commit bcf876870b95592b52519ed4aafcf9d95999bc9c Author: Linus Torvalds Date: Sun Aug 2 14:21:45 2020 -0700 Linux 5.8 commit 5a30a78924ecd97b0335d2e1d3e01a5023c1a3d8 Merge: 142c3326b055 bdd65589593e Author: Linus Torvalds Date: Sun Aug 2 13:10:42 2020 -0700 Merge tag 'x86-urgent-2020-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Ingo Molnar: "A single fix for a potential deadlock when printing a message about spurious interrupts" * tag 'x86-urgent-2020-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/i8259: Use printk_deferred() to prevent deadlock commit 142c3326b055a278c303bfef8dc6a105fff18ca6 Merge: 628e04dfeb4f 28ab576ba8de Author: Linus Torvalds Date: Sun Aug 2 11:23:51 2020 -0700 Merge tag 'kbuild-fixes-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - clean the generated moc file for xconfig - fix xconfig bugs, and revert some bad commits * tag 'kbuild-fixes-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: remove redundant FORCE definition in scripts/Makefile.modpost kconfig: qconf: remove wrong ConfigList::firstChild() Revert "kconfig: qconf: don't show goback button on splitMode" Revert "kconfig: qconf: Change title for the item window" kconfig: qconf: remove "goBack" debug message kconfig: qconf: use delete[] instead of delete to free array kconfig: qconf: compile moc object separately kconfig: qconf: use if_changed for qconf.moc rule modpost: explain why we can't use strsep commit 628e04dfeb4f66635c0d22cf1ad0cf427406e129 Merge: ac3a0c847296 830f01b089b1 Author: Linus Torvalds Date: Sun Aug 2 10:41:00 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM fixes from Paolo Bonzini: "Bugfixes and strengthening the validity checks on inputs from new userspace APIs. Now I know why I shouldn't prepare pull requests on the weekend, it's hard to concentrate if your son is shouting about his latest Minecraft builds in your ear. Fortunately all the patches were ready and I just had to check the test results..." * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: SVM: Fix disable pause loop exit/pause filtering capability on SVM KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled KVM: arm64: Don't inherit exec permission across page-table levels KVM: arm64: Prevent vcpu_has_ptrauth from generating OOL functions KVM: nVMX: check for invalid hdr.vmx.flags KVM: nVMX: check for required but missing VMCS12 in KVM_SET_NESTED_STATE selftests: kvm: do not set guest mode flag commit 28ab576ba8de934ee3145b6d75119f016de567cb Author: Masahiro Yamada Date: Sun Aug 2 22:54:40 2020 +0900 kbuild: remove redundant FORCE definition in scripts/Makefile.modpost The same code exists a few lines above. Fixes: 436b2ac603d5 ("modpost: invoke modpost only when input files are updated") Signed-off-by: Masahiro Yamada commit ccf56e5fe3d208883cd6db982197eac9b70a0bf9 Author: Masahiro Yamada Date: Sat Aug 1 16:08:50 2020 +0900 kconfig: qconf: remove wrong ConfigList::firstChild() This function returns the first child object, but the returned pointer is not compatible with (ConfigItem *). Commit cc1c08edccaf ("kconfig: qconf: don't show goback button on splitMode") uncovered this issue because using the pointer from this function would make qconf crash. (https://lkml.org/lkml/2020/7/18/411) This function does not work. Remove. Signed-off-by: Masahiro Yamada commit ac3a0c8472969a03c0496ae774b3a29eb26c8d5a Merge: 0ae3495b6502 fda2ec62cf1a Author: Linus Torvalds Date: Sat Aug 1 16:47:24 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from David Miller: 1) Encap offset calculation is incorrect in esp6, from Sabrina Dubroca. 2) Better parameter validation in pfkey_dump(), from Mark Salyzyn. 3) Fix several clang issues on powerpc in selftests, from Tanner Love. 4) cmsghdr_from_user_compat_to_kern() uses the wrong length, from Al Viro. 5) Out of bounds access in mlx5e driver, from Raed Salem. 6) Fix transfer buffer memleak in lan78xx, from Johan Havold. 7) RCU fixups in rhashtable, from Herbert Xu. 8) Fix ipv6 nexthop refcnt leak, from Xiyu Yang. 9) vxlan FDB dump must be done under RCU, from Ido Schimmel. 10) Fix use after free in mlxsw, from Ido Schimmel. 11) Fix map leak in HASH_OF_MAPS bpf code, from Andrii Nakryiko. 12) Fix bug in mac80211 Tx ack status reporting, from Vasanthakumar Thiagarajan. 13) Fix memory leaks in IPV6_ADDRFORM code, from Cong Wang. 14) Fix bpf program reference count leaks in mlx5 during mlx5e_alloc_rq(), from Xin Xiong. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (86 commits) vxlan: fix memleak of fdb rds: Prevent kernel-infoleak in rds_notify_queue_get() net/sched: The error lable position is corrected in ct_init_module net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq net/mlx5e: E-Switch, Specify flow_source for rule with no in_port net/mlx5e: E-Switch, Add misc bit when misc fields changed for mirroring net/mlx5e: CT: Support restore ipv6 tunnel net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe() ionic: unlock queue mutex in error path atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent net: ethernet: mtk_eth_soc: fix MTU warnings net: nixge: fix potential memory leak in nixge_probe() devlink: ignore -EOPNOTSUPP errors on dumpit rxrpc: Fix race between recvmsg and sendmsg on immediate call failure MAINTAINERS: Replace Thor Thayer as Altera Triple Speed Ethernet maintainer selftests/bpf: fix netdevsim trap_flow_action_cookie read ipv6: fix memory leaks on IPV6_ADDRFORM path net/bpfilter: Initialize pos in __bpfilter_process_sockopt igb: reinit_locked() should be called with rtnl_lock e1000e: continue to init PHY even when failed to disable ULP ... commit 0ae3495b6502cf93634cbd027cb2f6f9f83a406f Merge: bf121a0bda29 7665a47f70b3 Author: Linus Torvalds Date: Sat Aug 1 16:40:59 2020 -0700 Merge tag 'for-linus-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull thread fix from Christian Brauner: "A simple spelling fix for dequeue_synchronous_signal()" * tag 'for-linus-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: signal: fix typo in dequeue_synchronous_signal() commit bf121a0bda29daa67a1fcedbdf479f6b03c9f977 Merge: d52daa8620c6 39efdd94e314 Author: Linus Torvalds Date: Sat Aug 1 13:08:50 2020 -0700 Merge tag 'perf-tools-fixes-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tooling fixes from Arnaldo Carvalho de Melo: - Fix libtraceevent build with binutils 2.35 - Fix memory leak in process_dynamic_array_len in libtraceevent - Fix 'perf test 68' zstd compression for s390 - Fix record failure when mixed with ARM SPE event * tag 'perf-tools-fixes-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: libtraceevent: Fix build with binutils 2.35 perf tools: Fix record failure when mixed with ARM SPE event perf tests: Fix test 68 zstd compression for s390 tools lib traceevent: Fix memory leak in process_dynamic_array_len commit fda2ec62cf1aa7cbee52289dc8059cd3662795da Author: Taehee Yoo Date: Sat Aug 1 07:07:50 2020 +0000 vxlan: fix memleak of fdb When vxlan interface is deleted, all fdbs are deleted by vxlan_flush(). vxlan_flush() flushes fdbs but it doesn't delete fdb, which contains all-zeros-mac because it is deleted by vxlan_uninit(). But vxlan_uninit() deletes only the fdb, which contains both all-zeros-mac and default vni. So, the fdb, which contains both all-zeros-mac and non-default vni will not be deleted. Test commands: ip link add vxlan0 type vxlan dstport 4789 external ip link set vxlan0 up bridge fdb add to 00:00:00:00:00:00 dst 172.0.0.1 dev vxlan0 via lo \ src_vni 10000 self permanent ip link del vxlan0 kmemleak reports as follows: unreferenced object 0xffff9486b25ced88 (size 96): comm "bridge", pid 2151, jiffies 4294701712 (age 35506.901s) hex dump (first 32 bytes): 02 00 00 00 ac 00 00 01 40 00 09 b1 86 94 ff ff ........@....... 46 02 00 00 00 00 00 00 a7 03 00 00 12 b5 6a 6b F.............jk backtrace: [<00000000c10cf651>] vxlan_fdb_append.part.51+0x3c/0xf0 [vxlan] [<000000006b31a8d9>] vxlan_fdb_create+0x184/0x1a0 [vxlan] [<0000000049399045>] vxlan_fdb_update+0x12f/0x220 [vxlan] [<0000000090b1ef00>] vxlan_fdb_add+0x12a/0x1b0 [vxlan] [<0000000056633c2c>] rtnl_fdb_add+0x187/0x270 [<00000000dd5dfb6b>] rtnetlink_rcv_msg+0x264/0x490 [<00000000fc44dd54>] netlink_rcv_skb+0x4a/0x110 [<00000000dff433e7>] netlink_unicast+0x18e/0x250 [<00000000b87fb421>] netlink_sendmsg+0x2e9/0x400 [<000000002ed55153>] ____sys_sendmsg+0x237/0x260 [<00000000faa51c66>] ___sys_sendmsg+0x88/0xd0 [<000000006c3982f1>] __sys_sendmsg+0x4e/0x80 [<00000000a8f875d2>] do_syscall_64+0x56/0xe0 [<000000003610eefa>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 unreferenced object 0xffff9486b1c40080 (size 128): comm "bridge", pid 2157, jiffies 4294701754 (age 35506.866s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 f8 dc 42 b2 86 94 ff ff ..........B..... 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk backtrace: [<00000000a2981b60>] vxlan_fdb_create+0x67/0x1a0 [vxlan] [<0000000049399045>] vxlan_fdb_update+0x12f/0x220 [vxlan] [<0000000090b1ef00>] vxlan_fdb_add+0x12a/0x1b0 [vxlan] [<0000000056633c2c>] rtnl_fdb_add+0x187/0x270 [<00000000dd5dfb6b>] rtnetlink_rcv_msg+0x264/0x490 [<00000000fc44dd54>] netlink_rcv_skb+0x4a/0x110 [<00000000dff433e7>] netlink_unicast+0x18e/0x250 [<00000000b87fb421>] netlink_sendmsg+0x2e9/0x400 [<000000002ed55153>] ____sys_sendmsg+0x237/0x260 [<00000000faa51c66>] ___sys_sendmsg+0x88/0xd0 [<000000006c3982f1>] __sys_sendmsg+0x4e/0x80 [<00000000a8f875d2>] do_syscall_64+0x56/0xe0 [<000000003610eefa>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 3ad7a4b141eb ("vxlan: support fdb and learning in COLLECT_METADATA mode") Signed-off-by: Taehee Yoo Acked-by: Roopa Prabhu Signed-off-by: David S. Miller commit d52daa8620c65960e1ef882adc1f92061326bd7a Merge: 7dc6fd0f3b84 c3c0c2e18d94 Author: Linus Torvalds Date: Sat Aug 1 10:11:42 2020 -0700 Merge tag 'pinctrl-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fix from Linus Walleij: "A single last minute pin control fix to the Qualcomm driver fixing missing dual edge PCH interrupts" * tag 'pinctrl-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: qcom: Handle broken/missing PDC dual edge IRQs on sc7180 commit 4b20e103a63d056fb7a594b23d42ef8e0dbfc5ff Author: Masahiro Yamada Date: Sat Aug 1 16:08:49 2020 +0900 Revert "kconfig: qconf: don't show goback button on splitMode" This reverts commit cc1c08edccaf5317d99a17a3231fe06381044e83. Maxim Levitsky reports 'make xconfig' crashes since that commit (https://lkml.org/lkml/2020/7/18/411) Or, the following is simple test code that makes it crash: menu "Menu" config FOO bool "foo" default y menuconfig BAR bool "bar" depends on FOO endmenu Select the Split View mode, and double-click "bar" in the right window, then you will see Segmentation fault. When 'last' is not set for symbolMode, the following code in ConfigList::updateList() calls firstChild(). item = last ? last->nextSibling() : firstChild(); However, the pointer returned by ConfigList::firstChild() does not seem to be compatible with (ConfigItem *), which seems another bug. I'd rather want to reconsider whether hiding the goback icon is the right thing to do. In the following test code, the Split View shows "Menu2" and "Menu3" in the right window. You can descend into "Menu3", but there is no way to ascend back to "Menu2" from "Menu3". menu "Menu1" config FOO bool "foo" default y menu "Menu2" depends on FOO menu "Menu3" config BAZ bool "baz" endmenu endmenu endmenu It is true that the goback button is currently not functional due to yet another bug, but hiding the problem is not the right way to go. Anyway, Segmentation fault is fatal. Revert the offending commit for now, and we should find the right solution. Reported-by: Maxim Levitsky Signed-off-by: Masahiro Yamada commit 97bebbcd8b9368212e08913461bb511e35b46627 Author: Masahiro Yamada Date: Thu Jul 30 02:46:17 2020 +0900 Revert "kconfig: qconf: Change title for the item window" This reverts commit 5752ff07fd90d764d96e3c586cc95c09598abfdd. It added dead code to ConfigList:ConfigList(). The constructor of ConfigList has the initializer, mode(singleMode). if (mode == symbolMode) setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value"); else setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); ... always takes the else part. The change to ConfigList::updateSelection() is strange too. When you click the split view icon for the first time, the titles in both windows show "Option". After you click something in the right window, the title suddenly changes to "Item". ConfigList::updateSelection() is not the right place to do this, at least. It was not a good idea, I think. Signed-off-by: Masahiro Yamada commit ce02397f44e9ad36b14a29f3eeef252a6a8575c4 Author: Masahiro Yamada Date: Thu Jul 30 02:12:40 2020 +0900 kconfig: qconf: remove "goBack" debug message Every time the goback icon is clicked, the annoying message "goBack" is displayed on the console. I guess this line is the left-over debug code of commit af737b4defe1 ("kconfig: qconf: simplify the goBack() logic"). Signed-off-by: Masahiro Yamada commit c9b09a9249e6db802013c37a24af1fe45824cd3a Author: Masahiro Yamada Date: Thu Jul 30 02:02:39 2020 +0900 kconfig: qconf: use delete[] instead of delete to free array cppcheck reports "Mismatching allocation and deallocation". $ cppcheck scripts/kconfig/qconf.cc Checking scripts/kconfig/qconf.cc ... scripts/kconfig/qconf.cc:1242:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc] delete data; ^ scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and deallocation: data char *data = new char[count + 1]; ^ scripts/kconfig/qconf.cc:1242:10: note: Mismatching allocation and deallocation: data delete data; ^ scripts/kconfig/qconf.cc:1255:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc] delete data; ^ scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and deallocation: data char *data = new char[count + 1]; ^ scripts/kconfig/qconf.cc:1255:10: note: Mismatching allocation and deallocation: data delete data; ^ Fixes: c4f7398bee9c ("kconfig: qconf: make debug links work again") Reported-by: David Binderman Signed-off-by: Masahiro Yamada commit 0e912c03208075b95ea726076bf1b45db8419bc2 Author: Masahiro Yamada Date: Thu Jul 30 02:02:38 2020 +0900 kconfig: qconf: compile moc object separately Currently, qconf.moc is included from qconf.cc but they can be compiled independently. When you modify qconf.cc, qconf.moc does not need recompiling. Rename qconf.moc to qconf-moc.cc, and split it out as an independent compilation unit. Signed-off-by: Masahiro Yamada commit c3cd7cfad51ab521bf4c3edd050f3dcf275e9ee8 Author: Masahiro Yamada Date: Thu Jul 30 02:02:37 2020 +0900 kconfig: qconf: use if_changed for qconf.moc rule Regenerate qconf.moc when the moc command is changed. This also allows 'make mrproper' to clean it up. Previously, it was not cleaned up because 'clean-files += qconf.moc' was missing. Now 'make mrproper' correctly cleans it up because files listed in 'targets' are cleaned. Signed-off-by: Masahiro Yamada commit 69138b34a7248d2396ab85c8652e20c0c39beaba Merge: 8d46215a1ff3 4f010246b408 Author: David S. Miller Date: Fri Jul 31 17:19:47 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2020-07-31 The following pull-request contains BPF updates for your *net* tree. We've added 5 non-merge commits during the last 21 day(s) which contain a total of 5 files changed, 126 insertions(+), 18 deletions(-). The main changes are: 1) Fix a map element leak in HASH_OF_MAPS map type, from Andrii Nakryiko. 2) Fix a NULL pointer dereference in __btf_resolve_helper_id() when no btf_vmlinux is available, from Peilin Ye. 3) Init pos variable in __bpfilter_process_sockopt(), from Christoph Hellwig. 4) Fix a cgroup sockopt verifier test by specifying expected attach type, from Jean-Philippe Brucker. Note that when net gets merged into net-next later on, there is a small merge conflict in kernel/bpf/btf.c between commit 5b801dfb7feb ("bpf: Fix NULL pointer dereference in __btf_resolve_helper_id()") from the bpf tree and commit 138b9a0511c7 ("bpf: Remove btf_id helpers resolving") from the net-next tree. Resolve as follows: remove the old hunk with the __btf_resolve_helper_id() function. Change the btf_resolve_helper_id() so it actually tests for a NULL btf_vmlinux and bails out: int btf_resolve_helper_id(struct bpf_verifier_log *log, const struct bpf_func_proto *fn, int arg) { int id; if (fn->arg_type[arg] != ARG_PTR_TO_BTF_ID || !btf_vmlinux) return -EINVAL; id = fn->btf_id[arg]; if (!id || id > btf_vmlinux->nr_types) return -EINVAL; return id; } Let me know if you run into any others issues (CC'ing Jiri Olsa so he's in the loop with regards to merge conflict resolution). ==================== Signed-off-by: David S. Miller commit 8d46215a1ff37b83e80e573563066548fc82084d Merge: e535d87d8b4f 71b59bf482b2 Author: David S. Miller Date: Fri Jul 31 17:10:53 2020 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2020-07-31 1) Fix policy matching with mark and mask on userspace interfaces. From Xin Long. 2) Several fixes for the new ESP in TCP encapsulation. From Sabrina Dubroca. 3) Fix crash when the hold queue is used. The assumption that xdst->path and dst->child are not a NULL pointer only if dst->xfrm is not a NULL pointer is true with the exception of using the hold queue. Fix this by checking for hold queue usage before dereferencing xdst->path or dst->child. 4) Validate pfkey_dump parameter before sending them. From Mark Salyzyn. 5) Fix the location of the transport header with ESP in UDPv6 encapsulation. From Sabrina Dubroca. ==================== Signed-off-by: David S. Miller commit e535d87d8b4f85fe1659aa38c8fb75226b56eec5 Merge: bbc8a99e9522 e692139e6af3 Author: David S. Miller Date: Fri Jul 31 17:05:54 2020 -0700 Merge tag 'mlx5-fixes-2020-07-30' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2020-07-30 This small patchset introduces some fixes to mlx5 driver. Please pull and let me know if there is any problem. For -stable v4.18: ('net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq') For -stable v5.7: ('net/mlx5e: E-Switch, Add misc bit when misc fields changed for mirroring') ==================== Signed-off-by: David S. Miller commit bbc8a99e952226c585ac17477a85ef1194501762 Author: Peilin Ye Date: Thu Jul 30 15:20:26 2020 -0400 rds: Prevent kernel-infoleak in rds_notify_queue_get() rds_notify_queue_get() is potentially copying uninitialized kernel stack memory to userspace since the compiler may leave a 4-byte hole at the end of `cmsg`. In 2016 we tried to fix this issue by doing `= { 0 };` on `cmsg`, which unfortunately does not always initialize that 4-byte hole. Fix it by using memset() instead. Cc: stable@vger.kernel.org Fixes: f037590fff30 ("rds: fix a leak of kernel memory") Fixes: bdbe6fbc6a2f ("RDS: recv.c") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit dc096288d579c82efbf6f82a5d895fed6e41e5a6 Merge: 8c5c51f5cac6 024a8168b749 Author: David S. Miller Date: Fri Jul 31 16:51:58 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2020-07-30 This series contains updates to the e1000e and igb drivers. Aaron Ma allows PHY initialization to continue if ULP disable failed for e1000e. Francesco Ruggeri fixes race conditions in igb reset that could cause panics. ==================== Signed-off-by: David S. Miller commit 8c5c51f5cac676e9065cb6de9feaa3a16a462675 Author: liujian Date: Thu Jul 30 16:14:28 2020 +0800 net/sched: The error lable position is corrected in ct_init_module Exchange the positions of the err_tbl_init and err_register labels in ct_init_module function. Fixes: c34b961a2492 ("net/sched: act_ct: Create nf flow table per zone") Signed-off-by: liujian Signed-off-by: David S. Miller commit 7dc6fd0f3b8404542718039f5de19fe56e474578 Merge: deacdb3e3979 8808981baf96 Author: Linus Torvalds Date: Fri Jul 31 12:50:54 2020 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Some I2C core improvements to prevent NULL pointer usage and a MAINTAINERS update" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: slave: add sanity check when unregistering i2c: slave: improve sanity check when registering MAINTAINERS: Update GENI I2C maintainers list i2c: also convert placeholder function to return errno commit deacdb3e3979979016fcd0ffd518c320a62ad166 Merge: 14aab7eeb9f0 909adfc66b9a Author: Linus Torvalds Date: Fri Jul 31 09:38:39 2020 -0700 Merge tag 'powerpc-5.8-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: "Fix a bug introduced by the changes we made to lockless page table walking this cycle. When using the hash MMU, and perf with callchain recording, we can deadlock if the PMI interrupts a hash fault, and the callchain recording then takes a hash fault on the same page. Thanks to Nicholas Piggin, Aneesh Kumar K.V, Anton Blanchard, and Athira Rajeev" * tag 'powerpc-5.8-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s/hash: Fix hash_preload running with interrupts enabled commit 14aab7eeb9f0b9c424aab0f07eb82b1baf2e5bbd Merge: c1954ca6abdc 6a7389f0312f Author: Linus Torvalds Date: Fri Jul 31 09:36:03 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "The main one is to fix the build after Willy's per-cpu entropy changes this week. Although that was already resolved elsewhere, the arm64 fix here is useful cleanup anyway. Other than that, we've got a fix for building with Clang's integrated assembler and a fix to make our IPv4 checksumming robust against invalid header lengths (this only seems to be triggerable by injected errors). - Fix build breakage due to circular headers - Fix build regression when using Clang's integrated assembler - Fix IPv4 header checksum code to deal with invalid length field - Fix broken path for Arm PMU entry in MAINTAINERS" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: MAINTAINERS: Include drivers subdirs for ARM PMU PROFILING AND DEBUGGING entry arm64: csum: Fix handling of bad packets arm64: Drop unnecessary include from asm/smp.h arm64/alternatives: move length validation inside the subsection commit c1954ca6abdc69a02a768368eb31882e92cf5bfa Merge: ae2911de2eb5 5c6360ee4a0e Author: Linus Torvalds Date: Fri Jul 31 09:33:45 2020 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - avoid invoking overflow handler for uaccess watchpoints - fix incorrect clock_gettime64 availability - fix EFI crash in create_mapping_late() * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8988/1: mmu: fix crash in EFI calls due to p4d typo in create_mapping_late() ARM: 8987/1: VDSO: Fix incorrect clock_gettime64 ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints commit ae2911de2eb5dc9ccb88c6502c776a8fbb7acc67 Merge: 78431ab723aa fb448ce87a4a Author: Linus Torvalds Date: Fri Jul 31 09:22:10 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Two more merge window regressions, a corruption bug in hfi1 and a few other small fixes. - Missing user input validation regression in ucma - Disallowing a previously allowed user combination regression in mlx5 - ODP prefetch memory leaking triggerable by userspace - Memory corruption in hf1 due to faulty ring buffer logic - Missed mutex initialization crash in mlx5 - Two small defects with RDMA DIM" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/core: Free DIM memory in error unwind RDMA/core: Stop DIM before destroying CQ RDMA/mlx5: Initialize QP mutex for the debug kernels IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE RDMA/mlx5: Allow providing extra scatter CQE QP flag RDMA/mlx5: Fix prefetch memory leak if get_prefetchable_mr fails RDMA/cm: Add min length checks to user structure copies commit 78431ab723aa6f10258979acf88d9aaac2462cbe Merge: d8b9faec54ae 5649625344fe Author: Linus Torvalds Date: Fri Jul 31 09:17:24 2020 -0700 Merge tag 'sound-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A few wrap-up small fixes for the usual HD-audio and USB-audio stuff: - A regression fix for S3 suspend on old Intel platforms - A fix for possible Oops in ASoC HD-audio binding - Trivial quirks for various devices" * tag 'sound-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Fixed HP right speaker no sound ALSA: hda: fix NULL pointer dereference during suspend ALSA: hda/hdmi: Fix keep_power assignment for non-component devices ALSA: hda: Workaround for spurious wakeups on some Intel platforms ALSA: hda/realtek: Fix add a "ultra_low_power" function for intel reference board (alc256) ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus G14(GA401) series with ALC289 ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series with ALC289 ALSA: usb-audio: Add implicit feedback quirk for SSL2 commit 39efdd94e314336f4acbac4c07e0f37bdc3bef71 Author: Ben Hutchings Date: Sat Jul 25 02:06:23 2020 +0100 libtraceevent: Fix build with binutils 2.35 In binutils 2.35, 'nm -D' changed to show symbol versions along with symbol names, with the usual @@ separator. When generating libtraceevent-dynamic-list we need just the names, so strip off the version suffix if present. Signed-off-by: Ben Hutchings Tested-by: Salvatore Bonaccorso Reviewed-by: Steven Rostedt Cc: linux-trace-devel@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bd3c628f8fafa6cbd6a1ca440034b841f0080160 Author: Wei Li Date: Fri Jul 24 15:11:10 2020 +0800 perf tools: Fix record failure when mixed with ARM SPE event When recording with cache-misses and arm_spe_x event, I found that it will just fail without showing any error info if i put cache-misses after 'arm_spe_x' event. [root@localhost 0620]# perf record -e cache-misses \ -e arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.067 MB perf.data ] [root@localhost 0620]# [root@localhost 0620]# perf record -e arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ \ -e cache-misses sleep 1 [root@localhost 0620]# The current code can only work if the only event to be traced is an 'arm_spe_x', or if it is the last event to be specified. Otherwise the last event type will be checked against all the arm_spe_pmus[i]->types, none will match and an out of bound 'i' index will be used in arm_spe_recording_init(). We don't support concurrent multiple arm_spe_x events currently, that is checked in arm_spe_recording_options(), and it will show the relevant info. So add the check and record of the first found 'arm_spe_pmu' to fix this issue here. Fixes: ffd3d18c20b8 ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") Signed-off-by: Wei Li Reviewed-by: Mathieu Poirier Tested-by-by: Leo Yan Cc: Alexander Shishkin Cc: Hanjun Guo Cc: Jiri Olsa Cc: Kim Phillips Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200724071111.35593-2-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 463538a383a27337cb83ae195e432a839a52d639 Author: Thomas Richter Date: Wed Jul 29 15:53:14 2020 +0200 perf tests: Fix test 68 zstd compression for s390 Commit 5aa98879efe7 ("s390/cpum_sf: prohibit callchain data collection") prohibits call graph sampling for hardware events on s390. The information recorded is out of context and does not match. On s390 this commit now breaks test case 68 Zstd perf.data compression/decompression. Therefore omit call graph sampling on s390 in this test. Output before: [root@t35lp46 perf]# ./perf test -Fv 68 68: Zstd perf.data compression/decompression : --- start --- Collecting compressed record file: Error: cycles: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' ---- end ---- Zstd perf.data compression/decompression: FAILED! [root@t35lp46 perf]# Output after: [root@t35lp46 perf]# ./perf test -Fv 68 68: Zstd perf.data compression/decompression : --- start --- Collecting compressed record file: 500+0 records in 500+0 records out 256000 bytes (256 kB, 250 KiB) copied, 0.00615638 s, 41.6 MB/s [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.004 MB /tmp/perf.data.X3M, compressed (original 0.002 MB, ratio is 3.609) ] Checking compressed events stats: # compressed : Zstd, level = 1, ratio = 4 COMPRESSED events: 1 2ELIFREPh---- end ---- Zstd perf.data compression/decompression: Ok [root@t35lp46 perf]# Signed-off-by: Thomas Richter Reviewed-by: Sumanth Korikkar Cc: Heiko Carstens Cc: Sven Schnelle Cc: Vasily Gorbik Link: http://lore.kernel.org/lkml/20200729135314.91281-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit e24c6447ccb7b1a01f9bf0aec94939e6450c0b4d Author: Philippe Duplessis-Guindon Date: Thu Jul 30 11:02:36 2020 -0400 tools lib traceevent: Fix memory leak in process_dynamic_array_len I compiled with AddressSanitizer and I had these memory leaks while I was using the tep_parse_format function: Direct leak of 28 byte(s) in 4 object(s) allocated from: #0 0x7fb07db49ffe in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe) #1 0x7fb07a724228 in extend_token /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:985 #2 0x7fb07a724c21 in __read_token /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:1140 #3 0x7fb07a724f78 in read_token /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:1206 #4 0x7fb07a725191 in __read_expect_type /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:1291 #5 0x7fb07a7251df in read_expect_type /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:1299 #6 0x7fb07a72e6c8 in process_dynamic_array_len /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:2849 #7 0x7fb07a7304b8 in process_function /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:3161 #8 0x7fb07a730900 in process_arg_token /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:3207 #9 0x7fb07a727c0b in process_arg /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:1786 #10 0x7fb07a731080 in event_read_print_args /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:3285 #11 0x7fb07a731722 in event_read_print /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:3369 #12 0x7fb07a740054 in __tep_parse_format /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:6335 #13 0x7fb07a74047a in __parse_event /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:6389 #14 0x7fb07a740536 in tep_parse_format /home/pduplessis/repo/linux/tools/lib/traceevent/event-parse.c:6431 #15 0x7fb07a785acf in parse_event ../../../src/fs-src/fs.c:251 #16 0x7fb07a785ccd in parse_systems ../../../src/fs-src/fs.c:284 #17 0x7fb07a786fb3 in read_metadata ../../../src/fs-src/fs.c:593 #18 0x7fb07a78760e in ftrace_fs_source_init ../../../src/fs-src/fs.c:727 #19 0x7fb07d90c19c in add_component_with_init_method_data ../../../../src/lib/graph/graph.c:1048 #20 0x7fb07d90c87b in add_source_component_with_initialize_method_data ../../../../src/lib/graph/graph.c:1127 #21 0x7fb07d90c92a in bt_graph_add_source_component ../../../../src/lib/graph/graph.c:1152 #22 0x55db11aa632e in cmd_run_ctx_create_components_from_config_components ../../../src/cli/babeltrace2.c:2252 #23 0x55db11aa6fda in cmd_run_ctx_create_components ../../../src/cli/babeltrace2.c:2347 #24 0x55db11aa780c in cmd_run ../../../src/cli/babeltrace2.c:2461 #25 0x55db11aa8a7d in main ../../../src/cli/babeltrace2.c:2673 #26 0x7fb07d5460b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) The token variable in the process_dynamic_array_len function is allocated in the read_expect_type function, but is not freed before calling the read_token function. Free the token variable before calling read_token in order to plug the leak. Signed-off-by: Philippe Duplessis-Guindon Reviewed-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/linux-trace-devel/20200730150236.5392-1-pduplessis@efficios.com Signed-off-by: Arnaldo Carvalho de Melo commit 830f01b089b12bbe93bd55f2d62837253012a30e Author: Wanpeng Li Date: Fri Jul 31 11:12:21 2020 +0800 KVM: SVM: Fix disable pause loop exit/pause filtering capability on SVM 'Commit 8566ac8b8e7c ("KVM: SVM: Implement pause loop exit logic in SVM")' drops disable pause loop exit/pause filtering capability completely, I guess it is a merge fault by Radim since disable vmexits capabilities and pause loop exit for SVM patchsets are merged at the same time. This patch reintroduces the disable pause loop exit/pause filtering capability support. Reported-by: Haiwei Li Tested-by: Haiwei Li Fixes: 8566ac8b ("KVM: SVM: Implement pause loop exit logic in SVM") Signed-off-by: Wanpeng Li Message-Id: <1596165141-28874-3-git-send-email-wanpengli@tencent.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit d2286ba7d574ba3103a421a2f9ec17cb5b0d87a1 Author: Wanpeng Li Date: Fri Jul 31 11:12:19 2020 +0800 KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled Prevent setting the tscdeadline timer if the lapic is hw disabled. Fixes: bce87cce88 (KVM: x86: consolidate different ways to test for in-kernel LAPIC) Cc: Signed-off-by: Wanpeng Li Message-Id: <1596165141-28874-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit d8b9faec54ae4bc2fff68bcd0befa93ace8256ce Merge: a2ec905d1e16 887c909dd5d5 Author: Linus Torvalds Date: Thu Jul 30 21:26:42 2020 -0700 Merge tag 'drm-fixes-2020-07-31' of git://anongit.freedesktop.org/drm/drm Pull more drm fixes from Dave Airlie: "As mentioned previously this contains the nouveau regression fix. amdgpu had three fixes outstanding as well, one revert, an info leak and use after free. The use after free is a bit trickier than I'd like, and I've personally gone over it to confirm I'm happy that it is doing what it says. nouveau: - final modifiers regression fix amdgpu: - Revert a fix which caused other regressions - Fix potential kernel info leak - Fix a use-after-free bug that was uncovered by another change in 5.7" * tag 'drm-fixes-2020-07-31' of git://anongit.freedesktop.org/drm/drm: drm/nouveau: Accept 'legacy' format modifiers Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers" drm/amd/display: Clear dm_state for fast updates drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl() commit 887c909dd5d557c203a233ebbe238c18438a680a Merge: faa0fcf943d2 87004abfbc27 Author: Dave Airlie Date: Fri Jul 31 13:04:00 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-07-30' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-07-30: amdgpu: - Revert a fix which caused other regressions - Fix potential kernel info leak - Fix a use-after-free bug that was uncovered by another change in 5.7 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200730154338.244104-1-alexander.deucher@amd.com commit faa0fcf943d2d53992b3c73752df9a0547cb4797 Author: James Jones Date: Thu Jul 30 16:58:23 2020 -0700 drm/nouveau: Accept 'legacy' format modifiers Accept the DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK() family of modifiers to handle broken userspace Xorg modesetting and Mesa drivers. Existing Mesa drivers are still aware of only these older format modifiers which do not differentiate between different variations of the block linear layout. When the format modifier support flag was flipped in the nouveau kernel driver, the X.org modesetting driver began attempting to use its format modifier-enabled framebuffer path. Because the set of format modifiers advertised by the kernel prior to this change do not intersect with the set of format modifiers advertised by Mesa, allocating GBM buffers using format modifiers fails and the modesetting driver falls back to non-modifier allocation. However, it still later queries the modifier of the GBM buffer when creating its DRM-KMS framebuffer object, receives the old-format modifier from Mesa, and attempts to create a framebuffer with it. Since the kernel is still not aware of these formats, this fails. Userspace should not be attempting to query format modifiers of GBM buffers allocated with a non- format-modifier-aware allocation path, but to avoid breaking existing userspace behavior, this change accepts the old-style format modifiers when creating framebuffers and applying them to planes by translating them to the equivalent new-style modifier. To accomplish this, some layout parameters must be assumed to match properties of the device targeted by the relevant ioctls. To avoid perpetuating misuse of the old-style modifiers, this change does not advertise support for them. Doing so would imply compatibility between devices with incompatible memory layouts. Tested with Xorg 1.20 modesetting driver, weston@c46c70dac84a4b3030cd05b380f9f410536690fc, gnome & KDE wayland desktops from Ubuntu 18.04, and sway 1.5 Reported-by: Kirill A. Shutemov Fixes: fa4f4c213f5f ("drm/nouveau/kms: Support NVIDIA format modifiers") Link: https://lkml.org/lkml/2020/6/30/1251 Signed-off-by: James Jones Acked-by: Ben Skeggs Signed-off-by: Dave Airlie commit e692139e6af339a1495ef401b2d95f7f9d1c7a44 Author: Xin Xiong Date: Thu Jul 30 18:29:41 2020 +0800 net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq The function invokes bpf_prog_inc(), which increases the reference count of a bpf_prog object "rq->xdp_prog" if the object isn't NULL. The refcount leak issues take place in two error handling paths. When either mlx5_wq_ll_create() or mlx5_wq_cyc_create() fails, the function simply returns the error code and forgets to drop the reference count increased earlier, causing a reference count leak of "rq->xdp_prog". Fix this issue by jumping to the error handling path err_rq_wq_destroy while either function fails. Fixes: 422d4c401edd ("net/mlx5e: RX, Split WQ objects for different RQ types") Signed-off-by: Xin Xiong Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: Saeed Mahameed commit 6f7bbad18e8343da6318654f408dea0ccd6efb00 Author: Jianbo Liu Date: Fri Jul 3 02:34:23 2020 +0000 net/mlx5e: E-Switch, Specify flow_source for rule with no in_port The flow_source must be specified, even for rule without matching source vport, because some actions are only allowed in uplink. Otherwise, rule can't be offloaded and firmware syndrome happens. Fixes: 6fb0701a9cfa ("net/mlx5: E-Switch, Add support for offloading rules with no in_port") Signed-off-by: Jianbo Liu Reviewed-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 0faddfe6b7953e224a1283f89f671ef6a9ba73de Author: Jianbo Liu Date: Thu Jul 2 01:06:37 2020 +0000 net/mlx5e: E-Switch, Add misc bit when misc fields changed for mirroring The modified flow_context fields in FTE must be indicated in modify_enable bitmask. Previously, the misc bit in modify_enable is always set as source vport must be set for each rule. So, when parsing vxlan/gre/geneve/qinq rules, this bit is not set because those are all from the same misc fileds that source vport fields are located at, and we don't need to set the indicator twice. After adding per vport tables for mirroring, misc bit is not set, then firmware syndrome happens. To fix it, set the bit wherever misc fileds are changed. This also makes it unnecessary to check misc fields and set the misc bit accordingly in metadata matching, so here remove it. Besides, flow_source must be specified for uplink because firmware will check it and some actions are only allowed for packets received from uplink. Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for mirroring") Signed-off-by: Jianbo Liu Reviewed-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 01cefbbe2c51fa94d4221ca63d236907c5e19fe3 Author: Jianbo Liu Date: Mon Jul 20 01:36:45 2020 +0000 net/mlx5e: CT: Support restore ipv6 tunnel Currently the driver restores only IPv4 tunnel headers. Add support for restoring IPv6 tunnel header. Fixes: b8ce90370977 ("net/mlx5e: Restore tunnel metadata on miss") Signed-off-by: Jianbo Liu Reviewed-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit d0c3c75d5d8911b0e92e48ce79b827ad869d5c93 Merge: 85496a292241 04e35caa32ec Author: David S. Miller Date: Thu Jul 30 17:47:34 2020 -0700 Merge tag 'mac80211-for-davem-2020-07-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== A couple of more changes: * remove a warning that can trigger in certain races * check a function pointer before using it * check before adding 6 GHz to avoid a warning in mesh * fix two memory leaks in mesh * fix a TX status bug leading to a memory leak ==================== Signed-off-by: David S. Miller commit 85496a29224188051b6135eb38da8afd4c584765 Author: Wang Hai Date: Thu Jul 30 15:30:00 2020 +0800 net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe() Fix the missing clk_disable_unprepare() before return from gemini_ethernet_port_probe() in the error handling case. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit 59929fbb45e06da7d501d3a97f10a91912181f7c Author: Shannon Nelson Date: Wed Jul 29 10:52:17 2020 -0700 ionic: unlock queue mutex in error path On an error return, jump to the unlock at the end to be sure to unlock the queue_lock mutex. Fixes: 0925e9db4dc8 ("ionic: use mutex to protect queue operations") Reported-by: kernel test robot Reported-by: Julia Lawall Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 51875dad43b44241b46a569493f1e4bfa0386d86 Author: Xin Xiong Date: Wed Jul 29 21:06:59 2020 +0800 atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent atmtcp_remove_persistent() invokes atm_dev_lookup(), which returns a reference of atm_dev with increased refcount or NULL if fails. The refcount leaks issues occur in two error handling paths. If dev_data->persist is zero or PRIV(dev)->vcc isn't NULL, the function returns 0 without decreasing the refcount kept by a local variable, resulting in refcount leaks. Fix the issue by adding atm_dev_put() before returning 0 both when dev_data->persist is zero or PRIV(dev)->vcc isn't NULL. Signed-off-by: Xin Xiong Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: David S. Miller commit 555a893303872e044fb86f0a5834ce78d41ad2e2 Author: Landen Chao Date: Wed Jul 29 10:15:17 2020 +0200 net: ethernet: mtk_eth_soc: fix MTU warnings in recent kernel versions there are warnings about incorrect MTU size like these: eth0: mtu greater than device maximum mtk_soc_eth 1b100000.ethernet eth0: error -22 setting MTU to include DSA overhead Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports") Fixes: 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") Fixes: 7a4c53bee332 ("net: report invalid mtu value via netlink extack") Signed-off-by: Landen Chao Signed-off-by: Frank Wunderlich Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 366228ed01f6882cc203e3d5b40010dfae0be1c3 Author: Lu Wei Date: Wed Jul 29 11:50:05 2020 +0800 net: nixge: fix potential memory leak in nixge_probe() If some processes in nixge_probe() fail, free_netdev(dev) needs to be called to aviod a memory leak. Fixes: 87ab207981ec ("net: nixge: Separate ctrl and dma resources") Fixes: abcd3d6fc640 ("net: nixge: Fix error path for obtaining mac address") Reported-by: Hulk Robot Signed-off-by: Lu Wei Signed-off-by: David S. Miller commit 82274d075536322368ce710b211c41c37c4740b9 Author: Jakub Kicinski Date: Tue Jul 28 16:15:07 2020 -0700 devlink: ignore -EOPNOTSUPP errors on dumpit Number of .dumpit functions try to ignore -EOPNOTSUPP errors. Recent change missed that, and started reporting all errors but -EMSGSIZE back from dumps. This leads to situation like this: $ devlink dev info devlink answers: Operation not supported Dump should not report an error just because the last device to be queried could not provide an answer. To fix this and avoid similar confusion make sure we clear err properly, and not leave it set to an error if we don't terminate the iteration. Fixes: c62c2cfb801b ("net: devlink: don't ignore errors during dumpit") Signed-off-by: Jakub Kicinski Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 65550098c1c4db528400c73acf3e46bfa78d9264 Author: David Howells Date: Wed Jul 29 00:03:56 2020 +0100 rxrpc: Fix race between recvmsg and sendmsg on immediate call failure There's a race between rxrpc_sendmsg setting up a call, but then failing to send anything on it due to an error, and recvmsg() seeing the call completion occur and trying to return the state to the user. An assertion fails in rxrpc_recvmsg() because the call has already been released from the socket and is about to be released again as recvmsg deals with it. (The recvmsg_q queue on the socket holds a ref, so there's no problem with use-after-free.) We also have to be careful not to end up reporting an error twice, in such a way that both returns indicate to userspace that the user ID supplied with the call is no longer in use - which could cause the client to malfunction if it recycles the user ID fast enough. Fix this by the following means: (1) When sendmsg() creates a call after the point that the call has been successfully added to the socket, don't return any errors through sendmsg(), but rather complete the call and let recvmsg() retrieve them. Make sendmsg() return 0 at this point. Further calls to sendmsg() for that call will fail with ESHUTDOWN. Note that at this point, we haven't send any packets yet, so the server doesn't yet know about the call. (2) If sendmsg() returns an error when it was expected to create a new call, it means that the user ID wasn't used. (3) Mark the call disconnected before marking it completed to prevent an oops in rxrpc_release_call(). (4) recvmsg() will then retrieve the error and set MSG_EOR to indicate that the user ID is no longer known by the kernel. An oops like the following is produced: kernel BUG at net/rxrpc/recvmsg.c:605! ... RIP: 0010:rxrpc_recvmsg+0x256/0x5ae ... Call Trace: ? __init_waitqueue_head+0x2f/0x2f ____sys_recvmsg+0x8a/0x148 ? import_iovec+0x69/0x9c ? copy_msghdr_from_user+0x5c/0x86 ___sys_recvmsg+0x72/0xaa ? __fget_files+0x22/0x57 ? __fget_light+0x46/0x51 ? fdget+0x9/0x1b do_recvmmsg+0x15e/0x232 ? _raw_spin_unlock+0xa/0xb ? vtime_delta+0xf/0x25 __x64_sys_recvmmsg+0x2c/0x2f do_syscall_64+0x4c/0x78 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 357f5ef64628 ("rxrpc: Call rxrpc_release_call() on error in rxrpc_new_client_call()") Reported-by: syzbot+b54969381df354936d96@syzkaller.appspotmail.com Signed-off-by: David Howells Reviewed-by: Marc Dionne Signed-off-by: David S. Miller commit 591eee6d0783d4a0d7f0e7c4effdba9cf6c1e2c5 Author: Joyce Ooi Date: Mon Jul 27 17:46:41 2020 +0800 MAINTAINERS: Replace Thor Thayer as Altera Triple Speed Ethernet maintainer This patch is to replace Thor Thayer as Altera Triple Speed Ethernet maintainer as he is moving to a different role. Signed-off-by: Joyce Ooi Signed-off-by: David S. Miller commit 4bbca662df2523ff7ad3224463f1f28e6a118044 Author: Hangbin Liu Date: Mon Jul 27 19:04:55 2020 +0800 selftests/bpf: fix netdevsim trap_flow_action_cookie read When read netdevsim trap_flow_action_cookie, we need to init it first, or we will get "Invalid argument" error. Fixes: d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 8c0de6e96c9794cb523a516c465991a70245da1c Author: Cong Wang Date: Sat Jul 25 15:40:53 2020 -0700 ipv6: fix memory leaks on IPV6_ADDRFORM path IPV6_ADDRFORM causes resource leaks when converting an IPv6 socket to IPv4, particularly struct ipv6_ac_socklist. Similar to struct ipv6_mc_socklist, we should just close it on this path. This bug can be easily reproduced with the following C program: #include #include #include #include #include int main() { int s, value; struct sockaddr_in6 addr; struct ipv6_mreq m6; s = socket(AF_INET6, SOCK_DGRAM, 0); addr.sin6_family = AF_INET6; addr.sin6_port = htons(5000); inet_pton(AF_INET6, "::ffff:192.168.122.194", &addr.sin6_addr); connect(s, (struct sockaddr *)&addr, sizeof(addr)); inet_pton(AF_INET6, "fe80::AAAA", &m6.ipv6mr_multiaddr); m6.ipv6mr_interface = 5; setsockopt(s, SOL_IPV6, IPV6_JOIN_ANYCAST, &m6, sizeof(m6)); value = AF_INET; setsockopt(s, SOL_IPV6, IPV6_ADDRFORM, &value, sizeof(value)); close(s); return 0; } Reported-by: ch3332xr@gmail.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 4f010246b4087ab931b060481014ec110e6a8a46 Author: Christoph Hellwig Date: Thu Jul 30 18:09:00 2020 +0200 net/bpfilter: Initialize pos in __bpfilter_process_sockopt __bpfilter_process_sockopt never initialized the pos variable passed to the pipe write. This has been mostly harmless in the past as pipes ignore the offset, but the switch to kernel_write now verified the position, which can lead to a failure depending on the exact stack initialization pattern. Initialize the variable to zero to make rw_verify_area happy. Fixes: 6955a76fbcd5 ("bpfilter: switch to kernel_write") Reported-by: Christian Brauner Reported-by: Rodrigo Madera Signed-off-by: Christoph Hellwig Signed-off-by: Daniel Borkmann Tested-by: Rodrigo Madera Tested-by: Christian Brauner Reviewed-by: Christian Brauner Link: https://lore.kernel.org/bpf/20200730160900.187157-1-hch@lst.de commit d741dcae5562259841bd2211a0bd7e6c0f909f1e Merge: 5e105c88ab48 b757b47a2fcb Author: Paolo Bonzini Date: Thu Jul 30 18:10:26 2020 -0400 Merge tag 'kvmarm-fixes-5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm64 fixes for Linux 5.8, take #3 - Fix a corner case of a new mapping inheriting exec permission without and yet bypassing invalidation of the I-cache - Make sure PtrAuth predicates oinly generate inline code for the non-VHE hypervisor code commit a2ec905d1e160a33b2e210e45ad30445ef26ce0e Author: Alain Michaud Date: Mon Jul 27 20:48:55 2020 +0000 Bluetooth: fix kernel oops in store_pending_adv_report Fix kernel oops observed when an ext adv data is larger than 31 bytes. This can be reproduced by setting up an advertiser with advertisement larger than 31 bytes. The issue is not sensitive to the advertisement content. In particular, this was reproduced with an advertisement of 229 bytes filled with 'A'. See stack trace below. This is fixed by not catching ext_adv as legacy adv are only cached to be able to concatenate a scanable adv with its scan response before sending it up through mgmt. With ext_adv, this is no longer necessary. general protection fault: 0000 [#1] SMP PTI CPU: 6 PID: 205 Comm: kworker/u17:0 Not tainted 5.4.0-37-generic #41-Ubuntu Hardware name: Dell Inc. XPS 15 7590/0CF6RR, BIOS 1.7.0 05/11/2020 Workqueue: hci0 hci_rx_work [bluetooth] RIP: 0010:hci_bdaddr_list_lookup+0x1e/0x40 [bluetooth] Code: ff ff e9 26 ff ff ff 0f 1f 44 00 00 0f 1f 44 00 00 55 48 8b 07 48 89 e5 48 39 c7 75 0a eb 24 48 8b 00 48 39 f8 74 1c 44 8b 06 <44> 39 40 10 75 ef 44 0f b7 4e 04 66 44 39 48 14 75 e3 38 50 16 75 RSP: 0018:ffffbc6a40493c70 EFLAGS: 00010286 RAX: 4141414141414141 RBX: 000000000000001b RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff9903e76c100f RDI: ffff9904289d4b28 RBP: ffffbc6a40493c70 R08: 0000000093570362 R09: 0000000000000000 R10: 0000000000000000 R11: ffff9904344eae38 R12: ffff9904289d4000 R13: 0000000000000000 R14: 00000000ffffffa3 R15: ffff9903e76c100f FS: 0000000000000000(0000) GS:ffff990434580000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007feed125a000 CR3: 00000001b860a003 CR4: 00000000003606e0 Call Trace: process_adv_report+0x12e/0x560 [bluetooth] hci_le_meta_evt+0x7b2/0xba0 [bluetooth] hci_event_packet+0x1c29/0x2a90 [bluetooth] hci_rx_work+0x19b/0x360 [bluetooth] process_one_work+0x1eb/0x3b0 worker_thread+0x4d/0x400 kthread+0x104/0x140 Fixes: c215e9397b00 ("Bluetooth: Process extended ADV report event") Reported-by: Andy Nguyen Reported-by: Linus Torvalds Reported-by: Balakrishna Godavarthi Signed-off-by: Alain Michaud Tested-by: Sonny Sasaka Acked-by: Marcel Holtmann Signed-off-by: Linus Torvalds commit 417385c47ef7ee0d4f48f63f70cca6c1ed6355f4 Merge: aa54ea903abb a96b0d061d47 Author: Linus Torvalds Date: Thu Jul 30 13:34:07 2020 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "A couple of last minute bugfixes" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio-mem: Fix build error due to improper use 'select' virtio_balloon: fix up endian-ness for free cmd id virtio-balloon: Document byte ordering of poison_val vhost/scsi: fix up req type endian-ness firmware: Fix a reference count leak. commit aa54ea903abb02303bf55855fb51e3fcee135d70 Author: Grygorii Strashko Date: Thu Jul 30 22:05:01 2020 +0300 ARM: percpu.h: fix build error Fix build error for the case: defined(CONFIG_SMP) && !defined(CONFIG_CPU_V6) config: keystone_defconfig CC arch/arm/kernel/signal.o In file included from ../include/linux/random.h:14, from ../arch/arm/kernel/signal.c:8: ../arch/arm/include/asm/percpu.h: In function ‘__my_cpu_offset’: ../arch/arm/include/asm/percpu.h:29:34: error: ‘current_stack_pointer’ undeclared (first use in this function); did you mean ‘user_stack_pointer’? : "Q" (*(const unsigned long *)current_stack_pointer)); ^~~~~~~~~~~~~~~~~~~~~ user_stack_pointer Fixes: f227e3ec3b5c ("random32: update the net random state on interrupt and activity") Signed-off-by: Grygorii Strashko Signed-off-by: Linus Torvalds commit d9644712a243ac47af4fe9cf65472d85c57753c7 Merge: e2c46b5762c6 b361663c5a40 Author: Linus Torvalds Date: Thu Jul 30 12:01:42 2020 -0700 Merge tag 'pci-v5.8-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fix from Bjorn Helgaas: "Disable ASPM on ASM1083/1085 PCIe-to-PCI bridge (Robert Hancock)" * tag 'pci-v5.8-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge commit 024a8168b749db7a4aa40a5fbdfa04bf7e77c1c0 Author: Francesco Ruggeri Date: Thu Jul 2 15:39:06 2020 -0700 igb: reinit_locked() should be called with rtnl_lock We observed two panics involving races with igb_reset_task. The first panic is caused by this race condition: kworker reboot -f igb_reset_task igb_reinit_locked igb_down napi_synchronize __igb_shutdown igb_clear_interrupt_scheme igb_free_q_vectors igb_free_q_vector adapter->q_vector[v_idx] = NULL; napi_disable Panics trying to access adapter->q_vector[v_idx].napi_state The second panic (a divide error) is caused by this race: kworker reboot -f tx packet igb_reset_task __igb_shutdown rtnl_lock() ... igb_clear_interrupt_scheme igb_free_q_vectors adapter->num_tx_queues = 0 ... rtnl_unlock() rtnl_lock() igb_reinit_locked igb_down igb_up netif_tx_start_all_queues dev_hard_start_xmit igb_xmit_frame igb_tx_queue_mapping Panics on r_idx % adapter->num_tx_queues This commit applies to igb_reset_task the same changes that were applied to ixgbe in commit 2f90b8657ec9 ("ixgbe: this patch adds support for DCB to the kernel and ixgbe driver"), commit 8f4c5c9fb87a ("ixgbe: reinit_locked() should be called with rtnl_lock") and commit 88adce4ea8f9 ("ixgbe: fix possible race in reset subtask"). Signed-off-by: Francesco Ruggeri Tested-by: Aaron Brown Signed-off-by: Tony Nguyen commit 1050242fa657093d3788c3ffa0bd9b42e4d7d1ab Author: Aaron Ma Date: Thu Jun 18 14:54:53 2020 +0800 e1000e: continue to init PHY even when failed to disable ULP After 'commit e086ba2fccda4 ("e1000e: disable s0ix entry and exit flows for ME systems")', ThinkPad P14s always failed to disable ULP by ME. 'commit 0c80cdbf3320 ("e1000e: Warn if disabling ULP failed")' break out of init phy: error log: [ 42.364753] e1000e 0000:00:1f.6 enp0s31f6: Failed to disable ULP [ 42.524626] e1000e 0000:00:1f.6 enp0s31f6: PHY Wakeup cause - Unicast Packet [ 42.822476] e1000e 0000:00:1f.6 enp0s31f6: Hardware Error When disable s0ix, E1000_FWSM_ULP_CFG_DONE will never be 1. If continue to init phy like before, it can work as before. iperf test result good too. Fixes: 0c80cdbf3320 ("e1000e: Warn if disabling ULP failed") Signed-off-by: Aaron Ma Tested-by: Aaron Brown Signed-off-by: Tony Nguyen commit e2c46b5762c616c249201688d3b9846627f78d2c Merge: 0513b9d75c07 d6364a867ccb Author: Linus Torvalds Date: Thu Jul 30 09:48:51 2020 -0700 Merge tag 'block-5.8-2020-07-30' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Three NVMe fixes" * tag 'block-5.8-2020-07-30' of git://git.kernel.dk/linux-block: nvme: add a Identify Namespace Identification Descriptor list quirk nvme-pci: prevent SK hynix PC400 from using Write Zeroes command nvme-tcp: fix possible hang waiting for icresp response commit 0513b9d75c07cbcdfda3778b636d3d131d679eb1 Merge: 1c9df907da83 4ae6dbd68386 Author: Linus Torvalds Date: Thu Jul 30 09:47:07 2020 -0700 Merge tag 'io_uring-5.8-2020-07-30' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Two small fixes for corner/error cases" * tag 'io_uring-5.8-2020-07-30' of git://git.kernel.dk/linux-block: io_uring: fix lockup in io_fail_links() io_uring: fix ->work corruption with poll_add commit 1c9df907da83812e4f33b59d3d142c864d9da57f Author: Willy Tarreau Date: Thu Jul 30 07:59:24 2020 +0200 random: fix circular include dependency on arm64 after addition of percpu.h Daniel Díaz and Kees Cook independently reported that commit f227e3ec3b5c ("random32: update the net random state on interrupt and activity") broke arm64 due to a circular dependency on include files since the addition of percpu.h in random.h. The correct fix would definitely be to move all the prandom32 stuff out of random.h but for backporting, a smaller solution is preferred. This one replaces linux/percpu.h with asm/percpu.h, and this fixes the problem on x86_64, arm64, arm, and mips. Note that moving percpu.h around didn't change anything and that removing it entirely broke differently. When backporting, such options might still be considered if this patch fails to help. [ It turns out that an alternate fix seems to be to just remove the troublesome remove from the arm64 that causes the circular dependency. But we might as well do the whole belt-and-suspenders thing, and minimize inclusion in too. Either will fix the problem, and both are good changes. - Linus ] Reported-by: Daniel Díaz Reported-by: Kees Cook Tested-by: Marc Zyngier Fixes: f227e3ec3b5c Cc: Stephen Rothwell Signed-off-by: Willy Tarreau Signed-off-by: Linus Torvalds commit 6a7389f0312f01bb6641d37b395548a2922a057c Author: John Garry Date: Wed Jun 17 19:17:28 2020 +0800 MAINTAINERS: Include drivers subdirs for ARM PMU PROFILING AND DEBUGGING entry Ensure that the ARM PMU PROFILING AND DEBUGGING maintainers are included for the HiSilicon PMU driver. Signed-off-by: John Garry Link: https://lore.kernel.org/r/1592392648-128331-1-git-send-email-john.garry@huawei.com Signed-off-by: Will Deacon commit 05fb3dbda187bbd9cc1cd0e97e5d6595af570ac6 Author: Robin Murphy Date: Thu Jul 30 10:56:49 2020 +0100 arm64: csum: Fix handling of bad packets Although iph is expected to point to at least 20 bytes of valid memory, ihl may be bogus, for example on reception of a corrupt packet. If it happens to be less than 5, we really don't want to run away and dereference 16GB worth of memory until it wraps back to exactly zero... Fixes: 0e455d8e80aa ("arm64: Implement optimised IP checksum helpers") Reported-by: guodeqing Signed-off-by: Robin Murphy Signed-off-by: Will Deacon commit 835d1c3a98799914db8aee0973018af21128cd1e Author: Marc Zyngier Date: Thu Jul 30 10:53:05 2020 +0100 arm64: Drop unnecessary include from asm/smp.h asm/pointer_auth.h is not needed anymore in asm/smp.h, as 62a679cb2825 ("arm64: simplify ptrauth initialization") removed the keys from the secondary_data structure. This also cures a compilation issue introduced by f227e3ec3b5c ("random32: update the net random state on interrupt and activity"). Fixes: 62a679cb2825 ("arm64: simplify ptrauth initialization") Fixes: f227e3ec3b5c ("random32: update the net random state on interrupt and activity") Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 966a0acce2fca776391823381dba95c40e03c339 Author: Sami Tolvanen Date: Thu Jul 30 08:37:01 2020 -0700 arm64/alternatives: move length validation inside the subsection Commit f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") breaks LLVM's integrated assembler, because due to its one-pass design, it cannot compute instruction sequence lengths before the layout for the subsection has been finalized. This change fixes the build by moving the .org directives inside the subsection, so they are processed after the subsection layout is known. Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") Signed-off-by: Sami Tolvanen Link: https://github.com/ClangBuiltLinux/linux/issues/1078 Link: https://lore.kernel.org/r/20200730153701.3892953-1-samitolvanen@google.com Signed-off-by: Will Deacon commit a96b0d061d476093cf86ca1c2de06fc57163588d Author: Weilong Chen Date: Fri Jun 19 16:03:33 2020 +0800 virtio-mem: Fix build error due to improper use 'select' As noted in: https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt "select should be used with care. select will force a symbol to a value without visiting the dependencies." Config VIRTIO_MEM should not select CONTIG_ALLOC directly. Otherwise it will cause an error: https://bugzilla.kernel.org/show_bug.cgi?id=208245 Signed-off-by: Weilong Chen Link: https://lore.kernel.org/r/20200619080333.194753-1-chenweilong@huawei.com Acked-by: Randy Dunlap # build-tested Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Acked-by: David Hildenbrand commit 87004abfbc27261edd15716515d89ab42198b405 Author: Alex Deucher Date: Thu Jul 30 11:02:30 2020 -0400 Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers" This regressed some working configurations so revert it. Will fix this properly for 5.9 and backport then. This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b. Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit fde9f39ac7f1ffd799a96ffa1e06b2051f0898f1 Author: Mazin Rezk Date: Mon Jul 27 05:40:46 2020 +0000 drm/amd/display: Clear dm_state for fast updates This patch fixes a race condition that causes a use-after-free during amdgpu_dm_atomic_commit_tail. This can occur when 2 non-blocking commits are requested and the second one finishes before the first. Essentially, this bug occurs when the following sequence of events happens: 1. Non-blocking commit #1 is requested w/ a new dm_state #1 and is deferred to the workqueue. 2. Non-blocking commit #2 is requested w/ a new dm_state #2 and is deferred to the workqueue. 3. Commit #2 starts before commit #1, dm_state #1 is used in the commit_tail and commit #2 completes, freeing dm_state #1. 4. Commit #1 starts after commit #2 completes, uses the freed dm_state 1 and dereferences a freelist pointer while setting the context. Since this bug has only been spotted with fast commits, this patch fixes the bug by clearing the dm_state instead of using the old dc_state for fast updates. In addition, since dm_state is only used for its dc_state and amdgpu_dm_atomic_commit_tail will retain the dc_state if none is found, removing the dm_state should not have any consequences in fast updates. This use-after-free bug has existed for a while now, but only caused a noticeable issue starting from 5.7-rc1 due to 3202fa62f ("slub: relocate freelist pointer to middle of object") moving the freelist pointer from dm_state->base (which was unused) to dm_state->context (which is dereferenced). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207383 Fixes: bd200d190f45 ("drm/amd/display: Don't replace the dc_state for fast updates") Reported-by: Duncan <1i5t5.duncan@cox.net> Signed-off-by: Mazin Rezk Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 543e8669ed9bfb30545fd52bc0e047ca4df7fb31 Author: Peilin Ye Date: Tue Jul 28 15:29:24 2020 -0400 drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl() Compiler leaves a 4-byte hole near the end of `dev_info`, causing amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace when `size` is greater than 356. In 2015 we tried to fix this issue by doing `= {};` on `dev_info`, which unfortunately does not initialize that 4-byte hole. Fix it by using memset() instead. Cc: stable@vger.kernel.org Fixes: c193fa91b918 ("drm/amdgpu: information leak in amdgpu_info_ioctl()") Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Suggested-by: Dan Carpenter Reviewed-by: Christian König Signed-off-by: Peilin Ye Signed-off-by: Alex Deucher commit fb448ce87a4a9482b084e67faf804aec79ed9b43 Author: Leon Romanovsky Date: Thu Jul 30 11:27:19 2020 +0300 RDMA/core: Free DIM memory in error unwind The memory allocated for the DIM wasn't freed in in error unwind path, fix it by calling to rdma_dim_destroy(). Fixes: da6629793aa6 ("RDMA/core: Provide RDMA DIM support for ULPs") Link: https://lore.kernel.org/r/20200730082719.1582397-4-leon@kernel.org Signed-off-by: Leon Romanovsky Reviewed-by: Max Gurtovoy > Signed-off-by: Jason Gunthorpe commit 5d46b289d04b98eb992b2f8b67745cc0953e16b1 Author: Leon Romanovsky Date: Thu Jul 30 11:27:18 2020 +0300 RDMA/core: Stop DIM before destroying CQ HW destroy operation should be last operation after all possible CQ users completed their work, so move DIM work cancellation before such destroy call. Fixes: da6629793aa6 ("RDMA/core: Provide RDMA DIM support for ULPs") Link: https://lore.kernel.org/r/20200730082719.1582397-3-leon@kernel.org Reviewed-by: Max Gurtovoy Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7fa84b5708cf359efe43ce99fd1f3c8765cacd23 Author: Leon Romanovsky Date: Thu Jul 30 11:27:17 2020 +0300 RDMA/mlx5: Initialize QP mutex for the debug kernels In DCT and RSS RAW QP creation flows, the QP mutex wasn't initialized and the magic field inside lock was missing. This caused to the following kernel warning for kernels build with CONFIG_DEBUG_MUTEXES. DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: CPU: 3 PID: 16261 at kernel/locking/mutex.c:938 __mutex_lock+0x60e/0x940 Modules linked in: bonding nf_tables ipip tunnel4 geneve ip6_udp_tunnel udp_tunnel ip6_gre ip6_tunnel tunnel6 ip_gre gre ip_tunnel mlx5_ib mlx5_core mlxfw ptp pps_core rdma_ucm ib_uverbs ib_ipoib ib_umad openvswitch nsh xt_MASQUERADE nf_conntrack_netlink nfnetlink iptable_nat xt_addrtype xt_conntrack nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter overlay ib_srp scsi_transport_srp rpcrdma ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm ib_core [last unloaded: mlxfw] CPU: 3 PID: 16261 Comm: ib_send_bw Not tainted 5.8.0-rc4_for_upstream_min_debug_2020_07_08_22_04 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 RIP: 0010:__mutex_lock+0x60e/0x940 Code: c0 0f 84 6d fa ff ff 44 8b 15 4e 9d ba 00 45 85 d2 0f 85 5d fa ff ff 48 c7 c6 f2 de 2b 82 48 c7 c7 f1 8a 2b 82 e8 d2 4d 72 ff <0f> 0b 4c 8b 4d 88 e9 3f fa ff ff f6 c2 04 0f 84 37 fe ff ff 48 89 RSP: 0018:ffff88810bb8b870 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff88829f1dd880 RSI: 0000000000000000 RDI: ffffffff81192afa RBP: ffff88810bb8b910 R08: 0000000000000000 R09: 0000000000000028 R10: 0000000000000000 R11: 0000000000003f85 R12: 0000000000000002 R13: ffff88827d8d3ce0 R14: ffffffffa059f615 R15: ffff8882a4d02610 FS: 00007f3f6988e740(0000) GS:ffff8882f5b80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556556158000 CR3: 000000010a63c005 CR4: 0000000000360ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? cmd_exec+0x947/0xe60 [mlx5_core] ? __mutex_lock+0x76/0x940 ? mlx5_ib_qp_set_counter+0x25/0xa0 [mlx5_ib] mlx5_ib_qp_set_counter+0x25/0xa0 [mlx5_ib] mlx5_ib_counter_bind_qp+0x9b/0xe0 [mlx5_ib] __rdma_counter_bind_qp+0x6b/0xa0 [ib_core] rdma_counter_bind_qp_auto+0x363/0x520 [ib_core] _ib_modify_qp+0x316/0x580 [ib_core] ib_modify_qp_with_udata+0x19/0x30 [ib_core] modify_qp+0x4c4/0x600 [ib_uverbs] ib_uverbs_ex_modify_qp+0x87/0xe0 [ib_uverbs] ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x129/0x1c0 [ib_uverbs] ib_uverbs_cmd_verbs.isra.5+0x5d5/0x11f0 [ib_uverbs] ? ib_uverbs_handler_UVERBS_METHOD_QUERY_CONTEXT+0x120/0x120 [ib_uverbs] ? lock_acquire+0xb9/0x3a0 ? ib_uverbs_ioctl+0xd0/0x210 [ib_uverbs] ? ib_uverbs_ioctl+0x175/0x210 [ib_uverbs] ib_uverbs_ioctl+0x14b/0x210 [ib_uverbs] ? ib_uverbs_ioctl+0xd0/0x210 [ib_uverbs] ksys_ioctl+0x234/0x7d0 ? exc_page_fault+0x202/0x640 ? do_syscall_64+0x1f/0x2e0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x59/0x2e0 ? asm_exc_page_fault+0x8/0x30 ? rcu_read_lock_sched_held+0x52/0x60 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: b4aaa1f0b415 ("IB/mlx5: Handle type IB_QPT_DRIVER when creating a QP") Link: https://lore.kernel.org/r/20200730082719.1582397-2-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 04e35caa32ec9aae6b306d07f07dc2ee6d69166c Author: Felix Fietkau Date: Sat Jul 25 10:45:33 2020 +0200 mac80211: remove STA txq pending airtime underflow warning This warning can trigger if there is a mismatch between frames that were sent with the sta pointer set vs tx status frames reported for the sta address. This can happen due to race conditions on re-creating stations, or even in the case of .sta_add/remove being used instead of .sta_state, which can cause frames to be sent to a station that has not been uploaded yet. If there is an actual underflow issue, it should show up in the device airtime warning below, so it is better to remove this one. Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20200725084533.13829-1-nbd@nbd.name Signed-off-by: Johannes Berg commit e61fbfca8055eef18f11727f431e1e3e5221291e Author: Vasanthakumar Thiagarajan Date: Wed Jul 22 19:50:17 2020 +0530 mac80211: Fix bug in Tx ack status reporting in 802.3 xmit path Allocated ack_frame id from local->ack_status_frames is not really stored in the tx_info for 802.3 Tx path. Due to this, tx ack status is not reported and ack_frame id is not freed for the buffers requiring tx ack status. Also move the memset to 0 of tx_info before IEEE80211_TX_CTL_REQ_TX_STATUS flag assignment. Fixes: 50ff477a8639 ("mac80211: add 802.11 encapsulation offloading support") Signed-off-by: Vasanthakumar Thiagarajan Link: https://lore.kernel.org/r/1595427617-1713-1-git-send-email-vthiagar@codeaurora.org Signed-off-by: Johannes Berg commit 4052d3d2e8f47a15053320bbcbe365d15610437d Author: Julian Squires Date: Mon Jul 6 17:13:53 2020 -0400 cfg80211: check vendor command doit pointer before use In the case where a vendor command does not implement doit, and has no flags set, doit would not be validated and a NULL pointer dereference would occur, for example when invoking the vendor command via iw. I encountered this while developing new vendor commands. Perhaps in practice it is advisable to always implement doit along with dumpit, but it seems reasonable to me to always check doit anyway, not just when NEED_WDEV. Signed-off-by: Julian Squires Link: https://lore.kernel.org/r/20200706211353.2366470-1-julian@cipht.net Signed-off-by: Johannes Berg commit 5e43540c2af0a0c0a18e39579b1ad49541f87506 Author: Remi Pommarel Date: Sat Jul 4 15:54:19 2020 +0200 mac80211: mesh: Free pending skb when destroying a mpath A mpath object can hold reference on a list of skb that are waiting for mpath resolution to be sent. When destroying a mpath this skb list should be cleaned up in order to not leak memory. Fixing that kind of leak: unreferenced object 0xffff0000181c9300 (size 1088): comm "openvpn", pid 1782, jiffies 4295071698 (age 80.416s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 f9 80 36 00 00 00 00 00 ..........6..... 02 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............ backtrace: [<000000004bc6a443>] kmem_cache_alloc+0x1a4/0x2f0 [<000000002caaef13>] sk_prot_alloc.isra.39+0x34/0x178 [<00000000ceeaa916>] sk_alloc+0x34/0x228 [<00000000ca1f1d04>] inet_create+0x198/0x518 [<0000000035626b1c>] __sock_create+0x134/0x328 [<00000000a12b3a87>] __sys_socket+0xb0/0x158 [<00000000ff859f23>] __arm64_sys_socket+0x40/0x58 [<00000000263486ec>] el0_svc_handler+0xd0/0x1a0 [<0000000005b5157d>] el0_svc+0x8/0xc unreferenced object 0xffff000012973a40 (size 216): comm "openvpn", pid 1782, jiffies 4295082137 (age 38.660s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 c0 06 16 00 00 ff ff 00 93 1c 18 00 00 ff ff ................ backtrace: [<000000004bc6a443>] kmem_cache_alloc+0x1a4/0x2f0 [<0000000023c8c8f9>] __alloc_skb+0xc0/0x2b8 [<000000007ad950bb>] alloc_skb_with_frags+0x60/0x320 [<00000000ef90023a>] sock_alloc_send_pskb+0x388/0x3c0 [<00000000104fb1a3>] sock_alloc_send_skb+0x1c/0x28 [<000000006919d2dd>] __ip_append_data+0xba4/0x11f0 [<0000000083477587>] ip_make_skb+0x14c/0x1a8 [<0000000024f3d592>] udp_sendmsg+0xaf0/0xcf0 [<000000005aabe255>] inet_sendmsg+0x5c/0x80 [<000000008651ea08>] __sys_sendto+0x15c/0x218 [<000000003505c99b>] __arm64_sys_sendto+0x74/0x90 [<00000000263486ec>] el0_svc_handler+0xd0/0x1a0 [<0000000005b5157d>] el0_svc+0x8/0xc Fixes: 2bdaf386f99c (mac80211: mesh: move path tables into if_mesh) Signed-off-by: Remi Pommarel Link: https://lore.kernel.org/r/20200704135419.27703-1-repk@triplefau.lt Signed-off-by: Johannes Berg commit 6a01afcf8468d3ca2bd8bbb27503f60dcf643b20 Author: Remi Pommarel Date: Sat Jul 4 15:50:07 2020 +0200 mac80211: mesh: Free ie data when leaving mesh At ieee80211_join_mesh() some ie data could have been allocated (see copy_mesh_setup()) and need to be cleaned up when leaving the mesh. This fixes the following kmemleak report: unreferenced object 0xffff0000116bc600 (size 128): comm "wpa_supplicant", pid 608, jiffies 4294898983 (age 293.484s) hex dump (first 32 bytes): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 0............... 00 0f ac 08 00 00 00 00 c4 65 40 00 00 00 00 00 .........e@..... backtrace: [<00000000bebe439d>] __kmalloc_track_caller+0x1c0/0x330 [<00000000a349dbe1>] kmemdup+0x28/0x50 [<0000000075d69baa>] ieee80211_join_mesh+0x6c/0x3b8 [mac80211] [<00000000683bb98b>] __cfg80211_join_mesh+0x1e8/0x4f0 [cfg80211] [<0000000072cb507f>] nl80211_join_mesh+0x520/0x6b8 [cfg80211] [<0000000077e9bcf9>] genl_family_rcv_msg+0x374/0x680 [<00000000b1bd936d>] genl_rcv_msg+0x78/0x108 [<0000000022c53788>] netlink_rcv_skb+0xb0/0x1c0 [<0000000011af8ec9>] genl_rcv+0x34/0x48 [<0000000069e41f53>] netlink_unicast+0x268/0x2e8 [<00000000a7517316>] netlink_sendmsg+0x320/0x4c0 [<0000000069cba205>] ____sys_sendmsg+0x354/0x3a0 [<00000000e06bab0f>] ___sys_sendmsg+0xd8/0x120 [<0000000037340728>] __sys_sendmsg+0xa4/0xf8 [<000000004fed9776>] __arm64_sys_sendmsg+0x44/0x58 [<000000001c1e5647>] el0_svc_handler+0xd0/0x1a0 Fixes: c80d545da3f7 (mac80211: Let userspace enable and configure vendor specific path selection.) Signed-off-by: Remi Pommarel Link: https://lore.kernel.org/r/20200704135007.27292-1-repk@triplefau.lt Signed-off-by: Johannes Berg commit 65ad3ef9fced4062dfd74e2f89443fb5ce184321 Author: Rajkumar Manoharan Date: Wed Jul 1 19:20:24 2020 -0700 mac80211: fix warning in 6 GHz IE addition in mesh mode The commit 24a2042cb22f ("mac80211: add HE 6 GHz Band Capability element") failed to check device capability before adding HE 6 GHz capability element. Below warning is reported in 11ac device in mesh. Fix that by checking device capability at HE 6 GHz cap IE addition in mesh beacon and association request. WARNING: CPU: 1 PID: 1897 at net/mac80211/util.c:2878 ieee80211_ie_build_he_6ghz_cap+0x149/0x150 [mac80211] [ 3138.720358] Call Trace: [ 3138.720361] ieee80211_mesh_build_beacon+0x462/0x530 [mac80211] [ 3138.720363] ieee80211_start_mesh+0xa8/0xf0 [mac80211] [ 3138.720365] __cfg80211_join_mesh+0x122/0x3e0 [cfg80211] [ 3138.720368] nl80211_join_mesh+0x3d3/0x510 [cfg80211] Fixes: 24a2042cb22f ("mac80211: add HE 6 GHz Band Capability element") Reported-by: Markus Theil Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1593656424-18240-1-git-send-email-rmanohar@codeaurora.org Signed-off-by: Johannes Berg commit 5649625344fe1f4695eace7c37d011e317bf66d5 Author: Kailang Yang Date: Wed Jul 29 15:09:27 2020 +0800 ALSA: hda/realtek - Fixed HP right speaker no sound HP NB right speaker had no sound output. This platform was connected to I2S Amp for speaker out.(None Realtek I2S Amp IC) EC need to check codec GPIO1 pin to initial I2S Amp. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/01285f623ac7447187482fb4a8ecaa7c@realtek.com Signed-off-by: Takashi Iwai commit 71b59bf482b2dd662774f34108c5b904efa9e02b Author: Sabrina Dubroca Date: Wed Jul 29 18:38:43 2020 +0200 espintcp: count packets dropped in espintcp_rcv Currently, espintcp_rcv drops packets silently, which makes debugging issues difficult. Count packets as either XfrmInHdrError (when the packet was too short or contained invalid data) or XfrmInError (for other issues). Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit fadd1a63a7b4df295a01fa50b2f4e447542bee59 Author: Sabrina Dubroca Date: Wed Jul 29 18:38:42 2020 +0200 espintcp: handle short messages instead of breaking the encap socket Currently, short messages (less than 4 bytes after the length header) will break the stream of messages. This is unnecessary, since we can still parse messages even if they're too short to contain any usable data. This is also bogus, as keepalive messages (a single 0xff byte), though not needed with TCP encapsulation, should be allowed. This patch changes the stream parser so that short messages are accepted and dropped in the kernel. Messages that contain a valid SPI or non-ESP header are processed as before. Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)") Reported-by: Andrew Cagney Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 83bdc7275e6206f560d247be856bceba3e1ed8f2 Author: Linus Torvalds Date: Wed Jul 29 19:11:00 2020 -0700 random32: remove net_rand_state from the latent entropy gcc plugin It turns out that the plugin right now ends up being really unhappy about the change from 'static' to 'extern' storage that happened in commit f227e3ec3b5c ("random32: update the net random state on interrupt and activity"). This is probably a trivial fix for the latent_entropy plugin, but for now, just remove net_rand_state from the list of things the plugin worries about. Reported-by: Stephen Rothwell Cc: Emese Revfy Cc: Kees Cook Cc: Willy Tarreau Signed-off-by: Linus Torvalds commit b361663c5a40c8bc758b7f7f2239f7a192180e7c Author: Robert Hancock Date: Tue Jul 21 20:18:03 2020 -0600 PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge Recently ASPM handling was changed to allow ASPM on PCIe-to-PCI/PCI-X bridges. Unfortunately the ASMedia ASM1083/1085 PCIe to PCI bridge device doesn't seem to function properly with ASPM enabled. On an Asus PRIME H270-PRO motherboard, it causes errors like these: pcieport 0000:00:1c.0: AER: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID) pcieport 0000:00:1c.0: AER: device [8086:a292] error status/mask=00003000/00002000 pcieport 0000:00:1c.0: AER: [12] Timeout pcieport 0000:00:1c.0: AER: Corrected error received: 0000:00:1c.0 pcieport 0000:00:1c.0: AER: can't find device of ID00e0 In addition to flooding the kernel log, this also causes the machine to wake up immediately after suspend is initiated. The device advertises ASPM L0s and L1 support in the Link Capabilities register, but the ASMedia web page for ASM1083 [1] claims "No PCIe ASPM support". Windows 10 (build 2004) enables L0s, but it also logs correctable PCIe errors. Add a quirk to disable ASPM for this device. [1] https://www.asmedia.com.tw/eng/e_show_products.php?cate_index=169&item=114 [bhelgaas: commit log] Fixes: 66ff14e59e8a ("PCI/ASPM: Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208667 Link: https://lore.kernel.org/r/20200722021803.17958-1-hancockrwd@gmail.com Signed-off-by: Robert Hancock Signed-off-by: Bjorn Helgaas commit 0ba58348414eb10249480635545758b40b3c33b6 Author: Andrii Nakryiko Date: Tue Jul 28 21:09:13 2020 -0700 selftests/bpf: Extend map-in-map selftest to detect memory leaks Add test validating that all inner maps are released properly after skeleton is destroyed. To ensure determinism, trigger kernel-side synchronize_rcu() before checking map existence by their IDs. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200729040913.2815687-2-andriin@fb.com commit 1d4e1eab456e1ee92a94987499b211db05f900ea Author: Andrii Nakryiko Date: Tue Jul 28 21:09:12 2020 -0700 bpf: Fix map leak in HASH_OF_MAPS map Fix HASH_OF_MAPS bug of not putting inner map pointer on bpf_map_elem_update() operation. This is due to per-cpu extra_elems optimization, which bypassed free_htab_elem() logic doing proper clean ups. Make sure that inner map is put properly in optimized case as well. Fixes: 8c290e60fa2a ("bpf: fix hashmap extra_elems logic") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200729040913.2815687-1-andriin@fb.com commit 27a2145d6f826d1fad9de06ac541b1016ced3427 Author: Thomas Falcon Date: Wed Jul 29 16:36:32 2020 -0500 ibmvnic: Fix IRQ mapping disposal in error path RX queue IRQ mappings are disposed in both the TX IRQ and RX IRQ error paths. Fix this and dispose of TX IRQ mappings correctly in case of an error. Fixes: ea22d51a7831 ("ibmvnic: simplify and improve driver probe function") Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit d3590ebf6f91350192737dd1d1b219c05277f067 Merge: 21391520cbb5 8ac68dc455d9 Author: Linus Torvalds Date: Wed Jul 29 12:35:36 2020 -0700 Merge tag 'audit-pr-20200729' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fixes from Paul Moore: "One small audit fix that you can hopefully merge before v5.8 is released. Unfortunately it is a revert of a patch that went in during the v5.7 window and we just recently started to see some bug reports relating to that commit. We are working on a proper fix, but I'm not yet clear on when that will be ready and we need to fix the v5.7 kernels anyway, so in the interest of time a revert seemed like the best solution right now" * tag 'audit-pr-20200729' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: revert: 1320a4052ea1 ("audit: trigger accompanying records when no rules present") commit 21391520cbb597823050ac1bc343a0df3222ac90 Merge: c2f3850df7f9 74d6a5d56629 Author: Linus Torvalds Date: Wed Jul 29 12:29:24 2020 -0700 Merge tag '9p-for-5.8-2' of git://github.com/martinetd/linux into master Pull 9p fixes from Dominique Martinet: "A couple of syzcaller fixes for 5.8 The first one in particular has been quite noisy ("broke" in -rc5) so this would be worth landing even this late even if users likely won't see a difference" * tag '9p-for-5.8-2' of git://github.com/martinetd/linux: 9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work net/9p: validate fds in p9_fd_open commit 5d104a5f325e16ef92ffc05b93eabdf6f0818c9f Merge: 83f3522860f7 10fef9ca6a87 Author: David S. Miller Date: Wed Jul 29 12:16:21 2020 -0700 Merge branch 'mlxsw-fixes' Ido Schimmel says: ==================== mlxsw fixes This patch set contains various fixes for mlxsw. Patches #1-#2 fix two trap related issues introduced in previous cycle. Patches #3-#5 fix rare use-after-frees discovered by syzkaller. After over a week of fuzzing with the fixes, the bugs did not reproduce. Patch #6 from Amit fixes an issue in the ethtool selftest that was recently discovered after running the test on a new platform that supports only 1Gbps and 10Gbps speeds. ==================== Signed-off-by: David S. Miller commit 10fef9ca6a879e7bee090b8e51c9812d438d3fb1 Author: Amit Cohen Date: Wed Jul 29 12:26:48 2020 +0300 selftests: ethtool: Fix test when only two speeds are supported The test case check_highest_speed_is_chosen() configures $h1 to advertise a subset of its supported speeds and checks that $h2 chooses the highest speed from the subset. To find the common advertised speeds between $h1 and $h2, common_speeds_get() is called. Currently, the first speed returned from common_speeds_get() is removed claiming "h1 does not advertise this speed". The claim is wrong because the function is called after $h1 already advertised a subset of speeds. In case $h1 supports only two speeds, it will advertise a single speed which will be later removed because of previously mentioned bug. This results in the test needlessly failing. When more than two speeds are supported this is not an issue because the first advertised speed is the lowest one. Fix this by not removing any speed from the list of commonly advertised speeds. Fixes: 64916b57c0b1 ("selftests: forwarding: Add speed and auto-negotiation test") Reported-by: Danielle Ratson Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5515c3448d55bdcb5ff8a1778aa84f34e4205596 Author: Ido Schimmel Date: Wed Jul 29 12:26:47 2020 +0300 mlxsw: spectrum_router: Fix use-after-free in router init / de-init Several notifiers are registered as part of router initialization. Since some of these notifiers are registered before the end of the initialization, it is possible for them to access uninitialized or freed memory when processing notifications [1]. Additionally, some of these notifiers queue work items on a workqueue. If these work items are executed after the router was de-initialized, they will access freed memory. Fix both problems by moving the registration of the notifiers to the end of the router initialization and flush the work queue after they are unregistered. [1] BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:938 [inline] BUG: KASAN: use-after-free in __mutex_lock+0xeea/0x1340 kernel/locking/mutex.c:1103 Read of size 8 at addr ffff888038c3a6e0 by task kworker/u4:1/61 CPU: 1 PID: 61 Comm: kworker/u4:1 Not tainted 5.8.0-rc2+ #36 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Workqueue: mlxsw_core_ordered mlxsw_sp_inet6addr_event_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xf6/0x16e lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x250 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 __mutex_lock_common kernel/locking/mutex.c:938 [inline] __mutex_lock+0xeea/0x1340 kernel/locking/mutex.c:1103 mlxsw_sp_inet6addr_event_work+0xb3/0x1b0 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:7123 process_one_work+0xa3e/0x17a0 kernel/workqueue.c:2269 worker_thread+0x9e/0x1050 kernel/workqueue.c:2415 kthread+0x355/0x470 kernel/kthread.c:291 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:293 Allocated by task 1298: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc mm/kasan/common.c:494 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:467 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] mlxsw_sp_router_init+0xb2/0x1d20 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:8074 mlxsw_sp_init+0xbd8/0x3ac0 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:2932 __mlxsw_core_bus_device_register+0x657/0x10d0 drivers/net/ethernet/mellanox/mlxsw/core.c:1375 mlxsw_core_bus_device_register drivers/net/ethernet/mellanox/mlxsw/core.c:1436 [inline] mlxsw_devlink_core_bus_device_reload_up+0xcd/0x150 drivers/net/ethernet/mellanox/mlxsw/core.c:1133 devlink_reload net/core/devlink.c:2959 [inline] devlink_reload+0x281/0x3b0 net/core/devlink.c:2944 devlink_nl_cmd_reload+0x2f1/0x7c0 net/core/devlink.c:2987 genl_family_rcv_msg_doit net/netlink/genetlink.c:691 [inline] genl_family_rcv_msg net/netlink/genetlink.c:736 [inline] genl_rcv_msg+0x611/0x9d0 net/netlink/genetlink.c:753 netlink_rcv_skb+0x152/0x440 net/netlink/af_netlink.c:2469 genl_rcv+0x24/0x40 net/netlink/genetlink.c:764 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x53a/0x750 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x850/0xd90 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0x150/0x190 net/socket.c:672 ____sys_sendmsg+0x6d8/0x840 net/socket.c:2363 ___sys_sendmsg+0xff/0x170 net/socket.c:2417 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2450 do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1348: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x12c/0x170 mm/kasan/common.c:455 slab_free_hook mm/slub.c:1474 [inline] slab_free_freelist_hook mm/slub.c:1507 [inline] slab_free mm/slub.c:3072 [inline] kfree+0xe6/0x320 mm/slub.c:4063 mlxsw_sp_fini+0x340/0x4e0 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3132 mlxsw_core_bus_device_unregister+0x16c/0x6d0 drivers/net/ethernet/mellanox/mlxsw/core.c:1474 mlxsw_devlink_core_bus_device_reload_down+0x8e/0xc0 drivers/net/ethernet/mellanox/mlxsw/core.c:1123 devlink_reload+0xc6/0x3b0 net/core/devlink.c:2952 devlink_nl_cmd_reload+0x2f1/0x7c0 net/core/devlink.c:2987 genl_family_rcv_msg_doit net/netlink/genetlink.c:691 [inline] genl_family_rcv_msg net/netlink/genetlink.c:736 [inline] genl_rcv_msg+0x611/0x9d0 net/netlink/genetlink.c:753 netlink_rcv_skb+0x152/0x440 net/netlink/af_netlink.c:2469 genl_rcv+0x24/0x40 net/netlink/genetlink.c:764 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x53a/0x750 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x850/0xd90 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0x150/0x190 net/socket.c:672 ____sys_sendmsg+0x6d8/0x840 net/socket.c:2363 ___sys_sendmsg+0xff/0x170 net/socket.c:2417 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2450 do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888038c3a000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1760 bytes inside of 2048-byte region [ffff888038c3a000, ffff888038c3a800) The buggy address belongs to the page: page:ffffea0000e30e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea0000e30e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head) raw: 0100000000010200 dead000000000100 dead000000000122 ffff88806c40c000 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888038c3a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888038c3a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888038c3a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888038c3a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888038c3a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Fixes: 965fa8e600d2 ("mlxsw: spectrum_router: Make RIF deletion more robust") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 3c8ce24b037648a5a15b85888b259a74b05ff97d Author: Ido Schimmel Date: Wed Jul 29 12:26:46 2020 +0300 mlxsw: core: Free EMAD transactions using kfree_rcu() The lifetime of EMAD transactions (i.e., 'struct mlxsw_reg_trans') is managed using RCU. They are freed using kfree_rcu() once the transaction ends. However, in case the transaction failed it is freed immediately after being removed from the active transactions list. This is problematic because it is still possible for a different CPU to dereference the transaction from an RCU read-side critical section while traversing the active transaction list in mlxsw_emad_rx_listener_func(). In which case, a use-after-free is triggered [1]. Fix this by freeing the transaction after a grace period by calling kfree_rcu(). [1] BUG: KASAN: use-after-free in mlxsw_emad_rx_listener_func+0x969/0xac0 drivers/net/ethernet/mellanox/mlxsw/core.c:671 Read of size 8 at addr ffff88800b7964e8 by task syz-executor.2/2881 CPU: 0 PID: 2881 Comm: syz-executor.2 Not tainted 5.8.0-rc4+ #44 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xf6/0x16e lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x250 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 mlxsw_emad_rx_listener_func+0x969/0xac0 drivers/net/ethernet/mellanox/mlxsw/core.c:671 mlxsw_core_skb_receive+0x571/0x700 drivers/net/ethernet/mellanox/mlxsw/core.c:2061 mlxsw_pci_cqe_rdq_handle drivers/net/ethernet/mellanox/mlxsw/pci.c:595 [inline] mlxsw_pci_cq_tasklet+0x12a6/0x2520 drivers/net/ethernet/mellanox/mlxsw/pci.c:651 tasklet_action_common.isra.0+0x13f/0x3e0 kernel/softirq.c:550 __do_softirq+0x223/0x964 kernel/softirq.c:292 asm_call_on_stack+0x12/0x20 arch/x86/entry/entry_64.S:711 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] do_softirq_own_stack+0x109/0x140 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:387 [inline] __irq_exit_rcu kernel/softirq.c:417 [inline] irq_exit_rcu+0x16f/0x1a0 kernel/softirq.c:429 sysvec_apic_timer_interrupt+0x4e/0xd0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:587 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 kernel/locking/spinlock.c:191 Code: e8 2a c3 f4 fc 48 89 ef e8 12 96 f5 fc f6 c7 02 75 11 53 9d e8 d6 db 11 fd 65 ff 0d 1f 21 b3 56 5b 5d c3 e8 a7 d7 11 fd 53 9d ed 0f 1f 00 55 48 89 fd 65 ff 05 05 21 b3 56 ff 74 24 08 48 8d RSP: 0018:ffff8880446ffd80 EFLAGS: 00000286 RAX: 0000000000000006 RBX: 0000000000000286 RCX: 0000000000000006 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffffa94ecea9 RBP: ffff888012934408 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: fffffbfff57be301 R12: 1ffff110088dffc1 R13: ffff888037b817c0 R14: ffff88802442415a R15: ffff888024424000 __do_sys_perf_event_open+0x1b5d/0x2bd0 kernel/events/core.c:11874 do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x473dbd Code: Bad RIP value. RSP: 002b:00007f21e5e9cc28 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 000000000057bf00 RCX: 0000000000473dbd RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000040 RBP: 000000000057bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 000000000057bf0c R13: 00007ffd0493503f R14: 00000000004d0f46 R15: 00007f21e5e9cd80 Allocated by task 871: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc mm/kasan/common.c:494 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:467 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] mlxsw_core_reg_access_emad+0x70/0x1410 drivers/net/ethernet/mellanox/mlxsw/core.c:1812 mlxsw_core_reg_access+0xeb/0x540 drivers/net/ethernet/mellanox/mlxsw/core.c:1991 mlxsw_sp_port_get_hw_xstats+0x335/0x7e0 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:1130 update_stats_cache+0xf4/0x140 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:1173 process_one_work+0xa3e/0x17a0 kernel/workqueue.c:2269 worker_thread+0x9e/0x1050 kernel/workqueue.c:2415 kthread+0x355/0x470 kernel/kthread.c:291 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:293 Freed by task 871: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x12c/0x170 mm/kasan/common.c:455 slab_free_hook mm/slub.c:1474 [inline] slab_free_freelist_hook mm/slub.c:1507 [inline] slab_free mm/slub.c:3072 [inline] kfree+0xe6/0x320 mm/slub.c:4052 mlxsw_core_reg_access_emad+0xd45/0x1410 drivers/net/ethernet/mellanox/mlxsw/core.c:1819 mlxsw_core_reg_access+0xeb/0x540 drivers/net/ethernet/mellanox/mlxsw/core.c:1991 mlxsw_sp_port_get_hw_xstats+0x335/0x7e0 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:1130 update_stats_cache+0xf4/0x140 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:1173 process_one_work+0xa3e/0x17a0 kernel/workqueue.c:2269 worker_thread+0x9e/0x1050 kernel/workqueue.c:2415 kthread+0x355/0x470 kernel/kthread.c:291 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:293 The buggy address belongs to the object at ffff88800b796400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 232 bytes inside of 512-byte region [ffff88800b796400, ffff88800b796600) The buggy address belongs to the page: page:ffffea00002de500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea00002de500 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head) raw: 0100000000010200 dead000000000100 dead000000000122 ffff88806c402500 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800b796380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800b796400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88800b796480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800b796500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800b796580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Fixes: caf7297e7ab5 ("mlxsw: core: Introduce support for asynchronous EMAD register access") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 7d8e8f3433dc8d1dc87c1aabe73a154978fb4c4d Author: Ido Schimmel Date: Wed Jul 29 12:26:45 2020 +0300 mlxsw: core: Increase scope of RCU read-side critical section The lifetime of the Rx listener item ('rxl_item') is managed using RCU, but is dereferenced outside of RCU read-side critical section, which can lead to a use-after-free. Fix this by increasing the scope of the RCU read-side critical section. Fixes: 93c1edb27f9e ("mlxsw: Introduce Mellanox switch driver core") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit ec4f5b3617049d474b3263792785b638640f2dbe Author: Ido Schimmel Date: Wed Jul 29 12:26:44 2020 +0300 mlxsw: spectrum: Use different trap group for externally routed packets Cited commit mistakenly removed the trap group for externally routed packets (e.g., via the management interface) and grouped locally routed and externally routed packet traps under the same group, thereby subjecting them to the same policer. This can result in problems, for example, when FRR is restarted and suddenly all transient traffic is trapped to the CPU because of a default route through the management interface. Locally routed packets required to re-establish a BGP connection will never reach the CPU and the routing tables will not be re-populated. Fix this by using a different trap group for externally routed packets. Fixes: 8110668ecd9a ("mlxsw: spectrum_trap: Register layer 3 control traps") Reported-by: Alex Veber Tested-by: Alex Veber Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 89ab53313543b18640eb5d25a1e74bf9eee889b0 Author: Ido Schimmel Date: Wed Jul 29 12:26:43 2020 +0300 mlxsw: spectrum_router: Allow programming link-local host routes Cited commit added the ability to program link-local prefix routes to the ASIC so that relevant packets are routed and trapped correctly. However, host routes were not included in the change and thus not programmed to the ASIC. This can result in packets being trapped via an external route trap instead of a local route trap as in IPv4. Fix this by programming all the link-local routes to the ASIC. Fixes: 10d3757fcb07 ("mlxsw: spectrum_router: Allow programming link-local prefix routes") Reported-by: Alex Veber Tested-by: Alex Veber Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 83f3522860f702748143e022f1a546547314c715 Author: Ido Schimmel Date: Wed Jul 29 11:37:13 2020 +0300 ipv4: Silence suspicious RCU usage warning fib_trie_unmerge() is called with RTNL held, but not from an RCU read-side critical section. This leads to the following warning [1] when the FIB alias list in a leaf is traversed with hlist_for_each_entry_rcu(). Since the function is always called with RTNL held and since modification of the list is protected by RTNL, simply use hlist_for_each_entry() and silence the warning. [1] WARNING: suspicious RCU usage 5.8.0-rc4-custom-01520-gc1f937f3f83b #30 Not tainted ----------------------------- net/ipv4/fib_trie.c:1867 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by ip/164: #0: ffffffff85a27850 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x49a/0xbd0 stack backtrace: CPU: 0 PID: 164 Comm: ip Not tainted 5.8.0-rc4-custom-01520-gc1f937f3f83b #30 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014 Call Trace: dump_stack+0x100/0x184 lockdep_rcu_suspicious+0x153/0x15d fib_trie_unmerge+0x608/0xdb0 fib_unmerge+0x44/0x360 fib4_rule_configure+0xc8/0xad0 fib_nl_newrule+0x37a/0x1dd0 rtnetlink_rcv_msg+0x4f7/0xbd0 netlink_rcv_skb+0x17a/0x480 rtnetlink_rcv+0x22/0x30 netlink_unicast+0x5ae/0x890 netlink_sendmsg+0x98a/0xf40 ____sys_sendmsg+0x879/0xa00 ___sys_sendmsg+0x122/0x190 __sys_sendmsg+0x103/0x1d0 __x64_sys_sendmsg+0x7d/0xb0 do_syscall_64+0x54/0xa0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fc80a234e97 Code: Bad RIP value. RSP: 002b:00007ffef8b66798 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc80a234e97 RDX: 0000000000000000 RSI: 00007ffef8b66800 RDI: 0000000000000003 RBP: 000000005f141b1c R08: 0000000000000001 R09: 0000000000000000 R10: 00007fc80a2a8ac0 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 00007ffef8b67008 R15: 0000556fccb10020 Fixes: 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit b5141915b5aec3b29a63db869229e3741ebce258 Author: Ido Schimmel Date: Wed Jul 29 11:34:36 2020 +0300 vxlan: Ensure FDB dump is performed under RCU The commit cited below removed the RCU read-side critical section from rtnl_fdb_dump() which means that the ndo_fdb_dump() callback is invoked without RCU protection. This results in the following warning [1] in the VXLAN driver, which relied on the callback being invoked from an RCU read-side critical section. Fix this by calling rcu_read_lock() in the VXLAN driver, as already done in the bridge driver. [1] WARNING: suspicious RCU usage 5.8.0-rc4-custom-01521-g481007553ce6 #29 Not tainted ----------------------------- drivers/net/vxlan.c:1379 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by bridge/166: #0: ffffffff85a27850 (rtnl_mutex){+.+.}-{3:3}, at: netlink_dump+0xea/0x1090 stack backtrace: CPU: 1 PID: 166 Comm: bridge Not tainted 5.8.0-rc4-custom-01521-g481007553ce6 #29 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014 Call Trace: dump_stack+0x100/0x184 lockdep_rcu_suspicious+0x153/0x15d vxlan_fdb_dump+0x51e/0x6d0 rtnl_fdb_dump+0x4dc/0xad0 netlink_dump+0x540/0x1090 __netlink_dump_start+0x695/0x950 rtnetlink_rcv_msg+0x802/0xbd0 netlink_rcv_skb+0x17a/0x480 rtnetlink_rcv+0x22/0x30 netlink_unicast+0x5ae/0x890 netlink_sendmsg+0x98a/0xf40 __sys_sendto+0x279/0x3b0 __x64_sys_sendto+0xe6/0x1a0 do_syscall_64+0x54/0xa0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fe14fa2ade0 Code: Bad RIP value. RSP: 002b:00007fff75bb5b88 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00005614b1ba0020 RCX: 00007fe14fa2ade0 RDX: 000000000000011c RSI: 00007fff75bb5b90 RDI: 0000000000000003 RBP: 00007fff75bb5b90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00005614b1b89160 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Fixes: 5e6d24358799 ("bridge: netlink dump interface at par with brctl") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 54a485e9ec084da1a4b32dcf7749c7d760ed8aa5 Author: Mike Marciniszyn Date: Tue Jul 28 14:38:48 2020 -0400 IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE The lookaside count is improperly initialized to the size of the Receive Queue with the additional +1. In the traces below, the RQ size is 384, so the count was set to 385. The lookaside count is then rarely refreshed. Note the high and incorrect count in the trace below: rvt_get_rwqe: [hfi1_0] wqe ffffc900078e9008 wr_id 55c7206d75a0 qpn c qpt 2 pid 3018 num_sge 1 head 1 tail 0, count 385 rvt_get_rwqe: (hfi1_rc_rcv+0x4eb/0x1480 [hfi1] <- rvt_get_rwqe) ret=0x1 The head,tail indicate there is only one RWQE posted although the count says 385 and we correctly return the element 0. The next call to rvt_get_rwqe with the decremented count: rvt_get_rwqe: [hfi1_0] wqe ffffc900078e9058 wr_id 0 qpn c qpt 2 pid 3018 num_sge 0 head 1 tail 1, count 384 rvt_get_rwqe: (hfi1_rc_rcv+0x4eb/0x1480 [hfi1] <- rvt_get_rwqe) ret=0x1 Note that the RQ is empty (head == tail) yet we return the RWQE at tail 1, which is not valid because of the bogus high count. Best case, the RWQE has never been posted and the rc logic sees an RWQE that is too small (all zeros) and puts the QP into an error state. In the worst case, a server slow at posting receive buffers might fool rvt_get_rwqe() into fetching an old RWQE and corrupt memory. Fix by deleting the faulty initialization code and creating an inline to fetch the posted count and convert all callers to use new inline. Fixes: f592ae3c999f ("IB/rdmavt: Fracture single lock used for posting and processing RWQEs") Link: https://lore.kernel.org/r/20200728183848.22226.29132.stgit@awfm-01.aw.intel.com Reported-by: Zhaojuan Guo Cc: # 5.4.x Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Tested-by: Honggang Li Signed-off-by: Jason Gunthorpe commit c2f3850df7f95537e79c561f7be49df2e4ad8060 Merge: f227e3ec3b5c a4a2739beb89 Author: Linus Torvalds Date: Wed Jul 29 11:39:20 2020 -0700 Merge tag 'drm-fixes-2020-07-29' of git://anongit.freedesktop.org/drm/drm into master Pull drm fixes from Dave Airlie: "The nouveau fixes missed the last pull by a few hours, and we had a few arm driver/panel/bridge fixes come in. This is possibly a bit more than I'm comfortable sending at this stage, but I've looked at each patch, the core + nouveau patches fix regressions, and the arm related ones are all around screens turning on and working, and are mostly trivial patches, the line count is mostly in comments. core: - fix possible use-after-free drm_fb_helper: - regression fix to use memcpy_io on bochs' sparc64 nouveau: - format modifiers fixes - HDA regression fix - turing modesetting race fix of: - fix a double free dbi: - fix SPI Type 1 transfer mcde: - fix screen stability crash panel: - panel: fix display noise on auo,kd101n80-45na - panel: delay HPD checks for boe_nv133fhm_n61 bridge: - bridge: drop connector check in nwl-dsi bridge - bridge: set proper bridge type for adv7511" * tag 'drm-fixes-2020-07-29' of git://anongit.freedesktop.org/drm/drm: drm: hold gem reference until object is no longer accessed drm/dbi: Fix SPI Type 1 (9-bit) transfer drm/drm_fb_helper: fix fbdev with sparc64 drm/mcde: Fix stability issue drm/bridge: nwl-dsi: Drop DRM_BRIDGE_ATTACH_NO_CONNECTOR check. drm/panel: Fix auo, kd101n80-45na horizontal noise on edges of panel drm: panel: simple: Delay HPD checking on boe_nv133fhm_n61 for 15 ms drm/bridge/adv7511: set the bridge type properly drm: of: Fix double-free bug drm/nouveau/fbcon: zero-initialise the mode_cmd2 structure drm/nouveau/fbcon: fix module unload when fbcon init has failed for some reason drm/nouveau/kms/tu102: wait for core update to complete when assigning windows drm/nouveau/kms/gf100: use correct format modifiers drm/nouveau/disp/gm200-: fix regression from HDA SOR selection changes commit f227e3ec3b5cad859ad15666874405e8c1bbc1d4 Author: Willy Tarreau Date: Fri Jul 10 15:23:19 2020 +0200 random32: update the net random state on interrupt and activity This modifies the first 32 bits out of the 128 bits of a random CPU's net_rand_state on interrupt or CPU activity to complicate remote observations that could lead to guessing the network RNG's internal state. Note that depending on some network devices' interrupt rate moderation or binding, this re-seeding might happen on every packet or even almost never. In addition, with NOHZ some CPUs might not even get timer interrupts, leaving their local state rarely updated, while they are running networked processes making use of the random state. For this reason, we also perform this update in update_process_times() in order to at least update the state when there is user or system activity, since it's the only case we care about. Reported-by: Amit Klein Suggested-by: Linus Torvalds Cc: Eric Dumazet Cc: "Jason A. Donenfeld" Cc: Andy Lutomirski Cc: Kees Cook Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Signed-off-by: Willy Tarreau Signed-off-by: Linus Torvalds commit 168c358af2f8c5a37f8b5f877ba2cc93995606ee Author: Michael S. Tsirkin Date: Mon Jul 27 12:01:27 2020 -0400 virtio_balloon: fix up endian-ness for free cmd id free cmd id is read using virtio endian, spec says all fields in balloon are LE. Fix it up. Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Wei Wang Acked-by: David Hildenbrand commit ca72cc348355fbc969f5fa00fa94d584920d403b Author: Alexander Duyck Date: Mon Jul 13 13:35:39 2020 -0700 virtio-balloon: Document byte ordering of poison_val The poison_val field in the virtio_balloon_config is treated as a little-endian field by the host. Since we are currently only having to deal with a single byte poison value this isn't a problem, however if the value should ever expand it would cause byte ordering issues. Document that in the code so that we know that if the value should ever expand we need to byte swap the value on big-endian architectures. Signed-off-by: Alexander Duyck Link: https://lore.kernel.org/r/20200713203539.17140.71425.stgit@localhost.localdomain Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand commit 295c1b9852d000580786375304a9800bd9634d15 Author: Michael S. Tsirkin Date: Fri Jul 10 06:36:16 2020 -0400 vhost/scsi: fix up req type endian-ness vhost/scsi doesn't handle type conversion correctly for request type when using virtio 1.0 and up for BE, or cross-endian platforms. Fix it up using vhost_32_to_cpu. Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Stefan Hajnoczi commit d6364a867ccbf34a6afe0d57721ff64aa43befcd Merge: 1f273e255b28 5bedd3afee8e Author: Jens Axboe Date: Wed Jul 29 11:21:14 2020 -0600 Merge branch 'nvme-5.8' of git://git.infradead.org/nvme into block-5.8 Pull NVMe fixes from Christoph. * 'nvme-5.8' of git://git.infradead.org/nvme: nvme: add a Identify Namespace Identification Descriptor list quirk nvme-pci: prevent SK hynix PC400 from using Write Zeroes command nvme-tcp: fix possible hang waiting for icresp response commit 81530ab08ef002f90b7dc68f5a69816b0e3be803 Author: Leon Romanovsky Date: Tue Jul 28 15:02:55 2020 +0300 RDMA/mlx5: Allow providing extra scatter CQE QP flag Scatter CQE feature relies on two flags MLX5_QP_FLAG_SCATTER_CQE and MLX5_QP_FLAG_ALLOW_SCATTER_CQE, both of them can be provided without relation to device capability. Relax global validity check to allow MLX5_QP_FLAG_ALLOW_SCATTER_CQE QP flag. Existing user applications are failing on this new validity check. Fixes: 90ecb37a751b ("RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags") Fixes: 37518fa49f76 ("RDMA/mlx5: Process all vendor flags in one place") Link: https://lore.kernel.org/r/20200728120255.805733-1-leon@kernel.org Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fe3c60684377d5ad9b0569b87ed3e26e12c8173b Author: Qiushi Wu Date: Sat Jun 13 14:05:33 2020 -0500 firmware: Fix a reference count leak. kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Callback function fw_cfg_sysfs_release_entry() in kobject_put() can handle the pointer "entry" properly. Signed-off-by: Qiushi Wu Link: https://lore.kernel.org/r/20200613190533.15712-1-wu000273@umn.edu Signed-off-by: Michael S. Tsirkin commit bdd65589593edd79b6a12ce86b3b7a7c6dae5208 Author: Thomas Gleixner Date: Wed Jul 29 10:53:28 2020 +0200 x86/i8259: Use printk_deferred() to prevent deadlock 0day reported a possible circular locking dependency: Chain exists of: &irq_desc_lock_class --> console_owner --> &port_lock_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port_lock_key); lock(console_owner); lock(&port_lock_key); lock(&irq_desc_lock_class); The reason for this is a printk() in the i8259 interrupt chip driver which is invoked with the irq descriptor lock held, which reverses the lock operations vs. printk() from arbitrary contexts. Switch the printk() to printk_deferred() to avoid that. Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87365abt2v.fsf@nanos.tec.linutronix.de commit 8ac68dc455d9d18241d44b96800d73229029ed34 Author: Paul Moore Date: Tue Jul 28 15:33:21 2020 -0400 revert: 1320a4052ea1 ("audit: trigger accompanying records when no rules present") Unfortunately the commit listed in the subject line above failed to ensure that the task's audit_context was properly initialized/set before enabling the "accompanying records". Depending on the situation, the resulting audit_context could have invalid values in some of it's fields which could cause a kernel panic/oops when the task/syscall exists and the audit records are generated. We will revisit the original patch, with the necessary fixes, in a future kernel but right now we just want to fix the kernel panic with the least amount of added risk. Cc: stable@vger.kernel.org Fixes: 1320a4052ea1 ("audit: trigger accompanying records when no rules present") Reported-by: j2468h@googlemail.com Signed-off-by: Paul Moore commit 7fcd9bb5acd01250bcae1ecc0cb8b8d4bb5b7e63 Author: Ranjani Sridharan Date: Tue Jul 28 16:10:11 2020 -0700 ALSA: hda: fix NULL pointer dereference during suspend When the ASoC card registration fails and the codec component driver never probes, the codec device is not initialized and therefore memory for codec->wcaps is not allocated. This results in a NULL pointer dereference when the codec driver suspend callback is invoked during system suspend. Fix this by returning without performing any actions during codec suspend/resume if the card was not registered successfully. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200728231011.1454066-1-ranjani.sridharan@linux.intel.com Signed-off-by: Takashi Iwai commit 5bedd3afee8eb01ccd256f0cd2cc0fa6f841417a Author: Christoph Hellwig Date: Tue Jul 28 13:09:03 2020 +0200 nvme: add a Identify Namespace Identification Descriptor list quirk Add a quirk for a device that does not support the Identify Namespace Identification Descriptor list despite claiming 1.3 compliance. Fixes: ea43d9709f72 ("nvme: fix identify error status silent ignore") Reported-by: Ingo Brunberg Signed-off-by: Christoph Hellwig Tested-by: Ingo Brunberg Reviewed-by: Sagi Grimberg commit a4a2739beb8933a19281bca077fdb852598803ed Merge: 0d7869805a82 8490d6a7e0a0 Author: Dave Airlie Date: Wed Jul 29 12:44:45 2020 +1000 Merge tag 'drm-misc-fixes-2020-07-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm: fix possible use-after-free * dbi: fix SPI Type 1 transfer * drm_fb_helper: use memcpy_io on bochs' sparc64 * mcde: fix stability * panel: fix display noise on auo,kd101n80-45na * panel: delay HPD checks for boe_nv133fhm_n61 * bridge: drop connector check in nwl-dsi bridge * bridge: set proper bridge type for adv7511 * of: fix a double free Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200728110446.GA8076@linux-uq9g commit 1ed06dbc213e1408ab60faa3ac0c0855a3ddc52d Author: Martin Varghese Date: Tue Jul 28 22:35:52 2020 +0530 Documentation: bareudp: Corrected description of bareudp module. Removed redundant words. Fixes: 571912c69f0e ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.") Signed-off-by: Martin Varghese Signed-off-by: David S. Miller commit 302d201b5cdf6f4781ee6cd9862f377f975d6c43 Author: Guillaume Nault Date: Sat Jul 25 15:06:47 2020 +0200 bareudp: forbid mixing IP and MPLS in multiproto mode In multiproto mode, bareudp_xmit() accepts sending multicast MPLS and IPv6 packets regardless of the bareudp ethertype. In practice, this let an IP tunnel send multicast MPLS packets, or an MPLS tunnel send IPv6 packets. We need to restrict the test further, so that the multiproto mode only enables * IPv6 for IPv4 tunnels, * or multicast MPLS for unicast MPLS tunnels. To improve clarity, the protocol validation is moved to its own function, where each logical test has its own condition. v2: s/ntohs/htons/ Fixes: 4b5f67232d95 ("net: Special handling for IP & MPLS.") Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 706ec919164622ff5ce822065472d0f30a9e9dd2 Author: Xiyu Yang Date: Sat Jul 25 16:02:18 2020 +0800 ipv6: Fix nexthop refcnt leak when creating ipv6 route info ip6_route_info_create() invokes nexthop_get(), which increases the refcount of the "nh". When ip6_route_info_create() returns, local variable "nh" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of ip6_route_info_create(). When nexthops can not be used with source routing, the function forgets to decrease the refcnt increased by nexthop_get(), causing a refcnt leak. Fix this issue by pulling up the error source routing handling when nexthops can not be used with source routing. Fixes: f88d8ea67fbd ("ipv6: Plumb support for nexthop object in a fib6_info") Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: David Ahern Signed-off-by: David S. Miller commit fa662d7816a5a3790f3ee49f27e5f65991d3347d Merge: 3cab8c655259 ed543f5c6a98 Author: David S. Miller Date: Tue Jul 28 17:14:48 2020 -0700 Merge branch 'Fix-bugs-in-Octeontx2-netdev-driver' Subbaraya Sundeep says: ==================== Fix bugs in Octeontx2 netdev driver There are problems in the existing Octeontx2 netdev drivers like missing cancel_work for the reset task, missing lock in reset task and missing unergister_netdev in driver remove. This patch set fixes the above problems. ==================== Signed-off-by: David S. Miller commit ed543f5c6a988d8a863d2436794230cef2c82389 Author: Subbaraya Sundeep Date: Sat Jul 25 10:13:54 2020 +0530 octeontx2-pf: Unregister netdev at driver remove Added unregister_netdev in the driver remove function. Generally unregister_netdev is called after disabling all the device interrupts but here it is called before disabling device mailbox interrupts. The reason behind this is VF needs mailbox interrupt to communicate with its PF to clean up its resources during otx2_stop. otx2_stop disables packet I/O and queue interrupts first and by using mailbox interrupt communicates to PF to free VF resources. Hence this patch calls unregister_device just before disabling mailbox interrupts. Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit c0376f473c5cc2ef94f8e1e055d173293cc3698c Author: Subbaraya Sundeep Date: Sat Jul 25 10:13:53 2020 +0530 octeontx2-pf: cancel reset_task work During driver exit cancel the queued reset_task work in VF driver. Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 948a66338f44c16f52c0f03f6ad81a6f59eb5604 Author: Subbaraya Sundeep Date: Sat Jul 25 10:13:52 2020 +0530 octeontx2-pf: Fix reset_task bugs Two bugs exist in the code related to reset_task in PF driver one is the missing protection against network stack ndo_open and ndo_close. Other one is the missing cancel_work. This patch fixes those problems. Fixes: 4ff7d1488a84 ("octeontx2-pf: Error handling support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 3cab8c65525920f00d8f4997b3e9bb73aecb3a8e Author: Jakub Kicinski Date: Fri Jul 24 16:15:43 2020 -0700 mlx4: disable device on shutdown It appears that not disabling a PCI device on .shutdown may lead to a Hardware Error with particular (perhaps buggy) BIOS versions: mlx4_en: eth0: Close port called mlx4_en 0000:04:00.0: removed PHC reboot: Restarting system {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1 {1}[Hardware Error]: event severity: fatal {1}[Hardware Error]: Error 0, type: fatal {1}[Hardware Error]: section_type: PCIe error {1}[Hardware Error]: port_type: 4, root port {1}[Hardware Error]: version: 1.16 {1}[Hardware Error]: command: 0x4010, status: 0x0143 {1}[Hardware Error]: device_id: 0000:00:02.2 {1}[Hardware Error]: slot: 0 {1}[Hardware Error]: secondary_bus: 0x04 {1}[Hardware Error]: vendor_id: 0x8086, device_id: 0x2f06 {1}[Hardware Error]: class_code: 000604 {1}[Hardware Error]: bridge: secondary_status: 0x2000, control: 0x0003 {1}[Hardware Error]: aer_uncor_status: 0x00100000, aer_uncor_mask: 0x00000000 {1}[Hardware Error]: aer_uncor_severity: 0x00062030 {1}[Hardware Error]: TLP Header: 40000018 040000ff 791f4080 00000000 [hw error repeats] Kernel panic - not syncing: Fatal hardware error! CPU: 0 PID: 2189 Comm: reboot Kdump: loaded Not tainted 5.6.x-blabla #1 Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 05/05/2017 Fix the mlx4 driver. This is a very similar problem to what had been fixed in: commit 0d98ba8d70b0 ("scsi: hpsa: disable device during shutdown") to address https://bugzilla.kernel.org/show_bug.cgi?id=199779. Fixes: 2ba5fbd62b25 ("net/mlx4_core: Handle AER flow properly") Reported-by: Jake Lawrence Signed-off-by: Jakub Kicinski Reviewed-by: Saeed Mahameed Signed-off-by: David S. Miller commit a7ef23e56864ad7720b3a38ef408bc7c9a74c58d Merge: 19016d93bfc3 ce9b362bf6db Author: David S. Miller Date: Tue Jul 28 17:09:49 2020 -0700 Merge branch 'rhashtable-Fix-unprotected-RCU-dereference-in-__rht_ptr' Herbert Xu says: ==================== rhashtable: Fix unprotected RCU dereference in __rht_ptr This patch series fixes an unprotected dereference in __rht_ptr. The first patch is a minimal fix that does not use the correct RCU markings but is suitable for backport, and the second patch cleans up the RCU markings. ==================== Signed-off-by: David S. Miller commit ce9b362bf6db51a083c4221ef0f93c16cfb1facf Author: Herbert Xu Date: Fri Jul 24 20:14:34 2020 +1000 rhashtable: Restore RCU marking on rhash_lock_head This patch restores the RCU marking on bucket_table->buckets as it really does need RCU protection. Its removal had led to a fatal bug. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller commit 1748f6a2cbc4694523f16da1c892b59861045b9d Author: Herbert Xu Date: Fri Jul 24 20:12:53 2020 +1000 rhashtable: Fix unprotected RCU dereference in __rht_ptr The rcu_dereference call in rht_ptr_rcu is completely bogus because we've already dereferenced the value in __rht_ptr and operated on it. This causes potential double readings which could be fatal. The RCU dereference must occur prior to the comparison in __rht_ptr. This patch changes the order of RCU dereference so that it is done first and the result is then fed to __rht_ptr. The RCU marking changes have been minimised using casts which will be removed in a follow-up patch. Fixes: ba6306e3f648 ("rhashtable: Remove RCU marking from...") Reported-by: "Gong, Sishuai" Signed-off-by: Herbert Xu Signed-off-by: David S. Miller commit 19016d93bfc335f0c158c0d9e3b9d06c4dd53d39 Author: René van Dorst Date: Thu Jul 23 20:07:10 2020 +0100 net: ethernet: mtk_eth_soc: Always call mtk_gmac0_rgmii_adjust() for mt7623 Modify mtk_gmac0_rgmii_adjust() so it can always be called. mtk_gmac0_rgmii_adjust() sets-up the TRGMII clocks. Signed-off-by: René van Dorst Signed-off-By: David Woodhouse Tested-by: Frank Wunderlich Signed-off-by: David S. Miller commit b5cd55b334f3cdb2562c84626600f3728151ee29 Merge: 2ff34c909f75 350a63249d27 Author: David S. Miller Date: Tue Jul 28 16:55:13 2020 -0700 Merge tag 'mlx5-fixes-2020-07-28' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes-2020-07-28 This series introduces some fixes to mlx5 driver. v1->v2: - Drop the "Hold reference on mirred devices" patch, until Or's comments are addressed. - Imporve "Modify uplink state" patch commit message per Or's request. Please pull and let me know if there is any problem. For -Stable: For -stable v4.9 ('net/mlx5e: Fix error path of device attach') For -stable v4.15 ('net/mlx5: Verify Hardware supports requested ptp function on a given pin') For -stable v5.3 ('net/mlx5e: Modify uplink state on interface up/down') For -stable v5.4 ('net/mlx5e: Fix kernel crash when setting vf VLANID on a VF dev') ('net/mlx5: E-switch, Destroy TSAR when fail to enable the mode') For -stable v5.5 ('net/mlx5: E-switch, Destroy TSAR after reload interface') For -stable v5.7 ('net/mlx5: Fix a bug of using ptp channel index as pin index') ==================== Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 2ff34c909f75d2d145a27b84e2ee6710a6b43446 Merge: e911e99a0770 ea060b352654 Author: David S. Miller Date: Tue Jul 28 13:35:44 2020 -0700 Merge branch 'net-lan78xx-fix-NULL-deref-and-memory-leak' Johan Hovold says: ==================== net: lan78xx: fix NULL deref and memory leak The first two patches fix a NULL-pointer dereference at probe that can be triggered by a malicious device and a small transfer-buffer memory leak, respectively. For another subsystem I would have marked them: Cc: stable@vger.kernel.org # 4.3 The third one replaces the driver's current broken endpoint lookup helper, which could end up accepting incomplete interfaces and whose results weren't even useeren Johan ==================== Signed-off-by: David S. Miller commit ea060b352654a8de1e070140d25fe1b7e4d50310 Author: Johan Hovold Date: Tue Jul 28 14:10:31 2020 +0200 net: lan78xx: replace bogus endpoint lookup Drop the bogus endpoint-lookup helper which could end up accepting interfaces based on endpoints belonging to unrelated altsettings. Note that the returned bulk pipes and interrupt endpoint descriptor were never actually used. Instead the bulk-endpoint numbers are hardcoded to 1 and 2 (matching the specification), while the interrupt- endpoint descriptor was assumed to be the third descriptor created by USB core. Try to bring some order to this by dropping the bogus lookup helper and adding the missing endpoint sanity checks while keeping the interrupt- descriptor assumption for now. Signed-off-by: Johan Hovold Signed-off-by: David S. Miller commit 63634aa679ba8b5e306ad0727120309ae6ba8a8e Author: Johan Hovold Date: Tue Jul 28 14:10:30 2020 +0200 net: lan78xx: fix transfer-buffer memory leak The interrupt URB transfer-buffer was never freed on disconnect or after probe errors. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Cc: Woojung.Huh@microchip.com Signed-off-by: Johan Hovold Signed-off-by: David S. Miller commit 8d8e95fd6d69d774013f51e5f2ee10c6e6d1fc14 Author: Johan Hovold Date: Tue Jul 28 14:10:29 2020 +0200 net: lan78xx: add missing endpoint sanity check Add the missing endpoint sanity check to prevent a NULL-pointer dereference should a malicious device lack the expected endpoints. Note that the driver has a broken endpoint-lookup helper, lan78xx_get_endpoints(), which can end up accepting interfaces in an altsetting without endpoints as long as *some* altsetting has a bulk-in and a bulk-out endpoint. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Cc: Woojung.Huh@microchip.com Signed-off-by: Johan Hovold Signed-off-by: David S. Miller commit e911e99a0770f760377c263bc7bac1b1593c6147 Author: Rustam Kovhaev Date: Mon Jul 27 23:42:17 2020 -0700 usb: hso: check for return value in hso_serial_common_create() in case of an error tty_register_device_attr() returns ERR_PTR(), add IS_ERR() check Reported-and-tested-by: syzbot+67b2bd0e34f952d0321e@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=67b2bd0e34f952d0321e Signed-off-by: Rustam Kovhaev Reviewed-by: Greg Kroah-Hartman Signed-off-by: David S. Miller commit 350a63249d270b1f5bd05c7e2a24cd8de0f9db20 Author: Alaa Hleihel Date: Wed Jul 15 11:46:30 2020 +0300 net/mlx5e: Fix kernel crash when setting vf VLANID on a VF dev After the cited commit, function 'mlx5_eswitch_set_vport_vlan' started to acquire esw->state_lock. However, esw is not defined for VF devices, hence attempting to set vf VLANID on a VF dev will cause a kernel panic. Fix it by moving up the (redundant) esw validation from function '__mlx5_eswitch_set_vport_vlan' since the rest of the callers now have and use a valid esw. For example with vf device eth4: # ip link set dev eth4 vf 0 vlan 0 Trace of the panic: [ 411.409842] BUG: unable to handle page fault for address: 00000000000011b8 [ 411.449745] #PF: supervisor read access in kernel mode [ 411.452348] #PF: error_code(0x0000) - not-present page [ 411.454938] PGD 80000004189c9067 P4D 80000004189c9067 PUD 41899a067 PMD 0 [ 411.458382] Oops: 0000 [#1] SMP PTI [ 411.460268] CPU: 4 PID: 5711 Comm: ip Not tainted 5.8.0-rc4_for_upstream_min_debug_2020_07_08_22_04 #1 [ 411.462447] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [ 411.464158] RIP: 0010:__mutex_lock+0x4e/0x940 [ 411.464928] Code: fd 41 54 49 89 f4 41 52 53 89 d3 48 83 ec 70 44 8b 1d ee 03 b0 01 65 48 8b 04 25 28 00 00 00 48 89 45 c8 31 c0 45 85 db 75 0a <48> 3b 7f 60 0f 85 7e 05 00 00 49 8d 45 68 41 56 41 b8 01 00 00 00 [ 411.467678] RSP: 0018:ffff88841fcd74b0 EFLAGS: 00010246 [ 411.468562] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [ 411.469715] RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000001158 [ 411.470812] RBP: ffff88841fcd7550 R08: ffffffffa00fa1ce R09: 0000000000000000 [ 411.471835] R10: ffff88841fcd7570 R11: 0000000000000000 R12: 0000000000000002 [ 411.472862] R13: 0000000000001158 R14: ffffffffa00fa1ce R15: 0000000000000000 [ 411.474004] FS: 00007faee7ca6b80(0000) GS:ffff88846fc00000(0000) knlGS:0000000000000000 [ 411.475237] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 411.476129] CR2: 00000000000011b8 CR3: 000000041909c006 CR4: 0000000000360ea0 [ 411.477260] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 411.478340] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 411.479332] Call Trace: [ 411.479760] ? __nla_validate_parse.part.6+0x57/0x8f0 [ 411.482825] ? mlx5_eswitch_set_vport_vlan+0x3e/0xa0 [mlx5_core] [ 411.483804] mlx5_eswitch_set_vport_vlan+0x3e/0xa0 [mlx5_core] [ 411.484733] mlx5e_set_vf_vlan+0x41/0x50 [mlx5_core] [ 411.485545] do_setlink+0x613/0x1000 [ 411.486165] __rtnl_newlink+0x53d/0x8c0 [ 411.486791] ? mark_held_locks+0x49/0x70 [ 411.487429] ? __lock_acquire+0x8fe/0x1eb0 [ 411.488085] ? rcu_read_lock_sched_held+0x52/0x60 [ 411.488998] ? kmem_cache_alloc_trace+0x16d/0x2d0 [ 411.489759] rtnl_newlink+0x47/0x70 [ 411.490357] rtnetlink_rcv_msg+0x24e/0x450 [ 411.490978] ? netlink_deliver_tap+0x92/0x3d0 [ 411.491631] ? validate_linkmsg+0x330/0x330 [ 411.492262] netlink_rcv_skb+0x47/0x110 [ 411.492852] netlink_unicast+0x1ac/0x270 [ 411.493551] netlink_sendmsg+0x336/0x450 [ 411.494209] sock_sendmsg+0x30/0x40 [ 411.494779] ____sys_sendmsg+0x1dd/0x1f0 [ 411.495378] ? copy_msghdr_from_user+0x5c/0x90 [ 411.496082] ___sys_sendmsg+0x87/0xd0 [ 411.496683] ? lock_acquire+0xb9/0x3a0 [ 411.497322] ? lru_cache_add+0x5/0x170 [ 411.497944] ? find_held_lock+0x2d/0x90 [ 411.498568] ? handle_mm_fault+0xe46/0x18c0 [ 411.499205] ? __sys_sendmsg+0x51/0x90 [ 411.499784] __sys_sendmsg+0x51/0x90 [ 411.500341] do_syscall_64+0x59/0x2e0 [ 411.500938] ? asm_exc_page_fault+0x8/0x30 [ 411.501609] ? rcu_read_lock_sched_held+0x52/0x60 [ 411.502350] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 411.503093] RIP: 0033:0x7faee73b85a7 [ 411.503654] Code: Bad RIP value. Fixes: 0e18134f4f9f ("net/mlx5e: Eswitch, use state_lock to synchronize vlan change") Signed-off-by: Alaa Hleihel Reviewed-by: Roi Dayan Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 7d0314b11cdd92bca8b89684c06953bf114605fc Author: Ron Diskin Date: Sun Apr 5 13:58:40 2020 +0300 net/mlx5e: Modify uplink state on interface up/down When setting the PF interface up/down, notify the firmware to update uplink state via MODIFY_VPORT_STATE, when E-Switch is enabled. This behavior will prevent sending traffic out on uplink port when PF is down, such as sending traffic from a VF interface which is still up. Currently when calling mlx5e_open/close(), the driver only sends PAOS command to notify the firmware to set the physical port state to up/down, however, it is not sufficient. When VF is in "auto" state, it follows the uplink state, which was not updated on mlx5e_open/close() before this patch. When switchdev mode is enabled and uplink representor is first enabled, set the uplink port state value back to its FW default "AUTO". Fixes: 63bfd399de55 ("net/mlx5e: Send PAOS command on interface up/down") Signed-off-by: Ron Diskin Reviewed-by: Roi Dayan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit ed56d749c366be269d58b29597392e4a0ae71c0a Author: Eran Ben Elisha Date: Mon Jul 20 18:34:37 2020 +0300 net/mlx5: Query PPS pin operational status before registering it In a special configuration, a ConnectX6-Dx pin pps-out might be activated when driver is loaded. Fix the driver to always read the operational pin mode when registering it, and advertise it accordingly. Fixes: ee7f12205abc ("net/mlx5e: Implement 1PPS support") Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 21083309cab1a66877b410cd61340b5dd7cf4875 Author: Raed Salem Date: Thu Jul 9 15:51:53 2020 +0300 net/mlx5e: Fix slab-out-of-bounds in mlx5e_rep_is_lag_netdev mlx5e_rep_is_lag_netdev is used as first check as part of netdev events handler for bond device of non-uplink representors, this handler can get any netdevice under the same network namespace of mlx5e netdevice. Current code treats the netdev as mlx5e netdev and only later on verifies this, hence causes the following Kasan trace: [15402.744990] ================================================================== [15402.746942] BUG: KASAN: slab-out-of-bounds in mlx5e_rep_is_lag_netdev+0xcb/0xf0 [mlx5_core] [15402.749009] Read of size 8 at addr ffff880391f3f6b0 by task ovs-vswitchd/5347 [15402.752065] CPU: 7 PID: 5347 Comm: ovs-vswitchd Kdump: loaded Tainted: G B O --------- -t - 4.18.0-g3dcc204d291d-dirty #1 [15402.755349] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [15402.757600] Call Trace: [15402.758968] dump_stack+0x71/0xab [15402.760427] print_address_description+0x6a/0x270 [15402.761969] kasan_report+0x179/0x2d0 [15402.763445] ? mlx5e_rep_is_lag_netdev+0xcb/0xf0 [mlx5_core] [15402.765121] mlx5e_rep_is_lag_netdev+0xcb/0xf0 [mlx5_core] [15402.766782] mlx5e_rep_esw_bond_netevent+0x129/0x620 [mlx5_core] Fix by deferring the violating access to be post the netdev verify check. Fixes: 7e51891a237f ("net/mlx5e: Use netdev events to set/del egress acl forward-to-vport rule") Signed-off-by: Raed Salem Reviewed-by: Roi Dayan Reviewed-by: Vu Pham Signed-off-by: Saeed Mahameed commit 071995c877a8646209d55ff8edddd2b054e7424c Author: Eran Ben Elisha Date: Wed Jul 8 11:10:01 2020 +0300 net/mlx5: Verify Hardware supports requested ptp function on a given pin Fix a bug where driver did not verify Hardware pin capabilities for PTP functions. Fixes: ee7f12205abc ("net/mlx5e: Implement 1PPS support") Signed-off-by: Eran Ben Elisha Reviewed-by: Ariel Levkovich Signed-off-by: Saeed Mahameed commit 88c8cf92db48b2e359fe3051ad8e09829c1bee5d Author: Eran Ben Elisha Date: Wed Jul 8 18:53:19 2020 +0300 net/mlx5: Fix a bug of using ptp channel index as pin index On PTP mlx5_ptp_enable(on=0) flow, driver mistakenly used channel index as pin index. After ptp patch marked in fixes tag was introduced, driver can freely call ptp_find_pin() as part of the .enable() callback. Fix driver mlx5_ptp_enable(on=0) flow to always use ptp_find_pin(). With that, Driver will use the correct pin index in mlx5_ptp_enable(on=0) flow. In addition, when initializing the pins, always set channel to zero. As all pins can be attached to all channels, let ptp_set_pinfunc() to move them between the channels. For stable branches, this fix to be applied only on kernels that includes both patches in fixes tag. Otherwise, mlx5_ptp_enable(on=0) will be stuck on pincfg_mux. Fixes: 62582a7ee783 ("ptp: Avoid deadlocks in the programmable pin code.") Fixes: ee7f12205abc ("net/mlx5e: Implement 1PPS support") Signed-off-by: Eran Ben Elisha Reviewed-by: Ariel Levkovich Signed-off-by: Saeed Mahameed commit 0e2e7aa57b8060ee357839dc4f1731a724ba387b Author: Maor Dickman Date: Wed Jul 8 13:01:36 2020 +0300 net/mlx5e: Fix missing cleanup of ethtool steering during rep rx cleanup The cited commit add initialization of ethtool steering during representor rx initializations without cleaning it up in representor rx cleanup, this may cause for stale ethtool flows to remain after moving back from switchdev mode to legacy mode. Fixed by calling ethtool steering cleanup during rep rx cleanup. Fixes: 6783e8b29f63 ("net/mlx5e: Init ethtool steering for representors") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 5cd39b6e9a420329a9a408894be7ba8aa7dd755e Author: Aya Levin Date: Wed Jul 1 12:21:53 2020 +0300 net/mlx5e: Fix error path of device attach On failure to attach the netdev, fix the rollback by re-setting the device's state back to MLX5E_STATE_DESTROYING. Failing to attach doesn't stop statistics polling via .ndo_get_stats64. In this case, although the device is not attached, it falsely continues to query the firmware for counters. Setting the device's state back to MLX5E_STATE_DESTROYING prevents the firmware counters query. Fixes: 26e59d8077a3 ("net/mlx5e: Implement mlx5e interface attach/detach callbacks") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 59f8f7c84c506cd4fafbfa47acd23ebdb6256dac Author: Maor Gottlieb Date: Thu Jun 25 10:56:07 2020 +0300 net/mlx5: Fix forward to next namespace The steering tree is as follow (nic RX as example): --------- |root_ns| --------- | -------------------------------- | | | ---------- ---------- --------- |p(prio)0| | p1 | | pn | ---------- ---------- --------- | | ---------------- --------------- |ns(e.g bypass)| |ns(e.g. lag) | ---------------- --------------- | | | ---- ---- ---- |p0| |p1| |pn| ---- ---- ---- | ---- |FT| ---- find_next_chained_ft(prio) returns the first flow table in the next priority. If prio is a parent of a flow table then it returns the first flow table in the next priority in the same namespace, else if prio is parent of namespace, then it should return the first flow table in the next namespace. Currently if the user requests to forward to next namespace, the code calls to find_next_chained_ft with the prio of the next namespace and not the prio of the namesapce itself. Fixes: 9254f8ed15b6 ("net/mlx5: Add support in forward to namespace") Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 0c2600c619578f759cf3d5192b01bd14e281f24c Author: Parav Pandit Date: Sat Jun 27 13:11:56 2020 +0300 net/mlx5: E-switch, Destroy TSAR after reload interface When eswitch offloads is enabled, TSAR is created before reloading the interfaces. However when eswitch offloads mode is disabled, TSAR is disabled before reloading the interfaces. To keep the eswitch enable/disable sequence as mirror, destroy TSAR after reloading the interfaces. Fixes: 1bd27b11c1df ("net/mlx5: Introduce E-switch QoS management") Signed-off-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 2b8e9c7c3fd0e31091edb1c66cc06ffe4988ca21 Author: Parav Pandit Date: Sat Jun 27 13:29:28 2020 +0300 net/mlx5: E-switch, Destroy TSAR when fail to enable the mode When either esw_legacy_enable() or esw_offloads_enable() fails, code missed to destroy the created TSAR. Hence, add the missing call to destroy the TSAR. Fixes: 610090ebce92 ("net/mlx5: E-switch, Initialize TSAR Qos hardware block before its user vports") Signed-off-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 7a9212d1783192eb087a24f7ef47e777e1d1a790 Merge: 181964e619b7 b7b5d25bdd7b Author: David S. Miller Date: Tue Jul 28 12:54:48 2020 -0700 Merge branch 'hns3-fixes' Huazhong Tan says: ==================== net: hns3: fixes for -net There are some bugfixes for the HNS3 ethernet driver. patch#1 fixes a desc filling bug, patch#2 fixes a false TX timeout issue, and patch#3~#5 fixes some bugs related to VLAN and FD. ==================== Signed-off-by: David S. Miller commit b7b5d25bdd7bdea7d72a41e0a97b1b8f3dea2ee7 Author: Guojia Liao Date: Tue Jul 28 10:16:52 2020 +0800 net: hns3: fix for VLAN config when reset failed When device is resetting or reset failed, firmware is unable to handle mailbox. VLAN should not be configured in this case. Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit efe3fa45f770f1d66e2734ee7a3523c75694ff04 Author: Guojia Liao Date: Tue Jul 28 10:16:51 2020 +0800 net: hns3: fix aRFS FD rules leftover after add a user FD rule When user had created a FD rule, all the aRFS rules should be clear up. HNS3 process flow as below: 1.get spin lock of fd_ruls_list 2.clear up all aRFS rules 3.release lock 4.get spin lock of fd_ruls_list 5.creat a rules 6.release lock; There is a short period of time between step 3 and step 4, which would creatting some new aRFS FD rules if driver was receiving packet. So refactor the fd_rule_lock to fix it. Fixes: 441228875706 ("net: hns3: refine the flow director handle") Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit a6f7bfdc78ddd8d719d108fef973b4e4a5a6ac6b Author: Jian Shen Date: Tue Jul 28 10:16:50 2020 +0800 net: hns3: add reset check for VF updating port based VLAN Currently hclgevf_update_port_base_vlan_info() may be called when VF is resetting, which may cause hns3_nic_net_open() being called twice unexpectedly. So fix it by adding a reset check for it, and extend critical region for rntl_lock in hclgevf_update_port_base_vlan_info(). Fixes: 92f11ea177cd ("net: hns3: fix set port based VLAN issue for VF") Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit a7e90ee5965fafc53d36e8b3205f08c88d7bc11f Author: Yonglong Liu Date: Tue Jul 28 10:16:49 2020 +0800 net: hns3: fix a TX timeout issue When the queue depth and queue parameters are modified, there is a low probability that TX timeout occurs. The two operations cause the link to be down or up when the watchdog is still working. All queues are stopped when the link is down. After the carrier is on, all queues are woken up. If the watchdog detects the link between the carrier on and wakeup queues, a false TX timeout occurs. So fix this issue by modifying the sequence of carrier on and queue wakeup, which is symmetrical to the link down action. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit cfdaeba5ddc98b303639a3265c2031ac5db249d6 Author: Yunsheng Lin Date: Tue Jul 28 10:16:48 2020 +0800 net: hns3: fix desc filling bug when skb is expanded or lineared The linear and frag data part may be changed when the skb is expanded or lineared in skb_cow_head() or skb_checksum_help(), which is called by hns3_fill_skb_desc(), so the linear len return by skb_headlen() before the calling of hns3_fill_skb_desc() is unreliable. Move hns3_fill_skb_desc() before the calling of skb_headlen() to fix this bug. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 6ba1b005ffc388c2aeaddae20da29e4810dea298 Merge: fb896c910712 214ba3584b2e Author: Linus Torvalds Date: Tue Jul 28 11:55:53 2020 -0700 Merge tag 'asm-generic-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic into master Pull asm-generic bugfix from Arnd Bergmann: "A single bugfix for a regression introduced through a typo in the v5.8 merge window, leading to incorrect data returned from inl() on some architectures" * tag 'asm-generic-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: io: Fix return type of _inb and _inl commit fb896c9107127ec80263225dc060d9622697d76b Merge: 4764e61e1d57 fe1d899f4212 Author: Linus Torvalds Date: Tue Jul 28 11:44:44 2020 -0700 Merge tag 'arm-fixes-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into master Pull ARM SoC DT fixes from Arnd Bergmann: "These are the latest device tree fixes for Arm SoCs: - TI Keystone2 ethernet regressed after a driver change broke with incorrect phy-mode in a board's DT source. - A similar fix is needed for two i.MX boards that were missed in an earlier bugfix. - DT change for Armada 38x allowing to add the register needed to fix NETA lockup when repeatedly switching speed. - One fix on imx6qdl-icore pin muxing to get USB OTG_ID and SD card detect work correctly. - Two fixes for the Allwinner SoCs, one to relax the CMA allocation ranges that were failing on older SoCs and one to fix Cedrus on the H6" * tag 'arm-fixes-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: dts: keystone-k2g-evm: fix rgmii phy-mode for ksz9031 phy ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2 ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2 arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage ARM: dts sunxi: Relax a bit the CMA pool allocation range commit 8808981baf96e1b3dea1f08461e4d958aa0dbde1 Author: Wolfram Sang Date: Sat Jul 25 21:50:53 2020 +0200 i2c: slave: add sanity check when unregistering Signed-off-by: Wolfram Sang Reviewed-by: Alain Volmat Signed-off-by: Wolfram Sang commit 1b1be3bf27b62f5abcf85c6f3214bdb9c7526685 Author: Wolfram Sang Date: Sat Jul 25 21:50:52 2020 +0200 i2c: slave: improve sanity check when registering Add check for ERR_PTR and simplify code while here. Signed-off-by: Wolfram Sang Reviewed-by: Alain Volmat Signed-off-by: Wolfram Sang commit c2c3657f0aedb8736a0fb7b2b1985adfb86e7802 Author: Takashi Iwai Date: Tue Jul 28 10:20:33 2020 +0200 ALSA: hda/hdmi: Fix keep_power assignment for non-component devices It's been reported that, when neither nouveau nor Nvidia graphics driver is used, the screen starts flickering. And, after comparing between the working case (stable 4.4.x) and the broken case, it turned out that the problem comes from the audio component binding. The Nvidia and AMD audio binding code clears the bus->keep_power flag whenever snd_hdac_acomp_init() succeeds. But this doesn't mean that the component is actually bound, but it merely indicates that it's ready for binding. So, when both nouveau and Nvidia are blacklisted or not ready, the driver keeps running without the audio component but also with bus->keep_power = false. This made the driver runtime PM kicked in and powering down when unused, which results in flickering in the graphics side, as it seems. For fixing the bug, this patch moves the bus->keep_power flag change into generic_acomp_notifier_set() that is the function called from the master_bind callback of component ops; i.e. it's guaranteed that the binding succeeded. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208609 Fixes: 5a858e79c911 ("ALSA: hda - Disable audio component for legacy Nvidia HDMI codecs") Cc: Link: https://lore.kernel.org/r/20200728082033.23933-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit b757b47a2fcba584d4a32fd7ee68faca510ab96f Author: Will Deacon Date: Thu Jul 23 11:17:14 2020 +0100 KVM: arm64: Don't inherit exec permission across page-table levels If a stage-2 page-table contains an executable, read-only mapping at the pte level (e.g. due to dirty logging being enabled), a subsequent write fault to the same page which tries to install a larger block mapping (e.g. due to dirty logging having been disabled) will erroneously inherit the exec permission and consequently skip I-cache invalidation for the rest of the block. Ensure that exec permission is only inherited by write faults when the new mapping is of the same size as the existing one. A subsequent instruction abort will result in I-cache invalidation for the entire block mapping. Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Tested-by: Quentin Perret Reviewed-by: Quentin Perret Cc: Marc Zyngier Cc: Link: https://lore.kernel.org/r/20200723101714.15873-1-will@kernel.org commit bf4086b1a1efa3d3a2c17582e00bbd2176dfe177 Author: Marc Zyngier Date: Wed Jul 22 17:22:31 2020 +0100 KVM: arm64: Prevent vcpu_has_ptrauth from generating OOL functions So far, vcpu_has_ptrauth() is implemented in terms of system_supports_*_auth() calls, which are declared "inline". In some specific conditions (clang and SCS), the "inline" very much turns into an "out of line", which leads to a fireworks when this predicate is evaluated on a non-VHE system (right at the beginning of __hyp_handle_ptrauth). Instead, make sure vcpu_has_ptrauth gets expanded inline by directly using the cpus_have_final_cap() helpers, which are __always_inline, generate much better code, and are the only thing that make sense when running at EL2 on a nVHE system. Fixes: 29eb5a3c57f7 ("KVM: arm64: Handle PtrAuth traps early") Reported-by: Nathan Chancellor Reported-by: Nick Desaulniers Signed-off-by: Marc Zyngier Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20200722162231.3689767-1-maz@kernel.org commit d5dba1376e2bafec0f4408dc65706c5908964083 Author: Sabrina Dubroca Date: Mon Jul 27 16:03:47 2020 +0200 xfrm: esp6: fix the location of the transport header with encapsulation commit 17175d1a27c6 ("xfrm: esp6: fix encapsulation header offset computation") changed esp6_input_done2 to correctly find the size of the IPv6 header that precedes the TCP/UDP encapsulation header, but didn't adjust the final call to skb_set_transport_header, which I assumed was correct in using skb_network_header_len. Xiumei Mu reported that when we create xfrm states that include port numbers in the selector, traffic from the user sockets is dropped. It turns out that we get a state mismatch in __xfrm_policy_check, because we end up trying to compare the encapsulation header's ports with the selector that's based on user traffic ports. Fixes: 0146dca70b87 ("xfrm: add support for UDPv6 encapsulation of ESP") Fixes: 26333c37fc28 ("xfrm: add IPv6 support for espintcp") Reported-by: Xiumei Mu Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 4764e61e1d57c0bc3569dbc540af8bb28e18d2e6 Merge: 92ed30191993 04a8a3d0a73f Author: Linus Torvalds Date: Mon Jul 27 17:04:45 2020 -0700 Merge tag 'sh-for-5.8-part2' of git://git.libc.org/linux-sh into master Pull arch/sh fixes from Rich Felker: "Two last-minute fixes: one is for a boot regression (mmu code broken) and the other fixes a long-standing broken syscall number bounds check" * tag 'sh-for-5.8-part2' of git://git.libc.org/linux-sh: sh: Fix validation of system call number sh/tlb: Fix PGTABLE_LEVELS > 2 commit 181964e619b76ae2e71bcdc6001cf977bec4cf6e Author: Al Viro Date: Mon Jul 27 19:22:20 2020 +0100 fix a braino in cmsghdr_from_user_compat_to_kern() commit 547ce4cfb34c ("switch cmsghdr_from_user_compat_to_kern() to copy_from_user()") missed one of the places where ucmlen should've been replaced with cmsg.cmsg_len, now that we are fetching the entire struct rather than doing it field-by-field. As the result, compat sendmsg() with several different-sized cmsg attached started to fail with EINVAL. Trivial to fix, fortunately. Fixes: 547ce4cfb34c ("switch cmsghdr_from_user_compat_to_kern() to copy_from_user()") Reported-by: Nick Bowler Tested-by: Nick Bowler Signed-off-by: Al Viro Signed-off-by: David S. Miller commit 04a8a3d0a73f51c7c2da84f494db7ec1df230e69 Author: Michael Karcher Date: Thu Jul 23 01:13:19 2020 +0200 sh: Fix validation of system call number The slow path for traced system call entries accessed a wrong memory location to get the number of the maximum allowed system call number. Renumber the numbered "local" label for the correct location to avoid collisions with actual local labels. Signed-off-by: Michael Karcher Tested-by: John Paul Adrian Glaubitz Fixes: f3a8308864f920d2 ("sh: Add a few missing irqflags tracing markers.") Signed-off-by: Rich Felker commit c7bcbc8ab9cb20536b8f50c62a48cebda965fdba Author: Peter Zijlstra Date: Fri Jul 17 13:10:07 2020 +0200 sh/tlb: Fix PGTABLE_LEVELS > 2 Geert reported that his SH7722-based Migo-R board failed to boot after commit: c5b27a889da9 ("sh/tlb: Convert SH to generic mmu_gather") That commit fell victim to copying the wrong pattern -- __pmd_free_tlb() used to be implemented with pmd_free(). Fixes: c5b27a889da9 ("sh/tlb: Convert SH to generic mmu_gather") Reported-by: Geert Uytterhoeven Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Rich Felker commit 8490d6a7e0a0a6fab5c2d82d57a3937306660864 Author: Steve Cohen Date: Mon Jul 20 18:30:50 2020 -0400 drm: hold gem reference until object is no longer accessed A use-after-free in drm_gem_open_ioctl can happen if the GEM object handle is closed between the idr lookup and retrieving the size from said object since a local reference is not being held at that point. Hold the local reference while the object can still be accessed to fix this and plug the potential security hole. Signed-off-by: Steve Cohen Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1595284250-31580-1-git-send-email-cohens@codeaurora.org commit 11d268107ad4c7d694148269e3b23ef43dd0e8ba Merge: 5fd82200d870 94b6c13be57c Author: David S. Miller Date: Mon Jul 27 12:56:59 2020 -0700 Merge branch 'selftests-net-Fix-clang-warnings-on-powerpc' Tanner Love says: ==================== selftests/net: Fix clang warnings on powerpc This is essentially a v2 of http://patchwork.ozlabs.org/project/netdev/patch/20200724181757.2331172-1-tannerlove.kernel@gmail.com/, but it has been split up in order to have only one "Fixes" tag per patch. ==================== Signed-off-by: David S. Miller commit 94b6c13be57cdedb7cf4d33dbcd066fad133f22b Author: Tanner Love Date: Mon Jul 27 12:25:31 2020 -0400 selftests/net: tcp_mmap: fix clang warning for target arch PowerPC When size_t maps to unsigned int (e.g. on 32-bit powerpc), then the comparison with 1<<35 is always true. Clang 9 threw: warning: result of comparison of constant 34359738368 with \ expression of type 'size_t' (aka 'unsigned int') is always true \ [-Wtautological-constant-out-of-range-compare] while (total < FILE_SZ) { Tested: make -C tools/testing/selftests TARGETS="net" run_tests Fixes: 192dc405f308 ("selftests: net: add tcp_mmap program") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit b4da96ffd30bd4a305045ba5c9b0de5d4aa20dc7 Author: Tanner Love Date: Mon Jul 27 12:25:30 2020 -0400 selftests/net: so_txtime: fix clang issues for target arch PowerPC On powerpcle, int64_t maps to long long. Clang 9 threw: warning: absolute value function 'labs' given an argument of type \ 'long long' but has parameter of type 'long' which may cause \ truncation of value [-Wabsolute-value] if (labs(tstop - texpect) > cfg_variance_us) Tested: make -C tools/testing/selftests TARGETS="net" run_tests Fixes: af5136f95045 ("selftests/net: SO_TXTIME with ETF and FQ") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 64f9ede2274980076423583683d44480909b7a40 Author: Tanner Love Date: Mon Jul 27 12:25:29 2020 -0400 selftests/net: psock_fanout: fix clang issues for target arch PowerPC Clang 9 threw: warning: format specifies type 'unsigned short' but the argument has \ type 'int' [-Wformat] typeflags, PORT_BASE, PORT_BASE + port_off); Tested: make -C tools/testing/selftests TARGETS="net" run_tests Fixes: 77f65ebdca50 ("packet: packet fanout rollover during socket overload") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 955cbe91bcf782c09afe369c95a20f0a4b6dcc3c Author: Tanner Love Date: Mon Jul 27 12:25:28 2020 -0400 selftests/net: rxtimestamp: fix clang issues for target arch PowerPC The signedness of char is implementation-dependent. Some systems (including PowerPC and ARM) use unsigned char. Clang 9 threw: warning: result of comparison of constant -1 with expression of type \ 'char' is always true [-Wtautological-constant-out-of-range-compare] &arg_index)) != -1) { Tested: make -C tools/testing/selftests TARGETS="net" run_tests Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 5fd82200d870a5dd3e509c98ef2041f580b2c0e1 Author: laurent brando Date: Mon Jul 27 18:26:14 2020 +0800 net: mscc: ocelot: fix hardware timestamp dequeue logic The next hw timestamp should be snapshoot to the read registers only once the current timestamp has been read. If none of the pending skbs matches the current HW timestamp just gracefully flush the available timestamp by reading it. Signed-off-by: laurent brando Signed-off-by: Vladimir Oltean Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 367fe04eb64760fab400bdc990cc6067071e1e39 Author: Matthieu Baerts Date: Mon Jul 27 12:24:33 2020 +0200 mptcp: fix joined subflows with unblocking sk Unblocking sockets used for outgoing connections were not containing inet info about the initial connection due to a typo there: the value of "err" variable is negative in the kernelspace. This fixes the creation of additional subflows where the remote port has to be reused if the other host didn't announce another one. This also fixes inet_diag showing blank info about MPTCP sockets from unblocking sockets doing a connect(). Fixes: 41be81a8d3d0 ("mptcp: fix unblocking connect()") Signed-off-by: Matthieu Baerts Acked-by: Paolo Abeni Signed-off-by: David S. Miller commit 900ab59e2621053b009f707f80b2c19ce0af5dee Author: Paul Cercueil Date: Fri Jul 3 16:13:41 2020 +0200 drm/dbi: Fix SPI Type 1 (9-bit) transfer The function mipi_dbi_spi1_transfer() will transfer its payload as 9-bit data, the 9th (MSB) bit being the data/command bit. In order to do that, it unpacks the 8-bit values into 16-bit values, then sets the 9th bit if the byte corresponds to data, clears it otherwise. The 7 MSB are padding. The array of now 16-bit values is then passed to the SPI core for transfer. This function was broken since its introduction, as the length of the SPI transfer was set to the payload size before its conversion, but the payload doubled in size due to the 8-bit -> 16-bit conversion. Fixes: 02dd95fe3169 ("drm/tinydrm: Add MIPI DBI support") Cc: # 5.4+ Signed-off-by: Paul Cercueil Reviewed-by: Sam Ravnborg Reviewed-by: Noralf Trønnes Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200703141341.1266263-1-paul@crapouillou.net commit d076947912696efc1e223b25799a025cd73d6a22 Author: Akash Asthana Date: Mon Jul 27 13:56:00 2020 +0530 MAINTAINERS: Update GENI I2C maintainers list Alok Chauhan has moved out of GENI team, he no longer supports GENI I2C driver, remove him from maintainer list. Add Akash Asthana & Mukesh Savaliya as maintainers for GENI I2C drivers. Signed-off-by: Akash Asthana Signed-off-by: Wolfram Sang commit 8be23aec0ee151de731626d5578973fde25b2285 Author: Wolfram Sang Date: Sat Jul 25 16:07:36 2020 +0200 i2c: also convert placeholder function to return errno All i2c_new_device-alike functions return ERR_PTR these days, but this fallback function was missed. Fixes: 2dea645ffc21 ("i2c: acpi: Return error pointers from i2c_acpi_new_device()") Signed-off-by: Wolfram Sang Reviewed-by: Andy Shevchenko [wsa: changed from 'ENOSYS' to 'ENODEV'] Signed-off-by: Wolfram Sang commit a6630529aecb5a3e84370c376ed658e892e6261e Author: Takashi Iwai Date: Mon Jul 27 18:44:43 2020 +0200 ALSA: hda: Workaround for spurious wakeups on some Intel platforms We've received a regression report on Intel HD-audio controller that wakes up immediately after S3 suspend. The bisection leads to the commit c4c8dd6ef807 ("ALSA: hda: Skip controller resume if not needed"). This commit replaces the system-suspend to use pm_runtime_force_suspend() instead of the direct call of __azx_runtime_suspend(). However, by some really mysterious reason, pm_runtime_force_suspend() causes a spurious wakeup (although it calls the same __azx_runtime_suspend() internally). As an ugly workaround for now, revert the behavior to call __azx_runtime_suspend() and __azx_runtime_resume() for those old Intel platforms that may exhibit such a problem, while keeping the new standard pm_runtime_force_suspend() and pm_runtime_force_resume() pair for the remaining chips. Fixes: c4c8dd6ef807 ("ALSA: hda: Skip controller resume if not needed") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208649 Cc: Link: https://lore.kernel.org/r/20200727164443.4233-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5351a56b1a4ceafd7a17ebfdf3cda430cdfd365d Author: Jason Gunthorpe Date: Mon Jul 27 12:57:12 2020 +0300 RDMA/mlx5: Fix prefetch memory leak if get_prefetchable_mr fails destroy_prefetch_work() must always be called if the work is not going to be queued. The num_sge also should have been set to i, not i-1 which avoids the condition where it shouldn't have been called in the first place. Cc: stable@vger.kernel.org Fixes: fb985e278a30 ("RDMA/mlx5: Use SRCU properly in ODP prefetch") Link: https://lore.kernel.org/r/20200727095712.495652-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 31142a4ba617f5aa8aefdf1c65561ca30d43f360 Author: Jason Gunthorpe Date: Fri Jul 24 10:19:29 2020 -0300 RDMA/cm: Add min length checks to user structure copies These are missing throughout ucma, it harmlessly copies garbage from userspace, but in this new code which uses min to compute the copy length it can result in uninitialized stack memory. Check for minimum length at the very start. BUG: KMSAN: uninit-value in ucma_connect+0x2aa/0xab0 drivers/infiniband/core/ucma.c:1091 CPU: 0 PID: 8457 Comm: syz-executor069 Not tainted 5.8.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1df/0x240 lib/dump_stack.c:118 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215 ucma_connect+0x2aa/0xab0 drivers/infiniband/core/ucma.c:1091 ucma_write+0x5c5/0x630 drivers/infiniband/core/ucma.c:1764 do_loop_readv_writev fs/read_write.c:737 [inline] do_iter_write+0x710/0xdc0 fs/read_write.c:1020 vfs_writev fs/read_write.c:1091 [inline] do_writev+0x42d/0x8f0 fs/read_write.c:1134 __do_sys_writev fs/read_write.c:1207 [inline] __se_sys_writev+0x9b/0xb0 fs/read_write.c:1204 __x64_sys_writev+0x4a/0x70 fs/read_write.c:1204 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 34e2ab57a911 ("RDMA/ucma: Extend ucma_connect to receive ECE parameters") Fixes: 0cb15372a615 ("RDMA/cma: Connect ECE to rdma_accept") Link: https://lore.kernel.org/r/0-v1-d5b86dab17dc+28c25-ucma_syz_min_jgg@nvidia.com Reported-by: syzbot+086ab5ca9eafd2379aa6@syzkaller.appspotmail.com Reported-by: syzbot+7446526858b83c8828b2@syzkaller.appspotmail.com Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2a1658bf922ffd9b7907e270a7d9cdc9643fc45d Author: Sam Ravnborg Date: Thu Jul 9 21:30:16 2020 +0200 drm/drm_fb_helper: fix fbdev with sparc64 Recent kernels have been reported to panic using the bochs_drm framebuffer under qemu-system-sparc64 which was bisected to commit 7a0483ac4ffc ("drm/bochs: switch to generic drm fbdev emulation"). The backtrace indicates that the shadow framebuffer copy in drm_fb_helper_dirty_blit_real() is trying to access the real framebuffer using a virtual address rather than use an IO access typically implemented using a physical (ASI_PHYS) access on SPARC. The fix is to replace the memcpy with memcpy_toio() from io.h. memcpy_toio() uses writeb() where the original fbdev code used sbus_memcpy_toio(). The latter uses sbus_writeb(). The difference between writeb() and sbus_memcpy_toio() is that writeb() writes bytes in little-endian, where sbus_writeb() writes bytes in big-endian. As endian does not matter for byte writes they are the same. So we can safely use memcpy_toio() here. Note that this only fixes bochs, in general fbdev helpers still have issues with mixing up system memory and __iomem space. Fixing that will require a lot more work. v3: - Improved changelog (Daniel) - Added FIXME to fbdev_use_iomem (Daniel) v2: - Added missing __iomem cast (kernel test robot) - Made changelog readable and fix typos (Mark) - Add flag to select iomem - and set it in the bochs driver Signed-off-by: Sam Ravnborg Reported-by: Mark Cave-Ayland Reported-by: kernel test robot Tested-by: Mark Cave-Ayland Reviewed-by: Daniel Vetter Cc: Mark Cave-Ayland Cc: Thomas Zimmermann Cc: Gerd Hoffmann Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200709193016.291267-1-sam@ravnborg.org Link: https://patchwork.freedesktop.org/patch/msgid/20200725191012.GA434957@ravnborg.org commit 5e105c88ab4859bc1aedd29e8d2f55e599427035 Author: Paolo Bonzini Date: Mon Jul 27 08:55:09 2020 -0400 KVM: nVMX: check for invalid hdr.vmx.flags hdr.vmx.flags is meant for future extensions to the ABI, rejecting invalid flags is necessary to avoid broken half-loads of the nVMX state. Signed-off-by: Paolo Bonzini commit 0f02bd0ade9a552492463c0159abbe26c4d92b40 Author: Paolo Bonzini Date: Mon Jul 27 09:00:37 2020 -0400 KVM: nVMX: check for required but missing VMCS12 in KVM_SET_NESTED_STATE A missing VMCS12 was not causing -EINVAL (it was just read with copy_from_user, so it is not a security issue, but it is still wrong). Test for VMCS12 validity and reject the nested state if a VMCS12 is required but not present. Signed-off-by: Paolo Bonzini commit 9319676595a2da8022327119e89c8b13f934835e Author: Paolo Bonzini Date: Mon Jul 27 08:45:00 2020 -0400 selftests: kvm: do not set guest mode flag Setting KVM_STATE_NESTED_GUEST_MODE enables various consistency checks on VMCS12 and therefore causes KVM_SET_NESTED_STATE to fail spuriously with -EINVAL. Do not set the flag so that we're sure to cover the conditions included by the test, and cover the case where VMCS12 is set and KVM_SET_NESTED_STATE is called with invalid VMCS12 contents. Signed-off-by: Paolo Bonzini commit 6fa38ef1534e7e9320aa15e329eb1404ab2f70ac Author: PeiSen Hou Date: Mon Jul 27 13:56:47 2020 +0200 ALSA: hda/realtek: Fix add a "ultra_low_power" function for intel reference board (alc256) Intel requires to enable power saving mode for intel reference board (alc256) Signed-off-by: PeiSen Hou Cc: Link: https://lore.kernel.org/r/20200727115647.10967-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 214ba3584b2e2c57536fa8aed52521ac59c5b448 Author: Stafford Horne Date: Sun Jul 26 12:11:54 2020 +0900 io: Fix return type of _inb and _inl The return type of functions _inb, _inw and _inl are all u16 which looks wrong. This patch makes them u8, u16 and u32 respectively. The original commit text for these does not indicate that these should be all forced to u16. Fixes: f009c89df79a ("io: Provide _inX() and _outX()") Signed-off-by: Stafford Horne Reviewed-by: John Garry Signed-off-by: Arnd Bergmann commit 909adfc66b9a1db21b5e8733e9ebfa6cd5135d74 Author: Nicholas Piggin Date: Mon Jul 27 16:09:47 2020 +1000 powerpc/64s/hash: Fix hash_preload running with interrupts enabled Commit 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the caller") removed the local_irq_disable from hash_preload, but it was required for more than just the page table walk: the hash pte busy bit is effectively a lock which may be taken in interrupt context, and the local update flag test must not be preempted before it's used. This solves apparent lockups with perf interrupting __hash_page_64K. If get_perf_callchain then also takes a hash fault on the same page while it is already locked, it will loop forever taking hash faults, which looks like this: cpu 0x49e: Vector: 100 (System Reset) at [c00000001a4f7d70] pc: c000000000072dc8: hash_page_mm+0x8/0x800 lr: c00000000000c5a4: do_hash_page+0x24/0x38 sp: c0002ac1cc69ac70 msr: 8000000000081033 current = 0xc0002ac1cc602e00 paca = 0xc00000001de1f280 irqmask: 0x03 irq_happened: 0x01 pid = 20118, comm = pread2_processe Linux version 5.8.0-rc6-00345-g1fad14f18bc6 49e:mon> t [c0002ac1cc69ac70] c00000000000c5a4 do_hash_page+0x24/0x38 (unreliable) --- Exception: 300 (Data Access) at c00000000008fa60 __copy_tofrom_user_power7+0x20c/0x7ac [link register ] c000000000335d10 copy_from_user_nofault+0xf0/0x150 [c0002ac1cc69af70] c00032bf9fa3c880 (unreliable) [c0002ac1cc69afa0] c000000000109df0 read_user_stack_64+0x70/0xf0 [c0002ac1cc69afd0] c000000000109fcc perf_callchain_user_64+0x15c/0x410 [c0002ac1cc69b060] c000000000109c00 perf_callchain_user+0x20/0x40 [c0002ac1cc69b080] c00000000031c6cc get_perf_callchain+0x25c/0x360 [c0002ac1cc69b120] c000000000316b50 perf_callchain+0x70/0xa0 [c0002ac1cc69b140] c000000000316ddc perf_prepare_sample+0x25c/0x790 [c0002ac1cc69b1a0] c000000000317350 perf_event_output_forward+0x40/0xb0 [c0002ac1cc69b220] c000000000306138 __perf_event_overflow+0x88/0x1a0 [c0002ac1cc69b270] c00000000010cf70 record_and_restart+0x230/0x750 [c0002ac1cc69b620] c00000000010d69c perf_event_interrupt+0x20c/0x510 [c0002ac1cc69b730] c000000000027d9c performance_monitor_exception+0x4c/0x60 [c0002ac1cc69b750] c00000000000b2f8 performance_monitor_common_virt+0x1b8/0x1c0 --- Exception: f00 (Performance Monitor) at c0000000000cb5b0 pSeries_lpar_hpte_insert+0x0/0x160 [link register ] c0000000000846f0 __hash_page_64K+0x210/0x540 [c0002ac1cc69ba50] 0000000000000000 (unreliable) [c0002ac1cc69bb00] c000000000073ae0 update_mmu_cache+0x390/0x3a0 [c0002ac1cc69bb70] c00000000037f024 wp_page_copy+0x364/0xce0 [c0002ac1cc69bc20] c00000000038272c do_wp_page+0xdc/0xa60 [c0002ac1cc69bc70] c0000000003857bc handle_mm_fault+0xb9c/0x1b60 [c0002ac1cc69bd50] c00000000006c434 __do_page_fault+0x314/0xc90 [c0002ac1cc69be20] c00000000000c5c8 handle_page_fault+0x10/0x2c --- Exception: 300 (Data Access) at 00007fff8c861fe8 SP (7ffff6b19660) is in userspace Fixes: 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the caller") Reported-by: Athira Rajeev Reported-by: Anton Blanchard Signed-off-by: Nicholas Piggin Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200727060947.10060-1-npiggin@gmail.com commit 6020db504cece0d93cc31c6f73609ef1304607e2 Author: Wolfram Sang Date: Sun Jul 26 23:44:19 2020 +0200 modpost: explain why we can't use strsep Mention why we open-code strsep, so it is clear that it is intentional. Fixes: 736bb11898ef ("modpost: remove use of non-standard strsep() in HOSTCC code") Signed-off-by: Wolfram Sang Signed-off-by: Masahiro Yamada commit 0d7869805a82b91abdc1a56bddeaa374969af310 Merge: 92ed30191993 15fbc3b93853 Author: Dave Airlie Date: Mon Jul 27 11:05:01 2020 +1000 Merge branch 'linux-5.8' of git://github.com/skeggsb/linux into drm-fixes A couple of fixes for issues relating to format modifiers (there's still a patch pending from James Jones to hopefully address the remaining ones), regression fix from the recent HDA nightmare, and a race fix for Turing modesetting. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/ Date: Fri Jul 24 11:05:31 2020 +0200 signal: fix typo in dequeue_synchronous_signal() s/postive/positive/ Signed-off-by: Pavel Machek (CIP) Link: https://lore.kernel.org/r/20200724090531.GA14409@amd [christian.brauner@ubuntu.com: tweak commit message] Signed-off-by: Christian Brauner commit 92ed301919932f777713b9172e525674157e983d Author: Linus Torvalds Date: Sun Jul 26 14:14:06 2020 -0700 Linux 5.8-rc7 commit 1c8594b8427290c178c5d39885eacd9e41f68743 Merge: 40c60ac32174 ca9b31f6bb9c Author: Linus Torvalds Date: Sun Jul 26 13:46:57 2020 -0700 Merge tag 'kbuild-fixes-v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild into master Pull Kbuild fixes from Masahiro Yamada: - do not use non-portable strsep() in a host program - fix single target builds for external modules - change Clang's --prefix option to make it work for the latest Clang * tag 'kbuild-fixes-v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation kbuild: fix single target builds for external modules modpost: remove use of non-standard strsep() in HOSTCC code commit aa7bf898d4bf921f61fab078040e8baec3f28126 Author: Linus Walleij Date: Sun Jul 19 01:33:22 2020 +0200 drm/mcde: Fix stability issue Whenever a display update was sent, apart from updating the memory base address, we called mcde_display_send_one_frame() which also sent a command to the display requesting the TE IRQ and enabling the FIFO. When continuous updates are running this is wrong: we need to only send this to start the flow to the display on the very first update. This lead to the display pipeline locking up and crashing. Check if the flow is already running and in that case do not call mcde_display_send_one_frame(). This fixes crashes on the Samsung GT-S7710 (Skomer). Signed-off-by: Linus Walleij Acked-by: Sam Ravnborg Acked-by: Stephan Gerhold Cc: Stephan Gerhold Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200718233323.3407670-1-linus.walleij@linaro.org commit 40c60ac32174f0c0c090cd31d0d1712f2478e689 Merge: 1ada9010e578 be6577af0cef Author: Linus Torvalds Date: Sun Jul 26 12:14:46 2020 -0700 Merge branch 'parisc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux into master Pull parisc fixes from Helge Deller: "Two fixes: - Add the cmpxchg() function for pointers to u8 values. This fixes a kernel linking error when building the tusb1210 driver (from Liam Beguin). - Add a define for atomic64_set_release() to fix CPU soft lockups which happen because of missing unlocks while processing bit operations (from John David Anglin)" * 'parisc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Add atomic64_set_release() define to avoid CPU soft lockups parisc: add support for cmpxchg on u8 pointers commit 07c08f5210e08dd6d4e0c3f8df2cf1c7de6d4ea4 Author: Guido Günther Date: Sat Jul 18 20:26:37 2020 +0200 drm/bridge: nwl-dsi: Drop DRM_BRIDGE_ATTACH_NO_CONNECTOR check. We don't create a connector but let panel_bridge handle that so there's no point in rejecting DRM_BRIDGE_ATTACH_NO_CONNECTOR. Signed-off-by: Guido Günther Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/8b6545b991afce6add0a24f5f5d116778b0cb763.1595096667.git.agx@sigxcpu.org commit d76acc9fcddeda53b985b029c890976a87fcc3fc Author: Jitao Shi Date: Tue Jul 14 20:33:32 2020 +0800 drm/panel: Fix auo, kd101n80-45na horizontal noise on edges of panel Fine tune the HBP and HFP to avoid the dot noise on the left and right edges. Signed-off-by: Jitao Shi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200714123332.37609-1-jitao.shi@mediatek.com commit 667d73d72f3188909914c60e97a1db33edc21971 Author: Douglas Anderson Date: Thu Jul 16 13:21:22 2020 -0700 drm: panel: simple: Delay HPD checking on boe_nv133fhm_n61 for 15 ms On boe_nv133fhm_n62 (and presumably on boe_nv133fhm_n61) a scope shows a small spike on the HPD line right when you power the panel on. The picture looks something like this: +-------------------------------------- | | | Power ---+ +--- | ++ | +----+| | HPD -----+ +---------------------------+ So right when power is applied there's a little bump in HPD and then there's small spike right before it goes low. The total time of the little bump plus the spike was measured on one panel as being 8 ms long. The total time for the HPD to go high on the same panel was 51.2 ms, though the datasheet only promises it is < 200 ms. When asked about this glitch, BOE indicated that it was expected and persisted until the TCON has been initialized. If this was a real hotpluggable DP panel then this wouldn't matter a whole lot. We'd debounce the HPD signal for a really long time and so the little blip wouldn't hurt. However, this is not a hotpluggable DP panel and the the debouncing logic isn't needed and just shows down the time needed to get the display working. This is why the code in panel_simple_prepare() doesn't do debouncing and just waits for HPD to go high once. Unfortunately if we get unlucky and happen to poll the HPD line right at the spike we can try talking to the panel before it's ready. Let's handle this situation by putting in a 15 ms prepare delay and decreasing the "hpd absent delay" by 15 ms. That means: * If you don't have HPD hooked up at all you've still got the hardcoded 200 ms delay. * If you've got HPD hooked up you will always wait at least 15 ms before checking HPD. The only case where this could be bad is if the panel is sharing a voltage rail with something else in the system and was already turned on long before the panel came up. In such a case we'll be delaying 15 ms for no reason, but it's not a huge delay and I don't see any other good solution to handle that case. Even though the delay was measured as 8 ms, 15 ms was chosen to give a bit of margin. Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200716132120.1.I01e738cd469b61fc9b28b3ef1c6541a4f48b11bf@changeid commit f10761c9df96a882438faa09dcd25261281d69ca Author: Laurentiu Palcu Date: Mon Jul 20 15:42:27 2020 +0300 drm/bridge/adv7511: set the bridge type properly After the drm_bridge_connector_init() helper function has been added, the ADV driver has been changed accordingly. However, the 'type' field of the bridge structure was left unset, which makes the helper function always return -EINVAL. Signed-off-by: Laurentiu Palcu Reviewed-by: Laurent Pinchart Reviewed-by: Vinod Koul Tested-by: Vinod Koul # tested on DragonBoard 410c Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200720124228.12552-1-laurentiu.palcu@oss.nxp.com commit 1ada9010e578150984039a770c98f41799b30bc4 Merge: 7f2e231c3165 92d232d17604 Author: Linus Torvalds Date: Sun Jul 26 09:33:25 2020 -0700 Merge tag 'char-misc-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc into master Pull char/misc driver fixes from Greg KH: "Here are a few small driver fixes for 5.8-rc7 They include: - habanalabs fixes - tiny fpga driver fixes - /dev/mem fixup from previous changes - interconnect driver fixes - binder fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: interconnect: msm8916: Fix buswidth of pcnoc_s nodes interconnect: Do not skip aggregation for disabled paths /dev/mem: Add missing memory barriers for devmem_inode binder: Don't use mmput() from shrinker function. habanalabs: prevent possible out-of-bounds array access fpga: dfl: fix bug in port reset handshake fpga: dfl: pci: reduce the scope of variable 'ret' habanalabs: set 4s timeout for message to device CPU habanalabs: set clock gating per engine habanalabs: block WREG_BULK packet on PDMA commit 7f2e231c316591246284b10b008cadfc953f16d3 Merge: f208a76fcb57 29c4a54bc645 Author: Linus Torvalds Date: Sun Jul 26 09:29:22 2020 -0700 Merge tag 'driver-core-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core into master Pull driver core fix from Greg KH: "A single driver core fix for 5.8-rc7. It resolves a problem found in the previous fix for this code made in 5.8-rc6. Hopefully this is all now cleared up, as this seems to be the last of the reported issues in this area, and was tested on the problem hardware. This patch has been in linux-next with no reported problems" * tag 'driver-core-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: device property: Avoid NULL pointer dereference in device_get_next_child_node() commit f208a76fcb5700a0c5104e5888679acc31d1ce41 Merge: 7d22af6c5bdb faaff9765664 Author: Linus Torvalds Date: Sun Jul 26 09:14:59 2020 -0700 Merge tag 'staging-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging into master Pull staging driver fixes from Greg KH: "Five small staging driver fixes for 5.8-rc7 to resolve some reported problems: - four comedi driver fixes for problems found with them - a syzbot-found fix for the wlang-ng driver that resolves a much reported problem. All of these have been in linux-next with no reported issues" * tag 'staging-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: wlan-ng: properly check endpoint types staging: comedi: addi_apci_1564: check INSN_CONFIG_DIGITAL_TRIG shift staging: comedi: addi_apci_1500: check INSN_CONFIG_DIGITAL_TRIG shift staging: comedi: addi_apci_1032: check INSN_CONFIG_DIGITAL_TRIG shift staging: comedi: ni_6527: fix INSN_CONFIG_DIGITAL_TRIG support commit 7d22af6c5bdb001c5ed0a20185138304ad2af91b Merge: 17f50e28a858 5fdbe136ae19 Author: Linus Torvalds Date: Sun Jul 26 09:09:43 2020 -0700 Merge tag 'tty-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty into master Pull tty/serial/fbcon fixes from Greg KH: "Here are some small tty and serial and fbcon fixes for 5.8-rc7 to resolve some reported issues. The fbcon fix is in here as it was simpler to take it this way (and it was acked by the maintainer) as it was related to the vt console fix as well, both of which resolve syzbot-found issues in the console handling code. The other serial driver fixes are for small issues reported in the -rc releases. All of these have been in linux-next with no reported issues" * tag 'tty-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: exar: Fix GPIO configuration for Sealevel cards based on XR17V35X fbdev: Detect integer underflow at "struct fbcon_ops"->clear_margins. serial: 8250_mtk: Fix high-speed baud rates clamping serial: 8250: fix null-ptr-deref in serial8250_start_tx() serial: tegra: drop bogus NULL tty-port checks serial: tegra: fix CREAD handling for PIO tty: xilinx_uartps: Really fix id assignment vt: Reject zero-sized screen buffer size. commit 4ee48cc5586bf519df19894273002aa8ef7b70ad Author: Biju Das Date: Thu Jul 23 12:10:54 2020 +0100 drm: of: Fix double-free bug Fix double-free bug in the error path. Fixes: 6529007522de ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order") Reported-by: Pavel Machek Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Cc: stable@vger.kernel.org Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1595502654-40595-1-git-send-email-biju.das.jz@bp.renesas.com commit 17f50e28a858e4bab808733339995133390aae54 Merge: cf48f79b74de 0b987032f8b5 Author: Linus Torvalds Date: Sun Jul 26 09:02:29 2020 -0700 Merge tag 'usb-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb into master Pull USB fixes from Greg KH: "Three small USB XHCI driver fixes for 5.8-rc7. They all resolve some minor issues that have been reported on some different platforms. All of these have been in linux-next with no reported issues" * tag 'usb-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: tegra: Fix allocation for the FPCI context usb: xhci: Fix ASM2142/ASM3142 DMA addressing usb: xhci-mtk: fix the failure of bandwidth allocation commit cf48f79b74de2bf900d27c924528bb41d73689c3 Merge: 04300d66f0a0 3f0dcfbcd2e1 Author: Linus Torvalds Date: Sun Jul 26 08:59:15 2020 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi into master Pull SCSI fix from James Bottomley: "Small core patch to fix a corner case bug: we forgot to run the queues to handle starvation in the error exit from the scsi_queue_rq routine, which can lead to hangs on error conditions" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: core: Run queue in case of I/O resource contention failure commit 5611ec2b9814bc91f7b0a8d804c1fc152e2025d9 Author: Kai-Heng Feng Date: Fri Jul 24 01:29:10 2020 +0800 nvme-pci: prevent SK hynix PC400 from using Write Zeroes command After commit 6e02318eaea5 ("nvme: add support for the Write Zeroes command"), SK hynix PC400 becomes very slow with the following error message: [ 224.567695] blk_update_request: operation not supported error, dev nvme1n1, sector 499384320 op 0x9:(WRITE_ZEROES) flags 0x1000000 phys_seg 0 prio class 0] SK Hynix PC400 has a buggy firmware that treats NLB as max value instead of a range, so the NLB passed isn't a valid value to the firmware. According to SK hynix there are three commands are affected: - Write Zeroes - Compare - Write Uncorrectable Right now only Write Zeroes is implemented, so disable it completely on SK hynix PC400. BugLink: https://bugs.launchpad.net/bugs/1872383 Cc: kyounghwan sohn Signed-off-by: Kai-Heng Feng Signed-off-by: Christoph Hellwig commit adc99fd378398f4c58798a1c57889872967d56a6 Author: Sagi Grimberg Date: Thu Jul 23 16:42:26 2020 -0700 nvme-tcp: fix possible hang waiting for icresp response If the controller died exactly when we are receiving icresp we hang because icresp may never return. Make sure to set a high finite limit. Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 04300d66f0a06d572d9f2ad6768c38cabde22179 Merge: fbe0d451bcea fa5a19835905 Author: Linus Torvalds Date: Sat Jul 25 14:42:11 2020 -0700 Merge tag 'riscv-for-linus-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux into master Pull RISC-V fixes from Palmer Dabbelt: "A few more fixes this week: - A fix to avoid using SBI calls during kasan initialization, as the SBI calls themselves have not been probed yet. - Three fixes related to systems with multiple memory regions" * tag 'riscv-for-linus-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Parse all memory blocks to remove unusable memory RISC-V: Do not rely on initrd_start/end computed during early dt parsing RISC-V: Set maximum number of mapped pages correctly riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence commit fbe0d451bcea569fc0ed3455511a90646c8a9c81 Merge: 78b1afe22d51 d181d2da0141 Author: Linus Torvalds Date: Sat Jul 25 14:25:47 2020 -0700 Merge tag 'x86-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull x86 fixes from Ingo Molnar: "Misc fixes: - Fix a section end page alignment assumption that was causing crashes - Fix ORC unwinding on freshly forked tasks which haven't executed yet and which have empty user task stacks - Fix the debug.exception-trace=1 sysctl dumping of user stacks, which was broken by recent maccess changes" * tag 'x86-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/dumpstack: Dump user space code correctly again x86/stacktrace: Fix reliable check for empty user task stacks x86/unwind/orc: Fix ORC for newly forked tasks x86, vmlinux.lds: Page-align end of ..page_aligned sections commit 78b1afe22d51996c1916a332d43b853ff2b10ade Merge: a7b36c2b134f fe5ed7ab99c6 Author: Linus Torvalds Date: Sat Jul 25 13:55:38 2020 -0700 Merge tag 'perf-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull uprobe fix from Ingo Molnar: "Fix an interaction/regression between uprobes based shared library tracing & GDB" * tag 'perf-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: uprobes: Change handle_swbp() to send SIGTRAP with si_code=SI_KERNEL, to fix GDB regression commit a7b36c2b134f7ca75789d174b97d07acccbf6b93 Merge: 3077805eebb6 b4a25fb0e629 Author: Linus Torvalds Date: Sat Jul 25 13:27:12 2020 -0700 Merge tag 'timers-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull timer fix from Ingo Molnar: "Fix a suspend/resume regression (crash) on TI AM3/AM4 SoC's" * tag 'timers-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/timer-ti-dm: Fix suspend and resume for am3 and am4 commit 3077805eebb63d75ad716e36777a54a3321d34a5 Merge: 17baa4428642 062d3f95b630 Author: Linus Torvalds Date: Sat Jul 25 13:24:40 2020 -0700 Merge tag 'sched-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull scheduler fixes from Ingo Molnar: "Fix a race introduced by the recent loadavg race fix, plus add a debug check for a hard to debug case of bogus wakeup function flags" * tag 'sched-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Warn if garbage is passed to default_wake_function() sched: Fix race against ptrace_freeze_trace() commit 17baa442864254cb2aadf3a4d668c0f81d2f07c5 Merge: 7cb3a5c5f647 74f85551666f Author: Linus Torvalds Date: Sat Jul 25 13:18:42 2020 -0700 Merge tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull EFI fixes from Ingo Molnar: "Various EFI fixes: - Fix the layering violation in the use of the EFI runtime services availability mask in users of the 'efivars' abstraction - Revert build fix for GCC v4.8 which is no longer supported - Clean up some x86 EFI stub details, some of which are borderline bugs that copy around garbage into padding fields - let's fix these out of caution. - Fix build issues while working on RISC-V support - Avoid --whole-archive when linking the stub on arm64" * tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: Revert "efi/x86: Fix build with gcc 4" efi/efivars: Expose RT service availability via efivars abstraction efi/libstub: Move the function prototypes to header file efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds efi/libstub/arm64: link stub lib.a conditionally efi/x86: Only copy upto the end of setup_header efi/x86: Remove unused variables commit 7cb3a5c5f6478ac0c14d01e35bc49e0ba7525e21 Merge: 1b64b2e2444c 0e6705182d4e Author: Linus Torvalds Date: Sat Jul 25 12:53:46 2020 -0700 Merge tag '5.8-rc6-cifs-fix' of git://git.samba.org/sfrench/cifs-2.6 into master Pull cifs fix from Steve French: "A fix for a recently discovered regression in rename to older servers caused by a recent patch" * tag '5.8-rc6-cifs-fix' of git://git.samba.org/sfrench/cifs-2.6: Revert "cifs: Fix the target file was deleted when rename failed." commit 1b64b2e2444c11b8dd2b657f8538c05cb699ed25 Merge: 23ee3e4e5bd2 8754e1379e70 Author: Linus Torvalds Date: Sat Jul 25 11:50:59 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net into master Pull networking fixes from David Miller: 1) Fix RCU locaking in iwlwifi, from Johannes Berg. 2) mt76 can access uninitialized NAPI struct, from Felix Fietkau. 3) Fix race in updating pause settings in bnxt_en, from Vasundhara Volam. 4) Propagate error return properly during unbind failures in ax88172a, from George Kennedy. 5) Fix memleak in adf7242_probe, from Liu Jian. 6) smc_drv_probe() can leak, from Wang Hai. 7) Don't muck with the carrier state if register_netdevice() fails in the bonding driver, from Taehee Yoo. 8) Fix memleak in dpaa_eth_probe, from Liu Jian. 9) Need to check skb_put_padto() return value in hsr_fill_tag(), from Murali Karicheri. 10) Don't lose ionic RSS hash settings across FW update, from Shannon Nelson. 11) Fix clobbered SKB control block in act_ct, from Wen Xu. 12) Missing newlink in "tx_timeout" sysfs output, from Xiongfeng Wang. 13) IS_UDPLITE cleanup a long time ago, incorrectly handled transformations involving UDPLITE_RECV_CC. From Miaohe Lin. 14) Unbalanced locking in netdevsim, from Taehee Yoo. 15) Suppress false-positive error messages in qed driver, from Alexander Lobakin. 16) Out of bounds read in ax25_connect and ax25_sendmsg, from Peilin Ye. 17) Missing SKB release in cxgb4's uld_send(), from Navid Emamdoost. 18) Uninitialized value in geneve_changelink(), from Cong Wang. 19) Fix deadlock in xen-netfront, from Andera Righi. 19) flush_backlog() frees skbs with IRQs disabled, so should use dev_kfree_skb_irq() instead of kfree_skb(). From Subash Abhinov Kasiviswanathan. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (111 commits) drivers/net/wan: lapb: Corrected the usage of skb_cow dev: Defer free of skbs in flush_backlog qrtr: orphan socket in qrtr_release() xen-netfront: fix potential deadlock in xennet_remove() flow_offload: Move rhashtable inclusion to the source file geneve: fix an uninitialized value in geneve_changelink() bonding: check return value of register_netdevice() in bond_newlink() tcp: allow at most one TLP probe per flight AX.25: Prevent integer overflows in connect and sendmsg cxgb4: add missing release on skb in uld_send() net: atlantic: fix PTP on AQC10X AX.25: Prevent out-of-bounds read in ax25_sendmsg() sctp: shrink stream outq when fails to do addstream reconf sctp: shrink stream outq only when new outcnt < old outcnt AX.25: Fix out-of-bounds read in ax25_connect() enetc: Remove the mdio bus on PF probe bailout net: ethernet: ti: add NETIF_F_HW_TC hw feature flag for taprio offload net: ethernet: ave: Fix error returns in ave_init drivers/net/wan/x25_asy: Fix to make it work ipvs: fix the connection sync failed in some cases ... commit fe1d899f4212a08dad98accb47cd335b58cc9085 Author: Grygorii Strashko Date: Sat Jul 25 00:42:21 2020 +0300 ARM: dts: keystone-k2g-evm: fix rgmii phy-mode for ksz9031 phy Since commit bcf3440c6dd7 ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY") the networking is broken on keystone-k2g-evm board. The above board have phy-mode = "rgmii-id" and it is worked before because KSZ9031 PHY started with default RGMII internal delays configuration (TX off, RX on 1.2 ns) and MAC provided TX delay by default. After above commit, the KSZ9031 PHY starts handling phy mode properly and enables both RX and TX delays, as result networking is become broken. Fix it by switching to phy-mode = "rgmii-rxid" to reflect previous behavior. Fixes: bcf3440c6dd7 ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY") Signed-off-by: Grygorii Strashko Cc: Oleksij Rempel Cc: Andrew Lunn Cc: Philippe Schenker Signed-off-by: Arnd Bergmann commit fa5a198359053c8e21dcc2b39c0e13871059bc9f Author: Atish Patra Date: Wed Jul 15 16:30:09 2020 -0700 riscv: Parse all memory blocks to remove unusable memory Currently, maximum physical memory allowed is equal to -PAGE_OFFSET. That's why we remove any memory blocks spanning beyond that size. However, it is done only for memblock containing linux kernel which will not work if there are multiple memblocks. Process all memory blocks to figure out how much memory needs to be removed and remove at the end instead of updating the memblock list in place. Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 4400231c8acc7e513204c8470c6d796ba47dc169 Author: Atish Patra Date: Wed Jul 15 16:30:08 2020 -0700 RISC-V: Do not rely on initrd_start/end computed during early dt parsing Currently, initrd_start/end are computed during early_init_dt_scan but used during arch_setup. We will get the following panic if initrd is used and CONFIG_DEBUG_VIRTUAL is turned on. [ 0.000000] ------------[ cut here ]------------ [ 0.000000] kernel BUG at arch/riscv/mm/physaddr.c:33! [ 0.000000] Kernel BUG [#1] [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.8.0-rc4-00015-ged0b226fed02 #886 [ 0.000000] epc: ffffffe0002058d2 ra : ffffffe0000053f0 sp : ffffffe001001f40 [ 0.000000] gp : ffffffe00106e250 tp : ffffffe001009d40 t0 : ffffffe00107ee28 [ 0.000000] t1 : 0000000000000000 t2 : ffffffe000a2e880 s0 : ffffffe001001f50 [ 0.000000] s1 : ffffffe0001383e8 a0 : ffffffe00c087e00 a1 : 0000000080200000 [ 0.000000] a2 : 00000000010bf000 a3 : ffffffe00106f3c8 a4 : ffffffe0010bf000 [ 0.000000] a5 : ffffffe000000000 a6 : 0000000000000006 a7 : 0000000000000001 [ 0.000000] s2 : ffffffe00106f068 s3 : ffffffe00106f070 s4 : 0000000080200000 [ 0.000000] s5 : 0000000082200000 s6 : 0000000000000000 s7 : 0000000000000000 [ 0.000000] s8 : 0000000080011010 s9 : 0000000080012700 s10: 0000000000000000 [ 0.000000] s11: 0000000000000000 t3 : 000000000001fe30 t4 : 000000000001fe30 [ 0.000000] t5 : 0000000000000000 t6 : ffffffe00107c471 [ 0.000000] status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003 [ 0.000000] random: get_random_bytes called from print_oops_end_marker+0x22/0x46 with crng_init=0 To avoid the error, initrd_start/end can be computed from phys_initrd_start/size in setup itself. It also improves the initrd placement by aligning the start and size with the page size. Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code") Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 8754e1379e7089516a449821f88e1fe1ebbae5e1 Author: Xie He Date: Fri Jul 24 09:33:47 2020 -0700 drivers/net/wan: lapb: Corrected the usage of skb_cow This patch fixed 2 issues with the usage of skb_cow in LAPB drivers "lapbether" and "hdlc_x25": 1) After skb_cow fails, kfree_skb should be called to drop a reference to the skb. But in both drivers, kfree_skb is not called. 2) skb_cow should be called before skb_push so that is can ensure the safety of skb_push. But in "lapbether", it is incorrectly called after skb_push. More details about these 2 issues: 1) The behavior of calling kfree_skb on failure is also the behavior of netif_rx, which is called by this function with "return netif_rx(skb);". So this function should follow this behavior, too. 2) In "lapbether", skb_cow is called after skb_push. This results in 2 logical issues: a) skb_push is not protected by skb_cow; b) An extra headroom of 1 byte is ensured after skb_push. This extra headroom has no use in this function. It also has no use in the upper-layer function that this function passes the skb to (x25_lapb_receive_frame in net/x25/x25_dev.c). So logically skb_cow should instead be called before skb_push. Cc: Eric Dumazet Cc: Martin Schiller Signed-off-by: Xie He Signed-off-by: David S. Miller commit 7df5cb75cfb8acf96c7f2342530eb41e0c11f4c3 Author: Subash Abhinov Kasiviswanathan Date: Thu Jul 23 11:31:48 2020 -0600 dev: Defer free of skbs in flush_backlog IRQs are disabled when freeing skbs in input queue. Use the IRQ safe variant to free skbs here. Fixes: 145dd5f9c88f ("net: flush the softnet backlog in process context") Signed-off-by: Subash Abhinov Kasiviswanathan Signed-off-by: David S. Miller commit d0d8aae64566b753c4330fbd5944b88af035f299 Author: Atish Patra Date: Wed Jul 15 16:30:07 2020 -0700 RISC-V: Set maximum number of mapped pages correctly Currently, maximum number of mapper pages are set to the pfn calculated from the memblock size of the memblock containing kernel. This will work until that memblock spans the entire memory. However, it will be set to a wrong value if there are multiple memblocks defined in kernel (e.g. with efi runtime services). Set the the maximum value to the pfn calculated from dram size. Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 23ee3e4e5bd27bdbc0f1785eef7209ce872794c7 Merge: 5876aa073f52 d08c30d7a0d1 Author: Linus Torvalds Date: Fri Jul 24 18:30:24 2020 -0700 Merge tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into master Pull PCI fixes from Bjorn Helgaas: - Reject invalid IRQ 0 command line argument for virtio_mmio because IRQ 0 now generates warnings (Bjorn Helgaas) - Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms", which broke nouveau (Bjorn Helgaas) * tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms" virtio-mmio: Reject invalid IRQ 0 command line argument commit af9f691f0f5bdd1ade65a7b84927639882d7c3e5 Author: Cong Wang Date: Fri Jul 24 09:45:51 2020 -0700 qrtr: orphan socket in qrtr_release() We have to detach sock from socket in qrtr_release(), otherwise skb->sk may still reference to this socket when the skb is released in tun->queue, particularly sk->sk_wq still points to &sock->wq, which leads to a UAF. Reported-and-tested-by: syzbot+6720d64f31c081c2f708@syzkaller.appspotmail.com Fixes: 28fb4e59a47d ("net: qrtr: Expose tunneling endpoint to user space") Cc: Bjorn Andersson Cc: Eric Dumazet Signed-off-by: Cong Wang Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 657237f56b26be2784cbf82867d65ebddff16539 Merge: c2c633106453 1cfd3426ef98 Author: David S. Miller Date: Fri Jul 24 17:26:09 2020 -0700 Merge tag 'wireless-drivers-2020-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers Kalle Valo says: ==================== wireless-drivers fixes for v5.8 Second set of fixes for v5.8, and hopefully also the last. Three important regressions fixed. ath9k * fix a regression which broke support for all ath9k usb devices ath10k * fix a regression which broke support for all QCA4019 AHB devices iwlwifi * fix a regression which broke support for some Killer Wireless-AC 1550 cards ==================== Signed-off-by: David S. Miller commit c2c633106453611be07821f53dff9e93a9d1c3f0 Author: Andrea Righi Date: Fri Jul 24 10:59:10 2020 +0200 xen-netfront: fix potential deadlock in xennet_remove() There's a potential race in xennet_remove(); this is what the driver is doing upon unregistering a network device: 1. state = read bus state 2. if state is not "Closed": 3. request to set state to "Closing" 4. wait for state to be set to "Closing" 5. request to set state to "Closed" 6. wait for state to be set to "Closed" If the state changes to "Closed" immediately after step 1 we are stuck forever in step 4, because the state will never go back from "Closed" to "Closing". Make sure to check also for state == "Closed" in step 4 to prevent the deadlock. Also add a 5 sec timeout any time we wait for the bus state to change, to avoid getting stuck forever in wait_event(). Signed-off-by: Andrea Righi Signed-off-by: David S. Miller commit 5876aa073f52541f4787b6111c8494ea9cfcde15 Merge: 68845a55c31b 9affa4358177 Author: Linus Torvalds Date: Fri Jul 24 16:27:54 2020 -0700 Merge tag 'nfsd-5.8-2' of git://linux-nfs.org/~bfields/linux into master Pull nfsd fix from Bruce Fields: "Just one fix for a NULL dereference if someone happens to read /proc/fs/nfsd/client/../state at the wrong moment" * tag 'nfsd-5.8-2' of git://linux-nfs.org/~bfields/linux: nfsd4: fix NULL dereference in nfsd/clients display code commit c2b69f24ebd166a13cdc9909b50f33228895998b Author: Herbert Xu Date: Fri Jul 24 10:50:22 2020 +1000 flow_offload: Move rhashtable inclusion to the source file I noticed that touching linux/rhashtable.h causes lib/vsprintf.c to be rebuilt. This dependency came through a bogus inclusion in the file net/flow_offload.h. This patch moves it to the right place. This patch also removes a lingering rhashtable inclusion in cls_api created by the same commit. Fixes: 4e481908c51b ("flow_offload: move tc indirect block to...") Signed-off-by: Herbert Xu Signed-off-by: David S. Miller commit 68845a55c31bd4e00107c6b6585ab0c707782c5c Merge: c953d60b1180 7359608a271c Author: Linus Torvalds Date: Fri Jul 24 14:24:35 2020 -0700 Merge branch 'akpm' into master (patches from Andrew) Merge misc fixes from Andrew Morton: "Subsystems affected by this patch series: mm/pagemap, mm/shmem, mm/hotfixes, mm/memcg, mm/hugetlb, mailmap, squashfs, scripts, io-mapping, MAINTAINERS, and gdb" * emailed patches from Andrew Morton : scripts/gdb: fix lx-symbols 'gdb.error' while loading modules MAINTAINERS: add KCOV section io-mapping: indicate mapping failure scripts/decode_stacktrace: strip basepath from all paths squashfs: fix length field overlap check in metadata reading mailmap: add entry for Mike Rapoport khugepaged: fix null-pointer dereference due to race mm/hugetlb: avoid hardcoding while checking if cma is enabled mm: memcg/slab: fix memory leak at non-root kmem_cache destroy mm/memcg: fix refcount error while moving and swapping mm/memcontrol: fix OOPS inside mem_cgroup_get_nr_swap_pages() mm: initialize return of vm_insert_pages vfs/xattr: mm/shmem: kernfs: release simple xattr entry in a right way mm/mmap.c: close race between munmap() and expand_upwards()/downwards() commit c953d60b1180c4a59a55b72fecd278d264d60f5b Merge: c6d686047456 5fff09bc1415 Author: Linus Torvalds Date: Fri Jul 24 14:19:00 2020 -0700 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs into master Pull xtensa csum regression fix from Al Viro: "Max Filippov caught a breakage introduced in xtensa this cycle by the csum_and_copy_..._user() series. Cut'n'paste from the wrong source - the check that belongs in csum_and_copy_to_user() ended up both there and in csum_and_copy_from_user()" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: xtensa: fix access check in csum_and_copy_from_user commit c6d686047456bd3e36dce7de95375890fb8b7dd9 Merge: 0669704270e1 7b7891c7bdfd Author: Linus Torvalds Date: Fri Jul 24 14:16:12 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux into master Pull arm64 fix from Will Deacon: "Fix compat vDSO build flags for recent versions of clang to tell it where to find the assembler" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: vdso32: Fix '--prefix=' value for newer versions of clang commit 0669704270e142483d80cfda5c526426c1a89711 Merge: 6a343656d302 48cfa61b58a1 Author: Linus Torvalds Date: Fri Jul 24 14:11:43 2020 -0700 Merge tag 'for-5.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into master Pull btrfs fixes from David Sterba: "A few resouce leak fixes from recent patches, all are stable material. The problems have been observed during testing or have a reproducer" * tag 'for-5.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix mount failure caused by race with umount btrfs: fix page leaks after failure to lock page for delalloc btrfs: qgroup: fix data leak caused by race between writeback and truncate btrfs: fix double free on ulist after backref resolution failure commit 6a343656d30229a424458f8111e55df336375382 Merge: 1f68f31b5150 89ee72376be2 Author: Linus Torvalds Date: Fri Jul 24 14:09:19 2020 -0700 Merge tag 'zonefs-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs into master Pull zonefs fixes from Damien Le Moal: "Two fixes, the first one to remove compilation warnings and the second to avoid potentially inefficient allocation of BIOs for direct writes into sequential zones" * tag 'zonefs-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: count pages after truncating the iterator zonefs: Fix compilation warning commit 1f68f31b51507e1ad647aa3a43c295eb024490ad Merge: 5a0b8af0719f 3e863ea3bb1a Author: Linus Torvalds Date: Fri Jul 24 14:02:41 2020 -0700 Merge tag 'io_uring-5.8-2020-07-24' of git://git.kernel.dk/linux-block into master Pull io_uring fixes from Jens Axboe: - Fix discrepancy in how sqe->flags are treated for a few requests, this makes it consistent (Daniele) - Ensure that poll driven retry works with double waitqueue poll users - Fix a missing io_req_init_async() (Pavel) * tag 'io_uring-5.8-2020-07-24' of git://git.kernel.dk/linux-block: io_uring: missed req_init_async() for IOSQE_ASYNC io_uring: always allow drain/link/hardlink/async sqe flags io_uring: ensure double poll additions work with both request types commit 5a0b8af0719fd0710d9d1a9ad83b7fbdf4bfca66 Merge: fcef1046eb1b 1014a2f8d76b Author: Linus Torvalds Date: Fri Jul 24 13:58:05 2020 -0700 Merge tag 'iommu-fix-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu into master Pull iommu fix from Joerg Roedel: "Fix a NULL-ptr dereference in the QCOM IOMMU driver" * tag 'iommu-fix-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/qcom: Use domain rather than dev as tlb cookie commit fcef1046eb1b78c98105e9b68e48df6022c23a06 Merge: a38a19efcd9b a862192e9227 Author: Linus Torvalds Date: Fri Jul 24 13:48:57 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma into master Pull rdma fixes from Jason Gunthorpe: "One merge window regression, some corruption bugs in HNS and a few more syzkaller fixes: - Two long standing syzkaller races - Fix incorrect HW configuration in HNS - Restore accidentally dropped locking in IB CM - Fix ODP prefetch bug added in the big rework several versions ago" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/mlx5: Prevent prefetch from racing with implicit destruction RDMA/cm: Protect access to remote_sidr_table RDMA/core: Fix race in rdma_alloc_commit_uobject() RDMA/hns: Fix wrong PBL offset when VA is not aligned to PAGE_SIZE RDMA/hns: Fix wrong assignment of lp_pktn_ini in QPC RDMA/mlx5: Use xa_lock_irq when access to SRQ table commit a38a19efcd9b7b536e2820df91e9f0be806f9a42 Merge: c615035b29c3 5df96f2b9f58 Author: Linus Torvalds Date: Fri Jul 24 13:44:14 2020 -0700 Merge tag 'for-5.8/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm into master Pull device mapper fix from Mike Snitzer: "A stable fix for DM integrity target's integrity recalculation that gets skipped when resuming a device. This is a fix for a previous stable@ fix" * tag 'for-5.8/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm integrity: fix integrity recalculation that is improperly skipped commit c615035b29c3628a35ece192046e0e6658d96ab3 Merge: b85bcb784fd8 02b9aec59243 Author: Linus Torvalds Date: Fri Jul 24 13:41:13 2020 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into master Pull i2c fixes from Wolfram Sang: "Again some driver bugfixes and some documentation fixes" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: i2c-qcom-geni: Fix DMA transfer race i2c: rcar: always clear ICSAR to avoid side effects MAINTAINERS: i2c: at91: handover maintenance to Codrin Ciubotariu i2c: drop duplicated word in the header file i2c: cadence: Clear HOLD bit at correct time in Rx path Revert "i2c: cadence: Fix the hold bit setting" commit b85bcb784fd84ef854f6a6d03a0c48c207d0b0ec Merge: 88fff0b7dcc1 ebd4050c6144 Author: Linus Torvalds Date: Fri Jul 24 13:37:38 2020 -0700 Merge tag 'mmc-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc into master Pull MMC fix from Ulf Hansson: "Fix clock divider calculation in the ASPEED SDHCI controller" * tag 'mmc-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-of-aspeed: Fix clock divider calculation commit 88fff0b7dcc132c924d710d75d1401264b6d0ef6 Merge: f37e99aca03f d8904ca9d338 Author: Linus Torvalds Date: Fri Jul 24 13:35:55 2020 -0700 Merge tag 'drm-fixes-2020-07-24' of git://anongit.freedesktop.org/drm/drm into master Pull drm fixes from Dave Airlie: "Quiet fixes, I may have a single regression fix follow up to this for nouveau, but it might be next week, Ben was testing it a bit more . Otherwise two amdgpu fixes, one lima and one sun4i: amdgpu: - Fix crash when overclocking VegaM - Fix possible crash when editing dpm levels sun4i: - Fix inverted HPD result; fixes an earlier fix lima: - fix timeout during reset" * tag 'drm-fixes-2020-07-24' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: Fix NULL dereference in dpm sysfs handlers drm/amd/powerplay: fix a crash when overclocking Vega M drm/lima: fix wait pp reset timeout drm: sun4i: hdmi: Fix inverted HPD result commit 7359608a271ce81803de148befefd309baf88c76 Author: Stefano Garzarella Date: Thu Jul 23 21:15:52 2020 -0700 scripts/gdb: fix lx-symbols 'gdb.error' while loading modules Commit ed66f991bb19 ("module: Refactor section attr into bin attribute") removed the 'name' field from 'struct module_sect_attr' triggering the following error when invoking lx-symbols: (gdb) lx-symbols loading vmlinux scanning for modules in linux/build loading @0xffffffffc014f000: linux/build/drivers/net/tun.ko Python Exception There is no member named name.: Error occurred in Python: There is no member named name. This patch fixes the issue taking the module name from the 'struct attribute'. Fixes: ed66f991bb19 ("module: Refactor section attr into bin attribute") Signed-off-by: Stefano Garzarella Signed-off-by: Andrew Morton Reviewed-by: Jan Kiszka Reviewed-by: Kieran Bingham Link: http://lkml.kernel.org/r/20200722102239.313231-1-sgarzare@redhat.com Signed-off-by: Linus Torvalds commit bb9715379abfeddea86343b748b62410e20ef037 Author: Andrey Konovalov Date: Thu Jul 23 21:15:49 2020 -0700 MAINTAINERS: add KCOV section To link KCOV to the kasan-dev@ mailing list. Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Acked-by: Dmitry Vyukov Cc: Alexander Potapenko Cc: Marco Elver Link: http://lkml.kernel.org/r/5fa344db7ac4af2213049e5656c0f43d6ecaa379.1595331682.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit e0b3e0b1a04367fc15c07f44e78361545b55357c Author: Michael J. Ruhl Date: Thu Jul 23 21:15:46 2020 -0700 io-mapping: indicate mapping failure The !ATOMIC_IOMAP version of io_maping_init_wc will always return success, even when the ioremap fails. Since the ATOMIC_IOMAP version returns NULL when the init fails, and callers check for a NULL return on error this is unexpected. During a device probe, where the ioremap failed, a crash can look like this: BUG: unable to handle page fault for address: 0000000000210000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page Oops: 0002 [#1] PREEMPT SMP CPU: 0 PID: 177 Comm: RIP: 0010:fill_page_dma [i915] gen8_ppgtt_create [i915] i915_ppgtt_create [i915] intel_gt_init [i915] i915_gem_init [i915] i915_driver_probe [i915] pci_device_probe really_probe driver_probe_device The remap failure occurred much earlier in the probe. If it had been propagated, the driver would have exited with an error. Return NULL on ioremap failure. [akpm@linux-foundation.org: detect ioremap_wc() errors earlier] Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata about the io-mapping") Signed-off-by: Michael J. Ruhl Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Mike Rapoport Cc: Andy Shevchenko Cc: Chris Wilson Cc: Daniel Vetter Cc: Link: http://lkml.kernel.org/r/20200721171936.81563-1-michael.j.ruhl@intel.com Signed-off-by: Linus Torvalds commit d178770d8d21489abf5bafefcbb6d5243b482e9a Author: Pi-Hsun Shih Date: Thu Jul 23 21:15:43 2020 -0700 scripts/decode_stacktrace: strip basepath from all paths Currently the basepath is removed only from the beginning of the string. When the symbol is inlined and there's multiple line outputs of addr2line, only the first line would have basepath removed. Change to remove the basepath prefix from all lines. Fixes: 31013836a71e ("scripts/decode_stacktrace: match basepath using shell prefix operator, not regex") Co-developed-by: Shik Chen Signed-off-by: Pi-Hsun Shih Signed-off-by: Shik Chen Signed-off-by: Andrew Morton Reviewed-by: Stephen Boyd Cc: Sasha Levin Cc: Nicolas Boichat Cc: Jiri Slaby Link: http://lkml.kernel.org/r/20200720082709.252805-1-pihsun@chromium.org Signed-off-by: Linus Torvalds commit 2910c59fd0423f87aca3a669b156a2325da63745 Author: Phillip Lougher Date: Thu Jul 23 21:15:40 2020 -0700 squashfs: fix length field overlap check in metadata reading This is a regression introduced by the "migrate from ll_rw_block usage to BIO" patch. Squashfs packs structures on byte boundaries, and due to that the length field (of the metadata block) may not be fully in the current block. The new code rewrote and introduced a faulty check for that edge case. Fixes: 93e72b3c612adcaca1 ("squashfs: migrate from ll_rw_block usage to BIO") Reported-by: Bernd Amend Signed-off-by: Phillip Lougher Signed-off-by: Andrew Morton Cc: Christoph Hellwig Cc: Adrien Schildknecht Cc: Guenter Roeck Cc: Daniel Rosenberg Link: http://lkml.kernel.org/r/20200717195536.16069-1-phillip@squashfs.org.uk Signed-off-by: Linus Torvalds commit e57942c5630f86880f2cefa61f4a1ab10d4864af Author: Mike Rapoport Date: Thu Jul 23 21:15:37 2020 -0700 mailmap: add entry for Mike Rapoport Add an entry to correct my email addresses. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200708095414.12275-1-rppt@kernel.org Signed-off-by: Linus Torvalds commit 594cced14ad3903166c8b091ff96adac7552f0b3 Author: Kirill A. Shutemov Date: Thu Jul 23 21:15:34 2020 -0700 khugepaged: fix null-pointer dereference due to race khugepaged has to drop mmap lock several times while collapsing a page. The situation can change while the lock is dropped and we need to re-validate that the VMA is still in place and the PMD is still subject for collapse. But we miss one corner case: while collapsing an anonymous pages the VMA could be replaced with file VMA. If the file VMA doesn't have any private pages we get NULL pointer dereference: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] anon_vma_lock_write include/linux/rmap.h:120 [inline] collapse_huge_page mm/khugepaged.c:1110 [inline] khugepaged_scan_pmd mm/khugepaged.c:1349 [inline] khugepaged_scan_mm_slot mm/khugepaged.c:2110 [inline] khugepaged_do_scan mm/khugepaged.c:2193 [inline] khugepaged+0x3bba/0x5a10 mm/khugepaged.c:2238 The fix is to make sure that the VMA is anonymous in hugepage_vma_revalidate(). The helper is only used for collapsing anonymous pages. Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Reported-by: syzbot+ed318e8b790ca72c5ad0@syzkaller.appspotmail.com Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Yang Shi Cc: Link: http://lkml.kernel.org/r/20200722121439.44328-1-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit dbda8feadfa46b3d8dd7a2304f84ccbc036effe9 Author: Barry Song Date: Thu Jul 23 21:15:30 2020 -0700 mm/hugetlb: avoid hardcoding while checking if cma is enabled hugetlb_cma[0] can be NULL due to various reasons, for example, node0 has no memory. so NULL hugetlb_cma[0] doesn't necessarily mean cma is not enabled. gigantic pages might have been reserved on other nodes. This patch fixes possible double reservation and CMA leak. [akpm@linux-foundation.org: fix CONFIG_CMA=n warning] [sfr@canb.auug.org.au: better checks before using hugetlb_cma] Link: http://lkml.kernel.org/r/20200721205716.6dbaa56b@canb.auug.org.au Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") Signed-off-by: Barry Song Signed-off-by: Andrew Morton Reviewed-by: Mike Kravetz Acked-by: Roman Gushchin Cc: Jonathan Cameron Cc: Link: http://lkml.kernel.org/r/20200710005726.36068-1-song.bao.hua@hisilicon.com Signed-off-by: Linus Torvalds commit d38a2b7a9c939e6d7329ab92b96559ccebf7b135 Author: Muchun Song Date: Thu Jul 23 21:15:27 2020 -0700 mm: memcg/slab: fix memory leak at non-root kmem_cache destroy If the kmem_cache refcount is greater than one, we should not mark the root kmem_cache as dying. If we mark the root kmem_cache dying incorrectly, the non-root kmem_cache can never be destroyed. It resulted in memory leak when memcg was destroyed. We can use the following steps to reproduce. 1) Use kmem_cache_create() to create a new kmem_cache named A. 2) Coincidentally, the kmem_cache A is an alias for kmem_cache B, so the refcount of B is just increased. 3) Use kmem_cache_destroy() to destroy the kmem_cache A, just decrease the B's refcount but mark the B as dying. 4) Create a new memory cgroup and alloc memory from the kmem_cache B. It leads to create a non-root kmem_cache for allocating memory. 5) When destroy the memory cgroup created in the step 4), the non-root kmem_cache can never be destroyed. If we repeat steps 4) and 5), this will cause a lot of memory leak. So only when refcount reach zero, we mark the root kmem_cache as dying. Fixes: 92ee383f6daa ("mm: fix race between kmem_cache destroy, create and deactivate") Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Vlastimil Babka Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Shakeel Butt Cc: Link: http://lkml.kernel.org/r/20200716165103.83462-1-songmuchun@bytedance.com Signed-off-by: Linus Torvalds commit 8d22a9351035ef2ff12ef163a1091b8b8cf1e49c Author: Hugh Dickins Date: Thu Jul 23 21:15:24 2020 -0700 mm/memcg: fix refcount error while moving and swapping It was hard to keep a test running, moving tasks between memcgs with move_charge_at_immigrate, while swapping: mem_cgroup_id_get_many()'s refcount is discovered to be 0 (supposedly impossible), so it is then forced to REFCOUNT_SATURATED, and after thousands of warnings in quick succession, the test is at last put out of misery by being OOM killed. This is because of the way moved_swap accounting was saved up until the task move gets completed in __mem_cgroup_clear_mc(), deferred from when mem_cgroup_move_swap_account() actually exchanged old and new ids. Concurrent activity can free up swap quicker than the task is scanned, bringing id refcount down 0 (which should only be possible when offlining). Just skip that optimization: do that part of the accounting immediately. Fixes: 615d66c37c75 ("mm: memcontrol: fix memcg id ref counter on swap charge move") Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Cc: Johannes Weiner Cc: Alex Shi Cc: Shakeel Butt Cc: Michal Hocko Cc: Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2007071431050.4726@eggly.anvils Signed-off-by: Linus Torvalds commit 82ff165cd35110d4e380b55927bbd74dcb564998 Author: Bhupesh Sharma Date: Thu Jul 23 21:15:21 2020 -0700 mm/memcontrol: fix OOPS inside mem_cgroup_get_nr_swap_pages() Prabhakar reported an OOPS inside mem_cgroup_get_nr_swap_pages() function in a corner case seen on some arm64 boards when kdump kernel runs with "cgroup_disable=memory" passed to the kdump kernel via bootargs. The root-cause behind the same is that currently mem_cgroup_swap_init() function is implemented as a subsys_initcall() call instead of a core_initcall(), this means 'cgroup_memory_noswap' still remains set to the default value (false) even when memcg is disabled via "cgroup_disable=memory" boot parameter. This may result in premature OOPS inside mem_cgroup_get_nr_swap_pages() function in corner cases: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000188 Mem abort info: ESR = 0x96000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 [0000000000000188] user address but active_mm is swapper Internal error: Oops: 96000006 [#1] SMP Modules linked in: <..snip..> Call trace: mem_cgroup_get_nr_swap_pages+0x9c/0xf4 shrink_lruvec+0x404/0x4f8 shrink_node+0x1a8/0x688 do_try_to_free_pages+0xe8/0x448 try_to_free_pages+0x110/0x230 __alloc_pages_slowpath.constprop.106+0x2b8/0xb48 __alloc_pages_nodemask+0x2ac/0x2f8 alloc_page_interleave+0x20/0x90 alloc_pages_current+0xdc/0xf8 atomic_pool_expand+0x60/0x210 __dma_atomic_pool_init+0x50/0xa4 dma_atomic_pool_init+0xac/0x158 do_one_initcall+0x50/0x218 kernel_init_freeable+0x22c/0x2d0 kernel_init+0x18/0x110 ret_from_fork+0x10/0x18 Code: aa1403e3 91106000 97f82a27 14000011 (f940c663) ---[ end trace 9795948475817de4 ]--- Kernel panic - not syncing: Fatal exception Rebooting in 10 seconds.. Fixes: eccb52e78809 ("mm: memcontrol: prepare swap controller setup for integration") Reported-by: Prabhakar Kushwaha Signed-off-by: Bhupesh Sharma Signed-off-by: Andrew Morton Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Cc: James Morse Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Link: http://lkml.kernel.org/r/1593641660-13254-2-git-send-email-bhsharma@redhat.com Signed-off-by: Linus Torvalds commit 45779b036d3d2870633443a9f9bd03c177befbf5 Author: Tom Rix Date: Thu Jul 23 21:15:18 2020 -0700 mm: initialize return of vm_insert_pages clang static analysis reports a garbage return In file included from mm/memory.c:84: mm/memory.c:1612:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] return err; ^~~~~~~~~~ The setting of err depends on a loop executing. So initialize err. Signed-off-by: Tom Rix Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200703155354.29132-1-trix@redhat.com Signed-off-by: Linus Torvalds commit 3bef735ad7b7d987069181e7b58588043cbd1509 Author: Chengguang Xu Date: Thu Jul 23 21:15:14 2020 -0700 vfs/xattr: mm/shmem: kernfs: release simple xattr entry in a right way After commit fdc85222d58e ("kernfs: kvmalloc xattr value instead of kmalloc"), simple xattr entry is allocated with kvmalloc() instead of kmalloc(), so we should release it with kvfree() instead of kfree(). Fixes: fdc85222d58e ("kernfs: kvmalloc xattr value instead of kmalloc") Signed-off-by: Chengguang Xu Signed-off-by: Andrew Morton Acked-by: Hugh Dickins Acked-by: Tejun Heo Cc: Daniel Xu Cc: Chris Down Cc: Andreas Dilger Cc: Greg Kroah-Hartman Cc: Al Viro Cc: [5.7] Link: http://lkml.kernel.org/r/20200704051608.15043-1-cgxu519@mykernel.net Signed-off-by: Linus Torvalds commit 246c320a8cfe0b11d81a4af38fa9985ef0cc9a4c Author: Kirill A. Shutemov Date: Thu Jul 23 21:15:11 2020 -0700 mm/mmap.c: close race between munmap() and expand_upwards()/downwards() VMA with VM_GROWSDOWN or VM_GROWSUP flag set can change their size under mmap_read_lock(). It can lead to race with __do_munmap(): Thread A Thread B __do_munmap() detach_vmas_to_be_unmapped() mmap_write_downgrade() expand_downwards() vma->vm_start = address; // The VMA now overlaps with // VMAs detached by the Thread A // page fault populates expanded part // of the VMA unmap_region() // Zaps pagetables partly // populated by Thread B Similar race exists for expand_upwards(). The fix is to avoid downgrading mmap_lock in __do_munmap() if detached VMAs are next to VM_GROWSDOWN or VM_GROWSUP VMA. [akpm@linux-foundation.org: s/mmap_sem/mmap_lock/ in comment] Fixes: dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap") Reported-by: Jann Horn Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Reviewed-by: Yang Shi Acked-by: Vlastimil Babka Cc: Oleg Nesterov Cc: Matthew Wilcox Cc: [4.20+] Link: http://lkml.kernel.org/r/20200709105309.42495-1-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit 4ae6dbd683860b9edc254ea8acf5e04b5ae242e5 Author: Pavel Begunkov Date: Fri Jul 24 20:07:21 2020 +0300 io_uring: fix lockup in io_fail_links() io_fail_links() doesn't consider REQ_F_COMP_LOCKED leading to nested spin_lock(completion_lock) and lockup. [ 197.680409] rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { 6-... } 18239 jiffies s: 1421 root: 0x40/. [ 197.680411] rcu: blocking rcu_node structures: [ 197.680412] Task dump for CPU 6: [ 197.680413] link-timeout R running task 0 1669 1 0x8000008a [ 197.680414] Call Trace: [ 197.680420] ? io_req_find_next+0xa0/0x200 [ 197.680422] ? io_put_req_find_next+0x2a/0x50 [ 197.680423] ? io_poll_task_func+0xcf/0x140 [ 197.680425] ? task_work_run+0x67/0xa0 [ 197.680426] ? do_exit+0x35d/0xb70 [ 197.680429] ? syscall_trace_enter+0x187/0x2c0 [ 197.680430] ? do_group_exit+0x43/0xa0 [ 197.680448] ? __x64_sys_exit_group+0x18/0x20 [ 197.680450] ? do_syscall_64+0x52/0xa0 [ 197.680452] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit d5e16d8e23825304c6a9945116cc6b6f8d51f28c Author: Pavel Begunkov Date: Fri Jul 24 20:07:20 2020 +0300 io_uring: fix ->work corruption with poll_add req->work might be already initialised by the time it gets into __io_arm_poll_handler(), which will corrupt it by using fields that are in an union with req->work. Luckily, the only side effect is missing put_creds(). Clean req->work before going there. Suggested-by: Jens Axboe Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 293a92c1d9913248b9987b68f3a5d6d2f0aae62b Author: Armas Spann Date: Fri Jul 24 16:08:37 2020 +0200 ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus G14(GA401) series with ALC289 This patch fixes a small typo I accidently submitted with the initial patch. The board should be named GA401 not G401. Fixes: ff53664daff2 ("ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G14(G401) series with ALC289") Signed-off-by: Armas Spann Cc: Link: https://lore.kernel.org/r/20200724140837.302763-1-zappel@retarded.farm Signed-off-by: Takashi Iwai commit 4b43d05a1978a93a19374c6e6b817c9c1ff4ba4b Author: Armas Spann Date: Fri Jul 24 16:06:16 2020 +0200 ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series with ALC289 This patch adds support for headset mic to the ASUS ROG Zephyrus G15(GA502) notebook series by adding the corresponding vendor/pci_device id, as well as adding a new fixup for the used realtek ALC289. The fixup stets the correct pin to get the headset mic correctly recognized on audio-jack. Signed-off-by: Armas Spann Cc: Link: https://lore.kernel.org/r/20200724140616.298892-1-zappel@retarded.farm Signed-off-by: Takashi Iwai commit b0fef5edff0330eb6de267acd3b6cccb32a43633 Merge: 7c8c70ba5c15 09781ba0395c Author: Arnd Bergmann Date: Fri Jul 24 16:14:24 2020 +0200 Merge tag 'mvebu-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/fixes mvebu fixes for 5.8 (part 1) - DT change for Armada 38x allowing to add the register needed to fix NETA lockup when repeatedly switching speed. * tag 'mvebu-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds commit fe5ed7ab99c656bd2f5b79b49df0e9ebf2cead8a Author: Oleg Nesterov Date: Thu Jul 23 17:44:20 2020 +0200 uprobes: Change handle_swbp() to send SIGTRAP with si_code=SI_KERNEL, to fix GDB regression If a tracee is uprobed and it hits int3 inserted by debugger, handle_swbp() does send_sig(SIGTRAP, current, 0) which means si_code == SI_USER. This used to work when this code was written, but then GDB started to validate si_code and now it simply can't use breakpoints if the tracee has an active uprobe: # cat test.c void unused_func(void) { } int main(void) { return 0; } # gcc -g test.c -o test # perf probe -x ./test -a unused_func # perf record -e probe_test:unused_func gdb ./test -ex run GNU gdb (GDB) 10.0.50.20200714-git ... Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff7ddf909 in dl_main () from /lib64/ld-linux-x86-64.so.2 (gdb) The tracee hits the internal breakpoint inserted by GDB to monitor shared library events but GDB misinterprets this SIGTRAP and reports a signal. Change handle_swbp() to use force_sig(SIGTRAP), this matches do_int3_user() and fixes the problem. This is the minimal fix for -stable, arch/x86/kernel/uprobes.c is equally wrong; it should use send_sigtrap(TRAP_TRACE) instead of send_sig(SIGTRAP), but this doesn't confuse GDB and needs another x86-specific patch. Reported-by: Aaron Merey Signed-off-by: Oleg Nesterov Signed-off-by: Ingo Molnar Reviewed-by: Srikar Dronamraju Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200723154420.GA32043@redhat.com commit 062d3f95b630113e1156a31f376ad36e25da29a7 Author: Chris Wilson Date: Thu Jul 23 21:10:42 2020 +0100 sched: Warn if garbage is passed to default_wake_function() Since the default_wake_function() passes its flags onto try_to_wake_up(), warn if those flags collide with internal values. Given that the supplied flags are garbage, no repair can be done but at least alert the user to the damage they are causing. In the belief that these errors should be picked up during testing, the warning is only compiled in under CONFIG_SCHED_DEBUG. Signed-off-by: Chris Wilson Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200723201042.18861-1-chris@chris-wilson.co.uk commit 5fdbe136ae19ab751daaa4d08d9a42f3e30d17f9 Author: Matthew Howell Date: Wed Jul 22 16:11:24 2020 -0400 serial: exar: Fix GPIO configuration for Sealevel cards based on XR17V35X Sealevel XR17V35X based devices are inoperable on kernel versions 4.11 and above due to a change in the GPIO preconfiguration introduced in commit 7dea8165f1d. This patch fixes this by preconfiguring the GPIO on Sealevel cards to the value (0x00) used prior to commit 7dea8165f1d With GPIOs preconfigured as per commit 7dea8165f1d all ports on Sealevel XR17V35X based devices become stuck in high impedance mode, regardless of dip-switch or software configuration. This causes the device to become effectively unusable. This patch (in various forms) has been distributed to our customers and no issues related to it have been reported. Fixes: 7dea8165f1d6 ("serial: exar: Preconfigure xr17v35x MPIOs as output") Signed-off-by: Matthew Howell Link: https://lore.kernel.org/r/alpine.DEB.2.21.2007221605270.13247@tstest-VirtualBox Signed-off-by: Greg Kroah-Hartman commit 15fbc3b938534cc8eaac584a7b0c1183fc968b86 Author: Ben Skeggs Date: Fri Jul 24 17:02:48 2020 +1000 drm/nouveau/fbcon: zero-initialise the mode_cmd2 structure This is tripping up the format modifier patches. Signed-off-by: Ben Skeggs commit 498595abf5bd51f0ae074cec565d888778ea558f Author: Ben Skeggs Date: Fri Jul 24 17:01:39 2020 +1000 drm/nouveau/fbcon: fix module unload when fbcon init has failed for some reason Stale pointer was tripping up the unload path. Signed-off-by: Ben Skeggs commit 705d9d022949e3cdae82d89db6a8fc773eb23dad Author: Ben Skeggs Date: Thu Jul 23 20:10:42 2020 +1000 drm/nouveau/kms/tu102: wait for core update to complete when assigning windows Fixes a race on Turing between the core cross-channel error checks and the following window update. Signed-off-by: Ben Skeggs commit 0508831470fb5ba02485156cb8bea9aeda74248b Author: Ben Skeggs Date: Fri Jul 24 13:26:40 2020 +1000 drm/nouveau/kms/gf100: use correct format modifiers The disp015x classes are used by both gt21x and gf1xx (aside from gf119), but page kinds differ between Tesla and Fermi. Signed-off-by: Ben Skeggs commit 163d5446c37af92c85e6d58f87fe9840abac71ea Author: Ben Skeggs Date: Wed Jul 8 17:28:09 2020 +1000 drm/nouveau/disp/gm200-: fix regression from HDA SOR selection changes Fixes: 9b5ca547bb8 ("drm/nouveau/disp/gm200-: detect and potentially disable HDA support on some SORs") Signed-off-by: Ben Skeggs commit 09781ba0395c46b1c844f47e405e3ce7856f5989 Author: Russell King Date: Tue Jul 21 15:40:38 2020 +0100 ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds To support the change in "phy: armada-38x: fix NETA lockup when repeatedly switching speeds" we need to update the DT with the additional register. Fixes: 14dc100b4411 ("phy: armada38x: add common phy support") Signed-off-by: Russell King Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 8e8135862ccb5082347e2137b8a33edaf51427ce Merge: 32818c075c54 8210e344ccb7 Author: David S. Miller Date: Thu Jul 23 17:22:09 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter/IPVS fixes for net The following patchset contains Netfilter/IPVS fixes for net: 1) Fix NAT hook deletion when table is dormant, from Florian Westphal. 2) Fix IPVS sync stalls, from guodeqing. ==================== Signed-off-by: David S. Miller commit 32818c075c54bb0cae44dd6f7ab00b01c52b8372 Author: Cong Wang Date: Wed Jul 22 18:56:25 2020 -0700 geneve: fix an uninitialized value in geneve_changelink() geneve_nl2info() sets 'df' conditionally, so we have to initialize it by copying the value from existing geneve device in geneve_changelink(). Fixes: 56c09de347e4 ("geneve: allow changing DF behavior after creation") Reported-by: syzbot+7ebc2e088af5e4c0c9fa@syzkaller.appspotmail.com Cc: Sabrina Dubroca Signed-off-by: Cong Wang Reviewed-by: Sabrina Dubroca Signed-off-by: David S. Miller commit c75d1d5248c0c97996051809ad0e9f154ba5d76e Author: Cong Wang Date: Wed Jul 22 16:31:54 2020 -0700 bonding: check return value of register_netdevice() in bond_newlink() Very similar to commit 544f287b8495 ("bonding: check error value of register_netdevice() immediately"), we should immediately check the return value of register_netdevice() before doing anything else. Fixes: 005db31d5f5f ("bonding: set carrier off for devices created through netlink") Reported-and-tested-by: syzbot+bbc3a11c4da63c1b74d6@syzkaller.appspotmail.com Cc: Beniamino Galvani Cc: Taehee Yoo Cc: Jay Vosburgh Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 0e6705182d4e1b77248a93470d6d7b3013d59b30 Author: Steve French Date: Thu Jul 23 14:41:29 2020 -0500 Revert "cifs: Fix the target file was deleted when rename failed." This reverts commit 9ffad9263b467efd8f8dc7ae1941a0a655a2bab2. Upon additional testing with older servers, it was found that the original commit introduced a regression when using the old SMB1 dialect and rsyncing over an existing file. The patch will need to be respun to address this, likely including a larger refactoring of the SMB1 and SMB3 rename code paths to make it less confusing and also to address some additional rename error cases that SMB3 may be able to workaround. Signed-off-by: Steve French Reported-by: Patrick Fernie CC: Stable Acked-by: Ronnie Sahlberg Acked-by: Pavel Shilovsky Acked-by: Zhang Xiaoxu commit f37e99aca03f63aa3f2bd13ceaf769455d12c4b0 Merge: d15be546031c 0cfa112b33ab Author: Linus Torvalds Date: Thu Jul 23 13:42:46 2020 -0700 Merge tag 's390-5.8-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux into master Pull s390 fixes from Heiko Carstens: - Change cpum_cf/perf counter name from DFLT_CCERROR to DFLT_CCFINISH to reflect reality and avoid further confusion. This is a user space visible change therefore the commit has also a stable tag for 5.7, where this counter was introduced. - Add Matthew Rosato as s390 IOMMU maintainer. * tag 's390-5.8-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: MAINTAINERS: add Matthew for s390 IOMMU s390/cpum_cf,perf: change DFLT_CCERROR counter name commit 02b9aec59243c6240fc42884acc958602146ddf6 Author: Douglas Anderson Date: Wed Jul 22 15:00:21 2020 -0700 i2c: i2c-qcom-geni: Fix DMA transfer race When I have KASAN enabled on my kernel and I start stressing the touchscreen my system tends to hang. The touchscreen is one of the only things that does a lot of big i2c transfers and ends up hitting the DMA paths in the geni i2c driver. It appears that KASAN adds enough delay in my system to tickle a race condition in the DMA setup code. When the system hangs, I found that it was running the geni_i2c_irq() over and over again. It had these: m_stat = 0x04000080 rx_st = 0x30000011 dm_tx_st = 0x00000000 dm_rx_st = 0x00000000 dma = 0x00000001 Notably we're in DMA mode but are getting M_RX_IRQ_EN and M_RX_FIFO_WATERMARK_EN over and over again. Putting some traces in geni_i2c_rx_one_msg() showed that when we failed we were getting to the start of geni_i2c_rx_one_msg() but were never executing geni_se_rx_dma_prep(). I believe that the problem here is that we are starting the geni command before we run geni_se_rx_dma_prep(). If a transfer makes it far enough before we do that then we get into the state I have observed. Let's change the order, which seems to work fine. Although problems were seen on the RX path, code inspection suggests that the TX should be changed too. Change it as well. Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller") Signed-off-by: Douglas Anderson Tested-by: Sai Prakash Ranjan Reviewed-by: Akash Asthana Reviewed-by: Stephen Boyd Reviewed-by: Mukesh Kumar Savaliya Signed-off-by: Wolfram Sang commit eb01597158ffb1853a7a7fc2c57d4c844640f75e Author: Wolfram Sang Date: Sat Jul 4 15:38:29 2020 +0200 i2c: rcar: always clear ICSAR to avoid side effects On R-Car Gen2, we get a timeout when reading from the address set in ICSAR, even though the slave interface is disabled. Clearing it fixes this situation. Note that Gen3 is not affected. To reproduce: bind and undbind an I2C slave on some bus, run 'i2cdetect' on that bus. Fixes: de20d1857dd6 ("i2c: rcar: add slave support") Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 76be93fc0702322179bb0ea87295d820ee46ad14 Author: Yuchung Cheng Date: Thu Jul 23 12:00:06 2020 -0700 tcp: allow at most one TLP probe per flight Previously TLP may send multiple probes of new data in one flight. This happens when the sender is cwnd limited. After the initial TLP containing new data is sent, the sender receives another ACK that acks partial inflight. It may re-arm another TLP timer to send more, if no further ACK returns before the next TLP timeout (PTO) expires. The sender may send in theory a large amount of TLP until send queue is depleted. This only happens if the sender sees such irregular uncommon ACK pattern. But it is generally undesirable behavior during congestion especially. The original TLP design restrict only one TLP probe per inflight as published in "Reducing Web Latency: the Virtue of Gentle Aggression", SIGCOMM 2013. This patch changes TLP to send at most one probe per inflight. Note that if the sender is app-limited, TLP retransmits old data and did not have this issue. Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 17ad73e941b71f3bec7523ea4e9cbc3752461c2d Author: Dan Carpenter Date: Thu Jul 23 17:49:57 2020 +0300 AX.25: Prevent integer overflows in connect and sendmsg We recently added some bounds checking in ax25_connect() and ax25_sendmsg() and we so we removed the AX25_MAX_DIGIS checks because they were no longer required. Unfortunately, I believe they are required to prevent integer overflows so I have added them back. Fixes: 8885bb0621f0 ("AX.25: Prevent out-of-bounds read in ax25_sendmsg()") Fixes: 2f2a7ffad5c6 ("AX.25: Fix out-of-bounds read in ax25_connect()") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 5df96f2b9f58a5d2dc1f30fe7de75e197f2c25f2 Author: Mikulas Patocka Date: Thu Jul 23 10:42:09 2020 -0400 dm integrity: fix integrity recalculation that is improperly skipped Commit adc0daad366b62ca1bce3e2958a40b0b71a8b8b3 ("dm: report suspended device during destroy") broke integrity recalculation. The problem is dm_suspended() returns true not only during suspend, but also during resume. So this race condition could occur: 1. dm_integrity_resume calls queue_work(ic->recalc_wq, &ic->recalc_work) 2. integrity_recalc (&ic->recalc_work) preempts the current thread 3. integrity_recalc calls if (unlikely(dm_suspended(ic->ti))) goto unlock_ret; 4. integrity_recalc exits and no recalculating is done. To fix this race condition, add a function dm_post_suspending that is only true during the postsuspend phase and use it instead of dm_suspended(). Signed-off-by: Mikulas Patocka Fixes: adc0daad366b ("dm: report suspended device during destroy") Cc: stable vger kernel org # v4.18+ Signed-off-by: Mike Snitzer commit 3e863ea3bb1a2203ae648eb272db0ce6a1a2072c Author: Pavel Begunkov Date: Thu Jul 23 20:17:20 2020 +0300 io_uring: missed req_init_async() for IOSQE_ASYNC IOSQE_ASYNC branch of io_queue_sqe() is another place where an unitialised req->work can be accessed (i.e. prior io_req_init_async()). Nothing really bad though, it just looses IO_WQ_WORK_CONCURRENT flag. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 29c4a54bc645c8b6745eeb58519e9ad794ceb419 Author: Andy Shevchenko Date: Thu Jul 16 21:27:47 2020 +0300 device property: Avoid NULL pointer dereference in device_get_next_child_node() When we have no primary fwnode or when it's a software node, we may end up in the situation when fwnode is a NULL pointer. There is no point to look for secondary fwnode in such case. Add a necessary check to a condition. Fixes: 114dbb4fa7c4 ("drivers property: When no children in primary, try secondary") Reported-by: Maxim Levitsky Signed-off-by: Andy Shevchenko Tested-by: Maxim Levitsky Link: https://lore.kernel.org/r/20200716182747.54929-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 033724d6864245a11f8e04c066002e6ad22b3fd0 Author: Tetsuo Handa Date: Wed Jul 15 10:51:02 2020 +0900 fbdev: Detect integer underflow at "struct fbcon_ops"->clear_margins. syzbot is reporting general protection fault in bitfill_aligned() [1] caused by integer underflow in bit_clear_margins(). The cause of this problem is when and how do_vc_resize() updates vc->vc_{cols,rows}. If vc_do_resize() fails (e.g. kzalloc() fails) when var.xres or var.yres is going to shrink, vc->vc_{cols,rows} will not be updated. This allows bit_clear_margins() to see info->var.xres < (vc->vc_cols * cw) or info->var.yres < (vc->vc_rows * ch). Unexpectedly large rw or bh will try to overrun the __iomem region and causes general protection fault. Also, vc_resize(vc, 0, 0) does not set vc->vc_{cols,rows} = 0 due to new_cols = (cols ? cols : vc->vc_cols); new_rows = (lines ? lines : vc->vc_rows); exception. Since cols and lines are calculated as cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); cols /= vc->vc_font.width; rows /= vc->vc_font.height; vc_resize(vc, cols, rows); in fbcon_modechanged(), var.xres < vc->vc_font.width makes cols = 0 and var.yres < vc->vc_font.height makes rows = 0. This means that const int fd = open("/dev/fb0", O_ACCMODE); struct fb_var_screeninfo var = { }; ioctl(fd, FBIOGET_VSCREENINFO, &var); var.xres = var.yres = 1; ioctl(fd, FBIOPUT_VSCREENINFO, &var); easily reproduces integer underflow bug explained above. Of course, callers of vc_resize() are not handling vc_do_resize() failure is bad. But we can't avoid vc_resize(vc, 0, 0) which returns 0. Therefore, as a band-aid workaround, this patch checks integer underflow in "struct fbcon_ops"->clear_margins call, assuming that vc->vc_cols * vc->vc_font.width and vc->vc_rows * vc->vc_font.heigh do not cause integer overflow. [1] https://syzkaller.appspot.com/bug?id=a565882df74fa76f10d3a6fec4be31098dbb37c6 Reported-and-tested-by: syzbot Signed-off-by: Tetsuo Handa Acked-by: Daniel Vetter Cc: stable Link: https://lore.kernel.org/r/20200715015102.3814-1-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman commit 0b987032f8b58ef51cc8a042f46cc0cf1f277172 Author: Jon Hunter Date: Wed Jul 15 12:38:42 2020 +0100 usb: tegra: Fix allocation for the FPCI context Commit 5c4e8d3781bc ("usb: host: xhci-tegra: Add support for XUSB context save/restore") is using the IPFS 'num_offsets' value when allocating memory for FPCI context instead of the FPCI 'num_offsets'. After commit cad064f1bd52 ("devres: handle zero size in devm_kmalloc()") was added system suspend started failing on Tegra186. The kernel log showed that the Tegra XHCI driver was crashing on entry to suspend when attempting the save the USB context. On Tegra186, the IPFS context has a zero length but the FPCI content has a non-zero length, and because of the bug in the Tegra XHCI driver we are incorrectly allocating a zero length array for the FPCI context. The crash seen on entering suspend when we attempt to save the FPCI context and following commit cad064f1bd52 ("devres: handle zero size in devm_kmalloc()") this now causes a NULL pointer deference when we access the memory. Fix this by correcting the amount of memory we are allocating for FPCI contexts. Cc: stable@vger.kernel.org Fixes: 5c4e8d3781bc ("usb: host: xhci-tegra: Add support for XUSB context save/restore") Signed-off-by: Jon Hunter Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20200715113842.30680-1-jonathanh@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 7b7891c7bdfd61fc9ed6747a0a05efe2394dddc6 Author: Nathan Chancellor Date: Wed Jul 22 21:15:10 2020 -0700 arm64: vdso32: Fix '--prefix=' value for newer versions of clang Newer versions of clang only look for $(COMPAT_GCC_TOOLCHAIN_DIR)as [1], rather than $(COMPAT_GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE_COMPAT)as, resulting in the following build error: $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \ CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LLVM=1 O=out/aarch64 distclean \ defconfig arch/arm64/kernel/vdso32/ ... /home/nathan/cbl/toolchains/llvm-binutils/bin/as: unrecognized option '-EL' clang-12: error: assembler command failed with exit code 1 (use -v to see invocation) make[3]: *** [arch/arm64/kernel/vdso32/Makefile:181: arch/arm64/kernel/vdso32/note.o] Error 1 ... Adding the value of CROSS_COMPILE_COMPAT (adding notdir to account for a full path for CROSS_COMPILE_COMPAT) fixes this issue, which matches the solution done for the main Makefile [2]. [1]: https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90 [2]: https://lore.kernel.org/lkml/20200721173125.1273884-1-maskray@google.com/ Signed-off-by: Nathan Chancellor Cc: stable@vger.kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/1099 Link: https://lore.kernel.org/r/20200723041509.400450-1-natechancellor@gmail.com Signed-off-by: Will Deacon commit 92d232d176041db5b033dd7b7f7f2cf343f82237 Author: Georgi Djakov Date: Thu Jul 23 11:37:35 2020 +0300 interconnect: msm8916: Fix buswidth of pcnoc_s nodes The buswidth of the pcnoc_s_* nodes is actually not 8, but 4 bytes. Let's fix it. Reported-by: Jun Nie Reviewed-by: Mike Tipton Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Link: https://lore.kernel.org/r/20200709130004.12462-1-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov Cc: stable Link: https://lore.kernel.org/r/20200723083735.5616-3-georgi.djakov@linaro.org Signed-off-by: Greg Kroah-Hartman commit 91b44981a2316e7b00574d32dec4fae356444dcf Author: Georgi Djakov Date: Thu Jul 23 11:37:34 2020 +0300 interconnect: Do not skip aggregation for disabled paths When an interconnect path is being disabled, currently we don't aggregate the requests for it afterwards. But the re-aggregation step shouldn't be skipped, as it may leave the nodes with outdated bandwidth data. This outdated data may actually keep the path still enabled and prevent the device from going into lower power states. Reported-by: Atul Dhudase Fixes: 7d374b209083 ("interconnect: Add helpers for enabling/disabling a path") Reviewed-by: Sibi Sankar Tested-by: Atul Dhudase Reviewed-by: Atul Dhudase Link: https://lore.kernel.org/r/20200721120740.3436-1-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov Link: https://lore.kernel.org/r/20200723083735.5616-2-georgi.djakov@linaro.org Signed-off-by: Greg Kroah-Hartman commit b34e7e298d7a5ed76b3aa327c240c29f1ef6dd22 Author: Eric Biggers Date: Wed Jul 15 23:05:53 2020 -0700 /dev/mem: Add missing memory barriers for devmem_inode WRITE_ONCE() isn't the correct way to publish a pointer to a data structure, since it doesn't include a write memory barrier. Therefore other tasks may see that the pointer has been set but not see that the pointed-to memory has finished being initialized yet. Instead a primitive with "release" semantics is needed. Use smp_store_release() for this. The use of READ_ONCE() on the read side is still potentially correct if there's no control dependency, i.e. if all memory being "published" is transitively reachable via the pointer itself. But this pairing is somewhat confusing and error-prone. So just upgrade the read side to smp_load_acquire() so that it clearly pairs with smp_store_release(). Cc: Arnd Bergmann Cc: Ingo Molnar Cc: Kees Cook Cc: Matthew Wilcox Cc: Russell King Cc: Andrew Morton Fixes: 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the region") Signed-off-by: Eric Biggers Cc: stable Acked-by: Dan Williams Link: https://lore.kernel.org/r/20200716060553.24618-1-ebiggers@kernel.org Signed-off-by: Greg Kroah-Hartman commit f867c771f98891841c217fa8459244ed0dd28921 Author: Tetsuo Handa Date: Fri Jul 17 00:12:15 2020 +0900 binder: Don't use mmput() from shrinker function. syzbot is reporting that mmput() from shrinker function has a risk of deadlock [1], for delayed_uprobe_add() from update_ref_ctr() calls kzalloc(GFP_KERNEL) with delayed_uprobe_lock held, and uprobe_clear_state() from __mmput() also holds delayed_uprobe_lock. Commit a1b2289cef92ef0e ("android: binder: drop lru lock in isolate callback") replaced mmput() with mmput_async() in order to avoid sleeping with spinlock held. But this patch replaces mmput() with mmput_async() in order not to start __mmput() from shrinker context. [1] https://syzkaller.appspot.com/bug?id=bc9e7303f537c41b2b0cc2dfcea3fc42964c2d45 Reported-by: syzbot Reported-by: syzbot Signed-off-by: Tetsuo Handa Reviewed-by: Michal Hocko Acked-by: Todd Kjos Acked-by: Christian Brauner Cc: stable Link: https://lore.kernel.org/r/4ba9adb2-43f5-2de0-22de-f6075c1fab50@i-love.sakura.ne.jp Signed-off-by: Greg Kroah-Hartman commit d8904ca9d338cdaa67e3bd06d7a7d418e426648c Merge: 26a2be0789a7 38e0c89a19fd Author: Dave Airlie Date: Thu Jul 23 14:06:14 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-07-22' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-07-22: amdgpu: - Fix crash when overclocking VegaM - Fix possible crash when editing dpm levels Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200723032608.3865-1-alexander.deucher@amd.com commit 26a2be0789a7c0d1c6d7d86d9ed8d25e2efd94a8 Merge: ba47d845d715 f3f90c6db188 Author: Dave Airlie Date: Thu Jul 23 14:05:28 2020 +1000 Merge tag 'drm-misc-fixes-2020-07-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * sun4i: Fix inverted HPD result; fixes an earlier fix * lima: fix timeout during reset Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200722070321.GA29190@linux-uq9g commit e6827d1abdc9b061a57d7b7d3019c4e99fabea2f Author: Navid Emamdoost Date: Wed Jul 22 21:58:39 2020 -0500 cxgb4: add missing release on skb in uld_send() In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP. Signed-off-by: Navid Emamdoost Signed-off-by: David S. Miller commit ca9b31f6bb9c6aa9b4e5f0792f39a97bbffb8c51 Author: Fangrui Song Date: Tue Jul 21 10:31:23 2020 -0700 Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation When CROSS_COMPILE is set (e.g. aarch64-linux-gnu-), if $(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-elfedit, GCC_TOOLCHAIN_DIR will be set to /usr/bin/. --prefix= will be set to /usr/bin/ and Clang as of 11 will search for both $(prefix)aarch64-linux-gnu-$needle and $(prefix)$needle. GCC searchs for $(prefix)aarch64-linux-gnu/$version/$needle, $(prefix)aarch64-linux-gnu/$needle and $(prefix)$needle. In practice, $(prefix)aarch64-linux-gnu/$needle rarely contains executables. To better model how GCC's -B/--prefix takes in effect in practice, newer Clang (since https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90) only searches for $(prefix)$needle. Currently it will find /usr/bin/as instead of /usr/bin/aarch64-linux-gnu-as. Set --prefix= to $(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) (/usr/bin/aarch64-linux-gnu-) so that newer Clang can find the appropriate cross compiling GNU as (when -no-integrated-as is in effect). Cc: stable@vger.kernel.org Reported-by: Nathan Chancellor Signed-off-by: Fangrui Song Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Tested-by: Nick Desaulniers Link: https://github.com/ClangBuiltLinux/linux/issues/1099 Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 901f3cc1639e5103a8997f6ab243785d292e2074 Author: Egor Pomozov Date: Wed Jul 22 22:09:58 2020 +0300 net: atlantic: fix PTP on AQC10X This patch fixes PTP on AQC10X. PTP support on AQC10X requires FW involvement and FW configures the TPS data arb mode itself. So we must make sure driver doesn't touch TPS data arb mode on AQC10x if PTP is enabled. Otherwise, there are no timestamps even though packets are flowing. Fixes: 2deac71ac492a ("net: atlantic: QoS implementation: min_rate") Signed-off-by: Egor Pomozov Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 8885bb0621f01a6c82be60a91e5fc0f6e2f71186 Author: Peilin Ye Date: Wed Jul 22 12:05:12 2020 -0400 AX.25: Prevent out-of-bounds read in ax25_sendmsg() Checks on `addr_len` and `usax->sax25_ndigis` are insufficient. ax25_sendmsg() can go out of bounds when `usax->sax25_ndigis` equals to 7 or 8. Fix it. It is safe to remove `usax->sax25_ndigis > AX25_MAX_DIGIS`, since `addr_len` is guaranteed to be less than or equal to `sizeof(struct full_sockaddr_ax25)` Signed-off-by: Peilin Ye Signed-off-by: David S. Miller commit f659173364c64d3276b8aba62368e7e732fab309 Merge: 2f2a7ffad5c6 3ecdda3e9ad8 Author: David S. Miller Date: Wed Jul 22 18:00:12 2020 -0700 Merge branch 'sctp-shrink-stream-outq-in-the-right-place' Xin Long says: ==================== sctp: shrink stream outq in the right place Patch 1 is an improvement, and Patch 2 is a bug fix. ==================== Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 3ecdda3e9ad837cf9cb41b6faa11b1af3a5abc0c Author: Xin Long Date: Wed Jul 22 23:52:12 2020 +0800 sctp: shrink stream outq when fails to do addstream reconf When adding a stream with stream reconf, the new stream firstly is in CLOSED state but new out chunks can still be enqueued. Then once gets the confirmation from the peer, the state will change to OPEN. However, if the peer denies, it needs to roll back the stream. But when doing that, it only sets the stream outcnt back, and the chunks already in the new stream don't get purged. It caused these chunks can still be dequeued in sctp_outq_dequeue_data(). As its stream is still in CLOSE, the chunk will be enqueued to the head again by sctp_outq_head_data(). This chunk will never be sent out, and the chunks after it can never be dequeued. The assoc will be 'hung' in a dead loop of sending this chunk. To fix it, this patch is to purge these chunks already in the new stream by calling sctp_stream_shrink_out() when failing to do the addstream reconf. Fixes: 11ae76e67a17 ("sctp: implement receiver-side procedures for the Reconf Response Parameter") Reported-by: Ying Xu Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 8f13399db22f909a35735bf8ae2f932e0c8f0e30 Author: Xin Long Date: Wed Jul 22 23:52:11 2020 +0800 sctp: shrink stream outq only when new outcnt < old outcnt It's not necessary to go list_for_each for outq->out_chunk_list when new outcnt >= old outcnt, as no chunk with higher sid than new (outcnt - 1) exists in the outqueue. While at it, also move the list_for_each code in a new function sctp_stream_shrink_out(), which will be used in the next patch. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 2f2a7ffad5c6cbf3d438e813cfdc88230e185ba6 Author: Peilin Ye Date: Wed Jul 22 11:19:01 2020 -0400 AX.25: Fix out-of-bounds read in ax25_connect() Checks on `addr_len` and `fsa->fsa_ax25.sax25_ndigis` are insufficient. ax25_connect() can go out of bounds when `fsa->fsa_ax25.sax25_ndigis` equals to 7 or 8. Fix it. This issue has been reported as a KMSAN uninit-value bug, because in such a case, ax25_connect() reaches into the uninitialized portion of the `struct sockaddr_storage` statically allocated in __sys_connect(). It is safe to remove `fsa->fsa_ax25.sax25_ndigis > AX25_MAX_DIGIS` because `addr_len` is guaranteed to be less than or equal to `sizeof(struct full_sockaddr_ax25)`. Reported-by: syzbot+c82752228ed975b0a623@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=55ef9d629f3b3d7d70b69558015b63b48d01af66 Signed-off-by: Peilin Ye Signed-off-by: David S. Miller commit 26cb7085c8984e5b71d65c374a135134ed8cabb3 Author: Claudiu Manoil Date: Wed Jul 22 17:40:12 2020 +0300 enetc: Remove the mdio bus on PF probe bailout For ENETC ports that register an external MDIO bus, the bus doesn't get removed on the error bailout path of enetc_pf_probe(). This issue became much more visible after recent: commit 07095c025ac2 ("net: enetc: Use DT protocol information to set up the ports") Before this commit, one could make probing fail on the error path only by having register_netdev() fail, which is unlikely. But after this commit, because it moved the enetc_of_phy_get() call up in the probing sequence, now we can trigger an mdiobus_free() bug just by forcing enetc_alloc_msix() to return error, i.e. with the 'pci=nomsi' kernel bootarg (since ENETC relies on MSI support to work), as the calltrace below shows: kernel BUG at /home/eiz/work/enetc/net/drivers/net/phy/mdio_bus.c:648! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [...] Hardware name: LS1028A RDB Board (DT) pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--) pc : mdiobus_free+0x50/0x58 lr : devm_mdiobus_free+0x14/0x20 [...] Call trace: mdiobus_free+0x50/0x58 devm_mdiobus_free+0x14/0x20 release_nodes+0x138/0x228 devres_release_all+0x38/0x60 really_probe+0x1c8/0x368 driver_probe_device+0x5c/0xc0 device_driver_attach+0x74/0x80 __driver_attach+0x8c/0xd8 bus_for_each_dev+0x7c/0xd8 driver_attach+0x24/0x30 bus_add_driver+0x154/0x200 driver_register+0x64/0x120 __pci_register_driver+0x44/0x50 enetc_pf_driver_init+0x24/0x30 do_one_initcall+0x60/0x1c0 kernel_init_freeable+0x1fc/0x274 kernel_init+0x14/0x110 ret_from_fork+0x10/0x34 Fixes: ebfcb23d62ab ("enetc: Add ENETC PF level external MDIO support") Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller commit 74f85551666fe40bd739e95b5ecb20f53f8ad4df Merge: 2a55280a3675 769e0fe1171e Author: Thomas Gleixner Date: Thu Jul 23 00:46:44 2020 +0200 Merge tag 'efi-urgent-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgent Pull EFI fixes from Ard Biesheuvel: - Fix the layering violation in the use of the EFI runtime services availability mask in users of the 'efivars' abstraction - Revert build fix for GCC v4.8 which is no longer supported - Some fixes for build issues found by Atish while working on RISC-V support - Avoid --whole-archive when linking the stub on arm64 - Some x86 EFI stub cleanups from Arvind commit d181d2da0141371bbc360eaea78719203e165e1c Author: Thomas Gleixner Date: Wed Jul 22 10:39:54 2020 +0200 x86/dumpstack: Dump user space code correctly again H.J. reported that post 5.7 a segfault of a user space task does not longer dump the Code bytes when /proc/sys/debug/exception-trace is enabled. It prints 'Code: Bad RIP value.' instead. This was broken by a recent change which made probe_kernel_read() reject non-kernel addresses. Update show_opcodes() so it retrieves user space opcodes via copy_from_user_nmi(). Fixes: 98a23609b103 ("maccess: always use strict semantics for probe_kernel_read") Reported-by: H.J. Lu Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/87h7tz306w.fsf@nanos.tec.linutronix.de commit 039a7a30ec102ec866d382a66f87f6f7654f8140 Author: Josh Poimboeuf Date: Fri Jul 17 09:04:26 2020 -0500 x86/stacktrace: Fix reliable check for empty user task stacks If a user task's stack is empty, or if it only has user regs, ORC reports it as a reliable empty stack. But arch_stack_walk_reliable() incorrectly treats it as unreliable. That happens because the only success path for user tasks is inside the loop, which only iterates on non-empty stacks. Generally, a user task must end in a user regs frame, but an empty stack is an exception to that rule. Thanks to commit 71c95825289f ("x86/unwind/orc: Fix error handling in __unwind_start()"), unwind_start() now sets state->error appropriately. So now for both ORC and FP unwinders, unwind_done() and !unwind_error() always means the end of the stack was successfully reached. So the success path for kthreads is no longer needed -- it can also be used for empty user tasks. Reported-by: Wang ShaoBo Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner Tested-by: Wang ShaoBo Link: https://lkml.kernel.org/r/f136a4e5f019219cbc4f4da33b30c2f44fa65b84.1594994374.git.jpoimboe@redhat.com commit 372a8eaa05998cd45b3417d0e0ffd3a70978211a Author: Josh Poimboeuf Date: Fri Jul 17 09:04:25 2020 -0500 x86/unwind/orc: Fix ORC for newly forked tasks The ORC unwinder fails to unwind newly forked tasks which haven't yet run on the CPU. It correctly reads the 'ret_from_fork' instruction pointer from the stack, but it incorrectly interprets that value as a call stack address rather than a "signal" one, so the address gets incorrectly decremented in the call to orc_find(), resulting in bad ORC data. Fix it by forcing 'ret_from_fork' frames to be signal frames. Reported-by: Wang ShaoBo Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner Tested-by: Wang ShaoBo Link: https://lkml.kernel.org/r/f91a8778dde8aae7f71884b5df2b16d552040441.1594994374.git.jpoimboe@redhat.com commit 9affa435817711861d774f5626c393c80f16d044 Author: J. Bruce Fields Date: Wed Jul 15 13:31:36 2020 -0400 nfsd4: fix NULL dereference in nfsd/clients display code We hold the cl_lock here, and that's enough to keep stateid's from going away, but it's not enough to prevent the files they point to from going away. Take fi_lock and a reference and check for NULL, as we do in other code. Reported-by: NeilBrown Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens") Reviewed-by: NeilBrown Signed-off-by: J. Bruce Fields commit 7c8c70ba5c15adcd9785aa7b17431a9d3fe7f717 Merge: 21a59e0bf5e0 4a601da92c2a Author: Arnd Bergmann Date: Wed Jul 22 21:41:36 2020 +0200 Merge tag 'imx-fixes-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.8, round 3: - A couple of FEC2 phy-mode fixes on imx6sx-sabreauto and imx6sx-sdb board. - One fix on imx6qdl-icore pin muxing to get USB OTG_ID and SD card detect work correctly. * tag 'imx-fixes-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2 ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2 Link: https://lore.kernel.org/r/20200720040148.GA20462@dragon Signed-off-by: Arnd Bergmann commit 21a59e0bf5e00d69303a0ab61729c514ef067c3b Merge: 2648298a06ba 62a8ccf3a248 Author: Arnd Bergmann Date: Wed Jul 22 21:40:40 2020 +0200 Merge tag 'sunxi-fixes-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes Two fixes for the Allwinner SoCs, one to relax the CMA allocation ranges that were failing on older SoCs and one to fix Cedrus on the H6. * tag 'sunxi-fixes-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage ARM: dts sunxi: Relax a bit the CMA pool allocation range Link: https://lore.kernel.org/r/e24f0608-6a4f-4163-b99e-a5f48e796184.lettre@localhost Signed-off-by: Arnd Bergmann commit d15be546031cf65a0fc34879beca02fd90fe7ac7 Merge: 071fb1bcd727 0d6db85131e0 Author: Linus Torvalds Date: Wed Jul 22 11:56:00 2020 -0700 Merge tag 'media/v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media into master Pull media fixes from Mauro Carvalho Chehab: "A series of fixes for the upcoming atomisp driver. They solve issues when probing atomisp on devices with multiple cameras and get rid of warnings when built with W=1. The diffstat is a bit long, as this driver has several abstractions. The patches that solved the issues with W=1 had to get rid of some duplicated code (there used to have 2 versions of the same code, one for ISP2401 and another one for ISP2400). As this driver is not in 5.7, such changes won't cause regressions" * tag 'media/v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (38 commits) Revert "media: atomisp: keep the ISP powered on when setting it" media: atomisp: fix mask and shift operation on ISPSSPM0 media: atomisp: move system_local consts into a C file media: atomisp: get rid of version-specific system_local.h media: atomisp: move global stuff into a common header media: atomisp: remove non-used 32-bits consts at system_local media: atomisp: get rid of some unused static vars media: atomisp: Fix error code in ov5693_probe() media: atomisp: Replace trace_printk by pr_info media: atomisp: Fix __func__ style warnings media: atomisp: fix help message for ISP2401 selection media: atomisp: i2c: atomisp-ov2680.c: fixed a brace coding style issue. media: atomisp: make const arrays static, makes object smaller media: atomisp: Clean up non-existing folders from Makefile media: atomisp: Get rid of ACPI specifics in gmin_subdev_add() media: atomisp: Provide Gmin subdev as parameter to gmin_subdev_add() media: atomisp: Use temporary variable for device in gmin_subdev_add() media: atomisp: Refactor PMIC detection to a separate function media: atomisp: Deduplicate return ret in gmin_i2c_write() media: atomisp: Make pointer to PMIC client global ... commit 071fb1bcd727e306f3e5911e53e7222fc4efab35 Merge: 8c26c87b0532 db415f7aae07 Author: Linus Torvalds Date: Wed Jul 22 11:30:07 2020 -0700 Merge tag 'exfat-for-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat into master Pull exfat fixes from Namjae Jeon: - fix overflow issue at sector calculation - fix wrong hint_stat initialization - fix wrong size update of stream entry - fix endianness of upname in name_hash computation * tag 'exfat-for-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: fix name_hash computation on big endian systems exfat: fix wrong size update of stream entry by typo exfat: fix wrong hint_stat initialization in exfat_find_dir_entry() exfat: fix overflow issue in exfat_cluster_to_sector() commit faaff9765664009c1c7c65551d32e9ed3b1dda8f Author: Rustam Kovhaev Date: Wed Jul 22 09:10:52 2020 -0700 staging: wlan-ng: properly check endpoint types As syzkaller detected, wlan-ng driver does not do sanity check of endpoints in prism2sta_probe_usb(), add check for xfer direction and type Reported-and-tested-by: syzbot+c2a1fa67c02faa0de723@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=c2a1fa67c02faa0de723 Signed-off-by: Rustam Kovhaev Cc: stable Link: https://lore.kernel.org/r/20200722161052.999754-1-rkovhaev@gmail.com Signed-off-by: Greg Kroah-Hartman commit d08c30d7a0d1826f771f16cde32bd86e48401791 Author: Bjorn Helgaas Date: Fri Jul 17 17:21:28 2020 -0500 Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms" This reverts commit ec411e02b7a2e785a4ed9ed283207cd14f48699d. Patrick reported that this commit broke hybrid graphics on a ThinkPad X1 Extreme 2nd with Intel UHD Graphics 630 and NVIDIA GeForce GTX 1650 Mobile: nouveau 0000:01:00.0: fifo: PBDMA0: 01000000 [] ch 0 [00ff992000 DRM] subc 0 mthd 0008 data 00000000 Karol reported that this commit broke Nouveau firmware loading on a Lenovo P1G2 with Intel UHD Graphics 630 and NVIDIA TU117GLM [Quadro T1000 Mobile]: nouveau 0000:01:00.0: acr: AHESASC binary failed In both cases, reverting ec411e02b7a2 solved the problem. Unfortunately, this revert will reintroduce the "Thunderbolt bridges take long time to resume from D3cold" problem: https://bugzilla.kernel.org/show_bug.cgi?id=206837 Link: https://lore.kernel.org/r/CAErSpo5sTeK_my1dEhWp7aHD0xOp87+oHYWkTjbL7ALgDbXo-Q@mail.gmail.com Link: https://lore.kernel.org/r/CACO55tsAEa5GXw5oeJPG=mcn+qxNvspXreJYWDJGZBy5v82JDA@mail.gmail.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=208597 Reported-by: Patrick Volkerding Reported-by: Karol Herbst Fixes: ec411e02b7a2 ("PCI/PM: Assume ports without DLL Link Active train links in 100 ms") Signed-off-by: Bjorn Helgaas commit 62ca18a0896f5590806e6aee7bce39f130a2d9d5 Author: Bjorn Helgaas Date: Wed Jul 1 15:53:15 2020 -0500 virtio-mmio: Reject invalid IRQ 0 command line argument The "virtio_mmio.device=" command line argument allows a user to specify the size, address, and IRQ of a virtio device. Previously the only requirement for the IRQ was that it be an unsigned integer. Zero is an unsigned integer but an invalid IRQ number, and after a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid"), attempts to use IRQ 0 cause warnings. If the user specifies IRQ 0, return failure instead of registering a device with IRQ 0. Fixes: a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid") Signed-off-by: Bjorn Helgaas Acked-by: Jason Wang Acked-by: Michael S. Tsirkin commit 1014a2f8d76b05e0f228dd097ac1a249c5934232 Author: Rob Clark Date: Mon Jul 20 08:52:17 2020 -0700 iommu/qcom: Use domain rather than dev as tlb cookie The device may be torn down, but the domain should still be valid. Lets use that as the tlb flush ops cookie. Fixes a problem reported in [1] [1] https://lkml.org/lkml/2020/7/20/104 Reported-by: Naresh Kamboju Signed-off-by: Rob Clark Tested-by: Naresh Kamboju Fixes: 09b5dfff9ad6 ("iommu/qcom: Use accessor functions for iommu private data") Link: https://lore.kernel.org/r/20200720155217.274994-1-robdclark@gmail.com Signed-off-by: Joerg Roedel commit 0cfa112b33aba4473b00151c75b87818a835702a Author: Gerald Schaefer Date: Tue Jul 21 15:04:30 2020 +0200 MAINTAINERS: add Matthew for s390 IOMMU Acked-By: Matthew Rosato Signed-off-by: Gerald Schaefer Signed-off-by: Heiko Carstens commit 37bd22420f856fcd976989f1d4f1f7ad28e1fcac Author: Mark Salyzyn Date: Wed Jul 22 04:00:53 2020 -0700 af_key: pfkey_dump needs parameter validation In pfkey_dump() dplen and splen can both be specified to access the xfrm_address_t structure out of bounds in__xfrm_state_filter_match() when it calls addr_match() with the indexes. Return EINVAL if either are out of range. Signed-off-by: Mark Salyzyn Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com Cc: Steffen Klassert Cc: Herbert Xu Cc: "David S. Miller" Cc: Jakub Kicinski Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Steffen Klassert commit 436d17675be1c090f08d4eddf1d7193cacf0e9be Author: Ludovic Desroches Date: Thu Jul 9 10:42:33 2020 +0200 MAINTAINERS: i2c: at91: handover maintenance to Codrin Ciubotariu My colleague Codrin Ciubotariu, now, maintains this driver internally. Then I handover the mainline maintenance to him. Signed-off-by: Ludovic Desroches Signed-off-by: Wolfram Sang commit aca7ed091117d9b4ce499855c383119afb2819a2 Author: Randy Dunlap Date: Fri Jul 17 16:38:15 2020 -0700 i2c: drop duplicated word in the header file Drop the doubled word "be" in a comment. Signed-off-by: Randy Dunlap Signed-off-by: Wolfram Sang commit 12d4d9ec5eeecd712c73772e422b6d082e66b046 Author: Raviteja Narayanam Date: Fri Jul 3 19:26:12 2020 +0530 i2c: cadence: Clear HOLD bit at correct time in Rx path There are few issues on Zynq SOC observed in the stress tests causing timeout errors. Even though all the data is received, timeout error is thrown. This is due to an IP bug in which the COMP bit in ISR is not set at end of transfer and completion interrupt is not generated. This bug is seen on Zynq platforms when the following condition occurs: Master read & HOLD bit set & Transfer size register reaches '0'. One workaround is to clear the HOLD bit before the transfer size register reaches '0'. The current implementation checks for this at the start of the loop and also only for less than FIFO DEPTH case (ignoring the equal to case). So clear the HOLD bit when the data yet to receive is less than or equal to the FIFO DEPTH. This avoids the IP bug condition. Signed-off-by: Raviteja Narayanam Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 0db9254d6b896b587759e2c844c277fb1a6da5b9 Author: Raviteja Narayanam Date: Fri Jul 3 19:25:49 2020 +0530 Revert "i2c: cadence: Fix the hold bit setting" This reverts commit d358def706880defa4c9e87381c5bf086a97d5f9. There are two issues with "i2c: cadence: Fix the hold bit setting" commit. 1. In case of combined message request from user space, when the HOLD bit is cleared in cdns_i2c_mrecv function, a STOP condition is sent on the bus even before the last message is started. This is because when the HOLD bit is cleared, the FIFOS are empty and there is no pending transfer. The STOP condition should occur only after the last message is completed. 2. The code added by the commit is redundant. Driver is handling the setting/clearing of HOLD bit in right way before the commit. The setting of HOLD bit based on 'bus_hold_flag' is taken care in cdns_i2c_master_xfer function even before cdns_i2c_msend/cdns_i2c_recv functions. The clearing of HOLD bit is taken care at the end of cdns_i2c_msend and cdns_i2c_recv functions based on bus_hold_flag and byte count. Since clearing of HOLD bit is done after the slave address is written to the register (writing to address register triggers the message transfer), it is ensured that STOP condition occurs at the right time after completion of the pending transfer (last message). Signed-off-by: Raviteja Narayanam Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 3da87ec67a491b9633a82045896c076b794bf938 Author: Laurence Tratt Date: Sun Jun 21 08:50:05 2020 +0100 ALSA: usb-audio: Add implicit feedback quirk for SSL2 As expected, this requires the same quirk as the SSL2+ in order for the clock to sync. This was suggested by, and tested on an SSL2, by Dmitry. Suggested-by: Dmitry Signed-off-by: Laurence Tratt Cc: Link: https://lore.kernel.org/r/20200621075005.52mjjfc6dtdjnr3h@overdrive.tratt.net Signed-off-by: Takashi Iwai commit d136122f58458479fd8926020ba2937de61d7f65 Author: Peter Zijlstra Date: Mon Jul 20 17:20:21 2020 +0200 sched: Fix race against ptrace_freeze_trace() There is apparently one site that violates the rule that only current and ttwu() will modify task->state, namely ptrace_{,un}freeze_traced() will change task->state for a remote task. Oleg explains: "TASK_TRACED/TASK_STOPPED was always protected by siglock. In particular, ttwu(__TASK_TRACED) must be always called with siglock held. That is why ptrace_freeze_traced() assumes it can safely do s/TASK_TRACED/__TASK_TRACED/ under spin_lock(siglock)." This breaks the ordering scheme introduced by commit: dbfb089d360b ("sched: Fix loadavg accounting race") Specifically, the reload not matching no longer implies we don't have to block. Simply things by noting that what we need is a LOAD->STORE ordering and this can be provided by a control dependency. So replace: prev_state = prev->state; raw_spin_lock(&rq->lock); smp_mb__after_spinlock(); /* SMP-MB */ if (... && prev_state && prev_state == prev->state) deactivate_task(); with: prev_state = prev->state; if (... && prev_state) /* CTRL-DEP */ deactivate_task(); Since that already implies the 'prev->state' load must be complete before allowing the 'prev->on_rq = 0' store to become visible. Fixes: dbfb089d360b ("sched: Fix loadavg accounting race") Reported-by: Jiri Slaby Signed-off-by: Peter Zijlstra (Intel) Acked-by: Oleg Nesterov Tested-by: Paul Gortmaker Tested-by: Christian Brauner commit de2b41be8fcccb2f5b6c480d35df590476344201 Author: Joerg Roedel Date: Tue Jul 21 11:34:48 2020 +0200 x86, vmlinux.lds: Page-align end of ..page_aligned sections On x86-32 the idt_table with 256 entries needs only 2048 bytes. It is page-aligned, but the end of the .bss..page_aligned section is not guaranteed to be page-aligned. As a result, objects from other .bss sections may end up on the same 4k page as the idt_table, and will accidentially get mapped read-only during boot, causing unexpected page-faults when the kernel writes to them. This could be worked around by making the objects in the page aligned sections page sized, but that's wrong. Explicit sections which store only page aligned objects have an implicit guarantee that the object is alone in the page in which it is placed. That works for all objects except the last one. That's inconsistent. Enforcing page sized objects for these sections would wreckage memory sanitizers, because the object becomes artificially larger than it should be and out of bound access becomes legit. Align the end of the .bss..page_aligned and .data..page_aligned section on page-size so all objects places in these sections are guaranteed to have their own page. [ tglx: Amended changelog ] Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Reviewed-by: Kees Cook Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200721093448.10417-1-joro@8bytes.org commit 2c4dc31486034fa8929a571e7a59677e92b5d6c5 Author: Murali Karicheri Date: Fri Jul 17 15:19:32 2020 +0300 net: ethernet: ti: add NETIF_F_HW_TC hw feature flag for taprio offload Currently drive supports taprio offload which is a tc feature offloaded to cpsw hardware. So driver has to set the hw feature flag, NETIF_F_HW_TC in the net device to be compliant. This patch adds the flag. Fixes: 8127224c2708 ("ethernet: ti: am65-cpsw-qos: add TAPRIO offload support") Signed-off-by: Murali Karicheri Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 1264d7fa3a64d8bea7aebb77253f917947ffda25 Author: Wang Hai Date: Fri Jul 17 10:50:49 2020 +0800 net: ethernet: ave: Fix error returns in ave_init When regmap_update_bits failed in ave_init(), calls of the functions reset_control_assert() and clk_disable_unprepare() were missed. Add goto out_reset_assert to do this. Fixes: 57878f2f4697 ("net: ethernet: ave: add support for phy-mode setting of system controller") Reported-by: Hulk Robot Signed-off-by: Wang Hai Reviewed-by: Kunihiko Hayashi Signed-off-by: David S. Miller commit 8fdcabeac39824fe67480fd9508d80161c541854 Author: Xie He Date: Thu Jul 16 16:44:33 2020 -0700 drivers/net/wan/x25_asy: Fix to make it work This driver is not working because of problems of its receiving code. This patch fixes it to make it work. When the driver receives an LAPB frame, it should first pass the frame to the LAPB module to process. After processing, the LAPB module passes the data (the packet) back to the driver, the driver should then add a one-byte pseudo header and pass the data to upper layers. The changes to the "x25_asy_bump" function and the "x25_asy_data_indication" function are to correctly implement this procedure. Also, the "x25_asy_unesc" function ignores any frame that is shorter than 3 bytes. However the shortest frames are 2-byte long. So we need to change it to allow 2-byte frames to pass. Cc: Eric Dumazet Cc: Martin Schiller Signed-off-by: Xie He Reviewed-by: Martin Schiller Signed-off-by: David S. Miller commit 8210e344ccb798c672ab237b1a4f241bda08909b Author: guodeqing Date: Thu Jul 16 16:12:08 2020 +0800 ipvs: fix the connection sync failed in some cases The sync_thread_backup only checks sk_receive_queue is empty or not, there is a situation which cannot sync the connection entries when sk_receive_queue is empty and sk_rmem_alloc is larger than sk_rcvbuf, the sync packets are dropped in __udp_enqueue_schedule_skb, this is because the packets in reader_queue is not read, so the rmem is not reclaimed. Here I add the check of whether the reader_queue of the udp sock is empty or not to solve this problem. Fixes: 2276f58ac589 ("udp: use a separate rx queue for packet reception") Reported-by: zhouxudong Signed-off-by: guodeqing Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit b346c0c85892cb8c53e8715734f71ba5bbec3387 Author: Paolo Pisati Date: Tue Jul 21 18:17:10 2020 +0200 selftest: txtimestamp: fix net ns entry logic According to 'man 8 ip-netns', if `ip netns identify` returns an empty string, there's no net namespace associated with current PID: fix the net ns entrance logic. Signed-off-by: Paolo Pisati Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 5fff09bc141570cd15c118b097b17dec832b517f Author: Max Filippov Date: Tue Jul 21 15:00:35 2020 -0700 xtensa: fix access check in csum_and_copy_from_user Commit d341659f470b ("xtensa: switch to providing csum_and_copy_from_user()") introduced access check, but incorrectly tested dst instead of src. Fix access_ok argument in csum_and_copy_from_user. Cc: Al Viro Fixes: d341659f470b ("xtensa: switch to providing csum_and_copy_from_user()") Signed-off-by: Max Filippov Signed-off-by: Al Viro commit 785ed9c32aa1e709e62a475e44139bd875b00c9d Merge: 2c9d8e01f0c6 eb61c2d69903 Author: David S. Miller Date: Tue Jul 21 16:07:34 2020 -0700 Merge branch 'qed-suppress-irrelevant-error-messages-on-HW-init' Alexander Lobakin says: ==================== qed: suppress irrelevant error messages on HW init This raises the verbosity level of several error/warning messages on driver/module initialization, most of which are false-positives, and the one actively spamming the log for no reason. ==================== Signed-off-by: David S. Miller commit eb61c2d69903e977ffa2b80b1da9d1f758cf228d Author: Alexander Lobakin Date: Tue Jul 21 17:41:43 2020 +0300 qed: suppress false-positives interrupt error messages on HW init It was found that qed_pglueb_rbc_attn_handler() can produce a lot of false-positive error detections on driver load/reload (especially after crashes/recoveries) and spam the kernel log: [ 4.958275] [qed_pglueb_rbc_attn_handler:324()]ICPL error - 00d00ff0 [ 2079.146764] [qed_pglueb_rbc_attn_handler:324()]ICPL error - 00d80ff0 [ 2116.374631] [qed_pglueb_rbc_attn_handler:324()]ICPL error - 00d80ff0 [ 2135.250564] [qed_pglueb_rbc_attn_handler:324()]ICPL error - 00d80ff0 [...] Reduce the logging level of two false-positive prone error messages from notice to verbose on initialization (only) to not mix it with real error attentions while debugging. Fixes: 666db4862f2d ("qed: Revise load sequence to avoid PCI errors") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 1ea999039fe7c7953da2fbb7ca7c3ef00064d328 Author: Alexander Lobakin Date: Tue Jul 21 17:41:42 2020 +0300 qed: suppress "don't support RoCE & iWARP" flooding on HW init Change the verbosity of the "don't support RoCE & iWARP simultaneously" warning to debug level to stop flooding on driver/hardware initialization: [ 4.783230] qede 01:00.00: Storm FW 8.37.7.0, Management FW 8.52.9.0 [MBI 15.10.6] [eth0] [ 4.810020] [qed_rdma_set_pf_params:2076()]Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only [ 4.861186] qede 01:00.01: Storm FW 8.37.7.0, Management FW 8.52.9.0 [MBI 15.10.6] [eth1] [ 4.893311] [qed_rdma_set_pf_params:2076()]Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only [ 5.181713] qede a1:00.00: Storm FW 8.37.7.0, Management FW 8.52.9.0 [MBI 15.10.6] [eth2] [ 5.224740] [qed_rdma_set_pf_params:2076()]Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only [ 5.276449] qede a1:00.01: Storm FW 8.37.7.0, Management FW 8.52.9.0 [MBI 15.10.6] [eth3] [ 5.318671] [qed_rdma_set_pf_params:2076()]Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only [ 5.369548] qede a1:00.02: Storm FW 8.37.7.0, Management FW 8.52.9.0 [MBI 15.10.6] [eth4] [ 5.411645] [qed_rdma_set_pf_params:2076()]Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only Fixes: e0a8f9de16fc ("qed: Add iWARP enablement support") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 2c9d8e01f0c6017317eee7638496173d4a64e6bc Author: Taehee Yoo Date: Tue Jul 21 14:51:50 2020 +0000 netdevsim: fix unbalaced locking in nsim_create() In the nsim_create(), rtnl_lock() is called before nsim_bpf_init(). If nsim_bpf_init() is failed, rtnl_unlock() should be called, but it isn't called. So, unbalanced locking would occur. Fixes: e05b2d141fef ("netdevsim: move netdev creation/destruction to dev probe") Signed-off-by: Taehee Yoo Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 3506b2f42dff66ea6814c3dfa1988bafb79e6f88 Author: Helmut Grohne Date: Tue Jul 21 13:07:39 2020 +0200 net: dsa: microchip: call phy_remove_link_mode during probe When doing "ip link set dev ... up" for a ksz9477 backed link, ksz9477_phy_setup is called and it calls phy_remove_link_mode to remove 1000baseT HDX. During phy_remove_link_mode, phy_advertise_supported is called. Doing so reverts any previous change to advertised link modes e.g. using a udevd .link file. phy_remove_link_mode is not meant to be used while opening a link and should be called during phy probe when the link is not yet available to userspace. Therefore move the phy_remove_link_mode calls into ksz9477_switch_register. It indirectly calls dsa_register_switch, which creates the relevant struct phy_devices and we update the link modes right after that. At that time dev->features is already initialized by ksz9477_switch_detect. Remove phy_setup from ksz_dev_ops as no users remain. Link: https://lore.kernel.org/netdev/20200715192722.GD1256692@lunn.ch/ Fixes: 42fc6a4c613019 ("net: dsa: microchip: prepare PHY for proper advertisement") Signed-off-by: Helmut Grohne Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2dc3bd74d7214914fa911a9772fb5ed1164707bf Merge: b0a422772fec fac24df7b9a6 Author: David S. Miller Date: Tue Jul 21 15:49:17 2020 -0700 Merge branch 'hns3-fixes' Huazhong Tan says: ==================== net: hns3: fixes for -net There are some bugfixes for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit fac24df7b9a6d9363abdff0e351ade041dd16daa Author: Jian Shen Date: Tue Jul 21 19:03:54 2020 +0800 net: hns3: fix return value error when query MAC link status fail Currently, PF queries the MAC link status per second by calling function hclge_get_mac_link_status(). It return the error code when failed to send cmdq command to firmware. It's incorrect, because this return value is used as the MAC link status, which 0 means link down, and none-zero means link up. So fixes it. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Huazhong tan Signed-off-by: David S. Miller commit 8ceca59fb3ed48a693171bd571c4fcbd555b7f1f Author: Yunsheng Lin Date: Tue Jul 21 19:03:53 2020 +0800 net: hns3: fix error handling for desc filling The content of the TX desc is automatically cleared by the HW when the HW has sent out the packet to the wire. When desc filling fails in hns3_nic_net_xmit(), it will call hns3_clear_desc() to do the error handling, which miss zeroing of the TX desc and the checking if a unmapping is needed. So add the zeroing and checking in hns3_clear_desc() to avoid the above problem. Also add DESC_TYPE_UNKNOWN to indicate the info in desc_cb is not valid, because hns3_nic_reclaim_desc() may treat the desc_cb->type of zero as packet and add to the sent pkt statistics accordingly. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 48ae74c9d89f827b39b5c07a1f02fc13637a3cd6 Author: Yunsheng Lin Date: Tue Jul 21 19:03:52 2020 +0800 net: hns3: fix for not calculating TX BD send size correctly With GRO and fraglist support, the SKB can be aggregated to a total size of 65535, and when that SKB is forwarded through a bridge, the size of the SKB may be pushed to exceed the size of 65535 when br_dev_queue_push_xmit() is called. The max send size of BD supported by the HW is 65535, when a SKB with a headlen of over 65535 is sent to the driver, the driver needs to use multi BD to send the linear data, and the send size of the last BD is calculated incorrectly by the driver who is using '&' operation, which causes a TX error. Use '%' operation to fix this problem. Fixes: 3fe13ed95dd3 ("net: hns3: avoid mult + div op in critical data path") Signed-off-by: Yunsheng Lin Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 0ec3b6a7c026e8f404f76d6dda5dae8d262312a0 Author: Yunsheng Lin Date: Tue Jul 21 19:03:51 2020 +0800 net: hns3: fix for not unmapping TX buffer correctly When a big TX buffer is sent using multi BD, the driver maps the whole TX buffer, and unmaps it using info in desc_cb corresponding to each BD, but only the info in the desc_cb of first BD is correct, other info in desc_cb is wrong, which causes TX unmapping problem when SMMU is on. Only set the mapping and freeing info in the desc_cb of first BD to fix this problem, because the TX buffer only need to be unmapped and freed once. Fixes: 1e8a7977d09f("net: hns3: add handling for big TX fragment") Signed-off-by: Yunsheng Lin Signed-off-by: Huzhong Tan Signed-off-by: David S. Miller commit b0a422772fec29811e293c7c0e6f991c0fd9241d Author: Miaohe Lin Date: Tue Jul 21 17:11:44 2020 +0800 net: udp: Fix wrong clean up for IS_UDPLITE macro We can't use IS_UDPLITE to replace udp_sk->pcflag when UDPLITE_RECV_CC is checked. Fixes: b2bf1e2659b1 ("[UDP]: Clean up for IS_UDPLITE macro") Signed-off-by: Miaohe Lin Signed-off-by: David S. Miller commit 9bb5fbea59f36a589ef886292549ca4052fe676c Author: Xiongfeng Wang Date: Tue Jul 21 15:02:57 2020 +0800 net-sysfs: add a newline when printing 'tx_timeout' by sysfs When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to add a newline for easy reading. root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout 0root@syzkaller:~# Signed-off-by: Xiongfeng Wang Signed-off-by: David S. Miller commit 015c5d5e6aa3523c758a70eb87b291cece2dbbb4 Author: Yoshihiro Shimoda Date: Tue Jul 21 15:23:12 2020 +0900 net: ethernet: ravb: exit if re-initialization fails in tx timeout According to the report of [1], this driver is possible to cause the following error in ravb_tx_timeout_work(). ravb e6800000.ethernet ethernet: failed to switch device to config mode This error means that the hardware could not change the state from "Operation" to "Configuration" while some tx and/or rx queue are operating. After that, ravb_config() in ravb_dmac_init() will fail, and then any descriptors will be not allocaled anymore so that NULL pointer dereference happens after that on ravb_start_xmit(). To fix the issue, the ravb_tx_timeout_work() should check the return values of ravb_stop_dma() and ravb_dmac_init(). If ravb_stop_dma() fails, ravb_tx_timeout_work() re-enables TX and RX and just exits. If ravb_dmac_init() fails, just exits. [1] https://lore.kernel.org/linux-renesas-soc/20200518045452.2390-1-dirk.behme@de.bosch.com/ Reported-by: Dirk Behme Signed-off-by: Yoshihiro Shimoda Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit ca673235523019ac58dda5287d9c819e19702860 Merge: 6ef9dcb78046 efc6b6f6c311 Author: David S. Miller Date: Tue Jul 21 15:31:03 2020 -0700 Merge branch 'udp-Fix-reuseport-selection-with-connected-sockets' Kuniyuki Iwashima says: ==================== udp: Fix reuseport selection with connected sockets. This patch set addresses two issues which happen when both connected and unconnected sockets are in the same UDP reuseport group. ==================== Signed-off-by: David S. Miller commit efc6b6f6c3113e8b203b9debfb72d81e0f3dcace Author: Kuniyuki Iwashima Date: Tue Jul 21 15:15:31 2020 +0900 udp: Improve load balancing for SO_REUSEPORT. Currently, SO_REUSEPORT does not work well if connected sockets are in a UDP reuseport group. Then reuseport_has_conns() returns true and the result of reuseport_select_sock() is discarded. Also, unconnected sockets have the same score, hence only does the first unconnected socket in udp_hslot always receive all packets sent to unconnected sockets. So, the result of reuseport_select_sock() should be used for load balancing. The noteworthy point is that the unconnected sockets placed after connected sockets in sock_reuseport.socks will receive more packets than others because of the algorithm in reuseport_select_sock(). index | connected | reciprocal_scale | result --------------------------------------------- 0 | no | 20% | 40% 1 | no | 20% | 20% 2 | yes | 20% | 0% 3 | no | 20% | 40% 4 | yes | 20% | 0% If most of the sockets are connected, this can be a problem, but it still works better than now. Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets") CC: Willem de Bruijn Reviewed-by: Benjamin Herrenschmidt Signed-off-by: Kuniyuki Iwashima Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit f2b2c55e512879a05456eaf5de4d1ed2f7757509 Author: Kuniyuki Iwashima Date: Tue Jul 21 15:15:30 2020 +0900 udp: Copy has_conns in reuseport_grow(). If an unconnected socket in a UDP reuseport group connect()s, has_conns is set to 1. Then, when a packet is received, udp[46]_lib_lookup2() scans all sockets in udp_hslot looking for the connected socket with the highest score. However, when the number of sockets bound to the port exceeds max_socks, reuseport_grow() resets has_conns to 0. It can cause udp[46]_lib_lookup2() to return without scanning all sockets, resulting in that packets sent to connected sockets may be distributed to unconnected sockets. Therefore, reuseport_grow() should copy has_conns. Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets") CC: Willem de Bruijn Reviewed-by: Benjamin Herrenschmidt Signed-off-by: Kuniyuki Iwashima Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 48cfa61b58a1fee0bc49eef04f8ccf31493b7cdd Author: Boris Burkov Date: Thu Jul 16 13:29:46 2020 -0700 btrfs: fix mount failure caused by race with umount It is possible to cause a btrfs mount to fail by racing it with a slow umount. The crux of the sequence is generic_shutdown_super not yet calling sop->put_super before btrfs_mount_root calls btrfs_open_devices. If that occurs, btrfs_open_devices will decide the opened counter is non-zero, increment it, and skip resetting fs_devices->total_rw_bytes to 0. From here, mount will call sget which will result in grab_super trying to take the super block umount semaphore. That semaphore will be held by the slow umount, so mount will block. Before up-ing the semaphore, umount will delete the super block, resulting in mount's sget reliably allocating a new one, which causes the mount path to dutifully fill it out, and increment total_rw_bytes a second time, which causes the mount to fail, as we see double the expected bytes. Here is the sequence laid out in greater detail: CPU0 CPU1 down_write sb->s_umount btrfs_kill_super kill_anon_super(sb) generic_shutdown_super(sb); shrink_dcache_for_umount(sb); sync_filesystem(sb); evict_inodes(sb); // SLOW btrfs_mount_root btrfs_scan_one_device fs_devices = device->fs_devices fs_info->fs_devices = fs_devices // fs_devices-opened makes this a no-op btrfs_open_devices(fs_devices, mode, fs_type) s = sget(fs_type, test, set, flags, fs_info); find sb in s_instances grab_super(sb); down_write(&s->s_umount); // blocks sop->put_super(sb) // sb->fs_devices->opened == 2; no-op spin_lock(&sb_lock); hlist_del_init(&sb->s_instances); spin_unlock(&sb_lock); up_write(&sb->s_umount); return 0; retry lookup don't find sb in s_instances (deleted by CPU0) s = alloc_super return s; btrfs_fill_super(s, fs_devices, data) open_ctree // fs_devices total_rw_bytes improperly set! btrfs_read_chunk_tree read_one_dev // increment total_rw_bytes again!! super_total_bytes < fs_devices->total_rw_bytes // ERROR!!! To fix this, we clear total_rw_bytes from within btrfs_read_chunk_tree before the calls to read_one_dev, while holding the sb umount semaphore and the uuid mutex. To reproduce, it is sufficient to dirty a decent number of inodes, then quickly umount and mount. for i in $(seq 0 500) do dd if=/dev/zero of="/mnt/foo/$i" bs=1M count=1 done umount /mnt/foo& mount /mnt/foo does the trick for me. CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5909ca110b29aa16b23b52b8de8d3bb1035fd738 Author: Robbie Ko Date: Mon Jul 20 09:42:09 2020 +0800 btrfs: fix page leaks after failure to lock page for delalloc When locking pages for delalloc, we check if it's dirty and mapping still matches. If it does not match, we need to return -EAGAIN and release all pages. Only the current page was put though, iterate over all the remaining pages too. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Filipe Manana Reviewed-by: Nikolay Borisov Signed-off-by: Robbie Ko Reviewed-by: David Sterba Signed-off-by: David Sterba commit fa91e4aa1716004ea8096d5185ec0451e206aea0 Author: Qu Wenruo Date: Fri Jul 17 15:12:05 2020 +0800 btrfs: qgroup: fix data leak caused by race between writeback and truncate [BUG] When running tests like generic/013 on test device with btrfs quota enabled, it can normally lead to data leak, detected at unmount time: BTRFS warning (device dm-3): qgroup 0/5 has unreleased space, type 0 rsv 4096 ------------[ cut here ]------------ WARNING: CPU: 11 PID: 16386 at fs/btrfs/disk-io.c:4142 close_ctree+0x1dc/0x323 [btrfs] RIP: 0010:close_ctree+0x1dc/0x323 [btrfs] Call Trace: btrfs_put_super+0x15/0x17 [btrfs] generic_shutdown_super+0x72/0x110 kill_anon_super+0x18/0x30 btrfs_kill_super+0x17/0x30 [btrfs] deactivate_locked_super+0x3b/0xa0 deactivate_super+0x40/0x50 cleanup_mnt+0x135/0x190 __cleanup_mnt+0x12/0x20 task_work_run+0x64/0xb0 __prepare_exit_to_usermode+0x1bc/0x1c0 __syscall_return_slowpath+0x47/0x230 do_syscall_64+0x64/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ---[ end trace caf08beafeca2392 ]--- BTRFS error (device dm-3): qgroup reserved space leaked [CAUSE] In the offending case, the offending operations are: 2/6: writev f2X[269 1 0 0 0 0] [1006997,67,288] 0 2/7: truncate f2X[269 1 0 0 48 1026293] 18388 0 The following sequence of events could happen after the writev(): CPU1 (writeback) | CPU2 (truncate) ----------------------------------------------------------------- btrfs_writepages() | |- extent_write_cache_pages() | |- Got page for 1003520 | | 1003520 is Dirty, no writeback | | So (!clear_page_dirty_for_io()) | | gets called for it | |- Now page 1003520 is Clean. | | | btrfs_setattr() | | |- btrfs_setsize() | | |- truncate_setsize() | | New i_size is 18388 |- __extent_writepage() | | |- page_offset() > i_size | |- btrfs_invalidatepage() | |- Page is clean, so no qgroup | callback executed This means, the qgroup reserved data space is not properly released in btrfs_invalidatepage() as the page is Clean. [FIX] Instead of checking the dirty bit of a page, call btrfs_qgroup_free_data() unconditionally in btrfs_invalidatepage(). As qgroup rsv are completely bound to the QGROUP_RESERVED bit of io_tree, not bound to page status, thus we won't cause double freeing anyway. Fixes: 0b34c261e235 ("btrfs: qgroup: Prevent qgroup->reserved from going subzero") CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 38e0c89a19fd13f28d2b4721035160a3e66e270b Author: Paweł Gronowski Date: Sun Jul 19 17:54:53 2020 +0200 drm/amdgpu: Fix NULL dereference in dpm sysfs handlers NULL dereference occurs when string that is not ended with space or newline is written to some dpm sysfs interface (for example pp_dpm_sclk). This happens because strsep replaces the tmp with NULL if the delimiter is not present in string, which is then dereferenced by tmp[0]. Reproduction example: sudo sh -c 'echo -n 1 > /sys/class/drm/card0/device/pp_dpm_sclk' Signed-off-by: Paweł Gronowski Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 88bb16ad998a0395fe4b346b7d3f621aaa0a2324 Author: Qiu Wenbo Date: Fri Jul 17 15:09:57 2020 +0800 drm/amd/powerplay: fix a crash when overclocking Vega M Avoid kernel crash when vddci_control is SMU7_VOLTAGE_CONTROL_NONE and vddci_voltage_table is empty. It has been tested on Intel Hades Canyon (i7-8809G). Bug: https://bugzilla.kernel.org/show_bug.cgi?id=208489 Fixes: ac7822b0026f ("drm/amd/powerplay: add smumgr support for VEGAM (v2)") Reviewed-by: Evan Quan Signed-off-by: Qiu Wenbo Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 580c079b5766ac706f56eec5c79aee4bf929fef6 Author: Filipe Manana Date: Mon Jul 13 15:11:56 2020 +0100 btrfs: fix double free on ulist after backref resolution failure At btrfs_find_all_roots_safe() we allocate a ulist and set the **roots argument to point to it. However if later we fail due to an error returned by find_parent_nodes(), we free that ulist but leave a dangling pointer in the **roots argument. Upon receiving the error, a caller of this function can attempt to free the same ulist again, resulting in an invalid memory access. One such scenario is during qgroup accounting: btrfs_qgroup_account_extents() --> calls btrfs_find_all_roots() passes &new_roots (a stack allocated pointer) to btrfs_find_all_roots() --> btrfs_find_all_roots() just calls btrfs_find_all_roots_safe() passing &new_roots to it --> allocates ulist and assigns its address to **roots (which points to new_roots from btrfs_qgroup_account_extents()) --> find_parent_nodes() returns an error, so we free the ulist and leave **roots pointing to it after returning --> btrfs_qgroup_account_extents() sees btrfs_find_all_roots() returned an error and jumps to the label 'cleanup', which just tries to free again the same ulist Stack trace example: ------------[ cut here ]------------ BTRFS: tree first key check failed WARNING: CPU: 1 PID: 1763215 at fs/btrfs/disk-io.c:422 btrfs_verify_level_key+0xe0/0x180 [btrfs] Modules linked in: dm_snapshot dm_thin_pool (...) CPU: 1 PID: 1763215 Comm: fsstress Tainted: G W 5.8.0-rc3-btrfs-next-64 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:btrfs_verify_level_key+0xe0/0x180 [btrfs] Code: 28 5b 5d (...) RSP: 0018:ffffb89b473779a0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff90397759bf08 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000027 RDI: 00000000ffffffff RBP: ffff9039a419c000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: ffffb89b43301000 R12: 000000000000005e R13: ffffb89b47377a2e R14: ffffb89b473779af R15: 0000000000000000 FS: 00007fc47e1e1000(0000) GS:ffff9039ac200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc47e1df000 CR3: 00000003d9e4e001 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: read_block_for_search+0xf6/0x350 [btrfs] btrfs_next_old_leaf+0x242/0x650 [btrfs] resolve_indirect_refs+0x7cf/0x9e0 [btrfs] find_parent_nodes+0x4ea/0x12c0 [btrfs] btrfs_find_all_roots_safe+0xbf/0x130 [btrfs] btrfs_qgroup_account_extents+0x9d/0x390 [btrfs] btrfs_commit_transaction+0x4f7/0xb20 [btrfs] btrfs_sync_file+0x3d4/0x4d0 [btrfs] do_fsync+0x38/0x70 __x64_sys_fdatasync+0x13/0x20 do_syscall_64+0x5c/0xe0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fc47e2d72e3 Code: Bad RIP value. RSP: 002b:00007fffa32098c8 EFLAGS: 00000246 ORIG_RAX: 000000000000004b RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc47e2d72e3 RDX: 00007fffa3209830 RSI: 00007fffa3209830 RDI: 0000000000000003 RBP: 000000000000072e R08: 0000000000000001 R09: 0000000000000003 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000003e8 R13: 0000000051eb851f R14: 00007fffa3209970 R15: 00005607c4ac8b50 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0x755/0x1eb0 softirqs last enabled at (0): [] copy_process+0x755/0x1eb0 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace 8639237550317b48 ]--- BTRFS error (device sdc): tree first key mismatch detected, bytenr=62324736 parent_transid=94 key expected=(262,108,1351680) has=(259,108,1921024) general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI CPU: 2 PID: 1763215 Comm: fsstress Tainted: G W 5.8.0-rc3-btrfs-next-64 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:ulist_release+0x14/0x60 [btrfs] Code: c7 07 00 (...) RSP: 0018:ffffb89b47377d60 EFLAGS: 00010282 RAX: 6b6b6b6b6b6b6b6b RBX: ffff903959b56b90 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000270024 RDI: ffff9036e2adc840 RBP: ffff9036e2adc848 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff9036e2adc840 R13: 0000000000000015 R14: ffff9039a419ccf8 R15: ffff90395d605840 FS: 00007fc47e1e1000(0000) GS:ffff9039ac600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8c1c0a51c8 CR3: 00000003d9e4e004 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ulist_free+0x13/0x20 [btrfs] btrfs_qgroup_account_extents+0xf3/0x390 [btrfs] btrfs_commit_transaction+0x4f7/0xb20 [btrfs] btrfs_sync_file+0x3d4/0x4d0 [btrfs] do_fsync+0x38/0x70 __x64_sys_fdatasync+0x13/0x20 do_syscall_64+0x5c/0xe0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fc47e2d72e3 Code: Bad RIP value. RSP: 002b:00007fffa32098c8 EFLAGS: 00000246 ORIG_RAX: 000000000000004b RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc47e2d72e3 RDX: 00007fffa3209830 RSI: 00007fffa3209830 RDI: 0000000000000003 RBP: 000000000000072e R08: 0000000000000001 R09: 0000000000000003 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000003e8 R13: 0000000051eb851f R14: 00007fffa3209970 R15: 00005607c4ac8b50 Modules linked in: dm_snapshot dm_thin_pool (...) ---[ end trace 8639237550317b49 ]--- RIP: 0010:ulist_release+0x14/0x60 [btrfs] Code: c7 07 00 (...) RSP: 0018:ffffb89b47377d60 EFLAGS: 00010282 RAX: 6b6b6b6b6b6b6b6b RBX: ffff903959b56b90 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000270024 RDI: ffff9036e2adc840 RBP: ffff9036e2adc848 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff9036e2adc840 R13: 0000000000000015 R14: ffff9039a419ccf8 R15: ffff90395d605840 FS: 00007fc47e1e1000(0000) GS:ffff9039ad200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6a776f7d40 CR3: 00000003d9e4e002 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Fix this by making btrfs_find_all_roots_safe() set *roots to NULL after it frees the ulist. Fixes: 8da6d5815c592b ("Btrfs: added btrfs_find_all_roots()") CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 551e553f0d4ab623e2a6f424ab5834f9c7b5229c Author: Serge Semin Date: Tue Jul 14 15:41:12 2020 +0300 serial: 8250_mtk: Fix high-speed baud rates clamping Commit 7b668c064ec3 ("serial: 8250: Fix max baud limit in generic 8250 port") fixed limits of a baud rate setting for a generic 8250 port. In other words since that commit the baud rate has been permitted to be within [uartclk / 16 / UART_DIV_MAX; uartclk / 16], which is absolutely normal for a standard 8250 UART port. But there are custom 8250 ports, which provide extended baud rate limits. In particular the Mediatek 8250 port can work with baud rates up to "uartclk" speed. Normally that and any other peculiarity is supposed to be handled in a custom set_termios() callback implemented in the vendor-specific 8250-port glue-driver. Currently that is how it's done for the most of the vendor-specific 8250 ports, but for some reason for Mediatek a solution has been spread out to both the glue-driver and to the generic 8250-port code. Due to that a bug has been introduced, which permitted the extended baud rate limit for all even for standard 8250-ports. The bug has been fixed by the commit 7b668c064ec3 ("serial: 8250: Fix max baud limit in generic 8250 port") by narrowing the baud rates limit back down to the normal bounds. Unfortunately by doing so we also broke the Mediatek-specific extended bauds feature. A fix of the problem described above is twofold. First since we can't get back the extended baud rate limits feature to the generic set_termios() function and that method supports only a standard baud rates range, the requested baud rate must be locally stored before calling it and then restored back to the new termios structure after the generic set_termios() finished its magic business. By doing so we still use the serial8250_do_set_termios() method to set the LCR/MCR/FCR/etc. registers, while the extended baud rate setting procedure will be performed later in the custom Mediatek-specific set_termios() callback. Second since a true baud rate is now fully calculated in the custom set_termios() method we need to locally update the port timeout by calling the uart_update_timeout() function. After the fixes described above are implemented in the 8250_mtk.c driver, the Mediatek 8250-port should get back to normally working with extended baud rates. Link: https://lore.kernel.org/linux-serial/20200701211337.3027448-1-danielwinkler@google.com Fixes: 7b668c064ec3 ("serial: 8250: Fix max baud limit in generic 8250 port") Reported-by: Daniel Winkler Signed-off-by: Serge Semin Cc: stable Tested-by: Claire Chang Link: https://lore.kernel.org/r/20200714124113.20918-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Greg Kroah-Hartman commit f4c23a140d80ef5e6d3d1f8f57007649014b60fa Author: Yang Yingliang Date: Tue Jul 21 14:38:52 2020 +0000 serial: 8250: fix null-ptr-deref in serial8250_start_tx() I got null-ptr-deref in serial8250_start_tx(): [ 78.114630] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 78.123778] Mem abort info: [ 78.126560] ESR = 0x86000007 [ 78.129603] EC = 0x21: IABT (current EL), IL = 32 bits [ 78.134891] SET = 0, FnV = 0 [ 78.137933] EA = 0, S1PTW = 0 [ 78.141064] user pgtable: 64k pages, 48-bit VAs, pgdp=00000027d41a8600 [ 78.147562] [0000000000000000] pgd=00000027893f0003, p4d=00000027893f0003, pud=00000027893f0003, pmd=00000027c9a20003, pte=0000000000000000 [ 78.160029] Internal error: Oops: 86000007 [#1] SMP [ 78.164886] Modules linked in: sunrpc vfat fat aes_ce_blk crypto_simd cryptd aes_ce_cipher crct10dif_ce ghash_ce sha2_ce sha256_arm64 sha1_ce ses enclosure sg sbsa_gwdt ipmi_ssif spi_dw_mmio sch_fq_codel vhost_net tun vhost vhost_iotlb tap ip_tables ext4 mbcache jbd2 ahci hisi_sas_v3_hw libahci hisi_sas_main libsas hns3 scsi_transport_sas hclge libata megaraid_sas ipmi_si hnae3 ipmi_devintf ipmi_msghandler br_netfilter bridge stp llc nvme nvme_core xt_sctp sctp libcrc32c dm_mod nbd [ 78.207383] CPU: 11 PID: 23258 Comm: null-ptr Not tainted 5.8.0-rc6+ #48 [ 78.214056] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B210.01 03/12/2020 [ 78.222888] pstate: 80400089 (Nzcv daIf +PAN -UAO BTYPE=--) [ 78.228435] pc : 0x0 [ 78.230618] lr : serial8250_start_tx+0x160/0x260 [ 78.235215] sp : ffff800062eefb80 [ 78.238517] x29: ffff800062eefb80 x28: 0000000000000fff [ 78.243807] x27: ffff800062eefd80 x26: ffff202fd83b3000 [ 78.249098] x25: ffff800062eefd80 x24: ffff202fd83b3000 [ 78.254388] x23: ffff002fc5e50be8 x22: 0000000000000002 [ 78.259679] x21: 0000000000000001 x20: 0000000000000000 [ 78.264969] x19: ffffa688827eecc8 x18: 0000000000000000 [ 78.270259] x17: 0000000000000000 x16: 0000000000000000 [ 78.275550] x15: ffffa68881bc67a8 x14: 00000000000002e6 [ 78.280841] x13: ffffa68881bc67a8 x12: 000000000000c539 [ 78.286131] x11: d37a6f4de9bd37a7 x10: ffffa68881cccff0 [ 78.291421] x9 : ffffa68881bc6000 x8 : ffffa688819daa88 [ 78.296711] x7 : ffffa688822a0f20 x6 : ffffa688819e0000 [ 78.302002] x5 : ffff800062eef9d0 x4 : ffffa68881e707a8 [ 78.307292] x3 : 0000000000000000 x2 : 0000000000000002 [ 78.312582] x1 : 0000000000000001 x0 : ffffa688827eecc8 [ 78.317873] Call trace: [ 78.320312] 0x0 [ 78.322147] __uart_start.isra.9+0x64/0x78 [ 78.326229] uart_start+0xb8/0x1c8 [ 78.329620] uart_flush_chars+0x24/0x30 [ 78.333442] n_tty_receive_buf_common+0x7b0/0xc30 [ 78.338128] n_tty_receive_buf+0x44/0x2c8 [ 78.342122] tty_ioctl+0x348/0x11f8 [ 78.345599] ksys_ioctl+0xd8/0xf8 [ 78.348903] __arm64_sys_ioctl+0x2c/0xc8 [ 78.352812] el0_svc_common.constprop.2+0x88/0x1b0 [ 78.357583] do_el0_svc+0x44/0xd0 [ 78.360887] el0_sync_handler+0x14c/0x1d0 [ 78.364880] el0_sync+0x140/0x180 [ 78.368185] Code: bad PC value SERIAL_PORT_DFNS is not defined on each arch, if it's not defined, serial8250_set_defaults() won't be called in serial8250_isa_init_ports(), so the p->serial_in pointer won't be initialized, and it leads a null-ptr-deref. Fix this problem by calling serial8250_set_defaults() after init uart port. Signed-off-by: Yang Yingliang Cc: stable Link: https://lore.kernel.org/r/20200721143852.4058352-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 707631ce639651e51bfed9e56326cde86f9e97b8 Author: Johan Hovold Date: Fri Jul 10 15:59:47 2020 +0200 serial: tegra: drop bogus NULL tty-port checks The struct tty_port is part of the uart state and will never be NULL in the receive helpers. Drop the bogus NULL checks and rename the pointer-variables "port" to differentiate them from struct tty_struct pointers (which can be NULL). Fixes: 962963e4ee23 ("serial: tegra: Switch to using struct tty_port") Signed-off-by: Johan Hovold Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20200710135947.2737-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit b374c562ee7ab3f3a1daf959c01868bae761571c Author: Johan Hovold Date: Fri Jul 10 15:59:46 2020 +0200 serial: tegra: fix CREAD handling for PIO Commit 33ae787b74fc ("serial: tegra: add support to ignore read") added support for dropping input in case CREAD isn't set, but for PIO the ignore_status_mask wasn't checked until after the character had been put in the receive buffer. Note that the NULL tty-port test is bogus and will be removed by a follow-on patch. Fixes: 33ae787b74fc ("serial: tegra: add support to ignore read") Cc: stable # 5.4 Cc: Shardar Shariff Md Cc: Krishna Yarlagadda Signed-off-by: Johan Hovold Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20200710135947.2737-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit a862192e9227ad46e0447fd0a03869ba1b30d16f Author: Jason Gunthorpe Date: Sun Jul 19 09:54:35 2020 +0300 RDMA/mlx5: Prevent prefetch from racing with implicit destruction Prefetch work in mlx5_ib_prefetch_mr_work can be queued and able to run concurrently with destruction of the implicit MR. The num_deferred_work was intended to serialize this, but there is a race: CPU0 CPU1 mlx5_ib_free_implicit_mr() xa_erase(odp_mkeys) synchronize_srcu() __xa_erase(implicit_children) mlx5_ib_prefetch_mr_work() pagefault_mr() pagefault_implicit_mr() implicit_get_child_mr() xa_cmpxchg() atomic_dec_and_test(num_deferred_mr) wait_event(imr->q_deferred_work) ib_umem_odp_release(odp_imr) kfree(odp_imr) At this point in mlx5_ib_free_implicit_mr() the implicit_children list is supposed to be empty forever so that destroy_unused_implicit_child_mr() and related are not and will not be running. Since it is not empty the destroy_unused_implicit_child_mr() flow ends up touching deallocated memory as mlx5_ib_free_implicit_mr() already tore down the imr parent. The solution is to flush out the prefetch wq by driving num_deferred_work to zero after creation of new prefetch work is blocked. Fixes: 5256edcb98a1 ("RDMA/mlx5: Rework implicit ODP destroy") Link: https://lore.kernel.org/r/20200719065435.130722-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 22a82fa7d6c3e16d56a036b1fa697a39b954adf0 Author: Helmut Grohne Date: Mon Jul 13 09:32:28 2020 +0200 tty: xilinx_uartps: Really fix id assignment The problems started with the revert (18cc7ac8a28e28). The cdns_uart_console.index is statically assigned -1. When the port is registered, Linux assigns consecutive numbers to it. It turned out that when using ttyPS1 as console, the index is not updated as we are reusing the same cdns_uart_console instance for multiple ports. When registering ttyPS0, it gets updated from -1 to 0, but when registering ttyPS1, it already is 0 and not updated. That led to 2ae11c46d5fdc4. It assigns the index prior to registering the uart_driver once. Unfortunately, that ended up breaking the situation where the probe order does not match the id order. When using the same device tree for both uboot and linux, it is important that the serial0 alias points to the console. So some boards reverse those aliases. This was reported by Jan Kiszka. The proposed fix was reverting the index assignment and going back to the previous iteration. However such a reversed assignement (serial0 -> uart1, serial1 -> uart0) was already partially broken by the revert (18cc7ac8a28e28). While the ttyPS device works, the kmsg connection is already broken and kernel messages go missing. Reverting the id assignment does not fix this. >From the xilinx_uartps driver pov (after reverting the refactoring commits), there can be only one console. This manifests in static variables console_pprt and cdns_uart_console. These variables are not properly linked and can go out of sync. The cdns_uart_console.index is important for uart_add_one_port. We call that function for each port - one of which hopefully is the console. If it isn't, the CON_ENABLED flag is not set and console_port is cleared. The next cdns_uart_probe call then tries to register the next port using that same cdns_uart_console. It is important that console_port and cdns_uart_console (and its index in particular) stay in sync. The index assignment implemented by Shubhrajyoti Datta is correct in principle. It just may have to happen a second time if the first cdns_uart_probe call didn't encounter the console device. And we shouldn't change the index once the console uart is registered. Reported-by: Shubhrajyoti Datta Reported-by: Jan Kiszka Link: https://lore.kernel.org/linux-serial/f4092727-d8f5-5f91-2c9f-76643aace993@siemens.com/ Fixes: 18cc7ac8a28e28 ("Revert "serial: uartps: Register own uart console and driver structures"") Fixes: 2ae11c46d5fdc4 ("tty: xilinx_uartps: Fix missing id assignment to the console") Fixes: 76ed2e10579671 ("Revert "tty: xilinx_uartps: Fix missing id assignment to the console"") Signed-off-by: Helmut Grohne Cc: stable Link: https://lore.kernel.org/r/20200713073227.GA3805@laureti-dev Signed-off-by: Greg Kroah-Hartman commit ce684552a266cb1c7cc2f7e623f38567adec6653 Author: Tetsuo Handa Date: Sun Jul 12 20:10:12 2020 +0900 vt: Reject zero-sized screen buffer size. syzbot is reporting general protection fault in do_con_write() [1] caused by vc->vc_screenbuf == ZERO_SIZE_PTR caused by vc->vc_screenbuf_size == 0 caused by vc->vc_cols == vc->vc_rows == vc->vc_size_row == 0 caused by fb_set_var() from ioctl(FBIOPUT_VSCREENINFO) on /dev/fb0 , for gotoxy(vc, 0, 0) from reset_terminal() from vc_init() from vc_allocate() from con_install() from tty_init_dev() from tty_open() on such console causes vc->vc_pos == 0x10000000e due to ((unsigned long) ZERO_SIZE_PTR) + -1U * 0 + (-1U << 1). I don't think that a console with 0 column or 0 row makes sense. And it seems that vc_do_resize() does not intend to allow resizing a console to 0 column or 0 row due to new_cols = (cols ? cols : vc->vc_cols); new_rows = (lines ? lines : vc->vc_rows); exception. Theoretically, cols and rows can be any range as long as 0 < cols * rows * 2 <= KMALLOC_MAX_SIZE is satisfied (e.g. cols == 1048576 && rows == 2 is possible) because of vc->vc_size_row = vc->vc_cols << 1; vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row; in visual_init() and kzalloc(vc->vc_screenbuf_size) in vc_allocate(). Since we can detect cols == 0 or rows == 0 via screenbuf_size = 0 in visual_init(), we can reject kzalloc(0). Then, vc_allocate() will return an error, and con_write() will not be called on a console with 0 column or 0 row. We need to make sure that integer overflow in visual_init() won't happen. Since vc_do_resize() restricts cols <= 32767 and rows <= 32767, applying 1 <= cols <= 32767 and 1 <= rows <= 32767 restrictions to vc_allocate() will be practically fine. This patch does not touch con_init(), for returning -EINVAL there does not help when we are not returning -ENOMEM. [1] https://syzkaller.appspot.com/bug?extid=017265e8553724e514e8 Reported-and-tested-by: syzbot Signed-off-by: Tetsuo Handa Cc: stable Link: https://lore.kernel.org/r/20200712111013.11881-1-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman commit 5c6360ee4a0e7f62de34341ad5d3c936f49b391d Author: Ard Biesheuvel Date: Wed Jun 24 08:51:49 2020 +0100 ARM: 8988/1: mmu: fix crash in EFI calls due to p4d typo in create_mapping_late() Commit 84e6ffb2c49c7901 ("arm: add support for folded p4d page tables") updated create_mapping_late() to take folded P4Ds into account when creating mappings, but inverted the p4d_alloc() failure test, resulting in no mapping to be created at all. When the EFI rtc driver subsequently tries to invoke the EFI GetTime() service, the memory regions covering the EFI data structures are missing from the page tables, resulting in a crash like Unable to handle kernel paging request at virtual address 5ae0cf28 pgd = (ptrval) [5ae0cf28] *pgd=80000040205003, *pmd=00000000 Internal error: Oops: 207 [#1] SMP THUMB2 Modules linked in: CPU: 0 PID: 7 Comm: kworker/u32:0 Not tainted 5.7.0+ #92 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 Workqueue: efi_rts_wq efi_call_rts PC is at efi_call_rts+0x94/0x294 LR is at efi_call_rts+0x83/0x294 pc : [] lr : [] psr: 30000033 sp : e6219ef0 ip : 00000000 fp : ffffe000 r10: 00000000 r9 : 00000000 r8 : 30000013 r7 : e6201dd0 r6 : e6201ddc r5 : 00000000 r4 : c181f264 r3 : 5ae0cf10 r2 : 00000001 r1 : e6201dd0 r0 : e6201ddc Flags: nzCV IRQs on FIQs on Mode SVC_32 ISA Thumb Segment none Control: 70c5383d Table: 661cc840 DAC: 00000001 Process kworker/u32:0 (pid: 7, stack limit = 0x(ptrval)) ... [] (efi_call_rts) from [] (process_one_work+0x16d/0x3d8) [] (process_one_work) from [] (worker_thread+0xfd/0x408) [] (worker_thread) from [] (kthread+0x103/0x104) ... Fixes: 84e6ffb2c49c7901 ("arm: add support for folded p4d page tables") Reviewed-by: Mike Rapoport Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King commit 4405bdf3c57ec28d606bdf5325f1167505bfdcd4 Author: Jaedon Shin Date: Thu Jun 18 18:15:30 2020 +0100 ARM: 8987/1: VDSO: Fix incorrect clock_gettime64 __vdso_*() should be removed and fallback used if CNTCVT is not available by cntvct_functional(). __vdso_clock_gettime64 when added previous commit is using the incorrect CNTCVT value in that state. __vdso_clock_gettime64 is also added to remove it's symbol. Cc: stable@vger.kernel.org Fixes: 74d06efb9c2f ("ARM: 8932/1: Add clock_gettime64 entry point") Signed-off-by: Jaedon Shin Tested-by: Robin Murphy Signed-off-by: Robin Murphy Signed-off-by: Russell King commit eec13b42d41b0f3339dcf0c4da43734427c68620 Author: Will Deacon Date: Thu Jun 18 11:16:45 2020 +0100 ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints Unprivileged memory accesses generated by the so-called "translated" instructions (e.g. LDRT) in kernel mode can cause user watchpoints to fire unexpectedly. In such cases, the hw_breakpoint logic will invoke the user overflow handler which will typically raise a SIGTRAP back to the current task. This is futile when returning back to the kernel because (a) the signal won't have been delivered and (b) userspace can't handle the thing anyway. Avoid invoking the user overflow handler for watchpoints triggered by kernel uaccess routines, and instead single-step over the faulting instruction as we would if no overflow handler had been installed. Cc: Fixes: f81ef4a920c8 ("ARM: 6356/1: hw-breakpoint: add ARM backend for the hw-breakpoint framework") Reported-by: Luis Machado Tested-by: Luis Machado Signed-off-by: Will Deacon Signed-off-by: Russell King commit b4a25fb0e62990df467451744b22e0e24960a5e6 Merge: e2a71bdea816 6cfcd5563b4f Author: Thomas Gleixner Date: Tue Jul 21 17:18:32 2020 +0200 Merge tag 'timers-v5.8-rc7' of https://git.linaro.org/people/daniel.lezcano/linux into timers/urgent Pull a timer chip fix from Daniel Lezcano: - Fix kernel panic at suspend / resume time on TI am3/am4 (Tony Lindgren) commit be6577af0cef934ccb036445314072e8cb9217b9 Author: John David Anglin Date: Tue Jul 21 07:36:59 2020 -0400 parisc: Add atomic64_set_release() define to avoid CPU soft lockups Stalls are quite frequent with recent kernels. I enabled CONFIG_SOFTLOCKUP_DETECTOR and I caught the following stall: watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [cc1:22803] CPU: 0 PID: 22803 Comm: cc1 Not tainted 5.6.17+ #3 Hardware name: 9000/800/rp3440 IAOQ[0]: d_alloc_parallel+0x384/0x688 IAOQ[1]: d_alloc_parallel+0x388/0x688 RP(r2): d_alloc_parallel+0x134/0x688 Backtrace: [<000000004036974c>] __lookup_slow+0xa4/0x200 [<0000000040369fc8>] walk_component+0x288/0x458 [<000000004036a9a0>] path_lookupat+0x88/0x198 [<000000004036e748>] filename_lookup+0xa0/0x168 [<000000004036e95c>] user_path_at_empty+0x64/0x80 [<000000004035d93c>] vfs_statx+0x104/0x158 [<000000004035dfcc>] __do_sys_lstat64+0x44/0x80 [<000000004035e5a0>] sys_lstat64+0x20/0x38 [<0000000040180054>] syscall_exit+0x0/0x14 The code was stuck in this loop in d_alloc_parallel: 4037d414: 0e 00 10 dc ldd 0(r16),ret0 4037d418: c7 fc 5f ed bb,< ret0,1f,4037d414 4037d41c: 08 00 02 40 nop This is the inner loop of bit_spin_lock which is called by hlist_bl_unlock in d_alloc_parallel: static inline void bit_spin_lock(int bitnum, unsigned long *addr) { /* * Assuming the lock is uncontended, this never enters * the body of the outer loop. If it is contended, then * within the inner loop a non-atomic test is used to * busywait with less bus contention for a good time to * attempt to acquire the lock bit. */ preempt_disable(); #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) while (unlikely(test_and_set_bit_lock(bitnum, addr))) { preempt_enable(); do { cpu_relax(); } while (test_bit(bitnum, addr)); preempt_disable(); } #endif __acquire(bitlock); } After consideration, I realized that we must be losing bit unlocks. Then, I noticed that we missed defining atomic64_set_release(). Adding this define fixes the stalls in bit operations. Signed-off-by: Dave Anglin Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit 8c26c87b05323a7ccdc632820b85253e0bf47fd9 Merge: 4fa640dc5230 568e4e82128a Author: Linus Torvalds Date: Tue Jul 21 08:06:45 2020 -0700 Merge tag 'sound-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into master Pull sound fixes from Takashi Iwai: "This became fairly large, containing mostly the collection of ASoC fixes that slipped from the previous request, so I sent now a bit earlier than usual. But all changes look small and mostly device-specific, hence nothing to worry too much. Majority of changes are for x86 based platforms and their CODEC drivers, in order to address some issues hit by their recent tests and fuzzing. The rest are other ASoC device-specific fixes (imx, qcom, wm8974, amd, rockchip) as well as a trivial fix for a kernel WARNING hit by syzkaller" * tag 'sound-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (28 commits) ALSA: hda/realtek: Fixed ALC298 sound bug by adding quirk for Samsung Notebook Pen S ALSA: info: Drop WARN_ON() from buffer NULL sanity check ASoC: rt5682: Report the button event in the headset type only ASoC: Intel: bytcht_es8316: Add missed put_device() ASoC: rt5682: Enable Vref2 under using PLL2 ASoC: rt286: fix unexpected interrupt happens ASoC: wm8974: remove unsupported clock mode ASoC: wm8974: fix Boost Mixer Aux Switch ASoC: SOF: core: fix null-ptr-deref bug during device removal ASoc: codecs: max98373: remove Idle_bias_on to let codec suspend ASoC: codecs: max98373: Removed superfluous volume control from chip default ASoC: topology: fix tlvs in error handling for widget_dmixer ASoC: topology: fix kernel oops on route addition error ASoC: SOF: imx: add min/max channels for SAI/ESAI on i.MX8/i.MX8M ASoC: Intel: bdw-rt5677: fix non BE conversion ASoC: soc-dai: set dai_link dpcm_ flags with a helper MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl ASoC: core: Remove only the registered component in devm functions MAINTAINERS: Change Maintainer for some at91 drivers ASoC: dt-bindings: simple-card: Fix 'make dt_binding_check' warnings ... commit 6cfcd5563b4fadbf49ba8fa481978e5e86d30322 Author: Tony Lindgren Date: Mon Jul 13 09:26:01 2020 -0700 clocksource/drivers/timer-ti-dm: Fix suspend and resume for am3 and am4 Carlos Hernandez reported that we now have a suspend and resume regresssion on am3 and am4 compared to the earlier kernels. While suspend and resume works with v5.8-rc3, we now get errors with rtcwake: pm33xx pm33xx: PM: Could not transition all powerdomains to target state ... rtcwake: write error This is because we now fail to idle the system timer clocks that the idle code checks and the error gets propagated to the rtcwake. Turns out there are several issues that need to be fixed: 1. Ignore no-idle and no-reset configured timers for the ti-sysc interconnect target driver as otherwise it will keep the system timer clocks enabled 2. Toggle the system timer functional clock for suspend for am3 and am4 (but not for clocksource on am3) 3. Only reconfigure type1 timers in dmtimer_systimer_disable() 4. Use of_machine_is_compatible() instead of of_device_is_compatible() for checking the SoC type Fixes: 52762fbd1c47 ("clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support") Reported-by: Carlos Hernandez Signed-off-by: Tony Lindgren Tested-by: Carlos Hernandez Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200713162601.6829-1-tony@atomide.com commit dbb0897e805f2ab1b8bc358f6c3d878a376b8897 Author: Forest Crossman Date: Fri Jul 17 06:27:34 2020 -0500 usb: xhci: Fix ASM2142/ASM3142 DMA addressing The ASM2142/ASM3142 (same PCI IDs) does not support full 64-bit DMA addresses, which can cause silent memory corruption or IOMMU errors on platforms that use the upper bits. Add the XHCI_NO_64BIT_SUPPORT quirk to fix this issue. Signed-off-by: Forest Crossman Cc: stable Link: https://lore.kernel.org/r/20200717112734.328432-1-cyrozap@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5ce1a24dd98c00a57a8fa13660648abf7e08e3ef Author: Chunfeng Yun Date: Fri Jul 10 13:57:52 2020 +0800 usb: xhci-mtk: fix the failure of bandwidth allocation The wMaxPacketSize field of endpoint descriptor may be zero as default value in alternate interface, and they are not actually selected when start stream, so skip them when try to allocate bandwidth. Cc: stable Fixes: 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host controller") Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1594360672-2076-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 3d3af181d370069861a3be94608464e2ff3682e2 Author: Thomas Richter Date: Fri Jul 17 11:27:22 2020 +0200 s390/cpum_cf,perf: change DFLT_CCERROR counter name Change the counter name DLFT_CCERROR to DLFT_CCFINISH on IBM z15. This counter counts completed DEFLATE instructions with exit code 0, 1 or 2. Since exit code 0 means success and exit code 1 or 2 indicate errors, change the counter name to avoid confusion. This counter is incremented each time the DEFLATE instruction completed regardless if an error was detected or not. Fixes: d68d5d51dc89 ("s390/cpum_cf: Add new extended counters for IBM z15") Fixes: e7950166e402 ("perf vendor events s390: Add new deflate counters for IBM z15") Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Thomas Richter Reviewed-by: Sumanth Korikkar Signed-off-by: Heiko Carstens commit 101dde4207f1daa1fda57d714814a03835dccc3f Author: Steffen Klassert Date: Fri Jul 17 10:34:27 2020 +0200 xfrm: Fix crash when the hold queue is used. The commits "xfrm: Move dst->path into struct xfrm_dst" and "net: Create and use new helper xfrm_dst_child()." changed xfrm bundle handling under the assumption that xdst->path and dst->child are not a NULL pointer only if dst->xfrm is not a NULL pointer. That is true with one exception. If the xfrm hold queue is used to wait until a SA is installed by the key manager, we create a dummy bundle without a valid dst->xfrm pointer. The current xfrm bundle handling crashes in that case. Fix this by extending the NULL check of dst->xfrm with a test of the DST_XFRM_QUEUE flag. Fixes: 0f6c480f23f4 ("xfrm: Move dst->path into struct xfrm_dst") Fixes: b92cf4aab8e6 ("net: Create and use new helper xfrm_dst_child().") Signed-off-by: Steffen Klassert commit b344d6a83d01c52fddbefa6b3b4764da5b1022a0 Author: Liam Beguin Date: Sat Jul 18 16:10:21 2020 -0400 parisc: add support for cmpxchg on u8 pointers The kernel test bot reported[1] that using set_mask_bits on a u8 causes the following issue on parisc: hppa-linux-ld: drivers/phy/ti/phy-tusb1210.o: in function `tusb1210_probe': >> (.text+0x2f4): undefined reference to `__cmpxchg_called_with_bad_pointer' >> hppa-linux-ld: (.text+0x324): undefined reference to `__cmpxchg_called_with_bad_pointer' hppa-linux-ld: (.text+0x354): undefined reference to `__cmpxchg_called_with_bad_pointer' Add support for cmpxchg on u8 pointers. [1] https://lore.kernel.org/patchwork/patch/1272617/#1468946 Reported-by: kernel test robot Signed-off-by: Liam Beguin Tested-by: Dave Anglin Signed-off-by: Helge Deller commit 0a266f8954e29139654dcca529be099f3404b61c Merge: 17175d1a27c6 95a35b42bc6e Author: Steffen Klassert Date: Tue Jul 21 08:03:04 2020 +0200 Merge remote-tracking branch 'origin/testing' Sabrina Dubroca says: ==================== xfrm: a few fixes for espintc Andrew Cagney reported some issues when trying to use async operations on the encapsulation socket. Patches 1 and 2 take care of these bugs. In addition, I missed a spot when adding IPv6 support and converting to the common config option. ==================== Signed-off-by: Steffen Klassert commit 4cb699d0447be8e0906539f93cbe41e19598ee5a Author: Vincent Chen Date: Fri Jul 10 10:40:54 2020 +0800 riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence It fails to boot the v5.8-rc4 kernel with CONFIG_KASAN because kasan_init and kasan_early_init use uninitialized __sbi_rfence as executing the tlb_flush_all(). Actually, at this moment, only the CPU which is responsible for the system initialization enables the MMU. Other CPUs are parking at the .Lsecondary_start. Hence the tlb_flush_all() is able to be replaced by local_tlb_flush_all() to avoid using uninitialized __sbi_rfence. Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit 6ef9dcb78046b346b5508ca1659848b136a343c2 Author: Tung Nguyen Date: Tue Jul 21 08:57:05 2020 +0700 tipc: allow to build NACK message in link timeout function Commit 02288248b051 ("tipc: eliminate gap indicator from ACK messages") eliminated sending of the 'gap' indicator in regular ACK messages and only allowed to build NACK message with enabled probe/probe_reply. However, necessary correction for building NACK message was missed in tipc_link_timeout() function. This leads to significant delay and link reset (due to retransmission failure) in lossy environment. This commit fixes it by setting the 'probe' flag to 'true' when the receive deferred queue is not empty. As a result, NACK message will be built to send back to another peer. Fixes: 02288248b051 ("tipc: eliminate gap indicator from ACK messages") Acked-by: Jon Maloy Signed-off-by: Tung Nguyen Signed-off-by: David S. Miller commit db415f7aae07cadcabd5d2a659f8ad825c905299 Author: Ilya Ponetayev Date: Thu Jul 16 17:27:53 2020 +0900 exfat: fix name_hash computation on big endian systems On-disk format for name_hash field is LE, so it must be explicitly transformed on BE system for proper result. Fixes: 370e812b3ec1 ("exfat: add nls operations") Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Chen Minqiang Signed-off-by: Ilya Ponetayev Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 41e3928f8c58184fcf0bb22e822af39a436370c7 Author: Hyeongseok Kim Date: Wed Jul 8 18:52:33 2020 +0900 exfat: fix wrong size update of stream entry by typo The stream.size field is updated to the value of create timestamp of the file entry. Fix this to use correct stream entry pointer. Fixes: 29bbb14bfc80 ("exfat: fix incorrect update of stream entry in __exfat_truncate()") Signed-off-by: Hyeongseok Kim Signed-off-by: Namjae Jeon commit d2fa0c337d97a5490190b9f3b9c73c8f9f3602a1 Author: Namjae Jeon Date: Fri Jul 3 11:19:46 2020 +0900 exfat: fix wrong hint_stat initialization in exfat_find_dir_entry() We found the wrong hint_stat initialization in exfat_find_dir_entry(). It should be initialized when cluster is EXFAT_EOF_CLUSTER. Fixes: ca06197382bd ("exfat: add directory operations") Cc: stable@vger.kernel.org # v5.7 Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 43946b70494beefe40ec1b2ba4744c0f294d7736 Author: Namjae Jeon Date: Fri Jul 3 11:16:32 2020 +0900 exfat: fix overflow issue in exfat_cluster_to_sector() An overflow issue can occur while calculating sector in exfat_cluster_to_sector(). It needs to cast clus's type to sector_t before left shifting. Fixes: 1acf1a564b60 ("exfat: add in-memory and on-disk structures and headers") Cc: stable@vger.kernel.org # v5.7 Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit db44c60c45aa533c92394c778247cfe8bdd66134 Author: Bixuan Cui Date: Mon Jul 20 09:58:39 2020 +0800 net: neterion: vxge: reduce stack usage in VXGE_COMPLETE_VPATH_TX Fix the warning: [-Werror=-Wframe-larger-than=] drivers/net/ethernet/neterion/vxge/vxge-main.c: In function'VXGE_COMPLETE_VPATH_TX.isra.37': drivers/net/ethernet/neterion/vxge/vxge-main.c:119:1: warning: the frame size of 1056 bytes is larger than 1024 bytes Dropping the NR_SKB_COMPLETED to 16 is appropriate that won't have much impact on performance and functionality. Signed-off-by: Bixuan Cui Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 3f0dcfbcd2e162fc0a11c1f59b7acd42ee45f126 Author: Ming Lei Date: Mon Jul 20 10:54:35 2020 +0800 scsi: core: Run queue in case of I/O resource contention failure I/O requests may be held in scheduler queue because of resource contention. The starvation scenario was handled properly in the regular completion path but we failed to account for it during I/O submission. This lead to the hang captured below. Make sure we run the queue when resource contention is encountered in the submission path. [ 39.054963] scsi 13:0:0:0: rejecting I/O to dead device [ 39.058700] scsi 13:0:0:0: rejecting I/O to dead device [ 39.087855] sd 13:0:0:1: [sdd] Synchronizing SCSI cache [ 39.088909] scsi 13:0:0:1: rejecting I/O to dead device [ 39.095351] scsi 13:0:0:1: rejecting I/O to dead device [ 39.096962] scsi 13:0:0:1: rejecting I/O to dead device [ 247.021859] INFO: task scsi-stress-rem:813 blocked for more than 122 seconds. [ 247.023258] Not tainted 5.8.0-rc2 #8 [ 247.024069] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 247.025331] scsi-stress-rem D 0 813 802 0x00004000 [ 247.025334] Call Trace: [ 247.025354] __schedule+0x504/0x55f [ 247.027987] schedule+0x72/0xa8 [ 247.027991] blk_mq_freeze_queue_wait+0x63/0x8c [ 247.027994] ? do_wait_intr_irq+0x7a/0x7a [ 247.027996] blk_cleanup_queue+0x4b/0xc9 [ 247.028000] __scsi_remove_device+0xf6/0x14e [ 247.028002] scsi_remove_device+0x21/0x2b [ 247.029037] sdev_store_delete+0x58/0x7c [ 247.029041] kernfs_fop_write+0x10d/0x14f [ 247.031281] vfs_write+0xa2/0xdf [ 247.032670] ksys_write+0x6b/0xb3 [ 247.032673] do_syscall_64+0x56/0x82 [ 247.034053] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 247.034059] RIP: 0033:0x7f69f39e9008 [ 247.036330] Code: Bad RIP value. [ 247.036331] RSP: 002b:00007ffdd8116498 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 247.037613] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f69f39e9008 [ 247.039714] RDX: 0000000000000002 RSI: 000055cde92a0ab0 RDI: 0000000000000001 [ 247.039715] RBP: 000055cde92a0ab0 R08: 000000000000000a R09: 00007f69f3a79e80 [ 247.039716] R10: 000000000000000a R11: 0000000000000246 R12: 00007f69f3abb780 [ 247.039717] R13: 0000000000000002 R14: 00007f69f3ab6740 R15: 0000000000000002 Link: https://lore.kernel.org/r/20200720025435.812030-1-ming.lei@redhat.com Cc: linux-block@vger.kernel.org Cc: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit befc113c56a76ae7be3986034a0e476d3385e265 Author: Huang Guobin Date: Sun Jul 19 21:46:14 2020 -0400 net: ag71xx: add missed clk_disable_unprepare in error path of probe The ag71xx_mdio_probe() forgets to call clk_disable_unprepare() when of_reset_control_get_exclusive() failed. Add the missed call to fix it. Fixes: d51b6ce441d3 ("net: ethernet: add ag71xx driver") Reported-by: Hulk Robot Signed-off-by: Huang Guobin Signed-off-by: David S. Miller commit ae372cb1750f6c95370f92fe5f5620e0954663ba Author: wenxu Date: Sun Jul 19 20:30:37 2020 +0800 net/sched: act_ct: fix restore the qdisc_skb_cb after defrag The fragment packets do defrag in tcf_ct_handle_fragments will clear the skb->cb which make the qdisc_skb_cb clear too. So the qdsic_skb_cb should be store before defrag and restore after that. It also update the pkt_len after all the fragments finish the defrag to one packet and make the following actions counter correct. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: wenxu Signed-off-by: David S. Miller commit 1e8fd3a97f2d83a7197876ceb4f37b4c2b00a0f3 Author: Navid Emamdoost Date: Sat Jul 18 00:31:49 2020 -0500 nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame The implementation of s3fwrn5_recv_frame() is supposed to consume skb on all execution paths. Release skb before returning -ENODEV. Signed-off-by: Navid Emamdoost Signed-off-by: David S. Miller commit 30d9e5057ac01dd6982adace221bfcafb1f8186e Author: Vinay Kumar Yadav Date: Sat Jul 18 00:41:07 2020 +0530 crypto/chtls: correct net_device reference count ip_dev_find() call holds net_device reference which is not needed, use __ip_dev_find() which does not hold reference. v1->v2: - Correct submission tree. - Add fixes tag. Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Vinay Kumar Yadav Signed-off-by: David S. Miller commit c271042eb6a031d1333cf57422ec1d20726901ab Author: Vinay Kumar Yadav Date: Sat Jul 18 00:31:42 2020 +0530 crypto/chtls: fix tls alert messages corrupted by tls data When tls data skb is pending for Tx and tls alert comes , It is wrongly overwrite the record type of tls data to tls alert record type. fix the issue correcting it. v1->v2: - Correct submission tree. - Add fixes tag. Fixes: 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver") Signed-off-by: Vinay Kumar Yadav Signed-off-by: David S. Miller commit 4932893924e9b9cdca8fcee2b87a4fa241cd95e8 Merge: 5d93518e06b2 0925e9db4dc8 Author: David S. Miller Date: Mon Jul 20 18:09:38 2020 -0700 Merge branch 'ionic-locking-and-filter-fixes' Shannon Nelson says: ==================== ionic: locking and filter fixes These patches address an ethtool show regs problem, some locking sightings, and issues with RSS hash and filter_id tracking after a managed FW update. ==================== Signed-off-by: David S. Miller commit 0925e9db4dc86daf666d9a3d53c7db14ac6d5d00 Author: Shannon Nelson Date: Mon Jul 20 16:00:17 2020 -0700 ionic: use mutex to protect queue operations The ionic_wait_on_bit_lock() was a open-coded mutex knock-off used only for protecting the queue reset operations, and there was no reason not to use the real thing. We can use the lock more correctly and to better protect the queue stop and start operations from cross threading. We can also remove a useless and expensive bit operation from the Rx path. This fixes a case found where the link_status_check from a link flap could run into an MTU change and cause a crash. Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit bdff46665ee655600d0fe2a0e5f62ec7853d3b22 Author: Shannon Nelson Date: Mon Jul 20 16:00:16 2020 -0700 ionic: keep rss hash after fw update Make sure the RSS hash key is kept across a fw update by not de-initing it when an update is happening. Fixes: c672412f6172 ("ionic: remove lifs on fw reset") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit cc4428c4de8c31f12e4690d0409e0432fe05702f Author: Shannon Nelson Date: Mon Jul 20 16:00:15 2020 -0700 ionic: update filter id after replay When we replay the rx filters after a fw-upgrade we get new filter_id values from the FW, which we need to save and update in our local filter list. This allows us to delete the filters with the correct filter_id when we're done. Fixes: 7e4d47596b68 ("ionic: replay filters after fw upgrade") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit cbec2153a9a68d011454960ba84887e46e40b37d Author: Shannon Nelson Date: Mon Jul 20 16:00:14 2020 -0700 ionic: fix up filter locks and debug msgs Add in a couple of forgotten spinlocks and fix up some of the debug messages around filter management. Fixes: c1e329ebec8d ("ionic: Add management of rx filters") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit f85ae16f924f92a370b81b4e77862c1c59882fce Author: Shannon Nelson Date: Mon Jul 20 16:00:13 2020 -0700 ionic: use offset for ethtool regs data Use an offset to write the second half of the regs data into the second half of the buffer instead of overwriting the first half. Fixes: 4d03e00a2140 ("ionic: Add initial ethtool support") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 5d93518e06b2102253d465e523f16bd4cb5ce859 Author: Murali Karicheri Date: Mon Jul 20 12:43:27 2020 -0400 net: hsr: check for return value of skb_put_padto() skb_put_padto() can fail. So check for return type and return NULL for skb. Caller checks for skb and acts correctly if it is NULL. Fixes: 6d6148bc78d2 ("net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames") Signed-off-by: Murali Karicheri Signed-off-by: David S. Miller commit 34b85adad831547cdd349ce9a05bbe751f9f4d46 Author: Guillaume Nault Date: Mon Jul 20 17:46:58 2020 +0200 Documentation: bareudp: update iproute2 sample commands bareudp.rst was written before iproute2 gained support for this new type of tunnel. Therefore, the sample command lines didn't match the final iproute2 implementation. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 5dbaeb87f2b309936be0aeae00cbc9e7f20ab296 Author: Liu Jian Date: Mon Jul 20 22:31:49 2020 +0800 mlxsw: destroy workqueue when trap_register in mlxsw_emad_init When mlxsw_core_trap_register fails in mlxsw_emad_init, destroy_workqueue() shouled be called to destroy mlxsw_core->emad_wq. Fixes: d965465b60ba ("mlxsw: core: Fix possible deadlock") Signed-off-by: Liu Jian Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 6790711f8ac5faabc43237c0d05d93db431a1ecc Author: Liu Jian Date: Mon Jul 20 22:28:29 2020 +0800 dpaa_eth: Fix one possible memleak in dpaa_eth_probe When dma_coerce_mask_and_coherent() fails, the alloced netdev need to be freed. Fixes: 060ad66f9795 ("dpaa_eth: change DMA device") Signed-off-by: Liu Jian Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit d49e2c9e54ddc072fe38dcd838a78067757b13c8 Merge: 639f181f0ee2 a9e445029570 Author: David S. Miller Date: Mon Jul 20 17:52:25 2020 -0700 Merge branch 'smc-fixes' Karsten Graul says: ==================== net/smc: fixes 2020-07-20 Please apply the following patch series for smc to netdev's net tree. Patch 1 fixes a problem with a buffer that is not put back when the connection was killed in the meantime. Patch 2 fixes a wrong behaviour when the maximum dmb buffer count exceeded. ==================== Signed-off-by: David S. Miller commit a9e445029570ab691a44389d68b9c544338586b5 Author: Karsten Graul Date: Mon Jul 20 16:24:29 2020 +0200 net/smc: fix dmb buffer shortage There is a current limit of 1920 registered dmb buffers per ISM device for smc-d. One link group can contain 255 connections, each connection is using one dmb buffer. When the connection is closed then the registered buffer is held in a queue and is reused by the next connection. When a link group is 'full' then another link group is created and uses an own buffer pool. The link groups are added to a list using list_add() which puts a new link group to the first position in the list. In the situation that many connections are opened (>1920) and a few of them stay open while others are closed quickly we end up with at least 8 link groups. For a new connection a matching link group is looked up, iterating over the list of link groups. The trailing 7 link groups all have registered dmb buffers which could be reused, while the first link group has only a few dmb buffers and then hit the 1920 limit. Because the first link group is not full (255 connection limit not reached) it is chosen and finally the connection falls back to TCP because there is no dmb buffer available in this link group. There are multiple ways to fix that: using list_add_tail() allows to scan older link groups first for free buffers which ensures that buffers are reused first. This fixes the problem for smc-r link groups as well. For smc-d there is an even better way to address this problem because smc-d does not have the 255 connections per link group limit. So fix the problem for smc-d by allowing large link groups. Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM") Reviewed-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 2bced6aefa3d0347e11efc610759e1317bfca7a7 Author: Karsten Graul Date: Mon Jul 20 16:24:28 2020 +0200 net/smc: put slot when connection is killed To get a send slot smc_wr_tx_get_free_slot() is called, which might wait for a free slot. When smc_wr_tx_get_free_slot() returns there is a check if the connection was killed in the meantime. In that case don't only return an error, but also put back the free slot. Fixes: b290098092e4 ("net/smc: cancel send and receive for terminated socket") Reviewed-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 639f181f0ee20d3249dbc55f740f0167267180f0 Author: David Howells Date: Mon Jul 20 12:41:46 2020 +0100 rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA rxrpc_sendmsg() returns EPIPE if there's an outstanding error, such as if rxrpc_recvmsg() indicating ENODATA if there's nothing for it to read. Change rxrpc_recvmsg() to return EAGAIN instead if there's nothing to read as this particular error doesn't get stored in ->sk_err by the networking core. Also change rxrpc_sendmsg() so that it doesn't fail with delayed receive errors (there's no way for it to report which call, if any, the error was caused by). Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Signed-off-by: David Howells Signed-off-by: David S. Miller commit 7d85396c4c72de12df76d6b9853fd871dbfdf2ec Merge: 53a92889ec0e 19dc36548be2 Author: David S. Miller Date: Mon Jul 20 17:04:35 2020 -0700 Merge tag 'ieee802154-for-davem-2020-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2020-07-20 An update from ieee802154 for your *net* tree. A potential memory leak fix for adf7242 from Liu Jian, and one more HTTPS link change from Alexander A. Klimov. ==================== Signed-off-by: David S. Miller commit 53a92889ec0e6d968a7f4098a16031a672b6fd51 Author: Zhang Changzhong Date: Mon Jul 20 17:36:34 2020 +0800 net: bcmgenet: add missed clk_disable_unprepare in bcmgenet_probe The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix to goto err_clk_disable if clk_prepare_enable() is successful. Fixes: c80d36ff63a5 ("net: bcmgenet: Use devm_clk_get_optional() to get the clocks") Signed-off-by: Zhang Changzhong Acked-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 24a63fe6d45d6527db5ab87bcd1da6921f10e89e Author: Zhang Changzhong Date: Mon Jul 20 15:18:43 2020 +0800 net: bcmgenet: fix error returns in bcmgenet_probe() The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix to goto err_clk_disable if clk_prepare_enable() is successful. Fixes: 99d55638d4b0 ("net: bcmgenet: enable NETIF_F_HIGHDMA flag") Signed-off-by: Zhang Changzhong Acked-by: Doug Berger Acked-by: Florian fainelli Signed-off-by: David S. Miller commit 4fa640dc52302b5e62b01b05c755b055549633ae Merge: 5714ee50bb43 b872d0640840 Author: Linus Torvalds Date: Mon Jul 20 13:30:59 2020 -0700 Merge tag 'vfio-v5.8-rc7' of git://github.com/awilliam/linux-vfio into master Pull VFIO fix from Alex Williamson: "Fix race with eventfd ctx cleared outside of mutex (Zeng Tao)" * tag 'vfio-v5.8-rc7' of git://github.com/awilliam/linux-vfio: vfio/pci: fix racy on error and request eventfd ctx commit 1cfd3426ef989b83fa6176490a38777057e57f6c Author: Hauke Mehrtens Date: Tue Jul 14 22:58:02 2020 +0200 ath10k: Fix NULL pointer dereference in AHB device probe This fixes a NULL pointer dereference in the probe path for AHB devices. There attr parameter in the ath10k_ce_alloc_pipe() function is not initialized, but accessed. This function is called by ath10k_pci_setup_resource() which is called by ath10k_ahb_probe(). The struct ath10k_pci is also used for AHB devices and not only for PCI devices. The initialization of the new members of struct ath10k_pci is moved to ath10k_pci_setup_resource() which is used by the PCI and the AHB code. This also fixes a use after free bug in ath10k_pci_remove() when ar_pci is accessed after ath10k_core_destroy() was called, which calls ieee80211_free_hw() and frees this memory. This fixes the following bug seen with backports-5.8-rc2 on OpenWrt on a IPQ4019 device: [ 11.117462] 8<--- cut here --- [ 11.117494] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 11.119510] pgd = f377fd58 [ 11.127657] [00000000] *pgd=8e9a0835, *pte=00000000, *ppte=00000000 [ 11.130206] Internal error: Oops: 17 [#1] SMP ARM [ 11.136339] Modules linked in: ath10k_pci(+) ath10k_core ath xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables crc_ccitt compat nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug [ 11.174355] CPU: 2 PID: 257 Comm: kmodloader Not tainted 5.4.51 #0 [ 11.196585] Hardware name: Generic DT based system [ 11.202746] PC is at ath10k_ce_alloc_pipe+0x58/0x180 [ath10k_core] [ 11.207459] LR is at ath10k_pci_alloc_pipes+0x94/0xc8 [ath10k_pci] [ 11.213600] pc : [] lr : [] psr: 80000013 [ 11.219760] sp : cea0dc90 ip : cf4001f0 fp : 00000001 [ 11.225923] r10: 00000000 r9 : 00000018 r8 : ce4963b4 [ 11.231133] r7 : 00000000 r6 : ce491ea0 r5 : 00000000 r4 : ce4963b4 [ 11.236342] r3 : 0004a000 r2 : 0004a000 r1 : bf2d0d70 r0 : 00000006 [ 11.242942] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 11.249452] Control: 10c5387d Table: 8e9c006a DAC: 00000051 [ 11.256656] Process kmodloader (pid: 257, stack limit = 0xaba286ca) [ 11.262386] Stack: (0xcea0dc90 to 0xcea0e000) [ 11.268462] dc80: 00000000 ce49629c ce491ea0 ce4963bc [ 11.272984] dca0: ce495ea0 bf2fbf98 00000002 ce4963a8 ce495ea0 00000000 ce491ea0 cf95d800 [ 11.281142] dcc0: cf95d810 cf95d810 00000001 bf2fc854 00000000 cf95d800 bf300748 ce495ea0 [ 11.289304] dce0: ce491ea0 d1300000 cf95d800 bf2fde8c 00000000 00000001 ce49cea0 00000000 [ 11.297462] dd00: 00000000 00000000 bf3010a0 cf95d810 bf3010a0 c0b61580 00000000 00000000 [ 11.305624] dd20: bf3010a0 0000000b c0b04e48 c06110c8 c0b61588 cf95d810 c0b61580 c060f740 [ 11.313781] dd40: cf95d810 00000000 bf3010a0 00000000 00000000 ce49d2a4 bf301100 c060fc90 [ 11.321943] dd60: 00000000 bf3010a0 cf95d810 c060fcf0 cf95d810 bf3010a0 c060fc98 c060dca4 [ 11.330101] dd80: cf809d58 cf952cb4 bf3010a0 ce967900 c0b1f2c8 c060ec28 bf3007b8 bf301038 [ 11.338263] dda0: bf3010a0 bf3010a0 c0b2d4d4 ffffe000 bf304000 c0610278 c0b04e48 c0b2d4d4 [ 11.346422] ddc0: ffffe000 bf2fe2b4 c0b04e48 bf30403c c0b04e48 c0302764 8040003f 00000001 [ 11.354582] dde0: 38e38e39 ce513580 c0b2cb50 cf801e00 cffbc6ac ce513600 cf801e00 cffbc6ac [ 11.362740] de00: 8040003e ce49d280 00000001 c0428d54 00000001 cf801e00 cffbc6ac ce513580 [ 11.370900] de20: ce49d280 0e391998 bf301100 ce49d340 d12d2000 ce49d280 00000001 c0398c2c [ 11.379061] de40: 00000001 cea0df34 cea0df34 00000001 d12d2000 c039ae48 bf30110c 00007fff [ 11.387221] de60: bf301100 c0398044 cf804028 bf301148 c0397674 bf30126c c08ee5c0 c08ee70c [ 11.395380] de80: bf30110c c0b04e48 c08ee518 00000000 c08ee570 c0b04e48 ce513600 fffff000 [ 11.403540] dea0: 00000001 ce513580 0000000d 0000000d 00000000 00000000 00000000 00000000 [ 11.411698] dec0: 00000000 00000000 6e72656b 00006c65 00000000 00000000 00000000 00000000 [ 11.419858] dee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 11.428018] df00: 00000000 0e391998 00000000 0000c610 d12de610 00000000 0062c620 ffffe000 [ 11.436180] df20: 000129d1 00000051 00000000 c039b228 00000000 d12d7afd d12d8e80 d12d2000 [ 11.444337] df40: 0000c610 d12de0e8 d12ddfa8 d12dab74 00009000 00009570 00003a2c 00009cae [ 11.452498] df60: 00000000 00000000 00000000 00003a1c 0000001e 0000001f 00000018 00000000 [ 11.460656] df80: 00000010 00000000 00000000 00000000 00000003 00000080 c0301204 cea0c000 [ 11.468817] dfa0: 00000080 c0301000 00000000 00000000 00620010 0000c610 000129d1 00000014 [ 11.476975] dfc0: 00000000 00000000 00000003 00000080 0000c610 00000000 b6fc1d20 00000000 [ 11.485137] dfe0: bef0ad14 bef0acf8 00011e14 b6f74c94 60000010 00620010 00000000 00000000 [ 11.493390] [] (ath10k_ce_alloc_pipe [ath10k_core]) from [] (ath10k_pci_alloc_pipes+0x94/0xc8 [ath10k_pci]) [ 11.501498] [] (ath10k_pci_alloc_pipes [ath10k_pci]) from [] (ath10k_pci_setup_resource+0xb8/0xf0 [ath10k_pci]) [ 11.512773] [] (ath10k_pci_setup_resource [ath10k_pci]) from [] (ath10k_ahb_probe+0x32c/0x670 [ath10k_pci]) [ 11.524566] [] (ath10k_ahb_probe [ath10k_pci]) from [] (platform_drv_probe+0x34/0x70) [ 11.536016] [] (platform_drv_probe) from [] (really_probe+0x1f0/0x358) [ 11.545729] [] (really_probe) from [] (device_driver_attach+0x58/0x60) [ 11.553886] [] (device_driver_attach) from [] (__driver_attach+0x58/0xcc) [ 11.562134] [] (__driver_attach) from [] (bus_for_each_dev+0x68/0x8c) [ 11.570731] [] (bus_for_each_dev) from [] (bus_add_driver+0x1c8/0x1d8) [ 11.578886] [] (bus_add_driver) from [] (driver_register+0x74/0x108) [ 11.587060] [] (driver_register) from [] (ath10k_ahb_init+0x18/0x38 [ath10k_pci]) [ 11.595320] [] (ath10k_ahb_init [ath10k_pci]) from [] (init_module+0x3c/0x1000 [ath10k_pci]) [ 11.604432] [] (init_module [ath10k_pci]) from [] (do_one_initcall+0x84/0x1d8) [ 11.614657] [] (do_one_initcall) from [] (do_init_module+0x5c/0x228) [ 11.623421] [] (do_init_module) from [] (load_module+0x1fc8/0x224c) [ 11.631663] [] (load_module) from [] (sys_init_module+0x15c/0x17c) [ 11.639390] [] (sys_init_module) from [] (ret_fast_syscall+0x0/0x54) [ 11.647370] Exception stack(0xcea0dfa8 to 0xcea0dff0) [ 11.655615] dfa0: 00000000 00000000 00620010 0000c610 000129d1 00000014 [ 11.660569] dfc0: 00000000 00000000 00000003 00000080 0000c610 00000000 b6fc1d20 00000000 [ 11.668725] dfe0: bef0ad14 bef0acf8 00011e14 b6f74c94 [ 11.676886] Code: e1c321d4 e0433002 e0232397 e5843014 (e5953000) [ 11.681958] ---[ end trace 8f35917de2e76854 ]--- Fixes: 521fc37be3d8 ("ath10k: Avoid override CE5 configuration for QCA99X0 chipsets") Reported-by: Stefan Lippers-Hollmann [ipq40xx/ map-ac2200] Signed-off-by: Hauke Mehrtens Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200714205802.17688-1-hauke@hauke-m.de commit b5ba46b81c2fef00bcf110777fb6d51befa4a23e Author: Alessio Bonfiglio Date: Tue Jul 14 11:19:11 2020 +0200 iwlwifi: Make some Killer Wireless-AC 1550 cards work again Fix the regression introduced by commit c8685937d07f ("iwlwifi: move pu devices to new table") by adding the ids and the configurations of two missing Killer 1550 cards in order to configure and let them work correctly again (following the new table convention). Resolve bug 208141 ("Wireless ac 9560 not working kernel 5.7.2", https://bugzilla.kernel.org/show_bug.cgi?id=208141). Fixes: c8685937d07f ("iwlwifi: move pu devices to new table") Signed-off-by: Alessio Bonfiglio Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200714091911.4442-1-alessio.bonfiglio@mail.polimi.it commit 92f53e2fda8bb9a559ad61d57bfb397ce67ed0ab Author: Mark O'Donovan Date: Sat Jul 11 05:33:24 2020 +0100 ath9k: Fix regression with Atheros 9271 This fix allows ath9k_htc modules to connect to WLAN once again. Fixes: 2bbcaaee1fcb ("ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb") Link: https://bugzilla.kernel.org/show_bug.cgi?id=208251 Signed-off-by: Mark O'Donovan Reported-by: Roman Mamedov Tested-by: Viktor Jägersküpper Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200711043324.8079-1-shiftee@posteo.net commit 89ee72376be23a1029a0c65eff8838c262b01d65 Author: Johannes Thumshirn Date: Thu Jul 16 19:37:23 2020 +0900 zonefs: count pages after truncating the iterator Count pages after possibly truncating the iterator to the maximum zone append size, not before. Signed-off-by: Johannes Thumshirn Signed-off-by: Damien Le Moal commit 01b2651cfb20ba38429cdb47c68f36e56a2d3cb4 Author: Damien Le Moal Date: Mon Jul 20 17:52:52 2020 +0900 zonefs: Fix compilation warning Avoid the compilation warning "Variable 'ret' is reassigned a value before the old one has been used." in zonefs_create_zgroup() by setting ret for the error path only if an error happens. Reported-by: kernel test robot Signed-off-by: Damien Le Moal commit 926234f1b8434c4409aa4c53637aa3362ca07cea Author: Ian Abbott Date: Fri Jul 17 15:52:56 2020 +0100 staging: comedi: addi_apci_1564: check INSN_CONFIG_DIGITAL_TRIG shift The `INSN_CONFIG` comedi instruction with sub-instruction code `INSN_CONFIG_DIGITAL_TRIG` includes a base channel in `data[3]`. This is used as a right shift amount for other bitmask values without being checked. Shift amounts greater than or equal to 32 will result in undefined behavior. Add code to deal with this. Fixes: 1e15687ea472 ("staging: comedi: addi_apci_1564: add Change-of-State interrupt subdevice and required functions") Cc: #3.17+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20200717145257.112660-4-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit fc846e9db67c7e808d77bf9e2ef3d49e3820ce5d Author: Ian Abbott Date: Fri Jul 17 15:52:57 2020 +0100 staging: comedi: addi_apci_1500: check INSN_CONFIG_DIGITAL_TRIG shift The `INSN_CONFIG` comedi instruction with sub-instruction code `INSN_CONFIG_DIGITAL_TRIG` includes a base channel in `data[3]`. This is used as a right shift amount for other bitmask values without being checked. Shift amounts greater than or equal to 32 will result in undefined behavior. Add code to deal with this, adjusting the checks for invalid channels so that enabled channel bits that would have been lost by shifting are also checked for validity. Only channels 0 to 15 are valid. Fixes: a8c66b684efaf ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions") Cc: #4.0+: ef75e14a6c93: staging: comedi: verify array index is correct before using it Cc: #4.0+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20200717145257.112660-5-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 0bd0db42a030b75c20028c7ba6e327b9cb554116 Author: Ian Abbott Date: Fri Jul 17 15:52:55 2020 +0100 staging: comedi: addi_apci_1032: check INSN_CONFIG_DIGITAL_TRIG shift The `INSN_CONFIG` comedi instruction with sub-instruction code `INSN_CONFIG_DIGITAL_TRIG` includes a base channel in `data[3]`. This is used as a right shift amount for other bitmask values without being checked. Shift amounts greater than or equal to 32 will result in undefined behavior. Add code to deal with this. Fixes: 33cdce6293dcc ("staging: comedi: addi_apci_1032: conform to new INSN_CONFIG_DIGITAL_TRIG") Cc: #3.8+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20200717145257.112660-3-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit f07804ec77d77f8a9dcf570a24154e17747bc82f Author: Ian Abbott Date: Fri Jul 17 15:52:54 2020 +0100 staging: comedi: ni_6527: fix INSN_CONFIG_DIGITAL_TRIG support `ni6527_intr_insn_config()` processes `INSN_CONFIG` comedi instructions for the "interrupt" subdevice. When `data[0]` is `INSN_CONFIG_DIGITAL_TRIG` it is configuring the digital trigger. When `data[2]` is `COMEDI_DIGITAL_TRIG_ENABLE_EDGES` it is configuring rising and falling edge detection for the digital trigger, using a base channel number (or shift amount) in `data[3]`, a rising edge bitmask in `data[4]` and falling edge bitmask in `data[5]`. If the base channel number (shift amount) is greater than or equal to the number of channels (24) of the digital input subdevice, there are no changes to the rising and falling edges, so the mask of channels to be changed can be set to 0, otherwise the mask of channels to be changed, and the rising and falling edge bitmasks are shifted by the base channel number before calling `ni6527_set_edge_detection()` to change the appropriate registers. Unfortunately, the code is comparing the base channel (shift amount) to the interrupt subdevice's number of channels (1) instead of the digital input subdevice's number of channels (24). Fix it by comparing to 32 because all shift amounts for an `unsigned int` must be less than that and everything from bit 24 upwards is ignored by `ni6527_set_edge_detection()` anyway. Fixes: 110f9e687c1a8 ("staging: comedi: ni_6527: support INSN_CONFIG_DIGITAL_TRIG") Cc: # 3.17+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20200717145257.112660-2-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit b62e185184e9d210000fcf2af39aac52d73562c8 Merge: 120c8a4939f9 cea7a0449ea3 Author: Greg Kroah-Hartman Date: Mon Jul 20 10:01:58 2020 +0200 Merge tag 'misc-habanalabs-fixes-2020-07-19' of git://people.freedesktop.org/~gabbayo/linux into char-misc-linus Oded writes: This tag contains a single bug fix for 5.8-rc7: - Check that an index is in valid range before using it to access an array. The index is received from the user. This is to prevent a possible out-of-bounds access error. * tag 'misc-habanalabs-fixes-2020-07-19' of git://people.freedesktop.org/~gabbayo/linux: habanalabs: prevent possible out-of-bounds array access commit 120c8a4939f9aac672a84ed9a81ed12b0b005db3 Merge: b279b1fe5799 8614afd689df Author: Greg Kroah-Hartman Date: Mon Jul 20 09:59:53 2020 +0200 Merge tag 'fpga-late-fixes-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-linus Moritz writes: FPGA manager fixes for 5.8 Here are two (late) dfl fixes for the the 5.8 release. Matthew's fix addresses an issue in the reset of a port. Xu'x fix addresses a linter warning. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my fixes branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-late-fixes-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: dfl: fix bug in port reset handshake fpga: dfl: pci: reduce the scope of variable 'ret' commit 19dc36548be2027cb5a491511bc152493c1244bb Author: Alexander A. Klimov Date: Sun Jul 19 13:31:42 2020 +0200 net: ieee802154: adf7242: Replace HTTP links with HTTPS ones Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov Link: https://lore.kernel.org/r/20200719113142.58304-1-grandmaster@al2klimov.de Signed-off-by: Stefan Schmidt commit 4a601da92c2a782e5c022680d476104586b74994 Author: Michael Trimarchi Date: Fri Jul 17 13:33:52 2020 +0530 ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect The current pin muxing scheme muxes GPIO_1 pad for USB_OTG_ID because of which when card is inserted, usb otg is enumerated and the card is never detected. [ 64.492645] cfg80211: failed to load regulatory.db [ 64.492657] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware [ 76.343711] ci_hdrc ci_hdrc.0: EHCI Host Controller [ 76.349742] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 2 [ 76.388862] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00 [ 76.396650] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.08 [ 76.405412] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 76.412763] usb usb2: Product: EHCI Host Controller [ 76.417666] usb usb2: Manufacturer: Linux 5.8.0-rc1-next-20200618 ehci_hcd [ 76.424623] usb usb2: SerialNumber: ci_hdrc.0 [ 76.431755] hub 2-0:1.0: USB hub found [ 76.435862] hub 2-0:1.0: 1 port detected The TRM mentions GPIO_1 pad should be muxed/assigned for card detect and ENET_RX_ER pad for USB_OTG_ID for proper operation. This patch fixes pin muxing as per TRM and is tested on a i.Core 1.5 MX6 DL SOM. [ 22.449165] mmc0: host does not support reading read-only switch, assuming write-enable [ 22.459992] mmc0: new high speed SDHC card at address 0001 [ 22.469725] mmcblk0: mmc0:0001 EB1QT 29.8 GiB [ 22.478856] mmcblk0: p1 p2 Fixes: 6df11287f7c9 ("ARM: dts: imx6q: Add Engicam i.CoreM6 Quad/Dual initial support") Cc: stable@vger.kernel.org Signed-off-by: Michael Trimarchi Signed-off-by: Suniel Mahesh Signed-off-by: Shawn Guo commit d36f260718d83928e6012247a7e1b9791cdb12ff Author: Fabio Estevam Date: Mon Jul 13 11:23:25 2020 -0300 ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2 Commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode") fixed the phy-mode for fec1, but missed to fix it for the fec2 node. Fix fec2 to also use "rgmii-id" as the phy-mode. Cc: Fixes: 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit c696afd331be1acb39206aba53048f2386b781fc Author: Fabio Estevam Date: Mon Jul 13 11:23:24 2020 -0300 ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2 Commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode") fixed the phy-mode for fec1, but missed to fix it for the fec2 node. Fix fec2 to also use "rgmii-id" as the phy-mode. Cc: Fixes: 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 544f287b84959203367cd29e16e772717612fab4 Author: Taehee Yoo Date: Sun Jul 19 12:11:24 2020 +0000 bonding: check error value of register_netdevice() immediately If register_netdevice() is failed, net_device should not be used because variables are uninitialized or freed. So, the routine should be stopped immediately. But, bond_create() doesn't check return value of register_netdevice() immediately. That will result in a panic because of using uninitialized or freed memory. Test commands: modprobe netdev-notifier-error-inject echo -22 > /sys/kernel/debug/notifier-error-inject/netdev/\ actions/NETDEV_REGISTER/error modprobe bonding max_bonds=3 Splat looks like: [ 375.028492][ T193] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] SMP DEBUG_PAGEALLOC PTI [ 375.033207][ T193] CPU: 2 PID: 193 Comm: kworker/2:2 Not tainted 5.8.0-rc4+ #645 [ 375.036068][ T193] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 375.039673][ T193] Workqueue: events linkwatch_event [ 375.041557][ T193] RIP: 0010:dev_activate+0x4a/0x340 [ 375.043381][ T193] Code: 40 a8 04 0f 85 db 00 00 00 8b 83 08 04 00 00 85 c0 0f 84 0d 01 00 00 31 d2 89 d0 48 8d 04 40 48 c1 e0 07 48 03 83 00 04 00 00 <48> 8b 48 10 f6 41 10 01 75 08 f0 80 a1 a0 01 00 00 fd 48 89 48 08 [ 375.050267][ T193] RSP: 0018:ffff9f8facfcfdd8 EFLAGS: 00010202 [ 375.052410][ T193] RAX: 6b6b6b6b6b6b6b6b RBX: ffff9f8fae6ea000 RCX: 0000000000000006 [ 375.055178][ T193] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9f8fae6ea000 [ 375.057762][ T193] RBP: ffff9f8fae6ea000 R08: 0000000000000000 R09: 0000000000000000 [ 375.059810][ T193] R10: 0000000000000001 R11: 0000000000000000 R12: ffff9f8facfcfe08 [ 375.061892][ T193] R13: ffffffff883587e0 R14: 0000000000000000 R15: ffff9f8fae6ea580 [ 375.063931][ T193] FS: 0000000000000000(0000) GS:ffff9f8fbae00000(0000) knlGS:0000000000000000 [ 375.066239][ T193] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 375.067841][ T193] CR2: 00007f2f542167a0 CR3: 000000012cee6002 CR4: 00000000003606e0 [ 375.069657][ T193] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 375.071471][ T193] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 375.073269][ T193] Call Trace: [ 375.074005][ T193] linkwatch_do_dev+0x4d/0x50 [ 375.075052][ T193] __linkwatch_run_queue+0x10b/0x200 [ 375.076244][ T193] linkwatch_event+0x21/0x30 [ 375.077274][ T193] process_one_work+0x252/0x600 [ 375.078379][ T193] ? process_one_work+0x600/0x600 [ 375.079518][ T193] worker_thread+0x3c/0x380 [ 375.080534][ T193] ? process_one_work+0x600/0x600 [ 375.081668][ T193] kthread+0x139/0x150 [ 375.082567][ T193] ? kthread_park+0x90/0x90 [ 375.083567][ T193] ret_from_fork+0x22/0x30 Fixes: e826eafa65c6 ("bonding: Call netif_carrier_off after register_netdevice") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 7c6719a1aaca51ffd7cdf3905e70aa8313f6ef26 Author: Russell King Date: Sun Jul 19 12:00:40 2020 +0100 arm64: dts: clearfog-gt-8k: fix switch link configuration The commit below caused a regression for clearfog-gt-8k, where the link between the switch and the host does not come up. Investigation revealed two issues: - MV88E6xxx DSA no longer allows an in-band link to come up as the link is programmed to be forced down. Commit "net: dsa: mv88e6xxx: fix in-band AN link establishment" addresses this. - The dts configured dissimilar link modes at each end of the host to switch link; the host was configured using a fixed link (so has no in-band status) and the switch was configured to expect in-band status. With both issues fixed, the regression is resolved. Fixes: 34b5e6a33c1a ("net: dsa: mv88e6xxx: Configure MAC when using fixed link") Reported-by: Martin Rowe Signed-off-by: Russell King Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit fad58190c0ffd72c394722928cd3e919b6e18357 Author: Russell King Date: Sun Jul 19 12:00:35 2020 +0100 net: dsa: mv88e6xxx: fix in-band AN link establishment If in-band negotiation or fixed-link modes are specified for a DSA port, the DSA code will force the link down during initialisation. For fixed-link mode, this is fine, as phylink will manage the link state. However, for in-band mode, phylink expects the PCS to detect link, which will not happen if the link is forced down. There is a related issue that in in-band mode, the link could come up while we are making configuration changes, so we should force the link down prior to reconfiguring the interface mode. This patch addresses both issues. Fixes: 3be98b2d5fbc ("net: dsa: Down cpu/dsa ports phylink will control") Signed-off-by: Russell King Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit f3f90c6db188d437add55aaffadd5ad5bcb8cda6 Author: Qiang Yu Date: Sun Jul 19 15:30:50 2020 +0800 drm/lima: fix wait pp reset timeout PP bcast is marked as doing async reset after job is done. When resume after suspend, each PP is reset individually, so no need to reset in PP bcast resume. But I forgot to clear the PP bcast async reset mark so call into async wait before job run and gets timeout. Closes: https://gitlab.freedesktop.org/lima/linux/-/issues/34 Fixes: 3446d7e9883d ("drm/lima: add resume/suspend callback for each ip") Reviewed-by: Erico Nunes Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200719073050.776962-1-yuq825@gmail.com commit 5714ee50bb4375bd586858ad800b1d9772847452 Author: Kevin Buettner Date: Sat Jul 18 00:20:03 2020 -0700 copy_xstate_to_kernel: Fix typo which caused GDB regression This fixes a regression encountered while running the gdb.base/corefile.exp test in GDB's test suite. In my testing, the typo prevented the sw_reserved field of struct fxregs_state from being output to the kernel XSAVES area. Thus the correct mask corresponding to XCR0 was not present in the core file for GDB to interrogate, resulting in the following behavior: [kev@f32-1 gdb]$ ./gdb -q testsuite/outputs/gdb.base/corefile/corefile testsuite/outputs/gdb.base/corefile/corefile.core Reading symbols from testsuite/outputs/gdb.base/corefile/corefile... [New LWP 232880] warning: Unexpected size of section `.reg-xstate/232880' in core file. With the typo fixed, the test works again as expected. Signed-off-by: Kevin Buettner Fixes: 9e4636545933 ("copy_xstate_to_kernel(): don't leave parts of destination uninitialized") Cc: Al Viro Cc: Dave Airlie Signed-off-by: Linus Torvalds commit ba47d845d715a010f7b51f6f89bae32845e6acb7 Author: Linus Torvalds Date: Sun Jul 19 15:41:18 2020 -0700 Linux 5.8-rc6 commit a463fa2cda5641c12da76d115a3490aee01d0377 Merge: 9b8737788af6 1ad240583354 Author: David S. Miller Date: Sun Jul 19 15:30:23 2020 -0700 Merge branch 'net-smc-fixes' Karsten Graul says: ==================== net/smc: fixes 2020-07-16 Please apply the following patch series for smc to netdev's net tree. The patches address problems caused by late or unexpected link layer control packets, dma sync calls for unmapped memory, freed buffers that are not removed from the buffer list and a possible null pointer access that results in a crash. v1->v2: in patch 4, improve patch description and correct the comment for the new mutex ==================== Signed-off-by: David S. Miller commit 1ad24058335427d046b2e5666bcd15a62ad9e242 Author: Karsten Graul Date: Sat Jul 18 15:06:18 2020 +0200 net/smc: fix restoring of fallback changes When a listen socket is closed then all non-accepted sockets in its accept queue are to be released. Inside __smc_release() the helper smc_restore_fallback_changes() restores the changes done to the socket without to check if the clcsocket has a file set. This can result in a crash. Fix this by checking the file pointer first. Reviewed-by: Ursula Braun Fixes: f536dffc0b79 ("net/smc: fix closing of fallback SMC sockets") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit fd7f3a746582e8b17c48d4d8087d38c91f59ba67 Author: Karsten Graul Date: Sat Jul 18 15:06:17 2020 +0200 net/smc: remove freed buffer from list Two buffers are allocated for each SMC connection. Each buffer is added to a buffer list after creation. When the second buffer allocation fails, the first buffer is freed but not deleted from the list. This might result in crashes when another connection picks up the freed buffer later and starts to work with it. Reviewed-by: Ursula Braun Fixes: 6511aad3f039 ("net/smc: change smc_buf_free function parameters") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 741a49a4dc5fd7e61b37b259dde915083c2c5327 Author: Karsten Graul Date: Sat Jul 18 15:06:16 2020 +0200 net/smc: do not call dma sync for unmapped memory The dma related ...sync_sg... functions check the link state before the dma function is actually called. But the check in smc_link_usable() allows links in ACTIVATING state which are not yet mapped to dma memory. Under high load it may happen that the sync_sg functions are called for such a link which results in an debug output like DMA-API: mlx5_core 0002:00:00.0: device driver tries to sync DMA memory it has not allocated [device address=0x0000000103370000] [size=65536 bytes] To fix that introduce a helper to check for the link state ACTIVE and use it where appropriate. And move the link state update to ACTIVATING to the end of smcr_link_init() when most initial setup is done. Reviewed-by: Ursula Braun Fixes: d854fcbfaeda ("net/smc: add new link state and related helpers") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit b9979c2e837926c87358024a95c67988477909b1 Author: Karsten Graul Date: Sat Jul 18 15:06:15 2020 +0200 net/smc: fix handling of delete link requests As smc client the delete link requests are assigned to the flow when _any_ flow is active. This may break other flows that do not expect delete link requests during their handling. Fix that by assigning the request only when an add link flow is active. With that fix the code for smc client and smc server is the same, so remove the separate handling. Reviewed-by: Ursula Braun Fixes: 9ec6bf19ec8b ("net/smc: llc_del_link_work and use the LLC flow for delete link") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit c48254fa48e5bad589fbbf1578dae960cedcafcf Author: Karsten Graul Date: Sat Jul 18 15:06:14 2020 +0200 net/smc: move add link processing for new device into llc layer When a new ib device is up smc will send an add link invitation to the peer if needed. This is currently done with rudimentary flow control. Under high workload these add link invitations can disturb other llc flows because they arrive unexpected. Fix this by integrating the invitations into the normal llc event flow and handle them as a flow. While at it, check for already assigned requests in the flow before the new add link request is assigned. Reviewed-by: Ursula Braun Fixes: 1f90a05d9ff9 ("net/smc: add smcr_port_add() and smcr_link_up() processing") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 2ff0867851a21ea1ccb0c275ae1df2fe7787e1b9 Author: Karsten Graul Date: Sat Jul 18 15:06:13 2020 +0200 net/smc: drop out-of-flow llc response messages To be save from unexpected or late llc response messages check if the arrived message fits to the current flow type and drop out-of-flow messages. And drop it when there is already a response assigned to the flow. Reviewed-by: Ursula Braun Fixes: ef79d439cd12 ("net/smc: process llc responses in tasklet context") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 63673597cca93ef6fa12414933da01d5806547af Author: Karsten Graul Date: Sat Jul 18 15:06:12 2020 +0200 net/smc: protect smc ib device initialization Before an smc ib device is used the first time for an smc link it is lazily initialized. When there are 2 active link groups and a new ib device is brought online then it might happen that 2 link creations run in parallel and enter smc_ib_setup_per_ibdev(). Both allocate new send and receive completion queues on the device, but only one set of them keeps assigned and the other leaks. Fix that by protecting the setup and cleanup code using a mutex. Reviewed-by: Ursula Braun Fixes: f3c1deddb21c ("net/smc: separate function for link initialization") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 7df8bcb56053173e5e5c0e566391fa601e3e4778 Author: Karsten Graul Date: Sat Jul 18 15:06:11 2020 +0200 net/smc: fix link lookup for new rdma connections For new rdma connections the SMC server assigns the link and sends the link data in the clc accept message. To match the correct link use not only the qp_num but also the gid and the mac of the links. If there are equal qp_nums for different links the wrong link would be chosen. Reviewed-by: Ursula Braun Fixes: 0fb0b02bd6fd ("net/smc: adapt SMC client code to use the LLC flow") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 68fd8942038f30dbb64a594dc15d9948289de42a Author: Karsten Graul Date: Sat Jul 18 15:06:10 2020 +0200 net/smc: clear link during SMC client link down processing In a link-down condition we notify the SMC server and expect that the server will finally trigger the link clear processing on the client side. This could fail when anything along this notification path goes wrong. Clear the link as part of SMC client link-down processing to prevent dangling links. Reviewed-by: Ursula Braun Fixes: 541afa10c126 ("net/smc: add smcr_port_err() and smcr_link_down() processing") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit a35fffbf98189ba8359f19073286b2ea816255c5 Author: Karsten Graul Date: Sat Jul 18 15:06:09 2020 +0200 net/smc: handle unexpected response types for confirm link A delete link could arrive during confirm link processing. Handle this situation directly in smc_llc_srv_conf_link() rather than using the logic in smc_llc_wait() to avoid the unexpected message handling there. Reviewed-by: Ursula Braun Fixes: 1551c95b6124 ("net/smc: final part of add link processing as SMC server") Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 92188b41f1394d5e4399fcb28c13a2933f255255 Merge: efb9666e900b 25d4e7f513d4 Author: Linus Torvalds Date: Sun Jul 19 12:35:07 2020 -0700 Merge tag 'perf-tools-fixes-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into master Pull perf tooling fixes from Arnaldo Carvalho de Melo: - Update hashmap.h from libbpf and kvm.h from x86's kernel UAPI. - Set opt->set in libsubcmd's OPT_CALLBACK_SET(). This fixes 'perf record --switch-output-event event-name' usage" * tag 'perf-tools-fixes-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: tools arch kvm: Sync kvm headers with the kernel sources perf tools: Sync hashmap.h with libbpf's libsubcmd: Fix OPT_CALLBACK_SET() commit efb9666e900b6f8f079adb2ab18a7be266434cd3 Merge: 66e4b63624fc da05b143a308 Author: Linus Torvalds Date: Sun Jul 19 12:16:09 2020 -0700 Merge tag 'x86-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull x86 fixes from Thomas Gleixner: "A pile of fixes for x86: - Fix the I/O bitmap invalidation on XEN PV, which was overlooked in the recent ioperm/iopl rework. This caused the TSS and XEN's I/O bitmap to get out of sync. - Use the proper vectors for HYPERV. - Make disabling of stack protector for the entry code work with GCC builds which enable stack protector by default. Removing the option is not sufficient, it needs an explicit -fno-stack-protector to shut it off. - Mark check_user_regs() noinstr as it is called from noinstr code. The missing annotation causes it to be placed in the text section which makes it instrumentable. - Add the missing interrupt disable in exc_alignment_check() - Fixup a XEN_PV build dependency in the 32bit entry code - A few fixes to make the Clang integrated assembler happy - Move EFI stub build to the right place for out of tree builds - Make prepare_exit_to_usermode() static. It's not longer called from ASM code" * tag 'x86-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Don't add the EFI stub to targets x86/entry: Actually disable stack protector x86/ioperm: Fix io bitmap invalidation on Xen PV x86: math-emu: Fix up 'cmp' insn for clang ias x86/entry: Fix vectors to IDTENTRY_SYSVEC for CONFIG_HYPERV x86/entry: Add compatibility with IAS x86/entry/common: Make prepare_exit_to_usermode() static x86/entry: Mark check_user_regs() noinstr x86/traps: Disable interrupts in exc_aligment_check() x86/entry/32: Fix XEN_PV build dependency commit 66e4b63624fcfa47f4d4e0d451f22a8f67902426 Merge: 43768f7ce099 e2a71bdea816 Author: Linus Torvalds Date: Sun Jul 19 12:06:08 2020 -0700 Merge tag 'timers-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull timer fixes from Thomas Gleixner: "Two fixes for the timer wheel: - A timer which is already expired at enqueue time can set the base->next_expiry value backwards. As a consequence base->clk can be set back as well. This can lead to timers expiring early. Add a sanity check to prevent this. - When a timer is queued with an expiry time beyond the wheel capacity then it should be queued in the bucket of the last wheel level which is expiring last. The code adjusted the expiry time to the maximum wheel capacity, which is only correct when the wheel clock is 0. Aside of that the check whether the delta is larger than wheel capacity does not check the delta, it checks the expiry value itself. As a result timers can expire at random. Fix this by checking the right variable and adjust expiry time so it becomes base->clock plus capacity which places it into the outmost bucket in the last wheel level" * tag 'timers-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timer: Fix wheel index calculation on last level timer: Prevent base->clk from moving backward commit 43768f7ce0996590cb9588de71f026f30fb35581 Merge: 9413cd7792dc 01cfcde9c26d Author: Linus Torvalds Date: Sun Jul 19 11:55:24 2020 -0700 Merge tag 'sched-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull scheduler fixes from Thomas Gleixner: "A set of scheduler fixes: - Plug a load average accounting race which was introduced with a recent optimization casing load average to show bogus numbers. - Fix the rseq CPU id initialization for new tasks. sched_fork() does not update the rseq CPU id so the id is the stale id of the parent task, which can cause user space data corruption. - Handle a 0 return value of task_h_load() correctly in the load balancer, which does not decrease imbalance and therefore pulls until the maximum number of loops is reached, which might be all tasks just created by a fork bomb" * tag 'sched-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: handle case of task_h_load() returning 0 sched: Fix unreliable rseq cpu_id for new tasks sched: Fix loadavg accounting race commit 9413cd7792dc03608ec9b1f1f5c74fc54e714ed3 Merge: ce20d7bf6e00 baedb87d1b53 Author: Linus Torvalds Date: Sun Jul 19 11:53:08 2020 -0700 Merge tag 'irq-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master Pull irq fixes from Thomas Gleixner: "Two fixes for the interrupt subsystem: - Make the handling of the firmware node consistent and do not free the node after the domain has been created successfully. The core code stores a pointer to it which can lead to a use after free or double free. This used to "work" because the pointer was not stored when the initial code was written, but at some point later it was required to store it. Of course nobody noticed that the existing users break that way. - Handle affinity setting on inactive interrupts correctly when hierarchical irq domains are enabled. When interrupts are inactive with the modern hierarchical irqdomain design, the interrupt chips are not necessarily in a state where affinity changes can be handled. The legacy irq chip design allowed this because interrupts are immediately fully initialized at allocation time. X86 has a hacky workaround for this, but other implementations do not. This cased malfunction on GIC-V3. Instead of playing whack a mole to find all affected drivers, change the core code to store the requested affinity setting and then establish it when the interrupt is allocated, which makes the X86 hack go away" * tag 'irq-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq/affinity: Handle affinity setting on inactive interrupts correctly irqdomain/treewide: Keep firmware node unconditionally allocated commit ce20d7bf6e00997496d8d5322b1253584d2a0908 Merge: 8c18fc634456 c7300cdf8f68 Author: Linus Torvalds Date: Sun Jul 19 11:46:32 2020 -0700 Merge tag 'usb-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb into master Pull USB fixes from Greg KH: "Here are a few small USB fixes, and one thunderbolt fix, for 5.8-rc6. Nothing huge in here, just the normal collection of gadget, dwc2/3, serial, and other minor USB driver fixes and id additions. Full details are in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: iuu_phoenix: fix memory corruption USB: c67x00: fix use after free in c67x00_giveback_urb usb: gadget: function: fix missing spinlock in f_uac1_legacy usb: gadget: udc: atmel: fix uninitialized read in debug printk usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable() usb: dwc2: Fix shutdown callback in platform usb: cdns3: trace: fix some endian issues usb: cdns3: ep0: fix some endian issues usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init() usb: gadget: fix langid kernel-doc warning in usbstring.c usb: dwc3: pci: add support for the Intel Jasper Lake usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant usb: chipidea: core: add wakeup support for extcon USB: serial: option: add Quectel EG95 LTE modem thunderbolt: Fix path indices used in USB3 tunnel discovery USB: serial: ch341: add new Product ID for CH340 USB: serial: option: add GosunCn GM500 series USB: serial: cypress_m8: enable Simply Automated UPB PIM commit 8c18fc6344568bdc131436be0345d82da512bfef Merge: f932d58abc38 d9765e41d8e9 Author: Linus Torvalds Date: Sun Jul 19 11:28:23 2020 -0700 Merge tag 'dma-mapping-5.8-6' of git://git.infradead.org/users/hch/dma-mapping into master Pull dma-mapping fixes from Christoph Hellwig: "Ensure we always have fully addressable memory in the dma coherent pool (Nicolas Saenz Julienne)" * tag 'dma-mapping-5.8-6' of git://git.infradead.org/users/hch/dma-mapping: dma-pool: do not allocate pool memory from CMA dma-pool: make sure atomic pool suits device dma-pool: introduce dma_guess_pool() dma-pool: get rid of dma_in_atomic_pool() dma-direct: provide function to check physical memory area validity commit 74d6a5d5662975aed7f25952f62efbb6f6dadd29 Author: Wang Hai Date: Fri Jun 12 17:08:33 2020 +0800 9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work p9_read_work and p9_fd_cancelled may be called concurrently. In some cases, req->req_list may be deleted by both p9_read_work and p9_fd_cancelled. We can fix it by ignoring replies associated with a cancelled request and ignoring cancelled request if message has been received before lock. Link: http://lkml.kernel.org/r/20200612090833.36149-1-wanghai38@huawei.com Fixes: 60ff779c4abb ("9p: client: remove unused code and any reference to "cancelled" function") Cc: # v3.12+ Reported-by: syzbot+77a25acfa0382e06ab23@syzkaller.appspotmail.com Signed-off-by: Wang Hai Signed-off-by: Dominique Martinet commit a39c46067c845a8a2d7144836e9468b7f072343e Author: Christoph Hellwig Date: Fri Jul 10 10:57:22 2020 +0200 net/9p: validate fds in p9_fd_open p9_fd_open just fgets file descriptors passed in from userspace, but doesn't verify that they are valid for read or writing. This gets cought down in the VFS when actually attempting a read or write, but a new warning added in linux-next upsets syzcaller. Fix this by just verifying the fds early on. Link: http://lkml.kernel.org/r/20200710085722.435850-1-hch@lst.de Reported-by: syzbot+e6f77e16ff68b2434a2c@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig [Dominique: amend goto as per Doug Nazar's review] Signed-off-by: Dominique Martinet commit 0d6db85131e014c128e57649793aff5aa96e065f Author: Mauro Carvalho Chehab Date: Sun Jul 19 13:29:18 2020 +0200 Revert "media: atomisp: keep the ISP powered on when setting it" changeset d0213061a501 ("media: atomisp: fix mask and shift operation on ISPSSPM0") solved the existing issue with the IUNIT power on code. So, the driver can now use the right code again. This reverts commit 95d1f398c4dc3f55e9007c89452ccc16301205fc. Signed-off-by: Mauro Carvalho Chehab commit 23988c9704f0e341d2e860476430aaf378efd129 Author: Colin Ian King Date: Thu Jul 16 15:51:38 2020 +0100 media: atomisp: fix mask and shift operation on ISPSSPM0 Currently the check on bits 25:24 on ISPSSPM0 is always 0 because the mask and shift operations are incorrect. Fix this by shifting by MRFLD_ISPSSPM0_ISPSSS_OFFSET (24 bits right) and then masking with RFLD_ISPSSPM0_ISPSSC_MASK (0x03) to get the appropriate 2 bits to check. Addresses-Coverity: ("Operands don't affect result") Fixes: 0f441fd70b1e ("media: atomisp: simplify the power down/up code") Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit da05b143a308bd6a7a444401f9732678ae63fc70 Author: Arvind Sankar Date: Tue Jul 14 23:26:31 2020 -0400 x86/boot: Don't add the EFI stub to targets vmlinux-objs-y is added to targets, which currently means that the EFI stub gets added to the targets as well. It shouldn't be added since it is built elsewhere. This confuses Makefile.build which interprets the EFI stub as a target $(obj)/$(objtree)/drivers/firmware/efi/libstub/lib.a and will create drivers/firmware/efi/libstub/ underneath arch/x86/boot/compressed, to hold this supposed target, if building out-of-tree. [0] Fix this by pulling the stub out of vmlinux-objs-y into efi-obj-y. [0] See scripts/Makefile.build near the end: # Create directories for object files if they do not exist Signed-off-by: Arvind Sankar Signed-off-by: Thomas Gleixner Reviewed-by: Masahiro Yamada Acked-by: Ard Biesheuvel Link: https://lkml.kernel.org/r/20200715032631.1562882-1-nivedita@alum.mit.edu commit 58ac3154b83938515129c20aa76d456a4c9202a8 Author: Kees Cook Date: Fri Jun 26 13:34:25 2020 -0700 x86/entry: Actually disable stack protector Some builds of GCC enable stack protector by default. Simply removing the arguments is not sufficient to disable stack protector, as the stack protector for those GCC builds must be explicitly disabled. Remove the argument removals and add -fno-stack-protector. Additionally include missed x32 argument updates, and adjust whitespace for readability. Fixes: 20355e5f73a7 ("x86/entry: Exclude low level entry code from sanitizing") Signed-off-by: Kees Cook Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/202006261333.585319CA6B@keescook commit 85ebb8eb12e6fb1abdff774d9cfc926d2dc3246d Author: Mauro Carvalho Chehab Date: Sun Jul 19 07:11:00 2020 +0200 media: atomisp: move system_local consts into a C file Instead of declaring all those consts everywhere when the headers are included, just place them on a single place. This change shuts up lots of warnings when built with W=1: In file included from drivers/staging/media/atomisp/pci/ia_css_acc_types.h:23, from drivers/staging/media/atomisp/pci/ia_css.h:26, from drivers/staging/media/atomisp/pci/atomisp_compat_css20.h:24, from drivers/staging/media/atomisp/pci/atomisp_compat.h:22, from drivers/staging/media/atomisp/pci/atomisp_drvfs.c:23: ./drivers/staging/media/atomisp//pci/system_local.h:193:26: warning: ‘STREAM2MMIO_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 193 | static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = { | ^~~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:186:26: warning: ‘PIXELGEN_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 186 | static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = { | ^~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:179:26: warning: ‘CSI_RX_BE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 179 | static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:172:26: warning: ‘CSI_RX_FE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 172 | static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:165:26: warning: ‘ISYS_IRQ_BASE’ defined but not used [-Wunused-const-variable=] 165 | static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:158:26: warning: ‘IBUF_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 158 | static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:153:26: warning: ‘RX_BASE’ defined but not used [-Wunused-const-variable=] 153 | static const hrt_address RX_BASE[N_RX_ID] = { | ^~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:138:26: warning: ‘INPUT_SYSTEM_BASE’ defined but not used [-Wunused-const-variable=] 138 | static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:130:26: warning: ‘INPUT_FORMATTER_BASE’ defined but not used [-Wunused-const-variable=] 130 | static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = { | ^~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:125:26: warning: ‘TIMED_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 125 | static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = { | ^~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:120:26: warning: ‘GPIO_BASE’ defined but not used [-Wunused-const-variable=] 120 | static const hrt_address GPIO_BASE[N_GPIO_ID] = { | ^~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:116:26: warning: ‘GP_TIMER_BASE’ defined but not used [-Wunused-const-variable=] 116 | static const hrt_address GP_TIMER_BASE = | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:109:26: warning: ‘GP_DEVICE_BASE’ defined but not used [-Wunused-const-variable=] 109 | static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:96:26: warning: ‘FIFO_MONITOR_BASE’ defined but not used [-Wunused-const-variable=] 96 | static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:90:26: warning: ‘GDC_BASE’ defined but not used [-Wunused-const-variable=] 90 | static const hrt_address GDC_BASE[N_GDC_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:78:26: warning: ‘IRQ_BASE’ defined but not used [-Wunused-const-variable=] 78 | static const hrt_address IRQ_BASE[N_IRQ_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:73:26: warning: ‘ISYS2401_DMA_BASE’ defined but not used [-Wunused-const-variable=] 73 | static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:69:26: warning: ‘DMA_BASE’ defined but not used [-Wunused-const-variable=] 69 | static const hrt_address DMA_BASE[N_DMA_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:63:26: warning: ‘MMU_BASE’ defined but not used [-Wunused-const-variable=] 63 | static const hrt_address MMU_BASE[N_MMU_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:54:26: warning: ‘SP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 54 | static const hrt_address SP_DMEM_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:50:26: warning: ‘SP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 50 | static const hrt_address SP_CTRL_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:45:26: warning: ‘ISP_BAMEM_BASE’ defined but not used [-Wunused-const-variable=] 45 | static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:41:26: warning: ‘ISP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 41 | static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:37:26: warning: ‘ISP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 37 | static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ In file included from drivers/staging/media/atomisp/pci/ia_css_acc_types.h:23, from drivers/staging/media/atomisp/pci/ia_css.h:26, from drivers/staging/media/atomisp/pci/atomisp_file.c:27: ./drivers/staging/media/atomisp//pci/system_local.h:193:26: warning: ‘STREAM2MMIO_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 193 | static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = { | ^~~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:186:26: warning: ‘PIXELGEN_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 186 | static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = { | ^~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:179:26: warning: ‘CSI_RX_BE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 179 | static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:172:26: warning: ‘CSI_RX_FE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 172 | static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:165:26: warning: ‘ISYS_IRQ_BASE’ defined but not used [-Wunused-const-variable=] 165 | static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:158:26: warning: ‘IBUF_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 158 | static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:153:26: warning: ‘RX_BASE’ defined but not used [-Wunused-const-variable=] 153 | static const hrt_address RX_BASE[N_RX_ID] = { | ^~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:138:26: warning: ‘INPUT_SYSTEM_BASE’ defined but not used [-Wunused-const-variable=] 138 | static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:130:26: warning: ‘INPUT_FORMATTER_BASE’ defined but not used [-Wunused-const-variable=] 130 | static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = { | ^~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:125:26: warning: ‘TIMED_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 125 | static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = { | ^~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:120:26: warning: ‘GPIO_BASE’ defined but not used [-Wunused-const-variable=] 120 | static const hrt_address GPIO_BASE[N_GPIO_ID] = { | ^~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:116:26: warning: ‘GP_TIMER_BASE’ defined but not used [-Wunused-const-variable=] 116 | static const hrt_address GP_TIMER_BASE = | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:109:26: warning: ‘GP_DEVICE_BASE’ defined but not used [-Wunused-const-variable=] 109 | static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:96:26: warning: ‘FIFO_MONITOR_BASE’ defined but not used [-Wunused-const-variable=] 96 | static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:90:26: warning: ‘GDC_BASE’ defined but not used [-Wunused-const-variable=] 90 | static const hrt_address GDC_BASE[N_GDC_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:78:26: warning: ‘IRQ_BASE’ defined but not used [-Wunused-const-variable=] 78 | static const hrt_address IRQ_BASE[N_IRQ_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:73:26: warning: ‘ISYS2401_DMA_BASE’ defined but not used [-Wunused-const-variable=] 73 | static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:69:26: warning: ‘DMA_BASE’ defined but not used [-Wunused-const-variable=] 69 | static const hrt_address DMA_BASE[N_DMA_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:63:26: warning: ‘MMU_BASE’ defined but not used [-Wunused-const-variable=] 63 | static const hrt_address MMU_BASE[N_MMU_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:54:26: warning: ‘SP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 54 | static const hrt_address SP_DMEM_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:50:26: warning: ‘SP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 50 | static const hrt_address SP_CTRL_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:45:26: warning: ‘ISP_BAMEM_BASE’ defined but not used [-Wunused-const-variable=] 45 | static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:41:26: warning: ‘ISP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 41 | static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:37:26: warning: ‘ISP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 37 | static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ In file included from ./drivers/staging/media/atomisp//pci/ia_css_acc_types.h:23, from ./drivers/staging/media/atomisp//pci/ia_css_pipe_public.h:29, from drivers/staging/media/atomisp/pci/sh_css_legacy.h:23, from drivers/staging/media/atomisp/pci/atomisp_internal.h:34, from drivers/staging/media/atomisp/pci/atomisp_cmd.h:30, from drivers/staging/media/atomisp/pci/atomisp_csi2.c:21: ./drivers/staging/media/atomisp//pci/system_local.h:193:26: warning: ‘STREAM2MMIO_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 193 | static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = { | ^~~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:186:26: warning: ‘PIXELGEN_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 186 | static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = { | ^~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:179:26: warning: ‘CSI_RX_BE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 179 | static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:172:26: warning: ‘CSI_RX_FE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 172 | static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:165:26: warning: ‘ISYS_IRQ_BASE’ defined but not used [-Wunused-const-variable=] 165 | static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:158:26: warning: ‘IBUF_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 158 | static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:153:26: warning: ‘RX_BASE’ defined but not used [-Wunused-const-variable=] 153 | static const hrt_address RX_BASE[N_RX_ID] = { | ^~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:138:26: warning: ‘INPUT_SYSTEM_BASE’ defined but not used [-Wunused-const-variable=] 138 | static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:130:26: warning: ‘INPUT_FORMATTER_BASE’ defined but not used [-Wunused-const-variable=] 130 | static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = { | ^~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:125:26: warning: ‘TIMED_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 125 | static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = { | ^~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:120:26: warning: ‘GPIO_BASE’ defined but not used [-Wunused-const-variable=] 120 | static const hrt_address GPIO_BASE[N_GPIO_ID] = { | ^~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:116:26: warning: ‘GP_TIMER_BASE’ defined but not used [-Wunused-const-variable=] 116 | static const hrt_address GP_TIMER_BASE = | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:109:26: warning: ‘GP_DEVICE_BASE’ defined but not used [-Wunused-const-variable=] 109 | static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:96:26: warning: ‘FIFO_MONITOR_BASE’ defined but not used [-Wunused-const-variable=] 96 | static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:90:26: warning: ‘GDC_BASE’ defined but not used [-Wunused-const-variable=] 90 | static const hrt_address GDC_BASE[N_GDC_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:78:26: warning: ‘IRQ_BASE’ defined but not used [-Wunused-const-variable=] 78 | static const hrt_address IRQ_BASE[N_IRQ_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:73:26: warning: ‘ISYS2401_DMA_BASE’ defined but not used [-Wunused-const-variable=] 73 | static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:69:26: warning: ‘DMA_BASE’ defined but not used [-Wunused-const-variable=] 69 | static const hrt_address DMA_BASE[N_DMA_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:63:26: warning: ‘MMU_BASE’ defined but not used [-Wunused-const-variable=] 63 | static const hrt_address MMU_BASE[N_MMU_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:54:26: warning: ‘SP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 54 | static const hrt_address SP_DMEM_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:50:26: warning: ‘SP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 50 | static const hrt_address SP_CTRL_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:45:26: warning: ‘ISP_BAMEM_BASE’ defined but not used [-Wunused-const-variable=] 45 | static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:41:26: warning: ‘ISP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 41 | static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:37:26: warning: ‘ISP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 37 | static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ In file included from ./drivers/staging/media/atomisp//pci/ia_css_acc_types.h:23, from ./drivers/staging/media/atomisp//pci/ia_css_pipe_public.h:29, from drivers/staging/media/atomisp/pci/sh_css_legacy.h:23, from drivers/staging/media/atomisp/pci/atomisp_internal.h:34, from drivers/staging/media/atomisp/pci/atomisp_acc.h:23, from drivers/staging/media/atomisp/pci/atomisp_acc.c:29: ./drivers/staging/media/atomisp//pci/system_local.h:193:26: warning: ‘STREAM2MMIO_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 193 | static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = { | ^~~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:186:26: warning: ‘PIXELGEN_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 186 | static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = { | ^~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:179:26: warning: ‘CSI_RX_BE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 179 | static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:172:26: warning: ‘CSI_RX_FE_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 172 | static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = { | ^~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:165:26: warning: ‘ISYS_IRQ_BASE’ defined but not used [-Wunused-const-variable=] 165 | static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:158:26: warning: ‘IBUF_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 158 | static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:153:26: warning: ‘RX_BASE’ defined but not used [-Wunused-const-variable=] 153 | static const hrt_address RX_BASE[N_RX_ID] = { | ^~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:138:26: warning: ‘INPUT_SYSTEM_BASE’ defined but not used [-Wunused-const-variable=] 138 | static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:130:26: warning: ‘INPUT_FORMATTER_BASE’ defined but not used [-Wunused-const-variable=] 130 | static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = { | ^~~~~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:125:26: warning: ‘TIMED_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 125 | static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = { | ^~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:120:26: warning: ‘GPIO_BASE’ defined but not used [-Wunused-const-variable=] 120 | static const hrt_address GPIO_BASE[N_GPIO_ID] = { | ^~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:116:26: warning: ‘GP_TIMER_BASE’ defined but not used [-Wunused-const-variable=] 116 | static const hrt_address GP_TIMER_BASE = | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:109:26: warning: ‘GP_DEVICE_BASE’ defined but not used [-Wunused-const-variable=] 109 | static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:96:26: warning: ‘FIFO_MONITOR_BASE’ defined but not used [-Wunused-const-variable=] 96 | static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:90:26: warning: ‘GDC_BASE’ defined but not used [-Wunused-const-variable=] 90 | static const hrt_address GDC_BASE[N_GDC_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:78:26: warning: ‘IRQ_BASE’ defined but not used [-Wunused-const-variable=] 78 | static const hrt_address IRQ_BASE[N_IRQ_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:73:26: warning: ‘ISYS2401_DMA_BASE’ defined but not used [-Wunused-const-variable=] 73 | static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = { | ^~~~~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:69:26: warning: ‘DMA_BASE’ defined but not used [-Wunused-const-variable=] 69 | static const hrt_address DMA_BASE[N_DMA_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:63:26: warning: ‘MMU_BASE’ defined but not used [-Wunused-const-variable=] 63 | static const hrt_address MMU_BASE[N_MMU_ID] = { | ^~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:54:26: warning: ‘SP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 54 | static const hrt_address SP_DMEM_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:50:26: warning: ‘SP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 50 | static const hrt_address SP_CTRL_BASE[N_SP_ID] = { | ^~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:45:26: warning: ‘ISP_BAMEM_BASE’ defined but not used [-Wunused-const-variable=] 45 | static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = { | ^~~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:41:26: warning: ‘ISP_DMEM_BASE’ defined but not used [-Wunused-const-variable=] 41 | static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ ./drivers/staging/media/atomisp//pci/system_local.h:37:26: warning: ‘ISP_CTRL_BASE’ defined but not used [-Wunused-const-variable=] 37 | static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = { | ^~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab commit 08b2bcc665eac1d53bc1394f08b0bdd3440a57cb Author: Mauro Carvalho Chehab Date: Sat Jul 18 09:51:14 2020 +0200 media: atomisp: get rid of version-specific system_local.h After removing the unused 32-bits data, the isp2401_system_local.h now contains everything that it is needed, either by isp2401 or by isp2400. So, remove code duplication. Signed-off-by: Mauro Carvalho Chehab commit 4b28ded7634cbfc37c224ae20423924e43580f3b Author: Mauro Carvalho Chehab Date: Sat Jul 18 10:26:26 2020 +0200 media: atomisp: move global stuff into a common header Right now, there are two versions of system_global.h headers. Both share a lot of common code. There are some ISP2401 specific types on one of the headers, but it doesn't conflict with the ISP2400 ones. Also, the common code is identical. So, remove code duplication by moving such code into a common header. Signed-off-by: Mauro Carvalho Chehab commit a6154805d0735bdd9149a2f44bb7433f3ef37ff9 Author: Mauro Carvalho Chehab Date: Sat Jul 18 09:30:56 2020 +0200 media: atomisp: remove non-used 32-bits consts at system_local There is an abstraction at the code in order to support 32 or 64 bits address/data length. However, for all Atom chipsets supported by this version, the size is fixed. So, cleanup the mess, removing the uused code and placing the data sizes on a single place. The end goal is to completely remove those local/global headers, replacing them by some ISP-version dependent struct, in order for the driver to decide what version it would need in runtime. Signed-off-by: Mauro Carvalho Chehab commit ecf1b4ca97117201c5e41b0e8ac6cb3c9a49cd57 Author: Mauro Carvalho Chehab Date: Sat Jul 18 09:18:10 2020 +0200 media: atomisp: get rid of some unused static vars There are several static vars declared inside the system local headers. This causes lots of warnings when W=1. Remove the unused ones. Signed-off-by: Mauro Carvalho Chehab commit ac8284569e9746c474102aaa1618c40b225a698d Author: Dan Carpenter Date: Tue Jul 14 12:55:29 2020 +0200 media: atomisp: Fix error code in ov5693_probe() If gmin_camera_platform_data() returns NULL then we should return a negative error instead of success. Fixes: 90ebe55ab886 ("media: staging: atomisp: Add driver prefix to Kconfig option and module names") Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab commit 3d81099c75a685d0e72cac58b96cc39a6784ff54 Author: Nicolas Boichat Date: Fri Jul 10 08:45:29 2020 +0200 media: atomisp: Replace trace_printk by pr_info trace_printk should not be used in production code, replace it call with pr_info. Signed-off-by: Nicolas Boichat Acked-by: Greg Kroah-Hartman Signed-off-by: Mauro Carvalho Chehab commit d8ebd811415117ac86418d6b987381059bb3c6e5 Author: Baidyanath Kundu Date: Wed Jul 1 18:48:42 2020 +0200 media: atomisp: Fix __func__ style warnings This patch fixes the checkpatch.pl warning: Prefer using '"%s...", __func__' to using '', this function's name, in a string Signed-off-by: Baidyanath Kundu Signed-off-by: Mauro Carvalho Chehab commit 52c6f42fed25683ee26cebe50ee7af006dfb9b29 Author: Mauro Carvalho Chehab Date: Wed Jun 17 20:52:12 2020 +0200 media: atomisp: fix help message for ISP2401 selection I'm pretty sure I named this right, but it sounds that I ended doing something weird maybe while solving some conflict. So, fix the title of this config var. Signed-off-by: Mauro Carvalho Chehab commit cea7a0449ea3fa4883bf5dc8397f000d6b67d6cd Author: Oded Gabbay Date: Sun Jul 12 23:34:57 2020 +0300 habanalabs: prevent possible out-of-bounds array access Queue index is received from the user. Therefore, we must validate it before using it to access the queue props array. Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar commit f932d58abc38c898d7d3fe635ecb2b821a256f54 Merge: e26aeee89f54 07d3f0455002 Author: Linus Torvalds Date: Sat Jul 18 13:22:03 2020 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi into master Pull SCSI fix from James Bottomley: "One small driver fix. Although the one liner makes it sound like a cosmetic change, it's a regression fix for the megaraid_sas driver" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: megaraid_sas: Remove undefined ENABLE_IRQ_POLL macro commit 61710e437f2807e26a3402543bdbb7217a9c8620 Author: Daniele Albano Date: Sat Jul 18 14:15:16 2020 -0600 io_uring: always allow drain/link/hardlink/async sqe flags We currently filter these for timeout_remove/async_cancel/files_update, but we only should be filtering for fixed file and buffer select. This also causes a second read of sqe->flags, which isn't needed. Just check req->flags for the relevant bits. This then allows these commands to be used in links, for example, like everything else. Signed-off-by: Daniele Albano Signed-off-by: Jens Axboe commit e26aeee89f54e2e5867836231b4dc6448e45248b Merge: 6cf7ccba29dc c66ef39eb27f Author: Linus Torvalds Date: Sat Jul 18 12:06:11 2020 -0700 Merge tag 'hwmon-for-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging into master Pull hwmon fixes from Guenter Roeck: - Using SCT on some Tohsiba drives causes firmware hangs. Disable its use in the drivetemp driver. - Handle potential buffer overflows in scmi and aspeed-pwm-tacho driver. - Energy reporting does not work well on all AMD CPUs. Restrict amd_energy to known working models. - Enable reading the CPU temperature on NCT6798D using undocumented registers. - Fix read errors seen if PEC is enabled in adm1275 driver. - Fix setting the pwm1_enable in emc2103 driver. * tag 'hwmon-for-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (drivetemp) Avoid SCT usage on Toshiba DT01ACA family drives hwmon: (scmi) Fix potential buffer overflow in scmi_hwmon_probe() hwmon: (nct6775) Accept PECI Calibration as temperature source for NCT6798D hwmon: (adm1275) Make sure we are reading enough data for different chips hwmon: (emc2103) fix unable to change fan pwm1_enable attribute hwmon: (amd_energy) match for supported models hwmon: (aspeed-pwm-tacho) Avoid possible buffer overflow commit 6cf7ccba29dcf39ab27630c383a3844078a6d5cd Merge: 721db9dfb106 38b7c2a3ffb1 Author: Linus Torvalds Date: Sat Jul 18 11:10:06 2020 -0700 Merge tag 'riscv-for-linus-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux into master Pull RISC-V fixes from Palmer Dabbelt: "Two fixes: - 16KiB kernel stacks on rv64, which fixes a lot of crashes. - Rolling an mmiowb() into the scheduler, which when combined with Will's fix to the mmiowb()-on-spinlock should fix the PREEMPT issues we've been seeing" * tag 'riscv-for-linus-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Upgrade smp_mb__after_spinlock() to iorw,iorw riscv: use 16KB kernel stack on 64-bit commit 721db9dfb106f042294f40d2dbbd6c3613c3cd61 Merge: 6a70f89cc58f f0479c4bcbd9 Author: Linus Torvalds Date: Sat Jul 18 10:45:17 2020 -0700 Merge tag 'powerpc-5.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux into master Pull powerpc fixes from Michael Ellerman: "Some more powerpc fixes for 5.8: - A fix to the VAS code we merged this cycle, to report the proper error code to userspace for address translation failures. And a selftest update to match. - Another fix for our pkey handling of PROT_EXEC mappings. - A fix for a crash when booting a "secure VM" under an ultravisor with certain numbers of CPUs. Thanks to: Aneesh Kumar K.V, Haren Myneni, Laurent Dufour, Sandipan Das, Satheesh Rajendran, Thiago Jung Bauermann" * tag 'powerpc-5.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: selftests/powerpc: Use proper error code to check fault address powerpc/vas: Report proper error code for address translation failure powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey commit c66ef39eb27fe123ee05082b90eb2985c33c7715 Author: Maciej S. Szmigiero Date: Sat Jul 18 14:32:10 2020 +0200 hwmon: (drivetemp) Avoid SCT usage on Toshiba DT01ACA family drives It has been observed that Toshiba DT01ACA family drives have WRITE FPDMA QUEUED command timeouts and sometimes just freeze until power-cycled under heavy write loads when their temperature is getting polled in SCT mode. The SMART mode seems to be fine, though. Let's make sure we don't use SCT mode for these drives then. While only the 3 TB model was actually caught exhibiting the problem let's play safe here to avoid data corruption and extend the ban to the whole family. Fixes: 5b46903d8bf3 ("hwmon: Driver for disk and solid state drives with temperature sensors") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/0cb2e7022b66c6d21d3f189a12a97878d0e7511b.1595075458.git.mail@maciej.szmigiero.name Signed-off-by: Guenter Roeck commit 568e4e82128aac2c62c2c359ebebb6007fd794f9 Author: Joonho Wohn Date: Sat Jul 18 17:23:15 2020 +0900 ALSA: hda/realtek: Fixed ALC298 sound bug by adding quirk for Samsung Notebook Pen S Fixed no headphone sound bug on laptop Samsung Notebook Pen S (950SBE-951SBE), by using existing patch in Linus' tree, commit 14425f1f521f (ALSA: hda/realtek: Add quirk for Samsung Notebook). This laptop uses the same ALC298 but different subsystem id 0x144dc812. I added SND_PCI_QUIRK at sound/pci/hda/patch_realtek.c Signed-off-by: Joonho Wohn Cc: Link: https://lore.kernel.org/r/CAHcbMh291aWDKiWSZoxXB4-Eru6OYRwGA4AVEdCZeYmVLo5ZxQ@mail.gmail.com Signed-off-by: Takashi Iwai commit cadfad870154e14f745ec845708bc17d166065f2 Author: Andy Lutomirski Date: Fri Jul 17 16:53:55 2020 -0700 x86/ioperm: Fix io bitmap invalidation on Xen PV tss_invalidate_io_bitmap() wasn't wired up properly through the pvop machinery, so the TSS and Xen's io bitmap would get out of sync whenever disabling a valid io bitmap. Add a new pvop for tss_invalidate_io_bitmap() to fix it. This is XSA-329. Fixes: 22fe5b0439dd ("x86/ioperm: Move TSS bitmap update to exit to user work") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Reviewed-by: Juergen Gross Reviewed-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/d53075590e1f91c19f8af705059d3ff99424c020.1595030016.git.luto@kernel.org commit b6b415a80150ef712ab8d510cc7a8a299b88902e Author: B K Karthik Date: Sun Jun 28 06:38:33 2020 +0200 media: atomisp: i2c: atomisp-ov2680.c: fixed a brace coding style issue. Fixed a coding style issue. Signed-off-by: B K Karthik Signed-off-by: Mauro Carvalho Chehab commit fb2595456d75d688305690fb555fe8d31b18f673 Author: Colin Ian King Date: Thu Jun 11 16:08:31 2020 +0200 media: atomisp: make const arrays static, makes object smaller Don't populate const arrays on the stack but instead make them static. Makes the object code smaller by 150 bytes. Before: text data bss dec hex filename 111083 23692 64 134839 20eb7 atomisp/pci/atomisp_compat_css20.o After: text data bss dec hex filename 110773 23852 64 134689 20e21 atomisp/pci/atomisp_compat_css20.o After: (gcc version 9.3.0, amd64) Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit 3a0744603a042fc2dae70845923bce0e50d634fb Author: Andy Shevchenko Date: Mon Jun 29 12:57:39 2020 +0200 media: atomisp: Clean up non-existing folders from Makefile Compiler is not happy about leftovers: cc1: warning: .../pci/hrt/: No such file or directory [-Wmissing-include-dirs] cc1: warning: .../pci/hive_isp_css_include/memory_access/: No such file or directory [-Wmissing-include-dirs] cc1: warning: .../pci/css_2400_system/hrt/: No such file or directory [-Wmissing-include-dirs] Drop them from Makefile. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit e8b4a890eddb95b8acc2073def0231ef0c77ceb0 Author: Andy Shevchenko Date: Mon Jun 29 12:57:38 2020 +0200 media: atomisp: Get rid of ACPI specifics in gmin_subdev_add() First of all ACPI HID is a part of the device name which is printed as a part of the dev_info(dev, ...); line. Second, since the only BID is left, it's a part of ACPI path, which can be printed via %pfw. Besides that, drop ACPI handle from atomisp_get_acpi_power() parameters. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 5cb30aed643545af0e6eb687eb4262e4e2583695 Author: Andy Shevchenko Date: Mon Jun 29 12:57:37 2020 +0200 media: atomisp: Provide Gmin subdev as parameter to gmin_subdev_add() Provide Gmin subdev as parameter to gmin_subdev_add() to avoid direct global variable usage. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit fecd8833cc480559a50bf2532254c2e4d3a07240 Author: Andy Shevchenko Date: Mon Jun 29 12:57:36 2020 +0200 media: atomisp: Use temporary variable for device in gmin_subdev_add() Use temporary variable for device in gmin_subdev_add(). While here, drop unused temporary variable for device in other places. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit c30f4cb2d4c785b8bd0ea1710af7a542aeca1bbe Author: Andy Shevchenko Date: Mon Jun 29 12:57:35 2020 +0200 media: atomisp: Refactor PMIC detection to a separate function Refactor PMIC detection to a separate function. In the future we may move this code somewhere else where it's more suitable. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit e4fb745c9575b0d02548ebd024c95b75fd038c03 Author: Andy Shevchenko Date: Fri Jun 26 14:19:25 2020 +0200 media: atomisp: Deduplicate return ret in gmin_i2c_write() Deduplicate return ret in gmin_i2c_write(). While here, replace 'Kernel' by 'kernel' in the message and reduce amount of LOCs. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 2e31e6f89c728ddbfc803f213823917dc705c330 Author: Andy Shevchenko Date: Fri Jun 26 14:19:21 2020 +0200 media: atomisp: Make pointer to PMIC client global When we enumerate second device when PMIC has been successfully detected to AXP, we got into troubles dereferencing NULL pointer. It seems we have to detect PMIC only once because pmic_id is a global variable and code doesn't expect the change of it: Two PMICs on one platform? It's impossible. Crash excerpt: [ 34.335237] BUG: kernel NULL pointer dereference, address: 0000000000000002 ... [ 35.652036] RIP: 0010:gmin_subdev_add.cold+0x32f/0x33e [atomisp_gmin_platform] So, as a quick fix make power a global variable. In next patches we move PMIC detection to be more independent from subdevices. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 0f46ab461e3a15ba6f9c5e0c12233b3339abc42e Author: Andy Shevchenko Date: Fri Jun 26 14:19:20 2020 +0200 media: atomisp: Don't try to parse unexpected ACPI object type There are devices with completely different _DSM() format, and accessing object as a package leads to crashes. Bail out in the case of unexpected object type. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 96310fd873897dc08274f4dfd6f8a5c3e009a5a4 Author: Andy Shevchenko Date: Fri Jun 26 14:19:19 2020 +0200 media: atomisp: make platform data more readable Add few blank lines to make platform data more readable. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 250977de59340d2bdaa83bb78e03c4c38957b998 Author: Andy Shevchenko Date: Fri Jun 26 14:19:18 2020 +0200 media: atomisp: Drop global atomisp_dev variable (easy cases) Refactor code to avoid use of atomisp_dev global variable where it's easy to achieve. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 71aecd5d63eea41bc5f6a03e3a868bbe44c2acef Author: Andy Shevchenko Date: Fri Jun 26 14:19:17 2020 +0200 media: atomisp: Replace direct access to MMIO with proper helpers We have special helpers to access MMIO. Use them. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 89027fea0d04146e6df5e5bff4672655faeb43fb Author: Andy Shevchenko Date: Fri Jun 26 14:19:16 2020 +0200 media: atomisp: Unify pdev to be pointer to struct pci_device Unify pdev to be pointer to struct pci_device. While here, reindent some (touched) lines for better readability. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 1cfc8593f42085b469fe167eec615527a84fe793 Author: Andy Shevchenko Date: Fri Jun 26 14:19:15 2020 +0200 media: atomisp: Get rid of struct pci_dev in struct atomisp_device struct atomisp device has struct device and struct pci_dev pointers which are basically duplicates of each other. Drop the latter in favour of the former. While here, unify pdev to be pointer to struct pci_device and reindent some (touched) lines for better readability. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 0697fd92e7f1fc2b0783491e3fd40d5a7e77d011 Author: Andy Shevchenko Date: Fri Jun 26 14:19:14 2020 +0200 media: atomisp: don't pass struct device_driver as parameter There is no need to pass a pointer to struct device_driver when we have an access to struct device already. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 4f307131f376e92fc038677a655a495dcb1d8ada Author: Andy Shevchenko Date: Fri Jun 26 14:19:13 2020 +0200 media: atomisp: Use proper APIs to find I²C client device by ACPI HID There are specific ACPI and I\xB2C APIs to match device by different parameters, such as ACPI HID, and retrieve an I\xB2C client. Use them instead of home grown approach. Note, it fixes a resource leak as well. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 5f55dd54994a596ce3bdb9e2a73164907ca46c03 Author: Andy Shevchenko Date: Fri Jun 26 14:19:12 2020 +0200 media: atomisp: move CCK endpoint address to generic header IOSF MBI header contains a lot of definitions, such as end point addresses of IPs. Move CCK address from AtomISP driver to generic header. While here, drop unused one. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit e651cc385a2b4b5f361468f6fe11e6199fe2ae5f Author: Andy Shevchenko Date: Fri Jun 26 14:19:11 2020 +0200 media: atomisp: Replace last use of Intel MID APIs Intel MID special header is not in use in this driver. Replace it with a better macro for now on. Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 79317baaaea22b2b7d8bdfc1e0718f6579da88ac Author: Mauro Carvalho Chehab Date: Sun Jun 21 10:04:16 2020 +0200 media: atomisp: place all gpio parsing together Instead of parsing GPIO for two exceptions inside the logic which would be trying to use the GPIO, move the init code to the routine which adds a new gmin device. Move the notes to it too, as this helps to identify where those two GPIO settings are used, explaining why they're defaulting to -1 when not found. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 2b5b3221060cf7a694188929b362d7a6e41af928 Author: Mauro Carvalho Chehab Date: Sun Jun 21 09:42:47 2020 +0200 media: atomisp: split add from find subdev There's only one place where a subdev can be added: when the sensor driver registers it. Trying to do it elsewhere will cause problems, as the detection code needs to access the I2C bus in order to probe some things. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 1153cb48d657388d27752fecdc1bc53432942882 Author: Mauro Carvalho Chehab Date: Sun Jun 21 09:07:24 2020 +0200 media: atomisp: print info if gpio0 and gpio2 were detected If the ACPI DSDT tables provide _CRS for the camera, the GPIO core code should be able to handle them automatically. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit d6ad1c9bbadd83889080350489bc63f7ff9207f0 Author: Mauro Carvalho Chehab Date: Sun Jun 21 08:32:27 2020 +0200 media: atomisp: fix call to g_frame_interval The media core has now a check if fi->pad is bigger than zero or bigger than sd->entity.num_pads, if the media controller is defined. This causes a call to g_frame_interval to return -EINVAL. Fix it by first cleaning up the struct. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit e2c57942382dd1ace16b90c73febdd31666f2ad3 Author: Mauro Carvalho Chehab Date: Sat Jun 20 12:25:10 2020 +0200 media: atomisp: properly parse CLK PMIC on newer devices Newer devices don't place the PMIC CLK line inside an EFI var. Instead, those are found at the _PR0 table. Add a parser for it, using info stored via the DSDT table. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit d6697288d8c4b4174b77f29d302bd5f69354659b Author: Mauro Carvalho Chehab Date: Sun Jun 14 09:02:01 2020 +0200 media: atomisp: Prepare sensor support for ACPI PM Add support code for this driver to use ACPI power management. Yet, at least with known devices, this won't work without further changes. The rationale is that the ACPI handling code checks for the _PR? tables in order to know what is required to switch the device from power state D0 (_PR0) up to D3COLD (_PR3). The adev->flags.power_manageable is set to true if the device has a _PR0 table, which can be checked by calling acpi_device_power_manageable(adev). However, this only says that the device can be set to power off mode. At least on the DSDT tables we've seen so far, there's no _PR3 nor _PS3 (which would have a somewhat similar effect). So, using ACPI for power management won't work, except if adding an ACPI override logic somewhere. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 6391c63e61a76dfe4020432368cc2a7aa1273b41 Author: Mauro Carvalho Chehab Date: Sun Jun 14 08:36:23 2020 +0200 media: atomisp: reorganize the code under gmin_subdev_add() The gmin_subdev_add() currently doesn't use ACPI device power management. In order to prepare for adding support for it, let's shift some things, placing the PM-related stuff at the end of the probing logic. Let's also store the current gs on a temporary var, in order to simplify the source code. Tested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 9b8737788af6c76ef93e3161ee2cdc4ddcc034ca Author: Vadim Pasternak Date: Fri Jul 17 22:01:43 2020 +0300 mlxsw: core: Fix wrong SFP EEPROM reading for upper pages 1-3 Fix wrong reading of upper pages for SFP EEPROM. According to "Memory Organization" figure in SFF-8472 spec: When reading upper pages 1, 2 and 3 the offset should be set relative to zero and I2C high address 0x51 [1010001X (A2h)] is to be used. Fixes: a45bfb5a5070 ("mlxsw: core: Extend QSFP EEPROM size for ethtool") Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit eea9f73e1ff9b99fbb937d41bb07c5bb2ae9ea2f Author: Murali Karicheri Date: Fri Jul 17 10:55:10 2020 -0400 net: hsr: validate address B before copying to skb Validate MAC address before copying the same to outgoing frame skb destination address. Since a node can have zero mac address for Link B until a valid frame is received over that link, this fix address the issue of a zero MAC address being in the packet. Signed-off-by: Murali Karicheri Signed-off-by: David S. Miller commit 6d6148bc78d2f002ecc67b801c5f55a0cc5184c8 Author: Murali Karicheri Date: Fri Jul 17 10:55:09 2020 -0400 net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames For small Ethernet frames with size less than minimum size 66 for HSR vs 60 for regular Ethernet frames, hsr driver currently doesn't pad the frame to make it minimum size. This results in incorrect LSDU size being populated in the HSR tag for these frames. Fix this by padding the frame to the minimum size applicable for HSR. Signed-off-by: Murali Karicheri Signed-off-by: David S. Miller commit 807abcb0883439af5ead73f3308310453b97b624 Author: Jens Axboe Date: Fri Jul 17 17:09:27 2020 -0600 io_uring: ensure double poll additions work with both request types The double poll additions were centered around doing POLL_ADD on file descriptors that use more than one waitqueue (typically one for read, one for write) when being polled. However, it can also end up being triggered for when we use poll triggered retry. For that case, we cannot safely use req->io, as that could be used by the request type itself. Add a second io_poll_iocb pointer in the structure we allocate for poll based retry, and ensure we use the right one from the two paths. Fixes: 18bceab101ad ("io_uring: allow POLL_ADD with double poll_wait() users") Signed-off-by: Jens Axboe commit 7f5f81406e2b36785f1e25fe5209edd9dd3610d7 Author: Randy Dunlap Date: Fri Jul 17 16:37:25 2020 -0700 rhashtable: drop duplicated word in Drop the doubled word "be" in a comment. Signed-off-by: Randy Dunlap Cc: Thomas Graf Cc: Herbert Xu Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit 2ccb0161a0e9eb06f538557d38987e436fc39b8d Author: Alexandre Belloni Date: Sat Jul 18 01:32:21 2020 +0200 net: macb: use phy_interface_mode_is_rgmii everywhere There is one RGMII check not using the phy_interface_mode_is_rgmii() helper. This prevents the driver from configuring the MAC properly when using a phy-mode that is not just rgmii, e.g. rgmii-rxid. This became an issue on sama5d3 xplained since the ksz9031 driver is hadling phy-mode properly and the phy-mode has to be set to rgmii-rxid. Fixes: bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY") Signed-off-by: Alexandre Belloni Signed-off-by: David S. Miller commit 23e500e88723f243c27e1b26c9d035d4cdd1b24a Author: Nikita Danilov Date: Fri Jul 17 23:39:49 2020 +0300 net: atlantic: disable PTP on AQC111, AQC112 This patch disables PTP on AQC111 and AQC112 due to a known HW issue, which can cause datapath issues. Ideally PTP block should have been disabled via PHY provisioning, but unfortunately many units have been shipped with enabled PTP block. Thus, we have to work around this in the driver. Fixes: dbcd6806af420 ("net: aquantia: add support for Phy access") Signed-off-by: Nikita Danilov Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 6a70f89cc58f2368efa055cbcbd8b37384f6c588 Merge: 630c183b2de1 65caafd0d214 Author: Linus Torvalds Date: Fri Jul 17 16:37:52 2020 -0700 Merge tag 'nfs-for-5.8-3' of git://git.linux-nfs.org/projects/anna/linux-nfs into master Pull NFS client fixes from Anna Schumaker: "A few more NFS client bugfixes for Linux 5.8: NFS: - Fix interrupted slots by using the SEQUENCE operation SUNRPC: - revert d03727b248d0 to fix unkillable IOs xprtrdma: - Fix double-free in rpcrdma_ep_create() - Fix recursion into rpcrdma_xprt_disconnect() - Fix return code from rpcrdma_xprt_connect() - Fix handling of connect errors - Fix incorrect header size calculations" * tag 'nfs-for-5.8-3' of git://git.linux-nfs.org/projects/anna/linux-nfs: SUNRPC reverting d03727b248d0 ("NFSv4 fix CLOSE not waiting for direct IO compeletion") xprtrdma: fix incorrect header size calculations NFS: Fix interrupted slots by sending a solo SEQUENCE operation xprtrdma: Fix handling of connect errors xprtrdma: Fix return code from rpcrdma_xprt_connect() xprtrdma: Fix recursion into rpcrdma_xprt_disconnect() xprtrdma: Fix double-free in rpcrdma_ep_create() commit 630c183b2de1a94f442564664362fc0171428640 Merge: a570f4198906 2648298a06ba Author: Linus Torvalds Date: Fri Jul 17 15:38:22 2020 -0700 Merge tag 'arm-fixes-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into master Pull ARM SoC fixes from Arnd Bergmann: "This time there are a number of actual code fixes, plus a small set of device tree issues getting addressed: Renesas: - one defconfig cleanup to allow a later Kconfig change Intel socfpga: - enable QSPI devices on some machines - fix DTC validation warnings TI OMAP: - Two DEBUG_ATOMIC_SLEEP fixes for ti-sysc interconnect target module driver - A regression fix for ti-sysc no-idle handling that caused issues compared to earlier platform data based booting - A fix for memory leak for omap_hwmod_allocate_module - Fix d_can driver probe for am437x NXP i.MX: - A couple of fixes on i.MX platform device registration code to stop the use of invalid IRQ 0. - Fix a regression seen on ls1021a platform, caused by commit 52102a3ba6a61 ("soc: imx: move cpu code to drivers/soc/imx"). - Fix a misconfiguration of audio SSI on imx6qdl-gw551x board. Amlogic Meson: - misc DT fixes - SoC ID fixes to detect all chips correctly" * tag 'arm-fixes-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm64: dts: spcfpga: Align GIC, NAND and UART nodenames with dtschema ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema arm64: dts: stratix10: increase QSPI reg address in nand dts file arm64: dts: stratix10: add status to qspi dts node arm64: dts: agilex: add status to qspi dts node ARM: dts: Fix dcan driver probe failed on am437x platform ARM: OMAP2+: Fix possible memory leak in omap_hwmod_allocate_module arm64: defconfig: Enable CONFIG_PCIE_RCAR_HOST soc: imx: check ls1021a ARM: imx: Remove imx_add_imx_dma() unused irq_err argument ARM: imx: Provide correct number of resources when registering gpio devices ARM: dts: imx6qdl-gw551x: fix audio SSI bus: ti-sysc: Do not disable on suspend for no-idle bus: ti-sysc: Fix sleeping function called from invalid context for RTC quirk bus: ti-sysc: Fix wakeirq sleeping function called from invalid context ARM: dts: meson: Align L2 cache-controller nodename with dtschema arm64: dts: meson-gxl-s805x: reduce initial Mali450 core frequency arm64: dts: meson: add missing gxl rng clock soc: amlogic: meson-gx-socinfo: Fix S905X3 and S905D3 ID's commit a570f4198906a88b959ddcc56ddabc634397e810 Merge: 4ebf8d7649cd f32ed8eb0e3f Author: Linus Torvalds Date: Fri Jul 17 15:27:52 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux into master Pull arm64 fixes from Will Deacon: "A batch of arm64 fixes. Although the diffstat is a bit larger than we'd usually have at this stage, a decent amount of it is the addition of comments describing our syscall tracing behaviour, and also a sweep across all the modular arm64 PMU drivers to make them rebust against unloading and unbinding. There are a couple of minor things kicking around at the moment (CPU errata and module PLTs for very large modules), but I'm not expecting any significant changes now for us in 5.8. - Fix kernel text addresses for relocatable images booting using EFI and with KASLR disabled so that they match the vmlinux ELF binary. - Fix unloading and unbinding of PMU driver modules. - Fix generic mmiowb() when writeX() is called from preemptible context (reported by the riscv folks). - Fix ptrace hardware single-step interactions with signal handlers, system calls and reverse debugging. - Fix reporting of 64-bit x0 register for 32-bit tasks via 'perf_regs'. - Add comments describing syscall entry/exit tracing ABI" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: drivers/perf: Prevent forced unbinding of PMU drivers asm-generic/mmiowb: Allow mmiowb_set_pending() when preemptible() arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter() arm64: syscall: Expand the comment about ptrace and syscall(-1) arm64: ptrace: Add a comment describing our syscall entry/exit trap ABI arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return arm64: ptrace: Override SPSR.SS when single-stepping is enabled arm64: ptrace: Consistently use pseudo-singlestep exceptions drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling efi/libstub/arm64: Retain 2MB kernel Image alignment if !KASLR commit baedb87d1b53532f81b4bd0387f83b05d4f7eb9a Author: Thomas Gleixner Date: Fri Jul 17 18:00:02 2020 +0200 genirq/affinity: Handle affinity setting on inactive interrupts correctly Setting interrupt affinity on inactive interrupts is inconsistent when hierarchical irq domains are enabled. The core code should just store the affinity and not call into the irq chip driver for inactive interrupts because the chip drivers may not be in a state to handle such requests. X86 has a hacky workaround for that but all other irq chips have not which causes problems e.g. on GIC V3 ITS. Instead of adding more ugly hacks all over the place, solve the problem in the core code. If the affinity is set on an inactive interrupt then: - Store it in the irq descriptors affinity mask - Update the effective affinity to reflect that so user space has a consistent view - Don't call into the irq chip driver This is the core equivalent of the X86 workaround and works correctly because the affinity setting is established in the irq chip when the interrupt is activated later on. Note, that this is only effective when hierarchical irq domains are enabled by the architecture. Doing it unconditionally would break legacy irq chip implementations. For hierarchial irq domains this works correctly as none of the drivers can have a dependency on affinity setting in inactive state by design. Remove the X86 workaround as it is not longer required. Fixes: 02edee152d6e ("x86/apic/vector: Ignore set_affinity call for inactive interrupts") Reported-by: Ali Saidi Signed-off-by: Thomas Gleixner Tested-by: Ali Saidi Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200529015501.15771-1-alisaidi@amazon.com Link: https://lkml.kernel.org/r/877dv2rv25.fsf@nanos.tec.linutronix.de commit 0b4a66a389d1ff5dab29f688fcfe36482bc889a2 Author: Wang Hai Date: Fri Jul 17 15:10:16 2020 +0800 nfc: nci: add missed destroy_workqueue in nci_register_device When nfc_register_device fails in nci_register_device, destroy_workqueue() shouled be called to destroy ndev->tx_wq. Fixes: 3c1c0f5dc80b ("NFC: NCI: Fix nci_register_device init sequence") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit 1291517462f7fc667ab780d92955f5796f4fd6af Merge: aba69d49fb49 a8c64542b478 Author: David S. Miller Date: Fri Jul 17 13:00:28 2020 -0700 Merge branch 'bcmgenet-WAKE_FILTER' Doug Berger says: ==================== net: bcmgenet: fix WAKE_FILTER resume from deep sleep The WAKE_FILTER logic can only wake the system from the standby power state. However, some systems that include the GENET IP support deeper power saving states and the driver should suspend and resume correctly from those states as well. This commit set squashes a few issues uncovered while testing suspend and resume from these deep sleep states. ==================== Signed-off-by: David S. Miller commit a8c64542b478e61fa17661803b590ed276205914 Author: Doug Berger Date: Thu Jul 16 16:38:17 2020 -0700 net: bcmgenet: restore HFB filters on resume The Hardware Filter Block RAM may not be preserved when the GENET block is reset during a deep sleep, so it is not sufficient to only backup and restore the enables. This commit clears out the HFB block and reprograms the rxnfc rules when the system resumes from a suspended state. To support this the bcmgenet_hfb_create_rxnfc_filter() function is modified to access the register space directly so that it can't fail due to memory allocation issues. Fixes: f50932cca632 ("net: bcmgenet: add WAKE_FILTER support") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 3d653adb4b4955addad8c3accd33e22cb99a445b Author: Doug Berger Date: Thu Jul 16 16:38:16 2020 -0700 net: bcmgenet: test RBUF_ACPI_EN when resuming When the GENET driver resumes from deep sleep the UMAC_CMD register may not be accessible and therefore should not be accessed from bcmgenet_wol_power_up_cfg() if the GENET has been reset. This commit adds a check of the RBUF_ACPI_EN flag when Wake on Filter is enabled. A clear flag indicates that the GENET hardware must have been reset so the remainder of the hardware programming is bypassed. Fixes: f50932cca632 ("net: bcmgenet: add WAKE_FILTER support") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 2f11f0df8474b2206c8cf2d5d5b98e7eff240cdf Author: Doug Berger Date: Thu Jul 16 16:38:15 2020 -0700 net: bcmgenet: test MPD_EN when resuming When the GENET driver resumes from deep sleep the UMAC_CMD register may not be accessible and therefore should not be accessed from bcmgenet_wol_power_up_cfg() if the GENET has been reset. This commit adds a check of the MPD_EN flag when Wake on Magic Packet is enabled. A clear flag indicates that the GENET hardware must have been reset so the remainder of the hardware programming is bypassed. Fixes: 1a1d5106c1e3 ("net: bcmgenet: move clk_wol management to bcmgenet_wol") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit aba69d49fb49c9166596dd78926514173b7f9ab5 Author: Paolo Pisati Date: Thu Jul 16 17:51:14 2020 +0200 selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m: $ sudo ./ip_defrag.sh + set -e + mktemp -u XXXXXX + readonly NETNS=ns-rGlXcw + trap cleanup EXIT + setup + ip netns add ns-rGlXcw + ip -netns ns-rGlXcw link set lo up + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000 + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000 + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1 + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000 + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000 + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1 + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000 + cleanup + ip netns del ns-rGlXcw $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory $ sudo modprobe nf_defrag_ipv6 $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh Signed-off-by: Paolo Pisati Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit bca9749b1aa23d964d3ab930938af66dbf887f15 Author: Wang Hai Date: Thu Jul 16 11:50:38 2020 +0800 net: smc91x: Fix possible memory leak in smc_drv_probe() If try_toggle_control_gpio() failed in smc_drv_probe(), free_netdev(ndev) should be called to free the ndev created earlier. Otherwise, a memleak will occur. Fixes: 7d2911c43815 ("net: smc91x: Fix gpios for device tree based booting") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit e2a71bdea81690b6ef11f4368261ec6f5b6891aa Author: Frederic Weisbecker Date: Fri Jul 17 16:05:40 2020 +0200 timer: Fix wheel index calculation on last level When an expiration delta falls into the last level of the wheel, that delta has be compared against the maximum possible delay and reduced to fit in if necessary. However instead of comparing the delta against the maximum, the code compares the actual expiry against the maximum. Then instead of fixing the delta to fit in, it sets the maximum delta as the expiry value. This can result in various undesired outcomes, the worst possible one being a timer expiring 15 days ahead to fire immediately. Fixes: 500462a9de65 ("timers: Switch to a non-cascading wheel") Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200717140551.29076-2-frederic@kernel.org commit cebb69754f37d68e1355a5e726fdac317bcda302 Author: Weilong Chen Date: Wed Jul 15 20:58:10 2020 +0800 rtnetlink: Fix memory(net_device) leak when ->newlink fails When vlan_newlink call register_vlan_dev fails, it might return error with dev->reg_state = NETREG_UNREGISTERED. The rtnl_newlink should free the memory. But currently rtnl_newlink only free the memory which state is NETREG_UNINITIALIZED. BUG: memory leak unreferenced object 0xffff8881051de000 (size 4096): comm "syz-executor139", pid 560, jiffies 4294745346 (age 32.445s) hex dump (first 32 bytes): 76 6c 61 6e 32 00 00 00 00 00 00 00 00 00 00 00 vlan2........... 00 45 28 03 81 88 ff ff 00 00 00 00 00 00 00 00 .E(............. backtrace: [<0000000047527e31>] kmalloc_node include/linux/slab.h:578 [inline] [<0000000047527e31>] kvmalloc_node+0x33/0xd0 mm/util.c:574 [<000000002b59e3bc>] kvmalloc include/linux/mm.h:753 [inline] [<000000002b59e3bc>] kvzalloc include/linux/mm.h:761 [inline] [<000000002b59e3bc>] alloc_netdev_mqs+0x83/0xd90 net/core/dev.c:9929 [<000000006076752a>] rtnl_create_link+0x2c0/0xa20 net/core/rtnetlink.c:3067 [<00000000572b3be5>] __rtnl_newlink+0xc9c/0x1330 net/core/rtnetlink.c:3329 [<00000000e84ea553>] rtnl_newlink+0x66/0x90 net/core/rtnetlink.c:3397 [<0000000052c7c0a9>] rtnetlink_rcv_msg+0x540/0x990 net/core/rtnetlink.c:5460 [<000000004b5cb379>] netlink_rcv_skb+0x12b/0x3a0 net/netlink/af_netlink.c:2469 [<00000000c71c20d3>] netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] [<00000000c71c20d3>] netlink_unicast+0x4c6/0x690 net/netlink/af_netlink.c:1329 [<00000000cca72fa9>] netlink_sendmsg+0x735/0xcc0 net/netlink/af_netlink.c:1918 [<000000009221ebf7>] sock_sendmsg_nosec net/socket.c:652 [inline] [<000000009221ebf7>] sock_sendmsg+0x109/0x140 net/socket.c:672 [<000000001c30ffe4>] ____sys_sendmsg+0x5f5/0x780 net/socket.c:2352 [<00000000b71ca6f3>] ___sys_sendmsg+0x11d/0x1a0 net/socket.c:2406 [<0000000007297384>] __sys_sendmsg+0xeb/0x1b0 net/socket.c:2439 [<000000000eb29b11>] do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359 [<000000006839b4d0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: cb626bf566eb ("net-sysfs: Fix reference count leak") Reported-by: Hulk Robot Signed-off-by: Weilong Chen Signed-off-by: David S. Miller commit 65caafd0d2145d1dd02072c4ced540624daeab40 Author: Olga Kornievskaia Date: Wed Jul 15 13:04:15 2020 -0400 SUNRPC reverting d03727b248d0 ("NFSv4 fix CLOSE not waiting for direct IO compeletion") Reverting commit d03727b248d0 "NFSv4 fix CLOSE not waiting for direct IO compeletion". This patch made it so that fput() by calling inode_dio_done() in nfs_file_release() would wait uninterruptably for any outstanding directIO to the file (but that wait on IO should be killable). The problem the patch was also trying to address was REMOVE returning ERR_ACCESS because the file is still opened, is supposed to be resolved by server returning ERR_FILE_OPEN and not ERR_ACCESS. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 4ebf8d7649cd86c41c41bf48da4b7761da2d5009 Merge: c9ea87dc6c3f 681fda8d27a6 Author: Linus Torvalds Date: Fri Jul 17 10:47:51 2020 -0700 Merge tag 'io_uring-5.8-2020-07-17' of git://git.kernel.dk/linux-block into master Pull io_uring fix from Jens Axboe: "Fix for a case where, with automatic buffer selection, we can leak the buffer descriptor for recvmsg" * tag 'io_uring-5.8-2020-07-17' of git://git.kernel.dk/linux-block: io_uring: fix recvmsg memory leak with buffer selection commit c9ea87dc6c3f48a8de02019fe52472a6cdfedd65 Merge: 0dd68a34eccd 1f273e255b28 Author: Linus Torvalds Date: Fri Jul 17 10:45:36 2020 -0700 Merge tag 'block-5.8-2020-07-17' of git://git.kernel.dk/linux-block into master Pull block fix from Jens Axboe: "Single NVMe multipath capacity fix" * tag 'block-5.8-2020-07-17' of git://git.kernel.dk/linux-block: nvme: explicitly update mpath disk capacity on revalidation commit 0dd68a34eccd598109eb845d107a7e8e196745db Merge: 44fea37378bf 31070f6ccec0 Author: Linus Torvalds Date: Fri Jul 17 10:36:19 2020 -0700 Merge tag 'fuse-fixes-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse into master Pull fuse fixes from Miklos Szeredi: - two regressions in this cycle caused by the conversion of writepage list to an rb_tree - two regressions in v5.4 cause by the conversion to the new mount API - saner behavior of fsconfig(2) for the reconfigure case - an ancient issue with FS_IOC_{GET,SET}FLAGS ioctls * tag 'fuse-fixes-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: Fix parameter for FS_IOC_{GET,SET}FLAGS fuse: don't ignore errors from fuse_writepages_fill() fuse: clean up condition for writepage sending fuse: reject options on reconfigure via fsconfig(2) fuse: ignore 'data' argument of mount(..., MS_REMOUNT) fuse: use ->reconfigure() instead of ->remount_fs() fuse: fix warning in tree_insert() and clean up writepage insertion fuse: move rb_erase() before tree_insert() commit 44fea37378bf735de63263d558763ce50fca05ef Merge: 33b9108f0429 4518dfcf761e Author: Linus Torvalds Date: Fri Jul 17 10:29:19 2020 -0700 Merge tag 'ovl-fixes-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs into master Pull overlayfs fixes from Miklos Szeredi: - fix a regression introduced in v4.20 in handling a regenerated squashfs lower layer - two regression fixes for this cycle, one of which is Oops inducing - miscellaneous issues * tag 'ovl-fixes-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: fix lookup of indexed hardlinks with metacopy ovl: fix unneeded call to ovl_change_flags() ovl: fix mount option checks for nfs_export with no upperdir ovl: force read-only sb on failure to create index dir ovl: fix regression with re-formatted lower squashfs ovl: fix oops in ovl_indexdir_cleanup() with nfs_export=on ovl: relax WARN_ON() when decoding lower directory file handle ovl: remove not used argument in ovl_check_origin ovl: change ovl_copy_up_flags static ovl: inode reference leak in ovl_is_inuse true case. commit 56a1c778c7663a3068a59b4cb8c8fd27506b3eca Author: Min Li Date: Tue Jul 14 13:15:20 2020 -0400 docs: ptp.rst: add support for Renesas (IDT) ClockMatrix Add below to “Ancillary clock features” section - Low Pass Filter (LPF) access from user space Add below to list of “Supported hardware” section + Renesas (IDT) ClockMatrix™ Signed-off-by: Min Li Signed-off-by: David S. Miller commit 33b9108f04298bab93d41a452a0551db8ee9eec7 Merge: 8da822e8a573 ed7815db70d1 Author: Linus Torvalds Date: Fri Jul 17 10:24:09 2020 -0700 Merge tag 'spi-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into master Pull spi fixes from Mark Brown: "A couple of small driver specific fixes for fairly minor issues" * tag 'spi-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-sun6i: sun6i_spi_transfer_one(): fix setting of clock rate spi: mediatek: use correct SPI_CFG2_REG MACRO commit 8da822e8a573767c4777a4b3f11ee12954a8cd0e Merge: ee43695571c2 412847fb4733 Author: Linus Torvalds Date: Fri Jul 17 10:20:26 2020 -0700 Merge tag 'regulator-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into master Pull regulator fixes from Mark Brown: "The more substantial fix here is the rename of the da903x driver which fixes a collision with the parent MFD driver name which caused issues when things were built as modules. There's also a fix for a mislableled regulator on the pmi8994 which is quite important for systems with that device" * tag 'regulator-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: MAINTAINERS: remove obsolete entry after file renaming regulator: rename da903x to da903x-regulator regulator: qcom_smd: Fix pmi8994 label commit ee43695571c258c0945d4c456ea85b2af9aafdf4 Merge: 60541fb62438 299632e54b2e Author: Linus Torvalds Date: Fri Jul 17 09:58:18 2020 -0700 Merge tag 'regmap-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into master Pull regmap fixes from Mark Brown: "A couple of substantial fixes here, one from Doug which fixes the debugfs code for MMIO regmaps (fortunately not the common case) and one from Marc fixing lookups of multiple regmaps for the same device (a very unusual case). There's also a fix for Kconfig to ensure we enable SoundWire properly" * tag 'regmap-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: debugfs: Don't sleep while atomic for fast_io regmaps regmap: add missing dependency on SoundWire regmap: dev_get_regmap_match(): fix string comparison commit 60541fb62438c6abd821874cfc3a24d280d1cbbf Merge: a238ac2d6aa5 e13762abf38e Author: Linus Torvalds Date: Fri Jul 17 09:43:13 2020 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid into master Pull HID fixes from Jiri Kosina: - linked list race condition fix in hid-steam driver from Rodrigo Rivas Costa - assorted deviceID-specific quirks and other small cosmetic cleanups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: logitech-hidpp: avoid repeated "multiplier = " log messages HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff HID: quirks: Ignore Simply Automated UPB PIM HID: apple: Disable Fn-key key-re-mapping on clone keyboards MAINTAINERS: update uhid and hid-wiimote entry HID: steam: fixes race in handling device list. HID: magicmouse: do not set up autorepeat HID: alps: support devices with report id 2 HID: quirks: Always poll Obins Anne Pro 2 keyboard HID: i2c-hid: add Mediacom FlexBook edge13 to descriptor override commit 38b7c2a3ffb1fce8358ddc6006cfe5c038ff9963 Author: Palmer Dabbelt Date: Thu Jul 16 11:57:26 2020 -0700 RISC-V: Upgrade smp_mb__after_spinlock() to iorw,iorw While digging through the recent mmiowb preemption issue it came up that we aren't actually preventing IO from crossing a scheduling boundary. While it's a bit ugly to overload smp_mb__after_spinlock() with this behavior, it's what PowerPC is doing so there's some precedent. Signed-off-by: Palmer Dabbelt commit d3bbc28bd3457d3629cf6b325478f7ec7e3da96c Merge: 60379ba08532 fe0a53044b4b Author: Takashi Iwai Date: Fri Jul 17 18:19:02 2020 +0200 Merge tag 'asoc-fix-v5.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.8 An awful lot of mostly small fixes here, mainly for x86 based platforms and the CODEC drivers mainly used on them. For the most part this is either minor device specific stuff which seems to come from detailed testing or robustness against errors which comes from people having done some fuzzing runs aginst the topology code. commit 2648298a06ba7e902c4489a15c0db26032813c7b Merge: f7d96b86e0c1 681a5c71fb82 Author: Arnd Bergmann Date: Fri Jul 17 18:01:41 2020 +0200 Merge tag 'socfpga_fixes_for_v5.8_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/fixes arm/arm64: dts: socfpga: fixes for v5.8 - Add status = "okay" in QSPI - Increase QSPI size in reg property - Fix dtschema for SoCFPGA platforms * tag 'socfpga_fixes_for_v5.8_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: spcfpga: Align GIC, NAND and UART nodenames with dtschema ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema arm64: dts: stratix10: increase QSPI reg address in nand dts file arm64: dts: stratix10: add status to qspi dts node arm64: dts: agilex: add status to qspi dts node Link: https://lore.kernel.org/r/20200717155758.18233-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit f7d96b86e0c15f22dbfad2997e12a072d6d25b18 Merge: b041ef0e58d1 fecc5cfcd55f Author: Arnd Bergmann Date: Fri Jul 17 15:35:23 2020 +0200 Merge tag 'renesas-fixes-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/fixes Renesas fixes for v5.8 - Replace CONFIG_PCIE_RCAR by CONFIG_PCIE_RCAR_HOST in the defconfig, to unblock a planned Kconfig change. * tag 'renesas-fixes-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: defconfig: Enable CONFIG_PCIE_RCAR_HOST Link: https://lore.kernel.org/r/20200717100523.15418-1-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit a238ac2d6aa587168db943661646883126f3c3fd Merge: 8882572675c1 5734e509d5d5 Author: Linus Torvalds Date: Fri Jul 17 08:48:19 2020 -0700 Merge tag 'sound-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into master Pull sound fixes from Takashi Iwai: "No surprise here, just a few device-specific small fixes: two fixes for USB LINE6 and one for USB-audio drivers wrt syzkaller fuzzer issues, while the rest are all HD-audio Realtek quirks" * tag 'sound-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - fixup for yet another Intel reference board ALSA: hda/realtek - Enable Speaker for ASUS UX563 ALSA: hda/realtek - Enable Speaker for ASUS UX533 and UX534 ALSA: hda/realtek: Enable headset mic of Acer TravelMate B311R-31 with ALC256 ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G14(G401) series with ALC289 ALSA: hda/realtek - change to suitable link model for ASUS platform ALSA: usb-audio: Fix race against the error recovery URB submission ALSA: line6: Sync the pending work cancel at disconnection ALSA: line6: Perform sanity check for each URB creation commit b872d0640840018669032b20b6375a478ed1f923 Author: Zeng Tao Date: Wed Jul 15 15:34:41 2020 +0800 vfio/pci: fix racy on error and request eventfd ctx The vfio_pci_release call will free and clear the error and request eventfd ctx while these ctx could be in use at the same time in the function like vfio_pci_request, and it's expected to protect them under the vdev->igate mutex, which is missing in vfio_pci_release. This issue is introduced since commit 1518ac272e78 ("vfio/pci: fix memory leaks of eventfd ctx"),and since commit 5c5866c593bb ("vfio/pci: Clear error and request eventfd ctx after releasing"), it's very easily to trigger the kernel panic like this: [ 9513.904346] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 [ 9513.913091] Mem abort info: [ 9513.915871] ESR = 0x96000006 [ 9513.918912] EC = 0x25: DABT (current EL), IL = 32 bits [ 9513.924198] SET = 0, FnV = 0 [ 9513.927238] EA = 0, S1PTW = 0 [ 9513.930364] Data abort info: [ 9513.933231] ISV = 0, ISS = 0x00000006 [ 9513.937048] CM = 0, WnR = 0 [ 9513.940003] user pgtable: 4k pages, 48-bit VAs, pgdp=0000007ec7d12000 [ 9513.946414] [0000000000000008] pgd=0000007ec7d13003, p4d=0000007ec7d13003, pud=0000007ec728c003, pmd=0000000000000000 [ 9513.956975] Internal error: Oops: 96000006 [#1] PREEMPT SMP [ 9513.962521] Modules linked in: vfio_pci vfio_virqfd vfio_iommu_type1 vfio hclge hns3 hnae3 [last unloaded: vfio_pci] [ 9513.972998] CPU: 4 PID: 1327 Comm: bash Tainted: G W 5.8.0-rc4+ #3 [ 9513.980443] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B270.01 05/08/2020 [ 9513.989274] pstate: 80400089 (Nzcv daIf +PAN -UAO BTYPE=--) [ 9513.994827] pc : _raw_spin_lock_irqsave+0x48/0x88 [ 9513.999515] lr : eventfd_signal+0x6c/0x1b0 [ 9514.003591] sp : ffff800038a0b960 [ 9514.006889] x29: ffff800038a0b960 x28: ffff007ef7f4da10 [ 9514.012175] x27: ffff207eefbbfc80 x26: ffffbb7903457000 [ 9514.017462] x25: ffffbb7912191000 x24: ffff007ef7f4d400 [ 9514.022747] x23: ffff20be6e0e4c00 x22: 0000000000000008 [ 9514.028033] x21: 0000000000000000 x20: 0000000000000000 [ 9514.033321] x19: 0000000000000008 x18: 0000000000000000 [ 9514.038606] x17: 0000000000000000 x16: ffffbb7910029328 [ 9514.043893] x15: 0000000000000000 x14: 0000000000000001 [ 9514.049179] x13: 0000000000000000 x12: 0000000000000002 [ 9514.054466] x11: 0000000000000000 x10: 0000000000000a00 [ 9514.059752] x9 : ffff800038a0b840 x8 : ffff007ef7f4de60 [ 9514.065038] x7 : ffff007fffc96690 x6 : fffffe01faffb748 [ 9514.070324] x5 : 0000000000000000 x4 : 0000000000000000 [ 9514.075609] x3 : 0000000000000000 x2 : 0000000000000001 [ 9514.080895] x1 : ffff007ef7f4d400 x0 : 0000000000000000 [ 9514.086181] Call trace: [ 9514.088618] _raw_spin_lock_irqsave+0x48/0x88 [ 9514.092954] eventfd_signal+0x6c/0x1b0 [ 9514.096691] vfio_pci_request+0x84/0xd0 [vfio_pci] [ 9514.101464] vfio_del_group_dev+0x150/0x290 [vfio] [ 9514.106234] vfio_pci_remove+0x30/0x128 [vfio_pci] [ 9514.111007] pci_device_remove+0x48/0x108 [ 9514.115001] device_release_driver_internal+0x100/0x1b8 [ 9514.120200] device_release_driver+0x28/0x38 [ 9514.124452] pci_stop_bus_device+0x68/0xa8 [ 9514.128528] pci_stop_and_remove_bus_device+0x20/0x38 [ 9514.133557] pci_iov_remove_virtfn+0xb4/0x128 [ 9514.137893] sriov_disable+0x3c/0x108 [ 9514.141538] pci_disable_sriov+0x28/0x38 [ 9514.145445] hns3_pci_sriov_configure+0x48/0xb8 [hns3] [ 9514.150558] sriov_numvfs_store+0x110/0x198 [ 9514.154724] dev_attr_store+0x44/0x60 [ 9514.158373] sysfs_kf_write+0x5c/0x78 [ 9514.162018] kernfs_fop_write+0x104/0x210 [ 9514.166010] __vfs_write+0x48/0x90 [ 9514.169395] vfs_write+0xbc/0x1c0 [ 9514.172694] ksys_write+0x74/0x100 [ 9514.176079] __arm64_sys_write+0x24/0x30 [ 9514.179987] el0_svc_common.constprop.4+0x110/0x200 [ 9514.184842] do_el0_svc+0x34/0x98 [ 9514.188144] el0_svc+0x14/0x40 [ 9514.191185] el0_sync_handler+0xb0/0x2d0 [ 9514.195088] el0_sync+0x140/0x180 [ 9514.198389] Code: b9001020 d2800000 52800022 f9800271 (885ffe61) [ 9514.204455] ---[ end trace 648de00c8406465f ]--- [ 9514.212308] note: bash[1327] exited with preempt_count 1 Cc: Qian Cai Cc: Alex Williamson Fixes: 1518ac272e78 ("vfio/pci: fix memory leaks of eventfd ctx") Signed-off-by: Zeng Tao Signed-off-by: Alex Williamson commit c2942c4363ceb8bbce12c2db8f42d8bbbf5bb0ef Author: Mauro Carvalho Chehab Date: Sat Jun 13 08:46:25 2020 +0200 media: atomisp: fix the handling of clock number Right now, the driver is not doing the right thing to detect the clock like used by the sensor, at least on devices without the gmin's EFI vars. Add some notes at the code to explain why and skip the wrong value provided by the _DSM table. Signed-off-by: Mauro Carvalho Chehab commit 25d4e7f513d4f8afcf81cb6f00edf1248b0ff8fc Author: Arnaldo Carvalho de Melo Date: Fri Jul 17 09:39:16 2020 -0300 tools arch kvm: Sync kvm headers with the kernel sources To pick up the changes from: 83d31e5271ac ("KVM: nVMX: fixes for preemption timer migration") That don't entail changes in tooling. This silences these tools/perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h' diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Signed-off-by: Arnaldo Carvalho de Melo commit 94fddb7ad019ad9f14d33cd0a6cd159a52a082b8 Author: Arnaldo Carvalho de Melo Date: Fri Jul 17 09:35:18 2020 -0300 perf tools: Sync hashmap.h with libbpf's To pick up the changes in: b2f9f1535bb9 ("libbpf: Fix libbpf hashmap on (I)LP32 architectures") Silencing this warning: Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h' diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h I'll eventually update the warning to remove the "Kernel ABI" part and instead state libbpf when noticing that the original is at "tools/lib/something". Cc: Adrian Hunter Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Jakub Bogusz Cc: Jiri Olsa Cc: Namhyung Kim Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo commit a2db71b9123492e67210985867b332db09eec0cf Author: Ravi Bangoria Date: Fri Jun 19 19:04:11 2020 +0530 libsubcmd: Fix OPT_CALLBACK_SET() Any option macro with _SET suffix should set opt->set variable which is not happening for OPT_CALLBACK_SET(). This is causing issues with perf record --switch-output-event. Fix that. Before: # ./perf record --overwrite -e sched:*switch,syscalls:sys_enter_mmap \ --switch-output-event syscalls:sys_enter_mmap ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.297 MB perf.data (657 samples) ] After: $ ./perf record --overwrite -e sched:*switch,syscalls:sys_enter_mmap \ --switch-output-event syscalls:sys_enter_mmap [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020061918144542 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020061918144608 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020061918144660 ] ^C[ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020061918144784 ] [ perf record: Woken up 0 times to write data ] [ perf record: Dump perf.data.2020061918144803 ] [ perf record: Captured and wrote 0.419 MB perf.data. ] Fixes: 636eb4d001b1 ("libsubcmd: Introduce OPT_CALLBACK_SET()") Signed-off-by: Ravi Bangoria Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200619133412.50705-1-ravi.bangoria@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit baa1841eb797eadce6c907bdaed7cd6f01815404 Author: Chen-Yu Tsai Date: Sat Jul 11 09:10:30 2020 +0800 drm: sun4i: hdmi: Fix inverted HPD result When the extra HPD polling in sun4i_hdmi was removed, the result of HPD was accidentally inverted. Fix this by inverting the check. Fixes: bda8eaa6dee7 ("drm: sun4i: hdmi: Remove extra HPD polling") Signed-off-by: Chen-Yu Tsai Tested-by: Mans Rullgard Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20200711011030.21997-1-wens@kernel.org commit b279b1fe5799cf653de3822ca253f5d21639d90a Merge: 3e543a4d3001 788cacf30887 Author: Greg Kroah-Hartman Date: Fri Jul 17 11:56:58 2020 +0200 Merge tag 'misc-habanalabs-fixes-2020-07-10' of git://people.freedesktop.org/~gabbayo/linux into char-misc-linus This tag contains the following fixes for 5.8-rc4/5: - Prevent user from using command WREG_BULK in PCI DMA channel. The command won't be parsed correctly by the driver and will cause unknown behavior. As the user doesn't need to use that command in that channel, its better to just prevent it completely. - Change the interface of the clock gating debugfs property from true/false to bitmask with bit per engine. This will allow the user to debug the ASIC while disabling the clock gating feature with fine-grain granularity. - Increase message-to-ASIC-CPU timeout to 4s (from 100ms/1s). The ASIC CPU might respond sometimes after a large delay due to slow external interfaces (such as temperature sensors) and that will result in a driver timeout which will lead to ASIC reset. * tag 'misc-habanalabs-fixes-2020-07-10' of git://people.freedesktop.org/~gabbayo/linux: habanalabs: set 4s timeout for message to device CPU habanalabs: set clock gating per engine habanalabs: block WREG_BULK packet on PDMA commit f32ed8eb0e3f0d0ef4ddb854554d60ca5863a9f9 Author: Qi Liu Date: Fri Jul 17 16:49:23 2020 +0800 drivers/perf: Prevent forced unbinding of PMU drivers Forcefully unbinding PMU drivers during perf sampling will lead to a kernel panic, because the perf upper-layer framework call a NULL pointer in this situation. To solve this issue, "suppress_bind_attrs" should be set to true, so that bind/unbind can be disabled via sysfs and prevent unbinding PMU drivers during perf sampling. Signed-off-by: Qi Liu Reviewed-by: John Garry Link: https://lore.kernel.org/r/1594975763-32966-1-git-send-email-liuqi115@huawei.com Signed-off-by: Will Deacon commit 66673f96f0f968b991dc38be06102246919c663c Author: Liu Jian Date: Fri Jul 17 17:01:21 2020 +0800 ieee802154: fix one possible memleak in adf7242_probe When probe fail, we should destroy the workqueue. Fixes: 2795e8c25161 ("net: ieee802154: fix a potential NULL pointer dereference") Signed-off-by: Liu Jian Acked-by: Michael Hennerich Link: https://lore.kernel.org/r/20200717090121.2143-1-liujian56@huawei.com Signed-off-by: Stefan Schmidt commit bd024e82e4cd95c7f1a475a55f99871936c2b2db Author: Will Deacon Date: Thu Jul 16 12:28:16 2020 +0100 asm-generic/mmiowb: Allow mmiowb_set_pending() when preemptible() Although mmiowb() is concerned only with serialising MMIO writes occuring in contexts where a spinlock is held, the call to mmiowb_set_pending() from the MMIO write accessors can occur in preemptible contexts, such as during driver probe() functions where ordering between CPUs is not usually a concern, assuming that the task migration path provides the necessary ordering guarantees. Unfortunately, the default implementation of mmiowb_set_pending() is not preempt-safe, as it makes use of a a per-cpu variable to track its internal state. This has been reported to generate the following splat on riscv: | BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 | caller is regmap_mmio_write32le+0x1c/0x46 | CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc3-hfu+ #1 | Call Trace: | walk_stackframe+0x0/0x7a | dump_stack+0x6e/0x88 | regmap_mmio_write32le+0x18/0x46 | check_preemption_disabled+0xa4/0xaa | regmap_mmio_write32le+0x18/0x46 | regmap_mmio_write+0x26/0x44 | regmap_write+0x28/0x48 | sifive_gpio_probe+0xc0/0x1da Although it's possible to fix the driver in this case, other splats have been seen from other drivers, including the infamous 8250 UART, and so it's better to address this problem in the mmiowb core itself. Fix mmiowb_set_pending() by using the raw_cpu_ptr() to get at the mmiowb state and then only updating the 'mmiowb_pending' field if we are not preemptible (i.e. we have a non-zero nesting count). Cc: Arnd Bergmann Cc: Paul Walmsley Cc: Guo Ren Cc: Michael Ellerman Reported-by: Palmer Dabbelt Reported-by: Emil Renner Berthing Tested-by: Emil Renner Berthing Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20200716112816.7356-1-will@kernel.org Signed-off-by: Will Deacon commit 60379ba08532eca861e933b389526a4dc89e0c42 Author: Takashi Iwai Date: Fri Jul 17 10:40:23 2020 +0200 ALSA: info: Drop WARN_ON() from buffer NULL sanity check snd_info_get_line() has a sanity check of NULL buffer -- both buffer itself being NULL and buffer->buffer being NULL. Basically both checks are valid and necessary, but the problem is that it's with snd_BUG_ON() macro that triggers WARN_ON(). The latter condition (NULL buffer->buffer) can be met arbitrarily by user since the buffer is allocated at the first write, so it means that user can trigger WARN_ON() at will. This patch addresses it by simply moving buffer->buffer NULL check out of snd_BUG_ON() so that spurious WARNING is no longer triggered. Reported-by: syzbot+e42d0746c3c3699b6061@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/20200717084023.5928-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 95a35b42bc6e5d8ce7baff8aefed10e9829e7ae5 Author: Sabrina Dubroca Date: Thu Jul 16 10:09:03 2020 +0200 xfrm: policy: fix IPv6-only espintcp compilation In case we're compiling espintcp support only for IPv6, we should still initialize the common code. Fixes: 26333c37fc28 ("xfrm: add IPv6 support for espintcp") Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit e229c877cde141a4c46cb603a341ce8c909e9a98 Author: Sabrina Dubroca Date: Thu Jul 16 10:09:02 2020 +0200 espintcp: recv() should return 0 when the peer socket is closed man 2 recv says: RETURN VALUE When a stream socket peer has performed an orderly shutdown, the return value will be 0 (the traditional "end-of-file" return). Currently, this works for blocking reads, but non-blocking reads will return -EAGAIN. This patch overwrites that return value when the peer won't send us any more data. Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)") Reported-by: Andrew Cagney Tested-by: Andrew Cagney Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit ac1321efb14284f5572dcba57aa9da362faba751 Author: Sabrina Dubroca Date: Thu Jul 16 10:09:01 2020 +0200 espintcp: support non-blocking sends Currently, non-blocking sends from userspace result in EOPNOTSUPP. To support this, we need to tell espintcp_sendskb_locked() and espintcp_sendskmsg_locked() that non-blocking operation was requested from espintcp_sendmsg(). Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)") Reported-by: Andrew Cagney Tested-by: Andrew Cagney Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 8882572675c1bb1cc544f4e229a11661f1fc52e4 Merge: 07a56bb875af adbe8a3cae94 Author: Linus Torvalds Date: Thu Jul 16 21:39:51 2020 -0700 Merge tag 'drm-fixes-2020-07-17-1' of git://anongit.freedesktop.org/drm/drm into master Pull drm fixes from Dave Airlie: "Weekly fixes pull, big bigger than I'd normally like, but they are fairly scattered and small individually. The vmwgfx one is a black screen regression, otherwise the largest is an MST encoder fix for amdgpu which results in a WARN in some cases, and a scattering of i915 fixes. I'm tracking two regressions at the moment that hopefully we get nailed down this week for rc7. dma-buf: - sleeping atomic fix amdgpu: - Fix a race condition with KIQ - Preemption fix - Fix handling of fake MST encoders - OLED panel fix - Handle allocation failure in stream construction - Renoir SMC fix - SDMA 5.x fix i915: - FBC w/a stride fix - Fix use-after-free fix on module reload - Ignore irq enabling on the virtual engines to fix device sleep - Use GTT when saving/restoring engine GPR - Fix selftest sort function vmwgfx: - black screen fix aspeed: - fbcon init warn fix" * tag 'drm-fixes-2020-07-17-1' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu/sdma5: fix wptr overwritten in ->get_wptr() drm/amdgpu/powerplay: Modify SMC message name for setting power profile mode drm/amd/display: handle failed allocation during stream construction drm/amd/display: OLED panel backlight adjust not work with external display connected drm/amdgpu/display: create fake mst encoders ahead of time (v4) drm/amdgpu: fix preemption unit test drm/amdgpu/gfx10: fix race condition for kiq drm/i915: Recalculate FBC w/a stride when needed drm/i915: Move cec_notifier to intel_hdmi_connector_unregister, v2. drm/i915/gt: Only swap to a random sibling once upon creation drm/i915/gt: Ignore irq enabling on the virtual engines drm/i915/perf: Use GTT when saving/restoring engine GPR drm/i915/selftests: Fix compare functions provided for sorting drm/vmwgfx: fix update of display surface when resolution changes dmabuf: use spinlock to access dmabuf->name drm/aspeed: Call drm_fbdev_generic_setup after drm_dev_register commit adbe8a3cae94a63e9f416795c750237a9b789124 Merge: 524d4f71e755 05051496b262 Author: Dave Airlie Date: Fri Jul 17 13:29:00 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-07-15' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-07-15: amdgpu: - Fix a race condition with KIQ - Preemption fix - Fix handling of fake MST encoders - OLED panel fix - Handle allocation failure in stream construction - Renoir SMC fix - SDMA 5.x fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200715213914.3994-1-alexander.deucher@amd.com commit 01cfcde9c26d8555f0e6e9aea9d6049f87683998 Author: Vincent Guittot Date: Fri Jul 10 17:24:26 2020 +0200 sched/fair: handle case of task_h_load() returning 0 task_h_load() can return 0 in some situations like running stress-ng mmapfork, which forks thousands of threads, in a sched group on a 224 cores system. The load balance doesn't handle this correctly because env->imbalance never decreases and it will stop pulling tasks only after reaching loop_max, which can be equal to the number of running tasks of the cfs. Make sure that imbalance will be decreased by at least 1. misfit task is the other feature that doesn't handle correctly such situation although it's probably more difficult to face the problem because of the smaller number of CPUs and running tasks on heterogenous system. We can't simply ensure that task_h_load() returns at least one because it would imply to handle underflow in other places. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Cc: # v4.4+ Link: https://lkml.kernel.org/r/20200710152426.16981-1-vincent.guittot@linaro.org commit 473309fb8372365ad211f425bca760af800e10a7 Author: Sergey Organov Date: Wed Jul 15 19:10:00 2020 +0300 net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration From Documentation/networking/timestamping.txt: A driver which supports hardware time stamping shall update the struct with the actual, possibly more permissive configuration. Do update the struct passed when we upscale the requested time stamping mode. Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.") Signed-off-by: Sergey Organov Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit b041ef0e58d1b8efc6cc7956808a2b80dbf58316 Merge: d943a9c83e3d 2a4117df9b43 Author: Arnd Bergmann Date: Thu Jul 16 22:08:21 2020 +0200 Merge tag 'omap-for-v5.8/fixes-rc5-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps for v5.8-rc cycle Few fixes for issues noticed during testing: - Two DEBUG_ATOMIC_SLEEP fixes for ti-sysc interconnect target module driver - A regression fix for ti-sysc no-idle handling that caused issues compared to earlier platform data based booting - A fix for memory leak for omap_hwmod_allocate_module - Fix d_can driver probe for am437x * tag 'omap-for-v5.8/fixes-rc5-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Fix dcan driver probe failed on am437x platform ARM: OMAP2+: Fix possible memory leak in omap_hwmod_allocate_module bus: ti-sysc: Do not disable on suspend for no-idle bus: ti-sysc: Fix sleeping function called from invalid context for RTC quirk bus: ti-sysc: Fix wakeirq sleeping function called from invalid context Link: https://lore.kernel.org/r/pull-1594840100-132735@atomide.com Signed-off-by: Arnd Bergmann commit d943a9c83e3dd42fb1c6f9cf5ff706effeb19fc5 Merge: c07e902a511e 7f6e8dffc30b Author: Arnd Bergmann Date: Thu Jul 16 22:08:07 2020 +0200 Merge tag 'imx-fixes-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.8, round 2: - A couple of fixes on i.MX platform device registration code to stop the use of invalid IRQ 0. - Fix a regression seen on ls1021a platform, caused by commit 52102a3ba6a61 ("soc: imx: move cpu code to drivers/soc/imx"). - Fix a misconfiguration of audio SSI on imx6qdl-gw551x board. * tag 'imx-fixes-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: check ls1021a ARM: imx: Remove imx_add_imx_dma() unused irq_err argument ARM: imx: Provide correct number of resources when registering gpio devices ARM: dts: imx6qdl-gw551x: fix audio SSI Link: https://lore.kernel.org/r/20200714145649.GP15718@dragon Signed-off-by: Arnd Bergmann commit c07e902a511eb80ae116184dcf17c647a02f2316 Merge: 11ba468877bb 54320dcaa252 Author: Arnd Bergmann Date: Thu Jul 16 22:07:47 2020 +0200 Merge tag 'amlogic-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/fixes Amlogic fixes for v5.8-rc - misc DT fixes, and SoC ID fixes * tag 'amlogic-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: ARM: dts: meson: Align L2 cache-controller nodename with dtschema arm64: dts: meson-gxl-s805x: reduce initial Mali450 core frequency arm64: dts: meson: add missing gxl rng clock soc: amlogic: meson-gx-socinfo: Fix S905X3 and S905D3 ID's Link: https://lore.kernel.org/r/7hk0zc1ujc.fsf@baylibre.com Signed-off-by: Arnd Bergmann commit 299632e54b2e692d2830af84be51172480dc1e26 Author: Douglas Anderson Date: Wed Jul 15 16:46:15 2020 -0700 regmap: debugfs: Don't sleep while atomic for fast_io regmaps If a regmap has "fast_io" set then its lock function uses a spinlock. That doesn't work so well with the functions: * regmap_cache_only_write_file() * regmap_cache_bypass_write_file() Both of the above functions have the pattern: 1. Lock the regmap. 2. Call: debugfs_write_file_bool() copy_from_user() __might_fault() __might_sleep() Let's reorder things a bit so that we do all of our sleepable functions before we grab the lock. Fixes: d3dc5430d68f ("regmap: debugfs: Allow writes to cache state settings") Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200715164611.1.I35b3533e8a80efde0cec1cc70f71e1e74b2fa0da@changeid Signed-off-by: Mark Brown commit fe0a53044b4bce947045eadd7fa1adbc4685afab Author: Oder Chiou Date: Thu Jul 16 11:01:23 2020 +0800 ASoC: rt5682: Report the button event in the headset type only The irq work will be manipulated by resume function, and it will report the wrong jack type while the jack type is headphone in the button event. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200716030123.27122-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit b3df80ab6d147d4738be242e1c91e5fdbb6b03ef Author: Jing Xiangfeng Date: Tue Jul 14 16:09:18 2020 +0800 ASoC: Intel: bytcht_es8316: Add missed put_device() snd_byt_cht_es8316_mc_probe() misses to call put_device() in an error path. Add the missed function call to fix it. Fixes: ba49cf6f8e4a ("ASoC: Intel: bytcht_es8316: Add quirk for inverted jack detect") Signed-off-by: Jing Xiangfeng Reviewed-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200714080918.148196-1-jingxiangfeng@huawei.com Signed-off-by: Mark Brown commit 07a56bb875afbe39dabbf6ba7b83783d166863db Merge: 3e543a4d3001 1740f21af58b Author: Linus Torvalds Date: Thu Jul 16 11:57:43 2020 -0700 Merge tag 'pm-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm into master Pull power management fixes from Rafael Wysocki: "Add missing handling of a command line switch to the intel_pstate driver (Rafael Wysocki) and fix the freeing of the operating performance point (OPP) entries for the legacy (v1) OPP table type (Walter Lozano)" * tag 'pm-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: opp: Increase parsed_static_opps in _of_add_opp_table_v1() cpufreq: intel_pstate: Fix active mode setting from command line commit 3e543a4d30014d45b6bb5d2095554be02153cefc Merge: 50ad1c2155a3 897c44f0bae5 Author: Linus Torvalds Date: Thu Jul 16 11:26:40 2020 -0700 Merge tag 'char-misc-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc into master Pull char/misc fixes from Greg KH: "Here are number of small char/misc driver fixes for 5.8-rc6 Not that many complex fixes here, just a number of small fixes for reported issues, and some new device ids. Nothing fancy. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) virtio: virtio_console: add missing MODULE_DEVICE_TABLE() for rproc serial intel_th: Fix a NULL dereference when hub driver is not loaded intel_th: pci: Add Emmitsburg PCH support intel_th: pci: Add Tiger Lake PCH-H support intel_th: pci: Add Jasper Lake CPU support virt: vbox: Fix guest capabilities mask check virt: vbox: Fix VBGL_IOCTL_VMMDEV_REQUEST_BIG and _LOG req numbers to match upstream uio_pdrv_genirq: fix use without device tree and no interrupt uio_pdrv_genirq: Remove warning when irq is not specified coresight: etmv4: Fix CPU power management setup in probe() function coresight: cti: Fix error handling in probe Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" mei: bus: don't clean driver pointer misc: atmel-ssc: lock with mutex instead of spinlock phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked phy: rockchip: Fix return value of inno_dsidphy_probe() phy: ti: j721e-wiz: Constify structs phy: ti: am654-serdes: Constify regmap_config phy: intel: fix enum type mismatch warning phy: intel: Fix compilation error on FIELD_PREP usage ... commit 340746398b67e3ce5019698748ebaa7adf048114 Author: Sergey Organov Date: Tue Jul 14 19:28:02 2020 +0300 net: fec: fix hardware time stamping by external devices Fix support for external PTP-aware devices such as DSA or PTP PHY: Make sure we never time stamp tx packets when hardware time stamping is disabled. Check for PTP PHY being in use and then pass ioctls related to time stamping of Ethernet packets to the PTP PHY rather than handle them ourselves. In addition, disable our own hardware time stamping in this case. Fixes: 6605b730c061 ("FEC: Add time stamping code and a PTP hardware clock") Signed-off-by: Sergey Organov Acked-by: Richard Cochran Acked-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 50ad1c2155a32dc68e0da8efcc6d95429869076e Merge: 6a058f0be518 2451e746478a Author: Linus Torvalds Date: Thu Jul 16 11:20:23 2020 -0700 Merge tag 'driver-core-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core into master Pull driver core fixes from Greg KH: "Here are 3 driver core fixes for 5.8-rc6. They resolve some issues found with the deferred probe code for some types of devices on some embedded systems. They have been tested a bunch and have been in linux-next for a while with no reported issues" * tag 'driver-core-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: driver core: Avoid deferred probe due to fw_devlink_pause/resume() driver core: Rename dev_links_info.defer_sync to defer_hook driver core: Don't do deferred probe in parallel with kernel_init thread commit 6a058f0be518bbb10aadd3c5d18516f91b1a4a04 Merge: 7531ee3147ed ef75e14a6c93 Author: Linus Torvalds Date: Thu Jul 16 11:17:41 2020 -0700 Merge tag 'staging-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging into master Pull IIO and staging driver fixes from Greg KH: "Here are some IIO and staging driver fixes for 5.8-rc6. The majority of fixes are for IIO drivers, resolving a number of small reported issues, and there are some counter fixes in here too that were tied to the IIO fixes. There's only one staging driver fix here, a comedi fix found by code inspection. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: comedi: verify array index is correct before using it iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()' iio:pressure:ms5611 Fix buffer element alignment iio:humidity:hts221 Fix alignment and data leak issues iio:humidity:hdc100x Fix alignment and data leak issues iio:magnetometer:ak8974: Fix alignment and data leak issues iio: adc: adi-axi-adc: Fix object reference counting iio: pressure: zpa2326: handle pm_runtime_get_sync failure counter: 104-quad-8: Add lock guards - filter clock prescaler counter: 104-quad-8: Add lock guards - differential encoder iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers iio: magnetometer: ak8974: Fix runtime PM imbalance on error iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe() iio:health:afe4404 Fix timestamp alignment and prevent data leak. iio:health:afe4403 Fix timestamp alignment and prevent data leak. commit 7531ee3147ed2fad5d5bbbd22880eea969dfc291 Merge: 7e8d2f6d4d8f f743061a85f5 Author: Linus Torvalds Date: Thu Jul 16 11:10:27 2020 -0700 Merge tag 'tty-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty into master Pull tty/serial driver fixes from Greg KH: :Here are some small tty and serial driver fixes for 5.8-rc6. The largest set of patches in here is a revert of the sysrq changes that went into 5.8-rc1 but turned out to cause a noticable overhead and cpu usage. Other than that, there's a few small serial driver fixes to resolve reported issues, and finally resolving the spinlock init problem on many serial driver consoles. All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: core: Initialise spin lock before use in uart_configure_port() serial: mxs-auart: add missed iounmap() in probe failure and remove serial: sh-sci: Initialize spinlock for uart console Revert "tty: xilinx_uartps: Fix missing id assignment to the console" serial: core: drop redundant sysrq checks serial: core: fix sysrq overhead regression Revert "serial: core: Refactor uart_unlock_and_check_sysrq()" tty/serial: fix serial_core.c kernel-doc warnings tty: serial: cpm_uart: Fix behaviour for non existing GPIOs commit 7e8d2f6d4d8fa6adc5075d39184c2ce713ce168e Merge: f8456690ba8e a8f62f183021 Author: Linus Torvalds Date: Thu Jul 16 11:08:54 2020 -0700 Merge tag 'thermal-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux into master Pull thermal fixes from Daniel Lezcano: - Fix invalid index array access on int340x_thermal leading to a kernel panic (Bartosz Szczepanek) - Fix debug message level to prevent flooding on some platform (Alex Hung) - Fix invalid bank access by reverting "thermal: mediatek: fix register index error" (Enric Balletbo i Serra) * tag 'thermal-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: Revert "thermal: mediatek: fix register index error" thermal: int3403_thermal: Downgrade error message thermal/int340x_thermal: Prevent page fault on .set_mode() op commit 1740f21af58b89a072f33ae0912d5acf95314f22 Merge: a6c99daa8c9b 39a188b88332 Author: Rafael J. Wysocki Date: Thu Jul 16 19:17:01 2020 +0200 Merge branch 'pm-cpufreq' * pm-cpufreq: cpufreq: intel_pstate: Fix active mode setting from command line commit c7300cdf8f683ae00cf74616b5fd14ffac327979 Merge: d1c0d96535d7 e7b931bee739 Author: Greg Kroah-Hartman Date: Thu Jul 16 17:30:59 2020 +0200 Merge tag 'usb-serial-5.8-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.8-rc6 Here's a fix for 5.8 addressing a long-standing bug in iuu_phoenix. * tag 'usb-serial-5.8-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: iuu_phoenix: fix memory corruption commit 81e96851ea32deb2c921c870eecabf335f598aeb Author: Arnd Bergmann Date: Wed May 27 15:53:46 2020 +0200 x86: math-emu: Fix up 'cmp' insn for clang ias The clang integrated assembler requires the 'cmp' instruction to have a length prefix here: arch/x86/math-emu/wm_sqrt.S:212:2: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', or 'cmpl') cmp $0xffffffff,-24(%ebp) ^ Make this a 32-bit comparison, which it was clearly meant to be. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Reviewed-by: Nick Desaulniers Link: https://lkml.kernel.org/r/20200527135352.1198078-1-arnd@arndb.de commit 5769fe26f389b0002ed48fd16d642a1d86edaf79 Author: Sedat Dilek Date: Tue Jul 14 21:47:40 2020 +0200 x86/entry: Fix vectors to IDTENTRY_SYSVEC for CONFIG_HYPERV When assembling with Clang via `make LLVM_IAS=1` and CONFIG_HYPERV enabled, we observe the following error: :9:6: error: expected absolute expression .if HYPERVISOR_REENLIGHTENMENT_VECTOR == 3 ^ :1:1: note: while in macro instantiation idtentry HYPERVISOR_REENLIGHTENMENT_VECTOR asm_sysvec_hyperv_reenlightenment sysvec_hyperv_reenlightenment has_error_code=0 ^ ./arch/x86/include/asm/idtentry.h:627:1: note: while in macro instantiation idtentry_sysvec HYPERVISOR_REENLIGHTENMENT_VECTOR sysvec_hyperv_reenlightenment; ^ :9:6: error: expected absolute expression .if HYPERVISOR_STIMER0_VECTOR == 3 ^ :1:1: note: while in macro instantiation idtentry HYPERVISOR_STIMER0_VECTOR asm_sysvec_hyperv_stimer0 sysvec_hyperv_stimer0 has_error_code=0 ^ ./arch/x86/include/asm/idtentry.h:628:1: note: while in macro instantiation idtentry_sysvec HYPERVISOR_STIMER0_VECTOR sysvec_hyperv_stimer0; This is caused by typos in arch/x86/include/asm/idtentry.h: HYPERVISOR_REENLIGHTENMENT_VECTOR -> HYPERV_REENLIGHTENMENT_VECTOR HYPERVISOR_STIMER0_VECTOR -> HYPERV_STIMER0_VECTOR For more details see ClangBuiltLinux issue #1088. Fixes: a16be368dd3f ("x86/entry: Convert various hypervisor vectors to IDTENTRY_SYSVEC") Suggested-by: Nick Desaulniers Signed-off-by: Sedat Dilek Signed-off-by: Thomas Gleixner Reviewed-by: Nathan Chancellor Reviewed-by: Wei Liu Reviewed-by: Nick Desaulniers Link: https://github.com/ClangBuiltLinux/linux/issues/1088 Link: https://github.com/ClangBuiltLinux/linux/issues/1043 Link: https://lore.kernel.org/patchwork/patch/1272115/ Link: https://lkml.kernel.org/r/20200714194740.4548-1-sedat.dilek@gmail.com commit 6ee93f8df09c470da1a4af11e394c52d7b62418c Author: Jian Cai Date: Tue Jul 14 16:30:21 2020 -0700 x86/entry: Add compatibility with IAS Clang's integrated assembler does not allow symbols with non-absolute values to be reassigned. Modify the interrupt entry loop macro to be compatible with IAS by using a label and an offset. Reported-by: Nick Desaulniers Reported-by: Sedat Dilek Suggested-by: Nick Desaulniers Suggested-by: Brian Gerst Suggested-by: Arvind Sankar Signed-off-by: Jian Cai Signed-off-by: Thomas Gleixner Tested-by: Sedat Dilek # Link: https://github.com/ClangBuiltLinux/linux/issues/1043 Link: https://lkml.kernel.org/r/20200714233024.1789985-1-caij2003@gmail.com commit 1f273e255b285282707fa3246391f66e9dc4178f Merge: 579dd91ab3a5 05b29021fba5 Author: Jens Axboe Date: Thu Jul 16 08:58:14 2020 -0600 Merge branch 'nvme-5.8' of git://git.infradead.org/nvme into block-5.8 Pull NVMe fix from Christoph. * 'nvme-5.8' of git://git.infradead.org/nvme: nvme: explicitly update mpath disk capacity on revalidation commit a6c99daa8c9bbed28a459fd9e6cf62a5fef623d8 Merge: 11ba468877bb 6544abc520f0 Author: Rafael J. Wysocki Date: Thu Jul 16 16:48:13 2020 +0200 Merge branch 'opp/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull an operating performance points (OPP) framework fix for 5.8-rc6 from Viresh Kumar: "This fixes freeing of the OPP entries for the legacy OPP table type (v1)." * 'opp/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: opp: Increase parsed_static_opps in _of_add_opp_table_v1() commit 05b29021fba5e725dd385151ef00b6340229b500 Author: Anthony Iliopoulos Date: Tue Jul 14 13:11:59 2020 +0200 nvme: explicitly update mpath disk capacity on revalidation Commit 3b4b19721ec652 ("nvme: fix possible deadlock when I/O is blocked") reverted multipath head disk revalidation due to deadlocks caused by holding the bd_mutex during revalidate. Updating the multipath disk blockdev size is still required though for userspace to be able to observe any resizing while the device is mounted. Directly update the bdev inode size to avoid unnecessarily holding the bdev->bd_mutex. Fixes: 3b4b19721ec652 ("nvme: fix possible deadlock when I/O is blocked") Signed-off-by: Anthony Iliopoulos Signed-off-by: Christoph Hellwig commit c3c0c2e18d943ec4a84162ac679970b592555a4a Author: Douglas Anderson Date: Tue Jul 14 08:04:17 2020 -0700 pinctrl: qcom: Handle broken/missing PDC dual edge IRQs on sc7180 Depending on how you look at it, you can either say that: a) There is a PDC hardware issue (with the specific IP rev that exists on sc7180) that causes the PDC not to work properly when configured to handle dual edges. b) The dual edge feature of the PDC hardware was only added in later HW revisions and thus isn't in all hardware. Regardless of how you look at it, let's work around the lack of dual edge support by only ever letting our parent see requests for single edge interrupts on affected hardware. NOTE: it's possible that a driver requesting a dual edge interrupt might get several edges coalesced into a single IRQ. For instance if a line starts low and then goes high and low again, the driver that requested the IRQ is not guaranteed to be called twice. However, it is guaranteed that once the driver's interrupt handler starts running its first instruction that any new edges coming in will cause the interrupt to fire again. This is relatively commonplace for dual-edge gpio interrupts (many gpio controllers require software to emulate dual edge with single edge) so client drivers should be setup to handle it. Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy") Signed-off-by: Douglas Anderson Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20200714080254.v3.1.Ie0d730120b232a86a4eac1e2909bcbec844d1766@changeid Signed-off-by: Linus Walleij commit 87c4c774cbef5c68b3df96827c2fb07f1aa80152 Author: Maor Gottlieb Date: Thu Jul 16 13:55:19 2020 +0300 RDMA/cm: Protect access to remote_sidr_table cm.lock must be held while accessing remote_sidr_table. This fixes the below NULL pointer dereference. BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] SMP PTI CPU: 2 PID: 7288 Comm: udaddy Not tainted 5.7.0_for_upstream_perf_2020_06_09_15_14_20_38 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 RIP: 0010:rb_erase+0x10d/0x360 Code: 00 00 00 48 89 c1 48 89 d0 48 8b 50 08 48 39 ca 74 48 f6 02 01 75 af 48 8b 7a 10 48 89 c1 48 83 c9 01 48 89 78 08 48 89 42 10 <48> 89 0f 48 8b 08 48 89 0a 48 83 e1 fc 48 89 10 0f 84 b1 00 00 00 RSP: 0018:ffffc90000f77c30 EFLAGS: 00010086 RAX: ffff8883df27d458 RBX: ffff8883df27da58 RCX: ffff8883df27d459 RDX: ffff8883d183fa58 RSI: ffffffffa01e8d00 RDI: 0000000000000000 RBP: ffff8883d62ac800 R08: 0000000000000000 R09: 00000000000000ce R10: 000000000000000a R11: 0000000000000000 R12: ffff8883df27da00 R13: ffffc90000f77c98 R14: 0000000000000130 R15: 0000000000000000 FS: 00007f009f877740(0000) GS:ffff8883f1a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000003d467e003 CR4: 0000000000160ee0 Call Trace: cm_send_sidr_rep_locked+0x15a/0x1a0 [ib_cm] ib_send_cm_sidr_rep+0x2b/0x50 [ib_cm] cma_send_sidr_rep+0x8b/0xe0 [rdma_cm] __rdma_accept+0x21d/0x2b0 [rdma_cm] ? ucma_get_ctx+0x2b/0xe0 [rdma_ucm] ? _copy_from_user+0x30/0x60 ucma_accept+0x13e/0x1e0 [rdma_ucm] ucma_write+0xb4/0x130 [rdma_ucm] vfs_write+0xad/0x1a0 ksys_write+0x9d/0xb0 do_syscall_64+0x48/0x130 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f009ef60924 Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 80 00 00 00 00 8b 05 2a ef 2c 00 48 63 ff 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 f3 c3 66 90 55 53 48 89 d5 48 89 f3 48 83 RSP: 002b:00007fff843edf38 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000055743042e1d0 RCX: 00007f009ef60924 RDX: 0000000000000130 RSI: 00007fff843edf40 RDI: 0000000000000003 RBP: 00007fff843ee0e0 R08: 0000000000000000 R09: 0000557430433090 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff843edf40 R14: 000000000000038c R15: 00000000ffffff00 CR2: 0000000000000000 Fixes: 6a8824a74bc9 ("RDMA/cm: Allow ib_send_cm_sidr_rep() to be done under lock") Link: https://lore.kernel.org/r/20200716105519.1424266-1-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0d1fd39bb27e479fb1de3dd4b4c247c7c9a1fabf Author: Leon Romanovsky Date: Thu Jul 16 13:20:59 2020 +0300 RDMA/core: Fix race in rdma_alloc_commit_uobject() The FD should not be installed until all of the setup is completed as the fd_install() transfers ownership of the kref to the FD table. A thread can race a close() and trigger concurrent rdma_alloc_commit_uobject() and uverbs_uobject_fd_release() which, at least, triggers a safety WARN_ON: WARNING: CPU: 4 PID: 6913 at drivers/infiniband/core/rdma_core.c:768 uverbs_uobject_fd_release+0x202/0x230 Kernel panic - not syncing: panic_on_warn set ... CPU: 4 PID: 6913 Comm: syz-executor.3 Not tainted 5.7.0-rc2 #22 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [..] RIP: 0010:uverbs_uobject_fd_release+0x202/0x230 Code: fe 4c 89 e7 e8 af 23 fe ff e9 2a ff ff ff e8 c5 fa 61 fe be 03 00 00 00 4c 89 e7 e8 68 eb f5 fe e9 13 ff ff ff e8 ae fa 61 fe <0f> 0b eb ac e8 e5 aa 3c fe e8 50 2b 86 fe e9 6a fe ff ff e8 46 2b RSP: 0018:ffffc90008117d88 EFLAGS: 00010293 RAX: ffff88810e146580 RBX: 1ffff92001022fb1 RCX: ffffffff82d5b902 RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff88811951b040 RBP: ffff88811951b000 R08: ffffed10232a3609 R09: ffffed10232a3609 R10: ffff88811951b043 R11: 0000000000000001 R12: ffff888100a7c600 R13: ffff888100a7c650 R14: ffffc90008117da8 R15: ffffffff82d5b700 ? __uverbs_cleanup_ufile+0x270/0x270 ? uverbs_uobject_fd_release+0x202/0x230 ? uverbs_uobject_fd_release+0x202/0x230 ? __uverbs_cleanup_ufile+0x270/0x270 ? locks_remove_file+0x282/0x3d0 ? security_file_free+0xaa/0xd0 __fput+0x2be/0x770 task_work_run+0x10e/0x1b0 exit_to_usermode_loop+0x145/0x170 do_syscall_64+0x2d0/0x390 ? prepare_exit_to_usermode+0x17a/0x230 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x414da7 Code: 00 00 0f 05 48 3d 00 f0 ff ff 77 3f f3 c3 0f 1f 44 00 00 53 89 fb 48 83 ec 10 e8 f4 fb ff ff 89 df 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 2b 89 d7 89 44 24 0c e8 36 fc ff ff 8b 44 24 RSP: 002b:00007fff39d379d0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000414da7 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 00007fff39d37a3c R08: 0000000400000000 R09: 0000000400000000 R10: 00007fff39d37910 R11: 0000000000000293 R12: 0000000000000001 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000003 Reorder so that fd_install() is the last thing done in rdma_alloc_commit_uobject(). Fixes: aba94548c9e4 ("IB/uverbs: Move the FD uobj type struct file allocation to alloc_commit") Link: https://lore.kernel.org/r/20200716102059.1420681-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 79d5208386523183ae5cd359a9d1c024f46b1202 Author: Xi Wang Date: Tue Jul 14 19:42:15 2020 +0800 RDMA/hns: Fix wrong PBL offset when VA is not aligned to PAGE_SIZE ROCE uses "VA % buf_page_size" to caclulate the offset in the PBL's first page, the actual PA corresponding to the MR's VA is equal to MR's PA plus this offset. The first PA in PBL has already been aligned to PAGE_SIZE after calling ib_umem_get(), but the MR's VA may not. If the buf_page_size is smaller than the PAGE_SIZE, this will lead the HW to access the wrong memory because the offset is smaller than expected. Fixes: 9b2cf76c9f05 ("RDMA/hns: Optimize PBL buffer allocation process") Link: https://lore.kernel.org/r/1594726935-45666-1-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 7b9bd73ed13d3c399f76bb7578cbe1b9e5a8e8b0 Author: Weihang Li Date: Tue Jul 14 19:28:58 2020 +0800 RDMA/hns: Fix wrong assignment of lp_pktn_ini in QPC The RoCE Engine will schedule to another QP after one has sent (2 ^ lp_pktn_ini) packets. lp_pktn_ini is set in QPC and should be calculated from 2 factors: 1. current MTU as a integer 2. the RoCE Engine's maximum slice length 64KB But the driver use MTU as a enum ib_mtu and the max inline capability, the lp_pktn_ini will be much bigger than expected which may cause traffic of some QPs to never get scheduled. Fixes: b713128de7a1 ("RDMA/hns: Adjust lp_pktn_ini dynamically") Link: https://lore.kernel.org/r/1594726138-49294-1-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit c3d6057e07a5d15be7c69ea545b3f91877808c96 Author: Maor Gottlieb Date: Sun Jul 12 13:26:41 2020 +0300 RDMA/mlx5: Use xa_lock_irq when access to SRQ table SRQ table is accessed both from interrupt and process context, therefore we must use xa_lock_irq. inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. kworker/u17:9/8573 takes: ffff8883e3503d30 (&xa->xa_lock#13){?...}-{2:2}, at: mlx5_cmd_get_srq+0x18/0x70 [mlx5_ib] {IN-HARDIRQ-W} state was registered at: lock_acquire+0xb9/0x3a0 _raw_spin_lock+0x25/0x30 srq_event_notifier+0x2b/0xc0 [mlx5_ib] notifier_call_chain+0x45/0x70 __atomic_notifier_call_chain+0x69/0x100 forward_event+0x36/0xc0 [mlx5_core] notifier_call_chain+0x45/0x70 __atomic_notifier_call_chain+0x69/0x100 mlx5_eq_async_int+0xc5/0x160 [mlx5_core] notifier_call_chain+0x45/0x70 __atomic_notifier_call_chain+0x69/0x100 mlx5_irq_int_handler+0x19/0x30 [mlx5_core] __handle_irq_event_percpu+0x43/0x2a0 handle_irq_event_percpu+0x30/0x70 handle_irq_event+0x34/0x60 handle_edge_irq+0x7c/0x1b0 do_IRQ+0x60/0x110 ret_from_intr+0x0/0x2a default_idle+0x34/0x160 do_idle+0x1ec/0x220 cpu_startup_entry+0x19/0x20 start_secondary+0x153/0x1a0 secondary_startup_64+0xa4/0xb0 irq event stamp: 20907 hardirqs last enabled at (20907): _raw_spin_unlock_irq+0x24/0x30 hardirqs last disabled at (20906): _raw_spin_lock_irq+0xf/0x40 softirqs last enabled at (20746): __do_softirq+0x2c9/0x436 softirqs last disabled at (20681): irq_exit+0xb3/0xc0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&xa->xa_lock#13); lock(&xa->xa_lock#13); *** DEADLOCK *** 2 locks held by kworker/u17:9/8573: #0: ffff888295218d38 ((wq_completion)mlx5_ib_page_fault){+.+.}-{0:0}, at: process_one_work+0x1f1/0x5f0 #1: ffff888401647e78 ((work_completion)(&pfault->work)){+.+.}-{0:0}, at: process_one_work+0x1f1/0x5f0 stack backtrace: CPU: 0 PID: 8573 Comm: kworker/u17:9 Tainted: GO 5.7.0_for_upstream_min_debug_2020_06_14_11_31_46_41 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5_ib_page_fault mlx5_ib_eqe_pf_action [mlx5_ib] Call Trace: dump_stack+0x71/0x9b mark_lock+0x4f2/0x590 ? print_shortest_lock_dependencies+0x200/0x200 __lock_acquire+0xa00/0x1eb0 lock_acquire+0xb9/0x3a0 ? mlx5_cmd_get_srq+0x18/0x70 [mlx5_ib] _raw_spin_lock+0x25/0x30 ? mlx5_cmd_get_srq+0x18/0x70 [mlx5_ib] mlx5_cmd_get_srq+0x18/0x70 [mlx5_ib] mlx5_ib_eqe_pf_action+0x257/0xa30 [mlx5_ib] ? process_one_work+0x209/0x5f0 process_one_work+0x27b/0x5f0 ? __schedule+0x280/0x7e0 worker_thread+0x2d/0x3c0 ? process_one_work+0x5f0/0x5f0 kthread+0x111/0x130 ? kthread_park+0x90/0x90 ret_from_fork+0x24/0x30 Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Link: https://lore.kernel.org/r/20200712102641.15210-1-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5afc78551bf5d53279036e0bf63314e35631d79f Author: Will Deacon Date: Thu Feb 13 12:12:26 2020 +0000 arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP Rather than open-code test_tsk_thread_flag() at each callsite, simply replace the couple of offenders with calls to test_tsk_thread_flag() directly. Signed-off-by: Will Deacon commit d83ee6e3e75db6f518ef2b0858f163849f2ddeb7 Author: Will Deacon Date: Fri Jul 10 13:20:57 2020 +0100 arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter() Setting a system call number of -1 is special, as it indicates that the current system call should be skipped. Use NO_SYSCALL instead of -1 when checking for this scenario, which is different from the -1 returned due to a seccomp failure. Cc: Mark Rutland Cc: Keno Fischer Cc: Luis Machado Signed-off-by: Will Deacon commit 139dbe5d8ed383cbd1ada56c78dbbbd35bf6a9d3 Author: Will Deacon Date: Fri Jul 3 09:41:24 2020 +0100 arm64: syscall: Expand the comment about ptrace and syscall(-1) If a task executes syscall(-1), we intercept this early and force x0 to be -ENOSYS so that we don't need to distinguish this scenario from one where the scno is -1 because a tracer wants to skip the system call using ptrace. With the return value set, the return path is the same as the skip case. Although there is a one-line comment noting this in el0_svc_common(), it misses out most of the detail. Expand the comment to describe a bit more about what is going on. Cc: Mark Rutland Cc: Keno Fischer Cc: Luis Machado Signed-off-by: Will Deacon commit 59ee987ea47caff8c1e7ba4b89932c6900a35d0c Author: Will Deacon Date: Thu Jul 2 21:14:20 2020 +0100 arm64: ptrace: Add a comment describing our syscall entry/exit trap ABI Our tracehook logic for syscall entry/exit raises a SIGTRAP back to the tracer following a ptrace request such as PTRACE_SYSCALL. As part of this procedure, we clobber the reported value of one of the tracee's general purpose registers (x7 for native tasks, r12 for compat) to indicate whether the stop occurred on syscall entry or exit. This is a slightly unfortunate ABI, as it prevents the tracer from accessing the real register value and is at odds with other similar stops such as seccomp traps. Since we're stuck with this ABI, expand the comment in our tracehook logic to acknowledge the issue and describe the behaviour in more detail. Cc: Mark Rutland Cc: Luis Machado Reported-by: Keno Fischer Signed-off-by: Will Deacon commit 15956689a0e60aa0c795174f3c310b60d8794235 Author: Will Deacon Date: Fri Jul 3 12:08:42 2020 +0100 arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return Although we zero the upper bits of x0 on entry to the kernel from an AArch32 task, we do not clear them on the exception return path and can therefore expose 64-bit sign extended syscall return values to userspace via interfaces such as the 'perf_regs' ABI, which deal exclusively with 64-bit registers. Explicitly clear the upper 32 bits of x0 on return from a compat system call. Cc: Cc: Mark Rutland Cc: Keno Fischer Cc: Luis Machado Signed-off-by: Will Deacon commit 3a5a4366cecc25daa300b9a9174f7fdd352b9068 Author: Will Deacon Date: Thu Feb 13 12:06:26 2020 +0000 arm64: ptrace: Override SPSR.SS when single-stepping is enabled Luis reports that, when reverse debugging with GDB, single-step does not function as expected on arm64: | I've noticed, under very specific conditions, that a PTRACE_SINGLESTEP | request by GDB won't execute the underlying instruction. As a consequence, | the PC doesn't move, but we return a SIGTRAP just like we would for a | regular successful PTRACE_SINGLESTEP request. The underlying problem is that when the CPU register state is restored as part of a reverse step, the SPSR.SS bit is cleared and so the hardware single-step state can transition to the "active-pending" state, causing an unexpected step exception to be taken immediately if a step operation is attempted. In hindsight, we probably shouldn't have exposed SPSR.SS in the pstate accessible by the GPR regset, but it's a bit late for that now. Instead, simply prevent userspace from configuring the bit to a value which is inconsistent with the TIF_SINGLESTEP state for the task being traced. Cc: Cc: Mark Rutland Cc: Keno Fischer Link: https://lore.kernel.org/r/1eed6d69-d53d-9657-1fc9-c089be07f98c@linaro.org Reported-by: Luis Machado Tested-by: Luis Machado Signed-off-by: Will Deacon commit ac2081cdc4d99c57f219c1a6171526e0fa0a6fff Author: Will Deacon Date: Thu Jul 2 21:16:20 2020 +0100 arm64: ptrace: Consistently use pseudo-singlestep exceptions Although the arm64 single-step state machine can be fast-forwarded in cases where we wish to generate a SIGTRAP without actually executing an instruction, this has two major limitations outside of simply skipping an instruction due to emulation. 1. Stepping out of a ptrace signal stop into a signal handler where SIGTRAP is blocked. Fast-forwarding the stepping state machine in this case will result in a forced SIGTRAP, with the handler reset to SIG_DFL. 2. The hardware implicitly fast-forwards the state machine when executing an SVC instruction for issuing a system call. This can interact badly with subsequent ptrace stops signalled during the execution of the system call (e.g. SYSCALL_EXIT or seccomp traps), as they may corrupt the stepping state by updating the PSTATE for the tracee. Resolve both of these issues by injecting a pseudo-singlestep exception on entry to a signal handler and also on return to userspace following a system call. Cc: Cc: Mark Rutland Tested-by: Luis Machado Reported-by: Keno Fischer Signed-off-by: Will Deacon commit bdc5c744c7b6457d18a95c26769dad0e7f480a08 Author: Qi Liu Date: Thu Jul 16 17:19:25 2020 +0800 drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling When users try to remove PMU modules during perf sampling, kernel panic will happen because the pmu->read() is a NULL pointer here. INFO on HiSilicon hip08 platform as follow: pc : hisi_uncore_pmu_event_update+0x30/0xa4 [hisi_uncore_pmu] lr : hisi_uncore_pmu_read+0x20/0x2c [hisi_uncore_pmu] sp : ffff800010103e90 x29: ffff800010103e90 x28: ffff0027db0c0e40 x27: ffffa29a76f129d8 x26: ffffa29a77ceb000 x25: ffffa29a773a5000 x24: ffffa29a77392000 x23: ffffddffe5943f08 x22: ffff002784285960 x21: ffff002784285800 x20: ffff0027d2e76c80 x19: ffff0027842859e0 x18: ffff80003498bcc8 x17: ffffa29a76afe910 x16: ffffa29a7583f530 x15: 16151a1512061a1e x14: 0000000000000000 x13: ffffa29a76f1e238 x12: 0000000000000001 x11: 0000000000000400 x10: 00000000000009f0 x9 : ffff8000107b3e70 x8 : ffff0027db0c1890 x7 : ffffa29a773a7000 x6 : 00000007f5131013 x5 : 00000007f5131013 x4 : 09f257d417c00000 x3 : 00000002187bd7ce x2 : ffffa29a38f0f0d8 x1 : ffffa29a38eae268 x0 : ffff0027d2e76c80 Call trace: hisi_uncore_pmu_event_update+0x30/0xa4 [hisi_uncore_pmu] hisi_uncore_pmu_read+0x20/0x2c [hisi_uncore_pmu] __perf_event_read+0x1a0/0x1f8 flush_smp_call_function_queue+0xa0/0x160 generic_smp_call_function_single_interrupt+0x18/0x20 handle_IPI+0x31c/0x4dc gic_handle_irq+0x2c8/0x310 el1_irq+0xcc/0x180 arch_cpu_idle+0x4c/0x20c default_idle_call+0x20/0x30 do_idle+0x1b4/0x270 cpu_startup_entry+0x28/0x30 secondary_start_kernel+0x1a4/0x1fc To solve the above issue, current module should be registered to kernel, so that try_module_get() can be invoked when perf sampling starts. This adds the reference counting of module and could prevent users from removing modules during sampling. Reported-by: Haifeng Wang Signed-off-by: Qi Liu Reviewed-by: John Garry Link: https://lore.kernel.org/r/1594891165-8228-1-git-send-email-liuqi115@huawei.com Signed-off-by: Will Deacon commit 5734e509d5d515c187f642937ef2de1e58d7715d Author: PeiSen Hou Date: Thu Jul 16 11:01:34 2020 +0200 ALSA: hda/realtek - fixup for yet another Intel reference board Add headset_jack for the intel reference board support with 10ec:1230. Signed-off-by: PeiSen Hou Link: https://lore.kernel.org/r/20200716090134.9811-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit e7b931bee739e8a77ae216e613d3b99342b6dec0 Author: Johan Hovold Date: Wed Jul 15 11:02:45 2020 +0200 USB: serial: iuu_phoenix: fix memory corruption The driver would happily overwrite its write buffer with user data in 256 byte increments due to a removed buffer-space sanity check. Fixes: 5fcf62b0f1f2 ("tty: iuu_phoenix: fix locking.") Cc: stable # 2.6.31 Signed-off-by: Johan Hovold commit 62a8ccf3a248cd222985ee5568b6bd6217282dbc Author: Maxime Ripard Date: Sun Jun 28 20:08:04 2020 +0200 arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage Now that the IOMMU driver has been introduced, it prevents any access from a DMA master going through it that hasn't properly mapped the pages, and that link is set up through the iommus property. Unfortunately we forgot to add that property to the video engine node when adding the IOMMU node, so now any DMA access is broken. Fixes: b3a0a2f910c7 ("arm64: dts: allwinner: h6: Add IOMMU") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20200628180804.79026-1-maxime@cerno.tech commit 158ae2f5e6fead30be1f0c203037f5556871513b Author: Kailang Yang Date: Thu Jul 16 15:21:59 2020 +0800 ALSA: hda/realtek - Enable Speaker for ASUS UX563 ASUS UX563 speaker can't output. Add quirk to link suitable model will enable it. This model also could enable headset Mic. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/96dee3ab01a04c28a7b44061e88009dd@realtek.com Signed-off-by: Takashi Iwai commit 473fbe13fd6f9082e413aea37e624ecbce5463cc Author: Kailang Yang Date: Thu Jul 16 14:42:33 2020 +0800 ALSA: hda/realtek - Enable Speaker for ASUS UX533 and UX534 ASUS UX533 and UX534 speaker still can't output. End User feedback speaker didn't have output. Add this COEF value will enable it. Fixes: 4e051106730d ("ALSA: hda/realtek: Enable audio jacks of ASUS UX533FD with ALC294") Cc: Signed-off-by: Kailang Yang Link: https://lore.kernel.org/r/80334402a93b48e385f8f4841b59ae09@realtek.com Signed-off-by: Takashi Iwai commit 4518dfcf761e3c44632855abcf433236cf7ab6c6 Author: Amir Goldstein Date: Wed Jul 15 16:38:08 2020 +0300 ovl: fix lookup of indexed hardlinks with metacopy We recently moved setting inode flag OVL_UPPERDATA to ovl_lookup(). When looking up an overlay dentry, upperdentry may be found by index and not by name. In that case, we fail to read the metacopy xattr and falsly set the OVL_UPPERDATA on the overlay inode. This caused a regression in xfstest overlay/033 when run with OVERLAY_MOUNT_OPTIONS="-o metacopy=on". Fixes: 28166ab3c875 ("ovl: initialize OVL_UPPERDATA in ovl_lookup()") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 81a33c1ee941c3bb9ffc6bac8f676be13351344e Author: Amir Goldstein Date: Thu Jun 18 18:43:53 2020 +0300 ovl: fix unneeded call to ovl_change_flags() The check if user has changed the overlay file was wrong, causing unneeded call to ovl_change_flags() including taking f_lock on every file access. Fixes: d989903058a8 ("ovl: do not generate duplicate fsnotify events for "fake" path") Cc: # v4.19+ Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 6544abc520f0fff701e9da382110dc29676c683a Author: Walter Lozano Date: Wed Jul 15 23:54:52 2020 -0300 opp: Increase parsed_static_opps in _of_add_opp_table_v1() Currently, when using _of_add_opp_table_v2 parsed_static_opps is increased and this value is used in _opp_remove_all_static() to check if there are static opp entries that need to be freed. Unfortunately this does not happen when using _of_add_opp_table_v1(), which leads to warnings. This patch increases parsed_static_opps in _of_add_opp_table_v1() in a similar way as in _of_add_opp_table_v2(). Fixes: 03758d60265c ("opp: Replace list_kref with a local counter") Cc: v5.6+ # v5.6+ Signed-off-by: Walter Lozano [ Viresh: Do the operation with lock held and set the value to 1 instead of incrementing it ] Signed-off-by: Viresh Kumar commit f8456690ba8eb18ea4714e68554e242a04f65cff Merge: 994e99a96c9b 1e7468bd9d30 Author: Linus Torvalds Date: Wed Jul 15 19:00:12 2020 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux into master Pull clk fixes from Stephen Boyd: "A couple build fixes for issues exposed this merge window and a fix for the eMMC clk on AST2600 SoCs that fixes the rate that is calculated by the clk framework" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: Specify IOMEM dependency for HSDK pll driver clk: AST2600: Add mux for EMMC clock clk: mvebu: ARMADA_AP_CPU_CLK needs to select ARMADA_AP_CP_HELPER commit c28d9a285668c799eeae2f7f93e929a6028a4d6d Author: George Kennedy Date: Wed Jul 15 09:59:31 2020 -0400 ax88172a: fix ax88172a_unbind() failures If ax88172a_unbind() fails, make sure that the return code is less than zero so that cleanup is done properly and avoid UAF. Fixes: a9a51bd727d1 ("ax88172a: fix information leak on short answers") Signed-off-by: George Kennedy Reported-by: syzbot+4cd84f527bf4a10fc9c1@syzkaller.appspotmail.com Signed-off-by: Jakub Kicinski commit f961134a612c793d5901a93d85a29337c74af978 Author: Stefano Garzarella Date: Fri Jul 10 14:12:43 2020 +0200 vsock/virtio: annotate 'the_virtio_vsock' RCU pointer Commit 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") starts to use RCU to protect 'the_virtio_vsock' pointer, but we forgot to annotate it. This patch adds the annotation to fix the following sparse errors: net/vmw_vsock/virtio_transport.c:73:17: error: incompatible types in comparison expression (different address spaces): net/vmw_vsock/virtio_transport.c:73:17: struct virtio_vsock [noderef] __rcu * net/vmw_vsock/virtio_transport.c:73:17: struct virtio_vsock * net/vmw_vsock/virtio_transport.c:171:17: error: incompatible types in comparison expression (different address spaces): net/vmw_vsock/virtio_transport.c:171:17: struct virtio_vsock [noderef] __rcu * net/vmw_vsock/virtio_transport.c:171:17: struct virtio_vsock * net/vmw_vsock/virtio_transport.c:207:17: error: incompatible types in comparison expression (different address spaces): net/vmw_vsock/virtio_transport.c:207:17: struct virtio_vsock [noderef] __rcu * net/vmw_vsock/virtio_transport.c:207:17: struct virtio_vsock * net/vmw_vsock/virtio_transport.c:561:13: error: incompatible types in comparison expression (different address spaces): net/vmw_vsock/virtio_transport.c:561:13: struct virtio_vsock [noderef] __rcu * net/vmw_vsock/virtio_transport.c:561:13: struct virtio_vsock * net/vmw_vsock/virtio_transport.c:612:9: error: incompatible types in comparison expression (different address spaces): net/vmw_vsock/virtio_transport.c:612:9: struct virtio_vsock [noderef] __rcu * net/vmw_vsock/virtio_transport.c:612:9: struct virtio_vsock * net/vmw_vsock/virtio_transport.c:631:9: error: incompatible types in comparison expression (different address spaces): net/vmw_vsock/virtio_transport.c:631:9: struct virtio_vsock [noderef] __rcu * net/vmw_vsock/virtio_transport.c:631:9: struct virtio_vsock * Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") Reported-by: Michael S. Tsirkin Signed-off-by: Stefano Garzarella Reviewed-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski commit 841eb4012cef84820e5906527b31a854f42b0748 Author: Ioana Ciornei Date: Tue Jul 14 15:08:16 2020 +0300 dpaa2-eth: check fsl_mc_get_endpoint for IS_ERR_OR_NULL() The fsl_mc_get_endpoint() function can return an error or directly a NULL pointer in case the peer device is not under the root DPRC container. Treat this case also, otherwise it would lead to a NULL pointer when trying to access the peer fsl_mc_device. Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink") Signed-off-by: Ioana Ciornei Signed-off-by: Jakub Kicinski commit 524d4f71e75503a8f707bfb5d74c7b58fb5eb181 Merge: 03d54ef0a1d5 92e0575b9983 Author: Dave Airlie Date: Thu Jul 16 10:10:15 2020 +1000 Merge tag 'drm-intel-fixes-2020-07-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.8-rc6: - FBC w/a stride fix - Fix use-after-free fix on module reload - Ignore irq enabling on the virtual engines to fix device sleep - Use GTT when saving/restoring engine GPR - Fix selftest sort function Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87ft9t0vtt.fsf@intel.com commit 03d54ef0a1d5e5115744cb7dc7058e9852228114 Merge: 8257a0d91310 6348dd291e36 Author: Dave Airlie Date: Thu Jul 16 10:09:55 2020 +1000 Merge tag 'drm-misc-fixes-2020-07-15' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * aspeed: setup fbdev console after registering device; avoids warning and stacktrace in dmesg log * dmabuf: protect dmabuf->name with a spinlock; avoids sleeping in atomic context Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200715171756.GA18606@linux-uq9g commit 8257a0d91310a71e4fa04b9aef8f2c4173ec9fb5 Merge: 11ba468877bb 1f054fd26e29 Author: Dave Airlie Date: Thu Jul 16 10:07:57 2020 +1000 Merge branch 'vmwgfx-fixes-5.8' of git://people.freedesktop.org/~sroland/linux into drm-fixes fix for black screens Signed-off-by: Dave Airlie From: "Roland Scheidegger (VMware)" Link: https://patchwork.freedesktop.org/patch/msgid/20200715161843.21118-1-rscheidegger.oss@gmail.com commit 994e99a96c9b502b3f6ee411457007cd52051cf5 Merge: 0665a4e9a1d6 9a33e375d98e Author: Linus Torvalds Date: Wed Jul 15 16:05:19 2020 -0700 Merge tag 'platform-drivers-x86-v5.8-2' of git://git.infradead.org/linux-platform-drivers-x86 into master Pull x86 platform driver fixes from Andriy Shevchenko: "Small fixes for this cycle: - Fix procfs handling in Thinkpad ACPI driver - Fix battery management on new ASUS laptops - New IDs (Sapphire Rapids) in ISST tool" * tag 'platform-drivers-x86-v5.8-2' of git://git.infradead.org/linux-platform-drivers-x86: platform/x86: asus-wmi: allow BAT1 battery name platform/x86: ISST: Add new PCI device ids platform/x86: thinkpad_acpi: Revert "Use strndup_user() in dispatch_proc_write()" commit 0665a4e9a1d6a51b6a25d5a5de6c623d380d853b Merge: 6cbba1f9114a 87730ccbddcb Author: Linus Torvalds Date: Wed Jul 15 15:58:11 2020 -0700 Merge tag 'dmaengine-fix-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine into master Pull dmaengine fixes from Vinod Koul: - update dmaengine tree location to kernel.org - dmatest fix for completing threads - driver fixes for k3dma, fsl-dma, idxd, ,tegra, and few other drivers * tag 'dmaengine-fix-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (21 commits) dmaengine: ioat setting ioat timeout as module parameter dmaengine: fsl-edma: fix wrong tcd endianness for big-endian cpu dmaengine: dmatest: stop completed threads when running without set channel dmaengine: fsl-edma-common: correct DSIZE_32BYTE dmaengine: dw: Initialize channel before each transfer dmaengine: idxd: fix misc interrupt handler thread unmasking dmaengine: idxd: cleanup workqueue config after disabling dmaengine: tegra210-adma: Fix runtime PM imbalance on error dmaengine: mcf-edma: Fix NULL pointer exception in mcf_edma_tx_handler dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler dmaengine: fsl-edma: Add lockdep assert for exported function dmaengine: idxd: fix hw descriptor fields for delta record dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get() dmaengine: sh: usb-dmac: set tx_result parameters dmaengine: ti: k3-udma: Fix delayed_work usage for tx drain workaround dmaengine: idxd: fix cdev locking for open and release dmaengine: imx-sdma: Fix: Remove 'always true' comparison MAINTAINERS: switch dmaengine tree to kernel.org dmaengine: ti: k3-udma: Fix the running channel handling in alloc_chan_resources dmaengine: ti: k3-udma: Fix cleanup code for alloc_chan_resources ... commit 6cbba1f9114a8134cff9138c79add15012fd52b9 Author: Wei Yongjun Date: Wed Jul 15 23:28:38 2020 +0100 keys: asymmetric: fix error return code in software_key_query() Fix to return negative error code -ENOMEM from kmalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: f1774cb8956a ("X.509: parse public key parameters from x509 for akcipher") Signed-off-by: Wei Yongjun Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 811f04bac15181a3351ef1d1aaa377954056e93b Author: David Howells Date: Wed Jul 8 09:27:07 2020 +0100 afs: Fix interruption of operations The afs filesystem driver allows unstarted operations to be cancelled by signal, but most of these can easily be restarted (mkdir for example). The primary culprits for reproducing this are those applications that use SIGALRM to display a progress counter. File lock-extension operation is marked uninterruptible as we have a limited time in which to do it, and the release op is marked uninterruptible also as if we fail to unlock a file, we'll have to wait 20 mins before anyone can lock it again. The store operation logs a warning if it gets interruption, e.g.: kAFS: Unexpected error from FS.StoreData -4 because it's run from the background - but it can also be run from fdatasync()-type things. However, store options aren't marked interruptible at the moment. Fix this in the following ways: (1) Mark store operations as uninterruptible. It might make sense to relax this for certain situations, but I'm not sure how to make sure that background store ops aren't affected by signals to foreground processes that happen to trigger them. (2) In afs_get_io_locks(), where we're getting the serialisation lock for talking to the fileserver, return ERESTARTSYS rather than EINTR because a lot of the operations (e.g. mkdir) are restartable if we haven't yet started sending the op to the server. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit f0e1266ed24b8a69655e1ab7fb618dbf6730879b Author: Amir Goldstein Date: Mon Jul 13 17:19:44 2020 +0300 ovl: fix mount option checks for nfs_export with no upperdir Without upperdir mount option, there is no index dir and the dependency checks nfs_export => index for mount options parsing are incorrect. Allow the combination nfs_export=on,index=off with no upperdir and move the check for dependency redirect_dir=nofollow for non-upper mount case to mount options parsing. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 470c15636125d1591bc901f6aa2d8e4a60ed2190 Author: Amir Goldstein Date: Mon Jul 13 17:19:43 2020 +0300 ovl: force read-only sb on failure to create index dir With index feature enabled, on failure to create index dir, overlay is being mounted read-only. However, we do not forbid user to remount overlay read-write. Fix that by setting ofs->workdir to NULL, which prevents remount read-write. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit a888db310195400f050b89c47673f0f8babfbb41 Author: Amir Goldstein Date: Wed Jul 8 16:16:13 2020 +0300 ovl: fix regression with re-formatted lower squashfs Commit 9df085f3c9a2 ("ovl: relax requirement for non null uuid of lower fs") relaxed the requirement for non null uuid with single lower layer to allow enabling index and nfs_export features with single lower squashfs. Fabian reported a regression in a setup when overlay re-uses an existing upper layer and re-formats the lower squashfs image. Because squashfs has no uuid, the origin xattr in upper layer are decoded from the new lower layer where they may resolve to a wrong origin file and user may get an ESTALE or EIO error on lookup. To avoid the reported regression while still allowing the new features with single lower squashfs, do not allow decoding origin with lower null uuid unless user opted-in to one of the new features that require following the lower inode of non-dir upper (index, xino, metacopy). Reported-by: Fabian Link: https://lore.kernel.org/linux-unionfs/32532923.JtPX5UtSzP@fgdesktop/ Fixes: 9df085f3c9a2 ("ovl: relax requirement for non null uuid of lower fs") Cc: stable@vger.kernel.org # v4.20+ Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 20396365a16dae4b4e3967fc7115d5336feb30ee Author: Amir Goldstein Date: Sun Jun 21 09:37:59 2020 +0300 ovl: fix oops in ovl_indexdir_cleanup() with nfs_export=on Mounting with nfs_export=on, xfstests overlay/031 triggers a kernel panic since v5.8-rc1 overlayfs updates. overlayfs: orphan index entry (index/00fb1..., ftype=4000, nlink=2) BUG: kernel NULL pointer dereference, address: 0000000000000030 RIP: 0010:ovl_cleanup_and_whiteout+0x28/0x220 [overlay] Bisect point at commit c21c839b8448 ("ovl: whiteout inode sharing") Minimal reproducer: -------------------------------------------------- rm -rf l u w m mkdir -p l u w m mkdir -p l/testdir touch l/testdir/testfile mount -t overlay -o lowerdir=l,upperdir=u,workdir=w,nfs_export=on overlay m echo 1 > m/testdir/testfile umount m rm -rf u/testdir mount -t overlay -o lowerdir=l,upperdir=u,workdir=w,nfs_export=on overlay m umount m -------------------------------------------------- When mount with nfs_export=on, and fail to verify an orphan index, we're cleaning this index from indexdir by calling ovl_cleanup_and_whiteout(). This dereferences ofs->workdir, that was earlier set to NULL. The design was that ovl->workdir will point at ovl->indexdir, but we are assigning ofs->indexdir to ofs->workdir only after ovl_indexdir_cleanup(). There is no reason not to do it sooner, because once we get success from ofs->indexdir = ovl_workdir_create(... there is no turning back. Reported-and-tested-by: Murphy Zhou Fixes: c21c839b8448 ("ovl: whiteout inode sharing") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 124c2de2c0aee96271e4ddab190083d8aa7aa71a Author: Amir Goldstein Date: Wed Jun 17 09:57:11 2020 +0300 ovl: relax WARN_ON() when decoding lower directory file handle Decoding a lower directory file handle to overlay path with cold inode/dentry cache may go as follows: 1. Decode real lower file handle to lower dir path 2. Check if lower dir is indexed (was copied up) 3. If indexed, get the upper dir path from index 4. Lookup upper dir path in overlay 5. If overlay path found, verify that overlay lower is the lower dir from step 1 On failure to verify step 5 above, user will get an ESTALE error and a WARN_ON will be printed. A mismatch in step 5 could be a result of lower directory that was renamed while overlay was offline, after that lower directory has been copied up and indexed. This is a scripted reproducer based on xfstest overlay/052: # Create lower subdir create_dirs create_test_files $lower/lowertestdir/subdir mount_dirs # Copy up lower dir and encode lower subdir file handle touch $SCRATCH_MNT/lowertestdir test_file_handles $SCRATCH_MNT/lowertestdir/subdir -p -o $tmp.fhandle # Rename lower dir offline unmount_dirs mv $lower/lowertestdir $lower/lowertestdir.new/ mount_dirs # Attempt to decode lower subdir file handle test_file_handles $SCRATCH_MNT -p -i $tmp.fhandle Since this WARN_ON() can be triggered by user we need to relax it. Fixes: 4b91c30a5a19 ("ovl: lookup connected ancestor of dir in inode cache") Cc: # v4.16+ Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit d78a0dcf64cb94ffdd5253722caed3f044a92a78 Author: youngjun Date: Sun Jun 21 05:50:01 2020 -0700 ovl: remove not used argument in ovl_check_origin ovl_check_origin outparam 'ctrp' argument not used by caller. So remove this argument. Signed-off-by: youngjun Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 5ac8e8025aedd2ea832ae3fe3ca0f920697f45c7 Author: youngjun Date: Sun Jun 21 07:30:59 2020 -0700 ovl: change ovl_copy_up_flags static "ovl_copy_up_flags" is used in copy_up.c. so, change it static. Signed-off-by: youngjun Signed-off-by: Miklos Szeredi commit 24f14009b8f1754ec2ae4c168940c01259b0f88a Author: youngjun Date: Tue Jun 16 17:30:43 2020 +0900 ovl: inode reference leak in ovl_is_inuse true case. When "ovl_is_inuse" true case, trap inode reference not put. plus adding the comment explaining sequence of ovl_is_inuse after ovl_setup_trap. Fixes: 0be0bfd2de9d ("ovl: fix regression caused by overlapping layers detection") Cc: # v4.19+ Reviewed-by: Amir Goldstein Signed-off-by: youngjun Signed-off-by: Miklos Szeredi commit 5b801dfb7feb2738975d80223efc2fc193e55573 Author: Peilin Ye Date: Tue Jul 14 14:09:04 2020 -0400 bpf: Fix NULL pointer dereference in __btf_resolve_helper_id() Prevent __btf_resolve_helper_id() from dereferencing `btf_vmlinux` as NULL. This patch fixes the following syzbot bug: https://syzkaller.appspot.com/bug?id=f823224ada908fa5c207902a5a62065e53ca0fcc Reported-by: syzbot+ee09bda7017345f1fbe6@syzkaller.appspotmail.com Signed-off-by: Peilin Ye Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200714180904.277512-1-yepeilin.cs@gmail.com commit 07d3f04550023395bbf34b99ec7e00fc50d9859f Author: Chandrakanth Patil Date: Wed Jul 15 17:31:53 2020 +0530 scsi: megaraid_sas: Remove undefined ENABLE_IRQ_POLL macro As the ENABLE_IRQ_POLL macro is undefined, the check for ENABLE_IRQ_POLL macro in ISR will always be false. This leads to irq polling being non-functional. Remove ENABLE_IRQ_POLL check from ISR. Link: https://lore.kernel.org/r/20200715120153.20512-1-chandrakanth.patil@broadcom.com Fixes: a6ffd5bf6819 ("scsi: megaraid_sas: Call disable_irq from process IRQ") Cc: # v5.3+ Signed-off-by: Chandrakanth Patil Signed-off-by: Kashyap Desai Signed-off-by: Martin K. Petersen commit 681fda8d27a66f7e65ff7f2d200d7635e64a8d05 Author: Pavel Begunkov Date: Wed Jul 15 22:20:45 2020 +0300 io_uring: fix recvmsg memory leak with buffer selection io_recvmsg() doesn't free memory allocated for struct io_buffer. This can causes a leak when used with automatic buffer selection. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 681a5c71fb829fc2193e3bb524af41525477f5c3 Author: Krzysztof Kozlowski Date: Mon Jun 29 10:16:29 2020 +0200 arm64: dts: spcfpga: Align GIC, NAND and UART nodenames with dtschema Fix dtschema validator warnings like: intc@fffc1000: $nodename:0: 'intc@fffc1000' does not match '^interrupt-controller(@[0-9a-f,]+)*$' Fixes: 78cd6a9d8e15 ("arm64: dts: Add base stratix 10 dtsi") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Dinh Nguyen commit d7adfe5ffed9faa05f8926223086b101e14f700d Author: Krzysztof Kozlowski Date: Fri Jun 26 10:06:02 2020 +0200 ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema Fix dtschema validator warnings like: l2-cache@fffff000: $nodename:0: 'l2-cache@fffff000' does not match '^(cache-controller|cpu)(@[0-9a-f,]+)*$' Fixes: 475dc86d08de ("arm: dts: socfpga: Add a base DTSI for Altera's Arria10 SOC") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Dinh Nguyen commit 3bf9b8ffc8980c1090bdd3a5570cf42420620838 Author: Dinh Nguyen Date: Mon Jun 29 12:47:35 2020 -0500 arm64: dts: stratix10: increase QSPI reg address in nand dts file Match the QSPI reg address in the socfpga_stratix10_socdk.dts file. Fixes: 80f132d73709 ("arm64: dts: increase the QSPI reg address for Stratix10 and Agilex") Cc: linux-stable # >= v5.6 Signed-off-by: Dinh Nguyen commit 263a0269a59c0b4145829462a107fe7f7327105f Author: Dinh Nguyen Date: Mon Jun 29 11:25:43 2020 -0500 arm64: dts: stratix10: add status to qspi dts node Add status = "okay" to QSPI node. Fixes: 0cb140d07fc75 ("arm64: dts: stratix10: Add QSPI support for Stratix10") Cc: linux-stable # >= v5.6 Signed-off-by: Dinh Nguyen commit 60176e6be0bb6f629b15aea7dcab5a95ecb158e9 Author: Dinh Nguyen Date: Mon Jun 29 11:19:21 2020 -0500 arm64: dts: agilex: add status to qspi dts node Add status = "okay" to QSPI node. Fixes: c4c8757b2d895 ("arm64: dts: agilex: add QSPI support for Intel Agilex") Cc: linux-stable # >= v5.5 Signed-off-by: Dinh Nguyen commit 1e9451cbda456a170518b2bfd643e2cb980880bf Author: Florian Westphal Date: Tue Jul 14 18:51:39 2020 +0200 netfilter: nf_tables: fix nat hook table deletion sybot came up with following transaction: add table ip syz0 add chain ip syz0 syz2 { type nat hook prerouting priority 0; policy accept; } add table ip syz0 { flags dormant; } delete chain ip syz0 syz2 delete table ip syz0 which yields: hook not found, pf 2 num 0 WARNING: CPU: 0 PID: 6775 at net/netfilter/core.c:413 __nf_unregister_net_hook+0x3e6/0x4a0 net/netfilter/core.c:413 [..] nft_unregister_basechain_hooks net/netfilter/nf_tables_api.c:206 [inline] nft_table_disable net/netfilter/nf_tables_api.c:835 [inline] nf_tables_table_disable net/netfilter/nf_tables_api.c:868 [inline] nf_tables_commit+0x32d3/0x4d70 net/netfilter/nf_tables_api.c:7550 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:486 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:544 [inline] nfnetlink_rcv+0x14a5/0x1e50 net/netfilter/nfnetlink.c:562 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] Problem is that when I added ability to override base hook registration to make nat basechains register with the nat core instead of netfilter core, I forgot to update nft_table_disable() to use that instead of the 'raw' hook register interface. In syzbot transaction, the basechain is of 'nat' type. Its registered with the nat core. The switch to 'dormant mode' attempts to delete from netfilter core instead. After updating nft_table_disable/enable to use the correct helper, nft_(un)register_basechain_hooks can be folded into the only remaining caller. Because nft_trans_table_enable() won't do anything when the DORMANT flag is set, remove the flag first, then re-add it in case re-enablement fails, else this patch breaks sequence: add table ip x { flags dormant; } /* add base chains */ add table ip x The last 'add' will remove the dormant flags, but won't have any other effect -- base chains are not registered. Then, next 'set dormant flag' will create another 'hook not found' splat. Reported-by: syzbot+2570f2c036e3da5db176@syzkaller.appspotmail.com Fixes: 4e25ceb80b58 ("netfilter: nf_tables: allow chain type to override hook register") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 912288442cb2f431bf3c8cb097a5de83bc6dbac1 Author: Colin Ian King Date: Wed Jul 15 17:26:04 2020 +0100 xprtrdma: fix incorrect header size calculations Currently the header size calculations are using an assignment operator instead of a += operator when accumulating the header size leading to incorrect sizes. Fix this by using the correct operator. Addresses-Coverity: ("Unused value") Fixes: 302d3deb2068 ("xprtrdma: Prevent inline overflow") Signed-off-by: Colin Ian King Reviewed-by: Chuck Lever Signed-off-by: Anna Schumaker commit 3ce17cd2b94907f6d91b81b32848044b84c97606 Author: Cristian Marussi Date: Wed Jul 15 13:13:38 2020 +0100 hwmon: (scmi) Fix potential buffer overflow in scmi_hwmon_probe() SMATCH detected a potential buffer overflow in the manipulation of hwmon_attributes array inside the scmi_hwmon_probe function: drivers/hwmon/scmi-hwmon.c:226 scmi_hwmon_probe() error: buffer overflow 'hwmon_attributes' 6 <= 9 Fix it by statically declaring the size of the array as the maximum possible as defined by hwmon_max define. Signed-off-by: Cristian Marussi Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20200715121338.GA18761@e119603-lin.cambridge.arm.com Signed-off-by: Guenter Roeck commit f0479c4bcbd92d1a457d4a43bcab79f29d11334a Author: Haren Myneni Date: Fri Jul 10 16:49:58 2020 -0700 selftests/powerpc: Use proper error code to check fault address ERR_NX_TRANSLATION(CSB.CC=5) is for internal to VAS for fault handling and should not used by OS. ERR_NX_AT_FAULT(CSB.CC=250) is the proper error code should be reported by OS when NX encounters address translation failure. This patch uses CC=250 to determine the fault address when the request is not successful. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0315251705baff94f678c33178491b5008723511.camel@linux.ibm.com commit 6068e1a4427e88f5cc62f238d1baf94a8b824ef4 Author: Haren Myneni Date: Fri Jul 10 16:47:19 2020 -0700 powerpc/vas: Report proper error code for address translation failure P9 DD2 NX workbook (Table 4-36) says DMA controller uses CC=5 internally for translation fault handling. NX reserves CC=250 for OS to notify user space when NX encounters address translation failure on the request buffer. Not an issue in earlier releases as NX does not get faults on kernel addresses. This patch defines CSB_CC_FAULT_ADDRESS(250) and updates CSB.CC with this proper error code for user space. Fixes: c96c4436aba4 ("powerpc/vas: Update CSB and notify process for fault CRBs") Signed-off-by: Haren Myneni [mpe: Added Fixes tag and fix typo in comment] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/019fd53e7538c6f8f332d175df74b1815ef5aa8c.camel@linux.ibm.com commit 31070f6ccec09f3bd4f1e28cd1e592fa4f3ba0b6 Author: Chirantan Ekbote Date: Tue Jul 14 19:26:39 2020 +0900 fuse: Fix parameter for FS_IOC_{GET,SET}FLAGS The ioctl encoding for this parameter is a long but the documentation says it should be an int and the kernel drivers expect it to be an int. If the fuse driver treats this as a long it might end up scribbling over the stack of a userspace process that only allocated enough space for an int. This was previously discussed in [1] and a patch for fuse was proposed in [2]. From what I can tell the patch in [2] was nacked in favor of adding new, "fixed" ioctls and using those from userspace. However there is still no "fixed" version of these ioctls and the fact is that it's sometimes infeasible to change all userspace to use the new one. Handling the ioctls specially in the fuse driver seems like the most pragmatic way for fuse servers to support them without causing crashes in userspace applications that call them. [1]: https://lore.kernel.org/linux-fsdevel/20131126200559.GH20559@hall.aurel32.net/T/ [2]: https://sourceforge.net/p/fuse/mailman/message/31771759/ Signed-off-by: Chirantan Ekbote Fixes: 59efec7b9039 ("fuse: implement ioctl support") Cc: Signed-off-by: Miklos Szeredi commit 9a33e375d98ece5ea40c576eabd3257acb90c509 Author: Vasiliy Kupriakov Date: Tue Jun 30 20:56:01 2020 +0300 platform/x86: asus-wmi: allow BAT1 battery name The battery on my laptop ASUS TUF Gaming FX706II is named BAT1. This patch allows battery extension to load. Signed-off-by: Vasiliy Kupriakov Signed-off-by: Andy Shevchenko commit e1eea3f839f41368d7cb4eb2d872d5b288677e94 Author: Srinivas Pandruvada Date: Wed Jun 24 10:51:38 2020 -0700 platform/x86: ISST: Add new PCI device ids Added new PCI device ids for supporting mailbox and MMIO interface for Sapphire Rapids. Signed-off-by: Srinivas Pandruvada Signed-off-by: Andy Shevchenko commit e2e90804dc1c190dcc00e4ca481bfd847ee5efcd Author: Andy Shevchenko Date: Wed Jul 15 12:40:07 2020 +0300 platform/x86: thinkpad_acpi: Revert "Use strndup_user() in dispatch_proc_write()" This reverts commit 35d13c7a05126a5a54a1ef40aff4c6984474e604. This broke procfs interface due to neglecting the fact that the strings are not coming NULL terminated. Revert the change till we will have a better clean up. Fixes: 35d13c7a0512 ("platform/x86: thinkpad_acpi: Use strndup_user() in dispatch_proc_write()") Reported-by: Hans de Goede Signed-off-by: Andy Shevchenko commit a8f62f183021be389561570ab5f8c701a5e70298 Author: Enric Balletbo i Serra Date: Tue Jul 7 12:34:12 2020 +0200 Revert "thermal: mediatek: fix register index error" This reverts commit eb9aecd90d1a39601e91cd08b90d5fee51d321a6 The above patch is supposed to fix a register index error on mt2701. It is not clear if the problem solved is a hang or just an invalid value returned, my guess is the second. The patch introduces, though, a new hang on MT8173 device making them unusable. So, seems reasonable, revert the patch because introduces a worst issue. The reason I send a revert instead of trying to fix the issue for MT8173 is because the information needed to fix the issue is in the datasheet and is not public. So I am not really able to fix it. Fixes the following bug when CONFIG_MTK_THERMAL is set on MT8173 devices. [ 2.222488] Unable to handle kernel paging request at virtual address ffff8000125f5001 [ 2.230421] Mem abort info: [ 2.233207] ESR = 0x96000021 [ 2.236261] EC = 0x25: DABT (current EL), IL = 32 bits [ 2.241571] SET = 0, FnV = 0 [ 2.244623] EA = 0, S1PTW = 0 [ 2.247762] Data abort info: [ 2.250640] ISV = 0, ISS = 0x00000021 [ 2.254473] CM = 0, WnR = 0 [ 2.257544] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041850000 [ 2.264251] [ffff8000125f5001] pgd=000000013ffff003, pud=000000013fffe003, pmd=000000013fff9003, pte=006800001100b707 [ 2.274867] Internal error: Oops: 96000021 [#1] PREEMPT SMP [ 2.280432] Modules linked in: [ 2.283483] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.0-rc6+ #162 [ 2.289914] Hardware name: Google Elm (DT) [ 2.294003] pstate: 20000005 (nzCv daif -PAN -UAO) [ 2.298792] pc : mtk_read_temp+0xb8/0x1c8 [ 2.302793] lr : mtk_read_temp+0x7c/0x1c8 [ 2.306794] sp : ffff80001003b930 [ 2.310100] x29: ffff80001003b930 x28: 0000000000000000 [ 2.315404] x27: 0000000000000002 x26: ffff0000f9550b10 [ 2.320709] x25: ffff0000f9550a80 x24: 0000000000000090 [ 2.326014] x23: ffff80001003ba24 x22: 00000000610344c0 [ 2.331318] x21: 0000000000002710 x20: 00000000000001f4 [ 2.336622] x19: 0000000000030d40 x18: ffff800011742ec0 [ 2.341926] x17: 0000000000000001 x16: 0000000000000001 [ 2.347230] x15: ffffffffffffffff x14: ffffff0000000000 [ 2.352535] x13: ffffffffffffffff x12: 0000000000000028 [ 2.357839] x11: 0000000000000003 x10: ffff800011295ec8 [ 2.363143] x9 : 000000000000291b x8 : 0000000000000002 [ 2.368447] x7 : 00000000000000a8 x6 : 0000000000000004 [ 2.373751] x5 : 0000000000000000 x4 : ffff800011295cb0 [ 2.379055] x3 : 0000000000000002 x2 : ffff8000125f5001 [ 2.384359] x1 : 0000000000000001 x0 : ffff0000f9550a80 [ 2.389665] Call trace: [ 2.392105] mtk_read_temp+0xb8/0x1c8 [ 2.395760] of_thermal_get_temp+0x2c/0x40 [ 2.399849] thermal_zone_get_temp+0x78/0x160 [ 2.404198] thermal_zone_device_update.part.0+0x3c/0x1f8 [ 2.409589] thermal_zone_device_update+0x34/0x48 [ 2.414286] of_thermal_set_mode+0x58/0x88 [ 2.418375] thermal_zone_of_sensor_register+0x1a8/0x1d8 [ 2.423679] devm_thermal_zone_of_sensor_register+0x64/0xb0 [ 2.429242] mtk_thermal_probe+0x690/0x7d0 [ 2.433333] platform_drv_probe+0x5c/0xb0 [ 2.437335] really_probe+0xe4/0x448 [ 2.440901] driver_probe_device+0xe8/0x140 [ 2.445077] device_driver_attach+0x7c/0x88 [ 2.449252] __driver_attach+0xac/0x178 [ 2.453082] bus_for_each_dev+0x78/0xc8 [ 2.456909] driver_attach+0x2c/0x38 [ 2.460476] bus_add_driver+0x14c/0x230 [ 2.464304] driver_register+0x6c/0x128 [ 2.468131] __platform_driver_register+0x50/0x60 [ 2.472831] mtk_thermal_driver_init+0x24/0x30 [ 2.477268] do_one_initcall+0x50/0x298 [ 2.481098] kernel_init_freeable+0x1ec/0x264 [ 2.485450] kernel_init+0x1c/0x110 [ 2.488931] ret_from_fork+0x10/0x1c [ 2.492502] Code: f9401081 f9400402 b8a67821 8b010042 (b9400042) [ 2.498599] ---[ end trace e43e3105ed27dc99 ]--- [ 2.503367] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [ 2.511020] SMP: stopping secondary CPUs [ 2.514941] Kernel Offset: disabled [ 2.518421] CPU features: 0x090002,25006005 [ 2.522595] Memory Limit: none [ 2.525644] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]-- Cc: Michael Kao Fixes: eb9aecd90d1a ("thermal: mediatek: fix register index error") Signed-off-by: Enric Balletbo i Serra Reviewed-by: Matthias Brugger Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200707103412.1010823-1-enric.balletbo@collabora.com commit f3d7fb38976b1b0a8462ba1c7cbd404ddfaad086 Author: Alex Hung Date: Mon Jun 15 16:39:57 2020 -0600 thermal: int3403_thermal: Downgrade error message Downgrade "Unsupported event" message from dev_err to dev_dbg to avoid flooding with this message on some platforms. Cc: stable@vger.kernel.org # v5.4+ Suggested-by: Zhang Rui Signed-off-by: Alex Hung [ rzhang: fix typo in changelog ] Signed-off-by: Zhang Rui Link: https://lore.kernel.org/r/20200615223957.183153-1-alex.hung@canonical.com commit 1d61e21852d3161f234b9656797669fe185c251b Author: Laurence Oberman Date: Tue Jul 14 18:08:05 2020 -0400 qed: Disable "MFW indication via attention" SPAM every 5 minutes This is likely firmware causing this but its starting to annoy customers. Change the message level to verbose to prevent the spam. Note that this seems to only show up with ISCSI enabled on the HBA via the qedi driver. Signed-off-by: Laurence Oberman Signed-off-by: David S. Miller commit 651149f60376758a4759f761767965040f9e4464 Author: Paolo Pisati Date: Tue Jul 14 17:40:55 2020 +0200 selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion During setup(): ... for ns in h0 r1 h1 h2 h3 do create_ns ${ns} done ... while in cleanup(): ... for n in h1 r1 h2 h3 h4 do ip netns del ${n} 2>/dev/null done ... and after removing the stderr redirection in cleanup(): $ sudo ./fib_nexthop_multiprefix.sh ... TEST: IPv4: host 0 to host 3, mtu 1400 [ OK ] TEST: IPv6: host 0 to host 3, mtu 1400 [ OK ] Cannot remove namespace file "/run/netns/h4": No such file or directory $ echo $? 1 and a non-zero return code, make kselftests fail (even if the test itself is fine): ... not ok 34 selftests: net: fib_nexthop_multiprefix.sh # exit=1 ... Signed-off-by: Paolo Pisati Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 8a03746c8baf82e1616f05a1a716d34378dcf780 Author: Guenter Roeck Date: Tue Jul 14 14:31:11 2020 -0700 hwmon: (nct6775) Accept PECI Calibration as temperature source for NCT6798D Stefan Dietrich reports invalid temperature source messages on Asus Formula XII Z490. nct6775 nct6775.656: Invalid temperature source 28 at index 0, source register 0x100, temp register 0x73 Debugging suggests that temperature source 28 reports the CPU temperature. Let's assume that temperature sources 28 and 29 reflect "PECI Agent {0,1} Calibration", similar to other chips of the series. Reported-by: Stefan Dietrich Cc: Stefan Dietrich Signed-off-by: Guenter Roeck commit ff021f22ea8f1388ced048243c6e06ca5cfbd62a Author: Maxim Kochetkov Date: Tue Jul 14 15:01:04 2020 +0300 gianfar: Use random MAC address when none is given If there is no valid MAC address in the device tree, use a random MAC address. Signed-off-by: Maxim Kochetkov Signed-off-by: David S. Miller commit 3195c4706b00106aa82c73acd28340fa8fc2bfc1 Author: Christophe JAILLET Date: Tue Jul 14 13:00:27 2020 +0200 hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path The size used when calling 'pci_alloc_consistent()' and 'pci_free_consistent()' should match. Fix it and have it consistent with the corresponding call in 'rr_close()'. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 0cac21b02ba5f3095fd2dcc77c26a25a0b2432ed Author: Andreas Schwab Date: Mon Jul 6 14:32:26 2020 +0200 riscv: use 16KB kernel stack on 64-bit With the current 8KB stack size there are frequent overflows in a 64-bit configuration. We may split IRQ stacks off in the future, but this fixes a number of issues right now. Signed-off-by: Andreas Schwab Reviewed-by: Anup Patel [Palmer: mention irqstack in the commit text] Fixes: 7db91e57a0ac ("RISC-V: Task implementation") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 05051496b2622e4d12e2036b35165969aa502f89 Author: Xiaojie Yuan Date: Tue Jul 14 15:47:31 2020 +0800 drm/amdgpu/sdma5: fix wptr overwritten in ->get_wptr() "u64 *wptr" points to the the wptr value in write back buffer and "*wptr = (*wptr) >> 2;" results in the value being overwritten each time when ->get_wptr() is called. umr uses /sys/kernel/debug/dri/0/amdgpu_ring_sdma0 to get rptr/wptr and decode ring content and it is affected by this issue. fix and simplify the logic similar as sdma_v4_0_ring_get_wptr(). v2: fix for sdma5.2 as well v3: drop sdma 5.2 changes for 5.8 and stable Suggested-by: Le Ma Signed-off-by: Xiaojie Yuan Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 98a34cf931e848f8489d3fb15a8f5fc03802ad65 Author: chen gong Date: Mon Jul 13 16:11:24 2020 +0800 drm/amdgpu/powerplay: Modify SMC message name for setting power profile mode I consulted Cai Land(Chuntian.Cai@amd.com), he told me corresponding smc message name to fSMC_MSG_SetWorkloadMask() is "PPSMC_MSG_ActiveProcessNotify" in firmware code of Renoir. Strange though it may seem, but it's a fact. Signed-off-by: chen gong Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit be73e608ae2711dc8a1ab8b9549d9e348061b2ee Author: Josip Pavic Date: Mon Jul 6 15:43:39 2020 -0400 drm/amd/display: handle failed allocation during stream construction [Why] Failing to allocate a transfer function during stream construction leads to a null pointer dereference [How] Handle the failed allocation by failing the stream construction Cc: stable@vger.kernel.org Signed-off-by: Josip Pavic Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b448d30b0c303d5454ea572b772d1ffae96bc6e7 Author: hersen wu Date: Mon Jun 22 13:29:16 2020 -0400 drm/amd/display: OLED panel backlight adjust not work with external display connected [Why] amdgpu_dm->backlight_caps is for single eDP only. the caps are upddated for very connector. Real eDP caps will be overwritten by other external display. For OLED panel, caps->aux_support is set to 1 for OLED pnael. after external connected, caps+.aux_support is set to 0. This causes OLED backlight adjustment not work. [How] within update_conector_ext_caps, backlight caps will be updated only for eDP connector. Cc: stable@vger.kernel.org Signed-off-by: hersen wu Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 3168470142e0a82b5732c04ed4c031a9322ae170 Author: Alex Deucher Date: Fri Jul 10 17:50:00 2020 -0400 drm/amdgpu/display: create fake mst encoders ahead of time (v4) Prevents a warning in the MST create connector case. v2: create global fake encoders rather per connector fake encoders to avoid running out of encoder indices. v3: use the actual number of crtcs on the asic rather than the max to conserve encoders. v4: v3 plus missing hunk I forgot to git add. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1108 Fixes: c6385e503aeaf9 ("drm/amdgpu: drop legacy drm load and unload callbacks") Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.7.x commit d845a2051b6b673fab4229b920ea04c7c4352b51 Author: Jack Xiao Date: Fri Jul 10 12:34:52 2020 +0800 drm/amdgpu: fix preemption unit test Remove signaled jobs from job list and ensure the job was indeed preempted. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7d65a577bb58d4f27a3398a4c0cb0b00ab7d0511 Author: Jack Xiao Date: Fri Jul 10 12:18:22 2020 +0800 drm/amdgpu/gfx10: fix race condition for kiq During preemption test for gfx10, it uses kiq to trigger gfx preemption, which would result in race condition with flushing TLB for kiq. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 92e0575b99835b5b3aaab2132dd551e0e04eb96a Author: Ville Syrjälä Date: Sat Jul 11 11:03:36 2020 +0300 drm/i915: Recalculate FBC w/a stride when needed Currently we're failing to recalculate the gen9 FBC w/a stride unless something more drastic than just the modifier itself has changed. This often leaves us with FBC enabled with the linear fbdev framebuffer without the w/a stride enabled. That will cause an immediate underrun and FBC will get promptly disabled. Fix the problem by checking if the w/a stride is about to change, and go through the full dance if so. This part of the FBC code is still pretty much a disaster and will need lots more work. But this should at least fix the immediate issue. v2: Deactivate FBC when the modifier changes since that will likely require resetting the w/a CFB stride Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200711080336.13423-1-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza (cherry picked from commit 0428ab013fdd39dbfb8f4cd8ad2b60af3776c6b9) Signed-off-by: Jani Nikula commit 6647e6cdba753e71170be7da2acfead7154f56d8 Author: Maarten Lankhorst Date: Wed Feb 12 14:54:45 2020 +0100 drm/i915: Move cec_notifier to intel_hdmi_connector_unregister, v2. This fixes the following KASAN splash on module reload: [ 145.136327] ================================================================== [ 145.136502] BUG: KASAN: use-after-free in intel_hdmi_destroy+0x74/0x80 [i915] [ 145.136514] Read of size 8 at addr ffff888216641830 by task kworker/1:1/134 [ 145.136535] CPU: 1 PID: 134 Comm: kworker/1:1 Tainted: G U T 5.5.0-rc7-valkyria+ #5783 [ 145.136539] Hardware name: GIGABYTE GB-BKi3A-7100/MFLP3AP-00, BIOS F1 07/27/2016 [ 145.136546] Workqueue: events drm_connector_free_work_fn [ 145.136551] Call Trace: [ 145.136560] dump_stack+0xa1/0xe0 [ 145.136571] print_address_description.constprop.0+0x1e/0x210 [ 145.136639] ? intel_hdmi_destroy+0x74/0x80 [i915] [ 145.136703] ? intel_hdmi_destroy+0x74/0x80 [i915] [ 145.136710] __kasan_report.cold+0x1b/0x37 [ 145.136790] ? intel_hdmi_destroy+0x74/0x80 [i915] [ 145.136863] ? intel_hdmi_destroy+0x74/0x80 [i915] [ 145.136870] kasan_report+0x27/0x30 [ 145.136881] __asan_report_load8_noabort+0x1c/0x20 [ 145.136946] intel_hdmi_destroy+0x74/0x80 [i915] [ 145.136954] drm_connector_free_work_fn+0xd1/0x100 [ 145.136967] process_one_work+0x86e/0x1610 [ 145.136987] ? pwq_dec_nr_in_flight+0x2f0/0x2f0 [ 145.137004] ? move_linked_works+0x128/0x2c0 [ 145.137021] worker_thread+0x63e/0xc90 [ 145.137048] kthread+0x2f6/0x3f0 [ 145.137054] ? calculate_sigpending+0x81/0xa0 [ 145.137059] ? process_one_work+0x1610/0x1610 [ 145.137064] ? kthread_bind+0x40/0x40 [ 145.137075] ret_from_fork+0x24/0x30 [ 145.137111] Allocated by task 0: [ 145.137119] (stack is not available) [ 145.137137] Freed by task 5053: [ 145.137147] save_stack+0x28/0x90 [ 145.137152] __kasan_slab_free+0x136/0x180 [ 145.137157] kasan_slab_free+0x26/0x30 [ 145.137161] kfree+0xe6/0x350 [ 145.137242] intel_ddi_encoder_destroy+0x60/0x80 [i915] [ 145.137252] drm_mode_config_cleanup+0x11d/0x8f0 [ 145.137329] intel_modeset_driver_remove+0x1f5/0x350 [i915] [ 145.137403] i915_driver_remove+0xc4/0x130 [i915] [ 145.137482] i915_pci_remove+0x3e/0x90 [i915] [ 145.137489] pci_device_remove+0x108/0x2d0 [ 145.137494] device_release_driver_internal+0x1e6/0x4a0 [ 145.137499] driver_detach+0xcb/0x198 [ 145.137503] bus_remove_driver+0xde/0x204 [ 145.137508] driver_unregister+0x6d/0xa0 [ 145.137513] pci_unregister_driver+0x2e/0x230 [ 145.137576] i915_exit+0x1f/0x26 [i915] [ 145.137157] kasan_slab_free+0x26/0x30 [ 145.137161] kfree+0xe6/0x350 [ 145.137242] intel_ddi_encoder_destroy+0x60/0x80 [i915] [ 145.137252] drm_mode_config_cleanup+0x11d/0x8f0 [ 145.137329] intel_modeset_driver_remove+0x1f5/0x350 [i915] [ 145.137403] i915_driver_remove+0xc4/0x130 [i915] [ 145.137482] i915_pci_remove+0x3e/0x90 [i915] [ 145.137489] pci_device_remove+0x108/0x2d0 [ 145.137494] device_release_driver_internal+0x1e6/0x4a0 [ 145.137499] driver_detach+0xcb/0x198 [ 145.137503] bus_remove_driver+0xde/0x204 [ 145.137508] driver_unregister+0x6d/0xa0 [ 145.137513] pci_unregister_driver+0x2e/0x230 [ 145.137576] i915_exit+0x1f/0x26 [i915] [ 145.137581] __x64_sys_delete_module+0x35b/0x470 [ 145.137586] do_syscall_64+0x99/0x4e0 [ 145.137591] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 145.137606] The buggy address belongs to the object at ffff888216640000 which belongs to the cache kmalloc-8k of size 8192 [ 145.137618] The buggy address is located 6192 bytes inside of 8192-byte region [ffff888216640000, ffff888216642000) [ 145.137630] The buggy address belongs to the page: [ 145.137640] page:ffffea0008599000 refcount:1 mapcount:0 mapping:ffff888107c02a80 index:0xffff888216644000 compound_mapcount: 0 [ 145.137647] raw: 0200000000010200 0000000000000000 0000000100000001 ffff888107c02a80 [ 145.137652] raw: ffff888216644000 0000000080020001 00000001ffffffff 0000000000000000 [ 145.137656] page dumped because: kasan: bad access detected [ 145.137668] Memory state around the buggy address: [ 145.137678] ffff888216641700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 145.137687] ffff888216641780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 145.137697] >ffff888216641800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 145.137706] ^ [ 145.137715] ffff888216641880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 145.137724] ffff888216641900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 145.137733] ================================================================== [ 145.137742] Disabling lock debugging due to kernel taint Changes since v1: - Add fixes tags. - Use early unregister. Signed-off-by: Maarten Lankhorst Fixes: 9c229127aee2 ("drm/i915: hdmi: add CEC notifier to intel_hdmi") Cc: # v4.19+ Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200212135445.1469133-1-maarten.lankhorst@linux.intel.com (cherry picked from commit a581483b1e5466d28fc50ff623fba31cea2cccb6) Signed-off-by: Jani Nikula commit 110f9efa858f584c6bed177cd48d0c0f526940e1 Author: Chris Wilson Date: Mon Jul 13 17:05:49 2020 +0100 drm/i915/gt: Only swap to a random sibling once upon creation The danger in switching at random upon intel_context_pin is that the context may still actually be inflight, as it will not be scheduled out until a context switch after it is complete -- that may be a long time after we do a final intel_context_unpin. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2118 Fixes: 6d06779e8672 ("drm/i915: Load balancing across a virtual engine") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.3+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200713160549.17344-1-chris@chris-wilson.co.uk (cherry picked from commit 90a987205c6cf74116a102ed446d22d92cdaf915) Signed-off-by: Jani Nikula commit 858f1299fd6f7518ddef19ddd304c8398ac79fa5 Author: Chris Wilson Date: Sat Jul 11 21:32:36 2020 +0100 drm/i915/gt: Ignore irq enabling on the virtual engines We do not use the virtual engines for interrupts (they have physical components), but we do use them to decouple the fence signaling during submission. Currently, when we submit a completed request, we try to enable the interrupt handler for the virtual engine, but we never disarm it. A quick fix is then to mark the irq as enabled, and it will then remain enabled -- and this prevents us from waking the device and never letting it sleep again. Fixes: f8db4d051b5e ("drm/i915: Initialise breadcrumb lists on the virtual engine") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Cc: # v5.5+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200711203236.12330-1-chris@chris-wilson.co.uk (cherry picked from commit 4fe6abb8f51355224808ab02a9febf65d184c40b) Signed-off-by: Jani Nikula commit aee62e02c48bd62b9b07f5e297ecfc9aaa964937 Author: Umesh Nerlige Ramappa Date: Thu Jul 9 23:45:03 2020 +0100 drm/i915/perf: Use GTT when saving/restoring engine GPR MI_STORE_REGISTER_MEM and MI_LOAD_REGISTER_MEM need to know which translation to use when saving restoring the engine general purpose registers to and from the GT scratch. Since GT scratch is mapped to ggtt, we need to set an additional bit in the command to use GTT. Fixes: daed3e44396d17 ("drm/i915/perf: implement active wait for noa configurations") Suggested-by: Prathap Kumar Valsan Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Lionel Landwerlin Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200709224504.11345-1-chris@chris-wilson.co.uk Signed-off-by: Chris Wilson (cherry picked from commit e43ff99c8deda85234e6233e0f4af6cb09566a37) Signed-off-by: Jani Nikula commit 42de9b0a2bb29238d316bd56407c0e727d6d7ff9 Author: Sudeep Holla Date: Thu Jul 9 16:49:31 2020 +0100 drm/i915/selftests: Fix compare functions provided for sorting Both cmp_u32 and cmp_u64 are comparing the pointers instead of the value at those pointers. This will result in incorrect/unsorted list. Fix it by deferencing the pointers before comparison. Fixes: 4ba74e53ada3 ("drm/i915/selftests: Verify frequency scaling with RPS") Fixes: 8757797ff9c9 ("drm/i915/selftests: Repeat the rps clock frequency measurement") Cc: Chris Wilson Cc: Mika Kuoppala Signed-off-by: Sudeep Holla Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200709154931.23310-1-sudeep.holla@arm.com (cherry picked from commit 2196dfea896f7027b43bae848890ce4aec5c8724) Signed-off-by: Jani Nikula commit e3beca48a45b5e0e6e6a4e0124276b8248dcc9bb Author: Thomas Gleixner Date: Thu Jul 9 11:53:06 2020 +0200 irqdomain/treewide: Keep firmware node unconditionally allocated Quite some non OF/ACPI users of irqdomains allocate firmware nodes of type IRQCHIP_FWNODE_NAMED or IRQCHIP_FWNODE_NAMED_ID and free them right after creating the irqdomain. The only purpose of these FW nodes is to convey name information. When this was introduced the core code did not store the pointer to the node in the irqdomain. A recent change stored the firmware node pointer in irqdomain for other reasons and missed to notice that the usage sites which do the alloc_fwnode/create_domain/free_fwnode sequence are broken by this. Storing a dangling pointer is dangerous itself, but in case that the domain is destroyed later on this leads to a double free. Remove the freeing of the firmware node after creating the irqdomain from all affected call sites to cure this. Fixes: 711419e504eb ("irqdomain: Add the missing assignment of domain->fwnode for named fwnode") Reported-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas Acked-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/873661qakd.fsf@nanos.tec.linutronix.de commit 2a4117df9b436a0e4c79d211284ab2097bcd00dc Author: dillon min Date: Tue Jul 14 14:35:07 2020 +0800 ARM: dts: Fix dcan driver probe failed on am437x platform Got following d_can probe errors with kernel 5.8-rc1 on am437x [ 10.730822] CAN device driver interface Starting Wait for Network to be Configured... [ OK ] Reached target Network. [ 10.787363] c_can_platform 481cc000.can: probe failed [ 10.792484] c_can_platform: probe of 481cc000.can failed with error -2 [ 10.799457] c_can_platform 481d0000.can: probe failed [ 10.804617] c_can_platform: probe of 481d0000.can failed with error -2 actually, Tony has fixed this issue on am335x with the patch [3] Since am437x has the same clock structure with am335x [1][2], so reuse the code from Tony Lindgren's patch [3] to fix it. [1]: https://www.ti.com/lit/pdf/spruh73 Chapter-23, Figure 23-1. DCAN Integration [2]: https://www.ti.com/lit/pdf/spruhl7 Chapter-25, Figure 25-1. DCAN Integration [3]: commit 516f1117d0fb ("ARM: dts: Configure osc clock for d_can on am335x") Fixes: 1a5cd7c23cc5 ("bus: ti-sysc: Enable all clocks directly during init to read revision") Signed-off-by: dillon min [tony@atomide.com: aligned commit message a bit for readability] Signed-off-by: Tony Lindgren commit a18fb07623813aaee1a69873c785865695a32c9e Author: Chen Tao Date: Fri Jun 19 18:42:40 2020 +0800 ARM: OMAP2+: Fix possible memory leak in omap_hwmod_allocate_module Fix memory leak in omap_hwmod_allocate_module not freeing in handling error path. Fixes: 8c87970543b17("ARM: OMAP2+: Add functions to allocate module data from device tree") Signed-off-by: Chen Tao Reviewed-by: Paul Walmsley [tony@atomide.com: fix call iounmap for missing regs] Signed-off-by: Tony Lindgren commit fa291331cb24bd9665096d660b917998285aae17 Author: derek.fang Date: Tue Jul 14 18:13:20 2020 +0800 ASoC: rt5682: Enable Vref2 under using PLL2 Enable Vref2 under long term using PLL2 to avoid clock unstable. Signed-off-by: derek.fang Link: https://lore.kernel.org/r/1594721600-29994-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown commit 3ce315a704b4568616d1b14166cff3430ef07d12 Author: Bartosz Szczepanek Date: Wed Jul 8 15:46:13 2020 +0200 thermal/int340x_thermal: Prevent page fault on .set_mode() op Starting from commit "thermal/int340x_thermal: Don't require IDSP to exist", priv->current_uuid_index is initialized to -1. This value may be passed to int3400_thermal_run_osc() from int3400_thermal_set_mode, contributing to page fault when accessing int3400_thermal_uuids array at index -1. This commit adds a check on uuid value to int3400_thermal_run_osc. Fixes: 8d485da0ddee ("thermal/int340x_thermal: Don't require IDSP to exist") Signed-off-by: Bartosz Szczepanek Reviewed-by: Pandruvada, Srinivas [ rzhang: Add Fixes tag ] Signed-off-by: Zhang Rui Link: https://lore.kernel.org/r/20200708134613.131555-1-bsz@semihalf.com commit d9765e41d8e9ea2251bf73735a2895c8bad546fc Author: Nicolas Saenz Julienne Date: Wed Jul 8 18:49:39 2020 +0200 dma-pool: do not allocate pool memory from CMA There is no guarantee to CMA's placement, so allocating a zone specific atomic pool from CMA might return memory from a completely different memory zone. So stop using it. Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map to gfp mask") Reported-by: Jeremy Linton Signed-off-by: Nicolas Saenz Julienne Tested-by: Jeremy Linton Acked-by: David Rientjes Signed-off-by: Christoph Hellwig commit 81e9d894e03f9a279102c7aac62ea7cbf9949f4b Author: Nicolas Saenz Julienne Date: Tue Jul 14 14:39:28 2020 +0200 dma-pool: make sure atomic pool suits device When allocating DMA memory from a pool, the core can only guess which atomic pool will fit a device's constraints. If it doesn't, get a safer atomic pool and try again. Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map to gfp mask") Reported-by: Jeremy Linton Suggested-by: Robin Murphy Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Christoph Hellwig commit 48b6703858dd5526c82d8ff2dbac59acab3a9dda Author: Nicolas Saenz Julienne Date: Tue Jul 14 14:39:27 2020 +0200 dma-pool: introduce dma_guess_pool() dma-pool's dev_to_pool() creates the false impression that there is a way to grantee a mapping between a device's DMA constraints and an atomic pool. It tuns out it's just a guess, and the device might need to use an atomic pool containing memory from a 'safer' (or lower) memory zone. To help mitigate this, introduce dma_guess_pool() which can be fed a device's DMA constraints and atomic pools already known to be faulty, in order for it to provide an better guess on which pool to use. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Christoph Hellwig commit 23e469be6239d9cf3d921fc3e38545491df56534 Author: Nicolas Saenz Julienne Date: Tue Jul 14 14:39:26 2020 +0200 dma-pool: get rid of dma_in_atomic_pool() The function is only used once and can be simplified to a one-liner. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Christoph Hellwig commit 567f6a6eba0c09e5f502e0290e57651befa8aacb Author: Nicolas Saenz Julienne Date: Tue Jul 14 14:39:25 2020 +0200 dma-direct: provide function to check physical memory area validity dma_coherent_ok() checks if a physical memory area fits a device's DMA constraints. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Christoph Hellwig commit 7779b047a57f6824a43d0e1f70de2741b7426b9d Author: Vasily Averin Date: Thu Jun 25 12:39:51 2020 +0300 fuse: don't ignore errors from fuse_writepages_fill() fuse_writepages() ignores some errors taken from fuse_writepages_fill() I believe it is a bug: if .writepages is called with WB_SYNC_ALL it should either guarantee that all data was successfully saved or return error. Fixes: 26d614df1da9 ("fuse: Implement writepages callback") Signed-off-by: Vasily Averin Signed-off-by: Miklos Szeredi commit 6ddf3af93e32b996cfc30477ea1509960d4ba669 Author: Miklos Szeredi Date: Tue Jul 14 14:45:41 2020 +0200 fuse: clean up condition for writepage sending fuse_writepages_fill uses following construction: if (wpa && ap->num_pages && (A || B || C)) { action; } else if (wpa && D) { if (E) { the same action; } } - ap->num_pages check is always true and can be removed - "if" and "else if" calls the same action and can be merged. Move checking A, B, C, D, E conditions to a helper, add comments. Original-patch-by: Vasily Averin Signed-off-by: Miklos Szeredi commit b330966f79fb4fdc49183f58db113303695a750f Author: Miklos Szeredi Date: Tue Jul 14 14:45:41 2020 +0200 fuse: reject options on reconfigure via fsconfig(2) Previous patch changed handling of remount/reconfigure to ignore all options, including those that are unknown to the fuse kernel fs. This was done for backward compatibility, but this likely only affects the old mount(2) API. The new fsconfig(2) based reconfiguration could possibly be improved. This would make the new API less of a drop in replacement for the old, OTOH this is a good chance to get rid of some weirdnesses in the old API. Several other behaviors might make sense: 1) unknown options are rejected, known options are ignored 2) unknown options are rejected, known options are rejected if the value is changed, allowed otherwise 3) all options are rejected Prior to the backward compatibility fix to ignore all options all known options were accepted (1), even if they change the value of a mount parameter; fuse_reconfigure() does not look at the config values set by fuse_parse_param(). To fix that we'd need to verify that the value provided is the same as set in the initial configuration (2). The major drawback is that this is much more complex than just rejecting all attempts at changing options (3); i.e. all options signify initial configuration values and don't make sense on reconfigure. This patch opts for (3) with the rationale that no mount options are reconfigurable in fuse. Signed-off-by: Miklos Szeredi commit e8b20a474cf2c42698d1942f939ff2128819f151 Author: Miklos Szeredi Date: Tue Jul 14 14:45:41 2020 +0200 fuse: ignore 'data' argument of mount(..., MS_REMOUNT) The command mount -o remount -o unknownoption /mnt/fuse succeeds on kernel versions prior to v5.4 and fails on kernel version at or after. This is because fuse_parse_param() rejects any unrecognised options in case of FS_CONTEXT_FOR_RECONFIGURE, just as for FS_CONTEXT_FOR_MOUNT. This causes a regression in case the fuse filesystem is in fstab, since remount sends all options found there to the kernel; even ones that are meant for the initial mount and are consumed by the userspace fuse server. Fix this by ignoring mount options, just as fuse_remount_fs() did prior to the conversion to the new API. Reported-by: Stefan Priebe Fixes: c30da2e981a7 ("fuse: convert to use the new mount API") Cc: # v5.4 Signed-off-by: Miklos Szeredi commit 0189a2d367f49729622fdafaef5da73161591859 Author: Miklos Szeredi Date: Tue Jul 14 14:45:41 2020 +0200 fuse: use ->reconfigure() instead of ->remount_fs() s_op->remount_fs() is only called from legacy_reconfigure(), which is not used after being converted to the new API. Convert to using ->reconfigure(). This restores the previous behavior of syncing the filesystem and rejecting MS_MANDLOCK on remount. Fixes: c30da2e981a7 ("fuse: convert to use the new mount API") Cc: # v5.4 Signed-off-by: Miklos Szeredi commit c146024ec44c2946de7c6c45ddd3402abcab17f9 Author: Miklos Szeredi Date: Tue Jul 14 14:45:41 2020 +0200 fuse: fix warning in tree_insert() and clean up writepage insertion fuse_writepages_fill() calls tree_insert() with ap->num_pages = 0 which triggers the following warning: WARNING: CPU: 1 PID: 17211 at fs/fuse/file.c:1728 tree_insert+0xab/0xc0 [fuse] RIP: 0010:tree_insert+0xab/0xc0 [fuse] Call Trace: fuse_writepages_fill+0x5da/0x6a0 [fuse] write_cache_pages+0x171/0x470 fuse_writepages+0x8a/0x100 [fuse] do_writepages+0x43/0xe0 Fix up the warning and clean up the code around rb-tree insertion: - Rename tree_insert() to fuse_insert_writeback() and make it return the conflicting entry in case of failure - Re-add tree_insert() as a wrapper around fuse_insert_writeback() - Rename fuse_writepage_in_flight() to fuse_writepage_add() and reverse the meaning of the return value to mean + "true" in case the writepage entry was successfully added + "false" in case it was in-fligt queued on an existing writepage entry's auxiliary list or the existing writepage entry's temporary page updated Switch from fuse_find_writeback() + tree_insert() to fuse_insert_writeback() - Move setting orig_pages to before inserting/updating the entry; this may result in the orig_pages value being discarded later in case of an in-flight request - In case of a new writepage entry use fuse_writepage_add() unconditionally, only set data->wpa if the entry was added. Fixes: 6b2fb79963fb ("fuse: optimize writepages search") Reported-by: kernel test robot Original-path-by: Vasily Averin Signed-off-by: Miklos Szeredi commit 69a6487ac0ea1bbc8d8b654cb5a4541f2d922f91 Author: Miklos Szeredi Date: Tue Jul 14 14:45:41 2020 +0200 fuse: move rb_erase() before tree_insert() In fuse_writepage_end() the old writepages entry needs to be removed from the rbtree before inserting the new one, otherwise tree_insert() would fail. This is a very rare codepath and no reproducer exists. Signed-off-by: Miklos Szeredi commit b710d27bf72068b15b2f0305d825988183e2ff28 Author: Satheesh Rajendran Date: Fri Jun 19 12:31:13 2020 +0530 powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size Early secure guest boot hits the below crash while booting with vcpus numbers aligned with page boundary for PAGE size of 64k and LPPACA size of 1k i.e 64, 128 etc. Partition configured for 64 cpus. CPU maps initialized for 1 thread per core ------------[ cut here ]------------ kernel BUG at arch/powerpc/kernel/paca.c:89! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries This is due to the BUG_ON() for shared_lppaca_total_size equal to shared_lppaca_size. Instead the code should only BUG_ON() if we have exceeded the total_size, which indicates we've overflowed the array. Fixes: bd104e6db6f0 ("powerpc/pseries/svm: Use shared memory for LPPACA structures") Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Satheesh Rajendran Reviewed-by: Laurent Dufour Reviewed-by: Thiago Jung Bauermann [mpe: Reword change log to clarify we're fixing not removing the check] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200619070113.16696-1-sathnaga@linux.vnet.ibm.com commit 8614afd689df59d9ce019439389be20bd788a897 Author: Matthew Gerlach Date: Mon Jul 13 14:10:03 2020 +0800 fpga: dfl: fix bug in port reset handshake When putting the port in reset, driver must wait for the soft reset acknowledgment bit instead of the soft reset bit. Fixes: 47c1b19c160f (fpga: dfl: afu: add port ops support) Signed-off-by: Matthew Gerlach Signed-off-by: Xu Yilun Acked-by: Wu Hao Reviewed-by: Tom Rix Signed-off-by: Moritz Fischer commit e19485dc7a0d210b428a249c0595769bd495fb71 Author: Xu Yilun Date: Mon Jul 13 14:10:02 2020 +0800 fpga: dfl: pci: reduce the scope of variable 'ret' This is to fix lkp cppcheck warnings: drivers/fpga/dfl-pci.c:230:6: warning: The scope of the variable 'ret' can be reduced. [variableScope] int ret = 0; ^ drivers/fpga/dfl-pci.c:230:10: warning: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Fixes: 3c2760b78f90 ("fpga: dfl: pci: fix return value of cci_pci_sriov_configure") Reported-by: kbuild test robot Signed-off-by: Xu Yilun Acked-by: Wu Hao Reviewed-by: Tom Rix Signed-off-by: Moritz Fischer commit 1f054fd26e29784d373c3d29c348ee48f1c41fb2 Author: Roland Scheidegger Date: Thu Jul 9 18:54:14 2020 +0200 drm/vmwgfx: fix update of display surface when resolution changes The assignment of metadata overwrote the new display resolution values, hence we'd miss the size actually changed and wouldn't redefine the surface. This would then lead to command buffer error when trying to update the screen target (due to the size mismatch), and result in a VM with black screen. Fixes: 504901dbb0b5 ("drm/vmwgfx: Refactor surface_define to use vmw_surface_metadata") Reviewed-by: Charmaine Lee Signed-off-by: Roland Scheidegger Cc: stable@vger.kernel.org commit e9919e11e219eaa5e8041b7b1a196839143e9125 Merge: 0dc589da873b a50ca29523b1 Author: Linus Torvalds Date: Mon Jul 13 18:31:15 2020 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: "A few quirks for the Elan touchpad driver, another Thinkpad is being switched over from PS/2 to native RMI4 interface, and we gave a brand new SW_MACHINE_COVER switch definition" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elan_i2c - add more hardware ID for Lenovo laptops Input: i8042 - add Lenovo XiaoXin Air 12 to i8042 nomux list Revert "Input: elants_i2c - report resolution information for touch major" Input: elan_i2c - only increment wakeup count on touch Input: synaptics - enable InterTouch for ThinkPad X1E 1st gen ARM: dts: n900: remove mmc1 card detect gpio Input: add `SW_MACHINE_COVER` commit d113c0f2e0d2e04e088a9f27ca29c64c3f44c49d Merge: 46ef5b89ec0e dc7bd30b97aa Author: David S. Miller Date: Mon Jul 13 17:43:31 2020 -0700 Merge tag 'wireless-drivers-2020-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers Kalle Valo says: ==================== wireless-drivers fixes for v5.8 First set of fixes for v5.8. Various important fixes for iwlwifi and mt76. iwlwifi * fix sleeping under RCU * fix a kernel crash when using compressed firmware images mt76 * tx queueing fixes for mt7615/22/63 * locking fix * fix a crash during watchdog reset * fix memory leaks ==================== Signed-off-by: David S. Miller commit 46ef5b89ec0ecf290d74c4aee844f063933c4da4 Author: Wei Yongjun Date: Mon Jul 13 23:59:50 2020 +0800 ip6_gre: fix null-ptr-deref in ip6gre_init_net() KASAN report null-ptr-deref error when register_netdev() failed: KASAN: null-ptr-deref in range [0x00000000000003c0-0x00000000000003c7] CPU: 2 PID: 422 Comm: ip Not tainted 5.8.0-rc4+ #12 Call Trace: ip6gre_init_net+0x4ab/0x580 ? ip6gre_tunnel_uninit+0x3f0/0x3f0 ops_init+0xa8/0x3c0 setup_net+0x2de/0x7e0 ? rcu_read_lock_bh_held+0xb0/0xb0 ? ops_init+0x3c0/0x3c0 ? kasan_unpoison_shadow+0x33/0x40 ? __kasan_kmalloc.constprop.0+0xc2/0xd0 copy_net_ns+0x27d/0x530 create_new_namespaces+0x382/0xa30 unshare_nsproxy_namespaces+0xa1/0x1d0 ksys_unshare+0x39c/0x780 ? walk_process_tree+0x2a0/0x2a0 ? trace_hardirqs_on+0x4a/0x1b0 ? _raw_spin_unlock_irq+0x1f/0x30 ? syscall_trace_enter+0x1a7/0x330 ? do_syscall_64+0x1c/0xa0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x56/0xa0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ip6gre_tunnel_uninit() has set 'ign->fb_tunnel_dev' to NULL, later access to ign->fb_tunnel_dev cause null-ptr-deref. Fix it by saving 'ign->fb_tunnel_dev' to local variable ndev. Fixes: dafabb6590cb ("ip6_gre: fix use-after-free in ip6gre_tunnel_lookup()") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit e0484010ec05191a8edf980413fc92f28050c1cc Author: Geert Uytterhoeven Date: Mon Jul 13 13:05:13 2020 +0200 usb: hso: Fix debug compile warning on sparc32 On sparc32, tcflag_t is "unsigned long", unlike on all other architectures, where it is "unsigned int": drivers/net/usb/hso.c: In function ‘hso_serial_set_termios’: include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘unsigned int’, but argument 4 has type ‘tcflag_t {aka long unsigned int}’ [-Wformat=] drivers/net/usb/hso.c:1393:3: note: in expansion of macro ‘hso_dbg’ hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n", ^~~~~~~ include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘unsigned int’, but argument 5 has type ‘tcflag_t {aka long unsigned int}’ [-Wformat=] drivers/net/usb/hso.c:1393:3: note: in expansion of macro ‘hso_dbg’ hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n", ^~~~~~~ As "unsigned long" is 32-bit on sparc32, fix this by casting all tcflag_t parameters to "unsigned int". While at it, use "%u" to format unsigned numbers. Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 0dc589da873b58b70f4caf4b070fb0cf70fdd1dc Merge: f81fdd0c4ab7 a082121b55ba Author: Linus Torvalds Date: Mon Jul 13 12:34:05 2020 -0700 Merge tag 'iommu-fixes-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Fix a use-after-free of the device iommu-group. Found in the arm-smmu driver, but the fix is in generic code. - Fix for the new Allwinner IOMMU driver to use the atomic readl_timeout() variant in IO/TLB flushing code. - A couple of cleanups to fix various compile warnings. * tag 'iommu-fixes-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused iommu: Fix use-after-free in iommu_release_device iommu/amd: Make amd_iommu_apply_ivrs_quirks() static inline iommu: SUN50I_IOMMU should depend on HAS_DMA iommu/sun50i: Remove unused variable iommu/sun50i: Change the readl timeout to the atomic variant commit f81fdd0c4ab7ac2c57302283309bf776557d35ff Author: Linus Torvalds Date: Mon Jul 13 11:37:39 2020 -0700 mm: document warning in move_normal_pmd() and make it warn only once Naresh Kamboju reported that the LTP tests can cause warnings on i386 going back all the way to v5.0, and bisected it to commit 2c91bd4a4e2e ("mm: speed up mremap by 20x on large regions"). The warning in move_normal_pmd() is actually mostly correct, but we have a very unusual special case at process creation time, when we may move the stack down with an overlapping mode (kind of like a "memmove()" except using the page tables). And when you have just the right condition of "move a large initial stack by the right alignment in the end, but with the early part of the move being only page-aligned", we'll be in a situation where we're trying to move a normal PMD entry on top of an already existing - but now empty - PMD entry. The warning is still worth having, in case it ever triggers other cases, and perhaps as a reminder that we could do the stack move case more efficiently (although it's clearly rare enough that it probably doesn't matter). But make it do WARN_ON_ONCE(), so that you can't flood the logs with it. And add a *big* comment above it to explain and remind us what's going on, because it took some figuring out to see how this could trigger. Kudos to Joel Fernandes for debugging this. Reported-by: Naresh Kamboju Debugged-and-acked-by: Joel Fernandes Cc: Arnd Bergmann Cc: Kirill A. Shutemov Signed-off-by: Linus Torvalds commit 39a188b88332545073b8e07633f5e3298e066b61 Author: Rafael J. Wysocki Date: Mon Jul 13 15:58:38 2020 +0200 cpufreq: intel_pstate: Fix active mode setting from command line If intel_pstate starts in the passive mode by default (that happens when the processor in the system doesn't support HWP), passing intel_pstate=active in the kernel command line doesn't work, so fix that. Fixes: 33aa46f252c7 ("cpufreq: intel_pstate: Use passive mode by default without HWP") Reported-by: Doug Smythies Signed-off-by: Rafael J. Wysocki Acked-by: Doug Smythies commit 913fadc5b105c3619d9e8d0fe8899ff1593cc737 Author: Anna Schumaker Date: Wed Jul 8 10:33:40 2020 -0400 NFS: Fix interrupted slots by sending a solo SEQUENCE operation We used to do this before 3453d5708b33, but this was changed to better handle the NFS4ERR_SEQ_MISORDERED error code. This commit fixed the slot re-use case when the server doesn't receive the interrupted operation, but if the server does receive the operation then it could still end up replying to the client with mis-matched operations from the reply cache. We can fix this by sending a SEQUENCE to the server while recovering from a SEQ_MISORDERED error when we detect that we are in an interrupted slot situation. Fixes: 3453d5708b33 (NFSv4.1: Avoid false retries when RPC calls are interrupted) Signed-off-by: Anna Schumaker commit af667527b0e34912d2cb3586d585f66db4e4f486 Author: Chuck Lever Date: Sat Jun 27 12:35:20 2020 -0400 xprtrdma: Fix handling of connect errors Ensure that the connect worker is awoken if an attempt to establish a connection is unsuccessful. Otherwise the worker waits forever and the transport workload hangs. Connect errors should not attempt to destroy the ep, since the connect worker continues to use it after the handler runs, so these errors are now handled independently of DISCONNECTED events. Reported-by: Dan Aloni Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit dda9a951dd6dd6073bbaf2c8d3119da2f8fe2d5b Author: Chuck Lever Date: Sat Jun 27 12:35:15 2020 -0400 xprtrdma: Fix return code from rpcrdma_xprt_connect() I noticed that when rpcrdma_xprt_connect() returns -ENOMEM, instead of retrying the connect, the RPC client kills the RPC task that requested the connection. We want a retry here. Fixes: cb586decbb88 ("xprtrdma: Make sendctx queue lifetime the same as connection lifetime") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 4cf44be6f1e86da302085bf3e1dc2c86f3cdaaaa Author: Chuck Lever Date: Sat Jun 27 12:35:09 2020 -0400 xprtrdma: Fix recursion into rpcrdma_xprt_disconnect() Both Dan and I have observed two processes invoking rpcrdma_xprt_disconnect() concurrently. In my case: 1. The connect worker invokes rpcrdma_xprt_disconnect(), which drains the QP and waits for the final completion 2. This causes the newly posted Receive to flush and invoke xprt_force_disconnect() 3. xprt_force_disconnect() sets CLOSE_WAIT and wakes up the RPC task that is holding the transport lock 4. The RPC task invokes xprt_connect(), which calls ->ops->close 5. xprt_rdma_close() invokes rpcrdma_xprt_disconnect(), which tries to destroy the QP. Deadlock. To prevent xprt_force_disconnect() from waking anything, handle the clean up after a failed connection attempt in the xprt's sndtask. The retry loop is removed from rpcrdma_xprt_connect() to ensure that the newly allocated ep and id are properly released before a REJECTED connection attempt can be retried. Reported-by: Dan Aloni Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 85bfd71bc34e20d9fadb745131f6314c36d0f75b Author: Chuck Lever Date: Sat Jun 27 12:35:04 2020 -0400 xprtrdma: Fix double-free in rpcrdma_ep_create() In the error paths, there's no need to call kfree(ep) after calling rpcrdma_ep_put(ep). Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 7c116db24d944ff04a67c8bd89cb32c5cd0894ff Author: Will Deacon Date: Thu Jul 9 21:48:41 2020 +0100 efi/libstub/arm64: Retain 2MB kernel Image alignment if !KASLR Since commit 82046702e288 ("efi/libstub/arm64: Replace 'preferred' offset with alignment check"), loading a relocatable arm64 kernel at a physical address which is not 2MB aligned and subsequently booting with EFI will leave the Image in-place, relying on the kernel to relocate itself early during boot. In conjunction with commit dd4bc6076587 ("arm64: warn on incorrect placement of the kernel by the bootloader"), which enables CONFIG_RELOCATABLE by default, this effectively means that entering an arm64 kernel loaded at an alignment smaller than 2MB with EFI (e.g. using QEMU) will result in silent relocation at runtime. Unfortunately, this has a subtle but confusing affect for developers trying to inspect the PC value during a crash and comparing it to the symbol addresses in vmlinux using tools such as 'nm' or 'addr2line'; all text addresses will be displaced by a sub-2MB offset, resulting in the wrong symbol being identified in many cases. Passing "nokaslr" on the command line or disabling "CONFIG_RANDOMIZE_BASE" does not help, since the EFI stub only copies the kernel Image to a 2MB boundary if it is not relocatable. Adjust the EFI stub for arm64 so that the minimum Image alignment is 2MB unless KASLR is in use. Cc: Mark Rutland Cc: Catalin Marinas Cc: Marc Zyngier Cc: David Brazdil Acked-by: Ard Biesheuvel Signed-off-by: Will Deacon commit ebd4050c6144b38098d8eed34df461e5e3fa82a9 Author: Eddie James Date: Thu Jul 9 14:57:06 2020 -0500 mmc: sdhci-of-aspeed: Fix clock divider calculation When calculating the clock divider, start dividing at 2 instead of 1. The divider is divided by two at the end of the calculation, so starting at 1 may result in a divider of 0, which shouldn't happen. Signed-off-by: Eddie James Reviewed-by: Andrew Jeffery Acked-by: Joel Stanley Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200709195706.12741-3-eajames@linux.ibm.com Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Ulf Hansson commit fecc5cfcd55f7aacc483726c405a951bd6aaaf2e Author: Lad Prabhakar Date: Thu May 14 23:10:38 2020 +0100 arm64: defconfig: Enable CONFIG_PCIE_RCAR_HOST config option PCIE_RCAR internally selects PCIE_RCAR_HOST which builds the same driver. So this patch renames CONFIG_PCIE_RCAR to CONFIG_PCIE_RCAR_HOST so that PCIE_RCAR can be safely dropped from Kconfig file. Signed-off-by: Lad Prabhakar Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1589494238-2933-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7f6e8dffc30bd22b15ad810fb90ea741c15e6d54 Author: Peng Fan Date: Thu Jul 9 16:25:45 2020 +0800 soc: imx: check ls1021a fsl,ls1021a is a mach under arch/arm/mach-imx/, however it could not use the soc driver which will break caam on ls1021a platform. So directly return if it is compatible with fsl,ls1021a. Fixes: 52102a3ba6a61 ("soc: imx: move cpu code to drivers/soc/imx") Signed-off-by: Peng Fan Tested-by: Horia Geantă Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit f50a121d2f32bccc1d6b94df925a1ce44ea7eff7 Author: Jian-Hong Pan Date: Mon Jul 13 14:04:22 2020 +0800 ALSA: hda/realtek: Enable headset mic of Acer TravelMate B311R-31 with ALC256 The Acer TravelMate B311R-31 laptop's audio (1025:1430) with ALC256 cannot detect the headset microphone until ALC256_FIXUP_ACER_MIC_NO_PRESENCE quirk maps the NID 0x19 as the headset mic pin. Signed-off-by: Jian-Hong Pan Cc: Link: https://lore.kernel.org/r/20200713060421.62435-1-jian-hong@endlessm.com Signed-off-by: Takashi Iwai commit 192b6a780598976feb7321ff007754f8511a4129 Author: Aneesh Kumar K.V Date: Sun Jul 12 18:50:47 2020 +0530 powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey Even if the IAMR value denies execute access, the current code returns true from pkey_access_permitted() for an execute permission check, if the AMR read pkey bit is cleared. This results in repeated page fault loop with a test like below: #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #ifdef SYS_pkey_mprotect #undef SYS_pkey_mprotect #endif #ifdef SYS_pkey_alloc #undef SYS_pkey_alloc #endif #ifdef SYS_pkey_free #undef SYS_pkey_free #endif #undef PKEY_DISABLE_EXECUTE #define PKEY_DISABLE_EXECUTE 0x4 #define SYS_pkey_mprotect 386 #define SYS_pkey_alloc 384 #define SYS_pkey_free 385 #define PPC_INST_NOP 0x60000000 #define PPC_INST_BLR 0x4e800020 #define PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC) static int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey) { return syscall(SYS_pkey_mprotect, addr, len, prot, pkey); } static int sys_pkey_alloc(unsigned long flags, unsigned long access_rights) { return syscall(SYS_pkey_alloc, flags, access_rights); } static int sys_pkey_free(int pkey) { return syscall(SYS_pkey_free, pkey); } static void do_execute(void *region) { /* jump to region */ asm volatile( "mtctr %0;" "bctrl" : : "r"(region) : "ctr", "lr"); } static void do_protect(void *region) { size_t pgsize; int i, pkey; pgsize = getpagesize(); pkey = sys_pkey_alloc(0, PKEY_DISABLE_EXECUTE); assert (pkey > 0); /* perform mprotect */ assert(!sys_pkey_mprotect(region, pgsize, PROT_RWX, pkey)); do_execute(region); /* free pkey */ assert(!sys_pkey_free(pkey)); } int main(int argc, char **argv) { size_t pgsize, numinsns; unsigned int *region; int i; /* allocate memory region to protect */ pgsize = getpagesize(); region = memalign(pgsize, pgsize); assert(region != NULL); assert(!mprotect(region, pgsize, PROT_RWX)); /* fill page with NOPs with a BLR at the end */ numinsns = pgsize / sizeof(region[0]); for (i = 0; i < numinsns - 1; i++) region[i] = PPC_INST_NOP; region[i] = PPC_INST_BLR; do_protect(region); return EXIT_SUCCESS; } The fix is to only check the IAMR for an execute check, the AMR value is not relevant. Fixes: f2407ef3ba22 ("powerpc: helper to validate key-access permissions of a pte") Cc: stable@vger.kernel.org # v4.16+ Reported-by: Sandipan Das Signed-off-by: Aneesh Kumar K.V [mpe: Add detail to change log, tweak wording & formatting] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200712132047.1038594-1-aneesh.kumar@linux.ibm.com commit f8951dce10c092075e39ef12c29022548e4c63db Author: Bjorn Helgaas Date: Wed Jul 1 17:10:39 2020 -0500 ARM: imx: Remove imx_add_imx_dma() unused irq_err argument No callers of imx_add_imx_dma() need an error IRQ, so they supply 0 as "irq_err", which means we register a resource of IRQ 0, which is invalid and causes a warning if used. Remove the "irq_err" argument altogether so there's no chance of trying to use the invalid IRQ 0. Fixes: a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid") Signed-off-by: Bjorn Helgaas Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: kernel@pengutronix.de Cc: Fabio Estevam Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 2a83544007aba792167615c393e6154824f3a175 Author: Guenter Roeck Date: Tue Jun 30 20:26:51 2020 -0700 ARM: imx: Provide correct number of resources when registering gpio devices Since commit a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid"), the kernel is a bit touchy when it encounters interrupt 0. As a result, there are lots of warnings such as the following when booting systems such as 'kzm'. WARNING: CPU: 0 PID: 1 at drivers/base/platform.c:224 platform_get_irq_optional+0x118/0x128 0 is an invalid IRQ number Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc3 #1 Hardware name: Kyoto Microcomputer Co., Ltd. KZM-ARM11-01 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xe8/0x120) [] (dump_stack) from [] (__warn+0xe4/0x108) [] (__warn) from [] (warn_slowpath_fmt+0x74/0xbc) [] (warn_slowpath_fmt) from [] (platform_get_irq_optional+0x118/0x128) [] (platform_get_irq_optional) from [] (platform_irq_count+0x20/0x3c) [] (platform_irq_count) from [] (mxc_gpio_probe+0x8c/0x494) [] (mxc_gpio_probe) from [] (platform_drv_probe+0x48/0x98) [] (platform_drv_probe) from [] (really_probe+0x214/0x344) [] (really_probe) from [] (driver_probe_device+0x58/0xb4) [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) [] (device_driver_attach) from [] (__driver_attach+0x84/0xc0) [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xb8) [] (bus_for_each_dev) from [] (bus_add_driver+0x154/0x1e0) [] (bus_add_driver) from [] (driver_register+0x74/0x108) [] (driver_register) from [] (do_one_initcall+0x80/0x3b4) [] (do_one_initcall) from [] (kernel_init_freeable+0x170/0x208) [] (kernel_init_freeable) from [] (kernel_init+0x8/0x11c) [] (kernel_init) from [] (ret_from_fork+0x14/0x20) As it turns out, mxc_register_gpio() is a bit lax when setting the number of resources: it registers a resource with interrupt 0 when in reality there is no such interrupt. Fix the problem by not declaring the second interrupt resource if there is no second interrupt. Fixes: a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid") Cc: Bjorn Helgaas Signed-off-by: Guenter Roeck Signed-off-by: Shawn Guo commit 11ba468877bb23f28956a35e896356252d63c983 Author: Linus Torvalds Date: Sun Jul 12 16:34:50 2020 -0700 Linux 5.8-rc5 commit d99c6fa49e06d3b05a970e4f4895469f2c7c3d38 Merge: 1df0d8960499 27640ce68d21 Author: David S. Miller Date: Sun Jul 12 15:29:01 2020 -0700 Merge branch 'bnxt_en-fixes' Michael Chan says: ==================== bnxt_en: 3 bug fixes. 2 Fixes related to PHY/link settings. The last one fixes the sizing of the completion ring. Please also queue for -stable. Thanks. ==================== Signed-off-by: David S. Miller commit 27640ce68d21e556b66bc5fa022aacd26e53c947 Author: Michael Chan Date: Sat Jul 11 20:48:25 2020 -0400 bnxt_en: Fix completion ring sizing with TPA enabled. The current completion ring sizing formula is wrong with TPA enabled. The formula assumes that the number of TPA completions are bound by the RX ring size, but that's not true. TPA_START completions are immediately recycled so they are not bound by the RX ring size. We must add bp->max_tpa to the worst case maximum RX and TPA completions. The completion ring can overflow because of this mistake. This will cause hardware to disable the completion ring when this happens, leading to RX and TX traffic to stall on that ring. This issue is generally exposed only when the RX ring size is set very small. Fix the formula by adding bp->max_tpa to the number of RX completions if TPA is enabled. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver."); Reviewed-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ca0c753815fe4786b79a80abf0412eb5d52090b8 Author: Vasundhara Volam Date: Sat Jul 11 20:48:24 2020 -0400 bnxt_en: Init ethtool link settings after reading updated PHY configuration. In a shared port PHY configuration, async event is received when any of the port modifies the configuration. Ethtool link settings should be initialised after updated PHY configuration from firmware. Fixes: b1613e78e98d ("bnxt_en: Add async. event logic for PHY configuration changes.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 163e9ef63641a02de4c95cd921577265c52e1ce2 Author: Vasundhara Volam Date: Sat Jul 11 20:48:23 2020 -0400 bnxt_en: Fix race when modifying pause settings. The driver was modified to not rely on rtnl lock to protect link settings about 2 years ago. The pause setting was missed when making that change. Fix it by acquiring link_lock mutex before calling bnxt_hwrm_set_pause(). Fixes: e2dc9b6e38fa ("bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.") Signed-off-by: Vasundhara Volam Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 5c38b7d3c48bbbec043913354b5974f998373efa Merge: 4437dd6e8f71 ee769ebbe9e5 Author: Linus Torvalds Date: Sun Jul 12 13:29:07 2020 -0700 Merge tag 'xtensa-20200712' of git://github.com/jcmvbkbc/linux-xtensa Pull Xtensa fixes from Max Filippov: - fix __sync_fetch_and_{and,or}_4 declarations to avoid build warning - update *pos in cpuinfo_op.next to avoid runtime warning - use for_each_set_bit in xtensa_pmu_irq_handler instead of open-coding it * tag 'xtensa-20200712' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: simplify xtensa_pmu_irq_handler xtensa: update *pos in cpuinfo_op.next xtensa: fix __sync_fetch_and_{and,or}_4 declarations commit 4437dd6e8f71e8b4b5546924a6e48e7edaf4a8dc Merge: 72c34e8d7099 16d598030a37 Author: Linus Torvalds Date: Sun Jul 12 12:17:58 2020 -0700 Merge tag 'io_uring-5.8-2020-07-12' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Two late fixes again: - Fix missing msg_name assignment in certain cases (Pavel) - Correct a previous fix for full coverage (Pavel)" * tag 'io_uring-5.8-2020-07-12' of git://git.kernel.dk/linux-block: io_uring: fix not initialised work->flags io_uring: fix missing msg_name assignment commit 72c34e8d7099c329c2934c2ac9c886f638b6edaf Merge: 9901a6bd1577 d77765911385 Author: Linus Torvalds Date: Sun Jul 12 10:58:35 2020 -0700 Merge tag 'for-5.8-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "Two refcounting fixes and one prepartory patch for upcoming splice cleanup: - fix double put of block group with nodatacow - fix missing block group put when remounting with discard=async - explicitly set splice callback (no functional change), to ease integrating splice cleanup patches" * tag 'for-5.8-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: wire up iter_file_splice_write btrfs: fix double put of block group with nocow btrfs: discard: add missing put when grabbing block group from unused list commit 16d598030a37853a7a6b4384cad19c9c0af2f021 Author: Pavel Begunkov Date: Sun Jul 12 16:16:47 2020 +0300 io_uring: fix not initialised work->flags 59960b9deb535 ("io_uring: fix lazy work init") tried to fix missing io_req_init_async(), but left out work.flags and hash. Do it earlier. Fixes: 7cdaf587de7c ("io_uring: avoid whole io_wq_work copy for requests completed inline") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit dd821e0c95a64b5923a0c57f07d3f7563553e756 Author: Pavel Begunkov Date: Sun Jul 12 13:23:08 2020 +0300 io_uring: fix missing msg_name assignment Ensure to set msg.msg_name for the async portion of send/recvmsg, as the header copy will copy to/from it. Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 9901a6bd157719f9f93186868c527c5ba5edf8e5 Merge: 9599e9e7e3ee 70ee5731a40b Author: Linus Torvalds Date: Sat Jul 11 19:22:46 2020 -0700 Merge tag 'riscv-for-linus-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: "I have a few KGDB-related fixes. They're mostly fixes for build warnings, but there's also: - Support for the qSupported and qXfer packets, which are necessary to pass around GDB XML information which we need for the RISC-V GDB port to fully function. - Users can now select STRICT_KERNEL_RWX instead of forcing it on" * tag 'riscv-for-linus-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Avoid kgdb.h including gdb_xml.h to solve unused-const-variable warning kgdb: Move the extern declaration kgdb_has_hit_break() to generic kgdb.h riscv: Fix "no previous prototype" compile warning in kgdb.c file riscv: enable the Kconfig prompt of STRICT_KERNEL_RWX kgdb: enable arch to support XML packet. commit 9599e9e7e3ee3a5afcdf00b05d4e86d256a98ae3 Merge: 0aea6d5c5be3 e094fd346021 Author: Linus Torvalds Date: Sat Jul 11 18:15:17 2020 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Five small fixes, four in driver and one in the SCSI Parallel transport, which fixes an incredibly old bug so I suspect no-one has actually used the functionality it fixes" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: dh: Add Fujitsu device to devinfo and dh lists scsi: mpt3sas: Fix error returns in BRM_status_show scsi: mpt3sas: Fix unlock imbalance scsi: iscsi: Change iSCSI workqueue max_active back to 1 scsi: scsi_transport_spi: Fix function pointer check commit 0aea6d5c5be33ce94c16f9ab2f64de1f481f424b Merge: 997c4431f04d ba8c42348897 Author: Linus Torvalds Date: Sat Jul 11 11:16:46 2020 -0700 Merge tag 'for-linus-5.8b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fix from Juergen Gross: "Just one fix of a recent patch (double free in an error path)" * tag 'for-linus-5.8b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/xenbus: Fix a double free in xenbus_map_ring_pv() commit 997c4431f04d8f0d6063bac3bcdceba8d939b879 Merge: 1df0d8960499 4557ac6b344b Author: Linus Torvalds Date: Sat Jul 11 10:24:38 2020 -0700 Merge tag 'powerpc-5.8-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: "One fix for a crash/soft lockup on Power8, caused by the exception rework we did in v5.7. Thanks to Paul Menzel and Nicholas Piggin" * tag 'powerpc-5.8-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s/exception: Fix 0x1500 interrupt handler crash commit 1e7468bd9d30a21e059af477106dc5588ae52dff Author: David Gow Date: Mon Jun 29 21:32:14 2020 -0700 clk: Specify IOMEM dependency for HSDK pll driver The HSDK pll driver uses the devm_ioremap_resource function, but does not specify a dependency on IOMEM in Kconfig. This causes a build failure on architectures without IOMEM, for example, UML (notably with make allyesconfig). Fix this by making CONFIG_CLK_HSDK depend on CONFIG_IOMEM. Signed-off-by: David Gow Link: https://lore.kernel.org/r/20200630043214.1080961-1-davidgow@google.com Signed-off-by: Stephen Boyd commit c2407ab3bd55064d459bc822efd1c134e852798c Author: Eddie James Date: Thu Jul 9 14:57:05 2020 -0500 clk: AST2600: Add mux for EMMC clock The EMMC clock can be derived from either the HPLL or the MPLL. Register a clock mux so that the rate is calculated correctly based upon the parent. Signed-off-by: Eddie James Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20200709195706.12741-2-eajames@linux.ibm.com Acked-by: Joel Stanley Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC") Signed-off-by: Stephen Boyd commit 8e3709d7e3a67e2d3f42bd1fc2052353a5678944 Author: Nathan Chancellor Date: Wed Jul 1 13:11:29 2020 -0700 clk: mvebu: ARMADA_AP_CPU_CLK needs to select ARMADA_AP_CP_HELPER When building arm32 allmodconfig: ld.lld: error: undefined symbol: ap_cp_unique_name >>> referenced by ap-cpu-clk.c >>> clk/mvebu/ap-cpu-clk.o:(ap_cpu_clock_probe) in archive drivers/built-in.a ap_cp_unique_name is only compiled into the kernel image when CONFIG_ARMADA_AP_CP_HELPER is selected (as it is not user selectable). However, CONFIG_ARMADA_AP_CPU_CLK does not select it. This has been a problem since the driver was added to the kernel but it was not built before commit c318ea261749 ("cpufreq: ap806: fix cpufreq driver needs ap cpu clk") so it was never noticed. Fixes: f756e362d938 ("clk: mvebu: add CPU clock driver for Armada 7K/8K") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20200701201128.2448427-1-natechancellor@gmail.com Signed-off-by: Stephen Boyd commit 20b1be59528295e5c2a8812059b8560753dd8e68 Author: Masahiro Yamada Date: Wed Jul 8 01:35:08 2020 +0900 kbuild: fix single target builds for external modules Commit f566e1fbadb6 ("kbuild: make multiple directory targets work") broke single target builds for external modules. Fix this. Fixes: f566e1fbadb6 ("kbuild: make multiple directory targets work") Reported-by: Bjørn Mork Signed-off-by: Masahiro Yamada Tested-by: Bjørn Mork commit 4237c625304b212a3f30adf787901082082511ec Author: Tim Harvey Date: Tue Jun 23 12:06:54 2020 -0700 ARM: dts: imx6qdl-gw551x: fix audio SSI The audio codec on the GW551x routes to ssi1. It fixes audio capture on the device. Cc: stable@vger.kernel.org Fixes: 3117e851cef1 ("ARM: dts: imx: Add TDA19971 HDMI Receiver to GW551x") Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit ff53664daff2a65f4bf2479ac56dfb3e908deff0 Author: Armas Spann Date: Sat Jul 11 13:05:57 2020 +0200 ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G14(G401) series with ALC289 This patch adds support for headset mic to the ASUS ROG Zephyrus G14(GA401) notebook series by adding the corresponding vendor/pci_device id, as well as adding a new fixup for the used realtek ALC289. The fixup stets the correct pin to get the headset mic correctly recognized on audio-jack. Signed-off-by: Armas Spann Cc: Link: https://lore.kernel.org/r/20200711110557.18681-1-zappel@retarded.farm Signed-off-by: Takashi Iwai commit ef9ddb9dc4f8b1da3b975918cd1fd98ec055b918 Author: Kailang Yang Date: Fri Jul 10 15:31:11 2020 +0800 ALSA: hda/realtek - change to suitable link model for ASUS platform ASUS platform couldn't need to use Headset Mode model. It changes to the suitable model. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/d05bcff170784ec7bb35023407148161@realtek.com Signed-off-by: Takashi Iwai commit 1df0d8960499e58963fd6c8ac75e544f2b417b29 Merge: 5ab39e08ff15 813357fead4a Author: Linus Torvalds Date: Fri Jul 10 21:23:10 2020 -0700 Merge tag 'libnvdimm-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fix from Dan Williams: "A one-line Fix for key ring search permissions to address a regression from -rc1" * tag 'libnvdimm-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: libnvdimm/security: Fix key lookup permissions commit 5ab39e08ff1558ed80d93f5c5217338f19369a40 Merge: 49decddd39e5 a8dab63ea623 Author: Linus Torvalds Date: Fri Jul 10 21:16:48 2020 -0700 Merge tag '5.8-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Four cifs/smb3 fixes: the three for stable fix problems found recently with change notification including a reference count leak" * tag '5.8-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number cifs: fix reference leak for tlink smb3: fix unneeded error message on change notify cifs: remove the retry in cifs_poxis_lock_set smb3: fix access denied on change notify request to some servers commit 49decddd39e5f6132ccd7d9fdc3d7c470b0061bb Merge: 5a764898afec a5f526ecb075 Author: Linus Torvalds Date: Fri Jul 10 21:15:25 2020 -0700 Merge tag 'inclusive-terminology' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/linux Pull coding style terminology documentation from Dan Williams: "The discussion has tapered off as well as the incoming ack, review, and sign-off tags. I did not see a reason to wait for the next merge window" * tag 'inclusive-terminology' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/linux: CodingStyle: Inclusive Terminology commit 5a764898afec0bc097003e8c3e727792289f76d6 Merge: 9321f1aaf63e 1195c7cebb95 Author: Linus Torvalds Date: Fri Jul 10 18:16:22 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from David Miller: 1) Restore previous behavior of CAP_SYS_ADMIN wrt loading networking BPF programs, from Maciej Żenczykowski. 2) Fix dropped broadcasts in mac80211 code, from Seevalamuthu Mariappan. 3) Slay memory leak in nl80211 bss color attribute parsing code, from Luca Coelho. 4) Get route from skb properly in ip_route_use_hint(), from Miaohe Lin. 5) Don't allow anything other than ARPHRD_ETHER in llc code, from Eric Dumazet. 6) xsk code dips too deeply into DMA mapping implementation internals. Add dma_need_sync and use it. From Christoph Hellwig 7) Enforce power-of-2 for BPF ringbuf sizes. From Andrii Nakryiko. 8) Check for disallowed attributes when loading flow dissector BPF programs. From Lorenz Bauer. 9) Correct packet injection to L3 tunnel devices via AF_PACKET, from Jason A. Donenfeld. 10) Don't advertise checksum offload on ipa devices that don't support it. From Alex Elder. 11) Resolve several issues in TCP MD5 signature support. Missing memory barriers, bogus options emitted when using syncookies, and failure to allow md5 key changes in established states. All from Eric Dumazet. 12) Fix interface leak in hsr code, from Taehee Yoo. 13) VF reset fixes in hns3 driver, from Huazhong Tan. 14) Make loopback work again with ipv6 anycast, from David Ahern. 15) Fix TX starvation under high load in fec driver, from Tobias Waldekranz. 16) MLD2 payload lengths not checked properly in bridge multicast code, from Linus Lüssing. 17) Packet scheduler code that wants to find the inner protocol currently only works for one level of VLAN encapsulation. Allow Q-in-Q situations to work properly here, from Toke Høiland-Jørgensen. 18) Fix route leak in l2tp, from Xin Long. 19) Resolve conflict between the sk->sk_user_data usage of bpf reuseport support and various protocols. From Martin KaFai Lau. 20) Fix socket cgroup v2 reference counting in some situations, from Cong Wang. 21) Cure memory leak in mlx5 connection tracking offload support, from Eli Britstein. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (146 commits) mlxsw: pci: Fix use-after-free in case of failed devlink reload mlxsw: spectrum_router: Remove inappropriate usage of WARN_ON() net: macb: fix call to pm_runtime in the suspend/resume functions net: macb: fix macb_suspend() by removing call to netif_carrier_off() net: macb: fix macb_get/set_wol() when moving to phylink net: macb: mark device wake capable when "magic-packet" property present net: macb: fix wakeup test in runtime suspend/resume routines bnxt_en: fix NULL dereference in case SR-IOV configuration fails libbpf: Fix libbpf hashmap on (I)LP32 architectures net/mlx5e: CT: Fix memory leak in cleanup net/mlx5e: Fix port buffers cell size value net/mlx5e: Fix 50G per lane indication net/mlx5e: Fix CPU mapping after function reload to avoid aRFS RX crash net/mlx5e: Fix VXLAN configuration restore after function reload net/mlx5e: Fix usage of rcu-protected pointer net/mxl5e: Verify that rpriv is not NULL net/mlx5: E-Switch, Fix vlan or qos setting in legacy mode net/mlx5: Fix eeprom support for SFP module cgroup: Fix sock_cgroup_data on big-endian. selftests: bpf: Fix detach from sockmap tests ... commit 55b244221c3f17eb2ed51c8e39e4a01c523e4eee Author: Jean-Philippe Brucker Date: Fri Jul 10 17:04:40 2020 +0200 selftests/bpf: Fix cgroup sockopt verifier test Since the BPF_PROG_TYPE_CGROUP_SOCKOPT verifier test does not set an attach type, bpf_prog_load_check_attach() disallows loading the program and the test is always skipped: #434/p perfevent for cgroup sockopt SKIP (unsupported program type 25) Fix the issue by setting a valid attach type. Fixes: 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}") Signed-off-by: Jean-Philippe Brucker Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20200710150439.126627-1-jean-philippe@linaro.org commit 9321f1aaf63e74ec3884347490e4ebb039f01b6e Author: Nathan Chancellor Date: Fri Jul 10 15:34:41 2020 -0700 mips: Remove compiler check in unroll macro CONFIG_CC_IS_GCC is undefined when Clang is used, which breaks the build (see our Travis link below). Clang 8 was chosen as a minimum version for this check because there were some improvements around __builtin_constant_p in that release. In reality, MIPS was not even buildable until clang 9 so that check was not technically necessary. Just remove all compiler checks and just assume that we have a working compiler. Fixes: d4e60453266b ("Restore gcc check in mips asm/unroll.h") Link: https://travis-ci.com/github/ClangBuiltLinux/continuous-integration/jobs/359642821 Signed-off-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 1195c7cebb95081d809f81a27b21829573cbd4a8 Merge: f9f41e3db40e c4317b11675b Author: David S. Miller Date: Fri Jul 10 14:33:34 2020 -0700 Merge branch 'mlxsw-Various-fixes' Ido Schimmel says: ==================== mlxsw: Various fixes Fix two issues found by syzkaller. Patch #1 removes inappropriate usage of WARN_ON() following memory allocation failure. Constantly triggered when syzkaller injects faults. Patch #2 fixes a use-after-free that can be triggered by 'devlink dev info' following a failed devlink reload. ==================== Signed-off-by: David S. Miller commit c4317b11675b99af6641662ebcbd3c6010600e64 Author: Ido Schimmel Date: Fri Jul 10 16:41:39 2020 +0300 mlxsw: pci: Fix use-after-free in case of failed devlink reload In case devlink reload failed, it is possible to trigger a use-after-free when querying the kernel for device info via 'devlink dev info' [1]. This happens because as part of the reload error path the PCI command interface is de-initialized and its mailboxes are freed. When the devlink '->info_get()' callback is invoked the device is queried via the command interface and the freed mailboxes are accessed. Fix this by initializing the command interface once during probe and not during every reload. This is consistent with the other bus used by mlxsw (i.e., 'mlxsw_i2c') and also allows user space to query the running firmware version (for example) from the device after a failed reload. [1] BUG: KASAN: use-after-free in memcpy include/linux/string.h:406 [inline] BUG: KASAN: use-after-free in mlxsw_pci_cmd_exec+0x177/0xa60 drivers/net/ethernet/mellanox/mlxsw/pci.c:1675 Write of size 4096 at addr ffff88810ae32000 by task syz-executor.1/2355 CPU: 1 PID: 2355 Comm: syz-executor.1 Not tainted 5.8.0-rc2+ #29 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xf6/0x16e lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x250 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x14e/0x1b0 mm/kasan/generic.c:192 memcpy+0x39/0x60 mm/kasan/common.c:106 memcpy include/linux/string.h:406 [inline] mlxsw_pci_cmd_exec+0x177/0xa60 drivers/net/ethernet/mellanox/mlxsw/pci.c:1675 mlxsw_cmd_exec+0x249/0x550 drivers/net/ethernet/mellanox/mlxsw/core.c:2335 mlxsw_cmd_access_reg drivers/net/ethernet/mellanox/mlxsw/cmd.h:859 [inline] mlxsw_core_reg_access_cmd drivers/net/ethernet/mellanox/mlxsw/core.c:1938 [inline] mlxsw_core_reg_access+0x2f6/0x540 drivers/net/ethernet/mellanox/mlxsw/core.c:1985 mlxsw_reg_query drivers/net/ethernet/mellanox/mlxsw/core.c:2000 [inline] mlxsw_devlink_info_get+0x17f/0x6e0 drivers/net/ethernet/mellanox/mlxsw/core.c:1090 devlink_nl_info_fill.constprop.0+0x13c/0x2d0 net/core/devlink.c:4588 devlink_nl_cmd_info_get_dumpit+0x246/0x460 net/core/devlink.c:4648 genl_lock_dumpit+0x85/0xc0 net/netlink/genetlink.c:575 netlink_dump+0x515/0xe50 net/netlink/af_netlink.c:2245 __netlink_dump_start+0x53d/0x830 net/netlink/af_netlink.c:2353 genl_family_rcv_msg_dumpit.isra.0+0x296/0x300 net/netlink/genetlink.c:638 genl_family_rcv_msg net/netlink/genetlink.c:733 [inline] genl_rcv_msg+0x78d/0x9d0 net/netlink/genetlink.c:753 netlink_rcv_skb+0x152/0x440 net/netlink/af_netlink.c:2469 genl_rcv+0x24/0x40 net/netlink/genetlink.c:764 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x53a/0x750 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x850/0xd90 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0x150/0x190 net/socket.c:672 ____sys_sendmsg+0x6d8/0x840 net/socket.c:2363 ___sys_sendmsg+0xff/0x170 net/socket.c:2417 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2450 do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: a9c8336f6544 ("mlxsw: core: Add support for devlink info command") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit d9d5420273997664a1c09151ca86ac993f2f89c1 Author: Ido Schimmel Date: Fri Jul 10 16:41:38 2020 +0300 mlxsw: spectrum_router: Remove inappropriate usage of WARN_ON() We should not trigger a warning when a memory allocation fails. Remove the WARN_ON(). The warning is constantly triggered by syzkaller when it is injecting faults: [ 2230.758664] FAULT_INJECTION: forcing a failure. [ 2230.758664] name failslab, interval 1, probability 0, space 0, times 0 [ 2230.762329] CPU: 3 PID: 1407 Comm: syz-executor.0 Not tainted 5.8.0-rc2+ #28 ... [ 2230.898175] WARNING: CPU: 3 PID: 1407 at drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6265 mlxsw_sp_router_fib_event+0xfad/0x13e0 [ 2230.898179] Kernel panic - not syncing: panic_on_warn set ... [ 2230.898183] CPU: 3 PID: 1407 Comm: syz-executor.0 Not tainted 5.8.0-rc2+ #28 [ 2230.898190] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Fixes: 3057224e014c ("mlxsw: spectrum_router: Implement FIB offload in deferred work") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit f9f41e3db40ee8d61b427d4d88c7365d968052a9 Merge: c8b1d7436045 6c8f85cac98a Author: David S. Miller Date: Fri Jul 10 14:29:38 2020 -0700 Merge branch 'macb-WOL-fixes' Nicolas Ferre says: ==================== net: macb: Wake-on-Lan magic packet fixes and GEM handling Here is a split series to fix WoL magic-packet on the current macb driver. Only fixes in this one based on current net/master. Changes in v5: - Addressed the error code returned by phylink_ethtool_set_wol() as suggested by Russell. If PHY handles WoL, MAC doesn't stay in the way. - Removed Florian's tag on 3/5 because of the above changes. - Correct the "Fixes" tag on 1/5. Changes in v4: - Pure bug fix series for 'net'. GEM addition and MACB update removed: will be sent later. Changes in v3: - Revert some of the v2 changes done in macb_resume(). Now the resume function supports in-depth re-configuration of the controller in order to deal with deeper sleep states. Basically as it was before changes introduced by this series - Tested for non-regression with our deeper Power Management mode which cuts power to the controller completely Changes in v2: - Add patch 4/7 ("net: macb: fix macb_suspend() by removing call to netif_carrier_off()") needed for keeping phy state consistent - Add patch 5/7 ("net: macb: fix call to pm_runtime in the suspend/resume functions") that prevent putting the macb in runtime pm suspend mode when WoL is used - Collect review tags on 3 first patches from Florian: Thanks! - Review of macb_resume() function - Addition of pm_wakeup_event() in both MACB and GEM WoL IRQ handlers ==================== Signed-off-by: David S. Miller commit 6c8f85cac98a4c6b767c4c4f6af7283724c32b47 Author: Nicolas Ferre Date: Fri Jul 10 14:46:45 2020 +0200 net: macb: fix call to pm_runtime in the suspend/resume functions The calls to pm_runtime_force_suspend/resume() functions are only relevant if the device is not configured to act as a WoL wakeup source. Add the device_may_wakeup() test before calling them. Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet") Cc: Claudiu Beznea Cc: Harini Katakam Cc: Sergio Prado Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit 64febc5e56c9a748162f206dcc5be1a44436087a Author: Nicolas Ferre Date: Fri Jul 10 14:46:44 2020 +0200 net: macb: fix macb_suspend() by removing call to netif_carrier_off() As we now use the phylink call to phylink_stop() in the non-WoL path, there is no need for this call to netif_carrier_off() anymore. It can disturb the underlying phylink FSM. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Cc: Claudiu Beznea Cc: Harini Katakam Cc: Antoine Tenart Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit 253fe09435045ab9346a8e364299d971185ae031 Author: Nicolas Ferre Date: Fri Jul 10 14:46:43 2020 +0200 net: macb: fix macb_get/set_wol() when moving to phylink Keep previous function goals and integrate phylink actions to them. phylink_ethtool_get_wol() is not enough to figure out if Ethernet driver supports Wake-on-Lan. Initialization of "supported" and "wolopts" members is done in phylink function, no need to keep them in calling function. phylink_ethtool_set_wol() return value is considered and determines if the MAC has to handle WoL or not. The case where the PHY doesn't implement WoL leads to the MAC configuring it to provide this feature. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Cc: Claudiu Beznea Cc: Harini Katakam Cc: Antoine Tenart Cc: Florian Fainelli Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit ced4799d06375929e013eea04ba6908207afabbe Author: Nicolas Ferre Date: Fri Jul 10 14:46:42 2020 +0200 net: macb: mark device wake capable when "magic-packet" property present Change the way the "magic-packet" DT property is handled in the macb_probe() function, matching DT binding documentation. Now we mark the device as "wakeup capable" instead of calling the device_init_wakeup() function that would enable the wakeup source. For Ethernet WoL, enabling the wakeup_source is done by using ethtool and associated macb_set_wol() function that already calls device_set_wakeup_enable() for this purpose. That would reduce power consumption by cutting more clocks if "magic-packet" property is set but WoL is not configured by ethtool. Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet") Cc: Claudiu Beznea Cc: Harini Katakam Cc: Sergio Prado Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit 515a10a701d570e26dfbe6ee373f77c8bf11053f Author: Nicolas Ferre Date: Fri Jul 10 14:46:41 2020 +0200 net: macb: fix wakeup test in runtime suspend/resume routines Use the proper struct device pointer to check if the wakeup flag and wakeup source are positioned. Use the one passed by function call which is equivalent to &bp->dev->dev.parent. It's preventing the trigger of a spurious interrupt in case the Wake-on-Lan feature is used. Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support") Cc: Claudiu Beznea Cc: Harini Katakam Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit c8b1d7436045d3599bae56aef1682813ecccaad7 Author: Davide Caratti Date: Fri Jul 10 12:55:08 2020 +0200 bnxt_en: fix NULL dereference in case SR-IOV configuration fails we need to set 'active_vfs' back to 0, if something goes wrong during the allocation of SR-IOV resources: otherwise, further VF configurations will wrongly assume that bp->pf.vf[x] are valid memory locations, and commands like the ones in the following sequence: # echo 2 >/sys/bus/pci/devices/${ADDR}/sriov_numvfs # ip link set dev ens1f0np0 up # ip link set dev ens1f0np0 vf 0 trust on will cause a kernel crash similar to this: bnxt_en 0000:3b:00.0: not enough MMIO resources for SR-IOV BUG: kernel NULL pointer dereference, address: 0000000000000014 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 43 PID: 2059 Comm: ip Tainted: G I 5.8.0-rc2.upstream+ #871 Hardware name: Dell Inc. PowerEdge R740/08D89F, BIOS 2.2.11 06/13/2019 RIP: 0010:bnxt_set_vf_trust+0x5b/0x110 [bnxt_en] Code: 44 24 58 31 c0 e8 f5 fb ff ff 85 c0 0f 85 b6 00 00 00 48 8d 1c 5b 41 89 c6 b9 0b 00 00 00 48 c1 e3 04 49 03 9c 24 f0 0e 00 00 <8b> 43 14 89 c2 83 c8 10 83 e2 ef 45 84 ed 49 89 e5 0f 44 c2 4c 89 RSP: 0018:ffffac6246a1f570 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000000b RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff98b28f538900 RBP: ffff98b28f538900 R08: 0000000000000000 R09: 0000000000000008 R10: ffffffffb9515be0 R11: ffffac6246a1f678 R12: ffff98b28f538000 R13: 0000000000000001 R14: 0000000000000000 R15: ffffffffc05451e0 FS: 00007fde0f688800(0000) GS:ffff98baffd40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000014 CR3: 000000104bb0a003 CR4: 00000000007606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: do_setlink+0x994/0xfe0 __rtnl_newlink+0x544/0x8d0 rtnl_newlink+0x47/0x70 rtnetlink_rcv_msg+0x29f/0x350 netlink_rcv_skb+0x4a/0x110 netlink_unicast+0x21d/0x300 netlink_sendmsg+0x329/0x450 sock_sendmsg+0x5b/0x60 ____sys_sendmsg+0x204/0x280 ___sys_sendmsg+0x88/0xd0 __sys_sendmsg+0x5e/0xa0 do_syscall_64+0x47/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.") Reported-by: Fei Liu CC: Jonathan Toppins CC: Michael Chan Signed-off-by: Davide Caratti Reviewed-by: Michael Chan Acked-by: Jonathan Toppins Signed-off-by: David S. Miller commit 45ae836f8a257599ae11873e2642101a96b40a4c Merge: ca68d5637aaf b2f9f1535bb9 Author: David S. Miller Date: Fri Jul 10 14:07:43 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2020-07-09 The following pull-request contains BPF updates for your *net* tree. We've added 4 non-merge commits during the last 1 day(s) which contain a total of 4 files changed, 26 insertions(+), 15 deletions(-). The main changes are: 1) fix crash in libbpf on 32-bit archs, from Jakub and Andrii. 2) fix crash when l2tp and bpf_sk_reuseport conflict, from Martin. ==================== Signed-off-by: David S. Miller commit ca68d5637aaff64d4838f609708ecf592d67bfe0 Merge: 14b032b8f8fc eb32b3f53d28 Author: David S. Miller Date: Fri Jul 10 14:02:01 2020 -0700 Merge tag 'mlx5-fixes-2020-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2020-07-02 This series introduces some fixes to mlx5 driver. V1->v2: - Drop "ip -s" patch and mirred device hold reference patch. - Will revise them in a later submission. Please pull and let me know if there is any problem. For -stable v5.2 ('net/mlx5: Fix eeprom support for SFP module') For -stable v5.4 ('net/mlx5e: Fix 50G per lane indication') For -stable v5.5 ('net/mlx5e: Fix CPU mapping after function reload to avoid aRFS RX crash') ('net/mlx5e: Fix VXLAN configuration restore after function reload') For -stable v5.7 ('net/mlx5e: CT: Fix memory leak in cleanup') ==================== Signed-off-by: David S. Miller commit aa0c9086b40c17a7ad94425b3b70dd1fdd7497bf Merge: 0f318cba1e08 0a0371506879 Author: Linus Torvalds Date: Fri Jul 10 13:09:41 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Small update, a few more merge window bugs and normal driver bug fixes: - Two merge window regressions in mlx5: a error path bug found by syzkaller and some lost code during a rework preventing ipoib from working in some configurations - Silence clang compilation warning in OPA related code - Fix a long standing race condition in ib_nl for ACM - Resolve when the HFI1 is shutdown" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/mlx5: Set PD pointers for the error flow unwind IB/mlx5: Fix 50G per lane indication RDMA/siw: Fix reporting vendor_part_id IB/sa: Resolv use-after-free in ib_nl_make_request() IB/hfi1: Do not destroy link_wq when the device is shut down IB/hfi1: Do not destroy hfi1_wq when the device is shut down RDMA/mlx5: Fix legacy IPoIB QP initialization IB/hfi1: Add explicit cast OPA_MTU_8192 to 'enum ib_mtu' commit 0f318cba1e08a2e18494eec847f6caf94f13129b Merge: a581387e415b 3c01655ac82e Author: Linus Torvalds Date: Fri Jul 10 10:15:37 2020 -0700 Merge tag 'linux-kselftest-fixes-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest fixes from Shuah Khan: "TPM2 test changes to run on python3 and kselftest framework fix to incorrect return type" * tag 'linux-kselftest-fixes-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kselftest: ksft_test_num return type should be unsigned selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3 commit a581387e415bbb0085e7e67906c8f4a99746590e Merge: d33db702745b 309fc03a3284 Author: Linus Torvalds Date: Fri Jul 10 09:57:57 2020 -0700 Merge tag 'io_uring-5.8-2020-07-10' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Fix memleak for error path in registered files (Yang) - Export CQ overflow state in flags, necessary to fix a case where liburing doesn't know if it needs to enter the kernel (Xiaoguang) - Fix for a regression in when user memory is accounted freed, causing issues with back-to-back ring exit + init if the ulimit -l setting is very tight. * tag 'io_uring-5.8-2020-07-10' of git://git.kernel.dk/linux-block: io_uring: account user memory freed when exit has been queued io_uring: fix memleak in io_sqe_files_register() io_uring: fix memleak in __io_sqe_files_update() io_uring: export cq overflow status to userspace commit d33db702745b84fd553d9a5f5db85e122aa45020 Merge: b1b11d0063aa 579dd91ab3a5 Author: Linus Torvalds Date: Fri Jul 10 09:55:46 2020 -0700 Merge tag 'block-5.8-2020-07-10' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Fix for inflight accounting, which affects only dm (Ming) - Fix documentation error for bfq (Yufen) - Fix memory leak for nbd (Zheng) * tag 'block-5.8-2020-07-10' of git://git.kernel.dk/linux-block: nbd: Fix memory leak in nbd_add_socket blk-mq: consider non-idle request as "inflight" in blk_mq_rq_inflight() docs: block: update and fix tiny error for bfq commit 788cacf308871db0a619952321bedfec8f1773e2 Author: Oded Gabbay Date: Tue Jul 7 17:30:13 2020 +0300 habanalabs: set 4s timeout for message to device CPU We see that sometimes the CPU in GOYA and GAUDI is occupied by the power/thermal loop and can't answer requests from the driver fast enough. Therefore, to avoid false notifications on timeouts, increase the timeout to 4 seconds on each message sent to the device CPU. Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar commit e38bfd30e08802d9661efffb8c048bd53a3acfc4 Author: Oded Gabbay Date: Fri Jul 3 20:46:12 2020 +0300 habanalabs: set clock gating per engine For debugging purposes, we need to allow the root user better control of the clock gating feature of the DMA and compute engines. Therefore, change the clock gating debugfs interface to be bitmask instead of true/false. Each bit represents a different engine, according to gaudi_engine_id enum. See debugfs documentation for more details. Signed-off-by: Oded Gabbay Reviewed-by: Omer Shpigelman commit 2edc66e22ba1af33020ff8b75fe1a2b055cdb73f Author: Oded Gabbay Date: Fri Jul 3 19:28:54 2020 +0300 habanalabs: block WREG_BULK packet on PDMA WREG_BULK is a special packet that has a variable length. Therefore, we can't parse it when validating CBs that go to the PCI DMA queue. In case the user needs to use it, it can put multiple WREG32 packets instead. Signed-off-by: Oded Gabbay Reviewed-by: Omer Shpigelman commit b1b11d0063aab28aaf65f63cff56470bc01dc290 Merge: 1bfde037425d 775802c0571f Author: Linus Torvalds Date: Fri Jul 10 09:45:15 2020 -0700 Merge tag 'cleanup-kernel_read_write' of git://git.infradead.org/users/hch/misc Pull in-kernel read and write op cleanups from Christoph Hellwig: "Cleanup in-kernel read and write operations Reshuffle the (__)kernel_read and (__)kernel_write helpers, and ensure all users of in-kernel file I/O use them if they don't use iov_iter based methods already. The new WARN_ONs in combination with syzcaller already found a missing input validation in 9p. The fix should be on your way through the maintainer ASAP". [ This is prep-work for the real changes coming 5.9 ] * tag 'cleanup-kernel_read_write' of git://git.infradead.org/users/hch/misc: fs: remove __vfs_read fs: implement kernel_read using __kernel_read integrity/ima: switch to using __kernel_read fs: add a __kernel_read helper fs: remove __vfs_write fs: implement kernel_write using __kernel_write fs: check FMODE_WRITE in __kernel_write fs: unexport __kernel_write bpfilter: switch to kernel_write autofs: switch to kernel_write cachefiles: switch to kernel_write commit 1bfde037425d91d1d615d30ec362f5f5c1ca0dd2 Merge: 25aadbd2a8ad 68d237056e00 Author: Linus Torvalds Date: Fri Jul 10 09:36:03 2020 -0700 Merge tag 'dma-mapping-5.8-5' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - add a warning when the atomic pool is depleted (David Rientjes) - protect the parameters of the new scatterlist helper macros (Marek Szyprowski ) * tag 'dma-mapping-5.8-5' of git://git.infradead.org/users/hch/dma-mapping: scatterlist: protect parameters of the sg_table related macros dma-mapping: warn when coherent pool is depleted commit 25aadbd2a8ad05ed0477cb94c7659075f540d158 Merge: 3f8834327ae7 f8e99dde2199 Author: Linus Torvalds Date: Fri Jul 10 09:28:52 2020 -0700 Merge tag 'pinctrl-v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Fix an issue in the AMD driver for the UART0 group - Fix a glitch issue in the Baytrail pin controller * tag 'pinctrl-v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: baytrail: Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH) pinctrl: amd: fix npins for uart0 in kerncz_groups commit 3f8834327ae7d8bfc34793cfce72663af35133d0 Merge: d02b0478c1ac 93e0272a4395 Author: Linus Torvalds Date: Fri Jul 10 09:19:39 2020 -0700 Merge tag 'gpio-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO fixes from Linus Walleij: "Some GPIO fixes, most of them for the PCA953x that Andy worked hard to fix up. - Fix two runtime PM errorpath problems in the Arizona GPIO driver. - Fix three interrupt issues in the PCA953x driver. - Fix the automatic address increment handling in the PCA953x driver again. - Add a quirk to the PCA953x that fixes a problem in the Intel Galileo Gen 2" * tag 'gpio-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: pca953x: Fix GPIO resource leak on Intel Galileo Gen 2 gpio: pca953x: disable regmap locking for automatic address incrementing gpio: pca953x: Fix direction setting when configure an IRQ gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2 gpio: pca953x: Synchronize interrupt handler properly gpio: arizona: put pm_runtime in case of failure gpio: arizona: handle pm_runtime_get_sync failure case commit 9b7e5208a941e2e491a83eb5fa83d889e888fa2f Author: Takashi Iwai Date: Fri Jul 10 18:06:56 2020 +0200 ALSA: usb-audio: Fix race against the error recovery URB submission USB MIDI driver has an error recovery mechanism to resubmit the URB in the delayed timer handler, and this may race with the standard start / stop operations. Although both start and stop operations themselves don't race with each other due to the umidi->mutex protection, but this isn't applied to the timer handler. For fixing this potential race, the following changes are applied: - Since the timer handler can't use the mutex, we apply the umidi->disc_lock protection at each input stream URB submission; this also needs to change the GFP flag to GFP_ATOMIC - Add a check of the URB refcount and skip if already submitted - Move the timer cancel call at disconnection to the beginning of the procedure; this assures the in-flight timer handler is gone properly before killing all pending URBs Reported-by: syzbot+0f4ecfe6a2c322c81728@syzkaller.appspotmail.com Reported-by: syzbot+5f1d24c49c1d2c427497@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/20200710160656.16819-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit d02b0478c1acb00e9d9ee40810627eba5745d94b Merge: f4c8824cbcc6 20f829999c38 Author: Linus Torvalds Date: Fri Jul 10 08:53:21 2020 -0700 Merge tag 'gfs2-v5.8-rc4.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fixes from Andreas Gruenbacher: "Fix gfs2 readahead deadlocks by adding a IOCB_NOIO flag that allows gfs2 to use the generic fiel read iterator functions without having to worry about being called back while holding locks". * tag 'gfs2-v5.8-rc4.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Rework read and page fault locking fs: Add IOCB_NOIO flag for generic_file_read_iter commit f4c8824cbcc64524905f83388eb1139747829756 Merge: e8749d068855 5679b2814219 Author: Linus Torvalds Date: Fri Jul 10 08:42:17 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "An unfortunately large collection of arm64 fixes for -rc5. Some of this is absolutely trivial, but the alternatives, vDSO and CPU errata workaround fixes are significant. At least people are finding and fixing these things, I suppose. - Fix workaround for CPU erratum #1418040 to disable the compat vDSO - Fix Oops when single-stepping with KGDB - Fix memory attributes for hypervisor device mappings at EL2 - Fix memory leak in PSCI and remove useless variable assignment - Fix up some comments and asm labels in our entry code - Fix broken register table formatting in our generated html docs - Fix missing NULL sentinel in CPU errata workaround list - Fix patching of branches in alternative instruction sections" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/alternatives: don't patch up internal branches arm64: Add missing sentinel to erratum_1463225 arm64: Documentation: Fix broken table in generated HTML arm64: kgdb: Fix single-step exception handling oops arm64: entry: Tidy up block comments and label numbers arm64: Rework ARM_ERRATUM_1414080 handling arm64: arch_timer: Disable the compat vdso for cores affected by ARM64_WORKAROUND_1418040 arm64: arch_timer: Allow an workaround descriptor to disable compat vdso arm64: Introduce a way to disable the 32bit vdso arm64: entry: Fix the typo in the comment of el1_dbg() drivers/firmware/psci: Assign @err directly in hotplug_tests() drivers/firmware/psci: Fix memory leakage in alloc_init_cpu_groups() KVM: arm64: Fix definition of PAGE_HYP_DEVICE commit e8749d068855c2b075b3de1985e6af836a02b257 Merge: cb24c61b53c3 dd9ce2d6eeae Author: Linus Torvalds Date: Fri Jul 10 08:39:33 2020 -0700 Merge tag 's390-5.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: "This is mainly due to the fact that Gerald Schaefer's and also my old email addresses currently do not work any longer. Therefore we decided to switch to new email addresses and reflect that in the MAINTAINERS file. - Update email addresses in MAINTAINERS file and add .mailmap entries for Gerald Schaefer and Heiko Carstens. - Fix huge pte soft dirty copying" * tag 's390-5.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: MAINTAINERS: update email address for Gerald Schaefer MAINTAINERS: update email address for Heiko Carstens s390/mm: fix huge pte soft dirty copying commit cb24c61b53c3f47d4ba596fe37076202f7189676 Merge: d45f47a46854 3d9fdc252b52 Author: Linus Torvalds Date: Fri Jul 10 08:34:12 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull vkm fixes from Paolo Bonzini: "Two simple but important bugfixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: MIPS: Fix build errors for 32bit kernel KVM: nVMX: fixes for preemption timer migration commit d45f47a46854b304ebda238b6121f95370b195ec Merge: 42f82040ee66 3ec2d5113ea5 Author: Linus Torvalds Date: Fri Jul 10 08:28:49 2020 -0700 Merge tag 'mmc-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - Override DLL_CONFIG only with valid values in sdhci-msm - Get rid of of_match_ptr() macro to fix warning in owl-mmc - Limit segments to 1 to fix meson-gx G12A/G12B SoCs * tag 'mmc-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-msm: Override DLL_CONFIG only if the valid value is supplied mmc: owl-mmc: Get rid of of_match_ptr() macro mmc: meson-gx: limit segments to 1 when dram-access-quirk is needed commit 309fc03a3284af62eb6082fb60327045a1dabf57 Author: Jens Axboe Date: Fri Jul 10 09:13:34 2020 -0600 io_uring: account user memory freed when exit has been queued We currently account the memory after the exit work has been run, but that leaves a gap where a process has closed its ring and until the memory has been accounted as freed. If the memlocked ulimit is borderline, then that can introduce spurious setup errors returning -ENOMEM because the free work hasn't been run yet. Account this as freed when we close the ring, as not to expose a tiny gap where setting up a new ring can fail. Fixes: 85faa7b8346e ("io_uring: punt final io_ring_ctx wait-and-free to workqueue") Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Jens Axboe commit 68359a1ad8447c99732ebeab8c169bfed543667a Author: Takashi Iwai Date: Fri Jul 10 15:59:59 2020 +0200 ALSA: line6: Sync the pending work cancel at disconnection Recently syzkaller reported a UAF in LINE6 driver, and it's likely because we call cancel_delayed_work() at the disconnect callback instead of cancel_delayed_work_sync(). Let's use the correct one instead. Reported-by: syzbot+145012a46658ac00fc9e@syzkaller.appspotmail.com Suggested-by: Alan Stern Cc: Link: https://lore.kernel.org/r/s5hlfjr4gio.wl-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6e8a914ad619042c5f25a4feb663357c4170fd8d Author: Takashi Iwai Date: Fri Jul 10 15:33:51 2020 +0200 ALSA: line6: Perform sanity check for each URB creation LINE6 drivers create stream URBs with a fixed pipe without checking its validity, and this may lead to a kernel WARNING at the submission when a malformed USB descriptor is passed. For avoiding the kernel warning, perform the similar sanity checks for each pipe type at creating a URB. Reported-by: syzbot+c190f6858a04ea7fbc52@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/s5hv9iv4hq8.wl-tiwai@suse.de Signed-off-by: Takashi Iwai commit 667e57da358f61b6966e12e925a69e42d912e8bb Author: Yang Yingliang Date: Fri Jul 10 14:14:20 2020 +0000 io_uring: fix memleak in io_sqe_files_register() I got a memleak report when doing some fuzz test: BUG: memory leak unreferenced object 0x607eeac06e78 (size 8): comm "test", pid 295, jiffies 4294735835 (age 31.745s) hex dump (first 8 bytes): 00 00 00 00 00 00 00 00 ........ backtrace: [<00000000932632e6>] percpu_ref_init+0x2a/0x1b0 [<0000000092ddb796>] __io_uring_register+0x111d/0x22a0 [<00000000eadd6c77>] __x64_sys_io_uring_register+0x17b/0x480 [<00000000591b89a6>] do_syscall_64+0x56/0xa0 [<00000000864a281d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Call percpu_ref_exit() on error path to avoid refcount memleak. Fixes: 05f3fb3c5397 ("io_uring: avoid ring quiesce for fixed file set unregister and update") Cc: stable@vger.kernel.org Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Jens Axboe commit 2451e746478a6a6e981cfa66b62b791ca93b90c8 Author: Saravana Kannan Date: Wed Jul 1 12:42:59 2020 -0700 driver core: Avoid deferred probe due to fw_devlink_pause/resume() With the earlier patch in this series, all devices that deferred probe due to fw_devlink_pause() will have their probes delayed till the deferred probe thread is kicked off during late_initcall. This will also affect all their consumers. This delayed probing in unnecessary. So this patch just keeps track of the devices that had their probe deferred due to fw_devlink_pause() and attempts to probe them once during fw_devlink_resume(). Fixes: 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing") Signed-off-by: Saravana Kannan Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200701194259.3337652-4-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit ec7bd78498f29680f536451fbdf9464e851273ed Author: Saravana Kannan Date: Wed Jul 1 12:42:58 2020 -0700 driver core: Rename dev_links_info.defer_sync to defer_hook The defer_sync field is used as a hook to add the device to the deferred_sync list. Rename it so that it's more meaningful for the next patch that'll also use this field as a hook to a deferred_fw_devlink list. Signed-off-by: Saravana Kannan Reviewed-by: Rafael J. Wysocki Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200701194259.3337652-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit cec72f3efc6272420c2c2c699607f03d09b93e41 Author: Saravana Kannan Date: Wed Jul 1 12:42:57 2020 -0700 driver core: Don't do deferred probe in parallel with kernel_init thread The current deferred probe implementation can mess up suspend/resume ordering if deferred probe thread is kicked off in parallel with the main initcall thread (kernel_init thread) [1]. For example: Say device-B is a consumer of device-A. Initcall thread Deferred probe thread =============== ===================== 1. device-A is added. 2. device-B is added. 3. dpm_list is now [device-A, device-B]. 4. driver-A defers probe of device-A. 5. device-A is moved to end of dpm_list 6. dpm_list is now [device-B, device-A] 7. driver-B is registereed and probes device-B. 8. dpm_list stays as [device-B, device-A]. The reverse order of dpm_list is used for suspend. So in this case device-A would incorrectly get suspended before device-B. Commit 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing") kicked off the deferred probe thread early during boot to run in parallel with the initcall thread and caused suspend/resume regressions. This patch removes the parallel run of the deferred probe thread to avoid the suspend/resume regressions. [1] - https://lore.kernel.org/lkml/CAGETcx8W96KAw-d_siTX4qHB_-7ddk0miYRDQeHE6E0_8qx-6Q@mail.gmail.com/ Fixes: 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing") Signed-off-by: Saravana Kannan Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200701194259.3337652-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 897c44f0bae574c5fb318c759b060bebf9dd6013 Author: Alexander Lobakin Date: Tue Jun 23 11:09:33 2020 +0000 virtio: virtio_console: add missing MODULE_DEVICE_TABLE() for rproc serial rproc_serial_id_table lacks an exposure to module devicetable, so when remoteproc firmware requests VIRTIO_ID_RPROC_SERIAL, no uevent is generated and no module autoloading occurs. Add missing MODULE_DEVICE_TABLE() annotation and move the existing one for VIRTIO_ID_CONSOLE right to the table itself. Fixes: 1b6370463e88 ("virtio_console: Add support for remoteproc serial") Cc: # v3.8+ Signed-off-by: Alexander Lobakin Reviewed-by: Amit Shah Link: https://lore.kernel.org/r/x7C_CbeJtoGMy258nwAXASYz3xgFMFpyzmUvOyZzRnQrgWCREBjaqBOpAUS7ol4NnZYvSVwmTsCG0Ohyfvta-ygw6HMHcoeKK0C3QFiAO_Q=@pm.me Signed-off-by: Greg Kroah-Hartman commit e78e1fdb282726beaf88aa75943682217e6ded0e Author: Alexander Shishkin Date: Mon Jul 6 19:13:39 2020 +0300 intel_th: Fix a NULL dereference when hub driver is not loaded Connecting master to an output port when GTH driver module is not loaded triggers a NULL dereference: > RIP: 0010:intel_th_set_output+0x35/0x70 [intel_th] > Call Trace: > ? sth_stm_link+0x12/0x20 [intel_th_sth] > stm_source_link_store+0x164/0x270 [stm_core] > dev_attr_store+0x17/0x30 > sysfs_kf_write+0x3e/0x50 > kernfs_fop_write+0xda/0x1b0 > __vfs_write+0x1b/0x40 > vfs_write+0xb9/0x1a0 > ksys_write+0x67/0xe0 > __x64_sys_write+0x1a/0x20 > do_syscall_64+0x57/0x1d0 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 Make sure the module in question is loaded and return an error if not. Signed-off-by: Alexander Shishkin Fixes: 39f4034693b7c ("intel_th: Add driver infrastructure for Intel(R) Trace Hub devices") Reviewed-by: Andy Shevchenko Reported-by: Ammy Yi Tested-by: Ammy Yi Cc: stable@vger.kernel.org # v4.4 Link: https://lore.kernel.org/r/20200706161339.55468-5-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit fd73d74a32bfaaf259441322cc5a1c83caaa94f2 Author: Alexander Shishkin Date: Mon Jul 6 19:13:38 2020 +0300 intel_th: pci: Add Emmitsburg PCH support This adds support for the Trace Hub in Emmitsburg PCH. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v4.14+ Link: https://lore.kernel.org/r/20200706161339.55468-4-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 6227585dc7b6a5405fc08dc322f98cb95e2f0eb4 Author: Alexander Shishkin Date: Mon Jul 6 19:13:37 2020 +0300 intel_th: pci: Add Tiger Lake PCH-H support This adds support for the Trace Hub in Tiger Lake PCH-H. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v4.14+ Link: https://lore.kernel.org/r/20200706161339.55468-3-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 203c1f615052921901b7a8fbe2005d8ea6add076 Author: Alexander Shishkin Date: Mon Jul 6 19:13:36 2020 +0300 intel_th: pci: Add Jasper Lake CPU support This adds support for the Trace Hub in Jasper Lake CPU. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v4.14+ Link: https://lore.kernel.org/r/20200706161339.55468-2-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit dd9ce2d6eeaebbdd342cbe095b7a195d569f18d3 Author: Gerald Schaefer Date: Fri Jul 10 13:36:26 2020 +0200 MAINTAINERS: update email address for Gerald Schaefer Signed-off-by: Gerald Schaefer Signed-off-by: Heiko Carstens commit 2c08f65fd71cc2c96042c14fd3847a79262e1757 Author: Heiko Carstens Date: Thu Jul 9 10:37:54 2020 +0200 MAINTAINERS: update email address for Heiko Carstens Signed-off-by: Heiko Carstens commit f743061a85f5e9989df22ccbf07c80c98fc90e08 Author: Andy Shevchenko Date: Tue Jul 7 00:49:03 2020 +0300 serial: core: Initialise spin lock before use in uart_configure_port() The comment near to uart_port_spin_lock_init() says: Ensure that the serial console lock is initialised early. If this port is a console, then the spinlock is already initialised. and there is nothing about enabled or disabled consoles. The commit a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") made a change, which follows the comment, and also to prevent reinitialisation of the lock in use, when user detaches and attaches back the same console device. But this change discovers another issue, that uart_add_one_port() tries to access a spin lock that now may be uninitialised. This happens when a driver expects the serial core to register a console on its behalf. In this case we must initialise a spin lock before use. Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") Reported-by: Marc Zyngier Reported-by: Lad Prabhakar Reported-by: Guenter Roeck Reported-by: Anatoly Pugachev Acked-by: Marc Zyngier Tested-by: Tony Lindgren Cc: Geert Uytterhoeven Signed-off-by: Andy Shevchenko Tested-by: Lad Prabhakar Link: https://lore.kernel.org/r/20200706214903.56148-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d8edf8eb5f6e921fe6389f96d2cd05862730a6ff Author: Chuhong Yuan Date: Thu Jul 9 21:56:08 2020 +0800 serial: mxs-auart: add missed iounmap() in probe failure and remove This driver calls ioremap() in probe, but it misses calling iounmap() in probe's error handler and remove. Add the missed calls to fix it. Fixes: 47d37d6f94cc ("serial: Add auart driver for i.MX23/28") Signed-off-by: Chuhong Yuan Cc: stable Link: https://lore.kernel.org/r/20200709135608.68290-1-hslester96@gmail.com Signed-off-by: Greg Kroah-Hartman commit ba8c423488974f02b538e9dc1730f0334f9b85aa Author: Dan Carpenter Date: Fri Jul 10 14:36:10 2020 +0300 xen/xenbus: Fix a double free in xenbus_map_ring_pv() When there is an error the caller frees "info->node" so the free here will result in a double free. We should just delete first kfree(). Fixes: 3848e4e0a32a ("xen/xenbus: avoid large structs and arrays on the stack") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200710113610.GA92345@mwanda Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit ef75e14a6c935eec82abac07ab68e388514e39bc Author: Dan Carpenter Date: Thu Jul 9 13:29:36 2020 +0300 staging: comedi: verify array index is correct before using it This code reads from the array before verifying that "trig" is a valid index. If the index is wildly out of bounds then reading from an invalid address could lead to an Oops. Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions") Signed-off-by: Dan Carpenter Reviewed-by: Ian Abbott Link: https://lore.kernel.org/r/20200709102936.GA20875@mwanda Signed-off-by: Greg Kroah-Hartman commit 59d1d2e8e1e7c50d2657d5e4812b53f71f507968 Author: Hans de Goede Date: Thu Jul 9 14:08:52 2020 +0200 virt: vbox: Fix guest capabilities mask check Check the passed in capabilities against VMMDEV_GUEST_CAPABILITIES_MASK instead of against VMMDEV_EVENT_VALID_EVENT_MASK. This tightens the allowed mask from 0x7ff to 0x7. Fixes: 0ba002bc4393 ("virt: Add vboxguest driver for Virtual Box Guest integration") Cc: stable@vger.kernel.org Acked-by: Arnd Bergmann Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20200709120858.63928-3-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit f794db6841e5480208f0c3a3ac1df445a96b079e Author: Hans de Goede Date: Thu Jul 9 14:08:51 2020 +0200 virt: vbox: Fix VBGL_IOCTL_VMMDEV_REQUEST_BIG and _LOG req numbers to match upstream Until this commit the mainline kernel version (this version) of the vboxguest module contained a bug where it defined VBGL_IOCTL_VMMDEV_REQUEST_BIG and VBGL_IOCTL_LOG using _IOC(_IOC_READ | _IOC_WRITE, 'V', ...) instead of _IO(V, ...) as the out of tree VirtualBox upstream version does. Since the VirtualBox userspace bits are always built against VirtualBox upstream's headers, this means that so far the mainline kernel version of the vboxguest module has been failing these 2 ioctls with -ENOTTY. I guess that VBGL_IOCTL_VMMDEV_REQUEST_BIG is never used causing us to not hit that one and sofar the vboxguest driver has failed to actually log any log messages passed it through VBGL_IOCTL_LOG. This commit changes the VBGL_IOCTL_VMMDEV_REQUEST_BIG and VBGL_IOCTL_LOG defines to match the out of tree VirtualBox upstream vboxguest version, while keeping compatibility with the old wrong request defines so as to not break the kernel ABI in case someone has been using the old request defines. Fixes: f6ddd094f579 ("virt: Add vboxguest driver for Virtual Box Guest integration UAPI") Cc: stable@vger.kernel.org Acked-by: Arnd Bergmann Reviewed-by: Arnd Bergmann Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20200709120858.63928-2-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit d1c0d96535d7464d1111727c79d6dac274b8bc4f Merge: 211f08347355 8778eb0927dd Author: Greg Kroah-Hartman Date: Fri Jul 10 12:40:04 2020 +0200 Merge tag 'fixes-for-v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: USB: fixes for v5.8-rc3 Adding support for recent Intel devices (Tiger Lake and Jasper Lake) on dwc3. We have some endianess fixes in cdns3, a memleak fix in gr_udc and lock API usage fix in the legacy f_uac1 Signed-off-by: Felipe Balbi * tag 'fixes-for-v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: usb: gadget: function: fix missing spinlock in f_uac1_legacy usb: gadget: udc: atmel: fix uninitialized read in debug printk usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable() usb: dwc2: Fix shutdown callback in platform usb: cdns3: trace: fix some endian issues usb: cdns3: ep0: fix some endian issues usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init() usb: gadget: fix langid kernel-doc warning in usbstring.c usb: dwc3: pci: add support for the Intel Jasper Lake usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant commit 3d9fdc252b52023260de1d12399cb3157ed28c07 Author: Huacai Chen Date: Fri Jul 10 15:23:17 2020 +0800 KVM: MIPS: Fix build errors for 32bit kernel Commit dc6d95b153e78ed70b1b2c04a ("KVM: MIPS: Add more MMIO load/store instructions emulation") introduced some 64bit load/store instructions emulation which are unavailable on 32bit platform, and it causes build errors: arch/mips/kvm/emulate.c: In function 'kvm_mips_emulate_store': arch/mips/kvm/emulate.c:1734:6: error: right shift count >= width of type [-Werror] ((vcpu->arch.gprs[rt] >> 56) & 0xff); ^ arch/mips/kvm/emulate.c:1738:6: error: right shift count >= width of type [-Werror] ((vcpu->arch.gprs[rt] >> 48) & 0xffff); ^ arch/mips/kvm/emulate.c:1742:6: error: right shift count >= width of type [-Werror] ((vcpu->arch.gprs[rt] >> 40) & 0xffffff); ^ arch/mips/kvm/emulate.c:1746:6: error: right shift count >= width of type [-Werror] ((vcpu->arch.gprs[rt] >> 32) & 0xffffffff); ^ arch/mips/kvm/emulate.c:1796:6: error: left shift count >= width of type [-Werror] (vcpu->arch.gprs[rt] << 32); ^ arch/mips/kvm/emulate.c:1800:6: error: left shift count >= width of type [-Werror] (vcpu->arch.gprs[rt] << 40); ^ arch/mips/kvm/emulate.c:1804:6: error: left shift count >= width of type [-Werror] (vcpu->arch.gprs[rt] << 48); ^ arch/mips/kvm/emulate.c:1808:6: error: left shift count >= width of type [-Werror] (vcpu->arch.gprs[rt] << 56); ^ cc1: all warnings being treated as errors make[3]: *** [arch/mips/kvm/emulate.o] Error 1 So, use #if defined(CONFIG_64BIT) && defined(CONFIG_KVM_MIPS_VZ) to guard the 64bit load/store instructions emulation. Reported-by: kernel test robot Fixes: dc6d95b153e78ed70b1b2c04a ("KVM: MIPS: Add more MMIO load/store instructions emulation") Signed-off-by: Huacai Chen Message-Id: <1594365797-536-1-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 83d31e5271ac74aad14b5a1a2ed26923e1446329 Author: Paolo Bonzini Date: Thu Jul 9 13:12:09 2020 -0400 KVM: nVMX: fixes for preemption timer migration Commit 850448f35aaf ("KVM: nVMX: Fix VMX preemption timer migration", 2020-06-01) accidentally broke nVMX live migration from older version by changing the userspace ABI. Restore it and, while at it, ensure that vmx->nested.has_preemption_timer_deadline is always initialized according to the KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE flag. Cc: Makarand Sonare Fixes: 850448f35aaf ("KVM: nVMX: Fix VMX preemption timer migration") Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 6348dd291e3653534a9e28e6917569bc9967b35b Author: Charan Teja Kalla Date: Fri Jun 19 17:27:19 2020 +0530 dmabuf: use spinlock to access dmabuf->name There exists a sleep-while-atomic bug while accessing the dmabuf->name under mutex in the dmabuffs_dname(). This is caused from the SELinux permissions checks on a process where it tries to validate the inherited files from fork() by traversing them through iterate_fd() (which traverse files under spin_lock) and call match_file(security/selinux/hooks.c) where the permission checks happen. This audit information is logged using dump_common_audit_data() where it calls d_path() to get the file path name. If the file check happen on the dmabuf's fd, then it ends up in ->dmabuffs_dname() and use mutex to access dmabuf->name. The flow will be like below: flush_unauthorized_files() iterate_fd() spin_lock() --> Start of the atomic section. match_file() file_has_perm() avc_has_perm() avc_audit() slow_avc_audit() common_lsm_audit() dump_common_audit_data() audit_log_d_path() d_path() dmabuffs_dname() mutex_lock()--> Sleep while atomic. Call trace captured (on 4.19 kernels) is below: ___might_sleep+0x204/0x208 __might_sleep+0x50/0x88 __mutex_lock_common+0x5c/0x1068 __mutex_lock_common+0x5c/0x1068 mutex_lock_nested+0x40/0x50 dmabuffs_dname+0xa0/0x170 d_path+0x84/0x290 audit_log_d_path+0x74/0x130 common_lsm_audit+0x334/0x6e8 slow_avc_audit+0xb8/0xf8 avc_has_perm+0x154/0x218 file_has_perm+0x70/0x180 match_file+0x60/0x78 iterate_fd+0x128/0x168 selinux_bprm_committing_creds+0x178/0x248 security_bprm_committing_creds+0x30/0x48 install_exec_creds+0x1c/0x68 load_elf_binary+0x3a4/0x14e0 search_binary_handler+0xb0/0x1e0 So, use spinlock to access dmabuf->name to avoid sleep-while-atomic. Cc: [5.3+] Signed-off-by: Charan Teja Kalla Reviewed-by: Michael J. Ruhl Acked-by: Christian König [sumits: added comment to spinlock_t definition to avoid warning] Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/a83e7f0d-4e54-9848-4b58-e1acdbe06735@codeaurora.org commit 211f08347355cba1f769bbf3355816a12b3ddd55 Author: Tom Rix Date: Wed Jul 8 06:12:43 2020 -0700 USB: c67x00: fix use after free in c67x00_giveback_urb clang static analysis flags this error c67x00-sched.c:489:55: warning: Use of memory after it is freed [unix.Malloc] usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); ^~~~~~~~~~~~ Problem happens in this block of code c67x00_release_urb(c67x00, urb); usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); spin_unlock(&c67x00->lock); usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); In the call to c67x00_release_urb has this freeing of urbp urbp = urb->hcpriv; urb->hcpriv = NULL; list_del(&urbp->hep_node); kfree(urbp); And so urbp is freed before usb_hcd_giveback_urb uses it as its 3rd parameter. Since all is required is the status, pass the status directly as is done in c64x00_urb_dequeue Fixes: e9b29ffc519b ("USB: add Cypress c67x00 OTG controller HCD driver") Signed-off-by: Tom Rix Cc: stable Link: https://lore.kernel.org/r/20200708131243.24336-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 70ee5731a40b1f07f151e52c3c4ed27d70d4f9fe Author: Vincent Chen Date: Tue Jun 23 13:37:35 2020 +0800 riscv: Avoid kgdb.h including gdb_xml.h to solve unused-const-variable warning The constant arrays in gdb_xml.h are only used in arch/riscv/kernel/kgdb.c, but other c files may include the gdb_xml.h indirectly via including the kgdb.h. Hence, It will cause many unused-const-variable warnings. This patch makes the kgdb.h not to include the gdb_xml.h to solve this problem. Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit def0aa218e6d42231540329e6f5741fdec9e7da4 Author: Vincent Chen Date: Tue Jun 23 13:37:25 2020 +0800 kgdb: Move the extern declaration kgdb_has_hit_break() to generic kgdb.h Currently, only riscv kgdb.c uses the kgdb_has_hit_break() to identify the kgdb breakpoint. It causes other architectures will encounter the "no previous prototype" warnings if the compile option has W=1. Moving the declaration of extern kgdb_has_hit_break() from risc-v kgdb.h to generic kgdb.h to avoid generating these warnings. Signed-off-by: Vincent Chen Acked-by: Daniel Thompson Signed-off-by: Palmer Dabbelt commit f7fc752815f8e2337548497b3afb4aef791db4ef Author: Vincent Chen Date: Tue Jun 23 13:37:10 2020 +0800 riscv: Fix "no previous prototype" compile warning in kgdb.c file Some functions are only used in the kgdb.c file. Add static properities to these functions to avoid "no previous prototype" compile warnings Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit fc0c769ffd926312848912a7c2296e1c503898c3 Author: Vincent Chen Date: Tue Jun 23 13:36:59 2020 +0800 riscv: enable the Kconfig prompt of STRICT_KERNEL_RWX Due to lack of hardware breakpoint support, the kernel option CONFIG_STRICT_KERNEL_RWX should be disabled when using KGDB. However, CONFIG_STRICT_KERNEL_RWX is always enabled now. Therefore, select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT to enable CONFIG_STRICT_KERNEL_RWX by default, and then select ARCH_OPTIONAL_KERNEL_RWX to enable the Kconfig prompt of CONFIG_STRICT_KERNEL_RWX so that users can turn it off. Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit 8c080d3a974ad471d8324825851044284f1886c9 Author: Vincent Chen Date: Tue Jun 23 13:36:42 2020 +0800 kgdb: enable arch to support XML packet. The XML packet could be supported by required architecture if the architecture defines CONFIG_HAVE_ARCH_KGDB_QXFER_PKT and implement its own kgdb_arch_handle_qxfer_pkt(). Except for the kgdb_arch_handle_qxfer_pkt(), the architecture also needs to record the feature supported by gdb stub into the kgdb_arch_gdb_stub_feature, and these features will be reported to host gdb when gdb stub receives the qSupported packet. Signed-off-by: Vincent Chen Acked-by: Daniel Thompson Signed-off-by: Palmer Dabbelt commit b2f9f1535bb93ee5fa2ea30ac1c26fa0d676154c Author: Jakub Bogusz Date: Thu Jul 9 15:57:23 2020 -0700 libbpf: Fix libbpf hashmap on (I)LP32 architectures On ILP32, 64-bit result was shifted by value calculated for 32-bit long type and returned value was much outside hashmap capacity. As advised by Andrii Nakryiko, this patch uses different hashing variant for architectures with size_t shorter than long long. Fixes: e3b924224028 ("libbpf: add resizable non-thread safe internal hashmap") Signed-off-by: Jakub Bogusz Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200709225723.1069937-1-andriin@fb.com commit eb32b3f53d283e8d68b6d86c3a6ed859b24dacae Author: Eli Britstein Date: Sun Jun 28 15:42:26 2020 +0300 net/mlx5e: CT: Fix memory leak in cleanup CT entries are deleted via a workqueue from netfilter. If removing the module before that, the rules are cleaned by the driver itself, but the memory entries for them are not freed. Fix that. Fixes: ac991b48d43c ("net/mlx5e: CT: Offload established flows") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 88b3d5c90e9685be54dd5bc441970044020eca76 Author: Eran Ben Elisha Date: Mon Jun 22 09:03:31 2020 +0300 net/mlx5e: Fix port buffers cell size value Device unit for port buffers size, xoff_threshold and xon_threshold is cells. Fix a bug in driver where cell unit size was hard-coded to 128 bytes. This hard-coded value is buggy, as it is wrong for some hardware versions. Driver to read cell size from SBCAM register and translate bytes to cell units accordingly. In order to fix the bug, this patch exposes SBCAM (Shared buffer capabilities mask) layout and defines. If SBCAM.cap_cell_size is valid, use it for all bytes to cells calculations. If not valid, fallback to 128. Cell size do not change on the fly per device. Instead of issuing SBCAM access reg command every time such translation is needed, cache it in mlx5e_dcbx as part of mlx5e_dcbnl_initialize(). Pass dcbx.port_buff_cell_sz as a param to every function that needs bytes to cells translation. While fixing the bug, move MLX5E_BUFFER_CELL_SHIFT macro to en_dcbnl.c, as it is only used by that file. Fixes: 0696d60853d5 ("net/mlx5e: Receive buffer configuration") Signed-off-by: Eran Ben Elisha Reviewed-by: Huy Nguyen Signed-off-by: Saeed Mahameed commit 6a1cf4e443a3b0a4d690d3c93b84b1e9cbfcb1bd Author: Aya Levin Date: Mon Jun 15 12:48:47 2020 +0300 net/mlx5e: Fix 50G per lane indication Some released FW versions mistakenly don't set the capability that 50G per lane link-modes are supported for VFs (ptys_extended_ethernet capability bit). When the capability is unset, read PTYS.ext_eth_proto_capability (always reliable). If PTYS.ext_eth_proto_capability is valid (has a non-zero value) conclude that the HCA supports 50G per lane. Otherwise, conclude that the HCA doesn't support 50G per lane. Fixes: a08b4ed1373d ("net/mlx5: Add support to ext_* fields introduced in Port Type and Speed register") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit f4aebbfb56ed0c186adbeb2799df836da50f78e3 Author: Aya Levin Date: Wed May 20 10:37:42 2020 +0300 net/mlx5e: Fix CPU mapping after function reload to avoid aRFS RX crash After function reload, CPU mapping used by aRFS RX is broken, leading to a kernel panic. Fix by moving initialization of rx_cpu_rmap from netdev_init to netdev_attach. IRQ table is re-allocated on mlx5_load, but netdev is not re-initialize. Trace of the panic: [ 22.055672] general protection fault, probably for non-canonical address 0x785634120000ff1c: 0000 [#1] SMP PTI [ 22.065010] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 5.7.0-rc2-for-upstream-perf-2020-04-21_16-34-03-31 #1 [ 22.067967] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [ 22.071174] RIP: 0010:get_rps_cpu+0x267/0x300 [ 22.075692] RSP: 0018:ffffc90000244d60 EFLAGS: 00010202 [ 22.076888] RAX: ffff888459b0e400 RBX: 0000000000000000 RCX:0000000000000007 [ 22.078364] RDX: 0000000000008884 RSI: ffff888467cb5b00 RDI:0000000000000000 [ 22.079815] RBP: 00000000ff342b27 R08: 0000000000000007 R09:0000000000000003 [ 22.081289] R10: ffffffffffffffff R11: 00000000000070cc R12:ffff888454900000 [ 22.082767] R13: ffffc90000e5a950 R14: ffffc90000244dc0 R15:0000000000000007 [ 22.084190] FS: 0000000000000000(0000) GS:ffff88846fc80000(0000)knlGS:0000000000000000 [ 22.086161] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 22.087427] CR2: ffffffffffffffff CR3: 0000000464426003 CR4:0000000000760ee0 [ 22.088888] DR0: 0000000000000000 DR1: 0000000000000000 DR2:0000000000000000 [ 22.090336] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:0000000000000400 [ 22.091764] PKRU: 55555554 [ 22.092618] Call Trace: [ 22.093442] [ 22.094211] ? kvm_clock_get_cycles+0xd/0x10 [ 22.095272] netif_receive_skb_list_internal+0x258/0x2a0 [ 22.096460] gro_normal_list.part.137+0x19/0x40 [ 22.097547] napi_complete_done+0xc6/0x110 [ 22.098685] mlx5e_napi_poll+0x190/0x670 [mlx5_core] [ 22.099859] net_rx_action+0x2a0/0x400 [ 22.100848] __do_softirq+0xd8/0x2a8 [ 22.101829] irq_exit+0xa5/0xb0 [ 22.102750] do_IRQ+0x52/0xd0 [ 22.103654] common_interrupt+0xf/0xf [ 22.104641] Fixes: 4383cfcc65e7 ("net/mlx5: Add devlink reload") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit b3c2ed21c0bdf35ba498a9974aa587f99a03b658 Author: Aya Levin Date: Wed Jun 24 19:04:03 2020 +0300 net/mlx5e: Fix VXLAN configuration restore after function reload When detaching netdev, remove vxlan port configuration using udp_tunnel_drop_rx_info. During function reload, configuration will be restored using udp_tunnel_get_rx_info. This ensures sync between firmware and driver. Use udp_tunnel_get_rx_info even if its physical interface is down. Fixes: 4383cfcc65e7 ("net/mlx5: Add devlink reload") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit c1aea9e1765a047c7397da30f52315c43e3501fb Author: Vlad Buslov Date: Wed Jun 17 17:51:53 2020 +0300 net/mlx5e: Fix usage of rcu-protected pointer In mlx5e_configure_flower() flow pointer is protected by rcu read lock. However, after cited commit the pointer is being used outside of rcu read block. Extend the block to protect all pointer accesses. Fixes: 553f9328385d ("net/mlx5e: Support tc block sharing for representors") Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 2fb15e72c0d7fc5fb05aefd3a7f0d70cf39d3ad4 Author: Vlad Buslov Date: Wed Jun 17 17:26:33 2020 +0300 net/mxl5e: Verify that rpriv is not NULL In helper function is_flow_rule_duplicate_allowed() verify that rpviv pointer is not NULL before dereferencing it. This can happen when device is in NIC mode and leads to following crash: [90444.046419] BUG: kernel NULL pointer dereference, address: 0000000000000000 [90444.048149] #PF: supervisor read access in kernel mode [90444.049781] #PF: error_code(0x0000) - not-present page [90444.051386] PGD 80000003d35a4067 P4D 80000003d35a4067 PUD 3d35a3067 PMD 0 [90444.053051] Oops: 0000 [#1] SMP PTI [90444.054683] CPU: 16 PID: 31736 Comm: tc Not tainted 5.8.0-rc1+ #1157 [90444.056340] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017 [90444.058079] RIP: 0010:mlx5e_configure_flower+0x3aa/0x9b0 [mlx5_core] [90444.059753] Code: 24 50 49 8b 95 08 02 00 00 48 b8 00 08 00 00 04 00 00 00 48 21 c2 48 39 c2 74 0a 41 f6 85 0d 02 00 00 20 74 16 48 8b 44 24 20 <48> 8b 00 66 83 78 20 ff 74 07 4d 89 aa e0 00 00 00 48 83 7d 28 00 [90444.063232] RSP: 0018:ffffabe9c61ff768 EFLAGS: 00010246 [90444.065014] RAX: 0000000000000000 RBX: ffff9b13c4c91e80 RCX: 00000000000093fa [90444.066784] RDX: 0000000400000800 RSI: 0000000000000000 RDI: 000000000002d5e0 [90444.068533] RBP: ffff9b174d308468 R08: 0000000000000000 R09: ffff9b17d63003f0 [90444.070285] R10: ffff9b17ea288600 R11: 0000000000000000 R12: ffffabe9c61ff878 [90444.072032] R13: ffff9b174d300000 R14: ffffabe9c61ffbb8 R15: ffff9b174d300880 [90444.073760] FS: 00007f3c23775480(0000) GS:ffff9b13efc80000(0000) knlGS:0000000000000000 [90444.075492] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [90444.077266] CR2: 0000000000000000 CR3: 00000003e2a60002 CR4: 00000000001606e0 [90444.079024] Call Trace: [90444.080753] tc_setup_cb_add+0xca/0x1e0 [90444.082415] fl_hw_replace_filter+0x15f/0x1f0 [cls_flower] [90444.084119] fl_change+0xa59/0x13dc [cls_flower] [90444.085772] ? wait_for_completion+0xa8/0xf0 [90444.087364] tc_new_tfilter+0x3f5/0xa60 [90444.088960] rtnetlink_rcv_msg+0xeb/0x360 [90444.090514] ? __d_lookup_done+0x76/0xe0 [90444.092034] ? proc_alloc_inode+0x16/0x70 [90444.093560] ? prep_new_page+0x8c/0xf0 [90444.095048] ? _cond_resched+0x15/0x30 [90444.096483] ? rtnl_calcit.isra.0+0x110/0x110 [90444.097907] netlink_rcv_skb+0x49/0x110 [90444.099289] netlink_unicast+0x191/0x230 [90444.100629] netlink_sendmsg+0x243/0x480 [90444.101984] sock_sendmsg+0x5e/0x60 [90444.103305] ____sys_sendmsg+0x1f3/0x260 [90444.104597] ? copy_msghdr_from_user+0x5c/0x90 [90444.105916] ? __mod_lruvec_state+0x3c/0xe0 [90444.107210] ___sys_sendmsg+0x81/0xc0 [90444.108484] ? do_filp_open+0xa5/0x100 [90444.109732] ? handle_mm_fault+0x117b/0x1e00 [90444.110970] ? __check_object_size+0x46/0x147 [90444.112205] ? __check_object_size+0x136/0x147 [90444.113402] __sys_sendmsg+0x59/0xa0 [90444.114587] do_syscall_64+0x4d/0x90 [90444.115782] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [90444.116953] RIP: 0033:0x7f3c2393b7b8 [90444.118101] Code: Bad RIP value. [90444.119240] RSP: 002b:00007ffc6ad8e6c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [90444.120408] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3c2393b7b8 [90444.121583] RDX: 0000000000000000 RSI: 00007ffc6ad8e740 RDI: 0000000000000003 [90444.122750] RBP: 000000005eea0c3a R08: 0000000000000001 R09: 00007ffc6ad8e68c [90444.123928] R10: 0000000000404fa8 R11: 0000000000000246 R12: 0000000000000001 [90444.125073] R13: 0000000000000000 R14: 00007ffc6ad92a00 R15: 00000000004866a0 [90444.126221] Modules linked in: act_skbedit act_tunnel_key act_mirred bonding vxlan ip6_udp_tunnel udp_tunnel nfnetlink act_gact cls_flower sch_ingress openvswitch nsh nf_conncount nfsv3 nfs_acl nfs lockd grace fscache tun bridge stp llc sunrpc rdma_ucm rdma_cm iw_cm ib_cm mlx5_ib ib_uverbs ib_core mlx5_core intel_r apl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel mlxfw kvm act_ct nf_flow_table nf_nat nf_conntrack irqbypass crct10dif_pclmul nf_defrag_ipv6 igb ipmi_ssif libcrc32c crc32_pclmul crc32c_intel ipmi_si nf_defrag_ipv4 ptp ghash_clmulni_intel mei_me ses iTCO_wdt i2c_i801 pps_core ioatdma iTCO_vendor_support joydev mei enclosure intel_cstate i2c_smbus wmi dca ipmi_devintf intel_uncore lpc_ich ipmi_msghandler pcspkr acpi_pad acpi_power_meter ast i2c_algo_bit drm_vram_helper drm_kms_helper drm_ttm_helper ttm drm mpt3sas raid_class scsi_transport_sas [90444.136253] CR2: 0000000000000000 [90444.137621] ---[ end trace 924af62aa2b151bd ]--- Fixes: 553f9328385d ("net/mlx5e: Support tc block sharing for representors") Reported-by: David Ahern Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 01f3d5db4a9add67f53630a7f71664538b3b9783 Author: Vu Pham Date: Wed Jun 17 15:11:24 2020 -0700 net/mlx5: E-Switch, Fix vlan or qos setting in legacy mode Refactoring eswitch ingress acl codes accidentally inserts extra memset zero that removes vlan and/or qos setting in legacy mode. Fixes: 07bab9502641 ("net/mlx5: E-Switch, Refactor eswitch ingress acl codes") Signed-off-by: Vu Pham Signed-off-by: Saeed Mahameed commit 47afbdd2fa4c5775c383ba376a3d1da7d7f694dc Author: Eran Ben Elisha Date: Sun Jun 14 17:31:26 2020 +0300 net/mlx5: Fix eeprom support for SFP module Fix eeprom SFP query support by setting i2c_addr, offset and page number correctly. Unlike QSFP modules, SFP eeprom params are as follow: - i2c_addr is 0x50 for offset 0 - 255 and 0x51 for offset 256 - 511. - Page number is always zero. - Page offset is always relative to zero. As part of eeprom query, query the module ID (SFP / QSFP*) via helper function to set the params accordingly. In addition, change mlx5_qsfp_eeprom_page() input type to be u16 to avoid unnecessary casting. Fixes: a708fb7b1f8d ("net/mlx5e: ethtool, Add support for EEPROM high pages query") Signed-off-by: Eran Ben Elisha Signed-off-by: Huy Nguyen Signed-off-by: Saeed Mahameed commit 42f82040ee66db13525dc6f14b8559890b2f4c1c Merge: d4e60453266b 38794a5465b7 Author: Linus Torvalds Date: Thu Jul 9 18:20:19 2020 -0700 Merge tag 'drm-fixes-2020-07-10' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "I've been off most of the week, but some fixes have piled up. Seems a bit busier than last week, but they are pretty spread out across a bunch of drivers, none of them seem that big or worried me too much. amdgpu: - Fix a suspend/resume issue with PSP - Backlight fix for Renoir - Fix for gpu recovery debugging radeon: - Fix a double free in error path i915: - fbc fencing fix - debugfs panic fix - gem vma constuction fix - gem pin under vm->nutex fix nouveau: - SVM fixes - display fixes meson: - OSD burst length fixes hibmc: - runtime warning fix mediatek: - cmdq, mmsys fixes - visibility check fixes" * tag 'drm-fixes-2020-07-10' of git://anongit.freedesktop.org/drm/drm: (24 commits) drm/amdgpu: don't do soft recovery if gpu_recovery=0 drm/radeon: fix double free drm/amd/display: add dmcub check on RENOIR drm/amdgpu: add TMR destory function for psp drm/amdgpu: asd function needs to be unloaded in suspend phase drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat drm/nouveau/nouveau: fix page fault on device private memory drm/nouveau/svm: fix migrate page regression drm/nouveau/i2c/g94-: increase NV_PMGR_DP_AUXCTL_TRANSACTREQ timeout drm/nouveau/kms/nv50-: bail from nv50_audio_disable() early if audio not enabled drm/i915/gt: Pin the rings before marking active drm/i915: Also drop vm.ref along error paths for vma construction drm/i915: Drop vm.ref for duplicate vma on construction drm/i915/fbc: Fix fence_y_offset handling drm/i915: Skip stale object handle for debugfs per-file-stats drm/mediatek: mtk_hdmi: Remove debug messages for function calls drm/mediatek: mtk_mt8173_hdmi_phy: Remove unnused const variables drm/mediatek: Delete not used of_device_get_match_data drm/mediatek: Remove unnecessary conversion to bool drm/meson: viu: fix setting the OSD burst length in VIU_OSD1_FIFO_CTRL_STAT ... commit d4e60453266b95b9dc19e0af2a819617e556bc4e Author: Cesar Eduardo Barros Date: Thu Jul 9 19:11:02 2020 -0300 Restore gcc check in mips asm/unroll.h While raising the gcc version requirement to 4.9, the compile-time check in the unroll macro was accidentally changed from being used on gcc and clang to being used on clang only. Restore the gcc check, changing it from "gcc >= 4.7" to "all gcc". [ We should probably remove this all entirely: if we remove the check for CLANG, then the check for GCC can go away. Older versions of clang are not really appropriate or supported for kernel builds - Linus ] Fixes: 6ec4476ac825 ("Raise gcc version requirement to 4.9") Signed-off-by: Cesar Eduardo Barros Signed-off-by: Linus Torvalds commit 355a3587d4ca09f2b1014778a7c8908351a91468 Author: Rikard Falkeborn Date: Wed Jul 8 21:07:56 2020 +0200 kbuild: Move -Wtype-limits to W=2 -Wtype-limits is included in -Wextra which is added at W=1. It warns (among other things) that 'comparison of an unsigned variable `< 0` is always false. This causes noisy warnings, especially when used in macros, hence it is more suitable for W=2. Link: https://lore.kernel.org/lkml/CAHk-=wiKCXEWKJ9dWUimGbrVRo_N2RosESUw8E7m9AEtyZcu=w@mail.gmail.com/ Signed-off-by: Rikard Falkeborn Suggested-by: Arnd Bergmann Acked-by: Andy Shevchenko Signed-off-by: Linus Torvalds commit 14b032b8f8fce03a546dcf365454bec8c4a58d7d Author: Cong Wang Date: Thu Jul 9 16:28:44 2020 -0700 cgroup: Fix sock_cgroup_data on big-endian. In order for no_refcnt and is_data to be the lowest order two bits in the 'val' we have to pad out the bitfield of the u8. Fixes: ad0f75e5f57c ("cgroup: fix cgroup_sk_alloc() for sk_clone_lock()") Reported-by: Guenter Roeck Signed-off-by: David S. Miller commit f43cb0d672aa8eb09bfdb779de5900c040487d1d Author: Lorenz Bauer Date: Thu Jul 9 12:51:51 2020 +0100 selftests: bpf: Fix detach from sockmap tests Fix sockmap tests which rely on old bpf_prog_dispatch behaviour. In the first case, the tests check that detaching without giving a program succeeds. Since these are not the desired semantics, invert the condition. In the second case, the clean up code doesn't supply the necessary program fds. Fixes: bb0de3131f4c ("bpf: sockmap: Require attach_bpf_fd when detaching a program") Reported-by: Martin KaFai Lau Signed-off-by: Lorenz Bauer Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20200709115151.75829-1-lmb@cloudflare.com commit 38794a5465b752118098e36cf95c59083f9f1f88 Merge: 1328af842d70 f4892c327a8e Author: Dave Airlie Date: Fri Jul 10 07:02:02 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-07-09' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-07-09: amdgpu: - Fix a suspend/resume issue with PSP - Backlight fix for Renoir - Fix for gpu recovery debugging radeon: - Fix a double free in error path Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200709185221.44895-1-alexander.deucher@amd.com commit 1328af842d703d6d7ae6bfc7b2218abb1781eafc Merge: 76cfab9c8cad 5a383d443b29 Author: Dave Airlie Date: Fri Jul 10 07:01:24 2020 +1000 Merge tag 'drm-intel-fixes-2020-07-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes One display's fbc patch fixing fence_y_offset calculation from Ville and 4 patches from Chris on GEM: 1 fixing a debugfs panic and others fixing vma construction and pin under vm->mutex. Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20200708190654.GA3924867@intel.com commit 76cfab9c8cad1cbd1ac9590afcd9235a2d3851d2 Merge: a088eb0faf4f ed710a6ed797 Author: Dave Airlie Date: Fri Jul 10 06:59:05 2020 +1000 Merge branch 'linux-5.8' of git://github.com/skeggsb/linux into drm-fixes - SVM fixes - display fixes Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/ Date: Fri Jul 10 06:46:47 2020 +1000 Merge tag 'drm-misc-fixes-2020-07-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * meson: OSD burst-length fixes * hibmc: fix runtime warning by setting up generic fbdev after registering device Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200708121050.GA29420@linux-uq9g commit 46a20c9aaab37d6a4afd7ae6fa49259d7a6c8665 Merge: dcb7fd82c75e 5ab546f5e630 Author: Dave Airlie Date: Fri Jul 10 06:43:31 2020 +1000 Merge tag 'mediatek-drm-fixes-5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes Mediatek DRM Fixes for Linux 5.8 This include fixup for cmdq, mmsys, visibility checking and some refinement. Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20200707153944.604-1-chunkuang.hu@kernel.org commit 2a89b99f580371b86ae9bafd6cbeccd3bfab524a Merge: ce69fb3b392f 6958c1c640af Author: Linus Torvalds Date: Thu Jul 9 13:14:51 2020 -0700 Merge tag 'for-5.8/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - A request-based DM fix to not use a waitqueue to wait for blk-mq IO completion because doing so is racey. - A couple more DM zoned target fixes to address issues introduced during the 5.8 cycle. - A DM core fix to use proper interface to cleanup DM's static flush bio. - A DM core fix to prevent mm recursion during memory allocation needed by dm_kobject_uevent. * tag 'for-5.8/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: use noio when sending kobject event dm zoned: Fix zone reclaim trigger dm zoned: fix unused but set variable warnings dm writecache: reject asynchronous pmem devices dm: use bio_uninit instead of bio_disassociate_blkg dm: do not use waitqueue for request-based DM commit ce69fb3b392fbfd6c255aeb0ee371652478c716f Merge: 0bddd227f3dc 2c79583927bb Author: Linus Torvalds Date: Thu Jul 9 13:09:30 2020 -0700 Merge tag 'kallsyms_show_value-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kallsyms fix from Kees Cook: "Refactor kallsyms_show_value() users for correct cred. I'm not delighted by the timing of getting these changes to you, but it does fix a handful of kernel address exposures, and no one has screamed yet at the patches. Several users of kallsyms_show_value() were performing checks not during "open". Refactor everything needed to gain proper checks against file->f_cred for modules, kprobes, and bpf" * tag 'kallsyms_show_value-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: selftests: kmod: Add module address visibility test bpf: Check correct cred for CAP_SYSLOG in bpf_dump_raw_ok() kprobes: Do not expose probe addresses to non-CAP_SYSLOG module: Do not expose section addresses to non-CAP_SYSLOG module: Refactor section attr into bin attribute kallsyms: Refactor kallsyms_show_value() to take cred commit ce69e563b325f620863830c246a8698ccea52048 Author: Christoph Paasch Date: Wed Jul 8 16:18:34 2020 -0700 tcp: make sure listeners don't initialize congestion-control state syzkaller found its way into setsockopt with TCP_CONGESTION "cdg". tcp_cdg_init() does a kcalloc to store the gradients. As sk_clone_lock just copies all the memory, the allocated pointer will be copied as well, if the app called setsockopt(..., TCP_CONGESTION) on the listener. If now the socket will be destroyed before the congestion-control has properly been initialized (through a call to tcp_init_transfer), we will end up freeing memory that does not belong to that particular socket, opening the door to a double-free: [ 11.413102] ================================================================== [ 11.414181] BUG: KASAN: double-free or invalid-free in tcp_cleanup_congestion_control+0x58/0xd0 [ 11.415329] [ 11.415560] CPU: 3 PID: 4884 Comm: syz-executor.5 Not tainted 5.8.0-rc2 #80 [ 11.416544] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [ 11.418148] Call Trace: [ 11.418534] [ 11.418834] dump_stack+0x7d/0xb0 [ 11.419297] print_address_description.constprop.0+0x1a/0x210 [ 11.422079] kasan_report_invalid_free+0x51/0x80 [ 11.423433] __kasan_slab_free+0x15e/0x170 [ 11.424761] kfree+0x8c/0x230 [ 11.425157] tcp_cleanup_congestion_control+0x58/0xd0 [ 11.425872] tcp_v4_destroy_sock+0x57/0x5a0 [ 11.426493] inet_csk_destroy_sock+0x153/0x2c0 [ 11.427093] tcp_v4_syn_recv_sock+0xb29/0x1100 [ 11.427731] tcp_get_cookie_sock+0xc3/0x4a0 [ 11.429457] cookie_v4_check+0x13d0/0x2500 [ 11.433189] tcp_v4_do_rcv+0x60e/0x780 [ 11.433727] tcp_v4_rcv+0x2869/0x2e10 [ 11.437143] ip_protocol_deliver_rcu+0x23/0x190 [ 11.437810] ip_local_deliver+0x294/0x350 [ 11.439566] __netif_receive_skb_one_core+0x15d/0x1a0 [ 11.441995] process_backlog+0x1b1/0x6b0 [ 11.443148] net_rx_action+0x37e/0xc40 [ 11.445361] __do_softirq+0x18c/0x61a [ 11.445881] asm_call_on_stack+0x12/0x20 [ 11.446409] [ 11.446716] do_softirq_own_stack+0x34/0x40 [ 11.447259] do_softirq.part.0+0x26/0x30 [ 11.447827] __local_bh_enable_ip+0x46/0x50 [ 11.448406] ip_finish_output2+0x60f/0x1bc0 [ 11.450109] __ip_queue_xmit+0x71c/0x1b60 [ 11.451861] __tcp_transmit_skb+0x1727/0x3bb0 [ 11.453789] tcp_rcv_state_process+0x3070/0x4d3a [ 11.456810] tcp_v4_do_rcv+0x2ad/0x780 [ 11.457995] __release_sock+0x14b/0x2c0 [ 11.458529] release_sock+0x4a/0x170 [ 11.459005] __inet_stream_connect+0x467/0xc80 [ 11.461435] inet_stream_connect+0x4e/0xa0 [ 11.462043] __sys_connect+0x204/0x270 [ 11.465515] __x64_sys_connect+0x6a/0xb0 [ 11.466088] do_syscall_64+0x3e/0x70 [ 11.466617] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 11.467341] RIP: 0033:0x7f56046dc469 [ 11.467844] Code: Bad RIP value. [ 11.468282] RSP: 002b:00007f5604dccdd8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a [ 11.469326] RAX: ffffffffffffffda RBX: 000000000068bf00 RCX: 00007f56046dc469 [ 11.470379] RDX: 0000000000000010 RSI: 0000000020000000 RDI: 0000000000000004 [ 11.471311] RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000 [ 11.472286] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 11.473341] R13: 000000000041427c R14: 00007f5604dcd5c0 R15: 0000000000000003 [ 11.474321] [ 11.474527] Allocated by task 4884: [ 11.475031] save_stack+0x1b/0x40 [ 11.475548] __kasan_kmalloc.constprop.0+0xc2/0xd0 [ 11.476182] tcp_cdg_init+0xf0/0x150 [ 11.476744] tcp_init_congestion_control+0x9b/0x3a0 [ 11.477435] tcp_set_congestion_control+0x270/0x32f [ 11.478088] do_tcp_setsockopt.isra.0+0x521/0x1a00 [ 11.478744] __sys_setsockopt+0xff/0x1e0 [ 11.479259] __x64_sys_setsockopt+0xb5/0x150 [ 11.479895] do_syscall_64+0x3e/0x70 [ 11.480395] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 11.481097] [ 11.481321] Freed by task 4872: [ 11.481783] save_stack+0x1b/0x40 [ 11.482230] __kasan_slab_free+0x12c/0x170 [ 11.482839] kfree+0x8c/0x230 [ 11.483240] tcp_cleanup_congestion_control+0x58/0xd0 [ 11.483948] tcp_v4_destroy_sock+0x57/0x5a0 [ 11.484502] inet_csk_destroy_sock+0x153/0x2c0 [ 11.485144] tcp_close+0x932/0xfe0 [ 11.485642] inet_release+0xc1/0x1c0 [ 11.486131] __sock_release+0xc0/0x270 [ 11.486697] sock_close+0xc/0x10 [ 11.487145] __fput+0x277/0x780 [ 11.487632] task_work_run+0xeb/0x180 [ 11.488118] __prepare_exit_to_usermode+0x15a/0x160 [ 11.488834] do_syscall_64+0x4a/0x70 [ 11.489326] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Wei Wang fixed a part of these CDG-malloc issues with commit c12014440750 ("tcp: memset ca_priv data to 0 properly"). This patch here fixes the listener-scenario: We make sure that listeners setting the congestion-control through setsockopt won't initialize it (thus CDG never allocates on listeners). For those who use AF_UNSPEC to reuse a socket, tcp_disconnect() is changed to cleanup afterwards. (The issue can be reproduced at least down to v4.4.x.) Cc: Wei Wang Cc: Eric Dumazet Fixes: 2b0a8c9eee81 ("tcp: add CDG congestion control") Signed-off-by: Christoph Paasch Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c9a368f1c0fbe2e3a21ebf231caeae58b18b2681 Author: Martin KaFai Lau Date: Wed Jul 8 23:11:10 2020 -0700 bpf: net: Avoid incorrect bpf_sk_reuseport_detach call bpf_sk_reuseport_detach is currently called when sk->sk_user_data is not NULL. It is incorrect because sk->sk_user_data may not be managed by the bpf's reuseport_array. It has been reported in [1] that, the bpf_sk_reuseport_detach() which is called from udp_lib_unhash() has corrupted the sk_user_data managed by l2tp. This patch solves it by using another bit (defined as SK_USER_DATA_BPF) of the sk_user_data pointer value. It marks that a sk_user_data is managed/owned by BPF. The patch depends on a PTRMASK introduced in commit f1ff5ce2cd5e ("net, sk_msg: Clear sk_user_data pointer on clone if tagged"). [ Note: sk->sk_user_data is used by bpf's reuseport_array only when a sk is added to the bpf's reuseport_array. i.e. doing setsockopt(SO_REUSEPORT) and having "sk->sk_reuseport == 1" alone will not stop sk->sk_user_data being used by other means. ] [1]: https://lore.kernel.org/netdev/20200706121259.GA20199@katalix.com/ Fixes: 5dc4c4b7d4e8 ("bpf: Introduce BPF_MAP_TYPE_REUSEPORT_SOCKARRAY") Reported-by: James Chapman Reported-by: syzbot+9f092552ba9a5efca5df@syzkaller.appspotmail.com Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Tested-by: James Chapman Acked-by: James Chapman Link: https://lore.kernel.org/bpf/20200709061110.4019316-1-kafai@fb.com commit f3dda7a679df183e798b86e7b6ec05ab35476de3 Author: Martin KaFai Lau Date: Wed Jul 8 23:11:04 2020 -0700 bpf: net: Avoid copying sk_user_data of reuseport_array during sk_clone It makes little sense for copying sk_user_data of reuseport_array during sk_clone_lock(). This patch reuses the SK_USER_DATA_NOCOPY bit introduced in commit f1ff5ce2cd5e ("net, sk_msg: Clear sk_user_data pointer on clone if tagged"). It is used to mark the sk_user_data is not supposed to be copied to its clone. Although the cloned sk's sk_user_data will not be used/freed in bpf_sk_reuseport_detach(), this change can still allow the cloned sk's sk_user_data to be used by some other means. Freeing the reuseport_array's sk_user_data does not require a rcu grace period. Thus, the existing rcu_assign_sk_user_data_nocopy() is not used. Fixes: 5dc4c4b7d4e8 ("bpf: Introduce BPF_MAP_TYPE_REUSEPORT_SOCKARRAY") Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20200709061104.4018798-1-kafai@fb.com commit 365f9ae4ee36037e2a9268fe7296065356840b4c Author: Michal Kubecek Date: Thu Jul 9 12:11:50 2020 +0200 ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit() If the genlmsg_put() call in ethnl_default_dumpit() fails, we bail out without checking if we already have some messages in current skb like we do with ethnl_default_dump_one() failure later. Therefore if existing messages almost fill up the buffer so that there is not enough space even for netlink and genetlink header, we lose all prepared messages and return and error. Rather than duplicating the skb->len check, move the genlmsg_put(), genlmsg_cancel() and genlmsg_end() calls into ethnl_default_dump_one(). This is also more logical as all message composition will be in ethnl_default_dump_one() and only iteration logic will be left in ethnl_default_dumpit(). Fixes: 728480f12442 ("ethtool: default handlers for GET requests") Reported-by: Jakub Kicinski Signed-off-by: Michal Kubecek Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 306381aec7c2b5a658eebca008c8a1b666536cba Author: Cong Wang Date: Wed Jul 8 20:13:59 2020 -0700 net_sched: fix a memory leak in atm_tc_init() When tcf_block_get() fails inside atm_tc_init(), atm_tc_put() is called to release the qdisc p->link.q. But the flow->ref prevents it to do so, as the flow->ref is still zero. Fix this by moving the p->link.ref initialization before tcf_block_get(). Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure") Reported-and-tested-by: syzbot+d411cff6ab29cc2c311b@syzkaller.appspotmail.com Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 13cf8aab7425a253070433b5a55b4209ceac8b19 Author: Sudarsana Reddy Kalluru Date: Wed Jul 8 20:14:29 2020 -0700 qed: Populate nvm-file attributes while reading nvm config partition. NVM config file address will be modified when the MBI image is upgraded. Driver would return stale config values if user reads the nvm-config (via ethtool -d) in this state. The fix is to re-populate nvm attribute info while reading the nvm config values/partition. Changes from previous version: ------------------------------- v3: Corrected the formatting in 'Fixes' tag. v2: Added 'Fixes' tag. Fixes: 1ac4329a1cff ("qed: Add configuration information to register dump and debug data") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 12eb3ad0638c2a6af72de866e9d7837de16ee82f Author: Shuming Fan Date: Thu Jul 9 18:13:45 2020 +0800 ASoC: rt286: fix unexpected interrupt happens The HV/VREF should not turn off if the headphone jack plug-in. This patch could solve the unexpected interrupt issue in some devices. Signed-off-by: Shuming Fan Tested-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200709101345.11449-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 01283d56f0ea0040b64dc785542f3ad3fb8b3e68 Author: Puyou Lu Date: Thu Jul 2 10:30:56 2020 +0800 ASoC: wm8974: remove unsupported clock mode In DSP_A mode, BIT7 of IFACE should bit 0 according to datasheet (ie. inverted frame clock is not support in this mode). Signed-off-by: Puyou Lu Acked-by: Charles Keepax Link: https://lore.kernel.org/r/1593657056-4989-1-git-send-email-puyou.lu@gmail.com Signed-off-by: Mark Brown commit 574ea5c80eb18edd0d93864985650efec63347c0 Author: Puyou Lu Date: Thu Jul 2 10:30:25 2020 +0800 ASoC: wm8974: fix Boost Mixer Aux Switch Clear BIT6 of INPPGA means not muted (Switch On). Signed-off-by: Puyou Lu Acked-by: Charles Keepax Link: https://lore.kernel.org/r/1593657025-4903-1-git-send-email-puyou.lu@gmail.com Signed-off-by: Mark Brown commit f4892c327a8e5df7ce16cab40897daf90baf6bec Author: Marek Olšák Date: Mon Jul 6 18:23:17 2020 -0400 drm/amdgpu: don't do soft recovery if gpu_recovery=0 It's impossible to debug shader hangs with soft recovery. Signed-off-by: Marek Olšák Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 41855a898650803e24b284173354cc3e44d07725 Author: Tom Rix Date: Mon Jul 6 05:28:57 2020 -0700 drm/radeon: fix double free clang static analysis flags this error drivers/gpu/drm/radeon/ci_dpm.c:5652:9: warning: Use of memory after it is freed [unix.Malloc] kfree(rdev->pm.dpm.ps[i].ps_priv); ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/ci_dpm.c:5654:2: warning: Attempt to free released memory [unix.Malloc] kfree(rdev->pm.dpm.ps); ^~~~~~~~~~~~~~~~~~~~~~ problem is reported in ci_dpm_fini, with these code blocks. for (i = 0; i < rdev->pm.dpm.num_ps; i++) { kfree(rdev->pm.dpm.ps[i].ps_priv); } kfree(rdev->pm.dpm.ps); The first free happens in ci_parse_power_table where it cleans up locally on a failure. ci_dpm_fini also does a cleanup. ret = ci_parse_power_table(rdev); if (ret) { ci_dpm_fini(rdev); return ret; } So remove the cleanup in ci_parse_power_table and move the num_ps calculation to inside the loop so ci_dpm_fini will know how many array elements to free. Fixes: cc8dbbb4f62a ("drm/radeon: add dpm support for CI dGPUs (v2)") Signed-off-by: Tom Rix Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 3b2e973dff59d88bee1d814ddf8762a24fc02b60 Author: Aaron Ma Date: Wed Jul 8 04:16:22 2020 -0400 drm/amd/display: add dmcub check on RENOIR RENOIR loads dmub fw not dmcu, check dmcu only will prevent loading iram, it breaks backlight control. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=208277 Acked-by: Alex Deucher Reviewed-by: Nicholas Kazlauskas Signed-off-by: Aaron Ma Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c564b8601ae917086751d90f464d5f19d731ece7 Author: Huang Rui Date: Tue Jun 30 12:32:57 2020 +0800 drm/amdgpu: add TMR destory function for psp TMR is required to be destoried with GFX_CMD_ID_DESTROY_TMR while the system goes to suspend. Otherwise, PSP may return the failure state (0xFFFF007) on Gfx-2-PSP command GFX_CMD_ID_SETUP_TMR after do multiple times suspend/resume. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 20303ec5d2165ee6344190274bc59118921f71d9 Author: Huang Rui Date: Tue Jun 30 10:43:21 2020 +0800 drm/amdgpu: asd function needs to be unloaded in suspend phase Unload ASD function in suspend phase. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d77765911385b65fc82d74ab71b8983cddfe0b58 Author: Christoph Hellwig Date: Thu Jul 9 18:22:06 2020 +0200 btrfs: wire up iter_file_splice_write btrfs implements the iter_write op and thus can use the more efficient iov_iter based splice implementation. For now falling back to the less efficient default is pretty harmless, but I have a pending series that removes the default, and thus would cause btrfs to not support splice at all. Reported-by: Andy Lavr Tested-by: Andy Lavr Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 230ed397435e85b54f055c524fcb267ae2ce3bc4 Author: Josef Bacik Date: Mon Jul 6 09:14:12 2020 -0400 btrfs: fix double put of block group with nocow While debugging a patch that I wrote I was hitting use-after-free panics when accessing block groups on unmount. This turned out to be because in the nocow case if we bail out of doing the nocow for whatever reason we need to call btrfs_dec_nocow_writers() if we called the inc. This puts our block group, but a few error cases does if (nocow) { btrfs_dec_nocow_writers(); goto error; } unfortunately, error is error: if (nocow) btrfs_dec_nocow_writers(); so we get a double put on our block group. Fix this by dropping the error cases calling of btrfs_dec_nocow_writers(), as it's handled at the error label now. Fixes: 762bf09893b4 ("btrfs: improve error handling in run_delalloc_nocow") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a082121b55bac125f7d09d78de00607ea75a6903 Author: Jordan Crouse Date: Thu Jun 4 14:39:04 2020 -0600 iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused When CONFIG_OF=n of_match_device() gets pre-processed out of existence leaving qcom-smmu_client_of_match unused. Mark it as possibly unused to keep the compiler from warning in that case. Fixes: 0e764a01015d ("iommu/arm-smmu: Allow client devices to select direct mapping") Reported-by: kbuild test robot Signed-off-by: Jordan Crouse Acked-by: Will Deacon Link: https://lore.kernel.org/r/20200604203905.31964-1-jcrouse@codeaurora.org Signed-off-by: Joerg Roedel commit 9ac8545199a1b711f5643f535b82981faa0b4bf1 Author: Qian Cai Date: Fri Jul 3 20:10:03 2020 -0400 iommu: Fix use-after-free in iommu_release_device In pci_disable_sriov(), i.e., # echo 0 > /sys/class/net/enp11s0f1np1/device/sriov_numvfs iommu_release_device iommu_group_remove_device arm_smmu_domain_free kfree(smmu_domain) Later, iommu_release_device arm_smmu_release_device arm_smmu_detach_dev spin_lock_irqsave(&smmu_domain->devices_lock, would trigger an use-after-free. Fixed it by call arm_smmu_release_device() first before iommu_group_remove_device(). BUG: KASAN: use-after-free in __lock_acquire+0x3458/0x4440 __lock_acquire at kernel/locking/lockdep.c:4250 Read of size 8 at addr ffff0089df1a6f68 by task bash/3356 CPU: 5 PID: 3356 Comm: bash Not tainted 5.8.0-rc3-next-20200630 #2 Hardware name: HPE Apollo 70 /C01_APACHE_MB , BIOS L50_5.13_1.11 06/18/2019 Call trace: dump_backtrace+0x0/0x398 show_stack+0x14/0x20 dump_stack+0x140/0x1b8 print_address_description.isra.12+0x54/0x4a8 kasan_report+0x134/0x1b8 __asan_report_load8_noabort+0x2c/0x50 __lock_acquire+0x3458/0x4440 lock_acquire+0x204/0xf10 _raw_spin_lock_irqsave+0xf8/0x180 arm_smmu_detach_dev+0xd8/0x4a0 arm_smmu_detach_dev at drivers/iommu/arm-smmu-v3.c:2776 arm_smmu_release_device+0xb4/0x1c8 arm_smmu_disable_pasid at drivers/iommu/arm-smmu-v3.c:2754 (inlined by) arm_smmu_release_device at drivers/iommu/arm-smmu-v3.c:3000 iommu_release_device+0xc0/0x178 iommu_release_device at drivers/iommu/iommu.c:302 iommu_bus_notifier+0x118/0x160 notifier_call_chain+0xa4/0x128 __blocking_notifier_call_chain+0x70/0xa8 blocking_notifier_call_chain+0x14/0x20 device_del+0x618/0xa00 pci_remove_bus_device+0x108/0x2d8 pci_stop_and_remove_bus_device+0x1c/0x28 pci_iov_remove_virtfn+0x228/0x368 sriov_disable+0x8c/0x348 pci_disable_sriov+0x5c/0x70 mlx5_core_sriov_configure+0xd8/0x260 [mlx5_core] sriov_numvfs_store+0x240/0x318 dev_attr_store+0x38/0x68 sysfs_kf_write+0xdc/0x128 kernfs_fop_write+0x23c/0x448 __vfs_write+0x54/0xe8 vfs_write+0x124/0x3f0 ksys_write+0xe8/0x1b8 __arm64_sys_write+0x68/0x98 do_el0_svc+0x124/0x220 el0_sync_handler+0x260/0x408 el0_sync+0x140/0x180 Allocated by task 3356: save_stack+0x24/0x50 __kasan_kmalloc.isra.13+0xc4/0xe0 kasan_kmalloc+0xc/0x18 kmem_cache_alloc_trace+0x1ec/0x318 arm_smmu_domain_alloc+0x54/0x148 iommu_group_alloc_default_domain+0xc0/0x440 iommu_probe_device+0x1c0/0x308 iort_iommu_configure+0x434/0x518 acpi_dma_configure+0xf0/0x128 pci_dma_configure+0x114/0x160 really_probe+0x124/0x6d8 driver_probe_device+0xc4/0x180 __device_attach_driver+0x184/0x1e8 bus_for_each_drv+0x114/0x1a0 __device_attach+0x19c/0x2a8 device_attach+0x10/0x18 pci_bus_add_device+0x70/0xf8 pci_iov_add_virtfn+0x7b4/0xb40 sriov_enable+0x5c8/0xc30 pci_enable_sriov+0x64/0x80 mlx5_core_sriov_configure+0x58/0x260 [mlx5_core] sriov_numvfs_store+0x1c0/0x318 dev_attr_store+0x38/0x68 sysfs_kf_write+0xdc/0x128 kernfs_fop_write+0x23c/0x448 __vfs_write+0x54/0xe8 vfs_write+0x124/0x3f0 ksys_write+0xe8/0x1b8 __arm64_sys_write+0x68/0x98 do_el0_svc+0x124/0x220 el0_sync_handler+0x260/0x408 el0_sync+0x140/0x180 Freed by task 3356: save_stack+0x24/0x50 __kasan_slab_free+0x124/0x198 kasan_slab_free+0x10/0x18 slab_free_freelist_hook+0x110/0x298 kfree+0x128/0x668 arm_smmu_domain_free+0xf4/0x1a0 iommu_group_release+0xec/0x160 kobject_put+0xf4/0x238 kobject_del+0x110/0x190 kobject_put+0x1e4/0x238 iommu_group_remove_device+0x394/0x938 iommu_release_device+0x9c/0x178 iommu_release_device at drivers/iommu/iommu.c:300 iommu_bus_notifier+0x118/0x160 notifier_call_chain+0xa4/0x128 __blocking_notifier_call_chain+0x70/0xa8 blocking_notifier_call_chain+0x14/0x20 device_del+0x618/0xa00 pci_remove_bus_device+0x108/0x2d8 pci_stop_and_remove_bus_device+0x1c/0x28 pci_iov_remove_virtfn+0x228/0x368 sriov_disable+0x8c/0x348 pci_disable_sriov+0x5c/0x70 mlx5_core_sriov_configure+0xd8/0x260 [mlx5_core] sriov_numvfs_store+0x240/0x318 dev_attr_store+0x38/0x68 sysfs_kf_write+0xdc/0x128 kernfs_fop_write+0x23c/0x448 __vfs_write+0x54/0xe8 vfs_write+0x124/0x3f0 ksys_write+0xe8/0x1b8 __arm64_sys_write+0x68/0x98 do_el0_svc+0x124/0x220 el0_sync_handler+0x260/0x408 el0_sync+0x140/0x180 The buggy address belongs to the object at ffff0089df1a6e00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 360 bytes inside of 512-byte region [ffff0089df1a6e00, ffff0089df1a7000) The buggy address belongs to the page: page:ffffffe02257c680 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0089df1a1400 flags: 0x7ffff800000200(slab) raw: 007ffff800000200 ffffffe02246b8c8 ffffffe02257ff88 ffff000000320680 raw: ffff0089df1a1400 00000000002a000e 00000001ffffffff ffff0089df1a5001 page dumped because: kasan: bad access detected page->mem_cgroup:ffff0089df1a5001 Memory state around the buggy address: ffff0089df1a6e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0089df1a6e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0089df1a6f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0089df1a6f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0089df1a7000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc Fixes: a6a4c7e2c5b8 ("iommu: Add probe_device() and release_device() call-backs") Signed-off-by: Qian Cai Link: https://lore.kernel.org/r/20200704001003.2303-1-cai@lca.pw Signed-off-by: Joerg Roedel commit a8dab63ea623610bb258d93649e30330dd1b7c8b Author: Steve French Date: Tue Jul 7 23:52:07 2020 -0500 cifs: update internal module version number To 2.28 Signed-off-by: Steve French commit a77592a70081edb58a95b9da18fd5a2882a25666 Author: Ronnie Sahlberg Date: Thu Jul 9 20:39:49 2020 +1000 cifs: fix reference leak for tlink Don't leak a reference to tlink during the NOTIFY ioctl Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Aurelien Aptel CC: Stable # v5.6+ commit 6d1d41c075a1a54ba03370e268171fec20e06563 Author: Chu Lin Date: Thu Jul 9 04:06:12 2020 +0000 hwmon: (adm1275) Make sure we are reading enough data for different chips Issue: When PEC is enabled, binding adm1272 to the adm1275 would fail due to PEC error. See below: adm1275: probe of xxxx failed with error -74 Diagnosis: Per the datasheet of adm1272, adm1278, adm1293 and amd1294, PMON_CONFIG (0xd4) is 16bits wide. On the other hand, PMON_CONFIG (0xd4) for adm1275 is 8bits wide. The driver should not assume everything is 8bits wide and read only 8bits from it. Solution: If it is adm1272, adm1278, adm1293 and adm1294, use i2c_read_word. Else, use i2c_read_byte Testing: Binding adm1272 to the driver. The change is only tested on adm1272. Signed-off-by: Chu Lin Link: https://lore.kernel.org/r/20200709040612.3977094-1-linchuyuan@google.com Signed-off-by: Guenter Roeck commit 5679b28142193a62f6af93249c0477be9f0c669b Author: Ard Biesheuvel Date: Thu Jul 9 15:59:53 2020 +0300 arm64/alternatives: don't patch up internal branches Commit f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") moved the alternatives replacement sequences into subsections, in order to keep the as close as possible to the code that they replace. Unfortunately, this broke the logic in branch_insn_requires_update, which assumed that any branch into kernel executable code was a branch that required updating, which is no longer the case now that the code sequences that are patched in are in the same section as the patch site itself. So the only way to discriminate branches that require updating and ones that don't is to check whether the branch targets the replacement sequence itself, and so we can drop the call to kernel_text_address() entirely. Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") Reported-by: Alexandru Elisei Signed-off-by: Ard Biesheuvel Tested-by: Alexandru Elisei Link: https://lore.kernel.org/r/20200709125953.30918-1-ardb@kernel.org Signed-off-by: Will Deacon commit 528a9539348a0234375dfaa1ca5dbbb2f8f8e8d2 Author: Janosch Frank Date: Tue Jul 7 15:38:54 2020 +0200 s390/mm: fix huge pte soft dirty copying If the pmd is soft dirty we must mark the pte as soft dirty (and not dirty). This fixes some cases for guest migration with huge page backings. Cc: # 4.8 Fixes: bc29b7ac1d9f ("s390/mm: clean up pte/pmd encoding") Reviewed-by: Christian Borntraeger Reviewed-by: Gerald Schaefer Signed-off-by: Janosch Frank Signed-off-by: Heiko Carstens commit 30c66fc30ee7a98c4f3adf5fb7e213b61884474f Author: Frederic Weisbecker Date: Fri Jul 3 03:06:57 2020 +0200 timer: Prevent base->clk from moving backward When a timer is enqueued with a negative delta (ie: expiry is below base->clk), it gets added to the wheel as expiring now (base->clk). Yet the value that gets stored in base->next_expiry, while calling trigger_dyntick_cpu(), is the initial timer->expires value. The resulting state becomes: base->next_expiry < base->clk On the next timer enqueue, forward_timer_base() may accidentally rewind base->clk. As a possible outcome, timers may expire way too early, the worst case being that the highest wheel levels get spuriously processed again. To prevent from that, make sure that base->next_expiry doesn't get below base->clk. Fixes: a683f390b93f ("timers: Forward the wheel clock whenever possible") Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Reviewed-by: Anna-Maria Behnsen Tested-by: Juri Lelli Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200703010657.2302-1-frederic@kernel.org commit bd87e6f6610aa96fde01ee6653e162213f7ec836 Author: Thomas Gleixner Date: Wed Jul 8 21:28:07 2020 +0200 x86/entry/common: Make prepare_exit_to_usermode() static No users outside this file anymore. Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200708192934.301116609@linutronix.de commit 006e1ced516d2bfd9db63a32b5dba3c2abf43b04 Author: Thomas Gleixner Date: Wed Jul 8 21:28:06 2020 +0200 x86/entry: Mark check_user_regs() noinstr It's called from the non-instrumentable section. Fixes: c9c26150e61d ("x86/entry: Assert that syscalls are on the right stack") Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200708192934.191497962@linutronix.de commit bce9b042ec73e8662b8119d4ca47e7c78b20d0bf Author: Thomas Gleixner Date: Wed Jul 8 21:28:05 2020 +0200 x86/traps: Disable interrupts in exc_aligment_check() exc_alignment_check() fails to disable interrupts before returning to the entry code. Fixes: ca4c6a9858c2 ("x86/traps: Make interrupt enable/disable symmetric in C code") Reported-by: syzbot+0889df9502bc0f112b31@syzkaller.appspotmail.com Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200708192934.076519438@linutronix.de commit 09c717c92b52df54918e12cbfe6a4658233fda69 Author: Florian Fainelli Date: Wed Jul 8 22:13:40 2020 -0700 arm64: Add missing sentinel to erratum_1463225 When the erratum_1463225 array was introduced a sentinel at the end was missing thus causing a KASAN: global-out-of-bounds in is_affected_midr_range_list on arm64 error. Fixes: a9e821b89daa ("arm64: Add KRYO4XX gold CPU cores to erratum list 1463225 and 1418040") Signed-off-by: Florian Fainelli Reviewed-by: Sai Prakash Ranjan Link: https://lore.kernel.org/linux-arm-kernel/CA+G9fYs3EavpU89-rTQfqQ9GgxAMgMAk7jiiVrfP0yxj5s+Q6g@mail.gmail.com/ Link: https://lore.kernel.org/r/20200709051345.14544-1-f.fainelli@gmail.com Signed-off-by: Will Deacon commit 769e0fe1171e95d90ea5a2d6d0b2bdc7d5d2e7b2 Author: Ard Biesheuvel Date: Thu Jul 9 09:59:57 2020 +0300 efi: Revert "efi/x86: Fix build with gcc 4" This reverts commit 5435f73d5c4a1b75, which is no longer needed now that the minimum GCC version has been bumped to v4.9 Signed-off-by: Ard Biesheuvel commit f88814cc2578c121e6edef686365036db72af0ed Author: Ard Biesheuvel Date: Wed Jul 8 13:01:57 2020 +0300 efi/efivars: Expose RT service availability via efivars abstraction Commit bf67fad19e493b ("efi: Use more granular check for availability for variable services") introduced a check into the efivarfs, efi-pstore and other drivers that aborts loading of the module if not all three variable runtime services (GetVariable, SetVariable and GetNextVariable) are supported. However, this results in efivarfs being unavailable entirely if only SetVariable support is missing, which is only needed if you want to make any modifications. Also, efi-pstore and the sysfs EFI variable interface could be backed by another implementation of the 'efivars' abstraction, in which case it is completely irrelevant which services are supported by the EFI firmware. So make the generic 'efivars' abstraction dependent on the availibility of the GetVariable and GetNextVariable EFI runtime services, and add a helper 'efivar_supports_writes()' to find out whether the currently active efivars abstraction supports writes (and wire it up to the availability of SetVariable for the generic one). Then, use the efivar_supports_writes() helper to decide whether to permit efivarfs to be mounted read-write, and whether to enable efi-pstore or the sysfs EFI variable interface altogether. Fixes: bf67fad19e493b ("efi: Use more granular check for availability for variable services") Reported-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas Tested-by: Ilias Apalodimas Signed-off-by: Ard Biesheuvel commit 8778eb0927ddcd3f431805c37b78fa56481aeed9 Author: Zhang Qiang Date: Mon Jul 6 13:14:55 2020 +0800 usb: gadget: function: fix missing spinlock in f_uac1_legacy Add a missing spinlock protection for play_queue, because the play_queue may be destroyed when the "playback_work" work func and "f_audio_out_ep_complete" callback func operate this paly_queue at the same time. Fixes: c6994e6f067cf ("USB: gadget: add USB Audio Gadget driver") Cc: stable Signed-off-by: Zhang Qiang Signed-off-by: Felipe Balbi commit 30517ffeb3bff842e1355cbc32f1959d9dbb5414 Author: Michał Mirosław Date: Thu May 28 20:35:54 2020 +0200 usb: gadget: udc: atmel: fix uninitialized read in debug printk Fixed commit moved the assignment of 'req', but did not update a reference in the DBG() call. Use the argument as it was renamed. Fixes: 5fb694f96e7c ("usb: gadget: udc: atmel: fix possible oops when unloading module") Signed-off-by: Michał Mirosław Signed-off-by: Felipe Balbi commit 9706247d94165ef9d6f7f00308e1cd7e0cc9251d Author: Michał Mirosław Date: Thu May 28 20:35:53 2020 +0200 usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable() Fixed commit removed the offending behaviour from the driver, but missed the comment and associated test. Remove them now. Fixes: 38e58986e6fc ("usb: gadget: udc: atmel: don't disable enpdoints we don't own") Signed-off-by: Michał Mirosław Signed-off-by: Felipe Balbi commit 4fdf228cdf6925af45a2066d403821e0977bfddb Author: Minas Harutyunyan Date: Sat May 30 11:41:50 2020 +0400 usb: dwc2: Fix shutdown callback in platform To avoid lot of interrupts from dwc2 core, which can be asserted in specific conditions need to disable interrupts on HW level instead of disable IRQs on Kernel level, because of IRQ can be shared between drivers. Cc: stable@vger.kernel.org Fixes: a40a00318c7fc ("usb: dwc2: add shutdown callback to platform variant") Tested-by: Frank Mori Hess Reviewed-by: Alan Stern Reviewed-by: Doug Anderson Reviewed-by: Frank Mori Hess Signed-off-by: Minas Harutyunyan Signed-off-by: Felipe Balbi commit 65b7cf48c211ece5e2560a334eb9608e48775a8f Author: Peter Chen Date: Wed Jun 3 14:53:55 2020 +0800 usb: cdns3: trace: fix some endian issues It is found by sparse. Reported-by: kbuild test robot Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 9f81d45c79271def8a9b90447b04b9c6323291f9 Author: Peter Chen Date: Wed Jun 3 14:53:54 2020 +0800 usb: cdns3: ep0: fix some endian issues It is found by sparse. Reported-by: kbuild test robot Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit c8f8529e2c4141afa2ebb487ad48e8a6ec3e8c99 Author: Evgeny Novikov Date: Fri Jun 26 16:17:47 2020 +0300 usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init() gr_ep_init() does not assign the allocated request anywhere if allocation of memory for the buffer fails. This is a memory leak fixed by the given patch. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Felipe Balbi commit 4a0f5a7f2bab80348ca1e4b996648a20746a2407 Author: Randy Dunlap Date: Sun Jun 28 20:08:03 2020 -0700 usb: gadget: fix langid kernel-doc warning in usbstring.c Fix spelling of the 'langid' function argument in the kernel-doc notation to quieten a kernel-doc warning. ../drivers/usb/gadget/usbstring.c:77: warning: Function parameter or member 'langid' not described in 'usb_validate_langid' ../drivers/usb/gadget/usbstring.c:77: warning: Excess function parameter 'lang' description in 'usb_validate_langid' Fixes: 17309a6a4356 ("usb: gadget: add "usb_validate_langid" function") Signed-off-by: Randy Dunlap Reviewed-by: Tao Ren Cc: Tao Ren Cc: Felipe Balbi Signed-off-by: Felipe Balbi commit e25d1e8532c3d84f075deca1580a7d61e0f43ce6 Author: Heikki Krogerus Date: Tue Jun 30 15:24:59 2020 +0300 usb: dwc3: pci: add support for the Intel Jasper Lake This patch adds the necessary PCI ID for Intel Jasper Lake devices. Signed-off-by: Heikki Krogerus Signed-off-by: Felipe Balbi commit c3f595a8119207cc0f82b3dc6ec5bbf6f3e6b135 Author: Heikki Krogerus Date: Thu Jun 25 10:34:32 2020 +0300 usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant This patch adds the necessary PCI ID for TGP-H devices. Signed-off-by: Heikki Krogerus Signed-off-by: Felipe Balbi commit 2249357459c0a52608678c27ebc74c4238204057 Author: Guenter Roeck Date: Tue Jun 30 17:10:02 2020 -0700 drm/aspeed: Call drm_fbdev_generic_setup after drm_dev_register The following backtrace is seen when running aspeed G5 kernels. WARNING: CPU: 0 PID: 1 at drivers/gpu/drm/drm_fb_helper.c:2233 drm_fbdev_generic_setup+0x138/0x198 aspeed_gfx 1e6e6000.display: Device has not been registered. CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc3 #1 Hardware name: Generic DT based system Backtrace: [<8010d6d0>] (dump_backtrace) from [<8010d9b8>] (show_stack+0x20/0x24) r7:00000009 r6:60000153 r5:00000000 r4:8119fa94 [<8010d998>] (show_stack) from [<80b8cb98>] (dump_stack+0xcc/0xec) [<80b8cacc>] (dump_stack) from [<80123ef0>] (__warn+0xd8/0xfc) r7:00000009 r6:80e62ed0 r5:00000000 r4:974c3ccc [<80123e18>] (__warn) from [<80123f98>] (warn_slowpath_fmt+0x84/0xc4) r9:00000009 r8:806a0140 r7:000008b9 r6:80e62ed0 r5:80e631f8 r4:974c2000 [<80123f18>] (warn_slowpath_fmt) from [<806a0140>] (drm_fbdev_generic_setup+0x138/0x198) r9:00000001 r8:9758fc10 r7:9758fc00 r6:00000000 r5:00000020 r4:9768a000 [<806a0008>] (drm_fbdev_generic_setup) from [<806d4558>] (aspeed_gfx_probe+0x204/0x32c) r7:9758fc00 r6:00000000 r5:00000000 r4:9768a000 [<806d4354>] (aspeed_gfx_probe) from [<806dfca0>] (platform_drv_probe+0x58/0xa8) Since commit 1aed9509b29a6 ("drm/fb-helper: Remove return value from drm_fbdev_generic_setup()"), drm_fbdev_generic_setup() must be called after drm_dev_register() to avoid the warning. Do that. Fixes: 1aed9509b29a6 ("drm/fb-helper: Remove return value from drm_fbdev_generic_setup()") Signed-off-by: Guenter Roeck Acked-by: Sam Ravnborg Acked-by: Joel Stanley Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200701001002.74997-1-linux@roeck-us.net commit 3230d95cea0515a6acf3f5ff360663de4c40fd07 Author: Atish Patra Date: Mon Jul 6 10:25:59 2020 -0700 efi/libstub: Move the function prototypes to header file The prototype of the functions handle_kernel_image & efi_enter_kernel are defined in efi-stub.c which may result in a compiler warnings if -Wmissing-prototypes is set in gcc compiler. Move the prototype to efistub.h to make the compiler happy. Signed-off-by: Atish Patra Link: https://lore.kernel.org/r/20200706172609.25965-2-atish.patra@wdc.com Signed-off-by: Ard Biesheuvel commit 950accbabd4cfa83519fa920f99428bcc131c3c9 Author: Atish Patra Date: Thu Jun 25 16:45:06 2020 -0700 efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds 32bit gcc doesn't support modulo operation on 64 bit data. It results in a __umoddi3 error while building EFI for 32 bit. Use bitwise operations instead of modulo operations to fix the issue. Signed-off-by: Atish Patra Link: https://lore.kernel.org/r/20200625234516.31406-2-atish.patra@wdc.com Signed-off-by: Ard Biesheuvel commit c1aac64ddc01112e137121a43645b96c3633c41b Author: Masahiro Yamada Date: Thu Jun 4 11:20:30 2020 +0900 efi/libstub/arm64: link stub lib.a conditionally Since commit 799c43415442 ("kbuild: thin archives make default for all archs"), core-y is passed to the linker with --whole-archive. Hence, the whole of stub library is linked to vmlinux. Use libs-y so that lib.a is passed after --no-whole-archive for conditional linking. The unused drivers/firmware/efi/libstub/relocate.o will be dropped for ARCH=arm64. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200604022031.164207-1-masahiroy@kernel.org Signed-off-by: Ard Biesheuvel commit a50ca29523b18baea548bdf5df9b4b923c2bb4f6 Author: Dave Wang Date: Wed Jul 8 22:25:03 2020 -0700 Input: elan_i2c - add more hardware ID for Lenovo laptops This adds more hardware IDs for Elan touchpads found in various Lenovo laptops. Signed-off-by: Dave Wang Link: https://lore.kernel.org/r/000201d5a8bd$9fead3f0$dfc07bd0$@emc.com.tw Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit f3bd9dae3708a0ff6b067e766073ffeb853301f9 Author: Yang Yingliang Date: Thu Jul 9 10:11:41 2020 +0000 io_uring: fix memleak in __io_sqe_files_update() I got a memleak report when doing some fuzz test: BUG: memory leak unreferenced object 0xffff888113e02300 (size 488): comm "syz-executor401", pid 356, jiffies 4294809529 (age 11.954s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0 a4 ce 19 81 88 ff ff 60 ce 09 0d 81 88 ff ff ........`....... backtrace: [<00000000129a84ec>] kmem_cache_zalloc include/linux/slab.h:659 [inline] [<00000000129a84ec>] __alloc_file+0x25/0x310 fs/file_table.c:101 [<000000003050ad84>] alloc_empty_file+0x4f/0x120 fs/file_table.c:151 [<000000004d0a41a3>] alloc_file+0x5e/0x550 fs/file_table.c:193 [<000000002cb242f0>] alloc_file_pseudo+0x16a/0x240 fs/file_table.c:233 [<00000000046a4baa>] anon_inode_getfile fs/anon_inodes.c:91 [inline] [<00000000046a4baa>] anon_inode_getfile+0xac/0x1c0 fs/anon_inodes.c:74 [<0000000035beb745>] __do_sys_perf_event_open+0xd4a/0x2680 kernel/events/core.c:11720 [<0000000049009dc7>] do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359 [<00000000353731ca>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 BUG: memory leak unreferenced object 0xffff8881152dd5e0 (size 16): comm "syz-executor401", pid 356, jiffies 4294809529 (age 11.954s) hex dump (first 16 bytes): 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000074caa794>] kmem_cache_zalloc include/linux/slab.h:659 [inline] [<0000000074caa794>] lsm_file_alloc security/security.c:567 [inline] [<0000000074caa794>] security_file_alloc+0x32/0x160 security/security.c:1440 [<00000000c6745ea3>] __alloc_file+0xba/0x310 fs/file_table.c:106 [<000000003050ad84>] alloc_empty_file+0x4f/0x120 fs/file_table.c:151 [<000000004d0a41a3>] alloc_file+0x5e/0x550 fs/file_table.c:193 [<000000002cb242f0>] alloc_file_pseudo+0x16a/0x240 fs/file_table.c:233 [<00000000046a4baa>] anon_inode_getfile fs/anon_inodes.c:91 [inline] [<00000000046a4baa>] anon_inode_getfile+0xac/0x1c0 fs/anon_inodes.c:74 [<0000000035beb745>] __do_sys_perf_event_open+0xd4a/0x2680 kernel/events/core.c:11720 [<0000000049009dc7>] do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359 [<00000000353731ca>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 If io_sqe_file_register() failed, we need put the file that get by fget() to avoid the memleak. Fixes: c3a31e605620 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE") Cc: stable@vger.kernel.org Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Jens Axboe commit 6d5f904904608a9cd32854d7d0a4dd65b27f9935 Author: Xiaoguang Wang Date: Thu Jul 9 09:15:29 2020 +0800 io_uring: export cq overflow status to userspace For those applications which are not willing to use io_uring_enter() to reap and handle cqes, they may completely rely on liburing's io_uring_peek_cqe(), but if cq ring has overflowed, currently because io_uring_peek_cqe() is not aware of this overflow, it won't enter kernel to flush cqes, below test program can reveal this bug: static void test_cq_overflow(struct io_uring *ring) { struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; int issued = 0; int ret = 0; do { sqe = io_uring_get_sqe(ring); if (!sqe) { fprintf(stderr, "get sqe failed\n"); break;; } ret = io_uring_submit(ring); if (ret <= 0) { if (ret != -EBUSY) fprintf(stderr, "sqe submit failed: %d\n", ret); break; } issued++; } while (ret > 0); assert(ret == -EBUSY); printf("issued requests: %d\n", issued); while (issued) { ret = io_uring_peek_cqe(ring, &cqe); if (ret) { if (ret != -EAGAIN) { fprintf(stderr, "peek completion failed: %s\n", strerror(ret)); break; } printf("left requets: %d\n", issued); continue; } io_uring_cqe_seen(ring, cqe); issued--; printf("left requets: %d\n", issued); } } int main(int argc, char *argv[]) { int ret; struct io_uring ring; ret = io_uring_queue_init(16, &ring, 0); if (ret) { fprintf(stderr, "ring setup failed: %d\n", ret); return 1; } test_cq_overflow(&ring); return 0; } To fix this issue, export cq overflow status to userspace by adding new IORING_SQ_CQ_OVERFLOW flag, then helper functions() in liburing, such as io_uring_peek_cqe, can be aware of this cq overflow and do flush accordingly. Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 813357fead4adee73f7eca6bbe0e69dfcf514dc6 Author: Dan Williams Date: Tue Jun 23 21:35:26 2020 -0700 libnvdimm/security: Fix key lookup permissions As of commit 8c0637e950d6 ("keys: Make the KEY_NEED_* perms an enum rather than a mask") lookup_user_key() needs an explicit declaration of what it wants to do with the key. Add KEY_NEED_SEARCH to fix a warning with the below signature, and fixes the inability to retrieve a key. WARNING: CPU: 15 PID: 6276 at security/keys/permission.c:35 key_task_permission+0xd3/0x140 [..] RIP: 0010:key_task_permission+0xd3/0x140 [..] Call Trace: lookup_user_key+0xeb/0x6b0 ? vsscanf+0x3df/0x840 ? key_validate+0x50/0x50 ? key_default_cmp+0x20/0x20 nvdimm_get_user_key_payload.part.0+0x21/0x110 [libnvdimm] nvdimm_security_store+0x67d/0xb20 [libnvdimm] security_store+0x67/0x1a0 [libnvdimm] kernfs_fop_write+0xcf/0x1c0 vfs_write+0xde/0x1d0 ksys_write+0x68/0xe0 do_syscall_64+0x5c/0xa0 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Fixes: 8c0637e950d6 ("keys: Make the KEY_NEED_* perms an enum rather than a mask") Suggested-by: David Howells Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Link: https://lore.kernel.org/r/159297332630.1304143.237026690015653759.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 0a03715068794e4b524f66ebbf412ab1f2933f3f Author: Leon Romanovsky Date: Tue Jul 7 14:06:12 2020 +0300 RDMA/mlx5: Set PD pointers for the error flow unwind ib_pd is accessed internally during destroy of the TIR/TIS, but PD can be not set yet. This leading to the following kernel panic. BUG: kernel NULL pointer dereference, address: 0000000000000074 PGD 8000000079eaa067 P4D 8000000079eaa067 PUD 7ae81067 PMD 0 Oops: 0000 [#1] SMP PTI CPU: 1 PID: 709 Comm: syz-executor.0 Not tainted 5.8.0-rc3 #41 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 RIP: 0010:destroy_raw_packet_qp_tis drivers/infiniband/hw/mlx5/qp.c:1189 [inline] RIP: 0010:destroy_raw_packet_qp drivers/infiniband/hw/mlx5/qp.c:1527 [inline] RIP: 0010:destroy_qp_common+0x2ca/0x4f0 drivers/infiniband/hw/mlx5/qp.c:2397 Code: 00 85 c0 74 2e e8 56 18 55 ff 48 8d b3 28 01 00 00 48 89 ef e8 d7 d3 ff ff 48 8b 43 08 8b b3 c0 01 00 00 48 8b bd a8 0a 00 00 <0f> b7 50 74 e8 0d 6a fe ff e8 28 18 55 ff 49 8d 55 50 4c 89 f1 48 RSP: 0018:ffffc900007bbac8 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff88807949e800 RCX: 0000000000000998 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807c180140 RBP: ffff88807b50c000 R08: 000000000002d379 R09: ffffc900007bba00 R10: 0000000000000001 R11: 000000000002d358 R12: ffff888076f37000 R13: ffff88807949e9c8 R14: ffffc900007bbe08 R15: ffff888076f37000 FS: 00000000019bf940(0000) GS:ffff88807dd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000074 CR3: 0000000076d68004 CR4: 0000000000360ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mlx5_ib_create_qp+0xf36/0xf90 drivers/infiniband/hw/mlx5/qp.c:3014 _ib_create_qp drivers/infiniband/core/core_priv.h:333 [inline] create_qp+0x57f/0xd20 drivers/infiniband/core/uverbs_cmd.c:1443 ib_uverbs_create_qp+0xcf/0x100 drivers/infiniband/core/uverbs_cmd.c:1564 ib_uverbs_write+0x5fa/0x780 drivers/infiniband/core/uverbs_main.c:664 __vfs_write+0x3f/0x90 fs/read_write.c:495 vfs_write+0xc7/0x1f0 fs/read_write.c:559 ksys_write+0x5e/0x110 fs/read_write.c:612 do_syscall_64+0x3e/0x70 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x466479 Code: Bad RIP value. RSP: 002b:00007ffd057b62b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000466479 RDX: 0000000000000070 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 00000000019bf8fc R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000bf6 R14: 00000000004cb859 R15: 00000000006fefc0 Fixes: 6c41965d647a ("RDMA/mlx5: Don't access ib_qp fields in internal destroy QP path") Link: https://lore.kernel.org/r/20200707110612.882962-4-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 530c8632b547ff72f11ff83654b22462a73f1f7b Author: Aya Levin Date: Tue Jul 7 14:06:11 2020 +0300 IB/mlx5: Fix 50G per lane indication Some released FW versions mistakenly don't set the capability that 50G per lane link-modes are supported for VFs (ptys_extended_ethernet capability bit). Use PTYS.ext_eth_proto_capability instead, as this indication is always accurate. If PTYS.ext_eth_proto_capability is valid (has a non-zero value) conclude that the HCA supports 50G per lane. Otherwise, conclude that the HCA doesn't support 50G per lane. Fixes: 08e8676f1607 ("IB/mlx5: Add support for 50Gbps per lane link modes") Link: https://lore.kernel.org/r/20200707110612.882962-3-leon@kernel.org Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2c79583927bb8154ecaa45a67dde97661d895ecd Author: Kees Cook Date: Fri Jul 3 11:25:09 2020 -0700 selftests: kmod: Add module address visibility test Make sure we don't regress the CAP_SYSLOG behavior of the module address visibility via /proc/modules nor /sys/module/*/sections/*. Reviewed-by: Luis Chamberlain Signed-off-by: Kees Cook commit 63960260457a02af2a6cb35d75e6bdb17299c882 Author: Kees Cook Date: Thu Jul 2 15:45:23 2020 -0700 bpf: Check correct cred for CAP_SYSLOG in bpf_dump_raw_ok() When evaluating access control over kallsyms visibility, credentials at open() time need to be used, not the "current" creds (though in BPF's case, this has likely always been the same). Plumb access to associated file->f_cred down through bpf_dump_raw_ok() and its callers now that kallsysm_show_value() has been refactored to take struct cred. Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: bpf@vger.kernel.org Cc: stable@vger.kernel.org Fixes: 7105e828c087 ("bpf: allow for correlation of maps and helpers in dump") Signed-off-by: Kees Cook commit 60f7bb66b88b649433bf700acfc60c3f24953871 Author: Kees Cook Date: Thu Jul 2 15:20:22 2020 -0700 kprobes: Do not expose probe addresses to non-CAP_SYSLOG The kprobe show() functions were using "current"'s creds instead of the file opener's creds for kallsyms visibility. Fix to use seq_file->file->f_cred. Cc: Masami Hiramatsu Cc: stable@vger.kernel.org Fixes: 81365a947de4 ("kprobes: Show address of kprobes if kallsyms does") Fixes: ffb9bd68ebdb ("kprobes: Show blacklist addresses as same as kallsyms does") Signed-off-by: Kees Cook commit b25a7c5af9051850d4f3d93ca500056ab6ec724b Author: Kees Cook Date: Thu Jul 2 14:43:59 2020 -0700 module: Do not expose section addresses to non-CAP_SYSLOG The printing of section addresses in /sys/module/*/sections/* was not using the correct credentials to evaluate visibility. Before: # cat /sys/module/*/sections/.*text 0xffffffffc0458000 ... # capsh --drop=CAP_SYSLOG -- -c "cat /sys/module/*/sections/.*text" 0xffffffffc0458000 ... After: # cat /sys/module/*/sections/*.text 0xffffffffc0458000 ... # capsh --drop=CAP_SYSLOG -- -c "cat /sys/module/*/sections/.*text" 0x0000000000000000 ... Additionally replaces the existing (safe) /proc/modules check with file->f_cred for consistency. Reported-by: Dominik Czarnota Fixes: be71eda5383f ("module: Fix display of wrong module .text address") Cc: stable@vger.kernel.org Tested-by: Jessica Yu Acked-by: Jessica Yu Signed-off-by: Kees Cook commit ed66f991bb19d94cae5d38f77de81f96aac7813f Author: Kees Cook Date: Thu Jul 2 13:47:20 2020 -0700 module: Refactor section attr into bin attribute In order to gain access to the open file's f_cred for kallsym visibility permission checks, refactor the module section attributes to use the bin_attribute instead of attribute interface. Additionally removes the redundant "name" struct member. Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Tested-by: Jessica Yu Acked-by: Jessica Yu Signed-off-by: Kees Cook commit 160251842cd35a75edfb0a1d76afa3eb674ff40a Author: Kees Cook Date: Thu Jul 2 11:49:23 2020 -0700 kallsyms: Refactor kallsyms_show_value() to take cred In order to perform future tests against the cred saved during open(), switch kallsyms_show_value() to operate on a cred, and have all current callers pass current_cred(). This makes it very obvious where callers are checking the wrong credential in their "read" contexts. These will be fixed in the coming patches. Additionally switch return value to bool, since it is always used as a direct permission check, not a 0-on-success, negative-on-error style function return. Cc: stable@vger.kernel.org Signed-off-by: Kees Cook commit 76c4d85c9260c3d741cbd194c30c61983d0a4303 Author: Rahul Lakkireddy Date: Thu Jul 9 03:14:27 2020 +0530 cxgb4: fix all-mask IP address comparison Convert all-mask IP address to Big Endian, instead, for comparison. Fixes: f286dd8eaad5 ("cxgb4: use correct type for all-mask IP address comparison") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit a34f829164f3c70d7f53bb532ddcc39fa890b722 Author: Hamish Martin Date: Thu Jul 9 09:06:44 2020 +1200 tipc: fix retransmission on unicast links A scenario has been observed where a 'bc_init' message for a link is not retransmitted if it fails to be received by the peer. This leads to the peer never establishing the link fully and it discarding all other data received on the link. In this scenario the message is lost in transit to the peer. The issue is traced to the 'nxt_retr' field of the skb not being initialised for links that aren't a bc_sndlink. This leads to the comparison in tipc_link_advance_transmq() that gates whether to attempt retransmission of a message performing in an undesirable way. Depending on the relative value of 'jiffies', this comparison: time_before(jiffies, TIPC_SKB_CB(skb)->nxt_retr) may return true or false given that 'nxt_retr' remains at the uninitialised value of 0 for non bc_sndlinks. This is most noticeable shortly after boot when jiffies is initialised to a high value (to flush out rollover bugs) and we compare a jiffies of, say, 4294940189 to zero. In that case time_before returns 'true' leading to the skb not being retransmitted. The fix is to ensure that all skbs have a valid 'nxt_retr' time set for them and this is achieved by refactoring the setting of this value into a central function. With this fix, transmission losses of 'bc_init' messages do not stall the link establishment forever because the 'bc_init' message is retransmitted and the link eventually establishes correctly. Fixes: 382f598fb66b ("tipc: reduce duplicate packets for unicast traffic") Acked-by: Jon Maloy Signed-off-by: Hamish Martin Signed-off-by: David S. Miller commit 27d53323664c549b5bb2dfaaf6f7ad6e0376a64e Author: Xin Long Date: Tue Jul 7 02:02:32 2020 +0800 l2tp: remove skb_dst_set() from l2tp_xmit_skb() In the tx path of l2tp, l2tp_xmit_skb() calls skb_dst_set() to set skb's dst. However, it will eventually call inet6_csk_xmit() or ip_queue_xmit() where skb's dst will be overwritten by: skb_dst_set_noref(skb, dst); without releasing the old dst in skb. Then it causes dst/dev refcnt leak: unregister_netdevice: waiting for eth0 to become free. Usage count = 1 This can be reproduced by simply running: # modprobe l2tp_eth && modprobe l2tp_ip # sh ./tools/testing/selftests/net/l2tp.sh So before going to inet6_csk_xmit() or ip_queue_xmit(), skb's dst should be dropped. This patch is to fix it by removing skb_dst_set() from l2tp_xmit_skb() and moving skb_dst_drop() into l2tp_xmit_core(). Fixes: 3557baabf280 ("[L2TP]: PPP over L2TP driver core") Reported-by: Hangbin Liu Signed-off-by: Xin Long Acked-by: James Chapman Tested-by: James Chapman Signed-off-by: David S. Miller commit 579dd91ab3a5446b148e7f179b6596b270dace46 Author: Zheng Bin Date: Mon Jun 29 09:23:49 2020 +0800 nbd: Fix memory leak in nbd_add_socket When adding first socket to nbd, if nsock's allocation failed, the data structure member "config->socks" was reallocated, but the data structure member "config->num_connections" was not updated. A memory leak will occur then because the function "nbd_config_put" will free "config->socks" only when "config->num_connections" is not zero. Fixes: 03bf73c315ed ("nbd: prevent memory leak") Reported-by: syzbot+934037347002901b8d2a@syzkaller.appspotmail.com Signed-off-by: Zheng Bin Reviewed-by: Eric Biggers Signed-off-by: Jens Axboe commit 581fce373581772470af8fb4fe13505dc66281e6 Author: Suzuki K Poulose Date: Tue Jul 7 15:31:52 2020 +0100 arm64: Documentation: Fix broken table in generated HTML cpu-feature-registers.rst is missing a new line before a couple of tables listing the visible fields, causing broken tables in the HTML documentation generated by "make htmldocs". Fix this by adding the missing new line. Reported-by: Peter Maydell Signed-off-by: Suzuki K Poulose Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Link: https://lore.kernel.org/r/20200707143152.154541-1-suzuki.poulose@arm.com Signed-off-by: Will Deacon commit 8523c006264df65aac7d77284cc69aac46a6f842 Author: Wei Li Date: Sun May 10 05:41:56 2020 +0800 arm64: kgdb: Fix single-step exception handling oops After entering kdb due to breakpoint, when we execute 'ss' or 'go' (will delay installing breakpoints, do single-step first), it won't work correctly, and it will enter kdb due to oops. It's because the reason gotten in kdb_stub() is not as expected, and it seems that the ex_vector for single-step should be 0, like what arch powerpc/sh/parisc has implemented. Before the patch: Entering kdb (current=0xffff8000119e2dc0, pid 0) on processor 0 due to Keyboard Entry [0]kdb> bp printk Instruction(i) BP #0 at 0xffff8000101486cc (printk) is enabled addr at ffff8000101486cc, hardtype=0 installed=0 [0]kdb> g / # echo h > /proc/sysrq-trigger Entering kdb (current=0xffff0000fa878040, pid 266) on processor 3 due to Breakpoint @ 0xffff8000101486cc [3]kdb> ss Entering kdb (current=0xffff0000fa878040, pid 266) on processor 3 Oops: (null) due to oops @ 0xffff800010082ab8 CPU: 3 PID: 266 Comm: sh Not tainted 5.7.0-rc4-13839-gf0e5ad491718 #6 Hardware name: linux,dummy-virt (DT) pstate: 00000085 (nzcv daIf -PAN -UAO) pc : el1_irq+0x78/0x180 lr : __handle_sysrq+0x80/0x190 sp : ffff800015003bf0 x29: ffff800015003d20 x28: ffff0000fa878040 x27: 0000000000000000 x26: ffff80001126b1f0 x25: ffff800011b6a0d8 x24: 0000000000000000 x23: 0000000080200005 x22: ffff8000101486cc x21: ffff800015003d30 x20: 0000ffffffffffff x19: ffff8000119f2000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff800015003e50 x7 : 0000000000000002 x6 : 00000000380b9990 x5 : ffff8000106e99e8 x4 : ffff0000fadd83c0 x3 : 0000ffffffffffff x2 : ffff800011b6a0d8 x1 : ffff800011b6a000 x0 : ffff80001130c9d8 Call trace: el1_irq+0x78/0x180 printk+0x0/0x84 write_sysrq_trigger+0xb0/0x118 proc_reg_write+0xb4/0xe0 __vfs_write+0x18/0x40 vfs_write+0xb0/0x1b8 ksys_write+0x64/0xf0 __arm64_sys_write+0x14/0x20 el0_svc_common.constprop.2+0xb0/0x168 do_el0_svc+0x20/0x98 el0_sync_handler+0xec/0x1a8 el0_sync+0x140/0x180 [3]kdb> After the patch: Entering kdb (current=0xffff8000119e2dc0, pid 0) on processor 0 due to Keyboard Entry [0]kdb> bp printk Instruction(i) BP #0 at 0xffff8000101486cc (printk) is enabled addr at ffff8000101486cc, hardtype=0 installed=0 [0]kdb> g / # echo h > /proc/sysrq-trigger Entering kdb (current=0xffff0000fa852bc0, pid 268) on processor 0 due to Breakpoint @ 0xffff8000101486cc [0]kdb> g Entering kdb (current=0xffff0000fa852bc0, pid 268) on processor 0 due to Breakpoint @ 0xffff8000101486cc [0]kdb> ss Entering kdb (current=0xffff0000fa852bc0, pid 268) on processor 0 due to SS trap @ 0xffff800010082ab8 [0]kdb> Fixes: 44679a4f142b ("arm64: KGDB: Add step debugging support") Signed-off-by: Wei Li Tested-by: Douglas Anderson Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20200509214159.19680-2-liwei391@huawei.com Signed-off-by: Will Deacon commit 8c3001b9252d8dbf72289d3590a723eea8cfe824 Author: Will Deacon Date: Wed Jul 8 22:10:01 2020 +0100 arm64: entry: Tidy up block comments and label numbers Continually butchering our entry code with CPU errata workarounds has led to it looking a little scruffy. Consistently used /* */ comment style for multi-line block comments and ensure that small numeric labels use consecutive integers. No functional change, but the state of things was irritating. Signed-off-by: Will Deacon commit dc802f2bc0208f4abca420705a860c5175db4bee Author: Marc Zyngier Date: Mon Jul 6 17:38:02 2020 +0100 arm64: Rework ARM_ERRATUM_1414080 handling The current handling of erratum 1414080 has the side effect that cntkctl_el1 can get changed for both 32 and 64bit tasks. This isn't a problem so far, but if we ever need to mitigate another of these errata on the 64bit side, we'd better keep the messing with cntkctl_el1 local to 32bit tasks. For that, make sure that on entering the kernel from a 32bit tasks, userspace access to cntvct gets enabled, and disabled returning to userspace, while it never gets changed for 64bit tasks. Signed-off-by: Marc Zyngier Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20200706163802.1836732-5-maz@kernel.org [will: removed branch instructions per Mark's review comments] Signed-off-by: Will Deacon commit 4b661d6133c5d3a7c9aca0b4ee5a78c7766eff3f Author: Marc Zyngier Date: Mon Jul 6 17:38:01 2020 +0100 arm64: arch_timer: Disable the compat vdso for cores affected by ARM64_WORKAROUND_1418040 ARM64_WORKAROUND_1418040 requires that AArch32 EL0 accesses to the virtual counter register are trapped and emulated by the kernel. This makes the vdso pretty pointless, and in some cases livelock prone. Provide a workaround entry that limits the vdso to 64bit tasks. Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200706163802.1836732-4-maz@kernel.org Signed-off-by: Will Deacon commit c1fbec4ac0d701f350a581941d35643d5a9cd184 Author: Marc Zyngier Date: Mon Jul 6 17:38:00 2020 +0100 arm64: arch_timer: Allow an workaround descriptor to disable compat vdso As we are about to disable the vdso for compat tasks in some circumstances, let's allow a workaround descriptor to express exactly that. Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200706163802.1836732-3-maz@kernel.org Signed-off-by: Will Deacon commit 97884ca8c2925d14c32188e865069f21378b4b4f Author: Marc Zyngier Date: Mon Jul 6 17:37:59 2020 +0100 arm64: Introduce a way to disable the 32bit vdso We have a class of errata (grouped under the ARM64_WORKAROUND_1418040 banner) that force the trapping of counter access from 32bit EL0. We would normally disable the whole vdso for such defect, except that it would disable it for 64bit userspace as well, which is a shame. Instead, add a new vdso_clock_mode, which signals that the vdso isn't usable for compat tasks. This gets checked in the new vdso_clocksource_ok() helper, now provided for the 32bit vdso. Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200706163802.1836732-2-maz@kernel.org Signed-off-by: Will Deacon commit b8c1c9fe6a042dfbb169d14ab2000d9163f06d10 Author: Kevin Hao Date: Fri Apr 17 18:32:11 2020 +0800 arm64: entry: Fix the typo in the comment of el1_dbg() The function name should be local_daif_mask(). Signed-off-by: Kevin Hao Acked-by: Mark Rutlamd Link: https://lore.kernel.org/r/20200417103212.45812-2-haokexin@gmail.com Signed-off-by: Will Deacon commit 132330f8044c8e0cfa83b5eee41ade52708390dc Author: Gavin Shan Date: Tue Jun 30 17:59:43 2020 +1000 drivers/firmware/psci: Assign @err directly in hotplug_tests() The return value of down_and_up_cpus() can be assigned to @err directly. With that, the useless assignment to @err with zero can be dropped. Signed-off-by: Gavin Shan Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20200630075943.203954-1-gshan@redhat.com Signed-off-by: Will Deacon commit c377e67c6271954969384f9be1b1b71de13eba30 Author: Gavin Shan Date: Tue Jun 30 17:52:27 2020 +1000 drivers/firmware/psci: Fix memory leakage in alloc_init_cpu_groups() The CPU mask (@tmp) should be released on failing to allocate @cpu_groups or any of its elements. Otherwise, it leads to memory leakage because the CPU mask variable is dynamically allocated when CONFIG_CPUMASK_OFFSTACK is enabled. Signed-off-by: Gavin Shan Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20200630075227.199624-1-gshan@redhat.com Signed-off-by: Will Deacon commit 68cf617309b5f6f3a651165f49f20af1494753ae Author: Will Deacon Date: Wed Jul 8 17:25:46 2020 +0100 KVM: arm64: Fix definition of PAGE_HYP_DEVICE PAGE_HYP_DEVICE is intended to encode attribute bits for an EL2 stage-1 pte mapping a device. Unfortunately, it includes PROT_DEVICE_nGnRE which encodes attributes for EL1 stage-1 mappings such as UXN and nG, which are RES0 for EL2, and DBM which is meaningless as TCR_EL2.HD is not set. Fix the definition of PAGE_HYP_DEVICE so that it doesn't set RES0 bits at EL2. Acked-by: Marc Zyngier Cc: Marc Zyngier Cc: Catalin Marinas Cc: James Morse Cc: Link: https://lore.kernel.org/r/20200708162546.26176-1-will@kernel.org Signed-off-by: Will Deacon commit 1412bb2b4bb7e05b694742748b0f315664d91450 Merge: a42e6aee7f47 fb4f79264c0f Author: David S. Miller Date: Wed Jul 8 12:35:15 2020 -0700 Merge branch 'net-smc-fixes' Karsten Graul says: ==================== net/smc: fixes 2020-07-08 Please apply the following patch series for smc to netdev's net tree. The patches fix problems found during more testing of SMC functionality, resulting in hang conditions and unneeded link deactivations. The clc module was hardened to be prepared for possible future SMCD versions. ==================== Signed-off-by: David S. Miller commit fb4f79264c0fc6fd5a68ffe3e31bfff97311e1f1 Author: Ursula Braun Date: Wed Jul 8 17:05:15 2020 +0200 net/smc: tolerate future SMCD versions CLC proposal messages of future SMCD versions could be larger than SMCD V1 CLC proposal messages. To enable toleration in SMC V1 the receival of CLC proposal messages is adapted: * accept larger length values in CLC proposal * check trailing eye catcher for incoming CLC proposal with V1 length only * receive the whole CLC proposal even in cases it does not fit into the V1 buffer Fixes: e7b7a64a8493d ("smc: support variable CLC proposal messages") Signed-off-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 82087c0330534d18e6db25869871e589d214b7fa Author: Ursula Braun Date: Wed Jul 8 17:05:14 2020 +0200 net/smc: switch smcd_dev_list spinlock to mutex The similar smc_ib_devices spinlock has been converted to a mutex. Protecting the smcd_dev_list by a mutex is possible as well. This patch converts the smcd_dev_list spinlock to a mutex. Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM") Signed-off-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 92f3cb0e11dda530d1daa42d7a11af5a92ed89e4 Author: Ursula Braun Date: Wed Jul 8 17:05:13 2020 +0200 net/smc: fix sleep bug in smc_pnet_find_roce_resource() Tests showed this BUG: [572555.252867] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935 [572555.252876] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 131031, name: smcapp [572555.252879] INFO: lockdep is turned off. [572555.252883] CPU: 1 PID: 131031 Comm: smcapp Tainted: G O 5.7.0-rc3uschi+ #356 [572555.252885] Hardware name: IBM 3906 M03 703 (LPAR) [572555.252887] Call Trace: [572555.252896] [<00000000ac364554>] show_stack+0x94/0xe8 [572555.252901] [<00000000aca1f400>] dump_stack+0xa0/0xe0 [572555.252906] [<00000000ac3c8c10>] ___might_sleep+0x260/0x280 [572555.252910] [<00000000acdc0c98>] __mutex_lock+0x48/0x940 [572555.252912] [<00000000acdc15c2>] mutex_lock_nested+0x32/0x40 [572555.252975] [<000003ff801762d0>] mlx5_lag_get_roce_netdev+0x30/0xc0 [mlx5_core] [572555.252996] [<000003ff801fb3aa>] mlx5_ib_get_netdev+0x3a/0xe0 [mlx5_ib] [572555.253007] [<000003ff80063848>] smc_pnet_find_roce_resource+0x1d8/0x310 [smc] [572555.253011] [<000003ff800602f0>] __smc_connect+0x1f0/0x3e0 [smc] [572555.253015] [<000003ff80060634>] smc_connect+0x154/0x190 [smc] [572555.253022] [<00000000acbed8d4>] __sys_connect+0x94/0xd0 [572555.253025] [<00000000acbef620>] __s390x_sys_socketcall+0x170/0x360 [572555.253028] [<00000000acdc6800>] system_call+0x298/0x2b8 [572555.253030] INFO: lockdep is turned off. Function smc_pnet_find_rdma_dev() might be called from smc_pnet_find_roce_resource(). It holds the smc_ib_devices list spinlock while calling infiniband op get_netdev(). At least for mlx5 the get_netdev operation wants mutex serialization, which conflicts with the smc_ib_devices spinlock. This patch switches the smc_ib_devices spinlock into a mutex to allow sleeping when calling get_netdev(). Fixes: a4cf0443c414 ("smc: introduce SMC as an IB-client") Signed-off-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit b7eede757883a9892dcb7bf0280f4890fc74bcf6 Author: Karsten Graul Date: Wed Jul 8 17:05:12 2020 +0200 net/smc: fix work request handling Wait for pending sends only when smc_switch_conns() found a link to move the connections to. Do not wait during link freeing, this can lead to permanent hang situations. And refuse to provide a new tx slot on an unusable link. Fixes: c6f02ebeea3a ("net/smc: switch connections to alternate link") Reviewed-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 6778a6bed09b58beca936a675e9dd195c0986580 Author: Karsten Graul Date: Wed Jul 8 17:05:11 2020 +0200 net/smc: separate LLC wait queues for flow and messages There might be races in scenarios where both SMC link groups are on the same system. Prevent that by creating separate wait queues for LLC flows and messages. Switch to non-interruptable versions of wait_event() and wake_up() for the llc flow waiter to make sure the waiters get control sequentially. Fine tune the llc_flow_lock to include the assignment of the message. Write to system log when an unexpected message was dropped. And remove an extra indirection and use the existing local variable lgr in smc_llc_enqueue(). Fixes: 555da9af827d ("net/smc: add event-based llc_flow framework") Reviewed-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit a42e6aee7f47a8a68d09923c720fc8f605a04207 Author: Dmitry Bogdanov Date: Wed Jul 8 17:17:10 2020 +0300 net: atlantic: fix ip dst and ipv6 address filters This patch fixes ip dst and ipv6 address filters. There were 2 mistakes in the code, which led to the issue: * invalid register was used for ipv4 dst address; * incorrect write order of dwords for ipv6 addresses. Fixes: 23e7a718a49b ("net: aquantia: add rx-flow filter definitions") Signed-off-by: Dmitry Bogdanov Signed-off-by: Mark Starovoytov Signed-off-by: Alexander Lobakin Signed-off-by: David S. Miller commit 0bddd227f3dc55975e2b8dfa7fc6f959b062a2c7 Author: Randy Dunlap Date: Wed Jul 8 11:44:59 2020 -0700 Documentation: update for gcc 4.9 requirement Update Documentation for the gcc v4.9 upgrade requirement. Fixes: 5429ef62bcf3 ("compiler/gcc: Raise minimum GCC version for kernel builds to 4.8") Fixes: 6ec4476ac825 ("Raise gcc version requirement to 4.9") Signed-off-by: Randy Dunlap Acked-by: Jonathan Corbet Signed-off-by: Linus Torvalds commit 63e1968a2c87e9461e9694a96991935116e0cec7 Merge: 6ec4476ac825 f79a732a8325 Author: Linus Torvalds Date: Wed Jul 8 11:07:09 2020 -0700 Merge tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small, mostly device-specific fixes. The significant one is the regression fix for USB-audio implicit feedback devices due to the incorrect frame size calculation, which landed in 5.8 and stable trees. In addition, a few usual HD-audio and USB-audio quirks, Intel HDMI fixes, ASoC fsl and rt5682 fixes, as well as the fix in compress-offload partial drain operation" * tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: compress: fix partial_drain completion state ALSA: usb-audio: Add implicit feedback quirk for RTX6001 ALSA: usb-audio: add quirk for MacroSilicon MS2109 ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id ALSA: hda/hdmi: improve debug traces for stream lookups ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later ALSA: opl3: fix infoleak in opl3 ALSA: usb-audio: Replace s/frame/packet/ where appropriate ALSA: usb-audio: Fix packet size calculation AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module ALSA: hda - let hs_mic be picked ahead of hp_mic ASoC: rt5682: fix the pop noise while OMTP type headset plugin ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable ASoC: fsl_mqs: Don't check clock is NULL before calling clk API commit 6ec4476ac82512f09c94aff5972654b70f3772b2 Author: Linus Torvalds Date: Wed Jul 8 10:48:35 2020 -0700 Raise gcc version requirement to 4.9 I realize that we fairly recently raised it to 4.8, but the fact is, 4.9 is a much better minimum version to target. We have a number of workarounds for actual bugs in pre-4.9 gcc versions (including things like internal compiler errors on ARM), but we also have some syntactic workarounds for lacking features. In particular, raising the minimum to 4.9 means that we can now just assume _Generic() exists, which is likely the much better replacement for a lot of very convoluted built-time magic with conditionals on sizeof and/or __builtin_choose_expr() with same_type() etc. Using _Generic also means that you will need to have a very recent version of 'sparse', but thats easy to build yourself, and much less of a hassle than some old gcc version can be. The latest (in a long string) of reasons for minimum compiler version upgrades was commit 5435f73d5c4a ("efi/x86: Fix build with gcc 4"). Ard points out that RHEL 7 uses gcc-4.8, but the people who stay back on old RHEL versions persumably also don't build their own kernels anyway. And maybe they should cross-built or just have a little side affair with a newer compiler? Acked-by: Ard Biesheuvel Acked-by: Peter Zijlstra Signed-off-by: Linus Torvalds commit 6958c1c640af8c3f40fa8a2eee3b5b905d95b677 Author: Mikulas Patocka Date: Wed Jul 8 12:25:20 2020 -0400 dm: use noio when sending kobject event kobject_uevent may allocate memory and it may be called while there are dm devices suspended. The allocation may recurse into a suspended device, causing a deadlock. We must set the noio flag when sending a uevent. The observed deadlock was reported here: https://www.redhat.com/archives/dm-devel/2020-March/msg00025.html Reported-by: Khazhismel Kumykov Reported-by: Tahsin Erdogan Reported-by: Gabriel Krisman Bertazi Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit 174364f6a8979655f71b04b6492657aec3762703 Author: Damien Le Moal Date: Wed Jul 8 09:20:22 2020 +0900 dm zoned: Fix zone reclaim trigger Only triggering reclaim based on the percentage of unmapped cache zones can fail to detect cases where reclaim is needed, e.g. if the target has only 2 or 3 cache zones and only one unmapped cache zone, the percentage of free cache zones is higher than DMZ_RECLAIM_LOW_UNMAP_ZONES (30%) and reclaim does not trigger. This problem, combined with the fact that dmz_schedule_reclaim() is called from dmz_handle_bio() without the map lock held, leads to a race between zone allocation and dmz_should_reclaim() result. Depending on the workload applied, this race can lead to the write path waiting forever for a free zone without reclaim being triggered. Fix this by moving dmz_schedule_reclaim() inside dmz_alloc_zone() under the map lock. This results in checking the need for zone reclaim whenever a new data or buffer zone needs to be allocated. Also fix dmz_reclaim_percentage() to always return 0 if the number of unmapped cache (or random) zones is less than or equal to 1. Suggested-by: Shin'ichiro Kawasaki Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit bcf003be750a888a002f909b1043e43ac6997e2d Merge: 76ea60f77161 38b1927e5bf9 Author: Greg Kroah-Hartman Date: Wed Jul 8 18:00:07 2020 +0200 Merge tag 'phy-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-next Vinod writes: phy: fixes for 5.8 *) Fix for intel combo driver for warns or errors *) Constify symbols for am654-serdes & j721e-wiz *) Return value fix for rockchip driver *) Null pointer dereference fix for sun4i-usb * tag 'phy-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked phy: rockchip: Fix return value of inno_dsidphy_probe() phy: ti: j721e-wiz: Constify structs phy: ti: am654-serdes: Constify regmap_config phy: intel: fix enum type mismatch warning phy: intel: Fix compilation error on FIELD_PREP usage commit 76ea60f771615d32c0c5caed81991b25a87e0137 Merge: bf12fdf0ab72 bf6d6e68d202 Author: Greg Kroah-Hartman Date: Wed Jul 8 17:59:14 2020 +0200 Merge tag 'soundwire-5.8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char--misc-linus Vinod writes: soundwire fixes for v5.8 - Intel driver memory leak fix * tag 'soundwire-5.8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: intel: fix memory leak with devm_kasprintf commit ce34c9b461b50001892b0b348e024d2275014ede Author: Wei Yongjun Date: Thu Jul 2 23:11:40 2020 +0800 dm zoned: fix unused but set variable warnings Fix unused but set variable warnings: drivers/md/dm-zoned-reclaim.c:504:42: warning: variable nr_rnd set but not used [-Wunused-but-set-variable] 504 | unsigned int p_unmap, nr_unmap_rnd = 0, nr_rnd = 0; | ^~~~~~ drivers/md/dm-zoned-reclaim.c:504:24: warning: variable nr_unmap_rnd set but not used [-Wunused-but-set-variable] 504 | unsigned int p_unmap, nr_unmap_rnd = 0, nr_rnd = 0; | ^~~~~~~~~~~~ Fixes: f97809aec589 ("dm zoned: per-device reclaim") Signed-off-by: Wei Yongjun Signed-off-by: Mike Snitzer commit af3cf0ac6805a36740089a5f200c28a04d452404 Merge: 876d4e1e8298 da6902e5b6db Author: Greg Kroah-Hartman Date: Wed Jul 8 17:10:17 2020 +0200 Merge tag 'usb-serial-5.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.8-rc5 Here are some new device ids for 5.8. All have been in linux-next with no reported issues. * tag 'usb-serial-5.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Quectel EG95 LTE modem USB: serial: ch341: add new Product ID for CH340 USB: serial: option: add GosunCn GM500 series USB: serial: cypress_m8: enable Simply Automated UPB PIM commit a46624580376a3a0beb218d94cbc7f258696e29f Author: Michal Suchanek Date: Tue Jun 30 17:49:24 2020 +0200 dm writecache: reject asynchronous pmem devices DM writecache does not handle asynchronous pmem. Reject it when supplied as cache. Link: https://lore.kernel.org/linux-nvdimm/87lfk5hahc.fsf@linux.ibm.com/ Fixes: 6e84200c0a29 ("virtio-pmem: Add virtio pmem driver") Signed-off-by: Michal Suchanek Acked-by: Mikulas Patocka Cc: stable@vger.kernel.org # 5.3+ Signed-off-by: Mike Snitzer commit 382761dc6312965a11f82f2217e16ec421bf17ae Author: Christoph Hellwig Date: Sat Jun 27 09:31:46 2020 +0200 dm: use bio_uninit instead of bio_disassociate_blkg bio_uninit is the proper API to clean up a BIO that has been allocated on stack or inside a structure that doesn't come from the BIO allocator. Switch dm to use that instead of bio_disassociate_blkg, which really is an implementation detail. Note that the bio_uninit calls are also moved to the two callers of __send_empty_flush, so that they better pair with the bio_init calls used to initialize them. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Mike Snitzer commit 443a34ba68e8a627c15f9987b11cfa01f3e1ba0a Author: Pierre-Louis Bossart Date: Tue Jul 7 15:26:28 2020 -0500 regmap: add missing dependency on SoundWire CONFIG_REGMAP is not selected when no other serial bus is supported. It's largely academic since CONFIG_I2C is usually selected e.g. by DRM, but still this can break randconfig so let's be explicit. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200707202628.113142-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 37d65a26c9630af5263039dc36bedf878b5680cf Merge: 1e9c7ce7ad82 4e7f8cac1171 Author: Mark Brown Date: Wed Jul 8 15:02:06 2020 +0100 Merge series "ASoC: more fixes for dpcm checks" from Pierre-Louis Bossart : This is hopefully the last set of fixes to avoid probe errors due to stricter checks of DAI capabilities introduced late in the 5.8 cycle. Daniel Baluta (1): ASoC: SOF: imx: add min/max channels for SAI/ESAI on i.MX8/i.MX8M Pierre-Louis Bossart (2): ASoC: soc-dai: set dai_link dpcm_ flags with a helper ASoC: Intel: bdw-rt5677: fix non BE conversion include/sound/soc-dai.h | 1 + sound/soc/generic/audio-graph-card.c | 4 +-- sound/soc/generic/simple-card.c | 4 +-- sound/soc/intel/boards/bdw-rt5677.c | 1 + sound/soc/soc-dai.c | 38 ++++++++++++++++++++++++++++ sound/soc/sof/imx/imx8.c | 8 ++++++ sound/soc/sof/imx/imx8m.c | 8 ++++++ 7 files changed, 60 insertions(+), 4 deletions(-) base-commit: a5911ac5790acaf98c929b826b3f7b4a438f9759 -- 2.25.1 commit 1e9c7ce7ad829f901549547a83fc7130ae9d3379 Merge: 5f886d7d2c06 8edac489e7c3 Author: Mark Brown Date: Wed Jul 8 15:02:04 2020 +0100 Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis Bossart : While experimenting and introducing errors in Baytrail topology files until I got them right, I encountered multiple kernel oopses and memory leaks. This is a first batch to harden the code, but we should probably think of a tool to fuzz the topology... Pierre-Louis Bossart (5): ASoC: topology: fix kernel oops on route addition error ASoC: topology: fix tlvs in error handling for widget_dmixer ASoC: topology: use break on errors, not continue ASoC: topology: factor kfree(se) in error handling ASoC: topology: add more logs when topology load fails. sound/soc/soc-topology.c | 97 ++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 39 deletions(-) base-commit: a5911ac5790acaf98c929b826b3f7b4a438f9759 -- 2.25.1 commit 5f886d7d2c06a06650d41c37a02257c55f23a10e Merge: eceb5437ed0d 0fd3935ef888 Author: Mark Brown Date: Wed Jul 8 15:02:03 2020 +0100 Merge series "ASoC: codecs: add MAX98373 Soundwire driver" from Pierre-Louis Bossart : V2 with a number of cleanups: split between I2C and SoundWire modes, as done for rt5682, and updated Kconfigs. removed useless initializations common to both modes removed idle_bias on fixed register classified as volatile in error fixed SPDX comments Pierre-Louis Bossart (2): ASoC: codecs: max98373: split I2C and common parts ASoC: Intel: sof-sdw: add MAX98373 I2C dependencies Ryan Lee (2): ASoC: codecs: max98373: Removed superfluous volume control from chip default ASoC: codecs: max98373: add SoundWire support randerwang (2): ASoc: codecs: max98373: remove Idle_bias_on to let codec suspend ASoC: Intel: sdw_max98373: add card_late_probe support sound/soc/codecs/Kconfig | 20 +- sound/soc/codecs/Makefile | 4 + sound/soc/codecs/max98373-i2c.c | 612 +++++++++++++++ sound/soc/codecs/max98373-sdw.c | 887 ++++++++++++++++++++++ sound/soc/codecs/max98373-sdw.h | 72 ++ sound/soc/codecs/max98373.c | 619 +-------------- sound/soc/codecs/max98373.h | 17 +- sound/soc/intel/boards/Kconfig | 7 +- sound/soc/intel/boards/sof_sdw.c | 19 +- sound/soc/intel/boards/sof_sdw_common.h | 6 + sound/soc/intel/boards/sof_sdw_max98373.c | 12 + 11 files changed, 1668 insertions(+), 607 deletions(-) create mode 100644 sound/soc/codecs/max98373-i2c.c create mode 100644 sound/soc/codecs/max98373-sdw.c create mode 100644 sound/soc/codecs/max98373-sdw.h base-commit: a5911ac5790acaf98c929b826b3f7b4a438f9759 -- 2.25.1 commit eceb5437ed0d41be5d12af3add58b3be2d5719e5 Author: Ranjani Sridharan Date: Tue Jul 7 15:40:27 2020 -0500 ASoC: SOF: core: fix null-ptr-deref bug during device removal The DSP should be notified for device removal only if the probe was successful. Fixes the following KASAN bug: BUG: KASAN: null-ptr-deref in sof_ipc_tx_message+0x80/0x160 [snd_sof] Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200707204027.114169-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0fd3935ef888b7231fde87eba3fdf613c4923b4a Author: randerwang Date: Tue Jul 7 15:57:37 2020 -0500 ASoc: codecs: max98373: remove Idle_bias_on to let codec suspend Idle_bias_on is used to decide bias on/off in standby state by dapm. When Idle_bias_on is set to one, dapm will keep max98373 active at idle time. Max98373 is doing nothing in this state, so remove idle_bias_on setting to let max98373 get suspended when it is idle. Signed-off-by: randerwang Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ryan Lee Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200707205740.114927-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a53bacc04d7e2b813ebe0ca4dae38716c00d7953 Author: Ryan Lee Date: Tue Jul 7 15:57:36 2020 -0500 ASoC: codecs: max98373: Removed superfluous volume control from chip default Volume control in probe function is not necessary. Signed-off-by: Ryan Lee Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200707205740.114927-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3ec2d5113ea5e182b759b613dc1f7108ba7aac9e Author: Veerabhadrarao Badiganti Date: Wed Jul 8 18:41:19 2020 +0530 mmc: sdhci-msm: Override DLL_CONFIG only if the valid value is supplied During DLL initialization, the DLL_CONFIG register value would be updated with the value supplied from the device-tree. Override this register only if a valid value is supplied. Fixes: 03591160ca19 ("mmc: sdhci-msm: Read and use DLL Config property from device tree file") Signed-off-by: Veerabhadrarao Badiganti Link: https://lore.kernel.org/r/1594213888-2780-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson commit 8edac489e7c3fce44208373bb3e7b5835a672c66 Author: Pierre-Louis Bossart Date: Tue Jul 7 15:37:46 2020 -0500 ASoC: topology: fix tlvs in error handling for widget_dmixer we need to free all allocated tlvs, not just the one allocated in the loop before releasing kcontrols - other the tlvs references will leak. Fixes: 9f90af3a995298 ('ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200707203749.113883-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 6f0307df83f2aa6bdf656c2219c89ce96502d20e Author: Pierre-Louis Bossart Date: Tue Jul 7 15:37:45 2020 -0500 ASoC: topology: fix kernel oops on route addition error When errors happens while loading graph components, the kernel oopses while trying to remove all topology components. This can be root-caused to a list pointing to memory that was already freed on error. remove_route() is already called on errors and will perform the required cleanups so there's no need to free the route memory in soc_tplg_dapm_graph_elems_load() if the route was added to the list. We do however want to free the routes allocated but not added to the list. Fixes: 7df04ea7a31ea ('ASoC: topology: modify dapm route loading routine and add dapm route unloading') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200707203749.113883-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 4e7f8cac1171ba369a9209a8d949732a4d3b939a Author: Daniel Baluta Date: Tue Jul 7 16:04:39 2020 -0500 ASoC: SOF: imx: add min/max channels for SAI/ESAI on i.MX8/i.MX8M This is identical with change for Intel platforms done with commit 8c05246c0b58 ("ASoC: SOF: Intel: add min/max channels for SSP on Baytrail/Broadwell") and fixes a regression on i.MX8/i.MX8M: [ 25.705750] esai-Codec: ASoC: no backend playback stream [ 27.923378] esai-Codec: ASoC: no users playback at close - state This is root-caused to the introduction of the DAI capability checks with snd_soc_dai_stream_valid(). Its use in soc-pcm.c makes it a requirement for all DAIs to report at least a non-zero min_channels field. Fixes: 9b5db059366ae2 ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") Signed-off-by: Daniel Baluta Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200707210439.115300-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fffebe8a8339c7e56db4126653a3bc0c0c5592cf Author: Pierre-Louis Bossart Date: Tue Jul 7 16:04:38 2020 -0500 ASoC: Intel: bdw-rt5677: fix non BE conversion When SOF is used, the normal links are converted into DPCM ones. This generates an error [ 58.276668] bdw-rt5677 bdw-rt5677: CPU DAI spi-RT5677AA:00 for rtd Wake on Voice does not support playback [ 58.276676] bdw-rt5677 bdw-rt5677: ASoC: can't create pcm Wake on Voice :-22 Fix by forcing the capture direction. Fixes: b73287f0b0745 ('ASoC: soc-pcm: dpcm: fix playback/capture checks') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Curtis Malainey Link: https://lore.kernel.org/r/20200707210439.115300-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 25612477d20b522a3203707ff23575b99f639fff Author: Pierre-Louis Bossart Date: Tue Jul 7 16:04:37 2020 -0500 ASoC: soc-dai: set dai_link dpcm_ flags with a helper Add a helper to walk through all the DAIs and set dpcm_playback and dpcm_capture flags based on the DAIs capabilities, and use this helper to avoid setting these flags arbitrarily in generic cards. The commit referenced in the Fixes tag did not introduce the configuration issue but will prevent the card from probing when detecting invalid configurations. Fixes: b73287f0b0745 ('ASoC: soc-pcm: dpcm: fix playback/capture checks') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200707210439.115300-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 04340645f69ab7abb6f9052688a60f0213b3f79c Author: Kamal Heib Date: Tue Jul 7 16:09:31 2020 +0300 RDMA/siw: Fix reporting vendor_part_id Move the initialization of the vendor_part_id to be before calling ib_register_device(), this is needed because the query_device() callback is called from the context of ib_register_device() before initializing the vendor_part_id, so the reported value is wrong. Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface") Link: https://lore.kernel.org/r/20200707130931.444724-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Reviewed-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit 4557ac6b344b8cdf948ff8b007e8e1de34832f2e Author: Nicholas Piggin Date: Wed Jul 8 17:49:42 2020 +1000 powerpc/64s/exception: Fix 0x1500 interrupt handler crash A typo caused the interrupt handler to branch immediately to the common "unknown interrupt" handler and skip the special case test for denormal cause. This does not affect KVM softpatch handling (e.g., for POWER9 TM assist) because the KVM test was moved to common code by commit 9600f261acaa ("powerpc/64s/exception: Move KVM test to common code") just before this bug was introduced. Fixes: 3f7fbd97d07d ("powerpc/64s/exception: Clean up SRR specifiers") Reported-by: Paul Menzel Signed-off-by: Nicholas Piggin Tested-by: Paul Menzel [mpe: Split selftest into a separate patch] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200708074942.1713396-1-npiggin@gmail.com commit ce3614daabea8a2d01c1dd17ae41d1ec5e5ae7db Author: Mathieu Desnoyers Date: Mon Jul 6 16:49:10 2020 -0400 sched: Fix unreliable rseq cpu_id for new tasks While integrating rseq into glibc and replacing glibc's sched_getcpu implementation with rseq, glibc's tests discovered an issue with incorrect __rseq_abi.cpu_id field value right after the first time a newly created process issues sched_setaffinity. For the records, it triggers after building glibc and running tests, and then issuing: for x in {1..2000} ; do posix/tst-affinity-static & done and shows up as: error: Unexpected CPU 2, expected 0 error: Unexpected CPU 2, expected 0 error: Unexpected CPU 2, expected 0 error: Unexpected CPU 2, expected 0 error: Unexpected CPU 138, expected 0 error: Unexpected CPU 138, expected 0 error: Unexpected CPU 138, expected 0 error: Unexpected CPU 138, expected 0 This is caused by the scheduler invoking __set_task_cpu() directly from sched_fork() and wake_up_new_task(), thus bypassing rseq_migrate() which is done by set_task_cpu(). Add the missing rseq_migrate() to both functions. The only other direct use of __set_task_cpu() is done by init_idle(), which does not involve a user-space task. Based on my testing with the glibc test-case, just adding rseq_migrate() to wake_up_new_task() is sufficient to fix the observed issue. Also add it to sched_fork() to keep things consistent. The reason why this never triggered so far with the rseq/basic_test selftest is unclear. The current use of sched_getcpu(3) does not typically require it to be always accurate. However, use of the __rseq_abi.cpu_id field within rseq critical sections requires it to be accurate. If it is not accurate, it can cause corruption in the per-cpu data targeted by rseq critical sections in user-space. Reported-By: Florian Weimer Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Tested-By: Florian Weimer Cc: stable@vger.kernel.org # v4.18+ Link: https://lkml.kernel.org/r/20200707201505.2632-1-mathieu.desnoyers@efficios.com commit dbfb089d360b1cc623c51a2c7cf9b99eff78e0e7 Author: Peter Zijlstra Date: Fri Jul 3 12:40:33 2020 +0200 sched: Fix loadavg accounting race The recent commit: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") moved these lines in ttwu(): p->sched_contributes_to_load = !!task_contributes_to_load(p); p->state = TASK_WAKING; up before: smp_cond_load_acquire(&p->on_cpu, !VAL); into the 'p->on_rq == 0' block, with the thinking that once we hit schedule() the current task cannot change it's ->state anymore. And while this is true, it is both incorrect and flawed. It is incorrect in that we need at least an ACQUIRE on 'p->on_rq == 0' to avoid weak hardware from re-ordering things for us. This can fairly easily be achieved by relying on the control-dependency already in place. The second problem, which makes the flaw in the original argument, is that while schedule() will not change prev->state, it will read it a number of times (arguably too many times since it's marked volatile). The previous condition 'p->on_cpu == 0' was sufficient because that indicates schedule() has completed, and will no longer read prev->state. So now the trick is to make this same true for the (much) earlier 'prev->on_rq == 0' case. Furthermore, in order to make the ordering stick, the 'prev->on_rq = 0' assignment needs to he a RELEASE, but adding additional ordering to schedule() is an unwelcome proposition at the best of times, doubly so for mere accounting. Luckily we can push the prev->state load up before rq->lock, with the only caveat that we then have to re-read the state after. However, we know that if it changed, we no longer have to worry about the blocking path. This gives us the required ordering, if we block, we did the prev->state load before an (effective) smp_mb() and the p->on_rq store needs not change. With this we end up with the effective ordering: LOAD p->state LOAD-ACQUIRE p->on_rq == 0 MB STORE p->on_rq, 0 STORE p->state, TASK_WAKING which ensures the TASK_WAKING store happens after the prev->state load, and all is well again. Fixes: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") Reported-by: Dave Jones Reported-by: Paul Gortmaker Signed-off-by: Peter Zijlstra (Intel) Tested-by: Dave Jones Tested-by: Paul Gortmaker Link: https://lkml.kernel.org/r/20200707102957.GN117543@hirez.programming.kicks-ass.net commit 00debf8109e5fad3db31375be2a3c515e1461b4a Author: Zenghui Yu Date: Mon Jul 6 22:47:13 2020 +0800 drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat The HiSilicon hibmc driver triggers a splat at boot time as below [ 14.137806] ------------[ cut here ]------------ [ 14.142405] hibmc-drm 0000:0a:00.0: Device has not been registered. [ 14.148661] WARNING: CPU: 0 PID: 496 at drivers/gpu/drm/drm_fb_helper.c:2233 drm_fbdev_generic_setup+0x15c/0x1b8 [ 14.158787] [...] [ 14.278307] Call trace: [ 14.280742] drm_fbdev_generic_setup+0x15c/0x1b8 [ 14.285337] hibmc_pci_probe+0x354/0x418 [ 14.289242] local_pci_probe+0x44/0x98 [ 14.292974] work_for_cpu_fn+0x20/0x30 [ 14.296708] process_one_work+0x1c4/0x4e0 [ 14.300698] worker_thread+0x2c8/0x528 [ 14.304431] kthread+0x138/0x140 [ 14.307646] ret_from_fork+0x10/0x18 [ 14.311205] ---[ end trace a2000ec2d838af4d ]--- This turned out to be due to the fbdev device hasn't been registered when drm_fbdev_generic_setup() is invoked. Let's fix the splat by moving it down after drm_dev_register() which will follow the "Display driver example" documented by commit de99f0600a79 ("drm/drv: DOC: Add driver example code"). Signed-off-by: Zenghui Yu Reviewed-by: Thomas Zimmermann Signed-off-by: Xinliang Liu Link: https://patchwork.freedesktop.org/patch/msgid/20200706144713.1123-1-yuzenghui@huawei.com commit 8668115cf2db40e22e7be02652a3673d8d30c9f0 Author: Steve French Date: Tue Jul 7 23:43:39 2020 -0500 smb3: fix unneeded error message on change notify We should not be logging a warning repeatedly on change notify. CC: Stable # v5.6+ Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 617894cd848f592fa84d7cf561dc80929afc66ff Merge: 9ebcfadb0610 b0536f9826a5 Author: Greg Kroah-Hartman Date: Wed Jul 8 09:20:50 2020 +0200 Merge tag 'iio-fixes-for-5.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First set of IIO and counter fixes in the 5.8 cycle. The buffer alignment fixes continue to trickle through as we get reviews in. The rest are the standard mixed bag of long term issues just discovered an things we missed in this cycle. IIO fixes * core - Add missing IIO_MOD_H2 and ETHANOL strings. Somehow got missed when drivers were added using these in attribute names. * afe4403, afe4404, ak8974, hdc100x, hts221, ms5611 - Fix a recently identified issue with alignment when using iio_push_to_buffers_with_timestamp which assumes the timestamp is 8 byte aligned. * ad7780 - Fix a some premature / excess cleanup in an error path. * adi-axi-adc - Fix reference counting on the wrong object. * ak8974 - Fix unbalance runtime pm. * mma8452 - Fix missing iio_device_unregister in error path. * zp2326 - Error handling for pm_runtime_get_sync failing. counter fixes * Add lock guards in 104-quad-8 to protect against races - done in 2 patches to allow easy back porting. * tag 'iio-fixes-for-5.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()' iio:pressure:ms5611 Fix buffer element alignment iio:humidity:hts221 Fix alignment and data leak issues iio:humidity:hdc100x Fix alignment and data leak issues iio:magnetometer:ak8974: Fix alignment and data leak issues iio: adc: adi-axi-adc: Fix object reference counting iio: pressure: zpa2326: handle pm_runtime_get_sync failure counter: 104-quad-8: Add lock guards - filter clock prescaler counter: 104-quad-8: Add lock guards - differential encoder iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers iio: magnetometer: ak8974: Fix runtime PM imbalance on error iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe() iio:health:afe4404 Fix timestamp alignment and prevent data leak. iio:health:afe4403 Fix timestamp alignment and prevent data leak. commit ee769ebbe9e5fc7219e979fb7c5ed5bb5722649e Author: Xu Wang Date: Wed Jul 8 06:20:23 2020 +0000 xtensa: simplify xtensa_pmu_irq_handler Use for_each_set_bit() instead of open-coding it to simplify the code. Signed-off-by: Xu Wang Message-Id: <20200708062023.7986-1-vulab@iscas.ac.cn> Signed-off-by: Max Filippov commit 775802c0571fb438cd4f6548a323f9e4cb89f5aa Author: Christoph Hellwig Date: Fri May 8 11:17:46 2020 +0200 fs: remove __vfs_read Fold it into the two callers. Signed-off-by: Christoph Hellwig commit 6209dd9132e8ea5545cffc84483841e88ea8cc5b Author: Christoph Hellwig Date: Fri May 8 09:00:28 2020 +0200 fs: implement kernel_read using __kernel_read Consolidate the two in-kernel read helpers to make upcoming changes easier. The only difference are the missing call to rw_verify_area in kernel_read, and an access_ok check that doesn't make sense for kernel buffers to start with. Signed-off-by: Christoph Hellwig commit a1f9b1c0439db47ea10418b8ee7092a0d970cc2d Author: Christoph Hellwig Date: Fri May 8 08:54:27 2020 +0200 integrity/ima: switch to using __kernel_read __kernel_read has a bunch of additional sanity checks, and this moves the set_fs out of non-core code. Signed-off-by: Christoph Hellwig commit 61a707c543e2afe3aa7e88f87267c5dafa4b5afa Author: Christoph Hellwig Date: Fri May 8 08:54:16 2020 +0200 fs: add a __kernel_read helper This is the counterpart to __kernel_write, and skip the rw_verify_area call compared to kernel_read. Signed-off-by: Christoph Hellwig commit 53ad86266bda973b526078227997ca3fcb92c9be Author: Christoph Hellwig Date: Wed May 13 08:51:46 2020 +0200 fs: remove __vfs_write Fold it into the two callers. Signed-off-by: Christoph Hellwig commit 81238b2cff1469ff5b94390d026cd075105d6dcd Author: Christoph Hellwig Date: Thu May 7 19:33:03 2020 +0200 fs: implement kernel_write using __kernel_write Consolidate the two in-kernel write helpers to make upcoming changes easier. The only difference are the missing call to rw_verify_area in kernel_write, and an access_ok check that doesn't make sense for kernel buffers to start with. Signed-off-by: Christoph Hellwig commit a01ac27be4729f80176a45c54611b768dfbdc840 Author: Christoph Hellwig Date: Fri May 8 08:55:03 2020 +0200 fs: check FMODE_WRITE in __kernel_write Add a WARN_ON_ONCE if the file isn't actually open for write. This matches the check done in vfs_write, but actually warn warns as a kernel user calling write on a file not opened for writing is a pretty obvious programming error. Signed-off-by: Christoph Hellwig commit 9db97752244919c604eb21df7ef2da3bf58aec73 Author: Christoph Hellwig Date: Wed May 13 08:47:17 2020 +0200 fs: unexport __kernel_write This is a very special interface that skips sb_writes protection, and not used by modules anymore. Signed-off-by: Christoph Hellwig commit 6955a76fbcd56d27c84c01353101048e366d070f Author: Christoph Hellwig Date: Wed May 13 08:46:58 2020 +0200 bpfilter: switch to kernel_write While pipes don't really need sb_writers projection, __kernel_write is an interface better kept private, and the additional rw_verify_area does not hurt here. Signed-off-by: Christoph Hellwig commit 13c164b1a186dfe17d104d9638b86a06be1e40bf Author: Christoph Hellwig Date: Wed May 13 08:45:59 2020 +0200 autofs: switch to kernel_write While pipes don't really need sb_writers projection, __kernel_write is an interface better kept private, and the additional rw_verify_area does not hurt here. Signed-off-by: Christoph Hellwig Acked-by: Ian Kent commit 97c7990c4bf6423578f5b7317027ff8b6fb7cdf6 Author: Christoph Hellwig Date: Wed May 13 08:42:36 2020 +0200 cachefiles: switch to kernel_write __kernel_write doesn't take a sb_writers references, which we need here. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells commit e094fd346021b820f37188aaa6b502c7490ab5b5 Author: Steve Schremmer Date: Tue Jul 7 17:07:22 2020 +0000 scsi: dh: Add Fujitsu device to devinfo and dh lists Add FUJITSU ETERNUS_AHB Link: https://lore.kernel.org/r/DM6PR06MB5276CCA765336BD312C4282E8C660@DM6PR06MB5276.namprd06.prod.outlook.com Signed-off-by: Steve Schremmer Signed-off-by: Martin K. Petersen commit 2e98c01846b2ce96cc41f60b70fd03cd47d3ac77 Author: yangerkun Date: Thu Jul 2 15:25:26 2020 +0800 cifs: remove the retry in cifs_poxis_lock_set The caller of cifs_posix_lock_set will do retry(like fcntl_setlk64->do_lock_file_wait) if we will wait for any file_lock. So the retry in cifs_poxis_lock_set seems duplicated, remove it to make a cleanup. Signed-off-by: yangerkun Signed-off-by: Steve French Reviewed-by: NeilBrown commit 0fd181456aa0826057adbfb6c79c40f4083cfd75 Author: Johannes Thumshirn Date: Wed Jul 1 22:14:54 2020 +0900 scsi: mpt3sas: Fix error returns in BRM_status_show BRM_status_show() has several error branches, but none of them record the error in the error return. Also while at it remove the manual mutex_unlock() of the pci_access_mutex in case of an ongoing pci error recovery or host removal and jump to the cleanup label instead. Note: We can safely jump to out from here as io_unit_pg3 is initialized to NULL and if it hasn't been allocated, kfree() skips the NULL pointer. [mkp: compilation warning] Link: https://lore.kernel.org/r/20200701131454.5255-1-johannes.thumshirn@wdc.com Reviewed-by: Damien Le Moal Acked-by: Sreekanth Reddy Signed-off-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit ed710a6ed797430026aa5116dd0ab22378798b69 Author: Ralph Campbell Date: Fri Jun 26 14:03:37 2020 -0700 drm/nouveau/nouveau: fix page fault on device private memory If system memory is migrated to device private memory and no GPU MMU page table entry exists, the GPU will fault and call hmm_range_fault() to get the PFN for the page. Since the .dev_private_owner pointer in struct hmm_range is not set, hmm_range_fault returns an error which results in the GPU program stopping with a fatal fault. Fix this by setting .dev_private_owner appropriately. Fixes: 08ddddda667b ("mm/hmm: check the device private page owner in hmm_range_fault()") Cc: stable@vger.kernel.org Signed-off-by: Ralph Campbell Reviewed-by: Jason Gunthorpe Signed-off-by: Ben Skeggs commit ad61f5f5e02e0aaf667efcd0c44ba5d70ea0b356 Author: Ralph Campbell Date: Mon Jun 22 16:38:52 2020 -0700 drm/nouveau/svm: fix migrate page regression The patch to add zero page migration to GPU memory inadvertently included part of a future change which broke normal page migration to GPU memory by copying too much data and corrupting GPU memory. Fix this by only copying one page instead of a byte count. Fixes: 9d4296a7d4b3 ("drm/nouveau/nouveau/hmm: fix migrate zero page to GPU") Signed-off-by: Ralph Campbell Reviewed-by: John Hubbard Signed-off-by: Ben Skeggs commit 0156e76d388310a490aeb0f2fbb5b284ded3aecc Author: Ben Skeggs Date: Tue Jun 23 16:39:13 2020 +1000 drm/nouveau/i2c/g94-: increase NV_PMGR_DP_AUXCTL_TRANSACTREQ timeout Tegra TRM says worst-case reply time is 1216us, and this should fix some spurious timeouts that have been popping up. Signed-off-by: Ben Skeggs commit 72923e24f98aa5d99adeb83b7b4f0ec1496e5b5e Author: Ben Skeggs Date: Wed Jun 17 11:08:41 2020 +1000 drm/nouveau/kms/nv50-: bail from nv50_audio_disable() early if audio not enabled Prevents "snd_hda_codec_hdmi hdaudioC1D0: HDMI: pin nid 5 not registered" that occur on some configurations. Signed-off-by: Ben Skeggs commit 5a383d443b29a140094430f3ad1d02fa1acc2b80 Author: Chris Wilson Date: Mon Jul 6 18:01:38 2020 +0100 drm/i915/gt: Pin the rings before marking active On eviction, we acquire the vm->mutex and then wait on the vma->active. Therefore when binding and pinning the vma, we must follow the same sequence, lock/pin the vma then mark it active. Otherwise, we mark the vma as active, then wait for the vm->mutex, and meanwhile the evictor holding the mutex waits upon us to complete our activity. Fixes: 8ccfc20a7d56 ("drm/i915/gt: Mark ring->vma as active while pinned") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.6+ Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200706170138.8993-1-chris@chris-wilson.co.uk (cherry picked from commit 8567774e87e23a57155e5102f81208729b992ae6) Signed-off-by: Rodrigo Vivi commit 4ef9b4f1a76ea2370fbfe20e80fef141ab92b65e Author: Steve French Date: Tue Jul 7 18:08:46 2020 -0500 smb3: fix access denied on change notify request to some servers read permission, not just read attributes permission, is required on the directory. See MS-SMB2 (protocol specification) section 3.3.5.19. Signed-off-by: Steve French CC: Stable # v5.6+ Reviewed-by: Pavel Shilovsky commit 086c18f2452d0028f81e319f098bcb8e53133dbf Author: Shannon Nelson Date: Tue Jul 7 14:13:26 2020 -0700 ionic: centralize queue reset code The queue reset pattern is used in a couple different places, only slightly different from each other, and could cause issues if one gets changed and the other didn't. This puts them together so that only one version is needed, yet each can have slighty different effects by passing in a pointer to a work function to do whatever configuration twiddling is needed in the middle of the reset. This specifically addresses issues seen where under loops of changing ring size or queue count parameters we could occasionally bump into the netdev watchdog. v2: added more commit message commentary Fixes: 4d03e00a2140 ("ionic: Add initial ethtool support") Signed-off-by: Shannon Nelson Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 469aceddfa3ed16e17ee30533fae45e90f62efd8 Author: Toke Høiland-Jørgensen Date: Tue Jul 7 13:03:25 2020 +0200 vlan: consolidate VLAN parsing code and limit max parsing depth Toshiaki pointed out that we now have two very similar functions to extract the L3 protocol number in the presence of VLAN tags. And Daniel pointed out that the unbounded parsing loop makes it possible for maliciously crafted packets to loop through potentially hundreds of tags. Fix both of these issues by consolidating the two parsing functions and limiting the VLAN tag parsing to a max depth of 8 tags. As part of this, switch over __vlan_get_protocol() to use skb_header_pointer() instead of pskb_may_pull(), to avoid the possible side effects of the latter and keep the skb pointer 'const' through all the parsing functions. v2: - Use limit of 8 tags instead of 32 (matching XMIT_RECURSION_LIMIT) Reported-by: Toshiaki Makita Reported-by: Daniel Borkmann Fixes: d7bf2ebebc2b ("sched: consistently handle layer3 header accesses in the presence of VLANs") Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit da3287111ab43b32cec54d7ca6b48640f210a196 Author: Alexander Lobakin Date: Mon Jul 6 12:25:53 2020 +0300 net: qed: fix buffer overflow on ethtool -d When generating debug dump, driver firstly collects all data in binary form, and then performs per-feature formatting to human-readable if it is supported. For ethtool -d, this is roughly incorrect for two reasons. First of all, drivers should always provide only original raw dumps to Ethtool without any changes. The second, and more critical, is that Ethtool's output buffer size is strictly determined by ethtool_ops::get_regs_len(), and all data *must* fit in it. The current version of driver always returns the size of raw data, but the size of the formatted buffer exceeds it in most cases. This leads to out-of-bound writes and memory corruption. Address both issues by adding an option to return original, non-formatted debug data, and using it for Ethtool case. v2: - Expand commit message to make it more clear; - No functional changes. Fixes: c965db444629 ("qed: Add support for debug data collection") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit dcde237b9b0eb1d19306e6f48c0a4e058907619f Merge: 6d12075ddeed bee9ca1c8a23 Author: Linus Torvalds Date: Tue Jul 7 15:38:53 2020 -0700 Merge tag 'perf-tools-fixes-2020-07-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tooling fixes from Arnaldo Carvalho de Melo: - Intel PT fixes for PEBS-via-PT with registers - Fixes for Intel PT python based GUI - Avoid duplicated sideband events with Intel PT in system wide tracing - Remove needless 'dummy' event from TUI menu, used when synthesizing meta data events for pre-existing processes - Fix corner case segfault when pressing enter in a screen without entries in the TUI for report/top - Fixes for time stamp handling in libtraceevent - Explicitly set utf-8 encoding in perf flamegraph - Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy', silencing perf build warning * tag 'perf-tools-fixes-2020-07-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf report TUI: Remove needless 'dummy' event from menu perf intel-pt: Fix PEBS sample for XMM registers perf intel-pt: Fix displaying PEBS-via-PT with registers perf intel-pt: Fix recording PEBS-via-PT with registers perf report TUI: Fix segmentation fault in perf_evsel__hists_browse() tools lib traceevent: Add proper KBUFFER_TYPE_TIME_STAMP handling tools lib traceevent: Add API to read time information from kbuffer perf scripts python: exported-sql-viewer.py: Fix time chart call tree perf scripts python: exported-sql-viewer.py: Fix zero id in call tree 'Find' result perf scripts python: exported-sql-viewer.py: Fix zero id in call graph 'Find' result perf scripts python: exported-sql-viewer.py: Fix unexpanded 'Find' result perf record: Fix duplicated sideband events with Intel PT system wide tracing perf scripts python: export-to-postgresql.py: Fix struct.pack() int argument tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' perf flamegraph: Explicitly set utf-8 encoding commit 5fc6266af7b427243da24f3443a50cd4584aac06 Author: Linus Lüssing Date: Sun Jul 5 21:10:17 2020 +0200 bridge: mcast: Fix MLD2 Report IPv6 payload length check Commit e57f61858b7c ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling") introduced a bug in the IPv6 header payload length check which would potentially lead to rejecting a valid MLD2 Report: The check needs to take into account the 2 bytes for the "Number of Sources" field in the "Multicast Address Record" before reading it. And not the size of a pointer to this field. Fixes: e57f61858b7c ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling") Acked-by: Nikolay Aleksandrov Signed-off-by: Linus Lüssing Signed-off-by: David S. Miller commit 394de110a73395de2ca4516b0de435e91b11b604 Author: Martin Varghese Date: Sun Jul 5 14:23:49 2020 +0530 net: Added pointer check for dst->ops->neigh_lookup in dst_neigh_lookup_skb The packets from tunnel devices (eg bareudp) may have only metadata in the dst pointer of skb. Hence a pointer check of neigh_lookup is needed in dst_neigh_lookup_skb Kernel crashes when packets from bareudp device is processed in the kernel neighbour subsytem. [ 133.384484] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 133.385240] #PF: supervisor instruction fetch in kernel mode [ 133.385828] #PF: error_code(0x0010) - not-present page [ 133.386603] PGD 0 P4D 0 [ 133.386875] Oops: 0010 [#1] SMP PTI [ 133.387275] CPU: 0 PID: 5045 Comm: ping Tainted: G W 5.8.0-rc2+ #15 [ 133.388052] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 [ 133.391076] RIP: 0010:0x0 [ 133.392401] Code: Bad RIP value. [ 133.394029] RSP: 0018:ffffb79980003d50 EFLAGS: 00010246 [ 133.396656] RAX: 0000000080000102 RBX: ffff9de2fe0d6600 RCX: ffff9de2fe5e9d00 [ 133.399018] RDX: 0000000000000000 RSI: ffff9de2fe5e9d00 RDI: ffff9de2fc21b400 [ 133.399685] RBP: ffff9de2fe5e9d00 R08: 0000000000000000 R09: 0000000000000000 [ 133.400350] R10: ffff9de2fbc6be22 R11: ffff9de2fe0d6600 R12: ffff9de2fc21b400 [ 133.401010] R13: ffff9de2fe0d6628 R14: 0000000000000001 R15: 0000000000000003 [ 133.401667] FS: 00007fe014918740(0000) GS:ffff9de2fec00000(0000) knlGS:0000000000000000 [ 133.402412] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 133.402948] CR2: ffffffffffffffd6 CR3: 000000003bb72000 CR4: 00000000000006f0 [ 133.403611] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 133.404270] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 133.404933] Call Trace: [ 133.405169] [ 133.405367] __neigh_update+0x5a4/0x8f0 [ 133.405734] arp_process+0x294/0x820 [ 133.406076] ? __netif_receive_skb_core+0x866/0xe70 [ 133.406557] arp_rcv+0x129/0x1c0 [ 133.406882] __netif_receive_skb_one_core+0x95/0xb0 [ 133.407340] process_backlog+0xa7/0x150 [ 133.407705] net_rx_action+0x2af/0x420 [ 133.408457] __do_softirq+0xda/0x2a8 [ 133.408813] asm_call_on_stack+0x12/0x20 [ 133.409290] [ 133.409519] do_softirq_own_stack+0x39/0x50 [ 133.410036] do_softirq+0x50/0x60 [ 133.410401] __local_bh_enable_ip+0x50/0x60 [ 133.410871] ip_finish_output2+0x195/0x530 [ 133.411288] ip_output+0x72/0xf0 [ 133.411673] ? __ip_finish_output+0x1f0/0x1f0 [ 133.412122] ip_send_skb+0x15/0x40 [ 133.412471] raw_sendmsg+0x853/0xab0 [ 133.412855] ? insert_pfn+0xfe/0x270 [ 133.413827] ? vvar_fault+0xec/0x190 [ 133.414772] sock_sendmsg+0x57/0x80 [ 133.415685] __sys_sendto+0xdc/0x160 [ 133.416605] ? syscall_trace_enter+0x1d4/0x2b0 [ 133.417679] ? __audit_syscall_exit+0x1d9/0x280 [ 133.418753] ? __prepare_exit_to_usermode+0x5d/0x1a0 [ 133.419819] __x64_sys_sendto+0x24/0x30 [ 133.420848] do_syscall_64+0x4d/0x90 [ 133.421768] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 133.422833] RIP: 0033:0x7fe013689c03 [ 133.423749] Code: Bad RIP value. [ 133.424624] RSP: 002b:00007ffc7288f418 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 133.425940] RAX: ffffffffffffffda RBX: 000056151fc63720 RCX: 00007fe013689c03 [ 133.427225] RDX: 0000000000000040 RSI: 000056151fc63720 RDI: 0000000000000003 [ 133.428481] RBP: 00007ffc72890b30 R08: 000056151fc60500 R09: 0000000000000010 [ 133.429757] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000040 [ 133.431041] R13: 000056151fc636e0 R14: 000056151fc616bc R15: 0000000000000080 [ 133.432481] Modules linked in: mpls_iptunnel act_mirred act_tunnel_key cls_flower sch_ingress veth mpls_router ip_tunnel bareudp ip6_udp_tunnel udp_tunnel macsec udp_diag inet_diag unix_diag af_packet_diag netlink_diag binfmt_misc xt_MASQUERADE iptable_nat xt_addrtype xt_conntrack nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter bridge stp llc ebtable_filter ebtables overlay ip6table_filter ip6_tables iptable_filter sunrpc ext4 mbcache jbd2 pcspkr i2c_piix4 virtio_balloon joydev ip_tables xfs libcrc32c ata_generic qxl pata_acpi drm_ttm_helper ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm ata_piix libata virtio_net net_failover virtio_console failover virtio_blk i2c_core virtio_pci virtio_ring serio_raw floppy virtio dm_mirror dm_region_hash dm_log dm_mod [ 133.444045] CR2: 0000000000000000 [ 133.445082] ---[ end trace f4aeee1958fd1638 ]--- [ 133.446236] RIP: 0010:0x0 [ 133.447180] Code: Bad RIP value. [ 133.448152] RSP: 0018:ffffb79980003d50 EFLAGS: 00010246 [ 133.449363] RAX: 0000000080000102 RBX: ffff9de2fe0d6600 RCX: ffff9de2fe5e9d00 [ 133.450835] RDX: 0000000000000000 RSI: ffff9de2fe5e9d00 RDI: ffff9de2fc21b400 [ 133.452237] RBP: ffff9de2fe5e9d00 R08: 0000000000000000 R09: 0000000000000000 [ 133.453722] R10: ffff9de2fbc6be22 R11: ffff9de2fe0d6600 R12: ffff9de2fc21b400 [ 133.455149] R13: ffff9de2fe0d6628 R14: 0000000000000001 R15: 0000000000000003 [ 133.456520] FS: 00007fe014918740(0000) GS:ffff9de2fec00000(0000) knlGS:0000000000000000 [ 133.458046] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 133.459342] CR2: ffffffffffffffd6 CR3: 000000003bb72000 CR4: 00000000000006f0 [ 133.460782] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 133.462240] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 133.463697] Kernel panic - not syncing: Fatal exception in interrupt [ 133.465226] Kernel Offset: 0xfa00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 133.467025] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- Fixes: aaa0c23cb901 ("Fix dst_neigh_lookup/dst_neigh_lookup_skb return value handling bug") Signed-off-by: Martin Varghese Signed-off-by: David S. Miller commit 8367b3ab6e9a26dec5d5d07ea3eae17a21035322 Author: wenxu Date: Sat Jul 4 15:42:47 2020 +0800 net/sched: act_ct: add miss tcf_lastuse_update. When tcf_ct_act execute the tcf_lastuse_update should be update or the used stats never update filter protocol ip pref 3 flower chain 0 filter protocol ip pref 3 flower chain 0 handle 0x1 eth_type ipv4 dst_ip 1.1.1.1 ip_flags frag/firstfrag skip_hw not_in_hw action order 1: ct zone 1 nat pipe index 1 ref 1 bind 1 installed 103 sec used 103 sec Action statistics: Sent 151500 bytes 101 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 cookie 4519c04dc64a1a295787aab13b6a50fb Signed-off-by: wenxu Signed-off-by: David S. Miller commit f0b594dfa47555d8d69e6865c882d65a9054cb81 Author: Sebastian Andrzej Siewior Date: Fri Jul 3 18:44:32 2020 +0200 net/mlx5e: Do not include rwlock.h directly rwlock.h should not be included directly. Instead linux/splinlock.h should be included. Including it directly will break the RT build. Fixes: 549c243e4e010 ("net/mlx5e: Extract neigh-specific code from en_rep.c to rep/neigh.c") Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Leon Romanovsky Acked-by: Saeed Mahameed Signed-off-by: David S. Miller commit 9c29e36152748fd623fcff6cc8f538550f9eeafc Author: Paolo Abeni Date: Fri Jul 3 18:06:04 2020 +0200 mptcp: fix DSS map generation on fin retransmission The RFC 8684 mandates that no-data DATA FIN packets should carry a DSS with 0 sequence number and data len equal to 1. Currently, on FIN retransmission we re-use the existing mapping; if the previous fin transmission was part of a partially acked data packet, we could end-up writing in the egress packet a non-compliant DSS. The above will be detected by a "Bad mapping" warning on the receiver side. This change addresses the issue explicitly checking for 0 len packet when adding the DATA_FIN option. Fixes: 6d0060f600ad ("mptcp: Write MPTCP DSS headers to outgoing data packets") Reported-by: syzbot+42a07faa5923cfaeb9c9@syzkaller.appspotmail.com Tested-by: Christoph Paasch Reviewed-by: Christoph Paasch Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 5eff06902394425c722f0a44d9545909a8800f79 Author: Sabrina Dubroca Date: Fri Jul 3 17:00:32 2020 +0200 ipv4: fill fl4_icmp_{type,code} in ping_v4_sendmsg IPv4 ping sockets don't set fl4.fl4_icmp_{type,code}, which leads to incomplete IPsec ACQUIRE messages being sent to userspace. Currently, both raw sockets and IPv6 ping sockets set those fields. Expected output of "ip xfrm monitor": acquire proto esp sel src 10.0.2.15/32 dst 8.8.8.8/32 proto icmp type 8 code 0 dev ens4 policy src 10.0.2.15/32 dst 8.8.8.8/32 Currently with ping sockets: acquire proto esp sel src 10.0.2.15/32 dst 8.8.8.8/32 proto icmp type 0 code 0 dev ens4 policy src 10.0.2.15/32 dst 8.8.8.8/32 The Libreswan test suite found this problem after Fedora changed the value for the sysctl net.ipv4.ping_group_range. Fixes: c319b4d76b9e ("net: ipv4: add IPPROTO_ICMP socket kind") Reported-by: Paul Wouters Tested-by: Paul Wouters Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 7cdaa4cc4bdfa252d515b307863f5a1972246dd6 Author: Tobias Waldekranz Date: Fri Jul 3 16:10:58 2020 +0200 net: ethernet: fec: prevent tx starvation under high rx load In the ISR, we poll the event register for the queues in need of service and then enter polled mode. After this point, the event register will never be read again until we exit polled mode. In a scenario where a UDP flow is routed back out through the same interface, i.e. "router-on-a-stick" we'll typically only see an rx queue event initially. Once we start to process the incoming flow we'll be locked polled mode, but we'll never clean the tx rings since that event is never caught. Eventually the netdev watchdog will trip, causing all buffers to be dropped and then the process starts over again. Rework the NAPI poll to keep trying to consome the entire budget as long as new events are coming in, making sure to service all rx/tx queues, in priority order, on each pass. Fixes: 4d494cdc92b3 ("net: fec: change data structure to support multiqueue") Signed-off-by: Tobias Waldekranz Tested-by: Fugang Duan Reviewed-by: Fugang Duan Signed-off-by: David S. Miller commit 28b18e4eb515af7c6661c3995c6e3c34412c2874 Author: Tom Rix Date: Fri Jul 3 06:33:59 2020 -0700 net: sky2: initialize return of gm_phy_read clang static analysis flags this garbage return drivers/net/ethernet/marvell/sky2.c:208:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] return v; ^~~~~~~~ static inline u16 gm_phy_read( ... { u16 v; __gm_phy_read(hw, port, reg, &v); return v; } __gm_phy_read can return without setting v. So handle similar to skge.c's gm_phy_read, initialize v. Signed-off-by: Tom Rix Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6d12075ddeedc38d25c5b74e929e686158da728c Merge: aa27b32b76d0 880bc529bae2 Author: Linus Torvalds Date: Tue Jul 7 14:54:02 2020 -0700 Merge tag 'mtd/fixes-for-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD fixes from Miquel Raynal: "MTD: - Set a missing master partition panic write flag Raw NAND: - Fix build issue in the xway driver - Fix a wrong return code" * tag 'mtd/fixes-for-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: xway: Fix build issue mtd: set master partition panic write flag nandsim: Fix return code testing of ns_find_operation() commit 20f829999c38b18e3d17f9e40dea3a28f721fac4 Author: Andreas Gruenbacher Date: Wed Jul 1 19:25:19 2020 +0200 gfs2: Rework read and page fault locking So far, gfs2 has taken the inode glocks inside the ->readpage and ->readahead address space operations. Since commit d4388340ae0b ("fs: convert mpage_readpages to mpage_readahead"), gfs2_readahead is passed the pages to read ahead locked. With that, the current holder of the inode glock may be trying to lock one of those pages while gfs2_readahead is trying to take the inode glock, resulting in a deadlock. Fix that by moving the lock taking to the higher-level ->read_iter file and ->fault vm operations. This also gets rid of an ugly lock inversion workaround in gfs2_readpage. The cache consistency model of filesystems like gfs2 is such that if data is found in the page cache, the data is up to date and can be used without taking any filesystem locks. If a page is not cached, filesystem locks must be taken before populating the page cache. To avoid taking the inode glock when the data is already cached, gfs2_file_read_iter first tries to read the data with the IOCB_NOIO flag set. If that fails, the inode glock is taken and the operation is retried with the IOCB_NOIO flag cleared. Signed-off-by: Andreas Gruenbacher commit 41da51bce36f44eefc1e3d0f47d18841cbd065ba Author: Andreas Gruenbacher Date: Thu Nov 21 23:25:07 2019 +0000 fs: Add IOCB_NOIO flag for generic_file_read_iter Add an IOCB_NOIO flag that indicates to generic_file_read_iter that it shouldn't trigger any filesystem I/O for the actual request or for readahead. This allows to do tentative reads out of the page cache as some filesystems allow, and to take the appropriate locks and retry the reads only if the requested pages are not cached. Signed-off-by: Andreas Gruenbacher commit aa27b32b76d0b1b242d43977da0e5358da1c825f Merge: 9e4d7696213f 0465337c5599 Author: Linus Torvalds Date: Tue Jul 7 14:10:33 2020 -0700 Merge tag 'for-5.8-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - regression fix of a leak in global block reserve accounting - fix a (hard to hit) race of readahead vs releasepage that could lead to crash - convert all remaining uses of comment fall through annotations to the pseudo keyword - fix crash when mounting a fuzzed image with -o recovery * tag 'for-5.8-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: reset tree root pointer after error in init_tree_roots btrfs: fix reclaim_size counter leak after stealing from global reserve btrfs: fix fatal extent_buffer readahead vs releasepage race btrfs: convert comments to fallthrough annotations commit 9e4d7696213f0231f7a54512da4b8514eb316edb Merge: a6bc851ffe0b 10011f7d95de Author: Linus Torvalds Date: Tue Jul 7 13:43:43 2020 -0700 Merge tag 'arc-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fixes from Vineet Gupta: - User build systems to pass -mcpu - Fix potential EFA clobber in syscall handler - Fix ARCompact 2 levels of interrupts build - Detect newer HS CPU releases - misc other fixes * tag 'arc-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARCv2: support loop buffer (LPB) disabling ARC: build: remove deprecated toggle for arc700 builds ARC: build: allow users to specify -mcpu ARCv2: boot log: detect newer/upconing HS3x/HS4x releases ARC: elf: use right ELF_ARCH ARC: [arcompact] fix bitrot with 2 levels of interrupt ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE commit ad0f75e5f57ccbceec13274e1e242f2b5a6397ed Author: Cong Wang Date: Thu Jul 2 11:52:56 2020 -0700 cgroup: fix cgroup_sk_alloc() for sk_clone_lock() When we clone a socket in sk_clone_lock(), its sk_cgrp_data is copied, so the cgroup refcnt must be taken too. And, unlike the sk_alloc() path, sock_update_netprioidx() is not called here. Therefore, it is safe and necessary to grab the cgroup refcnt even when cgroup_sk_alloc is disabled. sk_clone_lock() is in BH context anyway, the in_interrupt() would terminate this function if called there. And for sk_alloc() skcd->val is always zero. So it's safe to factor out the code to make it more readable. The global variable 'cgroup_sk_alloc_disabled' is used to determine whether to take these reference counts. It is impossible to make the reference counting correct unless we save this bit of information in skcd->val. So, add a new bit there to record whether the socket has already taken the reference counts. This obviously relies on kmalloc() to align cgroup pointers to at least 4 bytes, ARCH_KMALLOC_MINALIGN is certainly larger than that. This bug seems to be introduced since the beginning, commit d979a39d7242 ("cgroup: duplicate cgroup reference when cloning sockets") tried to fix it but not compeletely. It seems not easy to trigger until the recent commit 090e28b229af ("netprio_cgroup: Fix unlimited memory leak of v2 cgroups") was merged. Fixes: bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup") Reported-by: Cameron Berkenpas Reported-by: Peter Geis Reported-by: Lu Fengqi Reported-by: Daniël Sonck Reported-by: Zhang Qiang Tested-by: Cameron Berkenpas Tested-by: Peter Geis Tested-by: Thomas Lamprecht Cc: Daniel Borkmann Cc: Zefan Li Cc: Tejun Heo Cc: Roman Gushchin Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit a6bc851ffe0b246ab4f8aa0d01620fbc08d0441f Merge: bfe91da29bfa 786a2aa281f4 Author: Linus Torvalds Date: Tue Jul 7 13:26:00 2020 -0700 Merge tag 'tpmdd-next-v5.8-rc5' of git://git.infradead.org/users/jjs/linux-tpmdd Pull tpm fix from Jarkko Sakkinen: "Revert commit e918e570415c ("tpm_tis: Remove the HID IFX0102"). Removing IFX0102 from tpm_tis was not a right move because both tpm_tis and tpm_infineon use the same device ID. A real fix requires quirks added to both drivers. It can probably wait until v5.9 as the bug has existed since 2006" * tag 'tpmdd-next-v5.8-rc5' of git://git.infradead.org/users/jjs/linux-tpmdd: Revert commit e918e570415c ("tpm_tis: Remove the HID IFX0102") commit aea23c323d89836bcdcee67e49def997ffca043b Author: David Ahern Date: Tue Jul 7 07:39:24 2020 -0600 ipv6: Fix use of anycast address with loopback Thomas reported a regression with IPv6 and anycast using the following reproducer: echo 1 > /proc/sys/net/ipv6/conf/all/forwarding ip -6 a add fc12::1/16 dev lo sleep 2 echo "pinging lo" ping6 -c 2 fc12:: The conversion of addrconf_f6i_alloc to use ip6_route_info_create missed the use of fib6_is_reject which checks addresses added to the loopback interface and sets the REJECT flag as needed. Update fib6_is_reject for loopback checks to handle RTF_ANYCAST addresses. Fixes: c7a1ce397ada ("ipv6: Change addrconf_f6i_alloc to use ip6_route_info_create") Reported-by: thomas.gambier@nexedi.com Signed-off-by: David Ahern Signed-off-by: David S. Miller commit f815dd5cf48b905eeecf0a2b990e9b7ab048b4f1 Author: AceLan Kao Date: Tue Jul 7 16:14:45 2020 +0800 net: usb: qmi_wwan: add support for Quectel EG95 LTE modem Add support for Quectel Wireless Solutions Co., Ltd. EG95 LTE modem T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0195 Rev=03.18 S: Manufacturer=Android S: Product=Android C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) Signed-off-by: AceLan Kao Acked-by: Bjørn Mork Signed-off-by: David S. Miller commit 92cffd48bfb3647552e73c41c4a95bbd04385b08 Merge: 34fe5a1cf95c a21c1f028fba Author: David S. Miller Date: Tue Jul 7 12:43:18 2020 -0700 Merge branch 'net-ipa-fix-warning-reported-errors' Alex Elder says: ==================== net: ipa: fix warning-reported errors Building the kernel with W=1 produces numerous warnings for the IPA code. Some of those warnings turn out to flag real problems, and this series fixes them. The first patch fixes the most important ones, but the second and third are problems I think are worth treating as bugs as well. Note: I'll happily combine any of these if someone prefers that. ==================== Signed-off-by: David S. Miller commit a21c1f028fbae8c8e2e2602d3ea206fefa448d73 Author: Alex Elder Date: Mon Jul 6 18:10:10 2020 -0500 net: ipa: include declarations in "ipa_gsi.c" Include "ipa_gsi.h" in "ipa_gsi.c", so the public functions are defined before they are used in "ipa_gsi.c". This addresses some warnings that are reported with a "W=1" build. Fixes: c3f398b141a8 ("soc: qcom: ipa: IPA interface to GSI") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 3c90e95bd958285d416e83cffda82ddc92d91294 Author: Alex Elder Date: Mon Jul 6 18:10:09 2020 -0500 net: ipa: declare struct types in "ipa_gsi.h" Pointers to two struct types are used in "ipa_gsi.h", without those struct types being forward-declared. Add these declarations. Fixes: c3f398b141a8 ("soc: qcom: ipa: IPA interface to GSI") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 74478ea4ded519db35cb1f059948b1e713bb4abf Author: Alex Elder Date: Mon Jul 6 18:10:08 2020 -0500 net: ipa: fix QMI structure definition bugs Building with "W=1" did exactly what it was supposed to do, namely point out some suspicious-looking code to be verified not to contain bugs. Some QMI message structures defined in "ipa_qmi_msg.c" contained some bad field names (duplicating the "elem_size" field instead of defining the "offset" field), almost certainly due to copy/paste errors that weren't obvious in a scan of the code. Fix these bugs. Fixes: 530f9216a953 ("soc: qcom: ipa: AP/modem communications") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 880bc529bae2257d05a767f7f5c24fd61a47b605 Author: Miquel Raynal Date: Fri Jun 26 08:55:11 2020 +0200 mtd: rawnand: xway: Fix build issue This MIPS driver does not support COMPILE_TEST yet and failed to build under my radar. Replace 'mtd' chich is not defined in the scope of xway_nand_remove() by nand_to_mtd(chip). The mistake has been added in the long series dropping nand_release(). Tested with a 7.3.0 MIPS GCC toolchain built with Buildroot. Fixes: 9fdd78f7bcda ("mtd: rawnand: xway: Stop using nand_release()") Reported-by: kernel test robot Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200626065511.16424-1-miquel.raynal@bootlin.com commit 17d51429da722cd8fc77a365a112f008abf4f8b3 Author: David Pedersen Date: Mon Jul 6 18:48:51 2020 -0700 Input: i8042 - add Lenovo XiaoXin Air 12 to i8042 nomux list This fixes two finger trackpad scroll on the Lenovo XiaoXin Air 12. Without nomux, the trackpad behaves as if only one finger is present and moves the cursor when trying to scroll. Signed-off-by: David Pedersen Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200625133754.291325-1-limero1337@gmail.com Signed-off-by: Dmitry Torokhov commit 876d4e1e8298ad1f94d9e9392fc90486755437b4 Author: Peter Chen Date: Tue Jul 7 14:06:01 2020 +0800 usb: chipidea: core: add wakeup support for extcon If wakeup event occurred by extcon event, it needs to call ci_irq again since the first ci_irq calling at extcon notifier only wakes up controller, but do noop for event handling, it causes the extcon use case can't work well from low power mode. Cc: Fixes: 3ecb3e09b042 ("usb: chipidea: Use extcon framework for VBUS and ID detect") Reported-by: Philippe Schenker Tested-by: Philippe Schenker Signed-off-by: Peter Chen Link: https://lore.kernel.org/r/20200707060601.31907-2-peter.chen@kernel.org Signed-off-by: Greg Kroah-Hartman commit 85067747cf9888249fa11fa49ef75af5192d3988 Author: Ming Lei Date: Wed Jun 24 16:00:58 2020 -0400 dm: do not use waitqueue for request-based DM Given request-based DM now uses blk-mq's blk_mq_queue_inflight() to determine if outstanding IO has completed (and DM has no control over the blk-mq state machine used to track outstanding IO) it is unsafe to wakeup waiter (dm_wait_for_completion) before blk-mq has cleared a request's state bits (e.g. MQ_RQ_IN_FLIGHT or MQ_RQ_COMPLETE). As such dm_wait_for_completion() could be left to wait indefinitely if no other requests complete. Fix this by eliminating request-based DM's use of waitqueue to wait for blk-mq requests to complete in dm_wait_for_completion. Signed-off-by: Ming Lei Depends-on: 3c94d83cb3526 ("blk-mq: change blk_mq_queue_busy() to blk_mq_queue_inflight()") Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit da6902e5b6dbca9081e3d377f9802d4fd0c5ea59 Author: AceLan Kao Date: Tue Jul 7 16:15:53 2020 +0800 USB: serial: option: add Quectel EG95 LTE modem Add support for Quectel Wireless Solutions Co., Ltd. EG95 LTE modem T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0195 Rev=03.18 S: Manufacturer=Android S: Product=Android C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) Signed-off-by: AceLan Kao Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 05a4fed69ff00a8bd83538684cb602a4636b07a7 Author: Ming Lei Date: Tue Jul 7 11:04:33 2020 -0400 blk-mq: consider non-idle request as "inflight" in blk_mq_rq_inflight() dm-multipath is the only user of blk_mq_queue_inflight(). When dm-multipath calls blk_mq_queue_inflight() to check if it has outstanding IO it can get a false negative. The reason for this is blk_mq_rq_inflight() doesn't consider requests that are no longer MQ_RQ_IN_FLIGHT but that are now MQ_RQ_COMPLETE (->complete isn't called or finished yet) as "inflight". This causes request-based dm-multipath's dm_wait_for_completion() to return before all outstanding dm-multipath requests have actually completed. This breaks DM multipath's suspend functionality because blk-mq requests complete after DM's suspend has finished -- which shouldn't happen. Fix this by considering any request not in the MQ_RQ_IDLE state (so either MQ_RQ_COMPLETE or MQ_RQ_IN_FLIGHT) as "inflight" in blk_mq_rq_inflight(). Fixes: 3c94d83cb3526 ("blk-mq: change blk_mq_queue_busy() to blk_mq_queue_inflight()") Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit 14b0e83dc4f1e52b94acaeb85a18fd7fdd46d2dc Author: Vishwas M Date: Tue Jul 7 19:57:47 2020 +0530 hwmon: (emc2103) fix unable to change fan pwm1_enable attribute This patch fixes a bug which does not let FAN mode to be changed from sysfs(pwm1_enable). i.e pwm1_enable can not be set to 3, it will always remain at 0. This is caused because the device driver handles the result of "read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg)" incorrectly. The driver thinks an error has occurred if the (result != 0). This has been fixed by changing the condition to (result < 0). Signed-off-by: Vishwas M Link: https://lore.kernel.org/r/20200707142747.118414-1-vishwas.reddy.vr@gmail.com Fixes: 9df7305b5a86 ("hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller") Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck commit f28e360f29031fdef8df3a1bcad666243bd6872d Author: Naveen Krishna Chatradhi Date: Mon Jul 6 22:47:15 2020 +0530 hwmon: (amd_energy) match for supported models The energy counters of certain models seems to be reporting inconsistent values. Hence, match for the supported models. Signed-off-by: Naveen Krishna Chatradhi Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters") Link: https://lore.kernel.org/r/20200706171715.124993-1-nchatrad@amd.com Signed-off-by: Guenter Roeck commit 04e484c5973ed0f9234c97685c3c5e1ebf0d6eb6 Author: Qu Wenruo Date: Fri Jul 3 15:05:50 2020 +0800 btrfs: discard: add missing put when grabbing block group from unused list [BUG] The following small test script can trigger ASSERT() at unmount time: mkfs.btrfs -f $dev mount $dev $mnt mount -o remount,discard=async $mnt umount $mnt The call trace: assertion failed: atomic_read(&block_group->count) == 1, in fs/btrfs/block-group.c:3431 ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.h:3204! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 4 PID: 10389 Comm: umount Tainted: G O 5.8.0-rc3-custom+ #68 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: btrfs_free_block_groups.cold+0x22/0x55 [btrfs] close_ctree+0x2cb/0x323 [btrfs] btrfs_put_super+0x15/0x17 [btrfs] generic_shutdown_super+0x72/0x110 kill_anon_super+0x18/0x30 btrfs_kill_super+0x17/0x30 [btrfs] deactivate_locked_super+0x3b/0xa0 deactivate_super+0x40/0x50 cleanup_mnt+0x135/0x190 __cleanup_mnt+0x12/0x20 task_work_run+0x64/0xb0 __prepare_exit_to_usermode+0x1bc/0x1c0 __syscall_return_slowpath+0x47/0x230 do_syscall_64+0x64/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The code: ASSERT(atomic_read(&block_group->count) == 1); btrfs_put_block_group(block_group); [CAUSE] Obviously it's some btrfs_get_block_group() call doesn't get its put call. The offending btrfs_get_block_group() happens here: void btrfs_mark_bg_unused(struct btrfs_block_group *bg) { if (list_empty(&bg->bg_list)) { btrfs_get_block_group(bg); list_add_tail(&bg->bg_list, &fs_info->unused_bgs); } } So every call sites removing the block group from unused_bgs list should reduce the ref count of that block group. However for async discard, it didn't follow the call convention: void btrfs_discard_punt_unused_bgs_list(struct btrfs_fs_info *fs_info) { list_for_each_entry_safe(block_group, next, &fs_info->unused_bgs, bg_list) { list_del_init(&block_group->bg_list); btrfs_discard_queue_work(&fs_info->discard_ctl, block_group); } } And in btrfs_discard_queue_work(), it doesn't call btrfs_put_block_group() either. [FIX] Fix the problem by reducing the reference count when we grab the block group from unused_bgs list. Reported-by: Marcos Paulo de Souza Fixes: 6e80d4f8c422 ("btrfs: handle empty block_group removal for async discard") CC: stable@vger.kernel.org # 5.6+ Tested-by: Marcos Paulo de Souza Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 503ed52225ed3d369c8e0dedf13556a7bc1e5c2b Author: Nicolin Chen Date: Mon Jul 6 21:58:29 2020 -0700 MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl Add Shengjiu who's actively working on the latest fsl/nxp audio drivers. Signed-off-by: Nicolin Chen Reviewed-by: Fabio Estevam Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20200707045829.10002-1-nicoleotsuka@gmail.com Signed-off-by: Mark Brown commit 58f30150ffd6d95efa524ff05bbcee4e95bfa870 Author: Maxime Ripard Date: Tue Jul 7 09:42:37 2020 +0200 ASoC: core: Remove only the registered component in devm functions The ASoC devm_ functions that register a component (devm_snd_soc_register_component and devm_snd_dmaengine_pcm_register) will clean their component by running snd_soc_unregister_component. snd_soc_unregister_component will then remove all the components for the device that was used to register the component in the first place. However, some drivers register several components (such as a DAI and a dmaengine PCM) on the same device, and if the dmaengine PCM is registered first, then the DAI will be cleaned up first and snd_dmaengine_pcm_unregister will be called next. snd_dmaengine_pcm_unregister will then lookup the dmaengine PCM component on the device, and if there's one unregister that component and release its dmaengine channels. That doesn't happen in practice though since the first call to snd_soc_unregister_component removed all the components, so we never get the chance to release the dmaengine channels. In order to fix this, instead of removing all the components for a given device, we can simply remove the component that was registered in the first place. We should have the same number of component registration than we have components, so it should work just fine. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20200707074237.287171-1-maxime@cerno.tech Signed-off-by: Mark Brown commit e13762abf38ead29071407f32b9dcec38f21dc34 Author: Maciej S. Szmigiero Date: Sun Jul 5 19:34:57 2020 +0200 HID: logitech-hidpp: avoid repeated "multiplier = " log messages These messages appear each time the mouse wakes from sleep, in my case (Logitech M705), every minute or so. Let's downgrade them to the "debug" level so they don't fill the kernel log by default. While we are at it, let's make clear that this is a wheel multiplier (and not, for example, XY movement multiplier). Fixes: 4435ff2f09a2 ("HID: logitech: Enable high-resolution scrolling on Logitech mice") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Reviewed-by: Harry Cutts Signed-off-by: Jiri Kosina commit 7f02bb6239f5e443cfe8af923ab2764561a833f6 Author: Mazin Rezk Date: Sun Jul 5 02:48:17 2020 +0000 HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff Some parts of hid-logitech-dj explicitly referred to 0xff for the receiver index. This patch changes those references to the HIDPP_RECEIVER_INDEX definition. Signed-off-by: Mazin Rezk Reviewed-by: Filipe Laíns Signed-off-by: Jiri Kosina commit f79a732a8325dfbd570d87f1435019d7e5501c6d Author: Vinod Koul Date: Mon Jun 29 19:17:37 2020 +0530 ALSA: compress: fix partial_drain completion state On partial_drain completion we should be in SNDRV_PCM_STATE_RUNNING state, so set that for partially draining streams in snd_compr_drain_notify() and use a flag for partially draining streams While at it, add locks for stream state change in snd_compr_drain_notify() as well. Fixes: f44f2a5417b2 ("ALSA: compress: fix drain calls blocking other compress functions (v6)") Reviewed-by: Srinivas Kandagatla Tested-by: Srinivas Kandagatla Reviewed-by: Charles Keepax Tested-by: Charles Keepax Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200629134737.105993-4-vkoul@kernel.org Signed-off-by: Takashi Iwai commit b6a1e78b96a5d7f312f08b3a470eb911ab5feec0 Author: Pavel Hofman Date: Fri Jul 3 12:04:33 2020 +0200 ALSA: usb-audio: Add implicit feedback quirk for RTX6001 USB Audio analyzer RTX6001 uses the same implicit feedback quirk as other XMOS-based devices. Signed-off-by: Pavel Hofman Tested-by: Pavel Hofman Cc: Link: https://lore.kernel.org/r/822f0f20-1886-6884-a6b2-d11c685cbafa@ivitera.com Signed-off-by: Takashi Iwai commit e337bf19f6af38d5c3fa6d06cd594e0f890ca1ac Author: Hector Martin Date: Thu Jul 2 16:14:33 2020 +0900 ALSA: usb-audio: add quirk for MacroSilicon MS2109 These devices claim to be 96kHz mono, but actually are 48kHz stereo with swapped channels and unaligned transfers. Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20200702071433.237843-1-marcan@marcan.st Signed-off-by: Takashi Iwai commit 781c90c034d994c6a4e2badf189128a95ed864c2 Author: Jian-Hong Pan Date: Mon Jul 6 15:18:29 2020 +0800 ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC The Acer Veriton N4660G desktop's audio (1025:1248) with ALC269VC cannot detect the headset microphone until ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE quirk maps the NID 0x18 as the headset mic pin. Signed-off-by: Jian-Hong Pan Cc: Link: https://lore.kernel.org/r/20200706071826.39726-3-jian-hong@endlessm.com Signed-off-by: Takashi Iwai commit 6e15d1261d522d1d222f8f89b23c6966905e9049 Author: Jian-Hong Pan Date: Mon Jul 6 15:18:27 2020 +0800 ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC The Acer Aspire C20-820 AIO's audio (1025:1065) with ALC269VC can't detect the headset microphone until ALC269VC_FIXUP_ACER_HEADSET_MIC quirk maps the NID 0x18 as the headset mic pin. Signed-off-by: Jian-Hong Pan Signed-off-by: Daniel Drake Cc: Link: https://lore.kernel.org/r/20200706071826.39726-2-jian-hong@endlessm.com Signed-off-by: Takashi Iwai commit 8eae7e9b3967f08efaa4d70403aec513cbe45ad0 Author: Jian-Hong Pan Date: Mon Jul 6 15:18:25 2020 +0800 ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC The Acer desktop vCopperbox with ALC269VC cannot detect the MIC of headset, the line out and internal speaker until ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS quirk applied. Signed-off-by: Jian-Hong Pan Signed-off-by: Chris Chiu Cc: Link: https://lore.kernel.org/r/20200706071826.39726-1-jian-hong@endlessm.com Signed-off-by: Takashi Iwai commit 9774dc218bb628974dcbc76412f970e9258e5f27 Author: Benjamin Poirier Date: Fri Jul 3 17:00:04 2020 +0900 ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id 1) In snd_hda_pick_fixup(), quirks are first matched by PCI SSID and then, if there is no match, by codec SSID. The Lenovo "ThinkPad X1 Carbon 7th" has an audio chip with PCI SSID 0x2292 and codec SSID 0x2293[1]. Therefore, fix the quirk meant for that device to match on .subdevice == 0x2292. 2) The "Thinkpad X1 Yoga 7th" does not exist. The companion product to the Carbon 7th is the Yoga 4th. That device has an audio chip with PCI SSID 0x2292 and codec SSID 0x2292[2]. Given the behavior of snd_hda_pick_fixup(), it is not possible to have a separate quirk for the Yoga based on SSID. Therefore, merge the quirks meant for the Carbon and Yoga. This preserves the current behavior for the Yoga. [1] This is the case on my own machine and can also be checked here https://github.com/linuxhw/LsPCI/tree/master/Notebook/Lenovo/ThinkPad https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#gistcomment-3225701 [2] https://github.com/linuxhw/LsPCI/tree/master/Convertible/Lenovo/ThinkPad https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#gistcomment-3176355 Fixes: d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen") Fixes: 54a6a7dc107d ("ALSA: hda/realtek - Add quirk for the bass speaker on Lenovo Yoga X1 7th gen") Cc: Jaroslav Kysela Cc: Kailang Yang Tested-by: Vincent Bernat Tested-by: Even Brenden Signed-off-by: Benjamin Poirier Cc: Link: https://lore.kernel.org/r/20200703080005.8942-2-benjamin.poirier@gmail.com Signed-off-by: Takashi Iwai commit 90670fdfcf210f997c18490922bd3603b248f349 Author: Kai Vehmanen Date: Fri Jul 3 18:38:18 2020 +0300 ALSA: hda/hdmi: improve debug traces for stream lookups The HDMI codec driver has two debug traces printed from different functions but with identical message content: "HDMI: hinfo 000000006a6b84d9 not registered" Fix this duplication and also add a bit more context in addition to raw object pointer, to help analysis of kernel logs. Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200703153818.2808592-2-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit 56275036d8185f92eceac7479d48b858ee3dab84 Author: Kai Vehmanen Date: Fri Jul 3 18:38:17 2020 +0300 ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later When HDMI PCM devices are opened in a specific order, with at least one HDMI/DP receiver connected, ALSA PCM open fails to -EBUSY on the connected monitor, on recent Intel platforms (ICL/JSL and newer). While this is not a typical sequence, at least Pulseaudio does this every time when it is started, to discover the available PCMs. The rootcause is an invalid assumption in hdmi_add_pin(), where the total number of converters is assumed to be known at the time the function is called. On older Intel platforms this held true, but after ICL/JSL, the order how pins and converters are in the subnode list as returned by snd_hda_get_sub_nodes(), was changed. As a result, information for some converters was not stored to per_pin->mux_nids. And this means some pins cannot be connected to all converters, and application instead gets -EBUSY instead at open. The assumption that converters are always before pins in the subnode list, is not really a valid one. Fix the problem in hdmi_parse_codec() by introducing separate loops for discovering converters and pins. BugLink: https://github.com/thesofproject/linux/issues/1978 BugLink: https://github.com/thesofproject/linux/issues/2216 BugLink: https://github.com/thesofproject/linux/issues/2217 Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200703153818.2808592-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit ad155712bb1ea2151944cf06a0e08c315c70c1e3 Author: xidongwang Date: Sun Jul 5 20:27:38 2020 -0700 ALSA: opl3: fix infoleak in opl3 The stack object “info” in snd_opl3_ioctl() has a leaking problem. It has 2 padding bytes which are not initialized and leaked via “copy_to_user”. Signed-off-by: xidongwang Cc: Link: https://lore.kernel.org/r/1594006058-30362-1-git-send-email-wangxidong_97@163.com Signed-off-by: Takashi Iwai commit 17175d1a27c618e214555b91eca8a0be4cf07f45 Author: Sabrina Dubroca Date: Fri Jul 3 16:57:09 2020 +0200 xfrm: esp6: fix encapsulation header offset computation In commit 0146dca70b87, I incorrectly adapted the code that computes the location of the UDP or TCP encapsulation header from IPv4 to IPv6. In esp6_input_done2, skb->transport_header points to the ESP header, so by adding skb_network_header_len, uh and th will point to the ESP header, not the encapsulation header that's in front of it. Since the TCP header's size can change with options, we have to start from the IPv6 header and walk past possible extensions. Fixes: 0146dca70b87 ("xfrm: add support for UDPv6 encapsulation of ESP") Fixes: 26333c37fc28 ("xfrm: add IPv6 support for espintcp") Reported-by: Tobias Brunner Tested-by: Tobias Brunner Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 736bb11898ef748da1d805f40d485b66ceac9a3c Author: H. Nikolaus Schaller Date: Wed Jul 1 08:18:27 2020 +0200 modpost: remove use of non-standard strsep() in HOSTCC code strsep() is neither standard C nor POSIX and used outside the kernel code here. Using it here requires that the build host supports it out of the box which is e.g. not true for a Darwin build host and using a cross-compiler. This leads to: scripts/mod/modpost.c:145:2: warning: implicit declaration of function 'strsep' [-Wimplicit-function-declaration] return strsep(stringp, "\n"); ^ and a segfault when running MODPOST. See also: https://stackoverflow.com/a/7219504 So let's replace this by strchr() instead of using strsep(). It does not hurt kernel size or speed since this code is run on the build host. Fixes: ac5100f5432967 ("modpost: add read_text_file() and get_line() helpers") Co-developed-by: Masahiro Yamada Signed-off-by: H. Nikolaus Schaller Signed-off-by: Masahiro Yamada commit 786a2aa281f4c4ba424ea8b8ea1e85ab62c4a57c Author: Jarkko Sakkinen Date: Mon Jul 6 23:53:42 2020 +0300 Revert commit e918e570415c ("tpm_tis: Remove the HID IFX0102") Removing IFX0102 from tpm_tis was not a right move because both tpm_tis and tpm_infineon use the same device ID. Revert the commit and add a remark about a bug caused by commit 93e1b7d42e1e ("[PATCH] tpm: add HID module parameter"). Fixes: e918e570415c ("tpm_tis: Remove the HID IFX0102") Reported-by: Peter Huewe Reviewed-by: Jerry Snitselaar Signed-off-by: Jarkko Sakkinen commit 93b9de223c0135db495c25334e66cb669bef13e2 Author: Dmitry Torokhov Date: Mon Jul 6 17:47:35 2020 -0700 Revert "Input: elants_i2c - report resolution information for touch major" This reverts commit 061706716384f1633d3d5090b22a99f33f1fcf2f - it turns out that the resolution of 1 unit per mm was not correct for a number of touch screens, causing touch sizes to be reported as way too large. See https://crbug.com/1085648 Reported-by: Harry Cutts Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit 966334dfc472bdfa67bed864842943b19755d192 Author: Derek Basehore Date: Mon Jul 6 17:39:41 2020 -0700 Input: elan_i2c - only increment wakeup count on touch This moves the wakeup increment for elan devices to the touch report. This prevents the drivers from incorrectly reporting a wakeup when the resume callback resets then device, which causes an interrupt to occur. Signed-off-by: Derek Basehore Link: https://lore.kernel.org/r/20200706235046.1984283-1-dbasehore@chromium.org Signed-off-by: Dmitry Torokhov commit dcb00fc799dc03fd320e123e4c81b3278c763ea5 Author: Ilya Katsnelson Date: Mon Jul 6 15:27:43 2020 -0700 Input: synaptics - enable InterTouch for ThinkPad X1E 1st gen Tested on my own laptop, touchpad feels slightly more responsive with this on, though it might just be placebo. Signed-off-by: Ilya Katsnelson Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20200703143457.132373-1-me@0upti.me Signed-off-by: Dmitry Torokhov commit cf1976b11372cac3b57fbae1831f66a4486355d3 Author: Chris Wilson Date: Thu Jul 2 22:10:15 2020 +0100 drm/i915: Also drop vm.ref along error paths for vma construction Not only do we need to release the vm.ref we acquired for the vma on the duplicate insert branch, but also for the normal error paths, so roll them all into one. Reported-by: Andi Shyti Suggested-by: Andi Shyti Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex") Signed-off-by: Chris Wilson Cc: Andi Shyti Cc: # v5.5+ Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200702211015.29604-1-chris@chris-wilson.co.uk (cherry picked from commit 03fca66b7a36b52da8915341eee388267f6d5b73) Signed-off-by: Rodrigo Vivi commit 42723673a193d5f8e30dba6ea9826d42262a502b Author: Chris Wilson Date: Thu Jul 2 09:32:03 2020 +0100 drm/i915: Drop vm.ref for duplicate vma on construction As we allow for parallel threads to create the same vma instance concurrently, and we only filter out the duplicates upon reacquiring the spinlock for the rbtree, we have to free the loser of the constructors' race. When freeing, we should also drop any resource references acquired for the redundant vma. Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.5+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200702083225.20044-1-chris@chris-wilson.co.uk (cherry picked from commit 2377427cdd2b7514eb4c40241cf5c4dec63c1bec) Signed-off-by: Rodrigo Vivi commit 9eb0463cfe65d826c97fa26b904a64f52c94300d Author: Ville Syrjälä Date: Wed Apr 29 13:10:25 2020 +0300 drm/i915/fbc: Fix fence_y_offset handling The current fence_y_offset calculation is broken. I think it more or less used to do the right thing, but then I changed the plane code to put the final x/y source offsets back into the src rectangle so now it's just subtraacting the same value from itself. The code would never have worked if we allowed the framebuffer to have a non-zero offset. Let's do this in a better way by just calculating the fence_y_offset from the final plane surface offset. Note that we don't align the plane surface address to fence rows so with horizontal panning there's often a horizontal offset from the fence start to the surface address as well. We have no way to tell the hardware about that so we just ignore it. Based on some quick tests the invlidation still happens correctly. I presume due to the invalidation nuking at least the full line (or a segment of multiple lines). Fixes: 54d4d719fa11 ("drm/i915: Overcome display engine stride limits via GTT remapping") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200429101034.8208-4-ville.syrjala@linux.intel.com Reviewed-by: Matt Roper (cherry picked from commit 5331889b5ffb11d6257953e418291a9f04c02bed) Signed-off-by: Rodrigo Vivi commit 7dfbf8a07cf8c936b0d6cc810df6ae7923954d5b Author: Chris Wilson Date: Tue Jun 30 16:27:24 2020 +0100 drm/i915: Skip stale object handle for debugfs per-file-stats As we close a handle GEM object, we update the drm_file's idr with an error^W NULL pointer to indicate the in-progress closure, and finally removing it. If we read the idr directly, we may then see an invalid object pointer, and in our debugfs per_file_stats() we therefore need to protect against the entry being invalid. [ 1016.651637] RIP: 0010:per_file_stats+0xe/0x16e [ 1016.651646] Code: d2 41 0f b6 8e 69 8c 00 00 48 89 df 48 c7 c6 7b 74 8c be 31 c0 e8 0c 89 cf ff eb d2 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 53 <8b> 06 85 c0 0f 84 4d 01 00 00 49 89 d6 48 89 f3 3d ff ff ff 7f 73 [ 1016.651651] RSP: 0018:ffffad3a01337ba0 EFLAGS: 00010293 [ 1016.651656] RAX: 0000000000000018 RBX: ffff96fe040d65e0 RCX: 0000000000000002 [ 1016.651660] RDX: ffffad3a01337c50 RSI: 0000000000000000 RDI: 00000000000001e8 [ 1016.651663] RBP: ffffad3a01337bb8 R08: 0000000000000000 R09: 00000000000001c0 [ 1016.651667] R10: 0000000000000000 R11: ffffffffbdbe5fce R12: 0000000000000000 [ 1016.651671] R13: ffffffffbdbe5fce R14: ffffad3a01337c50 R15: 0000000000000001 [ 1016.651676] FS: 00007a597e2d7480(0000) GS:ffff96ff3bb00000(0000) knlGS:0000000000000000 [ 1016.651680] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1016.651683] CR2: 0000000000000000 CR3: 0000000171fc2001 CR4: 00000000003606e0 [ 1016.651687] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1016.651690] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1016.651693] Call Trace: [ 1016.651693] Call Trace: [ 1016.651703] idr_for_each+0x8a/0xe8 [ 1016.651711] i915_gem_object_info+0x2a3/0x3eb [ 1016.651720] seq_read+0x162/0x3ca [ 1016.651727] full_proxy_read+0x5b/0x8d [ 1016.651733] __vfs_read+0x45/0x1bb [ 1016.651741] vfs_read+0xc9/0x15e [ 1016.651746] ksys_read+0x7e/0xde [ 1016.651752] do_syscall_64+0x54/0x68 [ 1016.651758] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Reported-by: Guenter Roeck Fixes: a8c15954d64a ("drm/i915: Protect debugfs per_file_stats with RCU lock") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Guenter Roeck Cc: stable@vger.kernel.org Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200630152724.3734-1-chris@chris-wilson.co.uk (cherry picked from commit c1b9fd3d310177b31621d5e661f06885869cae12) Signed-off-by: Rodrigo Vivi commit 3c01655ac82eb6d1cc2cfe9507031f1b5e0a6df1 Author: Paolo Bonzini Date: Mon Jun 22 20:07:37 2020 -0400 kselftest: ksft_test_num return type should be unsigned Fixes a compiler warning: In file included from sync_test.c:37: ../kselftest.h: In function ‘ksft_print_cnts’: ../kselftest.h:78:16: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare] if (ksft_plan != ksft_test_num()) ^~ Signed-off-by: Paolo Bonzini Signed-off-by: Shuah Khan commit 34fe5a1cf95c3f114068fc16d919c9cf4b00e428 Author: David Ahern Date: Mon Jul 6 11:45:07 2020 -0600 ipv6: fib6_select_path can not use out path for nexthop objects Brian reported a crash in IPv6 code when using rpfilter with a setup running FRR and external nexthop objects. The root cause of the crash is fib6_select_path setting fib6_nh in the result to NULL because of an improper check for nexthop objects. More specifically, rpfilter invokes ip6_route_lookup with flowi6_oif set causing fib6_select_path to be called with have_oif_match set. fib6_select_path has early check on have_oif_match and jumps to the out label which presumes a builtin fib6_nh. This path is invalid for nexthop objects; for external nexthops fib6_select_path needs to just return if the fib6_nh has already been set in the result otherwise it returns after the call to nexthop_path_fib6_result. Update the check on have_oif_match to not bail on external nexthops. Update selftests for this problem. Fixes: f88d8ea67fbd ("ipv6: Plumb support for nexthop object in a fib6_info") Reported-by: Brian Rak Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 0b78c9e8c19b57bf2081cd432841c7fe3f800633 Author: Pengfei Xu Date: Fri Jun 26 11:40:52 2020 +0800 selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3 Python 2 is no longer supported by the Python upstream project, so upgrade TPM2 tests to Python 3. Fixed minor merge conflicts Shuah Khan Signed-off-by: Pengfei Xu Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Shuah Khan commit bfe91da29bfad9941d5d703d45e29f0812a20724 Merge: 5c82ec00dd00 8038a922cf9a Author: Linus Torvalds Date: Mon Jul 6 12:48:04 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "Bugfixes and a one-liner patch to silence a sparse warning" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: arm64: Stop clobbering x0 for HVC_SOFT_RESTART KVM: arm64: PMU: Fix per-CPU access in preemptible context KVM: VMX: Use KVM_POSSIBLE_CR*_GUEST_BITS to initialize guest/host masks KVM: x86: Mark CR4.TSD as being possibly owned by the guest KVM: x86: Inject #GP if guest attempts to toggle CR4.LA57 in 64-bit mode kvm: use more precise cast and do not drop __user KVM: x86: bit 8 of non-leaf PDPEs is not reserved KVM: X86: Fix async pf caused null-ptr-deref KVM: arm64: vgic-v4: Plug race between non-residency and v4.1 doorbell KVM: arm64: pvtime: Ensure task delay accounting is enabled KVM: arm64: Fix kvm_reset_vcpu() return code being incorrect with SVE KVM: arm64: Annotate hyp NMI-related functions as __always_inline KVM: s390: reduce number of IO pins to 1 commit eadede5f936276e93e62834ffbe1550d305e0921 Merge: 2294ca7a47d7 a06656211304 Author: David S. Miller Date: Mon Jul 6 12:33:28 2020 -0700 Merge branch 'hns3-fixes' Huazhong Tan says: ==================== net: hns3: fixes for -net There are some fixes about reset issue and a use-after-free of self-test. ==================== Signed-off-by: David S. Miller commit a06656211304fec653c1931c2ca6d644013b5bbb Author: Yonglong Liu Date: Mon Jul 6 19:26:02 2020 +0800 net: hns3: fix use-after-free when doing self test Enable promisc mode of PF, set VF link state to enable, and run iperf of the VF, then do self test of the PF. The self test will fail with a low frequency, and may cause a use-after-free problem. [ 87.142126] selftest:000004a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 87.159722] ================================================================== [ 87.174187] BUG: KASAN: use-after-free in hex_dump_to_buffer+0x140/0x608 [ 87.187600] Read of size 1 at addr ffff003b22828000 by task ethtool/1186 [ 87.201012] [ 87.203978] CPU: 7 PID: 1186 Comm: ethtool Not tainted 5.5.0-rc4-gfd51c473-dirty #4 [ 87.219306] Hardware name: Huawei TaiShan 2280 V2/BC82AMDA, BIOS TA BIOS 2280-A CS V2.B160.01 01/15/2020 [ 87.238292] Call trace: [ 87.243173] dump_backtrace+0x0/0x280 [ 87.250491] show_stack+0x24/0x30 [ 87.257114] dump_stack+0xe8/0x140 [ 87.263911] print_address_description.isra.8+0x70/0x380 [ 87.274538] __kasan_report+0x12c/0x230 [ 87.282203] kasan_report+0xc/0x18 [ 87.288999] __asan_load1+0x60/0x68 [ 87.295969] hex_dump_to_buffer+0x140/0x608 [ 87.304332] print_hex_dump+0x140/0x1e0 [ 87.312000] hns3_lb_check_skb_data+0x168/0x170 [ 87.321060] hns3_clean_rx_ring+0xa94/0xfe0 [ 87.329422] hns3_self_test+0x708/0x8c0 The length of packet sent by the selftest process is only 128 + 14 bytes, and the min buffer size of a BD is 256 bytes, and the receive process will make sure the packet sent by the selftest process is in the linear part, so only check the linear part in hns3_lb_check_skb_data(). So fix this use-after-free by using skb_headlen() to dump skb->data instead of skb->len. Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver") Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit e22b5e728bbb179b912d3a3cd5c25894a89a26a2 Author: Huazhong Tan Date: Mon Jul 6 19:26:01 2020 +0800 net: hns3: add a missing uninit debugfs when unload driver When unloading driver, if flag HNS3_NIC_STATE_INITED has been already cleared, the debugfs will not be uninitialized, so fix it. Fixes: b2292360bb2a ("net: hns3: Add debugfs framework registration") Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit cddd5648926d7a6e84526dadd8bfb21609a14fb7 Author: Huazhong Tan Date: Mon Jul 6 19:26:00 2020 +0800 net: hns3: fix for mishandle of asserting VF reset fail When asserts VF reset fail, flag HCLGEVF_STATE_CMD_DISABLE and handshake status should not set, otherwise the retry will fail. So adds a check for asserting VF reset and returns directly when fails. Fixes: ef5f8e507ec9 ("net: hns3: stop handling command queue while resetting VF") Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit bb3d866882c280a85e8950d4d72af1e294d2e69c Author: Huazhong Tan Date: Mon Jul 6 19:25:59 2020 +0800 net: hns3: check reset pending after FLR prepare If there is a PF reset pending before FLR prepare, FLR's preparatory work will not fail, but the FLR rebuild procedure will fail for this pending. So this PF reset pending should be handled in the FLR preparatory. Fixes: 8627bdedc435 ("net: hns3: refactor the precedure of PF FLR") Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 2294ca7a47d7094706450d641b243fa3a61843a3 Merge: 9dc829a135fb 3ed58f96a70b Author: David S. Miller Date: Mon Jul 6 12:22:24 2020 -0700 Merge branch 'smsc95xx-fix-smsc95xx_bind' Andre Edich says: ==================== smsc95xx: fix smsc95xx_bind The patchset fixes two problems in the function smsc95xx_bind: - return of false success - memory leak Changes in v2: - added "Fixes" tags to both patches ==================== Signed-off-by: David S. Miller commit 3ed58f96a70b85ef646d5427258f677f1395b62f Author: Andre Edich Date: Mon Jul 6 10:39:35 2020 +0200 smsc95xx: avoid memory leak in smsc95xx_bind In a case where the ID_REV register read is failed, the memory for a private data structure has to be freed before returning error from the function smsc95xx_bind. Fixes: bbd9f9ee69242 ("smsc95xx: add wol support for more frame types") Signed-off-by: Andre Edich Signed-off-by: Parthiban Veerasooran Signed-off-by: David S. Miller commit 7c8b1e855f94f88a0c569be6309fc8d5c8844cd1 Author: Andre Edich Date: Mon Jul 6 10:39:34 2020 +0200 smsc95xx: check return value of smsc95xx_reset The return value of the function smsc95xx_reset() must be checked to avoid returning false success from the function smsc95xx_bind(). Fixes: 2f7ca802bdae2 ("net: Add SMSC LAN9500 USB2.0 10/100 ethernet adapter driver") Signed-off-by: Andre Edich Signed-off-by: Parthiban Veerasooran Signed-off-by: David S. Miller commit 9dc829a135fb5927f1519de11286e2bbb79f5b66 Author: Xie He Date: Sun Jul 5 17:45:21 2020 -0700 drivers/net/wan/lapbether: Fixed the value of hard_header_len When this driver transmits data, first this driver will remove a pseudo header of 1 byte, then the lapb module will prepend the LAPB header of 2 or 3 bytes, then this driver will prepend a length field of 2 bytes, then the underlying Ethernet device will prepend its own header. So, the header length required should be: -1 + 3 + 2 + "the header length needed by the underlying device". This patch fixes kernel panic when this driver is used with AF_PACKET SOCK_DGRAM sockets. Signed-off-by: Xie He Signed-off-by: David S. Miller commit 5c82ec00dd00c7a2b02d4b42cf59ae87592cb75f Merge: dcb7fd82c75e 075ebfe19fa3 Author: Linus Torvalds Date: Mon Jul 6 10:16:16 2020 -0700 Merge tag 's390-5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: - Initialize jump labels before early command line parsing in order to make init_on_alloc and init_on_free options work - Fix vfio-ccw build error due to missing include - Prevent callchain data collection with hardware sampling, since the callchains simply do not exist - Prevent multiple registrations of the same zPCI function - Update defconfigs * tag 's390-5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: vfio-ccw: Fix a build error due to missing include of linux/slab.h s390: update defconfigs s390/cpum_sf: prohibit callchain data collection s390/setup: init jump labels before command line parsing s390/maccess: add no DAT mode to kernel_write s390/pci: fix enabling a reserved PCI function commit 8038a922cf9af5266eaff29ce996a0d1b788fc0d Merge: fa71e9527f6a b9e10d4a6c9f Author: Paolo Bonzini Date: Mon Jul 6 13:05:38 2020 -0400 Merge tag 'kvmarm-fixes-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm fixes for 5.8, take #3 - Disable preemption on context-switching PMU EL0 state happening on system register trap - Don't clobber X0 when tearing down KVM via a soft reset (kexec) commit ed7815db70d17b1741883f2da8e1d80bc2efe517 Author: Marc Kleine-Budde Date: Mon Jul 6 16:34:34 2020 +0200 spi: spi-sun6i: sun6i_spi_transfer_one(): fix setting of clock rate A SPI transfer defines the _maximum_ speed of the SPI transfer. However the driver doesn't take into account that the clock divider is always rounded down (due to integer arithmetics). This results in a too high clock rate for the SPI transfer. E.g.: with a mclk_rate of 24 MHz and a SPI transfer speed of 10 MHz, the original code calculates a reg of "0", which results in a effective divider of "2" and a 12 MHz clock for the SPI transfer. This patch fixes the issue by using DIV_ROUND_UP() instead of a plain integer division. While there simplify the divider calculation for the CDR1 case, use order_base_2() instead of two ilog2() calculations. Fixes: 3558fe900e8a ("spi: sunxi: Add Allwinner A31 SPI controller driver") Signed-off-by: Marc Kleine-Budde Acked-by: Maxime Ripard Link: https://lore.kernel.org/r/20200706143443.9855-2-mkl@pengutronix.de Signed-off-by: Mark Brown commit 68d237056e007c88031d80900cdba0945121a287 Author: Marek Szyprowski Date: Tue Jun 30 10:16:02 2020 +0200 scatterlist: protect parameters of the sg_table related macros Add brackets to protect parameters of the recently added sg_table related macros from side-effects. Fixes: 709d6d73c756 ("scatterlist: add generic wrappers for iterating over sgtable objects") Signed-off-by: Marek Szyprowski Signed-off-by: Christoph Hellwig commit 65752aef0a407e1ef17ec78a7fc31ba4e0b360f9 Author: Yufen Yu Date: Fri Jul 3 02:13:23 2020 -0400 docs: block: update and fix tiny error for bfq The max value of blkio.bfq.weight is 1000, rather than 10000. And 'weights' have been remove from /sys/block/XXX/queue/iosched. Signed-off-by: Yufen Yu Acked-by: Paolo Valente Signed-off-by: Jens Axboe commit f8884711f78fa946041cf04492e218c377479a9c Author: Manivannan Sadhasivam Date: Sun Jun 21 08:23:30 2020 +0530 mmc: owl-mmc: Get rid of of_match_ptr() macro Remove the 'of_match_ptr()' macro to fix the warning when CONFIG_OF is not selected. drivers/mmc/host/owl-mmc.c:677:34: warning: unused variable 'owl_mmc_of_match' [-Wunused-const-variable] Reported-by: kernel test robot Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200621025330.10561-1-mani@kernel.org Fixes: ff65ffe46d28 ("mmc: Add Actions Semi Owl SoCs SD/MMC driver") Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson commit 92025b90f18d45e26b7f17d68756b1abd771b9d3 Author: Maxime Ripard Date: Sat Jul 4 15:08:29 2020 +0200 ARM: dts sunxi: Relax a bit the CMA pool allocation range The hardware codec on the A10, A10s, A13 and A20 needs buffer in the first 256MB of RAM. This was solved by setting the CMA pool at a fixed address in that range. However, in recent kernels there's something else that comes in and reserve some range that end up conflicting with our default pool requirement, and thus makes its reservation fail. The video codec will then use buffers from the usual default pool, outside of the range it can access, and will fail to decode anything. Since we're only concerned about that 256MB, we can however relax the allocation to just specify the range that's allowed, and not try to enforce a specific address. Fixes: 5949bc5602cc ("ARM: dts: sun4i-a10: Add Video Engine and reserved memory nodes") Fixes: 960432010156 ("ARM: dts: sun5i: Add Video Engine and reserved memory nodes") Fixes: c2a641a74850 ("ARM: dts: sun7i-a20: Add Video Engine and reserved memory nodes") Signed-off-by: Maxime Ripard Acked-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20200704130829.34297-1-maxime@cerno.tech commit bee9ca1c8a237ca178f281062bf162637071ab04 Author: Arnaldo Carvalho de Melo Date: Fri Jul 3 09:29:57 2020 -0300 perf report TUI: Remove needless 'dummy' event from menu Fixing the common case of: perf record perf report And getting just the cycles events. We now have a 'dummy' event to get perf metadata events that take place while we synthesize metadata records for pre-existing processes by traversing procfs, so we always have this extra 'dummy' evsel, but we don't have to offer it as there will be no samples on it, remove this distraction. Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/20200706115452.GA2772@redhat.com/ Signed-off-by: Arnaldo Carvalho de Melo commit 4c95ad261cfac120dd66238fcae222766754c219 Author: Adrian Hunter Date: Tue Jun 30 16:39:35 2020 +0300 perf intel-pt: Fix PEBS sample for XMM registers The condition to add XMM registers was missing, the regs array needed to be in the outer scope, and the size of the regs array was too small. Fixes: 143d34a6b387b ("perf intel-pt: Add XMM registers to synthesized PEBS sample") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: Luwei Kang Link: http://lore.kernel.org/lkml/20200630133935.11150-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit add07ccd9222ba0944df2a6d39c6e38de90cd0c5 Author: Adrian Hunter Date: Tue Jun 30 16:39:34 2020 +0300 perf intel-pt: Fix displaying PEBS-via-PT with registers After recording PEBS-via-PT, perf script will not accept 'iregs' field e.g. # perf record -c 10000 -e '{intel_pt/branch=0/,branch-loads/aux-output/ppp}' -I -- ls -l ... [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.062 MB perf.data ] # ./perf script --itrace=eop -F+iregs Samples for 'dummy:u' event do not have IREGS attribute set. Cannot print 'iregs' field. Fix by using allow_user_set, which is true when recording AUX area data. Fixes: 9e64cefe4335b ("perf intel-pt: Process options for PEBS event synthesis") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: Luwei Kang Link: http://lore.kernel.org/lkml/20200630133935.11150-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 75bcb8776dc987538f267ba4ba05ca43fc2b1676 Author: Adrian Hunter Date: Tue Jun 30 16:39:33 2020 +0300 perf intel-pt: Fix recording PEBS-via-PT with registers When recording PEBS-via-PT, the kernel will not accept the intel_pt event with register sampling e.g. # perf record --kcore -c 10000 -e '{intel_pt/branch=0/,branch-loads/aux-output/ppp}' -I -- ls -l Error: intel_pt/branch=0/: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' Fix by suppressing register sampling on the intel_pt evsel. Committer notes: Adrian informed that this is only available from Tremont onwards, so on older processors the error continues the same as before. Fixes: 9e64cefe4335b ("perf intel-pt: Process options for PEBS event synthesis") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: Luwei Kang Link: http://lore.kernel.org/lkml/20200630133935.11150-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d61cbb859b45fdb6b4997f2d51834fae41af0e94 Author: Wei Li Date: Fri Jun 12 17:43:22 2020 +0800 perf report TUI: Fix segmentation fault in perf_evsel__hists_browse() The segmentation fault can be reproduced as following steps: 1) Executing perf report in tui. 2) Typing '/xxxxx' to filter the symbol to get nothing matched. 3) Pressing enter with no entry selected. Then it will report a segmentation fault. It is caused by the lack of check of browser->he_selection when accessing it's member res_samples in perf_evsel__hists_browse(). These processes are meaningful for specified samples, so we can skip these when nothing is selected. Fixes: 4968ac8fb7c3 ("perf report: Implement browsing of individual samples") Signed-off-by: Wei Li Acked-by: Jiri Olsa Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Hanjun Guo Cc: Jin Yao Cc: Mark Rutland Link: http://lore.kernel.org/lkml/20200612094322.39565-1-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit b9e10d4a6c9f5cbe6369ce2c17ebc67d2e5a4be5 Author: Andrew Scull Date: Mon Jul 6 10:52:59 2020 +0100 KVM: arm64: Stop clobbering x0 for HVC_SOFT_RESTART HVC_SOFT_RESTART is given values for x0-2 that it should installed before exiting to the new address so should not set x0 to stub HVC success or failure code. Fixes: af42f20480bf1 ("arm64: hyp-stub: Zero x0 on successful stub handling") Cc: stable@vger.kernel.org Signed-off-by: Andrew Scull Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200706095259.1338221-1-ascull@google.com commit 146f76cc84b787c4eec6ed73ebeec708a06e4ae4 Author: Marc Zyngier Date: Sat Jul 4 13:30:55 2020 +0100 KVM: arm64: PMU: Fix per-CPU access in preemptible context Commit 07da1ffaa137 ("KVM: arm64: Remove host_cpu_context member from vcpu structure") has, by removing the host CPU context pointer, exposed that kvm_vcpu_pmu_restore_guest is called in preemptible contexts: [ 266.932442] BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-aar/779 [ 266.939721] caller is debug_smp_processor_id+0x20/0x30 [ 266.944157] CPU: 2 PID: 779 Comm: qemu-system-aar Tainted: G E 5.8.0-rc3-00015-g8d4aa58b2fe3 #1374 [ 266.954268] Hardware name: amlogic w400/w400, BIOS 2020.04 05/22/2020 [ 266.960640] Call trace: [ 266.963064] dump_backtrace+0x0/0x1e0 [ 266.966679] show_stack+0x20/0x30 [ 266.969959] dump_stack+0xe4/0x154 [ 266.973338] check_preemption_disabled+0xf8/0x108 [ 266.977978] debug_smp_processor_id+0x20/0x30 [ 266.982307] kvm_vcpu_pmu_restore_guest+0x2c/0x68 [ 266.986949] access_pmcr+0xf8/0x128 [ 266.990399] perform_access+0x8c/0x250 [ 266.994108] kvm_handle_sys_reg+0x10c/0x2f8 [ 266.998247] handle_exit+0x78/0x200 [ 267.001697] kvm_arch_vcpu_ioctl_run+0x2ac/0xab8 Note that the bug was always there, it is only the switch to using percpu accessors that made it obvious. The fix is to wrap these accesses in a preempt-disabled section, so that we sample a coherent context on trap from the guest. Fixes: 435e53fb5e21 ("arm64: KVM: Enable VHE support for :G/:H perf event modifiers") Cc:: Andrew Murray Signed-off-by: Marc Zyngier commit 87730ccbddcb48478b1b88e88b14e73424130764 Author: Leonid Ravich Date: Wed Jul 1 21:48:12 2020 +0300 dmaengine: ioat setting ioat timeout as module parameter DMA transaction time to completion is a function of PCI bandwidth, transaction size and a queue depth. So hard coded value for timeouts might be wrong for some scenarios. Signed-off-by: Leonid Ravich Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20200701184816.29138-1-leonid.ravich@dell.com Signed-off-by: Vinod Koul commit 8678c71c17721e0f771f135967ef0cce8f69ce9a Author: Angelo Dureghello Date: Thu Jul 2 00:52:05 2020 +0200 dmaengine: fsl-edma: fix wrong tcd endianness for big-endian cpu Due to recent fixes in m68k arch-specific I/O accessor macros, this driver is not working anymore for ColdFire. Fix wrong tcd endianness removing additional swaps, since edma_writex() functions should already take care of any eventual swap if needed. Note, i could only test the change in ColdFire mcf54415 and Vybrid vf50 / Colibri where i don't see any issue. So, every feedback and test for all other SoCs involved is really appreciated. Signed-off-by: Angelo Dureghello Reported-by: kbuild test robot Link: https://lore.kernel.org/r/20200701225205.1674463-1-angelo.dureghello@timesys.com Signed-off-by: Vinod Koul commit fd17d1abce426b4224a916a242b57be94272771b Author: Peter Ujfalusi Date: Wed Jul 1 13:12:25 2020 +0300 dmaengine: dmatest: stop completed threads when running without set channel The completed threads were not cleared and consequent run would result threads accumulating: echo 800000 > /sys/module/dmatest/parameters/test_buf_size echo 2000 > /sys/module/dmatest/parameters/timeout echo 50 > /sys/module/dmatest/parameters/iterations echo 1 > /sys/module/dmatest/parameters/max_channels echo "" > /sys/module/dmatest/parameters/channel [ 237.507265] dmatest: Added 1 threads using dma1chan2 echo 1 > /sys/module/dmatest/parameters/run [ 244.713360] dmatest: Started 1 threads using dma1chan2 [ 246.117680] dmatest: dma1chan2-copy0: summary 50 tests, 0 failures 2437.47 iops 977623 KB/s (0) echo 1 > /sys/module/dmatest/parameters/run [ 292.381471] dmatest: No channels configured, continue with any [ 292.389307] dmatest: Added 1 threads using dma1chan3 [ 292.394302] dmatest: Started 1 threads using dma1chan2 [ 292.399454] dmatest: Started 1 threads using dma1chan3 [ 293.800835] dmatest: dma1chan3-copy0: summary 50 tests, 0 failures 2624.53 iops 975014 KB/s (0) echo 1 > /sys/module/dmatest/parameters/run [ 307.301429] dmatest: No channels configured, continue with any [ 307.309212] dmatest: Added 1 threads using dma1chan4 [ 307.314197] dmatest: Started 1 threads using dma1chan2 [ 307.319343] dmatest: Started 1 threads using dma1chan3 [ 307.324492] dmatest: Started 1 threads using dma1chan4 [ 308.730773] dmatest: dma1chan4-copy0: summary 50 tests, 0 failures 2390.28 iops 965436 KB/s (0) Fixes: 6b41030fdc79 ("dmaengine: dmatest: Restore default for channel") Reported-by: Grygorii Strashko Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200701101225.8607-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit e142087b15960a4e1e5932942e5abae1f49d2318 Author: Robin Gong Date: Tue Jun 30 00:59:58 2020 +0800 dmaengine: fsl-edma-common: correct DSIZE_32BYTE Correct EDMA_TCD_ATTR_DSIZE_32BYTE define since it's broken by the below: '0x0005 --> BIT(3) | BIT(0))' Fixes: 4d6d3a90e4ac ("dmaengine: fsl-edma: fix macros") Signed-off-by: Robin Gong Tested-by: Angelo Dureghello Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1593449998-32091-1-git-send-email-yibin.gong@nxp.com Signed-off-by: Vinod Koul commit 99ba8b9b0d9780e9937eb1d488d120e9e5c2533d Author: Andy Shevchenko Date: Sun Jul 5 14:56:20 2020 +0300 dmaengine: dw: Initialize channel before each transfer In some cases DMA can be used only with a consumer which does runtime power management and on the platforms, that have DMA auto power gating logic (see comments in the drivers/acpi/acpi_lpss.c), may result in DMA losing its context. Simple mitigation of this issue is to initialize channel each time the consumer initiates a transfer. Fixes: cfdf5b6cc598 ("dw_dmac: add support for Lynxpoint DMA controllers") Reported-by: Tsuchiya Yuto Signed-off-by: Andy Shevchenko Acked-by: Viresh Kumar BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206403 Link: https://lore.kernel.org/r/20200705115620.51929-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit bc4071aafcf4d0535ee423b69167696d6c03207d Author: Evgeny Novikov Date: Fri Jul 3 14:15:18 2020 +0300 hwmon: (aspeed-pwm-tacho) Avoid possible buffer overflow aspeed_create_fan() reads a pwm_port value using of_property_read_u32(). If pwm_port will be more than ARRAY_SIZE(pwm_port_params), there will be a buffer overflow in aspeed_create_pwm_port()->aspeed_set_pwm_port_enable(). The patch fixes the potential buffer overflow. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Link: https://lore.kernel.org/r/20200703111518.9644-1-novikov@ispras.ru Signed-off-by: Guenter Roeck commit dcb7fd82c75ee2d6e6f9d8cc71c52519ed52e258 Author: Linus Torvalds Date: Sun Jul 5 16:20:22 2020 -0700 Linux 5.8-rc4 commit bb5a93aaf25261321db0c499cde7da6ee9d8b164 Author: Linus Torvalds Date: Sun Jul 5 12:50:20 2020 -0700 x86/ldt: use "pr_info_once()" instead of open-coding it badly Using a mutex for "print this warning only once" is so overdesigned as to be actively offensive to my sensitive stomach. Just use "pr_info_once()" that already does this, although in a (harmlessly) racy manner that can in theory cause the message to be printed twice if more than one CPU races on that "is this the first time" test. [ If somebody really cares about that harmless data race (which sounds very unlikely indeed), that person can trivially fix printk_once() by using a simple atomic access, preferably with an optimistic non-atomic test first before even bothering to treat the pointless "make sure it is _really_ just once" case. A mutex is most definitely never the right primitive to use for something like this. ] Yes, this is a small and meaningless detail in a code path that hardly matters. But let's keep some code quality standards here, and not accept outrageously bad code. Link: https://lore.kernel.org/lkml/CAHk-=wgV9toS7GU3KmNpj8hCS9SeF+A0voHS8F275_mgLhL4Lw@mail.gmail.com/ Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Peter Zijlstra (Intel) Signed-off-by: Linus Torvalds commit a4c0e91d1d65bc58f928b80ed824e10e165da22c Author: Ingo Molnar Date: Sun Jul 5 21:33:11 2020 +0200 x86/entry/32: Fix XEN_PV build dependency xenpv_exc_nmi() and xenpv_exc_debug() are only defined on 64-bit kernels, but they snuck into the 32-bit build via , causing the link to fail: ld: arch/x86/entry/entry_32.o: in function `asm_xenpv_exc_nmi': (.entry.text+0x817): undefined reference to `xenpv_exc_nmi' ld: arch/x86/entry/entry_32.o: in function `asm_xenpv_exc_debug': (.entry.text+0x827): undefined reference to `xenpv_exc_debug' Only use them on 64-bit kernels. Fixes: f41f0824224e: ("x86/entry/xen: Route #DB correctly on Xen PV") Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Peter Zijlstra (Intel) Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 72674d480076067d627e708c0a062dd900438bd7 Merge: f23dbe18930b cc801833a171 Author: Linus Torvalds Date: Sun Jul 5 12:23:49 2020 -0700 Merge tag 'x86-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "A series of fixes for x86: - Reset MXCSR in kernel_fpu_begin() to prevent using a stale user space value. - Prevent writing MSR_TEST_CTRL on CPUs which are not explicitly whitelisted for split lock detection. Some CPUs which do not support it crash even when the MSR is written to 0 which is the default value. - Fix the XEN PV fallout of the entry code rework - Fix the 32bit fallout of the entry code rework - Add more selftests to ensure that these entry problems don't come back. - Disable 16 bit segments on XEN PV. It's not supported because XEN PV does not implement ESPFIX64" * tag 'x86-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ldt: Disable 16-bit segments on Xen PV x86/entry/32: Fix #MC and #DB wiring on x86_32 x86/entry/xen: Route #DB correctly on Xen PV x86/entry, selftests: Further improve user entry sanity checks x86/entry/compat: Clear RAX high bits on Xen PV SYSENTER selftests/x86: Consolidate and fix get/set_eflags() helpers selftests/x86/syscall_nt: Clear weird flags after each test selftests/x86/syscall_nt: Add more flag combinations x86/entry/64/compat: Fix Xen PV SYSENTER frame setup x86/entry: Move SYSENTER's regs->sp and regs->flags fixups into C x86/entry: Assert that syscalls are on the right stack x86/split_lock: Don't write MSR_TEST_CTRL on CPUs that aren't whitelisted x86/fpu: Reset MXCSR to default in kernel_fpu_begin() commit f23dbe18930ba992f5c8c7b31e80f40dd6716081 Merge: 5465a324af6a 98817a84ff1c Author: Linus Torvalds Date: Sun Jul 5 12:22:35 2020 -0700 Merge tag 'irq-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Thomas Gleixner: "A set of interrupt chip driver fixes: - Ensure the atomicity of affinity updates in the GIC driver - Don't try to sleep in atomic context when waiting for the GICv4.1 to respond. Use polling instead. - Typo fixes in Kconfig and warnings" * tag 'irq-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic: Atomically update affinity irqchip/riscv-intc: Fix a typo in a pr_warn() irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix sleep in atomic irqchip/loongson-pci-msi: Fix a typo in Kconfig commit 5465a324af6af2f2debd23a9336650457d6cb0fd Merge: 4bc927367db1 5fdeefa053df Author: Linus Torvalds Date: Sun Jul 5 12:21:28 2020 -0700 Merge tag 'core-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull rcu fixlet from Thomas Gleixner: "A single fix for a printk format warning in RCU" * tag 'core-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rcuperf: Fix printk format warning commit 4bc927367db11d8c5b1e20d05729f1ee748791b9 Merge: 19a61a753d07 ba77dca584f5 Author: Linus Torvalds Date: Sun Jul 5 12:14:24 2020 -0700 Merge tag 'kbuild-fixes-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes frin Masahiro Yamada: - fix various bugs in xconfig - fix some issues in cross-compilation using Clang - fix documentation * tag 'kbuild-fixes-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: .gitignore: Do not track `defconfig` from `make savedefconfig` kbuild: make Clang build userprogs for target architecture kbuild: fix CONFIG_CC_CAN_LINK(_STATIC) for cross-compilation with Clang kconfig: qconf: parse newer types at debug info kconfig: qconf: navigate menus on hyperlinks kconfig: qconf: don't show goback button on splitMode kconfig: qconf: simplify the goBack() logic kconfig: qconf: re-implement setSelected() kconfig: qconf: make debug links work again kconfig: qconf: make search fully work again on split mode kconfig: qconf: cleanup includes docs: kbuild: fix ReST formatting gcc-plugins: fix gcc-plugins directory path in documentation commit 19a61a753d0705fcb41e7aa130351e0a0a54c3bd Merge: 29206c6314a3 311950f8b8d8 Author: Linus Torvalds Date: Sun Jul 5 10:56:44 2020 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Four small fixes in three drivers. The mptfusion one has actually caused user visible issues in certain kernel configurations" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mptfusion: Don't use GFP_ATOMIC for larger DMA allocations scsi: libfc: Skip additional kref updating work event scsi: libfc: Handling of extra kref scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() commit 29206c6314a3e5242b23b61cd1270cba9e93b415 Merge: 9fbe565cb78d 3197d48a7c04 Author: Linus Torvalds Date: Sun Jul 5 10:45:31 2020 -0700 Merge tag 'block-5.8-2020-07-05' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe fixes from Christoph: - Fix crash in multi-path disk add (Christoph) - Fix ignore of identify error (Sagi) - Fix a compiler complaint that a function should be static (Wei) * tag 'block-5.8-2020-07-05' of git://git.kernel.dk/linux-block: block: make function __bio_integrity_free() static nvme: fix a crash in nvme_mpath_add_disk nvme: fix identify error status silent ignore commit 9fbe565cb78d10ca2619ee23eac27262cff45629 Merge: 7783485401e8 b7db41c9e03b Author: Linus Torvalds Date: Sun Jul 5 10:41:33 2020 -0700 Merge tag 'io_uring-5.8-2020-07-05' of git://git.kernel.dk/linux-block Pull io_uring fix from Jens Axboe: "Andres reported a regression with the fix that was merged earlier this week, where his setup of using signals to interrupt io_uring CQ waits no longer worked correctly. Fix this, and also limit our use of TWA_SIGNAL to the case where we need it, and continue using TWA_RESUME for task_work as before. Since the original is marked for 5.7 stable, let's flush this one out early" * tag 'io_uring-5.8-2020-07-05' of git://git.kernel.dk/linux-block: io_uring: fix regression with always ignoring signals in io_cqring_wait() commit 7783485401e802b4802c93cb1b23deb7f0d168a4 Merge: 45a5ac7a5cc3 597911287fcd Author: Linus Torvalds Date: Sun Jul 5 10:35:01 2020 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "The usual driver fixes and documentation updates" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mlxcpld: check correct size of maximum RECV_LEN packet i2c: add Kconfig help text for slave mode i2c: slave-eeprom: update documentation i2c: eg20t: Load module automatically if ID matches i2c: designware: platdrv: Set class based on DMI i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665 commit 45a5ac7a5cc3c71739d240c422c3818a5bc97fc4 Merge: 9bc0b029a888 5868347a192a Author: Linus Torvalds Date: Sun Jul 5 10:29:32 2020 -0700 Merge tag 'mips_fixes_5.8_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - fix for missing hazard barrier - DT fix for ingenic - DT fix of GPHY names for lantiq - fix usage of smp_processor_id() while preemption is enabled * tag 'mips_fixes_5.8_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Do not use smp_processor_id() in preemptible code MIPS: Add missing EHB in mtc0 -> mfc0 sequence for DSPen MIPS: ingenic: gcw0: Fix HP detection GPIO. MIPS: lantiq: xway: sysctrl: fix the GPHY clock alias names commit b0536f9826a5ed3328d527b4fc1686867a9f3041 Author: Christophe JAILLET Date: Sun May 17 11:59:53 2020 +0200 iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()' If 'ad7780_init_gpios()' fails, we must not release some resources that have not been allocated yet. Return directly instead. Fixes: 5bb30e7daf00 ("staging: iio: ad7780: move regulator to after GPIO init") Fixes: 9085daa4abcc ("staging: iio: ad7780: add gain & filter gpio support") Signed-off-by: Christophe JAILLET Acked-by: Renato Lui Geh Signed-off-by: Jonathan Cameron commit 8db4afe163bbdd93dca6fcefbb831ef12ecc6b4d Author: Jonathan Cameron Date: Sun Jun 7 16:53:57 2020 +0100 iio:pressure:ms5611 Fix buffer element alignment One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. Here there is no data leak possibility so use an explicit structure on the stack to ensure alignment and nice readable fashion. The forced alignment of ts isn't strictly necessary in this driver as the padding will be correct anyway (there isn't any). However it is probably less fragile to have it there and it acts as documentation of the requirement. Fixes: 713bbb4efb9dc ("iio: pressure: ms5611: Add triggered buffer support") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Acked-by: Tomasz Duszynski Cc: commit 5c49056ad9f3c786f7716da2dd47e4488fc6bd25 Author: Jonathan Cameron Date: Sun Jun 7 16:53:53 2020 +0100 iio:humidity:hts221 Fix alignment and data leak issues One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data. This data is allocated with kzalloc so no data can leak apart from previous readings. Explicit alignment of ts needed to ensure consistent padding on all architectures (particularly x86_32 with it's 4 byte alignment of s64) Fixes: e4a70e3e7d84 ("iio: humidity: add support to hts221 rh/temp combo device") Reported-by: Lars-Peter Clausen Acked-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron Cc: commit ea5e7a7bb6205d24371373cd80325db1bc15eded Author: Jonathan Cameron Date: Sun Jun 7 16:53:52 2020 +0100 iio:humidity:hdc100x Fix alignment and data leak issues One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data. This data is allocated with kzalloc so no data can leak apart from previous readings. Fixes: 16bf793f86b2 ("iio: humidity: hdc100x: add triggered buffer support for HDC100X") Reported-by: Lars-Peter Clausen Acked-by: Matt Ranostay Cc: Alison Schofield Signed-off-by: Jonathan Cameron Cc: commit 838e00b13bfd4cac8b24df25bfc58e2eb99bcc70 Author: Jonathan Cameron Date: Sun Jun 7 16:53:49 2020 +0100 iio:magnetometer:ak8974: Fix alignment and data leak issues One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data. This data is allocated with kzalloc so no data can leak appart from previous readings. Fixes: 7c94a8b2ee8cf ("iio: magn: add a driver for AK8974") Reported-by: Lars-Peter Clausen Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron Cc: commit 5868347a192afb99b189d72946ab6a321b6115ac Author: Xingxing Su Date: Fri Jul 3 12:11:58 2020 +0800 MIPS: Do not use smp_processor_id() in preemptible code Use preempt_disable() to fix the following bug under CONFIG_DEBUG_PREEMPT. [ 21.915305] BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-mip/1056 [ 21.923996] caller is do_ri+0x1d4/0x690 [ 21.927921] CPU: 0 PID: 1056 Comm: qemu-system-mip Not tainted 5.8.0-rc2 #3 [ 21.934913] Stack : 0000000000000001 ffffffff81370000 ffffffff8071cd60 a80f926d5ac95694 [ 21.942984] a80f926d5ac95694 0000000000000000 98000007f0043c88 ffffffff80f2fe40 [ 21.951054] 0000000000000000 0000000000000000 0000000000000001 0000000000000000 [ 21.959123] ffffffff802d60cc 98000007f0043dd8 ffffffff81f4b1e8 ffffffff81f60000 [ 21.967192] ffffffff81f60000 ffffffff80fe0000 ffff000000000000 0000000000000000 [ 21.975261] fffffffff500cce1 0000000000000001 0000000000000002 0000000000000000 [ 21.983331] ffffffff80fe1a40 0000000000000006 ffffffff8077f940 0000000000000000 [ 21.991401] ffffffff81460000 98000007f0040000 98000007f0043c80 000000fffba8cf20 [ 21.999471] ffffffff8071cd60 0000000000000000 0000000000000000 0000000000000000 [ 22.007541] 0000000000000000 0000000000000000 ffffffff80212ab4 a80f926d5ac95694 [ 22.015610] ... [ 22.018086] Call Trace: [ 22.020562] [] show_stack+0xa4/0x138 [ 22.025732] [] dump_stack+0xf0/0x150 [ 22.030903] [] check_preemption_disabled+0xf4/0x100 [ 22.037375] [] do_ri+0x1d4/0x690 [ 22.042198] [] handle_ri_int+0x44/0x5c [ 24.359386] BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-mip/1072 [ 24.368204] caller is do_ri+0x1a8/0x690 [ 24.372169] CPU: 4 PID: 1072 Comm: qemu-system-mip Not tainted 5.8.0-rc2 #3 [ 24.379170] Stack : 0000000000000001 ffffffff81370000 ffffffff8071cd60 a80f926d5ac95694 [ 24.387246] a80f926d5ac95694 0000000000000000 98001007ef06bc88 ffffffff80f2fe40 [ 24.395318] 0000000000000000 0000000000000000 0000000000000001 0000000000000000 [ 24.403389] ffffffff802d60cc 98001007ef06bdd8 ffffffff81f4b818 ffffffff81f60000 [ 24.411461] ffffffff81f60000 ffffffff80fe0000 ffff000000000000 0000000000000000 [ 24.419533] fffffffff500cce1 0000000000000001 0000000000000002 0000000000000000 [ 24.427603] ffffffff80fe0000 0000000000000006 ffffffff8077f940 0000000000000020 [ 24.435673] ffffffff81460020 98001007ef068000 98001007ef06bc80 000000fffbbbb370 [ 24.443745] ffffffff8071cd60 0000000000000000 0000000000000000 0000000000000000 [ 24.451816] 0000000000000000 0000000000000000 ffffffff80212ab4 a80f926d5ac95694 [ 24.459887] ... [ 24.462367] Call Trace: [ 24.464846] [] show_stack+0xa4/0x138 [ 24.470029] [] dump_stack+0xf0/0x150 [ 24.475208] [] check_preemption_disabled+0xf4/0x100 [ 24.481682] [] do_ri+0x1a8/0x690 [ 24.486509] [] handle_ri_int+0x44/0x5c Signed-off-by: Xingxing Su Signed-off-by: Thomas Bogendoerfer commit fcec538ef8cca0ad0b84432235dccd9059c8e6f8 Author: Hauke Mehrtens Date: Fri Jul 3 00:53:34 2020 +0200 MIPS: Add missing EHB in mtc0 -> mfc0 sequence for DSPen This resolves the hazard between the mtc0 in the change_c0_status() and the mfc0 in configure_exception_vector(). Without resolving this hazard configure_exception_vector() could read an old value and would restore this old value again. This would revert the changes change_c0_status() did. I checked this by printing out the read_c0_status() at the end of per_cpu_trap_init() and the ST0_MX is not set without this patch. The hazard is documented in the MIPS Architecture Reference Manual Vol. III: MIPS32/microMIPS32 Privileged Resource Architecture (MD00088), rev 6.03 table 8.1 which includes: Producer | Consumer | Hazard ----------|----------|---------------------------- mtc0 | mfc0 | any coprocessor 0 register I saw this hazard on an Atheros AR9344 rev 2 SoC with a MIPS 74Kc CPU. There the change_c0_status() function would activate the DSPen by setting ST0_MX in the c0_status register. This was reverted and then the system got a DSP exception when the DSP registers were saved in save_dsp() in the first process switch. The crash looks like this: [ 0.089999] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.097796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.107070] Kernel panic - not syncing: Unexpected DSP exception [ 0.113470] Rebooting in 1 seconds.. We saw this problem in OpenWrt only on the MIPS 74Kc based Atheros SoCs, not on the 24Kc based SoCs. We only saw it with kernel 5.4 not with kernel 4.19, in addition we had to use GCC 8.4 or 9.X, with GCC 8.3 it did not happen. In the kernel I bisected this problem to commit 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING"), but when this was reverted it also happened after commit 172dcd935c34b ("MIPS: Always allocate exception vector for MIPSr2+"). Commit 0b24cae4d535 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.") does similar changes to a different file. I am not sure if there are more places affected by this problem. Signed-off-by: Hauke Mehrtens Cc: Signed-off-by: Thomas Bogendoerfer commit ba77dca584f5abf30340672bc752fe7912731af5 Author: Paul Menzel Date: Thu Jul 2 13:12:00 2020 +0200 .gitignore: Do not track `defconfig` from `make savedefconfig` Running `make savedefconfig` creates by default `defconfig`, which is, currently, on git’s radar, for example, `git status` lists this file as untracked. So, add the file to `.gitignore`, so it’s ignored by git. Signed-off-by: Paul Menzel Acked-by: Greg Kroah-Hartman Signed-off-by: Masahiro Yamada commit 0f57a1e522f413e87852e632f55de4723e511939 Merge: ccfc9df1352b 2fb2799a2abb Author: David S. Miller Date: Sat Jul 4 18:04:56 2020 -0700 Merge branch 'net-rmnet-fix-interface-leak-for-rmnet-module' Taehee Yoo says: ==================== net: rmnet: fix interface leak for rmnet module There are two problems in rmnet module that they occur the leak of a lower interface. The symptom is the same, which is the leak of a lower interface. But there are two different real problems. This patchset is to fix these real problems. 1. Do not allow to have different two modes. As a lower interface of rmnet, there are two modes that they are VND and BRIDGE. One interface can have only one mode. But in the current rmnet, there is no code to prevent to have two modes in one lower interface. So, interface leak occurs. 2. Do not allow to add multiple bridge interfaces. rmnet can have only two bridge interface. If an additional bridge interface is tried to be attached, rmnet should deny it. But there is no code to do that. So, interface leak occurs. ==================== Signed-off-by: David S. Miller commit 2fb2799a2abb39d7dbb48abb3baa1133bf5e921a Author: Taehee Yoo Date: Thu Jul 2 17:08:55 2020 +0000 net: rmnet: do not allow to add multiple bridge interfaces rmnet can have only two bridge interface. One of them is a link interface and another one is added by the master operation. rmnet interface shouldn't allow adding additional bridge interfaces by mater operation. But, there is no code to deny additional interfaces. So, interface leak occurs. Test commands: ip link add dummy0 type dummy ip link add dummy1 type dummy ip link add dummy2 type dummy ip link add rmnet0 link dummy0 type rmnet mux_id 1 ip link set dummy1 master rmnet0 ip link set dummy2 master rmnet0 ip link del rmnet0 In the above test command, the dummy0 was attached to rmnet as VND mode. Then, dummy1 was attached to rmnet0 as BRIDGE mode. At this point, dummy0 mode is switched from VND to BRIDGE automatically. Then, dummy2 is attached to rmnet as BRIDGE mode. At this point, rmnet0 should deny this operation. But, rmnet0 doesn't deny this. So that below splat occurs when the rmnet0 interface is deleted. Splat looks like: [ 186.684787][ C2] WARNING: CPU: 2 PID: 1009 at net/core/dev.c:8992 rollback_registered_many+0x986/0xcf0 [ 186.684788][ C2] Modules linked in: rmnet dummy openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_x [ 186.684805][ C2] CPU: 2 PID: 1009 Comm: ip Not tainted 5.8.0-rc1+ #621 [ 186.684807][ C2] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 186.684808][ C2] RIP: 0010:rollback_registered_many+0x986/0xcf0 [ 186.684811][ C2] Code: 41 8b 4e cc 45 31 c0 31 d2 4c 89 ee 48 89 df e8 e0 47 ff ff 85 c0 0f 84 cd fc ff ff 5 [ 186.684812][ C2] RSP: 0018:ffff8880cd9472e0 EFLAGS: 00010287 [ 186.684815][ C2] RAX: ffff8880cc56da58 RBX: ffff8880ab21c000 RCX: ffffffff9329d323 [ 186.684816][ C2] RDX: 1ffffffff2be6410 RSI: 0000000000000008 RDI: ffffffff95f32080 [ 186.684818][ C2] RBP: dffffc0000000000 R08: fffffbfff2be6411 R09: fffffbfff2be6411 [ 186.684819][ C2] R10: ffffffff95f32087 R11: 0000000000000001 R12: ffff8880cd947480 [ 186.684820][ C2] R13: ffff8880ab21c0b8 R14: ffff8880cd947400 R15: ffff8880cdf10640 [ 186.684822][ C2] FS: 00007f00843890c0(0000) GS:ffff8880d4e00000(0000) knlGS:0000000000000000 [ 186.684823][ C2] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 186.684825][ C2] CR2: 000055b8ab1077b8 CR3: 00000000ab612006 CR4: 00000000000606e0 [ 186.684826][ C2] Call Trace: [ 186.684827][ C2] ? lockdep_hardirqs_on_prepare+0x379/0x540 [ 186.684829][ C2] ? netif_set_real_num_tx_queues+0x780/0x780 [ 186.684830][ C2] ? rmnet_unregister_real_device+0x56/0x90 [rmnet] [ 186.684831][ C2] ? __kasan_slab_free+0x126/0x150 [ 186.684832][ C2] ? kfree+0xdc/0x320 [ 186.684834][ C2] ? rmnet_unregister_real_device+0x56/0x90 [rmnet] [ 186.684835][ C2] unregister_netdevice_many.part.135+0x13/0x1b0 [ 186.684836][ C2] rtnl_delete_link+0xbc/0x100 [ ... ] [ 238.440071][ T1009] unregister_netdevice: waiting for rmnet0 to become free. Usage count = 1 Fixes: 037f9cdf72fb ("net: rmnet: use upper/lower device infrastructure") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 2a762e9e8cd1cf1242e4269a2244666ed02eecd1 Author: Taehee Yoo Date: Thu Jul 2 17:08:18 2020 +0000 net: rmnet: fix lower interface leak There are two types of the lower interface of rmnet that are VND and BRIDGE. Each lower interface can have only one type either VND or BRIDGE. But, there is a case, which uses both lower interface types. Due to this unexpected behavior, lower interface leak occurs. Test commands: ip link add dummy0 type dummy ip link add dummy1 type dummy ip link add rmnet0 link dummy0 type rmnet mux_id 1 ip link set dummy1 master rmnet0 ip link add rmnet1 link dummy1 type rmnet mux_id 2 ip link del rmnet0 The dummy1 was attached as BRIDGE interface of rmnet0. Then, it also was attached as VND interface of rmnet1. This is unexpected behavior and there is no code for handling this case. So that below splat occurs when the rmnet0 interface is deleted. Splat looks like: [ 53.254112][ C1] WARNING: CPU: 1 PID: 1192 at net/core/dev.c:8992 rollback_registered_many+0x986/0xcf0 [ 53.254117][ C1] Modules linked in: rmnet dummy openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nfx [ 53.254182][ C1] CPU: 1 PID: 1192 Comm: ip Not tainted 5.8.0-rc1+ #620 [ 53.254188][ C1] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 53.254192][ C1] RIP: 0010:rollback_registered_many+0x986/0xcf0 [ 53.254200][ C1] Code: 41 8b 4e cc 45 31 c0 31 d2 4c 89 ee 48 89 df e8 e0 47 ff ff 85 c0 0f 84 cd fc ff ff 0f 0b e5 [ 53.254205][ C1] RSP: 0018:ffff888050a5f2e0 EFLAGS: 00010287 [ 53.254214][ C1] RAX: ffff88805756d658 RBX: ffff88804d99c000 RCX: ffffffff8329d323 [ 53.254219][ C1] RDX: 1ffffffff0be6410 RSI: 0000000000000008 RDI: ffffffff85f32080 [ 53.254223][ C1] RBP: dffffc0000000000 R08: fffffbfff0be6411 R09: fffffbfff0be6411 [ 53.254228][ C1] R10: ffffffff85f32087 R11: 0000000000000001 R12: ffff888050a5f480 [ 53.254233][ C1] R13: ffff88804d99c0b8 R14: ffff888050a5f400 R15: ffff8880548ebe40 [ 53.254238][ C1] FS: 00007f6b86b370c0(0000) GS:ffff88806c200000(0000) knlGS:0000000000000000 [ 53.254243][ C1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 53.254248][ C1] CR2: 0000562c62438758 CR3: 000000003f600005 CR4: 00000000000606e0 [ 53.254253][ C1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 53.254257][ C1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 53.254261][ C1] Call Trace: [ 53.254266][ C1] ? lockdep_hardirqs_on_prepare+0x379/0x540 [ 53.254270][ C1] ? netif_set_real_num_tx_queues+0x780/0x780 [ 53.254275][ C1] ? rmnet_unregister_real_device+0x56/0x90 [rmnet] [ 53.254279][ C1] ? __kasan_slab_free+0x126/0x150 [ 53.254283][ C1] ? kfree+0xdc/0x320 [ 53.254288][ C1] ? rmnet_unregister_real_device+0x56/0x90 [rmnet] [ 53.254293][ C1] unregister_netdevice_many.part.135+0x13/0x1b0 [ 53.254297][ C1] rtnl_delete_link+0xbc/0x100 [ 53.254301][ C1] ? rtnl_af_register+0xc0/0xc0 [ 53.254305][ C1] rtnl_dellink+0x2dc/0x840 [ 53.254309][ C1] ? find_held_lock+0x39/0x1d0 [ 53.254314][ C1] ? valid_fdb_dump_strict+0x620/0x620 [ 53.254318][ C1] ? rtnetlink_rcv_msg+0x457/0x890 [ 53.254322][ C1] ? lock_contended+0xd20/0xd20 [ 53.254326][ C1] rtnetlink_rcv_msg+0x4a8/0x890 [ ... ] [ 73.813696][ T1192] unregister_netdevice: waiting for rmnet0 to become free. Usage count = 1 Fixes: 037f9cdf72fb ("net: rmnet: use upper/lower device infrastructure") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit ccfc9df1352be5b2f391091e18c4b2395d30ce78 Author: Taehee Yoo Date: Thu Jul 2 17:06:19 2020 +0000 hsr: fix interface leak in error path of hsr_dev_finalize() To release hsr(upper) interface, it should release its own lower interfaces first. Then, hsr(upper) interface can be released safely. In the current code of error path of hsr_dev_finalize(), it releases hsr interface before releasing a lower interface. So, a warning occurs, which warns about the leak of lower interfaces. In order to fix this problem, changing the ordering of the error path of hsr_dev_finalize() is needed. Test commands: ip link add dummy0 type dummy ip link add dummy1 type dummy ip link add dummy2 type dummy ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 ip link add hsr1 type hsr slave1 dummy2 slave2 dummy0 Splat looks like: [ 214.923127][ C2] WARNING: CPU: 2 PID: 1093 at net/core/dev.c:8992 rollback_registered_many+0x986/0xcf0 [ 214.923129][ C2] Modules linked in: hsr dummy openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipx [ 214.923154][ C2] CPU: 2 PID: 1093 Comm: ip Not tainted 5.8.0-rc2+ #623 [ 214.923156][ C2] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 214.923157][ C2] RIP: 0010:rollback_registered_many+0x986/0xcf0 [ 214.923160][ C2] Code: 41 8b 4e cc 45 31 c0 31 d2 4c 89 ee 48 89 df e8 e0 47 ff ff 85 c0 0f 84 cd fc ff ff 5 [ 214.923162][ C2] RSP: 0018:ffff8880c5156f28 EFLAGS: 00010287 [ 214.923165][ C2] RAX: ffff8880d1dad458 RBX: ffff8880bd1b9000 RCX: ffffffffb929d243 [ 214.923167][ C2] RDX: 1ffffffff77e63f0 RSI: 0000000000000008 RDI: ffffffffbbf31f80 [ 214.923168][ C2] RBP: dffffc0000000000 R08: fffffbfff77e63f1 R09: fffffbfff77e63f1 [ 214.923170][ C2] R10: ffffffffbbf31f87 R11: 0000000000000001 R12: ffff8880c51570a0 [ 214.923172][ C2] R13: ffff8880bd1b90b8 R14: ffff8880c5157048 R15: ffff8880d1dacc40 [ 214.923174][ C2] FS: 00007fdd257a20c0(0000) GS:ffff8880da200000(0000) knlGS:0000000000000000 [ 214.923175][ C2] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 214.923177][ C2] CR2: 00007ffd78beb038 CR3: 00000000be544005 CR4: 00000000000606e0 [ 214.923179][ C2] Call Trace: [ 214.923180][ C2] ? netif_set_real_num_tx_queues+0x780/0x780 [ 214.923182][ C2] ? dev_validate_mtu+0x140/0x140 [ 214.923183][ C2] ? synchronize_rcu.part.79+0x85/0xd0 [ 214.923185][ C2] ? synchronize_rcu_expedited+0xbb0/0xbb0 [ 214.923187][ C2] rollback_registered+0xc8/0x170 [ 214.923188][ C2] ? rollback_registered_many+0xcf0/0xcf0 [ 214.923190][ C2] unregister_netdevice_queue+0x18b/0x240 [ 214.923191][ C2] hsr_dev_finalize+0x56e/0x6e0 [hsr] [ 214.923192][ C2] hsr_newlink+0x36b/0x450 [hsr] [ 214.923194][ C2] ? hsr_dellink+0x70/0x70 [hsr] [ 214.923195][ C2] ? rtnl_create_link+0x2e4/0xb00 [ 214.923197][ C2] ? __netlink_ns_capable+0xc3/0xf0 [ 214.923198][ C2] __rtnl_newlink+0xbdb/0x1270 [ ... ] Fixes: e0a4b99773d3 ("hsr: use upper/lower device infrastructure") Reported-by: syzbot+7f1c020f68dab95aab59@syzkaller.appspotmail.com Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 6dbb89014dc303facc54d33ae64419d2f9c8ff32 Author: Luo bin Date: Sat Jul 4 15:32:43 2020 +0800 hinic: fix sending mailbox timeout in aeq event work When sending mailbox in the work of aeq event, another aeq event will be triggered. because the last aeq work is not exited and only one work can be excuted simultaneously in the same workqueue, mailbox sending function will return failure of timeout. We create and use another workqueue to fix this. Signed-off-by: Luo bin Signed-off-by: David S. Miller commit c00e858d550c141169cde01c0d220d9eb21321a8 Merge: 4d572545543e d005fbb855d3 Author: David S. Miller Date: Sat Jul 4 17:47:35 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Use kvfree() to release vmalloc()'ed areas in ipset, from Eric Dumazet. 2) UAF in nfnetlink_queue from the nf_conntrack_update() path. ==================== Signed-off-by: David S. Miller commit 4d572545543e7b54d3f9721e54cb71d02d026209 Merge: d7bf2ebebc2b e54ac95afb2f Author: David S. Miller Date: Sat Jul 4 17:46:21 2020 -0700 Merge branch 'Documentation-networking-eliminate-doubled-words' Randy Dunlap says: ==================== Documentation: networking: eliminate doubled words Drop all duplicated words in Documentation/networking/ files. ==================== Signed-off-by: David S. Miller commit e54ac95afb2fe9dabcbb139b1705d5a8fe96345a Author: Randy Dunlap Date: Fri Jul 3 15:41:15 2020 -0700 Documentation: networking: rxrpc: drop doubled word Drop the doubled word "have". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: David Howells Cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 474112d57c70520ebd81a5ca578fee1d93fafd07 Author: Randy Dunlap Date: Fri Jul 3 15:41:14 2020 -0700 Documentation: networking: ipvs-sysctl: drop doubled word Drop the doubled word "that". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit a7db3c766916e8a9a054925d036a2746d3e93596 Author: Randy Dunlap Date: Fri Jul 3 15:41:13 2020 -0700 Documentation: networking: ip-sysctl: drop doubled word Drop the doubled word "that". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit 4f6a009c8bdd69b611cf3a807128314992d07bf9 Author: Randy Dunlap Date: Fri Jul 3 15:41:12 2020 -0700 Documentation: networking: dsa: drop doubled word Drop the doubled word "in". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: Andrew Lunn Cc: Vivien Didelot Cc: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6d0fe3aea4a815929118a002a342849e6b9f0cfd Author: Randy Dunlap Date: Fri Jul 3 15:41:11 2020 -0700 Documentation: networking: can_ucan_protocol: drop doubled words Drop the doubled words "the" and "of". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: linux-can@vger.kernel.org Acked-by: Marc Kleine-Budde Signed-off-by: David S. Miller commit e99094856d0ab192501c3e6e2ff77b3ae44f6445 Author: Randy Dunlap Date: Fri Jul 3 15:41:10 2020 -0700 Documentation: networking: ax25: drop doubled word Drop the doubled word "and". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: Ralf Baechle Cc: linux-hams@vger.kernel.org Signed-off-by: David S. Miller commit caebecb0326907e978b064926836b48f94fec62f Author: Randy Dunlap Date: Fri Jul 3 15:41:09 2020 -0700 Documentation: networking: arcnet: drop doubled word Drop the doubled word "to". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit 5ab546f5e6309373aef01a8d398e163ab7a78431 Author: Enric Balletbo i Serra Date: Tue May 19 11:41:15 2020 +0200 drm/mediatek: mtk_hdmi: Remove debug messages for function calls Equivalent information can be nowadays obtained using function tracer Signed-off-by: Enric Balletbo i Serra Signed-off-by: Chun-Kuang Hu commit 3a7826cc24e56ba8d3d18a202968553bdf687d98 Author: Enric Balletbo i Serra Date: Tue May 19 11:40:45 2020 +0200 drm/mediatek: mtk_mt8173_hdmi_phy: Remove unnused const variables There are some `static const u8` variables that are not used, this triggers a warning building with `make W=1`, it is safe to remove them, so do it and make the compiler more happy. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Chun-Kuang Hu commit deb0f88b2208e9e6dbe39a0cbb3cdc458580d999 Author: Matthias Brugger Date: Mon May 18 13:22:54 2020 +0200 drm/mediatek: Delete not used of_device_get_match_data The driver will be loaded by via a platform device. So we will need to get the device_node from the parent device. Depending on this we will set the driver data. As all this is done later already, just delete the call to of_device_get_match_data. Signed-off-by: Matthias Brugger Reviewed-by: Enric Balletbo i Serra Signed-off-by: Chun-Kuang Hu commit e9052927941d393b4bed6f295da763172b7829f0 Author: Bernard Zhao Date: Tue Jun 16 14:51:01 2020 +0800 drm/mediatek: Remove unnecessary conversion to bool In function mtk_dsi_clk_hs_state, remove unnecessary conversion to bool return, this change is to make the code a bit readable. Signed-off-by: Bernard Zhao Signed-off-by: Chun-Kuang Hu commit 9bc0b029a8889f2c67c988760aba66a8d7b22af5 Merge: ec84c3f6ef71 19ab500edb5d Author: Linus Torvalds Date: Sat Jul 4 14:46:11 2020 -0700 Merge tag 'powerpc-5.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "One fix for a regression in our pkey handling, which exhibits as PROT_EXEC mappings taking continuous page faults. Thanks to: Jan Stancek, Aneesh Kumar K.V" * tag 'powerpc-5.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm/pkeys: Make pkey access check work on execute_only_key commit ec84c3f6ef710661c8d14e3f63e540b795dc0a51 Merge: 35e884f89df4 9b23d95c539e Author: Linus Torvalds Date: Sat Jul 4 14:43:26 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "Nothing earth-shattering, really - some CPU errata workarounds (one day they'll get it right, ha!) and a fix for a boot failure with very large kernel images where the alternative patching gets confused when patching relative branches using veneers. - Fix alternative patching for very large kernel images and modules - Hook up existing CPU errata workarounds for Qualcomm Kryo CPUs" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add KRYO4XX silver CPU cores to erratum list 1530923 and 1024718 arm64: Add KRYO4XX gold CPU cores to erratum list 1463225 and 1418040 arm64: Add MIDR value for KRYO4XX gold CPU cores arm64/alternatives: use subsections for replacement sequences commit b7db41c9e03b5189bc94993bd50e4506ac9e34c1 Author: Jens Axboe Date: Sat Jul 4 08:55:50 2020 -0600 io_uring: fix regression with always ignoring signals in io_cqring_wait() When switching to TWA_SIGNAL for task_work notifications, we also made any signal based condition in io_cqring_wait() return -ERESTARTSYS. This breaks applications that rely on using signals to abort someone waiting for events. Check if we have a signal pending because of queued task_work, and repeat the signal check once we've run the task_work. This provides a reliable way of telling the two apart. Additionally, only use TWA_SIGNAL if we are using an eventfd. If not, we don't have the dependency situation described in the original commit, and we can get by with just using TWA_RESUME like we previously did. Fixes: ce593a6c480a ("io_uring: use signal based task_work running") Cc: stable@vger.kernel.org # v5.7 Reported-by: Andres Freund Tested-by: Andres Freund Signed-off-by: Jens Axboe commit cc801833a171163edb6385425349ba8903bd1b20 Author: Andy Lutomirski Date: Fri Jul 3 10:02:57 2020 -0700 x86/ldt: Disable 16-bit segments on Xen PV Xen PV doesn't implement ESPFIX64, so they don't work right. Disable them. Also print a warning the first time anyone tries to use a 16-bit segment on a Xen PV guest that would otherwise allow it to help people diagnose this change in behavior. This gets us closer to having all x86 selftests pass on Xen PV. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/92b2975459dfe5929ecf34c3896ad920bd9e3f2d.1593795633.git.luto@kernel.org commit 13cbc0cd4a30c815984ad88e3a2e5976493516a3 Author: Andy Lutomirski Date: Fri Jul 3 10:02:56 2020 -0700 x86/entry/32: Fix #MC and #DB wiring on x86_32 DEFINE_IDTENTRY_MCE and DEFINE_IDTENTRY_DEBUG were wired up as non-RAW on x86_32, but the code expected them to be RAW. Get rid of all the macro indirection for them on 32-bit and just use DECLARE_IDTENTRY_RAW and DEFINE_IDTENTRY_RAW directly. Also add a warning to make sure that we only hit the _kernel paths in kernel mode. Reported-by: Naresh Kamboju Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/9e90a7ee8e72fd757db6d92e1e5ff16339c1ecf9.1593795633.git.luto@kernel.org commit f41f0824224eb12ad84de8972962dd54be5abe3b Author: Andy Lutomirski Date: Fri Jul 3 10:02:55 2020 -0700 x86/entry/xen: Route #DB correctly on Xen PV On Xen PV, #DB doesn't use IST. It still needs to be correctly routed depending on whether it came from user or kernel mode. Get rid of DECLARE/DEFINE_IDTENTRY_XEN -- it was too hard to follow the logic. Instead, route #DB and NMI through DECLARE/DEFINE_IDTENTRY_RAW on Xen, and do the right thing for #DB. Also add more warnings to the exc_debug* handlers to make this type of failure more obvious. This fixes various forms of corruption that happen when usermode triggers #DB on Xen PV. Fixes: 4c0dcd8350a0 ("x86/entry: Implement user mode C entry points for #DB and #MCE") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/4163e733cce0b41658e252c6c6b3464f33fdff17.1593795633.git.luto@kernel.org commit 3c73b81a9164d0c1b6379d6672d2772a9e95168e Author: Andy Lutomirski Date: Fri Jul 3 10:02:54 2020 -0700 x86/entry, selftests: Further improve user entry sanity checks Chasing down a Xen bug caused me to realize that the new entry sanity checks are still fairly weak. Add some more checks. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/881de09e786ab93ce56ee4a2437ba2c308afe7a9.1593795633.git.luto@kernel.org commit db5b2c5a90a111618f071d231a8b945cf522313e Author: Andy Lutomirski Date: Fri Jul 3 10:02:53 2020 -0700 x86/entry/compat: Clear RAX high bits on Xen PV SYSENTER Move the clearing of the high bits of RAX after Xen PV joins the SYSENTER path so that Xen PV doesn't skip it. Arguably this code should be deleted instead, but that would belong in the merge window. Fixes: ffae641f5747 ("x86/entry/64/compat: Fix Xen PV SYSENTER frame setup") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/9d33b3f3216dcab008070f1c28b6091ae7199969.1593795633.git.luto@kernel.org commit e9c6004eef0019375e4b0339f1f88d9d6ed99018 Author: Nuno Sá Date: Wed Jul 1 14:04:41 2020 +0200 iio: adc: adi-axi-adc: Fix object reference counting When looking for a registered client to attach with, the wrong reference counters are being grabbed. The idea is to increment the module and device counters of the client device and not the counters of the axi device being probed. Fixes: ef04070692a2 (iio: adc: adi-axi-adc: add support for AXI ADC IP core) Signed-off-by: Nuno Sá Acked-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 35e884f89df4c48566d745dc5a97a0d058d04263 Merge: 8b082a41dae7 578c1bb90562 Author: Linus Torvalds Date: Fri Jul 3 23:58:12 2020 -0700 Merge tag 'for-linus-5.8b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "One small cleanup patch for ARM and two patches for the xenbus driver fixing latent problems (large stack allocations and bad return code settings)" * tag 'for-linus-5.8b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/xenbus: let xenbus_map_ring_valloc() return errno values only xen/xenbus: avoid large structs and arrays on the stack arm/xen: remove the unused macro GRANT_TABLE_PHYSADDR commit a5f526ecb075a08c4a082355020166c7fe13ae27 Author: Dan Williams Date: Fri Jul 3 23:54:35 2020 -0700 CodingStyle: Inclusive Terminology Linux maintains a coding-style and its own idiomatic set of terminology. Update the style guidelines to recommend replacements for the terms master/slave and blacklist/whitelist. Link: http://lore.kernel.org/r/159389297140.2210796.13590142254668787525.stgit@dwillia2-desk3.amr.corp.intel.com Acked-by: Randy Dunlap Acked-by: Dave Airlie Acked-by: SeongJae Park Acked-by: Christian Brauner Acked-by: James Bottomley Acked-by: Daniel Vetter Acked-by: Andy Lutomirski Acked-by: Laura Abbott Acked-by: Gustavo A. R. Silva Reviewed-by: Matthias Brugger Reviewed-by: Mark Brown Signed-off-by: Stephen Hemminger Signed-off-by: Theodore Ts'o Signed-off-by: Shuah Khan Signed-off-by: Dan Carpenter Signed-off-by: Kees Cook Signed-off-by: Olof Johansson Signed-off-by: Jonathan Corbet Signed-off-by: Chris Mason Signed-off-by: Greg Kroah-Hartman Signed-off-by: Dan Williams commit 597911287fcd13c3a4b4aa3e0a52b33d431e0a8e Author: Wolfram Sang Date: Sun Jun 28 13:52:44 2020 +0200 i2c: mlxcpld: check correct size of maximum RECV_LEN packet I2C_SMBUS_BLOCK_MAX defines already the maximum number as defined in the SMBus 2.0 specs. I don't see a reason to add 1 here. Also, fix the errno to what is suggested for this error. Fixes: c9bfdc7c16cb ("i2c: mlxcpld: Add support for smbus block read transaction") Signed-off-by: Wolfram Sang Reviewed-by: Michael Shych Tested-by: Michael Shych Signed-off-by: Wolfram Sang commit 8b082a41dae7d420db649bffe86cf5af62121f11 Merge: b8e516b36748 d4d80e69927a Author: Linus Torvalds Date: Fri Jul 3 23:20:14 2020 -0700 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull sysctl fix from Al Viro: "Another regression fix for sysctl changes this cycle..." * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: Call sysctl_head_finish on error commit 58e64b050d09836a39b4339c9f46757f1616b2e6 Author: Wolfram Sang Date: Sun Jun 28 20:55:22 2020 +0200 i2c: add Kconfig help text for slave mode I can't recall why there was none, but we surely want to have it. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 59d3d6042d432f36e206127de0dab7f9319762d5 Author: Wolfram Sang Date: Sun Jun 28 20:54:26 2020 +0200 i2c: slave-eeprom: update documentation Add more details which have either been missing ever since or describe recent additions. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Luca Ceresoli Signed-off-by: Wolfram Sang commit 5f90786b31fb7d1e199a8999d46c4e3aea672e11 Author: Andy Shevchenko Date: Thu Jul 2 13:15:27 2020 +0300 i2c: eg20t: Load module automatically if ID matches The driver can't be loaded automatically because it misses module alias to be provided. Add corresponding MODULE_DEVICE_TABLE() call to the driver. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit db2a8b6f1df93d5311970cca03052c01178de674 Author: Ricardo Ribalda Date: Thu Jul 2 12:33:21 2020 +0200 i2c: designware: platdrv: Set class based on DMI Current AMD's zen-based APUs use this core for some of its i2c-buses. With this patch we re-enable autodetection of hwmon-alike devices, so lm-sensors will be able to work automatically. It does not affect the boot-time of embedded devices, as the class is set based on the DMI information. DMI is probed only on Qtechnology QT5222 Industrial Camera Platform. DocLink: https://qtec.com/camera-technology-camera-platforms/ Fixes: 3eddad96c439 ("i2c: designware: reverts "i2c: designware: Add support for AMD I2C controller"") Signed-off-by: Ricardo Ribalda Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit cd217f2300793a106b49c7dfcbfb26e348bc7593 Author: Chris Packham Date: Thu Jul 2 10:39:11 2020 +1200 i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665 The PCA9665 datasheet says that I2CSTA = 78h indicates that SCL is stuck low, this differs to the PCA9564 which uses 90h for this indication. Treat either 0x78 or 0x90 as an indication that the SCL line is stuck. Based on looking through the PCA9564 and PCA9665 datasheets this should be safe for both chips. The PCA9564 should not return 0x78 for any valid state and the PCA9665 should not return 0x90. Fixes: eff9ec95efaa ("i2c-algo-pca: Add PCA9665 support") Signed-off-by: Chris Packham Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit b8e516b36748fd87943e54596a8a6f04ec05f1a5 Merge: 6f216714a690 19e888678bac Author: Linus Torvalds Date: Fri Jul 3 23:03:45 2020 -0700 Merge tag '5.8-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Eight cifs/smb3 fixes, most when specifying the multiuser mount flag. Five of the fixes are for stable" * tag '5.8-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: prevent truncation from long to int in wait_for_free_credits cifs: Fix the target file was deleted when rename failed. SMB3: Honor 'posix' flag for multiuser mounts SMB3: Honor 'handletimeout' flag for multiuser mounts SMB3: Honor lease disabling for multiuser mounts SMB3: Honor persistent/resilient handle flags for multiuser mounts SMB3: Honor 'seal' flag for multiuser mounts cifs: Display local UID details for SMB sessions in DebugData commit 6f216714a6906d6d5d0654313d9f9a47613bb473 Merge: bc2391e7bdfe 0d242479b3e6 Author: Linus Torvalds Date: Fri Jul 3 17:28:16 2020 -0700 Merge tag 'hwmon-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fix typo in Kconfig SENSORS_IR35221 option - Fix potential memory leak in acpi_power_meter_add() - Make sure the OVERT mask is set correctly in max6697 driver - In PMBus core, fix page vs. register when accessing fans - Mark is_visible functions static in bt1-pvt driver - Define Temp- and Volt-to-N poly as maybe-unused in bt1-pvt driver * tag 'hwmon-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (pmbus) fix a typo in Kconfig SENSORS_IR35221 option hwmon: (acpi_power_meter) Fix potential memory leak in acpi_power_meter_add() hwmon: (max6697) Make sure the OVERT mask is set correctly hwmon: (pmbus) Fix page vs. register when accessing fans hwmon: (bt1-pvt) Mark is_visible functions static hwmon: (bt1-pvt) Define Temp- and Volt-to-N poly as maybe-unused commit bc2391e7bdfe7318b077f0d257d6ee1a77dda452 Merge: 0c7d7d1fada7 8beeae86b8e1 Author: Linus Torvalds Date: Fri Jul 3 17:23:50 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "Subsystems affected by this patch series: mm/hugetlb, samples, mm/cma, mm/vmalloc, mm/pagealloc" * emailed patches from Andrew Morton : mm/page_alloc: fix documentation error vmalloc: fix the owner argument for the new __vmalloc_node_range callers mm/cma.c: use exact_nid true to fix possible per-numa cma leak samples/vfs: avoid warning in statx override mm/hugetlb.c: fix pages per hugetlb calculation commit 8beeae86b8e19a4714531f8764b68bd828ffba2a Author: Joel Savitz Date: Fri Jul 3 15:15:30 2020 -0700 mm/page_alloc: fix documentation error When I increased the upper bound of the min_free_kbytes value in ee8eb9a5fe863 ("mm/page_alloc: increase default min_free_kbytes bound") I forgot to tweak the above comment to reflect the new value. This patch fixes that mistake. Signed-off-by: Joel Savitz Signed-off-by: Andrew Morton Cc: Matthew Wilcox Cc: Rafael Aquini Cc: Fabrizio D'Angelo Link: http://lkml.kernel.org/r/20200624221236.29560-1-jsavitz@redhat.com Signed-off-by: Linus Torvalds commit a3a66c3822e03692ed7c5888e8f2d384cc698d34 Author: Christoph Hellwig Date: Fri Jul 3 15:15:27 2020 -0700 vmalloc: fix the owner argument for the new __vmalloc_node_range callers Fix the recently added new __vmalloc_node_range callers to pass the correct values as the owner for display in /proc/vmallocinfo. Fixes: 800e26b81311 ("x86/hyperv: allocate the hypercall page with only read and execute bits") Fixes: 10d5e97c1bf8 ("arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page") Fixes: 7a0e27b2a0ce ("mm: remove vmalloc_exec") Reported-by: Ard Biesheuvel Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200627075649.2455097-1-hch@lst.de Signed-off-by: Linus Torvalds commit 40366bd70bbbbf822ca224dfc227a8c8e868c44f Author: Barry Song Date: Fri Jul 3 15:15:24 2020 -0700 mm/cma.c: use exact_nid true to fix possible per-numa cma leak Calling cma_declare_contiguous_nid() with false exact_nid for per-numa reservation can easily cause cma leak and various confusion. For example, mm/hugetlb.c is trying to reserve per-numa cma for gigantic pages. But it can easily leak cma and make users confused when system has memoryless nodes. In case the system has 4 numa nodes, and only numa node0 has memory. if we set hugetlb_cma=4G in bootargs, mm/hugetlb.c will get 4 cma areas for 4 different numa nodes. since exact_nid=false in current code, all 4 numa nodes will get cma successfully from node0, but hugetlb_cma[1 to 3] will never be available to hugepage will only allocate memory from hugetlb_cma[0]. In case the system has 4 numa nodes, both numa node0&2 has memory, other nodes have no memory. if we set hugetlb_cma=4G in bootargs, mm/hugetlb.c will get 4 cma areas for 4 different numa nodes. since exact_nid=false in current code, all 4 numa nodes will get cma successfully from node0 or 2, but hugetlb_cma[1] and [3] will never be available to hugepage as mm/hugetlb.c will only allocate memory from hugetlb_cma[0] and hugetlb_cma[2]. This causes permanent leak of the cma areas which are supposed to be used by memoryless node. Of cource we can workaround the issue by letting mm/hugetlb.c scan all cma areas in alloc_gigantic_page() even node_mask includes node0 only. that means when node_mask includes node0 only, we can get page from hugetlb_cma[1] to hugetlb_cma[3]. But this will cause kernel crash in free_gigantic_page() while it wants to free page by: cma_release(hugetlb_cma[page_to_nid(page)], page, 1 << order) On the other hand, exact_nid=false won't consider numa distance, it might be not that useful to leverage cma areas on remote nodes. I feel it is much simpler to make exact_nid true to make everything clear. After that, memoryless nodes won't be able to reserve per-numa CMA from other nodes which have memory. Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") Signed-off-by: Barry Song Signed-off-by: Andrew Morton Acked-by: Roman Gushchin Cc: Jonathan Cameron Cc: Aslan Bakirov Cc: Michal Hocko Cc: Andreas Schaufler Cc: Mike Kravetz Cc: Rik van Riel Cc: Joonsoo Kim Cc: Robin Murphy Cc: Link: http://lkml.kernel.org/r/20200628074345.27228-1-song.bao.hua@hisilicon.com Signed-off-by: Linus Torvalds commit c3eeaae9fd736b7f2afbda8d3cbb1cbae06decf3 Author: Kees Cook Date: Fri Jul 3 15:15:21 2020 -0700 samples/vfs: avoid warning in statx override Something changed recently to uncover this warning: samples/vfs/test-statx.c:24:15: warning: `struct foo' declared inside parameter list will not be visible outside of this definition or declaration 24 | #define statx foo | ^~~ Which is due the use of "struct statx" (here, "struct foo") in a function prototype argument list before it has been defined: int # 56 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" foo # 56 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4 (int __dirfd, const char *__restrict __path, int __flags, unsigned int __mask, struct # 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" foo # 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5))); Add explicit struct before #include to avoid warning. Fixes: f1b5618e013a ("vfs: Add a sample program for the new mount API") Signed-off-by: Kees Cook Signed-off-by: Andrew Morton Cc: Miklos Szeredi Cc: Al Viro Cc: David Howells Link: http://lkml.kernel.org/r/202006282213.C516EA6@keescook Signed-off-by: Linus Torvalds commit 1139d336fff425f9a20374945cdd28eb44d09fa8 Author: Mike Kravetz Date: Fri Jul 3 15:15:18 2020 -0700 mm/hugetlb.c: fix pages per hugetlb calculation The routine hpage_nr_pages() was incorrectly used to calculate the number of base pages in a hugetlb page. hpage_nr_pages is designed to be called for THP pages and will return HPAGE_PMD_NR for hugetlb pages of any size. Due to the context in which hpage_nr_pages was called, it is unlikely to produce a user visible error. The routine with the incorrect call is only exercised in the case of hugetlb memory error or migration. In addition, this would need to be on an architecture which supports huge page sizes less than PMD_SIZE. And, the vma containing the huge page would also need to smaller than PMD_SIZE. Fixes: c0d0381ade79 ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization") Reported-by: Matthew Wilcox (Oracle) Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Reviewed-by: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Kirill A . Shutemov" Cc: Link: http://lkml.kernel.org/r/20200629185003.97202-1-mike.kravetz@oracle.com Signed-off-by: Linus Torvalds commit 0c7d7d1fada70420851b63f2e2669cb4976a303b Merge: 7fec3ce50a5d c7f87f3984cf Author: Linus Torvalds Date: Fri Jul 3 14:46:46 2020 -0700 Merge tag 'xfs-5.8-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fix from Darrick Wong: "Fix a use-after-free bug when the fs shuts down" * tag 'xfs-5.8-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix use-after-free on CIL context on shutdown commit d7bf2ebebc2bd61ab95e2a8e33541ef282f303d4 Author: Toke Høiland-Jørgensen Date: Fri Jul 3 22:26:43 2020 +0200 sched: consistently handle layer3 header accesses in the presence of VLANs There are a couple of places in net/sched/ that check skb->protocol and act on the value there. However, in the presence of VLAN tags, the value stored in skb->protocol can be inconsistent based on whether VLAN acceleration is enabled. The commit quoted in the Fixes tag below fixed the users of skb->protocol to use a helper that will always see the VLAN ethertype. However, most of the callers don't actually handle the VLAN ethertype, but expect to find the IP header type in the protocol field. This means that things like changing the ECN field, or parsing diffserv values, stops working if there's a VLAN tag, or if there are multiple nested VLAN tags (QinQ). To fix this, change the helper to take an argument that indicates whether the caller wants to skip the VLAN tags or not. When skipping VLAN tags, we make sure to skip all of them, so behaviour is consistent even in QinQ mode. To make the helper usable from the ECN code, move it to if_vlan.h instead of pkt_sched.h. v3: - Remove empty lines - Move vlan variable definitions inside loop in skb_protocol() - Also use skb_protocol() helper in IP{,6}_ECN_decapsulate() and bpf_skb_ecn_set_ce() v2: - Use eth_type_vlan() helper in skb_protocol() - Also fix code that reads skb->protocol directly - Change a couple of 'if/else if' statements to switch constructs to avoid calling the helper twice Reported-by: Ilya Ponetayev Fixes: d8b9605d2697 ("net: sched: fix skb->protocol use in case of accelerated vlan path") Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 7fec3ce50a5d3fc54de9c0e9d43682ea9320b199 Merge: 718b7a570a34 5396956cc7c6 Author: Linus Torvalds Date: Fri Jul 3 12:14:51 2020 -0700 Merge tag 'pci-v5.8-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fix from Bjorn Helgaas: "Fix a pcie_find_root_port() simplification that broke power management because it didn't handle the edge case of finding the Root Port of a Root Port itself (Mika Westerberg)"" * tag 'pci-v5.8-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Make pcie_find_root_port() work for Root Ports commit 718b7a570a346323cd80dc28d0a41892036b050b Merge: bf2d63694e9e ef0c44c3e51b Author: Linus Torvalds Date: Fri Jul 3 12:11:18 2020 -0700 Merge tag 'acpi-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "Add a new device ID for Intel Tiger Lake to the DPTF battery participant driver (Srinivas Pandruvada) and fix the Tiger Lake fan device ID (Sumeet Pawnikar)" * tag 'acpi-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: fan: Fix Tiger Lake ACPI device ID ACPI: DPTF: Add battery participant for TigerLake commit bf2d63694e9ed5142711325e0039b017d40fae4c Merge: 1d4287146529 c860f8ffbea8 Author: Linus Torvalds Date: Fri Jul 3 12:01:04 2020 -0700 Merge tag 'gfs2-v5.8-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fixes from Andreas Gruenbacher: "Various gfs2 fixes" * tag 'gfs2-v5.8-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: The freeze glock should never be frozen gfs2: When freezing gfs2, use GL_EXACT and not GL_NOCACHE gfs2: read-only mounts should grab the sd_freeze_gl glock gfs2: freeze should work on read-only mounts gfs2: eliminate GIF_ORDERED in favor of list_empty gfs2: Don't sleep during glock hash walk gfs2: fix trans slab error when withdraw occurs inside log_flush gfs2: Don't return NULL from gfs2_inode_lookup commit 1d42871465291c3f117ea3c9fbce8d4a603c303b Merge: cdd3bb54332f 1298a549e22a Author: Linus Torvalds Date: Fri Jul 3 11:39:30 2020 -0700 Merge tag 'drm-fixes-2020-07-03' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Pretty usual rc4 pull: two usual amdgpu, i915 pulls, and some misc arm driver fixes. The bigger bit is including the asm sources for some GPU shaders that were contained in the i915 driver, otherwise it's pretty much business as usual. dma-buf: - fix a use-after-free bug amdgpu: - Fix for vega20 boards without RAS support - DC bandwidth revalidation fix - Fix Renoir vram info fetching - Fix hwmon freq printing i915: - GVT fixes - Two missed MMIO handler fixes for SKL/CFL - Fix mask register bits check - Fix one lockdep error for debugfs entry access - Include asm sources for render cache clear batches msm: - memleak fix - display block fix - address space fixes exynos: - error value and reference count fix - error print removal sun4i: - remove HPD polling" * tag 'drm-fixes-2020-07-03' of git://anongit.freedesktop.org/drm/drm: (22 commits) drm/amdgpu: use %u rather than %d for sclk/mclk drm/amdgpu/atomfirmware: fix vram_info fetching for renoir drm/amd/display: Only revalidate bandwidth on medium and fast updates drm: sun4i: hdmi: Remove extra HPD polling drm/i915: Include asm sources for {ivb, hsw}_clear_kernel.c drm/exynos: fix ref count leak in mic_pre_enable drm/exynos: Properly propagate return value in drm_iommu_attach_device() drm/exynos: Remove dev_err() on platform_get_irq() failure drm/amd/powerplay: Fix NULL dereference in lock_bus() on Vega20 w/o RAS dma-buf: Move dma_buf_release() from fops to dentry_ops drm/msm: Fix up the rest of the messed up address sizes drm/msm: Fix setup of a6xx create_address_space. drm/msm: Fix address space size after refactor. drm/i915/gvt: Use GFP_ATOMIC instead of GFP_KERNEL in atomic context drm/i915/gvt: Fix incorrect check of enabled bits in mask registers drm/i915/gvt: Fix two CFL MMIO handling caused by regression. drm/i915/gvt: Add one missing MMIO handler for D_SKL_PLUS drm/msm: Fix 0xfffflub in "Refactor address space initialization" drm/msm/dpu: allow initialization of encoder locks during encoder init drm/msm/dpu: fix error return code in dpu_encoder_init ... commit d4d80e69927ab5da67026c1c94e23c305dbc799e Author: Matthew Wilcox (Oracle) Date: Fri Jul 3 14:10:14 2020 -0400 Call sysctl_head_finish on error This error path returned directly instead of calling sysctl_head_finish(). Fixes: ef9d965bc8b6 ("sysctl: reject gigantic reads/write to sysctl files") Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Al Viro commit fa71e9527f6a0153ae6a880031b902818af1bdaf Author: Sean Christopherson Date: Thu Jul 2 21:04:22 2020 -0700 KVM: VMX: Use KVM_POSSIBLE_CR*_GUEST_BITS to initialize guest/host masks Use the "common" KVM_POSSIBLE_CR*_GUEST_BITS defines to initialize the CR0/CR4 guest host masks instead of duplicating most of the CR4 mask and open coding the CR0 mask. SVM doesn't utilize the masks, i.e. the masks are effectively VMX specific even if they're not named as such. This avoids duplicate code, better documents the guest owned CR0 bit, and eliminates the need for a build-time assertion to keep VMX and x86 synchronized. Signed-off-by: Sean Christopherson Message-Id: <20200703040422.31536-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 7c83d096aed055a7763a03384f92115363448b71 Author: Sean Christopherson Date: Thu Jul 2 21:04:21 2020 -0700 KVM: x86: Mark CR4.TSD as being possibly owned by the guest Mark CR4.TSD as being possibly owned by the guest as that is indeed the case on VMX. Without TSD being tagged as possibly owned by the guest, a targeted read of CR4 to get TSD could observe a stale value. This bug is benign in the current code base as the sole consumer of TSD is the emulator (for RDTSC) and the emulator always "reads" the entirety of CR4 when grabbing bits. Add a build-time assertion in to ensure VMX doesn't hand over more CR4 bits without also updating x86. Fixes: 52ce3c21aec3 ("x86,kvm,vmx: Don't trap writes to CR4.TSD") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20200703040422.31536-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit d74fcfc1f0ff4b6c26ecef1f9e48d8089ab4eaac Author: Sean Christopherson Date: Thu Jul 2 19:17:14 2020 -0700 KVM: x86: Inject #GP if guest attempts to toggle CR4.LA57 in 64-bit mode Inject a #GP on MOV CR4 if CR4.LA57 is toggled in 64-bit mode, which is illegal per Intel's SDM: CR4.LA57 57-bit linear addresses (bit 12 of CR4) ... blah blah blah ... This bit cannot be modified in IA-32e mode. Note, the pseudocode for MOV CR doesn't call out the fault condition, which is likely why the check was missed during initial development. This is arguably an SDM bug and will hopefully be fixed in future release of the SDM. Fixes: fd8cb433734ee ("KVM: MMU: Expose the LA57 feature to VM.") Cc: stable@vger.kernel.org Reported-by: Sebastien Boeuf Signed-off-by: Sean Christopherson Message-Id: <20200703021714.5549-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 075ebfe19fa3fa8838d2afdde5e87c86b7953b1e Merge: 9e9f85e029a2 d8ca55addb93 Author: Heiko Carstens Date: Fri Jul 3 18:02:09 2020 +0200 Merge tag 'vfio-ccw-20200703' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into fixes add a missing include Signed-off-by: Heiko Carstens commit 9b23d95c539ebc5d6d6b5d6f20d2d7922384e76e Author: Sai Prakash Ranjan Date: Tue Jun 30 23:30:55 2020 +0530 arm64: Add KRYO4XX silver CPU cores to erratum list 1530923 and 1024718 KRYO4XX silver/LITTLE CPU cores with revision r1p0 are affected by erratum 1530923 and 1024718, so add them to the respective list. The variant and revision bits are implementation defined and are different from the their Cortex CPU counterparts on which they are based on, i.e., r1p0 is equivalent to rdpe. Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/7013e8a3f857ca7e82863cc9e34a614293d7f80c.1593539394.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit a9e821b89daa55cc940c546b124101939d3f0451 Author: Sai Prakash Ranjan Date: Tue Jun 30 23:30:54 2020 +0530 arm64: Add KRYO4XX gold CPU cores to erratum list 1463225 and 1418040 KRYO4XX gold/big CPU core revisions r0p0 to r3p1 are affected by erratum 1463225 and 1418040, so add them to the respective list. The variant and revision bits are implementation defined and are different from the their Cortex CPU counterparts on which they are based on, i.e., (r0p0 to r3p1) is equivalent to (rcpe to rfpf). Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/83780e80c6377c12ca51b5d53186b61241685e49.1593539394.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit dce4f2807f6920bb907eb4cd4f95e7f42d918bc6 Author: Sai Prakash Ranjan Date: Tue Jun 30 23:30:53 2020 +0530 arm64: Add MIDR value for KRYO4XX gold CPU cores Add MIDR value for KRYO4XX gold/big CPU cores which are used in Qualcomm Technologies, Inc. SoCs. This will be used to identify and apply erratum which are applicable for these CPU cores. Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/9093fb82e22441076280ca1b729242ffde80c432.1593539394.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit ef0c44c3e51ba051c500620685ee0b476ef2cbdf Merge: 1e05daca83bb 0318e8374e87 Author: Rafael J. Wysocki Date: Fri Jul 3 16:15:31 2020 +0200 Merge branch 'acpi-fan' * acpi-fan: ACPI: fan: Fix Tiger Lake ACPI device ID commit e84861fec32dee8a2e62bbaa52cded6b05a2a456 Author: Marc Kleine-Budde Date: Fri Jul 3 12:33:15 2020 +0200 regmap: dev_get_regmap_match(): fix string comparison This function is used by dev_get_regmap() to retrieve a regmap for the specified device. If the device has more than one regmap, the name parameter can be used to specify one. The code here uses a pointer comparison to check for equal strings. This however will probably always fail, as the regmap->name is allocated via kstrdup_const() from the regmap's config->name. Fix this by using strcmp() instead. Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20200703103315.267996-1-mkl@pengutronix.de Signed-off-by: Mark Brown commit c0dadd298faca771f749a01848fa86567c5afa35 Author: Nicolas Ferre Date: Thu Jul 2 15:42:24 2020 +0200 MAINTAINERS: Change Maintainer for some at91 drivers I hand over the maintenance of these drivers to my colleagues. Claudiu, Codrin and Tudor already have experience with these controllers and sub-systems. Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20200702134224.3750-1-nicolas.ferre@microchip.com Signed-off-by: Mark Brown commit d005fbb855d3b5660d62ee5a6bd2d99c13ff8cf3 Author: Pablo Neira Ayuso Date: Wed Jul 1 13:17:40 2020 +0200 netfilter: conntrack: refetch conntrack after nf_conntrack_update() __nf_conntrack_update() might refresh the conntrack object that is attached to the skbuff. Otherwise, this triggers UAF. [ 633.200434] ================================================================== [ 633.200472] BUG: KASAN: use-after-free in nf_conntrack_update+0x34e/0x770 [nf_conntrack] [ 633.200478] Read of size 1 at addr ffff888370804c00 by task nfqnl_test/6769 [ 633.200487] CPU: 1 PID: 6769 Comm: nfqnl_test Not tainted 5.8.0-rc2+ #388 [ 633.200490] Hardware name: LENOVO 23259H1/23259H1, BIOS G2ET32WW (1.12 ) 05/30/2012 [ 633.200491] Call Trace: [ 633.200499] dump_stack+0x7c/0xb0 [ 633.200526] ? nf_conntrack_update+0x34e/0x770 [nf_conntrack] [ 633.200532] print_address_description.constprop.6+0x1a/0x200 [ 633.200539] ? _raw_write_lock_irqsave+0xc0/0xc0 [ 633.200568] ? nf_conntrack_update+0x34e/0x770 [nf_conntrack] [ 633.200594] ? nf_conntrack_update+0x34e/0x770 [nf_conntrack] [ 633.200598] kasan_report.cold.9+0x1f/0x42 [ 633.200604] ? call_rcu+0x2c0/0x390 [ 633.200633] ? nf_conntrack_update+0x34e/0x770 [nf_conntrack] [ 633.200659] nf_conntrack_update+0x34e/0x770 [nf_conntrack] [ 633.200687] ? nf_conntrack_find_get+0x30/0x30 [nf_conntrack] Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1436 Fixes: ee04805ff54a ("netfilter: conntrack: make conntrack userspace helpers work again") Signed-off-by: Pablo Neira Ayuso commit 2160d6c8a13e685b7b2bacbe9cd1e9600506a05f Author: Tom Zanussi Date: Thu Jul 2 14:53:46 2020 -0400 tools lib traceevent: Add proper KBUFFER_TYPE_TIME_STAMP handling Kernel commit dc4e2801d400 (ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP) changed the way the ring buffer timestamps work - after that commit the previously unimplemented RINGBUF_TYPE_TIME_STAMP type causes the time delta to be used as a timestamp rather than a delta to be added to the timestamp. The trace-cmd code didn't get updated to handle this, so misinterprets the event data for this case, which causes a cascade of errors, including trace-report not being able to identify synthetic (or any other) events generated by the histogram code (which uses TIME_STAMP mode). For example, the following triggers along with the trace-cmd shown cause an UNKNOWN_EVENT error and trace-cmd report crash: # echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > /sys/kernel/debug/tracing/synthetic_events # echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).trace(wakeup_latency,$wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > /sys/kernel/debug/tracing/events/sched/sched_switch/trigger # echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger # trace-cmd record -e wakeup_latency -e sched_wakeup -f comm==\"ping\" ping localhost -c 5 # trace-cmd report CPU 0 is empty CPU 1 is empty CPU 2 is empty CPU 3 is empty CPU 5 is empty CPU 6 is empty CPU 7 is empty cpus=8 ug! no event found for type 0 [UNKNOWN TYPE 0] ug! no event found for type 11520 Segmentation fault (core dumped) After this patch we get the correct interpretation and the events are shown properly: # trace-cmd report CPU 0 is empty CPU 1 is empty CPU 2 is empty CPU 3 is empty CPU 5 is empty CPU 6 is empty CPU 7 is empty cpus=8 -0 [004] 23284.341392: sched_wakeup: ping:12031 [120] success=1 CPU:004 -0 [004] 23284.341464: wakeup_latency: lat=58, pid=12031, comm=ping -0 [004] 23285.365303: sched_wakeup: ping:12031 [120] success=1 CPU:004 -0 [004] 23285.365382: wakeup_latency: lat=64, pid=12031, comm=ping -0 [004] 23286.389290: sched_wakeup: ping:12031 [120] success=1 CPU:004 -0 [004] 23286.389378: wakeup_latency: lat=72, pid=12031, comm=ping -0 [004] 23287.413213: sched_wakeup: ping:12031 [120] success=1 CPU:004 -0 [004] 23287.413291: wakeup_latency: lat=64, pid=12031, comm=ping Link: http://lkml.kernel.org/r/1567628224.13841.4.camel@kernel.org Link: http://lore.kernel.org/linux-trace-devel/20200625100516.365338-3-tz.stoyanov@gmail.com Signed-off-by: Tom Zanussi [ Ported from trace-cmd.git ] Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Cc: linux-trace-devel@vger.kernel.org Link: http://lore.kernel.org/lkml/20200702185703.785094515@goodmis.org Signed-off-by: Tzvetomir Stoyanov (VMware) Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 374855c5e4a76f7cc7f9aeb613c54929510eff18 Author: Steven Rostedt (Red Hat) Date: Thu Jul 2 14:53:45 2020 -0400 tools lib traceevent: Add API to read time information from kbuffer Add the functions kbuffer_subbuf_timestamp() and kbuffer_ptr_delta() to get the timing data stored in the ring buffer that is used to produced the time stamps of the records. This is useful for tools like trace-cmd to be able to display the content of the read data to understand why the records show the time stamps that they do. Link: http://lore.kernel.org/linux-trace-devel/20200625100516.365338-2-tz.stoyanov@gmail.com Signed-off-by: Steven Rostedt (VMware) [ Ported from trace-cmd.git ] Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Cc: linux-trace-devel@vger.kernel.org Link: http://lore.kernel.org/lkml/20200702185703.619656282@goodmis.org Signed-off-by: Tzvetomir Stoyanov (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit f18d5cf86cdb58eb50cafb5a5e20943ec7a61b1f Author: Adrian Hunter Date: Mon Jun 29 12:19:55 2020 +0300 perf scripts python: exported-sql-viewer.py: Fix time chart call tree Using Python version 3.8.2 and PySide2 version 5.14.0, time chart call tree would not expand the tree to the result. Fix by using setExpanded(). Example: $ perf record -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.034 MB perf.data ] $ perf script --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-sqlite.py perf.data.db branches calls 2020-06-26 15:32:14.928997 Creating database ... 2020-06-26 15:32:14.933971 Writing records... 2020-06-26 15:32:15.535251 Adding indexes 2020-06-26 15:32:15.542993 Dropping unused tables 2020-06-26 15:32:15.549716 Done $ python3 ~/libexec/perf-core/scripts/python/exported-sql-viewer.py perf.data.db Select: Charts -> Time chart by CPU Move mouse over middle of chart Right-click and select Show Call Tree Before: displays Call Tree but not expanded to selected time After: displays Call Tree expanded to selected time Fixes: e69d5df75d74d ("perf scripts python: exported-sql-viewer.py: Add ability for Call tree to open at a specified task and time") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200629091955.17090-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 031c8d5edb1ddeb6d398f7942ce2a01a1a51ada9 Author: Adrian Hunter Date: Mon Jun 29 12:19:54 2020 +0300 perf scripts python: exported-sql-viewer.py: Fix zero id in call tree 'Find' result Using ctrl-F ('Find') would not find 'unknown' because it matches id zero. Fix by excluding id zero from selection. Example: $ perf record -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.034 MB perf.data ] $ perf script --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-sqlite.py perf.data.db branches calls 2020-06-26 15:32:14.928997 Creating database ... 2020-06-26 15:32:14.933971 Writing records... 2020-06-26 15:32:15.535251 Adding indexes 2020-06-26 15:32:15.542993 Dropping unused tables 2020-06-26 15:32:15.549716 Done $ python3 ~/libexec/perf-core/scripts/python/exported-sql-viewer.py perf.data.db Select: Reports -> Call Tree Press: Ctrl-F Enter: unknown Press: Enter Before: displays 'unknown' not found After: tree is expanded to line showing 'unknown' Fixes: ae8b887c00d3f ("perf scripts python: exported-sql-viewer.py: Add call tree") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200629091955.17090-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7ff520b0a71dd2db695b52ad117d81b7eaf6ff9d Author: Adrian Hunter Date: Mon Jun 29 12:19:53 2020 +0300 perf scripts python: exported-sql-viewer.py: Fix zero id in call graph 'Find' result Using ctrl-F ('Find') would not find 'unknown' because it matches id zero. Fix by excluding id zero from selection. Example: $ perf record -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.034 MB perf.data ] $ perf script --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-sqlite.py perf.data.db branches calls 2020-06-26 15:32:14.928997 Creating database ... 2020-06-26 15:32:14.933971 Writing records... 2020-06-26 15:32:15.535251 Adding indexes 2020-06-26 15:32:15.542993 Dropping unused tables 2020-06-26 15:32:15.549716 Done $ python3 ~/libexec/perf-core/scripts/python/exported-sql-viewer.py perf.data.db Select: Reports -> Context-Sensitive Call Graph Press: Ctrl-F Enter: unknown Press: Enter Before: gets stuck After: tree is expanded to line showing 'unknown' Fixes: 254c0d820b86d ("perf scripts python: exported-sql-viewer.py: Factor out CallGraphModelBase") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200629091955.17090-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3a3cf7c570a486b07d9a6e68a77548aea6a8421f Author: Adrian Hunter Date: Mon Jun 29 12:19:52 2020 +0300 perf scripts python: exported-sql-viewer.py: Fix unexpanded 'Find' result Using Python version 3.8.2 and PySide2 version 5.14.0, ctrl-F ('Find') would not expand the tree to the result. Fix by using setExpanded(). Example: $ perf record -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.034 MB perf.data ] $ perf script --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-sqlite.py perf.data.db branches calls 2020-06-26 15:32:14.928997 Creating database ... 2020-06-26 15:32:14.933971 Writing records... 2020-06-26 15:32:15.535251 Adding indexes 2020-06-26 15:32:15.542993 Dropping unused tables 2020-06-26 15:32:15.549716 Done $ python3 ~/libexec/perf-core/scripts/python/exported-sql-viewer.py perf.data.db Select: Reports -> Context-Sensitive Call Graph or Reports -> Call Tree Press: Ctrl-F Enter: main Press: Enter Before: line showing 'main' does not display After: tree is expanded to line showing 'main' Fixes: ebd70c7dc2f5f ("perf scripts python: exported-sql-viewer.py: Add ability to find symbols in the call-graph") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200629091955.17090-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 442ad2254ac56b39870c0cfed96d500921fea5d5 Author: Adrian Hunter Date: Mon Jun 29 12:19:51 2020 +0300 perf record: Fix duplicated sideband events with Intel PT system wide tracing Commit 0a892c1c9472 ("perf record: Add dummy event during system wide synthesis") reveals an issue with Intel PT system wide tracing. Specifically that Intel PT already adds a dummy tracking event, and it is not the first event. Adding another dummy tracking event causes duplicated sideband events. Fix by checking for an existing dummy tracking event first. Example showing duplicated switch events: Before: # perf record -a -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.895 MB perf.data ] # perf script --no-itrace --show-switch-events | head swapper 0 [007] 6390.516222: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 11/11 swapper 0 [007] 6390.516222: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 11/11 rcu_sched 11 [007] 6390.516223: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 0/0 rcu_sched 11 [007] 6390.516224: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 0/0 rcu_sched 11 [007] 6390.516227: PERF_RECORD_SWITCH_CPU_WIDE OUT next pid/tid: 0/0 rcu_sched 11 [007] 6390.516227: PERF_RECORD_SWITCH_CPU_WIDE OUT next pid/tid: 0/0 swapper 0 [007] 6390.516228: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 11/11 swapper 0 [007] 6390.516228: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 11/11 swapper 0 [002] 6390.516415: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 5556/5559 swapper 0 [002] 6390.516416: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 5556/5559 After: # perf record -a -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.868 MB perf.data ] # perf script --no-itrace --show-switch-events | head swapper 0 [005] 6450.567013: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 7179/7181 perf 7181 [005] 6450.567014: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 0/0 perf 7181 [005] 6450.567028: PERF_RECORD_SWITCH_CPU_WIDE OUT next pid/tid: 0/0 swapper 0 [005] 6450.567029: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 7179/7181 swapper 0 [005] 6450.571699: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 11/11 rcu_sched 11 [005] 6450.571700: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 0/0 rcu_sched 11 [005] 6450.571702: PERF_RECORD_SWITCH_CPU_WIDE OUT next pid/tid: 0/0 swapper 0 [005] 6450.571703: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 11/11 swapper 0 [005] 6450.579703: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt next pid/tid: 11/11 rcu_sched 11 [005] 6450.579704: PERF_RECORD_SWITCH_CPU_WIDE IN prev pid/tid: 0/0 Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200629091955.17090-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 640432e6bed08e9d5d2ba26856ba3f55008b07e3 Author: Adrian Hunter Date: Mon Jun 29 12:19:50 2020 +0300 perf scripts python: export-to-postgresql.py: Fix struct.pack() int argument Python 3.8 is requiring that arguments being packed as integers are also integers. Add int() accordingly. Before: $ perf record -e intel_pt//u uname $ perf script --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-postgresql.py perf_data_db branches calls 2020-06-25 16:09:10.547256 Creating database... 2020-06-25 16:09:10.733185 Writing to intermediate files... Traceback (most recent call last): File "/home/ahunter/libexec/perf-core/scripts/python/export-to-postgresql.py", line 1106, in synth_data cbr(id, raw_buf) File "/home/ahunter/libexec/perf-core/scripts/python/export-to-postgresql.py", line 1058, in cbr value = struct.pack("!hiqiiiiii", 4, 8, id, 4, cbr, 4, MHz, 4, percent) struct.error: required argument is not an integer Fatal Python error: problem in Python trace event handler Python runtime state: initialized Current thread 0x00007f35d3695780 (most recent call first): Aborted (core dumped) After: $ dropdb perf_data_db $ rm -rf perf_data_db-perf-data $ perf script --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-postgresql.py perf_data_db branches calls 2020-06-25 16:09:40.990267 Creating database... 2020-06-25 16:09:41.207009 Writing to intermediate files... 2020-06-25 16:09:41.270915 Copying to database... 2020-06-25 16:09:41.382030 Removing intermediate files... 2020-06-25 16:09:41.384630 Adding primary keys 2020-06-25 16:09:41.541894 Adding foreign keys 2020-06-25 16:09:41.677044 Dropping unused tables 2020-06-25 16:09:41.703761 Done Fixes: aba44287a224 ("perf scripts python: export-to-postgresql.py: Export Intel PT power and ptwrite events") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200629091955.17090-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit eb25de276505c664c6ee838e60c6e5ad1837f55e Author: Arnaldo Carvalho de Melo Date: Fri Jul 3 08:11:16 2020 -0300 tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' To bring in the change made in this cset: e3a9e681adb7 ("x86/entry: Fixup bad_iret vs noinstr") This doesn't cause any functional changes to tooling, just a rebuild. Addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Signed-off-by: Arnaldo Carvalho de Melo commit 9434628fcee63b1f3c6a6881b70e8f69a1f68e88 Merge: c42ad5d43582 cdd3bb54332f Author: Arnaldo Carvalho de Melo Date: Fri Jul 3 08:05:59 2020 -0300 Merge remote-tracking branch 'torvalds/master' into perf/urgent To synchronize UAPI headers. Signed-off-by: Arnaldo Carvalho de Melo commit c860f8ffbea8924de05a281b937128773d30a77c Author: Bob Peterson Date: Thu Jun 25 14:42:17 2020 -0500 gfs2: The freeze glock should never be frozen Before this patch, some gfs2 code locked the freeze glock with LM_FLAG_NOEXP (Do not freeze) flag, and some did not. We never want to freeze the freeze glock, so this patch makes it consistently use LM_FLAG_NOEXP always. Signed-off-by: Bob Peterson commit 623ba664b74a20f22a2ef7ebd71e171d2d7c626f Author: Bob Peterson Date: Thu Jun 25 13:30:52 2020 -0500 gfs2: When freezing gfs2, use GL_EXACT and not GL_NOCACHE Before this patch, the freeze code in gfs2 specified GL_NOCACHE in several places. That's wrong because we always want to know the state of whether the file system is frozen. There was also a problem with freeze/thaw transitioning the glock from frozen (EX) to thawed (SH) because gfs2 will normally grant glocks in EX to processes that request it in SH mode, unless GL_EXACT is specified. Therefore, the freeze/thaw code, which tried to reacquire the glock in SH mode would get the glock in EX mode, and miss the transition from EX to SH. That made it think the thaw had completed normally, but since the glock was still cached in EX, other nodes could not freeze again. This patch removes the GL_NOCACHE flag to allow the freeze glock to be cached. It also adds the GL_EXACT flag so the glock is fully transitioned from EX to SH, thereby allowing future freeze operations. Signed-off-by: Bob Peterson commit b780cc615ba4795a7ef0e93b19424828a5ad456a Author: Bob Peterson Date: Thu Jun 25 13:30:18 2020 -0500 gfs2: read-only mounts should grab the sd_freeze_gl glock Before this patch, only read-write mounts would grab the freeze glock in read-only mode, as part of gfs2_make_fs_rw. So the freeze glock was never initialized. That meant requests to freeze, which request the glock in EX, were granted without any state transition. That meant you could mount a gfs2 file system, which is currently frozen on a different cluster node, in read-only mode. This patch makes read-only mounts lock the freeze glock in SH mode, which will block for file systems that are frozen on another node. Signed-off-by: Bob Peterson commit 541656d3a5136ae830d604e237f29f406d42c592 Author: Bob Peterson Date: Thu Jun 25 13:29:44 2020 -0500 gfs2: freeze should work on read-only mounts Before this patch, function freeze_go_sync, called when promoting the freeze glock, was testing for the SDF_JOURNAL_LIVE superblock flag. That's only set for read-write mounts. Read-only mounts don't use a journal, so the bit is never set, so the freeze never happened. This patch removes the check for SDF_JOURNAL_LIVE for freeze requests but still checks it when deciding whether to flush a journal. Signed-off-by: Bob Peterson commit 7542486b89b2e321ffe0de82163b425d6a38bc72 Author: Bob Peterson Date: Wed Jun 17 07:47:34 2020 -0500 gfs2: eliminate GIF_ORDERED in favor of list_empty In several places, we used the GIF_ORDERED inode flag to determine if an inode was on the ordered writes list. However, since we always held the sd_ordered_lock spin_lock during the manipulation, we can just as easily check list_empty(&ip->i_ordered) instead. This allows us to keep more than one ordered writes list to make journal writing improvements. This patch eliminates GIF_ORDERED in favor of checking list_empty. Signed-off-by: Bob Peterson commit d8ca55addb9315ecd9fc4397f4c94d3f1980161c Author: Sean Christopherson Date: Thu Jul 2 19:26:28 2020 -0700 vfio-ccw: Fix a build error due to missing include of linux/slab.h Include linux/slab.h to fix a build error due to kfree() being undefined. Fixes: 3f02cb2fd9d2 ("vfio-ccw: Wire up the CRW irq and CRW region") Signed-off-by: Sean Christopherson Message-Id: <20200703022628.6036-1-sean.j.christopherson@intel.com> Signed-off-by: Cornelia Huck commit bf12fdf0ab728ca8e5933aac46dd972c0dd0421e Author: Esben Haabendal Date: Wed Jul 1 16:56:58 2020 +0200 uio_pdrv_genirq: fix use without device tree and no interrupt While e3a3c3a20555 ("UIO: fix uio_pdrv_genirq with device tree but no interrupt") added support for using uio_pdrv_genirq for devices without interrupt for device tree platforms, the removal of uio_pdrv in 26dac3c49d56 ("uio: Remove uio_pdrv and use uio_pdrv_genirq instead") broke the support for non device tree platforms. This change fixes this, so that uio_pdrv_genirq can be used without interrupt on all platforms. This still leaves the support that uio_pdrv had for custom interrupt handler lacking, as uio_pdrv_genirq does not handle it (yet). Fixes: 26dac3c49d56 ("uio: Remove uio_pdrv and use uio_pdrv_genirq instead") Signed-off-by: Esben Haabendal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200701145659.3978-3-esben@geanix.com Signed-off-by: Greg Kroah-Hartman commit 324ac45f25e634eca6346953ae531e8da3e0c73d Author: Esben Haabendal Date: Wed Jul 1 16:56:57 2020 +0200 uio_pdrv_genirq: Remove warning when irq is not specified Since e3a3c3a20555 ("UIO: fix uio_pdrv_genirq with device tree but no interrupt"), the uio_pdrv_genirq has supported use without interrupt, so the change in 7723f4c5ecdb ("driver core: platform: Add an error message to") added false warnings for those cases. Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()") Signed-off-by: Esben Haabendal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200701145659.3978-2-esben@geanix.com Signed-off-by: Greg Kroah-Hartman commit f38278e9b810b06aff2981d505267be984423ba3 Author: Lad Prabhakar Date: Wed Jul 1 16:41:40 2020 +0100 serial: sh-sci: Initialize spinlock for uart console serial core expects the spinlock to be initialized by the controller driver for serial console, this patch makes sure the spinlock is initialized, fixing the below issue: [ 0.865928] BUG: spinlock bad magic on CPU#0, swapper/0/1 [ 0.865945] lock: sci_ports+0x0/0x4c80, .magic: 00000000, .owner: /-1, .owner_cpu: 0 [ 0.865955] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc1+ #112 [ 0.865961] Hardware name: HopeRun HiHope RZ/G2H with sub board (DT) [ 0.865968] Call trace: [ 0.865979] dump_backtrace+0x0/0x1d8 [ 0.865985] show_stack+0x14/0x20 [ 0.865996] dump_stack+0xe8/0x130 [ 0.866006] spin_dump+0x6c/0x88 [ 0.866012] do_raw_spin_lock+0xb0/0xf8 [ 0.866023] _raw_spin_lock_irqsave+0x80/0xa0 [ 0.866032] uart_add_one_port+0x3a4/0x4e0 [ 0.866039] sci_probe+0x504/0x7c8 [ 0.866048] platform_drv_probe+0x50/0xa0 [ 0.866059] really_probe+0xdc/0x330 [ 0.866066] driver_probe_device+0x58/0xb8 [ 0.866072] device_driver_attach+0x6c/0x90 [ 0.866078] __driver_attach+0x88/0xd0 [ 0.866085] bus_for_each_dev+0x74/0xc8 [ 0.866091] driver_attach+0x20/0x28 [ 0.866098] bus_add_driver+0x14c/0x1f8 [ 0.866104] driver_register+0x60/0x110 [ 0.866109] __platform_driver_register+0x40/0x48 [ 0.866119] sci_init+0x2c/0x34 [ 0.866127] do_one_initcall+0x88/0x428 [ 0.866137] kernel_init_freeable+0x2c0/0x328 [ 0.866143] kernel_init+0x10/0x108 [ 0.866150] ret_from_fork+0x10/0x18 Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") Cc: stable Link: https://lore.kernel.org/r/1593618100-2151-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit cdd3bb54332f82295ed90cd0c09c78cd0c0ee822 Merge: 684c8ccc40d7 c43e55796dd4 Author: Linus Torvalds Date: Thu Jul 2 22:56:29 2020 -0700 Merge tag 'm68knommu-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu mm fixes from Greg Ungerer: "Two critical mm related fixes that affect booting of m68k/ColdFire devices. Both fix problems caused by recent system init memblock changes" * tag 'm68knommu-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: mm: fix node memblock init m68k: nommu: register start of the memory with memblock commit 684c8ccc40d7e5408d597a43712bad3827d3fb94 Merge: 45564bcd5704 0115e6c98c22 Author: Linus Torvalds Date: Thu Jul 2 22:46:05 2020 -0700 Merge tag 'devicetree-fixes-for-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Sync dtc to upstream to pick up fixes for I2C bus checks and quiet warnings - Various fixes for DT binding check warnings - A couple of build fixes/improvements for binding checks - ReST formatting improvements for writing-schema.rst - Document reference fixes * tag 'devicetree-fixes-for-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: clock: imx: Fix e-mail address dt-bindings: thermal: k3: Fix the reg property dt-bindings: thermal: Remove soc unit address dt-bindings: display: arm: versatile: Pass the sysreg unit name dt-bindings: usb: aspeed: Remove the leading zeroes dt-bindings: copy process-schema-examples.yaml to process-schema.yaml dt-bindings: do not build processed-schema.yaml for 'make dt_binding_check' dt-bindings: fix error in 'make clean' after 'make dt_binding_check' dt-bindings: mailbox: zynqmp_ipi: fix unit address dt-bindings: bus: uniphier-system-bus: fix warning in example scripts/dtc: Update to upstream version v1.6.0-11-g9d7888cbf19c doc: devicetree: bindings: fix spelling mistake docs: dt: minor adjustments at writing-schema.rst dt: fix reference to olpc,xo1.75-ec.txt dt: Fix broken references to renamed docs dt: fix broken links due to txt->yaml renames dt: update a reference for reneases pcar file renamed to yaml commit 45564bcd57046ebe8c9309527c114dcd042cb7e5 Merge: 0c7415c31ea9 c17d1a3a8ee4 Author: Linus Torvalds Date: Thu Jul 2 22:40:06 2020 -0700 Merge tag 'for-linus-2020-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull data race annotation from Christian Brauner: "This contains an annotation patch for a data race in copy_process() reported by KCSAN when reading and writing nr_threads. The data race is intentional and benign. This is obvious from the comment above the relevant code and based on general consensus when discussing this issue. So simply using data_race() to annotate this as an intentional race seems the best option" * tag 'for-linus-2020-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fork: annotate data race in copy_process() commit 0c7415c31ea9482c4377287af5f459778bf64d2a Merge: 0dce88451f9c e918e570415c Author: Linus Torvalds Date: Thu Jul 2 22:36:19 2020 -0700 Merge tag 'tpmdd-next-v5.8-rc4' of git://git.infradead.org/users/jjs/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen: "These are just fixes for bugs found lately. All of them are small scale things here and there, and all of them are for previous kernel releases (the oldest appeared in v2.6.17)" * tag 'tpmdd-next-v5.8-rc4' of git://git.infradead.org/users/jjs/linux-tpmdd: tpm_tis: Remove the HID IFX0102 tpm_tis_spi: Prefer async probe tpm: ibmvtpm: Wait for ready buffer before probing for TPM2 attributes tpm/st33zp24: fix spelling mistake "drescription" -> "description" tpm_tis: extra chip->ops check on error path in tpm_tis_core_init tpm_tis_spi: Don't send anything during flow control tpm: Fix TIS locality timeout problems commit 0dce88451f9c1cc5f1b73818e0608d5f84499e9a Merge: 55844741a1e7 377ff83083c9 Author: Linus Torvalds Date: Thu Jul 2 21:53:16 2020 -0700 Merge tag 'linux-kselftest-fixes-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest fixes from Shuah Khan: "tpm test fixes from Jarkko Sakkinen" * tag 'linux-kselftest-fixes-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: tpm: Use /bin/sh instead of /bin/bash selftests: tpm: Use 'test -e' instead of 'test -f' Revert "tpm: selftest: cleanup after unseal with wrong auth/policy test" commit 55844741a1e74bd41b4cea57502c2efedc99bf47 Merge: 083176c86ffa c63d2dd7e134 Author: Linus Torvalds Date: Thu Jul 2 21:49:26 2020 -0700 Merge tag 'linux-kselftest-kunit-fixes-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kunit fixes from Shuah Khan "Fixes for build and run-times failures. Also includes troubleshooting tips updates to kunit user documentation" * tag 'linux-kselftest-kunit-fixes-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: kunit: Add some troubleshooting tips to the FAQ kunit: kunit_tool: Fix invalid result when build fails kunit: show error if kunit results are not present kunit: kunit_config: Fix parsing of CONFIG options with space commit 083176c86ffae8c9b467358eca5ba05a54a27898 Merge: 7cc2a8ea1048 becd2014923f Author: Linus Torvalds Date: Thu Jul 2 20:35:33 2020 -0700 Merge tag 'nfsd-5.8-1' of git://linux-nfs.org/~bfields/linux Pull nfsd fixes from Bruce Fields: "Fixes for a umask bug on exported filesystems lacking ACL support, a leak and a module unloading bug in the /proc/fs/nfsd/clients/ code, and a compile warning" * tag 'nfsd-5.8-1' of git://linux-nfs.org/~bfields/linux: SUNRPC: Add missing definition of ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE nfsd: fix nfsdfs inode reference count leak nfsd4: fix nfsdfs reference count loop nfsd: apply umask on fs without ACL support commit cb551b8dc079d2ef189145782627c99cb68c0255 Author: Damien Le Moal Date: Wed Jul 1 17:52:54 2020 +0900 scsi: mpt3sas: Fix unlock imbalance In BRM_status_show(), if the condition "!ioc->is_warpdrive" tested on entry to the function is true, a "goto out" is called. This results in unlocking ioc->pci_access_mutex without this mutex lock being taken. This generates the following splat: [ 1148.539883] mpt3sas_cm2: BRM_status_show: BRM attribute is only for warpdrive [ 1148.547184] [ 1148.548708] ===================================== [ 1148.553501] WARNING: bad unlock balance detected! [ 1148.558277] 5.8.0-rc3+ #827 Not tainted [ 1148.562183] ------------------------------------- [ 1148.566959] cat/5008 is trying to release lock (&ioc->pci_access_mutex) at: [ 1148.574035] [] BRM_status_show+0xd3/0x100 [mpt3sas] [ 1148.580574] but there are no more locks to release! [ 1148.585524] [ 1148.585524] other info that might help us debug this: [ 1148.599624] 3 locks held by cat/5008: [ 1148.607085] #0: ffff92aea3e392c0 (&p->lock){+.+.}-{3:3}, at: seq_read+0x34/0x480 [ 1148.618509] #1: ffff922ef14c4888 (&of->mutex){+.+.}-{3:3}, at: kernfs_seq_start+0x2a/0xb0 [ 1148.630729] #2: ffff92aedb5d7310 (kn->active#224){.+.+}-{0:0}, at: kernfs_seq_start+0x32/0xb0 [ 1148.643347] [ 1148.643347] stack backtrace: [ 1148.655259] CPU: 73 PID: 5008 Comm: cat Not tainted 5.8.0-rc3+ #827 [ 1148.665309] Hardware name: HGST H4060-S/S2600STB, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019 [ 1148.678394] Call Trace: [ 1148.684750] dump_stack+0x78/0xa0 [ 1148.691802] lock_release.cold+0x45/0x4a [ 1148.699451] __mutex_unlock_slowpath+0x35/0x270 [ 1148.707675] BRM_status_show+0xd3/0x100 [mpt3sas] [ 1148.716092] dev_attr_show+0x19/0x40 [ 1148.723664] sysfs_kf_seq_show+0x87/0x100 [ 1148.731193] seq_read+0xbc/0x480 [ 1148.737882] vfs_read+0xa0/0x160 [ 1148.744514] ksys_read+0x58/0xd0 [ 1148.751129] do_syscall_64+0x4c/0xa0 [ 1148.757941] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1148.766240] RIP: 0033:0x7f1230566542 [ 1148.772957] Code: Bad RIP value. [ 1148.779206] RSP: 002b:00007ffeac1bcac8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [ 1148.790063] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f1230566542 [ 1148.800284] RDX: 0000000000020000 RSI: 00007f1223460000 RDI: 0000000000000003 [ 1148.810474] RBP: 00007f1223460000 R08: 00007f122345f010 R09: 0000000000000000 [ 1148.820641] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000000000 [ 1148.830728] R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000 Fix this by returning immediately instead of jumping to the out label. Link: https://lore.kernel.org/r/20200701085254.51740-1-damien.lemoal@wdc.com Reviewed-by: Johannes Thumshirn Acked-by: Sreekanth Reddy Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 1a9826204109acd3f8e926394b16bd4cdc4c5dbb Author: Bob Liu Date: Wed Jul 1 11:07:44 2020 +0800 scsi: iscsi: Change iSCSI workqueue max_active back to 1 Commit 3ce419662dd4 ("scsi: iscsi: Register sysfs for iscsi workqueue") enabled 'cpumask' support for iSCSI workqueues. However, it is unnecessary to set max_active = 2 since 'cpumask' can still be modified when max_active is 1. This patch sets max_active to 1 so as to keep the same behaviour as before. Link: https://lore.kernel.org/r/20200701030745.16897-1-bob.liu@oracle.com Reviewed-by: Mike Christie Signed-off-by: Bob Liu Signed-off-by: Martin K. Petersen commit 1298a549e22abe36c82208406c7069280553c7dd Merge: 80e89901e5a5 bda8eaa6dee7 Author: Dave Airlie Date: Fri Jul 3 11:18:06 2020 +1000 Merge tag 'drm-misc-fixes-2020-07-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * dma-buf: fix a use-after-free bug * sun4i: remove HPD polling Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200702075143.GA25040@linux-uq9g commit 0d242479b3e6f7b5aebea3ef07b8a73c4f45b50c Author: Tao Ren Date: Thu Jul 2 15:13:49 2020 -0700 hwmon: (pmbus) fix a typo in Kconfig SENSORS_IR35221 option Fix a typo in SENSORS_IR35221 option: module name should be "ir35221" instead of "ir35521". Fixes: 8991ebd9c9a6 ("hwmon: (pmbus) Add client driver for IR35221") Cc: Samuel Mendoza-Jonas Signed-off-by: Tao Ren Link: https://lore.kernel.org/r/20200702221349.18139-1-rentao.bupt@gmail.com Signed-off-by: Guenter Roeck commit 7cc2a8ea104820dd9e702202621e8fd4d9f6c8cf Merge: c93493b7cd40 e7eea44eefbd Author: Linus Torvalds Date: Thu Jul 2 15:13:51 2020 -0700 Merge tag 'block-5.8-2020-07-01' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Use kvfree_sensitive() for the block keyslot free (Eric) - Sync blk-mq debugfs flags (Hou) - Memory leak fix in virtio-blk error path (Hou) * tag 'block-5.8-2020-07-01' of git://git.kernel.dk/linux-block: virtio-blk: free vblk-vqs in error path of virtblk_probe() block/keyslot-manager: use kvfree_sensitive() blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags commit c93493b7cd40c20708e3373a7cc8e8049460d7ce Merge: cd77006e01b3 ce593a6c480a Author: Linus Torvalds Date: Thu Jul 2 14:56:22 2020 -0700 Merge tag 'io_uring-5.8-2020-07-01' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "One fix in here, for a regression in 5.7 where a task is waiting in the kernel for a condition, but that condition won't become true until task_work is run. And the task_work can't be run exactly because the task is waiting in the kernel, so we'll never make any progress. One example of that is registering an eventfd and queueing io_uring work, and then the task goes and waits in eventfd read with the expectation that it'll get woken (and read an event) when the io_uring request completes. The io_uring request is finished through task_work, which won't get run while the task is looping in eventfd read" * tag 'io_uring-5.8-2020-07-01' of git://git.kernel.dk/linux-block: io_uring: use signal based task_work running task_work: teach task_work_add() to do signal_wake_up() commit ad4e2b64839710e3b6e17a11b2684ceaaeae795e Author: Nicolas Ferre Date: Thu Jul 2 15:00:21 2020 +0200 MAINTAINERS: net: macb: add Claudiu as co-maintainer I would like that Claudiu becomes co-maintainer of the Cadence macb driver. He's already participating to lots of reviews and enhancements to this driver and knows the different versions of this controller. Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit af199a1a9cb02ec0194804bd46c174b6db262075 Author: Codrin Ciubotariu Date: Thu Jul 2 12:44:50 2020 +0300 net: dsa: microchip: set the correct number of ports The number of ports is incorrectly set to the maximum available for a DSA switch. Even if the extra ports are not used, this causes some functions to be called later, like port_disable() and port_stp_state_set(). If the driver doesn't check the port index, it will end up modifying unknown registers. Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Codrin Ciubotariu Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 578c1bb9056263ad3c9e09746b3d6e4daf63bdb0 Author: Juergen Gross Date: Wed Jul 1 14:16:38 2020 +0200 xen/xenbus: let xenbus_map_ring_valloc() return errno values only Today xenbus_map_ring_valloc() can return either a negative errno value (-ENOMEM or -EINVAL) or a grant status value. This is a mess as e.g -ENOMEM and GNTST_eagain have the same numeric value. Fix that by turning all grant mapping errors into -ENOENT. This is no problem as all callers of xenbus_map_ring_valloc() only use the return value to print an error message, and in case of mapping errors the grant status value has already been printed by __xenbus_map_ring() before. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20200701121638.19840-3-jgross@suse.com Signed-off-by: Boris Ostrovsky commit 3848e4e0a32afb96dc3b84e1358c3b9d103c6a2c Author: Juergen Gross Date: Wed Jul 1 14:16:37 2020 +0200 xen/xenbus: avoid large structs and arrays on the stack xenbus_map_ring_valloc() and its sub-functions are putting quite large structs and arrays on the stack. This is problematic at runtime, but might also result in build failures (e.g. with clang due to the option -Werror,-Wframe-larger-than=... used). Fix that by moving most of the data from the stack into a dynamically allocated struct. Performance is no issue here, as xenbus_map_ring_valloc() is used only when adding a new PV device to a backend driver. While at it move some duplicated code from pv/hvm specific mapping functions to the single caller. Reported-by: Arnd Bergmann Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20200701121638.19840-2-jgross@suse.com Signed-off-by: Boris Ostrovsky commit 1ca0fafd73c5268e8fc4b997094b8bb2bfe8deea Author: Eric Dumazet Date: Wed Jul 1 18:39:33 2020 -0700 tcp: md5: allow changing MD5 keys in all socket states This essentially reverts commit 721230326891 ("tcp: md5: reject TCP_MD5SIG or TCP_MD5SIG_EXT on established sockets") Mathieu reported that many vendors BGP implementations can actually switch TCP MD5 on established flows. Quoting Mathieu : Here is a list of a few network vendors along with their behavior with respect to TCP MD5: - Cisco: Allows for password to be changed, but within the hold-down timer (~180 seconds). - Juniper: When password is initially set on active connection it will reset, but after that any subsequent password changes no network resets. - Nokia: No notes on if they flap the tcp connection or not. - Ericsson/RedBack: Allows for 2 password (old/new) to co-exist until both sides are ok with new passwords. - Meta-Switch: Expects the password to be set before a connection is attempted, but no further info on whether they reset the TCP connection on a change. - Avaya: Disable the neighbor, then set password, then re-enable. - Zebos: Would normally allow the change when socket connected. We can revert my prior change because commit 9424e2e7ad93 ("tcp: md5: fix potential overestimation of TCP option space") removed the leak of 4 kernel bytes to the wire that was the main reason for my patch. While doing my investigations, I found a bug when a MD5 key is changed, leading to these commits that stable teams want to consider before backporting this revert : Commit 6a2febec338d ("tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()") Commit e6ced831ef11 ("tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers") Fixes: 721230326891 "tcp: md5: reject TCP_MD5SIG or TCP_MD5SIG_EXT on established sockets" Signed-off-by: Eric Dumazet Reported-by: Mathieu Desnoyers Signed-off-by: David S. Miller commit a55de412228cc5a2b4bf8d2a09849898102633e2 Author: Tony Lindgren Date: Thu Jul 2 13:57:14 2020 -0700 bus: ti-sysc: Do not disable on suspend for no-idle If we have "ti,no-idle" specified for a module we must not disable the the module on suspend to keep things backwards compatible. Fixes: 386cb76681ca ("bus: ti-sysc: Handle missed no-idle property in addition to no-idle-on-init") Reported-by: Grygorii Strashko Signed-off-by: Tony Lindgren commit f427f4d6214c183c474eeb46212d38e6c7223d6a Author: Divya Indi Date: Tue Jun 23 19:13:09 2020 -0700 IB/sa: Resolv use-after-free in ib_nl_make_request() There is a race condition where ib_nl_make_request() inserts the request data into the linked list but the timer in ib_nl_request_timeout() can see it and destroy it before ib_nl_send_msg() is done touching it. This could happen, for instance, if there is a long delay allocating memory during nlmsg_new() This causes a use-after-free in the send_mad() thread: [] ? ib_pack+0x17b/0x240 [ib_core] [ ] ib_sa_path_rec_get+0x181/0x200 [ib_sa] [] rdma_resolve_route+0x3c0/0x8d0 [rdma_cm] [] ? cma_bind_port+0xa0/0xa0 [rdma_cm] [] ? rds_rdma_cm_event_handler_cmn+0x850/0x850 [rds_rdma] [] rds_rdma_cm_event_handler_cmn+0x22c/0x850 [rds_rdma] [] rds_rdma_cm_event_handler+0x10/0x20 [rds_rdma] [] addr_handler+0x9e/0x140 [rdma_cm] [] process_req+0x134/0x190 [ib_addr] [] process_one_work+0x169/0x4a0 [] worker_thread+0x5b/0x560 [] ? flush_delayed_work+0x50/0x50 [] kthread+0xcb/0xf0 [] ? __schedule+0x24a/0x810 [] ? __schedule+0x24a/0x810 [] ? kthread_create_on_node+0x180/0x180 [] ret_from_fork+0x47/0x90 [] ? kthread_create_on_node+0x180/0x180 The ownership rule is once the request is on the list, ownership transfers to the list and the local thread can't touch it any more, just like for the normal MAD case in send_mad(). Thus, instead of adding before send and then trying to delete after on errors, move the entire thing under the spinlock so that the send and update of the lists are atomic to the conurrent threads. Lightly reoganize things so spinlock safe memory allocations are done in the final NL send path and the rest of the setup work is done before and outside the lock. Fixes: 3ebd2fd0d011 ("IB/sa: Put netlink request into the request list before sending") Link: https://lore.kernel.org/r/1592964789-14533-1-git-send-email-divya.indi@oracle.com Signed-off-by: Divya Indi Signed-off-by: Jason Gunthorpe commit 3197d48a7c04eee3e50bd54ef7e17e383b8a919e Author: Wei Yongjun Date: Thu Jul 2 13:35:43 2020 +0800 block: make function __bio_integrity_free() static Fix sparse build warning: block/bio-integrity.c:27:6: warning: symbol '__bio_integrity_free' was not declared. Should it be static? Signed-off-by: Wei Yongjun Signed-off-by: Jens Axboe commit b3c58fcd0e2c3cf2af30a766191431b4d69aafc2 Merge: e7eea44eefbd 72d447113bb7 Author: Jens Axboe Date: Thu Jul 2 12:11:23 2020 -0600 Merge branch 'nvme-5.8' of git://git.infradead.org/nvme into block-5.8 Pull NVMe fixes from Christoph. * 'nvme-5.8' of git://git.infradead.org/nvme: nvme: fix a crash in nvme_mpath_add_disk nvme: fix identify error status silent ignore commit afe6f1eeb08f85e57f0a02b71efb5a0839606aac Author: Tony Lindgren Date: Thu Jul 2 10:41:02 2020 -0700 bus: ti-sysc: Fix sleeping function called from invalid context for RTC quirk With CONFIG_DEBUG_ATOMIC_SLEEP enabled we can see the following with RTC probe: BUG: sleeping function called from invalid context at drivers/bus/ti-sysc.c:1736 ... (sysc_quirk_rtc) from [] (sysc_write_sysconfig+0x1c/0x60) (sysc_write_sysconfig) from [] (sysc_enable_module+0x11c/0x274) (sysc_enable_module) from [] (sysc_probe+0xe9c/0x1380) (sysc_probe) from [] (platform_drv_probe+0x48/0x98) Fixes: e8639e1c986a ("bus: ti-sysc: Handle module unlock quirk needed for some RTC") Signed-off-by: Tony Lindgren commit 9f9113925018d500a95df539014d9ff11ac2c02d Author: Tony Lindgren Date: Thu Jul 2 10:44:20 2020 -0700 bus: ti-sysc: Fix wakeirq sleeping function called from invalid context With CONFIG_DEBUG_ATOMIC_SLEEP enabled we can see the following with wakeirqs and serial console idled: BUG: sleeping function called from invalid context at drivers/bus/ti-sysc.c:242 ... (sysc_wait_softreset) from [] (sysc_enable_module+0x48/0x274) (sysc_enable_module) from [] (sysc_runtime_resume+0x19c/0x1d8) (sysc_runtime_resume) from [] (sysc_child_runtime_resume+0x58/0x84) (sysc_child_runtime_resume) from [] (__rpm_callback+0x30/0x12c) (__rpm_callback) from [] (rpm_callback+0x20/0x80) (rpm_callback) from [] (rpm_resume+0x638/0x7fc) (rpm_resume) from [] (__pm_runtime_resume+0x60/0x9c) (__pm_runtime_resume) from [] (handle_threaded_wake_irq+0x24/0x60) (handle_threaded_wake_irq) from [] (irq_thread_fn+0x1c/0x78) (irq_thread_fn) from [] (irq_thread+0x140/0x26c) We have __pm_runtime_resume() call the sysc_runtime_resume() with spinlock held and interrupts disabled. Fixes: d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit") Signed-off-by: Tony Lindgren commit 2315ec12ee8e8257bb335654c62e0cae71dc278d Author: Kaike Wan Date: Tue Jun 23 16:40:53 2020 -0400 IB/hfi1: Do not destroy link_wq when the device is shut down The workqueue link_wq should only be destroyed when the hfi1 driver is unloaded, not when the device is shut down. Fixes: 71d47008ca1b ("IB/hfi1: Create workqueue for link events") Link: https://lore.kernel.org/r/20200623204053.107638.70315.stgit@awfm-01.aw.intel.com Cc: Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 28b70cd9236563e1a88a6094673fef3c08db0d51 Author: Kaike Wan Date: Tue Jun 23 16:40:47 2020 -0400 IB/hfi1: Do not destroy hfi1_wq when the device is shut down The workqueue hfi1_wq is destroyed in function shutdown_device(), which is called by either shutdown_one() or remove_one(). The function shutdown_one() is called when the kernel is rebooted while remove_one() is called when the hfi1 driver is unloaded. When the kernel is rebooted, hfi1_wq is destroyed while all qps are still active, leading to a kernel crash: BUG: unable to handle kernel NULL pointer dereference at 0000000000000102 IP: [] __queue_work+0x32/0x3e0 PGD 0 Oops: 0000 [#1] SMP Modules linked in: dm_round_robin nvme_rdma(OE) nvme_fabrics(OE) nvme_core(OE) ib_isert iscsi_target_mod target_core_mod ib_ucm mlx4_ib iTCO_wdt iTCO_vendor_support mxm_wmi sb_edac intel_powerclamp coretemp intel_rapl iosf_mbi kvm rpcrdma sunrpc irqbypass crc32_pclmul ghash_clmulni_intel rdma_ucm aesni_intel ib_uverbs lrw gf128mul opa_vnic glue_helper ablk_helper ib_iser cryptd ib_umad rdma_cm iw_cm ses enclosure libiscsi scsi_transport_sas pcspkr joydev ib_ipoib(OE) scsi_transport_iscsi ib_cm sg ipmi_ssif mei_me lpc_ich i2c_i801 mei ioatdma ipmi_si dm_multipath ipmi_devintf ipmi_msghandler wmi acpi_pad acpi_power_meter hangcheck_timer ip_tables ext4 mbcache jbd2 mlx4_en sd_mod crc_t10dif crct10dif_generic mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm hfi1(OE) crct10dif_pclmul crct10dif_common crc32c_intel drm ahci mlx4_core libahci rdmavt(OE) igb megaraid_sas ib_core libata drm_panel_orientation_quirks ptp pps_core devlink dca i2c_algo_bit dm_mirror dm_region_hash dm_log dm_mod CPU: 19 PID: 0 Comm: swapper/19 Kdump: loaded Tainted: G OE ------------ 3.10.0-957.el7.x86_64 #1 Hardware name: Phegda X2226A/S2600CW, BIOS SE5C610.86B.01.01.0024.021320181901 02/13/2018 task: ffff8a799ba0d140 ti: ffff8a799bad8000 task.ti: ffff8a799bad8000 RIP: 0010:[] [] __queue_work+0x32/0x3e0 RSP: 0018:ffff8a90dde43d80 EFLAGS: 00010046 RAX: 0000000000000082 RBX: 0000000000000086 RCX: 0000000000000000 RDX: ffff8a90b924fcb8 RSI: 0000000000000000 RDI: 000000000000001b RBP: ffff8a90dde43db8 R08: ffff8a799ba0d6d8 R09: ffff8a90dde53900 R10: 0000000000000002 R11: ffff8a90dde43de8 R12: ffff8a90b924fcb8 R13: 000000000000001b R14: 0000000000000000 R15: ffff8a90d2890000 FS: 0000000000000000(0000) GS:ffff8a90dde40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000102 CR3: 0000001a70410000 CR4: 00000000001607e0 Call Trace: [] queue_work_on+0x45/0x50 [] _hfi1_schedule_send+0x6e/0xc0 [hfi1] [] hfi1_schedule_send+0x32/0x70 [hfi1] [] rvt_rc_timeout+0xe9/0x130 [rdmavt] [] ? trigger_load_balance+0x6a/0x280 [] ? rvt_free_qpn+0x40/0x40 [rdmavt] [] call_timer_fn+0x38/0x110 [] ? rvt_free_qpn+0x40/0x40 [rdmavt] [] run_timer_softirq+0x24d/0x300 [] __do_softirq+0xf5/0x280 [] call_softirq+0x1c/0x30 [] do_softirq+0x65/0xa0 [] irq_exit+0x105/0x110 [] smp_apic_timer_interrupt+0x48/0x60 [] apic_timer_interrupt+0x162/0x170 [] ? cpuidle_enter_state+0x57/0xd0 [] cpuidle_idle_call+0xde/0x230 [] arch_cpu_idle+0xe/0xc0 [] cpu_startup_entry+0x14a/0x1e0 [] start_secondary+0x1f7/0x270 [] start_cpu+0x5/0x14 The solution is to destroy the workqueue only when the hfi1 driver is unloaded, not when the device is shut down. In addition, when the device is shut down, no more work should be scheduled on the workqueues and the workqueues are flushed. Fixes: 8d3e71136a08 ("IB/{hfi1, qib}: Add handling of kernel restart") Link: https://lore.kernel.org/r/20200623204047.107638.77646.stgit@awfm-01.aw.intel.com Cc: Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 0d5ab144429e8bd80889b856a44d56ab4a5cd59b Author: Max Filippov Date: Thu Jul 2 08:32:25 2020 -0700 xtensa: update *pos in cpuinfo_op.next Increment *pos in the cpuinfo_op.next to fix the following warning triggered by cat /proc/cpuinfo: seq_file: buggy .next function c_next did not update position index Signed-off-by: Max Filippov commit 73f9941306d5ce030f3ffc7db425c7b2a798cf8e Author: Max Filippov Date: Thu Jun 4 13:37:10 2020 -0700 xtensa: fix __sync_fetch_and_{and,or}_4 declarations Building xtensa kernel with gcc-10 produces the following warnings: arch/xtensa/kernel/xtensa_ksyms.c:90:15: warning: conflicting types for built-in function ‘__sync_fetch_and_and_4’; expected ‘unsigned int(volatile void *, unsigned int)’ [-Wbuiltin-declaration-mismatch] arch/xtensa/kernel/xtensa_ksyms.c:96:15: warning: conflicting types for built-in function ‘__sync_fetch_and_or_4’; expected ‘unsigned int(volatile void *, unsigned int)’ [-Wbuiltin-declaration-mismatch] Fix declarations of these functions to avoid the warning. Signed-off-by: Max Filippov commit e918e570415ced9898a51109000a3f39a6e03be5 Author: Jarkko Sakkinen Date: Thu Jun 25 05:31:11 2020 +0300 tpm_tis: Remove the HID IFX0102 Acer C720 running Linux v5.3 reports this in klog: tpm_tis: 1.2 TPM (device-id 0xB, rev-id 16) tpm tpm0: tpm_try_transmit: send(): error -5 tpm tpm0: A TPM error (-5) occurred attempting to determine the timeouts tpm_tis tpm_tis: Could not get TPM timeouts and durations tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16) tpm tpm0: tpm_try_transmit: send(): error -5 tpm tpm0: A TPM error (-5) occurred attempting to determine the timeouts tpm_tis 00:08: Could not get TPM timeouts and durations ima: No TPM chip found, activating TPM-bypass! tpm_inf_pnp 00:08: Found TPM with ID IFX0102 % git --no-pager grep IFX0102 drivers/char/tpm drivers/char/tpm/tpm_infineon.c: {"IFX0102", 0}, drivers/char/tpm/tpm_tis.c: {"IFX0102", 0}, /* Infineon */ Obviously IFX0102 was added to the HID table for the TCG TIS driver by mistake. Fixes: 93e1b7d42e1e ("[PATCH] tpm: add HID module parameter") Link: https://bugzilla.kernel.org/show_bug.cgi?id=203877 Cc: stable@vger.kernel.org Cc: Kylene Jo Hall Reported-by: Ferry Toth: Reviewed-by: Jerry Snitselaar Signed-off-by: Jarkko Sakkinen commit 7187bf7f6297a8cfc74512a4493e06028626482d Author: Douglas Anderson Date: Fri Jun 19 14:20:01 2020 -0700 tpm_tis_spi: Prefer async probe On a Chromebook I'm working on I noticed a big (~1 second) delay during bootup where nothing was happening. Right around this big delay there were messages about the TPM: [ 2.311352] tpm_tis_spi spi0.0: TPM ready IRQ confirmed on attempt 2 [ 3.332790] tpm_tis_spi spi0.0: Cr50 firmware version: ... I put a few printouts in and saw that tpm_tis_spi_init() (specifically tpm_chip_register() in that function) was taking the lion's share of this time, though ~115 ms of the time was in cr50_print_fw_version(). Let's make a one-line change to prefer async probe for tpm_tis_spi. There's no reason we need to block other drivers from probing while we load. NOTES: * It's possible that other hardware runs through the init sequence faster than Cr50 and this isn't such a big problem for them. However, even if they are faster they are still doing _some_ transfers over a SPI bus so this should benefit everyone even if to a lesser extent. * It's possible that there are extra delays in the code that could be optimized out. I didn't dig since once I enabled async probe they no longer impacted me. Signed-off-by: Douglas Anderson Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 72d0556dca39f45eca6c4c085e9eb0fc70aec025 Author: David Gibson Date: Fri Jun 19 13:30:40 2020 +1000 tpm: ibmvtpm: Wait for ready buffer before probing for TPM2 attributes The tpm2_get_cc_attrs_tbl() call will result in TPM commands being issued, which will need the use of the internal command/response buffer. But, we're issuing this *before* we've waited to make sure that buffer is allocated. This can result in intermittent failures to probe if the hypervisor / TPM implementation doesn't respond quickly enough. I find it fails almost every time with an 8 vcpu guest under KVM with software emulated TPM. To fix it, just move the tpm2_get_cc_attrs_tlb() call after the existing code to wait for initialization, which will ensure the buffer is allocated. Fixes: 18b3670d79ae9 ("tpm: ibmvtpm: Add support for TPM2") Signed-off-by: David Gibson Reviewed-by: Jerry Snitselaar Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 82efeb161c090072ab493ab8c8f8a551727f586e Author: Binbin Zhou Date: Wed Jun 17 09:00:38 2020 +0800 tpm/st33zp24: fix spelling mistake "drescription" -> "description" Trivial fix, the spelling of "drescription" is incorrect in function comment. Fix this. Signed-off-by: Binbin Zhou Acked-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit ccf6fb858e17a8f8a914a1c6444d277cfedfeae6 Author: Vasily Averin Date: Sat Jun 13 17:18:33 2020 +0300 tpm_tis: extra chip->ops check on error path in tpm_tis_core_init Found by smatch: drivers/char/tpm/tpm_tis_core.c:1088 tpm_tis_core_init() warn: variable dereferenced before check 'chip->ops' (see line 979) 'chip->ops' is assigned in the beginning of function in tpmm_chip_alloc->tpm_chip_alloc and is used before first possible goto to error path. Signed-off-by: Vasily Averin Reviewed-by: Jerry Snitselaar Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit eac9347d932b96c09f089ac0673ebe588983e59b Author: Douglas Anderson Date: Thu May 28 15:19:30 2020 -0700 tpm_tis_spi: Don't send anything during flow control During flow control we are just reading from the TPM, yet our spi_xfer has the tx_buf and rx_buf both non-NULL which means we're requesting a full duplex transfer. SPI is always somewhat of a full duplex protocol anyway and in theory the other side shouldn't really be looking at what we're sending it during flow control, but it's still a bit ugly to be sending some "random" data when we shouldn't. The default tpm_tis_spi_flow_control() tries to address this by setting 'phy->iobuf[0] = 0'. This partially avoids the problem of sending "random" data, but since our tx_buf and rx_buf both point to the same place I believe there is the potential of us sending the TPM's previous byte back to it if we hit the retry loop. Another flow control implementation, cr50_spi_flow_control(), doesn't address this at all. Let's clean this up and just make the tx_buf NULL before we call flow_control(). Not only does this ensure that we're not sending any "random" bytes but it also possibly could make the SPI controller behave in a slightly more optimal way. NOTE: no actual observed problems are fixed by this patch--it's was just made based on code inspection. Signed-off-by: Douglas Anderson Reviewed-by: Paul Menzel Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 7862840219058436b80029a0263fd1ef065fb1b3 Author: James Bottomley Date: Thu May 28 11:10:57 2020 -0700 tpm: Fix TIS locality timeout problems It has been reported that some TIS based TPMs are giving unexpected errors when using the O_NONBLOCK path of the TPM device. The problem is that some TPMs don't like it when you get and then relinquish a locality (as the tpm_try_get_ops()/tpm_put_ops() pair does) without sending a command. This currently happens all the time in the O_NONBLOCK write path. Fix this by moving the tpm_try_get_ops() further down the code to after the O_NONBLOCK determination is made. This is safe because the priv->buffer_mutex still protects the priv state being modified. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206275 Fixes: d23d12484307 ("tpm: fix invalid locking in NONBLOCKING mode") Reported-by: Mario Limonciello Tested-by: Alex Guzman Cc: stable@vger.kernel.org Reviewed-by: Jerry Snitselaar Signed-off-by: James Bottomley Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit f81b4565c1108fb954f344e6b4a153c8189e57fe Author: Leon Romanovsky Date: Tue Jun 30 15:21:47 2020 +0300 RDMA/mlx5: Fix legacy IPoIB QP initialization Legacy IPoIB sets IB_QP_CREATE_NETIF_QP QP create flag and because mlx5 doesn't use this flag, the process_create_flags() failed to create IPoIB QPs. Fixes: 2978975ce7f1 ("RDMA/mlx5: Process create QP flags in one place") Link: https://lore.kernel.org/r/20200630122147.445847-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e18321acfb9f14d01c03578e1c498e3f815d20a3 Author: Nathan Chancellor Date: Mon Jun 22 17:52:24 2020 -0700 IB/hfi1: Add explicit cast OPA_MTU_8192 to 'enum ib_mtu' Clang warns: drivers/infiniband/hw/hfi1/qp.c:198:9: warning: implicit conversion from enumeration type 'enum opa_mtu' to different enumeration type 'enum ib_mtu' [-Wenum-conversion] mtu = OPA_MTU_8192; ~ ^~~~~~~~~~~~ enum opa_mtu extends enum ib_mtu. There are typically two ways to deal with this: * Remove the expected types and just use 'int' for all parameters and types. * Explicitly cast the enums between each other. This driver chooses to do the later so do the same thing here. Fixes: 6d72344cf6c4 ("IB/ipoib: Increase ipoib Datagram mode MTU's upper limit") Link: https://lore.kernel.org/r/20200623005224.492239-1-natechancellor@gmail.com Link: https://github.com/ClangBuiltLinux/linux/issues/1062 Link: https://lore.kernel.org/linux-rdma/20200527040350.GA3118979@ubuntu-s3-xlarge-x86/ Signed-off-by: Nathan Chancellor Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit e3122822a74033ba8d6d9af855078f9ab741e33f Author: Dave Jiang Date: Thu Jun 25 12:16:54 2020 -0700 dmaengine: idxd: fix misc interrupt handler thread unmasking Fix unmasking of misc interrupt handler when completing normal. It exits early and skips the unmasking with the current implementation. Fix to unmask interrupt when exiting normally. Fixes: bfe1d56091c1 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/159311256528.855.11527922406329728512.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit da32b28c95a79e399e18c03f8178f41aec9c66e4 Author: Dave Jiang Date: Thu Jun 25 12:17:42 2020 -0700 dmaengine: idxd: cleanup workqueue config after disabling After disabling a device, we should clean up the internal state for the wqs and zero out the configuration registers. Without doing so can cause issues when the user reprogram the wqs. Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver") Reported-by: Yixin Zhang Signed-off-by: Dave Jiang Tested-by: Yixin Zhang Link: https://lore.kernel.org/r/159311264246.1198.11955791213681679428.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 5aaec71d605426d5963e17a88d0d9db97ccd3345 Author: Fabio Estevam Date: Tue Jun 30 19:30:20 2020 -0300 ASoC: dt-bindings: simple-card: Fix 'make dt_binding_check' warnings The following build warnings are seen with 'make dt_binding_check': Documentation/devicetree/bindings/sound/simple-card.example.dts:209.46-211.15: Warning (unit_address_vs_reg): /example-4/sound/simple-audio-card,cpu@0: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:213.37-215.15: Warning (unit_address_vs_reg): /example-4/sound/simple-audio-card,cpu@1: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:250.42-261.15: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@0: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:263.42-288.15: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@1: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:270.32-272.19: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@1/cpu@0: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:273.23-275.19: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@1/cpu@1: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:276.23-278.19: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@1/cpu@2: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:279.23-281.19: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@1/cpu@3: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/sound/simple-card.example.dts:290.42-303.15: Warning (unit_address_vs_reg): /example-5/sound/simple-audio-card,dai-link@2: node has a unit name, but no reg or ranges property Fix them all. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200630223020.25546-1-festevam@gmail.com Signed-off-by: Mark Brown commit f7b93d42945cc71e1346dd5ae07c59061d56745e Author: Ard Biesheuvel Date: Tue Jun 30 10:19:21 2020 +0200 arm64/alternatives: use subsections for replacement sequences When building very large kernels, the logic that emits replacement sequences for alternatives fails when relative branches are present in the code that is emitted into the .altinstr_replacement section and patched in at the original site and fixed up. The reason is that the linker will insert veneers if relative branches go out of range, and due to the relative distance of the .altinstr_replacement from the .text section where its branch targets usually live, veneers may be emitted at the end of the .altinstr_replacement section, with the relative branches in the sequence pointed at the veneers instead of the actual target. The alternatives patching logic will attempt to fix up the branch to point to its original target, which will be the veneer in this case, but given that the patch site is likely to be far away as well, it will be out of range and so patching will fail. There are other cases where these veneers are problematic, e.g., when the target of the branch is in .text while the patch site is in .init.text, in which case putting the replacement sequence inside .text may not help either. So let's use subsections to emit the replacement code as closely as possible to the patch site, to ensure that veneers are only likely to be emitted if they are required at the patch site as well, in which case they will be in range for the replacement sequence both before and after it is transported to the patch site. This will prevent alternative sequences in non-init code from being released from memory after boot, but this is tolerable given that the entire section is only 512 KB on an allyesconfig build (which weighs in at 500+ MB for the entire Image). Also, note that modules today carry the replacement sequences in non-init sections as well, and any of those that target init code will be emitted into init sections after this change. This fixes an early crash when booting an allyesconfig kernel on a system where any of the alternatives sequences containing relative branches are activated at boot (e.g., ARM64_HAS_PAN on TX2) Signed-off-by: Ard Biesheuvel Cc: Suzuki K Poulose Cc: James Morse Cc: Andre Przywara Cc: Dave P Martin Link: https://lore.kernel.org/r/20200630081921.13443-1-ardb@kernel.org Signed-off-by: Will Deacon commit 1393b4aaf9e1e803d59726053d542cebd4e2b5b2 Author: Paolo Bonzini Date: Thu Jul 2 05:39:31 2020 -0400 kvm: use more precise cast and do not drop __user Sparse complains on a call to get_compat_sigset, fix it. The "if" right above explains that sigmask_arg->sigset is basically a compat_sigset_t. Signed-off-by: Paolo Bonzini commit 72d447113bb751ded97b2e2c38f886e4a4139082 Author: Christoph Hellwig Date: Mon Jun 29 16:30:19 2020 +0200 nvme: fix a crash in nvme_mpath_add_disk For private namespaces ns->head_disk is NULL, so add a NULL check before updating the BDI capabilities. Fixes: b2ce4d90690b ("nvme-multipath: set bdi capabilities once") Reported-by: Avinash M N Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy commit ea43d9709f727e728e933a8157a7a7ca1a868281 Author: Sagi Grimberg Date: Fri Jun 26 10:46:29 2020 -0700 nvme: fix identify error status silent ignore Commit 59c7c3caaaf8 intended to only silently ignore non retry-able errors (DNR bit set) such that we can still identify misbehaving controllers, and in the other hand propagate retry-able errors (DNR bit cleared) so we don't wrongly abandon a namespace just because it happens to be temporarily inaccessible. The goal remains the same as the original commit where this was introduced but unfortunately had the logic backwards. Fixes: 59c7c3caaaf8 ("nvme: fix possible hang when ns scanning fails during error recovery") Reported-by: Keith Busch Signed-off-by: Sagi Grimberg Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit 17f64701ea6f541db7eb5d7423a830cb929b3052 Author: Martin Blumenstingl Date: Sat Jun 20 17:57:52 2020 +0200 drm/meson: viu: fix setting the OSD burst length in VIU_OSD1_FIFO_CTRL_STAT The burst length is configured in VIU_OSD1_FIFO_CTRL_STAT[31] and VIU_OSD1_FIFO_CTRL_STAT[11:10]. The public S905D3 datasheet describes this as: - 0x0 = up to 24 per burst - 0x1 = up to 32 per burst - 0x2 = up to 48 per burst - 0x3 = up to 64 per burst - 0x4 = up to 96 per burst - 0x5 = up to 128 per burst The lower two bits map to VIU_OSD1_FIFO_CTRL_STAT[11:10] while the upper bit maps to VIU_OSD1_FIFO_CTRL_STAT[31]. Replace meson_viu_osd_burst_length_reg() with pre-defined macros which set these values. meson_viu_osd_burst_length_reg() always returned 0 (for the two used values: 32 and 64 at least) and thus incorrectly set the burst size to 24. Fixes: 147ae1cbaa1842 ("drm: meson: viu: use proper macros instead of magic constants") Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Reviewed-by: Neil Armstrong Tested-by: Christian Hewitt Link: https://patchwork.freedesktop.org/patch/msgid/20200620155752.21065-1-martin.blumenstingl@googlemail.com commit 0465337c5599bbe360cdcff452992a1a6b7ed2d4 Author: Josef Bacik Date: Tue Jun 30 14:53:02 2020 -0400 btrfs: reset tree root pointer after error in init_tree_roots Eric reported an issue where mounting -o recovery with a fuzzed fs resulted in a kernel panic. This is because we tried to free the tree node, except it was an error from the read. Fix this by properly resetting the tree_root->node == NULL in this case. The panic was the following BTRFS warning (device loop0): failed to read tree root BUG: kernel NULL pointer dereference, address: 000000000000001f RIP: 0010:free_extent_buffer+0xe/0x90 [btrfs] Call Trace: free_root_extent_buffers.part.0+0x11/0x30 [btrfs] free_root_pointers+0x1a/0xa2 [btrfs] open_ctree+0x1776/0x18a5 [btrfs] btrfs_mount_root.cold+0x13/0xfa [btrfs] ? selinux_fs_context_parse_param+0x37/0x80 legacy_get_tree+0x27/0x40 vfs_get_tree+0x25/0xb0 fc_mount+0xe/0x30 vfs_kern_mount.part.0+0x71/0x90 btrfs_mount+0x147/0x3e0 [btrfs] ? cred_has_capability+0x7c/0x120 ? legacy_get_tree+0x27/0x40 legacy_get_tree+0x27/0x40 vfs_get_tree+0x25/0xb0 do_mount+0x735/0xa40 __x64_sys_mount+0x8e/0xd0 do_syscall_64+0x4d/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Nik says: this is problematic only if we fail on the last iteration of the loop as this results in init_tree_roots returning err value with tree_root->node = -ERR. Subsequently the caller does: fail_tree_roots which calls free_root_pointers on the bogus value. Reported-by: Eric Sandeen Fixes: b8522a1e5f42 ("btrfs: Factor out tree roots initialization during mount") CC: stable@vger.kernel.org # 5.5+ Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba [ add details how the pointer gets dereferenced ] Signed-off-by: David Sterba commit 6d548b9e5d56067cff17ff77585167cd65375e4b Author: Filipe Manana Date: Sat Jun 27 11:40:44 2020 +0100 btrfs: fix reclaim_size counter leak after stealing from global reserve Commit 7f9fe614407692 ("btrfs: improve global reserve stealing logic"), added in the 5.8 merge window, introduced another leak for the space_info's reclaim_size counter. This is very often triggered by the test cases generic/269 and generic/416 from fstests, producing a stack trace like the following during unmount: [37079.155499] ------------[ cut here ]------------ [37079.156844] WARNING: CPU: 2 PID: 2000423 at fs/btrfs/block-group.c:3422 btrfs_free_block_groups+0x2eb/0x300 [btrfs] [37079.158090] Modules linked in: dm_snapshot btrfs dm_thin_pool (...) [37079.164440] CPU: 2 PID: 2000423 Comm: umount Tainted: G W 5.7.0-rc7-btrfs-next-62 #1 [37079.165422] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), (...) [37079.167384] RIP: 0010:btrfs_free_block_groups+0x2eb/0x300 [btrfs] [37079.168375] Code: bd 58 ff ff ff 00 4c 8d (...) [37079.170199] RSP: 0018:ffffaa53875c7de0 EFLAGS: 00010206 [37079.171120] RAX: ffff98099e701cf8 RBX: ffff98099e2d4000 RCX: 0000000000000000 [37079.172057] RDX: 0000000000000001 RSI: ffffffffc0acc5b1 RDI: 00000000ffffffff [37079.173002] RBP: ffff98099e701cf8 R08: 0000000000000000 R09: 0000000000000000 [37079.173886] R10: 0000000000000000 R11: 0000000000000000 R12: ffff98099e701c00 [37079.174730] R13: ffff98099e2d5100 R14: dead000000000122 R15: dead000000000100 [37079.175578] FS: 00007f4d7d0a5840(0000) GS:ffff9809ec600000(0000) knlGS:0000000000000000 [37079.176434] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [37079.177289] CR2: 0000559224dcc000 CR3: 000000012207a004 CR4: 00000000003606e0 [37079.178152] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [37079.178935] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [37079.179675] Call Trace: [37079.180419] close_ctree+0x291/0x2d1 [btrfs] [37079.181162] generic_shutdown_super+0x6c/0x100 [37079.181898] kill_anon_super+0x14/0x30 [37079.182641] btrfs_kill_super+0x12/0x20 [btrfs] [37079.183371] deactivate_locked_super+0x31/0x70 [37079.184012] cleanup_mnt+0x100/0x160 [37079.184650] task_work_run+0x68/0xb0 [37079.185284] exit_to_usermode_loop+0xf9/0x100 [37079.185920] do_syscall_64+0x20d/0x260 [37079.186556] entry_SYSCALL_64_after_hwframe+0x49/0xb3 [37079.187197] RIP: 0033:0x7f4d7d2d9357 [37079.187836] Code: eb 0b 00 f7 d8 64 89 01 48 (...) [37079.189180] RSP: 002b:00007ffee4e0d368 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [37079.189845] RAX: 0000000000000000 RBX: 00007f4d7d3fb224 RCX: 00007f4d7d2d9357 [37079.190515] RDX: ffffffffffffff78 RSI: 0000000000000000 RDI: 0000559224dc5c90 [37079.191173] RBP: 0000559224dc1970 R08: 0000000000000000 R09: 00007ffee4e0c0e0 [37079.191815] R10: 0000559224dc7b00 R11: 0000000000000246 R12: 0000000000000000 [37079.192451] R13: 0000559224dc5c90 R14: 0000559224dc1a80 R15: 0000559224dc1ba0 [37079.193096] irq event stamp: 0 [37079.193729] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [37079.194379] hardirqs last disabled at (0): [] copy_process+0x755/0x1ea0 [37079.195033] softirqs last enabled at (0): [] copy_process+0x755/0x1ea0 [37079.195700] softirqs last disabled at (0): [<0000000000000000>] 0x0 [37079.196318] ---[ end trace b32710d864dea887 ]--- In the past commit d611add48b717a ("btrfs: fix reclaim counter leak of space_info objects") fixed similar cases. That commit however has a date more recent (April 7 2020) then the commit mentioned before (March 13 2020), however it was merged in kernel 5.7 while the older commit, which introduces a new leak, was merged only in the 5.8 merge window. So the leak sneaked in unnoticed. Fix this by making steal_from_global_rsv() remove the ticket using the helper remove_ticket(), which decrements the reclaim_size counter of the space_info object. Fixes: 7f9fe614407692 ("btrfs: improve global reserve stealing logic") Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6bf9cd2eed9aee6d742bb9296c994a91f5316949 Author: Boris Burkov Date: Wed Jun 17 11:35:19 2020 -0700 btrfs: fix fatal extent_buffer readahead vs releasepage race Under somewhat convoluted conditions, it is possible to attempt to release an extent_buffer that is under io, which triggers a BUG_ON in btrfs_release_extent_buffer_pages. This relies on a few different factors. First, extent_buffer reads done as readahead for searching use WAIT_NONE, so they free the local extent buffer reference while the io is outstanding. However, they should still be protected by TREE_REF. However, if the system is doing signficant reclaim, and simultaneously heavily accessing the extent_buffers, it is possible for releasepage to race with two concurrent readahead attempts in a way that leaves TREE_REF unset when the readahead extent buffer is released. Essentially, if two tasks race to allocate a new extent_buffer, but the winner who attempts the first io is rebuffed by a page being locked (likely by the reclaim itself) then the loser will still go ahead with issuing the readahead. The loser's call to find_extent_buffer must also race with the reclaim task reading the extent_buffer's refcount as 1 in a way that allows the reclaim to re-clear the TREE_REF checked by find_extent_buffer. The following represents an example execution demonstrating the race: CPU0 CPU1 CPU2 reada_for_search reada_for_search readahead_tree_block readahead_tree_block find_create_tree_block find_create_tree_block alloc_extent_buffer alloc_extent_buffer find_extent_buffer // not found allocates eb lock pages associate pages to eb insert eb into radix tree set TREE_REF, refs == 2 unlock pages read_extent_buffer_pages // WAIT_NONE not uptodate (brand new eb) lock_page if !trylock_page goto unlock_exit // not an error free_extent_buffer release_extent_buffer atomic_dec_and_test refs to 1 find_extent_buffer // found try_release_extent_buffer take refs_lock reads refs == 1; no io atomic_inc_not_zero refs to 2 mark_buffer_accessed check_buffer_tree_ref // not STALE, won't take refs_lock refs == 2; TREE_REF set // no action read_extent_buffer_pages // WAIT_NONE clear TREE_REF release_extent_buffer atomic_dec_and_test refs to 1 unlock_page still not uptodate (CPU1 read failed on trylock_page) locks pages set io_pages > 0 submit io return free_extent_buffer release_extent_buffer dec refs to 0 delete from radix tree btrfs_release_extent_buffer_pages BUG_ON(io_pages > 0)!!! We observe this at a very low rate in production and were also able to reproduce it in a test environment by introducing some spurious delays and by introducing probabilistic trylock_page failures. To fix it, we apply check_tree_ref at a point where it could not possibly be unset by a competing task: after io_pages has been incremented. All the codepaths that clear TREE_REF check for io, so they would not be able to clear it after this point until the io is done. Stack trace, for reference: [1417839.424739] ------------[ cut here ]------------ [1417839.435328] kernel BUG at fs/btrfs/extent_io.c:4841! [1417839.447024] invalid opcode: 0000 [#1] SMP [1417839.502972] RIP: 0010:btrfs_release_extent_buffer_pages+0x20/0x1f0 [1417839.517008] Code: ed e9 ... [1417839.558895] RSP: 0018:ffffc90020bcf798 EFLAGS: 00010202 [1417839.570816] RAX: 0000000000000002 RBX: ffff888102d6def0 RCX: 0000000000000028 [1417839.586962] RDX: 0000000000000002 RSI: ffff8887f0296482 RDI: ffff888102d6def0 [1417839.603108] RBP: ffff88885664a000 R08: 0000000000000046 R09: 0000000000000238 [1417839.619255] R10: 0000000000000028 R11: ffff88885664af68 R12: 0000000000000000 [1417839.635402] R13: 0000000000000000 R14: ffff88875f573ad0 R15: ffff888797aafd90 [1417839.651549] FS: 00007f5a844fa700(0000) GS:ffff88885f680000(0000) knlGS:0000000000000000 [1417839.669810] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [1417839.682887] CR2: 00007f7884541fe0 CR3: 000000049f609002 CR4: 00000000003606e0 [1417839.699037] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [1417839.715187] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [1417839.731320] Call Trace: [1417839.737103] release_extent_buffer+0x39/0x90 [1417839.746913] read_block_for_search.isra.38+0x2a3/0x370 [1417839.758645] btrfs_search_slot+0x260/0x9b0 [1417839.768054] btrfs_lookup_file_extent+0x4a/0x70 [1417839.778427] btrfs_get_extent+0x15f/0x830 [1417839.787665] ? submit_extent_page+0xc4/0x1c0 [1417839.797474] ? __do_readpage+0x299/0x7a0 [1417839.806515] __do_readpage+0x33b/0x7a0 [1417839.815171] ? btrfs_releasepage+0x70/0x70 [1417839.824597] extent_readpages+0x28f/0x400 [1417839.833836] read_pages+0x6a/0x1c0 [1417839.841729] ? startup_64+0x2/0x30 [1417839.849624] __do_page_cache_readahead+0x13c/0x1a0 [1417839.860590] filemap_fault+0x6c7/0x990 [1417839.869252] ? xas_load+0x8/0x80 [1417839.876756] ? xas_find+0x150/0x190 [1417839.884839] ? filemap_map_pages+0x295/0x3b0 [1417839.894652] __do_fault+0x32/0x110 [1417839.902540] __handle_mm_fault+0xacd/0x1000 [1417839.912156] handle_mm_fault+0xaa/0x1c0 [1417839.921004] __do_page_fault+0x242/0x4b0 [1417839.930044] ? page_fault+0x8/0x30 [1417839.937933] page_fault+0x1e/0x30 [1417839.945631] RIP: 0033:0x33c4bae [1417839.952927] Code: Bad RIP value. [1417839.960411] RSP: 002b:00007f5a844f7350 EFLAGS: 00010206 [1417839.972331] RAX: 000000000000006e RBX: 1614b3ff6a50398a RCX: 0000000000000000 [1417839.988477] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000002 [1417840.004626] RBP: 00007f5a844f7420 R08: 000000000000006e R09: 00007f5a94aeccb8 [1417840.020784] R10: 00007f5a844f7350 R11: 0000000000000000 R12: 00007f5a94aecc79 [1417840.036932] R13: 00007f5a94aecc78 R14: 00007f5a94aecc90 R15: 00007f5a94aecc40 CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Filipe Manana Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit c730ae0c6bb3125ccb776fb2ab6abbdff500c02c Author: Marcos Paulo de Souza Date: Tue Jun 16 15:54:29 2020 -0300 btrfs: convert comments to fallthrough annotations Convert fall through comments to the pseudo-keyword which is now the preferred way. Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba commit 80e89901e5a5ef0688a3ba457ed37bc2e625eb79 Merge: 370678c5fd82 beaf10efca64 Author: Dave Airlie Date: Thu Jul 2 14:50:59 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-07-01' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-07-01: amdgpu: - Fix for vega20 boards without RAS support - DC bandwidth revalidation fix - Fix Renoir vram info fetching - Fix hwmon freq printing Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200701194415.4065-1-alexander.deucher@amd.com commit 370678c5fd82a892a3b4b2cdaaf1de4dc1185b2d Merge: a0d9dc022124 55fd7e0222ea Author: Dave Airlie Date: Thu Jul 2 14:42:35 2020 +1000 Merge tag 'drm-intel-fixes-2020-07-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.8-rc4: - GVT fixes - Include asm sources for render cache clear batches Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87imf7l6ee.fsf@intel.com commit 19e888678bac8c82206eb915eaf72741b2a2615c Author: Ronnie Sahlberg Date: Thu Jul 2 10:55:41 2020 +1000 cifs: prevent truncation from long to int in wait_for_free_credits The wait_event_... defines evaluate to long so we should not assign it an int as this may truncate the value. Reported-by: Marshall Midden Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit e4b9a72d76a47c11677b4bb0dee24a1fb6efb3e9 Author: Helmut Grohne Date: Wed Jul 1 13:22:20 2020 +0200 net: dsa: microchip: enable ksz9893 via i2c in the ksz9477 driver The KSZ9893 3-Port Gigabit Ethernet Switch can be controlled via SPI, I²C or MDIO (very limited and not supported by this driver). While there is already a compatible entry for the SPI bus, it was missing for I²C. Signed-off-by: Helmut Grohne Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ba3bb0e76ccd464bb66665a1941fabe55dadb3ba Author: Eric Dumazet Date: Tue Jun 30 13:51:28 2020 -0700 tcp: fix SO_RCVLOWAT possible hangs under high mem pressure Whenever tcp_try_rmem_schedule() returns an error, we are under trouble and should make sure to wakeup readers so that they can drain socket queues and eventually make room. Fixes: 03f45c883c6f ("tcp: avoid extra wakeups for SO_RCVLOWAT users") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 9ffad9263b467efd8f8dc7ae1941a0a655a2bab2 Author: Zhang Xiaoxu Date: Sun Jun 28 21:06:38 2020 -0400 cifs: Fix the target file was deleted when rename failed. When xfstest generic/035, we found the target file was deleted if the rename return -EACESS. In cifs_rename2, we unlink the positive target dentry if rename failed with EACESS or EEXIST, even if the target dentry is positived before rename. Then the existing file was deleted. We should just delete the target file which created during the rename. Reported-by: Hulk Robot Signed-off-by: Zhang Xiaoxu Cc: stable@vger.kernel.org Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 5391b8e1b7b7e5cfa2dd4ffdc4b8c6b64dfd1866 Author: Paul Aurich Date: Fri Jun 26 12:58:09 2020 -0700 SMB3: Honor 'posix' flag for multiuser mounts The flag from the primary tcon needs to be copied into the volume info so that cifs_get_tcon will try to enable extensions on the per-user tcon. At that point, since posix extensions must have already been enabled on the superblock, don't try to needlessly adjust the mount flags. Fixes: ce558b0e17f8 ("smb3: Add posix create context for smb3.11 posix mounts") Fixes: b326614ea215 ("smb3: allow "posix" mount option to enable new SMB311 protocol extensions") Signed-off-by: Paul Aurich Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 6b356f6cf941d5054d7fab072cae4a5f8658e3db Author: Paul Aurich Date: Fri Jun 26 12:58:08 2020 -0700 SMB3: Honor 'handletimeout' flag for multiuser mounts Fixes: ca567eb2b3f0 ("SMB3: Allow persistent handle timeout to be configurable on mount") Signed-off-by: Paul Aurich CC: Stable Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit ad35f169db6cd5a4c5c0a5a42fb0cad3efeccb83 Author: Paul Aurich Date: Fri Jun 26 12:58:07 2020 -0700 SMB3: Honor lease disabling for multiuser mounts Fixes: 3e7a02d47872 ("smb3: allow disabling requesting leases") Signed-off-by: Paul Aurich CC: Stable Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 00dfbc2f9c61185a2e662f27c45a0bb29b2a134f Author: Paul Aurich Date: Fri Jun 26 12:58:06 2020 -0700 SMB3: Honor persistent/resilient handle flags for multiuser mounts Without this: - persistent handles will only be enabled for per-user tcons if the server advertises the 'Continuous Availabity' capability - resilient handles would never be enabled for per-user tcons Signed-off-by: Paul Aurich CC: Stable Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit cc15461c73d7d044d56c47e869a215e49bd429c8 Author: Paul Aurich Date: Fri Jun 26 12:58:05 2020 -0700 SMB3: Honor 'seal' flag for multiuser mounts Ensure multiuser SMB3 mounts use encryption for all users' tcons if the mount options are configured to require encryption. Without this, only the primary tcon and IPC tcons are guaranteed to be encrypted. Per-user tcons would only be encrypted if the server was configured to require encryption. Signed-off-by: Paul Aurich CC: Stable Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 0da7536fb47f51df89ccfcb1fa09f249d9accec5 Author: Willem de Bruijn Date: Wed Jul 1 16:00:06 2020 -0400 ip: Fix SO_MARK in RST, ACK and ICMP packets When no full socket is available, skbs are sent over a per-netns control socket. Its sk_mark is temporarily adjusted to match that of the real (request or timewait) socket or to reflect an incoming skb, so that the outgoing skb inherits this in __ip_make_skb. Introduction of the socket cookie mark field broke this. Now the skb is set through the cookie and cork: # init sockc.mark from sk_mark or cmsg ip_append_data ip_setup_cork # convert sockc.mark to cork mark ip_push_pending_frames ip_finish_skb __ip_make_skb # set skb->mark to cork mark But I missed these special control sockets. Update all callers of __ip(6)_make_skb that were originally missed. For IPv6, the same two icmp(v6) paths are affected. The third case is not, as commit 92e55f412cff ("tcp: don't annotate mark on control socket from tcp_v6_send_response()") replaced the ctl_sk->sk_mark with passing the mark field directly as a function argument. That commit predates the commit that introduced the bug. Fixes: c6af0c227a22 ("ip: support SO_MARK cmsg") Signed-off-by: Willem de Bruijn Reported-by: Martin KaFai Lau Reviewed-by: Martin KaFai Lau Signed-off-by: David S. Miller commit aadd69cad07b4afe9e4c260bfcfcd954c6e696e1 Author: Paul Aurich Date: Fri Jun 26 12:58:04 2020 -0700 cifs: Display local UID details for SMB sessions in DebugData This is useful for distinguishing SMB sessions on a multiuser mount. Signed-off-by: Paul Aurich Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit e114e1e8ac9d31f25b9dd873bab5d80c1fc482ca Author: Eric Dumazet Date: Wed Jul 1 12:41:23 2020 -0700 tcp: md5: do not send silly options in SYNCOOKIES Whenever cookie_init_timestamp() has been used to encode ECN,SACK,WSCALE options, we can not remove the TS option in the SYNACK. Otherwise, tcp_synack_options() will still advertize options like WSCALE that we can not deduce later when receiving the packet from the client to complete 3WHS. Note that modern linux TCP stacks wont use MD5+TS+SACK in a SYN packet, but we can not know for sure that all TCP stacks have the same logic. Before the fix a tcpdump would exhibit this wrong exchange : 10:12:15.464591 IP C > S: Flags [S], seq 4202415601, win 65535, options [nop,nop,md5 valid,mss 1400,sackOK,TS val 456965269 ecr 0,nop,wscale 8], length 0 10:12:15.464602 IP S > C: Flags [S.], seq 253516766, ack 4202415602, win 65535, options [nop,nop,md5 valid,mss 1400,nop,nop,sackOK,nop,wscale 8], length 0 10:12:15.464611 IP C > S: Flags [.], ack 1, win 256, options [nop,nop,md5 valid], length 0 10:12:15.464678 IP C > S: Flags [P.], seq 1:13, ack 1, win 256, options [nop,nop,md5 valid], length 12 10:12:15.464685 IP S > C: Flags [.], ack 13, win 65535, options [nop,nop,md5 valid], length 0 After this patch the exchange looks saner : 11:59:59.882990 IP C > S: Flags [S], seq 517075944, win 65535, options [nop,nop,md5 valid,mss 1400,sackOK,TS val 1751508483 ecr 0,nop,wscale 8], length 0 11:59:59.883002 IP S > C: Flags [S.], seq 1902939253, ack 517075945, win 65535, options [nop,nop,md5 valid,mss 1400,sackOK,TS val 1751508479 ecr 1751508483,nop,wscale 8], length 0 11:59:59.883012 IP C > S: Flags [.], ack 1, win 256, options [nop,nop,md5 valid,nop,nop,TS val 1751508483 ecr 1751508479], length 0 11:59:59.883114 IP C > S: Flags [P.], seq 1:13, ack 1, win 256, options [nop,nop,md5 valid,nop,nop,TS val 1751508483 ecr 1751508479], length 12 11:59:59.883122 IP S > C: Flags [.], ack 13, win 256, options [nop,nop,md5 valid,nop,nop,TS val 1751508483 ecr 1751508483], length 0 11:59:59.883152 IP S > C: Flags [P.], seq 1:13, ack 13, win 256, options [nop,nop,md5 valid,nop,nop,TS val 1751508484 ecr 1751508483], length 12 11:59:59.883170 IP C > S: Flags [.], ack 13, win 256, options [nop,nop,md5 valid,nop,nop,TS val 1751508484 ecr 1751508484], length 0 Of course, no SACK block will ever be added later, but nothing should break. Technically, we could remove the 4 nops included in MD5+TS options, but again some stacks could break seeing not conventional alignment. Fixes: 4957faade11b ("TCPCT part 1g: Responder Cookie => Initiator") Signed-off-by: Eric Dumazet Cc: Florian Westphal Cc: Mathieu Desnoyers Signed-off-by: David S. Miller commit 9ef845f894c93416a1cbcbc6ec42525fb06aaf4e Author: Rao Shoaib Date: Wed Jul 1 12:23:38 2020 -0700 rds: If one path needs re-connection, check all and re-connect In testing with mprds enabled, Oracle Cluster nodes after reboot were not able to communicate with others nodes and so failed to rejoin the cluster. Peers with lower IP address initiated connection but the node could not respond as it choose a different path and could not initiate a connection as it had a higher IP address. With this patch, when a node sends out a packet and the selected path is down, all other paths are also checked and any down paths are re-connected. Reviewed-by: Ka-cheong Poon Reviewed-by: David Edmondson Signed-off-by: Somasundaram Krishnasamy Signed-off-by: Rao Shoaib Signed-off-by: David S. Miller commit e6ced831ef11a2a06e8d00aad9d4fc05b610bf38 Author: Eric Dumazet Date: Wed Jul 1 11:43:04 2020 -0700 tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers My prior fix went a bit too far, according to Herbert and Mathieu. Since we accept that concurrent TCP MD5 lookups might see inconsistent keys, we can use READ_ONCE()/WRITE_ONCE() instead of smp_rmb()/smp_wmb() Clearing all key->key[] is needed to avoid possible KMSAN reports, if key->keylen is increased. Since tcp_md5_do_add() is not fast path, using __GFP_ZERO to clear all struct tcp_md5sig_key is simpler. data_race() was added in linux-5.8 and will prevent KCSAN reports, this can safely be removed in stable backports, if data_race() is not yet backported. v2: use data_race() both in tcp_md5_hash_key() and tcp_md5_do_add() Fixes: 6a2febec338d ("tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()") Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Cc: Herbert Xu Cc: Marco Elver Reviewed-by: Mathieu Desnoyers Acked-by: Herbert Xu Signed-off-by: David S. Miller commit 1e82a62fec613844da9e558f3493540a5b7a7b67 Author: Sean Tranchetti Date: Tue Jun 30 11:50:17 2020 -0600 genetlink: remove genl_bind A potential deadlock can occur during registering or unregistering a new generic netlink family between the main nl_table_lock and the cb_lock where each thread wants the lock held by the other, as demonstrated below. 1) Thread 1 is performing a netlink_bind() operation on a socket. As part of this call, it will call netlink_lock_table(), incrementing the nl_table_users count to 1. 2) Thread 2 is registering (or unregistering) a genl_family via the genl_(un)register_family() API. The cb_lock semaphore will be taken for writing. 3) Thread 1 will call genl_bind() as part of the bind operation to handle subscribing to GENL multicast groups at the request of the user. It will attempt to take the cb_lock semaphore for reading, but it will fail and be scheduled away, waiting for Thread 2 to finish the write. 4) Thread 2 will call netlink_table_grab() during the (un)registration call. However, as Thread 1 has incremented nl_table_users, it will not be able to proceed, and both threads will be stuck waiting for the other. genl_bind() is a noop, unless a genl_family implements the mcast_bind() function to handle setting up family-specific multicast operations. Since no one in-tree uses this functionality as Cong pointed out, simply removing the genl_bind() function will remove the possibility for deadlock, as there is no attempt by Thread 1 above to take the cb_lock semaphore. Fixes: c380d9a7afff ("genetlink: pass multicast bind/unbind to families") Suggested-by: Cong Wang Acked-by: Johannes Berg Reported-by: kernel test robot Signed-off-by: Sean Tranchetti Signed-off-by: David S. Miller commit 0115e6c98c22f3fc7ff7da2a41480483abe95b37 Author: Fabio Estevam Date: Tue Jun 30 21:53:46 2020 -0300 dt-bindings: clock: imx: Fix e-mail address The freescale.com domain is gone for quite some time. Use the nxp.com domain instead. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200701005346.1008-1-festevam@gmail.com Signed-off-by: Rob Herring commit cd77006e01b3198c75fb7819b3d0ff89709539bb Merge: edb543cfe5db 77b48bea2fee Author: Linus Torvalds Date: Wed Jul 1 12:56:05 2020 -0700 Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fix from Wei Liu: "One patch from Joseph to make panic reporting contain more useful information" * tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: Drivers: hv: Change flag to write log level in panic msg to false commit d3c54f7f18cb82283777998c4bec52e49241c783 Author: Luo bin Date: Wed Jul 1 11:16:33 2020 +0800 hinic: fix passing non negative value to ERR_PTR get_dev_cap and set_resources_state functions may return a positive value because of hardware failure, and the positive return value can not be passed to ERR_PTR directly. Fixes: 7dd29ee12865 ("hinic: add sriov feature support") Signed-off-by: Luo bin Signed-off-by: David S. Miller commit beaf10efca64ac824240838ab1f054dfbefab5e6 Author: Alex Deucher Date: Wed Jul 1 12:00:08 2020 -0400 drm/amdgpu: use %u rather than %d for sclk/mclk Large clock values may overflow and show up as negative. Reported by prOMiNd on IRC. Acked-by: Nirmoy Das Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d7a6634a4cfba073ff6a526cb4265d6e58ece234 Author: Alex Deucher Date: Thu Jun 25 17:55:57 2020 -0400 drm/amdgpu/atomfirmware: fix vram_info fetching for renoir Renoir uses integrated_system_info table v12. The table has the same layout as v11 with respect to this data. Just reuse the existing code for v12 for stable. Fixes incorrectly reported vram info in the driver output. Acked-by: Evan Quan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 9e9f85e029a2ee4167aacf3ff04e4288a5e5c74e Author: Heiko Carstens Date: Wed Jul 1 07:32:13 2020 +0200 s390: update defconfigs Signed-off-by: Heiko Carstens commit 5aa98879efe77d33d1639e006d4b0c1579cde9f6 Author: Thomas Richter Date: Fri Jun 26 11:24:34 2020 +0200 s390/cpum_sf: prohibit callchain data collection CPU Measurement sampling facility on s390 does not support perf tool collection of callchain data using --call-graph option. The sampling facility collects samples in a ring buffer which includes only the instruction address the samples were taken. When the ring buffer hits a watermark, a measurement alert interrupt is triggered and handled by the performance measurement unit (PMU) device driver. It collects the samples and feeds each sample to the perf ring buffer in the common code via functions perf_prepare_sample()/perf_output_sample(). When function perf_prepare_sample() is called to collect sample data's callchain, user register values or stack area, invalid data is picked, because the context of the collected information does not match the context when the sample was taken. There is currently no way to provide the callchain and other information, because the hardware sampler does not collect this information. Therefore prohibit sampling when the user requests a callchain graph from the hardware sampler. Return -EOPNOTSUPP to the user in this case. If call chains are really wanted, users need to specify software event cpu-clock to get the callchain information from a software event. Signed-off-by: Thomas Richter Reviewed-by: Sumanth Korikkar Signed-off-by: Heiko Carstens commit 9b6a3f3633a5cc928b78627764793b60cb62e0f6 Author: Mike Leach Date: Wed Jul 1 10:08:52 2020 -0600 coresight: etmv4: Fix CPU power management setup in probe() function The current probe() function calls a pair of cpuhp_xxx API functions to setup CPU hotplug handling. The hotplug lock is held for the duration of the two calls and other CPU related code using cpus_read_lock() / cpus_read_unlock() calls. The problem is that on error states, goto: statements bypass the cpus_read_unlock() call. This code has increased in complexity as the driver has developed. This patch introduces a pair of helper functions etm4_pm_setup_cpuslocked() and etm4_pm_clear() which correct the issues above and group the PM code a little better. The two functions etm4_cpu_pm_register() and etm4_cpu_pm_unregister() are dropped as these call cpu_pm_register_notifier() / ..unregister_notifier() dependent on CONFIG_CPU_PM - but this define is used to nop these functions out in the pm headers - so the wrapper functions are superfluous. Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Fixes: e9f5d63f84fe ("hwtracing/coresight-etm4x: Use cpuhp_setup_state_nocalls_cpuslocked()") Fixes: 58eb457be028 ("hwtracing/coresight-etm4x: Convert to hotplug state machine") Signed-off-by: Mike Leach Cc: stable Reviewed-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200701160852.2782823-3-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 6740de9433556d5e3f94c4901dce120d27677be1 Author: Dan Carpenter Date: Wed Jul 1 10:08:51 2020 -0600 coresight: cti: Fix error handling in probe There were a couple problems with error handling in the probe function: 1) If the "drvdata" allocation failed then it lead to a NULL dereference. 2) On several error paths we decremented "nr_cti_cpu" before it was incremented which lead to a reference counting bug. There were also some parts of the error handling which were not bugs but were messy. The error handling was confusing to read. It printed some unnecessary error messages. The simplest way to fix these problems was to create a cti_pm_setup() function that did all the power management setup in one go. That way when we call cti_pm_release() we don't have to deal with the complications of a partially configured power management config. I reversed the "if (drvdata->ctidev.cpu >= 0)" condition in cti_pm_release() so that it mirros the new cti_pm_setup() function. Fixes: 6a0953ce7de9 ("coresight: cti: Add CPU idle pm notifer to CTI devices") Signed-off-by: Dan Carpenter Reviewed-by: Mike Leach Reviewed-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200701160852.2782823-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7f58b487e9ff3ff0f5f29a57172295a41f08a6b5 Author: Masahiro Yamada Date: Wed Jul 1 00:06:25 2020 +0900 kbuild: make Clang build userprogs for target architecture Programs added 'userprogs' should be compiled for the target architecture i.e. the same architecture as the kernel. GCC does this correctly since the target architecture is implied by the toolchain prefix. Clang builds userspace programs always for the host architecture because the target triple is currently missing. Fix this. Fixes: 7f3a59db274c ("kbuild: add infrastructure to build userspace programs") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Nathan Chancellor commit b816b3db15f68690ee72a4a414624f8e82942b25 Author: Masahiro Yamada Date: Wed Jul 1 00:06:24 2020 +0900 kbuild: fix CONFIG_CC_CAN_LINK(_STATIC) for cross-compilation with Clang scripts/cc-can-link.sh tests if the compiler can link userspace programs. When $(CC) is GCC, it is checked against the target architecture because the toolchain prefix is specified as a part of $(CC). When $(CC) is Clang, it is checked against the host architecture because --target option is missing. Pass $(CLANG_FLAGS) to scripts/cc-can-link.sh to evaluate the link capability for the target architecture. Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor commit 853eab68afc80f59f36bbdeb715e5c88c501e680 Author: Wade Mealing Date: Wed Jun 17 13:49:47 2020 +0200 Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" Turns out that the permissions for 0400 really are what we want here, otherwise any user can read from this file. [fixed formatting, added changelog, and made attribute static - gregkh] Reported-by: Wade Mealing Cc: stable Fixes: f40609d1591f ("zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()") Link: https://bugzilla.redhat.com/show_bug.cgi?id=1847832 Reviewed-by: Steffen Maier Acked-by: Minchan Kim Link: https://lore.kernel.org/r/20200617114946.GA2131650@kroah.com Signed-off-by: Greg Kroah-Hartman commit 8f8499a910e63f9973b95c183e2d3bccfe9845ac Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:48:53 2020 +0200 kconfig: qconf: parse newer types at debug info There are 3 types that are not parsed by the debug info logic. Add support for them. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit 8a3b6e5687836cd16bfdfec38c7313c95492169c Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:48:35 2020 +0200 kconfig: qconf: navigate menus on hyperlinks Instead of just changing the helper window to show a dependency, also navigate to it at the config and menu widgets. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit cc1c08edccaf5317d99a17a3231fe06381044e83 Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:26:40 2020 +0200 kconfig: qconf: don't show goback button on splitMode the goback button does nothing on splitMode. So, why display it? Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit af737b4defe14eb4a2e4d6016973cc90df1d77d6 Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:26:39 2020 +0200 kconfig: qconf: simplify the goBack() logic The goBack() logic is used only for the configList, as it only makes sense on singleMode. So, let's simplify the code. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit b06c3ec3bd184e8bbd3e37d53a3d27c4ab9ccd09 Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:26:38 2020 +0200 kconfig: qconf: re-implement setSelected() The default implementation for setSelected() at QTreeWidgetItem allows multiple items to be selected. Well, this should never be possible for the configItem lists. So, implement a function that will automatically clean any previous selection. This simplifies the logic somewhat, while making the selection logic to be applied atomically, avoiding future issues on that. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit c4f7398bee9c49bd79930d4a856fb6291d20cde3 Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:26:37 2020 +0200 kconfig: qconf: make debug links work again The Qt5 conversion broke support for debug info links. Restore the behaviour added by changeset ab45d190fd4a ("kconfig: create links in info window"). The original approach was to pass a pointer for a data struct via an . That doesn't sound a good idea, as, if something gets wrong, the app could crash. So, instead, pass the name of the symbol, and validate such symbol at the hyperlink handling logic. Link: https://lore.kernel.org/lkml/20200628125421.12458086@coco.lan/ Reported-by: Maxim Levitsky Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit c699eaaba98322872adbf4a55e7d679016d27b2d Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:26:36 2020 +0200 kconfig: qconf: make search fully work again on split mode When the search dialog box finds symbols/menus that match the search criteria, it presents all results at the window. Clicking on a search result should make qconf to navigate to the selected item. This works on singleMode and on fullMode, but on splitMode, the navigation is broken. This was partially caused by an incomplete Qt5 conversion and by the followup patches that restored the original behavior. When qconf is on split mode, it has to update both the config and the menu views. Right now, such logic is broken, as it is not seeking using the right structures. On qconf, the screen is split into 3 parts: +------------+-------+ | | | | Config | Menu | | | | +------------+-------+ | | | ConfigInfo | | | +--------------------+ On singleMode and on fullMode, the menuView is hidden, and search updates only the configList (which controls the ConfigView). On SplitMode, the search logic should detect if the variable is a leaf or not. If it is a leaf, it should be presented at the menuView, and both configList and menuList should be updated. Otherwise, just the configList should be updated. Link: https://lore.kernel.org/lkml/a98b0f0ebe0c23615a76f1d23f25fd0c84835e6b.camel@redhat.com/ Reported-by: Maxim Levitsky Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit cf81dfa479e6c80c1b55208cd380f7b770645d52 Author: Mauro Carvalho Chehab Date: Tue Jun 30 08:26:35 2020 +0200 kconfig: qconf: cleanup includes The usage of c-like include is deprecated on modern Qt versions. Use the c++ style includes. While here, remove uneeded and redundant ones, sorting them on alphabetic order. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Masahiro Yamada commit 6e1d72f1ea212b0614b499aa8164a45622690877 Merge: 5ecad245de2a a3f574cd6548 Author: Paolo Bonzini Date: Wed Jul 1 10:24:35 2020 -0400 Merge tag 'kvmarm-fixes-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm fixes for 5.8, take #2 - Make sure a vcpu becoming non-resident doesn't race against the doorbell delivery - Only advertise pvtime if accounting is enabled - Return the correct error code if reset fails with SVE - Make sure that pseudo-NMI functions are annotated as __always_inline commit 44b37eb79e16a56cb30ba55b2da452396b941e7a Author: leilk.liu Date: Wed Jul 1 17:00:20 2020 +0800 spi: mediatek: use correct SPI_CFG2_REG MACRO this patch use correct SPI_CFG2_REG offset. Signed-off-by: leilk.liu Link: https://lore.kernel.org/r/20200701090020.7935-1-leilk.liu@mediatek.com Signed-off-by: Mark Brown commit 1eb96c198aff13162de4857e19f9488d59c4acb1 Author: Yu-Hsuan Hsu Date: Tue Jun 30 17:16:15 2020 +0800 ASoC: rockchip: add format and rate constraints on rk3399 S8 and S24 formats does not work on this machine driver so force to use S16_LE instead. In addition, add constraint to limit the max value of rate because the rate higher than 96000(172000, 192000) is not stable either. Signed-off-by: Yu-Hsuan Hsu Link: https://lore.kernel.org/r/20200630091615.4020059-1-yuhsuan@chromium.org Signed-off-by: Mark Brown commit ad922ca199b38974dbe392e2faeba3aadf461ac2 Author: Ravulapati Vishnu vardhan rao Date: Tue Jun 30 14:52:38 2020 +0530 ASoC: amd: Rectifying Unbalanced pm_runtime_enable! issue When snd_pci_acp3x driver loads we see: WARNING kernel:snd_pci_acp3x 0000:04:00.5: Unbalanced pm_runtime_enable! at boot time. same can be observed in /var/log/messages/. Modifying pm runtime sequence for fixing unbalanced pm issue. Signed-off-by: Ravulapati Vishnu vardhan rao Link: https://lore.kernel.org/r/20200630092242.7799-1-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown commit bc4be656471b39af8f2ad57ee372012c55da1da7 Author: Oder Chiou Date: Wed Jul 1 15:16:45 2020 +0800 ASoC: rt5682: cancel jack_detect_work if hs_jack is set to null even soundwire mode Base on https://patchwork.kernel.org/patch/11237953/ Soundwire mode also should follow it. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200701071645.32061-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 3660d0b8380e7c490a31d2eb669b4c02ccddaf3f Merge: 9ebcfadb0610 8b94a4b92327 Author: Greg Kroah-Hartman Date: Wed Jul 1 13:52:21 2020 +0200 Merge tag 'thunderbolt-fix-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: thunderbolt: Fix for v5.8-rc4 This includes a single patch that corrects path indices used in USB3 tunnel discovery. * tag 'thunderbolt-fix-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Fix path indices used in USB3 tunnel discovery commit cced0b24bb545bfe74fea96de84adc23c0146b05 Author: Andy Lutomirski Date: Fri Jun 26 10:21:16 2020 -0700 selftests/x86: Consolidate and fix get/set_eflags() helpers There are several copies of get_eflags() and set_eflags() and they all are buggy. Consolidate them and fix them. The fixes are: Add memory clobbers. These are probably unnecessary but they make sure that the compiler doesn't move something past one of these calls when it shouldn't. Respect the redzone on x86_64. There has no failure been observed related to this, but it's definitely a bug. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/982ce58ae8dea2f1e57093ee894760e35267e751.1593191971.git.luto@kernel.org commit a61fa2799ef9bf6c4f54cf7295036577cececc72 Author: Andy Lutomirski Date: Fri Jun 26 10:21:15 2020 -0700 selftests/x86/syscall_nt: Clear weird flags after each test Clear the weird flags before logging to improve strace output -- logging results while, say, TF is set does no one any favors. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/907bfa5a42d4475b8245e18b67a04b13ca51ffdb.1593191971.git.luto@kernel.org commit e4ef7de160c6b12639c4fc49bcacb25b860ac76d Author: Andy Lutomirski Date: Fri Jun 26 10:21:14 2020 -0700 selftests/x86/syscall_nt: Add more flag combinations Add EFLAGS.AC to the mix. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/12924e2fe2c5826568b7fc9436d85ca7f5eb1743.1593191971.git.luto@kernel.org commit ffae641f57476369b4d503402b37ebe489d23395 Author: Andy Lutomirski Date: Fri Jun 26 10:21:13 2020 -0700 x86/entry/64/compat: Fix Xen PV SYSENTER frame setup The SYSENTER frame setup was nonsense. It worked by accident because the normal code into which the Xen asm jumped (entry_SYSENTER_32/compat) threw away SP without touching the stack. entry_SYSENTER_compat was recently modified such that it relied on having a valid stack pointer, so now the Xen asm needs to invoke it with a valid stack. Fix it up like SYSCALL: use the Xen-provided frame and skip the bare metal prologue. Fixes: 1c3e5d3f60e2 ("x86/entry: Make entry_64_compat.S objtool clean") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Reviewed-by: Boris Ostrovsky Link: https://lkml.kernel.org/r/947880c41ade688ff4836f665d0c9fcaa9bd1201.1593191971.git.luto@kernel.org commit d1721250f3ffed9afba3e1fb729947cec64c5a8a Author: Andy Lutomirski Date: Fri Jun 26 10:21:12 2020 -0700 x86/entry: Move SYSENTER's regs->sp and regs->flags fixups into C The SYSENTER asm (32-bit and compat) contains fixups for regs->sp and regs->flags. Move the fixups into C and fix some comments while at it. This is a valid cleanup all by itself, and it also simplifies the subsequent patch that will fix Xen PV SYSENTER. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/fe62bef67eda7fac75b8f3dbafccf571dc4ece6b.1593191971.git.luto@kernel.org commit c9c26150e61de441ab58b25c1f64afc049ee0fee Author: Andy Lutomirski Date: Fri Jun 26 10:21:11 2020 -0700 x86/entry: Assert that syscalls are on the right stack Now that the entry stack is a full page, it's too easy to regress the system call entry code and end up on the wrong stack without noticing. Assert that all system calls (SYSCALL64, SYSCALL32, SYSENTER, and INT80) are on the right stack and have pt_regs in the right place. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/52059e42bb0ab8551153d012d68f7be18d72ff8e.1593191971.git.luto@kernel.org commit a0d9dc0221241c529e15905465c145a7439b5def Merge: b325b5ed5e0a d4f5a095daf0 Author: Dave Airlie Date: Wed Jul 1 15:40:52 2020 +1000 Merge tag 'exynos-drm-fixes-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes Two fixups - It fixes wrong return value by returing proper error value instead of fixed one. - It fixes ref count leak in mic_pre_enable. One cleanup - It removes dev_err() call on platform_get_irq() failure because platform_get_irq() call dev_err() itself on failure. Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/1593395988-4612-1-git-send-email-inki.dae@samsung.com commit b325b5ed5e0a553f4e502bc58cf83cf012167699 Merge: 9ebcfadb0610 30480e6ed508 Author: Dave Airlie Date: Wed Jul 1 15:01:29 2020 +1000 Merge tag 'drm-msm-fixes-2020-06-25' of https://gitlab.freedesktop.org/drm/msm into drm-fixes A few fixes, mostly fallout from the address space refactor and dpu color processing. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/ Date: Mon Jun 29 13:03:52 2020 -0400 drm/amd/display: Only revalidate bandwidth on medium and fast updates [Why] Changes that are fast don't require updating DLG parameters making this call unnecessary. Considering this is an expensive call it should not be done on every flip. DML touches clocks, p-state support, DLG params and a few other DC internal flags and these aren't expected during fast. A hang has been reported with this change when called on every flip which suggests that modifying these fields is not recommended behavior on fast updates. [How] Guard the validation to only happen if update type isn't FAST. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1191 Fixes: a24eaa5c51255b ("drm/amd/display: Revalidate bandwidth before commiting DC updates") Signed-off-by: Nicholas Kazlauskas Acked-by: Alex Deucher Reviewed-by: Roman Li Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8ff41cc21714704ef0158a546c3c4d07fae2c952 Author: Dan Carpenter Date: Tue Jun 30 14:46:15 2020 +0300 net: qrtr: Fix an out of bounds read qrtr_endpoint_post() This code assumes that the user passed in enough data for a qrtr_hdr_v1 or qrtr_hdr_v2 struct, but it's not necessarily true. If the buffer is too small then it will read beyond the end. Reported-by: Manivannan Sadhasivam Reported-by: syzbot+b8fe393f999a291a9ea6@syzkaller.appspotmail.com Fixes: 194ccc88297a ("net: qrtr: Support decoding incoming v2 packets") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 6a2febec338df7e7699a52d00b2e1207dcf65b28 Author: Eric Dumazet Date: Tue Jun 30 16:41:01 2020 -0700 tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key() MD5 keys are read with RCU protection, and tcp_md5_do_add() might update in-place a prior key. Normally, typical RCU updates would allocate a new piece of memory. In this case only key->key and key->keylen might be updated, and we do not care if an incoming packet could see the old key, the new one, or some intermediate value, since changing the key on a live flow is known to be problematic anyway. We only want to make sure that in the case key->keylen is changed, cpus in tcp_md5_hash_key() wont try to use uninitialized data, or crash because key->keylen was read twice to feed sg_init_one() and ahash_request_set_crypt() Fixes: 9ea88a153001 ("tcp: md5: check md5 signature without socket lock") Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Signed-off-by: David S. Miller commit e7eea44eefbdd5f0345a0a8b80a3ca1c21030d06 Author: Hou Tao Date: Mon Jun 15 12:14:59 2020 +0800 virtio-blk: free vblk-vqs in error path of virtblk_probe() Else there will be memory leak if alloc_disk() fails. Fixes: 6a27b656fc02 ("block: virtio-blk: support multi virt queues per virtio-blk device") Signed-off-by: Hou Tao Reviewed-by: Stefano Garzarella Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 28541f3d324f6de1e545e2875283b6cef95c5d36 Author: Carl Huang Date: Tue Jun 30 14:52:51 2020 +0800 net: qrtr: free flow in __qrtr_node_release The flow is allocated in qrtr_tx_wait, but not freed when qrtr node is released. (*slot) becomes NULL after radix_tree_iter_delete is called in __qrtr_node_release. The fix is to save (*slot) to a vairable and then free it. This memory leak is catched when kmemleak is enabled in kernel, the report looks like below: unreferenced object 0xffffa0de69e08420 (size 32): comm "kworker/u16:3", pid 176, jiffies 4294918275 (age 82858.876s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 28 84 e0 69 de a0 ff ff ........(..i.... 28 84 e0 69 de a0 ff ff 03 00 00 00 00 00 00 00 (..i............ backtrace: [<00000000e252af0a>] qrtr_node_enqueue+0x38e/0x400 [qrtr] [<000000009cea437f>] qrtr_sendmsg+0x1e0/0x2a0 [qrtr] [<000000008bddbba4>] sock_sendmsg+0x5b/0x60 [<0000000003beb43a>] qmi_send_message.isra.3+0xbe/0x110 [qmi_helpers] [<000000009c9ae7de>] qmi_send_request+0x1c/0x20 [qmi_helpers] Signed-off-by: Carl Huang Signed-off-by: David S. Miller commit 8a259e6b73ad8181b0b2ef338b35043433db1075 Author: Li Heng Date: Mon Jun 29 18:49:51 2020 +0800 net: cxgb4: fix return error value in t4_prep_fw t4_prep_fw goto bye tag with positive return value when something bad happened and which can not free resource in adap_init0. so fix it to return negative value. Fixes: 16e47624e76b ("cxgb4: Add new scheme to update T4/T5 firmware") Reported-by: Hulk Robot Signed-off-by: Li Heng Signed-off-by: David S. Miller commit 5396956cc7c6874180c9bfc1ceceb02b739a6a87 Author: Mika Westerberg Date: Mon Jun 22 19:12:48 2020 +0300 PCI: Make pcie_find_root_port() work for Root Ports Commit 6ae72bfa656e ("PCI: Unify pcie_find_root_port() and pci_find_pcie_root_port()") broke acpi_pci_bridge_d3() because calling pcie_find_root_port() on a Root Port returned NULL when it should return the Root Port, which in turn broke power management of PCIe hierarchies. Rework pcie_find_root_port() so it returns its argument when it is already a Root Port. [bhelgaas: test device only once, test for PCIe] Fixes: 6ae72bfa656e ("PCI: Unify pcie_find_root_port() and pci_find_pcie_root_port()") Link: https://lore.kernel.org/r/20200622161248.51099-1-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas commit e708e2bd55c921f5bb554fa5837d132a878951cf Merge: 0433c93dff14 d923021c2ce1 Author: David S. Miller Date: Tue Jun 30 14:20:45 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2020-06-30 The following pull-request contains BPF updates for your *net* tree. We've added 28 non-merge commits during the last 9 day(s) which contain a total of 35 files changed, 486 insertions(+), 232 deletions(-). The main changes are: 1) Fix an incorrect verifier branch elimination for PTR_TO_BTF_ID pointer types, from Yonghong Song. 2) Fix UAPI for sockmap and flow_dissector progs that were ignoring various arguments passed to BPF_PROG_{ATTACH,DETACH}, from Lorenz Bauer & Jakub Sitnicki. 3) Fix broken AF_XDP DMA hacks that are poking into dma-direct and swiotlb internals and integrate it properly into DMA core, from Christoph Hellwig. 4) Fix RCU splat from recent changes to avoid skipping ingress policy when kTLS is enabled, from John Fastabend. 5) Fix BPF ringbuf map to enforce size to be the power of 2 in order for its position masking to work, from Andrii Nakryiko. 6) Fix regression from CAP_BPF work to re-allow CAP_SYS_ADMIN for loading of network programs, from Maciej Żenczykowski. 7) Fix libbpf section name prefix for devmap progs, from Jesper Dangaard Brouer. 8) Fix formatting in UAPI documentation for BPF helpers, from Quentin Monnet. ==================== Signed-off-by: David S. Miller commit d923021c2ce12acb50dc7086a1bf66eed82adf6a Author: Yonghong Song Date: Tue Jun 30 10:12:41 2020 -0700 bpf: Add tests for PTR_TO_BTF_ID vs. null comparison Add two tests for PTR_TO_BTF_ID vs. null ptr comparison, one for PTR_TO_BTF_ID in the ctx structure and the other for PTR_TO_BTF_ID after one level pointer chasing. In both cases, the test ensures condition is not removed. For example, for this test struct bpf_fentry_test_t { struct bpf_fentry_test_t *a; }; int BPF_PROG(test7, struct bpf_fentry_test_t *arg) { if (arg == 0) test7_result = 1; return 0; } Before the previous verifier change, we have xlated codes: int test7(long long unsigned int * ctx): ; int BPF_PROG(test7, struct bpf_fentry_test_t *arg) 0: (79) r1 = *(u64 *)(r1 +0) ; int BPF_PROG(test7, struct bpf_fentry_test_t *arg) 1: (b4) w0 = 0 2: (95) exit After the previous verifier change, we have: int test7(long long unsigned int * ctx): ; int BPF_PROG(test7, struct bpf_fentry_test_t *arg) 0: (79) r1 = *(u64 *)(r1 +0) ; if (arg == 0) 1: (55) if r1 != 0x0 goto pc+4 ; test7_result = 1; 2: (18) r1 = map[id:6][0]+48 4: (b7) r2 = 1 5: (7b) *(u64 *)(r1 +0) = r2 ; int BPF_PROG(test7, struct bpf_fentry_test_t *arg) 6: (b4) w0 = 0 7: (95) exit Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200630171241.2523875-1-yhs@fb.com commit 01c66c48d4f0825a202d4163800b706a1d2ec7ad Author: Yonghong Song Date: Tue Jun 30 10:12:40 2020 -0700 bpf: Fix an incorrect branch elimination by verifier Wenbo reported an issue in [1] where a checking of null pointer is evaluated as always false. In this particular case, the program type is tp_btf and the pointer to compare is a PTR_TO_BTF_ID. The current verifier considers PTR_TO_BTF_ID always reprents a non-null pointer, hence all PTR_TO_BTF_ID compares to 0 will be evaluated as always not-equal, which resulted in the branch elimination. For example, struct bpf_fentry_test_t { struct bpf_fentry_test_t *a; }; int BPF_PROG(test7, struct bpf_fentry_test_t *arg) { if (arg == 0) test7_result = 1; return 0; } int BPF_PROG(test8, struct bpf_fentry_test_t *arg) { if (arg->a == 0) test8_result = 1; return 0; } In above bpf programs, both branch arg == 0 and arg->a == 0 are removed. This may not be what developer expected. The bug is introduced by Commit cac616db39c2 ("bpf: Verifier track null pointer branch_taken with JNE and JEQ"), where PTR_TO_BTF_ID is considered to be non-null when evaluting pointer vs. scalar comparison. This may be added considering we have PTR_TO_BTF_ID_OR_NULL in the verifier as well. PTR_TO_BTF_ID_OR_NULL is added to explicitly requires a non-NULL testing in selective cases. The current generic pointer tracing framework in verifier always assigns PTR_TO_BTF_ID so users does not need to check NULL pointer at every pointer level like a->b->c->d. We may not want to assign every PTR_TO_BTF_ID as PTR_TO_BTF_ID_OR_NULL as this will require a null test before pointer dereference which may cause inconvenience for developers. But we could avoid branch elimination to preserve original code intention. This patch simply removed PTR_TO_BTD_ID from reg_type_not_null() in verifier, which prevented the above branches from being eliminated. [1]: https://lore.kernel.org/bpf/79dbb7c0-449d-83eb-5f4f-7af0cc269168@fb.com/T/ Fixes: cac616db39c2 ("bpf: Verifier track null pointer branch_taken with JNE and JEQ") Reported-by: Wenbo Zhang Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200630171240.2523722-1-yhs@fb.com commit 0433c93dff147fac488d39956ef1ddf34fd76044 Merge: f2ca673d2cd5 6cb63ea6a39e Author: David S. Miller Date: Tue Jun 30 13:10:57 2020 -0700 Merge branch 'net-ipa-three-bug-fixes' Alex Elder says: ==================== net: ipa: three bug fixes This series contains three bug fixes for the Qualcomm IPA driver. In practice these bugs are unlikke.y to be harmful, but they do represent incorrect code. Version 2 adds "Fixes" tags to two of the patches and fixes a typo in one (found by checkpatch.pl). ==================== Signed-off-by: David S. Miller commit 6cb63ea6a39eac9640d109f274a237b34350c183 Author: Alex Elder Date: Tue Jun 30 07:44:44 2020 -0500 net: ipa: introduce ipa_cmd_tag_process() Create a new function ipa_cmd_tag_process() that simply allocates a transaction, adds a tag process command to it to clear the hardware pipeline, and commits the transaction. Call it in from ipa_endpoint_suspend(), after suspending the modem endpoints but before suspending the AP command TX and AP LAN RX endpoints (which are used by the tag sequence). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 41af5436e857ec64f302fcc9b6e4a8c526b6b402 Author: Alex Elder Date: Tue Jun 30 07:44:43 2020 -0500 net: ipa: no checksum offload for SDM845 LAN RX The AP LAN RX endpoint should not have download checksum offload enabled. The receive handler does properly accommodate the trailer that's added by the hardware, but we ignore it. Fixes: 1ed7d0c0fdba ("soc: qcom: ipa: configuration data") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 5468cbcddf47f674829c6ada190283108a63d7b5 Author: Alex Elder Date: Tue Jun 30 07:44:42 2020 -0500 net: ipa: always check for stopped channel In gsi_channel_stop(), there's a check to see if the channel might have entered STOPPED state since a previous call, which might have timed out before stopping completed. That check actually belongs in gsi_channel_stop_command(), which is called repeatedly by gsi_channel_stop() for RX channels. Fixes: 650d1603825d ("soc: qcom: ipa: the generic software interface") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f2ca673d2cd5df9a76247b670e9ffd4d63682b3f Author: Russell King Date: Tue Jun 30 11:04:40 2020 +0100 net: mvneta: fix use of state->speed When support for short preambles was added, it incorrectly keyed its decision off state->speed instead of state->interface. state->speed is not guaranteed to be correct for in-band modes, which can lead to short preambles being unexpectedly disabled. Fix this by keying off the interface mode, which is the only way that mvneta can operate at 2.5Gbps. Fixes: da58a931f248 ("net: mvneta: Add support for 2500Mbps SGMII") Signed-off-by: Russell King Signed-off-by: David S. Miller commit edb543cfe5db6148935a383aeef4d0bfd240216c Merge: 615bc218d628 5267456e953f Author: Linus Torvalds Date: Tue Jun 30 12:35:11 2020 -0700 Merge tag 'exfat-for-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat fixes from Namjae Jeon: - Zero out unused characters of FileName field to avoid a complaint from some fsck tool. - Fix memory leak on error paths. - Fix unnecessary VOL_DIRTY set when calling rmdir on non-empty directory. - Call sync_filesystem() for read-only remount (Fix generic/452 test in xfstests) - Add own fsync() to flush dirty metadata. * tag 'exfat-for-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: flush dirty metadata in fsync exfat: move setting VOL_DIRTY over exfat_remove_entries() exfat: call sync_filesystem for read-only remount exfat: add missing brelse() calls on error paths exfat: Set the unused characters of FileName field to the value 0000h commit b9fcf0a0d826a3a556ae368a42461c920928c6c5 Merge: bf64ff4c2aac 8f9a1fa43083 Author: David S. Miller Date: Tue Jun 30 12:29:39 2020 -0700 Merge branch 'support-AF_PACKET-for-layer-3-devices' Jason A. Donenfeld says: ==================== support AF_PACKET for layer 3 devices Hans reported that packets injected by a correct-looking and trivial libpcap-based program were not being accepted by wireguard. In investigating that, I noticed that a few devices weren't properly handling AF_PACKET-injected packets, and so this series introduces a bit of shared infrastructure to support that. The basic problem begins with socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)) sockets. When sendto is called, AF_PACKET examines the headers of the packet with this logic: static void packet_parse_headers(struct sk_buff *skb, struct socket *sock) { if ((!skb->protocol || skb->protocol == htons(ETH_P_ALL)) && sock->type == SOCK_RAW) { skb_reset_mac_header(skb); skb->protocol = dev_parse_header_protocol(skb); } skb_probe_transport_header(skb); } The middle condition there triggers, and we jump to dev_parse_header_protocol. Note that this is the only caller of dev_parse_header_protocol in the kernel, and I assume it was designed for this purpose: static inline __be16 dev_parse_header_protocol(const struct sk_buff *skb) { const struct net_device *dev = skb->dev; if (!dev->header_ops || !dev->header_ops->parse_protocol) return 0; return dev->header_ops->parse_protocol(skb); } Since AF_PACKET already knows which netdev the packet is going to, the dev_parse_header_protocol function can see if that netdev has a way it prefers to figure out the protocol from the header. This, again, is the only use of parse_protocol in the kernel. At the moment, it's only used with ethernet devices, via eth_header_parse_protocol. This makes sense, as mostly people are used to AF_PACKET-injecting ethernet frames rather than layer 3 frames. But with nothing in place for layer 3 netdevs, this function winds up returning 0, and skb->protocol then is set to 0, and then by the time it hits the netdev's ndo_start_xmit, the driver doesn't know what to do with it. This is a problem because drivers very much rely on skb->protocol being correct, and routinely reject packets where it's incorrect. That's why having this parsing happen for injected packets is quite important. In wireguard, ipip, and ipip6, for example, packets from AF_PACKET are just dropped entirely. For tun devices, it's sort of uglier, with the tun "packet information" header being passed to userspace containing a bogus protocol value. Some userspace programs are ill-equipped to deal with that. (But of course, that doesn't happen with tap devices, which benefit from the similar shared infrastructure for layer 2 netdevs, further motiviating this patchset for layer 3 netdevs.) This patchset addresses the issue by first adding a layer 3 header parse function, much akin to the existing one for layer 2 packets, and then adds a shared header_ops structure that, also much akin to the existing one for layer 2 packets. Then it wires it up to a few immediate places that stuck out as requiring it, and does a bit of cleanup. This patchset seems like it's fixing real bugs, so it might be appropriate for stable. But they're also very old bugs, so if you'd rather not backport to stable, that'd make sense to me too. ==================== Signed-off-by: David S. Miller commit 8f9a1fa4308363944ba94a961f69646c4b0ff26b Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:25 2020 -0600 net: xfrmi: implement header_ops->parse_protocol for AF_PACKET The xfrm interface uses skb->protocol to determine packet type, and bails out if it's not set. For AF_PACKET injection, we need to support its call chain of: packet_sendmsg -> packet_snd -> packet_parse_headers -> dev_parse_header_protocol -> parse_protocol Without a valid parse_protocol, this returns zero, and xfrmi rejects the skb. So, this wires up the ip_tunnel handler for layer 3 packets for that case. Reported-by: Willem de Bruijn Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit 75ea1f4773c09730bf8a364a367f6e7211484e12 Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:24 2020 -0600 net: sit: implement header_ops->parse_protocol for AF_PACKET Sit uses skb->protocol to determine packet type, and bails out if it's not set. For AF_PACKET injection, we need to support its call chain of: packet_sendmsg -> packet_snd -> packet_parse_headers -> dev_parse_header_protocol -> parse_protocol Without a valid parse_protocol, this returns zero, and sit rejects the skb. So, this wires up the ip_tunnel handler for layer 3 packets for that case. Reported-by: Willem de Bruijn Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit ab59d2b6982b69a9728296ee3a1f330a72c0383e Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:23 2020 -0600 net: vti: implement header_ops->parse_protocol for AF_PACKET Vti uses skb->protocol to determine packet type, and bails out if it's not set. For AF_PACKET injection, we need to support its call chain of: packet_sendmsg -> packet_snd -> packet_parse_headers -> dev_parse_header_protocol -> parse_protocol Without a valid parse_protocol, this returns zero, and vti rejects the skb. So, this wires up the ip_tunnel handler for layer 3 packets for that case. Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit b9815eb1d13f0dc088ee8afb6e6d0683ea551098 Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:22 2020 -0600 tun: implement header_ops->parse_protocol for AF_PACKET The tun driver passes up skb->protocol to userspace in the form of PI headers. For AF_PACKET injection, we need to support its call chain of: packet_sendmsg -> packet_snd -> packet_parse_headers -> dev_parse_header_protocol -> parse_protocol Without a valid parse_protocol, this returns zero, and the tun driver then gives userspace bogus values that it can't deal with. Note that this isn't the case with tap, because tap already benefits from the shared infrastructure for ethernet headers. But with tun, there's nothing. Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit 1a574074ae7d1d745c16f7710655f38a53174c27 Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:21 2020 -0600 wireguard: queueing: make use of ip_tunnel_parse_protocol Now that wg_examine_packet_protocol has been added for general consumption as ip_tunnel_parse_protocol, it's possible to remove wg_examine_packet_protocol and simply use the new ip_tunnel_parse_protocol function directly. Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit 01a4967c71c004f8ecad4ab57021348636502fa9 Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:20 2020 -0600 wireguard: implement header_ops->parse_protocol for AF_PACKET WireGuard uses skb->protocol to determine packet type, and bails out if it's not set or set to something it's not expecting. For AF_PACKET injection, we need to support its call chain of: packet_sendmsg -> packet_snd -> packet_parse_headers -> dev_parse_header_protocol -> parse_protocol Without a valid parse_protocol, this returns zero, and wireguard then rejects the skb. So, this wires up the ip_tunnel handler for layer 3 packets for that case. Reported-by: Hans Wippel Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit e53ac93220e002fdf26b2874af6a74f393cd3872 Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:19 2020 -0600 net: ipip: implement header_ops->parse_protocol for AF_PACKET Ipip uses skb->protocol to determine packet type, and bails out if it's not set. For AF_PACKET injection, we need to support its call chain of: packet_sendmsg -> packet_snd -> packet_parse_headers -> dev_parse_header_protocol -> parse_protocol Without a valid parse_protocol, this returns zero, and ipip rejects the skb. So, this wires up the ip_tunnel handler for layer 3 packets for that case. Signed-off-by: Jason A. Donenfeld Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 2606aff916854b61234bf85001be9777bab2d5f8 Author: Jason A. Donenfeld Date: Mon Jun 29 19:06:18 2020 -0600 net: ip_tunnel: add header_ops for layer 3 devices Some devices that take straight up layer 3 packets benefit from having a shared header_ops so that AF_PACKET sockets can inject packets that are recognized. This shared infrastructure will be used by other drivers that currently can't inject packets using AF_PACKET. It also exposes the parser function, as it is useful in standalone form too. Signed-off-by: Jason A. Donenfeld Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 615bc218d628d90a3afebcfa772aa41865acd301 Merge: b13f40bc69a1 23e390cdbe6f Author: Linus Torvalds Date: Tue Jun 30 12:21:53 2020 -0700 Merge tag 'fixes-v5.8-rc3-a' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull security subsystem fixes from James Morris: "Two simple fixes for v5.8: - Fix hook iteration and default value for inode_copy_up_xattr (KP Singh) - Fix the key_permission LSM hook function type (Sami Tolvanen)" * tag 'fixes-v5.8-rc3-a' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: security: Fix hook iteration and default value for inode_copy_up_xattr security: fix the key_permission LSM hook function type commit b13f40bc69a16e465d21e23ca5adf4bf26365815 Merge: 7c30b859a947 20c59ce010f8 Author: Linus Torvalds Date: Tue Jun 30 12:17:21 2020 -0700 Merge tag 'integrity-v5.8-fix-2' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity updates from Mimi Zohar: "Include PCRs 8 & 9 in per TPM 2.0 bank boot_aggregate calculation. Prior to Linux 5.8 the SHA1 "boot_aggregate" value was padded with 0's and extended into the other TPM 2.0 banks. Included in the Linux 5.8 open window, TPM 2.0 PCR bank specific "boot_aggregate" values (PCRs 0 - 7) are calculated and extended into the TPM banks. Distro releases are now shipping grub2 with TPM support, which extend PCRs 8 & 9. I'd like for PCRs 8 & 9 to be included in the new "boot_aggregate" calculations. For backwards compatibility, if the hash is SHA1, these new PCRs are not included in the boot aggregate" * tag 'integrity-v5.8-fix-2' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: extend boot_aggregate with kernel measurements commit ed3e98e919aaaa47e9d9f8a40c3f6f4a22577842 Author: Merlijn Wajer Date: Tue Jun 30 11:47:40 2020 -0700 ARM: dts: n900: remove mmc1 card detect gpio Instead, expose the key via the input framework, as SW_MACHINE_COVER The chip-detect GPIO is actually detecting if the cover is closed. Technically it's possible to use the SD card with open cover. The only downside is risk of battery falling out and user being able to physically remove the card. The behaviour of SD card not being available when the device is open is unexpected and creates more problems than it solves. There is a high chance, that more people accidentally break their rootfs by opening the case without physically removing the card. Reviewed-by: Sebastian Reichel Acked-by: Tony Lindgren Signed-off-by: Merlijn Wajer Link: https://lore.kernel.org/r/20200612125402.18393-3-merlijn@wizzup.org Signed-off-by: Dmitry Torokhov commit c463bb2a8f8d7d97aa414bf7714fc77e9d3b10df Author: Merlijn Wajer Date: Tue Jun 30 11:47:04 2020 -0700 Input: add `SW_MACHINE_COVER` This event code represents the state of a removable cover of a device. Value 0 means that the cover is open or removed, value 1 means that the cover is closed. Reviewed-by: Sebastian Reichel Acked-by: Tony Lindgren Signed-off-by: Merlijn Wajer Link: https://lore.kernel.org/r/20200612125402.18393-2-merlijn@wizzup.org Signed-off-by: Dmitry Torokhov commit ce593a6c480a22acba08795be313c0c6d49dd35d Author: Jens Axboe Date: Tue Jun 30 12:39:05 2020 -0600 io_uring: use signal based task_work running Since 5.7, we've been using task_work to trigger async running of requests in the context of the original task. This generally works great, but there's a case where if the task is currently blocked in the kernel waiting on a condition to become true, it won't process task_work. Even though the task is woken, it just checks whatever condition it's waiting on, and goes back to sleep if it's still false. This is a problem if that very condition only becomes true when that task_work is run. An example of that is the task registering an eventfd with io_uring, and it's now blocked waiting on an eventfd read. That read could depend on a completion event, and that completion event won't get trigged until task_work has been run. Use the TWA_SIGNAL notification for task_work, so that we ensure that the task always runs the work when queued. Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Jens Axboe commit e91b48162332480f5840902268108bb7fb7a44c7 Author: Oleg Nesterov Date: Tue Jun 30 17:32:54 2020 +0200 task_work: teach task_work_add() to do signal_wake_up() So that the target task will exit the wait_event_interruptible-like loop and call task_work_run() asap. The patch turns "bool notify" into 0,TWA_RESUME,TWA_SIGNAL enum, the new TWA_SIGNAL flag implies signal_wake_up(). However, it needs to avoid the race with recalc_sigpending(), so the patch also adds the new JOBCTL_TASK_WORK bit included in JOBCTL_PENDING_MASK. TODO: once this patch is merged we need to change all current users of task_work_add(notify = true) to use TWA_RESUME. Cc: stable@vger.kernel.org # v5.7 Acked-by: Peter Zijlstra (Intel) Signed-off-by: Oleg Nesterov Signed-off-by: Jens Axboe commit 2576f87066dc08a11cb1c05f11d1eaa02148ef9e Author: Jakub Sitnicki Date: Tue Jun 30 18:45:41 2020 +0200 bpf, netns: Fix use-after-free in pernet pre_exit callback Iterating over BPF links attached to network namespace in pre_exit hook is not safe, even if there is just one. Once link gets auto-detached, that is its back-pointer to net object is set to NULL, the link can be released and freed without waiting on netns_bpf_mutex, effectively causing the list element we are operating on to be freed. This leads to use-after-free when trying to access the next element on the list, as reported by KASAN. Bug can be triggered by destroying a network namespace, while also releasing a link attached to this network namespace. | ================================================================== | BUG: KASAN: use-after-free in netns_bpf_pernet_pre_exit+0xd9/0x130 | Read of size 8 at addr ffff888119e0d778 by task kworker/u8:2/177 | | CPU: 3 PID: 177 Comm: kworker/u8:2 Not tainted 5.8.0-rc1-00197-ga0c04c9d1008-dirty #776 | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014 | Workqueue: netns cleanup_net | Call Trace: | dump_stack+0x9e/0xe0 | print_address_description.constprop.0+0x3a/0x60 | ? netns_bpf_pernet_pre_exit+0xd9/0x130 | kasan_report.cold+0x1f/0x40 | ? netns_bpf_pernet_pre_exit+0xd9/0x130 | netns_bpf_pernet_pre_exit+0xd9/0x130 | cleanup_net+0x30b/0x5b0 | ? unregister_pernet_device+0x50/0x50 | ? rcu_read_lock_bh_held+0xb0/0xb0 | ? _raw_spin_unlock_irq+0x24/0x50 | process_one_work+0x4d1/0xa10 | ? lock_release+0x3e0/0x3e0 | ? pwq_dec_nr_in_flight+0x110/0x110 | ? rwlock_bug.part.0+0x60/0x60 | worker_thread+0x7a/0x5c0 | ? process_one_work+0xa10/0xa10 | kthread+0x1e3/0x240 | ? kthread_create_on_node+0xd0/0xd0 | ret_from_fork+0x1f/0x30 | | Allocated by task 280: | save_stack+0x1b/0x40 | __kasan_kmalloc.constprop.0+0xc2/0xd0 | netns_bpf_link_create+0xfe/0x650 | __do_sys_bpf+0x153a/0x2a50 | do_syscall_64+0x59/0x300 | entry_SYSCALL_64_after_hwframe+0x44/0xa9 | | Freed by task 198: | save_stack+0x1b/0x40 | __kasan_slab_free+0x12f/0x180 | kfree+0xed/0x350 | process_one_work+0x4d1/0xa10 | worker_thread+0x7a/0x5c0 | kthread+0x1e3/0x240 | ret_from_fork+0x1f/0x30 | | The buggy address belongs to the object at ffff888119e0d700 | which belongs to the cache kmalloc-192 of size 192 | The buggy address is located 120 bytes inside of | 192-byte region [ffff888119e0d700, ffff888119e0d7c0) | The buggy address belongs to the page: | page:ffffea0004678340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 | flags: 0x2fffe0000000200(slab) | raw: 02fffe0000000200 ffffea00045ba8c0 0000000600000006 ffff88811a80ea80 | raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 | page dumped because: kasan: bad access detected | | Memory state around the buggy address: | ffff888119e0d600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb | ffff888119e0d680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc | >ffff888119e0d700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb | ^ | ffff888119e0d780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc | ffff888119e0d800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb | ================================================================== Remove the "fast-path" for releasing a link that got auto-detached by a dying network namespace to fix it. This way as long as link is on the list and netns_bpf mutex is held, we have a guarantee that link memory can be accessed. An alternative way to fix this issue would be to safely iterate over the list of links and ensure there is no access to link object after detaching it. But, at the moment, optimizing synchronization overhead on link release without a workload in mind seems like an overkill. Fixes: ab53cad90eb1 ("bpf, netns: Keep a list of attached bpf_link's") Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200630164541.1329993-1-jakub@cloudflare.com commit d02b10590953429a6dd2d6245df4d8a0a869df66 Merge: b9fd2007c974 bc5c7f55f5ea Author: Takashi Iwai Date: Tue Jun 30 19:49:38 2020 +0200 Merge tag 'asoc-fix-v5.8-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.8 A few small driver specific fixes, nothing particularly dramatic. commit b9fd2007c97413154e16bda01a6d5d5fc0c3bd44 Author: Alexander Tsoy Date: Mon Jun 29 05:59:34 2020 +0300 ALSA: usb-audio: Replace s/frame/packet/ where appropriate Replace several occurences of "frame" with a "packet" where appropriate. Signed-off-by: Alexander Tsoy Link: https://lore.kernel.org/r/20200629025934.154288-2-alexander@tsoy.me Signed-off-by: Takashi Iwai commit 695cf5ab401c1a368fed228ee4a624784cd17fc5 Author: Alexander Tsoy Date: Mon Jun 29 05:59:33 2020 +0300 ALSA: usb-audio: Fix packet size calculation Commit f0bd62b64016 ("ALSA: usb-audio: Improve frames size computation") introduced a regression for devices which have playback endpoints with bInterval > 1. Fix this by taking ep->datainterval into account. Note that frame and fps are actually mean packet and packets per second in the code introduces by the mentioned commit. This will be fixed in a follow-up patch. Fixes: f0bd62b64016 ("ALSA: usb-audio: Improve frames size computation") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208353 Signed-off-by: Alexander Tsoy Link: https://lore.kernel.org/r/20200629025934.154288-1-alexander@tsoy.me Signed-off-by: Takashi Iwai commit 084af57c51cfff7bb455311ac7b9fe6da8955d58 Merge: 951f38cf0835 1a1ad3c20a6f Author: Alexei Starovoitov Date: Tue Jun 30 10:46:39 2020 -0700 Merge branch 'fix-sockmap-flow_dissector-uapi' Lorenz Bauer says: ==================== Both sockmap and flow_dissector ingnore various arguments passed to BPF_PROG_ATTACH and BPF_PROG_DETACH. We can fix the attach case by checking that the unused arguments are zero. I considered requiring target_fd to be -1 instead of 0, but this leads to a lot of churn in selftests. There is also precedent in that bpf_iter already expects 0 for a similar field. I think that we can come up with a work around for fd 0 should we need to in the future. The detach case is more problematic: both cgroups and lirc2 verify that attach_bpf_fd matches the currently attached program. This way you need access to the program fd to be able to remove it. Neither sockmap nor flow_dissector do this. flow_dissector even has a check for CAP_NET_ADMIN because of this. The patch set addresses this by implementing the desired behaviour. There is a possibility for user space breakage: any callers that don't provide the correct fd will fail with ENOENT. For sockmap the risk is low: even the selftests assume that sockmap works the way I described. For flow_dissector the story is less straightforward, and the selftests use a variety of arguments. I've includes fixes tags for the oldest commits that allow an easy backport, however the behaviour dates back to when sockmap and flow_dissector were introduced. What is the best way to handle these? This set is based on top of Jakub's work "bpf, netns: Prepare for multi-prog attachment" available at https://lore.kernel.org/bpf/87k0zwmhtb.fsf@cloudflare.com/T/ Since v1: - Adjust selftests - Implement detach behaviour ==================== Signed-off-by: Alexei Starovoitov commit 1a1ad3c20a6fe0e8a4b570fbf835d7cc6e87a9d8 Author: Lorenz Bauer Date: Mon Jun 29 10:56:30 2020 +0100 selftests: bpf: Pass program to bpf_prog_detach in flow_dissector Calling bpf_prog_detach is incorrect, since it takes target_fd as its argument. The intention here is to pass it as attach_bpf_fd, so use bpf_prog_detach2 and pass zero for target_fd. Fixes: 06716e04a043 ("selftests/bpf: Extend test_flow_dissector to cover link creation") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200629095630.7933-7-lmb@cloudflare.com commit 0434296c72486881c2a71cd33876e4e6342001b5 Author: Lorenz Bauer Date: Mon Jun 29 10:56:29 2020 +0100 selftests: bpf: Pass program and target_fd in flow_dissector_reattach Pass 0 as target_fd when attaching and detaching flow dissector. Additionally, pass the expected program when detaching. Fixes: 1f043f87bb59 ("selftests/bpf: Add tests for attaching bpf_link to netns") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200629095630.7933-6-lmb@cloudflare.com commit bb0de3131f4c60a9bf976681e0fe4d1e55c7a821 Author: Lorenz Bauer Date: Mon Jun 29 10:56:28 2020 +0100 bpf: sockmap: Require attach_bpf_fd when detaching a program The sockmap code currently ignores the value of attach_bpf_fd when detaching a program. This is contrary to the usual behaviour of checking that attach_bpf_fd represents the currently attached program. Ensure that attach_bpf_fd is indeed the currently attached program. It turns out that all sockmap selftests already do this, which indicates that this is unlikely to cause breakage. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200629095630.7933-5-lmb@cloudflare.com commit 9b2b09717e1812e450782a43ca0c2790651cf380 Author: Lorenz Bauer Date: Mon Jun 29 10:56:27 2020 +0100 bpf: sockmap: Check value of unused args to BPF_PROG_ATTACH Using BPF_PROG_ATTACH on a sockmap program currently understands no flags or replace_bpf_fd, but accepts any value. Return EINVAL instead. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200629095630.7933-4-lmb@cloudflare.com commit 4ac2add65974e4efafb8d4ccd8fc5660417ea312 Author: Lorenz Bauer Date: Mon Jun 29 10:56:26 2020 +0100 bpf: flow_dissector: Check value of unused flags to BPF_PROG_DETACH Using BPF_PROG_DETACH on a flow dissector program supports neither attach_flags nor attach_bpf_fd. Yet no value is enforced for them. Enforce that attach_flags are zero, and require the current program to be passed via attach_bpf_fd. This allows us to remove the check for CAP_SYS_ADMIN, since userspace can now no longer remove arbitrary flow dissector programs. Fixes: b27f7bb590ba ("flow_dissector: Move out netns_bpf prog callbacks") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200629095630.7933-3-lmb@cloudflare.com commit 1b514239e85965cc4df085180a73dd91733135f7 Author: Lorenz Bauer Date: Mon Jun 29 10:56:25 2020 +0100 bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH Using BPF_PROG_ATTACH on a flow dissector program supports neither target_fd, attach_flags or replace_bpf_fd but accepts any value. Enforce that all of them are zero. This is fine for replace_bpf_fd since its presence is indicated by BPF_F_REPLACE. It's more problematic for target_fd, since zero is a valid fd. Should we want to use the flag later on we'd have to add an exception for fd 0. The alternative is to force a value like -1. This requires more changes to tests. There is also precedent for using 0, since bpf_iter uses this for target_fd as well. Fixes: b27f7bb590ba ("flow_dissector: Move out netns_bpf prog callbacks") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200629095630.7933-2-lmb@cloudflare.com commit 951f38cf08350884e72e0936adf147a8d764cc5d Merge: 517bbe1994a3 6ebb85c83aaf Author: Alexei Starovoitov Date: Tue Jun 30 10:45:08 2020 -0700 Merge branch 'bpf-multi-prog-prep' Jakub Sitnicki says: ==================== This patch set prepares ground for link-based multi-prog attachment for future netns attach types, with BPF_SK_LOOKUP attach type in mind [0]. Two changes are needed in order to attach and run a series of BPF programs: 1) an bpf_prog_array of programs to run (patch #2), and 2) a list of attached links to keep track of attachments (patch #3). Nothing changes for BPF flow_dissector. Just as before only one program can be attached to netns. In v3 I've simplified patch #2 that introduces bpf_prog_array to take advantage of the fact that it will hold at most one program for now. In particular, I'm no longer using bpf_prog_array_copy. It turned out to be less suitable for link operations than I thought as it fails to append the same BPF program. bpf_prog_array_replace_item is also gone, because we know we always want to replace the first element in prog_array. Naturally the code that handles bpf_prog_array will need change once more when there is a program type that allows multi-prog attachment. But I feel it will be better to do it gradually and present it together with tests that actually exercise multi-prog code paths. [0] https://lore.kernel.org/bpf/20200511185218.1422406-1-jakub@cloudflare.com/ v2 -> v3: - Don't check if run_array is null in link update callback. (Martin) - Allow updating the link with the same BPF program. (Andrii) - Add patch #4 with a test for the above case. - Kill bpf_prog_array_replace_item. Access the run_array directly. - Switch from bpf_prog_array_copy() to bpf_prog_array_alloc(1, ...). - Replace rcu_deref_protected & RCU_INIT_POINTER with rcu_replace_pointer. - Drop Andrii's Ack from patch #2. Code changed. v1 -> v2: - Show with a (void) cast that bpf_prog_array_replace_item() return value is ignored on purpose. (Andrii) - Explain why bpf-cgroup cannot replace programs in bpf_prog_array based on bpf_prog pointer comparison in patch #2 description. (Andrii) ==================== Signed-off-by: Alexei Starovoitov commit 6ebb85c83aaf6ae75b920ef45d2a9eee42079265 Author: Jakub Sitnicki Date: Thu Jun 25 16:13:57 2020 +0200 selftests/bpf: Test updating flow_dissector link with same program This case, while not particularly useful, is worth covering because we expect the operation to succeed as opposed when re-attaching the same program directly with PROG_ATTACH. While at it, update the tests summary that fell out of sync when tests extended to cover links. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200625141357.910330-5-jakub@cloudflare.com commit ab53cad90eb10c9991f501ba08904680a074ef3d Author: Jakub Sitnicki Date: Thu Jun 25 16:13:56 2020 +0200 bpf, netns: Keep a list of attached bpf_link's To support multi-prog link-based attachments for new netns attach types, we need to keep track of more than one bpf_link per attach type. Hence, convert net->bpf.links into a list, that currently can be either empty or have just one item. Instead of reusing bpf_prog_list from bpf-cgroup, we link together bpf_netns_link's themselves. This makes list management simpler as we don't have to allocate, initialize, and later release list elements. We can do this because multi-prog attachment will be available only for bpf_link, and we don't need to build a list of programs attached directly and indirectly via links. No functional changes intended. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200625141357.910330-4-jakub@cloudflare.com commit 695c12147a40181fe9221d321c3f2de33c9574ed Author: Jakub Sitnicki Date: Thu Jun 25 16:13:55 2020 +0200 bpf, netns: Keep attached programs in bpf_prog_array Prepare for having multi-prog attachments for new netns attach types by storing programs to run in a bpf_prog_array, which is well suited for iterating over programs and running them in sequence. After this change bpf(PROG_QUERY) may block to allocate memory in bpf_prog_array_copy_to_user() for collected program IDs. This forces a change in how we protect access to the attached program in the query callback. Because bpf_prog_array_copy_to_user() can sleep, we switch from an RCU read lock to holding a mutex that serializes updaters. Because we allow only one BPF flow_dissector program to be attached to netns at all times, the bpf_prog_array pointed by net->bpf.run_array is always either detached (null) or one element long. No functional changes intended. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200625141357.910330-3-jakub@cloudflare.com commit 3b7016996c4c44db5d499d98759b82fb714bb912 Author: Jakub Sitnicki Date: Thu Jun 25 16:13:54 2020 +0200 flow_dissector: Pull BPF program assignment up to bpf-netns Prepare for using bpf_prog_array to store attached programs by moving out code that updates the attached program out of flow dissector. Managing bpf_prog_array is more involved than updating a single bpf_prog pointer. This will let us do it all from one place, bpf/net_namespace.c, in the subsequent patch. No functional change intended. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200625141357.910330-2-jakub@cloudflare.com commit 0318e8374e87b32def1d5c279013ca7730a74982 Author: Sumeet Pawnikar Date: Tue Jun 30 21:11:49 2020 +0530 ACPI: fan: Fix Tiger Lake ACPI device ID Tiger Lake's new unique ACPI device ID for Fan is not valid because of missing 'C' in the ID. Use correct fan device ID. Fixes: c248dfe7e0ca ("ACPI: fan: Add Tiger Lake ACPI device ID") Signed-off-by: Sumeet Pawnikar Cc: 5.6+ # 5.6+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit c4e8fa9074ad94f80e5c0dcaa16b313e50e958c5 Author: Eric Dumazet Date: Mon Jun 29 17:04:17 2020 -0700 netfilter: ipset: call ip_set_free() instead of kfree() Whenever ip_set_alloc() is used, allocated memory can either use kmalloc() or vmalloc(). We should call kvfree() or ip_set_free() invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 21935 Comm: syz-executor.3 Not tainted 5.8.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__phys_addr+0xa7/0x110 arch/x86/mm/physaddr.c:28 Code: 1d 7a 09 4c 89 e3 31 ff 48 d3 eb 48 89 de e8 d0 58 3f 00 48 85 db 75 0d e8 26 5c 3f 00 4c 89 e0 5b 5d 41 5c c3 e8 19 5c 3f 00 <0f> 0b e8 12 5c 3f 00 48 c7 c0 10 10 a8 89 48 ba 00 00 00 00 00 fc RSP: 0000:ffffc900018572c0 EFLAGS: 00010046 RAX: 0000000000040000 RBX: 0000000000000001 RCX: ffffc9000fac3000 RDX: 0000000000040000 RSI: ffffffff8133f437 RDI: 0000000000000007 RBP: ffffc90098aff000 R08: 0000000000000000 R09: ffff8880ae636cdb R10: 0000000000000000 R11: 0000000000000000 R12: 0000408018aff000 R13: 0000000000080000 R14: 000000000000001d R15: ffffc900018573d8 FS: 00007fc540c66700(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc9dcd67200 CR3: 0000000059411000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: virt_to_head_page include/linux/mm.h:841 [inline] virt_to_cache mm/slab.h:474 [inline] kfree+0x77/0x2c0 mm/slab.c:3749 hash_net_create+0xbb2/0xd70 net/netfilter/ipset/ip_set_hash_gen.h:1536 ip_set_create+0x6a2/0x13c0 net/netfilter/ipset/ip_set_core.c:1128 nfnetlink_rcv_msg+0xbe8/0xea0 net/netfilter/nfnetlink.c:230 netlink_rcv_skb+0x15a/0x430 net/netlink/af_netlink.c:2469 nfnetlink_rcv+0x1ac/0x420 net/netfilter/nfnetlink.c:564 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2352 ___sys_sendmsg+0xf3/0x170 net/socket.c:2406 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2439 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45cb19 Code: Bad RIP value. RSP: 002b:00007fc540c65c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004fed80 RCX: 000000000045cb19 RDX: 0000000000000000 RSI: 0000000020001080 RDI: 0000000000000003 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000095e R14: 00000000004cc295 R15: 00007fc540c666d4 Fixes: f66ee0410b1c ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports") Fixes: 03c8b234e61a ("netfilter: ipset: Generalize extensions support") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: Pablo Neira Ayuso commit 341404415e76501543b4255506d4d9da09493c3a Author: Fabio Estevam Date: Tue Jun 30 09:25:27 2020 -0300 dt-bindings: thermal: k3: Fix the reg property Adjust the reg property to fix the following warning seen with 'make dt_binding_check': Documentation/devicetree/bindings/thermal/ti,am654-thermal.example.dt.yaml: example-0: thermal@42050000:reg:0: [0, 1107623936, 0, 604] is too long Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200630122527.28640-1-festevam@gmail.com Signed-off-by: Rob Herring commit 34b9610609baf07048b127a9bdd33829ff0edd4b Author: Fabio Estevam Date: Tue Jun 30 09:18:04 2020 -0300 dt-bindings: thermal: Remove soc unit address Remove the soc unit address to fix the following warnings seen with 'make dt_binding_check': Documentation/devicetree/bindings/thermal/thermal-sensor.example.dts:22.20-49.11: Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/thermal/thermal-zones.example.dts:23.20-50.11: Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name, but no reg or ranges property Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200630121804.27887-1-festevam@gmail.com [robh: also fix thermal-zones.yaml example] Signed-off-by: Rob Herring commit 0b3f3ad3fe19dc56ec6689032cbf76d033f3e37d Author: Fabio Estevam Date: Mon Jun 29 18:55:00 2020 -0300 dt-bindings: display: arm: versatile: Pass the sysreg unit name Pass the sysreg unit name to fix the following warning seen with 'make dt_binding_check': Warning (unit_address_vs_reg): /example-0/sysreg: node has a reg or ranges property, but no unit name Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200629215500.18037-1-festevam@gmail.com Signed-off-by: Rob Herring commit dd075b664c491d7dd86c4587d11c56bd98bb28be Author: Fabio Estevam Date: Mon Jun 29 18:40:27 2020 -0300 dt-bindings: usb: aspeed: Remove the leading zeroes Remove the leading zeroes to fix the following warning seen with 'make dt_binding_check': Documentation/devicetree/bindings/usb/aspeed,usb-vhub.example.dts:37.33-42.23: Warning (unit_address_format): /example-0/usb-vhub@1e6a0000/vhub-strings/string@0409: unit name should not have leading 0s Reviewed-by: Tao Ren Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200629214027.16768-1-festevam@gmail.com Signed-off-by: Rob Herring commit dee9c0b57594834fdd65dc476ea2890592bcf35c Author: Masahiro Yamada Date: Fri Jun 26 02:04:33 2020 +0900 dt-bindings: copy process-schema-examples.yaml to process-schema.yaml There are two processed schema files: - processed-schema-examples.yaml Used for 'make dt_binding_check'. This is always a full schema. - processed-schema.yaml Used for 'make dtbs_check'. This may be a full schema, or a smaller subset if DT_SCHEMA_FILES is given by a user. If DT_SCHEMA_FILES is not specified, they are the same. You can copy the former to the latter instead of running dt-mk-schema twice. This saves the cpu time a lot when you do 'make dt_binding_check dtbs_check' because building the full schema takes a couple of seconds. If DT_SCHEMA_FILES is specified, processed-schema.yaml is generated based on the specified yaml files. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200625170434.635114-4-masahiroy@kernel.org Signed-off-by: Rob Herring commit ce810eeb6540f1210fc78eb430d447b5b93337ab Author: Masahiro Yamada Date: Fri Jun 26 02:04:32 2020 +0900 dt-bindings: do not build processed-schema.yaml for 'make dt_binding_check' Currently, processed-schema.yaml is always built, but it is actually used only for 'make dtbs_check'. 'make dt_binding_check' uses processed-schema-example.yaml instead. Build processed-schema.yaml only for 'make dtbs_check'. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200625170434.635114-3-masahiroy@kernel.org Signed-off-by: Rob Herring commit fa714cf58c7c09a454ff9fda2ee8318591128eb6 Author: Masahiro Yamada Date: Fri Jun 26 02:04:31 2020 +0900 dt-bindings: fix error in 'make clean' after 'make dt_binding_check' We are having more and more schema files. Commit 8b6b80218b01 ("dt-bindings: Fix command line length limit calling dt-mk-schema") fixed the 'Argument list too long' error of the schema checks, but the same error happens while cleaning too. 'make clean' after 'make dt_binding_check' fails as follows: $ make dt_binding_check [ snip ] $ make clean make[2]: execvp: /bin/sh: Argument list too long make[2]: *** [scripts/Makefile.clean:52: __clean] Error 127 make[1]: *** [scripts/Makefile.clean:66: Documentation/devicetree/bindings] Error 2 make: *** [Makefile:1763: _clean_Documentation] Error 2 'make dt_binding_check' generates so many .example.dts, .dt.yaml files, which are passed to the 'rm' command when you run 'make clean'. I added a small hack to use the 'find' command to clean up most of the build artifacts before they are processed by scripts/Makefile.clean Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200625170434.635114-2-masahiroy@kernel.org Signed-off-by: Rob Herring commit 35b9c0fdb9f666628ecda02b1fc44306933a2d97 Author: Kangmin Park Date: Thu Jun 25 22:51:58 2020 +0900 dt-bindings: mailbox: zynqmp_ipi: fix unit address Fix unit address to match the first address specified in the reg property of the node in example. Signed-off-by: Kangmin Park Link: https://lore.kernel.org/r/20200625135158.5861-1-l4stpr0gr4m@gmail.com Signed-off-by: Rob Herring commit 0fb24d1e5a6cf3b7ca0df325fbfb10895df41bec Author: Masahiro Yamada Date: Tue Jun 23 20:32:42 2020 +0900 dt-bindings: bus: uniphier-system-bus: fix warning in example Since commit e69f5dc623f9 ("dt-bindings: serial: Convert 8250 to json-schema"), the schema for "ns16550a" is checked. 'make dt_binding_check' emits the following warning: uart@5,00200000: $nodename:0: 'uart@5,00200000' does not match '^serial(@[0-9a-f,]+)*$' Rename the node to follow the pattern defined in Documentation/devicetree/bindings/serial/serial.yaml While I was here, I removed leading zeros from unit names. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200623113242.779241-1-yamada.masahiro@socionext.com Signed-off-by: Rob Herring commit 3eb619b2f7d8a98a86a48de8dfa613a205c0eaab Author: Rob Herring Date: Mon Jun 29 12:15:13 2020 -0600 scripts/dtc: Update to upstream version v1.6.0-11-g9d7888cbf19c Sync with upstream dtc primarily to pickup the I2C bus check fixes. The interrupt_provider check is noisy, so turn it off for now. This adds the following commits from upstream: 9d7888cbf19c dtc: Consider one-character strings as strings 8259d59f59de checks: Improve i2c reg property checking fdabcf2980a4 checks: Remove warning for I2C_OWN_SLAVE_ADDRESS 2478b1652c8d libfdt: add extern "C" for C++ f68bfc2668b2 libfdt: trivial typo fix 7be250b4d059 libfdt: Correct condition for reordering blocks 81e0919a3e21 checks: Add interrupt provider test 85e5d839847a Makefile: when building libfdt only, do not add unneeded deps b28464a550c5 Fix some potential unaligned accesses in dtc Signed-off-by: Rob Herring commit 517bbe1994a3cee29a35c730662277bb5daff582 Author: Andrii Nakryiko Date: Mon Jun 29 23:15:00 2020 -0700 bpf: Enforce BPF ringbuf size to be the power of 2 BPF ringbuf assumes the size to be a multiple of page size and the power of 2 value. The latter is important to avoid division while calculating position inside the ring buffer and using (N-1) mask instead. This patch fixes omission to enforce power-of-2 size rule. Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200630061500.1804799-1-andriin@fb.com commit 7e0245753f1794f17de472dcf4694fa5ed527384 Author: Christoph Hellwig Date: Mon Jun 29 15:03:59 2020 +0200 xsk: Use dma_need_sync instead of reimplenting it Use the dma_need_sync helper instead of (not always entirely correctly) poking into the dma-mapping internals. Signed-off-by: Christoph Hellwig Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200629130359.2690853-5-hch@lst.de commit 53937ff7bc776aac647d0b3004d7cd21861b0f78 Author: Christoph Hellwig Date: Mon Jun 29 15:03:58 2020 +0200 xsk: Remove a double pool->dev assignment in xp_dma_map ->dev is already assigned at the top of the function, remove the duplicate one at the end. Signed-off-by: Christoph Hellwig Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200629130359.2690853-4-hch@lst.de commit 91d5b70273267bbae6f5d1fb4cf3510bd31ef9ff Author: Christoph Hellwig Date: Mon Jun 29 15:03:57 2020 +0200 xsk: Replace the cheap_dma flag with a dma_need_sync flag Invert the polarity and better name the flag so that the use case is properly documented. Signed-off-by: Christoph Hellwig Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200629130359.2690853-3-hch@lst.de commit 3aa91625007807bfca4155df1867a5c924a08662 Author: Christoph Hellwig Date: Mon Jun 29 15:03:56 2020 +0200 dma-mapping: Add a new dma_need_sync API Add a new API to check if calls to dma_sync_single_for_{device,cpu} are required for a given DMA streaming mapping. Signed-off-by: Christoph Hellwig Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200629130359.2690853-2-hch@lst.de commit e7fc23838ebbdbb227c8d45fe02904d0d67a0540 Author: Joerg Roedel Date: Tue Jun 30 14:46:11 2020 +0200 iommu/amd: Make amd_iommu_apply_ivrs_quirks() static inline At least the version in the header file to fix a compile warning about the function being unused. Reported-by: Borislav Petkov Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200630124611.23153-1-joro@8bytes.org commit 009bce1df0bb5eb970b9eb98d963861f7fe353c7 Author: Sean Christopherson Date: Fri Jun 5 12:26:05 2020 -0700 x86/split_lock: Don't write MSR_TEST_CTRL on CPUs that aren't whitelisted Choo! Choo! All aboard the Split Lock Express, with direct service to Wreckage! Skip split_lock_verify_msr() if the CPU isn't whitelisted as a possible SLD-enabled CPU model to avoid writing MSR_TEST_CTRL. MSR_TEST_CTRL exists, and is writable, on many generations of CPUs. Writing the MSR, even with '0', can result in bizarre, undocumented behavior. This fixes a crash on Haswell when resuming from suspend with a live KVM guest. Because APs use the standard SMP boot flow for resume, they will go through split_lock_init() and the subsequent RDMSR/WRMSR sequence, which runs even when sld_state==sld_off to ensure SLD is disabled. On Haswell (at least, my Haswell), writing MSR_TEST_CTRL with '0' will succeed and _may_ take the SMT _sibling_ out of VMX root mode. When KVM has an active guest, KVM performs VMXON as part of CPU onlining (see kvm_starting_cpu()). Because SMP boot is serialized, the resulting flow is effectively: on_each_ap_cpu() { WRMSR(MSR_TEST_CTRL, 0) VMXON } As a result, the WRMSR can disable VMX on a different CPU that has already done VMXON. This ultimately results in a #UD on VMPTRLD when KVM regains control and attempt run its vCPUs. The above voodoo was confirmed by reworking KVM's VMXON flow to write MSR_TEST_CTRL prior to VMXON, and to serialize the sequence as above. Further verification of the insanity was done by redoing VMXON on all APs after the initial WRMSR->VMXON sequence. The additional VMXON, which should VM-Fail, occasionally succeeded, and also eliminated the unexpected #UD on VMPTRLD. The damage done by writing MSR_TEST_CTRL doesn't appear to be limited to VMX, e.g. after suspend with an active KVM guest, subsequent reboots almost always hang (even when fudging VMXON), a #UD on a random Jcc was observed, suspend/resume stability is qualitatively poor, and so on and so forth. kernel BUG at arch/x86/kvm/x86.c:386! CPU: 1 PID: 2592 Comm: CPU 6/KVM Tainted: G D Hardware name: ASUS Q87M-E/Q87M-E, BIOS 1102 03/03/2014 RIP: 0010:kvm_spurious_fault+0xf/0x20 Call Trace: vmx_vcpu_load_vmcs+0x1fb/0x2b0 vmx_vcpu_load+0x3e/0x160 kvm_arch_vcpu_load+0x48/0x260 finish_task_switch+0x140/0x260 __schedule+0x460/0x720 _cond_resched+0x2d/0x40 kvm_arch_vcpu_ioctl_run+0x82e/0x1ca0 kvm_vcpu_ioctl+0x363/0x5c0 ksys_ioctl+0x88/0xa0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x4c/0x170 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: dbaba47085b0c ("x86/split_lock: Rework the initialization flow of split lock detection") Signed-off-by: Sean Christopherson Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200605192605.7439-1-sean.j.christopherson@intel.com commit 5ecad245de2ae23dc4e2dbece92f8ccfbaed2fa7 Author: Paolo Bonzini Date: Tue Jun 30 07:07:20 2020 -0400 KVM: x86: bit 8 of non-leaf PDPEs is not reserved Bit 8 would be the "global" bit, which does not quite make sense for non-leaf page table entries. Intel ignores it; AMD ignores it in PDEs and PDPEs, but reserves it in PML4Es. Probably, earlier versions of the AMD manual documented it as reserved in PDPEs as well, and that behavior made it into KVM as well as kvm-unit-tests; fix it. Cc: stable@vger.kernel.org Reported-by: Nadav Amit Fixes: a0c0feb57992 ("KVM: x86: reserve bit 8 of non-leaf PDPEs and PML4Es in 64-bit mode on AMD", 2014-09-03) Signed-off-by: Paolo Bonzini commit 34244d711dea568f4a42c5b0d6b3d620f8cb6971 Author: Andreas Gruenbacher Date: Wed Jun 10 18:31:56 2020 +0200 gfs2: Don't sleep during glock hash walk In flush_delete_work, instead of flushing each individual pending delayed work item, cancel and re-queue them for immediate execution. The waiting isn't needed here because we're already waiting for all queued work items to complete in gfs2_flush_delete_work. This makes the code more efficient, but more importantly, it avoids sleeping during a rhashtable walk, inside rcu_read_lock(). Signed-off-by: Andreas Gruenbacher commit 58e08e8d83ab03a1ca25d53420bd0b87f2dfe458 Author: Bob Peterson Date: Tue Jun 9 09:55:11 2020 -0400 gfs2: fix trans slab error when withdraw occurs inside log_flush Log flush operations (gfs2_log_flush()) can target a specific transaction. But if the function encounters errors (e.g. io errors) and withdraws, the transaction was only freed it if was queued to one of the ail lists. If the withdraw occurred before the transaction was queued to the ail1 list, function ail_drain never freed it. The result was: BUG gfs2_trans: Objects remaining in gfs2_trans on __kmem_cache_shutdown() This patch makes log_flush() add the targeted transaction to the ail1 list so that function ail_drain() will find and free it properly. Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 5902f4dd6e666c4d160b2f5c4505f7e58642d2bf Author: Andreas Gruenbacher Date: Tue Jun 9 14:33:11 2020 +0200 gfs2: Don't return NULL from gfs2_inode_lookup Callers expect gfs2_inode_lookup to return an inode pointer or ERR_PTR(error). Commit b66648ad6dcf caused it to return NULL instead of ERR_PTR(-ESTALE) in some cases. Fix that. Reported-by: Dan Carpenter Fixes: b66648ad6dcf ("gfs2: Move inode generation number check into gfs2_inode_lookup") Signed-off-by: Andreas Gruenbacher commit c7451e495b2abfc35b2bb4347c8d0aaa7699df26 Author: Geert Uytterhoeven Date: Mon Jun 29 14:11:46 2020 +0200 iommu: SUN50I_IOMMU should depend on HAS_DMA If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config): drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap': dma-iommu.c:(.text+0x92e): undefined reference to `dma_pgprot' IOMMU_DMA must not be selected, unless HAS_DMA=y. Hence fix this by making SUN50I_IOMMU depend on HAS_DMA. Fixes: 4100b8c229b32835 ("iommu: Add Allwinner H6 IOMMU driver") Signed-off-by: Geert Uytterhoeven Acked-by: Maxime Ripard Link: https://lore.kernel.org/r/20200629121146.24011-1-geert@linux-m68k.org Signed-off-by: Joerg Roedel commit 98817a84ff1c755c347ac633ff017a623a631fad Merge: 0e698dfa2822 005c34ae4b44 Author: Thomas Gleixner Date: Tue Jun 30 12:07:51 2020 +0200 Merge tag 'irqchip-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zyngier: - Fix atomicity of affinity update in the GIC driver - Don't sleep in atomic when waiting for a GICv4.1 RD to respond - Fix a couple of typos in user-visible messages commit ce0fd3892bfafca7cd352638ba84e8c17658b803 Author: Maxime Ripard Date: Sun Jun 28 20:08:44 2020 +0200 iommu/sun50i: Remove unused variable The pte_dma variable in the unmap callback is set but never used. Remove it. Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") Reported-by: kernel test robot Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20200628180844.79205-2-maxime@cerno.tech Signed-off-by: Joerg Roedel commit bc8784f348836ab8967e6116486c5079c7025999 Author: Maxime Ripard Date: Sun Jun 28 20:08:43 2020 +0200 iommu/sun50i: Change the readl timeout to the atomic variant The flush_all_tlb call back can be called from an atomic context, so using readl_poll_timeout that embeds a udelay doesn't work. Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20200628180844.79205-1-maxime@cerno.tech Signed-off-by: Joerg Roedel commit bda8eaa6dee7525f4dac950810a85a88bf6c2ba0 Author: Chen-Yu Tsai Date: Mon Jun 29 14:00:32 2020 +0800 drm: sun4i: hdmi: Remove extra HPD polling The HPD sense mechanism in Allwinner's old HDMI encoder hardware is more or less an input-only GPIO. Other GPIO-based HPD implementations directly return the current state, instead of polling for a specific state and returning the other if that times out. Remove the I/O polling from sun4i_hdmi_connector_detect() and directly return a known state based on the current reading. This also gets rid of excessive CPU usage by kworker as reported on Stack Exchange [1] and Armbian forums [2]. [1] https://superuser.com/questions/1515001/debian-10-buster-on-cubietruck-with-bug-in-sun4i-drm-hdmi [2] https://forum.armbian.com/topic/14282-headless-systems-and-sun4i_drm_hdmi-a10a20/ Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support") Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20200629060032.24134-1-wens@kernel.org commit 5aee52c44d9170591df65fafa1cd408acc1225ce Author: Tom Rix Date: Sat Jun 27 06:32:42 2020 -0700 scsi: scsi_transport_spi: Fix function pointer check clang static analysis flags several null function pointer problems. drivers/scsi/scsi_transport_spi.c:374:1: warning: Called function pointer is null (null dereference) [core.CallAndMessage] spi_transport_max_attr(offset, "%d\n"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewing the store_spi_store_max macro if (i->f->set_##field) return -EINVAL; should be if (!i->f->set_##field) return -EINVAL; Link: https://lore.kernel.org/r/20200627133242.21618-1-trix@redhat.com Reviewed-by: James Bottomley Signed-off-by: Tom Rix Signed-off-by: Martin K. Petersen commit bf64ff4c2aac65d680dc639a511c781cf6b6ec08 Author: Cong Wang Date: Sat Jun 27 00:12:24 2020 -0700 genetlink: get rid of family->attrbuf genl_family_rcv_msg_attrs_parse() reuses the global family->attrbuf when family->parallel_ops is false. However, family->attrbuf is not protected by any lock on the genl_family_rcv_msg_doit() code path. This leads to several different consequences, one of them is UAF, like the following: genl_family_rcv_msg_doit(): genl_start(): genl_family_rcv_msg_attrs_parse() attrbuf = family->attrbuf __nlmsg_parse(attrbuf); genl_family_rcv_msg_attrs_parse() attrbuf = family->attrbuf __nlmsg_parse(attrbuf); info->attrs = attrs; cb->data = info; netlink_unicast_kernel(): consume_skb() genl_lock_dumpit(): genl_dumpit_info(cb)->attrs Note family->attrbuf is an array of pointers to the skb data, once the skb is freed, any dereference of family->attrbuf will be a UAF. Maybe we could serialize the family->attrbuf with genl_mutex too, but that would make the locking more complicated. Instead, we can just get rid of family->attrbuf and always allocate attrbuf from heap like the family->parallel_ops==true code path. This may add some performance overhead but comparing with taking the global genl_mutex, it still looks better. Fixes: 75cdbdd08900 ("net: ieee802154: have genetlink code to parse the attrs during dumpit") Fixes: 057af7071344 ("net: tipc: have genetlink code to parse the attrs during dumpit") Reported-and-tested-by: syzbot+3039ddf6d7b13daf3787@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+80cad1e3cb4c41cde6ff@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+736bcbcb11b60d0c0792@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+520f8704db2b68091d44@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+c96e4dfb32f8987fdeed@syzkaller.appspotmail.com Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 33c568ba49e2b0ff7c3daead5d9427be797a4c43 Merge: a9b111016235 60a0121f8fa6 Author: David S. Miller Date: Mon Jun 29 16:58:30 2020 -0700 Merge tag 'mac80211-for-net-2020-06-29' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Couple of fixes/small things: * TX control port status check fixed to not assume frame format * mesh control port fixes * error handling/leak fixes when starting AP, with HE attributes * fix broadcast packet handling with encapsulation offload * add new AKM suites * and a small code cleanup ==================== Signed-off-by: David S. Miller commit caef73cf207074a62701c95c317a97b2f8c1e04e Author: Xiaofei Tan Date: Sun Jun 28 08:57:06 2020 +0800 arm/xen: remove the unused macro GRANT_TABLE_PHYSADDR Fix the following sparse warning: arch/arm64/xen/../../arm/xen/enlighten.c:244: warning: macro "GRANT_TABLE_PHYSADDR" is not used [-Wunused-macros] It is an isolated macro, and should be removed when its last user was deleted in the following commit 3cf4095d7446 ("arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table") Signed-off-by: Xiaofei Tan Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini commit 54320dcaa2522db3222c02d68b52cfed32a2e95b Author: Krzysztof Kozlowski Date: Fri Jun 26 10:06:26 2020 +0200 ARM: dts: meson: Align L2 cache-controller nodename with dtschema Fix dtschema validator warnings like: l2-cache-controller@c4200000: $nodename:0: 'l2-cache-controller@c4200000' does not match '^(cache-controller|cpu)(@[0-9a-f,]+)*$' Signed-off-by: Krzysztof Kozlowski Signed-off-by: Kevin Hilman Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200626080626.4080-1-krzk@kernel.org commit b2037dafcf082cd24b88ae9283af628235df36e1 Author: Neil Armstrong Date: Thu Jun 18 15:27:37 2020 +0200 arm64: dts: meson-gxl-s805x: reduce initial Mali450 core frequency When starting at 744MHz, the Mali 450 core crashes on S805X based boards: lima d00c0000.gpu: IRQ ppmmu3 not found lima d00c0000.gpu: IRQ ppmmu4 not found lima d00c0000.gpu: IRQ ppmmu5 not found lima d00c0000.gpu: IRQ ppmmu6 not found lima d00c0000.gpu: IRQ ppmmu7 not found Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.2+ #492 Hardware name: Libre Computer AML-S805X-AC (DT) pstate: 40000005 (nZcv daif -PAN -UAO) pc : lima_gp_init+0x28/0x188 ... Call trace: lima_gp_init+0x28/0x188 lima_device_init+0x334/0x534 lima_pdev_probe+0xa4/0xe4 ... Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Reverting to a safer 666Mhz frequency on the S805X that doesn't use the GP0 PLL makes it more stable. Fixes: fd47716479f5 ("ARM64: dts: add S805X based P241 board") Fixes: 0449b8e371ac ("arm64: dts: meson: add libretech aml-s805x-ac board") Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200618132737.14243-1-narmstrong@baylibre.com commit 95ca6f06dd4827ff63be5154120c7a8511cd9a41 Author: Jerome Brunet Date: Wed Jun 17 14:53:46 2020 +0200 arm64: dts: meson: add missing gxl rng clock The peripheral clock of the RNG is missing for gxl while it is present for gxbb. Fixes: 1b3f6d148692 ("ARM64: dts: meson-gx: add clock CLKID_RNG0 to hwrng node") Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20200617125346.1163527-1-jbrunet@baylibre.com commit d16d0481e6bab5a916450e4ef0e1c958b550880c Author: Christian Hewitt Date: Tue Jun 9 08:13:18 2020 +0000 soc: amlogic: meson-gx-socinfo: Fix S905X3 and S905D3 ID's Correct the SoC revision and package bits/mask values for S905D3/X3 to detect a wider range of observed SoC IDs, and tweak sort order for A311D/S922X. S905X3 05 0000 0101 (SEI610 initial devices) S905X3 10 0001 0000 (ODROID-C4 and recent Android boxes) S905X3 50 0101 0000 (SEI610 later revisions) S905D3 04 0000 0100 (VIM3L devices in kernelci) S905D3 b0 1011 0000 (VIM3L initial production) Fixes commit c9cc9bec36d0 ("soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs") Suggested-by: Neil Armstrong Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20200609081318.28023-1-christianshewitt@gmail.com commit 377ff83083c953dd58c5a030b3c9b5b85d8cc727 Author: Jarkko Sakkinen Date: Tue Jun 23 00:20:22 2020 +0300 selftests: tpm: Use /bin/sh instead of /bin/bash It's better to use /bin/sh instead of /bin/bash in order to run the tests in the BusyBox shell. Fixes: 6ea3dfe1e073 ("selftests: add TPM 2.0 tests") Cc: stable@vger.kernel.org Cc: linux-integrity@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Shuah Khan commit 88a16840f462f96d3a1808aff1d6479f87a02147 Author: Jarkko Sakkinen Date: Tue Jun 23 00:20:21 2020 +0300 selftests: tpm: Use 'test -e' instead of 'test -f' 'test -f' is suitable only for *regular* files. Use 'test -e' instead. Cc: Nikita Sobolev Cc: linux-integrity@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Fixes: 5627f9cffee7 ("Kernel selftests: Add check if TPM devices are supported") Signed-off-by: Jarkko Sakkinen Signed-off-by: Shuah Khan commit 5be206eaac9a68992fc3b06fb5dd5634e323de86 Author: Jarkko Sakkinen Date: Tue Jun 23 00:20:20 2020 +0300 Revert "tpm: selftest: cleanup after unseal with wrong auth/policy test" The reverted commit illegitly uses tpm2-tools. External dependencies are absolutely forbidden from these tests. There is also the problem that clearing is not necessarily wanted behavior if the test/target computer is not used only solely for testing. Fixes: a9920d3bad40 ("tpm: selftest: cleanup after unseal with wrong auth/policy test") Cc: Tadeusz Struk Cc: stable@vger.kernel.org Cc: linux-integrity@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Shuah Khan commit 3f31f7d9b5404a10648abe536c8b408bfb4502e1 Author: Hans de Goede Date: Sun Jun 28 17:52:29 2020 +0200 ASoC: rt5670: Fix dac- and adc- vol-tlv values being off by a factor of 10 The adc_vol_tlv volume-control has a range from -17.625 dB to +30 dB, not -176.25 dB to + 300 dB. This wrong scale is esp. a problem in userspace apps which translate the dB scale to a linear scale. With the logarithmic dB scale being of by a factor of 10 we loose all precision in the lower area of the range when apps translate things to a linear scale. E.g. the 0 dB default, which corresponds with a value of 47 of the 0 - 127 range for the control, would be shown as 0/100 in alsa-mixer. Since the centi-dB values used in the TLV struct cannot represent the 0.375 dB step size used by these controls, change the TLV definition for them to specify a min and max value instead of min + stepsize. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20200628155231.71089-5-hdegoede@redhat.com Signed-off-by: Mark Brown commit 85ca6b17e2bb96b19caac3b02c003d670b66de96 Author: Hans de Goede Date: Sun Jun 28 17:52:28 2020 +0200 ASoC: rt5670: Add new gpio1_is_ext_spk_en quirk and enable it on the Lenovo Miix 2 10 The Lenovo Miix 2 10 has a keyboard dock with extra speakers in the dock. Rather then the ACL5672's GPIO1 pin being used as IRQ to the CPU, it is actually used to enable the amplifier for these speakers (the IRQ to the CPU comes directly from the jack-detect switch). Add a quirk for having an ext speaker-amplifier enable pin on GPIO1 and replace the Lenovo Miix 2 10's dmi_system_id table entry's wrong GPIO_DEV quirk (which needs to be renamed to GPIO1_IS_IRQ) with the new RT5670_GPIO1_IS_EXT_SPK_EN quirk, so that we enable the external speaker-amplifier as necessary. Also update the ident field for the dmi_system_id table entry, the Miix models are not Thinkpads. Fixes: 67e03ff3f32f ("ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk") Signed-off-by: Hans de Goede BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723 Link: https://lore.kernel.org/r/20200628155231.71089-4-hdegoede@redhat.com Signed-off-by: Mark Brown commit 5cacc6f5764e94fa753b2c1f5f7f1f3f74286e82 Author: Hans de Goede Date: Sun Jun 28 17:52:27 2020 +0200 ASoC: rt5670: Correct RT5670_LDO_SEL_MASK The RT5670_PWR_ANLG1 register has 3 bits to select the LDO voltage, so the correct mask is 0x7 not 0x3. Because of this wrong mask we were programming the ldo bits to a setting of binary 001 (0x05 & 0x03) instead of binary 101 when moving to SND_SOC_BIAS_PREPARE. According to the datasheet 001 is a reserved value, so no idea what it did, since the driver was working fine before I guess we got lucky and it does something which is ok. Fixes: 5e8351de740d ("ASoC: add RT5670 CODEC driver") Signed-off-by: Hans de Goede Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200628155231.71089-3-hdegoede@redhat.com Signed-off-by: Mark Brown commit 0ceb8a36d023d4bb4ffca3474a452fb1dfaa0ef2 Author: Hans de Goede Date: Sun Jun 28 17:52:26 2020 +0200 ASoC: Intel: cht_bsw_rt5672: Change bus format to I2S 2 channel The default mode for SSP configuration is TDM 4 slot and so far we were using this for the bus format on cht-bsw-rt56732 boards. One board, the Lenovo Miix 2 10 uses not 1 but 2 codecs connected to SSP2. The second piggy-backed, output-only codec is inside the keyboard-dock (which has extra speakers). Unlike the main rt5672 codec, we cannot configure this codec, it is hard coded to use 2 channel 24 bit I2S. Using 4 channel TDM leads to the dock speakers codec (which listens in on the data send from the SSP to the rt5672 codec) emiting horribly distorted sound. Since we only support 2 channels anyways, there is no need for TDM on any cht-bsw-rt5672 designs. So we can simply use I2S 2ch everywhere. This commit fixes the Lenovo Miix 2 10 dock speakers issue by changing the bus format set in cht_codec_fixup() to I2S 2 channel. This change has been tested on the following devices with a rt5672 codec: Lenovo Miix 2 10 Lenovo Thinkpad 8 Lenovo Thinkpad 10 (gen 1) Signed-off-by: Hans de Goede Cc: stable@vger.kernel.org BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723 Link: https://lore.kernel.org/r/20200628155231.71089-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 3e20aa9630e5bcef4f1b9dcb7b50c5491867fd89 Author: Eric Biggers Date: Tue Jun 16 08:56:54 2020 -0700 block/keyslot-manager: use kvfree_sensitive() Make blk_ksm_destroy() use the kvfree_sensitive() function (which was introduced in v5.8-rc1) instead of open-coding it. Signed-off-by: Eric Biggers Signed-off-by: Jens Axboe commit becd2014923ff259b8155df58199f605dd50cb8f Author: Christophe Leroy Date: Mon Jun 15 06:25:23 2020 +0000 SUNRPC: Add missing definition of ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE Even if that's only a warning, not including asm/cacheflush.h leads to svc_flush_bvec() being empty allthough powerpc defines ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE. CC net/sunrpc/svcsock.o net/sunrpc/svcsock.c:227:5: warning: "ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE" is not defined [-Wundef] #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE ^ Include linux/highmem.h so that asm/cacheflush.h will be included. Reported-by: Christophe Leroy Reported-by: kernel test robot Fixes: ca07eda33e01 ("SUNRPC: Refactor svc_recvfrom()") Signed-off-by: Christophe Leroy Acked-by: Chuck Lever Signed-off-by: J. Bruce Fields commit bf2654017e0268cc83dc88d56f0e67ff4406631d Author: J. Bruce Fields Date: Tue Jun 23 21:01:19 2020 -0400 nfsd: fix nfsdfs inode reference count leak I don't understand this code well, but I'm seeing a warning about a still-referenced inode on unmount, and every other similar filesystem does a dput() here. Fixes: e8a79fb14f6b ("nfsd: add nfsd/clients directory") Signed-off-by: J. Bruce Fields commit 681370f4b00af0fcc65bbfb9f82de526ab7ceb0a Author: J. Bruce Fields Date: Tue Jun 23 16:00:33 2020 -0400 nfsd4: fix nfsdfs reference count loop We don't drop the reference on the nfsdfs filesystem with mntput(nn->nfsd_mnt) until nfsd_exit_net(), but that won't be called until the nfsd module's unloaded, and we can't unload the module as long as there's a reference on nfsdfs. So this prevents module unloading. Fixes: 2c830dd7209b ("nfsd: persist nfsd filesystem across mounts") Reported-and-Tested-by: Luo Xiaogang Signed-off-by: J. Bruce Fields commit 412847fb47336c58885ac6231a5f34ac7ac862a0 Author: Lukas Bulwahn Date: Sun Jun 28 20:02:29 2020 +0200 MAINTAINERS: remove obsolete entry after file renaming Commit f16861b12fa0 ("regulator: rename da903x to da903x-regulator") missed to adjust the DIALOG SEMICONDUCTOR DRIVERS section in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: drivers/regulator/da903x.c The da903x-regulator.c file is already covered by the pattern drivers/regulator/da9???-regulator.[ch] in the section. So, simply remove the non-matching file entry in MAINTAINERS. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20200628180229.5068-1-lukas.bulwahn@gmail.com Signed-off-by: Mark Brown commit e852c2c251ed9c23ae6e3efebc5ec49adb504207 Author: Alexander Usyskin Date: Mon Jun 29 01:53:59 2020 +0300 mei: bus: don't clean driver pointer It's not needed to set driver to NULL in mei_cl_device_remove() which is bus_type remove() handler as this is done anyway in __device_release_driver(). Actually this is causing an endless loop in driver_detach() on ubuntu patched kernel, while removing (rmmod) the mei_hdcp module. The reason list_empty(&drv->p->klist_devices.k_list) is always not-empty. as the check is always true in __device_release_driver() if (dev->driver != drv) return; The non upstream patch is causing this behavior, titled: 'vfio -- release device lock before userspace requests' Nevertheless the fix is correct also for the upstream. Link: https://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20180912085046.3401-2-apw@canonical.com/ Cc: Cc: Andy Whitcroft Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20200628225359.2185929-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit b037d60a3b1d1227609fd858fa34321f41829911 Author: Michał Mirosław Date: Wed Jun 24 13:35:41 2020 +0200 misc: atmel-ssc: lock with mutex instead of spinlock Uninterruptible context is not needed in the driver and causes lockdep warning because of mutex taken in of_alias_get_id(). Convert the lock to mutex to avoid the issue. Cc: stable@vger.kernel.org Fixes: 099343c64e16 ("ARM: at91: atmel-ssc: add device tree support") Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/50f0d7fa107f318296afb49477c3571e4d6978c5.1592998403.git.mirq-linux@rere.qmqm.pl Signed-off-by: Greg Kroah-Hartman commit 7c30b859a947535f2213277e827d7ac7dcff9c84 Merge: be88fef34f78 cf961fce30f8 Author: Linus Torvalds Date: Mon Jun 29 10:10:16 2020 -0700 Merge tag 'spi-fix-v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A batch of fixes for the Freescale DSPI driver fixing some serious issues with removal of active devices and one resume case, plus a few new PCI IDs for Intel platforms" * tag 'spi-fix-v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: pxa2xx: Add support for Intel Tiger Lake PCH-H spi: spi-fsl-dspi: Initialize completion before possible interrupt spi: spi-fsl-dspi: Fix external abort on interrupt in resume or exit paths spi: spi-fsl-dspi: Fix lockup if device is shutdown during SPI transfer spi: spi-fsl-dspi: Fix lockup if device is removed during SPI transfer commit be88fef34f784a8d612366e7ebb149785de7f928 Merge: 2cfa46dadd20 5f8f06425a0d Author: Linus Torvalds Date: Mon Jun 29 10:08:15 2020 -0700 Merge tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal fixes from Daniel Lezcano: - Fix undefined temperature if negative on the rcar_gen3 (Dien Pham) - Fix wrong frequency converted from power for the cpufreq cooling device (Finley Xiao) - Fix compilation warnings by making functions static in the tsens driver (Amit Kucheria) - Fix return value of sprd_thm_probe for the Spreadtrum driver (Tiezhu Yang) - Fix bank number settings on the Mediatek mt8183 (Michael Kao) - Fix missing of_node_put() at probe time i.MX (Anson Huang) * tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/rcar_gen3: Fix undefined temperature if negative thermal/drivers/cpufreq_cooling: Fix wrong frequency converted from power thermal/drivers/tsens: Fix compilation warnings by making functions static thermal/drivers/sprd: Fix return value of sprd_thm_probe() thermal/drivers/mediatek: Fix bank number settings on mt8183 thermal/drivers: imx: Fix missing of_node_put() at probe time commit 2cfa46dadd203eef88cc70131df7a81ebc34b8ff Merge: b6509f6a8c43 e04ec0de61c1 Author: Linus Torvalds Date: Mon Jun 29 10:06:26 2020 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "This fixes two race conditions, one in padata and one in af_alg" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: padata: upgrade smp_mb__after_atomic to smp_mb in padata_do_serial crypto: af_alg - fix use-after-free in af_alg_accept() due to bh_lock_sock() commit b6aa06de7757667bac88997a8807b143b8436035 Author: Geert Uytterhoeven Date: Mon Jun 29 14:24:43 2020 +0200 ASoC: qcom: Drop HAS_DMA dependency to fix link failure When building on allyesconfig kernel for a NO_DMA=y platform (e.g. Sun-3), CONFIG_SND_SOC_QCOM_COMMON=y, but CONFIG_SND_SOC_QDSP6_AFE=n, leading to a link failure: sound/soc/qcom/common.o: In function `qcom_snd_parse_of': common.c:(.text+0x2e2): undefined reference to `q6afe_is_rx_port' While SND_SOC_QDSP6 depends on HAS_DMA, SND_SOC_MSM8996 and SND_SOC_SDM845 don't, so the following warning is seen: WARNING: unmet direct dependencies detected for SND_SOC_QDSP6 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] && HAS_DMA [=n] Selected by [y]: - SND_SOC_MSM8996 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] - SND_SOC_SDM845 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] && CROS_EC [=y] && I2C [=y] && SOUNDWIRE [=y] Until recently, this warning was harmless (from a compile-testing point-of-view), but the new user of q6afe_is_rx_port() turned this into a hard failure. As the QDSP6 driver itself builds fine if NO_DMA=y, and it depends on QCOM_APR (which in turns depends on ARCH_QCOM || COMPILE_TEST), it is safe to increase compile testing coverage. Hence fix the link failure by dropping the HAS_DMA dependency of SND_SOC_QDSP6. Fixes: a2120089251f1fe2 ("ASoC: qcom: common: set correct directions for dailinks") Fixes: 6b1687bf76ef84cb ("ASoC: qcom: add sdm845 sound card support") Fixes: a6f933f63f2ffdb2 ("ASoC: qcom: apq8096: Add db820c machine driver") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200629122443.21736-1-geert@linux-m68k.org Signed-off-by: Mark Brown commit b6509f6a8c4313c068c69785c001451415969e44 Author: Mel Gorman Date: Mon Jun 29 15:41:45 2020 +0100 Revert "fs: Do not check if there is a fsnotify watcher on pseudo inodes" This reverts commit e9c15badbb7b ("fs: Do not check if there is a fsnotify watcher on pseudo inodes"). The commit intended to eliminate fsnotify-related overhead for pseudo inodes but it is broken in concept. inotify can receive events of pipe files under /proc/X/fd and chromium relies on close and open events for sandboxing. Maxim Levitsky reported the following Chromium starts as a white rectangle, shows few white rectangles that resemble its notifications and then crashes. The stdout output from chromium: [mlevitsk@starship ~]$chromium-freeworld mesa: for the --simplifycfg-sink-common option: may only occur zero or one times! mesa: for the --global-isel-abort option: may only occur zero or one times! [3379:3379:0628/135151.440930:ERROR:browser_switcher_service.cc(238)] XXX Init() ../../sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0072 Received signal 11 SEGV_MAPERR 0000004a9048 Crashes are not universal but even if chromium does not crash, it certainly does not work properly. While filtering just modify and access might be safe, the benefit is not worth the risk hence the revert. Reported-by: Maxim Levitsky Fixes: e9c15badbb7b ("fs: Do not check if there is a fsnotify watcher on pseudo inodes") Signed-off-by: Mel Gorman Signed-off-by: Linus Torvalds commit 9d3c447c72fb2337ca39f245c6ae89f2369de216 Author: Wanpeng Li Date: Mon Jun 29 18:26:31 2020 +0800 KVM: X86: Fix async pf caused null-ptr-deref Syzbot reported that: CPU: 1 PID: 6780 Comm: syz-executor153 Not tainted 5.7.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__apic_accept_irq+0x46/0xb80 Call Trace: kvm_arch_async_page_present+0x7de/0x9e0 kvm_check_async_pf_completion+0x18d/0x400 kvm_arch_vcpu_ioctl_run+0x18bf/0x69f0 kvm_vcpu_ioctl+0x46a/0xe20 ksys_ioctl+0x11a/0x180 __x64_sys_ioctl+0x6f/0xb0 do_syscall_64+0xf6/0x7d0 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The testcase enables APF mechanism in MSR_KVM_ASYNC_PF_EN with ASYNC_PF_INT enabled w/o setting MSR_KVM_ASYNC_PF_INT before, what's worse, interrupt based APF 'page ready' event delivery depends on in kernel lapic, however, we didn't bail out when lapic is not in kernel during guest setting MSR_KVM_ASYNC_PF_EN which causes the null-ptr-deref in host later. This patch fixes it. Reported-by: syzbot+1bf777dfdde86d64b89b@syzkaller.appspotmail.com Fixes: 2635b5c4a0 (KVM: x86: interrupt based APF 'page ready' event delivery) Signed-off-by: Wanpeng Li Message-Id: <1593426391-8231-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 95e61b1b5d6394b53d147c0fcbe2ae70fbe09446 Author: Vasily Gorbik Date: Thu Jun 18 17:17:19 2020 +0200 s390/setup: init jump labels before command line parsing Command line parameters might set static keys. This is true for s390 at least since commit 6471384af2a6 ("mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options"). To avoid the following WARN: static_key_enable_cpuslocked(): static key 'init_on_alloc+0x0/0x40' used before call to jump_label_init() call jump_label_init() just before parse_early_param(). jump_label_init() is safe to call multiple times (x86 does that), doesn't do any memory allocations and hence should be safe to call that early. Fixes: 6471384af2a6 ("mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options") Cc: # 5.3: d6df52e9996d: s390/maccess: add no DAT mode to kernel_write Cc: # 5.3 Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit d6df52e9996dcc2062c3d9c9123288468bb95b52 Author: Vasily Gorbik Date: Wed Jun 24 17:39:14 2020 +0200 s390/maccess: add no DAT mode to kernel_write To be able to patch kernel code before paging is initialized do plain memcpy if DAT is off. This is required to enable early jump label initialization. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 3047766bc6ec9c6bc9ece85b45a41ff401e8d988 Author: Niklas Schnelle Date: Thu Jun 18 17:16:27 2020 +0200 s390/pci: fix enabling a reserved PCI function In usual IPL or hot plug scenarios a zPCI function transitions directly from reserved (invisible to Linux) to configured state or is configured by Linux itself using an SCLP, however it can also first go from reserved to standby and then from standby to configured without Linux initiative. In this scenario we first get a PEC event 0x302 and then 0x301. This may happen for example when the device is deconfigured at another LPAR and made available for this LPAR. It may also happen under z/VM when a device is attached while in some inconsistent state. However when we get the 0x301 the device is already known to zPCI so calling zpci_create() will add it twice resulting in the below BUG. Instead we should only enable the existing device and finally scan it through the PCI subsystem. list_add double add: new=00000000ed5a9008, prev=00000000ed5a9008, next=0000000083502300. kernel BUG at lib/list_debug.c:31! Krnl PSW : 0704c00180000000 0000000082dc2db8 (__list_add_valid+0x70/0xa8) Call Trace: [<0000000082dc2db8>] __list_add_valid+0x70/0xa8 ([<0000000082dc2db4>] __list_add_valid+0x6c/0xa8) [<00000000828ea920>] zpci_create_device+0x60/0x1b0 [<00000000828ef04a>] zpci_event_availability+0x282/0x2f0 [<000000008315f848>] chsc_process_crw+0x2b8/0xa18 [<000000008316735c>] crw_collect_info+0x254/0x348 [<00000000829226ea>] kthread+0x14a/0x168 [<000000008319d5c0>] ret_from_fork+0x24/0x2c Fixes: f606b3ef47c9 ("s390/pci: adapt events for zbus") Reported-by: Alexander Egorenkov Tested-by: Alexander Egorenkov Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit c43e55796dd4d13f4855971a4d7970ce2cd94db4 Author: Angelo Dureghello Date: Wed Jun 17 09:53:41 2020 +0300 m68k: mm: fix node memblock init After pulling 5.7.0 (linux-next merge), mcf5441x mmu boot was hanging silently. memblock_add() seems not appropriate, since using MAX_NUMNODES as node id, while memblock_add_node() sets up memory for node id 0. Signed-off-by: Angelo Dureghello Signed-off-by: Mike Rapoport Signed-off-by: Greg Ungerer commit d63bd8c81d8ab64db506ffde569cc8ff197516e2 Author: Mike Rapoport Date: Wed Jun 17 09:53:40 2020 +0300 m68k: nommu: register start of the memory with memblock The m68k nommu setup code didn't register the beginning of the physical memory with memblock because it was anyway occupied by the kernel. However, commit fa3354e4ea39 ("mm: free_area_init: use maximal zone PFNs rather than zone sizes") changed zones initialization to use memblock.memory to detect the zone extents and this caused inconsistency between zone PFNs and the actual PFNs: BUG: Bad page state in process swapper pfn:20165 page:41fe0ca0 refcount:0 mapcount:1 mapping:00000000 index:0x0 flags: 0x0() raw: 00000000 00000100 00000122 00000000 00000000 00000000 00000000 00000000 page dumped because: nonzero mapcount CPU: 0 PID: 1 Comm: swapper Not tainted 5.8.0-rc1-00001-g3a38f8a60c65-dirty #1 Stack from 404c9ebc: 404c9ebc 4029ab28 4029ab28 40088470 41fe0ca0 40299e21 40299df1 404ba2a4 00020165 00000000 41fd2c10 402c7ba0 41fd2c04 40088504 41fe0ca0 40299e21 00000000 40088a12 41fe0ca0 41fe0ca4 0000020a 00000000 00000001 402ca000 00000000 41fe0ca0 41fd2c10 41fd2c10 00000000 00000000 402b2388 00000001 400a0934 40091056 404c9f44 404c9f44 40088db4 402c7ba0 00000001 41fd2c04 41fe0ca0 41fd2000 41fe0ca0 40089e02 4026ecf4 40089e4e 41fe0ca0 ffffffff Call Trace: [<40088470>] 0x40088470 [<40088504>] 0x40088504 [<40088a12>] 0x40088a12 [<402ca000>] 0x402ca000 [<400a0934>] 0x400a0934 Adjust the memory registration with memblock to include the beginning of the physical memory and make sure that the area occupied by the kernel is marked as reserved. Signed-off-by: Mike Rapoport Signed-off-by: Greg Ungerer commit bfe373f608cf81b7626dfeb904001b0e867c5110 Author: Hou Tao Date: Tue Apr 28 09:54:56 2020 +0800 blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags Else there may be magic numbers in /sys/kernel/debug/block/*/state. Signed-off-by: Hou Tao Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit 1e05daca83bb42cde569f75f3bd7c8828b1ef30f Author: Srinivas Pandruvada Date: Wed Jun 24 11:51:40 2020 -0700 ACPI: DPTF: Add battery participant for TigerLake Add DPTF battery participant ACPI ID for platforms based on the Intel TigerLake SoC. Signed-off-by: Srinivas Pandruvada [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit 77b48bea2fee47c15a835f6725dd8df0bc38375a Author: Joseph Salisbury Date: Fri Jun 26 15:28:17 2020 -0700 Drivers: hv: Change flag to write log level in panic msg to false When the kernel panics, one page of kmsg data may be collected and sent to Hyper-V to aid in diagnosing the failure. The collected kmsg data typically contains 50 to 100 lines, each of which has a log level prefix that isn't very useful from a diagnostic standpoint. So tell kmsg_dump_get_buffer() to not include the log level, enabling more information that *is* useful to fit in the page. Requesting in stable kernels, since many kernels running in production are stable releases. Cc: stable@vger.kernel.org Signed-off-by: Joseph Salisbury Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1593210497-114310-1-git-send-email-joseph.salisbury@microsoft.com Signed-off-by: Wei Liu commit 5f8f06425a0dcdad7bedbb77e67f5c65ab4dacfc Author: Dien Pham Date: Thu Jun 25 20:38:19 2020 +0900 thermal/drivers/rcar_gen3: Fix undefined temperature if negative As description for DIV_ROUND_CLOSEST in file include/linux/kernel.h. "Result is undefined for negative divisors if the dividend variable type is unsigned and for negative dividends if the divisor variable type is unsigned." In current code, the FIXPT_DIV uses DIV_ROUND_CLOSEST but has not checked sign of divisor before using. It makes undefined temperature value in case the value is negative. This patch fixes to satisfy DIV_ROUND_CLOSEST description and fix bug too. Note that the variable name "reg" is not good because it should be the same type as rcar_gen3_thermal_read(). However, it's better to rename the "reg" in a further patch as cleanup. Signed-off-by: Van Do Signed-off-by: Dien Pham [shimoda: minor fixes, add Fixes tag] Fixes: 564e73d283af ("thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Soderlund Tested-by: Niklas Soderlund Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1593085099-2057-1-git-send-email-yoshihiro.shimoda.uh@renesas.com commit 371a3bc79c11b707d7a1b7a2c938dc3cc042fffb Author: Finley Xiao Date: Fri Jun 19 17:08:25 2020 +0800 thermal/drivers/cpufreq_cooling: Fix wrong frequency converted from power The function cpu_power_to_freq is used to find a frequency and set the cooling device to consume at most the power to be converted. For example, if the power to be converted is 80mW, and the em table is as follow. struct em_cap_state table[] = { /* KHz mW */ { 1008000, 36, 0 }, { 1200000, 49, 0 }, { 1296000, 59, 0 }, { 1416000, 72, 0 }, { 1512000, 86, 0 }, }; The target frequency should be 1416000KHz, not 1512000KHz. Fixes: 349d39dc5739 ("thermal: cpu_cooling: merge frequency and power tables") Cc: # v4.13+ Signed-off-by: Finley Xiao Acked-by: Viresh Kumar Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200619090825.32747-1-finley.xiao@rock-chips.com commit 3ecc82926be729cb107a287cb6b1f07a2adb44bb Author: Amit Kucheria Date: Wed May 27 16:38:46 2020 +0530 thermal/drivers/tsens: Fix compilation warnings by making functions static After merging tsens-common.c into tsens.c, we can now mark some functions static so they don't need any prototype declarations. This fixes the following issue reported by lkp. >> drivers/thermal/qcom/tsens.c:385:13: warning: no previous prototype for 'tsens_critical_irq_thread' [-Wmissing-prototypes] 385 | irqreturn_t tsens_critical_irq_thread(int irq, void *data) | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/thermal/qcom/tsens.c:455:13: warning: no previous prototype for 'tsens_irq_thread' [-Wmissing-prototypes] 455 | irqreturn_t tsens_irq_thread(int irq, void *data) | ^~~~~~~~~~~~~~~~ >> drivers/thermal/qcom/tsens.c:523:5: warning: no previous prototype for 'tsens_set_trips' [-Wmissing-prototypes] 523 | int tsens_set_trips(void *_sensor, int low, int high) | ^~~~~~~~~~~~~~~ >> drivers/thermal/qcom/tsens.c:560:5: warning: no previous prototype for 'tsens_enable_irq' [-Wmissing-prototypes] 560 | int tsens_enable_irq(struct tsens_priv *priv) | ^~~~~~~~~~~~~~~~ >> drivers/thermal/qcom/tsens.c:573:6: warning: no previous prototype for 'tsens_disable_irq' [-Wmissing-prototypes] 573 | void tsens_disable_irq(struct tsens_priv *priv) | ^~~~~~~~~~~~~~~~~ Signed-off-by: Amit Kucheria Reported-by: kbuild test robot Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/6757a26876b29922929abf64b1c11fa3b3033d03.1590579709.git.amit.kucheria@linaro.org commit b4147917ad4ff2c755e01a7ca296b14030d2d507 Author: Tiezhu Yang Date: Mon May 25 09:59:01 2020 +0800 thermal/drivers/sprd: Fix return value of sprd_thm_probe() When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Fixes: 554fdbaf19b1 ("thermal: sprd: Add Spreadtrum thermal driver support") Signed-off-by: Tiezhu Yang Reviewed-by: Baolin Wang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1590371941-25430-1-git-send-email-yangtiezhu@loongson.cn commit 14533a5a6c12e8d7de79d309d4085bf186058fe1 Author: Michael Kao Date: Mon Mar 23 20:15:35 2020 +0800 thermal/drivers/mediatek: Fix bank number settings on mt8183 MT8183_NUM_ZONES should be set to 1 because MT8183 doesn't have multiple banks. Fixes: a4ffe6b52d27 ("thermal: mediatek: add support for MT8183") Signed-off-by: Michael Kao Signed-off-by: Hsin-Yi Wang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200323121537.22697-6-michael.kao@mediatek.com commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 Author: Anson Huang Date: Thu Mar 26 22:29:05 2020 +0800 thermal/drivers: imx: Fix missing of_node_put() at probe time After finishing using cpu node got from of_get_cpu_node(), of_node_put() needs to be called. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-email-Anson.Huang@nxp.com commit 55fd7e0222ea01246ef3e6aae28b5721fdfb790f Author: Rodrigo Vivi Date: Wed Jun 10 13:18:07 2020 -0700 drm/i915: Include asm sources for {ivb, hsw}_clear_kernel.c Alexandre Oliva has recently removed these files from Linux Libre with concerns that the sources weren't available. The sources are available on IGT repository, and only open source tools are used to generate the {ivb,hsw}_clear_kernel.c files. However, the remaining concern from Alexandre Oliva was around GPL license and the source not been present when distributing the code. So, it looks like 2 alternatives are possible, the use of linux-firmware.git repository to store the blob or making sure that the source is also present in our tree. Since the goal is to limit the i915 firmware to only the micro-controller blobs let's make sure that we do include the asm sources here in our tree. Btw, I tried to have some diligence here and make sure that the asms that these commits are adding are truly the source for the mentioned files: igt$ ./scripts/generate_clear_kernel.sh -g ivb \ -m ~/mesa/build/src/intel/tools/i965_asm Output file not specified - using default file "ivb-cb_assembled" Generating gen7 CB Kernel assembled file "ivb_clear_kernel.c" for i915 driver... igt$ diff ~/i915/drm-tip/drivers/gpu/drm/i915/gt/ivb_clear_kernel.c \ ivb_clear_kernel.c < * Generated by: IGT Gpu Tools on Fri 21 Feb 2020 05:29:32 AM UTC > * Generated by: IGT Gpu Tools on Mon 08 Jun 2020 10:00:54 AM PDT 61c61 < }; > }; \ No newline at end of file igt$ ./scripts/generate_clear_kernel.sh -g hsw \ -m ~/mesa/build/src/intel/tools/i965_asm Output file not specified - using default file "hsw-cb_assembled" Generating gen7.5 CB Kernel assembled file "hsw_clear_kernel.c" for i915 driver... igt$ diff ~/i915/drm-tip/drivers/gpu/drm/i915/gt/hsw_clear_kernel.c \ hsw_clear_kernel.c 5c5 < * Generated by: IGT Gpu Tools on Fri 21 Feb 2020 05:30:13 AM UTC > * Generated by: IGT Gpu Tools on Mon 08 Jun 2020 10:01:42 AM PDT 61c61 < }; > }; \ No newline at end of file Used IGT and Mesa master repositories from Fri Jun 5 2020) IGT: 53e8c878a6fb ("tests/kms_chamelium: Force reprobe after replugging the connector") Mesa: 5d13c7477eb1 ("radv: set keep_statistic_info with RADV_DEBUG=shaderstats") Mesa built with: meson build -D platforms=drm,x11 -D dri-drivers=i965 \ -D gallium-drivers=iris -D prefix=/usr \ -D libdir=/usr/lib64/ -Dtools=intel \ -Dkulkan-drivers=intel && ninja -C build v2: Header clean-up and include build instructions in a readme (Chris) Modified commit message to respect check-patch Reference: http://www.fsfla.org/pipermail/linux-libre/2020-June/003374.html Reference: http://www.fsfla.org/pipermail/linux-libre/2020-June/003375.html Fixes: 47f8253d2b89 ("drm/i915/gen7: Clear all EU/L3 residual contexts") Cc: # v5.7+ Cc: Alexandre Oliva Cc: Prathap Kumar Valsan Cc: Akeem G Abodunrin Cc: Mika Kuoppala Cc: Chris Wilson Cc: Jani Nikula Cc: Joonas Lahtinen Signed-off-by: Rodrigo Vivi Reviewed-by: Jon Bloomfield Link: https://patchwork.freedesktop.org/patch/msgid/20200610201807.191440-1-rodrigo.vivi@intel.com (cherry picked from commit 5a7eeb8ba143d860050ecea924a8f074f02d8023) Signed-off-by: Jani Nikula commit 5267456e953fd8c5abd8e278b1cc6a9f9027ac0a Author: Sungjong Seo Date: Thu Jun 18 20:43:26 2020 +0900 exfat: flush dirty metadata in fsync generic_file_fsync() exfat used could not guarantee the consistency of a file because it has flushed not dirty metadata but only dirty data pages for a file. Instead of that, use exfat_file_fsync() for files and directories so that it guarantees to commit both the metadata and data pages for a file. Signed-off-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 3bcfb701099acf96b0e883bf5544f96af473aa1d Author: Namjae Jeon Date: Wed Jun 17 12:17:18 2020 +0900 exfat: move setting VOL_DIRTY over exfat_remove_entries() Move setting VOL_DIRTY over exfat_remove_entries() to avoid unneeded leaving VOL_DIRTY on -ENOTEMPTY. Fixes: 5f2aa075070c ("exfat: add inode operations") Cc: stable@vger.kernel.org # v5.7 Reported-by: Tetsuhiro Kohada Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit a0271a15cf2cf907ea5b0f2ba611123f1b7935ec Author: Hyunchul Lee Date: Tue Jun 16 14:34:45 2020 +0900 exfat: call sync_filesystem for read-only remount We need to commit dirty metadata and pages to disk before remounting exfat as read-only. This fixes a failure in xfstests generic/452 generic/452 does the following: cp something / mount -o remount,ro the /something is corrupted. because while exfat is remounted as read-only, exfat doesn't have a chance to commit metadata and vfs invalidates page caches in a block device. Signed-off-by: Hyunchul Lee Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon commit e8dd3cda8667118b70d9fe527f61fe22623de04d Author: Dan Carpenter Date: Wed Jun 10 20:22:13 2020 +0300 exfat: add missing brelse() calls on error paths If the second exfat_get_dentry() call fails then we need to release "old_bh" before returning. There is a similar bug in exfat_move_file(). Fixes: 5f2aa075070c ("exfat: add inode operations") Reported-by: Markus Elfring Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon commit 4ba6ccd695f5ed3ae851e59b443b757bbe4557fe Author: Hyeongseok.Kim Date: Tue Jun 9 14:30:44 2020 +0900 exfat: Set the unused characters of FileName field to the value 0000h Some fsck tool complain that padding part of the FileName field is not set to the value 0000h. So let's maintain filesystem cleaner, as exfat's spec. recommendation. Signed-off-by: Hyeongseok.Kim Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit cd65bbb4d8c90079f2f4d114bd0a967718d53476 Merge: 9ebcfadb0610 a291e4fba259 Author: Jani Nikula Date: Mon Jun 29 11:09:53 2020 +0300 Merge tag 'gvt-fixes-2020-06-17' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2020-06-17 - Two missed MMIO handler fixes for SKL/CFL (Colin) - Fix mask register bits check (Colin) - Fix one lockdep error for debugfs entry access (Colin) Signed-off-by: Jani Nikula From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20200617043418.GQ5687@zhen-hp.sh.intel.com commit 71cdec4fab76667dabdbb2ca232b039004ebd40f Author: David Rientjes Date: Sun Jun 21 13:43:02 2020 -0700 dma-mapping: warn when coherent pool is depleted When a DMA coherent pool is depleted, allocation failures may or may not get reported in the kernel log depending on the allocator. The admin does have a workaround, however, by using coherent_pool= on the kernel command line. Provide some guidance on the failure and a recommended minimum size for the pools (double the size). Signed-off-by: David Rientjes Tested-by: Guenter Roeck Signed-off-by: Christoph Hellwig commit 7ad816762f9bf89e940e618ea40c43138b479e10 Author: Petteri Aimonen Date: Tue Jun 16 11:12:57 2020 +0200 x86/fpu: Reset MXCSR to default in kernel_fpu_begin() Previously, kernel floating point code would run with the MXCSR control register value last set by userland code by the thread that was active on the CPU core just before kernel call. This could affect calculation results if rounding mode was changed, or a crash if a FPU/SIMD exception was unmasked. Restore MXCSR to the kernel's default value. [ bp: Carve out from a bigger patch by Petteri, add feature check, add FNINIT call too (amluto). ] Signed-off-by: Petteri Aimonen Signed-off-by: Borislav Petkov Link: https://bugzilla.kernel.org/show_bug.cgi?id=207979 Link: https://lkml.kernel.org/r/20200624114646.28953-2-bp@alien8.de commit 19ab500edb5d6020010caba48ce3b4ce4182ab63 Author: Aneesh Kumar K.V Date: Sat Jun 27 12:31:46 2020 +0530 powerpc/mm/pkeys: Make pkey access check work on execute_only_key Jan reported that LTP mmap03 was getting stuck in a page fault loop after commit c46241a370a6 ("powerpc/pkeys: Check vma before returning key fault error to the user"), as well as a minimised reproducer: #include #include #include #include #include int main(int ac, char **av) { int page_sz = getpagesize(); int fildes; char *addr; fildes = open("tempfile", O_WRONLY | O_CREAT, 0666); write(fildes, &fildes, sizeof(fildes)); close(fildes); fildes = open("tempfile", O_RDONLY); unlink("tempfile"); addr = mmap(0, page_sz, PROT_EXEC, MAP_FILE | MAP_PRIVATE, fildes, 0); printf("%d\n", *addr); return 0; } And noticed that access_pkey_error() in page fault handler now always seem to return false: __do_page_fault access_pkey_error(is_pkey: 1, is_exec: 0, is_write: 0) arch_vma_access_permitted pkey_access_permitted if (!is_pkey_enabled(pkey)) return true return false pkey_access_permitted() should not check if the pkey is available in UAMOR (using is_pkey_enabled()). The kernel needs to do that check only when allocating keys. This also makes sure the execute_only_key which is marked as non-manageable via UAMOR is handled correctly in pkey_access_permitted(), and fixes the bug. Fixes: c46241a370a6 ("powerpc/pkeys: Check vma before returning key fault error to the user") Reported-by: Jan Stancek Signed-off-by: Aneesh Kumar K.V [mpe: Include bug report details etc. in the change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200627070147.297535-1-aneesh.kumar@linux.ibm.com commit a9b1110162357689a34992d5c925852948e5b9fd Author: Eric Dumazet Date: Sat Jun 27 13:31:50 2020 -0700 llc: make sure applications use ARPHRD_ETHER syzbot was to trigger a bug by tricking AF_LLC with non sensible addr->sllc_arphrd It seems clear LLC requires an Ethernet device. Back in commit abf9d537fea2 ("llc: add support for SO_BINDTODEVICE") Octavian Purdila added possibility for application to use a zero value for sllc_arphrd, convert it to ARPHRD_ETHER to not cause regressions on existing applications. BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:199 [inline] BUG: KASAN: use-after-free in list_empty include/linux/list.h:268 [inline] BUG: KASAN: use-after-free in waitqueue_active include/linux/wait.h:126 [inline] BUG: KASAN: use-after-free in wq_has_sleeper include/linux/wait.h:160 [inline] BUG: KASAN: use-after-free in skwq_has_sleeper include/net/sock.h:2092 [inline] BUG: KASAN: use-after-free in sock_def_write_space+0x642/0x670 net/core/sock.c:2813 Read of size 8 at addr ffff88801e0b4078 by task ksoftirqd/3/27 CPU: 3 PID: 27 Comm: ksoftirqd/3 Not tainted 5.5.0-rc1-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 __read_once_size include/linux/compiler.h:199 [inline] list_empty include/linux/list.h:268 [inline] waitqueue_active include/linux/wait.h:126 [inline] wq_has_sleeper include/linux/wait.h:160 [inline] skwq_has_sleeper include/net/sock.h:2092 [inline] sock_def_write_space+0x642/0x670 net/core/sock.c:2813 sock_wfree+0x1e1/0x260 net/core/sock.c:1958 skb_release_head_state+0xeb/0x260 net/core/skbuff.c:652 skb_release_all+0x16/0x60 net/core/skbuff.c:663 __kfree_skb net/core/skbuff.c:679 [inline] consume_skb net/core/skbuff.c:838 [inline] consume_skb+0xfb/0x410 net/core/skbuff.c:832 __dev_kfree_skb_any+0xa4/0xd0 net/core/dev.c:2967 dev_kfree_skb_any include/linux/netdevice.h:3650 [inline] e1000_unmap_and_free_tx_resource.isra.0+0x21b/0x3a0 drivers/net/ethernet/intel/e1000/e1000_main.c:1963 e1000_clean_tx_irq drivers/net/ethernet/intel/e1000/e1000_main.c:3854 [inline] e1000_clean+0x4cc/0x1d10 drivers/net/ethernet/intel/e1000/e1000_main.c:3796 napi_poll net/core/dev.c:6532 [inline] net_rx_action+0x508/0x1120 net/core/dev.c:6600 __do_softirq+0x262/0x98c kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:603 [inline] run_ksoftirqd+0x8e/0x110 kernel/softirq.c:595 smpboot_thread_fn+0x6a3/0xa40 kernel/smpboot.c:165 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 8247: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:521 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3484 sock_alloc_inode+0x1c/0x1d0 net/socket.c:240 alloc_inode+0x68/0x1e0 fs/inode.c:230 new_inode_pseudo+0x19/0xf0 fs/inode.c:919 sock_alloc+0x41/0x270 net/socket.c:560 __sock_create+0xc2/0x730 net/socket.c:1384 sock_create net/socket.c:1471 [inline] __sys_socket+0x103/0x220 net/socket.c:1513 __do_sys_socket net/socket.c:1522 [inline] __se_sys_socket net/socket.c:1520 [inline] __ia32_sys_socket+0x73/0xb0 net/socket.c:1520 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 17: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3694 sock_free_inode+0x20/0x30 net/socket.c:261 i_callback+0x44/0x80 fs/inode.c:219 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2183 [inline] rcu_core+0x570/0x1540 kernel/rcu/tree.c:2408 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2417 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff88801e0b4000 which belongs to the cache sock_inode_cache of size 1152 The buggy address is located 120 bytes inside of 1152-byte region [ffff88801e0b4000, ffff88801e0b4480) The buggy address belongs to the page: page:ffffea0000782d00 refcount:1 mapcount:0 mapping:ffff88807aa59c40 index:0xffff88801e0b4ffd raw: 00fffe0000000200 ffffea00008e6c88 ffffea0000782d48 ffff88807aa59c40 raw: ffff88801e0b4ffd ffff88801e0b4000 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801e0b3f00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88801e0b3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801e0b4000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801e0b4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801e0b4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Fixes: abf9d537fea2 ("llc: add support for SO_BINDTODEVICE") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e8280338c778a3f81477624267c9fa47f931477b Author: Cong Wang Date: Fri Jun 26 11:25:27 2020 -0700 net: explain the lockdep annotations for dev_uc_unsync() The lockdep annotations for dev_uc_unsync() and dev_mc_unsync() are not easy to understand, so add some comments to explain why they are correct. Similar for the rest netif_addr_lock_bh() cases, they don't need nested version. Cc: Taehee Yoo Cc: Dmitry Vyukov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit be74294ffa24f5fbc0d6643842e3e095447e17a2 Author: Cong Wang Date: Fri Jun 26 11:24:22 2020 -0700 net: get rid of lockdep_set_class_and_subclass() lockdep_set_class_and_subclass() is meant to reduce the _nested() annotations by assigning a default subclass. For addr_list_lock, we have to compute the subclass at run-time as the netdevice topology changes after creation. So, we should just get rid of these lockdep_set_class_and_subclass() and stick with our _nested() annotations. Fixes: 845e0ebb4408 ("net: change addr_list_lock back to static key") Suggested-by: Taehee Yoo Cc: Dmitry Vyukov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 7dea927f702df030c02bd0c9e6e320a8315e3efa Author: Vladimir Oltean Date: Sun Jun 28 17:49:35 2020 +0300 lib: packing: add documentation for pbuflen argument Fixes sparse warning: Function parameter or member 'pbuflen' not described in 'packing' Fixes: 554aae35007e ("lib: Add support for generic packing operations") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9b14d1f8a76682124c5e465196685a9833ff526e Author: Horatiu Vultur Date: Sun Jun 28 15:45:16 2020 +0200 bridge: mrp: Fix endian conversion and some other warnings The following sparse warnings are fixed: net/bridge/br_mrp.c:106:18: warning: incorrect type in assignment (different base types) net/bridge/br_mrp.c:106:18: expected unsigned short [usertype] net/bridge/br_mrp.c:106:18: got restricted __be16 [usertype] net/bridge/br_mrp.c:281:23: warning: incorrect type in argument 1 (different modifiers) net/bridge/br_mrp.c:281:23: expected struct list_head *entry net/bridge/br_mrp.c:281:23: got struct list_head [noderef] * net/bridge/br_mrp.c:332:28: warning: incorrect type in argument 1 (different modifiers) net/bridge/br_mrp.c:332:28: expected struct list_head *new net/bridge/br_mrp.c:332:28: got struct list_head [noderef] * net/bridge/br_mrp.c:332:40: warning: incorrect type in argument 2 (different modifiers) net/bridge/br_mrp.c:332:40: expected struct list_head *head net/bridge/br_mrp.c:332:40: got struct list_head [noderef] * net/bridge/br_mrp.c:682:29: warning: incorrect type in argument 1 (different modifiers) net/bridge/br_mrp.c:682:29: expected struct list_head const *head net/bridge/br_mrp.c:682:29: got struct list_head [noderef] * Reported-by: kernel test robot Fixes: 2f1a11ae11d222 ("bridge: mrp: Add MRP interface.") Fixes: 4b8d7d4c599182 ("bridge: mrp: Extend bridge interface") Fixes: 9a9f26e8f7ea30 ("bridge: mrp: Connect MRP API with the switchdev API") Signed-off-by: Horatiu Vultur Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit d4f5a095daf0d25f0b385e1ef26338608433a4c5 Author: Navid Emamdoost Date: Mon Jun 15 00:49:28 2020 -0500 drm/exynos: fix ref count leak in mic_pre_enable in mic_pre_enable, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost Signed-off-by: Inki Dae commit b9c633882de4601015625f9136f248e9abca8a7a Author: Marek Szyprowski Date: Mon Jun 1 17:06:30 2020 +0900 drm/exynos: Properly propagate return value in drm_iommu_attach_device() Propagate the proper error codes from the called functions instead of unconditionally returning 0. Reported-by: kbuild test robot Signed-off-by: Marek Szyprowski Merge conflict so merged it manually. Signed-off-by: Inki Dae commit aee83fbdbfa112c72fef3b91cd38ae93841d1075 Author: Tamseel Shams Date: Thu May 21 19:52:10 2020 +0530 drm/exynos: Remove dev_err() on platform_get_irq() failure platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected by coccinelle. Signed-off-by: Tamseel Shams Signed-off-by: Inki Dae commit 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68 Author: Linus Torvalds Date: Sun Jun 28 15:00:24 2020 -0700 Linux 5.8-rc3 commit f7db192b2d71ea42627a32349d59a5f99f2aafcc Merge: e44b59cd758a d528945d7762 Author: Linus Torvalds Date: Sun Jun 28 14:57:14 2020 -0700 Merge tag 'arm-omap-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM OMAP fixes from Arnd Bergmann: "The OMAP developers are particularly active at hunting down regressions, so this is a separate branch with OMAP specific fixes for v5.8: As Tony explains "The recent display subsystem (DSS) related platform data changes caused display related regressions for suspend and resume. Looks like I only tested suspend and resume before dropping the legacy platform data, and forgot to test it after dropping it. Turns out the main issue was that we no longer have platform code calling pm_runtime_suspend for DSS like we did for the legacy platform data case, and that fix is still being discussed on the dri-devel list and will get merged separately. The DSS related testing exposed a pile other other display related issues that also need fixing though": - Fix ti-sysc optional clock handling and reset status checks for devices that reset automatically in idle like DSS - Ignore ti-sysc clockactivity bit unless separately requested to avoid unexpected performance issues - Init ti-sysc framedonetv_irq to true and disable for am4 - Avoid duplicate DSS reset for legacy mode with dts data - Remove LCD timings for am4 as they cause warnings now that we're using generic panels Other OMAP changes from Tony include: - Fix omap_prm reset deassert as we still have drivers setting the pm_runtime_irq_safe() flag - Flush posted write for ti-sysc enable and disable - Fix droid4 spi related errors with spi flags - Fix am335x USB range and a typo for softreset - Fix dra7 timer nodes for clocks for IPU and DSP - Drop duplicate mailboxes after mismerge for dra7 - Prevent pocketgeagle header line signal from accidentally setting micro-SD write protection signal by removing the default mux - Fix NFSroot flakeyness after resume for duover by switching the smsc911x gpio interrupt to back to level sensitive - Fix regression for omap4 clockevent source after recent system timer changes - Yet another ethernet regression fix for the "rgmii" vs "rgmii-rxid" phy-mode - One patch to convert am3/am4 DT files to use the regular sdhci-omap driver instead of the old hsmmc driver, this was meant for the merge window but got lost in the process" * tag 'arm-omap-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (21 commits) ARM: dts: am5729: beaglebone-ai: fix rgmii phy-mode ARM: dts: Fix omap4 system timer source clocks ARM: dts: Fix duovero smsc interrupt for suspend ARM: dts: am335x-pocketbeagle: Fix mmc0 Write Protect Revert "bus: ti-sysc: Increase max softreset wait" ARM: dts: am437x-epos-evm: remove lcd timings ARM: dts: am437x-gp-evm: remove lcd timings ARM: dts: am437x-sk-evm: remove lcd timings ARM: dts: dra7-evm-common: Fix duplicate mailbox nodes ARM: dts: dra7: Fix timer nodes properly for timer_sys_ck clocks ARM: dts: Fix am33xx.dtsi ti,sysc-mask wrong softreset flag ARM: dts: Fix am33xx.dtsi USB ranges length bus: ti-sysc: Increase max softreset wait ARM: OMAP2+: Fix legacy mode dss_reset bus: ti-sysc: Fix uninitialized framedonetv_irq bus: ti-sysc: Ignore clockactivity unless specified as a quirk bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit ARM: dts: omap4-droid4: Fix spi configuration and increase rate bus: ti-sysc: Flush posted write on enable and disable soc: ti: omap-prm: use atomic iopoll instead of sleeping one ... commit e44b59cd758acdd413512d4597a1fabdadfe3abf Merge: 668f532da480 42d3f7e8da1b Author: Linus Torvalds Date: Sun Jun 28 14:55:18 2020 -0700 Merge tag 'arm-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "Here are a couple of bug fixes, mostly for devicetree files NXP i.MX: - Use correct voltage on some i.MX8M board device trees to avoid hardware damage - Code fixes for a compiler warning and incorrect reference counting, both harmless. - Fix the i.MX8M SoC driver to correctly identify imx8mp - Fix watchdog configuration in imx6ul-kontron device tree. Broadcom: - A small regression fix for the Raspberry-Pi firmware driver - A Kconfig change to use the correct timer driver on Northstar - A DT fix for the Luxul XWC-2000 machine - Two more DT fixes for NSP SoCs STmicroelectronics STI - Revert one broken patch for L2 cache configuration ARM Versatile Express: - Fix a regression by reverting a broken DT cleanup TEE drivers: - MAINTAINERS: change tee mailing list" * tag 'arm-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: Revert "ARM: sti: Implement dummy L2 cache's write_sec" soc: imx8m: fix build warning ARM: imx6: add missing put_device() call in imx6q_suspend_init() ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram() soc: imx8m: Correct i.MX8MP UID fuse offset ARM: dts: imx6ul-kontron: Change WDOG_ANY signal from push-pull to open-drain ARM: dts: imx6ul-kontron: Move watchdog from Kontron i.MX6UL/ULL board to SoM arm64: dts: imx8mm-beacon: Fix voltages on LDO1 and LDO2 arm64: dts: imx8mn-ddr4-evk: correct ldo1/ldo2 voltage range arm64: dts: imx8mm-evk: correct ldo1/ldo2 voltage range ARM: dts: NSP: Correct FA2 mailbox node ARM: bcm2835: Fix integer overflow in rpi_firmware_print_firmware_revision() MAINTAINERS: change tee mailing list ARM: dts: NSP: Disable PL330 by default, add dma-coherent property ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP ARM: dts: BCM5301X: Add missing memory "device_type" for Luxul XWC-2000 arm: dts: vexpress: Move mcc node back into motherboard node commit 668f532da4808688f5162cec6a38875390e1a91d Merge: ae71d4bf0074 f097eb38f713 Author: Linus Torvalds Date: Sun Jun 28 11:59:08 2020 -0700 Merge tag 'timers-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Ingo Molnar: "A single DocBook fix" * tag 'timers-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Fix kerneldoc system_device_crosststamp & al commit ae71d4bf0074a81cc04255c96e3de0a49b1d95fa Merge: bc53f67d247a 16accae3d97f Author: Linus Torvalds Date: Sun Jun 28 11:58:14 2020 -0700 Merge tag 'perf-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Ingo Molnar: "A single Kbuild dependency fix" * tag 'perf-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/rapl: Fix RAPL config variable bug commit bc53f67d247a38d43e081faa7e63690a1279f5c7 Merge: 91a9a90d040e 2a55280a3675 Author: Linus Torvalds Date: Sun Jun 28 11:42:16 2020 -0700 Merge tag 'efi-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI fixes from Ingo Molnar: - Fix build regression on v4.8 and older - Robustness fix for TPM log parsing code - kobject refcount fix for the ESRT parsing code - Two efivarfs fixes to make it behave more like an ordinary file system - Style fixup for zero length arrays - Fix a regression in path separator handling in the initrd loader - Fix a missing prototype warning - Add some kerneldoc headers for newly introduced stub routines - Allow support for SSDT overrides via EFI variables to be disabled - Report CPU mode and MMU state upon entry for 32-bit ARM - Use the correct stack pointer alignment when entering from mixed mode * tag 'efi-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi/libstub: arm: Print CPU boot mode and MMU state at boot efi/libstub: arm: Omit arch specific config table matching array on arm64 efi/x86: Setup stack correctly for efi_pe_entry efi: Make it possible to disable efivar_ssdt entirely efi/libstub: Descriptions for stub helper functions efi/libstub: Fix path separator regression efi/libstub: Fix missing-prototype warning for skip_spaces() efi: Replace zero-length array and use struct_size() helper efivarfs: Don't return -EINTR when rate-limiting reads efivarfs: Update inode modification time for successful writes efi/esrt: Fix reference count leak in esre_create_sysfs_entry. efi/tpm: Verify event log header before parsing efi/x86: Fix build with gcc 4 commit 91a9a90d040e8b9ff63d48ea71468e0f4db764ff Merge: 098c7938217d e21cf43406a1 Author: Linus Torvalds Date: Sun Jun 28 10:37:39 2020 -0700 Merge tag 'sched_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: "The most anticipated fix in this pull request is probably the horrible build fix for the RANDSTRUCT fail that didn't make -rc2. Also included is the cleanup that removes those BUILD_BUG_ON()s and replaces it with ugly unions. Also included is the try_to_wake_up() race fix that was first triggered by Paul's RCU-torture runs, but was independently hit by Dave Chinner's fstest runs as well" * tag 'sched_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/cfs: change initial value of runnable_avg smp, irq_work: Continue smp_call_function*() and irq_work*() integration sched/core: s/WF_ON_RQ/WQ_ON_CPU/ sched/core: Fix ttwu() race sched/core: Fix PI boosting between RT and DEADLINE tasks sched/deadline: Initialize ->dl_boosted sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption sched/core: Fix CONFIG_GCC_PLUGIN_RANDSTRUCT build fail commit 098c7938217dfd5ef61720bb93d08cc836274b55 Merge: c141b30e9960 bb5570ad3b54 Author: Linus Torvalds Date: Sun Jun 28 10:35:01 2020 -0700 Merge tag 'x86_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - AMD Memory bandwidth counter width fix, by Babu Moger. - Use the proper length type in the 32-bit truncate() syscall variant, by Jiri Slaby. - Reinit IA32_FEAT_CTL during wakeup to fix the case where after resume, VMXON would #GP due to VMX not being properly enabled, by Sean Christopherson. - Fix a static checker warning in the resctrl code, by Dan Carpenter. - Add a CR4 pinning mask for bits which cannot change after boot, by Kees Cook. - Align the start of the loop of __clear_user() to 16 bytes, to improve performance on AMD zen1 and zen2 microarchitectures, by Matt Fleming. * tag 'x86_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/asm/64: Align start of __clear_user() loop to 16-bytes x86/cpu: Use pinning mask for CR4 bits needing to be 0 x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get() x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup syscalls: Fix offset type of ksys_ftruncate() x86/resctrl: Fix memory bandwidth counter width for AMD commit c141b30e9960e81455ad9c3658c079051eea7e2d Merge: 7ecb59a56666 b58e733fd774 Author: Linus Torvalds Date: Sun Jun 28 10:29:38 2020 -0700 Merge tag 'rcu_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RCU-vs-KCSAN fixes from Borislav Petkov: "A single commit that uses "arch_" atomic operations to avoid the instrumentation that comes with the non-"arch_" versions. In preparation for that commit, it also has another commit that makes these "arch_" atomic operations available to generic code. Without these commits, KCSAN uses can see pointless errors" * tag 'rcu_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rcu: Fixup noinstr warnings locking/atomics: Provide the arch_atomic_ interface to generic code commit 7ecb59a56666506ebb1197f89ca7d587bd83309e Merge: a358505d8af3 0f1441b44e82 Author: Linus Torvalds Date: Sun Jun 28 10:16:15 2020 -0700 Merge tag 'objtool_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Borislav Petkov: "Three fixes from Peter Zijlstra suppressing KCOV instrumentation in noinstr sections. Peter Zijlstra says: "Address KCOV vs noinstr. There is no function attribute to selectively suppress KCOV instrumentation, instead teach objtool to NOP out the calls in noinstr functions" This cures a bunch of KCOV crashes (as used by syzcaller)" * tag 'objtool_urgent_for_5.8_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Fix noinstr vs KCOV objtool: Provide elf_write_{insn,reloc}() objtool: Clean up elf_write() condition commit a358505d8af3ab43763e1b49549619528783d2bf Merge: 719fdd32921f 2c92d787cc9f Author: Linus Torvalds Date: Sun Jun 28 09:42:47 2020 -0700 Merge tag 'x86_entry_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 entry fixes from Borislav Petkov: "This is the x86/entry urgent pile which has accumulated since the merge window. It is not the smallest but considering the almost complete entry core rewrite, the amount of fixes to follow is somewhat higher than usual, which is to be expected. Peter Zijlstra says: 'These patches address a number of instrumentation issues that were found after the x86/entry overhaul. When combined with rcu/urgent and objtool/urgent, these patches make UBSAN/KASAN/KCSAN happy again. Part of making this all work is bumping the minimum GCC version for KASAN builds to gcc-8.3, the reason for this is that the __no_sanitize_address function attribute is broken in GCC releases before that. No known GCC version has a working __no_sanitize_undefined, however because the only noinstr violation that results from this happens when an UB is found, we treat it like WARN. That is, we allow it to violate the noinstr rules in order to get the warning out'" * tag 'x86_entry_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/entry: Fix #UD vs WARN more x86/entry: Increase entry_stack size to a full page x86/entry: Fixup bad_iret vs noinstr objtool: Don't consider vmlinux a C-file kasan: Fix required compiler version compiler_attributes.h: Support no_sanitize_undefined check with GCC 4 x86/entry, bug: Comment the instrumentation_begin() usage for WARN() x86/entry, ubsan, objtool: Whitelist __ubsan_handle_*() x86/entry, cpumask: Provide non-instrumented variant of cpu_is_offline() compiler_types.h: Add __no_sanitize_{address,undefined} to noinstr kasan: Bump required compiler version x86, kcsan: Add __no_kcsan to noinstr kcsan: Remove __no_kcsan_or_inline x86, kcsan: Remove __no_kcsan_or_inline usage commit 2bdeb3ed547d8822b2566797afa6c2584abdb119 Merge: 7a64135f3229 53792fa45b1b Author: Alexei Starovoitov Date: Sun Jun 28 08:33:28 2020 -0700 Merge branch 'fix-sockmap' John Fastabend says: ==================== Fix a splat introduced by recent changes to avoid skipping ingress policy when kTLS is enabled. The RCU splat was introduced because in the non-TLS case the caller is wrapped in an rcu_read_lock/unlock. But, in the TLS case we have a reference to the psock and the caller did not wrap its call in rcu_read_lock/unlock. To fix extend the RCU section to include the redirect case which was missed. From v1->v2 I changed the location a bit to simplify the code some. See patch 1. But, then Martin asked why it was not needed in the non-TLS case. The answer for patch 1 was, as stated above, because the caller has the rcu read lock. However, there was still a missing case where a BPF user could in-theory line up a set of parameters to hit a case where the code was entered from strparser side from a different context then the initial caller. To hit this user would need a parser program to return value greater than skb->len then an ENOMEM error could happen in the strparser codepath triggering strparser to retry from a workqueue and without rcu_read_lock original caller used. See patch 2 for details. Finally, we don't actually have any selftests for parser returning a value geater than skb->len so add one in patch 3. This is especially needed because at least I don't have any code that uses the parser to return value greater than skb->len. So I wouldn't have caught any errors here in my own testing. Thanks, John v1->v2: simplify code in patch 1 some and add patches 2 and 3. ==================== Signed-off-by: Alexei Starovoitov commit 53792fa45b1b17f78f18bcd0bd167674341297e8 Author: John Fastabend Date: Thu Jun 25 16:13:38 2020 -0700 bpf, sockmap: Add ingres skb tests that utilize merge skbs Add a test to check strparser merging skbs is working. Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/159312681884.18340.4922800172600252370.stgit@john-XPS-13-9370 commit 8025751d4d55a2f32be6bdf825b6a80c299875f5 Author: John Fastabend Date: Thu Jun 25 16:13:18 2020 -0700 bpf, sockmap: RCU dereferenced psock may be used outside RCU block If an ingress verdict program specifies message sizes greater than skb->len and there is an ENOMEM error due to memory pressure we may call the rcv_msg handler outside the strp_data_ready() caller context. This is because on an ENOMEM error the strparser will retry from a workqueue. The caller currently protects the use of psock by calling the strp_data_ready() inside a rcu_read_lock/unlock block. But, in above workqueue error case the psock is accessed outside the read_lock/unlock block of the caller. So instead of using psock directly we must do a look up against the sk again to ensure the psock is available. There is an an ugly piece here where we must handle the case where we paused the strp and removed the psock. On psock removal we first pause the strparser and then remove the psock. If the strparser is paused while an skb is scheduled on the workqueue the skb will be dropped on the flow and kfree_skb() is called. If the workqueue manages to get called before we pause the strparser but runs the rcvmsg callback after the psock is removed we will hit the unlikely case where we run the sockmap rcvmsg handler but do not have a psock. For now we will follow strparser logic and drop the skb on the floor with skb_kfree(). This is ugly because the data is dropped. To date this has not caused problems in practice because either the application controlling the sockmap is coordinating with the datapath so that skbs are "flushed" before removal or we simply wait for the sock to be closed before removing it. This patch fixes the describe RCU bug and dropping the skb doesn't make things worse. Future patches will improve this by allowing the normal case where skbs are not merged to skip the strparser altogether. In practice many (most?) use cases have no need to merge skbs so its both a code complexity hit as seen above and a performance issue. For example, in the Cilium case we always set the strparser up to return sbks 1:1 without any merging and have avoided above issues. Fixes: e91de6afa81c1 ("bpf: Fix running sk_skb program types with ktls") Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/159312679888.18340.15248924071966273998.stgit@john-XPS-13-9370 commit 93dd5f185916b05e931cffae636596f21f98546e Author: John Fastabend Date: Thu Jun 25 16:12:59 2020 -0700 bpf, sockmap: RCU splat with redirect and strparser error or TLS There are two paths to generate the below RCU splat the first and most obvious is the result of the BPF verdict program issuing a redirect on a TLS socket (This is the splat shown below). Unlike the non-TLS case the caller of the *strp_read() hooks does not wrap the call in a rcu_read_lock/unlock. Then if the BPF program issues a redirect action we hit the RCU splat. However, in the non-TLS socket case the splat appears to be relatively rare, because the skmsg caller into the strp_data_ready() is wrapped in a rcu_read_lock/unlock. Shown here, static void sk_psock_strp_data_ready(struct sock *sk) { struct sk_psock *psock; rcu_read_lock(); psock = sk_psock(sk); if (likely(psock)) { if (tls_sw_has_ctx_rx(sk)) { psock->parser.saved_data_ready(sk); } else { write_lock_bh(&sk->sk_callback_lock); strp_data_ready(&psock->parser.strp); write_unlock_bh(&sk->sk_callback_lock); } } rcu_read_unlock(); } If the above was the only way to run the verdict program we would be safe. But, there is a case where the strparser may throw an ENOMEM error while parsing the skb. This is a result of a failed skb_clone, or alloc_skb_for_msg while building a new merged skb when the msg length needed spans multiple skbs. This will in turn put the skb on the strp_wrk workqueue in the strparser code. The skb will later be dequeued and verdict programs run, but now from a different context without the rcu_read_lock()/unlock() critical section in sk_psock_strp_data_ready() shown above. In practice I have not seen this yet, because as far as I know most users of the verdict programs are also only working on single skbs. In this case no merge happens which could trigger the above ENOMEM errors. In addition the system would need to be under memory pressure. For example, we can't hit the above case in selftests because we missed having tests to merge skbs. (Added in later patch) To fix the below splat extend the rcu_read_lock/unnlock block to include the call to sk_psock_tls_verdict_apply(). This will fix both TLS redirect case and non-TLS redirect+error case. Also remove psock from the sk_psock_tls_verdict_apply() function signature its not used there. [ 1095.937597] WARNING: suspicious RCU usage [ 1095.940964] 5.7.0-rc7-02911-g463bac5f1ca79 #1 Tainted: G W [ 1095.944363] ----------------------------- [ 1095.947384] include/linux/skmsg.h:284 suspicious rcu_dereference_check() usage! [ 1095.950866] [ 1095.950866] other info that might help us debug this: [ 1095.950866] [ 1095.957146] [ 1095.957146] rcu_scheduler_active = 2, debug_locks = 1 [ 1095.961482] 1 lock held by test_sockmap/15970: [ 1095.964501] #0: ffff9ea6b25de660 (sk_lock-AF_INET){+.+.}-{0:0}, at: tls_sw_recvmsg+0x13a/0x840 [tls] [ 1095.968568] [ 1095.968568] stack backtrace: [ 1095.975001] CPU: 1 PID: 15970 Comm: test_sockmap Tainted: G W 5.7.0-rc7-02911-g463bac5f1ca79 #1 [ 1095.977883] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 1095.980519] Call Trace: [ 1095.982191] dump_stack+0x8f/0xd0 [ 1095.984040] sk_psock_skb_redirect+0xa6/0xf0 [ 1095.986073] sk_psock_tls_strp_read+0x1d8/0x250 [ 1095.988095] tls_sw_recvmsg+0x714/0x840 [tls] v2: Improve commit message to identify non-TLS redirect plus error case condition as well as more common TLS case. In the process I decided doing the rcu_read_unlock followed by the lock/unlock inside branches was unnecessarily complex. We can just extend the current rcu block and get the same effeective without the shuffling and branching. Thanks Martin! Fixes: e91de6afa81c1 ("bpf: Fix running sk_skb program types with ktls") Reported-by: Jakub Sitnicki Reported-by: kernel test robot Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/159312677907.18340.11064813152758406626.stgit@john-XPS-13-9370 commit e21cf43406a190adfcc4bfe592768066fb3aaa9b Author: Vincent Guittot Date: Wed Jun 24 17:44:22 2020 +0200 sched/cfs: change initial value of runnable_avg Some performance regression on reaim benchmark have been raised with commit 070f5e860ee2 ("sched/fair: Take into account runnable_avg to classify group") The problem comes from the init value of runnable_avg which is initialized with max value. This can be a problem if the newly forked task is finally a short task because the group of CPUs is wrongly set to overloaded and tasks are pulled less agressively. Set initial value of runnable_avg equals to util_avg to reflect that there is no waiting time so far. Fixes: 070f5e860ee2 ("sched/fair: Take into account runnable_avg to classify group") Reported-by: kernel test robot Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200624154422.29166-1-vincent.guittot@linaro.org commit 8c4890d1c3358fb8023d46e1e554c41d54f02878 Author: Peter Zijlstra Date: Mon Jun 22 12:01:25 2020 +0200 smp, irq_work: Continue smp_call_function*() and irq_work*() integration Instead of relying on BUG_ON() to ensure the various data structures line up, use a bunch of horrible unions to make it all automatic. Much of the union magic is to ensure irq_work and smp_call_function do not (yet) see the members of their respective data structures change name. Suggested-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Frederic Weisbecker Link: https://lkml.kernel.org/r/20200622100825.844455025@infradead.org commit 739f70b476cf05c5a424b42a8b5728914345610c Author: Peter Zijlstra Date: Mon Jun 22 12:01:24 2020 +0200 sched/core: s/WF_ON_RQ/WQ_ON_CPU/ Use a better name for this poorly named flag, to avoid confusion... Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Mel Gorman Link: https://lkml.kernel.org/r/20200622100825.785115830@infradead.org commit b6e13e85829f032411b896bd2f0d6cbe4b0a3c4a Author: Peter Zijlstra Date: Mon Jun 22 12:01:23 2020 +0200 sched/core: Fix ttwu() race Paul reported rcutorture occasionally hitting a NULL deref: sched_ttwu_pending() ttwu_do_wakeup() check_preempt_curr() := check_preempt_wakeup() find_matching_se() is_same_group() if (se->cfs_rq == pse->cfs_rq) <-- *BOOM* Debugging showed that this only appears to happen when we take the new code-path from commit: 2ebb17717550 ("sched/core: Offload wakee task activation if it the wakee is descheduling") and only when @cpu == smp_processor_id(). Something which should not be possible, because p->on_cpu can only be true for remote tasks. Similarly, without the new code-path from commit: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") this would've unconditionally hit: smp_cond_load_acquire(&p->on_cpu, !VAL); and if: 'cpu == smp_processor_id() && p->on_cpu' is possible, this would result in an instant live-lock (with IRQs disabled), something that hasn't been reported. The NULL deref can be explained however if the task_cpu(p) load at the beginning of try_to_wake_up() returns an old value, and this old value happens to be smp_processor_id(). Further assume that the p->on_cpu load accurately returns 1, it really is still running, just not here. Then, when we enqueue the task locally, we can crash in exactly the observed manner because p->se.cfs_rq != rq->cfs_rq, because p's cfs_rq is from the wrong CPU, therefore we'll iterate into the non-existant parents and NULL deref. The closest semi-plausible scenario I've managed to contrive is somewhat elaborate (then again, actual reproduction takes many CPU hours of rcutorture, so it can't be anything obvious): X->cpu = 1 rq(1)->curr = X CPU0 CPU1 CPU2 // switch away from X LOCK rq(1)->lock smp_mb__after_spinlock dequeue_task(X) X->on_rq = 9 switch_to(Z) X->on_cpu = 0 UNLOCK rq(1)->lock // migrate X to cpu 0 LOCK rq(1)->lock dequeue_task(X) set_task_cpu(X, 0) X->cpu = 0 UNLOCK rq(1)->lock LOCK rq(0)->lock enqueue_task(X) X->on_rq = 1 UNLOCK rq(0)->lock // switch to X LOCK rq(0)->lock smp_mb__after_spinlock switch_to(X) X->on_cpu = 1 UNLOCK rq(0)->lock // X goes sleep X->state = TASK_UNINTERRUPTIBLE smp_mb(); // wake X ttwu() LOCK X->pi_lock smp_mb__after_spinlock if (p->state) cpu = X->cpu; // =? 1 smp_rmb() // X calls schedule() LOCK rq(0)->lock smp_mb__after_spinlock dequeue_task(X) X->on_rq = 0 if (p->on_rq) smp_rmb(); if (p->on_cpu && ttwu_queue_wakelist(..)) [*] smp_cond_load_acquire(&p->on_cpu, !VAL) cpu = select_task_rq(X, X->wake_cpu, ...) if (X->cpu != cpu) switch_to(Y) X->on_cpu = 0 UNLOCK rq(0)->lock However I'm having trouble convincing myself that's actually possible on x86_64 -- after all, every LOCK implies an smp_mb() there, so if ttwu observes ->state != RUNNING, it must also observe ->cpu != 1. (Most of the previous ttwu() races were found on very large PowerPC) Nevertheless, this fully explains the observed failure case. Fix it by ordering the task_cpu(p) load after the p->on_cpu load, which is easy since nothing actually uses @cpu before this. Fixes: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") Reported-by: Paul E. McKenney Tested-by: Paul E. McKenney Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20200622125649.GC576871@hirez.programming.kicks-ass.net commit 740797ce3a124b7dd22b7fb832d87bc8fba1cf6f Author: Juri Lelli Date: Mon Nov 19 16:32:01 2018 +0100 sched/core: Fix PI boosting between RT and DEADLINE tasks syzbot reported the following warning: WARNING: CPU: 1 PID: 6351 at kernel/sched/deadline.c:628 enqueue_task_dl+0x22da/0x38a0 kernel/sched/deadline.c:1504 At deadline.c:628 we have: 623 static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se) 624 { 625 struct dl_rq *dl_rq = dl_rq_of_se(dl_se); 626 struct rq *rq = rq_of_dl_rq(dl_rq); 627 628 WARN_ON(dl_se->dl_boosted); 629 WARN_ON(dl_time_before(rq_clock(rq), dl_se->deadline)); [...] } Which means that setup_new_dl_entity() has been called on a task currently boosted. This shouldn't happen though, as setup_new_dl_entity() is only called when the 'dynamic' deadline of the new entity is in the past w.r.t. rq_clock and boosted tasks shouldn't verify this condition. Digging through the PI code I noticed that what above might in fact happen if an RT tasks blocks on an rt_mutex hold by a DEADLINE task. In the first branch of boosting conditions we check only if a pi_task 'dynamic' deadline is earlier than mutex holder's and in this case we set mutex holder to be dl_boosted. However, since RT 'dynamic' deadlines are only initialized if such tasks get boosted at some point (or if they become DEADLINE of course), in general RT 'dynamic' deadlines are usually equal to 0 and this verifies the aforementioned condition. Fix it by checking that the potential donor task is actually (even if temporary because in turn boosted) running at DEADLINE priority before using its 'dynamic' deadline value. Fixes: 2d3d891d3344 ("sched/deadline: Add SCHED_DEADLINE inheritance logic") Reported-by: syzbot+119ba87189432ead09b4@syzkaller.appspotmail.com Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Daniel Bristot de Oliveira Tested-by: Daniel Wagner Link: https://lkml.kernel.org/r/20181119153201.GB2119@localhost.localdomain commit ce9bc3b27f2a21a7969b41ffb04df8cf61bd1592 Author: Juri Lelli Date: Wed Jun 17 09:29:19 2020 +0200 sched/deadline: Initialize ->dl_boosted syzbot reported the following warning triggered via SYSC_sched_setattr(): WARNING: CPU: 0 PID: 6973 at kernel/sched/deadline.c:593 setup_new_dl_entity /kernel/sched/deadline.c:594 [inline] WARNING: CPU: 0 PID: 6973 at kernel/sched/deadline.c:593 enqueue_dl_entity /kernel/sched/deadline.c:1370 [inline] WARNING: CPU: 0 PID: 6973 at kernel/sched/deadline.c:593 enqueue_task_dl+0x1c17/0x2ba0 /kernel/sched/deadline.c:1441 This happens because the ->dl_boosted flag is currently not initialized by __dl_clear_params() (unlike the other flags) and setup_new_dl_entity() rightfully complains about it. Initialize dl_boosted to 0. Fixes: 2d3d891d3344 ("sched/deadline: Add SCHED_DEADLINE inheritance logic") Reported-by: syzbot+5ac8bac25f95e8b221e7@syzkaller.appspotmail.com Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Daniel Wagner Link: https://lkml.kernel.org/r/20200617072919.818409-1-juri.lelli@redhat.com commit fd844ba9ae59b51e34e77105d79f8eca780b3bd6 Author: Scott Wood Date: Wed Jun 17 14:17:42 2020 +0200 sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption This function is concerned with the long-term CPU mask, not the transitory mask the task might have while migrate disabled. Before this patch, if a task was migrate-disabled at the time __set_cpus_allowed_ptr() was called, and the new mask happened to be equal to the CPU that the task was running on, then the mask update would be lost. Signed-off-by: Scott Wood Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20200617121742.cpxppyi7twxmpin7@linutronix.de commit 4f311afc2035f7b33d97e69ffaa2e6cd67fca16d Author: Peter Zijlstra Date: Wed Jun 10 12:14:09 2020 +0200 sched/core: Fix CONFIG_GCC_PLUGIN_RANDSTRUCT build fail As a temporary build fix, the proper cleanup needs more work. Reported-by: Guenter Roeck Reported-by: Eric Biggers Suggested-by: Eric Biggers Suggested-by: Kees Cook Fixes: a148866489fb ("sched: Replace rq::wake_list") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 42d3f7e8da1bc55e3109f612c519c945f6587194 Merge: 2596ce4b4ded a72132144643 Author: Arnd Bergmann Date: Sun Jun 28 14:48:19 2020 +0200 Merge tag 'imx-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.8: - Fix LDO1 and LDO2 voltage range for a couple of i.MX8M board device trees. - Fix i.MX8MP UID fuse offset in i.MX8M SoC driver. - Fix watchdog configuration in imx6ul-kontron device tree. - Fix one build warning seen on building soc-imx8m driver with x86_64-randconfig. - Add missing put_device() call for a couple of mach-imx PM functions. * tag 'imx-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx8m: fix build warning ARM: imx6: add missing put_device() call in imx6q_suspend_init() ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram() soc: imx8m: Correct i.MX8MP UID fuse offset ARM: dts: imx6ul-kontron: Change WDOG_ANY signal from push-pull to open-drain ARM: dts: imx6ul-kontron: Move watchdog from Kontron i.MX6UL/ULL board to SoM arm64: dts: imx8mm-beacon: Fix voltages on LDO1 and LDO2 arm64: dts: imx8mn-ddr4-evk: correct ldo1/ldo2 voltage range arm64: dts: imx8mm-evk: correct ldo1/ldo2 voltage range Link: https://lore.kernel.org/r/20200624111725.GA24312@dragon Signed-off-by: Arnd Bergmann commit 2596ce4b4ded685b67fed407aed2bfe6ebcc39cb Merge: 6d89c73ca581 e92bc059e7fa Author: Arnd Bergmann Date: Sun Jun 28 14:48:06 2020 +0200 Merge tag 'arm-soc/for-5.8/drivers-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM/ARM64/MIPS SoCs drivers fixes for 5.8, please pull the following: - Andy provides a fix for the Raspberry Pi firmware driver to print the correct time upon boot. This is a fallout from a converstion to use the ptT format * tag 'arm-soc/for-5.8/drivers-fixes' of https://github.com/Broadcom/stblinux: ARM: bcm2835: Fix integer overflow in rpi_firmware_print_firmware_revision() Link: https://lore.kernel.org/r/20200619202250.19029-2-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 6d89c73ca5813768a2cc66f7420ac0cbddf4f37d Merge: 275087fc3ef5 0386e9ce5877 Author: Arnd Bergmann Date: Sun Jun 28 14:47:40 2020 +0200 Merge tag 'arm-soc/for-5.8/soc-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-based SoCs machine/Kconfig fixes for 5.8, please pull the following: - Matthew adds a missing select to permit the use of the standard ARM SP804 timers on Norsthstar Plus (NSP) * tag 'arm-soc/for-5.8/soc-fixes' of https://github.com/Broadcom/stblinux: ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP Link: https://lore.kernel.org/r/20200619202250.19029-3-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 275087fc3ef5af5d20b5cab1403bd29d12311c6a Merge: 0f77ce26ebcf ac4e106d8934 Author: Arnd Bergmann Date: Sun Jun 28 14:47:24 2020 +0200 Merge tag 'arm-soc/for-5.8/devicetree-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-based SoCs Device Tree fixes for 5.8, please pull the following: - Rafal adds a missing 'device_type' property to the Luxul XWC-2000 required for the memory nodes to be correctly parsed by Linux - Matthew provides two fixes for the NSP SoCs, one to disable the PL330 DMA controller by default since it can be left in reset by the bootloader and the second to correct the flow accelerator mailbox node * tag 'arm-soc/for-5.8/devicetree-fixes' of https://github.com/Broadcom/stblinux: ARM: dts: NSP: Correct FA2 mailbox node ARM: dts: NSP: Disable PL330 by default, add dma-coherent property ARM: dts: BCM5301X: Add missing memory "device_type" for Luxul XWC-2000 Link: https://lore.kernel.org/r/20200619202250.19029-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 0f77ce26ebcf6ea384421d2dd47b924b83649692 Author: Patrice Chotard Date: Thu Jun 18 19:24:56 2020 +0200 Revert "ARM: sti: Implement dummy L2 cache's write_sec" This reverts commit 7b8e0188fa717cd9abc4fb52587445b421835c2a. Initially, STiH410-B2260 was supposed to be secured, that's why l2c_write_sec was stubbed to avoid secure register access from non secure world. But by default, STiH410-B2260 is running in non secure mode, so L2 cache register accesses are authorized, l2c_write_sec stub is not needed. With this patch, L2 cache is configured and performance are enhanced. Link: https://lore.kernel.org/r/20200618172456.29475-1-patrice.chotard@st.com Signed-off-by: Patrice Chotard Cc: Alain Volmat Signed-off-by: Arnd Bergmann commit d528945d7762be94beca4c111bb95dcc9a9f39c0 Merge: 8705ed2f725b a352fe371053 Author: Arnd Bergmann Date: Sun Jun 28 14:45:05 2020 +0200 Merge tag 'omap-for-v5.8/fixes-rc1-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/omap-fixes Few dts fixes for omaps for v5.8 Few fixes for various devices: - Prevent pocketgeagle header line signal from accidentally setting micro-SD write protection signal by removing the default mux - Fix NFSroot flakeyness after resume for duover by switching the smsc911x gpio interrupt to back to level sensitive - Fix regression for omap4 clockevent source after recent system timer changes - Yet another ethernet regression fix for the "rgmii" vs "rgmii-rxid" phy-mode * tag 'omap-for-v5.8/fixes-rc1-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am5729: beaglebone-ai: fix rgmii phy-mode ARM: dts: Fix omap4 system timer source clocks ARM: dts: Fix duovero smsc interrupt for suspend ARM: dts: am335x-pocketbeagle: Fix mmc0 Write Protect Link: https://lore.kernel.org/r/pull-1592499282-121092@atomide.com Signed-off-by: Arnd Bergmann commit 8705ed2f725b4d2bcc1c2474a906c9ade0dfa28f Merge: 5b75f16f13d3 0b4edf111870 Author: Arnd Bergmann Date: Sun Jun 28 14:44:39 2020 +0200 Merge tag 'omap-for-v5.8/dt-missed-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/omap-fixes Missed sdhci patch for am3 and am4 I forgot to send a pull request earlier for converting am3 and am4 to use sdhci-omap driver instead of the old omap_hsmmc driver. There was a display subsystem related suspend and resume regression found recently and looks like I forgot to send a pull request for this patch while debugging the regression. This patch has been tested without the display subsystem, and has been in Linux next for several weeks now, so would be good to have merged for v5.8. * tag 'omap-for-v5.8/dt-missed-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver Link: https://lore.kernel.org/r/pull-1591637467-607254@atomide.com Signed-off-by: Arnd Bergmann commit 4c9f47ce57b807003e83d7cbeee77e3c10a26ac6 Merge: d68ec1644dd5 cf5057e169f4 Author: Arnd Bergmann Date: Sat Jun 27 00:20:55 2020 +0200 Merge tag 'tee-ml-for-v5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes Change the TEE mailing list in MAINTAINERS * tag 'tee-ml-for-v5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee: MAINTAINERS: change tee mailing list Link: https://lore.kernel.org/r/20200616075948.GA2288211@jade Signed-off-by: Arnd Bergmann commit 5b75f16f13d38cd5ad5ac959bf71ead7635611c5 Merge: 48778464bb7d e4a8fc054340 Author: Arnd Bergmann Date: Sat Jun 27 00:17:23 2020 +0200 Merge tag 'omap-for-v5.8/fixes-merge-window-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps for v5.8 The recent display subsystem (DSS) related platform data changes caused display related regressions for suspend and resume. Looks like I only tested suspend and resume before dropping the legacy platform data, and forgot to test it after dropping it. Turns out the main issue was that we no longer have platform code calling pm_runtime_suspend for DSS like we did for the legacy platform data case, and that fix is still being discussed on the dri-devel list and will get merged separately. The DSS related testing exposed a pile other other display related issues that also need fixing though: - Fix ti-sysc optional clock handling and reset status checks for devices that reset automatically in idle like DSS - Ignore ti-sysc clockactivity bit unless separately requested to avoid unexpected performance issues - Init ti-sysc framedonetv_irq to true and disable for am4 - Avoid duplicate DSS reset for legacy mode with dts data - Remove LCD timings for am4 as they cause warnings now that we're using generic panels Then there is a pile of other fixes not related to the DSS: - Fix omap_prm reset deassert as we still have drivers setting the pm_runtime_irq_safe() flag - Flush posted write for ti-sysc enable and disable - Fix droid4 spi related errors with spi flags - Fix am335x USB range and a typo for softreset - Fix dra7 timer nodes for clocks for IPU and DSP - Drop duplicate mailboxes after mismerge for dra7 * tag 'omap-for-v5.8/fixes-merge-window-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: Revert "bus: ti-sysc: Increase max softreset wait" ARM: dts: am437x-epos-evm: remove lcd timings ARM: dts: am437x-gp-evm: remove lcd timings ARM: dts: am437x-sk-evm: remove lcd timings ARM: dts: dra7-evm-common: Fix duplicate mailbox nodes ARM: dts: dra7: Fix timer nodes properly for timer_sys_ck clocks ARM: dts: Fix am33xx.dtsi ti,sysc-mask wrong softreset flag ARM: dts: Fix am33xx.dtsi USB ranges length bus: ti-sysc: Increase max softreset wait ARM: OMAP2+: Fix legacy mode dss_reset bus: ti-sysc: Fix uninitialized framedonetv_irq bus: ti-sysc: Ignore clockactivity unless specified as a quirk bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit ARM: dts: omap4-droid4: Fix spi configuration and increase rate bus: ti-sysc: Flush posted write on enable and disable soc: ti: omap-prm: use atomic iopoll instead of sleeping one Link: https://lore.kernel.org/r/pull-1591889257-410830@atomide.com Signed-off-by: Arnd Bergmann commit 719fdd32921fb7e3208db8832d32ae1c2d68900f Author: David Howells Date: Wed Jun 24 17:00:24 2020 +0100 afs: Fix storage of cell names The cell name stored in the afs_cell struct is a 64-char + NUL buffer - when it needs to be able to handle up to AFS_MAXCELLNAME (256 chars) + NUL. Fix this by changing the array to a pointer and allocating the string. Found using Coverity. Fixes: 989782dcdc91 ("afs: Overhaul cell database management") Reported-by: Colin Ian King Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 758abb5a60244a8fa121259bd0666eb88aee07fe Author: Dov Murik Date: Mon Jun 22 12:43:43 2020 +0000 docs: kbuild: fix ReST formatting Commit cd238effefa2 ("docs: kbuild: convert docs to ReST and rename to *.rst") missed a ReST header and a verbatim file content area. Signed-off-by: Dov Murik Signed-off-by: Masahiro Yamada commit 6975031a31f0c72a20e464c1df4c607d6bb44fb8 Author: Masahiro Yamada Date: Thu Feb 13 21:24:10 2020 +0900 gcc-plugins: fix gcc-plugins directory path in documentation Fix typos "plgins" -> "plugins". Signed-off-by: Masahiro Yamada Acked-by: Kees Cook commit 2ce578ca9444bb44da66b9a494f56e7ec12e6466 Author: Miaohe Lin Date: Sat Jun 27 15:47:51 2020 +0800 net: ipv4: Fix wrong type conversion from hint to rt in ip_route_use_hint() We can't cast sk_buff to rtable by (struct rtable *)hint. Use skb_rtable(). Fixes: 02b24941619f ("ipv4: use dst hint for ipv4 list receive") Signed-off-by: Miaohe Lin Signed-off-by: David S. Miller commit f8e99dde21995d185e2379e34ea2b96acf85702b Merge: 69339d083dfb 45c11a927606 Author: Linus Walleij Date: Sun Jun 28 01:08:21 2020 +0200 Merge tag 'intel-pinctrl-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into fixes intel-pinctrl for v5.8-2 * Fix output pin value handling on Intel Baytrail The following is an automated git shortlog grouped by driver: baytrail: - Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH) commit 916a3b0fc1206f7e7ae8d00a21a3114b1dc67794 Merge: 3cd1c5d582f4 bf1028a41eaf Author: Linus Torvalds Date: Sat Jun 27 15:24:04 2020 -0700 Merge tag '5.8-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Six cifs/smb3 fixes, three of them for stable. Fixes xfstests 451, 313 and 316" * tag '5.8-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: misc: Use array_size() in if-statement controlling expression cifs: update ctime and mtime during truncate cifs/smb3: Fix data inconsistent when punch hole cifs/smb3: Fix data inconsistent when zero file range cifs: Fix double add page to memcg when cifs_readpages cifs: Fix cached_fid refcnt leak in open_shroot commit 3cd1c5d582f42fead949947a6e3c8f51797580c9 Merge: c322f5399fc3 afe89f115e84 Author: Linus Torvalds Date: Sat Jun 27 15:20:03 2020 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Six small fixes, five in drivers and one to correct another minor regression from cc97923a5bcc ("block: move dma drain handling to scsi") where we still need the drain stub to be built in to the kernel for the modular libata, non-modular SAS driver case" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mptscsih: Fix read sense data size scsi: zfcp: Fix panic on ERP timeout for previously dismissed ERP action scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset() scsi: libata: Fix the ata_scsi_dma_need_drain stub scsi: qla2xxx: Keep initiator ports after RSCN scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request commit c322f5399fc36300ae870db8fbcf793e063aaae5 Merge: 8bf9865187f6 ebfa440ce38b Author: Linus Torvalds Date: Sat Jun 27 15:17:21 2020 -0700 Merge tag 'vfio-v5.8-rc3' of git://github.com/awilliam/linux-vfio Pull VFIO fixes from Alex Williamson: - Fix double free of eventfd ctx (Alex Williamson) - Fix duplicate use of capability ID (Alex Williamson) - Fix SR-IOV VF memory enable handling (Alex Williamson) * tag 'vfio-v5.8-rc3' of git://github.com/awilliam/linux-vfio: vfio/pci: Fix SR-IOV VF handling with MMIO blocking vfio/type1: Fix migration info capability ID vfio/pci: Clear error and request eventfd ctx after releasing commit 8bf9865187f6c3130b5c748a3212d591c9d563de Merge: 42afe7d1c6ef 40e05200593a Author: Linus Torvalds Date: Sat Jun 27 15:15:37 2020 -0700 Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "This contains a 5.8 regression fix for the Designware driver, a register bitfield fix for the fsi driver, and a missing sanity check for the I2C core" * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: core: check returned size of emulated smbus block read i2c: fsi: Fix the port number field in status register i2c: designware: Adjust bus speed independently of ACPI commit 42afe7d1c6ef77212250af3459e549d1a944cc8a Merge: 7eb8f53b8afe b65a2d8c8614 Author: Linus Torvalds Date: Sat Jun 27 13:14:15 2020 -0700 Merge tag 'staging-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are a small number of tiny staging driver fixes for 5.8-rc3. Not much here, but there were some reported problems to be fixed: - three wfx driver fixes - rtl8723bs driver fix All of these have been in linux-next with no reported issues" * tag 'staging-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate() staging: wfx: fix coherency of hif_scan() prototype staging: wfx: drop useless loop staging: wfx: fix AC priority commit 7eb8f53b8afe87a7993c9d71d3d01bb97c50bd0a Merge: fc3ebc3c647a ed8fa04243e2 Author: Linus Torvalds Date: Sat Jun 27 13:12:10 2020 -0700 Merge tag 'usb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB fixes for 5.8-rc3 to resolve some reported issues. Nothing major here: - gadget driver fixes - cdns3 driver fixes - xhci fixes - renesas_usbhs driver fixes - some new device support with ids - documentation update All of these have been in linux-next with no reported issues" * tag 'usb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (27 commits) usb: renesas_usbhs: getting residue from callback_result Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk" xhci: Poll for U0 after disabling USB2 LPM xhci: Return if xHCI doesn't support LPM usb: host: xhci-mtk: avoid runtime suspend when removing hcd xhci: Fix enumeration issue when setting max packet size for FS devices. xhci: Fix incorrect EP_STATE_MASK usb: cdns3: ep0: add spinlock for cdns3_check_new_setup usb: cdns3: trace: using correct dir value usb: cdns3: ep0: fix the test mode set incorrectly Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk" usb: gadget: udc: Potential Oops in error handling code usb: phy: tegra: Fix unnecessary check in tegra_usb_phy_probe() usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work usb: cdns3: ep0: add spinlock for cdns3_check_new_setup usb: cdns3: trace: using correct dir value usb: cdns3: ep0: fix the test mode set incorrectly usb: typec: tcpci_rt1711h: avoid screaming irq causing boot hangs USB: ohci-sm501: Add missed iounmap() in remove cdc-acm: Add DISABLE_ECHO quirk for Microchip/SMSC chip ... commit fc3ebc3c647a15940f3371740e14bb0d1ad7fd9e Merge: 42f8f9bc5cb7 70b23b87b2d3 Author: Linus Torvalds Date: Sat Jun 27 13:10:31 2020 -0700 Merge tag 'char-misc-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc fixes from Greg KH: "Some tiny char/misc driver fixes for 5.8-rc3. The "largest" changes are in the mei driver, to resolve some reported problems and add some new device ids. There's also a binder bugfix, an fpga driver build fix, and some assorted habanalabs fixes. All of these, except for the habanalabs fixes, have been in linux-next with no reported issues. The habanalabs driver changes showed up in my tree on Friday, but as they are totally self-contained, all should be good there" * tag 'char-misc-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: habanalabs: increase h/w timer when checking idle habanalabs: Correct handling when failing to enqueue CB habanalabs: increase GAUDI QMAN ARB WDT timeout habanalabs: rename mmu_write() to mmu_asid_va_write() habanalabs: use PI in MMU cache invalidation habanalabs: block scalar load_and_exe on external queue mei: me: add tiger lake point device ids for H platforms. mei: me: disable mei interface on Mehlow server platforms binder: fix null deref of proc->context fpga: zynqmp: fix modular build commit 42f8f9bc5cb7c35ca04a6867cc01c24538d59f7f Merge: f05baa066d0f ee470bb25d0d Author: Linus Torvalds Date: Sat Jun 27 13:08:14 2020 -0700 Merge tag 'edac_urgent_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fix from Borislav Petkov: "A single fix for amd64_edac restoring the reporting of the DRAM scrub rate on family 0x15 CPUs" * tag 'edac_urgent_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/amd64: Read back the scrub rate PCI register on F15h commit f05baa066d0f6a38f0624c28008fb2f53cd00e17 Merge: 4e99b32169e8 8e36baf97b25 Author: Linus Torvalds Date: Sat Jun 27 13:06:22 2020 -0700 Merge tag 'dma-mapping-5.8-4' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - fix dma coherent mmap in nommu (me) - more AMD SEV fallout (David Rientjes, me) - fix alignment in dma_common_*_remap (Eric Auger) * tag 'dma-mapping-5.8-4' of git://git.infradead.org/users/hch/dma-mapping: dma-remap: align the size in dma_common_*_remap() dma-mapping: DMA_COHERENT_POOL should select GENERIC_ALLOCATOR dma-direct: add missing set_memory_decrypted() for coherent mapping dma-direct: check return value when encrypting or decrypting memory dma-direct: re-encrypt memory if dma_direct_alloc_pages() fails dma-direct: always align allocation size in dma_direct_alloc_pages() dma-direct: mark __dma_direct_alloc_pages static dma-direct: re-enable mmap for !CONFIG_MMU commit 4e99b32169e84b4ece5a1d74eb0b7e4ef07866b3 Merge: ab0f2473d374 89a3c9f5b9f0 Author: Linus Torvalds Date: Sat Jun 27 09:35:47 2020 -0700 Merge tag 'nfs-for-5.8-2' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client bugfixes from Anna Schumaker: "Stable Fixes: - xprtrdma: Fix handling of RDMA_ERROR replies - sunrpc: Fix rollback in rpc_gssd_dummy_populate() - pNFS/flexfiles: Fix list corruption if the mirror count changes - NFSv4: Fix CLOSE not waiting for direct IO completion - SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment() Other Fixes: - xprtrdma: Fix a use-after-free with r_xprt->rx_ep - Fix other xprtrdma races during disconnect - NFS: Fix memory leak of export_path" * tag 'nfs-for-5.8-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment() NFSv4 fix CLOSE not waiting for direct IO compeletion pNFS/flexfiles: Fix list corruption if the mirror count changes nfs: Fix memory leak of export_path sunrpc: fixed rollback in rpc_gssd_dummy_populate() xprtrdma: Fix handling of RDMA_ERROR replies xprtrdma: Clean up disconnect xprtrdma: Clean up synopsis of rpcrdma_flush_disconnect() xprtrdma: Use re_connect_status safely in rpcrdma_xprt_connect() xprtrdma: Prevent dereferencing r_xprt->rx_ep after it is freed commit ab0f2473d374f0dc4e3cc3f386abfafd8cf08ed2 Merge: 9b8d02079643 d60b5fbc1ce8 Author: Linus Torvalds Date: Sat Jun 27 09:02:49 2020 -0700 Merge tag 'io_uring-5.8-2020-06-26' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Three small fixes: - Close a corner case for polled IO resubmission (Pavel) - Toss commands when exiting (Pavel) - Fix SQPOLL conditional reschedule on perpetually busy submit (Xuan)" * tag 'io_uring-5.8-2020-06-26' of git://git.kernel.dk/linux-block: io_uring: fix current->mm NULL dereference on exit io_uring: fix hanging iopoll in case of -EAGAIN io_uring: fix io_sq_thread no schedule when busy commit 9b8d02079643b55343b41fb07ce7eb3d25472ce5 Merge: 5e8eed279f28 1b52671d79c4 Author: Linus Torvalds Date: Sat Jun 27 08:59:32 2020 -0700 Merge tag 'block-5.8-2020-06-26' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request from Christoph: - multipath deadlock fixes (Anton) - NUMA fixes (Max) - RDMA completion vector fix (Max) - IO deadlock fix (Sagi) - multipath reference fix (Sagi) - NS mutation fix (Sagi) - Use right allocator when freeing bip in error path (Chengguang) * tag 'block-5.8-2020-06-26' of git://git.kernel.dk/linux-block: nvme-multipath: fix bogus request queue reference put nvme-multipath: fix deadlock due to head->lock nvme: don't protect ns mutation with ns->head->lock nvme-multipath: fix deadlock between ana_work and scan_work nvme: fix possible deadlock when I/O is blocked nvme-rdma: assign completion vector correctly nvme-loop: initialize tagset numa value to the value of the ctrl nvme-tcp: initialize tagset numa value to the value of the ctrl nvme-pci: initialize tagset numa value to the value of the ctrl nvme-pci: override the value of the controller's numa node nvme: set initial value for controller's numa node block: release bip in a right way in error path commit 5e8eed279f280d6ad4cf59b3330d5d6d7b9de733 Merge: 6116dea80dfd d35bd764e689 Author: Linus Torvalds Date: Sat Jun 27 08:57:16 2020 -0700 Merge tag 'for-5.8/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Quite a few DM zoned target fixes and a Zone append fix in DM core. Considering the amount of dm-zoned changes that went in during the 5.8 merge window these fixes are not that surprising. - A few DM writecache target fixes. - A fix to Documentation index to include DM ebs target docs. - Small cleanup to use struct_size() in DM core's retrieve_deps(). * tag 'for-5.8/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm writecache: add cond_resched to loop in persistent_memory_claim() dm zoned: Fix reclaim zone selection dm zoned: Fix random zone reclaim selection dm: update original bio sector on Zone Append dm zoned: Fix metadata zone size check docs: device-mapper: add dm-ebs.rst to an index file dm ioctl: use struct_size() helper in retrieve_deps() dm writecache: skip writecache_wait when using pmem mode dm writecache: correct uncommitted_block when discarding uncommitted entry dm zoned: assign max_io_len correctly dm zoned: fix uninitialized pointer dereference commit 6116dea80dfd5b8d3825bf7f2e44a8bc2730f3d0 Merge: 21d2f6850c09 440ab9e10e2e Author: Linus Torvalds Date: Sat Jun 27 08:53:49 2020 -0700 Merge tag 'kgdb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb fixes from Daniel Thompson: "The main change here is a fix for a number of unsafe interactions between kdb and the console system. The fixes are specific to kdb (pure kgdb debugging does not use the console system at all). On systems with an NMI then kdb, if it is enabled, must get messages to the user despite potentially running from some "difficult" calling contexts. These fixes avoid using the console system where we have been provided an alternative (safer) way to interact with the user and, if using the console system in unavoidable, use oops_in_progress for deadlock avoidance. These fixes also ensure kdb honours the console enable flag. Also included is a fix that wraps kgdb trap handling in an RCU read lock to avoids triggering diagnostic warnings. This is a wide lock scope but this is OK because kgdb is a stop-the-world debugger. When we stop the world we put all the CPUs into holding pens and this inhibits RCU update anyway" * tag 'kgdb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kgdb: Avoid suspicious RCU usage warning kdb: Switch to use safer dbg_io_ops over console APIs kdb: Make kdb_printf() console handling more robust kdb: Check status of console prior to invoking handlers kdb: Re-factor kdb_printf() message write code commit 21d2f6850c09fdec730c11d35406da1dc541432d Merge: 3b6ab1012cbc 896066aa0685 Author: Linus Torvalds Date: Sat Jun 27 08:51:35 2020 -0700 Merge tag 'powerpc-5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - A fix for a crash in nested KVM when CONFIG_DEBUG_VIRTUAL=y. - Two minor build fixes. Thanks to: Aneesh Kumar K.V, Arseny Solokha, Harish. * tag 'powerpc-5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: selftests/powerpc: Fix build failure in ebb tests powerpc/kvm/book3s64: Fix kernel crash with nested kvm & DEBUG_VIRTUAL powerpc/fsl_booke/32: Fix build with CONFIG_RANDOMIZE_BASE commit 3b6ab1012cbcabf31db9c3a0c329d07dbcff4fd7 Merge: 8530684fd37c e05d57dcb8c7 Author: Linus Torvalds Date: Sat Jun 27 08:49:12 2020 -0700 Merge tag 'riscv-for-linus-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: "This contains a handful of fixes I'd like to target for rc3. Most of them fix issues with the conversion of our vDSO to C. There is also one fix to the SiFive PRCI driver that I picked up as it's causing boot issues on the hardware. - A fix to allow kernels with dynamic ftrace to use the vDSO. - Some build fixes for the C vDSO functions. - A fix to the PRCI driver's memory allocation, which was the cause of some boot panics with FREELIST_RANDOM" * tag 'riscv-for-linus-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fixup __vdso_gettimeofday broke dynamic ftrace riscv: Add extern declarations for vDSO time-related functions clk: sifive: allocate sufficient memory for struct __prci_data riscv: Add -fPIC option to CFLAGS_vgettimeofday.o commit 8530684fd37c151bbcf6c101ea3d0d784e221d98 Merge: 1590a2e1c681 108447fd0d1a Author: Linus Torvalds Date: Sat Jun 27 08:47:18 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "The big fix here is to our vDSO sigreturn trampoline as, after a painfully long stint of debugging, it turned out that fixing some of our CFI directives in the merge window lit up a bunch of logic in libgcc which has been shown to SEGV in some cases during asynchronous pthread cancellation. It looks like we can fix this by extending the directives to restore most of the interrupted register state from the sigcontext, but it's risky and hard to test so we opted to remove the CFI directives for now and rely on the unwinder fallback path like we used to. - Fix unwinding through vDSO sigreturn trampoline - Fix build warnings by raising minimum LD version for PAC - Whitelist some Kryo Cortex-A55 derivatives for Meltdown and SSB - Fix perf register PC reporting for compat tasks - Fix 'make clean' warning for arm64 signal selftests - Fix ftrace when BTI is compiled in - Avoid building the compat vDSO using GCC plugins" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add KRYO{3,4}XX silver CPU cores to SSB safelist arm64: perf: Report the PC value in REGS_ABI_32 mode kselftest: arm64: Remove redundant clean target arm64: kpti: Add KRYO{3, 4}XX silver CPU cores to kpti safelist arm64: Don't insert a BTI instruction at inner labels arm64: vdso: Don't use gcc plugins for building vgettimeofday.c arm64: vdso: Only pass --no-eh-frame-hdr when linker supports it arm64: Depend on newer binutils when building PAC arm64: compat: Remove 32-bit sigreturn code from the vDSO arm64: compat: Always use sigpage for sigreturn trampoline arm64: compat: Allow 32-bit vdso and sigpage to co-exist arm64: vdso: Disable dwarf unwinding through the sigreturn trampoline commit 76ed2e105796710cf5b8a4ba43c81eceed948b70 Author: Jan Kiszka Date: Thu Jun 18 10:11:40 2020 +0200 Revert "tty: xilinx_uartps: Fix missing id assignment to the console" This reverts commit 2ae11c46d5fdc46cb396e35911c713d271056d35. It turned out to break the ultra96-rev1, e.g., which uses uart1 as serial0 (and stdout-path = "serial0:115200n8"). Fixes: 2ae11c46d5fd ("tty: xilinx_uartps: Fix missing id assignment to the console") Cc: stable Signed-off-by: Jan Kiszka Reviewed-by: Michal Simek Tested-by: Michal Simek Link: https://lore.kernel.org/r/f4092727-d8f5-5f91-2c9f-76643aace993@siemens.com Signed-off-by: Greg Kroah-Hartman commit 225385657b7d81a99e17e04cd01f9ed5bb3109a8 Author: Johan Hovold Date: Wed Jun 10 17:22:32 2020 +0200 serial: core: drop redundant sysrq checks The sysrq timestamp will never be set unless port->has_sysrq is set (see uart_handle_break()) so drop the redundant checks that were added by commit 1997e9dfdc84 ("serial_core: Un-ifdef sysrq SUPPORT_SYSRQ"). Signed-off-by: Johan Hovold Reviewed-by: Andy Shevchenko Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://lore.kernel.org/r/20200610152232.16925-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 08d5470308ac3598e7709d08b8979ce6e9de8da2 Author: Johan Hovold Date: Wed Jun 10 17:22:31 2020 +0200 serial: core: fix sysrq overhead regression Commit 8e20fc391711 ("serial_core: Move sysrq functions from header file") converted the inline sysrq helpers to exported functions which are now called for every received character, interrupt and break signal also on systems without CONFIG_MAGIC_SYSRQ_SERIAL instead of being optimised away by the compiler. Inlining these helpers again also avoids the function call overhead when CONFIG_MAGIC_SYSRQ_SERIAL is enabled (e.g. when the port is not used as a console). Fixes: 8e20fc391711 ("serial_core: Move sysrq functions from header file") Cc: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Johan Hovold Cc: stable Reviewed-by: Andy Shevchenko Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://lore.kernel.org/r/20200610152232.16925-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 10652a9e9fe3fbcaca090f99cd3060ac3fee2913 Author: Johan Hovold Date: Wed Jun 10 17:22:30 2020 +0200 Revert "serial: core: Refactor uart_unlock_and_check_sysrq()" This reverts commit da9a5aa3402db0ff3b57216d8dbf2478e1046cae. In order to ease backporting a fix for a sysrq regression, revert this rewrite which was since added on top. The other sysrq helpers now bail out early when sysrq is not enabled; it's better to keep that pattern here as well. Note that the __releases() attribute won't be needed after the follow-on fix either. Fixes: da9a5aa3402d ("serial: core: Refactor uart_unlock_and_check_sysrq()") Cc: stable Signed-off-by: Johan Hovold Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200610152232.16925-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit a71725619ff63ccd41d5084094db53efc2286aae Author: Randy Dunlap Date: Mon Jun 15 12:24:36 2020 -0700 tty/serial: fix serial_core.c kernel-doc warnings Fix kernel-doc warnings in serial_core.c: ../drivers/tty/serial/serial_core.c:3300: warning: Function parameter or member 'port' not described in 'uart_get_rs485_mode' ../drivers/tty/serial/serial_core.c:3300: warning: Excess function parameter 'dev' description in 'uart_get_rs485_mode' ../drivers/tty/serial/serial_core.c:3300: warning: Excess function parameter 'rs485conf' description in 'uart_get_rs485_mode' Fixes: c150c0f362c1 ("serial: Allow uart_get_rs485_mode() to return errno") Signed-off-by: Randy Dunlap Cc: Lukas Wunner Cc: Heiko Stuebner Cc: Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org Link: https://lore.kernel.org/r/e170db8e-5c8b-27ac-79a4-81b96ac0ca2d@infradead.org Signed-off-by: Greg Kroah-Hartman commit 311eab8d5900ea9088513d4c6b4570058958edb5 Author: Christophe Leroy Date: Fri Jun 12 18:26:07 2020 +0000 tty: serial: cpm_uart: Fix behaviour for non existing GPIOs devm_gpiod_get_index() doesn't return NULL but -ENOENT when the requested GPIO doesn't exist, leading to the following messages: [ 2.742468] gpiod_direction_input: invalid GPIO (errorpointer) [ 2.748147] can't set direction for gpio #2: -2 [ 2.753081] gpiod_direction_input: invalid GPIO (errorpointer) [ 2.758724] can't set direction for gpio #3: -2 [ 2.763666] gpiod_direction_output: invalid GPIO (errorpointer) [ 2.769394] can't set direction for gpio #4: -2 [ 2.774341] gpiod_direction_input: invalid GPIO (errorpointer) [ 2.779981] can't set direction for gpio #5: -2 [ 2.784545] ff000a20.serial: ttyCPM1 at MMIO 0xfff00a20 (irq = 39, base_baud = 8250000) is a CPM UART Use devm_gpiod_get_index_optional() instead. At the same time, handle the error case and properly exit with an error. Fixes: 97cbaf2c829b ("tty: serial: cpm_uart: Convert to use GPIO descriptors") Cc: stable@vger.kernel.org Cc: Linus Walleij Signed-off-by: Christophe Leroy Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/694a25fdce548c5ee8b060ef6a4b02746b8f25c0.1591986307.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman commit 311950f8b8d80ba41aa09a26bcaf0c2231f8d264 Author: Christoph Hellwig Date: Wed Jun 24 18:57:24 2020 +0200 scsi: mptfusion: Don't use GFP_ATOMIC for larger DMA allocations The mpt fusion driver still uses the legacy PCI DMA API which hardcodes atomic allocations. This caused the driver to fail to load on some powerpc VMs with incoherent DMA and small memory sizes. Switch to use the modern DMA API and sleeping allocations for large allocations instead. This is not a full cleanup of the PCI DMA API usage yet, but just enough to fix the regression caused by reducing the default atomic pool size. Link: https://lore.kernel.org/r/20200624165724.1818496-1-hch@lst.de Fixes: 3ee06a6d532f ("dma-pool: fix too large DMA pools on medium memory size systems") Reported-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 823a65409c8990f64c5693af98ce0e7819975cba Author: Javed Hasan Date: Fri Jun 26 02:49:59 2020 -0700 scsi: libfc: Skip additional kref updating work event When an rport event (RPORT_EV_READY) is updated without work being queued, avoid taking an additional reference. This issue was leading to memory leak. Trace from KMEMLEAK tool: unreferenced object 0xffff8888259e8780 (size 512): comm "kworker/2:1", jiffies 4433237386 (age 113021.971s) hex dump (first 32 bytes): 58 0a ec cf 83 88 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 08 00 00 00 13 7d f0 1e 0e 00 00 10 backtrace: [<000000006b25760f>] fc_rport_recv_req+0x3c6/0x18f0 [libfc] [<00000000f208d994>] fc_lport_recv_els_req+0x120/0x8a0 [libfc] [<00000000a9c437b8>] fc_lport_recv+0xb9/0x130 [libfc] [<00000000a9c437b8>] fc_lport_recv+0xb9/0x130 [libfc] [<00000000ad5be37b>] qedf_ll2_process_skb+0x73d/0xad0 [qedf] [<00000000e0eb6893>] process_one_work+0x382/0x6c0 [<000000002dfd9e21>] worker_thread+0x57/0x5c0 [<00000000b648204f>] kthread+0x1a0/0x1c0 [<0000000072f5ab20>] ret_from_fork+0x35/0x40 [<000000001d5c05d8>] 0xffffffffffffffff Below is the log sequence which leads to memory leak. Here we get the RPORT_EV_READY and RPORT_EV_STOP back to back, which lead to overwrite the event RPORT_EV_READY by event RPORT_EV_STOP. Because of this, kref_count gets incremented by 1. kernel: host0: rport fffce5: Received PLOGI request kernel: host0: rport fffce5: Received PLOGI in INIT state kernel: host0: rport fffce5: Port is Ready kernel: host0: rport fffce5: Received PRLI request while in state Ready kernel: host0: rport fffce5: PRLI rspp type 8 active 1 passive 0 kernel: host0: rport fffce5: Received LOGO request while in state Ready kernel: host0: rport fffce5: Delete port kernel: host0: rport fffce5: Received PLOGI request kernel: host0: rport fffce5: Received PLOGI in state Delete - send busy kernel: host0: rport fffce5: work event 3 kernel: host0: rport fffce5: lld callback ev 3 kernel: host0: rport fffce5: work delete Link: https://lore.kernel.org/r/20200626094959.32151-1-jhasan@marvell.com Reviewed-by: Girish Basrur Reviewed-by: Saurav Kashyap Reviewed-by: Shyam Sundar Signed-off-by: Javed Hasan Signed-off-by: Martin K. Petersen commit 71f2bf85e90d938d4a9ef9dd9bfa8d9b0b6a03f7 Author: Javed Hasan Date: Mon Jun 22 03:12:11 2020 -0700 scsi: libfc: Handling of extra kref Handling of extra kref which is done by lookup table in case rdata is already present in list. This issue was leading to memory leak. Trace from KMEMLEAK tool: unreferenced object 0xffff8888259e8780 (size 512): comm "kworker/2:1", pid 182614, jiffies 4433237386 (age 113021.971s) hex dump (first 32 bytes): 58 0a ec cf 83 88 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 08 00 00 00 13 7d f0 1e 0e 00 00 10 backtrace: [<000000006b25760f>] fc_rport_recv_req+0x3c6/0x18f0 [libfc] [<00000000f208d994>] fc_lport_recv_els_req+0x120/0x8a0 [libfc] [<00000000a9c437b8>] fc_lport_recv+0xb9/0x130 [libfc] [<00000000ad5be37b>] qedf_ll2_process_skb+0x73d/0xad0 [qedf] [<00000000e0eb6893>] process_one_work+0x382/0x6c0 [<000000002dfd9e21>] worker_thread+0x57/0x5c0 [<00000000b648204f>] kthread+0x1a0/0x1c0 [<0000000072f5ab20>] ret_from_fork+0x35/0x40 [<000000001d5c05d8>] 0xffffffffffffffff Below is the log sequence which leads to memory leak. Here we get the nested "Received PLOGI request" for same port and this request leads to call the fc_rport_create() twice for the same rport. kernel: host1: rport fffce5: Received PLOGI request kernel: host1: rport fffce5: Received PLOGI in INIT state kernel: host1: rport fffce5: Port is Ready kernel: host1: rport fffce5: Received PRLI request while in state Ready kernel: host1: rport fffce5: PRLI rspp type 8 active 1 passive 0 kernel: host1: rport fffce5: Received LOGO request while in state Ready kernel: host1: rport fffce5: Delete port kernel: host1: rport fffce5: Received PLOGI request kernel: host1: rport fffce5: Received PLOGI in state Delete - send busy Link: https://lore.kernel.org/r/20200622101212.3922-2-jhasan@marvell.com Reviewed-by: Girish Basrur Reviewed-by: Saurav Kashyap Reviewed-by: Shyam Sundar Signed-off-by: Javed Hasan Signed-off-by: Martin K. Petersen commit 1fc98aaf7f85fadcca57c4a86ef17e1940cad2d3 Author: Dan Carpenter Date: Fri Jun 19 17:30:41 2020 +0300 scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() This code doesn't make sense unless the correct "fcport" was found. Link: https://lore.kernel.org/r/20200619143041.GD267142@mwanda Fixes: 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver") Reviewed-by: Himanshu Madhani Reviewed-by: Shyam Sundar Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit c0b8892e2461b5fa740e47efbb1269a487b04020 Author: Hsin-Yi Wang Date: Mon Jun 22 23:57:53 2020 +0800 drm/mediatek: Check plane visibility in atomic_update Disable the plane if it's not visible. Otherwise mtk_ovl_layer_config() would proceed with invalid plane and we may see vblank timeout. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang Reviewed-by: Tomasz Figa Signed-off-by: Chun-Kuang Hu commit c79484f68b164a4b59c85b7a5008455ddd7af6fb Author: YueHaibing Date: Wed Apr 29 15:13:37 2020 +0800 drm/mediatek: Fix Kconfig warning WARNING: unmet direct dependencies detected for MTK_MMSYS Depends on [n]: (ARCH_MEDIATEK [=y] || COMPILE_TEST [=n]) && COMMON_CLK_MT8173_MMSYS [=n] Selected by [y]: - DRM_MEDIATEK [=y] && HAS_IOMEM [=y] && DRM [=y] && (ARCH_MEDIATEK [=y] || ARM && COMPILE_TEST [=n]) && COMMON_CLK [=y] && HAVE_ARM_SMCCC [=y] && OF [=y] Make DRM_MEDIATEK depend on MTK_MMSYS to fix this. Fixes: 2c758e301ed9 ("soc / drm: mediatek: Move routing control to mmsys device") Signed-off-by: YueHaibing Reviewed-by: Enric Balletbo i Serra Signed-off-by: Chun-Kuang Hu commit a11398ef87ae38e008c69bea143513e9a36a6577 Author: Enric Balletbo i Serra Date: Wed Feb 26 12:27:23 2020 +0100 drm/mediatek: Remove debug messages for function calls Equivalent information can be nowadays obtained using function tracer. Signed-off-by: Enric Balletbo i Serra Reviewed-by: CK Hu Signed-off-by: Chun-Kuang Hu commit e09a7f87e5cb3b564ad1d98d4d2f678504d6df19 Author: Hsin-Yi Wang Date: Thu Apr 9 14:02:09 2020 +0800 drm/mediatek: Fix device passed to cmdq drm device is now probed from mmsys. We need to use mmsys device to get gce nodes. Fix following errors: [ 0.740068] mediatek-drm mediatek-drm.1.auto: error -2 can't parse gce-client-reg property (0) [ 0.748721] mediatek-drm mediatek-drm.1.auto: error -2 can't parse gce-client-reg property (0) ... [ 2.659645] mediatek-drm mediatek-drm.1.auto: failed to request channel [ 2.666270] mediatek-drm mediatek-drm.1.auto: failed to request channel Fixes: 667c769246b0 ("soc / drm: mediatek: Fix mediatek-drm device probing") Signed-off-by: Hsin-Yi Wang Reviewed-by: Enric Balletbo i Serra Tested-by: Enric Balletbo i Serra Signed-off-by: Chun-Kuang Hu commit d68ec1644dd546851d651787a638aead32a60a6f Merge: 48778464bb7d 38ac46002d1d Author: Arnd Bergmann Date: Sat Jun 27 00:16:42 2020 +0200 Merge tag 'juno-fix-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes ARMv8 Juno/Vexpress/Fast Models fix for v5.8 Partial revert of some recent fixes to silence DTC warning which broke clocks on some Vexpress platforms resulting in boot issues. * tag 'juno-fix-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm: dts: vexpress: Move mcc node back into motherboard node Link: https://lore.kernel.org/r/20200609180447.GB5732@bogus Signed-off-by: Arnd Bergmann commit 0574e2000fc3103cbc69ba82ec1175ce171fdf5e Author: Claudiu Manoil Date: Fri Jun 26 19:17:29 2020 +0300 enetc: Fix tx rings bitmap iteration range, irq handling The rings bitmap of an interrupt vector encodes which of the device's rings were assigned to that interrupt vector. Hence the iteration range of the tx rings bitmap (for_each_set_bit()) should be the total number of Tx rings of that netdevice instead of the number of rings assigned to the interrupt vector. Since there are 2 cores, and one interrupt vector for each core, the number of rings asigned to an interrupt vector is half the number of available rings. The impact of this error is that the upper half of the tx rings could still generate interrupts during napi polling. Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller commit 93e0272a4395819d51c7501b3cde771863ccecd2 Merge: 861254d82649 5d8913504ccf Author: Linus Walleij Date: Fri Jun 26 23:53:25 2020 +0200 Merge tag 'gpio-fixes-for-v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes gpio fixes for v5.8-rc3 - several fixes for gpio-pca953x commit c63d2dd7e134ebddce4745c51f9572b3f0d92b26 Author: David Gow Date: Tue Jun 2 20:37:25 2020 -0700 Documentation: kunit: Add some troubleshooting tips to the FAQ Add an FAQ entry to the KUnit documentation with some tips for troubleshooting KUnit and kunit_tool. These suggestions largely came from an email thread: https://lore.kernel.org/linux-kselftest/41db8bbd-3ba0-8bde-7352-083bf4b947ff@intel.com/T/#m23213d4e156db6d59b0b460a9014950f5ff6eb03 Signed-off-by: David Gow Reviewed-by: Alan Maguire Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit ee61492ab92b108b7db66acfd2c5f794244466b9 Author: David Gow Date: Mon Jun 15 23:47:30 2020 -0700 kunit: kunit_tool: Fix invalid result when build fails When separating out different phases of running tests[1] (build/exec/parse/etc), the format of the KunitResult tuple changed (adding an elapsed_time variable). This is not populated during a build failure, causing kunit.py to crash. This fixes [1] to probably populate the result variable, causing a failing build to be reported properly. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=45ba7a893ad89114e773b3dc32f6431354c465d6 Signed-off-by: David Gow Reviewed-by: Brendan Higgins Tested-by: Brendan Higgins Signed-off-by: Shuah Khan commit e173b8b8c419897eabe0e337a0125c6d87ef1644 Author: Uriel Guajardo Date: Thu Jun 11 21:05:45 2020 +0000 kunit: show error if kunit results are not present Currently, if the kernel is configured incorrectly or if it crashes before any kunit tests are run, kunit finishes without error, reporting that 0 test cases were run. To fix this, an error is shown when the tap header is not found, which indicates that kunit was not able to run at all. Signed-off-by: Uriel Guajardo Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 3f37d14b8a3152441f36b6bc74000996679f0998 Author: Rikard Falkeborn Date: Sun Jun 7 23:57:15 2020 +0200 kunit: kunit_config: Fix parsing of CONFIG options with space Commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is updated") introduced a new CONFIG option CONFIG_CC_VERSION_TEXT. On my system, this is set to "gcc (GCC) 10.1.0" which breaks KUnit config parsing which did not like the spaces in the string. Fix this by updating the regex to allow strings containing spaces. Fixes: 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is updated") Signed-off-by: Rikard Falkeborn Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 1590a2e1c681b0991bd42c992cabfd380e0338f2 Merge: ed3e00e7d6a8 0f29c20bf434 Author: Linus Torvalds Date: Fri Jun 26 12:33:48 2020 -0700 Merge tag 'acpi-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "Prevent bypassing kernel lockdown via the ACPI tables loading interface (Jason A. Donenfeld) and fix the handling of an ACPI sysfs attribute (Nathan Chancellor)" * tag 'acpi-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: sysfs: Fix pm_profile_attr type ACPI: configfs: Disallow loading ACPI tables when locked down commit ed3e00e7d6a87c60fcbc5a571b451891d365134e Merge: bd37cdf8ba1b 0e3fb2a128d8 Author: Linus Torvalds Date: Fri Jun 26 12:32:11 2020 -0700 Merge tag 'pm-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix a recent regression that broke suspend-to-idle on some x86 systems, fix the intel_pstate driver to correctly let the platform firmware control CPU performance in some cases and add __init annotations to a couple of functions. Specifics: - Make sure that the _TIF_POLLING_NRFLAG is clear before entering the last phase of suspend-to-idle to avoid wakeup issues on some x86 systems (Chen Yu, Rafael Wysocki). - Cover one more case in which the intel_pstate driver should let the platform firmware control the CPU frequency and refuse to load (Srinivas Pandruvada). - Add __init annotations to 2 functions in the power management core (Christophe JAILLET)" * tag 'pm-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpuidle: Rearrange s2idle-specific idle state entry code PM: sleep: core: mark 2 functions as __init to save some memory cpufreq: intel_pstate: Add one more OOB control bit PM: s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle commit bd37cdf8ba1b56a968173560314398d5d3b2d37a Merge: 6a6c9b220a7f 48f0bcfb7aad Author: Linus Torvalds Date: Fri Jun 26 12:30:07 2020 -0700 Merge tag 'iommu-fixes-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: "A couple of Intel VT-d fixes: - Make Intel SVM code 64bit only. The code uses pgd_t* and the IOMMU only supports long-mode page-table formats, so its broken on 32bit anyway. - Make sure GFX quirks in for Intel VT-d are not applied to untrusted devices. Those devices might gain full memory access otherwise. - Identity mapping setup fix. - Fix ACS enabling when Intel IOMMU is off and untrusted devices are detected. - Two smaller fixes for coherency and IO page-table setup" * tag 'iommu-fixes-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Fix misuse of iommu_domain_identity_map() iommu/vt-d: Update scalable mode paging structure coherency iommu/vt-d: Enable PCI ACS for platform opt in hint iommu/vt-d: Don't apply gfx quirks to untrusted devices iommu/vt-d: Set U/S bit in first level page table by default iommu/vt-d: Make Intel SVM code 64-bit only commit 6a6c9b220a7fb7c8285ad1739ac3c909584feb43 Merge: 7c902e273019 687a0ed33736 Author: Linus Torvalds Date: Fri Jun 26 12:27:25 2020 -0700 Merge tag 'drm-fixes-2020-06-26' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Usual rc3 pickup, lots of little fixes all over. The core VT registration regression fix is probably the largest, otherwise ttm, amdgpu and tegra are the bulk, with some minor driver fixes. No i915 pull this week which may or may not mean I get 2x of it next week, we'll see how it goes. core: - fix VT registration regression ttm: - fix two fence leaks amdgpu: - Fix missed mutex unlock in DC error path - Fix firmware leak for sdma5 - DC bpc property fixes amdkfd: - Fix memleak in an error path radeon: - Fix copy paste typo in NI DPM spll validation rcar-du: - build fix tegra: - add missing zpos property - child driver registeration fix - debugfs cleanup fix - doc fix mcde: - reorder fbdev setup panel: - fix connector type - fix orienation for some panels sun4i: - fix dma/iommu configuration uvesafb: - respect blank flag" * tag 'drm-fixes-2020-06-26' of git://anongit.freedesktop.org/drm/drm: (25 commits) drm/amd: fix potential memleak in err branch drm/amd/display: Fix ineffective setting of max bpc property drm/amd/display: Enable output_bpc property on all outputs drm/amdgpu: add fw release for sdma v5_0 drm/fb-helper: Fix vt restore drm/radeon: fix fb_div check in ni_init_smc_spll_table() drm/amdgpu/display: Unlock mutex on error drm/sun4i: mixer: Call of_dma_configure if there's an IOMMU drm: panel-orientation-quirks: Use generic orientation-data for Acer S1003 drm: panel-orientation-quirks: Add quirk for Asus T101HA panel video: fbdev: uvesafb: fix "noblank" option handling drm/panel-simple: fix connector type for newhaven_nhd_43_480272ef_atxl drm/panel-simple: fix connector type for LogicPD Type28 Display drm: rcar-du: Fix build error drm: mcde: Fix forgotten user of drm->dev_private drm: mcde: Fix display initialization problem drm/tegra: Add zpos property for cursor planes gpu: host1x: Detach driver on unregister gpu: host1x: Correct trivial kernel-doc inconsistencies drm/tegra: hub: Register child devices ... commit fa48494cce5f6360b0f8683cdf258fb45c666287 Author: Shannon Nelson Date: Thu Jun 25 22:58:37 2020 -0700 ionic: update the queue count on open Let the network stack know the real number of queues that we are using. v2: added error checking Fixes: 49d3b493673a ("ionic: disable the queues on link down") Signed-off-by: Shannon Nelson Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 7c902e273019ce60c1cb4d195e3cfd803969fd04 Merge: 4a21185cda0f 19ef1f9dfeff Author: Linus Torvalds Date: Fri Jun 26 12:19:36 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge misx fixes from Andrew Morton: "31 patches. Subsystems affected by this patch series: hotfixes, mm/pagealloc, kexec, ocfs2, lib, mm/slab, mm/slab, mm/slub, mm/swap, mm/pagemap, mm/vmalloc, mm/memcg, mm/gup, mm/thp, mm/vmscan, x86, mm/memory-hotplug, MAINTAINERS" * emailed patches from Andrew Morton : (31 commits) MAINTAINERS: update info for sparse mm/memory_hotplug.c: fix false softlockup during pfn range removal mm: remove vmalloc_exec arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page x86/hyperv: allocate the hypercall page with only read and execute bits mm/memory: fix IO cost for anonymous page mm/swap: fix for "mm: workingset: age nonresident information alongside anonymous pages" mm: workingset: age nonresident information alongside anonymous pages doc: THP CoW fault no longer allocate THP docs: mm/gup: minor documentation update mm/memcontrol.c: prevent missed memory.low load tears mm/memcontrol.c: add missed css_put() mm: memcontrol: handle div0 crash race condition in memory.low mm/vmalloc.c: fix a warning while make xmldocs media: omap3isp: remove cacheflush.h make asm-generic/cacheflush.h more standalone mm/debug_vm_pgtable: fix build failure with powerpc 8xx mm/memory.c: properly pte_offset_map_lock/unlock in vm_insert_pages() mm: fix swap cache node allocation mask slub: cure list_slab_objects() from double fix ... commit 70b23b87b2d32e608f97e06425853331f17fbda9 Merge: 56e287759b9a 6a47d6efc693 Author: Greg Kroah-Hartman Date: Fri Jun 26 17:26:31 2020 +0200 Merge tag 'fpga-fixes-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next FPGA Manager fixes for 5.8-rc1 Here is one (late) fix for 5.8-rc1 merge window. Arnd's change addresses a missing build dependency. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my fixes branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-fixes-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: zynqmp: fix modular build commit 56e287759b9a4ecd87b783a6daac65f59254a7c4 Merge: 8c289ea06416 ce04326edd59 Author: Greg Kroah-Hartman Date: Fri Jun 26 17:24:20 2020 +0200 Merge tag 'misc-habanalabs-fixes-2020-06-24' of git://people.freedesktop.org/~gabbayo/linux into char-misc-linus Oded writes: This tag contains the following fixes for kernel 5.8-rc2: - close security hole in GAUDI command buffer parsing by blocking an instruction that might allow user to run command buffer that wasn't parsed on a secured engine. - Fix bug in GAUDI MMU cache invalidation code. - Rename a function to resolve conflict with a static inline function in arch/m68k/include/asm/mcfmmu.h - Increase watchdog timeout of GAUDI QMAN arbitration H/W to prevent false reports on timeouts - Fix bug of dereferencing NULL pointer when an error occurs during command submission - Increase H/W timer for checking if PDMA engine is IDLE in GAUDI. * tag 'misc-habanalabs-fixes-2020-06-24' of git://people.freedesktop.org/~gabbayo/linux: habanalabs: increase h/w timer when checking idle habanalabs: Correct handling when failing to enqueue CB habanalabs: increase GAUDI QMAN ARB WDT timeout habanalabs: rename mmu_write() to mmu_asid_va_write() habanalabs: use PI in MMU cache invalidation habanalabs: block scalar load_and_exe on external queue commit ed8fa04243e22f7b8f470d08e5806c9f8c6a460a Merge: 603ea288dc53 cd37c6976f6a Author: Greg Kroah-Hartman Date: Fri Jun 26 17:16:52 2020 +0200 Merge tag 'fixes-for-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v5.8-rc2 A revert of Exynos5422 suspend clock support, it turns out it wasn't ready to be merged. CDNS3 got a fix for test mode initialization. Signed-off-by: Felipe Balbi * tag 'fixes-for-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk" usb: gadget: udc: Potential Oops in error handling code usb: phy: tegra: Fix unnecessary check in tegra_usb_phy_probe() usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work usb: cdns3: ep0: add spinlock for cdns3_check_new_setup usb: cdns3: trace: using correct dir value usb: cdns3: ep0: fix the test mode set incorrectly commit 0e3fb2a128d81bc5baee76dddcc8ddbc8ccae95c Merge: 0659d4205db4 589bab6bb30c 10e8b11eb319 Author: Rafael J. Wysocki Date: Fri Jun 26 17:09:49 2020 +0200 Merge branches 'pm-cpufreq' and 'pm-cpuidle' * pm-cpufreq: cpufreq: intel_pstate: Add one more OOB control bit * pm-cpuidle: cpuidle: Rearrange s2idle-specific idle state entry code PM: s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle commit 0f29c20bf4342c7757d9f4bf81159b02498b1b0d Merge: 75b0cea7bf30 e6d701dca989 Author: Rafael J. Wysocki Date: Fri Jun 26 17:06:29 2020 +0200 Merge branch 'acpi-sysfs' * acpi-sysfs: ACPI: sysfs: Fix pm_profile_attr type commit 603ea288dc53dfabf823bf7d38e401a945309492 Merge: ea0efd687b01 48778464bb7d Author: Greg Kroah-Hartman Date: Fri Jun 26 16:51:14 2020 +0200 Merge 5.8-rc2 into usb-linus Felipe has based his patches on that tag, so update my usb-linus branch to it as well so that I can pull his patches in here easier. Signed-off-by: Greg Kroah-Hartman commit 440ab9e10e2e6e5fd677473ee6f9e3af0f6904d6 Author: Douglas Anderson Date: Tue Jun 2 15:47:39 2020 -0700 kgdb: Avoid suspicious RCU usage warning At times when I'm using kgdb I see a splat on my console about suspicious RCU usage. I managed to come up with a case that could reproduce this that looked like this: WARNING: suspicious RCU usage 5.7.0-rc4+ #609 Not tainted ----------------------------- kernel/pid.c:395 find_task_by_pid_ns() needs rcu_read_lock() protection! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 3 locks held by swapper/0/1: #0: ffffff81b6b8e988 (&dev->mutex){....}-{3:3}, at: __device_attach+0x40/0x13c #1: ffffffd01109e9e8 (dbg_master_lock){....}-{2:2}, at: kgdb_cpu_enter+0x20c/0x7ac #2: ffffffd01109ea90 (dbg_slave_lock){....}-{2:2}, at: kgdb_cpu_enter+0x3ec/0x7ac stack backtrace: CPU: 7 PID: 1 Comm: swapper/0 Not tainted 5.7.0-rc4+ #609 Hardware name: Google Cheza (rev3+) (DT) Call trace: dump_backtrace+0x0/0x1b8 show_stack+0x1c/0x24 dump_stack+0xd4/0x134 lockdep_rcu_suspicious+0xf0/0x100 find_task_by_pid_ns+0x5c/0x80 getthread+0x8c/0xb0 gdb_serial_stub+0x9d4/0xd04 kgdb_cpu_enter+0x284/0x7ac kgdb_handle_exception+0x174/0x20c kgdb_brk_fn+0x24/0x30 call_break_hook+0x6c/0x7c brk_handler+0x20/0x5c do_debug_exception+0x1c8/0x22c el1_sync_handler+0x3c/0xe4 el1_sync+0x7c/0x100 rpmh_rsc_probe+0x38/0x420 platform_drv_probe+0x94/0xb4 really_probe+0x134/0x300 driver_probe_device+0x68/0x100 __device_attach_driver+0x90/0xa8 bus_for_each_drv+0x84/0xcc __device_attach+0xb4/0x13c device_initial_probe+0x18/0x20 bus_probe_device+0x38/0x98 device_add+0x38c/0x420 If I understand properly we should just be able to blanket kgdb under one big RCU read lock and the problem should go away. We'll add it to the beast-of-a-function known as kgdb_cpu_enter(). With this I no longer get any splats and things seem to work fine. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200602154729.v2.1.I70e0d4fd46d5ed2aaf0c98a355e8e1b7a5bb7e4e@changeid Signed-off-by: Daniel Thompson commit 5946d1f5b309381805bad3ddc3054c04f4ae9c24 Author: Sumit Garg Date: Thu Jun 4 15:31:19 2020 +0530 kdb: Switch to use safer dbg_io_ops over console APIs In kgdb context, calling console handlers aren't safe due to locks used in those handlers which could in turn lead to a deadlock. Although, using oops_in_progress increases the chance to bypass locks in most console handlers but it might not be sufficient enough in case a console uses more locks (VT/TTY is good example). Currently when a driver provides both polling I/O and a console then kdb will output using the console. We can increase robustness by using the currently active polling I/O driver (which should be lockless) instead of the corresponding console. For several common cases (e.g. an embedded system with a single serial port that is used both for console output and debugger I/O) this will result in no console handler being used. In order to achieve this we need to reverse the order of preference to use dbg_io_ops (uses polling I/O mode) over console APIs. So we just store "struct console" that represents debugger I/O in dbg_io_ops and while emitting kdb messages, skip console that matches dbg_io_ops console in order to avoid duplicate messages. After this change, "is_console" param becomes redundant and hence removed. Suggested-by: Daniel Thompson Signed-off-by: Sumit Garg Link: https://lore.kernel.org/r/1591264879-25920-5-git-send-email-sumit.garg@linaro.org Reviewed-by: Douglas Anderson Reviewed-by: Petr Mladek Acked-by: Greg Kroah-Hartman Signed-off-by: Daniel Thompson commit 89a3c9f5b9f0bcaa9aea3e8b2a616fcaea9aad78 Author: Chuck Lever Date: Thu Jun 25 11:32:34 2020 -0400 SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment() @subbuf is an output parameter of xdr_buf_subsegment(). A survey of call sites shows that @subbuf is always uninitialized before xdr_buf_segment() is invoked by callers. There are some execution paths through xdr_buf_subsegment() that do not set all of the fields in @subbuf, leaving some pointer fields containing garbage addresses. Subsequent processing of that buffer then results in a page fault. Signed-off-by: Chuck Lever Cc: Signed-off-by: Anna Schumaker commit d03727b248d0dae6199569a8d7b629a681154633 Author: Olga Kornievskaia Date: Wed Jun 24 13:54:08 2020 -0400 NFSv4 fix CLOSE not waiting for direct IO compeletion Figuring out the root case for the REMOVE/CLOSE race and suggesting the solution was done by Neil Brown. Currently what happens is that direct IO calls hold a reference on the open context which is decremented as an asynchronous task in the nfs_direct_complete(). Before reference is decremented, control is returned to the application which is free to close the file. When close is being processed, it decrements its reference on the open_context but since directIO still holds one, it doesn't sent a close on the wire. It returns control to the application which is free to do other operations. For instance, it can delete a file. Direct IO is finally releasing its reference and triggering an asynchronous close. Which races with the REMOVE. On the server, REMOVE can be processed before the CLOSE, failing the REMOVE with EACCES as the file is still opened. Signed-off-by: Olga Kornievskaia Suggested-by: Neil Brown CC: stable@vger.kernel.org Signed-off-by: Anna Schumaker commit 8b04013737341442ed914b336cde866b902664ae Author: Trond Myklebust Date: Mon Jun 22 15:04:15 2020 -0400 pNFS/flexfiles: Fix list corruption if the mirror count changes If the mirror count changes in the new layout we pick up inside ff_layout_pg_init_write(), then we can end up adding the request to the wrong mirror and corrupting the mirror->pg_list. Fixes: d600ad1f2bdb ("NFS41: pop some layoutget errors to application") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 4659ed7cc8514369043053463514408ca16ad6f3 Author: Tom Rix Date: Fri Jun 12 15:45:49 2020 -0700 nfs: Fix memory leak of export_path The try_location function is called within a loop by nfs_follow_referral. try_location calls nfs4_pathname_string to created the export_path. nfs4_pathname_string allocates the memory. export_path is stored in the nfs_fs_context/fs_context structure similarly as hostname and source. But whereas the ctx hostname and source are freed before assignment, export_path is not. So if there are multiple loops, the new export_path will overwrite the old without the old being freed. So call kfree for export_path. Signed-off-by: Tom Rix Signed-off-by: Anna Schumaker commit b7ade38165ca0001c5a3bd5314a314abbbfbb1b7 Author: Vasily Averin Date: Mon Jun 1 11:54:57 2020 +0300 sunrpc: fixed rollback in rpc_gssd_dummy_populate() __rpc_depopulate(gssd_dentry) was lost on error path cc: stable@vger.kernel.org Fixes: commit 4b9a445e3eeb ("sunrpc: create a new dummy pipe for gssd to hold open") Signed-off-by: Vasily Averin Reviewed-by: Jeff Layton Signed-off-by: Anna Schumaker commit 45c11a927606c612e4898a9484867b71318699f6 Author: Hans de Goede Date: Sat Jun 6 11:31:50 2020 +0200 pinctrl: baytrail: Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH) The pins on the Bay Trail SoC have separate input-buffer and output-buffer enable bits and a read of the level bit of the value register will always return the value from the input-buffer. The BIOS of a device may configure a pin in output-only mode, only enabling the output buffer, and write 1 to the level bit to drive the pin high. This 1 written to the level bit will be stored inside the data-latch of the output buffer. But a subsequent read of the value register will return 0 for the level bit because the input-buffer is disabled. This causes a read-modify-write as done by byt_gpio_set_direction() to write 0 to the level bit, driving the pin low! Before this commit byt_gpio_direction_output() relied on pinctrl_gpio_direction_output() to set the direction, followed by a call to byt_gpio_set() to apply the selected value. This causes the pin to go low between the pinctrl_gpio_direction_output() and byt_gpio_set() calls. Change byt_gpio_direction_output() to directly make the register modifications itself instead. Replacing the 2 subsequent writes to the value register with a single write. Note that the pinctrl code does not keep track internally of the direction, so not going through pinctrl_gpio_direction_output() is not an issue. This issue was noticed on a Trekstor SurfTab Twin 10.1. When the panel is already on at boot (no external monitor connected), then the i915 driver does a gpiod_get(..., GPIOD_OUT_HIGH) for the panel-enable GPIO. The temporarily going low of that GPIO was causing the panel to reset itself after which it would not show an image until it was turned off and back on again (until a full modeset was done on it). This commit fixes this. This commit also updates the byt_gpio_direction_input() to use direct register accesses instead of going through pinctrl_gpio_direction_input(), to keep it consistent with byt_gpio_direction_output(). Note for backporting, this commit depends on: commit e2b74419e5cc ("pinctrl: baytrail: Replace WARN with dev_info_once when setting direct-irq pin to output") Cc: stable@vger.kernel.org Fixes: 86e3ef812fe3 ("pinctrl: baytrail: Update gpio chip operations") Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 2c92d787cc9fad57d05c96bd117782183768258a Merge: 145a773aef83 8be3a53e18e0 Author: Ingo Molnar Date: Fri Jun 26 12:24:42 2020 +0200 Merge branch 'linus' into x86/entry, to resolve conflicts Conflicts: arch/x86/kernel/traps.c Signed-off-by: Ingo Molnar commit 60a0121f8fa64b0f4297aa6fef8207500483a874 Author: Luca Coelho Date: Fri Jun 26 12:49:40 2020 +0300 nl80211: fix memory leak when parsing NL80211_ATTR_HE_BSS_COLOR If there is an error when parsing the NL80211_ATTR_HE_BSS_COLOR attribute, we return immediately without freeing param.acl. Fit it by using goto out instead of returning immediately. Fixes: 5c5e52d1bb96 ("nl80211: add handling for BSS color") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200626124931.7ad2a3eb894f.I60905fb70bd20389a3b170db515a07275e31845e@changeid Signed-off-by: Johannes Berg commit bc7a39b4272b9672d806d422b6850e8c1a09914c Author: Luca Coelho Date: Fri Jun 26 12:49:39 2020 +0300 nl80211: don't return err unconditionally in nl80211_start_ap() When a memory leak was fixed, a return err was changed to goto err, but, accidentally, the if (err) was removed, so now we always exit at this point. Fix it by adding if (err) back. Fixes: 9951ebfcdf2b ("nl80211: fix potential leak in AP start") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200626124931.871ba5b31eee.I97340172d92164ee92f3c803fe20a8a6e97714e1@changeid Signed-off-by: Johannes Berg commit 40e05200593af06633f64ab0effff052eee6f076 Author: Mans Rullgard Date: Sat Jun 13 11:41:09 2020 +0100 i2c: core: check returned size of emulated smbus block read If the i2c bus driver ignores the I2C_M_RECV_LEN flag (as some of them do), it is possible for an I2C_SMBUS_BLOCK_DATA read issued on some random device to return an arbitrary value in the first byte (and nothing else). When this happens, i2c_smbus_xfer_emulated() will happily write past the end of the supplied data buffer, thus causing Bad Things to happen. To prevent this, check the size before copying the data block and return an error if it is too large. Fixes: 209d27c3b167 ("i2c: Emulate SMBus block read over I2C") Signed-off-by: Mans Rullgard [wsa: use better errno] Signed-off-by: Wolfram Sang commit 19ef1f9dfeffe2bfbeaf624277a179b1c0eef201 Author: Luc Van Oostenryck Date: Thu Jun 25 20:30:54 2020 -0700 MAINTAINERS: update info for sparse Update the info for sparse. More specifically: - change W entry to point to sparse.docs.kernel.org - add Q & B entry (patchwork & bugzilla) Link: http://lkml.kernel.org/r/20200621144204.53938-1-luc.vanoostenryck@gmail.com Signed-off-by: Luc Van Oostenryck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b7e3debdd0408c0dca5d4750371afa5003f792dc Author: Ben Widawsky Date: Thu Jun 25 20:30:51 2020 -0700 mm/memory_hotplug.c: fix false softlockup during pfn range removal When working with very large nodes, poisoning the struct pages (for which there will be very many) can take a very long time. If the system is using voluntary preemptions, the software watchdog will not be able to detect forward progress. This patch addresses this issue by offering to give up time like __remove_pages() does. This behavior was introduced in v5.6 with: commit d33695b16a9f ("mm/memory_hotplug: poison memmap in remove_pfn_range_from_zone()") Alternately, init_page_poison could do this cond_resched(), but it seems to me that the caller of init_page_poison() is what actually knows whether or not it should relax its own priority. Based on Dan's notes, I think this is perfectly safe: commit f931ab479dd2 ("mm: fix devm_memremap_pages crash, use mem_hotplug_{begin, done}") Aside from fixing the lockup, it is also a friendlier thing to do on lower core systems that might wipe out large chunks of hotplug memory (probably not a very common case). Fixes this kind of splat: watchdog: BUG: soft lockup - CPU#46 stuck for 22s! [daxctl:9922] irq event stamp: 138450 hardirqs last enabled at (138449): [] trace_hardirqs_on_thunk+0x1a/0x1c hardirqs last disabled at (138450): [] trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (138448): [] __do_softirq+0x347/0x456 softirqs last disabled at (138443): [] irq_exit+0x7d/0xb0 CPU: 46 PID: 9922 Comm: daxctl Not tainted 5.7.0-BEN-14238-g373c6049b336 #30 Hardware name: Intel Corporation PURLEY/PURLEY, BIOS PLYXCRB1.86B.0578.D07.1902280810 02/28/2019 RIP: 0010:memset_erms+0x9/0x10 Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 Call Trace: remove_pfn_range_from_zone+0x3a/0x380 memunmap_pages+0x17f/0x280 release_nodes+0x22a/0x260 __device_release_driver+0x172/0x220 device_driver_detach+0x3e/0xa0 unbind_store+0x113/0x130 kernfs_fop_write+0xdc/0x1c0 vfs_write+0xde/0x1d0 ksys_write+0x58/0xd0 do_syscall_64+0x5a/0x120 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Built 2 zonelists, mobility grouping on. Total pages: 49050381 Policy zone: Normal Built 3 zonelists, mobility grouping on. Total pages: 49312525 Policy zone: Normal David said: "It really only is an issue for devmem. Ordinary hotplugged system memory is not affected (onlined/offlined in memory block granularity)." Link: http://lkml.kernel.org/r/20200619231213.1160351-1-ben.widawsky@intel.com Fixes: commit d33695b16a9f ("mm/memory_hotplug: poison memmap in remove_pfn_range_from_zone()") Signed-off-by: Ben Widawsky Reported-by: "Scargall, Steve" Reported-by: Ben Widawsky Acked-by: David Hildenbrand Cc: Dan Williams Cc: Vishal Verma Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7a0e27b2a0ce2735e27e21ebc8b777550fe0ed81 Author: Christoph Hellwig Date: Thu Jun 25 20:30:47 2020 -0700 mm: remove vmalloc_exec Merge vmalloc_exec into its only caller. Note that for !CONFIG_MMU __vmalloc_node_range maps to __vmalloc, which directly clears the __GFP_HIGHMEM added by the vmalloc_exec stub anyway. Link: http://lkml.kernel.org/r/20200618064307.32739-4-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: David Hildenbrand Acked-by: Peter Zijlstra (Intel) Cc: Catalin Marinas Cc: Dexuan Cui Cc: Jessica Yu Cc: Vitaly Kuznetsov Cc: Wei Liu Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 10d5e97c1bf816facbc7c431c6caf47ee35fc1ed Author: Christoph Hellwig Date: Thu Jun 25 20:30:43 2020 -0700 arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the page read-only just after the allocation. Link: http://lkml.kernel.org/r/20200618064307.32739-3-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: David Hildenbrand Acked-by: Peter Zijlstra (Intel) Cc: Catalin Marinas Cc: Dexuan Cui Cc: Jessica Yu Cc: Vitaly Kuznetsov Cc: Wei Liu Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 800e26b81311dcc0080b8784f80620bb8f2baaa5 Author: Christoph Hellwig Date: Thu Jun 25 20:30:40 2020 -0700 x86/hyperv: allocate the hypercall page with only read and execute bits Patch series "fix a hyperv W^X violation and remove vmalloc_exec" Dexuan reported a W^X violation due to the fact that the hyper hypercall page due switching it to be allocated using vmalloc_exec. The problem is that PAGE_KERNEL_EXEC as used by vmalloc_exec actually sets writable permissions in the pte. This series fixes the issue by switching to the low-level __vmalloc_node_range interface that allows specifing more detailed permissions instead. It then also open codes the other two callers and removes the somewhat confusing vmalloc_exec interface. Peter noted that the hyper hypercall page allocation also has another long standing issue in that it shouldn't use the full vmalloc but just the module space. This issue is so far theoretical as the allocation is done early in the boot process. I plan to fix it with another bigger series for 5.9. This patch (of 3): Avoid a W^X violation cause by the fact that PAGE_KERNEL_EXEC includes the writable bit. For this resurrect the removed PAGE_KERNEL_RX definition, but as PAGE_KERNEL_ROX to match arm64 and powerpc. Link: http://lkml.kernel.org/r/20200618064307.32739-2-hch@lst.de Fixes: 78bb17f76edc ("x86/hyperv: use vmalloc_exec for the hypercall page") Signed-off-by: Christoph Hellwig Reported-by: Dexuan Cui Tested-by: Vitaly Kuznetsov Acked-by: Wei Liu Acked-by: Peter Zijlstra (Intel) Cc: Catalin Marinas Cc: Will Deacon Cc: Jessica Yu Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0076f029cb2906d32baf3bf4401ef09663071d16 Author: Joonsoo Kim Date: Thu Jun 25 20:30:37 2020 -0700 mm/memory: fix IO cost for anonymous page With synchronous IO swap device, swap-in is directly handled in fault code. Since IO cost notation isn't added there, with synchronous IO swap device, LRU balancing could be wrongly biased. Fix it to count it in fault code. Link: http://lkml.kernel.org/r/1592288204-27734-4-git-send-email-iamjoonsoo.kim@lge.com Fixes: 314b57fb0460001 ("mm: balance LRU lists based on relative thrashing cache sizing") Signed-off-by: Joonsoo Kim Acked-by: Johannes Weiner Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cb6868832ede5cd73b346ec11cf89814d26ff7c7 Author: Joonsoo Kim Date: Thu Jun 25 20:30:34 2020 -0700 mm/swap: fix for "mm: workingset: age nonresident information alongside anonymous pages" Non-file-lru page could also be activated in mark_page_accessed() and we need to count this activation for nonresident_age. Note that it's better for this patch to be squashed into the patch "mm: workingset: age nonresident information alongside anonymous pages". Link: http://lkml.kernel.org/r/1592288204-27734-3-git-send-email-iamjoonsoo.kim@lge.com Signed-off-by: Joonsoo Kim Acked-by: Johannes Weiner Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 31d8fcac00fcf4007f3921edc69ab4dcb3abcd4d Author: Johannes Weiner Date: Thu Jun 25 20:30:31 2020 -0700 mm: workingset: age nonresident information alongside anonymous pages Patch series "fix for "mm: balance LRU lists based on relative thrashing" patchset" This patchset fixes some problems of the patchset, "mm: balance LRU lists based on relative thrashing", which is now merged on the mainline. Patch "mm: workingset: let cache workingset challenge anon fix" is the result of discussion with Johannes. See following link. http://lkml.kernel.org/r/20200520232525.798933-6-hannes@cmpxchg.org And, the other two are minor things which are found when I try to rebase my patchset. This patch (of 3): After ("mm: workingset: let cache workingset challenge anon fix"), we compare refault distances to active_file + anon. But age of the non-resident information is only driven by the file LRU. As a result, we may overestimate the recency of any incoming refaults and activate them too eagerly, causing unnecessary LRU churn in certain situations. Make anon aging drive nonresident age as well to address that. Link: http://lkml.kernel.org/r/1592288204-27734-1-git-send-email-iamjoonsoo.kim@lge.com Link: http://lkml.kernel.org/r/1592288204-27734-2-git-send-email-iamjoonsoo.kim@lge.com Fixes: 34e58cac6d8f2a ("mm: workingset: let cache workingset challenge anon") Reported-by: Joonsoo Kim Signed-off-by: Johannes Weiner Signed-off-by: Joonsoo Kim Cc: Rik van Riel Cc: Minchan Kim Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2a8bef321749219a6f236dc9f5ee5571a5f1efc6 Author: Yang Shi Date: Thu Jun 25 20:30:28 2020 -0700 doc: THP CoW fault no longer allocate THP Since commit 3917c80280c9 ("thp: change CoW semantics for anon-THP"), THP CoW page fault is rewritten. Now it just splits pmd then fallback to base page fault, it doesn't try to allocate THP anymore. So it is no longer counted in THP_FAULT_ALLOC. Remove the obsolete statement in documentation about THP CoW allocation to avoid confusion. Link: http://lkml.kernel.org/r/1592424895-5421-1-git-send-email-yang.shi@linux.alibaba.com Signed-off-by: Yang Shi Cc: Kirill A. Shutemov Cc: Zi Yan Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f9e559703d0899cc74684128244682182157aa64 Author: Souptick Joarder Date: Thu Jun 25 20:30:25 2020 -0700 docs: mm/gup: minor documentation update Now there are 5 cases. Updated the same. Link: http://lkml.kernel.org/r/1592422023-7401-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Souptick Joarder Reviewed-by: John Hubbard Cc: Jonathan Corbet Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 03960e33187ae969187281c3aa6c308d7282c468 Author: Chris Down Date: Thu Jun 25 20:30:22 2020 -0700 mm/memcontrol.c: prevent missed memory.low load tears Looks like one of these got missed when massaging in f86b810c2610 ("mm, memcg: prevent memory.low load/store tearing") with other linux-mm changes. Link: http://lkml.kernel.org/r/20200612174437.GA391453@chrisdown.name Signed-off-by: Chris Down Reported-by: Michal Koutny Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3a98990ae2150277ed34d3b248c60e68bf2244b2 Author: Muchun Song Date: Thu Jun 25 20:30:19 2020 -0700 mm/memcontrol.c: add missed css_put() We should put the css reference when memory allocation failed. Link: http://lkml.kernel.org/r/20200614122653.98829-1-songmuchun@bytedance.com Fixes: f0a3a24b532d ("mm: memcg/slab: rework non-root kmem_cache lifecycle management") Signed-off-by: Muchun Song Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Qian Cai Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cd324edce598ebddde44162a2aa01321c1261b9e Author: Johannes Weiner Date: Thu Jun 25 20:30:16 2020 -0700 mm: memcontrol: handle div0 crash race condition in memory.low Tejun reports seeing rare div0 crashes in memory.low stress testing: RIP: 0010:mem_cgroup_calculate_protection+0xed/0x150 Code: 0f 46 d1 4c 39 d8 72 57 f6 05 16 d6 42 01 40 74 1f 4c 39 d8 76 1a 4c 39 d1 76 15 4c 29 d1 4c 29 d8 4d 29 d9 31 d2 48 0f af c1 <49> f7 f1 49 01 c2 4c 89 96 38 01 00 00 5d c3 48 0f af c7 31 d2 49 RSP: 0018:ffffa14e01d6fcd0 EFLAGS: 00010246 RAX: 000000000243e384 RBX: 0000000000000000 RCX: 0000000000008f4b RDX: 0000000000000000 RSI: ffff8b89bee84000 RDI: 0000000000000000 RBP: ffffa14e01d6fcd0 R08: ffff8b89ca7d40f8 R09: 0000000000000000 R10: 0000000000000000 R11: 00000000006422f7 R12: 0000000000000000 R13: ffff8b89d9617000 R14: ffff8b89bee84000 R15: ffffa14e01d6fdb8 FS: 0000000000000000(0000) GS:ffff8b8a1f1c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f93b1fc175b CR3: 000000016100a000 CR4: 0000000000340ea0 Call Trace: shrink_node+0x1e5/0x6c0 balance_pgdat+0x32d/0x5f0 kswapd+0x1d7/0x3d0 kthread+0x11c/0x160 ret_from_fork+0x1f/0x30 This happens when parent_usage == siblings_protected. We check that usage is bigger than protected, which should imply parent_usage being bigger than siblings_protected. However, we don't read (or even update) these values atomically, and they can be out of sync as the memory state changes under us. A bit of fluctuation around the target protection isn't a big deal, but we need to handle the div0 case. Check the parent state explicitly to make sure we have a reasonable positive value for the divisor. Link: http://lkml.kernel.org/r/20200615140658.601684-1-hannes@cmpxchg.org Fixes: 8a931f801340 ("mm: memcontrol: recursive memory.low protection") Signed-off-by: Johannes Weiner Reported-by: Tejun Heo Acked-by: Michal Hocko Acked-by: Chris Down Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8eab7035b231aa3ac27b20ec77f85375e4413083 Author: Masanari Iida Date: Thu Jun 25 20:30:13 2020 -0700 mm/vmalloc.c: fix a warning while make xmldocs This patch fixes following warning while "make xmldocs" mm/vmalloc.c:1877: warning: Excess function parameter 'prot' description in 'vm_map_ram' This warning started since commit d4efd79a81ab ("mm: remove the prot argument from vm_map_ram"). Link: http://lkml.kernel.org/r/20200622152850.140871-1-standby24x7@gmail.com Fixes: d4efd79a81ab ("mm: remove the prot argument from vm_map_ram") Signed-off-by: Masanari Iida Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3c7858268411dc6473e73965a23854d8f9825424 Author: Nathan Chancellor Date: Thu Jun 25 20:30:11 2020 -0700 media: omap3isp: remove cacheflush.h After mm.h was removed from the asm-generic version of cacheflush.h, s390 allyesconfig shows several warnings of the following nature: In file included from arch/s390/include/generated/asm/cacheflush.h:1, from drivers/media/platform/omap3isp/isp.c:42: include/asm-generic/cacheflush.h:16:42: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration As Geert and Laurent point out, this driver does not need this header in the two files that include it. Remove it so there are no warnings. Link: http://lkml.kernel.org/r/20200622234740.72825-2-natechancellor@gmail.com Fixes: e0cf615d725c ("asm-generic: don't include in cacheflush.h") Signed-off-by: Nathan Chancellor Suggested-by: Geert Uytterhoeven Suggested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Christoph Hellwig Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8dbdd5049cfa8f8848711ba83c9bbf67e08f5b2d Author: Stephen Rothwell Date: Thu Jun 25 20:30:07 2020 -0700 make asm-generic/cacheflush.h more standalone Some s390 builds get these warnings: include/asm-generic/cacheflush.h:16:42: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:22:46: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:28:45: warning: 'struct vm_area_struct' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:36:44: warning: 'struct vm_area_struct' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:44:45: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:52:50: warning: 'struct address_space' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:58:52: warning: 'struct address_space' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:75:17: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:74:45: warning: 'struct vm_area_struct' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:82:16: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration include/asm-generic/cacheflush.h:81:50: warning: 'struct vm_area_struct' declared inside parameter list will not be visible outside of this definition or declaration Forward declare the named structs to get rid of these. Link: http://lkml.kernel.org/r/20200623135714.4dae4b8a@canb.auug.org.au Fixes: e0cf615d725c ("asm-generic: don't include in cacheflush.h") Signed-off-by: Stephen Rothwell Reviewed-by: Christoph Hellwig Acked-by: Arnd Bergmann Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9449c9cb420b249eb6d7dad3953e4686443d7bd9 Author: Christophe Leroy Date: Thu Jun 25 20:30:04 2020 -0700 mm/debug_vm_pgtable: fix build failure with powerpc 8xx Since commit 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses"), READ_ONCE() cannot be used anymore to read complex page table entries. This leads to: CC mm/debug_vm_pgtable.o In file included from ./include/asm-generic/bug.h:5, from ./arch/powerpc/include/asm/bug.h:109, from ./include/linux/bug.h:5, from ./include/linux/mmdebug.h:5, from ./include/linux/gfp.h:5, from mm/debug_vm_pgtable.c:13: In function 'pte_clear_tests', inlined from 'debug_vm_pgtable' at mm/debug_vm_pgtable.c:363:2: ./include/linux/compiler.h:392:38: error: Unsupported access size for {READ,WRITE}_ONCE(). mm/debug_vm_pgtable.c:249:14: note: in expansion of macro 'READ_ONCE' 249 | pte_t pte = READ_ONCE(*ptep); | ^~~~~~~~~ make[2]: *** [mm/debug_vm_pgtable.o] Error 1 Fix it by using the recently added ptep_get() helper. Link: http://lkml.kernel.org/r/6ca8c972e6c920dc4ae0d4affbed9703afa4d010.1592490570.git.christophe.leroy@csgroup.eu Fixes: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Signed-off-by: Christophe Leroy Acked-by: Will Deacon Reviewed-by: Anshuman Khandual Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: "Peter Zijlstra (Intel)" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7f70c2a68a51496289df163f6969d4db7c383f30 Author: Arjun Roy Date: Thu Jun 25 20:30:01 2020 -0700 mm/memory.c: properly pte_offset_map_lock/unlock in vm_insert_pages() Calls to pte_offset_map() in vm_insert_pages() are erroneously not matched with a call to pte_unmap(). This would cause problems on architectures where that is not a no-op. This patch does away with the non-traditional locking in the existing code, and instead uses pte_offset_map_lock/unlock() as usual, incrementing PTE as necessary. The PTE pointer is kept within bounds since we clamp it with PTRS_PER_PTE. Link: http://lkml.kernel.org/r/20200618220446.20284-1-arjunroy.kdev@gmail.com Fixes: 8cd3984d81d5 ("mm/memory.c: add vm_insert_pages()") Signed-off-by: Arjun Roy Acked-by: David Rientjes Cc: Eric Dumazet Cc: Hugh Dickins Cc: Soheil Hassas Yeganeh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 243bce09c91b0145aeaedd5afba799d81841c030 Author: Hugh Dickins Date: Thu Jun 25 20:29:59 2020 -0700 mm: fix swap cache node allocation mask Chris Murphy reports that a slightly overcommitted load, testing swap and zram along with i915, splats and keeps on splatting, when it had better fail less noisily: gnome-shell: page allocation failure: order:0, mode:0x400d0(__GFP_IO|__GFP_FS|__GFP_COMP|__GFP_RECLAIMABLE), nodemask=(null),cpuset=/,mems_allowed=0 CPU: 2 PID: 1155 Comm: gnome-shell Not tainted 5.7.0-1.fc33.x86_64 #1 Call Trace: dump_stack+0x64/0x88 warn_alloc.cold+0x75/0xd9 __alloc_pages_slowpath.constprop.0+0xcfa/0xd30 __alloc_pages_nodemask+0x2df/0x320 alloc_slab_page+0x195/0x310 allocate_slab+0x3c5/0x440 ___slab_alloc+0x40c/0x5f0 __slab_alloc+0x1c/0x30 kmem_cache_alloc+0x20e/0x220 xas_nomem+0x28/0x70 add_to_swap_cache+0x321/0x400 __read_swap_cache_async+0x105/0x240 swap_cluster_readahead+0x22c/0x2e0 shmem_swapin+0x8e/0xc0 shmem_swapin_page+0x196/0x740 shmem_getpage_gfp+0x3a2/0xa60 shmem_read_mapping_page_gfp+0x32/0x60 shmem_get_pages+0x155/0x5e0 [i915] __i915_gem_object_get_pages+0x68/0xa0 [i915] i915_vma_pin+0x3fe/0x6c0 [i915] eb_add_vma+0x10b/0x2c0 [i915] i915_gem_do_execbuffer+0x704/0x3430 [i915] i915_gem_execbuffer2_ioctl+0x1ea/0x3e0 [i915] drm_ioctl_kernel+0x86/0xd0 [drm] drm_ioctl+0x206/0x390 [drm] ksys_ioctl+0x82/0xc0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x5b/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Reported on 5.7, but it goes back really to 3.1: when shmem_read_mapping_page_gfp() was implemented for use by i915, and allowed for __GFP_NORETRY and __GFP_NOWARN flags in most places, but missed swapin's "& GFP_KERNEL" mask for page tree node allocation in __read_swap_cache_async() - that was to mask off HIGHUSER_MOVABLE bits from what page cache uses, but GFP_RECLAIM_MASK is now what's needed. Link: https://bugzilla.kernel.org/show_bug.cgi?id=208085 Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2006151330070.11064@eggly.anvils Fixes: 68da9f055755 ("tmpfs: pass gfp to shmem_getpage_gfp") Signed-off-by: Hugh Dickins Reviewed-by: Vlastimil Babka Reviewed-by: Matthew Wilcox (Oracle) Reported-by: Chris Murphy Analyzed-by: Vlastimil Babka Analyzed-by: Matthew Wilcox Tested-by: Chris Murphy Cc: [3.1+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 55860d96ca59265d35427da0ee7d7f61e404f8e7 Author: Sebastian Andrzej Siewior Date: Thu Jun 25 20:29:55 2020 -0700 slub: cure list_slab_objects() from double fix According to Christopher Lameter two fixes have been merged for the same problem. As far as I can tell, the code does not acquire the list_lock and invoke kmalloc(). list_slab_objects() misses an unlock (the counterpart to get_map()) and the memory allocated in free_partial() isn't used. Revert the mentioned commit. Link: http://lkml.kernel.org/r/20200618201234.795692-1-bigeasy@linutronix.de Fixes: aa456c7aebb14 ("slub: remove kmalloc under list_lock from list_slab_objects() V2") Link: https://lkml.kernel.org/r/alpine.DEB.2.22.394.2006181501480.12014@www.lameter.com Signed-off-by: Sebastian Andrzej Siewior Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Thomas Gleixner Cc: Yu Zhao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8982ae527fbef170ef298650c15d55a9ccd33973 Author: Waiman Long Date: Thu Jun 25 20:29:52 2020 -0700 mm/slab: use memzero_explicit() in kzfree() The kzfree() function is normally used to clear some sensitive information, like encryption keys, in the buffer before freeing it back to the pool. Memset() is currently used for buffer clearing. However unlikely, there is still a non-zero probability that the compiler may choose to optimize away the memory clearing especially if LTO is being used in the future. To make sure that this optimization will never happen, memzero_explicit(), which is introduced in v3.18, is now used in kzfree() to future-proof it. Link: http://lkml.kernel.org/r/20200616154311.12314-2-longman@redhat.com Fixes: 3ef0e5ba4673 ("slab: introduce kzfree()") Signed-off-by: Waiman Long Acked-by: Michal Hocko Cc: David Howells Cc: Jarkko Sakkinen Cc: James Morris Cc: "Serge E. Hallyn" Cc: Joe Perches Cc: Matthew Wilcox Cc: David Rientjes Cc: Johannes Weiner Cc: Dan Carpenter Cc: "Jason A . Donenfeld" Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d7670879c5c4aa443d518fb234a9e5f30931efa3 Author: Waiman Long Date: Thu Jun 25 20:29:49 2020 -0700 mm, slab: fix sign conversion problem in memcg_uncharge_slab() It was found that running the LTP test on a PowerPC system could produce erroneous values in /proc/meminfo, like: MemTotal: 531915072 kB MemFree: 507962176 kB MemAvailable: 1100020596352 kB Using bisection, the problem is tracked down to commit 9c315e4d7d8c ("mm: memcg/slab: cache page number in memcg_(un)charge_slab()"). In memcg_uncharge_slab() with a "int order" argument: unsigned int nr_pages = 1 << order; : mod_lruvec_state(lruvec, cache_vmstat_idx(s), -nr_pages); The mod_lruvec_state() function will eventually call the __mod_zone_page_state() which accepts a long argument. Depending on the compiler and how inlining is done, "-nr_pages" may be treated as a negative number or a very large positive number. Apparently, it was treated as a large positive number in that PowerPC system leading to incorrect stat counts. This problem hasn't been seen in x86-64 yet, perhaps the gcc compiler there has some slight difference in behavior. It is fixed by making nr_pages a signed value. For consistency, a similar change is applied to memcg_charge_slab() as well. Link: http://lkml.kernel.org/r/20200620184719.10994-1-longman@redhat.com Fixes: 9c315e4d7d8c ("mm: memcg/slab: cache page number in memcg_(un)charge_slab()"). Signed-off-by: Waiman Long Acked-by: Roman Gushchin Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 786ae133e07f2a6b352a0efad16b555ee45a2898 Author: Randy Dunlap Date: Thu Jun 25 20:29:43 2020 -0700 lib: fix test_hmm.c reference after free Coccinelle scripts report the following errors: lib/test_hmm.c:523:20-26: ERROR: reference preceded by free on line 521 lib/test_hmm.c:524:21-27: ERROR: reference preceded by free on line 521 lib/test_hmm.c:523:28-35: ERROR: devmem is NULL but dereferenced. lib/test_hmm.c:524:29-36: ERROR: devmem is NULL but dereferenced. Fix these by using the local variable 'res' instead of devmem. Link: http://lkml.kernel.org/r/c845c158-9c65-9665-0d0b-00342846dd07@infradead.org Signed-off-by: Randy Dunlap Reviewed-by: Ralph Campbell Cc: Jérôme Glisse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9277f8334ffc719fe922d776444d6e4e884dbf30 Author: Junxiao Bi Date: Thu Jun 25 20:29:40 2020 -0700 ocfs2: fix value of OCFS2_INVALID_SLOT In the ocfs2 disk layout, slot number is 16 bits, but in ocfs2 implementation, slot number is 32 bits. Usually this will not cause any issue, because slot number is converted from u16 to u32, but OCFS2_INVALID_SLOT was defined as -1, when an invalid slot number from disk was obtained, its value was (u16)-1, and it was converted to u32. Then the following checking in get_local_system_inode will be always skipped: static struct inode **get_local_system_inode(struct ocfs2_super *osb, int type, u32 slot) { BUG_ON(slot == OCFS2_INVALID_SLOT); ... } Link: http://lkml.kernel.org/r/20200616183829.87211-5-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e5a15e17a78d58f933d17cafedfcf7486a29f5b4 Author: Junxiao Bi Date: Thu Jun 25 20:29:37 2020 -0700 ocfs2: fix panic on nfs server over ocfs2 The following kernel panic was captured when running nfs server over ocfs2, at that time ocfs2_test_inode_bit() was checking whether one inode locating at "blkno" 5 was valid, that is ocfs2 root inode, its "suballoc_slot" was OCFS2_INVALID_SLOT(65535) and it was allocted from //global_inode_alloc, but here it wrongly assumed that it was got from per slot inode alloctor which would cause array overflow and trigger kernel panic. BUG: unable to handle kernel paging request at 0000000000001088 IP: [] _raw_spin_lock+0x18/0xf0 PGD 1e06ba067 PUD 1e9e7d067 PMD 0 Oops: 0002 [#1] SMP CPU: 6 PID: 24873 Comm: nfsd Not tainted 4.1.12-124.36.1.el6uek.x86_64 #2 Hardware name: Huawei CH121 V3/IT11SGCA1, BIOS 3.87 02/02/2018 RIP: _raw_spin_lock+0x18/0xf0 RSP: e02b:ffff88005ae97908 EFLAGS: 00010206 RAX: ffff88005ae98000 RBX: 0000000000001088 RCX: 0000000000000000 RDX: 0000000000020000 RSI: 0000000000000009 RDI: 0000000000001088 RBP: ffff88005ae97928 R08: 0000000000000000 R09: ffff880212878e00 R10: 0000000000007ff0 R11: 0000000000000000 R12: 0000000000001088 R13: ffff8800063c0aa8 R14: ffff8800650c27d0 R15: 000000000000ffff FS: 0000000000000000(0000) GS:ffff880218180000(0000) knlGS:ffff880218180000 CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000001088 CR3: 00000002033d0000 CR4: 0000000000042660 Call Trace: igrab+0x1e/0x60 ocfs2_get_system_file_inode+0x63/0x3a0 [ocfs2] ocfs2_test_inode_bit+0x328/0xa00 [ocfs2] ocfs2_get_parent+0xba/0x3e0 [ocfs2] reconnect_path+0xb5/0x300 exportfs_decode_fh+0xf6/0x2b0 fh_verify+0x350/0x660 [nfsd] nfsd4_putfh+0x4d/0x60 [nfsd] nfsd4_proc_compound+0x3d3/0x6f0 [nfsd] nfsd_dispatch+0xe0/0x290 [nfsd] svc_process_common+0x412/0x6a0 [sunrpc] svc_process+0x123/0x210 [sunrpc] nfsd+0xff/0x170 [nfsd] kthread+0xcb/0xf0 ret_from_fork+0x61/0x90 Code: 83 c2 02 0f b7 f2 e8 18 dc 91 ff 66 90 eb bf 0f 1f 40 00 55 48 89 e5 41 56 41 55 41 54 53 0f 1f 44 00 00 48 89 fb ba 00 00 02 00 0f c1 17 89 d0 45 31 e4 45 31 ed c1 e8 10 66 39 d0 41 89 c6 RIP _raw_spin_lock+0x18/0xf0 CR2: 0000000000001088 ---[ end trace 7264463cd1aac8f9 ]--- Kernel panic - not syncing: Fatal exception Link: http://lkml.kernel.org/r/20200616183829.87211-4-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Mark Fasheh Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7569d3c754e452769a5747eeeba488179e38a5da Author: Junxiao Bi Date: Thu Jun 25 20:29:33 2020 -0700 ocfs2: load global_inode_alloc Set global_inode_alloc as OCFS2_FIRST_ONLINE_SYSTEM_INODE, that will make it load during mount. It can be used to test whether some global/system inodes are valid. One use case is that nfsd will test whether root inode is valid. Link: http://lkml.kernel.org/r/20200616183829.87211-3-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Mark Fasheh Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cd9973f9ff69e37dd0ba2bd6e6423f8179c329a Author: Junxiao Bi Date: Thu Jun 25 20:29:30 2020 -0700 ocfs2: avoid inode removal while nfsd is accessing it Patch series "ocfs2: fix nfsd over ocfs2 issues", v2. This is a series of patches to fix issues on nfsd over ocfs2. patch 1 is to avoid inode removed while nfsd access it patch 2 & 3 is to fix a panic issue. This patch (of 4): When nfsd is getting file dentry using handle or parent dentry of some dentry, one cluster lock is used to avoid inode removed from other node, but it still could be removed from local node, so use a rw lock to avoid this. Link: http://lkml.kernel.org/r/20200616183829.87211-1-junxiao.bi@oracle.com Link: http://lkml.kernel.org/r/20200616183829.87211-2-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Mark Fasheh Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fd7af71be54271a9f03b2e6f63e4b3ac1ecd113d Author: Lianbo Jiang Date: Thu Jun 25 20:29:27 2020 -0700 kexec: do not verify the signature without the lockdown or mandatory signature Signature verification is an important security feature, to protect system from being attacked with a kernel of unknown origin. Kexec rebooting is a way to replace the running kernel, hence need be secured carefully. In the current code of handling signature verification of kexec kernel, the logic is very twisted. It mixes signature verification, IMA signature appraising and kexec lockdown. If there is no KEXEC_SIG_FORCE, kexec kernel image doesn't have one of signature, the supported crypto, and key, we don't think this is wrong, Unless kexec lockdown is executed. IMA is considered as another kind of signature appraising method. If kexec kernel image has signature/crypto/key, it has to go through the signature verification and pass. Otherwise it's seen as verification failure, and won't be loaded. Seems kexec kernel image with an unqualified signature is even worse than those w/o signature at all, this sounds very unreasonable. E.g. If people get a unsigned kernel to load, or a kernel signed with expired key, which one is more dangerous? So, here, let's simplify the logic to improve code readability. If the KEXEC_SIG_FORCE enabled or kexec lockdown enabled, signature verification is mandated. Otherwise, we lift the bar for any kernel image. Link: http://lkml.kernel.org/r/20200602045952.27487-1-lijiang@redhat.com Signed-off-by: Lianbo Jiang Reviewed-by: Jiri Bohac Acked-by: Dave Young Acked-by: Baoquan He Cc: James Morris Cc: Matthew Garrett Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b9e20f0da1f5c9c68689450a8cb436c9486434c8 Author: Vlastimil Babka Date: Thu Jun 25 20:29:24 2020 -0700 mm, compaction: make capture control handling safe wrt interrupts Hugh reports: "While stressing compaction, one run oopsed on NULL capc->cc in __free_one_page()'s task_capc(zone): compact_zone_order() had been interrupted, and a page was being freed in the return from interrupt. Though you would not expect it from the source, both gccs I was using (4.8.1 and 7.5.0) had chosen to compile compact_zone_order() with the ".cc = &cc" implemented by mov %rbx,-0xb0(%rbp) immediately before callq compact_zone - long after the "current->capture_control = &capc". An interrupt in between those finds capc->cc NULL (zeroed by an earlier rep stos). This could presumably be fixed by a barrier() before setting current->capture_control in compact_zone_order(); but would also need more care on return from compact_zone(), in order not to risk leaking a page captured by interrupt just before capture_control is reset. Maybe that is the preferable fix, but I felt safer for task_capc() to exclude the rather surprising possibility of capture at interrupt time" I have checked that gcc10 also behaves the same. The advantage of fix in compact_zone_order() is that we don't add another test in the page freeing hot path, and that it might prevent future problems if we stop exposing pointers to uninitialized structures in current task. So this patch implements the suggestion for compact_zone_order() with barrier() (and WRITE_ONCE() to prevent store tearing) for setting current->capture_control, and prevents page leaking with WRITE_ONCE/READ_ONCE in the proper order. Link: http://lkml.kernel.org/r/20200616082649.27173-1-vbabka@suse.cz Fixes: 5e1f0f098b46 ("mm, compaction: capture a page under direct compaction") Signed-off-by: Vlastimil Babka Reported-by: Hugh Dickins Suggested-by: Hugh Dickins Acked-by: Hugh Dickins Cc: Alex Shi Cc: Li Wang Cc: Mel Gorman Cc: [5.1+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 545b1b077ca6b359820436af097bc65e3f6f6cc9 Author: Michal Hocko Date: Thu Jun 25 20:29:21 2020 -0700 mm: do_swap_page(): fix up the error code do_swap_page() returns error codes from the VM_FAULT* space. try_charge() might return -ENOMEM, though, and then do_swap_page() simply returns 0 which means a success. We almost never return ENOMEM for GFP_KERNEL single page charge. Except for async OOM handling (oom_disabled v1). So this needs translation to VM_FAULT_OOM otherwise the the page fault path will not notify the userspace and wait for an action. Link: http://lkml.kernel.org/r/20200617090238.GL9499@dhcp22.suse.cz Fixes: 4c6355b25e8b ("mm: memcontrol: charge swapin pages on instantiation") Signed-off-by: Michal Hocko Acked-by: Johannes Weiner Cc: Alex Shi Cc: Joonsoo Kim Cc: Shakeel Butt Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 313a5257b84c26b7f080c5d294aabe7d38ca439c Author: Stafford Horne Date: Thu Jun 25 20:29:17 2020 -0700 openrisc: fix boot oops when DEBUG_VM is enabled Since v5.8-rc1 OpenRISC Linux fails to boot when DEBUG_VM is enabled. This has been bisected to commit 42fc541404f2 ("mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked()"). The added locking checks exposed the issue that OpenRISC was not taking this mmap lock when during page walks for DMA operations. This patch locks and unlocks the mmap lock for page walking. Link: http://lkml.kernel.org/r/20200617090247.1680188-1-shorne@gmail.com Fixes: 42fc541404f2 ("mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked()" Signed-off-by: Stafford Horne Reviewed-by: Michel Lespinasse Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Jason Gunthorpe Cc: Steven Price Cc: Thomas Hellstrom Cc: Robin Murphy Cc: Vlastimil Babka Cc: Daniel Jordan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 687a0ed337367be5267652af5f6dbcfc954b8732 Merge: 5b83c254571b dc5bdb68b5b3 Author: Dave Airlie Date: Fri Jun 26 13:49:05 2020 +1000 Merge tag 'drm-misc-fixes-2020-06-25' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Short summary of fixes pull (less than what git shortlog provides): * In mcde, set up fbdev after device registration and removde the last access to dev->dev_private. Fixes an error message and a segmentation fault. * Set the connector type for LogicPT Type 28 and newhaven_nhd_43_480272ef_atxl panels. * In uvesafb, fix the handling of the noblank option. * Fix panel orientation for Asus T101HA and Acer S1003. * Fix DMA configuration for sun4i if IOMMU is present. * Fix regression in VT restoration. Unbreaks userspace (i.e., Xorg) VT handling. Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200625082717.GA14856@linux-uq9g commit 896066aa0685af3434637998b76218c2045142a8 Author: Harish Date: Thu Jun 25 22:27:21 2020 +0530 selftests/powerpc: Fix build failure in ebb tests We use OUTPUT directory as TMPOUT for checking no-pie option. Since commit f2f02ebd8f38 ("kbuild: improve cc-option to clean up all temporary files") when building powerpc/ from selftests directory, the OUTPUT directory points to powerpc/pmu/ebb/ and gets removed when checking for -no-pie option in try-run routine, subsequently build fails with the following: $ make -C powerpc ... TARGET=ebb; BUILD_TARGET=$OUTPUT/$TARGET; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C $TARGET all make[2]: Entering directory '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb' make[2]: *** No rule to make target 'Makefile'. make[2]: Failed to remake makefile 'Makefile'. make[2]: *** No rule to make target 'ebb.c', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'. make[2]: *** No rule to make target 'ebb_handler.S', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'. make[2]: *** No rule to make target 'trace.c', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'. make[2]: *** No rule to make target 'busy_loop.S', needed by '/home/linux-master/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test'. make[2]: Target 'all' not remade because of errors. Fix this by adding a suffix to the OUTPUT directory so that the failure is avoided. Fixes: 9686813f6e9d ("selftests/powerpc: Fix try-run when source tree is not writable") Signed-off-by: Harish [mpe: Mention that commit that triggered the breakage] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200625165721.264904-1-harish@linux.ibm.com commit 4a21185cda0fbb860580eeeb4f1a70a9cda332a4 Merge: 42e9c85f5c72 4c342f778fe2 Author: Linus Torvalds Date: Thu Jun 25 18:27:40 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from David Miller: 1) Don't insert ESP trailer twice in IPSEC code, from Huy Nguyen. 2) The default crypto algorithm selection in Kconfig for IPSEC is out of touch with modern reality, fix this up. From Eric Biggers. 3) bpftool is missing an entry for BPF_MAP_TYPE_RINGBUF, from Andrii Nakryiko. 4) Missing init of ->frame_sz in xdp_convert_zc_to_xdp_frame(), from Hangbin Liu. 5) Adjust packet alignment handling in ax88179_178a driver to match what the hardware actually does. From Jeremy Kerr. 6) register_netdevice can leak in the case one of the notifiers fail, from Yang Yingliang. 7) Use after free in ip_tunnel_lookup(), from Taehee Yoo. 8) VLAN checks in sja1105 DSA driver need adjustments, from Vladimir Oltean. 9) tg3 driver can sleep forever when we get enough EEH errors, fix from David Christensen. 10) Missing {READ,WRITE}_ONCE() annotations in various Intel ethernet drivers, from Ciara Loftus. 11) Fix scanning loop break condition in of_mdiobus_register(), from Florian Fainelli. 12) MTU limit is incorrect in ibmveth driver, from Thomas Falcon. 13) Endianness fix in mlxsw, from Ido Schimmel. 14) Use after free in smsc95xx usbnet driver, from Tuomas Tynkkynen. 15) Missing bridge mrp configuration validation, from Horatiu Vultur. 16) Fix circular netns references in wireguard, from Jason A. Donenfeld. 17) PTP initialization on recovery is not done properly in qed driver, from Alexander Lobakin. 18) Endian conversion of L4 ports in filters of cxgb4 driver is wrong, from Rahul Lakkireddy. 19) Don't clear bound device TX queue of socket prematurely otherwise we get problems with ktls hw offloading, from Tariq Toukan. 20) ipset can do atomics on unaligned memory, fix from Russell King. 21) Align ethernet addresses properly in bridging code, from Thomas Martitz. 22) Don't advertise ipv4 addresses on SCTP sockets having ipv6only set, from Marcelo Ricardo Leitner. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (149 commits) rds: transport module should be auto loaded when transport is set sch_cake: fix a few style nits sch_cake: don't call diffserv parsing code when it is not needed sch_cake: don't try to reallocate or unshare skb unconditionally ethtool: fix error handling in linkstate_prepare_data() wil6210: account for napi_gro_receive never returning GRO_DROP hns: do not cast return value of napi_gro_receive to null socionext: account for napi_gro_receive never returning GRO_DROP wireguard: receive: account for napi_gro_receive never returning GRO_DROP vxlan: fix last fdb index during dump of fdb with nhid sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket tc-testing: avoid action cookies with odd length. bpf: tcp: bpf_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT tcp_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT net: dsa: sja1105: fix tc-gate schedule with single element net: dsa: sja1105: recalculate gating subschedule after deleting tc-gate rules net: dsa: sja1105: unconditionally free old gating config net: dsa: sja1105: move sja1105_compose_gating_subschedule at the top net: macb: free resources on failure path of at91ether_open() net: macb: call pm_runtime_put_sync on failure path ... commit 4c342f778fe234e0c2a2601d87fec8ba42f0d2c6 Author: Rao Shoaib Date: Thu Jun 25 13:46:00 2020 -0700 rds: transport module should be auto loaded when transport is set This enhancement auto loads transport module when the transport is set via SO_RDS_TRANSPORT socket option. Reviewed-by: Ka-Cheong Poon Reviewed-by: Håkon Bugge Signed-off-by: Rao Shoaib Signed-off-by: Somasundaram Krishnasamy Signed-off-by: David S. Miller commit 6aeaf26222b230b3ab21f42e1e0d30738044ec69 Merge: 1ae71d997a67 3f608f0c4136 Author: David S. Miller Date: Thu Jun 25 16:24:05 2020 -0700 Merge branch 'sched-A-couple-of-fixes-for-sch_cake' Toke Høiland-Jørgensen says: ==================== sched: A couple of fixes for sch_cake This series contains a couple of fixes for diffserv handling in sch_cake that provide a nice speedup (with a somewhat pedantic nit fix tacked on to the end). Not quite sure about whether this should go to stable; it does provide a nice speedup, but it's not strictly a fix in the "correctness" sense. I lean towards including this in stable as well, since our most important consumer of that (OpenWrt) is likely to backport the series anyway. ==================== Signed-off-by: David S. Miller commit 3f608f0c41360b11b04c763f348b712f651c8bac Author: Toke Høiland-Jørgensen Date: Thu Jun 25 22:12:09 2020 +0200 sch_cake: fix a few style nits I spotted a few nits when comparing the in-tree version of sch_cake with the out-of-tree one: A redundant error variable declaration shadowing an outer declaration, and an indentation alignment issue. Fix both of these. Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc") Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 8c95eca0bb8c4bd2231a0d581f1ad0d50c90488c Author: Toke Høiland-Jørgensen Date: Thu Jun 25 22:12:08 2020 +0200 sch_cake: don't call diffserv parsing code when it is not needed As a further optimisation of the diffserv parsing codepath, we can skip it entirely if CAKE is configured to neither use diffserv-based classification, nor to zero out the diffserv bits. Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits") Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 9208d2863ac689a563b92f2161d8d1e7127d0add Author: Ilya Ponetayev Date: Thu Jun 25 22:12:07 2020 +0200 sch_cake: don't try to reallocate or unshare skb unconditionally cake_handle_diffserv() tries to linearize mac and network header parts of skb and to make it writable unconditionally. In some cases it leads to full skb reallocation, which reduces throughput and increases CPU load. Some measurements of IPv4 forward + NAPT on MIPS router with 580 MHz single-core CPU was conducted. It appears that on kernel 4.9 skb_try_make_writable() reallocates skb, if skb was allocated in ethernet driver via so-called 'build skb' method from page cache (it was discovered by strange increase of kmalloc-2048 slab at first). Obtain DSCP value via read-only skb_header_pointer() call, and leave linearization only for DSCP bleaching or ECN CE setting. And, as an additional optimisation, skip diffserv parsing entirely if it is not needed by the current configuration. Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits") Signed-off-by: Ilya Ponetayev [ fix a few style issues, reflow commit message ] Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 1ae71d997a672739b22572cbe72d61a0eed8c42c Author: Michal Kubecek Date: Thu Jun 25 00:09:08 2020 +0200 ethtool: fix error handling in linkstate_prepare_data() When getting SQI or maximum SQI value fails in linkstate_prepare_data(), we must not return without calling ethnl_ops_complete(dev) as that could result in imbalance between ethtool_ops ->begin() and ->complete() calls. Fixes: 806602191592 ("ethtool: provide UAPI for PHY Signal Quality Index (SQI)") Signed-off-by: Michal Kubecek Signed-off-by: David S. Miller commit 42e9c85f5c7296c4ec02644a2b3debc7120e2bf4 Merge: 52366a107bf0 20dc3847cc2f Author: Linus Torvalds Date: Thu Jun 25 16:16:49 2020 -0700 Merge tag 'trace-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Four small fixes: - Fix a ringbuffer bug for nested events having time go backwards - Fix a config dependency for boot time tracing to depend on synthetic events instead of histograms. - Fix trigger format parsing to handle multiple spaces - Fix bootconfig to handle failures in multiple events" * tag 'trace-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/boottime: Fix kprobe multiple events tracing: Fix event trigger to accept redundant spaces tracing/boot: Fix config dependency for synthedic event ring-buffer: Zero out time extend if it is nested and not absolute commit 0e00c05fa72554c86d7c7e0f538ec83bfe277c91 Merge: b18e9834f7b2 045790b7bc66 Author: David S. Miller Date: Thu Jun 25 16:16:21 2020 -0700 Merge branch 'napi_gro_receive-caller-return-value-cleanups' Jason A. Donenfeld says: ==================== napi_gro_receive caller return value cleanups In 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()"), the GRO_NORMAL case stopped calling netif_receive_skb_internal, checking its return value, and returning GRO_DROP in case it failed. Instead, it calls into netif_receive_skb_list_internal (after a bit of indirection), which doesn't return any error. Therefore, napi_gro_receive will never return GRO_DROP, making handling GRO_DROP dead code. I emailed the author of 6570bc79c0df on netdev [1] to see if this change was intentional, but the dlink.ru email address has been disconnected, and looking a bit further myself, it seems somewhat infeasible to start propagating return values backwards from the internal machinations of netif_receive_skb_list_internal. Taking a look at all the callers of napi_gro_receive, it appears that three are checking the return value for the purpose of comparing it to the now never-happening GRO_DROP, and one just casts it to (void), a likely historical leftover. Every other of the 120 callers does not bother checking the return value. And it seems like these remaining 116 callers are doing the right thing: after calling napi_gro_receive, the packet is now in the hands of the upper layers of the newtworking, and the device driver itself has no business now making decisions based on what the upper layers choose to do. Incrementing stats counters on GRO_DROP seems like a mistake, made by these three drivers, but not by the remaining 117. It would seem, therefore, that after rectifying these four callers of napi_gro_receive, that I should go ahead and just remove returning the value from napi_gro_receive all together. However, napi_gro_receive has a function event tracer, and being able to introspect into the networking stack to see how often napi_gro_receive is returning whatever interesting GRO status (aside from _DROP) remains an interesting data point worth keeping for debugging. So, this series simply gets rid of the return value checking for the four useless places where that check never evaluates to anything meaningful. [1] https://lore.kernel.org/netdev/20200624210606.GA1362687@zx2c4.com/ ==================== Acked-by: Edward Cree Signed-off-by: David S. Miller commit 045790b7bc66a75070c112a61558c639cef2263e Author: Jason A. Donenfeld Date: Wed Jun 24 16:06:06 2020 -0600 wil6210: account for napi_gro_receive never returning GRO_DROP The napi_gro_receive function no longer returns GRO_DROP ever, making handling GRO_DROP dead code. This commit removes that dead code. Further, it's not even clear that device drivers have any business in taking action after passing off received packets; that's arguably out of their hands. In this case, too, the non-gro path didn't bother checking the return value. Plus, this had some clunky debugging functions that duplicated code from elsewhere and was generally pretty messy. So, this commit cleans that all up too. Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit 93ab48a97af50c7c62c3c94996002949ffebf004 Author: Jason A. Donenfeld Date: Wed Jun 24 16:06:05 2020 -0600 hns: do not cast return value of napi_gro_receive to null Basically no drivers care about the return value here, and there's no __must_check that would make casting to void sensible, so remove it. Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit e5e7d8052f6140985c03bd49ebaa0af9c2944bc6 Author: Jason A. Donenfeld Date: Wed Jun 24 16:06:04 2020 -0600 socionext: account for napi_gro_receive never returning GRO_DROP The napi_gro_receive function no longer returns GRO_DROP ever, making handling GRO_DROP dead code. This commit removes that dead code. Further, it's not even clear that device drivers have any business in taking action after passing off received packets; that's arguably out of their hands. Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit df08126e3833e9dca19e2407db5f5860a7c194fb Author: Jason A. Donenfeld Date: Wed Jun 24 16:06:03 2020 -0600 wireguard: receive: account for napi_gro_receive never returning GRO_DROP The napi_gro_receive function no longer returns GRO_DROP ever, making handling GRO_DROP dead code. This commit removes that dead code. Further, it's not even clear that device drivers have any business in taking action after passing off received packets; that's arguably out of their hands. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit b18e9834f7b248b41e8179a039ec80803bb3d67a Author: Roopa Prabhu Date: Wed Jun 24 14:02:36 2020 -0700 vxlan: fix last fdb index during dump of fdb with nhid This patch fixes last saved fdb index in fdb dump handler when handling fdb's with nhid. Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 471e39df96b9a4c4ba88a2da9e25a126624d7a9c Author: Marcelo Ricardo Leitner Date: Wed Jun 24 17:34:18 2020 -0300 sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket If a socket is set ipv6only, it will still send IPv4 addresses in the INIT and INIT_ACK packets. This potentially misleads the peer into using them, which then would cause association termination. The fix is to not add IPv4 addresses to ipv6only sockets. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Corey Minyard Signed-off-by: Marcelo Ricardo Leitner Tested-by: Corey Minyard Signed-off-by: David S. Miller commit b6186d413b1d50f45fe2415d760947576ef3691a Author: Briana Oursler Date: Wed Jun 24 12:29:14 2020 -0700 tc-testing: avoid action cookies with odd length. Update odd length cookie hexstrings in csum.json, tunnel_key.json and bpf.json to be even length to comply with check enforced in commit 0149dabf2a1b ("tc: m_actions: check cookie hexstring len") in iproute2. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Reviewed-by: Davide Caratti Signed-off-by: David S. Miller commit 3b0e7dc0be62c6de0dbda68ac2961f27796919fb Merge: 29a30bac5642 7d21d54d6247 Author: David S. Miller Date: Thu Jun 25 16:08:47 2020 -0700 Merge branch 'tcp_cubic-fix-spurious-HYSTART_DELAY-on-RTT-decrease' Neal Cardwell says: ==================== tcp_cubic: fix spurious HYSTART_DELAY on RTT decrease This series fixes a long-standing bug in the TCP CUBIC HYSTART_DELAY mechanim recently reported by Mirja Kuehlewind. The code can cause a spurious exit of slow start in some particular cases: upon an RTT decrease that happens on the 9th or later ACK in a round trip. This series fixes the original Hystart code and also the recent BPF implementation. ==================== Signed-off-by: David S. Miller commit 7d21d54d624777358ab6c7be7ff778808fef70ba Author: Neal Cardwell Date: Wed Jun 24 12:42:03 2020 -0400 bpf: tcp: bpf_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT Apply the fix from: "tcp_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT" to the BPF implementation of TCP CUBIC congestion control. Repeating the commit description here for completeness: Mirja Kuehlewind reported a bug in Linux TCP CUBIC Hystart, where Hystart HYSTART_DELAY mechanism can exit Slow Start spuriously on an ACK when the minimum rtt of a connection goes down. From inspection it is clear from the existing code that this could happen in an example like the following: o The first 8 RTT samples in a round trip are 150ms, resulting in a curr_rtt of 150ms and a delay_min of 150ms. o The 9th RTT sample is 100ms. The curr_rtt does not change after the first 8 samples, so curr_rtt remains 150ms. But delay_min can be lowered at any time, so delay_min falls to 100ms. The code executes the HYSTART_DELAY comparison between curr_rtt of 150ms and delay_min of 100ms, and the curr_rtt is declared far enough above delay_min to force a (spurious) exit of Slow start. The fix here is simple: allow every RTT sample in a round trip to lower the curr_rtt. Fixes: 6de4a9c430b5 ("bpf: tcp: Add bpf_cubic example") Reported-by: Mirja Kuehlewind Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit b344579ca8478598937215f7005d6c7b84d28aee Author: Neal Cardwell Date: Wed Jun 24 12:42:02 2020 -0400 tcp_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT Mirja Kuehlewind reported a bug in Linux TCP CUBIC Hystart, where Hystart HYSTART_DELAY mechanism can exit Slow Start spuriously on an ACK when the minimum rtt of a connection goes down. From inspection it is clear from the existing code that this could happen in an example like the following: o The first 8 RTT samples in a round trip are 150ms, resulting in a curr_rtt of 150ms and a delay_min of 150ms. o The 9th RTT sample is 100ms. The curr_rtt does not change after the first 8 samples, so curr_rtt remains 150ms. But delay_min can be lowered at any time, so delay_min falls to 100ms. The code executes the HYSTART_DELAY comparison between curr_rtt of 150ms and delay_min of 100ms, and the curr_rtt is declared far enough above delay_min to force a (spurious) exit of Slow start. The fix here is simple: allow every RTT sample in a round trip to lower the curr_rtt. Fixes: ae27e98a5152 ("[TCP] CUBIC v2.3") Reported-by: Mirja Kuehlewind Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 29a30bac564252d732f6c387617a3456e038bdf6 Merge: 33fdef24c9ac 43ce887c5050 Author: David S. Miller Date: Thu Jun 25 16:06:56 2020 -0700 Merge branch 'Fixes-for-SJA1105-DSA-tc-gate-action' Vladimir Oltean says: ==================== Fixes for SJA1105 DSA tc-gate action This small series fixes 2 bugs in the tc-gate implementation: 1. The TAS state machine keeps getting rescheduled even after removing tc-gate actions on all ports. 2. tc-gate actions with only one gate control list entry are installed to hardware with an incorrect interval of zero, which makes the switch erroneously drop those packets (since the configuration is invalid). To keep the code palatable, a forward-declaration was avoided by moving some code around in patch 1/4. I hope that isn't too much of an issue. ==================== Signed-off-by: David S. Miller commit 43ce887c5050a3c213450a3058505f6a06519dd4 Author: Vladimir Oltean Date: Wed Jun 24 16:54:47 2020 +0300 net: dsa: sja1105: fix tc-gate schedule with single element The sja1105_gating_cfg_time_to_interval function does this, as per the comments: /* The gate entries contain absolute times in their e->interval field. Convert * that to proper intervals (i.e. "0, 5, 10, 15" to "5, 5, 5, 5"). */ To perform that task, it iterates over gating_cfg->entries, at each step updating the interval of the _previous_ entry. So one interval remains to be updated at the end of the loop: the last one (since it isn't "prev" for anyone else). But there was an erroneous check, that the last element's interval should not be updated if it's also the only element. I'm not quite sure why that check was there, but it's clearly incorrect, as a tc-gate schedule with a single element would get an e->interval of zero, regardless of the duration requested by the user. The switch wouldn't even consider this configuration as valid: it will just drop all traffic that matches the rule. Fixes: 834f8933d5dd ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links") Reported-by: Xiaoliang Yang Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 82f6896a25ee2471fdf039eb7b286a692d78f504 Author: Vladimir Oltean Date: Wed Jun 24 16:54:46 2020 +0300 net: dsa: sja1105: recalculate gating subschedule after deleting tc-gate rules Currently, tas_data->enabled would remain true even after deleting all tc-gate rules from the switch ports, which would cause the sja1105_tas_state_machine to get unnecessarily scheduled. Also, if there were any errors which would prevent the hardware from enabling the gating schedule, the sja1105_tas_state_machine would continuously detect and print that, spamming the kernel log, even if the rules were subsequently deleted. The rules themselves are _not_ active, because sja1105_init_scheduling does enough of a job to not install the gating schedule in the static config. But the virtual link rules themselves are still present. So call the functions that remove the tc-gate configuration from priv->tas_data.gating_cfg, so that tas_data->enabled can be set to false, and sja1105_tas_state_machine will stop from being scheduled. Fixes: 834f8933d5dd ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 026bdb2b96525edd1fb5cc6f24587ff08d277d5c Author: Vladimir Oltean Date: Wed Jun 24 16:54:45 2020 +0300 net: dsa: sja1105: unconditionally free old gating config Currently sja1105_compose_gating_subschedule is not prepared to be called for the case where we want to recompute the global tc-gate configuration after we've deleted those actions on a port. After deleting the tc-gate actions on the last port, max_cycle_time would become zero, and that would incorrectly prevent sja1105_free_gating_config from getting called. So move the freeing function above the check for the need to apply a new configuration. Fixes: 834f8933d5dd ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit e39109f59614e5646e6c53100a3e7e8f63dd1d2b Author: Vladimir Oltean Date: Wed Jun 24 16:54:44 2020 +0300 net: dsa: sja1105: move sja1105_compose_gating_subschedule at the top It turns out that sja1105_compose_gating_subschedule must also be called from sja1105_vl_delete, to recalculate the overall tc-gate configuration. Currently this is not possible without introducing a forward declaration. So move the function at the top of the file, along with its dependencies. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8b97f9922211c44a739c5cbd9502ecbb9f17f6d1 Author: Misono Tomohiro Date: Thu Jun 25 13:32:42 2020 +0900 hwmon: (acpi_power_meter) Fix potential memory leak in acpi_power_meter_add() Although it rarely happens, we should call free_capabilities() if error happens after read_capabilities() to free allocated strings. Fixes: de584afa5e188 ("hwmon driver for ACPI 4.0 power meters") Signed-off-by: Misono Tomohiro Link: https://lore.kernel.org/r/20200625043242.31175-1-misono.tomohiro@jp.fujitsu.com Signed-off-by: Guenter Roeck commit c17d1a3a8ee4dac7539d5c976b45d9300f6f10bc Author: Weilong Chen Date: Tue Jun 23 12:12:40 2020 +0800 fork: annotate data race in copy_process() KCSAN reported data race reading and writing nr_threads and max_threads. The data race is intentional and benign. This is obvious from the comment above it and based on general consensus when discussing this issue. So there's no need for any heavy atomic or *_ONCE() machinery here. In accordance with the newly introduced data_race() annotation consensus, mark the offending line with data_race(). Here it's actually useful not just to silence KCSAN but to also clearly communicate that the race is intentional. This is especially helpful since nr_threads is otherwise protected by tasklist_lock. BUG: KCSAN: data-race in copy_process / copy_process write to 0xffffffff86205cf8 of 4 bytes by task 14779 on cpu 1: copy_process+0x2eba/0x3c40 kernel/fork.c:2273 _do_fork+0xfe/0x7a0 kernel/fork.c:2421 __do_sys_clone kernel/fork.c:2576 [inline] __se_sys_clone kernel/fork.c:2557 [inline] __x64_sys_clone+0x130/0x170 kernel/fork.c:2557 do_syscall_64+0xcc/0x3a0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xa9 read to 0xffffffff86205cf8 of 4 bytes by task 6944 on cpu 0: copy_process+0x94d/0x3c40 kernel/fork.c:1954 _do_fork+0xfe/0x7a0 kernel/fork.c:2421 __do_sys_clone kernel/fork.c:2576 [inline] __se_sys_clone kernel/fork.c:2557 [inline] __x64_sys_clone+0x130/0x170 kernel/fork.c:2557 do_syscall_64+0xcc/0x3a0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Link: https://groups.google.com/forum/#!msg/syzkaller-upstream-mo deration/thvp7AHs5Ew/aPdYLXfYBQAJ Reported-by: syzbot+52fced2d288f8ecd2b20@syzkaller.appspotmail.com Signed-off-by: Zefan Li Signed-off-by: Weilong Chen Acked-by: Christian Brauner Cc: Qian Cai Cc: Oleg Nesterov Cc: Christian Brauner Cc: Marco Elver [christian.brauner@ubuntu.com: rewrite commit message] Link: https://lore.kernel.org/r/20200623041240.154294-1-chenweilong@huawei.com Signed-off-by: Christian Brauner commit 33fdef24c9ac20c68b71b363e423fbf9ad2bfc1e Author: Claudiu Beznea Date: Wed Jun 24 13:08:18 2020 +0300 net: macb: free resources on failure path of at91ether_open() DMA buffers were not freed on failure path of at91ether_open(). Along with changes for freeing the DMA buffers the enable/disable interrupt instructions were moved to at91ether_start()/at91ether_stop() functions and the operations on at91ether_stop() were done in their reverse order (compared with how is done in at91ether_start()): before this patch the operation order on interface open path was as follows: 1/ alloc DMA buffers 2/ enable tx, rx 3/ enable interrupts and the order on interface close path was as follows: 1/ disable tx, rx 2/ disable interrupts 3/ free dma buffers. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit 0eaf228d574bd82a9aed73e3953bfb81721f4227 Author: Claudiu Beznea Date: Wed Jun 24 13:08:17 2020 +0300 net: macb: call pm_runtime_put_sync on failure path Call pm_runtime_put_sync() on failure path of at91ether_open. Fixes: e6a41c23df0d ("net: macb: ensure interface is not suspended on at91rm9200") Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit e05d57dcb8c71492268ff46ba9bfe9a9cfb1f95d Author: Guo Ren Date: Tue Jun 23 09:50:54 2020 +0000 riscv: Fixup __vdso_gettimeofday broke dynamic ftrace For linux-5.8-rc1, enable ftrace of riscv will cause boot panic: [ 2.388980] Run /sbin/init as init process [ 2.529938] init[39]: unhandled signal 4 code 0x1 at 0x0000003ff449e000 [ 2.531078] CPU: 0 PID: 39 Comm: init Not tainted 5.8.0-rc1-dirty #13 [ 2.532719] epc: 0000003ff449e000 ra : 0000003ff449e954 sp : 0000003fffedb900 [ 2.534005] gp : 00000000000e8528 tp : 0000003ff449d800 t0 : 000000000000001e [ 2.534965] t1 : 000000000000000a t2 : 0000003fffedb89e s0 : 0000003fffedb920 [ 2.536279] s1 : 0000003fffedb940 a0 : 0000003ff43d4b2c a1 : 0000000000000000 [ 2.537334] a2 : 0000000000000001 a3 : 0000000000000000 a4 : fffffffffbad8000 [ 2.538466] a5 : 0000003ff449e93a a6 : 0000000000000000 a7 : 0000000000000000 [ 2.539511] s2 : 0000000000000000 s3 : 0000003ff448412c s4 : 0000000000000010 [ 2.541260] s5 : 0000000000000016 s6 : 00000000000d0a30 s7 : 0000003fffedba70 [ 2.542152] s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000003fffedb960 [ 2.543335] s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000003fffedb8a0 [ 2.544471] t5 : 0000000000000000 t6 : 0000000000000000 [ 2.545730] status: 0000000000004020 badaddr: 00000000464c457f cause: 0000000000000002 [ 2.549867] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 [ 2.551267] CPU: 0 PID: 1 Comm: init Not tainted 5.8.0-rc1-dirty #13 [ 2.552061] Call Trace: [ 2.552626] [] walk_stackframe+0x0/0xc4 [ 2.553486] [] show_stack+0x40/0x4c [ 2.553995] [] dump_stack+0x7a/0x98 [ 2.554615] [] panic+0x114/0x2f4 [ 2.555395] [] do_exit+0x89c/0x8c2 [ 2.555949] [] do_group_exit+0x3a/0x90 [ 2.556715] [] get_signal+0xe2/0x6e6 [ 2.557388] [] do_notify_resume+0x6a/0x37a [ 2.558089] [] ret_from_exception+0x0/0xc "ra:0x3ff449e954" is the return address of "call _mcount" in the prologue of __vdso_gettimeofday(). Without proper relocate, pc jmp to 0x0000003ff449e000 (vdso map base) with a illegal instruction trap. The solution comes from arch/arm64/kernel/vdso/Makefile: CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) - CC_FLAGS_SCS is ShadowCallStack feature in Clang and only implemented for arm64, no use for riscv. Fixes: ad5d1122b82f ("riscv: use vDSO common flow to reduce the latency of the time-related functions") Cc: stable@vger.kernel.org Signed-off-by: Guo Ren Reviewed-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit 502035e284cc7e9efef22b01771d822d49698ab9 Author: Eddie James Date: Tue Jun 9 15:15:54 2020 -0500 i2c: fsi: Fix the port number field in status register The port number field in the status register was not correct, so fix it. Fixes: d6ffb6300116 ("i2c: Add FSI-attached I2C master algorithm") Signed-off-by: Eddie James Signed-off-by: Joel Stanley Signed-off-by: Wolfram Sang commit e93b327dbf3d37f0dfb123b58f9627ad17be652e Author: Vincent Chen Date: Tue Jun 23 13:40:21 2020 +0800 riscv: Add extern declarations for vDSO time-related functions Add extern declarations for vDSO time-related functions to notify the compiler these functions will be used in somewhere to avoid "no previous prototype" compile warning. Reported-by: kernel test robot Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit d0a5fdf4cc83dabcdea668f971b8a2e916437711 Author: Vincent Chen Date: Tue Jun 23 09:24:17 2020 +0800 clk: sifive: allocate sufficient memory for struct __prci_data The (struct __prci_data).hw_clks.hws is an array with dynamic elements. Using struct_size(pd, hw_clks.hws, ARRAY_SIZE(__prci_init_clocks)) instead of sizeof(*pd) to get the correct memory size of struct __prci_data for sifive/fu540-prci. After applying this modifications, the kernel runs smoothly with CONFIG_SLAB_FREELIST_RANDOM enabled on the HiFive unleashed board. Fixes: 30b8e27e3b58 ("clk: sifive: add a driver for the SiFive FU540 PRCI IP block") Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit a0fc3b32893b29a7b3a2771b6d63bae16cb1e8de Author: Vincent Chen Date: Tue Jun 23 09:13:22 2020 +0800 riscv: Add -fPIC option to CFLAGS_vgettimeofday.o The time related vDSO functions use a variable, vdso_data, to access the vDSO data page to get the system time information. Because the vdso_data for CFLAGS_vgettimeofday.o is an external variable defined in vdso.o, the CFLAGS_vgettimeofday.o should be compiled with -fPIC to ensure that vdso_data is addressable. Reported-by: kernel test robot Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit 7a64135f3229a808067e4bd29be15fe6856a9ae6 Author: Jesper Dangaard Brouer Date: Thu Jun 25 16:26:58 2020 +0200 libbpf: Adjust SEC short cut for expected attach type BPF_XDP_DEVMAP Adjust the SEC("xdp_devmap/") prog type prefix to contain a slash "/" for expected attach type BPF_XDP_DEVMAP. This is consistent with other prog types like tracing. Fixes: 2778797037a6 ("libbpf: Add SEC name for xdp programs attached to device map") Suggested-by: Andrii Nakryiko Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159309521882.821855.6873145686353617509.stgit@firesoul commit 52366a107bf0600cf366f5ff3ea1f147b285e41f Merge: 87d93e9a91c7 e9c15badbb7b Author: Linus Torvalds Date: Thu Jun 25 13:02:58 2020 -0700 Merge tag 'fsnotify_for_v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify fixlet from Jan Kara: "A performance improvement to reduce impact of fsnotify for inodes where it isn't used" * tag 'fsnotify_for_v5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fs: Do not check if there is a fsnotify watcher on pseudo inodes commit f4926d513b4c753c3e831dc619466c82ba192fed Merge: 206e732323c2 619ae8e0697a Author: David S. Miller Date: Thu Jun 25 12:52:41 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net, they are: 1) Unaligned atomic access in ipset, from Russell King. 2) Missing module description, from Rob Gill. 3) Patches to fix a module unload causing NULL pointer dereference in xtables, from David Wilder. For the record, I posting here his cover letter explaining the problem: A crash happened on ppc64le when running ltp network tests triggered by "rmmod iptable_mangle". See previous discussion in this thread: https://lists.openwall.net/netdev/2020/06/03/161 . In the crash I found in iptable_mangle_hook() that state->net->ipv4.iptable_mangle=NULL causing a NULL pointer dereference. net->ipv4.iptable_mangle is set to NULL in +iptable_mangle_net_exit() and called when ip_mangle modules is unloaded. A rmmod task was found running in the crash dump. A 2nd crash showed the same problem when running "rmmod iptable_filter" (net->ipv4.iptable_filter=NULL). To fix this I added .pre_exit hook in all iptable_foo.c. The pre_exit will un-register the underlying hook and exit would do the table freeing. The netns core does an unconditional +synchronize_rcu after the pre_exit hooks insuring no packets are in flight that have picked up the pointer before completing the un-register. These patches include changes for both iptables and ip6tables. We tested this fix with ltp running iptables01.sh and iptables01.sh -6 a loop for 72 hours. 4) Add a selftest for conntrack helper assignment, from Florian Westphal. ==================== Signed-off-by: David S. Miller commit 206e732323c2a8e6d11f4125a62c27e60a50a850 Author: Thomas Martitz Date: Thu Jun 25 14:26:03 2020 +0200 net: bridge: enfore alignment for ethernet address The eth_addr member is passed to ether_addr functions that require 2-byte alignment, therefore the member must be properly aligned to avoid unaligned accesses. The problem is in place since the initial merge of multicast to unicast: commit 6db6f0eae6052b70885562e1733896647ec1d807 bridge: multicast to unicast Fixes: 6db6f0eae605 ("bridge: multicast to unicast") Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: David S. Miller Cc: Jakub Kicinski Cc: Felix Fietkau Signed-off-by: Thomas Martitz Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 87d93e9a91c76bcb45112d863ef72aab41e01879 Merge: 908f7d12d3ba 38fd98afeeb7 Author: Linus Torvalds Date: Thu Jun 25 12:38:09 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Several regression fixes from work that landed in the merge window, particularly in the mlx5 driver: - Various static checker and warning fixes - General bug fixes in rvt, qedr, hns, mlx5 and hfi1 - Several regression fixes related to the ECE and QP changes in last cycle - Fixes for a few long standing crashers in CMA, uverbs ioctl, and xrc" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (25 commits) IB/hfi1: Add atomic triggered sleep/wakeup IB/hfi1: Correct -EBUSY handling in tx code IB/hfi1: Fix module use count flaw due to leftover module put calls IB/hfi1: Restore kfree in dummy_netdev cleanup IB/mad: Fix use after free when destroying MAD agent RDMA/mlx5: Protect from kernel crash if XRC_TGT doesn't have udata RDMA/counter: Query a counter before release RDMA/mad: Fix possible memory leak in ib_mad_post_receive_mads() RDMA/mlx5: Fix integrity enabled QP creation RDMA/mlx5: Remove ECE limitation from the RAW_PACKET QPs RDMA/mlx5: Fix remote gid value in query QP RDMA/mlx5: Don't access ib_qp fields in internal destroy QP path RDMA/core: Check that type_attrs is not NULL prior access RDMA/hns: Fix an cmd queue issue when resetting RDMA/hns: Fix a calltrace when registering MR from userspace RDMA/mlx5: Add missed RST2INIT and INIT2INIT steps during ECE handshake RDMA/cma: Protect bind_list and listen_list while finding matching cm id RDMA/qedr: Fix KASAN: use-after-free in ucma_event_handler+0x532 RDMA/efa: Set maximum pkeys device attribute RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq ... commit 2570284060b48f3f79d8f1a2698792f36c385e9a Author: Denis Kirjanov Date: Thu Jun 25 14:51:06 2020 +0300 tcp: don't ignore ECN CWR on pure ACK there is a problem with the CWR flag set in an incoming ACK segment and it leads to the situation when the ECE flag is latched forever the following packetdrill script shows what happens: // Stack receives incoming segments with CE set +0.1 <[ect0] . 11001:12001(1000) ack 1001 win 65535 +0.0 <[ce] . 12001:13001(1000) ack 1001 win 65535 +0.0 <[ect0] P. 13001:14001(1000) ack 1001 win 65535 // Stack repsonds with ECN ECHO +0.0 >[noecn] . 1001:1001(0) ack 12001 +0.0 >[noecn] E. 1001:1001(0) ack 13001 +0.0 >[noecn] E. 1001:1001(0) ack 14001 // Write a packet +0.1 write(3, ..., 1000) = 1000 +0.0 >[ect0] PE. 1001:2001(1000) ack 14001 // Pure ACK received +0.01 <[noecn] W. 14001:14001(0) ack 2001 win 65535 // Since CWR was sent, this packet should NOT have ECE set +0.1 write(3, ..., 1000) = 1000 +0.0 >[ect0] P. 2001:3001(1000) ack 14001 // but Linux will still keep ECE latched here, with packetdrill // flagging a missing ECE flag, expecting // >[ect0] PE. 2001:3001(1000) ack 14001 // in the script In the situation above we will continue to send ECN ECHO packets and trigger the peer to reduce the congestion window. To avoid that we can check CWR on pure ACKs received. v3: - Add a sequence check to avoid sending an ACK to an ACK v2: - Adjusted the comment - move CWR check before checking for unacknowledged packets Signed-off-by: Denis Kirjanov Acked-by: Neal Cardwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 108447fd0d1a34b0929cd26dc637c917a734ebab Author: Sai Prakash Ranjan Date: Thu Jun 25 16:01:23 2020 +0530 arm64: Add KRYO{3,4}XX silver CPU cores to SSB safelist QCOM KRYO{3,4}XX silver/LITTLE CPU cores are based on Cortex-A55 and are SSB safe, hence add them to SSB safelist -> arm64_ssb_cpus[]. Reported-by: Stephen Boyd Signed-off-by: Sai Prakash Ranjan Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20200625103123.7240-1-saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 5a3235e50c0e3219d8659cbec996dae960acfee8 Author: Ard Biesheuvel Date: Thu Jun 25 09:18:16 2020 +0200 net: phy: mscc: avoid skcipher API for single block AES encryption The skcipher API dynamically instantiates the transformation object on request that implements the requested algorithm optimally on the given platform. This notion of optimality only matters for cases like bulk network or disk encryption, where performance can be a bottleneck, or in cases where the algorithm itself is not known at compile time. In the mscc case, we are dealing with AES encryption of a single block, and so neither concern applies, and we are better off using the AES library interface, which is lightweight and safe for this kind of use. Note that the scatterlist API does not permit references to buffers that are located on the stack, so the existing code is incorrect in any case, but avoiding the skcipher and scatterlist APIs entirely is the most straight-forward approach to fixing this. Cc: Antoine Tenart Cc: Andrew Lunn Cc: Florian Fainelli Cc: Heiner Kallweit Cc: "David S. Miller" Cc: Jakub Kicinski Fixes: 28c5107aa904e ("net: phy: mscc: macsec support") Reviewed-by: Eric Biggers Signed-off-by: Ard Biesheuvel Tested-by: Antoine Tenart Signed-off-by: David S. Miller commit 1b52671d79c4b9fdc91a85f99f69b7c91a3b1b71 Merge: 0b8eb629a700 c31244669f57 Author: Jens Axboe Date: Thu Jun 25 12:57:17 2020 -0600 Merge branch 'nvme-5.8' of git://git.infradead.org/nvme into block-5.8 Pull NVMe fixes from Christoph. * 'nvme-5.8' of git://git.infradead.org/nvme: nvme-multipath: fix bogus request queue reference put nvme-multipath: fix deadlock due to head->lock nvme: don't protect ns mutation with ns->head->lock nvme-multipath: fix deadlock between ana_work and scan_work nvme: fix possible deadlock when I/O is blocked nvme-rdma: assign completion vector correctly nvme-loop: initialize tagset numa value to the value of the ctrl nvme-tcp: initialize tagset numa value to the value of the ctrl nvme-pci: initialize tagset numa value to the value of the ctrl nvme-pci: override the value of the controller's numa node nvme: set initial value for controller's numa node commit 7e89e4aaa9ae83107d059c186955484b3aa6eb23 Author: Ivan Mironov Date: Thu Jun 25 21:50:42 2020 +0500 drm/amd/powerplay: Fix NULL dereference in lock_bus() on Vega20 w/o RAS I updated my system with Radeon VII from kernel 5.6 to kernel 5.7, and following started to happen on each boot: ... BUG: kernel NULL pointer dereference, address: 0000000000000128 ... CPU: 9 PID: 1940 Comm: modprobe Tainted: G E 5.7.2-200.im0.fc32.x86_64 #1 Hardware name: System manufacturer System Product Name/PRIME X570-P, BIOS 1407 04/02/2020 RIP: 0010:lock_bus+0x42/0x60 [amdgpu] ... Call Trace: i2c_smbus_xfer+0x3d/0xf0 i2c_default_probe+0xf3/0x130 i2c_detect.isra.0+0xfe/0x2b0 ? kfree+0xa3/0x200 ? kobject_uevent_env+0x11f/0x6a0 ? i2c_detect.isra.0+0x2b0/0x2b0 __process_new_driver+0x1b/0x20 bus_for_each_dev+0x64/0x90 ? 0xffffffffc0f34000 i2c_register_driver+0x73/0xc0 do_one_initcall+0x46/0x200 ? _cond_resched+0x16/0x40 ? kmem_cache_alloc_trace+0x167/0x220 ? do_init_module+0x23/0x260 do_init_module+0x5c/0x260 __do_sys_init_module+0x14f/0x170 do_syscall_64+0x5b/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ... Error appears when some i2c device driver tries to probe for devices using adapter registered by `smu_v11_0_i2c_eeprom_control_init()`. Code supporting this adapter requires `adev->psp.ras.ras` to be not NULL, which is true only when `amdgpu_ras_init()` detects HW support by calling `amdgpu_ras_check_supported()`. Before 9015d60c9ee1, adapter was registered by -> amdgpu_device_ip_init() -> amdgpu_ras_recovery_init() -> amdgpu_ras_eeprom_init() -> smu_v11_0_i2c_eeprom_control_init() after verifying that `adev->psp.ras.ras` is not NULL in `amdgpu_ras_recovery_init()`. Currently it is registered unconditionally by -> amdgpu_device_ip_init() -> pp_sw_init() -> hwmgr_sw_init() -> vega20_smu_init() -> smu_v11_0_i2c_eeprom_control_init() Fix simply adds HW support check (ras == NULL => no support) before calling `smu_v11_0_i2c_eeprom_control_{init,fini}()`. Please note that there is a chance that similar fix is also required for CHIP_ARCTURUS. I do not know whether any actual Arcturus hardware without RAS exist, and whether calling `smu_i2c_eeprom_init()` makes any sense when there is no HW support. Cc: stable@vger.kernel.org Fixes: 9015d60c9ee1 ("drm/amdgpu: Move EEPROM I2C adapter to amdgpu_device") Signed-off-by: Ivan Mironov Tested-by: Bjorn Nostvold Signed-off-by: Alex Deucher commit ebfa440ce38b7e2e04c3124aa89c8a9f4094cf21 Author: Alex Williamson Date: Thu Jun 25 11:04:23 2020 -0600 vfio/pci: Fix SR-IOV VF handling with MMIO blocking SR-IOV VFs do not implement the memory enable bit of the command register, therefore this bit is not set in config space after pci_enable_device(). This leads to an unintended difference between PF and VF in hand-off state to the user. We can correct this by setting the initial value of the memory enable bit in our virtualized config space. There's really no need however to ever fault a user on a VF though as this would only indicate an error in the user's management of the enable bit, versus a PF where the same access could trigger hardware faults. Fixes: abafbc551fdd ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory") Signed-off-by: Alex Williamson commit 908f7d12d3ba51dfe0449b9723199b423f97ca9a Merge: a4d3712b5105 827c4913923e Author: Linus Torvalds Date: Thu Jun 25 09:24:28 2020 -0700 Merge tag 's390-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: - Fix kernel crash on system call single stepping. - Make sure early program check handler is executed with DAT on to avoid an endless program check loop. - Add __GFP_NOWARN flag to debug feature to avoid user triggerable allocation failure messages. * tag 's390-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/debug: avoid kernel warning on too large number of pages s390/kasan: fix early pgm check handler execution s390: fix system call single stepping commit a4d3712b510534ef2ab5b15429aa94283c233a31 Merge: 8be3a53e18e0 220345e98f1c Author: Linus Torvalds Date: Thu Jun 25 09:15:24 2020 -0700 Merge tag 'sound-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes gathered in the last two weeks. The major changes here are fixes for the recent DPCM regressions found on i.MX and Qualcomm platforms and fixes for resource leaks in ASoC DAI registrations. Other than those are mostly device-specific fixes including the usual USB- and HD-audio quirks, and a fix for syzkaller case and ID updates for new Intel platforms" * tag 'sound-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits) ALSA: usb-audio: Fix OOB access of mixer element list ALSA: usb-audio: add quirk for Samsung USBC Headset (AKG) ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Flight S ASoC: rockchip: Fix a reference count leak. ASoC: amd: closing specific instance. ALSA: hda: Intel: add missing PCI IDs for ICL-H, TGL-H and EKL ASoC: hdac_hda: fix memleak with regmap not freed on remove ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H ASoC: SOF: Intel: add PCI ID for CometLake-S ASoC: Intel: SOF: merge COMETLAKE_LP and COMETLAKE_H ALSA: hda/realtek: Add mute LED and micmute LED support for HP systems ALSA: usb-audio: Fix potential use-after-free of streams ALSA: hda/realtek - Add quirk for MSI GE63 laptop ASoC: fsl_ssi: Fix bclk calculation for mono channel ASoC: SOF: Intel: hda: Clear RIRB status before reading WP ASoC: rt1015: Update rt1015 default register value according to spec modification. ASoC: qcom: common: set correct directions for dailinks ASoc: q6afe: add support to get port direction ASoC: soc-pcm: fix checks for multi-cpu FE dailinks ASoC: rt5682: Let dai clks be registered whether mclk exists or not ... commit 59476f80d8781a84e25f0cbcf378ccab1ad7abf8 Author: Arvind Sankar Date: Thu Jun 18 16:43:15 2020 -0400 efi/x86: Only copy upto the end of setup_header When copying the setup_header into the boot_params buffer, only the data that is actually part of the setup_header should be copied. efi_pe_entry() currently copies the entire second sector, which initializes some of the fields in boot_params beyond the setup_header with garbage (i.e. part of the real-mode boot code gets copied into those fields). This does not cause any issues currently because the fields that are overwritten are padding, BIOS EDD information that won't get used, and the E820 table which will get properly filled in later. Fix this to only copy data that is actually part of the setup_header structure. Signed-off-by: Arvind Sankar Signed-off-by: Ard Biesheuvel commit 0bda49f30ca48998102eb0a0b53970c3a3558be0 Author: Arvind Sankar Date: Thu Jun 18 15:10:59 2020 -0400 efi/x86: Remove unused variables Commit 987053a30016 ("efi/x86: Move command-line initrd loading to efi_main") made the ramdisk_addr/ramdisk_size variables in efi_pe_entry unused, but neglected to delete them. Delete these unused variables. Signed-off-by: Arvind Sankar Signed-off-by: Ard Biesheuvel commit b58e733fd774f3f4b49d9e7640d172a57e35200e Author: Peter Zijlstra Date: Mon Jun 15 18:24:27 2020 +0200 rcu: Fixup noinstr warnings A KCSAN build revealed we have explicit annoations through atomic_*() usage, switch to arch_atomic_*() for the respective functions. vmlinux.o: warning: objtool: rcu_nmi_exit()+0x4d: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x25: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_nmi_enter()+0x4f: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0x2a: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: __rcu_is_watching()+0x25: call to __kcsan_check_access() leaves .noinstr.text section Additionally, without the NOP in instrumentation_begin(), objtool would not detect the lack of the 'else instrumentation_begin();' branch in rcu_nmi_enter(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Paul E. McKenney commit 5faafd5685764e4d75376aceac91fdf75b3b16f8 Author: Peter Zijlstra Date: Thu Jun 25 15:55:14 2020 +0200 locking/atomics: Provide the arch_atomic_ interface to generic code Architectures with instrumented (KASAN/KCSAN) atomic operations natively provide arch_atomic_ variants that are not instrumented. It turns out that some generic code also requires arch_atomic_ in order to avoid instrumentation, so provide the arch_atomic_ interface as a direct map into the regular atomic_ interface for non-instrumented architectures. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Paul E. McKenney commit cf961fce30f8269d0c2662c48b2618005b67dfd4 Author: Jarkko Nikula Date: Thu Jun 25 17:00:41 2020 +0300 spi: pxa2xx: Add support for Intel Tiger Lake PCH-H Add Intel Tiger Lake PCH-H PCI IDs. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20200625140041.745804-1-jarkko.nikula@linux.intel.com Signed-off-by: Mark Brown commit f16861b12fa05717489e0c8fbe93a0b9346a6839 Author: Seth Forshee Date: Wed Jun 24 12:10:10 2020 -0500 regulator: rename da903x to da903x-regulator This module shares the same name as its parent PMIC driver, which confuses tools like kmod. Rename the regulator driver to avoid such problems. Signed-off-by: Seth Forshee Link: https://lore.kernel.org/r/20200624171010.845271-1-seth.forshee@canonical.com Signed-off-by: Mark Brown commit a9b59159d338d414acaa8e2f569d129d51c76452 Author: John Fastabend Date: Wed Jun 24 15:20:39 2020 -0700 bpf: Do not allow btf_ctx_access with __int128 types To ensure btf_ctx_access() is safe the verifier checks that the BTF arg type is an int, enum, or pointer. When the function does the BTF arg lookup it uses the calculation 'arg = off / 8' using the fact that registers are 8B. This requires that the first arg is in the first reg, the second in the second, and so on. However, for __int128 the arg will consume two registers by default LLVM implementation. So this will cause the arg layout assumed by the 'arg = off / 8' calculation to be incorrect. Because __int128 is uncommon this patch applies the easiest fix and will force int types to be sizeof(u64) or smaller so that they will fit in a single register. v2: remove unneeded parens per Andrii's feedback Fixes: 9e15db66136a1 ("bpf: Implement accurate raw_tp context access via BTF") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159303723962.11287.13309537171132420717.stgit@john-Precision-5820-Tower commit bc5c7f55f5ea91e137fc7939435ed2e2bb6e5a15 Author: Jaroslav Kysela Date: Thu Jun 25 13:58:29 2020 +0200 AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module Signed-off-by: Jaroslav Kysela Acked-by: Alex Deucher Cc: Mark Brown Cc: vijendar.mukunda@amd.com Cc: Alexander.Deucher@amd.com Link: https://lore.kernel.org/r/20200625115829.791750-1-perex@perex.cz Signed-off-by: Mark Brown commit 8dfe804a4031ca6ba3a3efb2048534249b64f3a5 Author: Jiping Ma Date: Mon May 11 10:52:07 2020 +0800 arm64: perf: Report the PC value in REGS_ABI_32 mode A 32-bit perf querying the registers of a compat task using REGS_ABI_32 will receive zeroes from w15, when it expects to find the PC. Return the PC value for register dwarf register 15 when returning register values for a compat task to perf. Cc: Acked-by: Mark Rutland Signed-off-by: Jiping Ma Link: https://lore.kernel.org/r/1589165527-188401-1-git-send-email-jiping.ma2@windriver.com [will: Shuffled code and added a comment] Signed-off-by: Will Deacon commit d60b5fbc1ce8210759b568da49d149b868e7c6d3 Author: Pavel Begunkov Date: Thu Jun 25 12:37:11 2020 +0300 io_uring: fix current->mm NULL dereference on exit Don't reissue requests from io_iopoll_reap_events(), the task may not have mm, which ends up with NULL. It's better to kill everything off on exit anyway. [ 677.734670] RIP: 0010:io_iopoll_complete+0x27e/0x630 ... [ 677.734679] Call Trace: [ 677.734695] ? __send_signal+0x1f2/0x420 [ 677.734698] ? _raw_spin_unlock_irqrestore+0x24/0x40 [ 677.734699] ? send_signal+0xf5/0x140 [ 677.734700] io_iopoll_getevents+0x12f/0x1a0 [ 677.734702] io_iopoll_reap_events.part.0+0x5e/0xa0 [ 677.734703] io_ring_ctx_wait_and_kill+0x132/0x1c0 [ 677.734704] io_uring_release+0x20/0x30 [ 677.734706] __fput+0xcd/0x230 [ 677.734707] ____fput+0xe/0x10 [ 677.734709] task_work_run+0x67/0xa0 [ 677.734710] do_exit+0x35d/0xb70 [ 677.734712] do_group_exit+0x43/0xa0 [ 677.734713] get_signal+0x140/0x900 [ 677.734715] do_signal+0x37/0x780 [ 677.734717] ? enqueue_hrtimer+0x41/0xb0 [ 677.734718] ? recalibrate_cpu_khz+0x10/0x10 [ 677.734720] ? ktime_get+0x3e/0xa0 [ 677.734721] ? lapic_next_deadline+0x26/0x30 [ 677.734723] ? tick_program_event+0x4d/0x90 [ 677.734724] ? __hrtimer_get_next_event+0x4d/0x80 [ 677.734726] __prepare_exit_to_usermode+0x126/0x1c0 [ 677.734741] prepare_exit_to_usermode+0x9/0x40 [ 677.734742] idtentry_exit_cond_rcu+0x4c/0x60 [ 677.734743] sysvec_reschedule_ipi+0x92/0x160 [ 677.734744] ? asm_sysvec_reschedule_ipi+0xa/0x20 [ 677.734745] asm_sysvec_reschedule_ipi+0x12/0x20 Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit cd664b0e35cb1202f40c259a1a5ea791d18c879d Author: Pavel Begunkov Date: Thu Jun 25 12:37:10 2020 +0300 io_uring: fix hanging iopoll in case of -EAGAIN io_do_iopoll() won't do anything with a request unless req->iopoll_completed is set. So io_complete_rw_iopoll() has to set it, otherwise io_do_iopoll() will poll a file again and again even though the request of interest was completed long time ago. Also, remove -EAGAIN check from io_issue_sqe() as it races with the changed lines. The request will take the long way and be resubmitted from io_iopoll*(). io_kiocb's result and iopoll_completed") Fixes: bbde017a32b3 ("io_uring: add memory barrier to synchronize Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 6a6ca7881b1ab1c13fe0d70bae29211a65dd90de Author: Hui Wang Date: Thu Jun 25 16:38:33 2020 +0800 ALSA: hda - let hs_mic be picked ahead of hp_mic We have a Dell AIO, there is neither internal speaker nor internal mic, only a multi-function audio jack on it. Users reported that after freshly installing the OS and plug a headset to the audio jack, the headset can't output sound. I reproduced this bug, at that moment, the Input Source is as below: Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Headphone Mic' 'Headset Mic' Item0: 'Headphone Mic' That is because the patch_realtek will set this audio jack as mic_in mode if Input Source's value is hp_mic. If it is not fresh installing, this issue will not happen since the systemd will run alsactl restore -f /var/lib/alsa/asound.state, this will set the 'Input Source' according to history value. If there is internal speaker or internal mic, this issue will not happen since there is valid sink/source in the pulseaudio, the PA will set the 'Input Source' according to active_port. To fix this issue, change the parser function to let the hs_mic be stored ahead of hp_mic. Cc: stable@vger.kernel.org Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20200625083833.11264-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai commit 38b1927e5bf9bcad4a2e33189ef1c5569f9599ba Author: Colin Ian King Date: Thu Jun 25 13:44:28 2020 +0100 phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked Currently pointer phy0 is being dereferenced via the assignment of phy on the call to phy_get_drvdata before phy0 is null checked, this can lead to a null pointer dereference. Fix this by performing the null check on phy0 before the call to phy_get_drvdata. Also replace the phy0 == NULL check with the more usual !phy0 idiom. Addresses-Coverity: ("Dereference before null check") Fixes: e6f32efb1b12 ("phy: sun4i-usb: Make sure to disable PHY0 passby for peripheral mode") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200625124428.83564-1-colin.king@canonical.com Signed-off-by: Vinod Koul commit 8b94a4b92327d061327117e127d7d44a4a43e639 Author: Mika Westerberg Date: Thu Apr 2 12:45:34 2020 +0300 thunderbolt: Fix path indices used in USB3 tunnel discovery The USB3 discovery used wrong indices when tunnel is discovered. It should use TB_USB3_PATH_DOWN for path that flows downstream and TB_USB3_PATH_UP when it flows upstream. This should not affect the functionality but better to fix it. Fixes: e6f818585713 ("thunderbolt: Add support for USB 3.x tunnels") Signed-off-by: Mika Westerberg Cc: stable@vger.kernel.org # v5.6+ commit 10e8b11eb3195e11450c509d4dd3984d707a4167 Author: Rafael J. Wysocki Date: Thu Jun 25 13:52:53 2020 +0200 cpuidle: Rearrange s2idle-specific idle state entry code Implement call_cpuidle_s2idle() in analogy with call_cpuidle() for the s2idle-specific idle state entry and invoke it from cpuidle_idle_call() to make the s2idle-specific idle entry code path look more similar to the "regular" idle entry one. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Chen Yu commit 145a773aef83181d47ebab21bb33c89233aadb1e Author: Peter Zijlstra Date: Tue Jun 16 13:28:36 2020 +0200 x86/entry: Fix #UD vs WARN more vmlinux.o: warning: objtool: exc_invalid_op()+0x47: call to probe_kernel_read() leaves .noinstr.text section Since we use UD2 as a short-cut for 'CALL __WARN', treat it as such. Have the bare exception handler do the report_bug() thing. Fixes: 15a416e8aaa7 ("x86/entry: Treat BUG/WARN as NMI-like entries") Signed-off-by: Peter Zijlstra (Intel) Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200622114713.GE577403@hirez.programming.kicks-ass.net commit c7aadc09321d8f9a1d3bd1e6d8a47222ecddf6c5 Author: Peter Zijlstra Date: Wed Jun 17 18:25:57 2020 +0200 x86/entry: Increase entry_stack size to a full page Marco crashed in bad_iret with a Clang11/KCSAN build due to overflowing the stack. Now that we run C code on it, expand it to a full page. Suggested-by: Andy Lutomirski Reported-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Lai Jiangshan Tested-by: Marco Elver Link: https://lkml.kernel.org/r/20200618144801.819246178@infradead.org commit e3a9e681adb779b39565a28b3252c3be1033f994 Author: Peter Zijlstra Date: Wed Jun 17 18:21:16 2020 +0200 x86/entry: Fixup bad_iret vs noinstr vmlinux.o: warning: objtool: fixup_bad_iret()+0x8e: call to memcpy() leaves .noinstr.text section Worse, when KASAN there is no telling what memcpy() actually is. Force the use of __memcpy() which is our assmebly implementation. Reported-by: Marco Elver Suggested-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Tested-by: Marco Elver Link: https://lkml.kernel.org/r/20200618144801.760070502@infradead.org commit 734d099ba644f5a92c70efa3d54d0ba2500ce162 Author: Peter Zijlstra Date: Wed Jun 17 18:22:31 2020 +0200 objtool: Don't consider vmlinux a C-file Avoids issuing C-file warnings for vmlinux. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200618144801.701257527@infradead.org commit acf7b0bf7dcf5a96d9b44a0997227c7210d995c1 Author: Marco Elver Date: Tue Jun 23 13:24:48 2020 +0200 kasan: Fix required compiler version The first working GCC version to satisfy CC_HAS_WORKING_NOSANITIZE_ADDRESS is GCC 8.3.0. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124 Reported-by: Stephen Rothwell Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200623112448.GA208112@elver.google.com commit 2a78b85b70f9c3d450619d369d349ba861320510 Author: Sumit Garg Date: Thu Jun 4 15:31:18 2020 +0530 kdb: Make kdb_printf() console handling more robust While rounding up CPUs via NMIs, its possible that a rounded up CPU maybe holding a console port lock leading to kgdb master CPU stuck in a deadlock during invocation of console write operations. A similar deadlock could also be possible while using synchronous breakpoints. So in order to avoid such a deadlock, set oops_in_progress to encourage the console drivers to disregard their internal spin locks: in the current calling context the risk of deadlock is a bigger problem than risks due to re-entering the console driver. We operate directly on oops_in_progress rather than using bust_spinlocks() because the calls bust_spinlocks() makes on exit are not appropriate for this calling context. Suggested-by: Sergey Senozhatsky Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Reviewed-by: Petr Mladek Link: https://lore.kernel.org/r/1591264879-25920-4-git-send-email-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit e8857288bb620d594c94a219148d18562e52b06e Author: Sumit Garg Date: Thu Jun 4 15:31:17 2020 +0530 kdb: Check status of console prior to invoking handlers Check if a console is enabled prior to invoking corresponding write handler. Suggested-by: Sergey Senozhatsky Signed-off-by: Sumit Garg Reviewed-by: Daniel Thompson Reviewed-by: Douglas Anderson Reviewed-by: Petr Mladek Link: https://lore.kernel.org/r/1591264879-25920-3-git-send-email-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit 9d71b344f86f4264a5fae43c997a630e93c0de9b Author: Sumit Garg Date: Thu Jun 4 15:31:16 2020 +0530 kdb: Re-factor kdb_printf() message write code Re-factor kdb_printf() message write code in order to avoid duplication of code and thereby increase readability. Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Reviewed-by: Petr Mladek Link: https://lore.kernel.org/r/1591264879-25920-2-git-send-email-sumit.garg@linaro.org Signed-off-by: Daniel Thompson commit 0b467b63870d9c05c81456aa9bfee894ab2db3b6 Author: Markus Theil Date: Thu Jun 25 12:42:14 2020 +0200 mac80211: allow rx of mesh eapol frames with default rx key Without this patch, eapol frames cannot be received in mesh mode, when 802.1X should be used. Initially only a MGTK is defined, which is found and set as rx->key, when there are no other keys set. ieee80211_drop_unencrypted would then drop these eapol frames, as they are data frames without encryption and there exists some rx->key. Fix this by differentiating between mesh eapol frames and other data frames with existing rx->key. Allow mesh mesh eapol frames only if they are for our vif address. With this patch in-place, ieee80211_rx_h_mesh_fwding continues after the ieee80211_drop_unencrypted check and notices, that these eapol frames have to be delivered locally, as they should. Signed-off-by: Markus Theil Link: https://lore.kernel.org/r/20200625104214.50319-1-markus.theil@tu-ilmenau.de [small code cleanups] Signed-off-by: Johannes Berg commit 4ab59c3c638c6c8952bf07739805d20eb6358a4d Author: Sumit Semwal Date: Thu Jun 11 17:14:18 2020 +0530 dma-buf: Move dma_buf_release() from fops to dentry_ops Charan Teja reported a 'use-after-free' in dmabuffs_dname [1], which happens if the dma_buf_release() is called while the userspace is accessing the dma_buf pseudo fs's dmabuffs_dname() in another process, and dma_buf_release() releases the dmabuf object when the last reference to the struct file goes away. I discussed with Arnd Bergmann, and he suggested that rather than tying the dma_buf_release() to the file_operations' release(), we can tie it to the dentry_operations' d_release(), which will be called when the last ref to the dentry is removed. The path exercised by __fput() calls f_op->release() first, and then calls dput, which eventually calls d_op->d_release(). In the 'normal' case, when no userspace access is happening via dma_buf pseudo fs, there should be exactly one fd, file, dentry and inode, so closing the fd will kill of everything right away. In the presented case, the dentry's d_release() will be called only when the dentry's last ref is released. Therefore, lets move dma_buf_release() from fops->release() to d_ops->d_release() Many thanks to Arnd for his FS insights :) [1]: https://lore.kernel.org/patchwork/patch/1238278/ Fixes: bb2bb9030425 ("dma-buf: add DMA_BUF_SET_NAME ioctls") Reported-by: syzbot+3643a18836bce555bff6@syzkaller.appspotmail.com Cc: [5.3+] Cc: Arnd Bergmann Reported-by: Charan Teja Reddy Reviewed-by: Arnd Bergmann Signed-off-by: Sumit Semwal Tested-by: Charan Teja Reddy Link: https://patchwork.freedesktop.org/patch/msgid/20200611114418.19852-1-sumit.semwal@linaro.org commit 5af7fef39d7952c0f5551afa7b821ee7b6c9dd3d Author: Markus Theil Date: Wed Jun 17 10:26:36 2020 +0200 mac80211: skip mpath lookup also for control port tx When using 802.1X over mesh networks, at first an ordinary mesh peering is established, then the 802.1X EAPOL dialog happens, afterwards an authenticated mesh peering exchange (AMPE) happens, finally the peering is complete and we can set the STA authorized flag. As 802.1X is an intermediate step here and key material is not yet exchanged for stations we have to skip mesh path lookup for these EAPOL frames. Otherwise the already configure mesh group encryption key would be used to send a mesh path request which no one can decipher, because we didn't already establish key material on both peers, like with SAE and directly using AMPE. Signed-off-by: Markus Theil Link: https://lore.kernel.org/r/20200617082637.22670-2-markus.theil@tu-ilmenau.de [remove pointless braces, remove unnecessary local variable, the list can only process one such frame (or its fragments)] Signed-off-by: Johannes Berg commit 78fb5b541b7ae57ac39187ccb3097e606004cf9b Author: Seevalamuthu Mariappan Date: Tue Jun 9 15:45:54 2020 +0530 mac80211: Fix dropping broadcast packets in 802.11 encap Broadcast pkts like arp are getting dropped in 'ieee80211_8023_xmit'. Fix this by replacing is_valid_ether_addr api with is_zero_ether_addr. Fixes: 50ff477a8639 ("mac80211: add 802.11 encapsulation offloading support") Signed-off-by: Seevalamuthu Mariappan Link: https://lore.kernel.org/r/1591697754-4975-1-git-send-email-seevalam@codeaurora.org Signed-off-by: Johannes Berg commit 01da2e059dc326d02091a62b81a795a393e3719f Author: Pavel Machek Date: Thu Jun 4 23:41:57 2020 +0200 mac80211: simplify mesh code Doing mod_timer() conditionaly is easier than conditionally unlocking and jumping around... Signed-off-by: Pavel Machek (CIP) Acked-by: Linus Lüssing Link: https://lore.kernel.org/r/20200604214157.GA9737@amd Signed-off-by: Johannes Berg commit 86a1b9d7c275a3dba69e7ab099f8d5f71f69f6a8 Author: Markus Theil Date: Mon Jun 22 14:35:42 2020 +0200 mac80211: fix control port tx status check The initial control port tx status patch assumed, that we have IEEE 802.11 frames, but actually ethernet frames are stored in the ack skb. Fix this by checking for the correct ethertype and skb protocol 802.3. Also allow tx status reports for ETH_P_PREAUTH, as preauth frames can also be send over the nl80211 control port. Fixes: a7528198add8 ("mac80211: support control port TX status reporting") Reported-by: Jouni Malinen Signed-off-by: Markus Theil Reported-by: kernel test robot Link: https://lore.kernel.org/r/20200622123542.173695-1-markus.theil@tu-ilmenau.de Signed-off-by: Johannes Berg commit 0c1a7f13c9ec1ceb18d97ef4b1dd20ec71ffba31 Author: Veerendranath Jakkam Date: Wed Jun 17 17:01:32 2020 +0530 ieee80211: Add missing and new AKM suite selector definitions Add the definitions for missing AKM selectors defined in IEEE P802.11-REVmd/D3.0, table 9-151. These definitions will be used by various drivers that support these new AKM suites. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20200617113132.13477-1-vjakkam@codeaurora.org Signed-off-by: Johannes Berg commit 9fbbb7ddd96ed68e75a4e8f194225b5297f62bd4 Author: João H. Spies Date: Tue Jun 23 18:19:45 2020 -0300 MIPS: ingenic: gcw0: Fix HP detection GPIO. Previously marked as active high, but is in reality active low. Cc: stable@vger.kernel.org Fixes: b1bfdb660516 ("MIPS: ingenic: DTS: Update GCW0 support") Signed-off-by: João H. Spies Tested-by: Paul Cercueil Reviewed-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 5b83c254571b26e6b6110019929dc9729e5c59d1 Merge: a1cd3486d7b3 b5b78a6c8d8c Author: Dave Airlie Date: Thu Jun 25 14:51:14 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-06-24' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-06-24: amdgpu: - Fix missed mutex unlock in DC error path - Fix firmware leak for sdma5 - DC bpc property fixes amdkfd: - Fix memleak in an error path radeon: - Fix copy paste typo in NI DPM spll validation Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200624221207.17773-1-alexander.deucher@amd.com commit eb2932b00fc75a154bb4607773dc0666924116ad Merge: a51243860893 20d1f2d1b024 Author: David S. Miller Date: Wed Jun 24 21:51:03 2020 -0700 Merge branch 'net-bcmgenet-use-hardware-padding-of-runt-frames' Doug Berger says: ==================== net: bcmgenet: use hardware padding of runt frames Now that scatter-gather and tx-checksumming are enabled by default it revealed a packet corruption issue that can occur for very short fragmented packets. When padding these frames to the minimum length it is possible for the non-linear (fragment) data to be added to the end of the linear header in an SKB. Since the number of fragments is read before the padding and used afterward without reloading, the fragment that should have been consumed can be tacked on in place of part of the padding. The third commit in this set corrects this by removing the software padding and allowing the hardware to add the pad bytes if necessary. The first two commits resolve warnings observed by the kbuild test robot and are included here for simplicity of application. ==================== Signed-off-by: David S. Miller commit 20d1f2d1b024f6be199a3bedf1578a1d21592bc5 Author: Doug Berger Date: Wed Jun 24 18:14:55 2020 -0700 net: bcmgenet: use hardware padding of runt frames When commit 474ea9cafc45 ("net: bcmgenet: correctly pad short packets") added the call to skb_padto() it should have been located before the nr_frags parameter was read since that value could be changed when padding packets with lengths between 55 and 59 bytes (inclusive). The use of a stale nr_frags value can cause corruption of the pad data when tx-scatter-gather is enabled. This corruption of the pad can cause invalid checksum computation when hardware offload of tx-checksum is also enabled. Since the original reason for the padding was corrected by commit 7dd399130efb ("net: bcmgenet: fix skb_len in bcmgenet_xmit_single()") we can remove the software padding all together and make use of hardware padding of short frames as long as the hardware also always appends the FCS value to the frame. Fixes: 474ea9cafc45 ("net: bcmgenet: correctly pad short packets") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit d966d2efb643a8ba925e910bfc10e19c8b018de7 Author: Doug Berger Date: Wed Jun 24 18:14:54 2020 -0700 net: bcmgenet: use __be16 for htons(ETH_P_IP) The 16-bit value that holds a short in network byte order should be declared as a restricted big endian type to allow type checks to succeed during assignment. Fixes: 3e370952287c ("net: bcmgenet: add support for ethtool rxnfc flows") Reported-by: kbuild test robot Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 673bafd5b8b0ec9b1e2eedca2a2be6b44ee5ba9c Author: Doug Berger Date: Wed Jun 24 18:14:53 2020 -0700 net: bcmgenet: re-remove bcmgenet_hfb_add_filter This function was originally removed by Baoyou Xie in commit e2072600a241 ("net: bcmgenet: remove unused function in bcmgenet.c") to prevent a build warning. Some of the functions removed by Baoyou Xie are now used for WAKE_FILTER support so his commit was reverted, but this function is still unused and the kbuild test robot dutifully reported the warning. This commit once again removes the remaining unused hfb functions. Fixes: 14da1510fedc ("Revert "net: bcmgenet: remove unused function in bcmgenet.c"") Reported-by: kbuild test robot Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit a1cd3486d7b37dbdc76ac0770a22e763c4d4271f Merge: 5107683f24d4 fce3a51d9b31 Author: Dave Airlie Date: Thu Jun 25 14:17:18 2020 +1000 Merge tag 'drm/tegra/for-5.8-rc3' of git://anongit.freedesktop.org/tegra/linux into drm-fixes drm/tegra: Fixes for v5.8-rc3 This contains a fairly random assortment of fixes for various minor issues. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20200624165254.2763104-1-thierry.reding@gmail.com commit 5107683f24d458afd94f56f7d7e256b1aa5a673d Merge: 48778464bb7d 5f9af404eec8 Author: Dave Airlie Date: Thu Jun 25 12:46:51 2020 +1000 Merge tag 'du-fixes-20200621' of git://linuxtv.org/pinchartl/media into drm-fixes Build fix for the R-Car DU DRM driver Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20200621021720.GA1569@pendragon.ideasonboard.com commit 20c59ce010f84300f6c655d32db2610d3433f85c Author: Maurizio Drocco Date: Tue Jun 23 11:57:32 2020 -0400 ima: extend boot_aggregate with kernel measurements Registers 8-9 are used to store measurements of the kernel and its command line (e.g., grub2 bootloader with tpm module enabled). IMA should include them in the boot aggregate. Registers 8-9 should be only included in non-SHA1 digests to avoid ambiguity. Signed-off-by: Maurizio Drocco Reviewed-by: Bruno Meneguele Tested-by: Bruno Meneguele (TPM 1.2, TPM 2.0) Signed-off-by: Mimi Zohar commit 8be3a53e18e0e1a98f288f6c7f5e9da3adbe9c49 Merge: fc10807db5ce 3c597282887f Author: Linus Torvalds Date: Wed Jun 24 17:39:30 2020 -0700 Merge tag 'erofs-for-5.8-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fix from Gao Xiang: "Fix a regression which uses potential uninitialized high 32-bit value unexpectedly recently observed with specific compiler options" * tag 'erofs-for-5.8-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix partially uninitialized misuse in z_erofs_onlinepage_fixup commit 619ae8e0697a6fb85b99b19137590c7c337c579e Author: Florian Westphal Date: Mon Jun 22 10:28:32 2020 +0200 selftests: netfilter: add test case for conntrack helper assignment check that 'nft ... ct helper set ' works: 1. configure ftp helper via nft and assign it to connections on port 2121 2. check with 'conntrack -L' that the next connection has the ftp helper attached to it. Also add a test for auto-assign (old behaviour). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 5f027bc74a9be2e53233de4ebcd2f90390b50a62 Author: David Wilder Date: Mon Jun 22 10:10:14 2020 -0700 netfilter: ip6tables: Add a .pre_exit hook in all ip6table_foo.c. Using new helpers ip6t_unregister_table_pre_exit() and ip6t_unregister_table_exit(). Fixes: b9e69e127397 ("netfilter: xtables: don't hook tables by default") Signed-off-by: David Wilder Signed-off-by: Pablo Neira Ayuso commit 57ea5f18882a3d7cf6135fa8c949a37c89395837 Author: David Wilder Date: Mon Jun 22 10:10:13 2020 -0700 netfilter: ip6tables: Split ip6t_unregister_table() into pre_exit and exit helpers. The pre_exit will un-register the underlying hook and .exit will do the table freeing. The netns core does an unconditional synchronize_rcu after the pre_exit hooks insuring no packets are in flight that have picked up the pointer before completing the un-register. Fixes: b9e69e127397 ("netfilter: xtables: don't hook tables by default") Signed-off-by: David Wilder Signed-off-by: Pablo Neira Ayuso commit cf4cbc610bfa29a88cd71ca638a890f8c565a22e Author: David Wilder Date: Mon Jun 22 10:10:12 2020 -0700 netfilter: iptables: Add a .pre_exit hook in all iptable_foo.c. Using new helpers ipt_unregister_table_pre_exit() and ipt_unregister_table_exit(). Fixes: b9e69e127397 ("netfilter: xtables: don't hook tables by default") Signed-off-by: David Wilder Signed-off-by: Pablo Neira Ayuso commit 1cbf90985f7448f1b0dd630e17ee1070f7d58665 Author: David Wilder Date: Mon Jun 22 10:10:11 2020 -0700 netfilter: iptables: Split ipt_unregister_table() into pre_exit and exit helpers. The pre_exit will un-register the underlying hook and .exit will do the table freeing. The netns core does an unconditional synchronize_rcu after the pre_exit hooks insuring no packets are in flight that have picked up the pointer before completing the un-register. Fixes: b9e69e127397 ("netfilter: xtables: don't hook tables by default") Signed-off-by: David Wilder Signed-off-by: Pablo Neira Ayuso commit 4cacc39516784670aa09833a9ec8bf3e90bef561 Author: Rob Gill Date: Sun Jun 21 05:27:36 2020 +0000 netfilter: Add MODULE_DESCRIPTION entries to kernel modules The user tool modinfo is used to get information on kernel modules, including a description where it is available. This patch adds a brief MODULE_DESCRIPTION to netfilter kernel modules (descriptions taken from Kconfig file or code comments) Signed-off-by: Rob Gill Signed-off-by: Pablo Neira Ayuso commit 715028460082d07a7ec6fcd87b14b46784346a72 Author: Russell King Date: Wed Jun 10 21:51:11 2020 +0100 netfilter: ipset: fix unaligned atomic access When using ip_set with counters and comment, traffic causes the kernel to panic on 32-bit ARM: Alignment trap: not handling instruction e1b82f9f at [] Unhandled fault: alignment exception (0x221) at 0xea08133c PC is at ip_set_match_extensions+0xe0/0x224 [ip_set] The problem occurs when we try to update the 64-bit counters - the faulting address above is not 64-bit aligned. The problem occurs due to the way elements are allocated, for example: set->dsize = ip_set_elem_len(set, tb, 0, 0); map = ip_set_alloc(sizeof(*map) + elements * set->dsize); If the element has a requirement for a member to be 64-bit aligned, and set->dsize is not a multiple of 8, but is a multiple of four, then every odd numbered elements will be misaligned - and hitting an atomic64_add() on that element will cause the kernel to panic. ip_set_elem_len() must return a size that is rounded to the maximum alignment of any extension field stored in the element. This change ensures that is the case. Fixes: 95ad1f4a9358 ("netfilter: ipset: Fix extension alignment") Signed-off-by: Russell King Acked-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit b5b78a6c8d8cb9c307bc6b16a754603424459d6e Author: Bernard Zhao Date: Sat Jun 20 17:11:52 2020 +0800 drm/amd: fix potential memleak in err branch The function kobject_init_and_add alloc memory like: kobject_init_and_add->kobject_add_varg->kobject_set_name_vargs ->kvasprintf_const->kstrdup_const->kstrdup->kmalloc_track_caller ->kmalloc_slab, in err branch this memory not free. If use kmemleak, this path maybe catched. These changes are to add kobject_put in kobject_init_and_add failed branch, fix potential memleak. Signed-off-by: Bernard Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit fa7041d9d2fc7401cece43f305eb5b87b7017fc4 Author: Stylon Wang Date: Fri Jun 12 19:04:18 2020 +0800 drm/amd/display: Fix ineffective setting of max bpc property [Why] Regression was introduced where setting max bpc property has no effect on the atomic check and final commit. It has the same effect as max bpc being stuck at 8. [How] Correctly propagate max bpc with the new connector state. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 5ae9c378c3d88b40af72f8e8f961808e29f3e70b Author: Stylon Wang Date: Mon Jun 1 16:12:09 2020 +0800 drm/amd/display: Enable output_bpc property on all outputs [Why] Connector property output_bpc is available on DP/eDP only. New IGT tests would benifit if this property works on HDMI. [How] Enable this read-only property on all types of connectors. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit edfaf6fa73f15568d4337f208b2333f647c35810 Author: Wenhui Sheng Date: Thu Jun 18 15:37:04 2020 +0800 drm/amdgpu: add fw release for sdma v5_0 sdma fw isn't released when module exit Reviewed-by: Hawking Zhang Signed-off-by: Wenhui Sheng Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit a51243860893615b457b149da1ef5df0a4f1ffc2 Author: Colin Ian King Date: Wed Jun 24 11:13:02 2020 +0100 qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE The error DBG_STATUS_NO_MATCHING_FRAMING_MODE was added to the enum enum dbg_status however there is a missing corresponding entry for this in the array s_status_str. This causes an out-of-bounds read when indexing into the last entry of s_status_str. Fix this by adding in the missing entry. Addresses-Coverity: ("Out-of-bounds read"). Fixes: 2d22bc8354b1 ("qed: FW 8.42.2.0 debug features") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 482f3bae5bf33522041590c0fde51c3e9651349f Merge: 41c2b6b4f0f8 9886a4dbd2aa Author: David S. Miller Date: Wed Jun 24 14:52:49 2020 -0700 Merge branch 'net-phy-call-phy_disable_interrupts-in-phy_init_hw' Jisheng Zhang says: ==================== net: phy: call phy_disable_interrupts() in phy_init_hw() We face an issue with rtl8211f, a pin is shared between INTB and PMEB, and the PHY Register Accessible Interrupt is enabled by default, so the INTB/PMEB pin is always active in polling mode case. As Heiner pointed out "I was thinking about calling phy_disable_interrupts() in phy_init_hw(), to have a defined init state as we don't know in which state the PHY is if the PHY driver is loaded. We shouldn't assume that it's the chip power-on defaults, BIOS or boot loader could have changed this. Or in case of dual-boot systems the other OS could leave the PHY in whatever state." patch1 makes phy_disable_interrupts() non-static so that it could be used in phy_init_hw() to have a defined init state. patch2 calls phy_disable_interrupts() in phy_init_hw() to have a defined init state. Since v3: - call phy_disable_interrupts() have interrupts disabled first then config_init, thank Florian Since v2: - Don't export phy_disable_interrupts() but just make it non-static Since v1: - EXPORT the correct symbol ==================== Signed-off-by: David S. Miller commit 9886a4dbd2aacf4b044e294e4cdebb43992d44b1 Author: Jisheng Zhang Date: Wed Jun 24 15:59:23 2020 +0800 net: phy: call phy_disable_interrupts() in phy_init_hw() Call phy_disable_interrupts() in phy_init_hw() to "have a defined init state as we don't know in which state the PHY is if the PHY driver is loaded. We shouldn't assume that it's the chip power-on defaults, BIOS or boot loader could have changed this. Or in case of dual-boot systems the other OS could leave the PHY in whatever state." as pointed out by Heiner. Suggested-by: Heiner Kallweit Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 3dd4ef1bdbac959bb20faec93937720ddd9917c6 Author: Jisheng Zhang Date: Wed Jun 24 15:58:24 2020 +0800 net: phy: make phy_disable_interrupts() non-static We face an issue with rtl8211f, a pin is shared between INTB and PMEB, and the PHY Register Accessible Interrupt is enabled by default, so the INTB/PMEB pin is always active in polling mode case. As Heiner pointed out "I was thinking about calling phy_disable_interrupts() in phy_init_hw(), to have a defined init state as we don't know in which state the PHY is if the PHY driver is loaded. We shouldn't assume that it's the chip power-on defaults, BIOS or boot loader could have changed this. Or in case of dual-boot systems the other OS could leave the PHY in whatever state." Make phy_disable_interrupts() non-static so that it could be used in phy_init_hw() to have a defined init state. Suggested-by: Heiner Kallweit Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 41c2b6b4f0f807803bb49f65835d136941a70f85 Author: Sascha Hauer Date: Wed Jun 24 09:00:45 2020 +0200 net: ethernet: mvneta: Add back interface mode validation When writing the serdes configuration register was moved to mvneta_config_interface() the whole code block was removed from mvneta_port_power_up() in the assumption that its only purpose was to write the serdes configuration register. As mentioned by Russell King its purpose was also to check for valid interface modes early so that later in the driver we do not have to care for unexpected interface modes. Add back the test to let the driver bail out early on unhandled interface modes. Fixes: b4748553f53f ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy") Signed-off-by: Sascha Hauer Reviewed-by: Russell King Signed-off-by: David S. Miller commit d3d239dcb8aae6d7b10642d292b404e57604f7ea Author: Sascha Hauer Date: Wed Jun 24 09:00:44 2020 +0200 net: ethernet: mvneta: Do not error out in non serdes modes In mvneta_config_interface() the RGMII modes are catched by the default case which is an error return. The RGMII modes are valid modes for the driver, so instead of returning an error add a break statement to return successfully. This avoids this warning for non comphy SoCs which use RGMII, like SolidRun Clearfog: WARNING: CPU: 0 PID: 268 at drivers/net/ethernet/marvell/mvneta.c:3512 mvneta_start_dev+0x220/0x23c Fixes: b4748553f53f ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy") Signed-off-by: Sascha Hauer Reviewed-by: Russell King Signed-off-by: David S. Miller commit 1ed9ec9b08addbd8d3e36d5f4a652d8590a6ddb7 Author: Daniel Mack Date: Sat Jun 20 21:39:25 2020 +0200 dsa: Allow forwarding of redirected IGMP traffic The driver for Marvell switches puts all ports in IGMP snooping mode which results in all IGMP/MLD frames that ingress on the ports to be forwarded to the CPU only. The bridge code in the kernel can then interpret these frames and act upon them, for instance by updating the mdb in the switch to reflect multicast memberships of stations connected to the ports. However, the IGMP/MLD frames must then also be forwarded to other ports of the bridge so external IGMP queriers can track membership reports, and external multicast clients can receive query reports from foreign IGMP queriers. Currently, this is impossible as the EDSA tagger sets offload_fwd_mark on the skb when it unwraps the tagged frames, and that will make the switchdev layer prevent the skb from egressing on any other port of the same switch. To fix that, look at the To_CPU code in the DSA header and make forwarding of the frame possible for trapped IGMP packets. Introduce some #defines for the frame types to make the code a bit more comprehensive. This was tested on a Marvell 88E6352 variant. Signed-off-by: Daniel Mack Reviewed-by: Andrew Lunn Tested-by: Andrew Lunn Signed-off-by: David S. Miller commit 17843655708e1941c0653af3cd61be6948e36f43 Author: Lorenzo Bianconi Date: Tue Jun 23 18:33:15 2020 +0200 openvswitch: take into account de-fragmentation/gso_size in execute_check_pkt_len ovs connection tracking module performs de-fragmentation on incoming fragmented traffic. Take info account if traffic has been de-fragmented in execute_check_pkt_len action otherwise we will perform the wrong nested action considering the original packet size. This issue typically occurs if ovs-vswitchd adds a rule in the pipeline that requires connection tracking (e.g. OVN stateful ACLs) before execute_check_pkt_len action. Moreover take into account GSO fragment size for GSO packet in execute_check_pkt_len routine Fixes: 4d5ec89fc8d14 ("net: openvswitch: Add a new action check_pkt_len") Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit fc10807db5ced090d83cec167e87c95a47452d24 Merge: fbb58011fdd9 cb91909e48a4 Author: Linus Torvalds Date: Wed Jun 24 14:26:28 2020 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Fixes all over the place. This includes a couple of tests that I would normally defer, but since they have already been helpful in catching some bugs, don't build for any users at all, and having them upstream makes life easier for everyone, I think it's ok even at this late stage" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: tools/virtio: Use tools/include/list.h instead of stubs tools/virtio: Reset index in virtio_test --reset. tools/virtio: Extract virtqueue initialization in vq_reset tools/virtio: Use __vring_new_virtqueue in virtio_test.c tools/virtio: Add --reset tools/virtio: Add --batch=random option tools/virtio: Add --batch option virtio-mem: add memory via add_memory_driver_managed() virtio-mem: silence a static checker warning vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap() vdpa: fix typos in the comments for __vdpa_alloc_device() commit fbb58011fdd9ca2e2f0e329d11085ddf46830c5a Merge: 26e122e97a3d 86f56395feb2 Author: Linus Torvalds Date: Wed Jun 24 14:19:45 2020 -0700 Merge tag 'for-linus-2020-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull thread fix from Christian Brauner: "This fixes a regression introduced with 303cc571d107 ("nsproxy: attach to namespaces via pidfds"). The LTP testsuite reported a regression where users would now see EBADF returned instead of EINVAL when an fd was passed that referred to an open file but the file was not a namespace file. Fix this by continuing to report EINVAL and add a regression test" * tag 'for-linus-2020-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: tests: test for setns() EINVAL regression nsproxy: restore EINVAL for non-namespace file descriptor commit dc5bdb68b5b369d5bc7d1de96fa64cc1737a6320 Author: Daniel Vetter Date: Wed Jun 24 11:29:10 2020 +0200 drm/fb-helper: Fix vt restore In the past we had a pile of hacks to orchestrate access between fbdev emulation and native kms clients. We've tried to streamline this, by always preferring the kms side above fbdev calls when a drm master exists, because drm master controls access to the display resources. Unfortunately this breaks existing userspace, specifically Xorg. When exiting Xorg first restores the console to text mode using the KDSET ioctl on the vt. This does nothing, because a drm master is still around. Then it drops the drm master status, which again does nothing, because logind is keeping additional drm fd open to be able to orchestrate vt switches. In the past this is the point where fbdev was restored, as part of the ->lastclose hook on the drm side. Now to fix this regression we don't want to go back to letting fbdev restore things whenever it feels like, or to the pile of hacks we've had before. Instead try and go with a minimal exception to make the KDSET case work again, and nothing else. This means that if userspace does a KDSET call when switching between graphical compositors, there will be some flickering with fbcon showing up for a bit. But a) that's not a regression and b) userspace can fix it by improving the vt switching dance - logind should have all the information it needs. While pondering all this I'm also wondering wheter we should have a SWITCH_MASTER ioctl to allow race-free master status handover. But that's for another day. v2: Somehow forgot to cc all the fbdev people. v3: Fix typo Alex spotted. Reviewed-by: Alex Deucher Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208179 Cc: shlomo@fastmail.com Reported-and-Tested-by: shlomo@fastmail.com Cc: Michel Dänzer Fixes: 64914da24ea9 ("drm/fbdev-helper: don't force restores") Cc: Noralf Trønnes Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.7+ Cc: Bartlomiej Zolnierkiewicz Cc: Geert Uytterhoeven Cc: Nathan Chancellor Cc: Qiujun Huang Cc: Peter Rosin Cc: linux-fbdev@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200624092910.3280448-1-daniel.vetter@ffwll.ch commit 38fd98afeeb79d3b148db49f81f2ec6a37a4ee00 Author: Mike Marciniszyn Date: Tue Jun 23 16:43:28 2020 -0400 IB/hfi1: Add atomic triggered sleep/wakeup When running iperf in a two host configuration the following trace can occur: [ 319.728730] NETDEV WATCHDOG: ib0 (hfi1): transmit queue 0 timed out The issue happens because the current implementation relies on the netif txq being stopped to control the flushing of the tx list. There are two resources that the transmit logic can wait on and stop the txq: - SDMA descriptors - Ring space to hold completions The ring space is tested on the sending side and relieved when the ring is consumed in the napi tx reaping. Unfortunately, that reaping can run conncurrently with the workqueue flushing of the txlist. If the txq is started just before the workitem executes, the txlist will never be flushed, leading to the txq being stuck. Fix by: - Adding sleep/wakeup wrappers * Use an atomic to control the call to the netif routines inside the wrappers - Use another atomic to record ring space exhaustion * Only wakeup when the a ring space exhaustion has happened and it relieved Add additional wrappers to clarify the ring space resource handling. Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets") Link: https://lore.kernel.org/r/20200623204327.108092.4024.stgit@awfm-01.aw.intel.com Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 82172b765530f84b4b9da929f2dcf46f2b7b232b Author: Mike Marciniszyn Date: Tue Jun 23 16:43:22 2020 -0400 IB/hfi1: Correct -EBUSY handling in tx code The current code mishandles -EBUSY in two ways: - The flow change doesn't test the return from the flush and runs on to process the current packet racing with the wakeup processing - The -EBUSY handling for a single packet inserts the tx into the txlist after the submit call, racing with the same wakeup processing Fix the first by dropping the skb and returning NETDEV_TX_OK. Fix the second by insuring the the list entry within the txreq is inited when allocated. This enables the sleep routine to detect that the txreq has used the non-list api and queue the packet to the txlist. Both flaws can lead to having the flushing thread executing in causing two threads to manipulate the txlist. Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets") Link: https://lore.kernel.org/r/20200623204321.108092.83898.stgit@awfm-01.aw.intel.com Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 822fbd37410639acdae368ea55477ddd3498651d Author: Dennis Dalessandro Date: Tue Jun 23 16:32:30 2020 -0400 IB/hfi1: Fix module use count flaw due to leftover module put calls When the try_module_get calls were removed from opening and closing of the i2c debugfs file, the corresponding module_put calls were missed. This results in an inaccurate module use count that requires a power cycle to fix. Fixes: 09fbca8e6240 ("IB/hfi1: No need to use try_module_get for debugfs") Link: https://lore.kernel.org/r/20200623203230.106975.76240.stgit@awfm-01.aw.intel.com Cc: Reviewed-by: Kaike Wan Reviewed-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit b46925a24a9ca7db03655657565e03d2de3027c8 Author: Dennis Dalessandro Date: Tue Jun 23 16:32:24 2020 -0400 IB/hfi1: Restore kfree in dummy_netdev cleanup We need to do some rework on the dummy netdev. Calling the free_netdev() would normally make sense, and that will be addressed in an upcoming patch. For now just revert the behavior to what it was before keeping the unused variable removal part of the patch. The dd->dumm_netdev is mainly used for packet receiving through alloc_netdev_mqs() for typical net devices. A a result, it should be freed with kfree instead of free_netdev() that leads to a crash when unloading the hfi1 module: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 8000000855b54067 P4D 8000000855b54067 PUD 84a4f5067 PMD 0 Oops: 0000 [#1] SMP PTI CPU: 73 PID: 10299 Comm: modprobe Not tainted 5.6.0-rc5+ #1 Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0016.033120161139 03/31/2016 RIP: 0010:__hw_addr_flush+0x12/0x80 Code: 40 00 48 83 c4 08 4c 89 e7 5b 5d 41 5c e9 76 77 18 00 66 0f 1f 44 00 00 0f 1f 44 00 00 41 54 49 89 fc 55 53 48 8b 1f 48 39 df <48> 8b 2b 75 08 eb 4a 48 89 eb 48 89 c5 48 89 df e8 99 bf d0 ff 84 RSP: 0018:ffffb40e08783db8 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000002 RDX: ffffb40e00000000 RSI: 0000000000000246 RDI: ffff88ab13662298 RBP: ffff88ab13662000 R08: 0000000000001549 R09: 0000000000001549 R10: 0000000000000001 R11: 0000000000aaaaaa R12: ffff88ab13662298 R13: ffff88ab1b259e20 R14: ffff88ab1b259e42 R15: 0000000000000000 FS: 00007fb39b534740(0000) GS:ffff88b31f940000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000084d3ea004 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: dev_addr_flush+0x15/0x30 free_netdev+0x7e/0x130 hfi1_netdev_free+0x59/0x70 [hfi1] remove_one+0x65/0x110 [hfi1] pci_device_remove+0x3b/0xc0 device_release_driver_internal+0xec/0x1b0 driver_detach+0x46/0x90 bus_remove_driver+0x58/0xd0 pci_unregister_driver+0x26/0xa0 hfi1_mod_cleanup+0xc/0xd54 [hfi1] __x64_sys_delete_module+0x16c/0x260 ? exit_to_usermode_loop+0xa4/0xc0 do_syscall_64+0x5b/0x200 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 193ba03141bb ("IB/hfi1: Use free_netdev() in hfi1_netdev_free()") Link: https://lore.kernel.org/r/20200623203224.106975.16926.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 016983d138cbe99a5c0aaae0103ee88f5300beb3 Author: Chu Lin Date: Tue Jun 23 22:13:08 2020 +0000 hwmon: (max6697) Make sure the OVERT mask is set correctly Per the datasheet for max6697, OVERT mask and ALERT mask are different. For example, the 7th bit of OVERT is the local channel but for alert mask, the 6th bit is the local channel. Therefore, we can't apply the same mask for both registers. In addition to that, the max6697 driver is supposed to be compatibale with different models. I manually went over all the listed chips and made sure all chip types have the same layout. Testing; mask value of 0x9 should map to 0x44 for ALERT and 0x84 for OVERT. I used iotool to read the reg value back to verify. I only tested this change on max6581. Reference: https://datasheets.maximintegrated.com/en/ds/MAX6581.pdf https://datasheets.maximintegrated.com/en/ds/MAX6697.pdf https://datasheets.maximintegrated.com/en/ds/MAX6699.pdf Signed-off-by: Chu Lin Fixes: 5372d2d71c46e ("hwmon: Driver for Maxim MAX6697 and compatibles") Signed-off-by: Guenter Roeck commit c31244669f57963b6ce133a5555b118fc50aec95 Author: Sagi Grimberg Date: Wed Jun 24 01:53:12 2020 -0700 nvme-multipath: fix bogus request queue reference put The mpath disk node takes a reference on the request mpath request queue when adding live path to the mpath gendisk. However if we connected to an inaccessible path device_add_disk is not called, so if we disconnect and remove the mpath gendisk we endup putting an reference on the request queue that was never taken [1]. Fix that to check if we ever added a live path (using NVME_NS_HEAD_HAS_DISK flag) and if not, clear the disk->queue reference. [1]: ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 1 PID: 1372 at lib/refcount.c:28 refcount_warn_saturate+0xa6/0xf0 CPU: 1 PID: 1372 Comm: nvme Tainted: G O 5.7.0-rc2+ #3 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1 04/01/2014 RIP: 0010:refcount_warn_saturate+0xa6/0xf0 RSP: 0018:ffffb29e8053bdc0 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8b7a2f4fc060 RCX: 0000000000000007 RDX: 0000000000000007 RSI: 0000000000000092 RDI: ffff8b7a3ec99980 RBP: ffff8b7a2f4fc000 R08: 00000000000002e1 R09: 0000000000000004 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 R13: fffffffffffffff2 R14: ffffb29e8053bf08 R15: ffff8b7a320e2da0 FS: 00007f135d4ca800(0000) GS:ffff8b7a3ec80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005651178c0c30 CR3: 000000003b650005 CR4: 0000000000360ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: disk_release+0xa2/0xc0 device_release+0x28/0x80 kobject_put+0xa5/0x1b0 nvme_put_ns_head+0x26/0x70 [nvme_core] nvme_put_ns+0x30/0x60 [nvme_core] nvme_remove_namespaces+0x9b/0xe0 [nvme_core] nvme_do_delete_ctrl+0x43/0x5c [nvme_core] nvme_sysfs_delete.cold+0x8/0xd [nvme_core] kernfs_fop_write+0xc1/0x1a0 vfs_write+0xb6/0x1a0 ksys_write+0x5f/0xe0 do_syscall_64+0x52/0x1a0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Reported-by: Anton Eidelman Tested-by: Anton Eidelman Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit d8a22f85609fadb46ba699e0136cc3ebdeebff79 Author: Anton Eidelman Date: Wed Jun 24 01:53:11 2020 -0700 nvme-multipath: fix deadlock due to head->lock In the following scenario scan_work and ana_work will deadlock: When scan_work calls nvme_mpath_add_disk() this holds ana_lock and invokes nvme_parse_ana_log(), which may issue IO in device_add_disk() and hang waiting for an accessible path. While nvme_mpath_set_live() only called when nvme_state_is_live(), a transition may cause NVME_SC_ANA_TRANSITION and requeue the IO. Since nvme_mpath_set_live() holds ns->head->lock, an ana_work on ANY ctrl will not be able to complete nvme_mpath_set_live() on the same ns->head, which is required in order to update the new accessible path and remove NVME_NS_ANA_PENDING.. Therefore IO never completes: deadlock [1]. Fix: Move device_add_disk out of the head->lock and protect it with an atomic test_and_set for a new NVME_NS_HEAD_HAS_DISK bit. [1]: kernel: INFO: task kworker/u8:2:160 blocked for more than 120 seconds. kernel: Tainted: G OE 5.3.5-050305-generic #201910071830 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kernel: kworker/u8:2 D 0 160 2 0x80004000 kernel: Workqueue: nvme-wq nvme_ana_work [nvme_core] kernel: Call Trace: kernel: __schedule+0x2b9/0x6c0 kernel: schedule+0x42/0xb0 kernel: schedule_preempt_disabled+0xe/0x10 kernel: __mutex_lock.isra.0+0x182/0x4f0 kernel: __mutex_lock_slowpath+0x13/0x20 kernel: mutex_lock+0x2e/0x40 kernel: nvme_update_ns_ana_state+0x22/0x60 [nvme_core] kernel: nvme_update_ana_state+0xca/0xe0 [nvme_core] kernel: nvme_parse_ana_log+0xa1/0x180 [nvme_core] kernel: nvme_read_ana_log+0x76/0x100 [nvme_core] kernel: nvme_ana_work+0x15/0x20 [nvme_core] kernel: process_one_work+0x1db/0x380 kernel: worker_thread+0x4d/0x400 kernel: kthread+0x104/0x140 kernel: ret_from_fork+0x35/0x40 kernel: INFO: task kworker/u8:4:439 blocked for more than 120 seconds. kernel: Tainted: G OE 5.3.5-050305-generic #201910071830 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kernel: kworker/u8:4 D 0 439 2 0x80004000 kernel: Workqueue: nvme-wq nvme_scan_work [nvme_core] kernel: Call Trace: kernel: __schedule+0x2b9/0x6c0 kernel: schedule+0x42/0xb0 kernel: io_schedule+0x16/0x40 kernel: do_read_cache_page+0x438/0x830 kernel: read_cache_page+0x12/0x20 kernel: read_dev_sector+0x27/0xc0 kernel: read_lba+0xc1/0x220 kernel: efi_partition+0x1e6/0x708 kernel: check_partition+0x154/0x244 kernel: rescan_partitions+0xae/0x280 kernel: __blkdev_get+0x40f/0x560 kernel: blkdev_get+0x3d/0x140 kernel: __device_add_disk+0x388/0x480 kernel: device_add_disk+0x13/0x20 kernel: nvme_mpath_set_live+0x119/0x140 [nvme_core] kernel: nvme_update_ns_ana_state+0x5c/0x60 [nvme_core] kernel: nvme_mpath_add_disk+0xbe/0x100 [nvme_core] kernel: nvme_validate_ns+0x396/0x940 [nvme_core] kernel: nvme_scan_work+0x256/0x390 [nvme_core] kernel: process_one_work+0x1db/0x380 kernel: worker_thread+0x4d/0x400 kernel: kthread+0x104/0x140 kernel: ret_from_fork+0x35/0x40 Fixes: 0d0b660f214d ("nvme: add ANA support") Signed-off-by: Anton Eidelman Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e164471dcf19308d154adb69e7760d8ba426a77f Author: Sagi Grimberg Date: Wed Jun 24 01:53:10 2020 -0700 nvme: don't protect ns mutation with ns->head->lock Right now ns->head->lock is protecting namespace mutation which is wrong and unneeded. Move it to only protect against head mutations. While we're at it, remove unnecessary ns->head reference as we already have head pointer. The problem with this is that the head->lock spans mpath disk node I/O that may block under some conditions (if for example the controller is disconnecting or the path became inaccessible), The locking scheme does not allow any other path to enable itself, preventing blocked I/O to complete and forward-progress from there. This is a preparation patch for the fix in a subsequent patch where the disk I/O will also be done outside the head->lock. Fixes: 0d0b660f214d ("nvme: add ANA support") Signed-off-by: Anton Eidelman Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 489dd102a2c7c94d783a35f9412eb085b8da1aa4 Author: Anton Eidelman Date: Wed Jun 24 01:53:09 2020 -0700 nvme-multipath: fix deadlock between ana_work and scan_work When scan_work calls nvme_mpath_add_disk() this holds ana_lock and invokes nvme_parse_ana_log(), which may issue IO in device_add_disk() and hang waiting for an accessible path. While nvme_mpath_set_live() only called when nvme_state_is_live(), a transition may cause NVME_SC_ANA_TRANSITION and requeue the IO. In order to recover and complete the IO ana_work on the same ctrl should be able to update the path state and remove NVME_NS_ANA_PENDING. The deadlock occurs because scan_work keeps holding ana_lock, so ana_work hangs [1]. Fix: Now nvme_mpath_add_disk() uses nvme_parse_ana_log() to obtain a copy of the ANA group desc, and then calls nvme_update_ns_ana_state() without holding ana_lock. [1]: kernel: Workqueue: nvme-wq nvme_scan_work [nvme_core] kernel: Call Trace: kernel: __schedule+0x2b9/0x6c0 kernel: schedule+0x42/0xb0 kernel: io_schedule+0x16/0x40 kernel: do_read_cache_page+0x438/0x830 kernel: read_cache_page+0x12/0x20 kernel: read_dev_sector+0x27/0xc0 kernel: read_lba+0xc1/0x220 kernel: efi_partition+0x1e6/0x708 kernel: check_partition+0x154/0x244 kernel: rescan_partitions+0xae/0x280 kernel: __blkdev_get+0x40f/0x560 kernel: blkdev_get+0x3d/0x140 kernel: __device_add_disk+0x388/0x480 kernel: device_add_disk+0x13/0x20 kernel: nvme_mpath_set_live+0x119/0x140 [nvme_core] kernel: nvme_update_ns_ana_state+0x5c/0x60 [nvme_core] kernel: nvme_set_ns_ana_state+0x1e/0x30 [nvme_core] kernel: nvme_parse_ana_log+0xa1/0x180 [nvme_core] kernel: nvme_mpath_add_disk+0x47/0x90 [nvme_core] kernel: nvme_validate_ns+0x396/0x940 [nvme_core] kernel: nvme_scan_work+0x24f/0x380 [nvme_core] kernel: process_one_work+0x1db/0x380 kernel: worker_thread+0x249/0x400 kernel: kthread+0x104/0x140 kernel: Workqueue: nvme-wq nvme_ana_work [nvme_core] kernel: Call Trace: kernel: __schedule+0x2b9/0x6c0 kernel: schedule+0x42/0xb0 kernel: schedule_preempt_disabled+0xe/0x10 kernel: __mutex_lock.isra.0+0x182/0x4f0 kernel: ? __switch_to_asm+0x34/0x70 kernel: ? select_task_rq_fair+0x1aa/0x5c0 kernel: ? kvm_sched_clock_read+0x11/0x20 kernel: ? sched_clock+0x9/0x10 kernel: __mutex_lock_slowpath+0x13/0x20 kernel: mutex_lock+0x2e/0x40 kernel: nvme_read_ana_log+0x3a/0x100 [nvme_core] kernel: nvme_ana_work+0x15/0x20 [nvme_core] kernel: process_one_work+0x1db/0x380 kernel: worker_thread+0x4d/0x400 kernel: kthread+0x104/0x140 kernel: ? process_one_work+0x380/0x380 kernel: ? kthread_park+0x80/0x80 kernel: ret_from_fork+0x35/0x40 Fixes: 0d0b660f214d ("nvme: add ANA support") Signed-off-by: Anton Eidelman Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 3b4b19721ec652ad2c4fe51dfbe5124212b5f581 Author: Sagi Grimberg Date: Wed Jun 24 01:53:08 2020 -0700 nvme: fix possible deadlock when I/O is blocked Revert fab7772bfbcf ("nvme-multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns") When adding a new namespace to the head disk (via nvme_mpath_set_live) we will see partition scan which triggers I/O on the mpath device node. This process will usually be triggered from the scan_work which holds the scan_lock. If I/O blocks (if we got ana change currently have only available paths but none are accessible) this can deadlock on the head disk bd_mutex as both partition scan I/O takes it, and head disk revalidation takes it to check for resize (also triggered from scan_work on a different path). See trace [1]. The mpath disk revalidation was originally added to detect online disk size change, but this is no longer needed since commit cb224c3af4df ("nvme: Convert to use set_capacity_revalidate_and_notify") which already updates resize info without unnecessarily revalidating the disk (the mpath disk doesn't even implement .revalidate_disk fop). [1]: -- kernel: INFO: task kworker/u65:9:494 blocked for more than 241 seconds. kernel: Tainted: G OE 5.3.5-050305-generic #201910071830 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kernel: kworker/u65:9 D 0 494 2 0x80004000 kernel: Workqueue: nvme-wq nvme_scan_work [nvme_core] kernel: Call Trace: kernel: __schedule+0x2b9/0x6c0 kernel: schedule+0x42/0xb0 kernel: schedule_preempt_disabled+0xe/0x10 kernel: __mutex_lock.isra.0+0x182/0x4f0 kernel: __mutex_lock_slowpath+0x13/0x20 kernel: mutex_lock+0x2e/0x40 kernel: revalidate_disk+0x63/0xa0 kernel: __nvme_revalidate_disk+0xfe/0x110 [nvme_core] kernel: nvme_revalidate_disk+0xa4/0x160 [nvme_core] kernel: ? evict+0x14c/0x1b0 kernel: revalidate_disk+0x2b/0xa0 kernel: nvme_validate_ns+0x49/0x940 [nvme_core] kernel: ? blk_mq_free_request+0xd2/0x100 kernel: ? __nvme_submit_sync_cmd+0xbe/0x1e0 [nvme_core] kernel: nvme_scan_work+0x24f/0x380 [nvme_core] kernel: process_one_work+0x1db/0x380 kernel: worker_thread+0x249/0x400 kernel: kthread+0x104/0x140 kernel: ? process_one_work+0x380/0x380 kernel: ? kthread_park+0x80/0x80 kernel: ret_from_fork+0x1f/0x40 ... kernel: INFO: task kworker/u65:1:2630 blocked for more than 241 seconds. kernel: Tainted: G OE 5.3.5-050305-generic #201910071830 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kernel: kworker/u65:1 D 0 2630 2 0x80004000 kernel: Workqueue: nvme-wq nvme_scan_work [nvme_core] kernel: Call Trace: kernel: __schedule+0x2b9/0x6c0 kernel: schedule+0x42/0xb0 kernel: io_schedule+0x16/0x40 kernel: do_read_cache_page+0x438/0x830 kernel: ? __switch_to_asm+0x34/0x70 kernel: ? file_fdatawait_range+0x30/0x30 kernel: read_cache_page+0x12/0x20 kernel: read_dev_sector+0x27/0xc0 kernel: read_lba+0xc1/0x220 kernel: ? kmem_cache_alloc_trace+0x19c/0x230 kernel: efi_partition+0x1e6/0x708 kernel: ? vsnprintf+0x39e/0x4e0 kernel: ? snprintf+0x49/0x60 kernel: check_partition+0x154/0x244 kernel: rescan_partitions+0xae/0x280 kernel: __blkdev_get+0x40f/0x560 kernel: blkdev_get+0x3d/0x140 kernel: __device_add_disk+0x388/0x480 kernel: device_add_disk+0x13/0x20 kernel: nvme_mpath_set_live+0x119/0x140 [nvme_core] kernel: nvme_update_ns_ana_state+0x5c/0x60 [nvme_core] kernel: nvme_set_ns_ana_state+0x1e/0x30 [nvme_core] kernel: nvme_parse_ana_log+0xa1/0x180 [nvme_core] kernel: ? nvme_update_ns_ana_state+0x60/0x60 [nvme_core] kernel: nvme_mpath_add_disk+0x47/0x90 [nvme_core] kernel: nvme_validate_ns+0x396/0x940 [nvme_core] kernel: ? blk_mq_free_request+0xd2/0x100 kernel: nvme_scan_work+0x24f/0x380 [nvme_core] kernel: process_one_work+0x1db/0x380 kernel: worker_thread+0x249/0x400 kernel: kthread+0x104/0x140 kernel: ? process_one_work+0x380/0x380 kernel: ? kthread_park+0x80/0x80 kernel: ret_from_fork+0x1f/0x40 -- Fixes: fab7772bfbcf ("nvme-multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns") Signed-off-by: Anton Eidelman Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 032a9966a22a3596addf81dacf0c1736dfedc32a Author: Max Gurtovoy Date: Tue Jun 23 17:55:25 2020 +0300 nvme-rdma: assign completion vector correctly The completion vector index that is given during CQ creation can't exceed the number of support vectors by the underlying RDMA device. This violation currently can accure, for example, in case one will try to connect with N regular read/write queues and M poll queues and the sum of N + M > num_supported_vectors. This will lead to failure in establish a connection to remote target. Instead, in that case, share a completion vector between queues. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 1b4ad7a50ab06573aa8841217d6a472dc1db2d85 Author: Max Gurtovoy Date: Tue Jun 16 12:34:25 2020 +0300 nvme-loop: initialize tagset numa value to the value of the ctrl Both admin's and drive's tagsets should be set according the numa node of the controller. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 610c823510f7d05a4ddb7bba00893e455bbef9dc Author: Max Gurtovoy Date: Tue Jun 16 12:34:24 2020 +0300 nvme-tcp: initialize tagset numa value to the value of the ctrl Both admin's and drive's tagsets should be set according the numa node of the controller. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit d4ec47f120537c75184c3dc939d3b2e1bcc8b260 Author: Max Gurtovoy Date: Tue Jun 16 12:34:23 2020 +0300 nvme-pci: initialize tagset numa value to the value of the ctrl Both admin's and drive's tagsets should be set according the numa node of the controller. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 635333e400e2e678258ea45232415cdadadd7818 Author: Max Gurtovoy Date: Tue Jun 16 12:34:22 2020 +0300 nvme-pci: override the value of the controller's numa node Set the node value according to the PCI device numa node. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 4fea243ebce40e2e4193d7d25eabfd963c46ef8c Author: Max Gurtovoy Date: Tue Jun 16 12:34:21 2020 +0300 nvme: set initial value for controller's numa node Initialize the node to NUMA_NO_NODE value. Transports that are aware of numa node affinity can override it (e.g. RDMA transport set the affinity according to the RDMA HCA). Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit ea0efd687b01355cd799c8643d0c636ba4859ffc Author: Yoshihiro Shimoda Date: Thu Jun 18 21:11:17 2020 +0900 usb: renesas_usbhs: getting residue from callback_result This driver assumed that dmaengine_tx_status() could return the residue even if the transfer was completed. However, this was not correct usage [1] and this caused to break getting the residue after the commit 24461d9792c2 ("dmaengine: virt-dma: Fix access after free in vchan_complete()") actually. So, this is possible to get wrong received size if the usb controller gets a short packet. For example, g_zero driver causes "bad OUT byte" errors. The usb-dmac driver will support the callback_result, so this driver can use it to get residue correctly. Note that even if the usb-dmac driver has not supported the callback_result yet, this patch doesn't cause any side-effects. [1] https://lore.kernel.org/dmaengine/20200616165550.GP2324254@vkoul-mobl/ Reported-by: Hien Dang Fixes: 24461d9792c2 ("dmaengine: virt-dma: Fix access after free in vchan_complete()") Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1592482277-19563-1-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Greg Kroah-Hartman commit 0b8eb629a700c0ef15a437758db8255f8444e76c Author: Chengguang Xu Date: Wed Jun 24 18:21:39 2020 +0800 block: release bip in a right way in error path Release bip using kfree() in error path when that was allocated by kmalloc(). Signed-off-by: Chengguang Xu Reviewed-by: Christoph Hellwig Acked-by: Martin K. Petersen Signed-off-by: Jens Axboe commit 35f760b44b1b9cb16a306bdcc7220fbbf78c4789 Author: Denis Efremov Date: Mon Jun 22 23:31:22 2020 +0300 drm/radeon: fix fb_div check in ni_init_smc_spll_table() clk_s is checked twice in a row in ni_init_smc_spll_table(). fb_div should be checked instead. Fixes: 69e0b57a91ad ("drm/radeon/kms: add dpm support for cayman (v5)") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov Signed-off-by: Alex Deucher commit 9bc5fd71b680ca017d59510b4f402577758b8496 Author: Shuming Fan Date: Tue Jun 23 20:53:12 2020 +0800 ASoC: rt5682: fix the pop noise while OMTP type headset plugin To turn the headphone output switch off during jack type detection, it could avoid the pop noise when jack type switches to OMTP type. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20200623125312.27896-1-shumingf@realtek.com Signed-off-by: Mark Brown commit ad38beb373a14e082f4e64b68c0b6e6b09764680 Author: Anand Moon Date: Tue Jun 23 07:46:37 2020 +0000 Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk" This reverts commit 07f6842341abe978e6375078f84506ec3280ece5. Since SCLK_SCLK_USBD300 suspend clock need to be configured for phy module, I wrongly mapped this clock to DWC3 code. Cc: Felipe Balbi Cc: Greg Kroah-Hartman Signed-off-by: Anand Moon Cc: stable Fixes: 07f6842341ab ("usb: dwc3: exynos: Add support for Exynos5422 suspend clk") Link: https://lore.kernel.org/r/20200623074637.756-1-linux.amoon@gmail.com Signed-off-by: Greg Kroah-Hartman commit b3d71abd135e6919ca0b6cab463738472653ddfb Author: Kai-Heng Feng Date: Wed Jun 24 16:59:49 2020 +0300 xhci: Poll for U0 after disabling USB2 LPM USB2 devices with LPM enabled may interrupt the system suspend: [ 932.510475] usb 1-7: usb suspend, wakeup 0 [ 932.510549] hub 1-0:1.0: hub_suspend [ 932.510581] usb usb1: bus suspend, wakeup 0 [ 932.510590] xhci_hcd 0000:00:14.0: port 9 not suspended [ 932.510593] xhci_hcd 0000:00:14.0: port 8 not suspended .. [ 932.520323] xhci_hcd 0000:00:14.0: Port change event, 1-7, id 7, portsc: 0x400e03 .. [ 932.591405] PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16 [ 932.591414] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -16 [ 932.591418] PM: Device 0000:00:14.0 failed to suspend async: error -16 During system suspend, USB core will let HC suspends the device if it doesn't have remote wakeup enabled and doesn't have any children. However, from the log above we can see that the usb 1-7 doesn't get bus suspended due to not in U0. After a while the port finished U2 -> U0 transition, interrupts the suspend process. The observation is that after disabling LPM, port doesn't transit to U0 immediately and can linger in U2. xHCI spec 4.23.5.2 states that the maximum exit latency for USB2 LPM should be BESL + 10us. The BESL for the affected device is advertised as 400us, which is still not enough based on my testing result. So let's use the maximum permitted latency, 10000, to poll for U0 status to solve the issue. Cc: stable@vger.kernel.org Signed-off-by: Kai-Heng Feng Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200624135949.22611-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f0c472a6da51f9fac15e80fe2fd9c83b68754cff Author: Kai-Heng Feng Date: Wed Jun 24 16:59:48 2020 +0300 xhci: Return if xHCI doesn't support LPM Just return if xHCI is quirked to disable LPM. We can save some time from reading registers and doing spinlocks. Add stable tag as we want this patch together with the next one, "Poll for U0 after disabling USB2 LPM" which fixes a suspend issue for some USB2 LPM devices Cc: stable@vger.kernel.org Signed-off-by: Kai-Heng Feng Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200624135949.22611-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a24d5072e87457a14023ee1dd3fc8b1e76f899ef Author: Macpaul Lin Date: Wed Jun 24 16:59:47 2020 +0300 usb: host: xhci-mtk: avoid runtime suspend when removing hcd When runtime suspend was enabled, runtime suspend might happen when xhci is removing hcd. This might cause kernel panic when hcd has been freed but runtime pm suspend related handle need to reference it. Signed-off-by: Macpaul Lin Reviewed-by: Chunfeng Yun Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200624135949.22611-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a73d9d9cfc3cfceabd91fb0b0c13e4062b6dbcd7 Author: Al Cooper Date: Wed Jun 24 16:59:46 2020 +0300 xhci: Fix enumeration issue when setting max packet size for FS devices. Unable to complete the enumeration of a USB TV Tuner device. Per XHCI spec (4.6.5), the EP state field of the input context shall be cleared for a set address command. In the special case of an FS device that has "MaxPacketSize0 = 8", the Linux XHCI driver does not do this before evaluating the context. With an XHCI controller that checks the EP state field for parameter context error this causes a problem in cases such as the device getting reset again after enumeration. When that field is cleared, the problem does not occur. This was found and fixed by Sasi Kumar. Cc: stable@vger.kernel.org Signed-off-by: Al Cooper Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200624135949.22611-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit dceea67058fe22075db3aed62d5cb62092be5053 Author: Mathias Nyman Date: Wed Jun 24 16:59:45 2020 +0300 xhci: Fix incorrect EP_STATE_MASK EP_STATE_MASK should be 0x7 instead of 0xf xhci spec 6.2.3 shows that the EP state field in the endpoint context data structure consist of bits [2:0]. The old value included a bit from the next field which fortunately is a RsvdZ region. So hopefully this hasn't caused too much harm Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200624135949.22611-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d0b78265cac9d8b5f7d5c97fa44860d6ab952dc8 Author: Peter Chen Date: Tue Jun 23 11:09:18 2020 +0800 usb: cdns3: ep0: add spinlock for cdns3_check_new_setup The other thread may access other endpoints when the cdns3_check_new_setup is handling, add spinlock to protect it. Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Cc: Reviewed-by: Pawel Laszczak Signed-off-by: Peter Chen Link: https://lore.kernel.org/r/20200623030918.8409-4-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit 813072b67ee97659807049d014c9d4e36fd62e94 Author: Peter Chen Date: Tue Jun 23 11:09:17 2020 +0800 usb: cdns3: trace: using correct dir value It should use the correct direction value from register, not depends on previous software setting. It fixed the EP number wrong issue at trace when the TRBERR interrupt occurs for EP0IN. When the EP0IN IOC has finished, software prepares the setup packet request, the expected direction is OUT, but at that time, the TRBERR for EP0IN may occur since it is DMULT mode, the DMA does not stop until TRBERR has met. Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Cc: Reviewed-by: Pawel Laszczak Signed-off-by: Peter Chen Link: https://lore.kernel.org/r/20200623030918.8409-3-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit c0e2a0341cd8ccd213ffc6c7f9cd52a31466cba9 Author: Peter Chen Date: Tue Jun 23 11:09:16 2020 +0800 usb: cdns3: ep0: fix the test mode set incorrectly The 'tmode' is ctrl->wIndex, changing it as the real test mode value for register assignment. Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Cc: Reviewed-by: Jun Li Reviewed-by: Pawel Laszczak Signed-off-by: Peter Chen Link: https://lore.kernel.org/r/20200623030918.8409-2-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit cb944f02d0d8c5a5f38119242325fe26504d33d2 Author: Mark Brown Date: Wed Jun 24 11:49:33 2020 +0100 kselftest: arm64: Remove redundant clean target The arm64 signal tests generate warnings during build since both they and the toplevel lib.mk define a clean target: Makefile:25: warning: overriding recipe for target 'clean' ../../lib.mk:126: warning: ignoring old recipe for target 'clean' Since the inclusion of lib.mk is in the signal Makefile there is no situation where this warning could be avoided so just remove the redundant clean target. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200624104933.21125-1-broonie@kernel.org Signed-off-by: Will Deacon commit f4617be35b4b547e82d30993f56d631dfc2d5f88 Author: Sai Prakash Ranjan Date: Wed Jun 24 18:04:06 2020 +0530 arm64: kpti: Add KRYO{3, 4}XX silver CPU cores to kpti safelist QCOM KRYO{3,4}XX silver/LITTLE CPU cores are based on Cortex-A55 and are meltdown safe, hence add them to kpti_safe_list[]. Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20200624123406.3472-1-saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 2d21889f8b5c50f65f5162bc972b0b1626b97be2 Author: Jean-Philippe Brucker Date: Wed Jun 24 13:22:54 2020 +0200 arm64: Don't insert a BTI instruction at inner labels Some ftrace features are broken since commit 714a8d02ca4d ("arm64: asm: Override SYM_FUNC_START when building the kernel with BTI"). For example the function_graph tracer: $ echo function_graph > /sys/kernel/debug/tracing/current_tracer [ 36.107016] WARNING: CPU: 0 PID: 115 at kernel/trace/ftrace.c:2691 ftrace_modify_all_code+0xc8/0x14c When ftrace_modify_graph_caller() attempts to write a branch at ftrace_graph_call, it finds the "BTI J" instruction inserted by SYM_INNER_LABEL() instead of a NOP, and aborts. It turns out we don't currently need the BTI landing pads inserted by SYM_INNER_LABEL: * ftrace_call and ftrace_graph_call are only used for runtime patching of the active tracer. The patched code is not reached from a branch. * install_el2_stub is reached from a CBZ instruction, which doesn't change PSTATE.BTYPE. * __guest_exit is reached from B instructions in the hyp-entry vectors, which aren't subject to BTI checks either. Remove the BTI annotation from SYM_INNER_LABEL. Fixes: 714a8d02ca4d ("arm64: asm: Override SYM_FUNC_START when building the kernel with BTI") Signed-off-by: Jean-Philippe Brucker Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20200624112253.1602786-1-jean-philippe@linaro.org Signed-off-by: Will Deacon commit e56404e8e475c91489b2cca57f2c1b2bc5edf6b2 Author: Alexander Popov Date: Wed Jun 24 15:33:28 2020 +0300 arm64: vdso: Don't use gcc plugins for building vgettimeofday.c Don't use gcc plugins for building arch/arm64/kernel/vdso/vgettimeofday.c to avoid unneeded instrumentation. Signed-off-by: Alexander Popov Link: https://lore.kernel.org/r/20200624123330.83226-4-alex.popov@linux.com Signed-off-by: Will Deacon commit fdc355a03df537bc8d8909b86d1688fe07c7032b Author: Tiezhu Yang Date: Mon May 25 21:08:57 2020 +0800 phy: rockchip: Fix return value of inno_dsidphy_probe() When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Fixes: b7535a3bc0ba ("phy/rockchip: Add support for Innosilicon MIPI/LVDS/TTL PHY") Signed-off-by: Tiezhu Yang Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/1590412138-13903-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Vinod Koul commit 5a72122dcfd921940ce877963ddd7be4b089adf2 Author: Rikard Falkeborn Date: Sun May 24 11:55:16 2020 +0200 phy: ti: j721e-wiz: Constify structs clk_div_table and wiz_regmap_config are not modified and can therefore be made const to allow the compiler to put them in read-only memory. Before: text data bss dec hex filename 20265 7044 64 27373 6aed drivers/phy/ti/phy-j721e-wiz.o After: text data bss dec hex filename 20649 6660 64 27373 6aed drivers/phy/ti/phy-j721e-wiz.o Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200524095516.25227-3-rikard.falkeborn@gmail.com Signed-off-by: Vinod Koul commit 0cb5ebc749fde8562fb876f92ac5cc6e92bd89fb Author: Rikard Falkeborn Date: Sun May 24 11:55:15 2020 +0200 phy: ti: am654-serdes: Constify regmap_config regmap_config is not modified and can be made static to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 12328 3644 64 16036 3ea4 drivers/phy/ti/phy-am654-serdes.o After: text data bss dec hex filename 12648 3324 64 16036 3ea4 drivers/phy/ti/phy-am654-serdes.o Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200524095516.25227-2-rikard.falkeborn@gmail.com Signed-off-by: Vinod Koul commit 220345e98f1cdc768eeb6e3364a0fa7ab9647fe7 Author: Takashi Iwai Date: Wed Jun 24 14:23:40 2020 +0200 ALSA: usb-audio: Fix OOB access of mixer element list The USB-audio mixer code holds a linked list of usb_mixer_elem_list, and several operations are performed for each mixer element. A few of them (snd_usb_mixer_notify_id() and snd_usb_mixer_interrupt_v2()) assume each mixer element being a usb_mixer_elem_info object that is a subclass of usb_mixer_elem_list, cast via container_of() and access it members. This may result in an out-of-bound access when a non-standard list element has been added, as spotted by syzkaller recently. This patch adds a new field, is_std_info, in usb_mixer_elem_list to indicate that the element is the usb_mixer_elem_info type or not, and skip the access to such an element if needed. Reported-by: syzbot+fb14314433463ad51625@syzkaller.appspotmail.com Reported-by: syzbot+2405ca3401e943c538b5@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/20200624122340.9615-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 49a3b0e1c05ab3601100a723f7ea207dc99a492a Author: Will Deacon Date: Wed Jun 24 13:23:10 2020 +0100 arm64: vdso: Only pass --no-eh-frame-hdr when linker supports it Commit 87676cfca141 ("arm64: vdso: Disable dwarf unwinding through the sigreturn trampoline") unconditionally passes the '--no-eh-frame-hdr' option to the linker when building the native vDSO in an attempt to prevent generation of the .eh_frame_hdr section, the presence of which has been implicated in segfaults originating from the libgcc unwinder. Unfortunately, not all versions of binutils support this option, which has been shown to cause build failures in linux-next: | CALL scripts/atomic/check-atomics.sh | CALL scripts/checksyscalls.sh | LD arch/arm64/kernel/vdso/vdso.so.dbg | ld: unrecognized option '--no-eh-frame-hdr' | ld: use the --help option for usage information | arch/arm64/kernel/vdso/Makefile:64: recipe for target | 'arch/arm64/kernel/vdso/vdso.so.dbg' failed | make[1]: *** [arch/arm64/kernel/vdso/vdso.so.dbg] Error 1 | arch/arm64/Makefile:175: recipe for target 'vdso_prepare' failed | make: *** [vdso_prepare] Error 2 Only link the vDSO with '--no-eh-frame-hdr' when the linker supports it. If we end up with the section due to linker defaults, the absence of CFI information in the sigreturn trampoline will prevent the unwinder from breaking. Link: https://lore.kernel.org/r/7a7e31a8-9a7b-2428-ad83-2264f20bdc2d@hisilicon.com Fixes: 87676cfca141 ("arm64: vdso: Disable dwarf unwinding through the sigreturn trampoline") Reported-by: Shaokun Zhang Tested-by: Jon Hunter Signed-off-by: Will Deacon commit 6153224bef8b218ecf9bf541b6154ff72fc4c54b Author: Arnd Bergmann Date: Wed May 27 15:45:06 2020 +0200 phy: intel: fix enum type mismatch warning clang points out that a local variable is initialized with an enum value of the wrong type: drivers/phy/intel/phy-intel-combo.c:202:34: error: implicit conversion from enumeration type 'enum intel_phy_mode' to different enumeration type 'enum intel_combo_mode' [-Werror,-Wenum-conversion] enum intel_combo_mode cb_mode = PHY_PCIE_MODE; ~~~~~~~ ^~~~~~~~~~~~~ >From reading the code, it seems that this was not only the wrong type, but not even supposed to be a code path that can happen in practice. Change the code to have no default phy mode but instead return an error for invalid input. Fixes: ac0a95a3ea78 ("phy: intel: Add driver support for ComboPhy") Signed-off-by: Arnd Bergmann Reviewed-by: Dilip Kota Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20200527134518.908624-1-arnd@arndb.de Signed-off-by: Vinod Koul commit 76e242c284521a0129a4c312093fb0ab102b704a Author: Dilip Kota Date: Wed May 27 18:56:53 2020 +0800 phy: intel: Fix compilation error on FIELD_PREP usage FIELD_PREP expects constant arguments. Istead of doing FIELD_PREP operation on the arguments of combo_phy_w32_off_mask(), pass the final FIELD_PREP value as an argument. Error reported as: In file included from include/linux/build_bug.h:5, from include/linux/bitfield.h:10, from drivers/phy/intel/phy-intel-combo.c:8: drivers/phy/intel/phy-intel-combo.c: In function 'combo_phy_w32_off_mask': include/linux/bitfield.h:52:28: warning: comparison is always false due to limited range of data type [-Wtype-limits] include/linux/compiler.h:350:38: error: call to '__compiletime_assert_37' declared with attribute error: FIELD_PREP: mask is not constant 94 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); | ^~~~~~~~~~~~~~~~ drivers/phy/intel/phy-intel-combo.c:137:13: note: in expansion of macro 'FIELD_PREP' 137 | reg_val |= FIELD_PREP(mask, val); | ^~~~~~~~~~ ../include/linux/compiler.h:392:38: error: call to__compiletime_assert_137 declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ../include/linux/bitfield.h:94:3: note: in expansion of macro __BF_FIELD_CHECK __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ ^~~~~~~~~~~~~~~~ ../drivers/phy/intel/phy-intel-combo.c:137:13: note: in expansion of macro FIELD_PREP reg_val |= FIELD_PREP(mask, val); ^~~~~~~~~~ Fixes: ac0a95a3ea78 ("phy: intel: Add driver support for ComboPhy") Reported-by: kbuild test robot Reported-by: Randy Dunlap Signed-off-by: Dilip Kota Acked-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/8a309dd3c238efbaa59d1649704255d6f8b6c9c5.1590575358.git.eswara.kota@linux.intel.com Signed-off-by: Vinod Koul commit 5b78fac4b1ba731cf4177fdbc1e3a4661521bcd0 Author: Dinghao Liu Date: Wed Jun 24 14:46:26 2020 +0800 dmaengine: tegra210-adma: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Reviewed-by: Jon Hunter Link: https://lore.kernel.org/r/20200624064626.19855-1-dinghao.liu@zju.edu.cn Signed-off-by: Vinod Koul commit ce04326edd59d7902d7ef3a9d853864096e0cd1a Author: Omer Shpigelman Date: Tue Jun 16 17:56:27 2020 +0300 habanalabs: increase h/w timer when checking idle In GAUDI the current timer value for the hardware to check if it is in IDLE state is too low. As a result, there are occasions where the H/W wrongly reports it is not IDLE. The driver checks that before submitting work on behalf of the driver during initialization, so a false report might cause the driver to fail during device initialization. Signed-off-by: Omer Shpigelman Signed-off-by: Oded Gabbay commit 1ee1369b46de1083238fced60ff718f59de4b8aa Author: James Hilliard Date: Tue Jun 23 13:24:15 2020 -0600 HID: quirks: Ignore Simply Automated UPB PIM As this is a cypress HID->COM RS232 style device that is handled by the cypress_M8 driver we also need to add it to the ignore list in hid-quirks. Cc: stable Signed-off-by: James Hilliard Signed-off-by: Jiri Kosina commit a5d81646fa294eed57786a9310b06ca48902adf8 Author: Hans de Goede Date: Sat Jun 20 14:32:29 2020 +0200 HID: apple: Disable Fn-key key-re-mapping on clone keyboards The Maxxter KB-BT-001 Bluetooth keyboard, which looks somewhat like the Apple Wireless Keyboard, is using the vendor and product IDs (05AC:0239) of the Apple Wireless Keyboard (2009 ANSI version) . But its F1 - F10 keys are marked as sending F1 - F10, not the special functions hid-apple.c maps them too; and since its descriptors do not contain the HID_UP_CUSTOM | 0x0003 usage apple-hid looks for for the Fn-key, apple_setup_input() never gets called, so F1 - F6 are mapped to key-codes which have not been set in the keybit array causing them to not send any events at all. The lack of a usage code matching the Fn key in the clone is actually useful as this allows solving this problem in a generic way. This commits adds a fn_found flag and it adds a input_configured callback which checks if this flag is set once all usages have been mapped. If it is not set, then assume this is a clone and clear the quirks bitmap so that the hid-apple code does not add any special handling to this keyboard. This fixes F1 - F6 not sending anything at all and F7 - F12 sending the wrong codes on the Maxxter KB-BT-001 Bluetooth keyboard and on similar clones. Cc: Joao Moreno Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit a06bb885cf3d812ebfd45c6300e503690a762955 Author: David Rheinsberg Date: Fri Jun 19 16:57:59 2020 +0200 MAINTAINERS: update uhid and hid-wiimote entry My last name changed to "Rheinsberg", so update the maintainer entries and adjust the emails while at it. Signed-off-by: David Rheinsberg Signed-off-by: David Herrmann Signed-off-by: Jiri Kosina commit 8995aa3d164ddd9200e6abcf25c449cf5298c858 Author: Krzysztof Kozlowski Date: Thu Jun 11 15:21:05 2020 +0200 dmaengine: mcf-edma: Fix NULL pointer exception in mcf_edma_tx_handler On Toradex Colibri VF50 (Vybrid VF5xx) with fsl-edma driver NULL pointer exception happens occasionally on serial output initiated by login timeout. This was reproduced only if kernel was built with significant debugging options and EDMA driver is used with serial console. Issue looks like a race condition between interrupt handler fsl_edma_tx_handler() (called as a result of fsl_edma_xfer_desc()) and terminating the transfer with fsl_edma_terminate_all(). The fsl_edma_tx_handler() handles interrupt for a transfer with already freed edesc and idle==true. The mcf-edma driver shares design and lot of code with fsl-edma. It looks like being affected by same problem. Fix this pattern the same way as fix for fsl-edma driver. Fixes: e7a3ff92eaf1 ("dmaengine: fsl-edma: add ColdFire mcf5441x edma support") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Robin Gong Link: https://lore.kernel.org/r/1591881665-25592-1-git-send-email-krzk@kernel.org Signed-off-by: Vinod Koul commit f5e5677c420346b4e9788051c2e4d750996c428c Author: Krzysztof Kozlowski Date: Thu Jun 11 14:17:41 2020 +0200 dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler NULL pointer exception happens occasionally on serial output initiated by login timeout. This was reproduced only if kernel was built with significant debugging options and EDMA driver is used with serial console. col-vf50 login: root Password: Login timed out after 60 seconds. Unable to handle kernel NULL pointer dereference at virtual address 00000044 Internal error: Oops: 5 [#1] ARM CPU: 0 PID: 157 Comm: login Not tainted 5.7.0-next-20200610-dirty #4 Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree) (fsl_edma_tx_handler) from [<8016eb10>] (__handle_irq_event_percpu+0x64/0x304) (__handle_irq_event_percpu) from [<8016eddc>] (handle_irq_event_percpu+0x2c/0x7c) (handle_irq_event_percpu) from [<8016ee64>] (handle_irq_event+0x38/0x5c) (handle_irq_event) from [<801729e4>] (handle_fasteoi_irq+0xa4/0x160) (handle_fasteoi_irq) from [<8016ddcc>] (generic_handle_irq+0x34/0x44) (generic_handle_irq) from [<8016e40c>] (__handle_domain_irq+0x54/0xa8) (__handle_domain_irq) from [<80508bc8>] (gic_handle_irq+0x4c/0x80) (gic_handle_irq) from [<80100af0>] (__irq_svc+0x70/0x98) Exception stack(0x8459fe80 to 0x8459fec8) fe80: 72286b00 e3359f64 00000001 0000412d a0070013 85c98840 85c98840 a0070013 fea0: 8054e0d4 00000000 00000002 00000000 00000002 8459fed0 8081fbe8 8081fbec fec0: 60070013 ffffffff (__irq_svc) from [<8081fbec>] (_raw_spin_unlock_irqrestore+0x30/0x58) (_raw_spin_unlock_irqrestore) from [<8056cb48>] (uart_flush_buffer+0x88/0xf8) (uart_flush_buffer) from [<80554e60>] (tty_ldisc_hangup+0x38/0x1ac) (tty_ldisc_hangup) from [<8054c7f4>] (__tty_hangup+0x158/0x2bc) (__tty_hangup) from [<80557b90>] (disassociate_ctty.part.1+0x30/0x23c) (disassociate_ctty.part.1) from [<8011fc18>] (do_exit+0x580/0xba0) (do_exit) from [<801214f8>] (do_group_exit+0x3c/0xb4) (do_group_exit) from [<80121580>] (__wake_up_parent+0x0/0x14) Issue looks like race condition between interrupt handler fsl_edma_tx_handler() (called as result of fsl_edma_xfer_desc()) and terminating the transfer with fsl_edma_terminate_all(). The fsl_edma_tx_handler() handles interrupt for a transfer with already freed edesc and idle==true. Fixes: d6be34fbd39b ("dma: Add Freescale eDMA engine driver support") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Robin Gong Cc: Link: https://lore.kernel.org/r/1591877861-28156-2-git-send-email-krzk@kernel.org Signed-off-by: Vinod Koul commit bfc1d5bf261df81155935aac10b721f4d5a70849 Author: Krzysztof Kozlowski Date: Thu Jun 11 14:17:40 2020 +0200 dmaengine: fsl-edma: Add lockdep assert for exported function Add lockdep assert for an exported function expected to be called under spin lock. Since this function is called in different modules, the lockdep assert will be self-documenting note about need for locking. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Robin Gong Link: https://lore.kernel.org/r/1591877861-28156-1-git-send-email-krzk@kernel.org Signed-off-by: Vinod Koul commit 4f47e8ab6ab796b5380f74866fa5287aca4dcc58 Author: Xin Long Date: Mon Jun 22 16:40:29 2020 +0800 xfrm: policy: match with both mark and mask on user interfaces In commit ed17b8d377ea ("xfrm: fix a warning in xfrm_policy_insert_list"), it would take 'priority' to make a policy unique, and allow duplicated policies with different 'priority' to be added, which is not expected by userland, as Tobias reported in strongswan. To fix this duplicated policies issue, and also fix the issue in commit ed17b8d377ea ("xfrm: fix a warning in xfrm_policy_insert_list"), when doing add/del/get/update on user interfaces, this patch is to change to look up a policy with both mark and mask by doing: mark.v == pol->mark.v && mark.m == pol->mark.m and leave the check: (mark & pol->mark.m) == pol->mark.v for tx/rx path only. As the userland expects an exact mark and mask match to manage policies. v1->v2: - make xfrm_policy_mark_match inline and fix the changelog as Tobias suggested. Fixes: 295fae568885 ("xfrm: Allow user space manipulation of SPD mark") Fixes: ed17b8d377ea ("xfrm: fix a warning in xfrm_policy_insert_list") Reported-by: Tobias Brunner Tested-by: Tobias Brunner Signed-off-by: Xin Long Signed-off-by: Steffen Klassert commit cd37c6976f6a5b681a900e74ff9d15062855bf87 Author: Anand Moon Date: Tue Jun 23 07:46:37 2020 +0000 Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk" This reverts commit 07f6842341abe978e6375078f84506ec3280ece5. Since SCLK_SCLK_USBD300 suspend clock need to be configured for phy module, I wrongly mapped this clock to DWC3 code. Cc: Felipe Balbi Cc: Greg Kroah-Hartman Signed-off-by: Anand Moon Signed-off-by: Felipe Balbi commit e55f3c37cb8d31c7e301f46396b2ac6a19eb3a7c Author: Dan Carpenter Date: Mon Jun 15 14:27:19 2020 +0300 usb: gadget: udc: Potential Oops in error handling code If this is in "transceiver" mode the the ->qwork isn't required and is a NULL pointer. This can lead to a NULL dereference when we call destroy_workqueue(udc->qwork). Fixes: 3517c31a8ece ("usb: gadget: mv_udc: use devm_xxx for probe") Signed-off-by: Dan Carpenter Signed-off-by: Felipe Balbi commit 0a1ef9c81e9194c4faa5686bdd80c66d03ec31ef Merge: e4553b4976d1 774911290c58 Author: Paolo Bonzini Date: Wed Jun 24 02:44:27 2020 -0400 Merge tag 'kvm-s390-master-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master The current number of KVM_IRQCHIP_NUM_PINS results in an order 3 allocation (32kb) for each guest start/restart which can result in OOM killer activity when kernel memory is fragmented enough. This fix reduces the number of iopins as s390 doesn't use them, hence reducing the memory footprint. commit d410912ef63714fad404f34baa72e5ceb0466e62 Author: Tang Bin Date: Thu May 28 19:47:17 2020 +0800 usb: phy: tegra: Fix unnecessary check in tegra_usb_phy_probe() In the function tegra_usb_phy_probe(), if usb_add_phy_dev() failed, the return value will be given to err, and if usb_add_phy_dev() succeed, the return value will be zero. Thus it is unnecessary to repeated check here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: Felipe Balbi commit 2655971ad4b34e97dd921df16bb0b08db9449df7 Author: Aditya Pakki Date: Sat Jun 13 22:15:25 2020 -0500 usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work dwc3_pci_resume_work() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference before returning. Signed-off-by: Aditya Pakki Signed-off-by: Felipe Balbi commit 2587a029fa2a877d0a8dda955ef1b24c94b4bd0e Author: Peter Chen Date: Tue Jun 23 11:09:18 2020 +0800 usb: cdns3: ep0: add spinlock for cdns3_check_new_setup The other thread may access other endpoints when the cdns3_check_new_setup is handling, add spinlock to protect it. Cc: Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Reviewed-by: Pawel Laszczak Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit ba3a80fe0fb67d8790f62b7bc60df97406d89871 Author: Peter Chen Date: Tue Jun 23 11:09:17 2020 +0800 usb: cdns3: trace: using correct dir value It should use the correct direction value from register, not depends on previous software setting. It fixed the EP number wrong issue at trace when the TRBERR interrupt occurs for EP0IN. When the EP0IN IOC has finished, software prepares the setup packet request, the expected direction is OUT, but at that time, the TRBERR for EP0IN may occur since it is DMULT mode, the DMA does not stop until TRBERR has met. Cc: Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Reviewed-by: Pawel Laszczak Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit b51e1cf64f93acebb6d8afbacd648a6ecefc39b4 Author: Peter Chen Date: Tue Jun 23 11:09:16 2020 +0800 usb: cdns3: ep0: fix the test mode set incorrectly The 'tmode' is ctrl->wIndex, changing it as the real test mode value for register assignment. Cc: Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Reviewed-by: Jun Li Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit a721321446432c3899aeca16cc6ddc30422b7f74 Author: Peng Fan Date: Wed Jun 24 14:06:54 2020 +0800 soc: imx8m: fix build warning Fix the build warning with x86_64-randconfig >> drivers/soc/imx/soc-imx8m.c:150:34: warning: unused variable >> 'imx8_soc_match' [-Wunused-const-variable] static const struct of_device_id imx8_soc_match[] = { ^ Fixes: fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver") Reported-by: kernel test robot Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 0b8975bdc0cc5310d48d9bdd871cefebe1f94c99 Author: Dave Jiang Date: Wed Jun 3 10:27:48 2020 -0700 dmaengine: idxd: fix hw descriptor fields for delta record Fix the hw descriptor fields for delta record in user exported idxd.h header. Missing the "expected result mask" field. Reported-by: Mona Hossain Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/159120526866.65385.536565786678052944.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 3292055c85aa02723b7b7a1114c4c91deefad5e4 Author: Ofir Bitton Date: Thu Jun 11 11:43:23 2020 +0300 habanalabs: Correct handling when failing to enqueue CB The fence release flow is different if the CS was never submitted. In that case, we don't have an hw_sob object attached that we need to "put". While if the CS was aborted, we do need to "put" the hw_sob. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 647e835e67421ee47b0ff8acc2808de86f7d5e01 Author: Oded Gabbay Date: Sun Jun 7 11:26:48 2020 +0300 habanalabs: increase GAUDI QMAN ARB WDT timeout The current timeout is too low for some of the workloads and we see false errors as a result. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit dd2fde10934fd0f21e144cf7fbb76564d1d57c77 Author: Oded Gabbay Date: Sun Jun 7 08:21:48 2020 +0300 habanalabs: rename mmu_write() to mmu_asid_va_write() The function name conflicts with a static inline function in arch/m68k/include/asm/mcfmmu.h Reported-by: kernel test robot Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit cfd4176dc0bbbd3d01d6764cd85e1f1705b35548 Author: Omer Shpigelman Date: Wed Jun 3 13:03:35 2020 +0300 habanalabs: use PI in MMU cache invalidation The PS flow for MMU cache invalidation caused timeouts in stress tests. Use PS + PI flow so no timeouts should happen whatsoever. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 64536abc62c17ef6c7b0f17b820de9923b80e745 Author: Oded Gabbay Date: Wed May 27 12:38:16 2020 +0300 habanalabs: block scalar load_and_exe on external queue In Gaudi, the user can't execute scalar load_and_exe on external queue because it can be a security hole. The driver doesn't parse the commands being loaded and it can be msg_prot, which the user isn't allowed to use. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit 1438cde8fe9cb709b569f5829c4c892c0f3f15b3 Author: Yu Kuai Date: Thu Jun 18 21:01:10 2020 +0800 dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get() if of_find_device_by_node() succeed and platform_get_drvdata() failed, of_xudma_dev_get() will return without put_device(), which will leak the memory. Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20200618130110.582543-1-yukuai3@huawei.com Signed-off-by: Vinod Koul commit 466257d9968ac79575831250b039dc07566c7b13 Author: Yoshihiro Shimoda Date: Thu Jun 18 21:07:33 2020 +0900 dmaengine: sh: usb-dmac: set tx_result parameters A client driver (renesas_usbhs) assumed that dmaengine_tx_status() could return the residue even if the transfer was completed. However, this was not correct usage [1] and this caused to break getting the residue after the commit 24461d9792c2 ("dmaengine: virt-dma: Fix access after free in vchan_complete()") actually. So, this is possible to get wrong received size if the usb controller gets a short packet. For example, g_zero driver causes "bad OUT byte" errors. To use the tx_result from the renesas_usbhs driver when the transfer is completed, set the tx_result parameters. Notes that the renesas_usbhs driver needs to update for it. [1] https://lore.kernel.org/dmaengine/20200616165550.GP2324254@vkoul-mobl/ Reported-by: Hien Dang Fixes: 24461d9792c2 ("dmaengine: virt-dma: Fix access after free in vchan_complete()") Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1592482053-19433-1-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit d964d5ff68dba21b53368656adec3fb5f50426bb Author: Peter Ujfalusi Date: Thu Jun 18 14:40:04 2020 +0300 dmaengine: ti: k3-udma: Fix delayed_work usage for tx drain workaround INIT_DELAYED_WORK_ONSTACK() must be used with on-stack delayed work, which is not the case here. Use normal delayed_work for the channels instead. Fixes: 25dcb5dd7b7c ("dmaengine: ti: New driver for K3 UDMA") Reported-by: Tomi Valkeinen Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200618114004.6268-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 66983bc18fad17d10766650b3685045f6f092d73 Author: Nikhil Rao Date: Mon Jun 22 13:38:34 2020 -0700 dmaengine: idxd: fix cdev locking for open and release add the wq lock in cdev open and release call. This fixes race conditions observed in the open and close routines. Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland") Signed-off-by: Nikhil Rao Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/159285824892.64944.2905413694915141834.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 2f57b8d57673af2c2caf8c2c7bef01be940a5c2c Author: Fabio Estevam Date: Sun Jun 21 12:57:30 2020 -0300 dmaengine: imx-sdma: Fix: Remove 'always true' comparison event_id0 is defined as 'unsigned int', so it is always greater or equal to zero. Remove the unneeded comparisons to fix the following W=1 build warning: drivers/dma/imx-sdma.c: In function 'sdma_free_chan_resources': drivers/dma/imx-sdma.c:1334:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 1334 | if (sdmac->event_id0 >= 0) | ^~ drivers/dma/imx-sdma.c: In function 'sdma_config': drivers/dma/imx-sdma.c:1635:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 1635 | if (sdmac->event_id0 >= 0) { | Fixes: 25962e1a7f1d ("dmaengine: imx-sdma: Fix the event id check to include RX event for UART6") Reported-by: kernel test robot Signed-off-by: Fabio Estevam Reviewed-by: Frieder Schrempf Link: https://lore.kernel.org/r/20200621155730.28766-1-festevam@gmail.com Signed-off-by: Vinod Koul commit 1aea5c139011f7f9431c74f1fe709516f72b437a Author: Vinod Koul Date: Tue Jun 23 20:07:29 2020 +0530 MAINTAINERS: switch dmaengine tree to kernel.org I have switched DMAengine tree to kernel.org now, so update in MAINTAINERS file Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200623143729.781403-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit afe89f115e84edbc76d316759e206580a06c6973 Author: Tomas Henzl Date: Tue Jun 16 17:04:46 2020 +0200 scsi: mptscsih: Fix read sense data size The sense data buffer in sense_buf_pool is allocated with size of MPT_SENSE_BUFFER_ALLOC(64) (multiplied by req_depth) while SNS_LEN(sc)(96) is used when reading the data. That may lead to a read from unallocated area, sometimes from another (unallocated) page. To fix this, limit the read size to MPT_SENSE_BUFFER_ALLOC. Link: https://lore.kernel.org/r/20200616150446.4840-1-thenzl@redhat.com Co-developed-by: Stanislav Saner Signed-off-by: Stanislav Saner Signed-off-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit 936e6b85da0476dd2edac7c51c68072da9fb4ba2 Author: Steffen Maier Date: Tue Jun 23 16:02:42 2020 +0200 scsi: zfcp: Fix panic on ERP timeout for previously dismissed ERP action Suppose that, for unrelated reasons, FSF requests on behalf of recovery are very slow and can run into the ERP timeout. In the case at hand, we did adapter recovery to a large degree. However due to the slowness a LUN open is pending so the corresponding fc_rport remains blocked. After fast_io_fail_tmo we trigger close physical port recovery for the port under which the LUN should have been opened. The new higher order port recovery dismisses the pending LUN open ERP action and dismisses the pending LUN open FSF request. Such dismissal decouples the ERP action from the pending corresponding FSF request by setting zfcp_fsf_req->erp_action to NULL (among other things) [zfcp_erp_strategy_check_fsfreq()]. If now the ERP timeout for the pending open LUN request runs out, we must not use zfcp_fsf_req->erp_action in the ERP timeout handler. This is a problem since v4.15 commit 75492a51568b ("s390/scsi: Convert timers to use timer_setup()"). Before that we intentionally only passed zfcp_erp_action as context argument to zfcp_erp_timeout_handler(). Note: The lifetime of the corresponding zfcp_fsf_req object continues until a (late) response or an (unrelated) adapter recovery. Just like the regular response path ignores dismissed requests [zfcp_fsf_req_complete() => zfcp_fsf_protstatus_eval() => return early] the ERP timeout handler now needs to ignore dismissed requests. So simply return early in the ERP timeout handler if the FSF request is marked as dismissed in its status flags. To protect against the race where zfcp_erp_strategy_check_fsfreq() dismisses and sets zfcp_fsf_req->erp_action to NULL after our previous status flag check, return early if zfcp_fsf_req->erp_action is NULL. After all, the former ERP action does not need to be woken up as that was already done as part of the dismissal above [zfcp_erp_action_dismiss()]. This fixes the following panic due to kernel page fault in IRQ context: Unable to handle kernel pointer dereference in virtual kernel address space Failing address: 0000000000000000 TEID: 0000000000000483 Fault in home space mode while using kernel ASCE. AS:000009859238c00b R2:00000e3e7ffd000b R3:00000e3e7ffcc007 S:00000e3e7ffd7000 P:000000000000013d Oops: 0004 ilc:2 [#1] SMP Modules linked in: ... CPU: 82 PID: 311273 Comm: stress Kdump: loaded Tainted: G E X ... Hardware name: IBM 8561 T01 701 (LPAR) Krnl PSW : 0404c00180000000 001fffff80549be0 (zfcp_erp_notify+0x40/0xc0 [zfcp]) R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3 Krnl GPRS: 0000000000000080 00000e3d00000000 00000000000000f0 0000000000030000 000000010028e700 000000000400a39c 000000010028e700 00000e3e7cf87e02 0000000010000000 0700098591cb67f0 0000000000000000 0000000000000000 0000033840e9a000 0000000000000000 001fffe008d6bc18 001fffe008d6bbc8 Krnl Code: 001fffff80549bd4: a7180000 lhi %r1,0 001fffff80549bd8: 4120a0f0 la %r2,240(%r10) #001fffff80549bdc: a53e0003 llilh %r3,3 >001fffff80549be0: ba132000 cs %r1,%r3,0(%r2) 001fffff80549be4: a7740037 brc 7,1fffff80549c52 001fffff80549be8: e320b0180004 lg %r2,24(%r11) 001fffff80549bee: e31020e00004 lg %r1,224(%r2) 001fffff80549bf4: 412020e0 la %r2,224(%r2) Call Trace: [<001fffff80549be0>] zfcp_erp_notify+0x40/0xc0 [zfcp] [<00000985915e26f0>] call_timer_fn+0x38/0x190 [<00000985915e2944>] expire_timers+0xfc/0x190 [<00000985915e2ac4>] run_timer_softirq+0xec/0x218 [<0000098591ca7c4c>] __do_softirq+0x144/0x398 [<00000985915110aa>] do_softirq_own_stack+0x72/0x88 [<0000098591551b58>] irq_exit+0xb0/0xb8 [<0000098591510c6a>] do_IRQ+0x82/0xb0 [<0000098591ca7140>] ext_int_handler+0x128/0x12c [<0000098591722d98>] clear_subpage.constprop.13+0x38/0x60 ([<000009859172ae4c>] clear_huge_page+0xec/0x250) [<000009859177e7a2>] do_huge_pmd_anonymous_page+0x32a/0x768 [<000009859172a712>] __handle_mm_fault+0x88a/0x900 [<000009859172a860>] handle_mm_fault+0xd8/0x1b0 [<0000098591529ef6>] do_dat_exception+0x136/0x3e8 [<0000098591ca6d34>] pgm_check_handler+0x1c8/0x220 Last Breaking-Event-Address: [<001fffff80549c88>] zfcp_erp_timeout_handler+0x10/0x18 [zfcp] Kernel panic - not syncing: Fatal exception in interrupt Link: https://lore.kernel.org/r/20200623140242.98864-1-maier@linux.ibm.com Fixes: 75492a51568b ("s390/scsi: Convert timers to use timer_setup()") Cc: #4.15+ Reviewed-by: Julian Wiedmann Signed-off-by: Steffen Maier Signed-off-by: Martin K. Petersen commit 46da547e21d6cefceec3fb3dba5ebbca056627fc Author: SeongJae Park Date: Tue Jun 23 10:41:22 2020 +0200 scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset() Commit cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu") has introduced static checker warnings for potential null dereferences in 'lpfc_sli4_hba_unset()' and commit 1ffdd2c0440d ("scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset") has tried to fix it. However, yet another potential null dereference is remaining. This commit fixes it. This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc. Link: https://lore.kernel.org/r/20200623084122.30633-1-sjpark@amazon.com Fixes: 1ffdd2c0440d ("scsi: lpfc: resolve static checker warning inlpfc_sli4_hba_unset") Fixes: cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu") Reviewed-by: James Smart Signed-off-by: SeongJae Park Signed-off-by: Martin K. Petersen commit 0275875530f692c725c6f993aced2eca2d6ac50c Merge: 41b14fb8724d 2e919bc446fa Author: David S. Miller Date: Tue Jun 23 20:53:28 2020 -0700 Merge branch 'Two-phylink-pause-fixes' Russell King says: ==================== Two phylink pause fixes While testing, I discovered two issues with ethtool -A with phylink. First, if there is a PHY bound to the network device, we hit a deadlock when phylib tries to notify us of the link changing as a result of triggering a renegotiation. Second, when we are manually forcing the pause settings, and there is no renegotiation triggered, we do not update the MAC via the new mac_link_up approach. These two patches solve both problems, and will need to be backported to v5.7; they do not apply cleanly there due to the introduction of PCS in the v5.8 merge window. ==================== Signed-off-by: David S. Miller commit 2e919bc446faee429ac862a6cdb5e40017051f6b Author: Russell King Date: Tue Jun 23 17:47:29 2020 +0100 net: phylink: ensure manual pause mode configuration takes effect We have been relying on link events and mac_config() when the manual pause modes are changed. With recent developments, such as moving the programming of link state to mac_link_up(), this no longer works. To ensure that we update the MAC, we must generate a link-down followed by a link-up event; we can do that by setting mac_link_dropped and triggering a resolve. Fixes: 91a208f2185a ("net: phylink: propagate resolved link config via mac_link_up()") Signed-off-by: Russell King Signed-off-by: David S. Miller commit c718af2d00a37587b09e5958d142da7569f3d55b Author: Russell King Date: Tue Jun 23 17:47:23 2020 +0100 net: phylink: fix ethtool -A with attached PHYs Fix a phylink's ethtool set_pauseparam support deadlock caused by phylib interacting with phylink: we must not hold the state lock while calling phylib functions that may call into phylink_phy_change(). Fixes: f904f15ea9b5 ("net: phylink: allow ethtool -A to change flow control advertisement") Signed-off-by: Russell King Signed-off-by: David S. Miller commit aad4b4d15f30de087c5972cfb767fadb5dbc3c52 Author: Christoph Hellwig Date: Sat Jun 20 09:13:02 2020 +0200 scsi: libata: Fix the ata_scsi_dma_need_drain stub We not only need the stub when libata is disabled, but also if it is modular and there are built-in SAS drivers (which can happen when SCSI_SAS_ATA is disabled). Link: https://lore.kernel.org/r/20200620071302.462974-2-hch@lst.de Fixes: b8f1d1e05817 ("scsi: Wire up ata_scsi_dma_need_drain for SAS HBA drivers") Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 632f24f09d5b7c8a2f94932c3391ca957ae76cc4 Author: Roman Bolshakov Date: Fri Jun 5 17:44:37 2020 +0300 scsi: qla2xxx: Keep initiator ports after RSCN The driver performs SCR (state change registration) in all modes including pure target mode. For each RSCN, scan_needed flag is set in qla2x00_handle_rscn() for the port mentioned in the RSCN and fabric rescan is scheduled. During the rescan, GNN_FT handler, qla24xx_async_gnnft_done() deletes session of the port that caused the RSCN. In target mode, the session deletion has an impact on ATIO handler, qlt_24xx_atio_pkt(). Target responds with SAM STATUS BUSY to I/O incoming from the deleted session. qlt_handle_cmd_for_atio() and qlt_handle_task_mgmt() return -EFAULT if they are not able to find session of the command/TMF, and that results in invocation of qlt_send_busy(): qlt_24xx_atio_pkt_all_vps: qla_target(0): type 6 ox_id 0014 qla_target(0): Unable to send command to target, sending BUSY status Such response causes command timeout on the initiator. Error handler thread on the initiator will be spawned to abort the commands: scsi 23:0:0:0: tag#0 abort scheduled scsi 23:0:0:0: tag#0 aborting command qla2xxx [0000:af:00.0]-188c:23: Entered qla24xx_abort_command. qla2xxx [0000:af:00.0]-801c:23: Abort command issued nexus=23:0:0 -- 0 2003. Command abort is rejected by target and fails (2003), error handler then tries to perform DEVICE RESET and TARGET RESET but they're also doomed to fail because TMFs are ignored for the deleted sessions. Then initiator makes BUS RESET that resets the link via qla2x00_full_login_lip(). BUS RESET succeeds and brings initiator port up, SAN switch detects that and sends RSCN to the target port and it fails again the same way as described above. It never goes out of the loop. The change breaks the RSCN loop by keeping initiator sessions mentioned in RSCN payload in all modes, including dual and pure target mode. Link: https://lore.kernel.org/r/20200605144435.27023-1-r.bolshakov@yadro.com Fixes: 2037ce49d30a ("scsi: qla2xxx: Fix stale session") Cc: Quinn Tran Cc: Arun Easi Cc: Nilesh Javali Cc: Bart Van Assche Cc: Daniel Wagner Cc: Himanshu Madhani Cc: Martin Wilck Cc: stable@vger.kernel.org # v5.4+ Reviewed-by: Daniel Wagner Reviewed-by: Shyam Sundar Reviewed-by: Himanshu Madhani Signed-off-by: Roman Bolshakov Signed-off-by: Martin K. Petersen commit 41b14fb8724d5a4b382a63cb4a1a61880347ccb8 Author: Tariq Toukan Date: Mon Jun 22 23:26:04 2020 +0300 net: Do not clear the sock TX queue in sk_set_socket() Clearing the sock TX queue in sk_set_socket() might cause unexpected out-of-order transmit when called from sock_orphan(), as outstanding packets can pick a different TX queue and bypass the ones already queued. This is undesired in general. More specifically, it breaks the in-order scheduling property guarantee for device-offloaded TLS sockets. Remove the call to sk_tx_queue_clear() in sk_set_socket(), and add it explicitly only where needed. Fixes: e022f0b4a03f ("net: Introduce sk_tx_queue_mapping") Signed-off-by: Tariq Toukan Reviewed-by: Boris Pismenny Signed-off-by: David S. Miller commit ef2e3ec520a8c20661ca4e7d17a5c7110d3a7828 Author: Daniel Wagner Date: Thu Jun 4 12:07:45 2020 +0200 scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request The qla2xxx driver knows when request was processed successfully or not. But it always sets the NVMe status code to 0/NVME_SC_SUCCESS. The upper layer needs to figure out from the rcv_rsplen and transferred_length variables if the request was transferred successfully. This is not always possible, e.g. when the request data length is 0, the transferred_length is also set 0 which is interpreted as success in nvme_fc_fcpio_done(). Let's inform the upper layer (nvme_fc_fcpio_done()) when something went wrong. nvme_fc_fcpio_done() maps all non-NVME_SC_SUCCESS status codes to NVME_SC_HOST_PATH_ERROR. There isn't any benefit to map the QLA status code to the NVMe status code. Therefore, use NVME_SC_INTERNAL to indicate an error which aligns it with the lpfc driver. Link: https://lore.kernel.org/r/20200604100745.89250-1-dwagner@suse.de Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner Signed-off-by: Martin K. Petersen commit 4b973f49830d74de36b5f4a75c07f6658524d2e4 Author: Andrew Lunn Date: Wed Jun 24 03:25:45 2020 +0200 net: ethtool: Handle missing cable test TDR parameters A last minute change put the TDR cable test parameters into a nest. The validation is not sufficient, resulting in an oops if the nest is missing. Set default values first, then update them if the nest is provided. Fixes: f2bc8ad31a7f ("net: ethtool: Allow PHY cable test TDR data to configured") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 54cc017c21b1a3fac71534125f6843cb1ccaa45e Merge: a83024b95ab4 c55e28a8b43f Author: David S. Miller Date: Tue Jun 23 20:13:58 2020 -0700 Merge branch 'bnxt_en-Bug-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes. The first patch stores the firmware version code which is needed by the next 2 patches to determine some worarounds based on the firmware version. The workarounds are to disable legacy TX push mode and to clear the hardware statistics during ifdown. The last patch checks that it is a PF before reading the VPD. Please also queue these for -stable. Thanks. ==================== Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit c55e28a8b43fcd7dc71868bd165705bc7741a7ca Author: Vasundhara Volam Date: Tue Jun 23 19:01:38 2020 -0400 bnxt_en: Read VPD info only for PFs Virtual functions does not have VPD information. This patch modifies calling bnxt_read_vpd_info() only for PFs and avoids an unnecessary error log. Fixes: a0d0fd70fed5 ("bnxt_en: Read partno and serialno of the board from VPD") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit c2dec363feb41544a76c8083aca2378990e17166 Author: Michael Chan Date: Tue Jun 23 19:01:37 2020 -0400 bnxt_en: Fix statistics counters issue during ifdown with older firmware. On older firmware, the hardware statistics are not cleared when the driver frees the hardware stats contexts during ifdown. The driver expects these stats to be cleared and saves a copy before freeing the stats contexts. During the next ifup, the driver will likely allocate the same hardware stats contexts and this will cause a big increase in the counters as the old counters are added back to the saved counters. We fix it by making an additional firmware call to clear the counters before freeing the hw stats contexts when the firmware is the older 20.x firmware. Fixes: b8875ca356f1 ("bnxt_en: Save ring statistics before reset.") Reported-by: Jakub Kicinski Reviewed-by: Vasundhara Volam Signed-off-by: Michael Chan Tested-by: Jakub Kicinski Signed-off-by: David S. Miller commit fed7edd18143c68c63ea049999a7e861123de6de Author: Michael Chan Date: Tue Jun 23 19:01:36 2020 -0400 bnxt_en: Do not enable legacy TX push on older firmware. Older firmware may not support legacy TX push properly and may not be disabling it. So we check certain firmware versions that may have this problem and disable legacy TX push unconditionally. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit d0ad2ea2bc185835f8a749302ad07b70528d2a09 Author: Michael Chan Date: Tue Jun 23 19:01:35 2020 -0400 bnxt_en: Store the running firmware version code. We currently only store the firmware version as a string for ethtool and devlink info. Store it also as a version code. The next 2 patches will need to check the firmware major version to determine some workarounds. We also use the 16-bit firmware version fields if the firmware is newer and provides the 16-bit fields. Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 20dc3847cc2fc886ee4eb9112e6e2fad9419b0c7 Author: Sascha Ortmann Date: Thu Jun 18 18:33:01 2020 +0200 tracing/boottime: Fix kprobe multiple events Fix boottime kprobe events to report and abort after each failure when adding probes. As an example, when we try to set multiprobe kprobe events in bootconfig like this: ftrace.event.kprobes.vfsevents { probes = "vfs_read $arg1 $arg2,, !error! not reported;?", // leads to error "vfs_write $arg1 $arg2" } This will not work as expected. After commit da0f1f4167e3af69e ("tracing/boottime: Fix kprobe event API usage"), the function trace_boot_add_kprobe_event will not produce any error message when adding a probe fails at kprobe_event_gen_cmd_start. Furthermore, we continue to add probes when kprobe_event_gen_cmd_end fails (and kprobe_event_gen_cmd_start did not fail). In this case the function even returns successfully when the last call to kprobe_event_gen_cmd_end is successful. The behaviour of reporting and aborting after failures is not consistent. The function trace_boot_add_kprobe_event now reports each failure and stops adding probes immediately. Link: https://lkml.kernel.org/r/20200618163301.25854-1-sascha.ortmann@stud.uni-hannover.de Cc: stable@vger.kernel.org Cc: linux-kernel@i4.cs.fau.de Co-developed-by: Maximilian Werner Fixes: da0f1f4167e3 ("tracing/boottime: Fix kprobe event API usage") Acked-by: Masami Hiramatsu Signed-off-by: Maximilian Werner Signed-off-by: Sascha Ortmann Signed-off-by: Steven Rostedt (VMware) commit 6784beada631800f2c5afd567e5628c843362cee Author: Masami Hiramatsu Date: Sat Jun 20 12:46:03 2020 +0900 tracing: Fix event trigger to accept redundant spaces Fix the event trigger to accept redundant spaces in the trigger input. For example, these return -EINVAL echo " traceon" > events/ftrace/print/trigger echo "traceon if common_pid == 0" > events/ftrace/print/trigger echo "disable_event:kmem:kmalloc " > events/ftrace/print/trigger But these are hard to find what is wrong. To fix this issue, use skip_spaces() to remove spaces in front of actual tokens, and set NULL if there is no token. Link: http://lkml.kernel.org/r/159262476352.185015.5261566783045364186.stgit@devnote2 Cc: Tom Zanussi Cc: stable@vger.kernel.org Fixes: 85f2b08268c0 ("tracing: Add basic event trigger framework") Reviewed-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 6c95503c292610ff2898b4271c510c16efdcd4e1 Author: Masami Hiramatsu Date: Sat Jun 20 12:45:54 2020 +0900 tracing/boot: Fix config dependency for synthedic event Since commit 726721a51838 ("tracing: Move synthetic events to a separate file") decoupled synthetic event from histogram, boot-time tracing also has to check CONFIG_SYNTH_EVENT instead of CONFIG_HIST_TRIGGERS. Link: http://lkml.kernel.org/r/159262475441.185015.5300725180746017555.stgit@devnote2 Fixes: 726721a51838 ("tracing: Move synthetic events to a separate file") Reviewed-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 3c597282887fd55181578996dca52ce697d985a5 Author: Gao Xiang Date: Fri Jun 19 07:43:49 2020 +0800 erofs: fix partially uninitialized misuse in z_erofs_onlinepage_fixup Hongyu reported "id != index" in z_erofs_onlinepage_fixup() with specific aarch64 environment easily, which wasn't shown before. After digging into that, I found that high 32 bits of page->private was set to 0xaaaaaaaa rather than 0 (due to z_erofs_onlinepage_init behavior with specific compiler options). Actually we only use low 32 bits to keep the page information since page->private is only 4 bytes on most 32-bit platforms. However z_erofs_onlinepage_fixup() uses the upper 32 bits by mistake. Let's fix it now. Reported-and-tested-by: Hongyu Jin Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") Cc: # 4.19+ Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20200618234349.22553-1-hsiangkao@aol.com Signed-off-by: Gao Xiang commit 4845446036fc9c13f43b54a65c9b757c14f5141b Author: yu kuai Date: Thu Jun 4 20:54:49 2020 +0800 ARM: imx6: add missing put_device() call in imx6q_suspend_init() if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Signed-off-by: yu kuai Signed-off-by: Shawn Guo commit 586745f1598ccf71b0a5a6df2222dee0a865954e Author: yu kuai Date: Thu Jun 4 20:42:06 2020 +0800 ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram() if of_find_device_by_node() succeed, imx_suspend_alloc_ocram() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: 1579c7b9fe01 ("ARM: imx53: Set DDR pins to high impedance when in suspend to RAM.") Signed-off-by: yu kuai Signed-off-by: Shawn Guo commit bcc7f554cfa7e0ac77c7adc4027c16f4a2f99c6f Author: Quentin Monnet Date: Tue Jun 23 16:39:35 2020 +0100 bpf: Fix formatting in documentation for BPF helpers When producing the bpf-helpers.7 man page from the documentation from the BPF user space header file, rst2man complains: :2636: (ERROR/3) Unexpected indentation. :2640: (WARNING/2) Block quote ends without a blank line; unexpected unindent. Let's fix formatting for the relevant chunk (item list in bpf_ringbuf_query()'s description), and for a couple other functions. Signed-off-by: Quentin Monnet Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200623153935.6215-1-quentin@isovalent.com commit b338cb921e6739ff59ce32f43342779fe5ffa732 Author: Maciej Żenczykowski Date: Sat Jun 20 14:26:16 2020 -0700 bpf: Restore behaviour of CAP_SYS_ADMIN allowing the loading of networking bpf programs This is a fix for a regression in commit 2c78ee898d8f ("bpf: Implement CAP_BPF"). Before the above commit it was possible to load network bpf programs with just the CAP_SYS_ADMIN privilege. The Android bpfloader happens to run in such a configuration (it has SYS_ADMIN but not NET_ADMIN) and creates maps and loads bpf programs for later use by Android's netd (which has NET_ADMIN but not SYS_ADMIN). Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") Reported-by: John Stultz Signed-off-by: Maciej Żenczykowski Signed-off-by: Alexei Starovoitov Tested-by: John Stultz Link: https://lore.kernel.org/bpf/20200620212616.93894-1-zenczykowski@gmail.com commit c4c0bdc0d2d084ed847c7066bdf59fe2cd25aa17 Author: Yonghong Song Date: Tue Jun 23 17:10:54 2020 -0700 bpf: Set the number of exception entries properly for subprograms Currently, if a bpf program has more than one subprograms, each program will be jitted separately. For programs with bpf-to-bpf calls the prog->aux->num_exentries is not setup properly. For example, with bpf_iter_netlink.c modified to force one function to be not inlined and with CONFIG_BPF_JIT_ALWAYS_ON the following error is seen: $ ./test_progs -n 3/3 ... libbpf: failed to load program 'iter/netlink' libbpf: failed to load object 'bpf_iter_netlink' libbpf: failed to load BPF skeleton 'bpf_iter_netlink': -4007 test_netlink:FAIL:bpf_iter_netlink__open_and_load skeleton open_and_load failed #3/3 netlink:FAIL The dmesg shows the following errors: ex gen bug which is triggered by the following code in arch/x86/net/bpf_jit_comp.c: if (excnt >= bpf_prog->aux->num_exentries) { pr_err("ex gen bug\n"); return -EFAULT; } This patch fixes the issue by computing proper num_exentries for each subprogram before calling JIT. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit bf1028a41eaf0ce39518cbdda34cdb717f16364a Author: Gustavo A. R. Silva Date: Mon Jun 15 17:41:12 2020 -0500 cifs: misc: Use array_size() in if-statement controlling expression Use array_size() instead of the open-coded version in the controlling expression of the if statement. Also, while there, use the preferred form for passing a size of a struct. The alternative form where struct name is spelled out hurts readability and introduces an opportunity for a bug when the pointer variable type is changed but the corresponding sizeof that is passed as argument is not. This issue was found with the help of Coccinelle and, audited and fixed manually. Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Reviewed-by: Kees Cook Signed-off-by: Steve French commit 5618303d8516f8ac5ecfe53ee8e8bc9a40eaf066 Author: Zhang Xiaoxu Date: Fri Jun 19 22:51:29 2020 -0400 cifs: update ctime and mtime during truncate As the man description of the truncate, if the size changed, then the st_ctime and st_mtime fields should be updated. But in cifs, we doesn't do it. It lead the xfstests generic/313 failed. So, add the ATTR_MTIME|ATTR_CTIME flags on attrs when change the file size Reported-by: Hulk Robot Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit acc91c2d8de4ef46ed751c5f9df99ed9a109b100 Author: Zhang Xiaoxu Date: Tue Jun 23 07:31:53 2020 -0400 cifs/smb3: Fix data inconsistent when punch hole When punch hole success, we also can read old data from file: # strace -e trace=pread64,fallocate xfs_io -f -c "pread 20 40" \ -c "fpunch 20 40" -c"pread 20 40" file pread64(3, " version 5.8.0-rc1+"..., 40, 20) = 40 fallocate(3, FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE, 20, 40) = 0 pread64(3, " version 5.8.0-rc1+"..., 40, 20) = 40 CIFS implements the fallocate(FALLOCATE_FL_PUNCH_HOLE) with send SMB ioctl(FSCTL_SET_ZERO_DATA) to server. It just set the range of the remote file to zero, but local page caches not updated, then the local page caches inconsistent with server. Also can be found by xfstests generic/316. So, we need to remove the page caches before send the SMB ioctl(FSCTL_SET_ZERO_DATA) to server. Fixes: 31742c5a33176 ("enable fallocate punch hole ("fallocate -p") for SMB3") Suggested-by: Pavel Shilovsky Reviewed-by: Pavel Shilovsky Signed-off-by: Zhang Xiaoxu Cc: stable@vger.kernel.org # v3.17 Signed-off-by: Steve French commit 6b69040247e14b43419a520f841f2b3052833df9 Author: Zhang Xiaoxu Date: Tue Jun 23 07:31:54 2020 -0400 cifs/smb3: Fix data inconsistent when zero file range CIFS implements the fallocate(FALLOC_FL_ZERO_RANGE) with send SMB ioctl(FSCTL_SET_ZERO_DATA) to server. It just set the range of the remote file to zero, but local page cache not update, then the data inconsistent with server, which leads the xfstest generic/008 failed. So we need to remove the local page caches before send SMB ioctl(FSCTL_SET_ZERO_DATA) to server. After next read, it will re-cache it. Fixes: 30175628bf7f5 ("[SMB3] Enable fallocate -z support for SMB3 mounts") Reported-by: Hulk Robot Signed-off-by: Zhang Xiaoxu Reviewed-by: Pavel Shilovsky Cc: stable@vger.kernel.org # v3.17 Signed-off-by: Steve French commit 9c82a63cf3701b78cd092c69c3e75ff806837194 Author: Andrii Nakryiko Date: Fri Jun 19 16:04:22 2020 -0700 libbpf: Fix CO-RE relocs against .text section bpf_object__find_program_by_title(), used by CO-RE relocation code, doesn't return .text "BPF program", if it is a function storage for sub-programs. Because of that, any CO-RE relocation in helper non-inlined functions will fail. Fix this by searching for .text-corresponding BPF program manually. Adjust one of bpf_iter selftest to exhibit this pattern. Fixes: ddc7c3042614 ("libbpf: implement BPF CO-RE offset relocation algorithm") Reported-by: Yonghong Song Signed-off-by: Andrii Nakryiko Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200619230423.691274-1-andriin@fb.com commit 23e390cdbe6f85827a43d38f9288dcd3066fa376 Author: KP Singh Date: Mon Jun 22 00:21:35 2020 +0200 security: Fix hook iteration and default value for inode_copy_up_xattr inode_copy_up_xattr returns 0 to indicate the acceptance of the xattr and 1 to reject it. If the LSM does not know about the xattr, it's expected to return -EOPNOTSUPP, which is the correct default value for this hook. BPF LSM, currently, uses 0 as the default value and thereby falsely allows all overlay fs xattributes to be copied up. The iteration logic is also updated from the "bail-on-fail" call_int_hook to continue on the non-decisive -EOPNOTSUPP and bail out on other values. Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks") Signed-off-by: KP Singh Signed-off-by: James Morris commit a83024b95ab4c4c38c8c5b0f43402ffd92a851d1 Merge: 6199496be353 20bb0c8f2c44 Author: David S. Miller Date: Tue Jun 23 15:18:48 2020 -0700 Merge branch 'cxgb4-cxgb4vf-fix-warnings-reported-by-sparse' Rahul Lakkireddy says: ==================== cxgb4/cxgb4vf: fix warnings reported by sparse This series of patches fix various warnings reported by the sparse tool. Patches 1 and 2 fix lock context imbalance warnings. Patch 3 fixes cast to restricted __be64 warning when fetching timestamp in PTP path. Patch 4 fixes several cast to restricted __be32 warnings in TC-U32 offload parser. Patch 5 fixes several cast from restricted __be16 warnings in parsing L4 ports for filters. Patch 6 fixes several restricted __be32 degrades to integer warnings when comparing IP address masks for exact-match filters. Patch 7 fixes cast to restricted __be64 warning when fetching SGE queue contexts in device dump collection. Patch 8 fixes cast from restricted __sum16 warning when saving IPv4 partial checksum. Patch 9 fixes issue with string array scope in DCB path. Patch 10 fixes a set but unused variable warning when DCB is disabled. Patch 11 fixes several kernel-doc comment warnings in cxgb4 driver. Patch 12 fixes several kernel-doc comment warnings in cxgb4vf driver. ==================== Signed-off-by: David S. Miller commit 20bb0c8f2c446c55f5a4e296beaa77d62ffe2d1e Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:42 2020 +0530 cxgb4vf: update kernel-doc line comments Update several kernel-doc line comments to fix warnings reported by make W=1. Fixes following class of warnings reported by make W=1 in several places: cxgb4vf_main.c:275: warning: Function parameter or member 'persistent' not described in 'cxgb4vf_change_mac' cxgb4vf_main.c:275: warning: Excess function parameter 'persist' description in 'cxgb4vf_change_mac' Fixes: 16f8bd4be754 ("cxgb4vf: Add core T4 PCI-E SR-IOV Virtual Function hardware definitions and device communication code") Fixes: c6e0d91464da ("cxgb4vf: Add T4 Virtual Function Scatter-Gather Engine DMA code") Fixes: e0a8b34a9cc4 ("cxgb4vf: Add and initialize some sge params for VF driver") Fixes: c3168cabe1af ("cxgb4/cxgbvf: Handle 32-bit fw port capabilities") Fixes: 0e23daeb6407 ("drivers/net: chelsio/cxgb*: Convert timers to use timer_setup()") Fixes: 3f8cfd0d95e6 ("cxgb4/cxgb4vf: Program hash region for {t4/t4vf}_change_mac()") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 29bbf5d7f5efe84f94bc66c6c24614f812a95f62 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:41 2020 +0530 cxgb4: update kernel-doc line comments Update several kernel-doc line comments to fix warnings reported by make W=1. Fixes following class of warnings reported by make W=1 in several places: l2t.c:616: warning: Cannot understand * @dev: net_device pointer t4_hw.c:3175: warning: Function parameter or member 'adap' not described in 't4_get_exprom_version' t4_hw.c:3175: warning: Excess function parameter 'adapter' description in 't4_get_exprom_version' Fixes: 56d36be4dd5f ("cxgb4: Add HW and FW support code") Fixes: fd3a47900b6f ("cxgb4: Add packet queues and packet DMA code") Fixes: 26f7cbc0a5a4 ("cxgb4: Don't attempt to upgrade T4 firmware when cxgb4 will end up as a slave") Fixes: 793dad94e745 ("RDMA/cxgb4: Fix bug for active and passive LE hash collision path") Fixes: ba3f8cd55f2a ("cxgb4: Add support in cxgb4 to get expansion rom version via ethtool") Fixes: f7502659cec8 ("cxgb4: Add API to alloc l2t entry; also update existing ones") Fixes: ddc7740d9a7c ("cxgb4: Decode link down reason code obtained from firmware") Fixes: 193c4c2845f7 ("cxgb4: Update T6 Buffer Group and Channel Mappings") Fixes: 8f46d46715a1 ("cxgb4: Use Firmware params to get buffer-group map") Fixes: a456950445a0 ("cxgb4: time stamping interface for PTP") Fixes: 9c33e4208bce ("cxgb4: Add PTP Hardware Clock (PHC) support") Fixes: c3168cabe1af ("cxgb4/cxgbvf: Handle 32-bit fw port capabilities") Fixes: 5ccf9d049615 ("cxgb4: update API for TP indirect register access") Fixes: 3bdb376e6944 ("cxgb4: introduce SMT ops to prepare for SMAC rewrite support") Fixes: 736c3b94474e ("cxgb4: collect egress and ingress SGE queue contexts") Fixes: f56ec6766dcf ("cxgb4: Add support for ethtool i2c dump") Fixes: 9d5fd927d20b ("cxgb4/cxgb4vf: add support for ndo_set_vf_vlan") Fixes: 98f3697f8d41 ("cxgb4: add tc flower match support for tunnel VNI") Fixes: 02d805dc5fe3 ("cxgb4: use new fw interface to get the VIN and smt index") Fixes: 3f8cfd0d95e6 ("cxgb4/cxgb4vf: Program hash region for {t4/t4vf}_change_mac()") Fixes: d429005fdf2c ("cxgb4/cxgb4vf: Add support for SGE doorbell queue timer") Fixes: 0e395b3cb1fb ("cxgb4: add FLOWC based QoS offload") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 00e31cfc8995de2a15352522fc672922a23b435e Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:40 2020 +0530 cxgb4: fix set but unused variable when DCB is disabled Remove the set but unused variable when DCB is disabled. Instead, do the calculation directly inline. Fixes following warning in make W=1: cxgb4_main.c: In function 'cfg_queues': cxgb4_main.c:5380:29: warning: variable 'n1g' set but not used [-Wunused-but-set-variable] u32 i, n10g = 0, qidx = 0, n1g = 0; ^ Fixes: 116ca924aea6 ("cxgb4: fix checks for max queues to allocate") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit bab3bcf3e9873e1e6e9cb39c1f55a05fb10415a4 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:39 2020 +0530 cxgb4: move DCB version extern to header file Move the DCB version string array extern to header file. Fixes following sparse warning: cxgb4_dcb.c:13:12: warning: symbol 'dcb_ver_array' was not declared. Should it be static? Fixes: ebddd97afb89 ("cxgb4: add support to display DCB info") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 2f6670165d22406467c667e9454e558bc75b933e Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:38 2020 +0530 cxgb4: remove cast when saving IPv4 partial checksum The checksum field in IPv4 header is in __sum16 and ip_fast_csum() also returns __sum16. So, no need to cast it to u16. Fixes following sparse warning: sge.c:1539:47: warning: cast from restricted __sum16 sge.c:1539:44: warning: incorrect type in assignment (different base types) sge.c:1539:44: expected restricted __sum16 [usertype] check sge.c:1539:44: got unsigned short [usertype] Fixes: d0a1299c6bf7 ("cxgb4: add support for vxlan segmentation offload") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 1992ded5d111997877a9a25205976d8d03c46814 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:37 2020 +0530 cxgb4: fix SGE queue dump destination buffer context The data in destination buffer is expected to be be parsed in big endian. So, use the right context. Fixes following sparse warning: cudbg_lib.c:2041:44: warning: incorrect type in assignment (different base types) cudbg_lib.c:2041:44: expected unsigned long long [usertype] cudbg_lib.c:2041:44: got restricted __be64 [usertype] Fixes: 736c3b94474e ("cxgb4: collect egress and ingress SGE queue contexts") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit f286dd8eaad5a2758750f407ab079298e0bcc8a5 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:36 2020 +0530 cxgb4: use correct type for all-mask IP address comparison Use correct type to check for all-mask exact match IP addresses. Fixes following sparse warnings due to big endian value checks against 0xffffffff in is_addr_all_mask(): cxgb4_filter.c:977:25: warning: restricted __be32 degrades to integer cxgb4_filter.c:983:37: warning: restricted __be32 degrades to integer cxgb4_filter.c:984:37: warning: restricted __be32 degrades to integer cxgb4_filter.c:985:37: warning: restricted __be32 degrades to integer cxgb4_filter.c:986:37: warning: restricted __be32 degrades to integer Fixes: 3eb8b62d5a26 ("cxgb4: add support to create hash-filters via tc-flower offload") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 63b53b0b99cd5f2d9754a21eda2ed8e706646cc9 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:35 2020 +0530 cxgb4: fix endian conversions for L4 ports in filters The source and destination L4 ports in filter offload need to be in CPU endian. They will finally be converted to Big Endian after all operations are done and before giving them to hardware. The L4 ports for NAT are expected to be passed as a byte stream TCB. So, treat them as such. Fixes following sparse warnings in several places: cxgb4_tc_flower.c:159:33: warning: cast from restricted __be16 cxgb4_tc_flower.c:159:33: warning: incorrect type in argument 1 (different base types) cxgb4_tc_flower.c:159:33: expected unsigned short [usertype] val cxgb4_tc_flower.c:159:33: got restricted __be16 [usertype] dst Fixes: dca4faeb812f ("cxgb4: Add LE hash collision bug fix path in LLD driver") Fixes: 62488e4b53ae ("cxgb4: add basic tc flower offload support") Fixes: 557ccbf9dfa8 ("cxgb4: add tc flower support for L3/L4 rewrite") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 27f78cb245abdb86735529c13b0a579f57829e71 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:34 2020 +0530 cxgb4: parse TC-U32 key values and masks natively TC-U32 passes all keys values and masks in __be32 format. The parser already expects this and hence pass the value and masks in __be32 natively to the parser. Fixes following sparse warnings in several places: cxgb4_tc_u32.c:57:21: warning: incorrect type in assignment (different base types) cxgb4_tc_u32.c:57:21: expected unsigned int [usertype] val cxgb4_tc_u32.c:57:21: got restricted __be32 [usertype] val cxgb4_tc_u32_parse.h:48:24: warning: cast to restricted __be32 Fixes: 2e8aad7bf203 ("cxgb4: add parser to translate u32 filters to internal spec") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 589b1c9c166dce120e27b32a83a78f55464a7ef9 Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:33 2020 +0530 cxgb4: use unaligned conversion for fetching timestamp Use get_unaligned_be64() to fetch the timestamp needed for ns_to_ktime() conversion. Fixes following sparse warning: sge.c:3282:43: warning: cast to restricted __be64 Fixes: a456950445a0 ("cxgb4: time stamping interface for PTP") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 030c98824deaba205787af501a074b3d7f46e32e Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:32 2020 +0530 cxgb4: move PTP lock and unlock to caller in Tx path Check for whether PTP is enabled or not at the caller and perform locking/unlocking at the caller. Fixes following sparse warning: sge.c:1641:26: warning: context imbalance in 'cxgb4_eth_xmit' - different lock contexts for basic block Fixes: a456950445a0 ("cxgb4: time stamping interface for PTP") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 11d8cd5c9f3b46f397f889cefdb66795518aaebd Author: Rahul Lakkireddy Date: Wed Jun 24 01:51:31 2020 +0530 cxgb4: move handling L2T ARP failures to caller Move code handling L2T ARP failures to the only caller. Fixes following sparse warning: skbuff.h:2091:29: warning: context imbalance in 'handle_failed_resolution' - unexpected unlock Fixes: 749cb5fe48bb ("cxgb4: Replace arpq_head/arpq_tail with SKB double link-list code") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit ee434a4f9f5ea15b0f84bddd8c012838cf9472c5 Author: John van der Kamp Date: Tue Jun 23 23:30:54 2020 +0200 drm/amdgpu/display: Unlock mutex on error Make sure we pass through ret label to unlock the mutex. Signed-off-by: John van der Kamp Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 6199496be35348a331cda5c072edc308e330cf23 Merge: b4730ae6a443 10f468ea5c48 Author: David S. Miller Date: Tue Jun 23 15:01:16 2020 -0700 Merge branch 'net-qed-qede-various-stability-fixes' Alexander Lobakin says: ==================== net: qed/qede: various stability fixes This set addresses several near-critical issues that were observed and reproduced on different test and production configurations. v2: - don't split the "Fixes:" tag across several lines in patch 9; - no functional changes. ==================== Signed-off-by: David S. Miller commit 10f468ea5c481b3a60cc291c4dfdc7bb338abb74 Author: Alexander Lobakin Date: Tue Jun 23 16:51:37 2020 +0300 net: qed: fix "maybe uninitialized" warning Variable 'abs_ppfid' in qed_dev.c:qed_llh_add_mac_filter() always gets printed, but is initialized only under 'ref_cnt == 1' condition. This results in: In file included from ./include/linux/kernel.h:15:0, from ./include/asm-generic/bug.h:19, from ./arch/x86/include/asm/bug.h:86, from ./include/linux/bug.h:5, from ./include/linux/io.h:11, from drivers/net/ethernet/qlogic/qed/qed_dev.c:35: drivers/net/ethernet/qlogic/qed/qed_dev.c: In function 'qed_llh_add_mac_filter': ./include/linux/printk.h:358:2: warning: 'abs_ppfid' may be used uninitialized in this function [-Wmaybe-uninitialized] printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~ drivers/net/ethernet/qlogic/qed/qed_dev.c:983:17: note: 'abs_ppfid' was declared here u8 filter_idx, abs_ppfid; ^~~~~~~~~ ...under W=1+. Fix this by initializing it with zero. Fixes: 79284adeb99e ("qed: Add llh ppfid interface and 100g support for offload protocols") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit c221dd1831732449f844e03631a34fd21c2b9429 Author: Alexander Lobakin Date: Tue Jun 23 16:51:36 2020 +0300 net: qed: reset ILT block sizes before recomputing to fix crashes Sizes of all ILT blocks must be reset before ILT recomputing when disabling clients, or memory allocation may exceed ILT shadow array and provoke system crashes. Fixes: 1408cc1fa48c ("qed: Introduce VFs") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit ec6c80590bde6b5dfa4970fffa3572f1acd313ca Author: Alexander Lobakin Date: Tue Jun 23 16:51:35 2020 +0300 net: qede: fix use-after-free on recovery and AER handling Set edev->cdev pointer to NULL after calling remove() callback to avoid using of already freed object. Fixes: ccc67ef50b90 ("qede: Error recovery process") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 1c85f394c2206ea3835f43534d5675f0574e1b70 Author: Alexander Lobakin Date: Tue Jun 23 16:51:34 2020 +0300 net: qede: fix PTP initialization on recovery Currently PTP cyclecounter and timecounter are initialized only on the first probing and are cleaned up during removal. This means that PTP becomes non-functional after device recovery. Fix this by unconditional PTP initialization on probing and clearing Tx pending bit on exiting. Fixes: ccc67ef50b90 ("qede: Error recovery process") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit d434d02f7e7c24c721365fd594ed781acb18e0da Author: Alexander Lobakin Date: Tue Jun 23 16:51:33 2020 +0300 net: qed: fix excessive QM ILT lines consumption This is likely a copy'n'paste mistake. The amount of ILT lines to reserve for a single VF was being multiplied by the total VFs count. This led to a huge redundancy in reservation and potential lines drainouts. Fixes: 1408cc1fa48c ("qed: Introduce VFs") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit ccd7c7ce167a21dbf2b698ffcf00f11d96d44f9b Author: Alexander Lobakin Date: Tue Jun 23 16:51:32 2020 +0300 net: qed: fix NVMe login fails over VFs 25ms sleep cycles in waiting for PF response are excessive and may lead to different timeout failures. Start to wait with short udelays, and in most cases polling will end here. If the time was not sufficient, switch to msleeps. usleep_range() may go far beyond 100us depending on platform and tick configuration, hence atomic udelays for consistency. Also add explicit DMA barriers since 'done' always comes from a shared request-response DMA pool, and note that in the comment nearby. Fixes: 1408cc1fa48c ("qed: Introduce VFs") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 4079c7f7a2a00ab403c177ce723b560de59139c3 Author: Alexander Lobakin Date: Tue Jun 23 16:51:31 2020 +0300 net: qede: stop adding events on an already destroyed workqueue Set rdma_wq pointer to NULL after destroying the workqueue and check for it when adding new events to fix crashes on driver unload. Fixes: cee9fbd8e2e9 ("qede: Add qedr framework") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 31333c1a2521ff4b4ceb0c29de492549cd4a8de3 Author: Alexander Lobakin Date: Tue Jun 23 16:51:30 2020 +0300 net: qed: fix async event callbacks unregistering qed_spq_unregister_async_cb() should be called before qed_rdma_info_free() to avoid crash-spawning uses-after-free. Instead of calling it from each subsystem exit code, do it in one place on PF down. Fixes: 291d57f67d24 ("qed: Fix rdma_info structure allocation") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 97dd1abd026ae4e6a82fa68645928404ad483409 Author: Alexander Lobakin Date: Tue Jun 23 16:51:29 2020 +0300 net: qed: fix left elements count calculation qed_chain_get_element_left{,_u32} returned 0 when the difference between producer and consumer page count was equal to the total page count. Fix this by conditional expanding of producer value (vs unconditional). This allowed to eliminate normalizaton against total page count, which was the cause of this bug. Misc: replace open-coded constants with common defines. Fixes: a91eb52abb50 ("qed: Revisit chain implementation") Signed-off-by: Alexander Lobakin Signed-off-by: Igor Russkikh Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit b4730ae6a443afe611afb4fb651c885c51003c15 Author: Alexander Lobakin Date: Tue Jun 23 10:43:48 2020 +0000 net: ethtool: add missing string for NETIF_F_GSO_TUNNEL_REMCSUM Commit e585f2363637 ("udp: Changes to udp_offload to support remote checksum offload") added new GSO type and a corresponding netdev feature, but missed Ethtool's 'netdev_features_strings' table. Give it a name so it will be exposed to userspace and become available for manual configuration. v3: - decouple from "netdev_features_strings[] cleanup" series; - no functional changes. v2: - don't split the "Fixes:" tag across lines; - no functional changes. Fixes: e585f2363637 ("udp: Changes to udp_offload to support remote checksum offload") Signed-off-by: Alexander Lobakin Signed-off-by: David S. Miller commit 2bcd350285ecbe442d5a1a27c04bd265baf992bb Merge: f7fb92acd9e5 900575aa33a3 Author: David S. Miller Date: Tue Jun 23 14:50:34 2020 -0700 Merge branch 'wg-fixes' Jason A. Donenfeld says: ==================== wireguard fixes for 5.8-rc3 This series contains two fixes, one cosmetic and one quite important: 1) Avoid the `if ((x = f()) == y)` pattern, from Frank Werner-Krippendorf. 2) Mitigate a potential memory leak by creating circular netns references, while also making the netns semantics a bit more robust. Patch (2) has a "Fixes:" line and should be backported to stable. ==================== Signed-off-by: David S. Miller commit 900575aa33a3eaaef802b31de187a85c4a4b4bd0 Author: Jason A. Donenfeld Date: Tue Jun 23 03:59:45 2020 -0600 wireguard: device: avoid circular netns references Before, we took a reference to the creating netns if the new netns was different. This caused issues with circular references, with two wireguard interfaces swapping namespaces. The solution is to rather not take any extra references at all, but instead simply invalidate the creating netns pointer when that netns is deleted. In order to prevent this from happening again, this commit improves the rough object leak tracking by allowing it to account for created and destroyed interfaces, aside from just peers and keys. That then makes it possible to check for the object leak when having two interfaces take a reference to each others' namespaces. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit 558b353c9c2a717509f291c066c6bd8f5f5e21be Author: Frank Werner-Krippendorf Date: Tue Jun 23 03:59:44 2020 -0600 wireguard: noise: do not assign initiation time in if condition Fixes an error condition reported by checkpatch.pl which caused by assigning a variable in an if condition in wg_noise_handshake_consume_ initiation(). Signed-off-by: Frank Werner-Krippendorf Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit f7fb92acd9e5606f6666bb0f9a7240002a6b3ff0 Merge: 26ac10be3c80 7882c895b71b Author: David S. Miller Date: Tue Jun 23 14:38:05 2020 -0700 Merge branch 'bridge-mrp-Update-MRP_PORT_ROLE' Horatiu Vultur says: ==================== bridge: mrp: Update MRP_PORT_ROLE This patch series does the following: - fixes the enum br_mrp_port_role_type. It removes the port role none(0x2) because this is in conflict with the standard. The standard defines the interconnect port role as value 0x2. - adds checks regarding current defined port roles: primary(0x0) and secondary(0x1). v2: - add the validation code when setting the port role. ==================== Signed-off-by: David S. Miller commit 7882c895b71b8cd6c81946fcc8e13d15a2841de7 Author: Horatiu Vultur Date: Tue Jun 23 11:05:41 2020 +0200 bridge: mrp: Validate when setting the port role This patch adds specific checks for primary(0x0) and secondary(0x1) when setting the port role. For any other value the function 'br_mrp_set_port_role' will return -EINVAL. Fixes: 20f6a05ef63594 ("bridge: mrp: Rework the MRP netlink interface") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2464bc7c2897b7549146a743045089d3aea7b85b Author: Horatiu Vultur Date: Tue Jun 23 11:05:40 2020 +0200 bridge: uapi: mrp: Fix MRP_PORT_ROLE Currently the MRP_PORT_ROLE_NONE has the value 0x2 but this is in conflict with the IEC 62439-2 standard. The standard defines the following port roles: primary (0x0), secondary(0x1), interconnect(0x2). Therefore remove the port role none. Fixes: 4714d13791f831 ("bridge: uapi: mrp: Add mrp attributes.") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 852f71942ce71fd9a2bb25667bda53afeb97dcb6 Author: Andy Shevchenko Date: Tue Jun 23 12:15:01 2020 +0300 i2c: designware: Adjust bus speed independently of ACPI John Stultz reported that commit f9288fcc5c615 ("i2c: designware: Move ACPI parts into common module") caused a regression on the HiKey board where adv7511 HDMI bridge driver wasn't probing anymore due the I2C bus failed to start. It seems the change caused the bus speed being zero when CONFIG_ACPI not set and neither speed based on "clock-frequency" device property or default fast mode is set. Fix this by splitting i2c_dw_acpi_adjust_bus_speed() to i2c_dw_acpi_round_bus_speed() and i2c_dw_adjust_bus_speed(), where the latter one has the code that runs independently of ACPI. Fixes: f9288fcc5c615 ("i2c: designware: Move ACPI parts into common module") Reported-by: John Stultz Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Tested-by: John Stultz Signed-off-by: Wolfram Sang commit 26e122e97a3d0390ebec389347f64f3730fdf48f Merge: 3e08a95294a4 e4553b4976d1 Author: Linus Torvalds Date: Tue Jun 23 11:01:16 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "All bugfixes except for a couple cleanup patches" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: VMX: Remove vcpu_vmx's defunct copy of host_pkru KVM: x86: allow TSC to differ by NTP correction bounds without TSC scaling KVM: X86: Fix MSR range of APIC registers in X2APIC mode KVM: VMX: Stop context switching MSR_IA32_UMWAIT_CONTROL KVM: nVMX: Plumb L2 GPA through to PML emulation KVM: x86/mmu: Avoid mixing gpa_t with gfn_t in walk_addr_generic() KVM: LAPIC: ensure APIC map is up to date on concurrent update requests kvm: lapic: fix broken vcpu hotplug Revert "KVM: VMX: Micro-optimize vmexit time when not exposing PMU" KVM: VMX: Add helpers to identify interrupt type from intr_info kvm/svm: disable KCSAN for svm_vcpu_run() KVM: MIPS: Fix a build error for !CPU_LOONGSON64 commit b772f07add1c0b22e02c0f1e96f647560679d3a9 Author: Xuan Zhuo Date: Tue Jun 23 19:34:06 2020 +0800 io_uring: fix io_sq_thread no schedule when busy When the user consumes and generates sqe at a fast rate, io_sqring_entries can always get sqe, and ret will not be equal to -EBUSY, so that io_sq_thread will never call cond_resched or schedule, and then we will get the following system error prompt: rcu: INFO: rcu_sched self-detected stall on CPU or watchdog: BUG: soft lockup-CPU#23 stuck for 112s! [io_uring-sq:1863] This patch checks whether need to call cond_resched() by checking the need_resched() function every cycle. Suggested-by: Jens Axboe Signed-off-by: Xuan Zhuo Signed-off-by: Jens Axboe commit 842ec61f4006a6477a9deaedd69131e9f46e4cb5 Author: Maxime Ripard Date: Wed May 13 16:07:24 2020 +0200 drm/sun4i: mixer: Call of_dma_configure if there's an IOMMU The main DRM device is actually a virtual device so it doesn't have the iommus property, which is instead on the DMA masters, in this case the mixers. Add a call to of_dma_configure with the mixers DT node but on the DRM virtual device to configure it in the same way than the mixers. Reviewed-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/9a4daf438dd3f2fe07afb23688bfb793a0613d7d.1589378833.git-series.maxime@cerno.tech (cherry picked from commit b718102dbdfd0285ad559687a30e27cc9124e592) [Maxime: Applied to -fixes since it missed the merge window and display is broken without it] Signed-off-by: Maxime Ripard commit 95a3d8f3af9b0d63b43f221b630beaab9739d13a Author: Zhang Xiaoxu Date: Mon Jun 22 05:30:19 2020 -0400 cifs: Fix double add page to memcg when cifs_readpages When xfstests generic/451, there is an BUG at mm/memcontrol.c: page:ffffea000560f2c0 refcount:2 mapcount:0 mapping:000000008544e0ea index:0xf mapping->aops:cifs_addr_ops dentry name:"tst-aio-dio-cycle-write.451" flags: 0x2fffff80000001(locked) raw: 002fffff80000001 ffffc90002023c50 ffffea0005280088 ffff88815cda0210 raw: 000000000000000f 0000000000000000 00000002ffffffff ffff88817287d000 page dumped because: VM_BUG_ON_PAGE(page->mem_cgroup) page->mem_cgroup:ffff88817287d000 ------------[ cut here ]------------ kernel BUG at mm/memcontrol.c:2659! invalid opcode: 0000 [#1] SMP CPU: 2 PID: 2038 Comm: xfs_io Not tainted 5.8.0-rc1 #44 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_ 073836-buildvm-ppc64le-16.ppc.4 RIP: 0010:commit_charge+0x35/0x50 Code: 0d 48 83 05 54 b2 02 05 01 48 89 77 38 c3 48 c7 c6 78 4a ea ba 48 83 05 38 b2 02 05 01 e8 63 0d9 RSP: 0018:ffffc90002023a50 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffff88817287d000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff88817ac97ea0 RDI: ffff88817ac97ea0 RBP: ffffea000560f2c0 R08: 0000000000000203 R09: 0000000000000005 R10: 0000000000000030 R11: ffffc900020237a8 R12: 0000000000000000 R13: 0000000000000001 R14: 0000000000000001 R15: ffff88815a1272c0 FS: 00007f5071ab0800(0000) GS:ffff88817ac80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055efcd5ca000 CR3: 000000015d312000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mem_cgroup_charge+0x166/0x4f0 __add_to_page_cache_locked+0x4a9/0x710 add_to_page_cache_locked+0x15/0x20 cifs_readpages+0x217/0x1270 read_pages+0x29a/0x670 page_cache_readahead_unbounded+0x24f/0x390 __do_page_cache_readahead+0x3f/0x60 ondemand_readahead+0x1f1/0x470 page_cache_async_readahead+0x14c/0x170 generic_file_buffered_read+0x5df/0x1100 generic_file_read_iter+0x10c/0x1d0 cifs_strict_readv+0x139/0x170 new_sync_read+0x164/0x250 __vfs_read+0x39/0x60 vfs_read+0xb5/0x1e0 ksys_pread64+0x85/0xf0 __x64_sys_pread64+0x22/0x30 do_syscall_64+0x69/0x150 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f5071fcb1af Code: Bad RIP value. RSP: 002b:00007ffde2cdb8e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000011 RAX: ffffffffffffffda RBX: 00007ffde2cdb990 RCX: 00007f5071fcb1af RDX: 0000000000001000 RSI: 000055efcd5ca000 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: 0000000000000001 R13: 000000000009f000 R14: 0000000000000000 R15: 0000000000001000 Modules linked in: ---[ end trace 725fa14a3e1af65c ]--- Since commit 3fea5a499d57 ("mm: memcontrol: convert page cache to a new mem_cgroup_charge() API") not cancel the page charge, the pages maybe double add to pagecache: thread1 | thread2 cifs_readpages readpages_get_pages add_to_page_cache_locked(head,index=n)=0 | readpages_get_pages | add_to_page_cache_locked(head,index=n+1)=0 add_to_page_cache_locked(head, index=n+1)=-EEXIST then, will next loop with list head page's index=n+1 and the page->mapping not NULL readpages_get_pages add_to_page_cache_locked(head, index=n+1) commit_charge VM_BUG_ON_PAGE So, we should not do the next loop when any page add to page cache failed. Reported-by: Hulk Robot Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French Acked-by: Ronnie Sahlberg commit 3e08a95294a4fb3702bb3d35ed08028433c37fe6 Merge: dd0d718152e4 b091f7fede97 Author: Linus Torvalds Date: Tue Jun 23 09:20:11 2020 -0700 Merge tag 'for-5.8-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A number of fixes, located in two areas, one performance fix and one fixup for better integration with another patchset. - bug fixes in nowait aio: - fix snapshot creation hang after nowait-aio was used - fix failure to write to prealloc extent past EOF - don't block when extent range is locked - block group fixes: - relocation failure when scrub runs in parallel - refcount fix when removing fails - fix race between removal and creation - space accounting fixes - reinstante fast path check for log tree at unlink time, fixes performance drop up to 30% in REAIM - kzfree/kfree fixup to ease treewide patchset renaming kzfree" * tag 'for-5.8-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: use kfree() in btrfs_ioctl_get_subvol_info() btrfs: fix RWF_NOWAIT writes blocking on extent locks and waiting for IO btrfs: fix RWF_NOWAIT write not failling when we need to cow btrfs: fix failure of RWF_NOWAIT write into prealloc extent beyond eof btrfs: fix hang on snapshot creation after RWF_NOWAIT write btrfs: check if a log root exists before locking the log_mutex on unlink btrfs: fix bytes_may_use underflow when running balance and scrub in parallel btrfs: fix data block group relocation failure due to concurrent scrub btrfs: fix race between block group removal and block group creation btrfs: fix a block group ref counter leak after failure to remove block group commit 0659d4205db4d0225efd8f83291cbacfcdea030c Author: Christophe JAILLET Date: Sun Jun 21 10:18:54 2020 +0200 PM: sleep: core: mark 2 functions as __init to save some memory 'early_resume_init()' and 'late_resume_init() 'are only called respectively via 'early_resume_init' and 'late_resume_init'. They can be marked as __init to save a few bytes of memory. Signed-off-by: Christophe JAILLET [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit 589bab6bb30c8cd43a7da6dcf43cc3a586cc2e25 Author: Srinivas Pandruvada Date: Fri Jun 12 11:09:57 2020 -0700 cpufreq: intel_pstate: Add one more OOB control bit Add one more bit for OOB (Out Of Band) enabling of P-states. If OOB handling of P-states is enabled, intel_pstate shouldn't load. Currently, only "BIT(8) == 1" of the MSR MSR_MISC_PWR_MGMT is considered as OOB, but "BIT(18) == 1" needs to be taken into consideration as OOB condition too. Signed-off-by: Srinivas Pandruvada [ rjw: Add an empty code line, edit subject and changelog ] Signed-off-by: Rafael J. Wysocki commit 097350d1c6e1f5808cae142006f18a0bbc57018d Author: Steven Rostedt (VMware) Date: Mon Jun 22 15:18:15 2020 -0400 ring-buffer: Zero out time extend if it is nested and not absolute Currently the ring buffer makes events that happen in interrupts that preempt another event have a delta of zero. (Hopefully we can change this soon). But this is to deal with the races of updating a global counter with lockless and nesting functions updating deltas. With the addition of absolute time stamps, the time extend didn't follow this rule. A time extend can happen if two events happen longer than 2^27 nanoseconds appart, as the delta time field in each event is only 27 bits. If that happens, then a time extend is injected with 2^59 bits of nanoseconds to use (18 years). But if the 2^27 nanoseconds happen between two events, and as it is writing the event, an interrupt triggers, it will see the 2^27 difference as well and inject a time extend of its own. But a recent change made the time extend logic not take into account the nesting, and this can cause two time extend deltas to happen moving the time stamp much further ahead than the current time. This gets all reset when the ring buffer moves to the next page, but that can cause time to appear to go backwards. This was observed in a trace-cmd recording, and since the data is saved in a file, with trace-cmd report --debug, it was possible to see that this indeed did happen! bash-52501 110d... 81778.908247: sched_switch: bash:52501 [120] S ==> swapper/110:0 [120] [12770284:0x2e8:64] -0 110d... 81778.908757: sched_switch: swapper/110:0 [120] R ==> bash:52501 [120] [509947:0x32c:64] TIME EXTEND: delta:306454770 length:0 bash-52501 110.... 81779.215212: sched_swap_numa: src_pid=52501 src_tgid=52388 src_ngid=52501 src_cpu=110 src_nid=2 dst_pid=52509 dst_tgid=52388 dst_ngid=52501 dst_cpu=49 dst_nid=1 [0:0x378:48] TIME EXTEND: delta:306458165 length:0 bash-52501 110dNh. 81779.521670: sched_wakeup: migration/110:565 [0] success=1 CPU:110 [0:0x3b4:40] and at the next page, caused the time to go backwards: bash-52504 110d... 81779.685411: sched_switch: bash:52504 [120] S ==> swapper/110:0 [120] [8347057:0xfb4:64] CPU:110 [SUBBUFFER START] [81779379165886:0x1320000] -0 110dN.. 81779.379166: sched_wakeup: bash:52504 [120] success=1 CPU:110 [0:0x10:40] -0 110d... 81779.379167: sched_switch: swapper/110:0 [120] R ==> bash:52504 [120] [1168:0x3c:64] Link: https://lkml.kernel.org/r/20200622151815.345d1bf5@oasis.local.home Cc: Ingo Molnar Cc: Andrew Morton Cc: Tom Zanussi Cc: stable@vger.kernel.org Fixes: dc4e2801d400b ("ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP") Reported-by: Julia Lawall Signed-off-by: Steven Rostedt (VMware) commit 4dc9b282bf5fc80b1761bac467adf78cd417b777 Author: Mark Brown Date: Fri Jun 19 13:35:50 2020 +0100 arm64: Depend on newer binutils when building PAC Versions of binutils prior to 2.33.1 don't understand the ELF notes that are added by modern compilers to indicate the PAC and BTI options used to build the code. This causes them to emit large numbers of warnings in the form: aarch64-linux-gnu-nm: warning: .tmp_vmlinux.kallsyms2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 during the kernel build which is currently causing quite a bit of disruption for automated build testing using clang. In commit 15cd0e675f3f76b (arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch) we added a dependency on binutils to avoid this issue when building with versions of GCC that emit the notes but did not do so for clang as it was believed that the existing check for .cfi_negate_ra_state was already requiring a new enough binutils. This does not appear to be the case for some versions of binutils (eg, the binutils in Debian 10) so instead refactor so we require a new enough GNU binutils in all cases other than when we are using an old GCC version that does not emit notes. Other, more exotic, combinations of tools are possible such as using clang, lld and gas together are possible and may have further problems but rather than adding further version checks it looks like the most robust thing will be to just test that we can build cleanly with the configured tools but that will require more review and discussion so do this for now to address the immediate problem disrupting build testing. Reported-by: KernelCI Reported-by: Nick Desaulniers Signed-off-by: Mark Brown Reviewed-by: Nick Desaulniers Link: https://github.com/ClangBuiltLinux/linux/issues/1054 Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org Signed-off-by: Will Deacon commit 81e6737518a1e392ead4e568a4ee70bb7c371458 Author: Chen Yu Date: Tue Jun 23 14:31:31 2020 +0800 PM: s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle Suspend to idle was found to not work on Goldmont CPU recently. The issue happens due to: 1. On Goldmont the CPU in idle can only be woken up via IPIs, not POLLING mode, due to commit 08e237fa56a1 ("x86/cpu: Add workaround for MONITOR instruction erratum on Goldmont based CPUs") 2. When the CPU is entering suspend to idle process, the _TIF_POLLING_NRFLAG remains on, because cpuidle_enter_s2idle() doesn't match call_cpuidle() exactly. 3. Commit b2a02fc43a1f ("smp: Optimize send_call_function_single_ipi()") makes use of _TIF_POLLING_NRFLAG to avoid sending IPIs to idle CPUs. 4. As a result, some IPIs related functions might not work well during suspend to idle on Goldmont. For example, one suspected victim: tick_unfreeze() -> timekeeping_resume() -> hrtimers_resume() -> clock_was_set() -> on_each_cpu() might wait forever, because the IPIs will not be sent to the CPUs which are sleeping with _TIF_POLLING_NRFLAG set, and Goldmont CPU could not be woken up by only setting _TIF_NEED_RESCHED on the monitor address. To avoid that, clear the _TIF_POLLING_NRFLAG flag before invoking enter_s2idle_proper() in cpuidle_enter_s2idle() in analogy with the call_cpuidle() code flow. Fixes: b2a02fc43a1f ("smp: Optimize send_call_function_single_ipi()") Suggested-by: Peter Zijlstra (Intel) Suggested-by: Rafael J. Wysocki Reported-by: kbuild test robot Signed-off-by: Chen Yu [ rjw: Subject / changelog ] Signed-off-by: Rafael J. Wysocki commit a32a1fc99807244d920d274adc46ba04b538cc8a Author: Macpaul Lin Date: Tue Jun 23 19:03:23 2020 +0800 ALSA: usb-audio: add quirk for Samsung USBC Headset (AKG) We've found Samsung USBC Headset (AKG) (VID: 0x04e8, PID: 0xa051) need a tiny delay after each class compliant request. Otherwise the device might not be able to be recognized each times. Signed-off-by: Chihhao Chen Signed-off-by: Macpaul Lin Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1592910203-24035-1-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Takashi Iwai commit 2d071968a4052e58681ace6488e2625b2a30a7f7 Author: Will Deacon Date: Mon Jun 22 13:13:58 2020 +0100 arm64: compat: Remove 32-bit sigreturn code from the vDSO The sigreturn code in the compat vDSO is unused. Remove it. Reviewed-by: Vincenzo Frascino Reviewed-by: Ard Biesheuvel Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit 8e411be6aad1387f40d60cb2c11d3260222c590b Author: Will Deacon Date: Mon Jun 22 13:09:49 2020 +0100 arm64: compat: Always use sigpage for sigreturn trampoline The 32-bit sigreturn trampoline in the compat sigpage matches the binary representation of the arch/arm/ sigpage exactly. This is important for debuggers (e.g. GDB) and unwinders (e.g. libunwind) since they rely on matching the instruction sequence in order to identify that they are unwinding through a signal. The same cannot be said for the sigreturn trampoline in the compat vDSO, which defeats the unwinder heuristics and instead attempts to use unwind directives for the unwinding. This is in contrast to arch/arm/, which never uses the vDSO for sigreturn. Ensure compatibility with arch/arm/ and existing unwinders by always using the sigpage for the sigreturn trampoline, regardless of the presence of the compat vDSO. Reviewed-by: Vincenzo Frascino Reviewed-by: Ard Biesheuvel Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit a39060b009ca0b5b5fe0c0dab85ed437531aab52 Author: Will Deacon Date: Mon Jun 22 12:35:41 2020 +0100 arm64: compat: Allow 32-bit vdso and sigpage to co-exist In preparation for removing the signal trampoline from the compat vDSO, allow the sigpage and the compat vDSO to co-exist. For the moment the vDSO signal trampoline will still be used when built. Subsequent patches will move to the sigpage consistently. Acked-by: Dave Martin Reviewed-by: Vincenzo Frascino Reviewed-by: Ard Biesheuvel Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit 87676cfca14171fc4c99d96ae2f3e87780488ac4 Author: Will Deacon Date: Mon Jun 22 20:24:22 2020 +0100 arm64: vdso: Disable dwarf unwinding through the sigreturn trampoline Commit 7e9f5e6629f6 ("arm64: vdso: Add --eh-frame-hdr to ldflags") results in a .eh_frame_hdr section for the vDSO, which in turn causes the libgcc unwinder to unwind out of signal handlers using the .eh_frame information populated by our .cfi directives. In conjunction with a4eb355a3fda ("arm64: vdso: Fix CFI directives in sigreturn trampoline"), this has been shown to cause segmentation faults originating from within the unwinder during thread cancellation: | Thread 14 "virtio-net-rx" received signal SIGSEGV, Segmentation fault. | 0x0000000000435e24 in uw_frame_state_for () | (gdb) bt | #0 0x0000000000435e24 in uw_frame_state_for () | #1 0x0000000000436e88 in _Unwind_ForcedUnwind_Phase2 () | #2 0x00000000004374d8 in _Unwind_ForcedUnwind () | #3 0x0000000000428400 in __pthread_unwind (buf=) at unwind.c:121 | #4 0x0000000000429808 in __do_cancel () at ./pthreadP.h:304 | #5 sigcancel_handler (sig=32, si=0xffff33c743f0, ctx=) at nptl-init.c:200 | #6 sigcancel_handler (sig=, si=0xffff33c743f0, ctx=) at nptl-init.c:165 | #7 | #8 futex_wait_cancelable (private=0, expected=0, futex_word=0x3890b708) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 After considerable bashing of heads, it appears that our CFI directives for unwinding out of the sigreturn trampoline are only processed by libgcc when both a .eh_frame_hdr section is present *and* the mysterious NOP is covered by an entry in .eh_frame. With both of these now in place, it has highlighted that our CFI directives are not comprehensive enough to restore the stack pointer of the interrupted context. This results in libgcc falling back to an arm64-specific unwinder after computing a bogus PC value from the unwind tables. The unwinder promptly dereferences this bogus address in an attempt to see if the pointed-to instruction sequence looks like the sigreturn trampoline. Restore the old unwind behaviour, which relied solely on heuristics in the unwinder, by removing the .eh_frame_hdr section from the vDSO and commenting out the insufficient CFI directives for now. Add comments to explain the current, miserable state of affairs. Cc: Tamas Zsoldos Cc: Szabolcs Nagy Cc: Catalin Marinas Cc: Daniel Kiss Acked-by: Dave Martin Reviewed-by: Vincenzo Frascino Reviewed-by: Ard Biesheuvel Reported-by: Ard Biesheuvel Signed-off-by: Will Deacon commit b4c8af4c2a226fc9c25e1decbd26fdab1b0993ee Author: Jan Kundrát Date: Tue Jun 23 09:47:39 2020 +0200 hwmon: (pmbus) Fix page vs. register when accessing fans Commit 16358542f32f ("hwmon: (pmbus) Implement multi-phase support") added support for multi-phase pmbus devices. However, when calling pmbus_add_sensor() for fans, the patch swapped the `page` and `reg` attributes. As a result, the fan speeds were reported as 0 RPM on my device. Signed-off-by: Jan Kundrát Fixes: 16358542f32f ("hwmon: (pmbus) Implement multi-phase support") Cc: stable@vger.kernel.org # v5.7+ Link: https://lore.kernel.org/r/449bc9e6c0e4305581e45905ce9d043b356a9932.1592904387.git.jan.kundrat@cesnet.cz [groeck: Fixed references to offending commit] Signed-off-by: Guenter Roeck commit 26797d8b467b18f7c71cd5fca75d17ae7cd832ab Author: Guenter Roeck Date: Mon Jun 8 07:21:36 2020 -0700 hwmon: (bt1-pvt) Mark is_visible functions static 0-day reports: drivers/hwmon/bt1-pvt.c:303:16: warning: no previous declaration for 'pvt_limit_is_visible' drivers/hwmon/bt1-pvt.c:308:16: warning: no previous declaration for 'pvt_alarm_is_visible' Declare both functions static. Reported-by: kernel test robot Fixes: 87976ce2825d("hwmon: Add Baikal-T1 PVT sensor driver") Cc: Serge Semin Reviewed-by: Serge Semin Signed-off-by: Guenter Roeck commit 332516947ef83343b9bcc7275ff99db392592c94 Author: Serge Semin Date: Wed Jun 3 03:07:53 2020 +0300 hwmon: (bt1-pvt) Define Temp- and Volt-to-N poly as maybe-unused Clang-based kernel building with W=1 warns that some static const variables are unused: drivers/hwmon/bt1-pvt.c:67:30: warning: unused variable 'poly_temp_to_N' [-Wunused-const-variable] static const struct pvt_poly poly_temp_to_N = { ^ drivers/hwmon/bt1-pvt.c:99:30: warning: unused variable 'poly_volt_to_N' [-Wunused-const-variable] static const struct pvt_poly poly_volt_to_N = { ^ Indeed these polynomials are utilized only when the PVT sensor alarms are enabled. In that case they are used to convert the temperature and voltage alarm limits from normal quantities (Volts and degree Celsius) to the sensor data representation N = [0, 1023]. Otherwise when alarms are disabled the driver only does the detected data conversion to the human readable form and doesn't need that polynomials defined. So let's mark the Temp-to-N and Volt-to-N polynomials with __maybe_unused attribute. Note gcc with W=1 doesn't notice the problem. Fixes: 87976ce2825d ("hwmon: Add Baikal-T1 PVT sensor driver") Reported-by: kbuild test robot Signed-off-by: Serge Semin Cc: Maxim Kaurkin Cc: Alexey Malahov Link: https://lore.kernel.org/r/20200603000753.391-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Guenter Roeck commit 8e36baf97b252cdcafa53589e8227cbb1e85f0b0 Author: Eric Auger Date: Tue Jun 23 14:07:55 2020 +0200 dma-remap: align the size in dma_common_*_remap() Running a guest with a virtio-iommu protecting virtio devices is broken since commit 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing it"). Before the conversion, the size was page aligned in __get_vm_area_node(). Doing so fixes the regression. Fixes: 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing it") Signed-off-by: Eric Auger Signed-off-by: Christoph Hellwig commit d07ae4c486908615ab336b987c7c367d132fd844 Author: Christoph Hellwig Date: Thu Jun 18 17:23:31 2020 +0200 dma-mapping: DMA_COHERENT_POOL should select GENERIC_ALLOCATOR The dma coherent pool code needs genalloc. Move the select over from DMA_REMAP, which doesn't actually need it. Fixes: dbed452a078d ("dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL") Reported-by: kernel test robot Signed-off-by: Christoph Hellwig Acked-by: David Rientjes commit 1a2b3357e860d890f8045367b179c7e7e802cd71 Author: David Rientjes Date: Thu Jun 11 12:20:32 2020 -0700 dma-direct: add missing set_memory_decrypted() for coherent mapping When a coherent mapping is created in dma_direct_alloc_pages(), it needs to be decrypted if the device requires unencrypted DMA before returning. Fixes: 3acac065508f ("dma-mapping: merge the generic remapping helpers into dma-direct") Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 827c4913923e0b441ba07ba4cc41e01181102303 Author: Christian Borntraeger Date: Tue Mar 31 05:57:23 2020 -0400 s390/debug: avoid kernel warning on too large number of pages When specifying insanely large debug buffers a kernel warning is printed. The debug code does handle the error gracefully, though. Instead of duplicating the check let us silence the warning to avoid crashes when panic_on_warn is used. Signed-off-by: Christian Borntraeger Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 998f5bbe3dbdab81c1cfb1aef7c3892f5d24f6c7 Author: Vasily Gorbik Date: Wed Jun 17 15:05:49 2020 +0200 s390/kasan: fix early pgm check handler execution Currently if early_pgm_check_handler is called it ends up in pgm check loop. The problem is that early_pgm_check_handler is instrumented by KASAN but executed without DAT flag enabled which leads to addressing exception when KASAN checks try to access shadow memory. Fix that by executing early handlers with DAT flag on under KASAN as expected. Reported-and-tested-by: Alexander Egorenkov Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit e64a1618af8566d20991607913a4d90d39b30118 Author: Sven Schnelle Date: Wed Jun 17 17:30:28 2020 +0200 s390: fix system call single stepping When single stepping an svc instruction on s390, the kernel is entered with a PER program check interruption. The program check handler than jumps to the system call handler by reloading the PSW. The code didn't set GPR13 to the thread pointer in struct task_struct. This made the kernel access invalid memory while trying to fetch the syscall function address. Fix this by always assigned GPR13 after .Lsysc_per. Fixes: 0b0ed657fe00 ("s390: remove critical section cleanup from entry.S") Reported-and-tested-by: Christian Borntraeger Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit c95c9693b112f312b59c5d100fd09a1349970fab Author: Anson Huang Date: Wed Jun 10 18:03:02 2020 +0800 soc: imx8m: Correct i.MX8MP UID fuse offset Correct i.MX8MP UID fuse offset according to fuse map: UID_LOW: 0x420 UID_HIGH: 0x430 Fixes: fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver") Fixes: 18f662a73862 ("soc: imx: Add i.MX8MP SoC driver support") Signed-off-by: Anson Huang Reviewed-by: Iuliana Prodan Signed-off-by: Shawn Guo commit 0d46f69881c34351b6ec523c31225b90ea89ee20 Author: Konrad Dybcio Date: Sat Jun 20 16:46:34 2020 +0200 regulator: qcom_smd: Fix pmi8994 label s3 was mislabeled as s2. Fix it. Signed-off-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200620144639.335093-19-konradybcio@gmail.com Signed-off-by: Mark Brown commit a05caf9e62a85d12da27e814ac13195f4683f21c Author: Hans de Goede Date: Sun May 31 11:30:25 2020 +0200 drm: panel-orientation-quirks: Use generic orientation-data for Acer S1003 The Acer S1003 has proper DMI strings for sys-vendor and product-name, so we do not need to match by BIOS-date. This means that the Acer S1003 can use the generic lcd800x1280_rightside_up drm_dmi_panel_orientation_data struct which is also used by other quirks. Reviewed-by: Emil Velikov Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200531093025.28050-2-hdegoede@redhat.com commit 6c22bc18a3b93a38018844636557ad02e588e055 Author: Hans de Goede Date: Sun May 31 11:30:24 2020 +0200 drm: panel-orientation-quirks: Add quirk for Asus T101HA panel Like the Asus T100HA the Asus T101HA also uses a panel which has been mounted 90 degrees rotated, albeit in the opposite direction. Add a quirk for this. Reviewed-by: Emil Velikov Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200531093025.28050-1-hdegoede@redhat.com commit a3f574cd65487cd993f79ab235d70229d9302c1e Author: Marc Zyngier Date: Tue Jun 23 10:44:08 2020 +0100 KVM: arm64: vgic-v4: Plug race between non-residency and v4.1 doorbell When making a vPE non-resident because it has hit a blocking WFI, the doorbell can fire at any time after the write to the RD. Crucially, it can fire right between the write to GICR_VPENDBASER and the write to the pending_last field in the its_vpe structure. This means that we would overwrite pending_last with stale data, and potentially not wakeup until some unrelated event (such as a timer interrupt) puts the vPE back on the CPU. GICv4 isn't affected by this as we actively mask the doorbell on entering the guest, while GICv4.1 automatically manages doorbell delivery without any hypervisor-driven masking. Use the vpe_lock to synchronize such update, which solves the problem altogether. Fixes: ae699ad348cdc ("irqchip/gic-v4.1: Move doorbell management to the GICv4 abstraction layer") Reported-by: Zenghui Yu Signed-off-by: Marc Zyngier commit 15217d170a4461c1d4c1ea7c497e1fc1122e42a9 Author: Shengjiu Wang Date: Tue Jun 23 14:01:12 2020 +0800 ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable Fix unchecked return value for clk_prepare_enable, add error handler in fsl_mqs_runtime_resume. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/5edd68d03def367d96268f1a9a00bd528ea5aaf2.1592888591.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit adf46113a608d9515801997fc96cbfe8ffa89ed3 Author: Shengjiu Wang Date: Tue Jun 23 14:01:11 2020 +0800 ASoC: fsl_mqs: Don't check clock is NULL before calling clk API Because clk_prepare_enable and clk_disable_unprepare should check input clock parameter is NULL or not internally, then we don't need to check them before calling the function. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/743be216bd504c26e8d45d5ce4a84561b67a122b.1592888591.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 73094608b8e214952444fb104651704c98a37aeb Author: Christoffer Nielsen Date: Fri Jun 19 13:48:22 2020 +0200 ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Flight S Similar to the Kingston HyperX AMP, the Kingston HyperX Cloud Alpha S (0951:0x16ea) uses two interfaces, but only the second interface contains the capture stream. This patch delays the registration until the second interface appears. Signed-off-by: Christoffer Nielsen Cc: Link: https://lore.kernel.org/r/CAOtG2YHOM3zy+ed9KS-J4HkZo_QGzcUG9MigSp4e4_-13r6B=Q@mail.gmail.com Signed-off-by: Takashi Iwai commit e4553b4976d1178c13da295cb5c7b21f55baf8f9 Author: Sean Christopherson Date: Tue Jun 16 20:41:23 2020 -0700 KVM: VMX: Remove vcpu_vmx's defunct copy of host_pkru Remove vcpu_vmx.host_pkru, which got left behind when PKRU support was moved to common x86 code. No functional change intended. Fixes: 37486135d3a7b ("KVM: x86: Fix pkru save/restore when guest CR4.PKE=0, move it to x86.c") Signed-off-by: Sean Christopherson Message-Id: <20200617034123.25647-1-sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 26769f96e6231095f6b1cc3090c903280d44bb57 Author: Marcelo Tosatti Date: Tue Jun 16 08:47:41 2020 -0300 KVM: x86: allow TSC to differ by NTP correction bounds without TSC scaling The Linux TSC calibration procedure is subject to small variations (its common to see +-1 kHz difference between reboots on a given CPU, for example). So migrating a guest between two hosts with identical processor can fail, in case of a small variation in calibrated TSC between them. Without TSC scaling, the current kernel interface will either return an error (if user_tsc_khz <= tsc_khz) or enable TSC catchup mode. This change enables the following TSC tolerance check to accept KVM_SET_TSC_KHZ within tsc_tolerance_ppm (which is 250ppm by default). /* * Compute the variation in TSC rate which is acceptable * within the range of tolerance and decide if the * rate being applied is within that bounds of the hardware * rate. If so, no scaling or compensation need be done. */ thresh_lo = adjust_tsc_khz(tsc_khz, -tsc_tolerance_ppm); thresh_hi = adjust_tsc_khz(tsc_khz, tsc_tolerance_ppm); if (user_tsc_khz < thresh_lo || user_tsc_khz > thresh_hi) { pr_debug("kvm: requested TSC rate %u falls outside tolerance [%u,%u]\n", user_tsc_khz, thresh_lo, thresh_hi); use_scaling = 1; } NTP daemon in the guest can correct this difference (NTP can correct upto 500ppm). Signed-off-by: Marcelo Tosatti Message-Id: <20200616114741.GA298183@fuller.cnet> Signed-off-by: Paolo Bonzini commit bf10bd0be53282183f374af23577b18b5fbf7801 Author: Xiaoyao Li Date: Tue Jun 16 15:33:07 2020 +0800 KVM: X86: Fix MSR range of APIC registers in X2APIC mode Only MSR address range 0x800 through 0x8ff is architecturally reserved and dedicated for accessing APIC registers in x2APIC mode. Fixes: 0105d1a52640 ("KVM: x2apic interface to lapic") Signed-off-by: Xiaoyao Li Message-Id: <20200616073307.16440-1-xiaoyao.li@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Sean Christopherson Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 5d0136f8e79f8287e6a36780601f0ce797cf11c2 Author: Igor Moura Date: Tue Jun 23 05:11:11 2020 -0300 USB: serial: ch341: add new Product ID for CH340 Add PID for CH340 that's found on some ESP8266 dev boards made by LilyGO. The specific device that contains such serial converter can be seen here: https://github.com/LilyGO/LILYGO-T-OI. Apparently, it's a regular CH340, but I've confirmed with others that also bought this board that the PID found on this device (0x7522) differs from other devices with the "same" converter (0x7523). Simply adding its PID to the driver and rebuilding it made it work as expected. Signed-off-by: Igor Moura Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit dc7bd30b97aac8a97eccef0ffe31f6cefb6e2c3e Author: Felix Fietkau Date: Mon Jun 22 17:07:16 2020 +0200 mt76: mt7615: fix EEPROM buffer size Avoid adding MT7615_EEPROM_SIZE twice. Rename MT7615_EEPROM_EXTRA_DATA to MT7615_EEPROM_FULL_SIZE, since it already includes MT7615_EEPROM_SIZE Fixes: ad380ad1ebbe ("mt76: mt7615: add support for applying DC offset calibration from EEPROM") Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200622150716.49622-1-nbd@nbd.name commit b1e79d105516fb96c39eb8a780936b87bae8e3e1 Author: Lorenzo Bianconi Date: Sun Jun 21 18:03:38 2020 +0200 mt76: mt7663u: fix memory leaks in mt7663u_probe Fix the two following memory leaks in mt7663u_probe: 1- if device power-own times out, remove ieee80211 hw device. 2- if mt76u queues allocation fails, remove pending urbs. Fixes: eb99cc95c3b65 ("mt76: mt7615: introduce mt7663u support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e4098f0c8a9ac51997de07f38c2bcdf7042d6db1.1592755166.git.lorenzo@kernel.org commit 4ac668a3b8c9d3477a3fe162c1cfeb867dd65de8 Author: Felix Fietkau Date: Mon Jun 15 20:13:41 2020 +0200 mt76: mt76x02: do not access uninitialized NAPI structs Fixes a crash on MMIO devices when running into the watchdog reset Fixes: d3377b78cec6 ("mt76: add HE phy modes and hardware queue") Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200615181341.81871-1-nbd@nbd.name commit 6247c3b0779c16894bf2f25cbaf613fa3258d1ce Merge: ea0cca61d628 7f88314321e2 Author: Kalle Valo Date: Tue Jun 23 11:39:21 2020 +0300 Merge tag 'mt76-for-kvalo-2020-06-07' of https://github.com/nbd168/wireless mt76 patches for 5.8 * tx queueing fixes for mt7615/22/63 * locking fix # gpg: Signature made Sun 07 Jun 2020 06:17:47 PM EEST using DSA key ID 02A76EF5 # gpg: Good signature from "Felix Fietkau " # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 75D1 1A7D 91A7 710F 4900 42EF D77D 141D 02A7 6EF5 commit ea0cca61d628662e4a1b26c77c7646f9a0257069 Author: Jiri Slaby Date: Fri Jun 12 09:38:00 2020 +0200 iwlwifi: fix crash in iwl_dbg_tlv_alloc_trigger The tlv passed to iwl_dbg_tlv_alloc_trigger comes from a loaded firmware file. The memory can be marked as read-only as firmware could be shared. In anyway, writing to this memory is not expected. So, iwl_dbg_tlv_alloc_trigger can crash now: BUG: unable to handle page fault for address: ffffae2c01bfa794 PF: supervisor write access in kernel mode PF: error_code(0x0003) - permissions violation PGD 107d51067 P4D 107d51067 PUD 107d52067 PMD 659ad2067 PTE 8000000662298161 CPU: 2 PID: 161 Comm: kworker/2:1 Not tainted 5.7.0-3.gad96a07-default #1 openSUSE Tumbleweed (unreleased) RIP: 0010:iwl_dbg_tlv_alloc_trigger+0x25/0x60 [iwlwifi] Code: eb f2 0f 1f 00 66 66 66 66 90 83 7e 04 33 48 89 f8 44 8b 46 10 48 89 f7 76 40 41 8d 50 ff 83 fa 19 77 23 8b 56 20 85 d2 75 07 46 20 ff ff ff ff 4b 8d 14 40 48 c1 e2 04 48 8d b4 10 00 05 00 RSP: 0018:ffffae2c00417ce8 EFLAGS: 00010246 RAX: ffff8f0522334018 RBX: ffff8f0522334018 RCX: ffffffffc0fc26c0 RDX: 0000000000000000 RSI: ffffae2c01bfa774 RDI: ffffae2c01bfa774 RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000001 R10: 0000000000000034 R11: ffffae2c01bfa77c R12: ffff8f0522334230 R13: 0000000001000009 R14: ffff8f0523fdbc00 R15: ffff8f051f395800 FS: 0000000000000000(0000) GS:ffff8f0527c80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffae2c01bfa794 CR3: 0000000389eba000 CR4: 00000000000006e0 Call Trace: iwl_dbg_tlv_alloc+0x79/0x120 [iwlwifi] iwl_parse_tlv_firmware.isra.0+0x57d/0x1550 [iwlwifi] iwl_req_fw_callback+0x3f8/0x6a0 [iwlwifi] request_firmware_work_func+0x47/0x90 process_one_work+0x1e3/0x3b0 worker_thread+0x46/0x340 kthread+0x115/0x140 ret_from_fork+0x1f/0x40 As can be seen, write bit is not set in the PTE. Read of trig->occurrences succeeds in iwl_dbg_tlv_alloc_trigger, but trig->occurrences = cpu_to_le32(-1); fails there, obviously. This is likely because we (at SUSE) use compressed firmware and that is marked as RO after decompression (see fw_map_paged_buf). Fix it by creating a temporary buffer in case we need to change the memory. Signed-off-by: Jiri Slaby Reported-by: Dieter Nützel Tested-by: Dieter Nützel Cc: Johannes Berg Cc: Emmanuel Grumbach Cc: Luca Coelho Cc: Intel Linux Wireless Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200612073800.27742-1-jslaby@suse.cz commit fbb1461ad1d6eacca9beb69a2f3ce1b5398d399b Author: Johannes Berg Date: Fri Apr 3 11:29:55 2020 +0300 iwlwifi: mvm: don't call iwl_mvm_free_inactive_queue() under RCU iwl_mvm_free_inactive_queue() will sleep in synchronize_net() under some circumstances, so don't call it under RCU. There doesn't appear to be a need for RCU protection around this particular call. Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20200403112332.0f49448c133d.I17fd308bc4a9491859c9b112f4eb5d2c3fc18d7d@changeid commit 48f0bcfb7aad2c6eb4c1e66476b58475aa14393e Author: Lu Baolu Date: Tue Jun 23 07:13:45 2020 +0800 iommu/vt-d: Fix misuse of iommu_domain_identity_map() The iommu_domain_identity_map() helper takes start/end PFN as arguments. Fix a misuse case where the start and end addresses are passed. Fixes: e70b081c6f376 ("iommu/vt-d: Remove IOVA handling code from the non-dma_ops path") Reported-by: Alex Williamson Signed-off-by: Lu Baolu Reviewed-by: Jerry Snitselaar Cc: Tom Murphy Link: https://lore.kernel.org/r/20200622231345.29722-7-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 04c00956ee3cd138fd38560a91452a804a8c5550 Author: Lu Baolu Date: Tue Jun 23 07:13:44 2020 +0800 iommu/vt-d: Update scalable mode paging structure coherency The Scalable-mode Page-walk Coherency (SMPWC) field in the VT-d extended capability register indicates the hardware coherency behavior on paging structures accessed through the pasid table entry. This is ignored in current code and using ECAP.C instead which is only valid in legacy mode. Fix this so that paging structure updates could be manually flushed from the cache line if hardware page walking is not snooped. Fixes: 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable mode capability") Signed-off-by: Lu Baolu Cc: Ashok Raj Cc: Kevin Tian Cc: Jacob Pan Link: https://lore.kernel.org/r/20200622231345.29722-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 50310600ebda74b9988467e2e6128711c7ba56fc Author: Lu Baolu Date: Tue Jun 23 07:13:43 2020 +0800 iommu/vt-d: Enable PCI ACS for platform opt in hint PCI ACS is disabled if Intel IOMMU is off by default or intel_iommu=off is used in command line. Unfortunately, Intel IOMMU will be forced on if there're devices sitting on an external facing PCI port that is marked as untrusted (for example, thunderbolt peripherals). That means, PCI ACS is disabled while Intel IOMMU is forced on to isolate those devices. As the result, the devices of an MFD will be grouped by a single group even the ACS is supported on device. [ 0.691263] pci 0000:00:07.1: Adding to iommu group 3 [ 0.691277] pci 0000:00:07.2: Adding to iommu group 3 [ 0.691292] pci 0000:00:07.3: Adding to iommu group 3 Fix it by requesting PCI ACS when Intel IOMMU is detected with platform opt in hint. Fixes: 89a6079df791a ("iommu/vt-d: Force IOMMU on for platform opt in hint") Co-developed-by: Lalithambika Krishnakumar Signed-off-by: Lalithambika Krishnakumar Signed-off-by: Lu Baolu Reviewed-by: Mika Westerberg Cc: Mika Westerberg Cc: Ashok Raj Link: https://lore.kernel.org/r/20200622231345.29722-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 67e8a5b18d41af9298db5c17193f671f235cce01 Author: Rajat Jain Date: Tue Jun 23 07:13:42 2020 +0800 iommu/vt-d: Don't apply gfx quirks to untrusted devices Currently, an external malicious PCI device can masquerade the VID:PID of faulty gfx devices, and thus apply iommu quirks to effectively disable the IOMMU restrictions for itself. Thus we need to ensure that the device we are applying quirks to, is indeed an internal trusted device. Signed-off-by: Rajat Jain Reviewed-by: Ashok Raj Reviewed-by: Mika Westerberg Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200622231345.29722-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 16ecf10e815d70d11d2300243f4a3b4c7c5acac7 Author: Lu Baolu Date: Tue Jun 23 07:13:41 2020 +0800 iommu/vt-d: Set U/S bit in first level page table by default When using first-level translation for IOVA, currently the U/S bit in the page table is cleared which implies DMA requests with user privilege are blocked. As the result, following error messages might be observed when passing through a device to user level: DMAR: DRHD: handling fault status reg 3 DMAR: [DMA Read] Request device [41:00.0] PASID 1 fault addr 7ecdcd000 [fault reason 129] SM: U/S set 0 for first-level translation with user privilege This fixes it by setting U/S bit in the first level page table and makes IOVA over first level compatible with previous second-level translation. Fixes: b802d070a52a1 ("iommu/vt-d: Use iova over first level") Reported-by: Xin Zeng Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200622231345.29722-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 9486727f5981a5ec5c0b699fb1777451bd6786e4 Author: Lu Baolu Date: Tue Jun 23 07:13:40 2020 +0800 iommu/vt-d: Make Intel SVM code 64-bit only Current Intel SVM is designed by setting the pgd_t of the processor page table to FLPTR field of the PASID entry. The first level translation only supports 4 and 5 level paging structures, hence it's infeasible for the IOMMU to share a processor's page table when it's running in 32-bit mode. Let's disable 32bit support for now and claim support only when all the missing pieces are ready in the future. Fixes: 1c4f88b7f1f92 ("iommu/vt-d: Shared virtual address in scalable mode") Suggested-by: Joerg Roedel Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200622231345.29722-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 08d4ef5cc9203a113702f24725f6cf4db476c958 Author: Jörgen Storvist Date: Tue Jun 23 00:13:59 2020 +0200 USB: serial: option: add GosunCn GM500 series Add USB IDs for GosunCn GM500 series cellular modules. RNDIS config: usb-devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 12 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=305a ProdID=1404 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber= C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host I: If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host I: If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option MBIM config: usb-devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 11 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=305a ProdID=1405 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber= C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim ECM config: usb-devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 13 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=305a ProdID=1406 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber= C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#=0x4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether Signed-off-by: Jörgen Storvist Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 5c45d04c5081c1830d674f4d22d4400ea2083afe Author: James Hilliard Date: Tue Jun 16 16:04:03 2020 -0600 USB: serial: cypress_m8: enable Simply Automated UPB PIM This is a UPB (Universal Powerline Bus) PIM (Powerline Interface Module) which allows for controlling multiple UPB compatible devices from Linux using the standard serial interface. Based on vendor application source code there are two different models of USB based PIM devices in addition to a number of RS232 based PIM's. The vendor UPB application source contains the following USB ID's: #define USB_PCS_VENDOR_ID 0x04b4 #define USB_PCS_PIM_PRODUCT_ID 0x5500 #define USB_SAI_VENDOR_ID 0x17dd #define USB_SAI_PIM_PRODUCT_ID 0x5500 The first set of ID's correspond to the PIM variant sold by Powerline Control Systems while the second corresponds to the Simply Automated Incorporated PIM. As the product ID for both of these match the default cypress HID->COM RS232 product ID it assumed that they both use an internal variant of this HID->COM RS232 converter hardware. However as the vendor ID for the Simply Automated variant is different we need to also add it to the cypress_M8 driver so that it is properly detected. Signed-off-by: James Hilliard Link: https://lore.kernel.org/r/20200616220403.1807003-1-james.hilliard1@gmail.com Cc: stable@vger.kernel.org [ johan: amend VID define entry ] Signed-off-by: Johan Hovold commit 8c289ea064165237891a7b4be77b74d5cba8fa99 Author: Alexander Usyskin Date: Fri Jun 19 19:51:21 2020 +0300 mei: me: add tiger lake point device ids for H platforms. Add Tiger Lake device ids H for HECI1. TGH_H is also used in Tatlow SPS platform we need to disable the mei interface there. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20200619165121.2145330-7-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit f76d77f50b343bc7f7d01e4c2771d43fb074f617 Author: Tomas Winkler Date: Fri Jun 19 19:51:15 2020 +0300 mei: me: disable mei interface on Mehlow server platforms For SPS firmware versions 5.0 and newer the way detection has changed. The detection is done now via PCI_CFG_HFS_3 register. To prevent conflict the previous method will get sps_4 suffix Disable both CNP_H and CNP_H_3 interfaces. CNP_H_3 requires a separate configuration as it doesn't support DMA. Cc: Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20200619165121.2145330-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit d35d3660e065b69fdb8bf512f3d899f350afce52 Author: Todd Kjos Date: Mon Jun 22 13:07:15 2020 -0700 binder: fix null deref of proc->context The binder driver makes the assumption proc->context pointer is invariant after initialization (as documented in the kerneldoc header for struct proc). However, in commit f0fe2c0f050d ("binder: prevent UAF for binderfs devices II") proc->context is set to NULL during binder_deferred_release(). Another proc was in the middle of setting up a transaction to the dying process and crashed on a NULL pointer deref on "context" which is a local set to &proc->context: new_ref->data.desc = (node == context->binder_context_mgr_node) ? 0 : 1; Here's the stack: [ 5237.855435] Call trace: [ 5237.855441] binder_get_ref_for_node_olocked+0x100/0x2ec [ 5237.855446] binder_inc_ref_for_node+0x140/0x280 [ 5237.855451] binder_translate_binder+0x1d0/0x388 [ 5237.855456] binder_transaction+0x2228/0x3730 [ 5237.855461] binder_thread_write+0x640/0x25bc [ 5237.855466] binder_ioctl_write_read+0xb0/0x464 [ 5237.855471] binder_ioctl+0x30c/0x96c [ 5237.855477] do_vfs_ioctl+0x3e0/0x700 [ 5237.855482] __arm64_sys_ioctl+0x78/0xa4 [ 5237.855488] el0_svc_common+0xb4/0x194 [ 5237.855493] el0_svc_handler+0x74/0x98 [ 5237.855497] el0_svc+0x8/0xc The fix is to move the kfree of the binder_device to binder_free_proc() so the binder_device is freed when we know there are no references remaining on the binder_proc. Fixes: f0fe2c0f050d ("binder: prevent UAF for binderfs devices II") Acked-by: Christian Brauner Signed-off-by: Todd Kjos Cc: stable Link: https://lore.kernel.org/r/20200622200715.114382-1-tkjos@google.com Signed-off-by: Greg Kroah-Hartman commit 26ac10be3c80a26d03c950b7387c4b9566c260b6 Author: Aiden Leong Date: Mon Jun 22 20:04:58 2020 -0700 GUE: Fix a typo Fix a typo in gue.h Signed-off-by: Aiden Leong Signed-off-by: David S. Miller commit b562f58bbc12444219b74a5d6524977a3d87a022 Author: Geliang Tang Date: Mon Jun 22 19:45:58 2020 +0800 mptcp: drop sndr_key in mptcp_syn_options In RFC 8684, we don't need to send sndr_key in SYN package anymore, so drop it. Fixes: cc7972ea1932 ("mptcp: parse and emit MP_CAPABLE option according to v1 spec") Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit 21a739c64d3e9871186483a0cc3e7b52638c3d59 Author: Gaurav Singh Date: Sun Jun 21 11:30:17 2020 -0400 ethtool: Fix check in ethtool_rx_flow_rule_create Fix check in ethtool_rx_flow_rule_create Fixes: eca4205f9ec3 ("ethtool: add ethtool_rx_flow_spec to flow_rule structure translator") Signed-off-by: Gaurav Singh Signed-off-by: David S. Miller commit de0083c7ed7dba036d1ed6e012157649d45313c8 Author: Taehee Yoo Date: Sun Jun 21 13:46:25 2020 +0000 hsr: avoid to create proc file after unregister When an interface is being deleted, "/proc/net/dev_snmp6/" is deleted. The function for this is addrconf_ifdown() in the addrconf_notify() and it is called by notification, which is NETDEV_UNREGISTER. But, if NETDEV_CHANGEMTU is triggered after NETDEV_UNREGISTER, this proc file will be created again. This recreated proc file will be deleted by netdev_wati_allrefs(). Before netdev_wait_allrefs() is called, creating a new HSR interface routine can be executed and It tries to create a proc file but it will find an un-deleted proc file. At this point, it warns about it. To avoid this situation, it can use ->dellink() instead of ->ndo_uninit() to release resources because ->dellink() is called before NETDEV_UNREGISTER. So, a proc file will not be recreated. Test commands ip link add dummy0 type dummy ip link add dummy1 type dummy ip link set dummy0 mtu 1300 #SHELL1 while : do ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 done #SHELL2 while : do ip link del hsr0 done Splat looks like: [ 9888.980852][ T2752] proc_dir_entry 'dev_snmp6/hsr0' already registered [ 9888.981797][ C2] WARNING: CPU: 2 PID: 2752 at fs/proc/generic.c:372 proc_register+0x2d5/0x430 [ 9888.981798][ C2] Modules linked in: hsr dummy veth openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6x [ 9888.981814][ C2] CPU: 2 PID: 2752 Comm: ip Tainted: G W 5.8.0-rc1+ #616 [ 9888.981815][ C2] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 9888.981816][ C2] RIP: 0010:proc_register+0x2d5/0x430 [ 9888.981818][ C2] Code: fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 65 01 00 00 49 8b b5 e0 00 00 00 48 89 ea 40 [ 9888.981819][ C2] RSP: 0018:ffff8880628dedf0 EFLAGS: 00010286 [ 9888.981821][ C2] RAX: dffffc0000000008 RBX: ffff888028c69170 RCX: ffffffffaae09a62 [ 9888.981822][ C2] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff88806c9f75ac [ 9888.981823][ C2] RBP: ffff888028c693f4 R08: ffffed100d9401bd R09: ffffed100d9401bd [ 9888.981824][ C2] R10: ffffffffaddf406f R11: 0000000000000001 R12: ffff888028c69308 [ 9888.981825][ C2] R13: ffff8880663584c8 R14: dffffc0000000000 R15: ffffed100518d27e [ 9888.981827][ C2] FS: 00007f3876b3b0c0(0000) GS:ffff88806c800000(0000) knlGS:0000000000000000 [ 9888.981828][ C2] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9888.981829][ C2] CR2: 00007f387601a8c0 CR3: 000000004101a002 CR4: 00000000000606e0 [ 9888.981830][ C2] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 9888.981831][ C2] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 9888.981832][ C2] Call Trace: [ 9888.981833][ C2] ? snmp6_seq_show+0x180/0x180 [ 9888.981834][ C2] proc_create_single_data+0x7c/0xa0 [ 9888.981835][ C2] snmp6_register_dev+0xb0/0x130 [ 9888.981836][ C2] ipv6_add_dev+0x4b7/0xf60 [ 9888.981837][ C2] addrconf_notify+0x684/0x1ca0 [ 9888.981838][ C2] ? __mutex_unlock_slowpath+0xd0/0x670 [ 9888.981839][ C2] ? kasan_unpoison_shadow+0x30/0x40 [ 9888.981840][ C2] ? wait_for_completion+0x250/0x250 [ 9888.981841][ C2] ? inet6_ifinfo_notify+0x100/0x100 [ 9888.981842][ C2] ? dropmon_net_event+0x227/0x410 [ 9888.981843][ C2] ? notifier_call_chain+0x90/0x160 [ 9888.981844][ C2] ? inet6_ifinfo_notify+0x100/0x100 [ 9888.981845][ C2] notifier_call_chain+0x90/0x160 [ 9888.981846][ C2] register_netdevice+0xbe5/0x1070 [ ... ] Reported-by: syzbot+1d51c8b74efa4c44adeb@syzkaller.appspotmail.com Fixes: e0a4b99773d3 ("hsr: use upper/lower device infrastructure") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit d22a16cc92e04d053fd807ef3587e4f135e4206f Author: Frieder Schrempf Date: Thu May 28 14:43:43 2020 +0000 ARM: dts: imx6ul-kontron: Change WDOG_ANY signal from push-pull to open-drain The WDOG_ANY signal is connected to the RESET_IN signal of the SoM and baseboard. It is currently configured as push-pull, which means that if some external device like a programmer wants to assert the RESET_IN signal by pulling it to ground, it drives against the high level WDOG_ANY output of the SoC. To fix this we set the WDOG_ANY signal to open-drain configuration. That way we make sure that the RESET_IN can be asserted by the watchdog as well as by external devices. Fixes: 1ea4b76cdfde ("ARM: dts: imx6ul-kontron-n6310: Add Kontron i.MX6UL N6310 SoM and boards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 04a2c05179b732a4c097f0a9c701ef4c9a37e1e3 Author: Frieder Schrempf Date: Thu May 28 14:43:42 2020 +0000 ARM: dts: imx6ul-kontron: Move watchdog from Kontron i.MX6UL/ULL board to SoM The watchdog's WDOG_ANY signal is used to trigger a POR of the SoC, if a soft reset is issued. As the SoM hardware connects the WDOG_ANY and the POR signals, the watchdog node itself and the pin configuration should be part of the common SoM devicetree. Let's move it from the baseboard's devicetree to its proper place. Fixes: 1ea4b76cdfde ("ARM: dts: imx6ul-kontron-n6310: Add Kontron i.MX6UL N6310 SoM and boards") Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit c7f87f3984cfa1e6d32806a715f35c5947ad9c09 Author: Dave Chinner Date: Tue Jun 16 08:57:43 2020 -0700 xfs: fix use-after-free on CIL context on shutdown xlog_wait() on the CIL context can reference a freed context if the waiter doesn't get scheduled before the CIL context is freed. This can happen when a task is on the hard throttle and the CIL push aborts due to a shutdown. This was detected by generic/019: thread 1 thread 2 __xfs_trans_commit xfs_log_commit_cil xlog_wait schedule xlog_cil_push_work wake_up_all xlog_cil_committed kmem_free remove_wait_queue spin_lock_irqsave --> UAF Fix it by moving the wait queue to the CIL rather than keeping it in in the CIL context that gets freed on push completion. Because the wait queue is now independent of the CIL context and we might have multiple contexts in flight at once, only wake the waiters on the push throttle when the context we are pushing is over the hard throttle size threshold. Fixes: 0e7ab7efe7745 ("xfs: Throttle commits on delayed background CIL push") Reported-by: Yu Kuai Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit bf09fb6cba4f7099620cc9ed32d94c27c4af992e Author: Sean Christopherson Date: Mon Jun 22 17:51:35 2020 -0700 KVM: VMX: Stop context switching MSR_IA32_UMWAIT_CONTROL Remove support for context switching between the guest's and host's desired UMWAIT_CONTROL. Propagating the guest's value to hardware isn't required for correct functionality, e.g. KVM intercepts reads and writes to the MSR, and the latency effects of the settings controlled by the MSR are not architecturally visible. As a general rule, KVM should not allow the guest to control power management settings unless explicitly enabled by userspace, e.g. see KVM_CAP_X86_DISABLE_EXITS. E.g. Intel's SDM explicitly states that C0.2 can improve the performance of SMT siblings. A devious guest could disable C0.2 so as to improve the performance of their workloads at the detriment to workloads running in the host or on other VMs. Wholesale removal of UMWAIT_CONTROL context switching also fixes a race condition where updates from the host may cause KVM to enter the guest with the incorrect value. Because updates are are propagated to all CPUs via IPI (SMP function callback), the value in hardware may be stale with respect to the cached value and KVM could enter the guest with the wrong value in hardware. As above, the guest can't observe the bad value, but it's a weird and confusing wart in the implementation. Removal also fixes the unnecessary usage of VMX's atomic load/store MSR lists. Using the lists is only necessary for MSRs that are required for correct functionality immediately upon VM-Enter/VM-Exit, e.g. EFER on old hardware, or for MSRs that need to-the-uop precision, e.g. perf related MSRs. For UMWAIT_CONTROL, the effects are only visible in the kernel via TPAUSE/delay(), and KVM doesn't do any form of delay in vcpu_vmx_run(). Using the atomic lists is undesirable as they are more expensive than direct RDMSR/WRMSR. Furthermore, even if giving the guest control of the MSR is legitimate, e.g. in pass-through scenarios, it's not clear that the benefits would outweigh the overhead. E.g. saving and restoring an MSR across a VMX roundtrip costs ~250 cycles, and if the guest diverged from the host that cost would be paid on every run of the guest. In other words, if there is a legitimate use case then it should be enabled by a new per-VM capability. Note, KVM still needs to emulate MSR_IA32_UMWAIT_CONTROL so that it can correctly expose other WAITPKG features to the guest, e.g. TPAUSE, UMWAIT and UMONITOR. Fixes: 6e3ba4abcea56 ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL") Cc: stable@vger.kernel.org Cc: Jingqi Liu Cc: Tao Xu Signed-off-by: Sean Christopherson Message-Id: <20200623005135.10414-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit b835a71ef64a61383c414d6bf2896d2c0161deca Author: Tuomas Tynkkynen Date: Sun Jun 21 13:43:26 2020 +0300 usbnet: smsc95xx: Fix use-after-free after removal Syzbot reports an use-after-free in workqueue context: BUG: KASAN: use-after-free in mutex_unlock+0x19/0x40 kernel/locking/mutex.c:737 mutex_unlock+0x19/0x40 kernel/locking/mutex.c:737 __smsc95xx_mdio_read drivers/net/usb/smsc95xx.c:217 [inline] smsc95xx_mdio_read+0x583/0x870 drivers/net/usb/smsc95xx.c:278 check_carrier+0xd1/0x2e0 drivers/net/usb/smsc95xx.c:644 process_one_work+0x777/0xf90 kernel/workqueue.c:2274 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420 kthread+0x2df/0x300 kernel/kthread.c:255 It looks like that smsc95xx_unbind() is freeing the structures that are still in use by the concurrently running workqueue callback. Thus switch to using cancel_delayed_work_sync() to ensure the work callback really is no longer active. Reported-by: syzbot+29dc7d4ae19b703ff947@syzkaller.appspotmail.com Signed-off-by: Tuomas Tynkkynen Signed-off-by: David S. Miller commit f3fe412b0a634286a6a3753c3f9ff201e6bec716 Author: Ido Schimmel Date: Sun Jun 21 11:29:17 2020 +0300 mlxsw: spectrum: Do not rely on machine endianness The second commit cited below performed a cast of 'u32 buffsize' to '(u16 *)' when calling mlxsw_sp_port_headroom_8x_adjust(): mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, (u16 *) &buffsize); Colin noted that this will behave differently on big endian architectures compared to little endian architectures. Fix this by following Colin's suggestion and have the function accept and return 'u32' instead of passing the current size by reference. Fixes: da382875c616 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC") Fixes: 60833d54d56c ("mlxsw: spectrum: Adjust headroom buffers for 8x ports") Signed-off-by: Ido Schimmel Reported-by: Colin Ian King Suggested-by: Colin Ian King Signed-off-by: David S. Miller commit 6d61f483f148b856d47a6c96d5d84054d5a9f849 Author: Dejin Zheng Date: Sat Jun 20 22:55:34 2020 +0800 net: phy: smsc: fix printing too many logs Commit 7ae7ad2f11ef47 ("net: phy: smsc: use phy_read_poll_timeout() to simplify the code") will print a lot of logs as follows when Ethernet cable is not connected: [ 4.473105] SMSC LAN8710/LAN8720 2188000.ethernet-1:00: lan87xx_read_status failed: -110 When wait 640 ms for check ENERGYON bit, the timeout should not be regarded as an actual error and an error message also should not be printed. due to a hardware bug in LAN87XX device, it leads to unstable detection of plugging in Ethernet cable when LAN87xx is in Energy Detect Power-Down mode. the workaround for it involves, when the link is down, and at each read_status() call: - disable EDPD mode, forcing the PHY out of low-power mode - waiting 640ms to see if we have any energy detected from the media - re-enable entry to EDPD mode This is presumably enough to allow the PHY to notice that a cable is connected, and resume normal operations to negotiate with the partner. The problem is that when no media is detected, the 640ms wait times out and this commit was modified to prints an error message. it is an inappropriate conversion by used phy_read_poll_timeout() to introduce this bug. so fix this issue by use read_poll_timeout() to replace phy_read_poll_timeout(). Fixes: 7ae7ad2f11ef47 ("net: phy: smsc: use phy_read_poll_timeout() to simplify the code") Reported-by: Kevin Groeneveld Signed-off-by: Dejin Zheng Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2dbebf7ae1ed9a420d954305e2c9d5ed39ec57c3 Author: Sean Christopherson Date: Mon Jun 22 14:58:29 2020 -0700 KVM: nVMX: Plumb L2 GPA through to PML emulation Explicitly pass the L2 GPA to kvm_arch_write_log_dirty(), which for all intents and purposes is vmx_write_pml_buffer(), instead of having the latter pull the GPA from vmcs.GUEST_PHYSICAL_ADDRESS. If the dirty bit update is the result of KVM emulation (rare for L2), then the GPA in the VMCS may be stale and/or hold a completely unrelated GPA. Fixes: c5f983f6e8455 ("nVMX: Implement emulated Page Modification Logging") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20200622215832.22090-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4e15507fea70c0c312d79610efa46b6853ccf8e0 Author: Andrii Nakryiko Date: Sat Jun 20 20:11:59 2020 -0700 libbpf: Forward-declare bpf_stats_type for systems with outdated UAPI headers Systems that doesn't yet have the very latest linux/bpf.h header, enum bpf_stats_type will be undefined, causing compilation warnings. Prevents this by forward-declaring enum. Fixes: 0bee106716cf ("libbpf: Add support for command BPF_ENABLE_STATS") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200621031159.2279101-1-andriin@fb.com commit b0c34bde72a59c05e826bf0a5aeca0d73f38f791 Author: Felix Fietkau Date: Sun Jun 21 17:06:30 2020 +0200 MAINTAINERS: update email address for Felix Fietkau The old address has been bouncing for a while now Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 30480e6ed508e3ff7a3e03c975696aa5196ffe8a Author: Jordan Crouse Date: Mon Jun 22 10:55:38 2020 -0600 drm/msm: Fix up the rest of the messed up address sizes msm_gem_address_space_create() changed to take a start/length instead of a start/end for the iova space but all of the callers were just cut and pasted from the old usage. Most of the mistakes have been fixed up so just catch up the rest. Fixes: ccac7ce373c1 ("drm/msm: Refactor address space initialization") Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 116a1b9f1cb769b83e5adff323f977a62b1dcb2e Author: Shay Drory Date: Sun Jun 21 13:47:35 2020 +0300 IB/mad: Fix use after free when destroying MAD agent Currently, when RMPP MADs are processed while the MAD agent is destroyed, it could result in use after free of rmpp_recv, as decribed below: cpu-0 cpu-1 ----- ----- ib_mad_recv_done() ib_mad_complete_recv() ib_process_rmpp_recv_wc() unregister_mad_agent() ib_cancel_rmpp_recvs() cancel_delayed_work() process_rmpp_data() start_rmpp() queue_delayed_work(rmpp_recv->cleanup_work) destroy_rmpp_recv() free_rmpp_recv() cleanup_work()[1] spin_lock_irqsave(&rmpp_recv->agent->lock) <-- use after free [1] cleanup_work() == recv_cleanup_handler Fix it by waiting for the MAD agent reference count becoming zero before calling to ib_cancel_rmpp_recvs(). Fixes: 9a41e38a467c ("IB/mad: Use IDR for agent IDs") Link: https://lore.kernel.org/r/20200621104738.54850-2-leon@kernel.org Signed-off-by: Shay Drory Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6eefa839c4dddf2149e9f5f6f1aa3e1191c8db9c Author: Leon Romanovsky Date: Sun Jun 21 14:59:59 2020 +0300 RDMA/mlx5: Protect from kernel crash if XRC_TGT doesn't have udata Don't deref udata if it is NULL BUG: kernel NULL pointer dereference, address: 0000000000000030 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 SMP PTI CPU: 2 PID: 1592 Comm: python3 Not tainted 5.7.0-rc6+ #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 RIP: 0010:create_qp+0x39e/0xae0 [mlx5_ib] Code: c0 0d 00 00 bf 10 01 00 00 e8 be a9 e4 e0 48 85 c0 49 89 c2 0f 84 0c 07 00 00 41 8b 85 74 63 01 00 0f c8 a9 00 00 00 10 74 0a <41> 8b 46 30 0f c8 41 89 42 14 41 8b 52 18 41 0f b6 4a 1c 0f ca 89 RSP: 0018:ffffc9000067f8b0 EFLAGS: 00010206 RAX: 0000000010170000 RBX: ffff888441313000 RCX: 0000000000000000 RDX: 0000000000000200 RSI: 0000000000000000 RDI: ffff88845b1d4400 RBP: ffffc9000067fa60 R08: 0000000000000200 R09: ffff88845b1d4200 R10: ffff88845b1d4200 R11: ffff888441313000 R12: ffffc9000067f950 R13: ffff88846ac00140 R14: 0000000000000000 R15: ffff88846c2bc000 FS: 00007faa1a3c0540(0000) GS:ffff88846fd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000030 CR3: 0000000446dca003 CR4: 0000000000760ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ? __switch_to_asm+0x40/0x70 ? __switch_to_asm+0x34/0x70 mlx5_ib_create_qp+0x897/0xfa0 [mlx5_ib] ib_create_qp+0x9e/0x300 [ib_core] create_qp+0x92d/0xb20 [ib_uverbs] ? ib_uverbs_cq_event_handler+0x30/0x30 [ib_uverbs] ? release_resource+0x30/0x30 ib_uverbs_create_qp+0xc4/0xe0 [ib_uverbs] ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xc8/0xf0 [ib_uverbs] ib_uverbs_run_method+0x223/0x770 [ib_uverbs] ? track_pfn_remap+0xa7/0x100 ? uverbs_disassociate_api+0xd0/0xd0 [ib_uverbs] ? remap_pfn_range+0x358/0x490 ib_uverbs_cmd_verbs.isra.6+0x19b/0x370 [ib_uverbs] ? rdma_umap_priv_init+0x82/0xe0 [ib_core] ? vm_mmap_pgoff+0xec/0x120 ib_uverbs_ioctl+0xc0/0x120 [ib_uverbs] ksys_ioctl+0x92/0xb0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x48/0x130 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: e383085c2425 ("RDMA/mlx5: Set ECE options during QP create") Link: https://lore.kernel.org/r/20200621115959.60126-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 312d16c7c06174f44f96ef4a61c2936e6e360414 Author: Vitaly Kuznetsov Date: Mon Jun 22 17:14:35 2020 +0200 KVM: x86/mmu: Avoid mixing gpa_t with gfn_t in walk_addr_generic() translate_gpa() returns a GPA, assigning it to 'real_gfn' seems obviously wrong. There is no real issue because both 'gpa_t' and 'gfn_t' are u64 and we don't use the value in 'real_gfn' as a GFN, we do real_gfn = gpa_to_gfn(real_gfn); instead. 'If you see a "buffalo" sign on an elephant's cage, do not trust your eyes', but let's fix it for good. No functional change intended. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200622151435.752560-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 44d527170731c75587e95052f3eea72b8c651daf Author: Paolo Bonzini Date: Mon Jun 22 16:37:42 2020 +0200 KVM: LAPIC: ensure APIC map is up to date on concurrent update requests The following race can cause lost map update events: cpu1 cpu2 apic_map_dirty = true ------------------------------------------------------------ kvm_recalculate_apic_map: pass check mutex_lock(&kvm->arch.apic_map_lock); if (!kvm->arch.apic_map_dirty) and in process of updating map ------------------------------------------------------------- other calls to apic_map_dirty = true might be too late for affected cpu ------------------------------------------------------------- apic_map_dirty = false ------------------------------------------------------------- kvm_recalculate_apic_map: bail out on if (!kvm->arch.apic_map_dirty) To fix it, record the beginning of an update of the APIC map in apic_map_dirty. If another APIC map change switches apic_map_dirty back to DIRTY during the update, kvm_recalculate_apic_map should not make it CLEAN, and the other caller will go through the slow path. Reported-by: Igor Mammedov Signed-off-by: Paolo Bonzini commit c1d869d64a1955817c4d6fff08ecbbe8e59d36f8 Author: Mark Zhang Date: Sun Jun 21 14:00:00 2020 +0300 RDMA/counter: Query a counter before release Query a dynamically-allocated counter before release it, to update it's hwcounters and log all of them into history data. Otherwise all values of these hwcounters will be lost. Fixes: f34a55e497e8 ("RDMA/core: Get sum value of all counters when perform a sysfs stat read") Link: https://lore.kernel.org/r/20200621110000.56059-1-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4bc799dcb67066e0531004d5bdbe755bb02b5488 Author: Sami Tolvanen Date: Mon Jun 15 11:12:32 2020 -0700 security: fix the key_permission LSM hook function type Commit 8c0637e950d6 ("keys: Make the KEY_NEED_* perms an enum rather than a mask") changed the type of the key_permission callback functions, but didn't change the type of the hook, which trips indirect call checking with Control-Flow Integrity (CFI). This change fixes the issue by changing the hook type to match the functions. Fixes: 8c0637e950d6 ("keys: Make the KEY_NEED_* perms an enum rather than a mask") Signed-off-by: Sami Tolvanen Acked-by: Kees Cook Signed-off-by: James Morris commit 5d8913504ccfeea6120df5ae1c6f4479ff09b931 Author: Andy Shevchenko Date: Thu Jun 18 14:49:06 2020 +0300 gpio: pca953x: Fix GPIO resource leak on Intel Galileo Gen 2 When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing. Fixes: ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") Signed-off-by: Andy Shevchenko Cc: Mika Westerberg Reviewed-by: Mika Westerberg Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit dd0d718152e4c65b173070d48ea9dfc06894c3e5 Merge: 751645789f7c 06096cc6c5a8 Author: Linus Torvalds Date: Mon Jun 22 09:49:59 2020 -0700 Merge tag 'spi-fix-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "Quite a lot of fixes here for no single reason. There's a collection of the usual sort of device specific fixes and also a bunch of people have been working on spidev and the userspace test program spidev_test so they've got an unusually large collection of small fixes" * tag 'spi-fix-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spidev: fix a potential use-after-free in spidev_release() spi: spidev: fix a race between spidev_release and spidev_remove spi: stm32-qspi: Fix error path in case of -EPROBE_DEFER spi: uapi: spidev: Use TABs for alignment spi: spi-fsl-dspi: Free DMA memory with matching function spi: tools: Add macro definitions to fix build errors spi: tools: Make default_tx/rx and input_tx static spi: dt-bindings: amlogic, meson-gx-spicc: Fix schema for meson-g12a spi: rspi: Use requested instead of maximum bit rate spi: spidev_test: Use %u to format unsigned numbers spi: sprd: switch the sequence of setting WDG_LOAD_LOW and _HIGH commit af28dfacbe00d53df5dec2bf50640df33138b1fe Author: Igor Mammedov Date: Mon Jun 22 12:08:30 2020 -0400 kvm: lapic: fix broken vcpu hotplug Guest fails to online hotplugged CPU with error smpboot: do_boot_cpu failed(-1) to wakeup CPU#4 It's caused by the fact that kvm_apic_set_state(), which used to call recalculate_apic_map() unconditionally and pulled hotplugged CPU into apic map, is updating map conditionally on state changes. In this case the APIC map is not considered dirty and the is not updated. Fix the issue by forcing unconditional update from kvm_apic_set_state(), like it used to be. Fixes: 4abaffce4d25a ("KVM: LAPIC: Recalculate apic map in batch") Cc: stable@vger.kernel.org Signed-off-by: Igor Mammedov Message-Id: <20200622160830.426022-1-imammedo@redhat.com> Signed-off-by: Paolo Bonzini commit 751645789f7cffddb0715d51fd9e72986ad9ecaf Merge: 2a0008706854 1b3bcca20858 Author: Linus Torvalds Date: Mon Jun 22 09:47:59 2020 -0700 Merge tag 'regulator-fix-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "This has a fix for the refactoring out of the pickable ranges functionality, plus the removal of a BROKEN dependency on mt6358 now that the dependencies were merged in -rc1 and a couple of device specific fixes" * tag 'regulator-fix-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: mt6358: Remove BROKEN dependency regualtor: pfuze100: correct sw1a/sw2 on pfuze3000 regulator: Fix pickable ranges mapping regulator: da9063: fix LDO9 suspend and warning. commit 2a00087068542b4324b54a14278acabc50f2a61b Merge: 625d3449788f 95b2c3ec4cb1 Author: Linus Torvalds Date: Mon Jun 22 09:46:43 2020 -0700 Merge tag 'regmap-fix-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fixes from Mark Brown: "A few small fixes, none of which are likely to have any substantial impact here - the most substantial one is a fix for a long standing memory leak on devices that use register patching which will only have an impact if the device is removed and re-added" * tag 'regmap-fix-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Fix memory leak from regmap_register_patch regmap: fix the kerneldoc for regmap_test_bits() regmap: fix alignment issue commit cb91909e48a4809261ef4e967464e2009b214f06 Author: Eugenio Pérez Date: Sat Apr 18 12:22:17 2020 +0200 tools/virtio: Use tools/include/list.h instead of stubs It should not make any significant difference but reduce stub code. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200418102217.32327-9-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit 1d8bf5c3a3a1b90c39ccbafb3aa63ffc5196b142 Author: Eugenio Pérez Date: Sat Apr 18 12:22:16 2020 +0200 tools/virtio: Reset index in virtio_test --reset. This way behavior for vhost is more like a VM. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200418102217.32327-8-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit 6741239260293e46a32a141fb61bf2c062b0b6ed Author: Eugenio Pérez Date: Sat Apr 18 12:22:15 2020 +0200 tools/virtio: Extract virtqueue initialization in vq_reset So we can reset after that in the main loop. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200418102217.32327-7-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit 4cfb93935337d8f9680d865b0987583e462cfcc7 Author: Eugenio Pérez Date: Sat Apr 18 12:22:14 2020 +0200 tools/virtio: Use __vring_new_virtqueue in virtio_test.c As updated in ("2a2d1382fe9d virtio: Add improved queue allocation API") Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200418102217.32327-6-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit 264ee5aa81ec87eebfb0e2fb70cc0a38df80bab2 Author: Eugenio Pérez Date: Sat Apr 18 12:22:13 2020 +0200 tools/virtio: Add --reset Currently, it only removes and add backend, but it will reset vq position in future commits. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200418102217.32327-5-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit 7add78b2a6b76d98fcf35e981c5f84b3c91459f5 Author: Eugenio Pérez Date: Sat Apr 18 12:22:12 2020 +0200 tools/virtio: Add --batch=random option So we can test with non-deterministic batches in flight. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200418102217.32327-4-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit 633fae33d562dc2538cc3d6033a2d5e277050783 Author: Eugenio Pérez Date: Sat Apr 18 12:22:11 2020 +0200 tools/virtio: Add --batch option This allow to test vhost having >1 buffers in flight Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200401183118.8334-5-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20200418102217.32327-3-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin commit b3562c6087b585abba53d906f127d6fd5a92829c Author: David Hildenbrand Date: Thu Jun 11 11:35:18 2020 +0200 virtio-mem: add memory via add_memory_driver_managed() Virtio-mem managed memory is always detected and added by the virtio-mem driver, never using something like the firmware-provided memory map. This is the case after an ordinary system reboot, and has to be guaranteed after kexec. Especially, virtio-mem added memory resources can contain inaccessible parts ("unblocked memory blocks"), blindly forwarding them to a kexec kernel is dangerous, as unplugged memory will get accessed (esp. written). Let's use the new way of adding special driver-managed memory introduced in commit 7b7b27214bba ("mm/memory_hotplug: introduce add_memory_driver_managed()"). This will result in no entries in /sys/firmware/memmap ("raw firmware- provided memory map"), the memory resource will be flagged IORESOURCE_MEM_DRIVER_MANAGED (esp., kexec_file_load() will not place kexec images on this memory), and it is exposed as "System RAM (virtio_mem)" in /proc/iomem, so esp. kexec-tools can properly handle it. Example /proc/iomem before this change: [...] 140000000-333ffffff : virtio0 140000000-147ffffff : System RAM 334000000-533ffffff : virtio1 338000000-33fffffff : System RAM 340000000-347ffffff : System RAM 348000000-34fffffff : System RAM [...] Example /proc/iomem after this change: [...] 140000000-333ffffff : virtio0 140000000-147ffffff : System RAM (virtio_mem) 334000000-533ffffff : virtio1 338000000-33fffffff : System RAM (virtio_mem) 340000000-347ffffff : System RAM (virtio_mem) 348000000-34fffffff : System RAM (virtio_mem) [...] Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Cc: teawater Fixes: 5f1f79bbc9e26 ("virtio-mem: Paravirtualized memory hotplug") Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200611093518.5737-1-david@redhat.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Pankaj Gupta commit 1c3d69ab5348b661616992206357a3ebf19b1008 Author: Dan Carpenter Date: Wed Jun 10 11:59:11 2020 +0300 virtio-mem: silence a static checker warning Smatch complains that "rc" can be uninitialized if we hit the "break;" statement on the first iteration through the loop. I suspect that this can't happen in real life, but returning a zero literal is cleaner and silence the static checker warning. Fixes: 5f1f79bbc9e2 ("virtio-mem: Paravirtualized memory hotplug") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200610085911.GC5439@mwanda Signed-off-by: Michael S. Tsirkin commit c09cc2c319863f620caf5e723db496eed55f7c7f Author: Dan Carpenter Date: Wed Jun 10 11:58:52 2020 +0300 vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap() The "vma->vm_pgoff" variable is an unsigned long so if it's larger than INT_MAX then "index" can be negative leading to an underflow. Fix this by changing the type of "index" to "unsigned long". Fixes: ddd89d0a059d ("vhost_vdpa: support doorbell mapping via mmap") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200610085852.GB5439@mwanda Signed-off-by: Michael S. Tsirkin commit 24eae8ebfb29ca54980764245ffb8aa218666ff6 Author: Jason Wang Date: Wed May 27 14:05:28 2020 +0800 vdpa: fix typos in the comments for __vdpa_alloc_device() Fix two typos in the comments for __vdpa_alloc_device(). Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20200527060528.9100-1-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin commit c42ad5d4358230be166fc36c87bae0dd1680c570 Author: Andreas Gerstmayr Date: Fri Jun 19 17:32:31 2020 +0200 perf flamegraph: Explicitly set utf-8 encoding On some platforms the default encoding is not utf-8, which causes an UnicodeDecodeError when reading the flamegraph template and writing the flamegraph Signed-off-by: Andreas Gerstmayr Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200619153232.203537-1-agerstmayr@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit e6d701dca9893990d999fd145e3e07223c002b06 Author: Nathan Chancellor Date: Thu Jun 11 21:51:50 2020 -0700 ACPI: sysfs: Fix pm_profile_attr type When running a kernel with Clang's Control Flow Integrity implemented, there is a violation that happens when accessing /sys/firmware/acpi/pm_profile: $ cat /sys/firmware/acpi/pm_profile 0 $ dmesg ... [ 17.352564] ------------[ cut here ]------------ [ 17.352568] CFI failure (target: acpi_show_profile+0x0/0x8): [ 17.352572] WARNING: CPU: 3 PID: 497 at kernel/cfi.c:29 __cfi_check_fail+0x33/0x40 [ 17.352573] Modules linked in: [ 17.352575] CPU: 3 PID: 497 Comm: cat Tainted: G W 5.7.0-microsoft-standard+ #1 [ 17.352576] RIP: 0010:__cfi_check_fail+0x33/0x40 [ 17.352577] Code: 48 c7 c7 50 b3 85 84 48 c7 c6 50 0a 4e 84 e8 a4 d8 60 00 85 c0 75 02 5b c3 48 c7 c7 dc 5e 49 84 48 89 de 31 c0 e8 7d 06 eb ff <0f> 0b 5b c3 00 00 cc cc 00 00 cc cc 00 85 f6 74 25 41 b9 ea ff ff [ 17.352577] RSP: 0018:ffffaa6dc3c53d30 EFLAGS: 00010246 [ 17.352578] RAX: 331267e0c06cee00 RBX: ffffffff83d85890 RCX: ffffffff8483a6f8 [ 17.352579] RDX: ffff9cceabbb37c0 RSI: 0000000000000082 RDI: ffffffff84bb9e1c [ 17.352579] RBP: ffffffff845b2bc8 R08: 0000000000000001 R09: ffff9cceabbba200 [ 17.352579] R10: 000000000000019d R11: 0000000000000000 R12: ffff9cc947766f00 [ 17.352580] R13: ffffffff83d6bd50 R14: ffff9ccc6fa80000 R15: ffffffff845bd328 [ 17.352582] FS: 00007fdbc8d13580(0000) GS:ffff9cce91ac0000(0000) knlGS:0000000000000000 [ 17.352582] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 17.352583] CR2: 00007fdbc858e000 CR3: 00000005174d0000 CR4: 0000000000340ea0 [ 17.352584] Call Trace: [ 17.352586] ? rev_id_show+0x8/0x8 [ 17.352587] ? __cfi_check+0x45bac/0x4b640 [ 17.352589] ? kobj_attr_show+0x73/0x80 [ 17.352590] ? sysfs_kf_seq_show+0xc1/0x140 [ 17.352592] ? ext4_seq_options_show.cfi_jt+0x8/0x8 [ 17.352593] ? seq_read+0x180/0x600 [ 17.352595] ? sysfs_create_file_ns.cfi_jt+0x10/0x10 [ 17.352596] ? tlbflush_read_file+0x8/0x8 [ 17.352597] ? __vfs_read+0x6b/0x220 [ 17.352598] ? handle_mm_fault+0xa23/0x11b0 [ 17.352599] ? vfs_read+0xa2/0x130 [ 17.352599] ? ksys_read+0x6a/0xd0 [ 17.352601] ? __do_sys_getpgrp+0x8/0x8 [ 17.352602] ? do_syscall_64+0x72/0x120 [ 17.352603] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 17.352604] ---[ end trace 7b1fa81dc897e419 ]--- When /sys/firmware/acpi/pm_profile is read, sysfs_kf_seq_show is called, which in turn calls kobj_attr_show, which gets the ->show callback member by calling container_of on attr (casting it to struct kobj_attribute) then calls it. There is a CFI violation because pm_profile_attr is of type struct device_attribute but kobj_attr_show calls ->show expecting it to be from struct kobj_attribute. CFI checking ensures that function pointer types match when doing indirect calls. Fix pm_profile_attr to be defined in terms of kobj_attribute so there is no violation or mismatch. Fixes: 362b646062b2 ("ACPI: Export FADT pm_profile integer value to userspace") Link: https://github.com/ClangBuiltLinux/linux/issues/1051 Reported-by: yuu ichii Signed-off-by: Nathan Chancellor Cc: 3.10+ # 3.10+ Signed-off-by: Rafael J. Wysocki commit 75b0cea7bf307f362057cc778efe89af4c615354 Author: Jason A. Donenfeld Date: Mon Jun 15 04:43:32 2020 -0600 ACPI: configfs: Disallow loading ACPI tables when locked down Like other vectors already patched, this one here allows the root user to load ACPI tables, which enables arbitrary physical address writes, which in turn makes it possible to disable lockdown. Prevents this by checking the lockdown status before allowing a new ACPI table to be installed. The link in the trailer shows a PoC of how this might be used. Link: https://git.zx2c4.com/american-unsigned-language/tree/american-unsigned-language-2.sh Cc: 5.4+ # 5.4+ Signed-off-by: Jason A. Donenfeld Signed-off-by: Rafael J. Wysocki commit a25e91028ac2f544e0140aff2c9360a0e995dd86 Author: Andrew Jones Date: Mon Jun 22 16:27:10 2020 +0200 KVM: arm64: pvtime: Ensure task delay accounting is enabled Ensure we're actually accounting run_delay before we claim that we'll expose it to the guest. If we're not, then we just pretend like steal time isn't supported in order to avoid any confusion. Signed-off-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200622142710.18677-1-drjones@redhat.com commit 66b7e05dc0239c5817859f261098ba9cc2efbd2b Author: Steven Price Date: Wed Jun 17 11:54:56 2020 +0100 KVM: arm64: Fix kvm_reset_vcpu() return code being incorrect with SVE If SVE is enabled then 'ret' can be assigned the return value of kvm_vcpu_enable_sve() which may be 0 causing future "goto out" sites to erroneously return 0 on failure rather than -EINVAL as expected. Remove the initialisation of 'ret' and make setting the return value explicit to avoid this situation in the future. Fixes: 9a3cdf26e336 ("KVM: arm64/sve: Allow userspace to enable SVE for vcpus") Cc: stable@vger.kernel.org Reported-by: James Morse Signed-off-by: Steven Price Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200617105456.28245-1-steven.price@arm.com commit 7733306bd593c737c63110175da6c35b4b8bb32c Author: Alexandru Elisei Date: Thu Jun 18 18:12:54 2020 +0100 KVM: arm64: Annotate hyp NMI-related functions as __always_inline The "inline" keyword is a hint for the compiler to inline a function. The functions system_uses_irq_prio_masking() and gic_write_pmr() are used by the code running at EL2 on a non-VHE system, so mark them as __always_inline to make sure they'll always be part of the .hyp.text section. This fixes the following splat when trying to run a VM: [ 47.625273] Kernel panic - not syncing: HYP panic: [ 47.625273] PS:a00003c9 PC:0000ca0b42049fc4 ESR:86000006 [ 47.625273] FAR:0000ca0b42049fc4 HPFAR:0000000010001000 PAR:0000000000000000 [ 47.625273] VCPU:0000000000000000 [ 47.647261] CPU: 1 PID: 217 Comm: kvm-vcpu-0 Not tainted 5.8.0-rc1-ARCH+ #61 [ 47.654508] Hardware name: Globalscale Marvell ESPRESSOBin Board (DT) [ 47.661139] Call trace: [ 47.663659] dump_backtrace+0x0/0x1cc [ 47.667413] show_stack+0x18/0x24 [ 47.670822] dump_stack+0xb8/0x108 [ 47.674312] panic+0x124/0x2f4 [ 47.677446] panic+0x0/0x2f4 [ 47.680407] SMP: stopping secondary CPUs [ 47.684439] Kernel Offset: disabled [ 47.688018] CPU features: 0x240402,20002008 [ 47.692318] Memory Limit: none [ 47.695465] ---[ end Kernel panic - not syncing: HYP panic: [ 47.695465] PS:a00003c9 PC:0000ca0b42049fc4 ESR:86000006 [ 47.695465] FAR:0000ca0b42049fc4 HPFAR:0000000010001000 PAR:0000000000000000 [ 47.695465] VCPU:0000000000000000 ]--- The instruction abort was caused by the code running at EL2 trying to fetch an instruction which wasn't mapped in the EL2 translation tables. Using objdump showed the two functions as separate symbols in the .text section. Fixes: 85738e05dc38 ("arm64: kvm: Unmask PMR before entering guest") Cc: stable@vger.kernel.org Signed-off-by: Alexandru Elisei Signed-off-by: Marc Zyngier Acked-by: James Morse Link: https://lore.kernel.org/r/20200618171254.1596055-1-alexandru.elisei@arm.com commit 7b2182ec381f8ea15c7eb1266d6b5d7da620ad93 Author: Chuck Lever Date: Mon Jun 15 09:21:13 2020 -0400 xprtrdma: Fix handling of RDMA_ERROR replies The RPC client currently doesn't handle ERR_CHUNK replies correctly. rpcrdma_complete_rqst() incorrectly passes a negative number to xprt_complete_rqst() as the number of bytes copied. Instead, set task->tk_status to the error value, and return zero bytes copied. In these cases, return -EIO rather than -EREMOTEIO. The RPC client's finite state machine doesn't know what to do with -EREMOTEIO. Additional clean ups: - Don't double-count RDMA_ERROR replies - Remove a stale comment Signed-off-by: Chuck Lever Cc: Signed-off-by: Anna Schumaker commit c487eb7d8e41579d87216ce43152acd336f2c4aa Author: Chuck Lever Date: Mon Jun 15 09:21:07 2020 -0400 xprtrdma: Clean up disconnect 1. Ensure that only rpcrdma_cm_event_handler() modifies ep->re_connect_status to avoid racy changes to that field. 2. Ensure that xprt_force_disconnect() is invoked only once as a transport is closed or destroyed. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit f423f755f41e4944fb4cd1c259cbf2ba3608d647 Author: Chuck Lever Date: Mon Jun 15 09:21:02 2020 -0400 xprtrdma: Clean up synopsis of rpcrdma_flush_disconnect() Refactor: Pass struct rpcrdma_xprt instead of an IB layer object. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 2d97f4637666704953dfbb10322c2b73bb53d5e7 Author: Chuck Lever Date: Mon Jun 15 09:20:57 2020 -0400 xprtrdma: Use re_connect_status safely in rpcrdma_xprt_connect() Clean up: Sometimes creating a fresh rpcrdma_ep can fail. That's why xprt_rdma_connect() always checks if the r_xprt->rx_ep pointer is valid before dereferencing it. Instead, xprt_rdma_connect() can simply check rpcrdma_xprt_connect()'s return value. Also, there's no need to set re_connect_status to zero just after the rpcrdma_ep is created, since it is allocated with kzalloc. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 2acc5cae292355f5f18ad377a2a966e7f03c8fec Author: Chuck Lever Date: Mon Jun 15 09:20:52 2020 -0400 xprtrdma: Prevent dereferencing r_xprt->rx_ep after it is freed r_xprt->rx_ep is known to be good while the transport's send lock is held. Otherwise additional references on rx_ep must be held when it is used outside of that lock's critical sections. For now, bump the rx_ep reference count once whenever there is at least one outstanding Receive WR. This avoids the memory bandwidth overhead of taking and releasing the reference count for every ib_post_recv() and Receive completion. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit f148915f91fccd8c3df1b0bff7d1c8458cad3be5 Author: Krzysztof Kozlowski Date: Mon Jun 22 13:05:43 2020 +0200 spi: spi-fsl-dspi: Initialize completion before possible interrupt The interrupt handler calls completion and is IRQ requested before the completion is initialized. Logically it should be the other way. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200622110543.5035-4-krzk@kernel.org Signed-off-by: Mark Brown commit 3d87b613d6a3c6f0980e877ab0895785a2dde581 Author: Krzysztof Kozlowski Date: Mon Jun 22 13:05:42 2020 +0200 spi: spi-fsl-dspi: Fix external abort on interrupt in resume or exit paths If shared interrupt comes late, during probe error path or device remove (could be triggered with CONFIG_DEBUG_SHIRQ), the interrupt handler dspi_interrupt() will access registers with the clock being disabled. This leads to external abort on non-linefetch on Toradex Colibri VF50 module (with Vybrid VF5xx): $ echo 4002d000.spi > /sys/devices/platform/soc/40000000.bus/4002d000.spi/driver/unbind Unhandled fault: external abort on non-linefetch (0x1008) at 0x8887f02c Internal error: : 1008 [#1] ARM Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree) Backtrace: (regmap_mmio_read32le) (regmap_mmio_read) (_regmap_bus_reg_read) (_regmap_read) (regmap_read) (dspi_interrupt) (free_irq) (devm_irq_release) (release_nodes) (devres_release_all) (device_release_driver_internal) The resource-managed framework should not be used for shared interrupt handling, because the interrupt handler might be called after releasing other resources and disabling clocks. Similar bug could happen during suspend - the shared interrupt handler could be invoked after suspending the device. Each device sharing this interrupt line should disable the IRQ during suspend so handler will be invoked only in following cases: 1. None suspended, 2. All devices resumed. Fixes: 349ad66c0ab0 ("spi:Add Freescale DSPI driver for Vybrid VF610 platform") Signed-off-by: Krzysztof Kozlowski Tested-by: Vladimir Oltean Reviewed-by: Vladimir Oltean Cc: Link: https://lore.kernel.org/r/20200622110543.5035-3-krzk@kernel.org Signed-off-by: Mark Brown commit 3c525b69e8c1a9a6944e976603c7a1a713e728f9 Author: Krzysztof Kozlowski Date: Mon Jun 22 13:05:41 2020 +0200 spi: spi-fsl-dspi: Fix lockup if device is shutdown during SPI transfer During shutdown, the driver should unregister the SPI controller and stop the hardware. Otherwise the dspi_transfer_one_message() could wait on completion infinitely. Additionally, calling spi_unregister_controller() first in device shutdown reverse-matches the probe function, where SPI controller is registered at the end. Fixes: dc234825997e ("spi: spi-fsl-dspi: Adding shutdown hook") Reported-by: Vladimir Oltean Signed-off-by: Krzysztof Kozlowski Tested-by: Vladimir Oltean Reviewed-by: Vladimir Oltean Cc: Link: https://lore.kernel.org/r/20200622110543.5035-2-krzk@kernel.org Signed-off-by: Mark Brown commit 7684580d45bd3d84ed9b453a4cadf7a9a5605a3f Author: Krzysztof Kozlowski Date: Mon Jun 22 13:05:40 2020 +0200 spi: spi-fsl-dspi: Fix lockup if device is removed during SPI transfer During device removal, the driver should unregister the SPI controller and stop the hardware. Otherwise the dspi_transfer_one_message() could wait on completion infinitely. Additionally, calling spi_unregister_controller() first in device removal reverse-matches the probe function, where SPI controller is registered at the end. Fixes: 05209f457069 ("spi: fsl-dspi: add missing clk_disable_unprepare() in dspi_remove()") Reported-by: Vladimir Oltean Signed-off-by: Krzysztof Kozlowski Cc: Link: https://lore.kernel.org/r/20200622110543.5035-1-krzk@kernel.org Signed-off-by: Mark Brown commit c1ed1754f271f6b7acb1bfdc8cfb62220fbed423 Author: Aneesh Kumar K.V Date: Thu Jun 11 17:31:59 2020 +0530 powerpc/kvm/book3s64: Fix kernel crash with nested kvm & DEBUG_VIRTUAL With CONFIG_DEBUG_VIRTUAL=y, __pa() checks for addr value and if it's less than PAGE_OFFSET it leads to a BUG(). #define __pa(x) ({ VIRTUAL_BUG_ON((unsigned long)(x) < PAGE_OFFSET); (unsigned long)(x) & 0x0fffffffffffffffUL; }) kernel BUG at arch/powerpc/kvm/book3s_64_mmu_radix.c:43! cpu 0x70: Vector: 700 (Program Check) at [c0000018a2187360] pc: c000000000161b30: __kvmhv_copy_tofrom_guest_radix+0x130/0x1f0 lr: c000000000161d5c: kvmhv_copy_from_guest_radix+0x3c/0x80 ... kvmhv_copy_from_guest_radix+0x3c/0x80 kvmhv_load_from_eaddr+0x48/0xc0 kvmppc_ld+0x98/0x1e0 kvmppc_load_last_inst+0x50/0x90 kvmppc_hv_emulate_mmio+0x288/0x2b0 kvmppc_book3s_radix_page_fault+0xd8/0x2b0 kvmppc_book3s_hv_page_fault+0x37c/0x1050 kvmppc_vcpu_run_hv+0xbb8/0x1080 kvmppc_vcpu_run+0x34/0x50 kvm_arch_vcpu_ioctl_run+0x2fc/0x410 kvm_vcpu_ioctl+0x2b4/0x8f0 ksys_ioctl+0xf4/0x150 sys_ioctl+0x28/0x80 system_call_exception+0x104/0x1d0 system_call_common+0xe8/0x214 kvmhv_copy_tofrom_guest_radix() uses a NULL value for to/from to indicate direction of copy. Avoid calling __pa() if the value is NULL to avoid the BUG(). Signed-off-by: Aneesh Kumar K.V [mpe: Massage change log a bit to mention CONFIG_DEBUG_VIRTUAL] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200611120159.680284-1-aneesh.kumar@linux.ibm.com commit 91ef3d9f9fef08e3f42b78ec0ae8187be1070fce Merge: d50313a5a0d8 f141a422159a Author: Takashi Iwai Date: Mon Jun 22 13:49:14 2020 +0200 Merge tag 'asoc-fix-v5.8-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.8 This is a collection of mostly small fixes, mostly fixing fallout from some of the DPCM changes that went in last time around which shook out some issues on i.MX and Qualcomm platforms. The addition of a managed version of snd_soc_register_dai() is to fix resource leaks. There's also a few new device IDs for x86 systems. commit bf6d6e68d2028a2d82f4c106f50ec75cc1e6ef89 Author: Pierre-Louis Bossart Date: Wed Jun 17 11:35:36 2020 -0500 soundwire: intel: fix memory leak with devm_kasprintf The dais are allocated with devm_kcalloc() but their name isn't resourced managed and never freed. Fix by also using devm_ for the dai names as well. Fixes: c46302ec554c5 ('soundwire: intel: Add audio DAI ops') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200617163536.17401-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul commit 7e4773f73dcfb92e7e33532162f722ec291e75a4 Author: Arseny Solokha Date: Sat Jun 13 23:28:01 2020 +0700 powerpc/fsl_booke/32: Fix build with CONFIG_RANDOMIZE_BASE Building the current 5.8 kernel for an e500 machine with CONFIG_RANDOMIZE_BASE=y and CONFIG_BLOCK=n yields the following failure: arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init': arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration of function 'flush_icache_range'; did you mean 'flush_tlb_range'? Indeed, including asm/cacheflush.h into kaslr_booke.c fixes the build. Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure") Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Arseny Solokha Reviewed-by: Jason Yan Acked-by: Scott Wood [mpe: Tweak change log to mention CONFIG_BLOCK=n] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200613162801.1946619-1-asolokha@kb.kras.ru commit 69339d083dfb7786b0e0b3fc19eaddcf11fabdfb Author: Jacky Hu Date: Tue Jun 16 09:50:24 2020 +0800 pinctrl: amd: fix npins for uart0 in kerncz_groups uart0_pins is defined as: static const unsigned uart0_pins[] = {135, 136, 137, 138, 139}; which npins is wronly specified as 9 later { .name = "uart0", .pins = uart0_pins, .npins = 9, }, npins should be 5 instead of 9 according to the definition. Signed-off-by: Jacky Hu Link: https://lore.kernel.org/r/20200616015024.287683-1-hengqing.hu@gmail.com Signed-off-by: Linus Walleij commit 625d3449788f85569096780592549d0340e9c0c7 Author: Jason A. Donenfeld Date: Sun Jun 21 21:02:22 2020 -0600 Revert "kernel/printk: add kmsg SEEK_CUR handling" This reverts commit 8ece3b3eb576a78d2e67ad4c3a80a39fa6708809. This commit broke userspace. Bash uses ESPIPE to determine whether or not the file should be read using "unbuffered I/O", which means reading 1 byte at a time instead of 128 bytes at a time. I used to use bash to read through kmsg in a really quite nasty way: while read -t 0.1 -r line 2>/dev/null || [[ $? -ne 142 ]]; do echo "SARU $line" done < /dev/kmsg This will show all lines that can fit into the 128 byte buffer, and skip lines that don't. That's pretty awful, but at least it worked. With this change, bash now tries to do 1-byte reads, which means it skips all the lines, which is worse than before. Now, I don't really care very much about this, and I'm already look for a workaround. But I did just spend an hour trying to figure out why my scripts were broken. Either way, it makes no difference to me personally whether this is reverted, but it might be something to consider. If you declare that "trying to read /dev/kmsg with bash is terminally stupid anyway," I might be inclined to agree with you. But do note that bash uses lseek(fd, 0, SEEK_CUR)==>ESPIPE to determine whether or not it's reading from a pipe. Cc: Bruno Meneguele Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: David Laight Cc: Sergey Senozhatsky Cc: Petr Mladek Signed-off-by: Jason A. Donenfeld Signed-off-by: Linus Torvalds commit 77577de64167aa0643d47ffbaacf3642632b321b Author: Xiyu Yang Date: Sat Jun 13 20:27:09 2020 +0800 cifs: Fix cached_fid refcnt leak in open_shroot open_shroot() invokes kref_get(), which increases the refcount of the "tcon->crfid" object. When open_shroot() returns not zero, it means the open operation failed and close_shroot() will not be called to decrement the refcount of the "tcon->crfid". The reference counting issue happens in one normal path of open_shroot(). When the cached root have been opened successfully in a concurrent process, the function increases the refcount and jump to "oshr_free" to return. However the current return value "rc" may not equal to 0, thus the increased refcount will not be balanced outside the function, causing a refcnt leak. Fix this issue by setting the value of "rc" to 0 before jumping to "oshr_free" label. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: Steve French CC: Stable commit 48778464bb7d346b47157d21ffde2af6b2d39110 Author: Linus Torvalds Date: Sun Jun 21 15:45:29 2020 -0700 Linux 5.8-rc2 commit 817d914d17651c188f28a284261ff6091d80ad2c Merge: 16f4aa9b7c23 8231b0b9c322 Author: Linus Torvalds Date: Sun Jun 21 15:41:24 2020 -0700 Merge tag 'selinux-pr-20200621' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull SELinux fixes from Paul Moore: "Three small patches to fix problems in the SELinux code, all found via clang. Two patches fix potential double-free conditions and one fixes an undefined return value" * tag 'selinux-pr-20200621' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: fix undefined return of cond_evaluate_expr selinux: fix a double free in cond_read_node()/cond_read_list() selinux: fix double free commit 16f4aa9b7c2304e439796bd097b2c0a7663f5d6e Merge: be9160a90de7 25fae752156d Author: Linus Torvalds Date: Sun Jun 21 13:04:57 2020 -0700 Merge tag 'pinctrl-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Some early fixes collected during the first week after the merge window, all pretty self-evident, with the details below. The revert is the crucial thing. - Fix a warning on the Qualcomm SPMI GPIO chip being instatiated twice without a unique irqchip struct - Use the noirq variants of the suspend and resume callbacks in the Tegra driver - Clean up the errorpath on the MCP23s08 driver - Revert the use of devm_of_iomap() in the Freescale driver as it was regressing the platform - Add some missing pins in the Qualcomm IPQ6018 driver - Fix a simple documentation bug in the pinctrl-single driver" * tag 'pinctrl-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: single: fix function name in documentation pinctrl: qcom: ipq6018 Add missing pins in qpic pin group Revert "pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'" pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings pinctrl: tegra: Use noirq suspend/resume callbacks pinctrl: qcom: spmi-gpio: fix warning about irq chip reusage commit be9160a90de778758d499fe2cb8ee8cc4dda2cc7 Merge: 75613939084f 214377e9b7e3 Author: Linus Torvalds Date: Sun Jun 21 12:44:52 2020 -0700 Merge tag 'kbuild-fixes-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - fix -gz=zlib compiler option test for CONFIG_DEBUG_INFO_COMPRESSED - improve cc-option in scripts/Kbuild.include to clean up temp files - improve cc-option in scripts/Kconfig.include for more reliable compile option test - do not copy modules.builtin by 'make install' because it would break existing systems - use 'userprogs' syntax for watch_queue sample * tag 'kbuild-fixes-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: samples: watch_queue: build sample program for target architecture Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n" scripts: Fix typo in headers_install.sh kconfig: unify cc-option and as-option kbuild: improve cc-option to clean up all temporary files Makefile: Improve compressed debug info support detection commit 75613939084f59c0848b146e54ba463dc494c433 Merge: 93bbca271a71 c0e1c8c22beb Author: Linus Torvalds Date: Sun Jun 21 10:02:53 2020 -0700 Merge tag 'powerpc-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - One fix for the interrupt rework we did last release which broke KVM-PR - Three commits fixing some fallout from the READ_ONCE() changes interacting badly with our 8xx 16K pages support, which uses a pte_t that is a structure of 4 actual PTEs - A cleanup of the 8xx pte_update() to use the newly added pmd_off() - A fix for a crash when handling an oops if CONFIG_DEBUG_VIRTUAL is enabled - A minor fix for the SPU syscall generation Thanks to Aneesh Kumar K.V, Christian Zigotzky, Christophe Leroy, Mike Rapoport, Nicholas Piggin. * tag 'powerpc-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/8xx: Provide ptep_get() with 16k pages mm: Allow arches to provide ptep_get() mm/gup: Use huge_ptep_get() in gup_hugepte() powerpc/syscalls: Use the number when building SPU syscall table powerpc/8xx: use pmd_off() to access a PMD entry in pte_update() powerpc/64s: Fix KVM interrupt using wrong save area powerpc: Fix kernel crash in show_instructions() w/DEBUG_VIRTUAL commit 93bbca271a715e2730b6f4ae0be42056cdab6561 Merge: 64677779e896 819966c06b75 Author: Linus Torvalds Date: Sun Jun 21 10:01:03 2020 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: - NULL dereference in octeontx - PM reference imbalance in ks-sa - deadlock in crypto manager - memory leak in drbg - missing socket limit check on receive SG list size in algif_skcipher - typos in caam - warnings in ccp and hisilicon * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: drbg - always try to free Jitter RNG instance crypto: marvell/octeontx - Fix a potential NULL dereference crypto: algboss - don't wait during notifier callback crypto: caam - fix typos crypto: ccp - Fix sparse warnings in sev-dev crypto: hisilicon - Cap block size at 2^31 crypto: algif_skcipher - Cap recv SG list at ctx->used hwrng: ks-sa - Fix runtime PM imbalance on error commit 214377e9b7e3185abf5998b8a90450e01bab21a7 Author: Masahiro Yamada Date: Wed Jun 17 11:08:38 2020 +0900 samples: watch_queue: build sample program for target architecture This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada commit 2c6d9636ad92083d79a060edc84259526c153670 Author: Masahiro Yamada Date: Sat Jun 20 00:09:55 2020 +0900 Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n" This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b, which broke build systems that need to install files to a certain path, but do not set INSTALL_MOD_PATH when invoking 'make install'. $ make INSTALL_PATH=/tmp/destdir install mkdir: cannot create directory ‘/lib/modules/5.8.0-rc1+/’: Permission denied Makefile:1342: recipe for target '_builtin_inst_' failed make: *** [_builtin_inst_] Error 1 While modules.builtin is useful also for CONFIG_MODULES=n, this change in the behavior is quite unexpected. Maybe "make modules_install" can install modules.builtin irrespective of CONFIG_MODULES as Jonas originally suggested. Anyway, that commit should be reverted ASAP. Reported-by: Douglas Anderson Reported-by: Guenter Roeck Cc: Jonas Karlman Signed-off-by: Masahiro Yamada Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck commit 005c34ae4b44f085120d7f371121ec7ded677761 Author: Marc Zyngier Date: Sun Jun 21 14:43:15 2020 +0100 irqchip/gic: Atomically update affinity The GIC driver uses a RMW sequence to update the affinity, and relies on the gic_lock_irqsave/gic_unlock_irqrestore sequences to update it atomically. But these sequences only expand into anything meaningful if the BL_SWITCHER option is selected, which almost never happens. It also turns out that using a RMW and locks is just as silly, as the GIC distributor supports byte accesses for the GICD_TARGETRn registers, which when used make the update atomic by definition. Drop the terminally broken code and replace it by a byte write. Fixes: 04c8b0f82c7d ("irqchip/gic: Make locking a BL_SWITCHER only feature") Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier commit 559fe74ba6b0c8283e923a64f19fc0398fb64d04 Author: Palmer Dabbelt Date: Thu Jun 11 10:53:02 2020 -0700 irqchip/riscv-intc: Fix a typo in a pr_warn() Anup originally re-spun his patch set to include this fix, but it was a bit too late for my PR so I've split it out. Signed-off-by: Palmer Dabbelt Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200611175302.253540-1-palmer@dabbelt.com commit 31dbb6b1d025506b3b8b8b74e9b697df47b9f696 Author: Zenghui Yu Date: Fri Jun 5 13:23:45 2020 +0800 irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix sleep in atomic readx_poll_timeout() can sleep if @sleep_us is specified by the caller, and is therefore unsafe to be used inside the atomic context, which is this case when we use it to poll the GICR_VPENDBASER.Dirty bit in irq_set_vcpu_affinity() callback. Let's convert to its atomic version instead which helps to get the v4.1 board back to life! Fixes: 96806229ca03 ("irqchip/gic-v4.1: Add support for VPENDBASER's Dirty+Valid signaling") Signed-off-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200605052345.1494-1-yuzenghui@huawei.com commit a23df9a4bd326fb4c7f160b72b0e0560b989ac29 Author: Jiaxun Yang Date: Sat May 30 20:11:12 2020 +0800 irqchip/loongson-pci-msi: Fix a typo in Kconfig PCH MSI driver's menuconfig entry was wrong. Fix it. Fixes: 632dcc2c75ef ("irqchip: Add Loongson PCH MSI controller") Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200530121113.1797678-2-jiaxun.yang@flygoat.com commit 7f757cb6b2fc0ad704d0ca0b7b5a2729aca35580 Author: Bartlomiej Zolnierkiewicz Date: Tue Jun 9 11:29:43 2020 +0200 video: fbdev: uvesafb: fix "noblank" option handling Fix the recent regression. Fixes: dbc7ece12a38 ("video: uvesafb: use true,false for bool variables") Cc: Jason Yan Reviewed-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/81c9f140-d6fb-803a-18c8-04dae1007ab3@samsung.com commit 8a4f5e1185db61bce6ce3a5dce6381a77bcf94e6 Author: Tomi Valkeinen Date: Tue Jun 9 13:28:09 2020 +0300 drm/panel-simple: fix connector type for newhaven_nhd_43_480272ef_atxl Add connector type for newhaven_nhd_43_480272ef_atxl, as drm_panel_bridge_add() requires connector type to be set. Signed-off-by: Tomi Valkeinen Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200609102809.753203-1-tomi.valkeinen@ti.com commit efb94790852ae673b18efde1b171d284689ff333 Author: Adam Ford Date: Mon Jun 15 08:19:34 2020 -0500 drm/panel-simple: fix connector type for LogicPD Type28 Display The LogicPD Type28 display used by several Logic PD products has not worked since v5.6. The connector type for the LogicPD Type 28 display is missing and drm_panel_bridge_add() requires connector type to be set. Signed-off-by: Adam Ford Fixes: 0d35408afbeb ("drm/panel: simple: Add Logic PD Type 28 display support") Cc: Adam Ford Cc: Sam Ravnborg Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Cc: # v5.6+ Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200615131934.12440-1-aford173@gmail.com commit 67c20de35a3cc2e2cd940f95ebd85ed0a765315a Author: Rob Gill Date: Sat Jun 20 02:08:25 2020 +0000 net: Add MODULE_DESCRIPTION entries to network modules The user tool modinfo is used to get information on kernel modules, including a description where it is available. This patch adds a brief MODULE_DESCRIPTION to the following modules: 9p drop_monitor esp4_offload esp6_offload fou fou6 ila sch_fq sch_fq_codel sch_hhf Signed-off-by: Rob Gill Signed-off-by: David S. Miller commit 0041cd5a50442db6e456b145892a0eaf2dff061f Author: David Howells Date: Fri Jun 19 23:38:16 2020 +0100 rxrpc: Fix notification call on completion of discarded calls When preallocated service calls are being discarded, they're passed to ->discard_new_call() to have the caller clean up any attached higher-layer preallocated pieces before being marked completed. However, the act of marking them completed now invokes the call's notification function - which causes a problem because that function might assume that the previously freed pieces of memory are still there. Fix this by setting a dummy notification function on the socket after calling ->discard_new_call(). This results in the following kasan message when the kafs module is removed. ================================================================== BUG: KASAN: use-after-free in afs_wake_up_async_call+0x6aa/0x770 fs/afs/rxrpc.c:707 Write of size 1 at addr ffff8880946c39e4 by task kworker/u4:1/21 CPU: 0 PID: 21 Comm: kworker/u4:1 Not tainted 5.8.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x413 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 afs_wake_up_async_call+0x6aa/0x770 fs/afs/rxrpc.c:707 rxrpc_notify_socket+0x1db/0x5d0 net/rxrpc/recvmsg.c:40 __rxrpc_set_call_completion.part.0+0x172/0x410 net/rxrpc/recvmsg.c:76 __rxrpc_call_completed net/rxrpc/recvmsg.c:112 [inline] rxrpc_call_completed+0xca/0xf0 net/rxrpc/recvmsg.c:111 rxrpc_discard_prealloc+0x781/0xab0 net/rxrpc/call_accept.c:233 rxrpc_listen+0x147/0x360 net/rxrpc/af_rxrpc.c:245 afs_close_socket+0x95/0x320 fs/afs/rxrpc.c:110 afs_net_exit+0x1bc/0x310 fs/afs/main.c:155 ops_exit_list.isra.0+0xa8/0x150 net/core/net_namespace.c:186 cleanup_net+0x511/0xa50 net/core/net_namespace.c:603 process_one_work+0x965/0x1690 kernel/workqueue.c:2269 worker_thread+0x96/0xe10 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:291 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293 Allocated by task 6820: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc mm/kasan/common.c:494 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:467 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] afs_alloc_call+0x55/0x630 fs/afs/rxrpc.c:141 afs_charge_preallocation+0xe9/0x2d0 fs/afs/rxrpc.c:757 afs_open_socket+0x292/0x360 fs/afs/rxrpc.c:92 afs_net_init+0xa6c/0xe30 fs/afs/main.c:125 ops_init+0xaf/0x420 net/core/net_namespace.c:151 setup_net+0x2de/0x860 net/core/net_namespace.c:341 copy_net_ns+0x293/0x590 net/core/net_namespace.c:482 create_new_namespaces+0x3fb/0xb30 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:231 ksys_unshare+0x43d/0x8e0 kernel/fork.c:2983 __do_sys_unshare kernel/fork.c:3051 [inline] __se_sys_unshare kernel/fork.c:3049 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3049 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 21: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 afs_put_call+0x585/0xa40 fs/afs/rxrpc.c:190 rxrpc_discard_prealloc+0x764/0xab0 net/rxrpc/call_accept.c:230 rxrpc_listen+0x147/0x360 net/rxrpc/af_rxrpc.c:245 afs_close_socket+0x95/0x320 fs/afs/rxrpc.c:110 afs_net_exit+0x1bc/0x310 fs/afs/main.c:155 ops_exit_list.isra.0+0xa8/0x150 net/core/net_namespace.c:186 cleanup_net+0x511/0xa50 net/core/net_namespace.c:603 process_one_work+0x965/0x1690 kernel/workqueue.c:2269 worker_thread+0x96/0xe10 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:291 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293 The buggy address belongs to the object at ffff8880946c3800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 484 bytes inside of 1024-byte region [ffff8880946c3800, ffff8880946c3c00) The buggy address belongs to the page: page:ffffea000251b0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002546508 ffffea00024fa248 ffff8880aa000c40 raw: 0000000000000000 ffff8880946c3000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880946c3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880946c3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880946c3980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880946c3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880946c3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Reported-by: syzbot+d3eccef36ddbd02713e9@syzkaller.appspotmail.com Fixes: 5ac0d62226a0 ("rxrpc: Fix missing notification") Signed-off-by: David Howells Signed-off-by: David S. Miller commit 7fcaf73193e9d15f4d65d43aaf890fd3fbea1836 Merge: 54eeea0d707d e795a61a85e6 Author: David S. Miller Date: Sat Jun 20 21:30:23 2020 -0700 Merge tag 'ieee802154-for-davem-2020-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2020-06-19 An update from ieee802154 for your *net* tree. Just two small maintenance fixes to update references to the new project homepage. ==================== Signed-off-by: David S. Miller commit 64677779e8962c20b580b471790fe42367750599 Merge: a5c6a1f0fe1d b8f1d1e05817 Author: Linus Torvalds Date: Sat Jun 20 19:23:13 2020 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "One minor fix and two patches reworking the ata dma drain for the !CONFIG_LIBATA case. The latter is a 5.7 regression fix" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: Wire up ata_scsi_dma_need_drain for SAS HBA drivers scsi: libata: Provide an ata_scsi_dma_need_drain stub for !CONFIG_ATA scsi: ufs-bsg: Fix runtime PM imbalance on error commit a5c6a1f0fe1d182489864b708fa472d0333b39d4 Merge: 8b6ddd10d678 28f9f8fb4f40 Author: Linus Torvalds Date: Sat Jun 20 19:18:27 2020 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: - a small collection of remaining API conversion patches (all acked) which allow to finally remove the deprecated API - some documentation fixes and a MAINTAINERS addition * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: MAINTAINERS: Add robert and myself as qcom i2c cci maintainers i2c: smbus: Fix spelling mistake in the comments Documentation/i2c: SMBus start signal is S not A i2c: remove deprecated i2c_new_device API Documentation: media: convert to use i2c_new_client_device() video: backlight: tosa_lcd: convert to use i2c_new_client_device() x86/platform/intel-mid: convert to use i2c_new_client_device() drm: encoder_slave: use new I2C API drm: encoder_slave: fix refcouting error for modules commit 5f9af404eec82981c4345c9943be48422234e7ab Author: Daniel Gomez Date: Mon May 18 22:16:46 2020 +0200 drm: rcar-du: Fix build error Select DRM_KMS_HELPER dependency. Build error when DRM_KMS_HELPER is not selected: drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to `drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to `drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to `drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to `drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to `drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to `drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state' Fixes: c6a27fa41fab ("drm: rcar-du: Convert LVDS encoder code to bridge driver") Cc: Signed-off-by: Daniel Gomez Reviewed-by: Emil Velikov Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 54eeea0d707d4e6efb02f5a7896d6788472a2da4 Author: Hangbin Liu Date: Fri Jun 19 11:24:45 2020 +0800 tc-testing: update geneve options match in tunnel_key unit tests Since iproute2 commit f72c3ad00f3b ("tc: m_tunnel_key: add options support for vxlan"), the geneve opt output use key word "geneve_opts" instead of "geneve_opt". To make compatibility for both old and new iproute2, let's accept both "geneve_opt" and "geneve_opts". Suggested-by: Davide Caratti Signed-off-by: Hangbin Liu Reviewed-by: Simon Horman Tested-by: Davide Caratti Signed-off-by: David S. Miller commit 89fbd26cca7ec9e82ec4787a4b6e95939b57d073 Author: Heiner Kallweit Date: Thu Jun 18 23:25:50 2020 +0200 r8169: fix firmware not resetting tp->ocp_base Typically the firmware takes care that tp->ocp_base is reset to its default value. That's not the case (at least) for RTL8117. As a result subsequent PHY access reads/writes the wrong page and the link is broken. Fix this be resetting tp->ocp_base explicitly. Fixes: 229c1e0dfd3d ("r8169: load firmware for RTL8168fp/RTL8117") Reported-by: Aaron Ma Tested-by: Aaron Ma Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 8b40eb73509f5704a0e8cd25de0163876299f1a7 Author: Dany Madden Date: Thu Jun 18 15:24:13 2020 -0400 ibmvnic: continue to init in CRQ reset returns H_CLOSED Continue the reset path when partner adapter is not ready or H_CLOSED is returned from reset crq. This patch allows the CRQ init to proceed to establish a valid CRQ for traffic to flow after reset. Signed-off-by: Dany Madden Signed-off-by: David S. Miller commit b59eabd23ee53e8c3492602722e1697f9a2f63ad Author: Shannon Nelson Date: Thu Jun 18 10:29:04 2020 -0700 ionic: tame the watchdog timer on reconfig Even with moving netif_tx_disable() to an earlier point when taking down the queues for a reconfiguration, we still end up with the occasional netdev watchdog Tx Timeout complaint. The old method of using netif_trans_update() works fine for queue 0, but has no effect on the remaining queues. Using netif_device_detach() allows us to signal to the watchdog to ignore us for the moment. Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support") Signed-off-by: Shannon Nelson Acked-by: Jonathan Toppins Signed-off-by: David S. Miller commit 25fae752156db7253471347df08a2700501eafde Author: Drew Fustini Date: Fri Jun 12 13:27:58 2020 +0200 pinctrl: single: fix function name in documentation Use the correct the function name in the documentation for "pcs_parse_one_pinctrl_entry()". "smux_parse_one_pinctrl_entry()" appears to be an artifact from the development of a prior patch series ("simple pinmux driver") which transformed into pinctrl-single. Signed-off-by: Drew Fustini Link: https://lore.kernel.org/r/20200612112758.GA3407886@x1 Signed-off-by: Linus Walleij commit 8b6ddd10d678bebec32381f71b6b420bafc43ad0 Merge: eede2b9b3fe0 026bb845b0ff Author: Linus Torvalds Date: Sat Jun 20 13:17:47 2020 -0700 Merge tag 'trace-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: - Have recordmcount work with > 64K sections (to support LTO) - kprobe RCU fixes - Correct a kprobe critical section with missing mutex - Remove redundant arch_disarm_kprobe() call - Fix lockup when kretprobe triggers within kprobe_flush_task() - Fix memory leak in fetch_op_data operations - Fix sleep in atomic in ftrace trace array sample code - Free up memory on failure in sample trace array code - Fix incorrect reporting of function_graph fields in format file - Fix quote within quote parsing in bootconfig - Fix return value of bootconfig tool - Add testcases for bootconfig tool - Fix maybe uninitialized warning in ftrace pid file code - Remove unused variable in tracing_iter_reset() - Fix some typos * tag 'trace-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace: Fix maybe-uninitialized compiler warning tools/bootconfig: Add testcase for show-command and quotes test tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig tools/bootconfig: Fix to use correct quotes for value proc/bootconfig: Fix to use correct quotes for value tracing: Remove unused event variable in tracing_iter_reset tracing/probe: Fix memleak in fetch_op_data operations trace: Fix typo in allocate_ftrace_ops()'s comment tracing: Make ftrace packed events have align of 1 sample-trace-array: Remove trace_array 'sample-instance' sample-trace-array: Fix sleeping function called from invalid context kretprobe: Prevent triggering kretprobe from within kprobe_flush_task kprobes: Remove redundant arch_disarm_kprobe() call kprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex kprobes: Use non RCU traversal APIs on kprobe_tables if possible kprobes: Suppress the suspicious RCU warning on kprobes recordmcount: support >64k sections commit eede2b9b3fe01168940bb42ff3ab502ef5f6375c Merge: 1566feea450c 9df24eaef86f Author: Linus Torvalds Date: Sat Jun 20 13:13:21 2020 -0700 Merge tag 'libnvdimm-for-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "A feature (papr_scm health retrieval) and a fix (sysfs attribute visibility) for v5.8. Vaibhav explains in the merge commit below why missing v5.8 would be painful and I agreed to try a -rc2 pull because only cosmetics kept this out of -rc1 and his initial versions were posted in more than enough time for v5.8 consideration: 'These patches are tied to specific features that were committed to customers in upcoming distros releases (RHEL and SLES) whose time-lines are tied to 5.8 kernel release. Being able to track the health of an nvdimm is critical for our customers that are running workloads leveraging papr-scm nvdimms. Missing the 5.8 kernel would mean missing the distro timelines and shifting forward the availability of this feature in distro kernels by at least 6 months' Summary: - Fix the visibility of the region 'align' attribute. The new unit tests for region alignment handling caught a corner case where the alignment cannot be specified if the region is converted from static to dynamic provisioning at runtime. - Add support for device health retrieval for the persistent memory supported by the papr_scm driver. This includes both the standard sysfs "health flags" that the nfit persistent memory driver publishes and a mechanism for the ndctl tool to retrieve a health-command payload" * tag 'libnvdimm-for-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm/region: always show the 'align' attribute powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl() powerpc/papr_scm: Fetch nvdimm health information from PHYP seq_buf: Export seq_buf_printf powerpc: Document details on H_SCM_HEALTH hcall commit 7f5f4de83ca30a4922bb178b80144e2778faad01 Author: Sivaprakash Murugesan Date: Fri Jun 19 10:01:29 2020 +0530 pinctrl: qcom: ipq6018 Add missing pins in qpic pin group The patch adds missing qpic data pins to qpic pingroup. These pins are necessary for the qpic nand to work. Fixes: ef1ea54eab0e ("pinctrl: qcom: Add ipq6018 pinctrl driver") Signed-off-by: Sivaprakash Murugesan Link: https://lore.kernel.org/r/1592541089-17700-1-git-send-email-sivaprak@codeaurora.org Signed-off-by: Linus Walleij commit 13f2d25b951f139064ec2dd53c0c7ebdf8d8007e Author: Haibo Chen Date: Tue Jun 9 11:27:03 2020 +0800 Revert "pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'" This reverts commit ba403242615c2c99e27af7984b1650771a2cc2c9. After commit 26d8cde5260b ("pinctrl: freescale: imx: add shared input select reg support"). i.MX7D has two iomux controllers iomuxc and iomuxc-lpsr which share select_input register for daisy chain settings. If use 'devm_of_iomap()', when probe the iomuxc-lpsr, will call devm_request_mem_region() for the region <0x30330000-0x3033ffff> for the first time. Then, next time when probe the iomuxc, API devm_platform_ioremap_resource() will also use the API devm_request_mem_region() for the share region <0x30330000-0x3033ffff> again, then cause issue, log like below: [ 0.179561] imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver [ 0.191742] imx7d-pinctrl 30330000.pinctrl: can't request region for resource [mem 0x30330000-0x3033ffff] [ 0.191842] imx7d-pinctrl: probe of 30330000.pinctrl failed with error -16 Fixes: ba403242615c ("pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'") Signed-off-by: Haibo Chen Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/1591673223-1680-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Linus Walleij commit 1566feea450cb0ffcdb47daf723f62640c9f616a Merge: 7fdfbe08a2b3 b3583fca5fb6 Author: Linus Torvalds Date: Sat Jun 20 12:31:08 2020 -0700 Merge tag 's390-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - a few ptrace fixes mostly for strace and seccomp_bpf kernel tests findings - cleanup unused pm callbacks in virtio ccw - replace kmalloc + memset with kzalloc in crypto - use $(LD) for vDSO linkage to make clang happy - fix vDSO clock_getres() to preserve the same behaviour as posix_get_hrtimer_res() - fix workqueue cpumask warning when NUMA=n and nr_node_ids=2 - reduce SLSB writes during input processing, improve warnings and cleanup qdio_data usage in qdio - a few fixes to use scnprintf() instead of snprintf() * tag 's390-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: fix syscall_get_error for compat processes s390/qdio: warn about unexpected SLSB states s390/qdio: clean up usage of qdio_data s390/numa: let NODES_SHIFT depend on NEED_MULTIPLE_NODES s390/vdso: fix vDSO clock_getres() s390/vdso: Use $(LD) instead of $(CC) to link vDSO s390/protvirt: use scnprintf() instead of snprintf() s390: use scnprintf() in sys_##_prefix##_##_name##_show s390/crypto: use scnprintf() instead of snprintf() s390/zcrypt: use kzalloc s390/virtio: remove unused pm callbacks s390/qdio: reduce SLSB writes during Input Queue processing selftests/seccomp: s390 shares the syscall and return value register s390/ptrace: fix setting syscall number s390/ptrace: pass invalid syscall numbers to tracing s390/ptrace: return -ENOSYS when invalid syscall is supplied s390/seccomp: pass syscall arguments via seccomp_data s390/qdio: fine-tune SLSB update commit 7fdfbe08a2b3e2bf776e2f2b341768ba93c2e158 Merge: 27c2760561c0 0e2c09011d4d Author: Linus Torvalds Date: Sat Jun 20 12:14:29 2020 -0700 Merge tag 'riscv-for-linus-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - a workaround for a compiler surprise related to the "r" inline assembly that allows LLVM to boot. - a fix to avoid WX-only mappings, which the ISA does not allow. While this probably manifests in many ways, the bug was found in stress-ng. - a missing lock in set_direct_map_*(), which due to a recent lockdep change started asserting. * tag 'riscv-for-linus-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Acquire mmap lock before invoking walk_page_range RISC-V: Don't allow write+exec only page mapping request in mmap riscv/atomic: Fix sign extension for RV64I commit 27c2760561c0c68595b60a084c317b34e85e7c73 Merge: 5481fc6eb8a7 1b8eec510ba6 Author: Linus Torvalds Date: Sat Jun 20 12:10:09 2020 -0700 Merge tag 'linux-kselftest-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest cleanups from Shuah Khan: - ftrace "requires:" list for simplifying and unifying requirement checks for each test case, adding "requires:" line instead of checking required ftrace interfaces in each test case. - a minor spelling correction patch * tag 'linux-kselftest-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ftrace: Support ":README" suffix for requires selftests/ftrace: Support ":tracer" suffix for requires selftests/ftrace: Convert check_filter_file() with requires list selftests/ftrace: Convert required interface checks into requires list selftests/ftrace: Add "requires:" list support selftests/ftrace: Return unsupported for the unconfigured features selftests/ftrace: Allow ":" in description tools: testing: ftrace: trigger: fix spelling mistake commit 5481fc6eb8a7f4b76d8ad1be371d2e11b22bfb55 Author: David Howells Date: Fri Jun 19 23:39:36 2020 +0100 afs: Fix hang on rmmod due to outstanding timer The fileserver probe timer, net->fs_probe_timer, isn't cancelled when the kafs module is being removed and so the count it holds on net->servers_outstanding doesn't get dropped.. This causes rmmod to wait forever. The hung process shows a stack like: afs_purge_servers+0x1b5/0x23c [kafs] afs_net_exit+0x44/0x6e [kafs] ops_exit_list+0x72/0x93 unregister_pernet_operations+0x14c/0x1ba unregister_pernet_subsys+0x1d/0x2a afs_exit+0x29/0x6f [kafs] __do_sys_delete_module.isra.0+0x1a2/0x24b do_syscall_64+0x51/0x95 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fix this by: (1) Attempting to cancel the probe timer and, if successful, drop the count that the timer was holding. (2) Make the timer function just drop the count and not schedule the prober if the afs portion of net namespace is being destroyed. Also, whilst we're at it, make the following changes: (3) Initialise net->servers_outstanding to 1 and decrement it before waiting on it so that it doesn't generate wake up events by being decremented to 0 until we're cleaning up. (4) Switch the atomic_dec() on ->servers_outstanding for ->fs_timer in afs_purge_servers() to use the helper function for that. Fixes: f6cbb368bcb0 ("afs: Actively poll fileservers to maintain NAT or firewall openings") Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit f8ea5c7bceeb6ce6e7b3e7fb28c9dda8c0a58dcb Author: David Howells Date: Fri Jun 19 00:01:28 2020 +0100 afs: Fix afs_do_lookup() to call correct fetch-status op variant Fix afs_do_lookup()'s fallback case for when FS.InlineBulkStatus isn't supported by the server. In the fallback, it calls FS.FetchStatus for the specific vnode it's meant to be looking up. Commit b6489a49f7b7 broke this by renaming one of the two identically-named afs_fetch_status_operation descriptors to something else so that one of them could be made non-static. The site that used the renamed one, however, wasn't renamed and didn't produce any warning because the other was declared in a header. Fix this by making afs_do_lookup() use the renamed variant. Note that there are two variants of the success method because one is called from ->lookup() where we may or may not have an inode, but can't call iget until after we've talked to the server - whereas the other is called from within iget where we have an inode, but it may or may not be initialised. The latter variant expects there to be an inode, but because it's being called from there former case, there might not be - resulting in an oops like the following: BUG: kernel NULL pointer dereference, address: 00000000000000b0 ... RIP: 0010:afs_fetch_status_success+0x27/0x7e ... Call Trace: afs_wait_for_operation+0xda/0x234 afs_do_lookup+0x2fe/0x3c1 afs_lookup+0x3c5/0x4bd __lookup_slow+0xcd/0x10f walk_component+0xa2/0x10c path_lookupat.isra.0+0x80/0x110 filename_lookup+0x81/0x104 vfs_statx+0x76/0x109 __do_sys_newlstat+0x39/0x6b do_syscall_64+0x4c/0x78 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: b6489a49f7b7 ("afs: Fix silly rename") Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit c0e1c8c22bebecef40097c80c1c74492ff96d081 Author: Christophe Leroy Date: Mon Jun 15 12:57:59 2020 +0000 powerpc/8xx: Provide ptep_get() with 16k pages READ_ONCE() now enforces atomic read, which leads to: CC mm/gup.o In file included from ./include/linux/kernel.h:11:0, from mm/gup.c:2: In function 'gup_hugepte.constprop', inlined from 'gup_huge_pd.isra.79' at mm/gup.c:2465:8: ./include/linux/compiler.h:392:38: error: call to '__compiletime_assert_222' declared with attribute error: Unsupported access size for {READ,WRITE}_ONCE(). _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ ./include/linux/compiler.h:373:4: note: in definition of macro '__compiletime_assert' prefix ## suffix(); \ ^ ./include/linux/compiler.h:392:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ ./include/linux/compiler.h:405:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^ ./include/linux/compiler.h:291:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^ mm/gup.c:2428:8: note: in expansion of macro 'READ_ONCE' pte = READ_ONCE(*ptep); ^ In function 'gup_get_pte', inlined from 'gup_pte_range' at mm/gup.c:2228:9, inlined from 'gup_pmd_range' at mm/gup.c:2613:15, inlined from 'gup_pud_range' at mm/gup.c:2641:15, inlined from 'gup_p4d_range' at mm/gup.c:2666:15, inlined from 'gup_pgd_range' at mm/gup.c:2694:15, inlined from 'internal_get_user_pages_fast' at mm/gup.c:2795:3: ./include/linux/compiler.h:392:38: error: call to '__compiletime_assert_219' declared with attribute error: Unsupported access size for {READ,WRITE}_ONCE(). _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ ./include/linux/compiler.h:373:4: note: in definition of macro '__compiletime_assert' prefix ## suffix(); \ ^ ./include/linux/compiler.h:392:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ ./include/linux/compiler.h:405:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^ ./include/linux/compiler.h:291:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^ mm/gup.c:2199:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(*ptep); ^ make[2]: *** [mm/gup.o] Error 1 Define ptep_get() on 8xx when using 16k pages. Fixes: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Signed-off-by: Christophe Leroy Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/341688399c1b102756046d19ea6ce39db1ae4742.1592225558.git.christophe.leroy@csgroup.eu commit 481e980a7c199c5a4634fd7ea308067dd4ba75fa Author: Christophe Leroy Date: Mon Jun 15 12:57:58 2020 +0000 mm: Allow arches to provide ptep_get() Since commit 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") it is not possible anymore to use READ_ONCE() to access complex page table entries like the one defined for powerpc 8xx with 16k size pages. Define a ptep_get() helper that architectures can override instead of performing a READ_ONCE() on the page table entry pointer. Fixes: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Signed-off-by: Christophe Leroy Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/087fa12b6e920e32315136b998aa834f99242695.1592225558.git.christophe.leroy@csgroup.eu commit 55ca22633a9faa34c6a61d99433f9cc8e28dd7cc Author: Christophe Leroy Date: Mon Jun 15 12:57:57 2020 +0000 mm/gup: Use huge_ptep_get() in gup_hugepte() gup_hugepte() reads hugepage table entries, it can't read them directly, huge_ptep_get() must be used. Fixes: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Signed-off-by: Christophe Leroy Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ffc3714334c3bfaca6f13788ad039e8759ae413f.1592225558.git.christophe.leroy@csgroup.eu commit ca8826095e4d4afc0ccaead27bba6e4b623a12ae Author: Willem de Bruijn Date: Thu Jun 18 12:40:43 2020 -0400 selftests/net: report etf errors correctly The ETF qdisc can queue skbs that it could not pace on the errqueue. Address a few issues in the selftest - recv buffer size was too small, and incorrectly calculated - compared errno to ee_code instead of ee_errno - missed invalid request error type v2: - fix a few checkpatch --strict indentation warnings Fixes: ea6a547669b3 ("selftests/net: make so_txtime more robust to timer variance") Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 5948378b26d89f8aa5eac37629dbd0616ce8d7a7 Author: Thomas Falcon Date: Thu Jun 18 10:43:46 2020 -0500 ibmveth: Fix max MTU limit The max MTU limit defined for ibmveth is not accounting for virtual ethernet buffer overhead, which is twenty-two additional bytes set aside for the ethernet header and eight additional bytes of an opaque handle reserved for use by the hypervisor. Update the max MTU to reflect this overhead. Fixes: d894be57ca92 ("ethernet: use net core MTU range checking in more drivers") Fixes: 110447f8269a ("ethernet: fix min/max MTU typos") Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit 95dcd89275bc54f59a16757c9712c0f981b413e2 Merge: 56c09de347e4 3c005110d408 Author: David S. Miller Date: Fri Jun 19 20:12:59 2020 -0700 Merge branch 'several-fixes-for-indirect-flow_blocks-offload' wenxu says: ==================== several fixes for indirect flow_blocks offload v2: patch2: store the cb_priv of representor to the flow_block_cb->indr.cb_priv in the driver. And make the correct check with the statments this->indr.cb_priv == cb_priv patch4: del the driver list only in the indriect cleanup callbacks v3: add the cover letter and changlogs. v4: collapsed 1/4, 2/4, 4/4 in v3 to one fix Add the prepare patch 1 and 2 v5: patch1: place flow_indr_block_cb_alloc() right before flow_indr_dev_setup_offload() to avoid moving flow_block_indr_init() This series fixes commit 1fac52da5942 ("net: flow_offload: consolidate indirect flow_block infrastructure") that revists the flow_block infrastructure. patch #1 #2: prepare for fix patch #3 add and use flow_indr_block_cb_alloc/remove function patch #3: fix flow_indr_dev_unregister path If the representor is removed, then identify the indirect flow_blocks that need to be removed by the release callback and the port representor structure. To identify the port representor structure, a new indr.cb_priv field needs to be introduced. The flow_block also needs to be removed from the driver list from the cleanup path patch#4 fix block->nooffloaddevcnt warning dmesg log. When a indr device add in offload success. The block->nooffloaddevcnt should be 0. After the representor go away. When the dir device go away the flow_block UNBIND operation with -EOPNOTSUPP which lead the warning demesg log. The block->nooffloaddevcnt should always count for indr block. even the indr block offload successful. The representor maybe gone away and the ingress qdisc can work in software mode. ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 3c005110d4083c52ff6c99018127adf92f3f23aa Author: wenxu Date: Thu Jun 18 20:49:11 2020 +0800 net/sched: cls_api: fix nooffloaddevcnt warning dmesg log The block->nooffloaddevcnt should always count for indr block. even the indr block offload successful. The representor maybe gone away and the ingress qdisc can work in software mode. block->nooffloaddevcnt warning with following dmesg log: [ 760.667058] ##################################################### [ 760.668186] ## TEST test-ecmp-add-vxlan-encap-disable-sriov.sh ## [ 760.669179] ##################################################### [ 761.780655] :test: Fedora 30 (Thirty) [ 761.783794] :test: Linux reg-r-vrt-018-180 5.7.0+ [ 761.822890] :test: NIC ens1f0 FW 16.26.6000 PCI 0000:81:00.0 DEVICE 0x1019 ConnectX-5 Ex [ 761.860244] mlx5_core 0000:81:00.0 ens1f0: Link up [ 761.880693] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f0: link becomes ready [ 762.059732] mlx5_core 0000:81:00.1 ens1f1: Link up [ 762.234341] :test: unbind vfs of ens1f0 [ 762.257825] :test: Change ens1f0 eswitch (0000:81:00.0) mode to switchdev [ 762.291363] :test: unbind vfs of ens1f1 [ 762.306914] :test: Change ens1f1 eswitch (0000:81:00.1) mode to switchdev [ 762.309237] mlx5_core 0000:81:00.1: E-Switch: Disable: mode(LEGACY), nvfs(2), active vports(3) [ 763.282598] mlx5_core 0000:81:00.1: E-Switch: Supported tc offload range - chains: 4294967294, prios: 4294967295 [ 763.362825] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0) [ 763.444465] mlx5_core 0000:81:00.1 ens1f1: renamed from eth0 [ 763.460088] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0) [ 763.502586] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0) [ 763.552429] ens1f1_0: renamed from eth0 [ 763.569569] mlx5_core 0000:81:00.1: E-Switch: Enable: mode(OFFLOADS), nvfs(2), active vports(3) [ 763.629694] ens1f1_1: renamed from eth1 [ 764.631552] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f1_0: link becomes ready [ 764.670841] :test: unbind vfs of ens1f0 [ 764.681966] :test: unbind vfs of ens1f1 [ 764.726762] mlx5_core 0000:81:00.0 ens1f0: Link up [ 764.766511] mlx5_core 0000:81:00.1 ens1f1: Link up [ 764.797325] :test: Add multipath vxlan encap rule and disable sriov [ 764.798544] :test: config multipath route [ 764.812732] mlx5_core 0000:81:00.0: lag map port 1:2 port 2:2 [ 764.874556] mlx5_core 0000:81:00.0: modify lag map port 1:1 port 2:2 [ 765.603681] :test: OK [ 765.659048] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f1_1: link becomes ready [ 765.675085] :test: verify rule in hw [ 765.694237] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f0: link becomes ready [ 765.711892] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f1: link becomes ready [ 766.979230] :test: OK [ 768.125419] :test: OK [ 768.127519] :test: - disable sriov ens1f1 [ 768.131160] pci 0000:81:02.2: Removing from iommu group 75 [ 768.132646] pci 0000:81:02.3: Removing from iommu group 76 [ 769.179749] mlx5_core 0000:81:00.1: E-Switch: Disable: mode(OFFLOADS), nvfs(2), active vports(3) [ 769.455627] mlx5_core 0000:81:00.0: modify lag map port 1:1 port 2:1 [ 769.703990] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0) [ 769.988637] mlx5_core 0000:81:00.1 ens1f1: renamed from eth0 [ 769.990022] :test: - disable sriov ens1f0 [ 769.994922] pci 0000:81:00.2: Removing from iommu group 73 [ 769.997048] pci 0000:81:00.3: Removing from iommu group 74 [ 771.035813] mlx5_core 0000:81:00.0: E-Switch: Disable: mode(OFFLOADS), nvfs(2), active vports(3) [ 771.339091] ------------[ cut here ]------------ [ 771.340812] WARNING: CPU: 6 PID: 3448 at net/sched/cls_api.c:749 tcf_block_offload_unbind.isra.0+0x5c/0x60 [ 771.341728] Modules linked in: act_mirred act_tunnel_key cls_flower dummy vxlan ip6_udp_tunnel udp_tunnel sch_ingress nfsv3 nfs_acl nfs lockd grace fscache tun bridge stp llc sunrpc rdma_ucm rdma_cm iw_cm ib_cm mlx5_ib ib_uverbs ib_core mlx5_core intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp mlxfw act_ct nf_flow_table kvm_intel nf_nat kvm nf_conntrack irqbypass crct10dif_pclmul igb crc32_pclmul nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 crc32c_intel ghash_clmulni_intel ptp ipmi_ssif intel_cstate pps_c ore ses intel_uncore mei_me iTCO_wdt joydev ipmi_si iTCO_vendor_support i2c_i801 enclosure mei ioatdma dca lpc_ich wmi ipmi_devintf pcspkr acpi_power_meter ipmi_msghandler acpi_pad ast i2c_algo_bit drm_vram_helper drm_kms_helper drm_ttm_helper ttm drm mpt3sas raid_class scsi_transport_sas [ 771.347818] CPU: 6 PID: 3448 Comm: test-ecmp-add-v Not tainted 5.7.0+ #1146 [ 771.348727] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017 [ 771.349646] RIP: 0010:tcf_block_offload_unbind.isra.0+0x5c/0x60 [ 771.350553] Code: 4a fd ff ff 83 f8 a1 74 0e 5b 4c 89 e7 5d 41 5c 41 5d e9 07 93 89 ff 8b 83 a0 00 00 00 8d 50 ff 89 93 a0 00 00 00 85 c0 75 df <0f> 0b eb db 0f 1f 44 00 00 41 57 41 56 41 55 41 89 cd 41 54 49 89 [ 771.352420] RSP: 0018:ffffb33144cd3b00 EFLAGS: 00010246 [ 771.353353] RAX: 0000000000000000 RBX: ffff8b37cf4b2800 RCX: 0000000000000000 [ 771.354294] RDX: 00000000ffffffff RSI: ffff8b3b9aad0000 RDI: ffffffff8d5c6e20 [ 771.355245] RBP: ffff8b37eb546948 R08: ffffffffc0b7a348 R09: ffff8b3b9aad0000 [ 771.356189] R10: 0000000000000001 R11: ffff8b3ba7a0a1c0 R12: ffff8b37cf4b2850 [ 771.357123] R13: ffff8b3b9aad0000 R14: ffff8b37cf4b2820 R15: ffff8b37cf4b2820 [ 771.358039] FS: 00007f8a19b6e740(0000) GS:ffff8b3befa00000(0000) knlGS:0000000000000000 [ 771.358965] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 771.359885] CR2: 00007f3afb91c1a0 CR3: 000000045133c004 CR4: 00000000001606e0 [ 771.360825] Call Trace: [ 771.361764] __tcf_block_put+0x84/0x150 [ 771.362712] ingress_destroy+0x1b/0x20 [sch_ingress] [ 771.363658] qdisc_destroy+0x3e/0xc0 [ 771.364594] dev_shutdown+0x7a/0xa5 [ 771.365522] rollback_registered_many+0x20d/0x530 [ 771.366458] ? netdev_upper_dev_unlink+0x15d/0x1c0 [ 771.367387] unregister_netdevice_many.part.0+0xf/0x70 [ 771.368310] vxlan_netdevice_event+0xa4/0x110 [vxlan] [ 771.369454] notifier_call_chain+0x4c/0x70 [ 771.370579] rollback_registered_many+0x2f5/0x530 [ 771.371719] rollback_registered+0x56/0x90 [ 771.372843] unregister_netdevice_queue+0x73/0xb0 [ 771.373982] unregister_netdev+0x18/0x20 [ 771.375168] mlx5e_vport_rep_unload+0x56/0xc0 [mlx5_core] [ 771.376327] esw_offloads_disable+0x81/0x90 [mlx5_core] [ 771.377512] mlx5_eswitch_disable_locked.cold+0xcb/0x1af [mlx5_core] [ 771.378679] mlx5_eswitch_disable+0x44/0x60 [mlx5_core] [ 771.379822] mlx5_device_disable_sriov+0xad/0xb0 [mlx5_core] [ 771.380968] mlx5_core_sriov_configure+0xc1/0xe0 [mlx5_core] [ 771.382087] sriov_numvfs_store+0xfc/0x130 [ 771.383195] kernfs_fop_write+0xce/0x1b0 [ 771.384302] vfs_write+0xb6/0x1a0 [ 771.385410] ksys_write+0x5f/0xe0 [ 771.386500] do_syscall_64+0x5b/0x1d0 [ 771.387569] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 0fdcf78d5973 ("net: use flow_indr_dev_setup_offload()") Signed-off-by: wenxu Signed-off-by: David S. Miller commit a1db217861f33b8d9ea8171bcacee51186e2d5ba Author: wenxu Date: Thu Jun 18 20:49:10 2020 +0800 net: flow_offload: fix flow_indr_dev_unregister path If the representor is removed, then identify the indirect flow_blocks that need to be removed by the release callback and the port representor structure. To identify the port representor structure, a new indr.cb_priv field needs to be introduced. The flow_block also needs to be removed from the driver list from the cleanup path. Fixes: 1fac52da5942 ("net: flow_offload: consolidate indirect flow_block infrastructure") Signed-off-by: wenxu Signed-off-by: David S. Miller commit 66f1939a1b705305df820d65f4d9a8457d05759c Author: wenxu Date: Thu Jun 18 20:49:09 2020 +0800 flow_offload: use flow_indr_block_cb_alloc/remove function Prepare fix the bug in the next patch. use flow_indr_block_cb_alloc/remove function and remove the __flow_block_indr_binding. Signed-off-by: wenxu Signed-off-by: David S. Miller commit 26f2eb27d081081dbea6d3c11602c9ece36f4d9c Author: wenxu Date: Thu Jun 18 20:49:08 2020 +0800 flow_offload: add flow_indr_block_cb_alloc/remove function Add flow_indr_block_cb_alloc/remove function for next fix patch. Signed-off-by: wenxu Signed-off-by: David S. Miller commit 56c09de347e40804fc8dad155272fb9609e0a97b Author: Sabrina Dubroca Date: Thu Jun 18 12:13:22 2020 +0200 geneve: allow changing DF behavior after creation Currently, trying to change the DF parameter of a geneve device does nothing: # ip -d link show geneve1 14: geneve1: link/ether geneve id 1 remote 10.0.0.1 ttl auto df set dstport 6081 # ip link set geneve1 type geneve id 1 df unset # ip -d link show geneve1 14: geneve1: link/ether geneve id 1 remote 10.0.0.1 ttl auto df set dstport 6081 We just need to update the value in geneve_changelink. Fixes: a025fb5f49ad ("geneve: Allow configuration of DF behaviour") Signed-off-by: Sabrina Dubroca Reviewed-by: Stefano Brivio Signed-off-by: David S. Miller commit 9deba33f1b7266a3870c9da31f787b605748fc0c Author: Claudiu Manoil Date: Thu Jun 18 12:16:52 2020 +0300 enetc: Fix HW_VLAN_CTAG_TX|RX toggling VLAN tag insertion/extraction offload is correctly activated at probe time but deactivation of this feature (i.e. via ethtool) is broken. Toggling works only for Tx/Rx ring 0 of a PF, and is ignored for the other rings, including the VF rings. To fix this, the existing VLAN offload toggling code was extended to all the rings assigned to a netdevice, instead of the default ring 0 (likely a leftover from the early validation days of this feature). And the code was moved to the common set_features() function to fix toggling for the VF driver too. Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller commit faa620876b01d6744f1599e279042bb8149247ab Author: Claudiu Beznea Date: Thu Jun 18 11:37:40 2020 +0300 net: macb: undo operations in case of failure Undo previously done operation in case macb_phylink_connect() fails. Since macb_reset_hw() is the 1st undo operation the napi_exit label was renamed to reset_hw. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre Signed-off-by: David S. Miller commit 2996cbd532a0d282dd3177d68a725f726a67f21c Merge: cc26c9f5ace2 02c28dffb13a Author: David S. Miller Date: Fri Jun 19 19:57:22 2020 -0700 Merge tag 'rxrpc-fixes-20200618' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs David Howells says: ==================== rxrpc: Performance drop fix and other fixes Here are three fixes for rxrpc: (1) Fix a trace symbol mapping. It doesn't seem to let you map to "". (2) Fix the handling of the remote receive window size when it increases beyond the size we can support for our transmit window. (3) Fix a performance drop caused by retransmitted packets being accidentally marked as already ACK'd. ==================== Signed-off-by: David S. Miller commit 9df24eaef86f5d5cb38c77eaa1cfa3eec09ebfe8 Merge: 543094e19c82 d35f18b554be Author: Dan Williams Date: Fri Jun 19 14:18:51 2020 -0700 Merge branch 'for-5.8/papr_scm' into libnvdimm-for-next Include the papr_scm health retrieval feature for v5.8-rc2. The functionality was initially posted well in advance of the merge window, but review comments and a late build-bot warning kept them out of the v5.8-rc1 libnvdimm pull request. Vaibhav notes: These patches are tied to specific features that were committed to customers in upcoming distros releases (RHEL and SLES) whose time-lines are tied to 5.8 kernel release. Being able to track the health of an nvdimm is critical for our customers that are running workloads leveraging papr-scm nvdimms. Missing the 5.8 kernel would mean missing the distro timelines and shifting forward the availability of this feature in distro kernels by at least 6 months. commit cc26c9f5ace29d00ccedd79ffa1ee90b2439fe55 Merge: 6564cfefb01c b2ffc75e2e99 Author: David S. Miller Date: Fri Jun 19 13:39:01 2020 -0700 Merge branch 'net-phy-MDIO-bus-scanning-fixes' Florian Fainelli says: ==================== net: phy: MDIO bus scanning fixes This patch series fixes two problems with the current MDIO bus scanning logic which was identified while moving from 4.9 to 5.4 on devices that do rely on scanning the MDIO bus at runtime because they use pluggable cards. Changes in v2: - added comment explaining the special value of -ENODEV - added Andrew's Reviewed-by tag ==================== Signed-off-by: David S. Miller commit b2ffc75e2e990b09903f9d15ccd53bc5f3a4217c Author: Florian Fainelli Date: Fri Jun 19 11:47:47 2020 -0700 net: phy: Check harder for errors in get_phy_id() Commit 02a6efcab675 ("net: phy: allow scanning busses with missing phys") added a special condition to return -ENODEV in case -ENODEV or -EIO was returned from the first read of the MII_PHYSID1 register. In case the MDIO bus data line pull-up is not strong enough, the MDIO bus controller will not flag this as a read error. This can happen when a pluggable daughter card is not connected and weak internal pull-ups are used (since that is the only option, otherwise the pins are floating). The second read of MII_PHYSID2 will be correctly flagged an error though, but now we will return -EIO which will be treated as a hard error, thus preventing MDIO bus scanning loops to continue succesfully. Apply the same logic to both register reads, thus allowing the scanning logic to proceed. Fixes: 02a6efcab675 ("net: phy: allow scanning busses with missing phys") Reviewed-by: Andrew Lunn Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 5a8d7f126c97d04d893f5e5be2b286437a0d01b0 Author: Florian Fainelli Date: Fri Jun 19 11:47:46 2020 -0700 of: of_mdio: Correct loop scanning logic Commit 209c65b61d94 ("drivers/of/of_mdio.c:fix of_mdiobus_register()") introduced a break of the loop on the premise that a successful registration should exit the loop. The premise is correct but not to code, because rc && rc != -ENODEV is just a special error condition, that means we would exit the loop even with rc == -ENODEV which is absolutely not correct since this is the error code to indicate to the MDIO bus layer that scanning should continue. Fix this by explicitly checking for rc = 0 as the only valid condition to break out of the loop. Fixes: 209c65b61d94 ("drivers/of/of_mdio.c:fix of_mdiobus_register()") Reviewed-by: Andrew Lunn Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 4333a9b0b67bb4e8bcd91bdd80da80b0ec151162 Merge: d2b1c81f5f6c 6f2cc1664db2 Author: Linus Torvalds Date: Fri Jun 19 13:16:58 2020 -0700 Merge tag 'io_uring-5.8-2020-06-19' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Catch a case where io_sq_thread() didn't do proper mm acquire - Ensure poll completions are reaped on shutdown - Async cancelation and run fixes (Pavel) - io-poll race fixes (Xiaoguang) - Request cleanup race fix (Xiaoguang) * tag 'io_uring-5.8-2020-06-19' of git://git.kernel.dk/linux-block: io_uring: fix possible race condition against REQ_F_NEED_CLEANUP io_uring: reap poll completions while waiting for refs to drop on exit io_uring: acquire 'mm' for task_work for SQPOLL io_uring: add memory barrier to synchronize io_kiocb's result and iopoll_completed io_uring: don't fail links for EAGAIN error in IOPOLL mode io_uring: cancel by ->task not pid io_uring: lazy get task io_uring: batch cancel in io_uring_cancel_files() io_uring: cancel all task's requests on exit io-wq: add an option to cancel all matched reqs io-wq: reorder cancellation pending -> running io_uring: fix lazy work init commit d2b1c81f5f6c3427bd900be5fed306ca83d649d4 Merge: 592be758f196 3373a3461aa1 Author: Linus Torvalds Date: Fri Jun 19 13:11:26 2020 -0700 Merge tag 'block-5.8-2020-06-19' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Use import_uuid() where appropriate (Andy) - bcache fixes (Coly, Mauricio, Zhiqiang) - blktrace sparse warnings fix (Jan) - blktrace concurrent setup fix (Luis) - blkdev_get use-after-free fix (Jason) - Ensure all blk-mq maps are updated (Weiping) - Loop invalidate bdev fix (Zheng) * tag 'block-5.8-2020-06-19' of git://git.kernel.dk/linux-block: block: make function 'kill_bdev' static loop: replace kill_bdev with invalidate_bdev partitions/ldm: Replace uuid_copy() with import_uuid() where it makes sense block: update hctx map when use multiple maps blktrace: Avoid sparse warnings when assigning q->blk_trace blktrace: break out of blktrace setup on concurrent calls block: Fix use-after-free in blkdev_get() trace/events/block.h: drop kernel-doc for dropped function parameter blk-mq: Remove redundant 'return' statement bcache: pr_info() format clean up in bcache_device_init() bcache: use delayed kworker fo asynchronous devices registration bcache: check and adjust logical block size for backing devices bcache: fix potential deadlock problem in btree_gc_coalesce commit 592be758f196ed4610e326fc3f33dadd80aa7c6b Merge: 62c91ead977a b5292111de9b Author: Linus Torvalds Date: Fri Jun 19 13:09:40 2020 -0700 Merge tag 'libata-5.8-2020-06-19' of git://git.kernel.dk/linux-block Pull libata fixes from Jens Axboe: "A few minor changes that should go into this release" * tag 'libata-5.8-2020-06-19' of git://git.kernel.dk/linux-block: libata: Use per port sync for detach ata/libata: Fix usage of page address by page_address in ata_scsi_mode_select_xlat function sata_rcar: handle pm_runtime_get_sync failure cases commit 6564cfefb01c4c5b8c357f300feac5cb1585e1a9 Author: Flavio Suligoi Date: Fri Jun 19 11:18:11 2020 +0200 net: ethernet: oki-semi: pch_gbe: fix spelling mistake Fix typo: "Triger" --> "Trigger" Signed-off-by: Flavio Suligoi Signed-off-by: David S. Miller commit e795a61a85e65b4f12c2ed3529911ac0f013fa40 Author: Stefan Schmidt Date: Tue Jun 16 08:49:10 2020 +0200 MAINTAINERS: update ieee802154 project website URL Update URL to our new home. Signed-off-by: Stefan Schmidt commit e2c0b9712452296cb50a9faf07cc688862238f24 Author: Stefan Schmidt Date: Tue Jun 16 08:47:32 2020 +0200 docs: net: ieee802154: change link to new project URL We finally came around to setup a new project website. Update the reference here. Signed-off-by: Stefan Schmidt commit 24f5aa53afbf72ffd7d2587cd2edd44342e0270f Author: Flavio Suligoi Date: Fri Jun 19 11:02:04 2020 +0200 net: ethernet: neterion: vxge: fix spelling mistake Fix typo: "trigered" --> "triggered" Signed-off-by: Flavio Suligoi Signed-off-by: David S. Miller commit 0e5f9d50ad969480ae3331f3802250e39327fb50 Merge: 7b075ad9f496 be01369859b8 Author: David S. Miller Date: Fri Jun 19 13:03:47 2020 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2020-06-19 1) Fix double ESP trailer insertion in IPsec crypto offload if netif_xmit_frozen_or_stopped is true. From Huy Nguyen. 2) Merge fixup for "remove output_finish indirection from xfrm_state_afinfo". From Stephen Rothwell. 3) Select CRYPTO_SEQIV for ESP as this is needed for GCM and several other encryption algorithms. Also modernize the crypto algorithm selections for ESP and AH, remove those that are maked as "MUST NOT" and add those that are marked as "MUST" be implemented in RFC 8221. From Eric Biggers. Please note the merge conflict between commit: a7f7f6248d97 ("treewide: replace '---help---' in Kconfig files with 'help'") from Linus' tree and commits: 7d4e39195925 ("esp, ah: consolidate the crypto algorithm selections") be01369859b8 ("esp, ah: modernize the crypto algorithm selections") from the ipsec tree. ==================== Signed-off-by: David S. Miller commit 7b075ad9f496d18f45c8835cef2ae058eb6f8371 Merge: 0ad6f6e767ec 3995ecbabc6f Author: David S. Miller Date: Fri Jun 19 12:55:12 2020 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2020-06-18 This series contains fixes to ixgbe, i40e and ice driver. Ciara fixes up the ixgbe, i40e and ice drivers to protect access when allocating and freeing the rings. In addition, made use of READ_ONCE when reading the rings prior to accessing the statistics pointer. Björn fixes a crash where the receive descriptor ring allocation was moved to a different function, which broke the ethtool set_ringparam() hook. ==================== Signed-off-by: David S. Miller commit 62c91ead977a5d5023be3d791cbff8535f7d5433 Merge: 672f9255a727 8a7a3d1d0dcf Author: Linus Torvalds Date: Fri Jun 19 12:40:57 2020 -0700 Merge tag 'drm-fixes-2020-06-19' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Just i915 and amd here. i915 has some workaround movement so they get applied at the right times, and a timeslicing fix, along with some display fixes. AMD has a few display floating point fix and a devcgroup fix for amdkfd. i915: - Fix for timeslicing and virtual engines/unpremptable requests (+ 1 dependency patch) - Fixes into TypeC register programming and interrupt storm detecting - Disable DIP on MST ports with the transcoder clock still on - Avoid missing GT workarounds at reset for HSW and older gens - Fix for unwinding multiple requests missing force restore - Fix encoder type check for DDI vswing sequence - Build warning fixes amdgpu: - Fix kvfree/kfree mixup - Fix hawaii device id in powertune configuration - Display FP fixes - Documentation fixes amdkfd: - devcgroup check fix" * tag 'drm-fixes-2020-06-19' of git://anongit.freedesktop.org/drm/drm: (23 commits) drm/amdgpu: fix documentation around busy_percentage drm/amdgpu/pm: update comment to clarify Overdrive interfaces drm/amdkfd: Use correct major in devcgroup check drm/i915/display: Fix the encoder type check drm/i915/icl+: Fix hotplug interrupt disabling after storm detection drm/i915/gt: Move gen4 GT workarounds from init_clock_gating to workarounds drm/i915/gt: Move ilk GT workarounds from init_clock_gating to workarounds drm/i915/gt: Move snb GT workarounds from init_clock_gating to workarounds drm/i915/gt: Move vlv GT workarounds from init_clock_gating to workarounds drm/i915/gt: Move ivb GT workarounds from init_clock_gating to workarounds drm/i915/gt: Move hsw GT workarounds from init_clock_gating to workarounds drm/i915/icl: Disable DIP on MST ports with the transcoder clock still on drm/i915/gt: Incrementally check for rewinding drm/i915/tc: fix the reset of ln0 drm/i915/gt: Prevent timeslicing into unpreemptable requests drm/i915/selftests: Restore to default heartbeat drm/i915: work around false-positive maybe-uninitialized warning drm/i915/pmu: avoid an maybe-uninitialized warning drm/i915/gt: Incorporate the virtual engine into timeslicing drm/amd/display: Rework dsc to isolate FPU operations ... commit 672f9255a727d04c98b05ba7af625ab7032c8028 Merge: 84bc1993e28b 7ed286f3e061 Author: Linus Torvalds Date: Fri Jun 19 12:25:04 2020 -0700 Merge tag 'ceph-for-5.8-rc2' of git://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "An important follow-up for replica reads support that went into -rc1 and two target_copy() fixups" * tag 'ceph-for-5.8-rc2' of git://github.com/ceph/ceph-client: libceph: don't omit used_replica in target_copy() libceph: don't omit recovery_deletes in target_copy() libceph: move away from global osd_req_flags commit 84bc1993e28b2d3cf6110bab0b625e8119825403 Merge: 98b769942c69 24ebec25fb27 Author: Linus Torvalds Date: Fri Jun 19 12:19:12 2020 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "Unfortunately, we still have a number of outstanding issues so there will be more fixes to come, but this lot are a good start. - Fix handling of watchpoints triggered by uaccess routines - Fix initialisation of gigantic pages for CMA buffers - Raise minimum clang version for BTI to avoid miscompilation - Fix data race in SVE vector length configuration code - Ensure address tags are ignored in kern_addr_valid() - Dump register state on fatal BTI exception - kexec_file() cleanup to use struct_size() macro" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints arm64: kexec_file: Use struct_size() in kmalloc() arm64: mm: reserve hugetlb CMA after numa_init arm64: bti: Require clang >= 10.0.1 for in-kernel BTI support arm64: sve: Fix build failure when ARM64_SVE=y and SYSCTL=n arm64: pgtable: Clear the GP bit for non-executable kernel pages arm64: mm: reset address tag set by kasan sw tagging arm64: traps: Dump registers prior to panic() in bad_mode() arm64/sve: Eliminate data races on sve_default_vl docs/arm64: Fix typo'd #define in sve.rst arm64: remove TEXT_OFFSET randomization commit 98b769942c698e43117334332ebfed852dfa6ff9 Merge: 98d7e741a0a3 b19d57d0f3cc Author: Linus Torvalds Date: Fri Jun 19 11:45:03 2020 -0700 Merge tag 'overflow-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull flex-array size helper from Kees Cook: "During the treewide clean-ups of zero-length "flexible arrays", the struct_size() helper was heavily used, but it was noticed that many times it would have been nice to have an additional helper to get the size of just the flexible array itself. This need appears to be even more common when cleaning up the 1-byte array "flexible arrays", so Gustavo implemented it. I'd love to get this landed early so it can be used during the v5.9 dev cycle to ease the 1-byte array cleanups." * tag 'overflow-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: overflow.h: Add flex_array_size() helper commit 98d7e741a0a37fff24f99e4b6c5a1bd1e50cd47a Merge: 5e857ce6eae7 6a1515c962b1 Author: Linus Torvalds Date: Fri Jun 19 11:39:57 2020 -0700 Merge tag 'perf-tools-fixes-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tooling fixes from Arnaldo Carvalho de Melo: - Update various UAPI headers, some automatically adding support for a new MSR and the faccess2 syscall. - Fix corner case NULL deref in the histograms code. - Fix corner case NULL deref in 'perf stat' aggregation code. - Fix array pointer deref and old style declaration in the parsing of events. - Fix segfault when processing ZSTD compressed perf.data files in 'perf script' due to lack of initialization of the ZSTD library. - Handle __attribute__((user)) in libtraceevent fixing the parsing of syscall tracepoints with user buffers. - Make libtraevent aware of __builtin_expect() appearing in tracepoint fields. - Make the BPF prologue generation use bpf_probe_read_{user,kernel}(). - Fix the '@user' attribute parsing in kprobes variables in 'perf probe'. - Fix error message when asking for -fsanitize=address without required libraries. * tag 'perf-tools-fixes-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (22 commits) perf build: Fix error message when asking for -fsanitize=address without required libraries tools lib traceevent: Add handler for __builtin_expect() tools lib traceevent: Handle __attribute__((user)) in field names tools lib traceevent: Add append() function helper for appending strings tools headers UAPI: Sync linux/fs.h with the kernel sources tools include UAPI: Sync linux/vhost.h with the kernel sources tools arch x86: Sync the msr-index.h copy with the kernel sources perf script: Initialize zstd_data perf pmu: Remove unused declaration perf parse-events: Fix an old style declaration perf parse-events: Fix an incompatible pointer perf bpf: Fix bpf prologue generation perf probe: Fix user attribute access in kprobes perf stat: Fix NULL pointer dereference perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events() tools headers UAPI: Sync kvm.h headers with the kernel sources tools headers UAPI: Sync drm/i915_drm.h with the kernel sources tools headers UAPI: Sync linux/fscrypt.h with the kernel sources perf beauty: Add support to STATX_MNT_ID in the 'statx' syscall 'mask' argument tools headers uapi: Sync linux/stat.h with the kernel sources ... commit d35bd764e6899a7bea71958f08d16cea5bfa1919 Author: Mikulas Patocka Date: Fri Jun 19 11:51:34 2020 -0400 dm writecache: add cond_resched to loop in persistent_memory_claim() Add cond_resched() to a loop that fills in the mapper memory area because the loop can be executed many times. Fixes: 48debafe4f2fe ("dm: add writecache target") Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit bb5570ad3b54e7930997aec76ab68256d5236d94 Author: Matt Fleming Date: Thu Jun 18 11:20:02 2020 +0100 x86/asm/64: Align start of __clear_user() loop to 16-bytes x86 CPUs can suffer severe performance drops if a tight loop, such as the ones in __clear_user(), straddles a 16-byte instruction fetch window, or worse, a 64-byte cacheline. This issues was discovered in the SUSE kernel with the following commit, 1153933703d9 ("x86/asm/64: Micro-optimize __clear_user() - Use immediate constants") which increased the code object size from 10 bytes to 15 bytes and caused the 8-byte copy loop in __clear_user() to be split across a 64-byte cacheline. Aligning the start of the loop to 16-bytes makes this fit neatly inside a single instruction fetch window again and restores the performance of __clear_user() which is used heavily when reading from /dev/zero. Here are some numbers from running libmicro's read_z* and pread_z* microbenchmarks which read from /dev/zero: Zen 1 (Naples) libmicro-file 5.7.0-rc6 5.7.0-rc6 5.7.0-rc6 revert-1153933703d9+ align16+ Time mean95-pread_z100k 9.9195 ( 0.00%) 5.9856 ( 39.66%) 5.9938 ( 39.58%) Time mean95-pread_z10k 1.1378 ( 0.00%) 0.7450 ( 34.52%) 0.7467 ( 34.38%) Time mean95-pread_z1k 0.2623 ( 0.00%) 0.2251 ( 14.18%) 0.2252 ( 14.15%) Time mean95-pread_zw100k 9.9974 ( 0.00%) 6.0648 ( 39.34%) 6.0756 ( 39.23%) Time mean95-read_z100k 9.8940 ( 0.00%) 5.9885 ( 39.47%) 5.9994 ( 39.36%) Time mean95-read_z10k 1.1394 ( 0.00%) 0.7483 ( 34.33%) 0.7482 ( 34.33%) Note that this doesn't affect Haswell or Broadwell microarchitectures which seem to avoid the alignment issue by executing the loop straight out of the Loop Stream Detector (verified using perf events). Fixes: 1153933703d9 ("x86/asm/64: Micro-optimize __clear_user() - Use immediate constants") Signed-off-by: Matt Fleming Signed-off-by: Borislav Petkov Cc: # v4.19+ Link: https://lkml.kernel.org/r/20200618102002.30034-1-matt@codeblueprint.co.uk commit f2cd9a5e85dc25e10f6318bc6fbcb7dcff262561 Author: Shin'ichiro Kawasaki Date: Fri Jun 19 16:49:56 2020 +0900 dm zoned: Fix reclaim zone selection When dm zoned has multiple devices, random zones are never selected for reclaim if all reserved sequential write zones are in use and no sequential write required zones can be selected for reclaim. This can lead to deadlocks as selecting a cache zone allows reclaiming a sequential zone, ensuring forward progress. Fix this by always defaulting to selecting a random zone when no sequential write required zone can be selected. [Damien: fix commit message] Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit 3ee39573e567eded4f73e1e22216034bc29f3813 Author: Damien Le Moal Date: Fri Jun 19 16:49:55 2020 +0900 dm zoned: Fix random zone reclaim selection Commit 2094045fe5b5 ("dm zoned: prefer full zones for reclaim") modified dmz_get_rnd_zone_for_reclaim() to add a search for the buffer zone with the heaviest weight as an optimal candidate for reclaim. This modification uses the zone pointer variabl "last" which is set only once and never modified as zones are scanned, resulting in the search being inefective. Furthermore, if the selected buffer zone at the end of the search loop is active or already locked for reclaim, dmz_get_rnd_zone_for_reclaim() returns NULL even if other random zones with a lesser weight can be reclaimed. To fix the search and to guarantee that reclaim can make forward progress, fix dmz_get_rnd_zone_for_reclaim() loop to correctly find the buffer zone with the heaviest weight using the variable maxw_z. Also make sure to fallback to finding the first random zone that can be reclaimed if this best candidate zone cannot be reclaimed. While at it, also fix the device index check to consider only random zones, ignoring cache zones belonging to the cache device if one is used as that device does not have a reclaim process. Fixes: 2094045fe5b5 ("dm zoned: prefer full zones for reclaim") Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit 415c79e13b17ce5f0a0815bab4d584f75f4d1171 Author: Johannes Thumshirn Date: Fri Jun 19 15:59:04 2020 +0900 dm: update original bio sector on Zone Append Naohiro reported that issuing zone-append bios to a zoned block device underneath a dm-linear device does not work as expected. This because we forgot to reverse-map the sector the device wrote to the original bio. For zone-append bios, get the offset in the zone of the written sector from the clone bio and add that to the original bio's sector position. Fixes: 0512a75b98f8 ("block: Introduce REQ_OP_ZONE_APPEND") Cc: stable@vger.kernel.org Reported-by: Naohiro Aota Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit b38c0ad57f8e7810f2d994f49dab4ccb129cf31c Author: Shin'ichiro Kawasaki Date: Thu Jun 18 11:48:10 2020 +0900 dm zoned: Fix metadata zone size check When dm zoned has multiple devices, metadata is on the cache device, not in random zones of the zoned devices. Then the number of metadata zones shall be checked with the number of cache zones, not random zones. Fixes: 34f5affd04c4 ("dm zoned: separate random and cache zones") Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit e0034433a7e4f1d74e86fe801f7c017b48f81315 Author: Mauro Carvalho Chehab Date: Mon Jun 15 08:47:00 2020 +0200 docs: device-mapper: add dm-ebs.rst to an index file Solves this Sphinx warning: Documentation/admin-guide/device-mapper/dm-ebs.rst: WARNING: document isn't included in any toctree Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mike Snitzer commit 28f9f8fb4f405ade488058f817b6cbd108e45e4e Author: Loic Poulain Date: Fri Jun 19 12:17:44 2020 +0200 MAINTAINERS: Add robert and myself as qcom i2c cci maintainers Signed-off-by: Loic Poulain Signed-off-by: Robert Foss [wsa: kept sorting] Signed-off-by: Wolfram Sang commit a17f4bed811c60712d8131883cdba11a105d0161 Author: Fan Guo Date: Fri Jun 12 14:38:24 2020 +0800 RDMA/mad: Fix possible memory leak in ib_mad_post_receive_mads() If ib_dma_mapping_error() returns non-zero value, ib_mad_post_receive_mads() will jump out of loops and return -ENOMEM without freeing mad_priv. Fix this memory-leak problem by freeing mad_priv in this case. Fixes: 2c34e68f4261 ("IB/mad: Check and handle potential DMA mapping errors") Link: https://lore.kernel.org/r/20200612063824.180611-1-guofan5@huawei.com Signed-off-by: Fan Guo Signed-off-by: Jason Gunthorpe commit 49097762fa405cdc16f8f597f6d27c078d4a31e9 Author: Vitaly Kuznetsov Date: Fri Jun 19 11:40:46 2020 +0200 Revert "KVM: VMX: Micro-optimize vmexit time when not exposing PMU" Guest crashes are observed on a Cascade Lake system when 'perf top' is launched on the host, e.g. BUG: unable to handle kernel paging request at fffffe0000073038 PGD 7ffa7067 P4D 7ffa7067 PUD 7ffa6067 PMD 7ffa5067 PTE ffffffffff120 Oops: 0000 [#1] SMP PTI CPU: 1 PID: 1 Comm: systemd Not tainted 4.18.0+ #380 ... Call Trace: serial8250_console_write+0xfe/0x1f0 call_console_drivers.constprop.0+0x9d/0x120 console_unlock+0x1ea/0x460 Call traces are different but the crash is imminent. The problem was blindly bisected to the commit 041bc42ce2d0 ("KVM: VMX: Micro-optimize vmexit time when not exposing PMU"). It was also confirmed that the issue goes away if PMU is exposed to the guest. With some instrumentation of the guest we can see what is being switched (when we do atomic_switch_perf_msrs()): vmx_vcpu_run: switching 2 msrs vmx_vcpu_run: switching MSR38f guest: 70000000d host: 70000000f vmx_vcpu_run: switching MSR3f1 guest: 0 host: 2 The current guess is that PEBS (MSR_IA32_PEBS_ENABLE, 0x3f1) is to blame. Regardless of whether PMU is exposed to the guest or not, PEBS needs to be disabled upon switch. This reverts commit 041bc42ce2d0efac3b85bbb81dea8c74b81f4ef9. Reported-by: Maxime Coquelin Signed-off-by: Vitaly Kuznetsov Message-Id: <20200619094046.654019-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit a23ff37b32c7e682b42feab651c83a18c34e75eb Author: Keyur Patel Date: Fri Jun 12 17:26:35 2020 -0400 i2c: smbus: Fix spelling mistake in the comments Fix spelling mistake in the comments with help of `codespell`. seperate ==> separate Signed-off-by: Keyur Patel Signed-off-by: Wolfram Sang commit a5765124e697e67df01420f9ed8f9a851097d680 Author: Daniel Schaefer Date: Sun Jun 14 20:23:55 2020 +0200 Documentation/i2c: SMBus start signal is S not A Just like all other I2C/SMBus commands, the start signal for the SMBus Quick Command is S, not A. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Daniel Schaefer Signed-off-by: Wolfram Sang commit 2d3f53a80e4eed078669853a178ed96d88f74143 Author: Rodrigo Rivas Costa Date: Tue Jun 16 18:44:18 2020 +0200 HID: steam: fixes race in handling device list. Using uhid and KASAN this driver crashed because it was getting several connection events where it only expected one. Then the device was added several times to the static device list and it got corrupted. This patch checks if the device is already in the list before adding it. Signed-off-by: Rodrigo Rivas Costa Tested-by: Siarhei Vishniakou Signed-off-by: Jiri Kosina commit 390fd0475af565d2fc31de98fcc84f3c2922e008 Author: Wolfram Sang Date: Mon Jun 15 09:58:15 2020 +0200 i2c: remove deprecated i2c_new_device API All in-tree users have been converted to the new i2c_new_client_device function, so remove this deprecated one. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit bc5a3e44af7edb2fe3a678dde104aab763bd1293 Author: Wolfram Sang Date: Mon Jun 15 09:58:14 2020 +0200 Documentation: media: convert to use i2c_new_client_device() Move away from the deprecated API and advertise the new one. Signed-off-by: Wolfram Sang Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Wolfram Sang commit 9e1b93b9f624e7f8ae836c47ee68dc2d732f2957 Author: Wolfram Sang Date: Mon Jun 15 09:58:13 2020 +0200 video: backlight: tosa_lcd: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Reviewed-by: Daniel Thompson Acked-by: Lee Jones Signed-off-by: Wolfram Sang commit f04a5ba1752512a46ffb61b88a8fa7d4ab7e02f3 Author: Wolfram Sang Date: Mon Jun 15 09:58:12 2020 +0200 x86/platform/intel-mid: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit bb7d93fff62f32f4ff0072b2ace695bd5f5137e7 Author: Wolfram Sang Date: Mon Jun 15 09:58:11 2020 +0200 drm: encoder_slave: use new I2C API i2c_new_client() is deprecated, use the replacement i2c_new_client_device(). Also, we have a helper to check if a driver is bound. Use it to simplify the code. Note that this changes the errno for a failed device creation from ENOMEM to ENODEV. No callers currently interpret this errno, though, so we use this condensed error check. Signed-off-by: Wolfram Sang Reviewed-by: Emil Velikov Acked-by: Daniel Vetter Signed-off-by: Wolfram Sang commit f78d4032de60f50fd4afaa0fb68ea03b985f820a Author: Wolfram Sang Date: Mon Jun 15 09:58:10 2020 +0200 drm: encoder_slave: fix refcouting error for modules module_put() balances try_module_get(), not request_module(). Fix the error path to match that. Fixes: 2066facca4c7 ("drm/kms: slave encoder interface.") Signed-off-by: Wolfram Sang Reviewed-by: Emil Velikov Acked-by: Daniel Vetter Signed-off-by: Wolfram Sang commit 3995ecbabc6f8019b3a55aeb551eeb9598b8b354 Author: Björn Töpel Date: Fri Jun 12 13:47:31 2020 +0200 i40e: fix crash when Rx descriptor count is changed When the AF_XDP buffer allocator was introduced, the Rx SW ring "rx_bi" allocation was moved from i40e_setup_rx_descriptors() function, and was instead done in the i40e_configure_rx_ring() function. This broke the ethtool set_ringparam() hook for changing the Rx descriptor count, which was relying on i40e_setup_rx_descriptors() to handle the allocation. Fix this by adding an explicit i40e_alloc_rx_bi() call to i40e_set_ringparam(). Fixes: be1222b585fd ("i40e: Separate kernel allocated rx_bi rings from AF_XDP rings") Signed-off-by: Björn Töpel Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit b1d95cc2391ffac0c5b27256a4fb0d2cfb021a29 Author: Ciara Loftus Date: Tue Jun 9 13:19:45 2020 +0000 ice: protect ring accesses with WRITE_ONCE The READ_ONCE macro is used when reading rings prior to accessing the statistics pointer. The corresponding WRITE_ONCE usage when allocating and freeing the rings to ensure protected access was not in place. Introduce this. Signed-off-by: Ciara Loftus Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit d59e267912cd90b0adf33b4659050d831e746317 Author: Ciara Loftus Date: Tue Jun 9 13:19:44 2020 +0000 i40e: protect ring accesses with READ- and WRITE_ONCE READ_ONCE should be used when reading rings prior to accessing the statistics pointer. Introduce this as well as the corresponding WRITE_ONCE usage when allocating and freeing the rings, to ensure protected access. Signed-off-by: Ciara Loftus Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f140ad9fe2ae16f385f8fe4dc9cf67bb4c51d794 Author: Ciara Loftus Date: Tue Jun 9 13:19:43 2020 +0000 ixgbe: protect ring accesses with READ- and WRITE_ONCE READ_ONCE should be used when reading rings prior to accessing the statistics pointer. Introduce this as well as the corresponding WRITE_ONCE usage when allocating and freeing the rings, to ensure protected access. Signed-off-by: Ciara Loftus Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 0ad6f6e767ec2f613418cbc7ebe5ec4c35af540c Author: Eric Dumazet Date: Wed Jun 17 22:23:25 2020 -0700 net: increment xmit_recursion level in dev_direct_xmit() Back in commit f60e5990d9c1 ("ipv6: protect skb->sk accesses from recursive dereference inside the stack") Hannes added code so that IPv6 stack would not trust skb->sk for typical cases where packet goes through 'standard' xmit path (__dev_queue_xmit()) Alas af_packet had a dev_direct_xmit() path that was not dealing yet with xmit_recursion level. Also change sk_mc_loop() to dump a stack once only. Without this patch, syzbot was able to trigger : [1] [ 153.567378] WARNING: CPU: 7 PID: 11273 at net/core/sock.c:721 sk_mc_loop+0x51/0x70 [ 153.567378] Modules linked in: nfnetlink ip6table_raw ip6table_filter iptable_raw iptable_nat nf_nat nf_conntrack nf_defrag_ipv4 nf_defrag_ipv6 iptable_filter macsec macvtap tap macvlan 8021q hsr wireguard libblake2s blake2s_x86_64 libblake2s_generic udp_tunnel ip6_udp_tunnel libchacha20poly1305 poly1305_x86_64 chacha_x86_64 libchacha curve25519_x86_64 libcurve25519_generic netdevsim batman_adv dummy team bridge stp llc w1_therm wire i2c_mux_pca954x i2c_mux cdc_acm ehci_pci ehci_hcd mlx4_en mlx4_ib ib_uverbs ib_core mlx4_core [ 153.567386] CPU: 7 PID: 11273 Comm: b159172088 Not tainted 5.8.0-smp-DEV #273 [ 153.567387] RIP: 0010:sk_mc_loop+0x51/0x70 [ 153.567388] Code: 66 83 f8 0a 75 24 0f b6 4f 12 b8 01 00 00 00 31 d2 d3 e0 a9 bf ef ff ff 74 07 48 8b 97 f0 02 00 00 0f b6 42 3a 83 e0 01 5d c3 <0f> 0b b8 01 00 00 00 5d c3 0f b6 87 18 03 00 00 5d c0 e8 04 83 e0 [ 153.567388] RSP: 0018:ffff95c69bb93990 EFLAGS: 00010212 [ 153.567388] RAX: 0000000000000011 RBX: ffff95c6e0ee3e00 RCX: 0000000000000007 [ 153.567389] RDX: ffff95c69ae50000 RSI: ffff95c6c30c3000 RDI: ffff95c6c30c3000 [ 153.567389] RBP: ffff95c69bb93990 R08: ffff95c69a77f000 R09: 0000000000000008 [ 153.567389] R10: 0000000000000040 R11: 00003e0e00026128 R12: ffff95c6c30c3000 [ 153.567390] R13: ffff95c6cc4fd500 R14: ffff95c6f84500c0 R15: ffff95c69aa13c00 [ 153.567390] FS: 00007fdc3a283700(0000) GS:ffff95c6ff9c0000(0000) knlGS:0000000000000000 [ 153.567390] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 153.567391] CR2: 00007ffee758e890 CR3: 0000001f9ba20003 CR4: 00000000001606e0 [ 153.567391] Call Trace: [ 153.567391] ip6_finish_output2+0x34e/0x550 [ 153.567391] __ip6_finish_output+0xe7/0x110 [ 153.567391] ip6_finish_output+0x2d/0xb0 [ 153.567392] ip6_output+0x77/0x120 [ 153.567392] ? __ip6_finish_output+0x110/0x110 [ 153.567392] ip6_local_out+0x3d/0x50 [ 153.567392] ipvlan_queue_xmit+0x56c/0x5e0 [ 153.567393] ? ksize+0x19/0x30 [ 153.567393] ipvlan_start_xmit+0x18/0x50 [ 153.567393] dev_direct_xmit+0xf3/0x1c0 [ 153.567393] packet_direct_xmit+0x69/0xa0 [ 153.567394] packet_sendmsg+0xbf0/0x19b0 [ 153.567394] ? plist_del+0x62/0xb0 [ 153.567394] sock_sendmsg+0x65/0x70 [ 153.567394] sock_write_iter+0x93/0xf0 [ 153.567394] new_sync_write+0x18e/0x1a0 [ 153.567395] __vfs_write+0x29/0x40 [ 153.567395] vfs_write+0xb9/0x1b0 [ 153.567395] ksys_write+0xb1/0xe0 [ 153.567395] __x64_sys_write+0x1a/0x20 [ 153.567395] do_syscall_64+0x43/0x70 [ 153.567396] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 153.567396] RIP: 0033:0x453549 [ 153.567396] Code: Bad RIP value. [ 153.567396] RSP: 002b:00007fdc3a282cc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 153.567397] RAX: ffffffffffffffda RBX: 00000000004d32d0 RCX: 0000000000453549 [ 153.567397] RDX: 0000000000000020 RSI: 0000000020000300 RDI: 0000000000000003 [ 153.567398] RBP: 00000000004d32d8 R08: 0000000000000000 R09: 0000000000000000 [ 153.567398] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004d32dc [ 153.567398] R13: 00007ffee742260f R14: 00007fdc3a282dc0 R15: 00007fdc3a283700 [ 153.567399] ---[ end trace c1d5ae2b1059ec62 ]--- f60e5990d9c1 ("ipv6: protect skb->sk accesses from recursive dereference inside the stack") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit 8dbe4c5d5e40fe140221024f7b16bec9f310bf70 Author: Florian Fainelli Date: Wed Jun 17 20:42:44 2020 -0700 net: dsa: bcm_sf2: Fix node reference count of_find_node_by_name() will do an of_node_put() on the "from" argument. With CONFIG_OF_DYNAMIC enabled which checks for device_node reference counts, we would be getting a warning like this: [ 6.347230] refcount_t: increment on 0; use-after-free. [ 6.352498] WARNING: CPU: 3 PID: 77 at lib/refcount.c:156 refcount_inc_checked+0x38/0x44 [ 6.360601] Modules linked in: [ 6.363661] CPU: 3 PID: 77 Comm: kworker/3:1 Tainted: G W 5.4.46-gb78b3e9956e6 #13 [ 6.372546] Hardware name: BCM97278SV (DT) [ 6.376649] Workqueue: events deferred_probe_work_func [ 6.381796] pstate: 60000005 (nZCv daif -PAN -UAO) [ 6.386595] pc : refcount_inc_checked+0x38/0x44 [ 6.391133] lr : refcount_inc_checked+0x38/0x44 ... [ 6.478791] Call trace: [ 6.481243] refcount_inc_checked+0x38/0x44 [ 6.485433] kobject_get+0x3c/0x4c [ 6.488840] of_node_get+0x24/0x34 [ 6.492247] of_irq_find_parent+0x3c/0xe0 [ 6.496263] of_irq_parse_one+0xe4/0x1d0 [ 6.500191] irq_of_parse_and_map+0x44/0x84 [ 6.504381] bcm_sf2_sw_probe+0x22c/0x844 [ 6.508397] platform_drv_probe+0x58/0xa8 [ 6.512413] really_probe+0x238/0x3fc [ 6.516081] driver_probe_device+0x11c/0x12c [ 6.520358] __device_attach_driver+0xa8/0x100 [ 6.524808] bus_for_each_drv+0xb4/0xd0 [ 6.528650] __device_attach+0xd0/0x164 [ 6.532493] device_initial_probe+0x24/0x30 [ 6.536682] bus_probe_device+0x38/0x98 [ 6.540524] deferred_probe_work_func+0xa8/0xd4 [ 6.545061] process_one_work+0x178/0x288 [ 6.549078] process_scheduled_works+0x44/0x48 [ 6.553529] worker_thread+0x218/0x270 [ 6.557285] kthread+0xdc/0xe4 [ 6.560344] ret_from_fork+0x10/0x18 [ 6.563925] ---[ end trace 68f65caf69bb152a ]--- Fix this by adding a of_node_get() to increment the reference count prior to the call. Fixes: afa3b592953b ("net: dsa: bcm_sf2: Ensure correct sub-node is parsed") Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit eddbf5d0204e550ee59de02bdc19fe90d4203dd6 Author: Alexander Lobakin Date: Wed Jun 17 20:42:47 2020 +0000 net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As a result, fraglist GSO feature is not shown in 'ethtool -k' output and can't be toggled on/off. The fix is trivial. Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") Signed-off-by: Alexander Lobakin Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit 3a2656a211caf35e56afc9425e6e518fa52f7fbc Author: David Christensen Date: Wed Jun 17 11:51:17 2020 -0700 tg3: driver sleeps indefinitely when EEH errors exceed eeh_max_freezes The driver function tg3_io_error_detected() calls napi_disable twice, without an intervening napi_enable, when the number of EEH errors exceeds eeh_max_freezes, resulting in an indefinite sleep while holding rtnl_lock. Add check for pcierr_recovery which skips code already executed for the "Frozen" state. Signed-off-by: David Christensen Reviewed-by: Michael Chan Signed-off-by: David S. Miller commit 4c98045c9b74feab837be58986c0517d3cc661f1 Author: Martin Date: Wed Jun 17 22:30:23 2020 +0530 bareudp: Fixed multiproto mode configuration Code to handle multiproto configuration is missing. Fixes: 4b5f67232d95 ("net: Special handling for IP & MPLS") Signed-off-by: Martin Signed-off-by: David S. Miller commit e807fa3f602edcebecdfe3cebda1d91aa8087f0f Merge: f3c7a6e0e515 8cebedb64383 Author: David S. Miller Date: Thu Jun 18 20:27:42 2020 -0700 Merge branch 's390-qeth-fixes' Julian Wiedmann says: ==================== s390/qeth: fixes 2020-06-17 please apply the following patch series for qeth to netdev's net tree. The first patch fixes a regression in the error handling for a specific cmd type. I have some follow-ups queued up for net-next to clean this up properly... The second patch fine-tunes the HW offload restrictions that went in with this merge window. In some setups we don't need to apply them. ==================== Signed-off-by: David S. Miller commit 8cebedb643832586162aa5313cae781173c1f81b Author: Julian Wiedmann Date: Wed Jun 17 16:54:53 2020 +0200 s390/qeth: let isolation mode override HW offload restrictions When a device is configured with ISOLATION_MODE_FWD, traffic never goes through the internal switch. Don't apply the offload restrictions in this case. Fixes: c619e9a6f52f ("s390/qeth: don't use restricted offloads for local traffic") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit e2dfcfba00ba4a414617ef4c5a8501fe21567eb3 Author: Julian Wiedmann Date: Wed Jun 17 16:54:52 2020 +0200 s390/qeth: fix error handling for isolation mode cmds Current(?) OSA devices also store their cmd-specific return codes for SET_ACCESS_CONTROL cmds into the top-level cmd->hdr.return_code. So once we added stricter checking for the top-level field a while ago, none of the error logic that rolls back the user's configuration to its old state is applied any longer. For this specific cmd, go back to the old model where we peek into the cmd structure even though the top-level field indicated an error. Fixes: 686c97ee29c8 ("s390/qeth: fix error handling in adapter command callbacks") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit f3c7a6e0e515ebe4efae894bac8d6906e4367be5 Merge: 5eea3a63ff4a 9e365ff576b7 Author: David S. Miller Date: Thu Jun 18 20:25:51 2020 -0700 Merge branch 'mptcp-cope-with-syncookie-on-MP_JOINs' Paolo Abeni says: ==================== mptcp: cope with syncookie on MP_JOINs Currently syncookies on MP_JOIN connections are not handled correctly: the connections fallback to TCP and are kept alive instead of resetting them at fallback time. The first patch propagates the required information up to syn_recv_sock time, and the 2nd patch addresses the unifying the error path for all MP_JOIN requests. ==================== Signed-off-by: David S. Miller commit 9e365ff576b7c1623bbc5ef31ec652c533e2f65e Author: Paolo Abeni Date: Wed Jun 17 12:08:57 2020 +0200 mptcp: drop MP_JOIN request sock on syn cookies Currently any MPTCP socket using syn cookies will fallback to TCP at 3rd ack time. In case of MP_JOIN requests, the RFC mandate closing the child and sockets, but the existing error paths do not handle the syncookie scenario correctly. Address the issue always forcing the child shutdown in case of MP_JOIN fallback. Fixes: ae2dd7164943 ("mptcp: handle tcp fallback when using syn cookies") Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: David S. Miller commit 8fd4de1275580a1befa1456d1070eaf6489fb48f Author: Paolo Abeni Date: Wed Jun 17 12:08:56 2020 +0200 mptcp: cache msk on MP_JOIN init_req The msk ownership is transferred to the child socket at 3rd ack time, so that we avoid more lookups later. If the request does not reach the 3rd ack, the MSK reference is dropped at request sock release time. As a side effect, fallback is now tracked by a NULL msk reference instead of zeroed 'mp_join' field. This will simplify the next patch. Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: David S. Miller commit 5eea3a63ff4aba6a26002e657a6d21934b7e2b96 Author: guodeqing Date: Wed Jun 17 10:07:16 2020 +0800 net: Fix the arp error in some cases ie., $ ifconfig eth0 6.6.6.6 netmask 255.255.255.0 $ ip rule add from 6.6.6.6 table 6666 $ ip route add 9.9.9.9 via 6.6.6.6 $ ping -I 6.6.6.6 9.9.9.9 PING 9.9.9.9 (9.9.9.9) from 6.6.6.6 : 56(84) bytes of data. 3 packets transmitted, 0 received, 100% packet loss, time 2079ms $ arp Address HWtype HWaddress Flags Mask Iface 6.6.6.6 (incomplete) eth0 The arp request address is error, this is because fib_table_lookup in fib_check_nh lookup the destnation 9.9.9.9 nexthop, the scope of the fib result is RT_SCOPE_LINK,the correct scope is RT_SCOPE_HOST. Here I add a check of whether this is RT_TABLE_MAIN to solve this problem. Fixes: 3bfd847203c6 ("net: Use passed in table for nexthop lookups") Signed-off-by: guodeqing Reviewed-by: David Ahern Signed-off-by: David S. Miller commit ad103e03bda701f54dc97fbde7f199adc9e80282 Merge: b64ee4856c10 5182a6222dd0 Author: David S. Miller Date: Thu Jun 18 20:20:46 2020 -0700 Merge branch 'sja1105-fixes' Vladimir Oltean says: ==================== Fix VLAN checks for SJA1105 DSA tc-flower filters This fixes a ridiculous situation where the driver, in VLAN-unaware mode, would refuse accepting any tc filter: tc filter replace dev sw1p3 ingress flower skip_sw \ dst_mac 42:be:24:9b:76:20 \ action gate (...) Error: sja1105: Can only gate based on {DMAC, VID, PCP}. tc filter replace dev sw1p3 ingress protocol 802.1Q flower skip_sw \ vlan_id 1 vlan_prio 0 dst_mac 42:be:24:9b:76:20 \ action gate (...) Error: sja1105: Can only gate based on DMAC. So, without changing the VLAN awareness state, it says it doesn't want VLAN-aware rules, and it doesn't want VLAN-unaware rules either. One would say it's in Schrodinger's state... Now, the situation has been made worse by commit 7f14937facdc ("net: dsa: sja1105: keep the VLAN awareness state in a driver variable"), which made VLAN awareness a ternary attribute, but after inspecting the code from before that patch with a truth table, it looks like the logical bug was there even before. While attempting to fix this, I also noticed some leftover debugging code in one of the places that needed to be fixed. It would have appeared in the context of patch 3/3 anyway, so I decided to create a patch that removes it. ==================== Signed-off-by: David S. Miller commit 5182a6222dd0f27c41cda2706bdc58d48a0d8f96 Author: Vladimir Oltean Date: Wed Jun 17 02:58:43 2020 +0300 net: dsa: sja1105: fix checks for VLAN state in gate action This action requires the VLAN awareness state of the switch to be of the same type as the key that's being added: - If the switch is unaware of VLAN, then the tc filter key must only contain the destination MAC address. - If the switch is VLAN-aware, the key must also contain the VLAN ID and PCP. But this check doesn't work unless we verify the VLAN awareness state on both the "if" and the "else" branches. Fixes: 834f8933d5dd ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c6ae970bcc8e6f0b761111680ba78f7be43fb05a Author: Vladimir Oltean Date: Wed Jun 17 02:58:42 2020 +0300 net: dsa: sja1105: fix checks for VLAN state in redirect action This action requires the VLAN awareness state of the switch to be of the same type as the key that's being added: - If the switch is unaware of VLAN, then the tc filter key must only contain the destination MAC address. - If the switch is VLAN-aware, the key must also contain the VLAN ID and PCP. But this check doesn't work unless we verify the VLAN awareness state on both the "if" and the "else" branches. Fixes: dfacc5a23e22 ("net: dsa: sja1105: support flow-based redirection via virtual links") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5b3b396c77677b51a6bd1aacd0fe2a04d1efa0ff Author: Vladimir Oltean Date: Wed Jun 17 02:58:41 2020 +0300 net: dsa: sja1105: remove debugging code in sja1105_vl_gate This shouldn't be there. Fixes: 834f8933d5dd ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b64ee4856c106fc743880c1a33074c7bcebf6eb6 Merge: ba61539c6ae5 c362a06e96ea Author: David S. Miller Date: Thu Jun 18 20:17:49 2020 -0700 Merge branch 'act_gate-fixes' Davide Caratti says: ==================== two fixes for 'act_gate' control plane - patch 1/2 attempts to fix the error path of tcf_gate_init() when users try to configure 'act_gate' rules with wrong parameters - patch 2/2 is a follow-up of a recent fix for NULL dereference in the error path of tcf_gate_init() further work will introduce a tdc test for 'act_gate'. changes since v2: - fix undefined behavior in patch 1/2 - improve comment in patch 2/2 changes since v1: coding style fixes in patch 1/2 and 2/2 ==================== Signed-off-by: David S. Miller commit c362a06e96eae16ccb7b0f4f93f19224279b8610 Author: Davide Caratti Date: Tue Jun 16 22:25:21 2020 +0200 net/sched: act_gate: fix configuration of the periodic timer assigning a dummy value of 'clock_id' to avoid cancellation of the cycle timer before its initialization was a temporary solution, and we still need to handle the case where act_gate timer parameters are changed by commands like the following one: # tc action replace action gate the fix consists in the following items: 1) remove the workaround assignment of 'clock_id', and init the list of entries before the first error path after IDR atomic check/allocation 2) validate 'clock_id' earlier: there is no need to do IDR atomic check/allocation if we know that 'clock_id' is a bad value 3) use a dedicated function, 'gate_setup_timer()', to ensure that the timer is cancelled and re-initialized on action overwrite, and also ensure we initialize the timer in the error path of tcf_gate_init() v3: improve comment in the error path of tcf_gate_init() (thanks to Vladimir Oltean) v2: avoid 'goto' in gate_setup_timer (thanks to Cong Wang) CC: Ivan Vecera Fixes: a01c245438c5 ("net/sched: fix a couple of splats in the error path of tfc_gate_init()") Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") Signed-off-by: Davide Caratti Acked-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7024339a1cfa0d5bbfa628a7a35b67789cc86d7f Author: Davide Caratti Date: Tue Jun 16 22:25:20 2020 +0200 net/sched: act_gate: fix NULL dereference in tcf_gate_init() it is possible to see a KASAN use-after-free, immediately followed by a NULL dereference crash, with the following command: # tc action add action gate index 3 cycle-time 100000000ns \ > cycle-time-ext 100000000ns clockid CLOCK_TAI BUG: KASAN: use-after-free in tcf_action_init_1+0x8eb/0x960 Write of size 1 at addr ffff88810a5908bc by task tc/883 CPU: 0 PID: 883 Comm: tc Not tainted 5.7.0+ #188 Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014 Call Trace: dump_stack+0x75/0xa0 print_address_description.constprop.6+0x1a/0x220 kasan_report.cold.9+0x37/0x7c tcf_action_init_1+0x8eb/0x960 tcf_action_init+0x157/0x2a0 tcf_action_add+0xd9/0x2f0 tc_ctl_action+0x2a3/0x39d rtnetlink_rcv_msg+0x5f3/0x920 netlink_rcv_skb+0x120/0x380 netlink_unicast+0x439/0x630 netlink_sendmsg+0x714/0xbf0 sock_sendmsg+0xe2/0x110 ____sys_sendmsg+0x5b4/0x890 ___sys_sendmsg+0xe9/0x160 __sys_sendmsg+0xd3/0x170 do_syscall_64+0x9a/0x370 entry_SYSCALL_64_after_hwframe+0x44/0xa9 [...] KASAN: null-ptr-deref in range [0x0000000000000070-0x0000000000000077] CPU: 0 PID: 883 Comm: tc Tainted: G B 5.7.0+ #188 Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014 RIP: 0010:tcf_action_fill_size+0xa3/0xf0 [....] RSP: 0018:ffff88813a48f250 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: 0000000000000094 RCX: ffffffffa47c3eb6 RDX: 000000000000000e RSI: 0000000000000008 RDI: 0000000000000070 RBP: ffff88810a590800 R08: 0000000000000004 R09: ffffed1027491e03 R10: 0000000000000003 R11: ffffed1027491e03 R12: 0000000000000000 R13: 0000000000000000 R14: dffffc0000000000 R15: ffff88810a590800 FS: 00007f62cae8ce40(0000) GS:ffff888147c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f62c9d20a10 CR3: 000000013a52a000 CR4: 0000000000340ef0 Call Trace: tcf_action_init+0x172/0x2a0 tcf_action_add+0xd9/0x2f0 tc_ctl_action+0x2a3/0x39d rtnetlink_rcv_msg+0x5f3/0x920 netlink_rcv_skb+0x120/0x380 netlink_unicast+0x439/0x630 netlink_sendmsg+0x714/0xbf0 sock_sendmsg+0xe2/0x110 ____sys_sendmsg+0x5b4/0x890 ___sys_sendmsg+0xe9/0x160 __sys_sendmsg+0xd3/0x170 do_syscall_64+0x9a/0x370 entry_SYSCALL_64_after_hwframe+0x44/0xa9 this is caused by the test on 'cycletime_ext', that is still unassigned when the action is newly created. This makes the action .init() return 0 without calling tcf_idr_insert(), hence the UAF + crash. rework the logic that prevents zero values of cycle-time, as follows: 1) 'tcfg_cycletime_ext' seems to be unused in the action software path, and it was already possible by other means to obtain non-zero cycletime and zero cycletime-ext. So, removing that test should not cause any damage. 2) while at it, we must prevent overwriting configuration data with wrong ones: use a temporary variable for 'tcfg_cycletime', and validate it preserving the original semantic (that allowed computing the cycle time as the sum of all intervals, when not specified by TCA_GATE_CYCLE_TIME). 3) remove the test on 'tcfg_cycletime', no more useful, and avoid returning -EFAULT, which did not seem an appropriate return value for a wrong netlink attribute. v3: fix uninitialized 'cycletime' (thanks to Vladimir Oltean) v2: remove useless 'return;' at the end of void gate_get_start_time() Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti Acked-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit ba61539c6ae57f4146284a5cb4f7b7ed8d42bf45 Author: Taehee Yoo Date: Tue Jun 16 16:51:51 2020 +0000 ip_tunnel: fix use-after-free in ip_tunnel_lookup() In the datapath, the ip_tunnel_lookup() is used and it internally uses fallback tunnel device pointer, which is fb_tunnel_dev. This pointer variable should be set to NULL when a fb interface is deleted. But there is no routine to set fb_tunnel_dev pointer to NULL. So, this pointer will be still used after interface is deleted and it eventually results in the use-after-free problem. Test commands: ip netns add A ip netns add B ip link add eth0 type veth peer name eth1 ip link set eth0 netns A ip link set eth1 netns B ip netns exec A ip link set lo up ip netns exec A ip link set eth0 up ip netns exec A ip link add gre1 type gre local 10.0.0.1 \ remote 10.0.0.2 ip netns exec A ip link set gre1 up ip netns exec A ip a a 10.0.100.1/24 dev gre1 ip netns exec A ip a a 10.0.0.1/24 dev eth0 ip netns exec B ip link set lo up ip netns exec B ip link set eth1 up ip netns exec B ip link add gre1 type gre local 10.0.0.2 \ remote 10.0.0.1 ip netns exec B ip link set gre1 up ip netns exec B ip a a 10.0.100.2/24 dev gre1 ip netns exec B ip a a 10.0.0.2/24 dev eth1 ip netns exec A hping3 10.0.100.2 -2 --flood -d 60000 & ip netns del B Splat looks like: [ 77.793450][ C3] ================================================================== [ 77.794702][ C3] BUG: KASAN: use-after-free in ip_tunnel_lookup+0xcc4/0xf30 [ 77.795573][ C3] Read of size 4 at addr ffff888060bd9c84 by task hping3/2905 [ 77.796398][ C3] [ 77.796664][ C3] CPU: 3 PID: 2905 Comm: hping3 Not tainted 5.8.0-rc1+ #616 [ 77.797474][ C3] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 77.798453][ C3] Call Trace: [ 77.798815][ C3] [ 77.799142][ C3] dump_stack+0x9d/0xdb [ 77.799605][ C3] print_address_description.constprop.7+0x2cc/0x450 [ 77.800365][ C3] ? ip_tunnel_lookup+0xcc4/0xf30 [ 77.800908][ C3] ? ip_tunnel_lookup+0xcc4/0xf30 [ 77.801517][ C3] ? ip_tunnel_lookup+0xcc4/0xf30 [ 77.802145][ C3] kasan_report+0x154/0x190 [ 77.802821][ C3] ? ip_tunnel_lookup+0xcc4/0xf30 [ 77.803503][ C3] ip_tunnel_lookup+0xcc4/0xf30 [ 77.804165][ C3] __ipgre_rcv+0x1ab/0xaa0 [ip_gre] [ 77.804862][ C3] ? rcu_read_lock_sched_held+0xc0/0xc0 [ 77.805621][ C3] gre_rcv+0x304/0x1910 [ip_gre] [ 77.806293][ C3] ? lock_acquire+0x1a9/0x870 [ 77.806925][ C3] ? gre_rcv+0xfe/0x354 [gre] [ 77.807559][ C3] ? erspan_xmit+0x2e60/0x2e60 [ip_gre] [ 77.808305][ C3] ? rcu_read_lock_sched_held+0xc0/0xc0 [ 77.809032][ C3] ? rcu_read_lock_held+0x90/0xa0 [ 77.809713][ C3] gre_rcv+0x1b8/0x354 [gre] [ ... ] Suggested-by: Eric Dumazet Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit dafabb6590cb15f300b77c095d50312e2c7c8e0f Author: Taehee Yoo Date: Tue Jun 16 16:04:00 2020 +0000 ip6_gre: fix use-after-free in ip6gre_tunnel_lookup() In the datapath, the ip6gre_tunnel_lookup() is used and it internally uses fallback tunnel device pointer, which is fb_tunnel_dev. This pointer variable should be set to NULL when a fb interface is deleted. But there is no routine to set fb_tunnel_dev pointer to NULL. So, this pointer will be still used after interface is deleted and it eventually results in the use-after-free problem. Test commands: ip netns add A ip netns add B ip link add eth0 type veth peer name eth1 ip link set eth0 netns A ip link set eth1 netns B ip netns exec A ip link set lo up ip netns exec A ip link set eth0 up ip netns exec A ip link add ip6gre1 type ip6gre local fc:0::1 \ remote fc:0::2 ip netns exec A ip -6 a a fc:100::1/64 dev ip6gre1 ip netns exec A ip link set ip6gre1 up ip netns exec A ip -6 a a fc:0::1/64 dev eth0 ip netns exec A ip link set ip6gre0 up ip netns exec B ip link set lo up ip netns exec B ip link set eth1 up ip netns exec B ip link add ip6gre1 type ip6gre local fc:0::2 \ remote fc:0::1 ip netns exec B ip -6 a a fc:100::2/64 dev ip6gre1 ip netns exec B ip link set ip6gre1 up ip netns exec B ip -6 a a fc:0::2/64 dev eth1 ip netns exec B ip link set ip6gre0 up ip netns exec A ping fc:100::2 -s 60000 & ip netns del B Splat looks like: [ 73.087285][ C1] BUG: KASAN: use-after-free in ip6gre_tunnel_lookup+0x1064/0x13f0 [ip6_gre] [ 73.088361][ C1] Read of size 4 at addr ffff888040559218 by task ping/1429 [ 73.089317][ C1] [ 73.089638][ C1] CPU: 1 PID: 1429 Comm: ping Not tainted 5.7.0+ #602 [ 73.090531][ C1] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 73.091725][ C1] Call Trace: [ 73.092160][ C1] [ 73.092556][ C1] dump_stack+0x96/0xdb [ 73.093122][ C1] print_address_description.constprop.6+0x2cc/0x450 [ 73.094016][ C1] ? ip6gre_tunnel_lookup+0x1064/0x13f0 [ip6_gre] [ 73.094894][ C1] ? ip6gre_tunnel_lookup+0x1064/0x13f0 [ip6_gre] [ 73.095767][ C1] ? ip6gre_tunnel_lookup+0x1064/0x13f0 [ip6_gre] [ 73.096619][ C1] kasan_report+0x154/0x190 [ 73.097209][ C1] ? ip6gre_tunnel_lookup+0x1064/0x13f0 [ip6_gre] [ 73.097989][ C1] ip6gre_tunnel_lookup+0x1064/0x13f0 [ip6_gre] [ 73.098750][ C1] ? gre_del_protocol+0x60/0x60 [gre] [ 73.099500][ C1] gre_rcv+0x1c5/0x1450 [ip6_gre] [ 73.100199][ C1] ? ip6gre_header+0xf00/0xf00 [ip6_gre] [ 73.100985][ C1] ? rcu_read_lock_sched_held+0xc0/0xc0 [ 73.101830][ C1] ? ip6_input_finish+0x5/0xf0 [ 73.102483][ C1] ip6_protocol_deliver_rcu+0xcbb/0x1510 [ 73.103296][ C1] ip6_input_finish+0x5b/0xf0 [ 73.103920][ C1] ip6_input+0xcd/0x2c0 [ 73.104473][ C1] ? ip6_input_finish+0xf0/0xf0 [ 73.105115][ C1] ? rcu_read_lock_held+0x90/0xa0 [ 73.105783][ C1] ? rcu_read_lock_sched_held+0xc0/0xc0 [ 73.106548][ C1] ipv6_rcv+0x1f1/0x300 [ ... ] Suggested-by: Eric Dumazet Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit fb7861d14c8d7edac65b2fcb6e8031cb138457b2 Author: Taehee Yoo Date: Tue Jun 16 15:52:05 2020 +0000 net: core: reduce recursion limit value In the current code, ->ndo_start_xmit() can be executed recursively only 10 times because of stack memory. But, in the case of the vxlan, 10 recursion limit value results in a stack overflow. In the current code, the nested interface is limited by 8 depth. There is no critical reason that the recursion limitation value should be 10. So, it would be good to be the same value with the limitation value of nesting interface depth. Test commands: ip link add vxlan10 type vxlan vni 10 dstport 4789 srcport 4789 4789 ip link set vxlan10 up ip a a 192.168.10.1/24 dev vxlan10 ip n a 192.168.10.2 dev vxlan10 lladdr fc:22:33:44:55:66 nud permanent for i in {9..0} do let A=$i+1 ip link add vxlan$i type vxlan vni $i dstport 4789 srcport 4789 4789 ip link set vxlan$i up ip a a 192.168.$i.1/24 dev vxlan$i ip n a 192.168.$i.2 dev vxlan$i lladdr fc:22:33:44:55:66 nud permanent bridge fdb add fc:22:33:44:55:66 dev vxlan$A dst 192.168.$i.2 self done hping3 192.168.10.2 -2 -d 60000 Splat looks like: [ 103.814237][ T1127] ============================================================================= [ 103.871955][ T1127] BUG kmalloc-2k (Tainted: G B ): Padding overwritten. 0x00000000897a2e4f-0x000 [ 103.873187][ T1127] ----------------------------------------------------------------------------- [ 103.873187][ T1127] [ 103.874252][ T1127] INFO: Slab 0x000000005cccc724 objects=5 used=5 fp=0x0000000000000000 flags=0x10000000001020 [ 103.881323][ T1127] CPU: 3 PID: 1127 Comm: hping3 Tainted: G B 5.7.0+ #575 [ 103.882131][ T1127] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 103.883006][ T1127] Call Trace: [ 103.883324][ T1127] dump_stack+0x96/0xdb [ 103.883716][ T1127] slab_err+0xad/0xd0 [ 103.884106][ T1127] ? _raw_spin_unlock+0x1f/0x30 [ 103.884620][ T1127] ? get_partial_node.isra.78+0x140/0x360 [ 103.885214][ T1127] slab_pad_check.part.53+0xf7/0x160 [ 103.885769][ T1127] ? pskb_expand_head+0x110/0xe10 [ 103.886316][ T1127] check_slab+0x97/0xb0 [ 103.886763][ T1127] alloc_debug_processing+0x84/0x1a0 [ 103.887308][ T1127] ___slab_alloc+0x5a5/0x630 [ 103.887765][ T1127] ? pskb_expand_head+0x110/0xe10 [ 103.888265][ T1127] ? lock_downgrade+0x730/0x730 [ 103.888762][ T1127] ? pskb_expand_head+0x110/0xe10 [ 103.889244][ T1127] ? __slab_alloc+0x3e/0x80 [ 103.889675][ T1127] __slab_alloc+0x3e/0x80 [ 103.890108][ T1127] __kmalloc_node_track_caller+0xc7/0x420 [ ... ] Fixes: 11a766ce915f ("net: Increase xmit RECURSION_LIMIT to 10.") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 814152a89ed52c722ab92e9fbabcac3cb8a39245 Author: Yang Yingliang Date: Tue Jun 16 09:39:21 2020 +0000 net: fix memleak in register_netdevice() I got a memleak report when doing some fuzz test: unreferenced object 0xffff888112584000 (size 13599): comm "ip", pid 3048, jiffies 4294911734 (age 343.491s) hex dump (first 32 bytes): 74 61 70 30 00 00 00 00 00 00 00 00 00 00 00 00 tap0............ 00 ee d9 19 81 88 ff ff 00 00 00 00 00 00 00 00 ................ backtrace: [<000000002f60ba65>] __kmalloc_node+0x309/0x3a0 [<0000000075b211ec>] kvmalloc_node+0x7f/0xc0 [<00000000d3a97396>] alloc_netdev_mqs+0x76/0xfc0 [<00000000609c3655>] __tun_chr_ioctl+0x1456/0x3d70 [<000000001127ca24>] ksys_ioctl+0xe5/0x130 [<00000000b7d5e66a>] __x64_sys_ioctl+0x6f/0xb0 [<00000000e1023498>] do_syscall_64+0x56/0xa0 [<000000009ec0eb12>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 unreferenced object 0xffff888111845cc0 (size 8): comm "ip", pid 3048, jiffies 4294911734 (age 343.491s) hex dump (first 8 bytes): 74 61 70 30 00 88 ff ff tap0.... backtrace: [<000000004c159777>] kstrdup+0x35/0x70 [<00000000d8b496ad>] kstrdup_const+0x3d/0x50 [<00000000494e884a>] kvasprintf_const+0xf1/0x180 [<0000000097880a2b>] kobject_set_name_vargs+0x56/0x140 [<000000008fbdfc7b>] dev_set_name+0xab/0xe0 [<000000005b99e3b4>] netdev_register_kobject+0xc0/0x390 [<00000000602704fe>] register_netdevice+0xb61/0x1250 [<000000002b7ca244>] __tun_chr_ioctl+0x1cd1/0x3d70 [<000000001127ca24>] ksys_ioctl+0xe5/0x130 [<00000000b7d5e66a>] __x64_sys_ioctl+0x6f/0xb0 [<00000000e1023498>] do_syscall_64+0x56/0xa0 [<000000009ec0eb12>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 unreferenced object 0xffff88811886d800 (size 512): comm "ip", pid 3048, jiffies 4294911734 (age 343.491s) hex dump (first 32 bytes): 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N.......... ff ff ff ff ff ff ff ff c0 66 3d a3 ff ff ff ff .........f=..... backtrace: [<0000000050315800>] device_add+0x61e/0x1950 [<0000000021008dfb>] netdev_register_kobject+0x17e/0x390 [<00000000602704fe>] register_netdevice+0xb61/0x1250 [<000000002b7ca244>] __tun_chr_ioctl+0x1cd1/0x3d70 [<000000001127ca24>] ksys_ioctl+0xe5/0x130 [<00000000b7d5e66a>] __x64_sys_ioctl+0x6f/0xb0 [<00000000e1023498>] do_syscall_64+0x56/0xa0 [<000000009ec0eb12>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 If call_netdevice_notifiers() failed, then rollback_registered() calls netdev_unregister_kobject() which holds the kobject. The reference cannot be put because the netdev won't be add to todo list, so it will leads a memleak, we need put the reference to avoid memleak. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 1a642ca7f38992b086101fe204a1ae3c90ed8016 Author: Sascha Hauer Date: Tue Jun 16 10:31:40 2020 +0200 net: ethernet: mvneta: Add 2500BaseX support for SoCs without comphy The older SoCs like Armada XP support a 2500BaseX mode in the datasheets referred to as DR-SGMII (Double rated SGMII) or HS-SGMII (High Speed SGMII). This is an upclocked 1000BaseX mode, thus PHY_INTERFACE_MODE_2500BASEX is the appropriate mode define for it. adding support for it merely means writing the correct magic value into the MVNETA_SERDES_CFG register. Signed-off-by: Sascha Hauer Signed-off-by: David S. Miller commit b4748553f53f2971e07d2619f13d461daac0f3bb Author: Sascha Hauer Date: Tue Jun 16 10:31:39 2020 +0200 net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy The MVNETA_SERDES_CFG register is only available on older SoCs like the Armada XP. On newer SoCs like the Armada 38x the fields are moved to comphy. This patch moves the writes to this register next to the comphy initialization, so that depending on the SoC either comphy or MVNETA_SERDES_CFG is configured. With this we no longer write to the MVNETA_SERDES_CFG on SoCs where it doesn't exist. Suggested-by: Russell King Signed-off-by: Sascha Hauer Signed-off-by: David S. Miller commit 0e2c09011d4de4161f615ff860a605a9186cf62a Author: Atish Patra Date: Wed Jun 17 13:37:32 2020 -0700 RISC-V: Acquire mmap lock before invoking walk_page_range As per walk_page_range documentation, mmap lock should be acquired by the caller before invoking walk_page_range. mmap_assert_locked gets triggered without that. The details can be found here. http://lists.infradead.org/pipermail/linux-riscv/2020-June/010335.html Fixes: 395a21ff859c(riscv: add ARCH_HAS_SET_DIRECT_MAP support) Signed-off-by: Atish Patra Reviewed-by: Michel Lespinasse Reviewed-by: Zong Li Signed-off-by: Palmer Dabbelt commit e0d17c842c0f824fd4df9f4688709fc6907201e1 Author: Yash Shah Date: Tue Jun 16 19:33:06 2020 +0530 RISC-V: Don't allow write+exec only page mapping request in mmap As per the table 4.4 of version "20190608-Priv-MSU-Ratified" of the RISC-V instruction set manual[0], the PTE permission bit combination of "write+exec only" is reserved for future use. Hence, don't allow such mapping request in mmap call. An issue is been reported by David Abdurachmanov, that while running stress-ng with "sysbadaddr" argument, RCU stalls are observed on RISC-V specific kernel. This issue arises when the stress-sysbadaddr request for pages with "write+exec only" permission bits and then passes the address obtain from this mmap call to various system call. For the riscv kernel, the mmap call should fail for this particular combination of permission bits since it's not valid. [0]: http://dabbelt.com/~palmer/keep/riscv-isa-manual/riscv-privileged-20190608-1.pdf Signed-off-by: Yash Shah Reported-by: David Abdurachmanov [Palmer: Refer to the latest ISA specification at the only link I could find, and update the terminology.] Signed-off-by: Palmer Dabbelt commit 8a7a3d1d0dcf2bb63dafe7275020420005e13e54 Merge: 7ac98ff024db da9cebe16930 Author: Dave Airlie Date: Fri Jun 19 10:02:28 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-06-17' of git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.8-2020-06-17: amdgpu: - Fix kvfree/kfree mixup - Fix hawaii device id in powertune configuration - Display FP fixes - Documentation fixes amdkfd: - devcgroup check fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200617220733.3773183-1-alexander.deucher@amd.com commit 7ac98ff024db3c4bf95873a4174213a258a9a04e Merge: b3a9e3b9622a 8e68c6340d58 Author: Dave Airlie Date: Fri Jun 19 09:45:47 2020 +1000 Merge tag 'drm-intel-fixes-2020-06-18' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix for timeslicing and virtual engines/unpremptable requests (+ 1 dependency patch) - Fixes into TypeC register programming and interrupt storm detecting - Disable DIP on MST ports with the transcoder clock still on - Avoid missing GT workarounds at reset for HSW and older gens - Fix for unwinding multiple requests missing force restore - Fix encoder type check for DDI vswing sequence - Build warning fixes Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200618124659.GA12342@jlahtine-desk.ger.corp.intel.com commit 10011f7d95dea311c0f2a3ea6725b5a2e97015a8 Author: Eugeniy Paltsev Date: Thu Jun 4 20:39:25 2020 +0300 ARCv2: support loop buffer (LPB) disabling On HS cores, loop buffer (LPB) is programmable in runtime and can be optionally disabled. Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta commit 5e857ce6eae7ca21b2055cca4885545e29228fe2 Merge: 670d0a4b1070 0c389d89abc2 Author: Linus Torvalds Date: Thu Jun 18 12:35:51 2020 -0700 Merge branch 'hch' (maccess patches from Christoph Hellwig) Merge non-faulting memory access cleanups from Christoph Hellwig: "Andrew and I decided to drop the patches implementing your suggested rename of the probe_kernel_* and probe_user_* helpers from -mm as there were way to many conflicts. After -rc1 might be a good time for this as all the conflicts are resolved now" This also adds a type safety checking patch on top of the renaming series to make the subtle behavioral difference between 'get_user()' and 'get_kernel_nofault()' less potentially dangerous and surprising. * emailed patches from Christoph Hellwig : maccess: make get_kernel_nofault() check for minimal type compatibility maccess: rename probe_kernel_address to get_kernel_nofault maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault commit 0c389d89abc28edf70ae847ee2fa55acb267b826 Author: Linus Torvalds Date: Thu Jun 18 12:10:37 2020 -0700 maccess: make get_kernel_nofault() check for minimal type compatibility Now that we've renamed probe_kernel_address() to get_kernel_nofault() and made it look and behave more in line with get_user(), some of the subtle type behavior differences end up being more obvious and possibly dangerous. When you do get_user(val, user_ptr); the type of the access comes from the "user_ptr" part, and the above basically acts as val = *user_ptr; by design (except, of course, for the fact that the actual dereference is done with a user access). Note how in the above case, the type of the end result comes from the pointer argument, and then the value is cast to the type of 'val' as part of the assignment. So the type of the pointer is ultimately the more important type both for the access itself. But 'get_kernel_nofault()' may now _look_ similar, but it behaves very differently. When you do get_kernel_nofault(val, kernel_ptr); it behaves like val = *(typeof(val) *)kernel_ptr; except, of course, for the fact that the actual dereference is done with exception handling so that a faulting access is suppressed and returned as the error code. But note how different the casting behavior of the two superficially similar accesses are: one does the actual access in the size of the type the pointer points to, while the other does the access in the size of the target, and ignores the pointer type entirely. Actually changing get_kernel_nofault() to act like get_user() is almost certainly the right thing to do eventually, but in the meantime this patch adds logit to at least verify that the pointer type is compatible with the type of the result. In many cases, this involves just casting the pointer to 'void *' to make it obvious that the type of the pointer is not the important part. It's not how 'get_user()' acts, but at least the behavioral difference is now obvious and explicit. Cc: Christoph Hellwig Signed-off-by: Linus Torvalds commit f751820bc319a30d31a80fe511d88642aaefcdee Author: Alex Williamson Date: Thu Jun 18 13:07:13 2020 -0600 vfio/type1: Fix migration info capability ID ID 1 is already used by the IOVA range capability, use ID 2. Reported-by: Liu Yi L Fixes: ad721705d09c ("vfio iommu: Add migration capability to report supported features") Reviewed-by: Kirti Wankhede Signed-off-by: Alex Williamson commit 8c31055758bcd567d3c9b0507123c25249108fda Author: Flavio Suligoi Date: Mon Jun 15 09:58:35 2020 +0200 doc: devicetree: bindings: fix spelling mistake Fix typo: "triger" --> "trigger" Acked-by: Guo Ren Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/20200615075835.15202-1-f.suligoi@asem.it Signed-off-by: Rob Herring commit ee470bb25d0dcdf126f586ec0ae6dca66cb340a4 Author: Borislav Petkov Date: Thu Jun 18 20:25:25 2020 +0200 EDAC/amd64: Read back the scrub rate PCI register on F15h Commit: da92110dfdfa ("EDAC, amd64_edac: Extend scrub rate support to F15hM60h") added support for F15h, model 0x60 CPUs but in doing so, missed to read back SCRCTRL PCI config register on F15h CPUs which are *not* model 0x60. Add that read so that doing $ cat /sys/devices/system/edac/mc/mc0/sdram_scrub_rate can show the previously set DRAM scrub rate. Fixes: da92110dfdfa ("EDAC, amd64_edac: Extend scrub rate support to F15hM60h") Reported-by: Anders Andersson Signed-off-by: Borislav Petkov Cc: #v4.4.. Link: https://lkml.kernel.org/r/CAKkunMbNWppx_i6xSdDHLseA2QQmGJqj_crY=NF-GZML5np4Vw@mail.gmail.com commit 9e0dc7b9e1cbc9cd0dc4ab2377c0536d4b18bedc Author: Max Gurtovoy Date: Wed Jun 17 16:02:30 2020 +0300 RDMA/mlx5: Fix integrity enabled QP creation create_flags checks was refactored and broke the creation on integrity enabled QPs and actually broke the NVMe/RDMA and iSER ULP's when using mlx5 driven devices. Fixes: 2978975ce7f1 ("RDMA/mlx5: Process create QP flags in one place") Link: https://lore.kernel.org/r/20200617130230.2846915-1-leon@kernel.org Signed-off-by: Max Gurtovoy Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 25f12ae45fc1931a1dce3cc59f9989a9d87834b0 Author: Christoph Hellwig Date: Wed Jun 17 09:37:55 2020 +0200 maccess: rename probe_kernel_address to get_kernel_nofault Better describe what this helper does, and match the naming of copy_from_kernel_nofault. Also switch the argument order around, so that it acts and looks like get_user(). Signed-off-by: Christoph Hellwig Signed-off-by: Linus Torvalds commit 2c0f5292d5358c2c5576146071d641110c3c1612 Author: Leon Romanovsky Date: Thu Jun 18 14:25:06 2020 +0300 RDMA/mlx5: Remove ECE limitation from the RAW_PACKET QPs Like any other QP type, rely on FW for the RAW_PACKET QPs to decide if ECE is supported or not. This fixes an inability to create RAW_PACKET QPs with latest rdma-core with the ECE support. Fixes: e383085c2425 ("RDMA/mlx5: Set ECE options during QP create") Link: https://lore.kernel.org/r/20200618112507.3453496-2-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d44335572f76020ef473d7977d9fd424e6fc0021 Author: Maor Gottlieb Date: Thu Jun 18 14:25:07 2020 +0300 RDMA/mlx5: Fix remote gid value in query QP Remote gid is not copied to the right address. Fix it by using rdma_ah_set_dgid_raw to copy the remote gid value from the QP context on query QP. Fixes: 70bd7fb87625 ("RDMA/mlx5: Remove manually crafted QP context the query call") Link: https://lore.kernel.org/r/20200618112507.3453496-3-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6c41965d647a97b51ff665c7406ec9435aab7fc1 Author: Leon Romanovsky Date: Wed Jun 17 16:01:48 2020 +0300 RDMA/mlx5: Don't access ib_qp fields in internal destroy QP path destroy_qp_common is called for flows where QP is already created by HW. While it is called from IB/core, the ibqp.* fields will be fully initialized, but it is not the case if this function is called during QP creation. Don't rely on ibqp fields as much as possible and initialize send_cq/recv_cq as temporal solution till all drivers will be converted to IB/core QP allocation scheme. refcount_t: underflow; use-after-free. WARNING: CPU: 1 PID: 5372 at lib/refcount.c:28 refcount_warn_saturate+0xfe/0x1a0 Kernel panic - not syncing: panic_on_warn set ... CPU: 1 PID: 5372 Comm: syz-executor.2 Not tainted 5.5.0-rc5 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Call Trace: mlx5_core_put_rsc+0x70/0x80 destroy_resource_common+0x8e/0xb0 mlx5_core_destroy_qp+0xaf/0x1d0 mlx5_ib_destroy_qp+0xeb0/0x1460 ib_destroy_qp_user+0x2d5/0x7d0 create_qp+0xed3/0x2130 ib_uverbs_create_qp+0x13e/0x190 ? ib_uverbs_ex_create_qp ib_uverbs_write+0xaa5/0xdf0 __vfs_write+0x7c/0x100 ksys_write+0xc8/0x200 do_syscall_64+0x9c/0x390 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 08d53976609a ("RDMA/mlx5: Copy response to the user in one place") Link: https://lore.kernel.org/r/20200617130148.2846643-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d0793c3c61348ac222e5b3b2458cf9dd76917c34 Author: Mauro Carvalho Chehab Date: Mon Jun 15 08:47:06 2020 +0200 docs: dt: minor adjustments at writing-schema.rst There are two literal blocks that aren't mark as such. Mark them, in order to make the document to produce a better html output. While here, also add a SPDX header to it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/14fc680fd6596b277f94bb5a240cc9dfc41d59bf.1592203542.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 6cb69ea53479958f914e03b21bab0ac152b8f949 Author: Mauro Carvalho Chehab Date: Mon Jun 15 08:46:54 2020 +0200 dt: fix reference to olpc,xo1.75-ec.txt This file was converted and renamed. Fixes: 7882d822b3f9 ("dt-bindings: spi: Convert spi-pxa2xx to json-schema") Reviewed-by: Lubomir Rintel Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d0262854582ee754e4b8bd80677d96b3e098ea5c.1592203542.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 9ac2a66158129e27ef19df602efffbd50da0cdef Author: Mauro Carvalho Chehab Date: Mon Jun 15 08:46:53 2020 +0200 dt: Fix broken references to renamed docs Some files got renamed. Those were all fixed automatically by ./scripts/documentation-file-ref-check --fix Reviewed-by: Philipp Zabel Acked-by: Mark Brown Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6866c0d6d10ce36bb151c2d3752a20eb5122c532.1592203542.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit 670d0a4b10704667765f7d18f7592993d02783aa Author: Luc Van Oostenryck Date: Thu Jun 18 00:02:26 2020 +0200 sparse: use identifiers to define address spaces Currently, address spaces in warnings are displayed as '' with 'X' being the address space's arbitrary number. But since sparse v0.6.0-rc1 (late December 2018), sparse allows you to define the address spaces using an identifier instead of a number. This identifier is then directly used in the warnings. So, use the identifiers '__user', '__iomem', '__percpu' & '__rcu' for the corresponding address spaces. The default address space, __kernel, being not displayed in warnings, stays defined as '0'. With this change, warnings that used to be displayed as: cast removes address space '' of expression ... void [noderef] * will now be displayed as: cast removes address space '__user' of expression ... void [noderef] __iomem * This also moves the __kernel annotation to be the first one, since it is quite different from the others because it's the default one, and so: - it's never displayed - it's normally not needed, nor in type annotations, nor in cast between address spaces. The only time it's needed is when it's combined with a typeof to express "the same type as this one but without the address space" - it can't be defined with a name, '0' must be used. So, it seemed strange to me to have it in the middle of the other ones. Signed-off-by: Luc Van Oostenryck Acked-by: Miguel Ojeda Signed-off-by: Linus Torvalds commit 06096cc6c5a84ced929634b0d79376b94c65a4bd Author: Zhenzhong Duan Date: Thu Jun 18 11:21:25 2020 +0800 spi: spidev: fix a potential use-after-free in spidev_release() If an spi device is unbounded from the driver before the release process, there will be an NULL pointer reference when it's referenced in spi_slave_abort(). Fix it by checking it's already freed before reference. Signed-off-by: Zhenzhong Duan Link: https://lore.kernel.org/r/20200618032125.4650-2-zhenzhong.duan@gmail.com Signed-off-by: Mark Brown commit abd42781c3d2155868821f1b947ae45bbc33330d Author: Zhenzhong Duan Date: Thu Jun 18 11:21:24 2020 +0800 spi: spidev: fix a race between spidev_release and spidev_remove Imagine below scene, spidev is referenced after it's freed. spidev_release() spidev_remove() ... spin_lock_irq(&spidev->spi_lock); spidev->spi = NULL; spin_unlock_irq(&spidev->spi_lock); mutex_lock(&device_list_lock); dofree = (spidev->spi == NULL); if (dofree) kfree(spidev); mutex_unlock(&device_list_lock); mutex_lock(&device_list_lock); list_del(&spidev->device_entry); device_destroy(spidev_class, spidev->devt); clear_bit(MINOR(spidev->devt), minors); if (spidev->users == 0) kfree(spidev); mutex_unlock(&device_list_lock); Fix it by resetting spidev->spi in device_list_lock's protection. Signed-off-by: Zhenzhong Duan Link: https://lore.kernel.org/r/20200618032125.4650-1-zhenzhong.duan@gmail.com Signed-off-by: Mark Brown commit d985becff25f0ddc7ef0d143ee9897014abe8d32 Author: Mauro Carvalho Chehab Date: Mon Jun 15 08:46:52 2020 +0200 dt: fix broken links due to txt->yaml renames There are some new broken doc links due to yaml renames at DT. Developers should really run: ./scripts/documentation-file-ref-check in order to solve those issues while submitting patches. This tool can even fix most of the issues with: ./scripts/documentation-file-ref-check --fix Acked-by: Thomas Bogendoerfer Acked-by: Mark Brown Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/0e4a7f0b7efcc8109c8a41a2e13c8adde4d9c6b9.1592203542.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit f2d94b86cdba14c9c98e3f1ce92b161f77523e83 Author: Mauro Carvalho Chehab Date: Mon Jun 15 08:46:51 2020 +0200 dt: update a reference for reneases pcar file renamed to yaml This file was renamed, but its reference at pfc-pinctl.txt is still pointing to the old file. Fixes: 7f7d408e5a00 ("dt-bindings: gpio: rcar: Convert to json-schema") Reviewed-by: Geert Uytterhoeven Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/72d7ec91a60e852d34f3e15bc5faef1f62a8260e.1592203542.git.mchehab+huawei@kernel.org Signed-off-by: Rob Herring commit f141a422159a199f4c8dedb7e0df55b3b2cf16cd Author: Qiushi Wu Date: Sat Jun 13 15:51:58 2020 -0500 ASoC: rockchip: Fix a reference count leak. Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count if pm_runtime_put is not called in error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails. Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller") Signed-off-by: Qiushi Wu Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20200613205158.27296-1-wu000273@umn.edu Signed-off-by: Mark Brown commit 0f1441b44e823a74f3f3780902a113e07c73fbf6 Author: Peter Zijlstra Date: Fri Jun 12 16:05:26 2020 +0200 objtool: Fix noinstr vs KCOV Since many compilers cannot disable KCOV with a function attribute, help it to NOP out any __sanitizer_cov_*() calls injected in noinstr code. This turns: 12: e8 00 00 00 00 callq 17 13: R_X86_64_PLT32 __sanitizer_cov_trace_pc-0x4 into: 12: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 13: R_X86_64_NONE __sanitizer_cov_trace_pc-0x4 Just like recordmcount does. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dmitry Vyukov commit fdabdd0b05e0bdf232340d5da86563ed142a99a7 Author: Peter Zijlstra Date: Fri Jun 12 15:43:00 2020 +0200 objtool: Provide elf_write_{insn,reloc}() This provides infrastructure to rewrite instructions; this is immediately useful for helping out with KCOV-vs-noinstr, but will also come in handy for a bunch of variable sized jump-label patches that are still on ice. Signed-off-by: Peter Zijlstra (Intel) commit 2b10be23ac0f8e107fd575397361ddbaebc2944b Author: Peter Zijlstra Date: Fri Apr 17 23:15:00 2020 +0200 objtool: Clean up elf_write() condition With there being multiple ways to change the ELF data, let's more concisely track modification. Signed-off-by: Peter Zijlstra (Intel) commit 3373a3461aa15b7f9a871fa4cb2c9ef21ac20b47 Author: Zheng Bin Date: Thu Jun 18 12:21:38 2020 +0800 block: make function 'kill_bdev' static kill_bdev does not have any external user, so make it static. Signed-off-by: Zheng Bin Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit f4bd34b139a3fa2808c4205f12714c65e1548c6c Author: Zheng Bin Date: Thu Jun 18 12:21:37 2020 +0800 loop: replace kill_bdev with invalidate_bdev When a filesystem is mounted on a loop device and on a loop ioctl LOOP_SET_STATUS64, because of kill_bdev, buffer_head mappings are getting destroyed. kill_bdev truncate_inode_pages truncate_inode_pages_range do_invalidatepage block_invalidatepage discard_buffer -->clear BH_Mapped flag sb_bread __bread_gfp bh = __getblk_gfp -->discard_buffer clear BH_Mapped flag __bread_slow submit_bh submit_bh_wbc BUG_ON(!buffer_mapped(bh)) --> hit this BUG_ON Fixes: 5db470e229e2 ("loop: drop caches if offset or block_size are changed") Signed-off-by: Zheng Bin Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit b5292111de9bb70cba3489075970889765302136 Author: Kai-Heng Feng Date: Wed Jun 3 15:48:19 2020 +0800 libata: Use per port sync for detach Commit 130f4caf145c ("libata: Ensure ata_port probe has completed before detach") may cause system freeze during suspend. Using async_synchronize_full() in PM callbacks is wrong, since async callbacks that are already scheduled may wait for not-yet-scheduled callbacks, causes a circular dependency. Instead of using big hammer like async_synchronize_full(), use async cookie to make sure port probe are synced, without affecting other scheduled PM callbacks. Fixes: 130f4caf145c ("libata: Ensure ata_port probe has completed before detach") Suggested-by: John Garry Signed-off-by: Kai-Heng Feng Tested-by: John Garry BugLink: https://bugs.launchpad.net/bugs/1867983 Signed-off-by: Jens Axboe commit bc163c2046c5867df7d2b03e85bca29adf83fa32 Author: Andy Shevchenko Date: Wed Apr 22 16:03:17 2020 +0300 partitions/ldm: Replace uuid_copy() with import_uuid() where it makes sense There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting. Signed-off-by: Andy Shevchenko Signed-off-by: Jens Axboe commit e353b325948d04f1305a7b4ad32eca87ba0823a2 Author: Adam Ford Date: Tue May 26 12:09:39 2020 -0500 arm64: dts: imx8mm-beacon: Fix voltages on LDO1 and LDO2 LDO1 and LDO2 settings are wrong and case the voltage to go above the maximum level of 2.15V permitted by the SoC to 3.0V. This patch is based on work done on the i.MX8M Mini-EVK which utilizes the same fix. Fixes: 593816fa2f35 ("arm64: dts: imx: Add Beacon i.MX8m-Mini development kit") Signed-off-by: Adam Ford Reviewed-by: Daniel Baluta Signed-off-by: Shawn Guo commit 6f2cc1664db20676069cff27a461ccc97dbfd114 Author: Xiaoguang Wang Date: Thu Jun 18 15:01:56 2020 +0800 io_uring: fix possible race condition against REQ_F_NEED_CLEANUP In io_read() or io_write(), when io request is submitted successfully, it'll go through the below sequence: kfree(iovec); req->flags &= ~REQ_F_NEED_CLEANUP; return ret; But clearing REQ_F_NEED_CLEANUP might be unsafe. The io request may already have been completed, and then io_complete_rw_iopoll() and io_complete_rw() will be called, both of which will also modify req->flags if needed. This causes a race condition, with concurrent non-atomic modification of req->flags. To eliminate this race, in io_read() or io_write(), if io request is submitted successfully, we don't remove REQ_F_NEED_CLEANUP flag. If REQ_F_NEED_CLEANUP is set, we'll leave __io_req_aux_free() to the iovec cleanup work correspondingly. Cc: stable@vger.kernel.org Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 4121fb0db68ed4de574f9bdc630b75fcc99b4835 Author: Leon Romanovsky Date: Wed Jun 17 09:18:26 2020 +0300 RDMA/core: Check that type_attrs is not NULL prior access In disassociate flow, the type_attrs is set to be NULL, which is in an implicit way is checked in alloc_uobj() by "if (!attrs->context)". Change the logic to rely on that check, to be consistent with other alloc_uobj() places that will fix the following kernel splat. BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 3 PID: 2743 Comm: python3 Not tainted 5.7.0-rc6-for-upstream-perf-2020-05-23_19-04-38-5 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 RIP: 0010:alloc_begin_fd_uobject+0x18/0xf0 [ib_uverbs] Code: 89 43 48 eb 97 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 49 89 f5 41 54 55 48 89 fd 53 48 83 ec 08 48 8b 1f <48> 8b 43 18 48 8b 80 80 00 00 00 48 3d 20 10 33 a0 74 1c 48 3d 30 RSP: 0018:ffffc90001127b70 EFLAGS: 00010282 RAX: ffffffffa0339fe0 RBX: 0000000000000000 RCX: 8000000000000007 RDX: fffffffffffffffb RSI: ffffc90001127d28 RDI: ffff88843fe1f600 RBP: ffff88843fe1f600 R08: ffff888461eb06d8 R09: ffff888461eb06f8 R10: ffff888461eb0700 R11: 0000000000000000 R12: ffff88846a5f6450 R13: ffffc90001127d28 R14: ffff88845d7d6ea0 R15: ffffc90001127cb8 FS: 00007f469bff1540(0000) GS:ffff88846f980000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 0000000450018003 CR4: 0000000000760ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ? xa_store+0x28/0x40 rdma_alloc_begin_uobject+0x4f/0x90 [ib_uverbs] ib_uverbs_create_comp_channel+0x87/0xf0 [ib_uverbs] ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xb1/0xf0 [ib_uverbs] ib_uverbs_cmd_verbs.isra.8+0x96d/0xae0 [ib_uverbs] ? get_page_from_freelist+0x3bb/0xf70 ? _copy_to_user+0x22/0x30 ? uverbs_disassociate_api+0xd0/0xd0 [ib_uverbs] ? __wake_up_common_lock+0x87/0xc0 ib_uverbs_ioctl+0xbc/0x130 [ib_uverbs] ksys_ioctl+0x83/0xc0 ? ksys_write+0x55/0xd0 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x48/0x130 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f469ac43267 Fixes: 849e149063bd ("RDMA/core: Do not allow alloc_commit to fail") Link: https://lore.kernel.org/r/20200617061826.2625359-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 3ec5f54f7a0fdf706951f379d3148798325e516f Author: Yangyang Li Date: Tue Jun 16 21:39:38 2020 +0800 RDMA/hns: Fix an cmd queue issue when resetting If a IMP reset caused by some hardware errors and hns RoCE driver reset occurred at the same time, there is a possiblity that the IMP will stop dealing with command and users can't use the hardware. The logs are as follows: hns3 0000:fd:00.1: cleaned 0, need to clean 1 hns3 0000:fd:00.1: firmware version query failed -11 hns3 0000:fd:00.1: Cmd queue init failed hns3 0000:fd:00.1: Upgrade reset level hns3 0000:fd:00.1: global reset interrupt The hns NIC driver divides the reset process into 3 status: initialization, hardware resetting and softwaring restting. RoCE driver gets reset status by interfaces provided by NIC driver and commands will not be sent to the IMP if the driver is in any above status. The main reason for this issue is that there is a time gap between status 1 and 2, if the RoCE driver sends commands to the IMP during this gap, the IMP will stop working because it is not ready. To eliminate the time gap, the hns NIC driver has added a new interface in commit a4de02287abb9 ("net: hns3: provide .get_cmdq_stat interface for the client"), so RoCE driver can ensure that no commands will be sent during resetting. Link: https://lore.kernel.org/r/1592314778-52822-1-git-send-email-liweihang@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 98a6151907cb5512eb6ba8b90644e3ace2d2fc46 Author: Yangyang Li Date: Tue Jun 16 21:37:09 2020 +0800 RDMA/hns: Fix a calltrace when registering MR from userspace ibmr.device is assigned after MR is successfully registered, but both write_mtpt() and frmr_write_mtpt() accesses it during the mr registration process, which may cause the following error when trying to register MR in userspace and pbl_hop_num is set to 0. pc : hns_roce_mtr_find+0xa0/0x200 [hns_roce] lr : set_mtpt_pbl+0x54/0x118 [hns_roce_hw_v2] sp : ffff00023e73ba20 x29: ffff00023e73ba20 x28: ffff00023e73bad8 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000002 x24: 0000000000000000 x23: ffff00023e73bad0 x22: 0000000000000000 x21: ffff0000094d9000 x20: 0000000000000000 x19: ffff8020a6bdb2c0 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0140000000000000 x12: 0040000000000041 x11: ffff000240000000 x10: 0000000000001000 x9 : 0000000000000000 x8 : ffff802fb7558480 x7 : ffff802fb7558480 x6 : 000000000003483d x5 : ffff00023e73bad0 x4 : 0000000000000002 x3 : ffff00023e73bad8 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000094d9708 Call trace: hns_roce_mtr_find+0xa0/0x200 [hns_roce] set_mtpt_pbl+0x54/0x118 [hns_roce_hw_v2] hns_roce_v2_write_mtpt+0x14c/0x168 [hns_roce_hw_v2] hns_roce_mr_enable+0x6c/0x148 [hns_roce] hns_roce_reg_user_mr+0xd8/0x130 [hns_roce] ib_uverbs_reg_mr+0x14c/0x2e0 [ib_uverbs] ib_uverbs_write+0x27c/0x3e8 [ib_uverbs] __vfs_write+0x60/0x190 vfs_write+0xac/0x1c0 ksys_write+0x6c/0xd8 __arm64_sys_write+0x24/0x30 el0_svc_common+0x78/0x130 el0_svc_handler+0x38/0x78 el0_svc+0x8/0xc Solve above issue by adding a pointer of structure hns_roce_dev as a parameter of write_mtpt() and frmr_write_mtpt(), so that both of these functions can access it before finishing MR's registration. Fixes: 9b2cf76c9f05 ("RDMA/hns: Optimize PBL buffer allocation process") Link: https://lore.kernel.org/r/1592314629-51715-1-git-send-email-liweihang@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 6a1515c962b17e2596ae7b9f074fc5685d6b435b Author: Tiezhu Yang Date: Thu Jun 18 10:06:01 2020 +0800 perf build: Fix error message when asking for -fsanitize=address without required libraries When build perf with ASan or UBSan, if libasan or libubsan can not find, the feature-glibc is 0 and there exists the following error log which is wrong, because we can find gnu/libc-version.h in /usr/include, glibc-devel is also installed. [yangtiezhu@linux perf]$ make DEBUG=1 EXTRA_CFLAGS='-fno-omit-frame-pointer -fsanitize=address' BUILD: Doing 'make -j4' parallel build HOSTCC fixdep.o HOSTLD fixdep-in.o LINK fixdep :1:0: warning: -fsanitize=address and -fsanitize=kernel-address are not supported for this target :1:0: warning: -fsanitize=address not supported for this target Auto-detecting system features: ... dwarf: [ OFF ] ... dwarf_getlocations: [ OFF ] ... glibc: [ OFF ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libcap: [ OFF ] ... libelf: [ OFF ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libcrypto: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ OFF ] ... bpf: [ OFF ] ... libaio: [ OFF ] ... libzstd: [ OFF ] ... disassembler-four-args: [ OFF ] Makefile.config:393: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop. Makefile.perf:224: recipe for target 'sub-make' failed make[1]: *** [sub-make] Error 2 Makefile:69: recipe for target 'all' failed make: *** [all] Error 2 [yangtiezhu@linux perf]$ ls /usr/include/gnu/libc-version.h /usr/include/gnu/libc-version.h After install libasan and libubsan, the feature-glibc is 1 and the build process is success, so the cause is related with libasan or libubsan, we should check them and print an error log to reflect the reality. Committer testing: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf $ make DEBUG=1 EXTRA_CFLAGS='-fno-omit-frame-pointer -fsanitize=address' O=/tmp/build/perf -C tools/perf/ install-bin make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j12' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Auto-detecting system features: ... dwarf: [ OFF ] ... dwarf_getlocations: [ OFF ] ... glibc: [ OFF ] ... gtk2: [ OFF ] ... libbfd: [ OFF ] ... libcap: [ OFF ] ... libelf: [ OFF ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libcrypto: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ OFF ] ... bpf: [ OFF ] ... libaio: [ OFF ] ... libzstd: [ OFF ] ... disassembler-four-args: [ OFF ] Makefile.config:401: *** No libasan found, please install libasan. Stop. make[1]: *** [Makefile.perf:231: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 make: Leaving directory '/home/acme/git/perf/tools/perf' $ $ $ sudo dnf install libasan Installed: libasan-9.3.1-2.fc31.x86_64 $ $ $ make DEBUG=1 EXTRA_CFLAGS='-fno-omit-frame-pointer -fsanitize=address' O=/tmp/build/perf -C tools/perf/ install-bin make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j12' parallel build Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libbfd: [ on ] ... libcap: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ on ] ... disassembler-four-args: [ on ] CC /tmp/build/perf/util/pmu-flex.o FLEX /tmp/build/perf/util/expr-flex.c CC /tmp/build/perf/util/expr-bison.o CC /tmp/build/perf/util/expr.o CC /tmp/build/perf/util/expr-flex.o CC /tmp/build/perf/util/parse-events-flex.o CC /tmp/build/perf/util/parse-events.o LD /tmp/build/perf/util/intel-pt-decoder/perf-in.o LD /tmp/build/perf/util/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf INSTALL python-scripts INSTALL perf_completion-script INSTALL perf-tip make: Leaving directory '/home/acme/git/perf/tools/perf' $ ldd ~/bin/perf | grep asan libasan.so.5 => /lib64/libasan.so.5 (0x00007f0904164000) $ And if we rebuild without -fsanitize-address: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf $ make O=/tmp/build/perf -C tools/perf/ install-bin make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j12' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libbfd: [ on ] ... libcap: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ on ] ... disassembler-four-args: [ on ] GEN /tmp/build/perf/common-cmds.h CC /tmp/build/perf/exec-cmd.o INSTALL perf_completion-script INSTALL perf-tip make: Leaving directory '/home/acme/git/perf/tools/perf' $ ldd ~/bin/perf | grep asan $ Signed-off-by: Tiezhu Yang Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: tiezhu yang Cc: xuefeng li Link: http://lore.kernel.org/lkml/1592445961-28044-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 1b20d9491cf9cf180f1f2a46c80d69af0f775d55 Author: Steven Rostedt (VMware) Date: Tue Mar 24 16:08:48 2020 -0400 tools lib traceevent: Add handler for __builtin_expect() In order to move pointer checks like IS_ERR_VALUE() out of the hotpath and into the reader path of a trace event, user space tools need to be able to parse that. IS_ERR_VALUE() is defined as: #define IS_ERR_VALUE() unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) Which eventually turns into: __builtin_expect(!!((unsigned long)(void *)(x) >= (unsigned long)-4095), 0) Now the traceevent parser can handle most of that except for the __builtin_expect(), which needs to be added. Link: https://lore.kernel.org/linux-mm/20200320055823.27089-3-jaewon31.kim@samsung.com/ Signed-off-by: Steven Rostedt (VMware) Cc: Andrew Morton Cc: Jaewon Kim Cc: Jiri Olsa Cc: Kees Kook Cc: Namhyung Kim Cc: Vlastimil Babka Cc: linux-mm@kvack.org Cc: linux-trace-devel@vger.kernel.org Link: http://lore.kernel.org/lkml/20200324200956.821799393@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo commit 74621d929d944529a5e2878a84f48bfa6fb69a66 Author: Steven Rostedt (VMware) Date: Tue Mar 24 16:08:47 2020 -0400 tools lib traceevent: Handle __attribute__((user)) in field names Commit c61f13eaa1ee1 ("gcc-plugins: Add structleak for more stack initialization") added "__attribute__((user))" to the user when stackleak detector is enabled. This now appears in the field format of system call trace events for system calls that have user buffers. The "__attribute__((user))" breaks the parsing in libtraceevent. That needs to be handled. Signed-off-by: Steven Rostedt (VMware) Cc: Andrew Morton Cc: Jaewon Kim Cc: Jiri Olsa Cc: Kees Kook Cc: Namhyung Kim Cc: Vlastimil Babka Cc: linux-mm@kvack.org Cc: linux-trace-devel@vger.kernel.org Link: http://lore.kernel.org/lkml/20200324200956.663647256@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo commit 27d4d336f2872193e90ee5450559e1699fae0f6d Author: Steven Rostedt (VMware) Date: Tue Mar 24 16:08:46 2020 -0400 tools lib traceevent: Add append() function helper for appending strings There's several locations that open code realloc and strcat() to append text to strings. Add an append() function that takes a delimiter and a string to append to another string. Signed-off-by: Steven Rostedt (VMware) Cc: Andrew Morton Cc: Jaewon Lim Cc: Jiri Olsa Cc: Kees Kook Cc: linux-mm@kvack.org Cc: linux-trace-devel@vger.kernel.org Cc: Namhyung Kim Cc: Vlastimil Babka Link: http://lore.kernel.org/lkml/20200324200956.515118403@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo commit ab183d460daac6292cb0cfd989d88b37b2437844 Author: Leon Romanovsky Date: Tue Jun 16 13:45:36 2020 +0300 RDMA/mlx5: Add missed RST2INIT and INIT2INIT steps during ECE handshake Missed steps during ECE handshake left userspace application with less options for the ECE handshake. Pass ECE options in the additional transitions. Fixes: 50aec2c3135e ("RDMA/mlx5: Return ECE data after modify QP") Link: https://lore.kernel.org/r/20200616104536.2426384-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 730c8912484186d4623d0c76509066d285c3a755 Author: Mark Zhang Date: Tue Jun 16 13:43:04 2020 +0300 RDMA/cma: Protect bind_list and listen_list while finding matching cm id The bind_list and listen_list must be accessed under a lock, add the missing locking around the access in cm_ib_id_from_event() In addition add lockdep asserts to make it clearer what the locking semantic is here. general protection fault: 0000 [#1] SMP NOPTI CPU: 226 PID: 126135 Comm: kworker/226:1 Tainted: G OE 4.12.14-150.47-default #1 SLE15 Hardware name: Cray Inc. Windom/Windom, BIOS 0.8.7 01-10-2020 Workqueue: ib_cm cm_work_handler [ib_cm] task: ffff9c5a60a1d2c0 task.stack: ffffc1d91f554000 RIP: 0010:cma_ib_req_handler+0x3f1/0x11b0 [rdma_cm] RSP: 0018:ffffc1d91f557b40 EFLAGS: 00010286 RAX: deacffffffffff30 RBX: 0000000000000001 RCX: ffff9c2af5bb6000 RDX: 00000000000000a9 RSI: ffff9c5aa4ed2f10 RDI: ffffc1d91f557b08 RBP: ffffc1d91f557d90 R08: ffff9c340cc80000 R09: ffff9c2c0f901900 R10: 0000000000000000 R11: 0000000000000001 R12: deacffffffffff30 R13: ffff9c5a48aeec00 R14: ffffc1d91f557c30 R15: ffff9c5c2eea3688 FS: 0000000000000000(0000) GS:ffff9c5c2fa80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00002b5cc03fa320 CR3: 0000003f8500a000 CR4: 00000000003406e0 Call Trace: ? rdma_addr_cancel+0xa0/0xa0 [ib_core] ? cm_process_work+0x28/0x140 [ib_cm] cm_process_work+0x28/0x140 [ib_cm] ? cm_get_bth_pkey.isra.44+0x34/0xa0 [ib_cm] cm_work_handler+0xa06/0x1a6f [ib_cm] ? __switch_to_asm+0x34/0x70 ? __switch_to_asm+0x34/0x70 ? __switch_to_asm+0x40/0x70 ? __switch_to_asm+0x34/0x70 ? __switch_to_asm+0x40/0x70 ? __switch_to_asm+0x34/0x70 ? __switch_to_asm+0x40/0x70 ? __switch_to+0x7c/0x4b0 ? __switch_to_asm+0x40/0x70 ? __switch_to_asm+0x34/0x70 process_one_work+0x1da/0x400 worker_thread+0x2b/0x3f0 ? process_one_work+0x400/0x400 kthread+0x118/0x140 ? kthread_create_on_node+0x40/0x40 ret_from_fork+0x22/0x40 Code: 00 66 83 f8 02 0f 84 ca 05 00 00 49 8b 84 24 d0 01 00 00 48 85 c0 0f 84 68 07 00 00 48 2d d0 01 00 00 49 89 c4 0f 84 59 07 00 00 <41> 0f b7 44 24 20 49 8b 77 50 66 83 f8 0a 75 9e 49 8b 7c 24 28 Fixes: 4c21b5bcef73 ("IB/cma: Add net_dev and private data checks to RDMA CM") Link: https://lore.kernel.org/r/20200616104304.2426081-1-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0dfbd5ecf28cbcb81674c49d34ee97366db1be44 Author: Michal Kalderon Date: Tue Jun 16 12:34:08 2020 +0300 RDMA/qedr: Fix KASAN: use-after-free in ucma_event_handler+0x532 Private data passed to iwarp_cm_handler is copied for connection request / response, but ignored otherwise. If junk is passed, it is stored in the event and used later in the event processing. The driver passes an old junk pointer during connection close which leads to a use-after-free on event processing. Set private data to NULL for events that don 't have private data. BUG: KASAN: use-after-free in ucma_event_handler+0x532/0x560 [rdma_ucm] kernel: Read of size 4 at addr ffff8886caa71200 by task kworker/u128:1/5250 kernel: kernel: Workqueue: iw_cm_wq cm_work_handler [iw_cm] kernel: Call Trace: kernel: dump_stack+0x8c/0xc0 kernel: print_address_description.constprop.0+0x1b/0x210 kernel: ? ucma_event_handler+0x532/0x560 [rdma_ucm] kernel: ? ucma_event_handler+0x532/0x560 [rdma_ucm] kernel: __kasan_report.cold+0x1a/0x33 kernel: ? ucma_event_handler+0x532/0x560 [rdma_ucm] kernel: kasan_report+0xe/0x20 kernel: check_memory_region+0x130/0x1a0 kernel: memcpy+0x20/0x50 kernel: ucma_event_handler+0x532/0x560 [rdma_ucm] kernel: ? __rpc_execute+0x608/0x620 [sunrpc] kernel: cma_iw_handler+0x212/0x330 [rdma_cm] kernel: ? iw_conn_req_handler+0x6e0/0x6e0 [rdma_cm] kernel: ? enqueue_timer+0x86/0x140 kernel: ? _raw_write_lock_irq+0xd0/0xd0 kernel: cm_work_handler+0xd3d/0x1070 [iw_cm] Fixes: e411e0587e0d ("RDMA/qedr: Add iWARP connection management functions") Link: https://lore.kernel.org/r/20200616093408.17827-1-michal.kalderon@marvell.com Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Jason Gunthorpe commit 0133654d8eb8607eacc96badfe49bf992155f4cb Author: Gal Pressman Date: Sun Jun 14 13:35:34 2020 +0300 RDMA/efa: Set maximum pkeys device attribute The max_pkeys device attribute was not set in query device verb, set it to one in order to account for the default pkey (0xffff). This information is exposed to userspace and can cause malfunction Fixes: 40909f664d27 ("RDMA/efa: Add EFA verbs implementation") Link: https://lore.kernel.org/r/20200614103534.88060-1-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit 90a239ee25fa3a483facec3de7c144361a3d3a51 Author: Aditya Pakki Date: Sat Jun 13 23:11:48 2020 -0500 RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq In case of failure of alloc_ud_wq_attr(), the memory allocated by rvt_alloc_rq() is not freed. Fix it by calling rvt_free_rq() using the existing clean-up code. Fixes: d310c4bf8aea ("IB/{rdmavt, hfi1, qib}: Remove AH refcount for UD QPs") Link: https://lore.kernel.org/r/20200614041148.131983-1-pakki001@umn.edu Signed-off-by: Aditya Pakki Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 1ea7c546b8b3f27bf7da673c265b09c8f79d11bc Author: Leon Romanovsky Date: Thu Jun 11 16:00:45 2020 +0300 RDMA/core: Annotate CMA unlock helper routine Fix the following sparse error by adding annotation to cm_queue_work_unlock() that it releases cm_id_priv->lock lock. drivers/infiniband/core/cm.c:936:24: warning: context imbalance in 'cm_queue_work_unlock' - unexpected unlock Fixes: e83f195aa45c ("RDMA/cm: Pull duplicated code into cm_queue_work_unlock()") Link: https://lore.kernel.org/r/20200611130045.1994026-1-leon@kernel.org Reported-by: kernel test robot Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9f7041b71a2f5defc1629368e7dbe83a9c6ea388 Author: Ravulapati Vishnu vardhan rao Date: Thu Jun 18 12:56:52 2020 +0530 ASoC: amd: closing specific instance. The steps to reproduce: Record from the internal mic : (arecord -D hw:1,2 -f dat /dev/null -V stereos) Record from the headphone mic: (arecord -D hw:1,0 -f dat /dev/null -V stereos) Kill the recording from internal mic. We can see the recording from the headphone mic is broken. This patch rectifies the issue reported. Signed-off-by: Ravulapati Vishnu vardhan rao Link: https://lore.kernel.org/r/20200618072653.27103-1-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown commit 24ebec25fb270100e252b19c288e21bd7d8cc7f7 Author: Will Deacon Date: Fri May 29 14:12:18 2020 +0100 arm64: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints Unprivileged memory accesses generated by the so-called "translated" instructions (e.g. STTR) at EL1 can cause EL0 watchpoints to fire unexpectedly if kernel debugging is enabled. In such cases, the hw_breakpoint logic will invoke the user overflow handler which will typically raise a SIGTRAP back to the current task. This is futile when returning back to the kernel because (a) the signal won't have been delivered and (b) userspace can't handle the thing anyway. Avoid invoking the user overflow handler for watchpoints triggered by kernel uaccess routines, and instead single-step over the faulting instruction as we would if no overflow handler had been installed. (Fixes tag identifies the introduction of unprivileged memory accesses, which exposed this latent bug in the hw_breakpoint code) Cc: Catalin Marinas Cc: James Morse Fixes: 57f4959bad0a ("arm64: kernel: Add support for User Access Override") Reported-by: Luis Machado Signed-off-by: Will Deacon commit bf508ec95ca3b902f14bb311a7709e5cb57fbc49 Author: Gustavo A. R. Silva Date: Wed Jun 17 16:34:07 2020 -0500 arm64: kexec_file: Use struct_size() in kmalloc() Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200617213407.GA1385@embeddedor Signed-off-by: Will Deacon commit a13b9d0b97211579ea63b96c606de79b963c0f47 Author: Kees Cook Date: Mon Jun 8 20:15:09 2020 -0700 x86/cpu: Use pinning mask for CR4 bits needing to be 0 The X86_CR4_FSGSBASE bit of CR4 should not change after boot[1]. Older kernels should enforce this bit to zero, and newer kernels need to enforce it depending on boot-time configuration (e.g. "nofsgsbase"). To support a pinned bit being either 1 or 0, use an explicit mask in combination with the expected pinned bit values. [1] https://lore.kernel.org/lkml/20200527103147.GI325280@hirez.programming.kicks-ass.net Signed-off-by: Kees Cook Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/202006082013.71E29A42@keescook commit 618e07865b7453d02410c1f3407c2d78a670eabb Author: Barry Song Date: Thu Jun 18 09:58:28 2020 +1200 arm64: mm: reserve hugetlb CMA after numa_init hugetlb_cma_reserve() is called at the wrong place. numa_init has not been done yet. so all reserved memory will be located at node0. Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") Signed-off-by: Barry Song Reviewed-by: Anshuman Khandual Acked-by: Roman Gushchin Cc: Matthias Brugger Cc: Will Deacon Link: https://lore.kernel.org/r/20200617215828.25296-1-song.bao.hua@hisilicon.com Signed-off-by: Will Deacon commit f097eb38f71391ff2cf078788bad5a00eb3bd96a Author: Kurt Kanzenbach Date: Tue Jun 9 10:17:26 2020 +0200 timekeeping: Fix kerneldoc system_device_crosststamp & al Make kernel doc comments actually work and fix the syncronized typo. [ tglx: Added the missing /** and fixed up formatting ] Signed-off-by: Kurt Kanzenbach Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200609081726.5657-1-kurt@linutronix.de commit 302c570bf36e997d55ad0d60628a2feec76954a4 Author: Li Jun Date: Thu Jun 4 19:21:18 2020 +0800 usb: typec: tcpci_rt1711h: avoid screaming irq causing boot hangs John reported screaming irq caused by rt1711h when system boot[1], this is because irq request is done before tcpci_register_port(), so the chip->tcpci has not been setup, irq handler is entered but can't do anything, this patch is to address this by moving the irq request after tcpci_register_port(). [1] https://lore.kernel.org/linux-usb/20200530040157.31038-1-john.stultz@linaro.org Fixes: ce08eaeb6388 ("staging: typec: rt1711h typec chip driver") Cc: stable # v4.18+ Cc: John Stultz Reported-and-tested-by: John Stultz Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Link: https://lore.kernel.org/r/20200604112118.38062-1-jun.li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 07c112fb09c86c0231f6ff0061a000ffe91c8eb9 Author: Chuhong Yuan Date: Wed Jun 10 10:48:44 2020 +0800 USB: ohci-sm501: Add missed iounmap() in remove This driver misses calling iounmap() in remove to undo the ioremap() called in probe. Add the missed call to fix it. Fixes: f54aab6ebcec ("usb: ohci-sm501 driver") Cc: stable Signed-off-by: Chuhong Yuan Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200610024844.3628408-1-hslester96@gmail.com Signed-off-by: Greg Kroah-Hartman commit 03894573f2913181ee5aae0089f333b2131f2d4b Author: Joakim Tjernlund Date: Fri Jun 5 12:54:18 2020 +0200 cdc-acm: Add DISABLE_ECHO quirk for Microchip/SMSC chip USB_DEVICE(0x0424, 0x274e) can send data before cdc_acm is ready, causing garbage chars on the TTY causing stray input to the shell and/or login prompt. Signed-off-by: Joakim Tjernlund Cc: stable@vger.kernel.org Acked-by: Oliver Neukum Link: https://lore.kernel.org/r/20200605105418.22263-1-joakim.tjernlund@infinera.com Signed-off-by: Greg Kroah-Hartman commit 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 Author: Longfang Liu Date: Mon Jun 8 11:46:59 2020 +0800 USB: ehci: reopen solution for Synopsys HC bug A Synopsys USB2.0 core used in Huawei Kunpeng920 SoC has a bug which might cause the host controller not issuing ping. Bug description: After indicating an Interrupt on Async Advance, the software uses the doorbell mechanism to delete the Next Link queue head of the last executed queue head. At this time, the host controller still references the removed queue head(the queue head is NULL). NULL reference causes the host controller to lose the USB device. Solution: After deleting the Next Link queue head, when has_synopsys_hc_bug set to 1,the software can write one of the valid queue head addresses to the ASYNCLISTADDR register to allow the host controller to get the valid queue head. in order to solve that problem, this patch set the flag for Huawei Kunpeng920 There are detailed instructions and solutions in this patch: commit 2f7ac6c19997 ("USB: ehci: add workaround for Synopsys HC bug") Signed-off-by: Longfang Liu Cc: stable Acked-by: Alan Stern Link: https://lore.kernel.org/r/1591588019-44284-1-git-send-email-liulongfang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 28ebeb8db77035e058a510ce9bd17c2b9a009dba Author: Zqiang Date: Fri Jun 12 11:52:10 2020 +0800 usb: usbtest: fix missing kfree(dev->buf) in usbtest_disconnect BUG: memory leak unreferenced object 0xffff888055046e00 (size 256): comm "kworker/2:9", pid 2570, jiffies 4294942129 (age 1095.500s) hex dump (first 32 bytes): 00 70 04 55 80 88 ff ff 18 bb 5a 81 ff ff ff ff .p.U......Z..... f5 96 78 81 ff ff ff ff 37 de 8e 81 ff ff ff ff ..x.....7....... backtrace: [<00000000d121dccf>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline] [<00000000d121dccf>] slab_post_alloc_hook mm/slab.h:586 [inline] [<00000000d121dccf>] slab_alloc_node mm/slub.c:2786 [inline] [<00000000d121dccf>] slab_alloc mm/slub.c:2794 [inline] [<00000000d121dccf>] kmem_cache_alloc_trace+0x15e/0x2d0 mm/slub.c:2811 [<000000005c3c3381>] kmalloc include/linux/slab.h:555 [inline] [<000000005c3c3381>] usbtest_probe+0x286/0x19d0 drivers/usb/misc/usbtest.c:2790 [<000000001cec6910>] usb_probe_interface+0x2bd/0x870 drivers/usb/core/driver.c:361 [<000000007806c118>] really_probe+0x48d/0x8f0 drivers/base/dd.c:551 [<00000000a3308c3e>] driver_probe_device+0xfc/0x2a0 drivers/base/dd.c:724 [<000000003ef66004>] __device_attach_driver+0x1b6/0x240 drivers/base/dd.c:831 [<00000000eee53e97>] bus_for_each_drv+0x14e/0x1e0 drivers/base/bus.c:431 [<00000000bb0648d0>] __device_attach+0x1f9/0x350 drivers/base/dd.c:897 [<00000000838b324a>] device_initial_probe+0x1a/0x20 drivers/base/dd.c:944 [<0000000030d501c1>] bus_probe_device+0x1e1/0x280 drivers/base/bus.c:491 [<000000005bd7adef>] device_add+0x131d/0x1c40 drivers/base/core.c:2504 [<00000000a0937814>] usb_set_configuration+0xe84/0x1ab0 drivers/usb/core/message.c:2030 [<00000000e3934741>] generic_probe+0x6a/0xe0 drivers/usb/core/generic.c:210 [<0000000098ade0f1>] usb_probe_device+0x90/0xd0 drivers/usb/core/driver.c:266 [<000000007806c118>] really_probe+0x48d/0x8f0 drivers/base/dd.c:551 [<00000000a3308c3e>] driver_probe_device+0xfc/0x2a0 drivers/base/dd.c:724 Acked-by: Alan Stern Reported-by: Kyungtae Kim Signed-off-by: Zqiang Link: https://lore.kernel.org/r/20200612035210.20494-1-qiang.zhang@windriver.com Signed-off-by: Greg Kroah-Hartman commit 207324a321a866401b098cadf19e4a2dd6584622 Author: Minas Harutyunyan Date: Tue Jun 9 12:28:11 2020 +0400 usb: dwc2: Postponed gadget registration to the udc class driver During dwc2 driver probe, after gadget registration to the udc class driver, if exist any builtin function driver it immediately bound to dwc2 and after init host side (dwc2_hcd_init()) stucked in host mode. Patch postpone gadget registration after host side initialization done. Fixes: 117777b2c3bb9 ("usb: dwc2: Move gadget probe function into platform code") Reported-by: kbuild test robot Tested-by: Marek Vasut Cc: stable Signed-off-by: Minas Harutyunyan Link: https://lore.kernel.org/r/f21cb38fecc72a230b86155d94c7e60c9cb66f58.1591690938.git.hminas@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 5d8021923e8a8cc37a421a64e27c7221f0fee33c Author: Tomasz Meresiński Date: Wed Jun 3 22:33:46 2020 +0200 usb: add USB_QUIRK_DELAY_INIT for Logitech C922 The Logitech C922, just like other Logitech webcams, needs the USB_QUIRK_DELAY_INIT or it will randomly not respond after device connection Signed-off-by: Tomasz Meresiński Cc: stable Link: https://lore.kernel.org/r/20200603203347.7792-1-tomasz@meresinski.eu Signed-off-by: Greg Kroah-Hartman commit 44ed240d62736ad29943ec01e41e194b96f7c5e9 Author: Tang Bin Date: Tue Jun 2 19:47:08 2020 +0800 usb: host: ehci-exynos: Fix error check in exynos_ehci_probe() If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in exynos_ehci_probe(). And when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Fixes: 1bcc5aa87f04 ("USB: Add initial S5P EHCI driver") Cc: stable Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200602114708.28620-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 130206a88683d859f63ed6d4a56ab5c2b4930c8e Author: Heikki Krogerus Date: Fri May 29 16:17:53 2020 +0300 usb: typec: mux: intel_pmc_mux: Fix DP alternate mode entry The PMC needs to be notified separately about HPD (hotplug detected) signal being high after mode entry. There is a bit "HPD High" in the Alternate Mode Request that the driver already sets, but that bit is only valid when the DisplayPort Alternate Mode is directly entered from disconnected state. Fixes: 5c4edcdbcd97 ("usb: typec: mux: intel: Fix DP_HPD_LVL bit field") Signed-off-by: Heikki Krogerus Cc: stable Tested-by: Prashant Malani Link: https://lore.kernel.org/r/20200529131753.15587-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3d19946b509c494672b46143b20d6dd8a02f5bb6 Author: Fabio Estevam Date: Fri May 29 07:42:34 2020 -0300 Documentation: ABI: usb: chipidea: Update Li Jun's e-mail The freescale.com e-mail domain is no longer active for quite some time. Switch Li Jun's e-mail address to the NXP domain. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200529104234.25136-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit d50313a5a0d803bcf55121a2b82086633060d05e Author: Pierre-Louis Bossart Date: Wed Jun 17 11:49:09 2020 -0500 ALSA: hda: Intel: add missing PCI IDs for ICL-H, TGL-H and EKL Mirror PCI ids used for SOF. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200617164909.18225-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 774911290c589e98e3638e73b24b0a4d4530e97c Author: Christian Borntraeger Date: Wed Jun 17 10:36:20 2020 +0200 KVM: s390: reduce number of IO pins to 1 The current number of KVM_IRQCHIP_NUM_PINS results in an order 3 allocation (32kb) for each guest start/restart. This can result in OOM killer activity even with free swap when the memory is fragmented enough: kernel: qemu-system-s39 invoked oom-killer: gfp_mask=0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), order=3, oom_score_adj=0 kernel: CPU: 1 PID: 357274 Comm: qemu-system-s39 Kdump: loaded Not tainted 5.4.0-29-generic #33-Ubuntu kernel: Hardware name: IBM 8562 T02 Z06 (LPAR) kernel: Call Trace: kernel: ([<00000001f848fe2a>] show_stack+0x7a/0xc0) kernel: [<00000001f8d3437a>] dump_stack+0x8a/0xc0 kernel: [<00000001f8687032>] dump_header+0x62/0x258 kernel: [<00000001f8686122>] oom_kill_process+0x172/0x180 kernel: [<00000001f8686abe>] out_of_memory+0xee/0x580 kernel: [<00000001f86e66b8>] __alloc_pages_slowpath+0xd18/0xe90 kernel: [<00000001f86e6ad4>] __alloc_pages_nodemask+0x2a4/0x320 kernel: [<00000001f86b1ab4>] kmalloc_order+0x34/0xb0 kernel: [<00000001f86b1b62>] kmalloc_order_trace+0x32/0xe0 kernel: [<00000001f84bb806>] kvm_set_irq_routing+0xa6/0x2e0 kernel: [<00000001f84c99a4>] kvm_arch_vm_ioctl+0x544/0x9e0 kernel: [<00000001f84b8936>] kvm_vm_ioctl+0x396/0x760 kernel: [<00000001f875df66>] do_vfs_ioctl+0x376/0x690 kernel: [<00000001f875e304>] ksys_ioctl+0x84/0xb0 kernel: [<00000001f875e39a>] __s390x_sys_ioctl+0x2a/0x40 kernel: [<00000001f8d55424>] system_call+0xd8/0x2c8 As far as I can tell s390x does not use the iopins as we bail our for anything other than KVM_IRQ_ROUTING_S390_ADAPTER and the chip/pin is only used for KVM_IRQ_ROUTING_IRQCHIP. So let us use a small number to reduce the memory footprint. Signed-off-by: Christian Borntraeger Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/20200617083620.5409-1-borntraeger@de.ibm.com commit cfb12c8952f617df58d73d24161e539a035d82b0 Author: Robin Gong Date: Fri May 22 18:44:51 2020 +0800 arm64: dts: imx8mn-ddr4-evk: correct ldo1/ldo2 voltage range Correct ldo1 voltage range from wrong high group(3.0V~3.3V) to low group (1.6V~1.9V) because the ldo1 should be 1.8V. Actually, two voltage groups have been supported at bd718x7-regulator driver, hence, just corrrect the voltage range to 1.6V~3.3V. For ldo2@0.8V, correct voltage range too. Otherwise, ldo1 would be kept @3.0V and ldo2@0.9V which violate i.mx8mn datasheet as the below warning log in kernel: [ 0.995524] LDO1: Bringing 1800000uV into 3000000-3000000uV [ 0.999196] LDO2: Bringing 800000uV into 900000-900000uV Fixes: 3e44dd09736d ("arm64: dts: imx8mn-ddr4-evk: Add rohm,bd71847 PMIC support") Cc: stable@vger.kernel.org Signed-off-by: Robin Gong Reviewed-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 4fd6b5735c03c0955d93960d31f17d7144f5578f Author: Robin Gong Date: Fri May 22 18:44:50 2020 +0800 arm64: dts: imx8mm-evk: correct ldo1/ldo2 voltage range Correct ldo1 voltage range from wrong high group(3.0V~3.3V) to low group (1.6V~1.9V) because the ldo1 should be 1.8V. Actually, two voltage groups have been supported at bd718x7-regulator driver, hence, just corrrect the voltage range to 1.6V~3.3V. For ldo2@0.8V, correct voltage range too. Otherwise, ldo1 would be kept @3.0V and ldo2@0.9V which violate i.mx8mm datasheet as the below warning log in kernel: [ 0.995524] LDO1: Bringing 1800000uV into 3000000-3000000uV [ 0.999196] LDO2: Bringing 800000uV into 900000-900000uV Fixes: 78cc25fa265d ("arm64: dts: imx8mm-evk: Add BD71847 PMIC") Cc: stable@vger.kernel.org Signed-off-by: Robin Gong Reviewed-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e04ec0de61c1eb9693179093e83ab8ca68a30d08 Author: Daniel Jordan Date: Mon Jun 8 17:26:52 2020 -0400 padata: upgrade smp_mb__after_atomic to smp_mb in padata_do_serial A 5.7 kernel hangs during a tcrypt test of padata that waits for an AEAD request to finish. This is only seen on large machines running many concurrent requests. The issue is that padata never serializes the request. The removal of the reorder_objects atomic missed that the memory barrier in padata_do_serial() depends on it. Upgrade the barrier from smp_mb__after_atomic to smp_mb to get correct ordering again. Fixes: 3facced7aeed1 ("padata: remove reorder_objects") Signed-off-by: Daniel Jordan Cc: Steffen Klassert Cc: linux-kernel@vger.kernel.org Cc: Signed-off-by: Herbert Xu commit 34c86f4c4a7be3b3e35aa48bd18299d4c756064d Author: Herbert Xu Date: Mon Jun 8 16:48:43 2020 +1000 crypto: af_alg - fix use-after-free in af_alg_accept() due to bh_lock_sock() The locking in af_alg_release_parent is broken as the BH socket lock can only be taken if there is a code-path to handle the case where the lock is owned by process-context. Instead of adding such handling, we can fix this by changing the ref counts to atomic_t. This patch also modifies the main refcnt to include both normal and nokey sockets. This way we don't have to fudge the nokey ref count when a socket changes from nokey to normal. Credits go to Mauricio Faria de Oliveira who diagnosed this bug and sent a patch for it: https://lore.kernel.org/linux-crypto/20200605161657.535043-1-mfo@canonical.com/ Reported-by: Brian Moyles Reported-by: Mauricio Faria de Oliveira Fixes: 37f96694cf73 ("crypto: af_alg - Use bh_lock_sock in...") Cc: Signed-off-by: Herbert Xu commit fe35ec58f0d339221643287bbb7cee15c93a5389 Author: Weiping Zhang Date: Wed Jun 17 14:18:37 2020 +0800 block: update hctx map when use multiple maps There is an issue when tune the number for read and write queues, if the total queue count was not changed. The hctx->type cannot be updated, since __blk_mq_update_nr_hw_queues will return directly if the total queue count has not been changed. Reproduce: dmesg | grep "default/read/poll" [ 2.607459] nvme nvme0: 48/0/0 default/read/poll queues cat /sys/kernel/debug/block/nvme0n1/hctx*/type | sort | uniq -c 48 default tune the write queues to 24: echo 24 > /sys/module/nvme/parameters/write_queues echo 1 > /sys/block/nvme0n1/device/reset_controller dmesg | grep "default/read/poll" [ 433.547235] nvme nvme0: 24/24/0 default/read/poll queues cat /sys/kernel/debug/block/nvme0n1/hctx*/type | sort | uniq -c 48 default The driver's hardware queue mapping is not same as block layer. Signed-off-by: Weiping Zhang Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 078e8f8ce8ad96fdcb5ca4dc8714d266a77eefc3 Author: Eric Anholt Date: Wed Jun 17 13:53:10 2020 -0700 drm/msm: Fix setup of a6xx create_address_space. We don't want it under CONFIG_DRM_MSM_GPU_STATE, we need it all the time (like the other GPUs do). Fixes: ccac7ce373c1 ("drm/msm: Refactor address space initialization") Signed-off-by: Eric Anholt Signed-off-by: Rob Clark commit f167989c673096c8d823b1292c6ee51ed266d178 Author: Eric Anholt Date: Wed Jun 17 13:53:09 2020 -0700 drm/msm: Fix address space size after refactor. Previously the address space went from 16M to ~0u, but with the refactor one of the 'f's was dropped, limiting us to 256MB. Additionally, the new interface takes a start and size, not start and end, so we can't just copy and paste. Fixes regressions in dEQP-VK.memory.allocation.random.* Fixes: ccac7ce373c1 ("drm/msm: Refactor address space initialization") Signed-off-by: Eric Anholt Signed-off-by: Rob Clark commit ef7232da6bcd4294cbb2d424bc35885721570f01 Author: Shannon Nelson Date: Tue Jun 16 08:06:26 2020 -0700 ionic: export features for vlans to use Set up vlan_features for use by any vlans above us. Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support") Signed-off-by: Shannon Nelson Acked-by: Jonathan Toppins Signed-off-by: David S. Miller commit 3103b6feb4454646558eedc50ece728bc469f341 Author: Shannon Nelson Date: Mon Jun 15 18:14:59 2020 -0700 ionic: no link check while resetting queues If the driver is busy resetting queues after a change in MTU or queue parameters, don't bother checking the link, wait until the next watchdog cycle. Fixes: 987c0871e8ae ("ionic: check for linkup in watchdog") Signed-off-by: Shannon Nelson Acked-by: Jonathan Toppins Signed-off-by: David S. Miller commit e92bc059e7fa5f443e958900229bc7fa1d38fecb Merge: b3a9e3b9622a da785a87787c Author: Florian Fainelli Date: Wed Jun 17 15:02:13 2020 -0700 Merge tag 'tags/bcm2835-drivers-fixes-2020-0-17' into drivers/fixes Fixes Raspberry Pi firmware version output Signed-off-by: Florian Fainelli commit 02c28dffb13abbaaedece1e4a6493b48ad3f913a Author: David Howells Date: Wed Jun 17 15:46:33 2020 +0100 rxrpc: Fix afs large storage transmission performance drop Commit 2ad6691d988c, which moved the modification of the status annotation for a packet in the Tx buffer prior to the retransmission moved the state clearance, but managed to lose the bit that set it to UNACK. Consequently, if a retransmission occurs, the packet is accidentally changed to the ACK state (ie. 0) by masking it off, which means that the packet isn't counted towards the tally of newly-ACK'd packets if it gets hard-ACK'd. This then prevents the congestion control algorithm from recovering properly. Fix by reinstating the change of state to UNACK. Spotted by the generic/460 xfstest. Fixes: 2ad6691d988c ("rxrpc: Fix race between incoming ACK parser and retransmitter") Signed-off-by: David Howells commit a2ad7c21ad8cf1ce4ad65e13df1c2a1c29b38ac5 Author: David Howells Date: Wed Jun 17 23:01:23 2020 +0100 rxrpc: Fix handling of rwind from an ACK packet The handling of the receive window size (rwind) from a received ACK packet is not correct. The rxrpc_input_ackinfo() function currently checks the current Tx window size against the rwind from the ACK to see if it has changed, but then limits the rwind size before storing it in the tx_winsize member and, if it increased, wake up the transmitting process. This means that if rwind > RXRPC_RXTX_BUFF_SIZE - 1, this path will always be followed. Fix this by limiting rwind before we compare it to tx_winsize. The effect of this can be seen by enabling the rxrpc_rx_rwind_change tracepoint. Fixes: 702f2ac87a9a ("rxrpc: Wake up the transmitter if Rx window size increases on the peer") Signed-off-by: David Howells commit e869e7a17798d85829fa7d4f9bbe1eebd4b2d3f6 Author: Jeremy Kerr Date: Mon Jun 15 10:54:56 2020 +0800 net: usb: ax88179_178a: fix packet alignment padding Using a AX88179 device (0b95:1790), I see two bytes of appended data on every RX packet. For example, this 48-byte ping, using 0xff as a payload byte: 04:20:22.528472 IP 192.168.1.1 > 192.168.1.2: ICMP echo request, id 2447, seq 1, length 64 0x0000: 000a cd35 ea50 000a cd35 ea4f 0800 4500 0x0010: 0054 c116 4000 4001 f63e c0a8 0101 c0a8 0x0020: 0102 0800 b633 098f 0001 87ea cd5e 0000 0x0030: 0000 dcf2 0600 0000 0000 ffff ffff ffff 0x0040: ffff ffff ffff ffff ffff ffff ffff ffff 0x0050: ffff ffff ffff ffff ffff ffff ffff ffff 0x0060: ffff 961f Those last two bytes - 96 1f - aren't part of the original packet. In the ax88179 RX path, the usbnet rx_fixup function trims a 2-byte 'alignment pseudo header' from the start of the packet, and sets the length from a per-packet field populated by hardware. It looks like that length field *includes* the 2-byte header; the current driver assumes that it's excluded. This change trims the 2-byte alignment header after we've set the packet length, so the resulting packet length is correct. While we're moving the comment around, this also fixes the spelling of 'pseudo'. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit aadf9dcef9d4cd68c73a4ab934f93319c4becc47 Author: David Howells Date: Wed Jun 17 22:50:33 2020 +0100 rxrpc: Fix trace string The trace symbol printer (__print_symbolic()) ignores symbols that map to an empty string and prints the hex value instead. Fix the symbol for rxrpc_cong_no_change to " -" instead of "" to avoid this. Fixes: b54a134a7de4 ("rxrpc: Fix handling of enums-to-string translation in tracing") Signed-off-by: David Howells commit da9cebe16930f0273278fe893f2809450c61ae41 Author: Alex Deucher Date: Mon Jun 15 16:36:49 2020 -0400 drm/amdgpu: fix documentation around busy_percentage Add rename the gpu busy percentage for consistency and add the mem busy percentage documentation. Reviewed-by: Evan Quan Reviewed-by: Nirmoy Das Signed-off-by: Alex Deucher commit 7386f5c9c8080525985780ed8c3d1475258a4e34 Author: Alex Deucher Date: Mon Jun 15 14:29:55 2020 -0400 drm/amdgpu/pm: update comment to clarify Overdrive interfaces Vega10 and previous asics use one interface, vega20 and newer use another. Reviewed-by: Evan Quan Acked-by: Nirmoy Das Signed-off-by: Alex Deucher commit 99c7b309472787026ce52fd2bc5d00630567a872 Author: Lorenz Brun Date: Thu Jun 11 22:11:21 2020 +0200 drm/amdkfd: Use correct major in devcgroup check The existing code used the major version number of the DRM driver instead of the device major number of the DRM subsystem for validating access for a devices cgroup. This meant that accesses allowed by the devices cgroup weren't permitted and certain accesses denied by the devices cgroup were permitted (if they matched the wrong major device number). Signed-off-by: Lorenz Brun Fixes: 6b855f7b83d2f ("drm/amdkfd: Check against device cgroup") Reviewed-off-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8231b0b9c322c894594fb42eb0eb9f93544a6acc Author: Tom Rix Date: Wed Jun 17 05:40:28 2020 -0700 selinux: fix undefined return of cond_evaluate_expr clang static analysis reports an undefined return security/selinux/ss/conditional.c:79:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] return s[0]; ^~~~~~~~~~~ static int cond_evaluate_expr( ... { u32 i; int s[COND_EXPR_MAXDEPTH]; for (i = 0; i < expr->len; i++) ... return s[0]; When expr->len is 0, the loop which sets s[0] never runs. So return -1 if the loop never runs. Cc: stable@vger.kernel.org Signed-off-by: Tom Rix Acked-by: Stephen Smalley Signed-off-by: Paul Moore commit 5c5866c593bbd444d0339ede6a8fb5f14ff66d72 Author: Alex Williamson Date: Tue Jun 16 15:26:36 2020 -0600 vfio/pci: Clear error and request eventfd ctx after releasing The next use of the device will generate an underflow from the stale reference. Cc: Qian Cai Fixes: 1518ac272e78 ("vfio/pci: fix memory leaks of eventfd ctx") Reported-by: Daniel Wagner Reviewed-by: Cornelia Huck Tested-by: Daniel Wagner Signed-off-by: Alex Williamson commit 026bb845b0fff6dec91fe24511dad7d3067dc3ed Author: Kaitao Cheng Date: Fri May 29 22:12:14 2020 +0800 ftrace: Fix maybe-uninitialized compiler warning During build compiler reports some 'false positive' warnings about variables {'seq_ops', 'filtered_pids', 'other_pids'} may be used uninitialized. This patch silences these warnings. Also delete some useless spaces Link: https://lkml.kernel.org/r/20200529141214.37648-1-pilgrimtao@gmail.com Signed-off-by: Kaitao Cheng Signed-off-by: Steven Rostedt (VMware) commit 543094e19c82b5d171e139d09a1a3ea0a7361117 Author: Vishal Verma Date: Wed May 20 16:50:26 2020 -0600 nvdimm/region: always show the 'align' attribute It is possible that a platform that is capable of 'namespace labels' comes up without the labels properly initialized. In this case, the region's 'align' attribute is hidden. Howerver, once the user does initialize he labels, the 'align' attribute still stays hidden, which is unexpected. The sysfs_update_group() API is meant to address this, and could be called during region probe, but it has entanglements with the device 'lockdep_mutex'. Therefore, simply make the 'align' attribute always visible. It doesn't matter what it says for label-less namespaces, since it is not possible to change their allocation anyway. Suggested-by: Dan Williams Signed-off-by: Vishal Verma Cc: Dan Williams Link: https://lore.kernel.org/r/20200520225026.29426-1-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit 56952e91acc93ed624fe9da840900defb75f1323 Author: Jens Axboe Date: Wed Jun 17 15:00:04 2020 -0600 io_uring: reap poll completions while waiting for refs to drop on exit If we're doing polled IO and end up having requests being submitted async, then completions can come in while we're waiting for refs to drop. We need to reap these manually, as nobody else will be looking for them. Break the wait into 1/20th of a second time waits, and check for done poll completions if we time out. Otherwise we can have done poll completions sitting in ctx->poll_list, which needs us to reap them but we're just waiting for them. Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit b3583fca5fb654af2cfc1c08259abb9728272538 Author: Dmitry V. Levin Date: Tue Jun 2 21:00:51 2020 +0300 s390: fix syscall_get_error for compat processes If both the tracer and the tracee are compat processes, and gprs[2] is assigned a value by __poke_user_compat, then the higher 32 bits of gprs[2] are cleared, IS_ERR_VALUE() always returns false, and syscall_get_error() always returns 0. Fix the implementation by sign-extending the value for compat processes the same way as x86 implementation does. The bug was exposed to user space by commit 201766a20e30f ("ptrace: add PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite. This change fixes strace syscall tampering on s390. Link: https://lkml.kernel.org/r/20200602180051.GA2427@altlinux.org Fixes: 753c4dd6a2fa2 ("[S390] ptrace changes") Cc: Elvira Khabirova Cc: stable@vger.kernel.org # v2.6.28+ Signed-off-by: Dmitry V. Levin Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit c920c545286270302d29fd63c05c3bd84828daee Author: Julian Wiedmann Date: Tue Jun 2 14:26:36 2020 +0200 s390/qdio: warn about unexpected SLSB states The way we produce SBALs to the device (first update q->nr_buf_used, then update the SLSB) should ensure that we never see some of the SLSB states when scanning the queue for progress. So make some noise if we do, this implies a bug in our SBAL tracking. Also tweak the WARN msg to provide more information. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 3d6c6f20d961209972a075ddc50b9a7207e9796e Author: Julian Wiedmann Date: Tue Jun 2 14:23:32 2020 +0200 s390/qdio: clean up usage of qdio_data This removes the last remaining accesses to ->qdio_data from internal code. Just pass the qdio_irq struct where needed instead. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit ac4e106d8934a5894811fc263f4b03fc8ed0fb7a Author: Matthew Hagan Date: Sun Jun 14 15:19:00 2020 -0700 ARM: dts: NSP: Correct FA2 mailbox node The FA2 mailbox is specified at 0x18025000 but should actually be 0x18025c00, length 0x400 according to socregs_nsp.h and board_bu.c. Also the interrupt was off by one and should be GIC SPI 151 instead of 150. Fixes: 17d517172300 ("ARM: dts: NSP: Add mailbox (PDC) to NSP") Signed-off-by: Matthew Hagan Signed-off-by: Florian Fainelli commit b9d37bbb55b8993d296a86fa21f98fa550b61967 Merge: 69119673bd50 8030e250d882 Author: David S. Miller Date: Wed Jun 17 13:26:55 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2020-06-17 The following pull-request contains BPF updates for your *net* tree. We've added 10 non-merge commits during the last 2 day(s) which contain a total of 14 files changed, 158 insertions(+), 59 deletions(-). The main changes are: 1) Important fix for bpf_probe_read_kernel_str() return value, from Andrii. 2) [gs]etsockopt fix for large optlen, from Stanislav. 3) devmap allocation fix, from Toke. ==================== Signed-off-by: David S. Miller commit dcb231e86a237a21305fb838e8140898fb140bcf Merge: a94eaccefea1 c8d2e2bfaeff Author: Mark Brown Date: Wed Jun 17 20:28:31 2020 +0100 Merge series "ASoC: SOF: Intel: update PCI IDs" from Pierre-Louis Bossart : Clean-up CometLake and add missing PCI IDs. Changes for the legacy driver are sent separately. Pierre-Louis Bossart (3): ASoC: Intel: SOF: merge COMETLAKE_LP and COMETLAKE_H ASoC: SOF: Intel: add PCI ID for CometLake-S ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H sound/hda/intel-dsp-config.c | 4 +--- sound/soc/intel/boards/Kconfig | 4 ++-- sound/soc/sof/intel/Kconfig | 29 ++++++++--------------------- sound/soc/sof/sof-pci-dev.c | 24 ++++++++++++++---------- 4 files changed, 25 insertions(+), 36 deletions(-) -- 2.20.1 commit a94eaccefea1186947c5c5451fcae2245dd7e714 Author: Pierre-Louis Bossart Date: Wed Jun 17 11:41:44 2020 -0500 ASoC: hdac_hda: fix memleak with regmap not freed on remove kmemleak throws error reports on module load/unload tests, add snd_hdac_regmap_exit() in .remove(). While we are at it, also fix the error handling flow in .probe() to use snd_hdac_regmap_exit() if needed. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200617164144.17859-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c8d2e2bfaeffa0f914330e8b4e45b986c8d30b58 Author: Pierre-Louis Bossart Date: Wed Jun 17 11:47:55 2020 -0500 ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H Usually the DSP is not traditionally enabled on H skews but this might be used moving forward. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200617164755.18104-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 258fb4f4c34a0db9d3834aba6784d7b322176bb9 Author: Pierre-Louis Bossart Date: Wed Jun 17 11:47:54 2020 -0500 ASoC: SOF: Intel: add PCI ID for CometLake-S Mirror ID added for legacy HDaudio Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200617164755.18104-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 4228668eb936357657046b486207b167caea5175 Author: Pierre-Louis Bossart Date: Wed Jun 17 11:47:53 2020 -0500 ASoC: Intel: SOF: merge COMETLAKE_LP and COMETLAKE_H We already have two configurations for CometLake, and a third one coming. On other platforms, we used a single Kconfig option, so we should follow the same trend by merging the two cases in a backwards compatible way. The backwards compatibility is handled by overloading the COMETLAKE_LP kconfig as COMETLAKE. In practice we've never seen a case where COMETLAKE_H is not selected along with COMETLAKE_LP, so keeping one of the two is enough. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200617164755.18104-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9d8426a09195e2dcf2aa249de2aaadd792d491c7 Author: Jens Axboe Date: Tue Jun 16 18:42:49 2020 -0600 io_uring: acquire 'mm' for task_work for SQPOLL If we're unlucky with timing, we could be running task_work after having dropped the memory context in the sq thread. Since dropping the context requires a runnable task state, we cannot reliably drop it as part of our check-for-work loop in io_sq_thread(). Instead, abstract out the mm acquire for the sq thread into a helper, and call it from the async task work handler. Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Jens Axboe commit bbde017a32b32d2fa8d5fddca25fade20132abf8 Author: Xiaoguang Wang Date: Tue Jun 16 02:06:38 2020 +0800 io_uring: add memory barrier to synchronize io_kiocb's result and iopoll_completed In io_complete_rw_iopoll(), stores to io_kiocb's result and iopoll completed are two independent store operations, to ensure that once iopoll_completed is ture and then req->result must been perceived by the cpu executing io_do_iopoll(), proper memory barrier should be used. And in io_do_iopoll(), we check whether req->result is EAGAIN, if it is, we'll need to issue this io request using io-wq again. In order to just issue a single smp_rmb() on the completion side, move the re-submit work to io_iopoll_complete(). Cc: stable@vger.kernel.org Signed-off-by: Xiaoguang Wang [axboe: don't set ->iopoll_completed for -EAGAIN retry] Signed-off-by: Jens Axboe commit 2d7d67920e5c8e0854df23ca77da2dd5880ce5dd Author: Xiaoguang Wang Date: Tue Jun 16 02:06:37 2020 +0800 io_uring: don't fail links for EAGAIN error in IOPOLL mode In IOPOLL mode, for EAGAIN error, we'll try to submit io request again using io-wq, so don't fail rest of links if this io request has links. Cc: stable@vger.kernel.org Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 1b5044021070efa3259f3e9548dc35d1eb6aa844 Merge: 69119673bd50 dbed452a078d Author: Linus Torvalds Date: Wed Jun 17 11:29:37 2020 -0700 Merge tag 'dma-mapping-5.8-3' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: "Fixes for the SEV atomic pool (Geert Uytterhoeven and David Rientjes)" * tag 'dma-mapping-5.8-3' of git://git.infradead.org/users/hch/dma-mapping: dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL dma-pool: fix too large DMA pools on medium memory size systems commit c0ee37e85e0e47402b8bbe35b6cec8e06937ca58 Author: Christoph Hellwig Date: Wed Jun 17 09:37:54 2020 +0200 maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault Better describe what these functions do. Suggested-by: Linus Torvalds Signed-off-by: Christoph Hellwig Signed-off-by: Linus Torvalds commit fe557319aa06c23cffc9346000f119547e0f289a Author: Christoph Hellwig Date: Wed Jun 17 09:37:53 2020 +0200 maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault Better describe what these functions do. Suggested-by: Linus Torvalds Signed-off-by: Christoph Hellwig Signed-off-by: Linus Torvalds commit 8030e250d882db174cbcd88273570ffb36a13080 Author: Stanislav Fomichev Date: Tue Jun 16 18:04:16 2020 -0700 bpf: Document optval > PAGE_SIZE behavior for sockopt hooks Extend existing doc with more details about requiring ctx->optlen = 0 for handling optval > PAGE_SIZE. Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200617010416.93086-3-sdf@google.com commit a0cb12b03132befbdb29d835ca330c18792e8134 Author: Stanislav Fomichev Date: Tue Jun 16 18:04:15 2020 -0700 selftests/bpf: Make sure optvals > PAGE_SIZE are bypassed We are relying on the fact, that we can pass > sizeof(int) optvals to the SOL_IP+IP_FREEBIND option (the kernel will take first 4 bytes). In the BPF program we check that we can only touch PAGE_SIZE bytes, but the real optlen is PAGE_SIZE * 2. In both cases, we override it to some predefined value and trim the optlen. Also, let's modify exiting IP_TOS usecase to test optlen=0 case where BPF program just bypasses the data as is. Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200617010416.93086-2-sdf@google.com commit d8fe449a9c51a37d844ab607e14e2f5c657d3cf2 Author: Stanislav Fomichev Date: Tue Jun 16 18:04:14 2020 -0700 bpf: Don't return EINVAL from {get,set}sockopt when optlen > PAGE_SIZE Attaching to these hooks can break iptables because its optval is usually quite big, or at least bigger than the current PAGE_SIZE limit. David also mentioned some SCTP options can be big (around 256k). For such optvals we expose only the first PAGE_SIZE bytes to the BPF program. BPF program has two options: 1. Set ctx->optlen to 0 to indicate that the BPF's optval should be ignored and the kernel should use original userspace value. 2. Set ctx->optlen to something that's smaller than the PAGE_SIZE. v5: * use ctx->optlen == 0 with trimmed buffer (Alexei Starovoitov) * update the docs accordingly v4: * use temporary buffer to avoid optval == optval_end == NULL; this removes the corner case in the verifier that might assume non-zero PTR_TO_PACKET/PTR_TO_PACKET_END. v3: * don't increase the limit, bypass the argument v2: * proper comments formatting (Jakub Kicinski) Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks") Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Cc: David Laight Link: https://lore.kernel.org/bpf/20200617010416.93086-1-sdf@google.com commit 99c51064fb06146b3d494b745c947e438a10aaa7 Author: Toke Høiland-Jørgensen Date: Tue Jun 16 16:28:29 2020 +0200 devmap: Use bpf_map_area_alloc() for allocating hash buckets Syzkaller discovered that creating a hash of type devmap_hash with a large number of entries can hit the memory allocator limit for allocating contiguous memory regions. There's really no reason to use kmalloc_array() directly in the devmap code, so just switch it to the existing bpf_map_area_alloc() function that is used elsewhere. Fixes: 6f9d451ab1a3 ("xdp: Add devmap_hash map type for looking up devices by hashed index") Reported-by: Xiumei Mu Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200616142829.114173-1-toke@redhat.com commit 3ff2351651a2ecb73ec9d29119793bde190b2850 Author: Hangbin Liu Date: Tue Jun 16 18:35:18 2020 +0800 xdp: Handle frame_sz in xdp_convert_zc_to_xdp_frame() In commit 34cc0b338a61 we only handled the frame_sz in convert_to_xdp_frame(). This patch will also handle frame_sz in xdp_convert_zc_to_xdp_frame(). Fixes: 34cc0b338a61 ("xdp: Xdp_frame add member frame_sz and handle in convert_to_xdp_frame") Signed-off-by: Hangbin Liu Signed-off-by: Alexei Starovoitov Acked-by: Jesper Dangaard Brouer Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200616103518.2963410-1-liuhangbin@gmail.com commit da8996250a7cb9fd6a262dc899258ad0f4021b68 Author: Gustavo A. R. Silva Date: Wed Jun 17 12:31:45 2020 -0400 dm ioctl: use struct_size() helper in retrieve_deps() One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct dm_target_deps { ... __u64 dev[0]; /* out */ }; Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mike Snitzer commit a143e172b66d992092eb6cf984f79d6989b684d6 Author: Huaisheng Ye Date: Fri Jun 12 23:55:44 2020 +0800 dm writecache: skip writecache_wait when using pmem mode The array bio_in_progress is only used with ssd mode. So skip writecache_wait_for_ios in writecache_discard when pmem mode. Signed-off-by: Huaisheng Ye Acked-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 39495b12ef1cf602e6abd350dce2ef4199906531 Author: Huaisheng Ye Date: Fri Jun 12 23:59:11 2020 +0800 dm writecache: correct uncommitted_block when discarding uncommitted entry When uncommitted entry has been discarded, correct wc->uncommitted_block for getting the exact number. Fixes: 48debafe4f2fe ("dm: add writecache target") Cc: stable@vger.kernel.org Signed-off-by: Huaisheng Ye Acked-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 7b2377486767503d47265e4d487a63c651f6b55d Author: Hou Tao Date: Mon Jun 15 11:33:23 2020 +0800 dm zoned: assign max_io_len correctly The unit of max_io_len is sector instead of byte (spotted through code review), so fix it. Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target") Cc: stable@vger.kernel.org Signed-off-by: Hou Tao Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 0e093c77c5b0dc0d8cbe123a84c944aa8bf0b878 Author: Arnaldo Carvalho de Melo Date: Wed Jun 17 10:23:51 2020 -0300 tools headers UAPI: Sync linux/fs.h with the kernel sources To pick the changes from: b383a73f2b83 ("fs/ext4: Introduce DAX inode flag") And silence this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/fs.h' differs from latest version at 'include/uapi/linux/fs.h' diff -u tools/include/uapi/linux/fs.h include/uapi/linux/fs.h It causes various beautifiers for things like fspick, fsmount, etc (see below) to get rebuilt, but this specific change doesn't make 'perf trace' be capable of decoding anything new, as we still don't decode what comes from ioctls, just its cmds. Details about the update: $ cp include/uapi/linux/fs.h tools/include/uapi/linux/fs.h $ git diff diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index 379a612f8f1d..f44eb0a04afd 100644 --- a/tools/include/uapi/linux/fs.h +++ b/tools/include/uapi/linux/fs.h @@ -262,6 +262,7 @@ struct fsxattr { #define FS_EA_INODE_FL 0x00200000 /* Inode used for large EA */ #define FS_EOFBLOCKS_FL 0x00400000 /* Reserved for ext4 */ #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ +#define FS_DAX_FL 0x02000000 /* Inode is DAX */ #define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */ #define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ #define FS_CASEFOLD_FL 0x40000000 /* Folder is case insensitive */ $ m make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j8' parallel build INSTALL GTK UI CC /tmp/build/perf/builtin-trace.o DESCEND plugins CC /tmp/build/perf/trace/beauty/fsmount.o CC /tmp/build/perf/trace/beauty/fspick.o CC /tmp/build/perf/trace/beauty/mount_flags.o CC /tmp/build/perf/trace/beauty/move_mount.o CC /tmp/build/perf/trace/beauty/renameat.o CC /tmp/build/perf/trace/beauty/sync_file_range.o INSTALL trace_plugins LD /tmp/build/perf/trace/beauty/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf Cc: Adrian Hunter Cc: Ira Weiny Cc: Jiri Olsa Cc: Namhyung Kim Cc: Theodore Ts'o Signed-off-by: Arnaldo Carvalho de Melo commit f64925c1ebacce7cadc7f2b993b145c3bfd95b57 Author: Arnaldo Carvalho de Melo Date: Wed Jun 17 10:16:53 2020 -0300 tools include UAPI: Sync linux/vhost.h with the kernel sources To get the changes in: 776f395004d8 ("vhost_vdpa: Support config interrupt in vdpa") Silencing this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h' diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h This automatically picks the new ioctl introduced in the above patch, making tools such as 'perf trace' aware of them and possibly allowing to use the strings in filters, etc: # perf trace -e ioctl --pid 7951 0.178 ( 0.010 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 0.194 ( 0.010 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 0.209 ( 0.010 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 0.224 (249.413 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.660 ( 0.011 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.675 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.686 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.697 ( 0.008 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.709 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.720 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.730 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.740 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.752 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.762 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.772 ( 0.007 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 249.782 (120.138 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 370.201 ( 0.039 ms): CPU 0/KVM/8023 ioctl(fd: 12, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7f744f9e1420) = 0 370.254 ( 0.052 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 370.575 ( 0.365 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 370.973 ( 0.028 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 371.015 ( 0.037 ms): CPU 0/KVM/8023 ioctl(fd: 14, cmd: KVM_RUN) = 0 371.071 ( 0.009 ms): CPU 0/KVM/8023 ioctl(fd: 12, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7f744f9e14b0) = 0 # Details about the update: $ diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h --- tools/include/uapi/linux/vhost.h 2020-04-16 13:19:12.056763843 -0300 +++ include/uapi/linux/vhost.h 2020-06-17 10:04:20.532056428 -0300 @@ -15,6 +15,8 @@ #include #include +#define VHOST_FILE_UNBIND -1 + /* ioctls */ #define VHOST_VIRTIO 0xAF @@ -140,4 +142,6 @@ /* Get the max ring size. */ #define VHOST_VDPA_GET_VRING_NUM _IOR(VHOST_VIRTIO, 0x76, __u16) +/* Set event fd for config interrupt*/ +#define VHOST_VDPA_SET_CONFIG_CALL _IOW(VHOST_VIRTIO, 0x77, int) #endif $ $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before $ cp include/uapi/linux/vhost.h tools/include/uapi/linux/vhost.h $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after $ diff -u before after --- before 2020-06-17 10:15:35.123275966 -0300 +++ after 2020-06-17 10:15:51.812482117 -0300 @@ -27,6 +27,7 @@ [0x72] = "VDPA_SET_STATUS", [0x74] = "VDPA_SET_CONFIG", [0x75] = "VDPA_SET_VRING_ENABLE", + [0x77] = "VDPA_SET_CONFIG_CALL", }; static const char *vhost_virtio_ioctl_read_cmds[] = { [0x00] = "GET_FEATURES", $ This causes these parts to get rebuilt: CC /tmp/build/perf/trace/beauty/ioctl.o INSTALL trace_plugins LD /tmp/build/perf/trace/beauty/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf Cc: Adrian Hunter Cc: Jiri Olsa Cc: Michael S. Tsirkin Cc: Namhyung Kim Cc: Zhu Lingshan Signed-off-by: Arnaldo Carvalho de Melo commit 25ca7e5c0b0315f3b5e6c4d2123e5a821ec0b590 Author: Arnaldo Carvalho de Melo Date: Wed Jun 17 10:07:59 2020 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes in: 7e5b3c267d25 ("x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation") Addressing these tools/perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h With this one will be able to use these new AMD MSRs in filters, by name, e.g.: # perf trace -e msr:* --filter "msr==IA32_MCU_OPT_CTRL" ^C# Using -v we can see how it sets up the tracepoint filters, converting from the string in the filter to the numeric value: # perf trace -v -e msr:* --filter "msr==IA32_MCU_OPT_CTRL" Using CPUID GenuineIntel-6-8E-A 0x123 New filter for msr:read_msr: (msr==0x123) && (common_pid != 335 && common_pid != 30344) 0x123 New filter for msr:write_msr: (msr==0x123) && (common_pid != 335 && common_pid != 30344) 0x123 New filter for msr:rdpmc: (msr==0x123) && (common_pid != 335 && common_pid != 30344) mmap size 528384B ^C# The updating process shows how this affects tooling in more detail: $ diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h --- tools/arch/x86/include/asm/msr-index.h 2020-06-03 10:36:09.959910238 -0300 +++ arch/x86/include/asm/msr-index.h 2020-06-17 10:04:20.235052901 -0300 @@ -128,6 +128,10 @@ #define TSX_CTRL_RTM_DISABLE BIT(0) /* Disable RTM feature */ #define TSX_CTRL_CPUID_CLEAR BIT(1) /* Disable TSX enumeration */ +/* SRBDS support */ +#define MSR_IA32_MCU_OPT_CTRL 0x00000123 +#define RNGDS_MITG_DIS BIT(0) + #define MSR_IA32_SYSENTER_CS 0x00000174 #define MSR_IA32_SYSENTER_ESP 0x00000175 #define MSR_IA32_SYSENTER_EIP 0x00000176 $ set -o vi $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after --- before 2020-06-17 10:05:49.653114752 -0300 +++ after 2020-06-17 10:06:01.777258731 -0300 @@ -51,6 +51,7 @@ [0x0000011e] = "IA32_BBL_CR_CTL3", [0x00000120] = "IDT_MCR_CTRL", [0x00000122] = "IA32_TSX_CTRL", + [0x00000123] = "IA32_MCU_OPT_CTRL", [0x00000140] = "MISC_FEATURES_ENABLES", [0x00000174] = "IA32_SYSENTER_CS", [0x00000175] = "IA32_SYSENTER_ESP", $ The related change to cpu-features.h affects this: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o This shouldn't be affecting that 'perf bench' entry: $ find tools/perf/ -type f | xargs grep SRBDS $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Mark Gross Cc: Namhyung Kim Cc: Thomas Gleixner Signed-off-by: Arnaldo Carvalho de Melo commit 08a7c7772b4db0be06e3b27239147c0a36e2a507 Merge: b13b04d93821 69119673bd50 Author: Arnaldo Carvalho de Melo Date: Wed Jun 17 13:20:14 2020 -0300 Merge remote-tracking branch 'torvalds/master' into perf/urgent To get some newer headers that got out of sync with the copies in tools/ so that we can try to have the tools/perf/ build clean for v5.8 with fewer pull requests. Signed-off-by: Arnaldo Carvalho de Melo commit b13b04d9382113f787e21c9567a4022fef8697b9 Author: Milian Wolff Date: Sat Jun 13 01:03:33 2020 +0200 perf script: Initialize zstd_data Fixes segmentation fault when trying to interpret zstd-compressed data with perf script: ``` $ perf record -z ls ... [ perf record: Captured and wrote 0,010 MB perf.data, compressed (original 0,001 MB, ratio is 2,190) ] $ memcheck perf script ... ==67911== Invalid read of size 4 ==67911== at 0x5568188: ZSTD_decompressStream (in /usr/lib/libzstd.so.1.4.5) ==67911== by 0x6E726B: zstd_decompress_stream (zstd.c:100) ==67911== by 0x65729C: perf_session__process_compressed_event (session.c:72) ==67911== by 0x6598E8: perf_session__process_user_event (session.c:1583) ==67911== by 0x65BA59: reader__process_events (session.c:2177) ==67911== by 0x65BA59: __perf_session__process_events (session.c:2234) ==67911== by 0x65BA59: perf_session__process_events (session.c:2267) ==67911== by 0x5A7397: __cmd_script (builtin-script.c:2447) ==67911== by 0x5A7397: cmd_script (builtin-script.c:3840) ==67911== by 0x5FE9D2: run_builtin (perf.c:312) ==67911== by 0x711627: handle_internal_command (perf.c:364) ==67911== by 0x711627: run_argv (perf.c:408) ==67911== by 0x711627: main (perf.c:538) ==67911== Address 0x71d8 is not stack'd, malloc'd or (recently) free'd ``` Signed-off-by: Milian Wolff Acked-by: Alexey Budankov Tested-by: Arnaldo Carvalho de Melo LPU-Reference: 20200612230333.72140-1-milian.wolff@kdab.com Signed-off-by: Arnaldo Carvalho de Melo commit c69cb1d17b6258830b0a97dde73525c1006898f8 Author: Damien Le Moal Date: Mon Jun 8 13:20:59 2020 +0900 dm zoned: fix uninitialized pointer dereference Make sure that the local variable rzone in dmz_do_reclaim() is always initialized before being used for printing debug messages. Fixes: f97809aec589 ("dm zoned: per-device reclaim") Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit 95b2c3ec4cb1689db2389c251d39f64490ba641c Author: Charles Keepax Date: Wed Jun 17 16:21:29 2020 +0100 regmap: Fix memory leak from regmap_register_patch When a register patch is registered the reg_sequence is copied but the memory allocated is never freed. Add a kfree in regmap_exit to clean it up. Fixes: 22f0d90a3482 ("regmap: Support register patch sets") Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20200617152129.19655-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 1c7fb20d6b0acd452cb93d447051eac7724edfa7 Author: Tobias Klauser Date: Tue Jun 16 13:33:03 2020 +0200 tools, bpftool: Add ringbuf map type to map command docs Commit c34a06c56df7 ("tools/bpftool: Add ringbuf map to a list of known map types") added the symbolic "ringbuf" name. Document it in the bpftool map command docs and usage as well. Signed-off-by: Tobias Klauser Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200616113303.8123-1-tklauser@distanz.ch commit 02553b91da5deb63c8562b47529b09b734659af0 Author: Andrii Nakryiko Date: Mon Jun 15 22:04:30 2020 -0700 bpf: bpf_probe_read_kernel_str() has to return amount of data read on success During recent refactorings, bpf_probe_read_kernel_str() started returning 0 on success, instead of amount of data successfully read. This majorly breaks applications relying on bpf_probe_read_kernel_str() and bpf_probe_read_str() and their results. Fix this by returning actual number of bytes read. Fixes: 8d92db5c04d1 ("bpf: rework the compat kernel probe handling") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Christoph Hellwig Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200616050432.1902042-1-andriin@fb.com commit b2c22910fe5aae10b7e17b0721e63a3edf0c9553 Author: Kai-Heng Feng Date: Wed Jun 17 18:29:02 2020 +0800 ALSA: hda/realtek: Add mute LED and micmute LED support for HP systems There are two more HP systems control mute LED from HDA codec and need to expose micmute led class so SoF can control micmute LED. Add quirks to support them. Signed-off-by: Kai-Heng Feng Cc: Link: https://lore.kernel.org/r/20200617102906.16156-2-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit c3dbe541ef77754729de5e82be2d6e5d267c6c8c Author: Jan Kara Date: Fri Jun 5 16:58:37 2020 +0200 blktrace: Avoid sparse warnings when assigning q->blk_trace Mostly for historical reasons, q->blk_trace is assigned through xchg() and cmpxchg() atomic operations. Although this is correct, sparse complains about this because it violates rcu annotations since commit c780e86dd48e ("blktrace: Protect q->blk_trace with RCU") which started to use rcu for accessing q->blk_trace. Furthermore there's no real need for atomic operations anymore since all changes to q->blk_trace happen under q->blk_trace_mutex and since it also makes more sense to check if q->blk_trace is set with the mutex held earlier. So let's just replace xchg() with rcu_replace_pointer() and cmpxchg() with explicit check and rcu_assign_pointer(). This makes the code more efficient and sparse happy. Reported-by: kbuild test robot Signed-off-by: Jan Kara Signed-off-by: Jens Axboe commit 1b0b283648163dae2a214ca28ed5a99f62a77319 Author: Luis Chamberlain Date: Fri Jun 5 16:58:36 2020 +0200 blktrace: break out of blktrace setup on concurrent calls We use one blktrace per request_queue, that means one per the entire disk. So we cannot run one blktrace on say /dev/vda and then /dev/vda1, or just two calls on /dev/vda. We check for concurrent setup only at the very end of the blktrace setup though. If we try to run two concurrent blktraces on the same block device the second one will fail, and the first one seems to go on. However when one tries to kill the first one one will see things like this: The kernel will show these: ``` debugfs: File 'dropped' in directory 'nvme1n1' already present! debugfs: File 'msg' in directory 'nvme1n1' already present! debugfs: File 'trace0' in directory 'nvme1n1' already present! `` And userspace just sees this error message for the second call: ``` blktrace /dev/nvme1n1 BLKTRACESETUP(2) /dev/nvme1n1 failed: 5/Input/output error ``` The first userspace process #1 will also claim that the files were taken underneath their nose as well. The files are taken away form the first process given that when the second blktrace fails, it will follow up with a BLKTRACESTOP and BLKTRACETEARDOWN. This means that even if go-happy process #1 is waiting for blktrace data, we *have* been asked to take teardown the blktrace. This can easily be reproduced with break-blktrace [0] run_0005.sh test. Just break out early if we know we're already going to fail, this will prevent trying to create the files all over again, which we know still exist. [0] https://github.com/mcgrof/break-blktrace Signed-off-by: Luis Chamberlain Signed-off-by: Jan Kara Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 22cf8419f1319ff87ec759d0ebdff4cbafaee832 Author: J. Bruce Fields Date: Tue Jun 16 16:43:18 2020 -0400 nfsd: apply umask on fs without ACL support The server is failing to apply the umask when creating new objects on filesystems without ACL support. To reproduce this, you need to use NFSv4.2 and a client and server recent enough to support umask, and you need to export a filesystem that lacks ACL support (for example, ext4 with the "noacl" mount option). Filesystems with ACL support are expected to take care of the umask themselves (usually by calling posix_acl_create). For filesystems without ACL support, this is up to the caller of vfs_create(), vfs_mknod(), or vfs_mkdir(). Reported-by: Elliott Mitchell Reported-by: Salvatore Bonaccorso Tested-by: Salvatore Bonaccorso Fixes: 47057abde515 ("nfsd: add support for the umask attribute") Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields commit 2a55280a3675203496d302463b941834228b9875 Author: Ard Biesheuvel Date: Sun Jun 7 15:41:35 2020 +0200 efi/libstub: arm: Print CPU boot mode and MMU state at boot On 32-bit ARM, we may boot at HYP mode, or with the MMU and caches off (or both), even though the EFI spec does not actually support this. While booting at HYP mode is something we might tolerate, fiddling with the caches is a more serious issue, as disabling the caches is tricky to do safely from C code, and running without the Dcache makes it impossible to support unaligned memory accesses, which is another explicit requirement imposed by the EFI spec. So take note of the CPU mode and MMU state in the EFI stub diagnostic output so that we can easily diagnose any issues that may arise from this. E.g., EFI stub: Entering in SVC mode with MMU enabled Also, capture the CPSR and SCTLR system register values at EFI stub entry, and after ExitBootServices() returns, and check whether the MMU and Dcache were disabled at any point. If this is the case, a diagnostic message like the following will be emitted: efi: [Firmware Bug]: EFI stub was entered with MMU and Dcache disabled, please fix your firmware! efi: CPSR at EFI stub entry : 0x600001d3 efi: SCTLR at EFI stub entry : 0x00c51838 efi: CPSR after ExitBootServices() : 0x600001d3 efi: SCTLR after ExitBootServices(): 0x00c50838 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm commit 62956be8f95b93e9f91ffe2e5aa9c0e411af5a14 Author: Ard Biesheuvel Date: Tue Jun 16 12:53:30 2020 +0200 efi/libstub: arm: Omit arch specific config table matching array on arm64 On arm64, the EFI stub is built into the kernel proper, and so the stub can refer to its symbols directly. Therefore, the practice of using EFI configuration tables to pass information between them is never needed, so we can omit any code consuming such tables when building for arm64. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm commit 41d90b0c1108d1e46c48cf79964636c553844f4c Author: Arvind Sankar Date: Wed Jun 17 09:19:57 2020 -0400 efi/x86: Setup stack correctly for efi_pe_entry Commit 17054f492dfd ("efi/x86: Implement mixed mode boot without the handover protocol") introduced a new entry point for the EFI stub to be booted in mixed mode on 32-bit firmware. When entered via efi32_pe_entry, control is first transferred to startup_32 to setup for the switch to long mode, and then the EFI stub proper is entered via efi_pe_entry. efi_pe_entry is an MS ABI function, and the ABI requires 32 bytes of shadow stack space to be allocated by the caller, as well as the stack being aligned to 8 mod 16 on entry. Allocate 40 bytes on the stack before switching to 64-bit mode when calling efi_pe_entry to account for this. For robustness, explicitly align boot_stack_end to 16 bytes. It is currently implicitly aligned since .bss is cacheline-size aligned, head_64.o is the first object file with a .bss section, and the heap and boot sizes are aligned. Fixes: 17054f492dfd ("efi/x86: Implement mixed mode boot without the handover protocol") Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200617131957.2507632-1-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 1497eea68624f6076bf3eaf66baec3771ea04045 Author: Michael Ellerman Date: Tue Jun 16 23:56:16 2020 +1000 powerpc/syscalls: Use the number when building SPU syscall table Currently the macro that inserts entries into the SPU syscall table doesn't actually use the "nr" (syscall number) parameter. This does work, but it relies on the exact right number of syscall entries being emitted in order for the syscal numbers to line up with the array entries. If for example we had two entries with the same syscall number we wouldn't get an error, it would just cause all subsequent syscalls to be off by one in the spu_syscall_table. So instead change the macro to assign to the specific entry of the array, meaning any numbering overlap will be caught by the compiler. Signed-off-by: Michael Ellerman Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200616135617.2937252-1-mpe@ellerman.id.au commit 687993ccf3b05070598b89fad97410b26d7bc9d2 Author: Mike Rapoport Date: Mon Jun 15 12:22:29 2020 +0300 powerpc/8xx: use pmd_off() to access a PMD entry in pte_update() The pte_update() implementation for PPC_8xx unfolds page table from the PGD level to access a PMD entry. Since 8xx has only 2-level page table this can be simplified with pmd_off() shortcut. Replace explicit unfolding with pmd_off() and drop defines of pgd_index() and pgd_offset() that are no longer needed. Signed-off-by: Mike Rapoport Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200615092229.23142-1-rppt@kernel.org commit 35700e221b18fa53401e5f315be90af9e0bbcdca Author: Patrice Chotard Date: Tue Jun 16 13:30:35 2020 +0200 spi: stm32-qspi: Fix error path in case of -EPROBE_DEFER In case of -EPROBE_DEFER, stm32_qspi_release() was called in any case which unregistered driver from pm_runtime framework even if it has not been registered yet to it. This leads to: stm32-qspi 58003000.spi: can't setup spi0.0, status -13 spi_master spi0: spi_device register error /soc/spi@58003000/mx66l51235l@0 spi_master spi0: Failed to create SPI device for /soc/spi@58003000/mx66l51235l@0 stm32-qspi 58003000.spi: can't setup spi0.1, status -13 spi_master spi0: spi_device register error /soc/spi@58003000/mx66l51235l@1 spi_master spi0: Failed to create SPI device for /soc/spi@58003000/mx66l51235l@1 On v5.7 kernel,this issue was not "visible", qspi driver was probed successfully. Fixes: 9d282c17b023 ("spi: stm32-qspi: Add pm_runtime support") Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20200616113035.4514-1-patrice.chotard@st.com Signed-off-by: Mark Brown commit 1b3bcca2085865c1facfbea9baf2f5cde5dc15e4 Author: Axel Lin Date: Tue Jun 16 21:50:30 2020 +0800 regulator: mt6358: Remove BROKEN dependency The MFD part is merged into v5.8-rc1, thus remove BROKEN dependency. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20200616135030.1163660-1-axel.lin@ingics.com Signed-off-by: Mark Brown commit 6870112c46c867f50cd27570860a05bd82614b5c Merge: 6f1cf5257acc b3a9e3b9622a Author: Mark Brown Date: Wed Jun 17 12:39:12 2020 +0100 Merge tag 'v5.8-rc1' into regulator-5.8 Linux 5.8-rc1 commit da785a87787c97823d12107a4f0ec7adcc2a78d9 Author: Andy Shevchenko Date: Tue Jun 16 19:31:39 2020 +0300 ARM: bcm2835: Fix integer overflow in rpi_firmware_print_firmware_revision() time64_t is 64-bit width type, we are not supposed to supply lesser ones as in the case of rpi_firmware_print_firmware_revision() after the commit 4a60f58ee002 ("ARM: bcm2835: Switch to use %ptT"). Use temporary variable of time64_t type to correctly handle lesser types. Fixes: 4a60f58ee002 ("ARM: bcm2835: Switch to use %ptT") Reported-by: Stefan Wahren Reported-by: Nicolas Saenz Julienne Signed-off-by: Andy Shevchenko Revieved-by: Petr Mladek Tested-by: Nicolas Saenz Julienne Signed-off-by: Nicolas Saenz Julienne Cc: Petr Mladek Cc: Steven Rostedt Cc: Sergey Senozhatsky Link: https://lore.kernel.org/r/20200616163139.4229-1-andriy.shevchenko@linux.intel.com commit b9249cba25a5dce5de87e5404503a5e11832c2dd Author: Will Deacon Date: Tue Jun 16 19:03:49 2020 +0100 arm64: bti: Require clang >= 10.0.1 for in-kernel BTI support Unfortunately, most versions of clang that support BTI are capable of miscompiling the kernel when converting a switch statement into a jump table. As an example, attempting to spawn a KVM guest results in a panic: [ 56.253312] Kernel panic - not syncing: bad mode [ 56.253834] CPU: 0 PID: 279 Comm: lkvm Not tainted 5.8.0-rc1 #2 [ 56.254225] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 [ 56.254712] Call trace: [ 56.254952] dump_backtrace+0x0/0x1d4 [ 56.255305] show_stack+0x1c/0x28 [ 56.255647] dump_stack+0xc4/0x128 [ 56.255905] panic+0x16c/0x35c [ 56.256146] bad_el0_sync+0x0/0x58 [ 56.256403] el1_sync_handler+0xb4/0xe0 [ 56.256674] el1_sync+0x7c/0x100 [ 56.256928] kvm_vm_ioctl_check_extension_generic+0x74/0x98 [ 56.257286] __arm64_sys_ioctl+0x94/0xcc [ 56.257569] el0_svc_common+0x9c/0x150 [ 56.257836] do_el0_svc+0x84/0x90 [ 56.258083] el0_sync_handler+0xf8/0x298 [ 56.258361] el0_sync+0x158/0x180 This is because the switch in kvm_vm_ioctl_check_extension_generic() is executed as an indirect branch to tail-call through a jump table: ffff800010032dc8: 3869694c ldrb w12, [x10, x9] ffff800010032dcc: 8b0c096b add x11, x11, x12, lsl #2 ffff800010032dd0: d61f0160 br x11 However, where the target case uses the stack, the landing pad is elided due to the presence of a paciasp instruction: ffff800010032e14: d503233f paciasp ffff800010032e18: a9bf7bfd stp x29, x30, [sp, #-16]! ffff800010032e1c: 910003fd mov x29, sp ffff800010032e20: aa0803e0 mov x0, x8 ffff800010032e24: 940017c0 bl ffff800010038d24 ffff800010032e28: 93407c00 sxtw x0, w0 ffff800010032e2c: a8c17bfd ldp x29, x30, [sp], #16 ffff800010032e30: d50323bf autiasp ffff800010032e34: d65f03c0 ret Unfortunately, this results in a fatal exception because paciasp is compatible only with branch-and-link (call) instructions and not simple indirect branches. A fix is being merged into Clang 10.0.1 so that a 'bti j' instruction is emitted as an explicit landing pad in this situation. Make in-kernel BTI depend on that compiler version when building with clang. Cc: Tom Stellard Cc: Daniel Kiss Reviewed-by: Mark Brown Acked-by: Dave Martin Reviewed-by: Nathan Chancellor Acked-by: Nick Desaulniers Link: https://lore.kernel.org/r/20200615105524.GA2694@willie-the-truck Link: https://lore.kernel.org/r/20200616183630.2445-1-will@kernel.org Signed-off-by: Will Deacon commit cc5277fe66cf3ad68f41f1c539b2ef0d5e432974 Author: Dan Carpenter Date: Tue Jun 2 22:36:11 2020 +0300 x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get() The callers don't expect *d_cdp to be set to an error pointer, they only check for NULL. This leads to a static checker warning: arch/x86/kernel/cpu/resctrl/rdtgroup.c:2648 __init_one_rdt_domain() warn: 'd_cdp' could be an error pointer This would not trigger a bug in this specific case because __init_one_rdt_domain() calls it with a valid domain that would not have a negative id and thus not trigger the return of the ERR_PTR(). If this was a negative domain id then the call to rdt_find_domain() in domain_add_cpu() would have returned the ERR_PTR() much earlier and the creation of the domain with an invalid id would have been prevented. Even though a bug is not triggered currently the right and safe thing to do is to set the pointer to NULL because that is what can be checked for when the caller is handling the CDP and non-CDP cases. Fixes: 52eb74339a62 ("x86/resctrl: Fix rdt_find_domain() return value and checks") Signed-off-by: Dan Carpenter Signed-off-by: Borislav Petkov Acked-by: Reinette Chatre Acked-by: Fenghua Yu Link: https://lkml.kernel.org/r/20200602193611.GA190851@mwanda commit ff58bbc7b9704a5869204176f804eff57307fef0 Author: Takashi Iwai Date: Tue Jun 16 14:09:21 2020 +0200 ALSA: usb-audio: Fix potential use-after-free of streams With the recent full-duplex support of implicit feedback streams, an endpoint can be still running after closing the capture stream as long as the playback stream with the sync-endpoint is running. In such a state, the URBs are still be handled and they may call retire_data_urb callback, which tries to transfer the data from the PCM buffer. Since the PCM stream gets closed, this may lead to use-after-free. This patch adds the proper clearance of the callback at stopping the capture stream for addressing the possible UAF above. Fixes: 10ce77e4817f ("ALSA: usb-audio: Add duplex sound support for USB devices using implicit feedback") Link: https://lore.kernel.org/r/20200616120921.12249-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 56fccf21d1961a06e2a0c96ce446ebf036651062 Author: David Rientjes Date: Thu Jun 11 12:20:30 2020 -0700 dma-direct: check return value when encrypting or decrypting memory __change_page_attr() can fail which will cause set_memory_encrypted() and set_memory_decrypted() to return non-zero. If the device requires unencrypted DMA memory and decryption fails, simply free the memory and fail. If attempting to re-encrypt in the failure path and that encryption fails, there is no alternative other than to leak the memory. Fixes: c10f07aa27da ("dma/direct: Handle force decryption for DMA coherent buffers in common code") Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 96a539fa3bb71f443ae08e57b9f63d6e5bb2207c Author: David Rientjes Date: Thu Jun 11 12:20:29 2020 -0700 dma-direct: re-encrypt memory if dma_direct_alloc_pages() fails If arch_dma_set_uncached() fails after memory has been decrypted, it needs to be re-encrypted before freeing. Fixes: fa7e2247c572 ("dma-direct: make uncached_kernel_address more general") Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 633d5fce78a61e8727674467944939f55b0bcfab Author: David Rientjes Date: Thu Jun 11 12:20:28 2020 -0700 dma-direct: always align allocation size in dma_direct_alloc_pages() dma_alloc_contiguous() does size >> PAGE_SHIFT and set_memory_decrypted() works at page granularity. It's necessary to page align the allocation size in dma_direct_alloc_pages() for consistent behavior. This also fixes an issue when arch_dma_prep_coherent() is called on an unaligned allocation size for dma_alloc_need_uncached() when CONFIG_DMA_DIRECT_REMAP is disabled but CONFIG_ARCH_HAS_DMA_SET_UNCACHED is enabled. Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 26749b3201ab05e288fbf78fbc8585dfa2da3218 Author: Christoph Hellwig Date: Mon Jun 15 08:52:31 2020 +0200 dma-direct: mark __dma_direct_alloc_pages static Signed-off-by: Christoph Hellwig commit 1fbf57d0530217b9f264eedc4867bf91479cdf3c Author: Christoph Hellwig Date: Wed Jun 10 10:29:49 2020 +0200 dma-direct: re-enable mmap for !CONFIG_MMU nommu configfs can trivially map the coherent allocations to user space, as no actual page table setup is required and the kernel and the user space programs share the same address space. Fixes: 62fcee9a3bd7 ("dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP") Signed-off-by: Christoph Hellwig Reported-by: dillon min Reviewed-by: Vladimir Murzin Tested-by: dillon min commit a291e4fba259a56a6a274c1989997acb6f0bb03a Author: Colin Xu Date: Mon Jun 1 11:55:56 2020 +0800 drm/i915/gvt: Use GFP_ATOMIC instead of GFP_KERNEL in atomic context GFP_KERNEL flag specifies a normal kernel allocation in which executing in process context without any locks and can sleep. mmio_diff takes sometime to finish all the diff compare and it has locks, continue using GFP_KERNEL will output below trace if LOCKDEP enabled. Use GFP_ATOMIC instead. V2: Rebase. ===================================================== WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected 5.7.0-rc2 #400 Not tainted ----------------------------------------------------- is trying to acquire: ffffffffb47bea20 (fs_reclaim){+.+.}-{0:0}, at: fs_reclaim_acquire.part.0+0x0/0x30 and this task is already holding: ffff88845b85cc90 (&gvt->scheduler.mmio_context_lock){+.-.}-{2:2}, at: vgpu_mmio_diff_show+0xcf/0x2e0 which would create a new lock dependency: (&gvt->scheduler.mmio_context_lock){+.-.}-{2:2} -> (fs_reclaim){+.+.}-{0:0} but this new dependency connects a SOFTIRQ-irq-safe lock: (&gvt->scheduler.mmio_context_lock){+.-.}-{2:2} ... which became SOFTIRQ-irq-safe at: lock_acquire+0x175/0x4e0 _raw_spin_lock_irqsave+0x2b/0x40 shadow_context_status_change+0xfe/0x2f0 notifier_call_chain+0x6a/0xa0 __atomic_notifier_call_chain+0x5f/0xf0 execlists_schedule_out+0x42a/0x820 process_csb+0xe7/0x3e0 execlists_submission_tasklet+0x5c/0x1d0 tasklet_action_common.isra.0+0xeb/0x260 __do_softirq+0x11d/0x56f irq_exit+0xf6/0x100 do_IRQ+0x7f/0x160 ret_from_intr+0x0/0x2a cpuidle_enter_state+0xcd/0x5b0 cpuidle_enter+0x37/0x60 do_idle+0x337/0x3f0 cpu_startup_entry+0x14/0x20 start_kernel+0x58b/0x5c5 secondary_startup_64+0xa4/0xb0 to a SOFTIRQ-irq-unsafe lock: (fs_reclaim){+.+.}-{0:0} ... which became SOFTIRQ-irq-unsafe at: ... lock_acquire+0x175/0x4e0 fs_reclaim_acquire.part.0+0x20/0x30 kmem_cache_alloc_node_trace+0x2e/0x290 alloc_worker+0x2b/0xb0 init_rescuer.part.0+0x17/0xe0 workqueue_init+0x293/0x3bb kernel_init_freeable+0x149/0x325 kernel_init+0x8/0x116 ret_from_fork+0x3a/0x50 other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); local_irq_disable(); lock(&gvt->scheduler.mmio_context_lock); lock(fs_reclaim); lock(&gvt->scheduler.mmio_context_lock); *** DEADLOCK *** 3 locks held by cat/1439: #0: ffff888444a23698 (&p->lock){+.+.}-{3:3}, at: seq_read+0x49/0x680 #1: ffff88845b858068 (&gvt->lock){+.+.}-{3:3}, at: vgpu_mmio_diff_show+0xc7/0x2e0 #2: ffff88845b85cc90 (&gvt->scheduler.mmio_context_lock){+.-.}-{2:2}, at: vgpu_mmio_diff_show+0xcf/0x2e0 the dependencies between SOFTIRQ-irq-safe lock and the holding lock: -> (&gvt->scheduler.mmio_context_lock){+.-.}-{2:2} ops: 31 { HARDIRQ-ON-W at: lock_acquire+0x175/0x4e0 _raw_spin_lock_bh+0x2f/0x40 vgpu_mmio_diff_show+0xcf/0x2e0 seq_read+0x242/0x680 full_proxy_read+0x95/0xc0 vfs_read+0xc2/0x1b0 ksys_read+0xc4/0x160 do_syscall_64+0x63/0x290 entry_SYSCALL_64_after_hwframe+0x49/0xb3 IN-SOFTIRQ-W at: lock_acquire+0x175/0x4e0 _raw_spin_lock_irqsave+0x2b/0x40 shadow_context_status_change+0xfe/0x2f0 notifier_call_chain+0x6a/0xa0 __atomic_notifier_call_chain+0x5f/0xf0 execlists_schedule_out+0x42a/0x820 process_csb+0xe7/0x3e0 execlists_submission_tasklet+0x5c/0x1d0 tasklet_action_common.isra.0+0xeb/0x260 __do_softirq+0x11d/0x56f irq_exit+0xf6/0x100 do_IRQ+0x7f/0x160 ret_from_intr+0x0/0x2a cpuidle_enter_state+0xcd/0x5b0 cpuidle_enter+0x37/0x60 do_idle+0x337/0x3f0 cpu_startup_entry+0x14/0x20 start_kernel+0x58b/0x5c5 secondary_startup_64+0xa4/0xb0 INITIAL USE at: lock_acquire+0x175/0x4e0 _raw_spin_lock_irqsave+0x2b/0x40 shadow_context_status_change+0xfe/0x2f0 notifier_call_chain+0x6a/0xa0 __atomic_notifier_call_chain+0x5f/0xf0 execlists_schedule_in+0x2c8/0x690 __execlists_submission_tasklet+0x1303/0x1930 execlists_submit_request+0x1e7/0x230 submit_notify+0x105/0x2a4 __i915_sw_fence_complete+0xaa/0x380 __engine_park+0x313/0x5a0 ____intel_wakeref_put_last+0x3e/0x90 intel_gt_resume+0x41e/0x440 intel_gt_init+0x283/0xbc0 i915_gem_init+0x197/0x240 i915_driver_probe+0xc2d/0x12e0 i915_pci_probe+0xa2/0x1e0 local_pci_probe+0x6f/0xb0 pci_device_probe+0x171/0x230 really_probe+0x17a/0x380 driver_probe_device+0x70/0xf0 device_driver_attach+0x82/0x90 __driver_attach+0x60/0x100 bus_for_each_dev+0xe4/0x140 bus_add_driver+0x257/0x2a0 driver_register+0xd3/0x150 i915_init+0x6d/0x80 do_one_initcall+0xb8/0x3a0 kernel_init_freeable+0x2b4/0x325 kernel_init+0x8/0x116 ret_from_fork+0x3a/0x50 } __key.77812+0x0/0x40 ... acquired at: lock_acquire+0x175/0x4e0 fs_reclaim_acquire.part.0+0x20/0x30 kmem_cache_alloc_trace+0x2e/0x260 mmio_diff_handler+0xc0/0x150 intel_gvt_for_each_tracked_mmio+0x7b/0x140 vgpu_mmio_diff_show+0x111/0x2e0 seq_read+0x242/0x680 full_proxy_read+0x95/0xc0 vfs_read+0xc2/0x1b0 ksys_read+0xc4/0x160 do_syscall_64+0x63/0x290 entry_SYSCALL_64_after_hwframe+0x49/0xb3 the dependencies between the lock to be acquired and SOFTIRQ-irq-unsafe lock: -> (fs_reclaim){+.+.}-{0:0} ops: 1999031 { HARDIRQ-ON-W at: lock_acquire+0x175/0x4e0 fs_reclaim_acquire.part.0+0x20/0x30 kmem_cache_alloc_node_trace+0x2e/0x290 alloc_worker+0x2b/0xb0 init_rescuer.part.0+0x17/0xe0 workqueue_init+0x293/0x3bb kernel_init_freeable+0x149/0x325 kernel_init+0x8/0x116 ret_from_fork+0x3a/0x50 SOFTIRQ-ON-W at: lock_acquire+0x175/0x4e0 fs_reclaim_acquire.part.0+0x20/0x30 kmem_cache_alloc_node_trace+0x2e/0x290 alloc_worker+0x2b/0xb0 init_rescuer.part.0+0x17/0xe0 workqueue_init+0x293/0x3bb kernel_init_freeable+0x149/0x325 kernel_init+0x8/0x116 ret_from_fork+0x3a/0x50 INITIAL USE at: lock_acquire+0x175/0x4e0 fs_reclaim_acquire.part.0+0x20/0x30 kmem_cache_alloc_node_trace+0x2e/0x290 alloc_worker+0x2b/0xb0 init_rescuer.part.0+0x17/0xe0 workqueue_init+0x293/0x3bb kernel_init_freeable+0x149/0x325 kernel_init+0x8/0x116 ret_from_fork+0x3a/0x50 } __fs_reclaim_map+0x0/0x60 ... acquired at: lock_acquire+0x175/0x4e0 fs_reclaim_acquire.part.0+0x20/0x30 kmem_cache_alloc_trace+0x2e/0x260 mmio_diff_handler+0xc0/0x150 intel_gvt_for_each_tracked_mmio+0x7b/0x140 vgpu_mmio_diff_show+0x111/0x2e0 seq_read+0x242/0x680 full_proxy_read+0x95/0xc0 vfs_read+0xc2/0x1b0 ksys_read+0xc4/0x160 do_syscall_64+0x63/0x290 entry_SYSCALL_64_after_hwframe+0x49/0xb3 stack backtrace: CPU: 5 PID: 1439 Comm: cat Not tainted 5.7.0-rc2 #400 Hardware name: Intel(R) Client Systems NUC8i7BEH/NUC8BEB, BIOS BECFL357.86A.0056.2018.1128.1717 11/28/2018 Call Trace: dump_stack+0x97/0xe0 check_irq_usage.cold+0x428/0x434 ? check_usage_forwards+0x2c0/0x2c0 ? class_equal+0x11/0x20 ? __bfs+0xd2/0x2d0 ? in_any_class_list+0xa0/0xa0 ? check_path+0x22/0x40 ? check_noncircular+0x150/0x2b0 ? print_circular_bug.isra.0+0x1b0/0x1b0 ? mark_lock+0x13d/0xc50 ? __lock_acquire+0x1e32/0x39b0 __lock_acquire+0x1e32/0x39b0 ? timerqueue_add+0xc1/0x130 ? register_lock_class+0xa60/0xa60 ? mark_lock+0x13d/0xc50 lock_acquire+0x175/0x4e0 ? __zone_pcp_update+0x80/0x80 ? check_flags.part.0+0x210/0x210 ? mark_held_locks+0x65/0x90 ? _raw_spin_unlock_irqrestore+0x32/0x40 ? lockdep_hardirqs_on+0x190/0x290 ? fwtable_read32+0x163/0x480 ? mmio_diff_handler+0xc0/0x150 fs_reclaim_acquire.part.0+0x20/0x30 ? __zone_pcp_update+0x80/0x80 kmem_cache_alloc_trace+0x2e/0x260 mmio_diff_handler+0xc0/0x150 ? vgpu_mmio_diff_open+0x30/0x30 intel_gvt_for_each_tracked_mmio+0x7b/0x140 vgpu_mmio_diff_show+0x111/0x2e0 ? mmio_diff_handler+0x150/0x150 ? rcu_read_lock_sched_held+0xa0/0xb0 ? rcu_read_lock_bh_held+0xc0/0xc0 ? kasan_unpoison_shadow+0x33/0x40 ? __kasan_kmalloc.constprop.0+0xc2/0xd0 seq_read+0x242/0x680 ? debugfs_locked_down.isra.0+0x70/0x70 full_proxy_read+0x95/0xc0 vfs_read+0xc2/0x1b0 ksys_read+0xc4/0x160 ? kernel_write+0xb0/0xb0 ? mark_held_locks+0x24/0x90 do_syscall_64+0x63/0x290 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x7ffbe3e6efb2 Code: c0 e9 c2 fe ff ff 50 48 8d 3d ca cb 0a 00 e8 f5 19 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24 RSP: 002b:00007ffd021c08a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007ffbe3e6efb2 RDX: 0000000000020000 RSI: 00007ffbe34cd000 RDI: 0000000000000003 RBP: 00007ffbe34cd000 R08: 00007ffbe34cc010 R09: 0000000000000000 R10: 0000000000000022 R11: 0000000000000246 R12: 0000562b6f0a11f0 R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000 ------------[ cut here ]------------ Acked-by: Zhenyu Wang Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200601035556.19999-1-colin.xu@intel.com commit fc1e3aa0337c76b620726e205372073c234616ab Author: Colin Xu Date: Mon Jun 1 11:07:21 2020 +0800 drm/i915/gvt: Fix incorrect check of enabled bits in mask registers Using _MASKED_BIT_ENABLE macro to set mask register bits is straight forward and not likely to go wrong. However when checking which bit(s) is(are) enabled, simply bitwise AND value and _MASKED_BIT_ENABLE() won't output expected result. Suppose the register write is disabling bit 1 by setting 0xFFFF0000, however "& _MASKED_BIT_ENABLE(1)" outputs 0x00010000, and the non-zero check will pass which cause the old code consider the new value set as an enabling operation. We found guest set 0x80008000 on boot, and set 0xffff8000 during resume. Both are legal settings but old code will block latter and force vgpu enter fail-safe mode. Introduce two new macro and make proper masked bit check in mmio handler: IS_MASKED_BITS_ENABLED() IS_MASKED_BITS_DISABLED() V2: Rebase. Reviewed-by: Zhenyu Wang Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200601030721.17129-1-colin.xu@intel.com commit fccd0f7cf4d532674d727c7f204f038456675dee Author: Colin Xu Date: Mon Jun 1 11:06:38 2020 +0800 drm/i915/gvt: Fix two CFL MMIO handling caused by regression. D_CFL was incorrectly removed for: GAMT_CHKN_BIT_REG GEN9_CTX_PREEMPT_REG V2: Update commit message. V3: Rebase and split Fixes and mis-handled MMIO. Fixes: 43226e6fe798 (drm/i915/gvt: replaced register address with name) Reviewed-by: Zhenyu Wang Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200601030638.16002-1-colin.xu@intel.com commit 2de60af4a4633be12e5559ed2d3c27613f715d53 Author: Colin Xu Date: Mon Jun 1 11:04:57 2020 +0800 drm/i915/gvt: Add one missing MMIO handler for D_SKL_PLUS _PLANE_CTL_3_A, _PLANE_CTL_3_B and _PLANE_SURF_3_A are handled, but miss _PLANE_SURF_3_B. Reviewed-by: Zhenyu Wang Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200601030457.14002-1-colin.xu@intel.com commit b19d57d0f3cc6f1022edf94daf1d70506a09e3c2 Author: Gustavo A. R. Silva Date: Mon Jun 8 20:22:33 2020 -0500 overflow.h: Add flex_array_size() helper Add flex_array_size() helper for the calculation of the size, in bytes, of a flexible array member contained within an enclosing structure. Example of usage: struct something { size_t count; struct foo items[]; }; struct something *instance; instance = kmalloc(struct_size(instance, items, count), GFP_KERNEL); instance->count = count; memcpy(instance->items, src, flex_array_size(instance, items, instance->count)); The helper returns SIZE_MAX on overflow instead of wrapping around. Additionally replaces parameter "n" with "count" in struct_size() helper for greater clarity and unification. Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200609012233.GA3371@embeddedor Signed-off-by: Kees Cook commit 0f50d21ade110e519425a5c1e2cfee7a130d1a0e Author: Masanari Iida Date: Tue Jun 16 21:51:32 2020 +0900 scripts: Fix typo in headers_install.sh This patch fixes a spelling typo in scripts/headers_install.sh Signed-off-by: Masanari Iida Signed-off-by: Masahiro Yamada commit 4d0831e8a029c03f49f434f28b8faef9f0bd403f Author: Masahiro Yamada Date: Sun Jun 14 23:43:41 2020 +0900 kconfig: unify cc-option and as-option cc-option and as-option are almost the same; both pass the flag to $(CC). The main difference is the cc-option stops before the assemble stage (-S option) whereas as-option stops after (-c option). I chose -S because it is slightly faster, but $(cc-option,-gz=zlib) returns a wrong result (https://lkml.org/lkml/2020/6/9/1529). It has been fixed by commit 7b16994437c7 ("Makefile: Improve compressed debug info support detection"), but the assembler should always be invoked for more reliable compiler option tests. However, you cannot simply replace -S with -c because the following code in lib/Kconfig.debug would break: depends on $(cc-option,-gsplit-dwarf) The combination of -c and -gsplit-dwarf does not accept /dev/null as output. $ cat /dev/null | gcc -gsplit-dwarf -S -x c - -o /dev/null $ echo $? 0 $ cat /dev/null | gcc -gsplit-dwarf -c -x c - -o /dev/null objcopy: Warning: '/dev/null' is not an ordinary file $ echo $? 1 $ cat /dev/null | gcc -gsplit-dwarf -c -x c - -o tmp.o $ echo $? 0 There is another flag that creates an separate file based on the object file path: $ cat /dev/null | gcc -ftest-coverage -c -x c - -o /dev/null :1: error: cannot open /dev/null.gcno So, we cannot use /dev/null to sink the output. Align the cc-option implementation with scripts/Kbuild.include. With -c option used in cc-option, as-option is unneeded. Signed-off-by: Masahiro Yamada Acked-by: Will Deacon commit 5414251aa2e23ad50cc769656b05ea196090e792 Author: Masami Hiramatsu Date: Tue Jun 16 19:14:34 2020 +0900 tools/bootconfig: Add testcase for show-command and quotes test Add testcases for the return value of the command to show bootconfig in initrd, and double/single quotes selecting. Link: http://lkml.kernel.org/r/159230247428.65555.2109472942519215104.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit f91cb5b7476a603068eae31e5b2cc170dd2b9b1b Author: Masami Hiramatsu Date: Tue Jun 16 19:14:25 2020 +0900 tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig Fix bootconfig to return 0 if succeeded to show the bootconfig in initrd. Without this fix, "bootconfig INITRD" command returns !0 even if the command succeeded to show the bootconfig. Link: http://lkml.kernel.org/r/159230246566.65555.11891772258543514487.stgit@devnote2 Cc: stable@vger.kernel.org Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 272da3279df191f028fd63d1683e5ecd56fcb13b Author: Masami Hiramatsu Date: Tue Jun 16 19:14:17 2020 +0900 tools/bootconfig: Fix to use correct quotes for value Fix bootconfig tool to select double or single quotes correctly according to the value. If a bootconfig value includes a double quote character, we must use single-quotes to quote that value. Link: http://lkml.kernel.org/r/159230245697.65555.12444299015852932304.stgit@devnote2 Cc: stable@vger.kernel.org Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 4e264ffd953463cd14c0720eaa9315ac052f5973 Author: Masami Hiramatsu Date: Tue Jun 16 19:14:08 2020 +0900 proc/bootconfig: Fix to use correct quotes for value Fix /proc/bootconfig to select double or single quotes corrctly according to the value. If a bootconfig value includes a double quote character, we must use single-quotes to quote that value. This modifies if() condition and blocks for avoiding double-quote in value check in 2 places. Anyway, since xbc_array_for_each_value() can handle the array which has a single node correctly. Thus, if (vnode && xbc_node_is_array(vnode)) { xbc_array_for_each_value(vnode) /* vnode->next != NULL */ ... } else { snprintf(val); /* val is an empty string if !vnode */ } is equivalent to if (vnode) { xbc_array_for_each_value(vnode) /* vnode->next can be NULL */ ... } else { snprintf(""); /* value is always empty */ } Link: http://lkml.kernel.org/r/159230244786.65555.3763894451251622488.stgit@devnote2 Cc: stable@vger.kernel.org Fixes: c1a3c36017d4 ("proc: bootconfig: Add /proc/bootconfig to show boot config list") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 69243720c0932b8672e571a873c78bcf3326575a Author: YangHui Date: Tue Jun 16 11:36:46 2020 +0800 tracing: Remove unused event variable in tracing_iter_reset We do not use the event variable, just remove it. Signed-off-by: YangHui Signed-off-by: Steven Rostedt (VMware) commit 3aa8fdc37d16735e8891035becf25b3857d3efe0 Author: Vamshi K Sthambamkadi Date: Mon Jun 15 20:00:38 2020 +0530 tracing/probe: Fix memleak in fetch_op_data operations kmemleak report: [<57dcc2ca>] __kmalloc_track_caller+0x139/0x2b0 [] kstrndup+0x37/0x80 [] parse_probe_arg.isra.7+0x3cc/0x630 [<055bf2ba>] traceprobe_parse_probe_arg+0x2f5/0x810 [<655a7766>] trace_kprobe_create+0x2ca/0x950 [<4fc6a02a>] create_or_delete_trace_kprobe+0xf/0x30 [<6d1c8a52>] trace_run_command+0x67/0x80 [] trace_parse_run_command+0xa7/0x140 [] probes_write+0x10/0x20 [<2027641c>] __vfs_write+0x30/0x1e0 [<6a4aeee1>] vfs_write+0x96/0x1b0 [<3517fb7d>] ksys_write+0x53/0xc0 [] __ia32_sys_write+0x15/0x20 [] do_syscall_32_irqs_on+0x3d/0x260 [] do_fast_syscall_32+0x39/0xb0 [] entry_SYSENTER_32+0xaf/0x102 Post parse_probe_arg(), the FETCH_OP_DATA operation type is overwritten to FETCH_OP_ST_STRING, as a result memory is never freed since traceprobe_free_probe_arg() iterates only over SYMBOL and DATA op types Setup fetch string operation correctly after fetch_op_data operation. Link: https://lkml.kernel.org/r/20200615143034.GA1734@cosmos Cc: stable@vger.kernel.org Fixes: a42e3c4de964 ("tracing/probe: Add immediate string parameter support") Acked-by: Masami Hiramatsu Signed-off-by: Vamshi K Sthambamkadi Signed-off-by: Steven Rostedt (VMware) commit 48a42f5d138435242529726b8802076a24b6db17 Author: Wei Yang Date: Wed Jun 10 11:32:51 2020 +0800 trace: Fix typo in allocate_ftrace_ops()'s comment No functional change, just correct the word. Link: https://lkml.kernel.org/r/20200610033251.31713-1-richard.weiyang@linux.alibaba.com Signed-off-by: Wei Yang Signed-off-by: Steven Rostedt (VMware) commit 4649079b9de1ad86be9f4c989373adb8235a8485 Author: Steven Rostedt (VMware) Date: Tue Jun 9 22:00:41 2020 -0400 tracing: Make ftrace packed events have align of 1 When using trace-cmd on 5.6-rt for the function graph tracer, the output was corrupted. It gave output like this: funcgraph_entry: func=0xffffffff depth=38982 funcgraph_entry: func=0x1ffffffff depth=16044 funcgraph_exit: func=0xffffffff overrun=0x92539aaf00000000 calltime=0x92539c9900000072 rettime=0x100000072 depth=11084 funcgraph_exit: func=0xffffffff overrun=0x9253946e00000000 calltime=0x92539e2100000072 rettime=0x72 depth=26033702 funcgraph_entry: func=0xffffffff depth=85798 funcgraph_entry: func=0x1ffffffff depth=12044 The reason was because the tracefs/events/ftrace/funcgraph_entry/exit format file was incorrect. The -rt kernel adds more common fields to the trace events. Namely, common_migrate_disable and common_preempt_lazy_count. Each is one byte in size. This changes the alignment of the normal payload. Most events are aligned normally, but the function and function graph events are defined with a "PACKED" macro, that packs their payload. As the offsets displayed in the format files are now calculated by an aligned field, the aligned field for function and function graph events should be 1, not their normal alignment. With aligning of the funcgraph_entry event, the format file has: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:unsigned char common_migrate_disable; offset:8; size:1; signed:0; field:unsigned char common_preempt_lazy_count; offset:9; size:1; signed:0; field:unsigned long func; offset:16; size:8; signed:0; field:int depth; offset:24; size:4; signed:1; But the actual alignment is: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:unsigned char common_migrate_disable; offset:8; size:1; signed:0; field:unsigned char common_preempt_lazy_count; offset:9; size:1; signed:0; field:unsigned long func; offset:12; size:8; signed:0; field:int depth; offset:20; size:4; signed:1; Link: https://lkml.kernel.org/r/20200609220041.2a3b527f@oasis.local.home Cc: stable@vger.kernel.org Fixes: 04ae87a52074e ("ftrace: Rework event_create_dir()") Signed-off-by: Steven Rostedt (VMware) commit 9fbc01cdba66e988122ccdc6094cfd85d9587769 Author: Kefeng Wang Date: Tue Jun 9 13:52:00 2020 +0000 sample-trace-array: Remove trace_array 'sample-instance' Remove trace_array 'sample-instance' if kthread_run fails in sample_trace_array_init(). Link: https://lkml.kernel.org/r/20200609135200.2206726-1-wangkefeng.wang@huawei.com Cc: stable@vger.kernel.org Fixes: 89ed42495ef4a ("tracing: Sample module to demonstrate kernel access to Ftrace instances.") Reviewed-by: Divya Indi Signed-off-by: Kefeng Wang Signed-off-by: Steven Rostedt (VMware) commit e9b7b1c0c103a623be1a65c39f98719803440871 Author: Kefeng Wang Date: Wed Jun 10 01:12:44 2020 +0000 sample-trace-array: Fix sleeping function called from invalid context BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/5 1 lock held by swapper/5/0: #0: ffff80001002bd90 (samples/ftrace/sample-trace-array.c:38){+.-.}-{0:0}, at: call_timer_fn+0x8/0x3e0 CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.7.0+ #8 Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x20/0x30 dump_stack+0xe4/0x150 ___might_sleep+0x160/0x200 __might_sleep+0x58/0x90 __mutex_lock+0x64/0x948 mutex_lock_nested+0x3c/0x58 __ftrace_set_clr_event+0x44/0x88 trace_array_set_clr_event+0x24/0x38 mytimer_handler+0x34/0x40 [sample_trace_array] mutex_lock() will be called in interrupt context, using workqueue to fix it. Link: https://lkml.kernel.org/r/20200610011244.2209486-1-wangkefeng.wang@huawei.com Cc: stable@vger.kernel.org Fixes: 89ed42495ef4 ("tracing: Sample module to demonstrate kernel access to Ftrace instances.") Reviewed-by: Divya Indi Signed-off-by: Kefeng Wang Signed-off-by: Steven Rostedt (VMware) commit 9b38cc704e844e41d9cf74e647bff1d249512cb3 Author: Jiri Olsa Date: Tue May 12 17:03:18 2020 +0900 kretprobe: Prevent triggering kretprobe from within kprobe_flush_task Ziqian reported lockup when adding retprobe on _raw_spin_lock_irqsave. My test was also able to trigger lockdep output: ============================================ WARNING: possible recursive locking detected 5.6.0-rc6+ #6 Not tainted -------------------------------------------- sched-messaging/2767 is trying to acquire lock: ffffffff9a492798 (&(kretprobe_table_locks[i].lock)){-.-.}, at: kretprobe_hash_lock+0x52/0xa0 but task is already holding lock: ffffffff9a491a18 (&(kretprobe_table_locks[i].lock)){-.-.}, at: kretprobe_trampoline+0x0/0x50 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(kretprobe_table_locks[i].lock)); lock(&(kretprobe_table_locks[i].lock)); *** DEADLOCK *** May be due to missing lock nesting notation 1 lock held by sched-messaging/2767: #0: ffffffff9a491a18 (&(kretprobe_table_locks[i].lock)){-.-.}, at: kretprobe_trampoline+0x0/0x50 stack backtrace: CPU: 3 PID: 2767 Comm: sched-messaging Not tainted 5.6.0-rc6+ #6 Call Trace: dump_stack+0x96/0xe0 __lock_acquire.cold.57+0x173/0x2b7 ? native_queued_spin_lock_slowpath+0x42b/0x9e0 ? lockdep_hardirqs_on+0x590/0x590 ? __lock_acquire+0xf63/0x4030 lock_acquire+0x15a/0x3d0 ? kretprobe_hash_lock+0x52/0xa0 _raw_spin_lock_irqsave+0x36/0x70 ? kretprobe_hash_lock+0x52/0xa0 kretprobe_hash_lock+0x52/0xa0 trampoline_handler+0xf8/0x940 ? kprobe_fault_handler+0x380/0x380 ? find_held_lock+0x3a/0x1c0 kretprobe_trampoline+0x25/0x50 ? lock_acquired+0x392/0xbc0 ? _raw_spin_lock_irqsave+0x50/0x70 ? __get_valid_kprobe+0x1f0/0x1f0 ? _raw_spin_unlock_irqrestore+0x3b/0x40 ? finish_task_switch+0x4b9/0x6d0 ? __switch_to_asm+0x34/0x70 ? __switch_to_asm+0x40/0x70 The code within the kretprobe handler checks for probe reentrancy, so we won't trigger any _raw_spin_lock_irqsave probe in there. The problem is in outside kprobe_flush_task, where we call: kprobe_flush_task kretprobe_table_lock raw_spin_lock_irqsave _raw_spin_lock_irqsave where _raw_spin_lock_irqsave triggers the kretprobe and installs kretprobe_trampoline handler on _raw_spin_lock_irqsave return. The kretprobe_trampoline handler is then executed with already locked kretprobe_table_locks, and first thing it does is to lock kretprobe_table_locks ;-) the whole lockup path like: kprobe_flush_task kretprobe_table_lock raw_spin_lock_irqsave _raw_spin_lock_irqsave ---> probe triggered, kretprobe_trampoline installed ---> kretprobe_table_locks locked kretprobe_trampoline trampoline_handler kretprobe_hash_lock(current, &head, &flags); <--- deadlock Adding kprobe_busy_begin/end helpers that mark code with fake probe installed to prevent triggering of another kprobe within this code. Using these helpers in kprobe_flush_task, so the probe recursion protection check is hit and the probe is never set to prevent above lockup. Link: http://lkml.kernel.org/r/158927059835.27680.7011202830041561604.stgit@devnote2 Fixes: ef53d9c5e4da ("kprobes: improve kretprobe scalability with hashed locking") Cc: Ingo Molnar Cc: "Gustavo A . R . Silva" Cc: Anders Roxell Cc: "Naveen N . Rao" Cc: Anil S Keshavamurthy Cc: David Miller Cc: Ingo Molnar Cc: Peter Zijlstra Cc: stable@vger.kernel.org Reported-by: "Ziqian SUN (Zamir)" Acked-by: Masami Hiramatsu Signed-off-by: Jiri Olsa Signed-off-by: Steven Rostedt (VMware) commit 75ddf64dd276e3fc8906f27549afa229798ad916 Author: Masami Hiramatsu Date: Tue May 12 17:03:07 2020 +0900 kprobes: Remove redundant arch_disarm_kprobe() call Fix to remove redundant arch_disarm_kprobe() call in force_unoptimize_kprobe(). This arch_disarm_kprobe() will be invoked if the kprobe is optimized but disabled, but that means the kprobe (optprobe) is unused (and unoptimized) state. In that case, unoptimize_kprobe() puts it in freeing_list and kprobe_optimizer (do_unoptimize_kprobes()) automatically disarm it. Thus this arch_disarm_kprobe() is redundant. Link: http://lkml.kernel.org/r/158927058719.27680.17183632908465341189.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 1a0aa991a6274161c95a844c58cfb801d681eb59 Author: Masami Hiramatsu Date: Tue May 12 17:02:56 2020 +0900 kprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex In kprobe_optimizer() kick_kprobe_optimizer() is called without kprobe_mutex, but this can race with other caller which is protected by kprobe_mutex. To fix that, expand kprobe_mutex protected area to protect kick_kprobe_optimizer() call. Link: http://lkml.kernel.org/r/158927057586.27680.5036330063955940456.stgit@devnote2 Fixes: cd7ebe2298ff ("kprobes: Use text_poke_smp_batch for optimizing") Cc: Ingo Molnar Cc: "Gustavo A . R . Silva" Cc: Anders Roxell Cc: "Naveen N . Rao" Cc: Anil S Keshavamurthy Cc: David Miller Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Ziqian SUN Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 7e6a71d8e60187726e29b13d9e9b23b77026c17a Author: Masami Hiramatsu Date: Tue May 12 17:02:44 2020 +0900 kprobes: Use non RCU traversal APIs on kprobe_tables if possible Current kprobes uses RCU traversal APIs on kprobe_tables even if it is safe because kprobe_mutex is locked. Make those traversals to non-RCU APIs where the kprobe_mutex is locked. Link: http://lkml.kernel.org/r/158927056452.27680.9710575332163005121.stgit@devnote2 Reviewed-by: Joel Fernandes (Google) Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 6743ad432ec92e680cd0d9db86cb17b949cf5a43 Author: Masami Hiramatsu Date: Tue May 12 17:02:33 2020 +0900 kprobes: Suppress the suspicious RCU warning on kprobes Anders reported that the lockdep warns that suspicious RCU list usage in register_kprobe() (detected by CONFIG_PROVE_RCU_LIST.) This is because get_kprobe() access kprobe_table[] by hlist_for_each_entry_rcu() without rcu_read_lock. If we call get_kprobe() from the breakpoint handler context, it is run with preempt disabled, so this is not a problem. But in other cases, instead of rcu_read_lock(), we locks kprobe_mutex so that the kprobe_table[] is not updated. So, current code is safe, but still not good from the view point of RCU. Joel suggested that we can silent that warning by passing lockdep_is_held() to the last argument of hlist_for_each_entry_rcu(). Add lockdep_is_held(&kprobe_mutex) at the end of the hlist_for_each_entry_rcu() to suppress the warning. Link: http://lkml.kernel.org/r/158927055350.27680.10261450713467997503.stgit@devnote2 Reported-by: Anders Roxell Suggested-by: Joel Fernandes Reviewed-by: Joel Fernandes (Google) Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 4ef57b21d6fb49d2b25c47e4cff467a0c2c8b6b7 Author: Sami Tolvanen Date: Fri Apr 24 12:30:46 2020 -0700 recordmcount: support >64k sections When compiling a kernel with Clang and LTO, we need to run recordmcount on vmlinux.o with a large number of sections, which currently fails as the program doesn't understand extended section indexes. This change adds support for processing binaries with >64k sections. Link: https://lkml.kernel.org/r/20200424193046.160744-1-samitolvanen@google.com Link: https://lore.kernel.org/lkml/CAK7LNARbZhoaA=Nnuw0=gBrkuKbr_4Ng_Ei57uafujZf7Xazgw@mail.gmail.com/ Cc: Kees Cook Reviewed-by: Matt Helsley Signed-off-by: Sami Tolvanen Signed-off-by: Steven Rostedt (VMware) commit f2f02ebd8f3833626642688b2d2c6a7b3c141fa9 Author: Masahiro Yamada Date: Sun Jun 14 23:43:40 2020 +0900 kbuild: improve cc-option to clean up all temporary files When cc-option and friends evaluate compiler flags, the temporary file $$TMP is created as an output object, and automatically cleaned up. The actual file path of $$TMP is ..tmp, here is the process ID of $(shell ...) invoked from cc-option. (Please note $$$$ is the escape sequence of $$). Such garbage files are cleaned up in most cases, but some compiler flags create additional output files. For example, -gsplit-dwarf creates a .dwo file. When CONFIG_DEBUG_INFO_SPLIT=y, you will see a bunch of ..dwo files left in the top of build directories. You may not notice them unless you do 'ls -a', but the garbage files will increase every time you run 'make'. This commit changes the temporary object path to .tmp_/tmp, and removes .tmp_ directory when exiting. Separate build artifacts such as *.dwo will be cleaned up all together because their file paths are usually determined based on the base name of the object. Another example is -ftest-coverage, which outputs the coverage data into .gcno Signed-off-by: Masahiro Yamada commit 69119673bd50b176ded34032fadd41530fb5af21 Merge: 26c20ffcb5c8 c9f66b43ee27 Author: Linus Torvalds Date: Tue Jun 16 17:44:54 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from David Miller: 1) Don't get per-cpu pointer with preemption enabled in nft_set_pipapo, fix from Stefano Brivio. 2) Fix memory leak in ctnetlink, from Pablo Neira Ayuso. 3) Multiple definitions of MPTCP_PM_MAX_ADDR, from Geliang Tang. 4) Accidently disabling NAPI in non-error paths of macb_open(), from Charles Keepax. 5) Fix races between alx_stop and alx_remove, from Zekun Shen. 6) We forget to re-enable SRIOV during resume in bnxt_en driver, from Michael Chan. 7) Fix memory leak in ipv6_mc_destroy_dev(), from Wang Hai. 8) rxtx stats use wrong index in mvpp2 driver, from Sven Auhagen. 9) Fix memory leak in mptcp_subflow_create_socket error path, from Wei Yongjun. 10) We should not adjust the TCP window advertised when sending dup acks in non-SACK mode, because it won't be counted as a dup by the sender if the window size changes. From Eric Dumazet. 11) Destroy the right number of queues during remove in mvpp2 driver, from Sven Auhagen. 12) Various WOL and PM fixes to e1000 driver, from Chen Yu, Vaibhav Gupta, and Arnd Bergmann. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (35 commits) e1000e: fix unused-function warning e1000: use generic power management e1000e: Do not wake up the system via WOL if device wakeup is disabled lan743x: add MODULE_DEVICE_TABLE for module loading alias mlxsw: spectrum: Adjust headroom buffers for 8x ports bareudp: Fixed configuration to avoid having garbage values mvpp2: remove module bugfix tcp: grow window for OOO packets only for SACK flows mptcp: fix memory leak in mptcp_subflow_create_socket() netfilter: flowtable: Make nf_flow_table_offload_add/del_cb inline net/sched: act_ct: Make tcf_ct_flow_table_restore_skb inline net: dsa: sja1105: fix PTP timestamping with large tc-taprio cycles mvpp2: ethtool rxtx stats fix MAINTAINERS: switch to my private email for Renesas Ethernet drivers rocker: fix incorrect error handling in dma_rings_init test_objagg: Fix potential memory leak in error handling net: ethernet: mtk-star-emac: simplify interrupt handling mld: fix memory leak in ipv6_mc_destroy_dev() bnxt_en: Return from timer if interface is not in open state. bnxt_en: Fix AER reset logic on 57500 chips. ... commit 26c20ffcb5c86eb6a052e0d528396de5600c9710 Merge: f17957f71d10 b6489a49f7b7 Author: Linus Torvalds Date: Tue Jun 16 17:40:51 2020 -0700 Merge tag 'afs-fixes-20200616' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS fixes from David Howells: "I've managed to get xfstests kind of working with afs. Here are a set of patches that fix most of the bugs found. There are a number of primary issues: - Incorrect handling of mtime and non-handling of ctime. It might be argued, that the latter isn't a bug since the AFS protocol doesn't support ctime, but I should probably still update it locally. - Shared-write mmap, truncate and writeback bugs. This includes not changing i_size under the callback lock, overwriting local i_size with the reply from the server after a partial writeback, not limiting the writeback from an mmapped page to EOF. - Checks for an abort code indicating that the primary vnode in an operation was deleted by a third-party are done in the wrong place. - Silly rename bugs. This includes an incomplete conversion to the new operation handling, duplicate nlink handling, nlink changing not being done inside the callback lock and insufficient handling of third-party conflicting directory changes. And some secondary ones: - The UAEOVERFLOW abort code should map to EOVERFLOW not EREMOTEIO. - Remove a couple of unused or incompletely used bits. - Remove a couple of redundant success checks. These seem to fix all the data-corruption bugs found by ./check -afs -g quick along with the obvious silly rename bugs and time bugs. There are still some test failures, but they seem to fall into two classes: firstly, the authentication/security model is different to the standard UNIX model and permission is arbitrated by the server and cached locally; and secondly, there are a number of features that AFS does not support (such as mknod). But in these cases, the tests themselves need to be adapted or skipped. Using the in-kernel afs client with xfstests also found a bug in the AuriStor AFS server that has been fixed for a future release" * tag 'afs-fixes-20200616' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Fix silly rename afs: afs_vnode_commit_status() doesn't need to check the RPC error afs: Fix use of afs_check_for_remote_deletion() afs: Remove afs_operation::abort_code afs: Fix yfs_fs_fetch_status() to honour vnode selector afs: Remove yfs_fs_fetch_file_status() as it's not used afs: Fix the mapping of the UAEOVERFLOW abort code afs: Fix truncation issues and mmap writeback size afs: Concoct ctimes afs: Fix EOF corruption afs: afs_write_end() should change i_size under the right lock afs: Fix non-setting of mtime when writing into mmap commit f17957f71d104d014118259acdcfe6315e24bb3a Author: Randy Dunlap Date: Sun Jun 14 19:59:07 2020 -0700 Documentation: remove SH-5 index entries Remove SH-5 documentation index entries following the removal of SH-5 source code. Error: Cannot open file ../arch/sh/mm/tlb-sh5.c Error: Cannot open file ../arch/sh/mm/tlb-sh5.c Error: Cannot open file ../arch/sh/include/asm/tlb_64.h Error: Cannot open file ../arch/sh/include/asm/tlb_64.h Fixes: 3b69e8b45711 ("Merge tag 'sh-for-5.8' of git://git.libc.org/linux-sh") Signed-off-by: Randy Dunlap Reviewed-by: Geert Uytterhoeven Cc: Rich Felker Cc: Christoph Hellwig Cc: Arnd Bergmann Cc: ysato@users.sourceforge.jp Cc: linux-sh@vger.kernel.org Cc: Geert Uytterhoeven Cc: Linus Torvalds Signed-off-by: Linus Torvalds commit aa449a7965a6172a89d48844c313708962216f1f Author: Tom Rix Date: Mon Jun 15 13:45:48 2020 -0700 selinux: fix a double free in cond_read_node()/cond_read_list() Clang static analysis reports this double free error security/selinux/ss/conditional.c:139:2: warning: Attempt to free released memory [unix.Malloc] kfree(node->expr.nodes); ^~~~~~~~~~~~~~~~~~~~~~~ When cond_read_node fails, it calls cond_node_destroy which frees the node but does not poison the entry in the node list. So when it returns to its caller cond_read_list, cond_read_list deletes the partial list. The latest entry in the list will be deleted twice. So instead of freeing the node in cond_read_node, let list freeing in code_read_list handle the freeing the problem node along with all of the earlier nodes. Because cond_read_node no longer does any error handling, the goto's the error case are redundant. Instead just return the error code. Cc: stable@vger.kernel.org Fixes: 60abd3181db2 ("selinux: convert cond_list to array") Signed-off-by: Tom Rix Reviewed-by: Ondrej Mosnacek [PM: subject line tweaks] Signed-off-by: Paul Moore commit ffbc93768e9d3a3dafdd90124b1244b4723d30e8 Merge: ff58155ca4fa 76fafbfffb44 Author: Linus Torvalds Date: Tue Jun 16 17:23:57 2020 -0700 Merge tag 'flex-array-conversions-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull flexible-array member conversions from Gustavo A. R. Silva: "Replace zero-length arrays with flexible-array members. Notice that all of these patches have been baking in linux-next for two development cycles now. There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. C99 introduced “flexible array members”, which lacks a numeric size for the array declaration entirely: struct something { size_t count; struct foo items[]; }; This is the way the kernel expects dynamically sized trailing elements to be declared. It allows the compiler to generate errors when the flexible array does not occur last in the structure, which helps to prevent some kind of undefined behavior[3] bugs from being inadvertently introduced to the codebase. It also allows the compiler to correctly analyze array sizes (via sizeof(), CONFIG_FORTIFY_SOURCE, and CONFIG_UBSAN_BOUNDS). For instance, there is no mechanism that warns us that the following application of the sizeof() operator to a zero-length array always results in zero: struct something { size_t count; struct foo items[0]; }; struct something *instance; instance = kmalloc(struct_size(instance, items, count), GFP_KERNEL); instance->count = count; size = sizeof(instance->items) * instance->count; memcpy(instance->items, source, size); At the last line of code above, size turns out to be zero, when one might have thought it represents the total size in bytes of the dynamic memory recently allocated for the trailing array items. Here are a couple examples of this issue[4][5]. Instead, flexible array members have incomplete type, and so the sizeof() operator may not be applied[6], so any misuse of such operators will be immediately noticed at build time. The cleanest and least error-prone way to implement this is through the use of a flexible array member: struct something { size_t count; struct foo items[]; }; struct something *instance; instance = kmalloc(struct_size(instance, items, count), GFP_KERNEL); instance->count = count; size = sizeof(instance->items[0]) * instance->count; memcpy(instance->items, source, size); instead" [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") [4] commit f2cd32a443da ("rndis_wlan: Remove logically dead code") [5] commit ab91c2a89f86 ("tpm: eventlog: Replace zero-length array with flexible-array member") [6] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html * tag 'flex-array-conversions-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: (41 commits) w1: Replace zero-length array with flexible-array tracing/probe: Replace zero-length array with flexible-array soc: ti: Replace zero-length array with flexible-array tifm: Replace zero-length array with flexible-array dmaengine: tegra-apb: Replace zero-length array with flexible-array stm class: Replace zero-length array with flexible-array Squashfs: Replace zero-length array with flexible-array ASoC: SOF: Replace zero-length array with flexible-array ima: Replace zero-length array with flexible-array sctp: Replace zero-length array with flexible-array phy: samsung: Replace zero-length array with flexible-array RxRPC: Replace zero-length array with flexible-array rapidio: Replace zero-length array with flexible-array media: pwc: Replace zero-length array with flexible-array firmware: pcdp: Replace zero-length array with flexible-array oprofile: Replace zero-length array with flexible-array block: Replace zero-length array with flexible-array tools/testing/nvdimm: Replace zero-length array with flexible-array libata: Replace zero-length array with flexible-array kprobes: Replace zero-length array with flexible-array ... commit ff58155ca4fa7e931f34d948fa09fe14c6a66116 Author: Arvind Sankar Date: Tue Jun 16 18:25:47 2020 -0400 x86/purgatory: Add -fno-stack-protector The purgatory Makefile removes -fstack-protector options if they were configured in, but does not currently add -fno-stack-protector. If gcc was configured with the --enable-default-ssp configure option, this results in the stack protector still being enabled for the purgatory (absent distro-specific specs files that might disable it again for freestanding compilations), if the main kernel is being compiled with stack protection enabled (if it's disabled for the main kernel, the top-level Makefile will add -fno-stack-protector). This will break the build since commit e4160b2e4b02 ("x86/purgatory: Fail the build if purgatory.ro has missing symbols") and prior to that would have caused runtime failure when trying to use kexec. Explicitly add -fno-stack-protector to avoid this, as done in other Makefiles that need to disable the stack protector. Reported-by: Gabriel C Signed-off-by: Arvind Sankar Signed-off-by: Linus Torvalds commit c9f66b43ee27409e1b614434d87e0e722efaa5f2 Merge: ea12fe9dee97 880e6269fd6e Author: David S. Miller Date: Tue Jun 16 16:16:24 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2020-06-16 This series contains fixes to e1000 and e1000e. Chen fixes an e1000e issue where systems could be waken via WoL, even though the user has disabled the wakeup bit via sysfs. Vaibhav Gupta updates the e1000 driver to clean up the legacy Power Management hooks. Arnd Bergmann cleans up the inconsistent use CONFIG_PM_SLEEP preprocessor tags, which also resolves the compiler warnings about the possibility of unused structure. ==================== Signed-off-by: David S. Miller commit 86f56395feb2b106b125c47e72192e37da5dd088 Author: Christian Brauner Date: Wed Jun 17 00:48:54 2020 +0200 tests: test for setns() EINVAL regression Verify that setns() reports EINVAL when an fd is passed that refers to an open file but the file is not a file descriptor useable to interact with namespaces. Cc: Jan Stancek Cc: Cyril Hrubis Link: https://lore.kernel.org/lkml/20200615085836.GR12456@shao2-debian Signed-off-by: Christian Brauner commit 880e6269fd6e60249c8f5f1b98295e9f7e56636d Author: Arnd Bergmann Date: Wed May 27 15:47:00 2020 +0200 e1000e: fix unused-function warning The CONFIG_PM_SLEEP #ifdef checks in this file are inconsistent, leading to a warning about sometimes unused function: drivers/net/ethernet/intel/e1000e/netdev.c:137:13: error: unused function 'e1000e_check_me' [-Werror,-Wunused-function] Rather than adding more #ifdefs, just remove them completely and mark the PM functions as __maybe_unused to let the compiler work it out on it own. Fixes: e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems") Signed-off-by: Arnd Bergmann Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit eb6779d4c505145f3d4331da505f4c058d02ad04 Author: Vaibhav Gupta Date: Mon May 25 17:57:10 2020 +0530 e1000: use generic power management With legacy PM hooks, it was the responsibility of a driver to manage PCI states and also the device's power state. The generic approach is to let PCI core handle the work. e1000_suspend() calls __e1000_shutdown() to perform intermediate tasks. __e1000_shutdown() modifies the value of "wake" (device should be wakeup enabled or not), responsible for controlling the flow of legacy PM. Since, PCI core has no idea about the value of "wake", new code for generic PM may produce unexpected results. Thus, use "device_set_wakeup_enable()" to wakeup-enable the device accordingly. Signed-off-by: Vaibhav Gupta Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 6bf6be1127f7e6d4bf39f84d56854e944d045d74 Author: Chen Yu Date: Fri May 22 01:59:00 2020 +0800 e1000e: Do not wake up the system via WOL if device wakeup is disabled Currently the system will be woken up via WOL(Wake On LAN) even if the device wakeup ability has been disabled via sysfs: cat /sys/devices/pci0000:00/0000:00:1f.6/power/wakeup disabled The system should not be woken up if the user has explicitly disabled the wake up ability for this device. This patch clears the WOL ability of this network device if the user has disabled the wake up ability in sysfs. Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver") Reported-by: "Rafael J. Wysocki" Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Chen Yu Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit e571d4ee334719727f22cce30c4c74471d4ef68a Author: Christian Brauner Date: Wed Jun 17 00:33:12 2020 +0200 nsproxy: restore EINVAL for non-namespace file descriptor The LTP testsuite reported a regression where users would now see EBADF returned instead of EINVAL when an fd was passed that referred to an open file but the file was not a nsfd. Fix this by continuing to report EINVAL. Reported-by: kernel test robot Cc: Jan Stancek Cc: Cyril Hrubis Link: https://lore.kernel.org/lkml/20200615085836.GR12456@shao2-debian Fixes: 303cc571d107 ("nsproxy: attach to namespaces via pidfds") Signed-off-by: Christian Brauner commit 040ece2a3c1503c0a7e327034510367747c27a5f Author: Vineet Gupta Date: Tue Jun 16 15:14:50 2020 -0700 ARC: build: remove deprecated toggle for arc700 builds Signed-off-by: Vineet Gupta commit 0bdd6e7428a2e8971d7c9b8e212056dd0e0001c9 Author: Eugeniy Paltsev Date: Thu Jun 4 20:39:24 2020 +0300 ARC: build: allow users to specify -mcpu kernel build system used to add -mcpu for each ARC ISA as default. These days there are versions and varaints of ARC HS cores some of which have specific -mcpu options to fine tune / optimize generated code. So allow users/external build systems to specify their own -mcpu This will be used in future patches for HSDK-4xD board support which uses specific -mcpu to utilize dual issue scheduling of the core. Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta [abrodkin/vgupta: rewrote changelog] commit ea12fe9dee97d1f284ee980845444859cfcb307d Author: Tim Harvey Date: Tue Jun 16 08:31:58 2020 -0700 lan743x: add MODULE_DEVICE_TABLE for module loading alias Without a MODULE_DEVICE_TABLE the attributes are missing that create an alias for auto-loading the module in userspace via hotplug. Signed-off-by: Tim Harvey Signed-off-by: David S. Miller commit b6489a49f7b71964e37978d6f89bbdbdb263f6f5 Author: David Howells Date: Mon Jun 15 17:36:58 2020 +0100 afs: Fix silly rename Fix AFS's silly rename by the following means: (1) Set the destination directory in afs_do_silly_rename() so as to avoid misbehaviour and indicate that the directory data version will increment by 1 so as to avoid warnings about unexpected changes in the DV. Also indicate that the ctime should be updated to avoid xfstest grumbling. (2) Note when the server indicates that a directory changed more than we expected (AFS_OPERATION_DIR_CONFLICT), indicating a conflict with a third party change, checking on successful completion of unlink and rename. The problem is that the FS.RemoveFile RPC op doesn't report the status of the unlinked file, though YFS.RemoveFile2 does. This can be mitigated by the assumption that if the directory DV cranked by exactly 1, we can be sure we removed one link from the file; further, ordinarily in AFS, files cannot be hardlinked across directories, so if we reduce nlink to 0, the file is deleted. However, if the directory DV jumps by more than 1, we cannot know if a third party intervened by adding or removing a link on the file we just removed a link from. The same also goes for any vnode that is at the destination of the FS.Rename RPC op. (3) Make afs_vnode_commit_status() apply the nlink drop inside the cb_lock section along with the other attribute updates if ->op_unlinked is set on the descriptor for the appropriate vnode. (4) Issue a follow up status fetch to the unlinked file in the event of a third party conflict that makes it impossible for us to know if we actually deleted the file or not. (5) Provide a flag, AFS_VNODE_SILLY_DELETED, to make afs_getattr() lie to the user about the nlink of a silly deleted file so that it appears as 0, not 1. Found with the generic/035 and generic/084 xfstests. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Reported-by: Marc Dionne Signed-off-by: David Howells commit 60833d54d56c21e7538296eb2e00e104768fd047 Author: Ido Schimmel Date: Tue Jun 16 10:14:58 2020 +0300 mlxsw: spectrum: Adjust headroom buffers for 8x ports The port's headroom buffers are used to store packets while they traverse the device's pipeline and also to store packets that are egress mirrored. On Spectrum-3, ports with eight lanes use two headroom buffers between which the configured headroom size is split. In order to prevent packet loss, multiply the calculated headroom size by two for 8x ports. Fixes: da382875c616 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit b15bb8817f991497d97ae55d8c0e349a9d1e1478 Author: Martin Date: Tue Jun 16 11:18:58 2020 +0530 bareudp: Fixed configuration to avoid having garbage values Code to initialize the conf structure while gathering the configuration of the device was missing. Fixes: 571912c69f0e ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.") Signed-off-by: Martin Signed-off-by: David S. Miller commit 807eaf99688ce162a98a7501477644782d4af098 Author: Sven Auhagen Date: Tue Jun 16 06:35:29 2020 +0200 mvpp2: remove module bugfix The remove function does not destroy all BM Pools when per cpu pool is active. When reloading the mvpp2 as a module the BM Pools are still active in hardware and due to the bug have twice the size now old + new. This eventually leads to a kernel crash. v2: * add Fixes tag Fixes: 7d04b0b13b11 ("mvpp2: percpu buffers") Signed-off-by: Sven Auhagen Signed-off-by: David S. Miller commit 662051215c758ae8545451628816204ed6cd372d Author: Eric Dumazet Date: Mon Jun 15 20:37:07 2020 -0700 tcp: grow window for OOO packets only for SACK flows Back in 2013, we made a change that broke fast retransmit for non SACK flows. Indeed, for these flows, a sender needs to receive three duplicate ACK before starting fast retransmit. Sending ACK with different receive window do not count. Even if enabling SACK is strongly recommended these days, there still are some cases where it has to be disabled. Not increasing the window seems better than having to rely on RTO. After the fix, following packetdrill test gives : // Initialize connection 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1) = 0 +0 < S 0:0(0) win 32792 +0 > S. 0:0(0) ack 1 +0 < . 1:1(0) ack 1 win 514 +0 accept(3, ..., ...) = 4 +0 < . 1:1001(1000) ack 1 win 514 // Quick ack +0 > . 1:1(0) ack 1001 win 264 +0 < . 2001:3001(1000) ack 1 win 514 // DUPACK : Normally we should not change the window +0 > . 1:1(0) ack 1001 win 264 +0 < . 3001:4001(1000) ack 1 win 514 // DUPACK : Normally we should not change the window +0 > . 1:1(0) ack 1001 win 264 +0 < . 4001:5001(1000) ack 1 win 514 // DUPACK : Normally we should not change the window +0 > . 1:1(0) ack 1001 win 264 +0 < . 1001:2001(1000) ack 1 win 514 // Hole is repaired. +0 > . 1:1(0) ack 5001 win 272 Fixes: 4e4f1fc22681 ("tcp: properly increase rcv_ssthresh for ofo packets") Signed-off-by: Eric Dumazet Reported-by: Venkat Venkatsubra Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit b48fd568ac649f0fd750e89487eaa4a0ef8d2835 Author: Linus Walleij Date: Sun Jun 14 00:30:27 2020 +0200 drm: mcde: Fix forgotten user of drm->dev_private Unable to handle kernel NULL pointer dereference at virtual address 00000918 pgd = (ptrval) [00000918] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.0-15001-gfa384b50b96b-dirty #514 Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support) PC is at mcde_display_enable+0x78/0x7c0 LR is at mcde_display_enable+0x78/0x7c0 Fix this by using to_mcde() as in other functions. Fixes: fd7ee85cfe7b ("drm/mcde: Don't use drm_device->dev_private") Signed-off-by: Linus Walleij Reviewed-by: Sam Ravnborg Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200613223027.4189309-2-linus.walleij@linaro.org commit b984b6d8b52372b98cce0a6ff6c2787f50665b87 Author: Linus Walleij Date: Sun Jun 14 00:30:26 2020 +0200 drm: mcde: Fix display initialization problem The following bug appeared in the MCDE driver/display initialization during the recent merge window. First the place we call drm_fbdev_generic_setup() in the wrong place: this needs to be called AFTER calling drm_dev_register() else we get this splat: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at ../drivers/gpu/drm/drm_fb_helper.c:2198 drm_fbdev_generic_setup+0x164/0x1a8 mcde a0350000.mcde: Device has not been registered. Modules linked in: Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x9c/0xb0) [] (dump_stack) from [] (__warn+0xb8/0xd0) [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8) [] (warn_slowpath_fmt) from [] (drm_fbdev_generic_setup+0x164/0x1a8) [] (drm_fbdev_generic_setup) from [] (mcde_drm_bind+0xc4/0x160) [] (mcde_drm_bind) from [] (try_to_bring_up_master+0x15c/0x1a4) (...) Signed-off-by: Linus Walleij Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200613223027.4189309-1-linus.walleij@linaro.org commit 97d0b5d0b5a99871a983ca9b5c02bfde8bf73cbf Author: Vineet Gupta Date: Wed Jun 10 12:26:15 2020 -0700 ARCv2: boot log: detect newer/upconing HS3x/HS4x releases Signed-off-by: Vineet Gupta commit b7faf971081a4e56147f082234bfff55135305cb Author: Vineet Gupta Date: Wed May 27 14:18:45 2020 -0700 ARC: elf: use right ELF_ARCH Cc: Signed-off-by: Vineet Gupta commit 33b59f1671f105a6da9c0aa75d7cf6bea126d2c5 Author: Vineet Gupta Date: Wed May 13 01:08:23 2020 -0700 ARC: [arcompact] fix bitrot with 2 levels of interrupt Signed-off-by: Vineet Gupta commit 00fdec98d9881bf5173af09aebd353ab3b9ac729 Author: Vineet Gupta Date: Tue May 19 22:28:32 2020 -0700 ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE Trap handler for syscall tracing reads EFA (Exception Fault Address), in case strace wants PC of trap instruction (EFA is not part of pt_regs as of current code). However this EFA read is racy as it happens after dropping to pure kernel mode (re-enabling interrupts). A taken interrupt could context-switch, trigger a different task's trap, clobbering EFA for this execution context. Fix this by reading EFA early, before re-enabling interrupts. A slight side benefit is de-duplication of FAKE_RET_FROM_EXCPN in trap handler. The trap handler is common to both ARCompact and ARCv2 builds too. This just came out of code rework/review and no real problem was reported but is clearly a potential problem specially for strace. Cc: Signed-off-by: Vineet Gupta commit b65a2d8c8614386f7e8d38ea150749f8a862f431 Author: Dan Carpenter Date: Wed Jun 3 13:19:58 2020 +0300 Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate() The "ie_len" variable is in the 0-255 range and it comes from the network. If it's over NDIS_802_11_LENGTH_RATES_EX (16) then that will lead to memory corruption. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Dan Carpenter Cc: stable Link: https://lore.kernel.org/r/20200603101958.GA1845750@mwanda Signed-off-by: Greg Kroah-Hartman commit 29de523a6270a308d12d21f4fecf52dac491e226 Author: Jérôme Pouiller Date: Fri May 29 14:12:56 2020 +0200 staging: wfx: fix coherency of hif_scan() prototype The function hif_scan() return the timeout for the completion of the scan request. It is the only function from hif_tx.c that return another thing than just an error code. This behavior is not coherent with the rest of file. Worse, if value returned is positive, the caller can't make say if it is a timeout or the value returned by the hardware. Uniformize API with other HIF functions, only return the error code and pass timeout with parameters. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200529121256.1045521-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 8cf509345096340416708d998bbb71a27c883880 Author: Jérôme Pouiller Date: Fri May 29 14:16:03 2020 +0200 staging: wfx: drop useless loop It is guarantee that the loop will stop at first iteration. So drop the loop. Fixes: 6bf418c50f98a ("staging: wfx: change the way to choose frame to send") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200529121603.1050891-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6a9620536ffd287c67997da3bf4a984d33e3a760 Author: Jérôme Pouiller Date: Fri May 29 14:16:02 2020 +0200 staging: wfx: fix AC priority In order to work properly all the queues of the device must be filled (the device chooses itself the queue to use depending of AC parameters and other things). It is the job of wfx_tx_queues_get_skb() to choose which queue must be filled. However, the sorting algorithm was inverted, so it prioritized the already filled queue! Consequently, the AC priorities was badly broken. Fixes: 6bf418c50f98a ("staging: wfx: change the way to choose frame to send") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200529121603.1050891-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 651220e2aee3ccfd986a0436b8d6f5b3b5574d1f Merge: a5dc8300df75 bf6b694a6a90 Author: Linus Torvalds Date: Tue Jun 16 11:07:02 2020 -0700 Merge tag 'mfd-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD fix from Lee Jones: "Fix NULL pointer dereference in mt6360 driver" * tag 'mfd-fixes-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: mfd: mt6360: Fix register driver NULL pointer by adding driver name commit e575fb9e76c8e33440fb859572a8b7d430f053d6 Author: Will Deacon Date: Tue Jun 16 18:29:11 2020 +0100 arm64: sve: Fix build failure when ARM64_SVE=y and SYSCTL=n When I squashed the 'allnoconfig' compiler warning about the set_sve_default_vl() function being defined but not used in commit 1e570f512cbd ("arm64/sve: Eliminate data races on sve_default_vl"), I accidentally broke the build for configs where ARM64_SVE is enabled, but SYSCTL is not. Fix this by only compiling the SVE sysctl support if both CONFIG_SVE=y and CONFIG_SYSCTL=y. Cc: Dave Martin Reported-by: Qian Cai Link: https://lore.kernel.org/r/20200616131808.GA1040@lca.pw Signed-off-by: Will Deacon commit b091f7fede97cc64f7aaad3eeb37965aebee3082 Author: Waiman Long Date: Tue Jun 16 11:31:59 2020 -0400 btrfs: use kfree() in btrfs_ioctl_get_subvol_info() In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc() was incorrectly paired with kzfree(). According to David Sterba, there isn't any sensitive information in the subvol_info that needs to be cleared before freeing. So kzfree() isn't really needed, use kfree() instead. Signed-off-by: Waiman Long Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5dbb75ed6900048e146247b6325742d92c892548 Author: Filipe Manana Date: Mon Jun 15 18:49:39 2020 +0100 btrfs: fix RWF_NOWAIT writes blocking on extent locks and waiting for IO A RWF_NOWAIT write is not supposed to wait on filesystem locks that can be held for a long time or for ongoing IO to complete. However when calling check_can_nocow(), if the inode has prealloc extents or has the NOCOW flag set, we can block on extent (file range) locks through the call to btrfs_lock_and_flush_ordered_range(). Such lock can take a significant amount of time to be available. For example, a fiemap task may be running, and iterating through the entire file range checking all extents and doing backref walking to determine if they are shared, or a readpage operation may be in progress. Also at btrfs_lock_and_flush_ordered_range(), called by check_can_nocow(), after locking the file range we wait for any existing ordered extent that is in progress to complete. Another operation that can take a significant amount of time and defeat the purpose of RWF_NOWAIT. So fix this by trying to lock the file range and if it's currently locked return -EAGAIN to user space. If we are able to lock the file range without waiting and there is an ordered extent in the range, return -EAGAIN as well, instead of waiting for it to complete. Finally, don't bother trying to lock the snapshot lock of the root when attempting a RWF_NOWAIT write, as that is only important for buffered writes. Fixes: edf064e7c6fec3 ("btrfs: nowait aio support") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 260a63395f90f67d6ab89e4266af9e3dc34a77e9 Author: Filipe Manana Date: Mon Jun 15 18:49:13 2020 +0100 btrfs: fix RWF_NOWAIT write not failling when we need to cow If we attempt to do a RWF_NOWAIT write against a file range for which we can only do NOCOW for a part of it, due to the existence of holes or shared extents for example, we proceed with the write as if it were possible to NOCOW the whole range. Example: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ touch /mnt/sdj/bar $ chattr +C /mnt/sdj/bar $ xfs_io -d -c "pwrite -S 0xab -b 256K 0 256K" /mnt/bar wrote 262144/262144 bytes at offset 0 256 KiB, 1 ops; 0.0003 sec (694.444 MiB/sec and 2777.7778 ops/sec) $ xfs_io -c "fpunch 64K 64K" /mnt/bar $ sync $ xfs_io -d -c "pwrite -N -V 1 -b 128K -S 0xfe 0 128K" /mnt/bar wrote 131072/131072 bytes at offset 0 128 KiB, 1 ops; 0.0007 sec (160.051 MiB/sec and 1280.4097 ops/sec) This last write should fail with -EAGAIN since the file range from 64K to 128K is a hole. On xfs it fails, as expected, but on ext4 it currently succeeds because apparently it is expensive to check if there are extents allocated for the whole range, but I'll check with the ext4 people. Fix the issue by checking if check_can_nocow() returns a number of NOCOW'able bytes smaller then the requested number of bytes, and if it does return -EAGAIN. Fixes: edf064e7c6fec3 ("btrfs: nowait aio support") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4b1946284dd6641afdb9457101056d9e6ee6204c Author: Filipe Manana Date: Mon Jun 15 18:48:58 2020 +0100 btrfs: fix failure of RWF_NOWAIT write into prealloc extent beyond eof If we attempt to write to prealloc extent located after eof using a RWF_NOWAIT write, we always fail with -EAGAIN. We do actually check if we have an allocated extent for the write at the start of btrfs_file_write_iter() through a call to check_can_nocow(), but later when we go into the actual direct IO write path we simply return -EAGAIN if the write starts at or beyond EOF. Trivial to reproduce: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ touch /mnt/foo $ chattr +C /mnt/foo $ xfs_io -d -c "pwrite -S 0xab 0 64K" /mnt/foo wrote 65536/65536 bytes at offset 0 64 KiB, 16 ops; 0.0004 sec (135.575 MiB/sec and 34707.1584 ops/sec) $ xfs_io -c "falloc -k 64K 1M" /mnt/foo $ xfs_io -d -c "pwrite -N -V 1 -S 0xfe -b 64K 64K 64K" /mnt/foo pwrite: Resource temporarily unavailable On xfs and ext4 the write succeeds, as expected. Fix this by removing the wrong check at btrfs_direct_IO(). Fixes: edf064e7c6fec3 ("btrfs: nowait aio support") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f2cb2f39ccc30fa13d3ac078d461031a63960e5b Author: Filipe Manana Date: Mon Jun 15 18:46:01 2020 +0100 btrfs: fix hang on snapshot creation after RWF_NOWAIT write If we do a successful RWF_NOWAIT write we end up locking the snapshot lock of the inode, through a call to check_can_nocow(), but we never unlock it. This means the next attempt to create a snapshot on the subvolume will hang forever. Trivial reproducer: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ touch /mnt/foobar $ chattr +C /mnt/foobar $ xfs_io -d -c "pwrite -S 0xab 0 64K" /mnt/foobar $ xfs_io -d -c "pwrite -N -V 1 -S 0xfe 0 64K" /mnt/foobar $ btrfs subvolume snapshot -r /mnt /mnt/snap --> hangs Fix this by unlocking the snapshot lock if check_can_nocow() returned success. Fixes: edf064e7c6fec3 ("btrfs: nowait aio support") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit e7a79811d0db136dc2d336b56d54cf1b774ce972 Author: Filipe Manana Date: Mon Jun 15 10:38:44 2020 +0100 btrfs: check if a log root exists before locking the log_mutex on unlink This brings back an optimization that commit e678934cbe5f02 ("btrfs: Remove unnecessary check from join_running_log_trans") removed, but in a different form. So it's almost equivalent to a revert. That commit removed an optimization where we avoid locking a root's log_mutex when there is no log tree created in the current transaction. The affected code path is triggered through unlink operations. That commit was based on the assumption that the optimization was not necessary because we used to have the following checks when the patch was authored: int btrfs_del_dir_entries_in_log(...) { (...) if (dir->logged_trans < trans->transid) return 0; ret = join_running_log_trans(root); (...) } int btrfs_del_inode_ref_in_log(...) { (...) if (inode->logged_trans < trans->transid) return 0; ret = join_running_log_trans(root); (...) } However before that patch was merged, another patch was merged first which replaced those checks because they were buggy. That other patch corresponds to commit 803f0f64d17769 ("Btrfs: fix fsync not persisting dentry deletions due to inode evictions"). The assumption that if the logged_trans field of an inode had a smaller value then the current transaction's generation (transid) meant that the inode was not logged in the current transaction was only correct if the inode was not evicted and reloaded in the current transaction. So the corresponding bug fix changed those checks and replaced them with the following helper function: static bool inode_logged(struct btrfs_trans_handle *trans, struct btrfs_inode *inode) { if (inode->logged_trans == trans->transid) return true; if (inode->last_trans == trans->transid && test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &inode->runtime_flags) && !test_bit(BTRFS_FS_LOG_RECOVERING, &trans->fs_info->flags)) return true; return false; } So if we have a subvolume without a log tree in the current transaction (because we had no fsyncs), every time we unlink an inode we can end up trying to lock the log_mutex of the root through join_running_log_trans() twice, once for the inode being unlinked (by btrfs_del_inode_ref_in_log()) and once for the parent directory (with btrfs_del_dir_entries_in_log()). This means if we have several unlink operations happening in parallel for inodes in the same subvolume, and the those inodes and/or their parent inode were changed in the current transaction, we end up having a lot of contention on the log_mutex. The test robots from intel reported a -30.7% performance regression for a REAIM test after commit e678934cbe5f02 ("btrfs: Remove unnecessary check from join_running_log_trans"). So just bring back the optimization to join_running_log_trans() where we check first if a log root exists before trying to lock the log_mutex. This is done by checking for a bit that is set on the root when a log tree is created and removed when a log tree is freed (at transaction commit time). Commit e678934cbe5f02 ("btrfs: Remove unnecessary check from join_running_log_trans") was merged in the 5.4 merge window while commit 803f0f64d17769 ("Btrfs: fix fsync not persisting dentry deletions due to inode evictions") was merged in the 5.3 merge window. But the first commit was actually authored before the second commit (May 23 2019 vs June 19 2019). Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/20200611090233.GL12456@shao2-debian/ Fixes: e678934cbe5f02 ("btrfs: Remove unnecessary check from join_running_log_trans") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6bd335b469f945f75474c11e3f577f85409f39c3 Author: Filipe Manana Date: Mon Jun 8 13:33:05 2020 +0100 btrfs: fix bytes_may_use underflow when running balance and scrub in parallel When balance and scrub are running in parallel it is possible to end up with an underflow of the bytes_may_use counter of the data space_info object, which triggers a warning like the following: [134243.793196] BTRFS info (device sdc): relocating block group 1104150528 flags data [134243.806891] ------------[ cut here ]------------ [134243.807561] WARNING: CPU: 1 PID: 26884 at fs/btrfs/space-info.h:125 btrfs_add_reserved_bytes+0x1da/0x280 [btrfs] [134243.808819] Modules linked in: btrfs blake2b_generic xor (...) [134243.815779] CPU: 1 PID: 26884 Comm: kworker/u8:8 Tainted: G W 5.6.0-rc7-btrfs-next-58 #5 [134243.816944] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [134243.818389] Workqueue: writeback wb_workfn (flush-btrfs-108483) [134243.819186] RIP: 0010:btrfs_add_reserved_bytes+0x1da/0x280 [btrfs] [134243.819963] Code: 0b f2 85 (...) [134243.822271] RSP: 0018:ffffa4160aae7510 EFLAGS: 00010287 [134243.822929] RAX: 000000000000c000 RBX: ffff96159a8c1000 RCX: 0000000000000000 [134243.823816] RDX: 0000000000008000 RSI: 0000000000000000 RDI: ffff96158067a810 [134243.824742] RBP: ffff96158067a800 R08: 0000000000000001 R09: 0000000000000000 [134243.825636] R10: ffff961501432a40 R11: 0000000000000000 R12: 000000000000c000 [134243.826532] R13: 0000000000000001 R14: ffffffffffff4000 R15: ffff96158067a810 [134243.827432] FS: 0000000000000000(0000) GS:ffff9615baa00000(0000) knlGS:0000000000000000 [134243.828451] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [134243.829184] CR2: 000055bd7e414000 CR3: 00000001077be004 CR4: 00000000003606e0 [134243.830083] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [134243.830975] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [134243.831867] Call Trace: [134243.832211] find_free_extent+0x4a0/0x16c0 [btrfs] [134243.832846] btrfs_reserve_extent+0x91/0x180 [btrfs] [134243.833487] cow_file_range+0x12d/0x490 [btrfs] [134243.834080] fallback_to_cow+0x82/0x1b0 [btrfs] [134243.834689] ? release_extent_buffer+0x121/0x170 [btrfs] [134243.835370] run_delalloc_nocow+0x33f/0xa30 [btrfs] [134243.836032] btrfs_run_delalloc_range+0x1ea/0x6d0 [btrfs] [134243.836725] ? find_lock_delalloc_range+0x221/0x250 [btrfs] [134243.837450] writepage_delalloc+0xe8/0x150 [btrfs] [134243.838059] __extent_writepage+0xe8/0x4c0 [btrfs] [134243.838674] extent_write_cache_pages+0x237/0x530 [btrfs] [134243.839364] extent_writepages+0x44/0xa0 [btrfs] [134243.839946] do_writepages+0x23/0x80 [134243.840401] __writeback_single_inode+0x59/0x700 [134243.841006] writeback_sb_inodes+0x267/0x5f0 [134243.841548] __writeback_inodes_wb+0x87/0xe0 [134243.842091] wb_writeback+0x382/0x590 [134243.842574] ? wb_workfn+0x4a2/0x6c0 [134243.843030] wb_workfn+0x4a2/0x6c0 [134243.843468] process_one_work+0x26d/0x6a0 [134243.843978] worker_thread+0x4f/0x3e0 [134243.844452] ? process_one_work+0x6a0/0x6a0 [134243.844981] kthread+0x103/0x140 [134243.845400] ? kthread_create_worker_on_cpu+0x70/0x70 [134243.846030] ret_from_fork+0x3a/0x50 [134243.846494] irq event stamp: 0 [134243.846892] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [134243.847682] hardirqs last disabled at (0): [] copy_process+0x74f/0x2020 [134243.848687] softirqs last enabled at (0): [] copy_process+0x74f/0x2020 [134243.849913] softirqs last disabled at (0): [<0000000000000000>] 0x0 [134243.850698] ---[ end trace bd7c03622e0b0a96 ]--- [134243.851335] ------------[ cut here ]------------ When relocating a data block group, for each extent allocated in the block group we preallocate another extent with the same size for the data relocation inode (we do it at prealloc_file_extent_cluster()). We reserve space by calling btrfs_check_data_free_space(), which ends up incrementing the data space_info's bytes_may_use counter, and then call btrfs_prealloc_file_range() to allocate the extent, which always decrements the bytes_may_use counter by the same amount. The expectation is that writeback of the data relocation inode always follows a NOCOW path, by writing into the preallocated extents. However, when starting writeback we might end up falling back into the COW path, because the block group that contains the preallocated extent was turned into RO mode by a scrub running in parallel. The COW path then calls the extent allocator which ends up calling btrfs_add_reserved_bytes(), and this function decrements the bytes_may_use counter of the data space_info object by an amount corresponding to the size of the allocated extent, despite we haven't previously incremented it. When the counter currently has a value smaller then the allocated extent we reset the counter to 0 and emit a warning, otherwise we just decrement it and slowly mess up with this counter which is crucial for space reservation, the end result can be granting reserved space to tasks when there isn't really enough free space, and having the tasks fail later in critical places where error handling consists of a transaction abort or hitting a BUG_ON(). Fix this by making sure that if we fallback to the COW path for a data relocation inode, we increment the bytes_may_use counter of the data space_info object. The COW path will then decrement it at btrfs_add_reserved_bytes() on success or through its error handling part by a call to extent_clear_unlock_delalloc() (which ends up calling btrfs_clear_delalloc_extent() that does the decrement operation) in case of an error. Test case btrfs/061 from fstests could sporadically trigger this. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 432cd2a10f1c10cead91fe706ff5dc52f06d642a Author: Filipe Manana Date: Mon Jun 8 13:32:55 2020 +0100 btrfs: fix data block group relocation failure due to concurrent scrub When running relocation of a data block group while scrub is running in parallel, it is possible that the relocation will fail and abort the current transaction with an -EINVAL error: [134243.988595] BTRFS info (device sdc): found 14 extents, stage: move data extents [134243.999871] ------------[ cut here ]------------ [134244.000741] BTRFS: Transaction aborted (error -22) [134244.001692] WARNING: CPU: 0 PID: 26954 at fs/btrfs/ctree.c:1071 __btrfs_cow_block+0x6a7/0x790 [btrfs] [134244.003380] Modules linked in: btrfs blake2b_generic xor raid6_pq (...) [134244.012577] CPU: 0 PID: 26954 Comm: btrfs Tainted: G W 5.6.0-rc7-btrfs-next-58 #5 [134244.014162] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [134244.016184] RIP: 0010:__btrfs_cow_block+0x6a7/0x790 [btrfs] [134244.017151] Code: 48 c7 c7 (...) [134244.020549] RSP: 0018:ffffa41607863888 EFLAGS: 00010286 [134244.021515] RAX: 0000000000000000 RBX: ffff9614bdfe09c8 RCX: 0000000000000000 [134244.022822] RDX: 0000000000000001 RSI: ffffffffb3d63980 RDI: 0000000000000001 [134244.024124] RBP: ffff961589e8c000 R08: 0000000000000000 R09: 0000000000000001 [134244.025424] R10: ffffffffc0ae5955 R11: 0000000000000000 R12: ffff9614bd530d08 [134244.026725] R13: ffff9614ced41b88 R14: ffff9614bdfe2a48 R15: 0000000000000000 [134244.028024] FS: 00007f29b63c08c0(0000) GS:ffff9615ba600000(0000) knlGS:0000000000000000 [134244.029491] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [134244.030560] CR2: 00007f4eb339b000 CR3: 0000000130d6e006 CR4: 00000000003606f0 [134244.031997] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [134244.033153] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [134244.034484] Call Trace: [134244.034984] btrfs_cow_block+0x12b/0x2b0 [btrfs] [134244.035859] do_relocation+0x30b/0x790 [btrfs] [134244.036681] ? do_raw_spin_unlock+0x49/0xc0 [134244.037460] ? _raw_spin_unlock+0x29/0x40 [134244.038235] relocate_tree_blocks+0x37b/0x730 [btrfs] [134244.039245] relocate_block_group+0x388/0x770 [btrfs] [134244.040228] btrfs_relocate_block_group+0x161/0x2e0 [btrfs] [134244.041323] btrfs_relocate_chunk+0x36/0x110 [btrfs] [134244.041345] btrfs_balance+0xc06/0x1860 [btrfs] [134244.043382] ? btrfs_ioctl_balance+0x27c/0x310 [btrfs] [134244.045586] btrfs_ioctl_balance+0x1ed/0x310 [btrfs] [134244.045611] btrfs_ioctl+0x1880/0x3760 [btrfs] [134244.049043] ? do_raw_spin_unlock+0x49/0xc0 [134244.049838] ? _raw_spin_unlock+0x29/0x40 [134244.050587] ? __handle_mm_fault+0x11b3/0x14b0 [134244.051417] ? ksys_ioctl+0x92/0xb0 [134244.052070] ksys_ioctl+0x92/0xb0 [134244.052701] ? trace_hardirqs_off_thunk+0x1a/0x1c [134244.053511] __x64_sys_ioctl+0x16/0x20 [134244.054206] do_syscall_64+0x5c/0x280 [134244.054891] entry_SYSCALL_64_after_hwframe+0x49/0xbe [134244.055819] RIP: 0033:0x7f29b51c9dd7 [134244.056491] Code: 00 00 00 (...) [134244.059767] RSP: 002b:00007ffcccc1dd08 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [134244.061168] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f29b51c9dd7 [134244.062474] RDX: 00007ffcccc1dda0 RSI: 00000000c4009420 RDI: 0000000000000003 [134244.063771] RBP: 0000000000000003 R08: 00005565cea4b000 R09: 0000000000000000 [134244.065032] R10: 0000000000000541 R11: 0000000000000202 R12: 00007ffcccc2060a [134244.066327] R13: 00007ffcccc1dda0 R14: 0000000000000002 R15: 00007ffcccc1dec0 [134244.067626] irq event stamp: 0 [134244.068202] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [134244.069351] hardirqs last disabled at (0): [] copy_process+0x74f/0x2020 [134244.070909] softirqs last enabled at (0): [] copy_process+0x74f/0x2020 [134244.072392] softirqs last disabled at (0): [<0000000000000000>] 0x0 [134244.073432] ---[ end trace bd7c03622e0b0a99 ]--- The -EINVAL error comes from the following chain of function calls: __btrfs_cow_block() <-- aborts the transaction btrfs_reloc_cow_block() replace_file_extents() get_new_location() <-- returns -EINVAL When relocating a data block group, for each allocated extent of the block group, we preallocate another extent (at prealloc_file_extent_cluster()), associated with the data relocation inode, and then dirty all its pages. These preallocated extents have, and must have, the same size that extents from the data block group being relocated have. Later before we start the relocation stage that updates pointers (bytenr field of file extent items) to point to the the new extents, we trigger writeback for the data relocation inode. The expectation is that writeback will write the pages to the previously preallocated extents, that it follows the NOCOW path. That is generally the case, however, if a scrub is running it may have turned the block group that contains those extents into RO mode, in which case writeback falls back to the COW path. However in the COW path instead of allocating exactly one extent with the expected size, the allocator may end up allocating several smaller extents due to free space fragmentation - because we tell it at cow_file_range() that the minimum allocation size can match the filesystem's sector size. This later breaks the relocation's expectation that an extent associated to a file extent item in the data relocation inode has the same size as the respective extent pointed by a file extent item in another tree - in this case the extent to which the relocation inode poins to is smaller, causing relocation.c:get_new_location() to return -EINVAL. For example, if we are relocating a data block group X that has a logical address of X and the block group has an extent allocated at the logical address X + 128KiB with a size of 64KiB: 1) At prealloc_file_extent_cluster() we allocate an extent for the data relocation inode with a size of 64KiB and associate it to the file offset 128KiB (X + 128KiB - X) of the data relocation inode. This preallocated extent was allocated at block group Z; 2) A scrub running in parallel turns block group Z into RO mode and starts scrubing its extents; 3) Relocation triggers writeback for the data relocation inode; 4) When running delalloc (btrfs_run_delalloc_range()), we try first the NOCOW path because the data relocation inode has BTRFS_INODE_PREALLOC set in its flags. However, because block group Z is in RO mode, the NOCOW path (run_delalloc_nocow()) falls back into the COW path, by calling cow_file_range(); 5) At cow_file_range(), in the first iteration of the while loop we call btrfs_reserve_extent() to allocate a 64KiB extent and pass it a minimum allocation size of 4KiB (fs_info->sectorsize). Due to free space fragmentation, btrfs_reserve_extent() ends up allocating two extents of 32KiB each, each one on a different iteration of that while loop; 6) Writeback of the data relocation inode completes; 7) Relocation proceeds and ends up at relocation.c:replace_file_extents(), with a leaf which has a file extent item that points to the data extent from block group X, that has a logical address (bytenr) of X + 128KiB and a size of 64KiB. Then it calls get_new_location(), which does a lookup in the data relocation tree for a file extent item starting at offset 128KiB (X + 128KiB - X) and belonging to the data relocation inode. It finds a corresponding file extent item, however that item points to an extent that has a size of 32KiB, which doesn't match the expected size of 64KiB, resuling in -EINVAL being returned from this function and propagated up to __btrfs_cow_block(), which aborts the current transaction. To fix this make sure that at cow_file_range() when we call the allocator we pass it a minimum allocation size corresponding the desired extent size if the inode belongs to the data relocation tree, otherwise pass it the filesystem's sector size as the minimum allocation size. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit ffcb9d44572afbaf8fa6dbf5115bff6dab7b299e Author: Filipe Manana Date: Mon Jun 1 19:12:19 2020 +0100 btrfs: fix race between block group removal and block group creation There is a race between block group removal and block group creation when the removal is completed by a task running fitrim or scrub. When this happens we end up failing the block group creation with an error -EEXIST since we attempt to insert a duplicate block group item key in the extent tree. That results in a transaction abort. The race happens like this: 1) Task A is doing a fitrim, and at btrfs_trim_block_group() it freezes block group X with btrfs_freeze_block_group() (until very recently that was named btrfs_get_block_group_trimming()); 2) Task B starts removing block group X, either because it's now unused or due to relocation for example. So at btrfs_remove_block_group(), while holding the chunk mutex and the block group's lock, it sets the 'removed' flag of the block group and it sets the local variable 'remove_em' to false, because the block group is currently frozen (its 'frozen' counter is > 0, until very recently this counter was named 'trimming'); 3) Task B unlocks the block group and the chunk mutex; 4) Task A is done trimming the block group and unfreezes the block group by calling btrfs_unfreeze_block_group() (until very recently this was named btrfs_put_block_group_trimming()). In this function we lock the block group and set the local variable 'cleanup' to true because we were able to decrement the block group's 'frozen' counter down to 0 and the flag 'removed' is set in the block group. Since 'cleanup' is set to true, it locks the chunk mutex and removes the extent mapping representing the block group from the mapping tree; 5) Task C allocates a new block group Y and it picks up the logical address that block group X had as the logical address for Y, because X was the block group with the highest logical address and now the second block group with the highest logical address, the last in the fs mapping tree, ends at an offset corresponding to block group X's logical address (this logical address selection is done at volumes.c:find_next_chunk()). At this point the new block group Y does not have yet its item added to the extent tree (nor the corresponding device extent items and chunk item in the device and chunk trees). The new group Y is added to the list of pending block groups in the transaction handle; 6) Before task B proceeds to removing the block group item for block group X from the extent tree, which has a key matching: (X logical offset, BTRFS_BLOCK_GROUP_ITEM_KEY, length) task C while ending its transaction handle calls btrfs_create_pending_block_groups(), which finds block group Y and tries to insert the block group item for Y into the exten tree, which fails with -EEXIST since logical offset is the same that X had and task B hasn't yet deleted the key from the extent tree. This failure results in a transaction abort, producing a stack like the following: ------------[ cut here ]------------ BTRFS: Transaction aborted (error -17) WARNING: CPU: 2 PID: 19736 at fs/btrfs/block-group.c:2074 btrfs_create_pending_block_groups+0x1eb/0x260 [btrfs] Modules linked in: btrfs blake2b_generic xor raid6_pq (...) CPU: 2 PID: 19736 Comm: fsstress Tainted: G W 5.6.0-rc7-btrfs-next-58 #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 RIP: 0010:btrfs_create_pending_block_groups+0x1eb/0x260 [btrfs] Code: ff ff ff 48 8b 55 50 f0 48 (...) RSP: 0018:ffffa4160a1c7d58 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff961581909d98 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffffb3d63990 RDI: 0000000000000001 RBP: ffff9614f3356a58 R08: 0000000000000000 R09: 0000000000000001 R10: ffff9615b65b0040 R11: 0000000000000000 R12: ffff961581909c10 R13: ffff9615b0c32000 R14: ffff9614f3356ab0 R15: ffff9614be779000 FS: 00007f2ce2841e80(0000) GS:ffff9615bae00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555f18780000 CR3: 0000000131d34005 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_start_dirty_block_groups+0x398/0x4e0 [btrfs] btrfs_commit_transaction+0xd0/0xc50 [btrfs] ? btrfs_attach_transaction_barrier+0x1e/0x50 [btrfs] ? __ia32_sys_fdatasync+0x20/0x20 iterate_supers+0xdb/0x180 ksys_sync+0x60/0xb0 __ia32_sys_sync+0xa/0x10 do_syscall_64+0x5c/0x280 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f2ce1d4d5b7 Code: 83 c4 08 48 3d 01 (...) RSP: 002b:00007ffd8b558c58 EFLAGS: 00000202 ORIG_RAX: 00000000000000a2 RAX: ffffffffffffffda RBX: 000000000000002c RCX: 00007f2ce1d4d5b7 RDX: 00000000ffffffff RSI: 00000000186ba07b RDI: 000000000000002c RBP: 0000555f17b9e520 R08: 0000000000000012 R09: 000000000000ce00 R10: 0000000000000078 R11: 0000000000000202 R12: 0000000000000032 R13: 0000000051eb851f R14: 00007ffd8b558cd0 R15: 0000555f1798ec20 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0x74f/0x2020 softirqs last enabled at (0): [] copy_process+0x74f/0x2020 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace bd7c03622e0b0a9c ]--- Fix this simply by making btrfs_remove_block_group() remove the block group's item from the extent tree before it flags the block group as removed. Also make the free space deletion from the free space tree before flagging the block group as removed, to avoid a similar race with adding and removing free space entries for the free space tree. Fixes: 04216820fe83d5 ("Btrfs: fix race between fs trimming and block group remove/allocation") CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 9fecd13202f520f3f25d5b1c313adb740fe19773 Author: Filipe Manana Date: Mon Jun 1 19:12:06 2020 +0100 btrfs: fix a block group ref counter leak after failure to remove block group When removing a block group, if we fail to delete the block group's item from the extent tree, we jump to the 'out' label and end up decrementing the block group's reference count once only (by 1), resulting in a counter leak because the block group at that point was already removed from the block group cache rbtree - so we have to decrement the reference count twice, once for the rbtree and once for our lookup at the start of the function. There is a second bug where if removing the free space tree entries (the call to remove_block_group_free_space()) fails we end up jumping to the 'out_put_group' label but end up decrementing the reference count only once, when we should have done it twice, since we have already removed the block group from the block group cache rbtree. This happens because the reference count decrement for the rbtree reference happens after attempting to remove the free space tree entries, which is far away from the place where we remove the block group from the rbtree. To make things less error prone, decrement the reference count for the rbtree immediately after removing the block group from it. This also eleminates the need for two different exit labels on error, renaming 'out_put_label' to just 'out' and removing the old 'out'. Fixes: f6033c5e333238 ("btrfs: fix block group leak when removing fails") CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Nikolay Borisov Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit fce3a51d9b31312aa12ecb72ffabfc4c7b40bdc6 Author: Thierry Reding Date: Wed Jun 10 13:30:59 2020 +0200 drm/tegra: Add zpos property for cursor planes As of commit 4dc55525b095 ("drm: plane: Verify that no or all planes have a zpos property") a warning is emitted if there's a mix of planes with and without a zpos property. On Tegra, cursor planes are always composited on top of all other planes, which is why they never had a zpos property attached to them. However, since the composition order is fixed, this is trivial to remedy by simply attaching an immutable zpos property to them. v3: do not hardcode zpos for overlay planes used as cursor (Dmitry) v2: hardcode cursor plane zpos to 255 instead of 0 (Ville) Reported-by: Jonathan Hunter Signed-off-by: Thierry Reding commit d9a0a05bf8c76e6dc79230669a8b5d685b168c30 Author: Thierry Reding Date: Wed Apr 8 19:38:02 2020 +0200 gpu: host1x: Detach driver on unregister Currently when a host1x device driver is unregistered, it is not detached from the host1x controller, which means that the device will stay around and when the driver is registered again, it may bind to the old, stale device rather than the new one that was created from scratch upon driver registration. This in turn can cause various weird crashes within the driver core because it is confronted with a device that was already deleted. Fix this by detaching the driver from the host1x controller when it is unregistered. This ensures that the deleted device also is no longer present in the device list that drivers will bind to. Reported-by: Sowjanya Komatineni Signed-off-by: Thierry Reding Tested-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 2fd2bc7f49324e7b439e3c5584762abd0a9a13bc Author: Colton Lewis Date: Sun Jun 14 04:08:04 2020 +0000 gpu: host1x: Correct trivial kernel-doc inconsistencies Silence documentation build warnings by adding kernel-doc fields. ./include/linux/host1x.h:69: warning: Function parameter or member 'parent' not described in 'host1x_client' ./include/linux/host1x.h:69: warning: Function parameter or member 'usecount' not described in 'host1x_client' ./include/linux/host1x.h:69: warning: Function parameter or member 'lock' not described in 'host1x_client' Signed-off-by: Colton Lewis Signed-off-by: Thierry Reding commit 1b8eec510ba641418573eacc98a7e9c07726af30 Author: Masami Hiramatsu Date: Wed Jun 3 11:41:09 2020 +0900 selftests/ftrace: Support ":README" suffix for requires Add ":README" suffix support for the requires list, so that the testcase can list up the required string for README file to the requires list. Note that the required string is treated as a fixed string, instead of regular expression. Also, the testcase can specify a string containing spaces with quotes. E.g. # requires: "place: [:]":README Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 305c8388fd0c92f37ab766dbf864b7bea4b66f5f Author: Masami Hiramatsu Date: Wed Jun 3 11:40:59 2020 +0900 selftests/ftrace: Support ":tracer" suffix for requires Add ":tracer" suffix support for the requires list, so that the testcase can list up the required tracer (e.g. function) to the requires list. For example, if the testcase requires function_graph tracer, it can write requires list as below instead of checking available_tracers. # requires: function_graph:tracer Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 74e6072894d6ccd9c950d1c9bce3870596731810 Author: Masami Hiramatsu Date: Wed Jun 3 11:40:49 2020 +0900 selftests/ftrace: Convert check_filter_file() with requires list Since check_filter_file() is basically checking the filter tracefs file, we can convert it into requires list. Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 3591e90fe1108909f822948bd7628412282f7e9d Author: Masami Hiramatsu Date: Wed Jun 3 11:40:38 2020 +0900 selftests/ftrace: Convert required interface checks into requires list Convert the required tracefs interface checking code with requires: list. Fixed merge conflicts in trigger-hist.tc and trigger-trace-marker-hist.tc Shuah Khan Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 2d3a8e2deddea6c89961c422ec0c5b851e648c14 Author: Jason Yan Date: Tue Jun 16 20:16:55 2020 +0800 block: Fix use-after-free in blkdev_get() In blkdev_get() we call __blkdev_get() to do some internal jobs and if there is some errors in __blkdev_get(), the bdput() is called which means we have released the refcount of the bdev (actually the refcount of the bdev inode). This means we cannot access bdev after that point. But acctually bdev is still accessed in blkdev_get() after calling __blkdev_get(). This results in use-after-free if the refcount is the last one we released in __blkdev_get(). Let's take a look at the following scenerio: CPU0 CPU1 CPU2 blkdev_open blkdev_open Remove disk bd_acquire blkdev_get __blkdev_get del_gendisk bdev_unhash_inode bd_acquire bdev_get_gendisk bd_forget failed because of unhashed bdput bdput (the last one) bdev_evict_inode access bdev => use after free [ 459.350216] BUG: KASAN: use-after-free in __lock_acquire+0x24c1/0x31b0 [ 459.351190] Read of size 8 at addr ffff88806c815a80 by task syz-executor.0/20132 [ 459.352347] [ 459.352594] CPU: 0 PID: 20132 Comm: syz-executor.0 Not tainted 4.19.90 #2 [ 459.353628] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 459.354947] Call Trace: [ 459.355337] dump_stack+0x111/0x19e [ 459.355879] ? __lock_acquire+0x24c1/0x31b0 [ 459.356523] print_address_description+0x60/0x223 [ 459.357248] ? __lock_acquire+0x24c1/0x31b0 [ 459.357887] kasan_report.cold+0xae/0x2d8 [ 459.358503] __lock_acquire+0x24c1/0x31b0 [ 459.359120] ? _raw_spin_unlock_irq+0x24/0x40 [ 459.359784] ? lockdep_hardirqs_on+0x37b/0x580 [ 459.360465] ? _raw_spin_unlock_irq+0x24/0x40 [ 459.361123] ? finish_task_switch+0x125/0x600 [ 459.361812] ? finish_task_switch+0xee/0x600 [ 459.362471] ? mark_held_locks+0xf0/0xf0 [ 459.363108] ? __schedule+0x96f/0x21d0 [ 459.363716] lock_acquire+0x111/0x320 [ 459.364285] ? blkdev_get+0xce/0xbe0 [ 459.364846] ? blkdev_get+0xce/0xbe0 [ 459.365390] __mutex_lock+0xf9/0x12a0 [ 459.365948] ? blkdev_get+0xce/0xbe0 [ 459.366493] ? bdev_evict_inode+0x1f0/0x1f0 [ 459.367130] ? blkdev_get+0xce/0xbe0 [ 459.367678] ? destroy_inode+0xbc/0x110 [ 459.368261] ? mutex_trylock+0x1a0/0x1a0 [ 459.368867] ? __blkdev_get+0x3e6/0x1280 [ 459.369463] ? bdev_disk_changed+0x1d0/0x1d0 [ 459.370114] ? blkdev_get+0xce/0xbe0 [ 459.370656] blkdev_get+0xce/0xbe0 [ 459.371178] ? find_held_lock+0x2c/0x110 [ 459.371774] ? __blkdev_get+0x1280/0x1280 [ 459.372383] ? lock_downgrade+0x680/0x680 [ 459.373002] ? lock_acquire+0x111/0x320 [ 459.373587] ? bd_acquire+0x21/0x2c0 [ 459.374134] ? do_raw_spin_unlock+0x4f/0x250 [ 459.374780] blkdev_open+0x202/0x290 [ 459.375325] do_dentry_open+0x49e/0x1050 [ 459.375924] ? blkdev_get_by_dev+0x70/0x70 [ 459.376543] ? __x64_sys_fchdir+0x1f0/0x1f0 [ 459.377192] ? inode_permission+0xbe/0x3a0 [ 459.377818] path_openat+0x148c/0x3f50 [ 459.378392] ? kmem_cache_alloc+0xd5/0x280 [ 459.379016] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 459.379802] ? path_lookupat.isra.0+0x900/0x900 [ 459.380489] ? __lock_is_held+0xad/0x140 [ 459.381093] do_filp_open+0x1a1/0x280 [ 459.381654] ? may_open_dev+0xf0/0xf0 [ 459.382214] ? find_held_lock+0x2c/0x110 [ 459.382816] ? lock_downgrade+0x680/0x680 [ 459.383425] ? __lock_is_held+0xad/0x140 [ 459.384024] ? do_raw_spin_unlock+0x4f/0x250 [ 459.384668] ? _raw_spin_unlock+0x1f/0x30 [ 459.385280] ? __alloc_fd+0x448/0x560 [ 459.385841] do_sys_open+0x3c3/0x500 [ 459.386386] ? filp_open+0x70/0x70 [ 459.386911] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 459.387610] ? trace_hardirqs_off_caller+0x55/0x1c0 [ 459.388342] ? do_syscall_64+0x1a/0x520 [ 459.388930] do_syscall_64+0xc3/0x520 [ 459.389490] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 459.390248] RIP: 0033:0x416211 [ 459.390720] Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48 83 ec 08 e8 0a fa ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fa ff ff 48 89 d0 48 83 c4 08 48 3d 01 [ 459.393483] RSP: 002b:00007fe45dfe9a60 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 [ 459.394610] RAX: ffffffffffffffda RBX: 00007fe45dfea6d4 RCX: 0000000000416211 [ 459.395678] RDX: 00007fe45dfe9b0a RSI: 0000000000000002 RDI: 00007fe45dfe9b00 [ 459.396758] RBP: 000000000076bf20 R08: 0000000000000000 R09: 000000000000000a [ 459.397930] R10: 0000000000000075 R11: 0000000000000293 R12: 00000000ffffffff [ 459.399022] R13: 0000000000000bd9 R14: 00000000004cdb80 R15: 000000000076bf2c [ 459.400168] [ 459.400430] Allocated by task 20132: [ 459.401038] kasan_kmalloc+0xbf/0xe0 [ 459.401652] kmem_cache_alloc+0xd5/0x280 [ 459.402330] bdev_alloc_inode+0x18/0x40 [ 459.402970] alloc_inode+0x5f/0x180 [ 459.403510] iget5_locked+0x57/0xd0 [ 459.404095] bdget+0x94/0x4e0 [ 459.404607] bd_acquire+0xfa/0x2c0 [ 459.405113] blkdev_open+0x110/0x290 [ 459.405702] do_dentry_open+0x49e/0x1050 [ 459.406340] path_openat+0x148c/0x3f50 [ 459.406926] do_filp_open+0x1a1/0x280 [ 459.407471] do_sys_open+0x3c3/0x500 [ 459.408010] do_syscall_64+0xc3/0x520 [ 459.408572] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 459.409415] [ 459.409679] Freed by task 1262: [ 459.410212] __kasan_slab_free+0x129/0x170 [ 459.410919] kmem_cache_free+0xb2/0x2a0 [ 459.411564] rcu_process_callbacks+0xbb2/0x2320 [ 459.412318] __do_softirq+0x225/0x8ac Fix this by delaying bdput() to the end of blkdev_get() which means we have finished accessing bdev. Fixes: 77ea887e433a ("implement in-kernel gendisk events handling") Reported-by: Hulk Robot Signed-off-by: Jason Yan Tested-by: Sedat Dilek Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Reviewed-by: Dan Carpenter Cc: Christoph Hellwig Cc: Jens Axboe Cc: Ming Lei Cc: Jan Kara Cc: Dan Carpenter Signed-off-by: Jens Axboe commit a352fe371053d047481635da328ea781329c84a4 Merge: 07c7b547a796 80bf72598663 Author: Tony Lindgren Date: Tue Jun 16 09:26:03 2020 -0700 Merge branch 'omap-for-v5.8/fixes-rc1' into fixes commit 07c7b547a79605f1041d55b84d91a4a4d9c5b363 Merge: e4a8fc054340 b3a9e3b9622a Author: Tony Lindgren Date: Tue Jun 16 09:25:03 2020 -0700 Merge tag 'v5.8-rc1' into fixes Linux 5.8-rc1 commit 034aa9cd698e315c767af1bac3fd1ff8898d2cd7 Author: Will Deacon Date: Mon Jun 15 16:27:43 2020 +0100 arm64: pgtable: Clear the GP bit for non-executable kernel pages Commit cca98e9f8b5e ("mm: enforce that vmap can't map pages executable") introduced 'pgprot_nx(prot)' for arm64 but collided silently with the BTI support during the merge window, which endeavours to clear the GP bit for non-executable kernel mappings in set_memory_nx(). For consistency between the two APIs, clear the GP bit in pgprot_nx(). Acked-by: Mark Rutland Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20200615154642.3579-1-will@kernel.org Signed-off-by: Will Deacon commit 80bf72598663496d08b3c0231377db6a99d7fd68 Author: Drew Fustini Date: Mon Jun 15 17:57:01 2020 +0200 ARM: dts: am5729: beaglebone-ai: fix rgmii phy-mode Since commit cd28d1d6e52e ("net: phy: at803x: Disable phy delay for RGMII mode") the networking is broken on the BeagleBone AI which has the AR8035 PHY for Gigabit Ethernet [0]. The fix is to switch from phy-mode = "rgmii" to phy-mode = "rgmii-rxid". Note: Grygorii made a similar DT fix for other AM57xx boards with a different phy in commit 820f8a870f65 ("ARM: dts: am57xx: fix networking on boards with ksz9031 phy"). [0] https://git.io/Jf7PX Fixes: 520557d4854b ("ARM: dts: am5729: beaglebone-ai: adding device tree") Cc: Vinod Koul Reviewed-by: Grygorii Strashko Signed-off-by: Robert Nelson Signed-off-by: Drew Fustini Signed-off-by: Tony Lindgren commit c030688d4427658bc4e947111341f75d2cb3d526 Author: Tony Lindgren Date: Fri Jun 12 10:23:40 2020 -0700 ARM: dts: Fix omap4 system timer source clocks I accidentally flipped the system timer to use system clock instead of the 32k source clock. Fixes: 14b1925a7219 ("ARM: dts: Configure system timers for omap4") Signed-off-by: Tony Lindgren commit 9cf28e41f9f768791f54ee18333239fda6927ed8 Author: Tony Lindgren Date: Fri Jun 12 10:19:50 2020 -0700 ARM: dts: Fix duovero smsc interrupt for suspend While testing the recent suspend and resume regressions I noticed that duovero can still end up losing edge gpio interrupts on runtime suspend. This causes NFSroot easily stopping working after resume on duovero. Let's fix the issue by using gpio level interrupts for smsc as then the gpio interrupt state is seen by the gpio controller on resume. Fixes: 731b409878a3 ("ARM: dts: Configure duovero for to allow core retention during idle") Signed-off-by: Tony Lindgren commit d7af722344e6dc52d87649100516515263e15c75 Author: Drew Fustini Date: Tue Jun 9 23:45:21 2020 +0200 ARM: dts: am335x-pocketbeagle: Fix mmc0 Write Protect AM3358 pin mcasp0_aclkr (ZCZ ball B13) [0] is routed to P1.31 header [1] Mode 4 of this pin is mmc0_sdwp (SD Write Protect). A signal connected to P1.31 may accidentally trigger mmc0 write protection. To avoid this situation, do not put mcasp0_aclkr in mode 4 (mmc0_sdwp) by default. [0] http://www.ti.com/lit/ds/symlink/am3358.pdf [1] https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual#531_Expansion_Headers Fixes: 047905376a16 (ARM: dts: Add am335x-pocketbeagle) Signed-off-by: Robert Nelson Signed-off-by: Drew Fustini Signed-off-by: Tony Lindgren commit b5b0180c2f767e90b4a6a885a0a2abaab6e3d48d Author: Peter Ujfalusi Date: Wed May 27 10:06:12 2020 +0300 dmaengine: ti: k3-udma: Fix the running channel handling in alloc_chan_resources In the unlikely case when the channel is running (RT enabled) during alloc_chan_resources then we should use udma_reset_chan() and not udma_stop() as the later is trying to initiate a teardown on the channel, which is not valid at this point. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200527070612.636-3-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 5a9377cc7421b59b13c9b90b8dc0aca332a1c958 Author: Peter Ujfalusi Date: Wed May 27 10:06:11 2020 +0300 dmaengine: ti: k3-udma: Fix cleanup code for alloc_chan_resources Some of the earlier errors should be sent to the error cleanup path to make sure that the uchan struct is reset, the dma_pool (if allocated) is released and memcpy channel pairs are released in a correct way. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200527070612.636-2-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 9f2f3ce3daed229eecf647acac44defbdee1f7c0 Author: Peter Ujfalusi Date: Wed May 27 09:53:57 2020 +0300 dmaengine: ti: k3-udma: Use correct node to read "ti,udma-atype" The "ti,udma-atype" property is expected in the UDMA node and not in the parent navss node. Fixes: 0ebcf1a274c5 ("dmaengine: ti: k3-udma: Implement support for atype (for virtualization)") Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200527065357.30791-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 6363d2065cd399cf9d6dc9d08c437f8658831100 Author: Dmitry Torokhov Date: Sun May 24 16:51:34 2020 -0700 HID: magicmouse: do not set up autorepeat Neither the trackpad, nor the mouse want input core to generate autorepeat events for their buttons, so let's reset the bit (as hid-input sets it for these devices based on the usage vendor code). Cc: stable@vger.kernel.org Reported-by: Yariv Tested-by: Yariv Signed-off-by: Dmitry Torokhov Signed-off-by: Jiri Kosina commit aa3c439c144f0a465ed1f28f11c772886fb02b35 Author: Caiyuan Xie Date: Fri May 22 05:06:10 2020 -0400 HID: alps: support devices with report id 2 Add support for devices which that have reports with id == 2 Signed-off-by: Caiyuan Xie Signed-off-by: Jiri Kosina commit 7c295eec1e351003a8ca06c34f9e79336fa5b244 Author: David Howells Date: Tue Jun 16 00:52:30 2020 +0100 afs: afs_vnode_commit_status() doesn't need to check the RPC error afs_vnode_commit_status() is only ever called if op->error is 0, so remove the op->error checks from the function. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Signed-off-by: David Howells commit 728279a5a1fd9fa9fa268f807391c4d19ad2822c Author: David Howells Date: Tue Jun 16 00:34:09 2020 +0100 afs: Fix use of afs_check_for_remote_deletion() afs_check_for_remote_deletion() checks to see if error ENOENT is returned by the server in response to an operation and, if so, marks the primary vnode as having been deleted as the FID is no longer valid. However, it's being called from the operation success functions, where no abort has happened - and if an inline abort is recorded, it's handled by afs_vnode_commit_status(). Fix this by actually calling the operation aborted method if provided and having that point to afs_check_for_remote_deletion(). Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Signed-off-by: David Howells commit 44767c353127cfcbee49a89bab39a3680ecd2a45 Author: David Howells Date: Tue Jun 16 00:25:56 2020 +0100 afs: Remove afs_operation::abort_code Remove afs_operation::abort_code as it's read but never set. Use ac.abort_code instead. Signed-off-by: David Howells commit 9bd87ec631ba07285138eed9c85645a12294f6c6 Author: David Howells Date: Tue Jun 16 00:23:12 2020 +0100 afs: Fix yfs_fs_fetch_status() to honour vnode selector Fix yfs_fs_fetch_status() to honour the vnode selector in op->fetch_status.which as does afs_fs_fetch_status() that allows afs_do_lookup() to use this as an alternative to the InlineBulkStatus RPC call if not implemented by the server. This doesn't matter in the current code as YFS servers always implement InlineBulkStatus, but a subsequent will call it on YFS servers too in some circumstances. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Signed-off-by: David Howells commit 6c85cacc8c096fc5cbdba61b6aa8fe675805e5d1 Author: David Howells Date: Tue Jun 16 00:18:09 2020 +0100 afs: Remove yfs_fs_fetch_file_status() as it's not used Remove yfs_fs_fetch_file_status() as it's no longer used. Signed-off-by: David Howells commit ca28aff0e1dc7dce9e12a7fd9276b7118ce5e73a Author: Sebastian Parschauer Date: Tue Jun 9 12:00:53 2020 +0200 HID: quirks: Always poll Obins Anne Pro 2 keyboard The Obins Anne Pro 2 keyboard (04d9:a293) disconnects after a few minutes of inactivity when using it wired and typing does not result in any input events any more. This is a common firmware flaw. So add the ALWAYS_POLL quirk for this device. GitHub user Dietrich Moerman (dietrichm) tested the quirk and requested my help in my project https://github.com/sriemer/fix-linux-mouse issue 22 to provide this patch. Link: https://www.reddit.com/r/AnnePro/comments/gruzcb/anne_pro_2_linux_cant_type_after_inactivity/ Signed-off-by: Sebastian Parschauer Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Jiri Kosina commit fa33e6236f5fa425a3ccf8925010d51fae9f0929 Author: Masami Hiramatsu Date: Wed Jun 3 11:40:28 2020 +0900 selftests/ftrace: Add "requires:" list support Introduce "requires:" list to check required ftrace interface for each test. This will simplify the interface checking code and unify the error message. Another good point is, it can skip the ftrace initializing. Note that this requires list must be written as a shell comment. Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 43e666acb79f3d355dd89bf20f4d25d3b15da13e Author: Federico Ricchiuto Date: Mon Jun 15 22:49:11 2020 +0200 HID: i2c-hid: add Mediacom FlexBook edge13 to descriptor override The Mediacom FlexBook edge13 uses the SIPODEV SP1064 touchpad, which does not supply descriptors, so it has to be added to the override list. Signed-off-by: Federico Ricchiuto Signed-off-by: Jiri Kosina commit 1e11b7dbef17bb6315f08771a64d86ab20fc037b Author: Masami Hiramatsu Date: Wed Jun 3 11:40:19 2020 +0900 selftests/ftrace: Return unsupported for the unconfigured features As same as other test cases, return unsupported if kprobe_events or argument access feature are not found. There can be a new arch which does not port those features yet, and an older kernel which doesn't support it. Those can not enable the features. Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 76ebbc2736434f210d0fe4a41cc3232b0dae4563 Author: Masami Hiramatsu Date: Wed Jun 3 11:40:10 2020 +0900 selftests/ftrace: Allow ":" in description Allow ":" in the description line. Currently if there is ":" in the test description line, the description is cut at that point, but that was unintended. Signed-off-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Shuah Khan commit 7ed286f3e061ee394782bd9fb4ed96bff0b5a021 Author: Ilya Dryomov Date: Tue Jun 9 11:59:08 2020 +0200 libceph: don't omit used_replica in target_copy() Currently target_copy() is used only for sending linger pings, so this doesn't come up, but generally omitting used_replica can hang the client as we wouldn't notice the acting set change (legacy_change in calc_target()) or trigger a warning in handle_reply(). Fixes: 117d96a04f00 ("libceph: support for balanced and localized reads") Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 2f3fead62144002557f322c2a7c15e1255df0653 Author: Ilya Dryomov Date: Tue Jun 9 11:57:56 2020 +0200 libceph: don't omit recovery_deletes in target_copy() Currently target_copy() is used only for sending linger pings, so this doesn't come up, but generally omitting recovery_deletes can result in unneeded resends (force_resend in calc_target()). Fixes: ae78dd8139ce ("libceph: make RECOVERY_DELETES feature create a new interval") Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 22d2cfdffa5bff3566e16cb7320e13ceb814674b Author: Ilya Dryomov Date: Thu Jun 4 11:12:34 2020 +0200 libceph: move away from global osd_req_flags osd_req_flags is overly general and doesn't suit its only user (read_from_replica option) well: - applying osd_req_flags in account_request() affects all OSD requests, including linger (i.e. watch and notify). However, linger requests should always go to the primary even though some of them are reads (e.g. notify has side effects but it is a read because it doesn't result in mutation on the OSDs). - calls to class methods that are reads are allowed to go to the replica, but most such calls issued for "rbd map" and/or exclusive lock transitions are requested to be resent to the primary via EAGAIN, doubling the latency. Get rid of global osd_req_flags and set read_from_replica flag only on specific OSD requests instead. Fixes: 8ad44d5e0d1e ("libceph: read_from_replica option") Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit a0b03952a797591d4b6d6fa7b9b7872e27783729 Author: Takashi Iwai Date: Tue Jun 16 15:21:50 2020 +0200 ALSA: hda/realtek - Add quirk for MSI GE63 laptop MSI GE63 laptop with ALC1220 codec requires the very same quirk (ALC1220_FIXUP_CLEVO_P950) as other MSI devices for the proper sound output. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208057 Cc: Link: https://lore.kernel.org/r/20200616132150.8778-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 33aea07f30c261eff7ba229f19fd1b161e0fb851 Author: Marco Elver Date: Tue Jun 16 01:15:29 2020 +0200 compiler_attributes.h: Support no_sanitize_undefined check with GCC 4 UBSAN is supported since GCC 4.9, which unfortunately did not yet have __has_attribute(). To work around, the __GCC4_has_attribute workaround requires defining which compiler version supports the given attribute. In the case of no_sanitize_undefined, it is the first version that supports UBSAN, which is GCC 4.9. Reported-by: kernel test robot Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miguel Ojeda Link: https://lkml.kernel.org/r/20200615231529.GA119644@google.com commit 6903cdae9f9f08d61e49c16cbef11c293e33a615 Author: Gaurav Singh Date: Fri Jun 12 14:53:27 2020 -0400 bpf, xdp, samples: Fix null pointer dereference in *_user code Memset on the pointer right after malloc can cause a NULL pointer deference if it failed to allocate memory. A simple fix is to replace malloc()/memset() pair with a simple call to calloc(). Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") Signed-off-by: Gaurav Singh Signed-off-by: Daniel Borkmann Acked-by: Jesper Dangaard Brouer Acked-by: John Fastabend commit a101e3dad8a90a840ccb45e492cd2ef7c01199ea Author: Thierry Reding Date: Fri Jun 12 17:01:00 2020 +0200 drm/tegra: hub: Register child devices In order to remove the dependency on the simple-bus compatible string, which causes the OF driver core to register all child devices, make the display-hub driver explicitly register the display controller children. Signed-off-by: Thierry Reding commit ca2030d56bb7b73079f834b10de38ced9cac74a3 Author: Thierry Reding Date: Fri Jun 12 17:00:59 2020 +0200 gpu: host1x: Register child devices In order to remove the dependency on the simple-bus compatible string, which causes the OF driver core to register all child devices, make the host1x driver explicitly register its children. Signed-off-by: Thierry Reding commit ef4e417eb3ec7fe657928f10ac1d2154d8a5fb38 Author: Nicolin Chen Date: Tue May 19 02:03:01 2020 -0700 drm/tegra: hub: Do not enable orphaned window group Though the unconditional enable/disable code is not a final solution, we don't want to run into a NULL pointer situation when window group doesn't link to its DC parent if the DC is disabled in Device Tree. So this patch simply adds a check to make sure that window group has a valid parent before running into tegra_windowgroup_enable/disable. Signed-off-by: Nicolin Chen Signed-off-by: Thierry Reding commit 109be8b23fb2ec8e2d309325ee3b7a49eab63961 Author: Christophe JAILLET Date: Sun Apr 26 21:16:30 2020 +0200 gpu: host1x: Clean up debugfs in error handling path host1x_debug_init() must be reverted in an error handling path. This is already fixed in the remove function since commit 44156eee91ba ("gpu: host1x: Clean up debugfs on removal") Signed-off-by: Christophe JAILLET Signed-off-by: Thierry Reding commit 64438e1bc0cdbe6d30bcdcb976f935eb3c297adc Author: Heiko Carstens Date: Wed Jun 10 10:36:05 2020 +0200 s390/numa: let NODES_SHIFT depend on NEED_MULTIPLE_NODES Qian Cai reported: """ When NUMA=n and nr_node_ids=2, in apply_wqattrs_prepare(), it has, for_each_node(node) { if (wq_calc_node_cpumask(... where it will trigger a booting warning, WARNING: workqueue cpumask: online intersect > possible intersect because it found 2 nodes and wq_numa_possible_cpumask[1] is an empty cpumask. """ Let NODES_SHIFT depend on NEED_MULTIPLE_NODES like it is done on other architectures in order to fix this. Fixes: 701dc81e7412 ("s390/mm: remove fake numa support") Reported-by: Qian Cai Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 478237a595120a18e9b52fd2c57a6e8b7a01e411 Author: Vincenzo Frascino Date: Tue Mar 24 12:10:27 2020 +0000 s390/vdso: fix vDSO clock_getres() clock_getres in the vDSO library has to preserve the same behaviour of posix_get_hrtimer_res(). In particular, posix_get_hrtimer_res() does: sec = 0; ns = hrtimer_resolution; and hrtimer_resolution depends on the enablement of the high resolution timers that can happen either at compile or at run time. Fix the s390 vdso implementation of clock_getres keeping a copy of hrtimer_resolution in vdso data and using that directly. Link: https://lkml.kernel.org/r/20200324121027.21665-1-vincenzo.frascino@arm.com Signed-off-by: Vincenzo Frascino Acked-by: Martin Schwidefsky [heiko.carstens@de.ibm.com: use llgf for proper zero extension] Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 2b2a25845d534ac6d55086e35c033961fdd83a26 Author: Nathan Chancellor Date: Tue Jun 2 12:25:24 2020 -0700 s390/vdso: Use $(LD) instead of $(CC) to link vDSO Currently, the VDSO is being linked through $(CC). This does not match how the rest of the kernel links objects, which is through the $(LD) variable. When clang is built in a default configuration, it first attempts to use the target triple's default linker, which is just ld. However, the user can override this through the CLANG_DEFAULT_LINKER cmake define so that clang uses another linker by default, such as LLVM's own linker, ld.lld. This can be useful to get more optimized links across various different projects. However, this is problematic for the s390 vDSO because ld.lld does not have any s390 emulatiom support: https://github.com/llvm/llvm-project/blob/llvmorg-10.0.1-rc1/lld/ELF/Driver.cpp#L132-L150 Thus, if a user is using a toolchain with ld.lld as the default, they will see an error, even if they have specified ld.bfd through the LD make variable: $ make -j"$(nproc)" -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- LLVM=1 \ LD=s390x-linux-gnu-ld \ defconfig arch/s390/kernel/vdso64/ ld.lld: error: unknown emulation: elf64_s390 clang-11: error: linker command failed with exit code 1 (use -v to see invocation) Normally, '-fuse-ld=bfd' could be used to get around this; however, this can be fragile, depending on paths and variable naming. The cleaner solution for the kernel is to take advantage of the fact that $(LD) can be invoked directly, which bypasses the heuristics of $(CC) and respects the user's choice. Similar changes have been done for ARM, ARM64, and MIPS. Link: https://lkml.kernel.org/r/20200602192523.32758-1-natechancellor@gmail.com Link: https://github.com/ClangBuiltLinux/linux/issues/1041 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers [heiko.carstens@de.ibm.com: add --build-id flag] Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 99448016ac792ac096def056828ab72c21f8582b Author: Chen Zhou Date: Sat May 9 16:56:08 2020 +0800 s390/protvirt: use scnprintf() instead of snprintf() snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. uv_query_facilities() should return the number of bytes printed into the buffer. This is the return value of scnprintf(). The other functions are the same. Link: https://lkml.kernel.org/r/20200509085608.41061-4-chenzhou10@huawei.com Signed-off-by: Chen Zhou Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 92fd356514b7505f40ca72b38ef84070e6502a70 Author: Chen Zhou Date: Sat May 9 16:56:07 2020 +0800 s390: use scnprintf() in sys_##_prefix##_##_name##_show snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show() methods should return the number of bytes printed into the buffer. This is the return value of scnprintf(). Link: https://lkml.kernel.org/r/20200509085608.41061-3-chenzhou10@huawei.com Signed-off-by: Chen Zhou Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit df8cea2a4bef3088c8570af543835992ce1d327e Author: Chen Zhou Date: Sat May 9 16:56:06 2020 +0800 s390/crypto: use scnprintf() instead of snprintf() snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show() methods should return the number of bytes printed into the buffer. This is the return value of scnprintf(). Link: https://lkml.kernel.org/r/20200509085608.41061-2-chenzhou10@huawei.com Signed-off-by: Chen Zhou Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 79d6c50227103a9f7df9690b38ff74127f69d3cf Author: Zou Wei Date: Tue Apr 21 20:35:48 2020 +0800 s390/zcrypt: use kzalloc This patch fixes below warning reported by coccicheck drivers/s390/crypto/zcrypt_ep11misc.c:198:8-15: WARNING: kzalloc should be used for cprb, instead of kmalloc/memset Link: https://lkml.kernel.org/r/1587472548-105240-1-git-send-email-zou_wei@huawei.com Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit ecc28f58e6cc479253bbd9aced013d8d34fef896 Author: Cornelia Huck Date: Tue May 26 11:36:29 2020 +0200 s390/virtio: remove unused pm callbacks Support for hibernation on s390 has been recently been removed with commit 394216275c7d ("s390: remove broken hibernate / power management support"), no need to keep unused code around. Link: https://lkml.kernel.org/r/20200526093629.257649-1-cohuck@redhat.com Signed-off-by: Cornelia Huck Reviewed-by: Halil Pasic Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit a87ee11607b853a31c8612d9f47b7fe974953b77 Author: Julian Wiedmann Date: Tue Apr 21 11:35:00 2020 +0100 s390/qdio: reduce SLSB writes during Input Queue processing Streamline the processing of QDIO Input Queues, and remove some intermittent SLSB updates (no deleting of old ACKs, no redundant transitions through NOT_INIT). Rather than counting ACKs, we now keep track of the whole batch of SBALs that were completed during the current polling cycle. Most completed SBALs stay in their initial state (ie. PRIMED or ERROR), except that the most recent SBAL in each sub-run is ACKed for IRQ reduction. The only logic changes happen in inbound_handle_work(), the other delta is just a renaming of the variables that track the SBAL batch. Note that in particular we don't need to flip the _oldest_ SBAL to an idle state (eg. NOT_INIT or ACKed) as a guard against catching our own tail. Since get_inbound_buffer_frontier() will never scan more than the remaining nr_buf_used SBALs, this scenario just doesn't occur. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 4bae85b620dc1f7aa4d2338b923d9d9b394b58c4 Author: Sven Schnelle Date: Mon Mar 9 16:56:53 2020 +0100 selftests/seccomp: s390 shares the syscall and return value register s390 cannot set syscall number and reture code at the same time, so set the appropriate flag to indicate it. Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 873e5a763d604c32988c4a78913a8dab3862d2f9 Author: Sven Schnelle Date: Mon Mar 9 16:44:50 2020 +0100 s390/ptrace: fix setting syscall number When strace wants to update the syscall number, it sets GPR2 to the desired number and updates the GPR via PTRACE_SETREGSET. It doesn't update regs->int_code which would cause the old syscall executed on syscall restart. As we cannot change the ptrace ABI and don't have a field for the interruption code, check whether the tracee is in a syscall and the last instruction was svc. In that case assume that the tracer wants to update the syscall number and copy the GPR2 value to regs->int_code. Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 00332c16b1604242a56289ff2b26e283dbad0812 Author: Sven Schnelle Date: Fri Mar 6 13:19:34 2020 +0100 s390/ptrace: pass invalid syscall numbers to tracing tracing expects to see invalid syscalls, so pass it through. The syscall path in entry.S checks the syscall number before looking up the handler, so it is still safe. Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit cd29fa798001075a554b978df3a64e6656c25794 Author: Sven Schnelle Date: Fri Mar 6 13:18:31 2020 +0100 s390/ptrace: return -ENOSYS when invalid syscall is supplied The current code returns the syscall number which an invalid syscall number is supplied and tracing is enabled. This makes the strace testsuite fail. Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 664f5f8de825648d1d31f6f5652e3cd117c77b50 Author: Sven Schnelle Date: Wed Mar 4 16:07:34 2020 +0100 s390/seccomp: pass syscall arguments via seccomp_data Use __secure_computing() and pass the register data via seccomp_data so secure computing doesn't have to fetch it again. Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit c119a8a3c395b0850f131728bdddd166d172842f Author: Julian Wiedmann Date: Fri May 8 17:00:21 2020 +0200 s390/qdio: fine-tune SLSB update xchg() for a single-byte location assembles to a 4-byte Compare&Swap, wrapped into a non-trivial amount of retry code that deals with concurrent modifications to the unaffected bytes. Change it to a simple byte-store, but preserve the memory ordering semantics that the CS provided. This simplifies the generated code for a hot path, and in theory also allows us to amortize the memory barriers over multiple SLSB updates. CC: Andreas Krebbel Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 4b3c1f1b15f576445c221cbc77a88540433a2ba7 Merge: 11425c4519e2 b3a9e3b9622a Author: Thomas Zimmermann Date: Tue Jun 16 13:31:47 2020 +0200 Merge v5.8-rc1 into drm-misc-fixes Beginning a new release cycles for what will become v5.8. Updating drm-misc-fixes accordingly. Signed-off-by: Thomas Zimmermann commit ed1220df6e666500ebf58c4f2fccc681941646fb Author: Shengjiu Wang Date: Tue Jun 16 10:53:48 2020 +0800 ASoC: fsl_ssi: Fix bclk calculation for mono channel For mono channel, SSI will switch to Normal mode. In Normal mode and Network mode, the Word Length Control bits control the word length divider in clock generator, which is different with I2S Master mode (the word length is fixed to 32bit), it should be the value of params_width(hw_params). The condition "slots == 2" is not good for I2S Master mode, because for Network mode and Normal mode, the slots can also be 2. Then we need to use (ssi->i2s_net & SSI_SCR_I2S_MODE_MASK) to check if it is I2S Master mode. So we refine the formula for mono channel, otherwise there will be sound issue for S24_LE. Fixes: b0a7043d5c2c ("ASoC: fsl_ssi: Caculate bit clock rate using slot number and width") Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/034eff1435ff6ce300b6c781130cefd9db22ab9a.1592276147.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 27a5e7d36d383970affae801d77141deafd536a8 Author: Neil Armstrong Date: Mon Jun 8 10:44:58 2020 +0200 mmc: meson-gx: limit segments to 1 when dram-access-quirk is needed The actual max_segs computation leads to failure while using the broadcom sdio brcmfmac/bcmsdh driver, since the driver tries to make usage of scatter gather. But with the dram-access-quirk we use a 1,5K SRAM bounce buffer, and the max_segs current value of 3 leads to max transfers to 4,5k, which doesn't work. This patch sets max_segs to 1 to better describe the hardware limitation, and fix the SDIO functionality with the brcmfmac/bcmsdh driver on Amlogic G12A/G12B SoCs on boards like SEI510 or Khadas VIM3. Reported-by: Art Nikpal Reported-by: Christian Hewitt Fixes: acdc8e71d9bb ("mmc: meson-gx: add dram-access-quirk") Signed-off-by: Neil Armstrong Reviewed-by: Kevin Hilman Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200608084458.32014-1-narmstrong@baylibre.com Signed-off-by: Ulf Hansson commit ec3decd21380081e3b5de4ba8d85d90a95f201a0 Author: Andy Shevchenko Date: Fri Jun 5 16:40:36 2020 +0300 gpio: pca953x: disable regmap locking for automatic address incrementing It's a repetition of the commit aa58a21ae378 ("gpio: pca953x: disable regmap locking") which states the following: This driver uses its own locking but regmap silently uses a mutex for all operations too. Add the option to disable locking to the regmap config struct. Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing") Cc: Uwe Kleine-König Signed-off-by: Andy Shevchenko Reviewed-by: Uwe Kleine-König Signed-off-by: Bartosz Golaszewski commit 0b22c25e1b81c5f718e89c4d759e6a359be24417 Author: Andy Shevchenko Date: Fri Jun 5 16:40:35 2020 +0300 gpio: pca953x: Fix direction setting when configure an IRQ The commit 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache") seems inadvertently made a typo in pca953x_irq_bus_sync_unlock(). When the direction bit is 1 it means input, and the piece of code in question was looking for output ones that should be turned to inputs. Fix direction setting when configure an IRQ by injecting a bitmap complement operation. Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache") Depends-on: 35d13d94893f ("gpio: pca953x: convert to use bitmap API") Cc: Marek Vasut Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit ba8c90c6184784b397807b72403656085ac2f8c1 Author: Andy Shevchenko Date: Fri Jun 5 16:40:34 2020 +0300 gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2 ACPI table on Intel Galileo Gen 2 has wrong pin number for IRQ resource of one of the I²C GPIO expanders. Since we know what that number is and luckily have GPIO bases fixed for SoC's controllers, we may use a simple DMI quirk to match the platform and retrieve GpioInt() pin on it for the expander in question. Mika suggested the way to avoid a quirk in the GPIO ACPI library and here is the second, almost rewritten version of it. Fixes: f32517bf1ae0 ("gpio: pca953x: support ACPI devices found on Galileo Gen2") Depends-on: 25e3ef894eef ("gpio: acpi: Split out acpi_gpio_get_irq_resource() helper") Suggested-by: Mika Westerberg Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 064c73afe7385de99e5b2785b88c83dc5d84403b Author: Andy Shevchenko Date: Fri Jun 5 16:40:33 2020 +0300 gpio: pca953x: Synchronize interrupt handler properly Since the commit aa58a21ae378 ("gpio: pca953x: disable regmap locking") the locking of regmap is disabled and that immediately introduces a synchronization issue. It's easy to see when we try to monitor more than one interrupt from the same chip. It seems that the problem exists from the day one and even commit 6e20fb18054c ("drivers/gpio/pca953x.c: add a mutex to fix race condition") missed this. Below are the traces and shell reproducers before and after proposed change. Note duplicates in the IRQ events. /proc/interrupts also shows a deviation, i.e. sum of children interrupts higher than parent's one. When locking is disabled for regmap and no protection in IRQ handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... gpioset-194 regmap_hw_write_start: i2c-INT3491:02 reg=2 count=1 irq/31-i2c-INT3-139 regmap_hw_read_start: i2c-INT3491:02 reg=4c count=2 gpioset-194 regmap_hw_write_done: i2c-INT3491:02 reg=2 count=1 gpioset-194 regmap_reg_read_cache: i2c-INT3491:02 reg=6 val=f5 gpioset-194 regmap_reg_write: i2c-INT3491:02 reg=6 val=f5 gpioset-194 regmap_hw_write_start: i2c-INT3491:02 reg=6 count=1 irq/31-i2c-INT3-139 regmap_hw_read_done: i2c-INT3491:02 reg=4c count=2 ... % gpiomon gpiochip3 0 & % gpioset gpiochip3 1=0 % gpioset gpiochip3 1=1 event: RISING EDGE offset: 0 timestamp: [ 302.782583765] % gpiomon gpiochip3 2 & % gpioset gpiochip3 1=0 event: RISING EDGE offset: 2 timestamp: [ 312.033148829] event: FALLING EDGE offset: 0 timestamp: [ 312.022757525] % gpioset gpiochip3 1=1 event: RISING EDGE offset: 2 timestamp: [ 316.201148473] event: RISING EDGE offset: 0 timestamp: [ 316.191759599] When locking is disabled for regmap and protection in IRQ handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... gpioset-202 regmap_hw_write_start: i2c-INT3491:02 reg=2 count=1 gpioset-202 regmap_hw_write_done: i2c-INT3491:02 reg=2 count=1 gpioset-202 regmap_reg_read_cache: i2c-INT3491:02 reg=6 val=fd gpioset-202 regmap_reg_write: i2c-INT3491:02 reg=6 val=fd gpioset-202 regmap_hw_write_start: i2c-INT3491:02 reg=6 count=1 gpioset-202 regmap_hw_write_done: i2c-INT3491:02 reg=6 count=1 irq/31-i2c-INT3-139 regmap_hw_read_start: i2c-INT3491:02 reg=4c count=2 irq/31-i2c-INT3-139 regmap_hw_read_done: i2c-INT3491:02 reg=4c count=2 ... % gpiomon gpiochip3 0 & % gpioset gpiochip3 1=0 event: FALLING EDGE offset: 0 timestamp: [ 531.330078107] % gpioset gpiochip3 1=1 event: RISING EDGE offset: 0 timestamp: [ 532.912239128] % gpiomon gpiochip3 2 & % gpioset gpiochip3 1=0 event: FALLING EDGE offset: 0 timestamp: [ 539.633669484] % gpioset gpiochip3 1=1 event: RISING EDGE offset: 0 timestamp: [ 542.256978461] Fixes: 6e20fb18054c ("drivers/gpio/pca953x.c: add a mutex to fix race condition") Depends-on: 35d13d94893f ("gpio: pca953x: convert to use bitmap API") Depends-on: 49427232764d ("gpio: pca953x: Perform basic regmap conversion") Cc: Marek Vasut Cc: Roland Stigge Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 435d1a471598752446a72ad1201b3c980526d869 Author: Peter Jones Date: Mon Jun 15 16:24:08 2020 -0400 efi: Make it possible to disable efivar_ssdt entirely In most cases, such as CONFIG_ACPI_CUSTOM_DSDT and CONFIG_ACPI_TABLE_UPGRADE, boot-time modifications to firmware tables are tied to specific Kconfig options. Currently this is not the case for modifying the ACPI SSDT via the efivar_ssdt kernel command line option and associated EFI variable. This patch adds CONFIG_EFI_CUSTOM_SSDT_OVERLAYS, which defaults disabled, in order to allow enabling or disabling that feature during the build. Cc: Signed-off-by: Peter Jones Link: https://lore.kernel.org/r/20200615202408.2242614-1-pjones@redhat.com Signed-off-by: Ard Biesheuvel commit 8c0a839c2bccb756454e35e8977e44fcf2bd417e Author: Heinrich Schuchardt Date: Tue Jun 16 01:42:31 2020 +0200 efi/libstub: Descriptions for stub helper functions Provide missing descriptions for EFI stub helper functions. Adjust formatting of existing descriptions to kernel style. Signed-off-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20200615234231.21059-1-xypron.glpk@gmx.de Signed-off-by: Ard Biesheuvel commit 861254d826499944cb4d9b5a15f5a794a6b99a69 Author: Navid Emamdoost Date: Thu Jun 4 22:00:52 2020 -0500 gpio: arizona: put pm_runtime in case of failure Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count if pm_runtime_put is not called in error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20200605030052.78235-1-navid.emamdoost@gmail.com Signed-off-by: Linus Walleij commit e6f390a834b56583e6fc0949822644ce92fbb107 Author: Navid Emamdoost Date: Thu Jun 4 21:52:07 2020 -0500 gpio: arizona: handle pm_runtime_get_sync failure case Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20200605025207.65719-1-navid.emamdoost@gmail.com Signed-off-by: Linus Walleij commit 8e68c6340d5833077b3753eabedab40755571383 Author: Vandita Kulkarni Date: Fri Jun 12 13:52:37 2020 +0530 drm/i915/display: Fix the encoder type check For all ddi, encoder->type holds output type as ddi, assigning it to individual o/p types is no more valid. Fixes: 362bfb995b78 ("drm/i915/tgl: Add DKL PHY vswing table for HDMI") v2: Rebase, no functional change. Signed-off-by: Vandita Kulkarni Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200612082237.11886-1-vandita.kulkarni@intel.com (cherry picked from commit 94641eb6c69682884abbecf22fe5b7c185af6a06) Signed-off-by: Joonas Lahtinen commit a3005c2edf7e8c3478880db1ca84028a2b6819bb Author: Imre Deak Date: Fri Jun 12 15:17:31 2020 +0300 drm/i915/icl+: Fix hotplug interrupt disabling after storm detection Atm, hotplug interrupts on TypeC ports are left enabled after detecting an interrupt storm, fix this. Reported-by: Kunal Joshi References: https://gitlab.freedesktop.org/drm/intel/-/issues/351 Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/1964 Cc: Kunal Joshi Cc: stable@vger.kernel.org Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200612121731.19596-1-imre.deak@intel.com (cherry picked from commit 587a87b9d7e94927edcdea018565bc1939381eb1) Signed-off-by: Joonas Lahtinen commit 27582a9c917940bc71c0df0b8e022cbde8d735d2 Author: Chris Wilson Date: Thu Jun 11 09:01:40 2020 +0100 drm/i915/gt: Move gen4 GT workarounds from init_clock_gating to workarounds Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200611080140.30228-6-chris@chris-wilson.co.uk (cherry picked from commit 2bcefd0d263ab4a72f0d61921ae6b0dc81606551) Signed-off-by: Joonas Lahtinen commit eacf21040aa97fd1b3c6bb201bfd43820e1c49be Author: Chris Wilson Date: Thu Jun 11 09:01:39 2020 +0100 drm/i915/gt: Move ilk GT workarounds from init_clock_gating to workarounds Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200611080140.30228-5-chris@chris-wilson.co.uk (cherry picked from commit 806a45c0838d253e306a6384057e851b65d11099) Signed-off-by: Joonas Lahtinen commit fd2599bda5a989c3332f4956fd7760ec32bd51ee Author: Chris Wilson Date: Thu Jun 11 09:01:38 2020 +0100 drm/i915/gt: Move snb GT workarounds from init_clock_gating to workarounds Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200611080140.30228-4-chris@chris-wilson.co.uk (cherry picked from commit c3b93a943f2c9ee4a106db100a2fc3b2f126bfc5) Signed-off-by: Joonas Lahtinen commit 695a2b11649e99bbf15d278042247042c42b8728 Author: Chris Wilson Date: Thu Jun 11 09:01:37 2020 +0100 drm/i915/gt: Move vlv GT workarounds from init_clock_gating to workarounds Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200611080140.30228-3-chris@chris-wilson.co.uk (cherry picked from commit 7331c356b6d2d8a01422cacab27478a1dba9fa2a) Signed-off-by: Joonas Lahtinen commit 7237b190add0794bd95979018a23eda698f2705d Author: Chris Wilson Date: Thu Jun 11 09:01:36 2020 +0100 drm/i915/gt: Move ivb GT workarounds from init_clock_gating to workarounds Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200611080140.30228-2-chris@chris-wilson.co.uk (cherry picked from commit 19f1f627b33385a2f0855cbc7d33d86d7f4a1e78) Signed-off-by: Joonas Lahtinen commit ef50fa9bd17d13d0611e39e13b37bbd3e1ea50bf Author: Chris Wilson Date: Thu Jun 11 10:30:15 2020 +0100 drm/i915/gt: Move hsw GT workarounds from init_clock_gating to workarounds Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. v2: Leave HSW_SCRATCH to set an explicit value, not or in our disable bit. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2011 Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200611093015.11370-1-chris@chris-wilson.co.uk (cherry picked from commit f93ec5fb563779bda4501890b1854526de58e0f1) Signed-off-by: Joonas Lahtinen commit 898e4e57adaeeefcfcf23f5d83360e513b69172f Author: Imre Deak Date: Wed Jun 10 01:06:16 2020 +0300 drm/i915/icl: Disable DIP on MST ports with the transcoder clock still on According to BSpec the Data Island Packet should be disabled after disabling the transcoder, but before the transcoder clock select is set to none. On an ICL RVP, daisy-chained MST config not following this leads to a hang with the following MCE when disabling the output: [ 870.948739] mce: [Hardware Error]: CPU 0: Machine Check Exception: 5 Bank 6: ba00000011000402 [ 871.019212] mce: [Hardware Error]: RIP !INEXACT! 10: {poll_idle+0x92/0xb0} [ 871.019212] mce: [Hardware Error]: TSC 135a261fe61 [ 871.019212] mce: [Hardware Error]: PROCESSOR 0:706e5 TIME 1591739604 SOCKET 0 APIC 0 microcode 20 [ 871.019212] mce: [Hardware Error]: Run the above through 'mcelog --ascii' [ 871.019212] mce: [Hardware Error]: Machine check: Processor context corrupt [ 871.019212] Kernel panic - not syncing: Fatal machine check [ 871.019212] Kernel Offset: disabled Bspec: 4287 Fixes: fa37a213275c ("drm/i915: Stop sending DP SDPs on ddi disable") Cc: Gwan-gyeong Mun Cc: Uma Shankar Signed-off-by: Imre Deak Reviewed-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200609220616.6015-1-imre.deak@intel.com (cherry picked from commit c980216dd224c52b5c70172753c209b653d84958) Signed-off-by: Joonas Lahtinen commit 8ab3a3812aa90e488813e719308ffd807b865624 Author: Chris Wilson Date: Tue Jun 9 16:17:23 2020 +0100 drm/i915/gt: Incrementally check for rewinding In commit 5ba32c7be81e ("drm/i915/execlists: Always force a context reload when rewinding RING_TAIL"), we placed the check for rewinding a context on actually submitting the next request in that context. This was so that we only had to check once, and could do so with precision avoiding as many forced restores as possible. For example, to ensure that we can resubmit the same request a couple of times, we include a small wa_tail such that on the next submission, the ring->tail will appear to move forwards when resubmitting the same request. This is very common as it will happen for every lite-restore to fill the second port after a context switch. However, intel_ring_direction() is limited in precision to movements of upto half the ring size. The consequence being that if we tried to unwind many requests, we could exceed half the ring and flip the sense of the direction, so missing a force restore. As no request can be greater than half the ring (i.e. 2048 bytes in the smallest case), we can check for rollback incrementally. As we check against the tail that would be submitted, we do not lose any sensitivity and allow lite restores for the simple case. We still need to double check upon submitting the context, to allow for multiple preemptions and resubmissions. Fixes: 5ba32c7be81e ("drm/i915/execlists: Always force a context reload when rewinding RING_TAIL") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: # v5.4+ Reviewed-by: Bruce Chang Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200609151723.12971-1-chris@chris-wilson.co.uk (cherry picked from commit e36ba817fa966f81fb1c8d16f3721b5a644b2fa9) Signed-off-by: Joonas Lahtinen commit a43555ac908c604f45ed98628805aec9355b9737 Author: Khaled Almahallawy Date: Mon Jun 8 13:45:37 2020 -0700 drm/i915/tc: fix the reset of ln0 Setting ln0 similar to ln1 Fixes: 3b51be4e4061b ("drm/i915/tc: Update DP_MODE programming") Cc: # v5.5+ Signed-off-by: Khaled Almahallawy Reviewed-by: José Roberto de Souza Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20200608204537.28468-1-khaled.almahallawy@intel.com (cherry picked from commit 4f72a8ee819d57d7329d88f487a2fc9b45153177) Signed-off-by: Joonas Lahtinen commit 4178b5a60cefd4721095cce974af7c142f2a6331 Author: Chris Wilson Date: Wed May 27 17:24:18 2020 +0100 drm/i915/gt: Prevent timeslicing into unpreemptable requests We have a I915_REQUEST_NOPREEMPT flag that we set when we must prevent the HW from preempting during the course of this request. We need to honour this flag and protect the HW even if we have a heartbeat request, or other maximum priority barrier, pending. As such, restrict the timeslicing check to avoid preempting into the topmost priority band, leaving the unpreemptable requests in blissful peace running uninterrupted on the HW. v2: Set the I915_PRIORITY_BARRIER to be less than I915_PRIORITY_UNPREEMPTABLE so that we never submit a request (heartbeat or barrier) that can legitimately preempt the current non-premptable request. Fixes: 2a98f4e65bba ("drm/i915: add infrastructure to hold off preemption on a request") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200527162418.24755-1-chris@chris-wilson.co.uk (cherry picked from commit b72f02d78e4f257761ed003444ae52083f962076) Signed-off-by: Joonas Lahtinen commit 3ffbe35321f4671c924a47bb50ca8087f87b2791 Author: Chris Wilson Date: Tue May 19 07:31:14 2020 +0100 drm/i915/selftests: Restore to default heartbeat Since we temporarily disable the heartbeat and restore back to the default value, we can use the stored defaults on the engine and avoid using a local. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200519063123.20673-3-chris@chris-wilson.co.uk (cherry picked from commit 3a230a554dbbc6cd5016cf1b56ee77cfcd48c7d8) Signed-off-by: Joonas Lahtinen commit bf6b694a6a908a6fd8f23eada669d1e90b2772af Author: Gene Chen Date: Mon Jun 8 17:38:45 2020 +0800 mfd: mt6360: Fix register driver NULL pointer by adding driver name The driver name was accidentally removed when .probe() by was replaced by .probe_new() during an early patch review. [ 121.243012] EAX: c2a8bc64 EBX: 00000000 ECX: 00000000 EDX: 00000000 [ 121.243012] ESI: c2a8bc79 EDI: 00000000 EBP: e54bdea8 ESP: e54bdea0 [ 121.243012] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010286 [ 121.243012] CR0: 80050033 CR2: 00000000 CR3: 02ec3000 CR4: 000006b0 [ 121.243012] Call Trace: [ 121.243012] kset_find_obj+0x3d/0xc0 [ 121.243012] driver_find+0x16/0x40 [ 121.243012] driver_register+0x49/0x100 [ 121.243012] ? i2c_for_each_dev+0x39/0x50 [ 121.243012] ? __process_new_adapter+0x20/0x20 [ 121.243012] ? cht_wc_driver_init+0x11/0x11 [ 121.243012] i2c_register_driver+0x30/0x80 [ 121.243012] ? intel_lpss_pci_driver_init+0x16/0x16 [ 121.243012] mt6360_pmu_driver_init+0xf/0x11 [ 121.243012] do_one_initcall+0x33/0x1a0 [ 121.243012] ? parse_args+0x1eb/0x3d0 [ 121.243012] ? __might_sleep+0x31/0x90 [ 121.243012] ? kernel_init_freeable+0x10a/0x17f [ 121.243012] kernel_init_freeable+0x12c/0x17f [ 121.243012] ? rest_init+0x110/0x110 [ 121.243012] kernel_init+0xb/0x100 [ 121.243012] ? schedule_tail_wrapper+0x9/0xc [ 121.243012] ret_from_fork+0x19/0x24 [ 121.243012] Modules linked in: [ 121.243012] CR2: 0000000000000000 [ 121.243012] random: get_random_bytes called from init_oops_id+0x3a/0x40 with crng_init=0 [ 121.243012] ---[ end trace 38a803400f1a2bee ]--- [ 121.243012] EIP: strcmp+0x11/0x30 Fixes: 7edd363421dab ("mfd: Add support for PMIC MT6360") Signed-off-by: Gene Chen Reviewed-by: Matthias Brugger [Lee: Taking the opportunity to fix the compatible string too 's/_/-/'] Signed-off-by: Lee Jones commit 3e5b8f87994e1269a7a9ea1862df163b110932eb Author: kernel test robot Date: Mon Jun 8 09:02:53 2020 +0800 pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI") Signed-off-by: kernel test robot Acked-by: Andy Shevchenko CC: Andy Shevchenko Link: https://lore.kernel.org/r/20200608010253.GA79576@44f7ab9e8d59 Signed-off-by: Linus Walleij commit 782b6b69847f34dda330530493ea62b7de3fd06a Author: Vidya Sagar Date: Thu Jun 4 23:19:35 2020 +0530 pinctrl: tegra: Use noirq suspend/resume callbacks Use noirq suspend/resume callbacks as other drivers which implement noirq suspend/resume callbacks (Ex:- PCIe) depend on pinctrl driver to configure the signals used by their respective devices in the noirq phase. Signed-off-by: Vidya Sagar Reviewed-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20200604174935.26560-1-vidyas@nvidia.com Signed-off-by: Linus Walleij commit 5e50311556c9f409a85740e3cb4c4511e7e27da0 Author: Dmitry Baryshkov Date: Thu Jun 4 03:28:17 2020 +0300 pinctrl: qcom: spmi-gpio: fix warning about irq chip reusage Fix the following warnings caused by reusage of the same irq_chip instance for all spmi-gpio gpio_irq_chip instances. Instead embed irq_chip into pmic_gpio_state struct. gpio gpiochip2: (c440000.qcom,spmi:pmic@2:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver. gpio gpiochip3: (c440000.qcom,spmi:pmic@4:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver. gpio gpiochip4: (c440000.qcom,spmi:pmic@a:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver. Signed-off-by: Dmitry Baryshkov Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200604002817.667160-1-dmitry.baryshkov@linaro.org Signed-off-by: Linus Walleij commit e9c15badbb7b20ccdbadf5da14e0a68fbad51015 Author: Mel Gorman Date: Mon Jun 15 13:13:58 2020 +0100 fs: Do not check if there is a fsnotify watcher on pseudo inodes The kernel uses internal mounts created by kern_mount() and populated with files with no lookup path by alloc_file_pseudo() for a variety of reasons. An example of such a mount is for anonymous pipes. For pipes, every vfs_write() regardless of filesystem, calls fsnotify_modify() to notify of any changes which incurs a small amount of overhead in fsnotify even when there are no watchers. It can also trigger for reads and readv and writev, it was simply vfs_write() that was noticed first. A patch is pending that reduces, but does not eliminate, the overhead of fsnotify but for files that cannot be looked up via a path, even that small overhead is unnecessary. The user API for all notification subsystems (inotify, fanotify, ...) is based on the pathname and a dirfd and proc entries appear to be the only visible representation of the files. Proc does not have the same pathname as the internal entry and the proc inode is not the same as the internal inode so even if fanotify is used on a file under /proc/XX/fd, no useful events are notified. This patch changes alloc_file_pseudo() to always opt out of fsnotify by setting FMODE_NONOTIFY flag so that no check is made for fsnotify watchers on pseudo files. This should be safe as the underlying helper for the dentry is d_alloc_pseudo() which explicitly states that no lookups are ever performed meaning that fanotify should have nothing useful to attach to. The test motivating this was "perf bench sched messaging --pipe". On a single-socket machine using threads the difference of the patch was as follows. 5.7.0 5.7.0 vanilla nofsnotify-v1r1 Amean 1 1.3837 ( 0.00%) 1.3547 ( 2.10%) Amean 3 3.7360 ( 0.00%) 3.6543 ( 2.19%) Amean 5 5.8130 ( 0.00%) 5.7233 * 1.54%* Amean 7 8.1490 ( 0.00%) 7.9730 * 2.16%* Amean 12 14.6843 ( 0.00%) 14.1820 ( 3.42%) Amean 18 21.8840 ( 0.00%) 21.7460 ( 0.63%) Amean 24 28.8697 ( 0.00%) 29.1680 ( -1.03%) Amean 30 36.0787 ( 0.00%) 35.2640 * 2.26%* Amean 32 38.0527 ( 0.00%) 38.1223 ( -0.18%) The difference is small but in some cases it's outside the noise so while marginal, there is still some small benefit to ignoring fsnotify for files allocated via alloc_file_pseudo() in some cases. Link: https://lore.kernel.org/r/20200615121358.GF3183@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit cf5057e169f460e825bdf580eb285bb601156f82 Author: Jens Wiklander Date: Mon Jun 15 15:02:42 2020 +0200 MAINTAINERS: change tee mailing list The old TEE mailing list tee-dev@lists.linaro.org is about to be retired. From now on please use op-tee@lists.trustedfirmware.org instead. Acked-by: Sumit Garg Signed-off-by: Jens Wiklander commit b9dbe0101e344e8339406a11b7a91d4a0c50ad13 Author: Matthew Hagan Date: Tue Jun 9 17:58:29 2020 +0100 ARM: dts: NSP: Disable PL330 by default, add dma-coherent property Currently the PL330 is enabled by default. However if left in IDM reset, as is the case with the Meraki and Synology NSP devices, the system will hang when probing for the PL330's AMBA peripheral ID. We therefore should be able to disable it in these cases. The PL330 is also included among of the list of peripherals put into coherent mode, so "dma-coherent" has been added here as well. Fixes: 5fa1026a3e4d ("ARM: dts: NSP: Add PL330 support") Signed-off-by: Matthew Hagan Signed-off-by: Florian Fainelli commit 76fafbfffb447d2a5a95d5a9486b0217c00f9785 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 w1: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 7fac96f2be3bbdb0b21c0de6812e965868137ad4 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 tracing/probe: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 9f162d9d726526b243b7452a6e7bb0ae5148c0f1 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 soc: ti: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 5cab1634e485ce7b33839f762f3bb9b5f009dc87 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 tifm: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 0084b225ee2639ece7b43af5b0b8a5e3d72a3c1e Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 dmaengine: tegra-apb: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit e35635000ffd74db358fbc18bc899918810788bf Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 stm class: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit b2b32e3aa08475d98d2c325fa5886e151fcd2981 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 Squashfs: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit ceaf7191b99daedd5b2026bf786c86ccadd94630 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 ASoC: SOF: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit eb492c627a61b5630d5e6d9f6cfecbcd60611e05 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 ima: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit af6bb61cc0a25fba4411f4348f01011c9a769047 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 sctp: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 50f894d50ac3303097011e7520755d337401245c Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 phy: samsung: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 18bdc20be19741ac97499a37e42323248114b496 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 RxRPC: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit a611d137bfe79098471cd22fbf969fa859074921 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 rapidio: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 5342e9bb035516f9649b53186a925a584b1800be Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 media: pwc: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit b912f89c947dbcea3101bba99c6edef44ae7ea29 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 firmware: pcdp: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 0a418cd117d2827653a3ae1cc1dd78edb4ff733d Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 oprofile: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 8a631c26bd184a94f9699b0cc7e0d1d34428d395 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 block: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit a5290feb5a90cc25901c51af8352a96d55776e66 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 tools/testing/nvdimm: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 9c5fbf05cb00cc9e6f1baf42751c6bfe1e6859ba Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 libata: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 67a862a94d5d55fbfde6942c81f9e51f943f452c Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 kprobes: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit ad8cb1654d2f123bbff317a8168028e2b451ed11 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 keys: encrypted-type: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 50b6951feb621ac6a246a6f773edc0a3b9b7f3b4 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 kexec: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 764e515f41c82220b20099962f47ec952c9ca6de Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 KVM: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 6112bad79f4de4bde62f630494760a300724e4b4 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 jffs2: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 8192e60c6a73f945c783d37934034eac29b5edb8 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 ibft: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit f2baaff2798fad7dd6d8cb03672b8024c85142f8 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 samples: mei: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 1907774c37f052ebc7606b6c24ae6d455ed07d85 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 ia64: kernel: unwind_i.h: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 67cd46244611ca7b0d5447dac9a0cbd76b875210 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 FS-Cache: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit c38e7e212acdb52dc8c0553340050b02e4a3f848 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 firewire: ohci: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 6b5679d2378324d0ed1c02c8e828b3b8687d3b08 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 cb710: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit ec4ac369397aa9ef81031cb7445bf1fbc677a393 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 drm/edid: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 1060bfc8e2d34a0fa058bdb610cd2fb70f74a472 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 drbd: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 6c48764aa478b193a58ae601e6e1e32d71a41988 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 crypto: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit d6562f1ca877e0c2b020be0a66d59592e9f37f24 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 can: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 12033457bf15c811ec26b0e9074ddce494d0399f Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 can: peak_canfd: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 466f966b1f4545acad150331911784d3f49ab1c3 Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 dmaengine: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 06f3a5a4cbb5fbf552174a426be0b3027149a66f Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 ARM: tegra: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 241cb28e38c322068c87da4c479e07fbae0c1a4e Author: Gustavo A. R. Silva Date: Thu May 28 09:35:11 2020 -0500 aio: Replace zero-length array with flexible-array There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit aa125f313d8e7d04bf001175dadeabaf8723c00b Author: Gustavo A. R. Silva Date: Fri Feb 21 09:32:33 2020 -0600 firmware: google: vpd: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit ea9ee9976750b3d047141ebeb12ba92b634dfbef Author: Gustavo A. R. Silva Date: Fri Feb 21 09:30:21 2020 -0600 firmware: google: memconsole: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit 8e849a41276a5bae6050d89ed9421bd882c77d2e Author: Gustavo A. R. Silva Date: Fri Feb 21 09:15:44 2020 -0600 firmware: dmi-sysfs: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva commit b8f1d1e05817f5e5f7517911b55ea13d2c0438a0 Author: Christoph Hellwig Date: Mon Jun 15 08:46:24 2020 +0200 scsi: Wire up ata_scsi_dma_need_drain for SAS HBA drivers We need ata_scsi_dma_need_drain for all drivers wired up to drive ATAPI devices through libata. That also includes the SAS HBA drivers in addition to native libata HBA drivers. Link: https://lore.kernel.org/r/20200615064624.37317-3-hch@lst.de Fixes: cc97923a5bcc ("block: move dma drain handling to scsi") Reported-by: Michael Ellerman Tested-by: Michael Ellerman Acked-by: Jack Wang Acked-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 7bb7ee8704fea9fec9eea53322b8464c3ed70a3d Author: Christoph Hellwig Date: Mon Jun 15 08:46:23 2020 +0200 scsi: libata: Provide an ata_scsi_dma_need_drain stub for !CONFIG_ATA SAS drivers can be compiled with ata support disabled. Provide a stub so that the drivers don't have to ifdef around wiring up ata_scsi_dma_need_drain. Link: https://lore.kernel.org/r/20200615064624.37317-2-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 0bdcfa182506526fbe4e088ff9ca86a31b81828d Author: Nicholas Piggin Date: Mon Jun 15 16:12:47 2020 +1000 powerpc/64s: Fix KVM interrupt using wrong save area The CTR register reload in the KVM interrupt path used the wrong save area for SLB (and NMI) interrupts. Fixes: 9600f261acaa ("powerpc/64s/exception: Move KVM test to common code") Cc: stable@vger.kernel.org # v5.7+ Reported-by: Christian Zigotzky Signed-off-by: Nicholas Piggin Tested-by: Christian Zigotzky Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200615061247.1310763-1-npiggin@gmail.com commit a1e17eb03e69bb61bd1b1a14610436b7b9be12d9 Author: Dinghao Liu Date: Fri May 22 12:59:29 2020 +0800 scsi: ufs-bsg: Fix runtime PM imbalance on error When ufs_bsg_alloc_desc_buffer() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Link: https://lore.kernel.org/r/20200522045932.31795-1-dinghao.liu@zju.edu.cn Fixes: 74e5e468b664 (scsi: ufs-bsg: Wake the device before sending raw upiu commands) Reviewed-by: Avri Altman Signed-off-by: Dinghao Liu Signed-off-by: Martin K. Petersen commit d35f18b554be015b6fa89fad6447c6fce8e6ad66 Author: Vaibhav Jain Date: Mon Jun 15 18:14:07 2020 +0530 powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' that returns a newly introduced 'struct nd_papr_pdsm_health' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_pdsm_health() that queries the nvdimm health information and then copies this information to the package payload whose layout is defined by 'struct nd_papr_pdsm_health'. Signed-off-by: Vaibhav Jain Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Link: https://lore.kernel.org/r/20200615124407.32596-7-vaibhav@linux.ibm.com Signed-off-by: Dan Williams commit f517f7925b7b453cb83be06c268ba057b78e4792 Author: Vaibhav Jain Date: Mon Jun 15 18:14:06 2020 +0530 ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm module and add the command family NVDIMM_FAMILY_PAPR to the white list of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the nvdimm command mask and implement necessary scaffolding in the module to handle ND_CMD_CALL ioctl and PDSM requests that we receive. The layout of the PDSM request as we expect from libnvdimm/libndctl is described in newly introduced uapi header 'papr_pdsm.h' which defines a 'struct nd_pkg_pdsm' and a maximal union named 'nd_pdsm_payload'. These new structs together with 'struct nd_cmd_pkg' for a pdsm envelop thats sent by libndctl to libnvdimm and serviced by papr_scm in 'papr_scm_service_pdsm()'. The PDSM request is communicated by member 'struct nd_cmd_pkg.nd_command' together with other information on the pdsm payload (size-in, size-out). The patch also introduces 'struct pdsm_cmd_desc' instances of which are stored in an array __pdsm_cmd_descriptors[] indexed with PDSM cmd and corresponding access function pdsm_cmd_desc() is introduced. 'struct pdsm_cdm_desc' holds the service function for a given PDSM and corresponding payload in/out sizes. A new function papr_scm_service_pdsm() is introduced and is called from papr_scm_ndctl() in case of a PDSM request is received via ND_CMD_CALL command from libnvdimm. The function performs validation on the PDSM payload based on info present in corresponding PDSM descriptor and if valid calls the 'struct pdcm_cmd_desc.service' function to service the PDSM. Signed-off-by: Vaibhav Jain Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Link: https://lore.kernel.org/r/20200615124407.32596-6-vaibhav@linux.ibm.com Signed-off-by: Dan Williams commit b5f38f09e1558c20265a2976b0337bab143a66c7 Author: Vaibhav Jain Date: Mon Jun 15 18:14:05 2020 +0530 powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl() Since papr_scm_ndctl() can be called from outside papr_scm, its exposed to the possibility of receiving NULL as value of 'cmd_rc' argument. This patch updates papr_scm_ndctl() to protect against such possibility by assigning it pointer to a local variable in case cmd_rc == NULL. Finally the patch also updates the 'default' add a debug log unknown 'cmd' values. Signed-off-by: Vaibhav Jain Reviewed-by: Ira Weiny Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Link: https://lore.kernel.org/r/20200615124407.32596-5-vaibhav@linux.ibm.com Signed-off-by: Dan Williams commit b791abf3201d724ac372c2ba1fa6e90d192e1dbf Author: Vaibhav Jain Date: Mon Jun 15 18:14:04 2020 +0530 powerpc/papr_scm: Fetch nvdimm health information from PHYP Implement support for fetching nvdimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit bitmap, bitwise-and of which is then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attribute 'papr/flags'. Since the hcall is costly, the health information is cached and only re-queried, 60s after the previous successful hcall. The patch also adds a documentation text describing flags reported by the the new sysfs attribute 'papr/flags' is also introduced at Documentation/ABI/testing/sysfs-bus-papr-pmem. [1] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Signed-off-by: Vaibhav Jain Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Link: https://lore.kernel.org/r/20200615124407.32596-4-vaibhav@linux.ibm.com Signed-off-by: Dan Williams commit 97c02c723bcef11da2f46facdde7c34e72ec8a1f Author: Vaibhav Jain Date: Mon Jun 15 18:14:03 2020 +0530 seq_buf: Export seq_buf_printf 'seq_buf' provides a very useful abstraction for writing to a string buffer without needing to worry about it over-flowing. However even though the API has been stable for couple of years now its still not exported to kernel loadable modules limiting its usage. Hence this patch proposes update to 'seq_buf.c' to mark seq_buf_printf() which is part of the seq_buf API to be exported to kernel loadable GPL modules. This symbol will be used in later parts of this patch-set to simplify content creation for a sysfs attribute. Signed-off-by: Vaibhav Jain Acked-by: Steven Rostedt (VMware) Cc: Piotr Maziarz Cc: Cezary Rojewski Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Borislav Petkov Link: https://lore.kernel.org/r/20200615124407.32596-3-vaibhav@linux.ibm.com Signed-off-by: Dan Williams commit 901e34905ac5e402fd690a1fdf51fc7f070bdc6e Author: Vaibhav Jain Date: Mon Jun 15 18:14:02 2020 +0530 powerpc: Document details on H_SCM_HEALTH hcall Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Signed-off-by: Vaibhav Jain Acked-by: Ira Weiny Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Link: https://lore.kernel.org/r/20200615124407.32596-2-vaibhav@linux.ibm.com Signed-off-by: Dan Williams commit b8ad540dd4e40566c520dff491fc06c71ae6b989 Author: Wei Yongjun Date: Mon Jun 15 09:35:22 2020 +0800 mptcp: fix memory leak in mptcp_subflow_create_socket() socket malloced by sock_create_kern() should be release before return in the error handling, otherwise it cause memory leak. unreferenced object 0xffff88810910c000 (size 1216): comm "00000003_test_m", pid 12238, jiffies 4295050289 (age 54.237s) hex dump (first 32 bytes): 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 2f 30 0a 81 88 ff ff ........./0..... backtrace: [<00000000e877f89f>] sock_alloc_inode+0x18/0x1c0 [<0000000093d1dd51>] alloc_inode+0x63/0x1d0 [<000000005673fec6>] new_inode_pseudo+0x14/0xe0 [<00000000b5db6be8>] sock_alloc+0x3c/0x260 [<00000000e7e3cbb2>] __sock_create+0x89/0x620 [<0000000023e48593>] mptcp_subflow_create_socket+0xc0/0x5e0 [<00000000419795e4>] __mptcp_socket_create+0x1ad/0x3f0 [<00000000b2f942e8>] mptcp_stream_connect+0x281/0x4f0 [<00000000c80cd5cc>] __sys_connect_file+0x14d/0x190 [<00000000dc761f11>] __sys_connect+0x128/0x160 [<000000008b14e764>] __x64_sys_connect+0x6f/0xb0 [<000000007b4f93bd>] do_syscall_64+0xa1/0x530 [<00000000d3e770b6>] entry_SYSCALL_64_after_hwframe+0x49/0xb3 Fixes: 2303f994b3e1 ("mptcp: Associate MPTCP context with TCP socket") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 4cd016ca2e3e880157070b78380199cc0c0a6226 Merge: c92cbaea3cc0 505ee3a1cab9 Author: David S. Miller Date: Mon Jun 15 18:06:52 2020 -0700 Merge branch 'remove-dependency-between-mlx5-act_ct-nf_flow_table' Roi Dayan says: ==================== remove dependency between mlx5, act_ct, nf_flow_table Some exported functions from act_ct and nf_flow_table being used in mlx5_core. This leads that mlx5 module always require act_ct and nf_flow_table modules. Those small exported functions can be moved to the header files to avoid this module dependency. ==================== Signed-off-by: David S. Miller commit 505ee3a1cab96785fbc2c7cdb41ab677ec270c3c Author: Alaa Hleihel Date: Sun Jun 14 14:12:49 2020 +0300 netfilter: flowtable: Make nf_flow_table_offload_add/del_cb inline Currently, nf_flow_table_offload_add/del_cb are exported by nf_flow_table module, therefore modules using them will have hard-dependency on nf_flow_table and will require loading it all the time. This can lead to an unnecessary overhead on systems that do not use this API. To relax the hard-dependency between the modules, we unexport these functions and make them static inline. Fixes: 978703f42549 ("netfilter: flowtable: Add API for registering to flow table events") Signed-off-by: Alaa Hleihel Reviewed-by: Roi Dayan Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 762f926d6f19b9ab4dee0f98d55fc67e276cd094 Author: Alaa Hleihel Date: Sun Jun 14 14:12:48 2020 +0300 net/sched: act_ct: Make tcf_ct_flow_table_restore_skb inline Currently, tcf_ct_flow_table_restore_skb is exported by act_ct module, therefore modules using it will have hard-dependency on act_ct and will require loading it all the time. This can lead to an unnecessary overhead on systems that do not use hardware connection tracking action (ct_metadata action) in the first place. To relax the hard-dependency between the modules, we unexport this function and make it a static inline one. Fixes: 30b0cf90c6dd ("net/sched: act_ct: Support restoring conntrack info on skbs") Signed-off-by: Alaa Hleihel Reviewed-by: Roi Dayan Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit c34a06c56df7c513cd19f591b26fe7d814c778cc Author: Andrii Nakryiko Date: Mon Jun 15 15:53:55 2020 -0700 tools/bpftool: Add ringbuf map to a list of known map types Add symbolic name "ringbuf" to map to BPF_MAP_TYPE_RINGBUF. Without this, users will see "type 27" instead of "ringbuf" in `map show` output. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200615225355.366256-1-andriin@fb.com commit b0659d8a950d424e57cc0a67afc4740ee561224e Author: Andrii Nakryiko Date: Mon Jun 15 14:49:26 2020 -0700 bpf: Fix definition of bpf_ringbuf_output() helper in UAPI comments Fix definition of bpf_ringbuf_output() in UAPI header comments, which is used to generate libbpf's bpf_helper_defs.h header. Return value is a number (error code), not a pointer. Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200615214926.3638836-1-andriin@fb.com commit 5bcc066c05909d2af5c954911309f02312b0b02e Author: Randy Dunlap Date: Mon Jun 15 12:22:53 2020 -0700 trace/events/block.h: drop kernel-doc for dropped function parameter Fix kernel-doc warning: the parameter was removed, so also remove the kernel-doc notation for it. ../include/trace/events/block.h:278: warning: Excess function parameter 'error' description in 'trace_block_bio_complete' Fixes: d24de76af836 ("block: remove the error argument to the block_bio_complete tracepoint") Signed-off-by: Randy Dunlap Cc: Christoph Hellwig Cc: Jens Axboe Signed-off-by: Jens Axboe commit a5dc8300df75e8b8384b4c82225f1e4a0b4d9b55 Author: Sasha Levin Date: Mon Jun 15 18:24:27 2020 -0400 scripts/decode_stacktrace: warn when modpath is needed but is unset When a user tries to parse a symbol located inside a module he must have modpath set. Otherwise, decode_stacktrace won't be able to parse the symbol correctly. Right now the failure is silent and easily missed by the user. What's worse is that by the time the user realizes what happened (or someone on LKML asks him to add the modpath and re-run), he might have already got rid of the vmlinux/modules. Signed-off-by: Sasha Levin Signed-off-by: Linus Torvalds commit c92cbaea3cc0a80807e386922f801eb6d3652c81 Author: Vladimir Oltean Date: Sun Jun 14 23:54:09 2020 +0300 net: dsa: sja1105: fix PTP timestamping with large tc-taprio cycles It isn't actually described clearly at all in UM10944.pdf, but on TX of a management frame (such as PTP), this needs to happen: - The destination MAC address (i.e. 01-80-c2-00-00-0e), along with the desired destination port, need to be installed in one of the 4 management slots of the switch, over SPI. - The host can poll over SPI for that management slot's ENFPORT field. That gets unset when the switch has matched the slot to the frame. And therein lies the problem. ENFPORT does not mean that the packet has been transmitted. Just that it has been received over the CPU port, and that the mgmt slot is yet again available. This is relevant because of what we are doing in sja1105_ptp_txtstamp_skb, which is called right after sja1105_mgmt_xmit. We are in a hard real-time deadline, since the hardware only gives us 24 bits of TX timestamp, so we need to read the full PTP clock to reconstruct it. Because we're in a hurry (in an attempt to make sure that we have a full 64-bit PTP time which is as close as possible to the actual transmission time of the frame, to avoid 24-bit wraparounds), first we read the PTP clock, then we poll for the TX timestamp to become available. But of course, we don't know for sure that the frame has been transmitted when we read the full PTP clock. We had assumed that ENFPORT means it has, but the assumption is incorrect. And while in most real-life scenarios this has never been caught due to software delays, nowhere is this fact more obvious than with a tc-taprio offload, where PTP traffic gets a small timeslot very rarely (example: 1 packet per 10 ms). In that case, we will be reading the PTP clock for timestamp reconstruction too early (before the packet has been transmitted), and this renders the reconstruction procedure incorrect (see the assumptions described in the comments found on function sja1105_tstamp_reconstruct). So the PTP TX timestamps will be off by 1<<24 clock ticks, or 135 ms (1 tick is 8 ns). So fix this case of premature optimization by simply reordering the sja1105_ptpegr_ts_poll and the sja1105_ptpclkval_read function calls. It turns out that in practice, the 135 ms hard deadline for PTP timestamp wraparound is not so hard, since even the most bandwidth-intensive PTP profiles, such as 802.1AS-2011, have a sync frame interval of 125 ms. So if we couldn't deliver a timestamp in 135 ms (which we can), we're toast and have much bigger problems anyway. Fixes: 47ed985e97f5 ("net: dsa: sja1105: Add logic for TX timestamping") Signed-off-by: Vladimir Oltean Acked-by: Richard Cochran Signed-off-by: David S. Miller commit cc970925feb9a38c2f0d34305518e00a3084ce85 Author: Sven Auhagen Date: Sun Jun 14 09:19:17 2020 +0200 mvpp2: ethtool rxtx stats fix The ethtool rx and tx queue statistics are reporting wrong values. Fix reading out the correct ones. Signed-off-by: Sven Auhagen Signed-off-by: David S. Miller commit 534a8bf0ccdd7b3f7a4eb22b5992d3aa1da08f93 Author: Sergei Shtylyov Date: Sat Jun 13 23:59:30 2020 +0300 MAINTAINERS: switch to my private email for Renesas Ethernet drivers I no longer work for Cogent Embedded (but my old email still works :-)), and still would like to continue looking after the Renesas Ethernet drivers and bindings. Let's switch to my private email. Signed-off-by: Sergei Shtylyov Acked-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 58d0c864e1a759a15c9df78f50ea5a5c32b3989e Author: Aditya Pakki Date: Fri Jun 12 15:27:55 2020 -0500 rocker: fix incorrect error handling in dma_rings_init In rocker_dma_rings_init, the goto blocks in case of errors caused by the functions rocker_dma_cmd_ring_waits_alloc() and rocker_dma_ring_create() are incorrect. The patch fixes the order consistent with cleanup in rocker_dma_rings_fini(). Signed-off-by: Aditya Pakki Signed-off-by: David S. Miller commit a6379f0ad6375a707e915518ecd5c2270afcd395 Author: Aditya Pakki Date: Fri Jun 12 15:01:54 2020 -0500 test_objagg: Fix potential memory leak in error handling In case of failure of check_expect_hints_stats(), the resources allocated by objagg_hints_get should be freed. The patch fixes this issue. Signed-off-by: Aditya Pakki Signed-off-by: David S. Miller commit adaff6d906d74dfe34d44fd18d5a7596d293df44 Author: Bartosz Golaszewski Date: Thu Jun 11 16:01:39 2020 +0200 net: ethernet: mtk-star-emac: simplify interrupt handling During development we tried to make the interrupt handling as fine-grained as possible with TX and RX interrupts being disabled/enabled independently and the counter registers reset from workqueue context. Unfortunately after thorough testing of current mainline, we noticed the driver has become unstable under heavy load. While this is hard to reproduce, it's quite consistent in the driver's current form. This patch proposes to go back to the previous approach of doing all processing in napi context with all interrupts masked in order to make the driver usable in mainline linux. This doesn't impact the performance on pumpkin boards at all and it's in line with what many ethernet drivers do in mainline linux anyway. At the same time we're adding a FIXME comment about the need to improve the interrupt handling. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit ea2fce88d2fd678ed9d45354ff49b73f1d5615dd Author: Wang Hai Date: Thu Jun 11 15:57:50 2020 +0800 mld: fix memory leak in ipv6_mc_destroy_dev() Commit a84d01647989 ("mld: fix memory leak in mld_del_delrec()") fixed the memory leak of MLD, but missing the ipv6_mc_destroy_dev() path, in which mca_sources are leaked after ma_put(). Using ip6_mc_clear_src() to take care of the missing free. BUG: memory leak unreferenced object 0xffff8881113d3180 (size 64): comm "syz-executor071", pid 389, jiffies 4294887985 (age 17.943s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 ff 02 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 ................ backtrace: [<000000002cbc483c>] kmalloc include/linux/slab.h:555 [inline] [<000000002cbc483c>] kzalloc include/linux/slab.h:669 [inline] [<000000002cbc483c>] ip6_mc_add1_src net/ipv6/mcast.c:2237 [inline] [<000000002cbc483c>] ip6_mc_add_src+0x7f5/0xbb0 net/ipv6/mcast.c:2357 [<0000000058b8b1ff>] ip6_mc_source+0xe0c/0x1530 net/ipv6/mcast.c:449 [<000000000bfc4fb5>] do_ipv6_setsockopt.isra.12+0x1b2c/0x3b30 net/ipv6/ipv6_sockglue.c:754 [<00000000e4e7a722>] ipv6_setsockopt+0xda/0x150 net/ipv6/ipv6_sockglue.c:950 [<0000000029260d9a>] rawv6_setsockopt+0x45/0x100 net/ipv6/raw.c:1081 [<000000005c1b46f9>] __sys_setsockopt+0x131/0x210 net/socket.c:2132 [<000000008491f7db>] __do_sys_setsockopt net/socket.c:2148 [inline] [<000000008491f7db>] __se_sys_setsockopt net/socket.c:2145 [inline] [<000000008491f7db>] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2145 [<00000000c7bc11c5>] do_syscall_64+0xa1/0x530 arch/x86/entry/common.c:295 [<000000005fb7a3f3>] entry_SYSCALL_64_after_hwframe+0x49/0xb3 Fixes: 1666d49e1d41 ("mld: do not remove mld souce list info when set link down") Reported-by: Hulk Robot Signed-off-by: Wang Hai Acked-by: Hangbin Liu Signed-off-by: David S. Miller commit 7c6cdf6376d563ddaf9229cf39c4f372516eb3ad Merge: 38af8f2d606a e000940473d1 Author: David S. Miller Date: Mon Jun 15 13:28:33 2020 -0700 Merge branch 'bnxt_en-Bug-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes. Four fixes related to the bnxt_en driver's resume path, AER reset, and the timer function. ==================== Signed-off-by: David S. Miller commit e000940473d1423a42ef9c823fb23ccffe3f07ea Author: Vasundhara Volam Date: Sun Jun 14 19:57:10 2020 -0400 bnxt_en: Return from timer if interface is not in open state. This will avoid many uneccessary error logs when driver or firmware is in reset. Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6e2f83884c099de0e87b15a820736e522755d074 Author: Michael Chan Date: Sun Jun 14 19:57:09 2020 -0400 bnxt_en: Fix AER reset logic on 57500 chips. AER reset should follow the same steps as suspend/resume. We need to free context memory during AER reset and allocate new context memory during recovery by calling bnxt_hwrm_func_qcaps(). We also need to call bnxt_reenable_sriov() to restore the VFs. Fixes: bae361c54fb6 ("bnxt_en: Improve AER slot reset.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 59ae210173ff86256fa0cdba4ea4d608c61e123d Author: Michael Chan Date: Sun Jun 14 19:57:08 2020 -0400 bnxt_en: Re-enable SRIOV during resume. If VFs are enabled, we need to re-configure them during resume because firmware has been reset while resuming. Otherwise, the VFs won't work after resume. Fixes: c16d4ee0e397 ("bnxt_en: Refactor logic to re-enable SRIOV after firmware reset detected.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 2084ccf6259cc95e0575f0fafc93595d0219a9f6 Author: Michael Chan Date: Sun Jun 14 19:57:07 2020 -0400 bnxt_en: Simplify bnxt_resume(). The separate steps we do in bnxt_resume() can be done more simply by calling bnxt_hwrm_func_qcaps(). This change will add an extra __bnxt_hwrm_func_qcaps() call which is needed anyway on older firmware. Fixes: f9b69d7f6279 ("bnxt_en: Fix suspend/resume path on 57500 chips") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 38af8f2d606a9372dbf19e47b3939e96c1ff28e4 Merge: 6e701c299469 3003055f5066 Author: David S. Miller Date: Mon Jun 15 13:27:13 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Fix bogus EEXIST on element insertions to the rbtree with timeouts, from Stefano Brivio. 2) Preempt BUG splat in the pipapo element insertion path, also from Stefano. 3) Release filter from the ctnetlink error path. 4) Release flowtable hooks from the deletion path. ==================== Signed-off-by: David S. Miller commit 6e701c299469dd2b8a64056051c6834809152424 Author: Vladimir Oltean Date: Mon Jun 15 19:42:44 2020 +0300 MAINTAINERS: merge entries for felix and ocelot drivers The ocelot switchdev driver also provides a set of library functions for the felix DSA driver, which in practice means that most of the patches will be of interest to both groups of driver maintainers. So, as also suggested in the discussion here, let's merge the 2 entries into a single larger one: https://www.spinics.net/lists/netdev/msg657412.html Note that the entry has been renamed into "OCELOT SWITCH" since neither Vitesse nor Microsemi exist any longer as company names, instead they are now named Microchip (which again might be subject to change in the future), so use the device family name instead. Suggested-by: Alexandre Belloni Signed-off-by: Vladimir Oltean Acked-by: Horatiu Vultur Signed-off-by: David S. Miller commit e89df5c4322c1bf495f62d74745895b5fd2a4393 Author: Zekun Shen Date: Mon Jun 15 11:50:29 2020 -0400 net: alx: fix race condition in alx_remove There is a race condition exist during termination. The path is alx_stop and then alx_remove. An alx_schedule_link_check could be called before alx_stop by interrupt handler and invoke alx_link_check later. Alx_stop frees the napis, and alx_remove cancels any pending works. If any of the work is scheduled before termination and invoked before alx_remove, a null-ptr-deref occurs because both expect alx->napis[i]. This patch fix the race condition by moving cancel_work_sync functions before alx_free_napis inside alx_stop. Because interrupt handler can call alx_schedule_link_check again, alx_free_irq is moved before cancel_work_sync calls too. Signed-off-by: Zekun Shen Signed-off-by: David S. Miller commit dff515a3e71dc8ab3b9dcc2e23a9b5fca88b3c18 Author: Thomas Falcon Date: Mon Jun 15 10:29:23 2020 -0500 ibmvnic: Harden device login requests The VNIC driver's "login" command sequence is the final step in the driver's initialization process with device firmware, confirming the available device queue resources to be utilized by the driver. Under high system load, firmware may not respond to the request in a timely manner or may abort the request. In such cases, the driver should reattempt the login command sequence. In case of a device error, the number of retries is bounded. Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit 939a5bf7c9b7a1ad9c5d3481c93766a522773531 Author: Charles Keepax Date: Mon Jun 15 14:18:54 2020 +0100 net: macb: Only disable NAPI on the actual error path A recent change added a disable to NAPI into macb_open, this was intended to only happen on the error path but accidentally applies to all paths. This causes NAPI to be disabled on the success path, which leads to the network to no longer functioning. Fixes: 014406babc1f ("net: cadence: macb: disable NAPI on error") Signed-off-by: Charles Keepax Tested-by: Corentin Labbe Signed-off-by: David S. Miller commit 0acb47a3a09381d20fb643aa195cf5840aac3bb4 Author: Wang Qing Date: Mon Jun 15 17:02:23 2020 +0800 qlcnic: Use kobj_to_dev() instead Use kobj_to_dev() instead of container_of() Signed-off-by: Wang Qing Signed-off-by: David S. Miller commit a386bc5b2155bf1fc76229481ac7e7f2a646d966 Author: Geliang Tang Date: Mon Jun 15 16:34:28 2020 +0800 mptcp: use list_first_entry_or_null Use list_first_entry_or_null to simplify the code. Signed-off-by: Geliang Tang Signed-off-by: David S. Miller commit 35ed87add7def6809cf7815cc495a6537bc3bb01 Author: Colin Ian King Date: Mon Jun 15 09:29:11 2020 +0100 net: axienet: fix spelling mistake in comment "Exteneded" -> "extended" There is a spelling mistake in a comment. Fix it. Signed-off-by: Colin Ian King Acked-by: Michal Simek Signed-off-by: David S. Miller commit c06c1f87b66e74c29ecc68020e0312c565deebe0 Author: Geliang Tang Date: Mon Jun 15 16:28:03 2020 +0800 mptcp: drop MPTCP_PM_MAX_ADDR We have defined MPTCP_PM_ADDR_MAX in pm_netlink.c, so drop this duplicate macro. Fixes: 1b1c7a0ef7f3 ("mptcp: Add path manager interface") Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit 33cf601da7a42b1a78d04746aea47b85ccb5c49b Author: Ka-Cheong Poon Date: Mon Jun 15 00:40:25 2020 -0700 net/rds: NULL pointer de-reference in rds_ib_add_one() The parent field of a struct device may be NULL. The macro ibdev_to_node() should check for that. Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 6769b275a313c76ddcd7d94c632032326db5f759 Author: Tom Seewald Date: Wed Jun 10 12:47:17 2020 -0500 RDMA/siw: Fix pointer-to-int-cast warning in siw_rx_pbl() The variable buf_addr is type dma_addr_t, which may not be the same size as a pointer. To ensure it is the correct size, cast to a uintptr_t. Fixes: c536277e0db1 ("RDMA/siw: Fix 64/32bit pointer inconsistency") Link: https://lore.kernel.org/r/20200610174717.15932-1-tseewald@gmail.com Signed-off-by: Tom Seewald Reviewed-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit 0dc63bbee0fa6da20283ae6e22e99c6fde25ed8e Author: Kieran Bingham Date: Tue Jun 9 13:45:55 2020 +0100 RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' The word 'descriptor' is misspelled throughout the tree. Fix it up accordingly: decriptors -> descriptors Link: https://lore.kernel.org/r/20200609124610.3445662-3-kieran.bingham+renesas@ideasonboard.com Link: https://lore.kernel.org/r/20200609124610.3445662-12-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Kieran Bingham Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 4f5747cf8e5947479a27a3597829e45d6d8d73e0 Author: Tom Seewald Date: Thu Jun 4 21:30:12 2020 -0500 RDMA/mlx5: Fix -Wformat warning in check_ucmd_data() Variables of type size_t should use %zu rather than %lu [1]. The variables "inlen", "ucmd", "last", and "size" are all size_t, so use the correct format specifiers. [1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html Fixes: e383085c2425 ("RDMA/mlx5: Set ECE options during QP create") Link: https://lore.kernel.org/r/20200605023012.9527-1-tseewald@gmail.com Signed-off-by: Tom Seewald Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7a88a6227dc7f2e723bba11ece05e57bd8dce8e4 Author: Philipp Fent Date: Mon Jun 15 13:51:09 2020 +0200 efi/libstub: Fix path separator regression Commit 9302c1bb8e47 ("efi/libstub: Rewrite file I/O routine") introduced a regression that made a couple of (badly configured) systems fail to boot [1]: Until 5.6, we silently accepted Unix-style file separators in EFI paths, which might violate the EFI standard, but are an easy to make mistake. This fix restores the pre-5.7 behaviour. [1] https://bbs.archlinux.org/viewtopic.php?id=256273 Fixes: 9302c1bb8e47 ("efi/libstub: Rewrite file I/O routine") Signed-off-by: Philipp Fent Link: https://lore.kernel.org/r/20200615115109.7823-1-fent@in.tum.de [ardb: rewrite as chained if/else statements] Signed-off-by: Ard Biesheuvel commit 24552d10339f13d2174e013002da3ed90e26adda Author: Ard Biesheuvel Date: Mon Jun 15 12:31:14 2020 +0200 efi/libstub: Fix missing-prototype warning for skip_spaces() Include into skip_spaces.c to silence a compiler warning about a missing prototype. Signed-off-by: Ard Biesheuvel commit 630e8d5507d9f55dfa98134bfcadefb6cfba4fbb Author: Kamal Dasu Date: Mon Jun 15 11:51:34 2020 -0400 mtd: set master partition panic write flag Check and set master panic write flag so that low level drivers can use it to take required action to ensure oops data gets written to assigned mtdoops device partition. Fixes: 9f897bfdd89f ("mtd: Add flag to indicate panic_write") Signed-off-by: Kamal Dasu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200615155134.32007-1-kdasu.kdev@gmail.com commit 1f6ce4445ab5c97aa63583bd6ce4fc20f471e11c Author: Richard Weinberger Date: Mon Jun 15 13:34:04 2020 +0200 nandsim: Fix return code testing of ns_find_operation() ns_find_operation() returns 0 on success. Fixes: 052a7a5374bc ("mtd: rawnand: nandsim: Clean error handling") Signed-off-by: Richard Weinberger Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200615113404.25447-1-richard@nod.at commit 3be20b6fc13abff843901fcd7cd9c7a3a7f95b90 Merge: b3a9e3b9622a 7b97d868b7ab Author: Linus Torvalds Date: Mon Jun 15 09:32:10 2020 -0700 Merge tag 'ext4-for-linus-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull more ext4 updates from Ted Ts'o: "This is the second round of ext4 commits for 5.8 merge window [1]. It includes the per-inode DAX support, which was dependant on the DAX infrastructure which came in via the XFS tree, and a number of regression and bug fixes; most notably the "BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks" reported by syzkaller" [1] The pull request actually came in 15 minutes after I had tagged the rc1 release. Tssk, tssk, late.. - Linus * tag 'ext4-for-linus-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4, jbd2: ensure panic by fix a race between jbd2 abort and ext4 error handlers ext4: support xattr gnu.* namespace for the Hurd ext4: mballoc: Use this_cpu_read instead of this_cpu_ptr ext4: avoid utf8_strncasecmp() with unstable name ext4: stop overwrite the errcode in ext4_setup_super ext4: fix partial cluster initialization when splitting extent ext4: avoid race conditions when remounting with options that change dax Documentation/dax: Update DAX enablement for ext4 fs/ext4: Introduce DAX inode flag fs/ext4: Remove jflag variable fs/ext4: Make DAX mount option a tri-state fs/ext4: Only change S_DAX on inode load fs/ext4: Update ext4_should_use_dax() fs/ext4: Change EXT4_MOUNT_DAX to EXT4_MOUNT_DAX_ALWAYS fs/ext4: Disallow verity if inode is DAX fs/ext4: Narrow scope of DAX check in setflags commit 88c200d929c969408779dbae4c4fad32bc510373 Author: Sean Christopherson Date: Mon Jun 8 18:45:18 2020 -0700 KVM: VMX: Add helpers to identify interrupt type from intr_info Add is_intr_type() and is_intr_type_n() to consolidate the boilerplate code for querying a specific type of interrupt given an encoded value from VMCS.VM_{ENTER,EXIT}_INTR_INFO, with and without an associated vector respectively. Signed-off-by: Sean Christopherson Message-Id: <20200609014518.26756-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8dd4daa04278d7437641962ed53b843c0b0ec4a9 Author: Shyam Thombre Date: Wed Jun 10 16:39:44 2020 +0530 arm64: mm: reset address tag set by kasan sw tagging KASAN sw tagging sets a random tag of 8 bits in the top byte of the pointer returned by the memory allocating functions. So for the functions unaware of this change, the top 8 bits of the address must be reset which is done by the function arch_kasan_reset_tag(). Signed-off-by: Shyam Thombre Link: https://lore.kernel.org/r/1591787384-5823-1-git-send-email-sthombre@codeaurora.org Signed-off-by: Will Deacon commit 413d3ea6b775d77b2057f13a9af75875eb066156 Author: Will Deacon Date: Mon Jun 15 12:23:16 2020 +0100 arm64: traps: Dump registers prior to panic() in bad_mode() When panicing due to an unknown/unhandled exception at EL1, dump the registers of the faulting context so that it's easier to figure out what went wrong. In particular, this makes it a lot easier to debug in-kernel BTI failures since it pretty-prints PSTATE.BTYPE in the crash log. Cc: Mark Brown Cc: Catalin Marinas Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200615113458.2884-1-will@kernel.org Signed-off-by: Will Deacon commit 1e570f512cbdc5e9e401ba640d9827985c1bea1e Author: Dave Martin Date: Wed Jun 10 18:03:10 2020 +0100 arm64/sve: Eliminate data races on sve_default_vl sve_default_vl can be modified via the /proc/sys/abi/sve_default_vl sysctl concurrently with use, and modified concurrently by multiple threads. Adding a lock for this seems overkill, and I don't want to think any more than necessary, so just define wrappers using READ_ONCE()/ WRITE_ONCE(). This will avoid the possibility of torn accesses and repeated loads and stores. There's no evidence yet that this is going wrong in practice: this is just hygiene. For generic sysctl users, it would be better to build this kind of thing into the sysctl common code somehow. Reported-by: Will Deacon Signed-off-by: Dave Martin Link: https://lore.kernel.org/r/1591808590-20210-3-git-send-email-Dave.Martin@arm.com [will: move set_sve_default_vl() inside #ifdef to squash allnoconfig warning] Signed-off-by: Will Deacon commit 43708c0ab7c9861cf3fb8664ab327f8c7b1bada0 Author: Flavio Suligoi Date: Tue Jun 9 18:38:53 2020 +0200 tools: testing: ftrace: trigger: fix spelling mistake Fix typo: "tigger" --> "trigger" Signed-off-by: Flavio Suligoi Acked-by: Steven Rostedt (VMware) Signed-off-by: Shuah Khan commit 27784a256c2a453d891c0aaff84c3ac3f2e8a5a0 Author: Geert Uytterhoeven Date: Sat Jun 13 09:37:54 2020 +0200 spi: uapi: spidev: Use TABs for alignment The UAPI uses TABs for alignment. Convert the recently introduced spaces to TABs to restore consistency. Fixes: 7bb64402a092136 ("spi: tools: Add macro definitions to fix build errors") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200613073755.15906-1-geert+renesas@glider.be Signed-off-by: Mark Brown commit 801dd57bd1d8c2c253f43635a3045bfa32a810b3 Author: Pavel Begunkov Date: Mon Jun 15 10:33:14 2020 +0300 io_uring: cancel by ->task not pid For an exiting process it tries to cancel all its inflight requests. Use req->task to match such instead of work.pid. We always have req->task set, and it will be valid because we're matching only current exiting task. Also, remove work.pid and everything related, it's useless now. Reported-by: Eric W. Biederman Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 4dd2824d6d5914949b5fe589538bc2622d84c5dd Author: Pavel Begunkov Date: Mon Jun 15 10:33:13 2020 +0300 io_uring: lazy get task There will be multiple places where req->task is used, so refcount-pin it lazily with introduced *io_{get,put}_req_task(). We need to always have valid ->task for cancellation reasons, but don't care about pinning it in some cases. That's why it sets req->task in io_req_init() and implements get/put laziness with a flag. This also removes using @current from polling io_arm_poll_handler(), etc., but doesn't change observable behaviour. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 67c4d9e693e3bb7fb968af24e3584f821a78ba56 Author: Pavel Begunkov Date: Mon Jun 15 10:24:05 2020 +0300 io_uring: batch cancel in io_uring_cancel_files() Instead of waiting for each request one by one, first try to cancel all of them in a batched manner, and then go over inflight_list/etc to reap leftovers. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 44e728b8aae0bb6d4229129083974f9dea43f50b Author: Pavel Begunkov Date: Mon Jun 15 10:24:04 2020 +0300 io_uring: cancel all task's requests on exit If a process is going away, io_uring_flush() will cancel only 1 request with a matching pid. Cancel all of them Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 4f26bda1522c35d2701fc219368c7101c17005c1 Author: Pavel Begunkov Date: Mon Jun 15 10:24:03 2020 +0300 io-wq: add an option to cancel all matched reqs This adds support for cancelling all io-wq works matching a predicate. It isn't used yet, so no change in observable behaviour. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit f4c2665e33f48904f2766d644df33fb3fd54b5ec Author: Pavel Begunkov Date: Mon Jun 15 10:24:02 2020 +0300 io-wq: reorder cancellation pending -> running Go all over all pending lists and cancel works there, and only then try to match running requests. No functional changes here, just a preparation for bulk cancellation. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 4ec89596d06bd481ba827f3b409b938d63914157 Author: David Howells Date: Sun Jun 14 22:12:05 2020 +0100 afs: Fix the mapping of the UAEOVERFLOW abort code Abort code UAEOVERFLOW is returned when we try and set a time that's out of range, but it's currently mapped to EREMOTEIO by the default case. Fix UAEOVERFLOW to map instead to EOVERFLOW. Found with the generic/258 xfstest. Note that the test is wrong as it assumes that the filesystem will support a pre-UNIX-epoch date. Fixes: 1eda8bab70ca ("afs: Add support for the UAE error table") Signed-off-by: David Howells commit 793fe82ee33aab1023cf023cd7d744af19a3dff9 Author: David Howells Date: Fri Jun 12 16:13:52 2020 +0100 afs: Fix truncation issues and mmap writeback size Fix the following issues: (1) Fix writeback to reduce the size of a store operation to i_size, effectively discarding the extra data. The problem comes when afs_page_mkwrite() records that a page is about to be modified by mmap(). It doesn't know what bits of the page are going to be modified, so it records the whole page as being dirty (this is stored in page->private as start and end offsets). Without this, the marshalling for the store to the server extends the size of the file to the end of the page (in afs_fs_store_data() and yfs_fs_store_data()). (2) Fix setattr to actually truncate the pagecache, thereby clearing the discarded part of a file. (3) Fix setattr to check that the new size is okay and to disable ATTR_SIZE if i_size wouldn't change. (4) Force i_size to be updated as the result of a truncate. (5) Don't truncate if ATTR_SIZE is not set. (6) Call pagecache_isize_extended() if the file was enlarged. Note that truncate_set_size() isn't used because the setting of i_size is done inside afs_vnode_commit_status() under the vnode->cb_lock. Found with the generic/029 and generic/393 xfstests. Fixes: 31143d5d515e ("AFS: implement basic file write support") Fixes: 4343d00872e1 ("afs: Get rid of the afs_writeback record") Signed-off-by: David Howells commit da8d07551275abb3a38fae2d16e02bc9cc7396b2 Author: David Howells Date: Sat Jun 13 19:34:59 2020 +0100 afs: Concoct ctimes The in-kernel afs filesystem ignores ctime because the AFS fileserver protocol doesn't support ctimes. This, however, causes various xfstests to fail. Work around this by: (1) Setting ctime to attr->ia_ctime in afs_setattr(). (2) Not ignoring ATTR_MTIME_SET, ATTR_TIMES_SET and ATTR_TOUCH settings. (3) Setting the ctime from the server mtime when on the target file when creating a hard link to it. (4) Setting the ctime on directories from their revised mtimes when renaming/moving a file. Found by the generic/221 and generic/309 xfstests. Signed-off-by: David Howells commit 3f4aa981816368fe6b1d13c2bfbe76df9687e787 Author: David Howells Date: Sat Jun 13 00:03:48 2020 +0100 afs: Fix EOF corruption When doing a partial writeback, afs_write_back_from_locked_page() may generate an FS.StoreData RPC request that writes out part of a file when a file has been constructed from pieces by doing seek, write, seek, write, ... as is done by ld. The FS.StoreData RPC is given the current i_size as the file length, but the server basically ignores it unless the data length is 0 (in which case it's just a truncate operation). The revised file length returned in the result of the RPC may then not reflect what we suggested - and this leads to i_size getting moved backwards - which causes issues later. Fix the client to take account of this by ignoring the returned file size unless the data version number jumped unexpectedly - in which case we're going to have to clear the pagecache and reload anyway. This can be observed when doing a kernel build on an AFS mount. The following pair of commands produce the issue: ld -m elf_x86_64 -z max-page-size=0x200000 --emit-relocs \ -T arch/x86/realmode/rm/realmode.lds \ arch/x86/realmode/rm/header.o \ arch/x86/realmode/rm/trampoline_64.o \ arch/x86/realmode/rm/stack.o \ arch/x86/realmode/rm/reboot.o \ -o arch/x86/realmode/rm/realmode.elf arch/x86/tools/relocs --realmode \ arch/x86/realmode/rm/realmode.elf \ >arch/x86/realmode/rm/realmode.relocs This results in the latter giving: Cannot read ELF section headers 0/18: Success as the realmode.elf file got corrupted. The sequence of events can also be driven with: xfs_io -t -f \ -c "pwrite -S 0x58 0 0x58" \ -c "pwrite -S 0x59 10000 1000" \ -c "close" \ /afs/example.com/scratch/a Fixes: 31143d5d515e ("AFS: implement basic file write support") Signed-off-by: David Howells commit 1f32ef79897052ef7d3d154610d8d6af95abde83 Author: David Howells Date: Fri Jun 12 23:58:51 2020 +0100 afs: afs_write_end() should change i_size under the right lock Fix afs_write_end() to change i_size under vnode->cb_lock rather than ->wb_lock so that it doesn't race with afs_vnode_commit_status() and afs_getattr(). The ->wb_lock is only meant to guard access to ->wb_keys which isn't accessed by that piece of code. Fixes: 4343d00872e1 ("afs: Get rid of the afs_writeback record") Signed-off-by: David Howells commit bb413489288e4e457353bac513fddb6330d245ca Author: David Howells Date: Fri Jun 12 00:15:13 2020 +0100 afs: Fix non-setting of mtime when writing into mmap The mtime on an inode needs to be updated when a write is made into an mmap'ed section. There are three ways in which this could be done: update it when page_mkwrite is called, update it when a page is changed from dirty to writeback or leave it to the server and fix the mtime up from the reply to the StoreData RPC. Found with the generic/215 xfstest. Fixes: 1cf7a1518aef ("afs: Implement shared-writeable mmap") Signed-off-by: David Howells commit 6f1cf5257acc6e6242ddf2f52bc7912aed77b79f Author: Robin Gong Date: Mon Jun 15 05:54:08 2020 +0800 regualtor: pfuze100: correct sw1a/sw2 on pfuze3000 PFUZE100_SWB_REG is not proper for sw1a/sw2, because enable_mask/enable_reg is not correct. On PFUZE3000, sw1a/sw2 should be the same as sw1a/sw2 on pfuze100 except that voltages are not linear, so add new PFUZE3000_SW_REG and pfuze3000_sw_regulator_ops which like the non-linear PFUZE100_SW_REG and pfuze100_sw_regulator_ops. Fixes: 1dced996ee70 ("regulator: pfuze100: update voltage setting for pfuze3000 sw1a") Reported-by: Christophe Meynard Signed-off-by: Robin Gong Link: https://lore.kernel.org/r/1592171648-8752-1-git-send-email-yibin.gong@nxp.com Signed-off-by: Mark Brown commit 59960b9deb5354e4cdb0b6ed3a3b653a2b4eb602 Author: Pavel Begunkov Date: Mon Jun 15 16:36:30 2020 +0300 io_uring: fix lazy work init Don't leave garbage in req.work before punting async on -EAGAIN in io_iopoll_queue(). [ 140.922099] general protection fault, probably for non-canonical address 0xdead000000000100: 0000 [#1] PREEMPT SMP PTI ... [ 140.922105] RIP: 0010:io_worker_handle_work+0x1db/0x480 ... [ 140.922114] Call Trace: [ 140.922118] ? __next_timer_interrupt+0xe0/0xe0 [ 140.922119] io_wqe_worker+0x2a9/0x360 [ 140.922121] ? _raw_spin_unlock_irqrestore+0x24/0x40 [ 140.922124] kthread+0x12c/0x170 [ 140.922125] ? io_worker_handle_work+0x480/0x480 [ 140.922126] ? kthread_park+0x90/0x90 [ 140.922127] ret_from_fork+0x22/0x30 Fixes: 7cdaf587de7c ("io_uring: avoid whole io_wq_work copy for requests completed inline") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit a8a5e383cf41c3852621f8cdfb9141c77b004cdd Author: Baolin Wang Date: Mon Jun 15 17:12:23 2020 +0800 blk-mq: Remove redundant 'return' statement The blk_mq_all_tag_iter() is a void function, thus remove the redundant 'return' statement in this function. Signed-off-by: Baolin Wang Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 4036d05c38ca2f73c2ca182c3ebf0dfd066593a6 Merge: 40e2c465894e 6ae4902f2f34 Author: Mark Brown Date: Mon Jun 15 15:18:35 2020 +0100 Merge series "ASoC: topology: fix use-after-free when removing components" from Pierre-Louis Bossart : This patchset fixes a memory allocation issue and removes a 100% reproducible use-after-free report thrown by KASAN in automated module removal tests across multiple platforms. All the credit goes to Bard Liao for root-causing the issue. DAIs may be registered at the same time as a component, or when the topology is loaded. This two-step registration causes the memory for topology-based DAIs to allocated last, and conversely to be released first by devres, before the component is released and the DAIs removed from the component DAI list with snd_soc_unregister_dais(). When we remove a component, by the time we walk through its dai list to unregister all dais, the dais allocated by the topology have been freed already by devres and the list is corrupted with pointers that are no longer valid. The suggestion is to add an explicit devm_ based registration for topology-based dais, so that each dai is cleanly removed from the component dai list in the release operation before devres releases the allocated memory. Pierre-Louis Bossart (2): ASoC: soc-devres: add devm_snd_soc_register_dai() ASoC: soc-topology: use devm_snd_soc_register_dai() include/sound/soc.h | 4 ++++ sound/soc/soc-devres.c | 37 +++++++++++++++++++++++++++++++++++++ sound/soc/soc-topology.c | 3 +-- 3 files changed, 42 insertions(+), 2 deletions(-) -- 2.20.1 commit 40e2c465894e5b79b49f55d9574dbcda4ac0f08f Author: Brent Lu Date: Fri Jun 12 18:50:48 2020 +0800 ASoC: SOF: Intel: hda: Clear RIRB status before reading WP Port commit 6d011d5057ff ("ALSA: hda: Clear RIRB status before reading WP") from legacy HDA driver to fix the get response timeout issue. Current SOF driver does not suffer from this issue because sync write is enabled in hda_init. The issue will come back if the sync write is disabled for some reason. Signed-off-by: Brent Lu Reviewed-by: Takashi Iwai Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/1591959048-15813-1-git-send-email-brent.lu@intel.com Signed-off-by: Mark Brown commit e74a1e7eaed95f2c6422e7cf9ed70154f17a6db3 Author: Jack Yu Date: Mon Jun 15 11:24:32 2020 +0800 ASoC: rt1015: Update rt1015 default register value according to spec modification. Update rt1015 default register value according to spec modification. Signed-off-by: Jack Yu Link: https://lore.kernel.org/r/20200615032433.31061-1-jack.yu@realtek.com Signed-off-by: Mark Brown commit a2120089251f1fe221305e88df99af16f940e236 Author: Srinivas Kandagatla Date: Fri Jun 12 13:37:11 2020 +0100 ASoC: qcom: common: set correct directions for dailinks Currently both FE and BE dai-links are configured bi-directional, However the DSP BE dais are only single directional, so set the directions as supported by the BE dais. Fixes: c25e295cd77b (ASoC: qcom: Add support to parse common audio device nodes) Reported-by: John Stultz Signed-off-by: Srinivas Kandagatla Tested-by: John Stultz Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200612123711.29130-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 4a95737440d426e93441d49d11abf4c6526d4666 Author: Srinivas Kandagatla Date: Fri Jun 12 13:37:10 2020 +0100 ASoc: q6afe: add support to get port direction This patch adds support to q6afe_is_rx_port() to get direction of DSP BE dai port, this is useful for setting dailink directions correctly. Fixes: c25e295cd77b (ASoC: qcom: Add support to parse common audio device nodes) Reported-by: John Stultz Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200612123711.29130-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 96bf62f018f40cb5d4e4bed95e50fd990a2354af Author: Pierre-Louis Bossart Date: Fri Jun 12 15:35:07 2020 -0500 ASoC: soc-pcm: fix checks for multi-cpu FE dailinks soc_dpcm_fe_runtime_update() is called for all dailinks, and we want to first discard all back-ends, then deal with front-ends. The existing code first reports an error with multi-cpu front-ends, and that check needs to be moved after we know that we are dealing with a front-end. Fixes: 6e1276a5e613d ('ASoC: Return error if the function does not support multi-cpu') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao BugLink: https://github.com/thesofproject/linux/issues/1970 Link: https://lore.kernel.org/r/20200612203507.25621-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 19ab0f005b165146ea4a93f71e9cb5e71de9c0ce Author: derek.fang Date: Fri Jun 12 13:15:25 2020 +0800 ASoC: rt5682: Let dai clks be registered whether mclk exists or not According to ideal rt5682 CCF, the root clk is mclk. But in some platforms, mclk is not exported to CCF. In this condition, rt5682_register_dai_clks will not be called. This patch lets dai clks could be registered whether mclk exists or not. Signed-off-by: derek.fang Link: https://lore.kernel.org/r/1591938925-1070-5-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown commit 2ef5612391f0a7a631c42a8afc867095b49a1992 Author: Colin Ian King Date: Thu Jun 4 15:39:02 2020 +0100 RDMA/mlx5: Remove duplicated assignment to resp.response_length The assignment to resp.response_length is never read since it is being updated again on the next statement. The assignment is redundant so removed it. Fixes: a645a89d9a78 ("RDMA/mlx5: Return ECE DC support") Link: https://lore.kernel.org/r/20200604143902.56021-1-colin.king@canonical.com Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b95273f1272398a9f7145de37703f1930244e465 Author: Qian Cai Date: Wed Apr 15 11:37:09 2020 -0400 kvm/svm: disable KCSAN for svm_vcpu_run() For some reasons, running a simple qemu-kvm command with KCSAN will reset AMD hosts. It turns out svm_vcpu_run() could not be instrumented. Disable it for now. # /usr/libexec/qemu-kvm -name ubuntu-18.04-server-cloudimg -cpu host -smp 2 -m 2G -hda ubuntu-18.04-server-cloudimg.qcow2 === console output === Kernel 5.6.0-next-20200408+ on an x86_64 hp-dl385g10-05 login: <...host reset...> HPE ProLiant System BIOS A40 v1.20 (03/09/2018) (C) Copyright 1982-2018 Hewlett Packard Enterprise Development LP Early system initialization, please wait... Signed-off-by: Qian Cai Message-Id: <20200415153709.1559-1-cai@lca.pw> Signed-off-by: Paolo Bonzini commit 6ae4902f2f3400503f9b78e87e8371e4ffde1e0c Author: Pierre-Louis Bossart Date: Fri Jun 12 15:59:38 2020 -0500 ASoC: soc-topology: use devm_snd_soc_register_dai() Use devm_ to avoid use-after-free KASAN reports and simplify error handling. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen BugLink: https://github.com/thesofproject/linux/issues/2186 Link: https://lore.kernel.org/r/20200612205938.26415-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0fae253af563cf5d1f5dc651d520c3eafd74f183 Author: Pierre-Louis Bossart Date: Fri Jun 12 15:59:37 2020 -0500 ASoC: soc-devres: add devm_snd_soc_register_dai() The registration of DAIs may be done at two distinct times, once during a component registration and later when loading a topology. Since devm_ managed resources are freed in the reverse order they were allocated, when a component starts unregistering DAIs by walking through the DAI list, the memory allocated for the topology-registered DAIs was freed already, which leads to 100% reproducible KASAN use-after-free reports. This patch suggests a new devm_ function to force the DAI list to be updated prior to freeing the memory chunks referenced by the list pointers. Suggested-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen BugLink: https://github.com/thesofproject/linux/issues/2186 Link: https://lore.kernel.org/r/20200612205938.26415-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 2963795122f50b36ed16e3ba880c3ed2de1bda6e Author: Gustavo A. R. Silva Date: Wed May 27 12:14:25 2020 -0500 efi: Replace zero-length array and use struct_size() helper The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. Lastly, make use of the sizeof_field() helper instead of an open-coded version. This issue was found with the help of Coccinelle and audited _manually_. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20200527171425.GA4053@embeddedor Signed-off-by: Ard Biesheuvel commit 4353f03317fd3eb0bd803b61bdb287b68736a728 Author: Tony Luck Date: Thu May 28 12:49:05 2020 -0700 efivarfs: Don't return -EINTR when rate-limiting reads Applications that read EFI variables may see a return value of -EINTR if they exceed the rate limit and a signal delivery is attempted while the process is sleeping. This is quite surprising to the application, which probably doesn't have code to handle it. Change the interruptible sleep to a non-interruptible one. Reported-by: Lennart Poettering Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20200528194905.690-3-tony.luck@intel.com Signed-off-by: Ard Biesheuvel commit 2096721f1577b51b574fa06a7d91823dffe7267a Author: Tony Luck Date: Thu May 28 12:49:04 2020 -0700 efivarfs: Update inode modification time for successful writes Some applications want to be able to see when EFI variables have been updated. Update the modification time for successful writes. Reported-by: Lennart Poettering Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20200528194905.690-2-tony.luck@intel.com Signed-off-by: Ard Biesheuvel commit 4ddf4739be6e375116c375f0a68bf3893ffcee21 Author: Qiushi Wu Date: Thu May 28 13:38:04 2020 -0500 efi/esrt: Fix reference count leak in esre_create_sysfs_entry. kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous commit "b8eb718348b8" fixed a similar problem. Fixes: 0bb549052d33 ("efi: Add esrt support") Signed-off-by: Qiushi Wu Link: https://lore.kernel.org/r/20200528183804.4497-1-wu000273@umn.edu Signed-off-by: Ard Biesheuvel commit a6e2c226c3d51fd93636320e47cabc8a8f0824c5 Author: Aneesh Kumar K.V Date: Sun May 24 15:08:19 2020 +0530 powerpc: Fix kernel crash in show_instructions() w/DEBUG_VIRTUAL With CONFIG_DEBUG_VIRTUAL=y, we can hit a BUG() if we take a hard lockup watchdog interrupt when in OPAL mode. This happens in show_instructions() if the kernel takes the watchdog NMI IPI, or any other interrupt, with MSR_IR == 0. show_instructions() updates the variable pc in the loop and the second iteration will result in BUG(). We hit the BUG_ON due the below check in __va() #define __va(x) ({ VIRTUAL_BUG_ON((unsigned long)(x) >= PAGE_OFFSET); (void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET); }) Fix it by moving the check out of the loop. Also update nip so that the nip == pc check still matches. Fixes: 4dd7554a6456 ("powerpc/64: Add VIRTUAL_BUG_ON checks for __va and __pa addresses") Signed-off-by: Aneesh Kumar K.V [mpe: Use IS_ENABLED(), massage change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200524093822.423487-1-aneesh.kumar@linux.ibm.com commit 7dfc06a0f25b593a9f51992f540c0f80a57f3629 Author: Fabian Vogt Date: Mon Jun 15 09:16:36 2020 +0200 efi/tpm: Verify event log header before parsing It is possible that the first event in the event log is not actually a log header at all, but rather a normal event. This leads to the cast in __calc_tpm2_event_size being an invalid conversion, which means that the values read are effectively garbage. Depending on the first event's contents, this leads either to apparently normal behaviour, a crash or a freeze. While this behaviour of the firmware is not in accordance with the TCG Client EFI Specification, this happens on a Dell Precision 5510 with the TPM enabled but hidden from the OS ("TPM On" disabled, state otherwise untouched). The EFI firmware claims that the TPM is present and active and that it supports the TCG 2.0 event log format. Fortunately, this can be worked around by simply checking the header of the first event and the event log header signature itself. Commit b4f1874c6216 ("tpm: check event log version before reading final events") addressed a similar issue also found on Dell models. Fixes: 6b0326190205 ("efi: Attempt to get the TCG2 event log in the boot stub") Signed-off-by: Fabian Vogt Link: https://lore.kernel.org/r/1927248.evlx2EsYKh@linux-e202.suse.de Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1165773 Signed-off-by: Ard Biesheuvel commit 5d5103595e9e53048bb7e70ee2673c897ab38300 Author: Sean Christopherson Date: Mon Jun 8 10:41:34 2020 -0700 x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup Reinitialize IA32_FEAT_CTL on the BSP during wakeup to handle the case where firmware doesn't initialize or save/restore across S3. This fixes a bug where IA32_FEAT_CTL is left uninitialized and results in VMXON taking a #GP due to VMX not being fully enabled, i.e. breaks KVM. Use init_ia32_feat_ctl() to "restore" IA32_FEAT_CTL as it already deals with the case where the MSR is locked, and because APs already redo init_ia32_feat_ctl() during suspend by virtue of the SMP boot flow being used to reinitialize APs upon wakeup. Do the call in the early wakeup flow to avoid dependencies in the syscore_ops chain, e.g. simply adding a resume hook is not guaranteed to work, as KVM does VMXON in its own resume hook, kvm_resume(), when KVM has active guests. Fixes: 21bd3467a58e ("KVM: VMX: Drop initialization of IA32_FEAT_CTL MSR") Reported-by: Brad Campbell Signed-off-by: Sean Christopherson Signed-off-by: Borislav Petkov Reviewed-by: Liam Merwick Reviewed-by: Maxim Levitsky Tested-by: Brad Campbell Cc: stable@vger.kernel.org # v5.6 Link: https://lkml.kernel.org/r/20200608174134.11157-1-sean.j.christopherson@intel.com commit 9ba6a9efa4a4c721d0115089bf422f82b8a59e45 Author: Dave Martin Date: Wed Jun 10 18:03:09 2020 +0100 docs/arm64: Fix typo'd #define in sve.rst sve.rst describes a flag PR_SVE_SET_VL_INHERIT for the PR_SVE_SET_VL prctl, but there is no flag of this name. The flag is shared between the _GET and _SET calls, so the _SET prefix was dropped, giving the name PR_SVE_VL_INHERIT in the headers. Fix it. Signed-off-by: Dave Martin Link: https://lore.kernel.org/r/1591808590-20210-2-git-send-email-Dave.Martin@arm.com Signed-off-by: Will Deacon commit 751c263bb74fd36b5fc2589d36abc75042336444 Author: Ard Biesheuvel Date: Mon Jun 15 12:19:39 2020 +0200 arm64: remove TEXT_OFFSET randomization TEXT_OFFSET was recently changed to 0x0, in preparation for its removal at a later stage, and a warning is emitted into the kernel log when the bootloader appears to have failed to take the TEXT_OFFSET image header value into account. Ironically, this warning itself fails to take TEXT_OFFSET into account, and compares the kernel image's alignment modulo 2M against a hardcoded value of 0x0, and so the warning will trigger spuriously when TEXT_OFFSET randomization is enabled. Given the intent to get rid of TEXT_OFFSET entirely, let's fix this oversight by just removing support for TEXT_OFFSET randomization. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200615101939.634391-1-ardb@kernel.org Signed-off-by: Will Deacon commit 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438 Author: Peter Zijlstra Date: Thu Jun 4 11:17:40 2020 +0200 x86/entry, bug: Comment the instrumentation_begin() usage for WARN() Explain the rationale for annotating WARN(), even though, strictly speaking printk() and friends are very much not safe in many of the places we put them. Signed-off-by: Peter Zijlstra (Intel) commit 6b643a07a7e41f9e11cfbb9bba4c5c9791ac2997 Author: Peter Zijlstra Date: Wed Jun 3 20:09:06 2020 +0200 x86/entry, ubsan, objtool: Whitelist __ubsan_handle_*() The UBSAN instrumentation only inserts external CALLs when things go 'BAD', much like WARN(). So treat them similar to WARN()s for noinstr, that is: allow them, at the risk of taking the machine down, to get their message out. Suggested-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Acked-by: Marco Elver commit 14d3b376b6c3f66d62559d457d32edf565472163 Author: Peter Zijlstra Date: Wed Jun 3 13:32:48 2020 +0200 x86/entry, cpumask: Provide non-instrumented variant of cpu_is_offline() vmlinux.o: warning: objtool: exc_nmi()+0x12: call to cpumask_test_cpu.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: mce_check_crashing_cpu()+0x12: call to cpumask_test_cpu.constprop.0()leaves .noinstr.text section cpumask_test_cpu() test_bit() instrument_atomic_read() arch_test_bit() Signed-off-by: Peter Zijlstra (Intel) commit 5144f8a8dfd7b3681f0a2b5bf599a210b2315018 Author: Marco Elver Date: Thu Jun 4 07:58:11 2020 +0200 compiler_types.h: Add __no_sanitize_{address,undefined} to noinstr Adds the portable definitions for __no_sanitize_address, and __no_sanitize_undefined, and subsequently changes noinstr to use the attributes to disable instrumentation via KASAN or UBSAN. Reported-by: syzbot+dc1fa714cb070b184db5@syzkaller.appspotmail.com Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Acked-by: Miguel Ojeda Link: https://lore.kernel.org/lkml/000000000000d2474c05a6c938fe@google.com/ commit 7b861a53e46b6b42ab8560b105af308cb72d7285 Author: Marco Elver Date: Thu Jun 4 07:58:10 2020 +0200 kasan: Bump required compiler version Adds config variable CC_HAS_WORKING_NOSANITIZE_ADDRESS, which will be true if we have a compiler that does not fail builds due to no_sanitize_address functions. This does not yet mean they work as intended, but for automated build-tests, this is the minimum requirement. For example, we require that __always_inline functions used from no_sanitize_address functions do not generate instrumentation. On GCC <= 7 this fails to build entirely, therefore we make the minimum version GCC 8. Suggested-by: Peter Zijlstra Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Nick Desaulniers Acked-by: Andrey Konovalov Link: https://lkml.kernel.org/r/20200602175859.GC2604@hirez.programming.kicks-ass.net commit 5ddbc4082e1072eeeae52ff561a88620a05be08f Author: Peter Zijlstra Date: Tue Jun 2 18:47:11 2020 +0200 x86, kcsan: Add __no_kcsan to noinstr The 'noinstr' function attribute means no-instrumentation, this should very much include *SAN. Because lots of that is broken at present, only include KCSAN for now, as that is limited to clang11, which has sane function attribute behaviour. Signed-off-by: Peter Zijlstra (Intel) commit e79302ae8c8cceb51cf642d5ace9da02668cb7b4 Author: Peter Zijlstra Date: Tue Jun 2 17:04:03 2020 +0200 kcsan: Remove __no_kcsan_or_inline There are no more user of this function attribute, also, with us now actively supporting '__no_kcsan inline' it doesn't make sense to have in any case. Signed-off-by: Peter Zijlstra (Intel) commit e82587336695f14283987c9aa0bfd775b520856d Author: Peter Zijlstra Date: Tue Jun 2 14:24:47 2020 +0200 x86, kcsan: Remove __no_kcsan_or_inline usage Now that KCSAN relies on -tsan-distinguish-volatile we no longer need the annotation for constant_test_bit(). Remove it. Signed-off-by: Peter Zijlstra (Intel) commit 03e62fd67d3ab33f39573fc8787d89dc9b4d7255 Author: Martin Blumenstingl Date: Sun Jun 7 15:10:23 2020 +0200 MIPS: lantiq: xway: sysctrl: fix the GPHY clock alias names The dt-bindings for the GSWIP describe that the node should be named "switch". Use the same name in sysctrl.c so the GSWIP driver can actually find the "gphy0" and "gphy1" clocks. Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Cc: stable@vger.kernel.org Signed-off-by: Martin Blumenstingl Acked-by: Hauke Mehrtens Signed-off-by: Thomas Bogendoerfer commit 5435f73d5c4a1b7504356876e69ba52de83f4975 Author: Arvind Sankar Date: Fri Jun 5 11:06:38 2020 -0400 efi/x86: Fix build with gcc 4 Commit bbf8e8b0fe04 ("efi/libstub: Optimize for size instead of speed") changed the optimization level for the EFI stub to -Os from -O2. Andrey Ignatov reports that this breaks the build with gcc 4.8.5. Testing on godbolt.org, the combination of -Os, -fno-asynchronous-unwind-tables, and ms_abi functions doesn't work, failing with the error: sorry, unimplemented: ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it This does appear to work with gcc 4.9 onwards. Add -maccumulate-outgoing-args explicitly to unbreak the build with pre-4.9 versions of gcc. Reported-by: Andrey Ignatov Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200605150638.1011637-1-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 70cac501b576710b426f3e9f67fcd0a0558df72c Author: Arnd Bergmann Date: Wed May 27 16:05:09 2020 +0200 drm/i915: work around false-positive maybe-uninitialized warning gcc-9 gets confused by the code flow in check_dirty_whitelist: drivers/gpu/drm/i915/gt/selftest_workarounds.c: In function 'check_dirty_whitelist': drivers/gpu/drm/i915/gt/selftest_workarounds.c:492:17: error: 'rsvd' may be used uninitialized in this function [-Werror=maybe-uninitialized] I could not figure out a good way to do this in a way that gcc understands better, so initialize the variable to zero, as last resort. Fixes: aee20aaed887 ("drm/i915: Implement read-only support in whitelist selftest") Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200527140526.1458215-2-arnd@arndb.de (cherry picked from commit cc649a9eafc1ef5c40db023084cb94422d08aa84) Signed-off-by: Joonas Lahtinen commit 54a9adc4608144c7a17530822246f3cfa9b15d76 Author: Arnd Bergmann Date: Wed May 27 16:05:08 2020 +0200 drm/i915/pmu: avoid an maybe-uninitialized warning Conditional spinlocks make it hard for gcc and for lockdep to follow the code flow. This one causes a warning with at least gcc-9 and higher: In file included from include/linux/irq.h:14, from drivers/gpu/drm/i915/i915_pmu.c:7: drivers/gpu/drm/i915/i915_pmu.c: In function 'i915_sample': include/linux/spinlock.h:289:3: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized] 289 | _raw_spin_unlock_irqrestore(lock, flags); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/i915_pmu.c:288:17: note: 'flags' was declared here 288 | unsigned long flags; | ^~~~~ Split out the part between the locks into a separate function for readability and to let the compiler figure out what the logic actually is. Fixes: d79e1bd676f0 ("drm/i915/pmu: Only use exclusive mmio access for gen7") Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200527140526.1458215-1-arnd@arndb.de (cherry picked from commit 6ec81b82732e2b4a5ac0853fd33919ff1ca94238) Signed-off-by: Joonas Lahtinen commit 8497376707be6d2ab30f6d6662f42ab0c15d2ba1 Author: Chris Wilson Date: Tue May 19 14:20:46 2020 +0100 drm/i915/gt: Incorporate the virtual engine into timeslicing It was quite the oversight to only factor in the normal queue to decide the timeslicing switch priority. By leaving out the next virtual request from the priority decision, we would not timeslice the current engine if there was an available virtual request. Testcase: igt/gem_exec_balancer/sliced Fixes: 3df2deed411e ("drm/i915/execlists: Enable timeslice on partial virtual engine dequeue") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200519132046.22443-3-chris@chris-wilson.co.uk (cherry picked from commit 6ad249ba59badc7ff157d4db1f835748f0e2c9b6) Signed-off-by: Joonas Lahtinen commit 0ae705f3d2b22d9d762f67fd49aa6c290987c6a3 Author: Huacai Chen Date: Mon Jun 15 14:56:55 2020 +0800 KVM: MIPS: Fix a build error for !CPU_LOONGSON64 During the KVM merging progress, a CONFIG_CPU_LOONGSON64 guard in commit 7f2a83f1c2a941ebfee53 ("KVM: MIPS: Add CPUCFG emulation for Loongson-3") is missing by accident. So add it to avoid building error. Fixes: 7f2a83f1c2a941ebfee53 ("KVM: MIPS: Add CPUCFG emulation for Loongson-3") Reported-by: kernel test robot Signed-off-by: Huacai Chen Message-Id: <1592204215-28704-1-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 8e742aa79780b13cd300a42198c1a4cea9c89905 Author: Jiri Slaby Date: Wed Jun 10 13:48:51 2020 +0200 syscalls: Fix offset type of ksys_ftruncate() After the commit below, truncate() on x86 32bit uses ksys_ftruncate(). But ksys_ftruncate() truncates the offset to unsigned long. Switch the type of offset to loff_t which is what do_sys_ftruncate() expects. Fixes: 121b32a58a3a (x86/entry/32: Use IA32-specific wrappers for syscalls taking 64-bit arguments) Signed-off-by: Jiri Slaby Signed-off-by: Thomas Gleixner Reviewed-by: Brian Gerst Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200610114851.28549-1-jslaby@suse.cz commit 11425c4519e2c974a100fc984867046d905b9380 Author: Xiyu Yang Date: Sat Jun 13 20:30:25 2020 +0800 drm/ttm: Fix dma_fence refcnt leak when adding move fence ttm_bo_add_move_fence() invokes dma_fence_get(), which returns a reference of the specified dma_fence object to "fence" with increased refcnt. When ttm_bo_add_move_fence() returns, local variable "fence" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of ttm_bo_add_move_fence(). When no_wait_gpu flag is equals to true, the function forgets to decrease the refcnt increased by dma_fence_get(), causing a refcnt leak. Fix this issue by calling dma_fence_put() when no_wait_gpu flag is equals to true. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/370221/ Signed-off-by: Christian König commit 37cc4b95d13f311c04aa8e9daacca3905ad45ca7 Author: Xiyu Yang Date: Sat Jun 13 20:28:38 2020 +0800 drm/ttm: Fix dma_fence refcnt leak in ttm_bo_vm_fault_reserved ttm_bo_vm_fault_reserved() invokes dma_fence_get(), which returns a reference of the specified dma_fence object to "moving" with increased refcnt. When ttm_bo_vm_fault_reserved() returns, local variable "moving" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in several exception handling paths of ttm_bo_vm_fault_reserved(). When those error scenarios occur such as "err" equals to -EBUSY, the function forgets to decrease the refcnt increased by dma_fence_get(), causing a refcnt leak. Fix this issue by calling dma_fence_put() when no_wait_gpu flag is equals to true. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/370219/ Signed-off-by: Christian König commit 819966c06b759022e9932f328284314d9272b9f3 Author: Stephan Müller Date: Sun Jun 7 15:20:26 2020 +0200 crypto: drbg - always try to free Jitter RNG instance The Jitter RNG is unconditionally allocated as a seed source follwoing the patch 97f2650e5040. Thus, the instance must always be deallocated. Reported-by: syzbot+2e635807decef724a1fa@syzkaller.appspotmail.com Fixes: 97f2650e5040 ("crypto: drbg - always seeded with SP800-90B ...") Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 1f5b07f5dd1748a6f9363fb1a76d599c74af8231 Author: Dan Carpenter Date: Fri Jun 5 14:03:39 2020 +0300 crypto: marvell/octeontx - Fix a potential NULL dereference Smatch reports that: drivers/crypto/marvell/octeontx/otx_cptvf_algs.c:132 otx_cpt_aead_callback() warn: variable dereferenced before check 'cpt_info' (see line 121) This function is called from process_pending_queue() as: drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c 599 /* 600 * Call callback after current pending entry has been 601 * processed, we don't do it if the callback pointer is 602 * invalid. 603 */ 604 if (callback) 605 callback(res_code, areq, cpt_info); It does appear to me that "cpt_info" can be NULL so this could lead to a NULL dereference. Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit 77251e41f89a813b4090f5199442f217bbf11297 Author: Eric Biggers Date: Thu Jun 4 11:52:53 2020 -0700 crypto: algboss - don't wait during notifier callback When a crypto template needs to be instantiated, CRYPTO_MSG_ALG_REQUEST is sent to crypto_chain. cryptomgr_schedule_probe() handles this by starting a thread to instantiate the template, then waiting for this thread to complete via crypto_larval::completion. This can deadlock because instantiating the template may require loading modules, and this (apparently depending on userspace) may need to wait for the crc-t10dif module (lib/crc-t10dif.c) to be loaded. But crc-t10dif's module_init function uses crypto_register_notifier() and therefore takes crypto_chain.rwsem for write. That can't proceed until the notifier callback has finished, as it holds this semaphore for read. Fix this by removing the wait on crypto_larval::completion from within cryptomgr_schedule_probe(). It's actually unnecessary because crypto_alg_mod_lookup() calls crypto_larval_wait() itself after sending CRYPTO_MSG_ALG_REQUEST. This only actually became a problem in v4.20 due to commit b76377543b73 ("crc-t10dif: Pick better transform if one becomes available"), but the unnecessary wait was much older. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207159 Reported-by: Mike Gerow Fixes: 398710379f51 ("crypto: algapi - Move larval completion into algboss") Cc: # v3.6+ Cc: Martin K. Petersen Signed-off-by: Eric Biggers Reported-by: Kai Lüke Signed-off-by: Herbert Xu commit 24c7bf089453f6a1eed4c77ed0604bf4bb8cfb03 Author: Heinrich Schuchardt Date: Thu Jun 4 12:39:47 2020 +0200 crypto: caam - fix typos Fix CAAM related typos. Signed-off-by: Heinrich Schuchardt Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu commit 376bd28d03c97b4d53f5797d5f9b3522c8bd4d3d Author: Herbert Xu Date: Thu Jun 4 18:09:41 2020 +1000 crypto: ccp - Fix sparse warnings in sev-dev This patch fixes a bunch of sparse warnings in sev-dev where the __user marking is incorrectly handled. Reported-by: kbuild test robot Fixes: 7360e4b14350 ("crypto: ccp: Implement SEV_PEK_CERT_IMPORT...") Fixes: e799035609e1 ("crypto: ccp: Implement SEV_PEK_CSR ioctl...") Fixes: 76a2b524a4b1 ("crypto: ccp: Implement SEV_PDH_CERT_EXPORT...") Fixes: d6112ea0cb34 ("crypto: ccp - introduce SEV_GET_ID2 command") Signed-off-by: Herbert Xu Reviewed-by: Brijesh Singh Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit c61e5644c69775ae9d54b86018fca238aca64a9b Author: Herbert Xu Date: Thu Jun 4 17:37:50 2020 +1000 crypto: hisilicon - Cap block size at 2^31 The function hisi_acc_create_sg_pool may allocate a block of memory of size PAGE_SIZE * 2^(MAX_ORDER - 1). This value may exceed 2^31 on ia64, which would overflow the u32. This patch caps it at 2^31. Reported-by: kernel test robot Fixes: d8ac7b85236b ("crypto: hisilicon - fix large sgl memory...") Signed-off-by: Herbert Xu commit 7cf81954705b7e5b057f7dc39a7ded54422ab6e1 Author: Herbert Xu Date: Fri May 29 14:54:43 2020 +1000 crypto: algif_skcipher - Cap recv SG list at ctx->used Somewhere along the line the cap on the SG list length for receive was lost. This patch restores it and removes the subsequent test which is now redundant. Fixes: 2d97591ef43d ("crypto: af_alg - consolidation of...") Cc: Signed-off-by: Herbert Xu Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit 95459261c99f1621d90bc628c2a48e60b7cf9a88 Author: Dinghao Liu Date: Thu May 28 15:21:04 2020 +0800 hwrng: ks-sa - Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Reviewed-by: Alexander Sverdlin Signed-off-by: Herbert Xu commit 2c18bd525c47f882f033b0a813ecd09c93e1ecdf Author: Babu Moger Date: Thu Jun 4 14:45:16 2020 -0500 x86/resctrl: Fix memory bandwidth counter width for AMD Memory bandwidth is calculated reading the monitoring counter at two intervals and calculating the delta. It is the software’s responsibility to read the count often enough to avoid having the count roll over _twice_ between reads. The current code hardcodes the bandwidth monitoring counter's width to 24 bits for AMD. This is due to default base counter width which is 24. Currently, AMD does not implement the CPUID 0xF.[ECX=1]:EAX to adjust the counter width. But, the AMD hardware supports much wider bandwidth counter with the default width of 44 bits. Kernel reads these monitoring counters every 1 second and adjusts the counter value for overflow. With 24 bits and scale value of 64 for AMD, it can only measure up to 1GB/s without overflowing. For the rates above 1GB/s this will fail to measure the bandwidth. Fix the issue setting the default width to 44 bits by adjusting the offset. AMD future products will implement CPUID 0xF.[ECX=1]:EAX. [ bp: Let the line stick out and drop {}-brackets around a single statement. ] Fixes: 4d05bf71f157 ("x86/resctrl: Introduce AMD QOS feature") Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/159129975546.62538.5656031125604254041.stgit@naples-babu.amd.com commit 8abf41dcd1bcdda0d09905fb59d18f45c035c752 Author: Christopher Swenson Date: Sun Jun 14 17:11:47 2020 -0700 ALSA: usb-audio: Set 48 kHz rate for Rodecaster Like the Line6 devices, the Rode Rodecaster Pro does not support UAC2_CS_RANGE and only supports a sample rate of 48 kHz. Tested against a Rode Rodecaster Pro. Tested-by: Christopher Swenson Signed-off-by: Christopher Swenson Cc: Link: https://lore.kernel.org/r/ebdb9e72-9649-0b5e-b9b9-d757dbf26927@swenson.io Signed-off-by: Takashi Iwai commit c9808bbfed3cfc911ecb60fe8e80c0c27876c657 Author: Yick W. Tse Date: Sat Jun 13 11:40:06 2020 +0000 ALSA: usb-audio: add quirk for Denon DCD-1500RE fix error "clock source 41 is not valid, cannot use" [] New USB device found, idVendor=154e, idProduct=1002, bcdDevice= 1.00 [] New USB device strings: Mfr=1, Product=2, SerialNumber=0 [] Product: DCD-1500RE [] Manufacturer: D & M Holdings Inc. [] [] clock source 41 is not valid, cannot use [] usbcore: registered new interface driver snd-usb-audio Signed-off-by: Yick W. Tse Cc: Link: https://lore.kernel.org/r/1373857985.210365.1592048406997@mail.yahoo.com Signed-off-by: Takashi Iwai commit dbed452a078d56bc7f1abecc3edd6a75e8e4484e Author: David Rientjes Date: Thu Jun 11 00:25:57 2020 -0700 dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL DMA_REMAP is an unnecessary requirement for AMD SEV, which requires DMA_COHERENT_POOL, so avoid selecting it when it is otherwise unnecessary. The only other requirement for DMA coherent pools is DMA_DIRECT_REMAP, so ensure that properly selects the config option when needed. Fixes: 82fef0ad811f ("x86/mm: unencrypted non-blocking DMA allocations use coherent pools") Reported-by: Alex Xu (Hello71) Signed-off-by: David Rientjes Tested-by: Alex Xu (Hello71) Signed-off-by: Christoph Hellwig commit be01369859b8aa07346e497381bb46d377da0d8c Author: Eric Biggers Date: Wed Jun 10 09:14:37 2020 -0700 esp, ah: modernize the crypto algorithm selections The crypto algorithms selected by the ESP and AH kconfig options are out-of-date with the guidance of RFC 8221, which lists the legacy algorithms MD5 and DES as "MUST NOT" be implemented, and some more modern algorithms like AES-GCM and HMAC-SHA256 as "MUST" be implemented. But the options select the legacy algorithms, not the modern ones. Therefore, modify these options to select the MUST algorithms -- and *only* the MUST algorithms. Also improve the help text. Note that other algorithms may still be explicitly enabled in the kconfig, and the choice of which to actually use is still controlled by userspace. This change only modifies the list of algorithms for which kernel support is guaranteed to be present. Suggested-by: Herbert Xu Suggested-by: Steffen Klassert Acked-by: Herbert Xu Cc: Corentin Labbe Cc: Greg Kroah-Hartman Signed-off-by: Eric Biggers Signed-off-by: Steffen Klassert commit 37ea0f18fb19e0646c166037043232915cd9e995 Author: Eric Biggers Date: Wed Jun 10 09:14:36 2020 -0700 esp: select CRYPTO_SEQIV Commit f23efcbcc523 ("crypto: ctr - no longer needs CRYPTO_SEQIV") made CRYPTO_CTR stop selecting CRYPTO_SEQIV. This breaks IPsec for most users since GCM and several other encryption algorithms require "seqiv" -- and RFC 8221 lists AES-GCM as "MUST" be implemented. Just make XFRM_ESP select CRYPTO_SEQIV. Fixes: f23efcbcc523 ("crypto: ctr - no longer needs CRYPTO_SEQIV") Acked-by: Herbert Xu Cc: Corentin Labbe Cc: Greg Kroah-Hartman Cc: Steffen Klassert Signed-off-by: Eric Biggers Signed-off-by: Steffen Klassert commit 7d4e3919592593594296944ae7da1a207706e8c5 Author: Eric Biggers Date: Wed Jun 10 09:14:35 2020 -0700 esp, ah: consolidate the crypto algorithm selections Instead of duplicating the algorithm selections between INET_AH and INET6_AH and between INET_ESP and INET6_ESP, create new tristates XFRM_AH and XFRM_ESP that do the algorithm selections, and make these be selected by the corresponding INET* options. Suggested-by: Herbert Xu Acked-by: Herbert Xu Cc: Corentin Labbe Cc: Greg Kroah-Hartman Cc: Steffen Klassert Signed-off-by: Eric Biggers Signed-off-by: Steffen Klassert commit 7b16994437c7359832dd51d66c5c387995a91438 Author: Arvind Sankar Date: Thu Jun 11 18:03:39 2020 -0400 Makefile: Improve compressed debug info support detection Commit 10e68b02c861 ("Makefile: support compressed debug info") added support for compressed debug sections. Support is detected by checking - does the compiler support -gz=zlib - does the assembler support --compressed-debug-sections=zlib - does the linker support --compressed-debug-sections=zlib However, the gcc driver's support for this option is somewhat convoluted. The driver's builtin specs are set based on the version of binutils that it was configured with. It reports an error if the configure-time linker/assembler (i.e., not necessarily the actual assembler that will be run) do not support the option, but only if the assembler (or linker) is actually invoked when -gz=zlib is passed. The cc-option check in scripts/Kconfig.include does not invoke the assembler, so the gcc driver reports success even if it does not support the option being passed to the assembler. Because the as-option check passes the option directly to the assembler via -Wa,--compressed-debug-sections=zlib, the gcc driver does not see this option and will never report an error. Combined with an installed version of binutils that is more recent than the one the compiler was built with, it is possible for all three tests to succeed, yet an actual compilation with -gz=zlib to fail. Moreover, it is unnecessary to explicitly pass --compressed-debug-sections=zlib to the assembler via -Wa, since the driver will do that automatically when it supports -gz=zlib. Convert the as-option to just -gz=zlib, simplifying it as well as performing a better test of the gcc driver's capabilities. Reported-by: kernel test robot Signed-off-by: Arvind Sankar Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 4b25bbf52a55b58f03473333eafe61c0d46125aa Author: Coly Li Date: Mon Jun 15 00:53:33 2020 +0800 bcache: pr_info() format clean up in bcache_device_init() scripts/checkpatch.pl reports following warning for patch ("bcache: check and adjust logical block size for backing devices"), WARNING: quoted string split across lines #146: FILE: drivers/md/bcache/super.c:896: + pr_info("%s: sb/logical block size (%u) greater than page size " + "(%lu) falling back to device logical block size (%u)", There are two things to fix up, - The kernel message print should be in a single line. - pr_info() won't automatically add new line since v5.8, a '\n' should be added. This patch just does the above cleanup in bcache_device_init(). Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit ee4a36f414617aaae01f93133e828363e7e9dd17 Author: Coly Li Date: Mon Jun 15 00:53:32 2020 +0800 bcache: use delayed kworker fo asynchronous devices registration This patch changes the asynchronous registration kworker to a delayed kworker. There is probability queue_work() queues the async registration kworker to the same CPU (even though very little), then the process which writing sysfs interface to reigster bcache device may won't return immeidately. queue_delayed_work() in this patch will delay 10 jiffies before insert the kworker to run queue, which makes sure the registering process may always returns to user space in time. Fixes: 9e23ccf8f0a22 ("bcache: asynchronous devices registration") Signed-off-by: Coly Li Cc: Hannes Reinecke Signed-off-by: Jens Axboe commit dcacbc1242c71e18fa9d2eadc5647e115c9c627d Author: Mauricio Faria de Oliveira Date: Mon Jun 15 00:53:31 2020 +0800 bcache: check and adjust logical block size for backing devices It's possible for a block driver to set logical block size to a value greater than page size incorrectly; e.g. bcache takes the value from the superblock, set by the user w/ make-bcache. This causes a BUG/NULL pointer dereference in the path: __blkdev_get() -> set_init_blocksize() // set i_blkbits based on ... -> bdev_logical_block_size() -> queue_logical_block_size() // ... this value -> bdev_disk_changed() ... -> blkdev_readpage() -> block_read_full_page() -> create_page_buffers() // size = 1 << i_blkbits -> create_empty_buffers() // give size/take pointer -> alloc_page_buffers() // return NULL .. BUG! Because alloc_page_buffers() is called with size > PAGE_SIZE, thus it initializes head = NULL, skips the loop, return head; then create_empty_buffers() gets (and uses) the NULL pointer. This has been around longer than commit ad6bf88a6c19 ("block: fix an integer overflow in logical block size"); however, it increased the range of values that can trigger the issue. Previously only 8k/16k/32k (on x86/4k page size) would do it, as greater values overflow unsigned short to zero, and queue_ logical_block_size() would then use the default of 512. Now the range with unsigned int is much larger, and users w/ the 512k value, which happened to be zero'ed previously and work fine, started to hit this issue -- as the zero is gone, and queue_logical_block_size() does return 512k (>PAGE_SIZE.) Fix this by checking the bcache device's logical block size, and if it's greater than page size, fallback to the backing/ cached device's logical page size. This doesn't affect cache devices as those are still checked for block/page size in read_super(); only the backing/cached devices are not. Apparently it's a regression from commit 2903381fce71 ("bcache: Take data offset from the bdev superblock."), moving the check into BCACHE_SB_VERSION_CDEV only. Now that we have superblocks of backing devices out there with this larger value, we cannot refuse to load them (i.e., have a similar check in _BDEV.) Ideally perhaps bcache should use all values from the backing device (physical/logical/io_min block size)? But for now just fix the problematic case. Test-case: # IMG=/root/disk.img # dd if=/dev/zero of=$IMG bs=1 count=0 seek=1G # DEV=$(losetup --find --show $IMG) # make-bcache --bdev $DEV --block 8k < see dmesg > Before: # uname -r 5.7.0-rc7 [ 55.944046] BUG: kernel NULL pointer dereference, address: 0000000000000000 ... [ 55.949742] CPU: 3 PID: 610 Comm: bcache-register Not tainted 5.7.0-rc7 #4 ... [ 55.952281] RIP: 0010:create_empty_buffers+0x1a/0x100 ... [ 55.966434] Call Trace: [ 55.967021] create_page_buffers+0x48/0x50 [ 55.967834] block_read_full_page+0x49/0x380 [ 55.972181] do_read_cache_page+0x494/0x610 [ 55.974780] read_part_sector+0x2d/0xaa [ 55.975558] read_lba+0x10e/0x1e0 [ 55.977904] efi_partition+0x120/0x5a6 [ 55.980227] blk_add_partitions+0x161/0x390 [ 55.982177] bdev_disk_changed+0x61/0xd0 [ 55.982961] __blkdev_get+0x350/0x490 [ 55.983715] __device_add_disk+0x318/0x480 [ 55.984539] bch_cached_dev_run+0xc5/0x270 [ 55.986010] register_bcache.cold+0x122/0x179 [ 55.987628] kernfs_fop_write+0xbc/0x1a0 [ 55.988416] vfs_write+0xb1/0x1a0 [ 55.989134] ksys_write+0x5a/0xd0 [ 55.989825] do_syscall_64+0x43/0x140 [ 55.990563] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 55.991519] RIP: 0033:0x7f7d60ba3154 ... After: # uname -r 5.7.0.bcachelbspgsz [ 31.672460] bcache: bcache_device_init() bcache0: sb/logical block size (8192) greater than page size (4096) falling back to device logical block size (512) [ 31.675133] bcache: register_bdev() registered backing device loop0 # grep ^ /sys/block/bcache0/queue/*_block_size /sys/block/bcache0/queue/logical_block_size:512 /sys/block/bcache0/queue/physical_block_size:8192 Reported-by: Ryan Finnie Reported-by: Sebastian Marsching Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit be23e837333a914df3f24bf0b32e87b0331ab8d1 Author: Zhiqiang Liu Date: Mon Jun 15 00:53:30 2020 +0800 bcache: fix potential deadlock problem in btree_gc_coalesce coccicheck reports: drivers/md//bcache/btree.c:1538:1-7: preceding lock on line 1417 In btree_gc_coalesce func, if the coalescing process fails, we will goto to out_nocoalesce tag directly without releasing new_nodes[i]->write_lock. Then, it will cause a deadlock when trying to acquire new_nodes[i]-> write_lock for freeing new_nodes[i] before return. btree_gc_coalesce func details as follows: if alloc new_nodes[i] fails: goto out_nocoalesce; // obtain new_nodes[i]->write_lock mutex_lock(&new_nodes[i]->write_lock) // main coalescing process for (i = nodes - 1; i > 0; --i) [snipped] if coalescing process fails: // Here, directly goto out_nocoalesce // tag will cause a deadlock goto out_nocoalesce; [snipped] // release new_nodes[i]->write_lock mutex_unlock(&new_nodes[i]->write_lock) // coalesing succ, return return; out_nocoalesce: btree_node_free(new_nodes[i]) // free new_nodes[i] // obtain new_nodes[i]->write_lock mutex_lock(&new_nodes[i]->write_lock); // set flag for reuse clear_bit(BTREE_NODE_dirty, &ew_nodes[i]->flags); // release new_nodes[i]->write_lock mutex_unlock(&new_nodes[i]->write_lock); To fix the problem, we add a new tag 'out_unlock_nocoalesce' for releasing new_nodes[i]->write_lock before out_nocoalesce tag. If coalescing process fails, we will go to out_unlock_nocoalesce tag for releasing new_nodes[i]->write_lock before free new_nodes[i] in out_nocoalesce tag. (Coly Li helps to clean up commit log format.) Fixes: 2a285686c109816 ("bcache: btree locking rework") Signed-off-by: Zhiqiang Liu Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 0386e9ce5877ee73e07675529d5ae594d00f0900 Author: Matthew Hagan Date: Tue Jun 9 17:58:31 2020 +0100 ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP The NSP SoC includes an SP804 timer so should be enabled here. Fixes: a0efb0d28b77 ("ARM: dts: NSP: Add SP804 Support to DT") Signed-off-by: Matthew Hagan Signed-off-by: Florian Fainelli commit de1f6d9304c38e414552c3565d36286609ced0c1 Author: Rafał Miłecki Date: Mon Jun 8 18:33:41 2020 +0200 ARM: dts: BCM5301X: Add missing memory "device_type" for Luxul XWC-2000 This property is needed since commit abe60a3a7afb ("ARM: dts: Kill off skeleton{64}.dtsi"). Without it booting silently hangs at: [ 0.000000] Memory policy: Data cache writealloc Fixes: 984829e2d39b ("ARM: dts: BCM5301X: Add DT for Luxul XWC-2000") Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407 Author: Linus Torvalds Date: Sun Jun 14 12:45:04 2020 -0700 Linux 5.8-rc1 commit 4a87b197c1da6b16608d5110709e0b3308e25dcd Merge: 9d645db853a4 39030e1351aa Author: Linus Torvalds Date: Sun Jun 14 11:39:31 2020 -0700 Merge tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux Pull SafeSetID update from Micah Morton: "Add additional LSM hooks for SafeSetID SafeSetID is capable of making allow/deny decisions for set*uid calls on a system, and we want to add similar functionality for set*gid calls. The work to do that is not yet complete, so probably won't make it in for v5.8, but we are looking to get this simple patch in for v5.8 since we have it ready. We are planning on the rest of the work for extending the SafeSetID LSM being merged during the v5.9 merge window" * tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux: security: Add LSM hooks to set*gid syscalls commit 39030e1351aa1aa7443bb2da24426573077c83da Author: Thomas Cedeno Date: Tue Jun 9 10:22:13 2020 -0700 security: Add LSM hooks to set*gid syscalls The SafeSetID LSM uses the security_task_fix_setuid hook to filter set*uid() syscalls according to its configured security policy. In preparation for adding analagous support in the LSM for set*gid() syscalls, we add the requisite hook here. Tested by putting print statements in the security_task_fix_setgid hook and seeing them get hit during kernel boot. Signed-off-by: Thomas Cedeno Signed-off-by: Micah Morton commit 9d645db853a4cd1b7077931491d0055602d3d420 Merge: 96144c58abe7 55e20bd12a56 Author: Linus Torvalds Date: Sun Jun 14 09:47:25 2020 -0700 Merge tag 'for-5.8-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "This reverts the direct io port to iomap infrastructure of btrfs merged in the first pull request. We found problems in invalidate page that don't seem to be fixable as regressions or without changing iomap code that would not affect other filesystems. There are four reverts in total, but three of them are followup cleanups needed to revert a43a67a2d715 cleanly. The result is the buffer head based implementation of direct io. Reverts are not great, but under current circumstances I don't see better options" * tag 'for-5.8-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: Revert "btrfs: switch to iomap_dio_rw() for dio" Revert "fs: remove dio_end_io()" Revert "btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK" Revert "btrfs: split btrfs_direct_IO to read and write part" commit d88de040e1df38414fc1e4380be9d0e997ab4d58 Author: Navid Emamdoost Date: Thu Jun 4 21:44:44 2020 -0500 iio: pressure: zpa2326: handle pm_runtime_get_sync failure Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support") Cc: Signed-off-by: Jonathan Cameron commit d5ed76adb926a90fada98f518abc1ab6ef07d28f Author: Syed Nayyar Waris Date: Mon Mar 16 18:20:46 2020 +0530 counter: 104-quad-8: Add lock guards - filter clock prescaler Add lock protection from race conditions to the 104-quad-8 counter driver for filter clock prescaler code changes. Mutex calls used for protection. Signed-off-by: Syed Nayyar Waris Fixes: de65d0556343 ("counter: 104-quad-8: Support Filter Clock Prescaler") Signed-off-by: Jonathan Cameron commit 708d98932893cea609386cefdfd190f757f5a61c Author: Syed Nayyar Waris Date: Mon Mar 16 18:20:06 2020 +0530 counter: 104-quad-8: Add lock guards - differential encoder Add lock protection from race conditions to 104-quad-8 counter driver for differential encoder status code changes. Mutex lock calls used for protection. Signed-off-by: Syed Nayyar Waris Fixes: 954ab5cc5f3e ("counter: 104-quad-8: Support Differential Encoder Cable Status") Signed-off-by: Jonathan Cameron commit 25f02d3242ab4d16d0cee2dec0d89cedb3747fa9 Author: Matt Ranostay Date: Tue Jun 9 06:01:16 2020 +0300 iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers Add missing strings to iio_modifier_names[] for proper modification of channels. Fixes: b170f7d48443d (iio: Add modifiers for ethanol and H2 gases) Signed-off-by: Matt Ranostay Cc: Signed-off-by: Jonathan Cameron commit 0187294d227dfc42889e1da8f8ce1e44fc25f147 Author: Dinghao Liu Date: Tue May 26 18:47:17 2020 +0800 iio: magnetometer: ak8974: Fix runtime PM imbalance on error When devm_regmap_init_i2c() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. For error paths after ak8974_set_power(), ak8974_detect() and ak8974_reset(), things are the same. However, When iio_triggered_buffer_setup() returns an error code, there will be two PM usgae counter decrements. Signed-off-by: Dinghao Liu Fixes: 7c94a8b2ee8c ("iio: magn: add a driver for AK8974") Reviewed-by: Linus Walleij Cc: Signed-off-by: Jonathan Cameron commit d7369ae1f4d7cffa7574d15e1f787dcca184c49d Author: Chuhong Yuan Date: Thu May 28 14:41:21 2020 +0800 iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe() The function iio_device_register() was called in mma8452_probe(). But the function iio_device_unregister() was not called after a call of the function mma8452_set_freefall_mode() failed. Thus add the missed function call for one error case. Fixes: 1a965d405fc6 ("drivers:iio:accel:mma8452: added cleanup provision in case of failure.") Signed-off-by: Chuhong Yuan Cc: Signed-off-by: Jonathan Cameron commit f88ecccac4be348bbcc6d056bdbc622a8955c04d Author: Jonathan Cameron Date: Sun May 17 18:29:57 2020 +0100 iio:health:afe4404 Fix timestamp alignment and prevent data leak. One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 40 byte array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment explicitly requested. This data is allocated with kzalloc so no data can leak appart from previous readings. Fixes: 87aec56e27ef ("iio: health: Add driver for the TI AFE4404 heart monitor") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Acked-by: Andrew F. Davis Signed-off-by: Jonathan Cameron commit 3f9c6d38797e9903937b007a341dad0c251765d6 Author: Jonathan Cameron Date: Sun May 17 18:29:56 2020 +0100 iio:health:afe4403 Fix timestamp alignment and prevent data leak. One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 32 byte array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment explicitly requested. This data is allocated with kzalloc so no data can leak appart from previous readings. Fixes: eec96d1e2d31 ("iio: health: Add driver for the TI AFE4403 heart monitor") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Acked-by: Andrew F. Davis Cc: Signed-off-by: Jonathan Cameron commit 96144c58abe7ff767e754b5b80995f7b8846d49b Merge: f82e7b57b5fc bc139119a170 Author: Linus Torvalds Date: Sat Jun 13 16:27:13 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from David Miller: 1) Fix cfg80211 deadlock, from Johannes Berg. 2) RXRPC fails to send norigications, from David Howells. 3) MPTCP RM_ADDR parsing has an off by one pointer error, fix from Geliang Tang. 4) Fix crash when using MSG_PEEK with sockmap, from Anny Hu. 5) The ucc_geth driver needs __netdev_watchdog_up exported, from Valentin Longchamp. 6) Fix hashtable memory leak in dccp, from Wang Hai. 7) Fix how nexthops are marked as FDB nexthops, from David Ahern. 8) Fix mptcp races between shutdown and recvmsg, from Paolo Abeni. 9) Fix crashes in tipc_disc_rcv(), from Tuong Lien. 10) Fix link speed reporting in iavf driver, from Brett Creeley. 11) When a channel is used for XSK and then reused again later for XSK, we forget to clear out the relevant data structures in mlx5 which causes all kinds of problems. Fix from Maxim Mikityanskiy. 12) Fix memory leak in genetlink, from Cong Wang. 13) Disallow sockmap attachments to UDP sockets, it simply won't work. From Lorenz Bauer. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (83 commits) net: ethernet: ti: ale: fix allmulti for nu type ale net: ethernet: ti: am65-cpsw-nuss: fix ale parameters init net: atm: Remove the error message according to the atomic context bpf: Undo internal BPF_PROBE_MEM in BPF insns dump libbpf: Support pre-initializing .bss global variables tools/bpftool: Fix skeleton codegen bpf: Fix memlock accounting for sock_hash bpf: sockmap: Don't attach programs to UDP sockets bpf: tcp: Recv() should return 0 when the peer socket is closed ibmvnic: Flush existing work items before device removal genetlink: clean up family attributes allocations net: ipa: header pad field only valid for AP->modem endpoint net: ipa: program upper nibbles of sequencer type net: ipa: fix modem LAN RX endpoint id net: ipa: program metadata mask differently ionic: add pcie_print_link_status rxrpc: Fix race between incoming ACK parser and retransmitter net/mlx5: E-Switch, Fix some error pointer dereferences net/mlx5: Don't fail driver on failure to create debugfs net/mlx5e: CT: Fix ipv6 nat header rewrite actions ... commit 55e20bd12a56e06c38b953177bb162cbbaa96004 Author: David Sterba Date: Tue Jun 9 19:56:06 2020 +0200 Revert "btrfs: switch to iomap_dio_rw() for dio" This reverts commit a43a67a2d715540c1368b9501a22b0373b5874c0. This patch reverts the main part of switching direct io implementation to iomap infrastructure. There's a problem in invalidate page that couldn't be solved as regression in this development cycle. The problem occurs when buffered and direct io are mixed, and the ranges overlap. Although this is not recommended, filesystems implement measures or fallbacks to make it somehow work. In this case, fallback to buffered IO would be an option for btrfs (this already happens when direct io is done on compressed data), but the change would be needed in the iomap code, bringing new semantics to other filesystems. Another problem arises when again the buffered and direct ios are mixed, invalidation fails, then -EIO is set on the mapping and fsync will fail, though there's no real error. There have been discussions how to fix that, but revert seems to be the least intrusive option. Link: https://lore.kernel.org/linux-btrfs/20200528192103.xm45qoxqmkw7i5yl@fiona/ Signed-off-by: David Sterba commit bc139119a1708ae3db1ebb379630f286e28d06e8 Author: Grygorii Strashko Date: Sat Jun 13 17:54:14 2020 +0300 net: ethernet: ti: ale: fix allmulti for nu type ale On AM65xx MCU CPSW2G NUSS and 66AK2E/L NUSS allmulti setting does not allow unregistered mcast packets to pass. This happens, because ALE VLAN entries on these SoCs do not contain port masks for reg/unreg mcast packets, but instead store indexes of ALE_VLAN_MASK_MUXx_REG registers which intended for store port masks for reg/unreg mcast packets. This path was missed by commit 9d1f6447274f ("net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled"). Hence, fix it by taking into account ALE type in cpsw_ale_set_allmulti(). Fixes: 9d1f6447274f ("net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled") Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 2074f9eaa58795a99e9da61c10f93180f810cfd6 Author: Grygorii Strashko Date: Sat Jun 13 17:52:59 2020 +0300 net: ethernet: ti: am65-cpsw-nuss: fix ale parameters init The ALE parameters structure is created on stack, so it has to be reset before passing to cpsw_ale_create() to avoid garbage values. Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit fa7566a0d68f8467846cba8ec29f1551b0a42de9 Merge: bf97bac9dc64 29fcb05bbf1a Author: David S. Miller Date: Sat Jun 13 15:28:08 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2020-06-12 The following pull-request contains BPF updates for your *net* tree. We've added 26 non-merge commits during the last 10 day(s) which contain a total of 27 files changed, 348 insertions(+), 93 deletions(-). The main changes are: 1) sock_hash accounting fix, from Andrey. 2) libbpf fix and probe_mem sanitizing, from Andrii. 3) sock_hash fixes, from Jakub. 4) devmap_val fix, from Jesper. 5) load_bytes_relative fix, from YiFei. ==================== Signed-off-by: David S. Miller commit bf97bac9dc6481e9f68992e52bed5cc4b210e636 Author: Liao Pingfang Date: Sat Jun 13 14:03:26 2020 +0800 net: atm: Remove the error message according to the atomic context Looking into the context (atomic!) and the error message should be dropped. Signed-off-by: Liao Pingfang Signed-off-by: David S. Miller commit f82e7b57b5fc48199e2f26ffafe2f96f7338ad3d Merge: 4f9b3a377549 a7a519a49262 Author: Linus Torvalds Date: Sat Jun 13 13:43:56 2020 -0700 Merge tag '5.8-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull more cifs updates from Steve French: "12 cifs/smb3 fixes, 2 for stable. - add support for idsfromsid on create and chgrp/chown allowing ability to save owner information more naturally for some workloads - improve query info (getattr) when SMB3.1.1 posix extensions are negotiated by using new query info level" * tag '5.8-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: smb3: Add debug message for new file creation with idsfromsid mount option cifs: fix chown and chgrp when idsfromsid mount option enabled smb3: allow uid and gid owners to be set on create with idsfromsid mount option smb311: Add tracepoints for new compound posix query info smb311: add support for using info level for posix extensions query smb311: Add support for lookup with posix extensions query info smb311: Add support for SMB311 query info (non-compounded) SMB311: Add support for query info using posix extensions (level 100) smb3: add indatalen that can be a non-zero value to calculation of credit charge in smb2 ioctl smb3: fix typo in mount options displayed in /proc/mounts cifs: Add get_security_type_str function to return sec type. smb3: extend fscache mount volume coherency check commit 4f9b3a377549e2b585f5e1910c247913b49e6c83 Author: Linus Torvalds Date: Sat Jun 13 13:41:24 2020 -0700 binderfs: add gitignore for generated sample program Let's keep "git status" happy and quiet. Fixes: 9762dc1432e1 ("samples: add binderfs sample program Fixes: fca5e94921d5 ("samples: binderfs: really compile this sample and fix build issues") Signed-off-by: Linus Torvalds commit 3e1ad4054b8d7c91c1ebf19d7709c754a6c703b6 Author: Linus Torvalds Date: Sat Jun 13 13:32:40 2020 -0700 doc: don't use deprecated "---help---" markers in target docs I'm not convinced the script makes useful automaed help lines anyway, but since we're trying to deprecate the use of "---help---" in Kconfig files, let's fix the doc example code too. See commit a7f7f6248d97 ("treewide: replace '---help---' in Kconfig files with 'help'") Cc: Masahiro Yamada Signed-off-by: Linus Torvalds commit 6adc19fd13f11883c44df67b551cf8201e6bba1d Merge: 3df83e164f1f a7f7f6248d97 Author: Linus Torvalds Date: Sat Jun 13 13:29:16 2020 -0700 Merge tag 'kbuild-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - fix build rules in binderfs sample - fix build errors when Kbuild recurses to the top Makefile - covert '---help---' in Kconfig to 'help' * tag 'kbuild-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: treewide: replace '---help---' in Kconfig files with 'help' kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables samples: binderfs: really compile this sample and fix build issues commit 3df83e164f1f39c614a3f31e39164756945ae2ea Merge: 91fa58840ae2 42c76c9848e1 Author: Linus Torvalds Date: Sat Jun 13 13:17:49 2020 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull more SCSI updates from James Bottomley: "This is the set of changes collected since just before the merge window opened. It's mostly minor fixes in drivers. The one non-driver set is the three optical disk (sr) changes where two are error path fixes and one is a helper conversion. The big driver change is the hpsa compat_alloc_userspace rework by Al so he can kill the remaining user. This has been tested and acked by the maintainer" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (21 commits) scsi: acornscsi: Fix an error handling path in acornscsi_probe() scsi: storvsc: Remove memset before memory freeing in storvsc_suspend() scsi: cxlflash: Remove an unnecessary NULL check scsi: ibmvscsi: Don't send host info in adapter info MAD after LPM scsi: sr: Fix sr_probe() missing deallocate of device minor scsi: sr: Fix sr_probe() missing mutex_destroy scsi: st: Convert convert get_user_pages() --> pin_user_pages() scsi: target: Rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb() scsi: target: Fix NULL pointer dereference scsi: target: Initialize LUN in transport_init_se_cmd() scsi: target: Factor out a new helper, target_cmd_init_cdb() scsi: hpsa: hpsa_ioctl(): Tidy up a bit scsi: hpsa: Get rid of compat_alloc_user_space() scsi: hpsa: Don't bother with vmalloc for BIG_IOCTL_Command_struct scsi: hpsa: Lift {BIG_,}IOCTL_Command_struct copy{in,out} into hpsa_ioctl() scsi: ufs: Remove redundant urgent_bkop_lvl initialization scsi: ufs: Don't update urgent bkops level when toggling auto bkops scsi: qedf: Remove redundant initialization of variable rc scsi: mpt3sas: Fix memset() in non-RDPQ mode scsi: iscsi: Fix reference count leak in iscsi_boot_create_kobj ... commit 91fa58840ae22cbf6d7c505ce6564c4c48f29af3 Merge: ac911b316336 d790eeb3db6a Author: Linus Torvalds Date: Sat Jun 13 13:12:38 2020 -0700 Merge branch 'i2c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "I2C has quite some patches for you this time. I hope it is the move to per-driver-maintainers which is now showing results. We will see. The big news is two new drivers (Nuvoton NPCM and Qualcomm CCI), larger refactoring of the Designware, Tegra, and PXA drivers, the Cadence driver supports being a slave now, and there is support to instanciate SPD eeproms for well-known cases (which will be user-visible because the i801 driver supports it), and some devm_platform_ioremap_resource() conversions which blow up the diffstat. Note that I applied the Nuvoton driver quite late, so some minor fixup patches arrived during the merge window. I chose to apply them right away because they were trivial" * 'i2c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (109 commits) i2c: Drop stray comma in MODULE_AUTHOR statements i2c: npcm7xx: npcm_i2caddr[] can be static MAINTAINERS: npcm7xx: Add maintainer for Nuvoton NPCM BMC i2c: npcm7xx: Fix a couple of error codes in probe i2c: icy: Fix build with CONFIG_AMIGA_PCMCIA=n i2c: npcm7xx: Remove unnecessary parentheses i2c: npcm7xx: Add support for slave mode for Nuvoton i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver dt-bindings: i2c: npcm7xx: add NPCM I2C controller i2c: pxa: don't error out if there's no pinctrl i2c: add 'single-master' property to generic bindings i2c: designware: Add Baikal-T1 System I2C support i2c: designware: Move reg-space remapping into a dedicated function i2c: designware: Retrieve quirk flags as early as possible i2c: designware: Convert driver to using regmap API i2c: designware: Discard Cherry Trail model flag i2c: designware: Add Baytrail sem config DW I2C platform dependency i2c: designware: slave: Set DW I2C core module dependency i2c: designware: Use `-y` to build multi-object modules dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller ... commit ac911b316336ad3d22b09e82698f0463347a5507 Merge: d74b15dbbbd2 2630e1bb0948 Author: Linus Torvalds Date: Sat Jun 13 13:09:38 2020 -0700 Merge tag 'media/v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull more media updates from Mauro Carvalho Chehab: - a set of atomisp patches. They remove several abstraction layers, and fixes clang and gcc warnings (that were hidden via some macros that were disabling 4 or 5 types of warnings there). There are also some important fixes and sensor auto-detection on newer BIOSes via ACPI _DCM tables. - some fixes * tag 'media/v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (95 commits) media: rkvdec: Fix H264 scaling list order media: v4l2-ctrls: Unset correct HEVC loop filter flag media: videobuf2-dma-contig: fix bad kfree in vb2_dma_contig_clear_max_seg_size media: v4l2-subdev.rst: correct information about v4l2 events media: s5p-mfc: Properly handle dma_parms for the allocated devices media: medium: cec: Make MEDIA_CEC_SUPPORT default to n if !MEDIA_SUPPORT media: cedrus: Implement runtime PM media: cedrus: Program output format during each run media: atomisp: improve ACPI/DMI detection logs media: Revert "media: atomisp: add Asus Transform T101HA ACPI vars" media: Revert "media: atomisp: Add some ACPI detection info" media: atomisp: improve sensor detection code to use _DSM table media: atomisp: get rid of an iomem abstraction layer media: atomisp: get rid of a string_support.h abstraction layer media: atomisp: use strscpy() instead of less secure variants media: atomisp: set DFS to MAX if sensor doesn't report fps media: atomisp: use different dfs failed messages media: atomisp: change the detection of ISP2401 at runtime media: atomisp: use macros from intel-family.h media: atomisp: don't set hpll_freq twice with different values ... commit d74b15dbbbd2741f3580d7c884cd285144ae0cab Merge: 298ce0fd5030 6ec26b8b2d70 Author: Linus Torvalds Date: Sat Jun 13 13:04:36 2020 -0700 Merge tag 'libnvdimm-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "Small collection of cleanups to rework usage of ->queuedata and the GUID api" * tag 'libnvdimm-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm/pmem: stop using ->queuedata nvdimm/btt: stop using ->queuedata nvdimm/blk: stop using ->queuedata libnvdimm: Replace guid_copy() with import_guid() where it makes sense commit 298ce0fd50309a4805413f9572280606e4007cbe Author: Linus Torvalds Date: Sat Jun 13 13:00:54 2020 -0700 watch_queue: add gitignore for generated sample program Let's keep "git status" happy and quiet. Fixes: f5b5a164f9a1 ("Add sample notification program") Signed-off-by: Linus Torvalds commit 593bd5e5d3e245262c40c7dd2f5edbac705ff578 Merge: c55572276834 d4ff3b2ef901 Author: Linus Torvalds Date: Sat Jun 13 12:44:30 2020 -0700 Merge tag 'iomap-5.8-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap fix from Darrick Wong: "A single iomap bug fix for a variable type mistake on 32-bit architectures, fixing an integer overflow problem in the unshare actor" * tag 'iomap-5.8-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: Fix unsharing of an extent >2GB on a 32-bit machine commit c55572276834f8b17c859db7d20c224fe25b9eda Merge: 61f3e825bec7 8cc007246972 Author: Linus Torvalds Date: Sat Jun 13 12:40:24 2020 -0700 Merge tag 'xfs-5.8-merge-9' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fix from Darrick Wong: "We've settled down into the bugfix phase; this one fixes a resource leak on an error bailout path" * tag 'xfs-5.8-merge-9' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster() commit 61f3e825bec7364790cb7d193a9a156c46119cff Merge: 08bf1a27c4c3 36f9967531da Author: Linus Torvalds Date: Sat Jun 13 12:38:57 2020 -0700 Merge tag '9p-for-5.8' of git://github.com/martinetd/linux Pull 9p update from Dominique Martinet: "Another very quiet cycle... Only one commit: increase the size of the ring used for xen transport" * tag '9p-for-5.8' of git://github.com/martinetd/linux: 9p/xen: increase XEN_9PFS_RING_ORDER commit 08bf1a27c4c354b853fd81a79e953525bbcc8506 Merge: cfd230b3cfd6 e881bfaf5a5f Author: Linus Torvalds Date: Sat Jun 13 10:56:31 2020 -0700 Merge tag 'powerpc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: "One fix for a recent change which broke nested KVM guests on Power9. Thanks to Alexey Kardashevskiy" * tag 'powerpc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Fix nested guest RC bits update commit cfd230b3cfd6f72a6016fb0b319bb63fcc8206cd Merge: 56192707bd83 db227c19e68d Author: Linus Torvalds Date: Sat Jun 13 10:55:29 2020 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - fix for "hex" Kconfig default to use 0x0 rather than 0 to allow these to be removed from defconfigs - fix from Ard Biesheuvel for EFI HYP mode booting * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8985/1: efi/decompressor: deal with HYP mode boot gracefully ARM: 8984/1: Kconfig: set default ZBOOT_ROM_TEXT/BSS value to 0x0 commit 56192707bd8330355d3d1746d99e808eca1999d7 Merge: 66125d934b39 6bd140e14d9a Author: Linus Torvalds Date: Sat Jun 13 10:54:09 2020 -0700 Merge tag 'for-linus' of git://github.com/openrisc/linux Pull OpenRISC update from Stafford Horne: "One patch found wile I was getting the glibc port ready: fix issue with clone TLS arg getting overwritten" * tag 'for-linus' of git://github.com/openrisc/linux: openrisc: Fix issue with argument clobbering for clone/fork commit 66125d934b39889372b8d75e4c192818656efb80 Merge: a9429089d3e8 777747f634ba Author: Linus Torvalds Date: Sat Jun 13 10:51:29 2020 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha Pull alpha updates from Matt Turner: "A few changes for alpha. They're mostly small janitorial fixes but there's also a build fix and most notably a patch from Mikulas that fixes a hang on boot on the Avanti platform, which required quite a bit of work and review" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha: alpha: Fix build around srm_sysrq_reboot_op alpha: c_next should increase position index alpha: Replace sg++ with sg = sg_next(sg) alpha: fix memory barriers so that they conform to the specification alpha: remove unneeded semicolon in sys_eiger.c alpha: remove unneeded semicolon in osf_sys.c alpha: Replace strncmp with str_has_prefix alpha: fix rtc port ranges alpha: Kconfig: pedantic formatting commit a9429089d3e822d45be01a9635f0685174508fd3 Merge: 076f14be7fc9 7ccddc4613db Author: Linus Torvalds Date: Sat Jun 13 10:21:00 2020 -0700 Merge tag 'ras-core-2020-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RAS updates from Thomas Gleixner: "RAS updates from Borislav Petkov: - Unmap a whole guest page if an MCE is encountered in it to avoid follow-on MCEs leading to the guest crashing, by Tony Luck. This change collided with the entry changes and the merge resolution would have been rather unpleasant. To avoid that the entry branch was merged in before applying this. The resulting code did not change over the rebase. - AMD MCE error thresholding machinery cleanup and hotplug sanitization, by Thomas Gleixner. - Change the MCE notifiers to denote whether they have handled the error and not break the chain early by returning NOTIFY_STOP, thus giving the opportunity for the later handlers in the chain to see it. By Tony Luck. - Add AMD family 0x17, models 0x60-6f support, by Alexander Monakov. - Last but not least, the usual round of fixes and improvements" * tag 'ras-core-2020-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) x86/mce/dev-mcelog: Fix -Wstringop-truncation warning about strncpy() x86/{mce,mm}: Unmap the entire page if the whole page is affected and poisoned EDAC/amd64: Add AMD family 17h model 60h PCI IDs hwmon: (k10temp) Add AMD family 17h model 60h PCI match x86/amd_nb: Add AMD family 17h model 60h PCI IDs x86/mcelog: Add compat_ioctl for 32-bit mcelog support x86/mce: Drop bogus comment about mce.kflags x86/mce: Fixup exception only for the correct MCEs EDAC: Drop the EDAC report status checks x86/mce: Add mce=print_all option x86/mce: Change default MCE logger to check mce->kflags x86/mce: Fix all mce notifiers to update the mce->kflags bitmask x86/mce: Add a struct mce.kflags field x86/mce: Convert the CEC to use the MCE notifier x86/mce: Rename "first" function as "early" x86/mce/amd, edac: Remove report_gart_errors x86/mce/amd: Make threshold bank setting hotplug robust x86/mce/amd: Cleanup threshold device remove path x86/mce/amd: Straighten CPU hotplug path x86/mce/amd: Sanitize thresholding device creation hotplug path ... commit 076f14be7fc942e112c94c841baec44124275cd0 Merge: 6c3297841472 0bf3924bfabd Author: Linus Torvalds Date: Sat Jun 13 10:05:47 2020 -0700 Merge tag 'x86-entry-2020-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 entry updates from Thomas Gleixner: "The x86 entry, exception and interrupt code rework This all started about 6 month ago with the attempt to move the Posix CPU timer heavy lifting out of the timer interrupt code and just have lockless quick checks in that code path. Trivial 5 patches. This unearthed an inconsistency in the KVM handling of task work and the review requested to move all of this into generic code so other architectures can share. Valid request and solved with another 25 patches but those unearthed inconsistencies vs. RCU and instrumentation. Digging into this made it obvious that there are quite some inconsistencies vs. instrumentation in general. The int3 text poke handling in particular was completely unprotected and with the batched update of trace events even more likely to expose to endless int3 recursion. In parallel the RCU implications of instrumenting fragile entry code came up in several discussions. The conclusion of the x86 maintainer team was to go all the way and make the protection against any form of instrumentation of fragile and dangerous code pathes enforcable and verifiable by tooling. A first batch of preparatory work hit mainline with commit d5f744f9a2ac ("Pull x86 entry code updates from Thomas Gleixner") That (almost) full solution introduced a new code section '.noinstr.text' into which all code which needs to be protected from instrumentation of all sorts goes into. Any call into instrumentable code out of this section has to be annotated. objtool has support to validate this. Kprobes now excludes this section fully which also prevents BPF from fiddling with it and all 'noinstr' annotated functions also keep ftrace off. The section, kprobes and objtool changes are already merged. The major changes coming with this are: - Preparatory cleanups - Annotating of relevant functions to move them into the noinstr.text section or enforcing inlining by marking them __always_inline so the compiler cannot misplace or instrument them. - Splitting and simplifying the idtentry macro maze so that it is now clearly separated into simple exception entries and the more interesting ones which use interrupt stacks and have the paranoid handling vs. CR3 and GS. - Move quite some of the low level ASM functionality into C code: - enter_from and exit to user space handling. The ASM code now calls into C after doing the really necessary ASM handling and the return path goes back out without bells and whistels in ASM. - exception entry/exit got the equivivalent treatment - move all IRQ tracepoints from ASM to C so they can be placed as appropriate which is especially important for the int3 recursion issue. - Consolidate the declaration and definition of entry points between 32 and 64 bit. They share a common header and macros now. - Remove the extra device interrupt entry maze and just use the regular exception entry code. - All ASM entry points except NMI are now generated from the shared header file and the corresponding macros in the 32 and 64 bit entry ASM. - The C code entry points are consolidated as well with the help of DEFINE_IDTENTRY*() macros. This allows to ensure at one central point that all corresponding entry points share the same semantics. The actual function body for most entry points is in an instrumentable and sane state. There are special macros for the more sensitive entry points, e.g. INT3 and of course the nasty paranoid #NMI, #MCE, #DB and #DF. They allow to put the whole entry instrumentation and RCU handling into safe places instead of the previous pray that it is correct approach. - The INT3 text poke handling is now completely isolated and the recursion issue banned. Aside of the entry rework this required other isolation work, e.g. the ability to force inline bsearch. - Prevent #DB on fragile entry code, entry relevant memory and disable it on NMI, #MC entry, which allowed to get rid of the nested #DB IST stack shifting hackery. - A few other cleanups and enhancements which have been made possible through this and already merged changes, e.g. consolidating and further restricting the IDT code so the IDT table becomes RO after init which removes yet another popular attack vector - About 680 lines of ASM maze are gone. There are a few open issues: - An escape out of the noinstr section in the MCE handler which needs some more thought but under the aspect that MCE is a complete trainwreck by design and the propability to survive it is low, this was not high on the priority list. - Paravirtualization When PV is enabled then objtool complains about a bunch of indirect calls out of the noinstr section. There are a few straight forward ways to fix this, but the other issues vs. general correctness were more pressing than parawitz. - KVM KVM is inconsistent as well. Patches have been posted, but they have not yet been commented on or picked up by the KVM folks. - IDLE Pretty much the same problems can be found in the low level idle code especially the parts where RCU stopped watching. This was beyond the scope of the more obvious and exposable problems and is on the todo list. The lesson learned from this brain melting exercise to morph the evolved code base into something which can be validated and understood is that once again the violation of the most important engineering principle "correctness first" has caused quite a few people to spend valuable time on problems which could have been avoided in the first place. The "features first" tinkering mindset really has to stop. With that I want to say thanks to everyone involved in contributing to this effort. Special thanks go to the following people (alphabetical order): Alexandre Chartre, Andy Lutomirski, Borislav Petkov, Brian Gerst, Frederic Weisbecker, Josh Poimboeuf, Juergen Gross, Lai Jiangshan, Macro Elver, Paolo Bonzin,i Paul McKenney, Peter Zijlstra, Vitaly Kuznetsov, and Will Deacon" * tag 'x86-entry-2020-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (142 commits) x86/entry: Force rcu_irq_enter() when in idle task x86/entry: Make NMI use IDTENTRY_RAW x86/entry: Treat BUG/WARN as NMI-like entries x86/entry: Unbreak __irqentry_text_start/end magic x86/entry: __always_inline CR2 for noinstr lockdep: __always_inline more for noinstr x86/entry: Re-order #DB handler to avoid *SAN instrumentation x86/entry: __always_inline arch_atomic_* for noinstr x86/entry: __always_inline irqflags for noinstr x86/entry: __always_inline debugreg for noinstr x86/idt: Consolidate idt functionality x86/idt: Cleanup trap_init() x86/idt: Use proper constants for table size x86/idt: Add comments about early #PF handling x86/idt: Mark init only functions __init x86/entry: Rename trace_hardirqs_off_prepare() x86/entry: Clarify irq_{enter,exit}_rcu() x86/entry: Remove DBn stacks x86/entry: Remove debug IDT frobbing x86/entry: Optimize local_db_save() for virt ... commit a7f7f6248d9740d710fd6bd190293fe5e16410ac Author: Masahiro Yamada Date: Sun Jun 14 01:50:22 2020 +0900 treewide: replace '---help---' in Kconfig files with 'help' Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over '---help---'"), the number of '---help---' has been gradually decreasing, but there are still more than 2400 instances. This commit finishes the conversion. While I touched the lines, I also fixed the indentation. There are a variety of indentation styles found. a) 4 spaces + '---help---' b) 7 spaces + '---help---' c) 8 spaces + '---help---' d) 1 space + 1 tab + '---help---' e) 1 tab + '---help---' (correct indentation) f) 1 tab + 1 space + '---help---' g) 1 tab + 2 spaces + '---help---' In order to convert all of them to 1 tab + 'help', I ran the following commend: $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/' Signed-off-by: Masahiro Yamada commit 6c3297841472b4e53e22e53826eea9e483d993e5 Merge: df2fbf5bfa0e a8478a602913 Author: Linus Torvalds Date: Sat Jun 13 09:56:21 2020 -0700 Merge tag 'notifications-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull notification queue from David Howells: "This adds a general notification queue concept and adds an event source for keys/keyrings, such as linking and unlinking keys and changing their attributes. Thanks to Debarshi Ray, we do have a pull request to use this to fix a problem with gnome-online-accounts - as mentioned last time: https://gitlab.gnome.org/GNOME/gnome-online-accounts/merge_requests/47 Without this, g-o-a has to constantly poll a keyring-based kerberos cache to find out if kinit has changed anything. [ There are other notification pending: mount/sb fsinfo notifications for libmount that Karel Zak and Ian Kent have been working on, and Christian Brauner would like to use them in lxc, but let's see how this one works first ] LSM hooks are included: - A set of hooks are provided that allow an LSM to rule on whether or not a watch may be set. Each of these hooks takes a different "watched object" parameter, so they're not really shareable. The LSM should use current's credentials. [Wanted by SELinux & Smack] - A hook is provided to allow an LSM to rule on whether or not a particular message may be posted to a particular queue. This is given the credentials from the event generator (which may be the system) and the watch setter. [Wanted by Smack] I've provided SELinux and Smack with implementations of some of these hooks. WHY === Key/keyring notifications are desirable because if you have your kerberos tickets in a file/directory, your Gnome desktop will monitor that using something like fanotify and tell you if your credentials cache changes. However, we also have the ability to cache your kerberos tickets in the session, user or persistent keyring so that it isn't left around on disk across a reboot or logout. Keyrings, however, cannot currently be monitored asynchronously, so the desktop has to poll for it - not so good on a laptop. This facility will allow the desktop to avoid the need to poll. DESIGN DECISIONS ================ - The notification queue is built on top of a standard pipe. Messages are effectively spliced in. The pipe is opened with a special flag: pipe2(fds, O_NOTIFICATION_PIPE); The special flag has the same value as O_EXCL (which doesn't seem like it will ever be applicable in this context)[?]. It is given up front to make it a lot easier to prohibit splice&co from accessing the pipe. [?] Should this be done some other way? I'd rather not use up a new O_* flag if I can avoid it - should I add a pipe3() system call instead? The pipe is then configured:: ioctl(fds[1], IOC_WATCH_QUEUE_SET_SIZE, queue_depth); ioctl(fds[1], IOC_WATCH_QUEUE_SET_FILTER, &filter); Messages are then read out of the pipe using read(). - It should be possible to allow write() to insert data into the notification pipes too, but this is currently disabled as the kernel has to be able to insert messages into the pipe *without* holding pipe->mutex and the code to make this work needs careful auditing. - sendfile(), splice() and vmsplice() are disabled on notification pipes because of the pipe->mutex issue and also because they sometimes want to revert what they just did - but one or more notification messages might've been interleaved in the ring. - The kernel inserts messages with the wait queue spinlock held. This means that pipe_read() and pipe_write() have to take the spinlock to update the queue pointers. - Records in the buffer are binary, typed and have a length so that they can be of varying size. This allows multiple heterogeneous sources to share a common buffer; there are 16 million types available, of which I've used just a few, so there is scope for others to be used. Tags may be specified when a watchpoint is created to help distinguish the sources. - Records are filterable as types have up to 256 subtypes that can be individually filtered. Other filtration is also available. - Notification pipes don't interfere with each other; each may be bound to a different set of watches. Any particular notification will be copied to all the queues that are currently watching for it - and only those that are watching for it. - When recording a notification, the kernel will not sleep, but will rather mark a queue as having lost a message if there's insufficient space. read() will fabricate a loss notification message at an appropriate point later. - The notification pipe is created and then watchpoints are attached to it, using one of: keyctl_watch_key(KEY_SPEC_SESSION_KEYRING, fds[1], 0x01); watch_mount(AT_FDCWD, "/", 0, fd, 0x02); watch_sb(AT_FDCWD, "/mnt", 0, fd, 0x03); where in both cases, fd indicates the queue and the number after is a tag between 0 and 255. - Watches are removed if either the notification pipe is destroyed or the watched object is destroyed. In the latter case, a message will be generated indicating the enforced watch removal. Things I want to avoid: - Introducing features that make the core VFS dependent on the network stack or networking namespaces (ie. usage of netlink). - Dumping all this stuff into dmesg and having a daemon that sits there parsing the output and distributing it as this then puts the responsibility for security into userspace and makes handling namespaces tricky. Further, dmesg might not exist or might be inaccessible inside a container. - Letting users see events they shouldn't be able to see. TESTING AND MANPAGES ==================== - The keyutils tree has a pipe-watch branch that has keyctl commands for making use of notifications. Proposed manual pages can also be found on this branch, though a couple of them really need to go to the main manpages repository instead. If the kernel supports the watching of keys, then running "make test" on that branch will cause the testing infrastructure to spawn a monitoring process on the side that monitors a notifications pipe for all the key/keyring changes induced by the tests and they'll all be checked off to make sure they happened. https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/log/?h=pipe-watch - A test program is provided (samples/watch_queue/watch_test) that can be used to monitor for keyrings, mount and superblock events. Information on the notifications is simply logged to stdout" * tag 'notifications-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: smack: Implement the watch_key and post_notification hooks selinux: Implement the watch_key security hook keys: Make the KEY_NEED_* perms an enum rather than a mask pipe: Add notification lossage handling pipe: Allow buffers to be marked read-whole-or-error for notifications Add sample notification program watch_queue: Add a key/keyring notification facility security: Add hooks to rule on setting a watch pipe: Add general notification queue support pipe: Add O_NOTIFICATION_PIPE security: Add a hook for the point of notification insertion uapi: General notification queue definitions commit db227c19e68db353e4cc6c99b6bc86bb24736943 Author: Ard Biesheuvel Date: Fri Jun 12 11:21:35 2020 +0100 ARM: 8985/1: efi/decompressor: deal with HYP mode boot gracefully EFI on ARM only supports short descriptors, and given that it mandates that the MMU and caches are on, it is implied that booting in HYP mode is not supported. However, implementations of EFI exist (i.e., U-Boot) that ignore this requirement, which is not entirely unreasonable, given that it makes HYP mode inaccessible to the operating system. So let's make sure that we can deal with this condition gracefully. We already tolerate booting the EFI stub with the caches off (even though this violates the EFI spec as well), and so we should deal with HYP mode boot with MMU and caches either on or off. - When the MMU and caches are on, we can ignore the HYP stub altogether, since we can carry on executing at HYP. We do need to ensure that we disable the MMU at HYP before entering the kernel proper. - When the MMU and caches are off, we have to drop to SVC mode so that we can set up the page tables using short descriptors. In this case, we need to install the HYP stub as usual, so that we can return to HYP mode before handing over to the kernel proper. Tested-by: Heinrich Schuchardt Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King commit 39c3e304567a013ac096ca8747fe53b44a76e44b Author: Chris Packham Date: Tue Jun 9 03:28:14 2020 +0100 ARM: 8984/1: Kconfig: set default ZBOOT_ROM_TEXT/BSS value to 0x0 ZBOOT_ROM_TEXT and ZBOOT_ROM_BSS are defined as 'hex' but had a default of "0". Kconfig will helpfully expand a text entry of 0 to 0x0 but because this is not the same as the default value it was treated as being explicitly set when running 'make savedefconfig' so most arm defconfigs have CONFIG_ZBOOT_ROM_TEXT=0x0 and CONFIG_ZBOOT_ROM_BSS=0x0. Change the default to 0x0 which will mean next time the defconfigs are re-generated the spurious config entries will be removed. Signed-off-by: Chris Packham Signed-off-by: Russell King commit bc8bd54ffd8513e05eb87b5badcb2d586ea278f0 Author: John Stultz Date: Sat Jun 13 04:21:59 2020 +0000 drm/msm: Fix 0xfffflub in "Refactor address space initialization" This week I started seeing GPU crashes on my DragonBoard 845c which I narrowed down to being caused by commit ccac7ce373c1 ("drm/msm: Refactor address space initialization"). Looking through the patch, Jordan and I couldn't find anything obviously wrong, so I ended up breaking that change up into a number of smaller logical steps so I could figure out which part was causing the trouble. Ends up, visually counting 'f's is hard, esp across a number of lines: 0xfffffff != 0xffffffff This patch corrects the end value we pass in to msm_gem_address_space_create() in adreno_iommu_create_address_space() so that it matches the value used before the problematic patch landed. With this change, I no longer see the GPU crashes that were affecting me. Cc: Shawn Guo Cc: Rob Clark Cc: Sean Paul Cc: Jordan Crouse Cc: freedreno@lists.freedesktop.org Fixes: ccac7ce373c1 ("drm/msm: Refactor address space initialization") Signed-off-by: John Stultz Signed-off-by: Rob Clark commit 777747f634ba765085373f851e9c48dccb12ad52 Author: Joerg Roedel Date: Thu Jun 11 11:11:39 2020 +0200 alpha: Fix build around srm_sysrq_reboot_op The patch introducing the struct was probably never compile tested, because it sets a handler with a wrong function signature. Wrap the handler into a functions with the correct signature to fix the build. Fixes: 0f1c9688a194 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()") Cc: Emil Velikov Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Joerg Roedel Signed-off-by: Matt Turner commit 7812193ca88bcb6c7bddea61c8797e2d5a6df5bd Author: Matt Turner Date: Wed Jun 10 16:59:30 2020 -0700 alpha: c_next should increase position index Signed-off-by: Matt Turner commit e66dd01e33bdea1c580bf037feec39aae6946ade Author: Xu Wang Date: Wed Jun 3 02:31:59 2020 +0000 alpha: Replace sg++ with sg = sg_next(sg) Replace sg++ with sg = sg_next(sg). Signed-off-by: Xu Wang Signed-off-by: Matt Turner commit 54505a1e2083fc54cbe8779b97479f969cd30a00 Author: Mikulas Patocka Date: Tue May 26 10:47:49 2020 -0400 alpha: fix memory barriers so that they conform to the specification The commits cd0e00c10672 and 92d7223a7423 broke boot on the Alpha Avanti platform. The patches move memory barriers after a write before the write. The result is that if there's iowrite followed by ioread, there is no barrier between them. The Alpha architecture allows reordering of the accesses to the I/O space, and the missing barrier between write and read causes hang with serial port and real time clock. This patch makes barriers confiorm to the specification. 1. We add mb() before readX_relaxed and writeX_relaxed - memory-barriers.txt claims that these functions must be ordered w.r.t. each other. Alpha doesn't order them, so we need an explicit barrier. 2. We add mb() before reads from the I/O space - so that if there's a write followed by a read, there should be a barrier between them. Signed-off-by: Mikulas Patocka Fixes: cd0e00c10672 ("alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering") Fixes: 92d7223a7423 ("alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering #2") Cc: stable@vger.kernel.org # v4.17+ Acked-by: Ivan Kokshaysky Reviewed-by: Maciej W. Rozycki Signed-off-by: Matt Turner commit c0ebf71506f11c5f66f3b47fb27f8c7d5e176baa Author: Jason Yan Date: Tue Apr 28 14:32:25 2020 +0800 alpha: remove unneeded semicolon in sys_eiger.c Fix the following coccicheck warning: arch/alpha/kernel/sys_eiger.c:179:2-3: Unneeded semicolon Signed-off-by: Jason Yan Signed-off-by: Matt Turner commit a466a5cfbb5665a0595cbd4cbe05140d57346990 Author: Jason Yan Date: Tue Apr 28 14:32:35 2020 +0800 alpha: remove unneeded semicolon in osf_sys.c Fix the following coccicheck warning: arch/alpha/kernel/osf_sys.c:680:2-3: Unneeded semicolon Signed-off-by: Jason Yan Signed-off-by: Matt Turner commit 5f14596e55de458987ee38043019b3d5cd636af1 Author: Chuhong Yuan Date: Tue Jul 30 11:02:39 2019 +0800 alpha: Replace strncmp with str_has_prefix In commit b6b2735514bc ("tracing: Use str_has_prefix() instead of using fixed sizes") the newly introduced str_has_prefix() was used to replace error-prone strncmp(str, const, len). Here fix codes with the same pattern. Signed-off-by: Chuhong Yuan Signed-off-by: Matt Turner commit 5bea3044a74acb3d780288c0fecd0eb25bdda24d Author: Mikulas Patocka Date: Fri Apr 5 07:16:31 2019 -0400 alpha: fix rtc port ranges Alpha incorrectly reports "0070-0080 : rtc" in /proc/ioports. Fix this, so that it is "0070-007f". Signed-off-by: Mikulas Patocka Signed-off-by: Matt Turner commit 8b3ebda6d81af05b4827f18086d27bee9000f67c Author: Enrico Weigelt, metux IT consult Date: Mon Mar 11 14:42:08 2019 +0100 alpha: Kconfig: pedantic formatting Formatting of Kconfig files doesn't look so pretty, so let the Great White Handkerchief come around and clean it up. Signed-off-by: Enrico Weigelt, metux IT consult Signed-off-by: Matt Turner commit 29fcb05bbf1a7008900bb9bee347bdbfc7171036 Author: Andrii Nakryiko Date: Fri Jun 12 17:21:15 2020 -0700 bpf: Undo internal BPF_PROBE_MEM in BPF insns dump BPF_PROBE_MEM is kernel-internal implmementation details. When dumping BPF instructions to user-space, it needs to be replaced back with BPF_MEM mode. Fixes: 2a02759ef5f8 ("bpf: Add support for BTF pointers to interpreter") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200613002115.1632142-1-andriin@fb.com commit caf62492f479585296e9d636c798d5ac256b7b04 Author: Andrii Nakryiko Date: Fri Jun 12 12:45:04 2020 -0700 libbpf: Support pre-initializing .bss global variables Remove invalid assumption in libbpf that .bss map doesn't have to be updated in kernel. With addition of skeleton and memory-mapped initialization image, .bss doesn't have to be all zeroes when BPF map is created, because user-code might have initialized those variables from user-space. Fixes: eba9c5f498a1 ("libbpf: Refactor global data map initialization") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200612194504.557844-1-andriin@fb.com commit 22eb78792e07a4dfb63c85f34950d4e58eb90326 Author: Andrii Nakryiko Date: Fri Jun 12 13:16:03 2020 -0700 tools/bpftool: Fix skeleton codegen Remove unnecessary check at the end of codegen() routine which makes codegen() to always fail and exit bpftool with error code. Positive value of variable n is not an indicator of a failure. Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Tobias Klauser Link: https://lore.kernel.org/bpf/20200612201603.680852-1-andriin@fb.com commit 60e5ca8a64bad8f3e2e20a1e57846e497361c700 Author: Andrey Ignatov Date: Thu Jun 11 17:08:57 2020 -0700 bpf: Fix memlock accounting for sock_hash Add missed bpf_map_charge_init() in sock_hash_alloc() and correspondingly bpf_map_charge_finish() on ENOMEM. It was found accidentally while working on unrelated selftest that checks "map->memory.pages > 0" is true for all map types. Before: # bpftool m l ... 3692: sockhash name m_sockhash flags 0x0 key 4B value 4B max_entries 8 memlock 0B After: # bpftool m l ... 84: sockmap name m_sockmap flags 0x0 key 4B value 4B max_entries 8 memlock 4096B Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200612000857.2881453-1-rdna@fb.com commit f6fede8569689dd31e7b0ed15024b25e5ce2e2e5 Author: Lorenz Bauer Date: Thu Jun 11 18:25:20 2020 +0100 bpf: sockmap: Don't attach programs to UDP sockets The stream parser infrastructure isn't set up to deal with UDP sockets, so we mustn't try to attach programs to them. I remember making this change at some point, but I must have lost it while rebasing or something similar. Fixes: 7b98cd42b049 ("bpf: sockmap: Add UDP support") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20200611172520.327602-1-lmb@cloudflare.com commit 2c7269b231194aae23fb90ab65842573a91acbc9 Author: Sabrina Dubroca Date: Wed Jun 10 12:19:43 2020 +0200 bpf: tcp: Recv() should return 0 when the peer socket is closed If the peer is closed, we will never get more data, so tcp_bpf_wait_data will get stuck forever. In case we passed MSG_DONTWAIT to recv(), we get EAGAIN but we should actually get 0. >From man 2 recv: RETURN VALUE When a stream socket peer has performed an orderly shutdown, the return value will be 0 (the traditional "end-of-file" return). This patch makes tcp_bpf_wait_data always return 1 when the peer socket has been shutdown. Either we have data available, and it would have returned 1 anyway, or there isn't, in which case we'll call tcp_recvmsg which does the right thing in this situation. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Sabrina Dubroca Signed-off-by: Alexei Starovoitov Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/26038a28c21fea5d04d4bd4744c5686d3f2e5504.1591784177.git.sd@queasysnail.net commit a7a519a4926214ba4161bc30109f4a8d69defb8d Author: Steve French Date: Fri Jun 12 14:49:47 2020 -0500 smb3: Add debug message for new file creation with idsfromsid mount option Pavel noticed that a debug message (disabled by default) in creating the security descriptor context could be useful for new file creation owner fields (as we already have for the mode) when using mount parm idsfromsid. [38120.392272] CIFS: FYI: owner S-1-5-88-1-0, group S-1-5-88-2-0 [38125.792637] CIFS: FYI: owner S-1-5-88-1-1000, group S-1-5-88-2-1000 Also cleans up a typo in a comment Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 6954a9e4192b86d778fb52b525fd7b62d51b1147 Author: Thomas Falcon Date: Fri Jun 12 13:34:41 2020 -0500 ibmvnic: Flush existing work items before device removal Ensure that all scheduled work items have completed before continuing with device removal and after further event scheduling has been halted. This patch fixes a bug where a scheduled driver reset event is processed following device removal. Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit df2fbf5bfa0e7fff8b4784507e4d68f200454318 Merge: 44ebe016df3a 8d485da0ddee Author: Linus Torvalds Date: Fri Jun 12 14:10:21 2020 -0700 Merge tag 'thermal-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal updates from Daniel Lezcano: - Add the hwmon support on the i.MX SC (Anson Huang) - Thermal framework cleanups (self-encapsulation, pointless stubs, private structures) (Daniel Lezcano) - Use the PM QoS frequency changes for the devfreq cooling device (Matthias Kaehlcke) - Remove duplicate error messages from platform_get_irq() error handling (Markus Elfring) - Add support for the bandgap sensors (Keerthy) - Statically initialize .get_mode/.set_mode ops (Andrzej Pietrasiewicz) - Add Renesas R-Car maintainer entry (Niklas Söderlund) - Fix error checking after calling ti_bandgap_get_sensor_data() for the TI SoC thermal (Sudip Mukherjee) - Add latency constraint for the idle injection, the DT binding and the change the registering function (Daniel Lezcano) - Convert the thermal framework binding to the Yaml schema (Amit Kucheria) - Replace zero-length array with flexible-array on i.MX 8MM (Gustavo A. R. Silva) - Thermal framework cleanups (alphabetic order for heads, replace module.h by export.h, make file naming consistent) (Amit Kucheria) - Merge tsens-common into the tsens driver (Amit Kucheria) - Fix platform dependency for the Qoriq driver (Geert Uytterhoeven) - Clean up the rcar_thermal_update_temp() function in the rcar thermal driver (Niklas Söderlund) - Fix the TMSAR register for the TMUv2 on the Qoriq platform (Yuantian Tang) - Export GDDV, OEM vendor variables, and don't require IDSP for the int340x thermal driver - trivial conflicts fixed (Matthew Garrett) * tag 'thermal-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (48 commits) thermal/int340x_thermal: Don't require IDSP to exist thermal/int340x_thermal: Export OEM vendor variables thermal/int340x_thermal: Export GDDV thermal: qoriq: Update the settings for TMUv2 thermal: rcar_thermal: Clean up rcar_thermal_update_temp() thermal: qoriq: Add platform dependencies drivers: thermal: tsens: Merge tsens-common.c into tsens.c thermal/of: Rename of-thermal.c thermal/governors: Prefix all source files with gov_ thermal/drivers/user_space: Sort headers alphabetically thermal/drivers/of-thermal: Sort headers alphabetically thermal/drivers/cpufreq_cooling: Replace module.h with export.h thermal/drivers/cpufreq_cooling: Sort headers alphabetically thermal/drivers/clock_cooling: Include export.h thermal/drivers/clock_cooling: Sort headers alphabetically thermal/drivers/thermal_hwmon: Include export.h thermal/drivers/thermal_hwmon: Sort headers alphabetically thermal/drivers/thermal_helpers: Include export.h thermal/drivers/thermal_helpers: Sort headers alphabetically thermal/core: Replace module.h with export.h ... commit b65ce380b754e77fbfdcfc83fd6e29c8ceedf431 Author: Cong Wang Date: Fri Jun 12 00:16:55 2020 -0700 genetlink: clean up family attributes allocations genl_family_rcv_msg_attrs_parse() and genl_family_rcv_msg_attrs_free() take a boolean parameter to determine whether allocate/free the family attrs. This is unnecessary as we can just check family->parallel_ops. More importantly, callers would not need to worry about pairing these parameters correctly after this patch. And this fixes a memory leak, as after commit c36f05559104 ("genetlink: fix memory leaks in genl_family_rcv_msg_dumpit()") we call genl_family_rcv_msg_attrs_parse() for both parallel and non-parallel cases. Fixes: c36f05559104 ("genetlink: fix memory leaks in genl_family_rcv_msg_dumpit()") Reported-by: Ido Schimmel Signed-off-by: Cong Wang Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: David S. Miller commit 44ebe016df3aad96e3be8f95ec52397728dd7701 Merge: 9433a51ec153 ef1548adada5 Author: Linus Torvalds Date: Fri Jun 12 12:38:18 2020 -0700 Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull proc fix from Eric Biederman: "Much to my surprise syzbot found a very old bug in proc that the recent changes made easier to reproce. This bug is subtle enough it looks like it fooled everyone who should know better" * 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: proc: Use new_inode not new_inode_pseudo commit 0bf3924bfabd13ba21aa702344fc00b3b3263e5a Author: Thomas Gleixner Date: Fri Jun 12 15:55:00 2020 +0200 x86/entry: Force rcu_irq_enter() when in idle task The idea of conditionally calling into rcu_irq_enter() only when RCU is not watching turned out to be not completely thought through. Paul noticed occasional premature end of grace periods in RCU torture testing. Bisection led to the commit which made the invocation of rcu_irq_enter() conditional on !rcu_is_watching(). It turned out that this conditional breaks RCU assumptions about the idle task when the scheduler tick happens to be a nested interrupt. Nested interrupts can happen when the first interrupt invokes softirq processing on return which enables interrupts. If that nested tick interrupt does not invoke rcu_irq_enter() then the RCU's irq-nesting checks will believe that this interrupt came directly from idle, which will cause RCU to report a quiescent state. Because this interrupt instead came from a softirq handler which might have been executing an RCU read-side critical section, this can cause the grace period to end prematurely. Change the condition from !rcu_is_watching() to is_idle_task(current) which enforces that interrupts in the idle task unconditionally invoke rcu_irq_enter() independent of the RCU state. This is also correct vs. user mode entries in NOHZ full scenarios because user mode entries bring RCU out of EQS and force the RCU irq nesting state accounting to nested. As only the first interrupt can enter from user mode a nested tick interrupt will enter from kernel mode and as the nesting state accounting is forced to nesting it will not do anything stupid even if rcu_irq_enter() has not been invoked. Fixes: 3eeec3858488 ("x86/entry: Provide idtentry_entry/exit_cond_rcu()") Reported-by: "Paul E. McKenney" Signed-off-by: Thomas Gleixner Tested-by: "Paul E. McKenney" Reviewed-by: "Paul E. McKenney" Acked-by: Andy Lutomirski Acked-by: Frederic Weisbecker Link: https://lkml.kernel.org/r/87wo4cxubv.fsf@nanos.tec.linutronix.de commit 9433a51ec1533e0620ff08d0318d215de73ceb77 Merge: 8f02f363f76f f5641d053d46 Author: Linus Torvalds Date: Fri Jun 12 12:24:42 2020 -0700 Merge tag 'pwm/for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "Nothing too exciting for this cycle. A couple of fixes across the board, and Lee volunteered to help with patch review" * tag 'pwm/for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: Add missing "CONFIG_" prefix MAINTAINERS: Add Lee Jones as reviewer for the PWM subsystem pwm: imx27: Fix rounding behavior pwm: rockchip: Simplify rockchip_pwm_get_state() pwm: img: Call pm_runtime_put() in pm_runtime_get_sync() failed case pwm: tegra: Support dynamic clock frequency configuration pwm: jz4740: Add support for the JZ4725B pwm: jz4740: Make PWM start with the active part pwm: jz4740: Enhance precision in calculation of duty cycle pwm: jz4740: Drop dependency on MACH_INGENIC pwm: lpss: Fix get_state runtime-pm reference handling pwm: sun4i: Support direct clock output on Allwinner A64 pwm: Add support for Azoteq IQS620A PWM generator dt-bindings: pwm: rcar: add r8a77961 support pwm: Add missing '\n' in log messages commit 8f02f363f76f99f08117336cfac7f24c76b25be3 Merge: 5c2fb57af0f4 672cf6df9b8a Author: Linus Torvalds Date: Fri Jun 12 12:19:13 2020 -0700 Merge tag 'iommu-drivers-move-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu driver directory structure cleanup from Joerg Roedel: "Move the Intel and AMD IOMMU drivers into their own subdirectory. Both drivers consist of several files by now and giving them their own directory unclutters the IOMMU top-level directory a bit" * tag 'iommu-drivers-move-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Move Intel IOMMU driver into subdirectory iommu/amd: Move AMD IOMMU driver into subdirectory commit 5c2fb57af0f42550eb718a3b0b445c81ec923895 Merge: 923ea1631e94 2a9e5ded9543 Author: Linus Torvalds Date: Fri Jun 12 12:13:36 2020 -0700 Merge tag 'printk-for-5.8-kdb-nmi' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk fix from Petr Mladek: "One more printk change for 5.8: make sure that messages printed from KDB context are redirected to KDB console handlers. It did not work when KDB interrupted NMI or printk_safe contexts. Arm people started hitting this problem more often recently. I forgot to add the fix into the previous pull request by mistake" * tag 'printk-for-5.8-kdb-nmi' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk/kdb: Redirect printk messages into kdb in any context commit ef1548adada51a2f32ed7faef50aa465e1b4c5da Author: Eric W. Biederman Date: Fri Jun 12 09:42:03 2020 -0500 proc: Use new_inode not new_inode_pseudo Recently syzbot reported that unmounting proc when there is an ongoing inotify watch on the root directory of proc could result in a use after free when the watch is removed after the unmount of proc when the watcher exits. Commit 69879c01a0c3 ("proc: Remove the now unnecessary internal mount of proc") made it easier to unmount proc and allowed syzbot to see the problem, but looking at the code it has been around for a long time. Looking at the code the fsnotify watch should have been removed by fsnotify_sb_delete in generic_shutdown_super. Unfortunately the inode was allocated with new_inode_pseudo instead of new_inode so the inode was not on the sb->s_inodes list. Which prevented fsnotify_unmount_inodes from finding the inode and removing the watch as well as made it so the "VFS: Busy inodes after unmount" warning could not find the inodes to warn about them. Make all of the inodes in proc visible to generic_shutdown_super, and fsnotify_sb_delete by using new_inode instead of new_inode_pseudo. The only functional difference is that new_inode places the inodes on the sb->s_inodes list. I wrote a small test program and I can verify that without changes it can trigger this issue, and by replacing new_inode_pseudo with new_inode the issues goes away. Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/000000000000d788c905a7dfa3f4@google.com Reported-by: syzbot+7d2debdcdb3cb93c1e5e@syzkaller.appspotmail.com Fixes: 0097875bd415 ("proc: Implement /proc/thread-self to point at the directory of the current thread") Fixes: 021ada7dff22 ("procfs: switch /proc/self away from proc_dir_entry") Fixes: 51f0885e5415 ("vfs,proc: guarantee unique inodes in /proc") Signed-off-by: "Eric W. Biederman" commit 6c58f25e6938c073198af8b1e1832f83f8f0df33 Author: Nathan Huckleberry Date: Thu Jun 11 18:32:35 2020 +0000 riscv/atomic: Fix sign extension for RV64I The argument passed to cmpxchg is not guaranteed to be sign extended, but lr.w sign extends on RV64I. This makes cmpxchg fail on clang built kernels when __old is negative. To fix this, we just cast __old to long which sign extends on RV64I. With this fix, clang built RISC-V kernels now boot. Link: https://github.com/ClangBuiltLinux/linux/issues/867 Signed-off-by: Nathan Huckleberry Signed-off-by: Palmer Dabbelt commit 923ea1631e942f8af179ca418e0cc1915025e4c2 Merge: 4071b856afc8 4235b1a4efe1 Author: Linus Torvalds Date: Fri Jun 12 12:02:41 2020 -0700 Merge tag 'integrity-v5.8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity fix from Mimi Zohar: "ima mprotect performance fix" * tag 'integrity-v5.8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: fix mprotect checking commit 4071b856afc8a49ec41e98ff45151bb0800bc46d Merge: 7de26c41c19f 8440d4a75d90 Author: Linus Torvalds Date: Fri Jun 12 11:56:43 2020 -0700 Merge tag 'devicetree-fixes-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull Devicetree fixes from Rob Herring: - Another round of whack-a-mole removing 'allOf', redundant cases of 'maxItems' and incorrect 'reg' sizes - Fix support for yaml.h in non-standard paths * tag 'devicetree-fixes-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: Remove redundant 'maxItems' dt-bindings: Fix more incorrect 'reg' property sizes in examples dt-bindings: phy: qcom: Fix missing 'ranges' and example addresses dt-bindings: Remove more cases of 'allOf' containing a '$ref' scripts/dtc: use pkg-config to include in non-standard path commit 7de26c41c19fc7b2e078d31fd039e1a017064b89 Merge: 52cd0d972fa6 6b57fa4d374b Author: Linus Torvalds Date: Fri Jun 12 11:55:11 2020 -0700 Merge tag 'nios2-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 Pull nios2 update from Ley Foon Tan: "Mark expected switch fall-through in signal handling" * tag 'nios2-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: signal: Mark expected switch fall-through commit 7b97d868b7ab2448859668de9222b8af43f76e78 Author: zhangyi (F) Date: Tue Jun 9 15:35:40 2020 +0800 ext4, jbd2: ensure panic by fix a race between jbd2 abort and ext4 error handlers In the ext4 filesystem with errors=panic, if one process is recording errno in the superblock when invoking jbd2_journal_abort() due to some error cases, it could be raced by another __ext4_abort() which is setting the SB_RDONLY flag but missing panic because errno has not been recorded. jbd2_journal_commit_transaction() jbd2_journal_abort() journal->j_flags |= JBD2_ABORT; jbd2_journal_update_sb_errno() | ext4_journal_check_start() | __ext4_abort() | sb->s_flags |= SB_RDONLY; | if (!JBD2_REC_ERR) | return; journal->j_flags |= JBD2_REC_ERR; Finally, it will no longer trigger panic because the filesystem has already been set read-only. Fix this by introduce j_abort_mutex to make sure journal abort is completed before panic, and remove JBD2_REC_ERR flag. Fixes: 4327ba52afd03 ("ext4, jbd2: ensure entering into panic after recording an error in superblock") Signed-off-by: zhangyi (F) Reviewed-by: Jan Kara Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200609073540.3810702-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit a6603398278480aafef644d4c40549b5c5064c73 Author: Steve French Date: Fri Jun 12 10:36:37 2020 -0500 cifs: fix chown and chgrp when idsfromsid mount option enabled idsfromsid was ignored in chown and chgrp causing it to fail when upcalls were not configured for lookup. idsfromsid allows mapping users when setting user or group ownership using "special SID" (reserved for this). Add support for chmod and chgrp when idsfromsid mount option is enabled. Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 975221eca5fbfdb4b6b1d17c9e540d4d7627ce18 Author: Steve French Date: Fri Jun 12 09:25:21 2020 -0500 smb3: allow uid and gid owners to be set on create with idsfromsid mount option Currently idsfromsid mount option allows querying owner information from the special sids used to represent POSIX uids and gids but needed changes to populate the security descriptor context with the owner information when idsfromsid mount option was used. Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 52cd0d972fa6491928add05f11f97a4a59babe92 Merge: d2d5439df22f 49b3deaad345 Author: Linus Torvalds Date: Fri Jun 12 11:05:52 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull more KVM updates from Paolo Bonzini: "The guest side of the asynchronous page fault work has been delayed to 5.9 in order to sync with Thomas's interrupt entry rework, but here's the rest of the KVM updates for this merge window. MIPS: - Loongson port PPC: - Fixes ARM: - Fixes x86: - KVM_SET_USER_MEMORY_REGION optimizations - Fixes - Selftest fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (62 commits) KVM: x86: do not pass poisoned hva to __kvm_set_memory_region KVM: selftests: fix sync_with_host() in smm_test KVM: async_pf: Inject 'page ready' event only if 'page not present' was previously injected KVM: async_pf: Cleanup kvm_setup_async_pf() kvm: i8254: remove redundant assignment to pointer s KVM: x86: respect singlestep when emulating instruction KVM: selftests: Don't probe KVM_CAP_HYPERV_ENLIGHTENED_VMCS when nested VMX is unsupported KVM: selftests: do not substitute SVM/VMX check with KVM_CAP_NESTED_STATE check KVM: nVMX: Consult only the "basic" exit reason when routing nested exit KVM: arm64: Move hyp_symbol_addr() to kvm_asm.h KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts KVM: arm64: Remove host_cpu_context member from vcpu structure KVM: arm64: Stop sparse from moaning at __hyp_this_cpu_ptr KVM: arm64: Handle PtrAuth traps early KVM: x86: Unexport x86_fpu_cache and make it static KVM: selftests: Ignore KVM 5-level paging support for VM_MODE_PXXV48_4K KVM: arm64: Save the host's PtrAuth keys in non-preemptible context KVM: arm64: Stop save/restoring ACTLR_EL1 KVM: arm64: Add emulation for 32bit guests accessing ACTLR2 ... commit d2d5439df22f3c2a07c5db582d4ef1b2b587ca27 Merge: b791d1bdf921 a952f64d14e5 Author: Linus Torvalds Date: Fri Jun 12 11:00:45 2020 -0700 Merge tag 'for-linus-5.8b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - several smaller cleanups - a fix for a Xen guest regression with CPU offlining - a small fix in the xen pvcalls backend driver - an update of MAINTAINERS * tag 'for-linus-5.8b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: MAINTAINERS: Update PARAVIRT_OPS_INTERFACE and VMWARE_HYPERVISOR_INTERFACE xen/pci: Get rid of verbose_request and use dev_dbg() instead xenbus: Use dev_printk() when possible xen-pciback: Use dev_printk() when possible xen: enable BALLOON_MEMORY_HOTPLUG by default xen: expand BALLOON_MEMORY_HOTPLUG description xen/pvcalls: Make pvcalls_back_global static xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests xen-platform: Constify dev_pm_ops xen/pvcalls-back: test for errors when calling backend_connect() commit 88ee9d571b6d8ed345f877e05f685814412e359b Author: Jan (janneke) Nieuwenhuizen Date: Mon May 25 21:39:40 2020 +0200 ext4: support xattr gnu.* namespace for the Hurd The Hurd gained[0] support for moving the translator and author fields out of the inode and into the "gnu.*" xattr namespace. In anticipation of that, an xattr INDEX was reserved[1]. The Hurd has now been brought into compliance[2] with that. This patch adds support for reading and writing such attributes from Linux; you can now do something like mkdir -p hurd-root/servers/socket touch hurd-root/servers/socket/1 setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' \ hurd-root/servers/socket/1 getfattr --name=gnu.translator hurd-root/servers/socket/1 # file: 1 gnu.translator="/hurd/pflocal" to setup a pipe translator, which is being used to create[3] a vm-image for the Hurd from GNU Guix. [0] https://summerofcode.withgoogle.com/projects/#5869799859027968 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a [2] https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=a04c7bf83172faa7cb080fbe3b6c04a8415ca645 [3] https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-hurd-vm Signed-off-by: Jan Nieuwenhuizen Link: https://lore.kernel.org/r/20200525193940.878-1-janneke@gnu.org Signed-off-by: Theodore Ts'o commit 8440d4a75d90556cfb8fb3e244443f67381aafd6 Merge: f8d8b46cd20e 447615701525 Author: Rob Herring Date: Fri Jun 12 09:57:00 2020 -0600 Merge branch 'dt/schema-cleanups' into dt/linus commit 447615701525c910a386a491a6780dec4971f797 Author: Rob Herring Date: Thu Jun 11 11:25:04 2020 -0600 dt-bindings: Remove redundant 'maxItems' There's no need to specify 'maxItems' with the same value as the number of entries in 'items'. A meta-schema update will catch future cases. Cc: Shawn Guo Cc: Sascha Hauer Cc: Anson Huang Cc: linux-clk@vger.kernel.org Cc: linux-pwm@vger.kernel.org Cc: linux-usb@vger.kernel.org Reviewed-by: Stephen Boyd # clk Acked-by: Thierry Reding Signed-off-by: Rob Herring commit 3003055f50663095472144994dac0339076031a8 Author: Pablo Neira Ayuso Date: Wed Jun 10 19:29:16 2020 +0200 netfilter: nf_tables: hook list memleak in flowtable deletion After looking up for the flowtable hooks that need to be removed, release the hook objects in the deletion list. The error path needs to released these hook objects too. Fixes: abadb2f865d7 ("netfilter: nf_tables: delete devices from flowtable") Reported-by: syzbot+eb9d5924c51d6d59e094@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso commit 4235b1a4efe19dd0309250170bbf0aa95e559626 Author: Mimi Zohar Date: Wed Jun 10 09:18:26 2020 -0400 ima: fix mprotect checking Make sure IMA is enabled before checking mprotect change. Addresses report of a 3.7% regression of boot-time.dhcp. Fixes: 8eb613c0b8f1 ("ima: verify mprotect change is consistent with mmap policy") Reported-by: kernel test robot Reviewed-by: Lakshmi Ramasubramanian Tested-by: Xing Zhengjun Signed-off-by: Mimi Zohar commit 92919679d31721381e3c376488477efe49b915f3 Author: Matti Vaittinen Date: Fri Jun 12 12:23:17 2020 +0300 regulator: Fix pickable ranges mapping Pickable ranges mapping function never used range min selector. Thus existing drivers broke when proper linear_ranges functionality was taken in use. Fix this for now just by ignoring the minimum selector. Fixes: 60ab7f4153b6 ("regulator: use linear_ranges helper") Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/20200612090225.GA3243@localhost.localdomain Signed-off-by: Mark Brown commit d7442ba13d62de9afc4e57344a676f9f4623dcaa Author: Martin Fuzzey Date: Fri Jun 12 12:50:33 2020 +0200 regulator: da9063: fix LDO9 suspend and warning. Commit 99f75ce66619 ("regulator: da9063: fix suspend") converted the regulators to use a common (corrected) suspend bit setting but one of regulators (LDO9) slipped through the crack. This means that the original problem was not fixed for LDO9 and also leads to a warning found by the test robot. da9063-regulator.c:515:3: warning: initialized field overwritten Fix this by converting that regulator too like the others. Fixes: 99f75ce66619 ("regulator: da9063: fix suspend") Reported-by: kernel test robot Signed-off-by: Martin Fuzzey Link: https://lore.kernel.org/r/1591959073-16792-1-git-send-email-martin.fuzzey@flowbird.group Signed-off-by: Mark Brown commit e4bd7c4a8d2a8471d821dd29919378d1b8567091 Author: Steve French Date: Thu Jun 11 23:02:33 2020 -0500 smb311: Add tracepoints for new compound posix query info Add dynamic tracepoints for new SMB3.1.1. posix extensions query info level (100) Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit d313852d7ad044476df7f640801aac17080e0521 Author: Steve French Date: Thu Jun 11 22:43:01 2020 -0500 smb311: add support for using info level for posix extensions query Adds calls to the newer info level for query info using SMB3.1.1 posix extensions. The remaining two places that call the older query info (non-SMB3.1.1 POSIX) require passing in the fid and can be updated in a later patch. Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit b287a6d9723c601dd947f1c27d4cc0192e384a5a Author: Shengjiu Wang Date: Fri Jun 12 15:37:51 2020 +0800 ASoC: fsl_asrc_dma: Fix data copying speed issue with EDMA With EDMA, there is two dma channels can be used for dev_to_dev, one is from ASRC, one is from another peripheral (ESAI or SAI). If we select the dma channel of ASRC, there is an issue for ideal ratio case, the speed of copy data is faster than sample frequency, because ASRC output data is very fast in ideal ratio mode. So it is reasonable to use the dma channel of Back-End peripheral. then copying speed of DMA is controlled by data consumption speed in the peripheral FIFO, Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/424ed6c249bafcbe30791c9de0352821c5ea67e2.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 706e2c8811585f42612b6cff218ab3adbe63a4ee Author: Shengjiu Wang Date: Fri Jun 12 15:37:50 2020 +0800 ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-End The dma channel has been requested by Back-End cpu dai driver already. If fsl_asrc_dma requests dma chan with same dma:tx symlink, then there will be below warning with SDMA. [ 48.174236] fsl-esai-dai 2024000.esai: Cannot create DMA dma:tx symlink So if we can reuse the dma channel of Back-End, then the issue can be fixed. In order to get the dma channel which is already requested in Back-End. we use the exported two functions (snd_soc_lookup_component_nolocked and soc_component_to_pcm). If we can get the dma channel, then reuse it, if can't, then request a new one. Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/3a79f0442cb4930c633cf72145cfe95a45b9c78e.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit a9a21e1eafc94b79502cab8272b392f7f63ef7bb Author: Shengjiu Wang Date: Fri Jun 12 15:37:49 2020 +0800 ASoC: dmaengine_pcm: export soc_component_to_pcm In DPCM case, Front-End needs to get the dma chan which has been requested by Back-End and reuse it. Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/429c6ae1f3c5b47eb893f475d531d71cdcfe34c0.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 6fbea6b6a838f9aa941fe53a3637fd8d8aab1eba Author: Shengjiu Wang Date: Fri Jun 12 15:37:48 2020 +0800 ASoC: soc-card: export snd_soc_lookup_component_nolocked snd_soc_lookup_component_nolocked can be used for the DPCM case that Front-End needs to get the unused platform component but added by Back-End cpu dai driver. If the component is gotten, then we can get the dma chan created by Back-End component and reused it in Front-End. Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/55f6e0d76f67a517b9a44136d790ff2a06b5caa8.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit e7585db1b0b5b4e4eb1967bb1472df308f7ffcbf Author: Laurence Tratt Date: Fri Jun 12 12:18:07 2020 +0100 ALSA: usb-audio: Add implicit feedback quirk for SSL2+. This uses the same quirk as the Motu M2 and M4 to ensure the driver uses the audio interface's clock. Tested on an SSL2+. Signed-off-by: Laurence Tratt Cc: Link: https://lore.kernel.org/r/20200612111807.dgnig6rwhmsl2bod@overdrive.tratt.net Signed-off-by: Takashi Iwai commit 71ed49d8fb33023f242419a77ecb1141c029cac4 Author: Thomas Gleixner Date: Fri Jun 12 14:02:27 2020 +0200 x86/entry: Make NMI use IDTENTRY_RAW For no reason other than beginning brainmelt, IDTENTRY_NMI was mapped to IDTENTRY_IST. This is not a problem on 64bit because the IST default entry point maps to IDTENTRY_RAW which does not any entry handling. The surplus function declaration for the noist C entry point is unused and as there is no ASM code emitted for NMI this went unnoticed. On 32bit IDTENTRY_IST maps to a regular IDTENTRY which does the normal entry handling. That is clearly the wrong thing to do for NMI. Map it to IDTENTRY_RAW to unbreak it. The IDTENTRY_NMI mapping needs to stay to avoid emitting ASM code. Fixes: 6271fef00b34 ("x86/entry: Convert NMI to IDTENTRY_NMI") Reported-by: Naresh Kamboju Debugged-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/CA+G9fYvF3cyrY+-iw_SZtpN-i2qA2BruHg4M=QYECU2-dNdsMw@mail.gmail.com commit 790434ff9848a4d44f067a6a5416b49a2db89a59 Author: Steve French Date: Thu Jun 11 22:28:49 2020 -0500 smb311: Add support for lookup with posix extensions query info Improve support for lookup when using SMB3.1.1 posix mounts. Use new info level 100 (posix query info) Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit b1bc1874b885683df5da9d9548ca66dfc0e407f2 Author: Steve French Date: Thu Jun 11 20:23:38 2020 -0500 smb311: Add support for SMB311 query info (non-compounded) Add worker function for non-compounded SMB3.1.1 POSIX Extensions query info. This is needed for revalidate of root (cached) directory for example. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Aurelien Aptel commit 6a5f6592a0b606eac3147f786c958f1696c337f3 Author: Steve French Date: Thu Jun 11 19:25:47 2020 -0500 SMB311: Add support for query info using posix extensions (level 100) Adds support for better query info on dentry revalidation (using the SMB3.1.1 POSIX extensions level 100). Followon patch will add support for translating the UID/GID from the SID and also will add support for using the posix query info on lookup. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Aurelien Aptel commit ebf57440ec59a36e1fc5fe91e31d66ae0d1662d0 Author: Namjae Jeon Date: Thu Jun 11 11:21:19 2020 +0900 smb3: add indatalen that can be a non-zero value to calculation of credit charge in smb2 ioctl Some of tests in xfstests failed with cifsd kernel server since commit e80ddeb2f70e. cifsd kernel server validates credit charge from client by calculating it base on max((InputCount + OutputCount) and (MaxInputResponse + MaxOutputResponse)) according to specification. MS-SMB2 specification describe credit charge calculation of smb2 ioctl : If Connection.SupportsMultiCredit is TRUE, the server MUST validate CreditCharge based on the maximum of (InputCount + OutputCount) and (MaxInputResponse + MaxOutputResponse), as specified in section 3.3.5.2.5. If the validation fails, it MUST fail the IOCTL request with STATUS_INVALID_PARAMETER. This patch add indatalen that can be a non-zero value to calculation of credit charge in SMB2_ioctl_init(). Fixes: e80ddeb2f70e ("smb3: fix incorrect number of credits when ioctl MaxOutputResponse > 64K") Cc: Stable Reviewed-by: Aurelien Aptel Cc: Steve French Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 15a416e8aaa758b5534f64a3972dae05275bc225 Author: Andy Lutomirski Date: Thu Jun 11 20:26:38 2020 -0700 x86/entry: Treat BUG/WARN as NMI-like entries BUG/WARN are cleverly optimized using UD2 to handle the BUG/WARN out of line in an exception fixup. But if BUG or WARN is issued in a funny RCU context, then the idtentry_enter...() path might helpfully WARN that the RCU context is invalid, which results in infinite recursion. Split the BUG/WARN handling into an nmi_enter()/nmi_exit() path in exc_invalid_op() to increase the chance to survive the experience. [ tglx: Make the declaration match the implementation ] Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/f8fe40e0088749734b4435b554f73eee53dcf7a8.1591932307.git.luto@kernel.org commit e881bfaf5a5f409390973e076333281465f2b0d9 Author: Alexey Kardashevskiy Date: Thu Jun 11 13:05:59 2020 +1000 KVM: PPC: Fix nested guest RC bits update Before commit 6cdf30375f82 ("powerpc/kvm/book3s: Use kvm helpers to walk shadow or secondary table") we called __find_linux_pte() with a page table pointer from a kvm_nested_guest struct but now we rely on kvmhv_find_nested() which takes an L1 LPID and returns a kvm_nested_guest pointer, however we pass a L0 LPID there and the L2 guest hangs. This fixes the LPID passed to kvmppc_hv_handle_set_rc(). Fixes: 6cdf30375f82 ("powerpc/kvm/book3s: Use kvm helpers to walk shadow or secondary table") Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200611030559.75257-1-aik@ozlabs.ru commit 6b57fa4d374bb8c005dee396c56598c14b9c01a6 Author: Ley Foon Tan Date: Fri Jun 12 14:04:49 2020 +0800 nios2: signal: Mark expected switch fall-through Mark switch cases where we are expecting to fall through. Fix the following warning through the use of the new the new pseudo-keyword fallthrough; arch/nios2/kernel/signal.c:254:12: warning: this statement may fall through [-Wimplicit-fallthrough=] 254 | restart = -2; | ~~~~~~~~^~~~ arch/nios2/kernel/signal.c:255:3: note: here 255 | case ERESTARTNOHAND: | ^~~~ Reported-by: Christian Brauner Signed-off-by: Gustavo A. R. Silva Signed-off-by: Ley Foon Tan commit 2e7ec6b5297157efabb50e5f82adc628cf90296c Author: Krishna Manikandan Date: Thu May 28 14:04:28 2020 +0530 drm/msm/dpu: allow initialization of encoder locks during encoder init In the current implementation, mutex initialization for encoder mutex locks are done during encoder setup. This can lead to scenarios where the lock is used before it is initialized. Move mutex_init to dpu_encoder_init to avoid this. Signed-off-by: Krishna Manikandan Signed-off-by: Rob Clark commit aa472721c8dbe1713cf510f56ffbc56ae9e14247 Author: Chen Tao Date: Mon Jun 8 09:48:59 2020 +0800 drm/msm/dpu: fix error return code in dpu_encoder_init Fix to return negative error code -ENOMEM with the use of ERR_PTR from dpu_encoder_init. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Chen Tao Signed-off-by: Rob Clark commit 177d3819633cd520e3f95df541a04644aab4c657 Author: Bernard Zhao Date: Fri Jun 12 09:23:49 2020 +0800 drm/msm: fix potential memleak in error branch In function msm_submitqueue_create, the queue is a local variable, in return -EINVAL branch, queue didn`t add to ctx`s list yet, and also didn`t kfree, this maybe bring in potential memleak. Signed-off-by: Bernard Zhao [trivial commit msg fixup] Signed-off-by: Rob Clark commit 5fddd4f5db873035cbf916495e8a8769f77673bc Author: Kalyan Thota Date: Thu Jun 11 18:25:15 2020 +0530 drm/msm/dpu: request for display color blocks based on hw catalog entry Request for color processing blocks only if they are available in the display hw catalog and they are sufficient in number for the selection. Signed-off-by: Kalyan Thota Fixes: e47616df008b ("drm/msm/dpu: add support for color processing Tested-by: John Stultz Signed-off-by: Rob Clark commit b791d1bdf9212d944d749a5c7ff6febdba241771 Merge: 9716e57a0195 1f44328ea24c Author: Linus Torvalds Date: Thu Jun 11 18:55:43 2020 -0700 Merge tag 'locking-kcsan-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull the Kernel Concurrency Sanitizer from Thomas Gleixner: "The Kernel Concurrency Sanitizer (KCSAN) is a dynamic race detector, which relies on compile-time instrumentation, and uses a watchpoint-based sampling approach to detect races. The feature was under development for quite some time and has already found legitimate bugs. Unfortunately it comes with a limitation, which was only understood late in the development cycle: It requires an up to date CLANG-11 compiler CLANG-11 is not yet released (scheduled for June), but it's the only compiler today which handles the kernel requirements and especially the annotations of functions to exclude them from KCSAN instrumentation correctly. These annotations really need to work so that low level entry code and especially int3 text poke handling can be completely isolated. A detailed discussion of the requirements and compiler issues can be found here: https://lore.kernel.org/lkml/CANpmjNMTsY_8241bS7=XAfqvZHFLrVEkv_uM4aDUWE_kh3Rvbw@mail.gmail.com/ We came to the conclusion that trying to work around compiler limitations and bugs again would end up in a major trainwreck, so requiring a working compiler seemed to be the best choice. For Continous Integration purposes the compiler restriction is manageable and that's where most xxSAN reports come from. For a change this limitation might make GCC people actually look at their bugs. Some issues with CSAN in GCC are 7 years old and one has been 'fixed' 3 years ago with a half baken solution which 'solved' the reported issue but not the underlying problem. The KCSAN developers also ponder to use a GCC plugin to become independent, but that's not something which will show up in a few days. Blocking KCSAN until wide spread compiler support is available is not a really good alternative because the continuous growth of lockless optimizations in the kernel demands proper tooling support" * tag 'locking-kcsan-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (76 commits) compiler_types.h, kasan: Use __SANITIZE_ADDRESS__ instead of CONFIG_KASAN to decide inlining compiler.h: Move function attributes to compiler_types.h compiler.h: Avoid nested statement expression in data_race() compiler.h: Remove data_race() and unnecessary checks from {READ,WRITE}_ONCE() kcsan: Update Documentation to change supported compilers kcsan: Remove 'noinline' from __no_kcsan_or_inline kcsan: Pass option tsan-instrument-read-before-write to Clang kcsan: Support distinguishing volatile accesses kcsan: Restrict supported compilers kcsan: Avoid inserting __tsan_func_entry/exit if possible ubsan, kcsan: Don't combine sanitizer with kcov on clang objtool, kcsan: Add kcsan_disable_current() and kcsan_enable_current_nowarn() kcsan: Add __kcsan_{enable,disable}_current() variants checkpatch: Warn about data_race() without comment kcsan: Use GFP_ATOMIC under spin lock Improve KCSAN documentation a bit kcsan: Make reporting aware of KCSAN tests kcsan: Fix function matching in report kcsan: Change data_race() to no longer require marking racing accesses kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h ... commit 18dbd4cd9b8c957025cf90a3c50102b31bde14f7 Merge: c25cba3689c7 f330fda331d2 Author: David S. Miller Date: Thu Jun 11 18:39:08 2020 -0700 Merge branch 'net-ipa-endpoint-configuration-fixes' Alex Elder says: ==================== net: ipa: endpoint configuration fixes This series fixes four bugs in the configuration of IPA endpoints. See the description of each for more information. In this version I have dropped the last patch from the series, and restored a "static" keyword that had inadvertently gotten removed. ==================== Signed-off-by: David S. Miller commit f330fda331d276464baec8ba938d031b4adcf5c7 Author: Alex Elder Date: Thu Jun 11 14:48:33 2020 -0500 net: ipa: header pad field only valid for AP->modem endpoint Only QMAP endpoints should be configured to find a pad size field within packet headers. They are found in the first byte of the QMAP header (and the hardware fills only the 6 bits in that byte that constitute the pad_len field). The RMNet driver assumes the pad_len field is valid for received packets, so we want to ensure the pad_len field is filled in that case. That driver also assumes the length in the QMAP header includes the pad bytes. The RMNet driver does *not* pad the packets it sends, so the pad_len field can be ignored. Fix ipa_endpoint_init_hdr_ext() so it only marks the pad field offset valid for QMAP RX endpoints, and in that case indicates that the length field in the header includes the pad bytes. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 636edeaad5577b6023f0de2b98a010d1cea73607 Author: Alex Elder Date: Thu Jun 11 14:48:32 2020 -0500 net: ipa: program upper nibbles of sequencer type The upper two nibbles of the sequencer type were not used for SDM845, and were assumed to be 0. But for SC7180 they are used, and so they must be programmed by ipa_endpoint_init_seq(). Fix this bug. IPA_SEQ_PKT_PROCESS_NO_DEC_NO_UCP_DMAP doesn't have a descriptive comment, so add one. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 9b8ad8dab994f4cba682ca6110bda37f3dcd4b83 Author: Alex Elder Date: Thu Jun 11 14:48:31 2020 -0500 net: ipa: fix modem LAN RX endpoint id The endpoint id assigned to the modem LAN RX endpoint for the SC7180 SoC is incorrect. The erroneous value might have been copied from SDM845 and never updated. The correct endpoint id to use for this SoC is 11. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8730f45d1ca5ff60033f5ba022f32e5379d7bb89 Author: Alex Elder Date: Thu Jun 11 14:48:30 2020 -0500 net: ipa: program metadata mask differently The way the mask value is programmed for QMAP RX endpoints was based on some wrong assumptions about the way metadata containing the QMAP mux_id value is formatted. The metadata value supplied by the modem is *not* in QMAP format, and in fact contains the mux_id we want in its (big endian) low-order byte. That byte must be written by the IPA into offset 1 of the QMAP header it inserts before the received packet. QMAP TX endpoints *do* use a QMAP header as the metadata sent with each packet. The modem assumes this, and based on that assumes the mux_id is in the second byte. To match those assumptions we must program the modem TX (QMAP) endpoint HDR register to indicate the metadata will be found at offset 0 in the message header. The previous configuration managed to work, but it was not working correctly. This patch fixes a bug whose symptom was receipt of messages containing the wrong QMAP mux_id. In fixing this, get rid of ipa_rmnet_mux_id_metadata_mask(), which was more or less defined so there was a separate place to explain what was happening as we generated the mask value. Instead, put a longer description of how this works above ipa_endpoint_init_hdr(), and define the metadata mask to use as a simple constant. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 9716e57a0195dae356ae1425df121988abd27131 Merge: b1a62749946e 37f8173dd849 Author: Linus Torvalds Date: Thu Jun 11 18:27:19 2020 -0700 Merge tag 'locking-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull atomics rework from Thomas Gleixner: "Peter Zijlstras rework of atomics and fallbacks. This solves two problems: 1) Compilers uninline small atomic_* static inline functions which can expose them to instrumentation. 2) The instrumentation of atomic primitives was done at the architecture level while composites or fallbacks were provided at the generic level. As a result there are no uninstrumented variants of the fallbacks. Both issues were in the way of fully isolating fragile entry code pathes and especially the text poke int3 handler which is prone to an endless recursion problem when anything in that code path is about to be instrumented. This was always a problem, but got elevated due to the new batch mode updates of tracing. The solution is to mark the functions __always_inline and to flip the fallback and instrumentation so the non-instrumented variants are at the architecture level and the instrumentation is done in generic code. The latter introduces another fallback variant which will go away once all architectures have been moved over to arch_atomic_*" * tag 'locking-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/atomics: Flip fallbacks and instrumentation asm-generic/atomic: Use __always_inline for fallback wrappers commit c25cba3689c7ab5ae6ee7228d1d49a5652429229 Author: Shannon Nelson Date: Thu Jun 11 17:18:15 2020 -0700 ionic: add pcie_print_link_status Print the PCIe link information for our device. Fixes: 77f972a7077d ("ionic: remove support for mgmt device") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 3049f0fd3b7103b44208a068ac6a7e4ad7ebd883 Merge: 07007dbee468 8e3e4b9da7e6 Author: David S. Miller Date: Thu Jun 11 18:25:20 2020 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2020-06-11 This series contains fixes to the iavf driver. Brett fixes the supported link speeds in the iavf driver, which was only able to report speeds that the i40e driver supported and was missing the speeds supported by the ice driver. In addition, fix how 2.5 and 5.0 GbE speeds are reported. Alek fixes a enum comparison that was comparing two different enums that may have different values, so update the comparison to use matching enums. Paul increases the time to complete a reset to allow for 128 VFs to complete a reset. ==================== Signed-off-by: David S. Miller commit 07007dbee468389b7124bc2efb7241a93067d901 Merge: 2ad6691d988c 09a9297574cb Author: David S. Miller Date: Thu Jun 11 18:20:20 2020 -0700 Merge tag 'mlx5-fixes-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2020-06-11 This series introduces some fixes to mlx5 driver. For more information please see tag log below. Please pull and let me know if there is any problem. For -stable v5.2 ('net/mlx5: drain health workqueue in case of driver load error') For -stable v5.3 ('net/mlx5e: Fix repeated XSK usage on one channel') ('net/mlx5: Fix fatal error handling during device load') For -stable v5.5 ('net/mlx5: Disable reload while removing the device') For -stable v5.7 ('net/mlx5e: CT: Fix ipv6 nat header rewrite actions') ==================== Signed-off-by: David S. Miller commit b1a62749946ee1956a480ba31e7d4929aa561d30 Merge: b961f8dc8976 8449d150e66c Author: Linus Torvalds Date: Thu Jun 11 18:18:50 2020 -0700 Merge branch 'akpm' (patches from Andrew) Pull updates from Andrew Morton: "A few fixes and stragglers. Subsystems affected by this patch series: mm/memory-failure, ocfs2, lib/lzo, misc" * emailed patches from Andrew Morton : amdgpu: a NULL ->mm does not mean a thread is a kthread lib/lzo: fix ambiguous encoding bug in lzo-rle ocfs2: fix build failure when TCP/IP is disabled mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread mm/memory-failure: prioritize prctl(PR_MCE_KILL) over vm.memory_failure_early_kill commit 2ad6691d988c0c611362ddc2aad89e0fb50e3261 Author: David Howells Date: Thu Jun 11 21:57:00 2020 +0100 rxrpc: Fix race between incoming ACK parser and retransmitter There's a race between the retransmission code and the received ACK parser. The problem is that the retransmission loop has to drop the lock under which it is iterating through the transmission buffer in order to transmit a packet, but whilst the lock is dropped, the ACK parser can crank the Tx window round and discard the packets from the buffer. The retransmission code then updated the annotations for the wrong packet and a later retransmission thought it had to retransmit a packet that wasn't there, leading to a NULL pointer dereference. Fix this by: (1) Moving the annotation change to before we drop the lock prior to transmission. This means we can't vary the annotation depending on the outcome of the transmission, but that's fine - we'll retransmit again later if it failed now. (2) Skipping the packet if the skb pointer is NULL. The following oops was seen: BUG: kernel NULL pointer dereference, address: 000000000000002d Workqueue: krxrpcd rxrpc_process_call RIP: 0010:rxrpc_get_skb+0x14/0x8a ... Call Trace: rxrpc_resend+0x331/0x41e ? get_vtime_delta+0x13/0x20 rxrpc_process_call+0x3c0/0x4ac process_one_work+0x18f/0x27f worker_thread+0x1a3/0x247 ? create_worker+0x17d/0x17d kthread+0xe6/0xeb ? kthread_delayed_work_timer_fn+0x83/0x83 ret_from_fork+0x1f/0x30 Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells Signed-off-by: David S. Miller commit 8449d150e66c43fd9bfd77691a56327dfdccedd7 Author: Christoph Hellwig Date: Thu Jun 11 17:34:58 2020 -0700 amdgpu: a NULL ->mm does not mean a thread is a kthread Use the proper API instead. Fixes: 70539bd795002 ("drm/amd: Update MEC HQD loading code for KFD") Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Tested-by: Jens Axboe Reviewed-by: Felix Kuehling Reviewed-by: Jens Axboe Cc: Al Viro Cc: Alex Deucher Cc: Zhenyu Wang Cc: Zhi Wang Cc: Felipe Balbi Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Greg Kroah-Hartman Link: http://lkml.kernel.org/r/20200404094101.672954-1-hch@lst.de Link: http://lkml.kernel.org/r/20200404094101.672954-2-hch@lst.de Signed-off-by: Linus Torvalds commit b5265c813ce4efbfa2e46fd27cdf9a7f44a35d2e Author: Dave Rodgman Date: Thu Jun 11 17:34:54 2020 -0700 lib/lzo: fix ambiguous encoding bug in lzo-rle In some rare cases, for input data over 32 KB, lzo-rle could encode two different inputs to the same compressed representation, so that decompression is then ambiguous (i.e. data may be corrupted - although zram is not affected because it operates over 4 KB pages). This modifies the compressor without changing the decompressor or the bitstream format, such that: - there is no change to how data produced by the old compressor is decompressed - an old decompressor will correctly decode data from the updated compressor - performance and compression ratio are not affected - we avoid introducing a new bitstream format In testing over 12.8M real-world files totalling 903 GB, three files were affected by this bug. I also constructed 37M semi-random 64 KB files totalling 2.27 TB, and saw no affected files. Finally I tested over files constructed to contain each of the ~1024 possible bad input sequences; for all of these cases, updated lzo-rle worked correctly. There is no significant impact to performance or compression ratio. Signed-off-by: Dave Rodgman Signed-off-by: Andrew Morton Cc: Mark Rutland Cc: Dave Rodgman Cc: Willy Tarreau Cc: Sergey Senozhatsky Cc: Markus F.X.J. Oberhumer Cc: Minchan Kim Cc: Nitin Gupta Cc: Chao Yu Cc: Link: http://lkml.kernel.org/r/20200507100203.29785-1-dave.rodgman@arm.com Signed-off-by: Linus Torvalds commit fce1affe4e39b9ca8346bdbb5171e60ac303c355 Author: Tom Seewald Date: Thu Jun 11 17:34:51 2020 -0700 ocfs2: fix build failure when TCP/IP is disabled After commit 12abc5ee7873 ("tcp: add tcp_sock_set_nodelay") and commit c488aeadcbd0 ("tcp: add tcp_sock_set_user_timeout"), building the kernel with OCFS2_FS=y but without INET=y causes it to fail with: ld: fs/ocfs2/cluster/tcp.o: in function `o2net_accept_many': tcp.c:(.text+0x21b1): undefined reference to `tcp_sock_set_nodelay' ld: tcp.c:(.text+0x21c1): undefined reference to `tcp_sock_set_user_timeout' ld: fs/ocfs2/cluster/tcp.o: in function `o2net_start_connect': tcp.c:(.text+0x2633): undefined reference to `tcp_sock_set_nodelay' ld: tcp.c:(.text+0x2643): undefined reference to `tcp_sock_set_user_timeout' This is due to tcp_sock_set_nodelay() and tcp_sock_set_user_timeout() being declared in linux/tcp.h and defined in net/ipv4/tcp.c, which depend on TCP/IP being enabled. To fix this, make OCFS2_FS depend on INET=y which already requires NET=y. Fixes: 12abc5ee7873 ("tcp: add tcp_sock_set_nodelay") Fixes: c488aeadcbd0 ("tcp: add tcp_sock_set_user_timeout") Signed-off-by: Tom Seewald Signed-off-by: Andrew Morton Reviewed-by: Joseph Qi Acked-by: Christoph Hellwig Cc: Sagi Grimberg Cc: Jason Gunthorpe Cc: David S. Miller Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Link: http://lkml.kernel.org/r/20200606190827.23954-1-tseewald@gmail.com Signed-off-by: Linus Torvalds commit 03151c6e0b66c63c3e9980edf78c3a7a99801764 Author: Naoya Horiguchi Date: Thu Jun 11 17:34:48 2020 -0700 mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread Action Required memory error should happen only when a processor is about to access to a corrupted memory, so it's synchronous and only affects current process/thread. Recently commit 872e9a205c84 ("mm, memory_failure: don't send BUS_MCEERR_AO for action required error") fixed the issue that Action Required memory could unnecessarily send SIGBUS to the processes which share the error memory. But we still have another issue that we could send SIGBUS to a wrong thread. This is because collect_procs() and task_early_kill() fails to add the current process to "to-kill" list. So this patch is suggesting to fix it. With this fix, SIGBUS(BUS_MCEERR_AR) is never sent to non-current process/thread. Signed-off-by: Naoya Horiguchi Signed-off-by: Andrew Morton Acked-by: Tony Luck Acked-by: Pankaj Gupta Link: http://lkml.kernel.org/r/1591321039-22141-3-git-send-email-naoya.horiguchi@nec.com Signed-off-by: Linus Torvalds commit 4e018b450ad34b0edc865e91ec5e957d677e2c4e Author: Naoya Horiguchi Date: Thu Jun 11 17:34:45 2020 -0700 mm/memory-failure: prioritize prctl(PR_MCE_KILL) over vm.memory_failure_early_kill Patch series "hwpoison: fixes signaling on memory error" This is a small patchset to solve issues in memory error handler to send SIGBUS to proper process/thread as expected in configuration. Please see descriptions in individual patches for more details. This patch (of 2): Early-kill policy is controlled from two types of settings, one is per-process setting prctl(PR_MCE_KILL) and the other is system-wide setting vm.memory_failure_early_kill. Users expect per-process setting to override system-wide setting as many other settings do, but early-kill setting doesn't work as such. For example, if a system configures vm.memory_failure_early_kill to 1 (enabled), a process receives SIGBUS even if it's configured to explicitly disable PF_MCE_KILL by prctl(). That's not desirable for applications with their own policies. This patch is suggesting to change the priority of these two types of settings, by checking sysctl_memory_failure_early_kill only when a given process has the default kill policy. Note that this patch is solving a thread choice issue too. Originally, collect_procs() always chooses the main thread when vm.memory_failure_early_kill is 1, even if the process has a dedicated thread for memory error handling. SIGBUS should be sent to the dedicated thread if early-kill is enabled via vm.memory_failure_early_kill as we are doing for PR_MCE_KILL_EARLY processes. Signed-off-by: Naoya Horiguchi Signed-off-by: Andrew Morton Cc: Tony Luck Cc: Pankaj Gupta Link: http://lkml.kernel.org/r/1591321039-22141-1-git-send-email-naoya.horiguchi@nec.com Link: http://lkml.kernel.org/r/1591321039-22141-2-git-send-email-naoya.horiguchi@nec.com Signed-off-by: Linus Torvalds commit b961f8dc8976c091180839f4483d67b7c2ca2578 Merge: a58dfea29731 65a6543da386 Author: Linus Torvalds Date: Thu Jun 11 16:10:08 2020 -0700 Merge tag 'io_uring-5.8-2020-06-11' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "A few late stragglers in here. In particular: - Validate full range for provided buffers (Bijan) - Fix bad use of kfree() in buffer registration failure (Denis) - Don't allow close of ring itself, it's not fully safe. Making it fully safe would require making the system call more expensive, which isn't worth it. - Buffer selection fix - Regression fix for O_NONBLOCK retry - Make IORING_OP_ACCEPT honor O_NONBLOCK (Jiufei) - Restrict opcode handling for SQ/IOPOLL (Pavel) - io-wq work handling cleanups and improvements (Pavel, Xiaoguang) - IOPOLL race fix (Xiaoguang)" * tag 'io_uring-5.8-2020-06-11' of git://git.kernel.dk/linux-block: io_uring: fix io_kiocb.flags modification race in IOPOLL mode io_uring: check file O_NONBLOCK state for accept io_uring: avoid unnecessary io_wq_work copy for fast poll feature io_uring: avoid whole io_wq_work copy for requests completed inline io_uring: allow O_NONBLOCK async retry io_wq: add per-wq work handler instead of per work io_uring: don't arm a timeout through work.func io_uring: remove custom ->func handlers io_uring: don't derive close state from ->func io_uring: use kvfree() in io_sqe_buffer_register() io_uring: validate the full range of provided buffers for access io_uring: re-set iov base/len for buffer select retry io_uring: move send/recv IOPOLL check into prep io_uring: deduplicate io_openat{,2}_prep() io_uring: do build_open_how() only once io_uring: fix {SQ,IO}POLL with unsupported opcodes io_uring: disallow close of ring itself commit a58dfea29731a93339529ce48fe239b383011c7c Merge: b3597945c8a7 9a6a5738abf8 Author: Linus Torvalds Date: Thu Jun 11 16:07:33 2020 -0700 Merge tag 'block-5.8-2020-06-11' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Some followup fixes for this merge window. In particular: - Seqcount write missing preemption disable for stats (Ahmed) - blktrace fixes (Chaitanya) - Redundant initializations (Colin) - Various small NVMe fixes (Chaitanya, Christoph, Daniel, Max, Niklas, Rikard) - loop flag bug regression fix (Martijn) - blk-mq tagging fixes (Christoph, Ming)" * tag 'block-5.8-2020-06-11' of git://git.kernel.dk/linux-block: umem: remove redundant initialization of variable ret pktcdvd: remove redundant initialization of variable ret nvmet: fail outstanding host posted AEN req nvme-pci: use simple suspend when a HMB is enabled nvme-fc: don't call nvme_cleanup_cmd() for AENs nvmet-tcp: constify nvmet_tcp_ops nvme-tcp: constify nvme_tcp_mq_ops and nvme_tcp_admin_mq_ops nvme: do not call del_gendisk() on a disk that was never added blk-mq: fix blk_mq_all_tag_iter blk-mq: split out a __blk_mq_get_driver_tag helper blktrace: fix endianness for blk_log_remap() blktrace: fix endianness in get_pdu_int() blktrace: use errno instead of bi_status block: nr_sects_write(): Disable preemption on seqcount write block: remove the error argument to the block_bio_complete tracepoint loop: Fix wrong masking of status flags block/bio-integrity: don't free 'buf' if bio_integrity_add_page() failed commit b3597945c8a78bd1c4ad7e7ed4f972fdf78650f1 Author: David Howells Date: Thu Jun 11 21:50:24 2020 +0100 afs: Fix afs_store_data() to set mtime in new operation descriptor Fix afs_store_data() so that it sets the mtime in the new operation descriptor otherwise the mtime on the server gets set to 0 when a write is stored to the server. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Reported-by: Dave Botsch Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 6a45a65888393eda692fce0851c40d9f5ce4ef66 Merge: 92ac971219a2 7778d8417b74 Author: Linus Torvalds Date: Thu Jun 11 15:54:31 2020 -0700 Merge tag 'x86-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull more x86 updates from Thomas Gleixner: "A set of fixes and updates for x86: - Unbreak paravirt VDSO clocks. While the VDSO code was moved into lib for sharing a subtle check for the validity of paravirt clocks got replaced. While the replacement works perfectly fine for bare metal as the update of the VDSO clock mode is synchronous, it fails for paravirt clocks because the hypervisor can invalidate them asynchronously. Bring it back as an optional function so it does not inflict this on architectures which are free of PV damage. - Fix the jiffies to jiffies64 mapping on 64bit so it does not trigger an ODR violation on newer compilers - Three fixes for the SSBD and *IB* speculation mitigation maze to ensure consistency, not disabling of some *IB* variants wrongly and to prevent a rogue cross process shutdown of SSBD. All marked for stable. - Add yet more CPU models to the splitlock detection capable list !@#%$! - Bring the pr_info() back which tells that TSC deadline timer is enabled. - Reboot quirk for MacBook6,1" * tag 'x86-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/vdso: Unbreak paravirt VDSO clocks lib/vdso: Provide sanity check for cycles (again) clocksource: Remove obsolete ifdef x86_64: Fix jiffies ODR violation x86/speculation: PR_SPEC_FORCE_DISABLE enforcement for indirect branches. x86/speculation: Prevent rogue cross-process SSBD shutdown x86/speculation: Avoid force-disabling IBPB based on STIBP and enhanced IBRS. x86/cpu: Add Sapphire Rapids CPU model number x86/split_lock: Add Icelake microserver and Tigerlake CPU models x86/apic: Make TSC deadline timer detection message visible x86/reboot/quirks: Add MacBook6,1 reboot quirk commit 09a9297574cb10b3d9fe722b2baa9a379b2d289c Author: Dan Carpenter Date: Wed Jun 3 20:54:36 2020 +0300 net/mlx5: E-Switch, Fix some error pointer dereferences We can't leave "counter" set to an error pointer. Otherwise either it will lead to an error pointer dereference later in the function or it leads to an error pointer dereference when we call mlx5_fc_destroy(). Fixes: 07bab9502641d ("net/mlx5: E-Switch, Refactor eswitch ingress acl codes") Signed-off-by: Dan Carpenter Signed-off-by: Saeed Mahameed commit 17e73d47cd095154878dfedd4918d6a9482eba13 Author: Leon Romanovsky Date: Tue Jun 2 15:28:37 2020 +0300 net/mlx5: Don't fail driver on failure to create debugfs Clang warns: drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!priv->dbg_root) { ^~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/main.c:1303:9: note: uninitialized use occurs here return err; ^~~ drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:2: note: remove the 'if' if its condition is always false if (!priv->dbg_root) { ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/main.c:1259:9: note: initialize the variable 'err' to silence this warning int err; ^ = 0 1 warning generated. The check of returned value of debugfs_create_dir() is wrong because by the design debugfs failures should never fail the driver and the check itself was wrong too. The kernel compiled without CONFIG_DEBUG_FS will return ERR_PTR(-ENODEV) and not NULL as expected. Fixes: 11f3b84d7068 ("net/mlx5: Split mdev init and pci init") Link: https://github.com/ClangBuiltLinux/linux/issues/1042 Reported-by: Nathan Chancellor Signed-off-by: Leon Romanovsky Reviewed-by: Nathan Chancellor Signed-off-by: Saeed Mahameed commit 0d156f2deda8675c29fa2b8b5ed9b374370e47f2 Author: Oz Shlomo Date: Sun Jun 7 15:40:40 2020 +0000 net/mlx5e: CT: Fix ipv6 nat header rewrite actions Set the ipv6 word fields according to the hardware definitions. Fixes: ac991b48d43c ("net/mlx5e: CT: Offload established flows") Signed-off-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 98f91c45769302b26e781f949b07a90df3c5cbda Author: Parav Pandit Date: Fri May 15 02:44:06 2020 -0500 net/mlx5: Fix devlink objects and devlink device unregister sequence Current below problems exists. 1. devlink device is registered by mlx5_load_one(). But it is not unregistered by mlx5_unload_one(). This is incorrect. 2. Above issue leads to, When mlx5 PCI device is removed, currently devlink device is unregistered before devlink ports are unregistered in below ladder diagram. remove_one() mlx5_devlink_unregister() [..] devlink_unregister() <- ports are still registered! mlx5_unload_one() mlx5_unregister_device() mlx5_remove_device() mlx5e_remove() mlx5e_devlink_port_unregister() devlink_port_unregister() 3. Condition checking for registering and unregister device are not symmetric either in these routines. Hence, fix the sequence by having load and unload routines symmetric and in right order. i.e. (a) register devlink device followed by registering devlink ports (b) unregister devlink ports followed by devlink device Do this based on boot and cleanup flags instead of different conditions. Fixes: c6acd629eec7 ("net/mlx5e: Add support for devlink-port in non-representors mode") Fixes: f60f315d339e ("net/mlx5e: Register devlink ports for physical link, PCI PF, VFs") Signed-off-by: Parav Pandit Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 60904cd349abc98cb888fc28d1ca55a8e2cf87b3 Author: Parav Pandit Date: Thu May 14 05:12:56 2020 -0500 net/mlx5: Disable reload while removing the device While unregistration is in progress, user might be reloading the interface. This can race with unregistration in below flow which uses the resources which are getting disabled by reload flow. Hence, disable the devlink reloading first when removing the device. CPU0 CPU1 ---- ---- local_pci_remove() devlink_mutex remove_one() devlink_nl_cmd_reload() mlx5_unregister_device() devlink_reload() ops->reload_down() mlx5_unload_one() Fixes: 4383cfcc65e7 ("net/mlx5: Add devlink reload") Signed-off-by: Parav Pandit Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 5f1572e6178e47c3ace55ced187d93240952c9cd Author: Aya Levin Date: Sun May 17 12:45:52 2020 +0300 net/mlx5e: Fix ethtool hfunc configuration change Changing RX hash function requires rearranging of RQT internal indexes, the user isn't exposed to such changes and these changes do not affect the user configured indirection table. Rebuild RQ table on hfunc change. Fixes: bdfc028de1b3 ("net/mlx5e: Fix ethtool RX hash func configuration change") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 36d45fb9d2fdf348d778bfe73f0427db1c6f9bc7 Author: Maxim Mikityanskiy Date: Mon Jun 1 16:03:44 2020 +0300 net/mlx5e: Fix repeated XSK usage on one channel After an XSK is closed, the relevant structures in the channel are not zeroed. If an XSK is opened the second time on the same channel without recreating channels, the stray values in the structures will lead to incorrect operation of queues, which causes CQE errors, and the new socket doesn't work at all. This patch fixes the issue by explicitly zeroing XSK-related structs in the channel on XSK close. Note that those structs are zeroed on channel creation, and usually a configuration change (XDP program is set) happens on XSK open, which leads to recreating channels, so typical XSK usecases don't suffer from this issue. However, if XSKs are opened and closed on the same channel without removing the XDP program, this bug reproduces. Fixes: db05815b36cb ("net/mlx5e: Add XSK zero-copy support") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 47a357de2b6b706af3c9471d5042f9ba8907031e Author: Denis Efremov Date: Mon Jun 1 19:45:26 2020 +0300 net/mlx5: DR, Fix freeing in dr_create_rc_qp() Variable "in" in dr_create_rc_qp() is allocated with kvzalloc() and should be freed with kvfree(). Fixes: 297cccebdc5a ("net/mlx5: DR, Expose an internal API to issue RDMA operations") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov Signed-off-by: Saeed Mahameed commit b6e0b6bebe0732d5cac51f0791f269d2413b8980 Author: Shay Drory Date: Thu May 7 09:32:53 2020 +0300 net/mlx5: Fix fatal error handling during device load Currently, in case of fatal error during mlx5_load_one(), we cannot enter error state until mlx5_load_one() is finished, what can take several minutes until commands will get timeouts, because these commands can't be processed due to the fatal error. Fix it by setting dev->state as MLX5_DEVICE_STATE_INTERNAL_ERROR before requesting the lock. Fixes: c1d4d2e92ad6 ("net/mlx5: Avoid calling sleeping function by the health poll thread") Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 42ea9f1b5c625fad225d4ac96a7e757dd4199d9c Author: Shay Drory Date: Wed May 6 15:59:48 2020 +0300 net/mlx5: drain health workqueue in case of driver load error In case there is a work in the health WQ when we teardown the driver, in driver load error flow, the health work will try to read dev->iseg, which was already unmap in mlx5_pci_close(). Fix it by draining the health workqueue first thing in mlx5_pci_close(). Trace of the error: BUG: unable to handle page fault for address: ffffb5b141c18014 PF: supervisor read access in kernel mode PF: error_code(0x0000) - not-present page PGD 1fe95d067 P4D 1fe95d067 PUD 1fe95e067 PMD 1b7823067 PTE 0 Oops: 0000 [#1] SMP PTI CPU: 3 PID: 6755 Comm: kworker/u128:2 Not tainted 5.2.0-net-next-mlx5-hv_stats-over-last-worked-hyperv #1 Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 04/28/2016 Workqueue: mlx5_healtha050:00:02.0 mlx5_fw_fatal_reporter_err_work [mlx5_core] RIP: 0010:ioread32be+0x30/0x40 Code: 00 77 27 48 81 ff 00 00 01 00 76 07 0f b7 d7 ed 0f c8 c3 55 48 c7 c6 3b ee d5 9f 48 89 e5 e8 67 fc ff ff b8 ff ff ff ff 5d c3 <8b> 07 0f c8 c3 66 66 2e 0f 1f 84 00 00 00 00 00 48 81 fe ff ff 03 RSP: 0018:ffffb5b14c56fd78 EFLAGS: 00010292 RAX: ffffb5b141c18000 RBX: ffff8e9f78a801c0 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffff8e9f7ecd7628 RDI: ffffb5b141c18014 RBP: ffffb5b14c56fd90 R08: 0000000000000001 R09: 0000000000000000 R10: ffff8e9f372a2c30 R11: ffff8e9f87f4bc40 R12: ffff8e9f372a1fc0 R13: ffff8e9f78a80000 R14: ffffffffc07136a0 R15: ffff8e9f78ae6f20 FS: 0000000000000000(0000) GS:ffff8e9f7ecc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffb5b141c18014 CR3: 00000001c8f82006 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? mlx5_health_try_recover+0x4d/0x270 [mlx5_core] mlx5_fw_fatal_reporter_recover+0x16/0x20 [mlx5_core] devlink_health_reporter_recover+0x1c/0x50 devlink_health_report+0xfb/0x240 mlx5_fw_fatal_reporter_err_work+0x65/0xd0 [mlx5_core] process_one_work+0x1fb/0x4e0 ? process_one_work+0x16b/0x4e0 worker_thread+0x4f/0x3d0 kthread+0x10d/0x140 ? process_one_work+0x4e0/0x4e0 ? kthread_cancel_delayed_work_sync+0x20/0x20 ret_from_fork+0x1f/0x30 Modules linked in: nfsv3 rpcsec_gss_krb5 nfsv4 nfs fscache 8021q garp mrp stp llc ipmi_devintf ipmi_msghandler rpcrdma rdma_ucm ib_iser rdma_cm ib_umad iw_cm ib_ipoib libiscsi scsi_transport_iscsi ib_cm mlx5_ib ib_uverbs ib_core mlx5_core sb_edac crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 mlxfw crypto_simd cryptd glue_helper input_leds hyperv_fb intel_rapl_perf joydev serio_raw pci_hyperv pci_hyperv_mini mac_hid hv_balloon nfsd auth_rpcgss nfs_acl lockd grace sunrpc sch_fq_codel ip_tables x_tables autofs4 hv_utils hid_generic hv_storvsc ptp hid_hyperv hid hv_netvsc hyperv_keyboard pps_core scsi_transport_fc psmouse hv_vmbus i2c_piix4 floppy pata_acpi CR2: ffffb5b141c18014 ---[ end trace b12c5503157cad24 ]--- RIP: 0010:ioread32be+0x30/0x40 Code: 00 77 27 48 81 ff 00 00 01 00 76 07 0f b7 d7 ed 0f c8 c3 55 48 c7 c6 3b ee d5 9f 48 89 e5 e8 67 fc ff ff b8 ff ff ff ff 5d c3 <8b> 07 0f c8 c3 66 66 2e 0f 1f 84 00 00 00 00 00 48 81 fe ff ff 03 RSP: 0018:ffffb5b14c56fd78 EFLAGS: 00010292 RAX: ffffb5b141c18000 RBX: ffff8e9f78a801c0 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffff8e9f7ecd7628 RDI: ffffb5b141c18014 RBP: ffffb5b14c56fd90 R08: 0000000000000001 R09: 0000000000000000 R10: ffff8e9f372a2c30 R11: ffff8e9f87f4bc40 R12: ffff8e9f372a1fc0 R13: ffff8e9f78a80000 R14: ffffffffc07136a0 R15: ffff8e9f78ae6f20 FS: 0000000000000000(0000) GS:ffff8e9f7ecc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffb5b141c18014 CR3: 00000001c8f82006 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 in_atomic(): 0, irqs_disabled(): 1, pid: 6755, name: kworker/u128:2 INFO: lockdep is turned off. CPU: 3 PID: 6755 Comm: kworker/u128:2 Tainted: G D 5.2.0-net-next-mlx5-hv_stats-over-last-worked-hyperv #1 Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 04/28/2016 Workqueue: mlx5_healtha050:00:02.0 mlx5_fw_fatal_reporter_err_work [mlx5_core] Call Trace: dump_stack+0x63/0x88 ___might_sleep+0x10a/0x130 __might_sleep+0x4a/0x80 exit_signals+0x33/0x230 ? blocking_notifier_call_chain+0x16/0x20 do_exit+0xb1/0xc30 ? kthread+0x10d/0x140 ? process_one_work+0x4e0/0x4e0 Fixes: 52c368dc3da7 ("net/mlx5: Move health and page alloc init to mdev_init") Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 92ac971219a29336e466921156b16f8fa88d91aa Merge: 623f6dc593ea b91c8c42ffdd Author: Linus Torvalds Date: Thu Jun 11 15:36:28 2020 -0700 Merge tag 'timers-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Thomas Gleixner: "A small fix for the VDSO code to force inline __cvdso_clock_gettime_common() so the compiler can't generate horrible code" * tag 'timers-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: lib/vdso: Force inlining of __cvdso_clock_gettime_common() commit 8e3e4b9da7e62680668f6cf71742207758764458 Author: Paul Greenwalt Date: Fri Jun 5 10:09:46 2020 -0700 iavf: increase reset complete wait time With an increased number of VFs, it's possible to encounter the following issue during reset. iavf b8d4:00:02.0: Hardware reset detected iavf b8d4:00:02.0: Reset never finished (0) iavf b8d4:00:02.0: Reset task did not complete, VF disabled Increase the reset complete wait count to allow for 128 VFs to complete reset. Signed-off-by: Paul Greenwalt Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 18c012d922620bb35ff2ab6838f1269bc12cf647 Author: Brett Creeley Date: Fri Jun 5 10:09:45 2020 -0700 iavf: Fix reporting 2.5 Gb and 5Gb speeds Commit 4ae4916b5643 ("i40e: fix 'Unknown bps' in dmesg for 2.5Gb/5Gb speeds") added the ability for the PF to report 2.5 and 5Gb speeds, however, the iavf driver does not recognize those speeds as the values were not added there. Add the proper enums and values so that iavf can properly deal with those speeds. Fixes: 4ae4916b5643 ("i40e: fix 'Unknown bps' in dmesg for 2.5Gb/5Gb speeds") Signed-off-by: Brett Creeley Signed-off-by: Witold Fijalkowski Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 5071bda2947f61da0b1c271cf0b16be45c9b81e9 Author: Aleksandr Loktionov Date: Fri Jun 5 10:09:44 2020 -0700 iavf: use appropriate enum for comparison adapter->link_speed has type enum virtchnl_link_speed but our comparisons are against enum iavf_aq_link_speed. Though they are, currently, the same values, change the comparison to the matching enum virtchnl_link_speed since that may not always be the case. Signed-off-by: Aleksandr Loktionov Signed-off-by: Piotr Kwapulinski Signed-off-by: Tony Nguyen Signed-off-by: Jeff Kirsher commit e0ef26fbe2b0c62f42ba7667076dc38b693b6fb8 Author: Brett Creeley Date: Fri Jun 5 10:09:43 2020 -0700 iavf: fix speed reporting over virtchnl Link speeds are communicated over virtchnl using an enum virtchnl_link_speed. Currently, the highest link speed is 40Gbps which leaves us unable to reflect some speeds that an ice VF is capable of. This causes link speed to be misreported on the iavf driver. Allow for communicating link speeds using Mbps so that the proper speed can be reported for an ice VF. Moving away from the enum allows us to communicate future speed changes without requiring a new enum to be added. In order to support communicating link speeds over virtchnl in Mbps the following functionality was added: - Added u32 link_speed_mbps in the iavf_adapter structure. - Added the macro ADV_LINK_SUPPORT(_a) to determine if the VF driver supports communicating link speeds in Mbps. - Added the function iavf_get_vpe_link_status() to fill the correct link_status in the event_data union based on the ADV_LINK_SUPPORT(_a) macro. - Added the function iavf_set_adapter_link_speed_from_vpe() to determine whether or not to fill the u32 link_speed_mbps or enum virtchnl_link_speed link_speed field in the iavf_adapter structure based on the ADV_LINK_SUPPORT(_a) macro. - Do not free vf_res in iavf_init_get_resources() as vf_res will be accessed in iavf_get_link_ksettings(); memset to 0 instead. This memory is subsequently freed in iavf_remove(). Fixes: 7c710869d64e ("ice: Add handlers for VF netdevice operations") Signed-off-by: Brett Creeley Signed-off-by: Sergey Nemov Signed-off-by: Paul Greenwalt Signed-off-by: Tony Nguyen Signed-off-by: Jeff Kirsher commit 2c4779eff837f1035f6f9650d246905daadd9528 Author: Tobias Klauser Date: Thu Jun 11 12:33:41 2020 +0200 tools, bpftool: Exit on error in function codegen Currently, the codegen function might fail and return an error. But its callers continue without checking its return value. Since codegen can fail only in the unlikely case of the system running out of memory or the static template being malformed, just exit(-1) directly from codegen and make it void-returning. Suggested-by: Andrii Nakryiko Signed-off-by: Tobias Klauser Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200611103341.21532-1-tklauser@distanz.ch commit aa2cad0600ed2ca6a0ab39948d4db1666b6c962b Author: Li RongQing Date: Thu Jun 11 13:11:06 2020 +0800 xdp: Fix xsk_generic_xmit errno Propagate sock_alloc_send_skb error code, not set it to EAGAIN unconditionally, when fail to allocate skb, which might cause that user space unnecessary loops. Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Li RongQing Signed-off-by: Daniel Borkmann Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/1591852266-24017-1-git-send-email-lirongqing@baidu.com commit 623f6dc593eaf98b91916836785278eddddaacf8 Merge: 5cd221e837d6 37c54f9bd486 Author: Linus Torvalds Date: Thu Jun 11 13:25:53 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge some more updates from Andrew Morton: - various hotfixes and minor things - hch's use_mm/unuse_mm clearnups Subsystems affected by this patch series: mm/hugetlb, scripts, kcov, lib, nilfs, checkpatch, lib, mm/debug, ocfs2, lib, misc. * emailed patches from Andrew Morton : kernel: set USER_DS in kthread_use_mm kernel: better document the use_mm/unuse_mm API contract kernel: move use_mm/unuse_mm to kthread.c kernel: move use_mm/unuse_mm to kthread.c stacktrace: cleanup inconsistent variable type lib: test get_count_order/long in test_bitops.c mm: add comments on pglist_data zones ocfs2: fix spelling mistake and grammar mm/debug_vm_pgtable: fix kernel crash by checking for THP support lib: fix bitmap_parse() on 64-bit big endian archs checkpatch: correct check for kernel parameters doc nilfs2: fix null pointer dereference at nilfs_segctor_do_construct() lib/lz4/lz4_decompress.c: document deliberate use of `&' kcov: check kcov_softirq in kcov_remote_stop() scripts/spelling: add a few more typos khugepaged: selftests: fix timeout condition in wait_for_scan() commit 0db958b689ca98ec6b6ca20edfffbdc0c4b422ce Author: Rob Herring Date: Thu Jun 11 08:58:04 2020 -0600 dt-bindings: Fix more incorrect 'reg' property sizes in examples The examples template is a 'simple-bus' with a size of 1 cell for had between 2 and 4 cells which really only errors on I2C or SPI type devices with a single cell. The easiest fix in most cases is to change the 'reg' property to 1 cell for address and size. Cc: "Heiko Stübner" Cc: Ezequiel Garcia Cc: Mauro Carvalho Chehab Cc: Philipp Zabel Cc: Miquel Raynal Cc: Richard Weinberger Cc: "David S. Miller" Cc: Bjorn Andersson Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Liam Girdwood Cc: linux-rockchip@lists.infradead.org Cc: linux-media@vger.kernel.org Cc: linux-mtd@lists.infradead.org Cc: netdev@vger.kernel.org Cc: alsa-devel@alsa-project.org Acked-by: Mark Brown Signed-off-by: Rob Herring commit adb36a8203831e40494a92095dacd566b2ad4a69 Author: Aaron Plattner Date: Thu Jun 11 11:08:45 2020 -0700 ALSA: hda: Add NVIDIA codec IDs 9a & 9d through a0 to patch table These IDs are for upcoming NVIDIA chips with audio functions that are largely similar to the existing ones. Signed-off-by: Aaron Plattner Cc: Link: https://lore.kernel.org/r/20200611180845.39942-1-aplattner@nvidia.com Signed-off-by: Takashi Iwai commit 9ec051bf4470ee20505c3c1bca9dc441944de4df Author: Rodrigo Siqueira Date: Wed Apr 29 10:53:02 2020 -0400 drm/amd/display: Rework dsc to isolate FPU operations When we want to use float point operation on Linux we need to use within special kernel protection (`kernel_fpu_{begin,end}()`.), otherwise the kernel can clobber userspace FPU register state. For detecting these issues we use a tool named objtool (with -Ffa flags) to highlight the FPU problems, all warnings can be summed up as follows: ./tools/objtool/objtool check -Ffa drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o [..] dc/dsc/rc_calc.o: warning: objtool: get_qp_set()+0x2f8: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/rc_calc.o: warning: objtool: dsc_roundf()+0x5: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/rc_calc.o: warning: objtool: dsc_ceil()+0x5: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/rc_calc.o: warning: objtool: get_ofs_set()+0x3eb: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/rc_calc.o: warning: objtool: calc_rc_params()+0x3c: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/dc_dsc.o: warning: objtool: get_dsc_bandwidth_range.isra.0()+0x8d: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/dc_dsc.o: warning: objtool: setup_dsc_config()+0x2ef: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/rc_calc_dpi.o: warning: objtool:copy_pps_fields()+0xbb: FPU instruction outside of kernel_fpu_{begin,end}() [..] dc/dsc/rc_calc_dpi.o: warning: objtool: dscc_compute_dsc_parameters()+0x7b: FPU instruction outside of kernel_fpu_{begin,end}() This commit fixes the above issues by rework DSC as described: 1. Isolate all FPU operations in a single file; 2. Use FPU flags only in the file that handles FPU operations; 3. Isolate all functions that require float point operation in static functions; 4. Add a mid-layer function that does not use any float point operation, and that could be safely invoked in other parts of the code. 5. Keep float point operation under DC_FP_{START/END} macro. CC: Christian König CC: Alexander Deucher CC: Peter Zijlstra CC: Tony Cheng CC: Harry Wentland Signed-off-by: Rodrigo Siqueira Reviewed-by: Mikita Lipski Acked-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit 5cd221e837d6fe2a4d284360581be3fdcbf79734 Author: Joerg Roedel Date: Thu Jun 11 11:11:39 2020 +0200 alpha: Fix build around srm_sysrq_reboot_op The patch introducing the struct was probably never compile tested, because it sets a handler with a wrong function signature. Wrap the handler into a functions with the correct signature to fix the build. Fixes: 0f1c9688a194 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()") Cc: Emil Velikov Signed-off-by: Joerg Roedel Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 790243d3bf78f9830a3b2ffbca1ed0f528295d48 Author: Sandeep Raghuraman Date: Thu Jun 11 01:36:26 2020 +0530 drm/amdgpu: Replace invalid device ID with a valid device ID Initializes Powertune data for a specific Hawaii card by fixing what looks like a typo in the code. The device ID 66B1 is not a supported device ID for this driver, and is not mentioned elsewhere. 67B1 is a valid device ID, and is a Hawaii Pro GPU. I have tested on my R9 390 which has device ID 67B1, and it works fine without problems. Signed-off-by: Sandeep Raghuraman Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit cd16ed33c3c618930ccda7049dcea05ee707a9c0 Merge: 55d728b2b05f 01f76386b0ac Author: Linus Torvalds Date: Thu Jun 11 12:55:20 2020 -0700 Merge tag 'riscv-for-linus-5.8-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: - Kconfig select statements are now sorted alphanumerically - first-level interrupts are now handled via a full irqchip driver - CPU hotplug is fixed - vDSO calls now use the common vDSO infrastructure * tag 'riscv-for-linus-5.8-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: set the permission of vdso_data to read-only riscv: use vDSO common flow to reduce the latency of the time-related functions riscv: fix build warning of missing prototypes RISC-V: Don't mark init section as non-executable RISC-V: Force select RISCV_INTC for CONFIG_RISCV RISC-V: Remove do_IRQ() function clocksource/drivers/timer-riscv: Use per-CPU timer interrupt irqchip: RISC-V per-HART local interrupt controller driver RISC-V: Rename and move plic_find_hart_id() to arch directory RISC-V: self-contained IPI handling routine RISC-V: Sort select statements alphanumerically commit 55d728b2b05fb0377a9048af3460c375b54619e2 Merge: d3ea69343983 dd4bc6076587 Author: Linus Torvalds Date: Thu Jun 11 12:53:23 2020 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "arm64 fixes that came in during the merge window. There will probably be more to come, but it doesn't seem like it's worth me sitting on these in the meantime. - Fix SCS debug check to report max stack usage in bytes as advertised - Fix typo: CONFIG_FTRACE_WITH_REGS => CONFIG_DYNAMIC_FTRACE_WITH_REGS - Fix incorrect mask in HiSilicon L3C perf PMU driver - Fix compat vDSO compilation under some toolchain configurations - Fix false UBSAN warning from ACPI IORT parsing code - Fix booting under bootloaders that ignore TEXT_OFFSET - Annotate debug initcall function with '__init'" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: warn on incorrect placement of the kernel by the bootloader arm64: acpi: fix UBSAN warning arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO drivers/perf: hisi: Fix wrong value for all counters enable arm64: ftrace: Change CONFIG_FTRACE_WITH_REGS to CONFIG_DYNAMIC_FTRACE_WITH_REGS arm64: debug: mark a function as __init to save some memory scs: Report SCS usage in bytes rather than number of entries commit d3ea693439833b5ed9b932512e9a90b9381035c9 Merge: 2dca74a40e1e 9e2b6ed41f8f Author: Linus Torvalds Date: Thu Jun 11 12:50:54 2020 -0700 Merge tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: - casting clean up in the user access macros - memory leak on error case fix for PCI probing - update of a defconfig * tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k,nommu: fix implicit cast from __user in __{get,put}_user_asm() m68k,nommu: add missing __user in uaccess' __ptr() macro m68k: Drop CONFIG_MTD_M25P80 in stmark2_defconfig m68k/PCI: Fix a memory leak in an error handling path commit c0eca14c57f12357551f48aa882791395fef1263 Author: Rob Herring Date: Thu Jun 11 08:52:38 2020 -0600 dt-bindings: phy: qcom: Fix missing 'ranges' and example addresses The QCom QMP PHY bindings have child nodes with translatable (MMIO) addresses, so a 'ranges' property is required in the parent node. Additionally, the examples default to 1 address and size cell, so let's fix that, too. Fixes: ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml") Cc: Andy Gross Cc: Bjorn Andersson Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Manu Gautam Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Rob Herring commit 086e9074f52f6f623e1d6d02edc3cb661bb04f4e Author: Rob Herring Date: Wed Jun 10 15:49:12 2020 -0600 dt-bindings: Remove more cases of 'allOf' containing a '$ref' Another round of 'allOf' removals that came in this cycle. json-schema versions draft7 and earlier have a weird behavior in that any keywords combined with a '$ref' are ignored (silently). The correct form was to put a '$ref' under an 'allOf'. This behavior is now changed in the 2019-09 json-schema spec and '$ref' can be mixed with other keywords. The json-schema library doesn't yet support this, but the tooling now does a fixup for this and either way works. This has been a constant source of review comments, so let's change this treewide so everyone copies the simpler syntax. Signed-off-by: Rob Herring commit 9798278260e8f61d04415342544a8f701bc5ace7 Author: Tuong Lien Date: Thu Jun 11 17:08:08 2020 +0700 tipc: fix NULL pointer dereference in tipc_disc_rcv() When a bearer is enabled, we create a 'tipc_discoverer' object to store the bearer related data along with a timer and a preformatted discovery message buffer for later probing... However, this is only carried after the bearer was set 'up', that left a race condition resulting in kernel panic. It occurs when a discovery message from a peer node is received and processed in bottom half (since the bearer is 'up' already) just before the discoverer object is created but is now accessed in order to update the preformatted buffer (with a new trial address, ...) so leads to the NULL pointer dereference. We solve the problem by simply moving the bearer 'up' setting to later, so make sure everything is ready prior to any message receiving. Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit c9aa81faf19115fc2e732e7f210b37bb316987ff Author: Tuong Lien Date: Thu Jun 11 17:07:35 2020 +0700 tipc: fix kernel WARNING in tipc_msg_append() syzbot found the following issue: WARNING: CPU: 0 PID: 6808 at include/linux/thread_info.h:150 check_copy_size include/linux/thread_info.h:150 [inline] WARNING: CPU: 0 PID: 6808 at include/linux/thread_info.h:150 copy_from_iter include/linux/uio.h:144 [inline] WARNING: CPU: 0 PID: 6808 at include/linux/thread_info.h:150 tipc_msg_append+0x49a/0x5e0 net/tipc/msg.c:242 Kernel panic - not syncing: panic_on_warn set ... This happens after commit 5e9eeccc58f3 ("tipc: fix NULL pointer dereference in streaming") that tried to build at least one buffer even when the message data length is zero... However, it now exposes another bug that the 'mss' can be zero and the 'cpy' will be negative, thus the above kernel WARNING will appear! The zero value of 'mss' is never expected because it means Nagle is not enabled for the socket (actually the socket type was 'SOCK_SEQPACKET'), so the function 'tipc_msg_append()' must not be called at all. But that was in this particular case since the message data length was zero, and the 'send <= maxnagle' check became true. We resolve the issue by explicitly checking if Nagle is enabled for the socket, i.e. 'maxnagle != 0' before calling the 'tipc_msg_append()'. We also reinforce the function to against such a negative values if any. Reported-by: syzbot+75139a7d2605236b0b7f@syzkaller.appspotmail.com Fixes: c0bceb97db9e ("tipc: add smart nagle feature") Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit 77f972a7077d06d565243ecc192f45e1e5813cf1 Author: Shannon Nelson Date: Wed Jun 10 21:07:39 2020 -0700 ionic: remove support for mgmt device We no longer support the mgmt device in the ionic driver, so remove the device id and related code. Fixes: b3f064e9746d ("ionic: add support for device id 0x1004") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 2dca74a40e1e7ff45079d85fc507769383039b9d Merge: e0154bd47889 e9f901dc05c0 Author: Linus Torvalds Date: Thu Jun 11 12:42:14 2020 -0700 Merge tag 'mailbox-v5.8' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: "qcom: - new controller driver for IPCC - reorg the of_device data - add support for ipq6018 platform spreadtrum: - new sprd controller driver imx: - implement suspend/resume PM support misc: - make pcc driver struct static - fix return value in imx_mu_scu - disable clock before bailout in imx probe - remove duplicate error mssg in zynqmp probe - fix header size in imx.scu - check for null instead of is-err in zynqmp" * tag 'mailbox-v5.8' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: qcom: Add ipq6018 apcs compatible mailbox: qcom: Add clock driver name in apcs mailbox driver data dt-bindings: mailbox: Add YAML schemas for QCOM APCS global block mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag mailbox: imx: Add runtime PM callback to handle MU clocks mailbox: imx: Add context save/restore for suspend/resume MAINTAINERS: Add entry for Qualcomm IPCC driver mailbox: Add support for Qualcomm IPCC dt-bindings: mailbox: Add devicetree binding for Qcom IPCC mailbox: zynqmp-ipi: Fix NULL vs IS_ERR() check in zynqmp_ipi_mbox_probe() mailbox: imx-mailbox: fix scu msg header size check mailbox: sprd: Add Spreadtrum mailbox driver dt-bindings: mailbox: Add the Spreadtrum mailbox documentation mailbox: ZynqMP IPI: Delete an error message in zynqmp_ipi_probe() mailbox: imx: Disable the clock on devm_mbox_controller_register() failure mailbox: imx: Fix return in imx_mu_scu_xlate() mailbox: imx: Support runtime PM mailbox: pcc: make pcc_mbox_driver static commit 9334d5ba32c052fc925e0c817dc398c98b093221 Author: Xu Wang Date: Thu Jun 11 02:45:20 2020 +0000 drivers: dpaa2: Use devm_kcalloc() in setup_dpni() A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". Signed-off-by: Xu Wang Signed-off-by: David S. Miller commit e0154bd478897b277aeb7195bf9088e9ce05bbb0 Merge: d4e181f204dd a4f55d927d33 Author: Linus Torvalds Date: Thu Jun 11 12:38:11 2020 -0700 Merge tag 'sound-fix-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Here are last-minute fixes gathered before merge window close; a few fixes are for the core while the rest majority are driver fixes. - PCM locking annotation fixes and the possible self-lock fix - ASoC DPCM regression fixes with multi-CPU DAI - A fix for inconsistent resume from system-PM on USB-audio - Improved runtime-PM handling with multiple USB interfaces - Quirks for HD-audio and USB-audio - Hardened firmware handling in max98390 codec - A couple of fixes for meson" * tag 'sound-fix-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits) ASoC: rt5645: Add platform-data for Asus T101HA ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags ASoC: Intel: boards: replace capture_only by dpcm_capture ASoC: core: only convert non DPCM link to DPCM link ASoC: soc-pcm: dpcm: fix playback/capture checks ASoC: meson: add missing free_irq() in error path ALSA: pcm: disallow linking stream to itself ALSA: usb-audio: Manage auto-pm of all bundled interfaces ALSA: hda/realtek - add a pintbl quirk for several Lenovo machines ALSA: pcm: fix snd_pcm_link() lockdep splat ALSA: usb-audio: Use the new macro for HP Dock rename quirks ALSA: usb-audio: Add vendor, product and profile name for HP Thunderbolt Dock ALSA: emu10k1: delete an unnecessary condition dt-bindings: ASoc: Fix tdm-slot documentation spelling error ASoC: meson: fix memory leak of links if allocation of ldata fails ALSA: usb-audio: Fix inconsistent card PM state after resume ASoC: max98390: Fix potential crash during param fw loading ASoC: max98390: Fix incorrect printf qualifier ASoC: fsl-asoc-card: Defer probe when fail to find codec device ... commit d4e181f204dd0491da6c1d09b7208a0b990ec887 Merge: a53956829914 66057dd1d1cf Author: Linus Torvalds Date: Thu Jun 11 12:27:06 2020 -0700 Merge tag 'drm-next-2020-06-11-1' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "One sun4i fix and a connector hotplug race The ast fix is for a regression in 5.6, and one of the i915 ones fixes an oops reported by dhowells. core: - fix race in connectors sending hotplug i915: - Avoid use after free in cmdparser - Avoid NULL dereference when probing all display encoders - Fixup to module parameter type sun4i: - clock divider fix ast: - 24/32 bpp mode setting fix" * tag 'drm-next-2020-06-11-1' of git://anongit.freedesktop.org/drm/drm: drm/ast: fix missing break in switch statement for format->cpp[0] case 4 drm/sun4i: hdmi ddc clk: Fix size of m divider drm/i915/display: Only query DP state of a DDI encoder drm/i915/params: fix i915.reset module param type drm/i915/gem: Mark the buffer pool as active for the cmdparser drm/connector: notify userspace on hotplug after register complete commit a53956829914223ff6c53397b007421201354eb8 Merge: e8de4575cf76 ba838a75e73f Author: Linus Torvalds Date: Thu Jun 11 12:22:41 2020 -0700 Merge tag 'nfs-for-5.8-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "New features and improvements: - Sunrpc receive buffer sizes only change when establishing a GSS credentials - Add more sunrpc tracepoints - Improve on tracepoints to capture internal NFS I/O errors Other bugfixes and cleanups: - Move a dprintk() to after a call to nfs_alloc_fattr() - Fix off-by-one issues in rpc_ntop6 - Fix a few coccicheck warnings - Use the correct SPDX license identifiers - Fix rpc_call_done assignment for BIND_CONN_TO_SESSION - Replace zero-length array with flexible array - Remove duplicate headers - Set invalid blocks after NFSv4 writes to update space_used attribute - Fix direct WRITE throughput regression" * tag 'nfs-for-5.8-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (27 commits) NFS: Fix direct WRITE throughput regression SUNRPC: rpc_xprt lifetime events should record xprt->state xprtrdma: Make xprt_rdma_slot_table_entries static nfs: set invalid blocks after NFSv4 writes NFS: remove redundant initialization of variable result sunrpc: add missing newline when printing parameter 'auth_hashtable_size' by sysfs NFS: Add a tracepoint in nfs_set_pgio_error() NFS: Trace short NFS READs NFS: nfs_xdr_status should record the procedure name SUNRPC: Set SOFTCONN when destroying GSS contexts SUNRPC: rpc_call_null_helper() should set RPC_TASK_SOFT SUNRPC: rpc_call_null_helper() already sets RPC_TASK_NULLCREDS SUNRPC: trace RPC client lifetime events SUNRPC: Trace transport lifetime events SUNRPC: Split the xdr_buf event class SUNRPC: Add tracepoint to rpc_call_rpcerror() SUNRPC: Update the RPC_SHOW_SOCKET() macro SUNRPC: Update the rpc_show_task_flags() macro SUNRPC: Trace GSS context lifetimes SUNRPC: receive buffer size estimation values almost never change ... commit 1f44328ea24c9de368a3cfe5cc0e110b949afb2e Author: Marco Elver Date: Thu May 21 16:20:47 2020 +0200 compiler_types.h, kasan: Use __SANITIZE_ADDRESS__ instead of CONFIG_KASAN to decide inlining Use __always_inline in compilation units that have instrumentation disabled (KASAN_SANITIZE_foo.o := n) for KASAN, like it is done for KCSAN. Also, add common documentation for KASAN and KCSAN explaining the attribute. [ bp: Massage commit message. ] Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/20200521142047.169334-12-elver@google.com commit eb73876c74313231c35cee6310f8ad62c56fa2b3 Author: Marco Elver Date: Thu May 21 16:20:46 2020 +0200 compiler.h: Move function attributes to compiler_types.h Cleanup and move the KASAN and KCSAN related function attributes to compiler_types.h, where the rest of the same kind live. No functional change intended. Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/20200521142047.169334-11-elver@google.com commit 95c094fccb85422eff3c12930ebebbda9278f76b Author: Marco Elver Date: Thu May 21 16:20:45 2020 +0200 compiler.h: Avoid nested statement expression in data_race() It appears that compilers have trouble with nested statement expressions. Therefore, remove one level of statement expression nesting from the data_race() macro. This will help avoiding potential problems in the future as its usage increases. Reported-by: Borislav Petkov Reported-by: Nathan Chancellor Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Tested-by: Nick Desaulniers Link: https://lkml.kernel.org/r/20200520221712.GA21166@zn.tnic Link: https://lkml.kernel.org/r/20200521142047.169334-10-elver@google.com commit 44b97dccb2291a56454549827adc5e99d94811f3 Author: Marco Elver Date: Thu May 21 16:20:44 2020 +0200 compiler.h: Remove data_race() and unnecessary checks from {READ,WRITE}_ONCE() The volatile accesses no longer need to be wrapped in data_race() because compilers that emit instrumentation distinguishing volatile accesses are required for KCSAN. Consequently, the explicit kcsan_check_atomic*() are no longer required either since the compiler emits instrumentation distinguishing the volatile accesses. Finally, simplify __READ_ONCE_SCALAR() and remove __WRITE_ONCE_SCALAR(). [ bp: Convert commit message to passive voice. ] Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/20200521142047.169334-9-elver@google.com commit 0bb9ab3a6fa7ca9f627d85f6f683fae51598e8c8 Author: Marco Elver Date: Thu May 21 16:20:43 2020 +0200 kcsan: Update Documentation to change supported compilers Document change in required compiler version for KCSAN, and remove the now redundant note about __no_kcsan and inlining problems with older compilers. Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/20200521142047.169334-8-elver@google.com commit e3b779d9ebe82b4be0121f25f27632844bb86d96 Author: Marco Elver Date: Thu May 21 16:20:41 2020 +0200 kcsan: Remove 'noinline' from __no_kcsan_or_inline Some compilers incorrectly inline small __no_kcsan functions, which then results in instrumenting the accesses. For this reason, the 'noinline' attribute was added to __no_kcsan_or_inline. All known versions of GCC are affected by this. Supported versions of Clang are unaffected, and never inline a no_sanitize function. However, the attribute 'noinline' in __no_kcsan_or_inline causes unexpected code generation in functions that are __no_kcsan and call a __no_kcsan_or_inline function. In certain situations it is expected that the __no_kcsan_or_inline function is actually inlined by the __no_kcsan function, and *no* calls are emitted. By removing the 'noinline' attribute, give the compiler the ability to inline and generate the expected code in __no_kcsan functions. Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/CANpmjNNOpJk0tprXKB_deiNAv_UmmORf1-2uajLhnLWQQ1hvoA@mail.gmail.com Link: https://lkml.kernel.org/r/20200521142047.169334-6-elver@google.com commit d31d4d6bb256c3e784709e4aaf075de87c3390fc Author: Marco Elver Date: Thu May 21 16:20:40 2020 +0200 kcsan: Pass option tsan-instrument-read-before-write to Clang Clang (unlike GCC) removes reads before writes with matching addresses in the same basic block. This is an optimization for TSAN, since writes will always cause conflict if the preceding read would have. However, for KCSAN we cannot rely on this option, because we apply several special rules to writes, in particular when the KCSAN_ASSUME_PLAIN_WRITES_ATOMIC option is selected. To avoid missing potential data races, pass the -tsan-instrument-read-before-write option to Clang if it is available [1]. [1] https://github.com/llvm/llvm-project/commit/151ed6aa38a3ec6c01973b35f684586b6e1c0f7e Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/20200521142047.169334-5-elver@google.com commit 75d75b7a4d5489cc6a5e91ace306f6c13f376f33 Author: Marco Elver Date: Thu May 21 16:20:39 2020 +0200 kcsan: Support distinguishing volatile accesses In the kernel, the "volatile" keyword is used in various concurrent contexts, whether in low-level synchronization primitives or for legacy reasons. If supported by the compiler, it will be assumed that aligned volatile accesses up to sizeof(long long) (matching compiletime_assert_rwonce_type()) are atomic. Recent versions of Clang [1] (GCC tentative [2]) can instrument volatile accesses differently. Add the option (required) to enable the instrumentation, and provide the necessary runtime functions. None of the updated compilers are widely available yet (Clang 11 will be the first release to support the feature). [1] https://github.com/llvm/llvm-project/commit/5a2c31116f412c3b6888be361137efd705e05814 [2] https://gcc.gnu.org/pipermail/gcc-patches/2020-April/544452.html This change allows removing of any explicit checks in primitives such as READ_ONCE() and WRITE_ONCE(). [ bp: Massage commit message a bit. ] Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200521142047.169334-4-elver@google.com commit 0e1aa5b62160500bb2ed3150367fba83c0a194e5 Author: Marco Elver Date: Thu May 21 16:20:42 2020 +0200 kcsan: Restrict supported compilers The first version of Clang that supports -tsan-distinguish-volatile will be able to support KCSAN. The first Clang release to do so, will be Clang 11. This is due to satisfying all the following requirements: 1. Never emit calls to __tsan_func_{entry,exit}. 2. __no_kcsan functions should not call anything, not even kcsan_{enable,disable}_current(), when using __{READ,WRITE}_ONCE => Requires leaving them plain! 3. Support atomic_{read,set}*() with KCSAN, which rely on arch_atomic_{read,set}*() using __{READ,WRITE}_ONCE() => Because of #2, rely on Clang 11's -tsan-distinguish-volatile support. We will double-instrument atomic_{read,set}*(), but that's reasonable given it's still lower cost than the data_race() variant due to avoiding 2 extra calls (kcsan_{en,dis}able_current() calls). 4. __always_inline functions inlined into __no_kcsan functions are never instrumented. 5. __always_inline functions inlined into instrumented functions are instrumented. 6. __no_kcsan_or_inline functions may be inlined into __no_kcsan functions => Implies leaving 'noinline' off of __no_kcsan_or_inline. 7. Because of #6, __no_kcsan and __no_kcsan_or_inline functions should never be spuriously inlined into instrumented functions, causing the accesses of the __no_kcsan function to be instrumented. Older versions of Clang do not satisfy #3. The latest GCC currently doesn't support at least #1, #3, and #7. Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Link: https://lkml.kernel.org/r/CANpmjNMTsY_8241bS7=XAfqvZHFLrVEkv_uM4aDUWE_kh3Rvbw@mail.gmail.com Link: https://lkml.kernel.org/r/20200521142047.169334-7-elver@google.com commit 17168f5c1bef4ec7c239e2dd5e3e60b862727dd4 Author: Marco Elver Date: Thu May 21 16:20:38 2020 +0200 kcsan: Avoid inserting __tsan_func_entry/exit if possible To avoid inserting __tsan_func_{entry,exit}, add option if supported by compiler. Currently only Clang can be told to not emit calls to these functions. It is safe to not emit these, since KCSAN does not rely on them. Note that, if we disable __tsan_func_{entry,exit}(), we need to disable tail-call optimization in sanitized compilation units, as otherwise we may skip frames in the stack trace; in particular when the tail called function is one of the KCSAN's runtime functions, and a report is generated, we might miss the function where the actual access occurred. Since __tsan_func_{entry,exit}() insertion effectively disabled tail-call optimization, there should be no observable change. This was caught and confirmed with kcsan-test & UNWINDER_ORC. Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200521142047.169334-3-elver@google.com commit ea91a1d45d19469001a4955583187b0d75915759 Author: Arnd Bergmann Date: Thu May 21 16:20:37 2020 +0200 ubsan, kcsan: Don't combine sanitizer with kcov on clang Clang does not allow -fsanitize-coverage=trace-{pc,cmp} together with -fsanitize=bounds or with ubsan: clang: error: argument unused during compilation: '-fsanitize-coverage=trace-pc' [-Werror,-Wunused-command-line-argument] clang: error: argument unused during compilation: '-fsanitize-coverage=trace-cmp' [-Werror,-Wunused-command-line-argument] To avoid the warning, check whether clang can handle this correctly or disallow ubsan and kcsan when kcov is enabled. Signed-off-by: Arnd Bergmann Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Marco Elver Acked-by: Peter Zijlstra (Intel) Link: https://bugs.llvm.org/show_bug.cgi?id=45831 Link: https://lore.kernel.org/lkml/20200505142341.1096942-1-arnd@arndb.de Link: https://lkml.kernel.org/r/20200521142047.169334-2-elver@google.com commit 37d1a04b13a6d2fec91a6813fc034947a27db034 Merge: 37f8173dd849 97a9474aeb78 Author: Thomas Gleixner Date: Thu Jun 11 20:02:46 2020 +0200 Rebase locking/kcsan to locking/urgent Merge the state of the locking kcsan branch before the read/write_once() and the atomics modifications got merged. Squash the fallout of the rebase on top of the read/write once and atomic fallback work into the merge. The history of the original branch is preserved in tag locking-kcsan-2020-06-02. Signed-off-by: Thomas Gleixner commit 49b3deaad3452217d62dbd78da8df24eb0c7e169 Merge: e0135a104c52 15c99816ed93 Author: Paolo Bonzini Date: Thu Jun 11 14:02:32 2020 -0400 Merge tag 'kvmarm-fixes-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for Linux 5.8, take #1 * 32bit VM fixes: - Fix embarassing mapping issue between AArch32 CSSELR and AArch64 ACTLR - Add ACTLR2 support for AArch32 - Get rid of the useless ACTLR_EL1 save/restore - Fix CP14/15 accesses for AArch32 guests on BE hosts - Ensure that we don't loose any state when injecting a 32bit exception when running on a VHE host * 64bit VM fixes: - Fix PtrAuth host saving happening in preemptible contexts - Optimize PtrAuth lazy enable - Drop vcpu to cpu context pointer - Fix sparse warnings for HYP per-CPU accesses commit e8de4575cf7601917c2eae9f8ee1a8ee3d9be2a7 Merge: 7cf035cc8326 320bdbd81615 Author: Linus Torvalds Date: Thu Jun 11 11:02:13 2020 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "A number of fixes to the omap and nitrox drivers" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: cavium/nitrox - Fix 'nitrox_get_first_device()' when ndevlist is fully iterated crypto: omap-sham - add proper load balancing support for multicore crypto: omap-aes - prevent unregistering algorithms twice crypto: omap-sham - fix very small data size handling crypto: omap-sham - huge buffer access fixes crypto: omap-crypto - fix userspace copied buffer access crypto: omap-sham - force kernel driver usage for sha algos crypto: omap-aes - avoid spamming console with self tests commit e0135a104c52ccc977bc04a972bc889e0298b068 Author: Paolo Bonzini Date: Thu Jun 11 14:01:51 2020 -0400 KVM: x86: do not pass poisoned hva to __kvm_set_memory_region __kvm_set_memory_region does not use the hva at all, so trying to catch use-after-delete is pointless and, worse, it fails access_ok now that we apply it to all memslots including private kernel ones. This fixes an AVIC regression. Fixes: 09d952c971a5 ("KVM: check userspace_addr for all memslots") Reported-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 7cf035cc8326066a514146065b6ee8fc2c30fc21 Merge: c742b63473b3 e4f9ba20d3b8 Author: Linus Torvalds Date: Thu Jun 11 10:48:12 2020 -0700 Merge tag 'vfs-5.8-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull DAX updates part three from Darrick Wong: "Now that the xfs changes have landed, this third piece changes the FS_XFLAG_DAX ioctl code in xfs to request that the inode be reloaded after the last program closes the file, if doing so would make a S_DAX change happen. The goal here is to make dax access mode switching quicker when possible. Summary: - Teach XFS to ask the VFS to drop an inode if the administrator changes the FS_XFLAG_DAX inode flag such that the S_DAX state would change. This can result in files changing access modes without requiring an unmount cycle" * tag 'vfs-5.8-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: fs/xfs: Update xfs_ioctl_setattr_dax_invalidate() fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags() fs/xfs: Create function xfs_inode_should_enable_dax() fs/xfs: Make DAX mount option a tri-state fs/xfs: Change XFS_MOUNT_DAX to XFS_MOUNT_DAX_ALWAYS fs/xfs: Remove unnecessary initialization of i_rwsem commit ba838a75e73f55a780f1ee896b8e3ecb032dba0f Author: Chuck Lever Date: Fri May 29 14:14:40 2020 -0400 NFS: Fix direct WRITE throughput regression I measured a 50% throughput regression for large direct writes. The observed on-the-wire behavior is that the client sends every NFS WRITE twice: once as an UNSTABLE WRITE plus a COMMIT, and once as a FILE_SYNC WRITE. This is because the nfs_write_match_verf() check in nfs_direct_commit_complete() fails for every WRITE. Buffered writes use nfs_write_completion(), which sets req->wb_verf correctly. Direct writes use nfs_direct_write_completion(), which does not set req->wb_verf at all. This leaves req->wb_verf set to all zeroes for every direct WRITE, and thus nfs_direct_commit_completion() always sets NFS_ODIRECT_RESCHED_WRITES. This fix appears to restore nearly all of the lost performance. Fixes: 1f28476dcb98 ("NFS: Fix O_DIRECT commit verifier handling") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 94afd9c489fe6720ea3f49084125344e22610880 Author: Chuck Lever Date: Mon May 18 10:13:02 2020 -0400 SUNRPC: rpc_xprt lifetime events should record xprt->state Help troubleshoot the logic that uses these flags. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5bffb00621b121c9f4726f1e755ad4246cf4b800 Author: Zou Wei Date: Thu Apr 23 15:10:02 2020 +0800 xprtrdma: Make xprt_rdma_slot_table_entries static Fix the following sparse warning: net/sunrpc/xprtrdma/transport.c:71:14: warning: symbol 'xprt_rdma_slot_table_entries' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Reviewed-by: Chuck Lever Signed-off-by: Anna Schumaker commit 3a39e778690500066b31fe982d18e2e394d3bce2 Author: Zheng Bin Date: Thu May 21 17:17:21 2020 +0800 nfs: set invalid blocks after NFSv4 writes Use the following command to test nfsv4(size of file1M is 1MB): mount -t nfs -o vers=4.0,actimeo=60 127.0.0.1/dir1 /mnt cp file1M /mnt du -h /mnt/file1M -->0 within 60s, then 1M When write is done(cp file1M /mnt), will call this: nfs_writeback_done nfs4_write_done nfs4_write_done_cb nfs_writeback_update_inode nfs_post_op_update_inode_force_wcc_locked(change, ctime, mtime nfs_post_op_update_inode_force_wcc_locked nfs_set_cache_invalid nfs_refresh_inode_locked nfs_update_inode nfsd write response contains change, ctime, mtime, the flag will be clear after nfs_update_inode. Howerver, write response does not contain space_used, previous open response contains space_used whose value is 0, so inode->i_blocks is still 0. nfs_getattr -->called by "du -h" do_update |= force_sync || nfs_attribute_cache_expired -->false in 60s cache_validity = READ_ONCE(NFS_I(inode)->cache_validity) do_update |= cache_validity & (NFS_INO_INVALID_ATTR -->false if (do_update) { __nfs_revalidate_inode } Within 60s, does not send getattr request to nfsd, thus "du -h /mnt/file1M" is 0. Add a NFS_INO_INVALID_BLOCKS flag, set it when nfsv4 write is done. Fixes: 16e143751727 ("NFS: More fine grained attribute tracking") Signed-off-by: Zheng Bin Signed-off-by: Anna Schumaker commit 86b936672e55388bd5674e50e5ff4ef95f3477b8 Author: Colin Ian King Date: Wed May 27 13:56:11 2020 +0100 NFS: remove redundant initialization of variable result The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Anna Schumaker commit 2ac3ddc723469c66846262e1d7954199ef95d6dc Author: Xiongfeng Wang Date: Fri May 8 09:33:00 2020 +0800 sunrpc: add missing newline when printing parameter 'auth_hashtable_size' by sysfs When I cat parameter '/sys/module/sunrpc/parameters/auth_hashtable_size', it displays as follows. It is better to add a newline for easy reading. [root@hulk-202 ~]# cat /sys/module/sunrpc/parameters/auth_hashtable_size 16[root@hulk-202 ~]# Signed-off-by: Xiongfeng Wang Signed-off-by: Anna Schumaker commit cd2ed9bdc0794464d57a5ae2d979b1543a75694b Author: Chuck Lever Date: Tue May 12 17:14:11 2020 -0400 NFS: Add a tracepoint in nfs_set_pgio_error() Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit fd2b6121415539c394f7c610da5ffa6df919db46 Author: Chuck Lever Date: Tue May 12 17:14:05 2020 -0400 NFS: Trace short NFS READs A short read can generate an -EIO error without there being an error on the wire. This tracepoint acts as an eyecatcher when there is no obvious I/O error. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5be5945864ea143fda628e8179c8474457af1f43 Author: Chuck Lever Date: Tue May 12 17:14:00 2020 -0400 NFS: nfs_xdr_status should record the procedure name When sunrpc trace points are not enabled, the recorded task ID information alone is not helpful. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 841a2ed9a13d0d54ec7f961c54e7b52ffa97c8bb Author: Chuck Lever Date: Tue May 12 17:13:55 2020 -0400 SUNRPC: Set SOFTCONN when destroying GSS contexts Move the RPC_TASK_SOFTCONN flag into rpc_call_null_helper(). The only minor behavior change is that it is now also set when destroying GSS contexts. This gives a better guarantee that gss_send_destroy_context() will not hang for long if a connection cannot be established. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 6fc3737aac19c81181d5ec3f9c86e324e85e733a Author: Chuck Lever Date: Tue May 12 17:13:50 2020 -0400 SUNRPC: rpc_call_null_helper() should set RPC_TASK_SOFT Clean up. All of rpc_call_null_helper() call sites assert RPC_TASK_SOFT, so move that setting into rpc_call_null_helper() itself. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit eefc536dbdf1c55777bb192dfac2faf0993d8e10 Author: Chuck Lever Date: Tue May 12 17:13:44 2020 -0400 SUNRPC: rpc_call_null_helper() already sets RPC_TASK_NULLCREDS Clean up. Commit a52458b48af1 ("NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'.") made rpc_call_null_helper() set RPC_TASK_NULLCREDS unconditionally. Therefore there's no need for rpc_call_null_helper()'s call sites to set RPC_TASK_NULLCREDS. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 42aad0d7f9486b72155892c689bea2ff9793d8a8 Author: Chuck Lever Date: Tue May 12 17:13:39 2020 -0400 SUNRPC: trace RPC client lifetime events The "create" tracepoint records parts of the rpc_create arguments, and the shutdown tracepoint records when the rpc_clnt is about to signal pending tasks and destroy auths. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 911813d7a15221362d1655d246f3502c0f898c14 Author: Chuck Lever Date: Tue May 12 17:13:34 2020 -0400 SUNRPC: Trace transport lifetime events Refactor: Hoist create/destroy/disconnect tracepoints out of xprtrdma and into the generic RPC client. Some benefits include: - Enable tracing of xprt lifetime events for the socket transport types - Expose the different types of disconnect to help run down issues with lingering connections Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit c509f15a5801605652126831d965751e8d602471 Author: Chuck Lever Date: Tue May 12 17:13:28 2020 -0400 SUNRPC: Split the xdr_buf event class To help tie the recorded xdr_buf to a particular RPC transaction, the client side version of this class should display task ID information and the server side one should show the request's XID. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 0125ecbb526745930c63585314fa4e1c45432979 Author: Chuck Lever Date: Tue May 12 17:13:23 2020 -0400 SUNRPC: Add tracepoint to rpc_call_rpcerror() Add a tracepoint in another common exit point for failing RPCs. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 82909dc546461c6ea060879e9b6fbe5eeac37cea Author: Chuck Lever Date: Tue May 12 17:13:18 2020 -0400 SUNRPC: Update the RPC_SHOW_SOCKET() macro Clean up: remove unnecessary commas, and fix a white-space nit. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 7a34c8e0c38b5fd21a764031b1f8664c28b595af Author: Chuck Lever Date: Tue May 12 17:13:12 2020 -0400 SUNRPC: Update the rpc_show_task_flags() macro Recent additions to the RPC_TASK flags neglected to update the tracepoint ENUM definitions. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 74fb8fecee99f61415dcb6e22dbc24f42988a1d3 Author: Chuck Lever Date: Tue May 12 17:13:07 2020 -0400 SUNRPC: Trace GSS context lifetimes Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 53bc19f17f21738735706fabcae3070f16c833db Author: Chuck Lever Date: Tue May 12 17:13:01 2020 -0400 SUNRPC: receive buffer size estimation values almost never change Avoid unnecessary cache sloshing by placing the buffer size estimation update logic behind an atomic bit flag. The size of GSS information included in each wrapped Reply does not change during the lifetime of a GSS context. Therefore, the au_rslack and au_ralign fields need to be updated only once after establishing a fresh GSS credential. Thus a slack size update must occur after a cred is created, duplicated, renewed, or expires. I'm not sure I have this exactly right. A trace point is introduced to track updates to these variables to enable troubleshooting the problem if I missed a spot. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit c742b63473b3c5180db8b5d74fdbd56e4371dfa2 Merge: b29482fde649 1eb2f96d0bff Author: Linus Torvalds Date: Thu Jun 11 10:33:13 2020 -0700 Merge tag 'nfsd-5.8' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Highlights: - Keep nfsd clients from unnecessarily breaking their own delegations. Note this requires a small kthreadd addition. The result is Tejun Heo's suggestion (see link), and he was OK with this going through my tree. - Patch nfsd/clients/ to display filenames, and to fix byte-order when displaying stateid's. - fix a module loading/unloading bug, from Neil Brown. - A big series from Chuck Lever with RPC/RDMA and tracing improvements, and lay some groundwork for RPC-over-TLS" Link: https://lore.kernel.org/r/1588348912-24781-1-git-send-email-bfields@redhat.com * tag 'nfsd-5.8' of git://linux-nfs.org/~bfields/linux: (49 commits) sunrpc: use kmemdup_nul() in gssp_stringify() nfsd: safer handling of corrupted c_type nfsd4: make drc_slab global, not per-net SUNRPC: Remove unreachable error condition in rpcb_getport_async() nfsd: Fix svc_xprt refcnt leak when setup callback client failed sunrpc: clean up properly in gss_mech_unregister() sunrpc: svcauth_gss_register_pseudoflavor must reject duplicate registrations. sunrpc: check that domain table is empty at module unload. NFSD: Fix improperly-formatted Doxygen comments NFSD: Squash an annoying compiler warning SUNRPC: Clean up request deferral tracepoints NFSD: Add tracepoints for monitoring NFSD callbacks NFSD: Add tracepoints to the NFSD state management code NFSD: Add tracepoints to NFSD's duplicate reply cache SUNRPC: svc_show_status() macro should have enum definitions SUNRPC: Restructure svc_udp_recvfrom() SUNRPC: Refactor svc_recvfrom() SUNRPC: Clean up svc_release_skb() functions SUNRPC: Refactor recvfrom path dealing with incomplete TCP receives SUNRPC: Replace dprintk() call sites in TCP receive path ... commit 2630e1bb0948c3134c6f22ad275ae27cc6023532 Author: Jonas Karlman Date: Fri May 22 22:21:33 2020 +0200 media: rkvdec: Fix H264 scaling list order The Rockchip Video Decoder driver is expecting that the values in a scaling list are in zig-zag order and applies the inverse scanning process to get the values in matrix order. Commit 0b0393d59eb4 ("media: uapi: h264: clarify expected scaling_list_4x4/8x8 order") clarified that the values in the scaling list should already be in matrix order. Fix this by removing the reordering and change to use two memcpy. Fixes: cd33c830448b ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Jonas Karlman Tested-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia [hverkuil-cisco@xs4all.nl: rkvdec_scaling_matrix -> rkvdec_h264_scaling_list] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 88441917dc6cd995cb993df603e264f5b88be50c Author: Jonas Karlman Date: Wed May 27 00:25:15 2020 +0200 media: v4l2-ctrls: Unset correct HEVC loop filter flag Wrong loop filter flag is unset when tiles enabled flag is not set, this cause HEVC decoding issues with Rockchip Video Decoder. Fix this by unsetting the loop filter across tiles enabled flag instead of the pps loop filter across slices enabled flag when tiles are disabled. Fixes: 256fa3920874 ("media: v4l: Add definitions for HEVC stateless decoding") Signed-off-by: Jonas Karlman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0d9668721311607353d4861e6c32afeb272813dc Author: Tomi Valkeinen Date: Wed May 27 10:23:34 2020 +0200 media: videobuf2-dma-contig: fix bad kfree in vb2_dma_contig_clear_max_seg_size Commit 9495b7e92f716ab2bd6814fab5e97ab4a39adfdd ("driver core: platform: Initialize dma_parms for platform devices") in v5.7-rc5 causes vb2_dma_contig_clear_max_seg_size() to kfree memory that was not allocated by vb2_dma_contig_set_max_seg_size(). The assumption in vb2_dma_contig_set_max_seg_size() seems to be that dev->dma_parms is always NULL when the driver is probed, and the case where dev->dma_parms has bee initialized by someone else than the driver (by calling vb2_dma_contig_set_max_seg_size) will cause a failure. All the current users of these functions are platform devices, which now always have dma_parms set by the driver core. To fix the issue for v5.7, make vb2_dma_contig_set_max_seg_size() return an error if dma_parms is NULL to be on the safe side, and remove the kfree code from vb2_dma_contig_clear_max_seg_size(). For v5.8 we should remove the two functions and move the dma_set_max_seg_size() calls into the drivers. Signed-off-by: Tomi Valkeinen Fixes: 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") Cc: stable@vger.kernel.org Acked-by: Marek Szyprowski Reviewed-by: Ulf Hansson Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5be5f41dd785a67cf4e1dc07a3454e340a94b2e0 Author: Michael Rodin Date: Wed May 27 18:21:32 2020 +0200 media: v4l2-subdev.rst: correct information about v4l2 events Remove description of non-existing v4l2_subdev.nevents and replace the undefined flag V4L2_SUBDEV_USES_EVENTS by the correct flag V4L2_SUBDEV_FL_HAS_EVENTS, which is already documented in v4l2_subdev.flags Fixes: commit 02adb1cc765b ("[media] v4l: subdev: Events support") Signed-off-by: Michael Rodin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cc8c0363ddce6308168d8223378ca884c213f280 Author: Marek Szyprowski Date: Thu May 28 16:03:26 2020 +0200 media: s5p-mfc: Properly handle dma_parms for the allocated devices Commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") in v5.7-rc5 added allocation of dma_parms structure to all platform devices. Then vb2_dma_contig_set_max_seg_size() have been changed not to allocate dma_parms structure and rely on the one allocated by the device core. Lets allocate the needed structure also for the devices created for the 2 MFC device memory ports. Reported-by: Tomi Valkeinen Suggested-by: Ulf Hansson Fixes: 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") Signed-off-by: Marek Szyprowski Reviewed-by: Ulf Hansson Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 15168b204691aa8cbff043c1151e9dbfdd088364 Author: Geert Uytterhoeven Date: Thu Jun 4 11:39:53 2020 +0200 media: medium: cec: Make MEDIA_CEC_SUPPORT default to n if !MEDIA_SUPPORT Recently, MEDIA_CEC_SUPPORT became indepedent of MEDIA_SUPPORT. However, if MEDIA_SUPPORT is not enabled, MEDIA_SUPPORT_FILTER is not defined, and MEDIA_CEC_SUPPORT is thus enabled by default, which is not desirable. Fix this by adding a dependency on MEDIA_CEC_SUPPORT to the default configuration. Fixes: 46d2a3b964ddbe63 ("media: place CEC menu before MEDIA_SUPPORT") Signed-off-by: Geert Uytterhoeven Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d5aecd289babf3adcf5a837b067a5efddb097d99 Author: Jernej Skrabec Date: Sat May 9 22:06:43 2020 +0200 media: cedrus: Implement runtime PM This allows the VE clocks and PLL_VE to be disabled most of the time. A runtime PM reference is held while streaming. Signed-off-by: Jernej Skrabec Signed-off-by: Samuel Holland Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a8876c22eab9a871834f85de83e98bbf7e6e264d Author: Samuel Holland Date: Sat May 9 22:06:42 2020 +0200 media: cedrus: Program output format during each run Previously, the output format was programmed as part of the ioctl() handler. However, this has two problems: 1) If there are multiple active streams with different output formats, the hardware will use whichever format was set last for both streams. Similarly, an ioctl() done in an inactive context will wrongly affect other active contexts. 2) The registers are written while the device is not actively streaming. To enable runtime PM tied to the streaming state, all hardware access needs to be moved inside cedrus_device_run(). The call to cedrus_dst_format_set() is now placed just before the codec-specific callback that programs the hardware. Cc: Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver") Suggested-by: Jernej Skrabec Suggested-by: Paul Kocialkowski Signed-off-by: Samuel Holland Tested-by: Jernej Skrabec Reviewed-by: Jernej Skrabec Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f4f90edf90935424c65c310e830db13a5a2ce944 Author: Mauro Carvalho Chehab Date: Thu Jun 4 17:04:33 2020 +0200 media: atomisp: improve ACPI/DMI detection logs As there are several ways where the driver could possible retrieve sensor data, make the prints clearer about what was detected and from where. Signed-off-by: Mauro Carvalho Chehab commit c25ad350f1ab36c56701601d98de9872b71fe0ad Author: Mauro Carvalho Chehab Date: Thu Jun 4 22:28:38 2020 +0200 media: Revert "media: atomisp: add Asus Transform T101HA ACPI vars" Now that the EFI _DSM table is parsed by the driver, we don't need a DMI match anymore for Asus Transform T101HA. This reverts commit 0a76fd8e8d202dcaabc714850205d5d75c9b8271. Signed-off-by: Mauro Carvalho Chehab commit fc9bfbc67fe4270150e34704ca40d696ec933abc Author: Mauro Carvalho Chehab Date: Thu Jun 4 14:40:40 2020 +0200 media: Revert "media: atomisp: Add some ACPI detection info" This reverts commit 0d64e9420583cbc3c4a3f949ebe38fd8f7769281. As gmin_subdev_add() now takes the ACPI handle directly, we can deprecate the code that were doing this inside each I2C driver. PS.: This also reverts commit c03496b3bd92 ("media: atomisp: add a notice about possible leak resources") Signed-off-by: Mauro Carvalho Chehab commit 387041cda44eda841c1b39858e75a916b100778c Author: Mauro Carvalho Chehab Date: Thu Jun 4 11:46:03 2020 +0200 media: atomisp: improve sensor detection code to use _DSM table Instead of keep hardcoding device-specific tables, read them directly from the ACPI BIOS, if available. This method is know to work with Asus T101HA device. the same table is also visible on EzPad devices. So, it seems that at least some BIOSes use this method to pass data about ISP2401-connected sensors. Signed-off-by: Mauro Carvalho Chehab commit 69a03e36c7116ce575f7dd438f895e499aa6e790 Author: Mauro Carvalho Chehab Date: Mon Jun 1 10:50:35 2020 +0200 media: atomisp: get rid of an iomem abstraction layer The hive_isp_css_custom_host_hrt.h code, together with atomisp_helper.h, provides an abstraction layer for some functions inside atomisp_compat_css20.c and atomisp_cmd.c. There's no good reason for that. In a matter of fact, after removing the abstraction, the code looked a lot cleaner and easier to understand. So, get rid of them. While here, get rid also of the udelay(1) abstraction code. Signed-off-by: Mauro Carvalho Chehab commit 662fb4fceb1a30c027774f8fc83c96198254af32 Author: Mauro Carvalho Chehab Date: Wed Jun 3 08:19:44 2020 +0200 media: atomisp: get rid of a string_support.h abstraction layer Some parts of the driver have their own implementation of memcpy() & friends. Replace all of them by strscpy(). Signed-off-by: Mauro Carvalho Chehab commit 48b532b9d2a2f27920878a0faea7fac05ec2ebc0 Author: Mauro Carvalho Chehab Date: Wed Jun 3 08:12:14 2020 +0200 media: atomisp: use strscpy() instead of less secure variants Replace usages of strcpy(), strlcpy() and strncpy() in favor of strscpy(). Suggested-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit baf768cf29f8fb1529e160e3ee481746ae78f6c7 Author: Mauro Carvalho Chehab Date: Mon Jun 1 10:38:47 2020 +0200 media: atomisp: set DFS to MAX if sensor doesn't report fps If the sensor doesn't implement support for g_frame_interval, it won't return the expected fps rate. Instead of keeping DFS on its minimal value (which will likely not work), set it to the max. Signed-off-by: Mauro Carvalho Chehab commit 92b2bc49fc7cb9219d144bff018884dfb000eb03 Author: Mauro Carvalho Chehab Date: Sun May 31 14:02:55 2020 +0200 media: atomisp: use different dfs failed messages There are several parts of the driver that could produce a "dfs failed!" message. Change the texts, in order to help identifying from where they're coming. Signed-off-by: Mauro Carvalho Chehab commit 469a7306f1717b9017006708f0815bd5294324dd Author: Mauro Carvalho Chehab Date: Mon Jun 1 09:43:24 2020 +0200 media: atomisp: change the detection of ISP2401 at runtime Instead of having a static var to detect it, let's use the already-existing arch-specific bytes, as this is how other parts of the code also checks when it needs to do something different, depending on an specific chipset version. Signed-off-by: Mauro Carvalho Chehab commit 77bdacaa9f553449fe2807bfb5a88f10dba4d2b4 Author: Mauro Carvalho Chehab Date: Mon Jun 1 09:39:55 2020 +0200 media: atomisp: use macros from intel-family.h Instead of hardcoding the intel family values there, use the already defined ones from asm/intel-family.h. Signed-off-by: Mauro Carvalho Chehab commit 17c3827b4c5744abed8cfc6bf86fdbedf0ed61d2 Author: Mauro Carvalho Chehab Date: Mon Jun 1 09:02:46 2020 +0200 media: atomisp: don't set hpll_freq twice with different values The logic which sets the hpll_freq for BYT sets hpll_freq to 1600MHz, but ignores it, and sets it again after reading from-device-specific EFI vars (this time, using a default of 2000MHz). Remove the first set, as this will be overriden anyway. While here, do minor adjustments on comments and on a printk message. Signed-off-by: Mauro Carvalho Chehab commit c371af686972ee2a7946b56f6b6b42bcb80d2091 Author: Mauro Carvalho Chehab Date: Mon Jun 1 08:34:08 2020 +0200 media: atomisp: get rid of a detection hack for a BYT Andorid-based tablet There's a hack at the driver that selects a different table for a BYT tablet, which sets the maximum frequency to 320 MHz, instead of 400 MHz. After looking at the Intel Aero Yocto's version from: https://download.01.org/aero/deb/pool/main/l/linux-4.4.76-aero-1.3/ It was noticed that this depends on an Android-specific modprobe parameter, which uses a macro (INTEL_MID_BOARD) from this file: arch/x86/include/asm/spid.h >From the comments there, it looks like this macro parses a variable passed at boot time: cmdline : androidboot.spid=vend:cust:manu:plat:prod:hard The devices in question are identified there as: INTEL_BYT_TABLET_BLK_PRO = 0x0000 INTEL_BYT_TABLET_BLK_ENG = 0x8000 Well, this is something that we don't have upstream. So, without further details about that, we can't really parse it. If we ever end supporting those devices with the upstream driver, this patch can be reverted and the device can be detected via DMI (or maybe via PCI ID?). Signed-off-by: Mauro Carvalho Chehab commit 946881109181d9def4002156bfa85b020dc05583 Author: Mauro Carvalho Chehab Date: Sun May 31 13:53:08 2020 +0200 media: atomisp: use just one mamoiada_params.h As both isp2400 and isp2401 files are identical, remove one of them and remove the test for ISP variant. Signed-off-by: Mauro Carvalho Chehab commit 55b0d4d9313f2875b461b02baf211e111dfb5075 Author: Mauro Carvalho Chehab Date: Sun May 31 13:50:05 2020 +0200 media: atomisp: remove some unused defines from *mamoiada_params.h There are some parameters that are different between isp2400 and isp2401. None of those are actually used. So, get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 0a4b8c457b04af7409348ceb2484e8c726ee6953 Author: Mauro Carvalho Chehab Date: Sun May 31 13:28:12 2020 +0200 media: atomisp: simplify IRQ ifdef logic There are lots of mess with IRQ ifdef settings. As the *_global.h will already detect the type of IRQ system at compile time, we can get rid of them, replacing by just one ifdef for ISP2401. Signed-off-by: Mauro Carvalho Chehab commit d0b674ac625058dac7888c08d9e26d338f4f23b9 Author: Mauro Carvalho Chehab Date: Sun May 31 13:06:01 2020 +0200 media: atomisp: get rid of ifdef nonsense There are some ifdefs there that end doing the same thing. Get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 35a933d47038c77ed8b9e5670480b830c503848a Author: Mauro Carvalho Chehab Date: Sun May 31 12:57:41 2020 +0200 media: atomisp: get rid of a duplicated file The contents of hive_isp_css_2401_irq_types_hrt.h and hive_isp_css_common/irq_global.h are identical, except for one unused enum: On isp2401, this IRQ line has this name: hrt_isp_css_irq_is2401 = HIVE_GP_DEV_IRQ_ISP_PMEM_ERROR_BIT_ID, While the same bit is named as: hrt_isp_css_irq_isp_pmem_error = HIVE_GP_DEV_IRQ_ISP_PMEM_ERROR_BIT_ID, At the isp2400 version. Remove one of them, in order to reduce the code differences between those two versions. Signed-off-by: Mauro Carvalho Chehab commit 90240017891afbd2b10506e30f688b6c63e11ebc Author: Mauro Carvalho Chehab Date: Sun May 31 12:47:00 2020 +0200 media: atomisp: do some cleanup at irq_local.h - Get rid of typedefs; - Get rid of a duplicated enum type with different names for ISP2400 and ISP2401; - adjust indentation on the touched code. Signed-off-by: Mauro Carvalho Chehab commit f2fb029b3790e1f374e93fc6d0ca1e6239e44543 Author: Mauro Carvalho Chehab Date: Sun May 31 11:55:21 2020 +0200 media: atomisp: improve IRQ handling debug messages When an IRQ is not handled, it is nice to know what's the reason. Signed-off-by: Mauro Carvalho Chehab commit 495eef11f79d176ba28435ff78adbcb77e5326c8 Author: Mauro Carvalho Chehab Date: Sun May 31 11:39:17 2020 +0200 media: atomisp: comment an unused code There's a different table for some BYT variants that depend on something inside a FIXME ifdef. Place this also inside it, just to shut up a clang-11 warning. Reported-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab commit 586f93fa2aee184c55aa63faed10d5cc09e1136a Author: Mauro Carvalho Chehab Date: Sun May 31 11:38:41 2020 +0200 media: atomisp: get rid of a left-over wrapper function The abstraction layer for kvfree() was removed, but there is still a left-over code there. Reported-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab commit 54b15d8de0f681aeddd93f8b73a7c60db021156c Author: Mauro Carvalho Chehab Date: Sun May 31 00:08:41 2020 +0200 media: atomisp: get rid of an unused IRQ duplicated event There are two names for the same IRQ, but just one is used. Remove the unused one. Signed-off-by: Mauro Carvalho Chehab commit c0818685371e269777514f2e2cbb120d6434840a Author: Mauro Carvalho Chehab Date: Sat May 30 21:06:42 2020 +0200 media: atomisp: get rid of sh_css_pipe.c There's nothing there, just comments. Signed-off-by: Mauro Carvalho Chehab commit 89f3b3196e7fe63a66296c7ed95b96964963c6ea Author: Arnd Bergmann Date: Fri May 29 22:00:27 2020 +0200 media: staging: media: atomisp: fix stack overflow in init_pipe_defaults() When building with clang, multiple copies of the structures to be initialized are passed around on the stack and copied locally, using an insane amount of stack space: drivers/staging/media/atomisp/pci/sh_css.c:2371:1: error: stack frame size of 26864 bytes in function 'create_pipe' [-Werror,-Wframe-larger-than=] Use constantly-allocated variables plus an explicit memcpy() to avoid that. Co-authored-by: Mauro Carvalho Chehab Fixes: 6dc9a2568f84 ("media: atomisp: convert default struct values to use compound-literals with designated initializers") Signed-off-by: Arnd Bergmann Signed-off-by: Mauro Carvalho Chehab commit 5b552b198c2557295becd471bff53bb520fefee5 Author: Mauro Carvalho Chehab Date: Sat May 30 18:10:07 2020 +0200 media: atomisp: re-enable warnings again For most warnings, the current code is OK. There are still some issues with implicit-fallthough warnings. Solve those and re-enable all warnings for this driver. Signed-off-by: Mauro Carvalho Chehab commit fb1f6ae692fc9d2d102a231ffbebe901a061f727 Author: Mauro Carvalho Chehab Date: Sat May 30 17:24:15 2020 +0200 media: atomisp: remove format duplication at mbus->fourcc table This table used to be used also to translate between ia_css abstraction and V4L2 fourcc codes. This was removed on a past patch, but the table now contains two fields with identical values. Get rid of one of them. Signed-off-by: Mauro Carvalho Chehab commit 4e86bde20122aeb4abd8b586ee7f3959f898223c Author: Arnd Bergmann Date: Fri May 29 22:00:31 2020 +0200 media: staging: media: atomisp: add PMIC_OPREGION dependency Without that driver, there is a link failure in ERROR: modpost: "intel_soc_pmic_exec_mipi_pmic_seq_element" [drivers/staging/media/atomisp/pci/atomisp_gmin_platform.ko] undefined! Add an explicit Kconfig dependency. Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 065e5e559555e2f100bc95792a8ef1b609bbe130 Author: Arnd Bergmann Date: Fri May 29 22:00:30 2020 +0200 media: staging: media: atomisp: disable all custom formats clang points out the usage of an incorrect enum type in the list of supported image formats: drivers/staging/media/atomisp/pci/atomisp_subdev.c:49:65: error: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Werror,-Wenum-conversion] { V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, CSS_FRAME_FORMAT_NV21, 0, CSS_FRAME_FORMAT_NV21 }, drivers/staging/media/atomisp/pci/atomisp_subdev.c:49:39: error: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Werror,-Wenum-conversion] { V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, CSS_FRAME_FORMAT_NV21, 0, CSS_FRAME_FORMAT_NV21 }, { V4L2_MBUS_FMT_CUSTOM_NV12, 12, 12, CSS_FRAME_FORMAT_NV12, 0, CSS_FRAME_FORMAT_NV12 }, { MEDIA_BUS_FMT_JPEG_1X8, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, ATOMISP_INPUT_FORMAT_BINARY_8 }, Checking the git history, I found a commit that disabled one such case because it did not work. It seems likely that the incorrect enum was part of the original problem and that the others do not work either, or have never been tested. Disable all the ones that cause a warning. Fixes: cb02ae3d71ea ("media: staging: atomisp: Disable custom format for now") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 6fc07dd22fd5c5d74cd6dca974867d5c55e0959f Author: Arnd Bergmann Date: Fri May 29 22:00:29 2020 +0200 media: staging: media: atomisp: fix enum type mixups Some function calls pass an incorrect enum type: drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:858:16: error: implicit conversion from enumeration type 'input_system_ID_t' to different enumeration type 'gp_device_ID_t' [-Werror,-Wenum-conversion] gp_device_rst(INPUT_SYSTEM0_ID); ~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:860:19: error: implicit conversion from enumeration type 'input_system_ID_t' to different enumeration type 'gp_device_ID_t' [-Werror,-Wenum-conversion] input_switch_rst(INPUT_SYSTEM0_ID); ~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:876:27: error: implicit conversion from enumeration type 'input_system_cfg_flag_t' to different enumeration type 'input_system_connection_t' [-Werror,-Wenum-conversion] config.multicast[i] = INPUT_SYSTEM_CFG_FLAG_RESET; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1326:32: error: implicit conversion from enumeration type 'input_system_ID_t' to different enumeration type 'gp_device_ID_t' [-Werror,-Wenum-conversion] input_selector_cfg_for_sensor(INPUT_SYSTEM0_ID); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1329:19: error: implicit conversion from enumeration type 'input_system_ID_t' to different enumeration type 'gp_device_ID_t' [-Werror,-Wenum-conversion] input_switch_cfg(INPUT_SYSTEM0_ID, &config.input_switch_cfg); ~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ INPUT_SYSTEM0_ID is zero, so use the corresponding zero-value of the expected types instead. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 93517ea037c3235d74945617c43af657ffe81bc6 Author: Arnd Bergmann Date: Fri May 29 22:00:24 2020 +0200 media: staging: media: atomisp: declare 'struct device' before using it In some configurations, including this header leads to a warning: drivers/staging/media/atomisp//pci/sh_css_firmware.h:41:38: error: declaration of 'struct device' will not be visible outside of this function [-Werror,-Wvisibility] Make sure the struct tag is known before declaring a function that uses it as an argument. Fixes: 9d4fa1a16b28 ("media: atomisp: cleanup directory hierarchy") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit f5fbb83feba2a91c4b19389ba995175d71c51df9 Author: Mauro Carvalho Chehab Date: Sat May 30 07:38:24 2020 +0200 media: atomisp: add SPDX headers This driver is licensed under GPL 2.0, as stated inside their headers. Add the proper tag there. We should probably latter cleanup the reduntant licensing text, but this could be done later, after we get rid of other abstraction layers. Signed-off-by: Mauro Carvalho Chehab commit a5047a3400d51c043a6501f960eefc8b102c9203 Author: Sakari Ailus Date: Thu Jun 4 18:16:21 2020 +0200 media: staging: atomisp: Check return value from compat_alloc_user_space If something gets wrong, return, instead of trying to convert from a NULL pointer. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 84f1b2dc0c47b11aff3de1af237e8377e8bb7898 Author: Sakari Ailus Date: Thu Jun 4 18:16:20 2020 +0200 media: staging: atomisp: Fix compat IOCTL handling Atomisp compat IOCTL handling suffers from the same security issue than the V4L2 did. Fix this for atomisp. See more information in patch a1dfb4c48cc1 ("media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic"). Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 09013efe1c1a73154a0bf2ab14430d33e3c7d2fd Author: Sakari Ailus Date: Thu Jun 4 18:16:19 2020 +0200 media: staging: atomisp: Fix atomisp_overlay32 compat handling The struct atomisp_overlay contains overlay_start_x and overlay_start_y fields. Instead of copying the value of the overlay_start_x field between the two structs, the value of the overlay_start_y field of the compat struct was copied to the overlay_start_x field of the 64-bit kernel struct in get operation and back in put. The overlay_start_x field value was not copied from or to the user space struct. Fix this so that the value of overlay_start_x is copied to overlay_start_x and the value of overlay_start_y is copied to overlay_start_y. Also do copy blend_overlay_perc_u field only once. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f8b39c658a524485d646d5fdfe2b987e80ba172f Author: Sakari Ailus Date: Thu Jun 4 18:16:18 2020 +0200 media: staging: atomisp: There's no struct atomisp_dvs2_coefficients It's called struct atomisp_dis_coefficients. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4556cbcf80c9b40130b69968155c49ecefcebbc0 Author: Mauro Carvalho Chehab Date: Fri May 29 10:41:02 2020 +0200 media: atomisp: add some debug messages when binaries are used The ISP firmware logic is complex, as several binaries are contained into a single file. Print debug messages: - with a stack dump if binary not found; - when a firmware is selected. Signed-off-by: Mauro Carvalho Chehab commit 530c09f26179debc4bcd7a0ad6da38d75bfc0296 Author: Mauro Carvalho Chehab Date: Fri May 29 12:18:25 2020 +0200 media: atomisp: add a debug message at hmm free In order to check if aren't there any memory leaks, let's add a debug print for hmm_free(). Signed-off-by: Mauro Carvalho Chehab commit 607e954ac50ed39944db72874d80240aab15004f Author: Mauro Carvalho Chehab Date: Fri May 29 09:56:05 2020 +0200 media: atomisp: allow passing firmware name at modprobe time It can be useful to be able to test different firmware files at modprobe time, in order to be able to test different variants without much efforts. Signed-off-by: Mauro Carvalho Chehab commit 6a9c6ba7b7358ab5c6921b30ec191af4c7dfa3f6 Author: Mauro Carvalho Chehab Date: Fri May 29 09:29:58 2020 +0200 media: atomisp: print firmware data during load While there's a way to list the firmware binaries in runtime, it is worth to also print it during firmware load. One advantage is that this code also introduces additional checks with regards to invalid firmware types, which can be useful to identify problems. Signed-off-by: Mauro Carvalho Chehab commit 0cd8726c26edd1df1d7aaf2c1b9a99cfa2f52c2a Author: Mauro Carvalho Chehab Date: Fri May 29 08:10:30 2020 +0200 media: atomisp: provide more details about the firmware binaries In order to make easier to identify what a firmware file contains, add more info at the firmware dump log facility. Signed-off-by: Mauro Carvalho Chehab commit cfb65c15d784d517b60b16ca917a42f68978740c Author: Vitaly Kuznetsov Date: Wed Jun 10 18:41:16 2020 +0200 KVM: selftests: fix sync_with_host() in smm_test It was reported that older GCCs compile smm_test in a way that breaks it completely: kvm_exit: reason EXIT_CPUID rip 0x4014db info 0 0 func 7ffffffd idx 830 rax 0 rbx 0 rcx 0 rdx 0, cpuid entry not found ... kvm_exit: reason EXIT_MSR rip 0x40abd9 info 0 0 kvm_msr: msr_read 487 = 0x0 (#GP) ... Note, '7ffffffd' was supposed to be '80000001' as we're checking for SVM. Dropping '-O2' from compiler flags help. Turns out, asm block in sync_with_host() is wrong. We us 'in 0xe, %%al' instruction to sync with the host and in 'AL' register we actually pass the parameter (stage) but after sync 'AL' gets written to but GCC thinks the value is still there and uses it to compute 'EAX' for 'cpuid'. smm_test can't fully use standard ucall() framework as we need to write a very simple SMI handler there. Fix the immediate issue by making RAX input/output operand. While on it, make sync_with_host() static inline. Reported-by: Marcelo Bandeira Condotta Signed-off-by: Vitaly Kuznetsov Message-Id: <20200610164116.770811-1-vkuznets@redhat.com> Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 2a18b7e7cd8882f626316c340c6f2fca49b5fa12 Author: Vitaly Kuznetsov Date: Wed Jun 10 19:55:32 2020 +0200 KVM: async_pf: Inject 'page ready' event only if 'page not present' was previously injected 'Page not present' event may or may not get injected depending on guest's state. If the event wasn't injected, there is no need to inject the corresponding 'page ready' event as the guest may get confused. E.g. Linux thinks that the corresponding 'page not present' event wasn't delivered *yet* and allocates a 'dummy entry' for it. This entry is never freed. Note, 'wakeup all' events have no corresponding 'page not present' event and always get injected. s390 seems to always be able to inject 'page not present', the change is effectively a nop. Suggested-by: Vivek Goyal Signed-off-by: Vitaly Kuznetsov Message-Id: <20200610175532.779793-2-vkuznets@redhat.com> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=208081 Signed-off-by: Paolo Bonzini commit 7863e346e1089b40cac1c7d9098314c405e2e1e3 Author: Vitaly Kuznetsov Date: Wed Jun 10 19:55:31 2020 +0200 KVM: async_pf: Cleanup kvm_setup_async_pf() schedule_work() returns 'false' only when the work is already on the queue and this can't happen as kvm_setup_async_pf() always allocates a new one. Also, to avoid potential race, it makes sense to to schedule_work() at the very end after we've added it to the queue. While on it, do some minor cleanup. gfn_to_pfn_async() mentioned in a comment does not currently exist and, moreover, we can check kvm_is_error_hva() at the very beginning, before we try to allocate work so 'retry_sync' label can go away completely. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200610175532.779793-1-vkuznets@redhat.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit cd18eaeaffa6e5291cdbcd591334d577c4e897df Author: Colin Ian King Date: Wed Jun 10 00:31:21 2020 +0100 kvm: i8254: remove redundant assignment to pointer s The pointer s is being assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Message-Id: <20200609233121.1118683-1-colin.king@canonical.com> Fixes: 7837699fa6d7 ("KVM: In kernel PIT model") Signed-off-by: Paolo Bonzini commit 384dea1c9183880be183cfaae161d99aafd16df6 Author: Felipe Franciosi Date: Tue May 19 08:11:22 2020 +0000 KVM: x86: respect singlestep when emulating instruction When userspace configures KVM_GUESTDBG_SINGLESTEP, KVM will manage the presence of X86_EFLAGS_TF via kvm_set/get_rflags on vcpus. The actual rflag bit is therefore hidden from callers. That includes init_emulate_ctxt() which uses the value returned from kvm_get_flags() to set ctxt->tf. As a result, x86_emulate_instruction() will skip a single step, leaving singlestep_rip stale and not returning to userspace. This resolves the issue by observing the vcpu guest_debug configuration alongside ctxt->tf in x86_emulate_instruction(), performing the single step if set. Cc: stable@vger.kernel.org Signed-off-by: Felipe Franciosi Message-Id: <20200519081048.8204-1-felipe@nutanix.com> Signed-off-by: Paolo Bonzini commit 7e464770a434f7e29bad4b2da7894d32775d6d6f Author: Vitaly Kuznetsov Date: Wed Jun 10 15:58:47 2020 +0200 KVM: selftests: Don't probe KVM_CAP_HYPERV_ENLIGHTENED_VMCS when nested VMX is unsupported KVM_CAP_HYPERV_ENLIGHTENED_VMCS will be reported as supported even when nested VMX is not, fix evmcs_test/hyperv_cpuid tests to check for both. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200610135847.754289-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 41a23ab336fbf4d01036e1aa6369d7364aa29b4c Author: Vitaly Kuznetsov Date: Wed Jun 10 15:58:46 2020 +0200 KVM: selftests: do not substitute SVM/VMX check with KVM_CAP_NESTED_STATE check state_test/smm_test use KVM_CAP_NESTED_STATE check as an indicator for nested VMX/SVM presence and this is incorrect. Check for the required features dirrectly. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200610135847.754289-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 77f81f37fb1fdce76304cc7858e91b223bfcef72 Merge: 80fbd280beea 2ebac8bb3c2d Author: Paolo Bonzini Date: Tue Jun 9 06:08:48 2020 -0400 Merge branch 'kvm-basic-exit-reason' into HEAD Using a topic branch so that stable branches can simply cherry-pick the patch. Reviewed-by: Oliver Upton Signed-off-by: Paolo Bonzini commit f90e73ce803c5b0444e347e4f667369de2a4b427 Author: Mauro Carvalho Chehab Date: Fri May 29 08:15:52 2020 +0200 media: atomisp: get rid of system_types.h This is just a wrapper for system_local.h. Signed-off-by: Mauro Carvalho Chehab commit 85b606e02ad7b9c6a168b4a4a86177d384fc76e8 Author: Mauro Carvalho Chehab Date: Thu May 28 12:35:44 2020 +0200 media: atomisp: get rid of a bunch of other wrappers There are too many wrapper functions at atomisp_compat_css20.c. Get rid of another set of such wrappers. Signed-off-by: Mauro Carvalho Chehab commit d9ab83953fa700cc7be319cea1ec747601a124a1 Author: Mauro Carvalho Chehab Date: Thu May 28 12:11:57 2020 +0200 media: atomisp: don't cause a warn if probe failed When probe fails, it is possible that hmm_init() to not be called. On such case, hmm_cleanup() will cause a WARN_ON(). Avoid it by adding an explicit check at hmm_cleanup() to ensure that the hmm code was properly initialized. Signed-off-by: Mauro Carvalho Chehab commit a86b4936ba6827e7c1b658d522412e5a78c03242 Author: Mauro Carvalho Chehab Date: Fri May 29 08:42:56 2020 +0200 media: atomisp: get rid of an error abstraction layer There is an abstraction layer there meant to convert to the Linux standard error codes. As the driver now use such errors everywhere. we can get rid of this. Signed-off-by: Mauro Carvalho Chehab commit 41022d35ddf219361f33b59034cc67430a6a590f Author: Mauro Carvalho Chehab Date: Thu May 28 10:01:53 2020 +0200 media: atomisp: get rid of non-Linux error codes The atomisp driver has its own error codes under the ia_css_err.h file. On several places, those got already replaced by standard error codes, but there are still a lot more to be fixed. Let's get rid of all of those, mapping them into the already-existing set of Linux error codes. Signed-off-by: Mauro Carvalho Chehab commit abbd669dbfbb8c68936b575fe296af3a3184ed3d Author: Mauro Carvalho Chehab Date: Thu May 28 10:29:31 2020 +0200 media: atomisp: do another round of coding style cleanup Run checkpatch --fix-inline again, in order to get rid of some additional issues that got introduced (or that checkpatch can now detect). This should help preventing receiving random cleanups, while keeping the code on a better shape. Signed-off-by: Mauro Carvalho Chehab commit 1a16d54539785d48db4fa44c16738bfb1c624e6f Author: Mauro Carvalho Chehab Date: Thu May 28 09:31:23 2020 +0200 media: atomisp: remove some trivial wrappers from compat css20 There are tons of code inside atomisp_compat_css20.c, but several of them are just trivial wrappers to other functions. Getting rid of all of them will take some time, but let's start getting rid of some of the trivial ones. Signed-off-by: Mauro Carvalho Chehab commit cadcec76ef1f167c628dcc59d6dfca257a56640b Author: Mauro Carvalho Chehab Date: Thu May 28 09:17:28 2020 +0200 media: atomisp: avoid an extra memset() when alloc memory Use the variant which zeroes the memory when allocating, instead of having an explicit memset. Signed-off-by: Mauro Carvalho Chehab commit 6b673fdbd594b0b75eb3ddd9f79d05f860983092 Author: Nathan Chancellor Date: Wed May 27 09:11:50 2020 +0200 media: atomisp: Remove binary_supports_input_format Clang warns: drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:1707:64: warning: implicit conversion from enumeration type 'const enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] binary_supports_input_format(xcandidate, req_in_info->format)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~^~~~~~ As it turns out, binary_supports_input_format only asserts that xcandidate is not NULL and just returns true so this call is never actually made. There are other functions that are called that assert info is not NULL so this function actually serves no purpose. Remove it. It can be brought back if needed later. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit bacefb07661733b64cb92fa7037baa1bbbf901e3 Author: Nathan Chancellor Date: Wed May 27 09:11:49 2020 +0200 media: atomisp: Avoid overflow in compute_blending Clang warns: drivers/staging/media/atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c:129:35: warning: implicit conversion from 'unsigned long' to 'int32_t' (aka 'int') changes value from 18446744073709543424 to -8192 [-Wconstant-conversion] return MAX(MIN(isp_strength, 0), -XNR_BLENDING_SCALE_FACTOR); ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ XNR_BLENDING_SCALE_FACTOR is BIT(13), or 8192, which will easily fit into a signed 32-bit integer. However, it is an unsigned long, which means that negating it is the same as subtracting that value from ULONG_MAX + 1, which causes it to be larger than a signed 32-bit integer so it gets implicitly converted. We can avoid this by using the variable isp_scale, which holds the value of XNR_BLENDING_SCALE_FACTOR already, where the implicit conversion from unsigned long to s32 already happened. If that were to ever overflow, clang would warn: https://godbolt.org/z/EeSxLG Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 541f681340c4248ce49f4dbaa64ce227914ad5e7 Author: Nathan Chancellor Date: Wed May 27 09:11:48 2020 +0200 media: atomisp: Remove unnecessary NULL check in atomisp_param Clang warns: drivers/staging/media/atomisp/pci/atomisp_cmd.c:4278:17: warning: address of 'config->info' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!&config->info) { ~ ~~~~~~~~^~~~ config cannot be NULL because it comes from an ioctl, which ensures that the user is not giving us an invalid pointer through copy_from_user. If config is not NULL, info cannot be NULL. Remove this check. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit a91727dfafe74b70f10e94b151aab837d375ce03 Author: Nathan Chancellor Date: Wed May 27 09:11:47 2020 +0200 media: atomisp: Remove unnecessary NULL checks in ia_css_pipe_load_extension Clang warns: ../drivers/staging/media/atomisp/pci/sh_css.c:8537:14: warning: address of 'pipe->output_stage' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&pipe->output_stage) ~~ ~~~~~~^~~~~~~~~~~~ ../drivers/staging/media/atomisp/pci/sh_css.c:8545:14: warning: address of 'pipe->vf_stage' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&pipe->vf_stage) ~~ ~~~~~~^~~~~~~~ output_stage and vf_stage are pointers in the middle of a struct, their addresses cannot be NULL if pipe is not NULL and pipe is already checked for NULL in this function. Simplify this if block. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 55fffcb927ba5ad6e0d6b348beefdea0478a6807 Author: Nathan Chancellor Date: Wed May 27 09:11:45 2020 +0200 media: atomisp: Remove second increment of count in atomisp_subdev_probe Clang warns: ../drivers/staging/media/atomisp/pci/atomisp_v4l2.c:1097:3: warning: variable 'count' is incremented both in the loop header and in the loop body [-Wfor-loop-analysis] count++; ^ This was probably unintentional, remove it. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit ebf89d12cae21dbefec6c8fe489ad98746087b93 Author: Nathan Chancellor Date: Wed May 27 09:11:44 2020 +0200 media: atomisp: Clean up if block in sh_css_sp_init_stage Clang warns: ../drivers/staging/media/atomisp/pci/sh_css_sp.c:1039:23: warning: address of 'binary->in_frame_info' will always evaluate to 'true' [-Wpointer-bool-conversion] } else if (&binary->in_frame_info) { ~~ ~~~~~~~~^~~~~~~~~~~~~ in_frame_info is not a pointer so if binary is not NULL, in_frame_info's address cannot be NULL. Change this to an else since it will always be evaluated as one. While we are here, clean up this if block. The contents of both if blocks are the same but a check against "stage == 0" is added when ISP2401 is defined. USE_INPUT_SYSTEM_VERSION_2401 is only defined when isp2401_system_global.h is included, which only happens when ISP2401. In other words, USE_INPUT_SYSTEM_VERSION_2401 always requires ISP2401 to be defined so the '#ifndef ISP2401' makes no sense. Remove that part of the block to simplify everything. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit bbed5b89e18148638cdd17fcc2d1d9a7368ddfe6 Author: Mauro Carvalho Chehab Date: Wed May 27 15:46:54 2020 +0200 media: atomisp: avoid OOPS due to non-existing ref_frames stage->args->delay_frames array could point to NULL frames. What's weird is that we didn't notice this behavior with the Intel Aero Yocto code. Handle it, while adding a notice at the code, as this could be due to some broken pipeline setup. Signed-off-by: Mauro Carvalho Chehab commit 9955d906f28098dfb7be9b5c75006c5f2b431772 Author: Mauro Carvalho Chehab Date: Wed May 27 14:23:31 2020 +0200 media: atomisp: remove kvmalloc/kvcalloc abstractions The sh_css layer adds an abstraction for kvmalloc/kvcalloc. Get rid of them. Most of the work here was done by this small coccinelle script: @@ expression size; @@ - sh_css_malloc(size) + kvmalloc(size, GFP_KERNEL) @@ expression n; expression size; @@ - sh_css_calloc(n, size) + kvcalloc(n, size, GFP_KERNEL) Signed-off-by: Mauro Carvalho Chehab commit 591e6a0aad547b37123274a290ab6e172bc8be9d Author: Mauro Carvalho Chehab Date: Wed May 27 14:21:26 2020 +0200 media: atomisp: add more comments about frame allocation The frame allocation logic happens differently for userptr or normal mmap. On a quick look, this sounded to be unbalanced, but the logic should actually work for both cases. Add an extra comment to reflect it. Signed-off-by: Mauro Carvalho Chehab commit 27b778c5ef59d03d0dbce2bb26730df10e8abce7 Author: Mauro Carvalho Chehab Date: Wed May 27 14:19:27 2020 +0200 media: atomisp: add debug functions for received events For debugging purposes, it helps to know what event was actually received. Signed-off-by: Mauro Carvalho Chehab commit d61ba1a2e295e9f17ab07b27a64430a0bca26bf2 Author: Mauro Carvalho Chehab Date: Wed May 27 14:18:00 2020 +0200 media: atomisp: improve warning for IRQ enable function If something gets wrong when enabling or disabling an IRQ, we should know better about what happened. Signed-off-by: Mauro Carvalho Chehab commit 03884c93560c48c2739caa9b104b0cb4d3ea8c91 Author: Mauro Carvalho Chehab Date: Tue May 26 14:35:16 2020 +0200 media: atomisp: add debug for hmm alloc The hmm code is still complex and has bugs. Add a debug print when memory gets allocated, in order to help identifying what's happening out there. Signed-off-by: Mauro Carvalho Chehab commit 14a638ab96c518f93386eae1ac460e459e775ea2 Author: Mauro Carvalho Chehab Date: Tue May 26 12:07:26 2020 +0200 media: atomisp: use pin_user_pages() for memory allocation Instead of using a hacked version of an old copy of get_user_pages(), use pin_user_pages(). Signed-off-by: Mauro Carvalho Chehab commit 19ae08554fe873136ac3f1c0d66aa0f5ac9f69dc Author: Mauro Carvalho Chehab Date: Tue May 26 13:05:21 2020 +0200 media: atomisp: fix driver caps This device driver is not MC-centric. So, remove the wrong caps from it. Signed-off-by: Mauro Carvalho Chehab commit 9ac8e4b90b09a33038e4a051313fc2547feedb80 Author: Mauro Carvalho Chehab Date: Tue May 26 10:45:00 2020 +0200 media: atomisp: use Yocto Aero default hmm pool sizes Yocto Aero driver has a different default for hmm pools. Use the definitions there. Signed-off-by: Mauro Carvalho Chehab commit e19718f6dea0d8123d7fefc8449b519bb05dff47 Author: Mauro Carvalho Chehab Date: Tue May 26 10:11:14 2020 +0200 media: atomisp: add debug message to help debugging hmm code The hmm code is partially based on a fork from 3.10 code, and has bugs. Add debug there to help tracking what happens there. Signed-off-by: Mauro Carvalho Chehab commit 576680cd014b5c6fd6d50abd8a43af83b016088f Author: Mauro Carvalho Chehab Date: Tue May 26 09:45:16 2020 +0200 media: atomisp: hmm_bo: untag user pointers The kernel ABI was extended to allow pass tagged user pointers. Untag the pointers in this function. Fixes: d93445225cd3 ("uaccess: add noop untagged_addr definition") Signed-off-by: Mauro Carvalho Chehab commit 08fef4fa947ba75cbf59d67c6be75223c6471a88 Author: Mauro Carvalho Chehab Date: Tue May 26 08:40:16 2020 +0200 media: atomisp: get rid of memory_access.c Now that we have everything in place, we can get rid of the memory_access abstraction layer. Now, everything related to heterogeneous memory management (hmm) is under hmm.c & related pools. Signed-off-by: Mauro Carvalho Chehab commit 100e89894b3b5dbec3a2b69224ef891eb83c822c Author: Mauro Carvalho Chehab Date: Tue May 26 08:13:27 2020 +0200 media: atomisp: change the type returned by mmgr alloc The mmgr alloc code returns a different type than hmm, due to some abstraction layer. Change the driver to use just one type to represent the hmm memory. Signed-off-by: Mauro Carvalho Chehab commit dc50fa18af5150f488b620aa4f91a11f3704e119 Author: Mauro Carvalho Chehab Date: Tue May 26 08:10:18 2020 +0200 media: atomisp: get rid of unused memory_realloc code The code for it is commented out, probably because it is broken or uneeded for the driver to work. So, let's get rid of it. Signed-off-by: Mauro Carvalho Chehab commit 5472b4db3f093274035c2e8a05c8d5a410224d6a Author: Mauro Carvalho Chehab Date: Tue May 26 08:02:00 2020 +0200 media: atomisp: get rid of mmgr_load and mmgr_store Those functions are just wrappers for hmm_load/hmm_store. Signed-off-by: Mauro Carvalho Chehab commit b92d99aec5d6221e386160801c99bafc291e6515 Author: Mauro Carvalho Chehab Date: Mon May 25 12:46:23 2020 +0200 media: atomisp: go one step further to drop ia_css_memory_access.c Move the attrs handling into hmm, simplifying even further what the ia_css_memory_access.c file does. Yet, the returned type for ia_css_memory_access.c is an integer, instead of a pointer. Signed-off-by: Mauro Carvalho Chehab commit 86df6ff2422ae9897c89f1aaf61e00c021239dfe Author: Mauro Carvalho Chehab Date: Mon May 25 11:33:24 2020 +0200 media: atomisp: reduce abstraction at ia_css_memory_access Yet another memory abstraction layer. Getting rid of this may be a little trickier, but let's reduce it to a minimal. Signed-off-by: Mauro Carvalho Chehab commit 4fba2916f6a585a4b46cd3216a08c2cd55625e52 Author: Mauro Carvalho Chehab Date: Mon May 25 10:53:20 2020 +0200 media: atomisp: get rid of the hrt/hive_isp_css_mm_hrt abstraction layer Simplify the code by removing this extra memory management abstraction layer. Signed-off-by: Mauro Carvalho Chehab commit 2323994338e7d5d68cc6826f2a887b0d87e5e2df Author: Mauro Carvalho Chehab Date: Mon May 25 10:11:49 2020 +0200 media: atomisp: simplify hive_isp_css_mm_hrt wrapper The code there is a wrapper for hmm/ wrapper. Simplify it, and get rid of ION-specific code. Signed-off-by: Mauro Carvalho Chehab commit 02ab76491bdcfe6f82745ea84d11e58c13827eb7 Author: Colin Ian King Date: Thu May 21 21:44:32 2020 +0200 media: atomisp: fix a handful of spelling mistakes There are several spelling mistakes in various messages and literal strings. Fix these. Signed-off-by: Colin Ian King Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d573933c80bd0fe32beb4fba93b965b1fe82411a Author: Mauro Carvalho Chehab Date: Sun May 24 09:11:07 2020 +0200 media: atomisp: fix size of delay_frames array Right now, the variables that define the max number of delay frames is defined as: #define VIDEO_FRAME_DELAY 2 #define MAX_NUM_VIDEO_DELAY_FRAMES (VIDEO_FRAME_DELAY + 1) #define NUM_PREVIEW_DVS_FRAMES (2) #define MAX_NUM_DELAY_FRAMES MAX(MAX_NUM_VIDEO_DELAY_FRAMES, NUM_PREVIEW_DVS_FRAMES) In other words, we have: MAX_NUM_VIDEO_DELAY_FRAMES = 3 MAX_NUM_DELAY_FRAMES = 2 The MAX_NUM_DELAY_FRAMES macro is used only only when allocating memory. On all other parts, including looping over such array, MAX_NUM_VIDEO_DELAY_FRAMES is used instead, like: void sh_css_binary_args_reset(struct sh_css_binary_args *args) { unsigned int i; ... for (i = 0; i < MAX_NUM_VIDEO_DELAY_FRAMES; i++) args->delay_frames[i] = NULL; Which will cause buffer overflows, with may override the next array (tnr_frames[]). In practice, this may not be causing real issues, as the code checks for num_delay_frames on some parts (but not everywhere). So, get rid of the smallest value. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f611797795f2d19e565f38c20516427596a0f27f Author: Mauro Carvalho Chehab Date: Sun May 24 08:56:58 2020 +0200 media: atomisp: drop a cast for a const argument Some arguments for tnf and ref settings are meant to be const, but they're defined without such annotation. Due to that, there's an ugly cast at sh_css_sp.c. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit c01d5546773e3a1587c86cb1fdd6a7b114874e9b Author: Mauro Carvalho Chehab Date: Thu May 21 12:07:53 2020 +0200 media: atomisp: partially get rid of one abstraction layer The very same macros are defined as CSS_foo and IA_CSS_foo. Remove this abstraction, as it just make things confusing, for no good reason. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit bdfdd9e7df0afb28f741ff2e3231aa14732d8594 Author: Mauro Carvalho Chehab Date: Sat May 23 16:59:14 2020 +0200 media: atomisp: make it use dbg_level to control debug level This driver has 3 different types of debug messages: - dev_dbg() - dbg_level - ia_css_debug_trace_level Which is crazy. Ideally, it shold just use dev_dbg() everywhere, but for now let's unify the last two machanisms. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6b3a422b7364334543944edef73b2e6e28a77795 Author: Mauro Carvalho Chehab Date: Sat May 23 16:44:42 2020 +0200 media: atomisp: get rid of some old broken debug code It sounds that someone once changed the debug level at compile time for some testing, but forgot to remove the legacy code after finishing debuging it. Get rid of the dead code. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2a693c3e186c6651ce8980c777a5ba87179c93a7 Author: Mauro Carvalho Chehab Date: Fri May 22 14:01:00 2020 +0200 media: atomisp: update TODO list Let's reflect the current status at the TODO list, as other developers can help addressing issues over there. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9c30f50d14c8779465bc8eb5e2b68fd840ca77f4 Author: Mauro Carvalho Chehab Date: Thu May 21 10:04:49 2020 +0200 media: atomisp: don't flood dmesg with -EAGAIN return codes Using DQBUF on non-blocking mode will return -EAGAIN if nothing arrives. Printing it has no value, even for debug purposes. So, only display real return codes. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 171b7bd66ab85437d377878650d2e4bcef2fee68 Author: Mauro Carvalho Chehab Date: Thu May 21 00:10:04 2020 +0200 media: atomisp: improve debug messages for set format There are several error conditions that don't print anything, making harder to identify bugs at the code there. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 370f6e5aaa22969db3e96a43e2e718b978a1b5c9 Author: Mauro Carvalho Chehab Date: Thu May 21 09:43:01 2020 +0200 media: atomisp: avoid a copy of v4l2_mbus_framefmt at stack There's no reason to copy isp_sink_fmt, as the driver uses it for read-only purposes. Linux stack is a precious resource. Let's avoid wasting it. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit aaebb6547610e7c739507e389296eb36aacc7908 Author: Mauro Carvalho Chehab Date: Thu May 21 09:05:11 2020 +0200 media: atomisp: reduce debug printk rate when IRQs are received Currently, when an EOF IRQ is received, it generates two messages: [ 59.191893] atomisp-isp2 0000:00:03.0: irq:0x200000 [ 59.191913] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 142, asd 0 Flooding the dmesg with lots of messages per second. The same pattern happens for all other IRQs. Change the logic for printing just one message per IRQ and rate-limit those, as, for debugging purposes, it is usually interesting to know that IRQs are being received, but not displaying every single one. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8ef6b8a67b015b4abe74d0488569a47e1f729a9b Author: Mauro Carvalho Chehab Date: Wed May 20 23:04:09 2020 +0200 media: atomisp: get rid of hmm_vm.c This is not used anywhere. So, let's trash it. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7b53e162f25835f9afb7f0025337319fe5c0dfc1 Author: Mauro Carvalho Chehab Date: Wed May 20 07:28:50 2020 +0200 media: atomisp: fix pipeline initialization code The code under load_primary_binaries() is complex and were hard to understand, because it used to have lots of ifdefs and broken identation. The patch which cleaned it and removed the version-specific ifdefs added a regression. Solve it. Fixes: 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version") Signed-off-by: Mauro Carvalho Chehab commit 65a6543da386838f935d2f03f452c5c0acff2a68 Author: Xiaoguang Wang Date: Thu Jun 11 23:39:36 2020 +0800 io_uring: fix io_kiocb.flags modification race in IOPOLL mode While testing io_uring in arm, we found sometimes io_sq_thread() keeps polling io requests even though there are not inflight io requests in block layer. After some investigations, found a possible race about io_kiocb.flags, see below race codes: 1) in the end of io_write() or io_read() req->flags &= ~REQ_F_NEED_CLEANUP; kfree(iovec); return ret; 2) in io_complete_rw_iopoll() if (res != -EAGAIN) req->flags |= REQ_F_IOPOLL_COMPLETED; In IOPOLL mode, io requests still maybe completed by interrupt, then above codes are not safe, concurrent modifications to req->flags, which is not protected by lock or is not atomic modifications. I also had disassemble io_complete_rw_iopoll() in arm: req->flags |= REQ_F_IOPOLL_COMPLETED; 0xffff000008387b18 <+76>: ldr w0, [x19,#104] 0xffff000008387b1c <+80>: orr w0, w0, #0x1000 0xffff000008387b20 <+84>: str w0, [x19,#104] Seems that the "req->flags |= REQ_F_IOPOLL_COMPLETED;" is load and modification, two instructions, which obviously is not atomic. To fix this issue, add a new iopoll_completed in io_kiocb to indicate whether io request is completed. Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 2ebac8bb3c2d35f5135466490fc8eeaf3f3e2d37 Author: Sean Christopherson Date: Thu Feb 27 09:44:30 2020 -0800 KVM: nVMX: Consult only the "basic" exit reason when routing nested exit Consult only the basic exit reason, i.e. bits 15:0 of vmcs.EXIT_REASON, when determining whether a nested VM-Exit should be reflected into L1 or handled by KVM in L0. For better or worse, the switch statement in nested_vmx_exit_reflected() currently defaults to "true", i.e. reflects any nested VM-Exit without dedicated logic. Because the case statements only contain the basic exit reason, any VM-Exit with modifier bits set will be reflected to L1, even if KVM intended to handle it in L0. Practically speaking, this only affects EXIT_REASON_MCE_DURING_VMENTRY, i.e. a #MC that occurs on nested VM-Enter would be incorrectly routed to L1, as "failed VM-Entry" is the only modifier that KVM can currently encounter. The SMM modifiers will never be generated as KVM doesn't support/employ a SMI Transfer Monitor. Ditto for "exit from enclave", as KVM doesn't yet support virtualizing SGX, i.e. it's impossible to enter an enclave in a KVM guest (L1 or L2). Fixes: 644d711aa0e1 ("KVM: nVMX: Deciding if L0 or L1 should handle an L2 exit") Cc: Jim Mattson Cc: Xiaoyao Li Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20200227174430.26371-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 03fe7aaf0c3d40ef7feff2bdc7180c146989586a Author: Krzysztof Kozlowski Date: Wed Jun 10 17:41:57 2020 +0200 spi: spi-fsl-dspi: Free DMA memory with matching function Driver allocates DMA memory with dma_alloc_coherent() but frees it with dma_unmap_single(). This causes DMA warning during system shutdown (with DMA debugging) on Toradex Colibri VF50 module: WARNING: CPU: 0 PID: 1 at ../kernel/dma/debug.c:1036 check_unmap+0x3fc/0xb04 DMA-API: fsl-edma 40098000.dma-controller: device driver frees DMA memory with wrong function [device address=0x0000000087040000] [size=8 bytes] [mapped as coherent] [unmapped as single] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree) (unwind_backtrace) from [<8010bb34>] (show_stack+0x10/0x14) (show_stack) from [<8011ced8>] (__warn+0xf0/0x108) (__warn) from [<8011cf64>] (warn_slowpath_fmt+0x74/0xb8) (warn_slowpath_fmt) from [<8017d170>] (check_unmap+0x3fc/0xb04) (check_unmap) from [<8017d900>] (debug_dma_unmap_page+0x88/0x90) (debug_dma_unmap_page) from [<80601d68>] (dspi_release_dma+0x88/0x110) (dspi_release_dma) from [<80601e4c>] (dspi_shutdown+0x5c/0x80) (dspi_shutdown) from [<805845f8>] (device_shutdown+0x17c/0x220) (device_shutdown) from [<80143ef8>] (kernel_restart+0xc/0x50) (kernel_restart) from [<801441cc>] (__do_sys_reboot+0x18c/0x210) (__do_sys_reboot) from [<80100060>] (ret_fast_syscall+0x0/0x28) DMA-API: Mapped at: dma_alloc_attrs+0xa4/0x130 dspi_probe+0x568/0x7b4 platform_drv_probe+0x6c/0xa4 really_probe+0x208/0x348 driver_probe_device+0x5c/0xb4 Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid") Signed-off-by: Krzysztof Kozlowski Acked-by: Vladimir Oltean Cc: Link: https://lore.kernel.org/r/1591803717-11218-1-git-send-email-krzk@kernel.org Signed-off-by: Mark Brown commit 7bb64402a092136fb2fda995b0e0304b43c163c5 Author: Qing Zhang Date: Thu Jun 11 20:56:52 2020 +0800 spi: tools: Add macro definitions to fix build errors Add SPI_TX_OCTAL and SPI_RX_OCTAL to fix the following build errors: CC spidev_test.o spidev_test.c: In function ‘transfer’: spidev_test.c:131:13: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function) if (mode & SPI_TX_OCTAL) ^ spidev_test.c:131:13: note: each undeclared identifier is reported only once for each function it appears in spidev_test.c:137:13: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function) if (mode & SPI_RX_OCTAL) ^ spidev_test.c: In function ‘parse_opts’: spidev_test.c:290:12: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function) mode |= SPI_TX_OCTAL; ^ spidev_test.c:308:12: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function) mode |= SPI_RX_OCTAL; ^ LD spidev_test-in.o ld: cannot find spidev_test.o: No such file or directory Additionally, maybe SPI_CS_WORD and SPI_3WIRE_HIZ will be used in the future, so add them too. Fixes: 896fa735084e ("spi: spidev_test: Add support for Octal mode data transfers") Signed-off-by: Qing Zhang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1591880212-13479-2-git-send-email-zhangqing@loongson.cn Signed-off-by: Mark Brown commit bd2077915bfebf6965480753f9dd6a8319d06d14 Author: Qing Zhang Date: Thu Jun 11 20:56:51 2020 +0800 spi: tools: Make default_tx/rx and input_tx static Fix the following sparse warning: ./spidev_test.c:50:9: warning: symbol 'default_tx' was not declared. Should it be static? ./spidev_test.c:59:9: warning: symbol 'default_rx' was not declared. Should it be static? ./spidev_test.c:60:6: warning: symbol 'input_tx' was not declared. Should it be static? Signed-off-by: Qing Zhang Link: https://lore.kernel.org/r/1591880212-13479-1-git-send-email-zhangqing@loongson.cn Signed-off-by: Mark Brown commit 9a6a5738abf82d6f467a31f1f6779e495462f7af Author: Colin Ian King Date: Thu Jun 11 15:35:27 2020 +0100 umem: remove redundant initialization of variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King Addresses-Coverity: ("Unused value") Signed-off-by: Jens Axboe commit 8d20319e29796c86dd4be26024219c52748fb6bd Author: Colin Ian King Date: Thu Jun 11 15:30:14 2020 +0100 pktcdvd: remove redundant initialization of variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King Addresses-Coverity: ("Unused value") Signed-off-by: Jens Axboe commit 819f7b88b48fd2bce932cfe3a38bf8fcefbcabe7 Author: Chaitanya Kulkarni Date: Tue Jun 9 16:55:14 2020 -0700 nvmet: fail outstanding host posted AEN req In function nvmet_async_event_process() we only process AENs iff there is an open slot on the ctrl->async_event_cmds[] && aen event list posted by the target is not empty. This keeps host posted AEN outstanding if target generated AEN list is empty. We do cleanup the target generated entries from the aen list in nvmet_ctrl_free()-> nvmet_async_events_free() but we don't process AEN posted by the host. This leads to following problem :- When processing admin sq at the time of nvmet_sq_destroy() holds an extra percpu reference(atomic value = 1), so in the following code path after switching to atomic rcu, release function (nvmet_sq_free()) is not getting called which blocks the sq->free_done in nvmet_sq_destroy() :- nvmet_sq_destroy() percpu_ref_kill_and_confirm() - __percpu_ref_switch_mode() -- __percpu_ref_switch_to_atomic() --- call_rcu() -> percpu_ref_switch_to_atomic_rcu() ---- /* calls switch callback */ - percpu_ref_put() -- percpu_ref_put_many(ref, 1) --- else if (unlikely(atomic_long_sub_and_test(nr, &ref->count))) ---- ref->release(ref); <---- Not called. This results in indefinite hang:- void nvmet_sq_destroy(struct nvmet_sq *sq) ... if (ctrl && ctrl->sqs && ctrl->sqs[0] == sq) { nvmet_async_events_process(ctrl, status); percpu_ref_put(&sq->ref); } percpu_ref_kill_and_confirm(&sq->ref, nvmet_confirm_sq); wait_for_completion(&sq->confirm_done); wait_for_completion(&sq->free_done); <-- Hang here Which breaks the further disconnect sequence. This problem seems to be introduced after commit 64f5e9cdd711b ("nvmet: fix memory leak when removing namespaces and controllers concurrently"). This patch processes ctrl->async_event_cmds[] in the admin sq destroy() context irrespetive of aen_list. Also we get rid of the controller's aen_list processing in the nvmet_sq_destroy() context and just ignore ctrl->aen_list. This results in nvmet_async_events_process() being called from workqueue context so we adjust the code accordingly. Fixes: 64f5e9cdd711 ("nvmet: fix memory leak when removing namespaces and controllers concurrently ") Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b97120b15ebd3de51325084136d3b9c3cce656d6 Author: Christoph Hellwig Date: Wed Jun 3 08:24:17 2020 +0200 nvme-pci: use simple suspend when a HMB is enabled While the NVMe specification allows the device to access the host memory buffer in host DRAM from all power states, hosts will fail access to DRAM during S3 and similar power states. Fixes: d916b1be94b6 ("nvme-pci: use host managed power state for suspend") Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit c9c12e51b82b2bd0c59ac4e27ee5427f382a503f Author: Daniel Wagner Date: Fri May 29 13:37:40 2020 +0200 nvme-fc: don't call nvme_cleanup_cmd() for AENs Asynchronous event notifications do not have an associated request. When fcp_io() fails we unconditionally call nvme_cleanup_cmd() which leads to a crash. Fixes: 16686f3a6c3c ("nvme: move common call to nvme_cleanup_cmd to core layer") Signed-off-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit a40aae6bbf8dea09fbe6353a5635f4027c43c796 Author: Max Gurtovoy Date: Mon Jun 1 20:05:20 2020 +0300 nvmet-tcp: constify nvmet_tcp_ops nvmet_tcp_ops is never modified and can be made const to allow the compiler to put it in read-only memory, as done in other transports. Before: text data bss dec hex filename 16164 160 12 16336 3fd0 drivers/nvme/target/tcp.o After: text data bss dec hex filename 16277 64 12 16353 3fe1 drivers/nvme/target/tcp.o Signed-off-by: Max Gurtovoy Reviewed-by: Himanshu Madhani Reviewed-by: Israel Rukshin Acked-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6acbd9619b153f2881c91e84cd36a9a2ce124565 Author: Rikard Falkeborn Date: Fri May 29 00:25:07 2020 +0200 nvme-tcp: constify nvme_tcp_mq_ops and nvme_tcp_admin_mq_ops nvme_tcp_mq_ops and nvme_tcp_admin_mq_ops are never modified and can be made const to allow the compiler to put them in read-only memory. Before: text data bss dec hex filename 53102 6885 576 60563 ec93 drivers/nvme/host/tcp.o After: text data bss dec hex filename 53422 6565 576 60563 ec93 drivers/nvme/host/tcp.o Signed-off-by: Rikard Falkeborn Acked-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 108a58585b196e31822c597891f2c83cea7aeb4a Author: Niklas Cassel Date: Sun Jun 7 13:45:20 2020 +0200 nvme: do not call del_gendisk() on a disk that was never added device_add_disk() is negated by del_gendisk(). alloc_disk_node() is negated by put_disk(). In nvme_alloc_ns(), device_add_disk() is one of the last things being called in the success case, and only void functions are being called after this. Therefore this call should not be negated in the error path. The superfluous call to del_gendisk() leads to the following prints: [ 7.839975] kobject: '(null)' (000000001ff73734): is not initialized, yet kobject_put() is being called. [ 7.840865] WARNING: CPU: 2 PID: 361 at lib/kobject.c:736 kobject_put+0x70/0x120 Fixes: 33cfdc2aa696 ("nvme: enforce extended LBA format for fabrics metadata") Signed-off-by: Niklas Cassel Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 811985365378df01386c3cfb7ff716e74ca376d5 Author: Ritesh Harjani Date: Tue Jun 9 16:23:10 2020 +0530 ext4: mballoc: Use this_cpu_read instead of this_cpu_ptr Simplify reading a seq variable by directly using this_cpu_read API instead of doing this_cpu_ptr and then dereferencing it. This also avoid the below kernel BUG: which happens when CONFIG_DEBUG_PREEMPT is enabled BUG: using smp_processor_id() in preemptible [00000000] code: syz-fuzzer/6927 caller is ext4_mb_new_blocks+0xa4d/0x3b70 fs/ext4/mballoc.c:4711 CPU: 1 PID: 6927 Comm: syz-fuzzer Not tainted 5.7.0-next-20200602-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 check_preemption_disabled+0x20d/0x220 lib/smp_processor_id.c:48 ext4_mb_new_blocks+0xa4d/0x3b70 fs/ext4/mballoc.c:4711 ext4_ext_map_blocks+0x201b/0x33e0 fs/ext4/extents.c:4244 ext4_map_blocks+0x4cb/0x1640 fs/ext4/inode.c:626 ext4_getblk+0xad/0x520 fs/ext4/inode.c:833 ext4_bread+0x7c/0x380 fs/ext4/inode.c:883 ext4_append+0x153/0x360 fs/ext4/namei.c:67 ext4_init_new_dir fs/ext4/namei.c:2757 [inline] ext4_mkdir+0x5e0/0xdf0 fs/ext4/namei.c:2802 vfs_mkdir+0x419/0x690 fs/namei.c:3632 do_mkdirat+0x21e/0x280 fs/namei.c:3655 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 42f56b7a4a7d ("ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling") Suggested-by: Borislav Petkov Tested-by: Marek Szyprowski Signed-off-by: Ritesh Harjani Reviewed-by: Christoph Hellwig Reported-by: syzbot+82f324bb69744c5f6969@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/534f275016296996f54ecf65168bb3392b6f653d.1591699601.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 2ce3ee931a097e9720310db3f09c01c825a4580c Author: Eric Biggers Date: Mon Jun 1 13:05:43 2020 -0700 ext4: avoid utf8_strncasecmp() with unstable name If the dentry name passed to ->d_compare() fits in dentry::d_iname, then it may be concurrently modified by a rename. This can cause undefined behavior (possibly out-of-bounds memory accesses or crashes) in utf8_strncasecmp(), since fs/unicode/ isn't written to handle strings that may be concurrently modified. Fix this by first copying the filename to a stack buffer if needed. This way we get a stable snapshot of the filename. Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups") Cc: # v5.2+ Cc: Al Viro Cc: Daniel Rosenberg Cc: Gabriel Krisman Bertazi Signed-off-by: Eric Biggers Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20200601200543.59417-1-ebiggers@kernel.org Signed-off-by: Theodore Ts'o commit 5adaccac46ea79008d7b75f47913f1a00f91d0ce Author: yangerkun Date: Mon Jun 1 15:34:04 2020 +0800 ext4: stop overwrite the errcode in ext4_setup_super Now the errcode from ext4_commit_super will overwrite EROFS exists in ext4_setup_super. Actually, no need to call ext4_commit_super since we will return EROFS. Fix it by goto done directly. Fixes: c89128a00838 ("ext4: handle errors on ext4_commit_super") Signed-off-by: yangerkun Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200601073404.3712492-1-yangerkun@huawei.com Signed-off-by: Theodore Ts'o commit 6476b60f32866be49d05e2e0163f337374c55b06 Author: Srinivas Kandagatla Date: Thu Jun 11 13:41:53 2020 +0100 ASoC: q6asm: handle EOS correctly Successful send of EOS command does not indicate that EOS is actually finished, correct event to wait EOS is finished is EOS_RENDERED event. EOS_RENDERED means that the DSP has finished processing all the buffers for that particular session and stream. This patch fixes EOS handling! Fixes: 68fd8480bb7b ("ASoC: qdsp6: q6asm: Add support to audio stream apis") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200611124159.20742-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit cfb3c85a600c6aa25a2581b3c1c4db3460f14e46 Author: Jeffle Xu Date: Fri May 22 12:18:44 2020 +0800 ext4: fix partial cluster initialization when splitting extent Fix the bug when calculating the physical block number of the first block in the split extent. This bug will cause xfstests shared/298 failure on ext4 with bigalloc enabled occasionally. Ext4 error messages indicate that previously freed blocks are being freed again, and the following fsck will fail due to the inconsistency of block bitmap and bg descriptor. The following is an example case: 1. First, Initialize a ext4 filesystem with cluster size '16K', block size '4K', in which case, one cluster contains four blocks. 2. Create one file (e.g., xxx.img) on this ext4 filesystem. Now the extent tree of this file is like: ... 36864:[0]4:220160 36868:[0]14332:145408 51200:[0]2:231424 ... 3. Then execute PUNCH_HOLE fallocate on this file. The hole range is like: .. ext4_ext_remove_space: dev 254,16 ino 12 since 49506 end 49506 depth 1 ext4_ext_remove_space: dev 254,16 ino 12 since 49544 end 49546 depth 1 ext4_ext_remove_space: dev 254,16 ino 12 since 49605 end 49607 depth 1 ... 4. Then the extent tree of this file after punching is like ... 49507:[0]37:158047 49547:[0]58:158087 ... 5. Detailed procedure of punching hole [49544, 49546] 5.1. The block address space: ``` lblk ~49505 49506 49507~49543 49544~49546 49547~ ---------+------+-------------+----------------+-------- extent | hole | extent | hole | extent ---------+------+-------------+----------------+-------- pblk ~158045 158046 158047~158083 158084~158086 158087~ ``` 5.2. The detailed layout of cluster 39521: ``` cluster 39521 <-------------------------------> hole extent <----------------------><-------- lblk 49544 49545 49546 49547 +-------+-------+-------+-------+ | | | | | +-------+-------+-------+-------+ pblk 158084 1580845 158086 158087 ``` 5.3. The ftrace output when punching hole [49544, 49546]: - ext4_ext_remove_space (start 49544, end 49546) - ext4_ext_rm_leaf (start 49544, end 49546, last_extent [49507(158047), 40], partial [pclu 39522 lblk 0 state 2]) - ext4_remove_blocks (extent [49507(158047), 40], from 49544 to 49546, partial [pclu 39522 lblk 0 state 2] - ext4_free_blocks: (block 158084 count 4) - ext4_mballoc_free (extent 1/6753/1) 5.4. Ext4 error message in dmesg: EXT4-fs error (device vdb): mb_free_blocks:1457: group 1, block 158084:freeing already freed block (bit 6753); block bitmap corrupt. EXT4-fs error (device vdb): ext4_mb_generate_buddy:747: group 1, block bitmap and bg descriptor inconsistent: 19550 vs 19551 free clusters In this case, the whole cluster 39521 is freed mistakenly when freeing pblock 158084~158086 (i.e., the first three blocks of this cluster), although pblock 158087 (the last remaining block of this cluster) has not been freed yet. The root cause of this isuue is that, the pclu of the partial cluster is calculated mistakenly in ext4_ext_remove_space(). The correct partial_cluster.pclu (i.e., the cluster number of the first block in the next extent, that is, lblock 49597 (pblock 158086)) should be 39521 rather than 39522. Fixes: f4226d9ea400 ("ext4: fix partial cluster initialization") Signed-off-by: Jeffle Xu Reviewed-by: Eric Whitney Cc: stable@kernel.org # v3.19+ Link: https://lore.kernel.org/r/1590121124-37096-1-git-send-email-jefflexu@linux.alibaba.com Signed-off-by: Theodore Ts'o commit 829b37b8cddb1db75c1b7905505b90e593b15db1 Author: Theodore Ts'o Date: Wed Jun 10 11:16:37 2020 -0400 ext4: avoid race conditions when remounting with options that change dax Trying to change dax mount options when remounting could allow mount options to be enabled for a small amount of time, and then the mount option change would be reverted. In the case of "mount -o remount,dax", this can cause a race where files would temporarily treated as DAX --- and then not. Cc: stable@kernel.org Reported-by: syzbot+bca9799bf129256190da@syzkaller.appspotmail.com Signed-off-by: Theodore Ts'o commit 68cd44920d2ccf32dea1502e71dc0175c9663af1 Merge: 6b8ed62008a4 15ee65676f1e Author: Theodore Ts'o Date: Thu Jun 11 10:51:44 2020 -0400 Enable ext4 support for per-file/directory dax operations This adds the same per-file/per-directory DAX support for ext4 as was done for xfs, now that we finally have consensus over what the interface should be. commit 4008b29eb47433c15ed3f242ee0132ba27dbdb67 Author: Steve Lee Date: Thu Jun 11 18:48:00 2020 +0900 ASoC: max98390: Update regmap readable reg and volatile Update max98390_readable_register and max98390_volatile_reg Signed-off-by: Steve Lee Link: https://lore.kernel.org/r/20200611094800.18422-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown commit d4060ac969563113101c79433f2ae005feca1c29 Author: Tobias Klauser Date: Wed Jun 10 15:08:04 2020 +0200 tools, bpftool: Fix memory leak in codegen error cases Free the memory allocated for the template on error paths in function codegen. Signed-off-by: Tobias Klauser Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200610130804.21423-1-tklauser@distanz.ch commit bd6fecb9a99cceb949271c1821cfbad2b2db97c6 Author: YiFei Zhu Date: Wed Jun 10 13:41:40 2020 -0500 selftests/bpf: Add cgroup_skb/egress test for load_bytes_relative When cgroup_skb/egress triggers the MAC header is not set. Added a test that asserts reading MAC header is a -EFAULT but NET header succeeds. The test result from within the eBPF program is stored in an 1-element array map that the userspace then reads and asserts on. Another assertion is added that reading from a large offset, past the end of packet, returns -EFAULT. Signed-off-by: YiFei Zhu Signed-off-by: Daniel Borkmann Reviewed-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/9028ccbea4385a620e69c0a104f469ffd655c01e.1591812755.git.zhuyifei@google.com commit 0f5d82f187e1beda3fe7295dfc500af266a5bd80 Author: YiFei Zhu Date: Wed Jun 10 13:41:39 2020 -0500 net/filter: Permit reading NET in load_bytes_relative when MAC not set Added a check in the switch case on start_header that checks for the existence of the header, and in the case that MAC is not set and the caller requests for MAC, -EFAULT. If the caller requests for NET then MAC's existence is completely ignored. There is no function to check NET header's existence and as far as cgroup_skb/egress is concerned it should always be set. Removed for ptr >= the start of header, considering offset is bounded unsigned and should always be true. len <= end - mac is redundant to ptr + len <= end. Fixes: 3eee1f75f2b9 ("bpf: fix bpf_skb_load_bytes_relative pkt length check") Signed-off-by: YiFei Zhu Signed-off-by: Daniel Borkmann Reviewed-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/76bb820ddb6a95f59a772ecbd8c8a336f646b362.1591812755.git.zhuyifei@google.com commit 7ccddc4613db446dc3cbb69a3763ba60ec651d13 Author: Tony Luck Date: Wed May 27 11:28:08 2020 -0700 x86/mce/dev-mcelog: Fix -Wstringop-truncation warning about strncpy() The kbuild test robot reported this warning: arch/x86/kernel/cpu/mce/dev-mcelog.c: In function 'dev_mcelog_init_device': arch/x86/kernel/cpu/mce/dev-mcelog.c:346:2: warning: 'strncpy' output \ truncated before terminating nul copying 12 bytes from a string of the \ same length [-Wstringop-truncation] This is accurate, but I don't care that the trailing NUL character isn't copied. The string being copied is just a magic number signature so that crash dump tools can be sure they are decoding the right blob of memory. Use memcpy() instead of strncpy(). Fixes: d8ecca4043f2 ("x86/mce/dev-mcelog: Dynamically allocate space for machine check records") Reported-by: kbuild test robot Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200527182808.27737-1-tony.luck@intel.com commit 17fae1294ad9d711b2c3dd0edef479d40c76a5e8 Author: Tony Luck Date: Wed May 20 09:35:46 2020 -0700 x86/{mce,mm}: Unmap the entire page if the whole page is affected and poisoned An interesting thing happened when a guest Linux instance took a machine check. The VMM unmapped the bad page from guest physical space and passed the machine check to the guest. Linux took all the normal actions to offline the page from the process that was using it. But then guest Linux crashed because it said there was a second machine check inside the kernel with this stack trace: do_memory_failure set_mce_nospec set_memory_uc _set_memory_uc change_page_attr_set_clr cpa_flush clflush_cache_range_opt This was odd, because a CLFLUSH instruction shouldn't raise a machine check (it isn't consuming the data). Further investigation showed that the VMM had passed in another machine check because is appeared that the guest was accessing the bad page. Fix is to check the scope of the poison by checking the MCi_MISC register. If the entire page is affected, then unmap the page. If only part of the page is affected, then mark the page as uncacheable. This assumes that VMMs will do the logical thing and pass in the "whole page scope" via the MCi_MISC register (since they unmapped the entire page). [ bp: Adjust to x86/entry changes. ] Fixes: 284ce4011ba6 ("x86/memory_failure: Introduce {set, clear}_mce_nospec()") Reported-by: Jue Wang Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Tested-by: Jue Wang Cc: Link: https://lkml.kernel.org/r/20200520163546.GA7977@agluck-desk2.amr.corp.intel.com commit f77d26a9fc525286bcef3d4f98b52e17482cf49c Merge: b6bea24d4151 f0178fc01fe4 Author: Thomas Gleixner Date: Thu Jun 11 15:17:57 2020 +0200 Merge branch 'x86/entry' into ras/core to fixup conflicts in arch/x86/kernel/cpu/mce/core.c so MCE specific follow up patches can be applied without creating a horrible merge conflict afterwards. commit f0178fc01fe46bab6a95415f5647d1a74efcad1b Author: Thomas Gleixner Date: Wed Jun 10 08:37:01 2020 +0200 x86/entry: Unbreak __irqentry_text_start/end magic The entry rework moved interrupt entry code from the irqentry to the noinstr section which made the irqentry section empty. This breaks boundary checks which rely on the __irqentry_text_start/end markers to find out whether a function in a stack trace is interrupt/exception entry code. This affects the function graph tracer and filter_irq_stacks(). As the IDT entry points are all sequentialy emitted this is rather simple to unbreak by injecting __irqentry_text_start/end as global labels. To make this work correctly: - Remove the IRQENTRY_TEXT section from the x86 linker script - Define __irqentry so it breaks the build if it's used - Adjust the entry mirroring in PTI - Remove the redundant kprobes and unwinder bound checks Reported-by: Qian Cai Signed-off-by: Thomas Gleixner commit 2823e83a3dc0f54d23db67ca07d74b9c8bb1fdda Author: Peter Zijlstra Date: Wed Jun 3 13:40:22 2020 +0200 x86/entry: __always_inline CR2 for noinstr vmlinux.o: warning: objtool: exc_page_fault()+0x9: call to read_cr2() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_page_fault()+0x24: call to prefetchw() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_page_fault()+0x21: call to kvm_handle_async_pf.isra.0() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_nmi()+0x1cc: call to write_cr2() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200603114052.243227806@infradead.org commit 6eebad1ad303db360ebe3e51c2b9656c3d407157 Author: Peter Zijlstra Date: Wed Jun 3 13:40:21 2020 +0200 lockdep: __always_inline more for noinstr vmlinux.o: warning: objtool: debug_locks_off()+0xd: call to __debug_locks_off() leaves .noinstr.text section vmlinux.o: warning: objtool: match_held_lock()+0x6a: call to look_up_lock_class.isra.0() leaves .noinstr.text section vmlinux.o: warning: objtool: lock_is_held_type()+0x90: call to lockdep_recursion_finish() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200603114052.185201076@infradead.org commit 5ef227933117085f1320b3421ef43a26bf624b4c Author: Peter Zijlstra Date: Wed Jun 3 13:40:20 2020 +0200 x86/entry: Re-order #DB handler to avoid *SAN instrumentation vmlinux.o: warning: objtool: exc_debug()+0xbb: call to clear_ti_thread_flag.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: noist_exc_debug()+0x55: call to clear_ti_thread_flag.constprop.0() leaves .noinstr.text section Rework things so that handle_debug() looses the noinstr and move the clear_thread_flag() into that. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200603114052.127756554@infradead.org commit 4b281e541bba74bf9574335289484c577f41eaf7 Author: Peter Zijlstra Date: Wed Jun 3 13:40:19 2020 +0200 x86/entry: __always_inline arch_atomic_* for noinstr vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0x33: call to arch_atomic_and.constprop.0() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200603114052.070166551@infradead.org commit 7a745be1cc902d7376fdc29d6b5533eb46532be1 Author: Peter Zijlstra Date: Wed Jun 3 13:40:18 2020 +0200 x86/entry: __always_inline irqflags for noinstr vmlinux.o: warning: objtool: lockdep_hardirqs_on()+0x65: call to arch_local_save_flags() leaves .noinstr.text section vmlinux.o: warning: objtool: lockdep_hardirqs_off()+0x5d: call to arch_local_save_flags() leaves .noinstr.text section vmlinux.o: warning: objtool: lock_is_held_type()+0x35: call to arch_local_irq_save() leaves .noinstr.text section vmlinux.o: warning: objtool: check_preemption_disabled()+0x31: call to arch_local_save_flags() leaves .noinstr.text section vmlinux.o: warning: objtool: check_preemption_disabled()+0x33: call to arch_irqs_disabled_flags() leaves .noinstr.text section vmlinux.o: warning: objtool: lock_is_held_type()+0x2f: call to native_irq_disable() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200603114052.012171668@infradead.org commit 28eaf87121abfb574fabfb08e21322b4dc377b10 Author: Peter Zijlstra Date: Wed Jun 3 13:40:17 2020 +0200 x86/entry: __always_inline debugreg for noinstr vmlinux.o: warning: objtool: exc_debug()+0x21: call to native_get_debugreg() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200603114051.954401211@infradead.org commit 3e77abda65b1cec10ef6b18b1ccfee0beaf400f1 Author: Thomas Gleixner Date: Thu May 28 16:53:20 2020 +0200 x86/idt: Consolidate idt functionality - Move load_current_idt() out of line and replace the hideous comment with a lockdep assert. This allows to make idt_table and idt_descr static. - Mark idt_table read only after the IDT initialization is complete. - Shuffle code around to consolidate the #ifdef sections into one. - Adapt the F00F bug code. Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200528145523.084915381@linutronix.de commit 00229a54300108502f68c8777faca2d13f805f1a Author: Thomas Gleixner Date: Thu May 28 16:53:19 2020 +0200 x86/idt: Cleanup trap_init() No point in having all the IDT cruft in trap_init(). Move it into the IDT code and fixup the comments. Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200528145522.992376498@linutronix.de commit 5a2bafca1b0675a126143eea3610143130347783 Author: Thomas Gleixner Date: Thu May 28 16:53:18 2020 +0200 x86/idt: Use proper constants for table size Use the actual struct size to calculate the IDT table size instead of hardcoded values. Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200528145522.898591501@linutronix.de commit 94438af40d06c110988fc9e30baf801f38b1491a Author: Thomas Gleixner Date: Thu May 28 16:53:17 2020 +0200 x86/idt: Add comments about early #PF handling The difference between 32 and 64 bit vs. early #PF handling is not documented. Replace the FIXME at idt_setup_early_pf() with proper comments. Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200528145522.807135882@linutronix.de commit bdf5bde8aec7b53d0ea3a44d880a4e5106ff37f3 Author: Thomas Gleixner Date: Thu May 28 16:53:16 2020 +0200 x86/idt: Mark init only functions __init Since 8175cfbbbfcb ("x86/idt: Remove update_intr_gate()") set_intr_gate() and idt_setup_from_table() are only called from __init functions. Mark them as well. Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200528145522.715816477@linutronix.de commit bf2b3008440072068580c609d79a079656af0588 Author: Peter Zijlstra Date: Fri May 29 23:27:40 2020 +0200 x86/entry: Rename trace_hardirqs_off_prepare() The typical pattern for trace_hardirqs_off_prepare() is: ENTRY lockdep_hardirqs_off(); // because hardware ... do entry magic instrumentation_begin(); trace_hardirqs_off_prepare(); ... do actual work trace_hardirqs_on_prepare(); lockdep_hardirqs_on_prepare(); instrumentation_end(); ... do exit magic lockdep_hardirqs_on(); which shows that it's named wrong, rename it to trace_hardirqs_off_finish(), as it concludes the hardirq_off transition. Also, given that the above is the only correct order, make the traditional all-in-one trace_hardirqs_off() follow suit. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.415774872@infradead.org commit 59bc300b712998d10254ee20e24f2e7ec09c560a Author: Peter Zijlstra Date: Fri May 29 23:27:39 2020 +0200 x86/entry: Clarify irq_{enter,exit}_rcu() Because: irq_enter_rcu() includes lockdep_hardirq_enter() irq_exit_rcu() does *NOT* include lockdep_hardirq_exit() Which resulted in two 'stray' lockdep_hardirq_exit() calls in idtentry.h, and me spending a long time trying to find the matching enter calls. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.359433429@infradead.org commit fd501d4f0399700011acde486576c7c1eb8e7a61 Author: Peter Zijlstra Date: Fri May 29 23:27:38 2020 +0200 x86/entry: Remove DBn stacks Both #DB itself, as all other IST users (NMI, #MC) now clear DR7 on entry. Combined with not allowing breakpoints on entry/noinstr/NOKPROBE text and no single step (EFLAGS.TF) inside the #DB handler should guarantee no nested #DB. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.303027161@infradead.org commit f9912ada82862df341b3e86864cbd532d0d24b84 Author: Peter Zijlstra Date: Fri May 29 23:27:37 2020 +0200 x86/entry: Remove debug IDT frobbing This is all unused now. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.245019500@infradead.org commit 84b6a3491567a540f955e18d8e615493afa36df0 Author: Peter Zijlstra Date: Fri May 29 23:27:36 2020 +0200 x86/entry: Optimize local_db_save() for virt Because DRn access is 'difficult' with virt; but the DR7 read is cheaper than a cacheline miss on native, add a virt specific fast path to local_db_save(), such that when breakpoints are not in use to avoid touching DRn entirely. Suggested-by: Andy Lutomirski Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.187833200@infradead.org commit cd840e424f27fcc1ae8d14b7ec3ec4560ee6561a Author: Peter Zijlstra Date: Fri May 29 23:27:35 2020 +0200 x86/entry, mce: Disallow #DB during #MC #MC is fragile as heck, don't tempt fate. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.131187767@infradead.org commit fd338e3564b0b8597a89f83941a0eda3e5092cc0 Author: Peter Zijlstra Date: Fri May 29 23:27:34 2020 +0200 x86/entry, nmi: Disable #DB Instead of playing stupid games with IST stacks, fully disallow #DB during NMIs. There is absolutely no reason to allow them, and killing this saves a heap of trouble. #DB is already forbidden on noinstr and CEA, so there can't be a #DB before this. Disabling it right after nmi_enter() ensures that the full NMI code is protected. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.069223695@infradead.org commit e1de11d4d1a64ac1b90b9833f1a3629dae18facb Author: Peter Zijlstra Date: Fri May 29 23:27:33 2020 +0200 x86/entry: Introduce local_db_{save,restore}() In order to allow other exceptions than #DB to disable breakpoints, provide common helpers. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200529213321.012060983@infradead.org commit fdef24dfccb7be06e6ebe11d6c6c56987421870f Author: Lai Jiangshan Date: Fri May 29 23:27:32 2020 +0200 x86/hw_breakpoint: Prevent data breakpoints on user_pcid_flush_mask The per-CPU user_pcid_flush_mask is used in the low level entry code. A data breakpoint can cause #DB recursion. Protect the full cpu_tlbstate structure for simplicity. Signed-off-by: Lai Jiangshan Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200526014221.2119-5-laijs@linux.alibaba.com Link: https://lkml.kernel.org/r/20200529213320.955117574@infradead.org commit f9fe0b89f05441c6e4034e024c2c75a0d93024c1 Author: Lai Jiangshan Date: Fri May 29 23:27:31 2020 +0200 x86/hw_breakpoint: Prevent data breakpoints on per_cpu cpu_tss_rw cpu_tss_rw is not directly referenced by hardware, but cpu_tss_rw is accessed in CPU entry code, especially when #DB shifts its stacks. If a data breakpoint would be set on cpu_tss_rw.x86_tss.ist[IST_INDEX_DB], it would cause recursive #DB ending up in a double fault. Add it to the list of protected items. Signed-off-by: Lai Jiangshan Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200526014221.2119-4-laijs@linux.alibaba.com Link: https://lkml.kernel.org/r/20200529213320.897976479@infradead.org commit 97417cb9ad4ed052d7a4c5c0d75db1ff1b0981fb Author: Lai Jiangshan Date: Fri May 29 23:27:30 2020 +0200 x86/hw_breakpoint: Prevent data breakpoints on direct GDT A data breakpoint on the GDT can be fatal and must be avoided. The GDT in the CPU entry area is already protected, but not the direct GDT. Add the necessary protection. Signed-off-by: Lai Jiangshan Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200526014221.2119-3-laijs@linux.alibaba.com Link: https://lkml.kernel.org/r/20200529213320.840953950@infradead.org commit d390e6de89d30402bd06056c40cea72328aec9b1 Author: Lai Jiangshan Date: Fri May 29 23:27:29 2020 +0200 x86/hw_breakpoint: Add within_area() to check data breakpoints Add a within_area() helper to checking whether the data breakpoints overlap with cpu_entry_area. It will be used to completely prevent data breakpoints on GDT, IDT, or TSS. Signed-off-by: Lai Jiangshan Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200526014221.2119-2-laijs@linux.alibaba.com Link: https://lkml.kernel.org/r/20200529213320.784524504@infradead.org commit 998c2034c6a36bd48284e8c8f945a6c6ffc0e3f0 Author: Vitaly Kuznetsov Date: Wed May 20 18:16:00 2020 +0200 xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h Kbuild test robot reports the following problem on ARM: for 'xen_setup_callback_vector' [-Wmissing-prototypes] 1664 | void xen_setup_callback_vector(void) {} | ^~~~~~~~~~~~~~~~~~~~~~~~~ The problem is that xen_setup_callback_vector is a x86 only thing, its definition is present in arch/x86/xen/xen-ops.h but not on ARM. In events_base.c there is a stub for !CONFIG_XEN_PVHVM but it is not declared as 'static'. On x86 the situation is hardly better: drivers/xen/events/events_base.c doesn't include 'xen-ops.h' from arch/x86/xen/, it includes its namesake from include/xen/ which also results in a 'no previous prototype' warning. Currently, xen_setup_callback_vector() has two call sites: one in drivers/xen/events_base.c and another in arch/x86/xen/suspend_hvm.c. The former is placed under #ifdef CONFIG_X86 and the later is only compiled in when CONFIG_XEN_PVHVM. Resolve the issue by moving xen_setup_callback_vector() declaration to arch neutral 'include/xen/hvm.h' as the implementation lives in arch neutral drivers/xen/events/events_base.c. Reported-by: kbuild test robot Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Juergen Gross Link: https://lkml.kernel.org/r/20200520161600.361895-1-vkuznets@redhat.com commit 320100a5ffe5ec781ec3dc190a57ce5e32885855 Author: Thomas Gleixner Date: Thu May 21 22:05:52 2020 +0200 x86/entry: Remove the TRACE_IRQS cruft No more users. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202120.523289762@linutronix.de commit 3ffdfdcec1bae39b68b990762350b3cd3127f23f Author: Thomas Gleixner Date: Thu May 21 22:05:51 2020 +0200 x86/entry: Move paranoid irq tracing out of ASM code The last step to remove the irq tracing cruft from ASM. Ignore #DF as the maschine is going to die anyway. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202120.414043330@linutronix.de commit 9628f26baef262a49d877e3785e8b88d241bc064 Author: Thomas Gleixner Date: Thu May 21 22:05:50 2020 +0200 x86/entry/64: Remove TRACE_IRQS_*_DEBUG Since INT3/#BP no longer runs on an IST, this workaround is no longer required. Tested by running lockdep+ftrace as described in the initial commit: 5963e317b1e9 ("ftrace/x86: Do not change stacks in DEBUG when calling lockdep") Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Reviewed-by: Steven Rostedt (VMware) Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202120.319418546@linutronix.de commit fa95a0cb0423661eb615b6ac1e9882ce9a75719a Author: Thomas Gleixner Date: Thu May 21 22:05:49 2020 +0200 x86/entry/32: Remove redundant irq disable code All exceptions/interrupts return with interrupts disabled now. No point in doing this in ASM again. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202120.221223450@linutronix.de commit 3b6c9bf69ef34c5ca36c78aad4ff76b9d9afc92c Author: Thomas Gleixner Date: Thu May 21 22:05:48 2020 +0200 x86/entry: Make enter_from_user_mode() static The ASM users are gone. All callers are local. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202120.129232680@linutronix.de commit e3e5c64ea1f5a81ace6984e7abbdd369ab631c93 Author: Thomas Gleixner Date: Thu May 21 22:05:47 2020 +0200 x86/entry/64: Remove IRQ stack switching ASM No more users. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202120.021462159@linutronix.de commit 75da04f7f3cb416a68475e040175dc013da32de2 Author: Thomas Gleixner Date: Thu May 21 22:05:46 2020 +0200 x86/entry: Remove the apic/BUILD interrupt leftovers Remove all the code which was there to emit the system vector stubs. All users are gone. Move the now unused GET_CR2_INTO macro muck to head_64.S where the last user is. Fixup the eye hurting comment there while at it. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.927433002@linutronix.de commit 13cad9851ef1d004640991d45227dd35c08f45fc Author: Thomas Gleixner Date: Thu May 21 22:05:45 2020 +0200 x86/entry: Convert reschedule interrupt to IDTENTRY_SYSVEC_SIMPLE The scheduler IPI does not need the full interrupt entry handling logic when the entry is from kernel mode. Use IDTENTRY_SYSVEC_SIMPLE and spare all the overhead. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.835425642@linutronix.de commit cb09ea2924cbf1a42da59bd30a59cc1836240bcb Author: Thomas Gleixner Date: Thu May 21 22:05:44 2020 +0200 x86/entry: Convert XEN hypercall vector to IDTENTRY_SYSVEC Convert the last oldstyle defined vector to IDTENTRY_SYSVEC: - Implement the C entry point with DEFINE_IDTENTRY_SYSVEC - Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC - Remove the ASM idtentries in 64-bit - Remove the BUILD_INTERRUPT entries in 32-bit - Remove the old prototypes Fixup the related XEN code by providing the primary C entry point in x86 to avoid cluttering the generic code with X86'isms. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.741950104@linutronix.de commit a16be368dd3fb695077cc9bc59c988b548955eec Author: Thomas Gleixner Date: Thu May 21 22:05:43 2020 +0200 x86/entry: Convert various hypervisor vectors to IDTENTRY_SYSVEC Convert various hypervisor vectors to IDTENTRY_SYSVEC: - Implement the C entry point with DEFINE_IDTENTRY_SYSVEC - Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC - Remove the ASM idtentries in 64-bit - Remove the BUILD_INTERRUPT entries in 32-bit - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Reviewed-by: Wei Liu Link: https://lore.kernel.org/r/20200521202119.647997594@linutronix.de commit 9c3b1f4975c46fc2932fd6d53e63c14f0ddf985f Author: Thomas Gleixner Date: Thu May 21 22:05:42 2020 +0200 x86/entry: Convert KVM vectors to IDTENTRY_SYSVEC* Convert KVM specific system vectors to IDTENTRY_SYSVEC*: The two empty stub handlers which only increment the stats counter do no need to run on the interrupt stack. Use IDTENTRY_SYSVEC_SIMPLE for them. The wakeup handler does more work and runs on the interrupt stack. None of these handlers need to save and restore the irq_regs pointer. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Paolo Bonzini Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.555715519@linutronix.de commit 720909a7abd351535bfb485a0ecce03c2e4467e2 Author: Thomas Gleixner Date: Thu May 21 22:05:41 2020 +0200 x86/entry: Convert various system vectors Convert various system vectors to IDTENTRY_SYSVEC: - Implement the C entry point with DEFINE_IDTENTRY_SYSVEC - Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC - Remove the ASM idtentries in 64-bit - Remove the BUILD_INTERRUPT entries in 32-bit - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.464812973@linutronix.de commit 582f9191231b994582ad5349a7b06b3255c926fb Author: Thomas Gleixner Date: Thu May 21 22:05:40 2020 +0200 x86/entry: Convert SMP system vectors to IDTENTRY_SYSVEC Convert SMP system vectors to IDTENTRY_SYSVEC: - Implement the C entry point with DEFINE_IDTENTRY_SYSVEC - Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC - Remove the ASM idtentries in 64-bit - Remove the BUILD_INTERRUPT entries in 32-bit - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.372234635@linutronix.de commit db0338eec5836eea3bd1b274212234d04bac2034 Author: Thomas Gleixner Date: Thu May 21 22:05:39 2020 +0200 x86/entry: Convert APIC interrupts to IDTENTRY_SYSVEC Convert APIC interrupts to IDTENTRY_SYSVEC: - Implement the C entry point with DEFINE_IDTENTRY_SYSVEC - Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC - Remove the ASM idtentries in 64-bit - Remove the BUILD_INTERRUPT entries in 32-bit - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.280728850@linutronix.de commit 6368558c37107bed35950cfbd994f49de07236dc Author: Thomas Gleixner Date: Thu May 21 22:05:38 2020 +0200 x86/entry: Provide IDTENTRY_SYSVEC Provide IDTENTRY variants for system vectors to consolidate the different mechanisms to emit the ASM stubs for 32- and 64-bit. On 64-bit this also moves the stack switching from ASM to C code. 32-bit will excute the system vectors w/o stack switching as before. The simple variant is meant for "empty" system vectors like scheduler IPI and KVM posted interrupt vectors. These do not need the full glory of irq enter/exit handling with softirq processing and more. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.185317067@linutronix.de commit fa5e5c409213265da8a188b4a5e4e641b1382eb4 Author: Thomas Gleixner Date: Thu May 21 22:05:37 2020 +0200 x86/entry: Use idtentry for interrupts Replace the extra interrupt handling code and reuse the existing idtentry machinery. This moves the irq stack switching on 64-bit from ASM to C code; 32-bit already does the stack switching in C. This requires to remove HAVE_IRQ_EXIT_ON_IRQ_STACK as the stack switch is not longer in the low level entry code. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202119.078690991@linutronix.de commit 0bf7c314ff68622468945a24ea2f7ebc1edf0a6b Author: Thomas Gleixner Date: Thu May 21 22:05:36 2020 +0200 x86/entry: Add IRQENTRY_IRQ macro Provide a seperate IDTENTRY macro for device interrupts. Similar to IDTENTRY_ERRORCODE with the addition of invoking irq_enter/exit_rcu() and providing the errorcode as a 'u8' argument to the C function, which truncates the sign extended vector number. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.984573165@linutronix.de commit 7c2a57364cae0f2e070a27d728f1df6844ffff56 Author: Thomas Gleixner Date: Thu May 21 22:05:35 2020 +0200 x86/irq: Rework handle_irq() for 64-bit To consolidate the interrupt entry/exit code vs. the other exceptions make handle_irq() an inline and handle both 64-bit and 32-bit mode. Preparatory change to move irq stack switching for 64-bit to C which allows to consolidate the entry exit handling by reusing the idtentry machinery both in ASM and C. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.889972748@linutronix.de commit 633260fa143bbed05e65dc557a492667dfdc45bb Author: Thomas Gleixner Date: Thu May 21 22:05:34 2020 +0200 x86/irq: Convey vector as argument and not in ptregs Device interrupts which go through do_IRQ() or the spurious interrupt handler have their separate entry code on 64 bit for no good reason. Both 32 and 64 bit transport the vector number through ORIG_[RE]AX in pt_regs. Further the vector number is forced to fit into an u8 and is complemented and offset by 0x80 so it's in the signed character range. Otherwise GAS would expand the pushq to a 5 byte instruction for any vector > 0x7F. Treat the vector number like an error code and hand it to the C function as argument. This allows to get rid of the extra entry code in a later step. Simplify the error code push magic by implementing the pushq imm8 via a '.byte 0x6a, vector' sequence so GAS is not able to screw it up. As the pushq imm8 is sign extending the resulting error code needs to be truncated to 8 bits in C code. Originally-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.796915981@linutronix.de commit 79b9c183021ef3f5ca2d5168cd3fd442580eca09 Author: Thomas Gleixner Date: Thu May 21 22:05:33 2020 +0200 x86/irq: Use generic irq_regs implementation The only difference is the name of the per-CPU variable: irq_regs vs. __irq_regs, but the accessor functions are identical. Remove the pointless copy and use the generic variant. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.704169051@linutronix.de commit 74ebed3193aa4964b6cb9d146c9c01c7759ef4f2 Author: Thomas Gleixner Date: Thu May 21 22:05:32 2020 +0200 x86/entry/32: Remove common_exception() No more users. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.611906966@linutronix.de commit 23d73f2ad4e7e7ce8bebdd1e138c8c79439dc301 Author: Thomas Gleixner Date: Thu May 21 22:05:31 2020 +0200 x86/entry/64: Remove error_exit() No more users. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.516757524@linutronix.de commit e88d974136dbb5d6962eeb63075900603e737a1e Author: Thomas Gleixner Date: Thu May 21 22:05:30 2020 +0200 x86/entry: Change exit path of xen_failsafe_callback xen_failsafe_callback() is invoked from XEN for two cases: 1. Fault while reloading DS, ES, FS or GS 2. Fault while executing IRET #1 retries the IRET after XEN has fixed up the segments. #2 injects a #GP which kills the task For #1 there is no reason to go through the full exception return path because the tasks TIF state is still the same. So just going straight to the IRET path is good enough. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.423224507@linutronix.de commit e2dcb5f1390715244aec12dbd6f294863ca37b88 Author: Thomas Gleixner Date: Thu May 21 22:05:29 2020 +0200 x86/entry: Remove the transition leftovers Now that all exceptions are converted over the sane flag is not longer needed. Also the vector argument of idtentry_body on 64-bit is pointless now. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.331115895@linutronix.de commit 91eeafea1e4b7c95cc4f38af186d7d48fceef89a Author: Thomas Gleixner Date: Thu May 21 22:05:28 2020 +0200 x86/entry: Switch page fault exception to IDTENTRY_RAW Convert page fault exceptions to IDTENTRY_RAW: - Implement the C entry point with DEFINE_IDTENTRY_RAW - Add the CR2 read into the exception handler - Add the idtentry_enter/exit_cond_rcu() invocations in in the regular page fault handler and in the async PF part. - Emit the ASM stub with DECLARE_IDTENTRY_RAW - Remove the ASM idtentry in 64-bit - Remove the CR2 read from 64-bit - Remove the open coded ASM entry code in 32-bit - Fix up the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.238455120@linutronix.de commit 00cf8baf9c2af3c17f9d77bb9d07d44d330d0df2 Author: Thomas Gleixner Date: Thu May 21 22:05:27 2020 +0200 x86/entry/64: Simplify idtentry_body All C functions which do not have an error code have been converted to the new IDTENTRY interface which does not expect an error code in the arguments. Spare the XORL. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202118.145811853@linutronix.de commit 2f6474e4636bcc68af6c44abb2703f12d7f083da Author: Thomas Gleixner Date: Thu May 21 22:05:26 2020 +0200 x86/entry: Switch XEN/PV hypercall entry to IDTENTRY Convert the XEN/PV hypercall to IDTENTRY: - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64-bit - Remove the open coded ASM entry code in 32-bit - Remove the old prototypes The handler stubs need to stay in ASM code as they need corner case handling and adjustment of the stack pointer. Provide a new C function which invokes the entry/exit handling and calls into the XEN handler on the interrupt stack if required. The exit code is slightly different from the regular idtentry_exit() on non-preemptible kernels. If the hypercall is preemptible and need_resched() is set then XEN provides a preempt hypercall scheduling function. Move this functionality into the entry code so it can use the existing idtentry functionality. [ mingo: Build fixes. ] Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Acked-by: Juergen Gross Tested-by: Juergen Gross Link: https://lore.kernel.org/r/20200521202118.055270078@linutronix.de commit 1de16e0c17155d138282f3a9f65914a9a5da757e Author: Thomas Gleixner Date: Thu May 21 22:05:25 2020 +0200 x86/entry: Split out idtentry_exit_cond_resched() The XEN PV hypercall requires the ability of conditional rescheduling when preemption is disabled because some hypercalls take ages. Split out the rescheduling code from idtentry_exit_cond_rcu() so it can be reused for that. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.962199649@linutronix.de commit eb6555c83933ce8e094d5429d57970aaa9f0591e Author: Thomas Gleixner Date: Thu May 21 22:05:24 2020 +0200 x86/entry/64: Move do_softirq_own_stack() to C The first step to get rid of the ENTER/LEAVE_IRQ_STACK ASM macro maze. Use the new C code helpers to move do_softirq_own_stack() out of ASM code. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.870911120@linutronix.de commit 931b94145981e411bd2c934657649347ba8a9083 Author: Thomas Gleixner Date: Thu May 21 22:05:23 2020 +0200 x86/entry: Provide helpers for executing on the irqstack Device interrupt handlers and system vector handlers are executed on the interrupt stack. The stack switch happens in the low level assembly entry code. This conflicts with the efforts to consolidate the exit code in C to ensure correctness vs. RCU and tracing. As there is no way to move #DB away from IST due to the MOV SS issue, the requirements vs. #DB and NMI for switching to the interrupt stack do not exist anymore. The only requirement is that interrupts are disabled. That allows the moving of the stack switching to C code, which simplifies the entry/exit handling further, because it allows the switching of stacks after handling the entry and on exit before handling RCU, returning to usermode and kernel preemption in the same way as for regular exceptions. The initial attempt of having the stack switching in inline ASM caused too much headache vs. objtool and the unwinder. After analysing the use cases it was agreed on that having the stack switch in ASM for the price of an indirect call is acceptable, as the main users are indirect call heavy anyway and the few system vectors which are empty shells (scheduler IPI and KVM posted interrupt vectors) can run from the regular stack. Provide helper functions to check whether the interrupt stack is already active and whether stack switching is required. 64-bit only for now, as 32-bit has a variant of that already. Once this is cleaned up, the two implementations might be consolidated as an additional cleanup on top. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.763775313@linutronix.de commit 98a3bf195e1a14755da3d2b83e1dbb4a3158866d Author: Thomas Gleixner Date: Thu May 21 22:05:22 2020 +0200 genirq: Provide __irq_enter/exit_raw() Like __irq_enter/exit() but without time accounting. To be used for "empty" system vectors like the scheduler IPI to avoid the overhead. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Reviewed-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.671682341@linutronix.de commit 8a6bc4787f05d087fda8e11ead225c8830250703 Author: Thomas Gleixner Date: Thu May 21 22:05:21 2020 +0200 genirq: Provide irq_enter/exit_rcu() irq_enter()/exit() currently include RCU handling. To properly separate the RCU handling code, provide variants which contain only the non-RCU related functionality. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Reviewed-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.567023613@linutronix.de commit 9ee01e0f69a925b6ff7d5f39441413c55132b167 Author: Thomas Gleixner Date: Thu May 21 22:05:20 2020 +0200 x86/entry: Clean up idtentry_enter/exit() leftovers Now that everything is converted to conditional RCU handling remove idtentry_enter/exit() and tidy up the conditional functions. This does not remove rcu_irq_exit_preempt(), to avoid conflicts with the RCU tree. Will be removed once all of this hits Linus's tree. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.473597954@linutronix.de commit fa95d7dc1abceb288db2959badb9aaf558eb0530 Author: Thomas Gleixner Date: Thu May 21 22:05:19 2020 +0200 x86/idtentry: Switch to conditional RCU handling Switch all idtentry_enter/exit() users over to the new conditional RCU handling scheme and make the user mode entries in #DB, #INT3 and #MCE use the user mode idtentry functions. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.382387286@linutronix.de commit 9f9781b60dfa68d5094a41982f1efa75215a62b1 Author: Thomas Gleixner Date: Thu May 21 22:05:18 2020 +0200 x86/entry: Provide idtentry_enter/exit_user() As there are exceptions which already handle entry from user mode and from kernel mode separately, providing explicit user entry/exit handling callbacks makes sense and makes the code easier to understand. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20200521202117.289548561@linutronix.de commit 3eeec385848855c8109eb72b8b309078d5507968 Author: Thomas Gleixner Date: Thu May 21 22:05:17 2020 +0200 x86/entry: Provide idtentry_entry/exit_cond_rcu() After a lengthy discussion [1] it turned out that RCU does not need a full rcu_irq_enter/exit() when RCU is already watching. All it needs if NOHZ_FULL is active is to check whether the tick needs to be restarted. This allows to avoid a separate variant for the pagefault handler which cannot invoke rcu_irq_enter() on a kernel pagefault which might sleep. The cond_rcu argument is only temporary and will be removed once the existing users of idtentry_enter/exit() have been cleaned up. After that the code can be significantly simplified. [ mingo: Simplified the control flow ] Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: "Paul E. McKenney" Acked-by: Andy Lutomirski Link: [1] https://lkml.kernel.org/r/20200515235125.628629605@linutronix.de Link: https://lore.kernel.org/r/20200521202117.181397835@linutronix.de commit 2ab70319bc1f79228da4dce7b9d604740c9beeef Author: Thomas Gleixner Date: Thu May 21 22:05:14 2020 +0200 nmi, tracing: Make hardware latency tracing noinstr safe The hardware latency tracer calls into instrumentable functions. Move the calls into the RCU watching sections and annotate them. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Acked-by: Andy Lutomirski Cc: Paul E. McKenney Link: https://lore.kernel.org/r/20200521202116.904176298@linutronix.de Signed-off-by: Ingo Molnar commit 7102cb07132624cdc09aa8e40c03ae34b4cbb74a Author: Ingo Molnar Date: Mon May 25 09:42:41 2020 +0200 x86/entry: Fix allnoconfig build warning The following commit: 095b7a3e7745 ("x86/entry: Convert double fault exception to IDTENTRY_DF") introduced a new build warning on 64-bit allnoconfig kernels, that have CONFIG_VMAP_STACK disabled: arch/x86/kernel/traps.c:332:16: warning: unused variable ‘address’ [-Wunused-variable] This variable is only used if CONFIG_VMAP_STACK is defined, so make it dependent on that, not CONFIG_X86_64. Signed-off-by: Ingo Molnar Cc: Thomas Gleixner Cc: Alexandre Chartre Cc: Peter Zijlstra Cc: Andy Lutomirski Cc: Borislav Petkov commit c29c775a554f7060b6fb31b68f88a3c9087cf1c5 Author: Thomas Gleixner Date: Tue Feb 25 23:33:31 2020 +0100 x86/entry: Convert double fault exception to IDTENTRY_DF Convert #DF to IDTENTRY_DF - Implement the C entry point with DEFINE_IDTENTRY_DF - Emit the ASM stub with DECLARE_IDTENTRY_DF on 64bit - Remove the ASM idtentry in 64bit - Adjust the 32bit shim code - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.583415264@linutronix.de commit 6a8dfa8e4053adfcf02ee4d96287943064166beb Author: Thomas Gleixner Date: Tue Feb 25 23:33:30 2020 +0100 x86/idtentry: Provide IDTENTRY_DF Provide a separate macro for #DF as this needs to emit paranoid only code and has also a special ASM stub in 32bit. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.583415264@linutronix.de commit 865d3a9afe7eddf320e7f61a442864d6efe27505 Author: Thomas Gleixner Date: Tue Apr 21 21:22:36 2020 +0200 x86/mce: Address objtools noinstr complaints Mark the relevant functions noinstr, use the plain non-instrumented MSR accessors. The only odd part is the instrumentation_begin()/end() pair around the indirect machine_check_vector() call as objtool can't figure that out. The possible invoked functions are annotated correctly. Also use notrace variant of nmi_enter/exit(). If MCEs happen then hardware latency tracing is the least of the worries. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.476734898@linutronix.de commit 75347bb2535a6d5549cc3e436467b7c40d7bb874 Author: Thomas Gleixner Date: Thu Apr 30 11:07:20 2020 +0200 x86/traps: Address objtool noinstr complaints in #DB The functions invoked from handle_debug() can be instrumented. Tell objtool about it. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.380927730@linutronix.de commit 9347f41352181bf4a7e663f7b5f4a4bb32244d73 Author: Thomas Gleixner Date: Mon May 4 19:56:26 2020 +0200 x86/traps: Restructure #DB handling Now that there are separate entry points, move the kernel/user_mode specifc checks into the entry functions so the common handling code does not need the extra mode checks. Make the code more readable while at it. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.283276272@linutronix.de commit 4c0dcd8350a03cb65f645a039f2772be880ee74a Author: Thomas Gleixner Date: Tue Feb 25 23:33:29 2020 +0100 x86/entry: Implement user mode C entry points for #DB and #MCE The MCE entry point uses the same mechanism as the IST entry point for now. For #DB split the inner workings and just keep the nmi_enter/exit() magic in the IST variant. Fixup the ASM code to emit the proper noist_##cfunc call. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.177564104@linutronix.de commit f08e32ec3cfcf9e6d3640007de590c225ab2e201 Author: Thomas Gleixner Date: Tue Feb 25 23:33:28 2020 +0100 x86/idtentry: Provide IDTRENTRY_NOIST variants for #DB and #MC Provide NOIST entry point macros which allows to implement NOIST variants of the C entry points. These are invoked when #DB or #MC enter from user space. This allows explicit handling of the difference between user mode and kernel mode entry later. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135315.084882104@linutronix.de commit df7ccaffd2035ebd4bfbb2d980e5817c31f4a891 Author: Thomas Gleixner Date: Tue Feb 25 23:33:27 2020 +0100 x86/entry/64: Remove error code clearing from #DB and #MCE ASM stub The C entry points do not expect an error code. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.992621707@linutronix.de commit 2bbc68f8373c0631ebf137f376fbea00e8086be7 Author: Thomas Gleixner Date: Tue Feb 25 23:33:26 2020 +0100 x86/entry: Convert Debug exception to IDTENTRY_DB Convert #DB to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY_DB - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.900297476@linutronix.de commit 9f58fdde95c9509a4ded27a6d0035e79294002b4 Author: Peter Zijlstra Date: Mon Apr 6 21:02:56 2020 +0200 x86/db: Split out dr6/7 handling DR6/7 should be handled before nmi_enter() is invoked and restore after nmi_exit() to minimize the exposure. Split it out into helper inlines and bring it into the correct order. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.808628211@linutronix.de commit f051f697955049c7cf10a635ab8149aa619243b2 Author: Thomas Gleixner Date: Mon Apr 6 15:55:06 2020 +0200 x86/nmi: Protect NMI entry against instrumentation Mark all functions in the fragile code parts noinstr or force inlining so they can't be instrumented. Also make the hardware latency tracer invocation explicit outside of non-instrumentable section. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.716186134@linutronix.de commit 6271fef00b3489690e52ce95edbc378357513547 Author: Thomas Gleixner Date: Tue Feb 25 23:33:25 2020 +0100 x86/entry: Convert NMI to IDTENTRY_NMI Convert #NMI to IDTENTRY_NMI: - Implement the C entry point with DEFINE_IDTENTRY_NMI - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.609932306@linutronix.de commit 9cce81cff748ef0e79b41c6e37d7137267f1212f Author: Thomas Gleixner Date: Tue Feb 25 23:33:24 2020 +0100 x86/idtentry: Provide IDTENTRY_XEN for XEN/PV XEN/PV has special wrappers for NMI and DB exceptions. They redirect these exceptions through regular IDTENTRY points. Provide the necessary IDTENTRY macros to make this work Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.518622698@linutronix.de commit aedbdeab00dcfcc6d751f9fb1b4896b01911d494 Author: Thomas Gleixner Date: Sat Apr 4 15:39:13 2020 +0200 x86/mce: Use untraced rd/wrmsr in the MCE offline/crash check mce_check_crashing_cpu() is called right at the entry of the MCE handler. It uses mce_rdmsr() and mce_wrmsr() which are wrappers around rdmsr() and wrmsr() to handle the MCE error injection mechanism, which is pointless in this context, i.e. when the MCE hits an offline CPU or the system is already marked crashing. The MSR access can also be traced, so use the untraceable variants. This is also safe vs. XEN paravirt as these MSRs are not affected by XEN PV modifications. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.426347351@linutronix.de commit 8cd501c1facc159dff6db63775151c9200a3ea1e Author: Thomas Gleixner Date: Tue Feb 25 23:33:23 2020 +0100 x86/entry: Convert Machine Check to IDTENTRY_IST Convert #MC to IDTENTRY_MCE: - Implement the C entry points with DEFINE_IDTENTRY_MCE - Emit the ASM stub with DECLARE_IDTENTRY_MCE - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the error code from *machine_check_vector() as it is always 0 and not used by any of the functions it can point to. Fixup all the functions as well. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.334980426@linutronix.de commit 94a46d316f2b54e3de8a4fa884cb16383db7fcd8 Author: Thomas Gleixner Date: Fri Apr 3 22:37:31 2020 +0200 x86/mce: Move nmi_enter/exit() into the entry point There is no reason to have nmi_enter/exit() in the actual MCE handlers. Move it to the entry point. This also covers the until now uncovered initial handler which only prints. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.243936614@linutronix.de commit 2c058b03cc06ba485169778a271f87e5ac57dd83 Author: Thomas Gleixner Date: Tue Feb 25 23:33:22 2020 +0100 x86/idtentry: Provide IDTENTRY_IST Same as IDTENTRY but for exceptions which run on Interrupt Stacks (IST) on 64bit. For 32bit this maps to IDTENTRY. There are 3 variants which will be used: IDTENTRY_MCE IDTENTRY_DB IDTENTRY_NMI These map to IDTENTRY_IST, but only the MCE and DB variants are emitting ASM code as the NMI entry needs hand crafted ASM still. The function defines do not contain any idtenter/exit calls as these exceptions need special treatment. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135314.137125609@linutronix.de commit 21e28290b31708b72763641604e239eb369c230d Author: Peter Zijlstra Date: Thu Mar 5 16:09:52 2020 +0100 x86/traps: Split int3 handler up For code simplicity split up the int3 handler into a kernel and user part which makes the code flow simpler to understand. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505135314.045220765@linutronix.de commit 8edd7e37aed8b9df938a63f0b0259c70569ce3d2 Author: Thomas Gleixner Date: Tue Feb 25 23:16:16 2020 +0100 x86/entry: Convert INT3 exception to IDTENTRY_RAW Convert #BP to IDTENTRY_RAW: - Implement the C entry point with DEFINE_IDTENTRY_RAW - Invoke idtentry_enter/exit() from the function body - Emit the ASM stub with DECLARE_IDTENTRY_RAW - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. This could be a plain IDTENTRY, but as Peter pointed out INT3 is broken vs. the static key in the context tracking code as this static key might be in the state of being patched and has an int3 which would recurse forever. IDTENTRY_RAW is therefore chosen to allow addressing this issue without lots of code churn. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135313.938474960@linutronix.de commit 0dc6cdc21b94eed8cdacf34eabb4175cebd13775 Author: Thomas Gleixner Date: Wed Mar 4 15:22:09 2020 +0100 x86/idtentry: Provide IDTENTRY_RAW Some exception handlers need to do extra work before any of the entry helpers are invoked. Provide IDTENTRY_RAW for this. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135313.830540017@linutronix.de commit f64366efd8c60b93138b813d071d2cd201fd0f6e Author: Peter Zijlstra Date: Thu Feb 20 13:28:06 2020 +0100 x86/int3: Inline bsearch() Avoid calling out to bsearch() by inlining it, for normal kernel configs this was the last external call and poke_int3_handler() is now fully self sufficient -- no calls to external code. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135313.731774429@linutronix.de commit df65bba1dcd8ffadd922a71196b78c6d7630c33b Author: Peter Zijlstra Date: Wed Feb 19 18:25:09 2020 +0100 lib/bsearch: Provide __always_inline variant For code that needs the ultimate performance (it can inline the @cmp function too) or simply needs to avoid calling external functions for whatever reason, provide an __always_inline variant of bsearch(). [ tglx: Renamed to __inline_bsearch() as suggested by Andy ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135313.624443814@linutronix.de commit ef882bfef933408360e4d9d0c2c83a1e2fc996f3 Author: Peter Zijlstra Date: Fri Jan 24 22:08:45 2020 +0100 x86/int3: Avoid atomic instrumentation Use arch_atomic_*() and __READ_ONCE() to ensure nothing untoward creeps in and ruins things. That is; this is the INT3 text poke handler, strictly limit the code that runs in it, lest it inadvertenly hits yet another INT3. Reported-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Masami Hiramatsu Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135313.517429268@linutronix.de commit 4979fb53ab0ed35eddd20a73c25a5597bc22a57f Author: Thomas Gleixner Date: Tue Jan 21 15:53:09 2020 +0100 x86/int3: Ensure that poke_int3_handler() is not traced In order to ensure poke_int3_handler() is completely self contained -- this is called while modifying other text, imagine the fun of hitting another INT3 -- ensure that everything it uses is not traced. The primary means here is to force inlining; bsearch() is notrace because all of lib/ is. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505135313.410702173@linutronix.de commit d77290507ab2ac691d50389e255ebd11a6cbc35a Author: Thomas Gleixner Date: Tue Feb 25 23:16:30 2020 +0100 x86/entry/32: Convert IRET exception to IDTENTRY_SW Convert the IRET exception handler to IDTENTRY_SW. This is slightly different than the conversions of hardware exceptions as the IRET exception is invoked via an exception table when IRET faults. So it just uses the IDTENTRY_SW mechanism for consistency. It does not emit ASM code as it does not fit the other idtentry exceptions. - Implement the C entry point with DEFINE_IDTENTRY_SW() which maps to DEFINE_IDTENTRY() - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134906.128769226@linutronix.de commit 48227e21f7430e31042f63e078a45cd230e9fdfc Author: Thomas Gleixner Date: Tue Feb 25 23:16:29 2020 +0100 x86/entry: Convert SIMD coprocessor error exception to IDTENTRY Convert #XF to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Handle INVD_BUG in C - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134906.021552202@linutronix.de commit 436608bb00a59f5457cee26f416067860ca88d9d Author: Thomas Gleixner Date: Tue Feb 25 23:16:28 2020 +0100 x86/entry: Convert Alignment check exception to IDTENTRY Convert #AC to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134905.928967113@linutronix.de commit 14a8bd2aa7c355b3a8879618a4f70f9c2b0004f7 Author: Thomas Gleixner Date: Tue Feb 25 23:16:27 2020 +0100 x86/entry: Convert Coprocessor error exception to IDTENTRY Convert #MF to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134905.838823510@linutronix.de commit dad7106f8194df1b096666c5499ef732497ddb15 Author: Thomas Gleixner Date: Tue Feb 25 23:16:26 2020 +0100 x86/entry: Convert Spurious interrupt bug exception to IDTENTRY Convert #SPURIOUS to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134905.728077036@linutronix.de commit be4c11afbb6d5317274e61fda0edf744080fb72b Author: Thomas Gleixner Date: Tue Feb 25 23:16:25 2020 +0100 x86/entry: Convert General protection exception to IDTENTRY Convert #GP to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134905.637269946@linutronix.de commit fd9689bf91131c4bea5ea54f828af5267f5ed6a0 Author: Thomas Gleixner Date: Tue Feb 25 23:16:24 2020 +0100 x86/entry: Convert Stack segment exception to IDTENTRY Convert #SS to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134905.539867572@linutronix.de commit 99a3fb8d01af1085f16a417a748e0a462dc92d29 Author: Thomas Gleixner Date: Tue Feb 25 23:16:23 2020 +0100 x86/entry: Convert Segment not present exception to IDTENTRY Convert #NP to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134905.443591450@linutronix.de commit 97b3d290b865cf9115f7d37d40b7482efba4d46d Author: Thomas Gleixner Date: Tue Feb 25 23:16:22 2020 +0100 x86/entry: Convert Invalid TSS exception to IDTENTRY Convert #TS to IDTENTRY_ERRORCODE: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134905.350676449@linutronix.de commit aabfe5383ec7b480ca222ac05d49eb3c83dc022a Author: Thomas Gleixner Date: Tue Feb 25 23:16:21 2020 +0100 x86/idtentry: Provide IDTENTRY_ERRORCODE Same as IDTENTRY but the C entry point has an error code argument. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134905.258989060@linutronix.de commit f95658fdb575233f79e3e7ed7ecf990389d31319 Author: Thomas Gleixner Date: Tue Feb 25 23:16:20 2020 +0100 x86/entry: Convert Coprocessor segment overrun exception to IDTENTRY Convert #OLD_MF to IDTENTRY: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134905.838823510@linutronix.de commit 866ae2ccee4ac092fea14f18d537205e14c5a904 Author: Thomas Gleixner Date: Tue Feb 25 23:16:19 2020 +0100 x86/entry: Convert Device not available exception to IDTENTRY Convert #NM to IDTENTRY: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134905.056243863@linutronix.de commit 49893c5cb281f8691dcbe53e6f85a963f47a4b9b Author: Thomas Gleixner Date: Tue Feb 25 23:16:18 2020 +0100 x86/entry: Convert Invalid Opcode exception to IDTENTRY Convert #UD to IDTENTRY: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Fixup the FOOF bug call in fault.c - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.955511913@linutronix.de commit 58d9c81facf55dbd1836d114ce360a048e3a0582 Author: Thomas Gleixner Date: Tue Feb 25 23:16:17 2020 +0100 x86/entry: Convert Bounds exception to IDTENTRY Convert #BR to IDTENTRY: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes - Remove the RCU warning as the new entry macro ensures correctness No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.863001309@linutronix.de commit 4b6b9111c0b9aa4c3b319f1c5a3b1d5850792167 Author: Thomas Gleixner Date: Tue Feb 25 23:16:15 2020 +0100 x86/entry: Convert Overflow exception to IDTENTRY Convert #OF to IDTENTRY: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code - Remove the old prototypes No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.771457898@linutronix.de commit 9d06c4027f21fcfa60221bd7203eda3c82568467 Author: Thomas Gleixner Date: Tue Feb 25 23:16:14 2020 +0100 x86/entry: Convert Divide Error to IDTENTRY Convert #DE to IDTENTRY: - Implement the C entry point with DEFINE_IDTENTRY - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Fixup the XEN/PV code No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134904.663914713@linutronix.de commit 218e31b6e7a33c9b5e5d608aa79d51665bb84e62 Author: Thomas Gleixner Date: Tue Feb 25 23:16:13 2020 +0100 x86/traps: Prepare for using DEFINE_IDTENTRY Prepare for using IDTENTRY to define the C exception/trap entry points. It would be possible to glue this into the existing macro maze, but it's simpler and better to read at the end to just make them distinct. Provide a trivial inline helper to read the trap address and add a comment explaining the logic behind it. The existing macros will be removed once all instances are converted. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.556327833@linutronix.de commit 0ba50e861ae9f91ffb6589e3a8ecbd47859b0275 Author: Thomas Gleixner Date: Thu Mar 26 16:28:52 2020 +0100 x86/entry/common: Provide idtentry_enter/exit() Provide functions which handle the low level entry and exit similar to enter/exit from user mode. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134904.457578656@linutronix.de commit 53aaf262c66ee237e4163f1af347939ebd9c51c2 Author: Thomas Gleixner Date: Tue Feb 25 23:16:12 2020 +0100 x86/idtentry: Provide macros to define/declare IDT entry points Provide DECLARE/DEFINE_IDTENTRY() macros. DEFINE_IDTENTRY() provides a wrapper which acts as the function definition. The exception handler body is just appended to it with curly brackets. The entry point is marked noinstr so that irq tracing and the enter_from_user_mode() can be moved into the C-entry point. As all C-entries use the same macro (or a later variant) the necessary entry handling can be implemented at one central place. DECLARE_IDTENTRY() provides the function prototypes: - The C entry point cfunc - The ASM entry point asm_cfunc - The XEN/PV entry point xen_asm_cfunc They all follow the same naming convention. When included from ASM code DECLARE_IDTENTRY() is a macro which emits the low level entry point in assembly by instantiating idtentry. IDTENTRY is the simplest variant which just has a pt_regs argument. It's going to be used for all exceptions which have no error code. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.273363275@linutronix.de commit 60400677e1280dae7d903e5997fb1cfabb22d4bd Author: Thomas Gleixner Date: Tue Feb 25 23:16:11 2020 +0100 x86/entry/32: Provide macro to emit IDT entry stubs 32 and 64 bit have unnecessary different ways to populate the exception entry code. Provide a idtentry macro which allows to consolidate all of that. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.166735365@linutronix.de commit 424c7d0a9a396ba93815b8861033e62791622cc3 Author: Thomas Gleixner Date: Thu Mar 26 16:56:20 2020 +0100 x86/entry/64: Provide sane error entry/exit For gradual conversion provide a macro parameter and the required code which allows to handle instrumentation and interrupt flags tracking in C. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134904.058904490@linutronix.de commit cfa82a00533f7074011a3a49fbb6ed1b1f6fa010 Author: Thomas Gleixner Date: Tue Feb 25 23:16:10 2020 +0100 x86/entry: Distangle idtentry idtentry is a completely unreadable maze. Split it into distinct idtentry variants which only contain the minimal code: - idtentry for regular exceptions - idtentry_mce_debug for #MCE and #DB - idtentry_df for #DF The generated binary code is equivalent. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134903.949227617@linutronix.de commit 67f1386616dc0c70f30f214245521c582666edac Author: Thomas Gleixner Date: Tue Feb 25 23:16:09 2020 +0100 x86/entry/64: Reorder idtentries Move them all together so verifying the cleanup patches for binary equivalence will be easier. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134903.841853522@linutronix.de commit 877f183f83cc33b1b09313b9c18ab7ee5abda44f Author: Thomas Gleixner Date: Tue Feb 25 23:16:07 2020 +0100 x86/traps: Split trap numbers out in a separate header So they can be used in ASM code. For this it is also necessary to convert them to defines. Will be used for the rework of the entry code. Signed-off-by: Thomas Gleixner Reviewed-by: Andy Lutomirski Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134903.731004084@linutronix.de commit ca4c6a9858c23b4f330113f391f2eadc983e780f Author: Thomas Gleixner Date: Wed Oct 23 14:27:10 2019 +0200 x86/traps: Make interrupt enable/disable symmetric in C code Traps enable interrupts conditionally but rely on the ASM return code to disable them again. That results in redundant interrupt disable and trace calls. Make the trap handlers disable interrupts before returning to avoid that, which allows simplification of the ASM entry code in follow up changes. Originally-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134903.622702796@linutronix.de commit c9317202af70ee03d44fdd68abebdb640b8ab411 Author: Thomas Gleixner Date: Tue May 12 14:54:14 2020 +0200 x86/entry/64: Use native swapgs in asm_load_gs_index() When PARAVIRT_XXL is in use, then load_gs_index() uses xen_load_gs_index() and asm_load_gs_index() is unused. It's therefore pointless to use the paravirtualized SWAPGS implementation in asm_load_gs_index(). Switch it to a plain swapgs. Signed-off-by: Thomas Gleixner Reviewed-by: Steven Rostedt (VMware) Acked-by: Juergen Gross Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200512213809.583980272@linutronix.de commit 410367e321b5cbd4a616161142a7d162cf55885e Author: Thomas Gleixner Date: Wed Mar 4 23:32:15 2020 +0100 x86/entry: Disable interrupts for native_load_gs_index() in C code There is absolutely no point in doing this in ASM code. Move it to C. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134903.531534675@linutronix.de commit daf7a69787b587d454adea73377a904e09fd54a9 Author: Thomas Gleixner Date: Wed Mar 25 23:47:51 2020 +0100 x86/traps: Mark sync_regs() noinstr Replace the notrace and NOKPROBE annotations with noinstr. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Reviewed-by: Masami Hiramatsu Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134903.439765290@linutronix.de commit d73a332936a6d33be3aa3fa4bee959efab09e431 Author: Thomas Gleixner Date: Wed Mar 25 19:53:38 2020 +0100 x86/traps: Mark fixup_bad_iret() noinstr This is called from deep entry ASM in a situation where instrumentation will cause more harm than providing useful information. Switch from memmove() to memcpy() because memmove() can't be called from noinstr code. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Reviewed-by: Masami Hiramatsu Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134903.346741553@linutronix.de commit 1c3e5d3f60e26415d4227aa1193cf9e2db4df834 Author: Peter Zijlstra Date: Tue May 12 18:17:12 2020 +0200 x86/entry: Make entry_64_compat.S objtool clean Currently entry_64_compat is exempt from objtool, but with vmlinux mode there is no hiding it. Make the following changes to make it pass: - change entry_SYSENTER_compat to STT_NOTYPE; it's not a function and doesn't have function type stack setup. - mark all STT_NOTYPE symbols with UNWIND_HINT_EMPTY; so we do validate them and don't treat them as unreachable. - don't abuse RSP as a temp register, this confuses objtool mightily as it (rightfully) thinks we're doing unspeakable things to the stack. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134341.272248024@linutronix.de commit a7ef9ba986b5fae9d80f8a7b31db0423687efe4e Author: Thomas Gleixner Date: Wed Mar 4 12:49:18 2020 +0100 x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline Prevent the compiler from uninlining and creating traceable/probable functions as this is invoked _after_ context tracking switched to CONTEXT_USER and rcu idle. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.902709267@linutronix.de commit 4983e5d74c821780d518232eea4acdc4a8f0b44d Author: Thomas Gleixner Date: Wed Mar 4 12:51:59 2020 +0100 x86/entry: Move irq flags tracing to prepare_exit_to_usermode() This is another step towards more C-code and less convoluted ASM. Similar to the entry path, invoke the tracer before context tracking which might turn off RCU and invoke lockdep as the last step before going back to user space. Annotate the code sections in exit_to_user_mode() accordingly so objtool won't complain about the tracer invocation. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134340.703783926@linutronix.de commit dd8e2d9ae64fa4348530df3e45e9f874d807a1c2 Author: Thomas Gleixner Date: Tue Feb 25 23:08:05 2020 +0100 x86/entry: Move irq tracing on syscall entry to C-code Now that the C entry points are safe, move the irq flags tracing code into the entry helper: - Invoke lockdep before calling into context tracking - Use the safe trace_hardirqs_on_prepare() trace function after context tracking established state and RCU is watching. enter_from_user_mode() is also still invoked from the exception/interrupt entry code which still contains the ASM irq flags tracing. So this is just a redundant and harmless invocation of tracing / lockdep until these are removed as well. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.611961721@linutronix.de commit 8f159f1dfa1ea29d70a84335fe6a8bd501a9eecd Author: Thomas Gleixner Date: Tue Mar 10 14:46:27 2020 +0100 x86/entry/common: Protect against instrumentation Mark the various syscall entries with noinstr to protect them against instrumentation and add the noinstrumentation_begin()/end() annotations to mark the parts of the functions which are safe to call out into instrumentable code. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.520277507@linutronix.de commit 1723be30e46fbda0c5971d3a19a37a7c2499bc90 Author: Thomas Gleixner Date: Sat Feb 29 15:12:33 2020 +0100 x86/entry: Mark enter_from_user_mode() noinstr Both the callers in the low level ASM code and __context_tracking_exit() which is invoked from enter_from_user_mode() via user_exit_irqoff() are marked NOKPROBE. Allowing enter_from_user_mode() to be probed is inconsistent at best. Aside of that while function tracing per se is safe the function trace entry/exit points can be used via BPF as well which is not safe to use before context tracking has reached CONTEXT_KERNEL and adjusted RCU. Mark it noinstr which moves it into the instrumentation protected text section and includes notrace. Note, this needs further fixups in context tracking to ensure that the full call chain is protected. Will be addressed in follow up changes. Signed-off-by: Thomas Gleixner Reviewed-by: Masami Hiramatsu Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.429059405@linutronix.de commit 8c0fa8a036cd9c000bcf761413b565b429f629fc Author: Thomas Gleixner Date: Wed Mar 25 19:47:40 2020 +0100 x86/entry/32: Move non entry code into .text section All ASM code which is not part of the entry functionality can move out into the .text section. No reason to keep it in the non-instrumentable entry section. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.320164650@linutronix.de commit b9f6976bfb949121bb6e1e6f4fd9909735729148 Author: Thomas Gleixner Date: Wed Mar 25 19:45:26 2020 +0100 x86/entry/64: Move non entry code into .text section All ASM code which is not part of the entry functionality can move out into the .text section. No reason to keep it in the non-instrumentable entry section. Signed-off-by: Thomas Gleixner Reviewed-by: Steven Rostedt (VMware) Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.227579223@linutronix.de commit fba8dbeaf30e2c8db2c2cfeb38f6dbffcbf86bba Author: Thomas Gleixner Date: Fri May 15 17:39:05 2020 +0200 x86/idt: Remove update_intr_gate() No more users. Signed-off-by: Thomas Gleixner commit 5916d5f9b3347344a3d96ba6b54cf8e290eba96a Author: Thomas Gleixner Date: Fri Mar 13 13:49:51 2020 +0100 bug: Annotate WARN/BUG/stackfail as noinstr safe Warnings, bugs and stack protection fails from noinstr sections, e.g. low level and early entry code, are likely to be fatal. Mark them as "safe" to be invoked from noinstr protected code to avoid annotating all usage sites. Getting the information out is important. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134100.376598577@linutronix.de commit 126f21f0e8d46e2c0e9daafb67546dbfb316d325 Author: Thomas Gleixner Date: Tue Mar 10 23:47:39 2020 +0100 lib/smp_processor_id: Move it into noinstr section That code is already not traceable. Move it into the noinstr section so the objtool section validation does not trigger. Annotate the warning code as "safe". While it might be not under all circumstances, getting the information out is important enough. Should this ever trigger from the sensitive code which is shielded against instrumentation, e.g. low level entry, then the printk is the least of the worries. Addresses the objtool warnings: vmlinux.o: warning: objtool: context_tracking_recursion_enter()+0x7: call to __this_cpu_preempt_check() leaves .noinstr.text section vmlinux.o: warning: objtool: __context_tracking_exit()+0x17: call to __this_cpu_preempt_check() leaves .noinstr.text section vmlinux.o: warning: objtool: __context_tracking_enter()+0x2a: call to __this_cpu_preempt_check() leaves .noinstr.text section Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.902709267@linutronix.de commit 0372007f5a79d61d3cb48a507717b9afb5d6addd Author: Thomas Gleixner Date: Wed Mar 4 11:05:22 2020 +0100 context_tracking: Ensure that the critical path cannot be instrumented context tracking lacks a few protection mechanisms against instrumentation: - While the core functions are marked NOKPROBE they lack protection against function tracing which is required as the function entry/exit points can be utilized by BPF. - static functions invoked from the protected functions need to be marked as well as they can be instrumented otherwise. - using plain inline allows the compiler to emit traceable and probable functions. Fix this by marking the functions noinstr and converting the plain inlines to __always_inline. The NOKPROBE_SYMBOL() annotations are removed as the .noinstr.text section is already excluded from being probed. Cures the following objtool warnings: vmlinux.o: warning: objtool: enter_from_user_mode()+0x34: call to __context_tracking_exit() leaves .noinstr.text section vmlinux.o: warning: objtool: prepare_exit_to_usermode()+0x29: call to __context_tracking_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_return_slowpath()+0x29: call to __context_tracking_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: do_syscall_64()+0x7f: call to __context_tracking_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: do_int80_syscall_32()+0x3d: call to __context_tracking_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: do_fast_syscall_32()+0x9c: call to __context_tracking_enter() leaves .noinstr.text section and generates new ones... Signed-off-by: Thomas Gleixner Reviewed-by: Masami Hiramatsu Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.811520478@linutronix.de commit 20355e5f73a75e58cee4c80d4cd92ce0d1628023 Author: Peter Zijlstra Date: Thu Mar 5 14:01:25 2020 +0100 x86/entry: Exclude low level entry code from sanitizing The sanitizers are not really applicable to the fragile low level entry code. Entry code needs to carefully setup a normal 'runtime' environment. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134059.970057117@linutronix.de commit 44d7e4fbc08eca153ea4b436a1440639dff2c771 Author: Thomas Gleixner Date: Thu Mar 5 11:16:49 2020 +0100 x86/entry: Remove the unused LOCKDEP_SYSEXIT cruft No users left since two years due to commit 21d375b6b34f ("x86/entry/64: Remove the SYSCALL64 fast path") Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.061301403@linutronix.de commit 725005897ec4ba07d6227a1ac3121048153eb3ce Author: Thomas Gleixner Date: Tue Feb 25 23:16:08 2020 +0100 x86/entry/64: Avoid pointless code when CONTEXT_TRACKING=n GAS cannot optimize out the test and conditional jump when context tracking is disabled and CALL_enter_from_user_mode is an empty macro. Wrap it in #ifdeffery. Will go away once all this is moved to C. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Frederic Weisbecker Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134058.955968069@linutronix.de commit e9660391d0ebd174b169af3d6de680c2f836027c Author: Peter Zijlstra Date: Thu Feb 20 13:17:27 2020 +0100 x86/doublefault: Remove memmove() call Use of memmove() in #DF is problematic considered tracing and other instrumentation. Remove the memmove() call and simply write out what needs doing; this even clarifies the code, win-win! The code copies from the espfix64 stack to the normal task stack, there is no possible way for that to overlap. Survives selftests/x86, specifically sigreturn_64. Suggested-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200505134058.863038566@linutronix.de commit 24ae0c91cbc57c2deb0401bd653453a508acdcee Author: Andy Lutomirski Date: Mon Feb 24 13:24:58 2020 +0100 x86/hw_breakpoint: Prevent data breakpoints on cpu_entry_area A data breakpoint near the top of an IST stack will cause unrecoverable recursion. A data breakpoint on the GDT, IDT, or TSS is terrifying. Prevent either of these from happening. Co-developed-by: Peter Zijlstra Signed-off-by: Andy Lutomirski Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov Reviewed-by: Lai Jiangshan Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134058.272448010@linutronix.de commit 1f1fbc70c10e81f70e9fbe2102d439c883269811 Author: Vitaly Kuznetsov Date: Tue Apr 28 11:38:24 2020 +0200 x86/idt: Keep spurious entries unset in system_vectors With commit dc20b2d52653 ("x86/idt: Move interrupt gate initialization to IDT code") non assigned system vectors are also marked as used in 'used_vectors' (now 'system_vectors') bitmap. This makes checks in arch_show_interrupts() whether a particular system vector is allocated to always pass and e.g. 'Hyper-V reenlightenment interrupts' entry always shows up in /proc/interrupts. Another side effect of having all unassigned system vectors marked as used is that irq_matrix_debug_show() will wrongly count them among 'System' vectors. As it is now ensured that alloc_intr_gate() is not called after init, it is possible to leave unused entries in 'system_vectors' unset to fix these issues. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200428093824.1451532-4-vkuznets@redhat.com commit 06184325a1cce27a02a688d98740f90fe06e0133 Author: Vitaly Kuznetsov Date: Tue Apr 28 11:38:23 2020 +0200 x86/idt: Annotate alloc_intr_gate() with __init There seems to be no reason to allocate interrupt gates after init. Mark alloc_intr_gate() as __init and add WARN_ON() checks making sure it is only used before idt_setup_apic_and_irq_gates() finalizes IDT setup and maps all un-allocated entries to spurious entries. Suggested-by: Thomas Gleixner Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200428093824.1451532-3-vkuznets@redhat.com commit a0bb51f2638e0810c347024679239fd10a8f7990 Author: Vitaly Kuznetsov Date: Tue Apr 28 11:38:22 2020 +0200 x86/xen: Split HVM vector callback setup and interrupt gate allocation As a preparatory change for making alloc_intr_gate() __init split xen_callback_vector() into callback vector setup via hypercall (xen_setup_callback_vector()) and interrupt gate allocation (xen_alloc_callback_vector()). xen_setup_callback_vector() is being called twice: on init and upon system resume from xen_hvm_post_suspend(). alloc_intr_gate() only needs to be called once. Suggested-by: Thomas Gleixner Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200428093824.1451532-2-vkuznets@redhat.com commit fbaed278a3cc72a46aadae667b8c6754b78640a6 Author: Lai Jiangshan Date: Sun Apr 19 14:40:48 2020 +0000 x86/idt: Remove address operator on function machine_check() machine_check is function address, the address operator on it is nop for compiler. Make it consistent with the other function addresses in the same file. Signed-off-by: Lai Jiangshan Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200419144049.1906-3-laijs@linux.alibaba.com commit c75890700455113c366f795f3d22ee03623835e8 Author: Lai Jiangshan Date: Sun Apr 19 14:40:47 2020 +0000 x86/entry/64: Remove unneeded kernel CR3 switching When native_load_gs_index() fails on .Lgs_change, CR3 must be kernel CR3. No need to switch it. Signed-off-by: Lai Jiangshan Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200419144049.1906-2-laijs@linux.alibaba.com commit 26fa1263b0ba35f01a25f4f7e70ba7c44455d1e3 Author: Lai Jiangshan Date: Sun Apr 19 14:40:49 2020 +0000 x86/entry/64: Remove an unused label The label .Lcommon_\sym was introduced by 39e9543344fa. (x86-64: Reduce amount of redundant code generated for invalidate_interruptNN) And all the other relevant information was removed by 52aec3308db8 (x86/tlb: replace INVALIDATE_TLB_VECTOR by CALL_FUNCTION_VECTOR) Signed-off-by: Lai Jiangshan Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200419144049.1906-4-laijs@linux.alibaba.com commit dd4bc60765873445893037ae73a5f75398a8cd19 Author: Ard Biesheuvel Date: Thu Jun 11 14:43:30 2020 +0200 arm64: warn on incorrect placement of the kernel by the bootloader Commit cfa7ede20f133c ("arm64: set TEXT_OFFSET to 0x0 in preparation for removing it entirely") results in boot failures when booting kernels that are built without KASLR support on broken bootloaders that ignore the TEXT_OFFSET value passed via the header, and use the default of 0x80000 instead. To work around this, turn CONFIG_RELOCATABLE on by default, even if KASLR itself (CONFIG_RANDOMIZE_BASE) is turned off, and require CONFIG_EXPERT to be enabled to deviate from this. Then, emit a warning into the kernel log if we are not booting via the EFI stub (which is permitted to deviate from the placement restrictions) and the kernel base address is not placed according to the rules as laid out in Documentation/arm64/booting.rst. Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200611124330.252163-1-ardb@kernel.org Signed-off-by: Will Deacon commit e4a42c82e943b97ce124539fcd7a47445b43fa0d Author: Denis Efremov Date: Mon Jun 8 12:59:44 2020 +0300 kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables Redefine GZIP, BZIP2, LZOP variables as KGZIP, KBZIP2, KLZOP resp. GZIP, BZIP2, LZOP env variables are reserved by the tools. The original attempt to redefine them internally doesn't work in makefiles/scripts intercall scenarios, e.g., "make GZIP=gzip bindeb-pkg" and results in broken builds. There can be other broken build commands because of this, so the universal solution is to use non-reserved env variables for the compression tools. Fixes: 8dfb61dcbace ("kbuild: add variables for compression tools") Signed-off-by: Denis Efremov Tested-by: Guenter Roeck Signed-off-by: Masahiro Yamada commit fca5e94921d50d13ee8720ce58a352e7fc0228bf Author: Masahiro Yamada Date: Sun Jun 7 12:20:53 2020 +0900 samples: binderfs: really compile this sample and fix build issues Even after commit c624adc9cb6e ("samples: fix binderfs sample"), this sample is never compiled. 'hostprogs' teaches Kbuild that this is a host program, but not enough to order to compile it. You must add it to 'always-y' to really compile it. Since this sample has never been compiled in upstream, various issues are left unnoticed. [1] compilers without are still widely used is only available since commit c13295ad219d ("binderfs: rename header to binderfs.h"), i.e., Linux 5.0 If your compiler is based on UAPI headers older than Linux 5.0, you will see the following error: samples/binderfs/binderfs_example.c:16:10: fatal error: linux/android/binderfs.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. You cannot rely on compilers having such a new header. The common approach is to install UAPI headers of this kernel into usr/include, and then add it to the header search path. I added 'depends on HEADERS_INSTALL' in Kconfig, and '-I usr/include' compiler flag in Makefile. [2] compile the sample for target architecture Because headers_install works for the target architecture, only the native compiler was able to build sample code that requires '-I usr/include'. Commit 7f3a59db274c ("kbuild: add infrastructure to build userspace programs") added the new syntax 'userprogs' to compile user-space programs for the target architecture. Use it, and then 'ifndef CROSS_COMPILE' will go away. I added 'depends on CC_CAN_LINK' because $(CC) is not necessarily capable of linking user-space programs. [3] use subdir-y to descend into samples/binderfs Since this directory does not contain any kernel-space code, it has no point in generating built-in.a or modules.order. Replace obj-$(CONFIG_...) with subdir-$(CONFIG_...). [4] -Wunused-variable warning If I compile this, I see the following warning. samples/binderfs/binderfs_example.c: In function 'main': samples/binderfs/binderfs_example.c:21:9: warning: unused variable 'len' [-Wunused-variable] 21 | size_t len; | ^~~ I removed the unused 'len'. [5] CONFIG_ANDROID_BINDERFS is not required Since this is a user-space standalone program, it is independent of the kernel configuration. Remove 'depends on ANDROID_BINDERFS'. Fixes: 9762dc1432e1 ("samples: add binderfs sample program") Fixes: c624adc9cb6e ("samples: fix binderfs sample") Signed-off-by: Masahiro Yamada Acked-by: Christian Brauner commit d790eeb3db6aefac39ffa06e598eb31b7352ca4f Author: Jean Delvare Date: Thu Jun 11 12:03:47 2020 +0200 i2c: Drop stray comma in MODULE_AUTHOR statements It is not the common usage to have a comma between the name and the email address, so remove it. Signed-off-by: Jean Delvare Cc: Kukjin Kim Cc: Krzysztof Kozlowski Reviewed-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit e6197c8290f72ebadc24e05d876f42211318cd91 Author: kernel test robot Date: Thu Jun 11 10:50:35 2020 +0800 i2c: npcm7xx: npcm_i2caddr[] can be static Fixes: f54736925a4f ("i2c: npcm7xx: Add support for slave mode for Nuvoton") Signed-off-by: kernel test robot Signed-off-by: Wolfram Sang commit 66057dd1d1cf2149e0f5fdaee58d6ea69bc98048 Merge: addb1e23bf72 291ddeb621e4 Author: Dave Airlie Date: Thu Jun 11 17:51:06 2020 +1000 Merge tag 'drm-misc-next-fixes-2020-06-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-next In core, DRM connectors now notify userspace of hotplug events via sysfs. In drivers, sun4i now uses 4 bits to store the clock's m divider; ast sets up 24/32-bit color mode correctly. Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200611075007.GA15098@linux-uq9g commit 291ddeb621e4a9f1ced8302a777fbd7fbda058c6 Author: Colin Ian King Date: Wed Jun 10 12:58:04 2020 +0100 drm/ast: fix missing break in switch statement for format->cpp[0] case 4 Currently the switch statement for format->cpp[0] value 4 assigns color_index which is never read again and then falls through to the default case and returns. This looks like a missing break statement bug. Fix this by adding a break statement. Addresses-Coverity: ("Unused value") Fixes: 259d14a76a27 ("drm/ast: Split ast_set_vbios_mode_info()") Signed-off-by: Colin Ian King Signed-off-by: Thomas Zimmermann Tested-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200610115804.1132338-1-colin.king@canonical.com commit 2a9e5ded9543436620a7fbc9329ddcc32bf97bc7 Author: Petr Mladek Date: Wed May 20 12:22:33 2020 +0200 printk/kdb: Redirect printk messages into kdb in any context kdb has to get messages on consoles even when the system is stopped. It uses kdb_printf() internally and calls console drivers on its own. It uses a hack to reuse an existing code. It sets "kdb_trap_printk" global variable to redirect even the normal printk() into the kdb_printf() variant. The variable "kdb_trap_printk" is checked in printk_default() and it is ignored when printk is redirected to printk_safe in NMI context. Solve this by moving the check into printk_func(). It is obvious that it is not fully safe. But it does not make things worse. The console drivers are already called in this context by db_printf() direct calls. Reported-by: Sumit Garg Tested-by: Sumit Garg Reviewed-by: Daniel Thompson Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20200520102233.GC3464@linux-b0ei commit 37f8173dd84936ea78000ed1cad24f8b18d48ebb Author: Peter Zijlstra Date: Fri Jan 24 22:13:03 2020 +0100 locking/atomics: Flip fallbacks and instrumentation Currently instrumentation of atomic primitives is done at the architecture level, while composites or fallbacks are provided at the generic level. The result is that there are no uninstrumented variants of the fallbacks. Since there is now need of such variants to isolate text poke from any form of instrumentation invert this ordering. Doing this means moving the instrumentation into the generic code as well as having (for now) two variants of the fallbacks. Notes: - the various *cond_read* primitives are not proper fallbacks and got moved into linux/atomic.c. No arch_ variants are generated because the base primitives smp_cond_load*() are instrumented. - once all architectures are moved over to arch_atomic_ one of the fallback variants can be removed and some 2300 lines reclaimed. - atomic_{read,set}*() are no longer double-instrumented Reported-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Mark Rutland Link: https://lkml.kernel.org/r/20200505134058.769149955@linutronix.de commit 765dcd209947e7b3666c08fb109ab8b879f7a471 Author: Marco Elver Date: Tue Nov 26 15:04:05 2019 +0100 asm-generic/atomic: Use __always_inline for fallback wrappers Use __always_inline for atomic fallback wrappers. When building for size (CC_OPTIMIZE_FOR_SIZE), some compilers appear to be less inclined to inline even relatively small static inline functions that are assumed to be inlinable such as atomic ops. This can cause problems, for example in UACCESS regions. While the fallback wrappers aren't pure wrappers, they are trivial nonetheless, and the function they wrap should determine the final inlining policy. For x86 tinyconfig we observe: - vmlinux baseline: 1315988 - vmlinux with patch: 1315928 (-60 bytes) [ tglx: Cherry-picked from KCSAN ] Suggested-by: Mark Rutland Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney Signed-off-by: Thomas Gleixner commit e9f901dc05c09c4f89183cadcb2d93177f3100cb Author: Sivaprakash Murugesan Date: Mon Jun 8 15:07:27 2020 +0530 mailbox: qcom: Add ipq6018 apcs compatible The Qualcomm ipq6018 has apcs block, add compatible for the same. Also, the ipq6018 apcs provides a clock functionality similar to msm8916 but the clock driver is different. Create a child device based on the apcs compatible for the clock controller functionality. Signed-off-by: Sivaprakash Murugesan Signed-off-by: Jassi Brar commit 9b007938ae3cd75d0ae883c6c0eeb0985cacba15 Author: Sivaprakash Murugesan Date: Mon Jun 8 15:07:26 2020 +0530 mailbox: qcom: Add clock driver name in apcs mailbox driver data Some apcs mailbox devices supports a clock driver, the compatible strings of devices supporting clock driver along with the clock driver name are maintained in a separate structure within the mailbox driver. And the clock driver is added based on device match. With increase in number of devices supporting the clock feature move the clock driver name inside the driver data. so that we can use a single API to get the register offset of mailbox driver and clock driver name together, and the clock driver will be added based on the driver data. Signed-off-by: Sivaprakash Murugesan Signed-off-by: Jassi Brar commit 01f76386b0ac0b1c1094456c8f43ea6085fc49d2 Author: Vincent Chen Date: Tue Jun 9 22:14:49 2020 +0800 riscv: set the permission of vdso_data to read-only The original vdso_data page is empty, so the permission of the vdso_data page can be the same with the vdso text page. After introducing the vDSO common flow, the vdso_data is not empty and the permission should be changed to read-only. Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit ad5d1122b82fbd6a816d1b9d26ee01a6dbc2d757 Author: Vincent Chen Date: Tue Jun 9 22:14:48 2020 +0800 riscv: use vDSO common flow to reduce the latency of the time-related functions Even if RISC-V has supported the vDSO feature, the latency of the functions for obtaining the system time is still expensive. It is because these functions still trigger a corresponding system call in the process, which slows down the response time. If we want to remove the system call to reduce the latency, the kernel should have the ability to output the system clock information to userspace. This patch introduces the vDSO common flow to enable the kernel to achieve the above feature and uses "rdtime" instruction to obtain the current time in the user space. Under this condition, the latency cost by the ecall from U-mode to S-mode can be eliminated. After applying this patch, the latency of gettimeofday() measured on the HiFive unleashed board can be reduced by %61. Signed-off-by: Vincent Chen Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 37c54f9bd48663f7657a9178fe08c47e4f5b537b Author: Christoph Hellwig Date: Wed Jun 10 18:42:10 2020 -0700 kernel: set USER_DS in kthread_use_mm Some architectures like arm64 and s390 require USER_DS to be set for kernel threads to access user address space, which is the whole purpose of kthread_use_mm, but other like x86 don't. That has lead to a huge mess where some callers are fixed up once they are tested on said architectures, while others linger around and yet other like io_uring try to do "clever" optimizations for what usually is just a trivial asignment to a member in the thread_struct for most architectures. Make kthread_use_mm set USER_DS, and kthread_unuse_mm restore to the previous value instead. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Tested-by: Jens Axboe Reviewed-by: Jens Axboe Acked-by: Michael S. Tsirkin Cc: Alex Deucher Cc: Al Viro Cc: Felipe Balbi Cc: Felix Kuehling Cc: Jason Wang Cc: Zhenyu Wang Cc: Zhi Wang Cc: Greg Kroah-Hartman Link: http://lkml.kernel.org/r/20200404094101.672954-7-hch@lst.de Signed-off-by: Linus Torvalds commit f5678e7f2ac31c270334b936352f0ef2fe7dd2b3 Author: Christoph Hellwig Date: Wed Jun 10 18:42:06 2020 -0700 kernel: better document the use_mm/unuse_mm API contract Switch the function documentation to kerneldoc comments, and add WARN_ON_ONCE asserts that the calling thread is a kernel thread and does not have ->mm set (or has ->mm set in the case of unuse_mm). Also give the functions a kthread_ prefix to better document the use case. [hch@lst.de: fix a comment typo, cover the newly merged use_mm/unuse_mm caller in vfio] Link: http://lkml.kernel.org/r/20200416053158.586887-3-hch@lst.de [sfr@canb.auug.org.au: powerpc/vas: fix up for {un}use_mm() rename] Link: http://lkml.kernel.org/r/20200422163935.5aa93ba5@canb.auug.org.au Signed-off-by: Christoph Hellwig Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Tested-by: Jens Axboe Reviewed-by: Jens Axboe Acked-by: Felix Kuehling Acked-by: Greg Kroah-Hartman [usb] Acked-by: Haren Myneni Cc: Alex Deucher Cc: Al Viro Cc: Felipe Balbi Cc: Jason Wang Cc: "Michael S. Tsirkin" Cc: Zhenyu Wang Cc: Zhi Wang Link: http://lkml.kernel.org/r/20200404094101.672954-6-hch@lst.de Signed-off-by: Linus Torvalds commit 4dbe59a6ae358f30b6a9a50406249d54cc954dc1 Author: Christoph Hellwig Date: Wed Jun 10 18:42:03 2020 -0700 kernel: move use_mm/unuse_mm to kthread.c cover the newly merged use_mm/unuse_mm caller in vfio Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Felix Kuehling Cc: Alex Deucher Cc: Al Viro Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Jason Wang Cc: Jens Axboe Cc: "Michael S. Tsirkin" Cc: Zhenyu Wang Cc: Zhi Wang Link: http://lkml.kernel.org/r/20200416053158.586887-2-hch@lst.de Signed-off-by: Linus Torvalds commit 9bf5b9eb232b34738800868e30bea3bad4a6a1ba Author: Christoph Hellwig Date: Wed Jun 10 18:41:59 2020 -0700 kernel: move use_mm/unuse_mm to kthread.c Patch series "improve use_mm / unuse_mm", v2. This series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. This patch (of 3): Use the proper API instead. Link: http://lkml.kernel.org/r/20200404094101.672954-1-hch@lst.de These helpers are only for use with kernel threads, and I will tie them more into the kthread infrastructure going forward. Also move the prototypes to kthread.h - mmu_context.h was a little weird to start with as it otherwise contains very low-level MM bits. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Tested-by: Jens Axboe Reviewed-by: Jens Axboe Acked-by: Felix Kuehling Cc: Alex Deucher Cc: Al Viro Cc: Felipe Balbi Cc: Jason Wang Cc: "Michael S. Tsirkin" Cc: Zhenyu Wang Cc: Zhi Wang Cc: Greg Kroah-Hartman Link: http://lkml.kernel.org/r/20200404094101.672954-1-hch@lst.de Link: http://lkml.kernel.org/r/20200416053158.586887-1-hch@lst.de Link: http://lkml.kernel.org/r/20200404094101.672954-5-hch@lst.de Signed-off-by: Linus Torvalds commit 2c34f6f738d2509cf9b710abd35a605acfd6ada6 Author: Walter Wu Date: Wed Jun 10 18:41:56 2020 -0700 stacktrace: cleanup inconsistent variable type Modify the variable type of 'skip' member of struct stack_trace. In theory, the 'skip' variable type should be unsigned int. There are two reasons: - The 'skip' only has two situation, 1)Positive value, 2)Zero - The 'skip' of struct stack_trace has inconsistent type with struct stack_trace_data, it makes a bit confusion in the relationship between struct stack_trace and stack_trace_data. Signed-off-by: Walter Wu Signed-off-by: Andrew Morton Reviewed-by: Bart Van Assche Cc: Matthias Brugger Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Josh Poimboeuf Link: http://lkml.kernel.org/r/20200421013511.5960-1-walter-zh.wu@mediatek.com Signed-off-by: Linus Torvalds commit 6af132f3a11e6d2d9032ce51c882aa5933543255 Author: Wei Yang Date: Wed Jun 10 18:41:53 2020 -0700 lib: test get_count_order/long in test_bitops.c Add some tests for get_count_order/long in test_bitops.c. [akpm@linux-foundation.org: define local `i'] [akpm@linux-foundation.org: enhancement, warning fix, cleanup per Geert] [akpm@linux-foundation.org: fix loop bound, per Wei Yang] Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andy Shevchenko Cc: Christian Brauner Cc: Geert Uytterhoeven Link: http://lkml.kernel.org/r/20200602223728.32722-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 496df3d3ab8a407f83330fb8d7160a5f91898c55 Author: Ben Widawsky Date: Wed Jun 10 18:41:50 2020 -0700 mm: add comments on pglist_data zones While making other modifications it was easy to confuse the two struct members node_zones and node_zonelists. For those already familiar with the code, this might seem to be a silly patch, but it's quite helpful to disambiguate the similar-sounding fields While here, add a small comment on why nr_zones isn't simply MAX_NR_ZONES Signed-off-by: Ben Widawsky Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200520205443.2757414-1-ben.widawsky@intel.com Signed-off-by: Linus Torvalds commit cc989e78472e29c69b196d6985e718c8834027b7 Author: Keyur Patel Date: Wed Jun 10 18:41:47 2020 -0700 ocfs2: fix spelling mistake and grammar ./ocfs2/mmap.c:65: bebongs ==> belonging Signed-off-by: Keyur Patel Signed-off-by: Andrew Morton Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Link: http://lkml.kernel.org/r/20200608014818.102358-1-iamkeyur96@gmail.com Signed-off-by: Linus Torvalds commit 787d563b8642f35c561e439ebaf7ee5653437d05 Author: Aneesh Kumar K.V Date: Wed Jun 10 18:41:44 2020 -0700 mm/debug_vm_pgtable: fix kernel crash by checking for THP support Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but no THP support enabled based on platforms. For ex: with 4K PAGE_SIZE ppc64 supports THP only with radix translation. This results in below crash when running with hash translation and 4K PAGE_SIZE. kernel BUG at arch/powerpc/include/asm/book3s/64/hash-4k.h:140! cpu 0x61: Vector: 700 (Program Check) at [c000000ff948f860] pc: debug_vm_pgtable+0x480/0x8b0 lr: debug_vm_pgtable+0x474/0x8b0 ... debug_vm_pgtable+0x374/0x8b0 (unreliable) do_one_initcall+0x98/0x4f0 kernel_init_freeable+0x330/0x3fc kernel_init+0x24/0x148 Check for THP support correctly Link: http://lkml.kernel.org/r/20200608125252.407659-1-aneesh.kumar@linux.ibm.com Fixes: 399145f9eb6c ("mm/debug: add tests validating architecture page table helpers") Signed-off-by: Aneesh Kumar K.V Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 81c4f4d924d5d009b5ed785a3e22b18d0f7b831f Author: Alexander Gordeev Date: Wed Jun 10 18:41:41 2020 -0700 lib: fix bitmap_parse() on 64-bit big endian archs Commit 2d6261583be0 ("lib: rework bitmap_parse()") does not take into account order of halfwords on 64-bit big endian architectures. As result (at least) Receive Packet Steering, IRQ affinity masks and runtime kernel test "test_bitmap" get broken on s390. [andriy.shevchenko@linux.intel.com: convert infinite while loop to a for loop] Link: http://lkml.kernel.org/r/20200609140535.87160-1-andriy.shevchenko@linux.intel.com Fixes: 2d6261583be0 ("lib: rework bitmap_parse()") Signed-off-by: Alexander Gordeev Signed-off-by: Andy Shevchenko Signed-off-by: Andrew Morton Reviewed-by: Andy Shevchenko Cc: Yury Norov Cc: Amritha Nambiar Cc: Arnaldo Carvalho de Melo Cc: Chris Wilson Cc: Kees Cook Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Rasmus Villemoes Cc: Steffen Klassert Cc: "Tobin C . Harding" Cc: Vineet Gupta Cc: Will Deacon Cc: Willem de Bruijn Cc: Link: http://lkml.kernel.org/r/1591634471-17647-1-git-send-email-agordeev@linux.ibm.com Signed-off-by: Linus Torvalds commit 2581ac7c2f6b093eea3340a4e2db8a55fc9f8470 Author: Tim Froidcoeur Date: Wed Jun 10 18:41:38 2020 -0700 checkpatch: correct check for kernel parameters doc Adding a new kernel parameter with documentation makes checkpatch complain __setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.rst The list of kernel parameters has moved to a separate txt file, but checkpatch has not been updated for this. Make checkpatch.pl look for the documentation for new kernel parameters in kernel-parameters.txt instead of kernel-parameters.rst. Fixes: e52347bd66f6 ("Documentation/admin-guide: split the kernel parameter list to a separate file") Signed-off-by: Tim Froidcoeur Signed-off-by: Andrew Morton Acked-by: Joe Perches Cc: Mauro Carvalho Chehab Signed-off-by: Linus Torvalds commit 8301c719a2bd131436438e49130ee381d30933f5 Author: Ryusuke Konishi Date: Wed Jun 10 18:41:35 2020 -0700 nilfs2: fix null pointer dereference at nilfs_segctor_do_construct() After commit c3aab9a0bd91 ("mm/filemap.c: don't initiate writeback if mapping has no dirty pages"), the following null pointer dereference has been reported on nilfs2: BUG: kernel NULL pointer dereference, address: 00000000000000a8 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI ... RIP: 0010:percpu_counter_add_batch+0xa/0x60 ... Call Trace: __test_set_page_writeback+0x2d3/0x330 nilfs_segctor_do_construct+0x10d3/0x2110 [nilfs2] nilfs_segctor_construct+0x168/0x260 [nilfs2] nilfs_segctor_thread+0x127/0x3b0 [nilfs2] kthread+0xf8/0x130 ... This crash turned out to be caused by set_page_writeback() call for segment summary buffers at nilfs_segctor_prepare_write(). set_page_writeback() can call inc_wb_stat(inode_to_wb(inode), WB_WRITEBACK) where inode_to_wb(inode) is NULL if the inode of underlying block device does not have an associated wb. This fixes the issue by calling inode_attach_wb() in advance to ensure to associate the bdev inode with its wb. Fixes: c3aab9a0bd91 ("mm/filemap.c: don't initiate writeback if mapping has no dirty pages") Reported-by: Walton Hoops Reported-by: Tomas Hlavaty Reported-by: ARAI Shun-ichi Reported-by: Hideki EIRAKU Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Tested-by: Ryusuke Konishi Cc: [5.4+] Link: http://lkml.kernel.org/r/20200608.011819.1399059588922299158.konishi.ryusuke@gmail.com Signed-off-by: Linus Torvalds commit e8ec04938c446e5f4dc53e0147f0f679995012ee Author: Joe Perches Date: Wed Jun 10 18:41:32 2020 -0700 lib/lz4/lz4_decompress.c: document deliberate use of `&' This operation was intentional, but tools such as smatch will warn that it might not have been. Signed-off-by: Andrew Morton Cc: Yann Collet Cc: Vasily Averin Cc: Gao Xiang Link: http://lkml.kernel.org/r/3bf931c6ea0cae3e23f3485801986859851b4f04.camel@perches.com Signed-off-by: Linus Torvalds commit 3021e69219e2f3df6d01243000db32d1325cdd0d Author: Andrey Konovalov Date: Wed Jun 10 18:41:28 2020 -0700 kcov: check kcov_softirq in kcov_remote_stop() kcov_remote_stop() should check that the corresponding kcov_remote_start() actually found the specified remote handle and started collecting coverage. This is done by checking the per thread kcov_softirq flag. A particular failure scenario where this was observed involved a softirq with a remote coverage collection section coming between check_kcov_mode() and the access to t->kcov_area in __sanitizer_cov_trace_pc(). In that softirq kcov_remote_start() bailed out after kcov_remote_find() check, but the matching kcov_remote_stop() didn't check if kcov_remote_start() succeeded, and overwrote per thread kcov parameters with invalid (zero) values. Fixes: 5ff3b30ab57d ("kcov: collect coverage from interrupts") Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alexander Potapenko Cc: Marco Elver Cc: Tetsuo Handa Link: http://lkml.kernel.org/r/fcd1cd16eac1d2c01a66befd8ea4afc6f8d09833.1591576806.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 405906600a33a37e225817c085b1807ad46784b4 Author: SeongJae Park Date: Wed Jun 10 18:41:25 2020 -0700 scripts/spelling: add a few more typos This commit adds typos I found from another work. Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Cc: Joe Perches Link: http://lkml.kernel.org/r/20200605092502.18018-3-sjpark@amazon.com Signed-off-by: Linus Torvalds commit 9f267a17bfb4eb52a1705d0886a7220e6470bf52 Author: Dan Carpenter Date: Wed Jun 10 18:41:22 2020 -0700 khugepaged: selftests: fix timeout condition in wait_for_scan() The loop exits with "timeout" set to -1 and not to 0 so the test needs to be fixed. Fixes: e7b592f6caca ("khugepaged: add self test") Signed-off-by: Dan Carpenter Signed-off-by: Andrew Morton Cc: Shuah Khan Cc: Stephen Rothwell Cc: Zi Yan Cc: William Kucharski Cc: Yang Shi Cc: John Hubbard Link: http://lkml.kernel.org/r/20200605110736.GH978434@mwanda Acked-by: Kirill A. Shutemov Signed-off-by: Linus Torvalds commit 65de50969a77509452ae590e9449b70a22b923bb Author: Tom Rix Date: Wed Jun 10 14:57:13 2020 -0700 selinux: fix double free Clang's static analysis tool reports these double free memory errors. security/selinux/ss/services.c:2987:4: warning: Attempt to free released memory [unix.Malloc] kfree(bnames[i]); ^~~~~~~~~~~~~~~~ security/selinux/ss/services.c:2990:2: warning: Attempt to free released memory [unix.Malloc] kfree(bvalues); ^~~~~~~~~~~~~~ So improve the security_get_bools error handling by freeing these variables and setting their return pointers to NULL and the return len to 0 Cc: stable@vger.kernel.org Signed-off-by: Tom Rix Acked-by: Stephen Smalley Signed-off-by: Paul Moore commit addb1e23bf72c47a3e2eb7cdad6dc8cdffa91384 Merge: 8d286e2ff440 3680c2e9f425 Author: Dave Airlie Date: Thu Jun 11 11:49:03 2020 +1000 Merge tag 'drm-intel-next-fixes-2020-06-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Avoid use after free in cmdparser - Avoid NULL dereference when probing all display encoders - Fixup to module parameter type Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200610093700.GA8599@jlahtine-desk.ger.corp.intel.com commit b29482fde649c72441d5478a4ea2c52c56d97a5e Merge: 4dbb29fe9dae 12aceb89b0bc Author: Linus Torvalds Date: Wed Jun 10 18:09:13 2020 -0700 Merge branch 'work.epoll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull epoll update from Al Viro: "epoll conversion to read_iter from Jens; I thought there might be more epoll stuff this cycle, but uaccess took too much time" * 'work.epoll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: eventfd: convert to f_op->read_iter() commit ae0b829df7120c78692e49c88453007e531c0e00 Author: Jakub Kicinski Date: Wed Jun 10 16:59:11 2020 -0700 docs: networkng: convert sja1105's devlink info to RTS A new file snuck into the tree after all existing documentation was converted to RST. Convert sja1105's devlink info and move it where the rest of the drivers are documented. Signed-off-by: Jakub Kicinski Acked-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit e697deed834de15d2322d0619d51893022c90ea2 Author: Jiufei Xue Date: Wed Jun 10 13:41:59 2020 +0800 io_uring: check file O_NONBLOCK state for accept If the socket is O_NONBLOCK, we should complete the accept request with -EAGAIN when data is not ready. Signed-off-by: Jiufei Xue Signed-off-by: Jens Axboe commit b548493cd485836e70ce29980089fc90d85874fb Merge: 934e36ec5e81 8b9914cd723b Author: David S. Miller Date: Wed Jun 10 17:05:02 2020 -0700 Merge branch 'chcr-Fixing-issues-in-dma-mapping-and-driver-removal' Ayush Sawal says: ==================== Fixing issues in dma mapping and driver removal Patch 1: This fixes the kernel panic which occurs due to the accessing of a zero length sg. Patch 2: Avoiding unregistering the algorithm if cra_refcnt is not 1. ==================== Signed-off-by: David S. Miller commit 8b9914cd723bfce8dbff65bd135563f887dcb19d Author: Ayush Sawal Date: Wed Jun 10 02:54:32 2020 +0530 Crypto/chcr: Checking cra_refcnt before unregistering the algorithms This patch puts a check for algorithm unregister, to avoid removal of driver if the algorithm is under use. Signed-off-by: Ayush Sawal Signed-off-by: David S. Miller commit fb90a1c85d8f08c85d9fd5729bfdeb786119f219 Author: Ayush Sawal Date: Wed Jun 10 02:54:31 2020 +0530 Crypto/chcr: Calculate src and dst sg lengths separately for dma map This patch calculates src and dst sg lengths separately for dma mapping in case of aead operation. This fixes a panic which occurs due to the accessing of a zero length sg. Panic: [ 138.173225] kernel BUG at drivers/iommu/intel-iommu.c:1184! Signed-off-by: Ayush Sawal Signed-off-by: David S. Miller commit 405a5d2b2762f2a9813efdee93274d4e7bf607a1 Author: Xiaoguang Wang Date: Wed Jun 10 19:41:20 2020 +0800 io_uring: avoid unnecessary io_wq_work copy for fast poll feature Basically IORING_OP_POLL_ADD command and async armed poll handlers for regular commands don't touch io_wq_work, so only REQ_F_WORK_INITIALIZED is set, can we do io_wq_work copy and restore. Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 7cdaf587de7c6f494b8433fded19f7728e70e1ef Author: Xiaoguang Wang Date: Wed Jun 10 19:41:19 2020 +0800 io_uring: avoid whole io_wq_work copy for requests completed inline If requests can be submitted and completed inline, we don't need to initialize whole io_wq_work in io_init_req(), which is an expensive operation, add a new 'REQ_F_WORK_INITIALIZED' to determine whether io_wq_work is initialized and add a helper io_req_init_async(), users must call io_req_init_async() for the first time touching any members of io_wq_work. I use /dev/nullb0 to evaluate performance improvement in my physical machine: modprobe null_blk nr_devices=1 completion_nsec=0 sudo taskset -c 60 fio -name=fiotest -filename=/dev/nullb0 -iodepth=128 -thread -rw=read -ioengine=io_uring -direct=1 -bs=4k -size=100G -numjobs=1 -time_based -runtime=120 before this patch: Run status group 0 (all jobs): READ: bw=724MiB/s (759MB/s), 724MiB/s-724MiB/s (759MB/s-759MB/s), io=84.8GiB (91.1GB), run=120001-120001msec With this patch: Run status group 0 (all jobs): READ: bw=761MiB/s (798MB/s), 761MiB/s-761MiB/s (798MB/s-798MB/s), io=89.2GiB (95.8GB), run=120001-120001msec About 5% improvement. Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 934e36ec5e81b8bc079f3d7acd12beb16cad9531 Author: Jakub Kicinski Date: Wed Jun 10 16:09:06 2020 -0700 docs: networkng: fix lists and table in sja1105 We need an empty line before list stats, otherwise first point will be smooshed into the paragraph. Inside tables text must start at the same offset in the cell, otherwise sphinx thinks it's a new indented block. Documentation/networking/dsa/sja1105.rst:108: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/networking/dsa/sja1105.rst:112: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/networking/dsa/sja1105.rst:245: WARNING: Unexpected indentation. Documentation/networking/dsa/sja1105.rst:246: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/networking/dsa/sja1105.rst:253: WARNING: Unexpected indentation. Documentation/networking/dsa/sja1105.rst:254: WARNING: Block quote ends without a blank line; unexpected unindent. Fixes: a20bc43bfb2e ("docs: net: dsa: sja1105: document the best_effort_vlan_filtering option") Signed-off-by: Jakub Kicinski Acked-by: Vladimir Oltean Signed-off-by: David S. Miller commit 58e898a07b9aa2de5eb2fdb9bfe1d0017682d340 Author: Jakub Kicinski Date: Wed Jun 10 15:36:48 2020 -0700 docs: networking: fix extra spaces in ethtool-netlink Sphinx appears to get upset at extra spaces at the end of a literal: Documentation/networking/ethtool-netlink.rst:1032: WARNING: Inline literal start-string without end-string. Documentation/networking/ethtool-netlink.rst:1034: WARNING: Inline literal start-string without end-string. Documentation/networking/ethtool-netlink.rst:1036: WARNING: Inline literal start-string without end-string. Documentation/networking/ethtool-netlink.rst:1089: WARNING: Inline literal start-string without end-string. Documentation/networking/ethtool-netlink.rst:1091: WARNING: Inline literal start-string without end-string. Documentation/networking/ethtool-netlink.rst:1093: WARNING: Inline literal start-string without end-string. Fixes: f2bc8ad31a7f ("net: ethtool: Allow PHY cable test TDR data to configured") Fixes: a331172b156b ("net: ethtool: Add attributes for cable test TDR data") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 014406babc1f5f887a08737566b5b356c7018242 Author: Corentin Labbe Date: Wed Jun 10 09:53:44 2020 +0000 net: cadence: macb: disable NAPI on error When the PHY is not working, the macb driver crash on a second try to setup it. [ 78.545994] macb e000b000.ethernet eth0: Could not attach PHY (-19) ifconfig: SIOCSIFFLAGS: No such device [ 78.655457] ------------[ cut here ]------------ [ 78.656014] kernel BUG at /linux-next/include/linux/netdevice.h:521! [ 78.656504] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 78.657079] Modules linked in: [ 78.657795] CPU: 0 PID: 122 Comm: ifconfig Not tainted 5.7.0-next-20200609 #1 [ 78.658202] Hardware name: Xilinx Zynq Platform [ 78.659632] PC is at macb_open+0x220/0x294 [ 78.660160] LR is at 0x0 [ 78.660373] pc : [] lr : [<00000000>] psr: 60000013 [ 78.660716] sp : c89ffd70 ip : c8a28800 fp : c199bac0 [ 78.661040] r10: 00000000 r9 : c8838540 r8 : c8838568 [ 78.661362] r7 : 00000001 r6 : c8838000 r5 : c883c000 r4 : 00000000 [ 78.661724] r3 : 00000010 r2 : 00000000 r1 : 00000000 r0 : 00000000 [ 78.662187] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 78.662635] Control: 10c5387d Table: 08b64059 DAC: 00000051 [ 78.663035] Process ifconfig (pid: 122, stack limit = 0x(ptrval)) [ 78.663476] Stack: (0xc89ffd70 to 0xc8a00000) [ 78.664121] fd60: 00000000 c89fe000 c8838000 c89fe000 [ 78.664866] fd80: 00000000 c11ff9ac c8838028 00000000 00000000 c0de6f2c 00000001 c1804eec [ 78.665579] fda0: c19b8178 c8838000 00000000 ca760866 c8838000 00000001 00001043 c89fe000 [ 78.666355] fdc0: 00001002 c0de72f4 c89fe000 c0de8dc0 00008914 c89fe000 c199bac0 ca760866 [ 78.667111] fde0: c89ffddc c8838000 00001002 00000000 c8838138 c881010c 00008914 c0de7364 [ 78.667862] fe00: 00000000 c89ffe70 c89fe000 ffffffff c881010c c0e8bd48 00000003 00000000 [ 78.668601] fe20: c8838000 c8810100 39c1118f 00039c11 c89a0960 00001043 00000000 000a26d0 [ 78.669343] fe40: b6f43000 ca760866 c89a0960 00000051 befe6c50 00008914 c8b2a3c0 befe6c50 [ 78.670086] fe60: 00000003 ee610500 00000000 c0e8ef58 30687465 00000000 00000000 00000000 [ 78.670865] fe80: 00001043 00000000 000a26d0 b6f43000 c89a0600 ee40ae7c c8870d00 c0ddabf4 [ 78.671593] fea0: c89ffeec c0ddabf4 c89ffeec c199bac0 00008913 c0ddac48 c89ffeec c89fe000 [ 78.672324] fec0: befe6c50 ca760866 befe6c50 00008914 c89fe000 befe6c50 c8b2a3c0 c0dc00e4 [ 78.673088] fee0: c89a0480 00000201 00000cc0 30687465 00000000 00000000 00000000 00001002 [ 78.673822] ff00: 00000000 000a26d0 b6f43000 ca760866 00008914 c8b2a3c0 000a0ec4 c8b2a3c0 [ 78.674576] ff20: befe6c50 c04b21bc 000d5004 00000817 c89a0480 c0315f94 00000000 00000003 [ 78.675415] ff40: c19a2bc8 c8a3cc00 c89fe000 00000255 00000000 00000000 00000000 000d5000 [ 78.676182] ff60: 000f6000 c180b2a0 00000817 c0315e64 000d5004 c89fffb0 b6ec0c30 ca760866 [ 78.676928] ff80: 00000000 000b609b befe6c50 000a0ec4 00000036 c03002c4 c89fe000 00000036 [ 78.677673] ffa0: 00000000 c03000c0 000b609b befe6c50 00000003 00008914 befe6c50 000b609b [ 78.678415] ffc0: 000b609b befe6c50 000a0ec4 00000036 befe6e0c befe6f1a 000d5150 00000000 [ 78.679154] ffe0: 000d41e4 befe6bf4 00019648 b6e4509c 20000010 00000003 00000000 00000000 [ 78.681059] [] (macb_open) from [] (__dev_open+0xd0/0x154) [ 78.681571] [] (__dev_open) from [] (__dev_change_flags+0x16c/0x1c4) [ 78.682015] [] (__dev_change_flags) from [] (dev_change_flags+0x18/0x48) [ 78.682493] [] (dev_change_flags) from [] (devinet_ioctl+0x5e4/0x75c) [ 78.682945] [] (devinet_ioctl) from [] (inet_ioctl+0x1f0/0x3b4) [ 78.683381] [] (inet_ioctl) from [] (sock_ioctl+0x39c/0x664) [ 78.683818] [] (sock_ioctl) from [] (ksys_ioctl+0x2d8/0x9c0) [ 78.684343] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 78.684789] Exception stack(0xc89fffa8 to 0xc89ffff0) [ 78.685346] ffa0: 000b609b befe6c50 00000003 00008914 befe6c50 000b609b [ 78.686106] ffc0: 000b609b befe6c50 000a0ec4 00000036 befe6e0c befe6f1a 000d5150 00000000 [ 78.686710] ffe0: 000d41e4 befe6bf4 00019648 b6e4509c [ 78.687582] Code: 9a000003 e5983078 e3130001 1affffef (e7f001f2) [ 78.688788] ---[ end trace e3f2f6ab69754eae ]--- This is due to NAPI left enabled if macb_phylink_connect() fail. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Signed-off-by: Corentin Labbe Signed-off-by: David S. Miller commit 4dbb29fe9dae033a375f231da9cc27aaa09d2580 Merge: 1c3837266214 cc23402c1c2d Author: Linus Torvalds Date: Wed Jun 10 16:09:11 2020 -0700 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs fixes from Al Viro: "A couple of trivial patches that fell through the cracks last cycle" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: fix indentation in deactivate_super() vfs: Remove duplicated d_mountpoint check in __is_local_mountpoint commit 4b5af44129d0653a4df44e5511c7d480c61c8f3c Author: Paolo Abeni Date: Wed Jun 10 10:49:00 2020 +0200 mptcp: don't leak msk in token container If a listening MPTCP socket has unaccepted sockets at close time, the related msks are freed via mptcp_sock_destruct(), which in turn does not invoke the proto->destroy() method nor the mptcp_token_destroy() function. Due to the above, the child msk socket is not removed from the token container, leading to later UaF. Address the issue explicitly removing the token even in the above error path. Fixes: 79c0949e9a09 ("mptcp: Add key generation and token tree") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit 1c3837266214c1e6fbbb96ff36bee13e923057d8 Merge: 3a8557e1aed0 ef9d965bc8b6 Author: Linus Torvalds Date: Wed Jun 10 16:05:54 2020 -0700 Merge branch 'work.sysctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull sysctl fixes from Al Viro: "Fixups to regressions in sysctl series" * 'work.sysctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: sysctl: reject gigantic reads/write to sysctl files cdrom: fix an incorrect __user annotation on cdrom_sysctl_info trace: fix an incorrect __user annotation on stack_trace_sysctl random: fix an incorrect __user annotation on proc_do_entropy net/sysctl: remove leftover __user annotations on neigh_proc_dointvec* net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl commit 3a8557e1aed0043d526f304a1f500108c8976b78 Merge: 4382a79b2746 7b3f0c4c56b0 Author: Linus Torvalds Date: Wed Jun 10 16:04:27 2020 -0700 Merge branch 'uaccess.i915' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull i915 uaccess updates from Al Viro: "Low-hanging fruit in i915; there are several trickier followups, but that'll wait for the next cycle" * 'uaccess.i915' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: i915:get_engines(): get rid of pointless access_ok() i915: alloc_oa_regs(): get rid of pointless access_ok() i915 compat ioctl(): just use drm_ioctl_kernel() i915: switch copy_perf_config_registers_or_number() to unsafe_put_user() i915: switch query_{topology,engine}_info() to copy_to_user() commit 4382a79b2746faf9db98a34ae1a1cbd364473f75 Merge: 79ca035d2d94 b7e4b65f3fe9 Author: Linus Torvalds Date: Wed Jun 10 16:02:54 2020 -0700 Merge branch 'uaccess.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull misc uaccess updates from Al Viro: "Assorted uaccess patches for this cycle - the stuff that didn't fit into thematic series" * 'uaccess.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: bpf: make bpf_check_uarg_tail_zero() use check_zeroed_user() x86: kvm_hv_set_msr(): use __put_user() instead of 32bit __clear_user() user_regset_copyout_zero(): use clear_user() TEST_ACCESS_OK _never_ had been checked anywhere x86: switch cp_stat64() to unsafe_put_user() binfmt_flat: don't use __put_user() binfmt_elf_fdpic: don't use __... uaccess primitives binfmt_elf: don't bother with __{put,copy_to}_user() pselect6() and friends: take handling the combined 6th/7th args into helper commit e4a8fc054340f4df761f6a73335f8fdc0b7ac4fd Author: Tony Lindgren Date: Wed Jun 10 15:31:54 2020 -0700 Revert "bus: ti-sysc: Increase max softreset wait" This reverts commit 636338d7968e47c7f2e0b772a2a825ad932883fb. This patch is not a proper fixes the i2c2 timeouts are still happening in some cases. Signed-off-by: Tony Lindgren commit 944021e79e7ec8db9c3edbc6af32276ade4ac0db Author: Tomi Valkeinen Date: Tue Jun 9 13:30:00 2020 +0300 ARM: dts: am437x-epos-evm: remove lcd timings LCD timings now come from panel-simple. Having timings in the DT will cause a WARN. Signed-off-by: Tomi Valkeinen Signed-off-by: Tony Lindgren commit 3991510bf6402b534f158e164569d051bfd81f68 Author: Tomi Valkeinen Date: Tue Jun 9 13:29:59 2020 +0300 ARM: dts: am437x-gp-evm: remove lcd timings LCD timings now come from panel-simple. Having timings in the DT will cause a WARN. Signed-off-by: Tomi Valkeinen Signed-off-by: Tony Lindgren commit 43a562774fceba867e8eebba977d7d42f8a2eac7 Author: Denis Efremov Date: Fri Jun 5 20:37:44 2020 +0300 drm/amd/display: Use kfree() to free rgb_user in calculate_user_regamma_ramp() Use kfree() instead of kvfree() to free rgb_user in calculate_user_regamma_ramp() because the memory is allocated with kcalloc(). Signed-off-by: Denis Efremov Signed-off-by: Alex Deucher commit 81921a828b94ce2816932c19a5ec74d302972833 Author: Denis Efremov Date: Fri Jun 5 20:37:43 2020 +0300 drm/amd/display: Use kvfree() to free coeff in build_regamma() Use kvfree() instead of kfree() to free coeff in build_regamma() because the memory is allocated with kvzalloc(). Fixes: e752058b8671 ("drm/amd/display: Optimize gamma calculations") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov Signed-off-by: Alex Deucher commit 79ca035d2d941839f55f3b8b69f8e81c66946ed8 Merge: 4152d146ee21 058f2e4da79b Author: Linus Torvalds Date: Wed Jun 10 15:00:11 2020 -0700 Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull proc fix from Eric Biederman: "Syzbot found a NULL pointer dereference if kzalloc of s_fs_info fails" * 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: proc: s_fs_info may be NULL when proc_kill_sb is called commit 4152d146ee2169653297e03b9fa2e0f476923959 Merge: 78c24f7beeae b398ace5d2ea Author: Linus Torvalds Date: Wed Jun 10 14:46:54 2020 -0700 Merge branch 'rwonce/rework' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux Pull READ/WRITE_ONCE rework from Will Deacon: "This the READ_ONCE rework I've been working on for a while, which bumps the minimum GCC version and improves code-gen on arm64 when stack protector is enabled" [ Side note: I'm _really_ tempted to raise the minimum gcc version to 4.9, so that we can just say that we require _Generic() support. That would allow us to more cleanly handle a lot of the cases where we depend on very complex macros with 'sizeof' or __builtin_choose_expr() with __builtin_types_compatible_p() etc. This branch has a workaround for sparse not handling _Generic(), either, but that was already fixed in the sparse development branch, so it's really just gcc-4.9 that we'd require. - Linus ] * 'rwonce/rework' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux: compiler_types.h: Use unoptimized __unqual_scalar_typeof for sparse compiler_types.h: Optimize __unqual_scalar_typeof compilation time compiler.h: Enforce that READ_ONCE_NOCHECK() access size is sizeof(long) compiler-types.h: Include naked type in __pick_integer_type() match READ_ONCE: Fix comment describing 2x32-bit atomicity gcov: Remove old GCC 3.4 support arm64: barrier: Use '__unqual_scalar_typeof' for acquire/release macros locking/barriers: Use '__unqual_scalar_typeof' for load-acquire macros READ_ONCE: Drop pointer qualifiers when reading from scalar types READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE() arm64: csum: Disable KASAN for do_csum() fault_inject: Don't rely on "return value" from WRITE_ONCE() net: tls: Avoid assigning 'const' pointer to non-const pointer netfilter: Avoid assigning 'const' pointer to non-const pointer compiler/gcc: Raise minimum GCC version for kernel builds to 4.8 commit 78c24f7beeae295cb6dfb4274568f9bcfa92b316 Author: Andrew Morton Date: Wed Jun 10 14:34:02 2020 -0700 arch/powerpc/mm/pgtable.c: another missed conversion Fixes: e05c7b1f2bc4b7 ("mm: pgtable: add shortcuts for accessing kernel PMD and PTE") Reported-by: kernel test robot Reported-by: Guenter Roeck Cc: Michael Ellerman Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6d62c5b21155acaaaeb24862d62cf15d1dc2d8ba Merge: 6672966d6c85 146f5cdeda15 Author: Linus Torvalds Date: Wed Jun 10 14:12:15 2020 -0700 Merge tag 'docs-5.8-2' of git://git.lwn.net/linux Pull more documentation updates from Jonathan Corbet: "A handful of late-arriving docs fixes, along with a patch changing a lot of HTTP links to HTTPS that had to be yanked and redone before the first pull" * tag 'docs-5.8-2' of git://git.lwn.net/linux: docs/memory-barriers.txt/kokr: smp_mb__{before,after}_atomic(): update Documentation Documentation: devres: add missing entry for devm_platform_get_and_ioremap_resource() Replace HTTP links with HTTPS ones: documentation docs: it_IT: address invalid reference warnings doc: zh_CN: use doc reference to resolve undefined label warning docs: Update the location of the LF NDA program docs: dev-tools: coccinelle: underlines commit 6672966d6c854d5b05a10227fd21e4e0895719f7 Merge: 0c67f6b29715 ede439be684c Author: Linus Torvalds Date: Wed Jun 10 14:09:08 2020 -0700 Merge tag 'acpi-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "Update the ACPICA code in the kernel to upstream revision 20200528 with the following changes: - Remove some dead code from the acpidump utility (Bob Moore) - Add new OperationRegion subtype keyword PlatformRtMechanism to the compiler (Erik Kaneda)" * tag 'acpi-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPICA: Update version to 20200528 ACPICA: iASL: add new OperationRegion subtype keyword PlatformRtMechanism ACPICA: acpidump: Removed dead code from oslinuxtbl.c commit 0c67f6b29715ff888cb967cc98336221a8a23916 Merge: 49f13b0921aa 50dd154ed7b1 Author: Linus Torvalds Date: Wed Jun 10 14:04:39 2020 -0700 Merge tag 'pm-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These are operating performance points (OPP) framework updates mostly, including support for interconnect bandwidth in the OPP core, plus a few cpufreq changes, including boost support in the CPPC cpufreq driver, an ACPI device power management fix and a hibernation code cleanup. Specifics: - Add support for interconnect bandwidth to the OPP core (Georgi Djakov, Saravana Kannan, Sibi Sankar, Viresh Kumar). - Add support for regulator enable/disable to the OPP core (Kamil Konieczny). - Add boost support to the CPPC cpufreq driver (Xiongfeng Wang). - Make the tegra186 cpufreq driver set the CPUFREQ_NEED_INITIAL_FREQ_CHECK flag (Mian Yousaf Kaukab). - Prevent the ACPI power management from using power resources with devices where the list of power resources for power state D0 (full power) is missing (Rafael Wysocki). - Annotate a hibernation-related function with __init (Christophe JAILLET)" * tag 'pm-5.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PM: Avoid using power resources if there are none for D0 cpufreq: CPPC: add SW BOOST support cpufreq: change '.set_boost' to act on one policy PM: hibernate: Add __init annotation to swsusp_header_init() opp: Don't parse icc paths unnecessarily opp: Remove bandwidth votes when target_freq is zero opp: core: add regulators enable and disable opp: Reorder the code for !target_freq case opp: Expose bandwidth information via debugfs cpufreq: dt: Add support for interconnect bandwidth scaling opp: Update the bandwidth on OPP frequency changes opp: Add sanity checks in _read_opp_key() opp: Add support for parsing interconnect bandwidth cpufreq: tegra186: add CPUFREQ_NEED_INITIAL_FREQ_CHECK flag OPP: Add helpers for reading the binding properties dt-bindings: opp: Introduce opp-peak-kBps and opp-avg-kBps bindings commit 49f13b0921aaef0d5519358fd9fcc237c1c9124a Merge: 09102704c674 751ad34fbad7 Author: Linus Torvalds Date: Wed Jun 10 13:51:47 2020 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a new driver for the Azoteq IQS269A capacitive touch controller - a new driver for the Cypress CY8CTMA140 touchscreen - updates to Elan and ft5x06 touchscreen drivers - assorted driver fixes - msm-vibrator has been removed as we have a more generic solution * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (28 commits) Input: adi - work around module name confict Input: iqs269a - add missing I2C dependency Input: elants - refactor elants_i2c_execute_command() Input: elants - override touchscreen info with DT properties Input: elants - remove unused axes Input: add support for Azoteq IQS269A dt-bindings: input: Add bindings for Azoteq IQS269A Input: imx_sc_key - use devm_add_action_or_reset() to handle all cleanups Input: remove msm-vibrator driver dt-bindings: Input: remove msm-vibrator Input: elants_i2c - provide an attribute to show calibration count Input: introduce input_mt_report_slot_inactive() dt-bindings: input: touchscreen: elants_i2c: convert to YAML Input: add driver for the Cypress CY8CTMA140 touchscreen dt-bindings: touchscreen: Add CY8CTMA140 bindings Input: edt-ft5x06 - prefer asynchronous probe Input: edt-ft5x06 - improve power management operations Input: edt-ft5x06 - move parameter restore into helper Input: edt-ft5x06 - fix get_default register write access Input: atkbd - receive and use physcode->keycode mapping from FW ... commit 09102704c67457c6cdea6c0394c34843484a852c Merge: 84fc461db99b 044e4b092230 Author: Linus Torvalds Date: Wed Jun 10 13:42:09 2020 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: - virtio-mem: paravirtualized memory hotplug - support doorbell mapping for vdpa - config interrupt support in ifc - fixes all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (40 commits) vhost/test: fix up after API change virtio_mem: convert device block size into 64bit virtio-mem: drop unnecessary initialization ifcvf: implement config interrupt in IFCVF vhost: replace -1 with VHOST_FILE_UNBIND in ioctls vhost_vdpa: Support config interrupt in vdpa ifcvf: ignore continuous setting same status value virtio-mem: Don't rely on implicit compiler padding for requests virtio-mem: Try to unplug the complete online memory block first virtio-mem: Use -ETXTBSY as error code if the device is busy virtio-mem: Unplug subblocks right-to-left virtio-mem: Drop manual check for already present memory virtio-mem: Add parent resource for all added "System RAM" virtio-mem: Better retry handling virtio-mem: Offline and remove completely unplugged memory blocks mm/memory_hotplug: Introduce offline_and_remove_memory() virtio-mem: Allow to offline partially unplugged memory blocks mm: Allow to offline unmovable PageOffline() pages via MEM_GOING_OFFLINE virtio-mem: Paravirtualized memory hotunplug part 2 virtio-mem: Paravirtualized memory hotunplug part 1 ... commit 5969856ae8ce29c9d523a1a6145cbd9e87f7046c Author: Paolo Abeni Date: Wed Jun 10 10:47:41 2020 +0200 mptcp: fix races between shutdown and recvmsg The msk sk_shutdown flag is set by a workqueue, possibly introducing some delay in user-space notification. If the last subflow carries some data with the fin packet, the user space can wake-up before RCV_SHUTDOWN is set. If it executes unblocking recvmsg(), it may return with an error instead of eof. Address the issue explicitly checking for eof in recvmsg(), when no data is found. Fixes: 59832e246515 ("mptcp: subflow: check parent mptcp socket on subflow state change") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit 84fc461db99b2dc19e019c0a97725a3653687981 Merge: 0e083da7c8a2 f6e8c474390b Author: Linus Torvalds Date: Wed Jun 10 13:25:40 2020 -0700 Merge tag 'for-linus-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - Use fdatasync() in ubd - Add a generic "fd" vector transport - Minor cleanups and fixes * tag 'for-linus-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: virtio: Replace zero-length array with flexible-array um: Use fdatasync() when mapping the UBD FSYNC command um: Do not evaluate compiler's library path when cleaning um: Neaten vu_err macro definition um: Add a generic "fd" vector transport um: Add include: memset() and memcpy() are in commit 0e083da7c8a26bc2674d7155bb5a0676b7dbc8ba Merge: 6f51ab9440d1 4b68bf9a69d2 Author: Linus Torvalds Date: Wed Jun 10 13:24:40 2020 -0700 Merge tag 'for-linus-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull UBI update from Richard Weinberger: "This contains a single change for UBI: - Select fastmap anchor PEBs considering wear level rules" * tag 'for-linus-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubi: Select fastmap anchor PEBs considering wear level rules commit 50cb8769f2c1c657a470bda192b79ff679d0ecfc Author: David Ahern Date: Tue Jun 9 17:27:28 2020 -0600 vxlan: Remove access to nexthop group struct vxlan driver should be using helpers to access nexthop struct internals. Remove open check if whether nexthop is multipath in favor of the existing nexthop_is_multipath helper. Add a new helper, nexthop_has_v4, to cover the need to check has_v4 in a group. Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Cc: Roopa Prabhu Signed-off-by: David Ahern Signed-off-by: David S. Miller commit ce9ac056d9cd15630dfca352ff6d3051ba3ba8f6 Author: David Ahern Date: Mon Jun 8 20:54:43 2020 -0600 nexthop: Fix fdb labeling for groups fdb nexthops are marked with a flag. For standalone nexthops, a flag was added to the nh_info struct. For groups that flag was added to struct nexthop when it should have been added to the group information. Fix by removing the flag from the nexthop struct and adding a flag to nh_group that mirrors nh_info and is really only a caching of the individual types. Add a helper, nexthop_is_fdb, for use by the vxlan code and fixup the internal code to use the flag from either nh_info or nh_group. v2 - propagate fdb_nh in remove_nh_grp_entry Fixes: 38428d68719c ("nexthop: support for fdb ecmp nexthops") Cc: Roopa Prabhu Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 6f51ab9440d131ae424cce27e3170746219f5142 Merge: 6f630784cc0d 5788ccf3c84f Author: Linus Torvalds Date: Wed Jun 10 13:15:17 2020 -0700 Merge tag 'mtd/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD updates from Richard Weinberger: "MTD core changes: - partition parser: Support MTD names containing one or more colons. - mtdblock: clear cache_state to avoid writing to bad blocks repeatedly. Raw NAND core changes: - Stop using nand_release(), patched all drivers. - Give more information about the ECC weakness when not matching the chip's requirement. - MAINTAINERS updates. - Support emulated SLC mode on MLC NANDs. - Support "constrained" controllers, adapt the core and ONFI/JEDEC table parsing and Micron's code. - Take check_only into account. - Add an invalid ECC mode to discriminate with valid ones. - Return an enum from of_get_nand_ecc_algo(). - Drop OOB_FIRST placement scheme. - Introduce nand_extract_bits(). - Ensure a consistent bitflips numbering. - BCH lib: - Allow easy bit swapping. - Rework a little bit the exported function names. - Fix nand_gpio_waitrdy(). - Propage CS selection to sub operations. - Add a NAND_NO_BBM_QUIRK flag. - Give the possibility to verify a read operation is supported. - Add a helper to check supported operations. - Avoid indirect access to ->data_buf(). - Rename the use_bufpoi variables. - Fix comments about the use of bufpoi. - Rename a NAND chip option. - Reorder the nand_chip->options flags. - Translate obscure bitfields into readable macros. - Timings: - Fix default values. - Add mode information to the timings structure. Raw NAND controller driver changes: - Fixed many error paths. - Arasan - New driver - Au1550nd: - Various cleanups - Migration to ->exec_op() - brcmnand: - Misc cleanup. - Support v2.1-v2.2 controllers. - Remove unused including . - Correctly verify erased pages. - Fix Hamming OOB layout. - Cadence - Make cadence_nand_attach_chip static. - Cafe: - Set the NAND_NO_BBM_QUIRK flag - cmx270: - Remove this controller driver. - cs553x: - Misc cleanup - Migration to ->exec_op() - Davinci: - Misc cleanup. - Migration to ->exec_op() - Denali: - Add more delays before latching incoming data - Diskonchip: - Misc cleanup - Migration to ->exec_op() - Fsmc: - Change to non-atomic bit operations. - GPMI: - Use nand_extract_bits() - Fix runtime PM imbalance. - Ingenic: - Migration to exec_op() - Fix the RB gpio active-high property on qi, lb60 - Make qi_lb60_ooblayout_ops static. - Marvell: - Misc cleanup and small fixes - Nandsim: - Fix the error paths, driver wide. - Omap_elm: - Fix runtime PM imbalance. - STM32_FMC2: - Misc cleanups (error cases, comments, timeout valus, cosmetic changes). SPI NOR core changes: - Add, update support and fix few flashes. - Prepare BFPT parsing for JESD216 rev D. - Kernel doc fixes. CFI changes: - Support the absence of protection registers for Intel CFI flashes. - Replace zero-length array with flexible-arrays" * tag 'mtd/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (208 commits) mtd: clear cache_state to avoid writing to bad blocks repeatedly mtd: parser: cmdline: Support MTD names containing one or more colons mtd: physmap_of_gemini: remove defined but not used symbol 'syscon_match' mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones mtd: rawnand: Return an enum from of_get_nand_ecc_algo() mtd: rawnand: Drop OOB_FIRST placement scheme mtd: rawnand: Avoid a typedef mtd: Fix typo in mtd_ooblayout_set_databytes() description mtd: rawnand: Stop using nand_release() mtd: rawnand: nandsim: Reorganize ns_cleanup_module() mtd: rawnand: nandsim: Rename a label in ns_init_module() mtd: rawnand: nandsim: Manage lists on error in ns_init_module() mtd: rawnand: nandsim: Fix the label pointing on nand_cleanup() mtd: rawnand: nandsim: Free erase_block_wear on error mtd: rawnand: nandsim: Use an additional label when freeing the nandsim object mtd: rawnand: nandsim: Stop using nand_release() mtd: rawnand: nandsim: Free the partition names in ns_free() mtd: rawnand: nandsim: Free the allocated device on error in ns_init() mtd: rawnand: nandsim: Free partition names on error in ns_init() mtd: rawnand: nandsim: Fix the two ns_alloc_device() error paths ... commit 058f2e4da79b23afb56ce3d03d907d6cdd36f2b8 Author: Alexey Gladkov Date: Wed Jun 10 20:35:49 2020 +0200 proc: s_fs_info may be NULL when proc_kill_sb is called syzbot found that proc_fill_super() fails before filling up sb->s_fs_info, deactivate_locked_super() will be called and sb->s_fs_info will be NULL. The proc_kill_sb() does not expect fs_info to be NULL which is wrong. Link: https://lore.kernel.org/lkml/0000000000002d7ca605a7b8b1c5@google.com Reported-by: syzbot+4abac52934a48af5ff19@syzkaller.appspotmail.com Fixes: fa10fed30f25 ("proc: allow to mount many instances of proc in one pid namespace") Signed-off-by: Alexey Gladkov Signed-off-by: Eric W. Biederman commit 6f630784cc0d92fb58ea326e2bc01aa056279ecb Merge: 3a2a87517421 9ac1eafa885a Author: Linus Torvalds Date: Wed Jun 10 11:42:19 2020 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "This time around we have four lines of diff in the core framework, removing a function that isn't used anymore. Otherwise the main new thing for the common clk framework is that it is selectable in the Kconfig language now. Hopefully this will let clk drivers and clk consumers be testable on more than the architectures that support the clk framework. The goal is to introduce some Kunit tests for the framework. Outside of the core framework we have the usual set of various driver updates and non-critical fixes. The dirstat shows that the new Baikal-T1 driver is the largest addition this time around in terms of lines of code. After that the x86 (Intel), Qualcomm, and Mediatek drivers introduce many lines to support new or upcoming SoCs. After that the dirstat shows the usual suspects working on their SoC support by fixing minor bugs, correcting data and converting some of their DT bindings to YAML. Core: - Allow the COMMON_CLK config to be selectable New Drivers: - Clk driver for Baikal-T1 SoCs - Mediatek MT6765 clock support - Support for Intel Agilex clks - Add support for X1830 and X1000 Ingenic SoC clk controllers - Add support for the new Renesas RZ/G1H (R8A7742) SoC - Add support for Qualcomm's MSM8939 Generic Clock Controller Updates: - Support IDT VersaClock 5P49V5925 - Bunch of updates for HSDK clock generation unit (CGU) driver - Start making audio and GPU clks work on Marvell MMP2/MMP3 SoCs - Add some GPU, NPU, and UFS clks to Qualcomm SM8150 driver - Enable supply regulators for GPU gdscs on Qualcomm SoCs - Add support for Si5342, Si5344 and Si5345 chips - Support custom flags in Xilinx zynq firmware - Various small fixes to the Xilinx clk driver - A single minor rounding fix for the legacy Allwinner clock support - A few patches from Abel Vesa as preparation of adding audiomix clock support on i.MX - A couple of cleanups from Anson Huang for i.MX clk-sscg-pll and clk-pllv3 drivers - Drop dependency on ARM64 for i.MX8M clock driver, to support aarch32 mode on aarch64 hardware - A series from Peng Fan to improve i.MX8M clock drivers, using composite clock for core and bus clk slice - Set a better parent clock for flexcan on i.MX6UL to support CiA102 defined bit rates - A couple changes for EMC frequency scaling on Tegra210 - Support for CPU frequency scaling on Tegra20/Tegra30 - New clk gate for CSI test pattern generator on Tegra210 - Regression fixes for Samsung exynos542x and exynos5433 SoCs - Use of fallthrough; attribute for Samsung s3c24xx - Updates and fixup HDMI and video clocks on Meson8b - Fixup reset polarity on Meson8b - Fix GPU glitch free mux switch on Meson gx and g12 - A minor fix for the currently unused suspend/resume handling on Renesas RZ/A1 and RZ/A2 - Two more conversions of Renesas DT bindings to json-schema - Add support for the USB 2.0 clock selector on Renesas R-Car M3-W+" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (155 commits) clk: mediatek: Remove ifr{0,1}_cfg_regs structures clk: baikal-t1: remove redundant assignment to variable 'divider' clk: baikal-t1: fix spelling mistake "Uncompatible" -> "Incompatible" dt-bindings: clock: Add a missing include to MMP Audio Clock binding dt: Add bindings for IDT VersaClock 5P49V5925 clk: vc5: Add support for IDT VersaClock 5P49V6965 clk: Add Baikal-T1 CCU Dividers driver clk: Add Baikal-T1 CCU PLLs driver dt-bindings: clk: Add Baikal-T1 CCU Dividers binding dt-bindings: clk: Add Baikal-T1 CCU PLLs binding clk: mediatek: assign the initial value to clk_init_data of mtk_mux clk: mediatek: Add MT6765 clock support clk: mediatek: add mt6765 clock IDs dt-bindings: clock: mediatek: document clk bindings vcodecsys for Mediatek MT6765 SoC dt-bindings: clock: mediatek: document clk bindings mipi0a for Mediatek MT6765 SoC dt-bindings: clock: mediatek: document clk bindings for Mediatek MT6765 SoC CLK: HSDK: CGU: add support for 148.5MHz clock CLK: HSDK: CGU: support PLL bypassing CLK: HSDK: CGU: check if PLL is bypassed first clk: clk-si5341: Add support for the Si5345 series ... commit 3a2a8751742133a7bbc49b9d1bcbd52e212edff6 Merge: c90e7945e3a3 152204dbdcee Author: Linus Torvalds Date: Wed Jun 10 11:28:35 2020 -0700 Merge tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "This time there are lots of changes. Quite a few changes to the core, lots of driver changes and one change to kobject core (with Ack from Greg). Summary: kobject: - Increase number of allowed uevent variables power-supply core: - Add power-supply type in uevent - Cleanup property handling in core - Make property and usb_type pointers const - Convert core power-supply DT binding to YAML - Cleanup HWMON code - Add new health status "calibration required" - Add new properties for manufacture date and capacity error margin battery drivers: - new cw2015 battery driver used by pine64 Pinebook Pro laptop - axp22: blacklist on Meegopad T02 - sc27xx: support current/voltage reading - max17042: support time-to-empty reading - simple-battery: add more battery parameters - bq27xxx: convert DT binding document to YAML - sbs-battery: add TI BQ20Z65 support, fix technology property, convert DT binding to YAML, add option to disable charger broadcasts, add new properties: manufacture date, capacity error margin, average current, charge current and voltage and support calibration required health status - misc fixes charger drivers: - bq25890: cleanup, implement charge type, precharge current and input current limiting properties - bd70528: use new linear range helper library - bd99954: new charger driver - mp2629: new charger driver - misc fixes reboot drivers: - oxnas-restart: introduce new driver - syscon-reboot: convert DT binding to YAML, add parent syscon device support - misc fixes" * tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (85 commits) power: supply: cw2015: Attach OF ID table to the driver power: reset: gpio-poweroff: add missing '\n' in dev_err() Revert "power: supply: sbs-battery: simplify read_read_string_data" Revert "power: supply: sbs-battery: add PEC support" dt-bindings: power: sbs-battery: Convert to yaml power: supply: sbs-battery: constify power-supply property array power: supply: sbs-battery: switch to i2c's probe_new power: supply: sbs-battery: switch from of_property_* to device_property_* power: supply: sbs-battery: add ability to disable charger broadcasts power: supply: sbs-battery: fix idle battery status power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support power: supply: sbs-battery: add MANUFACTURE_DATE support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support power: supply: sbs-battery: add PEC support power: supply: sbs-battery: simplify read_read_string_data power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support power: supply: sbs-battery: Add TI BQ20Z65 support power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED ... commit ef9d965bc8b6fce5bcc0ae76a4a5b3ed91ee81eb Author: Christoph Hellwig Date: Tue Jun 9 19:08:19 2020 +0200 sysctl: reject gigantic reads/write to sysctl files Instead of triggering a WARN_ON deep down in the page allocator just give up early on allocations that are way larger than the usual sysctl values. Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler") Reported-by: Vegard Nossum Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 8c46fa96822c28ca81036e26c2d963f1fac9a961 Author: Christoph Hellwig Date: Tue Jun 9 19:08:18 2020 +0200 cdrom: fix an incorrect __user annotation on cdrom_sysctl_info No user pointers for sysctls anymore. Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler") Reported-by: build test robot Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 15c99816ed9396c548eed2e84f30c14caccad1f4 Merge: 0370964dd3ff 304e2989c93e Author: Marc Zyngier Date: Wed Jun 10 19:09:26 2020 +0100 Merge branch 'kvm-arm64/ptrauth-fixes' into kvmarm-master/next Signed-off-by: Marc Zyngier commit 304e2989c93e941fa55b38c59c975d4acfb6e4a2 Author: Marc Zyngier Date: Wed Jun 10 16:27:46 2020 +0100 KVM: arm64: Move hyp_symbol_addr() to kvm_asm.h Recent refactoring of the arm64 code make it awkward to have hyp_symbol_addr() in kvm_mmu.h. Instead, move it next to its main user, which is __hyp_this_cpu_ptr(). Signed-off-by: Marc Zyngier commit c90e7945e3a39c50c07e63a5892e65ecfde374a9 Merge: 77d22a4388d3 be4cf718cd99 Author: Linus Torvalds Date: Wed Jun 10 11:03:04 2020 -0700 Merge tag 'dmaengine-5.8-rc1' of git://git.infradead.org/users/vkoul/slave-dma Pull dmaengine updates from Vinod Koul: "A fairly small dmaengine update which includes mostly driver updates (dmatest, dw-edma, ioat, mmp-tdma and k3-udma) along with Renesas binding update to json-schema" * tag 'dmaengine-5.8-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (39 commits) dmaengine: imx-sdma: initialize all script addresses dmaengine: ti: k3-udma: Use proper return code in alloc_chan_resources dmaengine: ti: k3-udma: Remove udma_chan.in_ring_cnt dmaengine: ti: k3-udma: Add missing dma_sync call for rx flush descriptor dmaengine: at_xdmac: Replace zero-length array with flexible-array dmaengine: at_hdmac: Replace zero-length array with flexible-array dmaengine: qcom: bam_dma: Replace zero-length array with flexible-array dmaengine: ti: k3-udma: Use PTR_ERR_OR_ZERO() to simplify code dmaengine: moxart-dma: Drop pointless static qualifier in moxart_probe() dmaengine: sf-pdma: Simplify the error handling path in 'sf_pdma_probe()' dmaengine: qcom_hidma: use true,false for bool variable dmaengine: dw-edma: support local dma device transfer semantics dmaengine: Fix doc strings to satisfy validation script dmaengine: Include dmaengine.h into dmaengine.c dmaengine: dmatest: Describe members of struct dmatest_info dmaengine: dmatest: Describe members of struct dmatest_params dmaengine: dmatest: Allow negative timeout value to specify infinite wait Revert "dmaengine: dmatest: timeout value of -1 should specify infinite wait" dmaengine: stm32-dma: direct mode support through device tree dt-bindings: dma: add direct mode support through device tree in stm32-dma ... commit 77d22a4388d33a76180cad69a4309d6636d30855 Author: Geert Uytterhoeven Date: Mon Jun 1 12:00:49 2020 +0200 Documentation/CodingStyle: Fix duplicate "are" typo The improved paragraph about line lengths contains a sentence with a duplicate word: there is one "are" at the end of a line, followed by a second one at the beginning of the next line. Drop the first one, as that one is part of the longest line. Fixes: bdc48fa11e46f867 ("checkpatch/coding-style: deprecate 80-column warning") Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds commit f7579007f3421bce25e05f54c462fe717bf581da Author: Andrew Morton Date: Tue Jun 9 18:46:16 2020 -0700 arch/sparc/mm/srmmu.c: fix build "mm: consolidate pte_index() and pte_offset_*() definitions" was supposed to remove arch/sparc/mm/srmmu.c:pte_offset_kernel(). Fixes: 974b9b2c68f3d35 ("mm: consolidate pte_index() and pte_offset_*() definitions") Reported-by: kernel test robot Cc: Mike Rapoport Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6c2d2176a85eb2fd65eb7cfe94b3bad0acce99c0 Author: Pablo Neira Ayuso Date: Wed Jun 10 19:28:53 2020 +0200 netfilter: ctnetlink: memleak in filter initialization error path Release the filter object in case of error. Fixes: cb8aa9a3affb ("netfilter: ctnetlink: add kernel side filtering for dump") Reported-by: syzbot+38b8b548a851a01793c5@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso commit 7866c177a03b18be3d83175014c643546e5b53c6 Author: Steve French Date: Tue Jun 9 19:50:40 2020 -0500 smb3: fix typo in mount options displayed in /proc/mounts Missing the final 's' in "max_channels" mount option when displayed in /proc/mounts (or by mount command) CC: Stable Signed-off-by: Steve French Reviewed-by: Shyam Prasad N commit 672cf6df9b8a3a6d70a6a5c30397f76fa40d3178 Author: Joerg Roedel Date: Tue Jun 9 15:03:03 2020 +0200 iommu/vt-d: Move Intel IOMMU driver into subdirectory Move all files related to the Intel IOMMU driver into its own subdirectory. Signed-off-by: Joerg Roedel Reviewed-by: Jerry Snitselaar Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/20200609130303.26974-3-joro@8bytes.org commit ad8694bac410e5d72ad610dfb146f58bf2fe0365 Author: Joerg Roedel Date: Tue Jun 9 15:03:02 2020 +0200 iommu/amd: Move AMD IOMMU driver into subdirectory Move all files related to the AMD IOMMU driver into its own subdirectory. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20200609130303.26974-2-joro@8bytes.org commit cb301414763e07e4cef58c9d5ef3750d1f9539bc Author: Tali Perry Date: Wed Jun 10 10:24:51 2020 +0300 MAINTAINERS: npcm7xx: Add maintainer for Nuvoton NPCM BMC Add maintainer for Nuvoton NPCM BMC I2C controller driver. Signed-off-by: Tali Perry Signed-off-by: Wolfram Sang commit ede439be684c54f01147e1f65cc565c6baaca1a4 Merge: 118d6e98293b 34a09bffd998 Author: Rafael J. Wysocki Date: Wed Jun 10 17:27:28 2020 +0200 Merge branch 'acpica' * acpica: ACPICA: Update version to 20200528 ACPICA: iASL: add new OperationRegion subtype keyword PlatformRtMechanism ACPICA: acpidump: Removed dead code from oslinuxtbl.c commit 50dd154ed7b17a8b3a1983fc32a8e41d4cc4211a Merge: 4c277e2f8596 54e74df5d76d 956ad9d98b73 Author: Rafael J. Wysocki Date: Wed Jun 10 17:10:40 2020 +0200 Merge branches 'pm-cpufreq' and 'pm-acpi' * pm-cpufreq: cpufreq: CPPC: add SW BOOST support cpufreq: change '.set_boost' to act on one policy cpufreq: tegra186: add CPUFREQ_NEED_INITIAL_FREQ_CHECK flag * pm-acpi: ACPI: PM: Avoid using power resources if there are none for D0 commit 4c277e2f859694291245701f054962e05c1ca16d Merge: afd8d7c7f936 4573e9ef5153 Author: Rafael J. Wysocki Date: Wed Jun 10 17:10:30 2020 +0200 Merge branch 'pm-opp' * pm-opp: opp: Don't parse icc paths unnecessarily opp: Remove bandwidth votes when target_freq is zero opp: core: add regulators enable and disable opp: Reorder the code for !target_freq case opp: Expose bandwidth information via debugfs cpufreq: dt: Add support for interconnect bandwidth scaling opp: Update the bandwidth on OPP frequency changes opp: Add sanity checks in _read_opp_key() opp: Add support for parsing interconnect bandwidth interconnect: Remove unused module exit code from core interconnect: Disallow interconnect core to be built as a module interconnect: Add of_icc_get_by_index() helper function OPP: Add helpers for reading the binding properties dt-bindings: opp: Introduce opp-peak-kBps and opp-avg-kBps bindings commit 0370964dd3ff7d3d406f292cb443a927952cbd05 Author: Marc Zyngier Date: Tue Jun 9 08:50:29 2020 +0100 KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception On a VHE system, the EL1 state is left in the CPU most of the time, and only syncronized back to memory when vcpu_put() is called (most of the time on preemption). Which means that when injecting an exception, we'd better have a way to either: (1) write directly to the EL1 sysregs (2) synchronize the state back to memory, and do the changes there For an AArch64, we already do (1), so we are safe. Unfortunately, doing the same thing for AArch32 would be pretty invasive. Instead, we can easily implement (2) by calling the put/load architectural backends, and keep preemption disabled. We can then reload the state back into EL1. Cc: stable@vger.kernel.org Reported-by: James Morse Signed-off-by: Marc Zyngier commit 3204be4109ad681523e3461ce64454c79278450a Author: Marc Zyngier Date: Tue Jun 9 08:40:35 2020 +0100 KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts AArch32 CP1x registers are overlayed on their AArch64 counterparts in the vcpu struct. This leads to an interesting problem as they are stored in their CPU-local format, and thus a CP1x register doesn't "hit" the lower 32bit portion of the AArch64 register on a BE host. To workaround this unfortunate situation, introduce a bias trick in the vcpu_cp1x() accessors which picks the correct half of the 64bit register. Cc: stable@vger.kernel.org Reported-by: James Morse Tested-by: James Morse Acked-by: James Morse Signed-off-by: Marc Zyngier commit 85d0f9ad8212d655ce71e9034d95eacce63538f3 Author: Ian Rogers Date: Tue Jun 9 16:43:43 2020 -0700 perf pmu: Remove unused declaration This avoids multiple declarations if the flex header is included. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200609234344.3795-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a4f55d927d33accd6eb535ce0db031e2df47714a Merge: 951e2736f4b1 44ce45f866c1 Author: Takashi Iwai Date: Wed Jun 10 15:40:49 2020 +0200 Merge tag 'asoc-fix-v5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.8 A small pile of fixes that came in during the merge window, the DPCM fixes from Pierre are the most notable thing here. commit 42c76c9848e13dbe0538d7ae0147a269dfa859cb Author: Christophe JAILLET Date: Sat May 30 10:16:22 2020 +0200 scsi: acornscsi: Fix an error handling path in acornscsi_probe() 'ret' is known to be 0 at this point. Explicitly return -ENOMEM if one of the 'ecardm_iomap()' calls fail. Link: https://lore.kernel.org/r/20200530081622.577888-1-christophe.jaillet@wanadoo.fr Fixes: e95a1b656a98 ("[ARM] rpc: acornscsi: update to new style ecard driver") Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 47f6bc4ce1ff70d7ba0924c2f1c218c96cd585fb Author: Brett Mastbergen Date: Tue Jun 9 17:35:06 2020 -0400 tools, bpf: Do not force gcc as CC This allows transparent cross-compilation with CROSS_COMPILE by relying on 7ed1c1901fe5 ("tools: fix cross-compile var clobbering"). Same change was applied to tools/bpf/bpftool/Makefile in 9e88b9312acb ("tools: bpftool: do not force gcc as CC"). Signed-off-by: Brett Mastbergen Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200609213506.3299-1-brett.mastbergen@gmail.com commit 32022fd97ed34f6812802bf1288db27c313576f4 Author: Andrii Nakryiko Date: Tue Jun 9 22:23:35 2020 -0700 libbpf: Handle GCC noreturn-turned-volatile quirk Handle a GCC quirk of emitting extra volatile modifier in DWARF (and subsequently preserved in BTF by pahole) for function pointers marked as __attribute__((noreturn)). This was the way to mark such functions before GCC 2.5 added noreturn attribute. Drop such func_proto modifiers, similarly to how it's done for array (also to handle GCC quirk/bug). Such volatile attribute is emitted by GCC only, so existing selftests can't express such test. Simple repro is like this (compiled with GCC + BTF generated by pahole): struct my_struct { void __attribute__((noreturn)) (*fn)(int); }; struct my_struct a; Without this fix, output will be: struct my_struct { voidvolatile (*fn)(int); }; With the fix: struct my_struct { void (*fn)(int); }; Fixes: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion") Reported-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Tested-by: Jean-Philippe Brucker Link: https://lore.kernel.org/bpf/20200610052335.2862559-1-andriin@fb.com commit a194c33f45f83068ef13bf1d16e26d4ca3ecc098 Author: Nick Desaulniers Date: Mon Jun 8 13:38:17 2020 -0700 arm64: acpi: fix UBSAN warning Will reported a UBSAN warning: UBSAN: null-ptr-deref in arch/arm64/kernel/smp.c:596:6 member access within null pointer of type 'struct acpi_madt_generic_interrupt' CPU: 0 PID: 0 Comm: swapper Not tainted 5.7.0-rc6-00124-g96bc42ff0a82 #1 Call trace: dump_backtrace+0x0/0x384 show_stack+0x28/0x38 dump_stack+0xec/0x174 handle_null_ptr_deref+0x134/0x174 __ubsan_handle_type_mismatch_v1+0x84/0xa4 acpi_parse_gic_cpu_interface+0x60/0xe8 acpi_parse_entries_array+0x288/0x498 acpi_table_parse_entries_array+0x178/0x1b4 acpi_table_parse_madt+0xa4/0x110 acpi_parse_and_init_cpus+0x38/0x100 smp_init_cpus+0x74/0x258 setup_arch+0x350/0x3ec start_kernel+0x98/0x6f4 This is from the use of the ACPI_OFFSET in arch/arm64/include/asm/acpi.h. Replace its use with offsetof from include/linux/stddef.h which should implement the same logic using __builtin_offsetof, so that UBSAN wont warn. Reported-by: Will Deacon Suggested-by: Ard Biesheuvel Signed-off-by: Nick Desaulniers Reviewed-by: Jeremy Linton Acked-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/20200521100952.GA5360@willie-the-truck/ Link: https://lore.kernel.org/r/20200608203818.189423-1-ndesaulniers@google.com Signed-off-by: Will Deacon commit 625412c210fb6423e40cb22de7d14fc3bb9d9e79 Author: Nick Desaulniers Date: Mon Jun 8 13:57:08 2020 -0700 arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO Allow the compat vdso (32b) to be compiled as either THUMB2 (default) or ARM. For THUMB2, the register r7 is reserved for the frame pointer, but code in arch/arm64/include/asm/vdso/compat_gettimeofday.h uses r7. Explicitly set -fomit-frame-pointer, since unwinding through interworked THUMB2 and ARM is unreliable anyways. See also how CONFIG_UNWINDER_FRAME_POINTER cannot be selected for CONFIG_THUMB2_KERNEL for ARCH=arm. This also helps toolchains that differ in their implicit value if the choice of -f{no-}omit-frame-pointer is left unspecified, to not error on the use of r7. 2019 Q4 ARM AAPCS seeks to standardize the use of r11 as the reserved frame pointer register, but no production compiler that can compile the Linux kernel currently implements this. We're actively discussing such a transition with ARM toolchain developers currently. Reported-by: Luis Lozano Signed-off-by: Nick Desaulniers Tested-by: Manoj Gupta Acked-by: Catalin Marinas Cc: Stephen Boyd Cc: Robin Murphy Cc: Dave Martin Link: https://static.docs.arm.com/ihi0042/i/aapcs32.pdf Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1084372 Link: https://lore.kernel.org/r/20200608205711.109418-1-ndesaulniers@google.com Signed-off-by: Will Deacon commit a575357b6435c6dd988b8194c59eec83f6e5d5af Author: Alexander Stein Date: Tue Jun 9 18:55:27 2020 +0200 spi: dt-bindings: amlogic, meson-gx-spicc: Fix schema for meson-g12a spi@13000: clock-names: Additional items are not allowed ('pclk' was unexpected) spi@13000: clock-names: ['core', 'pclk'] is too long spi@13000: clocks: [[2, 23], [2, 258]] is too long spi@15000: clock-names: Additional items are not allowed ('pclk' was unexpected) spi@15000: clock-names: ['core', 'pclk'] is too long spi@15000: clocks: [[2, 29], [2, 261]] is too long Conditional schema properties don't overwrite others. Instead of restrictions have to be validated. So general clock amount is 1-2 and depending on the actual device type limit the mount to 1 or 2. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20200609165527.55183-1-alexander.stein@mailbox.org Signed-off-by: Mark Brown commit 54e1e06bcf1cf6e7ac3f86daa5f7454add24b494 Author: Jernej Skrabec Date: Mon Apr 13 11:54:57 2020 +0200 drm/sun4i: hdmi ddc clk: Fix size of m divider m divider in DDC clock register is 4 bits wide. Fix that. Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support") Signed-off-by: Jernej Skrabec Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20200413095457.1176754-1-jernej.skrabec@siol.net commit 05589dde649cd954a122b0ebb2cbe4ade8a80e98 Author: Zong Li Date: Mon Jun 1 15:10:58 2020 +0800 riscv: fix build warning of missing prototypes Add the missing header in file, it was lost in original implementation. The warning message as follows: - no previous prototype for 'patch_text_nosync' [-Wmissing-prototypes] - no previous prototype for 'patch_text' [-Wmissing-prototypes] Changed in v2: - Correct the typo of commit message. Signed-off-by: Zong Li Reported-by: kbuild test robot Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 4e0f9e3a6104261f25b16fcab02fc96f5666ba11 Author: Anup Patel Date: Mon Jun 1 10:36:56 2020 +0530 RISC-V: Don't mark init section as non-executable The head text section (i.e. _start, secondary_start_sbi, etc) and the init section fall under same page table level-1 mapping. Currently, the runtime CPU hotplug is broken because we are marking init section as non-executable which in-turn marks head text section as non-executable. Further investigating other architectures, it seems marking the init section as non-executable is redundant because the init section pages are anyway poisoned and freed. To fix broken runtime CPU hotplug, we simply remove the code marking the init section as non-executable. Fixes: d27c3c90817e ("riscv: add STRICT_KERNEL_RWX support") Cc: stable@vger.kernel.org Signed-off-by: Anup Patel Reviewed-by: Zong Li Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit e71ee06e3ca337758ac95288a917622ff9808fa0 Author: Anup Patel Date: Mon Jun 1 14:45:43 2020 +0530 RISC-V: Force select RISCV_INTC for CONFIG_RISCV The RISC-V per-HART local interrupt controller driver is mandatory for all RISC-V system (with/without MMU) hence we force select it for CONFIG_RISCV (just like RISCV_TIMER). Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 24dc17005ca1d5034d5575f8f94bfd9ad719a22f Author: Anup Patel Date: Mon Jun 1 14:45:42 2020 +0530 RISC-V: Remove do_IRQ() function The only thing do_IRQ() does is call handle_arch_irq function pointer. We can very well call handle_arch_irq function pointer directly from assembly and remove do_IRQ() function hence this patch. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 033a65de7eced89f62d2cd166b1ee2d33af4f1e4 Author: Anup Patel Date: Mon Jun 1 14:45:41 2020 +0530 clocksource/drivers/timer-riscv: Use per-CPU timer interrupt Instead of directly calling RISC-V timer interrupt handler from RISC-V local interrupt conntroller driver, this patch implements RISC-V timer interrupt as a per-CPU interrupt using per-CPU APIs of Linux IRQ subsystem. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Reviewed-by: Marc Zyngier Signed-off-by: Palmer Dabbelt commit 6b7ce8927b5a4d739670d4dc0de301f2abfd9a5c Author: Anup Patel Date: Mon Jun 1 14:45:40 2020 +0530 irqchip: RISC-V per-HART local interrupt controller driver The RISC-V per-HART local interrupt controller manages software interrupts, timer interrupts, external interrupts (which are routed via the platform level interrupt controller) and other per-HART local interrupts. We add a driver for the RISC-V local interrupt controller, which eventually replaces the RISC-V architecture code, allowing for a better split between arch code and drivers. The driver is compliant with RISC-V Hart-Level Interrupt Controller DT bindings located at: Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt Co-developed-by: Palmer Dabbelt Signed-off-by: Anup Patel [Palmer: Cleaned up warnings] Signed-off-by: Palmer Dabbelt commit d175d699df07041befda3779f29bf7126c298730 Author: Anup Patel Date: Mon Jun 1 14:45:39 2020 +0530 RISC-V: Rename and move plic_find_hart_id() to arch directory The plic_find_hart_id() can be useful to other interrupt controller drivers (such as RISC-V local interrupt driver) so we rename this function to riscv_of_parent_hartid() and place it in arch directory along with riscv_of_processor_hartid(). Signed-off-by: Anup Patel Reviewed-by: Atish Patra Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt Reviewed-by: Marc Zyngier Signed-off-by: Palmer Dabbelt commit 5cf998ba8c7bbbfec3e0d6534c9a3f860ab9920e Author: Anup Patel Date: Mon Jun 1 14:45:38 2020 +0530 RISC-V: self-contained IPI handling routine Currently, the IPI handling routine riscv_software_interrupt() does not take any argument and also does not perform irq_enter()/irq_exit(). This patch makes IPI handling routine more self-contained by: 1. Passing "pt_regs *" argument 2. Explicitly doing irq_enter()/irq_exit() 3. Explicitly save/restore "pt_regs *" using set_irq_regs() With above changes, IPI handling routine does not depend on caller function to perform irq_enter()/irq_exit() and save/restore of "pt_regs *" hence its more self-contained. This also enables us to call IPI handling routine from IRQCHIP drivers. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit e8c7ef7d5819cb7ece70ce0d22bce63ca45a29e2 Author: Palmer Dabbelt Date: Thu Jun 4 13:55:14 2020 -0700 RISC-V: Sort select statements alphanumerically Like patch b1b3f49 ("ARM: config: sort select statements alphanumerically") , we sort all our select statements alphanumerically by using the perl script in patch b1b3f49 as above. As suggested by Andrew Morton: This is a pet peeve of mine. Any time there's a long list of items (header file inclusions, kconfig entries, array initalisers, etc) and someone wants to add a new item, they *always* go and stick it at the end of the list. Guys, don't do this. Either put the new item into a randomly-chosen position or, probably better, alphanumerically sort the list. Suggested-by: Zong Li [Palmer: Re-ran the script, as there were predictably a bunch of conflicts] Signed-off-by: Palmer Dabbelt commit f47c24033a1ac3a08e745f50a28c3dd2c5cceda2 Author: Denis Efremov Date: Fri Jun 5 10:59:34 2020 +0300 scsi: storvsc: Remove memset before memory freeing in storvsc_suspend() Remove memset with 0 for stor_device->stor_chns in storvsc_suspend() before the call to kfree() as the memory contains no sensitive information. Link: https://lore.kernel.org/r/20200605075934.8403-1-efremov@linux.com Fixes: 56fb10585934 ("scsi: storvsc: Add the support of hibernation") Suggested-by: Dexuan Cui Reviewed-by: Dexuan Cui Signed-off-by: Denis Efremov Signed-off-by: Martin K. Petersen commit 89dd9ce784fb64e732676b7958a0278750304567 Author: Dan Carpenter Date: Fri Jun 5 14:02:58 2020 +0300 scsi: cxlflash: Remove an unnecessary NULL check The "cmd" pointer was already dereferenced a couple lines earlier so this NULL check is too late. Fortunately, the pointer can never be NULL and the check can be removed. Link: https://lore.kernel.org/r/20200605110258.GD978434@mwanda Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 4919b33b63c8b69d8dcf2b867431d0e3b6dc6d28 Author: Tyrel Datwyler Date: Wed Jun 3 15:36:32 2020 -0500 scsi: ibmvscsi: Don't send host info in adapter info MAD after LPM The adapter info MAD is used to send the client info and receive the host info as a response. A persistent buffer is used and as such the client info is overwritten after the response. During the course of a normal adapter reset the client info is refreshed in the buffer in preparation for sending the adapter info MAD. However, in the special case of LPM where we reenable the CRQ instead of a full CRQ teardown and reset we fail to refresh the client info in the adapter info buffer. As a result, after Live Partition Migration (LPM) we erroneously report the host's info as our own. [mkp: typos] Link: https://lore.kernel.org/r/20200603203632.18426-1-tyreld@linux.ibm.com Signed-off-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen commit 6555781b3fdec5e94e6914511496144241df7dee Author: Simon Arlott Date: Sat May 30 18:59:44 2020 +0100 scsi: sr: Fix sr_probe() missing deallocate of device minor If the cdrom fails to be registered then the device minor should be deallocated. Link: https://lore.kernel.org/r/072dac4b-8402-4de8-36bd-47e7588969cd@0882a8b5-c6c3-11e9-b005-00805fc181fe Signed-off-by: Simon Arlott Signed-off-by: Martin K. Petersen commit a247e07f8dadba5da9f188aaf4f96db0302146d9 Author: Simon Arlott Date: Sat May 30 18:58:25 2020 +0100 scsi: sr: Fix sr_probe() missing mutex_destroy If the device minor cannot be allocated or the cdrom fails to be registered then the mutex should be destroyed. Link: https://lore.kernel.org/r/06e9de38-eeed-1cab-5e08-e889288935b3@0882a8b5-c6c3-11e9-b005-00805fc181fe Fixes: 51a858817dcd ("scsi: sr: get rid of sr global mutex") Signed-off-by: Simon Arlott Signed-off-by: Martin K. Petersen commit 08e9cbe75facfe08b9017eca37c9f1c5a6490b4a Author: John Hubbard Date: Tue May 26 11:27:09 2020 -0700 scsi: st: Convert convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in a "Case 1" scenario (Direct IO), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. Note that this effectively changes the code's behavior as well: it now ultimately calls set_page_dirty_lock(), instead of SetPageDirty().This is probably more accurate. As Christoph Hellwig put it, "set_page_dirty() is only safe if we are dealing with a file backed page where we have reference on the inode it hangs off." [3] Also, this deletes one of the two FIXME comments (about refcounting), because there is nothing wrong with the refcounting at this point. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ [3] https://lore.kernel.org/r/20190723153640.GB720@lst.de Link: https://lore.kernel.org/r/20200526182709.99599-1-jhubbard@nvidia.com Cc: "Kai Mäkisara (Kolumbus)" Cc: Bart Van Assche Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: linux-scsi@vger.kernel.org Acked-by: Kai Mäkisara Signed-off-by: John Hubbard Signed-off-by: Martin K. Petersen commit 987db58737e26c3d995811fefef9632756ca7cec Author: Sudhakar Panneerselvam Date: Sun Jun 7 19:58:33 2020 +0000 scsi: target: Rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb() This commit also removes the unused argument, cdb, that was passed to this function. Link: https://lore.kernel.org/r/1591559913-8388-5-git-send-email-sudhakar.panneerselvam@oracle.com Reviewed-by: Mike Christie Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Martin K. Petersen commit 9e95fb805dc043cc8ed878a08d1583e4097a5f80 Author: Sudhakar Panneerselvam Date: Sun Jun 7 19:58:32 2020 +0000 scsi: target: Fix NULL pointer dereference NULL pointer dereference happens when the following conditions are met: 1) A SCSI command is received for a non-existing LU or cdb initialization fails in target_setup_cmd_from_cdb(). 2) Tracing is enabled. The following call sequences lead to NULL pointer dereference: 1) iscsit_setup_scsi_cmd transport_lookup_cmd_lun <-- lookup fails. or target_setup_cmd_from_cdb() <-- cdb initialization fails iscsit_process_scsi_cmd iscsit_sequence_cmd transport_send_check_condition_and_sense trace_target_cmd_complete <-- NULL dereference 2) target_submit_cmd_map_sgls transport_lookup_cmd_lun <-- lookup fails or target_setup_cmd_from_cdb() <-- cdb initialization fails transport_send_check_condition_and_sense trace_target_cmd_complete <-- NULL dereference In the above sequence, cmd->t_task_cdb is uninitialized which when referenced in trace_target_cmd_complete() causes NULL pointer dereference. The fix is to use the helper, target_cmd_init_cdb() and call it after transport_init_se_cmd() is called, so that cmd->t_task_cdb can be initialized and hence can be referenced in trace_target_cmd_complete(). Link: https://lore.kernel.org/r/1591559913-8388-4-git-send-email-sudhakar.panneerselvam@oracle.com Reviewed-by: Mike Christie Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Martin K. Petersen commit a36840d8002736060f96386cf5dd148f0b0d4fa3 Author: Sudhakar Panneerselvam Date: Sun Jun 7 19:58:31 2020 +0000 scsi: target: Initialize LUN in transport_init_se_cmd() Initialization of orig_fe_lun is moved to transport_init_se_cmd() from transport_lookup_cmd_lun(). This helps for the cases where the SCSI request fails before the call to transport_lookup_cmd_lun() so that trace_target_cmd_complete() can print the LUN information to the trace buffer. Due to this change, the lun parameter is removed from transport_lookup_cmd_lun() and transport_lookup_tmr_lun(). Link: https://lore.kernel.org/r/1591559913-8388-3-git-send-email-sudhakar.panneerselvam@oracle.com Reviewed-by: Mike Christie Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Martin K. Petersen commit f98c2ddf8ba34d8c44bf81f2e7542166d90ce5d9 Author: Sudhakar Panneerselvam Date: Sun Jun 7 19:58:30 2020 +0000 scsi: target: Factor out a new helper, target_cmd_init_cdb() target_setup_cmd_from_cdb() is called after a successful call to transport_lookup_cmd_lun(). The new helper factors out the code that can be called before the call to transport_lookup_cmd_lun(). This helper will be used in an upcoming commit to address NULL pointer dereference. Link: https://lore.kernel.org/r/1591559913-8388-2-git-send-email-sudhakar.panneerselvam@oracle.com Reviewed-by: Mike Christie Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Martin K. Petersen commit c5b856255cbc3b664d686a83fa9397a835e063de Author: Jens Axboe Date: Tue Jun 9 19:23:05 2020 -0600 io_uring: allow O_NONBLOCK async retry We can assume that O_NONBLOCK is always honored, even if we don't have a ->read/write_iter() for the file type. Also unify the read/write checking for allowing async punt, having the write side factoring in the REQ_F_NOWAIT flag as well. Cc: stable@vger.kernel.org Fixes: 490e89676a52 ("io_uring: only force async punt if poll based retry can't handle it") Signed-off-by: Jens Axboe commit 8ca8d4a841730c02e77bf3c87bf658cc44f364b9 Author: Arnaldo Carvalho de Melo Date: Tue Jun 9 18:16:53 2020 -0300 libbpf: Define __WORDSIZE if not available Some systems, such as Android, don't have a define for __WORDSIZE, do it in terms of __SIZEOF_LONG__, as done in perf since 2012: http://git.kernel.org/torvalds/c/3f34f6c0233ae055b5 For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html I build tested it here and Andrii did some Travis CI build tests too. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200608161150.GA3073@kernel.org commit 89dc68533b190117e1a2fb4298d88b96b3580abf Author: Pablo Neira Ayuso Date: Tue Jun 9 23:47:44 2020 +0200 net: flow_offload: remove indirect flow_block declarations leftover Remove function declarations that are not available in the tree anymore. Fixes: 709ffbe19b77 ("net: remove indirect block netdev event registration") Reported-by: Jacob Keller Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 5b14671be58d0084e7e2d1cc9c2c36a94467f6e0 Merge: 52435c86bf0f 9b46418c40fe Author: Linus Torvalds Date: Tue Jun 9 15:48:24 2020 -0700 Merge tag 'fuse-update-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse updates from Miklos Szeredi: - Fix a rare deadlock in virtiofs - Fix st_blocks in writeback cache mode - Fix wrong checks in splice move causing spurious warnings - Fix a race between a GETATTR request and a FUSE_NOTIFY_INVAL_INODE notification - Use rb-tree instead of linear search for pages currently under writeout by userspace - Fix copy_file_range() inconsistencies * tag 'fuse-update-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: copy_file_range should truncate cache fuse: fix copy_file_range cache issues fuse: optimize writepages search fuse: update attr_version counter on fuse_notify_inval_inode() fuse: don't check refcount after stealing page fuse: fix weird page warning fuse: use dump_page virtiofs: do not use fuse_fill_super_common() for device installation fuse: always allow query of st_dev fuse: always flush dirty data on close(2) fuse: invalidate inode attr in writeback cache mode fuse: Update stale comment in queue_interrupt() fuse: BUG_ON correction in fuse_dev_splice_write() virtiofs: Add mount option and atime behavior to the doc virtiofs: schedule blocking async replies in separate worker commit 52435c86bf0f5c892804912481af7f1a5b95ff2d Merge: 4964dd29140a 2068cf7dfbc6 Author: Linus Torvalds Date: Tue Jun 9 15:40:50 2020 -0700 Merge tag 'ovl-update-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs updates from Miklos Szeredi: "Fixes: - Resolve mount option conflicts consistently - Sync before remount R/O - Fix file handle encoding corner cases - Fix metacopy related issues - Fix an unintialized return value - Add missing permission checks for underlying layers Optimizations: - Allow multipe whiteouts to share an inode - Optimize small writes by inheriting SB_NOSEC from upper layer - Do not call ->syncfs() multiple times for sync(2) - Do not cache negative lookups on upper layer - Make private internal mounts longterm" * tag 'ovl-update-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: (27 commits) ovl: remove unnecessary lock check ovl: make oip->index bool ovl: only pass ->ki_flags to ovl_iocb_to_rwf() ovl: make private mounts longterm ovl: get rid of redundant members in struct ovl_fs ovl: add accessor for ofs->upper_mnt ovl: initialize error in ovl_copy_xattr ovl: drop negative dentry in upper layer ovl: check permission to open real file ovl: call secutiry hook in ovl_real_ioctl() ovl: verify permissions in ovl_path_open() ovl: switch to mounter creds in readdir ovl: pass correct flags for opening real directory ovl: fix redirect traversal on metacopy dentries ovl: initialize OVL_UPPERDATA in ovl_lookup() ovl: use only uppermetacopy state in ovl_lookup() ovl: simplify setting of origin for index lookup ovl: fix out of bounds access warning in ovl_check_fb_len() ovl: return required buffer size for file handles ovl: sync dirty data when remounting to ro mode ... commit 4964dd29140a44e26474dbdca559b7393aba6c39 Merge: 42612e776331 c68421bbad75 Author: Linus Torvalds Date: Tue Jun 9 15:38:46 2020 -0700 Merge tag 'afs-fixes-20200609' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS fixes from David Howells: "A set of small patches to fix some things, most of them minor. - Fix a memory leak in afs_put_sysnames() - Fix an oops in AFS file locking - Fix new use of BUG() - Fix debugging statements containing %px - Remove afs_zero_fid as it's unused - Make afs_zap_data() static" * tag 'afs-fixes-20200609' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Make afs_zap_data() static afs: Remove afs_zero_fid as it's not used afs: Fix debugging statements with %px to be %p afs: Fix use of BUG() afs: Fix file locking afs: Fix memory leak in afs_put_sysnames() commit 865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e Author: tannerlove Date: Tue Jun 9 17:21:32 2020 -0400 selftests/net: in rxtimestamp getopt_long needs terminating null entry getopt_long requires the last element to be filled with zeros. Otherwise, passing an unrecognized option can cause a segfault. Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 62a502cc91f97e3ffd312d9b42e8d01a137c63ff Author: Lorenzo Bianconi Date: Tue Jun 9 00:02:39 2020 +0200 net: mvneta: do not redirect frames during reconfiguration Disable frames injection in mvneta_xdp_xmit routine during hw re-configuration in order to avoid hardware hangs Fixes: b0a43db9087a ("net: mvneta: add XDP_TX support") Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 9ac1eafa885a9b2d3becd4f2e622829b1f5b9b86 Author: Stephen Boyd Date: Tue Jun 9 14:18:47 2020 -0700 clk: mediatek: Remove ifr{0,1}_cfg_regs structures These aren't used and the macros that reference them aren't used either. Remove the dead code to avoid compile warnings. Cc: Owen Chen Cc: Mars Cheng Cc: Macpaul Lin Fixes: 1aca9939bf72 ("clk: mediatek: Add MT6765 clock support") Reported-by: kbuild test robot Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20200609211847.27366-1-sboyd@kernel.org commit 45edc7e27445f4d467d915c0e1ef0a7b41270f47 Author: Colin Ian King Date: Tue Jun 2 18:24:35 2020 +0100 clk: baikal-t1: remove redundant assignment to variable 'divider' The variable divider is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200602172435.70282-1-colin.king@canonical.com Reviewed-by: Serge Semin Signed-off-by: Stephen Boyd commit 8ae91d36ac1a16debb39e372f2a81278bb5b4830 Author: Colin Ian King Date: Tue Jun 2 13:10:30 2020 +0100 clk: baikal-t1: fix spelling mistake "Uncompatible" -> "Incompatible" There is a spelling mistake in a pr_err error message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200602121030.39132-1-colin.king@canonical.com Reviewed-by: Serge Semin Signed-off-by: Stephen Boyd commit 30b239686b86b1a8097a3b8752b4987b6afed519 Author: Lubomir Rintel Date: Fri Jun 5 08:52:58 2020 +0200 dt-bindings: clock: Add a missing include to MMP Audio Clock binding The include file for input clock in the example was missing, breaking the validation. Signed-off-by: Lubomir Rintel Reported-by: Rob Herring Link: https://lore.kernel.org/r/20200605065258.567858-1-lkundrak@v3.sk Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit c96b6acc8f89a4a7f6258dfe1d077654c11415be Author: Wang Hai Date: Tue Jun 9 22:18:16 2020 +0800 dccp: Fix possible memleak in dccp_init and dccp_fini There are some memory leaks in dccp_init() and dccp_fini(). In dccp_fini() and the error handling path in dccp_init(), free lhash2 is missing. Add inet_hashinfo2_free_mod() to do it. If inet_hashinfo2_init_mod() failed in dccp_init(), percpu_counter_destroy() should be called to destroy dccp_orphan_count. It need to goto out_free_percpu when inet_hashinfo2_init_mod() failed. Fixes: c92c81df93df ("net: dccp: fix kernel crash on module load") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit 976ee3b21119dcf5c6d96233d688a1453f29fa83 Author: Shannon Nelson Date: Mon Jun 8 20:41:43 2020 -0700 ionic: wait on queue start until after IFF_UP The netif_running() test looks at __LINK_STATE_START which gets set before ndo_open() is called, there is a window of time between that and when the queues are actually ready to be run. If ionic_check_link_status() notices that the link is up very soon after netif_running() becomes true, it might try to run the queues before they are ready, causing all manner of potential issues. Since the netdev->flags IFF_UP isn't set until after ndo_open() returns, we can wait for that before we allow ionic_check_link_status() to start the queues. On the way back to close, __LINK_STATE_START is cleared before calling ndo_stop(), and IFF_UP is cleared after. Both of these need to be true in order to safely stop the queues from ionic_check_link_status(). Fixes: 49d3b493673a ("ionic: disable the queues on link down") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 1a3db27ad9a72d033235b9673653962c02e3486e Author: Valentin Longchamp Date: Tue Jun 9 22:11:54 2020 +0200 net: sched: export __netdev_watchdog_up() Since the quiesce/activate rework, __netdev_watchdog_up() is directly called in the ucc_geth driver. Unfortunately, this function is not available for modules and thus ucc_geth cannot be built as a module anymore. Fix it by exporting __netdev_watchdog_up(). Since the commit introducing the regression was backported to stable branches, this one should ideally be as well. Fixes: 79dde73cf9bc ("net/ethernet/freescale: rework quiesce/activate for ucc_geth") Signed-off-by: Valentin Longchamp Signed-off-by: David S. Miller commit 845e0ebb4408d4473cf60d21224a897037e9a77a Author: Cong Wang Date: Mon Jun 8 14:53:01 2020 -0700 net: change addr_list_lock back to static key The dynamic key update for addr_list_lock still causes troubles, for example the following race condition still exists: CPU 0: CPU 1: (RCU read lock) (RTNL lock) dev_mc_seq_show() netdev_update_lockdep_key() -> lockdep_unregister_key() -> netif_addr_lock_bh() because lockdep doesn't provide an API to update it atomically. Therefore, we have to move it back to static keys and use subclass for nest locking like before. In commit 1a33e10e4a95 ("net: partially revert dynamic lockdep key changes"), I already reverted most parts of commit ab92d68fc22f ("net: core: add generic lockdep keys"). This patch reverts the rest and also part of commit f3b0a18bb6cb ("net: remove unnecessary variables and callback"). After this patch, addr_list_lock changes back to using static keys and subclasses to satisfy lockdep. Thanks to dev->lower_level, we do not have to change back to ->ndo_get_lock_subclass(). And hopefully this reduces some syzbot lockdep noises too. Reported-by: syzbot+f3a0e80c34b3fc28ac5e@syzkaller.appspotmail.com Cc: Taehee Yoo Cc: Dmitry Vyukov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 751ad34fbad74c3ed4a9ede24764b4253d4faa84 Author: Arnd Bergmann Date: Tue Jun 9 12:51:53 2020 -0700 Input: adi - work around module name confict Making module name conflicts a fatal error breaks sparc64 allmodconfig: Error log: error: the following would cause module name conflict: drivers/char/adi.ko drivers/input/joystick/adi.ko Renaming one of the modules would solve the problem, but then cause other problems because neither of them is automatically loaded and changing the name is likely to break any setup that relies on manually loading it by name. As there is probably no sparc64 system with this kind of ancient joystick attached, work around it by adding a Kconfig dependency that forbids them from both being modules. It is still possible to build the joystick driver if the sparc64 adi driver is built-in. Reported-by: Guenter Roeck Acked-by: Greg Kroah-Hartman Signed-off-by: Arnd Bergmann Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200609100643.1245061-1-arnd@arndb.de Signed-off-by: Dmitry Torokhov commit 042b1545fe47788e734b0f074a8ae65856015cdf Author: Jesper Dangaard Brouer Date: Tue Jun 9 15:31:52 2020 +0200 bpf: Selftests and tools use struct bpf_devmap_val from uapi Sync tools uapi bpf.h header file and update selftests that use struct bpf_devmap_val. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/159170951195.2102545.1833108712124273987.stgit@firesoul commit 281920b7e0b31e0a7706433ff58e7d52ac97c327 Author: Jesper Dangaard Brouer Date: Tue Jun 9 15:31:46 2020 +0200 bpf: Devmap adjust uapi for attach bpf program V2: - Defer changing BPF-syscall to start at file-descriptor 1 - Use {} to zero initialise struct. The recent commit fbee97feed9b ("bpf: Add support to attach bpf program to a devmap entry"), introduced ability to attach (and run) a separate XDP bpf_prog for each devmap entry. A bpf_prog is added via a file-descriptor. As zero were a valid FD, not using the feature requires using value minus-1. The UAPI is extended via tail-extending struct bpf_devmap_val and using map->value_size to determine the feature set. This will break older userspace applications not using the bpf_prog feature. Consider an old userspace app that is compiled against newer kernel uapi/bpf.h, it will not know that it need to initialise the member bpf_prog.fd to minus-1. Thus, users will be forced to update source code to get program running on newer kernels. This patch remove the minus-1 checks, and have zero mean feature isn't used. Followup patches either for kernel or libbpf should handle and avoid returning file-descriptor zero in the first place. Fixes: fbee97feed9b ("bpf: Add support to attach bpf program to a devmap entry") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/159170950687.2102545.7235914718298050113.stgit@firesoul commit 42612e7763315cf5d43c4422781e75f9ee57597a Merge: ad57a1022f9e b7b911d59dac Author: Linus Torvalds Date: Tue Jun 9 11:28:59 2020 -0700 Merge tag 'f2fs-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this round, we've added some knobs to enhance compression feature and harden testing environment. In addition, we've fixed several bugs reported from Android devices such as long discarding latency, device hanging during quota_sync, etc. Enhancements: - support lzo-rle algorithm - add two ioctls to release and reserve blocks for compression - support partial truncation/fiemap on compressed file - introduce sysfs entries to attach IO flags explicitly - add iostat trace point along with read io stat Bug fixes: - fix long discard latency - flush quota data by f2fs_quota_sync correctly - fix to recover parent inode number for power-cut recovery - fix lz4/zstd output buffer budget - parse checkpoint mount option correctly - avoid inifinite loop to wait for flushing node/meta pages - manage discard space correctly And some refactoring and clean up patches were added" * tag 'f2fs-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (51 commits) f2fs: attach IO flags to the missing cases f2fs: add node_io_flag for bio flags likewise data_io_flag f2fs: remove unused parameter of f2fs_put_rpages_mapping() f2fs: handle readonly filesystem in f2fs_ioc_shutdown() f2fs: avoid utf8_strncasecmp() with unstable name f2fs: don't return vmalloc() memory from f2fs_kmalloc() f2fs: fix retry logic in f2fs_write_cache_pages() f2fs: fix wrong discard space f2fs: compress: don't compress any datas after cp stop f2fs: remove unneeded return value of __insert_discard_tree() f2fs: fix wrong value of tracepoint parameter f2fs: protect new segment allocation in expand_inode_data f2fs: code cleanup by removing ifdef macro surrounding f2fs: avoid inifinite loop to wait for flushing node pages at cp_error f2fs: flush dirty meta pages when flushing them f2fs: fix checkpoint=disable:%u%% f2fs: compress: fix zstd data corruption f2fs: add compressed/gc data read IO stat f2fs: fix potential use-after-free issue f2fs: compress: don't handle non-compressed data in workqueue ... commit ad57a1022f9e050a09812d975874b94b4fcb0f46 Merge: 3beff76b5498 fc961522ddbd Author: Linus Torvalds Date: Tue Jun 9 11:24:59 2020 -0700 Merge tag 'exfat-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat update from Namjae Jeon: "Bug fixes: - Fix memory leak on mount failure with iocharset= option - Fix incorrect update of stream entry - Fix cluster range validation error Clean-ups: - Remove unused code and unneeded assignment - Rename variables in exfat structure as specification - Reorganize boot sector analysis code - Simplify exfat_utf8_d_hash and exfat_utf8_d_cmp() - Optimize exfat entry cache functions - Improve wording of EXFAT_DEFAULT_IOCHARSET config option New Feature: - Add boot region verification" * tag 'exfat-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: Fix potential use after free in exfat_load_upcase_table() exfat: fix range validation error in alloc and free cluster exfat: fix incorrect update of stream entry in __exfat_truncate() exfat: fix memory leak in exfat_parse_param() exfat: remove unnecessary reassignment of p_uniname->name_len exfat: standardize checksum calculation exfat: add boot region verification exfat: separate the boot sector analysis exfat: redefine PBR as boot_sector exfat: optimize dir-cache exfat: replace 'time_ms' with 'time_cs' exfat: remove the assignment of 0 to bool variable exfat: Remove unused functions exfat_high_surrogate() and exfat_low_surrogate() exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option exfat: Use a more common logging style exfat: Simplify exfat_utf8_d_cmp() for code points above U+FFFF commit 248e00ac47d64e153b9c50f45aad73cd61894a73 Author: Lorenz Bauer Date: Mon Jun 8 17:22:01 2020 +0100 bpf: cgroup: Allow multi-attach program to replace itself When using BPF_PROG_ATTACH to attach a program to a cgroup in BPF_F_ALLOW_MULTI mode, it is not possible to replace a program with itself. This is because the check for duplicate programs doesn't take the replacement program into account. Replacing a program with itself might seem weird, but it has some uses: first, it allows resetting the associated cgroup storage. Second, it makes the API consistent with the non-ALLOW_MULTI usage, where it is possible to replace a program with itself. Third, it aligns BPF_PROG_ATTACH with bpf_link, where replacing itself is also supported. Sice this code has been refactored a few times this change will only apply to v5.7 and later. Adjustments could be made to commit 1020c1f24a94 ("bpf: Simplify __cgroup_bpf_attach") and commit d7bf2c10af05 ("bpf: allocate cgroup storage entries on attaching bpf programs") as well as commit 324bda9e6c5a ("bpf: multi program support for cgroup+bpf") Fixes: af6eea57437a ("bpf: Implement bpf_link-based cgroup BPF program attachment") Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200608162202.94002-1-lmb@cloudflare.com commit 26afa0a4eb3fd87757f9de56ec5db5a03b14e120 Author: David Ahern Date: Mon Jun 8 09:17:23 2020 -0600 bpf: Reset data_meta before running programs attached to devmap entry This is a new context that does not handle metadata at the moment, so mark data_meta invalid. Fixes: fbee97feed9b ("bpf: Add support to attach bpf program to a devmap entry") Signed-off-by: David Ahern Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200608151723.9539-1-dsahern@kernel.org commit 22d5bd6867364b41576a712755271a7d6161abd6 Author: Jean-Philippe Brucker Date: Mon Jun 8 14:45:32 2020 +0200 tracing/probe: Fix bpf_task_fd_query() for kprobes and uprobes Commit 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe") removed the trace_[ku]probe structure from the trace_event_call->data pointer. As bpf_get_[ku]probe_info() were forgotten in that change, fix them now. These functions are currently only used by the bpf_task_fd_query() syscall handler to collect information about a perf event. Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe") Signed-off-by: Jean-Philippe Brucker Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Acked-by: Masami Hiramatsu Link: https://lore.kernel.org/bpf/20200608124531.819838-1-jean-philippe@linaro.org commit 21a85bd601ee50f2796d52c542c46d04e21cedac Author: Lorenz Bauer Date: Mon Jun 8 10:42:57 2020 +0100 scripts: Require pahole v1.16 when generating BTF bpf_iter requires the kernel BTF to be generated with pahole >= 1.16, since otherwise the function definitions that the iterator attaches to are not included. This failure mode is indistiguishable from trying to attach to an iterator that really doesn't exist. Since it's really easy to miss this requirement, bump the pahole version check used at build time to at least 1.16. Fixes: 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program") Suggested-by: Ivan Babrou Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200608094257.47366-1-lmb@cloudflare.com commit 75e68e5bf2c7fa9d3e874099139df03d5952a3e1 Author: Jakub Sitnicki Date: Sun Jun 7 22:52:29 2020 +0200 bpf, sockhash: Synchronize delete from bucket list on map free We can end up modifying the sockhash bucket list from two CPUs when a sockhash is being destroyed (sock_hash_free) on one CPU, while a socket that is in the sockhash is unlinking itself from it on another CPU it (sock_hash_delete_from_link). This results in accessing a list element that is in an undefined state as reported by KASAN: | ================================================================== | BUG: KASAN: wild-memory-access in sock_hash_free+0x13c/0x280 | Write of size 8 at addr dead000000000122 by task kworker/2:1/95 | | CPU: 2 PID: 95 Comm: kworker/2:1 Not tainted 5.7.0-rc7-02961-ge22c35ab0038-dirty #691 | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014 | Workqueue: events bpf_map_free_deferred | Call Trace: | dump_stack+0x97/0xe0 | ? sock_hash_free+0x13c/0x280 | __kasan_report.cold+0x5/0x40 | ? mark_lock+0xbc1/0xc00 | ? sock_hash_free+0x13c/0x280 | kasan_report+0x38/0x50 | ? sock_hash_free+0x152/0x280 | sock_hash_free+0x13c/0x280 | bpf_map_free_deferred+0xb2/0xd0 | ? bpf_map_charge_finish+0x50/0x50 | ? rcu_read_lock_sched_held+0x81/0xb0 | ? rcu_read_lock_bh_held+0x90/0x90 | process_one_work+0x59a/0xac0 | ? lock_release+0x3b0/0x3b0 | ? pwq_dec_nr_in_flight+0x110/0x110 | ? rwlock_bug.part.0+0x60/0x60 | worker_thread+0x7a/0x680 | ? _raw_spin_unlock_irqrestore+0x4c/0x60 | kthread+0x1cc/0x220 | ? process_one_work+0xac0/0xac0 | ? kthread_create_on_node+0xa0/0xa0 | ret_from_fork+0x24/0x30 | ================================================================== Fix it by reintroducing spin-lock protected critical section around the code that removes the elements from the bucket on sockhash free. To do that we also need to defer processing of removed elements, until out of atomic context so that we can unlink the socket from the map when holding the sock lock. Fixes: 90db6d772f74 ("bpf, sockmap: Remove bucket->lock from sock_{hash|map}_free") Reported-by: Eric Dumazet Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200607205229.2389672-3-jakub@cloudflare.com commit 33a7c831565c43a7ee2f38c7df4c4a40e1dfdfed Author: Jakub Sitnicki Date: Sun Jun 7 22:52:28 2020 +0200 bpf, sockhash: Fix memory leak when unlinking sockets in sock_hash_free When sockhash gets destroyed while sockets are still linked to it, we will walk the bucket lists and delete the links. However, we are not freeing the list elements after processing them, leaking the memory. The leak can be triggered by close()'ing a sockhash map when it still contains sockets, and observed with kmemleak: unreferenced object 0xffff888116e86f00 (size 64): comm "race_sock_unlin", pid 223, jiffies 4294731063 (age 217.404s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 81 de e8 41 00 00 00 00 c0 69 2f 15 81 88 ff ff ...A.....i/..... backtrace: [<00000000dd089ebb>] sock_hash_update_common+0x4ca/0x760 [<00000000b8219bd5>] sock_hash_update_elem+0x1d2/0x200 [<000000005e2c23de>] __do_sys_bpf+0x2046/0x2990 [<00000000d0084618>] do_syscall_64+0xad/0x9a0 [<000000000d96f263>] entry_SYSCALL_64_after_hwframe+0x49/0xb3 Fix it by freeing the list element when we're done with it. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200607205229.2389672-2-jakub@cloudflare.com commit 487082fb7bd2a32b66927d2b22e3a81b072b44f0 Author: dihu Date: Fri Jun 5 16:46:25 2020 +0800 bpf/sockmap: Fix kernel panic at __tcp_bpf_recvmsg When user application calls read() with MSG_PEEK flag to read data of bpf sockmap socket, kernel panic happens at __tcp_bpf_recvmsg+0x12c/0x350. sk_msg is not removed from ingress_msg queue after read out under MSG_PEEK flag is set. Because it's not judged whether sk_msg is the last msg of ingress_msg queue, the next sk_msg may be the head of ingress_msg queue, whose memory address of sg page is invalid. So it's necessary to add check codes to prevent this problem. [20759.125457] BUG: kernel NULL pointer dereference, address: 0000000000000008 [20759.132118] CPU: 53 PID: 51378 Comm: envoy Tainted: G E 5.4.32 #1 [20759.140890] Hardware name: Inspur SA5212M4/YZMB-00370-109, BIOS 4.1.12 06/18/2017 [20759.149734] RIP: 0010:copy_page_to_iter+0xad/0x300 [20759.270877] __tcp_bpf_recvmsg+0x12c/0x350 [20759.276099] tcp_bpf_recvmsg+0x113/0x370 [20759.281137] inet_recvmsg+0x55/0xc0 [20759.285734] __sys_recvfrom+0xc8/0x130 [20759.290566] ? __audit_syscall_entry+0x103/0x130 [20759.296227] ? syscall_trace_enter+0x1d2/0x2d0 [20759.301700] ? __audit_syscall_exit+0x1e4/0x290 [20759.307235] __x64_sys_recvfrom+0x24/0x30 [20759.312226] do_syscall_64+0x55/0x1b0 [20759.316852] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: dihu Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20200605084625.9783-1-anny.hu@linux.alibaba.com commit 3beff76b54986fc3132fb62614875f116bba7701 Author: Linus Torvalds Date: Tue Jun 9 10:39:33 2020 -0700 x86: use proper parentheses around new uaccess macro argument uses __get_kernel_nofault() didn't have the parentheses around the use of 'src' and 'dst' macro arguments, making the casts potentially do the wrong thing. The parentheses aren't necessary with the current very limited use in mm/access.c, but it's bad form, and future use-cases might have very unexpected errors as a result. Do the same for unsafe_copy_loop() while at it, although in that case it is an entirely internal x86 uaccess helper macro that isn't used anywhere else and any other use would be invalid anyway. Fixes: fa94111d9435 ("x86: use non-set_fs based maccess routines") Cc: Christoph Hellwig Cc: Andrew Morton Signed-off-by: Linus Torvalds commit f1084bc60a1ec592011a805a0f925f2f1205897d Author: David Sterba Date: Tue Jun 9 19:22:47 2020 +0200 Revert "fs: remove dio_end_io()" This reverts commit b75b7ca7c27dfd61dba368f390b7d4dc20b3a8cb. The patch restores a helper that was not necessary after direct IO port to iomap infrastructure, which gets reverted. Signed-off-by: David Sterba commit 8e0fa5d7b3df6e7e23e13a7250b00afe32d4e618 Author: David Sterba Date: Tue Jun 9 19:21:48 2020 +0200 Revert "btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK" This reverts commit 5f008163a559d566a0ee1190a0a24f3eec6f1ea7. The patch is a simplification after direct IO port to iomap infrastructure, which gets reverted. Signed-off-by: David Sterba commit f4c48b44080e18d86d7983c1a60ee5a7f9d07e3e Author: David Sterba Date: Tue Jun 9 19:19:27 2020 +0200 Revert "btrfs: split btrfs_direct_IO to read and write part" This reverts commit d8f3e73587ce574f7a9bc165e0db69b0b148f6f8. The patch is a cleanup of direct IO port to iomap infrastructure, which gets reverted. Signed-off-by: David Sterba commit c68421bbad755a280851afff0fb236dd4e53e684 Author: David Howells Date: Mon Feb 10 10:00:22 2020 +0000 afs: Make afs_zap_data() static Make afs_zap_data() static as it's only used in the file in which it is defined. Signed-off-by: David Howells commit 4a06fa5403832ce65986654e46042796f4e6123d Author: David Howells Date: Thu Feb 6 14:22:27 2020 +0000 afs: Remove afs_zero_fid as it's not used Remove afs_zero_fid as it's not used. Signed-off-by: David Howells commit fed79fd7834027c152a1491a42be252eb1c2a6b5 Author: David Howells Date: Tue Jun 9 16:25:02 2020 +0100 afs: Fix debugging statements with %px to be %p Fix a couple of %px to be %p in debugging statements. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Fixes: 8a070a964877 ("afs: Detect cell aliases 1 - Cells with root volumes") Reported-by: Kees Cook Signed-off-by: David Howells Reviewed-by: Kees Cook commit f9639f9a779ac0381cabfb793915851a89424f9f Author: Tomi Valkeinen Date: Tue Jun 9 13:29:58 2020 +0300 ARM: dts: am437x-sk-evm: remove lcd timings LCD timings now come from panel-simple. Having timings in the DT will cause a WARN. Signed-off-by: Tomi Valkeinen Signed-off-by: Tony Lindgren commit d1e521adad250ab8c979861c857fa2b1542c9741 Merge: 595a56ac1b0d 388d8bdb87e0 Author: Linus Torvalds Date: Tue Jun 9 10:06:18 2020 -0700 Merge tag 'trace-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: "No new features this release. Mostly clean ups, restructuring and documentation. - Have ftrace_bug() show ftrace errors before the WARN, as the WARN will reboot the box before the error messages are printed if panic_on_warn is set. - Have traceoff_on_warn disable tracing sooner (before prints) - Write a message to the trace buffer that its being disabled when disable_trace_on_warning() is set. - Separate out synthetic events from histogram code to let it be used by other parts of the kernel. - More documentation on histogram design. - Other small fixes and clean ups" * tag 'trace-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Remove obsolete PREEMPTIRQ_EVENTS kconfig option tracing/doc: Fix ascii-art in histogram-design.rst tracing: Add a trace print when traceoff_on_warning is triggered ftrace,bug: Improve traceoff_on_warn selftests/ftrace: Distinguish between hist and synthetic event checks tracing: Move synthetic events to a separate file tracing: Fix events.rst section numbering tracing/doc: Fix typos in histogram-design.rst tracing: Add hist_debug trace event files for histogram debugging tracing: Add histogram-design document tracing: Check state.disabled in synth event trace functions tracing/probe: reverse arguments to list_add tools/bootconfig: Add a summary of test cases and return error ftrace: show debugging information when panic_on_warn set commit 595a56ac1b0d5f0a16a89589ef55ffd35c1967a2 Merge: fc2fb38c8550 6d6861d45e38 Author: Linus Torvalds Date: Tue Jun 9 10:04:47 2020 -0700 Merge tag 'linux-kselftest-kunit-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kunit updates from Shuah Khan: "This consists of: - Several config fragment fixes from Anders Roxell to improve test coverage. - Improvements to kunit run script to use defconfig as default and restructure the code for config/build/exec/parse from Vitor Massaru Iha and David Gow. - Miscellaneous documentation warn fix" * tag 'linux-kselftest-kunit-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: security: apparmor: default KUNIT_* fragments to KUNIT_ALL_TESTS fs: ext4: default KUNIT_* fragments to KUNIT_ALL_TESTS drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS lib: Kconfig.debug: default KUNIT_* fragments to KUNIT_ALL_TESTS kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS kunit: Kconfig: enable a KUNIT_ALL_TESTS fragment kunit: Fix TabError, remove defconfig code and handle when there is no kunitconfig kunit: use KUnit defconfig by default kunit: use --build_dir=.kunit as default Documentation: test.h - fix warnings kunit: kunit_tool: Separate out config/build/exec/parse commit fc2fb38c85508a875fc2e95f1e14e0bdcf59e1e9 Merge: a5ad5742f671 382561a0f11c Author: Linus Torvalds Date: Tue Jun 9 10:03:12 2020 -0700 Merge tag 'linux-kselftest-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest updates from Shuah Khan: "This consists of: - Several fixes from Masami Hiramatsu to improve coverage for lib and sysctl tests. - Clean up to vdso test and a new test for getcpu() from Mark Brown. - Add new gen_tar selftests Makefile target generate selftest package running "make gen_tar" in selftests directory from Veronika Kabatova. - Other miscellaneous fixes to timens, exec, tpm2 tests" * tag 'linux-kselftest-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/sysctl: Make sysctl test driver as a module selftests/sysctl: Fix to load test_sysctl module lib: Make test_sysctl initialized as module lib: Make prime number generator independently selectable selftests/ftrace: Return unsupported if no error_log file selftests/ftrace: Use printf for backslash included command selftests/timens: handle a case when alarm clocks are not supported Kernel selftests: Add check if TPM devices are supported selftests: vdso: Add a selftest for vDSO getcpu() selftests: vdso: Use a header file to prototype parse_vdso API selftests: vdso: Rename vdso_test to vdso_test_gettimeofday selftests/exec: Verify execve of non-regular files fail selftests: introduce gen_tar Makefile target commit a5ad5742f671de906adbf29fbedf0a04705cebad Merge: 013b2deba9a6 4fa7252338a5 Author: Linus Torvalds Date: Tue Jun 9 09:54:46 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge even more updates from Andrew Morton: - a kernel-wide sweep of show_stack() - pagetable cleanups - abstract out accesses to mmap_sem - prep for mmap_sem scalability work - hch's user acess work Subsystems affected by this patch series: debug, mm/pagemap, mm/maccess, mm/documentation. * emailed patches from Andrew Morton : (93 commits) include/linux/cache.h: expand documentation over __read_mostly maccess: return -ERANGE when probe_kernel_read() fails x86: use non-set_fs based maccess routines maccess: allow architectures to provide kernel probing directly maccess: move user access routines together maccess: always use strict semantics for probe_kernel_read maccess: remove strncpy_from_unsafe tracing/kprobes: handle mixed kernel/userspace probes better bpf: rework the compat kernel probe handling bpf:bpf_seq_printf(): handle potentially unsafe format string better bpf: handle the compat string in bpf_trace_copy_string better bpf: factor out a bpf_trace_copy_string helper maccess: unify the probe kernel arch hooks maccess: remove probe_read_common and probe_write_common maccess: rename strnlen_unsafe_user to strnlen_user_nofault maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault maccess: update the top of file comment maccess: clarify kerneldoc comments maccess: remove duplicate kerneldoc comments ... commit 013b2deba9a6b80ca02f4fafd7dedf875e9b4450 Author: Oleg Nesterov Date: Mon May 4 18:47:25 2020 +0200 uprobes: ensure that uprobe->offset and ->ref_ctr_offset are properly aligned uprobe_write_opcode() must not cross page boundary; prepare_uprobe() relies on arch_uprobe_analyze_insn() which should validate "vaddr" but some architectures (csky, s390, and sparc) don't do this. We can remove the BUG_ON() check in prepare_uprobe() and validate the offset early in __uprobe_register(). The new IS_ALIGNED() check matches the alignment check in arch_prepare_kprobe() on supported architectures, so I think that all insns must be aligned to UPROBE_SWBP_INSN_SIZE. Another problem is __update_ref_ctr() which was wrong from the very beginning, it can read/write outside of kmap'ed page unless "vaddr" is aligned to sizeof(short), __uprobe_register() should check this too. Reported-by: Linus Torvalds Suggested-by: Linus Torvalds Signed-off-by: Oleg Nesterov Reviewed-by: Srikar Dronamraju Acked-by: Christian Borntraeger Tested-by: Sven Schnelle Cc: Steven Rostedt Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit 4fa7252338a56fbc90220e6330f136a379175a7a Author: Luis Chamberlain Date: Mon Jun 8 21:35:07 2020 -0700 include/linux/cache.h: expand documentation over __read_mostly __read_mostly can easily be misused by folks, its not meant for just read-only data. There are performance reasons for using it, but we also don't provide any guidance about its use. Provide a bit more guidance over its use. Signed-off-by: Luis Chamberlain Signed-off-by: Andrew Morton Reviewed-by: Kees Cook Acked-by: Christoph Lameter Acked-by: Rafael Aquini Cc: Arnd Bergmann Cc: Matthew Wilcox Link: http://lkml.kernel.org/r/20200507161424.2584-1-mcgrof@kernel.org Signed-off-by: Linus Torvalds commit 2a71e81d32198785387c8bc0f2cc5d78f84e2e78 Author: Christoph Hellwig Date: Mon Jun 8 21:35:04 2020 -0700 maccess: return -ERANGE when probe_kernel_read() fails Allow the callers to distinguish a real unmapped address vs a range that can't be probed. Suggested-by: Masami Hiramatsu Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Reviewed-by: Masami Hiramatsu Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-24-hch@lst.de Signed-off-by: Linus Torvalds commit fa94111d94354de76c47fea6e1187d1ee91e23a7 Author: Christoph Hellwig Date: Mon Jun 8 21:35:01 2020 -0700 x86: use non-set_fs based maccess routines Provide arch_kernel_read and arch_kernel_write routines to implement the maccess routines without messing with set_fs and without stac/clac that opens up access to user space. [akpm@linux-foundation.org: coding style fixes] Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-20-hch@lst.de Signed-off-by: Linus Torvalds commit b58294ead14cde8081853487929adca821ed630d Author: Christoph Hellwig Date: Mon Jun 8 21:34:58 2020 -0700 maccess: allow architectures to provide kernel probing directly Provide alternative versions of probe_kernel_read, probe_kernel_write and strncpy_from_kernel_unsafe that don't need set_fs magic, but instead use arch hooks that are modelled after unsafe_{get,put}_user to access kernel memory in an exception safe way. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-19-hch@lst.de Signed-off-by: Linus Torvalds commit fc3562d79456bf1740b44d84b8726d20de8d39bd Author: Christoph Hellwig Date: Mon Jun 8 21:34:55 2020 -0700 maccess: move user access routines together Move kernel access vs user access routines together to ease upcoming ifdefs. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-18-hch@lst.de Signed-off-by: Linus Torvalds commit 98a23609b10364a51a1bb3688f8dd1cd1aa94a9a Author: Christoph Hellwig Date: Mon Jun 8 21:34:50 2020 -0700 maccess: always use strict semantics for probe_kernel_read Except for historical confusion in the kprobes/uprobes and bpf tracers, which has been fixed now, there is no good reason to ever allow user memory accesses from probe_kernel_read. Switch probe_kernel_read to only read from kernel memory. [akpm@linux-foundation.org: update it for "mm, dump_page(): do not crash with invalid mapping pointer"] Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-17-hch@lst.de Signed-off-by: Linus Torvalds commit 7676fbf21b5fa04341c8046c2cbcd1949293e7ec Author: Christoph Hellwig Date: Mon Jun 8 21:34:47 2020 -0700 maccess: remove strncpy_from_unsafe All users are gone now. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-16-hch@lst.de Signed-off-by: Linus Torvalds commit 9de1fec50b23117f0a19f7609cc837ca72e764a6 Author: Christoph Hellwig Date: Mon Jun 8 21:34:44 2020 -0700 tracing/kprobes: handle mixed kernel/userspace probes better Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe helpers, rework probes to try a user probe based on the address if the architecture has a common address space for kernel and userspace. [svens@linux.ibm.com:use strncpy_from_kernel_nofault() in fetch_store_string()] Link: http://lkml.kernel.org/r/20200606181903.49384-1-svens@linux.ibm.com Signed-off-by: Christoph Hellwig Signed-off-by: Sven Schnelle Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-15-hch@lst.de Signed-off-by: Linus Torvalds commit 8d92db5c04d10381f4db70ed99b1b576f5db18a7 Author: Christoph Hellwig Date: Mon Jun 8 21:34:40 2020 -0700 bpf: rework the compat kernel probe handling Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe helpers, rework the compat probes to check if an address is a kernel or userspace one, and then use the low-level kernel or user probe helper shared by the proper kernel and user probe helpers. This slightly changes behavior as the compat probe on a user address doesn't check the lockdown flags, just as the pure user probes do. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-14-hch@lst.de Signed-off-by: Linus Torvalds commit 19c8d8ac63d39578483db0b82107c172d8edfb07 Author: Andrew Morton Date: Mon Jun 8 21:34:37 2020 -0700 bpf:bpf_seq_printf(): handle potentially unsafe format string better User the proper helper for kernel or userspace addresses based on TASK_SIZE instead of the dangerous strncpy_from_unsafe function. Signed-off-by: Andrew Morton Cc: Christoph Hellwig Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Signed-off-by: Linus Torvalds commit aec6ce59133edc4ac04f7d4e2556fdf047becb62 Author: Christoph Hellwig Date: Mon Jun 8 21:34:33 2020 -0700 bpf: handle the compat string in bpf_trace_copy_string better User the proper helper for kernel or userspace addresses based on TASK_SIZE instead of the dangerous strncpy_from_unsafe function. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-13-hch@lst.de Signed-off-by: Linus Torvalds commit d7b2977b816223a884814eea46fbe38e192cec4c Author: Christoph Hellwig Date: Mon Jun 8 21:34:30 2020 -0700 bpf: factor out a bpf_trace_copy_string helper Split out a helper to do the fault free access to the string pointer to get it out of a crazy indentation level. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-12-hch@lst.de Signed-off-by: Linus Torvalds commit eab0c6089b68974ebc6a9a7eab68456eeb6a99c7 Author: Christoph Hellwig Date: Mon Jun 8 21:34:27 2020 -0700 maccess: unify the probe kernel arch hooks Currently architectures have to override every routine that probes kernel memory, which includes a pure read and strcpy, both in strict and not strict variants. Just provide a single arch hooks instead to make sure all architectures cover all the cases. [akpm@linux-foundation.org: fix !CONFIG_X86_64 build] Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-11-hch@lst.de Signed-off-by: Linus Torvalds commit cd0309058f849257f08d1a3dd0c384d1fd20c1e8 Author: Christoph Hellwig Date: Mon Jun 8 21:34:24 2020 -0700 maccess: remove probe_read_common and probe_write_common Each of the helpers has just two callers, which also different in dealing with kernel or userspace pointers. Just open code the logic in the callers. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-10-hch@lst.de Signed-off-by: Linus Torvalds commit 02dddb160ec1dccb51e75f3113654a090bc3963a Author: Christoph Hellwig Date: Mon Jun 8 21:34:20 2020 -0700 maccess: rename strnlen_unsafe_user to strnlen_user_nofault This matches the naming of strnlen_user, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-9-hch@lst.de Signed-off-by: Linus Torvalds commit c4cb164426aebd635baa53685b0ebf1a127e9803 Author: Christoph Hellwig Date: Mon Jun 8 21:34:17 2020 -0700 maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault This matches the naming of strncpy_from_user_nofault, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-8-hch@lst.de Signed-off-by: Linus Torvalds commit bd88bb5d4007949be7154deae7cef7173c751a95 Author: Christoph Hellwig Date: Mon Jun 8 21:34:14 2020 -0700 maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault This matches the naming of strncpy_from_user, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-7-hch@lst.de Signed-off-by: Linus Torvalds commit 3f0acb1eb3221b37daf065a84df6360e69c1b516 Author: Christoph Hellwig Date: Mon Jun 8 21:34:11 2020 -0700 maccess: update the top of file comment This file now also contains several helpers for accessing user memory. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-6-hch@lst.de Signed-off-by: Linus Torvalds commit 4f6de12b375c37ba51f9412be7ed6ab44a7f71d8 Author: Christoph Hellwig Date: Mon Jun 8 21:34:07 2020 -0700 maccess: clarify kerneldoc comments Add proper kerneldoc comments for probe_kernel_read_strict and probe_kernel_read strncpy_from_unsafe_strict and explain the different versus the non-strict version. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-5-hch@lst.de Signed-off-by: Linus Torvalds commit 3ed740841bf94a8028ec44164d84f9af9bd552fd Author: Christoph Hellwig Date: Mon Jun 8 21:34:04 2020 -0700 maccess: remove duplicate kerneldoc comments Many of the maccess routines have a copy of the kerneldoc comment in the header. Remove it as it is not useful and will get out of sync sooner or later. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-4-hch@lst.de Signed-off-by: Linus Torvalds commit 48c49c0e5f318e7c329d9a0ee6facce30bbb28e6 Author: Christoph Hellwig Date: Mon Jun 8 21:34:01 2020 -0700 maccess: remove various unused weak aliases maccess tends to define lots of underscore prefixed symbols that then have other weak aliases. But except for two cases they are never actually used, so remove them. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-3-hch@lst.de Signed-off-by: Linus Torvalds commit 0493cb086353e786be56010780a0b7025b5db34c Author: Christoph Hellwig Date: Mon Jun 8 21:33:58 2020 -0700 maccess: unexport probe_kernel_write() Patch series "clean up and streamline probe_kernel_* and friends", v4. This series start cleaning up the safe kernel and user memory probing helpers in mm/maccess.c, and then allows architectures to implement the kernel probing without overriding the address space limit and temporarily allowing access to user memory. It then switches x86 over to this new mechanism by reusing the unsafe_* uaccess logic. This version also switches to the saner copy_{from,to}_kernel_nofault naming suggested by Linus. I kept the x86 helpers as-is without calling unsage_{get,put}_user as that avoids a number of hard to trace casts, and it will still work with the asm-goto based version easily. This patch (of 20): probe_kernel_write() is not used by any modular code. [sfr@canb.auug.org.au: turns out that probe_user_write is used in modular code] Link: http://lkml.kernel.org/r/20200602195741.4faaa348@canb.auug.org.au Signed-off-by: Christoph Hellwig Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Masami Hiramatsu Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200521152301.2587579-1-hch@lst.de Link: http://lkml.kernel.org/r/20200521152301.2587579-2-hch@lst.de Signed-off-by: Linus Torvalds commit c1e8d7c6a7a682e1405e3e242d32fc377fd196ff Author: Michel Lespinasse Date: Mon Jun 8 21:33:54 2020 -0700 mmap locking API: convert mmap_sem comments Convert comments that reference mmap_sem to reference mmap_lock instead. [akpm@linux-foundation.org: fix up linux-next leftovers] [akpm@linux-foundation.org: s/lockaphore/lock/, per Vlastimil] [akpm@linux-foundation.org: more linux-next fixups, per Michel] Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Vlastimil Babka Reviewed-by: Daniel Jordan Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Laurent Dufour Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-13-walken@google.com Signed-off-by: Linus Torvalds commit 3e4e28c5a8f01ee4174d639e36ed155ade489a6f Author: Michel Lespinasse Date: Mon Jun 8 21:33:51 2020 -0700 mmap locking API: convert mmap_sem API comments Convert comments that reference old mmap_sem APIs to reference corresponding new mmap locking APIs instead. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Reviewed-by: Daniel Jordan Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Laurent Dufour Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-12-walken@google.com Signed-off-by: Linus Torvalds commit da1c55f1b272f4bd54671d459b39ea7b54944ef9 Author: Michel Lespinasse Date: Mon Jun 8 21:33:47 2020 -0700 mmap locking API: rename mmap_sem to mmap_lock Rename the mmap_sem field to mmap_lock. Any new uses of this lock should now go through the new mmap locking api. The mmap_lock is still implemented as a rwsem, though this could change in the future. [akpm@linux-foundation.org: fix it for mm-gup-might_lock_readmmap_sem-in-get_user_pages_fast.patch] Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Reviewed-by: Daniel Jordan Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Laurent Dufour Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-11-walken@google.com Signed-off-by: Linus Torvalds commit 42fc541404f249778e752ab39c8bc25fcb2dbe1e Author: Michel Lespinasse Date: Mon Jun 8 21:33:44 2020 -0700 mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked() Add new APIs to assert that mmap_sem is held. Using this instead of rwsem_is_locked and lockdep_assert_held[_write] makes the assertions more tolerant of future changes to the lock type. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Vlastimil Babka Reviewed-by: Daniel Jordan Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Laurent Dufour Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-10-walken@google.com Signed-off-by: Linus Torvalds commit 14c3656b7284a8649496584869e8c6642ec1abbb Author: Michel Lespinasse Date: Mon Jun 8 21:33:40 2020 -0700 mmap locking API: add MMAP_LOCK_INITIALIZER Define a new initializer for the mmap locking api. Initially this just evaluates to __RWSEM_INITIALIZER as the API is defined as wrappers around rwsem. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Reviewed-by: Daniel Jordan Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-9-walken@google.com Signed-off-by: Linus Torvalds commit 0cc55a0213a02b760ade1d4755fdccfbf7d3157e Author: Michel Lespinasse Date: Mon Jun 8 21:33:37 2020 -0700 mmap locking API: add mmap_read_trylock_non_owner() Add a couple APIs used by kernel/bpf/stackmap.c only: - mmap_read_trylock_non_owner() - mmap_read_unlock_non_owner() (may be called from a work queue). It's still not ideal that bpf/stackmap subverts the lock ownership in this way. Thanks to Peter Zijlstra for suggesting this API as the least-ugly way of addressing this in the short term. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Laurent Dufour Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-8-walken@google.com Signed-off-by: Linus Torvalds commit aaa2cc56c1cd757efec88a4978ffce4cbf884352 Author: Michel Lespinasse Date: Mon Jun 8 21:33:33 2020 -0700 mmap locking API: convert nested write lock sites Add API for nested write locks and convert the few call sites doing that. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-7-walken@google.com Signed-off-by: Linus Torvalds commit 89154dd5313f774d3a592451360b78442571b1f8 Author: Michel Lespinasse Date: Mon Jun 8 21:33:29 2020 -0700 mmap locking API: convert mmap_sem call sites missed by coccinelle Convert the last few remaining mmap_sem rwsem calls to use the new mmap locking API. These were missed by coccinelle for some reason (I think coccinelle does not support some of the preprocessor constructs in these files ?) [akpm@linux-foundation.org: convert linux-next leftovers] [akpm@linux-foundation.org: more linux-next leftovers] [akpm@linux-foundation.org: more linux-next leftovers] Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-6-walken@google.com Signed-off-by: Linus Torvalds commit d8ed45c5dcd455fc5848d47f86883a1b872ac0d0 Author: Michel Lespinasse Date: Mon Jun 8 21:33:25 2020 -0700 mmap locking API: use coccinelle to convert mmap_sem rwsem call sites This change converts the existing mmap_sem rwsem calls to use the new mmap locking API instead. The change is generated using coccinelle with the following rule: // spatch --sp-file mmap_lock_api.cocci --in-place --include-headers --dir . @@ expression mm; @@ ( -init_rwsem +mmap_init_lock | -down_write +mmap_write_lock | -down_write_killable +mmap_write_lock_killable | -down_write_trylock +mmap_write_trylock | -up_write +mmap_write_unlock | -downgrade_write +mmap_write_downgrade | -down_read +mmap_read_lock | -down_read_killable +mmap_read_lock_killable | -down_read_trylock +mmap_read_trylock | -up_read +mmap_read_unlock ) -(&mm->mmap_sem) +(mm) Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-5-walken@google.com Signed-off-by: Linus Torvalds commit 0adf65f53aae86aa86d8dccada02890545de8938 Author: Michel Lespinasse Date: Mon Jun 8 21:33:21 2020 -0700 DMA reservations: use the new mmap locking API This use is converted manually ahead of the next patch in the series, as it requires including a new header which the automated conversion would miss. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Cc: Davidlohr Bueso Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-4-walken@google.com Signed-off-by: Linus Torvalds commit b72327fc8dfc1babce18526239b08724b95ef5f0 Author: Michel Lespinasse Date: Mon Jun 8 21:33:18 2020 -0700 MMU notifier: use the new mmap locking API This use is converted manually ahead of the next patch in the series, as it requires including a new header which the automated conversion would miss. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Davidlohr Bueso Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Cc: David Rientjes Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Liam Howlett Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Ying Han Link: http://lkml.kernel.org/r/20200520052908.204642-3-walken@google.com Signed-off-by: Linus Torvalds commit 9740ca4e95b43b91a4a848694a20d01ba6818f7b Author: Michel Lespinasse Date: Mon Jun 8 21:33:14 2020 -0700 mmap locking API: initial implementation as rwsem wrappers This patch series adds a new mmap locking API replacing the existing mmap_sem lock and unlocks. Initially the API is just implemente in terms of inlined rwsem calls, so it doesn't provide any new functionality. There are two justifications for the new API: - At first, it provides an easy hooking point to instrument mmap_sem locking latencies independently of any other rwsems. - In the future, it may be a starting point for replacing the rwsem implementation with a different one, such as range locks. This is something that is being explored, even though there is no wide concensus about this possible direction yet. (see https://patchwork.kernel.org/cover/11401483/) This patch (of 12): This change wraps the existing mmap_sem related rwsem calls into a new mmap locking API. There are two justifications for the new API: - At first, it provides an easy hooking point to instrument mmap_sem locking latencies independently of any other rwsems. - In the future, it may be a starting point for replacing the rwsem implementation with a different one, such as range locks. Signed-off-by: Michel Lespinasse Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: Davidlohr Bueso Reviewed-by: Laurent Dufour Reviewed-by: Vlastimil Babka Cc: Peter Zijlstra Cc: Matthew Wilcox Cc: Liam Howlett Cc: Jerome Glisse Cc: David Rientjes Cc: Hugh Dickins Cc: Ying Han Cc: Jason Gunthorpe Cc: John Hubbard Cc: Michel Lespinasse Link: http://lkml.kernel.org/r/20200520052908.204642-1-walken@google.com Link: http://lkml.kernel.org/r/20200520052908.204642-2-walken@google.com Signed-off-by: Linus Torvalds commit 974b9b2c68f3d35a65e80af9657fe378d2439b60 Author: Mike Rapoport Date: Mon Jun 8 21:33:10 2020 -0700 mm: consolidate pte_index() and pte_offset_*() definitions All architectures define pte_index() as (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1) and all architectures define pte_offset_kernel() as an entry in the array of PTEs indexed by the pte_index(). For the most architectures the pte_offset_kernel() implementation relies on the availability of pmd_page_vaddr() that converts a PMD entry value to the virtual address of the page containing PTEs array. Let's move x86 definitions of the PTE accessors to the generic place in and then simply drop the respective definitions from the other architectures. The architectures that didn't provide pmd_page_vaddr() are updated to have that defined. The generic implementation of pte_offset_kernel() can be overridden by an architecture and alpha makes use of this because it has special ordering requirements for its version of pte_offset_kernel(). [rppt@linux.ibm.com: v2] Link: http://lkml.kernel.org/r/20200514170327.31389-11-rppt@kernel.org [rppt@linux.ibm.com: update] Link: http://lkml.kernel.org/r/20200514170327.31389-12-rppt@kernel.org [rppt@linux.ibm.com: update] Link: http://lkml.kernel.org/r/20200514170327.31389-13-rppt@kernel.org [akpm@linux-foundation.org: fix x86 warning] [sfr@canb.auug.org.au: fix powerpc build] Link: http://lkml.kernel.org/r/20200607153443.GB738695@linux.ibm.com Signed-off-by: Mike Rapoport Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-10-rppt@kernel.org Signed-off-by: Linus Torvalds commit e05c7b1f2bc4b7b28199b9a7572f73436d97317e Author: Mike Rapoport Date: Mon Jun 8 21:33:05 2020 -0700 mm: pgtable: add shortcuts for accessing kernel PMD and PTE The powerpc 32-bit implementation of pgtable has nice shortcuts for accessing kernel PMD and PTE for a given virtual address. Make these helpers available for all architectures. [rppt@linux.ibm.com: microblaze: fix page table traversal in setup_rt_frame()] Link: http://lkml.kernel.org/r/20200518191511.GD1118872@kernel.org [akpm@linux-foundation.org: s/pmd_ptr_k/pmd_off_k/ in various powerpc places] Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-9-rppt@kernel.org Signed-off-by: Linus Torvalds commit 88107d330de4f175705a3ea03147feb0d7e68499 Author: Mike Rapoport Date: Mon Jun 8 21:33:01 2020 -0700 x86/mm: simplify init_trampoline() and surrounding logic There are three cases for the trampoline initialization: * 32-bit does nothing * 64-bit with kaslr disabled simply copies a PGD entry from the direct map to the trampoline PGD * 64-bit with kaslr enabled maps the real mode trampoline at PUD level These cases are currently differentiated by a bunch of ifdefs inside asm/include/pgtable.h and the case of 64-bits with kaslr on uses pgd_index() helper. Replacing the ifdefs with a static function in arch/x86/mm/init.c gives clearer code and allows moving pgd_index() to the generic implementation in include/linux/pgtable.h [rppt@linux.ibm.com: take CONFIG_RANDOMIZE_MEMORY into account in kaslr_enabled()] Link: http://lkml.kernel.org/r/20200525104045.GB13212@linux.ibm.com Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-8-rppt@kernel.org Signed-off-by: Linus Torvalds commit 1bcdc68d6a69440ff82c3e492cd383059852bdd7 Author: Mike Rapoport Date: Mon Jun 8 21:32:56 2020 -0700 m68k/mm: move {cache,nocahe}_page() definitions close to their user The cache_page() and nocache_page() functions are only used by the motorola MMU variant for setting caching attributes for the page table pages. Move the definitions of these functions from arch/m68k/include/asm/motorola_pgtable.h closer to their usage in arch/m68k/mm/motorola.c and drop unused definition in arch/m68k/include/asm/mcf_pgtable.h. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Acked-by: Greg Ungerer Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-7-rppt@kernel.org Signed-off-by: Linus Torvalds commit e73240be691e1b081190125da67cd38822b8d5f8 Author: Mike Rapoport Date: Mon Jun 8 21:32:51 2020 -0700 m68k/mm/motorola: move comment about page table allocation funcitons The comment about page table allocation functions resides in include/asm/motorola_pgtable.h while the functions live in include/asm/motorola_pgaloc.h. Move the comment close to the code. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-6-rppt@kernel.org Signed-off-by: Linus Torvalds commit c910951a85d8fef5a8dabe08df45201f0637690a Author: Mike Rapoport Date: Mon Jun 8 21:32:47 2020 -0700 csky: replace definitions of __pXd_offset() with pXd_index() All architectures use pXd_index() to get an entry in the page table page corresponding to a virtual address. Align csky with other architectures. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-5-rppt@kernel.org Signed-off-by: Linus Torvalds commit 65fddcfca8ad14778f71a57672fd01e8112d30fa Author: Mike Rapoport Date: Mon Jun 8 21:32:42 2020 -0700 mm: reorder includes after introduction of linux/pgtable.h The replacement of with made the include of the latter in the middle of asm includes. Fix this up with the aid of the below script and manual adjustments here and there. import sys import re if len(sys.argv) is not 3: print "USAGE: %s
" % (sys.argv[0]) sys.exit(1) hdr_to_move="#include " % sys.argv[2] moved = False in_hdrs = False with open(sys.argv[1], "r") as f: lines = f.readlines() for _line in lines: line = _line.rstrip(' ') if line == hdr_to_move: continue if line.startswith("#include Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-4-rppt@kernel.org Signed-off-by: Linus Torvalds commit ca5999fde0a1761665a38e4c9a72dbcd7d190a81 Author: Mike Rapoport Date: Mon Jun 8 21:32:38 2020 -0700 mm: introduce include/linux/pgtable.h The include/linux/pgtable.h is going to be the home of generic page table manipulation functions. Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and make the latter include asm/pgtable.h. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.org Signed-off-by: Linus Torvalds commit e31cf2f4ca422ac9b14ecc4a1295b8977a20f812 Author: Mike Rapoport Date: Mon Jun 8 21:32:33 2020 -0700 mm: don't include asm/pgtable.h if linux/mm.h is already included Patch series "mm: consolidate definitions of page table accessors", v2. The low level page table accessors (pXY_index(), pXY_offset()) are duplicated across all architectures and sometimes more than once. For instance, we have 31 definition of pgd_offset() for 25 supported architectures. Most of these definitions are actually identical and typically it boils down to, e.g. static inline unsigned long pmd_index(unsigned long address) { return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); } static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) { return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); } These definitions can be shared among 90% of the arches provided XYZ_SHIFT, PTRS_PER_XYZ and xyz_page_vaddr() are defined. For architectures that really need a custom version there is always possibility to override the generic version with the usual ifdefs magic. These patches introduce include/linux/pgtable.h that replaces include/asm-generic/pgtable.h and add the definitions of the page table accessors to the new header. This patch (of 12): The linux/mm.h header includes to allow inlining of the functions involving page table manipulations, e.g. pte_alloc() and pmd_alloc(). So, there is no point to explicitly include in the files that include . The include statements in such cases are remove with a simple loop: for f in $(git grep -l "include ") ; do sed -i -e '/include / d' $f done Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Rapoport Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200514170327.31389-1-rppt@kernel.org Link: http://lkml.kernel.org/r/20200514170327.31389-2-rppt@kernel.org Signed-off-by: Linus Torvalds commit 9cb8f069deeed708bf19486d5893e297dc467ae0 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:29 2020 -0700 kernel: rename show_stack_loglvl() => show_stack() Now the last users of show_stack() got converted to use an explicit log level, show_stack_loglvl() can drop it's redundant suffix and become once again well known show_stack(). Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200418201944.482088-51-dima@arista.com Signed-off-by: Linus Torvalds commit fe1993a001094a596576334c56e7a10e4cd69e6c Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:26 2020 -0700 kernel: use show_stack_loglvl() Align the last users of show_stack() by KERN_DEFAULT as the surrounding headers/messages. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-50-dima@arista.com Signed-off-by: Linus Torvalds commit 8ba09b1dc131ff9bb530967c593e298c600f72c0 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:23 2020 -0700 sched: print stack trace with KERN_INFO Aligning with other messages printed in sched_show_task() - use KERN_INFO to print the backtrace. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Ben Segall Cc: Dietmar Eggemann Cc: Ingo Molnar Cc: Juri Lelli Cc: Mel Gorman Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Vincent Guittot Link: http://lkml.kernel.org/r/20200418201944.482088-49-dima@arista.com Signed-off-by: Linus Torvalds commit 77819daf247aad16beaeb537ae77d1d6d0697ca2 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:19 2020 -0700 kdb: don't play with console_loglevel Print the stack trace with KERN_EMERG - it should be always visible. Playing with console_loglevel is a bad idea as there may be more messages printed than wanted. Also the stack trace might be not printed at all if printk() was deferred and console_loglevel was raised back before the trace got flushed. Unfortunately, after rebasing on commit 2277b492582d ("kdb: Fix stack crawling on 'running' CPUs that aren't the master"), kdb_show_stack() uses now kdb_dump_stack_on_cpu(), which for now won't be converted as it uses dump_stack() instead of show_stack(). Convert for now the branch that uses show_stack() and remove console_loglevel exercise from that case. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Reviewed-by: Douglas Anderson Acked-by: Daniel Thompson Cc: Jason Wessel Link: http://lkml.kernel.org/r/20200418201944.482088-48-dima@arista.com Signed-off-by: Linus Torvalds commit 3f0543780e09d6f475f043f6ce0824106e610fd4 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:16 2020 -0700 power: use show_stack_loglvl() Aligning with other watchdog messages just before panic - use KERN_EMERG. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Acked-by: Rafael J. Wysocki Cc: Greg Kroah-Hartman Cc: Len Brown Cc: Pavel Machek Link: http://lkml.kernel.org/r/20200418201944.482088-47-dima@arista.com Signed-off-by: Linus Torvalds commit 9ed5b01a36a0e40a7450b8a5caf82e0552c41bb3 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:13 2020 -0700 x86/amd_gart: print stacktrace for a leak with KERN_ERR It's under CONFIG_IOMMU_LEAK option which is enabled by debug config. Likely the backtrace is worth to be seen - so aligning with log level of error message in iommu_full(). Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200418201944.482088-46-dima@arista.com Signed-off-by: Linus Torvalds commit ab34b46d1a74e98996e67a7da7e5d683ecfd9f57 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:10 2020 -0700 sysrq: use show_stack_loglvl() Show the stack trace on a CPU with the same log level as "CPU%d" header. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Greg Kroah-Hartman Cc: Jiri Slaby Link: http://lkml.kernel.org/r/20200418201944.482088-45-dima@arista.com Signed-off-by: Linus Torvalds commit 20da1e8bb06d0e3ccd172de3e193c987e88013cb Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:07 2020 -0700 xtensa: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Chris Zankel Cc: Max Filippov Link: http://lkml.kernel.org/r/20200418201944.482088-44-dima@arista.com Signed-off-by: Linus Torvalds commit 47fb70294976cb1ea110f4fc01ae1bc2f450933a Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:04 2020 -0700 xtensa: add loglvl to show_trace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to show_trace() as a preparation for introducing show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u [rppt@kernel.org: build fix] Link: http://lkml.kernel.org/r/20200511194534.GA1018386@kernel.org Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Chris Zankel Cc: Max Filippov Cc: Mike Rapoport Link: http://lkml.kernel.org/r/20200418201944.482088-43-dima@arista.com Signed-off-by: Linus Torvalds commit a832ff02244e36da0bf4bb3a1aec0ce9a23b0bad Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:32:00 2020 -0700 x86: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200418201944.482088-42-dima@arista.com Signed-off-by: Linus Torvalds commit d46b3df78ad4b4c178f1035a35463cbc0ce768b2 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:57 2020 -0700 x86: add missing const qualifiers for log_lvl Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Keep log_lvl const show_trace_log_lvl() and printk_stack_address() as the new generic show_stack_loglvl() wants to have a proper const qualifier. And gcc rightfully produces warnings in case it's not keept: arch/x86/kernel/dumpstack.c: In function `show_stack': arch/x86/kernel/dumpstack.c:294:37: warning: passing argument 4 of `show_trace_log_lv ' discards `const' qualifier from pointer target type [-Wdiscarded-qualifiers] 294 | show_trace_log_lvl(task, NULL, sp, loglvl); | ^~~~~~ arch/x86/kernel/dumpstack.c:163:32: note: expected `char *' but argument is of type `const char *' 163 | unsigned long *stack, char *log_lvl) | ~~~~~~^~~~~~~ [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200418201944.482088-41-dima@arista.com Signed-off-by: Linus Torvalds commit 5c0884694f7fd1efc846f720f10d190bf708e461 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:54 2020 -0700 unicore32: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). As a nice side-effect - print backtrace in __die() with the same log level as the rest of function. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Guan Xuetao Link: http://lkml.kernel.org/r/20200418201944.482088-40-dima@arista.com Signed-off-by: Linus Torvalds commit de985dd50158fedde5f2916c1bcf949a0acf5cd0 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:51 2020 -0700 unicore32: add loglvl to c_backtrace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level parameter to c_backtrace() as a preparation for introducing show_stack_loglvl() [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Guan Xuetao Link: http://lkml.kernel.org/r/20200418201944.482088-39-dima@arista.com Signed-off-by: Linus Torvalds commit ee1e99009e914e4150774f5a717c179545c7699e Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:48 2020 -0700 unicore32: remove unused pmode argument in c_backtrace() The pmode parameter isn't used in assembly - remove it. Second argument will be reused for printk() log level. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Guan Xuetao Link: http://lkml.kernel.org/r/20200418201944.482088-38-dima@arista.com Signed-off-by: Linus Torvalds commit 1ad87824f4cf16a7f381e1f94943a96bb7a99062 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:45 2020 -0700 um: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Anton Ivanov Cc: Jeff Dike Cc: Richard Weinberger Link: http://lkml.kernel.org/r/20200418201944.482088-37-dima@arista.com Signed-off-by: Linus Torvalds commit 3dd923f39a03dede001afe0edcc08613d5f403e5 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:42 2020 -0700 um/sysrq: remove needless variable sp `sp' is a needless excercise here. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Anton Ivanov Cc: Jeff Dike Cc: Richard Weinberger Link: http://lkml.kernel.org/r/20200418201944.482088-36-dima@arista.com Signed-off-by: Linus Torvalds commit 13c6371ae576840bcacc0fc8407d7b11572eb7fb Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:39 2020 -0700 sparc: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Acked-by: David S. Miller Link: http://lkml.kernel.org/r/20200418201944.482088-35-dima@arista.com Signed-off-by: Linus Torvalds commit e6e371c4f653db7581072a0a20b32a11a751ebda Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:36 2020 -0700 sh: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Rich Felker Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200418201944.482088-34-dima@arista.com Signed-off-by: Linus Torvalds commit 539e786cc37ee5cb6e051ef5eb72b7a7c03022cf Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:33 2020 -0700 sh: add loglvl to show_trace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level parameter to show_trace() as a preparation to introduce show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Rich Felker Link: http://lkml.kernel.org/r/20200418201944.482088-33-dima@arista.com Signed-off-by: Linus Torvalds commit 2deebe4d56d638269a4a728086d64de5734b460a Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:30 2020 -0700 sh: add loglvl to printk_address() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to printk_address() as a preparation to introduce show_stack_loglvl(). As a good side-effect show_fault_oops() now prints the address with KERN_EMREG as the rest of output, making sure there won't be situation where "PC: " is printed without actual address. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Rich Felker Link: http://lkml.kernel.org/r/20200418201944.482088-32-dima@arista.com Signed-off-by: Linus Torvalds commit 8b92f34877225c8eb85e3ab7f1177fc248ba26d0 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:27 2020 -0700 sh: remove needless printk() Currently `data' is always an empty line "". No need for additional printk() call. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Rich Felker Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200418201944.482088-31-dima@arista.com Signed-off-by: Linus Torvalds commit ebf0a36a32b25fe6ba8a1b6bd3135432ebd9aa5c Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:24 2020 -0700 sh: add loglvl to dump_mem() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to dump_mem() as a preparation to introduce show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Rich Felker Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200418201944.482088-30-dima@arista.com Signed-off-by: Linus Torvalds commit 8539c1288ddc23eef0fe71e1bcecc04b3fc6a9ee Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:20 2020 -0700 s390: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Vasily Gorbik Link: http://lkml.kernel.org/r/20200418201944.482088-29-dima@arista.com Signed-off-by: Linus Torvalds commit 0b3d43657489711bf927998fde82b5cc575d9400 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:17 2020 -0700 riscv: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Albert Ou Cc: Palmer Dabbelt Cc: Paul Walmsley Link: http://lkml.kernel.org/r/20200418201944.482088-28-dima@arista.com Signed-off-by: Linus Torvalds commit b9677a8cf60995acdd1b36ff59e6b437154bff9e Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:14 2020 -0700 powerpc: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Acked-by: Michael Ellerman (powerpc) Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Link: http://lkml.kernel.org/r/20200418201944.482088-27-dima@arista.com Signed-off-by: Linus Torvalds commit 3481d31bf7473ced5a39fbfd2786b141798b6764 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:11 2020 -0700 parisc: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Helge Deller Cc: "James E.J. Bottomley" Link: http://lkml.kernel.org/r/20200418201944.482088-26-dima@arista.com Signed-off-by: Linus Torvalds commit 0633032f083a53cd33f1171cca38c8ba835d1eba Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:08 2020 -0700 openrisc: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Jonas Bonn Cc: Stafford Horne Cc: Stefan Kristiansson Link: http://lkml.kernel.org/r/20200418201944.482088-25-dima@arista.com Signed-off-by: Linus Torvalds commit 351dd61c3821fe9b6702205d3a894004a9674295 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:05 2020 -0700 nios2: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Ley Foon Tan Link: http://lkml.kernel.org/r/20200418201944.482088-24-dima@arista.com Signed-off-by: Linus Torvalds commit 18a4753f90175a6acfefd4cf3da1bcb163e12216 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:31:02 2020 -0700 nds32: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Greentime Hu Cc: Vincent Chen Link: http://lkml.kernel.org/r/20200418201944.482088-23-dima@arista.com Signed-off-by: Linus Torvalds commit 96f0458a96892dd2f1589a7517724d541e1c4520 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:59 2020 -0700 mips: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: James Hogan Cc: Paul Burton Cc: Ralf Baechle Link: http://lkml.kernel.org/r/20200418201944.482088-22-dima@arista.com Signed-off-by: Linus Torvalds commit 35f3968b499c6dd026a828933b57ebdb11e74cff Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:56 2020 -0700 microblaze: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Michal Simek Link: http://lkml.kernel.org/r/20200418201944.482088-21-dima@arista.com Signed-off-by: Linus Torvalds commit 14b0dd870f6f3b28fad1235b70d1a692db1d6a2f Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:53 2020 -0700 microblaze: add loglvl to microblaze_unwind() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level parameter to microblaze_unwind() as a preparation to add show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Michal Simek Link: http://lkml.kernel.org/r/20200418201944.482088-20-dima@arista.com Signed-off-by: Linus Torvalds commit 77530a5277bcab0433d0f68af11e04a5c4d79039 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:50 2020 -0700 microblaze: add loglvl to microblaze_unwind_inner() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to microblaze_unwind_inner() as a preparation for introducing show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Michal Simek Link: http://lkml.kernel.org/r/20200418201944.482088-19-dima@arista.com Signed-off-by: Linus Torvalds commit ce23c47a5632612dfaa80bd8f861256a419c0abf Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:47 2020 -0700 m68k: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Geert Uytterhoeven Link: http://lkml.kernel.org/r/20200418201944.482088-18-dima@arista.com Signed-off-by: Linus Torvalds commit ffdac29e40545cfb21d347c67daeb72541792ec8 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:44 2020 -0700 ia64: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Fenghua Yu Cc: Tony Luck Link: http://lkml.kernel.org/r/20200418201944.482088-17-dima@arista.com Signed-off-by: Linus Torvalds commit c261ad6ee80e337fb01a9cee91241f195c80f3d1 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:41 2020 -0700 ia64: pass log level as arg into ia64_do_show_stack() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to ia64_do_show_stack() as a preparation to introduce show_stack_loglvl(). Also, make ia64_do_show_stack() static as it's not used outside. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Fenghua Yu Cc: Tony Luck Link: http://lkml.kernel.org/r/20200418201944.482088-16-dima@arista.com Signed-off-by: Linus Torvalds commit d1e9086dd99b2501a692e9dbccdb211ac6e09d14 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:38 2020 -0700 hexagon: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). As a good side-effect die() now prints the stacktrace with KERN_EMERG aligned with other messages. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Acked-by: Brian Cain Link: http://lkml.kernel.org/r/20200418201944.482088-15-dima@arista.com Signed-off-by: Linus Torvalds commit 0b2ad0c7ae0fb37dee4e8ae36b887c1d4db1f898 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:35 2020 -0700 h8300: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200418201944.482088-14-dima@arista.com Signed-off-by: Linus Torvalds commit aeeb59d692c1bafecde3dfc47bfd0958fc96dfad Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:32 2020 -0700 csky: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Guo Ren Link: http://lkml.kernel.org/r/20200418201944.482088-13-dima@arista.com Signed-off-by: Linus Torvalds commit a1eea2efdcaa69275294ea2432114369c14b2b8f Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:29 2020 -0700 c6x: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Aurelien Jacquiot Cc: Mark Salter Link: http://lkml.kernel.org/r/20200418201944.482088-12-dima@arista.com Signed-off-by: Linus Torvalds commit c0fe096a8aba4b00c2a928c22b7f6a3ce3e9ca97 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:26 2020 -0700 arm64: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Catalin Marinas Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-11-dima@arista.com Signed-off-by: Linus Torvalds commit c76898373f9b71586edaf150190c493ae9ed3e77 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:23 2020 -0700 arm64: add loglvl to dump_backtrace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to dump_backtrace() as a preparation for introducing show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Catalin Marinas Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-10-dima@arista.com Signed-off-by: Linus Torvalds commit a4502d04c7dd075846bb70ebfde3843f9df86f98 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:19 2020 -0700 arm: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-9-dima@arista.com Signed-off-by: Linus Torvalds commit 34135eacae6497d9c7bfca450f6c33e5245c92d2 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:16 2020 -0700 arm: wire up dump_backtrace_{entry,stm} Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Now that c_backtrace() always emits correct loglvl, use it for printing. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-8-dima@arista.com Signed-off-by: Linus Torvalds commit ee65ca01c62cd89cea6192017806b55c34f1cfda Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:13 2020 -0700 arm: add loglvl to dump_backtrace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to dump_backtrace() as a preparation for introducing show_stack_loglvl(). As a good side-effect __die() now prints not only "Stack:" header with KERN_EMERG, but the backtrace itself. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-7-dima@arista.com Signed-off-by: Linus Torvalds commit e8d7b7353216586f64f5bbcc024951e3cab10a60 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:10 2020 -0700 arm: add loglvl to unwind_backtrace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to unwind_backtrace() as a preparation for introducing show_stack_loglvl(). As a good side-effect arm_syscall() is now printing errors with the same log level as the backtrace. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-6-dima@arista.com Signed-off-by: Linus Torvalds commit 5489ab50c22771ddcad014968141b0d104d650a3 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:07 2020 -0700 arm/asm: add loglvl to c_backtrace() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Add log level argument to c_backtrace() as a preparation for introducing show_stack_loglvl(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Russell King Cc: Will Deacon Link: http://lkml.kernel.org/r/20200418201944.482088-5-dima@arista.com Signed-off-by: Linus Torvalds commit 8ca4d19932a5649930db29202b285d8e4e96a98a Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:04 2020 -0700 arc: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). As a good side-effect header "Stack Trace:" is now printed with the same log level as the rest of backtrace. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Vineet Gupta Link: http://lkml.kernel.org/r/20200418201944.482088-4-dima@arista.com Signed-off-by: Linus Torvalds commit 8c49a909872ca757a62ccbfca08784c224d20fdc Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:30:01 2020 -0700 alpha: add show_stack_loglvl() Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In result, some users as sysrq/kdb/etc are doing tricks with temporary rising console_loglevel while printing their messages. And in result it not only may print unwanted messages from other CPUs, but also omit printing at all in the unlucky case where the printk() was deferred. Introducing log-level parameter and KERN_UNSUPPRESSED [1] seems an easier approach than introducing more printk buffers. Also, it will consolidate printings with headers. Introduce show_stack_loglvl(), that eventually will substitute show_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/T/#u Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Link: http://lkml.kernel.org/r/20200418201944.482088-3-dima@arista.com Signed-off-by: Linus Torvalds commit 2062a4e8ae9f486847652927aaf88e21ab8d195d Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Jun 8 21:29:56 2020 -0700 kallsyms/printk: add loglvl to print_ip_sym() Patch series "Add log level to show_stack()", v3. Add log level argument to show_stack(). Done in three stages: 1. Introducing show_stack_loglvl() for every architecture 2. Migrating old users with an explicit log level 3. Renaming show_stack_loglvl() into show_stack() Justification: - It's a design mistake to move a business-logic decision into platform realization detail. - I have currently two patches sets that would benefit from this work: Removing console_loglevel jumps in sysrq driver [1] Hung task warning before panic [2] - suggested by Tetsuo (but he probably didn't realise what it would involve). - While doing (1), (2) the backtraces were adjusted to headers and other messages for each situation - so there won't be a situation when the backtrace is printed, but the headers are missing because they have lesser log level (or the reverse). - As the result in (2) plays with console_loglevel for kdb are removed. The least important for upstream, but maybe still worth to note that every company I've worked in so far had an off-list patch to print backtrace with the needed log level (but only for the architecture they cared about). If you have other ideas how you will benefit from show_stack() with a log level - please, reply to this cover letter. See also discussion on v1: https://lore.kernel.org/linux-riscv/20191106083538.z5nlpuf64cigxigh@pathway.suse.cz/ This patch (of 50): print_ip_sym() needs to have a log level parameter to comply with other parts being printed. Otherwise, half of the expected backtrace would be printed and other may be missing with some logging level. The following callee(s) are using now the adjusted log level: - microblaze/unwind: the same level as headers & userspace unwind. Note that pr_debug()'s there are for debugging the unwinder itself. - nds32/traps: symbol addresses are printed with the same log level as backtrace headers. - lockdep: ip for locking issues is printed with the same log level as other part of the warning. - sched: ip where preemption was disabled is printed as error like the rest part of the message. - ftrace: bug reports are now consistent in the log level being used. Signed-off-by: Dmitry Safonov Signed-off-by: Andrew Morton Acked-by: Steven Rostedt (VMware) Cc: Albert Ou Cc: Ben Segall Cc: Dietmar Eggemann Cc: Greentime Hu Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Hogan Cc: Juri Lelli Cc: Mel Gorman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Burton Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Ralf Baechle Cc: Thomas Gleixner Cc: Vincent Chen Cc: Vincent Guittot Cc: Will Deacon Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Dmitry Safonov Cc: Jiri Slaby Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Aurelien Jacquiot Cc: Mark Salter Cc: Guo Ren Cc: Yoshinori Sato Cc: Brian Cain Cc: Fenghua Yu Cc: Tony Luck Cc: Geert Uytterhoeven Cc: Ley Foon Tan Cc: Jonas Bonn Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Paul Mackerras Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Rich Felker Cc: "David S. Miller" Cc: Anton Ivanov Cc: Jeff Dike Cc: Richard Weinberger Cc: Guan Xuetao Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Chris Zankel Cc: Max Filippov Cc: Len Brown Cc: Pavel Machek Cc: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" Cc: Daniel Thompson Cc: Douglas Anderson Cc: Jason Wessel Link: http://lkml.kernel.org/r/20200418201944.482088-2-dima@arista.com Signed-off-by: Linus Torvalds commit 8b4d37db9a566deaf22065ba1ba9b19c9fb964b4 Merge: abfbb29297c2 3798cc4d106e Author: Linus Torvalds Date: Tue Jun 9 09:30:21 2020 -0700 Merge branch 'x86/srbds' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 srbds fixes from Thomas Gleixner: "The 9th episode of the dime novel "The performance killer" with the subtitle "Slow Randomizing Boosts Denial of Service". SRBDS is an MDS-like speculative side channel that can leak bits from the random number generator (RNG) across cores and threads. New microcode serializes the processor access during the execution of RDRAND and RDSEED. This ensures that the shared buffer is overwritten before it is released for reuse. This is equivalent to a full bus lock, which means that many threads running the RNG instructions in parallel have the same effect as the same amount of threads issuing a locked instruction targeting an address which requires locking of two cachelines at once. The mitigation support comes with the usual pile of unpleasant ingredients: - command line options - sysfs file - microcode checks - a list of vulnerable CPUs identified by model and stepping this time which requires stepping match support for the cpu match logic. - the inevitable slowdown of affected CPUs" * branch 'x86/srbds' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation: Add Ivy Bridge to affected list x86/speculation: Add SRBDS vulnerability and mitigation documentation x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation x86/cpu: Add 'table' argument to cpu_matches() commit 9ca0652596bd924a4023db6b429a0aaaea629826 Author: David Howells Date: Tue Jun 9 16:15:45 2020 +0100 afs: Fix use of BUG() Fix afs_compare_addrs() to use WARN_ON(1) instead of BUG() and return 1 (ie. srx_a > srx_b). There's no point trying to put actual error handling in as this should not occur unless a new transport address type is allowed by AFS. And even if it does, in this particular case, it'll just never match unknown types of addresses. This BUG() was more of a 'you need to add a case here' indicator. Reported-by: Kees Cook Signed-off-by: David Howells Reviewed-by: Kees Cook commit ffaecd7d1f88a955f0b321749de8c0158f973afd Author: Ian Rogers Date: Mon Jun 8 22:36:10 2020 -0700 perf parse-events: Fix an old style declaration Fixes: a26e47162d76 (perf tools: Move ALLOC_LIST into a function) Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200609053610.206588-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c2412fae3f01725615b0de472095a9e16ed30ca9 Author: Ian Rogers Date: Mon Jun 8 22:36:09 2020 -0700 perf parse-events: Fix an incompatible pointer Arrays are pointer types and don't need their address taking. Fixes: 8255718f4bed (perf pmu: Expand PMU events by prefix match) Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200609053610.206588-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d38c692f160ea437585cb1ad1dc8f81c8898b46e Author: Sumanth Korikkar Date: Tue Jun 9 10:10:19 2020 +0200 perf bpf: Fix bpf prologue generation Issue: bpf_probe_read() is no longer available for architecture which has overlapping address space. Hence bpf prologue generation fails Fix: Use bpf_probe_read_kernel for kernel member access. For user attribute access in kprobes, use bpf_probe_read_user. Other: @user attribute was introduced in commit 1e032f7cfa14 ("perf-probe: Add user memory access attribute support") Test: 1. ulimit -l 128 ; ./perf record -e tests/bpf_sched_setscheduler.c 2. cat tests/bpf_sched_setscheduler.c static void (*bpf_trace_printk)(const char *fmt, int fmt_size, ...) = (void *) 6; static int (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 112; static int (*bpf_probe_read_kernel)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 113; SEC("func=do_sched_setscheduler pid policy param->sched_priority@user") int bpf_func__setscheduler(void *ctx, int err, pid_t pid, int policy, int param) { char fmt[] = "prio: %ld"; bpf_trace_printk(fmt, sizeof(fmt), param); return 1; } char _license[] SEC("license") = "GPL"; int _version SEC("version") = LINUX_VERSION_CODE; 3. ./perf script sched 305669 [000] 1614458.838675: perf_bpf_probe:func: (2904e508) pid=261614 policy=2 sched_priority=1 4. cat /sys/kernel/debug/tracing/trace <...>-309956 [006] .... 1616098.093957: 0: prio: 1 Committer testing: I had to add some missing headers in the bpf_sched_setscheduler.c test proggie, then instead of using record+script I used 'perf trace' to drive everything in one go: # cat bpf_sched_setscheduler.c #include #include static void (*bpf_trace_printk)(const char *fmt, int fmt_size, ...) = (void *) 6; static int (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 112; static int (*bpf_probe_read_kernel)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 113; SEC("func=do_sched_setscheduler pid policy param->sched_priority@user") int bpf_func__setscheduler(void *ctx, int err, pid_t pid, int policy, int param) { char fmt[] = "prio: %ld"; bpf_trace_printk(fmt, sizeof(fmt), param); return 1; } char _license[] SEC("license") = "GPL"; int _version SEC("version") = LINUX_VERSION_CODE; # # # perf trace -e bpf_sched_setscheduler.c chrt -f 42 sleep 1 0.000 chrt/80125 perf_bpf_probe:func(__probe_ip: -1676607808, policy: 1, sched_priority: 42) # And even with backtraces :-) # perf trace -e bpf_sched_setscheduler.c/max-stack=8/ chrt -f 42 sleep 1 0.000 chrt/79805 perf_bpf_probe:func(__probe_ip: -1676607808, policy: 1, sched_priority: 42) do_sched_setscheduler ([kernel.kallsyms]) __x64_sys_sched_setscheduler ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64 ([kernel.kallsyms]) __GI___sched_setscheduler (/usr/lib64/libc-2.30.so) # Signed-off-by: Sumanth Korikkar Reviewed-by: Thomas Richter Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ilya Leoshkevich Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: bpf@vger.kernel.org LPU-Reference: 20200609081019.60234-3-sumanthk@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9256c3031eb9beafa3957c61093104c3c75a6148 Author: Sumanth Korikkar Date: Tue Jun 9 10:10:18 2020 +0200 perf probe: Fix user attribute access in kprobes Issue: # perf probe -a 'do_sched_setscheduler pid policy param->sched_priority@user' did not work before. Fix: Make: # perf probe -a 'do_sched_setscheduler pid policy param->sched_priority@user' output equivalent to ftrace: # echo 'p:probe/do_sched_setscheduler _text+517384 pid=%r2:s32 policy=%r3:s32 sched_priority=+u0(%r4):s32' > /sys/kernel/debug/tracing/kprobe_events Other: 1. Right now, __match_glob() does not handle [u]. For now, use *u]. 2. @user attribute was introduced in commit 1e032f7cfa14 ("perf-probe: Add user memory access attribute support") Test: 1. perf probe -a 'do_sched_setscheduler pid policy param->sched_priority@user' 2 ./perf script sched 305669 [000] 1614458.838675: perf_bpf_probe:func: (2904e508) pid=261614 policy=2 sched_priority=1 3. cat /sys/kernel/debug/tracing/trace <...>-309956 [006] .... 1616098.093957: 0: prio: 1 Committer testing: Before: # perf probe -a 'do_sched_setscheduler pid policy param->sched_priority@user' param(type:sched_param) has no member sched_priority@user. Error: Failed to add events. # pahole sched_param struct sched_param { int sched_priority; /* 0 4 */ /* size: 4, cachelines: 1, members: 1 */ /* last cacheline: 4 bytes */ }; # After: # perf probe -a 'do_sched_setscheduler pid policy param->sched_priority@user' Added new event: probe:do_sched_setscheduler (on do_sched_setscheduler with pid policy sched_priority=param->sched_priority) You can now use it in all perf tools, such as: perf record -e probe:do_sched_setscheduler -aR sleep 1 # cat /sys/kernel/debug/tracing/kprobe_events p:probe/do_sched_setscheduler _text+1113792 pid=%di:s32 policy=%si:s32 sched_priority=+u0(%dx):s32 # Fixes: 1e032f7cfa14 ("perf-probe: Add user memory access attribute support") Signed-off-by: Sumanth Korikkar Reviewed-by: Thomas Richter Acked-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ilya Leoshkevich Cc: Jiri Olsa Cc: Steven Rostedt (VMware) Cc: bpf@vger.kernel.org LPU-Reference: 20200609081019.60234-2-sumanthk@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit c0c652fc705de75f4ba52e93053acc1ed3933e74 Author: Hongbo Yao Date: Fri Jun 5 17:17:40 2020 +0800 perf stat: Fix NULL pointer dereference If config->aggr_map is NULL and config->aggr_get_id is not NULL, the function print_aggr() will still calling arrg_update_shadow(), which can result in accessing the invalid pointer. Fixes: 088519f318be ("perf stat: Move the display functions to stat-display.c") Signed-off-by: Hongbo Yao Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Wei Li Link: https://lore.kernel.org/lkml/20200608163625.GC3073@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 11b6e5482e178055ec1f2444b55f2518713809d1 Author: Gaurav Singh Date: Mon Jun 8 13:18:17 2020 -0300 perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events() The 'evname' variable can be NULL, as it is checked a few lines back, check it before using. Fixes: 9e207ddfa207 ("perf report: Show call graph from reference events") Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/ Signed-off-by: Gaurav Singh commit dd76c302955de405ea589e36c574f6f10eca99b6 Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 12:28:16 2020 -0300 tools headers UAPI: Sync kvm.h headers with the kernel sources To pick the changes in: f97f5a56f597 ("x86/kvm/hyper-v: Add support for synthetic debugger interface") 850448f35aaf ("KVM: nVMX: Fix VMX preemption timer migration") 2c4c41325540 ("KVM: x86: Print symbolic names of VMX VM-Exit flags in traces") cc440cdad5b7 ("KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE") f7d31e65368a ("x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit") 72de5fa4c161 ("KVM: x86: announce KVM_FEATURE_ASYNC_PF_INT") acd05785e48c ("kvm: add capability for halt polling") 3ecad8c2c1ff ("docs: fix broken references for ReST files that moved around") That do not result in any change in tooling, as the additions are not being used in any table generator. This silences these perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h' diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/vmx.h' differs from latest version at 'arch/x86/include/uapi/asm/vmx.h' diff -u tools/arch/x86/include/uapi/asm/vmx.h arch/x86/include/uapi/asm/vmx.h Cc: Adrian Hunter Cc: David Matlack Cc: Jiri Olsa Cc: Jon Doron Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Shier Cc: Sean Christopherson Cc: Vitaly Kuznetsov Signed-off-by: Arnaldo Carvalho de Melo commit 377cb673cf35ec22878975f7eec0373378d52d3b Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 11:53:23 2020 -0300 tools headers UAPI: Sync drm/i915_drm.h with the kernel sources To pick the change in: 4ef10fe05ba0 ("drm/i915/perf: add new open param to configure polling of OA buffer") 11ecbdddf2f8 ("drm/i915/perf: introduce global sseu pinning") That don't result in any changes in tooling, just silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h' diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h Cc: Adrian Hunter Cc: Jiri Olsa Cc: Lionel Landwerlin Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit d8e1ef67722bba39a229a289844ac135998a4066 Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 11:44:32 2020 -0300 tools headers UAPI: Sync linux/fscrypt.h with the kernel sources To pick the changes from: e3b1078bedd3 ("fscrypt: add support for IV_INO_LBLK_32 policies") That don't trigger any changes in tooling. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/fscrypt.h' differs from latest version at 'include/uapi/linux/fscrypt.h' diff -u tools/include/uapi/linux/fscrypt.h include/uapi/linux/fscrypt.h Cc: Adrian Hunter Cc: Eric Biggers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 5d33cbfedb51f73283f5f995b27e4aecdd614abc Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 11:38:11 2020 -0300 perf beauty: Add support to STATX_MNT_ID in the 'statx' syscall 'mask' argument Introduced in: fa2fcf4f1df1 ("statx: add mount ID") Cc: Adrian Hunter Cc: Jiri Olsa Cc: Miklos Szeredi Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 93dc627f48018df6739f09fec9141bce356cf193 Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 11:32:48 2020 -0300 tools headers uapi: Sync linux/stat.h with the kernel sources To pick the changes from: 80340fe3605c ("statx: add mount_root") fa2fcf4f1df1 ("statx: add mount ID") 581701b7efd6 ("uapi: deprecate STATX_ALL") 712b2698e4c0 ("fs/stat: Define DAX statx attribute") These add some constants that will have to be manually added in a followup cset, at some point this should move to the shell based automated way. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/stat.h' differs from latest version at 'include/uapi/linux/stat.h' diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h Cc: Adrian Hunter Cc: Darrick J. Wong Cc: Ira Weiny Cc: Jiri Olsa Cc: Miklos Szeredi Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 7e579f3a074c9348389ea0cf0491264e1ffbc585 Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 11:23:33 2020 -0300 tools arch x86 uapi: Synch asm/unistd.h with the kernel sources To pick up the change in: 700d3a5a664d ("x86/syscalls: Revert "x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long"") That doesn't trigger any changes in tooling and silences this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h' diff -u tools/arch/x86/include/uapi/asm/unistd.h arch/x86/include/uapi/asm/unistd.h Cc: Adrian Hunter Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 6c3c184fc420a2d8233d0e0f977e7df8051c5edb Author: Arnaldo Carvalho de Melo Date: Fri Jun 5 13:36:38 2020 -0300 tools headers API: Update faccessat2 affected files Update the copies of files affected by: c8ffd8bcdd28 ("vfs: add faccessat2 syscall") To address this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/fcntl.h' differs from latest version at 'include/uapi/linux/fcntl.h' diff -u tools/include/uapi/linux/fcntl.h include/uapi/linux/fcntl.h Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h' diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl' diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl Which results in 'perf trace' gaining support for the 'faccessat2' syscall, now one can use: # perf trace -e faccessat2 And have system wide tracing of this syscall. And this also will include it; # perf trace -e faccess* Together with the other variants. How it affects building/usage (on an x86_64 system): $ cp /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c /tmp/syscalls_64.c.before $ [root@five ~]# perf trace -e faccessat2 event syntax error: 'faccessat2' \___ parser error Run 'perf list' for a list of valid events Usage: perf trace [] [] or: perf trace [] -- [] or: perf trace record [] [] or: perf trace record [] -- [] -e, --event event/syscall selector. use 'perf list' to list available events [root@five ~]# $ cp arch/x86/entry/syscalls/syscall_64.tbl tools/perf/arch/x86/entry/syscalls/syscall_64.tbl $ git diff diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl index 37b844f839bc..78847b32e137 100644 --- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl @@ -359,6 +359,7 @@ 435 common clone3 sys_clone3 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 # # x32-specific system call numbers start at 512 to avoid cache impact $ $ make -C tools/perf O=/tmp/build/perf/ install-bin CC /tmp/build/perf/util/syscalltbl.o LD /tmp/build/perf/util/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf [root@five ~]# perf trace -e faccessat2 ^C[root@five ~]# Cc: Miklos Szeredi Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 6a47d6efc6931b02d10163de2fb85ec9953c4f5e Author: Arnd Bergmann Date: Tue May 5 16:00:11 2020 +0200 fpga: zynqmp: fix modular build Two symbols need to be exported to allow the zynqmp-fpga module to get loaded dynamically: ERROR: modpost: "zynqmp_pm_fpga_load" [drivers/fpga/zynqmp-fpga.ko] undefined! ERROR: modpost: "zynqmp_pm_fpga_get_status" [drivers/fpga/zynqmp-fpga.ko] undefined! To ensure this is done correctly, also fix the Kconfig dependency to only allow building the fpga driver when the firmware driver is either disabled, or when it is reachable. With that, the dependency on the SoC itself can be removed, and there are no surprises when the fpga driver is built-in but the firmware a module. Fixes: 4db8180ffe7c ("firmware: xilinx: Remove eemi ops for fpga related APIs") Signed-off-by: Arnd Bergmann Signed-off-by: Moritz Fischer commit 44ce45f866c1606f03a411fb2d2c0db4626403a6 Merge: 79d4f823a067 ba4e5abc6c4e Author: Mark Brown Date: Tue Jun 9 15:46:20 2020 +0100 Merge series "ASoC: Fix dailink checks for DPCM" from Pierre-Louis Bossart : We've had a couple of changes that introduce regressions with the multi-cpu DAI solutions, and while trying to fix them we found additional inconsistencies that should also go to stable branches. Bard Liao (1): ASoC: core: only convert non DPCM link to DPCM link Pierre-Louis Bossart (3): ASoC: soc-pcm: dpcm: fix playback/capture checks ASoC: Intel: boards: replace capture_only by dpcm_capture ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 +- sound/soc/intel/boards/kbl_da7219_max98927.c | 4 +- sound/soc/intel/boards/kbl_rt5663_max98927.c | 2 +- .../intel/boards/kbl_rt5663_rt5514_max98927.c | 2 +- sound/soc/soc-core.c | 22 ++++++++-- sound/soc/soc-pcm.c | 44 ++++++++++++++----- sound/soc/sof/nocodec.c | 6 ++- 7 files changed, 62 insertions(+), 20 deletions(-) base-commit: 8a9144c1cf523221b37dd3393827253c91fcbf54 -- 2.20.1 commit 79d4f823a06796656289f97b922493da5690e46c Author: Hans de Goede Date: Mon Jun 8 22:46:34 2020 +0200 ASoC: rt5645: Add platform-data for Asus T101HA The Asus T101HA uses the default jack-detect mode 3, but instead of using an analog microphone it is using a DMIC on dmic-data-pin 1, like the Asus T100HA. Note unlike the T100HA its jack-detect is not inverted. Add a DMI quirk with the correct settings for this model. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200608204634.93407-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 199a5e8fda54ab3c8c6f6bf980c004e97ebf5ccb Author: Hans de Goede Date: Mon Jun 8 22:46:33 2020 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet The Toshiba Encore WT10-A tablet almost fully works with the default settings for Bay Trail CR devices. The only issue is that it uses a digital mic. connected the the DMIC1 input instead of an analog mic. Add a quirk for this model using the default settings with the input-map replaced with BYT_RT5640_DMIC1_MAP. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200608204634.93407-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 7778d8417b74aded842eeb372961cfc460417fa0 Author: Thomas Gleixner Date: Sat Jun 6 23:51:17 2020 +0200 x86/vdso: Unbreak paravirt VDSO clocks The conversion of x86 VDSO to the generic clock mode storage broke the paravirt and hyperv clocksource logic. These clock sources have their own internal sequence counter to validate the clocksource at the point of reading it. This is necessary because the hypervisor can invalidate the clocksource asynchronously so a check during the VDSO data update is not sufficient. If the internal check during read invalidates the clocksource the read return U64_MAX. The original code checked this efficiently by testing whether the result (casted to signed) is negative, i.e. bit 63 is set. This was done that way because an extra indicator for the validity had more overhead. The conversion broke this check because the check was replaced by a check for a valid VDSO clock mode. The wreckage manifests itself when the paravirt clock is installed as a valid VDSO clock and during runtime invalidated by the hypervisor, e.g. after a host suspend/resume cycle. After the invalidation the read function returns U64_MAX which is used as cycles and makes the clock jump by ~2200 seconds, and become stale until the 2200 seconds have elapsed where it starts to jump again. The period of this effect depends on the shift/mult pair of the clocksource and the jumps and staleness are an artifact of undefined but reproducible behaviour of math overflow. Implement an x86 version of the new vdso_cycles_ok() inline which adds this check back and a variant of vdso_clocksource_ok() which lets the compiler optimize it out to avoid the extra conditional. That's suboptimal when the system does not have a VDSO capable clocksource, but that's not the case which is optimized for. Fixes: 5d51bee725cc ("clocksource: Add common vdso clock mode storage") Reported-by: Miklos Szeredi Signed-off-by: Thomas Gleixner Tested-by: Miklos Szeredi Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200606221532.080560273@linutronix.de commit 72ce778007e57e8996b4bebdec738fc5e1145fd2 Author: Thomas Gleixner Date: Sat Jun 6 23:51:16 2020 +0200 lib/vdso: Provide sanity check for cycles (again) The original x86 VDSO implementation checked for the validity of the clock source read by testing whether the returned signed cycles value is less than zero. This check was also used by the vdso read function to signal that the current selected clocksource is not VDSO capable. During the rework of the VDSO code the check was removed and replaced with a check for the clocksource mode being != NONE. This turned out to be a mistake because the check is necessary for paravirt and hyperv clock sources. The reason is that these clock sources have their own internal sequence counter to validate the clocksource at the point of reading it. This is necessary because the hypervisor can invalidate the clocksource asynchronously so a check during the VDSO data update is not sufficient. Having a separate indicator for the validity is slower than just validating the cycles value. The check for it being negative turned out to be the fastest implementation and safe as it would require an uptime of ~73 years with a 4GHz counter frequency to result in a false positive. Add an optional function to validate the cycles with a default implementation which allows the compiler to optimize it out for architectures which do not require it. Fixes: 5d51bee725cc ("clocksource: Add common vdso clock mode storage") Reported-by: Miklos Szeredi Signed-off-by: Thomas Gleixner Tested-by: Miklos Szeredi Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200606221531.963970768@linutronix.de commit c7f3d43b629b598a2bb9ec3524e844eae7492e7e Author: Thomas Gleixner Date: Sat Jun 6 23:51:15 2020 +0200 clocksource: Remove obsolete ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE was a transitional config switch which got removed after all architectures got converted to the new storage model. But the removal forgot to remove the #ifdef which guards the vdso_clock_mode sanity check, which effectively disables the sanity check. Remove it now. Fixes: f86fd32db706 ("lib/vdso: Cleanup clock mode storage leftovers") Signed-off-by: Thomas Gleixner Tested-by: Miklos Szeredi Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200606221531.845475036@linutronix.de commit ba4e5abc6c4e173af7c941c03c067263b686665d Author: Pierre-Louis Bossart Date: Mon Jun 8 14:44:15 2020 -0500 ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags With additional checks on dailinks, we see errors such as [ 3.000418] sof-nocodec sof-nocodec: CPU DAI DMIC01 Pin for rtd NoCodec-6 does not support playback It's not clear why we set the dpcm_playback and dpcm_capture flags unconditionally, add a check on number of channels for each direction to avoid invalid configurations. Fixes: 8017b8fd37bf5e ('ASoC: SOF: Add Nocodec machine driver support') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200608194415.4663-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit dc261875865539ca91bff9bc44d3e62f811dec1d Author: Pierre-Louis Bossart Date: Mon Jun 8 14:44:14 2020 -0500 ASoC: Intel: boards: replace capture_only by dpcm_capture It's not clear why specific FE dailinks use capture_only flags, likely blind copy/paste from Chromebook driver to the other. Replace by dpcm_capture, this will make future alignment and removal of flags easier. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200608194415.4663-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 607fa205a7e4dfad28b8a67ab1c985756ddbccb0 Author: Bard Liao Date: Mon Jun 8 14:44:13 2020 -0500 ASoC: core: only convert non DPCM link to DPCM link Additional checks for valid DAIs expose a corner case, where existing BE dailinks get modified, e.g. HDMI links are tagged with dpcm_capture=1 even if the DAIs are for playback. This patch makes those changes conditional and flags configuration issues when a BE dailink is has no_pcm=0 but dpcm_playback or dpcm_capture=1 (which makes no sense). As discussed on the alsa-devel mailing list, there are redundant flags for dpcm_playback, dpcm_capture, playback_only, capture_only. This will have to be cleaned-up in a future update. For now only correct and flag problematic configurations. Fixes: 218fe9b7ec7f3 ("ASoC: soc-core: Set dpcm_playback / dpcm_capture") Suggested-by: Daniel Baluta Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200608194415.4663-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b73287f0b0745961b14e5ebcce92cc8ed24d4d52 Author: Pierre-Louis Bossart Date: Mon Jun 8 14:44:12 2020 -0500 ASoC: soc-pcm: dpcm: fix playback/capture checks Recent changes in the ASoC core prevent multi-cpu BE dailinks from being used. DPCM does support multi-cpu DAIs for BE Dailinks, but not for FE. Handle the FE checks first, and make sure all DAIs support the same capabilities within the same dailink. Fixes: 9b5db059366ae2 ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Reviewed-by: Daniel Baluta BugLink: https://github.com/thesofproject/linux/issues/2031 Link: https://lore.kernel.org/r/20200608194415.4663-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5749ce92c4b707353cbd934dd0518a1966d7988f Author: David Howells Date: Thu Jun 4 21:31:39 2020 +0100 afs: Fix file locking Fix AFS file locking to use the correct vnode pointer and remove a member of the afs_operation struct that is never set, but it is read and followed, causing an oops. This can be triggered by: flock -s /afs/example.com/foo sleep 1 when it calls the kernel to get a file lock. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Reported-by: Dave Botsch Signed-off-by: David Howells Tested-by: Dave Botsch commit 2ca068be09bf8e285036603823696140026dcbe7 Author: Zhihao Cheng Date: Tue Jun 2 09:30:45 2020 +0800 afs: Fix memory leak in afs_put_sysnames() Fix afs_put_sysnames() to actually free the specified afs_sysnames object after its reference count has been decreased to zero and its contents have been released. Fixes: 6f8880d8e681557 ("afs: Implement @sys substitution handling") Signed-off-by: Zhihao Cheng Signed-off-by: David Howells commit 3ee06a6d532f75f20528ff4d2c473cda36c484fe Author: Geert Uytterhoeven Date: Mon Jun 8 15:22:17 2020 +0200 dma-pool: fix too large DMA pools on medium memory size systems On systems with at least 32 MiB, but less than 32 GiB of RAM, the DMA memory pools are much larger than intended (e.g. 2 MiB instead of 128 KiB on a 256 MiB system). Fix this by correcting the calculation of the number of GiBs of RAM in the system. Invert the order of the min/max operations, to keep on calculating in pages until the last step, which aids readability. Fixes: 1d659236fb43c4d2 ("dma-pool: scale the default DMA coherent pool size with memory capacity") Signed-off-by: Geert Uytterhoeven Acked-by: David Rientjes Signed-off-by: Christoph Hellwig commit a952f64d14e5f8461f04cd9d729037db9099ddb0 Author: Deep Shah Date: Thu Apr 16 16:45:20 2020 -0700 MAINTAINERS: Update PARAVIRT_OPS_INTERFACE and VMWARE_HYPERVISOR_INTERFACE Thomas Hellstrom will be handing over VMware's maintainership of these interfaces to Deep Shah. Signed-off-by: Deep Shah Acked-by: Thomas Hellstrom Acked-by: Juergen Gross Link: https://lore.kernel.org/r/20200416234520.GA1700@prme-mon-cfl-mlw-07 Signed-off-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 3680c2e9f4254d1f033bf00f540e47a51f8f996b Author: Chris Wilson Date: Mon May 25 13:49:12 2020 +0100 drm/i915/display: Only query DP state of a DDI encoder Avoid a NULL dereference for a mismatched encoder type, hit when probing state for all encoders. This is a band aid to prevent the OOPS as the right fix is "probably to swap the psr vs infoframes.enable checks, or outright disappear from this function" (Ville). Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1892 Signed-off-by: Chris Wilson Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200525124912.16019-1-chris@chris-wilson.co.uk (cherry picked from commit 22da5d846d54dd13183b57874b9d5611d583d7c8) Signed-off-by: Joonas Lahtinen commit e0fe70051f12c25c4afb04cb10ca8648c6e761cf Author: Geert Uytterhoeven Date: Mon Jun 8 11:59:34 2020 +0200 spi: rspi: Use requested instead of maximum bit rate Currently, the RSPI driver always tries to use the maximum configured bit rate for communicating with a slave device, even if the transfer(s) in the current message specify a lower rate. Use the mininum rate specified in the message instead. Rename rspi_data.max_speed_hz accordingly. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200608095940.30516-3-geert+renesas@glider.be Signed-off-by: Mark Brown commit 3b8a299a58b2afce464ae11324b59dcf0f1d10a7 Author: Pavel Machek (CIP) Date: Sat Jun 6 17:31:03 2020 +0200 ASoC: meson: add missing free_irq() in error path free_irq() is missing in case of error, fix that. Signed-off-by: Pavel Machek (CIP) Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20200606153103.GA17905@amd Signed-off-by: Mark Brown commit 044e4b09223039e571e6ec540e25552054208765 Author: Michael S. Tsirkin Date: Mon Jun 8 08:42:09 2020 -0400 vhost/test: fix up after API change Pass a flag to request kernel thread use. Fixes: 01fcb1cbc88e ("vhost: allow device that does not depend on vhost worker") Signed-off-by: Michael S. Tsirkin commit 544fc7dbbf920a3e64d109c416ee229e8e1763c5 Author: Michael S. Tsirkin Date: Mon Jun 8 02:03:15 2020 -0400 virtio_mem: convert device block size into 64bit If subblock size is large (e.g. 1G) 32 bit math involving it can overflow. Rather than try to catch all instances of that, let's tweak block size to 64 bit. It ripples through UAPI which is an ABI change, but it's not too late to make it, and it will allow supporting >4Gbyte blocks while might become necessary down the road. Fixes: 5f1f79bbc9e26 ("virtio-mem: Paravirtualized memory hotplug") Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand commit 07da1ffaa1373f99331712faa67a00b5b807dfe8 Author: Marc Zyngier Date: Fri Jun 5 14:08:13 2020 +0100 KVM: arm64: Remove host_cpu_context member from vcpu structure For very long, we have kept this pointer back to the per-cpu host state, despite having working per-cpu accessors at EL2 for some time now. Recent investigations have shown that this pointer is easy to abuse in preemptible context, which is a sure sign that it would better be gone. Not to mention that a per-cpu pointer is faster to access at all times. Reported-by: Andrew Scull Acked-by: Mark Rutland Signed-off-by: Marc Zyngier commit b990d37fdf6781fd0907ffd14d0dff16b5d58ffa Author: Marc Zyngier Date: Sun Jun 7 10:55:28 2020 +0100 KVM: arm64: Stop sparse from moaning at __hyp_this_cpu_ptr Sparse complains that __hyp_this_cpu_ptr() returns something that is flagged noderef and not in the correct address space (both being the result of the __percpu annotation). Pretend that __hyp_this_cpu_ptr() knows what it is doing by forcefully casting the pointer with __kernel __force. Signed-off-by: Marc Zyngier commit 29eb5a3c57f7e06d803bb44a0ce2f9ed79f39cd9 Author: Marc Zyngier Date: Thu Jun 4 11:14:00 2020 +0100 KVM: arm64: Handle PtrAuth traps early The current way we deal with PtrAuth is a bit heavy handed: - We forcefully save the host's keys on each vcpu_load() - Handling the PtrAuth trap forces us to go all the way back to the exit handling code to just set the HCR bits Overall, this is pretty cumbersome. A better approach would be to handle it the same way we deal with the FPSIMD registers: - On vcpu_load() disable PtrAuth for the guest - On first use, save the host's keys, enable PtrAuth in the guest Crucially, this can happen as a fixup, which is done very early on exit. We can then reenter the guest immediately without leaving the hypervisor role. Another thing is that it simplify the rest of the host handling: exiting all the way to the host means that the only possible outcome for this trap is to inject an UNDEF. Reviewed-by: Mark Rutland Signed-off-by: Marc Zyngier commit 80fbd280beea1bcc298660f9024cbc4bf392c7f7 Author: Sean Christopherson Date: Mon Jun 8 11:02:18 2020 -0700 KVM: x86: Unexport x86_fpu_cache and make it static Make x86_fpu_cache static now that FPU allocation and destruction is handled entirely by common x86 code. Signed-off-by: Sean Christopherson Message-Id: <20200608180218.20946-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 2067028512b60c78961c3e075bb72cc44310355c Author: Sean Christopherson Date: Wed May 27 19:15:30 2020 -0700 KVM: selftests: Ignore KVM 5-level paging support for VM_MODE_PXXV48_4K Explicitly set the VA width to 48 bits for the x86_64-only PXXV48_4K VM mode instead of asserting the guest VA width is 48 bits. The fact that KVM supports 5-level paging is irrelevant unless the selftests opt-in to 5-level paging by setting CR4.LA57 for the guest. The overzealous assert prevents running the selftests on a kernel with 5-level paging enabled. Incorporate LA57 into the assert instead of removing the assert entirely as a sanity check of KVM's CPUID output. Fixes: 567a9f1e9deb ("KVM: selftests: Introduce VM_MODE_PXXV48_4K") Reported-by: Sergio Perez Gonzalez Cc: Adriana Cervantes Jimenez Cc: Peter Xu Signed-off-by: Sean Christopherson Message-Id: <20200528021530.28091-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ef3e40a7ea8dbe2abd0a345032cd7d5023b9684f Author: Marc Zyngier Date: Wed Jun 3 18:24:01 2020 +0100 KVM: arm64: Save the host's PtrAuth keys in non-preemptible context When using the PtrAuth feature in a guest, we need to save the host's keys before allowing the guest to program them. For that, we dump them in a per-CPU data structure (the so called host context). But both call sites that do this are in preemptible context, which may end up in disaster should the vcpu thread get preempted before reentering the guest. Instead, save the keys eagerly on each vcpu_load(). This has an increased overhead, but is at least safe. Cc: stable@vger.kernel.org Reviewed-by: Mark Rutland Signed-off-by: Marc Zyngier commit d8ad6d39c35d2b44b3d48b787df7f3359381dcbf Author: Bob Haarman Date: Tue Jun 2 12:30:59 2020 -0700 x86_64: Fix jiffies ODR violation 'jiffies' and 'jiffies_64' are meant to alias (two different symbols that share the same address). Most architectures make the symbols alias to the same address via a linker script assignment in their arch//kernel/vmlinux.lds.S: jiffies = jiffies_64; which is effectively a definition of jiffies. jiffies and jiffies_64 are both forward declared for all architectures in include/linux/jiffies.h. jiffies_64 is defined in kernel/time/timer.c. x86_64 was peculiar in that it wasn't doing the above linker script assignment, but rather was: 1. defining jiffies in arch/x86/kernel/time.c instead via the linker script. 2. overriding the symbol jiffies_64 from kernel/time/timer.c in arch/x86/kernel/vmlinux.lds.s via 'jiffies_64 = jiffies;'. As Fangrui notes: In LLD, symbol assignments in linker scripts override definitions in object files. GNU ld appears to have the same behavior. It would probably make sense for LLD to error "duplicate symbol" but GNU ld is unlikely to adopt for compatibility reasons. This results in an ODR violation (UB), which seems to have survived thus far. Where it becomes harmful is when; 1. -fno-semantic-interposition is used: As Fangrui notes: Clang after LLVM commit 5b22bcc2b70d ("[X86][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local") defaults to -fno-semantic-interposition similar semantics which help -fpic/-fPIC code avoid GOT/PLT when the referenced symbol is defined within the same translation unit. Unlike GCC -fno-semantic-interposition, Clang emits such relocations referencing local symbols for non-pic code as well. This causes references to jiffies to refer to '.Ljiffies$local' when jiffies is defined in the same translation unit. Likewise, references to jiffies_64 become references to '.Ljiffies_64$local' in translation units that define jiffies_64. Because these differ from the names used in the linker script, they will not be rewritten to alias one another. 2. Full LTO Full LTO effectively treats all source files as one translation unit, causing these local references to be produced everywhere. When the linker processes the linker script, there are no longer any references to jiffies_64' anywhere to replace with 'jiffies'. And thus '.Ljiffies$local' and '.Ljiffies_64$local' no longer alias at all. In the process of porting patches enabling Full LTO from arm64 to x86_64, spooky bugs have been observed where the kernel appeared to boot, but init doesn't get scheduled. Avoid the ODR violation by matching other architectures and define jiffies only by linker script. For -fno-semantic-interposition + Full LTO, there is no longer a global definition of jiffies for the compiler to produce a local symbol which the linker script won't ensure aliases to jiffies_64. Fixes: 40747ffa5aa8 ("asmlinkage: Make jiffies visible") Reported-by: Nathan Chancellor Reported-by: Alistair Delva Debugged-by: Nick Desaulniers Debugged-by: Sami Tolvanen Suggested-by: Fangrui Song Signed-off-by: Bob Haarman Signed-off-by: Thomas Gleixner Tested-by: Sedat Dilek # build+boot on Reviewed-by: Andi Kleen Reviewed-by: Josh Poimboeuf Cc: stable@vger.kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/852 Link: https://lkml.kernel.org/r/20200602193100.229287-1-inglorion@google.com commit 4d8df8cbb9156b0a0ab3f802b80cb5db57acc0bf Author: Anthony Steinhauser Date: Sun Jun 7 05:44:19 2020 -0700 x86/speculation: PR_SPEC_FORCE_DISABLE enforcement for indirect branches. Currently, it is possible to enable indirect branch speculation even after it was force-disabled using the PR_SPEC_FORCE_DISABLE option. Moreover, the PR_GET_SPECULATION_CTRL command gives afterwards an incorrect result (force-disabled when it is in fact enabled). This also is inconsistent vs. STIBP and the documention which cleary states that PR_SPEC_FORCE_DISABLE cannot be undone. Fix this by actually enforcing force-disabled indirect branch speculation. PR_SPEC_ENABLE called after PR_SPEC_FORCE_DISABLE now fails with -EPERM as described in the documentation. Fixes: 9137bb27e60e ("x86/speculation: Add prctl() control for indirect branch speculation") Signed-off-by: Anthony Steinhauser Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org commit dbbe2ad02e9df26e372f38cc3e70dab9222c832e Author: Anthony Steinhauser Date: Sun Jan 5 12:19:43 2020 -0800 x86/speculation: Prevent rogue cross-process SSBD shutdown On context switch the change of TIF_SSBD and TIF_SPEC_IB are evaluated to adjust the mitigations accordingly. This is optimized to avoid the expensive MSR write if not needed. This optimization is buggy and allows an attacker to shutdown the SSBD protection of a victim process. The update logic reads the cached base value for the speculation control MSR which has neither the SSBD nor the STIBP bit set. It then OR's the SSBD bit only when TIF_SSBD is different and requests the MSR update. That means if TIF_SSBD of the previous and next task are the same, then the base value is not updated, even if TIF_SSBD is set. The MSR write is not requested. Subsequently if the TIF_STIBP bit differs then the STIBP bit is updated in the base value and the MSR is written with a wrong SSBD value. This was introduced when the per task/process conditional STIPB switching was added on top of the existing SSBD switching. It is exploitable if the attacker creates a process which enforces SSBD and has the contrary value of STIBP than the victim process (i.e. if the victim process enforces STIBP, the attacker process must not enforce it; if the victim process does not enforce STIBP, the attacker process must enforce it) and schedule it on the same core as the victim process. If the victim runs after the attacker the victim becomes vulnerable to Spectre V4. To fix this, update the MSR value independent of the TIF_SSBD difference and dependent on the SSBD mitigation method available. This ensures that a subsequent STIPB initiated MSR write has the correct state of SSBD. [ tglx: Handle X86_FEATURE_VIRT_SSBD & X86_FEATURE_VIRT_SSBD correctly and massaged changelog ] Fixes: 5bfbe3ad5840 ("x86/speculation: Prepare for per task indirect branch speculation control") Signed-off-by: Anthony Steinhauser Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org commit 21998a351512eba4ed5969006f0c55882d995ada Author: Anthony Steinhauser Date: Tue May 19 06:40:42 2020 -0700 x86/speculation: Avoid force-disabling IBPB based on STIBP and enhanced IBRS. When STIBP is unavailable or enhanced IBRS is available, Linux force-disables the IBPB mitigation of Spectre-BTB even when simultaneous multithreading is disabled. While attempts to enable IBPB using prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIRECT_BRANCH, ...) fail with EPERM, the seccomp syscall (or its prctl(PR_SET_SECCOMP, ...) equivalent) which are used e.g. by Chromium or OpenSSH succeed with no errors but the application remains silently vulnerable to cross-process Spectre v2 attacks (classical BTB poisoning). At the same time the SYSFS reporting (/sys/devices/system/cpu/vulnerabilities/spectre_v2) displays that IBPB is conditionally enabled when in fact it is unconditionally disabled. STIBP is useful only when SMT is enabled. When SMT is disabled and STIBP is unavailable, it makes no sense to force-disable also IBPB, because IBPB protects against cross-process Spectre-BTB attacks regardless of the SMT state. At the same time since missing STIBP was only observed on AMD CPUs, AMD does not recommend using STIBP, but recommends using IBPB, so disabling IBPB because of missing STIBP goes directly against AMD's advice: https://developer.amd.com/wp-content/resources/Architecture_Guidelines_Update_Indirect_Branch_Control.pdf Similarly, enhanced IBRS is designed to protect cross-core BTB poisoning and BTB-poisoning attacks from user space against kernel (and BTB-poisoning attacks from guest against hypervisor), it is not designed to prevent cross-process (or cross-VM) BTB poisoning between processes (or VMs) running on the same core. Therefore, even with enhanced IBRS it is necessary to flush the BTB during context-switches, so there is no reason to force disable IBPB when enhanced IBRS is available. Enable the prctl control of IBPB even when STIBP is unavailable or enhanced IBRS is available. Fixes: 7cc765a67d8e ("x86/speculation: Enable prctl mode for spectre_v2_user") Signed-off-by: Anthony Steinhauser Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org commit e8679fedd026eb3b4655af83829d9036e32c9b97 Author: James Morse Date: Fri May 29 15:06:56 2020 +0000 KVM: arm64: Stop save/restoring ACTLR_EL1 KVM sets HCR_EL2.TACR via HCR_GUEST_FLAGS. This means ACTLR* accesses from the guest are always trapped, and always return the value in the sys_regs array. The guest can't change the value of these registers, so we are save restoring the reset value, which came from the host. Stop save/restoring this register. Keep the storage for this register in sys_regs[] as this is how the value is exposed to user-space, removing it would break migration. Signed-off-by: James Morse Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200529150656.7339-4-james.morse@arm.com commit ef5a294be8d0e17b91d23be905f69368b0d3952e Author: James Morse Date: Fri May 29 15:06:55 2020 +0000 KVM: arm64: Add emulation for 32bit guests accessing ACTLR2 ACTLR_EL1 is a 64bit register while the 32bit ACTLR is obviously 32bit. For 32bit software, the extra bits are accessible via ACTLR2... which KVM doesn't emulate. Suggested-by: Marc Zyngier Signed-off-by: James Morse Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200529150656.7339-3-james.morse@arm.com commit 7c582bf4ed84f3eb58bdd1f63024a14c17551e7d Author: James Morse Date: Fri May 29 15:06:54 2020 +0000 KVM: arm64: Stop writing aarch32's CSSELR into ACTLR aarch32 has pairs of registers to access the high and low parts of 64bit registers. KVM has a union of 64bit sys_regs[] and 32bit copro[]. The 32bit accessors read the high or low part of the 64bit sys_reg[] value through the union. Both sys_reg_descs[] and cp15_regs[] list access_csselr() as the accessor for CSSELR{,_EL1}. access_csselr() is only aware of the 64bit sys_regs[], and expects r->reg to be 'CSSELR_EL1' in the enum, index 2 of the 64bit array. cp15_regs[] uses the 32bit copro[] alias of sys_regs[]. Here CSSELR is c0_CSSELR which is the same location in sys_reg[]. r->reg is 'c0_CSSELR', index 4 in the 32bit array. access_csselr() uses the 32bit r->reg value to access the 64bit array, so reads and write the wrong value. sys_regs[4], is ACTLR_EL1, which is subsequently save/restored when we enter the guest. ACTLR_EL1 is supposed to be read-only for the guest. This register only affects execution at EL1, and the host's value is restored before we return to host EL1. Convert the 32bit register index back to the 64bit version. Suggested-by: Marc Zyngier Signed-off-by: James Morse Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200529150656.7339-2-james.morse@arm.com commit fc961522ddbdf00254dd03b677627139cc1f68bc Author: Dan Carpenter Date: Mon Jun 8 17:16:29 2020 +0300 exfat: Fix potential use after free in exfat_load_upcase_table() This code calls brelse(bh) and then dereferences "bh" on the next line resulting in a possible use after free. The brelse() should just be moved down a line. Fixes: b676fdbcf4c8 ("exfat: standardize checksum calculation") Signed-off-by: Dan Carpenter Signed-off-by: Namjae Jeon commit a949824f01f3b39f737d77aed6cba47aced09319 Author: hyeongseok.kim Date: Thu Jun 4 13:54:28 2020 +0900 exfat: fix range validation error in alloc and free cluster There is check error in range condition that can never be entered even with invalid input. Replace incorrent checking code with already existing valid checker. Signed-off-by: hyeongseok.kim Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 29bbb14bfc80dd760b07d2be0a27e610562982e3 Author: Namjae Jeon Date: Thu Jun 4 08:05:31 2020 +0900 exfat: fix incorrect update of stream entry in __exfat_truncate() At truncate, there is a problem of incorrect updating in the file entry pointer instead of stream entry. This will cause the problem of overwriting the time field of the file entry to new_size. Fix it to update stream entry. Fixes: 98d917047e8b ("exfat: add file operations") Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Namjae Jeon commit f341a7d8dcc4e3d01544d7bc145633f062ef6249 Author: Al Viro Date: Wed Jun 3 09:48:36 2020 +0900 exfat: fix memory leak in exfat_parse_param() butt3rflyh4ck reported memory leak found by syzkaller. A param->string held by exfat_mount_options. BUG: memory leak unreferenced object 0xffff88801972e090 (size 8): comm "syz-executor.2", pid 16298, jiffies 4295172466 (age 14.060s) hex dump (first 8 bytes): 6b 6f 69 38 2d 75 00 00 koi8-u.. backtrace: [<000000005bfe35d6>] kstrdup+0x36/0x70 mm/util.c:60 [<0000000018ed3277>] exfat_parse_param+0x160/0x5e0 fs/exfat/super.c:276 [<000000007680462b>] vfs_parse_fs_param+0x2b4/0x610 fs/fs_context.c:147 [<0000000097c027f2>] vfs_parse_fs_string+0xe6/0x150 fs/fs_context.c:191 [<00000000371bf78f>] generic_parse_monolithic+0x16f/0x1f0 fs/fs_context.c:231 [<000000005ce5eb1b>] do_new_mount fs/namespace.c:2812 [inline] [<000000005ce5eb1b>] do_mount+0x12bb/0x1b30 fs/namespace.c:3141 [<00000000b642040c>] __do_sys_mount fs/namespace.c:3350 [inline] [<00000000b642040c>] __se_sys_mount fs/namespace.c:3327 [inline] [<00000000b642040c>] __x64_sys_mount+0x18f/0x230 fs/namespace.c:3327 [<000000003b024e98>] do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 [<00000000ce2b698c>] entry_SYSCALL_64_after_hwframe+0x49/0xb3 exfat_free() should call exfat_free_iocharset(), to prevent a leak in case we fail after parsing iocharset= but before calling get_tree_bdev(). Additionally, there's no point copying param->string in exfat_parse_param() - just steal it, leaving NULL in param->string. That's independent from the leak or fix thereof - it's simply avoiding an extra copy. Fixes: 719c1e182916 ("exfat: add super block operations") Cc: stable@vger.kernel.org # v5.7 Reported-by: butt3rflyh4ck Signed-off-by: Al Viro Signed-off-by: Namjae Jeon commit f78059805fb9fc5c343e89f39cf11856d047dd60 Author: Namjae Jeon Date: Mon Jun 1 09:43:49 2020 +0900 exfat: remove unnecessary reassignment of p_uniname->name_len kbuild test robot reported : fs/exfat/nls.c:531:22: warning: Variable 'p_uniname->name_len' is reassigned a value before the old one has been used. The reassignment of p_uniname->name_len is not needed and remove it. Reported-by: kbuild test robot Signed-off-by: Namjae Jeon commit 5875bf287d95314c58add01184f361cc5aa38429 Author: Tetsuhiro Kohada Date: Fri May 29 19:14:59 2020 +0900 exfat: standardize checksum calculation To clarify that it is a 16-bit checksum, the parts related to the 16-bit checksum are renamed and change type to u16. Furthermore, replace checksum calculation in exfat_load_upcase_table() with exfat_calc_checksum32(). Signed-off-by: Tetsuhiro Kohada Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 476189c0ef3b658de3f6b89fd0fdeb6dc451b564 Author: Tetsuhiro Kohada Date: Sun May 31 18:30:17 2020 +0900 exfat: add boot region verification Add Boot-Regions verification specified in exFAT specification. Note that the checksum type is strongly related to the raw structure, so the'u32 'type is used to clarify the number of bits. Signed-off-by: Tetsuhiro Kohada Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 33404a159828a97fefada0d8f4cf910873b8e9f1 Author: Tetsuhiro Kohada Date: Fri May 29 19:14:57 2020 +0900 exfat: separate the boot sector analysis Separate the boot sector analysis to read_boot_sector(). And add a check for the fs_name field. Furthermore, add a strict consistency check, because overlapping areas can cause serious corruption. Signed-off-by: Tetsuhiro Kohada Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 181a9e8009a8a8bdb19c2e24eeeae7d8e77c8c47 Author: Tetsuhiro Kohada Date: Fri May 29 19:14:56 2020 +0900 exfat: redefine PBR as boot_sector Aggregate PBR related definitions and redefine as "boot_sector" to comply with the exFAT specification. And, rename variable names including 'pbr'. Signed-off-by: Tetsuhiro Kohada Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 943af1fdacfebe4ff13430655abc460a5e1072f7 Author: Tetsuhiro Kohada Date: Wed May 20 16:56:41 2020 +0900 exfat: optimize dir-cache Optimize directory access based on exfat_entry_set_cache. - Hold bh instead of copied d-entry. - Modify bh->data directly instead of the copied d-entry. - Write back the retained bh instead of rescanning the d-entry-set. And - Remove unused cache related definitions. Signed-off-by: Tetsuhiro Kohada Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit ed0f84d30ba65f44bed2739572c7ab0fdeed4004 Author: Tetsuhiro Kohada Date: Wed Apr 22 08:30:56 2020 +0900 exfat: replace 'time_ms' with 'time_cs' Replace time_ms with time_cs in the file directory entry structure and related functions. The unit of create_time_ms/modify_time_ms in File Directory Entry are not 'milli-second', but 'centi-second'. The exfat specification uses the term '10ms', but instead use 'cs' as in msdos_fs.h. Signed-off-by: Tetsuhiro Kohada Signed-off-by: Namjae Jeon commit cdc06129a6cea0e4863fa2b34a0c132c6eb7278b Author: Jason Yan Date: Thu Apr 16 13:34:26 2020 +0900 exfat: remove the assignment of 0 to bool variable There is no need to init 'sync' in exfat_set_vol_flags(). This also fixes the following coccicheck warning: fs/exfat/super.c:104:6-10: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Namjae Jeon commit 6778337a7a4e51ec9fa4a76846d34e8a66ca6418 Author: Pali Rohár Date: Tue Mar 17 23:25:54 2020 +0100 exfat: Remove unused functions exfat_high_surrogate() and exfat_low_surrogate() After applying previous two patches, these functions are not used anymore. Signed-off-by: Pali Rohár Signed-off-by: Namjae Jeon commit dddf7da3985ee144b46ee287e81e47b9ee8bb980 Author: Pali Rohár Date: Tue Mar 17 23:25:52 2020 +0100 exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Function partial_name_hash() takes long type value into which can be stored one Unicode code point. Therefore conversion from UTF-32 to UTF-16 is not needed. Signed-off-by: Pali Rohár Signed-off-by: Namjae Jeon commit 31f5acc0aaa319a34308442413ef0b878e9d2c93 Author: Geert Uytterhoeven Date: Mon Apr 6 11:13:43 2020 +0200 exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option - Use consistent capitalization for "exFAT". - Fix grammar, - Split long sentence. Signed-off-by: Geert Uytterhoeven Signed-off-by: Namjae Jeon commit d1727d55c0327efdba2a5bad7801d509b721fef3 Author: Joe Perches Date: Fri Apr 24 13:31:12 2020 +0900 exfat: Use a more common logging style Remove the direct use of KERN_ in functions by creating separate exfat_ macros. Miscellanea: o Remove several unnecessary terminating newlines in formats o Realign arguments and fit to 80 columns where appropriate Signed-off-by: Joe Perches Signed-off-by: Namjae Jeon commit 197298a64983e2beaf1a87413daff3044b4f3821 Author: Pali Rohár Date: Tue Mar 17 22:34:33 2020 +0100 exfat: Simplify exfat_utf8_d_cmp() for code points above U+FFFF If two Unicode code points represented in UTF-16 are different then also their UTF-32 representation must be different. Therefore conversion from UTF-32 to UTF-16 is not needed. Signed-off-by: Pali Rohár Signed-off-by: Namjae Jeon commit 0b0430c6a10a22813e3d40c5658ae644acda4303 Author: Kenneth D'souza Date: Tue Jun 9 10:12:10 2020 +0530 cifs: Add get_security_type_str function to return sec type. This code is more organized and robust. Signed-off-by: Kenneth D'souza Signed-off-by: Roberto Bergantinos Corpas Signed-off-by: Steve French commit d4ff3b2ef901cd451fb8a9ff4623d060a79502cd Author: Matthew Wilcox (Oracle) Date: Mon Jun 8 20:58:29 2020 -0700 iomap: Fix unsharing of an extent >2GB on a 32-bit machine Widen the type used for counting the number of bytes unshared. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8cc0072469723459dc6bd7beff81b2b3149f4cf4 Author: Chuhong Yuan Date: Wed Jun 3 09:27:28 2020 -0700 xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster() xfs_ifree_cluster() calls xfs_perag_get() at the beginning, but forgets to call xfs_perag_put() in one failed path. Add the missed function call to fix it. Fixes: ce92464c180b ("xfs: make xfs_trans_get_buf return an error code") Signed-off-by: Chuhong Yuan Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b7b911d59dacb47511a1e604bbfa901beb108305 Author: Jaegeuk Kim Date: Thu Jun 4 16:45:30 2020 -0700 f2fs: attach IO flags to the missing cases This adds more IOs to attach flags. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 32b6aba85c8dbd1d3a155543986574c6969f0a48 Author: Jaegeuk Kim Date: Thu Jun 4 11:49:43 2020 -0700 f2fs: add node_io_flag for bio flags likewise data_io_flag This patch adds another way to attach bio flags to node writes. Description: Give a way to attach REQ_META|FUA to node writes given temperature-based bits. Now the bits indicate: * REQ_META | REQ_FUA | * 5 | 4 | 3 | 2 | 1 | 0 | * Cold | Warm | Hot | Cold | Warm | Hot | Signed-off-by: Jaegeuk Kim commit bc67c5d0ce406522cc846159f6a0dc0180be58d6 Author: Chao Yu Date: Mon Jun 8 20:03:17 2020 +0800 f2fs: remove unused parameter of f2fs_put_rpages_mapping() Just cleanup, no logic change. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8626441f05dc45a2f4693ee6863d02456ce39e60 Author: Chao Yu Date: Mon Jun 8 20:03:16 2020 +0800 f2fs: handle readonly filesystem in f2fs_ioc_shutdown() If mountpoint is readonly, we should allow shutdowning filesystem successfully, this fixes issue found by generic/599 testcase of xfstest. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit fc3bb095ab02b9e7d89a069ade2cead15c64c504 Author: Eric Biggers Date: Mon Jun 1 13:08:05 2020 -0700 f2fs: avoid utf8_strncasecmp() with unstable name If the dentry name passed to ->d_compare() fits in dentry::d_iname, then it may be concurrently modified by a rename. This can cause undefined behavior (possibly out-of-bounds memory accesses or crashes) in utf8_strncasecmp(), since fs/unicode/ isn't written to handle strings that may be concurrently modified. Fix this by first copying the filename to a stack buffer if needed. This way we get a stable snapshot of the filename. Fixes: 2c2eb7a300cd ("f2fs: Support case-insensitive file name lookups") Cc: # v5.4+ Cc: Al Viro Cc: Daniel Rosenberg Cc: Gabriel Krisman Bertazi Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 0b6d4ca04a86b9dababbb76e58d33c437e127b77 Author: Eric Biggers Date: Thu Jun 4 21:57:48 2020 -0700 f2fs: don't return vmalloc() memory from f2fs_kmalloc() kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either kmalloc'ed or vmalloc'ed memory. But the f2fs wrappers, f2fs_kmalloc() and f2fs_kvmalloc(), both return both kinds of memory. It's redundant to have two functions that do the same thing, and also breaking the standard naming convention is causing bugs since people assume it's safe to kfree() memory allocated by f2fs_kmalloc(). See e.g. the various allocations in fs/f2fs/compress.c. Fix this by making f2fs_kmalloc() just use kmalloc(). And to avoid re-introducing the allocation failures that the vmalloc fallback was intended to fix, convert the largest allocations to use f2fs_kvmalloc(). Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8027bc0307ce59759b90679fa5d8b22949586d20 Author: tannerlove Date: Mon Jun 8 15:37:15 2020 -0400 selftests/net: in timestamping, strncpy needs to preserve null byte If user passed an interface option longer than 15 characters, then device.ifr_name and hwtstamp.ifr_name became non-null-terminated strings. The compiler warned about this: timestamping.c:353:2: warning: ‘strncpy’ specified bound 16 equals \ destination size [-Wstringop-truncation] 353 | strncpy(device.ifr_name, interface, sizeof(device.ifr_name)); Fixes: cb9eff097831 ("net: new user space API for time stamping of incoming and outgoing packets") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 07a86b01c07c315d9b8eeb0009a9123af3d7dd4b Merge: 8e60eed6b38e 5ac0d62226a0 Author: David S. Miller Date: Mon Jun 8 19:13:37 2020 -0700 Merge tag 'rxrpc-fixes-20200605' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs David Howells says: ==================== rxrpc: Fix hang due to missing notification Here's a fix for AF_RXRPC. Occasionally calls hang because there are circumstances in which rxrpc generate a notification when a call is completed - primarily because initial packet transmission failed and the call was killed off and an error returned. But the AFS filesystem driver doesn't check this under all circumstances, expecting failure to be delivered by asynchronous notification. There are two patches: the first moves the problematic bits out-of-line and the second contains the fix. ==================== Signed-off-by: David S. Miller commit 8e60eed6b38e464e8c9d68f9caecafaa554dffe0 Author: Geliang Tang Date: Mon Jun 8 18:47:54 2020 +0800 mptcp: bugfix for RM_ADDR option parsing In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the "Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet: +-------+-------+---------------+ |Subtype|(resvd)| Address ID | +-------+-------+---------------+ | | ptr ptr+1 We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch will fix this bug. Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling") Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit 3763a24c727ecf236358a81ee749e5fcab1c972a Author: Arjun Roy Date: Sun Jun 7 18:54:41 2020 -0700 net-zerocopy: use vm_insert_pages() for tcp rcv zerocopy Use vm_insert_pages() for tcp receive zerocopy. Spin lock cycles (as reported by perf) drop from a couple of percentage points to a fraction of a percent. This results in a roughly 6% increase in efficiency, measured roughly as zerocopy receive count divided by CPU utilization. The intention of this patchset is to reduce atomic ops for tcp zerocopy receives, which normally hits the same spinlock multiple times consecutively. [akpm@linux-foundation.org: suppress gcc-7.2.0 warning] Link: http://lkml.kernel.org/r/20200128025958.43490-3-arjunroy.kdev@gmail.com Signed-off-by: Arjun Roy Signed-off-by: Eric Dumazet Signed-off-by: Soheil Hassas Yeganeh Cc: David Miller Cc: Matthew Wilcox Cc: Jason Gunthorpe Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: David S. Miller commit 0e6fbe39bdf71b4e665767bcbf53567a3e6d0623 Author: Pooja Trivedi Date: Fri Jun 5 16:01:18 2020 +0000 net/tls(TLS_SW): Add selftest for 'chunked' sendfile test This selftest tests for cases where sendfile's 'count' parameter is provided with a size greater than the intended file size. Motivation: When sendfile is provided with 'count' parameter value that is greater than the size of the file, kTLS example fails to send the file correctly. Last chunk of the file is not sent, and the data integrity is compromised. The reason is that the last chunk has MSG_MORE flag set because of which it gets added to pending records, but is not pushed. Note that if user space were to send SSL_shutdown control message, pending records would get flushed and the issue would not happen. So a shutdown control message following sendfile can mask the issue. Signed-off-by: Pooja Trivedi Signed-off-by: Mallesham Jatharkonda Signed-off-by: Josh Tway Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 6b1ad5a3ad049262195fddb31dfa6133da643868 Merge: af7b4801030c 59d4bfc1e2c0 Author: David S. Miller Date: Mon Jun 8 17:14:19 2020 -0700 Merge tag 'mac80211-for-davem-2020-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Just a small update: * fix the deadlock on rfkill/wireless removal that a few people reported * fix an uninitialized variable * update wiki URLs ==================== Signed-off-by: David S. Miller commit c3829285b2e6a0d5461078d7f6cbb2c2b4bf8c4e Author: Stefano Brivio Date: Mon Jun 8 10:50:29 2020 +0200 netfilter: nft_set_pipapo: Disable preemption before getting per-CPU pointer The lkp kernel test robot reports, with CONFIG_DEBUG_PREEMPT enabled: [ 165.316525] BUG: using smp_processor_id() in preemptible [00000000] code: nft/6247 [ 165.319547] caller is nft_pipapo_insert+0x464/0x610 [nf_tables] [ 165.321846] CPU: 1 PID: 6247 Comm: nft Not tainted 5.6.0-rc5-01595-ge32a4dc6512ce3 #1 [ 165.332128] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 165.334892] Call Trace: [ 165.336435] dump_stack+0x8f/0xcb [ 165.338128] debug_smp_processor_id+0xb2/0xc0 [ 165.340117] nft_pipapo_insert+0x464/0x610 [nf_tables] [ 165.342290] ? nft_trans_alloc_gfp+0x1c/0x60 [nf_tables] [ 165.344420] ? rcu_read_lock_sched_held+0x52/0x80 [ 165.346460] ? nft_trans_alloc_gfp+0x1c/0x60 [nf_tables] [ 165.348543] ? __mmu_interval_notifier_insert+0xa0/0xf0 [ 165.350629] nft_add_set_elem+0x5ff/0xa90 [nf_tables] [ 165.352699] ? __lock_acquire+0x241/0x1400 [ 165.354573] ? __lock_acquire+0x241/0x1400 [ 165.356399] ? reacquire_held_locks+0x12f/0x200 [ 165.358384] ? nf_tables_valid_genid+0x1f/0x40 [nf_tables] [ 165.360502] ? nla_strcmp+0x10/0x50 [ 165.362199] ? nft_table_lookup+0x4f/0xa0 [nf_tables] [ 165.364217] ? nla_strcmp+0x10/0x50 [ 165.365891] ? nf_tables_newsetelem+0xd5/0x150 [nf_tables] [ 165.367997] nf_tables_newsetelem+0xd5/0x150 [nf_tables] [ 165.370083] nfnetlink_rcv_batch+0x4fd/0x790 [nfnetlink] [ 165.372205] ? __lock_acquire+0x241/0x1400 [ 165.374058] ? __nla_validate_parse+0x57/0x8a0 [ 165.375989] ? cap_inode_getsecurity+0x230/0x230 [ 165.377954] ? security_capable+0x38/0x50 [ 165.379795] nfnetlink_rcv+0x11d/0x140 [nfnetlink] [ 165.381779] netlink_unicast+0x1b2/0x280 [ 165.383612] netlink_sendmsg+0x351/0x470 [ 165.385439] sock_sendmsg+0x5b/0x60 [ 165.387133] ____sys_sendmsg+0x200/0x280 [ 165.388871] ? copy_msghdr_from_user+0xd9/0x160 [ 165.390805] ___sys_sendmsg+0x88/0xd0 [ 165.392524] ? __might_fault+0x3e/0x90 [ 165.394273] ? sock_getsockopt+0x3d5/0xbb0 [ 165.396021] ? __handle_mm_fault+0x545/0x6a0 [ 165.397822] ? find_held_lock+0x2d/0x90 [ 165.399593] ? __sys_sendmsg+0x5e/0xa0 [ 165.401338] __sys_sendmsg+0x5e/0xa0 [ 165.402979] do_syscall_64+0x60/0x280 [ 165.404680] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 165.406621] RIP: 0033:0x7ff1fa46e783 [ 165.408299] Code: c7 c0 ff ff ff ff eb bb 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 89 54 24 1c 48 [ 165.414163] RSP: 002b:00007ffedf59ea78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 165.416804] RAX: ffffffffffffffda RBX: 00007ffedf59fc60 RCX: 00007ff1fa46e783 [ 165.419419] RDX: 0000000000000000 RSI: 00007ffedf59fb10 RDI: 0000000000000005 [ 165.421886] RBP: 00007ffedf59fc10 R08: 00007ffedf59ea54 R09: 0000000000000001 [ 165.424445] R10: 00007ff1fa630c6c R11: 0000000000000246 R12: 0000000000020000 [ 165.426954] R13: 0000000000000280 R14: 0000000000000005 R15: 00007ffedf59ea90 Disable preemption before accessing the lookup scratch area in nft_pipapo_insert(). Reported-by: kernel test robot Analysed-by: Florian Westphal Cc: # 5.6.x Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso commit de9be772c6794f27d1aa02d90d370b724cb67fd7 Author: Dan Carpenter Date: Mon Jun 8 17:17:27 2020 +0300 i2c: npcm7xx: Fix a couple of error codes in probe The code here is accidentally returning IS_ERR() which is 1 but it should be returning negative error codes with PTR_ERR(). Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Dan Carpenter Signed-off-by: Wolfram Sang commit abfbb29297c27e3f101f348dc9e467b0fe70f919 Merge: d26a42a96140 7dcef3988eed Author: Linus Torvalds Date: Mon Jun 8 13:01:08 2020 -0700 Merge tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc Pull remoteproc updates from Bjorn Andersson: "This introduces device managed versions of functions used to register remoteproc devices, add support for remoteproc driver specific resource control, enables remoteproc drivers to specify ELF class and machine for coredumps. It integrates pm_runtime in the core for keeping resources active while the remote is booted and holds a wake source while recoverying a remote processor after a firmware crash. It refactors the remoteproc device's allocation path to simplify the logic, fix a few cleanup bugs and to not clone const strings onto the heap. Debugfs code is simplifies using the DEFINE_SHOW_ATTRIBUTE and a zero-length array is replaced with flexible-array. A new remoteproc driver for the JZ47xx VPU is introduced, the Qualcomm SM8250 gains support for audio, compute and sensor remoteprocs and the Qualcomm SC7180 modem support is cleaned up and improved. The Qualcomm glink subsystem-restart driver is merged into the main glink driver, the Qualcomm sysmon driver is extended to properly notify remote processors about all other remote processors' state transitions" * tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: (43 commits) remoteproc: Fix an error code in devm_rproc_alloc() MAINTAINERS: Add myself as reviewer for Ingenic rproc driver remoteproc: ingenic: Added remoteproc driver remoteproc: Add support for runtime PM dt-bindings: Document JZ47xx VPU auxiliary processor remoteproc: wcss: Fix arguments passed to qcom_add_glink_subdev() remoteproc: Fix and restore the parenting hierarchy for vdev remoteproc: Fall back to using parent memory pool if no dedicated available remoteproc: Replace zero-length array with flexible-array remoteproc: wcss: add support for rpmsg communication remoteproc: core: Prevent system suspend during remoteproc recovery remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use remoteproc: qcom_q6v5_mss: Drop accesses to MPSS PERPH register space dt-bindings: remoteproc: qcom: Replace halt-nav with spare-regs remoteproc: qcom: pas: Add SM8250 PAS remoteprocs dt-bindings: remoteproc: qcom: pas: Add SM8250 remoteprocs remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region dt-bindings: remoteproc: qcom: Use memory-region to reference memory remoteproc: qcom: pas: Add SC7180 Modem support ... commit d26a42a9614083413e778832a6efbdf0038c3bff Merge: 95288a9b3bee 4f05fc33bebd Author: Linus Torvalds Date: Mon Jun 8 12:58:12 2020 -0700 Merge tag 'rpmsg-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc Pull rpmsg updates from Bjorn Andersson: "This replaces a zero-length array with flexible-array and fixes a typo in a comment in the rpmsg core" * tag 'rpmsg-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: rpmsg: Replace zero-length array with flexible-array rpmsg: fix a comment typo for rpmsg_device_match() commit 95288a9b3beee8dd69d73b7691e36f2f231b7903 Merge: ca687877e05a dc1dad8e1a61 Author: Linus Torvalds Date: Mon Jun 8 12:49:18 2020 -0700 Merge tag 'ceph-for-5.8-rc1' of git://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "The highlights are: - OSD/MDS latency and caps cache metrics infrastructure for the filesytem (Xiubo Li). Currently available through debugfs and will be periodically sent to the MDS in the future. - support for replica reads (balanced and localized reads) for rbd and the filesystem (myself). The default remains to always read from primary, users can opt-in with the new crush_location and read_from_replica options. Note that reading from replica is safe for general use only since Octopus. - support for RADOS allocation hint flags (myself). Currently used by rbd to propagate the compressible/incompressible hint given with the new compression_hint map option and ready for passing on more advanced hints, e.g. based on fadvise() from the filesystem. - support for efficient cross-quota-realm renames (Luis Henriques) - assorted cap handling improvements and cleanups, particularly untangling some of the locking (Jeff Layton)" * tag 'ceph-for-5.8-rc1' of git://github.com/ceph/ceph-client: (29 commits) rbd: compression_hint option libceph: support for alloc hint flags libceph: read_from_replica option libceph: support for balanced and localized reads libceph: crush_location infrastructure libceph: decode CRUSH device/bucket types and names libceph: add non-asserting rbtree insertion helper ceph: skip checking caps when session reconnecting and releasing reqs ceph: make sure mdsc->mutex is nested in s->s_mutex to fix dead lock ceph: don't return -ESTALE if there's still an open file libceph, rbd: replace zero-length array with flexible-array ceph: allow rename operation under different quota realms ceph: normalize 'delta' parameter usage in check_quota_exceeded ceph: ceph_kick_flushing_caps needs the s_mutex ceph: request expedited service on session's last cap flush ceph: convert mdsc->cap_dirty to a per-session list ceph: reset i_requested_max_size if file write is not wanted ceph: throw a warning if we destroy session with mutex still locked ceph: fix potential race in ceph_check_caps ceph: document what protects i_dirty_item and i_flushing_item ... commit f5fa38c59cb0b40633dee5cdf7465801be3e4928 Author: Pavel Begunkov Date: Mon Jun 8 21:08:20 2020 +0300 io_wq: add per-wq work handler instead of per work io_uring is the only user of io-wq, and now it uses only io-wq callback for all its requests, namely io_wq_submit_work(). Instead of storing work->runner callback in each instance of io_wq_work, keep it in io-wq itself. pros: - reduces io_wq_work size - more robust -- ->func won't be invalidated with mem{cpy,set}(req) - helps other work Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit d4c81f38522f3e7f4be1b472ef9988d0ed7f3696 Author: Pavel Begunkov Date: Mon Jun 8 21:08:19 2020 +0300 io_uring: don't arm a timeout through work.func Remove io_link_work_cb() -- the last custom work.func. Not the prettiest thing, but works. Instead of queueing a linked timeout in io_link_work_cb() mark a request with REQ_F_QUEUE_TIMEOUT and do enqueueing based on the flag in io_wq_submit_work(). Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit ac45abc0e2a8ed16ecc0eea039fe762ddfefbcad Author: Pavel Begunkov Date: Mon Jun 8 21:08:18 2020 +0300 io_uring: remove custom ->func handlers In preparation of getting rid of work.func, this removes almost all custom instances of it, leaving only io_wq_submit_work() and io_link_work_cb(). And the last one will be dealt later. Nothing fancy, just routinely remove *_finish() function and inline what's left. E.g. remove io_fsync_finish() + inline __io_fsync() into io_fsync(). As no users of io_req_cancelled() are left, delete it as well. The patch adds extra switch lookup on cold-ish path, but that's overweighted by nice diffstat and other benefits of the following patches. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 3af73b286ccee493dc055fc58da02b2dc7a5304d Author: Pavel Begunkov Date: Mon Jun 8 21:08:17 2020 +0300 io_uring: don't derive close state from ->func Relying on having a specific work.func is dangerous, even if an opcode handler set it itself. E.g. io_wq_assign_next() can modify it. io_close() sets a custom work.func to indicate that __close_fd_get_file() was already called. Fortunately, there is no bugs with io_wq_assign_next() and close yet. Still, do it safe and always be prepared to be called through io_wq_submit_work(). Zero req->close.put_file in prep, and call __close_fd_get_file() IFF it's NULL. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit ca687877e05ad1bf5b4cefd9cdd091044626deac Merge: 23fc02e36e4f 300e549b6e53 Author: Linus Torvalds Date: Mon Jun 8 12:47:09 2020 -0700 Merge tag 'gfs2-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - An iopen glock locking scheme rework that speeds up deletes of inodes accessed from multiple nodes - Various bug fixes and debugging improvements - Convert gfs2-glocks.txt to ReST * tag 'gfs2-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: fix use-after-free on transaction ail lists gfs2: new slab for transactions gfs2: initialize transaction tr_ailX_lists earlier gfs2: Smarter iopen glock waiting gfs2: Wake up when setting GLF_DEMOTE gfs2: Check inode generation number in delete_work_func gfs2: Move inode generation number check into gfs2_inode_lookup gfs2: Minor gfs2_lookup_by_inum cleanup gfs2: Try harder to delete inodes locally gfs2: Give up the iopen glock on contention gfs2: Turn gl_delete into a delayed work gfs2: Keep track of deleted inode generations in LVBs gfs2: Allow ASPACE glocks to also have an lvb gfs2: instrumentation wrt log_flush stuck gfs2: introduce new gfs2_glock_assert_withdraw gfs2: print mapping->nrpages in glock dump for address space glocks gfs2: Only do glock put in gfs2_create_inode for free inodes gfs2: Allow lock_nolock mount to specify jid=X gfs2: Don't ignore inode write errors during inode_go_sync docs: filesystems: convert gfs2-glocks.txt to ReST commit f8d8b46cd20e3a262c17ba1061640d9c190ad769 Author: Masahiro Yamada Date: Tue May 5 19:03:19 2020 +0900 scripts/dtc: use pkg-config to include in non-standard path Commit 067c650c456e ("dtc: Use pkg-config to locate libyaml") added 'pkg-config --libs' to link libyaml installed in a non-standard location. yamltree.c includes , but that commit did not add the search path for . If /usr/include/yaml.h does not exist, it fails to build. A user can explicitly pass HOSTCFLAGS to work around it, but the policy is not consistent. There are two ways to deal with libraries in a non-default location. [1] Use HOSTCFLAGS and HOSTLDFLAGS for additional search paths for headers and libraries. They are documented in Documentation/kbuild/kbuild.rst $ make HOSTCFLAGS='-I /include' HOSTLDFLAGS='-L /lib' [2] Use pkg-config 'pkg-config --cflags' for querying the header search path 'pkg-config --libs' for querying the lib and its path If we go with pkg-config, use [2] consistently. Do not mix up [1] and [2]. Signed-off-by: Masahiro Yamada Signed-off-by: Rob Herring commit 23fc02e36e4f657af242e59175c891b27c704935 Merge: 4e3a16ee9148 bfa50e1427e4 Author: Linus Torvalds Date: Mon Jun 8 12:05:31 2020 -0700 Merge tag 's390-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Vasily Gorbik: - Add support for multi-function devices in pci code. - Enable PF-VF linking for architectures using the pdev->no_vf_scan flag (currently just s390). - Add reipl from NVMe support. - Get rid of critical section cleanup in entry.S. - Refactor PNSO CHSC (perform network subchannel operation) in cio and qeth. - QDIO interrupts and error handling fixes and improvements, more refactoring changes. - Align ioremap() with generic code. - Accept requests without the prefetch bit set in vfio-ccw. - Enable path handling via two new regions in vfio-ccw. - Other small fixes and improvements all over the code. * tag 's390-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (52 commits) vfio-ccw: make vfio_ccw_regops variables declarations static vfio-ccw: Add trace for CRW event vfio-ccw: Wire up the CRW irq and CRW region vfio-ccw: Introduce a new CRW region vfio-ccw: Refactor IRQ handlers vfio-ccw: Introduce a new schib region vfio-ccw: Refactor the unregister of the async regions vfio-ccw: Register a chp_event callback for vfio-ccw vfio-ccw: Introduce new helper functions to free/destroy regions vfio-ccw: document possible errors vfio-ccw: Enable transparent CCW IPL from DASD s390/pci: Log new handle in clp_disable_fh() s390/cio, s390/qeth: cleanup PNSO CHSC s390/qdio: remove q->first_to_kick s390/qdio: fix up qdio_start_irq() kerneldoc s390: remove critical section cleanup from entry.S s390: add machine check SIGP s390/pci: ioremap() align with generic code s390/ap: introduce new ap function ap_get_qdev() Documentation/s390: Update / remove developerWorks web links ... commit 4e3a16ee9148e966678bbc713579235422271a63 Merge: 9413b9a690ec 431275afdc71 Author: Linus Torvalds Date: Mon Jun 8 11:42:23 2020 -0700 Merge tag 'iommu-updates-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: "A big part of this is a change in how devices get connected to IOMMUs in the core code. It contains the change from the old add_device() / remove_device() to the new probe_device() / release_device() call-backs. As a result functionality that was previously in the IOMMU drivers has been moved to the IOMMU core code, including IOMMU group allocation for each device. The reason for this change was to get more robust allocation of default domains for the iommu groups. A couple of fixes were necessary after this was merged into the IOMMU tree, but there are no known bugs left. The last fix is applied on-top of the merge commit for the topic branches. Other than that change, we have: - Removal of the driver private domain handling in the Intel VT-d driver. This was fragile code and I am glad it is gone now. - More Intel VT-d updates from Lu Baolu: - Nested Shared Virtual Addressing (SVA) support to the Intel VT-d driver - Replacement of the Intel SVM interfaces to the common IOMMU SVA API - SVA Page Request draining support - ARM-SMMU Updates from Will: - Avoid mapping reserved MMIO space on SMMUv3, so that it can be claimed by the PMU driver - Use xarray to manage ASIDs on SMMUv3 - Reword confusing shutdown message - DT compatible string updates - Allow implementations to override the default domain type - A new IOMMU driver for the Allwinner Sun50i platform - Support for ATS gets disabled for untrusted devices (like Thunderbolt devices). This includes a PCI patch, acked by Bjorn. - Some cleanups to the AMD IOMMU driver to make more use of IOMMU core features. - Unification of some printk formats in the Intel and AMD IOMMU drivers and in the IOVA code. - Updates for DT bindings - A number of smaller fixes and cleanups. * tag 'iommu-updates-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (109 commits) iommu: Check for deferred attach in iommu_group_do_dma_attach() iommu/amd: Remove redundant devid checks iommu/amd: Store dev_data as device iommu private data iommu/amd: Merge private header files iommu/amd: Remove PD_DMA_OPS_MASK iommu/amd: Consolidate domain allocation/freeing iommu/amd: Free page-table in protection_domain_free() iommu/amd: Allocate page-table in protection_domain_init() iommu/amd: Let free_pagetable() not rely on domain->pt_root iommu/amd: Unexport get_dev_data() iommu/vt-d: Fix compile warning iommu/vt-d: Remove real DMA lookup in find_domain iommu/vt-d: Allocate domain info for real DMA sub-devices iommu/vt-d: Only clear real DMA device's context entries iommu: Remove iommu_sva_ops::mm_exit() uacce: Remove mm_exit() op iommu/sun50i: Constify sun50i_iommu_ops iommu/hyper-v: Constify hyperv_ir_domain_ops iommu/vt-d: Use pci_ats_supported() iommu/arm-smmu-v3: Use pci_ats_supported() ... commit 33d077996a87175b155fe88030e8fec7ca76327e Author: Stefano Brivio Date: Wed Jun 3 01:50:11 2020 +0200 netfilter: nft_set_rbtree: Don't account for expired elements on insertion While checking the validity of insertion in __nft_rbtree_insert(), we currently ignore conflicting elements and intervals only if they are not active within the next generation. However, if we consider expired elements and intervals as potentially conflicting and overlapping, we'll return error for entries that should be added instead. This is particularly visible with garbage collection intervals that are comparable with the element timeout itself, as reported by Mike Dillinger. Other than the simple issue of denying insertion of valid entries, this might also result in insertion of a single element (opening or closing) out of a given interval. With single entries (that are inserted as intervals of size 1), this leads in turn to the creation of new intervals. For example: # nft add element t s { 192.0.2.1 } # nft list ruleset [...] elements = { 192.0.2.1-255.255.255.255 } Always ignore expired elements active in the next generation, while checking for conflicts. It might be more convenient to introduce a new macro that covers both inactive and expired items, as this type of check also appears quite frequently in other set back-ends. This is however beyond the scope of this fix and can be deferred to a separate patch. Other than the overlap detection cases introduced by commit 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion"), we also have to cover the original conflict check dealing with conflicts between two intervals of size 1, which was introduced before support for timeout was introduced. This won't return an error to the user as -EEXIST is masked by nft if NLM_F_EXCL is not given, but would result in a silent failure adding the entry. Reported-by: Mike Dillinger Cc: # 5.6.x Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support") Fixes: 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion") Signed-off-by: Stefano Brivio Acked-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 9413b9a690ec8aeaedea74bb875079d36f295304 Merge: 107821669a9c efe792f39ddb Author: Linus Torvalds Date: Mon Jun 8 11:33:38 2020 -0700 Merge tag 'drm-next-msm-5.8-2020-06-08' of git://anongit.freedesktop.org/drm/drm Pull drm msm updates from Dave Airlie: "This tree has been in next for a couple of weeks, but Rob missed an arm32 build issue, so I was awaiting the tree with a patch reverted. - new gpu support: a405, a640, a650 - dpu: color processing support - mdp5: support for msm8x36 (the thing with a405) - some prep work for per-context pagetables (ie the part that does not depend on in-flight iommu patches) - last but not least, UABI update for submit ioctl to support syncobj (from Bas)" * tag 'drm-next-msm-5.8-2020-06-08' of git://anongit.freedesktop.org/drm/drm: (30 commits) Revert "drm/msm/dpu: add support for clk and bw scaling for display" drm/msm/a6xx: skip HFI set freq if GMU is powered down drm/msm: Update the MMU helper function APIs drm/msm: Refactor address space initialization drm/msm: Attach the IOMMU device during initialization drm/msm/dpu: dpu_setup_dspp_pcc() can be static drm/msm/a6xx: a6xx_hfi_send_start() can be static drm/msm/a4xx: add a405_registers for a405 device drm/msm/a4xx: add adreno a405 support drm/msm/a6xx: update a6xx_hw_init for A640 and A650 drm/msm/a6xx: enable GMU log drm/msm/a6xx: update pdc/rscc GMU registers for A640/A650 drm/msm/a6xx: A640/A650 GMU firmware path drm/msm/a6xx: HFI v2 for A640 and A650 drm/msm/a6xx: add A640/A650 to gpulist drm/msm/a6xx: use msm_gem for GMU memory objects drm/msm: add internal MSM_BO_MAP_PRIV flag drm/msm: add msm_gem_get_and_pin_iova_range drm/msm: Check for powered down HW in the devfreq callbacks drm/msm/dpu: update bandwidth threshold check ... commit 107821669a9cbf234f260d576039983b64c7cb6d Merge: 20b0d0672216 8d286e2ff440 Author: Linus Torvalds Date: Mon Jun 8 11:31:10 2020 -0700 Merge tag 'drm-next-2020-06-08' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "These are the fixes from last week for the stuff merged in the merge window. It got a bunch of nouveau fixes for HDA audio on some new GPUs, some i915 and some amdpgu fixes. i915: - gvt: Fix one clang warning on debug only function - Use ARRAY_SIZE for coccicheck warning - Use after free fix for display global state. - Whitelisting context-local timestamp on Gen9 and two scheduler fixes with deps (Cc: stable) - Removal of write flag from sysfs files where ineffective nouveau: - HDMI/DP audio HDA fixes - display hang fix for Volta/Turing - GK20A regression fix. amdgpu: - Prevent hwmon accesses while GPU is in reset - CTF interrupt fix - Backlight fix for renoir - Fix for display sync groups - Display bandwidth validation workaround" * tag 'drm-next-2020-06-08' of git://anongit.freedesktop.org/drm/drm: (28 commits) drm/nouveau/kms/nv50-: clear SW state of disabled windows harder drm/nouveau: gr/gk20a: Use firmware version 0 drm/nouveau/disp/gm200-: detect and potentially disable HDA support on some SORs drm/nouveau/disp/gp100: split SOR implementation from gm200 drm/nouveau/disp: modify OR allocation policy to account for HDA requirements drm/nouveau/disp: split part of OR allocation logic into a function drm/nouveau/disp: provide hint to OR allocation about HDA requirements drm/amd/display: Revalidate bandwidth before commiting DC updates drm/amdgpu/display: use blanked rather than plane state for sync groups drm/i915/params: fix i915.fake_lmem_start module param sysfs permissions drm/i915/params: don't expose inject_probe_failure in debugfs drm/i915: Whitelist context-local timestamp in the gen9 cmdparser drm/i915: Fix global state use-after-frees with a refcount drm/i915: Check for awaits on still currently executing requests drm/i915/gt: Do not schedule normal requests immediately along virtual drm/i915: Reorder await_execution before await_request drm/nouveau/kms/gt215-: fix race with audio driver runpm drm/nouveau/disp/gm200-: fix NV_PDISP_SOR_HDMI2_CTRL(n) selection Revert "drm/amd/display: disable dcn20 abm feature for bring up" drm/amd/powerplay: ack the SMUToHost interrupt on receive V2 ... commit 20b0d06722169e6e66049c8fe6f1a48adffb79c6 Merge: 63d72b93f226 db33ec371be8 Author: Linus Torvalds Date: Mon Jun 8 11:11:38 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge still more updates from Andrew Morton: "Various trees. Mainly those parts of MM whose linux-next dependents are now merged. I'm still sitting on ~160 patches which await merges from -next. Subsystems affected by this patch series: mm/proc, ipc, dynamic-debug, panic, lib, sysctl, mm/gup, mm/pagemap" * emailed patches from Andrew Morton : (52 commits) doc: cgroup: update note about conditions when oom killer is invoked module: move the set_fs hack for flush_icache_range to m68k nommu: use flush_icache_user_range in brk and mmap binfmt_flat: use flush_icache_user_range exec: use flush_icache_user_range in read_code exec: only build read_code when needed m68k: implement flush_icache_user_range arm: rename flush_cache_user_range to flush_icache_user_range xtensa: implement flush_icache_user_range sh: implement flush_icache_user_range asm-generic: add a flush_icache_user_range stub mm: rename flush_icache_user_range to flush_icache_user_page arm,sparc,unicore32: remove flush_icache_user_range riscv: use asm-generic/cacheflush.h powerpc: use asm-generic/cacheflush.h openrisc: use asm-generic/cacheflush.h m68knommu: use asm-generic/cacheflush.h microblaze: use asm-generic/cacheflush.h ia64: use asm-generic/cacheflush.h hexagon: use asm-generic/cacheflush.h ... commit db33ec371be8e45956e8cebb5b0fe641f008430b Author: Konstantin Khlebnikov Date: Sun Jun 7 21:42:55 2020 -0700 doc: cgroup: update note about conditions when oom killer is invoked Starting from v4.19 commit 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path") cgroup oom killer is no longer invoked only from page faults. Now it implements the same semantics as global OOM killer: allocation context invokes OOM killer and keeps retrying until success. [akpm@linux-foundation.org: fixes per Randy] Signed-off-by: Konstantin Khlebnikov Signed-off-by: Andrew Morton Acked-by: Michal Hocko Cc: Roman Gushchin Cc: Randy Dunlap Link: http://lkml.kernel.org/r/158894738928.208854.5244393925922074518.stgit@buzz Signed-off-by: Linus Torvalds commit 490741ab1beb9c9f6580e30c7cd91b17a7560369 Author: Christoph Hellwig Date: Sun Jun 7 21:42:52 2020 -0700 module: move the set_fs hack for flush_icache_range to m68k flush_icache_range generally operates on kernel addresses, but for some reason m68k needed a set_fs override. Move that into the m68k code insted of keeping it in the module loader. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Jessica Yu Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Link: http://lkml.kernel.org/r/20200515143646.3857579-30-hch@lst.de Signed-off-by: Linus Torvalds commit a75a2df68f87c4924c614204a85b29d82d5c7dc4 Author: Christoph Hellwig Date: Sun Jun 7 21:42:49 2020 -0700 nommu: use flush_icache_user_range in brk and mmap These obviously operate on user addresses. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Greg Ungerer Cc: Geert Uytterhoeven Link: http://lkml.kernel.org/r/20200515143646.3857579-29-hch@lst.de Signed-off-by: Linus Torvalds commit 79ef1e1fffebcfcb2c93463ca8d0f4a03eceb8f1 Author: Christoph Hellwig Date: Sun Jun 7 21:42:46 2020 -0700 binfmt_flat: use flush_icache_user_range load_flat_file works on user addresses. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Greg Ungerer Cc: Alexander Viro Link: http://lkml.kernel.org/r/20200515143646.3857579-28-hch@lst.de Signed-off-by: Linus Torvalds commit bce2b68b891af3dd02fdc1603786c1c28db8bfad Author: Christoph Hellwig Date: Sun Jun 7 21:42:43 2020 -0700 exec: use flush_icache_user_range in read_code read_code operates on user addresses. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexander Viro Link: http://lkml.kernel.org/r/20200515143646.3857579-27-hch@lst.de Signed-off-by: Linus Torvalds commit 48304f7994d74ef8fddde3ff27ce41aa61453d39 Author: Christoph Hellwig Date: Sun Jun 7 21:42:40 2020 -0700 exec: only build read_code when needed Only build read_code when binary formats that use it are built into the kernel. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexander Viro Link: http://lkml.kernel.org/r/20200515143646.3857579-26-hch@lst.de Signed-off-by: Linus Torvalds commit a1e81f9654eef650d3ee35c94a8cab00b5cd379c Author: Christoph Hellwig Date: Sun Jun 7 21:42:37 2020 -0700 m68k: implement flush_icache_user_range Rename the current flush_icache_range to flush_icache_user_range as per commit ae92ef8a4424 ("PATCH] flush icache in correct context") there seems to be an assumption that it operates on user addresses. Add a flush_icache_range around it that for now is a no-op. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Geert Uytterhoeven Cc: Geert Uytterhoeven Link: http://lkml.kernel.org/r/20200515143646.3857579-25-hch@lst.de Signed-off-by: Linus Torvalds commit fca7f8e6fdeb716420a348acf6ca9bc7e609f5c0 Author: Christoph Hellwig Date: Sun Jun 7 21:42:34 2020 -0700 arm: rename flush_cache_user_range to flush_icache_user_range flush_icache_user_range will be the name for a generic primitive. Move the arm name so that arm already has an implementation. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Russell King Link: http://lkml.kernel.org/r/20200515143646.3857579-24-hch@lst.de Signed-off-by: Linus Torvalds commit 70cd3444c17d80d227c9c6ff2287f10b7114e479 Author: Christoph Hellwig Date: Sun Jun 7 21:42:32 2020 -0700 xtensa: implement flush_icache_user_range The Xtensa implementation of flush_icache_range seems to be able to cope with user addresses. Just define flush_icache_user_range to flush_icache_range. [jcmvbkbc@gmail.com: fix flush_icache_user_range in noMMU configs] Link: http://lkml.kernel.org/r/20200525221556.4270-1-jcmvbkbc@gmail.com Signed-off-by: Christoph Hellwig Signed-off-by: Max Filippov Signed-off-by: Andrew Morton Cc: Chris Zankel Cc: Max Filippov Link: http://lkml.kernel.org/r/20200515143646.3857579-23-hch@lst.de Signed-off-by: Linus Torvalds commit 952ec41c44a4e9802f2c991912c117d2347832af Author: Christoph Hellwig Date: Sun Jun 7 21:42:28 2020 -0700 sh: implement flush_icache_user_range The SuperH implementation of flush_icache_range seems to be able to cope with user addresses. Just define flush_icache_user_range to flush_icache_range. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Yoshinori Sato Cc: Rich Felker Link: http://lkml.kernel.org/r/20200515143646.3857579-22-hch@lst.de Signed-off-by: Linus Torvalds commit 1268c33382facefd9c389d4c425e8f906f279c7b Author: Christoph Hellwig Date: Sun Jun 7 21:42:26 2020 -0700 asm-generic: add a flush_icache_user_range stub Define flush_icache_user_range to flush_icache_range unless the architecture provides its own implementation. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Arnd Bergmann Link: http://lkml.kernel.org/r/20200515143646.3857579-21-hch@lst.de Signed-off-by: Linus Torvalds commit 885f7f8e30468705926b3de53d32925bd7a51a03 Author: Christoph Hellwig Date: Sun Jun 7 21:42:22 2020 -0700 mm: rename flush_icache_user_range to flush_icache_user_page The function currently known as flush_icache_user_range only operates on a single page. Rename it to flush_icache_user_page as we'll need the name flush_icache_user_range for something else soon. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Geert Uytterhoeven Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Tony Luck Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Vincent Chen Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Arnd Bergmann Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20200515143646.3857579-20-hch@lst.de Signed-off-by: Linus Torvalds commit 97f52c1536f041fd9f0b62667864930c92ac93cf Author: Christoph Hellwig Date: Sun Jun 7 21:42:19 2020 -0700 arm,sparc,unicore32: remove flush_icache_user_range flush_icache_user_range is only used by , so remove it from the architectures that implement it, but don't use . Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Russell King Cc: "David S. Miller" Cc: Guan Xuetao Link: http://lkml.kernel.org/r/20200515143646.3857579-19-hch@lst.de Signed-off-by: Linus Torvalds commit 396eb69c6e3914c4aa7b2bdeaa7476cc48265df6 Author: Christoph Hellwig Date: Sun Jun 7 21:42:15 2020 -0700 riscv: use asm-generic/cacheflush.h RISC-V needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Also remove the pointless __KERNEL__ ifdef while we're at it. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Link: http://lkml.kernel.org/r/20200515143646.3857579-18-hch@lst.de Signed-off-by: Linus Torvalds commit 5019f76019e5780bad60248638891d13fd905e6e Author: Christoph Hellwig Date: Sun Jun 7 21:42:12 2020 -0700 powerpc: use asm-generic/cacheflush.h Power needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Also remove the pointless __KERNEL__ ifdef while we're at it. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Link: http://lkml.kernel.org/r/20200515143646.3857579-17-hch@lst.de Signed-off-by: Linus Torvalds commit e050945123065b1804446cf68cdd8dc2a6a2b9f2 Author: Christoph Hellwig Date: Sun Jun 7 21:42:09 2020 -0700 openrisc: use asm-generic/cacheflush.h OpenRISC needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Link: http://lkml.kernel.org/r/20200515143646.3857579-16-hch@lst.de Signed-off-by: Linus Torvalds commit 9e730ffac148127bc0cbc45097fe23d7e29a8130 Author: Christoph Hellwig Date: Sun Jun 7 21:42:06 2020 -0700 m68knommu: use asm-generic/cacheflush.h m68knommu needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Greg Ungerer Cc: Greg Ungerer Cc: Geert Uytterhoeven Link: http://lkml.kernel.org/r/20200515143646.3857579-15-hch@lst.de Signed-off-by: Linus Torvalds commit 03518c82b4b33592fed428d38925ce59df91b1c9 Author: Christoph Hellwig Date: Sun Jun 7 21:42:04 2020 -0700 microblaze: use asm-generic/cacheflush.h Microblaze needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Michal Simek Link: http://lkml.kernel.org/r/20200515143646.3857579-14-hch@lst.de Signed-off-by: Linus Torvalds commit 57b94ff59796bfbf7debebb2293b66d96f726a12 Author: Christoph Hellwig Date: Sun Jun 7 21:42:01 2020 -0700 ia64: use asm-generic/cacheflush.h IA64 needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Tony Luck Cc: Fenghua Yu Link: http://lkml.kernel.org/r/20200515143646.3857579-13-hch@lst.de Signed-off-by: Linus Torvalds commit af23eea561961108b22422750f07025d2fd91240 Author: Christoph Hellwig Date: Sun Jun 7 21:41:58 2020 -0700 hexagon: use asm-generic/cacheflush.h Hexagon needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Brian Cain Link: http://lkml.kernel.org/r/20200515143646.3857579-12-hch@lst.de Signed-off-by: Linus Torvalds commit 2d49d89c73fe9b76b02799a71e768b312ad65039 Author: Christoph Hellwig Date: Sun Jun 7 21:41:55 2020 -0700 c6x: use asm-generic/cacheflush.h C6x needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Mark Salter Cc: Aurelien Jacquiot Link: http://lkml.kernel.org/r/20200515143646.3857579-11-hch@lst.de Signed-off-by: Linus Torvalds commit a7ba121215faad444f94db5e89eb5d7dfc58ecb2 Author: Christoph Hellwig Date: Sun Jun 7 21:41:51 2020 -0700 arm64: use asm-generic/cacheflush.h ARM64 needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Catalin Marinas Cc: Will Deacon Link: http://lkml.kernel.org/r/20200515143646.3857579-10-hch@lst.de Signed-off-by: Linus Torvalds commit 43c74ca337ce623a5f0cb93e2903f4a88d3e98a7 Author: Christoph Hellwig Date: Sun Jun 7 21:41:48 2020 -0700 alpha: use asm-generic/cacheflush.h Alpha needs almost no cache flushing routines of its own. Rely on asm-generic/cacheflush.h for the defaults. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Link: http://lkml.kernel.org/r/20200515143646.3857579-9-hch@lst.de Signed-off-by: Linus Torvalds commit 76b3b58fac350c45e44a3868946ff5e454e8d367 Author: Christoph Hellwig Date: Sun Jun 7 21:41:45 2020 -0700 asm-generic: improve the flush_dcache_page stub There is a magic ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE cpp symbol that guards non-stub availability of flush_dcache_pagge. Use that to check if flush_dcache_pagg is implemented. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Arnd Bergmann Link: http://lkml.kernel.org/r/20200515143646.3857579-8-hch@lst.de Signed-off-by: Linus Torvalds commit e0cf615d725cb3b69f0bdf1d8afdd4d4c31b4fd1 Author: Christoph Hellwig Date: Sun Jun 7 21:41:42 2020 -0700 asm-generic: don't include in cacheflush.h This seems to lead to some crazy include loops when using asm-generic/cacheflush.h on more architectures, so leave it to the arch header for now. [hch@lst.de: fix warning] Link: http://lkml.kernel.org/r/20200520173520.GA11199@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Will Deacon Cc: Nick Piggin Cc: Peter Zijlstra Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Keith Busch Cc: Ira Weiny Cc: Arnd Bergmann Link: http://lkml.kernel.org/r/20200515143646.3857579-7-hch@lst.de Signed-off-by: Linus Torvalds commit 92a73bd29ad0a31cfa9241e86a557252ac77b217 Author: Christoph Hellwig Date: Sun Jun 7 21:41:39 2020 -0700 asm-generic: fix the inclusion guards for cacheflush.h cacheflush.h uses a somewhat to generic include guard name that clashes with various arch files. Use a more specific one. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Arnd Bergmann Link: http://lkml.kernel.org/r/20200515143646.3857579-6-hch@lst.de Signed-off-by: Linus Torvalds commit 7c95fda549bdd6308dc833e13263227a7238c50d Author: Christoph Hellwig Date: Sun Jun 7 21:41:36 2020 -0700 unicore32: remove flush_cache_user_range flush_cache_user_range is an ARMism not used by any generic or unicore32 specific code. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Guan Xuetao Link: http://lkml.kernel.org/r/20200515143646.3857579-5-hch@lst.de Signed-off-by: Linus Torvalds commit e292e7403e3fe048abec1a5fd83b3181748dcb1d Author: Christoph Hellwig Date: Sun Jun 7 21:41:32 2020 -0700 powerpc: unexport flush_icache_user_range flush_icache_user_range is only used by copy_to_user_page, which is only used by core VM code. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Link: http://lkml.kernel.org/r/20200515143646.3857579-4-hch@lst.de Signed-off-by: Linus Torvalds commit e7c1fa11b0b007e5b74c39be38d507d06aa19e8d Author: Christoph Hellwig Date: Sun Jun 7 21:41:29 2020 -0700 nds32: unexport flush_icache_page flush_icache_page is only used by mm/memory.c. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Greentime Hu Cc: Vincent Chen Link: http://lkml.kernel.org/r/20200515143646.3857579-3-hch@lst.de Signed-off-by: Linus Torvalds commit ce450ebf6179acf6e90dcc090e90face215faec4 Author: Christoph Hellwig Date: Sun Jun 7 21:41:25 2020 -0700 arm: fix the flush_icache_range arguments in set_fiq_handler Patch series "sort out the flush_icache_range mess", v2. flush_icache_range is mostly used for kernel address, except for the following cases: - the nommu brk and mmap implementations - the read_code helper that is only used for binfmt_flat, binfmt_elf_fdpic, and binfmt_aout including the broken ia32 compat version - binfmt_flat itself none of which really are used by a typical MMU enabled kernel, as a.out can only be build for alpha and m68k to start with. But strangely enough commit ae92ef8a4424 ("PATCH] flush icache in correct context") added a "set_fs(KERNEL_DS)" around the flush_icache_range call in the module loader, because apparently m68k assumed user pointers. This series first cleans up the cacheflush implementations, largely by switching as much as possible to the asm-generic version after a few preparations, then moves the misnamed current flush_icache_user_range to a new name, to finally introduce a real flush_icache_user_range to be used for the above use cases to flush the instruction cache for a userspace address range. The last patch then drops the set_fs in the module code and moves it into the m68k implementation. This patch (of 29): The arguments passed look bogus, try to fix them to something that seems to make sense. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Roman Zippel Cc: Jessica Yu Cc: Michal Simek Cc: Albert Ou Cc: Alexander Shishkin Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Anton Ivanov Cc: Arnaldo Carvalho de Melo Cc: Aurelien Jacquiot Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Chris Zankel Cc: Daniel Borkmann Cc: Dan Williams Cc: Dave Jiang Cc: "David S. Miller" Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Ira Weiny Cc: Ivan Kokshaysky Cc: Jeff Dike Cc: Jiri Olsa Cc: Jonas Bonn Cc: Keith Busch Cc: Mark Rutland Cc: Mark Salter Cc: Martin KaFai Lau Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Nick Piggin Cc: Palmer Dabbelt Cc: Palmer Dabbelt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Richard Henderson Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Song Liu Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vishal Verma Cc: Will Deacon Cc: Yonghong Song Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200515143646.3857579-1-hch@lst.de Link: http://lkml.kernel.org/r/20200515143646.3857579-2-hch@lst.de Signed-off-by: Linus Torvalds commit 690623e1b49603bdd3df4532b7911a2ce26fb4c4 Author: John Hubbard Date: Sun Jun 7 21:41:15 2020 -0700 vhost: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in approximately a "Case 5" scenario (accessing the data within a page), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Acked-by: Michael S. Tsirkin Acked-by: Pankaj Gupta Cc: Jason Wang Cc: Dave Chinner Cc: Jérôme Glisse Cc: Jonathan Corbet Cc: Souptick Joarder Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200529234309.484480-3-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit eaf4d22a9ea419bc4c85ad8f825a331bcc1ae340 Author: John Hubbard Date: Sun Jun 7 21:41:11 2020 -0700 docs: mm/gup: pin_user_pages.rst: add a "case 5" Patch series "vhost, docs: convert to pin_user_pages(), new "case 5"" It recently became clear to me that there are some get_user_pages*() callers that don't fit neatly into any of the four cases that are so far listed in pin_user_pages.rst. vhost.c is one of those. Add a Case 5 to the documentation, and refer to that when converting vhost.c. Thanks to Jan Kara for helping me (again) in understanding the interaction between get_user_pages() and page writeback [1]. This is based on today's mmotm, which has a nearby patch to pin_user_pages.rst that rewords cases 3 and 4. Note that I have only compile-tested the vhost.c patch, although that does also include cross-compiling for a few other arches. Any run-time testing would be greatly appreciated. [1] https://lore.kernel.org/r/20200529070343.GL14550@quack2.suse.cz This patch (of 2): There are four cases listed in pin_user_pages.rst. These are intended to help developers figure out whether to use get_user_pages*(), or pin_user_pages*(). However, the four cases do not cover all the situations. For example, drivers/vhost/vhost.c has a "pin, write to page, set page dirty, unpin" case. Add a fifth case, to help explain that there is a general pattern that requires pin_user_pages*() API calls. [jhubbard@nvidia.com: v2] Link: http://lkml.kernel.org/r/20200601052633.853874-2-jhubbard@nvidia.com Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Cc: Vlastimil Babka Cc: Jan Kara Cc: Jérôme Glisse Cc: Dave Chinner Cc: Jonathan Corbet Cc: Souptick Joarder Cc: "Michael S . Tsirkin" Cc: Jason Wang Link: http://lkml.kernel.org/r/20200529234309.484480-1-jhubbard@nvidia.com Link: http://lkml.kernel.org/r/20200529234309.484480-2-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 6a005645edd6de2b535783c96e66e08cccc5e067 Author: John Hubbard Date: Sun Jun 7 21:41:08 2020 -0700 mm/gup: documentation fix for pin_user_pages*() APIs All of the pin_user_pages*() API calls will cause pages to be dma-pinned. As such, they are all suitable for either DMA, RDMA, and/or Direct IO. The documentation should say so, but it was instead saying that three of the API calls were only suitable for Direct IO. This was discovered when a reviewer wondered why an API call that specifically recommended against Case 2 (DMA/RDMA) was being used in a DMA situation [1]. Fix this by simply deleting those claims. The gup.c comments already refer to the more extensive Documentation/core-api/pin_user_pages.rst, which does have the correct guidance. So let's just write it once, there. [1] https://lore.kernel.org/r/20200529074658.GM30374@kadam Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Pankaj Gupta Acked-by: Souptick Joarder Cc: Dan Carpenter Cc: Jan Kara Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200529084515.46259-1-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 55a650c35fea7cfdf989647f37960dfaf76da737 Author: John Hubbard Date: Sun Jun 7 21:41:05 2020 -0700 mm/gup: frame_vector: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), and all of the callers so far were in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Acked-by: David Hildenbrand Cc: Daniel Vetter Cc: Jérôme Glisse Cc: Vlastimil Babka Cc: Jan Kara Cc: Dave Chinner Cc: Pankaj Gupta Cc: Souptick Joarder Link: http://lkml.kernel.org/r/20200527223243.884385-3-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 420c2091b65a95b1daea4c36d27df4ac5f38033d Author: John Hubbard Date: Sun Jun 7 21:41:02 2020 -0700 mm/gup: introduce pin_user_pages_locked() Patch series "mm/gup: introduce pin_user_pages_locked(), use it in frame_vector.c", v2. This adds yet one more pin_user_pages*() variant, and uses that to convert mm/frame_vector.c. With this, along with maybe 20 or 30 other recent patches in various trees, we are close to having the relevant gup call sites converted--with the notable exception of the bio/block layer. This patch (of 2): Introduce pin_user_pages_locked(), which is nearly identical to get_user_pages_locked() except that it sets FOLL_PIN and rejects FOLL_GET. As with other pairs of get_user_pages*() and pin_user_pages() API calls, it's prudent to assert that FOLL_PIN is *not* set in the get_user_pages*() call, so add that as part of this. [jhubbard@nvidia.com: v2] Link: http://lkml.kernel.org/r/20200531234131.770697-2-jhubbard@nvidia.com Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Pankaj Gupta Cc: Daniel Vetter Cc: Jérôme Glisse Cc: Vlastimil Babka Cc: Jan Kara Cc: Dave Chinner Cc: Souptick Joarder Link: http://lkml.kernel.org/r/20200531234131.770697-1-jhubbard@nvidia.com Link: http://lkml.kernel.org/r/20200527223243.884385-1-jhubbard@nvidia.com Link: http://lkml.kernel.org/r/20200527223243.884385-2-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit a8f80f53fb5c367e1a160adfb3b092a788faeb29 Author: John Hubbard Date: Sun Jun 7 21:40:59 2020 -0700 mm/gup: update pin_user_pages.rst for "case 3" (mmu notifiers) Update case 3 so that it covers the use of mmu notifiers, for hardware that does, or does not have replayable page faults. Also, elaborate case 4 slightly, as it was quite cryptic. Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Cc: Daniel Vetter Cc: Jérôme Glisse Cc: Vlastimil Babka Cc: Jan Kara Cc: Dave Chinner Cc: Jonathan Corbet Link: http://lkml.kernel.org/r/20200527194953.11130-1-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit dadbb612f6e50bbf9101c2f5d82690ce9ea4d66b Author: Souptick Joarder Date: Sun Jun 7 21:40:55 2020 -0700 mm/gup.c: convert to use get_user_{page|pages}_fast_only() API __get_user_pages_fast() renamed to get_user_pages_fast_only() to align with pin_user_pages_fast_only(). As part of this we will get rid of write parameter. Instead caller will pass FOLL_WRITE to get_user_pages_fast_only(). This will not change any existing functionality of the API. All the callers are changed to pass FOLL_WRITE. Also introduce get_user_page_fast_only(), and use it in a few places that hard-code nr_pages to 1. Updated the documentation of the API. Signed-off-by: Souptick Joarder Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: Paul Mackerras [arch/powerpc/kvm] Cc: Matthew Wilcox Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Stephen Rothwell Cc: Mike Rapoport Cc: Aneesh Kumar K.V Cc: Michal Suchanek Link: http://lkml.kernel.org/r/1590396812-31277-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Linus Torvalds commit e77132e75845470065768e2205727e6be52cb7f4 Author: Rafael Aquini Date: Sun Jun 7 21:40:51 2020 -0700 kernel/sysctl.c: ignore out-of-range taint bits introduced via kernel.tainted Users with SYS_ADMIN capability can add arbitrary taint flags to the running kernel by writing to /proc/sys/kernel/tainted or issuing the command 'sysctl -w kernel.tainted=...'. This interface, however, is open for any integer value and this might cause an invalid set of flags being committed to the tainted_mask bitset. This patch introduces a simple way for proc_taint() to ignore any eventual invalid bit coming from the user input before committing those bits to the kernel tainted_mask. Signed-off-by: Rafael Aquini Signed-off-by: Andrew Morton Reviewed-by: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: "Theodore Ts'o" Link: http://lkml.kernel.org/r/20200512223946.888020-1-aquini@redhat.com Signed-off-by: Linus Torvalds commit 60c958d8df9cfc40b745d6cd583cfbfa7525ead6 Author: Guilherme G. Piccoli Date: Sun Jun 7 21:40:48 2020 -0700 panic: add sysctl to dump all CPUs backtraces on oops event Usually when the kernel reaches an oops condition, it's a point of no return; in case not enough debug information is available in the kernel splat, one of the last resorts would be to collect a kernel crash dump and analyze it. The problem with this approach is that in order to collect the dump, a panic is required (to kexec-load the crash kernel). When in an environment of multiple virtual machines, users may prefer to try living with the oops, at least until being able to properly shutdown their VMs / finish their important tasks. This patch implements a way to collect a bit more debug details when an oops event is reached, by printing all the CPUs backtraces through the usage of NMIs (on architectures that support that). The sysctl added (and documented) here was called "oops_all_cpu_backtrace", and when set will (as the name suggests) dump all CPUs backtraces. Far from ideal, this may be the last option though for users that for some reason cannot panic on oops. Most of times oopses are clear enough to indicate the kernel portion that must be investigated, but in virtual environments it's possible to observe hypervisor/KVM issues that could lead to oopses shown in other guests CPUs (like virtual APIC crashes). This patch hence aims to help debug such complex issues without resorting to kdump. Signed-off-by: Guilherme G. Piccoli Signed-off-by: Andrew Morton Reviewed-by: Kees Cook Cc: Luis Chamberlain Cc: Iurii Zaikin Cc: Thomas Gleixner Cc: Vlastimil Babka Cc: Randy Dunlap Cc: Matthew Wilcox Link: http://lkml.kernel.org/r/20200327224116.21030-1-gpiccoli@canonical.com Signed-off-by: Linus Torvalds commit 0ec9dc9bcba0a62b0844e54c1caf6b8b0bf6b5b4 Author: Guilherme G. Piccoli Date: Sun Jun 7 21:40:45 2020 -0700 kernel/hung_task.c: introduce sysctl to print all traces when a hung task is detected Commit 401c636a0eeb ("kernel/hung_task.c: show all hung tasks before panic") introduced a change in that we started to show all CPUs backtraces when a hung task is detected _and_ the sysctl/kernel parameter "hung_task_panic" is set. The idea is good, because usually when observing deadlocks (that may lead to hung tasks), the culprit is another task holding a lock and not necessarily the task detected as hung. The problem with this approach is that dumping backtraces is a slightly expensive task, specially printing that on console (and specially in many CPU machines, as servers commonly found nowadays). So, users that plan to collect a kdump to investigate the hung tasks and narrow down the deadlock definitely don't need the CPUs backtrace on dmesg/console, which will delay the panic and pollute the log (crash tool would easily grab all CPUs traces with 'bt -a' command). Also, there's the reciprocal scenario: some users may be interested in seeing the CPUs backtraces but not have the system panic when a hung task is detected. The current approach hence is almost as embedding a policy in the kernel, by forcing the CPUs backtraces' dump (only) on hung_task_panic. This patch decouples the panic event on hung task from the CPUs backtraces dump, by creating (and documenting) a new sysctl called "hung_task_all_cpu_backtrace", analog to the approach taken on soft/hard lockups, that have both a panic and an "all_cpu_backtrace" sysctl to allow individual control. The new mechanism for dumping the CPUs backtraces on hung task detection respects "hung_task_warnings" by not dumping the traces in case there's no warnings left. Signed-off-by: Guilherme G. Piccoli Signed-off-by: Andrew Morton Reviewed-by: Kees Cook Cc: Tetsuo Handa Link: http://lkml.kernel.org/r/20200327223646.20779-1-gpiccoli@canonical.com Signed-off-by: Linus Torvalds commit f117955a2255721a6a0e9cecf6cad3a6eb43cbc3 Author: Guilherme G. Piccoli Date: Sun Jun 7 21:40:42 2020 -0700 kernel/watchdog.c: convert {soft/hard}lockup boot parameters to sysctl aliases After a recent change introduced by Vlastimil's series [0], kernel is able now to handle sysctl parameters on kernel command line; also, the series introduced a simple infrastructure to convert legacy boot parameters (that duplicate sysctls) into sysctl aliases. This patch converts the watchdog parameters softlockup_panic and {hard,soft}lockup_all_cpu_backtrace to use the new alias infrastructure. It fixes the documentation too, since the alias only accepts values 0 or 1, not the full range of integers. We also took the opportunity here to improve the documentation of the previously converted hung_task_panic (see the patch series [0]) and put the alias table in alphabetical order. [0] http://lkml.kernel.org/r/20200427180433.7029-1-vbabka@suse.cz Signed-off-by: Guilherme G. Piccoli Signed-off-by: Andrew Morton Acked-by: Vlastimil Babka Cc: Kees Cook Cc: Iurii Zaikin Cc: Luis Chamberlain Link: http://lkml.kernel.org/r/20200507214624.21911-1-gpiccoli@canonical.com Signed-off-by: Linus Torvalds commit 4f2f682d89d83fb6194562321d875253282d8496 Author: Vlastimil Babka Date: Sun Jun 7 21:40:38 2020 -0700 lib/test_sysctl: support testing of sysctl. boot parameter Testing is done by a new parameter debug.test_sysctl.boot_int which defaults to 0 and it's expected that the tester passes a boot parameter that sets it to 1. The test checks if it's set to 1. To distinguish true failure from parameter not being set, the test checks /proc/cmdline for the expected parameter, and whether test_sysctl is built-in and not a module. [vbabka@suse.cz: skip the new test if boot_int sysctl is not present] Link: http://lkml.kernel.org/r/305af605-1e60-cf84-fada-6ce1ca37c102@suse.cz Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Cc: Alexey Dobriyan Cc: Christian Brauner Cc: David Rientjes Cc: "Eric W . Biederman" Cc: Greg Kroah-Hartman Cc: "Guilherme G . Piccoli" Cc: Iurii Zaikin Cc: Ivan Teterevkov Cc: Kees Cook Cc: Luis Chamberlain Cc: Masami Hiramatsu Cc: Matthew Wilcox Cc: Michal Hocko Cc: Michal Hocko Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200427180433.7029-6-vbabka@suse.cz Signed-off-by: Linus Torvalds commit 4546cde96f9fbef8f59c645f2e0677b5a390ed0d Author: Vlastimil Babka Date: Sun Jun 7 21:40:35 2020 -0700 tools/testing/selftests/sysctl/sysctl.sh: support CONFIG_TEST_SYSCTL=y The testing script recommends CONFIG_TEST_SYSCTL=y, but actually only works with CONFIG_TEST_SYSCTL=m. Testing of sysctl setting via boot param however requires the test to be built-in, so make sure the test script supports it. Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Acked-by: Luis Chamberlain Cc: Alexey Dobriyan Cc: Christian Brauner Cc: David Rientjes Cc: "Eric W . Biederman" Cc: Greg Kroah-Hartman Cc: "Guilherme G . Piccoli" Cc: Iurii Zaikin Cc: Ivan Teterevkov Cc: Kees Cook Cc: Masami Hiramatsu Cc: Matthew Wilcox Cc: Michal Hocko Cc: Michal Hocko Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200427180433.7029-5-vbabka@suse.cz Signed-off-by: Linus Torvalds commit b467f3ef3c50c4fa8926ca07f7db9a33a645e13a Author: Vlastimil Babka Date: Sun Jun 7 21:40:31 2020 -0700 kernel/hung_task convert hung_task_panic boot parameter to sysctl We can now handle sysctl parameters on kernel command line and have infrastructure to convert legacy command line options that duplicate sysctl to become a sysctl alias. This patch converts the hung_task_panic parameter. Note that the sysctl handler is more strict and allows only 0 and 1, while the legacy parameter allowed any non-zero value. But there is little reason anyone would not be using 1. Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Reviewed-by: Kees Cook Acked-by: Michal Hocko Cc: Alexey Dobriyan Cc: Christian Brauner Cc: David Rientjes Cc: "Eric W . Biederman" Cc: Greg Kroah-Hartman Cc: "Guilherme G . Piccoli" Cc: Iurii Zaikin Cc: Ivan Teterevkov Cc: Luis Chamberlain Cc: Masami Hiramatsu Cc: Matthew Wilcox Cc: Michal Hocko Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200427180433.7029-4-vbabka@suse.cz Signed-off-by: Linus Torvalds commit 0a477e1ae21b28267b9bd8599f75c115291b1666 Author: Vlastimil Babka Date: Sun Jun 7 21:40:27 2020 -0700 kernel/sysctl: support handling command line aliases We can now handle sysctl parameters on kernel command line, but historically some parameters introduced their own command line equivalent, which we don't want to remove for compatibility reasons. We can, however, convert them to the generic infrastructure with a table translating the legacy command line parameters to their sysctl names, and removing the one-off param handlers. This patch adds the support and makes the first conversion to demonstrate it, on the (deprecated) numa_zonelist_order parameter. Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Reviewed-by: Luis Chamberlain Acked-by: Kees Cook Acked-by: Michal Hocko Cc: Alexey Dobriyan Cc: Christian Brauner Cc: David Rientjes Cc: "Eric W . Biederman" Cc: Greg Kroah-Hartman Cc: "Guilherme G . Piccoli" Cc: Iurii Zaikin Cc: Ivan Teterevkov Cc: Masami Hiramatsu Cc: Matthew Wilcox Cc: Michal Hocko Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200427180433.7029-3-vbabka@suse.cz Signed-off-by: Linus Torvalds commit 3db978d480e2843979a2b56f2f7da726f2b295b2 Author: Vlastimil Babka Date: Sun Jun 7 21:40:24 2020 -0700 kernel/sysctl: support setting sysctl parameters from kernel command line Patch series "support setting sysctl parameters from kernel command line", v3. This series adds support for something that seems like many people always wanted but nobody added it yet, so here's the ability to set sysctl parameters via kernel command line options in the form of sysctl.vm.something=1 The important part is Patch 1. The second, not so important part is an attempt to clean up legacy one-off parameters that do the same thing as a sysctl. I don't want to remove them completely for compatibility reasons, but with generic sysctl support the idea is to remove the one-off param handlers and treat the parameters as aliases for the sysctl variants. I have identified several parameters that mention sysctl counterparts in Documentation/admin-guide/kernel-parameters.txt but there might be more. The conversion also has varying level of success: - numa_zonelist_order is converted in Patch 2 together with adding the necessary infrastructure. It's easy as it doesn't really do anything but warn on deprecated value these days. - hung_task_panic is converted in Patch 3, but there's a downside that now it only accepts 0 and 1, while previously it was any integer value - nmi_watchdog maps to two sysctls nmi_watchdog and hardlockup_panic, so there's no straighforward conversion possible - traceoff_on_warning is a flag without value and it would be required to handle that somehow in the conversion infractructure, which seems pointless for a single flag This patch (of 5): A recently proposed patch to add vm_swappiness command line parameter in addition to existing sysctl [1] made me wonder why we don't have a general support for passing sysctl parameters via command line. Googling found only somebody else wondering the same [2], but I haven't found any prior discussion with reasons why not to do this. Settings the vm_swappiness issue aside (the underlying issue might be solved in a different way), quick search of kernel-parameters.txt shows there are already some that exist as both sysctl and kernel parameter - hung_task_panic, nmi_watchdog, numa_zonelist_order, traceoff_on_warning. A general mechanism would remove the need to add more of those one-offs and might be handy in situations where configuration by e.g. /etc/sysctl.d/ is impractical. Hence, this patch adds a new parse_args() pass that looks for parameters prefixed by 'sysctl.' and tries to interpret them as writes to the corresponding sys/ files using an temporary in-kernel procfs mount. This mechanism was suggested by Eric W. Biederman [3], as it handles all dynamically registered sysctl tables, even though we don't handle modular sysctls. Errors due to e.g. invalid parameter name or value are reported in the kernel log. The processing is hooked right before the init process is loaded, as some handlers might be more complicated than simple setters and might need some subsystems to be initialized. At the moment the init process can be started and eventually execute a process writing to /proc/sys/ then it should be also fine to do that from the kernel. Sysctls registered later on module load time are not set by this mechanism - it's expected that in such scenarios, setting sysctl values from userspace is practical enough. [1] https://lore.kernel.org/r/BL0PR02MB560167492CA4094C91589930E9FC0@BL0PR02MB5601.namprd02.prod.outlook.com/ [2] https://unix.stackexchange.com/questions/558802/how-to-set-sysctl-using-kernel-command-line-parameter [3] https://lore.kernel.org/r/87bloj2skm.fsf@x220.int.ebiederm.org/ Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Reviewed-by: Luis Chamberlain Reviewed-by: Masami Hiramatsu Acked-by: Kees Cook Acked-by: Michal Hocko Cc: Iurii Zaikin Cc: Ivan Teterevkov Cc: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox Cc: "Eric W . Biederman" Cc: "Guilherme G . Piccoli" Cc: Alexey Dobriyan Cc: Thomas Gleixner Cc: Greg Kroah-Hartman Cc: Christian Brauner Link: http://lkml.kernel.org/r/20200427180433.7029-1-vbabka@suse.cz Link: http://lkml.kernel.org/r/20200427180433.7029-2-vbabka@suse.cz Signed-off-by: Linus Torvalds commit 01f39c1c11ee5bf44a1df49e47eb53a86515b9dc Author: Manfred Spraul Date: Sun Jun 7 21:40:20 2020 -0700 xarray.h: correct return code documentation for xa_store_{bh,irq}() __xa_store() and xa_store() document that the functions can fail, and that the return code can be an xa_err() encoded error code. xa_store_bh() and xa_store_irq() do not document that the functions can fail and that they can also return xa_err() encoded error codes. Thus: Update the documentation. Signed-off-by: Manfred Spraul Signed-off-by: Andrew Morton Cc: Matthew Wilcox Link: http://lkml.kernel.org/r/20200430111424.16634-1-manfred@colorfullife.com Signed-off-by: Linus Torvalds commit db38d5c106dfdd7cb7207c83267d82fdf4950b61 Author: Rafael Aquini Date: Sun Jun 7 21:40:17 2020 -0700 kernel: add panic_on_taint Analogously to the introduction of panic_on_warn, this patch introduces a kernel option named panic_on_taint in order to provide a simple and generic way to stop execution and catch a coredump when the kernel gets tainted by any given flag. This is useful for debugging sessions as it avoids having to rebuild the kernel to explicitly add calls to panic() into the code sites that introduce the taint flags of interest. For instance, if one is interested in proceeding with a post-mortem analysis at the point a given code path is hitting a bad page (i.e. unaccount_page_cache_page(), or slab_bug()), a coredump can be collected by rebooting the kernel with 'panic_on_taint=0x20' amended to the command line. Another, perhaps less frequent, use for this option would be as a means for assuring a security policy case where only a subset of taints, or no single taint (in paranoid mode), is allowed for the running system. The optional switch 'nousertaint' is handy in this particular scenario, as it will avoid userspace induced crashes by writes to sysctl interface /proc/sys/kernel/tainted causing false positive hits for such policies. [akpm@linux-foundation.org: tweak kernel-parameters.txt wording] Suggested-by: Qian Cai Signed-off-by: Rafael Aquini Signed-off-by: Andrew Morton Reviewed-by: Luis Chamberlain Cc: Dave Young Cc: Baoquan He Cc: Jonathan Corbet Cc: Kees Cook Cc: Randy Dunlap Cc: "Theodore Ts'o" Cc: Adrian Bunk Cc: Greg Kroah-Hartman Cc: Laura Abbott Cc: Jeff Mahoney Cc: Jiri Kosina Cc: Takashi Iwai Link: http://lkml.kernel.org/r/20200515175502.146720-1-aquini@redhat.com Signed-off-by: Linus Torvalds commit ceabef7dd71720aef58bd182943352c9c307a3de Author: Orson Zhai Date: Sun Jun 7 21:40:14 2020 -0700 dynamic_debug: add an option to enable dynamic debug for modules only Instead of enabling dynamic debug globally with CONFIG_DYNAMIC_DEBUG, CONFIG_DYNAMIC_DEBUG_CORE will only enable core function of dynamic debug. With the DYNAMIC_DEBUG_MODULE defined for any modules, dynamic debug will be tied to them. This is useful for people who only want to enable dynamic debug for kernel modules without worrying about kernel image size and memory consumption is increasing too much. [orson.zhai@unisoc.com: v2] Link: http://lkml.kernel.org/r/1587408228-10861-1-git-send-email-orson.unisoc@gmail.com Signed-off-by: Orson Zhai Signed-off-by: Andrew Morton Acked-by: Greg Kroah-Hartman Acked-by: Petr Mladek Cc: Jonathan Corbet Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Jason Baron Cc: Randy Dunlap Link: http://lkml.kernel.org/r/1586521984-5890-1-git-send-email-orson.unisoc@gmail.com Signed-off-by: Linus Torvalds commit e1eb26fa62d04ec0955432be1aa8722a97cb52e7 Author: Giuseppe Scrivano Date: Sun Jun 7 21:40:10 2020 -0700 ipc/namespace.c: use a work queue to free_ipc the reason is to avoid a delay caused by the synchronize_rcu() call in kern_umount() when the mqueue mount is freed. the code: #define _GNU_SOURCE #include #include #include #include int main() { int i; for (i = 0; i < 1000; i++) if (unshare(CLONE_NEWIPC) < 0) error(EXIT_FAILURE, errno, "unshare"); } goes from Command being timed: "./ipc-namespace" User time (seconds): 0.00 System time (seconds): 0.06 Percent of CPU this job got: 0% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.05 to Command being timed: "./ipc-namespace" User time (seconds): 0.00 System time (seconds): 0.02 Percent of CPU this job got: 96% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.03 Signed-off-by: Giuseppe Scrivano Signed-off-by: Andrew Morton Reviewed-by: Paul E. McKenney Reviewed-by: Waiman Long Cc: Davidlohr Bueso Cc: Manfred Spraul Link: http://lkml.kernel.org/r/20200225145419.527994-1-gscrivan@redhat.com Signed-off-by: Linus Torvalds commit 4b78e2013a374f379457ceba7dc860d9fc28156b Author: Jules Irenge Date: Sun Jun 7 21:40:07 2020 -0700 ipc/msg: add missing annotation for freeque() Sparse reports a warning at freeque() warning: context imbalance in freeque() - unexpected unlock The root cause is the missing annotation at freeque() Add the missing __releases(RCU) annotation Add the missing __releases(&msq->q_perm) annotation Signed-off-by: Jules Irenge Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Boqun Feng Cc: Lu Shuaibing Cc: Nathan Chancellor Cc: Manfred Spraul Cc: Davidlohr Bueso Link: http://lkml.kernel.org/r/20200403160505.2832-2-jbi.octave@gmail.com Signed-off-by: Linus Torvalds commit 92fb1db26eefc11554820f11ce8e92007da2fbf4 Author: SeongJae Park Date: Sun Jun 7 21:40:04 2020 -0700 mm/page_idle.c: skip offline pages 'Idle page tracking' users can pass random pfn that might be mapped to an offline page. To avoid accessing such pages, this commit modifies the 'page_idle_get_page()' to use 'pfn_to_online_page()' instead of 'pfn_valid()' and 'pfn_to_page()' combination, so that the pfn mapped to an offline page can be skipped. Reported-by: David Hildenbrand Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Reviewed-by: Pankaj Gupta Link: http://lkml.kernel.org/r/20200605092502.18018-2-sjpark@amazon.com Signed-off-by: Linus Torvalds commit 63d72b93f2262900c8de74ad0f5a58e0d452c9d3 Author: Linus Torvalds Date: Sun Jun 7 12:19:06 2020 -0700 vfs: clean up posix_acl_permission() logic aroudn MAY_NOT_BLOCK posix_acl_permission() does not care about MAY_NOT_BLOCK, and in fact the permission logic internally must not check that bit (it's only for upper layers to decide whether they can block to do IO to look up the acl information or not). But the way the code was written, it _looked_ like it cared, since the function explicitly did not mask that bit off. But it has exactly two callers: one for when that bit is set, which first clears the bit before calling posix_acl_permission(), and the other call site when that bit was clear. So stop the silly games "saving" the MAY_NOT_BLOCK bit that must not be used for the actual permission test, and that currently is pointlessly cleared by the callers when the function itself should just not care. Signed-off-by: Linus Torvalds commit 5fc475b749c72e0b3f3991b33a90d302f52ae746 Author: Linus Torvalds Date: Fri Jun 5 13:40:45 2020 -0700 vfs: do not do group lookup when not necessary Rasmus Villemoes points out that the 'in_group_p()' tests can be a noticeable expense, and often completely unnecessary. A common situation is that the 'group' bits are the same as the 'other' bits wrt the permissions we want to test. So rewrite 'acl_permission_check()' to not bother checking for group ownership when the permission check doesn't care. For example, if we're asking for read permissions, and both 'group' and 'other' allow reading, there's really no reason to check if we're part of the group or not: either way, we'll allow it. Rasmus says: "On a bog-standard Ubuntu 20.04 install, a workload consisting of compiling lots of userspace programs (i.e., calling lots of short-lived programs that all need to get their shared libs mapped in, and the compilers poking around looking for system headers - lots of /usr/lib, /usr/bin, /usr/include/ accesses) puts in_group_p around 0.1% according to perf top. System-installed files are almost always 0755 (directories and binaries) or 0644, so in most cases, we can avoid the binary search and the cost of pulling the cred->groups array and in_group_p() .text into the cpu cache" Reported-by: Rasmus Villemoes Signed-off-by: Linus Torvalds commit 951e2736f4b11b58dc44d41964fa17c3527d882a Author: Michał Mirosław Date: Mon Jun 8 18:50:39 2020 +0200 ALSA: pcm: disallow linking stream to itself Prevent SNDRV_PCM_IOCTL_LINK linking stream to itself - the code can't handle it. Fixed commit is not where bug was introduced, but changes the context significantly. Cc: stable@vger.kernel.org Fixes: 0888c321de70 ("pcm_native: switch to fdget()/fdput()") Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/89c4a2487609a0ed6af3ecf01cc972bdc59a7a2d.1591634956.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai commit 88d8822d30cc6f668d44a1a7466bed5a1f85f607 Author: Takashi Iwai Date: Fri Jun 5 08:41:17 2020 +0200 ALSA: usb-audio: Manage auto-pm of all bundled interfaces Currently USB-audio driver manages the auto-pm of the primary interface although a card may consist of multiple interfaces. This may leave the secondary and other interfaces left running unnecessarily after the auto-suspend. This patch allows the driver managing the auto-pm of all bundled interfaces per card. The chip->pm_intf field is extended as chip->intf[] to contain the array of assigned interfaces, and the runtime-PM is performed to all those interfaces. Tested-by: Macpaul Lin Link: https://lore.kernel.org/r/20200605064117.28504-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4263eb6880df8383fff0efb872278a99eb6142c8 Merge: 636338d7968e 8e326a8bdef3 Author: Tony Lindgren Date: Mon Jun 8 10:14:49 2020 -0700 Merge branch 'fixes-v5.7' into fixes commit 8e326a8bdef3fb42b92bf2742e8405d9b9209367 Author: Suman Anna Date: Fri Jun 5 17:13:47 2020 -0500 ARM: dts: dra7-evm-common: Fix duplicate mailbox nodes The mailbox nodes defined in various dts files have been moved to common dra7-ipu-dsp-common.dtsi and dra74-ipu-dsp-common.dtsi files in commit a11a2f73b32d ("ARM: dts: dra7-ipu-dsp-common: Move mailboxes into common files"), but the nodes were erroneously left out in the dra7-evm-common.dtsi file. Fix this by removing these duplicate nodes. Fixes: a11a2f73b32d ("ARM: dts: dra7-ipu-dsp-common: Move mailboxes into common files") Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit ebf89ed78b6ad6bc53f49a9dc0754fa97bb11e4a Author: Suman Anna Date: Fri Jun 5 17:13:46 2020 -0500 ARM: dts: dra7: Fix timer nodes properly for timer_sys_ck clocks The commit 5390130f3b28 ("ARM: dts: dra7: add timer_sys_ck entries for IPU/DSP timers") was added to allow the OMAP clocksource timer driver to use the clock aliases when reconfiguring the parent clock source for the timer functional clocks after the timer_sys_ck clock aliases got cleaned up in commit a8202cd5174d ("clk: ti: dra7: drop unnecessary clock aliases"). The above patch however has missed adding the entries for couple of timers (14, 15 and 16), and also added erroneously in the parent ti-sysc nodes for couple of clocks (timers 4, 5 and 6). Fix these properly, so that any of these timers can be used with OMAP remoteproc IPU and DSP devices. The always-on timers 1 and 12 are not expected to use this clock source, so they are not modified. Fixes: 5390130f3b28 ("ARM: dts: dra7: add timer_sys_ck entries for IPU/DSP timers") Signed-off-by: Suman Anna Signed-off-by: Tony Lindgren commit 6a9110f9f7e96a059902415b4ac90b07e5f06961 Merge: 9f872f924545 5390130f3b28 Author: Tony Lindgren Date: Mon Jun 8 10:11:49 2020 -0700 Merge commit '5390130f3b288db7d67de5e6c29d0de70d327ff0' into fixes-v5.7 commit 9f872f924545324a06fa216ad38132804c20f2db Author: Oskar Holmlund Date: Fri Jun 5 19:51:09 2020 +0200 ARM: dts: Fix am33xx.dtsi ti,sysc-mask wrong softreset flag AM335x TRM: Figure 16-23 define sysconfig register and soft_reset are in first position corresponding to SYSC_OMAP4_SOFTRESET defined in ti-sysc.h. Fixes: 0782e8572ce4 ("ARM: dts: Probe am335x musb with ti-sysc") Signed-off-by: Oskar Holmlund Signed-off-by: Tony Lindgren commit 3f311e8993ed18fb7325373ec0f82a7f8e8be82e Author: Oskar Holmlund Date: Fri Jun 5 19:49:23 2020 +0200 ARM: dts: Fix am33xx.dtsi USB ranges length AM335x TRM: Table 2-1 defines USBSS - USB Queue Manager in memory region 0x4740 0000 to 0x4740 7FFF. Looks like the older TRM revisions list the range from 0x5000 to 0x8000 as reserved. Fixes: 0782e8572ce4 ("ARM: dts: Probe am335x musb with ti-sysc") Signed-off-by: Oskar Holmlund [tony@atomide.com: updated comments] Signed-off-by: Tony Lindgren commit 146f5cdeda153a1c7866cd240d2f464543d368c0 Author: SeongJae Park Date: Sat Jun 6 10:37:46 2020 +0200 docs/memory-barriers.txt/kokr: smp_mb__{before,after}_atomic(): update Documentation Translate this commit to Korean: 39323c64b8a9 ("smp_mb__{before,after}_atomic(): update Documentation") Signed-off-by: SeongJae Park Reviewed-by: Yunjae Lee Link: https://lore.kernel.org/r/20200606083746.20869-1-sjpark@amazon.de Signed-off-by: Jonathan Corbet commit a8c73c1a614f6da6c0b04c393f87447e28cb6de4 Author: Denis Efremov Date: Fri Jun 5 12:32:03 2020 +0300 io_uring: use kvfree() in io_sqe_buffer_register() Use kvfree() to free the pages and vmas, since they are allocated by kvmalloc_array() in a loop. Fixes: d4ef647510b1 ("io_uring: avoid page allocation warnings") Signed-off-by: Denis Efremov Signed-off-by: Jens Axboe Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200605093203.40087-1-efremov@linux.com commit efe68c1ca8f49e8c06afd74b699411bfbb8ba1ff Author: Bijan Mottahedeh Date: Thu Jun 4 18:01:52 2020 -0700 io_uring: validate the full range of provided buffers for access Account for the number of provided buffers when validating the address range. Signed-off-by: Bijan Mottahedeh Signed-off-by: Jens Axboe commit 3699158d3fe31a7739356ce4ad6934d6ede445c7 Author: Dejin Zheng Date: Wed May 27 22:45:31 2020 +0800 Documentation: devres: add missing entry for devm_platform_get_and_ioremap_resource() The devm_platform_get_and_ioremap_resource() should be documented in devres.rst. Add the missing entry. Signed-off-by: Dejin Zheng Link: https://lore.kernel.org/r/20200527144531.9376-1-zhengdejin5@gmail.com Signed-off-by: Jonathan Corbet commit 93431e0607e58a3c997a134adc0fad4fdc147dab Author: Alexander A. Klimov Date: Tue May 26 08:05:44 2020 +0200 Replace HTTP links with HTTPS ones: documentation Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov Link: https://lore.kernel.org/r/20200526060544.25127-1-grandmaster@al2klimov.de Signed-off-by: Jonathan Corbet commit b55e45a59cb6a421fc52084ea154e7cf21e6b569 Author: Lukas Bulwahn Date: Sun May 31 20:56:18 2020 +0200 docs: it_IT: address invalid reference warnings Documentation generation warns: it_IT/kernel-hacking/hacking.rst: WARNING: unknown document: ../core-api/symbol/namespaces it_IT/process/5.Posting.rst: WARNING: undefined label: it_email_clients it_IT/process/submitting-patches.rst: WARNING: undefined label: it_email_clients it_IT/process/howto.rst: WARNING: undefined label: it_managementstyle Refer to English documentation, as Italian translation does not exist, and add labels for Italian process documents to resolve label references. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20200531185618.7099-1-lukas.bulwahn@gmail.com Signed-off-by: Jonathan Corbet commit a5001484e203377e553326bc8f3f91e4ea80bcc2 Author: Lukas Bulwahn Date: Sun May 31 20:35:56 2020 +0200 doc: zh_CN: use doc reference to resolve undefined label warning Documentation generation warns: Documentation/translations/zh_CN/filesystems/debugfs.rst:5: WARNING: undefined label: debugfs_index Use doc reference for files rather than introducing a label to refer to. This resolves the warning above. Signed-off-by: Lukas Bulwahn Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20200531183556.5751-1-lukas.bulwahn@gmail.com Signed-off-by: Jonathan Corbet commit 99702304745941271c73ad7de18f38d93844929c Author: Jonathan Corbet Date: Wed Jun 3 16:10:20 2020 -0600 docs: Update the location of the LF NDA program The link to the Linux Foundation NDA program got broken in one of their web-site thrashups; now that the information is back online, point to its current location. This should last until the next thrashup... Reported-by: Lukas Bulwahn Reviewed-by: Lukas Bulwahn Signed-off-by: Jonathan Corbet commit cc8246debbe4146668acafcfa45358cfe286d03c Author: Heinrich Schuchardt Date: Fri Jun 5 05:04:05 2020 +0200 docs: dev-tools: coccinelle: underlines Underline lengths should match the lengths of headings to avoid build warnings with Sphinx. Signed-off-by: Heinrich Schuchardt Acked-by: Julia Lawall Link: https://lore.kernel.org/r/20200605030405.6479-1-xypron.glpk@gmx.de Signed-off-by: Jonathan Corbet commit 1eb2f96d0bffb2cca1fb7249ad9b6b4daa1d1d6a Author: Chen Zhou Date: Fri May 8 20:40:00 2020 +0800 sunrpc: use kmemdup_nul() in gssp_stringify() It is more efficient to use kmemdup_nul() if the size is known exactly . According to doc: "Note: Use kmemdup_nul() instead if the size is known exactly." Signed-off-by: Chen Zhou Signed-off-by: J. Bruce Fields commit 961abd78adcb4c72c343fcd9f9dc5e2ebbe9b448 Author: Shaokun Zhang Date: Fri Jun 5 17:43:41 2020 +0800 drivers/perf: hisi: Fix wrong value for all counters enable In L3C uncore PMU drivers, bit16 is used to control all counters enable & disable. Wrong value is given in the driver and its default value is 1'b1, it can work because each PMU counter has its own control bits too. Let's fix the wrong value. Fixes: 2940bc433370 ("perf: hisi: Add support for HiSilicon SoC L3C PMU driver") Signed-off-by: Shaokun Zhang Cc: Will Deacon Cc: Mark Rutland Link: https://lore.kernel.org/r/1591350221-32275-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Will Deacon commit 91970bef48d68d06b2bb3f464b572ad50941f6a9 Author: Joe Perches Date: Sat Jun 6 12:25:50 2020 -0700 arm64: ftrace: Change CONFIG_FTRACE_WITH_REGS to CONFIG_DYNAMIC_FTRACE_WITH_REGS CONFIG_FTRACE_WITH_REGS does not exist as a Kconfig symbol. Fixes: 3b23e4991fb6 ("arm64: implement ftrace with regs") Signed-off-by: Joe Perches Acked-by: Mark Rutland Link: https://lore.kernel.org/r/b9b27f2233bd1fa31d72ff937beefdae0e2104e5.camel@perches.com Signed-off-by: Will Deacon commit f3a1381ec84ec1fdc8091f9935f97e836792b6a7 Author: Sivaprakash Murugesan Date: Mon Jun 8 15:07:24 2020 +0530 dt-bindings: mailbox: Add YAML schemas for QCOM APCS global block Qualcomm APCS global block provides a bunch of generic properties which are required in a device tree. Add YAML schema for these properties. Reviewed-by: Rob Herring Signed-off-by: Sivaprakash Murugesan Signed-off-by: Jassi Brar commit 7ff0d4490ebadae8037a079a70c5cac13385a808 Author: Christoph Hellwig Date: Wed Jun 3 07:52:37 2020 +0200 trace: fix an incorrect __user annotation on stack_trace_sysctl No user pointers for sysctls anymore. Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler") Reported-by: build test robot Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit a2541dcb51127dc31934ab93bc99ae7df458e41b Author: Christoph Hellwig Date: Wed Jun 3 07:52:36 2020 +0200 random: fix an incorrect __user annotation on proc_do_entropy No user pointers for sysctls anymore. Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler") Reported-by: build test robot Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit c7388c1f8fb6d8687403e9554c873f9df4512797 Author: Christoph Hellwig Date: Wed Jun 3 07:52:35 2020 +0200 net/sysctl: remove leftover __user annotations on neigh_proc_dointvec* Remove the leftover __user annotation on the prototypes for neigh_proc_dointvec*. The implementations already got this right, but the headers kept the __user tags around. Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler") Reported-by: build test robot Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 56965ac7253ece22050cf31ea5d1558e4c49cff2 Author: Christoph Hellwig Date: Wed Jun 3 07:52:34 2020 +0200 net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl cpumask_parse_user works on __user pointers, so this is wrong now. Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler") Reported-by: build test robot Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 1f2436229bf64ac040f2f5018df059c21fc5526a Author: Andrii Nakryiko Date: Sun Jun 7 17:36:15 2020 -0700 selftests/bpf: Fix ringbuf selftest sample counting undeterminism Fix test race, in which background poll can get either 5 or 6 samples, depending on timing of notification. Prevent this by open-coding sample triggering and forcing notification for the very last sample only. Also switch to using atomic increments and exchanges for more obviously reliable counting and checking. Additionally, check expected processed sample counters for single-threaded use cases as well. Fixes: 9a5f25ad30e5 ("selftests/bpf: Fix sample_cnt shared between two threads") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200608003615.3549991-1-andriin@fb.com commit e649b3f0188f8fd34dd0dde8d43fd3312b902fb2 Author: Eiichi Tsukata Date: Sat Jun 6 13:26:27 2020 +0900 KVM: x86: Fix APIC page invalidation race Commit b1394e745b94 ("KVM: x86: fix APIC page invalidation") tried to fix inappropriate APIC page invalidation by re-introducing arch specific kvm_arch_mmu_notifier_invalidate_range() and calling it from kvm_mmu_notifier_invalidate_range_start. However, the patch left a possible race where the VMCS APIC address cache is updated *before* it is unmapped: (Invalidator) kvm_mmu_notifier_invalidate_range_start() (Invalidator) kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD) (KVM VCPU) vcpu_enter_guest() (KVM VCPU) kvm_vcpu_reload_apic_access_page() (Invalidator) actually unmap page Because of the above race, there can be a mismatch between the host physical address stored in the APIC_ACCESS_PAGE VMCS field and the host physical address stored in the EPT entry for the APIC GPA (0xfee0000). When this happens, the processor will not trap APIC accesses, and will instead show the raw contents of the APIC-access page. Because Windows OS periodically checks for unexpected modifications to the LAPIC register, this will show up as a BSOD crash with BugCheck CRITICAL_STRUCTURE_CORRUPTION (109) we are currently seeing in https://bugzilla.redhat.com/show_bug.cgi?id=1751017. The root cause of the issue is that kvm_arch_mmu_notifier_invalidate_range() cannot guarantee that no additional references are taken to the pages in the range before kvm_mmu_notifier_invalidate_range_end(). Fortunately, this case is supported by the MMU notifier API, as documented in include/linux/mmu_notifier.h: * If the subsystem * can't guarantee that no additional references are taken to * the pages in the range, it has to implement the * invalidate_range() notifier to remove any references taken * after invalidate_range_start(). The fix therefore is to reload the APIC-access page field in the VMCS from kvm_mmu_notifier_invalidate_range() instead of ..._range_start(). Cc: stable@vger.kernel.org Fixes: b1394e745b94 ("KVM: x86: fix APIC page invalidation") Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=197951 Signed-off-by: Eiichi Tsukata Message-Id: <20200606042627.61070-1-eiichi.tsukata@nutanix.com> Signed-off-by: Paolo Bonzini commit 573fcbfd319ccef26caa3700320242accea7fd5c Author: Hui Wang Date: Mon Jun 8 19:55:41 2020 +0800 ALSA: hda/realtek - add a pintbl quirk for several Lenovo machines A couple of Lenovo ThinkCentre machines all have 2 front mics and they use the same codec alc623 and have the same pin config, so add a pintbl entry for those machines to apply the fixup ALC283_FIXUP_HEADSET_MIC. Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20200608115541.9531-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai commit e18035cf5cb3d2bf8e4f4d350a23608bd208b934 Author: Michał Mirosław Date: Mon Jun 8 12:06:32 2020 +0200 ALSA: pcm: fix snd_pcm_link() lockdep splat Add and use snd_pcm_stream_lock_nested() in snd_pcm_link/unlink implementation. The code is fine, but generates a lockdep complaint: ============================================ WARNING: possible recursive locking detected 5.7.1mq+ #381 Tainted: G O -------------------------------------------- pulseaudio/4180 is trying to acquire lock: ffff888402d6f508 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xda8/0xee0 [snd_pcm] but task is already holding lock: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&group->lock); lock(&group->lock); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by pulseaudio/4180: #0: ffffffffa1a05190 (snd_pcm_link_rwsem){++++}-{3:3}, at: snd_pcm_common_ioctl+0xca0/0xee0 [snd_pcm] #1: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] [...] Cc: stable@vger.kernel.org Fixes: f57f3df03a8e ("ALSA: pcm: More fine-grained PCM link locking") Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/37252c65941e58473b1219ca9fab03d48f47e3e3.1591610330.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai commit 9ec8ade812240f3ef553b5e8bfc74deec3f14339 Author: Geert Uytterhoeven Date: Mon Jun 8 12:00:49 2020 +0200 spi: spidev_test: Use %u to format unsigned numbers Consistently use %u to format unsigned numbers. For "bits" this doesn't matter that much, as it is "uint8_t". However, "speed" is "uint32_t", so in case people use "-s -1" to force the maximum, they would see: max speed: -1 Hz (4294967 KHz) While at it, use "k" (kilo) instead of "K" (kelvin) in "kHz". Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200608100049.30648-1-geert+renesas@glider.be Signed-off-by: Mark Brown commit e680a4098f6404191e0e438a9758715b0bff6d7f Author: Bartosz Golaszewski Date: Sun Jun 7 11:34:21 2020 +0200 regmap: fix the kerneldoc for regmap_test_bits() The kerneldoc comment for regmap_test_bits() says that it returns -1 on regmap_read() failure. This is not true - it will propagate the error code returned by regmap_read(). Fix it. Fixes: aa2ff9dbaedd ("regmap: provide helpers for simple bit operations") Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20200607093421.22209-1-brgl@bgdev.pl Signed-off-by: Mark Brown commit fb7333dfd812062d3d51f377e70c1d3a3788472b Author: Paolo Bonzini Date: Mon Jun 8 07:11:47 2020 -0400 KVM: SVM: fix calls to is_intercept is_intercept takes an INTERCEPT_* constant, not SVM_EXIT_*; because of this, the compiler was removing the body of the conditionals, as if is_intercept returned 0. This unveils a latent bug: when clearing the VINTR intercept, int_ctl must also be changed in the L1 VMCB (svm->nested.hsave), just like the intercept itself is also changed in the L1 VMCB. Otherwise V_IRQ remains set and, due to the VINTR intercept being clear, we get a spurious injection of a vector 0 interrupt on the next L2->L1 vmexit. Reported-by: Qian Cai Signed-off-by: Paolo Bonzini commit 75ad6e800217220b8ee63904fb472fd5c3819259 Author: Vitaly Kuznetsov Date: Mon Jun 8 13:23:46 2020 +0200 KVM: selftests: fix vmx_preemption_timer_test build with GCC10 GCC10 fails to build vmx_preemption_timer_test: gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 -fno-stack-protector -fno-PIE -I../../../../tools/include -I../../../../tools/arch/x86/include -I../../../../usr/include/ -Iinclude -Ix86_64 -Iinclude/x86_64 -I.. -pthread -no-pie x86_64/evmcs_test.c ./linux/tools/testing/selftests/kselftest_harness.h ./linux/tools/testing/selftests/kselftest.h ./linux/tools/testing/selftests/kvm/libkvm.a -o ./linux/tools/testing/selftests/kvm/x86_64/evmcs_test /usr/bin/ld: ./linux/tools/testing/selftests/kvm/libkvm.a(vmx.o): ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:603: multiple definition of `ctrl_exit_rev'; /tmp/ccMQpvNt.o: ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:603: first defined here /usr/bin/ld: ./linux/tools/testing/selftests/kvm/libkvm.a(vmx.o): ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:602: multiple definition of `ctrl_pin_rev'; /tmp/ccMQpvNt.o: ./linux/tools/testing/selftests/kvm/include/x86_64/vmx.h:602: first defined here ... ctrl_exit_rev/ctrl_pin_rev/basic variables are only used in vmx_preemption_timer_test.c, just move them there. Fixes: 8d7fbf01f9af ("KVM: selftests: VMX preemption timer migration test") Reported-by: Marcelo Bandeira Condotta Signed-off-by: Vitaly Kuznetsov Message-Id: <20200608112346.593513-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 5ae1452f5ff3084a6a273b9980499620eae20f7e Author: Vitaly Kuznetsov Date: Mon Jun 8 13:23:45 2020 +0200 KVM: selftests: Add x86_64/debug_regs to .gitignore Add x86_64/debug_regs to .gitignore. Reported-by: Marcelo Bandeira Condotta Fixes: 449aa906e67e ("KVM: selftests: Add KVM_SET_GUEST_DEBUG test") Signed-off-by: Vitaly Kuznetsov Message-Id: <20200608112346.593513-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 25597f64c2f6fffa367d1e6ff4f62b9a751f9051 Author: Vitaly Kuznetsov Date: Fri Jun 5 13:59:06 2020 +0200 Revert "KVM: x86: work around leak of uninitialized stack contents" handle_vmptrst()/handle_vmread() stopped injecting #PF unconditionally and switched to nested_vmx_handle_memory_failure() which just kills the guest with KVM_EXIT_INTERNAL_ERROR in case of MMIO access, zeroing 'exception' in kvm_write_guest_virt_system() is not needed anymore. This reverts commit 541ab2aeb28251bf7135c7961f3a6080eebcc705. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200605115906.532682-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 7a35e515a7055f483f87d12041c41db11b36c9ee Author: Vitaly Kuznetsov Date: Fri Jun 5 13:59:05 2020 +0200 KVM: VMX: Properly handle kvm_read/write_guest_virt*() result Syzbot reports the following issue: WARNING: CPU: 0 PID: 6819 at arch/x86/kvm/x86.c:618 kvm_inject_emulated_page_fault+0x210/0x290 arch/x86/kvm/x86.c:618 ... Call Trace: ... RIP: 0010:kvm_inject_emulated_page_fault+0x210/0x290 arch/x86/kvm/x86.c:618 ... nested_vmx_get_vmptr+0x1f9/0x2a0 arch/x86/kvm/vmx/nested.c:4638 handle_vmon arch/x86/kvm/vmx/nested.c:4767 [inline] handle_vmon+0x168/0x3a0 arch/x86/kvm/vmx/nested.c:4728 vmx_handle_exit+0x29c/0x1260 arch/x86/kvm/vmx/vmx.c:6067 'exception' we're trying to inject with kvm_inject_emulated_page_fault() comes from: nested_vmx_get_vmptr() kvm_read_guest_virt() kvm_read_guest_virt_helper() vcpu->arch.walk_mmu->gva_to_gpa() but it is only set when GVA to GPA conversion fails. In case it doesn't but we still fail kvm_vcpu_read_guest_page(), X86EMUL_IO_NEEDED is returned and nested_vmx_get_vmptr() calls kvm_inject_emulated_page_fault() with zeroed 'exception'. This happen when the argument is MMIO. Paolo also noticed that nested_vmx_get_vmptr() is not the only place in KVM code where kvm_read/write_guest_virt*() return result is mishandled. VMX instructions along with INVPCID have the same issue. This was already noticed before, e.g. see commit 541ab2aeb282 ("KVM: x86: work around leak of uninitialized stack contents") but was never fully fixed. KVM could've handled the request correctly by going to userspace and performing I/O but there doesn't seem to be a good need for such requests in the first place. Introduce vmx_handle_memory_failure() as an interim solution. Note, nested_vmx_get_vmptr() now has three possible outcomes: OK, PF, KVM_EXIT_INTERNAL_ERROR and callers need to know if userspace exit is needed (for KVM_EXIT_INTERNAL_ERROR) in case of failure. We don't seem to have a good enum describing this tristate, just add "int *ret" to nested_vmx_get_vmptr() interface to pass the information. Reported-by: syzbot+2a7156e11dc199bdbd8a@syzkaller.appspotmail.com Suggested-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20200605115906.532682-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 956ad9d98b73f59e442cc119c98ba1e04e94fe6d Author: Rafael J. Wysocki Date: Thu Jun 4 19:22:26 2020 +0200 ACPI: PM: Avoid using power resources if there are none for D0 As recently reported, some platforms provide a list of power resources for device power state D3hot, through the _PR3 object, but they do not provide a list of power resources for device power state D0. Among other things, this causes acpi_device_get_power() to return D3hot as the current state of the device in question if all of the D3hot power resources are "on", because it sees the power_resources flag set and calls acpi_power_get_inferred_state() which finds that D3hot is the shallowest power state with all of the associated power resources turned "on", so that's what it returns. Moreover, that value takes precedence over the acpi_dev_pm_explicit_get() return value, because it means a deeper power state. The device may very well be in D0 physically at that point, however. Moreover, the presence of _PR3 without _PR0 for a given device means that only one D3-level power state can be supported by it. Namely, because there are no power resources to turn "off" when transitioning the device from D0 into D3cold (which should be supported since _PR3 is present), the evaluation of _PS3 should be sufficient to put it straight into D3cold, but this means that the effect of turning "on" the _PR3 power resources is unclear, so it is better to avoid doing that altogether. Consequently, there is no practical way do distinguish D3cold from D3hot for the device in question and the power states of it can be labeled so that D3hot is the deepest supported one (and Linux assumes that putting a device into D3hot via ACPI may cause power to be removed from it anyway, for legacy reasons). To work around the problem described above modify the ACPI enumeration of devices so that power resources are only used for device power management if the list of D0 power resources is not empty and make it mart D3cold as supported only if that is the case and the D3hot list of power resources is not empty too. Fixes: ef85bdbec444 ("ACPI / scan: Consolidate extraction of power resources lists") Link: https://bugzilla.kernel.org/show_bug.cgi?id=205057 Link: https://lore.kernel.org/linux-acpi/20200603194659.185757-1-hdegoede@redhat.com/ Reported-by: Hans de Goede Tested-by: Hans de Goede Tested-by: youling257@gmail.com Cc: 3.10+ # 3.10+ Signed-off-by: Rafael J. Wysocki Reviewed-by: Hans de Goede commit 4da1ced1e57c885b714255b130e17845234669ff Author: Jani Nikula Date: Tue Jun 2 18:11:26 2020 +0300 drm/i915/params: fix i915.reset module param type The reset member in i915_params was previously changed to unsigned, but this failed to change the actual module parameter. Fixes: aae970d8454b ("drm/i915: Mark i915.reset as unsigned") Cc: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200602151126.25626-1-jani.nikula@intel.com (cherry picked from commit 34becfdb945a5eb819b7c8e4f0ec5cc5952ec68f) Signed-off-by: Joonas Lahtinen commit d7466a5adbd61d79610981903eec19aaf8ac935d Author: Chris Wilson Date: Thu Jun 4 11:37:30 2020 +0100 drm/i915/gem: Mark the buffer pool as active for the cmdparser If the execbuf is interrupted after building the cmdparser pipeline, and before we commit to submitting the request to HW, we would attempt to clean up the cmdparser early. While we held active references to the vma being parsed and constructed, we did not hold an active reference for the buffer pool itself. The result was that an interrupted execbuf could still have run the cmdparser pipeline, but since the buffer pool was idle, its target vma could have been recycled. Note this problem only occurs if the cmdparser is running async due to pipelined waits on busy fences, and the execbuf is interrupted. Fixes: 686c7c35abc2 ("drm/i915/gem: Asynchronous cmdparser") Fixes: 16e87459673a ("drm/i915/gt: Move the batch buffer pool from the engine to the gt") Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200604103751.18816-1-chris@chris-wilson.co.uk (cherry picked from commit 57a78ca4eceab1ecb0299fba8a10211289329889) Signed-off-by: Joonas Lahtinen commit b3fb6de7c6019c5d8495c3a115d42a0f118f631c Author: Michael S. Tsirkin Date: Mon Jun 8 01:43:22 2020 -0400 virtio-mem: drop unnecessary initialization rc is initialized to -ENIVAL but that's never used. Drop it. Fixes: 5f1f79bbc9e2 ("virtio-mem: Paravirtualized memory hotplug") Reported-by: kernel test robot Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand commit 59d4bfc1e2c09435d91c980b03f7b72ce6e9f24e Author: Flavio Suligoi Date: Fri Jun 5 17:41:12 2020 +0200 net: fix wiki website url mac80211 and wireless files In the files: - net/mac80211/rx.c - net/wireless/Kconfig the wiki url is still the old "wireless.kernel.org" instead of the new "wireless.wiki.kernel.org" Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/20200605154112.16277-10-f.suligoi@asem.it Signed-off-by: Johannes Berg commit 97eda66421c44f1449e8d087fd05eab5d466afb7 Author: Flavio Suligoi Date: Fri Jun 5 17:41:11 2020 +0200 include: fix wiki website url in netlink interface header The wiki url is still the old "wireless.kernel.org" instead of the new "wireless.wiki.kernel.org" Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/20200605154112.16277-9-f.suligoi@asem.it Signed-off-by: Johannes Berg commit 327cdb98fb3eed8373777465759c44f8d123c227 Author: Flavio Suligoi Date: Fri Jun 5 17:41:04 2020 +0200 doc: networking: wireless: fix wiki website url In the files: - regulatory.rst - mac80211-injection.rst the wiki url is still the old "wireless.kernel.org" instead of the new "wireless.wiki.kernel.org" Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/20200605154112.16277-2-f.suligoi@asem.it Signed-off-by: Johannes Berg commit 2068cf7dfbc69c4097c95af3a0bd943ced155a76 Author: youngjun Date: Sun Jun 7 02:04:06 2020 -0700 ovl: remove unnecessary lock check Directory is always locked until "out_unlock" label. So lock check is not needed. Signed-off-by: youngjun Signed-off-by: Miklos Szeredi commit e4b0e41fee948ad327f9c912160aa4b50a6a4340 Author: Takashi Iwai Date: Mon Jun 8 09:15:13 2020 +0200 ALSA: usb-audio: Use the new macro for HP Dock rename quirks Replace the open-code with the new QUIRK_DEVICE_PROFILE() macro for simplicity. Fixes: 0c5086f56999 ("ALSA: usb-audio: Add vendor, product and profile name for HP Thunderbolt Dock") Link: https://lore.kernel.org/r/20200608071513.570-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0c5086f5699906ec8e31ea6509239489f060f2dc Author: Kai-Heng Feng Date: Mon Jun 8 14:26:28 2020 +0800 ALSA: usb-audio: Add vendor, product and profile name for HP Thunderbolt Dock The HP Thunderbolt Dock has two separate USB devices, one is for speaker and one is for headset. Add names for them so userspace can apply UCM settings. Signed-off-by: Kai-Heng Feng Cc: Link: https://lore.kernel.org/r/20200608062630.10806-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit efe792f39ddbc6396b9142afff97855ee357b492 Merge: 3d77e6a8804a 1cb2c4a2c89b Author: Dave Airlie Date: Mon Jun 8 13:22:56 2020 +1000 Merge https://gitlab.freedesktop.org/drm/msm into drm-next-msm-5.8 * new gpu support: a405, a640, a650 * dpu: color processing support * mdp5: support for msm8x36 (the thing with a405) * some prep work for per-context pagetables (ie the part that does not depend on in-flight iommu patches) * last but not least, UABI update for submit ioctl to support syncobj (from Bas) Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/ Date: Mon Jun 8 11:59:56 2020 +1000 Merge tag 'drm-intel-next-fixes-2020-06-04' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Includes gvt-next-fixes-2020-05-28 - Use after free fix for display global state. - Whitelisting context-local timestamp on Gen9 and two scheduler fixes with deps (Cc: stable) - Removal of write flag from sysfs files where ineffective Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200604150454.GA59322@jlahtine-desk.ger.corp.intel.com commit fa3fa2228c886435b3eea22cea4767f3fb07671f Merge: 3f29eacc3ea8 a24eaa5c5125 Author: Dave Airlie Date: Mon Jun 8 11:55:33 2020 +1000 Merge tag 'amd-drm-fixes-5.8-2020-06-04' of git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-fixes-5.8-2020-06-04 amdgpu: - Prevent hwmon accesses while GPU is in reset - CTF interrupt fix - Backlight fix for renoir - Fix for display sync groups - Display bandwidth validation workaround Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200604181900.4609-1-alexander.deucher@amd.com commit af7b4801030c07637840191c69eb666917e4135d Merge: 52e0ad262cd7 4d3da2d8d91f Author: Linus Torvalds Date: Sun Jun 7 17:27:45 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from David Miller: - Fix the build with certain Kconfig combinations for the Chelsio inline TLS device, from Rohit Maheshwar and Vinay Kumar Yadavi. - Fix leak in genetlink, from Cong Lang. - Fix out of bounds packet header accesses in seg6, from Ahmed Abdelsalam. - Two XDP fixes in the ENA driver, from Sameeh Jubran - Use rwsem in device rename instead of a seqcount because this code can sleep, from Ahmed S. Darwish. - Fix WoL regressions in r8169, from Heiner Kallweit. - Fix qed crashes in kdump mode, from Alok Prasad. - Fix the callbacks used for certain thermal zones in mlxsw, from Vadim Pasternak. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (35 commits) net: dsa: lantiq_gswip: fix and improve the unsupported interface error mlxsw: core: Use different get_trend() callbacks for different thermal zones net: dp83869: Reset return variable if PHY strap is read rhashtable: Drop raw RCU deref in nested_table_free cxgb4: Use kfree() instead kvfree() where appropriate net: qed: fixes crash while running driver in kdump kernel vsock/vmci: make vmci_vsock_transport_cb() static net: ethtool: Fix comment mentioning typo in IS_ENABLED() net: phy: mscc: fix Serdes configuration in vsc8584_config_init net: mscc: Fix OF_MDIO config check net: marvell: Fix OF_MDIO config check net: dp83867: Fix OF_MDIO config check net: dp83869: Fix OF_MDIO config check net: ethernet: mvneta: fix MVNETA_SKB_HEADROOM alignment ethtool: linkinfo: remove an unnecessary NULL check net/xdp: use shift instead of 64 bit division crypto/chtls:Fix compile error when CONFIG_IPV6 is disabled inet_connection_sock: clear inet_num out of destroy helper yam: fix possible memory leak in yam_init_driver lan743x: Use correct MAC_CR configuration for 1 GBit speed ... commit 52e0ad262cd76696e8cd8510944b0bfdc0c140a9 Merge: cf0c97f148e9 4f8ad7389817 Author: Linus Torvalds Date: Sun Jun 7 17:25:29 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next Pull sparc updates from David Miller: - Rework the sparc32 page tables so that READ_ONCE(*pmd), as done by generic code, operates on a word sized element. From Will Deacon. - Some scnprintf() conversions, from Chen Zhou. - A pin_user_pages() conversion from John Hubbard. - Several 32-bit ptrace register handling fixes and such from Al Viro. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: fix a braino in "sparc32: fix register window handling in genregs32_[gs]et()" sparc32: mm: Only call ctor()/dtor() functions for first and last user sparc32: mm: Disable SPLIT_PTLOCK_CPUS sparc32: mm: Don't try to free page-table pages if ctor() fails sparc32: register memory occupied by kernel as memblock.memory sparc: remove unused header file nfs_fs.h sparc32: fix register window handling in genregs32_[gs]et() sparc64: fix misuses of access_process_vm() in genregs32_[sg]et() oradax: convert get_user_pages() --> pin_user_pages() sparc: use scnprintf() in show_pciobppath_attr() in vio.c sparc: use scnprintf() in show_pciobppath_attr() in pci.c tty: vcc: Fix error return code in vcc_probe() sparc32: mm: Reduce allocation size for PMD and PTE tables sparc32: mm: Change pgtable_t type to pte_t * instead of struct page * sparc32: mm: Restructure sparc32 MMU page-table layout sparc32: mm: Fix argument checking in __srmmu_get_nocache() sparc64: Replace zero-length array with flexible-array sparc: mm: return true,false in kern_addr_valid() commit 4f8ad73898171cea2dce9ecf5bd4337c9dfcddc1 Merge: 9049a40c858f fcdf818d239e Author: David S. Miller Date: Sun Jun 7 17:11:41 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc commit 4d3da2d8d91f66988a829a18a0ce59945e8ae4fb Author: Martin Blumenstingl Date: Sun Jun 7 15:02:58 2020 +0200 net: dsa: lantiq_gswip: fix and improve the unsupported interface error While trying to use the lantiq_gswip driver on one of my boards I made a mistake when specifying the phy-mode (because the out-of-tree driver wants phy-mode "gmii" or "mii" for the internal PHYs). In this case the following error is printed multiple times: Unsupported interface: 3 While it gives at least a hint at what may be wrong it is not very user friendly. Print the human readable phy-mode and also which port is configured incorrectly (this hardware supports ports 0..6) to improve the cases where someone made a mistake. Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Signed-off-by: Martin Blumenstingl Acked-by: Hauke Mehrtens Signed-off-by: David S. Miller commit 3f29eacc3ea828cde4d1f06f74fa7f2ca479c216 Merge: 9ca1f474cea0 dd67cab5db7e Author: Dave Airlie Date: Mon Jun 8 10:06:09 2020 +1000 Merge branch 'linux-5.8' of git://github.com/skeggsb/linux into drm-next - HDMI/DP audio HDA fixes - display hang fix for Volta/Turing - GK20A regression fix. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/ Date: Sun Jun 7 11:10:27 2020 +0300 mlxsw: core: Use different get_trend() callbacks for different thermal zones The driver registers three different types of thermal zones: For the ASIC itself, for port modules and for gearboxes. Currently, all three types use the same get_trend() callback which does not work correctly for the ASIC thermal zone. The callback assumes that the device data is of type 'struct mlxsw_thermal_module', whereas for the ASIC thermal zone 'struct mlxsw_thermal' is passed as device data. Fix this by using one get_trend() callback for the ASIC thermal zone and another for the other two types. Fixes: 6f73862fabd9 ("mlxsw: core: Add the hottest thermal zone detection") Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9049a40c858f49c141e12924b77b91cce4c46617 Merge: 824c874abc1d 9d964e1b82d8 Author: David S. Miller Date: Sun Jun 7 16:40:14 2020 -0700 Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs commit cf0c97f148e9e50aa5a7ddd1984a604dd2bde4af Merge: e8dff03aef6a 94873f6b46f8 Author: Linus Torvalds Date: Sun Jun 7 16:13:43 2020 -0700 Merge tag 'pinctrl-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "This is the bulk of pin control changes for the v5.8 kernel cycle. It's just really boring this time. Zero core changes. Just linear development, cleanups and misc noncritical fixes. Some new drivers for very new Qualcomm and Intel chips. New drivers: - Intel Jasper Lake support. - NXP Freescale i.MX8DXL support. - Qualcomm SM8250 support. - Renesas R8A7742 SH-PFC support. Driver improvements: - Severe cleanup and modernization of the MCP23s08 driver. - Mediatek driver modularized. - Setting config supported in the Meson driver. - Wakeup support for the Broadcom BCM7211" * tag 'pinctrl-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (72 commits) pinctrl: sprd: Fix the incorrect pull-up definition pinctrl: pxa: pxa2xx: Remove 'pxa2xx_pinctrl_exit()' which is unused and broken pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()' pinctrl: freescale: imx: Fix an error handling path in 'imx_pinctrl_probe()' pinctrl: sirf: add missing put_device() call in sirfsoc_gpio_probe() pinctrl: imxl: Fix an error handling path in 'imx1_pinctrl_core_probe()' pinctrl: bcm2835: Add support for wake-up interrupts pinctrl: bcm2835: Match BCM7211 compatible string dt-bindings: pinctrl: Document optional BCM7211 wake-up interrupts dt-bindings: pinctrl: Document 7211 compatible for brcm, bcm2835-gpio.txt dt-bindings: pinctrl: stm32: Add missing interrupts property pinctrl: at91-pio4: Add COMPILE_TEST support pinctrl: Fix return value about devm_platform_ioremap_resource() MAINTAINERS: Renesas Pin Controllers are supported dt-bindings: pinctrl: ocelot: Add Sparx5 SoC support pinctrl: ocelot: Fix GPIO interrupt decoding on Jaguar2 pinctrl: ocelot: Remove instance number from pin functions pinctrl: ocelot: Always register GPIO driver dt-bindings: pinctrl: rockchip: update example pinctrl: amd: Add ACPI dependency ... commit e8dff03aef6a76c5c9184ed1dd3c770d4ce9c885 Merge: 787f74fc5050 4601e24a6fb8 Author: Linus Torvalds Date: Sun Jun 7 16:11:23 2020 -0700 Merge tag 'rtc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Not much this cycle apart from the ingenic rtc driver rework. The fixes are mainly minor issues reported by coccinelle rather than real world issues. Subsystem: - new VL flag for backup switch over Drivers: - ingenic: only support device tree - pcf2127: report battery switch over, handle nowayout" * tag 'rtc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (29 commits) rtc: pcf2127: watchdog: handle nowayout feature rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake rtc: abx80x: Provide debug feedback for invalid dt properties rtc: abx80x: Add Device Tree matching table rtc: rv3028: Add missed check for devm_regmap_init_i2c() rtc: mpc5121: Use correct return value for mpc5121_rtc_probe() rtc: goldfish: Use correct return value for goldfish_rtc_probe() rtc: snvs: Add necessary clock operations for RTC APIs rtc: snvs: Make SNVS clock always prepared rtc: ingenic: Reset regulator register in probe rtc: ingenic: Fix masking of error code rtc: ingenic: Remove unused fields from private structure rtc: ingenic: Set wakeup params in probe rtc: ingenic: Enable clock in probe rtc: ingenic: Use local 'dev' variable in probe rtc: ingenic: Only support probing from devicetree rtc: mc13xxx: fix a double-unlock issue rtc: stmp3xxx: update contact email rtc: max77686: Use single-byte writes on MAX77620 rtc: pcf2127: report battery switch over ... commit 787f74fc5050c77e29a96f480f40421336eed5ac Merge: a2b447066cac 2130c0ba69d6 Author: Linus Torvalds Date: Sun Jun 7 16:08:41 2020 -0700 Merge tag 'ntb-5.8' of git://github.com/jonmason/ntb Pull NTB updates from Jon Mason: "Intel Icelake NTB support, Intel driver bug fixes, and lots of bug fixes for ntb tests" * tag 'ntb-5.8' of git://github.com/jonmason/ntb: NTB: ntb_test: Fix bug when counting remote files NTB: perf: Fix race condition when run with ntb_test NTB: perf: Fix support for hardware that doesn't have port numbers NTB: perf: Don't require one more memory window than number of peers NTB: ntb_pingpong: Choose doorbells based on port number NTB: Fix the default port and peer numbers for legacy drivers NTB: Revert the change to use the NTB device dev for DMA allocations NTB: ntb_tool: reading the link file should not end in a NULL byte ntb_perf: avoid false dma unmap of destination address ntb_perf: increase sleep time from one milli sec to one sec ntb_tool: pass correct struct device to dma_alloc_coherent ntb_perf: pass correct struct device to dma_alloc_coherent ntb: hw: remove the code that sets the DMA mask NTB: correct ntb_peer_spad_addr and ntb_peer_spad_read comment typos ntb: intel: fix static declaration ntb: intel: add hw workaround for NTB BAR alignment ntb: intel: Add Icelake (gen4) support for Intel NTB NTB: Fix static check warning in perf_clear_test include/ntb: Fix typo in ntb_unregister_device description commit a2b447066cacb6db82a1f69b46d9f894f695badf Merge: 8b8c704d913b 3622ad25d4d6 Author: Linus Torvalds Date: Sun Jun 7 16:04:49 2020 -0700 Merge tag 'apparmor-pr-2020-06-07' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor updates from John Johansen: "Features: - Replace zero-length array with flexible-array - add a valid state flags check - add consistency check between state and dfa diff encode flags - add apparmor subdir to proc attr interface - fail unpack if profile mode is unknown - add outofband transition and use it in xattr match - ensure that dfa state tables have entries Cleanups: - Use true and false for bool variable - Remove semicolon - Clean code by removing redundant instructions - Replace two seq_printf() calls by seq_puts() in aa_label_seq_xprint() - remove duplicate check of xattrs on profile attachment - remove useless aafs_create_symlink Bug fixes: - Fix memory leak of profile proxy - fix introspection of of task mode for unconfined tasks - fix nnp subset test for unconfined - check/put label on apparmor_sk_clone_security()" * tag 'apparmor-pr-2020-06-07' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: Fix memory leak of profile proxy apparmor: fix introspection of of task mode for unconfined tasks apparmor: check/put label on apparmor_sk_clone_security() apparmor: Use true and false for bool variable security/apparmor/label.c: Clean code by removing redundant instructions apparmor: Replace zero-length array with flexible-array apparmor: ensure that dfa state tables have entries apparmor: remove duplicate check of xattrs on profile attachment. apparmor: add outofband transition and use it in xattr match apparmor: fail unpack if profile mode is unknown apparmor: fix nnp subset test for unconfined apparmor: remove useless aafs_create_symlink apparmor: add proc subdir to attrs apparmor: add consistency check between state and dfa diff encode flags apparmor: add a valid state flags check AppArmor: Remove semicolon apparmor: Replace two seq_printf() calls by seq_puts() in aa_label_seq_xprint() commit 8b8c704d913b0fe490af370631a4200e26334ec0 Author: Roberto Sassu Date: Sun Jun 7 23:00:29 2020 +0200 ima: Remove __init annotation from ima_pcrread() Commit 6cc7c266e5b4 ("ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init()") added a call to ima_calc_boot_aggregate() so that the digest can be recalculated for the boot_aggregate measurement entry if the 'd' template field has been requested. For the 'd' field, only SHA1 and MD5 digests are accepted. Given that ima_eventdigest_init() does not have the __init annotation, all functions called should not have it. This patch removes __init from ima_pcrread(). Cc: stable@vger.kernel.org Fixes: 6cc7c266e5b4 ("ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init()") Reported-by: Linus Torvalds Signed-off-by: Roberto Sassu Signed-off-by: Linus Torvalds commit b7b2796b9b31e3dcbd563bcf8f983a79bb81163d Author: Anson Huang Date: Wed Jun 3 13:15:44 2020 +0800 mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag IPC MU has no power domain assigned and there could be IPC during noirq suspend phase, so IRQF_NO_SUSPEND flag is needed for IPC MU. However, for other MUs, they have power domain assigned and their power will be turned off during noirq suspend phase, but with IRQF_NO_SUSPEND set, their interrupts are NOT disabled even after their power turned off, it will cause system crash when mailbox driver trys to handle pending interrupts but the MU power is already turned off. So, IRQF_NO_SUSPEND flag should ONLY be added to IPC MU which has power domain managed by SCU, then all other MUs' pending interrupts after noirq suspend phase will be handled after system resume. Signed-off-by: Anson Huang Signed-off-by: Jassi Brar commit bb2b2624dbe27246bd1ee087f2d50f80daa6622c Author: Anson Huang Date: Wed Jun 3 13:15:43 2020 +0800 mailbox: imx: Add runtime PM callback to handle MU clocks Some of i.MX8M SoCs have MU clock, they need to be managed in runtime to make sure the MU clock can be off in runtime, add runtime PM callback to handle MU clock. And on i.MX8MP, the MU clock is combined with power domain and runtime PM is enabled for the clock driver, during noirq suspend/resume phase, runtime PM is disabled by device suspend, but the MU context save/restore needs to enable MU clock for register access, calling clock prepare/enable will trigger runtime resume failure and lead to system suspend failed. Actually, the MU context save/restore is ONLY necessary for SCU IPC MU, other MUs especially on i.MX8MP platforms which have MU clock assigned, they need to runtime request/free mailbox channel in the consumer driver, so no need to save/restore MU context for them, hence it can avoid this issue, so the MU context save/restore is ONLY applied to i.MX platforms MU instance without clock present. Signed-off-by: Anson Huang Signed-off-by: Jassi Brar commit ba5f9fa0ca85a6137fa35efd3a1256d8bb6bc5ff Author: Dong Aisheng Date: Wed Jun 3 13:15:42 2020 +0800 mailbox: imx: Add context save/restore for suspend/resume For "mem" mode suspend on i.MX8 SoCs, MU settings could be lost because its power is off, so save/restore is needed for MU settings during suspend/resume. However, the restore can ONLY be done when MU settings are actually lost, for the scenario of settings NOT lost in "freeze" mode suspend, since there could be still IPC going on multiple CPUs, restoring the MU settings could overwrite the TIE by mistake and cause system freeze, so need to make sure ONLY restore the MU settings when it is powered off, Anson fixes this by checking whether restore is actually needed when resume. Signed-off-by: Dong Aisheng Signed-off-by: Anson Huang Signed-off-by: Jassi Brar commit 3622ad25d4d68fcbdef3bc084b5916873e785344 Author: John Johansen Date: Sun Jun 7 04:10:33 2020 -0700 apparmor: Fix memory leak of profile proxy When the proxy isn't replaced and the profile is removed, the proxy is being leaked resulting in a kmemleak check message of unreferenced object 0xffff888077a3a490 (size 16): comm "apparmor_parser", pid 128041, jiffies 4322684109 (age 1097.028s) hex dump (first 16 bytes): 03 00 00 00 00 00 00 00 b0 92 fd 4b 81 88 ff ff ...........K.... backtrace: [<0000000084d5daf2>] aa_alloc_proxy+0x58/0xe0 [<00000000ecc0e21a>] aa_alloc_profile+0x159/0x1a0 [<000000004cc9ce15>] unpack_profile+0x275/0x1c40 [<000000007332b3ca>] aa_unpack+0x1e7/0x7e0 [<00000000e25e31bd>] aa_replace_profiles+0x18a/0x1d10 [<00000000350d9415>] policy_update+0x237/0x650 [<000000003fbf934e>] profile_load+0x122/0x160 [<0000000047f7b781>] vfs_write+0x139/0x290 [<000000008ad12358>] ksys_write+0xcd/0x170 [<000000001a9daa7b>] do_syscall_64+0x70/0x310 [<00000000b9efb0cf>] entry_SYSCALL_64_after_hwframe+0x49/0xb3 Make sure to cleanup the profile's embedded label which will result on the proxy being properly freed. Fixes: 637f688dc3dc ("apparmor: switch from profiles to using labels on contexts") Signed-off-by: John Johansen commit dd2569fbb053719f7df7ef8fdbb45cf47156a701 Author: John Johansen Date: Fri Jun 5 18:12:21 2020 -0700 apparmor: fix introspection of of task mode for unconfined tasks Fix two issues with introspecting the task mode. 1. If a task is attached to a unconfined profile that is not the ns->unconfined profile then. Mode the mode is always reported as - $ ps -Z LABEL PID TTY TIME CMD unconfined 1287 pts/0 00:00:01 bash test (-) 1892 pts/0 00:00:00 ps instead of the correct value of (unconfined) as shown below $ ps -Z LABEL PID TTY TIME CMD unconfined 2483 pts/0 00:00:01 bash test (unconfined) 3591 pts/0 00:00:00 ps 2. if a task is confined by a stack of profiles that are unconfined the output of label mode is again the incorrect value of (-) like above, instead of (unconfined). This is because the visibile profile count increment is skipped by the special casing of unconfined. Fixes: f1bd904175e8 ("apparmor: add the base fns() for domain labels") Signed-off-by: John Johansen commit 3b646abc5bc6c0df649daea4c2c976bd4d47e4c8 Author: Mauricio Faria de Oliveira Date: Tue Jun 2 18:15:16 2020 -0300 apparmor: check/put label on apparmor_sk_clone_security() Currently apparmor_sk_clone_security() does not check for existing label/peer in the 'new' struct sock; it just overwrites it, if any (with another reference to the label of the source sock.) static void apparmor_sk_clone_security(const struct sock *sk, struct sock *newsk) { struct aa_sk_ctx *ctx = SK_CTX(sk); struct aa_sk_ctx *new = SK_CTX(newsk); new->label = aa_get_label(ctx->label); new->peer = aa_get_label(ctx->peer); } This might leak label references, which might overflow under load. Thus, check for and put labels, to prevent such errors. Note this is similarly done on: static int apparmor_socket_post_create(struct socket *sock, ...) ... if (sock->sk) { struct aa_sk_ctx *ctx = SK_CTX(sock->sk); aa_put_label(ctx->label); ctx->label = aa_get_label(label); } ... Context: ------- The label reference count leak is observed if apparmor_sock_graft() is called previously: this sets the 'ctx->label' field by getting a reference to the current label (later overwritten, without put.) static void apparmor_sock_graft(struct sock *sk, ...) { struct aa_sk_ctx *ctx = SK_CTX(sk); if (!ctx->label) ctx->label = aa_get_current_label(); } And that is the case on crypto/af_alg.c:af_alg_accept(): int af_alg_accept(struct sock *sk, struct socket *newsock, ...) ... struct sock *sk2; ... sk2 = sk_alloc(...); ... security_sock_graft(sk2, newsock); security_sk_clone(sk, sk2); ... Apparently both calls are done on their own right, especially for other LSMs, being introduced in 2010/2014, before apparmor socket mediation in 2017 (see commits [1,2,3,4]). So, it looks OK there! Let's fix the reference leak in apparmor. Test-case: --------- Exercise that code path enough to overflow label reference count. $ cat aa-refcnt-af_alg.c #include #include #include #include #include int main() { int sockfd; struct sockaddr_alg sa; /* Setup the crypto API socket */ sockfd = socket(AF_ALG, SOCK_SEQPACKET, 0); if (sockfd < 0) { perror("socket"); return 1; } memset(&sa, 0, sizeof(sa)); sa.salg_family = AF_ALG; strcpy((char *) sa.salg_type, "rng"); strcpy((char *) sa.salg_name, "stdrng"); if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) < 0) { perror("bind"); return 1; } /* Accept a "connection" and close it; repeat. */ while (!close(accept(sockfd, NULL, 0))); return 0; } $ gcc -o aa-refcnt-af_alg aa-refcnt-af_alg.c $ ./aa-refcnt-af_alg [ 9928.475953] refcount_t overflow at apparmor_sk_clone_security+0x37/0x70 in aa-refcnt-af_alg[1322], uid/euid: 1000/1000 ... [ 9928.507443] RIP: 0010:apparmor_sk_clone_security+0x37/0x70 ... [ 9928.514286] security_sk_clone+0x33/0x50 [ 9928.514807] af_alg_accept+0x81/0x1c0 [af_alg] [ 9928.516091] alg_accept+0x15/0x20 [af_alg] [ 9928.516682] SYSC_accept4+0xff/0x210 [ 9928.519609] SyS_accept+0x10/0x20 [ 9928.520190] do_syscall_64+0x73/0x130 [ 9928.520808] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 Note that other messages may be seen, not just overflow, depending on the value being incremented by kref_get(); on another run: [ 7273.182666] refcount_t: saturated; leaking memory. ... [ 7273.185789] refcount_t: underflow; use-after-free. Kprobes: ------- Using kprobe events to monitor sk -> sk_security -> label -> count (kref): Original v5.7 (one reference leak every iteration) ... (af_alg_accept+0x0/0x1c0) label=0xffff8a0f36c25eb0 label_refcnt=0x11fd2 ... (af_alg_release_parent+0x0/0xd0) label=0xffff8a0f36c25eb0 label_refcnt=0x11fd4 ... (af_alg_accept+0x0/0x1c0) label=0xffff8a0f36c25eb0 label_refcnt=0x11fd3 ... (af_alg_release_parent+0x0/0xd0) label=0xffff8a0f36c25eb0 label_refcnt=0x11fd5 ... (af_alg_accept+0x0/0x1c0) label=0xffff8a0f36c25eb0 label_refcnt=0x11fd4 ... (af_alg_release_parent+0x0/0xd0) label=0xffff8a0f36c25eb0 label_refcnt=0x11fd6 Patched v5.7 (zero reference leak per iteration) ... (af_alg_accept+0x0/0x1c0) label=0xffff9ff376c25eb0 label_refcnt=0x593 ... (af_alg_release_parent+0x0/0xd0) label=0xffff9ff376c25eb0 label_refcnt=0x594 ... (af_alg_accept+0x0/0x1c0) label=0xffff9ff376c25eb0 label_refcnt=0x593 ... (af_alg_release_parent+0x0/0xd0) label=0xffff9ff376c25eb0 label_refcnt=0x594 ... (af_alg_accept+0x0/0x1c0) label=0xffff9ff376c25eb0 label_refcnt=0x593 ... (af_alg_release_parent+0x0/0xd0) label=0xffff9ff376c25eb0 label_refcnt=0x594 Commits: ------- [1] commit 507cad355fc9 ("crypto: af_alg - Make sure sk_security is initialized on accept()ed sockets") [2] commit 4c63f83c2c2e ("crypto: af_alg - properly label AF_ALG socket") [3] commit 2acce6aa9f65 ("Networking") a.k.a ("crypto: af_alg - Avoid sock_graft call warning) [4] commit 56974a6fcfef ("apparmor: add base infastructure for socket mediation") Fixes: 56974a6fcfef ("apparmor: add base infastructure for socket mediation") Reported-by: Brian Moyles Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: John Johansen commit cdb555397f438592bab00599037c347b700cf397 Author: Max Staudt Date: Sun Jun 7 20:28:12 2020 +0200 i2c: icy: Fix build with CONFIG_AMIGA_PCMCIA=n This has been found by the Kernel Test Robot: http://lkml.iu.edu/hypermail/linux/kernel/2006.0/06862.html With CONFIG_AMIGA_PCMCIA=n, io_mm.h does not pull in amigahw.h and ZTWO_VADDR is undefined. Add forgotten include to i2c-icy.c Fixes: 4768e90ecaec ("i2c: Add i2c-icy for I2C on m68k/Amiga") Reported-by: kernel test robot Signed-off-by: Max Staudt Signed-off-by: Wolfram Sang commit 9aa900c8094dba7a60dc805ecec1e9f720744ba1 Merge: f558b8364e19 05c8a4fc44a9 Author: Linus Torvalds Date: Sun Jun 7 10:59:32 2020 -0700 Merge tag 'char-misc-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver updates from Greg KH: "Here is the large set of char/misc driver patches for 5.8-rc1 Included in here are: - habanalabs driver updates, loads - mhi bus driver updates - extcon driver updates - clk driver updates (approved by the clock maintainer) - firmware driver updates - fpga driver updates - gnss driver updates - coresight driver updates - interconnect driver updates - parport driver updates (it's still alive!) - nvmem driver updates - soundwire driver updates - visorbus driver updates - w1 driver updates - various misc driver updates In short, loads of different driver subsystem updates along with the drivers as well. All have been in linux-next for a while with no reported issues" * tag 'char-misc-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (233 commits) habanalabs: correctly cast u64 to void* habanalabs: initialize variable to default value extcon: arizona: Fix runtime PM imbalance on error extcon: max14577: Add proper dt-compatible strings extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' extcon: remove redundant assignment to variable idx w1: omap-hdq: print dev_err if irq flags are not cleared w1: omap-hdq: fix interrupt handling which did show spurious timeouts w1: omap-hdq: fix return value to be -1 if there is a timeout w1: omap-hdq: cleanup to add missing newline for some dev_dbg /dev/mem: Revoke mappings when a driver claims the region misc: xilinx-sdfec: convert get_user_pages() --> pin_user_pages() misc: xilinx-sdfec: cleanup return value in xsdfec_table_write() misc: xilinx-sdfec: improve get_user_pages_fast() error handling nvmem: qfprom: remove incorrect write support habanalabs: handle MMU cache invalidation timeout habanalabs: don't allow hard reset with open processes habanalabs: GAUDI does not support soft-reset habanalabs: add print for soft reset due to event habanalabs: improve MMU cache invalidation code ... commit f558b8364e19f9222e7976c64e9367f66bab02cc Merge: 80ef846e9909 8c3e315d4296 Author: Linus Torvalds Date: Sun Jun 7 10:53:36 2020 -0700 Merge tag 'driver-core-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of driver core patches for 5.8-rc1. Not all that huge this release, just a number of small fixes and updates: - software node fixes - kobject now sends KOBJ_REMOVE when it is removed from sysfs, not when it is removed from memory (which could come much later) - device link additions and fixes based on testing on more devices - firmware core cleanups - other minor changes, full details in the shortlog All have been in linux-next for a while with no reported issues" * tag 'driver-core-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (23 commits) driver core: Update device link status correctly for SYNC_STATE_ONLY links firmware_loader: change enum fw_opt to u32 software node: implement software_node_unregister() kobject: send KOBJ_REMOVE uevent when the object is removed from sysfs driver core: Remove unnecessary is_fwnode_dev variable in device_add() drivers property: When no children in primary, try secondary driver core: platform: Fix spelling errors in platform.c driver core: Remove check in driver_deferred_probe_force_trigger() of: platform: Batch fwnode parsing when adding all top level devices driver core: fw_devlink: Add support for batching fwnode parsing driver core: Look for waiting consumers only for a fwnode's primary device driver core: Move code to the right part of the file Revert "Revert "driver core: Set fw_devlink to "permissive" behavior by default"" drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish firmware_loader: move fw_fallback_config to a private kernel symbol namespace driver core: Add missing '\n' in log messages driver/base/soc: Use kobj_to_dev() API Add documentation on meaning of -EPROBE_DEFER driver core: platform: remove redundant assignment to variable ret debugfs: Use the correct style for SPDX License Identifier ... commit 80ef846e9909f22ccdc2a4a6d931266cecce8b2c Merge: 081096d98bb2 77f55d1305c1 Author: Linus Torvalds Date: Sun Jun 7 10:45:08 2020 -0700 Merge tag 'staging-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO driver updates from Greg KH: "Here is the large set of staging and IIO driver changes for 5.8-rc1 Nothing major, but a lot of new IIO drivers are included in here, along with other core iio cleanups and changes. On the staging driver front, again, nothing noticable. No new deletions or additions, just a ton of tiny cleanups all over the tree done by a lot of different people. Most coding style, but many actual real fixes and cleanups that are nice to see. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (618 commits) staging: rtl8723bs: Use common packet header constants staging: sm750fb: Add names to proc_setBLANK args staging: most: usb: init return value in default path of switch/case expression staging: vchiq: Get rid of VCHIQ_SERVICE_OPENEND callback reason staging: vchiq: move vchiq_release_message() into vchiq staging: vchi: Get rid of C++ guards staging: vchi: Get rid of not implemented function declarations staging: vchi: Get rid of vchiq_status_to_vchi() staging: vchi: Get rid of vchi_service_set_option() staging: vchi: Merge vchi_msg_queue() into vchi_queue_kernel_message() staging: vchiq: Move copy callback handling into vchiq staging: vchi: Get rid of vchi_queue_user_message() staging: vchi: Get rid of vchi_service_destroy() staging: most: usb: use function sysfs_streq staging: most: usb: add missing put_device calls staging: most: usb: use correct error codes staging: most: usb: replace code to calculate array index staging: most: usb: don't use error path to exit function on success staging: most: usb: move allocation of URB out of critical section staging: most: usb: return 0 instead of variable ... commit 081096d98bb23946f16215357b141c5616b234bf Merge: e611c0fe318c a1b44ea340b2 Author: Linus Torvalds Date: Sun Jun 7 09:52:36 2020 -0700 Merge tag 'tty-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the tty and serial driver updates for 5.8-rc1 Nothing huge at all, just a lot of little serial driver fixes, updates for new devices and features, and other small things. Full details are in the shortlog. All of these have been in linux-next with no issues for a while" * tag 'tty-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (67 commits) tty: serial: qcom_geni_serial: Add 51.2MHz frequency support tty: serial: imx: clear Ageing Timer Interrupt in handler serial: 8250_fintek: Add F81966 Support sc16is7xx: Add flag to activate IrDA mode dt-bindings: sc16is7xx: Add flag to activate IrDA mode serial: 8250: Support rs485 bus termination GPIO serial: 8520_port: Fix function param documentation dt-bindings: serial: Add binding for rs485 bus termination GPIO vt: keyboard: avoid signed integer overflow in k_ascii serial: 8250: Enable 16550A variants by default on non-x86 tty: hvc_console, fix crashes on parallel open/close serial: imx: Initialize lock for non-registered console sc16is7xx: Read the LSR register for basic device presence check sc16is7xx: Allow sharing the IRQ line sc16is7xx: Use threaded IRQ sc16is7xx: Always use falling edge IRQ tty: n_gsm: Fix bogus i++ in gsm_data_kick tty: n_gsm: Remove unnecessary test in gsm_print_packet() serial: stm32: add no_console_suspend support tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP ... commit e611c0fe318c6d6827ee2bba660fbc23cf73f7dc Merge: 3b69e8b45711 347052e3bf1b Author: Linus Torvalds Date: Sun Jun 7 09:42:16 2020 -0700 Merge tag 'usb-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY driver updates from Greg KH: "Here are the large set of USB and PHY driver updates for 5.8-rc1. Nothing huge, just lots of little things: - USB gadget fixes and additions all over the place - new PHY drivers - PHY driver fixes and updates - XHCI driver updates - musb driver updates - more USB-serial driver ids added - various USB quirks added - thunderbolt minor updates and fixes - typec updates and additions All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (245 commits) usb: dwc3: meson-g12a: fix USB2 PHY initialization on G12A and A1 SoCs usb: dwc3: meson-g12a: fix error path when fetching the reset line fails Revert "dt-bindings: usb: qcom,dwc3: Convert USB DWC3 bindings" Revert "dt-bindings: usb: qcom,dwc3: Add compatible for SC7180" Revert "dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver" USB: serial: ch341: fix lockup of devices with limited prescaler USB: serial: ch341: add basis for quirk detection CDC-ACM: heed quirk also in error handling USB: serial: option: add Telit LE910C1-EUX compositions usb: musb: Fix runtime PM imbalance on error usb: musb: jz4740: Prevent lockup when CONFIG_SMP is set usb: musb: mediatek: add reset FADDR to zero in reset interrupt handle usb: musb: use true for 'use_dma' usb: musb: start session in resume for host port usb: musb: return -ESHUTDOWN in urb when three-strikes error happened USB: serial: qcserial: add DW5816e QDL support thunderbolt: Add trivial .shutdown usb: dwc3: keystone: Turn on USB3 PHY before controller dt-bindings: usb: ti,keystone-dwc3.yaml: Add USB3.0 PHY property dt-bindings: usb: convert keystone-usb.txt to YAML ... commit 7f88314321e20744114bc596b6528bb9d57ff46f Author: Lorenzo Bianconi Date: Mon Jun 1 09:45:33 2020 +0200 mt76: overwrite qid for non-bufferable mgmt frames Overwrite hw queue id for non-bufferable management frames if the hw support always txq (altxq) in order to be in sync with mac txwi code Fixes: cdad4874057d ("mt76: mt7615: add dma and tx queue initialization for MT7622") Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Suggested-by: Felix Fietkau Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit a07292ee144b1c4f4269871bb138d16cf5dc603c Author: Lorenzo Bianconi Date: Sun May 31 00:32:04 2020 +0200 mt76: mt7615: fix hw queue mapping mt7622/mt7663 chipsets rely on a fixed reverse queue map order respect to mac80211 one: - q(0): IEEE80211_AC_BK - q(1): IEEE80211_AC_BE - q(2): IEEE80211_AC_VI - q(3): IEEE80211_AC_VO Fixes: cdad4874057d ("mt76: mt7615: add dma and tx queue initialization for MT7622") Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit d941f47caa386931c3b598ad1b43d5ddd65869aa Author: Lorenzo Bianconi Date: Sat May 30 23:51:27 2020 +0200 mt76: mt7615: fix lmac queue debugsfs entry acs and wmm index are swapped in mt7615_queues_acq respect to the hw design Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit bb57768215fb6b557a1ef95a3d87b011efe2e267 Author: Lorenzo Bianconi Date: Tue Jun 2 22:26:38 2020 +0200 mt76: add missing lock configuring coverage class Coverage class callback can potentially run in parallel with other routines (e.g. mt7615_set_channel) that configures timing registers. Run coverage class callback holding mt76 mutex Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 22f614bc0f376e7a1bcf1a2cd912885f4a933045 Author: Ming Lei Date: Fri Jun 5 19:44:10 2020 +0800 blk-mq: fix blk_mq_all_tag_iter blk_mq_all_tag_iter() is added to iterate all requests, so we should fetch the request from ->static_rqs][] instead of ->rqs[] which is for holding in-flight request only. Fix it by adding flag of BT_TAG_ITER_STATIC_RQS. Fixes: bf0beec0607d ("blk-mq: drain I/O when all CPUs in a hctx are offline") Signed-off-by: Ming Lei Tested-by: John Garry Cc: Dongli Zhang Cc: Hannes Reinecke Cc: Daniel Wagner Cc: Christoph Hellwig Signed-off-by: Jens Axboe commit d94ecfc399715f06da347922e7979c088b1d8834 Author: Christoph Hellwig Date: Fri Jun 5 19:44:09 2020 +0800 blk-mq: split out a __blk_mq_get_driver_tag helper Allocation of the driver tag in the case of using a scheduler shares very little code with the "normal" tag allocation. Split out a new helper to streamline this path, and untangle it from the complex normal tag allocation. This way also avoids to fail driver tag allocation because of inactive hctx during cpu hotplug, and fixes potential hang risk. Fixes: bf0beec0607d ("blk-mq: drain I/O when all CPUs in a hctx are offline") Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Tested-by: John Garry Cc: Dongli Zhang Cc: Hannes Reinecke Cc: Daniel Wagner Signed-off-by: Jens Axboe commit 9d964e1b82d8182184153b70174f445ea616f053 Author: Al Viro Date: Sat Jun 6 23:44:24 2020 -0400 fix a braino in "sparc32: fix register window handling in genregs32_[gs]et()" lost npc in PTRACE_SETREGSET, breaking PTRACE_SETREGS as well Fixes: cf51e129b968 "sparc32: fix register window handling in genregs32_[gs]et()" Signed-off-by: Al Viro commit 2667a6814cb518f0df6520a00ddea48e8af50bd0 Author: Gustavo A. R. Silva Date: Thu Jun 4 10:39:57 2020 -0500 i2c: npcm7xx: Remove unnecessary parentheses Remove unnecessary parentheses around _bus_. This issue was found with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Wolfram Sang commit 4e2905adac9f0fdc25154ac83719a986c2367a14 Author: Dan Murphy Date: Fri Jun 5 15:51:03 2020 -0500 net: dp83869: Reset return variable if PHY strap is read When the PHY's strap register is read to determine if lane swapping is needed the phy_read_mmd returns the value back into the ret variable. If the call to read the strap fails the failed value is returned. If the call to read the strap is successful then ret is possibly set to a non-zero positive number. Without reseting the ret value to 0 this will cause the parse DT function to return a failure. Fixes: c4566aec6e808 ("net: phy: dp83869: Update port-mirroring to read straps") Signed-off-by: Dan Murphy Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 4a3084aaa88e70a0af0e38b72ca29af32ec6b9c5 Author: Herbert Xu Date: Wed Jun 3 18:12:43 2020 +1000 rhashtable: Drop raw RCU deref in nested_table_free This patch replaces some unnecessary uses of rcu_dereference_raw in the rhashtable code with rcu_dereference_protected. The top-level nested table entry is only marked as RCU because it shares the same type as the tree entries underneath it. So it doesn't need any RCU protection. We also don't need RCU protection when we're freeing a nested RCU table because by this stage we've long passed a memory barrier when anyone could change the nested table. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller commit 3b69e8b4571125bec1f77f886174fe6cab6b9d75 Merge: b170290c2836 37744feebc08 Author: Linus Torvalds Date: Sat Jun 6 15:22:01 2020 -0700 Merge tag 'sh-for-5.8' of git://git.libc.org/linux-sh Pull arch/sh updates from Rich Felker: "Fix for arch/sh build regression with newer binutils, removal of SH5, fixes for module exports, and misc cleanup" * tag 'sh-for-5.8' of git://git.libc.org/linux-sh: sh: remove sh5 support sh: add missing EXPORT_SYMBOL() for __delay sh: Convert ins[bwl]/outs[bwl] macros to inline functions sh: Convert iounmap() macros to inline functions sh: Add missing DECLARE_EXPORT() for __ashiftrt_r4_xx sh: configs: Cleanup old Kconfig IO scheduler options arch/sh: vmlinux.scr sh: Replace CONFIG_MTD_M25P80 with CONFIG_MTD_SPI_NOR in sh7757lcr_defconfig sh: sh4a: Bring back tmu3_device early device commit e7991f376a4dd837f455d9e2112a280617854d12 Author: Zhu Lingshan Date: Fri Jun 5 18:27:15 2020 +0800 ifcvf: implement config interrupt in IFCVF This commit implements config interrupt support in IFC VF Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Link: https://lore.kernel.org/r/1591352835-22441-6-git-send-email-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit e0136c16fae95dc3762f3912f6f9336f5f57fe81 Author: Zhu Lingshan Date: Fri Jun 5 18:27:14 2020 +0800 vhost: replace -1 with VHOST_FILE_UNBIND in ioctls This commit replaces -1 with VHOST_FILE_UNBIND in ioctls since we have added such a macro in the uapi header for vdpa_host. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Link: https://lore.kernel.org/r/1591352835-22441-5-git-send-email-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit 776f395004d829bbbf18c159ed9beb517a208c71 Author: Zhu Lingshan Date: Fri Jun 5 18:27:13 2020 +0800 vhost_vdpa: Support config interrupt in vdpa This commit implements config interrupt support in vhost_vdpa layer. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Link: https://lore.kernel.org/r/1591352835-22441-4-git-send-email-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit bb02e6e63d0e71188bc5fe5f4732e66bc8b5dceb Author: Zhu Lingshan Date: Fri Jun 5 18:27:12 2020 +0800 ifcvf: ignore continuous setting same status value User space may try to set status of same value multiple times, this patch handles this case more efficiently by ignoring the setting of the same status value. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/1591352835-22441-3-git-send-email-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit b170290c2836c40ab565736ba37681eb3dfd79b8 Merge: cff11abeca78 bcfefb61cd2b Author: Linus Torvalds Date: Sat Jun 6 12:07:28 2020 -0700 Merge tag 'kconfig-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig updates from Masahiro Yamada: - allow only 'config', 'comment', 'if' statements inside 'choice' since the other statements are not sensible inside 'choice' and should be grammatical error - support LMC_KEEP env variable for 'make local{yes,mod}config' to preserve some CONFIG options - deprecate 'make kvmconfig' and 'make xenconfig' in favor of 'make kvm_guest.config' and 'make xen.config' - code cleanups * tag 'kconfig-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: announce removal of 'kvmconfig' and 'xenconfig' shorthands streamline_config.pl: add LMC_KEEP to preserve some kconfigs kconfig: allow only 'config', 'comment', and 'if' inside 'choice' kconfig: tests: remove randconfig test for choice in choice kconfig: do not assign a variable in the return statement kconfig: do not use OR-assignment for zero-cleared structure commit cff11abeca78aa782378401ca2800bd2194aa14e Merge: 6f2dc3d33545 8dfb61dcbace Author: Linus Torvalds Date: Sat Jun 6 12:00:25 2020 -0700 Merge tag 'kbuild-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - fix warnings in 'make clean' for ARCH=um, hexagon, h8300, unicore32 - ensure to rebuild all objects when the compiler is upgraded - exclude system headers from dependency tracking and fixdep processing - fix potential bit-size mismatch between the kernel and BPF user-mode helper - add the new syntax 'userprogs' to build user-space programs for the target architecture (the same arch as the kernel) - compile user-space sample code under samples/ for the target arch instead of the host arch - make headers_install fail if a CONFIG option is leaked to user-space - sanitize the output format of scripts/checkstack.pl - handle ARM 'push' instruction in scripts/checkstack.pl - error out before modpost if a module name conflict is found - error out when multiple directories are passed to M= because this feature is broken for a long time - add CONFIG_DEBUG_INFO_COMPRESSED to support compressed debug info - a lot of cleanups of modpost - dump vmlinux symbols out into vmlinux.symvers, and reuse it in the second pass of modpost - do not run the second pass of modpost if nothing in modules is updated - install modules.builtin(.modinfo) by 'make install' as well as by 'make modules_install' because it is useful even when CONFIG_MODULES=n - add new command line variables, GZIP, BZIP2, LZOP, LZMA, LZ4, and XZ to allow users to use alternatives such as pigz, pbzip2, etc. * tag 'kbuild-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (96 commits) kbuild: add variables for compression tools Makefile: install modules.builtin even if CONFIG_MODULES=n mksysmap: Fix the mismatch of '.L' symbols in System.map kbuild: doc: rename LDFLAGS to KBUILD_LDFLAGS modpost: change elf_info->size to size_t modpost: remove is_vmlinux() helper modpost: strip .o from modname before calling new_module() modpost: set have_vmlinux in new_module() modpost: remove mod->skip struct member modpost: add mod->is_vmlinux struct member modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}() modpost: remove mod->is_dot_o struct member modpost: move -d option in scripts/Makefile.modpost modpost: remove -s option modpost: remove get_next_text() and make {grab,release_}file static modpost: use read_text_file() and get_line() for reading text files modpost: avoid false-positive file open error modpost: fix potential mmap'ed file overrun in get_src_version() modpost: add read_text_file() and get_line() helpers modpost: do not call get_modinfo() for vmlinux(.o) ... commit 6f2dc3d335457d9c815be9f4fd3dc8eff92fcef7 Merge: 1ee18de92927 48530d9fab0d Author: Linus Torvalds Date: Sat Jun 6 11:55:53 2020 -0700 Merge tag 'dma-mapping-5.8-2' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping helpers from Christoph Hellwig: "These were in a separate stable branch so that various media and drm trees could pull the in for bug fixes, but looking at linux-next that hasn't actually happened yet. Still sending the APIs to you in the hope that these bug fixes get picked up for 5.8 in one way or another. Summary: - add DMA mapping helpers for struct sg_table (Marek Szyprowski)" * tag 'dma-mapping-5.8-2' of git://git.infradead.org/users/hch/dma-mapping: iommu: add generic helper for mapping sgtable objects scatterlist: add generic wrappers for iterating over sgtable objects dma-mapping: add generic helpers for mapping sgtable objects commit 1ee18de92927f37e6948d5a6fc73cbf89f806905 Merge: e542e0dc3ee3 298f3db6ee69 Author: Linus Torvalds Date: Sat Jun 6 11:43:23 2020 -0700 Merge tag 'dma-mapping-5.8' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - enhance the dma pool to allow atomic allocation on x86 with AMD SEV (David Rientjes) - two small cleanups (Jason Yan and Peter Collingbourne) * tag 'dma-mapping-5.8' of git://git.infradead.org/users/hch/dma-mapping: dma-contiguous: fix comment for dma_release_from_contiguous dma-pool: scale the default DMA coherent pool size with memory capacity x86/mm: unencrypted non-blocking DMA allocations use coherent pools dma-pool: add pool sizes to debugfs dma-direct: atomic allocations must come from atomic coherent pools dma-pool: dynamically expanding atomic pools dma-pool: add additional coherent pools to map to gfp mask dma-remap: separate DMA atomic pools from direct remap code dma-debug: make __dma_entry_alloc_check_leak() static commit e542e0dc3ee3eafc46dd8e3073388079d69cace0 Merge: 3925c3bbdf88 f5152f4ded3c Author: Linus Torvalds Date: Sat Jun 6 11:30:00 2020 -0700 Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull dmi update from Jean Delvare. * 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: firmware/dmi: Report DMI Bios & EC firmware release commit 3925c3bbdf886f1ddf64461b9b380e1bb36f90c1 Merge: 9fa88c5d3f5e 2bd81cd04a3f Author: Linus Torvalds Date: Sat Jun 6 11:01:58 2020 -0700 Merge tag 'pci-v5.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: "Enumeration: - Program MPS for RCiEP devices (Ashok Raj) - Fix pci_register_host_bridge() device_register() error handling (Rob Herring) - Fix pci_host_bridge struct device release/free handling (Rob Herring) Resource management: - Allow resizing BARs for devices on root bus (Ard Biesheuvel) Power management: - Reduce Thunderbolt resume time by working around devices that don't support DLL Link Active reporting (Mika Westerberg) - Work around a Pericom USB controller OHCI/EHCI PME# defect (Kai-Heng Feng) Virtualization: - Add ACS quirk for Intel Root Complex Integrated Endpoints (Ashok Raj) - Avoid FLR for AMD Starship USB 3.0 (Kevin Buettner) - Avoid FLR for AMD Matisse HD Audio & USB 3.0 (Marcos Scriven) Error handling: - Use only _OSC (not HEST FIRMWARE_FIRST) to determine AER ownership (Alexandru Gagniuc, Kuppuswamy Sathyanarayanan) - Reduce verbosity by logging only ACPI_NOTIFY_DISCONNECT_RECOVER events (Kuppuswamy Sathyanarayanan) - Don't enable AER by default in Kconfig (Bjorn Helgaas) Peer-to-peer DMA: - Add AMD Zen Raven and Renoir Root Ports to whitelist (Alex Deucher) ASPM: - Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges (Kai-Heng Feng) Endpoint framework: - Fix DMA channel release in test (Kunihiko Hayashi) - Add page size as argument to pci_epc_mem_init() (Lad Prabhakar) - Add support to handle multiple base for mapping outbound memory (Lad Prabhakar) Generic host bridge driver: - Support building as module (Rob Herring) - Eliminate pci_host_common_probe wrappers (Rob Herring) Amlogic Meson PCIe controller driver: - Don't use FAST_LINK_MODE to set up link (Marc Zyngier) Broadcom STB PCIe controller driver: - Disable ASPM L0s if 'aspm-no-l0s' in DT (Jim Quinlan) - Fix clk_put() error (Jim Quinlan) - Fix window register offset (Jim Quinlan) - Assert fundamental reset on initialization (Nicolas Saenz Julienne) - Add notify xHCI reset property (Nicolas Saenz Julienne) - Add init routine for Raspberry Pi 4 VL805 USB controller (Nicolas Saenz Julienne) - Sync with Raspberry Pi 4 firmware for VL805 initialization (Nicolas Saenz Julienne) Cadence PCIe controller driver: - Remove "cdns,max-outbound-regions" DT property (replaced by "ranges") (Kishon Vijay Abraham I) - Read 32-bit (not 16-bit) Vendor ID/Device ID property from DT (Kishon Vijay Abraham I) Marvell Aardvark PCIe controller driver: - Improve link training (Marek Behún) - Add PHY support (Marek Behún) - Add "phys", "max-link-speed", "reset-gpios" to dt-binding (Marek Behún) - Train link immediately after enabling training to work around detection issues with some cards (Pali Rohár) - Issue PERST via GPIO to work around detection issues (Pali Rohár) - Don't blindly enable ASPM L0s (Pali Rohár) - Replace custom macros by standard linux/pci_regs.h macros (Pali Rohár) Microsoft Hyper-V host bridge driver: - Fix probe failure path to release resource (Wei Hu) - Retry PCI bus D0 entry on invalid device state for kdump (Wei Hu) Renesas R-Car PCIe controller driver: - Fix incorrect programming of OB windows (Andrew Murray) - Add suspend/resume (Kazufumi Ikeda) - Rename pcie-rcar.c to pcie-rcar-host.c (Lad Prabhakar) - Add endpoint controller driver (Lad Prabhakar) - Fix PCIEPAMR mask calculation (Lad Prabhakar) - Add r8a77961 to DT binding (Yoshihiro Shimoda) Socionext UniPhier Pro5 controller driver: - Add endpoint controller driver (Kunihiko Hayashi) Synopsys DesignWare PCIe controller driver: - Program outbound ATU upper limit register (Alan Mikhak) - Fix inner MSI IRQ domain registration (Marc Zyngier) Miscellaneous: - Check for platform_get_irq() failure consistently (negative return means failure) (Aman Sharma) - Fix several runtime PM get/put imbalances (Dinghao Liu) - Use flexible-array and struct_size() helpers for code cleanup (Gustavo A. R. Silva) - Update & fix issues in bridge emulation of PCIe registers (Jon Derrick) - Add macros for bridge window names (PCI_BRIDGE_IO_WINDOW, etc) (Krzysztof Wilczyński) - Work around Intel PCH MROMs that have invalid BARs (Xiaochun Lee)" * tag 'pci-v5.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (100 commits) PCI: uniphier: Add Socionext UniPhier Pro5 PCIe endpoint controller driver PCI: Add ACS quirk for Intel Root Complex Integrated Endpoints PCI/DPC: Print IRQ number used by port PCI/AER: Use "aer" variable for capability offset PCI/AER: Remove redundant dev->aer_cap checks PCI/AER: Remove redundant pci_is_pcie() checks PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership PCI: tegra: Fix runtime PM imbalance on error PCI: vmd: Filter resource type bits from shadow register PCI: tegra194: Fix runtime PM imbalance on error dt-bindings: PCI: Add UniPhier PCIe endpoint controller description PCI: hv: Use struct_size() helper PCI: Rename _DSM constants to align with spec PCI: Avoid FLR for AMD Starship USB 3.0 PCI: Avoid FLR for AMD Matisse HD Audio & USB 3.0 x86/PCI: Drop unused xen_register_pirq() gsi_override parameter PCI: dwc: Use private data pointer of "struct irq_domain" to get pcie_port PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link PCI: dwc: Fix inner MSI IRQ domain registration PCI: dwc: pci-dra7xx: Use devm_platform_ioremap_resource_byname() ... commit 8dd06ef34b6e2f41b29fbf5fc1663780f2524285 Merge: 642aa86eaf8f d0ac7079d5fc Author: Dmitry Torokhov Date: Sat Jun 6 10:45:37 2020 -0700 Merge branch 'next' into for-linus Prepare input updates for 5.8 merge window. commit 9fa88c5d3f5eae3e68ef20d226c3f13e21490668 Author: Zou Wei Date: Sat Jun 6 18:57:41 2020 +0200 hpfs: fix warning due to superfluous semicolon Fixes coccicheck warning: fs/hpfs/buffer.c:56:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Mikulas Patocka Signed-off-by: Linus Torvalds commit fe3bc8a988a4d38dc090e77071ff9b8ea266528a Merge: 4a7e89c5ec02 10cdb1575954 Author: Linus Torvalds Date: Sat Jun 6 10:01:48 2020 -0700 Merge branch 'for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue updates from Tejun Heo: "Mostly cleanups and other trivial changes. The only interesting change is Sebastian's rcuwait conversion for RT" * 'for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: use BUILD_BUG_ON() for compile time test instead of WARN_ON() workqueue: fix a piece of comment about reserved bits for work flags workqueue: remove useless unlock() and lock() in series workqueue: void unneeded requeuing the pwq in rescuer thread workqueue: Convert the pool::lock and wq_mayday_lock to raw_spinlock_t workqueue: Use rcuwait for wq_manager_wait workqueue: Remove unnecessary kfree() call in rcu_free_wq() workqueue: Fix an use after free in init_rescuer() workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO. commit 4a7e89c5ec0238017a757131eb9ab8dc111f961c Merge: 3c0ad98c2eda 936f2a70f207 Author: Linus Torvalds Date: Sat Jun 6 09:59:34 2020 -0700 Merge branch 'for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "Just two patches: one to add system-level cpu.stat to the root cgroup for convenience and a trivial comment update" * 'for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: add cpu.stat file to root cgroup cgroup: Remove stale comments commit 3c0ad98c2eda5ff30d23777e30744be6f7b8f097 Merge: aaa2faab4ed8 42413b49804b Author: Linus Torvalds Date: Sat Jun 6 09:39:05 2020 -0700 Merge tag 'integrity-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity updates from Mimi Zohar: "The main changes are extending the TPM 2.0 PCR banks with bank specific file hashes, calculating the "boot_aggregate" based on other TPM PCR banks, using the default IMA hash algorithm, instead of SHA1, as the basis for the cache hash table key, and preventing the mprotect syscall to circumvent an IMA mmap appraise policy rule. - In preparation for extending TPM 2.0 PCR banks with bank specific digests, commit 0b6cf6b97b7e ("tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend()") modified tpm_pcr_extend(). The original SHA1 file digests were padded/truncated, before being extended into the other TPM PCR banks. This pull request calculates and extends the TPM PCR banks with bank specific file hashes completing the above change. - The "boot_aggregate", the first IMA measurement list record, is the "trusted boot" link between the pre-boot environment and the running OS. With TPM 2.0, the "boot_aggregate" record is not limited to being based on the SHA1 TPM PCR bank, but can be calculated based on any enabled bank, assuming the hash algorithm is also enabled in the kernel. Other changes include the following and five other bug fixes/code clean up: - supporting both a SHA1 and a larger "boot_aggregate" digest in a custom template format containing both the the SHA1 ('d') and larger digests ('d-ng') fields. - Initial hash table key fix, but additional changes would be good" * tag 'integrity-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: Directly free *entry in ima_alloc_init_template() if digests is NULL ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init() ima: Directly assign the ima_default_policy pointer to ima_rules ima: verify mprotect change is consistent with mmap policy evm: Fix possible memory leak in evm_calc_hmac_or_hash() ima: Set again build_ima_appraise variable ima: Remove redundant policy rule set in add_rules() ima: Fix ima digest hash table key calculation ima: Use ima_hash_algo for collision detection in the measurement list ima: Calculate and extend PCR with digests in ima_template_entry ima: Allocate and initialize tfm for each PCR bank ima: Switch to dynamically allocated buffer for template digests ima: Store template digest directly in ima_template_entry ima: Evaluate error in init_ima() ima: Switch to ima_hash_algo for boot aggregate commit 5865985416ebb5a0c198a819a098b5cc300ac8a4 Author: Steve French Date: Fri Jun 5 17:19:46 2020 -0500 smb3: extend fscache mount volume coherency check It is better to check volume id and creation time, not just the root inode number to verify if the volume has changed when remounting. Reviewed-by: David Howells Signed-off-by: Steve French commit 8dfb61dcbaceb19a5ded5e9c9dcf8d05acc32294 Author: Denis Efremov Date: Fri Jun 5 10:39:55 2020 +0300 kbuild: add variables for compression tools Allow user to use alternative implementations of compression tools, such as pigz, pbzip2, pxz. For example, multi-threaded tools to speed up the build: $ make GZIP=pigz BZIP2=pbzip2 Variables _GZIP, _BZIP2, _LZOP are used internally because original env vars are reserved by the tools. The use of GZIP in gzip tool is obsolete since 2015. However, alternative implementations (e.g., pigz) still rely on it. BZIP2, BZIP, LZOP vars are not obsolescent. The credit goes to @grsecurity. As a sidenote, for multi-threaded lzma, xz compression one can use: $ export XZ_OPT="--threads=0" Signed-off-by: Denis Efremov Signed-off-by: Masahiro Yamada commit e0b250b57dcf403529081e5898a9de717f96b76b Author: Jonas Zeiger Date: Wed Jun 3 15:34:05 2020 +0200 Makefile: install modules.builtin even if CONFIG_MODULES=n Many applications check for available kernel features via: - /proc/modules (loaded modules, present if CONFIG_MODULES=y) - $(MODLIB)/modules.builtin (builtin modules) They fail to detect features if the kernel was built with CONFIG_MODULES=n and modules.builtin isn't installed. Therefore, add the target "_builtin_inst_" and make "install" and "modules_install" depend on it. Tests results: - make install: kernel image is copied as before, modules.builtin copied - make modules_install: (CONFIG_MODULES=n) nothing is copied, exit 1 Signed-off-by: Jonas Zeiger Signed-off-by: Masahiro Yamada commit 72d24accf02add25e08733f0ecc93cf10fcbd88c Author: ashimida Date: Tue Jun 2 15:45:17 2020 +0800 mksysmap: Fix the mismatch of '.L' symbols in System.map When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'. For example: ashimida@ubuntu:~/linux$ cat System.map |grep ' .L' ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L' ffff0000088028e0 t bLength_show ...... ffff0000092e0408 b PLLP_OUTC_lock ffff0000092e0410 b PLLP_OUTA_lock The original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped. Fixes: 00902e984732 ("mksysmap: Add h8300 local symbol pattern") Signed-off-by: ashimida Signed-off-by: Masahiro Yamada commit c0901577e1dcc8d1c0fd1a11c8d571f650df845f Author: Masahiro Yamada Date: Tue Jun 2 02:03:28 2020 +0900 kbuild: doc: rename LDFLAGS to KBUILD_LDFLAGS Commit d503ac531a52 ("kbuild: rename LDFLAGS to KBUILD_LDFLAGS") missed to update the documentation. Signed-off-by: Masahiro Yamada commit 3b09efc4f0c94669a928c0453d2dcb54c59543f2 Author: Masahiro Yamada Date: Mon Jun 1 14:57:31 2020 +0900 modpost: change elf_info->size to size_t Align with the mmap / munmap APIs. Signed-off-by: Masahiro Yamada commit 4de7b62936122570408357417f21072e78292926 Author: Masahiro Yamada Date: Mon Jun 1 14:57:30 2020 +0900 modpost: remove is_vmlinux() helper Now that is_vmlinux() is called only in new_module(), we can inline the function call. modname is the basename with '.o' is stripped. No need to compare it with 'vmlinux.o'. vmlinux is always located at the current working directory. No need to strip the directory path. Signed-off-by: Masahiro Yamada commit a82f794c41ab51f088af325f5d9acba30a6facdb Author: Masahiro Yamada Date: Mon Jun 1 14:57:29 2020 +0900 modpost: strip .o from modname before calling new_module() new_module() conditionally strips the .o because the modname has .o suffix when it is called from read_symbols(), but no .o when it is called from read_dump(). It is clearer to strip .o in read_symbols(). I also used flexible-array for mod->name. Signed-off-by: Masahiro Yamada commit 858b937d289bbf7551d496100c1fa9efcad5796e Author: Masahiro Yamada Date: Mon Jun 1 14:57:28 2020 +0900 modpost: set have_vmlinux in new_module() Set have_vmlinux flag in a single place. Signed-off-by: Masahiro Yamada commit 0b19d54cae11bd5b9e208f52e42d88ad33a3b1d9 Author: Masahiro Yamada Date: Mon Jun 1 14:57:27 2020 +0900 modpost: remove mod->skip struct member The meaning of 'skip' is obscure since it does not explain "what to skip". mod->skip is set when it is vmlinux or the module info came from a dump file. So, mod->skip is equivalent to (mod->is_vmlinux || mod->from_dump). For the check in write_namespace_deps_files(), mod->is_vmlinux is unneeded because the -d option is not passed in the first pass of modpost. Signed-off-by: Masahiro Yamada commit 5a438af9db2c4a0b80d51d8c1c9c623b0c0de967 Author: Masahiro Yamada Date: Mon Jun 1 14:57:26 2020 +0900 modpost: add mod->is_vmlinux struct member is_vmlinux() is called in several places to check whether the current module is vmlinux or not. It is faster and clearer to check mod->is_vmlinux flag. Signed-off-by: Masahiro Yamada commit 1be5fa6c948533bb95ac783010ef686261be5384 Author: Masahiro Yamada Date: Mon Jun 1 14:57:25 2020 +0900 modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}() check_exports() is never called for vmlinux because mod->skip is set for vmlinux. Hence, check_for_gpl_usage() and check_for_unused() are not called for vmlinux, either. is_vmlinux() is always false here. Remove the is_vmlinux() calls, and hard-code the ".ko" suffix. Signed-off-by: Masahiro Yamada commit 3379576dd6e708f66498d49b4cec5f9b198791a0 Author: Masahiro Yamada Date: Mon Jun 1 14:57:24 2020 +0900 modpost: remove mod->is_dot_o struct member Previously, there were two cases where mod->is_dot_o is unset: [1] the executable 'vmlinux' in the second pass of modpost [2] modules loaded by read_dump() I think [1] was intended usage to distinguish 'vmlinux.o' and 'vmlinux'. Now that modpost does not parse the executable 'vmlinux', this case does not happen. [2] is obscure, maybe a bug. Module.symver stores module paths without extension. So, none of modules loaded by read_dump() has the .o suffix, and new_module() unsets ->is_dot_o. Anyway, it is not a big deal because handle_symbol() is not called for the case. To sum up, all the parsed ELF files are .o files. mod->is_dot_o is unneeded. Signed-off-by: Masahiro Yamada commit 859c926aea29353bced3a456c2f73753040b437e Author: Masahiro Yamada Date: Mon Jun 1 14:57:23 2020 +0900 modpost: move -d option in scripts/Makefile.modpost Collect options for modules into a single place. Signed-off-by: Masahiro Yamada commit 467b82d7cee4373aa7bc47fd3043e2fa0a3440f5 Author: Masahiro Yamada Date: Mon Jun 1 14:57:22 2020 +0900 modpost: remove -s option The -s option was added by commit 8d8d8289df65 ("kbuild: do not do section mismatch checks on vmlinux in 2nd pass"). Now that the second pass does not parse vmlinux, this option is unneeded. Signed-off-by: Masahiro Yamada commit 75893572d45399cefbb88443d0878adae9cb0b41 Author: Masahiro Yamada Date: Mon Jun 1 14:57:21 2020 +0900 modpost: remove get_next_text() and make {grab,release_}file static get_next_line() is no longer used. Remove. grab_file() and release_file() are only used in modpost.c. Make them static. Signed-off-by: Masahiro Yamada commit 70f30cfe5b892fcb7f98e7df72ed6ccfe3225628 Author: Masahiro Yamada Date: Mon Jun 1 14:57:20 2020 +0900 modpost: use read_text_file() and get_line() for reading text files grab_file() mmaps a file, but it is not so efficient here because get_next_line() copies every line to the temporary buffer anyway. read_text_file() and get_line() are simpler. get_line() exploits the library function strchr(). Going forward, the missing *.symvers or *.cmd is a fatal error. This should not happen because scripts/Makefile.modpost guards the -i option files with $(wildcard $(input-symdump)). Signed-off-by: Masahiro Yamada commit 7c8f5662c502b7b967399fef8a64532ec43b063d Author: Masahiro Yamada Date: Mon Jun 1 14:57:19 2020 +0900 modpost: avoid false-positive file open error One problem of grab_file() is that it cannot distinguish the following two cases: - It cannot read the file (the file does not exist, or read permission is not set) - It can read the file, but the file size is zero This is because grab_file() calls mmap(), which requires the mapped length is greater than 0. Hence, grab_file() fails for both cases. If an empty header file were included for checksum calculation, the following warning would be printed: WARNING: modpost: could not open ...: Invalid argument An empty file is a valid source file, so it should not fail. Use read_text_file() instead. It can read a zero-length file. Then, parse_file() will succeed with doing nothing. Going forward, the first case (it cannot read the file) is a fatal error. If the source file from which an object was compiled is missing, something went wrong. Signed-off-by: Masahiro Yamada commit f531c1b5de65bc687bdcca69e7649fe2db5b6d87 Author: Masahiro Yamada Date: Mon Jun 1 14:57:18 2020 +0900 modpost: fix potential mmap'ed file overrun in get_src_version() I do not know how reliably this function works, but it looks dangerous to me. strchr(sources, '\n'); ... continues searching until it finds '\n' or it reaches the '\0' terminator. In other words, 'sources' should be a null-terminated string. However, grab_file() just mmaps a file, so 'sources' is not terminated with null byte. If the file does not contain '\n' at all, strchr() will go beyond the mmap'ed memory. Use read_text_file(), which loads the file content into a malloc'ed buffer, appending null byte. Here we are interested only in the first line of *.mod files. Use get_line() helper to get the first line. This also makes missing *.mod file a fatal error. Commit 4be40e22233c ("kbuild: do not emit src version warning for non-modules") ignored missing *.mod files. I do not fully understand what that commit addressed, but commit 91341d4b2c19 ("kbuild: introduce new option to enhance section mismatch analysis") introduced partial section checks by using modpost. built-in.o was parsed by modpost. Even modules had a problem because *.mod files were created after the modpost check. Commit b7dca6dd1e59 ("kbuild: create *.mod with full directory path and remove MODVERDIR") stopped doing that. Now that modpost is only invoked after the directory descend, *.mod files should always exist at the modpost stage. Signed-off-by: Masahiro Yamada commit ac5100f54329676469688d1b5415cd8d6428c909 Author: Masahiro Yamada Date: Mon Jun 1 14:57:17 2020 +0900 modpost: add read_text_file() and get_line() helpers modpost uses grab_file() to open a file, but it is not suitable for a text file because the mmap'ed file is not terminated by null byte. Actually, I see some issues for the use of grab_file(). The new helper, read_text_file() loads the whole file content into a malloc'ed buffer, and appends a null byte. Then, get_line() reads each line. To handle text files, I intend to replace as follows: grab_file() -> read_text_file() get_new_line() -> get_line() Signed-off-by: Masahiro Yamada commit 4ddea2f8e825a86e94011ebc32eb1dce220b2316 Author: Masahiro Yamada Date: Mon Jun 1 14:57:16 2020 +0900 modpost: do not call get_modinfo() for vmlinux(.o) The three calls of get_modinfo() ("license", "import_ns", "version") always return NULL for vmlinux(.o) because the built-in module info is prefixed with __MODULE_INFO_PREFIX. It is harmless to call get_modinfo(), but there is no point to search for what apparently does not exist. Signed-off-by: Masahiro Yamada commit f693153519607449d3e270d9e6af20b032543c05 Author: Masahiro Yamada Date: Mon Jun 1 14:57:15 2020 +0900 modpost: drop RCS/CVS $Revision handling in MODULE_VERSION() As far as I understood, this code gets rid of '$Revision$' or '$Revision:' of CVS, RCS or whatever in MODULE_VERSION() tags. Remove the primeval code. Signed-off-by: Masahiro Yamada commit 48a0f72797bdc6b428f951aff265f5aecc2bda49 Author: Masahiro Yamada Date: Mon Jun 1 14:57:14 2020 +0900 modpost: show warning if any of symbol dump files is missing If modpost fails to load a symbol dump file, it cannot check unresolved symbols, hence module dependency will not be added. Nor CRCs can be added. Currently, external module builds check only $(objtree)/Module.symvers, but it should check files specified by KBUILD_EXTRA_SYMBOLS as well. Move the warning message from the top Makefile to scripts/Makefile.modpost and print the warning if any dump file is missing. Signed-off-by: Masahiro Yamada commit 7e8a3235823bcb779acf92de630edd5ddffaf886 Author: Masahiro Yamada Date: Mon Jun 1 14:57:13 2020 +0900 modpost: show warning if vmlinux is not found when processing modules check_exports() does not print warnings about unresolved symbols if vmlinux is missing because there would be too many. This situation happens when you do 'make modules' from the clean tree, or compile external modules against a kernel tree that has not been completely built. It is dangerous to not check unresolved symbols because you might be building useless modules. At least it should be warned. Signed-off-by: Masahiro Yamada commit 436b2ac603d58504f38041a0cd8adb5aeace992b Author: Masahiro Yamada Date: Mon Jun 1 14:57:12 2020 +0900 modpost: invoke modpost only when input files are updated Currently, the second pass of modpost is always invoked when you run 'make' or 'make modules' even if none of modules is changed. Use if_changed to invoke it only when it is necessary. Signed-off-by: Masahiro Yamada commit 269a535ca931b754a40dda3ab60514e68773c759 Author: Masahiro Yamada Date: Mon Jun 1 14:57:11 2020 +0900 modpost: generate vmlinux.symvers and reuse it for the second modpost The full build runs modpost twice, first for vmlinux.o and second for modules. The first pass dumps all the vmlinux symbols into Module.symvers, but the second pass parses vmlinux again instead of reusing the dump file, presumably because it needs to avoid accumulating stale symbols. Loading symbol info from a dump file is faster than parsing an ELF object. Besides, modpost deals with various issues to parse vmlinux in the second pass. A solution is to make the first pass dumps symbols into a separate file, vmlinux.symvers. The second pass reads it, and parses module .o files. The merged symbol information is dumped into Module.symvers in the same way as before. This makes further modpost cleanups possible. Also, it fixes the problem of 'make vmlinux', which previously overwrote Module.symvers, throwing away module symbols. I slightly touched scripts/link-vmlinux.sh so that vmlinux is re-linked when you cross this commit. Otherwise, vmlinux.symvers would not be generated. Signed-off-by: Masahiro Yamada commit f1005b30ade716eb9286613aeb1d33b5c7852a91 Author: Masahiro Yamada Date: Mon Jun 1 14:57:10 2020 +0900 modpost: refactor -i option calculation Prepare to use -i for in-tree modpost as well. Signed-off-by: Masahiro Yamada commit bcfedae7d92886597e581ec32dfbf698cbccb4a1 Author: Masahiro Yamada Date: Mon Jun 1 14:57:09 2020 +0900 modpost: print symbol dump file as the build target in short log The symbol dump *.symvers is the output of modpost. Print it in the short log. Signed-off-by: Masahiro Yamada commit e3fb4df7fe4e8636de32a1e4ff5ebc75257f5570 Author: Masahiro Yamada Date: Mon Jun 1 14:57:08 2020 +0900 modpost: re-add -e to set external_module flag Previously, the -i option had two functions; load a symbol dump file, and set the external_module flag. I want to assign a dedicate option for each of them. Going forward, the -i is used to load a symbol dump file, and the -e to set the external_module flag. With this, we will be able to use -i for loading in-kernel symbols. Signed-off-by: Masahiro Yamada commit 7924799ed2ddaa393c2ef0c4cd13a81d122bffde Author: Masahiro Yamada Date: Mon Jun 1 14:57:07 2020 +0900 modpost: rename ext_sym_list to dump_list The -i option is used to include Modules.symver as well as files from $(KBUILD_EXTRA_SYMBOLS). Make the struct and variable names more generic. Signed-off-by: Masahiro Yamada commit ce2ddd6d6ab3b343837d5c8e17538a5f67fa400e Author: Masahiro Yamada Date: Mon Jun 1 14:57:06 2020 +0900 modpost: allow to pass -i option multiple times to remove -e option Now that there is no difference between -i and -e, they can be unified. Make modpost accept the -i option multiple times, then remove -e. I will reuse -e for a different purpose. Signed-off-by: Masahiro Yamada commit 52c3416db00d970c91a6992ab6e5ff48e077ad29 Author: Masahiro Yamada Date: Mon Jun 1 14:57:05 2020 +0900 modpost: track if the symbol origin is a dump file or ELF object The meaning of sym->kernel is obscure; it is set for in-kernel symbols loaded from Modules.symvers. This happens only when we are building external modules, and it is used to determine whether to dump symbols to $(KBUILD_EXTMOD)/Modules.symvers It is clearer to remember whether the symbol or module came from a dump file or ELF object. This changes the KBUILD_EXTRA_SYMBOLS behavior. Previously, symbols loaded from KBUILD_EXTRA_SYMBOLS are accumulated into the current $(KBUILD_EXTMOD)/Modules.symvers Going forward, they will be only used to check symbol references, but not dumped into the current $(KBUILD_EXTMOD)/Modules.symvers. I believe this makes more sense. sym->vmlinux will have no user. Remove it too. Signed-off-by: Masahiro Yamada commit f5152f4ded3ce6d332d5e4f9d7e325c3b81cae1b Author: Erwan Velu Date: Sat Jun 6 11:35:50 2020 +0200 firmware/dmi: Report DMI Bios & EC firmware release Some vendors like HPe or Dell, encode the release version of their BIOS in the "System BIOS {Major|Minor} Release" fields of Type 0. This information is used to know which bios release actually runs. It could be used for some quirks, debugging sessions or inventory tasks. A typical output for a Dell system running the 65.27 bios is : [root@t1700 ~]# cat /sys/devices/virtual/dmi/id/bios_release 65.27 [root@t1700 ~]# Servers that have a BMC encode the release version of their firmware in the "Embedded Controller Firmware {Major|Minor} Release" fields of Type 0. This information is used to know which BMC release actually runs. It could be used for some quirks, debugging sessions or inventory tasks. A typical output for a Dell system running the 3.75 bmc release is : [root@t1700 ~]# cat /sys/devices/virtual/dmi/id/ec_firmware_release 3.75 [root@t1700 ~]# Signed-off-by: Erwan Velu Signed-off-by: Jean Delvare commit 388d8bdb87e01bcea6d0b2bf797b5f6d7b2401fb Author: Mel Gorman Date: Thu Apr 9 11:40:34 2020 +0100 tracing: Remove obsolete PREEMPTIRQ_EVENTS kconfig option The PREEMPTIRQ_EVENTS option is unused after commit c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage"). Remove it. Note that this option is hazardous as it stands. It enables TRACE_IRQFLAGS event on non-preempt configurations without the irqsoff tracer enabled. TRACE_IRQFLAGS as it stands incurs significant overhead on each IRQ entry/exit. This is because trace_hardirqs_[on|off] does all the per-cpu manipulations and NMI checks even if tracing is completely disabled for some insane reason. For example, netperf running UDP_STREAM on localhost incurs a 4-6% performance penalty without any tracing if IRQFLAGS is set. It can be put behind a static brach but even the function entry/exit costs a little bit. Link: https://lkml.kernel.org/r/20200409104034.GJ3818@techsingularity.net Signed-off-by: Mel Gorman Signed-off-by: Steven Rostedt (VMware) commit 2130c0ba69d69bb21f5c52787f2587db00d13d8a Author: Logan Gunthorpe Date: Wed Jan 9 12:22:33 2019 -0700 NTB: ntb_test: Fix bug when counting remote files When remote files are counted in get_files_count, without using SSH, the code returns 0 because there is a colon prepended to $LOC. $VPATH should have been used instead of $LOC. Fixes: 06bd0407d06c ("NTB: ntb_test: Update ntb_tool Scratchpad tests") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit 34d8673a01b053b6231a995a4eec9341163d63be Author: Logan Gunthorpe Date: Wed Jan 9 12:22:32 2019 -0700 NTB: perf: Fix race condition when run with ntb_test When running ntb_test, the script tries to run the ntb_perf test immediately after probing the modules. Since adding multi-port support, this fails seeing the new initialization procedure in ntb_perf can not complete instantly. To fix this we add a completion which is waited on when a test is started. In this way, run can be written any time after the module is loaded and it will wait for the initialization to complete instead of sending an error. Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit b54369a248c2e033bfcf5d6917e08cf9d73d54a6 Author: Logan Gunthorpe Date: Wed Jan 9 12:22:31 2019 -0700 NTB: perf: Fix support for hardware that doesn't have port numbers Legacy drivers do not have port numbers (but is reliably only two ports) and was broken by the recent commit that added mult-port support to ntb_perf. This is especially important to support the cross link topology which is perfectly symmetric and cannot assign unique port numbers easily. Hardware that returns zero for both the local port and the peer should just always use gidx=0 for the only peer. Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit a9c4211ac918ade1522aced6b5acfbe824722f7d Author: Logan Gunthorpe Date: Wed Jan 9 12:22:30 2019 -0700 NTB: perf: Don't require one more memory window than number of peers ntb_perf should not require more than one memory window per peer. This was probably an off-by-one error. Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit ca93c45755da98302c93abdd788fc09113baf9e0 Author: Logan Gunthorpe Date: Wed Jan 9 12:22:29 2019 -0700 NTB: ntb_pingpong: Choose doorbells based on port number This commit fixes pingpong support for existing drivers that do not implement ntb_default_port_number() and ntb_default_peer_port_number(). This is required for hardware (like the crosslink topology of switchtec) which cannot assign reasonable port numbers to each port due to its perfect symmetry. Instead of picking the doorbell to use based on the the index of the peer, we use the peer's port number. This is a bit clearer and easier to understand. Fixes: c7aeb0afdcc2 ("NTB: ntb_pp: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit fc8b086d9dbd57458d136c4fa70ee26f832c3a2e Author: Logan Gunthorpe Date: Wed Jan 9 12:22:28 2019 -0700 NTB: Fix the default port and peer numbers for legacy drivers When the commit adding ntb_default_port_number() and ntb_default_peer_port_number() entered the kernel there was no users of it so it was impossible to tell what the API needed. When a user finally landed a year later (ntb_pingpong) there were more NTB topologies were created and no consideration was considered to how other drivers had changed. Now that there is a user it can be fixed to provide a sensible default for the legacy drivers that do not implement ntb_{peer_}port_number(). Seeing ntb_pingpong doesn't check error codes returning EINVAL was also not sensible. Patches for ntb_pingpong and ntb_perf follow (which are broken otherwise) to support hardware that doesn't have port numbers. This is important not only to not break support with existing drivers but for the cross link topology which, due to its perfect symmetry, cannot assign unique port numbers to each side. Fixes: 1e5301196a88 ("NTB: Add indexed ports NTB API") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit 40da7d9a93c8941737ef4a1208d32c13ce017fe1 Author: Logan Gunthorpe Date: Wed Jan 9 12:22:27 2019 -0700 NTB: Revert the change to use the NTB device dev for DMA allocations Commit 417cf39cfea9 ("NTB: Set dma mask and dma coherent mask to NTB devices") started using the NTB device for DMA allocations which was turns out was wrong. If the IOMMU is enabled, such alloctanions will always fail with messages such as: DMAR: Allocating domain for 0000:02:00.1 failed This is because the IOMMU has not setup the device for such use. Change the tools back to using the PCI device for allocations seeing it doesn't make sense to add an IOMMU group for the non-physical NTB device. Also remove the code that sets the DMA mask as it no longer makes sense to do this. Fixes: 7f46c8b3a552 ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit 912e12813dd03c602e4922fc34709ec4d4380cf0 Author: Logan Gunthorpe Date: Wed Jan 9 12:22:26 2019 -0700 NTB: ntb_tool: reading the link file should not end in a NULL byte When running ntb_test this warning is issued: ./ntb_test.sh: line 200: warning: command substitution: ignored null byte in input This is caused by the kernel returning one more byte than is necessary when reading the link file. Reduce the number of bytes read back to 2 as it was before the commit that regressed this. Fixes: 7f46c8b3a552 ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason commit 9cb8bfdf5262b14d29617d1595b79e1f360135ab Author: Sanjay R Mehta Date: Tue May 5 23:21:52 2020 -0500 ntb_perf: avoid false dma unmap of destination address The DMA map and unmap of destination address is already being done in perf_init_test() and perf_clear_test() functions. Hence avoiding it by making necessary changes in perf_copy_chunk() function. Signed-off-by: Sanjay R Mehta Signed-off-by: Arindam Nath Signed-off-by: Jon Mason commit d7699665773b6afc14d4eef82bb3ef50467a9353 Author: Sanjay R Mehta Date: Tue May 5 23:21:51 2020 -0500 ntb_perf: increase sleep time from one milli sec to one sec After trying to send commands for a maximum of MSG_TRIES re-tries, link-up fails due to short sleep time(1ms) between re-tries. Hence increasing the sleep time to one second providing sufficient time for perf link-up. Signed-off-by: Sanjay R Mehta Signed-off-by: Arindam Nath Signed-off-by: Jon Mason commit 433efe720674efd9fdbcef78be75793393cf05db Author: Sanjay R Mehta Date: Tue May 5 23:21:50 2020 -0500 ntb_tool: pass correct struct device to dma_alloc_coherent Currently, ntb->dev is passed to dma_alloc_coherent and dma_free_coherent calls. The returned dma_addr_t is the CPU physical address. This works fine as long as IOMMU is disabled. But when IOMMU is enabled, we need to make sure that IOVA is returned for dma_addr_t. So the correct way to achieve this is by changing the first parameter of dma_alloc_coherent() as ntb->pdev->dev instead. Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Sanjay R Mehta Signed-off-by: Arindam Nath Signed-off-by: Jon Mason commit 98f4e140264eeb52f22ff05be6b6dd48237255ac Author: Sanjay R Mehta Date: Tue May 5 23:21:49 2020 -0500 ntb_perf: pass correct struct device to dma_alloc_coherent Currently, ntb->dev is passed to dma_alloc_coherent and dma_free_coherent calls. The returned dma_addr_t is the CPU physical address. This works fine as long as IOMMU is disabled. But when IOMMU is enabled, we need to make sure that IOVA is returned for dma_addr_t. So the correct way to achieve this is by changing the first parameter of dma_alloc_coherent() as ntb->pdev->dev instead. Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Signed-off-by: Sanjay R Mehta Signed-off-by: Arindam Nath Signed-off-by: Jon Mason commit f80fe8944e085a1065f4829a14af8394cad1c30f Author: Logan Gunthorpe Date: Tue May 5 23:21:48 2020 -0500 ntb: hw: remove the code that sets the DMA mask This patch removes the code that sets the DMA mask as it no longer makes sense to do this. Fixes: 7f46c8b3a552 ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Tested-by: Alexander Fomichev Signed-off-by: Sanjay R Mehta Signed-off-by: Jon Mason commit 46f21af862656c477387f2256adc1005503db67d Author: Wesley Sheng Date: Tue May 26 15:59:43 2020 +0800 NTB: correct ntb_peer_spad_addr and ntb_peer_spad_read comment typos The comment for ntb_peer_spad_addr and ntb_peer_spad_read incorrectly referred to peer doorbell register and local scratchpad register. Signed-off-by: Wesley Sheng Signed-off-by: Jon Mason commit 893733c58d59f43e4c5219bf9ab9e9d39bb14289 Author: Dave Jiang Date: Tue May 26 10:28:53 2020 -0700 ntb: intel: fix static declaration intel_ntb4_link_disable() missing static declaration. Reported-by: kbuild test robot Signed-off-by: Dave Jiang Signed-off-by: Jon Mason commit 134a86545c6072c049a2c6e77d6843e650df511d Author: Dave Jiang Date: Fri Jun 5 08:13:34 2020 -0700 ntb: intel: add hw workaround for NTB BAR alignment Add NTB_HWERR_BAR_ALIGN hw errata flag to work around issue where the aligment for the XLAT base must be BAR size aligned rather than 4k page aligned. On ICX platform, the XLAT base can be 4k page size aligned rather than BAR size aligned unlike the previous gen Intel NTB. However, a silicon errata prevented this from working as expected and a workaround is introduced to resolve the issue. Signed-off-by: Dave Jiang Signed-off-by: Jon Mason commit aaa2faab4ed8e5fe0111e04d6e168c028fe2987f Merge: e3cea0cad147 0df556457748 Author: Linus Torvalds Date: Fri Jun 5 16:44:36 2020 -0700 Merge tag 'for-linus-5.8-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs updates from Mike Marshall: - John Hubbard's conversion from get_user_pages() to pin_user_pages() - Colin Ian King's removal of an unneeded variable initialization * tag 'for-linus-5.8-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: convert get_user_pages() --> pin_user_pages() orangefs: remove redundant assignment to variable ret commit e3cea0cad147a9ab4f0e74a2fbdf15d18df1f820 Merge: 3803d5e4d3ce fe204591cc94 Author: Linus Torvalds Date: Fri Jun 5 16:43:16 2020 -0700 Merge tag 'dlm-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This set includes a couple minor cleanups, and dropping the interruptible from a wait_event that waits for an event from the userspace cluster management" * tag 'dlm-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: dlm: remove BUG() before panic() dlm: Switch to using wait_event() fs:dlm:remove unneeded semicolon in rcom.c dlm: user: Replace zero-length array with flexible-array member dlm: dlm_internal: Replace zero-length array with flexible-array member commit 3803d5e4d3ce2600ffddc16a1999798bc719042d Merge: 9daa0a27a0bc 331cc667a99c Author: Linus Torvalds Date: Fri Jun 5 16:40:53 2020 -0700 Merge tag '5.8-rc-smb3-fixes-part-1' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs updates from Steve French: "22 changesets, 2 for stable. Includes big performance improvement for large i/o when using multichannel, also includes DFS fixes" * tag '5.8-rc-smb3-fixes-part-1' of git://git.samba.org/sfrench/cifs-2.6: (22 commits) cifs: update internal module version number cifs: multichannel: try to rebind when reconnecting a channel cifs: multichannel: use pointer for binding channel smb3: remove static checker warning cifs: multichannel: move channel selection above transport layer cifs: multichannel: always zero struct cifs_io_parms cifs: dump Security Type info in DebugData smb3: fix incorrect number of credits when ioctl MaxOutputResponse > 64K smb3: default to minimum of two channels when multichannel specified cifs: multichannel: move channel selection in function cifs: fix minor typos in comments and log messages smb3: minor update to compression header definitions cifs: minor fix to two debug messages cifs: Standardize logging output smb3: Add new parm "nodelete" cifs: move some variables off the stack in smb2_ioctl_query_info cifs: reduce stack use in smb2_compound_op cifs: get rid of unused parameter in reconn_setup_dfs_targets() cifs: handle hostnames that resolve to same ip in failover cifs: set up next DFS target before generic_ip_connect() ... commit 9daa0a27a0bce6596be287fb1df372ff80bb1087 Merge: 0b166a57e622 8409f67b6437 Author: Linus Torvalds Date: Fri Jun 5 16:26:36 2020 -0700 Merge tag 'afs-next-20200604' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS updates from David Howells: "There's some core VFS changes which affect a couple of filesystems: - Make the inode hash table RCU safe and providing some RCU-safe accessor functions. The search can then be done without taking the inode_hash_lock. Care must be taken because the object may be being deleted and no wait is made. - Allow iunique() to avoid taking the inode_hash_lock. - Allow AFS's callback processing to avoid taking the inode_hash_lock when using the inode table to find an inode to notify. - Improve Ext4's time updating. Konstantin Khlebnikov said "For now, I've plugged this issue with try-lock in ext4 lazy time update. This solution is much better." Then there's a set of changes to make a number of improvements to the AFS driver: - Improve callback (ie. third party change notification) processing by: (a) Relying more on the fact we're doing this under RCU and by using fewer locks. This makes use of the RCU-based inode searching outlined above. (b) Moving to keeping volumes in a tree indexed by volume ID rather than a flat list. (c) Making the server and volume records logically part of the cell. This means that a server record now points directly at the cell and the tree of volumes is there. This removes an N:M mapping table, simplifying things. - Improve keeping NAT or firewall channels open for the server callbacks to reach the client by actively polling the fileserver on a timed basis, instead of only doing it when we have an operation to process. - Improving detection of delayed or lost callbacks by including the parent directory in the list of file IDs to be queried when doing a bulk status fetch from lookup. We can then check to see if our copy of the directory has changed under us without us getting notified. - Determine aliasing of cells (such as a cell that is pointed to be a DNS alias). This allows us to avoid having ambiguity due to apparently different cells using the same volume and file servers. - Improve the fileserver rotation to do more probing when it detects that all of the addresses to a server are listed as non-responsive. It's possible that an address that previously stopped responding has become responsive again. Beyond that, lay some foundations for making some calls asynchronous: - Turn the fileserver cursor struct into a general operation struct and hang the parameters off of that rather than keeping them in local variables and hang results off of that rather than the call struct. - Implement some general operation handling code and simplify the callers of operations that affect a volume or a volume component (such as a file). Most of the operation is now done by core code. - Operations are supplied with a table of operations to issue different variants of RPCs and to manage the completion, where all the required data is held in the operation object, thereby allowing these to be called from a workqueue. - Put the standard "if (begin), while(select), call op, end" sequence into a canned function that just emulates the current behaviour for now. There are also some fixes interspersed: - Don't let the EACCES from ICMP6 mapping reach the user as such, since it's confusing as to whether it's a filesystem error. Convert it to EHOSTUNREACH. - Don't use the epoch value acquired through probing a server. If we have two servers with the same UUID but in different cells, it's hard to draw conclusions from them having different epoch values. - Don't interpret the argument to the CB.ProbeUuid RPC as a fileserver UUID and look up a fileserver from it. - Deal with servers in different cells having the same UUIDs. In the event that a CB.InitCallBackState3 RPC is received, we have to break the callback promises for every server record matching that UUID. - Don't let afs_statfs return values that go below 0. - Don't use running fileserver probe state to make server selection and address selection decisions on. Only make decisions on final state as the running state is cleared at the start of probing" Acked-by: Al Viro (fs/inode.c part) * tag 'afs-next-20200604' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: (27 commits) afs: Adjust the fileserver rotation algorithm to reprobe/retry more quickly afs: Show more a bit more server state in /proc/net/afs/servers afs: Don't use probe running state to make decisions outside probe code afs: Fix afs_statfs() to not let the values go below zero afs: Fix the by-UUID server tree to allow servers with the same UUID afs: Reorganise volume and server trees to be rooted on the cell afs: Add a tracepoint to track the lifetime of the afs_volume struct afs: Detect cell aliases 3 - YFS Cells with a canonical cell name op afs: Detect cell aliases 2 - Cells with no root volumes afs: Detect cell aliases 1 - Cells with root volumes afs: Implement client support for the YFSVL.GetCellName RPC op afs: Retain more of the VLDB record for alias detection afs: Fix handling of CB.ProbeUuid cache manager op afs: Don't get epoch from a server because it may be ambiguous afs: Build an abstraction around an "operation" concept afs: Rename struct afs_fs_cursor to afs_operation afs: Remove the error argument from afs_protocol_error() afs: Set error flag rather than return error from file status decode afs: Make callback processing more efficient. afs: Show more information in /proc/net/afs/servers ... commit 0b166a57e6222666292a481b742af92b50c3ba50 Merge: b25c6644bfd3 6b8ed62008a4 Author: Linus Torvalds Date: Fri Jun 5 16:19:28 2020 -0700 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "A lot of bug fixes and cleanups for ext4, including: - Fix performance problems found in dioread_nolock now that it is the default, caused by transaction leaks. - Clean up fiemap handling in ext4 - Clean up and refactor multiple block allocator (mballoc) code - Fix a problem with mballoc with a smaller file systems running out of blocks because they couldn't properly use blocks that had been reserved by inode preallocation. - Fixed a race in ext4_sync_parent() versus rename() - Simplify the error handling in the extent manipulation code - Make sure all metadata I/O errors are felected to ext4_ext_dirty()'s and ext4_make_inode_dirty()'s callers. - Avoid passing an error pointer to brelse in ext4_xattr_set() - Fix race which could result to freeing an inode on the dirty last in data=journal mode. - Fix refcount handling if ext4_iget() fails - Fix a crash in generic/019 caused by a corrupted extent node" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (58 commits) ext4: avoid unnecessary transaction starts during writeback ext4: don't block for O_DIRECT if IOCB_NOWAIT is set ext4: remove the access_ok() check in ext4_ioctl_get_es_cache fs: remove the access_ok() check in ioctl_fiemap fs: handle FIEMAP_FLAG_SYNC in fiemap_prep fs: move fiemap range validation into the file systems instances iomap: fix the iomap_fiemap prototype fs: move the fiemap definitions out of fs.h fs: mark __generic_block_fiemap static ext4: remove the call to fiemap_check_flags in ext4_fiemap ext4: split _ext4_fiemap ext4: fix fiemap size checks for bitmap files ext4: fix EXT4_MAX_LOGICAL_BLOCK macro add comment for ext4_dir_entry_2 file_type member jbd2: avoid leaking transaction credits when unreserving handle ext4: drop ext4_journal_free_reserved() ext4: mballoc: use lock for checking free blocks while retrying ext4: mballoc: refactor ext4_mb_good_group() ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling ext4: mballoc: refactor ext4_mb_discard_preallocations() ... commit 152204dbdcee6df9406f87c81f9591aeaf1ba55b Author: Andy Shevchenko Date: Sat May 30 19:40:30 2020 +0300 power: supply: cw2015: Attach OF ID table to the driver It appears that OF ID table was hanging around without being attached to the driver. Attach it properly. Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver") Reported-by: kbuild test robot Signed-off-by: Andy Shevchenko Acked-By: Tobias Schramm Tested-By: Tobias Schramm Signed-off-by: Sebastian Reichel commit 5a1c9565c07b981449d8432cab2927cbeca73476 Author: Luca Ceresoli Date: Wed Jun 3 18:21:18 2020 +0200 power: reset: gpio-poweroff: add missing '\n' in dev_err() dev_err() needs a terminating newline. Signed-off-by: Luca Ceresoli Signed-off-by: Sebastian Reichel commit b25c6644bfd3affd7d0127ce95c5c96c155a7515 Merge: 818dbde78e0f 64611a15ca9d Author: Linus Torvalds Date: Fri Jun 5 15:45:03 2020 -0700 Merge tag 'for-5.8/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - The largest change for this cycle is the DM zoned target's metadata version 2 feature that adds support for pairing regular block devices with a zoned device to ease the performance impact associated with finite random zones of zoned device. The changes came in three batches: the first prepared for and then added the ability to pair a single regular block device, the second was a batch of fixes to improve zoned's reclaim heuristic, and the third removed the limitation of only adding a single additional regular block device to allow many devices. Testing has shown linear scaling as more devices are added. - Add new emulated block size (ebs) target that emulates a smaller logical_block_size than a block device supports The primary use-case is to emulate "512e" devices that have 512 byte logical_block_size and 4KB physical_block_size. This is useful to some legacy applications that otherwise wouldn't be able to be used on 4K devices because they depend on issuing IO in 512 byte granularity. - Add discard interfaces to DM bufio. First consumer of the interface is the dm-ebs target that makes heavy use of dm-bufio. - Fix DM crypt's block queue_limits stacking to not truncate logic_block_size. - Add Documentation for DM integrity's status line. - Switch DMDEBUG from a compile time config option to instead use dynamic debug via pr_debug. - Fix DM multipath target's hueristic for how it manages "queue_if_no_path" state internally. DM multipath now avoids disabling "queue_if_no_path" unless it is actually needed (e.g. in response to configure timeout or explicit "fail_if_no_path" message). This fixes reports of spurious -EIO being reported back to userspace application during fault tolerance testing with an NVMe backend. Added various dynamic DMDEBUG messages to assist with debugging queue_if_no_path in the future. - Add a new DM multipath "Historical Service Time" Path Selector. - Fix DM multipath's dm_blk_ioctl() to switch paths on IO error. - Improve DM writecache target performance by using explicit cache flushing for target's single-threaded usecase and a small cleanup to remove unnecessary test in persistent_memory_claim. - Other small cleanups in DM core, dm-persistent-data, and DM integrity. * tag 'for-5.8/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (62 commits) dm crypt: avoid truncating the logical block size dm mpath: add DM device name to Failing/Reinstating path log messages dm mpath: enhance queue_if_no_path debugging dm mpath: restrict queue_if_no_path state machine dm mpath: simplify __must_push_back dm zoned: check superblock location dm zoned: prefer full zones for reclaim dm zoned: select reclaim zone based on device index dm zoned: allocate zone by device index dm zoned: support arbitrary number of devices dm zoned: move random and sequential zones into struct dmz_dev dm zoned: per-device reclaim dm zoned: add metadata pointer to struct dmz_dev dm zoned: add device pointer to struct dm_zone dm zoned: allocate temporary superblock for tertiary devices dm zoned: convert to xarray dm zoned: add a 'reserved' zone flag dm zoned: improve logging messages for reclaim dm zoned: avoid unnecessary device recalulation for secondary superblock dm zoned: add debugging message for reading superblocks ... commit 4601e24a6fb819d38d1156d0f690cbe6a42c6d76 Author: Bruno Thomsen Date: Thu Jun 4 18:26:02 2020 +0200 rtc: pcf2127: watchdog: handle nowayout feature Driver does not use module parameter for nowayout, so it need to statically initialize status variable of the watchdog_device based on CONFIG_WATCHDOG_NOWAYOUT. Signed-off-by: Bruno Thomsen Signed-off-by: Alexandre Belloni Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20200604162602.76524-1-bruno.thomsen@gmail.com commit 3a8ce46ce15accad53b39837735c12d886964211 Author: Ran Wang Date: Mon Jun 1 15:19:14 2020 +0800 rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake Use dev_pm_set_wake_irq() instead of flag IRQF_NO_SUSPEND to enable wakeup system feature for both freeze(s2idle) and mem(deep). Signed-off-by: Ran Wang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20200601071914.36444-1-ran.wang_1@nxp.com commit 6e429f6b8c6b8f40874c50c1e8485783dd0f97a8 Author: Kevin P. Fleming Date: Sat May 30 08:29:56 2020 -0400 rtc: abx80x: Provide debug feedback for invalid dt properties When the user provides an invalid value for tc-diode or tc-resistor generate a debug message instead of silently ignoring it. Signed-off-by: Kevin P. Fleming Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20200530122956.360689-1-kevin+linux@km6g.us commit 818dbde78e0f4f11c9f804c36913a7ccfc2e87ad Merge: 242b23319809 22617e216331 Author: Linus Torvalds Date: Fri Jun 5 15:11:50 2020 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: :This series consists of the usual driver updates (qla2xxx, ufs, zfcp, target, scsi_debug, lpfc, qedi, qedf, hisi_sas, mpt3sas) plus a host of other minor updates. There are no major core changes in this series apart from a refactoring in scsi_lib.c" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (207 commits) scsi: ufs: ti-j721e-ufs: Fix unwinding of pm_runtime changes scsi: cxgb3i: Fix some leaks in init_act_open() scsi: ibmvscsi: Make some functions static scsi: iscsi: Fix deadlock on recovery path during GFP_IO reclaim scsi: ufs: Fix WriteBooster flush during runtime suspend scsi: ufs: Fix index of attributes query for WriteBooster feature scsi: ufs: Allow WriteBooster on UFS 2.2 devices scsi: ufs: Remove unnecessary memset for dev_info scsi: ufs-qcom: Fix scheduling while atomic issue scsi: mpt3sas: Fix reply queue count in non RDPQ mode scsi: lpfc: Fix lpfc_nodelist leak when processing unsolicited event scsi: target: tcmu: Fix a use after free in tcmu_check_expired_queue_cmd() scsi: vhost: Notify TCM about the maximum sg entries supported per command scsi: qla2xxx: Remove return value from qla_nvme_ls() scsi: qla2xxx: Remove an unused function scsi: iscsi: Register sysfs for iscsi workqueue scsi: scsi_debug: Parser tables and code interaction scsi: core: Refactor scsi_mq_setup_tags function scsi: core: Fix incorrect usage of shost_for_each_device scsi: qla2xxx: Fix endianness annotations in source files ... commit 242b23319809e05170b3cc0d44d3b4bd202bb073 Merge: 3f7e82379fc9 fba97dc7fc76 Author: Linus Torvalds Date: Fri Jun 5 14:05:57 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "A more active cycle than most of the recent past, with a few large, long discussed works this time. The RNBD block driver has been posted for nearly two years now, and flowing through RDMA due to it also introducing a new ULP. The removal of FMR has been a recurring discussion theme for a long time. And the usual smattering of features and bug fixes. Summary: - Various small driver bugs fixes in rxe, mlx5, hfi1, and efa - Continuing driver cleanups in bnxt_re, hns - Big cleanup of mlx5 QP creation flows - More consistent use of src port and flow label when LAG is used and a mlx5 implementation - Additional set of cleanups for IB CM - 'RNBD' network block driver and target. This is a network block RDMA device specific to ionos's cloud environment. It brings strong multipath and resiliency capabilities. - Accelerated IPoIB for HFI1 - QP/WQ/SRQ ioctl migration for uverbs, and support for multiple async fds - Support for exchanging the new IBTA defiend ECE data during RDMA CM exchanges - Removal of the very old and insecure FMR interface from all ULPs and drivers. FRWR should be preferred for at least a decade now" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (247 commits) RDMA/cm: Spurious WARNING triggered in cm_destroy_id() RDMA/mlx5: Return ECE DC support RDMA/mlx5: Don't rely on FW to set zeros in ECE response RDMA/mlx5: Return an error if copy_to_user fails IB/hfi1: Use free_netdev() in hfi1_netdev_free() RDMA/hns: Uninitialized variable in modify_qp_init_to_rtr() RDMA/core: Move and rename trace_cm_id_create() IB/hfi1: Fix hfi1_netdev_rx_init() error handling RDMA: Remove 'max_map_per_fmr' RDMA: Remove 'max_fmr' RDMA/core: Remove FMR device ops RDMA/rdmavt: Remove FMR memory registration RDMA/mthca: Remove FMR support for memory registration RDMA/mlx4: Remove FMR support for memory registration RDMA/i40iw: Remove FMR leftovers RDMA/bnxt_re: Remove FMR leftovers RDMA/mlx5: Remove FMR leftovers RDMA/core: Remove FMR pool API RDMA/rds: Remove FMR support for memory registration RDMA/srp: Remove support for FMR memory registration ... commit 3f7e82379fc91102d82ed89822bd4242c83e40d5 Merge: 1f2dc7f5b6c1 74910e15ab25 Author: Linus Torvalds Date: Fri Jun 5 14:00:30 2020 -0700 Merge tag 'gpio-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v5.8 kernel cycle. Core changes: - A new GPIO aggregator driver has been merged: this can join a few select GPIO lines into a new aggregated GPIO chip. This can be used for security: a process can be granted access to only these lines, for example for industrial control. Another way to use this is to reexpose certain select lines to a virtual machine or container. - Warn if the gpio-line-names is too long in he DT parser core. - GPIO lines can now be looked up by line name in addition to being looked up by offset. New drivers: - A new generic regmap GPIO driver has been merged. Too many regmap drivers are starting to look like each other so we need to create some common ground and try to move drivers over to using that. - The F7188X driver now supports F81865. Driver improvements: - Large improvements to the PCA953x expander, get multiple lines and several cleanups. - Large improvements to the DesignWare DWAPB driver, and Sergey Semin has volunteered to maintain it. - PL061 can now be built as a module, this is part of a bigger effort to make the ARM platforms more modular" * tag 'gpio-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (77 commits) gpio: pca953x: Drop unneeded ACPI_PTR() MAINTAINERS: Add gpio regmap section gpio: add a reusable generic gpio_chip using regmap gpiolib: Introduce gpiochip_irqchip_add_domain() gpio: gpiolib: Allow GPIO IRQs to lazy disable gpiolib: Separate GPIO_GET_LINEINFO_WATCH_IOCTL conditional gpio: rcar: Fix runtime PM imbalance on error gpio: pca935x: Allow IRQ support for driver built as a module gpio: pxa: Add COMPILE_TEST support dt-bindings: gpio: Add renesas,em-gio bindings MAINTAINERS: Fix file name for DesignWare GPIO DT schema gpio: dwapb: Remove unneeded has_irq member in struct dwapb_port_property gpio: dwapb: Don't use IRQ 0 as valid Linux interrupt gpio: dwapb: avoid error message for optional IRQ gpio: dwapb: Call acpi_gpiochip_free_interrupts() on GPIO chip de-registration gpio: max730x: bring gpiochip_add_data after port config MAINTAINERS: Add GPIO Aggregator section docs: gpio: Add GPIO Aggregator documentation gpio: Add GPIO Aggregator gpiolib: Add support for GPIO lookup by line name ... commit 1f2dc7f5b6c1fffdb24e776b9d3529bd9414aa2c Merge: 5a36f0f3f518 2a556ce779e3 Author: Linus Torvalds Date: Fri Jun 5 13:58:04 2020 -0700 Merge tag 'for-linus-5.8-1' of git://github.com/cminyard/linux-ipmi Pull IPMI updates from Corey Minyard: "A few small fixes for things, nothing earth shattering" * tag 'for-linus-5.8-1' of git://github.com/cminyard/linux-ipmi: ipmi:ssif: Remove dynamic platform device handing Try to load acpi_ipmi when an SSIF ACPI IPMI interface is added ipmi_si: Load acpi_ipmi when ACPI IPMI interface added ipmi:bt-bmc: Fix error handling and status check ipmi: Replace guid_copy() with import_guid() where it makes sense ipmi: use vzalloc instead of kmalloc for user creation ipmi:bt-bmc: Fix some format issue of the code ipmi:bt-bmc: Avoid unnecessary check commit 5a36f0f3f518c60ccddf052e6c48862f357d126f Merge: ac7b34218a00 4f085ca2f5a8 Author: Linus Torvalds Date: Fri Jun 5 13:51:49 2020 -0700 Merge tag 'vfio-v5.8-rc1' of git://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Block accesses to disabled MMIO space (Alex Williamson) - VFIO device migration API (Kirti Wankhede) - type1 IOMMU dirty bitmap API and implementation (Kirti Wankhede) - PCI NULL capability masking (Alex Williamson) - Memory leak fixes (Qian Cai) - Reference leak fix (Qiushi Wu) * tag 'vfio-v5.8-rc1' of git://github.com/awilliam/linux-vfio: vfio iommu: typecast corrections vfio iommu: Use shift operation for 64-bit integer division vfio/mdev: Fix reference count leak in add_mdev_supported_type vfio: Selective dirty page tracking if IOMMU backed device pins pages vfio iommu: Add migration capability to report supported features vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap vfio iommu: Implementation of ioctl for dirty pages tracking vfio iommu: Add ioctl definition for dirty pages tracking vfio iommu: Cache pgsize_bitmap in struct vfio_iommu vfio iommu: Remove atomicity of ref_count of pinned pages vfio: UAPI for migration interface for device state vfio/pci: fix memory leaks of eventfd ctx vfio/pci: fix memory leaks in alloc_perm_bits() vfio-pci: Mask cap zero vfio-pci: Invalidate mmaps and block MMIO access on disabled memory vfio-pci: Fault mmaps to enable vma tracking vfio/type1: Support faulting PFNMAP vmas commit ac7b34218a0021bafd1d4c11c54217b930f516b0 Merge: 7ae77150d94d 6e0d6ac5f3d9 Author: Linus Torvalds Date: Fri Jun 5 13:45:21 2020 -0700 Merge tag 'core_core_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull READ_IMPLIES_EXEC changes from Borislav Petkov: "Split the old READ_IMPLIES_EXEC workaround from executable PT_GNU_STACK now that toolchains long support PT_GNU_STACK marking and there's no need anymore to force modern programs into having all its user mappings executable instead of only the stack and the PROT_EXEC ones. Disable that automatic READ_IMPLIES_EXEC forcing on x86-64 and arm64. Add tables documenting how READ_IMPLIES_EXEC is handled on x86-64, arm and arm64. By Kees Cook" * tag 'core_core_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: arm64/elf: Disable automatic READ_IMPLIES_EXEC for 64-bit address spaces arm32/64/elf: Split READ_IMPLIES_EXEC from executable PT_GNU_STACK arm32/64/elf: Add tables to document READ_IMPLIES_EXEC x86/elf: Disable automatic READ_IMPLIES_EXEC on 64-bit x86/elf: Split READ_IMPLIES_EXEC from executable PT_GNU_STACK x86/elf: Add table to document READ_IMPLIES_EXEC commit 7f89cc07d22a4152f3c649a89aa8fe240effd24a Author: Denis Efremov Date: Fri Jun 5 22:11:44 2020 +0300 cxgb4: Use kfree() instead kvfree() where appropriate Use kfree(buf) in blocked_fl_read() because the memory is allocated with kzalloc(). Use kfree(t) in blocked_fl_write() because the memory is allocated with kcalloc(). Signed-off-by: Denis Efremov Signed-off-by: David S. Miller commit 6da95b52b8ea4944ed1e596ee6db176ee83ddbeb Author: Alok Prasad Date: Fri Jun 5 16:30:34 2020 +0000 net: qed: fixes crash while running driver in kdump kernel This fixes a crash introduced by recent is_kdump_kernel() check. The source of the crash is that kdump kernel can be loaded on a system with already created VFs. But for such VFs, it will follow a logic path of PF and eventually crash. Thus, we are partially reverting back previous changes and instead use is_kdump_kernel is a single init point of PF init, where we disable SRIOV explicitly. Fixes: 37d4f8a6b41f ("net: qed: Disable SRIOV functionality inside kdump kernel") Cc: Bhupesh Sharma Signed-off-by: Igor Russkikh Signed-off-by: Alok Prasad Signed-off-by: David S. Miller commit fdb4276aae1100aa13f955eff6c944a8200a15ac Author: Stefano Garzarella Date: Fri Jun 5 17:12:41 2020 +0200 vsock/vmci: make vmci_vsock_transport_cb() static Fix the following gcc-9.3 warning when building with 'make W=1': net/vmw_vsock/vmci_transport.c:2058:6: warning: no previous prototype for ‘vmci_vsock_transport_cb’ [-Wmissing-prototypes] 2058 | void vmci_vsock_transport_cb(bool is_host) | ^~~~~~~~~~~~~~~~~~~~~~~ Fixes: b1bba80a4376 ("vsock/vmci: register vmci_transport only when VMCI guest/host are active") Reported-by: kernel test robot Signed-off-by: Stefano Garzarella Signed-off-by: David S. Miller commit 90c56b3877995d948dc382fe833a1c5eeaaee2ad Author: Kees Cook Date: Fri Jun 5 07:21:22 2020 -0700 net: ethtool: Fix comment mentioning typo in IS_ENABLED() This has no code changes, but it's a typo noticed in other clean-ups, so we might as well fix it. IS_ENABLED() takes full names, and should have the "CONFIG_" prefix. Reported-by: Joe Perches Link: https://lore.kernel.org/lkml/b08611018fdb6d88757c6008a5c02fa0e07b32fb.camel@perches.com Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 49113d5e0c3f3fbf409075e69c2d1e157c387ac5 Author: Antoine Tenart Date: Fri Jun 5 16:00:09 2020 +0200 net: phy: mscc: fix Serdes configuration in vsc8584_config_init When converting the MSCC PHY driver to shared PHY packages, the Serdes configuration in vsc8584_config_init was modified to use 'base_addr' instead of 'base' as the port number. But 'base_addr' isn't equal to 'addr' for all PHYs inside the package, which leads to the Serdes still being enabled on those ports. This patch fixes it. Fixes: deb04e9c0ff2 ("net: phy: mscc: use phy_package_shared") Signed-off-by: Antoine Tenart Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ba3823ca6a052d1aea2c7f7bf8ed6377f5f180e3 Merge: e22437207683 ae602786407f Author: David S. Miller Date: Fri Jun 5 13:15:22 2020 -0700 Merge branch 'Fixes-for-OF_MDIO-flag' Dan Murphy says: ==================== Fixes for OF_MDIO flag There are some residual drivers that check the CONFIG_OF_MDIO flag using the if defs. Using this check does not work when the OF_MDIO is configured as a module. Using the IS_ENABLED macro checks if the flag is declared as built-in or as a module. ==================== Signed-off-by: David S. Miller commit ae602786407fef34e1d66b3c8f278a10ed37197e Author: Dan Murphy Date: Fri Jun 5 09:01:07 2020 -0500 net: mscc: Fix OF_MDIO config check When CONFIG_OF_MDIO is set to be a module the code block is not compiled. Use the IS_ENABLED macro that checks for both built in as well as module. Fixes: 4f58e6dceb0e4 ("net: phy: Cleanup the Edge-Rate feature in Microsemi PHYs.") Signed-off-by: Dan Murphy Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5cd119d9a05f1c1a08778a7305b4ca0f16bc1e20 Author: Dan Murphy Date: Fri Jun 5 09:01:06 2020 -0500 net: marvell: Fix OF_MDIO config check When CONFIG_OF_MDIO is set to be a module the code block is not compiled. Use the IS_ENABLED macro that checks for both built in as well as module. Fixes: cf41a51db8985 ("of/phylib: Use device tree properties to initialize Marvell PHYs.") Signed-off-by: Dan Murphy Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 506de00677b84dfc6718cbbd3495b1d90df5d098 Author: Dan Murphy Date: Fri Jun 5 09:01:05 2020 -0500 net: dp83867: Fix OF_MDIO config check When CONFIG_OF_MDIO is set to be a module the code block is not compiled. Use the IS_ENABLED macro that checks for both built in as well as module. Fixes: 2a10154abcb75 ("net: phy: dp83867: Add TI dp83867 phy") Signed-off-by: Dan Murphy Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e9293c982d88b2d859e26ec42b72c06f20235315 Author: Dan Murphy Date: Fri Jun 5 09:01:04 2020 -0500 net: dp83869: Fix OF_MDIO config check When CONFIG_OF_MDIO is set to be a module the code block is not compiled. Use the IS_ENABLED macro that checks for both built in as well as module. Fixes: 01db923e83779 ("net: phy: dp83869: Add TI dp83869 phy") Signed-off-by: Dan Murphy Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e22437207683a9099d5fb3a1b5cc8f5c7b24a583 Author: Alexander Lobakin Date: Fri Jun 5 15:53:24 2020 +0300 net: ethernet: mvneta: fix MVNETA_SKB_HEADROOM alignment Commit ca23cb0bc50f ("mvneta: MVNETA_SKB_HEADROOM set last 3 bits to zero") added headroom alignment check against 8. Hovewer (if we imagine that NET_SKB_PAD or XDP_PACKET_HEADROOM is not aligned to cacheline size), it actually aligns headroom down, while skb/xdp_buff headroom should be *at least* equal to one of the values (depending on XDP prog presence). So, fix the check to align the value up. This satisfies both hardware/driver and network stack requirements. Fixes: ca23cb0bc50f ("mvneta: MVNETA_SKB_HEADROOM set last 3 bits to zero") Signed-off-by: Alexander Lobakin Signed-off-by: David S. Miller commit 178f67b1288b6952117fdc4e5ffbd4c4bd4e4a7f Author: Dan Carpenter Date: Fri Jun 5 14:04:13 2020 +0300 ethtool: linkinfo: remove an unnecessary NULL check This code generates a Smatch warning: net/ethtool/linkinfo.c:143 ethnl_set_linkinfo() warn: variable dereferenced before check 'info' (see line 119) Fortunately, the "info" pointer is never NULL so the check can be removed. Signed-off-by: Dan Carpenter Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit 7ae77150d94d3b535c7b85e6b3647113095e79bf Merge: 084623e468d5 1395375c5927 Author: Linus Torvalds Date: Fri Jun 5 12:39:30 2020 -0700 Merge tag 'powerpc-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Support for userspace to send requests directly to the on-chip GZIP accelerator on Power9. - Rework of our lockless page table walking (__find_linux_pte()) to make it safe against parallel page table manipulations without relying on an IPI for serialisation. - A series of fixes & enhancements to make our machine check handling more robust. - Lots of plumbing to add support for "prefixed" (64-bit) instructions on Power10. - Support for using huge pages for the linear mapping on 8xx (32-bit). - Remove obsolete Xilinx PPC405/PPC440 support, and an associated sound driver. - Removal of some obsolete 40x platforms and associated cruft. - Initial support for booting on Power10. - Lots of other small features, cleanups & fixes. Thanks to: Alexey Kardashevskiy, Alistair Popple, Andrew Donnellan, Andrey Abramov, Aneesh Kumar K.V, Balamuruhan S, Bharata B Rao, Bulent Abali, Cédric Le Goater, Chen Zhou, Christian Zigotzky, Christophe JAILLET, Christophe Leroy, Dmitry Torokhov, Emmanuel Nicolet, Erhard F., Gautham R. Shenoy, Geoff Levand, George Spelvin, Greg Kurz, Gustavo A. R. Silva, Gustavo Walbon, Haren Myneni, Hari Bathini, Joel Stanley, Jordan Niethe, Kajol Jain, Kees Cook, Leonardo Bras, Madhavan Srinivasan., Mahesh Salgaonkar, Markus Elfring, Michael Neuling, Michal Simek, Nathan Chancellor, Nathan Lynch, Naveen N. Rao, Nicholas Piggin, Oliver O'Halloran, Paul Mackerras, Pingfan Liu, Qian Cai, Ram Pai, Raphael Moreira Zinsly, Ravi Bangoria, Sam Bobroff, Sandipan Das, Segher Boessenkool, Stephen Rothwell, Sukadev Bhattiprolu, Tyrel Datwyler, Wolfram Sang, Xiongfeng Wang. * tag 'powerpc-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (299 commits) powerpc/pseries: Make vio and ibmebus initcalls pseries specific cxl: Remove dead Kconfig options powerpc: Add POWER10 architected mode powerpc/dt_cpu_ftrs: Add MMA feature powerpc/dt_cpu_ftrs: Enable Prefixed Instructions powerpc/dt_cpu_ftrs: Advertise support for ISA v3.1 if selected powerpc: Add support for ISA v3.1 powerpc: Add new HWCAP bits powerpc/64s: Don't set FSCR bits in INIT_THREAD powerpc/64s: Save FSCR to init_task.thread.fscr after feature init powerpc/64s: Don't let DT CPU features set FSCR_DSCR powerpc/64s: Don't init FSCR_DSCR in __init_FSCR() powerpc/32s: Fix another build failure with CONFIG_PPC_KUAP_DEBUG powerpc/module_64: Use special stub for _mcount() with -mprofile-kernel powerpc/module_64: Simplify check for -mprofile-kernel ftrace relocations powerpc/module_64: Consolidate ftrace code powerpc/32: Disable KASAN with pages bigger than 16k powerpc/uaccess: Don't set KUEP by default on book3s/32 powerpc/uaccess: Don't set KUAP by default on book3s/32 powerpc/8xx: Reduce time spent in allow_user_access() and friends ... commit 084623e468d535d98f883cc2ccf2c4fdf2108556 Merge: f4dd60a3d4c7 5c3a7db0c7ec Author: Linus Torvalds Date: Fri Jun 5 12:31:16 2020 -0700 Merge tag 'modules-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux Pull module updates from Jessica Yu: - Harden CONFIG_STRICT_MODULE_RWX by rejecting any module that has SHF_WRITE|SHF_EXECINSTR sections - Remove and clean up nested #ifdefs, as it makes code hard to read * tag 'modules-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux: module: Harden STRICT_MODULE_RWX module: break nested ARCH_HAS_STRICT_MODULE_RWX and STRICT_MODULE_RWX #ifdefs commit 300e549b6e53025ea69550f009451f7a13bfc3eb Merge: 83d060ca8d90 9e8990dea926 Author: Andreas Gruenbacher Date: Fri Jun 5 21:25:36 2020 +0200 Merge branch 'gfs2-iopen' into for-next commit 83d060ca8d90fa1e3feac227f995c013100862d3 Author: Bob Peterson Date: Thu Jun 4 14:28:58 2020 -0500 gfs2: fix use-after-free on transaction ail lists Before this patch, transactions could be merged into the system transaction by function gfs2_merge_trans(), but the transaction ail lists were never merged. Because the ail flushing mechanism can run separately, bd elements can be attached to the transaction's buffer list during the transaction (trans_add_meta, etc) but quickly moved to its ail lists. Later, in function gfs2_trans_end, the transaction can be freed (by gfs2_trans_end) while it still has bd elements queued to its ail lists, which can cause it to either lose track of the bd elements altogether (memory leak) or worse, reference the bd elements after the parent transaction has been freed. Although I've not seen any serious consequences, the problem becomes apparent with the previous patch's addition of: gfs2_assert_warn(sdp, list_empty(&tr->tr_ail1_list)); to function gfs2_trans_free(). This patch adds logic into gfs2_merge_trans() to move the merged transaction's ail lists to the sdp transaction. This prevents the use-after-free. To do this properly, we need to hold the ail lock, so we pass sdp into the function instead of the transaction itself. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit b839dadae8721eaf7245fcef3d67d82b95d00c77 Author: Bob Peterson Date: Wed Apr 17 12:04:27 2019 -0600 gfs2: new slab for transactions This patch adds a new slab for gfs2 transactions. That allows us to reduce kernel memory fragmentation, have better organization of data for analysis of vmcore dumps. A new centralized function is added to free the slab objects, and it exposes use-after-free by giving warnings if a transaction is freed while it still has bd elements attached to its buffers or ail lists. We make sure to initialize those transaction ail lists so we can check their integrity when freeing. At a later time, we should add a slab initialization function to make it more efficient, but for this initial patch I wanted to minimize the impact. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit cbcc89b630447ec7836aa2b9242d9bb1725f5a61 Author: Bob Peterson Date: Fri Jun 5 14:12:34 2020 -0500 gfs2: initialize transaction tr_ailX_lists earlier Since transactions may be freed shortly after they're created, before a log_flush occurs, we need to initialize their ail1 and ail2 lists earlier. Before this patch, the ail1 list was initialized in gfs2_log_flush(). This moves the initialization to the point when the transaction is first created. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 64611a15ca9da91ff532982429c44686f4593b5f Author: Eric Biggers Date: Thu Jun 4 12:01:26 2020 -0700 dm crypt: avoid truncating the logical block size queue_limits::logical_block_size got changed from unsigned short to unsigned int, but it was forgotten to update crypt_io_hints() to use the new type. Fix it. Fixes: ad6bf88a6c19 ("block: fix an integer overflow in logical block size") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 04867370ec40b708bd335df641182ddab0c59685 Author: Mike Snitzer Date: Thu Jun 4 10:44:34 2020 -0400 dm mpath: add DM device name to Failing/Reinstating path log messages When there are many DM multipath devices it really helps to have additional context for which DM device a failed or reinstated path is part of. Signed-off-by: Mike Snitzer commit 4c3f48380fedbd714fc95958f503c1b5adf3ee6b Author: Mike Snitzer Date: Fri May 29 15:59:13 2020 -0400 dm mpath: enhance queue_if_no_path debugging Add more DMDEBUG that shows arguments passed and caller, and another that shows state of related flags at end of queue_if_no_path(). Also add queue_if_no_path DMDEBUG to multipath_resume(). Signed-off-by: Mike Snitzer commit 553ec94cb4b4937b48f81e27de33f71325d1a227 Author: Mike Snitzer Date: Wed May 27 16:32:51 2020 -0400 dm mpath: restrict queue_if_no_path state machine Do not allow saving disabled queue_if_no_path if already saved as enabled; implies multiple suspends (which shouldn't ever happen). Log if this unlikely scenario is ever triggered. Also, only write MPATHF_SAVED_QUEUE_IF_NO_PATH during presuspend or if "fail_if_no_path" message. MPATHF_SAVED_QUEUE_IF_NO_PATH is no longer always modified, e.g.: even if queue_if_no_path()'s save_old_value argument wasn't set. This just implies a bit tighter control over the management of MPATHF_SAVED_QUEUE_IF_NO_PATH. Side-effect is multipath_resume() doesn't reset MPATHF_QUEUE_IF_NO_PATH unless MPATHF_SAVED_QUEUE_IF_NO_PATH was set (during presuspend); and at that time the MPATHF_SAVED_QUEUE_IF_NO_PATH bit gets cleared. So MPATHF_SAVED_QUEUE_IF_NO_PATH's use is much more narrow in scope. Last, but not least, do _not_ disable queue_if_no_path during noflush suspend. There is no need/benefit to saving off queue_if_no_path via MPATHF_SAVED_QUEUE_IF_NO_PATH and clearing MPATHF_QUEUE_IF_NO_PATH for noflush suspend -- by avoiding this needless queue_if_no_path flag churn there is less potential for MPATHF_QUEUE_IF_NO_PATH to get lost. Which avoids potential for IOs to be errored back up to userspace during DM multipath's handling of path failures. That said, this last change papers over a reported issue concerning request-based dm-multipath's interaction with blk-mq, relative to suspend and resume: multipath_endio is being called _before_ multipath_resume. This should never happen if DM suspend's blk_mq_quiesce_queue() + dm_wait_for_completion() is genuinely waiting for all inflight blk-mq requests to complete. Similarly: drivers/md/dm.c:__dm_resume() clearly calls dm_table_resume_targets() _before_ dm_start_queue()'s blk_mq_unquiesce_queue() is called. If the queue isn't even restarted until after multipath_resume(); the BIG question that still needs answering is: how can multipath_end_io beat multipath_resume in a race!? Signed-off-by: Mike Snitzer commit a862e4e2154289fc12aa9e70f33614d9c70f3be4 Author: Mike Snitzer Date: Tue May 26 16:06:56 2020 -0400 dm mpath: simplify __must_push_back Remove micro-optimization that infers device is between presuspend and resume (was done purely to avoid call to dm_noflush_suspending, which isn't expensive anyway). Remove flags argument since they are no longer checked. And remove must_push_back_bio() since it was simply a call to __must_push_back(). Signed-off-by: Mike Snitzer commit 27d49ac1dd751897506ba51df7226fc0ce7ef681 Author: Hannes Reinecke Date: Tue Jun 2 13:09:56 2020 +0200 dm zoned: check superblock location When specifying several devices the superblock location must be checked to ensure the devices are specified in the correct order. Signed-off-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit 2094045fe5b5dda98c4ec6cb1ac7b12ba4382856 Author: Hannes Reinecke Date: Tue Jun 2 13:09:55 2020 +0200 dm zoned: prefer full zones for reclaim Prefer full zones when selecting the next zone for reclaim. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 69875d443bc3bb1b2e1f77fe3da5ad5c8c729aa2 Author: Hannes Reinecke Date: Tue Jun 2 13:09:54 2020 +0200 dm zoned: select reclaim zone based on device index per-device reclaim should select zones on that device only. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 22c1ef66c4cbb82baf81a28abedfe8ad20ad9126 Author: Hannes Reinecke Date: Tue Jun 2 13:09:53 2020 +0200 dm zoned: allocate zone by device index When allocating a zone, pass in an indicator on which device the zone should be allocated; this increases performance for a multi-device setup because reclaim will now allocate zones on the device for which reclaim is running. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 4dba12881f882b629774796bb8655f5b1415d803 Author: Hannes Reinecke Date: Tue Jun 2 13:09:52 2020 +0200 dm zoned: support arbitrary number of devices Remove the hard-coded limit of two devices and support an unlimited number of additional zoned devices. Signed-off-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit bd82fdabf162fec1404c4e22988b178c4f3dd23b Author: Hannes Reinecke Date: Tue Jun 2 13:09:51 2020 +0200 dm zoned: move random and sequential zones into struct dmz_dev Random and sequential zones should be part of the respective device structure to make arbitration between devices possible. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit f97809aec58995a87a9a30cb45c9a6148377df64 Author: Hannes Reinecke Date: Tue Jun 2 13:09:50 2020 +0200 dm zoned: per-device reclaim Instead of having one reclaim workqueue for the entire set we should be allocating a reclaim workqueue per device; doing so will reduce contention and should boost performance for a multi-device setup. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 18979819b57ecbc598a8e27d925ab4bb9e145cf0 Author: Hannes Reinecke Date: Tue Jun 2 13:09:49 2020 +0200 dm zoned: add metadata pointer to struct dmz_dev Add a metadata pointer within struct dmz_dev and use it as argument for blkdev_report_zones() instead of the metadata itself. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 8f22272af7a72763fe9f6b710cdcc380fed80f75 Author: Hannes Reinecke Date: Tue Jun 2 13:09:48 2020 +0200 dm zoned: add device pointer to struct dm_zone Add a pointer, to the containing device, within struct dm_zone and kill dmz_zone_to_dev(). Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 5d2c74f3ddc010b5812e556715f7605201eff101 Author: Hannes Reinecke Date: Tue Jun 2 13:09:47 2020 +0200 dm zoned: allocate temporary superblock for tertiary devices Checking the tertiary superblock just consists of validating UUIDs, crcs, and the generation number; it doesn't have contents which would be required during the actual operation. So allocate a temporary superblock when checking tertiary devices to avoid having to store it together with the 'real' superblocks. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit a92fbc446d1a93950b7e25bec6ad75dd26f01ba8 Author: Hannes Reinecke Date: Tue Jun 2 13:09:46 2020 +0200 dm zoned: convert to xarray The zones array is getting really large, and large arrays tend to wreak havoc with the CPU caches. So convert it to xarray to become more cache friendly. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Colin Ian King # fix leak in dmz_insert Signed-off-by: Mike Snitzer commit aec67b4ffa4bea4a02063d9a0f379e5795d6f5dc Author: Hannes Reinecke Date: Tue Jun 2 13:09:45 2020 +0200 dm zoned: add a 'reserved' zone flag Instead of counting the number of reserved zones in dmz_free_zone(), mark the zone as 'reserved' during allocation and simplify dmz_free_zone(). Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit c3ff479dde9f77d044c164f3ff5443bbe2b6c72d Author: Hannes Reinecke Date: Tue Jun 2 13:09:44 2020 +0200 dm zoned: improve logging messages for reclaim Instead of just reporting the errno, add some more verbose debugging message in the reclaim path. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 1565929b870fe166c5a57a85d6cb5a2bfe1e6c84 Author: Hannes Reinecke Date: Tue Jun 2 13:09:43 2020 +0200 dm zoned: avoid unnecessary device recalulation for secondary superblock The secondary superblock must reside on the same device as the primary superblock, so there is no need to re-calculate the device. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 35d0c96e422a484bbc5d4921fa20dcc880bfba2c Author: Hannes Reinecke Date: Tue Jun 2 13:09:42 2020 +0200 dm zoned: add debugging message for reading superblocks Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 334b4fc17275667b38ebfd719714dab0edb83c6a Author: Mikulas Patocka Date: Tue Jun 2 15:34:41 2020 +0200 dm ebs: use dm_bufio_forget_buffers Use dm_bufio_forget_buffers instead of a block-by-block loop that calls dm_bufio_forget. dm_bufio_forget_buffers is faster than the loop because it searches for used buffers using rb-tree. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 33a180623b6c35f2727daecb63763955af3af1df Author: Mikulas Patocka Date: Tue Jun 2 15:34:40 2020 +0200 dm bufio: introduce forget_buffer_locked Introduce a function forget_buffer_locked that forgets a range of buffers. It is more efficient than calling forget_buffer in a loop. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 88f878e58879acfdad03e08776c9802f9cd6f26a Author: Mikulas Patocka Date: Tue Jun 2 15:34:39 2020 +0200 dm bufio: clean up rbtree block ordering dm-bufio uses unnatural ordering in the rb-tree - blocks with smaller numbers were put to the right node and blocks with bigger numbers were put to the left node. Reverse that logic so that it's natural. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 40e9c5ac4e3d670799a247944c330e5126935a7c Author: Mikulas Patocka Date: Tue Jun 2 09:48:10 2020 -0400 dm integrity: add status line documentation Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 9e8990dea9266af68a668b1503dc6f55c56f1bb6 Author: Andreas Gruenbacher Date: Fri Jan 17 10:53:23 2020 +0100 gfs2: Smarter iopen glock waiting When trying to upgrade the iopen glock from a shared to an exclusive lock in gfs2_evict_inode, abort the wait if there is contention on the corresponding inode glock: in that case, the inode must still be in active use on another node, and we're not guaranteed to get the iopen glock anytime soon. To make this work even better, when we notice contention on the iopen glock and we can't evict the corresponsing inode and release the iopen glock immediately, poke the inode glock. The other node(s) trying to acquire the lock can then abort instead of timing out. Thanks to Heinz Mauelshagen for pointing out a locking bug in a previous version of this patch. Signed-off-by: Andreas Gruenbacher commit 35b6f8fbcf9b2ebdee0a0f77143a8d203a9616e1 Author: Andreas Gruenbacher Date: Fri Jan 17 13:48:49 2020 +0100 gfs2: Wake up when setting GLF_DEMOTE Wake up the sdp->sd_async_glock_wait wait queue when setting the GLF_DEMOTE flag. Signed-off-by: Andreas Gruenbacher commit b0dcffd8da3339ad0300587ce7030efdf2e914a9 Author: Andreas Gruenbacher Date: Wed Jan 15 09:54:14 2020 +0100 gfs2: Check inode generation number in delete_work_func In delete_work_func, if the iopen glock still has an inode attached, limit the inode lookup to that specific generation number: in the likely case that the inode was deleted on the node on which the inode's link count dropped to zero, we can skip verifying the on-disk block type and reading in the inode. The same applies if another node that had the inode open managed to delete the inode before us. Signed-off-by: Andreas Gruenbacher commit b66648ad6dcfefd9f02b5408c1381987c090cb13 Author: Andreas Gruenbacher Date: Wed Jan 15 06:21:42 2020 +0100 gfs2: Move inode generation number check into gfs2_inode_lookup Move the inode generation number check from gfs2_lookup_by_inum into gfs2_inode_lookup: gfs2_inode_lookup may be able to decide that an inode with the given inode generation number cannot exist without having to verify the block type or reading the inode from disk. Signed-off-by: Andreas Gruenbacher commit 6bdcadea75768bbd1cd8f6f13011978e1e19a53b Author: Andreas Gruenbacher Date: Wed Jan 15 05:31:38 2020 +0100 gfs2: Minor gfs2_lookup_by_inum cleanup Use a zero no_formal_ino instead of a NULL pointer to indicate that any inode generation number will qualify: a valid inode never has a zero no_formal_ino. Signed-off-by: Andreas Gruenbacher commit 9e73330f298acf544de72436b7bb825ff3aa1a54 Author: Andreas Gruenbacher Date: Tue Jan 14 14:59:08 2020 +0100 gfs2: Try harder to delete inodes locally When an inode's link count drops to zero and the inode is cached on other nodes, the current behavior of gfs2 is to immediately give up and to rely on the other node(s) to delete the inode if there is iopen glock contention. This leads to resource group glock bouncing and the loss of caching. With the previous patches in place, we can fix that by not giving up immediately. When the inode is still open on other nodes, those nodes won't be able to evict the inode and give up the iopen glock. In that case, our lock conversion request will time out. The unlink system call will block for the duration of the iopen lock conversion request. We're also holding the inode glock in EX mode for an extended duration, so other nodes won't be able to make progress on the inode, either. This is worse than what we had before, but we can prevent other nodes from getting stuck by aborting our iopen locking request if there is contention on the inode glock. This will the the subject of a future patch. Signed-off-by: Andreas Gruenbacher commit 8c7b9262a8607636ecd7250f29c7aac17f08901c Author: Andreas Gruenbacher Date: Mon Jan 13 22:16:17 2020 +0100 gfs2: Give up the iopen glock on contention When there's contention on the iopen glock, it means that the link count of the corresponding inode has dropped to zero on a remote node which is now trying to delete the inode. In that case, try to evict the inode so that the iopen glock will be released, which will allow the remote node to do its job. When the inode is still open locally, the inode's reference count won't drop to zero and so we'll keep holding the inode and its iopen glock. The remote node will time out its request to grab the iopen glock, and when the inode is finally closed locally, we'll try to delete it ourself. Signed-off-by: Andreas Gruenbacher commit a0e3cc65fa29f497cc97a069c318532c2a48d148 Author: Andreas Gruenbacher Date: Thu Jan 16 20:12:26 2020 +0100 gfs2: Turn gl_delete into a delayed work This requires flushing delayed work items in gfs2_make_fs_ro (which is called before unmounting a filesystem). When inodes are deleted and then recreated, pending gl_delete work items would have no effect because the inode generations will have changed, so we can cancel any pending gl_delete works before reusing iopen glocks. Signed-off-by: Andreas Gruenbacher commit f286d627ef026a4d04b41ae5917d58ddf243c3c5 Author: Andreas Gruenbacher Date: Mon Jan 13 21:21:49 2020 +0100 gfs2: Keep track of deleted inode generations in LVBs When deleting an inode, keep track of the generation of the deleted inode in the inode glock Lock Value Block (LVB). When trying to delete an inode remotely, check the last-known inode generation against the deleted inode generation to skip duplicate remote deletes. This avoids taking the resource group glock in order to verify the block type. Signed-off-by: Andreas Gruenbacher commit 15f2547b4157a1e7e4d75bec5df097c1436f6cbd Author: Bob Peterson Date: Wed Jan 15 12:47:46 2020 -0600 gfs2: Allow ASPACE glocks to also have an lvb Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit f4dd60a3d4c7656dcaa0ba2afb503528c86f913f Merge: 435faf5c218a bd1de2a7aace Author: Linus Torvalds Date: Fri Jun 5 11:18:53 2020 -0700 Merge tag 'x86-mm-2020-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm updates from Ingo Molnar: "Misc changes: - Unexport various PAT primitives - Unexport per-CPU tlbstate and uninline TLB helpers" * tag 'x86-mm-2020-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) x86/tlb/uv: Add a forward declaration for struct flush_tlb_info x86/cpu: Export native_write_cr4() only when CONFIG_LKTDM=m x86/tlb: Restrict access to tlbstate xen/privcmd: Remove unneeded asm/tlb.h include x86/tlb: Move PCID helpers where they are used x86/tlb: Uninline nmi_uaccess_okay() x86/tlb: Move cr4_set_bits_and_update_boot() to the usage site x86/tlb: Move paravirt_tlb_remove_table() to the usage site x86/tlb: Move __flush_tlb_all() out of line x86/tlb: Move flush_tlb_others() out of line x86/tlb: Move __flush_tlb_one_kernel() out of line x86/tlb: Move __flush_tlb_one_user() out of line x86/tlb: Move __flush_tlb_global() out of line x86/tlb: Move __flush_tlb() out of line x86/alternatives: Move temporary_mm helpers into C x86/cr4: Sanitize CR4.PCE update x86/cpu: Uninline CR4 accessors x86/tlb: Uninline __get_current_cr3_fast() x86/mm: Use pgprotval_t in protval_4k_2_large() and protval_large_2_4k() x86/mm: Unexport __cachemode2pte_tbl ... commit d5dc3d9677394d4fb4dca61856491df5a37db31a Author: Bob Peterson Date: Fri May 22 14:03:21 2020 -0500 gfs2: instrumentation wrt log_flush stuck This adds checks for gfs2_log_flush being stuck, similarly to the check in gfs2_ail1_flush. To faciliate this and make the strings easy to grep we move the ail1 emptying to its own function, empty_ail1_list. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 91231e525bb654731f60d6699472e1e98379bb01 Author: Dan Carpenter Date: Fri Jun 5 14:01:34 2020 +0300 ALSA: emu10k1: delete an unnecessary condition The "val" variable is an unsigned int so it's always <= UINT_MAX. This check is always true so it can be removed. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200605110134.GC978434@mwanda Signed-off-by: Takashi Iwai commit 34d2618d3318bf4832a13ef71c96833dc996f7d5 Author: Paolo Bonzini Date: Fri May 15 12:18:14 2020 -0400 KVM: x86: emulate reserved nops from 0f/18 to 0f/1f Instructions starting with 0f18 up to 0f1f are reserved nops, except those that were assigned to MPX. These include the endbr markers used by CET. List them correctly in the opcode table. Signed-off-by: Paolo Bonzini commit b80db73dc8be7022adae1b4414a1bebce50fe915 Author: Vitaly Kuznetsov Date: Fri Jun 5 16:20:28 2020 +0200 KVM: selftests: Fix build with "make ARCH=x86_64" Marcelo reports that kvm selftests fail to build with "make ARCH=x86_64": gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 -fno-stack-protector -fno-PIE -I../../../../tools/include -I../../../../tools/arch/x86_64/include -I../../../../usr/include/ -Iinclude -Ilib -Iinclude/x86_64 -I.. -c lib/kvm_util.c -o /var/tmp/20200604202744-bin/lib/kvm_util.o In file included from lib/kvm_util.c:11: include/x86_64/processor.h:14:10: fatal error: asm/msr-index.h: No such file or directory #include ^~~~~~~~~~~~~~~~~ compilation terminated. "make ARCH=x86", however, works. The problem is that arch specific headers for x86_64 live in 'tools/arch/x86/include', not in 'tools/arch/x86_64/include'. Fixes: 66d69e081b52 ("selftests: fix kvm relocatable native/cross builds and installs") Reported-by: Marcelo Bandeira Condotta Signed-off-by: Vitaly Kuznetsov Message-Id: <20200605142028.550068-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit ea4e61c7f46d33fdf17580a925e47cc83570d658 Author: Bob Peterson Date: Sat May 23 08:13:50 2020 -0500 gfs2: introduce new gfs2_glock_assert_withdraw Before this patch, asserts based on glocks did not print the glock with the error. This patch introduces a new macro, gfs2_glock_assert_withdraw which first prints the glock, then takes the assert. This also changes a few glock asserts to the new macro. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 7e901d6e9519db4db0dd30a33ec172dd094cfb11 Author: Bob Peterson Date: Fri May 22 13:57:41 2020 -0500 gfs2: print mapping->nrpages in glock dump for address space glocks This patch makes the glock dumps in debugfs print the number of pages (nrpages) for address space glocks. This will aid in debugging. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 5ac0d62226a07849b1a5233af8c800a19cecab83 Author: David Howells Date: Wed Jun 3 22:21:16 2020 +0100 rxrpc: Fix missing notification Under some circumstances, rxrpc will fail a transmit a packet through the underlying UDP socket (ie. UDP sendmsg returns an error). This may result in a call getting stuck. In the instance being seen, where AFS tries to send a probe to the Volume Location server, tracepoints show the UDP Tx failure (in this case returing error 99 EADDRNOTAVAIL) and then nothing more: afs_make_vl_call: c=0000015d VL.GetCapabilities rxrpc_call: c=0000015d NWc u=1 sp=rxrpc_kernel_begin_call+0x106/0x170 [rxrpc] a=00000000dd89ee8a rxrpc_call: c=0000015d Gus u=2 sp=rxrpc_new_client_call+0x14f/0x580 [rxrpc] a=00000000e20e4b08 rxrpc_call: c=0000015d SEE u=2 sp=rxrpc_activate_one_channel+0x7b/0x1c0 [rxrpc] a=00000000e20e4b08 rxrpc_call: c=0000015d CON u=2 sp=rxrpc_kernel_begin_call+0x106/0x170 [rxrpc] a=00000000e20e4b08 rxrpc_tx_fail: c=0000015d r=1 ret=-99 CallDataNofrag The problem is that if the initial packet fails and the retransmission timer hasn't been started, the call is set to completed and an error is returned from rxrpc_send_data_packet() to rxrpc_queue_packet(). Though rxrpc_instant_resend() is called, this does nothing because the call is marked completed. So rxrpc_notify_socket() isn't called and the error is passed back up to rxrpc_send_data(), rxrpc_kernel_send_data() and thence to afs_make_call() and afs_vl_get_capabilities() where it is simply ignored because it is assumed that the result of a probe will be collected asynchronously. Fileserver probing is similarly affected via afs_fs_get_capabilities(). Fix this by always issuing a notification in __rxrpc_set_call_completion() if it shifts a call to the completed state, even if an error is also returned to the caller through the function return value. Also put in a little bit of optimisation to avoid taking the call state_lock and disabling softirqs if the call is already in the completed state and remove some now redundant rxrpc_notify_socket() calls. Fixes: f5c17aaeb2ae ("rxrpc: Calls should only have one terminal state") Reported-by: Gerry Seidman Signed-off-by: David Howells Reviewed-by: Marc Dionne commit 3067bf8c596d59164f48569a2d362de5b4c42f59 Author: David Howells Date: Wed Jun 3 22:21:16 2020 +0100 rxrpc: Move the call completion handling out of line Move the handling of call completion out of line so that the next patch can add more code in that area. Signed-off-by: David Howells Reviewed-by: Marc Dionne commit 523f3ec030aa5bf4818ec8dee35b2646abf367fa Author: Johannes Berg Date: Wed Jun 3 11:15:03 2020 +0200 mac80211: initialize return flags in HE 6 GHz operation parsing Dan points out that if ieee80211_chandef_he_6ghz_oper() succeeds, we don't initialize 'ret'. Initialize it to 0 in this case, since everything went fine and nothing has to be disabled. Reported-by: Dan Carpenter Fixes: 57fa5e85d53c ("mac80211: determine chandef from HE 6 GHz operation") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200603111500.bd2a5ff37b83.I2c3f338ce343b581db493eb9a0d988d1b626c8fb@changeid Signed-off-by: Johannes Berg commit 54e74df5d76dea824c7c0c9d1b97150bf9b33793 Author: Xiongfeng Wang Date: Sat May 30 10:08:31 2020 +0800 cpufreq: CPPC: add SW BOOST support To add SW BOOST support for CPPC, we need to get the max frequency of boost mode and non-boost mode. ACPI spec 6.2 section 8.4.7.1 describes the following two CPC registers. "Highest performance is the absolute maximum performance an individual processor may reach, assuming ideal conditions. This performance level may not be sustainable for long durations, and may only be achievable if other platform components are in a specific state; for example, it may require other processors be in an idle state. Nominal Performance is the maximum sustained performance level of the processor, assuming ideal operating conditions. In absence of an external constraint (power, thermal, etc.) this is the performance level the platform is expected to be able to maintain continuously. All processors are expected to be able to sustain their nominal performance state simultaneously." To add SW BOOST support for CPPC, we can use Highest Performance as the max performance in boost mode and Nominal Performance as the max performance in non-boost mode. If the Highest Performance is greater than the Nominal Performance, we assume SW BOOST is supported. The current CPPC driver does not support SW BOOST and use 'Highest Performance' as the max performance the CPU can achieve. 'Nominal Performance' is used to convert 'performance' to 'frequency'. That means, if firmware enable boost and provide a value for Highest Performance which is greater than Nominal Performance, boost feature is enabled by default. Because SW BOOST is disabled by default, so, after this patch, boost feature is disabled by default even if boost is enabled by firmware. Signed-off-by: Xiongfeng Wang Suggested-by: Viresh Kumar Acked-by: Viresh Kumar [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki commit cf6fada71543ceea0f6228ffdc0b85778f3f5a6e Author: Xiongfeng Wang Date: Sat May 30 10:08:30 2020 +0800 cpufreq: change '.set_boost' to act on one policy Macro 'for_each_active_policy()' is defined internally. To avoid some cpufreq driver needing this macro to iterate over all the policies in '.set_boost' callback, we redefine '.set_boost' to act on only one policy and pass the policy as an argument. 'cpufreq_boost_trigger_state()' iterates over all the policies to set boost for the system. This is preparation for adding SW BOOST support for CPPC. To protect Boost enable/disable by sysfs from CPU online/offline, add 'cpu_hotplug_lock' before calling '.set_boost' for each CPU. Also move the lock from 'set_boost()' to 'store_cpb()' in acpi_cpufreq. Signed-off-by: Xiongfeng Wang Suggested-by: Viresh Kumar Acked-by: Viresh Kumar [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki commit afd8d7c7f93681370f6fc2ec62f2705710eee62d Author: Christophe JAILLET Date: Sun May 31 23:00:59 2020 +0200 PM: hibernate: Add __init annotation to swsusp_header_init() 'swsusp_header_init()' is only called via 'core_initcall'. It can be marked as __init to save a few bytes of memory. Signed-off-by: Christophe JAILLET [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki commit 34a09bffd9982fdced603643068c39de867ec778 Author: Bob Moore Date: Thu Jun 4 13:44:21 2020 -0700 ACPICA: Update version to 20200528 ACPICA commit 30ceafb55b59724f73ae6f2b35523417c4e569ea Version 20200528. Link: https://github.com/acpica/acpica/commit/30ceafb5 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki commit f083906fa9c1643e5c16b887cc29099fdfc3e875 Author: Erik Kaneda Date: Thu Jun 4 13:44:20 2020 -0700 ACPICA: iASL: add new OperationRegion subtype keyword PlatformRtMechanism ACPICA commit 2c2eefa827bd37297f5f9ca4b263fcba829aaf3f Link: https://github.com/acpica/acpica/commit/2c2eefa8 Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit d82faa0825061aef01b99c3c94f77713b483b060 Author: Bob Moore Date: Thu Jun 4 13:44:19 2020 -0700 ACPICA: acpidump: Removed dead code from oslinuxtbl.c ACPICA commit 4d938d048790983b8b4252b0f4aeec59dabb476c ACPICA BZ 1119. Link: https://github.com/acpica/acpica/commit/4d938d04 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki commit 8a9144c1cf523221b37dd3393827253c91fcbf54 Author: Dan Murphy Date: Tue Jun 2 14:35:23 2020 -0500 dt-bindings: ASoc: Fix tdm-slot documentation spelling error Fix the spelling of 'specified'. Also fix grammarical issue with the use of 'a' over 'an' Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200602193524.30309-1-dmurphy@ti.com Signed-off-by: Mark Brown commit 6e801dc411329aff592fbd48fb116183d0acdb00 Author: Colin Ian King Date: Thu Jun 4 18:12:16 2020 +0100 ASoC: meson: fix memory leak of links if allocation of ldata fails Currently if the allocation of ldata fails the error return path does not kfree the allocated links object. Fix this by adding an error exit return path that performs the necessary kfree'ing. Fixes: 7864a79f37b5 ("ASoC: meson: add axg sound card support") Signed-off-by: Colin Ian King Addresses-Coverity: ("Resource leak") Link: https://lore.kernel.org/r/20200604171216.60043-1-colin.king@canonical.com Signed-off-by: Mark Brown commit b398ace5d2ea0b7f00d9f1ce23c647e289c206ca Author: Marco Elver Date: Thu May 28 09:43:13 2020 +0200 compiler_types.h: Use unoptimized __unqual_scalar_typeof for sparse If the file is being checked with sparse, use the unoptimized version of __unqual_scalar_typeof(), since sparse does not support _Generic. Reported-by: kbuild test robot Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/202005280727.lXn1VnTw%lkp@intel.com Signed-off-by: Will Deacon commit 1fd76043ecb04b8567a76b106db09ac778e1e2b8 Author: Marco Elver Date: Wed May 27 12:32:36 2020 +0200 compiler_types.h: Optimize __unqual_scalar_typeof compilation time If the compiler supports C11's _Generic, use it to speed up compilation times of __unqual_scalar_typeof(). GCC version 4.9 or later and all supported versions of Clang support the feature (the oldest supported compiler that doesn't support _Generic is GCC 4.8, for which we use the slower alternative). The non-_Generic variant relies on multiple expansions of __pick_integer_type -> __pick_scalar_type -> __builtin_choose_expr, which increases pre-processed code size, and can cause compile times to increase in files with numerous expansions of READ_ONCE(), or other users of __unqual_scalar_typeof(). Summary of compile-time benchmarking done by Arnd Bergmann: clang-11 gcc-9 this patch 0.78 0.91 ideal 0.76 0.86 See https://lkml.kernel.org/r/CAK8P3a3UYQeXhiufUevz=rwe09WM_vSTCd9W+KvJHJcOeQyWVA@mail.gmail.com Further compile-testing done with: gcc 4.8, 4.9, 5.5, 6.4, 7.5, 8.4; clang 9, 10. Reported-by: Arnd Bergmann Signed-off-by: Marco Elver Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra Tested-by: Arnd Bergmann Link: https://lkml.kernel.org/r/20200527103236.148700-1-elver@google.com Link: https://lkml.kernel.org/r/CAK8P3a0RJtbVi1JMsfik=jkHCNFv+DJn_FeDg-YLW+ueQW3tNg@mail.gmail.com [will: tweak new macros to make them a bit more readable] Signed-off-by: Will Deacon commit b16d8ecf4fa17e16fff20638364f9bd2205615e7 Author: Will Deacon Date: Fri Jun 5 11:19:46 2020 +0100 compiler.h: Enforce that READ_ONCE_NOCHECK() access size is sizeof(long) READ_ONCE_NOCHECK() unconditionally performs a sizeof(long)-sized access, so enforce that the size of the pointed-to object that we are loading from is the same size as 'long'. Reported-by: Marco Elver Signed-off-by: Will Deacon commit 8d4beed7bbc71666de2630b79899c8852c3bf5cd Author: Will Deacon Date: Fri Jun 5 11:05:51 2020 +0100 compiler-types.h: Include naked type in __pick_integer_type() match __pick_integer_type() checks whether the type of its first argument is compatible with an explicitly signed or unsigned integer type, returning the compatible type if it exists. Unfortunately, 'char' is neither compatible with 'signed char' nor 'unsigned char', so add a check against the naked type to allow the __unqual_scalar_typeof() macro to strip qualifiers from char types without an explicit signedness. Reported-by: Rasmus Villemoes Signed-off-by: Will Deacon commit 42413b49804b250ced70dac8815388af2d4ad872 Author: Roberto Sassu Date: Fri Jun 5 08:50:28 2020 +0200 ima: Directly free *entry in ima_alloc_init_template() if digests is NULL To support multiple template digests, the static array entry->digest has been replaced with a dynamically allocated array in commit aa724fe18a8a ("ima: Switch to dynamically allocated buffer for template digests"). The array is allocated in ima_alloc_init_template() and if the returned pointer is NULL, ima_free_template_entry() is called. However, (*entry)->template_desc is not yet initialized while it is used by ima_free_template_entry(). This patch fixes the issue by directly freeing *entry without calling ima_free_template_entry(). Fixes: aa724fe18a8a ("ima: Switch to dynamically allocated buffer for template digests") Reported-by: syzbot+223310b454ba6b75974e@syzkaller.appspotmail.com Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 5872f1a2e5c783783d51e96468f0ff6aede61182 Author: Will Deacon Date: Mon May 11 21:59:51 2020 +0100 READ_ONCE: Fix comment describing 2x32-bit atomicity READ_ONCE() permits 64-bit accesses on 32-bit architectures, since this crops up in a few places and is generally harmless because either the upper bits are always zero (e.g. for a virtual address or 32-bit time_t) or the architecture provides 64-bit atomicity anyway. Update the corresponding comment above compiletime_assert_rwonce_type(), which incorrectly states that 32-bit x86 provides 64-bit atomicity, and instead reference 32-bit Armv7 with LPAE. Cc: Thomas Gleixner Cc: Peter Zijlstra Reported-by: Jann Horn Signed-off-by: Will Deacon commit 5788ccf3c84f5587418a80128a3653aa35abf00b Author: Xiaoming Ni Date: Tue Mar 31 09:31:59 2020 +0800 mtd: clear cache_state to avoid writing to bad blocks repeatedly The function call process is as follows: mtd_blktrans_work() while (1) do_blktrans_request() mtdblock_writesect() do_cached_write() write_cached_data() /*if cache_state is STATE_DIRTY*/ erase_write() write_cached_data() returns failure without modifying cache_state and cache_offset. So when do_cached_write() is called again, write_cached_data() will be called again to perform erase_write() on the same cache_offset. But if this cache_offset points to a bad block, erase_write() will always return -EIO. Writing to this mtdblk is equivalent to losing the current data, and repeatedly writing to the bad block. Repeatedly writing a bad block has no real benefits, but brings some negative effects: 1 Lost subsequent data 2 Loss of flash device life 3 erase_write() bad blocks are very time-consuming. For example: the function do_erase_oneblock() in chips/cfi_cmdset_0020.c or chips/cfi_cmdset_0002.c may take more than 20 seconds to return Therefore, when erase_write() returns -EIO in write_cached_data(), clear cache_state to avoid writing to bad blocks repeatedly. Signed-off-by: Xiaoming Ni Reviewed-by: Miquel Raynal Signed-off-by: Richard Weinberger commit eb13fa0227417e84aecc3bd9c029d376e33474d3 Author: Boris Brezillon Date: Wed Apr 29 09:53:47 2020 -0700 mtd: parser: cmdline: Support MTD names containing one or more colons Looks like some drivers define MTD names with a colon in it, thus making mtdpart= parsing impossible. Let's fix the parser to gracefully handle that case: the last ':' in a partition definition sequence is considered instead of the first one. Signed-off-by: Boris Brezillon Signed-off-by: Ron Minnich Tested-by: Ron Minnich Signed-off-by: Richard Weinberger commit 9029537c93b6f7347cf213d4e3b5c935a4d07ac8 Author: Jason Yan Date: Fri Apr 3 16:15:44 2020 +0800 mtd: physmap_of_gemini: remove defined but not used symbol 'syscon_match' It's not used by anyone now, remove it. Fix the following gcc warning: drivers/mtd/maps/physmap-gemini.c:49:34: warning: ‘syscon_match’ defined but not used [-Wunused-const-variable=] static const struct of_device_id syscon_match[] = { ^~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Reviewed-by: Linus Walleij Signed-off-by: Richard Weinberger commit 79ea1e12c0b8540100e89b32afb9f0e6503fad35 Author: Johannes Berg Date: Thu Jun 4 12:04:20 2020 +0200 cfg80211: fix management registrations deadlock Lockdep reports that we may deadlock because we take the RTNL on the work struct, but flush it under RTNL. Clearly, it's correct. In practice, this can happen when doing rfkill on an active device. Fix this by moving the work struct to the wiphy (registered dev) layer, and iterate over all the wdevs inside there. This then means we need to track which one of them has work to do, so we don't update to the driver for all wdevs all the time. Also fix a locking bug I noticed while working on this - the registrations list is iterated as if it was an RCU list, but it isn't handle that way - and we need to lock now for the update flag anyway, so remove the RCU. Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API") Reported-by: Markus Theil Reported-and-tested-by: Kenneth R. Crudup Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200604120420.b1dc540a7e26.I55dcca56bb5bdc5d7ad66a36a0b42afd7034d8be@changeid Signed-off-by: Johannes Berg commit a4902d914e508f3691fa7ef885a76d2b7e735805 Author: Stephen Rothwell Date: Mon May 11 13:00:15 2020 +1000 xfrm: merge fixup for "remove output_finish indirection from xfrm_state_afinfo" Signed-off-by: Stephen Rothwell Signed-off-by: Steffen Klassert commit 5aec598c456fe3c1b71a1202cbb42bdc2a643277 Author: Chaitanya Kulkarni Date: Thu Jun 4 00:13:30 2020 -0700 blktrace: fix endianness for blk_log_remap() The function blk_log_remap() can be simplified by removing the call to get_pdu_remap() that copies the values into extra variable to print the data, which also fixes the endiannness warning reported by sparse. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 71df3fd82e7cccec7b749a8607a4662d9f7febdd Author: Chaitanya Kulkarni Date: Thu Jun 4 00:13:29 2020 -0700 blktrace: fix endianness in get_pdu_int() In function get_pdu_len() replace variable type from __u64 to __be64. This fixes sparse warning. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 48bc3cd3e07a1486f45d9971c75d6090976c3b1b Author: Chaitanya Kulkarni Date: Thu Jun 4 00:13:28 2020 -0700 blktrace: use errno instead of bi_status In blk_add_trace_spliti() blk_add_trace_bio_remap() use blk_status_to_errno() to pass the error instead of pasing the bi_status. This fixes the sparse warning. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 15b81ce5abdc4b502aa31dff2d415b79d2349d2f Author: Ahmed S. Darwish Date: Wed Jun 3 16:49:48 2020 +0200 block: nr_sects_write(): Disable preemption on seqcount write For optimized block readers not holding a mutex, the "number of sectors" 64-bit value is protected from tearing on 32-bit architectures by a sequence counter. Disable preemption before entering that sequence counter's write side critical section. Otherwise, the read side can preempt the write side section and spin for the entire scheduler tick. If the reader belongs to a real-time scheduling class, it can spin forever and the kernel will livelock. Fixes: c83f6bf98dc1 ("block: add partition resize function to blkpg ioctl") Cc: Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Jens Axboe commit d24de76af836260a99ca2ba281a937bd5bc55591 Author: Christoph Hellwig Date: Wed Jun 3 07:14:43 2020 +0200 block: remove the error argument to the block_bio_complete tracepoint The status can be trivially derived from the bio itself. That also avoid callers like NVMe to incorrectly pass a blk_status_t instead of the errno, and the overhead of translating the blk_status_t to the errno in the I/O completion fast path when no tracing is enabled. Fixes: 35fe0d12c8a3 ("nvme: trace bio completion") Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit f650ef61e040bcb175dd8762164b00a5d627f20e Author: Ye Bin Date: Fri Jun 5 09:41:49 2020 +0800 ata/libata: Fix usage of page address by page_address in ata_scsi_mode_select_xlat function BUG: KASAN: use-after-free in ata_scsi_mode_select_xlat+0x10bd/0x10f0 drivers/ata/libata-scsi.c:4045 Read of size 1 at addr ffff88803b8cd003 by task syz-executor.6/12621 CPU: 1 PID: 12621 Comm: syz-executor.6 Not tainted 4.19.95 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xac/0xee lib/dump_stack.c:118 print_address_description+0x60/0x223 mm/kasan/report.c:253 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xae/0x2d8 mm/kasan/report.c:393 ata_scsi_mode_select_xlat+0x10bd/0x10f0 drivers/ata/libata-scsi.c:4045 ata_scsi_translate+0x2da/0x680 drivers/ata/libata-scsi.c:2035 __ata_scsi_queuecmd drivers/ata/libata-scsi.c:4360 [inline] ata_scsi_queuecmd+0x2e4/0x790 drivers/ata/libata-scsi.c:4409 scsi_dispatch_cmd+0x2ee/0x6c0 drivers/scsi/scsi_lib.c:1867 scsi_queue_rq+0xfd7/0x1990 drivers/scsi/scsi_lib.c:2170 blk_mq_dispatch_rq_list+0x1e1/0x19a0 block/blk-mq.c:1186 blk_mq_do_dispatch_sched+0x147/0x3d0 block/blk-mq-sched.c:108 blk_mq_sched_dispatch_requests+0x427/0x680 block/blk-mq-sched.c:204 __blk_mq_run_hw_queue+0xbc/0x200 block/blk-mq.c:1308 __blk_mq_delay_run_hw_queue+0x3c0/0x460 block/blk-mq.c:1376 blk_mq_run_hw_queue+0x152/0x310 block/blk-mq.c:1413 blk_mq_sched_insert_request+0x337/0x6c0 block/blk-mq-sched.c:397 blk_execute_rq_nowait+0x124/0x320 block/blk-exec.c:64 blk_execute_rq+0xc5/0x112 block/blk-exec.c:101 sg_scsi_ioctl+0x3b0/0x6a0 block/scsi_ioctl.c:507 sg_ioctl+0xd37/0x23f0 drivers/scsi/sg.c:1106 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xae6/0x1030 fs/ioctl.c:688 ksys_ioctl+0x76/0xa0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xa0/0x2e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45c479 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb0e9602c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fb0e96036d4 RCX: 000000000045c479 RDX: 0000000020000040 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 000000000076bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000046d R14: 00000000004c6e1a R15: 000000000076bfcc Allocated by task 12577: set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:531 __kmalloc+0xf3/0x1e0 mm/slub.c:3749 kmalloc include/linux/slab.h:520 [inline] load_elf_phdrs+0x118/0x1b0 fs/binfmt_elf.c:441 load_elf_binary+0x2de/0x4610 fs/binfmt_elf.c:737 search_binary_handler fs/exec.c:1654 [inline] search_binary_handler+0x15c/0x4e0 fs/exec.c:1632 exec_binprm fs/exec.c:1696 [inline] __do_execve_file.isra.0+0xf52/0x1a90 fs/exec.c:1820 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8a/0xb0 fs/exec.c:1959 do_syscall_64+0xa0/0x2e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 12577: set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x129/0x170 mm/kasan/kasan.c:521 slab_free_hook mm/slub.c:1370 [inline] slab_free_freelist_hook mm/slub.c:1397 [inline] slab_free mm/slub.c:2952 [inline] kfree+0x8b/0x1a0 mm/slub.c:3904 load_elf_binary+0x1be7/0x4610 fs/binfmt_elf.c:1118 search_binary_handler fs/exec.c:1654 [inline] search_binary_handler+0x15c/0x4e0 fs/exec.c:1632 exec_binprm fs/exec.c:1696 [inline] __do_execve_file.isra.0+0xf52/0x1a90 fs/exec.c:1820 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8a/0xb0 fs/exec.c:1959 do_syscall_64+0xa0/0x2e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88803b8ccf00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 259 bytes inside of 512-byte region [ffff88803b8ccf00, ffff88803b8cd100) The buggy address belongs to the page: page:ffffea0000ee3300 count:1 mapcount:0 mapping:ffff88806cc03080 index:0xffff88803b8cc780 compound_mapcount: 0 flags: 0x100000000008100(slab|head) raw: 0100000000008100 ffffea0001104080 0000000200000002 ffff88806cc03080 raw: ffff88803b8cc780 00000000800c000b 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88803b8ccf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803b8ccf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803b8cd000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803b8cd080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803b8cd100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc You can refer to "https://www.lkml.org/lkml/2019/1/17/474" reproduce this error. The exception code is "bd_len = p[3];", "p" value is ffff88803b8cd000 which belongs to the cache kmalloc-512 of size 512. The "page_address(sg_page(scsi_sglist(scmd)))" maybe from sg_scsi_ioctl function "buffer" which allocated by kzalloc, so "buffer" may not page aligned. This also looks completely buggy on highmem systems and really needs to use a kmap_atomic. --Christoph Hellwig To address above bugs, Paolo Bonzini advise to simpler to just make a char array of size CACHE_MPAGE_LEN+8+8+4-2(or just 64 to make it easy), use sg_copy_to_buffer to copy from the sglist into the buffer, and workthere. Signed-off-by: Ye Bin Signed-off-by: Jens Axboe commit eea1238867205b9e48a67c1a63219529a73c46fd Author: Navid Emamdoost Date: Thu Jun 4 22:06:43 2020 -0500 sata_rcar: handle pm_runtime_get_sync failure cases Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost Signed-off-by: Jens Axboe commit 435faf5c218a47fd6258187f62d9bb1009717896 Merge: 571d54ed91c0 09c0533d129c Author: Linus Torvalds Date: Thu Jun 4 20:14:18 2020 -0700 Merge tag 'riscv-for-linus-5.8-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - The remainder of the code necessary to support the Kendryte K210: * Support for building device trees into the kernel, as the K210 doesn't have a bootloader that provides one * A K210 device tree and the associated defconfig update * Support for skipping PMP initialization on systems that trap on PMP accesses rather than treating them as WARL - Support for KGDB - Improvements to text patching - Some cleanups to the SiFive L2 cache driver * tag 'riscv-for-linus-5.8-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: soc: sifive: l2 cache: Mark l2_get_priv_group as static soc: sifive: l2 cache: Eliminate an unsigned zero compare warning riscv: Add support to determine no. of L2 cache way enabled riscv: cacheinfo: Implement cache_get_priv_group with a generic ops structure riscv: Use text_mutex instead of patch_lock riscv: Use NOKPROBE_SYMBOL() instead of __krpobes annotation riscv: Remove the 'riscv_' prefix of function name riscv: Add SW single-step support for KDB riscv: Use the XML target descriptions to report 3 system registers riscv: Add KGDB support kgdb: Add kgdb_has_hit_break function RISC-V: Skip setting up PMPs on traps riscv: K210: Update defconfig riscv: K210: Add a built-in device tree riscv: Allow device trees to be built into the kernel commit 6ac92fb5cdff6e5708199f1d5d9d58011ccc76a0 Author: Martijn Coenen Date: Thu Jun 4 22:25:20 2020 +0200 loop: Fix wrong masking of status flags In faf1d25440d6, loop_set_status() now assigns lo_status directly from the passed in lo_flags, but then fixes it up by masking out flags that can't be set by LOOP_SET_STATUS; unfortunately the mask was negated. Re-ran all ltp ioctl_loop tests, and they all passed. Pass run of the previously failing one: tst_test.c:1247: INFO: Timeout per run is 0h 05m 00s tst_device.c:88: INFO: Found free device 0 '/dev/loop0' ioctl_loop01.c:49: PASS: /sys/block/loop0/loop/partscan = 0 ioctl_loop01.c:50: PASS: /sys/block/loop0/loop/autoclear = 0 ioctl_loop01.c:51: PASS: /sys/block/loop0/loop/backing_file = '/tmp/ZRJ6H4/test.img' ioctl_loop01.c:65: PASS: get expected lo_flag 12 ioctl_loop01.c:67: PASS: /sys/block/loop0/loop/partscan = 1 ioctl_loop01.c:68: PASS: /sys/block/loop0/loop/autoclear = 1 ioctl_loop01.c:77: PASS: access /dev/loop0p1 succeeds ioctl_loop01.c:83: PASS: access /sys/block/loop0/loop0p1 succeeds Summary: passed 8 failed 0 skipped 0 warnings 0 Fixes: faf1d25440d6 ("loop: Clean up LOOP_SET_STATUS lo_flags handling") Reported-by: Naresh Kamboju Signed-off-by: Martijn Coenen Tested-by: Naresh Kamboju Signed-off-by: Jens Axboe commit 571d54ed91c0fae174d933683c0c2e11c84843d9 Merge: 9d71d3cd9ef0 8211d1e83ade Author: Linus Torvalds Date: Thu Jun 4 20:11:25 2020 -0700 Merge tag 'devicetree-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: - Convert various DT (non-binding) doc files to ReST - Various improvements to device link code - Fix __of_attach_node_sysfs refcounting bug - Add support for 'memory-region-names' with reserved-memory binding - Vendor prefixes for Protonic Holland, BeagleBoard.org, Alps, Check Point, Würth Elektronik, U-Boot, Vaisala, Baikal Electronics, Shanghai Awinic Technology Co., MikroTik, Silex Insight - A bunch more binding conversions to DT schema. Only 3K to go. - Add a minimum version check for schema tools - Treewide dropping of 'allOf' usage with schema references. Not needed in new json-schema spec. - Some formatting clean-ups of schemas * tag 'devicetree-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (194 commits) dt-bindings: clock: Add documentation for X1830 bindings. dt-bindings: mailbox: Convert imx mu to json-schema dt-bindings: power: Convert imx gpcv2 to json-schema dt-bindings: power: Convert imx gpc to json-schema dt-bindings: Merge gpio-usb-b-connector with usb-connector dt-bindings: timer: renesas: cmt: Convert to json-schema dt-bindings: clock: Convert i.MX8QXP LPCG to json-schema dt-bindings: timer: Convert i.MX GPT to json-schema dt-bindings: thermal: rcar-thermal: Add device tree support for r8a7742 dt-bindings: serial: Add binding for UART pin swap dt-bindings: geni-se: Add interconnect binding for GENI QUP dt-bindings: geni-se: Convert QUP geni-se bindings to YAML dt-bindings: vendor-prefixes: Add Silex Insight vendor prefix dt-bindings: input: touchscreen: edt-ft5x06: change reg property dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver dt-bindings: timer: renesas: mtu2: Convert to json-schema of/fdt: Remove redundant kbasename function call dt-bindings: clock: Convert i.MX1 clock to json-schema dt-bindings: clock: Convert i.MX21 clock to json-schema dt-bindings: clock: Convert i.MX25 clock to json-schema ... commit 9d71d3cd9ef040c284506648285915e9ba4d08c4 Merge: 828f3e18e1cb 9ad249abe7b8 Author: Linus Torvalds Date: Thu Jun 4 20:02:14 2020 -0700 Merge tag 'arm-dt-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM devicetree updates from Arnd Bergmann: "This is the set of device tree changes, mostly covering new hardware support, with 577 patches touching a little over 500 files. There are five new Arm SoCs supported in this release, all of them for existing SoC families: - Realtek RTD1195, RTD1395 and RTD1619 -- three SoCs used in both NAS devices and Android Set-top-box designs, along with the "Horseradish", "Lion Skin" and "Mjolnir" reference platforms; the Mele X1000 and Xnano X5 set-top-boxes and the Banana Pi BPi-M4 single-board computer. - Renesas RZ/G1H (r8a7742) -- a high-end 32-bit industrial SoC and the iW-RainboW-G21D-Qseven-RZG1H board/SoM - Rockchips RK3326 -- low-end 64-bit SoC along with the Odroid-GO Advance game console Newly added machines on already supported SoCs are: - AMLogic S905D based Smartlabs SML-5442TW TV box - AMLogic S905X3 based ODROID-C4 SBC - AMLogic S922XH based Beelink GT-King Pro TV box - Allwinner A20 based Olimex A20-OLinuXino-LIME-eMMC SBC - Aspeed ast2500 based BMCs in Facebook x86 "Yosemite V2" and YADRO OpenPower P9 "Nicole" - Marvell Kirkwood based Check Point L-50 router - Mediatek MT8173 based Elm/Hana Chromebook laptops - Microchip SAMA5D2 "Industrial Connectivity Platform" reference board - NXP i.MX8m based Beacon i.MX8m-Mini SoM development kit - Octavo OSDMP15x based Linux Automation MC-1 development board - Qualcomm SDM630 based Xiaomi Redmi Note 7 phone - Realtek RTD1295 based Xnano X5 TV Box - STMicroelectronics STM32MP1 based Stinger96 single-board computer and IoT Box - Samsung Exynos4210 based based Samsung Galaxy S2 phone - Socionext Uniphier based Akebi96 SBC - TI Keystone based K2G Evaluation board - TI am5729 based Beaglebone-AI development board Include device descriptions for additional hardware support in existing SoCs and machines based on all major SoC platforms: - AMlogic Meson - Allwinner sunxi - Arm Juno/VFP/Vexpress/Integrator - Broadcom bcm283x/bcm2711 - Hisilicon hi6220 - Marvell EBU - Mediatek MT27xx, MT76xx, MT81xx and MT67xx - Microchip SAMA5D2 - NXP i.MX6/i.MX7/i.MX8 and Layerscape - Nvidia Tegra - Qualcomm Snapdragon - Renesas r8a77961, r8a7791 - Rockchips RK32xx/RK33xx - ST-Ericsson ux500 - STMicroelectronics SMT32 - Samsung Exynos and S5PV210 - Socionext Uniphier - TI OMAP5/DRA7 and Keystone" * tag 'arm-dt-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (564 commits) ARM: dts: keystone: Rename "msmram" node to "sram" arm: dts: mt2712: add uart APDMA to device tree arm64: dts: mt8183: add mmc node arm64: dts: mt2712: add ethernet device node arm64: tegra: Make the RTC a wakeup source on Jetson Nano and TX1 ARM: dts: mmp3: Add the fifth SD HCI ARM: dts: berlin*: Fix up the SDHCI node names ARM: dts: mmp3: Fix USB & USB PHY node names ARM: dts: mmp3: Fix L2 cache controller node name ARM: dts: mmp*: Fix up encoding of the /rtc interrupts property ARM: dts: pxa*: Fix up encoding of the /rtc interrupts property ARM: dts: pxa910: Fix the gpio interrupt cell number ARM: dts: pxa3xx: Fix up encoding of the /gpio interrupts property ARM: dts: pxa168: Fix the gpio interrupt cell number ARM: dts: pxa168: Add missing address/size cells to i2c nodes ARM: dts: dove: Fix interrupt controller node name ARM: dts: kirkwood: Fix interrupt controller node name arm64: dts: Add SC9863A emmc and sd card nodes arm64: dts: Add SC9863A clock nodes arm64: dts: mt6358: add PMIC MT6358 related nodes ... commit 828f3e18e1cb98c68fc6db4d5113513d4a267775 Merge: 298743c193bb b5f73d47f34b Author: Linus Torvalds Date: Thu Jun 4 19:56:20 2020 -0700 Merge tag 'arm-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM/SoC driver updates from Arnd Bergmann: "These are updates to SoC specific drivers that did not have another subsystem maintainer tree to go through for some reason: - Some bus and memory drivers for the MIPS P5600 based Baikal-T1 SoC that is getting added through the MIPS tree. - There are new soc_device identification drivers for TI K3, Qualcomm MSM8939 - New reset controller drivers for NXP i.MX8MP, Renesas RZ/G1H, and Hisilicon hi6220 - The SCMI firmware interface can now work across ARM SMC/HVC as a transport. - Mediatek platforms now use a new driver for their "MMSYS" hardware block that controls clocks and some other aspects in behalf of the media and gpu drivers. - Some Tegra processors have improved power management support, including getting woken up by the PMIC and cluster power down during idle. - A new v4l staging driver for Tegra is added. - Cleanups and minor bugfixes for TI, NXP, Hisilicon, Mediatek, and Tegra" * tag 'arm-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (155 commits) clk: sprd: fix compile-testing bus: bt1-axi: Build the driver into the kernel bus: bt1-apb: Build the driver into the kernel bus: bt1-axi: Use sysfs_streq instead of strncmp bus: bt1-axi: Optimize the return points in the driver bus: bt1-apb: Use sysfs_streq instead of strncmp bus: bt1-apb: Use PTR_ERR_OR_ZERO to return from request-regs method bus: bt1-apb: Fix show/store callback identations bus: bt1-apb: Include linux/io.h dt-bindings: memory: Add Baikal-T1 L2-cache Control Block binding memory: Add Baikal-T1 L2-cache Control Block driver bus: Add Baikal-T1 APB-bus driver bus: Add Baikal-T1 AXI-bus driver dt-bindings: bus: Add Baikal-T1 APB-bus binding dt-bindings: bus: Add Baikal-T1 AXI-bus binding staging: tegra-video: fix V4L2 dependency tee: fix crypto select drivers: soc: ti: knav_qmss_queue: Make knav_gp_range_ops static soc: ti: add k3 platforms chipid module driver dt-bindings: soc: ti: add binding for k3 platforms chipid module ... commit 298743c193bb50b5d65b9285eb7206ffb31d412d Merge: 694b5a5d313f f11d7cb47f15 Author: Linus Torvalds Date: Thu Jun 4 19:54:15 2020 -0700 Merge tag 'arm-defconfig-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "These are the usual updates to arm/arm64 defconfig files, enabling newly added drivers and addressing changes to Kconfig files" * tag 'arm-defconfig-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (22 commits) ARM: imx_v6_v7_defconfig: extend RN5T618 PMIC family support arm64: defconfig: enable Qualcomm IPA and RMNet modules arm64: defconfig: Add LEDS_TRIGGER_TIMER arm64: defconfig: Enable UACCE/PCI PASID/SEC2/HPRE configs arm64: defconfig: Enable Qualcomm SC7180 pinctrl and gcc arm64: defconfig: Remove QCOM_GLINK_SSR ARM: multi_v7_defconfig: Enable r8a7742 SoC ARM: shmobile: defconfig: Enable r8a7742 SoC arm64: defconfig: enable meson gx audio as module arm64: defconfig: Enable SM8250 GCC driver ARM: defconfig: u8500: Enable new drivers for ux500 arm64: defconfig: Enable CONFIG_PINCTRL_IMX8DXL by default arm64: configs: Enable sun50i cpufreq nvmem ARM: shmobile: defconfig: Refresh for v5.7-rc1 ARM: defconfig: u8500: Enable new drivers for samsung-golden ARM: configs: sunxi: Add sun8i analog codec arm64: defconfig: Enable Qualcomm CAMCC, CAMSS and CCI drivers ARM: configs: at91: sama5: enable MCP16502 regulator ARM: configs: at91: sama5: enable SAMA5D2_PIOBU ARM: exynos_defconfig: Compile MAC80211/CFG80211 as modules ... commit 694b5a5d313f3997764b67d52bab66ec7e59e714 Merge: 587f17018a2c d2353bad2c1e Author: Linus Torvalds Date: Thu Jun 4 19:47:11 2020 -0700 Merge tag 'arm-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC updates from Arnd Bergmann: "One new platform gets added, the Realtek RTD1195, which is an older Cortex-a7 based relative of the RTD12xx chips that are already supported in arch/arm64. The platform may also be extended to support running 32-bit kernels on those 64-bit chips for memory-constrained machines. In the Renesas shmobile platform, we gain support for "RZ/G1H" or R8A7742, an eight-core chip based on Cortex-A15 and Cortex-A7 cores, originally released in 2016 as one of the last high-end 32-bit designs. There is ongoing cleanup for the integrator, tegra, imx, and omap2 platforms, with integrator getting very close to the goal of having zero code in arch/arm/, and omap2 moving more of the chip specifics from old board code into device tree files. The Versatile Express platform is made more modular, with built-in drivers now becoming loadable modules. This is part of a greater effort for the Android OS to have a common kernel binary for all platforms and any platform specific code in loadable modules. The PXA platform drops support for Compulab's pxa2xx boards that had rather unusual flash and PCI drivers but no known users remaining. All device drivers specific to those boards can now get removed as well. Across platforms, there is ongoing cleanup, with Geert and Rob revisiting some a lot of Kconfig options" * tag 'arm-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (94 commits) ARM: omap2: fix omap5_realtime_timer_init definition ARM: zynq: Don't select CONFIG_ICST ARM: OMAP2+: Fix regression for using local timer on non-SMP SoCs clk: versatile: Fix kconfig dependency on COMMON_CLK_VERSATILE ARM: davinci: fix build failure without I2C power: reset: vexpress: fix build issue power: vexpress: cleanup: use builtin_platform_driver power: vexpress: add suppress_bind_attrs to true Revert "ARM: vexpress: Don't select VEXPRESS_CONFIG" MAINTAINERS: pxa: remove Compulab arm/pxa support ARM: pxa: remove Compulab pxa2xx boards bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe() soc: imx: move cpu code to drivers/soc/imx ARM: imx: move cpu definitions into a header ARM: imx: use device_initcall for imx_soc_device_init ARM: imx: pcm037: make pcm970_sja1000_platform_data static bus: ti-sysc: Timers no longer need legacy quirk handling ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter ARM: dts: Configure system timers for omap2 ARM: dts: Configure system timers for ti81xx ... commit 587f17018a2c6c414e41a312b002faaef60cf423 Author: Nick Desaulniers Date: Fri Feb 14 14:18:11 2020 -0800 Kconfig: add config option for asm goto w/ outputs This allows C code to make use of compilers with support for output variables along the fallthrough path via preprocessor define: CONFIG_CC_HAS_ASM_GOTO_OUTPUT [ This is not used anywhere yet, and currently released compilers don't support this yet, but it's coming, and I have some local experimental patches to take advantage of it when it does - Linus ] Signed-off-by: Nick Desaulniers Signed-off-by: Linus Torvalds commit 886d7de631da71e30909980fdbf318f7caade262 Merge: 5bfea2d9b17f 469cbd016157 Author: Linus Torvalds Date: Thu Jun 4 19:18:29 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge yet more updates from Andrew Morton: - More MM work. 100ish more to go. Mike Rapoport's "mm: remove __ARCH_HAS_5LEVEL_HACK" series should fix the current ppc issue - Various other little subsystems * emailed patches from Andrew Morton : (127 commits) lib/ubsan.c: fix gcc-10 warnings tools/testing/selftests/vm: remove duplicate headers selftests: vm: pkeys: fix multilib builds for x86 selftests: vm: pkeys: use the correct page size on powerpc selftests/vm/pkeys: override access right definitions on powerpc selftests/vm/pkeys: test correct behaviour of pkey-0 selftests/vm/pkeys: introduce a sub-page allocator selftests/vm/pkeys: detect write violation on a mapped access-denied-key page selftests/vm/pkeys: associate key on a mapped page and detect write violation selftests/vm/pkeys: associate key on a mapped page and detect access violation selftests/vm/pkeys: improve checks to determine pkey support selftests/vm/pkeys: fix assertion in test_pkey_alloc_exhaust() selftests/vm/pkeys: fix number of reserved powerpc pkeys selftests/vm/pkeys: introduce powerpc support selftests/vm/pkeys: introduce generic pkey abstractions selftests: vm: pkeys: use the correct huge page size selftests/vm/pkeys: fix alloc_random_pkey() to make it really random selftests/vm/pkeys: fix assertion in pkey_disable_set/clear() selftests/vm/pkeys: fix pkey_disable_clear() selftests: vm: pkeys: add helpers for pkey bits ... commit 469cbd016157d28c27fda8da6ddc76b856f4e1b9 Author: Arnd Bergmann Date: Thu Jun 4 16:53:00 2020 -0700 lib/ubsan.c: fix gcc-10 warnings The latest compiler expects slightly different function prototypes for the ubsan helpers: lib/ubsan.c:192:6: error: conflicting types for built-in function '__ubsan_handle_add_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch] 192 | void __ubsan_handle_add_overflow(struct overflow_data *data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/ubsan.c:200:6: error: conflicting types for built-in function '__ubsan_handle_sub_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch] 200 | void __ubsan_handle_sub_overflow(struct overflow_data *data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/ubsan.c:207:6: error: conflicting types for built-in function '__ubsan_handle_mul_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch] 207 | void __ubsan_handle_mul_overflow(struct overflow_data *data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/ubsan.c:214:6: error: conflicting types for built-in function '__ubsan_handle_negate_overflow'; expected 'void(void *, void *)' [-Werror=builtin-declaration-mismatch] 214 | void __ubsan_handle_negate_overflow(struct overflow_data *data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/ubsan.c:234:6: error: conflicting types for built-in function '__ubsan_handle_divrem_overflow'; expected 'void(void *, void *, void *)' [-Werror=builtin-declaration-mismatch] 234 | void __ubsan_handle_divrem_overflow(struct overflow_data *data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change the Linux implementation to match these, using a local typed pointer. Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton Reviewed-by: Kees Cook Cc: Andrey Ryabinin Cc: Herbert Xu Cc: Julien Grall Link: http://lkml.kernel.org/r/20200429185948.4189600-1-arnd@arndb.de Signed-off-by: Linus Torvalds commit 2792d488a2d36c80e8beb34d710d10d144b66c22 Author: Jagadeesh Pagadala Date: Thu Jun 4 16:52:57 2020 -0700 tools/testing/selftests/vm: remove duplicate headers Code cleanup: Remove duplicate headers which are included twice. Signed-off-by: Jagadeesh Pagadala Signed-off-by: Andrew Morton Cc: Shuah Khan Cc: Brian Geffon Link: http://lkml.kernel.org/r/1587278984-18847-1-git-send-email-jagdsh.linux@gmail.com Signed-off-by: Linus Torvalds commit f21fda8f64533787db3e3682fee5775eb0bbea5f Author: Sandipan Das Date: Thu Jun 4 16:52:54 2020 -0700 selftests: vm: pkeys: fix multilib builds for x86 This ensures that both 32-bit and 64-bit binaries are generated when this is built on a x86_64 system. Most of the changes have been borrowed from tools/testing/selftests/x86/Makefile. Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Tested-by: Dave Hansen Acked-by: Dave Hansen Cc: "Desnes A. Nunes do Rosario" Cc: Florian Weimer Cc: Ingo Molnar Cc: Ram Pai Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/0326a442214d7a1b970d38296e63df3b217f5912.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 473c3cc86c36026d22129660746f2f4447abb79d Author: Sandipan Das Date: Thu Jun 4 16:52:50 2020 -0700 selftests: vm: pkeys: use the correct page size on powerpc Both 4K and 64K pages are supported on powerpc. Parts of the selftest code perform alignment computations based on the PAGE_SIZE macro which is currently hardcoded to 64K for powerpc. This causes some test failures on kernels configured with 4K page size. In some cases, we need to enforce function alignment on page size. Since this can only be done at build time, 64K is used as the alignment factor as that also ensures 4K alignment. Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: "Desnes A. Nunes do Rosario" Cc: Florian Weimer Cc: Ingo Molnar Cc: Ram Pai Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/5dcdfbf3353acdc90f315172e800b49f5ca21299.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit e9506394a159a449bdf0427b71d5191b4f7fc618 Author: Ram Pai Date: Thu Jun 4 16:52:46 2020 -0700 selftests/vm/pkeys: override access right definitions on powerpc Some platforms hardcode the x86 values for PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE such as those in: /usr/include/bits/mman-shared.h. This overrides the definitions with correct values for powerpc. [sandipan@linux.ibm.com: fix powerpc access right definitions] Link: http://lkml.kernel.org/r/1ba86fd8a94f38131cfe2d9f277001dd1ad1d34e.1588959697.git.sandipan@linux.ibm.com Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/f6eb38cb3a1e12eb2cdc9da6300bc5a5dfba0db9.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit fa17437cb8405bd0904f0aff8fb80d5e8c854b04 Author: Ram Pai Date: Thu Jun 4 16:52:43 2020 -0700 selftests/vm/pkeys: test correct behaviour of pkey-0 Ensure that pkey-0 is allocated on start and that it can be attached dynamically in various modes, without failures. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/9b7c54a9b4261894fe0c7e884c70b87214ff8fbb.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 6e2c2d0fb7819a05765147286ed71d5bb96faa36 Author: Ram Pai Date: Thu Jun 4 16:52:39 2020 -0700 selftests/vm/pkeys: introduce a sub-page allocator This introduces a new allocator that allocates 4K hardware pages to back 64K linux pages. This allocator is available only on powerpc. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/c4a82fa962ec71015b994fab1aaf83bdfd091553.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 4e06e718afd71f99592a76a29167e9cd617b2b09 Author: Ram Pai Date: Thu Jun 4 16:52:36 2020 -0700 selftests/vm/pkeys: detect write violation on a mapped access-denied-key page Detect write-violation on a page to which access-disabled key is associated much after the page is mapped. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/6a7dd4069ee18a2a51b207a55aa197f3f3c59753.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 39351c1326cf72d9b01c5faa3de23153727832f5 Author: Ram Pai Date: Thu Jun 4 16:52:32 2020 -0700 selftests/vm/pkeys: associate key on a mapped page and detect write violation Detect write-violation on a page to which write-disabled key is associated much after the page is mapped. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/6bfe3b3832f8bcfb07d7f2cf116b45197f4587dd.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit aef759db63fd4cfad5b585db96cf05f34d04cbd9 Author: Ram Pai Date: Thu Jun 4 16:52:29 2020 -0700 selftests/vm/pkeys: associate key on a mapped page and detect access violation Detect access-violation on a page to which access-disabled key is associated much after the page is mapped. Signed-off-by: Ram Pai Signed-off: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/4a19cf9252c03dd883887e9002881599e6900d06.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 94c8a223ded59918536387a9c33fee29ca54fc7e Author: Ram Pai Date: Thu Jun 4 16:52:25 2020 -0700 selftests/vm/pkeys: improve checks to determine pkey support For the pkeys subsystem to work, both the CPU and the kernel need to have support. So, additionally check if the kernel supports pkeys apart from the CPU feature checks. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/8fb76c63ebdadcf068ecd2d23731032e195cd364.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit b0acc5d6bf333583b535f5caf1539d90c78519c2 Author: Ram Pai Date: Thu Jun 4 16:52:22 2020 -0700 selftests/vm/pkeys: fix assertion in test_pkey_alloc_exhaust() Some pkeys which are valid on the hardware are reserved and not available for application use. These keys cannot be allocated. test_pkey_alloc_exhaust() tries to account for these and has an assertion which validates if all available pkeys have been exahaustively allocated. However, the expression that is currently used is only valid for x86. On powerpc, a pkey is additionally reserved as compared to x86. Hence, the assertion is made to use an arch-specific helper to get the correct count of reserved pkeys. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/38b08d0318820ae46af3aa6048384fd8056c3df7.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit c63e5e7f9942ac18bc6cc7e8853ad709e72e9f8b Author: Desnes A. Nunes do Rosario Date: Thu Jun 4 16:52:19 2020 -0700 selftests/vm/pkeys: fix number of reserved powerpc pkeys The number of reserved pkeys in a PowerNV environment is different from that on PowerVM or KVM. Tested on PowerVM and PowerNV environments. Signed-off-by: "Desnes A. Nunes do Rosario" Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Florian Weimer Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/0341a0ca961166814b44c9e724774672c18d54ca.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 589944b53b0f913b89f5b6bc50d53c38a252ba0f Author: Ram Pai Date: Thu Jun 4 16:52:15 2020 -0700 selftests/vm/pkeys: introduce powerpc support This makes use of the abstractions added earlier and introduces support for powerpc. For powerpc, after receiving the SIGSEGV, the signal handler must explicitly restore access permissions for the faulting pkey to allow the test to continue. As this makes use of pkey_access_allow(), all of its dependencies and other similar functions have been moved ahead of the signal handler. [sandipan@linux.ibm.com: fix powerpc access right updates] Link: http://lkml.kernel.org/r/5f65cf37be993760de8112a88da194e3ccbb2bf8.1588959697.git.sandipan@linux.ibm.com Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/b121e9fd33789ed9195276e32fe4e80bb6b88a31.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 604c496b227d300aac330aecd88ae5ffa28fbfc0 Author: Ram Pai Date: Thu Jun 4 16:52:12 2020 -0700 selftests/vm/pkeys: introduce generic pkey abstractions This introduces some generic abstractions and provides the corresponding architecture-specfic implementations for these abstractions. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/1c977915e69fb7767fb0dbd55ac7656554b15b93.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 57bcb57da241a186e8174c58850cb0e8e21f77a9 Author: Sandipan Das Date: Thu Jun 4 16:52:08 2020 -0700 selftests: vm: pkeys: use the correct huge page size The huge page size can vary across architectures. This will ensure that the correct huge page size is used when accessing the hugetlb controls under sysfs. Instead of using a hardcoded page size (i.e. 2MB), this now uses the HPAGE_SIZE macro which is arch-specific. Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: "Desnes A. Nunes do Rosario" Cc: Florian Weimer Cc: Ingo Molnar Cc: Ram Pai Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/66882a5d6e45c73c3a52bc4aef9754e48afa4f88.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 6e373263ce07eeaa6410843179535fbdf561fc31 Author: Ram Pai Date: Thu Jun 4 16:52:05 2020 -0700 selftests/vm/pkeys: fix alloc_random_pkey() to make it really random alloc_random_pkey() was allocating the same pkey every time. Not all pkeys were geting tested. This fixes it. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/0162f55816d4e783a0d6e49e554d0ab9a3c9a23b.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit ea5f95c3d6bb117abfe41fd2612f3213cf22b609 Author: Ram Pai Date: Thu Jun 4 16:52:01 2020 -0700 selftests/vm/pkeys: fix assertion in pkey_disable_set/clear() In some cases, a pkey's bits need not necessarily change in a way that the value of the pkey register increases when performing a pkey_disable_set() or decreases when performing a pkey_disable_clear(). For example, on powerpc, if a pkey's current state is PKEY_DISABLE_ACCESS and we perform a pkey_write_disable() on it, the bits still remain the same. We will observe something similar when the pkey's current state is 0 and a pkey_access_enable() is performed on it. Either case would cause some assertions to fail. This fixes the problem. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/8240665131e43fc93eed4eea8194676c1ea39a7f.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 11551801a71c84b9713abf1b588933eea141e362 Author: Ram Pai Date: Thu Jun 4 16:51:58 2020 -0700 selftests/vm/pkeys: fix pkey_disable_clear() Currently, pkey_disable_clear() sets the specified bits instead clearing them. This has been dead code up to now because its only callers i.e. pkey_access/write_allow() are also unused. Signed-off-by: Ram Pai Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/1f70bca60330a85dca42c3cd98212bb1cdf5a076.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 0c416bcaef8dc9b8378b3e7fa7ce3e9ad5cedcd0 Author: Sandipan Das Date: Thu Jun 4 16:51:54 2020 -0700 selftests: vm: pkeys: add helpers for pkey bits This introduces some functions that help with setting or clearing bits of a particular pkey. This also adds an abstraction for getting a pkey's bit position in the pkey register as this may vary across architectures. Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: "Desnes A. Nunes do Rosario" Cc: Florian Weimer Cc: Ingo Molnar Cc: Ram Pai Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/2ad9705f4f68ca7e72155cc583415e5a979546f1.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 4dbdd947cb7f5534bedfdd1dbf983d0c0d9def29 Author: Sandipan Das Date: Thu Jun 4 16:51:51 2020 -0700 selftests: vm: pkeys: Use sane types for pkey register The size of the pkey register can vary across architectures. This converts the data type of all its references to u64 in preparation for multi-arch support. To keep the definition of the u64 type consistent and remove format specifier related warnings, __SANE_USERSPACE_TYPES__ is defined as suggested by Michael Ellerman. Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: "Desnes A. Nunes do Rosario" Cc: Florian Weimer Cc: Ingo Molnar Cc: Ram Pai Cc: Thiago Jung Bauermann Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/d3e271798455d940e395e56e1ff1e82a31bcb7aa.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit a09160e694ccd822365da28f9e5f94d22a6784b0 Author: Thiago Jung Bauermann Date: Thu Jun 4 16:51:47 2020 -0700 selftests/vm/pkeys: make gcc check arguments of sigsafe_printf() This will help us ensure we print pkey_reg_t values correctly in different architectures. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: "Desnes A. Nunes do Rosario" Cc: Florian Weimer Cc: Ingo Molnar Cc: Ram Pai Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/b40b7a95fdd4045d62530a2a34452934caf3b0bc.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 53555e2b4d9a29ff93d9bedfe209328cc69806be Author: Thiago Jung Bauermann Date: Thu Jun 4 16:51:44 2020 -0700 selftests/vm/pkeys: move some definitions to arch-specific header In preparation for multi-arch support, move definitions which have arch-specific values to x86-specific header. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/d58eba2930059c8b209eefd6d5b48fe922a5b010.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 5461c6625f2961ec21541604c9043c688aa176e0 Author: Ram Pai Date: Thu Jun 4 16:51:41 2020 -0700 selftests/vm/pkeys: move generic definitions to header file Moved all the generic definition and helper functions to the header file. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/57177f99e92a51295956715d5f2d5688a4d13927.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit c4273c7f0ec34f7ab94332bf8279f19c04feca73 Author: Ram Pai Date: Thu Jun 4 16:51:37 2020 -0700 selftests/vm/pkeys: rename all references to pkru to a generic name This renames PKRU references to "pkey_reg" or "pkey" based on the usage. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Reviewed-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: "Aneesh Kumar K.V" Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Suchanek Cc: Shuah Khan Link: http://lkml.kernel.org/r/2c6970bc6d2e99796cd5cc1101bd2ecf7eccb937.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 804eb64615a405b3765fb3618bc07d7d95809add Author: Ram Pai Date: Thu Jun 4 16:51:34 2020 -0700 selftests/x86/pkeys: move selftests to arch-neutral directory Patch series "selftests, powerpc, x86: Memory Protection Keys", v19. Memory protection keys enables an application to protect its address space from inadvertent access by its own code. This feature is now enabled on powerpc and has been available since 4.16-rc1. The patches move the selftests to arch neutral directory and enhance their test coverage. Tested on powerpc64 and x86_64 (Skylake-SP). This patch (of 24): Move selftest files from tools/testing/selftests/x86/ to tools/testing/selftests/vm/. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Ingo Molnar Acked-by: Dave Hansen Cc: Dave Hansen Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Michal Hocko Cc: "Aneesh Kumar K.V" Cc: Michal Suchanek Cc: Michael Ellerman Cc: Shuah Khan Link: http://lkml.kernel.org/r/14d25194c3e2e652e0047feec4487e269e76e8c9.1585646528.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 341a7213e5c1ce274cc0f02270054905800ea660 Author: Pengcheng Yang Date: Thu Jun 4 16:51:30 2020 -0700 kernel/relay.c: fix read_pos error when multiple readers When reading, read_pos should start with bytes_consumed, not file->f_pos. Because when there is more than one reader, the read_pos corresponding to file->f_pos may have been consumed, which will cause the data that has been consumed to be read and the bytes_consumed update error. Signed-off-by: Pengcheng Yang Signed-off-by: Andrew Morton Reviewed-by: Jens Axboe Cc: Greg Kroah-Hartman Cc: Jann Horn Cc: Al Viro e Link: http://lkml.kernel.org/r/1579691175-28949-1-git-send-email-yangpc@wangsu.com Signed-off-by: Linus Torvalds commit 54e200ab40fc14c863bcc80a51e20b7906608fce Author: Daniel Axtens Date: Thu Jun 4 16:51:27 2020 -0700 kernel/relay.c: handle alloc_percpu returning NULL in relay_open alloc_percpu() may return NULL, which means chan->buf may be set to NULL. In that case, when we do *per_cpu_ptr(chan->buf, ...), we dereference an invalid pointer: BUG: Unable to handle kernel data access at 0x7dae0000 Faulting instruction address: 0xc0000000003f3fec ... NIP relay_open+0x29c/0x600 LR relay_open+0x270/0x600 Call Trace: relay_open+0x264/0x600 (unreliable) __blk_trace_setup+0x254/0x600 blk_trace_setup+0x68/0xa0 sg_ioctl+0x7bc/0x2e80 do_vfs_ioctl+0x13c/0x1300 ksys_ioctl+0x94/0x130 sys_ioctl+0x48/0xb0 system_call+0x5c/0x68 Check if alloc_percpu returns NULL. This was found by syzkaller both on x86 and powerpc, and the reproducer it found on powerpc is capable of hitting the issue as an unprivileged user. Fixes: 017c59c042d0 ("relay: Use per CPU constructs for the relay channel buffer pointers") Reported-by: syzbot+1e925b4b836afe85a1c6@syzkaller-ppc64.appspotmail.com Reported-by: syzbot+587b2421926808309d21@syzkaller-ppc64.appspotmail.com Reported-by: syzbot+58320b7171734bf79d26@syzkaller.appspotmail.com Reported-by: syzbot+d6074fb08bdb2e010520@syzkaller.appspotmail.com Signed-off-by: Daniel Axtens Signed-off-by: Andrew Morton Reviewed-by: Michael Ellerman Reviewed-by: Andrew Donnellan Acked-by: David Rientjes Cc: Akash Goel Cc: Andrew Donnellan Cc: Guenter Roeck Cc: Salvatore Bonaccorso Cc: [4.10+] Link: http://lkml.kernel.org/r/20191219121256.26480-1-dja@axtens.net Signed-off-by: Linus Torvalds commit 67446283d89467edae5ad9f632ee31f0fbae35fe Author: John Hubbard Date: Thu Jun 4 16:51:24 2020 -0700 rapidio: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages_fast(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages_fast() + put_page() calls to pin_user_pages_fast() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Cc: Matt Porter Cc: Alexandre Bounine Cc: Sumit Semwal Cc: Dan Carpenter Link: http://lkml.kernel.org/r/20200517235620.205225-3-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit e1c3cdb26ab881b77486dc50370356a349077c74 Author: Madhuparna Bhowmik Date: Thu Jun 4 16:51:21 2020 -0700 rapidio: avoid data race between file operation callbacks and mport_cdev_add(). Fields of md(mport_dev) are set after cdev_device_add(). However, the file operation callbacks can be called after cdev_device_add() and therefore accesses to fields of md in the callbacks can race with the rest of the mport_cdev_add() function. One such example is INIT_LIST_HEAD(&md->portwrites) in mport_cdev_add(), the list is initialised after cdev_device_add(). This can race with list_add_tail(&pw_filter->md_node,&md->portwrites) in rio_mport_add_pw_filter() which is called by unlocked_ioctl. To avoid such data races use cdev_device_add() after initializing md. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Madhuparna Bhowmik Signed-off-by: Andrew Morton Acked-by: Alexandre Bounine Cc: Matt Porter Cc: Dan Carpenter Cc: Mike Marshall Cc: Thomas Gleixner Cc: Ira Weiny Cc: Allison Randal Cc: Pavel Andrianov Link: http://lkml.kernel.org/r/20200426112950.1803-1-madhuparnabhowmik10@gmail.com Signed-off-by: Linus Torvalds commit 762a3af6faa0682e5b30b67b1db156c7df55f2c7 Author: Christoph Hellwig Date: Thu Jun 4 16:51:18 2020 -0700 exec: open code copy_string_kernel Currently copy_string_kernel is just a wrapper around copy_strings that simplifies the calling conventions and uses set_fs to allow passing a kernel pointer. But due to the fact the we only need to handle a single kernel argument pointer, the logic can be sigificantly simplified while getting rid of the set_fs. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexander Viro Link: http://lkml.kernel.org/r/20200501104105.2621149-3-hch@lst.de Signed-off-by: Linus Torvalds commit 986db2d14a6dca6456b63b4f5c410ae2aab4ec9d Author: Christoph Hellwig Date: Thu Jun 4 16:51:14 2020 -0700 exec: simplify the copy_strings_kernel calling convention copy_strings_kernel is always used with a single argument, adjust the calling convention to that. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Alexander Viro Link: http://lkml.kernel.org/r/20200501104105.2621149-2-hch@lst.de Signed-off-by: Linus Torvalds commit eac2cece45074e372f78a459c7bb2d7207b72736 Author: Kefeng Wang Date: Thu Jun 4 16:51:11 2020 -0700 kernel/kprobes.c: convert to use DEFINE_SEQ_ATTRIBUTE macro Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Kefeng Wang Signed-off-by: Andrew Morton Cc: Anil S Keshavamurthy Cc: "David S. Miller" Cc: Masami Hiramatsu Cc: Greg KH Cc: Ingo Molnar Cc: Al Viro Link: http://lkml.kernel.org/r/20200509064031.181091-4-wangkefeng.wang@huawei.com Signed-off-by: Linus Torvalds commit 01a995600275779d7b06c3b82fd50f6cb50c601c Author: Kefeng Wang Date: Thu Jun 4 16:51:08 2020 -0700 mm/vmstat.c: convert to use DEFINE_SEQ_ATTRIBUTE macro Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Kefeng Wang Signed-off-by: Andrew Morton Cc: Anil S Keshavamurthy Cc: "David S. Miller" Cc: Greg KH Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Al Viro Link: http://lkml.kernel.org/r/20200509064031.181091-3-wangkefeng.wang@huawei.com Signed-off-by: Linus Torvalds commit d2c0e6e91c7990c67921005f44f9b2b326ff2906 Author: Kefeng Wang Date: Thu Jun 4 16:51:05 2020 -0700 include/linux/seq_file.h: introduce DEFINE_SEQ_ATTRIBUTE() helper macro Patch series "seq_file: Introduce DEFINE_SEQ_ATTRIBUTE() helper macro". As discussed in https://lore.kernel.org/lkml/20191129222310.GA3712618@kroah.com/, we could introduce a new helper macro to reduce losts of boilerplate code, vmstat and kprobes is the example which covert to use it, if this is accepted, I will send out more cleanups. This patch (of 3): Introduce DEFINE_SEQ_ATTRIBUTE() helper macro to decrease code duplication. [akpm@linux-foundation.org: coding style fixes] Signed-off-by: Kefeng Wang Signed-off-by: Andrew Morton Cc: Greg KH Cc: Ingo Molnar Cc: Kefeng Wang Cc: Anil S Keshavamurthy Cc: "David S. Miller" Cc: Masami Hiramatsu Cc: Al Viro Link: http://lkml.kernel.org/r/20200509064031.181091-1-wangkefeng.wang@huawei.com Link: http://lkml.kernel.org/r/20200509064031.181091-2-wangkefeng.wang@huawei.com Signed-off-by: Linus Torvalds commit a3963015787d0a3bd9c2d91b62de5ca70413dc3b Author: Joe Perches Date: Thu Jun 4 16:51:02 2020 -0700 fs/seq_file.c: seq_read: Update pr_info_ratelimited Use a more common logging style. Add and use pr_fmt, coalesce the format string, align arguments, use better grammar. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Cc: Vasily Averin Link: http://lkml.kernel.org/r/96ff603230ca1bd60034c36519be3930c3a3a226.camel@perches.com Signed-off-by: Linus Torvalds commit 898310032b96c198014a8bbace0fd26259b2db77 Author: OGAWA Hirofumi Date: Thu Jun 4 16:50:59 2020 -0700 fat: improve the readahead for FAT entries Current readahead for FAT entries is very simple but is having some flaws, so it is not working well for some environments. This patch improves the readahead more or less. The key points of modification are, - make the readahead size tunable by using bdi->ra_pages - care the bdi->io_pages to avoid the small size I/O request - update readahead window before fully exhausting With this patch, on slow USB connected 2TB hdd: [before] 383.18sec [after] 51.03sec Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Tested-by: hyeongseok.kim Reviewed-by: hyeongseok.kim Link: http://lkml.kernel.org/r/87d08e1dlh.fsf@mail.parknet.co.jp Signed-off-by: Linus Torvalds commit b1b65750b8db67834482f758fc385bfa7560d228 Author: OGAWA Hirofumi Date: Thu Jun 4 16:50:56 2020 -0700 fat: don't allow to mount if the FAT length == 0 If FAT length == 0, the image doesn't have any data. And it can be the cause of overlapping the root dir and FAT entries. Also Windows treats it as invalid format. Reported-by: syzbot+6f1624f937d9d6911e2d@syzkaller.appspotmail.com Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Cc: Marco Elver Cc: Dmitry Vyukov Link: http://lkml.kernel.org/r/87r1wz8mrd.fsf@mail.parknet.co.jp Signed-off-by: Linus Torvalds commit ada4ab7af1a67db7eb8596709071a97afb2bf7de Author: Chris Down Date: Thu Jun 4 16:50:53 2020 -0700 init: allow distribution configuration of default init Some init systems (eg. systemd) have init at their own paths, for example, /usr/lib/systemd/systemd. A compatibility symlink to one of the hardcoded init paths is provided by another package, usually named something like systemd-sysvcompat or similar. Currently distro maintainers who are hands-off on the bootloader are more or less required to include those compatibility links as part of their base distribution, because it's hard to migrate away from them since there's a risk some users will not get the message to set init= on the kernel command line appropriately. Moreover, for distributions where the init system is something the distribution itself is opinionated about (eg. Arch, which has systemd in the required `base` package), we could usually reasonably configure this ahead of time when building the distribution kernel. However, we currently simply don't have any way to configure the kernel to do this. Here's an example discussion where removing sysvcompat was discussed by distro maintainers[0]. This patch adds a new Kconfig tunable, CONFIG_DEFAULT_INIT, which if set is tried before the hardcoded fallback list. So the order of precedence is now thus: 1. init= on command line (on failure: panic) 2. CONFIG_DEFAULT_INIT (on failure: try #3) 3. Hardcoded fallback list (on failure: panic) This new config parameter will allow distribution maintainers to move away from these compatibility links safely, without having to worry that their users might not have the right init=. There are also two other benefits of this over having the distribution maintain a symlink: 1. One of the value propositions over simply having distributions maintain a /sbin/init symlink via a package is that it also frees distributions which have a preferred default, but not mandatory, init system from having their package manager fight with their users for control of /{s,}bin/init. Instead, the distribution simply makes their preference known in CONFIG_DEFAULT_INIT, and if the user installs another init system and uninstalls the default one they can still make use of /{s,}bin/init and friends for their own uses. This makes more cases Just Work(tm) without the user having to perform extra configuration via init=. 2. Since before this we don't know which path the distribution actually _intends_ to serve init from, we don't pr_err if it is simply missing, and usually will just silently put the user in a /bin/sh shell. Now that the distribution can make a declaration of intent, we can be more vocal when this init system fails to launch for any reason, even if it's simply because no file exists at that location, speeding up the palaver of init/mount dependency/etc debugging a bit. [0]: https://lists.archlinux.org/pipermail/arch-dev-public/2019-January/029435.html Signed-off-by: Chris Down Signed-off-by: Andrew Morton Cc: Greg Kroah-Hartman Cc: Masami Hiramatsu Link: http://lkml.kernel.org/r/20200522160234.GA1487022@chrisdown.name Signed-off-by: Linus Torvalds commit 51da9dfb7f20911ae4e79e9b412a9c2d4c373d4b Author: Nick Desaulniers Date: Thu Jun 4 16:50:49 2020 -0700 elfnote: mark all .note sections SHF_ALLOC ELFNOTE_START allows callers to specify flags for .pushsection assembler directives. All callsites but ELF_NOTE use "a" for SHF_ALLOC. For vdso's that explicitly use ELF_NOTE_START and BUILD_SALT, the same section is specified twice after preprocessing, once with "a" flag, once without. Example: .pushsection .note.Linux, "a", @note ; .pushsection .note.Linux, "", @note ; While GNU as allows this ordering, it warns for the opposite ordering, making these directives position dependent. We'd prefer not to precisely match this behavior in Clang's integrated assembler. Instead, the non __ASSEMBLY__ definition of ELF_NOTE uses __attribute__((section(".note.Linux"))) which is created with SHF_ALLOC, so let's make the __ASSEMBLY__ definition of ELF_NOTE consistent with C and just always use "a" flag. This allows Clang to assemble a working mainline (5.6) kernel via: $ make CC=clang AS=clang Signed-off-by: Nick Desaulniers Signed-off-by: Andrew Morton Reviewed-by: Nathan Chancellor Reviewed-by: Fangrui Song Cc: Jeremy Fitzhardinge Cc: Thomas Gleixner Cc: Vincenzo Frascino Link: https://github.com/ClangBuiltLinux/linux/issues/913 Link: http://lkml.kernel.org/r/20200325231250.99205-1-ndesaulniers@google.com Debugged-by: Ilie Halip Signed-off-by: Linus Torvalds commit 852991dd3a7374a15b21b904117272f57939463c Author: Anthony Iliopoulos Date: Thu Jun 4 16:50:46 2020 -0700 fs/binfmt_elf: remove redundant elf_map ifndef The ifndef was added a long time ago to support archs that would define their own mapping function. The last user was the metag arch which was removed from the tree, and as such there are no users left. Let's kill it. Signed-off-by: Anthony Iliopoulos Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200402161543.4119-1-ailiop@suse.com Signed-off-by: Linus Torvalds commit c7f574d0e9f9e8c3655b6bb06e69e37d341956d3 Author: Geert Uytterhoeven Date: Thu Jun 4 16:50:43 2020 -0700 checkpatch: use patch subject when reading from stdin While "git am" can apply an mbox file containing multiple patches (e.g. as created by b4[1], or a patch bundle downloaded from patchwork), checkpatch does not have proper support for that. When operating on an mbox, checkpatch will merge all detected tags, and complain falsely about duplicates: WARNING: Duplicate signature As modifying checkpatch to reset state in between each patch is a lot of work, a simple solution is splitting the mbox into individual patches, and invoking checkpatch for each of them. Fortunately checkpatch can read a patch from stdin, so the classic "formail" tool can be used to split the mbox, and pipe all individual patches to checkpatch: formail -s scripts/checkpatch.pl < my-mbox However, when reading a patch file from standard input, checkpatch calls it "Your patch", and reports its state as: Your patch has style problems, please review. or: Your patch has no obvious style problems and is ready for submission. Hence it can be difficult to identify which patches need to be reviewed and improved. Fix this by replacing "Your patch" by (the first line of) the email subject, if present. Note that "git mailsplit" can also be used to split an mbox, but it will create individual files for each patch, thus requiring cleanup afterwards. Formail does not have this disadvantage. [1] https://git.kernel.org/pub/scm/utils/b4/b4.git [joe@perches.com: reduce cpu usage] Link: http://lkml.kernel.org/r/c9d89bb24c7414142414c60371e210fdcf4617d2.camel@perches.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Andrew Morton Cc: Joe Perches Cc: Konstantin Ryabitsev Link: http://lkml.kernel.org/r/20200505132613.17452-1-geert+renesas@glider.be Signed-off-by: Linus Torvalds commit 32f30ca9f19df77eced0ec029ce9dcfb24ff045b Author: Joe Perches Date: Thu Jun 4 16:50:40 2020 -0700 checkpatch: disallow --git and --file/--fix Don't allow these options to be combined. Miscellanea: o Add missing $P: to some die("reason message") output Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/3dc7bdaa58490f5906efc11a4d6113e42a087723.camel@perches.com Signed-off-by: Linus Torvalds commit a55ee0cc09a4e3ee6c4443afdbff53639672178f Author: Joe Perches Date: Thu Jun 4 16:50:36 2020 -0700 checkpatch: look for c99 comments in ctx_locate_comment Some checks look for comments around a specific function like read_barrier_depends. Extend the check to support both c89 and c90 comment styles. c89 /* comment */ or c99 // comment For c99 comments, only look a 3 single lines, the line being scanned, the line above and the line below the line being scanned rather than the patch diff context. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Tested-by: Paul E. McKenney Cc: Marco Elver Cc: Dmitry Vyukov Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andy Whitcroft Cc: Will Deacon Link: http://lkml.kernel.org/r/65cb075435d2f385a53c77571b491b2b09faaf8e.camel@perches.com Signed-off-by: Linus Torvalds commit 7ccf41a89cb0c178dca31bce4836b8fed2694d71 Author: Joe Perches Date: Thu Jun 4 16:50:33 2020 -0700 checkpatch: additional MAINTAINER section entry ordering checks There is a preferred order for the entries in MAINTAINERS sections. See commits 3b50142d8528 ("MAINTAINERS: sort field names for all entries") and 6680125ea5a2 ("MAINTAINERS: list the section entries in the preferred order") Add checkpatch tests to try to keep that ordering. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Acked-by: Andy Shevchenko Link: http://lkml.kernel.org/r/17677130b3ca62d79817e6a22546bad39d7e81b4.camel@perches.com Signed-off-by: Linus Torvalds commit bd93f003b7462ae39a43c531abca37fe7073b866 Author: Arnd Bergmann Date: Thu Jun 4 16:50:30 2020 -0700 include/linux/bitops.h: avoid clang shift-count-overflow warnings Clang normally does not warn about certain issues in inline functions when it only happens in an eliminated code path. However if something else goes wrong, it does tend to complain about the definition of hweight_long() on 32-bit targets: include/linux/bitops.h:75:41: error: shift count >= width of type [-Werror,-Wshift-count-overflow] return sizeof(w) == 4 ? hweight32(w) : hweight64(w); ^~~~~~~~~~~~ include/asm-generic/bitops/const_hweight.h:29:49: note: expanded from macro 'hweight64' define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w)) ^~~~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/const_hweight.h:21:76: note: expanded from macro '__const_hweight64' define __const_hweight64(w) (__const_hweight32(w) + __const_hweight32((w) >> 32)) ^ ~~ include/asm-generic/bitops/const_hweight.h:20:49: note: expanded from macro '__const_hweight32' define __const_hweight32(w) (__const_hweight16(w) + __const_hweight16((w) >> 16)) ^ include/asm-generic/bitops/const_hweight.h:19:72: note: expanded from macro '__const_hweight16' define __const_hweight16(w) (__const_hweight8(w) + __const_hweight8((w) >> 8 )) ^ include/asm-generic/bitops/const_hweight.h:12:9: note: expanded from macro '__const_hweight8' (!!((w) & (1ULL << 2))) + \ Adding an explicit cast to __u64 avoids that warning and makes it easier to read other output. Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton Acked-by: Christian Brauner Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Josh Poimboeuf Cc: Nick Desaulniers Link: http://lkml.kernel.org/r/20200505135513.65265-1-arnd@arndb.de Signed-off-by: Linus Torvalds commit c348c16305280fe3e6c1186378f96c8634c149f9 Author: Jesse Brandeburg Date: Thu Jun 4 16:50:27 2020 -0700 lib: make a test module with set/clear bit Test some bit clears/sets to make sure assembly doesn't change, and that the set_bit and clear_bit functions work and don't cause sparse warnings. Instruct Kbuild to build this file with extra warning level -Wextra, to catch new issues, and also doesn't hurt to build with C=1. This was used to test changes to arch/x86/include/asm/bitops.h. In particular, sparse (C=1) was very concerned when the last bit before a natural boundary, like 7, or 31, was being tested, as this causes sign extension (0xffffff7f) for instance when clearing bit 7. Recommended usage: make defconfig scripts/config -m CONFIG_TEST_BITOPS make modules_prepare make C=1 W=1 lib/test_bitops.ko objdump -S -d lib/test_bitops.ko insmod lib/test_bitops.ko rmmod lib/test_bitops.ko , there should be no compiler/sparse warnings and no error messages in log. Link: http://lkml.kernel.org/r/20200310221747.2848474-2-jesse.brandeburg@intel.com Signed-off-by: Jesse Brandeburg Reviewed-by: Andy Shevchenko Cc: Thomas Gleixner CcL Ingo Molnar Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: Rasmus Villemoes Cc: Dan Williams Cc: Peter Zijlstra Cc: Wei Yang Cc: Christian Brauner Signed-off-by: Linus Torvalds commit 63d7f8167fe65891617d5eca6314eca46029955c Author: Tan Hu Date: Thu Jun 4 16:50:23 2020 -0700 lib/flex_proportions.c: cleanup __fprop_inc_percpu_max If the given type has fraction smaller than max_frac/FPROP_FRAC_BASE, the code could be modified to call __fprop_inc_percpu() directly and easier to understand. After this patch, fprop_reflect_period_percpu() will be called twice, and quicky return on pl->period == p->period test, so it would not result to significant downside of performance. Thanks for Jan's guidance. Signed-off-by: Tan Hu Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Cc: Cc: Yi Wang Cc: Link: http://lkml.kernel.org/r/1589004753-27554-1-git-send-email-tan.hu@zte.com.cn Signed-off-by: Linus Torvalds commit a818e526cb4e5f8b06f4d648b88b269fbdd85bdd Author: Joe Perches Date: Thu Jun 4 16:50:20 2020 -0700 lib/percpu-refcount.c: use a more common logging style Remove the trailing newline from the used-once pr_fmt and add it to the single use of pr_ in this code to use a more common logging style. Miscellanea: o Use %lu in the pr_debug format and remove the unnecessary cast Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Cc: Christophe JAILLET Link: http://lkml.kernel.org/r/47372467902a047c03b0fd29aab56e0c38d3f848.camel@perches.com Signed-off-by: Linus Torvalds commit acaab7335bd6f0c0b54ce3a00bd7f18222ce0f5f Author: Jann Horn Date: Thu Jun 4 16:50:17 2020 -0700 lib/zlib: remove outdated and incorrect pre-increment optimization The zlib inflate code has an old micro-optimization based on the assumption that for pre-increment memory accesses, the compiler will generate code that fits better into the processor's pipeline than what would be generated for post-increment memory accesses. This optimization was already removed in upstream zlib in 2016: https://github.com/madler/zlib/commit/9aaec95e8211 This optimization causes UB according to C99, which says in section 6.5.6 "Additive operators": "If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is undefined". This UB is not only a theoretical concern, but can also cause trouble for future work on compiler-based sanitizers. According to the zlib commit, this optimization also is not optimal anymore with modern compilers. Replace uses of OFF, PUP and UP_UNALIGNED with their definitions in the POSTINC case, and remove the macro definitions, just like in the upstream patch. Signed-off-by: Jann Horn Signed-off-by: Andrew Morton Cc: Mikhail Zaslonko Link: http://lkml.kernel.org/r/20200507123112.252723-1-jannh@google.com Signed-off-by: Linus Torvalds commit 02223e36f315be7e647aa4fbb09a8f8b5a2fa43e Author: Jason Yan Date: Thu Jun 4 16:50:14 2020 -0700 lib/test_lockup.c: make test_inode static Fix the following sparse warning: lib/test_lockup.c:145:14: warning: symbol 'test_inode' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200417074021.46411-1-yanaijie@huawei.com Signed-off-by: Linus Torvalds commit 07887358993d48571f0f3a25cfce715564b35587 Author: KP Singh Date: Thu Jun 4 16:50:11 2020 -0700 lib: Add might_fault() to strncpy_from_user. When updating a piece of broken logic from using get_user to strncpy_from_user, we noticed that a warning which is expected when calling a function that might fault from an atomic context with pagefaults enabled disappeared. Not having this warning in place can lead to calling strncpy_from_user from an atomic context and eventually kernel crashes/stack corruption. Signed-off-by: KP Singh Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Jann Horn Cc: Christophe Leroy Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20200414225705.255711-1-kpsingh@chromium.org Signed-off-by: Linus Torvalds commit 9ac17575804024fb3d5692cad7afc08929bab981 Author: Christophe JAILLET Date: Thu Jun 4 16:50:08 2020 -0700 lib/math: avoid trailing newline hidden in pr_fmt() pr_xxx() functions usually have a newline at the end of the logging message. Here, this newline is added via the 'pr_fmt' macro. In order to be more consistent with other files, use a more standard convention and put these newlines back in the messages themselves and remove it from the pr_fmt macro. While at it, use __func__ instead of hardcoding a function name in the last message. Signed-off-by: Christophe JAILLET Signed-off-by: Andrew Morton Reviewed-by: Andy Shevchenko Cc: Mauro Carvalho Chehab Cc: Andrew Morton Cc: Greg Kroah-Hartman Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200409163234.22830-1-christophe.jaillet@wanadoo.fr Signed-off-by: Linus Torvalds commit e33c9fe8b80ca86392a35ffff81fbfb6a54d2d22 Author: Joe Perches Date: Thu Jun 4 16:50:04 2020 -0700 get_maintainer: fix unexpected behavior for path/to//file (double slashes) get_maintainer behaves differently if there is a double sequential forward slash in a filename because the total number of slashes in a filename is used to match MAINTAINERS file patterns. For example: (with double slash) $ ./scripts/get_maintainer.pl -f drivers/gpu/drm//lima David Airlie (maintainer:DRM DRIVERS) Daniel Vetter (maintainer:DRM DRIVERS,commit_signer:3/42=7%) Qiang Yu (commit_signer:36/42=86%,authored:24/42=57%) Vasily Khoruzhick (commit_signer:26/42=62%) Krzysztof Kozlowski (commit_signer:5/42=12%,authored:5/42=12%) Emil Velikov (commit_signer:4/42=10%) dri-devel@lists.freedesktop.org (open list:DRM DRIVERS) linux-kernel@vger.kernel.org (open list) (without double slash) $ ./scripts/get_maintainer.pl -f drivers/gpu/drm/lima Qiang Yu (maintainer:DRM DRIVERS FOR LIMA) David Airlie (maintainer:DRM DRIVERS) Daniel Vetter (maintainer:DRM DRIVERS) dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR LIMA) lima@lists.freedesktop.org (moderated list:DRM DRIVERS FOR LIMA) linux-kernel@vger.kernel.org (open list) So reduce consecutive double slashes to a single slash by using File::Spec->canonpath(). from: https://perldoc.perl.org/File/Spec/Unix.html canonpath() No physical check on the filesystem, but a logical cleanup of a path. On UNIX eliminates successive slashes and successive "/.". Reported-by: Emil Velikov Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/9a18b611813bb409fef15bc8927adab79eb9be43.camel@perches.com Signed-off-by: Linus Torvalds commit 0c78c013762142bfe8fce34e7e968f83f0a4b891 Author: Joe Perches Date: Thu Jun 4 16:50:01 2020 -0700 get_maintainer: add email addresses from .yaml files .yaml files can contain maintainer/author addresses and it seems unlikely or unnecessary that individual MAINTAINER file section entries for each .yaml file will be created. So add the email addresses found in .yaml files to the default get_maintainer output. The email addresses are marked with "(in file)" when using the "--roles" or "--rolestats" options. Miscellanea: o Change $file_emails to $email_file_emails to avoid visual naming conflicts with @file_emails Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Tested-by: Sam Ravnborg Acked-by: Sam Ravnborg Link: http://lkml.kernel.org/r/e85006456d9dbae55286c67ac5263668a72f5b58.1588022228.git.joe@perches.com Signed-off-by: Linus Torvalds commit de83dbd97f173650a602c5e356025b732173ecc4 Author: Jason Yan Date: Thu Jun 4 16:49:58 2020 -0700 user.c: make uidhash_table static Fix the following sparse warning: kernel/user.c:85:19: warning: symbol 'uidhash_table' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Andrew Morton Cc: David Howells Cc: Greg Kroah-Hartman Cc: Rasmus Villemoes Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200413082146.22737-1-yanaijie@huawei.com Signed-off-by: Linus Torvalds commit 8977a27b663ebb3bc745a1e7f91b2927b4522861 Author: Alexey Dobriyan Date: Thu Jun 4 16:49:55 2020 -0700 proc: rename "catch" function argument "catch" is reserved keyword in C++, rename it to something both gcc and g++ accept. Rename "ign" for symmetry. Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200331210905.GA31680@avx2 Signed-off-by: Linus Torvalds commit 276aa42e9ff3a9dcea6a91d515916c653c5f9c6d Author: Andy Shevchenko Date: Thu Jun 4 16:49:52 2020 -0700 zcomp: Use ARRAY_SIZE() for backends list Instead of keeping NULL terminated array switch to use ARRAY_SIZE() which helps to further clean up. Signed-off-by: Andy Shevchenko Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Acked-by: Minchan Kim Cc: Sergey Senozhatsky Cc: Jens Axboe Cc: Andy Shevchenko Link: http://lkml.kernel.org/r/20200508100758.51644-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Torvalds commit 2b7874490243e014112100925405c4a17a8c40aa Author: Jason Yan Date: Thu Jun 4 16:49:49 2020 -0700 include/linux/mm.h: return true in cpupid_pid_unset() Fix the following coccicheck warning: include/linux/mm.h:1371:8-9: WARNING: return of 0/1 in function 'cpupid_pid_unset' with return type bool Signed-off-by: Jason Yan Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200422071816.48879-1-yanaijie@huawei.com Signed-off-by: Linus Torvalds commit fa1f68cc88f1dce6b7bb37628eb7c25c96593183 Author: Zou Wei Date: Thu Jun 4 16:49:46 2020 -0700 mm: use false for bool variable Fixes coccicheck warnings: mm/zbud.c:246:1-20: WARNING: Assignment of 0/1 to bool variable mm/mremap.c:777:2-8: WARNING: Assignment of 0/1 to bool variable mm/huge_memory.c:525:9-10: WARNING: return of 0/1 in function 'is_transparent_hugepage' with return type bool Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/1586835930-47076-1-git-send-email-zou_wei@huawei.com Signed-off-by: Linus Torvalds commit 985ba004be29b857f3475eea961af5ac6ea5fa4d Author: Ethon Paul Date: Thu Jun 4 16:49:43 2020 -0700 mm/memory: fix a typo in comment "attampt"->"attempt" There is a comment in typo, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200411004043.14686-1-ethp@qq.com Signed-off-by: Linus Torvalds commit e0857cf5ac107b663f1b43ac8e02fdcd9284ad72 Author: Ethon Paul Date: Thu Jun 4 16:49:40 2020 -0700 mm/page-writeback: fix a typo in comment "effictive"->"effective" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200411003513.14613-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 2e6787d380620e87b7d0ccbc0e52f7024a49efd1 Author: Ethon Paul Date: Thu Jun 4 16:49:37 2020 -0700 mm/sparse: fix a typo in comment "convienence"->"convenience" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200411002955.14545-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 0d645ed19cf9452827d69b733beeff58ed32ea56 Author: Ethon Paul Date: Thu Jun 4 16:49:34 2020 -0700 mm/slub: fix a typo in comment "disambiguiation"->"disambiguation" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Acked-by: David Rientjes Link: http://lkml.kernel.org/r/20200411002247.14468-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 68956ccb6ca96bd8873c1a0d30d9749094090922 Author: Ethon Paul Date: Thu Jun 4 16:49:31 2020 -0700 mm: fix a typo in comment "strucure"->"structure" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200411064723.15855-1-ethp@qq.com Signed-off-by: Linus Torvalds commit b8f2935f72448940b1ea8f5caf7fa984a4775fbc Author: Ethon Paul Date: Thu Jun 4 16:49:28 2020 -0700 mm, memcg: fix some typos in memcontrol.c There are some typos in comment, fix them. s/responsiblity/responsibility s/oflline/offline Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200411064246.15781-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 404f3ecfd86b14c2087901f11360d70bea05523e Author: Ethon Paul Date: Thu Jun 4 16:49:25 2020 -0700 mm/frontswap: fix some typos in frontswap.c There are some typos in comment, fix them. s/Fortunatly/Fortunately s/taked/taken s/necessory/necessary s/shink/shrink Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200411064009.15727-1-ethp@qq.com Signed-off-by: Linus Torvalds commit ffceeb62fce4b819f295bc724b413d62364f8d16 Author: Ethon Paul Date: Thu Jun 4 16:49:22 2020 -0700 mm/filemap: fix a typo in comment "unneccssary"->"unnecessary" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200411065141.15936-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 3dc5f032c4baae1b41977fab649c104015e3dcff Author: Ethon Paul Date: Thu Jun 4 16:49:19 2020 -0700 mm/list_lru: fix a typo in comment "numbesr"->"numbers" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200411071041.16161-1-ethp@qq.com Signed-off-by: Linus Torvalds commit df1758d9f28539091b9b9636b8485697b043b80b Author: Ethon Paul Date: Thu Jun 4 16:49:16 2020 -0700 mm/memblock: fix a typo in comment "implict"->"implicit" There is a typo in commet, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200411070701.16097-1-ethp@qq.com Signed-off-by: Linus Torvalds commit f386775510bf35d8ad28ad77e8d82524957abde7 Author: Ethon Paul Date: Thu Jun 4 16:49:13 2020 -0700 mm/compaction: fix a typo in comment "pessemistic"->"pessimistic" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200411070307.16021-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 55b65a57c2542165933611a7abb6e22b797acac0 Author: Ethon Paul Date: Thu Jun 4 16:49:10 2020 -0700 mm/vmsan: fix some typos in comment There are some typos, fix them. s/regsitration/registration s/santity/sanity s/decremeting/decrementing Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200411071544.16222-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 7c8de3588972eddc0b4fb6f71be470b12b171d9d Author: Ethon Paul Date: Thu Jun 4 16:49:07 2020 -0700 mm/hugetlb: fix a typos in comments [akpm@linux-foundation.org: coding style fixes] Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200410163714.14085-1-ethp@qq.com Signed-off-by: Linus Torvalds commit b4f315b40d43aec9234556ce678e3c3469cc838e Author: Ethon Paul Date: Thu Jun 4 16:49:04 2020 -0700 mm: mmap: fix a typo in comment "compatbility"->"compatibility" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200410163206.14016-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 457aef949de9efe9cf96a2452f1f372bc158f777 Author: Ethon Paul Date: Thu Jun 4 16:49:01 2020 -0700 mm: ksm: fix a typo in comment "alreaady"->"already" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200410162427.13927-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 52cfc24578c32aa4d604fcb38e081ed0eb4cfb5c Author: Ethon Paul Date: Thu Jun 4 16:48:58 2020 -0700 mm/memory_hotplug: fix a typo in comment "recoreded"->"recorded" There is a typo in comment, fix it. s/recoreded/recorded Signed-off-by: Ethon Paul Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Ralph Campbell Link: http://lkml.kernel.org/r/20200410160328.13843-1-ethp@qq.com Signed-off-by: Linus Torvalds commit 57e86fa16a707db9e05dec77eb88a398f05a022b Author: chenqiwu Date: Thu Jun 4 16:48:55 2020 -0700 mm: replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") [akpm@linux-foundation.org: fix build] Signed-off-by: chenqiwu Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Wei Yang Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Michal Hocko Cc: Pankaj Gupta Cc: Yang Shi Cc: Qian Cai Cc: Baoquan He Link: http://lkml.kernel.org/r/1586599916-15456-1-git-send-email-qiwuchen55@gmail.com Signed-off-by: Linus Torvalds commit b59d02ed086907e2d4ea3ecf0720f0cbd54a2601 Author: Michal Hocko Date: Thu Jun 4 16:48:51 2020 -0700 mm/memory_hotplug: disable the functionality for 32b Memory hotlug is broken for 32b systems at least since c6f03e2903c9 ("mm, memory_hotplug: remove zone restrictions") which has considerably reworked how can be memory associated with movable/kernel zones. The same is not really trivial to achieve in 32b where only lowmem is the kernel zone. While we can tweak this immediate problem around there are likely other land mines hidden at other places. It is also quite dubious that there is a real usecase for the memory hotplug on 32b in the first place. Low memory is just too small to be hotplugable (for hot add) and generally unusable for hotremove. Adding more memory to highmem is also dubious because it would increase the low mem or vmalloc space pressure for memmaps. Restrict the functionality to 64b systems. This will help future development to focus on usecases that have real life application. We can remove this restriction in future in presence of a real life usecase of course but until then make it explicit that hotplug on 32b is broken and requires a non trivial amount of work to fix. Robin said: "32-bit Arm doesn't support memory hotplug, and as far as I'm aware there's little likelihood of it ever wanting to. FWIW it looks like SuperH is the only pure-32-bit architecture to have hotplug support at all" Signed-off-by: Michal Hocko Signed-off-by: Andrew Morton Acked-by: David Hildenbrand Acked-by: Baoquan He Cc: Wei Yang Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Robin Murphy Cc: Vamshi K Sthambamkadi Link: http://lkml.kernel.org/r/20200218100532.GA4151@dhcp22.suse.cz Link: https://bugzilla.kernel.org/show_bug.cgi?id=206401 Signed-off-by: Linus Torvalds commit 8a725e4694b52ffad755500277d36f3b2eb34755 Author: David Hildenbrand Date: Thu Jun 4 16:48:48 2020 -0700 device-dax: add memory via add_memory_driver_managed() Currently, when adding memory, we create entries in /sys/firmware/memmap/ as "System RAM". This will lead to kexec-tools to add that memory to the fixed-up initial memmap for a kexec kernel (loaded via kexec_load()). The memory will be considered initial System RAM by the kexec'd kernel and can no longer be reconfigured. This is not what happens during a real reboot. Let's add our memory via add_memory_driver_managed() now, so we won't create entries in /sys/firmware/memmap/ and indicate the memory as "System RAM (kmem)" in /proc/iomem. This allows everybody (especially kexec-tools) to identify that this memory is special and has to be treated differently than ordinary (hotplugged) System RAM. Before configuring the namespace: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-33fffffff : namespace0.0 3280000000-32ffffffff : PCI Bus 0000:00 After configuring the namespace: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 148200000-33fffffff : dax0.0 3280000000-32ffffffff : PCI Bus 0000:00 After loading kmem before this change: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 150000000-33fffffff : dax0.0 150000000-33fffffff : System RAM 3280000000-32ffffffff : PCI Bus 0000:00 After loading kmem after this change: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 150000000-33fffffff : dax0.0 150000000-33fffffff : System RAM (kmem) 3280000000-32ffffffff : PCI Bus 0000:00 After a proper reboot: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 148200000-33fffffff : dax0.0 3280000000-32ffffffff : PCI Bus 0000:00 Within the kexec kernel before this change: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 150000000-33fffffff : System RAM 3280000000-32ffffffff : PCI Bus 0000:00 Within the kexec kernel after this change: [root@localhost ~]# cat /proc/iomem ... 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 148200000-33fffffff : dax0.0 3280000000-32ffffffff : PCI Bus 0000:00 /sys/firmware/memmap/ before this change: 0000000000000000-000000000009fc00 (System RAM) 000000000009fc00-00000000000a0000 (Reserved) 00000000000f0000-0000000000100000 (Reserved) 0000000000100000-00000000bffdf000 (System RAM) 00000000bffdf000-00000000c0000000 (Reserved) 00000000feffc000-00000000ff000000 (Reserved) 00000000fffc0000-0000000100000000 (Reserved) 0000000100000000-0000000140000000 (System RAM) 0000000150000000-0000000340000000 (System RAM) /sys/firmware/memmap/ after a proper reboot: 0000000000000000-000000000009fc00 (System RAM) 000000000009fc00-00000000000a0000 (Reserved) 00000000000f0000-0000000000100000 (Reserved) 0000000000100000-00000000bffdf000 (System RAM) 00000000bffdf000-00000000c0000000 (Reserved) 00000000feffc000-00000000ff000000 (Reserved) 00000000fffc0000-0000000100000000 (Reserved) 0000000100000000-0000000140000000 (System RAM) /sys/firmware/memmap/ after this change: 0000000000000000-000000000009fc00 (System RAM) 000000000009fc00-00000000000a0000 (Reserved) 00000000000f0000-0000000000100000 (Reserved) 0000000000100000-00000000bffdf000 (System RAM) 00000000bffdf000-00000000c0000000 (Reserved) 00000000feffc000-00000000ff000000 (Reserved) 00000000fffc0000-0000000100000000 (Reserved) 0000000100000000-0000000140000000 (System RAM) kexec-tools already seem to basically ignore any System RAM that's not on top level when searching for areas to place kexec images - but also for determining crash areas to dump via kdump. Changing the resource name won't have an impact. Handle unloading of the driver after memory hotremove failed properly, by duplicating the string if necessary. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Acked-by: Pankaj Gupta Cc: Michal Hocko Cc: Pankaj Gupta Cc: Wei Yang Cc: Baoquan He Cc: Dave Hansen Cc: Eric Biederman Cc: Pavel Tatashin Cc: Dan Williams Link: http://lkml.kernel.org/r/20200508084217.9160-5-david@redhat.com Signed-off-by: Linus Torvalds commit 3fe4f4991a2a818277445bd5b8b289305b7dd15d Author: David Hildenbrand Date: Thu Jun 4 16:48:44 2020 -0700 kexec_file: don't place kexec images on IORESOURCE_MEM_DRIVER_MANAGED Memory flagged with IORESOURCE_MEM_DRIVER_MANAGED is special - it won't be part of the initial memmap of the kexec kernel and not all memory might be accessible. Don't place any kexec images onto it. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Cc: Michal Hocko Cc: Pankaj Gupta Cc: Wei Yang Cc: Baoquan He Cc: Dave Hansen Cc: Eric Biederman Cc: Pavel Tatashin Cc: Dan Williams Link: http://lkml.kernel.org/r/20200508084217.9160-4-david@redhat.com Signed-off-by: Linus Torvalds commit 7b7b27214bba1966772f9213cd2d8e5d67f8487f Author: David Hildenbrand Date: Thu Jun 4 16:48:41 2020 -0700 mm/memory_hotplug: introduce add_memory_driver_managed() Patch series "mm/memory_hotplug: Interface to add driver-managed system ram", v4. kexec (via kexec_load()) can currently not properly handle memory added via dax/kmem, and will have similar issues with virtio-mem. kexec-tools will currently add all memory to the fixed-up initial firmware memmap. In case of dax/kmem, this means that - in contrast to a proper reboot - how that persistent memory will be used can no longer be configured by the kexec'd kernel. In case of virtio-mem it will be harmful, because that memory might contain inaccessible pieces that require coordination with hypervisor first. In both cases, we want to let the driver in the kexec'd kernel handle detecting and adding the memory, like during an ordinary reboot. Introduce add_memory_driver_managed(). More on the samentics are in patch #1. In the future, we might want to make this behavior configurable for dax/kmem- either by configuring it in the kernel (which would then also allow to configure kexec_file_load()) or in kexec-tools by also adding "System RAM (kmem)" memory from /proc/iomem to the fixed-up initial firmware memmap. More on the motivation can be found in [1] and [2]. [1] https://lkml.kernel.org/r/20200429160803.109056-1-david@redhat.com [2] https://lkml.kernel.org/r/20200430102908.10107-1-david@redhat.com This patch (of 3): Some device drivers rely on memory they managed to not get added to the initial (firmware) memmap as system RAM - so it's not used as initial system RAM by the kernel and the driver is under control. While this is the case during cold boot and after a reboot, kexec is not aware of that and might add such memory to the initial (firmware) memmap of the kexec kernel. We need ways to teach kernel and userspace that this system ram is different. For example, dax/kmem allows to decide at runtime if persistent memory is to be used as system ram. Another future user is virtio-mem, which has to coordinate with its hypervisor to deal with inaccessible parts within memory resources. We want to let users in the kernel (esp. kexec) but also user space (esp. kexec-tools) know that this memory has different semantics and needs to be handled differently: 1. Don't create entries in /sys/firmware/memmap/ 2. Name the memory resource "System RAM ($DRIVER)" (exposed via /proc/iomem) ($DRIVER might be "kmem", "virtio_mem"). 3. Flag the memory resource IORESOURCE_MEM_DRIVER_MANAGED /sys/firmware/memmap/ [1] represents the "raw firmware-provided memory map" because "on most architectures that firmware-provided memory map is modified afterwards by the kernel itself". The primary user is kexec on x86-64. Since commit d96ae5309165 ("memory-hotplug: create /sys/firmware/memmap entry for new memory"), we add all hotplugged memory to that firmware memmap - which makes perfect sense for traditional memory hotplug on x86-64, where real HW will also add hotplugged DIMMs to the firmware memmap. We replicate what the "raw firmware-provided memory map" looks like after hot(un)plug. To keep things simple, let the user provide the full resource name instead of only the driver name - this way, we don't have to manually allocate/craft strings for memory resources. Also use the resource name to make decisions, to avoid passing additional flags. In case the name isn't "System RAM", it's special. We don't have to worry about firmware_map_remove() on the removal path. If there is no entry, it will simply return with -EINVAL. We'll adapt dax/kmem in a follow-up patch. [1] https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-memmap Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Acked-by: Pankaj Gupta Cc: Michal Hocko Cc: Pankaj Gupta Cc: Wei Yang Cc: Baoquan He Cc: Dave Hansen Cc: Eric Biederman Cc: Pavel Tatashin Cc: Dan Williams Link: http://lkml.kernel.org/r/20200508084217.9160-1-david@redhat.com Link: http://lkml.kernel.org/r/20200508084217.9160-3-david@redhat.com Signed-off-by: Linus Torvalds commit 52219aeaf2dc6f7607704af2c40e3866fb04aed2 Author: David Hildenbrand Date: Thu Jun 4 16:48:38 2020 -0700 mm/memory_hotplug: handle memblocks only with CONFIG_ARCH_KEEP_MEMBLOCK The comment in add_memory_resource() is stale: hotadd_new_pgdat() will no longer call get_pfn_range_for_nid(), as a hotadded pgdat will simply span no pages at all, until memory is moved to the zone/node via move_pfn_range_to_zone() - e.g., when onlining memory blocks. The only archs that care about memblocks for hotplugged memory (either for iterating over all system RAM or testing for memory validity) are arm64, s390x, and powerpc - due to CONFIG_ARCH_KEEP_MEMBLOCK. Without CONFIG_ARCH_KEEP_MEMBLOCK, we can simply stop messing with memblocks. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Acked-by: Mike Rapoport Acked-by: Michal Hocko Cc: Michal Hocko Cc: Baoquan He Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Mike Rapoport Cc: Anshuman Khandual Link: http://lkml.kernel.org/r/20200422155353.25381-3-david@redhat.com Signed-off-by: Linus Torvalds commit c68ab18c6aee0397574afb418f6775f23379198e Author: David Hildenbrand Date: Thu Jun 4 16:48:35 2020 -0700 mm/memory_hotplug: set node_start_pfn of hotadded pgdat to 0 Patch series "mm/memory_hotplug: handle memblocks only with CONFIG_ARCH_KEEP_MEMBLOCK", v1. A hotadded node/pgdat will span no pages at all, until memory is moved to the zone/node via move_pfn_range_to_zone() -> resize_pgdat_range - e.g., when onlining memory blocks. We don't have to initialize the node_start_pfn to the memory we are adding. This patch (of 2): Especially, there is an inconsistency: - Hotplugging memory to a memory-less node with cpus: node_start_pf == 0 - Offlining and removing last memory from a node: node_start_pfn == 0 - Hotplugging memory to a memory-less node without cpus: node_start_pfn != 0 As soon as memory is onlined, node_start_pfn is overwritten with the actual start. E.g., when adding two DIMMs but only onlining one of both, only that DIMM (with online memory blocks) is spanned by the node. Currently, the validity of node_start_pfn really is linked to node_spanned_pages != 0. With node_spanned_pages == 0 (e.g., before onlining memory), it has no meaning. So let's stop setting node_start_pfn, just to be overwritten via move_pfn_range_to_zone(). This avoids confusion when looking at the code, wondering which magic will be performed with the node_start_pfn in this function, when hotadding a pgdat. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Acked-by: Pankaj Gupta Cc: Michal Hocko Cc: Baoquan He Cc: Oscar Salvador Cc: Pankaj Gupta Cc: Anshuman Khandual Cc: Mike Rapoport Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200422155353.25381-1-david@redhat.com Link: http://lkml.kernel.org/r/20200422155353.25381-2-david@redhat.com Signed-off-by: Linus Torvalds commit 04f3465c98665b7c5a3484d7194f1858954069f5 Author: David Hildenbrand Date: Thu Jun 4 16:48:31 2020 -0700 mm/memory_hotplug: remove is_mem_section_removable() Fortunately, all users of is_mem_section_removable() are gone. Get rid of it, including some now unnecessary functions. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Reviewed-by: Wei Yang Reviewed-by: Baoquan He Acked-by: Michal Hocko Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Oscar Salvador Link: http://lkml.kernel.org/r/20200407135416.24093-3-david@redhat.com Signed-off-by: Linus Torvalds commit ef1b51f7735e0988ea6bf99fd6eec4698e965b91 Author: David Hildenbrand Date: Thu Jun 4 16:48:28 2020 -0700 powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable() In commit 53cdc1cb29e8 ("drivers/base/memory.c: indicate all memory blocks as removable"), the user space interface to compute whether a memory block can be offlined (exposed via /sys/devices/system/memory/memoryX/removable) has effectively been deprecated. We want to remove the leftovers of the kernel implementation. When offlining a memory block (mm/memory_hotplug.c:__offline_pages()), we'll start by: 1. Testing if it contains any holes, and reject if so 2. Testing if pages belong to different zones, and reject if so 3. Isolating the page range, checking if it contains any unmovable pages Using is_mem_section_removable() before trying to offline is not only racy, it can easily result in false positives/negatives. Let's stop manually checking is_mem_section_removable(), and let device_offline() handle it completely instead. We can remove the racy is_mem_section_removable() implementation next. We now take more locks (e.g., memory hotplug lock when offlining and the zone lock when isolating), but maybe we should optimize that implementation instead if this ever becomes a real problem (after all, memory unplug is already an expensive operation). We started using is_mem_section_removable() in commit 51925fb3c5c9 ("powerpc/pseries: Implement memory hotplug remove in the kernel"), with the initial hotremove support of lmbs. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Cc: Nathan Fontenot Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michal Hocko Cc: Oscar Salvador Cc: Baoquan He Cc: Wei Yang Link: http://lkml.kernel.org/r/20200407135416.24093-2-david@redhat.com Signed-off-by: Linus Torvalds commit fa6d9ec790550b758215b6c6fa9f940878c3e2a2 Author: Vishal Verma Date: Thu Jun 4 16:48:25 2020 -0700 mm/memory_hotplug: refrain from adding memory into an impossible node A misbehaving qemu created a situation where the ACPI SRAT table advertised one fewer proximity domains than intended. The NFIT table did describe all the expected proximity domains. This caused the device dax driver to assign an impossible target_node to the device, and when hotplugged as system memory, this would fail with the following signature: BUG: kernel NULL pointer dereference, address: 0000000000000088 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 80000001767d4067 P4D 80000001767d4067 PUD 10e0c4067 PMD 0 Oops: 0000 [#1] SMP PTI CPU: 4 PID: 22737 Comm: kswapd3 Tainted: G O 5.6.0-rc5 #9 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:prepare_kswapd_sleep+0x7c/0xc0 Code: 89 df e8 87 fd ff ff 89 c2 31 c0 84 d2 74 e6 0f 1f 44 00 00 48 8b 05 fb af 7a 01 48 63 93 88 1d 01 00 48 8b 84 d0 20 0f 00 00 <48> 3b 98 88 00 00 00 75 28 f0 80 a0 80 00 00 00 fe f0 80 a3 38 20 RSP: 0018:ffffc900017a3e78 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffff8881209e0000 RCX: 0000000000000000 RDX: 0000000000000003 RSI: 0000000000000000 RDI: ffff8881209e0e80 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000008000 R10: 0000000000000000 R11: 0000000000000003 R12: 0000000000000003 R13: 0000000000000003 R14: 0000000000000000 R15: ffffc900017a3ec8 FS: 0000000000000000(0000) GS:ffff888318c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000088 CR3: 0000000120b50002 CR4: 00000000001606e0 Call Trace: kswapd+0x103/0x520 kthread+0x120/0x140 ret_from_fork+0x3a/0x50 Add a check in the add_memory path to fail if the node to which we are adding memory is in the node_possible_map Signed-off-by: Vishal Verma Signed-off-by: Andrew Morton Acked-by: David Hildenbrand Acked-by: Michal Hocko Cc: David Hildenbrand Cc: Dan Williams Cc: Dave Hansen Link: http://lkml.kernel.org/r/20200416225438.15208-1-vishal.l.verma@intel.com Signed-off-by: Linus Torvalds commit d4eaa2837851db2bfed572898bfc17f9a9f9151e Author: Waiman Long Date: Thu Jun 4 16:48:21 2020 -0700 mm: add kvfree_sensitive() for freeing sensitive data objects For kvmalloc'ed data object that contains sensitive information like cryptographic keys, we need to make sure that the buffer is always cleared before freeing it. Using memset() alone for buffer clearing may not provide certainty as the compiler may compile it away. To be sure, the special memzero_explicit() has to be used. This patch introduces a new kvfree_sensitive() for freeing those sensitive data objects allocated by kvmalloc(). The relevant places where kvfree_sensitive() can be used are modified to use it. Fixes: 4f0882491a14 ("KEYS: Avoid false positive ENOMEM error on key read") Suggested-by: Linus Torvalds Signed-off-by: Waiman Long Signed-off-by: Andrew Morton Reviewed-by: Eric Biggers Acked-by: David Howells Cc: Jarkko Sakkinen Cc: James Morris Cc: "Serge E. Hallyn" Cc: Joe Perches Cc: Matthew Wilcox Cc: David Rientjes Cc: Uladzislau Rezki Link: http://lkml.kernel.org/r/20200407200318.11711-1-longman@redhat.com Signed-off-by: Linus Torvalds commit 090e77e166334b83f555de408df64b9ab394ea08 Author: Ira Weiny Date: Thu Jun 4 16:48:18 2020 -0700 kmap: consolidate kmap_prot definitions Most architectures define kmap_prot to be PAGE_KERNEL. Let sparc and xtensa define there own and define PAGE_KERNEL as the default if not overridden. [akpm@linux-foundation.org: coding style fixes] Suggested-by: Christoph Hellwig Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-16-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit db6f1785f1c2462c388c516b0dacb980cf65012c Author: Ira Weiny Date: Thu Jun 4 16:48:14 2020 -0700 sparc: remove unnecessary includes linux/highmem.h has not been needed for the pte_offset_map => kmap_atomic use in sparc for some time (~2002) Remove this include. Suggested-by: Al Viro Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Christoph Hellwig Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-15-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 7438f36310ddd9fe536fc7403187f63427cecaba Author: Ira Weiny Date: Thu Jun 4 16:48:10 2020 -0700 parisc/kmap: remove duplicate kmap code parisc reimplements the kmap calls except to flush its dcache. This is arguably an abuse of kmap but regardless it is messy and confusing. Remove the duplicate code and have parisc define ARCH_HAS_FLUSH_ON_KUNMAP for a kunmap_flush_on_unmap() architecture specific call to flush the cache. Suggested-by: Al Viro Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Christoph Hellwig Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-14-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 8bfb1a10f2bb621a2c4c8bf7671b163f7e20d332 Author: Ira Weiny Date: Thu Jun 4 16:48:06 2020 -0700 kmap: remove kmap_atomic_to_page() kmap_atomic_to_page() has no callers and is only defined on 1 arch and declared on another. Remove it. Suggested-by: Al Viro Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Christoph Hellwig Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-13-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 915ecc22d5b20fc936b91d3678b267a96b352c12 Author: Ira Weiny Date: Thu Jun 4 16:48:02 2020 -0700 drm: remove drm specific kmap_atomic code kmap_atomic_prot() is now exported by all architectures. Use this function rather than open coding a driver specific kmap_atomic. [arnd@arndb.de: include linux/highmem.h] Link: http://lkml.kernel.org/r/20200508220150.649044-1-arnd@arndb.de Signed-off-by: Ira Weiny Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton Reviewed-by: Christian König Reviewed-by: Christoph Hellwig Acked-by: Daniel Vetter Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Chris Zankel Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-12-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 20b271dfe9d932b02b067a1f7ba9805c5b8d79bd Author: Ira Weiny Date: Thu Jun 4 16:47:58 2020 -0700 arch/kmap: define kmap_atomic_prot() for all arch's To support kmap_atomic_prot(), all architectures need to support protections passed to their kmap_atomic_high() function. Pass protections into kmap_atomic_high() and change the name to kmap_atomic_high_prot() to match. Then define kmap_atomic_prot() as a core function which calls kmap_atomic_high_prot() when needed. Finally, redefine kmap_atomic() as a wrapper of kmap_atomic_prot() with the default kmap_prot exported by the architectures. Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-11-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit d8c25836fa16496392bfa6a43908d231dd41bfc6 Author: Ira Weiny Date: Thu Jun 4 16:47:54 2020 -0700 arch/kmap: don't hard code kmap_prot values To support kmap_atomic_prot() on all architectures each arch must support protections passed in to them. Change csky, mips, nds32 and xtensa to use their global constant kmap_prot rather than a hard coded value which was equal. Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-10-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit db458d73fa35e256bba90b59a6776810800c8bb6 Author: Ira Weiny Date: Thu Jun 4 16:47:50 2020 -0700 arch/kmap: ensure kmap_prot visibility We want to support kmap_atomic_prot() on all architectures and it makes sense to define kmap_atomic() to use the default kmap_prot. So we ensure all arch's have a globally available kmap_prot either as a define or exported symbol. Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-9-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit abca2500c0c1b20c3e552f259da4c4a99db3b4d1 Author: Ira Weiny Date: Thu Jun 4 16:47:46 2020 -0700 arch/kunmap_atomic: consolidate duplicate code Every single architecture (including !CONFIG_HIGHMEM) calls... pagefault_enable(); preempt_enable(); ... before returning from __kunmap_atomic(). Lift this code into the kunmap_atomic() macro. While we are at it rename __kunmap_atomic() to kunmap_atomic_high() to be consistent. [ira.weiny@intel.com: don't enable pagefault/preempt twice] Link: http://lkml.kernel.org/r/20200518184843.3029640-1-ira.weiny@intel.com [akpm@linux-foundation.org: coding style fixes] Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Guenter Roeck Link: http://lkml.kernel.org/r/20200507150004.1423069-8-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 78b6d91ec7bbfc5bcc2dd05bb2cf13c9de1dc7cd Author: Ira Weiny Date: Thu Jun 4 16:47:42 2020 -0700 arch/kmap_atomic: consolidate duplicate code Every arch has the same code to ensure atomic operations and a check for !HIGHMEM page. Remove the duplicate code by defining a core kmap_atomic() which only calls the arch specific kmap_atomic_high() when the page is high memory. [akpm@linux-foundation.org: coding style fixes] Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-7-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit ee9bc5fdf5b6d24875fc55d43d5a0728bc2add21 Author: Ira Weiny Date: Thu Jun 4 16:47:38 2020 -0700 {x86,powerpc,microblaze}/kmap: move preempt disable During this kmap() conversion series we must maintain bisect-ability. To do this, kmap_atomic_prot() in x86, powerpc, and microblaze need to remain functional. Create a temporary inline version of kmap_atomic_prot within these architectures so we can rework their kmap_atomic() calls and then lift kmap_atomic_prot() to the core. Suggested-by: Al Viro Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-6-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit e23c45976f82ac789469c37e4d5a72ea2ce30bba Author: Ira Weiny Date: Thu Jun 4 16:47:34 2020 -0700 arch/kunmap: remove duplicate kunmap implementations All architectures do exactly the same thing for kunmap(); remove all the duplicate definitions and lift the call to the core. This also has the benefit of changing kmap_unmap() on a number of architectures to be an inline call rather than an actual function. [akpm@linux-foundation.org: fix CONFIG_HIGHMEM=n build on various architectures] Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-5-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 525aaf9bad00e7454b9f9b3873e92795afb59f8e Author: Ira Weiny Date: Thu Jun 4 16:47:30 2020 -0700 arch/kmap: remove redundant arch specific kmaps The kmap code for all the architectures is almost 100% identical. Lift the common code to the core. Use ARCH_HAS_KMAP_FLUSH_TLB to indicate if an arch defines kmap_flush_tlb() and call if if needed. This also has the benefit of changing kmap() on a number of architectures to be an inline call rather than an actual function. Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-4-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 2159687248dda396ae5861b7551aeb0b5527da24 Author: Ira Weiny Date: Thu Jun 4 16:47:26 2020 -0700 arch/xtensa: move kmap build bug out of the way Move the kmap() build bug to kmap_init() to facilitate patches to lift kmap() to the core. Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Andy Lutomirski Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian König Cc: Chris Zankel Cc: Daniel Vetter Cc: Dan Williams Cc: Dave Hansen Cc: "David S. Miller" Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Max Filippov Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20200507150004.1423069-3-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 01c4b788e01bfdb715de9a6763a7515da7a30a8f Author: Ira Weiny Date: Thu Jun 4 16:47:22 2020 -0700 arch/kmap: remove BUG_ON() Patch series "Remove duplicated kmap code", v3. The kmap infrastructure has been copied almost verbatim to every architecture. This series consolidates obvious duplicated code by defining core functions which call into the architectures only when needed. Some of the k[un]map_atomic() implementations have some similarities but the similarities were not sufficient to warrant further changes. In addition we remove a duplicate implementation of kmap() in DRM. This patch (of 15): Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap() in favor of might_sleep(). Besides the benefits of might_sleep(), this normalizes the implementations such that they can be made generic in subsequent patches. Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Reviewed-by: Dan Williams Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Christian König Cc: Daniel Vetter Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Chris Zankel Cc: Max Filippov Link: http://lkml.kernel.org/r/20200507150004.1423069-1-ira.weiny@intel.com Link: http://lkml.kernel.org/r/20200507150004.1423069-2-ira.weiny@intel.com Signed-off-by: Linus Torvalds commit 73221d8887241103b4e6193b9c41114256ed4a18 Author: Jeongtae Park Date: Thu Jun 4 16:47:19 2020 -0700 mm/vmalloc: fix a typo in comment There is a typo in comment, fix it. "nother" -> "another" Signed-off-by: Jeongtae Park Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Cc: Andrey Ryabinin Cc: Christoph Hellwig Link: http://lkml.kernel.org/r/20200604185239.20765-1-jtp.park@samsung.com Signed-off-by: Linus Torvalds commit 399145f9eb6c670daa605f0a823f836761e560ae Author: Anshuman Khandual Date: Thu Jun 4 16:47:15 2020 -0700 mm/debug: add tests validating architecture page table helpers This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validating changes to existing page table helpers or addition of new ones. This test covers basic page table entry transformations including but not limited to old, young, dirty, clean, write, write protect etc at various level along with populating intermediate entries with next page table page and validating them. Test page table pages are allocated from system memory with required size and alignments. The mapped pfns at page table levels are derived from a real pfn representing a valid kernel text symbol. This test gets called via late_initcall(). This test gets built and run when CONFIG_DEBUG_VM_PGTABLE is selected. Any architecture, which is willing to subscribe this test will need to select ARCH_HAS_DEBUG_VM_PGTABLE. For now this is limited to arc, arm64, x86, s390 and powerpc platforms where the test is known to build and run successfully Going forward, other architectures too can subscribe the test after fixing any build or runtime problems with their page table helpers. Folks interested in making sure that a given platform's page table helpers conform to expected generic MM semantics should enable the above config which will just trigger this test during boot. Any non conformity here will be reported as an warning which would need to be fixed. This test will help catch any changes to the agreed upon semantics expected from generic MM and enable platforms to accommodate it thereafter. [anshuman.khandual@arm.com: v17] Link: http://lkml.kernel.org/r/1587436495-22033-3-git-send-email-anshuman.khandual@arm.com [anshuman.khandual@arm.com: v18] Link: http://lkml.kernel.org/r/1588564865-31160-3-git-send-email-anshuman.khandual@arm.com Suggested-by: Catalin Marinas Signed-off-by: Anshuman Khandual Signed-off-by: Christophe Leroy Signed-off-by: Qian Cai Signed-off-by: Andrew Morton Tested-by: Gerald Schaefer [s390] Tested-by: Christophe Leroy [ppc32] Reviewed-by: Ingo Molnar Cc: Mike Rapoport Cc: Vineet Gupta Cc: Catalin Marinas Cc: Will Deacon Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Kirill A. Shutemov Cc: Paul Walmsley Cc: Palmer Dabbelt Link: http://lkml.kernel.org/r/1583919272-24178-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit 8898ad58a0195e2d3f5ffb770fbe9c9dc978a171 Author: Anshuman Khandual Date: Thu Jun 4 16:47:12 2020 -0700 x86/mm: define mm_p4d_folded() Patch series "mm/debug: Add tests validating architecture page table helpers", v18. This adds a test validation for architecture exported page table helpers. Patch adds basic transformation tests at various levels of the page table. This test was originally suggested by Catalin during arm64 THP migration RFC discussion earlier. Going forward it can include more specific tests with respect to various generic MM functions like THP, HugeTLB etc and platform specific tests. https://lore.kernel.org/linux-mm/20190628102003.GA56463@arrakis.emea.arm.com/ This patch (of 2): This just defines mm_p4d_folded() to check whether P4D page table level is folded at runtime. Signed-off-by: Kirill A. Shutemov Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Cc: Thomas Gleixner Cc: Ingo Molnar Link: http://lkml.kernel.org/r/1587436495-22033-2-git-send-email-anshuman.khandual@arm.com Link: http://lkml.kernel.org/r/1588564865-31160-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit f089dcc74226b874a4d4b122854e0dea91ff72d8 Author: Mike Rapoport Date: Thu Jun 4 16:47:08 2020 -0700 mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h There are no architectures that use include/asm-generic/5level-fixup.h therefore it can be removed along with __ARCH_HAS_5LEVEL_HACK define and the code it surrounds Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-15-rppt@kernel.org Signed-off-by: Linus Torvalds commit ee7767430ec27ac10b3d476e8a7735ca850fbd7d Author: Mike Rapoport Date: Thu Jun 4 16:47:04 2020 -0700 asm-generic: remove pgtable-nop4d-hack.h No architecture defines __ARCH_USE_5LEVEL_HACK and therefore pgtable-nop4d-hack.h will be never actually included. Remove it. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-14-rppt@kernel.org Signed-off-by: Linus Torvalds commit 453668afbf9906cf8d2b927eb9306c8bd108c6c4 Author: Mike Rapoport Date: Thu Jun 4 16:47:00 2020 -0700 unicore32: remove __ARCH_USE_5LEVEL_HACK The unicore32 architecture has 2 level page tables and asm-generic/pgtable-nopmd.h and explicit casts from pud_t to pgd_t for page table folding. Add p4d walk in the only place that actually unfolds the pud level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-13-rppt@kernel.org Signed-off-by: Linus Torvalds commit 874e2cc18972d30ecd4d572d1286fe9b594d309c Author: Mike Rapoport Date: Thu Jun 4 16:46:56 2020 -0700 sh: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-12-rppt@kernel.org Signed-off-by: Linus Torvalds commit a194a62650de5f74795a8edf0db5d8fdf1218aeb Author: Mike Rapoport Date: Thu Jun 4 16:46:52 2020 -0700 sh: drop __pXd_offset() macros that duplicate pXd_index() ones The __pXd_offset() macros are identical to the pXd_index() macros and there is no point to keep both of them. All architectures define and use pXd_index() so let's keep only those to make mips consistent with the rest of the kernel. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-11-rppt@kernel.org Signed-off-by: Linus Torvalds commit eaabf98b0932a540f3c772e4243e140ec239302c Author: Geert Uytterhoeven Date: Thu Jun 4 16:46:48 2020 -0700 sh: fault: modernize printing of kernel messages - Convert from printk() to pr_*(), - Add missing continuations, - Use "%llx" to format u64, - Join multiple prints in show_fault_oops() into a single print. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-10-rppt@kernel.org Signed-off-by: Linus Torvalds commit 2fb4706057bcf8261b3b0521ec7a62b54b82ce48 Author: Mike Rapoport Date: Thu Jun 4 16:46:44 2020 -0700 powerpc: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h. [rppt@linux.ibm.com: powerpc/xmon: drop unused pgdir varialble in show_pte() function] Link: http://lkml.kernel.org/r/20200519181454.GI1059226@linux.ibm.com [rppt@linux.ibm.com; build fix] Link: http://lkml.kernel.org/r/20200423141845.GI13521@linux.ibm.com Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Christophe Leroy # 8xx and 83xx Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-9-rppt@kernel.org Signed-off-by: Linus Torvalds commit b187fb7fca9cc420d111b2e058b69fae5eea18bc Author: Mike Rapoport Date: Thu Jun 4 16:46:39 2020 -0700 openrisc: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-8-rppt@kernel.org Signed-off-by: Linus Torvalds commit 9f4e70379f609d3bcc9d67eafecda75a495ffb4b Author: Mike Rapoport Date: Thu Jun 4 16:46:35 2020 -0700 nios2: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-7-rppt@kernel.org Signed-off-by: Linus Torvalds commit c03ab9e32a2c4fadbb65a07e88fbb4a25f9ab9d6 Author: Mike Rapoport Date: Thu Jun 4 16:46:31 2020 -0700 ia64: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, remove usage of __ARCH_USE_5LEVEL_HACK and replace 5level-fixup.h with pgtable-nop4d.h Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-6-rppt@kernel.org Signed-off-by: Linus Torvalds commit 00b13def5c03525c25084441f2b5f974a8751dad Author: Mike Rapoport Date: Thu Jun 4 16:46:27 2020 -0700 hexagon: remove __ARCH_USE_5LEVEL_HACK The hexagon architecture has 2 level page tables and as such most of the page table folding is already implemented in asm-generic/pgtable-nopmd.h. Fixup the only place in arch/hexagon to unfold the p4d level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-5-rppt@kernel.org Signed-off-by: Linus Torvalds commit e9f6376858b9799148d07e58b72b681d4b8fa4c7 Author: Mike Rapoport Date: Thu Jun 4 16:46:23 2020 -0700 arm64: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, replace 5level-fixup.h with pgtable-nop4d.h and remove __ARCH_USE_5LEVEL_HACK. [arnd@arndb.de: fix gcc-10 shift warning] Link: http://lkml.kernel.org/r/20200429185657.4085975-1-arnd@arndb.de Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-4-rppt@kernel.org Signed-off-by: Linus Torvalds commit 84e6ffb2c49c7901a9efb54b497d2eb84c3bef8c Author: Mike Rapoport Date: Thu Jun 4 16:46:19 2020 -0700 arm: add support for folded p4d page tables Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, and remove __ARCH_USE_5LEVEL_HACK. [rppt@linux.ibm.com: fix kexec] Link: http://lkml.kernel.org/r/20200508174232.GA759899@linux.ibm.com Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Marek Szyprowski Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200414153455.21744-3-rppt@kernel.org Signed-off-by: Linus Torvalds commit f426f4edf46c1a188edc33c25c13728857da3152 Author: Mike Rapoport Date: Thu Jun 4 16:46:15 2020 -0700 h8300: remove usage of __ARCH_USE_5LEVEL_HACK Patch series "mm: remove __ARCH_HAS_5LEVEL_HACK", v4. These patches convert several architectures to use page table folding and remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h and include/asm-generic/pgtable-nop4d-hack.h. With that we'll have a single and consistent way of dealing with page table folding instead of a mix of three existing options. The changes are mostly about mechanical replacement of pgd accessors with p4d ones and the addition of higher levels to page table traversals. This patch (of 14): h8300 is a nommu architecture and does not require fixup for upper layers of the page tables because it is already handled by the generic nommu implementation. Remove definition of __ARCH_USE_5LEVEL_HACK in arch/h8300/include/asm/pgtable.h Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Brian Cain Cc: Catalin Marinas Cc: Christophe Leroy Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: James Morse Cc: Jonas Bonn Cc: Julien Thierry Cc: Ley Foon Tan Cc: Marc Zyngier Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Russell King Cc: Stafford Horne [openrisc] Cc: Stefan Kristiansson Cc: Suzuki K Poulose Cc: Tony Luck Cc: Will Deacon Cc: Yoshinori Sato Cc: Joerg Roedel Link: http://lkml.kernel.org/r/20200414153455.21744-1-rppt@kernel.org Link: http://lkml.kernel.org/r/20200414153455.21744-2-rppt@kernel.org Signed-off-by: Linus Torvalds commit c571686a92ffd30d9f6092ce3f697e125bf96fd5 Author: Feng Tang Date: Thu Jun 4 16:46:11 2020 -0700 mm/util.c: remove the VM_WARN_ONCE for vm_committed_as underflow check This check was added by commit 82f71ae4a2b8 ("mm: catch memory commitment underflow") in 2014 to have a safety check for issues which have been fixed. And there has been few report caught by it, as described in its commit log: : This shouldn't happen any more - the previous two patches fixed : the committed_as underflow issues. But it was really found by Qian Cai when he used the LTP memory stress suite to test a RFC patchset, which tries to improve scalability of per-cpu counter 'vm_committed_as', by chosing a bigger 'batch' number for loose overcommit policies (OVERCOMMIT_ALWAYS and OVERCOMMIT_GUESS), while keeping current number for OVERCOMMIT_NEVER. With that patchset, when system firstly uses a loose policy, the 'vm_committed_as' count could be a big negative value, as its big 'batch' number allows a big deviation, then when the policy is changed to OVERCOMMIT_NEVER, the 'batch' will be decreased to a much smaller value, thus hits this WARN check. To mitigate this, one proposed solution is to queue work on all online CPUs to do a local sync for 'vm_committed_as' when changing policy to OVERCOMMIT_NEVER, plus some global syncing to garante the case won't be hit. But this solution is costy and slow, given this check hasn't shown real trouble or benefit, simply drop it from one hot path of MM. And perf stats does show some tiny saving for removing it. Reported-by: Qian Cai Signed-off-by: Feng Tang Signed-off-by: Andrew Morton Reviewed-by: Qian Cai Acked-by: Michal Hocko Cc: Konstantin Khlebnikov Cc: Andi Kleen Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mel Gorman Cc: Kees Cook Link: http://lkml.kernel.org/r/20200603094804.GB89848@shbuild999.sh.intel.com Signed-off-by: Linus Torvalds commit 76e278d6b50534092038d4117d7a2687af034107 Author: Andrey Konovalov Date: Thu Jun 4 16:46:08 2020 -0700 usb: core: kcov: collect coverage from usb complete callback This patch adds kcov_remote_start/stop() callbacks around the urb complete() callback that is executed in softirq context when dummy_hcd is in use. As the result, kcov can be used to collect coverage from those callbacks, which is used to facilitate coverage-guided fuzzing with syzkaller. Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alan Stern Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Greg Kroah-Hartman Cc: Marco Elver Link: http://lkml.kernel.org/r/4520671eeb604adbc2432c248b0c07fbaa5519ef.1585233617.git.andreyknvl@google.com Link: http://lkml.kernel.org/r/2821d497ac1cdc0efb5e00df30271e4a67fc8009.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 5ff3b30ab57da82d8db4f14662a2858cabfbc2c0 Author: Andrey Konovalov Date: Thu Jun 4 16:46:04 2020 -0700 kcov: collect coverage from interrupts This change extends kcov remote coverage support to allow collecting coverage from soft interrupts in addition to kernel background threads. To collect coverage from code that is executed in softirq context, a part of that code has to be annotated with kcov_remote_start/stop() in a similar way as how it is done for global kernel background threads. Then the handle used for the annotations has to be passed to the KCOV_REMOTE_ENABLE ioctl. Internally this patch adjusts the __sanitizer_cov_trace_pc() compiler inserted callback to not bail out when called from softirq context. kcov_remote_start/stop() are updated to save/restore the current per task kcov state in a per-cpu area (in case the softirq came when the kernel was already collecting coverage in task context). Coverage from softirqs is collected into pre-allocated per-cpu areas, whose size is controlled by the new CONFIG_KCOV_IRQ_AREA_SIZE. [andreyknvl@google.com: turn current->kcov_softirq into unsigned int to fix objtool warning] Link: http://lkml.kernel.org/r/841c778aa3849c5cb8c3761f56b87ce653a88671.1585233617.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alan Stern Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Greg Kroah-Hartman Cc: Marco Elver Link: http://lkml.kernel.org/r/469bd385c431d050bc38a593296eff4baae50666.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 5fe7042dc0a2e80b4633df20dcd06b93e76e3c31 Author: Andrey Konovalov Date: Thu Jun 4 16:46:01 2020 -0700 kcov: use t->kcov_mode as enabled indicator Currently kcov_remote_start() and kcov_remote_stop() check t->kcov to find out whether the coverage is already being collected by the current task. Use t->kcov_mode for that instead. This doesn't change the overall behavior in any way, but serves as a preparation for the following softirq coverage collection support patch. Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alan Stern Cc: Alexander Potapenko Cc: Greg Kroah-Hartman Cc: Marco Elver Cc: Andrey Konovalov Link: http://lkml.kernel.org/r/f70377945d1d8e6e4916cbce871a12303d6186b4.1585233617.git.andreyknvl@google.com Link: http://lkml.kernel.org/r/ee1a1dec43059da5d7664c85c1addc89c4cd58de.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit eeb91f9a2e3e9766ae9fd1117bd19d87538f21bf Author: Andrey Konovalov Date: Thu Jun 4 16:45:58 2020 -0700 kcov: move t->kcov_sequence assignment Move t->kcov_sequence assignment before assigning t->kcov_mode for consistency. Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alan Stern Cc: Alexander Potapenko Cc: Greg Kroah-Hartman Cc: Marco Elver Cc: Andrey Konovalov Link: http://lkml.kernel.org/r/5889efe35e0b300e69dba97216b1288d9c2428a8.1585233617.git.andreyknvl@google.com Link: http://lkml.kernel.org/r/f0283c676bab3335cb48bfe12d375a3da4719f59.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 76484b1c77242b737f8fd001d6e00af7518221f3 Author: Andrey Konovalov Date: Thu Jun 4 16:45:55 2020 -0700 kcov: move t->kcov assignments into kcov_start/stop Every time kcov_start/stop() is called, t->kcov is also assigned, so move the assignment into the functions. Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alan Stern Cc: Alexander Potapenko Cc: Greg Kroah-Hartman Cc: Marco Elver Cc: Andrey Konovalov Link: http://lkml.kernel.org/r/6644839d3567df61ade3c4b246a46cacbe4f9e11.1585233617.git.andreyknvl@google.com Link: http://lkml.kernel.org/r/82625ef3ff878f0b585763cc31d09d9b08ca37d6.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 67b3d3cca385507c4c8b6ad97b823415e038e3c8 Author: Andrey Konovalov Date: Thu Jun 4 16:45:51 2020 -0700 kcov: fix potential use-after-free in kcov_remote_start If vmalloc() fails in kcov_remote_start() we'll access remote->kcov without holding kcov_remote_lock, so remote might potentially be freed at that point. Cache kcov pointer in a local variable. Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Alan Stern Cc: Alexander Potapenko Cc: Greg Kroah-Hartman Cc: Marco Elver Cc: Andrey Konovalov Link: http://lkml.kernel.org/r/9d9134359725a965627b7e8f2652069f86f1d1fa.1585233617.git.andreyknvl@google.com Link: http://lkml.kernel.org/r/de0d3d30ff90776a2a509cc34c7c1c7521bda125.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 3c61df3885e91f8737bbbbaba79b908da0e1919f Author: Andrey Konovalov Date: Thu Jun 4 16:45:48 2020 -0700 kcov: cleanup debug messages Patch series "kcov: collect coverage from usb soft interrupts", v4. This patchset extends kcov to allow collecting coverage from soft interrupts and then uses the new functionality to collect coverage from USB code. This has allowed to find at least one new HID bug [1], which was recently fixed by Alan [2]. [1] https://syzkaller.appspot.com/bug?extid=09ef48aa58261464b621 [2] https://patchwork.kernel.org/patch/11283319/ Any subsystem that uses softirqs (e.g. timers) can make use of this in the future. Looking at the recent syzbot reports, an obvious candidate is the networking subsystem [3, 4, 5 and many more]. [3] https://syzkaller.appspot.com/bug?extid=522ab502c69badc66ab7 [4] https://syzkaller.appspot.com/bug?extid=57f89d05946c53dbbb31 [5] https://syzkaller.appspot.com/bug?extid=df358e65d9c1b9d3f5f4 This pach (of 7): Previous commit left a lot of excessive debug messages, clean them up. Link; http://lkml.kernel.org/r/cover.1585233617.git.andreyknvl@google.com Link; http://lkml.kernel.org/r/ab5e2885ce674ba6e04368551e51eeb6a2c11baf.1585233617.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Dmitry Vyukov Cc: Greg Kroah-Hartman Cc: Alan Stern Cc: Alexander Potapenko Cc: Marco Elver Cc: Andrey Konovalov Link: http://lkml.kernel.org/r/4a497134b2cf7a9d306d28e3dd2746f5446d1605.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 5bfea2d9b17f1034a68147a8b03b9789af5700f9 Author: Fan Yang Date: Thu Jun 4 18:22:07 2020 +0800 mm: Fix mremap not considering huge pmd devmap The original code in mm/mremap.c checks huge pmd by: if (is_swap_pmd(*old_pmd) || pmd_trans_huge(*old_pmd)) { However, a DAX mapped nvdimm is mapped as huge page (by default) but it is not transparent huge page (_PAGE_PSE | PAGE_DEVMAP). This commit changes the condition to include the case. This addresses CVE-2020-10757. Fixes: 5c7fb56e5e3f ("mm, dax: dax-pmd vs thp-pmd vs hugetlbfs-pmd") Cc: Reported-by: Fan Yang Signed-off-by: Fan Yang Tested-by: Fan Yang Tested-by: Dan Williams Reviewed-by: Dan Williams Acked-by: Kirill A. Shutemov Signed-off-by: Linus Torvalds commit a1c979f330cb82cae7a3b19464f9815e43060fe3 Author: Mikulas Patocka Date: Wed May 27 07:04:46 2020 -0400 dm bufio: delete unused and inefficient dm_bufio_discard_buffers There is no user for this interface. If in future it is needed it can be reimplemented to walk the rbtree of buffers instead of doing block-by-block lookups. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 7d877c35ca84cfa634fd63c2b64bf7b6ae9c71cb Author: Pavel Machek Date: Thu Jun 4 23:42:59 2020 +0200 net/xdp: use shift instead of 64 bit division 64bit division is kind of expensive, and shift should do the job here. Signed-off-by: Pavel Machek (CIP) Signed-off-by: David S. Miller commit a624a86510adaeefd33aac224751e89348596d2a Author: Vinay Kumar Yadav Date: Fri Jun 5 01:53:44 2020 +0530 crypto/chtls:Fix compile error when CONFIG_IPV6 is disabled Fix compile errors,warnings when CONFIG_IPV6 is disabled and inconsistent indenting. v1->v2: - Corrected errors/warnings reported when used newer gcc version, unused array. Fixes: 6abde0b24122 ("crypto/chtls: IPv6 support for inline TLS") Signed-off-by: Vinay Kumar Yadav Signed-off-by: David S. Miller commit 6761893eeaa378321198f06194ef2e1e4e8a4ad4 Author: Paolo Abeni Date: Thu Jun 4 18:55:45 2020 +0200 inet_connection_sock: clear inet_num out of destroy helper Clearing the 'inet_num' field is necessary and safe if and only if the socket is not bound. The MPTCP protocol calls the destroy helper on bound sockets, as tcp_v{4,6}_syn_recv_sock completed successfully. Move the clearing of such field out of the common code, otherwise the MPTCP MP_JOIN error path will find the wrong 'inet_num' value on socket disposal, __inet_put_port() will acquire the wrong lock and bind_node removal could race with other modifiers possibly corrupting the bind hash table. Reported-and-tested-by: Christoph Paasch Fixes: 729cd6436f35 ("mptcp: cope better with MP_JOIN failure") Signed-off-by: Paolo Abeni Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 98749b7188affbf2900c2aab704a8853901d1139 Author: Wang Hai Date: Thu Jun 4 20:18:51 2020 +0800 yam: fix possible memory leak in yam_init_driver If register_netdev(dev) fails, free_netdev(dev) needs to be called, otherwise a memory leak will occur. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit 7cdee28c4eeda8242c9fdbb02e315dbf35064afe Author: Roelof Berg Date: Wed Jun 3 23:54:14 2020 +0200 lan743x: Use correct MAC_CR configuration for 1 GBit speed Corrected the MAC_CR configuration bits for 1 GBit operation. The data sheet allows MAC_CR(2:1) to be 10 and also 11 for 1 GBit/s speed, but only 10 works correctly. Devices tested: Microchip Lan7431, fixed-phy mode Microchip Lan7430, normal phy mode Fixes: 6f197fb63850 ("lan743x: Added fixed link and RGMII support") Signed-off-by: Roelof Berg Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 09820ce88b4d36c452b23e05042542f87ff122d0 Author: Valentin Longchamp Date: Wed Jun 3 23:28:23 2020 +0200 net: ethernet: freescale: remove unneeded include for ucc_geth net/sch_generic.h does not need to be included, remove it. Signed-off-by: Valentin Longchamp Signed-off-by: David S. Miller commit 120068481405f9e3d60a95bd464496dff6b54669 Author: Heiner Kallweit Date: Wed Jun 3 22:29:06 2020 +0200 r8169: fix failing WoL Th referenced change added an extra hw reset to rtl8169_net_suspend() what makes WoL fail on few chip versions. Therefore skip the extra reset if we're going down and WoL is enabled. In rtl_shutdown() rtl8169_hw_reset() is called by rtl8169_net_suspend() already if needed, therefore avoid issues issue by removing the extra call. The fix was tested on a system with RTL8168g. Meanwhile rtl8169_hw_reset() does more than a hw reset and should be renamed. But that's net-next material. Fixes: 8ac8e8c64b53 ("r8169: make rtl8169_down central chip quiesce function") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f6c1fb0a76d97447ea7f928ee6a113ee15318df1 Author: Dan Carpenter Date: Wed Jun 3 20:50:25 2020 +0300 net: ethernet: dwmac: Fix an error code in imx_dwmac_probe() The code is return PTR_ERR(NULL) which is zero or success. We should return -ENOMEM instead. Fixes: 94abdad6974a5 ("net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip") Signed-off-by: Dan Carpenter Acked-by: Fugang Duan Signed-off-by: David S. Miller commit c7e261d81783387a0502878cd229327e7c54322e Author: Ahmed S. Darwish Date: Wed Jun 3 16:49:47 2020 +0200 net: mdiobus: Disable preemption upon u64_stats update The u64_stats mechanism uses sequence counters to protect against 64-bit values tearing on 32-bit architectures. Updating u64_stats is thus a sequence counter write side critical section where preemption must be disabled. For mdiobus_stats_acct(), disable preemption upon the u64_stats update. It is called from process context through mdiobus_read() and mdiobus_write(). Reported-by: kernel test robot Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 6501bf87602f799b7e502014f8bc0aa58b868277 Author: Ahmed S. Darwish Date: Wed Jun 3 16:49:46 2020 +0200 u64_stats: Document writer non-preemptibility requirement The u64_stats mechanism uses sequence counters to protect against 64-bit values tearing on 32-bit architectures. Updating such statistics is a sequence counter write side critical section. Preemption must be disabled before entering this seqcount write critical section. Failing to do so, the seqcount read side can preempt the write side section and spin for the entire scheduler tick. If that reader belongs to a real-time scheduling class, it can spin forever and the kernel will livelock. Document this statistics update side non-preemptibility requirement. Reword the introductory paragraph to highlight u64_stats raison d'être: 64-bit values tearing protection on 32-bit architectures. Divide documentation on a basis of internal design vs. usage constraints. Reword the u64_stats header file top comment to always mention "Reader" or "Writer" at the start of each bullet point, making it easier to follow which side each point is actually for. Clarify the statement "whole thing is a NOOP on 64bit arches or UP kernels". For 32-bit UP kernels, preemption is always disabled for the statistics read side section. Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 79cbb6bc3332da7162c2581e151659ab8ebaa528 Author: Ahmed S. Darwish Date: Wed Jun 3 16:49:45 2020 +0200 net: phy: fixed_phy: Remove unused seqcount Commit bf7afb29d545 ("phy: improve safety of fixed-phy MII register reading") protected the fixed PHY status with a sequence counter. Two years later, commit d2b977939b18 ("net: phy: fixed-phy: remove fixed_phy_update_state()") removed the sequence counter's write side critical section -- neutralizing its read side retry loop. Remove the unused seqcount. Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 11d6011c2cf29f7c8181ebde6c8bc0c4d83adcd7 Author: Ahmed S. Darwish Date: Wed Jun 3 16:49:44 2020 +0200 net: core: device_rename: Use rwsem instead of a seqcount Sequence counters write paths are critical sections that must never be preempted, and blocking, even for CONFIG_PREEMPTION=n, is not allowed. Commit 5dbe7c178d3f ("net: fix kernel deadlock with interface rename and netdev name retrieval.") handled a deadlock, observed with CONFIG_PREEMPTION=n, where the devnet_rename seqcount read side was infinitely spinning: it got scheduled after the seqcount write side blocked inside its own critical section. To fix that deadlock, among other issues, the commit added a cond_resched() inside the read side section. While this will get the non-preemptible kernel eventually unstuck, the seqcount reader is fully exhausting its slice just spinning -- until TIF_NEED_RESCHED is set. The fix is also still broken: if the seqcount reader belongs to a real-time scheduling policy, it can spin forever and the kernel will livelock. Disabling preemption over the seqcount write side critical section will not work: inside it are a number of GFP_KERNEL allocations and mutex locking through the drivers/base/ :: device_rename() call chain. >From all the above, replace the seqcount with a rwsem. Fixes: 5dbe7c178d3f (net: fix kernel deadlock with interface rename and netdev name retrieval.) Fixes: 30e6c9fa93cf (net: devnet_rename_seq should be a seqcount) Fixes: c91f6df2db49 (sockopt: Change getsockopt() of SO_BINDTODEVICE to return an interface name) Cc: Reported-by: kbuild test robot [ v1 missing up_read() on error exit ] Reported-by: Dan Carpenter [ v1 missing up_read() on error exit ] Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 67122a7910bf2135dc7f7ececfcf16a5bdb362c1 Author: Michal Vokáč Date: Wed Jun 3 13:31:39 2020 +0200 net: dsa: qca8k: Fix "Unexpected gfp" kernel exception Commit 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper") replaced the dsa_switch_alloc helper by devm_kzalloc in all DSA drivers. Unfortunately it introduced a typo in qca8k.c driver and wrong argument is passed to the devm_kzalloc function. This fix mitigates the following kernel exception: Unexpected gfp: 0x6 (__GFP_HIGHMEM|GFP_DMA32). Fixing up to gfp: 0x101 (GFP_DMA|__GFP_ZERO). Fix your code! CPU: 1 PID: 44 Comm: kworker/1:1 Not tainted 5.5.9-yocto-ua #1 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) Workqueue: events deferred_probe_work_func [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x90/0xa4) [] (dump_stack) from [] (new_slab+0x20c/0x214) [] (new_slab) from [] (___slab_alloc.constprop.0+0x1b8/0x540) [] (___slab_alloc.constprop.0) from [] (__slab_alloc.constprop.0+0x1c/0x24) [] (__slab_alloc.constprop.0) from [] (__kmalloc_track_caller+0x1b0/0x298) [] (__kmalloc_track_caller) from [] (devm_kmalloc+0x24/0x70) [] (devm_kmalloc) from [] (qca8k_sw_probe+0x94/0x1ac) [] (qca8k_sw_probe) from [] (mdio_probe+0x30/0x54) [] (mdio_probe) from [] (really_probe+0x1e0/0x348) [] (really_probe) from [] (driver_probe_device+0x60/0x16c) [] (driver_probe_device) from [] (bus_for_each_drv+0x70/0x94) [] (bus_for_each_drv) from [] (__device_attach+0xb4/0x11c) [] (__device_attach) from [] (bus_probe_device+0x84/0x8c) [] (bus_probe_device) from [] (deferred_probe_work_func+0x64/0x90) [] (deferred_probe_work_func) from [] (process_one_work+0x1d4/0x41c) [] (process_one_work) from [] (worker_thread+0x248/0x528) [] (worker_thread) from [] (kthread+0x124/0x150) [] (kthread) from [] (ret_from_fork+0x14/0x3c) Exception stack(0xee1b5fb0 to 0xee1b5ff8) 5fa0: 00000000 00000000 00000000 00000000 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 qca8k 2188000.ethernet-1:0a: Using legacy PHYLIB callbacks. Please migrate to PHYLINK! qca8k 2188000.ethernet-1:0a eth2 (uninitialized): PHY [2188000.ethernet-1:01] driver [Generic PHY] qca8k 2188000.ethernet-1:0a eth1 (uninitialized): PHY [2188000.ethernet-1:02] driver [Generic PHY] Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper") Signed-off-by: Michal Vokáč Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 9d149045b3c0e44c049cdbce8a64e19415290017 Author: Jiri Benc Date: Wed Jun 3 11:12:14 2020 +0200 geneve: change from tx_error to tx_dropped on missing metadata If the geneve interface is in collect_md (external) mode, it can't send any packets submitted directly to its net interface, as such packets won't have metadata attached. This is expected. However, the kernel itself sends some packets to the interface, most notably, IPv6 DAD, IPv6 multicast listener reports, etc. This is not wrong, as tunnel metadata can be specified in routing table (although technically, that has never worked for IPv6, but hopefully will be fixed eventually) and then the interface must correctly participate in IPv6 housekeeping. The problem is that any such attempt increases the tx_error counter. Just bringing up a geneve interface with IPv6 enabled is enough to see a number of tx_errors. That causes confusion among users, prompting them to find a network error where there is none. Change the counter used to tx_dropped. That better conveys the meaning (there's nothing wrong going on, just some packets are getting dropped) and hopefully will make admins panic less. Signed-off-by: Jiri Benc Signed-off-by: David S. Miller commit a9a7d12954893f817dcb0652c488c7e823e7b8c6 Merge: bb986a50421a 3921a81c31df Author: David S. Miller Date: Thu Jun 4 15:43:01 2020 -0700 Merge branch 'ena-xdp-fixes' Sameeh Jubran says: ==================== Fix xdp in ena driver This patchset includes 2 XDP related bug fixes Difference from v1: * Fixed "Fixes" tag ==================== Acked-by: Jakub Kicinski Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit 3921a81c31df6057183aeb7f7d204003bf699d6f Author: Sameeh Jubran Date: Wed Jun 3 08:50:23 2020 +0000 net: ena: xdp: update napi budget for DROP and ABORTED This patch fixes two issues with XDP: 1. If the XDP verdict is XDP_ABORTED we break the loop, which results in us handling one buffer per napi cycle instead of the total budget (usually 64). To overcome this simply change the xdp_verdict check to != XDP_PASS. When the verdict is XDP_PASS, the skb is not expected to be NULL. 2. Update the residual budget for XDP_DROP and XDP_ABORTED, since packets are handled in these cases. Fixes: 548c4940b9f1 ("net: ena: Implement XDP_TX action") Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit cd07ecccba13b8bd5023ffe7be57363d07e3105f Author: Sameeh Jubran Date: Wed Jun 3 08:50:22 2020 +0000 net: ena: xdp: XDP_TX: fix memory leak When sending very high packet rate, the XDP tx queues can get full and start dropping packets. In this case we don't free the pages which results in ena driver draining the system memory. Fix: Simply free the pages when necessary. Fixes: 548c4940b9f1 ("net: ena: Implement XDP_TX action") Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit bb986a50421a11bf31a81afb15b9b8f45a4a3a11 Author: Ahmed Abdelsalam Date: Wed Jun 3 06:54:42 2020 +0000 seg6: fix seg6_validate_srh() to avoid slab-out-of-bounds The seg6_validate_srh() is used to validate SRH for three cases: case1: SRH of data-plane SRv6 packets to be processed by the Linux kernel. Case2: SRH of the netlink message received from user-space (iproute2) Case3: SRH injected into packets through setsockopt In case1, the SRH can be encoded in the Reduced way (i.e., first SID is carried in DA only and not represented as SID in the SRH) and the seg6_validate_srh() now handles this case correctly. In case2 and case3, the SRH shouldn’t be encoded in the Reduced way otherwise we lose the first segment (i.e., the first hop). The current implementation of the seg6_validate_srh() allow SRH of case2 and case3 to be encoded in the Reduced way. This leads a slab-out-of-bounds problem. This patch verifies SRH of case1, case2 and case3. Allowing case1 to be reduced while preventing SRH of case2 and case3 from being reduced . Reported-by: syzbot+e8c028b62439eac42073@syzkaller.appspotmail.com Reported-by: YueHaibing Fixes: 0cb7498f234e ("seg6: fix SRH processing to comply with RFC8754") Signed-off-by: Ahmed Abdelsalam Signed-off-by: David S. Miller commit 5e9eeccc58f3e6bcc99b929670665d2ce047e9c9 Author: Tuong Lien Date: Wed Jun 3 12:06:01 2020 +0700 tipc: fix NULL pointer dereference in streaming syzbot found the following crash: general protection fault, probably for non-canonical address 0xdffffc0000000019: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x00000000000000c8-0x00000000000000cf] CPU: 1 PID: 7060 Comm: syz-executor394 Not tainted 5.7.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__tipc_sendstream+0xbde/0x11f0 net/tipc/socket.c:1591 Code: 00 00 00 00 48 39 5c 24 28 48 0f 44 d8 e8 fa 3e db f9 48 b8 00 00 00 00 00 fc ff df 48 8d bb c8 00 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 e2 04 00 00 48 8b 9b c8 00 00 00 48 b8 00 00 00 RSP: 0018:ffffc90003ef7818 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8797fd9d RDX: 0000000000000019 RSI: ffffffff8797fde6 RDI: 00000000000000c8 RBP: ffff888099848040 R08: ffff88809a5f6440 R09: fffffbfff1860b4c R10: ffffffff8c305a5f R11: fffffbfff1860b4b R12: ffff88809984857e R13: 0000000000000000 R14: ffff888086aa4000 R15: 0000000000000000 FS: 00000000009b4880(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000140 CR3: 00000000a7fdf000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tipc_sendstream+0x4c/0x70 net/tipc/socket.c:1533 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x32f/0x810 net/socket.c:2352 ___sys_sendmsg+0x100/0x170 net/socket.c:2406 __sys_sendmmsg+0x195/0x480 net/socket.c:2496 __do_sys_sendmmsg net/socket.c:2525 [inline] __se_sys_sendmmsg net/socket.c:2522 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2522 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x440199 ... This bug was bisected to commit 0a3e060f340d ("tipc: add test for Nagle algorithm effectiveness"). However, it is not the case, the trouble was from the base in the case of zero data length message sending, we would unexpectedly make an empty 'txq' queue after the 'tipc_msg_append()' in Nagle mode. A similar crash can be generated even without the bisected patch but at the link layer when it accesses the empty queue. We solve the issues by building at least one buffer to go with socket's header and an optional data section that may be empty like what we had with the 'tipc_msg_build()'. Note: the previous commit 4c21daae3dbc ("tipc: Fix NULL pointer dereference in __tipc_sendstream()") is obsoleted by this one since the 'txq' will be never empty and the check of 'skb != NULL' is unnecessary but it is safe anyway. Reported-by: syzbot+8eac6d030e7807c21d32@syzkaller.appspotmail.com Fixes: c0bceb97db9e ("tipc: add smart nagle feature") Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit c36f05559104b66bcd7f617e931e38c680227b74 Author: Cong Wang Date: Tue Jun 2 21:49:10 2020 -0700 genetlink: fix memory leaks in genl_family_rcv_msg_dumpit() There are two kinds of memory leaks in genl_family_rcv_msg_dumpit(): 1. Before we call ops->start(), whenever an error happens, we forget to free the memory allocated in genl_family_rcv_msg_dumpit(). 2. When ops->start() fails, the 'info' has been already installed on the per socket control block, so we should not free it here. More importantly, nlk->cb_running is still false at this point, so netlink_sock_destruct() cannot free it either. The first kind of memory leaks is easier to resolve, but the second one requires some deeper thoughts. After reviewing how netfilter handles this, the most elegant solution I find is just to use a similar way to allocate the memory, that is, moving memory allocations from caller into ops->start(). With this, we can solve both kinds of memory leaks: for 1), no memory allocation happens before ops->start(); for 2), ops->start() handles its own failures and 'info' is installed to the socket control block only when success. The only ugliness here is we have to pass all local variables on stack via a struct, but this is not hard to understand. Alternatively, we can introduce a ops->free() to solve this too, but it is overkill as only genetlink has this problem so far. Fixes: 1927f41a22a0 ("net: genetlink: introduce dump info struct to be available during dumpit op") Reported-by: syzbot+21f04f481f449c8db840@syzkaller.appspotmail.com Cc: "Jason A. Donenfeld" Cc: Florian Westphal Cc: Pablo Neira Ayuso Cc: Jiri Pirko Cc: YueHaibing Cc: Shaochun Chen Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit ef1c75593e770aff8749e902aa0deb6855a3f485 Author: Rohit Maheshwari Date: Wed Jun 3 09:58:13 2020 +0530 crypto/chcr: error seen if CONFIG_CHELSIO_TLS_DEVICE isn't set cxgb4_uld_in_use() is used only by cxgb4_ktls_det_feature() which is under CONFIG_CHELSIO_TLS_DEVICE macro. Fixes: a3ac249a1ab5 ("cxgb4/chcr: Enable ktls settings at run time") Signed-off-by: Rohit Maheshwari Signed-off-by: David S. Miller commit e7ed83d6fa1a00d0f2ad0327e73d3ea9e7ea8de1 Author: Dan Carpenter Date: Thu Jun 4 11:54:36 2020 +0300 bpf: Fix an error code in check_btf_func() This code returns success if the "info_aux" allocation fails but it should return -ENOMEM. Fixes: 8c1b6e69dcc1 ("bpf: Compare BTF types of functions arguments with actual types") Signed-off-by: Dan Carpenter Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200604085436.GA943001@mwanda commit 15a2bc4dbb9cfed1c661a657fcb10798150b7598 Merge: 9ff7258575d5 3977e285ee89 Author: Linus Torvalds Date: Thu Jun 4 14:07:08 2020 -0700 Merge branch 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull execve updates from Eric Biederman: "Last cycle for the Nth time I ran into bugs and quality of implementation issues related to exec that could not be easily be fixed because of the way exec is implemented. So I have been digging into exec and cleanup up what I can. I don't think I have exec sorted out enough to fix the issues I started with but I have made some headway this cycle with 4 sets of changes. - promised cleanups after introducing exec_update_mutex - trivial cleanups for exec - control flow simplifications - remove the recomputation of bprm->cred The net result is code that is a bit easier to understand and work with and a decrease in the number of lines of code (if you don't count the added tests)" * 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (24 commits) exec: Compute file based creds only once exec: Add a per bprm->file version of per_clear binfmt_elf_fdpic: fix execfd build regression selftests/exec: Add binfmt_script regression test exec: Remove recursion from search_binary_handler exec: Generic execfd support exec/binfmt_script: Don't modify bprm->buf and then return -ENOEXEC exec: Move the call of prepare_binprm into search_binary_handler exec: Allow load_misc_binary to call prepare_binprm unconditionally exec: Convert security_bprm_set_creds into security_bprm_repopulate_creds exec: Factor security_bprm_creds_for_exec out of security_bprm_set_creds exec: Teach prepare_exec_creds how exec treats uids & gids exec: Set the point of no return sooner exec: Move handling of the point of no return to the top level exec: Run sync_mm_rss before taking exec_update_mutex exec: Fix spelling of search_binary_handler in a comment exec: Move the comment from above de_thread to above unshare_sighand exec: Rename flush_old_exec begin_new_exec exec: Move most of setup_new_exec into flush_old_exec exec: In setup_new_exec cache current in the local variable me ... commit 9ff7258575d5fee011649d20cc56de720a395191 Merge: 051c3556e3d6 9d78edeaec75 Author: Linus Torvalds Date: Thu Jun 4 13:54:34 2020 -0700 Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull proc updates from Eric Biederman: "This has four sets of changes: - modernize proc to support multiple private instances - ensure we see the exit of each process tid exactly - remove has_group_leader_pid - use pids not tasks in posix-cpu-timers lookup Alexey updated proc so each mount of proc uses a new superblock. This allows people to actually use mount options with proc with no fear of messing up another mount of proc. Given the kernel's internal mounts of proc for things like uml this was a real problem, and resulted in Android's hidepid mount options being ignored and introducing security issues. The rest of the changes are small cleanups and fixes that came out of my work to allow this change to proc. In essence it is swapping the pids in de_thread during exec which removes a special case the code had to handle. Then updating the code to stop handling that special case" * 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: proc: proc_pid_ns takes super_block as an argument remove the no longer needed pid_alive() check in __task_pid_nr_ns() posix-cpu-timers: Replace __get_task_for_clock with pid_for_clock posix-cpu-timers: Replace cpu_timer_pid_type with clock_pid_type posix-cpu-timers: Extend rcu_read_lock removing task_struct references signal: Remove has_group_leader_pid exec: Remove BUG_ON(has_group_leader_pid) posix-cpu-timer: Unify the now redundant code in lookup_task posix-cpu-timer: Tidy up group_leader logic in lookup_task proc: Ensure we see the exit of each process tid exactly once rculist: Add hlists_swap_heads_rcu proc: Use PIDTYPE_TGID in next_tgid Use proc_pid_ns() to get pid_namespace from the proc superblock proc: use named enums for better readability proc: use human-readable values for hidepid docs: proc: add documentation for "hidepid=4" and "subset=pid" options and new mount behavior proc: add option to mount only a pids subset proc: instantiate only pids that we can ptrace on 'hidepid=4' mount option proc: allow to mount many instances of proc in one pid namespace proc: rename struct proc_fs_info to proc_fs_opts commit 051c3556e3d6cc43bca71a624081de9c599df944 Merge: 07c8f3bfef16 5626de1e96f7 Author: Linus Torvalds Date: Thu Jun 4 13:53:10 2020 -0700 Merge tag 'for_v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull ext2 and reiserfs cleanups from Jan Kara: "Two small cleanups for ext2 and one for reiserfs" * tag 'for_v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: reiserfs: Replace kmalloc with kcalloc in the comment ext2: code cleanup by removing ifdef macro surrounding ext2: Fix i_op setting for special inode commit 49b23575943c04b6711107cfd08ad2b3ae4e81f5 Author: Matthieu Baerts Date: Wed Jun 3 21:03:47 2020 +0200 bpf: Fix unused-var without NETDEVICES A recent commit added new variables only used if CONFIG_NETDEVICES is set. A simple fix would be to only declare these variables if the same condition is valid but Alexei suggested an even simpler solution: since CONFIG_NETDEVICES doesn't change anything in .h I think the best is to remove #ifdef CONFIG_NETDEVICES from net/core/filter.c and rely on sock_bindtoindex() returning ENOPROTOOPT in the extreme case of oddly configured kernels. Fixes: 70c58997c1e8 ("bpf: Allow SO_BINDTODEVICE opt in bpf_setsockopt") Suggested-by: Alexei Starovoitov Signed-off-by: Matthieu Baerts Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200603190347.2310320-1-matthieu.baerts@tessares.net commit 07c8f3bfef161271786f368791f5fc33c7428964 Merge: d77d1dbba955 2f02fd3fa13e Author: Linus Torvalds Date: Thu Jun 4 13:51:54 2020 -0700 Merge tag 'fsnotify_for_v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "Several smaller fixes and cleanups for fsnotify subsystem" * tag 'fsnotify_for_v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: fix ignore mask logic for events on child and on dir fanotify: don't write with size under sizeof(response) fsnotify: Remove proc_fs.h include fanotify: remove reference to fill_event_metadata() fsnotify: add mutex destroy fanotify: prefix should_merge() fanotify: Replace zero-length array with flexible-array inotify: Fix error return code assignment flow. fsnotify: Add missing annotation for fsnotify_finish_user_wait() and for fsnotify_prepare_user_wait() commit d77d1dbba95500d1b38cab98bf608ad46dce8374 Merge: 9fb4c5250f10 568776f992c4 Author: Linus Torvalds Date: Thu Jun 4 13:50:13 2020 -0700 Merge tag 'zonefs-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs update from Damien Le Moal: "Only one patch in this pull request to cleanup handling of uuid using the import_uuid() helper, from Andy" * tag 'zonefs-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: Replace uuid_copy() with import_uuid() commit fce8afd76e3a4d8c59c92f84f8027569fd7031d0 Author: David Hildenbrand Date: Fri May 15 12:14:02 2020 +0200 virtio-mem: Don't rely on implicit compiler padding for requests The compiler will add padding after the last member, make that explicit. The size of a request is always 24 bytes. The size of a response always 10 bytes. Add compile-time checks. Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Cc: teawater Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200515101402.16597-1-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 72f9525ad76b1ddfe663285805982e9d57c7b2c2 Author: David Hildenbrand Date: Thu May 7 16:01:39 2020 +0200 virtio-mem: Try to unplug the complete online memory block first Right now, we always try to unplug single subblocks when processing an online memory block. Let's try to unplug the complete online memory block first, in case it is fully plugged and the unplug request is large enough. Fallback to single subblocks in case the memory block cannot get unplugged as a whole. Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-16-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 8d4edcfe78c0008d95effc0c90455cee59e18d10 Author: David Hildenbrand Date: Thu May 7 16:01:38 2020 +0200 virtio-mem: Use -ETXTBSY as error code if the device is busy Let's be able to distinguish if the device or if memory is busy. Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-15-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 562e08cd249f98af3a3e0845998f3b27b56b0067 Author: David Hildenbrand Date: Thu May 7 16:01:37 2020 +0200 virtio-mem: Unplug subblocks right-to-left We unplug blocks right-to-left, let's also unplug subblocks within a block right-to-left. Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-14-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 3c42e198e668e4040ef5cf3ad60d57765abc08a4 Author: David Hildenbrand Date: Thu May 7 16:01:36 2020 +0200 virtio-mem: Drop manual check for already present memory Registering our parent resource will fail if any memory is still present (e.g., because somebody unloaded the driver and tries to reload it). No need for the manual check. Move our "unplug all" handling to after registering the resource. Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-13-david@redhat.com Signed-off-by: Michael S. Tsirkin commit ebf71552bb0e690cad523ad175e8c4c89a33c333 Author: David Hildenbrand Date: Thu May 7 16:01:35 2020 +0200 virtio-mem: Add parent resource for all added "System RAM" Let's add a parent resource, named after the virtio device (inspired by drivers/dax/kmem.c). This allows user space to identify which memory belongs to which virtio-mem device. With this change and two virtio-mem devices: :/# cat /proc/iomem 00000000-00000fff : Reserved 00001000-0009fbff : System RAM [...] 140000000-333ffffff : virtio0 140000000-147ffffff : System RAM 148000000-14fffffff : System RAM 150000000-157ffffff : System RAM [...] 334000000-3033ffffff : virtio1 338000000-33fffffff : System RAM 340000000-347ffffff : System RAM 348000000-34fffffff : System RAM [...] Cc: "Michael S. Tsirkin" Cc: Pankaj Gupta Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-12-david@redhat.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Pankaj Gupta commit 23e77b5dc9cd88709c48ada936c07bdd72c49426 Author: David Hildenbrand Date: Thu May 7 16:01:34 2020 +0200 virtio-mem: Better retry handling Let's start with a retry interval of 5 seconds and double the time until we reach 5 minutes, in case we keep getting errors. Reset the retry interval in case we succeeded. The two main reasons for having to retry are - The hypervisor is busy and cannot process our request - We cannot reach the desired requested_size (esp., not enough memory can get unplugged because we can't allocate any subblocks). Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-11-david@redhat.com Signed-off-by: Michael S. Tsirkin commit a573238786f8f16aca6946fc7b804b965e3038e9 Author: David Hildenbrand Date: Thu May 7 16:01:33 2020 +0200 virtio-mem: Offline and remove completely unplugged memory blocks Let's offline+remove memory blocks once all subblocks are unplugged. We can use the new Linux MM interface for that. As no memory is in use anymore, this shouldn't take a long time and shouldn't fail. There might be corner cases where the offlining could still fail (especially, if another notifier NACKs the offlining request). Acked-by: Pankaj Gupta Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-10-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 08b3acd7a68fc17902e1cb6b146389322840deab Author: David Hildenbrand Date: Thu May 7 16:01:32 2020 +0200 mm/memory_hotplug: Introduce offline_and_remove_memory() virtio-mem wants to offline and remove a memory block once it unplugged all subblocks (e.g., using alloc_contig_range()). Let's provide an interface to do that from a driver. virtio-mem already supports to offline partially unplugged memory blocks. Offlining a fully unplugged memory block will not require to migrate any pages. All unplugged subblocks are PageOffline() and have a reference count of 0 - so offlining code will simply skip them. All we need is an interface to offline and remove the memory from kernel module context, where we don't have access to the memory block devices (esp. find_memory_block() and device_offline()) and the device hotplug lock. To keep things simple, allow to only work on a single memory block. Acked-by: Michal Hocko Tested-by: Pankaj Gupta Acked-by: Andrew Morton Cc: Andrew Morton Cc: David Hildenbrand Cc: Oscar Salvador Cc: Michal Hocko Cc: Pavel Tatashin Cc: Wei Yang Cc: Dan Williams Cc: Qian Cai Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-9-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 8e5c921ca0cd9aa59386e6be4b86b32f0ba7296b Author: David Hildenbrand Date: Thu May 7 16:01:31 2020 +0200 virtio-mem: Allow to offline partially unplugged memory blocks Dropping the reference count of PageOffline() pages during MEM_GOING_ONLINE allows offlining code to skip them. However, we also have to clear PG_reserved, because PG_reserved pages get detected as unmovable right away. Take care of restoring the reference count when offlining is canceled. Clarify why we don't have to perform any action when unloading the driver. Also, let's add a warning if anybody is still holding a reference to unplugged pages when offlining. Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-8-david@redhat.com Signed-off-by: Michael S. Tsirkin commit aa218795cb5fd583c94fc838dc76b7379dc4976a Author: David Hildenbrand Date: Thu May 7 16:01:30 2020 +0200 mm: Allow to offline unmovable PageOffline() pages via MEM_GOING_OFFLINE virtio-mem wants to allow to offline memory blocks of which some parts were unplugged (allocated via alloc_contig_range()), especially, to later offline and remove completely unplugged memory blocks. The important part is that PageOffline() has to remain set until the section is offline, so these pages will never get accessed (e.g., when dumping). The pages should not be handed back to the buddy (which would require clearing PageOffline() and result in issues if offlining fails and the pages are suddenly in the buddy). Let's allow to do that by allowing to isolate any PageOffline() page when offlining. This way, we can reach the memory hotplug notifier MEM_GOING_OFFLINE, where the driver can signal that he is fine with offlining this page by dropping its reference count. PageOffline() pages with a reference count of 0 can then be skipped when offlining the pages (like if they were free, however they are not in the buddy). Anybody who uses PageOffline() pages and does not agree to offline them (e.g., Hyper-V balloon, XEN balloon, VMWare balloon for 2MB pages) will not decrement the reference count and make offlining fail when trying to migrate such an unmovable page. So there should be no observable change. Same applies to balloon compaction users (movable PageOffline() pages), the pages will simply be migrated. Note 1: If offlining fails, a driver has to increment the reference count again in MEM_CANCEL_OFFLINE. Note 2: A driver that makes use of this has to be aware that re-onlining the memory block has to be handled by hooking into onlining code (online_page_callback_t), resetting the page PageOffline() and not giving them to the buddy. Reviewed-by: Alexander Duyck Acked-by: Michal Hocko Tested-by: Pankaj Gupta Acked-by: Andrew Morton Cc: Andrew Morton Cc: Juergen Gross Cc: Konrad Rzeszutek Wilk Cc: Pavel Tatashin Cc: Alexander Duyck Cc: Vlastimil Babka Cc: Johannes Weiner Cc: Anthony Yznaga Cc: Michal Hocko Cc: Oscar Salvador Cc: Mel Gorman Cc: Mike Rapoport Cc: Dan Williams Cc: Anshuman Khandual Cc: Qian Cai Cc: Pingfan Liu Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-7-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 255f598507083905995ecab96392770ae03aac7f Author: David Hildenbrand Date: Thu May 7 16:01:29 2020 +0200 virtio-mem: Paravirtualized memory hotunplug part 2 We also want to unplug online memory (contained in online memory blocks and, therefore, managed by the buddy), and eventually replug it later. When requested to unplug memory, we use alloc_contig_range() to allocate subblocks in online memory blocks (so we are the owner) and send them to our hypervisor. When requested to plug memory, we can replug such memory using free_contig_range() after asking our hypervisor. We also want to mark all allocated pages PG_offline, so nobody will touch them. To differentiate pages that were never onlined when onlining the memory block from pages allocated via alloc_contig_range(), we use PageDirty(). Based on this flag, virtio_mem_fake_online() can either online the pages for the first time or use free_contig_range(). It is worth noting that there are no guarantees on how much memory can actually get unplugged again. All device memory might completely be fragmented with unmovable data, such that no subblock can get unplugged. We are not touching the ZONE_MOVABLE. If memory is onlined to the ZONE_MOVABLE, it can only get unplugged after that memory was offlined manually by user space. In normal operation, virtio-mem memory is suggested to be onlined to ZONE_NORMAL. In the future, we will try to make unplug more likely to succeed. Add a module parameter to control if online memory shall be touched. As we want to access alloc_contig_range()/free_contig_range() from kernel module context, export the symbols. Note: Whenever virtio-mem uses alloc_contig_range(), all affected pages are on the same node, in the same zone, and contain no holes. Acked-by: Michal Hocko # to export contig range allocator API Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Cc: Mel Gorman Cc: Mike Rapoport Cc: Alexander Duyck Cc: Alexander Potapenko Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-6-david@redhat.com Signed-off-by: Michael S. Tsirkin commit c627ff5d982276908188fae86dbe727ed49c9594 Author: David Hildenbrand Date: Thu May 7 16:01:28 2020 +0200 virtio-mem: Paravirtualized memory hotunplug part 1 Unplugging subblocks of memory blocks that are offline is easy. All we have to do is watch out for concurrent onlining activity. Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-5-david@redhat.com Signed-off-by: Michael S. Tsirkin commit f2af6d3978d74a7891d0f428537b4494498202cb Author: David Hildenbrand Date: Thu May 7 16:01:27 2020 +0200 virtio-mem: Allow to specify an ACPI PXM as nid We want to allow to specify (similar as for a DIMM), to which node a virtio-mem device (and, therefore, its memory) belongs. Add a new virtio-mem feature flag and export pxm_to_node, so it can be used in kernel module context. Acked-by: Michal Hocko # for the export Acked-by: "Rafael J. Wysocki" # for the export Acked-by: Pankaj Gupta Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-4-david@redhat.com Signed-off-by: Michael S. Tsirkin commit dfb0b2e46d04d0b58754426184571a959bf30dce Author: David Hildenbrand Date: Thu May 7 16:01:26 2020 +0200 MAINTAINERS: Add myself as virtio-mem maintainer Let's make sure patches/bug reports find the right person. Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-3-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 5f1f79bbc9e26fa9412fa9522f957bb8f030c442 Author: David Hildenbrand Date: Thu May 7 16:01:25 2020 +0200 virtio-mem: Paravirtualized memory hotplug Each virtio-mem device owns exactly one memory region. It is responsible for adding/removing memory from that memory region on request. When the device driver starts up, the requested amount of memory is queried and then plugged to Linux. On request, further memory can be plugged or unplugged. This patch only implements the plugging part. On x86-64, memory can currently be plugged in 4MB ("subblock") granularity. When required, a new memory block will be added (e.g., usually 128MB on x86-64) in order to plug more subblocks. Only x86-64 was tested for now. The online_page callback is used to keep unplugged subblocks offline when onlining memory - similar to the Hyper-V balloon driver. Unplugged pages are marked PG_offline, to tell dump tools (e.g., makedumpfile) to skip them. User space is usually responsible for onlining the added memory. The memory hotplug notifier is used to synchronize virtio-mem activity against memory onlining/offlining. Each virtio-mem device can belong to a NUMA node, which allows us to easily add/remove small chunks of memory to/from a specific NUMA node by using multiple virtio-mem devices. Something that works even when the guest has no idea about the NUMA topology. One way to view virtio-mem is as a "resizable DIMM" or a DIMM with many "sub-DIMMS". This patch directly introduces the basic infrastructure to implement memory unplug. Especially the memory block states and subblock bitmaps will be heavily used there. Notes: - In case memory is to be onlined by user space, we limit the amount of offline memory blocks, to not run out of memory. This is esp. an issue if memory is added faster than it is getting onlined. - Suspend/Hibernate is not supported due to the way virtio-mem devices behave. Limited support might be possible in the future. - Reloading the device driver is not supported. Reviewed-by: Pankaj Gupta Tested-by: Pankaj Gupta Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Oscar Salvador Cc: Michal Hocko Cc: Igor Mammedov Cc: Dave Young Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Stefan Hajnoczi Cc: Vlastimil Babka Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200507140139.17083-2-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 18e643cd6c4dcdb09510a4bf739438e7cd1ae1f2 Author: Samuel Zou Date: Sat May 9 10:20:02 2020 +0800 vdpasim: Fix some coccinelle warnings Fix below warnings reported by coccicheck: drivers/vdpa/vdpa_sim/vdpa_sim.c:104:1-10: WARNING: Assignment of 0/1 to bool variable drivers/vdpa/vdpa_sim/vdpa_sim.c:164:7-11: WARNING: Unsigned expression compared with zero: read <= 0 drivers/vdpa/vdpa_sim/vdpa_sim.c:169:7-12: WARNING: Unsigned expression compared with zero: write <= 0 1. The 'ready' variable in vdpasim_virtqueue struct is bool type. It is better to initialize vq->ready to false 2. Modify 'read' and 'write' variables type from size_t to ssize_t. And preserve the reverse christmas tree ordering of local variables. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Link: https://lore.kernel.org/r/1588990802-28451-1-git-send-email-zou_wei@huawei.com Signed-off-by: Michael S. Tsirkin commit 7dd793f37e2ab4ca6585df8cfb1a1fcf44f61248 Author: Zhu Lingshan Date: Tue May 12 16:00:44 2020 +0800 ifcvf: move IRQ request/free to status change handlers This commit move IRQ request and free operations from probe() to VIRTIO status change handler to comply with VIRTIO spec. VIRTIO spec 1.1, section 2.1.2 Device Requirements: Device Status Field The device MUST NOT consume buffers or send any used buffer notifications to the driver before DRIVER_OK. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/1589270444-3669-1-git-send-email-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 002ef18eff43708be1d914cb11dbdd84fb149474 Author: Guennadi Liakhovetski Date: Wed May 27 20:05:38 2020 +0200 vhost: (cosmetic) remove a superfluous variable initialisation Even the compiler is able to figure out that in this case the initialisation is superfluous. Signed-off-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200527180541.5570-3-guennadi.liakhovetski@linux.intel.com Signed-off-by: Michael S. Tsirkin commit d90ca42012db2863a9a30b564a2ace6016594bda Author: Longpeng(Mike) Date: Tue Jun 2 15:05:01 2020 +0800 crypto: virtio: Fix dest length calculation in __virtio_crypto_skcipher_do_req() The src/dst length is not aligned with AES_BLOCK_SIZE(which is 16) in some testcases in tcrypto.ko. For example, the src/dst length of one of cts(cbc(aes))'s testcase is 17, the crypto_virtio driver will set @src_data_len=16 but @dst_data_len=17 in this case and get a wrong at then end. SRC: pp pp pp pp pp pp pp pp pp pp pp pp pp pp pp pp pp (17 bytes) EXP: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc pp (17 bytes) DST: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 00 (pollute the last bytes) (pp: plaintext cc:ciphertext) Fix this issue by limit the length of dest buffer. Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver") Cc: Gonglei Cc: Herbert Xu Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: "David S. Miller" Cc: virtualization@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Longpeng(Mike) Link: https://lore.kernel.org/r/20200602070501.2023-4-longpeng2@huawei.com Signed-off-by: Michael S. Tsirkin commit 8c855f0720ff006d75d0a2512c7f6c4f60ff60ee Author: Longpeng(Mike) Date: Tue Jun 2 15:05:00 2020 +0800 crypto: virtio: Fix use-after-free in virtio_crypto_skcipher_finalize_req() The system'll crash when the users insmod crypto/tcrypto.ko with mode=155 ( testing "authenc(hmac(sha1),cbc(aes))" ). It's caused by reuse the memory of request structure. In crypto_authenc_init_tfm(), the reqsize is set to: [PART 1] sizeof(authenc_request_ctx) + [PART 2] ictx->reqoff + [PART 3] MAX(ahash part, skcipher part) and the 'PART 3' is used by both ahash and skcipher in turn. When the virtio_crypto driver finish skcipher req, it'll call ->complete callback(in crypto_finalize_skcipher_request) and then free its resources whose pointers are recorded in 'skcipher parts'. However, the ->complete is 'crypto_authenc_encrypt_done' in this case, it will use the 'ahash part' of the request and change its content, so virtio_crypto driver will get the wrong pointer after ->complete finish and mistakenly free some other's memory. So the system will crash when these memory will be used again. The resources which need to be cleaned up are not used any more. But the pointers of these resources may be changed in the function "crypto_finalize_skcipher_request". Thus release specific resources before calling this function. Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver") Reported-by: LABBE Corentin Cc: Gonglei Cc: Herbert Xu Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: "David S. Miller" Cc: virtualization@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200123101000.GB24255@Red Acked-by: Gonglei Signed-off-by: Longpeng(Mike) Link: https://lore.kernel.org/r/20200602070501.2023-3-longpeng2@huawei.com Signed-off-by: Michael S. Tsirkin commit b02989f37fc5e865ceeee9070907e4493b3a21e2 Author: Longpeng(Mike) Date: Tue Jun 2 15:04:59 2020 +0800 crypto: virtio: Fix src/dst scatterlist calculation in __virtio_crypto_skcipher_do_req() The system will crash when the users insmod crypto/tcrypt.ko with mode=38 ( testing "cts(cbc(aes))" ). Usually the next entry of one sg will be @sg@ + 1, but if this sg element is part of a chained scatterlist, it could jump to the start of a new scatterlist array. Fix it by sg_next() on calculation of src/dst scatterlist. Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver") Reported-by: LABBE Corentin Cc: Herbert Xu Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: "David S. Miller" Cc: virtualization@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200123101000.GB24255@Red Signed-off-by: Gonglei Signed-off-by: Longpeng(Mike) Link: https://lore.kernel.org/r/20200602070501.2023-2-longpeng2@huawei.com Signed-off-by: Michael S. Tsirkin commit fb69c2c896fc8289b0d9e2c0791472e7cd398bca Author: Alexander Duyck Date: Fri May 8 10:40:06 2020 -0700 virtio-balloon: Disable free page reporting if page poison reporting is not enabled We should disable free page reporting if page poisoning is enabled but we cannot report it via the balloon interface. This way we can avoid the possibility of corrupting guest memory. Normally the page poisoning feature should always be present when free page reporting is enabled on the hypervisor, however this allows us to correctly handle a case of the virtio-balloon device being possibly misconfigured. Fixes: 5d757c8d518d ("virtio-balloon: add support for providing free page reports to host") Cc: stable@vger.kernel.org Acked-by: David Hildenbrand Signed-off-by: Alexander Duyck Link: https://lore.kernel.org/r/20200508173732.17877.85060.stgit@localhost.localdomain Signed-off-by: Michael S. Tsirkin commit 4b4e4867d92205158c524842f59b1c1caeb969fe Author: Michael S. Tsirkin Date: Thu Jun 4 14:47:29 2020 -0400 vhost_vdpa: disable doorbell mapping for !MMU There could be ways to support doorbell mapping with !MMU, but things like pgprot_noncached are not universally supported. Fixable, but just disable this for now. Signed-off-by: Michael S. Tsirkin commit ddd89d0a059d8e9740c75a97e0efe9bf07ee51f9 Author: Jason Wang Date: Fri May 29 16:03:01 2020 +0800 vhost_vdpa: support doorbell mapping via mmap Currently the doorbell is relayed via eventfd which may have significant overhead because of the cost of vmexits or syscall. This patch introduces mmap() based doorbell mapping which can eliminate the overhead caused by vmexit or syscall. To ease the userspace modeling of the doorbell layout (usually virtio-pci), this patch starts from a doorbell per page model. Vhost-vdpa only support the hardware doorbell that sit at the boundary of a page and does not share the page with other registers. Doorbell of each virtqueue must be mapped separately, pgoff is the index of the virtqueue. This allows userspace to map a subset of the doorbell which may be useful for the implementation of software assisted virtqueue (control vq) in the future. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20200529080303.15449-5-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin commit c25a26e653a61b93339dcd1b734c889df60b3eef Author: Jason Wang Date: Fri May 29 16:03:00 2020 +0800 vdpa: introduce get_vq_notification method This patch introduces a new method in the vdpa_config_ops which reports the physical address and the size of the doorbell for a specific virtqueue. This will be used by the future patches that maps doorbell to userspace. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20200529080303.15449-4-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin commit 5ce995f313ce56c0c62425c3ddc37c5c50fc33db Author: Jason Wang Date: Fri May 29 16:02:59 2020 +0800 vhost: use mmgrab() instead of mmget() for non worker device For the device that doesn't use vhost worker and use_mm(), mmget() is too heavy weight and it may brings troubles for implementing mmap() support for vDPA device. This is because, an reference to the address space was held via mm_get() in vhost_dev_set_owner() and an reference to the file was held in mmap(). This means when process exits, the mm can not be released thus we can not release the file. This patch tries to use mmgrab() instead of mmget(), which allows the address space to be destroy in process exit without releasing the mm structure itself. This is sufficient for vDPA device which pin user pages and does not depend on the address space to work. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20200529080303.15449-3-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin commit 01fcb1cbc88effb3493c6197efc96b69b9f4823a Author: Jason Wang Date: Fri May 29 16:02:58 2020 +0800 vhost: allow device that does not depend on vhost worker vDPA device currently relays the eventfd via vhost worker. This is inefficient due the latency of wakeup and scheduling, so this patch tries to introduce a use_worker attribute for the vhost device. When use_worker is not set with vhost_dev_init(), vhost won't try to allocate a worker thread and the vhost_poll will be processed directly in the wakeup function. This help for vDPA since it reduces the latency caused by vhost worker. In my testing, it saves 0.2 ms in pings between VMs on a mutual host. Signed-off-by: Zhu Lingshan Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20200529080303.15449-2-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin commit ba4e627921b179539dc97706ca12e7a244833741 Merge: 3741679ba4b4 11362b1befea Author: Paolo Bonzini Date: Thu Jun 4 14:58:03 2020 -0400 Merge tag 'kvm-ppc-next-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD PPC KVM update for 5.8 - Updates and bug fixes for secure guest support - Other minor bug fixes and cleanups. commit 331cc667a99c633abbbebeab4675beae713fb331 Author: Steve French Date: Tue Jun 2 23:30:50 2020 -0500 cifs: update internal module version number To 2.27 Signed-off-by: Steve French commit 2f58967979409ea3ec799343aa35e9007f735a3b Author: Aurelien Aptel Date: Fri Apr 24 16:55:31 2020 +0200 cifs: multichannel: try to rebind when reconnecting a channel first steps in trying to make channels properly reconnect. * add cifs_ses_find_chan() function to find the enclosing cifs_chan struct it belongs to * while we have the session lock and are redoing negprot and sess.setup in smb2_reconnect() redo the binding of channels. Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit 8eec79540d2b9cec385707be45f6e9388b34020f Author: Aurelien Aptel Date: Fri Apr 24 15:24:05 2020 +0200 cifs: multichannel: use pointer for binding channel Add a cifs_chan pointer in struct cifs_ses that points to the channel currently being bound if ses->binding is true. Previously it was always the channel past the established count. This will make reconnecting (and rebinding) a channel easier later on. Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit edb161353680e6d488d94cbcaf967745bee98d17 Author: Steve French Date: Sun May 31 14:36:56 2020 -0500 smb3: remove static checker warning Remove static checker warning pointed out by Dan Carpenter: The patch feeaec621c09: "cifs: multichannel: move channel selection above transport layer" from Apr 24, 2020, leads to the following static checker warning: fs/cifs/smb2pdu.c:149 smb2_hdr_assemble() error: we previously assumed 'tcon->ses' could be null (see line 133) Reported-by: Dan Carpenter CC: Aurelien Aptel Signed-off-by: Steve French commit 352d96f3acc6e02099f58a24d5cabce7f8ee061f Author: Aurelien Aptel Date: Sun May 31 12:38:22 2020 -0500 cifs: multichannel: move channel selection above transport layer Move the channel (TCP_Server_Info*) selection from the tranport layer to higher in the call stack so that: - credit handling is done with the server that will actually be used to send. * ->wait_mtu_credit * ->set_credits / set_credits * ->add_credits / add_credits * add_credits_and_wake_if - potential reconnection (smb2_reconnect) done when initializing a request is checked and done with the server that will actually be used to send. To do this: - remove the cifs_pick_channel() call out of compound_send_recv() - select channel and pass it down by adding a cifs_pick_channel(ses) call in: - smb311_posix_mkdir - SMB2_open - SMB2_ioctl - __SMB2_close - query_info - SMB2_change_notify - SMB2_flush - smb2_async_readv (if none provided in context param) - SMB2_read (if none provided in context param) - smb2_async_writev (if none provided in context param) - SMB2_write (if none provided in context param) - SMB2_query_directory - send_set_info - SMB2_oplock_break - SMB311_posix_qfs_info - SMB2_QFS_info - SMB2_QFS_attr - smb2_lockv - SMB2_lease_break - smb2_compound_op - smb2_set_ea - smb2_ioctl_query_info - smb2_query_dir_first - smb2_query_info_comound - smb2_query_symlink - cifs_writepages - cifs_write_from_iter - cifs_send_async_read - cifs_read - cifs_readpages - add TCP_Server_Info *server param argument to: - cifs_send_recv - compound_send_recv - SMB2_open_init - SMB2_query_info_init - SMB2_set_info_init - SMB2_close_init - SMB2_ioctl_init - smb2_iotcl_req_init - SMB2_query_directory_init - SMB2_notify_init - SMB2_flush_init - build_qfs_info_req - smb2_hdr_assemble - smb2_reconnect - fill_small_buf - smb2_plain_req_init - __smb2_plain_req_init The read/write codepath is different than the rest as it is using pages, io iterators and async calls. To deal with those we add a server pointer in the cifs_writedata/cifs_readdata/cifs_io_parms context struct and set it in: - cifs_writepages (wdata) - cifs_write_from_iter (wdata) - cifs_readpages (rdata) - cifs_send_async_read (rdata) The [rw]data->server pointer is eventually copied to cifs_io_parms->server to pass it down to SMB2_read/SMB2_write. If SMB2_read/SMB2_write is called from a different place that doesn't set the server field it will pick a channel. Some places do not pick a channel and just use ses->server or cifs_ses_server(ses). All cifs_ses_server(ses) calls are in codepaths involving negprot/sess.setup. - SMB2_negotiate (binding channel) - SMB2_sess_alloc_buffer (binding channel) - SMB2_echo (uses provided one) - SMB2_logoff (uses master) - SMB2_tdis (uses master) (list not exhaustive) Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit 7c06514afd38ed7a4b83edfd39ab033c804b4cf3 Author: Aurelien Aptel Date: Thu Jun 4 17:23:55 2020 +0200 cifs: multichannel: always zero struct cifs_io_parms SMB2_read/SMB2_write check and use cifs_io_parms->server, which might be uninitialized memory. This change makes all callers zero-initialize the struct. Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit 8e84a61a9c5ce55c5707448bb3c2cc544fccaa21 Author: Kenneth D'souza Date: Thu Jun 4 21:14:41 2020 +0530 cifs: dump Security Type info in DebugData Currently the end user is unaware with what sec type the cifs share is mounted if no sec= option is parsed. With this patch one can easily check from DebugData. Example: 1) Name: x.x.x.x Uses: 1 Capability: 0x8001f3fc Session Status: 1 Security type: RawNTLMSSP Signed-off-by: Kenneth D'souza Signed-off-by: Roberto Bergantinos Corpas Signed-off-by: Steve French Acked-by: Aurelien Aptel commit e78790f84a5417287965a06cd4dea85df0743935 Author: Sahitya Tummala Date: Tue Jun 2 18:11:47 2020 +0530 f2fs: fix retry logic in f2fs_write_cache_pages() In case a compressed file is getting overwritten, the current retry logic doesn't include the current page to be retried now as it sets the new start index as 0 and new end index as writeback_index - 1. This causes the corresponding cluster to be uncompressed and written as normal pages without compression. Fix this by allowing writeback to be retried for the current page as well (in case of compressed page getting retried due to index mismatch with cluster index). So that this cluster can be written compressed in case of overwrite. Also, align f2fs_write_cache_pages() according to the change - <64081362e8ff>("mm/page-writeback.c: fix range_cyclic writeback vs writepages deadlock"). Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3741679ba4b4b207e52587cfbee1a9bba947b15b Author: Anthony Yznaga Date: Tue Jun 2 13:07:30 2020 -0700 KVM: x86: minor code refactor and comments fixup around dirty logging Consolidate the code and correct the comments to show that the actions taken to update existing mappings to disable or enable dirty logging are not necessary when creating, moving, or deleting a memslot. Signed-off-by: Anthony Yznaga Message-Id: <1591128450-11977-4-git-send-email-anthony.yznaga@oracle.com> Signed-off-by: Paolo Bonzini commit 4b44295538b421de2de8b5754472284fe2daa4e9 Author: Anthony Yznaga Date: Tue Jun 2 13:07:29 2020 -0700 KVM: x86: avoid unnecessary rmap walks when creating/moving slots On large memory guests it has been observed that creating a memslot for a very large range can take noticeable amount of time. Investigation showed that the time is spent walking the rmaps to update existing sptes to remove write access or set/clear dirty bits to support dirty logging. These rmap walks are unnecessary when creating or moving a memslot. A newly created memslot will not have any existing mappings, and the existing mappings of a moved memslot will have been invalidated and flushed. Any mappings established once the new/moved memslot becomes visible will be set using the properties of the new slot. Signed-off-by: Anthony Yznaga Message-Id: <1591128450-11977-3-git-send-email-anthony.yznaga@oracle.com> Signed-off-by: Paolo Bonzini commit 5688fed649f15a232e75148afb0a28864046f44c Author: Anthony Yznaga Date: Tue Jun 2 13:07:28 2020 -0700 KVM: x86: remove unnecessary rmap walk of read-only memslots There's no write access to remove. An existing memslot cannot be updated to set or clear KVM_MEM_READONLY, and any mappings established in a newly created or moved read-only memslot will already be read-only. Signed-off-by: Anthony Yznaga Message-Id: <1591128450-11977-2-git-send-email-anthony.yznaga@oracle.com> Signed-off-by: Paolo Bonzini commit 7ec28e264f2e52089c14c6f8eba1ce7b6501e59b Author: Denis Efremov Date: Wed Jun 3 13:11:31 2020 +0300 KVM: Use vmemdup_user() Replace opencoded alloc and copy with vmemdup_user(). Signed-off-by: Denis Efremov Message-Id: <20200603101131.2107303-1-efremov@linux.com> Signed-off-by: Paolo Bonzini commit 9fb4c5250f10dc4d8257cd766991be690eb25c5b Merge: a789d5f8a99a f55d9895884b Author: Linus Torvalds Date: Thu Jun 4 11:13:03 2020 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching updates from Jiri Kosina: - simplifications and improvements for issues Peter Ziljstra found during his previous work on W^X cleanups. This allows us to remove livepatch arch-specific .klp.arch sections and add proper support for jump labels in patched code. Also, this patchset removes the last module_disable_ro() usage in the tree. Patches from Josh Poimboeuf and Peter Zijlstra - a few other minor cleanups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: MAINTAINERS: add lib/livepatch to LIVE PATCHING livepatch: add arch-specific headers to MAINTAINERS livepatch: Make klp_apply_object_relocs static MAINTAINERS: adjust to livepatch .klp.arch removal module: Make module_enable_ro() static again x86/module: Use text_mutex in apply_relocate_add() module: Remove module_disable_ro() livepatch: Remove module_disable_ro() usage x86/module: Use text_poke() for late relocations s390/module: Use s390_kernel_write() for late relocations s390: Change s390_kernel_write() return type to match memcpy() livepatch: Prevent module-specific KLP rela sections from referencing vmlinux symbols livepatch: Remove .klp.arch livepatch: Apply vmlinux-specific KLP relocations early livepatch: Disallow vmlinux.ko commit 0e96edd9a9c2e75ece7f581d4f75d26b38cd53ba Author: Sean Christopherson Date: Wed May 27 20:11:21 2020 -0700 x86/kvm: Remove defunct KVM_DEBUG_FS Kconfig Remove KVM_DEBUG_FS, which can easily be misconstrued as controlling KVM-as-a-host. The sole user of CONFIG_KVM_DEBUG_FS was removed by commit cfd8983f03c7b ("x86, locking/spinlocks: Remove ticket (spin)lock implementation"). Signed-off-by: Sean Christopherson Message-Id: <20200528031121.28904-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit a789d5f8a99a366778a6e42b3700a246244201a6 Merge: 631d6914085b 16ba7e312045 Author: Linus Torvalds Date: Thu Jun 4 11:10:14 2020 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - hid-mcp2221 GPIO support, from Rishi Gupta - MT_CLS_WIN_8_DUAL obsolete quirk removal from hid-multitouch, from Kai-Heng Feng - a bunch of new hardware support to hid-asus driver, from Hans de Goede - other assorted small fixes, cleanups and device-specific quirks * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: multitouch: Remove MT_CLS_WIN_8_DUAL HID: multitouch: enable multi-input as a quirk for some devices HID: sony: Fix for broken buttons on DS3 USB dongles HID: Add quirks for Trust Panora Graphic Tablet HID: apple: Swap the Fn and Left Control keys on Apple keyboards HID: asus: Add depends on USB_HID to HID_ASUS Kconfig option HID: asus: Fix mute and touchpad-toggle keys on Medion Akoya E1239T HID: asus: Add support for multi-touch touchpad on Medion Akoya E1239T HID: asus: Add report_size to struct asus_touchpad_info HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dock HID: asus: Only set EV_REP if we are adding a mapping HID: i2c-hid: add Schneider SCL142ALM to descriptor override HID: intel-ish-hid: avoid bogus uninitialized-variable warning HID: mcp2221: add GPIO functionality support HID: fix typo in Kconfig HID: logitech: drop outdated references to unifying receivers commit 631d6914085b4eea8d68a84f800974a6ad8fb5c0 Merge: a0a4d17e02a8 d9b8fbf15d05 Author: Linus Torvalds Date: Thu Jun 4 11:07:38 2020 -0700 Merge tag 'sound-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "It was another busy development cycle, and the majority of changes are found in ASoC side. Below are Some highlights. ASoC core: - Lots of core cleanups and refactorings, still on-going work by Morimoto-san ASoC drivers: - Continued work on cleaning up and improving the Intel SOF stuff, along with new platform support including SoundWire - Fixes to make the Marvell SSPA driver work upstream - Support for AMD Renoir ACP, Dialog DA7212, Freescale EASRC and i.MX8M, Intel Elkhard Lake, Maxim MAX98390, Nuvoton NAU8812 and NAU8814 and Realtek RT1016. USB-audio: - Improvement for sync and implicit feedback streams with the more accurate frame size calculation and full-duplex support - Support for RME Babyface Pro and Prioneer DJ DJM HD-audio: - Fixes for Mic mute LED on HP machines - Re-enable support of Intel SST driver for SKL/KBL platforms FireWire: - Lots of refactoring, add support for RME FireFace and MOTU UltraLite-mk3" * tag 'sound-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (428 commits) ALSA: es1688: Add the missed snd_card_free() ALSA: hda: add sienna_cichlid audio asic id for sienna_cichlid up ALSA: usb-audio: Add Pioneer DJ DJM-900NXS2 support ASoC: qcom: q6asm-dai: kCFI fix ASoC: soc-card: add snd_soc_card_remove_dai_link() ASoC: soc-card: add snd_soc_card_add_dai_link() ASoC: soc-card: add snd_soc_card_set_bias_level_post() ASoC: soc-card: add snd_soc_card_set_bias_level() ASoC: soc-card: add snd_soc_card_remove() ASoC: soc-card: add snd_soc_card_late_probe() ASoC: soc-card: add snd_soc_card_probe() ASoC: soc-card: add probed bit field to snd_soc_card ASoC: soc-card: add snd_soc_card_resume_post() ASoC: soc-card: add snd_soc_card_resume_pre() ASoC: soc-card: add snd_soc_card_suspend_post() ASoC: soc-card: add snd_soc_card_suspend_pre() ASoC: soc-card: move snd_soc_card_subclass to soc-card ASoC: soc-card: move snd_soc_card_get_codec_dai() to soc-card ASoC: soc-card: move snd_soc_card_set/get_drvdata() to soc-card ASoC: soc-card: move snd_soc_card_jack_new() to soc-card ... commit a0a4d17e02a80a74a63c7cbb7bc8cea2f0b7d8b1 Merge: 86c67ce20d08 46d079790663 Author: Linus Torvalds Date: Thu Jun 4 11:05:27 2020 -0700 Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux Pull pcmcia updates from Dominik Brodowski: "Two minor PCMCIA odd fixes: one replacing zero-length arrays with a flexible-array member, and one making a local function static" * 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: pcmcia: make pccard_loop_tuple() static pcmcia: Replace zero-length array with flexible-array commit 86c67ce20d080bdfefafd461d3068cad0a49a66b Merge: 9875b201e05a 59ea3c9faf32 Author: Linus Torvalds Date: Thu Jun 4 11:03:45 2020 -0700 Merge tag 'leds-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "New drivers: aw2013, sgm3140, some fixes Nothing much to see here, next release should be more interesting" * tag 'leds-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: add aw2013 driver dt-bindings: leds: Add binding for aw2013 leds: trigger: remove redundant assignment to variable ret leds: netxbig: Convert to use GPIO descriptors leds: add sgm3140 driver dt-bindings: leds: Add binding for sgm3140 leds: ariel: Add driver for status LEDs on Dell Wyse 3020 leds: pwm: check result of led_pwm_set() in led_pwm_add() leds: tlc591xxt: hide error on EPROBE_DEFER leds: tca6507: Include the right header leds: lt3593: Drop surplus include leds: lp3952: Include the right header leds: lm355x: Drop surplus include commit 2bd81cd04a3f5eb873cc81fa16c469377be3b092 Merge: 5a881eb3d138 3e5095eebe01 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:20 2020 -0500 Merge branch 'remotes/lorenzo/pci/vmd' - Fix vmd resource address calculation using Host Physical Address shadow register (Jon Derrick) * remotes/lorenzo/pci/vmd: PCI: vmd: Filter resource type bits from shadow register commit 5a881eb3d138bd1408ea22d2c2917a935b2a1ea9 Merge: 62e8a5ad4732 bca718988b90 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:19 2020 -0500 Merge branch 'remotes/lorenzo/pci/v3-semi' - Fix memory leak in probe error paths (Christophe JAILLET) * remotes/lorenzo/pci/v3-semi: PCI: v3-semi: Fix a memory leak in v3_pci_probe() error handling paths commit 62e8a5ad47323d21c4364e0c2f7852f9a9fef036 Merge: 51755de7398c fcee90cdf6f3 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:19 2020 -0500 Merge branch 'remotes/lorenzo/pci/tegra' - Fix error message for failure to get reset GPIO from DT (Pali Rohár) - Fix runtime PM imbalance on error path (both tegra and tegra194) (Dinghao Liu) * remotes/lorenzo/pci/tegra: PCI: tegra: Fix runtime PM imbalance on error PCI: tegra194: Fix runtime PM imbalance on error PCI: tegra: Fix reporting GPIO error value commit 51755de7398c596abbce6890ca6c62525f87d981 Merge: c521b7d5b804 56ad4a1b368a Author: Bjorn Helgaas Date: Thu Jun 4 12:59:18 2020 -0500 Merge branch 'remotes/lorenzo/pci/rcar' - Fix rcar OB window programming (Andrew Murray) - Add rcar suspend/resume support (Kazufumi Ikeda) - Add r8a77961 to DT binding (Yoshihiro Shimoda) - Rename pcie-rcar.c to pcie-rcar-host.c to make room for endpoint mode (Lad Prabhakar) - Move shareable code to pcie-rcar.c (Lad Prabhakar) - Correct PCIEPAMR mask calculation for "size < 128" (Lad Prabhakar) - Add endpoint support for multiple outbound memory windows (Lad Prabhakar) - Add R-Car PCIe endpoint driver and DT bindings (Lad Prabhakar) * remotes/lorenzo/pci/rcar: MAINTAINERS: Add file patterns for rcar PCI device tree bindings PCI: rcar: Add endpoint mode support dt-bindings: PCI: rcar: Add bindings for R-Car PCIe endpoint controller PCI: endpoint: Add support to handle multiple base for mapping outbound memory PCI: endpoint: Pass page size as argument to pci_epc_mem_init() PCI: rcar: Fix calculating mask for PCIEPAMR register PCI: rcar: Move shareable code to a common file PCI: rcar: Rename pcie-rcar.c to pcie-rcar-host.c dt-bindings: pci: rcar: add r8a77961 support PCI: rcar: Add suspend/resume PCI: rcar: Fix incorrect programming of OB windows commit c521b7d5b8047ee7d1800cea003831fb790b5019 Merge: 210d8ea82a0b 1446978d560f Author: Bjorn Helgaas Date: Thu Jun 4 12:59:18 2020 -0500 Merge branch 'remotes/lorenzo/pci/pci-bridge-emul' - Fix conflicts in pci-bridge-emul descriptions of Device Status and Slot Control (Jon Derrick) - Add emulation for more Device Status, Link Control, and Slot Control bits (Jon Derrick) - Improve emulation of reserved bits (Jon Derrick) * remotes/lorenzo/pci/pci-bridge-emul: PCI: pci-bridge-emul: Eliminate the 'reserved' member PCI: pci-bridge-emul: Update for PCIe 5.0 r1.0 PCI: pci-bridge-emul: Fix Root Cap/Status comment PCI: pci-bridge-emul: Fix PCIe bit conflicts commit 210d8ea82a0bd4ea10ee46690a1edf5def9dcd63 Merge: 7c9908d3c8ef 7fdde0f9a571 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:17 2020 -0500 Merge branch 'remotes/lorenzo/pci/misc' - Correct MAINTAINERS typo for NXP LAYERSCAPE GEN4 (Lukas Bulwahn) - Make PCI endpoint doc section labels unique (Bryce Willey) * remotes/lorenzo/pci/misc: Documentation: PCI: Give unique labels to sections MAINTAINERS: correct typo in new NXP LAYERSCAPE GEN4 commit 7c9908d3c8ef66411fc6a6e31ee283712c13928a Merge: d388e541e2e3 d0684fd0bd79 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:17 2020 -0500 Merge branch 'remotes/lorenzo/pci/hv' - Release resource in probe failure path (Wei Hu) - Retry PCI bus D0 entry if device state is invalid (Wei Hu) - Use struct_size() to help avoid type mistakes (Gustavo A. R. Silva) * remotes/lorenzo/pci/hv: PCI: hv: Use struct_size() helper PCI: hv: Retry PCI bus D0 entry on invalid device state PCI: hv: Fix the PCI HyperV probe failure path to release resource properly commit d388e541e2e3e26adfd9b1c99144176a73e19f95 Merge: d611b2b85331 b2f75a41eaa6 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:16 2020 -0500 Merge branch 'remotes/lorenzo/pci/host-generic' - Constify struct pci_ecam_ops (Rob Herring) - Support building as modules (Rob Herring) - Eliminate wrappers for pci_host_common_probe() by using DT match table data (Rob Herring) * remotes/lorenzo/pci/host-generic: PCI: host-generic: Eliminate pci_host_common_probe wrappers PCI: host-generic: Support building as modules PCI: Constify struct pci_ecam_ops # Conflicts: # drivers/pci/controller/dwc/pcie-hisi.c commit d611b2b85331f3c69863d78835e95d1a5d01f2ef Merge: b9fcf4910b72 0e86d981f9b7 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:16 2020 -0500 Merge branch 'remotes/lorenzo/pci/endpoint' - Avoid NULL pointer dereference in dma_release_channel() (Kunihiko Hayashi) * remotes/lorenzo/pci/endpoint: PCI: endpoint: functions/pci-epf-test: Fix DMA channel release commit b9fcf4910b72dd4d94b36989df5d6bcf7795c18d Merge: 712879510fa4 8d7e33d6811f Author: Bjorn Helgaas Date: Thu Jun 4 12:59:15 2020 -0500 Merge branch 'remotes/lorenzo/pci/dwc' - Simplify computation of msix_tbl (Jiri Slaby) - Make hisi_pcie_platform_ops static (Zou Wei) - Warn about resources above 4G (Alan Mikhak) - Make intel_pcie_cpu_addr() static (Jason Yan) - Use devm_platform_ioremap_resource_byname() to simplify code and improve error checking (Wei Yongjun) - Fix inner MSI IRQ domain registration so it doesn't confuse debugfs (Marc Zyngier) - Don't use FAST_LINK_MODE on meson (Marc Zyngier) - Add Socionext UniPhier Pro5 PCIe endpoint controller driver and DT description (Kunihiko Hayashi) * remotes/lorenzo/pci/dwc: PCI: uniphier: Add Socionext UniPhier Pro5 PCIe endpoint controller driver dt-bindings: PCI: Add UniPhier PCIe endpoint controller description PCI: dwc: Use private data pointer of "struct irq_domain" to get pcie_port PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link PCI: dwc: Fix inner MSI IRQ domain registration PCI: dwc: pci-dra7xx: Use devm_platform_ioremap_resource_byname() PCI: dwc: intel: Make intel_pcie_cpu_addr() static PCI: dwc: Program outbound ATU upper limit register PCI: dwc: Make hisi_pcie_platform_ops static PCI: dwc: Clean up computing of msix_tbl commit 712879510fa4930b65748046426ac4a730512bba Merge: a1dcc1aa6f67 7fb39bf2a1de Author: Bjorn Helgaas Date: Thu Jun 4 12:59:15 2020 -0500 Merge branch 'remotes/lorenzo/pci/cadence' - Deprecate 'cdns,max-outbound-regions' and 'cdns,no-bar-match-nbits' bindings in favor of deriving them from 'ranges' and 'dma-ranges' (Kishon Vijay Abraham I) - Read Vendor and Device ID as 32 bits (not 16) from DT (Kishon Vijay Abraham I) * remotes/lorenzo/pci/cadence: PCI: cadence: Fix to read 32-bit Vendor ID/Device ID property from DT PCI: cadence: Remove "cdns,max-outbound-regions" DT property dt-bindings: PCI: cadence: Deprecate inbound/outbound specific bindings commit a1dcc1aa6f67243e1622a55a345a37343af14b4e Merge: 754262d1befb c65822fef4ad Author: Bjorn Helgaas Date: Thu Jun 4 12:59:14 2020 -0500 Merge branch 'remotes/lorenzo/pci/brcmstb' - Assert fundamental reset on initialization (Nicolas Saenz Julienne) - Remove unnecessary clk_put(); devm_clk_get() handles this automatically (Jim Quinlan) - Fix outbound memory window register stride offset (Jim Quinlan) - Add "aspm-no-l0s" property for brcmstb and disable ASPM L0s when present (Jim Quinlan) - Add property to notify Raspberry Pi firmware of xHCI reset (Nicolas Saenz Julienne) - Add Raspberry Pi VL805 xHCI init function to trigger VL805 firmware load (Nicolas Saenz Julienne) - Wait in brcmstb probe for Raspberry Pi VL805 firmware initialization (Nicolas Saenz Julienne) - Load Raspberry Pi VL805 firmware in USB early handoff quirk (Nicolas Saenz Julienne) * remotes/lorenzo/pci/brcmstb: USB: pci-quirks: Add Raspberry Pi 4 quirk PCI: brcmstb: Wait for Raspberry Pi's firmware when present firmware: raspberrypi: Introduce vl805 init routine soc: bcm2835: Add notify xHCI reset property PCI: brcmstb: Disable L0s component of ASPM if requested dt-bindings: PCI: brcmstb: New prop 'aspm-no-l0s' PCI: brcmstb: Fix window register offset from 4 to 8 PCI: brcmstb: Don't clk_put() a managed clock PCI: brcmstb: Assert fundamental reset on initialization commit 754262d1befb16a9581b7ccfa9d1e17d41c54969 Merge: 075a383389d7 c96efe265692 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:14 2020 -0500 Merge branch 'remotes/lorenzo/pci/altera' - Fix altera whitespace (Colin Ian King) * remotes/lorenzo/pci/altera: PCI: altera: Clean up indentation issue on a return statement commit 075a383389d71b0afde7feacd1a6ad6f247fa411 Merge: 39a1af761950 e89897c9dec7 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:14 2020 -0500 Merge branch 'remotes/lorenzo/pci/aardvark' - Train link immediately after enabling link training to avoid issues with Compex WLE900VX and Turris MOX devices (Pali Rohár) - Remove ASPM config and let the PCI core do it (Pali Rohár) - Interpret zero 'max-link-speed' value as invalid (Pali Rohár) - Respect the 'max-link-speed' property and improve link training (Marek Behún) - Issue PERST via GPIO (Pali Rohár) - Add PHY support (Marek Behún) - Use standard PCIe capability macros (Pali Rohár) - Document new 'max-link-speed', 'phys', and 'reset-gpios' properties (Marek Behún) * remotes/lorenzo/pci/aardvark: dt-bindings: PCI: aardvark: Describe new properties PCI: aardvark: Replace custom macros by standard linux/pci_regs.h macros PCI: aardvark: Add PHY support PCI: aardvark: Add FIXME comment for PCIE_CORE_CMD_STATUS_REG access PCI: aardvark: Issue PERST via GPIO PCI: aardvark: Improve link training PCI: of: Zero max-link-speed value is invalid PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register PCI: aardvark: Train link immediately after enabling training commit 39a1af76195086349c4302f01e498a5fcbcb11d6 Merge: 0085090d7d58 3247bd10a450 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:13 2020 -0500 Merge branch 'pci/virtualization' - Remove unused xen_register_pirq() parameter (Wei Liu) - Quirk AMD Matisse HD Audio & USB 3.0 devices where FLR hangs the device (Marcos Scriven) - Quirk AMD Starship USB 3.0 device where FLR doesn't seem to work (Kevin Buettner) - Add ACS quirk for Intel RCiEPs (Ashok Raj) * pci/virtualization: PCI: Add ACS quirk for Intel Root Complex Integrated Endpoints PCI: Avoid FLR for AMD Starship USB 3.0 PCI: Avoid FLR for AMD Matisse HD Audio & USB 3.0 x86/PCI: Drop unused xen_register_pirq() gsi_override parameter commit 0085090d7d5844e4ddedc612bd65939ce043c18f Merge: b16666b85359 b8af85492fbf Author: Bjorn Helgaas Date: Thu Jun 4 12:59:13 2020 -0500 Merge branch 'pci/switchtec' - Fix a minor bool type issue (Krzysztof Wilczynski) * pci/switchtec: PCI/switchtec: Correct bool variable type assignment commit b16666b853597531a798f57e7cb38d510c9e6efd Merge: ae7322a06d22 d09ddd8190fb Author: Bjorn Helgaas Date: Thu Jun 4 12:59:12 2020 -0500 Merge branch 'pci/resource' - Allow resizing BARs of devices on root bus (Ard Biesheuvel) * pci/resource: PCI: Allow pci_resize_resource() for devices on root bus commit ae7322a06d225fadfc43a3eda950fc2b65d2d7a1 Merge: ff33cc2fc01c ec411e02b7a2 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:12 2020 -0500 Merge branch 'pci/pm' - Check .bridge_d3() hook for NULL before calling it (Bjorn Helgaas) - Disable PME# for Pericom OHCI/UHCI USB controllers because it's not reliably asserted on USB hotplug (Kai-Heng Feng) - Assume ports without DLL Link Active train links in 100 ms to work around Thunderbolt bridge defects (Mika Westerberg) * pci/pm: PCI/PM: Assume ports without DLL Link Active train links in 100 ms PCI/PM: Adjust pcie_wait_for_link_delay() for caller delay PCI: Avoid Pericom USB controller OHCI/EHCI PME# defect serial: 8250_pci: Move Pericom IDs to pci_ids.h PCI/PM: Call .bridge_d3() hook only if non-NULL commit ff33cc2fc01c3db06bc9428cdfc1551be167da1a Merge: 9f91d05e4aac 7d5b10fcb81e Author: Bjorn Helgaas Date: Thu Jun 4 12:59:11 2020 -0500 Merge branch 'pci/p2pdma' - Add AMD Zen Raven and Renoir Root Ports to P2PDMA whitelist (Alex Deucher) * pci/p2pdma: PCI/P2PDMA: Add AMD Zen Raven and Renoir Root Ports to whitelist commit 9f91d05e4aaceb46d9f39da9fa3c9c64643b9154 Merge: 08d6c8fca74c 3910ebaca8ea Author: Bjorn Helgaas Date: Thu Jun 4 12:59:11 2020 -0500 Merge branch 'pci/misc' - Clarify that platform_get_irq() should never return 0 (Bjorn Helgaas) - Check for platform_get_irq() failure consistently (Bjorn Helgaas) - Replace zero-length array with flexible-array (Gustavo A. R. Silva) - Unify pcie_find_root_port() and pci_find_pcie_root_port() (Yicong Yang) - Quirk Intel C620 MROMs, which have non-BARs in BAR locations (Xiaochun Lee) - Fix pcie_pme_resume() and pcie_pme_remove() kernel-doc (Jay Fang) - Rename _DSM constants to align with spec (Krzysztof Wilczyński) * pci/misc: PCI: Rename _DSM constants to align with spec PCI/PME: Fix kernel-doc of pcie_pme_resume() and pcie_pme_remove() x86/PCI: Mark Intel C620 MROMs as having non-compliant BARs PCI: Unify pcie_find_root_port() and pci_find_pcie_root_port() PCI: Replace zero-length array with flexible-array PCI: Check for platform_get_irq() failure consistently driver core: platform: Clarify that IRQ 0 is invalid commit 08d6c8fca74c502bbb82c265bdd34096f4beb7bb Merge: 1a765adf3353 8c8ff55b4da7 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:10 2020 -0500 Merge branch 'pci/kconfig' - Remove unnecessary "default y" Kconfig options (Bjorn Helgaas) * pci/kconfig: PCI/AER: Don't select CONFIG_PCIEAER by default PCI: keystone: Don't select CONFIG_PCI_KEYSTONE_HOST by default PCI: dra7xx: Don't select CONFIG_PCI_DRA7XX_HOST by default commit 1a765adf33531d5665fd69098be70ddc1047d644 Merge: 8810a9c4f15c cfbd83d02da7 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:10 2020 -0500 Merge branch 'pci/hotplug' - Remove unused pciehp EMI() and HP_SUPR_RM() macros (Ani Sinha) - Use of_node_name_eq() for node name comparisons (Rob Herring) - Convert shpchp_unconfigure_device() to void (Krzysztof Wilczynski) * pci/hotplug: PCI: shpchp: Make shpchp_unconfigure_device() void PCI: Use of_node_name_eq() for node name comparisons PCI: pciehp: Remove unused EMI() and HP_SUPR_RM() macros commit 8810a9c4f15ca33a2c3fc2a89653d03b294b0a85 Merge: 8ab064e93103 9103aaf9b40c Author: Bjorn Helgaas Date: Thu Jun 4 12:59:09 2020 -0500 Merge branch 'pci/error' - Log only ACPI_NOTIFY_DISCONNECT_RECOVER events for EDR, not all ACPI SYSTEM-level events (Kuppuswamy Sathyanarayanan) - Rely only on _OSC (not _OSC + HEST FIRMWARE_FIRST) to negotiate AER Capability ownership (Alexandru Gagniuc) - Remove HEST/FIRMWARE_FIRST parsing that was previously used to help intuit AER Capability ownership (Kuppuswamy Sathyanarayanan) - Remove redundant pci_is_pcie() and dev->aer_cap checks (Kuppuswamy Sathyanarayanan) - Print IRQ number used by DPC (Yicong Yang) * pci/error: PCI/DPC: Print IRQ number used by port PCI/AER: Use "aer" variable for capability offset PCI/AER: Remove redundant dev->aer_cap checks PCI/AER: Remove redundant pci_is_pcie() checks PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership PCI/AER: Use only _OSC to determine AER ownership PCI/EDR: Log only ACPI_NOTIFY_DISCONNECT_RECOVER events commit 8ab064e93103592bb38f8e77d52e15561df619ec Merge: 15d5a0157f31 11fdcf050328 Author: Bjorn Helgaas Date: Thu Jun 4 12:59:09 2020 -0500 Merge branch 'pci/enumeration' - Fix pci_register_host_bridge() device_register() error handling (Rob Herring) - Fix pci_host_bridge struct device release/free handling (Rob Herring) - Program MPS for RCiEP devices (Ashok Raj) - Inherit PTM settings from Switch Upstream Port so we can enable PTM on Endpoints (Bjorn Helgaas) - Add #defines for bridge windows (PCI_BRIDGE_IO_WINDOW, PCI_BRIDGE_MEM_WINDOW, etc) (Krzysztof Wilczynski) * pci/enumeration: pcmcia: Use CardBus window names (PCI_CB_BRIDGE_IO_0_WINDOW etc) when freeing PCI: Use bridge window names (PCI_BRIDGE_IO_WINDOW etc) PCI/PTM: Inherit Switch Downstream Port PTM settings from Upstream Port PCI: Program MPS for RCiEP devices PCI: Fix pci_host_bridge struct device release/free handling PCI: Fix pci_register_host_bridge() device_register() error handling commit 15d5a0157f31a874c94a0c8142c9bd7d494cb374 Merge: 8f3d9f354286 66ff14e59e8a Author: Bjorn Helgaas Date: Thu Jun 4 12:59:09 2020 -0500 Merge branch 'pci/aspm' - Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges (Kai-Heng Feng) * pci/aspm: PCI/ASPM: Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges commit 9875b201e05a8dfd107530853a0d021c8eea95d1 Merge: 0486a39a6d6c bbb7ad49b835 Author: Linus Torvalds Date: Thu Jun 4 10:54:45 2020 -0700 Merge tag 'tag-chrome-platform-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: "cros_ec_typec: - Add notifier for update, and register port partner Sensors/iio: - Fixes to cros_ec_sensorhub around allocation of resources, and send_sample Wilco EC: - Fix to output format of h1_gpio Misc: - Misc fixes to appease kernel-doc and other warnings - Set user space log size in chromeos_pstore" * tag 'tag-chrome-platform-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_usbpd_logger: Add __printf annotation to append_str() platform/chrome: cros_ec_i2c: Appease the kernel-doc deity platform/chrome: typec: Fix ret value check error platform/chrome: cros_ec_typec: Register port partner platform/chrome: cros_ec_typec: Add struct for port data platform/chrome: cros_ec_typec: Use notifier for updates platform/chrome: cros_ec_ishtp: free ishtp buffer before sending event platform/chrome: cros_ec_ishtp: skip old cros_ec responses platform/chrome: wilco_ec: Provide correct output format to 'h1_gpio' file platform/chrome: chromeos_pstore: set user space log size commit 0f78355c450835053fed85828c9d6526594c0921 Author: Huacai Chen Date: Sat May 23 15:56:41 2020 +0800 KVM: MIPS: Enable KVM support for Loongson-3 This patch enable KVM support for Loongson-3 by selecting HAVE_KVM, but only enable KVM/VZ on Loongson-3A R4+ (because VZ of early processors are incomplete). Besides, Loongson-3 support SMP guests, so we clear the linked load bit of LLAddr in kvm_vz_vcpu_load() if the guest has more than one VCPUs. Acked-by: Thomas Bogendoerfer Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-15-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit dc6d95b153e78ed70b1b2c04aadffb76bcd2b3ec Author: Huacai Chen Date: Sat May 23 15:56:40 2020 +0800 KVM: MIPS: Add more MMIO load/store instructions emulation This patch add more MMIO load/store instructions emulation, which can be observed in QXL and some other device drivers: 1, LWL, LWR, LDW, LDR, SWL, SWR, SDL and SDR for all MIPS; 2, GSLBX, GSLHX, GSLWX, GSLDX, GSSBX, GSSHX, GSSWX and GSSDX for Loongson-3. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-14-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 8a5097ee90c25656db23f44520a9dad7983d88fb Author: Huacai Chen Date: Sat May 23 15:56:39 2020 +0800 KVM: MIPS: Add CONFIG6 and DIAG registers emulation Loongson-3 has CONFIG6 and DIAG registers which need to be emulated. CONFIG6 is mostly used to enable/disable FTLB and SFB, while DIAG is mostly used to flush BTB, ITLB, DTLB, VTLB and FTLB. Acked-by: Thomas Bogendoerfer Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-13-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 7f2a83f1c2a941ebfee53f504ed5fdbc61cfb333 Author: Huacai Chen Date: Sat May 23 15:56:38 2020 +0800 KVM: MIPS: Add CPUCFG emulation for Loongson-3 Loongson-3 overrides lwc2 instructions to implement CPUCFG and CSR read/write functions. These instructions all cause guest exit so CSR doesn't benifit KVM guest (and there are always legacy methods to provide the same functions as CSR). So, we only emulate CPUCFG and let it return a reduced feature list (which means the virtual CPU doesn't have any other advanced features, including CSR) in KVM. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-12-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit f21db3090de2c056728dee76d5fb66343aaf6dd1 Author: Huacai Chen Date: Sat May 23 15:56:37 2020 +0800 KVM: MIPS: Add Loongson-3 Virtual IPI interrupt support This patch add Loongson-3 Virtual IPI interrupt support in the kernel. The current implementation of IPI emulation in QEMU is based on GIC for MIPS, but Loongson-3 doesn't use GIC. Furthermore, IPI emulation in QEMU is too expensive for performance (because of too many context switches between Host and Guest). With current solution, the IPI delay may even cause RCU stall warnings in a multi-core Guest. So, we design a faster solution that emulate IPI interrupt in kernel (only used by Loongson-3 now). Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-11-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 0486a39a6d6c8db78bde4d7b9c44e32dcc6050d4 Merge: 302d5b3321aa 072cb8b628d3 Author: Linus Torvalds Date: Thu Jun 4 10:50:22 2020 -0700 Merge tag 'linux-watchdog-5.8-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add new arm_smc_wdt watchdog driver - da9062 and da9063 improvements - clarify documentation about stop() that became optional - document r8a7742 support - some overall fixes and improvements * tag 'linux-watchdog-5.8-rc1' of git://www.linux-watchdog.org/linux-watchdog: watchdog: m54xx: Add missing include dt-bindings: watchdog: renesas,wdt: Document r8a7742 support watchdog: Fix runtime PM imbalance on error watchdog: riowd: remove unneeded semicolon watchdog: Add new arm_smc_wdt watchdog driver dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog watchdog: imx2_wdt: update contact email watchdog: iTCO: fix link error watchdog: da9062: No need to ping manually before setting timeout watchdog: da9063: Make use of pre-configured timeout during probe watchdog: da9062: Initialize timeout during probe watchdog: clarify that stop() is optional watchdog: imx_sc_wdt: Fix reboot on crash watchdog: ts72xx_wdt: fix build error commit 3f51d8fcac7a0925fb1222d932cb3baa776b1e79 Author: Huacai Chen Date: Sat May 23 15:56:36 2020 +0800 KVM: MIPS: Add more types of virtual interrupts In current implementation, MIPS KVM uses IP2, IP3, IP4 and IP7 for external interrupt, two kinds of IPIs and timer interrupt respectively, but Loongson-3 based machines prefer to use IP2, IP3, IP6 and IP7 for two kinds of external interrupts, IPI and timer interrupt. So we define two priority-irq mapping tables: kvm_loongson3_priority_to_irq[] for Loongson-3, and kvm_default_priority_to_irq[] for others. The virtual interrupt infrastructure is updated to deliver all types of interrupts from IP2, IP3, IP4, IP6 and IP7. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-10-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 49bb96003fb19b77a0116d9330bdfd61aa41244b Author: Huacai Chen Date: Sat May 23 15:56:35 2020 +0800 KVM: MIPS: Let indexed cacheops cause guest exit on Loongson-3 Loongson-3's indexed cache operations need a node-id in the address, but in KVM guest the node-id may be incorrect. So, let indexed cache operations cause guest exit on Loongson-3. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-9-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 52c07e1cbb6e16a0fe70646b4bc63f714caa0f3b Author: Huacai Chen Date: Sat May 23 15:56:34 2020 +0800 KVM: MIPS: Use root tlb to control guest's CCA for Loongson-3 KVM guest has two levels of address translation: guest tlb translates GVA to GPA, and root tlb translates GPA to HPA. By default guest's CCA is controlled by guest tlb, but Loongson-3 maintains all cache coherency by hardware (including multi-core coherency and I/O DMA coherency) so it prefers all guest mappings be cacheable mappings. Thus, we use root tlb to control guest's CCA for Loongson-3. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-8-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 3210e2c279fee1076978b49988acdd935a6f7435 Author: Huacai Chen Date: Sat May 23 15:56:33 2020 +0800 KVM: MIPS: Introduce and use cpu_guest_has_ldpte Loongson-3 has lddir/ldpte instructions and their related CP0 registers are the same as HTW. So we introduce a cpu_guest_has_ldpte flag and use it to indicate whether we need to save/restore HTW related CP0 registers (PWBase, PWSize, PWField and PWCtl). Acked-by: Thomas Bogendoerfer Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-7-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 8bf31295030e35ef1e9e1b25b02041423f8291d3 Author: Huacai Chen Date: Sat May 23 15:56:32 2020 +0800 KVM: MIPS: Use lddir/ldpte instructions to lookup gpa_mm.pgd Loongson-3 can use lddir/ldpte instuctions to accelerate page table walking, so use them to lookup gpa_mm.pgd. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-6-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit bf10efbb81bf0c7ae6ebac3320b5b40c323463f3 Author: Huacai Chen Date: Sat May 23 15:56:31 2020 +0800 KVM: MIPS: Add EVENTFD support which is needed by VHOST Add EVENTFD support for KVM/MIPS, which is needed by VHOST. Tested on Loongson-3 platform. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-5-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 210b4b9112b699df4c33273bf7b02d9debd2f35e Author: Huacai Chen Date: Sat May 23 15:56:30 2020 +0800 KVM: MIPS: Increase KVM_MAX_VCPUS and KVM_USER_MEM_SLOTS to 16 Loongson-3 based machines can have as many as 16 CPUs, and so does memory slots, so increase KVM_MAX_VCPUS and KVM_USER_MEM_SLOTS to 16. Reviewed-by: Aleksandar Markovic Signed-off-by: Huacai Chen Co-developed-by: Jiaxun Yang Message-Id: <1590220602-3547-4-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit 5816c76dea116a458f1932eefe064e35403248eb Author: Xing Li Date: Sat May 23 15:56:29 2020 +0800 KVM: MIPS: Fix VPN2_MASK definition for variable cpu_vmbits If a CPU support more than 32bit vmbits (which is true for 64bit CPUs), VPN2_MASK set to fixed 0xffffe000 will lead to a wrong EntryHi in some functions such as _kvm_mips_host_tlb_inv(). The cpu_vmbits definition of 32bit CPU in cpu-features.h is 31, so we still use the old definition. Cc: Stable Reviewed-by: Aleksandar Markovic Signed-off-by: Xing Li [Huacai: Improve commit messages] Signed-off-by: Huacai Chen Message-Id: <1590220602-3547-3-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit fe2b73dba47fb6d6922df1ad44e83b1754d5ed4d Author: Xing Li Date: Sat May 23 15:56:28 2020 +0800 KVM: MIPS: Define KVM_ENTRYHI_ASID to cpu_asid_mask(&boot_cpu_data) The code in decode_config4() of arch/mips/kernel/cpu-probe.c asid_mask = MIPS_ENTRYHI_ASID; if (config4 & MIPS_CONF4_AE) asid_mask |= MIPS_ENTRYHI_ASIDX; set_cpu_asid_mask(c, asid_mask); set asid_mask to cpuinfo->asid_mask. So in order to support variable ASID_MASK, KVM_ENTRYHI_ASID should also be changed to cpu_asid_mask(&boot_cpu_data). Cc: Stable #4.9+ Reviewed-by: Aleksandar Markovic Signed-off-by: Xing Li [Huacai: Change current_cpu_data to boot_cpu_data for optimization] Signed-off-by: Huacai Chen Message-Id: <1590220602-3547-2-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini commit dddb3e26f6d88c5344d28cb5ff9d3d6fa05c4f7a Author: Jens Axboe Date: Thu Jun 4 11:27:01 2020 -0600 io_uring: re-set iov base/len for buffer select retry We already have the buffer selected, but we should set the iter list again. Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Jens Axboe commit 302d5b3321aa61ff4ab15f0abc737d923355d33d Merge: 512b7d37ee0a 479da1f538a2 Author: Linus Torvalds Date: Thu Jun 4 10:43:07 2020 -0700 Merge tag 'backlight-next-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Core Framework: - Add backlight_device_get_by_name() to the API New Device Support: - Add support for WLED5 to Qualcomm WLED Fix-ups: - Convert to GPIO descriptors in l4f00242t03 - Device Tree fix-ups for qcom-wled Bug Fixes: - Properly disable regulators on .probe() failure" * tag 'backlight-next-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: Add backlight_device_get_by_name() backlight: qcom-wled: Add support for WLED5 peripheral that is present on PM8150L PMICs dt-bindings: backlight: qcom-wled: Add WLED5 bindings backlight: qcom-wled: Add callback functions dt-bindings: backlight: qcom-wled: Convert the wled bindings to .yaml format backlight: l4f00242t03: Convert to GPIO descriptors backlight: lp855x: Ensure regulators are disabled on probe failure commit 512b7d37ee0a9b4e2b5fafcd0b7c65a3f6e430ca Merge: acf25aa66371 098c4adf249c Author: Linus Torvalds Date: Thu Jun 4 10:38:42 2020 -0700 Merge tag 'mfd-next-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Constify 'properties' attribute in core header file New Drivers: - Add support for Gateworks System Controller - Add support for MediaTek MT6358 PMIC - Add support for Mediatek MT6360 PMIC - Add support for Monolithic Power Systems MP2629 ADC and Battery charger Fix-ups: - Use new I2C API in htc-i2cpld - Remove superfluous code in sprd-sc27xx-spi - Improve error handling in stm32-timers - Device Tree additions/fixes in mt6397 - Defer probe betterment in wm8994-core - Improve module handling in wm8994-core - Staticify in stpmic1 - Trivial (spelling, formatting) in tqmx86 Bug Fixes: - Fix incorrect register/PCI IDs in intel-lpss-pci - Fix unbalanced Regulator API calls in wm8994-core - Fix double free() in wcd934x - Remove IRQ domain on failure in stmfx - Reset chip on resume in stmfx - Disable/enable IRQs on suspend/resume in stmfx - Do not use bulk writes on H/W which does not support them in max77620" * tag 'mfd-next-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (29 commits) mfd: mt6360: Remove duplicate REGMAP_IRQ_REG_LINE() entry mfd: Add support for PMIC MT6360 mfd: max77620: Use single-byte writes on MAX77620 mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt mfd: stmfx: Fix stmfx_irq_init error path mfd: stmfx: Reset chip on resume as supply was disabled mfd: wm8994: Silence warning about supplies during deferred probe mfd: wm8994: Fix unbalanced calls to regulator_bulk_disable() mfd: wm8994: Fix driver operation if loaded as modules dt-bindings: mfd: mediatek: Add MT6397 Pin Controller mfd: Constify properties in mfd_cell mfd: stm32-timers: Use dma_request_chan() instead dma_request_slave_channel() mfd: sprd: Remove unnecessary spi_bus_type setting mfd: intel-lpss: Update LPSS UART #2 PCI ID for Jasper Lake mfd: tqmx86: Fix a typo in MODULE_DESCRIPTION mfd: stpmic1: Make stpmic1_regmap_config static mfd: htc-i2cpld: Convert to use i2c_new_client_device() MAINTAINERS: Add entry for mp2629 Battery Charger driver power: supply: mp2629: Add impedance compensation config ... commit acf25aa66371359f542d14e8d993b530fe25d7ac Merge: a484a497c98a ef26650a201f Author: Linus Torvalds Date: Thu Jun 4 10:31:05 2020 -0700 Merge tag 'Smack-for-5.8' of git://github.com/cschaufler/smack-next Pull smack updates from Casey Schaufler: "Clean out dead code and repair an out-of-bounds warning" * tag 'Smack-for-5.8' of git://github.com/cschaufler/smack-next: Smack: Remove unused inline function smk_ad_setfield_u_fs_path_mnt Smack:- Remove redundant inode_smack cache Smack:- Remove mutex lock "smk_lock" from inode_smack Smack: slab-out-of-bounds in vsscanf smack: remove redundant structure variable from header. smack: avoid unused 'sip' variable warning commit a484a497c98a0447aca2d70de19d11b1d66e6ef7 Merge: 38b3a5aaf2fd b6f61c314649 Author: Linus Torvalds Date: Thu Jun 4 10:27:07 2020 -0700 Merge tag 'keys-next-20200602' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull keyring updates from David Howells: - Fix a documentation warning. - Replace a zero-length array with a flexible one - Make the big_key key type use ChaCha20Poly1305 and use the crypto algorithm directly rather than going through the crypto layer. - Implement the update op for the big_key type. * tag 'keys-next-20200602' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: keys: Implement update for the big_key type security/keys: rewrite big_key crypto to use library interface KEYS: Replace zero-length array with flexible-array Documentation: security: core.rst: add missing argument commit 38b3a5aaf2fd35e997550b855cfb7460b077236a Merge: 6929f71e46bd 3e9b26dc2268 Author: Linus Torvalds Date: Thu Jun 4 10:17:59 2020 -0700 Merge tag 'perf-tools-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tooling updates from Arnaldo Carvalho de Melo: "These are additional changes to the perf tools, on top of what Ingo already submitted. - Further Intel PT call-trace fixes - Improve SELinux docs and tool warnings - Fix race at exit in 'perf record' using eventfd. - Add missing build tests to the default set of 'make -C tools/perf build-test' - Sync msr-index.h getting new AMD MSRs to decode and filter in 'perf trace'. - Fix fallback to libaudit in 'perf trace' for arches not using per-arch *.tbl files. - Fixes for 'perf ftrace'. - Fixes and improvements for the 'perf stat' metrics. - Use dummy event to get PERF_RECORD_{FORK,MMAP,etc} while synthesizing those metadata events for pre-existing threads. - Fix leaks detected using clang tooling. - Improvements to PMU event metric testing. - Report summary for 'perf stat' interval mode at the end, summing up all the intervals. - Improve pipe mode, i.e. this now works as expected, continuously dumping samples: # perf record -g -e raw_syscalls:sys_enter | perf --no-pager script - Fixes for event grouping, detecting incompatible groups such as: # perf stat -e '{cycles,power/energy-cores/}' -v WARNING: group events cpu maps do not match, disabling group: anon group { power/energy-cores/, cycles } power/energy-cores/: 0 cycles: 0-7 - Fixes for 'perf probe': blacklist address checking, number of kretprobe instances, etc. - JIT processing improvements and fixes plus the addition of a 'perf test' entry for the java demangler. - Add support for synthesizing first/last level cache, TLB and remove access events from HW tracing in the auxtrace code, first to use is ARM SPE. - Vendor events updates and fixes, including for POWER9 and Intel. - Allow using ~/.perfconfig for removing the ',' separators in 'perf stat' output. - Opt-in support for libpfm4" * tag 'perf-tools-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (120 commits) perf tools: Remove some duplicated includes perf symbols: Fix kernel maps for kcore and eBPF tools arch x86: Sync the msr-index.h copy with the kernel sources perf stat: Ensure group is defined on top of the same cpu mask perf libdw: Fix off-by 1 relative directory includes perf arm-spe: Support synthetic events perf auxtrace: Add four itrace options perf tools: Move arm-spe-pkt-decoder.h/c to the new dir perf test: Initialize memory in dwarf-unwind perf tests: Don't tail call optimize in unwind test tools compiler.h: Add attribute to disable tail calls perf build: Add a LIBPFM4=1 build test entry perf tools: Add optional support for libpfm4 perf tools: Correct license on jsmn JSON parser perf jit: Fix inaccurate DWARF line table perf jvmti: Remove redundant jitdump line table entries perf build: Add NO_SDT=1 to the default set of build tests perf build: Add NO_LIBCRYPTO=1 to the default set of build tests perf build: Add NO_SYSCALL_TABLE=1 to the build tests perf build: Remove libaudit from the default feature checks ... commit d2b6f48b691ed67569786c332f0173b918d3fd1b Author: Pavel Begunkov Date: Wed Jun 3 18:03:25 2020 +0300 io_uring: move send/recv IOPOLL check into prep Fail recv/send in case of IORING_SETUP_IOPOLL earlier during prep, so it'd be done only once. Removes duplication as well Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit ec65fea5a8d7a82d3137dd2a44197eb577da111f Author: Pavel Begunkov Date: Wed Jun 3 18:03:24 2020 +0300 io_uring: deduplicate io_openat{,2}_prep() io_openat_prep() and io_openat2_prep() are identical except for how struct open_how is built. Deduplicate it with a helper. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 25e72d1012b30bdff712b563e6141a4f311d28d6 Author: Pavel Begunkov Date: Wed Jun 3 18:03:23 2020 +0300 io_uring: do build_open_how() only once build_open_how() is just adjusting open_flags/mode. Do it once during prep. It looks better than storing raw values for the future. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 3232dd02af65f2d01be641120d2a710176b0c7a7 Author: Pavel Begunkov Date: Wed Jun 3 18:03:22 2020 +0300 io_uring: fix {SQ,IO}POLL with unsupported opcodes IORING_SETUP_IOPOLL is defined only for read/write, other opcodes should be disallowed, otherwise it'll get an error as below. Also refuse open/close with SQPOLL, as the polling thread wouldn't know which file table to use. RIP: 0010:io_iopoll_getevents+0x111/0x5a0 Call Trace: ? _raw_spin_unlock_irqrestore+0x24/0x40 ? do_send_sig_info+0x64/0x90 io_iopoll_reap_events.part.0+0x5e/0xa0 io_ring_ctx_wait_and_kill+0x132/0x1c0 io_uring_release+0x20/0x30 __fput+0xcd/0x230 ____fput+0xe/0x10 task_work_run+0x67/0xa0 do_exit+0x353/0xb10 ? handle_mm_fault+0xd4/0x200 ? syscall_trace_enter+0x18c/0x2c0 do_group_exit+0x43/0xa0 __x64_sys_exit_group+0x18/0x20 do_syscall_64+0x60/0x1e0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Pavel Begunkov [axboe: allow provide/remove buffers and files update] Signed-off-by: Jens Axboe commit f5641d053d46a9a18fe13f2ecb4a7b4a66d9cdf7 Author: Kees Cook Date: Wed Jun 3 15:40:56 2020 -0700 pwm: Add missing "CONFIG_" prefix The IS_ENABLED() use was missing the CONFIG_ prefix which would have lead to skipping this code. Fixes: 3ad1f3a33286 ("pwm: Implement some checks for lowlevel drivers") Signed-off-by: Kees Cook Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit fa44b82eb8318facc56356afa897f3f3105172e1 Author: Babu Moger Date: Tue May 12 18:59:16 2020 -0500 KVM: x86: Move MPK feature detection to common code Both Intel and AMD support (MPK) Memory Protection Key feature. Move the feature detection from VMX to the common code. It should work for both the platforms now. Signed-off-by: Babu Moger Message-Id: <158932795627.44260.15144185478040178638.stgit@naples-babu.amd.com> Signed-off-by: Paolo Bonzini commit 65b1891499b1feb74aaab514c3d34080dc6702d8 Author: Xiaoyao Li Date: Thu Jun 4 12:16:36 2020 +0800 KVM: x86: Assign correct value to array.maxnent Delay the assignment of array.maxnent to use correct value for the case cpuid->nent > KVM_MAX_CPUID_ENTRIES. Fixes: e53c95e8d41e ("KVM: x86: Encapsulate CPUID entries and metadata in struct") Signed-off-by: Xiaoyao Li Message-Id: <20200604041636.1187-1-xiaoyao.li@intel.com> Signed-off-by: Paolo Bonzini commit f4f6bd93fdab6f03e20fbbb9e5c6d65fc81b1588 Author: Sean Christopherson Date: Wed Jun 3 13:33:03 2020 -0700 KVM: VMX: Always treat MSR_IA32_PERF_CAPABILITIES as a valid PMU MSR Unconditionally return true when querying the validity of MSR_IA32_PERF_CAPABILITIES so as to defer the validity check to intel_pmu_{get,set}_msr(), which can properly give the MSR a pass when the access is initiated from host userspace. The MSR is emulated so there is no underlying hardware dependency to worry about. Fixes: 27461da31089a ("KVM: x86/pmu: Support full width counting") Cc: Like Xu Signed-off-by: Sean Christopherson Message-Id: <20200603203303.28545-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 5311ebfb612f08ec2a712a86d0af7ee2b423a9fc Author: Christophe JAILLET Date: Sun May 31 13:00:15 2020 +0200 arm64: debug: mark a function as __init to save some memory 'debug_monitors_init()' is only called via 'postcore_initcall'. It can be marked as __init to save a few bytes of memory. Signed-off-by: Christophe JAILLET Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20200531110015.598607-1-christophe.jaillet@wanadoo.fr Signed-off-by: Will Deacon commit 333ed74689b8fca097574124fef7fa0e3d7f79d4 Author: Will Deacon Date: Wed Jun 3 12:16:37 2020 +0100 scs: Report SCS usage in bytes rather than number of entries Fix the SCS debug usage check so that we report the number of bytes used, rather than the number of entries. Fixes: 5bbaf9d1fcb9 ("scs: Add support for stack usage debugging") Reported-by: Sami Tolvanen Reviewed-by: Kees Cook Signed-off-by: Will Deacon commit d56f5136b01020155b6b0a29f69d924687529bee Author: Paolo Bonzini Date: Thu Jun 4 15:16:52 2020 +0200 KVM: let kvm_destroy_vm_debugfs clean up vCPU debugfs directories After commit 63d0434 ("KVM: x86: move kvm_create_vcpu_debugfs after last failure point") we are creating the pre-vCPU debugfs files after the creation of the vCPU file descriptor. This makes it possible for userspace to reach kvm_vcpu_release before kvm_create_vcpu_debugfs has finished. The vcpu->debugfs_dentry then does not have any associated inode anymore, and this causes a NULL-pointer dereference in debugfs_create_file. The solution is simply to avoid removing the files; they are cleaned up when the VM file descriptor is closed (and that must be after KVM_CREATE_VCPU returns). We can stop storing the dentry in struct kvm_vcpu too, because it is not needed anywhere after kvm_create_vcpu_debugfs returns. Reported-by: syzbot+705f4401d5a93a59b87d@syzkaller.appspotmail.com Fixes: 63d04348371b ("KVM: x86: move kvm_create_vcpu_debugfs after last failure point") Signed-off-by: Paolo Bonzini commit 8409f67b6437c4b327ee95a71081b9c7bfee0b00 Author: David Howells Date: Wed Apr 22 00:02:46 2020 +0100 afs: Adjust the fileserver rotation algorithm to reprobe/retry more quickly Adjust the fileserver rotation algorithm so that if we've tried all the addresses on a server (cumulatively over multiple operations) until we've run out of untried addresses, immediately reprobe all that server's interfaces and retry the op at least once before we move onto the next server. Signed-off-by: David Howells commit 32275d3f758f1252511709b77b3bab060a0e1d4f Author: David Howells Date: Sat May 2 13:44:50 2020 +0100 afs: Show more a bit more server state in /proc/net/afs/servers Display more information about the state of a server record, including the flags, rtt and break counter plus the probe state for each server in /proc/net/afs/servers. Rearrange the server flags a bit to make them easier to read at a glance in the proc file. Signed-off-by: David Howells commit f3c130e6e6d15822e1553531f91ecc8f3375bac3 Author: David Howells Date: Sat May 2 13:39:57 2020 +0100 afs: Don't use probe running state to make decisions outside probe code Don't use the running state for fileserver probes to make decisions about which server to use as the state is cleared at the start of a probe and also intermediate values might be misleading. Instead, add a separate 'latest known' rtt in the afs_server struct and a flag to indicate if the server is known to be responding and update these as and when we know what to change them to. Signed-off-by: David Howells commit f11a016a852f32e9c991baf6a036390eac5b4266 Author: David Howells Date: Fri May 1 22:06:02 2020 +0100 afs: Fix afs_statfs() to not let the values go below zero Fix afs_statfs() so that the value for f_bavail and f_bfree don't go "negative" if the number of blocks in use by a volume exceeds the max quota for that volume. Signed-off-by: David Howells commit 3c4c4075fc61f5c37a0112b1dc8398025dc3e26a Author: David Howells Date: Wed May 27 15:51:30 2020 +0100 afs: Fix the by-UUID server tree to allow servers with the same UUID Whilst it shouldn't happen, it is possible for multiple fileservers to share a UUID, particularly if an entire cell has been duplicated, UUIDs and all. In such a case, it's not necessarily possible to map the effect of the CB.InitCallBackState3 incoming RPC to a specific server unambiguously by UUID and thus to a specific cell. Indeed, there's a problem whereby multiple server records may need to occupy the same spot in the rb_tree rooted in the afs_net struct. Fix this by allowing servers to form a list, with the head of the list in the tree. When the front entry in the list is removed, the second in the list just replaces it. afs_init_callback_state() then just goes down the line, poking each server in the list. This means that some servers will be unnecessarily poked, unfortunately. An alternative would be to route by call parameters. Reported-by: Jeffrey Altman Signed-off-by: David Howells Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") commit 20325960f8750165964a6891a733e4cc15d19076 Author: David Howells Date: Thu Apr 30 01:03:49 2020 +0100 afs: Reorganise volume and server trees to be rooted on the cell Reorganise afs_volume objects such that they're in a tree keyed on volume ID, rooted at on an afs_cell object rather than being in multiple trees, each of which is rooted on an afs_server object. afs_server structs become per-cell and acquire a pointer to the cell. The process of breaking a callback then starts with finding the server by its network address, following that to the cell and then looking up each volume ID in the volume tree. This is simpler than the afs_vol_interest/afs_cb_interest N:M mapping web and allows those structs and the code for maintaining them to be simplified or removed. It does make a couple of things a bit more tricky, though: (1) Operations now start with a volume, not a server, so there can be more than one answer as to whether or not the server we'll end up using supports the FS.InlineBulkStatus RPC. (2) CB RPC operations that specify the server UUID. There's still a tree of servers by UUID on the afs_net struct, but the UUIDs in it aren't guaranteed unique. Signed-off-by: David Howells commit cca37d45d547434144409ae648a19b7eb6db5eb4 Author: David Howells Date: Wed Apr 29 17:02:04 2020 +0100 afs: Add a tracepoint to track the lifetime of the afs_volume struct Add a tracepoint to track the lifetime of the afs_volume struct. Signed-off-by: David Howells commit 6dfdf5369c9f0a47920b2f743434c90798f26cd5 Author: David Howells Date: Mon Apr 27 15:01:09 2020 +0100 afs: Detect cell aliases 3 - YFS Cells with a canonical cell name op YFS Volume Location servers have an operation by which the cell name may be queried. Use this to find out what a YFS server thinks the canonical cell name should be. Signed-off-by: David Howells commit 6ef350b1842081bef7e4879993f47f052b7007e7 Author: David Howells Date: Sun Apr 26 10:12:27 2020 +0100 afs: Detect cell aliases 2 - Cells with no root volumes Implement the second phase of cell alias detection. This part handles alias detection for cells that don't have root.cell volumes and so we have to find some other volume or fileserver to query. We take the first volume from each such cell and attempt to look it up in the new cell. If found, we compare the records, if they are the same, we judge the cell names to be aliases. Signed-off-by: David Howells commit 8a070a964877c71139cba46202f6f263c2b9419d Author: David Howells Date: Sat Apr 25 10:26:02 2020 +0100 afs: Detect cell aliases 1 - Cells with root volumes Put in the first phase of cell alias detection. This part handles alias detection for cells that have root.cell volumes (which is expected to be likely). When a cell becomes newly active, it is probed for its root.cell volume, and if it has one, this volume is compared against other root.cell volumes to find out if the list of fileserver UUIDs have any in common - and if that's the case, do the address lists of those fileservers have any addresses in common. If they do, the new cell is adjudged to be an alias of the old cell and the old cell is used instead. Comparing is aided by the server list in struct afs_server_list being sorted in UUID order and the addresses in the fileserver address lists being sorted in address order. The cell then retains the afs_volume object for the root.cell volume, even if it's not mounted for future alias checking. This necessary because: (1) Whilst fileservers have UUIDs that are meant to be globally unique, in practice they are not because cells get cloned without changing the UUIDs - so afs_server records need to be per cell. (2) Sometimes the DNS is used to make cell aliases - but if we don't know they're the same, we may end up with multiple superblocks and multiple afs_server records for the same thing, impairing our ability to deliver callback notifications of third party changes (3) The fileserver RPC API doesn't contain the cell name, so it can't tell us which cell it's notifying and can't see that a change made to to one cell should notify the same client that's also accessed as the other cell. Reported-by: Jeffrey Altman Signed-off-by: David Howells commit c3e9f888263bb4df11cbd623ceced02081cb2f9f Author: David Howells Date: Wed Apr 29 17:26:41 2020 +0100 afs: Implement client support for the YFSVL.GetCellName RPC op Implement client support for the YFSVL.GetCellName RPC operation by which YFS permits the canonical cell name to be queried from a VL server. Signed-off-by: David Howells commit 194d28cf197ca982556be58dcf687b43fd85e9cc Author: David Howells Date: Mon Apr 27 13:42:53 2020 +0100 afs: Retain more of the VLDB record for alias detection Save more bits from the volume location database record obtained for a server so that we can use this information in cell alias detection. Signed-off-by: David Howells commit 3120c170ef35c1a9be137535e44c7e237e33b78e Author: David Howells Date: Wed May 27 16:44:02 2020 +0100 afs: Fix handling of CB.ProbeUuid cache manager op The AFS filesystem driver is handling the CB.ProbeUuid request incorrectly. The UUID presented in the request is that of the cache manager, not the fileserver, so afs_deliver_cb_probe_uuid() shouldn't be using that UUID to look up the server. Fix this by looking up the server by address instead. Signed-off-by: David Howells commit 44746355ccb142341f92a0c86fc2e27bfc968b40 Author: David Howells Date: Wed May 27 15:52:02 2020 +0100 afs: Don't get epoch from a server because it may be ambiguous Don't get the epoch from a server, particularly one that we're looking up by UUID, as UUIDs may be ambiguous and may map to more than one server - so we can't draw any conclusions from it. Reported-by: Jeffrey Altman Signed-off-by: David Howells commit e49c7b2f6de7ff81ca34c56e4eeb4fa740c099f2 Author: David Howells Date: Fri Apr 10 20:51:51 2020 +0100 afs: Build an abstraction around an "operation" concept Turn the afs_operation struct into the main way that most fileserver operations are managed. Various things are added to the struct, including the following: (1) All the parameters and results of the relevant operations are moved into it, removing corresponding fields from the afs_call struct. afs_call gets a pointer to the op. (2) The target volume is made the main focus of the operation, rather than the target vnode(s), and a bunch of op->vnode->volume are made op->volume instead. (3) Two vnode records are defined (op->file[]) for the vnode(s) involved in most operations. The vnode record (struct afs_vnode_param) contains: - The vnode pointer. - The fid of the vnode to be included in the parameters or that was returned in the reply (eg. FS.MakeDir). - The status and callback information that may be returned in the reply about the vnode. - Callback break and data version tracking for detecting simultaneous third-parth changes. (4) Pointers to dentries to be updated with new inodes. (5) An operations table pointer. The table includes pointers to functions for issuing AFS and YFS-variant RPCs, handling the success and abort of an operation and handling post-I/O-lock local editing of a directory. To make this work, the following function restructuring is made: (A) The rotation loop that issues calls to fileservers that can be found in each function that wants to issue an RPC (such as afs_mkdir()) is extracted out into common code, in a new file called fs_operation.c. (B) The rotation loops, such as the one in afs_mkdir(), are replaced with a much smaller piece of code that allocates an operation, sets the parameters and then calls out to the common code to do the actual work. (C) The code for handling the success and failure of an operation are moved into operation functions (as (5) above) and these are called from the core code at appropriate times. (D) The pseudo inode getting stuff used by the dynamic root code is moved over into dynroot.c. (E) struct afs_iget_data is absorbed into the operation struct and afs_iget() expects to be given an op pointer and a vnode record. (F) Point (E) doesn't work for the root dir of a volume, but we know the FID in advance (it's always vnode 1, unique 1), so a separate inode getter, afs_root_iget(), is provided to special-case that. (G) The inode status init/update functions now also take an op and a vnode record. (H) The RPC marshalling functions now, for the most part, just take an afs_operation struct as their only argument. All the data they need is held there. The result delivery functions write their answers there as well. (I) The call is attached to the operation and then the operation core does the waiting. And then the new operation code is, for the moment, made to just initialise the operation, get the appropriate vnode I/O locks and do the same rotation loop as before. This lays the foundation for the following changes in the future: (*) Overhauling the rotation (again). (*) Support for asynchronous I/O, where the fileserver rotation must be done asynchronously also. Signed-off-by: David Howells commit 862b2509d157c629dd26d7ac6c6cdbf043d332eb Author: Takashi Iwai Date: Wed Jun 3 17:37:08 2020 +0200 ALSA: usb-audio: Fix inconsistent card PM state after resume When a USB-audio interface gets runtime-suspended via auto-pm feature, the driver suspends all functionality and increment chip->num_suspended_intf. Later on, when the system gets suspended to S3, the driver increments chip->num_suspended_intf again, skips the device changes, and sets the card power state to SNDRV_CTL_POWER_D3hot. In return, when the system gets resumed from S3, the resume callback decrements chip->num_suspended_intf. Since this refcount is still not zero (it's been runtime-suspended), the whole resume is skipped. But there is a small pitfall here. The problem is that the driver doesn't restore the card power state after this resume call, leaving it as SNDRV_CTL_POWER_D3hot. So, even after the system resume finishes, the card instance still appears as if it were system-suspended, and this confuses many ioctl accesses that are blocked unexpectedly. In details, we have two issues behind the scene: one is that the card power state is changed only when the refcount becomes zero, and another is that the prior auto-suspend check is kept in a boolean flag. Although the latter problem is almost negligible since the auto-pm feature is imposed only on the primary interface, but this can be a potential problem on the devices with multiple interfaces. This patch addresses those issues by the following: - Replace chip->autosuspended boolean flag with chip->system_suspend counter - At the first system-suspend, chip->num_suspended_intf is recorded to chip->system_suspend - At system-resume, the card power state is restored when the chip->num_suspended_intf refcount reaches to chip->system_suspend, i.e. the state returns to the auto-suspended Also, the patch fixes yet another hidden problem by the code refactoring along with the fixes above: namely, when some resume procedure failed, the driver left chip->num_suspended_intf that was already decreased, and it might lead to the refcount unbalance. In the new code, the refcount decrement is done after the whole resume procedure, and the problem is avoided as well. Fixes: 0662292aec05 ("ALSA: usb-audio: Handle normal and auto-suspend equally") Reported-and-tested-by: Macpaul Lin Cc: Link: https://lore.kernel.org/r/20200603153709.6293-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 06b43f968db58fd582b09b745338eae5af9f9f5e Author: Al Viro Date: Sat May 30 00:40:28 2020 +0100 scsi: hpsa: hpsa_ioctl(): Tidy up a bit Link: https://lore.kernel.org/r/20200529234028.46373-4-viro@ZenIV.linux.org.uk Acked-by: Don Brace Tested-by: Don Brace Signed-off-by: Al Viro Signed-off-by: Martin K. Petersen commit 10100ffd5f6584298b72f9fe26f32cf02abfb8b0 Author: Al Viro Date: Sat May 30 00:40:27 2020 +0100 scsi: hpsa: Get rid of compat_alloc_user_space() No need for building a native struct on kernel stack, copying it to userland one, then calling hpsa_ioctl() which copies it back into _another_ instance of the same struct. Link: https://lore.kernel.org/r/20200529234028.46373-3-viro@ZenIV.linux.org.uk Acked-by: Don Brace Tested-by: Don Brace Signed-off-by: Al Viro Signed-off-by: Martin K. Petersen commit cb17c1b69b175e3f7ae2ef53e384889cdbae5c0d Author: Al Viro Date: Sat May 30 00:40:26 2020 +0100 scsi: hpsa: Don't bother with vmalloc for BIG_IOCTL_Command_struct "BIG" in the name refers to the amount of data being transferred, _not_ the size of structure itself; it's 140 or 144 bytes (for 32bit and 64bit hosts resp.). IOCTL_Command_struct is 136 or 144 bytes large... No point whatsoever turning that into dynamic allocation, let alone vmalloc one. Just keep it as local variable... Link: https://lore.kernel.org/r/20200529234028.46373-2-viro@ZenIV.linux.org.uk Acked-by: Don Brace Tested-by: Don Brace Signed-off-by: Al Viro Signed-off-by: Martin K. Petersen commit 138125f74b254fd2e37b3d875faf8e0e8608299b Author: Al Viro Date: Sat May 30 00:40:25 2020 +0100 scsi: hpsa: Lift {BIG_,}IOCTL_Command_struct copy{in,out} into hpsa_ioctl() Link: https://lore.kernel.org/r/20200529234028.46373-1-viro@ZenIV.linux.org.uk Acked-by: Don Brace Tested-by: Don Brace Signed-off-by: Al Viro Signed-off-by: Martin K. Petersen commit 97ed3e509ee6d098730d137759c627a8d674cf55 Author: Steve Lee Date: Thu Jun 4 14:47:31 2020 +0900 ASoC: max98390: Fix potential crash during param fw loading malformed firmware file can cause out-of-bound access and crash during dsm_param bin loading. - add MIN/MAX param size to avoid out-of-bound access. - read start addr and size of param and check bound. - add condition that fw->size > param_size + _PAYLOAD_OFFSET to confirm enough data. Signed-off-by: Steve Lee Link: https://lore.kernel.org/r/20200604054731.21140-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown commit 678916ec54f38406032462dc466fd36cdfea4e3c Author: Takashi Iwai Date: Tue Jun 2 18:44:53 2020 +0200 ASoC: max98390: Fix incorrect printf qualifier This patch addresses a compile warning: sound/soc/codecs/max98390.c:781:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘size_t {aka const unsigned int}’ [-Wformat=] Fixes: a6e3f4f34cdb ("ASoC: max98390: Added Amplifier Driver") Signed-off-by: Takashi Iwai Acked-by: Mark Brown Link: https://lore.kernel.org/r/20200602164453.29925-1-tiwai@suse.de Signed-off-by: Mark Brown commit e396dec46c5600d426b2ca8a01a877928b50d1d9 Author: Shengjiu Wang Date: Thu Jun 4 14:25:30 2020 +0800 ASoC: fsl-asoc-card: Defer probe when fail to find codec device Defer probe when fail to find codec device, because the codec device maybe probed later than machine driver. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1591251930-4111-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit d605cbb64252071d6a74b4fbb626e1473d91838d Author: Oder Chiou Date: Thu Jun 4 15:10:16 2020 +0800 ASoC: rl6231: Modify the target DMIC clock rate Some DMIC components will not work correctly in the clock rate 3.072MHz. We recommend the clock rate 1.536MHz in the gerenal case. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200604071016.3981-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 38ac46002d1df5707566a73486452851341028d2 Author: Andre Przywara Date: Wed Jun 3 17:22:37 2020 +0100 arm: dts: vexpress: Move mcc node back into motherboard node Commit d9258898ad49 ("arm64: dts: arm: vexpress: Move fixed devices out of bus node") moved the "mcc" DT node into the root node, because it does not have any children using "reg" properties, so does violate some dtc checks about "simple-bus" nodes. However this broke the vexpress config-bus code, which walks up the device tree to find the first node with an "arm,vexpress,site" property. This gave the wrong result (matching the root node instead of the motherboard node), so broke the clocks and some other devices for VExpress boards. Move the whole node back into its original position. This re-introduces the dtc warning, but is conceptually the right thing to do. The dtc warning seems to be overzealous here, there are discussions on fixing or relaxing this check instead. Link: https://lore.kernel.org/r/20200603162237.16319-1-andre.przywara@arm.com Fixes: d9258898ad49 ("arm64: dts: vexpress: Move fixed devices out of bus node") Reported-and-tested-by: Guenter Roeck Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 320bdbd816156f9ca07e5fed7bfb449f2908dda7 Author: Christophe JAILLET Date: Sat May 30 15:35:37 2020 +0200 crypto: cavium/nitrox - Fix 'nitrox_get_first_device()' when ndevlist is fully iterated When a list is completely iterated with 'list_for_each_entry(x, ...)', x is not NULL at the end. While at it, remove a useless initialization of the ndev variable. It is overridden by 'list_for_each_entry'. Fixes: f2663872f073 ("crypto: cavium - Register the CNN55XX supported crypto algorithms.") Cc: Signed-off-by: Christophe JAILLET Signed-off-by: Herbert Xu commit 281c377872ff5d15d80df25fc4df02d2676c7cde Author: Tero Kristo Date: Wed May 27 15:24:29 2020 +0300 crypto: omap-sham - add proper load balancing support for multicore The current implementation of the multiple accelerator core support for OMAP SHA does not work properly. It always picks up the first probed accelerator core if this is available, and rest of the book keeping also gets confused if there are two cores available. Add proper load balancing support for SHA, and also fix any bugs related to the multicore support while doing it. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit 9ef4e6e5e31403860081b995f26dc0d4b26356c2 Author: Tero Kristo Date: Wed May 27 15:24:28 2020 +0300 crypto: omap-aes - prevent unregistering algorithms twice Most of the OMAP family SoCs contain two instances for AES core, which causes the remove callbacks to be also done twice when driver is removed. Fix the algorithm unregister callbacks to take into account the number of algorithms still registered to avoid removing these twice. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit 63832a0c6fe180aa34d2a77052aa501be6281c99 Author: Tero Kristo Date: Wed May 27 15:24:27 2020 +0300 crypto: omap-sham - fix very small data size handling With very small data sizes, the whole data can end up in the xmit buffer. This code path does not set the sg_len properly which causes the core dma framework to crash. Fix by adding the proper size in place. Also, the data length must be a multiple of block-size, so extend the DMA data size while here. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit 6395166d7a19019d5e9574eb9ecdaf0028abb887 Author: Tero Kristo Date: Wed May 27 15:24:26 2020 +0300 crypto: omap-sham - huge buffer access fixes The ctx internal buffer can only hold buflen amount of data, don't try to copy over more than that. Also, initialize the context sg pointer if we only have data in the context internal buffer, this can happen when closing a hash with certain data amounts. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit 7e34e0bbc6449458a8de675814ffa22dec003698 Author: Tero Kristo Date: Wed May 27 15:24:25 2020 +0300 crypto: omap-crypto - fix userspace copied buffer access In case buffers are copied from userspace, directly accessing the page will most likely fail because it hasn't been mapped into the kernel memory space. Fix the issue by forcing a kmap / kunmap within the cleanup functionality. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit 8dc43636e39a89ec51188b012a789625fa83bbe0 Author: Tero Kristo Date: Wed May 27 15:24:24 2020 +0300 crypto: omap-sham - force kernel driver usage for sha algos As the hardware acceleration for the omap-sham algos is not available from userspace, force kernel driver usage. Without this flag in place, openssl 1.1 implementation thinks it can accelerate sha algorithms on omap devices directly from userspace. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit b29cb8d645da87d7d1ff28a7317c541ffccfa66c Author: Tero Kristo Date: Wed May 27 15:24:23 2020 +0300 crypto: omap-aes - avoid spamming console with self tests Running the self test suite for omap-aes with extra tests enabled causes huge spam with the tag message wrong indicators. With self tests, this is fine as there are some tests that purposedly pass bad data to the driver. Also, returning -EBADMSG from the driver is enough, so remove the dev_err message completely. Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu commit bfa50e1427e4608ce6941d3d0855445fcaa7dbb7 Author: Vasily Gorbik Date: Thu Jun 4 13:20:45 2020 +0200 vfio-ccw: make vfio_ccw_regops variables declarations static Fixes the following sparse warnings: drivers/s390/cio/vfio_ccw_chp.c:62:30: warning: symbol 'vfio_ccw_schib_region_ops' was not declared. Should it be static? drivers/s390/cio/vfio_ccw_chp.c:117:30: warning: symbol 'vfio_ccw_crw_region_ops' was not declared. Should it be static? Link: https://lkml.kernel.org/r/patch.git-a34be7aede18.your-ad-here.call-01591269421-ext-5655@work.hours Reviewed-by: Cornelia Huck Signed-off-by: Vasily Gorbik commit 0927e157b7e48a190500f785ce6d52d6fca8f14e Merge: e1750a3d9abb b2dd9a44a109 Author: Vasily Gorbik Date: Thu Jun 4 11:58:05 2020 +0200 Merge tag 'vfio-ccw-20200603-v2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into features vfio-ccw updates: - accept requests without the prefetch bit set - enable path handling via two new regions * tag 'vfio-ccw-20200603-v2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw: vfio-ccw: Add trace for CRW event vfio-ccw: Wire up the CRW irq and CRW region vfio-ccw: Introduce a new CRW region vfio-ccw: Refactor IRQ handlers vfio-ccw: Introduce a new schib region vfio-ccw: Refactor the unregister of the async regions vfio-ccw: Register a chp_event callback for vfio-ccw vfio-ccw: Introduce new helper functions to free/destroy regions vfio-ccw: document possible errors vfio-ccw: Enable transparent CCW IPL from DASD Link: https://lkml.kernel.org/r/20200603112716.332801-1-cohuck@redhat.com Signed-off-by: Vasily Gorbik commit 431275afdc7155415254aef4bd3816a1b8a2ead0 Author: Joerg Roedel Date: Thu Jun 4 11:19:44 2020 +0200 iommu: Check for deferred attach in iommu_group_do_dma_attach() The iommu_group_do_dma_attach() must not attach devices which have deferred_attach set. Otherwise devices could cause IOMMU faults when re-initialized in a kdump kernel. Fixes: deac0b3bed26 ("iommu: Split off default domain allocation from group assignment") Reported-by: Jerry Snitselaar Signed-off-by: Joerg Roedel Tested-by: Jerry Snitselaar Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20200604091944.26402-1-joro@8bytes.org commit 8d7e33d6811fbd24d3a1476a1b481b704975352a Author: Kunihiko Hayashi Date: Thu May 14 21:03:21 2020 +0900 PCI: uniphier: Add Socionext UniPhier Pro5 PCIe endpoint controller driver Add driver for the Socionext UniPhier Pro5 SoC endpoint controller. This controller is based on the DesignWare PCIe core. And add "host" to existing controller descriontions for the host controller in Kconfig. Link: https://lore.kernel.org/r/1589457801-12796-3-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Kunihiko Hayashi Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 74c6e384e991c5305754e3c79edf768a62b00563 Author: Miklos Szeredi Date: Thu Jun 4 10:48:19 2020 +0200 ovl: make oip->index bool ovl_get_inode() uses oip->index as a bool value, not as a pointer. Signed-off-by: Miklos Szeredi commit b778e1ee1afe2784c2a034bb1e0192423097cb36 Author: Miklos Szeredi Date: Thu Jun 4 10:48:19 2020 +0200 ovl: only pass ->ki_flags to ovl_iocb_to_rwf() Next patch will want to pass a modified set of flags, so... Signed-off-by: Miklos Szeredi commit df820f8de4e481222b17f9bcee7b909ae8167529 Author: Miklos Szeredi Date: Thu Jun 4 10:48:19 2020 +0200 ovl: make private mounts longterm Overlayfs is using clone_private_mount() to create internal mounts for underlying layers. These are used for operations requiring a path, such as dentry_open(). Since these private mounts are not in any namespace they are treated as short term, "detached" mounts and mntput() involves taking the global mount_lock, which can result in serious cacheline pingpong. Make these private mounts longterm instead, which trade the penalty on mntput() for a slightly longer shutdown time due to an added RCU grace period when putting these mounts. Introduce a new helper kern_unmount_many() that can take care of multiple longterm mounts with a single RCU grace period. Cc: Al Viro Signed-off-by: Miklos Szeredi commit b8e42a651bdee06202ebdd96cff64fdeabd5b1d6 Author: Miklos Szeredi Date: Thu Jun 4 10:48:19 2020 +0200 ovl: get rid of redundant members in struct ovl_fs ofs->upper_mnt is copied to ->layers[0].mnt and ->layers[0].trap could be used instead of a separate ->upperdir_trap. Split the lowerdir option early to get the number of layers, then allocate the ->layers array, and finally fill the upper and lower layers, as before. Get rid of path_put_init() in ovl_lower_dir(), since the only caller will take care of that. [Colin Ian King] Fix null pointer dereference on null stack pointer on error return found by Coverity. Signed-off-by: Miklos Szeredi commit 08f4c7c86d4cf125389dce9d94423024549f9b02 Author: Miklos Szeredi Date: Thu Jun 4 10:48:19 2020 +0200 ovl: add accessor for ofs->upper_mnt Next patch will remove ofs->upper_mnt, so add an accessor function for this field. Signed-off-by: Miklos Szeredi commit 520da69d265a91c6536c63851cbb8a53946974f0 Author: Yuxuan Shui Date: Wed May 27 04:08:02 2020 +0100 ovl: initialize error in ovl_copy_xattr In ovl_copy_xattr, if all the xattrs to be copied are overlayfs private xattrs, the copy loop will terminate without assigning anything to the error variable, thus returning an uninitialized value. If ovl_copy_xattr is called from ovl_clear_empty, this uninitialized error value is put into a pointer by ERR_PTR(), causing potential invalid memory accesses down the line. This commit initialize error with 0. This is the correct value because when there's no xattr to copy, because all xattrs are private, ovl_copy_xattr should succeed. This bug is discovered with the help of INIT_STACK_ALL and clang. Signed-off-by: Yuxuan Shui Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1050405 Fixes: 0956254a2d5b ("ovl: don't copy up opaqueness") Cc: stable@vger.kernel.org # v4.8 Signed-off-by: Alexander Potapenko Signed-off-by: Miklos Szeredi commit 94579ac3f6d0820adc83b5dc5358ead0158101e9 Author: Huy Nguyen Date: Mon Jun 1 16:39:37 2020 -0500 xfrm: Fix double ESP trailer insertion in IPsec crypto offload. During IPsec performance testing, we see bad ICMP checksum. The error packet has duplicated ESP trailer due to double validate_xmit_xfrm calls. The first call is from ip_output, but the packet cannot be sent because netif_xmit_frozen_or_stopped is true and the packet gets dev_requeue_skb. The second call is from NET_TX softirq. However after the first call, the packet already has the ESP trailer. Fix by marking the skb with XFRM_XMIT bit after the packet is handled by validate_xmit_xfrm to avoid duplicate ESP trailer insertion. Fixes: f6e27114a60a ("net: Add a xfrm validate function to validate_xmit_skb") Signed-off-by: Huy Nguyen Reviewed-by: Boris Pismenny Reviewed-by: Raed Salem Reviewed-by: Saeed Mahameed Signed-off-by: Steffen Klassert commit e80ddeb2f70ebd0786aa7cdba3e58bc931fa0bb5 Author: Steve French Date: Wed Jun 3 01:33:58 2020 -0500 smb3: fix incorrect number of credits when ioctl MaxOutputResponse > 64K We were not checking to see if ioctl requests asked for more than 64K (ie when CIFSMaxBufSize was > 64K) so when setting larger CIFSMaxBufSize then ioctls would fail with invalid parameter errors. When requests ask for more than 64K in MaxOutputResponse then we need to ask for more than 1 credit. Signed-off-by: Steve French CC: Stable Reviewed-by: Aurelien Aptel commit 1ee0e6d47d08ef309e0975a96d643972855511d0 Author: Steve French Date: Tue Jun 2 23:17:16 2020 -0500 smb3: default to minimum of two channels when multichannel specified When "multichannel" is specified on mount, make sure to default to at least two channels. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit dd67cab5db7e940dad66653a04d780d53bd380d5 Author: Ben Skeggs Date: Thu Jun 4 11:00:01 2020 +1000 drm/nouveau/kms/nv50-: clear SW state of disabled windows harder The most innocuous result of not having done this is that we end up sending unnecessary methods when we next enable the window. However, interactions with the code handling skipping disables when an update immediately follows, and window ownership assignment, can lead to upsetting the display hardware on Volta and newer. Signed-off-by: Ben Skeggs commit 21454fe697fde188ad6fb541f94b9838fa73ab38 Author: Thierry Reding Date: Wed Jun 3 16:20:02 2020 +0200 drm/nouveau: gr/gk20a: Use firmware version 0 Tegra firmware doesn't actually use any version numbers and passing -1 causes the existing firmware binaries not to be found. Use version 0 to find the correct files. Fixes: ef16dc278ec2 ("drm/nouveau/gr/gf100-: select implementation based on available FW") Signed-off-by: Thierry Reding Reviewed-by: Emil Velikov Signed-off-by: Ben Skeggs commit 9b5ca547bb8fc26c251d457ac55cc8e3d9baa6bf Author: Ben Skeggs Date: Wed Jun 3 12:51:03 2020 +1000 drm/nouveau/disp/gm200-: detect and potentially disable HDA support on some SORs Some HDA pin widgets may be disabled by BIOS, and unavailable from a SOR. Our SOR allocation policy uses this information to allocate an appropriate SOR when HDA is supported by a display. Thank you to NVIDIA for providing the information to determine this. Signed-off-by: Ben Skeggs commit 9f9f54e887adef3dc9b62f372002c421ef4f1921 Author: Ben Skeggs Date: Thu Jun 4 14:22:32 2020 +1000 drm/nouveau/disp/gp100: split SOR implementation from gm200 GP100 needs different HDA detection. Signed-off-by: Ben Skeggs commit e6867ffa34340636252efe8e6b82be625c43d9b1 Author: Ben Skeggs Date: Wed Jun 3 11:43:23 2020 +1000 drm/nouveau/disp: modify OR allocation policy to account for HDA requirements Since GM200, SORs are no longer tied to a specific connector, and we allocate them instead, with the assumption that all SORs are equally capable. However, there's a 1<->1 mapping between SOR and HDA pin widget, and it turns out that it's possible for some widgets to be disabled... In order to avoid picking a SOR without a valid pin widget, some new rules need to be added. Signed-off-by: Ben Skeggs commit f24b6ae19fa257ea9b10a9389d0b7046b3efd97c Author: Ben Skeggs Date: Wed Jun 3 11:40:47 2020 +1000 drm/nouveau/disp: split part of OR allocation logic into a function No logical changes here, this is just moving the code to make the changes in the next commit more obvious. Signed-off-by: Ben Skeggs commit 6f8dbcf1c9cec3ec5efcf4c17b29a5b1732d1491 Author: Ben Skeggs Date: Wed Jun 3 11:37:56 2020 +1000 drm/nouveau/disp: provide hint to OR allocation about HDA requirements Will be used by a subsequent commit to influence SOR allocation policy. Signed-off-by: Ben Skeggs commit 6929f71e46bdddbf1c4d67c2728648176c67c555 Author: Linus Torvalds Date: Wed Jun 3 21:22:46 2020 -0700 atomisp: avoid warning about unused function The atomisp_mrfld_power() function isn't actually ever called, because the two call-sites have commented out the use because it breaks on some platforms. That results in: drivers/staging/media/atomisp/pci/atomisp_v4l2.c:764:12: warning: ‘atomisp_mrfld_power’ defined but not used [-Wunused-function] 764 | static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) | ^~~~~~~~~~~~~~~~~~~ during the build. Rather than commenting out the use entirely, just disable it semantically instead (using a "0 &&" construct), leaving the call in place from a syntax standpoint, and avoiding the warning. I really don't want my builds to have any warnings that can then hide real issues. Signed-off-by: Linus Torvalds commit a98f670e41a99f53acb1fb33cee9c6abbb2e6f23 Merge: ee01c4d72adf 938b29db3aa9 Author: Linus Torvalds Date: Wed Jun 3 20:59:38 2020 -0700 Merge tag 'media/v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Media documentation is now split into admin-guide, driver-api and userspace-api books (a longstanding request from Jon); - The media Kconfig was reorganized, in order to make easier to select drivers and their dependencies; - The testing drivers now has a separate directory; - added a new driver for Rockchip Video Decoder IP; - The atomisp staging driver was resurrected. It is meant to work with 4 generations of cameras on Atom-based laptops, tablets and cell phones. So, it seems worth investing time to cleanup this driver and making it in good shape. - Added some V4L2 core ancillary routines to help with h264 codecs; - Added an ov2740 image sensor driver; - The si2157 gained support for Analog TV, which, in turn, added support for some cx231xx and cx23885 boards to also support analog standards; - Added some V4L2 controls (V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION) to help identifying where the camera is located at the device; - VIDIOC_ENUM_FMT was extended to support MC-centric devices; - Lots of drivers improvements and cleanups. * tag 'media/v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (503 commits) media: Documentation: media: Refer to mbus format documentation from CSI-2 docs media: s5k5baf: Replace zero-length array with flexible-array media: i2c: imx219: Drop and media: i2c: Add ov2740 image sensor driver media: ov8856: Implement sensor module revision identification media: ov8856: Add devicetree support media: dt-bindings: ov8856: Document YAML bindings media: dvb-usb: Add Cinergy S2 PCIe Dual Port support media: dvbdev: Fix tuner->demod media controller link media: dt-bindings: phy: phy-rockchip-dphy-rx0: move rockchip dphy rx0 bindings out of staging media: staging: dt-bindings: phy-rockchip-dphy-rx0: remove non-used reg property media: atomisp: unify the version for isp2401 a0 and b0 versions media: atomisp: update TODO with the current data media: atomisp: adjust some code at sh_css that could be broken media: atomisp: don't produce errs for ignored IRQs media: atomisp: print IRQ when debugging media: atomisp: isp_mmu: don't use kmem_cache media: atomisp: add a notice about possible leak resources media: atomisp: disable the dynamic and reserved pools media: atomisp: turn on camera before setting it ... commit ee01c4d72adffb7d424535adf630f2955748fa8b Merge: c444eb564fb1 09587a09ada2 Author: Linus Torvalds Date: Wed Jun 3 20:24:15 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge more updates from Andrew Morton: "More mm/ work, plenty more to come Subsystems affected by this patch series: slub, memcg, gup, kasan, pagealloc, hugetlb, vmscan, tools, mempolicy, memblock, hugetlbfs, thp, mmap, kconfig" * akpm: (131 commits) arm64: mm: use ARCH_HAS_DEBUG_WX instead of arch defined x86: mm: use ARCH_HAS_DEBUG_WX instead of arch defined riscv: support DEBUG_WX mm: add DEBUG_WX support drivers/base/memory.c: cache memory blocks in xarray to accelerate lookup mm/thp: rename pmd_mknotpresent() as pmd_mkinvalid() powerpc/mm: drop platform defined pmd_mknotpresent() mm: thp: don't need to drain lru cache when splitting and mlocking THP hugetlbfs: get unmapped area below TASK_UNMAPPED_BASE for hugetlbfs sparc32: register memory occupied by kernel as memblock.memory include/linux/memblock.h: fix minor typo and unclear comment mm, mempolicy: fix up gup usage in lookup_node tools/vm/page_owner_sort.c: filter out unneeded line mm: swap: memcg: fix memcg stats for huge pages mm: swap: fix vmstats for huge pages mm: vmscan: limit the range of LRU type balancing mm: vmscan: reclaim writepage is IO cost mm: vmscan: determine anon/file pressure balance at the reclaim root mm: balance LRU lists based on relative thrashing mm: only count actual rotations as LRU reclaim cost ... commit 6b8ed62008a49751fc71fefd2a4f89202a7c2d4d Author: Jan Kara Date: Mon May 25 10:12:15 2020 +0200 ext4: avoid unnecessary transaction starts during writeback ext4_writepages() currently works in a loop like: start a transaction scan inode for pages to write map and submit these pages stop the transaction This loop results in starting transaction once more than is needed because in the last iteration we start a transaction only to scan the inode and find there are no pages to write. This can be significant increase in number of transaction starts for single-extent files or files that have all blocks already mapped. Furthermore we already know from previous iteration whether there are more pages to write or not. So propagate the information from mpage_prepare_extent_to_map() and avoid unnecessary looping in case there are no more pages to write. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20200525081215.29451-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 6e014c621e7271649f0d51e54dbe1db4c10486c8 Author: Jens Axboe Date: Sun May 24 16:53:16 2020 -0600 ext4: don't block for O_DIRECT if IOCB_NOWAIT is set Running with some debug patches to detect illegal blocking triggered the extend/unaligned condition in ext4. If ext4 needs to extend the file (and hence go to buffered IO), or if the app is doing unaligned IO, then ext4 asks the iomap code to wait for IO completion. If the caller asked for no-wait semantics by setting IOCB_NOWAIT, then ext4 should return -EAGAIN instead. Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/76152096-2bbb-7682-8fce-4cb498bcd909@kernel.dk Signed-off-by: Theodore Ts'o commit ba988903937c1b1ce5d54567b50f2ad9604b3bfe Author: Christoph Hellwig Date: Sat May 23 09:30:16 2020 +0200 ext4: remove the access_ok() check in ext4_ioctl_get_es_cache access_ok just checks we are fed a proper user pointer. We also do that in copy_to_user itself, so no need to do this early. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200523073016.2944131-10-hch@lst.de Signed-off-by: Theodore Ts'o commit c7d216e8c44cfc0b680d8c0de4f9bdafd92f7ef6 Author: Christoph Hellwig Date: Sat May 23 09:30:15 2020 +0200 fs: remove the access_ok() check in ioctl_fiemap access_ok just checks we are fed a proper user pointer. We also do that in copy_to_user itself, so no need to do this early. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20200523073016.2944131-9-hch@lst.de Signed-off-by: Theodore Ts'o commit 45dd052e67ad17c7a24874a783f41aeab15bc294 Author: Christoph Hellwig Date: Sat May 23 09:30:14 2020 +0200 fs: handle FIEMAP_FLAG_SYNC in fiemap_prep By moving FIEMAP_FLAG_SYNC handling to fiemap_prep we ensure it is handled once instead of duplicated, but can still be done under fs locks, like xfs/iomap intended with its duplicate handling. Also make sure the error value of filemap_write_and_wait is propagated to user space. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20200523073016.2944131-8-hch@lst.de Signed-off-by: Theodore Ts'o commit cddf8a2c4a8286ae60fc866eab59c8bc524e93a0 Author: Christoph Hellwig Date: Sat May 23 09:30:13 2020 +0200 fs: move fiemap range validation into the file systems instances Replace fiemap_check_flags with a fiemap_prep helper that also takes the inode and mapped range, and performs the sanity check and truncation previously done in fiemap_check_range. This way the validation is inside the file system itself and thus properly works for the stacked overlayfs case as well. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20200523073016.2944131-7-hch@lst.de Signed-off-by: Theodore Ts'o commit 2732881894714f545ffac42dad7ba7730069874d Author: Christoph Hellwig Date: Sat May 23 09:30:12 2020 +0200 iomap: fix the iomap_fiemap prototype iomap_fiemap should take u64 start and len arguments, just like the ->fiemap prototype. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20200523073016.2944131-6-hch@lst.de Signed-off-by: Theodore Ts'o commit 10c5db286452b8c60e8f58e9a4c1cbc5a91e4e5b Author: Christoph Hellwig Date: Sat May 23 09:30:11 2020 +0200 fs: move the fiemap definitions out of fs.h No need to pull the fiemap definitions into almost every file in the kernel build. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20200523073016.2944131-5-hch@lst.de Signed-off-by: Theodore Ts'o commit 44ebcd06bbb3ab3ee446b933800aca32fc4ca9b1 Author: Christoph Hellwig Date: Sat May 23 09:30:10 2020 +0200 fs: mark __generic_block_fiemap static There is no caller left outside of ioctl.c. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20200523073016.2944131-4-hch@lst.de Signed-off-by: Theodore Ts'o commit da565e792be540a5726af7f8cd50b282af0358b7 Author: Christoph Hellwig Date: Sat May 23 09:30:09 2020 +0200 ext4: remove the call to fiemap_check_flags in ext4_fiemap iomap_fiemap already calls fiemap_check_flags first thing, so this additional check is redundant. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200523073016.2944131-3-hch@lst.de Signed-off-by: Theodore Ts'o commit 03a5ed24c9b8f0180a59ba7b7b9b9517fcf4335b Author: Christoph Hellwig Date: Sat May 23 09:30:08 2020 +0200 ext4: split _ext4_fiemap The fiemap and EXT4_IOC_GET_ES_CACHE cases share almost no code, so split them into entirely separate functions. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200523073016.2944131-2-hch@lst.de Signed-off-by: Theodore Ts'o commit 328e24ae14aeb8ef624ec181e0d546b05c34f031 Author: Christoph Hellwig Date: Tue May 5 17:43:15 2020 +0200 ext4: fix fiemap size checks for bitmap files Add an extra validation of the len parameter, as for ext4 some files might have smaller file size limits than others. This also means the redundant size check in ext4_ioctl_get_es_cache can go away, as all size checking is done in the shared fiemap handler. Signed-off-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200505154324.3226743-3-hch@lst.de Signed-off-by: Theodore Ts'o commit 175efa81feb8405676e0136d97b10380179c92e0 Author: Ritesh Harjani Date: Tue May 5 17:43:14 2020 +0200 ext4: fix EXT4_MAX_LOGICAL_BLOCK macro ext4 supports max number of logical blocks in a file to be 0xffffffff. (This is since ext4_extent's ee_block is __le32). This means that EXT4_MAX_LOGICAL_BLOCK should be 0xfffffffe (starting from 0 logical offset). This patch fixes this. The issue was seen when ext4 moved to iomap_fiemap API and when overlayfs was mounted on top of ext4. Since overlayfs was missing filemap_check_ranges(), so it could pass a arbitrary huge length which lead to overflow of map.m_len logic. This patch fixes that. Fixes: d3b6f23f7167 ("ext4: move ext4_fiemap to use iomap framework") Reported-by: syzbot+77fa5bdb65cc39711820@syzkaller.appspotmail.com Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20200505154324.3226743-2-hch@lst.de Signed-off-by: Theodore Ts'o commit 9f364e1d9537d44fdf58deeeddb51277d8327ce5 Author: Jonathan Grant Date: Fri May 22 16:07:58 2020 +0100 add comment for ext4_dir_entry_2 file_type member Signed-off-by: Jonathan Grant Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/ad3290d5-86af-99c1-f9d5-cd1bab710429@jguk.org Signed-off-by: Theodore Ts'o commit 14ff6286309e2853aed50083c9a83328423fdd8c Author: Jan Kara Date: Wed May 20 15:31:19 2020 +0200 jbd2: avoid leaking transaction credits when unreserving handle When reserved transaction handle is unused, we subtract its reserved credits in __jbd2_journal_unreserve_handle() called from jbd2_journal_stop(). However this function forgets to remove reserved credits from transaction->t_outstanding_credits and thus the transaction space that was reserved remains effectively leaked. The leaked transaction space can be quite significant in some cases and leads to unnecessarily small transactions and thus reducing throughput of the journalling machinery. E.g. fsmark workload creating lots of 4k files was observed to have about 20% lower throughput due to this when ext4 is mounted with dioread_nolock mount option. Subtract reserved credits from t_outstanding_credits as well. CC: stable@vger.kernel.org Fixes: 8f7d89f36829 ("jbd2: transaction reservation support") Reviewed-by: Andreas Dilger Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20200520133119.1383-3-jack@suse.cz Signed-off-by: Theodore Ts'o commit dfcd4489e270282d984cd06c00f3a45d52a3f0a7 Author: Jan Kara Date: Wed May 20 15:31:18 2020 +0200 ext4: drop ext4_journal_free_reserved() Remove ext4_journal_free_reserved() function. It is never used. Signed-off-by: Jan Kara Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20200520133119.1383-2-jack@suse.cz Signed-off-by: Theodore Ts'o commit 993778306e7901a7286322f25c7c681dd47bede6 Author: Ritesh Harjani Date: Wed May 20 12:10:36 2020 +0530 ext4: mballoc: use lock for checking free blocks while retrying Currently while doing block allocation grp->bb_free may be getting modified if discard is happening in parallel. For e.g. consider a case where there are lot of threads who have preallocated lot of blocks and there is a thread which is trying to discard all of this group's PA. Now it could happen that we see all of those group's bb_free is zero and fail the allocation while there is sufficient space if we free up all the PA. So this patch adds another flag "EXT4_MB_STRICT_CHECK" which will be set if we are unable to allocate any blocks in the first try (since we may not have considered blocks about to be discarded from PA lists). So during retry attempt to allocate blocks we will use ext4_lock_group() for checking if the group is good or not. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/9cb740a117c958c36596f167b12af1beae9a68b7.1589955723.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 8ef123fe02ca0923b01b57bdf639800a23a2faa8 Author: Ritesh Harjani Date: Wed May 20 12:10:35 2020 +0530 ext4: mballoc: refactor ext4_mb_good_group() ext4_mb_good_group() definition was changed some time back and now it even initializes the buddy cache (via ext4_mb_init_group()), if in case the EXT4_MB_GRP_NEED_INIT() is true for a group. Note that ext4_mb_init_group() could sleep and so should not be called under a spinlock held. This is fine as of now because ext4_mb_good_group() is called before loading the buddy bitmap without ext4_lock_group() held and again called after loading the bitmap, only this time with ext4_lock_group() held. But still this whole thing is confusing. So this patch refactors out ext4_mb_good_group_nolock() which should be called when without holding ext4_lock_group(). Also in further patches we hold the spinlock (ext4_lock_group()) while doing any calculations which involves grp->bb_free or grp->bb_fragments. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/d9f7d031a5fbe1c943fae6bf1ff5cdf0604ae722.1589955723.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 07b5b8e1ac4004b7db1065a301df65cd434c31c9 Author: Ritesh Harjani Date: Wed May 20 12:10:34 2020 +0530 ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling There could be a race in function ext4_mb_discard_group_preallocations() where the 1st thread may iterate through group's bb_prealloc_list and remove all the PAs and add to function's local list head. Now if the 2nd thread comes in to discard the group preallocations, it will see that the group->bb_prealloc_list is empty and will return 0. Consider for a case where we have less number of groups (for e.g. just group 0), this may even return an -ENOSPC error from ext4_mb_new_blocks() (where we call for ext4_mb_discard_group_preallocations()). But that is wrong, since 2nd thread should have waited for 1st thread to release all the PAs and should have retried for allocation. Since 1st thread was anyway going to discard the PAs. The algorithm using this percpu seq counter goes below: 1. We sample the percpu discard_pa_seq counter before trying for block allocation in ext4_mb_new_blocks(). 2. We increment this percpu discard_pa_seq counter when we either allocate or free these blocks i.e. while marking those blocks as used/free in mb_mark_used()/mb_free_blocks(). 3. We also increment this percpu seq counter when we successfully identify that the bb_prealloc_list is not empty and hence proceed for discarding of those PAs inside ext4_mb_discard_group_preallocations(). Now to make sure that the regular fast path of block allocation is not affected, as a small optimization we only sample the percpu seq counter on that cpu. Only when the block allocation fails and when freed blocks found were 0, that is when we sample percpu seq counter for all cpus using below function ext4_get_discard_pa_seq_sum(). This happens after making sure that all the PAs on grp->bb_prealloc_list got freed or if it's empty. It can be well argued that why don't just check for grp->bb_free to see if there are any free blocks to be allocated. So here are the two concerns which were discussed:- 1. If for some reason the blocks available in the group are not appropriate for allocation logic (say for e.g. EXT4_MB_HINT_GOAL_ONLY, although this is not yet implemented), then the retry logic may result into infinte looping since grp->bb_free is non-zero. 2. Also before preallocation was clubbed with block allocation with the same ext4_lock_group() held, there were lot of races where grp->bb_free could not be reliably relied upon. Due to above, this patch considers discard_pa_seq logic to determine if we should retry for block allocation. Say if there are are n threads trying for block allocation and none of those could allocate or discard any of the blocks, then all of those n threads will fail the block allocation and return -ENOSPC error. (Since the seq counter for all of those will match as no block allocation/discard was done during that duration). Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/7f254686903b87c419d798742fd9a1be34f0657b.1589955723.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit cf5e2ca6c99077d128e971149f0c262e808ca831 Author: Ritesh Harjani Date: Wed May 20 12:10:33 2020 +0530 ext4: mballoc: refactor ext4_mb_discard_preallocations() Implement ext4_mb_discard_preallocations_should_retry() which we will need in later patches to add more logic like check for sequence number match to see if we should retry for block allocation or not. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/1cfae0098d2aa9afbeb59331401258182868c8f2.1589955723.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 53f86b170dfa8d50b8b3fb1c5cf17c33b2327db2 Author: Ritesh Harjani Date: Wed May 20 12:10:32 2020 +0530 ext4: mballoc: add blocks to PA list under same spinlock after allocating blocks ext4_mb_discard_preallocations() only checks for grp->bb_prealloc_list of every group to discard the group's PA to free up the space if allocation request fails. Consider below race:- Process A Process B 1. allocate blocks 1. Fails block allocation from ext4_mb_regular_allocator() ext4_lock_group() allocated blocks more than ac_o_ex.fe_len ext4_unlock_group() 2. Scans the grp->bb_prealloc_list (under ext4_lock_group()) and find nothing and thus return -ENOSPC. 2. Add the additional blocks to PA list ext4_lock_group() add blocks to grp->bb_prealloc_list ext4_unlock_group() Above race could be avoided if we add those additional blocks to grp->bb_prealloc_list at the same time with block allocation when ext4_lock_group() was still held. With this discard-PA will know if there are actually any blocks which could be freed from the PA Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/a2217dd782585b42328981832e6d396abaaccb80.1589955723.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit de8ff14cab998f51a3a289d2b58d6d440782f77e Author: Eric Biggers Date: Sun May 10 14:52:52 2020 -0700 ext4: add casefold flag to EXT4_INODE_* flags No one currently needs EXT4_INODE_CASEFOLD, but add it to keep the EXT4_INODE_* definitions in sync with the EXT4_*_FL definitions. Also make it clearer that the casefold flag is only for directories. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20200510215252.87833-1-ebiggers@kernel.org Signed-off-by: Theodore Ts'o commit 8ad8d710035edf8d14f8ecc5fa15f8e1a27ecb59 Author: Eric Whitney Date: Sun May 10 11:58:05 2020 -0400 ext4: rework map struct instantiation in ext4_ext_map_blocks() The path performing block allocations in ext4_ext_map_blocks() contains code trimming the length of a new extent that is repeated later in the function. This code is both redundant and unnecessary as the exact length of the new extent has already been calculated. Rewrite the instantiation of the map struct in this case to use the available values, avoiding the overhead of unnecessary conversions and improving clarity. Add another map struct instantiation tailored specifically to the separate case for an existing written extent. Remove an old comment that no longer appears applicable to the current code. Signed-off-by: Eric Whitney Link: https://lore.kernel.org/r/20200510155805.18808-1-enwlinux@gmail.com Signed-off-by: Theodore Ts'o Reviewed-by: Ritesh Harjani commit 70aa1554b01474ab08d08e5a18b0215a7ff1e8dc Author: Ritesh Harjani Date: Sun May 10 11:54:55 2020 +0530 ext4: make ext_debug() implementation to use pr_debug() ext_debug() msgs could be helpful, provided those could be enabled without recompiling kernel and also if we could selectively enable only required prints for case by case debugging. So make ext_debug() implementation use pr_debug(). Also change ext_debug() to be defined with CONFIG_EXT4_DEBUG. So EXT_DEBUG macro now mostly remain for below 3 functions. ext4_ext_show_path/leaf/move() (whose print msgs use ext_debug() which again could be dynamically enabled using pr_debug()) This also changes the ext_debug() to take inode as a parameter to add inode no. in all of it's msgs. Prints additional info like process name / pid, superblock id etc. This also removes any explicit function names passed in ext_debug(). Since ext_debug() on it's own prints file, func and line no. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/d31dc189b0aeda9384fe7665e36da7cd8c61571f.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit d3df14535f4a5b5af58ef12b4263202df3155356 Author: Ritesh Harjani Date: Sun May 10 11:54:54 2020 +0530 ext4: mballoc: make mb_debug() implementation to use pr_debug() mb_debug() msg had only 1 control level for all type of msgs. And if we enable mballoc_debug then all of those msgs would be enabled. Instead of adding multiple debug levels for mb_debug() msgs, use pr_debug() with which we could have finer control to print msgs at all of different levels (i.e. at file, func, line no.). Also add process name/pid, superblk id, and other info in mb_debug() msg. This also kills the mballoc_debug module parameter, since it is not needed any more. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/f0c660cbde9e2edbe95c67942ca9ad80dd2231eb.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 8ec2d31b27f683e3deeaf5d562b534a695052de3 Author: Ritesh Harjani Date: Sun May 10 11:54:53 2020 +0530 ext4: replace EXT_DEBUG with __maybe_unused in ext4_ext_handle_unwritten_extents() Replace EXT_DEBUG with __maybe_unused from inside ext4_ext_handle_unwritten_extents() function. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/ae335b94506cd9db9d2648c1f4dd25a80f9f3ce2.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit ec8c60be96d6de74be601fbca56342efb9a1e039 Author: Ritesh Harjani Date: Sun May 10 11:54:52 2020 +0530 ext4: improve ext_debug() msg in case of block allocation failure ext4_map_blocks() has ext_debug msg early at the start of function. We also get ext_debug msg if we could allocate a block from ext4_ext_map_blocks(). But there is no ext_debug() msg in case of block allocation failure. So add one along with error code. Also add more info in ext_debug() msg like how many blocks were allocated v/s how many were requested in ext4_ext_map_blocks(). Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/1610ec2aa932396be00f9d552fe29da473ead176.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 6db074618969dc6fac4978e8043945fd440b310a Author: Ritesh Harjani Date: Sun May 10 11:54:51 2020 +0530 ext4: use BIT() macro for BH_** state bits Simply use BIT() macro for all BH_** state bits instead of open coding it. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/57667689f51a3f9dba2fcef7d3425187fa3ba69f.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 9bee5779ee26d6debc84e0f1e4e54daa93f13ebc Author: Ritesh Harjani Date: Sun May 10 11:54:50 2020 +0530 ext4: balloc: use task_pid_nr() helper Use task_pid_nr() function instead of current->pid. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/4b58403e15e9c8deb34a1b93deb3fc9cd153ab84.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit eb2b8ebb867fa895d5c4768310998bc940f6506c Author: Ritesh Harjani Date: Sun May 10 11:54:49 2020 +0530 ext4: mballoc: fix possible NULL ptr & remove BUG_ONs from DOUBLE_CHECK Make sure to check for e4b->bd_info->bb_bitmap == NULL, in mb_cmp_bitmaps() and return if NULL, to avoid possible NULL ptr dereference. Similar to how we do this in other ifdef DOUBLE_CHECK functions. Also remove the BUG_ON() logic if kmalloc() or ext4_read_block_bitmap() fails. We should simply mark grp->bb_bitmap as NULL if above happens. In fact ext4_read_block_bitmap() may even return an error in case of resize ioctl. Hence remove this BUG_ON logic (fstests ext4/032 may trigger this). Link: https://lore.kernel.org/r/9a54f8a696ff17c057cd571be3d15ac3ec1407f1.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit a345021553f7e6343b05b1ad1c25ed931140b47c Author: Ritesh Harjani Date: Sun May 10 11:54:48 2020 +0530 ext4: mballoc: refactor code inside DOUBLE_CHECK into separate function This patch implemets mb_group_bb_bitmap_alloc() and mb_group_bb_bitmap_free() function to remove #ifdef DOUBLE_CHECK macro and it's related code from inside ext4_mb_add_groupinfo()/ext4_mb_release(). There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/8c2095d74b779f0254a19b24982490dc6f07c4f9.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 4fca8f07790a62c2b3da028ae423cf4d71c1bacd Author: Ritesh Harjani Date: Sun May 10 11:54:47 2020 +0530 ext4: mballoc: make ext4_mb_use_preallocated() return type as bool Change return type of function ext4_mb_use_preallocated() to bool to better reflect what this function can return. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/7880cb6ef911465beafefcd7e9c3ea214688744b.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit f283529abac45d8c2b4d4b69d356cca9e6a2de43 Author: Ritesh Harjani Date: Sun May 10 11:54:46 2020 +0530 ext4: mballoc: simplify error handling in ext4_init_mballoc() This patch simplifies error handling logic in ext4_init_mballoc(), by adding all the cleanups at one place at the end of that function. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/8621a7bc68f7107a9ac4292afeb784515333bd25.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 004379d0b02ab8e8efbee1f2f878d5f578bed72c Author: Ritesh Harjani Date: Sun May 10 11:54:45 2020 +0530 ext4: mballoc: fix few other format specifier in mb_debug() Fix few other format specifiers in mb_debug() msgs. As such no other functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/574fa7f833abf2dbf3b53a2fea3195e71f6cdbd8.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 36bad4233cc50e29022c1095666935cee1c978ad Author: Ritesh Harjani Date: Sun May 10 11:54:44 2020 +0530 ext4: mballoc: correct the mb_debug() format specifier for pa_len var pa->pa_len is an integer. Fix all of the format specifier used in mb_debug() for pa_len to %d instead of %u. As such no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/af4987f643c586f62bcc9961e43f0a67151d5551.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit bbc4ec77e9f9c7ac71aee15c6adbd1674fe66c60 Author: Ritesh Harjani Date: Sun May 10 11:54:43 2020 +0530 ext4: mballoc: add more mb_debug() msgs This patch adds some more debugging mb_debug() msgs to help improve mballoc code debugging. Other than adding more mb_debug() msgs at few more places, there should be no other functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/5fc8e7788b924e211fcfa4a4c1d2f8503511661a.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit e68cf40c0d098a63bc571bc5981dee6c2013c494 Author: Ritesh Harjani Date: Sun May 10 11:54:42 2020 +0530 ext4: mballoc: refactor ext4_mb_show_ac() This factors out ext4_mb_show_pa() function to show all the group's preallocation info. This could be useful info to be added in later patches. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/8f07d890b0038dcc935e9c10e6043ec9f3792721.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 212da3ec6fafe458cd54c3a365cbcb4f9bd794e1 Author: Ritesh Harjani Date: Sun May 10 11:54:41 2020 +0530 ext4: mballoc: print bb_free info even when it is 0 Improve the debugging msg by also printing even if bb_free is 0. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/c894f1d1d30f86ae38f4e3a861949665b6dc61cd.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 73c384c0cdaa8ea9ca9ef2d0cff6a25930f1648e Author: Theodore Ts'o Date: Thu May 7 10:50:28 2020 -0700 ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path We can't fail in the truncate path without requiring an fsck. Add work around for this by using a combination of retry loops and the __GFP_NOFAIL flag. From: Theodore Ts'o Signed-off-by: Theodore Ts'o Signed-off-by: Anna Pendleton Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20200507175028.15061-1-pendleton@google.com Signed-off-by: Theodore Ts'o commit 08adf452e628b0e2ce9a01048cfbec52353703d7 Author: Eric Biggers Date: Wed May 6 11:31:40 2020 -0700 ext4: fix race between ext4_sync_parent() and rename() 'igrab(d_inode(dentry->d_parent))' without holding dentry->d_lock is broken because without d_lock, d_parent can be concurrently changed due to a rename(). Then if the old directory is immediately deleted, old d_parent->inode can be NULL. That causes a NULL dereference in igrab(). To fix this, use dget_parent() to safely grab a reference to the parent dentry, which pins the inode. This also eliminates the need to use d_find_any_alias() other than for the initial inode, as we no longer throw away the dentry at each step. This is an extremely hard race to hit, but it is possible. Adding a udelay() in between the reads of ->d_parent and its ->d_inode makes it reproducible on a no-journal filesystem using the following program: #include #include int main() { if (fork()) { for (;;) { mkdir("dir1", 0700); int fd = open("dir1/file", O_RDWR|O_CREAT|O_SYNC); write(fd, "X", 1); close(fd); } } else { mkdir("dir2", 0700); for (;;) { rename("dir1/file", "dir2/file"); rmdir("dir1"); } } } Fixes: d59729f4e794 ("ext4: fix races in ext4_sync_parent()") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20200506183140.541194-1-ebiggers@kernel.org Signed-off-by: Theodore Ts'o commit 80dd4978ddd78b2fe5aec2d52b69cbc2d06b08d8 Author: Christophe JAILLET Date: Sun May 3 22:06:47 2020 +0200 ext4: fix a typo in a comment s/extnets/extents/ Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200503200647.154701-1-christophe.jaillet@wanadoo.fr Signed-off-by: Theodore Ts'o commit be809e1274ebc043640eeeb287accb7b4a4bcbff Author: Eric Whitney Date: Thu Apr 30 14:53:20 2020 -0400 ext4: clean up ext4_ext_convert_to_initialized() error handling If ext4_ext_convert_to_initialized() fails when called within ext4_ext_handle_unwritten_extents(), immediately error out through the exit point at function end. Fix the error handling in the event ext4_ext_convert_to_initialized() returns 0, which it shouldn't do when converting an existing extent. The current code returns the passed in value of allocated (which is likely non-zero) while failing to set m_flags, m_pblk, and m_len. Signed-off-by: Eric Whitney Link: https://lore.kernel.org/r/20200430185320.23001-5-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit 779e26517b3600830fe58933d5f97627711c9435 Author: Eric Whitney Date: Thu Apr 30 14:53:19 2020 -0400 ext4: clean up GET_BLOCKS_PRE_IO error handling If the call to ext4_split_convert_extents() fails in the EXT4_GET_BLOCKS_PRE_IO case within ext4_ext_handle_unwritten_extents(), error out through the exit point at function end rather than jumping through an intermediate point. Fix the error handling in the event ext4_split_convert_extents() returns 0, which it shouldn't do when splitting an existing extent. The current code returns the passed in value of allocated (which is likely non-zero) while failing to set m_flags, m_pblk, and m_len. Signed-off-by: Eric Whitney Link: https://lore.kernel.org/r/20200430185320.23001-4-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit bee6cf00c7f17df27c842c169db31d53bdd775ba Author: Eric Whitney Date: Thu Apr 30 14:53:18 2020 -0400 ext4: remove redundant GET_BLOCKS_CONVERT code Remove the redundant code assigning values to ext4_map_blocks components in ext4_ext_handle_unwritten_extents() for the EXT4_GET_BLOCKS_CONVERT case, using the code at the function exit instead. Clean up and reorder that code to eliminate more redundancy and improve readability. Signed-off-by: Eric Whitney Link: https://lore.kernel.org/r/20200430185320.23001-3-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit ee802f86899341d835c629a4ad9607135f1b71a2 Author: Eric Whitney Date: Thu Apr 30 14:53:17 2020 -0400 ext4: remove dead GET_BLOCKS_ZERO code There's no call to ext4_map_blocks() in the current ext4 code with a flags argument that combines EXT4_GET_BLOCKS_CONVERT and EXT4_GET_BLOCKS_ZERO. Remove the code that corresponds to this case from ext4_ext_handle_unwritten_extents(). Signed-off-by: Eric Whitney Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20200430185320.23001-2-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit b60ca3343e78761c6ebe6ff52c628893c8297b73 Author: Harshad Shirwadkar Date: Sun Apr 26 18:34:38 2020 -0700 ext4: don't ignore return values from ext4_ext_dirty() Don't ignore return values from ext4_ext_dirty, since the errors indicate valid failures below Ext4. In all of the other instances of ext4_ext_dirty calls, the error return value is handled in some way. This patch makes those remaining couple of places to handle ext4_ext_dirty errors as well. In case of ext4_split_extent_at(), the ignorance of return value is intentional. The reason is that we are already in error path and there isn't much we can do if ext4_ext_dirty returns error. This patch adds a comment for that case explaining why we ignore the return value. In the longer run, we probably should make sure that errors from other mark_dirty routines are handled as well. Ran gce-xfstests smoke tests and verified that there were no regressions. Signed-off-by: Harshad Shirwadkar Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200427013438.219117-2-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o commit 4209ae12b12265d475bba28634184423149bd14f Author: Harshad Shirwadkar Date: Sun Apr 26 18:34:37 2020 -0700 ext4: handle ext4_mark_inode_dirty errors ext4_mark_inode_dirty() can fail for real reasons. Ignoring its return value may lead ext4 to ignore real failures that would result in corruption / crashes. Harden ext4_mark_inode_dirty error paths to fail as soon as possible and return errors to the caller whenever appropriate. One of the possible scnearios when this bug could affected is that while creating a new inode, its directory entry gets added successfully but while writing the inode itself mark_inode_dirty returns error which is ignored. This would result in inconsistency that the directory entry points to a non-existent inode. Ran gce-xfstests smoke tests and verified that there were no regressions. Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20200427013438.219117-1-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o commit 8418897f1bf87da0cb6936489d57a4320c32c0af Author: Jeffle Xu Date: Thu Apr 23 15:46:44 2020 +0800 ext4: fix error pointer dereference Don't pass error pointers to brelse(). commit 7159a986b420 ("ext4: fix some error pointer dereferences") has fixed some cases, fix the remaining one case. Once ext4_xattr_block_find()->ext4_sb_bread() failed, error pointer is stored in @bs->bh, which will be passed to brelse() in the cleanup routine of ext4_xattr_set_handle(). This will then cause a NULL panic crash in __brelse(). BUG: unable to handle kernel NULL pointer dereference at 000000000000005b RIP: 0010:__brelse+0x1b/0x50 Call Trace: ext4_xattr_set_handle+0x163/0x5d0 ext4_xattr_set+0x95/0x110 __vfs_setxattr+0x6b/0x80 __vfs_setxattr_noperm+0x68/0x1b0 vfs_setxattr+0xa0/0xb0 setxattr+0x12c/0x1a0 path_setxattr+0x8d/0xc0 __x64_sys_setxattr+0x27/0x30 do_syscall_64+0x60/0x250 entry_SYSCALL_64_after_hwframe+0x49/0xbe In this case, @bs->bh stores '-EIO' actually. Fixes: fb265c9cb49e ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases") Signed-off-by: Jeffle Xu Reviewed-by: Joseph Qi Cc: stable@kernel.org # 2.6.19 Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/1587628004-95123-1-git-send-email-jefflexu@linux.alibaba.com Signed-off-by: Theodore Ts'o commit ceff86fddae8748fe00d4f2d249cb02cae62ad84 Author: Jan Kara Date: Tue Apr 21 10:54:45 2020 +0200 ext4: Avoid freeing inodes on dirty list When we are evicting inode with journalled data, we may race with transaction commit in the following way: CPU0 CPU1 jbd2_journal_commit_transaction() evict(inode) inode_io_list_del() inode_wait_for_writeback() process BJ_Forget list __jbd2_journal_insert_checkpoint() __jbd2_journal_refile_buffer() __jbd2_journal_unfile_buffer() if (test_clear_buffer_jbddirty(bh)) mark_buffer_dirty(bh) __mark_inode_dirty(inode) ext4_evict_inode(inode) frees the inode This results in use-after-free issues in the writeback code (or the assertion added in the previous commit triggering). Fix the problem by removing inode from writeback lists once all the page cache is evicted and so inode cannot be added to writeback lists again. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20200421085445.5731-4-jack@suse.cz Signed-off-by: Theodore Ts'o commit 4301efa4c7cca11556dd89899eee066d49b47bf7 Author: Jan Kara Date: Tue Apr 21 10:54:44 2020 +0200 writeback: Export inode_io_list_del() Ext4 needs to remove inode from writeback lists after it is out of visibility of its journalling machinery (which can still dirty the inode). Export inode_io_list_del() for it. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20200421085445.5731-3-jack@suse.cz Signed-off-by: Theodore Ts'o commit 3bbd0ef26098d241dc59ee77ba14b7dab0df0786 Author: Xiyu Yang Date: Thu Apr 23 13:09:27 2020 +0800 ext4: fix buffer_head refcnt leak when ext4_iget() fails ext4_orphan_get() invokes ext4_read_inode_bitmap(), which returns a reference of the specified buffer_head object to "bitmap_bh" with increased refcnt. When ext4_orphan_get() returns, local variable "bitmap_bh" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of ext4_orphan_get(). When ext4_iget() fails, the function forgets to decrease the refcnt increased by ext4_read_inode_bitmap(), causing a refcnt leak. Fix this issue by calling brelse() when ext4_iget() fails. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Cc: stable@kernel.org Link: https://lore.kernel.org/r/1587618568-13418-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Theodore Ts'o commit c36a71b4e35ab35340facdd6964a00956b9fef0a Author: Harshad Shirwadkar Date: Mon Apr 20 19:39:59 2020 -0700 ext4: fix EXT_MAX_EXTENT/INDEX to check for zeroed eh_max If eh->eh_max is 0, EXT_MAX_EXTENT/INDEX would evaluate to unsigned (-1) resulting in illegal memory accesses. Although there is no consistent repro, we see that generic/019 sometimes crashes because of this bug. Ran gce-xfstests smoke and verified that there were no regressions. Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20200421023959.20879-2-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 39c0ae163f3b3ae691e7cce226ba1984ef6456b1 Author: Jason Yan Date: Mon Apr 20 12:29:18 2020 +0800 ext4: remove unnecessary comparisons to bool Fix the following coccicheck warning: fs/ext4/extents_status.c:1057:5-28: WARNING: Comparison to bool fs/ext4/inode.c:2314:18-24: WARNING: Comparison to bool Signed-off-by: Jason Yan Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20200420042918.19459-1-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 493e83aafa02316bc79ec90041c378d7902194fa Author: Eric Whitney Date: Wed Apr 15 16:31:40 2020 -0400 ext4: translate a few more map flags to strings in tracepoints As new ext4_map_blocks() flags have been added, not all have gotten flag bit to string translations to make tracepoint output more readable. Fix that, and go one step further by adding a translation for the EXT4_EX_NOCACHE flag as well. The EXT4_EX_FORCE_CACHE flag can never be set in a tracepoint in the current code, so there's no need to bother with a translation for it right now. Signed-off-by: Eric Whitney Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200415203140.30349-3-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit 9e52484c713321e84e8834803a44ca0a001376d2 Author: Eric Whitney Date: Wed Apr 15 16:31:39 2020 -0400 ext4: remove EXT4_GET_BLOCKS_KEEP_SIZE flag The eofblocks code was removed in the 5.7 release by "ext4: remove EOFBLOCKS_FL and associated code" (4337ecd1fe99). The ext4_map_blocks() flag used to trigger it can now be removed as well. Signed-off-by: Eric Whitney Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200415203140.30349-2-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit 6b6aeffc932d5469c0dbb114bee59f34e8e02e65 Author: Carlos Guerrero Álvarez Date: Thu Apr 16 16:14:56 2020 +0200 ext4: fix a style issue in fs/ext4/acl.c Fixed an if statement where braces were not needed. Link: https://lore.kernel.org/r/20200416141456.1089-1-carlosteniswarrior@gmail.com Signed-off-by: Carlos Guerrero Álvarez Signed-off-by: Theodore Ts'o Reviewed-by: Ritesh Harjani commit 09587a09ada2ed7c39aedfa2681152b5ac5641ee Author: Zong Li Date: Wed Jun 3 16:04:02 2020 -0700 arm64: mm: use ARCH_HAS_DEBUG_WX instead of arch defined Extract DEBUG_WX to mm/Kconfig.debug for shared use. Change to use ARCH_HAS_DEBUG_WX instead of DEBUG_WX defined by arch port. Signed-off-by: Zong Li Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: Catalin Marinas Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Thomas Gleixner Cc: Will Deacon Link: http://lkml.kernel.org/r/e19709e7576f65e303245fe520cad5f7bae72763.1587455584.git.zong.li@sifive.com Signed-off-by: Linus Torvalds commit 7e01ccb43d62558dc65c53477a78da133ad8c377 Author: Zong Li Date: Wed Jun 3 16:03:58 2020 -0700 x86: mm: use ARCH_HAS_DEBUG_WX instead of arch defined Extract DEBUG_WX to mm/Kconfig.debug for shared use. Change to use ARCH_HAS_DEBUG_WX instead of DEBUG_WX defined by arch port. Signed-off-by: Zong Li Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: Catalin Marinas Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Thomas Gleixner Cc: Will Deacon Link: http://lkml.kernel.org/r/430736828d149df3f5b462d291e845ec690e0141.1587455584.git.zong.li@sifive.com Signed-off-by: Linus Torvalds commit b422d28b21773bbfc9e84dbb5579a8ce355279ca Author: Zong Li Date: Wed Jun 3 16:03:55 2020 -0700 riscv: support DEBUG_WX Support DEBUG_WX to check whether there are mapping with write and execute permission at the same time. [akpm@linux-foundation.org: replace macros with C] Signed-off-by: Zong Li Signed-off-by: Andrew Morton Cc: Borislav Petkov Cc: Catalin Marinas Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Thomas Gleixner Cc: Will Deacon Link: http://lkml.kernel.org/r/282e266311bced080bc6f7c255b92f87c1eb65d6.1587455584.git.zong.li@sifive.com Signed-off-by: Linus Torvalds commit 375d315cbfdb50e1eda099d4d004f7f401285111 Author: Zong Li Date: Wed Jun 3 16:03:52 2020 -0700 mm: add DEBUG_WX support Patch series "Extract DEBUG_WX to shared use". Some architectures support DEBUG_WX function, it's verbatim from each others, so extract to mm/Kconfig.debug for shared use. PPC and ARM ports don't support generic page dumper yet, so we only refine x86 and arm64 port in this patch series. For RISC-V port, the DEBUG_WX support depends on other patches which be merged already: - RISC-V page table dumper - Support strict kernel memory permissions for security This patch (of 4): Some architectures support DEBUG_WX function, it's verbatim from each others. Extract to mm/Kconfig.debug for shared use. [akpm@linux-foundation.org: reword text, per Will Deacon & Zong Li] Link: http://lkml.kernel.org/r/20200427194245.oxRJKj3fn%25akpm@linux-foundation.org [zong.li@sifive.com: remove the specific name of arm64] Link: http://lkml.kernel.org/r/3a6a92ecedc54e1d0fc941398e63d504c2cd5611.1589178399.git.zong.li@sifive.com [zong.li@sifive.com: add MMU dependency for DEBUG_WX] Link: http://lkml.kernel.org/r/4a674ac7863ff39ca91847b10e51209771f99416.1589178399.git.zong.li@sifive.com Suggested-by: Palmer Dabbelt Signed-off-by: Zong Li Signed-off-by: Andrew Morton Cc: Paul Walmsley Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Catalin Marinas Cc: Will Deacon Link: http://lkml.kernel.org/r/cover.1587455584.git.zong.li@sifive.com Link: http://lkml.kernel.org/r/23980cd0f0e5d79e24a92169116407c75bcc650d.1587455584.git.zong.li@sifive.com Signed-off-by: Linus Torvalds commit 4fb6eabf1037cfbef90a26412492aeae5580cf0a Author: Scott Cheloha Date: Wed Jun 3 16:03:48 2020 -0700 drivers/base/memory.c: cache memory blocks in xarray to accelerate lookup Searching for a particular memory block by id is an O(n) operation because each memory block's underlying device is kept in an unsorted linked list on the subsystem bus. We can cut the lookup cost to O(log n) if we cache each memory block in an xarray. This time complexity improvement is significant on systems with many memory blocks. For example: 1. A 128GB POWER9 VM with 256MB memblocks has 512 blocks. With this change memory_dev_init() completes ~12ms faster and walk_memory_blocks() completes ~12ms faster. Before: [ 0.005042] memory_dev_init: adding memory blocks [ 0.021591] memory_dev_init: added memory blocks [ 0.022699] walk_memory_blocks: walking memory blocks [ 0.038730] walk_memory_blocks: walked memory blocks 0-511 After: [ 0.005057] memory_dev_init: adding memory blocks [ 0.009415] memory_dev_init: added memory blocks [ 0.010519] walk_memory_blocks: walking memory blocks [ 0.014135] walk_memory_blocks: walked memory blocks 0-511 2. A 256GB POWER9 LPAR with 256MB memblocks has 1024 blocks. With this change memory_dev_init() completes ~88ms faster and walk_memory_blocks() completes ~87ms faster. Before: [ 0.252246] memory_dev_init: adding memory blocks [ 0.395469] memory_dev_init: added memory blocks [ 0.409413] walk_memory_blocks: walking memory blocks [ 0.433028] walk_memory_blocks: walked memory blocks 0-511 [ 0.433094] walk_memory_blocks: walking memory blocks [ 0.500244] walk_memory_blocks: walked memory blocks 131072-131583 After: [ 0.245063] memory_dev_init: adding memory blocks [ 0.299539] memory_dev_init: added memory blocks [ 0.313609] walk_memory_blocks: walking memory blocks [ 0.315287] walk_memory_blocks: walked memory blocks 0-511 [ 0.315349] walk_memory_blocks: walking memory blocks [ 0.316988] walk_memory_blocks: walked memory blocks 131072-131583 3. A 32TB POWER9 LPAR with 256MB memblocks has 131072 blocks. With this change we complete memory_dev_init() ~37 minutes faster and walk_memory_blocks() at least ~30 minutes faster. The exact timing for walk_memory_blocks() is missing, though I observed that the soft lockups in walk_memory_blocks() disappeared with the change, suggesting that lower bound. Before: [ 13.703907] memory_dev_init: adding blocks [ 2287.406099] memory_dev_init: added all blocks [ 2347.494986] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 2527.625378] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 2707.761977] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 2887.899975] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 3068.028318] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 3248.158764] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 3428.287296] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 3608.425357] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 3788.554572] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 3968.695071] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 [ 4148.823970] [c000000014c5bb60] [c000000000869af4] walk_memory_blocks+0x94/0x160 After: [ 13.696898] memory_dev_init: adding blocks [ 15.660035] memory_dev_init: added all blocks (the walk_memory_blocks traces disappear) There should be no significant negative impact for machines with few memory blocks. A sparse xarray has a small footprint and an O(log n) lookup is negligibly slower than an O(n) lookup for only the smallest number of memory blocks. 1. A 16GB x86 machine with 128MB memblocks has 132 blocks. With this change memory_dev_init() completes ~300us faster and walk_memory_blocks() completes no faster or slower. The improvement is pretty close to noise. Before: [ 0.224752] memory_dev_init: adding memory blocks [ 0.227116] memory_dev_init: added memory blocks [ 0.227183] walk_memory_blocks: walking memory blocks [ 0.227183] walk_memory_blocks: walked memory blocks 0-131 After: [ 0.224911] memory_dev_init: adding memory blocks [ 0.226935] memory_dev_init: added memory blocks [ 0.227089] walk_memory_blocks: walking memory blocks [ 0.227089] walk_memory_blocks: walked memory blocks 0-131 [david@redhat.com: document the locking] Link: http://lkml.kernel.org/r/bc21eec6-7251-4c91-2f57-9a0671f8d414@redhat.com Signed-off-by: Scott Cheloha Signed-off-by: Andrew Morton Acked-by: David Hildenbrand Acked-by: Nathan Lynch Acked-by: Michal Hocko Cc: Rafael J. Wysocki Cc: Greg Kroah-Hartman Cc: Rick Lindsley Cc: Scott Cheloha Link: http://lkml.kernel.org/r/20200121231028.13699-1-cheloha@linux.ibm.com Signed-off-by: Linus Torvalds commit 86ec2da037b85436b63afe3df43ed48fa0e52b0e Author: Anshuman Khandual Date: Wed Jun 3 16:03:45 2020 -0700 mm/thp: rename pmd_mknotpresent() as pmd_mkinvalid() pmd_present() is expected to test positive after pmdp_mknotpresent() as the PMD entry still points to a valid huge page in memory. pmdp_mknotpresent() implies that given PMD entry is just invalidated from MMU perspective while still holding on to pmd_page() referred valid huge page thus also clearing pmd_present() test. This creates the following situation which is counter intuitive. [pmd_present(pmd_mknotpresent(pmd)) = true] This renames pmd_mknotpresent() as pmd_mkinvalid() reflecting the helper's functionality more accurately while changing the above mentioned situation as follows. This does not create any functional change. [pmd_present(pmd_mkinvalid(pmd)) = true] This is not applicable for platforms that define own pmdp_invalidate() via __HAVE_ARCH_PMDP_INVALIDATE. Suggestion for renaming came during a previous discussion here. https://patchwork.kernel.org/patch/11019637/ [anshuman.khandual@arm.com: change pmd_mknotvalid() to pmd_mkinvalid() per Will] Link: http://lkml.kernel.org/r/1587520326-10099-3-git-send-email-anshuman.khandual@arm.com Suggested-by: Catalin Marinas Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Acked-by: Will Deacon Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Steven Rostedt Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Paul Mackerras Link: http://lkml.kernel.org/r/1584680057-13753-3-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit 124cb3a62d54b271d7acfcf6596cb6a88766a344 Author: Anshuman Khandual Date: Wed Jun 3 16:03:41 2020 -0700 powerpc/mm: drop platform defined pmd_mknotpresent() Patch series "mm/thp: Rename pmd_mknotpresent() as pmd_mknotvalid()", v2. This series renames pmd_mknotpresent() as pmd_mknotvalid(). Before that it drops an existing pmd_mknotpresent() definition from powerpc platform which was never required as it defines it's pmdp_invalidate() through subscribing __HAVE_ARCH_PMDP_INVALIDATE. This does not create any functional change. This rename was suggested by Catalin during a previous discussion while we were trying to change the THP helpers on arm64 platform for migration. https://patchwork.kernel.org/patch/11019637/ This patch (of 2): Platform needs to define pmd_mknotpresent() for generic pmdp_invalidate() only when __HAVE_ARCH_PMDP_INVALIDATE is not subscribed. Otherwise platform specific pmd_mknotpresent() is not required. Hence just drop it. Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Paul Mackerras Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Steven Rostedt Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1587520326-10099-1-git-send-email-anshuman.khandual@arm.com Link: http://lkml.kernel.org/r/1584680057-13753-1-git-send-email-anshuman.khandual@arm.com Link: http://lkml.kernel.org/r/1584680057-13753-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit 67e4eb076840c7d199ebae0a8825c89a5b07d162 Author: Yang Shi Date: Wed Jun 3 16:03:37 2020 -0700 mm: thp: don't need to drain lru cache when splitting and mlocking THP Since commit 8f182270dfec ("mm/swap.c: flush lru pvecs on compound page arrival") THP would not stay in pagevec anymore. So the optimization made by commit d965432234db ("thp: increase split_huge_page() success rate") doesn't make sense anymore, which tries to unpin munlocked THPs from pagevec by draining pagevec. Draining lru cache before isolating THP in mlock path is also unnecessary. b676b293fb48 ("mm, thp: fix mapped pages avoiding unevictable list on mlock") added it and 9a73f61bdb8a ("thp, mlock: do not mlock PTE-mapped file huge pages") accidentally carried it over after the above optimization went in. Signed-off-by: Yang Shi Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Acked-by: Kirill A. Shutemov Cc: Hugh Dickins Cc: Andrea Arcangeli Link: http://lkml.kernel.org/r/1585946493-7531-1-git-send-email-yang.shi@linux.alibaba.com Signed-off-by: Linus Torvalds commit 885902531586d5a20a74099c1357bfdc982befe3 Author: Shijie Hu Date: Wed Jun 3 16:03:34 2020 -0700 hugetlbfs: get unmapped area below TASK_UNMAPPED_BASE for hugetlbfs In a 32-bit program, running on arm64 architecture. When the address space below mmap base is completely exhausted, shmat() for huge pages will return ENOMEM, but shmat() for normal pages can still success on no-legacy mode. This seems not fair. For normal pages, the calling trace of get_unmapped_area() is: => mm->get_unmapped_area() if on legacy mode, => arch_get_unmapped_area() => vm_unmapped_area() if on no-legacy mode, => arch_get_unmapped_area_topdown() => vm_unmapped_area() For huge pages, the calling trace of get_unmapped_area() is: => file->f_op->get_unmapped_area() => hugetlb_get_unmapped_area() => vm_unmapped_area() To solve this issue, we only need to make hugetlb_get_unmapped_area() take the same way as mm->get_unmapped_area(). Add *bottomup() and *topdown() for hugetlbfs, and check current mm->get_unmapped_area() to decide which one to use. If mm->get_unmapped_area is equal to arch_get_unmapped_area_topdown(), hugetlb_get_unmapped_area() calls topdown routine, otherwise calls bottomup routine. Reported-by: kbuild test robot Signed-off-by: Shijie Hu Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Cc: Will Deacon Cc: Xiaoming Ni Cc: Kefeng Wang Cc: yangerkun Cc: ChenGang Cc: Chen Jie Link: http://lkml.kernel.org/r/20200518065338.113664-1-hushijie3@huawei.com Signed-off-by: Linus Torvalds commit 4360dfa99ff58edad778bdd07819ee32bbf495b8 Author: Mike Rapoport Date: Wed Jun 3 16:03:31 2020 -0700 sparc32: register memory occupied by kernel as memblock.memory sparc32 never registered the memory occupied by the kernel image with memblock_add() and it only reserved this memory with meblock_reserve(). With openbios as system firmware, the memory occupied by the kernel is reserved in openbios and removed from mem.available. The prom setup code in the kernel uses mem.available to set up the memory banks and essentially there is a hole for the memory occupied by the kernel image. Later in bootmem_init() this memory is memblock_reserve()d. Up until recently, memmap initialization would call __init_single_page() for the pages in that hole, the free_low_memory_core_early() would mark them as reserved and everything would be Ok. After the change in memmap initialization introduced by the commit "mm: memmap_init: iterate over memblock regions rather that check each PFN", the hole is skipped and the page structs for it are not initialized. And when they are passed from memblock to page allocator as reserved, the latter gets confused. Simply registering the memory occupied by the kernel with memblock_add() resolves this issue. Tested on qemu-system-sparc with Debian Etch [1] userspace. [1] https://people.debian.org/~aurel32/qemu/sparc/debian_etch_sparc_small.qcow2 Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Acked-by: David S. Miller Cc: Guenter Roeck Link: https://lkml.kernel.org/r/20200517000050.GA87467@roeck-us.nlllllet/ Signed-off-by: Linus Torvalds commit 8cbd54f52997f43be3d09acd9fa9a10d202c5374 Author: chenqiwu Date: Wed Jun 3 16:03:28 2020 -0700 include/linux/memblock.h: fix minor typo and unclear comment Fix a minor typo "usabe->usable" for the current discription of member variable "memory" in struct memblock. BTW, I think it's unclear the member variable "base" in struct memblock_type is currently described as the physical address of memory region, change it to base address of the region is clearer since the variable is decorated as phys_addr_t. Signed-off-by: chenqiwu Signed-off-by: Andrew Morton Reviewed-by: Mike Rapoport Link: http://lkml.kernel.org/r/1588846952-32166-1-git-send-email-qiwuchen55@gmail.com Signed-off-by: Linus Torvalds commit 2d3a36a47964371101d9a71691c18d59ee611e87 Author: Michal Hocko Date: Wed Jun 3 16:03:25 2020 -0700 mm, mempolicy: fix up gup usage in lookup_node ba841078cd05 ("mm/mempolicy: Allow lookup_node() to handle fatal signal") has added a special casing for 0 return value because that was a possible gup return value when interrupted by fatal signal. This has been fixed by ae46d2aa6a7f ("mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal") in the mean time so ba841078cd05 can be reverted. This patch however doesn't go all the way to revert it because the check for 0 is wrong and confusing here. Firstly it is inherently unsafe to access the page when get_user_pages_locked returns 0 (aka no page returned). Fortunatelly this will not happen because get_user_pages_locked will not return 0 when nr_pages > 0 unless FOLL_NOWAIT is specified which is not the case here. Document this potential error code in gup code while we are at it. Signed-off-by: Michal Hocko Signed-off-by: Andrew Morton Cc: Peter Xu Link: http://lkml.kernel.org/r/20200421071026.18394-1-mhocko@kernel.org Signed-off-by: Linus Torvalds commit 5b94ce2fcae2542c4d5d49176fa23eea638dc7b6 Author: Changhee Han Date: Wed Jun 3 16:03:22 2020 -0700 tools/vm/page_owner_sort.c: filter out unneeded line To see a sorted result from page_owner, there must be a tiresome preprocessing step before running page_owner_sort. This patch simply filters out lines which start with "PFN" while reading the page owner report. Signed-off-by: Changhee Han Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Vlastimil Babka Cc: Joonsoo Kim Cc: Jonathan Corbet Link: http://lkml.kernel.org/r/20200429052940.16968-1-ch0.han@lge.com Signed-off-by: Linus Torvalds commit 21e330fc632d6a288f73de48045b782cc51d501a Author: Shakeel Butt Date: Wed Jun 3 16:03:19 2020 -0700 mm: swap: memcg: fix memcg stats for huge pages The commit 2262185c5b28 ("mm: per-cgroup memory reclaim stats") added PGLAZYFREE, PGACTIVATE & PGDEACTIVATE stats for cgroups but missed couple of places and PGLAZYFREE missed huge page handling. Fix that. Also for PGLAZYFREE use the irq-unsafe function to update as the irq is already disabled. Fixes: 2262185c5b28 ("mm: per-cgroup memory reclaim stats") Signed-off-by: Shakeel Butt Signed-off-by: Andrew Morton Acked-by: Johannes Weiner Link: http://lkml.kernel.org/r/20200527182947.251343-1-shakeelb@google.com Signed-off-by: Linus Torvalds commit 5d91f31faf8ebed2acfc3a1d6ac344f95c488d66 Author: Shakeel Butt Date: Wed Jun 3 16:03:16 2020 -0700 mm: swap: fix vmstats for huge pages Many of the callbacks called by pagevec_lru_move_fn() does not correctly update the vmstats for huge pages. Fix that. Also __pagevec_lru_add_fn() use the irq-unsafe alternative to update the stat as the irqs are already disabled. Signed-off-by: Shakeel Butt Signed-off-by: Andrew Morton Acked-by: Johannes Weiner Link: http://lkml.kernel.org/r/20200527182916.249910-1-shakeelb@google.com Signed-off-by: Linus Torvalds commit d483a5dd009a091d3dab3bc873335989e2cd5b08 Author: Johannes Weiner Date: Wed Jun 3 16:03:13 2020 -0700 mm: vmscan: limit the range of LRU type balancing When LRU cost only shows up on one list, we abruptly stop scanning that list altogether. That's an extreme reaction: by the time the other list starts thrashing and the pendulum swings back, we may have no recent age information on the first list anymore, and we could have significant latencies until the scanner has caught up. Soften this change in the feedback system by ensuring that no list receives less than a third of overall pressure, and only distribute the other 66% according to LRU cost. This ensures that we maintain a minimum rate of aging on the entire workingset while it's being pressured, while still allowing a generous rate of convergence when the relative sizes of the lists need to adjust. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-15-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 96f8bf4fb1dd2656ae3e92326be9ebf003bbfd45 Author: Johannes Weiner Date: Wed Jun 3 16:03:09 2020 -0700 mm: vmscan: reclaim writepage is IO cost The VM tries to balance reclaim pressure between anon and file so as to reduce the amount of IO incurred due to the memory shortage. It already counts refaults and swapins, but in addition it should also count writepage calls during reclaim. For swap, this is obvious: it's IO that wouldn't have occurred if the anonymous memory hadn't been under memory pressure. From a relative balancing point of view this makes sense as well: even if anon is cold and reclaimable, a cache that isn't thrashing may have equally cold pages that don't require IO to reclaim. For file writeback, it's trickier: some of the reclaim writepage IO would have likely occurred anyway due to dirty expiration. But not all of it - premature writeback reduces batching and generates additional writes. Since the flushers are already woken up by the time the VM starts writing cache pages one by one, let's assume that we'e likely causing writes that wouldn't have happened without memory pressure. In addition, the per-page cost of IO would have probably been much cheaper if written in larger batches from the flusher thread rather than the single-page-writes from kswapd. For our purposes - getting the trend right to accelerate convergence on a stable state that doesn't require paging at all - this is sufficiently accurate. If we later wanted to optimize for sustained thrashing, we can still refine the measurements. Count all writepage calls from kswapd as IO cost toward the LRU that the page belongs to. Why do this dynamically? Don't we know in advance that anon pages require IO to reclaim, and so could build in a static bias? First, scanning is not the same as reclaiming. If all the anon pages are referenced, we may not swap for a while just because we're scanning the anon list. During this time, however, it's important that we age anonymous memory and the page cache at the same rate so that their hot-cold gradients are comparable. Everything else being equal, we still want to reclaim the coldest memory overall. Second, we keep copies in swap unless the page changes. If there is swap-backed data that's mostly read (tmpfs file) and has been swapped out before, we can reclaim it without incurring additional IO. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-14-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 7cf111bc39f6792abedcdfbc4e6291a5603b0ef0 Author: Johannes Weiner Date: Wed Jun 3 16:03:06 2020 -0700 mm: vmscan: determine anon/file pressure balance at the reclaim root We split the LRU lists into anon and file, and we rebalance the scan pressure between them when one of them begins thrashing: if the file cache experiences workingset refaults, we increase the pressure on anonymous pages; if the workload is stalled on swapins, we increase the pressure on the file cache instead. With cgroups and their nested LRU lists, we currently don't do this correctly. While recursive cgroup reclaim establishes a relative LRU order among the pages of all involved cgroups, LRU pressure balancing is done on an individual cgroup LRU level. As a result, when one cgroup is thrashing on the filesystem cache while a sibling may have cold anonymous pages, pressure doesn't get equalized between them. This patch moves LRU balancing decision to the root of reclaim - the same level where the LRU order is established. It does this by tracking LRU cost recursively, so that every level of the cgroup tree knows the aggregate LRU cost of all memory within its domain. When the page scanner calculates the scan balance for any given individual cgroup's LRU list, it uses the values from the ancestor cgroup that initiated the reclaim cycle. If one sibling is then thrashing on the cache, it will tip the pressure balance inside its ancestors, and the next hierarchical reclaim iteration will go more after the anon pages in the tree. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-13-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 314b57fb0460001a090b35ff8be987f2c868ad3c Author: Johannes Weiner Date: Wed Jun 3 16:03:03 2020 -0700 mm: balance LRU lists based on relative thrashing Since the LRUs were split into anon and file lists, the VM has been balancing between page cache and anonymous pages based on per-list ratios of scanned vs. rotated pages. In most cases that tips page reclaim towards the list that is easier to reclaim and has the fewest actively used pages, but there are a few problems with it: 1. Refaults and LRU rotations are weighted the same way, even though one costs IO and the other costs a bit of CPU. 2. The less we scan an LRU list based on already observed rotations, the more we increase the sampling interval for new references, and rotations become even more likely on that list. This can enter a death spiral in which we stop looking at one list completely until the other one is all but annihilated by page reclaim. Since commit a528910e12ec ("mm: thrash detection-based file cache sizing") we have refault detection for the page cache. Along with swapin events, they are good indicators of when the file or anon list, respectively, is too small for its workingset and needs to grow. For example, if the page cache is thrashing, the cache pages need more time in memory, while there may be colder pages on the anonymous list. Likewise, if swapped pages are faulting back in, it indicates that we reclaim anonymous pages too aggressively and should back off. Replace LRU rotations with refaults and swapins as the basis for relative reclaim cost of the two LRUs. This will have the VM target list balances that incur the least amount of IO on aggregate. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-12-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 264e90cc07f177adec17ee7cc154ddaa132f0b2d Author: Johannes Weiner Date: Wed Jun 3 16:03:00 2020 -0700 mm: only count actual rotations as LRU reclaim cost When shrinking the active file list we rotate referenced pages only when they're in an executable mapping. The others get deactivated. When it comes to balancing scan pressure, though, we count all referenced pages as rotated, even the deactivated ones. Yet they do not carry the same cost to the system: the deactivated page *might* refault later on, but the deactivation is tangible progress toward freeing pages; rotations on the other hand cost time and effort without getting any closer to freeing memory. Don't treat both events as equal. The following patch will hook up LRU balancing to cache and anon refaults, which are a much more concrete cost signal for reclaiming one list over the other. Thus, remove the maybe-IO cost bias from page references, and only note the CPU cost for actual rotations that prevent the pages from getting reclaimed. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Acked-by: Minchan Kim Acked-by: Michal Hocko Cc: Joonsoo Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-11-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit fbbb602e40c270e884bc545161b238074b20aaae Author: Johannes Weiner Date: Wed Jun 3 16:02:57 2020 -0700 mm: deactivations shouldn't bias the LRU balance Operations like MADV_FREE, FADV_DONTNEED etc. currently move any affected active pages to the inactive list to accelerate their reclaim (good) but also steer page reclaim toward that LRU type, or away from the other (bad). The reason why this is undesirable is that such operations are not part of the regular page aging cycle, and rather a fluke that doesn't say much about the remaining pages on that list; they might all be in heavy use, and once the chunk of easy victims has been purged, the VM continues to apply elevated pressure on those remaining hot pages. The other LRU, meanwhile, might have easily reclaimable pages, and there was never a need to steer away from it in the first place. As the previous patch outlined, we should focus on recording actually observed cost to steer the balance rather than speculating about the potential value of one LRU list over the other. In that spirit, leave explicitely deactivated pages to the LRU algorithm to pick up, and let rotations decide which list is the easiest to reclaim. [cai@lca.pw: fix set-but-not-used warning] Link: http://lkml.kernel.org/r/20200522133335.GA624@Qians-MacBook-Air.local Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Acked-by: Minchan Kim Acked-by: Michal Hocko Cc: Joonsoo Kim Cc: Rik van Riel Cc: Qian Cai Link: http://lkml.kernel.org/r/20200520232525.798933-10-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 1431d4d11abb265e79cd44bed2f5ea93f1bcc57b Author: Johannes Weiner Date: Wed Jun 3 16:02:53 2020 -0700 mm: base LRU balancing on an explicit cost model Currently, scan pressure between the anon and file LRU lists is balanced based on a mixture of reclaim efficiency and a somewhat vague notion of "value" of having certain pages in memory over others. That concept of value is problematic, because it has caused us to count any event that remotely makes one LRU list more or less preferrable for reclaim, even when these events are not directly comparable and impose very different costs on the system. One example is referenced file pages that we still deactivate and referenced anonymous pages that we actually rotate back to the head of the list. There is also conceptual overlap with the LRU algorithm itself. By rotating recently used pages instead of reclaiming them, the algorithm already biases the applied scan pressure based on page value. Thus, when rebalancing scan pressure due to rotations, we should think of reclaim cost, and leave assessing the page value to the LRU algorithm. Lastly, considering both value-increasing as well as value-decreasing events can sometimes cause the same type of event to be counted twice, i.e. how rotating a page increases the LRU value, while reclaiming it succesfully decreases the value. In itself this will balance out fine, but it quietly skews the impact of events that are only recorded once. The abstract metric of "value", the murky relationship with the LRU algorithm, and accounting both negative and positive events make the current pressure balancing model hard to reason about and modify. This patch switches to a balancing model of accounting the concrete, actually observed cost of reclaiming one LRU over another. For now, that cost includes pages that are scanned but rotated back to the list head. Subsequent patches will add consideration for IO caused by refaulting of recently evicted pages. Replace struct zone_reclaim_stat with two cost counters in the lruvec, and make everything that affects cost go through a new lru_note_cost() function. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Acked-by: Michal Hocko Cc: Joonsoo Kim Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-9-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit a4fe1631f313f75c7dced10d9e7eda816bf0937f Author: Johannes Weiner Date: Wed Jun 3 16:02:50 2020 -0700 mm: vmscan: drop unnecessary div0 avoidance rounding in get_scan_count() When we calculate the relative scan pressure between the anon and file LRU lists, we have to assume that reclaim_stat can contain zeroes. To avoid div0 crashes, we add 1 to all denominators like so: anon_prio = swappiness; file_prio = 200 - anon_prio; [...] /* * The amount of pressure on anon vs file pages is inversely * proportional to the fraction of recently scanned pages on * each list that were recently referenced and in active use. */ ap = anon_prio * (reclaim_stat->recent_scanned[0] + 1); ap /= reclaim_stat->recent_rotated[0] + 1; fp = file_prio * (reclaim_stat->recent_scanned[1] + 1); fp /= reclaim_stat->recent_rotated[1] + 1; spin_unlock_irq(&pgdat->lru_lock); fraction[0] = ap; fraction[1] = fp; denominator = ap + fp + 1; While reclaim_stat can contain 0, it's not actually possible for ap + fp to be 0. One of anon_prio or file_prio could be zero, but they must still add up to 200. And the reclaim_stat fraction, due to the +1 in there, is always at least 1. So if one of the two numerators is 0, the other one can't be. ap + fp is always at least 1. Drop the + 1. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-8-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 9682468747390c14962114f261cd76ba188ed987 Author: Johannes Weiner Date: Wed Jun 3 16:02:46 2020 -0700 mm: remove use-once cache bias from LRU balancing When the splitlru patches divided page cache and swap-backed pages into separate LRU lists, the pressure balance between the lists was biased to account for the fact that streaming IO can cause memory pressure with a flood of pages that are used only once. New page cache additions would tip the balance toward the file LRU, and repeat access would neutralize that bias again. This ensured that page reclaim would always go for used-once cache first. Since e9868505987a ("mm,vmscan: only evict file pages when we have plenty"), page reclaim generally skips over swap-backed memory entirely as long as there is used-once cache present, and will apply the LRU balancing when only repeatedly accessed cache pages are left - at which point the previous use-once bias will have been neutralized. This makes the use-once cache balancing bias unnecessary. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Acked-by: Michal Hocko Acked-by: Minchan Kim Cc: Joonsoo Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-7-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 34e58cac6d8f2a76b609b3510ff0c4468a220e61 Author: Johannes Weiner Date: Wed Jun 3 16:02:43 2020 -0700 mm: workingset: let cache workingset challenge anon We activate cache refaults with reuse distances in pages smaller than the size of the total cache. This allows new pages with competitive access frequencies to establish themselves, as well as challenge and potentially displace pages on the active list that have gone cold. However, that assumes that active cache can only replace other active cache in a competition for the hottest memory. This is not a great default assumption. The page cache might be thrashing while there are enough completely cold and unused anonymous pages sitting around that we'd only have to write to swap once to stop all IO from the cache. Activate cache refaults when their reuse distance in pages is smaller than the total userspace workingset, including anonymous pages. Reclaim can still decide how to balance pressure among the two LRUs depending on the IO situation. Rotational drives will prefer avoiding random IO from swap and go harder after cache. But fundamentally, hot cache should be able to compete with anon pages for a place in RAM. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-6-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 6058eaec816f29fbe33c9d35694614c9a4ed75ba Author: Johannes Weiner Date: Wed Jun 3 16:02:40 2020 -0700 mm: fold and remove lru_cache_add_anon() and lru_cache_add_file() They're the same function, and for the purpose of all callers they are equivalent to lru_cache_add(). [akpm@linux-foundation.org: fix it for local_lock changes] Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Rik van Riel Acked-by: Michal Hocko Acked-by: Minchan Kim Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200520232525.798933-5-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit c843966c556d7370bb32e7319a6d164cb8c70ae2 Author: Johannes Weiner Date: Wed Jun 3 16:02:37 2020 -0700 mm: allow swappiness that prefers reclaiming anon over the file workingset With the advent of fast random IO devices (SSDs, PMEM) and in-memory swap devices such as zswap, it's possible for swap to be much faster than filesystems, and for swapping to be preferable over thrashing filesystem caches. Allow setting swappiness - which defines the rough relative IO cost of cache misses between page cache and swap-backed pages - to reflect such situations by making the swap-preferred range configurable. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-4-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 497a6c1b09902b22ceccc0f25ba4dd623e1ddb7d Author: Johannes Weiner Date: Wed Jun 3 16:02:34 2020 -0700 mm: keep separate anon and file statistics on page reclaim activity Having statistics on pages scanned and pages reclaimed for both anon and file pages makes it easier to evaluate changes to LRU balancing. While at it, clean up the stat-keeping mess for isolation, putback, reclaim stats etc. a bit: first the physical LRU operation (isolation and putback), followed by vmstats, reclaim_stats, and then vm events. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Minchan Kim Cc: Rik van Riel Link: http://lkml.kernel.org/r/20200520232525.798933-3-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 5df741963d52506a985b14c4bcd9a25beb9d1981 Author: Johannes Weiner Date: Wed Jun 3 16:02:31 2020 -0700 mm: fix LRU balancing effect of new transparent huge pages The reclaim code that balances between swapping and cache reclaim tries to predict likely reuse based on in-memory reference patterns alone. This works in many cases, but when it fails it cannot detect when the cache is thrashing pathologically, or when we're in the middle of a swap storm. The high seek cost of rotational drives under which the algorithm evolved also meant that mistakes could quickly result in lockups from too aggressive swapping (which is predominantly random IO). As a result, the balancing code has been tuned over time to a point where it mostly goes for page cache and defers swapping until the VM is under significant memory pressure. The resulting strategy doesn't make optimal caching decisions - where optimal is the least amount of IO required to execute the workload. The proliferation of fast random IO devices such as SSDs, in-memory compression such as zswap, and persistent memory technologies on the horizon, has made this undesirable behavior very noticable: Even in the presence of large amounts of cold anonymous memory and a capable swap device, the VM refuses to even seriously scan these pages, and can leave the page cache thrashing needlessly. This series sets out to address this. Since commit ("a528910e12ec mm: thrash detection-based file cache sizing") we have exact tracking of refault IO - the ultimate cost of reclaiming the wrong pages. This allows us to use an IO cost based balancing model that is more aggressive about scanning anonymous memory when the cache is thrashing, while being able to avoid unnecessary swap storms. These patches base the LRU balance on the rate of refaults on each list, times the relative IO cost between swap device and filesystem (swappiness), in order to optimize reclaim for least IO cost incurred. History I floated these changes in 2016. At the time they were incomplete and full of workarounds due to a lack of infrastructure in the reclaim code: We didn't have PageWorkingset, we didn't have hierarchical cgroup statistics, and problems with the cgroup swap controller. As swapping wasn't too high a priority then, the patches stalled out. With all dependencies in place now, here we are again with much cleaner, feature-complete patches. I kept the acks for patches that stayed materially the same :-) Below is a series of test results that demonstrate certain problematic behavior of the current code, as well as showcase the new code's more predictable and appropriate balancing decisions. Test #1: No convergence This test shows an edge case where the VM currently doesn't converge at all on a new file workingset with a stale anon/tmpfs set. The test sets up a cold anon set the size of 3/4 RAM, then tries to establish a new file set half the size of RAM (flat access pattern). The vanilla kernel refuses to even scan anon pages and never converges. The file set is perpetually served from the filesystem. The first test kernel is with the series up to the workingset patch applied. This allows thrashing page cache to challenge the anonymous workingset. The VM then scans the lists based on the current scanned/rotated balancing algorithm. It converges on a stable state where all cold anon pages are pushed out and the fileset is served entirely from cache: noconverge/5.7-rc5-mm noconverge/5.7-rc5-mm-workingset Scanned 417719308.00 ( +0.00%) 64091155.00 ( -84.66%) Reclaimed 417711094.00 ( +0.00%) 61640308.00 ( -85.24%) Reclaim efficiency % 100.00 ( +0.00%) 96.18 ( -3.78%) Scanned file 417719308.00 ( +0.00%) 59211118.00 ( -85.83%) Scanned anon 0.00 ( +0.00%) 4880037.00 ( ) Swapouts 0.00 ( +0.00%) 2439957.00 ( ) Swapins 0.00 ( +0.00%) 257.00 ( ) Refaults 415246605.00 ( +0.00%) 59183722.00 ( -85.75%) Restore refaults 0.00 ( +0.00%) 54988252.00 ( ) The second test kernel is with the full patch series applied, which replaces the scanned/rotated ratios with refault/swapin rate-based balancing. It evicts the cold anon pages more aggressively in the presence of a thrashing cache and the absence of swapins, and so converges with about 60% of the IO and reclaim activity: noconverge/5.7-rc5-mm-workingset noconverge/5.7-rc5-mm-lrubalance Scanned 64091155.00 ( +0.00%) 37579741.00 ( -41.37%) Reclaimed 61640308.00 ( +0.00%) 35129293.00 ( -43.01%) Reclaim efficiency % 96.18 ( +0.00%) 93.48 ( -2.78%) Scanned file 59211118.00 ( +0.00%) 32708385.00 ( -44.76%) Scanned anon 4880037.00 ( +0.00%) 4871356.00 ( -0.18%) Swapouts 2439957.00 ( +0.00%) 2435565.00 ( -0.18%) Swapins 257.00 ( +0.00%) 262.00 ( +1.94%) Refaults 59183722.00 ( +0.00%) 32675667.00 ( -44.79%) Restore refaults 54988252.00 ( +0.00%) 28480430.00 ( -48.21%) We're triggering this case in host sideloading scenarios: When a host's primary workload is not saturating the machine (primary load is usually driven by user activity), we can optimistically sideload a batch job; if user activity picks up and the primary workload needs the whole host during this time, we freeze the sideload and rely on it getting pushed to swap. Frequently that swapping doesn't happen and the completely inactive sideload simply stays resident while the expanding primary worklad is struggling to gain ground. Test #2: Kernel build This test is a a kernel build that is slightly memory-restricted (make -j4 inside a 400M cgroup). Despite the very aggressive swapping of cold anon pages in test #1, this test shows that the new kernel carefully balances swap against cache refaults when both the file and the cache set are pressured. It shows the patched kernel to be slightly better at finding the coldest memory from the combined anon and file set to evict under pressure. The result is lower aggregate reclaim and paging activity: z 5.7-rc5-mm 5.7-rc5-mm-lrubalance Real time 210.60 ( +0.00%) 210.97 ( +0.18%) User time 745.42 ( +0.00%) 746.48 ( +0.14%) System time 69.78 ( +0.00%) 69.79 ( +0.02%) Scanned file 354682.00 ( +0.00%) 293661.00 ( -17.20%) Scanned anon 465381.00 ( +0.00%) 378144.00 ( -18.75%) Swapouts 185920.00 ( +0.00%) 147801.00 ( -20.50%) Swapins 34583.00 ( +0.00%) 32491.00 ( -6.05%) Refaults 212664.00 ( +0.00%) 172409.00 ( -18.93%) Restore refaults 48861.00 ( +0.00%) 80091.00 ( +63.91%) Total paging IO 433167.00 ( +0.00%) 352701.00 ( -18.58%) Test #3: Overload This next test is not about performance, but rather about the predictability of the algorithm. The current balancing behavior doesn't always lead to comprehensible results, which makes performance analysis and parameter tuning (swappiness e.g.) very difficult. The test shows the balancing behavior under equivalent anon and file input. Anon and file sets are created of equal size (3/4 RAM), have the same access patterns (a hot-cold gradient), and synchronized access rates. Swappiness is raised from the default of 60 to 100 to indicate equal IO cost between swap and cache. With the vanilla balancing code, anon scans make up around 9% of the total pages scanned, or a ~1:10 ratio. This is a surprisingly skewed ratio, and it's an outcome that is hard to explain given the input parameters to the VM. The new balancing model targets a 1:2 balance: All else being equal, reclaiming a file page costs one page IO - the refault; reclaiming an anon page costs two IOs - the swapout and the swapin. In the test we observe a ~1:3 balance. The scanned and paging IO numbers indicate that the anon LRU algorithm we have in place right now does a slightly worse job at picking the coldest pages compared to the file algorithm. There is ongoing work to improve this, like Joonsoo's anon workingset patches; however, it's difficult to compare the two aging strategies when the balancing between them is behaving unintuitively. The slightly less efficient anon reclaim results in a deviation from the optimal 1:2 scan ratio we would like to see here - however, 1:3 is much closer to what we'd want to see in this test than the vanilla kernel's aging of 10+ cache pages for every anonymous one: overload-100/5.7-rc5-mm-workingset overload-100/5.7-rc5-mm-lrubalance-realfile Scanned 533633725.00 ( +0.00%) 595687785.00 ( +11.63%) Reclaimed 494325440.00 ( +0.00%) 518154380.00 ( +4.82%) Reclaim efficiency % 92.63 ( +0.00%) 86.98 ( -6.03%) Scanned file 484532894.00 ( +0.00%) 456937722.00 ( -5.70%) Scanned anon 49100831.00 ( +0.00%) 138750063.00 ( +182.58%) Swapouts 8096423.00 ( +0.00%) 48982142.00 ( +504.98%) Swapins 10027384.00 ( +0.00%) 62325044.00 ( +521.55%) Refaults 479819973.00 ( +0.00%) 451309483.00 ( -5.94%) Restore refaults 426422087.00 ( +0.00%) 399914067.00 ( -6.22%) Total paging IO 497943780.00 ( +0.00%) 562616669.00 ( +12.99%) Test #4: Parallel IO It's important to note that these patches only affect the situation where the kernel has to reclaim workingset memory, which is usually a transitionary period. The vast majority of page reclaim occuring in a system is from trimming the ever-expanding page cache. These patches don't affect cache trimming behavior. We never swap as long as we only have use-once cache moving through the file LRU, we only consider swapping when the cache is actively thrashing. The following test demonstrates this. It has an anon workingset that takes up half of RAM and then writes a file that is twice the size of RAM out to disk. As the cache is funneled through the inactive file list, no anon pages are scanned (aside from apparently some background noise of 10 pages): 5.7-rc5-mm 5.7-rc5-mm-lrubalance Scanned 10714722.00 ( +0.00%) 10723445.00 ( +0.08%) Reclaimed 10703596.00 ( +0.00%) 10712166.00 ( +0.08%) Reclaim efficiency % 99.90 ( +0.00%) 99.89 ( -0.00%) Scanned file 10714722.00 ( +0.00%) 10723435.00 ( +0.08%) Scanned anon 0.00 ( +0.00%) 10.00 ( ) Swapouts 0.00 ( +0.00%) 7.00 ( ) Swapins 0.00 ( +0.00%) 0.00 ( +0.00%) Refaults 92.00 ( +0.00%) 41.00 ( -54.84%) Restore refaults 0.00 ( +0.00%) 0.00 ( +0.00%) Total paging IO 92.00 ( +0.00%) 48.00 ( -47.31%) This patch (of 14): Currently, THP are counted as single pages until they are split right before being swapped out. However, at that point the VM is already in the middle of reclaim, and adjusting the LRU balance then is useless. Always account THP by the number of basepages, and remove the fixup from the splitting path. Signed-off-by: Johannes Weiner Signed-off-by: Shakeel Butt Signed-off-by: Andrew Morton Reviewed-by: Rik van Riel Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Acked-by: Minchan Kim Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200520232525.798933-1-hannes@cmpxchg.org Link: http://lkml.kernel.org/r/20200520232525.798933-2-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit a0b5b4147fb34639ae7d0c25a823297834344061 Author: Johannes Weiner Date: Wed Jun 3 16:02:27 2020 -0700 mm: memcontrol: update page->mem_cgroup stability rules The previous patches have simplified the access rules around page->mem_cgroup somewhat: 1. We never change page->mem_cgroup while the page is isolated by somebody else. This was by far the biggest exception to our rules and it didn't stop at lock_page() or lock_page_memcg(). 2. We charge pages before they get put into page tables now, so the somewhat fishy rule about "can be in page table as long as it's still locked" is now gone and boiled down to having an exclusive reference to the page. Document the new rules. Any of the following will stabilize the page->mem_cgroup association: - the page lock - LRU isolation - lock_page_memcg() - exclusive access to the page Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Reviewed-by: Joonsoo Kim Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-20-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit d9eb1ea2bf8734afd8ec7d995270437a7242f82b Author: Johannes Weiner Date: Wed Jun 3 16:02:24 2020 -0700 mm: memcontrol: delete unused lrucare handling Swapin faults were the last event to charge pages after they had already been put on the LRU list. Now that we charge directly on swapin, the lrucare portion of the charge code is unused. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Balbir Singh Cc: Shakeel Butt Link: http://lkml.kernel.org/r/20200508183105.225460-19-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 0a27cae1389f6342e7b09179d2b2da9011d60c96 Author: Alex Shi Date: Wed Jun 3 16:02:21 2020 -0700 mm: memcontrol: document the new swap control behavior Signed-off-by: Alex Shi Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Hugh Dickins Cc: Joonsoo Kim Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-18-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 4c6355b25e8bb83c3cb455f532b7542089699d98 Author: Johannes Weiner Date: Wed Jun 3 16:02:17 2020 -0700 mm: memcontrol: charge swapin pages on instantiation Right now, users that are otherwise memory controlled can easily escape their containment and allocate significant amounts of memory that they're not being charged for. That's because swap readahead pages are not being charged until somebody actually faults them into their page table. This can be exploited with MADV_WILLNEED, which triggers arbitrary readahead allocations without charging the pages. There are additional problems with the delayed charging of swap pages: 1. To implement refault/workingset detection for anonymous pages, we need to have a target LRU available at swapin time, but the LRU is not determinable until the page has been charged. 2. To implement per-cgroup LRU locking, we need page->mem_cgroup to be stable when the page is isolated from the LRU; otherwise, the locks change under us. But swapcache gets charged after it's already on the LRU, and even if we cannot isolate it ourselves (since charging is not exactly optional). The previous patch ensured we always maintain cgroup ownership records for swap pages. This patch moves the swapcache charging point from the fault handler to swapin time to fix all of the above problems. v2: simplify swapin error checking (Joonsoo) [hughd@google.com: fix livelock in __read_swap_cache_async()] Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2005212246080.8458@eggly.anvils Signed-off-by: Johannes Weiner Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Cc: Hugh Dickins Cc: Joonsoo Kim Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Cc: Rafael Aquini Cc: Alex Shi Link: http://lkml.kernel.org/r/20200508183105.225460-17-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 2d1c498072de69e2857b849ee197ba2aa7de53a3 Author: Johannes Weiner Date: Wed Jun 3 16:02:14 2020 -0700 mm: memcontrol: make swap tracking an integral part of memory control Without swap page tracking, users that are otherwise memory controlled can easily escape their containment and allocate significant amounts of memory that they're not being charged for. That's because swap does readahead, but without the cgroup records of who owned the page at swapout, readahead pages don't get charged until somebody actually faults them into their page table and we can identify an owner task. This can be maliciously exploited with MADV_WILLNEED, which triggers arbitrary readahead allocations without charging the pages. Make swap swap page tracking an integral part of memcg and remove the Kconfig options. In the first place, it was only made configurable to allow users to save some memory. But the overhead of tracking cgroup ownership per swap page is minimal - 2 byte per page, or 512k per 1G of swap, or 0.04%. Saving that at the expense of broken containment semantics is not something we should present as a coequal option. The swapaccount=0 boot option will continue to exist, and it will eliminate the page_counter overhead and hide the swap control files, but it won't disable swap slot ownership tracking. This patch makes sure we always have the cgroup records at swapin time; the next patch will fix the actual bug by charging readahead swap pages at swapin time rather than at fault time. v2: fix double swap charge bug in cgroup1/cgroup2 code gating [hannes@cmpxchg.org: fix crash with cgroup_disable=memory] Link: http://lkml.kernel.org/r/20200521215855.GB815153@cmpxchg.org Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: "Kirill A. Shutemov" Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Cc: Naresh Kamboju Link: http://lkml.kernel.org/r/20200508183105.225460-16-hannes@cmpxchg.org Debugged-by: Hugh Dickins Debugged-by: Michal Hocko Signed-off-by: Linus Torvalds commit eccb52e7880973f221ab2606e4d22ce04d96a1a9 Author: Johannes Weiner Date: Wed Jun 3 16:02:11 2020 -0700 mm: memcontrol: prepare swap controller setup for integration A few cleanups to streamline the swap controller setup: - Replace the do_swap_account flag with cgroup_memory_noswap. This brings it in line with other functionality that is usually available unless explicitly opted out of - nosocket, nokmem. - Remove the really_do_swap_account flag that stores the boot option and is later used to switch the do_swap_account. It's not clear why this indirection is/was necessary. Use do_swap_account directly. - Minor coding style polishing Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-15-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit f0e45fb4da29746a116e810eb91423ccfa4830fc Author: Johannes Weiner Date: Wed Jun 3 16:02:07 2020 -0700 mm: memcontrol: drop unused try/commit/cancel charge API There are no more users. RIP in peace. [arnd@arndb.de: fix an unused-function warning] Link: http://lkml.kernel.org/r/20200528095640.151454-1-arnd@arndb.de Signed-off-by: Johannes Weiner Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-14-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 9d82c69438d0dff8809061edbcce43a5a4bcf09f Author: Johannes Weiner Date: Wed Jun 3 16:02:04 2020 -0700 mm: memcontrol: convert anon and file-thp to new mem_cgroup_charge() API With the page->mapping requirement gone from memcg, we can charge anon and file-thp pages in one single step, right after they're allocated. This removes two out of three API calls - especially the tricky commit step that needed to happen at just the right time between when the page is "set up" and when it's "published" - somewhat vague and fluid concepts that varied by page type. All we need is a freshly allocated page and a memcg context to charge. v2: prevent double charges on pre-allocated hugepages in khugepaged [hannes@cmpxchg.org: Fix crash - *hpage could be ERR_PTR instead of NULL] Link: http://lkml.kernel.org/r/20200512215813.GA487759@cmpxchg.org Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Cc: Qian Cai Link: http://lkml.kernel.org/r/20200508183105.225460-13-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 468c398233da208521a0f84c2068012a66a7489d Author: Johannes Weiner Date: Wed Jun 3 16:02:01 2020 -0700 mm: memcontrol: switch to native NR_ANON_THPS counter With rmap memcg locking already in place for NR_ANON_MAPPED, it's just a small step to remove the MEMCG_RSS_HUGE wart and switch memcg to the native NR_ANON_THPS accounting sites. [hannes@cmpxchg.org: fixes] Link: http://lkml.kernel.org/r/20200512121750.GA397968@cmpxchg.org Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Tested-by: Naresh Kamboju Reviewed-by: Joonsoo Kim Acked-by: Randy Dunlap [build-tested] Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-12-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit be5d0a74c62d8da43f9526a5b08cdd18e2bbc37a Author: Johannes Weiner Date: Wed Jun 3 16:01:57 2020 -0700 mm: memcontrol: switch to native NR_ANON_MAPPED counter Memcg maintains a private MEMCG_RSS counter. This divergence from the generic VM accounting means unnecessary code overhead, and creates a dependency for memcg that page->mapping is set up at the time of charging, so that page types can be told apart. Convert the generic accounting sites to mod_lruvec_page_state and friends to maintain the per-cgroup vmstat counter of NR_ANON_MAPPED. We use lock_page_memcg() to stabilize page->mem_cgroup during rmap changes, the same way we do for NR_FILE_MAPPED. With the previous patch removing MEMCG_CACHE and the private NR_SHMEM counter, this patch finally eliminates the need to have page->mapping set up at charge time. However, we need to have page->mem_cgroup set up by the time rmap runs and does the accounting, so switch the commit and the rmap callbacks around. v2: fix temporary accounting bug by switching rmap<->commit (Joonsoo) Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Cc: Alex Shi Cc: Hugh Dickins Cc: Joonsoo Kim Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-11-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 0d1c20722ab333ac0ac03ae2188922c1021d3abc Author: Johannes Weiner Date: Wed Jun 3 16:01:54 2020 -0700 mm: memcontrol: switch to native NR_FILE_PAGES and NR_SHMEM counters Memcg maintains private MEMCG_CACHE and NR_SHMEM counters. This divergence from the generic VM accounting means unnecessary code overhead, and creates a dependency for memcg that page->mapping is set up at the time of charging, so that page types can be told apart. Convert the generic accounting sites to mod_lruvec_page_state and friends to maintain the per-cgroup vmstat counters of NR_FILE_PAGES and NR_SHMEM. The page is already locked in these places, so page->mem_cgroup is stable; we only need minimal tweaks of two mem_cgroup_migrate() calls to ensure it's set up in time. Then replace MEMCG_CACHE with NR_FILE_PAGES and delete the private NR_SHMEM accounting sites. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-10-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 9da7b5216869f80e91f78403a57c72b42357758c Author: Johannes Weiner Date: Wed Jun 3 16:01:51 2020 -0700 mm: memcontrol: prepare cgroup vmstat infrastructure for native anon counters Anonymous compound pages can be mapped by ptes, which means that if we want to track NR_MAPPED_ANON, NR_ANON_THPS on a per-cgroup basis, we have to be prepared to see tail pages in our accounting functions. Make mod_lruvec_page_state() and lock_page_memcg() deal with tail pages correctly, namely by redirecting to the head page which has the page->mem_cgroup set up. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-9-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 49e50d277ba2bb2c6e64632bc3193585674a2261 Author: Johannes Weiner Date: Wed Jun 3 16:01:47 2020 -0700 mm: memcontrol: prepare move_account for removal of private page type counters When memcg uses the generic vmstat counters, it doesn't need to do anything at charging and uncharging time. It does, however, need to migrate counts when pages move to a different cgroup in move_account. Prepare the move_account function for the arrival of NR_FILE_PAGES, NR_ANON_MAPPED, NR_ANON_THPS etc. by having a branch for files and a branch for anon, which can then divided into sub-branches. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Reviewed-by: Joonsoo Kim Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-8-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 9f762dbe19b9f16d5df5603d4b93bad391c302bc Author: Johannes Weiner Date: Wed Jun 3 16:01:44 2020 -0700 mm: memcontrol: prepare uncharging for removal of private page type counters The uncharge batching code adds up the anon, file, kmem counts to determine the total number of pages to uncharge and references to drop. But the next patches will remove the anon and file counters. Maintain an aggregate nr_pages in the uncharge_gather struct. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Reviewed-by: Joonsoo Kim Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-7-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 3fea5a499d57dec46043fcdb08e38eac1767bb0d Author: Johannes Weiner Date: Wed Jun 3 16:01:41 2020 -0700 mm: memcontrol: convert page cache to a new mem_cgroup_charge() API The try/commit/cancel protocol that memcg uses dates back to when pages used to be uncharged upon removal from the page cache, and thus couldn't be committed before the insertion had succeeded. Nowadays, pages are uncharged when they are physically freed; it doesn't matter whether the insertion was successful or not. For the page cache, the transaction dance has become unnecessary. Introduce a mem_cgroup_charge() function that simply charges a newly allocated page to a cgroup and sets up page->mem_cgroup in one single step. If the insertion fails, the caller doesn't have to do anything but free/put the page. Then switch the page cache over to this new API. Subsequent patches will also convert anon pages, but it needs a bit more prep work. Right now, memcg depends on page->mapping being already set up at the time of charging, so that it can maintain its own MEMCG_CACHE and MEMCG_RSS counters. For anon, page->mapping is set under the same pte lock under which the page is publishd, so a single charge point that can block doesn't work there just yet. The following prep patches will replace the private memcg counters with the generic vmstat counters, thus removing the page->mapping dependency, then complete the transition to the new single-point charge API and delete the old transactional scheme. v2: leave shmem swapcache when charging fails to avoid double IO (Joonsoo) v3: rebase on preceeding shmem simplification patch Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Cc: Hugh Dickins Cc: Joonsoo Kim Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-6-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 6caa6a0703e03236f46461342e31ca53d0e3c091 Author: Johannes Weiner Date: Wed Jun 3 16:01:38 2020 -0700 mm: memcontrol: move out cgroup swaprate throttling The cgroup swaprate throttling is about matching new anon allocations to the rate of available IO when that is being throttled. It's the io controller hooking into the VM, rather than a memory controller thing. Rename mem_cgroup_throttle_swaprate() to cgroup_throttle_swaprate(), and drop the @memcg argument which is only used to check whether the preceding page charge has succeeded and the fault is proceeding. We could decouple the call from mem_cgroup_try_charge() here as well, but that would cause unnecessary churn: the following patches convert all callsites to a new charge API and we'll decouple as we go along. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Reviewed-by: Joonsoo Kim Reviewed-by: Shakeel Butt Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-5-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit 14235ab36019d169f5eb5bf0c064c5b12ca1bf46 Author: Johannes Weiner Date: Wed Jun 3 16:01:34 2020 -0700 mm: shmem: remove rare optimization when swapin races with hole punching Commit 215c02bc33bb ("tmpfs: fix shmem_getpage_gfp() VM_BUG_ON") recognized that hole punching can race with swapin and removed the BUG_ON() for a truncated entry from the swapin path. The patch also added a swapcache deletion to optimize this rare case: Since swapin has the page locked, and free_swap_and_cache() merely trylocks, this situation can leave the page stranded in swapcache. Usually, page reclaim picks up stale swapcache pages, and the race can happen at any other time when the page is locked. (The same happens for non-shmem swapin racing with page table zapping.) The thinking here was: we already observed the race and we have the page locked, we may as well do the cleanup instead of waiting for reclaim. However, this optimization complicates the next patch which moves the cgroup charging code around. As this is just a minor speedup for a race condition that is so rare that it required a fuzzer to trigger the original BUG_ON(), it's no longer worth the complications. Suggested-by: Hugh Dickins Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Acked-by: Hugh Dickins Cc: Alex Shi Cc: Joonsoo Kim Cc: Shakeel Butt Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200511181056.GA339505@cmpxchg.org Signed-off-by: Linus Torvalds commit 3fba69a56e16e8dcf182fe6ca77735dd65a898aa Author: Johannes Weiner Date: Wed Jun 3 16:01:31 2020 -0700 mm: memcontrol: drop @compound parameter from memcg charging API The memcg charging API carries a boolean @compound parameter that tells whether the page we're dealing with is a hugepage. mem_cgroup_commit_charge() has another boolean @lrucare that indicates whether the page needs LRU locking or not while charging. The majority of callsites know those parameters at compile time, which results in a lot of naked "false, false" argument lists. This makes for cryptic code and is a breeding ground for subtle mistakes. Thankfully, the huge page state can be inferred from the page itself and doesn't need to be passed along. This is safe because charging completes before the page is published and somebody may split it. Simplify the callsites by removing @compound, and let memcg infer the state by using hpage_nr_pages() unconditionally. That function does PageTransHuge() to identify huge pages, which also helpfully asserts that nobody passes in tail pages by accident. The following patches will introduce a new charging API, best not to carry over unnecessary weight. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Reviewed-by: Joonsoo Kim Reviewed-by: Shakeel Butt Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-4-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit abb242f57196dbaa108271575353a0453f6834ef Author: Johannes Weiner Date: Wed Jun 3 16:01:28 2020 -0700 mm: memcontrol: fix stat-corrupting race in charge moving The move_lock is a per-memcg lock, but the VM accounting code that needs to acquire it comes from the page and follows page->mem_cgroup under RCU protection. That means that the page becomes unlocked not when we drop the move_lock, but when we update page->mem_cgroup. And that assignment doesn't imply any memory ordering. If that pointer write gets reordered against the reads of the page state - page_mapped, PageDirty etc. the state may change while we rely on it being stable and we can end up corrupting the counters. Place an SMP memory barrier to make sure we're done with all page state by the time the new page->mem_cgroup becomes visible. Also replace the open-coded move_lock with a lock_page_memcg() to make it more obvious what we're serializing against. Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Joonsoo Kim Reviewed-by: Shakeel Butt Cc: Alex Shi Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Roman Gushchin Cc: Balbir Singh Link: http://lkml.kernel.org/r/20200508183105.225460-3-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit f4129ea3591ab111e5dacd7ce5085a75a086fd9c Author: Johannes Weiner Date: Wed Jun 3 16:01:24 2020 -0700 mm: fix NUMA node file count error in replace_page_cache() Patch series "mm: memcontrol: charge swapin pages on instantiation", v2. This patch series reworks memcg to charge swapin pages directly at swapin time, rather than at fault time, which may be much later, or not happen at all. Changes in version 2: - prevent double charges on pre-allocated hugepages in khugepaged - leave shmem swapcache when charging fails to avoid double IO (Joonsoo) - fix temporary accounting bug by switching rmap<->commit (Joonsoo) - fix double swap charge bug in cgroup1/cgroup2 code gating - simplify swapin error checking (Joonsoo) - mm: memcontrol: document the new swap control behavior (Alex) - review tags The delayed swapin charging scheme we have right now causes problems: - Alex's per-cgroup lru_lock patches rely on pages that have been isolated from the LRU to have a stable page->mem_cgroup; otherwise the lock may change underneath him. Swapcache pages are charged only after they are added to the LRU, and charging doesn't follow the LRU isolation protocol. - Joonsoo's anon workingset patches need a suitable LRU at the time the page enters the swap cache and displaces the non-resident info. But the correct LRU is only available after charging. - It's a containment hole / DoS vector. Users can trigger arbitrarily large swap readahead using MADV_WILLNEED. The memory is never charged unless somebody actually touches it. - It complicates the page->mem_cgroup stabilization rules In order to charge pages directly at swapin time, the memcg code base needs to be prepared, and several overdue cleanups become a necessity: To charge pages at swapin time, we need to always have cgroup ownership tracking of swap records. We also cannot rely on page->mapping to tell apart page types at charge time, because that's only set up during a page fault. To eliminate the page->mapping dependency, memcg needs to ditch its private page type counters (MEMCG_CACHE, MEMCG_RSS, NR_SHMEM) in favor of the generic vmstat counters and accounting sites, such as NR_FILE_PAGES, NR_ANON_MAPPED etc. To switch to generic vmstat counters, the charge sequence must be adjusted such that page->mem_cgroup is set up by the time these counters are modified. The series is structured as follows: 1. Bug fixes 2. Decoupling charging from rmap 3. Swap controller integration into memcg 4. Direct swapin charging This patch (of 19): When replacing one page with another one in the cache, we have to decrease the file count of the old page's NUMA node and increase the one of the new NUMA node, otherwise the old node leaks the count and the new node eventually underflows its counter. Fixes: 74d609585d8b ("page cache: Add and replace pages using the XArray") Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Alex Shi Reviewed-by: Shakeel Butt Reviewed-by: Joonsoo Kim Reviewed-by: Balbir Singh Cc: Hugh Dickins Cc: Michal Hocko Cc: "Kirill A. Shutemov" Cc: Roman Gushchin Link: http://lkml.kernel.org/r/20200508183105.225460-1-hannes@cmpxchg.org Link: http://lkml.kernel.org/r/20200508183105.225460-2-hannes@cmpxchg.org Signed-off-by: Linus Torvalds commit df3a45f9d8ee41abd69f2a567ac3eeb2fd34a210 Author: Qiwu Chen Date: Wed Jun 3 16:01:21 2020 -0700 mm/vmscan: update the comment of should_continue_reclaim() try_to_compact_zone() has been replaced by try_to_compact_pages(), which is necessary to be updated in the comment of should_continue_reclaim(). Signed-off-by: Qiwu Chen Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200501034907.22991-1-chenqiwu@xiaomi.com Signed-off-by: Linus Torvalds commit 730ec8c01a2bd6a311ada404398f44c142ac5e8e Author: Maninder Singh Date: Wed Jun 3 16:01:18 2020 -0700 mm/vmscan.c: change prototype for shrink_page_list commit 3c710c1ad11b ("mm, vmscan extract shrink_page_list reclaim counters into a struct") changed data type for the function, so changing return type for funciton and its caller. Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh Signed-off-by: Andrew Morton Acked-by: Michal Hocko Cc: Amit Sahrawat Cc: Mel Gorman Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/1588168259-25604-1-git-send-email-maninder1.s@samsung.com Signed-off-by: Linus Torvalds commit 1f318a9b0dc3990490e98eef48f21e6f15185781 Author: Jaewon Kim Date: Wed Jun 3 16:01:15 2020 -0700 mm/vmscan: count layzfree pages and fix nr_isolated_* mismatch Fix an nr_isolate_* mismatch problem between cma and dirty lazyfree pages. If try_to_unmap_one is used for reclaim and it detects a dirty lazyfree page, then the lazyfree page is changed to a normal anon page having SwapBacked by commit 802a3a92ad7a ("mm: reclaim MADV_FREE pages"). Even with the change, reclaim context correctly counts isolated files because it uses is_file_lru to distinguish file. And the change to anon is not happened if try_to_unmap_one is used for migration. So migration context like compaction also correctly counts isolated files even though it uses page_is_file_lru insted of is_file_lru. Recently page_is_file_cache was renamed to page_is_file_lru by commit 9de4f22a60f7 ("mm: code cleanup for MADV_FREE"). But the nr_isolate_* mismatch problem happens on cma alloc. There is reclaim_clean_pages_from_list which is being used only by cma. It was introduced by commit 02c6de8d757c ("mm: cma: discard clean pages during contiguous allocation instead of migration") to reclaim clean file pages without migration. The cma alloc uses both reclaim_clean_pages_from_list and migrate_pages, and it uses page_is_file_lru to count isolated files. If there are dirty lazyfree pages allocated from cma memory region, the pages are counted as isolated file at the beginging but are counted as isolated anon after finished. Mem-Info: Node 0 active_anon:3045904kB inactive_anon:611448kB active_file:14892kB inactive_file:205636kB unevictable:10416kB isolated(anon):0kB isolated(file):37664kB mapped:630216kB dirty:384kB writeback:0kB shmem:42576kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Like log above, there were too much isolated files, 37664kB, which triggers too_many_isolated in reclaim even when there is no actually isolated file in system wide. It could be reproducible by running two programs, writing on MADV_FREE page and doing cma alloc, respectively. Although isolated anon is 0, I found that the internal value of isolated anon was the negative value of isolated file. Fix this by compensating the isolated count for both LRU lists. Count non-discarded lazyfree pages in shrink_page_list, then compensate the counted number in reclaim_clean_pages_from_list. Reported-by: Yong-Taek Lee Suggested-by: Minchan Kim Signed-off-by: Jaewon Kim Signed-off-by: Andrew Morton Acked-by: Minchan Kim Cc: Mel Gorman Cc: Johannes Weiner Cc: Marek Szyprowski Cc: Michal Nazarewicz Cc: Shaohua Li Link: http://lkml.kernel.org/r/20200426011718.30246-1-jaewon31.kim@samsung.com Signed-off-by: Linus Torvalds commit a892cb6b977ffe209683809e5e9d627656d20aa8 Author: Wei Yang Date: Wed Jun 3 16:01:12 2020 -0700 mm/vmscan.c: use update_lru_size() in update_lru_sizes() We already defined the helper update_lru_size(). Let's use this to reduce code duplication. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Baoquan He Reviewed-by: Andrew Morton Acked-by: Michal Hocko Link: http://lkml.kernel.org/r/20200331221550.1011-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit ff45fc3ca0f3c38e752d75f71b8d8efcf409e42d Author: Matthew Wilcox (Oracle) Date: Wed Jun 3 16:01:09 2020 -0700 mm: simplify calling a compound page destructor None of the three callers of get_compound_page_dtor() want to know the value; they just want to call the function. Replace it with destroy_compound_page() which calls the dtor for them. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Anshuman Khandual Reviewed-by: David Hildenbrand Acked-by: Kirill A. Shutemov Link: http://lkml.kernel.org/r/20200517105051.9352-1-willy@infradead.org Signed-off-by: Linus Torvalds commit 5be993432821750f382809df5e20bf4c129b24f7 Author: Anshuman Khandual Date: Wed Jun 3 16:01:05 2020 -0700 mm/hugetlb: define a generic fallback for arch_clear_hugepage_flags() There are multiple similar definitions for arch_clear_hugepage_flags() on various platforms. Lets just add it's generic fallback definition for platforms that do not override. This help reduce code duplication. Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Acked-by: Mike Kravetz Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Tony Luck Cc: Fenghua Yu Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Link: http://lkml.kernel.org/r/1588907271-11920-4-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit b0eae98c66fe4ccac3a5a79a1479c057f2c7cdd7 Author: Anshuman Khandual Date: Wed Jun 3 16:01:01 2020 -0700 mm/hugetlb: define a generic fallback for is_hugepage_only_range() There are multiple similar definitions for is_hugepage_only_range() on various platforms. Lets just add it's generic fallback definition for platforms that do not override. This help reduce code duplication. Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Acked-by: Mike Kravetz Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Tony Luck Cc: Fenghua Yu Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Link: http://lkml.kernel.org/r/1588907271-11920-3-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit be51e3fde5c10f269c065fdca2caf28e4708e21e Author: Anshuman Khandual Date: Wed Jun 3 16:00:56 2020 -0700 arm64/mm: drop __HAVE_ARCH_HUGE_PTEP_GET Patch series "mm/hugetlb: Add some new generic fallbacks", v3. This series adds the following new generic fallbacks. Before that it drops __HAVE_ARCH_HUGE_PTEP_GET from arm64 platform. 1. is_hugepage_only_range() 2. arch_clear_hugepage_flags() After this arm (32 bit) remains the sole platform defining it's own huge_ptep_get() via __HAVE_ARCH_HUGE_PTEP_GET. This patch (of 3): Platform specific huge_ptep_get() is required only when fetching the huge PTE involves more than just dereferencing the page table pointer. This is not the case on arm64 platform. Hence huge_ptep_pte() can be dropped along with it's __HAVE_ARCH_HUGE_PTEP_GET subscription. Before that, it updates the generic huge_ptep_get() with READ_ONCE() which will prevent known page table issues with THP on arm64. Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Acked-by: Mike Kravetz Cc: Catalin Marinas Cc: Will Deacon Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christian Borntraeger Cc: "David S. Miller" Cc: Fenghua Yu Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Rich Felker Cc: Russell King Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vasily Gorbik Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1588907271-11920-1-git-send-email-anshuman.khandual@arm.com Link: http://lkml.kernel.org/r//1506527369-19535-1-git-send-email-will.deacon@arm.com/ Link: http://lkml.kernel.org/r/1588907271-11920-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit 8ac0b81ab1488e15305f51fe49f2f89c0f32e30d Author: Li Xinhai Date: Wed Jun 3 16:00:53 2020 -0700 mm/hugetlb: avoid unnecessary check on pud and pmd entry in huge_pte_offset When huge_pte_offset() is called, the parameter sz can only be PUD_SIZE or PMD_SIZE. If sz is PUD_SIZE and code can reach pud, then *pud must be none, or normal hugetlb entry, or non-present (migration or hwpoisoned) hugetlb entry, and we can directly return pud. When sz is PMD_SIZE, pud must be none or present, and if code can reach pmd, we can directly return pmd. So after this patch the code is simplified by first check on the parameter sz, and avoid unnecessary checks in current code. Same semantics of existing code is maintained. More details about relevant commits: commit 9b19df292c66 ("mm/hugetlb.c: make huge_pte_offset() consistent and document behaviour") changed the code path for pud and pmd handling, see comments about why this patch intends to change it. ... pud = pud_offset(p4d, addr); if (sz != PUD_SIZE && pud_none(*pud)) // [1] return NULL; /* hugepage or swap? */ if (pud_huge(*pud) || !pud_present(*pud)) // [2] return (pte_t *)pud; pmd = pmd_offset(pud, addr); if (sz != PMD_SIZE && pmd_none(*pmd)) // [3] return NULL; /* hugepage or swap? */ if (pmd_huge(*pmd) || !pmd_present(*pmd)) // [4] return (pte_t *)pmd; return NULL; // [5] ... [1]: this is necessary, return NULL for sz == PMD_SIZE; [2]: if sz == PUD_SIZE, all valid values of pud entry will cause return; [3]: dead code, sz != PMD_SIZE never true; [4]: all valid values of pmd entry will cause return; [5]: dead code, because of check in [4]. Now, this patch combines [1] and [2] for pud, and combines [3], [4] and [5] for pmd, so avoid unnecessary checks. I don't try to catch any invalid values in page table entry, as that will be checked by caller and avoid extra branch in this function. Also no assert on sz must equal PUD_SIZE or PMD_SIZE, since this function only call for hugetlb mapping. For commit 3c1d7e6ccb64 ("mm/hugetlb: fix a addressing exception caused by huge_pte_offset"), since we don't read the entry more than once now, variable pud_entry and pmd_entry are not needed. Signed-off-by: Li Xinhai Signed-off-by: Andrew Morton Cc: Mike Kravetz Cc: Jason Gunthorpe Cc: Punit Agrawal Cc: Longpeng Link: http://lkml.kernel.org/r/1587794313-16849-1-git-send-email-lixinhai.lxh@gmail.com Signed-off-by: Linus Torvalds commit c2833a5bf75b3657c4dd20b3709c8c702754cb1f Author: Mike Kravetz Date: Wed Jun 3 16:00:50 2020 -0700 hugetlbfs: fix changes to command line processing Previously, a check for hugepages_supported was added before processing hugetlb command line parameters. On some architectures such as powerpc, hugepages_supported() is not set to true until after command line processing. Therefore, no hugetlb command line parameters would be accepted. Remove the additional checks for hugepages_supported. In hugetlb_init, print a warning if !hugepages_supported and command line parameters were specified. Reported-by: Sandipan Das Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/b1f04f9f-fa46-c2a0-7693-4a0679d2a1ee@oracle.com Signed-off-by: Linus Torvalds commit 282f4214384ee2e2ca39b2532a5296fddf762518 Author: Mike Kravetz Date: Wed Jun 3 16:00:46 2020 -0700 hugetlbfs: clean up command line processing With all hugetlb page processing done in a single file clean up code. - Make code match desired semantics - Update documentation with semantics - Make all warnings and errors messages start with 'HugeTLB:'. - Consistently name command line parsing routines. - Warn if !hugepages_supported() and command line parameters have been specified. - Add comments to code - Describe some of the subtle interactions - Describe semantics of command line arguments This patch also fixes issues with implicitly setting the number of gigantic huge pages to preallocate. Previously on X86 command line, hugepages=2 default_hugepagesz=1G would result in zero 1G pages being preallocated and, # grep HugePages_Total /proc/meminfo HugePages_Total: 0 # sysctl -a | grep nr_hugepages vm.nr_hugepages = 2 vm.nr_hugepages_mempolicy = 2 # cat /proc/sys/vm/nr_hugepages 2 After this patch 2 gigantic pages will be preallocated and all the proc, sysfs, sysctl and meminfo files will accurately reflect this. To address the issue with gigantic pages, a small change in behavior was made to command line processing. Previously the command line, hugepages=128 default_hugepagesz=2M hugepagesz=2M hugepages=256 would result in the allocation of 256 2M huge pages. The value 128 would be ignored without any warning. After this patch, 128 2M pages will be allocated and a warning message will be displayed indicating the value of 256 is ignored. This change in behavior is required because allocation of implicitly specified gigantic pages must be done when the default_hugepagesz= is encountered for gigantic pages. Previously the code waited until later in the boot process (hugetlb_init), to allocate pages of default size. However the bootmem allocator required for gigantic allocations is not available at this time. Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Tested-by: Sandipan Das Acked-by: Gerald Schaefer [s390] Acked-by: Will Deacon Cc: Albert Ou Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dave Hansen Cc: David S. Miller Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Longpeng Cc: Mina Almasry Cc: Nitesh Narayan Lal Cc: Palmer Dabbelt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Peter Xu Cc: Randy Dunlap Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Anders Roxell Cc: "Aneesh Kumar K.V" Cc: Qian Cai Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/20200417185049.275845-5-mike.kravetz@oracle.com Signed-off-by: Linus Torvalds commit 38237830882ba8d425a397066982d5e32b4ced21 Author: Mike Kravetz Date: Wed Jun 3 16:00:42 2020 -0700 hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate hugetlb_add_hstate() prints a warning if the hstate already exists. This was originally done as part of kernel command line parsing. If 'hugepagesz=' was specified more than once, the warning pr_warn("hugepagesz= specified twice, ignoring\n"); would be printed. Some architectures want to enable all huge page sizes. They would call hugetlb_add_hstate for all supported sizes. However, this was done after command line processing and as a result hstates could have already been created for some sizes. To make sure no warning were printed, there would often be code like: if (!size_to_hstate(size) hugetlb_add_hstate(ilog2(size) - PAGE_SHIFT) The only time we want to print the warning is as the result of command line processing. So, remove the warning from hugetlb_add_hstate and add it to the single arch independent routine processing "hugepagesz=". After this, calls to size_to_hstate() in arch specific code can be removed and hugetlb_add_hstate can be called without worrying about warning messages. [mike.kravetz@oracle.com: fix hugetlb initialization] Link: http://lkml.kernel.org/r/4c36c6ce-3774-78fa-abc4-b7346bf24348@oracle.com Link: http://lkml.kernel.org/r/20200428205614.246260-5-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Tested-by: Anders Roxell Acked-by: Mina Almasry Acked-by: Gerald Schaefer [s390] Acked-by: Will Deacon Cc: Albert Ou Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dave Hansen Cc: David S. Miller Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Longpeng Cc: Nitesh Narayan Lal Cc: Palmer Dabbelt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Peter Xu Cc: Randy Dunlap Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: "Aneesh Kumar K.V" Cc: Qian Cai Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/20200417185049.275845-4-mike.kravetz@oracle.com Link: http://lkml.kernel.org/r/20200428205614.246260-4-mike.kravetz@oracle.com Signed-off-by: Linus Torvalds commit 359f25443a8dada0fb709dd044a422017031790f Author: Mike Kravetz Date: Wed Jun 3 16:00:38 2020 -0700 hugetlbfs: move hugepagesz= parsing to arch independent code Now that architectures provide arch_hugetlb_valid_size(), parsing of "hugepagesz=" can be done in architecture independent code. Create a single routine to handle hugepagesz= parsing and remove all arch specific routines. We can also remove the interface hugetlb_bad_size() as this is no longer used outside arch independent code. This also provides consistent behavior of hugetlbfs command line options. The hugepagesz= option should only be specified once for a specific size, but some architectures allow multiple instances. This appears to be more of an oversight when code was added by some architectures to set up ALL huge pages sizes. Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Tested-by: Sandipan Das Reviewed-by: Peter Xu Acked-by: Mina Almasry Acked-by: Gerald Schaefer [s390] Acked-by: Will Deacon Cc: Albert Ou Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dave Hansen Cc: David S. Miller Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Longpeng Cc: Nitesh Narayan Lal Cc: Palmer Dabbelt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Randy Dunlap Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Anders Roxell Cc: "Aneesh Kumar K.V" Cc: Qian Cai Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/20200417185049.275845-3-mike.kravetz@oracle.com Link: http://lkml.kernel.org/r/20200428205614.246260-3-mike.kravetz@oracle.com Signed-off-by: Linus Torvalds commit ae94da898133947c2d1f005da10838478e4548db Author: Mike Kravetz Date: Wed Jun 3 16:00:34 2020 -0700 hugetlbfs: add arch_hugetlb_valid_size Patch series "Clean up hugetlb boot command line processing", v4. Longpeng(Mike) reported a weird message from hugetlb command line processing and proposed a solution [1]. While the proposed patch does address the specific issue, there are other related issues in command line processing. As hugetlbfs evolved, updates to command line processing have been made to meet immediate needs and not necessarily in a coordinated manner. The result is that some processing is done in arch specific code, some is done in arch independent code and coordination is problematic. Semantics can vary between architectures. The patch series does the following: - Define arch specific arch_hugetlb_valid_size routine used to validate passed huge page sizes. - Move hugepagesz= command line parsing out of arch specific code and into an arch independent routine. - Clean up command line processing to follow desired semantics and document those semantics. [1] https://lore.kernel.org/linux-mm/20200305033014.1152-1-longpeng2@huawei.com This patch (of 3): The architecture independent routine hugetlb_default_setup sets up the default huge pages size. It has no way to verify if the passed value is valid, so it accepts it and attempts to validate at a later time. This requires undocumented cooperation between the arch specific and arch independent code. For architectures that support more than one huge page size, provide a routine arch_hugetlb_valid_size to validate a huge page size. hugetlb_default_setup can use this to validate passed values. arch_hugetlb_valid_size will also be used in a subsequent patch to move processing of the "hugepagesz=" in arch specific code to a common routine in arch independent code. Signed-off-by: Mike Kravetz Signed-off-by: Andrew Morton Acked-by: Gerald Schaefer [s390] Acked-by: Will Deacon Cc: Catalin Marinas Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: David S. Miller Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Dave Hansen Cc: Jonathan Corbet Cc: Longpeng Cc: Christophe Leroy Cc: Randy Dunlap Cc: Mina Almasry Cc: Peter Xu Cc: Nitesh Narayan Lal Cc: Anders Roxell Cc: "Aneesh Kumar K.V" Cc: Qian Cai Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/20200428205614.246260-1-mike.kravetz@oracle.com Link: http://lkml.kernel.org/r/20200428205614.246260-2-mike.kravetz@oracle.com Link: http://lkml.kernel.org/r/20200417185049.275845-1-mike.kravetz@oracle.com Link: http://lkml.kernel.org/r/20200417185049.275845-2-mike.kravetz@oracle.com Signed-off-by: Linus Torvalds commit 71a2c112a0f6da497e1b44e18e97b1716c240518 Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:30 2020 -0700 khugepaged: introduce 'max_ptes_shared' tunable 'max_ptes_shared' specifies how many pages can be shared across multiple processes. Exceeding the number would block the collapse:: /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_shared A higher value may increase memory footprint for some workloads. By default, at least half of pages has to be not shared. [colin.king@canonical.com: fix several spelling mistakes] Link: http://lkml.kernel.org/r/20200420084241.65433-1-colin.king@canonical.com Signed-off-by: Kirill A. Shutemov Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: John Hubbard Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-9-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit 3917c80280c93a7123f1a3a6dcdb10a3ea19737d Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:27 2020 -0700 thp: change CoW semantics for anon-THP Currently we have different copy-on-write semantics for anon- and file-THP. For anon-THP we try to allocate huge page on the write fault, but on file-THP we split PMD and allocate 4k page. Arguably, file-THP semantics is more desirable: we don't necessary want to unshare full PMD range from the parent on the first access. This is the primary reason THP is unusable for some workloads, like Redis. The original THP refcounting didn't allow to have PTE-mapped compound pages, so we had no options, but to allocate huge page on CoW (with fallback to 512 4k pages). The current refcounting doesn't have such limitations and we can cut a lot of complex code out of fault path. khugepaged is now able to recover THP from such ranges if the configuration allows. Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: John Hubbard Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-8-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit 5503fbf2b0b80c1a47a7dca0e4f060f52f522cfd Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:23 2020 -0700 khugepaged: allow to collapse PTE-mapped compound pages We can collapse PTE-mapped compound pages. We only need to avoid handling them more than once: lock/unlock page only once if it's present in the PMD range multiple times as it handled on compound level. The same goes for LRU isolation and putback. Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: John Hubbard Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-7-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit 9445689f3b6170c6145a8772eee692482199cdd6 Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:20 2020 -0700 khugepaged: allow to collapse a page shared across fork The page can be included into collapse as long as it doesn't have extra pins (from GUP or otherwise). Logic to check the refcount is moved to a separate function. For pages in swap cache, add compound_nr(page) to the expected refcount, in order to handle the compound page case. This is in preparation for the following patch. VM_BUG_ON_PAGE() was removed from __collapse_huge_page_copy() as the invariant it checks is no longer valid: the source can be mapped multiple times now. [yang.shi@linux.alibaba.com: remove error message when checking external pins] Link: http://lkml.kernel.org/r/1589317383-9595-1-git-send-email-yang.shi@linux.alibaba.com [cai@lca.pw: fix set-but-not-used warning] Link: http://lkml.kernel.org/r/20200521145644.GA6367@ovpn-112-192.phx2.redhat.com Signed-off-by: Kirill A. Shutemov Signed-off-by: Yang Shi Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Reviewed-by: John Hubbard Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-6-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit ae2c5d8042426b69c5f4a74296d1a20bb769a8ad Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:17 2020 -0700 khugepaged: drain LRU add pagevec after swapin collapse_huge_page() tries to swap in pages that are part of the PMD range. Just swapped in page goes though LRU add cache. The cache gets extra reference on the page. The extra reference can lead to the collapse fail: the following __collapse_huge_page_isolate() would check refcount and abort collapse seeing unexpected refcount. The fix is to drain local LRU add cache in __collapse_huge_page_swapin() if we successfully swapped in any pages. Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: John Hubbard Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-5-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit a980df33e9351e5474c06ec0fd96b2f409e2ff22 Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:12 2020 -0700 khugepaged: drain all LRU caches before scanning pages Having a page in LRU add cache offsets page refcount and gives false-negative on PageLRU(). It reduces collapse success rate. Drain all LRU add caches before scanning. It happens relatively rare and should not disturb the system too much. Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: John Hubbard Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-4-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit ffe945e633b527d5a4577b42cbadec3c7cbcf096 Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:09 2020 -0700 khugepaged: do not stop collapse if less than half PTEs are referenced __collapse_huge_page_swapin() checks the number of referenced PTE to decide if the memory range is hot enough to justify swapin. We have few problems with the approach: - It is way too late: we can do the check much earlier and safe time. khugepaged_scan_pmd() already knows if we have any pages to swap in and number of referenced page. - It stops collapse altogether if there's not enough referenced pages, not only swappingin. Fix it by making the right check early. We also can avoid additional page table scanning if khugepaged_scan_pmd() haven't found any swap entries. Fixes: 0db501f7a34c ("mm, thp: convert from optimistic swapin collapsing to conservative") Signed-off-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: John Hubbard Cc: Mike Kravetz Cc: Ralph Campbell Link: http://lkml.kernel.org/r/20200416160026.16538-3-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit e0c13f9761df8f97cf5e81495d12ecbc4075684a Author: Kirill A. Shutemov Date: Wed Jun 3 16:00:06 2020 -0700 khugepaged: add self test Patch series "thp/khugepaged improvements and CoW semantics", v4. The patchset adds khugepaged selftest (anon-THP only for now), expands cases khugepaged can handle and switches anon-THP copy-on-write handling to 4k. This patch (of 8): The test checks if khugepaged is able to recover huge page where we expect to do so. It only covers anon-THP for now. Currently the test shows few failures. They are going to be addressed by the following patches. [colin.king@canonical.com: fix several spelling mistakes] Link: http://lkml.kernel.org/r/20200420084241.65433-1-colin.king@canonical.com [aneesh.kumar@linux.ibm.com: replace the usage of system(3) in the test] Link: http://lkml.kernel.org/r/20200429110727.89388-1-aneesh.kumar@linux.ibm.com [kirill@shutemov.name: fixup for issues I've noticed] Link: http://lkml.kernel.org/r/20200429124816.jp272trghrzxx5j5@box [jhubbard@nvidia.com: add khugepaged to .gitignore] Link: http://lkml.kernel.org/r/20200517002509.362401-1-jhubbard@nvidia.com Signed-off-by: Kirill A. Shutemov Signed-off-by: Colin Ian King Signed-off-by: Aneesh Kumar K.V Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Tested-by: Zi Yan Reviewed-by: William Kucharski Reviewed-by: Zi Yan Acked-by: Yang Shi Cc: Andrea Arcangeli Cc: Ralph Campbell Cc: John Hubbard Cc: William Kucharski Cc: "Kirill A. Shutemov" Cc: Mike Kravetz Link: http://lkml.kernel.org/r/20200416160026.16538-1-kirill.shutemov@linux.intel.com Link: http://lkml.kernel.org/r/20200416160026.16538-2-kirill.shutemov@linux.intel.com Signed-off-by: Linus Torvalds commit 633bf2fe8da0520c74ee73e9eb82d78948c3b3cc Author: Chen Tao Date: Wed Jun 3 16:00:02 2020 -0700 mm/page_alloc.c: add missing newline Add missing line breaks on pr_warn(). Signed-off-by: Chen Tao Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200603063547.235825-1-chentao107@huawei.com Signed-off-by: Linus Torvalds commit ec3b39c731897aa03873094cd277d009341cd7c4 Author: Daniel Jordan Date: Wed Jun 3 15:59:59 2020 -0700 padata: document multithreaded jobs Add Documentation for multithreaded jobs. Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Cc: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-9-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit ecd096506922332fdb36ff1211e03601befe6e18 Author: Daniel Jordan Date: Wed Jun 3 15:59:55 2020 -0700 mm: make deferred init's max threads arch-specific Using padata during deferred init has only been tested on x86, so for now limit it to this architecture. If another arch wants this, it can find the max thread limit that's best for it and override deferred_page_init_max_threads(). Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Cc: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-8-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit e44431498f5fbf427f139aa413cf381b4fa3a600 Author: Daniel Jordan Date: Wed Jun 3 15:59:51 2020 -0700 mm: parallelize deferred_init_memmap() Deferred struct page init is a significant bottleneck in kernel boot. Optimizing it maximizes availability for large-memory systems and allows spinning up short-lived VMs as needed without having to leave them running. It also benefits bare metal machines hosting VMs that are sensitive to downtime. In projects such as VMM Fast Restart[1], where guest state is preserved across kexec reboot, it helps prevent application and network timeouts in the guests. Multithread to take full advantage of system memory bandwidth. The maximum number of threads is capped at the number of CPUs on the node because speedups always improve with additional threads on every system tested, and at this phase of boot, the system is otherwise idle and waiting on page init to finish. Helper threads operate on section-aligned ranges to both avoid false sharing when setting the pageblock's migrate type and to avoid accessing uninitialized buddy pages, though max order alignment is enough for the latter. The minimum chunk size is also a section. There was benefit to using multiple threads even on relatively small memory (1G) systems, and this is the smallest size that the alignment allows. The time (milliseconds) is the slowest node to initialize since boot blocks until all nodes finish. intel_pstate is loaded in active mode without hwp and with turbo enabled, and intel_idle is active as well. Intel(R) Xeon(R) Platinum 8167M CPU @ 2.00GHz (Skylake, bare metal) 2 nodes * 26 cores * 2 threads = 104 CPUs 384G/node = 768G memory kernel boot deferred init ------------------------ ------------------------ node% (thr) speedup time_ms (stdev) speedup time_ms (stdev) ( 0) -- 4089.7 ( 8.1) -- 1785.7 ( 7.6) 2% ( 1) 1.7% 4019.3 ( 1.5) 3.8% 1717.7 ( 11.8) 12% ( 6) 34.9% 2662.7 ( 2.9) 79.9% 359.3 ( 0.6) 25% ( 13) 39.9% 2459.0 ( 3.6) 91.2% 157.0 ( 0.0) 37% ( 19) 39.2% 2485.0 ( 29.7) 90.4% 172.0 ( 28.6) 50% ( 26) 39.3% 2482.7 ( 25.7) 90.3% 173.7 ( 30.0) 75% ( 39) 39.0% 2495.7 ( 5.5) 89.4% 190.0 ( 1.0) 100% ( 52) 40.2% 2443.7 ( 3.8) 92.3% 138.0 ( 1.0) Intel(R) Xeon(R) CPU E5-2699C v4 @ 2.20GHz (Broadwell, kvm guest) 1 node * 16 cores * 2 threads = 32 CPUs 192G/node = 192G memory kernel boot deferred init ------------------------ ------------------------ node% (thr) speedup time_ms (stdev) speedup time_ms (stdev) ( 0) -- 1988.7 ( 9.6) -- 1096.0 ( 11.5) 3% ( 1) 1.1% 1967.0 ( 17.6) 0.3% 1092.7 ( 11.0) 12% ( 4) 41.1% 1170.3 ( 14.2) 73.8% 287.0 ( 3.6) 25% ( 8) 47.1% 1052.7 ( 21.9) 83.9% 177.0 ( 13.5) 38% ( 12) 48.9% 1016.3 ( 12.1) 86.8% 144.7 ( 1.5) 50% ( 16) 48.9% 1015.7 ( 8.1) 87.8% 134.0 ( 4.4) 75% ( 24) 49.1% 1012.3 ( 3.1) 88.1% 130.3 ( 2.3) 100% ( 32) 49.5% 1004.0 ( 5.3) 88.5% 125.7 ( 2.1) Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz (Haswell, bare metal) 2 nodes * 18 cores * 2 threads = 72 CPUs 128G/node = 256G memory kernel boot deferred init ------------------------ ------------------------ node% (thr) speedup time_ms (stdev) speedup time_ms (stdev) ( 0) -- 1680.0 ( 4.6) -- 627.0 ( 4.0) 3% ( 1) 0.3% 1675.7 ( 4.5) -0.2% 628.0 ( 3.6) 11% ( 4) 25.6% 1250.7 ( 2.1) 67.9% 201.0 ( 0.0) 25% ( 9) 30.7% 1164.0 ( 17.3) 81.8% 114.3 ( 17.7) 36% ( 13) 31.4% 1152.7 ( 10.8) 84.0% 100.3 ( 17.9) 50% ( 18) 31.5% 1150.7 ( 9.3) 83.9% 101.0 ( 14.1) 75% ( 27) 31.7% 1148.0 ( 5.6) 84.5% 97.3 ( 6.4) 100% ( 36) 32.0% 1142.3 ( 4.0) 85.6% 90.0 ( 1.0) AMD EPYC 7551 32-Core Processor (Zen, kvm guest) 1 node * 8 cores * 2 threads = 16 CPUs 64G/node = 64G memory kernel boot deferred init ------------------------ ------------------------ node% (thr) speedup time_ms (stdev) speedup time_ms (stdev) ( 0) -- 1029.3 ( 25.1) -- 240.7 ( 1.5) 6% ( 1) -0.6% 1036.0 ( 7.8) -2.2% 246.0 ( 0.0) 12% ( 2) 11.8% 907.7 ( 8.6) 44.7% 133.0 ( 1.0) 25% ( 4) 13.9% 886.0 ( 10.6) 62.6% 90.0 ( 6.0) 38% ( 6) 17.8% 845.7 ( 14.2) 69.1% 74.3 ( 3.8) 50% ( 8) 16.8% 856.0 ( 22.1) 72.9% 65.3 ( 5.7) 75% ( 12) 15.4% 871.0 ( 29.2) 79.8% 48.7 ( 7.4) 100% ( 16) 21.0% 813.7 ( 21.0) 80.5% 47.0 ( 5.2) Server-oriented distros that enable deferred page init sometimes run in small VMs, and they still benefit even though the fraction of boot time saved is smaller: AMD EPYC 7551 32-Core Processor (Zen, kvm guest) 1 node * 2 cores * 2 threads = 4 CPUs 16G/node = 16G memory kernel boot deferred init ------------------------ ------------------------ node% (thr) speedup time_ms (stdev) speedup time_ms (stdev) ( 0) -- 716.0 ( 14.0) -- 49.7 ( 0.6) 25% ( 1) 1.8% 703.0 ( 5.3) -4.0% 51.7 ( 0.6) 50% ( 2) 1.6% 704.7 ( 1.2) 43.0% 28.3 ( 0.6) 75% ( 3) 2.7% 696.7 ( 13.1) 49.7% 25.0 ( 0.0) 100% ( 4) 4.1% 687.0 ( 10.4) 55.7% 22.0 ( 0.0) Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz (Haswell, kvm guest) 1 node * 2 cores * 2 threads = 4 CPUs 14G/node = 14G memory kernel boot deferred init ------------------------ ------------------------ node% (thr) speedup time_ms (stdev) speedup time_ms (stdev) ( 0) -- 787.7 ( 6.4) -- 122.3 ( 0.6) 25% ( 1) 0.2% 786.3 ( 10.8) -2.5% 125.3 ( 2.1) 50% ( 2) 5.9% 741.0 ( 13.9) 37.6% 76.3 ( 19.7) 75% ( 3) 8.3% 722.0 ( 19.0) 49.9% 61.3 ( 3.2) 100% ( 4) 9.3% 714.7 ( 9.5) 56.4% 53.3 ( 1.5) On Josh's 96-CPU and 192G memory system: Without this patch series: [ 0.487132] node 0 initialised, 23398907 pages in 292ms [ 0.499132] node 1 initialised, 24189223 pages in 304ms ... [ 0.629376] Run /sbin/init as init process With this patch series: [ 0.231435] node 1 initialised, 24189223 pages in 32ms [ 0.236718] node 0 initialised, 23398907 pages in 36ms [1] https://static.sched.com/hosted_files/kvmforum2019/66/VMM-fast-restart_kvmforum2019.pdf Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Reviewed-by: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-7-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit 89c7c4022dfccf0c48ab22f4a6fd2db3d98fe3bc Author: Daniel Jordan Date: Wed Jun 3 15:59:47 2020 -0700 mm: don't track number of pages during deferred initialization Deferred page init used to report the number of pages initialized: node 0 initialised, 32439114 pages in 97ms Tracking this makes the code more complicated when using multiple threads. Given that the statistic probably has limited value, especially since a zone grows on demand so that the page count can vary, just remove it. The boot message now looks like node 0 deferred pages initialised in 97ms Suggested-by: Alexander Duyck Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Reviewed-by: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Josh Triplett Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-6-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit 004ed42638f4428e70ead59d170f3d17ff761a0f Author: Daniel Jordan Date: Wed Jun 3 15:59:43 2020 -0700 padata: add basic support for multithreaded jobs Sometimes the kernel doesn't take full advantage of system memory bandwidth, leading to a single CPU spending excessive time in initialization paths where the data scales with memory size. Multithreading naturally addresses this problem. Extend padata, a framework that handles many parallel yet singlethreaded jobs, to also handle multithreaded jobs by adding support for splitting up the work evenly, specifying a minimum amount of work that's appropriate for one helper thread to do, load balancing between helpers, and coordinating them. This is inspired by work from Pavel Tatashin and Steve Sistare. Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Cc: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-5-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit 4611ce22468895acd61fee9ac1da810d60617d9a Author: Daniel Jordan Date: Wed Jun 3 15:59:39 2020 -0700 padata: allocate work structures for parallel jobs from a pool padata allocates per-CPU, per-instance work structs for parallel jobs. A do_parallel call assigns a job to a sequence number and hashes the number to a CPU, where the job will eventually run using the corresponding work. This approach fit with how padata used to bind a job to each CPU round-robin, makes less sense after commit bfde23ce200e6 ("padata: unbind parallel jobs from specific CPUs") because a work isn't bound to a particular CPU anymore, and isn't needed at all for multithreaded jobs because they don't have sequence numbers. Replace the per-CPU works with a preallocated pool, which allows sharing them between existing padata users and the upcoming multithreaded user. The pool will also facilitate setting NUMA-aware concurrency limits with later users. The pool is sized according to the number of possible CPUs. With this limit, MAX_OBJ_NUM no longer makes sense, so remove it. If the global pool is exhausted, a parallel job is run in the current task instead to throttle a system trying to do too much in parallel. Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Cc: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-4-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit f1b192b117cd418bacf42a9583d7a01855a18fe5 Author: Daniel Jordan Date: Wed Jun 3 15:59:35 2020 -0700 padata: initialize earlier padata will soon initialize the system's struct pages in parallel, so it needs to be ready by page_alloc_init_late(). The error return from padata_driver_init() triggers an initcall warning, so add a warning to padata_init() to avoid silent failure. Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Cc: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-3-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit 305dacf77952e6e62405f916654f38423c78ab2f Author: Daniel Jordan Date: Wed Jun 3 15:59:31 2020 -0700 padata: remove exit routine Patch series "padata: parallelize deferred page init", v3. Deferred struct page init is a bottleneck in kernel boot--the biggest for us and probably others. Optimizing it maximizes availability for large-memory systems and allows spinning up short-lived VMs as needed without having to leave them running. It also benefits bare metal machines hosting VMs that are sensitive to downtime. In projects such as VMM Fast Restart[1], where guest state is preserved across kexec reboot, it helps prevent application and network timeouts in the guests. So, multithread deferred init to take full advantage of system memory bandwidth. Extend padata, a framework that handles many parallel singlethreaded jobs, to handle multithreaded jobs as well by adding support for splitting up the work evenly, specifying a minimum amount of work that's appropriate for one helper thread to do, load balancing between helpers, and coordinating them. More documentation in patches 4 and 8. This series is the first step in a project to address other memory proportional bottlenecks in the kernel such as pmem struct page init, vfio page pinning, hugetlb fallocate, and munmap. Deferred page init doesn't require concurrency limits, resource control, or priority adjustments like these other users will because it happens during boot when the system is otherwise idle and waiting for page init to finish. This has been run on a variety of x86 systems and speeds up kernel boot by 4% to 49%, saving up to 1.6 out of 4 seconds. Patch 6 has more numbers. This patch (of 8): padata_driver_exit() is unnecessary because padata isn't built as a module and doesn't exit. padata's init routine will soon allocate memory, so getting rid of the exit function now avoids pointless code to free it. Signed-off-by: Daniel Jordan Signed-off-by: Andrew Morton Tested-by: Josh Triplett Cc: Alexander Duyck Cc: Alex Williamson Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Herbert Xu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Kirill Tkhai Cc: Michal Hocko Cc: Pavel Machek Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Robert Elliott Cc: Shile Zhang Cc: Steffen Klassert Cc: Steven Sistare Cc: Tejun Heo Cc: Zi Yan Link: http://lkml.kernel.org/r/20200527173608.2885243-1-daniel.m.jordan@oracle.com Link: http://lkml.kernel.org/r/20200527173608.2885243-2-daniel.m.jordan@oracle.com Signed-off-by: Linus Torvalds commit da97f2d56bbd880b4138916a7ef96f9881a551b2 Author: Pavel Tatashin Date: Wed Jun 3 15:59:27 2020 -0700 mm: call cond_resched() from deferred_init_memmap() Now that deferred pages are initialized with interrupts enabled we can replace touch_nmi_watchdog() with cond_resched(), as it was before 3a2d7fa8a3d5. For now, we cannot do the same in deferred_grow_zone() as it is still initializes pages with interrupts disabled. This change fixes RCU problem described in https://lkml.kernel.org/r/20200401104156.11564-2-david@redhat.com [ 60.474005] rcu: INFO: rcu_sched detected stalls on CPUs/tasks: [ 60.475000] rcu: 1-...0: (0 ticks this GP) idle=02a/1/0x4000000000000000 softirq=1/1 fqs=15000 [ 60.475000] rcu: (detected by 0, t=60002 jiffies, g=-1199, q=1) [ 60.475000] Sending NMI from CPU 0 to CPUs 1: [ 1.760091] NMI backtrace for cpu 1 [ 1.760091] CPU: 1 PID: 20 Comm: pgdatinit0 Not tainted 4.18.0-147.9.1.el8_1.x86_64 #1 [ 1.760091] Hardware name: Red Hat KVM, BIOS 1.13.0-1.module+el8.2.0+5520+4e5817f3 04/01/2014 [ 1.760091] RIP: 0010:__init_single_page.isra.65+0x10/0x4f [ 1.760091] Code: 48 83 cf 63 48 89 f8 0f 1f 40 00 48 89 c6 48 89 d7 e8 6b 18 80 ff 66 90 5b c3 31 c0 b9 10 00 00 00 49 89 f8 48 c1 e6 33 f3 ab 07 00 00 00 48 c1 e2 36 41 c7 40 34 01 00 00 00 48 c1 e0 33 41 [ 1.760091] RSP: 0000:ffffba783123be40 EFLAGS: 00000006 [ 1.760091] RAX: 0000000000000000 RBX: fffffad34405e300 RCX: 0000000000000000 [ 1.760091] RDX: 0000000000000000 RSI: 0010000000000000 RDI: fffffad34405e340 [ 1.760091] RBP: 0000000033f3177e R08: fffffad34405e300 R09: 0000000000000002 [ 1.760091] R10: 000000000000002b R11: ffff98afb691a500 R12: 0000000000000002 [ 1.760091] R13: 0000000000000000 R14: 000000003f03ea00 R15: 000000003e10178c [ 1.760091] FS: 0000000000000000(0000) GS:ffff9c9ebeb00000(0000) knlGS:0000000000000000 [ 1.760091] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.760091] CR2: 00000000ffffffff CR3: 000000a1cf20a001 CR4: 00000000003606e0 [ 1.760091] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1.760091] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1.760091] Call Trace: [ 1.760091] deferred_init_pages+0x8f/0xbf [ 1.760091] deferred_init_memmap+0x184/0x29d [ 1.760091] ? deferred_free_pages.isra.97+0xba/0xba [ 1.760091] kthread+0x112/0x130 [ 1.760091] ? kthread_flush_work_fn+0x10/0x10 [ 1.760091] ret_from_fork+0x35/0x40 [ 89.123011] node 0 initialised, 1055935372 pages in 88650ms Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages") Reported-by: Yiqian Wei Signed-off-by: Pavel Tatashin Signed-off-by: Andrew Morton Tested-by: David Hildenbrand Reviewed-by: Daniel Jordan Reviewed-by: David Hildenbrand Reviewed-by: Pankaj Gupta Acked-by: Michal Hocko Cc: Dan Williams Cc: James Morris Cc: Kirill Tkhai Cc: Sasha Levin Cc: Shile Zhang Cc: Vlastimil Babka Cc: [4.17+] Link: http://lkml.kernel.org/r/20200403140952.17177-4-pasha.tatashin@soleen.com Signed-off-by: Linus Torvalds commit 3d060856adfc59afb9d029c233141334cfaba418 Author: Pavel Tatashin Date: Wed Jun 3 15:59:24 2020 -0700 mm: initialize deferred pages with interrupts enabled Initializing struct pages is a long task and keeping interrupts disabled for the duration of this operation introduces a number of problems. 1. jiffies are not updated for long period of time, and thus incorrect time is reported. See proposed solution and discussion here: lkml/20200311123848.118638-1-shile.zhang@linux.alibaba.com 2. It prevents farther improving deferred page initialization by allowing intra-node multi-threading. We are keeping interrupts disabled to solve a rather theoretical problem that was never observed in real world (See 3a2d7fa8a3d5). Let's keep interrupts enabled. In case we ever encounter a scenario where an interrupt thread wants to allocate large amount of memory this early in boot we can deal with that by growing zone (see deferred_grow_zone()) by the needed amount before starting deferred_init_memmap() threads. Before: [ 1.232459] node 0 initialised, 12058412 pages in 1ms After: [ 1.632580] node 0 initialised, 12051227 pages in 436ms Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages") Reported-by: Shile Zhang Signed-off-by: Pavel Tatashin Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Dan Williams Cc: James Morris Cc: Kirill Tkhai Cc: Sasha Levin Cc: Yiqian Wei Cc: [4.17+] Link: http://lkml.kernel.org/r/20200403140952.17177-3-pasha.tatashin@soleen.com Signed-off-by: Linus Torvalds commit 117003c32771df617acf66e140fbdbdeb0ac71f5 Author: Daniel Jordan Date: Wed Jun 3 15:59:20 2020 -0700 mm/pagealloc.c: call touch_nmi_watchdog() on max order boundaries in deferred init Patch series "initialize deferred pages with interrupts enabled", v4. Keep interrupts enabled during deferred page initialization in order to make code more modular and allow jiffies to update. Original approach, and discussion can be found here: http://lkml.kernel.org/r/20200311123848.118638-1-shile.zhang@linux.alibaba.com This patch (of 3): deferred_init_memmap() disables interrupts the entire time, so it calls touch_nmi_watchdog() periodically to avoid soft lockup splats. Soon it will run with interrupts enabled, at which point cond_resched() should be used instead. deferred_grow_zone() makes the same watchdog calls through code shared with deferred init but will continue to run with interrupts disabled, so it can't call cond_resched(). Pull the watchdog calls up to these two places to allow the first to be changed later, independently of the second. The frequency reduces from twice per pageblock (init and free) to once per max order block. Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages") Signed-off-by: Daniel Jordan Signed-off-by: Pavel Tatashin Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Dan Williams Cc: Shile Zhang Cc: Kirill Tkhai Cc: James Morris Cc: Sasha Levin Cc: Yiqian Wei Cc: [4.17+] Link: http://lkml.kernel.org/r/20200403140952.17177-2-pasha.tatashin@soleen.com Signed-off-by: Linus Torvalds commit ae70eddd5633fc71dccf210f237c5aefc96f4332 Author: Anshuman Khandual Date: Wed Jun 3 15:59:17 2020 -0700 mm/page_alloc: restrict and formalize compound_page_dtors[] Restrict elements in compound_page_dtors[] array per NR_COMPOUND_DTORS and explicitly position them according to enum compound_dtor_id. This improves protection against possible misalignment between compound_page_dtors[] and enum compound_dtor_id later on. Signed-off-by: Anshuman Khandual Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Link: http://lkml.kernel.org/r/1589795958-19317-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Linus Torvalds commit aa09259109583b98b9d9e7ed0d8eb1b880d1eb97 Author: Charan Teja Reddy Date: Wed Jun 3 15:59:14 2020 -0700 mm, page_alloc: reset the zone->watermark_boost early Updating the zone watermarks by any means, like min_free_kbytes, water_mark_scale_factor etc, when ->watermark_boost is set will result in higher low and high watermarks than the user asked. Below are the steps to reproduce the problem on system setup of Android kernel running on Snapdragon hardware. 1) Default settings of the system are as below: #cat /proc/sys/vm/min_free_kbytes = 5162 #cat /proc/zoneinfo | grep -e boost -e low -e "high " -e min -e Node Node 0, zone Normal min 797 low 8340 high 8539 2) Monitor the zone->watermark_boost(by adding a debug print in the kernel) and whenever it is greater than zero value, write the same value of min_free_kbytes obtained from step 1. #echo 5162 > /proc/sys/vm/min_free_kbytes 3) Then read the zone watermarks in the system while the ->watermark_boost is zero. This should show the same values of watermarks as step 1 but shown a higher values than asked. #cat /proc/zoneinfo | grep -e boost -e low -e "high " -e min -e Node Node 0, zone Normal min 797 low 21148 high 21347 These higher values are because of updating the zone watermarks using the macro min_wmark_pages(zone) which also adds the zone->watermark_boost. #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost) So the steps that lead to the issue are: 1) On the extfrag event, watermarks are boosted by storing the required value in ->watermark_boost. 2) User tries to update the zone watermarks level in the system through min_free_kbytes or watermark_scale_factor. 3) Later, when kswapd woke up, it resets the zone->watermark_boost to zero. In step 2), we use the min_wmark_pages() macro to store the watermarks in the zone structure thus the values are always offsetted by ->watermark_boost value. This can be avoided by resetting the ->watermark_boost to zero before it is used. Signed-off-by: Charan Teja Reddy Signed-off-by: Andrew Morton Reviewed-by: Baoquan He Cc: Vinayak Menon Link: http://lkml.kernel.org/r/1589457511-4255-1-git-send-email-charante@codeaurora.org Signed-off-by: Linus Torvalds commit b418a0f9f0b0f17132daab8a3bb841142c2bdc44 Author: Sandipan Das Date: Wed Jun 3 15:59:11 2020 -0700 mm/page_alloc.c: reset numa stats for boot pagesets Initially, the per-cpu pagesets of each zone are set to the boot pagesets. The real pagesets are allocated later but before that happens, page allocations do occur and the numa stats for the boot pagesets get incremented since they are common to all zones at that point. The real pagesets, however, are allocated for the populated zones only. Unpopulated zones, like those associated with memory-less nodes, continue using the boot pageset and end up skewing the numa stats of the corresponding node. E.g. $ numactl -H available: 2 nodes (0-1) node 0 cpus: 0 1 2 3 node 0 size: 0 MB node 0 free: 0 MB node 1 cpus: 4 5 6 7 node 1 size: 8131 MB node 1 free: 6980 MB node distances: node 0 1 0: 10 40 1: 40 10 $ numastat node0 node1 numa_hit 108 56495 numa_miss 0 0 numa_foreign 0 0 interleave_hit 0 4537 local_node 108 31547 other_node 0 24948 Hence, the boot pageset stats need to be cleared after the real pagesets are allocated. After this point, the stats of the boot pagesets do not change as page allocations requested for a memory-less node will either fail (if __GFP_THISNODE is used) or get fulfilled by a preferred zone of a different node based on the fallback zonelist. [sandipan@linux.ibm.com: v3] Link: http://lkml.kernel.org/r/20200511170356.162531-1-sandipan@linux.ibm.com Signed-off-by: Sandipan Das Signed-off-by: Andrew Morton Acked-by: Vlastimil Babka Cc: Konstantin Khlebnikov Cc: Michal Hocko Cc: "Kirill A . Shutemov" Cc: "Aneesh Kumar K.V" Link: http://lkml.kernel.org/r/9c9c2d1b15e37f6e6bf32f99e3100035e90c4ac9.1588868430.git.sandipan@linux.ibm.com Signed-off-by: Linus Torvalds commit 01c0bfe061f309b848d51619f20495ee2acd7727 Author: Wei Yang Date: Wed Jun 3 15:59:08 2020 -0700 mm: rename gfpflags_to_migratetype to gfp_migratetype for same convention Pageblock migrate type is encoded in GFP flags, just as zone_type and zonelist. Currently we use gfp_zone() and gfp_zonelist() to extract related information, it would be proper to use the same naming convention for migrate type. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Pankaj Gupta Link: http://lkml.kernel.org/r/20200329080823.7735-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit d0ddf49b7c4a3161d28f58612672d08ee9b5db94 Author: Wei Yang Date: Wed Jun 3 15:59:05 2020 -0700 mm/page_alloc.c: use NODE_MASK_NONE in build_zonelists() Slightly simplify the code by initializing user_mask with NODE_MASK_NONE, instead of later calling nodes_clear(). This saves a line of code. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Pankaj Gupta Link: http://lkml.kernel.org/r/20200330220840.21228-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 97a225e69a1f880886f33d2e65a7ace13f152caa Author: Joonsoo Kim Date: Wed Jun 3 15:59:01 2020 -0700 mm/page_alloc: integrate classzone_idx and high_zoneidx classzone_idx is just different name for high_zoneidx now. So, integrate them and add some comment to struct alloc_context in order to reduce future confusion about the meaning of this variable. The accessor, ac_classzone_idx() is also removed since it isn't needed after integration. In addition to integration, this patch also renames high_zoneidx to highest_zoneidx since it represents more precise meaning. Signed-off-by: Joonsoo Kim Signed-off-by: Andrew Morton Reviewed-by: Baoquan He Acked-by: Vlastimil Babka Acked-by: David Rientjes Cc: Johannes Weiner Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Ye Xiaolong Link: http://lkml.kernel.org/r/1587095923-7515-3-git-send-email-iamjoonsoo.kim@lge.com Signed-off-by: Linus Torvalds commit 3334a45eb9e2bb040c880ef65e1d72357a0a008b Author: Joonsoo Kim Date: Wed Jun 3 15:58:58 2020 -0700 mm/page_alloc: use ac->high_zoneidx for classzone_idx Patch series "integrate classzone_idx and high_zoneidx", v5. This patchset is followup of the problem reported and discussed two years ago [1, 2]. The problem this patchset solves is related to the classzone_idx on the NUMA system. It causes a problem when the lowmem reserve protection exists for some zones on a node that do not exist on other nodes. This problem was reported two years ago, and, at that time, the solution got general agreements [2]. But it was not upstreamed. [1]: http://lkml.kernel.org/r/20180102063528.GG30397@yexl-desktop [2]: http://lkml.kernel.org/r/1525408246-14768-1-git-send-email-iamjoonsoo.kim@lge.com This patch (of 2): Currently, we use classzone_idx to calculate lowmem reserve proetection for an allocation request. This classzone_idx causes a problem on NUMA systems when the lowmem reserve protection exists for some zones on a node that do not exist on other nodes. Before further explanation, I should first clarify how to compute the classzone_idx and the high_zoneidx. - ac->high_zoneidx is computed via the arcane gfp_zone(gfp_mask) and represents the index of the highest zone the allocation can use - classzone_idx was supposed to be the index of the highest zone on the local node that the allocation can use, that is actually available in the system Think about following example. Node 0 has 4 populated zone, DMA/DMA32/NORMAL/MOVABLE. Node 1 has 1 populated zone, NORMAL. Some zones, such as MOVABLE, doesn't exist on node 1 and this makes following difference. Assume that there is an allocation request whose gfp_zone(gfp_mask) is the zone, MOVABLE. Then, it's high_zoneidx is 3. If this allocation is initiated on node 0, it's classzone_idx is 3 since actually available/usable zone on local (node 0) is MOVABLE. If this allocation is initiated on node 1, it's classzone_idx is 2 since actually available/usable zone on local (node 1) is NORMAL. You can see that classzone_idx of the allocation request are different according to their starting node, even if their high_zoneidx is the same. Think more about these two allocation requests. If they are processed on local, there is no problem. However, if allocation is initiated on node 1 are processed on remote, in this example, at the NORMAL zone on node 0, due to memory shortage, problem occurs. Their different classzone_idx leads to different lowmem reserve and then different min watermark. See the following example. root@ubuntu:/sys/devices/system/memory# cat /proc/zoneinfo Node 0, zone DMA per-node stats ... pages free 3965 min 5 low 8 high 11 spanned 4095 present 3998 managed 3977 protection: (0, 2961, 4928, 5440) ... Node 0, zone DMA32 pages free 757955 min 1129 low 1887 high 2645 spanned 1044480 present 782303 managed 758116 protection: (0, 0, 1967, 2479) ... Node 0, zone Normal pages free 459806 min 750 low 1253 high 1756 spanned 524288 present 524288 managed 503620 protection: (0, 0, 0, 4096) ... Node 0, zone Movable pages free 130759 min 195 low 326 high 457 spanned 1966079 present 131072 managed 131072 protection: (0, 0, 0, 0) ... Node 1, zone DMA pages free 0 min 0 low 0 high 0 spanned 0 present 0 managed 0 protection: (0, 0, 1006, 1006) Node 1, zone DMA32 pages free 0 min 0 low 0 high 0 spanned 0 present 0 managed 0 protection: (0, 0, 1006, 1006) Node 1, zone Normal per-node stats ... pages free 233277 min 383 low 640 high 897 spanned 262144 present 262144 managed 257744 protection: (0, 0, 0, 0) ... Node 1, zone Movable pages free 0 min 0 low 0 high 0 spanned 262144 present 0 managed 0 protection: (0, 0, 0, 0) - static min watermark for the NORMAL zone on node 0 is 750. - lowmem reserve for the request with classzone idx 3 at the NORMAL on node 0 is 4096. - lowmem reserve for the request with classzone idx 2 at the NORMAL on node 0 is 0. So, overall min watermark is: allocation initiated on node 0 (classzone_idx 3): 750 + 4096 = 4846 allocation initiated on node 1 (classzone_idx 2): 750 + 0 = 750 Allocation initiated on node 1 will have some precedence than allocation initiated on node 0 because min watermark of the former allocation is lower than the other. So, allocation initiated on node 1 could succeed on node 0 when allocation initiated on node 0 could not, and, this could cause too many numa_miss allocation. Then, performance could be downgraded. Recently, there was a regression report about this problem on CMA patches since CMA memory are placed in ZONE_MOVABLE by those patches. I checked that problem is disappeared with this fix that uses high_zoneidx for classzone_idx. http://lkml.kernel.org/r/20180102063528.GG30397@yexl-desktop Using high_zoneidx for classzone_idx is more consistent way than previous approach because system's memory layout doesn't affect anything to it. With this patch, both classzone_idx on above example will be 3 so will have the same min watermark. allocation initiated on node 0: 750 + 4096 = 4846 allocation initiated on node 1: 750 + 4096 = 4846 One could wonder if there is a side effect that allocation initiated on node 1 will use higher bar when allocation is handled on local since classzone_idx could be higher than before. It will not happen because the zone without managed page doesn't contributes lowmem_reserve at all. Reported-by: Ye Xiaolong Signed-off-by: Joonsoo Kim Signed-off-by: Andrew Morton Tested-by: Ye Xiaolong Reviewed-by: Baoquan He Acked-by: Vlastimil Babka Acked-by: David Rientjes Cc: Johannes Weiner Cc: Michal Hocko Cc: Minchan Kim Cc: Mel Gorman Link: http://lkml.kernel.org/r/1587095923-7515-1-git-send-email-iamjoonsoo.kim@lge.com Link: http://lkml.kernel.org/r/1587095923-7515-2-git-send-email-iamjoonsoo.kim@lge.com Signed-off-by: Linus Torvalds commit 26e7deadaae1755faf1f6d1a68988c4b8348df59 Author: Baoquan He Date: Wed Jun 3 15:58:55 2020 -0700 mm/vmstat.c: do not show lowmem reserve protection information of empty zone Because the lowmem reserve protection of a zone can't tell anything if the zone is empty, except of adding one more line in /proc/zoneinfo. Let's remove it from that zone's showing. Signed-off-by: Baoquan He Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200402140113.3696-4-bhe@redhat.com Signed-off-by: Linus Torvalds commit f63661566fad43c0884ad879e6ff07c55ed890f4 Author: Baoquan He Date: Wed Jun 3 15:58:52 2020 -0700 mm/page_alloc.c: clear out zone->lowmem_reserve[] if the zone is empty When requesting memory allocation from a specific zone is not satisfied, it will fall to lower zone to try allocating memory. In this case, lower zone's ->lowmem_reserve[] will help protect its own memory resource. The higher the relevant ->lowmem_reserve[] is, the harder the upper zone can get memory from this lower zone. However, this protection mechanism should be applied to populated zone, but not an empty zone. So filling ->lowmem_reserve[] for empty zone is not necessary, and may mislead people that it's valid data in that zone. Node 2, zone DMA pages free 0 min 0 low 0 high 0 spanned 0 present 0 managed 0 protection: (0, 0, 1024, 1024) Node 2, zone DMA32 pages free 0 min 0 low 0 high 0 spanned 0 present 0 managed 0 protection: (0, 0, 1024, 1024) Node 2, zone Normal per-node stats nr_inactive_anon 0 nr_active_anon 143 nr_inactive_file 0 nr_active_file 0 nr_unevictable 0 nr_slab_reclaimable 45 nr_slab_unreclaimable 254 Here clear out zone->lowmem_reserve[] if zone is empty. Signed-off-by: Baoquan He Signed-off-by: Andrew Morton Link: http://lkml.kernel.org/r/20200402140113.3696-3-bhe@redhat.com Signed-off-by: Linus Torvalds commit 86aaf255437af88c0ff5d20a3c98e2b42fb0beda Author: Baoquan He Date: Wed Jun 3 15:58:48 2020 -0700 mm/page_alloc.c: only tune sysctl_lowmem_reserve_ratio value once when changing it Patch series "improvements about lowmem_reserve and /proc/zoneinfo", v2. This patch (of 3): When people write to /proc/sys/vm/lowmem_reserve_ratio to change sysctl_lowmem_reserve_ratio[], setup_per_zone_lowmem_reserve() is called to recalculate all ->lowmem_reserve[] for each zone of all nodes as below: static void setup_per_zone_lowmem_reserve(void) { ... for_each_online_pgdat(pgdat) { for (j = 0; j < MAX_NR_ZONES; j++) { ... while (idx) { ... if (sysctl_lowmem_reserve_ratio[idx] < 1) { sysctl_lowmem_reserve_ratio[idx] = 0; lower_zone->lowmem_reserve[j] = 0; } else { ... } } } } Meanwhile, here, sysctl_lowmem_reserve_ratio[idx] will be tuned if its value is smaller than '1'. As we know, sysctl_lowmem_reserve_ratio[] is set for zone without regarding to which node it belongs to. That means the tuning will be done on all nodes, even though it has been done in the first node. And the tuning will be done too even when init_per_zone_wmark_min() calls setup_per_zone_lowmem_reserve(), where actually nobody tries to change sysctl_lowmem_reserve_ratio[]. So now move the tuning into lowmem_reserve_ratio_sysctl_handler(), to make code logic more reasonable. Signed-off-by: Baoquan He Signed-off-by: Andrew Morton Cc: Joonsoo Kim Cc: Michal Hocko Cc: Baoquan He Cc: Mel Gorman Cc: David Rientjes Link: http://lkml.kernel.org/r/20200402140113.3696-1-bhe@redhat.com Link: http://lkml.kernel.org/r/20200402140113.3696-2-bhe@redhat.com Signed-off-by: Linus Torvalds commit 4ca7be24eeb3198dffdae9472d7464c8b8cadadb Author: Baoquan He Date: Wed Jun 3 15:58:45 2020 -0700 mm/page_alloc.c: remove unused free_bootmem_with_active_regions Since commit 397dc00e249ec64e10 ("mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM"), the last caller of free_bootmem_with_active_regions() was gone. Now no user calls it any more. Let's remove it. Signed-off-by: Baoquan He Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Link: http://lkml.kernel.org/r/20200402143455.5145-1-bhe@redhat.com Signed-off-by: Linus Torvalds commit 16867664936e32423375bf44d240f440fff194cb Author: Roman Gushchin Date: Wed Jun 3 15:58:42 2020 -0700 mm,page_alloc,cma: conditionally prefer cma pageblocks for movable allocations Currently a cma area is barely used by the page allocator because it's used only as a fallback from movable, however kswapd tries hard to make sure that the fallback path isn't used. This results in a system evicting memory and pushing data into swap, while lots of CMA memory is still available. This happens despite the fact that alloc_contig_range is perfectly capable of moving any movable allocations out of the way of an allocation. To effectively use the cma area let's alter the rules: if the zone has more free cma pages than the half of total free pages in the zone, use cma pageblocks first and fallback to movable blocks in the case of failure. [guro@fb.com: ifdef the cma-specific code] Link: http://lkml.kernel.org/r/20200311225832.GA178154@carbon.DHCP.thefacebook.com Co-developed-by: Rik van Riel Signed-off-by: Roman Gushchin Signed-off-by: Rik van Riel Signed-off-by: Andrew Morton Acked-by: Vlastimil Babka Acked-by: Minchan Kim Cc: Qian Cai Cc: Mel Gorman Cc: Anshuman Khandual Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200306150102.3e77354b@imladris.surriel.com Signed-off-by: Linus Torvalds commit 58b7f1194fe1e188a1687e45c3475a98906aae4b Author: Wei Yang Date: Wed Jun 3 15:58:39 2020 -0700 mm/page_alloc.c: extract check_[new|free]_page_bad() common part to page_bad_reason() We share similar code in check_[new|free]_page_bad() to get the page's bad reason. Let's extract it and reduce code duplication. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Cc: David Rientjes Cc: Anshuman Khandual Cc: David Hildenbrand Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200411220357.9636-6-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 534fe5e3c44f93ddd9daf7bb59ec2950583d0522 Author: Wei Yang Date: Wed Jun 3 15:58:36 2020 -0700 mm/page_alloc.c: rename free_pages_check() to check_free_page() free_pages_check() is the counterpart of check_new_page(). Rename it to use the same naming convention. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Cc: Anshuman Khandual Cc: David Hildenbrand Cc: David Rientjes Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200411220357.9636-5-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 0d0c48a274d5beeeb42b904caacea01564d3222b Author: Wei Yang Date: Wed Jun 3 15:58:33 2020 -0700 mm/page_alloc.c: rename free_pages_check_bad() to check_free_page_bad() free_pages_check_bad() is the counterpart of check_new_page_bad(). Rename it to use the same naming convention. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Cc: Anshuman Khandual Cc: David Hildenbrand Cc: David Rientjes Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200411220357.9636-4-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 82a3241a8f76cca20862c16693afc13fcc4622c6 Author: Wei Yang Date: Wed Jun 3 15:58:29 2020 -0700 mm/page_alloc.c: bad_flags is not necessary for bad_page() After commit 5b57b8f22709 ("mm/debug.c: always print flags in dump_page()"), page->flags is always printed for a bad page. It is not necessary to have bad_flags any more. Suggested-by: Anshuman Khandual Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Cc: David Hildenbrand Cc: David Rientjes Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200411220357.9636-3-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 833d8a426f78f19b166d93bda0569d3d6d507dba Author: Wei Yang Date: Wed Jun 3 15:58:26 2020 -0700 mm/page_alloc.c: bad_[reason|flags] is not necessary when PageHWPoison Patch series "mm/page_alloc.c: cleanup on check page", v3. This patchset does some cleanup related to check page. 1. Remove unnecessary bad_reason assignment 2. Remove bad_flags to bad_page() 3. Rename function for naming convention 4. Extract common part to check page Thanks for suggestions from David Rientjes and Anshuman Khandual. This patch (of 5): Since function returns directly, bad_[reason|flags] is not used any where. And move this to the first. This is a following cleanup for commit e570f56cccd21 ("mm: check_new_page_bad() directly returns in __PG_HWPOISON case") Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Cc: Anshuman Khandual Cc: David Rientjes Link: http://lkml.kernel.org/r/20200411220357.9636-2-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 237e506cd5af254fbc3be560d57c29163133aaf6 Author: Mike Rapoport Date: Wed Jun 3 15:58:22 2020 -0700 docs/vm: update memory-models documentation To reflect the updates to free_area_init() family of functions. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-22-rppt@kernel.org Signed-off-by: Linus Torvalds commit 8a1b25fe3ce49f7c0ad562fa294ac7f93731bd3a Author: Mike Rapoport Date: Wed Jun 3 15:58:18 2020 -0700 mm: simplify find_min_pfn_with_active_regions() find_min_pfn_with_active_regions() calls find_min_pfn_for_node() with nid parameter set to MAX_NUMNODES. This makes the find_min_pfn_for_node() traverse all memblock memory regions although the first PFN in the system can be easily found with memblock_start_of_DRAM(). Use memblock_start_of_DRAM() in find_min_pfn_with_active_regions() and drop now unused find_min_pfn_for_node(). Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-21-rppt@kernel.org Signed-off-by: Linus Torvalds commit 854e8848c5841b4199a70f1838f55999cecbf3b6 Author: Mike Rapoport Date: Wed Jun 3 15:58:13 2020 -0700 mm: clean up free_area_init_node() and its helpers free_area_init_node() now always uses memblock info and the zone PFN limits so it does not need the backwards compatibility functions to calculate the zone spanned and absent pages. The removal of the compat_ versions of zone_{abscent,spanned}_pages_in_node() in turn, makes zone_size and zhole_size parameters unused. The node_start_pfn is determined by get_pfn_range_for_nid(), so there is no need to pass it to free_area_init_node(). As a result, the only required parameter to free_area_init_node() is the node ID, all the rest are removed along with no longer used compat_zone_{abscent,spanned}_pages_in_node() helpers. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-20-rppt@kernel.org Signed-off-by: Linus Torvalds commit bc9331a19d758706493cbebba67ca70382edddac Author: Mike Rapoport Date: Wed Jun 3 15:58:09 2020 -0700 mm: rename free_area_init_node() to free_area_init_memoryless_node() free_area_init_node() is only used by x86 to initialize a memory-less nodes. Make its name reflect this and drop all the function parameters except node ID as they are anyway zero. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-19-rppt@kernel.org Signed-off-by: Linus Torvalds commit 51930df5801e4da60e962ea52b811634d257a148 Author: Mike Rapoport Date: Wed Jun 3 15:58:03 2020 -0700 mm: free_area_init: allow defining max_zone_pfn in descending order Some architectures (e.g. ARC) have the ZONE_HIGHMEM zone below the ZONE_NORMAL. Allowing free_area_init() parse max_zone_pfn array even it is sorted in descending order allows using free_area_init() on such architectures. Add top -> down traversal of max_zone_pfn array in free_area_init() and use the latter in ARC node/zone initialization. [rppt@kernel.org: ARC fix] Link: http://lkml.kernel.org/r/20200504153901.GM14260@kernel.org [rppt@linux.ibm.com: arc: free_area_init(): take into account PAE40 mode] Link: http://lkml.kernel.org/r/20200507205900.GH683243@linux.ibm.com [akpm@linux-foundation.org: declare arch_has_descending_max_zone_pfns()] Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Reviewed-by: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Cc: Guenter Roeck Link: http://lkml.kernel.org/r/20200412194859.12663-18-rppt@kernel.org Signed-off-by: Linus Torvalds commit acd3f5c441e9635857f02a7c21e7dd590dcf672e Author: Mike Rapoport Date: Wed Jun 3 15:57:59 2020 -0700 mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES The memmap_init() function was made to iterate over memblock regions and as the result the early_pfn_in_nid() function became obsolete. Since CONFIG_NODES_SPAN_OTHER_NODES is only used to pick a stub or a real implementation of early_pfn_in_nid(), it is also not needed anymore. Remove both early_pfn_in_nid() and the CONFIG_NODES_SPAN_OTHER_NODES. Co-developed-by: Hoan Tran Signed-off-by: Hoan Tran Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-17-rppt@kernel.org Signed-off-by: Linus Torvalds commit 73a6e474cb376921a311786652782155eac2fdf0 Author: Baoquan He Date: Wed Jun 3 15:57:55 2020 -0700 mm: memmap_init: iterate over memblock regions rather that check each PFN When called during boot the memmap_init_zone() function checks if each PFN is valid and actually belongs to the node being initialized using early_pfn_valid() and early_pfn_in_nid(). Each such check may cost up to O(log(n)) where n is the number of memory banks, so for large amount of memory overall time spent in early_pfn*() becomes substantial. Since the information is anyway present in memblock, we can iterate over memblock memory regions in memmap_init() and only call memmap_init_zone() for PFN ranges that are know to be valid and in the appropriate node. [cai@lca.pw: fix a compilation warning from Clang] Link: http://lkml.kernel.org/r/CF6E407F-17DC-427C-8203-21979FB882EF@lca.pw [bhe@redhat.com: fix the incorrect hole in fast_isolate_freepages()] Link: http://lkml.kernel.org/r/8C537EB7-85EE-4DCF-943E-3CC0ED0DF56D@lca.pw Link: http://lkml.kernel.org/r/20200521014407.29690-1-bhe@redhat.com Signed-off-by: Baoquan He Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Cc: Qian Cai Link: http://lkml.kernel.org/r/20200412194859.12663-16-rppt@kernel.org Signed-off-by: Linus Torvalds commit da50c57bdbb8e37ec6f8c934a2f8acbf4e4fdfb9 Author: Mike Rapoport Date: Wed Jun 3 15:57:50 2020 -0700 xtensa: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-15-rppt@kernel.org Signed-off-by: Linus Torvalds commit 1b02ec0180b93b0e98a1c45bea3cfde39ff609bf Author: Mike Rapoport Date: Wed Jun 3 15:57:46 2020 -0700 unicore32: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-14-rppt@kernel.org Signed-off-by: Linus Torvalds commit bee3b3ccb10c8c950b71df011d9511ac15b78e6a Author: Mike Rapoport Date: Wed Jun 3 15:57:41 2020 -0700 sparc32: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-13-rppt@kernel.org Signed-off-by: Linus Torvalds commit 625bf73ed27f337ccc7d750087423df679a7f733 Author: Mike Rapoport Date: Wed Jun 3 15:57:37 2020 -0700 parisc: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-12-rppt@kernel.org Signed-off-by: Linus Torvalds commit 5d2ee1a17f344de60231e98a2c87d8364a985830 Author: Mike Rapoport Date: Wed Jun 3 15:57:32 2020 -0700 m68k: mm: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-11-rppt@kernel.org Signed-off-by: Linus Torvalds commit 8f4693f0e0f5e9f64d02a300afd12efda5b50f95 Author: Mike Rapoport Date: Wed Jun 3 15:57:28 2020 -0700 csky: simplify detection of memory zone boundaries The free_area_init() function only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-10-rppt@kernel.org Signed-off-by: Linus Torvalds commit 584cb13dca27be144a54f9e0b0d71f3db61130a2 Author: Mike Rapoport Date: Wed Jun 3 15:57:23 2020 -0700 arm64: simplify detection of memory zone boundaries for UMA configs The free_area_init() function only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Acked-by: Catalin Marinas Cc: Baoquan He Cc: Brian Cain Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-9-rppt@kernel.org Signed-off-by: Linus Torvalds commit a32c1c61212d93a8fa5bab56605982d2451852bb Author: Mike Rapoport Date: Wed Jun 3 15:57:19 2020 -0700 arm: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-8-rppt@kernel.org Signed-off-by: Linus Torvalds commit 307602036ba1795237361fe73e3c13628469c0cb Author: Mike Rapoport Date: Wed Jun 3 15:57:15 2020 -0700 alpha: simplify detection of memory zone boundaries free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Cc: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-7-rppt@kernel.org Signed-off-by: Linus Torvalds commit 9691a071aa26a21fc8dac804a2b98d3c24f76f9a Author: Mike Rapoport Date: Wed Jun 3 15:57:10 2020 -0700 mm: use free_area_init() instead of free_area_init_nodes() free_area_init() has effectively became a wrapper for free_area_init_nodes() and there is no point of keeping it. Still free_area_init() name is shorter and more general as it does not imply necessity to initialize multiple nodes. Rename free_area_init_nodes() to free_area_init(), update the callers and drop old version of free_area_init(). Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Reviewed-by: Baoquan He Acked-by: Catalin Marinas Cc: Brian Cain Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-6-rppt@kernel.org Signed-off-by: Linus Torvalds commit fa3354e4ea39e97af906c05551a36396541d70b4 Author: Mike Rapoport Date: Wed Jun 3 15:57:06 2020 -0700 mm: free_area_init: use maximal zone PFNs rather than zone sizes Currently, architectures that use free_area_init() to initialize memory map and node and zone structures need to calculate zone and hole sizes. We can use free_area_init_nodes() instead and let it detect the zone boundaries while the architectures will only have to supply the possible limits for the zones. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Reviewed-by: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-5-rppt@kernel.org Signed-off-by: Linus Torvalds commit 3f08a302f533f74ad2e909e7a61274aa7eebc0ab Author: Mike Rapoport Date: Wed Jun 3 15:57:02 2020 -0700 mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option CONFIG_HAVE_MEMBLOCK_NODE_MAP is used to differentiate initialization of nodes and zones structures between the systems that have region to node mapping in memblock and those that don't. Currently all the NUMA architectures enable this option and for the non-NUMA systems we can presume that all the memory belongs to node 0 and therefore the compile time configuration option is not required. The remaining few architectures that use DISCONTIGMEM without NUMA are easily updated to use memblock_add_node() instead of memblock_add() and thus have proper correspondence of memblock regions to NUMA nodes. Still, free_area_init_node() must have a backward compatible version because its semantics with and without CONFIG_HAVE_MEMBLOCK_NODE_MAP is different. Once all the architectures will use the new semantics, the entire compatibility layer can be dropped. To avoid addition of extra run time memory to store node id for architectures that keep memblock but have only a single node, the node id field of the memblock_region is guarded by CONFIG_NEED_MULTIPLE_NODES and the corresponding accessors presume that in those cases it is always 0. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Acked-by: Catalin Marinas [arm64] Cc: Baoquan He Cc: Brian Cain Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-4-rppt@kernel.org Signed-off-by: Linus Torvalds commit 6f24fbd38c4e05f7905814791806c01dc6c4b9de Author: Mike Rapoport Date: Wed Jun 3 15:56:57 2020 -0700 mm: make early_pfn_to_nid() and related defintions close to each other early_pfn_to_nid() and its helper __early_pfn_to_nid() are spread around include/linux/mm.h, include/linux/mmzone.h and mm/page_alloc.c. Drop unused stub for __early_pfn_to_nid() and move its actual generic implementation close to its users. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Reviewed-by: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-3-rppt@kernel.org Signed-off-by: Linus Torvalds commit d622abf74f3d81365e41c3bfdbbda50ecd99ba3d Author: Mike Rapoport Date: Wed Jun 3 15:56:53 2020 -0700 mm: memblock: replace dereferences of memblock_region.nid with API calls Patch series "mm: rework free_area_init*() funcitons". After the discussion [1] about removal of CONFIG_NODES_SPAN_OTHER_NODES and CONFIG_HAVE_MEMBLOCK_NODE_MAP options, I took it a bit further and updated the node/zone initialization. Since all architectures have memblock, it is possible to use only the newer version of free_area_init_node() that calculates the zone and node boundaries based on memblock node mapping and architectural limits on possible zone PFNs. The architectures that still determined zone and hole sizes can be switched to the generic code and the old code that took those zone and hole sizes can be simply removed. And, since it all started from the removal of CONFIG_NODES_SPAN_OTHER_NODES, the memmap_init() is now updated to iterate over memblocks and so it does not need to perform early_pfn_to_nid() query for every PFN. [1] https://lore.kernel.org/lkml/1585420282-25630-1-git-send-email-Hoan@os.amperecomputing.com This patch (of 21): There are several places in the code that directly dereference memblock_region.nid despite this field being defined only when CONFIG_HAVE_MEMBLOCK_NODE_MAP=y. Replace these with calls to memblock_get_region_nid() to improve code robustness and to avoid possible breakage when CONFIG_HAVE_MEMBLOCK_NODE_MAP will be removed. Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Tested-by: Hoan Tran [arm64] Reviewed-by: Baoquan He Cc: Brian Cain Cc: Catalin Marinas Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: Ley Foon Tan Cc: Mark Salter Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Hocko Cc: Michal Simek Cc: Mike Rapoport Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Tony Luck Cc: Vineet Gupta Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/20200412194859.12663-1-rppt@kernel.org Link: http://lkml.kernel.org/r/20200412194859.12663-2-rppt@kernel.org Signed-off-by: Linus Torvalds commit 574c1ae66c12410a08aeef8474936baa50e0371d Author: Michal Hocko Date: Wed Jun 3 15:56:49 2020 -0700 mm: clarify __GFP_MEMALLOC usage It seems that the existing documentation is not explicit about the expected usage and potential risks enough. While it is calls out that users have to free memory when using this flag it is not really apparent that users have to careful to not deplete memory reserves and that they should implement some sort of throttling wrt. freeing process. This is partly based on Neil's explanation [1]. Let's also call out that a pre allocated pool allocator should be considered. [1] http://lkml.kernel.org/r/877dz0yxoa.fsf@notabene.neil.brown.name [akpm@linux-foundation.org: coding style fixes] [mhocko@kernel.org: update] Link: http://lkml.kernel.org/r/20200406070137.GC19426@dhcp22.suse.cz Signed-off-by: Michal Hocko Signed-off-by: Andrew Morton Cc: David Rientjes Cc: Joel Fernandes Cc: Neil Brown Cc: Paul E. McKenney Cc: John Hubbard Link: http://lkml.kernel.org/r/20200403083543.11552-2-mhocko@kernel.org Signed-off-by: Linus Torvalds commit 47227d27e2fcb01a9e8f5958d8997cf47a820afc Author: Daniel Axtens Date: Wed Jun 3 15:56:46 2020 -0700 string.h: fix incompatibility between FORTIFY_SOURCE and KASAN The memcmp KASAN self-test fails on a kernel with both KASAN and FORTIFY_SOURCE. When FORTIFY_SOURCE is on, a number of functions are replaced with fortified versions, which attempt to check the sizes of the operands. However, these functions often directly invoke __builtin_foo() once they have performed the fortify check. Using __builtins may bypass KASAN checks if the compiler decides to inline it's own implementation as sequence of instructions, rather than emit a function call that goes out to a KASAN-instrumented implementation. Why is only memcmp affected? ============================ Of the string and string-like functions that kasan_test tests, only memcmp is replaced by an inline sequence of instructions in my testing on x86 with gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2). I believe this is due to compiler heuristics. For example, if I annotate kmalloc calls with the alloc_size annotation (and disable some fortify compile-time checking!), the compiler will replace every memset except the one in kmalloc_uaf_memset with inline instructions. (I have some WIP patches to add this annotation.) Does this affect other functions in string.h? ============================================= Yes. Anything that uses __builtin_* rather than __real_* could be affected. This looks like: - strncpy - strcat - strlen - strlcpy maybe, under some circumstances? - strncat under some circumstances - memset - memcpy - memmove - memcmp (as noted) - memchr - strcpy Whether a function call is emitted always depends on the compiler. Most bugs should get caught by FORTIFY_SOURCE, but the missed memcmp test shows that this is not always the case. Isn't FORTIFY_SOURCE disabled with KASAN? ========================================- The string headers on all arches supporting KASAN disable fortify with kasan, but only when address sanitisation is _also_ disabled. For example from x86: #if defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__) /* * For files that are not instrumented (e.g. mm/slub.c) we * should use not instrumented version of mem* functions. */ #define memcpy(dst, src, len) __memcpy(dst, src, len) #define memmove(dst, src, len) __memmove(dst, src, len) #define memset(s, c, n) __memset(s, c, n) #ifndef __NO_FORTIFY #define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */ #endif #endif This comes from commit 6974f0c4555e ("include/linux/string.h: add the option of fortified string.h functions"), and doesn't work when KASAN is enabled and the file is supposed to be sanitised - as with test_kasan.c I'm pretty sure this is not wrong, but not as expansive it should be: * we shouldn't use __builtin_memcpy etc in files where we don't have instrumentation - it could devolve into a function call to memcpy, which will be instrumented. Rather, we should use __memcpy which by convention is not instrumented. * we also shouldn't be using __builtin_memcpy when we have a KASAN instrumented file, because it could be replaced with inline asm that will not be instrumented. What is correct behaviour? ========================== Firstly, there is some overlap between fortification and KASAN: both provide some level of _runtime_ checking. Only fortify provides compile-time checking. KASAN and fortify can pick up different things at runtime: - Some fortify functions, notably the string functions, could easily be modified to consider sub-object sizes (e.g. members within a struct), and I have some WIP patches to do this. KASAN cannot detect these because it cannot insert poision between members of a struct. - KASAN can detect many over-reads/over-writes when the sizes of both operands are unknown, which fortify cannot. So there are a couple of options: 1) Flip the test: disable fortify in santised files and enable it in unsanitised files. This at least stops us missing KASAN checking, but we lose the fortify checking. 2) Make the fortify code always call out to real versions. Do this only for KASAN, for fear of losing the inlining opportunities we get from __builtin_*. (We can't use kasan_check_{read,write}: because the fortify functions are _extern inline_, you can't include _static_ inline functions without a compiler warning. kasan_check_{read,write} are static inline so we can't use them even when they would otherwise be suitable.) Take approach 2 and call out to real versions when KASAN is enabled. Use __underlying_foo to distinguish from __real_foo: __real_foo always refers to the kernel's implementation of foo, __underlying_foo could be either the kernel implementation or the __builtin_foo implementation. This is sometimes enough to make the memcmp test succeed with FORTIFY_SOURCE enabled. It is at least enough to get the function call into the module. One more fix is needed to make it reliable: see the next patch. Fixes: 6974f0c4555e ("include/linux/string.h: add the option of fortified string.h functions") Signed-off-by: Daniel Axtens Signed-off-by: Andrew Morton Tested-by: David Gow Reviewed-by: Dmitry Vyukov Cc: Daniel Micay Cc: Andrey Ryabinin Cc: Alexander Potapenko Link: http://lkml.kernel.org/r/20200423154503.5103-3-dja@axtens.net Signed-off-by: Linus Torvalds commit adb72ae1915db28f934e9e02c18bfcea2f3ed3b7 Author: Daniel Axtens Date: Wed Jun 3 15:56:43 2020 -0700 kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE Patch series "Fix some incompatibilites between KASAN and FORTIFY_SOURCE", v4. 3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE: memchr, memcmp and strlen. When FORTIFY_SOURCE is on, a number of functions are replaced with fortified versions, which attempt to check the sizes of the operands. However, these functions often directly invoke __builtin_foo() once they have performed the fortify check. The compiler can detect that the results of these functions are not used, and knows that they have no other side effects, and so can eliminate them as dead code. Why are only memchr, memcmp and strlen affected? ================================================ Of string and string-like functions, kasan_test tests: * strchr -> not affected, no fortified version * strrchr -> likewise * strcmp -> likewise * strncmp -> likewise * strnlen -> not affected, the fortify source implementation calls the underlying strnlen implementation which is instrumented, not a builtin * strlen -> affected, the fortify souce implementation calls a __builtin version which the compiler can determine is dead. * memchr -> likewise * memcmp -> likewise * memset -> not affected, the compiler knows that memset writes to its first argument and therefore is not dead. Why does this not affect the functions normally? ================================================ In string.h, these functions are not marked as __pure, so the compiler cannot know that they do not have side effects. If relevant functions are marked as __pure in string.h, we see the following warnings and the functions are elided: lib/test_kasan.c: In function `kasan_memchr': lib/test_kasan.c:606:2: warning: statement with no effect [-Wunused-value] memchr(ptr, '1', size + 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~ lib/test_kasan.c: In function `kasan_memcmp': lib/test_kasan.c:622:2: warning: statement with no effect [-Wunused-value] memcmp(ptr, arr, size+1); ^~~~~~~~~~~~~~~~~~~~~~~~ lib/test_kasan.c: In function `kasan_strings': lib/test_kasan.c:645:2: warning: statement with no effect [-Wunused-value] strchr(ptr, '1'); ^~~~~~~~~~~~~~~~ ... This annotation would make sense to add and could be added at any point, so the behaviour of test_kasan.c should change. The fix ======= Make all the functions that are pure write their results to a global, which makes them live. The strlen and memchr tests now pass. The memcmp test still fails to trigger, which is addressed in the next patch. [dja@axtens.net: drop patch 3] Link: http://lkml.kernel.org/r/20200424145521.8203-2-dja@axtens.net Fixes: 0c96350a2d2f ("lib/test_kasan.c: add tests for several string/memory API functions") Signed-off-by: Daniel Axtens Signed-off-by: Andrew Morton Tested-by: David Gow Reviewed-by: Dmitry Vyukov Cc: Daniel Micay Cc: Andrey Ryabinin Cc: Alexander Potapenko Link: http://lkml.kernel.org/r/20200423154503.5103-1-dja@axtens.net Link: http://lkml.kernel.org/r/20200423154503.5103-2-dja@axtens.net Signed-off-by: Linus Torvalds commit f81cd178ecfd0806c1d2859cfe0a162d80c81a69 Author: John Hubbard Date: Wed Jun 3 15:56:40 2020 -0700 mm/gup: might_lock_read(mmap_sem) in get_user_pages_fast() Instead of scattering these assertions across the drivers, do this assertion inside the core of get_user_pages_fast*() functions. That also includes pin_user_pages_fast*() routines. Add a might_lock_read(mmap_sem) call to internal_get_user_pages_fast(). Suggested-by: Matthew Wilcox Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Matthew Wilcox Cc: Michel Lespinasse Cc: Jason Gunthorpe Link: http://lkml.kernel.org/r/20200522010443.1290485-1-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 2170ecfa768850bb29487baa3101c993ab7d7402 Author: John Hubbard Date: Wed Jun 3 15:56:37 2020 -0700 drm/i915: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Chris Wilson Cc: Souptick Joarder Cc: Matthew Wilcox Cc: Jani Nikula Cc: "Joonas Lahtinen" Cc: Rodrigo Vivi Cc: David Airlie Cc: Daniel Vetter Cc: Tvrtko Ursulin Cc: Matthew Auld Link: http://lkml.kernel.org/r/20200519002124.2025955-5-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 104acc327648b347d1716374586803e82fa1dc95 Author: John Hubbard Date: Wed Jun 3 15:56:34 2020 -0700 mm/gup: introduce pin_user_pages_fast_only() This is the FOLL_PIN equivalent of __get_user_pages_fast(), except with a more descriptive name, and gup_flags instead of a boolean "write" in the argument list. Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Chris Wilson Cc: Daniel Vetter Cc: David Airlie Cc: Jani Nikula Cc: "Joonas Lahtinen" Cc: Matthew Auld Cc: Matthew Wilcox Cc: Rodrigo Vivi Cc: Souptick Joarder Cc: Tvrtko Ursulin Link: http://lkml.kernel.org/r/20200519002124.2025955-4-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 376a34efa4eeb699d285c1a741b186d44b44c429 Author: John Hubbard Date: Wed Jun 3 15:56:30 2020 -0700 mm/gup: refactor and de-duplicate gup_fast() code There were two nearly identical sets of code for gup_fast() style of walking the page tables with interrupts disabled. This has lead to the usual maintenance problems that arise from having duplicated code. There is already a core internal routine in gup.c for gup_fast(), so just enhance it very slightly: allow skipping the fall-back to "slow" (regular) get_user_pages(), via the new FOLL_FAST_ONLY flag. Then, just call internal_get_user_pages_fast() from __get_user_pages_fast(), and adjust the API to match pre-existing API behavior. There is a change in behavior from this refactoring: the nested form of interrupt disabling is used in all gup_fast() variants now. That's because there is only one place that interrupt disabling for page walking is done, and so the safer form is required. This should, if anything, eliminate possible (rare) bugs, because the non-nested form of enabling interrupts was fragile at best. [jhubbard@nvidia.com: fixup] Link: http://lkml.kernel.org/r/20200521233841.1279742-1-jhubbard@nvidia.com Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Chris Wilson Cc: Daniel Vetter Cc: David Airlie Cc: Jani Nikula Cc: "Joonas Lahtinen" Cc: Matthew Auld Cc: Matthew Wilcox Cc: Rodrigo Vivi Cc: Souptick Joarder Cc: Tvrtko Ursulin Link: http://lkml.kernel.org/r/20200519002124.2025955-3-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 9e1f0580d37e0d3fcfc2274128a5cc476feba5d0 Author: John Hubbard Date: Wed Jun 3 15:56:27 2020 -0700 mm/gup: move __get_user_pages_fast() down a few lines in gup.c Patch series "mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()", v2. In order to convert the drm/i915 driver from get_user_pages() to pin_user_pages(), a FOLL_PIN equivalent of __get_user_pages_fast() was required. That led to refactoring __get_user_pages_fast(), with the following goals: 1) As above: provide a pin_user_pages*() routine for drm/i915 to call, in place of __get_user_pages_fast(), 2) Get rid of the gup.c duplicate code for walking page tables with interrupts disabled. This duplicate code is a minor maintenance problem anyway. 3) Make it easy for an upcoming patch from Souptick, which aims to convert __get_user_pages_fast() to use a gup_flags argument, instead of a bool writeable arg. Also, if this series looks good, we can ask Souptick to change the name as well, to whatever the consensus is. My initial recommendation is: get_user_pages_fast_only(), to match the new pin_user_pages_only(). This patch (of 4): This is in order to avoid a forward declaration of internal_get_user_pages_fast(), in the next patch. This is code movement only--all generated code should be identical. Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Chris Wilson Cc: Daniel Vetter Cc: David Airlie Cc: Jani Nikula Cc: "Joonas Lahtinen" Cc: Matthew Auld Cc: Matthew Wilcox Cc: Rodrigo Vivi Cc: Souptick Joarder Cc: Tvrtko Ursulin Link: http://lkml.kernel.org/r/20200522051931.54191-1-jhubbard@nvidia.com Link: http://lkml.kernel.org/r/20200519002124.2025955-1-jhubbard@nvidia.com Link: http://lkml.kernel.org/r/20200519002124.2025955-2-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit dd8657b6c1cb5e65b13445b4a038736e81cf80ea Author: Shakeel Butt Date: Wed Jun 3 15:56:24 2020 -0700 mm/memcg: optimize memory.numa_stat like memory.stat Currently reading memory.numa_stat traverses the underlying memcg tree multiple times to accumulate the stats to present the hierarchical view of the memcg tree. However the kernel already maintains the hierarchical view of the stats and use it in memory.stat. Just use the same mechanism in memory.numa_stat as well. I ran a simple benchmark which reads root_mem_cgroup's memory.numa_stat file in the presense of 10000 memcgs. The results are: Without the patch: $ time cat /dev/cgroup/memory/memory.numa_stat > /dev/null real 0m0.700s user 0m0.001s sys 0m0.697s With the patch: $ time cat /dev/cgroup/memory/memory.numa_stat > /dev/null real 0m0.001s user 0m0.001s sys 0m0.000s [akpm@linux-foundation.org: avoid forcing out-of-line code generation] Signed-off-by: Shakeel Butt Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Acked-by: Johannes Weiner Cc: Roman Gushchin Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200304022058.248270-1-shakeelb@google.com Signed-off-by: Linus Torvalds commit dde3c6b72a16c2db826f54b2d49bdea26c3534a2 Author: Wang Hai Date: Wed Jun 3 15:56:21 2020 -0700 mm/slub: fix a memory leak in sysfs_slab_add() syzkaller reports for memory leak when kobject_init_and_add() returns an error in the function sysfs_slab_add() [1] When this happened, the function kobject_put() is not called for the corresponding kobject, which potentially leads to memory leak. This patch fixes the issue by calling kobject_put() even if kobject_init_and_add() fails. [1] BUG: memory leak unreferenced object 0xffff8880a6d4be88 (size 8): comm "syz-executor.3", pid 946, jiffies 4295772514 (age 18.396s) hex dump (first 8 bytes): 70 69 64 5f 33 00 ff ff pid_3... backtrace: kstrdup+0x35/0x70 mm/util.c:60 kstrdup_const+0x3d/0x50 mm/util.c:82 kvasprintf_const+0x112/0x170 lib/kasprintf.c:48 kobject_set_name_vargs+0x55/0x130 lib/kobject.c:289 kobject_add_varg lib/kobject.c:384 [inline] kobject_init_and_add+0xd8/0x170 lib/kobject.c:473 sysfs_slab_add+0x1d8/0x290 mm/slub.c:5811 __kmem_cache_create+0x50a/0x570 mm/slub.c:4384 create_cache+0x113/0x1e0 mm/slab_common.c:407 kmem_cache_create_usercopy+0x1a1/0x260 mm/slab_common.c:505 kmem_cache_create+0xd/0x10 mm/slab_common.c:564 create_pid_cachep kernel/pid_namespace.c:54 [inline] create_pid_namespace kernel/pid_namespace.c:96 [inline] copy_pid_ns+0x77c/0x8f0 kernel/pid_namespace.c:148 create_new_namespaces+0x26b/0xa30 kernel/nsproxy.c:95 unshare_nsproxy_namespaces+0xa7/0x1e0 kernel/nsproxy.c:229 ksys_unshare+0x3d2/0x770 kernel/fork.c:2969 __do_sys_unshare kernel/fork.c:3037 [inline] __se_sys_unshare kernel/fork.c:3035 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3035 do_syscall_64+0xa1/0x530 arch/x86/entry/common.c:295 Fixes: 80da026a8e5d ("mm/slub: fix slab double-free in case of duplicate sysfs filename") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Andrew Morton Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200602115033.1054-1-wanghai38@huawei.com Signed-off-by: Linus Torvalds commit c444eb564fb16645c172d550359cb3d75fe8a040 Author: Andrea Arcangeli Date: Wed May 27 19:06:24 2020 -0400 mm: thp: make the THP mapcount atomic against __split_huge_pmd_locked() Write protect anon page faults require an accurate mapcount to decide if to break the COW or not. This is implemented in the THP path with reuse_swap_page() -> page_trans_huge_map_swapcount()/page_trans_huge_mapcount(). If the COW triggers while the other processes sharing the page are under a huge pmd split, to do an accurate reading, we must ensure the mapcount isn't computed while it's being transferred from the head page to the tail pages. reuse_swap_cache() already runs serialized by the page lock, so it's enough to add the page lock around __split_huge_pmd_locked too, in order to add the missing serialization. Note: the commit in "Fixes" is just to facilitate the backporting, because the code before such commit didn't try to do an accurate THP mapcount calculation and it instead used the page_count() to decide if to COW or not. Both the page_count and the pin_count are THP-wide refcounts, so they're inaccurate if used in reuse_swap_page(). Reverting such commit (besides the unrelated fix to the local anon_vma assignment) would have also opened the window for memory corruption side effects to certain workloads as documented in such commit header. Signed-off-by: Andrea Arcangeli Suggested-by: Jann Horn Reported-by: Jann Horn Acked-by: Kirill A. Shutemov Fixes: 6d0a07edd17c ("mm: thp: calculate the mapcount correctly for THP pages during WP faults") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit daceabf1b494c9e40a93fcc323b1258f557f65a1 Author: Tom Zanussi Date: Wed Jun 3 10:21:24 2020 -0500 tracing/doc: Fix ascii-art in histogram-design.rst This fixes the Sphinx parallel build error when building htmldocs: docutils.utils.SystemMessage: /home/sfr/next/next/Documentation/trace/histogram-design.rst:219: (SEVERE/4) Unexpected section title. It also fixes a bunch of other warnings I noticed when fixing the above, caused by mixing ascii-art and text. Link: https://lkml.kernel.org/r/69c291c76964642a417e5dd170d183ba6b552010.camel@kernel.org Reported-by: Stephen Rothwell Tested-by: Stephen Rothwell Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit cb8e59cc87201af93dfbb6c3dccc8fcad72a09c2 Merge: 2e63f6ce7ed2 065fcfd49763 Author: Linus Torvalds Date: Wed Jun 3 16:27:18 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from David Miller: 1) Allow setting bluetooth L2CAP modes via socket option, from Luiz Augusto von Dentz. 2) Add GSO partial support to igc, from Sasha Neftin. 3) Several cleanups and improvements to r8169 from Heiner Kallweit. 4) Add IF_OPER_TESTING link state and use it when ethtool triggers a device self-test. From Andrew Lunn. 5) Start moving away from custom driver versions, use the globally defined kernel version instead, from Leon Romanovsky. 6) Support GRO vis gro_cells in DSA layer, from Alexander Lobakin. 7) Allow hard IRQ deferral during NAPI, from Eric Dumazet. 8) Add sriov and vf support to hinic, from Luo bin. 9) Support Media Redundancy Protocol (MRP) in the bridging code, from Horatiu Vultur. 10) Support netmap in the nft_nat code, from Pablo Neira Ayuso. 11) Allow UDPv6 encapsulation of ESP in the ipsec code, from Sabrina Dubroca. Also add ipv6 support for espintcp. 12) Lots of ReST conversions of the networking documentation, from Mauro Carvalho Chehab. 13) Support configuration of ethtool rxnfc flows in bcmgenet driver, from Doug Berger. 14) Allow to dump cgroup id and filter by it in inet_diag code, from Dmitry Yakunin. 15) Add infrastructure to export netlink attribute policies to userspace, from Johannes Berg. 16) Several optimizations to sch_fq scheduler, from Eric Dumazet. 17) Fallback to the default qdisc if qdisc init fails because otherwise a packet scheduler init failure will make a device inoperative. From Jesper Dangaard Brouer. 18) Several RISCV bpf jit optimizations, from Luke Nelson. 19) Correct the return type of the ->ndo_start_xmit() method in several drivers, it's netdev_tx_t but many drivers were using 'int'. From Yunjian Wang. 20) Add an ethtool interface for PHY master/slave config, from Oleksij Rempel. 21) Add BPF iterators, from Yonghang Song. 22) Add cable test infrastructure, including ethool interfaces, from Andrew Lunn. Marvell PHY driver is the first to support this facility. 23) Remove zero-length arrays all over, from Gustavo A. R. Silva. 24) Calculate and maintain an explicit frame size in XDP, from Jesper Dangaard Brouer. 25) Add CAP_BPF, from Alexei Starovoitov. 26) Support terse dumps in the packet scheduler, from Vlad Buslov. 27) Support XDP_TX bulking in dpaa2 driver, from Ioana Ciornei. 28) Add devm_register_netdev(), from Bartosz Golaszewski. 29) Minimize qdisc resets, from Cong Wang. 30) Get rid of kernel_getsockopt and kernel_setsockopt in order to eliminate set_fs/get_fs calls. From Christoph Hellwig. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2517 commits) selftests: net: ip_defrag: ignore EPERM net_failover: fixed rollback in net_failover_open() Revert "tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv" Revert "tipc: Fix potential tipc_node refcnt leak in tipc_rcv" vmxnet3: allow rx flow hash ops only when rss is enabled hinic: add set_channels ethtool_ops support selftests/bpf: Add a default $(CXX) value tools/bpf: Don't use $(COMPILE.c) bpf, selftests: Use bpf_probe_read_kernel s390/bpf: Use bcr 0,%0 as tail call nop filler s390/bpf: Maintain 8-byte stack alignment selftests/bpf: Fix verifier test selftests/bpf: Fix sample_cnt shared between two threads bpf, selftests: Adapt cls_redirect to call csum_level helper bpf: Add csum_level helper for fixing up csum levels bpf: Fix up bpf_skb_adjust_room helper's skb csum setting sfc: add missing annotation for efx_ef10_try_update_nic_stats_vf() crypto/chtls: IPv6 support for inline TLS Crypto/chcr: Fixes a coccinile check error Crypto/chcr: Fixes compilations warnings ... commit 2e63f6ce7ed2c4ff83ba30ad9ccad422289a6c63 Merge: ae03c53d005e bac42fb21259 Author: Linus Torvalds Date: Wed Jun 3 15:55:45 2020 -0700 Merge branch 'uaccess.comedi' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull comedi uaccess cleanups from Al Viro: "Comedi compat ioctls done saner - killing the single biggest pile of __get_user/__put_user outside of arch/* in the process" * 'uaccess.comedi' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: comedi: get rid of compat_alloc_user_space() mess in COMEDI_CMD{,TEST} compat comedi: do_cmd_ioctl(): lift copyin/copyout into the caller comedi: do_cmdtest_ioctl(): lift copyin/copyout into the caller comedi: lift copy_from_user() into callers of __comedi_get_user_cmd() comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSNLIST compat comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSN compat comedi: get rid of compat_alloc_user_space() mess in COMEDI_RANGEINFO compat comedi: get rid of compat_alloc_user_space() mess in COMEDI_CHANINFO compat comedi: get rid of indirection via translated_ioctl() comedi: move compat ioctl handling to native fops commit ae03c53d005ef8a1e0253ad67b7b62103ea1fae6 Merge: 039aeb9deb92 c928f642c29a Author: Linus Torvalds Date: Wed Jun 3 15:52:19 2020 -0700 Merge branch 'work.splice' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull splice updates from Al Viro: "Christoph's assorted splice cleanups" * 'work.splice' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: rename pipe_buf ->steal to ->try_steal fs: make the pipe_buf_operations ->confirm operation optional fs: make the pipe_buf_operations ->steal operation optional trace: remove tracing_pipe_buf_ops pipe: merge anon_pipe_buf*_ops fs: simplify do_splice_from fs: simplify do_splice_to commit 94873f6b46f8c103759c28adc121a58022972d01 Author: Baolin Wang Date: Thu May 7 11:47:25 2020 +0800 pinctrl: sprd: Fix the incorrect pull-up definition The bits of pull up resistor selection were defined mistakenly, thus fix them. Fixes: 41d32cfce1ae ("pinctrl: sprd: Add Spreadtrum pin control driver") Signed-off-by: Baolin Wang Link: https://lore.kernel.org/r/e973f8f194ce4cb2639121572e8621b5efa5bfbe.1588823152.git.baolin.wang7@gmail.com Signed-off-by: Linus Walleij commit 039aeb9deb9291f3b19c375a8bc6fa7f768996cc Merge: 6b2591c21273 13ffbd8db1dd Author: Linus Torvalds Date: Wed Jun 3 15:13:47 2020 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "ARM: - Move the arch-specific code into arch/arm64/kvm - Start the post-32bit cleanup - Cherry-pick a few non-invasive pre-NV patches x86: - Rework of TLB flushing - Rework of event injection, especially with respect to nested virtualization - Nested AMD event injection facelift, building on the rework of generic code and fixing a lot of corner cases - Nested AMD live migration support - Optimization for TSC deadline MSR writes and IPIs - Various cleanups - Asynchronous page fault cleanups (from tglx, common topic branch with tip tree) - Interrupt-based delivery of asynchronous "page ready" events (host side) - Hyper-V MSRs and hypercalls for guest debugging - VMX preemption timer fixes s390: - Cleanups Generic: - switch vCPU thread wakeup from swait to rcuwait The other architectures, and the guest side of the asynchronous page fault work, will come next week" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (256 commits) KVM: selftests: fix rdtsc() for vmx_tsc_adjust_test KVM: check userspace_addr for all memslots KVM: selftests: update hyperv_cpuid with SynDBG tests x86/kvm/hyper-v: Add support for synthetic debugger via hypercalls x86/kvm/hyper-v: enable hypercalls regardless of hypercall page x86/kvm/hyper-v: Add support for synthetic debugger interface x86/hyper-v: Add synthetic debugger definitions KVM: selftests: VMX preemption timer migration test KVM: nVMX: Fix VMX preemption timer migration x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit KVM: x86/pmu: Support full width counting KVM: x86/pmu: Tweak kvm_pmu_get_msr to pass 'struct msr_data' in KVM: x86: announce KVM_FEATURE_ASYNC_PF_INT KVM: x86: acknowledgment mechanism for async pf page ready notifications KVM: x86: interrupt based APF 'page ready' event delivery KVM: introduce kvm_read_guest_offset_cached() KVM: rename kvm_arch_can_inject_async_page_present() to kvm_arch_can_dequeue_async_page_present() KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info Revert "KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously" KVM: VMX: Replace zero-length array with flexible-array ... commit 08acc963190a3a0eb491efa9cc466b2c18d59f22 Author: Christophe JAILLET Date: Sun May 31 09:37:16 2020 +0200 pinctrl: pxa: pxa2xx: Remove 'pxa2xx_pinctrl_exit()' which is unused and broken Commit 6d33ee7a0534 ("pinctrl: pxa: Use devm_pinctrl_register() for pinctrl registration") has turned a 'pinctrl_register()' into 'devm_pinctrl_register()' in 'pxa2xx_pinctrl_init()'. However, the corresponding 'pinctrl_unregister()' call in 'pxa2xx_pinctrl_exit()' has not been removed. This is not an issue, because 'pxa2xx_pinctrl_exit()' is unused. Remove it now to avoid some wondering in the future and save a few LoC. Fixes: 6d33ee7a0534 ("pinctrl: pxa: Use devm_pinctrl_register() for pinctrl registration") Signed-off-by: Christophe JAILLET Acked-by: Robert Jarzmik Link: https://lore.kernel.org/r/20200531073716.593343-1-christophe.jaillet@wanadoo.fr Signed-off-by: Linus Walleij commit 6b2591c21273ebf65c13dae5d260ce88f0f197dd Merge: f1e455352b6f afaa33da08ab Author: Linus Torvalds Date: Wed Jun 3 15:00:05 2020 -0700 Merge tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyper-v updates from Wei Liu: - a series from Andrea to support channel reassignment - a series from Vitaly to clean up Vmbus message handling - a series from Michael to clean up and augment hyperv-tlfs.h - patches from Andy to clean up GUID usage in Hyper-V code - a few other misc patches * tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: (29 commits) Drivers: hv: vmbus: Resolve more races involving init_vp_index() Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug vmbus: Replace zero-length array with flexible-array Driver: hv: vmbus: drop a no long applicable comment hyper-v: Switch to use UUID types directly hyper-v: Replace open-coded variant of %*phN specifier hyper-v: Supply GUID pointer to printf() like functions hyper-v: Use UUID API for exporting the GUID (part 2) asm-generic/hyperv: Add definitions for Get/SetVpRegister hypercalls x86/hyperv: Split hyperv-tlfs.h into arch dependent and independent files x86/hyperv: Remove HV_PROCESSOR_POWER_STATE #defines KVM: x86: hyperv: Remove duplicate definitions of Reference TSC Page drivers: hv: remove redundant assignment to pointer primary_channel scsi: storvsc: Re-init stor_chns when a channel interrupt is re-assigned Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug Drivers: hv: vmbus: Remove the unused HV_LOCALIZED channel affinity logic PCI: hv: Prepare hv_compose_msi_msg() for the VMBus-channel-interrupt-to-vCPU reassignment functionality Drivers: hv: vmbus: Use a spin lock for synchronizing channel scheduling vs. channel removal hv_utils: Always execute the fcopy and vss callbacks in a tasklet ... commit 8211d1e83aded34631aa87fa37f97d7bb712e925 Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:45 2020 +0800 dt-bindings: clock: Add documentation for X1830 bindings. Add documentation for the clock bindings of the X1830 Soc from Ingenic. Reviewed-by: Rob Herring Acked-by: Rob Herring Signed-off-by: 周琰杰 (Zhou Yanjie) Signed-off-by: Rob Herring commit f1e455352b6f503532eb3637d0a6d991895e7856 Merge: 38696e33e2bd c893de12e1ef Author: Linus Torvalds Date: Wed Jun 3 14:57:03 2020 -0700 Merge tag 'kgdb-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb updates from Daniel Thompson: "By far the biggest change in this cycle are the changes that allow much earlier debug of systems that are hooked up via UART by taking advantage of the earlycon framework to implement the kgdb I/O hooks before handing over to the regular polling I/O drivers once they are available. When discussing Doug's work we also found and fixed an broken raw_smp_processor_id() sequence in in_dbg_master(). Also included are a collection of much smaller fixes and tweaks: a couple of tweaks to ged rid of doc gen or coccicheck warnings, future proof some internal calculations that made implicit power-of-2 assumptions and eliminate some rather weird handling of magic environment variables in kdb" * tag 'kgdb-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kdb: Remove the misfeature 'KDBFLAGS' kdb: Cleanup math with KDB_CMD_HISTORY_COUNT serial: amba-pl011: Support kgdboc_earlycon serial: 8250_early: Support kgdboc_earlycon serial: qcom_geni_serial: Support kgdboc_earlycon serial: kgdboc: Allow earlycon initialization to be deferred Documentation: kgdboc: Document new kgdboc_earlycon parameter kgdb: Don't call the deinit under spinlock kgdboc: Disable all the early code when kgdboc is a module kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles kgdboc: Remove useless #ifdef CONFIG_KGDB_SERIAL_CONSOLE in kgdboc kgdb: Prevent infinite recursive entries to the debugger kgdb: Delay "kgdbwait" to dbg_late_init() by default kgdboc: Use a platform device to handle tty drivers showing up late Revert "kgdboc: disable the console lock when in kgdb" kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb kgdb: Return true in kgdb_nmi_poll_knock() kgdb: Drop malformed kernel doc comment kgdb: Fix spurious true from in_dbg_master() commit 636338d7968e47c7f2e0b772a2a825ad932883fb Author: Tony Lindgren Date: Wed Jun 3 15:02:20 2020 -0700 bus: ti-sysc: Increase max softreset wait Otherwise we can get "OCP softreset timed out" warnings occasionally at least for i2c2 on omap4 now that we check the OCP softreset completed bit on enable. Reported-by: Merlijn Wajer Signed-off-by: Tony Lindgren commit 6cc7c266e5b47d3cd2b5bb7fd3aac4e6bb2dd1d2 Author: Roberto Sassu Date: Wed Jun 3 17:08:21 2020 +0200 ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init() If the template field 'd' is chosen and the digest to be added to the measurement entry was not calculated with SHA1 or MD5, it is recalculated with SHA1, by using the passed file descriptor. However, this cannot be done for boot_aggregate, because there is no file descriptor. This patch adds a call to ima_calc_boot_aggregate() in ima_eventdigest_init(), so that the digest can be recalculated also for the boot_aggregate entry. Cc: stable@vger.kernel.org # 3.13.x Fixes: 3ce1217d6cd5d ("ima: define template fields library and new helpers") Reported-by: Takashi Iwai Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 38696e33e2bdf91cbbc7a2291dc6db862d9dfd42 Merge: 44e40e96b5ac 3ead2f97bd44 Author: Linus Torvalds Date: Wed Jun 3 14:01:23 2020 -0700 Merge tag 'xtensa-20200603' of git://github.com/jcmvbkbc/linux-xtensa Pull Xtensa updates from Max Filippov: - fix __user annotations in asm/uaccess.h - fix comments in entry.S * tag 'xtensa-20200603' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: Fix spelling/grammar in comment xtensa: add missing __user annotations to asm/uaccess.h xtensa: fix error paths in __get_user_{check,size} xtensa: fix type conversion in __get_user_size xtensa: add missing __user annotations to __{get,put}_user_check commit b7e4b65f3fe92abbf4a1f57987a54c820969aebd Author: Al Viro Date: Fri May 8 00:16:31 2020 -0400 bpf: make bpf_check_uarg_tail_zero() use check_zeroed_user() ... rather than open-coding it, and badly, at that. Acked-by: Alexei Starovoitov Signed-off-by: Al Viro commit 9eb41c521465f62332dfddcd399412fdff9c062b Author: Al Viro Date: Tue Feb 18 17:32:46 2020 -0500 x86: kvm_hv_set_msr(): use __put_user() instead of 32bit __clear_user() Signed-off-by: Al Viro commit 5ea75ae6ae60d13dfa35fd5d2e2a81824cba6662 Author: Al Viro Date: Tue Feb 18 17:30:05 2020 -0500 user_regset_copyout_zero(): use clear_user() that's the only caller of __clear_user() in generic code, and it's not hot enough to bother with skipping access_ok(). Signed-off-by: Al Viro commit 86977da9cb71c8293263c630ac920dd1537de9e5 Author: Al Viro Date: Sun Feb 16 19:39:36 2020 -0500 TEST_ACCESS_OK _never_ had been checked anywhere Once upon a time the predecessor of that thing (TEST_VERIFY_AREA) used to be. However, that had been gone for years now (and the patch that introduced TEST_ACCESS_OK has not touched any ifdefs - they got gradually removed later). Just bury it... Signed-off-by: Al Viro commit c120f3b81ede0e3d2cf34d457d7c628306760ff1 Author: Al Viro Date: Sun Feb 16 17:32:57 2020 -0500 x86: switch cp_stat64() to unsafe_put_user() Signed-off-by: Al Viro commit 8861fd576ecf96450f42f3eb4b56cad5bf12188a Author: Al Viro Date: Wed Feb 19 09:32:55 2020 -0500 binfmt_flat: don't use __put_user() ... and check the return value Signed-off-by: Al Viro commit 0abb013e2e73c40bd196413b49651b29e1b7dafb Author: Al Viro Date: Wed Feb 19 09:28:34 2020 -0500 binfmt_elf_fdpic: don't use __... uaccess primitives Signed-off-by: Al Viro commit 646e84deb4496e2a884ca87fa960f1c614da882a Author: Al Viro Date: Wed Feb 19 09:23:34 2020 -0500 binfmt_elf: don't bother with __{put,copy_to}_user() Signed-off-by: Al Viro commit 44e40e96b5accb18a100fee1a67cde422d791c4c Merge: 8226f11318bd 775024cf49ff Author: Linus Torvalds Date: Wed Jun 3 13:45:21 2020 -0700 Merge branch 'parisc-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parsic updates from Helge Deller: "Enable the sysctl file interface for panic_on_stackoverflow for parisc, a warning fix and a bunch of documentation updates since the parisc website is now at https://parisc.wiki.kernel.org" * 'parisc-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: MAINTAINERS: Update references to parisc website parisc: module: Update references to parisc website parisc: hardware: Update references to parisc website parisc: firmware: Update references to parisc website parisc: Kconfig: Update references to parisc website parisc: add sysctl file interface panic_on_stackoverflow parisc: use -fno-strict-aliasing for decompressor parisc: suppress error messages for 'make clean' commit f54736925a4f83a67588381d0ead69d19323b526 Author: Tali Perry Date: Wed May 27 23:08:20 2020 +0300 i2c: npcm7xx: Add support for slave mode for Nuvoton Add support for slave mode for Nuvoton NPCM BMC I2C controller driver. Signed-off-by: Tali Perry Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 56a1485b102ed1cd5a4af8e87ed794699fd1cad2 Author: Tali Perry Date: Wed May 27 23:08:19 2020 +0300 i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver Add Nuvoton NPCM BMC I2C controller driver. Signed-off-by: Tali Perry Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit cd020be04b6ec269df1b44d5cd2cd548cae0d46a Author: Tali Perry Date: Wed May 27 23:08:18 2020 +0300 dt-bindings: i2c: npcm7xx: add NPCM I2C controller Added device tree binding documentation for Nuvoton BMC NPCM I2C controller. Signed-off-by: Tali Perry Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 9fa060df65715732655f7f46fe7fa68fc1a5b98e Author: Lubomir Rintel Date: Tue Jun 2 21:38:23 2020 +0200 i2c: pxa: don't error out if there's no pinctrl The bus recovery patch regresses on OLPC XO-1.75 that has no pinctrl in its DT. Fixes: 7c9ec2c52518 ("i2c: pxa: implement generic i2c bus recovery")' Signed-off-by: Lubomir Rintel Signed-off-by: Wolfram Sang commit 8226f11318bd03ae0dbf028f7c433071cf4927f4 Merge: e8f4abf8fd1a 9bd0bd264578 Author: Linus Torvalds Date: Wed Jun 3 13:32:21 2020 -0700 Merge tag 'mips_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - added support for MIPSr5 and P5600 cores - converted Loongson PCI driver into a PCI host driver using the generic PCI framework - added emulation of CPUCFG command for Loogonson64 cpus - removed of LASAT, PMC MSP71xx and NEC MARKEINS/EMMA - ioremap cleanup - fix for a race between two threads faulting the same page - various cleanups and fixes * tag 'mips_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (143 commits) MIPS: ralink: drop ralink_clk_init for mt7621 MIPS: ralink: bootrom: mark a function as __init to save some memory MIPS: Loongson64: Reorder CPUCFG model match arms MIPS: Expose Loongson CPUCFG availability via HWCAP MIPS: Loongson64: Guard against future cores without CPUCFG MIPS: Fix build warning about "PTR_STR" redefinition MIPS: Loongson64: Remove not used pci.c MIPS: Loongson64: Define PCI_IOBASE MIPS: CPU_LOONGSON2EF need software to maintain cache consistency MIPS: DTS: Fix build errors used with various configs MIPS: Loongson64: select NO_EXCEPT_FILL MIPS: Fix IRQ tracing when call handle_fpe() and handle_msa_fpe() MIPS: mm: add page valid judgement in function pte_modify mm/memory.c: Add memory read privilege on page fault handling mm/memory.c: Update local TLB if PTE entry exists MIPS: Do not flush tlb page when updating PTE entry MIPS: ingenic: Default to a generic board MIPS: ingenic: Add support for GCW Zero prototype MIPS: ingenic: DTS: Add memory info of GCW Zero MIPS: Loongson64: Switch to generic PCI driver ... commit e8f4abf8fd1a2beb94983cb95ed713df75b3d135 Merge: e7c93cbfe9cb 174e1ea8a2f6 Author: Linus Torvalds Date: Wed Jun 3 13:24:54 2020 -0700 Merge branch 'uaccess.csum' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull ia64 build regression fix from Al Viro: "Fix a braino in ia64 uaccess csum changes" * 'uaccess.csum' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix a braino in ia64 uaccess csum changes commit 16ba7e312045cd5d32fba0156312b4303f200787 Merge: e72455b898ac 346338ef00d3 c4f0126d487f 16863fbc1cf2 0b66fb3e6b7a c08ce255033a 328de1c519c5 27a6f70173ac Author: Jiri Kosina Date: Wed Jun 3 22:23:52 2020 +0200 Merge branches 'for-5.7/upstream-fixes', 'for-5.8/apple', 'for-5.8/asus', 'for-5.8/core', 'for-5.8/intel-ish', 'for-5.8/logitech', 'for-5.8/mcp2221' and 'for-5.8/multitouch' into for-linus commit 174e1ea8a2f6140078b6c61068b478cf3c4aa74f Author: Al Viro Date: Wed Jun 3 16:15:28 2020 -0400 fix a braino in ia64 uaccess csum changes Fixes: cc03f19cfd45 (ia64: csum_partial_copy_nocheck(): don't abuse csum_partial_copy_from_user()) Reported-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Al Viro commit e7c93cbfe9cb4b0a47633099e78c455b1f79bbac Merge: d479c5a1919b 2b40c5db73e2 Author: Linus Torvalds Date: Wed Jun 3 13:12:57 2020 -0700 Merge tag 'threads-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull thread updates from Christian Brauner: "We have been discussing using pidfds to attach to namespaces for quite a while and the patches have in one form or another already existed for about a year. But I wanted to wait to see how the general api would be received and adopted. This contains the changes to make it possible to use pidfds to attach to the namespaces of a process, i.e. they can be passed as the first argument to the setns() syscall. When only a single namespace type is specified the semantics are equivalent to passing an nsfd. That means setns(nsfd, CLONE_NEWNET) equals setns(pidfd, CLONE_NEWNET). However, when a pidfd is passed, multiple namespace flags can be specified in the second setns() argument and setns() will attach the caller to all the specified namespaces all at once or to none of them. Specifying 0 is not valid together with a pidfd. Here are just two obvious examples: setns(pidfd, CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWNET); setns(pidfd, CLONE_NEWUSER); Allowing to also attach subsets of namespaces supports various use-cases where callers setns to a subset of namespaces to retain privilege, perform an action and then re-attach another subset of namespaces. Apart from significantly reducing the number of syscalls needed to attach to all currently supported namespaces (eight "open+setns" sequences vs just a single "setns()"), this also allows atomic setns to a set of namespaces, i.e. either attaching to all namespaces succeeds or we fail without having changed anything. This is centered around a new internal struct nsset which holds all information necessary for a task to switch to a new set of namespaces atomically. Fwiw, with this change a pidfd becomes the only token needed to interact with a container. I'm expecting this to be picked-up by util-linux for nsenter rather soon. Associated with this change is a shiny new test-suite dedicated to setns() (for pidfds and nsfds alike)" * tag 'threads-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: selftests/pidfd: add pidfd setns tests nsproxy: attach to namespaces via pidfds nsproxy: add struct nsset commit d479c5a1919b4e569dcd3ae9c84ed74a675d0b94 Merge: f6aee505c71b 25de110d1486 Author: Linus Torvalds Date: Wed Jun 3 13:06:42 2020 -0700 Merge tag 'sched-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: "The changes in this cycle are: - Optimize the task wakeup CPU selection logic, to improve scalability and reduce wakeup latency spikes - PELT enhancements - CFS bandwidth handling fixes - Optimize the wakeup path by remove rq->wake_list and replacing it with ->ttwu_pending - Optimize IPI cross-calls by making flush_smp_call_function_queue() process sync callbacks first. - Misc fixes and enhancements" * tag 'sched-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) irq_work: Define irq_work_single() on !CONFIG_IRQ_WORK too sched/headers: Split out open-coded prototypes into kernel/sched/smp.h sched: Replace rq::wake_list sched: Add rq::ttwu_pending irq_work, smp: Allow irq_work on call_single_queue smp: Optimize send_call_function_single_ipi() smp: Move irq_work_run() out of flush_smp_call_function_queue() smp: Optimize flush_smp_call_function_queue() sched: Fix smp_call_function_single_async() usage for ILB sched/core: Offload wakee task activation if it the wakee is descheduling sched/core: Optimize ttwu() spinning on p->on_cpu sched: Defend cfs and rt bandwidth quota against overflow sched/cpuacct: Fix charge cpuacct.usage_sys sched/fair: Replace zero-length array with flexible-array sched/pelt: Sync util/runnable_sum with PELT window when propagating sched/cpuacct: Use __this_cpu_add() instead of this_cpu_ptr() sched/fair: Optimize enqueue_task_fair() sched: Make scheduler_ipi inline sched: Clean up scheduler_ipi() sched/core: Simplify sched_init() ... commit a24eaa5c51255b344d5a321f1eeb3205f2775498 Author: Nicholas Kazlauskas Date: Tue Jun 2 20:42:33 2020 -0400 drm/amd/display: Revalidate bandwidth before commiting DC updates [Why] Whenever we switch between tiled formats without also switching pixel formats or doing anything else that recreates the DC plane state we can run into underflow or hangs since we're not updating the DML parameters before committing to the hardware. [How] If the update type is FULL then call validate_bandwidth again to update the DML parmeters before committing the state. This is basically just a workaround and protective measure against update types being added DC where we could run into this issue in the future. We can only fully validate the state in advance before applying it to the hardware if we recreate all the plane and stream states since we can't modify what's currently in use. The next step is to update DM to ensure that we're creating the plane and stream states for whatever could potentially be a full update in DC to pre-emptively recreate the state for DC global validation. The workaround can stay until this has been fixed in DM. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Hersen Wu Signed-off-by: Alex Deucher commit b7f839d292948142eaab77cedd031aad0bfec872 Author: Alex Deucher Date: Tue Jun 2 17:22:48 2020 -0400 drm/amdgpu/display: use blanked rather than plane state for sync groups We may end up with no planes set yet, depending on the ordering, but we should have the proper blanking state which is either handled by either DPG or TG depending on the hardware generation. Check both to determine the proper blanked state. Bug: https://gitlab.freedesktop.org/drm/amd/issues/781 Fixes: 5fc0cbfad45648 ("drm/amd/display: determine if a pipe is synced by plane state") Cc: nicholas.kazlauskas@amd.com Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 067a436b1b0aafa593344fddd711a755a58afb3b Author: Roberto Sassu Date: Wed Jun 3 17:08:20 2020 +0200 ima: Directly assign the ima_default_policy pointer to ima_rules This patch prevents the following oops: [ 10.771813] BUG: kernel NULL pointer dereference, address: 0000000000000 [...] [ 10.779790] RIP: 0010:ima_match_policy+0xf7/0xb80 [...] [ 10.798576] Call Trace: [ 10.798993] ? ima_lsm_policy_change+0x2b0/0x2b0 [ 10.799753] ? inode_init_owner+0x1a0/0x1a0 [ 10.800484] ? _raw_spin_lock+0x7a/0xd0 [ 10.801592] ima_must_appraise.part.0+0xb6/0xf0 [ 10.802313] ? ima_fix_xattr.isra.0+0xd0/0xd0 [ 10.803167] ima_must_appraise+0x4f/0x70 [ 10.804004] ima_post_path_mknod+0x2e/0x80 [ 10.804800] do_mknodat+0x396/0x3c0 It occurs when there is a failure during IMA initialization, and ima_init_policy() is not called. IMA hooks still call ima_match_policy() but ima_rules is NULL. This patch prevents the crash by directly assigning the ima_default_policy pointer to ima_rules when ima_rules is defined. This wouldn't alter the existing behavior, as ima_rules is always set at the end of ima_init_policy(). Cc: stable@vger.kernel.org # 3.7.x Fixes: 07f6a79415d7d ("ima: add appraise action keywords and default rules") Reported-by: Takashi Iwai Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit b91c8c42ffdd5c983923edb38b3c3e112bfe6263 Author: Christophe Leroy Date: Tue Apr 28 13:16:53 2020 +0000 lib/vdso: Force inlining of __cvdso_clock_gettime_common() When adding gettime64() to a 32 bit architecture (namely powerpc/32) it has been noticed that GCC doesn't inline anymore __cvdso_clock_gettime_common() because it is called twice (Once by __cvdso_clock_gettime() and once by __cvdso_clock_gettime32). This has the effect of seriously degrading the performance: Before the implementation of gettime64(), gettime() runs in: clock-gettime-monotonic-raw: vdso: 1003 nsec/call clock-gettime-monotonic-coarse: vdso: 592 nsec/call clock-gettime-monotonic: vdso: 942 nsec/call When adding a gettime64() entry point, the standard gettime() performance is degraded by 30% to 50%: clock-gettime-monotonic-raw: vdso: 1300 nsec/call clock-gettime-monotonic-coarse: vdso: 900 nsec/call clock-gettime-monotonic: vdso: 1232 nsec/call Adding __always_inline() to __cvdso_clock_gettime_common() regains the original performance. In terms of code size, the inlining increases the code size by only 176 bytes. This is in the noise for a kernel image. Signed-off-by: Christophe Leroy Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/1ab6a62c356c3bec35d1623563ef9c636205bcda.1588079622.git.christophe.leroy@c-s.fr commit fba97dc7fc76b2c9a909fa0b3786d30a9899f5cf Author: Ka-Cheong Poon Date: Wed Jun 3 06:33:38 2020 -0700 RDMA/cm: Spurious WARNING triggered in cm_destroy_id() If the cm_id state is IB_CM_REP_SENT when cm_destroy_id() is called, it calls cm_send_rej_locked(). In cm_send_rej_locked(), it calls cm_enter_timewait() and the state is changed to IB_CM_TIMEWAIT. Now back to cm_destroy_id(), it breaks from the switch statement, and the next call is WARN_ON(cm_id->state != IB_CM_IDLE). This triggers a spurious warning. Instead, the code should goto retest after returning from cm_send_rej_locked() to move the state to IDLE. Fixes: 67b3c8dceac6 ("RDMA/cm: Make sure the cm_id is in the IB_CM_IDLE state in destroy") Link: https://lore.kernel.org/r/1591191218-9446-1-git-send-email-ka-cheong.poon@oracle.com Signed-off-by: Ka-Cheong Poon Signed-off-by: Jason Gunthorpe commit a645a89d9a780a8fbb6e283f84fc91ad538c2edc Author: Leon Romanovsky Date: Tue Jun 2 15:55:48 2020 +0300 RDMA/mlx5: Return ECE DC support The DC QPs are many-to-one QP types that means that first connection will establish ECE options that coming connections should follow. Due to this property, the ECE code was removed between first [1] and second [2] ECE submissions. This patch returns the dropped code, because ECE is a property of a connection and like any other connection users are needed to manage this data. Allow them to set ECE parameter for DC too and avoid need of having compatibility flag for the DC ECE. [1] https://lore.kernel.org/linux-rdma/20200523132243.817936-1-leon@kernel.org/ [2] https://lore.kernel.org/linux-rdma/20200525174401.71152-1-leon@kernel.org/ Link: https://lore.kernel.org/r/20200602125548.172654-4-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 92cd667c0e8a67de024134be0a6f0bdb320606a8 Author: Leon Romanovsky Date: Tue Jun 2 15:55:47 2020 +0300 RDMA/mlx5: Don't rely on FW to set zeros in ECE response The FW returns zeros in case feature is not enabled, but it is better to have the capability check and ensure that returned result is cleared. Fixes: 3e09a427ae7a ("RDMA/mlx5: Get ECE options from FW during create QP") Link: https://lore.kernel.org/r/20200602125548.172654-3-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6512f11d386c7cf83a48e71cfd7c7c1b0003c151 Author: Leon Romanovsky Date: Tue Jun 2 15:55:46 2020 +0300 RDMA/mlx5: Return an error if copy_to_user fails In theoretical event, the ib_copy_to_udata() can fail, so return -EFAULT error to the user, so he will destroy the QP. Fixes: 50aec2c3135e ("RDMA/mlx5: Return ECE data after modify QP") Link: https://lore.kernel.org/r/20200602125548.172654-2-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit be25d1b5ea6a3a3ecbb5474e2ae8e32d2ba055ea Author: Tony Luck Date: Wed Jun 3 10:33:52 2020 -0700 x86/cpu: Add Sapphire Rapids CPU model number Latest edition (039) of "Intel Architecture Instruction Set Extensions and Future Features Programming Reference" includes three new CPU model numbers. Linux already has the two Ice Lake server ones. Add the new model number for Sapphire Rapids. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200603173352.15506-1-tony.luck@intel.com commit f6aee505c71bbb035dde146caf5a6abbf3ccbe47 Merge: dabc4df27c62 bd35c77e32e4 Author: Linus Torvalds Date: Wed Jun 3 10:18:09 2020 -0700 Merge tag 'x86-timers-2020-06-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 timer updates from Thomas Gleixner: "X86 timer specific updates: - Add TPAUSE based delay which allows the CPU to enter an optimized power state while waiting for the delay to pass. The delay is based on TSC cycles. - Add tsc_early_khz command line parameter to workaround the problem that overclocked CPUs can report the wrong frequency via CPUID.16h which causes the refined calibration to fail because the delta to the initial frequency value is too big. With the parameter users can provide an halfways accurate initial value" * tag 'x86-timers-2020-06-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/tsc: Add tsc_early_khz command line parameter x86/delay: Introduce TPAUSE delay x86/delay: Refactor delay_mwaitx() for TPAUSE support x86/delay: Preparatory code cleanup commit 77cad9dbc957f23a73169e8a8971186744296614 Author: Tony Lindgren Date: Wed May 27 16:32:06 2020 -0700 ARM: OMAP2+: Fix legacy mode dss_reset We must check for "dss_core" instead of "dss" to avoid also matching also "dss_dispc". This only matters for the mixed case of data configured in device tree but with legacy booting ti,hwmods property still enabled. Fixes: 8b30919a4e3c ("ARM: OMAP2+: Handle reset quirks for dynamically allocated modules") Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren commit 085bc0e576a4bf53b67a917c54908f299a2fb949 Author: Tony Lindgren Date: Sun May 31 12:37:54 2020 -0700 bus: ti-sysc: Fix uninitialized framedonetv_irq We are currently only setting the framedonetv_irq disabled for the SoCs that don't have it. But we are never setting it enabled for the SoCs that have it. Let's initialized it to true by default. Fixes: 7324a7a0d5e2 ("bus: ti-sysc: Implement display subsystem reset quirk") Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren commit 08b91dd6e547467fad61a7c201ff71080d7ad65a Author: Tony Lindgren Date: Sun May 31 12:37:54 2020 -0700 bus: ti-sysc: Ignore clockactivity unless specified as a quirk We must ignore the clockactivity bit for most modules and not set it unless specified for the module with SYSC_QUIRK_USE_CLOCKACT. Otherwise the interface clock can be automatically gated constantly causing unexpected performance issues. Fixes: ae9ae12e9daa ("bus: ti-sysc: Handle clockactivity for enable and disable") Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren commit d46f9fbec71997420e4fb83c04d9affdf423f879 Author: Tony Lindgren Date: Sun May 31 12:37:54 2020 -0700 bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit Some modules reset automatically when idled, and when re-enabled, we must wait for the automatic OCP softreset to complete. And if optional clocks are configured, we need to keep the clocks on while waiting for the reset to complete. Let's fix the issue by moving the OCP softreset code to a separate function sysc_wait_softreset(), and call it also from sysc_enable_module() with the optional clocks enabled. This is based on what we're already doing for legacy platform data booting in _enable_sysc(). Fixes: 7324a7a0d5e2 ("bus: ti-sysc: Implement display subsystem reset quirk") Reported-by: Faiz Abbas Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren commit dabc4df27c628866ede130a09121f255ca894d8c Merge: f6606d0c0010 809eb4e9bf9d Author: Linus Torvalds Date: Wed Jun 3 10:10:07 2020 -0700 Merge tag 'timers-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "The truly boring timer and clocksource updates for 5.8: - Not a single new clocksource or clockevent driver! - Device tree updates for various chips - Fixes and improvements and cleanups all over the place" * tag 'timers-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits) dt-bindings: timer: Add renesas,em-sti bindings clocksource/drivers/timer-versatile: Clear OF_POPULATED flag clocksource: mips-gic-timer: Mark GIC timer as unstable if ref clock changes clocksource: mips-gic-timer: Register as sched_clock clocksource: dw_apb_timer_of: Fix missing clockevent timers clocksource: dw_apb_timer: Affiliate of-based timer with any CPU clocksource: dw_apb_timer: Make CPU-affiliation being optional dt-bindings: timer: Move snps,dw-apb-timer DT schema from rtc dt-bindings: rtc: Convert snps,dw-apb-timer to DT schema clocksource/drivers/timer-ti-dm: Do one override clock parent in prepare() clocksource/drivers/timer-ti-dm: Fix spelling mistake "detectt" -> "detect" clocksource/drivers/timer-ti-dm: Fix warning for set but not used clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support clocksource/drivers/timer-ti-32k: Add support for initializing directly drivers/clocksource/arm_arch_timer: Remove duplicate error message clocksource/drivers/arc_timer: Remove duplicate error message clocksource/drivers/rda: drop redundant Kconfig dependency clocksource/drivers/timer-ti-dm: Fix warning for set but not used clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support clocksource/drivers/timer-ti-32k: Add support for initializing directly ... commit f6606d0c0010953e4c28c8662623662b5108b4ce Merge: d6f9469a03d8 d77aeb5d403d Author: Linus Torvalds Date: Wed Jun 3 10:05:11 2020 -0700 Merge tag 'irq-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "The generic interrupt departement provides: - Cleanup of the irq_domain API - Overhaul of the interrupt chip simulator - The usual pile of new interrupt chip drivers - Cleanups, improvements and fixes all over the place" * tag 'irq-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) irqchip: Fix "Loongson HyperTransport Vector support" driver build on all non-MIPS platforms dt-bindings: interrupt-controller: Add Loongson PCH MSI irqchip: Add Loongson PCH MSI controller dt-bindings: interrupt-controller: Add Loongson PCH PIC irqchip: Add Loongson PCH PIC controller dt-bindings: interrupt-controller: Add Loongson HTVEC irqchip: Add Loongson HyperTransport Vector support genirq: Check irq_data_get_irq_chip() return value before use irqchip/sifive-plic: Improve boot prints for multiple PLIC instances irqchip/sifive-plic: Setup cpuhp once after boot CPU handler is present irqchip/sifive-plic: Set default irq affinity in plic_irqdomain_map() irqchip/gic-v2, v3: Drop extra IRQ_NOAUTOEN setting for (E)PPIs irqdomain: Allow software nodes for IRQ domain creation irqdomain: Get rid of special treatment for ACPI in __irq_domain_add() irqdomain: Make __irq_domain_add() less OF-dependent iio: dummy_evgen: Fix use after free on error in iio_dummy_evgen_create() irqchip/gic-v3-its: Balance initial LPI affinity across CPUs irqchip/gic-v3-its: Track LPI distribution on a per CPU basis genirq/irq_sim: Simplify the API irqdomain: Make irq_domain_reset_irq_data() available to non-hierarchical users ... commit c25bf185e57213b54ea0d632ac04907310993433 Author: J. Bruce Fields Date: Wed Jun 3 11:12:32 2020 -0400 nfsd: safer handling of corrupted c_type This can only happen if there's a bug somewhere, so let's make it a WARN not a printk. Also, I think it's safest to ignore the corruption rather than trying to fix it by removing a cache entry. Signed-off-by: J. Bruce Fields commit ba403242615c2c99e27af7984b1650771a2cc2c9 Author: Christophe JAILLET Date: Tue Jun 2 22:06:26 2020 +0200 pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()' Use 'devm_of_iomap()' instead 'of_iomap()' to avoid a resource leak in case of error. Update the error handling code accordingly. Fixes: 26d8cde5260b ("pinctrl: freescale: imx: add shared input select reg support") Suggested-by: Dan Carpenter Signed-off-by: Christophe JAILLET Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20200602200626.677981-1-christophe.jaillet@wanadoo.fr Signed-off-by: Linus Walleij commit 11d8da5cabf7c6c3263ba2cd9c00260395867048 Author: Christophe JAILLET Date: Sat May 30 22:49:55 2020 +0200 pinctrl: freescale: imx: Fix an error handling path in 'imx_pinctrl_probe()' 'pinctrl_unregister()' should not be called to undo 'devm_pinctrl_register_and_init()', it is already handled by the framework. This simplifies the error handling paths of the probe function. The 'imx_free_resources()' can be removed as well. Fixes: a51c158bf0f7 ("pinctrl: imx: use radix trees for groups and functions") Signed-off-by: Christophe JAILLET Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20200530204955.588962-1-christophe.jaillet@wanadoo.fr Signed-off-by: Linus Walleij commit 66339f2fba3fa05b0507e1887e4c6abcfc6228a3 Author: yu kuai Date: Wed Jun 3 09:35:32 2020 +0800 pinctrl: sirf: add missing put_device() call in sirfsoc_gpio_probe() A coccicheck run provided information like the following: drivers/pinctrl/sirf/pinctrl-sirf.c:798:2-8: ERROR: missing put_device; call of_find_device_by_node on line 792, but without a corresponding object release within this function. Generated by: scripts/coccinelle/free/put_device.cocci Thus add a jump target to fix the exception handling for this function implementation. Fixes: 5130216265f6 ("PINCTRL: SiRF: add GPIO and GPIO irq support in CSR SiRFprimaII") Signed-off-by: yu kuai Link: https://lore.kernel.org/r/20200603013532.755220-1-yukuai3@huawei.com Signed-off-by: Linus Walleij commit 9eb728321286c4b31e964d2377fca2368526d408 Author: Christophe JAILLET Date: Sat May 30 22:19:52 2020 +0200 pinctrl: imxl: Fix an error handling path in 'imx1_pinctrl_core_probe()' When 'pinctrl_register()' has been turned into 'devm_pinctrl_register()', an error handling path has not been updated. Axe a now unneeded 'pinctrl_unregister()'. Fixes: e55e025d1687 ("pinctrl: imxl: Use devm_pinctrl_register() for pinctrl registration") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200530201952.585798-1-christophe.jaillet@wanadoo.fr Signed-off-by: Linus Walleij commit 920fecc1aa4591da27ef9dcb338fc5da86b404d7 Author: Florian Fainelli Date: Sat May 30 17:11:01 2020 -0700 pinctrl: bcm2835: Add support for wake-up interrupts Leverage the IRQCHIP_MASK_ON_SUSPEND flag in order to avoid having to specifically treat the GPIO interrupts during suspend and resume, and simply implement an irq_set_wake() callback that is responsible for enabling the parent wake-up interrupt as a wake-up interrupt. To avoid allocating unnecessary resources for other chips, the wake-up interrupts are only initialized if we have a brcm,bcm7211-gpio compatibility string. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20200531001101.24945-5-f.fainelli@gmail.com Signed-off-by: Linus Walleij commit 562c856f96d22ef1204b0a314bc52e85617199b4 Author: Florian Fainelli Date: Sat May 30 17:11:00 2020 -0700 pinctrl: bcm2835: Match BCM7211 compatible string The BCM7211 SoC uses the same pinconf_ops as the ones defined for the BCM2711 SoC, match the compatible string and use the correct set of options. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20200531001101.24945-4-f.fainelli@gmail.com Signed-off-by: Linus Walleij commit d4f2b12e6d8e6be860f6b9e23e964cab607987ac Author: Florian Fainelli Date: Sat May 30 17:10:59 2020 -0700 dt-bindings: pinctrl: Document optional BCM7211 wake-up interrupts BCM7211 supports wake-up interrupts in the form of optional interrupt lines, one per bank, plus the "all banks" interrupt line. Signed-off-by: Florian Fainelli Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200531001101.24945-3-f.fainelli@gmail.com Signed-off-by: Linus Walleij commit 879c93f7062ff15c8712c660f24b79796100c10e Author: Florian Fainelli Date: Sat May 30 17:10:58 2020 -0700 dt-bindings: pinctrl: Document 7211 compatible for brcm, bcm2835-gpio.txt Document the brcm,bcm7211-gpio compatible string in the brcm,bcm2835-gpio.txt document. Signed-off-by: Florian Fainelli Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200531001101.24945-2-f.fainelli@gmail.com Signed-off-by: Linus Walleij commit a45c0ec26d4ae1c8ae679a978fc8b3d35dd836b0 Author: Benjamin Gaignard Date: Wed May 13 16:59:34 2020 +0200 dt-bindings: pinctrl: stm32: Add missing interrupts property Driver use interrupt-parent field so update the bindings to allow it. Signed-off-by: Benjamin Gaignard Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200513145935.22493-15-benjamin.gaignard@st.com Signed-off-by: Linus Walleij commit 74910e15ab25f95f162bc4d4a634d029186543ce Author: Andy Shevchenko Date: Thu May 21 00:19:14 2020 +0300 gpio: pca953x: Drop unneeded ACPI_PTR() ACPI_PTR() becomes a no-op when !CONFIG_ACPI. This is not needed since we always have ID table enabled. Moreover, in the mentioned case compiler will complain about defined but not used variable. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200520211916.25727-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit b5f73d47f34b238221ac771b5fe4907df621d7cb Author: Arnd Bergmann Date: Tue Apr 7 16:21:46 2020 +0200 clk: sprd: fix compile-testing I got a build failure with CONFIG_ARCH_SPRD=m when the main portion of the clock driver failed to get linked into the kernel: ERROR: modpost: "sprd_pll_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_comp_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_clk_probe" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_clk_regmap_init" [drivers/clk/sprd/sc9863a-clk.ko] undefined! ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined! ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined! ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined! This is a combination of two trivial bugs: - A platform should not be 'tristate', it should be a 'bool' symbol like the other platforms, if only for consistency, and to avoid surprises like this one. - The clk Makefile does not traverse into the sprd subdirectory if the platform is disabled but the drivers are enabled for compile-testing. Fixing either of the two would be sufficient to address the link failure, but for correctness, both need to be changed. Fixes: 2b1b799d7630 ("arm64: change ARCH_SPRD Kconfig to tristate") Fixes: d41f59fd92f2 ("clk: sprd: Add common infrastructure") Acked-by: Chunyan Zhang Signed-off-by: Arnd Bergmann commit d9b8fbf15d05350b36081eddafcf7b15aa1add50 Author: Chuhong Yuan Date: Wed Jun 3 17:24:59 2020 +0800 ALSA: es1688: Add the missed snd_card_free() snd_es968_pnp_detect() misses a snd_card_free() in a failed path. Add the missed function call to fix it. Fixes: a20971b201ac ("ALSA: Merge es1688 and es968 drivers") Signed-off-by: Chuhong Yuan Cc: Link: https://lore.kernel.org/r/20200603092459.1424093-1-hslester96@gmail.com Signed-off-by: Takashi Iwai commit 27a7c67012cfa6d79f87fbb51afa13c6c0e24e34 Author: Hersen Wu Date: Tue Jun 2 21:31:37 2020 -0400 ALSA: hda: add sienna_cichlid audio asic id for sienna_cichlid up dp/hdmi ati hda is not shown in audio settings [ rearranged to a more appropriate place per device number order -- tiwai ] Signed-off-by: Hersen Wu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: Link: https://lore.kernel.org/r/20200603013137.1849404-1-alexander.deucher@amd.com Signed-off-by: Takashi Iwai commit b2dd9a44a1098c96935c495570b663bd223a087e Author: Eric Farman Date: Tue May 5 14:27:45 2020 +0200 vfio-ccw: Add trace for CRW event Since CRW events are (should be) rare, let's put a trace in that routine too. Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-9-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit 3f02cb2fd9d2d9e8762102886e3e4b51285797ee Author: Farhan Ali Date: Tue May 5 14:27:44 2020 +0200 vfio-ccw: Wire up the CRW irq and CRW region Use the IRQ to notify userspace that there is a CRW pending in the region, related to path-availability changes on the passthrough subchannel. Signed-off-by: Farhan Ali Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-8-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit d8cac29b1d52204e6632d2887eff766acd02b9aa Author: Farhan Ali Date: Tue May 5 14:27:43 2020 +0200 vfio-ccw: Introduce a new CRW region This region provides a mechanism to pass a Channel Report Word that affect vfio-ccw devices, and needs to be passed to the guest for its awareness and/or processing. The base driver (see crw_collect_info()) provides space for two CRWs, as a subchannel event may have two CRWs chained together (one for the ssid, one for the subchannel). As vfio-ccw will deal with everything at the subchannel level, provide space for a single CRW to be transferred in one shot. Signed-off-by: Farhan Ali Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-7-farman@linux.ibm.com> [CH: added padding to ccw_crw_region] Signed-off-by: Cornelia Huck commit 5fdeefa053df54961c1e9b69a128ddb5185ce150 Merge: 4e909124f8ed b3e2d20973db Author: Ingo Molnar Date: Wed Jun 3 11:14:37 2020 +0200 Merge branch 'urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/urgent Pull RCU fix from Paul E. McKenney. Signed-off-by: Ingo Molnar commit 76bbea9a24df1feaed1f731ea4481dec2e39c239 Author: Michael Walle Date: Thu May 28 16:58:45 2020 +0200 MAINTAINERS: Add gpio regmap section Add myself as a reviewer for the gpio regmap. Signed-off-by: Michael Walle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200528145845.31436-4-michael@walle.cc Signed-off-by: Linus Walleij commit ebe363197e525ffbd279c729421f6f6c24d8d681 Author: Michael Walle Date: Thu May 28 16:58:44 2020 +0200 gpio: add a reusable generic gpio_chip using regmap There are quite a lot simple GPIO controller which are using regmap to access the hardware. This driver tries to be a base to unify existing code into one place. This won't cover everything but it should be a good starting point. It does not implement its own irq_chip because there is already a generic one for regmap based devices. Instead, the irq_chip will be instantiated in the parent driver and its irq domain will be associate to this driver. For now it consists of the usual registers, like set (and an optional clear) data register, an input register and direction registers. Out-of-the-box, it supports consecutive register mappings and mappings where the registers have gaps between them with a linear mapping between GPIO offset and bit position. For weirder mappings the user can register its own .xlate(). Signed-off-by: Michael Walle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200528145845.31436-3-michael@walle.cc Signed-off-by: Linus Walleij commit 6a45b0e2589fafd7fc501a5fbd0ab56689a08124 Author: Michael Walle Date: Thu May 28 16:58:43 2020 +0200 gpiolib: Introduce gpiochip_irqchip_add_domain() The function connects an IRQ domain to a gpiochip and reuses gpiochip_to_irq() which is provided by gpiolib. gpiochip_irqchip_* and regmap_irq partially provide the same functionality. This function will help to connect just the minimal functionality of the gpiochip_irqchip which is needed to work together with regmap-irq. Signed-off-by: Michael Walle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200528145845.31436-2-michael@walle.cc Signed-off-by: Linus Walleij commit 968d81a64a883af2d16dd3f8a6ad6b67db2fde58 Author: Jeykumar Sankaran Date: Tue Jun 2 20:37:31 2020 -0700 drm/connector: notify userspace on hotplug after register complete drm connector notifies userspace on hotplug event prematurely before late_register and mode_object register completes. This leads to a race between userspace and kernel on updating the IDR list. So, move the notification to end of connector register. Signed-off-by: Jeykumar Sankaran Signed-off-by: Steve Cohen Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1591155451-10393-1-git-send-email-jsanka@codeaurora.org commit 1434a65ea625c51317ccdf06dabf4bd27d20fa10 Author: Chengguang Xu Date: Tue May 26 09:35:57 2020 +0800 ovl: drop negative dentry in upper layer Negative dentries of upper layer are useless after construction of overlayfs' own dentry and may keep in the memory long time even after unmount of overlayfs instance. This patch tries to drop unnecessary negative dentry of upper layer to effectively reclaim memory. Signed-off-by: Chengguang Xu Signed-off-by: Miklos Szeredi commit 05acefb4872dae89e772729efb194af754c877e8 Author: Miklos Szeredi Date: Tue Jun 2 22:20:26 2020 +0200 ovl: check permission to open real file Call inode_permission() on real inode before opening regular file on one of the underlying layers. In some cases ovl_permission() already checks access to an underlying file, but it misses the metacopy case, and possibly other ones as well. Removing the redundant permission check from ovl_permission() should be considered later. Signed-off-by: Miklos Szeredi commit 292f902a40c11f043a5ca1305a114da0e523eaa3 Author: Miklos Szeredi Date: Tue Jun 2 22:20:26 2020 +0200 ovl: call secutiry hook in ovl_real_ioctl() Verify LSM permissions for underlying file, since vfs_ioctl() doesn't do it. [Stephen Rothwell] export security_file_ioctl Signed-off-by: Miklos Szeredi commit 48e9912e033050a9e5e895a58c2e5a826d7c6540 Merge: 3f5540032f5d 11399346ac39 Author: Richard Weinberger Date: Wed Jun 3 09:21:52 2020 +0200 Merge tag 'cfi/for-5.8' of gitolite.kernel.org:pub/scm/linux/kernel/git/mtd/linux into mtd/next CFI changes: * Support the absence of protection registers for Intel CFI flashes * Replace zero-length array with flexible-arrays commit 2beee868997485a5718a349c7868260d5ee7378f Author: Masahiro Yamada Date: Mon Jun 1 14:57:04 2020 +0900 modpost: load KBUILD_EXTRA_SYMBOLS files in order Currently, modpost reads extra symbol dump files in the reverse order. If '-e foo -e bar' is given, modpost reads bar, foo, in this order. This is probably not a big deal, but there is no good reason to reverse the order. Read files in the given order. Signed-off-by: Masahiro Yamada commit 4e5ab74c3cbbe7ca2b907a86ce5140e442b340bf Author: Masahiro Yamada Date: Mon Jun 1 14:57:03 2020 +0900 modpost: pass -N option only for modules modpost The built-in only code is not required to have MODULE_IMPORT_NS() to use symbols. So, the namespace is not checked for vmlinux(.o). Do not pass the meaningless -N option to the first pass of modpost. Signed-off-by: Masahiro Yamada commit 89d6117680bd8ac6a86f58576de0bd6905421707 Author: Masahiro Yamada Date: Mon Jun 1 14:57:02 2020 +0900 modpost: move -T option close to the modpost command The '-T -' option reads the file list from stdin. It is clearer to put it close to the piped command. Signed-off-by: Masahiro Yamada commit 91e6ee581270b8ae970f028b898314d73f16870b Author: Masahiro Yamada Date: Mon Jun 1 14:57:01 2020 +0900 modpost: fix -i (--ignore-errors) MAKEFLAGS detection $(filter -i,$(MAKEFLAGS)) works only in limited use-cases. The representation of $(MAKEFLAGS) depends on various factors: - GNU Make version (version 3.8x or version 4.x) - The presence of other flags like -j In my experiments, $(MAKEFLAGS) is expanded as follows: * GNU Make 3.8x: * without -j option: --no-print-directory -Rri * with -j option: --no-print-directory -Rr --jobserver-fds=3,4 -j -i * GNU Make 4.x: * without -j option: irR --no-print-directory * with -j option: irR -j --jobserver-fds=3,4 --no-print-directory For GNU Make 4.x, the flags are grouped as 'irR', which does not work. For the single thread build with GNU Make 3.8x, the flags are grouped as '-Rri', which does not work either. To make it work for all cases, do likewise as commit 6f0fa58e4596 ("kbuild: simplify silent build (-s) detection"). BTW, since commit ff9b45c55b26 ("kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod"), you also need to pass -k option to build final *.ko files. 'make -i -k' ignores compile errors in modules, and build as many remaining *.ko as possible. Please note this feature is kind of dangerous if other modules depend on the broken module because the generated modules will lack the correct module dependency or CRC. Honestly, I am not a big fan of it, but I am keeping this feature. Fixes: eed380f3f593 ("modpost: Optionally ignore secondary errors seen if a single module build fails") Cc: Guenter Roeck Signed-off-by: Masahiro Yamada commit b2c88554912267483baf8b4f5ae0a1bff529f6a3 Author: Masahiro Yamada Date: Mon Jun 1 14:57:00 2020 +0900 kbuild: update modules.order only when contained modules are updated Make modules.order depend on $(obj-m), and use if_changed to build it. This will avoid unneeded update of modules.order, which will be useful to optimize the modpost stage. Currently, the second pass of modpost is always invoked. By checking the timestamp of modules.order, we can avoid the unneeded modpost. Signed-off-by: Masahiro Yamada commit f0d50ca045e44dd7b423c2ae69f6a598f07d93e3 Author: Masahiro Yamada Date: Mon Jun 1 14:56:59 2020 +0900 kbuild: refactor KBUILD_VMLINUX_{OBJS,LIBS} calculation Do not overwrite core-y or drivers-y. Remove libs-y1 and libs-y2. Signed-off-by: Masahiro Yamada commit 1395375c592770fe5158a592944aaeed67fa94ff Merge: 4336b9337824 bf8036a4098d Author: Michael Ellerman Date: Wed Jun 3 13:44:51 2020 +1000 Merge branch 'topic/ppc-kvm' into next Merge one more commit from the topic branch we shared with the kvm-ppc tree. This brings in a fix to the code that scans for dirty pages during migration of a VM, which was incorrectly triggering a warning. commit d6f9469a03d832dcd17041ed67774ffb5f3e73b3 Merge: cadf32234b6f 34f853b849eb Author: Linus Torvalds Date: Tue Jun 2 20:16:55 2020 -0700 Merge tag 'erofs-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "The most interesting part is the new mount api conversion, which is actually a old patch already pending for several cycles. And the others are recent trivial cleanups here. Summary: - Convert to use the new mount apis - Some random cleanup patches" * tag 'erofs-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: suppress false positive last_block warning erofs: convert to use the new mount fs_context api erofs: code cleanup by removing ifdef macro surrounding commit cadf32234b6f6dd96a0892bf915e3ee8c438cf07 Merge: f3cdc8ae116e 7aba5dcc2346 Author: Linus Torvalds Date: Tue Jun 2 20:11:35 2020 -0700 Merge tag 'jfs-5.8' of git://github.com/kleikamp/linux-shaggy Pull JFS update from David Kleikamp: "Replace zero-length array in JFS" * tag 'jfs-5.8' of git://github.com/kleikamp/linux-shaggy: jfs: Replace zero-length array with flexible-array member commit f3cdc8ae116e27d84e1f33c7a2995960cebb73ac Merge: 8eeae5bae123 2166e5edce9a Author: Linus Torvalds Date: Tue Jun 2 19:59:25 2020 -0700 Merge tag 'for-5.8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "Highlights: - speedup dead root detection during orphan cleanup, eg. when there are many deleted subvolumes waiting to be cleaned, the trees are now looked up in radix tree instead of a O(N^2) search - snapshot creation with inherited qgroup will mark the qgroup inconsistent, requires a rescan - send will emit file capabilities after chown, this produces a stream that does not need postprocessing to set the capabilities again - direct io ported to iomap infrastructure, cleaned up and simplified code, notably removing last use of struct buffer_head in btrfs code Core changes: - factor out backreference iteration, to be used by ordinary backreferences and relocation code - improved global block reserve utilization * better logic to serialize requests * increased maximum available for unlink * improved handling on large pages (64K) - direct io cleanups and fixes * simplify layering, where cloned bios were unnecessarily created for some cases * error handling fixes (submit, endio) * remove repair worker thread, used to avoid deadlocks during repair - refactored block group reading code, preparatory work for new type of block group storage that should improve mount time on large filesystems Cleanups: - cleaned up (and slightly sped up) set/get helpers for metadata data structure members - root bit REF_COWS got renamed to SHAREABLE to reflect the that the blocks of the tree get shared either among subvolumes or with the relocation trees Fixes: - when subvolume deletion fails due to ENOSPC, the filesystem is not turned read-only - device scan deals with devices from other filesystems that changed ownership due to overwrite (mkfs) - fix a race between scrub and block group removal/allocation - fix long standing bug of a runaway balance operation, printing the same line to the syslog, caused by a stale status bit on a reloc tree that prevented progress - fix corrupt log due to concurrent fsync of inodes with shared extents - fix space underflow for NODATACOW and buffered writes when it for some reason needs to fallback to COW mode" * tag 'for-5.8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (133 commits) btrfs: fix space_info bytes_may_use underflow during space cache writeout btrfs: fix space_info bytes_may_use underflow after nocow buffered write btrfs: fix wrong file range cleanup after an error filling dealloc range btrfs: remove redundant local variable in read_block_for_search btrfs: open code key_search btrfs: split btrfs_direct_IO to read and write part btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK fs: remove dio_end_io() btrfs: switch to iomap_dio_rw() for dio iomap: remove lockdep_assert_held() iomap: add a filesystem hook for direct I/O bio submission fs: export generic_file_buffered_read() btrfs: turn space cache writeout failure messages into debug messages btrfs: include error on messages about failure to write space/inode caches btrfs: remove useless 'fail_unlock' label from btrfs_csum_file_blocks() btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums btrfs: make checksum item extension more efficient btrfs: fix corrupt log due to concurrent fsync of inodes with shared extents btrfs: unexport btrfs_compress_set_level() btrfs: simplify iget helpers ... commit 8eeae5bae1239c030ba0b34cac97ebd5e7ec1886 Merge: 96ed320d527e 2c567af418e3 Author: Linus Torvalds Date: Tue Jun 2 19:48:41 2020 -0700 Merge tag 'vfs-5.8-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull DAX updates part two from Darrick Wong: "This time around, we're hoisting the DONTCACHE flag from XFS into the VFS so that we can make the incore DAX mode changes become effective sooner. We can't change the file data access mode on a live inode because we don't have a safe way to change the file ops pointers. The incore state change becomes effective at inode loading time, which can happen if the inode is evicted. Therefore, we're making it so that filesystems can ask the VFS to evict the inode as soon as the last holder drops. The per-fs changes to make this call this will be in subsequent pull requests from Ted and myself. Summary: - Introduce DONTCACHE flags for dentries and inodes. This hint will cause the VFS to drop the associated objects immediately after the last put, so that we can change the file access mode (DAX or page cache) on the fly" * tag 'vfs-5.8-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: fs: Introduce DCACHE_DONTCACHE fs: Lift XFS_IDONTCACHE to the VFS layer commit 96ed320d527eb071389f69cbd6772440805af7d7 Merge: 16d91548d105 83d9088659e8 Author: Linus Torvalds Date: Tue Jun 2 19:45:12 2020 -0700 Merge tag 'vfs-5.8-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull DAX updates part one from Darrick Wong: "After many years of LKML-wrangling about how to enable programs to query and influence the file data access mode (DAX) when a filesystem resides on storage devices such as persistent memory, Ira Weiny has emerged with a proposed set of standard behaviors that has not been shot down by anyone! We're more or less standardizing on the current XFS behavior and adapting ext4 to do the same. This is the first of a handful pull requests that will make ext4 and XFS present a consistent interface for user programs that care about DAX. We add a statx attribute that programs can check to see if DAX is enabled on a particular file. Then, we update the DAX documentation to spell out the user-visible behaviors that filesystems will guarantee (until the next storage industry shakeup). The on-disk inode flag has been in XFS for a few years now. Summary: - Clean up io_is_direct. - Add a new statx flag to indicate when file data access is being done via DAX (as opposed to the page cache). - Update the documentation for how system administrators and application programmers can take advantage of the (still experimental DAX) feature" Link: https://lore.kernel.org/lkml/20200505002016.1085071-1-ira.weiny@intel.com/ * tag 'vfs-5.8-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: Documentation/dax: Update Usage section fs/stat: Define DAX statx attribute fs: Remove unneeded IS_DAX() check in io_is_direct() commit 16d91548d1057691979de4686693f0ff92f46000 Merge: d9afbb350990 6dcde60efd94 Author: Linus Torvalds Date: Tue Jun 2 19:21:40 2020 -0700 Merge tag 'xfs-5.8-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Darrick Wong: "Most of the changes this cycle are refactoring of existing code in preparation for things landing in the future. We also fixed various problems and deficiencies in the quota implementation, and (I hope) the last of the stale read vectors by forcing write allocations to go through the unwritten state until the write completes. Summary: - Various cleanups to remove dead code, unnecessary conditionals, asserts, etc. - Fix a linker warning caused by xfs stuffing '-g' into CFLAGS redundantly. - Tighten up our dmesg logging to ensure that everything is prefixed with 'XFS' for easier grepping. - Kill a bunch of typedefs. - Refactor the deferred ops code to reduce indirect function calls. - Increase type-safety with the deferred ops code. - Make the DAX mount options a tri-state. - Fix some error handling problems in the inode flush code and clean up other inode flush warts. - Refactor log recovery so that each log item recovery functions now live with the other log item processing code. - Fix some SPDX forms. - Fix quota counter corruption if the fs crashes after running quotacheck but before any dquots get logged. - Don't fail metadata verification on zero-entry attr leaf blocks, since they're just part of the disk format now due to a historic lack of log atomicity. - Don't allow SWAPEXT between files with different [ugp]id when quotas are enabled. - Refactor inode fork reading and verification to run directly from the inode-from-disk function. This means that we now actually guarantee that _iget'ted inodes are totally verified and ready to go. - Move the incore inode fork format and extent counts to the ifork structure. - Scalability improvements by reducing cacheline pingponging in struct xfs_mount. - More scalability improvements by removing m_active_trans from the hot path. - Fix inode counter update sanity checking to run /only/ on debug kernels. - Fix longstanding inconsistency in what error code we return when a program hits project quota limits (ENOSPC). - Fix group quota returning the wrong error code when a program hits group quota limits. - Fix per-type quota limits and grace periods for group and project quotas so that they actually work. - Allow extension of individual grace periods. - Refactor the non-reclaim inode radix tree walking code to remove a bunch of stupid little functions and straighten out the inconsistent naming schemes. - Fix a bug in speculative preallocation where we measured a new allocation based on the last extent mapping in the file instead of looking farther for the last contiguous space allocation. - Force delalloc writes to unwritten extents. This closes a stale disk contents exposure vector if the system goes down before the write completes. - More lockdep whackamole" * tag 'xfs-5.8-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (129 commits) xfs: more lockdep whackamole with kmem_alloc* xfs: force writes to delalloc regions to unwritten xfs: refactor xfs_iomap_prealloc_size xfs: measure all contiguous previous extents for prealloc size xfs: don't fail unwritten extent conversion on writeback due to edquot xfs: rearrange xfs_inode_walk_ag parameters xfs: straighten out all the naming around incore inode tree walks xfs: move xfs_inode_ag_iterator to be closer to the perag walking code xfs: use bool for done in xfs_inode_ag_walk xfs: fix inode ag walk predicate function return values xfs: refactor eofb matching into a single helper xfs: remove __xfs_icache_free_eofblocks xfs: remove flags argument from xfs_inode_ag_walk xfs: remove xfs_inode_ag_iterator_flags xfs: remove unused xfs_inode_ag_iterator function xfs: replace open-coded XFS_ICI_NO_TAG xfs: move eofblocks conversion function to xfs_ioctl.c xfs: allow individual quota grace period extension xfs: per-type quota timers and warn limits xfs: switch xfs_get_defquota to take explicit type ... commit 824c874abc1d99121934364647dd8ed7e71ce08e Merge: 7104e162b772 cf51e129b968 Author: David S. Miller Date: Tue Jun 2 18:46:55 2020 -0700 Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Some ptrace fixes from Al. Signed-off-by: David S. Miller commit 7104e162b772c777d84298f25c8431da4cf5206d Merge: ee7c7953134e 1996d47a0db2 Author: David S. Miller Date: Tue Jun 2 18:45:51 2020 -0700 Merge branch 'sparc32-SRMMU-fixes-for-SMP' Will Deacon says: ==================== sparc32 SRMMU fixes for SMP Enabling SMP for sparc32 uncovered some issues in the SRMMU page-table allocation code. One of these was introduced by me, but the other two seem to have been there a while and are probably just exposed more easily by my recent changes. Tested on QEMU. I'm assuming these will go via David's tree. ==================== Signed-off-by: David S. Miller commit 1996d47a0db27a3071f1a6587123185ba98c4585 Author: Will Deacon Date: Tue May 26 18:33:02 2020 +0100 sparc32: mm: Only call ctor()/dtor() functions for first and last user The SRMMU page-table allocator allocates multiple PTE tables per page, since they are only 1K in size. However, this means that calls to pgtable_pte_page_{ctor,dtor}() must be serialised and performed only by the first and last page-table allocation for the page respectively. Use the page reference count to track how many PTE tables we have allocated for a given page returned by the SRMMU allocator and only call the ctor()/dtor() functions for the first and last user respectively. Cc: David S. Miller Fixes: 8c8f3156dd40 ("sparc32: mm: Reduce allocation size for PMD and PTE tables") Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit 60bccaa671bce7ed040d9511b0738ca3b0a0e9ff Author: Will Deacon Date: Tue May 26 18:33:01 2020 +0100 sparc32: mm: Disable SPLIT_PTLOCK_CPUS The SRMMU page-table allocator is not compatible with SPLIT_PTLOCK_CPUS for two major reasons: 1. Pages are allocated via memblock, and therefore the ptl is not cleared by prep_new_page(), which is expected by ptlock_init() 2. Multiple PTE tables can exist in a single page, causing them to share the same ptl and deadlock when attempting to take the same lock twice (e.g. as part of copy_page_range()). Ensure that SPLIT_PTLOCK_CPUS is not selected for SPARC32. Cc: David S. Miller Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit 454b0289c6b5f2c66164654b80212d15fbef7a03 Author: Will Deacon Date: Tue May 26 18:33:00 2020 +0100 sparc32: mm: Don't try to free page-table pages if ctor() fails The pages backing page-table allocations for SRMMU are allocated via memblock as part of the "nocache" region initialisation during srmmu_paging_init() and should not be freed even if a later call to pgtable_pte_page_ctor() fails. Remove the broken call to __free_page(). Cc: David S. Miller Cc: Kirill A. Shutemov Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail") Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit ee7c7953134e23af41055c41a124b4f776d813c3 Author: Mike Rapoport Date: Sun May 24 19:53:58 2020 +0300 sparc32: register memory occupied by kernel as memblock.memory sparc32 never registered the memory occupied by the kernel image with memblock_add() and it only reserved this memory with meblock_reserve(). With openbios as system firmware, the memory occupied by the kernel is reserved in openbios and removed from mem.available. The prom setup code in the kernel uses mem.available to set up the memory banks and essentially there is a hole for the memory occupied by the kernel image. Later in bootmem_init() this memory is memblock_reserve()d. Up until recently, memmap initialization would call __init_single_page() for the pages in that hole, the free_low_memory_core_early() would mark them as reserved and everything would be Ok. After the change in memmap initialization introduced by the commit "mm: memmap_init: iterate over memblock regions rather that check each PFN", the hole is skipped and the page structs for it are not initialized. And when they are passed from memblock to page allocator as reserved, the latter gets confused. Simply registering the memory occupied by the kernel with memblock_add() resolves this issue. Tested on qemu-system-sparc with Debian Etch [1] userspace. [1] https://people.debian.org/~aurel32/qemu/sparc/debian_etch_sparc_small.qcow2 Signed-off-by: Mike Rapoport Link: https://lkml.kernel.org/r/20200517000050.GA87467@roeck-us.nlllllet/ Acked-by: David S. Miller Signed-off-by: David S. Miller commit 7b6668d8b806b013cfe084aeb72c7eebb578cb50 Author: Stanley Chu Date: Sat May 30 22:12:00 2020 +0800 scsi: ufs: Remove redundant urgent_bkop_lvl initialization In ufshcd_probe_hba(), all BKOP SW tracking variables can be reset together in ufshcd_force_reset_auto_bkops(), thus urgent_bkop_lvl initialization in the beginning of ufshcd_probe_hba() can be merged into ufshcd_force_reset_auto_bkops(). Link: https://lore.kernel.org/r/20200530141200.4616-1-stanley.chu@mediatek.com Reviewed-by: Avri Altman Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit be32acff43800c87dc5c707f5d47cc607b76b653 Author: Can Guo Date: Wed May 27 19:24:42 2020 -0700 scsi: ufs: Don't update urgent bkops level when toggling auto bkops Urgent bkops level is used to compare against actual bkops status read from UFS device. Urgent bkops level is set during initialization and might be updated in exception event handler during runtime. But it should not be updated to the actual bkops status every time when auto bkops is toggled. Otherwise, if urgent bkops level is updated to 0, auto bkops shall always be kept enabled. Link: https://lore.kernel.org/r/1590632686-17866-1-git-send-email-cang@codeaurora.org Fixes: 24366c2afbb0 ("scsi: ufs: Recheck bkops level if bkops is disabled") Reviewed-by: Stanley Chu Signed-off-by: Can Guo Signed-off-by: Martin K. Petersen commit 89523cb8a67cea2642deb19042a15fdd8c4138d4 Author: Colin Ian King Date: Wed May 27 12:52:42 2020 +0100 scsi: qedf: Remove redundant initialization of variable rc The variable rc is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Link: https://lore.kernel.org/r/20200527115242.172344-1-colin.king@canonical.com Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 243f5908b13509d5c246e1ce660dbd2cf7051a96 Author: Anupam Aggarwal Date: Fri May 29 17:56:00 2020 +0530 sparc: remove unused header file nfs_fs.h Remove unused header file linux/nfs_fs.h Signed-off-by: Anupam Aggarwal Signed-off-by: Vivek Trivedi Signed-off-by: Amit Sahrawat Signed-off-by: David S. Miller commit 61e6ba03ea26f0205e535862009ff6ffdbf4de0c Author: Suganath Prabu S Date: Thu May 28 10:56:17 2020 -0400 scsi: mpt3sas: Fix memset() in non-RDPQ mode Fix memset() accessing out of range address when reply_queue count is less than RDPQ_MAX_INDEX_IN_ONE_CHUNK (i.e. 16) in non-RDPQ mode. In non-RDPQ mode, the driver allocates a single contiguous pool of size reply_queue's count * reqly_post_free_sz. But the driver is always memsetting this pool with size 16 * reqly_post_free_sz. If reply queue count is less than 16 (i.e. when MSI-X vectors enabled < 16), the driver is accessing out of range address and this results in 'BUG: unable to handle kernel paging request at fff0x...x' bug. Make driver use dma_pool_zalloc() API to allocate and zero the pool. Link: https://lore.kernel.org/r/20200528145617.27252-1-suganath-prabu.subramani@broadcom.com Fixes: 8012209eb26b ("scsi: mpt3sas: Handle RDPQ DMA allocation in same 4G region") Signed-off-by: Suganath Prabu S Signed-off-by: Martin K. Petersen commit 0267ffce562c8bbf9b57ebe0e38445ad04972890 Author: Qiushi Wu Date: Thu May 28 15:13:53 2020 -0500 scsi: iscsi: Fix reference count leak in iscsi_boot_create_kobj kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Link: https://lore.kernel.org/r/20200528201353.14849-1-wu000273@umn.edu Reviewed-by: Lee Duncan Signed-off-by: Qiushi Wu Signed-off-by: Martin K. Petersen commit 8c4e0f212398cdd1eb4310a5981d06a723cdd24f Author: Bodo Stroesser Date: Thu May 28 21:31:08 2020 +0200 scsi: target: tcmu: Fix size in calls to tcmu_flush_dcache_range 1) If remaining ring space before the end of the ring is smaller then the next cmd to write, tcmu writes a padding entry which fills the remaining space at the end of the ring. Then tcmu calls tcmu_flush_dcache_range() with the size of struct tcmu_cmd_entry as data length to flush. If the space filled by the padding was smaller then tcmu_cmd_entry, tcmu_flush_dcache_range() is called for an address range reaching behind the end of the vmalloc'ed ring. tcmu_flush_dcache_range() in a loop calls flush_dcache_page(virt_to_page(start)); for every page being part of the range. On x86 the line is optimized out by the compiler, as flush_dcache_page() is empty on x86. But I assume the above can cause trouble on other architectures that really have a flush_dcache_page(). For paddings only the header part of an entry is relevant due to alignment rules the header always fits in the remaining space, if padding is needed. So tcmu_flush_dcache_range() can safely be called with sizeof(entry->hdr) as the length here. 2) After it has written a command to cmd ring, tcmu calls tcmu_flush_dcache_range() using the size of a struct tcmu_cmd_entry as data length to flush. But if a command needs many iovecs, the real size of the command may be bigger then tcmu_cmd_entry, so a part of the written command is not flushed then. Link: https://lore.kernel.org/r/20200528193108.9085-1-bstroesser@ts.fujitsu.com Acked-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit d9afbb3509900a953f5cf90bc57e793ee80c1108 Merge: f41030a20b38 56f2e3b7d819 Author: Linus Torvalds Date: Tue Jun 2 17:36:24 2020 -0700 Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull lockdown update from James Morris: "An update for the security subsystem to allow unprivileged users to see the status of the lockdown feature. From Jeremy Cline" Also an added comment to describe CAP_SETFCAP. * 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: capabilities: add description for CAP_SETFCAP lockdown: Allow unprivileged users to see lockdown status commit 193ba03141bb987c3af985f6479840030fec0534 Author: YueHaibing Date: Tue Jun 2 14:16:35 2020 +0800 IB/hfi1: Use free_netdev() in hfi1_netdev_free() dummy_netdev shold be freed by free_netdev() instead of kfree(). Also remove unneeded variable 'priv' Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") Link: https://lore.kernel.org/r/20200602061635.31224-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Reported-by: kbuild test robot Reported-by: Dan Carpenter Reviewed-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit f41030a20b38552a2da3b3f6bc9e7a78637d6c23 Merge: 9d99b1647fa5 fe5a90b8c149 Author: Linus Torvalds Date: Tue Jun 2 17:16:47 2020 -0700 Merge tag 'selinux-pr-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull SELinux updates from Paul Moore: "The highlights: - A number of improvements to various SELinux internal data structures to help improve performance. We move the role transitions into a hash table. In the content structure we shift from hashing the content string (aka SELinux label) to the structure itself, when it is valid. This last change not only offers a speedup, but it helps us simplify the code some as well. - Add a new SELinux policy version which allows for a more space efficient way of storing the filename transitions in the binary policy. Given the default Fedora SELinux policy with the unconfined module enabled, this change drops the policy size from ~7.6MB to ~3.3MB. The kernel policy load time dropped as well. - Some fixes to the error handling code in the policy parser to properly return error codes when things go wrong" * tag 'selinux-pr-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: netlabel: Remove unused inline function selinux: do not allocate hashtabs dynamically selinux: fix return value on error in policydb_read() selinux: simplify range_write() selinux: fix error return code in policydb_read() selinux: don't produce incorrect filename_trans_count selinux: implement new format of filename transitions selinux: move context hashing under sidtab selinux: hash context structure directly selinux: store role transitions in a hash table selinux: drop unnecessary smp_load_acquire() call selinux: fix warning Comparison to bool commit 9d99b1647fa56805c1cfef2d81ee7b9855359b62 Merge: 91681e8480af 9d44a121c5a7 Author: Linus Torvalds Date: Tue Jun 2 17:13:37 2020 -0700 Merge tag 'audit-pr-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit updates from Paul Moore: "Summary of the significant patches: - Record information about binds/unbinds to the audit multicast socket. This helps identify which processes have/had access to the information in the audit stream. - Cleanup and add some additional information to the netfilter configuration events collected by audit. - Fix some of the audit error handling code so we don't leak network namespace references" * tag 'audit-pr-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: add subj creds to NETFILTER_CFG record to audit: Replace zero-length array with flexible-array audit: make symbol 'audit_nfcfgs' static netfilter: add audit table unregister actions audit: tidy and extend netfilter_cfg x_tables audit: log audit netlink multicast bind and unbind audit: fix a net reference leak in audit_list_rules_send() audit: fix a net reference leak in audit_send_reply() commit 91681e8480af21dcab2c0d91bb1b7851cbc83d81 Merge: 1ee08de1e234 27acbf41be39 Author: Linus Torvalds Date: Tue Jun 2 17:12:07 2020 -0700 Merge tag 'tomoyo-pr-20200601' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1 Pull tomoyo update from Tetsuo Handa: "One patch for suppressing coccicheck's warning" * tag 'tomoyo-pr-20200601' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1: tomoyo: use true for bool variable commit 87d9e568496aeb519f1da61f54ac0dcb8d37561e Author: Dan Carpenter Date: Fri May 29 11:39:18 2020 +0300 RDMA/hns: Uninitialized variable in modify_qp_init_to_rtr() The "dmac" variable is used before it is initialized. Fixes: 494c3b312255 ("RDMA/hns: Refactor the QP context filling process related to WQE buffer configure") Link: https://lore.kernel.org/r/20200529083918.GA1298465@mwanda Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 278f74b39e641e1315e1b7f11b26aa1f989a40fc Author: Chuck Lever Date: Sat May 30 13:52:58 2020 -0400 RDMA/core: Move and rename trace_cm_id_create() The restrack ID for an rdma_cm_id is not assigned until it is associated with a device. Here's an example I captured while testing NFS/RDMA's support for DEVICE_REMOVAL. The new tracepoint name is "cm_id_attach". <...>-4261 [001] 366.581299: cm_event_handler: cm.id=0 src=0.0.0.0:45919 dst=192.168.2.55:20049 tos=0 ADDR_ERROR (1/-19) <...>-4261 [001] 366.581304: cm_event_done: cm.id=0 src=0.0.0.0:45919 dst=192.168.2.55:20049 tos=0 ADDR_ERROR consumer returns 0 <...>-1950 [000] 366.581309: cm_id_destroy: cm.id=0 src=0.0.0.0:45919 dst=192.168.2.55:20049 tos=0 <...>-7 [001] 369.589400: cm_event_handler: cm.id=0 src=0.0.0.0:49023 dst=192.168.2.55:20049 tos=0 ADDR_ERROR (1/-19) <...>-7 [001] 369.589404: cm_event_done: cm.id=0 src=0.0.0.0:49023 dst=192.168.2.55:20049 tos=0 ADDR_ERROR consumer returns 0 <...>-1950 [000] 369.589407: cm_id_destroy: cm.id=0 src=0.0.0.0:49023 dst=192.168.2.55:20049 tos=0 <...>-4261 [001] 372.597650: cm_id_attach: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 device=mlx4_0 <...>-4261 [001] 372.597652: cm_event_handler: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 ADDR_RESOLVED (0/0) <...>-4261 [001] 372.597654: cm_event_done: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 ADDR_RESOLVED consumer returns 0 <...>-4261 [001] 372.597738: cm_event_handler: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 ROUTE_RESOLVED (2/0) <...>-4261 [001] 372.597740: cm_event_done: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 ROUTE_RESOLVED consumer returns 0 <...>-4691 [007] 372.600101: cm_qp_create: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 pd.id=2 qp_type=RC send_wr=4091 recv_wr=256 qp_num=530 rc=0 <...>-4691 [007] 372.600207: cm_send_req: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 qp_num=530 <...>-185 [002] 372.601212: cm_send_mra: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 <...>-185 [002] 372.601362: cm_send_rtu: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 <...>-185 [002] 372.601372: cm_event_handler: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 ESTABLISHED (9/0) <...>-185 [002] 372.601379: cm_event_done: cm.id=0 src=192.168.2.51:47492 dst=192.168.2.55:20049 tos=0 ESTABLISHED consumer returns 0 Fixes: ed999f820a6c ("RDMA/cma: Add trace points in RDMA Connection Manager") Link: https://lore.kernel.org/r/20200530174934.21362.56754.stgit@manet.1015granger.net Signed-off-by: Chuck Lever Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 24c567ff75d342ed2392cd470c3acd29a09e03ba Author: Dan Carpenter Date: Sat May 30 17:02:24 2020 +0300 IB/hfi1: Fix hfi1_netdev_rx_init() error handling The hfi1_vnic_up() function doesn't check whether hfi1_netdev_rx_init() returns errors. In hfi1_vnic_init() we need to change the code to preserve the error code instead of returning success. Fixes: 2280740f01ae ("IB/hfi1: Virtual Network Interface Controller (VNIC) HW support") Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") Link: https://lore.kernel.org/r/20200530140224.GA1330098@mwanda Signed-off-by: Dan Carpenter Signed-off-by: Jason Gunthorpe commit 4d12c04caa88cd3115f25acd832a7cddb698981b Author: Jason Gunthorpe Date: Thu May 28 16:45:55 2020 -0300 RDMA: Remove 'max_map_per_fmr' Now that FMR support is gone, this attribute can be deleted from all places. Link: https://lore.kernel.org/r/13-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 649392bf75a423287a9c4936b341677f12e8cf0b Author: Jason Gunthorpe Date: Thu May 28 16:45:54 2020 -0300 RDMA: Remove 'max_fmr' Now that FMR support is gone, this attribute can be deleted from all places. Link: https://lore.kernel.org/r/12-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Reviewed-by: Max Gurtovoy Reviewed-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit 3a578152a9208bbcd196210be2f5396744cda302 Author: Max Gurtovoy Date: Thu May 28 16:45:53 2020 -0300 RDMA/core: Remove FMR device ops After removing FMR support from all the RDMA ULPs and providers, there is no need to keep FMR operation for IB devices. Link: https://lore.kernel.org/r/11-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 22c9cc2408b734d2e5b193d287572cd2c7011183 Author: Max Gurtovoy Date: Thu May 28 16:45:52 2020 -0300 RDMA/rdmavt: Remove FMR memory registration Use FRWR method to register memory by default and remove the ancient and unsafe FMR method. Link: https://lore.kernel.org/r/10-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Max Gurtovoy Tested-by: Dennis Dalessandro Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit d6747b3715561ddc14e805e7ad4dfab2c9f245bb Author: Max Gurtovoy Date: Thu May 28 16:45:51 2020 -0300 RDMA/mthca: Remove FMR support for memory registration Remove the ancient and unsafe FMR method. Link: https://lore.kernel.org/r/9-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Reviewed-by: Max Gurtovoy Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 1f55b7ab907d373581e9abf3fc4b24ed19cf831f Author: Max Gurtovoy Date: Thu May 28 16:45:50 2020 -0300 RDMA/mlx4: Remove FMR support for memory registration HCA's that are driven by mlx4 driver support FRWR method to register memory. Remove the ancient and unsafe FMR method. Link: https://lore.kernel.org/r/8-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Reviewed-by: Max Gurtovoy Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit f0c73c70db99e30f790572b97531aa569ec1ba60 Author: Jason Gunthorpe Date: Thu May 28 16:45:49 2020 -0300 RDMA/i40iw: Remove FMR leftovers The ibfmr member is never referenced, remove it. Link: https://lore.kernel.org/r/7-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Reviewed-by: Max Gurtovoy Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 7c08bc195665201c207fb3fd91a75a8f77c3b3b0 Author: Jason Gunthorpe Date: Thu May 28 16:45:48 2020 -0300 RDMA/bnxt_re: Remove FMR leftovers The bnxt_re_fmr struct is never referenced and the max_fmr items in bnxt_qplib_dev_attr are never read. Link: https://lore.kernel.org/r/6-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit d29d58e772ecde84df15f547dc06f0b7afc7ae5c Author: Gal Pressman Date: Thu May 28 16:45:47 2020 -0300 RDMA/mlx5: Remove FMR leftovers Remove a few leftovers from FMR functionality which are no longer used. Link: https://lore.kernel.org/r/5-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Gal Pressman Signed-off-by: Max Gurtovoy Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4e373d5417ecbb4f438a8500f0379a2fc29c2643 Author: Max Gurtovoy Date: Thu May 28 16:45:46 2020 -0300 RDMA/core: Remove FMR pool API This ancient and unsafe method for memory registration is no longer used by any RDMA based ULP. Remove the FMR pool API from the core driver. Link: https://lore.kernel.org/r/4-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 07549ee21ce5247143ffb069bf838025d86b908c Author: Max Gurtovoy Date: Thu May 28 16:45:45 2020 -0300 RDMA/rds: Remove FMR support for memory registration Use FRWR method for memory registration by default and remove the ancient and unsafe FMR method. Link: https://lore.kernel.org/r/3-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit f273ad4f8d90bb87d2259fe37caee82e9aa7906c Author: Max Gurtovoy Date: Thu May 28 16:45:44 2020 -0300 RDMA/srp: Remove support for FMR memory registration FMR is not supported on most recent RDMA devices (that use fast memory registration mechanism). Also, FMR was recently removed from NFS/RDMA ULP. Link: https://lore.kernel.org/r/2-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 1fc431320a53f3e9b33b399667c8788fa00eb8b0 Author: Israel Rukshin Date: Thu May 28 16:45:43 2020 -0300 RDMA/iser: Remove support for FMR memory registration FMR is not supported on most recent RDMA devices (that use fast memory registration mechanism). Also, FMR was recently removed from NFS/RDMA ULP. Link: https://lore.kernel.org/r/1-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe commit 56f2e3b7d819f4fa44857ba81aa6870f18714ea0 Author: Stefan Hajnoczi Date: Tue Jun 2 10:17:28 2020 +0100 capabilities: add description for CAP_SETFCAP Document the purpose of CAP_SETFCAP. For some reason this capability had no description while the others did. Signed-off-by: Stefan Hajnoczi Signed-off-by: James Morris commit fd2206e4e97b5bae422d9f2f9ebbc79bc97e44a5 Author: Jens Axboe Date: Tue Jun 2 16:40:47 2020 -0600 io_uring: disallow close of ring itself A previous commit enabled this functionality, which also enabled O_PATH to work correctly with io_uring. But we can't safely close the ring itself, as the file handle isn't reference counted inside io_uring_enter(). Instead of jumping through hoops to enable ring closure, add a "soft" ->needs_file option, ->needs_file_no_error. This enables O_PATH file descriptors to work, but still catches the case of trying to close the ring itself. Reported-by: Jann Horn Fixes: 904fbcb115c8 ("io_uring: remove 'fd is io_uring' from close path") Signed-off-by: Jens Axboe commit a75ca9303175d36af93c0937dd9b1a6422908b8d Author: yu kuai Date: Mon Jun 1 20:38:56 2020 +0800 block/bio-integrity: don't free 'buf' if bio_integrity_add_page() failed commit e7bf90e5afe3 ("block/bio-integrity: fix a memory leak bug") added a kfree() for 'buf' if bio_integrity_add_page() returns '0'. However, the object will be freed in bio_integrity_free() since 'bio->bi_opf' and 'bio->bi_integrity' were set previousy in bio_integrity_alloc(). Fixes: commit e7bf90e5afe3 ("block/bio-integrity: fix a memory leak bug") Signed-off-by: yu kuai Reviewed-by: Ming Lei Reviewed-by: Bob Liu Acked-by: Martin K. Petersen Signed-off-by: Jens Axboe commit 065fcfd49763ec71ae345bb5c5a74f961031e70e Author: Thadeu Lima de Souza Cascardo Date: Tue Jun 2 15:38:37 2020 -0300 selftests: net: ip_defrag: ignore EPERM When running with conntrack rules, the dropped overlap fragments may cause EPERM to be returned to sendto. Instead of completely failing, just ignore those errors and continue. If this causes packets with overlap fragments to be dropped as expected, that is okay. And if it causes packets that are expected to be received to be dropped, which should not happen, it will be detected as failure. Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: David S. Miller commit 1ee08de1e234d95b5b4f866878b72fceb5372904 Merge: bce159d73409 7b53d59859bc Author: Linus Torvalds Date: Tue Jun 2 15:42:50 2020 -0700 Merge tag 'for-5.8/io_uring-2020-06-01' of git://git.kernel.dk/linux-block Pull io_uring updates from Jens Axboe: "A relatively quiet round, mostly just fixes and code improvements. In particular: - Make statx just use the generic statx handler, instead of open coding it. We don't need that anymore, as we always call it async safe (Bijan) - Enable closing of the ring itself. Also fixes O_PATH closure (me) - Properly name completion members (me) - Batch reap of dead file registrations (me) - Allow IORING_OP_POLL with double waitqueues (me) - Add tee(2) support (Pavel) - Remove double off read (Pavel) - Fix overflow cancellations (Pavel) - Improve CQ timeouts (Pavel) - Async defer drain fixes (Pavel) - Add support for enabling/disabling notifications on a registered eventfd (Stefano) - Remove dead state parameter (Xiaoguang) - Disable SQPOLL submit on dying ctx (Xiaoguang) - Various code cleanups" * tag 'for-5.8/io_uring-2020-06-01' of git://git.kernel.dk/linux-block: (29 commits) io_uring: fix overflowed reqs cancellation io_uring: off timeouts based only on completions io_uring: move timeouts flushing to a helper statx: hide interfaces no longer used by io_uring io_uring: call statx directly statx: allow system call to be invoked from io_uring io_uring: add io_statx structure io_uring: get rid of manual punting in io_close io_uring: separate DRAIN flushing into a cold path io_uring: don't re-read sqe->off in timeout_prep() io_uring: simplify io_timeout locking io_uring: fix flush req->refs underflow io_uring: don't submit sqes when ctx->refs is dying io_uring: async task poll trigger cleanup io_uring: add tee(2) support splice: export do_tee() io_uring: don't repeat valid flag list io_uring: rename io_file_put() io_uring: remove req->needs_fixed_files io_uring: cleanup io_poll_remove_one() logic ... commit bce159d734091fe31340976081577333f52a85e4 Merge: 750a02ab8d3c 0c8d3fceade2 Author: Linus Torvalds Date: Tue Jun 2 15:37:03 2020 -0700 Merge tag 'for-5.8/drivers-2020-06-01' of git://git.kernel.dk/linux-block Pull block driver updates from Jens Axboe: "On top of the core changes, here are the block driver changes for this merge window: - NVMe changes: - NVMe over Fibre Channel protocol updates, which also reach over to drivers/scsi/lpfc (James Smart) - namespace revalidation support on the target (Anthony Iliopoulos) - gcc zero length array fix (Arnd Bergmann) - nvmet cleanups (Chaitanya Kulkarni) - misc cleanups and fixes (me, Keith Busch, Sagi Grimberg) - use a SRQ per completion vector (Max Gurtovoy) - fix handling of runtime changes to the queue count (Weiping Zhang) - t10 protection information support for nvme-rdma and nvmet-rdma (Israel Rukshin and Max Gurtovoy) - target side AEN improvements (Chaitanya Kulkarni) - various fixes and minor improvements all over, icluding the nvme part of the lpfc driver" - Floppy code cleanup series (Willy, Denis) - Floppy contention fix (Jiri) - Loop CONFIGURE support (Martijn) - bcache fixes/improvements (Coly, Joe, Colin) - q->queuedata cleanups (Christoph) - Get rid of ioctl_by_bdev (Christoph, Stefan) - md/raid5 allocation fixes (Coly) - zero length array fixes (Gustavo) - swim3 task state fix (Xu)" * tag 'for-5.8/drivers-2020-06-01' of git://git.kernel.dk/linux-block: (166 commits) bcache: configure the asynchronous registertion to be experimental bcache: asynchronous devices registration bcache: fix refcount underflow in bcache_device_free() bcache: Convert pr_ uses to a more typical style bcache: remove redundant variables i and n lpfc: Fix return value in __lpfc_nvme_ls_abort lpfc: fix axchg pointer reference after free and double frees lpfc: Fix pointer checks and comments in LS receive refactoring nvme: set dma alignment to qword nvmet: cleanups the loop in nvmet_async_events_process nvmet: fix memory leak when removing namespaces and controllers concurrently nvmet-rdma: add metadata/T10-PI support nvmet: add metadata support for block devices nvmet: add metadata/T10-PI support nvme: add Metadata Capabilities enumerations nvmet: rename nvmet_check_data_len to nvmet_check_transfer_len nvmet: rename nvmet_rw_len to nvmet_rw_data_len nvmet: add metadata characteristics for a namespace nvme-rdma: add metadata/T10-PI support nvme-rdma: introduce nvme_rdma_sgl structure ... commit e8224bfe77293494626f6eec1884fee7b87d0ced Author: Vasily Averin Date: Tue Jun 2 15:55:26 2020 +0300 net_failover: fixed rollback in net_failover_open() found by smatch: drivers/net/net_failover.c:65 net_failover_open() error: we previously assumed 'primary_dev' could be null (see line 43) Fixes: cfc80d9a1163 ("net: Introduce net_failover driver") Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit 750a02ab8d3c49ca7d23102be90d3d1db19e2827 Merge: 1966391fa576 abb30460bda2 Author: Linus Torvalds Date: Tue Jun 2 15:29:19 2020 -0700 Merge tag 'for-5.8/block-2020-06-01' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: "Core block changes that have been queued up for this release: - Remove dead blk-throttle and blk-wbt code (Guoqing) - Include pid in blktrace note traces (Jan) - Don't spew I/O errors on wouldblock termination (me) - Zone append addition (Johannes, Keith, Damien) - IO accounting improvements (Konstantin, Christoph) - blk-mq hardware map update improvements (Ming) - Scheduler dispatch improvement (Salman) - Inline block encryption support (Satya) - Request map fixes and improvements (Weiping) - blk-iocost tweaks (Tejun) - Fix for timeout failing with error injection (Keith) - Queue re-run fixes (Douglas) - CPU hotplug improvements (Christoph) - Queue entry/exit improvements (Christoph) - Move DMA drain handling to the few drivers that use it (Christoph) - Partition handling cleanups (Christoph)" * tag 'for-5.8/block-2020-06-01' of git://git.kernel.dk/linux-block: (127 commits) block: mark bio_wouldblock_error() bio with BIO_QUIET blk-wbt: rename __wbt_update_limits to wbt_update_limits blk-wbt: remove wbt_update_limits blk-throttle: remove tg_drain_bios blk-throttle: remove blk_throtl_drain null_blk: force complete for timeout request blk-mq: drain I/O when all CPUs in a hctx are offline blk-mq: add blk_mq_all_tag_iter blk-mq: open code __blk_mq_alloc_request in blk_mq_alloc_request_hctx blk-mq: use BLK_MQ_NO_TAG in more places blk-mq: rename BLK_MQ_TAG_FAIL to BLK_MQ_NO_TAG blk-mq: move more request initialization to blk_mq_rq_ctx_init blk-mq: simplify the blk_mq_get_request calling convention blk-mq: remove the bio argument to ->prepare_request nvme: force complete cancelled requests blk-mq: blk-mq: provide forced completion method block: fix a warning when blkdev.h is included for !CONFIG_BLOCK builds block: blk-crypto-fallback: remove redundant initialization of variable err block: reduce part_stat_lock() scope block: use __this_cpu_add() instead of access by smp_processor_id() ... commit 1966391fa576e1fb2701be8bcca197d8f72737b7 Author: Hugh Dickins Date: Tue Jun 2 14:36:32 2020 -0700 mm/migrate.c: attach_page_private already does the get_page Just finished bisecting mmotm, to find why a test which used to take four minutes now took more than an hour: the __buffer_migrate_page() cleanup left behind a get_page() which attach_page_private() now does. Fixes: cd0f37154443 ("mm/migrate.c: call detach_page_private to cleanup code") Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds commit 241d46dce9f4ee64e742e12568034b9ba4762961 Merge: 11e877b2a8cf a275727b1899 Author: David S. Miller Date: Tue Jun 2 15:13:47 2020 -0700 Merge branch 'tipc-revert-two-patches' Tuong Lien says: ==================== tipc: revert two patches We revert two patches: tipc: Fix potential tipc_node refcnt leak in tipc_rcv tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv which prevented TIPC encryption from working properly and caused kernel panic. ==================== Signed-off-by: David S. Miller commit a275727b1899d14d33d6c8c70f303b73f01cdbc6 Author: Tuong Lien Date: Tue Jun 2 11:46:41 2020 +0700 Revert "tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv" This reverts commit 441870ee4240cf67b5d3ab8e16216a9ff42eb5d6. Like the previous patch in this series, we revert the above commit that causes similar issues with the 'aead' object. Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit 049fa17f7ae6b0971ad41b761479962facafea4b Author: Tuong Lien Date: Tue Jun 2 11:46:40 2020 +0700 Revert "tipc: Fix potential tipc_node refcnt leak in tipc_rcv" This reverts commit de058420767df21e2b6b0f3bb36d1616fb962032. There is no actual tipc_node refcnt leak as stated in the above commit. The refcnt is hold carefully for the case of an asynchronous decryption (i.e. -EINPROGRESS/-EBUSY and skb = NULL is returned), so that the node object cannot be freed in the meantime. The counter will be re-balanced when the operation's callback arrives with the decrypted buffer if any. In other cases, e.g. a synchronous crypto the counter will be decreased immediately when it is done. Now with that commit, a kernel panic will occur when there is no node found (i.e. n = NULL) in the 'tipc_rcv()' or a premature release of the node object. This commit solves the issues by reverting the said commit, but keeping one valid case that the 'skb_linearize()' is failed. Acked-by: Jon Maloy Signed-off-by: Tuong Lien Tested-by: Hoang Le Signed-off-by: David S. Miller commit 11e877b2a8cfd282a1b81f9d4c594b900889a5d8 Author: Ronak Doshi Date: Mon Jun 1 20:02:39 2020 -0700 vmxnet3: allow rx flow hash ops only when rss is enabled It makes sense to allow changes to get/set rx flow hash callback only when rss is enabled. This patch restricts get_rss_hash_opts and set_rss_hash_opts methods to allow querying and configuring different Rx flow hash configurations only when rss is enabled Signed-off-by: Ronak Doshi Signed-off-by: David S. Miller commit 2eed5a8b614bc0197b29da7b21a78d2c564a7098 Author: Luo bin Date: Tue Jun 2 08:40:32 2020 +0800 hinic: add set_channels ethtool_ops support add support to change TX/RX queue number with "ethtool -L combined". V5 -> V6: remove check for carrier in hinic_xmit_frame V4 -> V5: change time zone in patch header V3 -> V4: update date in patch header V2 -> V3: remove check for zero channels->combined_count V1 -> V2: update commit message("ethtool -L" to "ethtool -L combined") V0 -> V1: remove check for channels->tx_count/rx_count/other_count Signed-off-by: Luo bin Signed-off-by: David S. Miller commit 9a5a908c38c7a8978f240d8de57ec65441cf554f Merge: 9a25c1df24a6 e7ad28e6fdbf Author: David S. Miller Date: Tue Jun 2 15:09:39 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2020-06-02 The following pull-request contains BPF _fixes-only_ for your *net-next* tree. We've added 10 non-merge commits during the last 1 day(s) which contain a total of 15 files changed, 229 insertions(+), 74 deletions(-). The main changes are: 1) Several fixes to s390 BPF JIT e.g. fixing kernel panic when BPF stack is not 8-byte aligned, from Ilya Leoshkevich. 2) Fix bpf_skb_adjust_room() helper's CHECKSUM_UNNECESSARY handling which was wrongly bypassing TCP checksum verification, from Daniel Borkmann. 3) Fix tools/bpf/ build under MAKEFLAGS=rR which causes built-in CXX and others vars to be undefined, also from Ilya Leoshkevich. 4) Fix BPF ringbuf's selftest shared sample_cnt variable to avoid compiler optimizations on it, from Andrii Nakryiko. 5) Fix up test_verifier selftest due to addition of rx_queue_mapping to the bpf_sock structure, from Alexei Starovoitov. ==================== Signed-off-by: David S. Miller commit faa392181a0bd42c5478175cef601adeecdc91b6 Merge: cfa3b8068b09 9ca1f474cea0 Author: Linus Torvalds Date: Tue Jun 2 15:04:15 2020 -0700 Merge tag 'drm-next-2020-06-02' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Highlights: - Core DRM had a lot of refactoring around managed drm resources to make drivers simpler. - Intel Tigerlake support is on by default - amdgpu now support p2p PCI buffer sharing and encrypted GPU memory Details: core: - uapi: error out EBUSY when existing master - uapi: rework SET/DROP MASTER permission handling - remove drm_pci.h - drm_pci* are now legacy - introduced managed DRM resources - subclassing support for drm_framebuffer - simple encoder helper - edid improvements - vblank + writeback documentation improved - drm/mm - optimise tree searches - port drivers to use devm_drm_dev_alloc dma-buf: - add flag for p2p buffer support mst: - ACT timeout improvements - remove drm_dp_mst_has_audio - don't use 2nd TX slot - spec recommends against it bridge: - dw-hdmi various improvements - chrontel ch7033 support - fix stack issues with old gcc hdmi: - add unpack function for drm infoframe fbdev: - misc fbdev driver fixes i915: - uapi: global sseu pinning - uapi: OA buffer polling - uapi: remove generated perf code - uapi: per-engine default property values in sysfs - Tigerlake GEN12 enabled. - Lots of gem refactoring - Tigerlake enablement patches - move to drm_device logging - Icelake gamma HW readout - push MST link retrain to hotplug work - bandwidth atomic helpers - ICL fixes - RPS/GT refactoring - Cherryview full-ppgtt support - i915 locking guidelines documented - require linear fb stride to be 512 multiple on gen9 - Tigerlake SAGV support amdgpu: - uapi: encrypted GPU memory handling - uapi: add MEM_SYNC IB flag - p2p dma-buf support - export VRAM dma-bufs - FRU chip access support - RAS/SR-IOV updates - Powerplay locking fixes - VCN DPG (powergating) enablement - GFX10 clockgating fixes - DC fixes - GPU reset fixes - navi SDMA fix - expose FP16 for modesetting - DP 1.4 compliance fixes - gfx10 soft recovery - Improved Critical Thermal Faults handling - resizable BAR on gmc10 amdkfd: - uapi: GWS resource management - track GPU memory per process - report PCI domain in topology radeon: - safe reg list generator fixes nouveau: - HD audio fixes on recent systems - vGPU detection (fail probe if we're on one, for now) - Interlaced mode fixes (mostly avoidance on Turing, which doesn't support it) - SVM improvements/fixes - NVIDIA format modifier support - Misc other fixes. adv7511: - HDMI SPDIF support ast: - allocate crtc state size - fix double assignment - fix suspend bochs: - drop connector register cirrus: - move to tiny drivers. exynos: - fix imported dma-buf mapping - enable runtime PM - fixes and cleanups mediatek: - DPI pin mode swap - config mipi_tx current/impedance lima: - devfreq + cooling device support - task handling improvements - runtime PM support pl111: - vexpress init improvements - fix module auto-load rcar-du: - DT bindings conversion to YAML - Planes zpos sanity check and fix - MAINTAINERS entry for LVDS panel driver mcde: - fix return value mgag200: - use managed config init stm: - read endpoints from DT vboxvideo: - use PCI managed functions - drop WC mtrr vkms: - enable cursor by default rockchip: - afbc support virtio: - various cleanups qxl: - fix cursor notify port hisilicon: - 128-byte stride alignment fix sun4i: - improved format handling" * tag 'drm-next-2020-06-02' of git://anongit.freedesktop.org/drm/drm: (1401 commits) drm/amd/display: Fix potential integer wraparound resulting in a hang drm/amd/display: drop cursor position check in atomic test drm/amdgpu: fix device attribute node create failed with multi gpu drm/nouveau: use correct conflicting framebuffer API drm/vblank: Fix -Wformat compile warnings on some arches drm/amdgpu: Sync with VM root BO when switching VM to CPU update mode drm/amd/display: Handle GPU reset for DC block drm/amdgpu: add apu flags (v2) drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven drm/amdgpu: fix pm sysfs node handling (v2) drm/amdgpu: move gpu_info parsing after common early init drm/amdgpu: move discovery gfx config fetching drm/nouveau/dispnv50: fix runtime pm imbalance on error drm/nouveau: fix runtime pm imbalance on error drm/nouveau: fix runtime pm imbalance on error drm/nouveau/debugfs: fix runtime pm imbalance on error drm/nouveau/nouveau/hmm: fix migrate zero page to GPU drm/nouveau/nouveau/hmm: fix nouveau_dmem_chunk allocations drm/nouveau/kms/nv50-: Share DP SST mode_valid() handling with MST drm/nouveau/kms/nv50-: Move 8BPC limit for MST into nv50_mstc_get_modes() ... commit cfa3b8068b09f25037146bfd5eed041b78878bee Merge: 194098915ac7 f07e2f6be37a Author: Linus Torvalds Date: Tue Jun 2 14:05:27 2020 -0700 Merge tag 'for-linus-hmm' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull hmm updates from Jason Gunthorpe: "This series adds a selftest for hmm_range_fault() and several of the DEVICE_PRIVATE migration related actions, and another simplification for hmm_range_fault()'s API. - Simplify hmm_range_fault() with a simpler return code, no HMM_PFN_SPECIAL, and no customizable output PFN format - Add a selftest for hmm_range_fault() and DEVICE_PRIVATE related functionality" * tag 'for-linus-hmm' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: MAINTAINERS: add HMM selftests mm/hmm/test: add selftests for HMM mm/hmm/test: add selftest driver for HMM mm/hmm: remove the customizable pfn format from hmm_range_fault mm/hmm: remove HMM_PFN_SPECIAL drm/amdgpu: remove dead code after hmm_range_fault() mm/hmm: make hmm_range_fault return 0 or -1 commit 4b68bf9a69d22dd512d61d5f0ba01b065b01ede6 Author: Arne Edholm Date: Mon Jan 13 15:56:22 2020 +0100 ubi: Select fastmap anchor PEBs considering wear level rules There is a risk that the fastmap anchor PEB is alternating between just two PEBs, the current anchor and the previous anchor that was just deleted. As the fastmap pools gets the first take on free PEBs, the pools may leave no free PEBs to be selected as the new anchor, resulting in the two PEBs alternating behaviour. If the anchor PEBs gets a high erase count the PEBs will not be used by the pools but remain in ubi->free, even more increasing the likelihood they will be used as anchors. Getting stuck using only a couple of PEBs continuously will result in an uneven wear, eventually leading to failure. To fix this: - Choose the fastmap anchor when the most free PEBs are available. This is during rebuilding of the fastmap pools, after the unused pool PEBs are added to ubi->free but before the pools are populated again from the free PEBs. Also reserve an additional second best PEB as a candidate for the next time the fast map anchor is updated. If a better PEB is found the next time the fast map anchor is updated, the candidate is made available for building the pools. - Enable anchor move within the anchor area again as it is useful for distributing wear. - The anchor candidate for the next fastmap update is the most suited free PEB. Check this PEB's erase count during wear leveling. If the wear leveling limit is exceeded, the PEB is considered unsuitable for now. As all other non used anchor area PEBs should be even worse, free up the used anchor area PEB with the lowest erase count. Signed-off-by: Arne Edholm Signed-off-by: Richard Weinberger commit f6e8c474390be2e6f5bd0b8966e19958214609ff Author: Gustavo A. R. Silva Date: Thu May 7 14:26:52 2020 -0500 um: virtio: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Richard Weinberger commit 54ebe4060fe6c4ab76c79354417612ac9cf4f95e Author: Anton Ivanov Date: Wed Apr 22 17:00:01 2020 +0100 um: Use fdatasync() when mapping the UBD FSYNC command We do not need to update the metadata (atime, mtime, etc) on the UBD file and/or the COW file until UML exits. UBD image mtime is checked in UML only when opening the files. After that they are locked and used exclusively by a single UML instance, so there is no point wasting resources on updating metadata on every sync. We can sync data only. The host will always update mtime if a file has been modified upon closing it. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 0b86ce29cfc273501d019b18f31cee7837c8fd2a Author: Masahiro Yamada Date: Sat Apr 18 03:04:55 2020 +0900 um: Do not evaluate compiler's library path when cleaning Since commit a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than="), 'make ARCH=um clean' emits an error message as follows: $ make ARCH=um clean gcc: error: missing argument to '-Wframe-larger-than=' We do not care compiler flags when cleaning. Use the '=' operator for lazy expansion because we do not use LDFLAGS_pcap.o or LDFLAGS_vde.o when cleaning. While I was here, I removed the redundant -r option because it already exists in the recipe. Fixes: a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than=") Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor [build] Signed-off-by: Richard Weinberger commit 4c5a770580054c1d107ba204a42df1db221670bd Author: Joe Perches Date: Sat Apr 11 09:28:08 2020 -0700 um: Neaten vu_err macro definition Defining a macro with ... and __VA_ARGS__ (without ##) can cause compilation errors if a macro use does not have additional args. Add ## to __VA_ARGS__ in the macro definition. Signed-off-by: Joe Perches Signed-off-by: Richard Weinberger commit bc8f8e4e6e7a648e8c6357307d614be8fdcfdf2a Author: Marc-André Lureau Date: Tue Apr 7 22:28:53 2020 +0200 um: Add a generic "fd" vector transport Learn to take a pre-opened file-descriptor for vector IO. Instead of teaching the driver to open a FD in multiple ways, it can rely on management layer to do it on its behalf. For example, this allows inheriting a preconfigured device fd or a simple socketpair() setup, without further arguments, privileges or system access by UML. Signed-off-by: Marc-André Lureau Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 38bccfbeb0af039e59eb75fe6d9b2a83cda3d381 Author: Zach van Rijn Date: Wed Apr 1 16:30:48 2020 -0500 um: Add include: memset() and memcpy() are in These two functions are otherwise unknown to the pedantic compiler. Include the correct header to enable the build to succeed. Signed-off-by: Zach van Rijn Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 194098915ac74daddca9d6ed46fd11be57f45e16 Merge: 118d6e98293b 9361797c7696 Author: Linus Torvalds Date: Tue Jun 2 13:31:48 2020 -0700 Merge tag 'pnp-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull PNP update from Rafael Wysocki: "Replace a zero-length array with a flexible-array (Gustavo A. R. Silva)" * tag 'pnp-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PNPBIOS: Replace zero-length array with flexible-array commit 118d6e98293b30aee378a6b08d27a35320a3e34f Merge: 355ba37d756c 48ccdeddc547 Author: Linus Torvalds Date: Tue Jun 2 13:25:52 2020 -0700 Merge tag 'acpi-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These update the ACPICA code in the kernel to upstream revision 20200430, fix several reference counting errors related to ACPI tables, add _Exx / _Lxx support to the GED driver, add a new acpi_evaluate_reg() helper, add new DPTF battery participant driver and extend the DPFT power participant driver, improve the handling of memory failures in the APEI code, add a blacklist entry to the backlight driver, update the PMIC driver and the processor idle driver, fix two kobject reference count leaks, and make a few janitory changes. Specifics: - Update the ACPICA code in the kernel to upstream revision 20200430: - Move acpi_gbl_next_cmd_num definition (Erik Kaneda). - Ignore AE_ALREADY_EXISTS status in the disassembler when parsing create operators (Erik Kaneda). - Add status checks to the dispatcher (Erik Kaneda). - Fix required parameters for _NIG and _NIH (Erik Kaneda). - Make acpi_protocol_lengths static (Yue Haibing). - Fix ACPI table reference counting errors in several places, mostly in error code paths (Hanjun Guo). - Extend the Generic Event Device (GED) driver to support _Exx and _Lxx handler methods (Ard Biesheuvel). - Add new acpi_evaluate_reg() helper and modify the ACPI PCI hotplug code to use it (Hans de Goede). - Add new DPTF battery participant driver and make the DPFT power participant driver create more sysfs device attributes (Srinivas Pandruvada). - Improve the handling of memory failures in APEI (James Morse). - Add new blacklist entry for Acer TravelMate 5735Z to the backlight driver (Paul Menzel). - Add i2c address for thermal control to the PMIC driver (Mauro Carvalho Chehab). - Allow the ACPI processor idle driver to work on platforms with only one ACPI C-state present (Zhang Rui). - Fix kobject reference count leaks in error code paths in two places (Qiushi Wu). - Delete unused proc filename macros and make some symbols static (Pascal Terjan, Zheng Zengkai, Zou Wei)" * tag 'acpi-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits) ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe() ACPI: sysfs: Fix reference count leak in acpi_sysfs_add_hotplug_profile() ACPI: GED: use correct trigger type field in _Exx / _Lxx handling ACPI: DPTF: Add battery participant driver ACPI: DPTF: Additional sysfs attributes for power participant driver ACPI: video: Use native backlight on Acer TravelMate 5735Z arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work ACPI: APEI: Kick the memory_failure() queue for synchronous errors mm/memory-failure: Add memory_failure_queue_kick() ACPI / PMIC: Add i2c address for thermal control ACPI: GED: add support for _Exx / _Lxx handler methods ACPI: Delete unused proc filename macros ACPI: hotplug: PCI: Use the new acpi_evaluate_reg() helper ACPI: utils: Add acpi_evaluate_reg() helper ACPI: debug: Make two functions static ACPI: sleep: Put the FACS table after using it ACPI: scan: Put SPCR and STAO table after using it ACPI: EC: Put the ACPI table after using it ACPI: APEI: Put the HEST table for error path ACPI: APEI: Put the error record serialization table for error path ... commit 56230d956739b9cb1cbde439d76227d77979a04d Author: Miklos Szeredi Date: Tue Jun 2 22:20:26 2020 +0200 ovl: verify permissions in ovl_path_open() Check permission before opening a real file. ovl_path_open() is used by readdir and copy-up routines. ovl_permission() theoretically already checked copy up permissions, but it doesn't hurt to re-do these checks during the actual copy-up. For directory reading ovl_permission() only checks access to topmost underlying layer. Readdir on a merged directory accesses layers below the topmost one as well. Permission wasn't checked for these layers. Note: modifying ovl_permission() to perform this check would be far more complex and hence more bug prone. The result is less precise permissions returned in access(2). If this turns out to be an issue, we can revisit this bug. Signed-off-by: Miklos Szeredi commit 48bd024b8a40d73ad6b086de2615738da0c7004f Author: Miklos Szeredi Date: Tue Jun 2 22:20:25 2020 +0200 ovl: switch to mounter creds in readdir In preparation for more permission checking, override credentials for directory operations on the underlying filesystems. Signed-off-by: Miklos Szeredi commit 130fdbc3d1f9966dd4230709c30f3768bccd3065 Author: Miklos Szeredi Date: Tue Jun 2 22:20:25 2020 +0200 ovl: pass correct flags for opening real directory The three instances of ovl_path_open() in overlayfs/readdir.c do three different things: - pass f_flags from overlay file - pass O_RDONLY | O_DIRECTORY - pass just O_RDONLY The value of f_flags can be (other than O_RDONLY): O_WRONLY - not possible for a directory O_RDWR - not possible for a directory O_CREAT - masked out by dentry_open() O_EXCL - masked out by dentry_open() O_NOCTTY - masked out by dentry_open() O_TRUNC - masked out by dentry_open() O_APPEND - no effect on directory ops O_NDELAY - no effect on directory ops O_NONBLOCK - no effect on directory ops __O_SYNC - no effect on directory ops O_DSYNC - no effect on directory ops FASYNC - no effect on directory ops O_DIRECT - no effect on directory ops O_LARGEFILE - ? O_DIRECTORY - only affects lookup O_NOFOLLOW - only affects lookup O_NOATIME - overlay sets this unconditionally in ovl_path_open() O_CLOEXEC - only affects fd allocation O_PATH - no effect on directory ops __O_TMPFILE - not possible for a directory Fon non-merge directories we use the underlying filesystem's iterate; in this case honor O_LARGEFILE from the original file to make sure that open doesn't get rejected. For merge directories it's safe to pass O_LARGEFILE unconditionally since userspace will only see the artificial offsets created by overlayfs. Signed-off-by: Miklos Szeredi commit 21d8d66abffb0c7834c1b09b8b043ea6a66d6089 Author: Vivek Goyal Date: Tue Jun 2 11:23:38 2020 -0400 ovl: fix redirect traversal on metacopy dentries Amir pointed me to metacopy test cases in unionmount-testsuite and I decided to run "./run --ov=10 --meta" and it failed while running test "rename-mass-5.py". Problem is w.r.t absolute redirect traversal on intermediate metacopy dentry. We do not store intermediate metacopy dentries and also skip current loop/layer and move onto lookup in next layer. But at the end of loop, we have logic to reset "poe" and layer index if currnently looked up dentry has absolute redirect. We skip all that and that means lookup in next layer will fail. Following is simple test case to reproduce this. - mkdir -p lower upper work merged lower/a lower/b - touch lower/a/foo.txt - mount -t overlay -o lowerdir=lower,upperdir=upper,workdir=work,metacopy=on none merged # Following will create absolute redirect "/a/foo.txt" on upper/b/bar.txt. - mv merged/a/foo.txt merged/b/bar.txt # unmount overlay and use upper as lower layer (lower2) for next mount. - umount merged - mv upper lower2 - rm -rf work; mkdir -p upper work - mount -t overlay -o lowerdir=lower2:lower,upperdir=upper,workdir=work,metacopy=on none merged # Force a metacopy copy-up - chown bin:bin merged/b/bar.txt # unmount overlay and use upper as lower layer (lower3) for next mount. - umount merged - mv upper lower3 - rm -rf work; mkdir -p upper work - mount -t overlay -o lowerdir=lower3:lower2:lower,upperdir=upper,workdir=work,metacopy=on none merged # ls merged/b/bar.txt ls: cannot access 'bar.txt': Input/output error Intermediate lower layer (lower2) has metacopy dentry b/bar.txt with absolute redirect "/a/foo.txt". We skipped redirect processing at the end of loop which sets poe to roe and sets the appropriate next lower layer index. And that means lookup failed in next layer. Fix this by continuing the loop for any intermediate dentries. We still do not save these at lower stack. With this fix applied unionmount-testsuite, "./run --ov-10 --meta" now passes. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 28166ab3c875b8cbe19b6ad43e29257d1605e3b9 Author: Vivek Goyal Date: Mon Jun 1 11:56:52 2020 -0400 ovl: initialize OVL_UPPERDATA in ovl_lookup() Currently ovl_get_inode() initializes OVL_UPPERDATA flag and for that it has to call ovl_check_metacopy_xattr() and check if metacopy xattr is present or not. yangerkun reported sometimes underlying filesystem might return -EIO and in that case error handling path does not cleanup properly leading to various warnings. Run generic/461 with ext4 upper/lower layer sometimes may trigger the bug as below(linux 4.19): [ 551.001349] overlayfs: failed to get metacopy (-5) [ 551.003464] overlayfs: failed to get inode (-5) [ 551.004243] overlayfs: cleanup of 'd44/fd51' failed (-5) [ 551.004941] overlayfs: failed to get origin (-5) [ 551.005199] ------------[ cut here ]------------ [ 551.006697] WARNING: CPU: 3 PID: 24674 at fs/inode.c:1528 iput+0x33b/0x400 ... [ 551.027219] Call Trace: [ 551.027623] ovl_create_object+0x13f/0x170 [ 551.028268] ovl_create+0x27/0x30 [ 551.028799] path_openat+0x1a35/0x1ea0 [ 551.029377] do_filp_open+0xad/0x160 [ 551.029944] ? vfs_writev+0xe9/0x170 [ 551.030499] ? page_counter_try_charge+0x77/0x120 [ 551.031245] ? __alloc_fd+0x160/0x2a0 [ 551.031832] ? do_sys_open+0x189/0x340 [ 551.032417] ? get_unused_fd_flags+0x34/0x40 [ 551.033081] do_sys_open+0x189/0x340 [ 551.033632] __x64_sys_creat+0x24/0x30 [ 551.034219] do_syscall_64+0xd5/0x430 [ 551.034800] entry_SYSCALL_64_after_hwframe+0x44/0xa9 One solution is to improve error handling and call iget_failed() if error is encountered. Amir thinks that this path is little intricate and there is not real need to check and initialize OVL_UPPERDATA in ovl_get_inode(). Instead caller of ovl_get_inode() can initialize this state. And this will avoid double checking of metacopy xattr lookup in ovl_lookup() and ovl_get_inode(). OVL_UPPERDATA is inode flag. So I was little concerned that initializing it outside ovl_get_inode() might have some races. But this is one way transition. That is once a file has been fully copied up, it can't go back to metacopy file again. And that seems to help avoid races. So as of now I can't see any races w.r.t OVL_UPPERDATA being set wrongly. So move settingof OVL_UPPERDATA inside the callers of ovl_get_inode(). ovl_obtain_alias() already does it. So only two callers now left are ovl_lookup() and ovl_instantiate(). Reported-by: yangerkun Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 6815f479ca90ee7fd2e28b2a420f796b974155fe Author: Vivek Goyal Date: Mon Jun 1 11:56:51 2020 -0400 ovl: use only uppermetacopy state in ovl_lookup() Currently we use a variable "metacopy" which signifies that dentry could be either uppermetacopy or lowermetacopy. Amir suggested that we can move code around and use d.metacopy in such a way that we don't need lowermetacopy and just can do away with uppermetacopy. So this patch replaces "metacopy" with "uppermetacopy". It also moves some code little higher to keep reading little simpler. Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 59fb20138a9b5249a4176d5bbc5c670a97343061 Author: Vivek Goyal Date: Mon Jun 1 11:56:50 2020 -0400 ovl: simplify setting of origin for index lookup overlayfs can keep index of copied up files and directories and it seems to serve two primary puroposes. For regular files, it avoids breaking lower hardlinks over copy up. For directories it seems to be used for various error checks. During ovl_lookup(), we lookup for index using lower dentry in many a cases. That lower dentry is called "origin" and following is a summary of current logic. If there is no upperdentry, always lookup for index using lower dentry. For regular files it helps avoiding breaking hard links over copyup and for directories it seems to be just error checks. If there is an upperdentry, then there are 3 possible cases. - For directories, lower dentry is found using two ways. One is regular path based lookup in lower layers and second is using ORIGIN xattr on upper dentry. First verify that path based lookup lower dentry matches the one pointed by upper ORIGIN xattr. If yes, use this verified origin for index lookup. - For regular files (non-metacopy), there is no path based lookup in lower layers as lookup stops once we find upper dentry. So there is no origin verification. If there is ORIGIN xattr present on upper, use that to lookup index otherwise don't. - For regular metacopy files, again lower dentry is found using path based lookup as well as ORIGIN xattr on upper. Path based lookup is continued in this case to find lower data dentry for metacopy upper. So like directories we only use verified origin. If ORIGIN xattr is not present (Either because lower did not support file handles or because this is hardlink copied up with index=off), then don't use path lookup based lower dentry as origin. This is same as regular non-metacopy file case. Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 522f6e6cba6880a038e2bd88e10390b84cd3febd Author: Amir Goldstein Date: Sat May 23 16:21:55 2020 +0300 ovl: fix out of bounds access warning in ovl_check_fb_len() syzbot reported out of bounds memory access from open_by_handle_at() with a crafted file handle that looks like this: { .handle_bytes = 2, .handle_type = OVL_FILEID_V1 } handle_bytes gets rounded down to 0 and we end up calling: ovl_check_fh_len(fh, 0) => ovl_check_fb_len(fh + 3, -3) But fh buffer is only 2 bytes long, so accessing struct ovl_fb at fh + 3 is illegal. Fixes: cbe7fba8edfc ("ovl: make sure that real fid is 32bit aligned in memory") Reported-and-tested-by: syzbot+61958888b1c60361a791@syzkaller.appspotmail.com Cc: # v5.5 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 355ba37d756c38962fe9bb616f5f48eb12a7e11e Merge: a5a82e0a5918 a34024d98eea Author: Linus Torvalds Date: Tue Jun 2 13:17:23 2020 -0700 Merge tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These rework the system-wide PM driver flags, make runtime switching of cpuidle governors easier, improve the user space hibernation interface code, add intel-speed-select interface documentation, add more debug messages to the ACPI code handling suspend to idle, update the cpufreq core and drivers, fix a minor issue in the cpuidle core and update two cpuidle drivers, improve the PM-runtime framework, update the Intel RAPL power capping driver, update devfreq core and drivers, and clean up the cpupower utility. Specifics: - Rework the system-wide PM driver flags to make them easier to understand and use and update their documentation (Rafael Wysocki, Alan Stern). - Allow cpuidle governors to be switched at run time regardless of the kernel configuration and update the related documentation accordingly (Hanjun Guo). - Improve the resume device handling in the user space hibernarion interface code (Domenico Andreoli). - Document the intel-speed-select sysfs interface (Srinivas Pandruvada). - Make the ACPI code handing suspend to idle print more debug messages to help diagnose issues with it (Rafael Wysocki). - Fix a helper routine in the cpufreq core and correct a typo in the struct cpufreq_driver kerneldoc comment (Rafael Wysocki, Wang Wenhu). - Update cpufreq drivers: - Make the intel_pstate driver start in the passive mode by default on systems without HWP (Rafael Wysocki). - Add i.MX7ULP support to the imx-cpufreq-dt driver and add i.MX7ULP to the cpufreq-dt-platdev blacklist (Peng Fan). - Convert the qoriq cpufreq driver to a platform one, make the platform code create a suitable device object for it and add platform dependencies to it (Mian Yousaf Kaukab, Geert Uytterhoeven). - Fix wrong compatible binding in the qcom driver (Ansuel Smith). - Build the omap driver by default for ARCH_OMAP2PLUS (Anders Roxell). - Add r8a7742 SoC support to the dt cpufreq driver (Lad Prabhakar). - Update cpuidle core and drivers: - Fix three reference count leaks in error code paths in the cpuidle core (Qiushi Wu). - Convert Qualcomm SPM to a generic cpuidle driver (Stephan Gerhold). - Fix up the execution order when entering a domain idle state in the PSCI driver (Ulf Hansson). - Fix a reference counting issue related to clock management and clean up two oddities in the PM-runtime framework (Rafael Wysocki, Andy Shevchenko). - Add ElkhartLake support to the Intel RAPL power capping driver and remove an unused local MSR definition from it (Jacob Pan, Sumeet Pawnikar). - Update devfreq core and drivers: - Replace strncpy() with strscpy() in the devfreq core and use lockdep asserts instead of manual checks for a locked mutex in it (Dmitry Osipenko, Krzysztof Kozlowski). - Add a generic imx bus scaling driver and make it register an interconnect device (Leonard Crestez, Gustavo A. R. Silva). - Make the cpufreq notifier in the tegra30 driver take boosting into account and delete an unuseful error message from that driver (Dmitry Osipenko, Markus Elfring). - Remove unneeded semicolon from the cpupower code (Zou Wei)" * tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (51 commits) cpuidle: Fix three reference count leaks PM: runtime: Replace pm_runtime_callbacks_present() PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR PM / devfreq: Replace strncpy with strscpy PM / devfreq: imx: Register interconnect device PM / devfreq: Add generic imx bus scaling driver PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe() PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting PM: hibernate: Restrict writes to the resume device PM: runtime: clk: Fix clk_pm_runtime_get() error path cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver ACPI: EC: PM: s2idle: Extend GPE dispatching debug message ACPI: PM: s2idle: Print type of wakeup debug messages powercap: RAPL: remove unused local MSR define PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend() Documentation: admin-guide: pm: Document intel-speed-select PM: hibernate: Split off snapshot dev option PM: hibernate: Incorporate concurrency handling Documentation: ABI: make current_governer_ro as a candidate for removal ... commit e7ad28e6fdbffa2b9b1bd376431fb81a5403bcfd Author: Ilya Leoshkevich Date: Tue Jun 2 19:56:49 2020 +0200 selftests/bpf: Add a default $(CXX) value When using make kselftest TARGETS=bpf, tools/bpf is built with MAKEFLAGS=rR, which causes $(CXX) to be undefined, which in turn causes the build to fail with CXX test_cpp /bin/sh: 2: g: not found Fix by adding a default $(CXX) value, like tools/build/feature/Makefile already does. Signed-off-by: Ilya Leoshkevich Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200602175649.2501580-3-iii@linux.ibm.com commit d70a6be1e2ab98f13688e4a529b326e8e11230d0 Author: Ilya Leoshkevich Date: Tue Jun 2 19:56:48 2020 +0200 tools/bpf: Don't use $(COMPILE.c) When using make kselftest TARGETS=bpf, tools/bpf is built with MAKEFLAGS=rR, which causes $(COMPILE.c) to be undefined, which in turn causes the build to fail with CC kselftest/bpf/tools/build/bpftool/map_perf_ring.o /bin/sh: 1: -MMD: not found Fix by using $(CC) $(CFLAGS) -c instead of $(COMPILE.c). Signed-off-by: Ilya Leoshkevich Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200602175649.2501580-2-iii@linux.ibm.com commit a5a82e0a5918fb2ae27b80d3b9c954b16ae6a7b7 Merge: c5d6c1384388 47a94c551a74 Author: Linus Torvalds Date: Tue Jun 2 12:56:58 2020 -0700 Merge tag 'platform-drivers-x86-v5.8-1' of git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: - Add a support of the media keys on the ASUS laptop UX325JA/UX425JA - ASUS WMI driver can now handle 2-in-1 models T100TA, T100CHI, T100HA, T200TA - Big refactoring of Intel SCU driver with Elkhart Lake support has been added - Slim Bootloarder firmware update signaling WMI driver has been added - Thinkpad ACPI driver can handle dual fan configuration on new P and X models - Touchscreen DMI driver has been extended to support - MP-man MPWIN895CL tablet - ONDA V891 v5 tablet - techBite Arc 11.6 - Trekstor Twin 10.1 - Trekstor Yourbook C11B - Vinga J116 - Virtual Button driver got a few fixes to detect mode of 2-in-1 tablet models - Intel Speed Select tools update - Plenty of small cleanups here and there * tag 'platform-drivers-x86-v5.8-1' of git://git.infradead.org/linux-platform-drivers-x86: (89 commits) platform/x86: dcdbas: Check SMBIOS for protected buffer address platform/x86: asus_wmi: Reserve more space for struct bias_args platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type platform/x86: intel-hid: Add a quirk to support HP Spectre X2 (2015) platform/x86: touchscreen_dmi: Update Trekstor Twin 10.1 entry platform/x86: touchscreen_dmi: Add info for the Trekstor Yourbook C11B platform/x86: hp-wmi: Introduce HPWMI_POWER_FW_OR_HW as convenient shortcut platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32() platform/x86: hp-wmi: Refactor postcode_store() to follow standard patterns platform/x86: acerhdf: replace space by * in modalias platform/x86: ISST: Increase timeout tools/power/x86/intel-speed-select: Fix invalid core mask tools/power/x86/intel-speed-select: Increase CPU count tools/power/x86/intel-speed-select: Fix json perf-profile output output platform/x86: dell-wmi: Ignore keyboard attached / detached events platform/x86: dell-laptop: don't register micmute LED if there is no token platform/x86: thinkpad_acpi: Replace custom approach by kstrtoint() platform/x86: thinkpad_acpi: Use strndup_user() in dispatch_proc_write() platform/x86: thinkpad_acpi: Replace next_cmd(&buf) with strsep(&buf, ",") platform/x86: intel-vbtn: Detect switch position before registering the input-device ... commit 4f085ca2f5a8047845ab2d6bbe97089daed28655 Merge: ea20868c7197 c8e9df4744a3 Author: Alex Williamson Date: Tue Jun 2 13:53:00 2020 -0600 Merge branch 'v5.8/vfio/kirti-migration-fixes' into v5.8/vfio/next commit c5d6c13843880ad0112f0513f3eb041b258be66e Merge: 94709049fb84 ae5c0585dfc2 Author: Linus Torvalds Date: Tue Jun 2 12:48:58 2020 -0700 Merge tag 'mmc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "MMC core: - Enable erase/discard/trim support for all (e)MMC/SD hosts - Export information through sysfs about enhanced RPMB support (eMMC v5.1+) - Align the initialization commands for SDIO cards - Fix SDIO initialization to prevent memory leaks and NULL pointer errors - Do not export undefined MMC_NAME/MODALIAS for SDIO cards - Export device/vendor field from common CIS for SDIO cards - Move SDIO IDs from functional drivers to the common SDIO header - Introduce the ->request_atomic() host ops MMC host: - Improve support for HW busy signaling for several hosts - Converting some DT bindings to the json-schema - meson-mx-sdhc: Add driver and DT doc for the Amlogic Meson SDHC controller - meson-mx-sdio: Run a soft reset to recover from timeout/CRC error - mmci: Convert to use mmc_regulator_set_vqmmc() - mmci_stm32_sdmmc: Fix a couple of DMA bugs - mmci_stm32_sdmmc: Fix power on issue - renesas,mmcif,sdhci: Document r8a7742 DT bindings - renesas_sdhi: Add support for M3-W ES1.2 and 1.3 revisions - renesas_sdhi: Improvements to the TAP selection - renesas_sdhi/tmio: Further fixup runtime PM management at ->remove() - sdhci: Introduce ops to dump vendor specific registers - sdhci-cadence: Fix PHY write sequence - sdhci-esdhc-imx: Improve tunings - sdhci-esdhc-imx: Enable GPIO card detect as system wakeup - sdhci-esdhc-imx: Add HS400 support for i.MX6SLL - sdhci-esdhc-mcf: Add driver for the Coldfire/M5441X esdhc controller - m68k: mcf5441x: Add platform data to enable esdhc mmc controller - sdhci-msm: Improve HS400 tuning - sdhci-msm: Dump vendor specific registers at error - sdhci-msm: Add support for DLL/DDR properties provided from DT - sdhci-msm: Add support for the sm8250 variant - sdhci-msm: Add support for DVFS by converting to dev_pm_opp_set_rate() - sdhci-of-arasan: Add support for Intel Keem Bay variant - sdhci-of-arasan: Add support for Xilinx Versal SD variant - sdhci-of-dwcmshc: Add support for system suspend/resume - sdhci-of-dwcmshc: Fix UHS signaling support - sdhci-of-esdhc: Fix tuning for eMMC HS400 mode - sdhci-pci-gli: Add Genesys Logic GL9763E support - sdhci-sprd: Add support for the ->request_atomic() ops - sdhci-tegra: Avoid reading autocal timeout values when not applicable MEMSTICK: - Minor trivial update" * tag 'mmc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (127 commits) dt-bindings: mmc: Convert sdhci-pxa to json-schema mmc: sdhci-msm: Clear tuning done flag while hs400 tuning mmc: core: Export device/vendor ids from Common CIS for SDIO cards mmc: core: Do not export MMC_NAME= and MODALIAS=mmc:block for SDIO cards mmc: sdhci-of-at91: fix CALCR register being rewritten mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning mmc: sdhci-esdhc-imx: fix the mask for tuning start point mmc: host: sdhci-esdhc-imx: add wakeup feature for GPIO CD pin mmc: mmci_sdmmc: fix DMA API warning max segment size mmc: mmci_sdmmc: fix DMA API warning overlapping mappings mmc: sdhci-of-arasan: Add support for Intel Keem Bay dt-bindings: mmc: arasan: Add compatible strings for Intel Keem Bay mmc: sdhci-cadence: fix PHY write mmc: sdio: Sort all SDIO IDs in common include file mmc: sdio: Fix Cypress SDIO IDs macros in common include file mmc: sdio: Move SDIO IDs from b43-sdio driver to common include file mmc: sdio: Move SDIO IDs from ath10k driver to common include file mmc: sdio: Move SDIO IDs from ath6kl driver to common include file mmc: sdio: Move SDIO IDs from smssdio driver to common include file mmc: sdio: Move SDIO IDs from btmtksdio driver to common include file ... commit c8e9df4744a3e4d897a6ac6e71a38aa8d7b65aa0 Author: Kirti Wankhede Date: Wed Jun 3 00:12:37 2020 +0530 vfio iommu: typecast corrections Fixes sparse warnings by adding '__user' in typecast for copy_[from,to]_user() Fixes: d6a4c185660c ("vfio iommu: Implementation of ioctl for dirty pages tracking") Reported-by: kbuild test robot Signed-off-by: Kirti Wankhede Signed-off-by: Alex Williamson commit cd0bb41ea86027d3a5c3555772692323cbc05bc1 Author: Kirti Wankhede Date: Wed Jun 3 00:12:36 2020 +0530 vfio iommu: Use shift operation for 64-bit integer division Fixes compilation error with ARCH=i386. Error fixed by this commit: ld: drivers/vfio/vfio_iommu_type1.o: in function `vfio_dma_populate_bitmap': >> vfio_iommu_type1.c:(.text+0x666): undefined reference to `__udivdi3' Fixes: d6a4c185660c ("vfio iommu: Implementation of ioctl for dirty pages tracking") Reported-by: kbuild test robot Signed-off-by: Kirti Wankhede Signed-off-by: Alex Williamson commit 1a0b00d15d4005390b74154e98822fc7d36d36cd Author: Bob Peterson Date: Mon Jun 1 11:37:09 2020 -0400 gfs2: Only do glock put in gfs2_create_inode for free inodes Before this patch, the error path of function gfs2_create_inode would always calls gfs2_glock_put for the inode glock. That's good for inodes that are free. But after they've been added to the vfs inodes, errors will cause the inode to be evicted, and the evict will do the glock put for us. If we do a glock put again, we can try to free the glock while there are still references to it, e.g. revokes pending for the transaction that created it. This patch adds a check: if (free_vfs_inode) before the put, thus solving the problem. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 94709049fb8442fb2f7b91fbec3c2897a75e18df Merge: 17839856fd58 4fba37586e4e Author: Linus Torvalds Date: Tue Jun 2 12:21:36 2020 -0700 Merge branch 'akpm' (patches from Andrew) Merge updates from Andrew Morton: "A few little subsystems and a start of a lot of MM patches. Subsystems affected by this patch series: squashfs, ocfs2, parisc, vfs. With mm subsystems: slab-generic, slub, debug, pagecache, gup, swap, memcg, pagemap, memory-failure, vmalloc, kasan" * emailed patches from Andrew Morton : (128 commits) kasan: move kasan_report() into report.c mm/mm_init.c: report kasan-tag information stored in page->flags ubsan: entirely disable alignment checks under UBSAN_TRAP kasan: fix clang compilation warning due to stack protector x86/mm: remove vmalloc faulting mm: remove vmalloc_sync_(un)mappings() x86/mm/32: implement arch_sync_kernel_mappings() x86/mm/64: implement arch_sync_kernel_mappings() mm/ioremap: track which page-table levels were modified mm/vmalloc: track which page-table levels were modified mm: add functions to track page directory modifications s390: use __vmalloc_node in stack_alloc powerpc: use __vmalloc_node in alloc_vm_stack arm64: use __vmalloc_node in arch_alloc_vmap_stack mm: remove vmalloc_user_node_flags mm: switch the test_vmalloc module to use __vmalloc_node mm: remove __vmalloc_node_flags_caller mm: remove both instances of __vmalloc_node_flags mm: remove the prot argument to __vmalloc_node mm: remove the pgprot argument to __vmalloc ... commit 9bc499befeef07a4d79f4924bfca05634ad8fc97 Author: Ilya Leoshkevich Date: Tue Jun 2 19:44:48 2020 +0200 bpf, selftests: Use bpf_probe_read_kernel Since commit 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") 44 verifier tests fail on s390 due to not having bpf_probe_read anymore. Fix by using bpf_probe_read_kernel. Signed-off-by: Ilya Leoshkevich Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200602174448.2501214-1-iii@linux.ibm.com commit 33d21f18204cb33b43ca6c78c8180949f6dc7227 Author: Ilya Leoshkevich Date: Tue Jun 2 19:45:55 2020 +0200 s390/bpf: Use bcr 0,%0 as tail call nop filler Currently used 0x0000 filler confuses bfd disassembler, making bpftool prog dump xlated output nearly useless. Fix by using a real instruction. Signed-off-by: Ilya Leoshkevich Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200602174555.2501389-1-iii@linux.ibm.com commit effe5be17706167ee968fa28afe40dec9c6f71db Author: Ilya Leoshkevich Date: Tue Jun 2 19:43:39 2020 +0200 s390/bpf: Maintain 8-byte stack alignment Certain kernel functions (e.g. get_vtimer/set_vtimer) cause kernel panic when the stack is not 8-byte aligned. Currently JITed BPF programs may trigger this by allocating stack frames with non-rounded sizes and then being interrupted. Fix by using rounded fp->aux->stack_depth. Signed-off-by: Ilya Leoshkevich Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200602174339.2501066-1-iii@linux.ibm.com commit 7cec0b927142f510a1fac88033017616cce44c26 Author: Alexei Starovoitov Date: Tue Jun 2 11:57:43 2020 -0700 selftests/bpf: Fix verifier test Adjust verifier test due to addition of new field. Fixes: c3c16f2ea6d2 ("bpf: Add rx_queue_mapping to bpf_sock") Signed-off-by: Alexei Starovoitov commit 9a5f25ad30e5bb40a2e0c61c991594d3e6529c0a Author: Andrii Nakryiko Date: Mon Jun 1 22:03:49 2020 -0700 selftests/bpf: Fix sample_cnt shared between two threads Make sample_cnt volatile to fix possible selftests failure due to compiler optimization preventing latest sample_cnt value to be visible to main thread. sample_cnt is incremented in background thread, which is then joined into main thread. So in terms of visibility sample_cnt update is ok. But because it's not volatile, compiler might make optimizations that would prevent main thread to see latest updated value. Fix this by marking global variable volatile. Fixes: cb1c9ddd5525 ("selftests/bpf: Add BPF ringbuf selftests") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200602050349.215037-1-andriin@fb.com commit f371c923505010b28c8a76f7d7973c014a1d0f5c Merge: 9a25c1df24a6 c4ba153b6501 Author: Alexei Starovoitov Date: Tue Jun 2 11:50:23 2020 -0700 Merge branch 'csum-fixes' Daniel Borkmann says: ==================== This series fixes an issue originally reported by Lorenz Bauer where using the bpf_skb_adjust_room() helper hid a checksum bug since it wasn't adjusting CHECKSUM_UNNECESSARY's skb->csum_level after decap. The fix is two-fold: i) We do a safe reset in bpf_skb_adjust_room() to CHECKSUM_NONE with an opt- out flag BPF_F_ADJ_ROOM_NO_CSUM_RESET. ii) We add a new bpf_csum_level() for the latter in order to allow users to manually inc/dec the skb->csum_level when needed. The series is rebased against latest bpf-next tree. It can be applied there, or to bpf after the merge win sync from net-next. Thanks! ==================== Signed-off-by: Alexei Starovoitov commit c4ba153b6501fa7ccfdc7e57946fb1d6011e36e8 Author: Daniel Borkmann Date: Tue Jun 2 16:58:34 2020 +0200 bpf, selftests: Adapt cls_redirect to call csum_level helper Adapt bpf_skb_adjust_room() to pass in BPF_F_ADJ_ROOM_NO_CSUM_RESET flag and use the new bpf_csum_level() helper to inc/dec the checksum level by one after the encap/decap. Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Reviewed-by: Lorenz Bauer Link: https://lore.kernel.org/bpf/e7458f10e3f3d795307cbc5ad870112671d9c6f7.1591108731.git.daniel@iogearbox.net commit 7cdec54f9713256bb170873a1fc5c75c9127c9d2 Author: Daniel Borkmann Date: Tue Jun 2 16:58:33 2020 +0200 bpf: Add csum_level helper for fixing up csum levels Add a bpf_csum_level() helper which BPF programs can use in combination with bpf_skb_adjust_room() when they pass in BPF_F_ADJ_ROOM_NO_CSUM_RESET flag to the latter to avoid falling back to CHECKSUM_NONE. The bpf_csum_level() allows to adjust CHECKSUM_UNNECESSARY skb->csum_levels via BPF_CSUM_LEVEL_{INC,DEC} which calls __skb_{incr,decr}_checksum_unnecessary() on the skb. The helper also allows a BPF_CSUM_LEVEL_RESET which sets the skb's csum to CHECKSUM_NONE as well as a BPF_CSUM_LEVEL_QUERY to just return the current level. Without this helper, there is no way to otherwise adjust the skb->csum_level. I did not add an extra dummy flags as there is plenty of free bitspace in level argument itself iff ever needed in future. Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Acked-by: Lorenz Bauer Link: https://lore.kernel.org/bpf/279ae3717cb3d03c0ffeb511493c93c450a01e1a.1591108731.git.daniel@iogearbox.net commit 836e66c218f355ec01ba57671c85abf32961dcea Author: Daniel Borkmann Date: Tue Jun 2 16:58:32 2020 +0200 bpf: Fix up bpf_skb_adjust_room helper's skb csum setting Lorenz recently reported: In our TC classifier cls_redirect [0], we use the following sequence of helper calls to decapsulate a GUE (basically IP + UDP + custom header) encapsulated packet: bpf_skb_adjust_room(skb, -encap_len, BPF_ADJ_ROOM_MAC, BPF_F_ADJ_ROOM_FIXED_GSO) bpf_redirect(skb->ifindex, BPF_F_INGRESS) It seems like some checksums of the inner headers are not validated in this case. For example, a TCP SYN packet with invalid TCP checksum is still accepted by the network stack and elicits a SYN ACK. [...] That is, we receive the following packet from the driver: | ETH | IP | UDP | GUE | IP | TCP | skb->ip_summed == CHECKSUM_UNNECESSARY ip_summed is CHECKSUM_UNNECESSARY because our NICs do rx checksum offloading. On this packet we run skb_adjust_room_mac(-encap_len), and get the following: | ETH | IP | TCP | skb->ip_summed == CHECKSUM_UNNECESSARY Note that ip_summed is still CHECKSUM_UNNECESSARY. After bpf_redirect()'ing into the ingress, we end up in tcp_v4_rcv(). There, skb_checksum_init() is turned into a no-op due to CHECKSUM_UNNECESSARY. The bpf_skb_adjust_room() helper is not aware of protocol specifics. Internally, it handles the CHECKSUM_COMPLETE case via skb_postpull_rcsum(), but that does not cover CHECKSUM_UNNECESSARY. In this case skb->csum_level of the original skb prior to bpf_skb_adjust_room() call was 0, that is, covering UDP. Right now there is no way to adjust the skb->csum_level. NICs that have checksum offload disabled (CHECKSUM_NONE) or that support CHECKSUM_COMPLETE are not affected. Use a safe default for CHECKSUM_UNNECESSARY by resetting to CHECKSUM_NONE and add a flag to the helper called BPF_F_ADJ_ROOM_NO_CSUM_RESET that allows users from opting out. Opting out is useful for the case where we don't remove/add full protocol headers, or for the case where a user wants to adjust the csum level manually e.g. through bpf_csum_level() helper that is added in subsequent patch. The bpf_skb_proto_{4_to_6,6_to_4}() for NAT64/46 translation from the BPF bpf_skb_change_proto() helper uses bpf_skb_net_hdr_{push,pop}() pair internally as well but doesn't change layers, only transitions between v4 to v6 and vice versa, therefore no adoption is required there. [0] https://lore.kernel.org/bpf/20200424185556.7358-1-lmb@cloudflare.com/ Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper") Reported-by: Lorenz Bauer Reported-by: Alan Maguire Signed-off-by: Daniel Borkmann Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/CACAyw9-uU_52esMd1JjuA80fRPHJv5vsSg8GnfW3t_qDU4aVKQ@mail.gmail.com/ Link: https://lore.kernel.org/bpf/11a90472e7cce83e76ddbfce81fdfce7bfc68808.1591108731.git.daniel@iogearbox.net commit 9ad249abe7b8f6f0d2d876bde860b1c511d71d7b Merge: 603986a7a486 818227321d33 Author: Arnd Bergmann Date: Tue Jun 2 20:45:53 2020 +0200 Merge tag 'zynqmp-dt-for-v5.8' of https://github.com/Xilinx/linux-xlnx into arm/dt arm64: dt: ZynqMP DT fixes for v5.8 - Add AES mode and fix GIC node * tag 'zynqmp-dt-for-v5.8' of https://github.com/Xilinx/linux-xlnx: arm64: zynqmp: Fix GIC compatible property arm64: zynqmp: Add Xilinx AES node Link: https://lore.kernel.org/r/ad25cfb0-156c-9bf6-a7b8-e30a7a859135@monstr.eu Signed-off-by: Arnd Bergmann commit 4fba37586e4e73f9f9a855e610e151ef7da2b481 Author: Andrey Konovalov Date: Mon Jun 1 21:52:53 2020 -0700 kasan: move kasan_report() into report.c The kasan_report() functions belongs to report.c, as it's a common functions that does error reporting. Reported-by: Leon Romanovsky Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Tested-by: Leon Romanovsky Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Leon Romanovsky Link: http://lkml.kernel.org/r/78a81fde6eeda9db72a7fd55fbc33173a515e4b1.1589297433.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 86fea8b49494a06a99c6a7511b73b97adbaf4a5b Author: Jing Xia Date: Mon Jun 1 21:52:49 2020 -0700 mm/mm_init.c: report kasan-tag information stored in page->flags The pageflags_layout_usage shows incorrect message by means of mminit_loglevel when Kasan runs in the mode of software tag-based enabled with CONFIG_KASAN_SW_TAGS. This patch corrects it and reports kasan-tag information. Signed-off-by: Jing Xia Signed-off-by: Andrew Morton Cc: Chunyan Zhang Cc: Orson Zhai Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Link: http://lkml.kernel.org/r/1586929370-10838-1-git-send-email-jing.xia.mail@gmail.com Signed-off-by: Linus Torvalds commit 9380ce246a052a1e00121cd480028b6907aeae38 Author: Kees Cook Date: Mon Jun 1 21:52:46 2020 -0700 ubsan: entirely disable alignment checks under UBSAN_TRAP Commit 8d58f222e85f ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") tried to fix the pathological results of UBSAN_ALIGNMENT with UBSAN_TRAP (which objtool would rightly scream about), but it made an assumption about how COMPILE_TEST gets set (it is not set for randconfig). As a result, we need a bigger hammer here: just don't allow the alignment checks with the trap mode. Fixes: 8d58f222e85f ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") Reported-by: Randy Dunlap Signed-off-by: Kees Cook Signed-off-by: Andrew Morton Acked-by: Randy Dunlap Cc: Josh Poimboeuf Cc: Dmitry Vyukov Cc: Elena Petrova Link: http://lkml.kernel.org/r/202005291236.000FCB6@keescook Link: https://lore.kernel.org/lkml/742521db-1e8c-0d7a-1ed4-a908894fb497@infradead.org/ Signed-off-by: Linus Torvalds commit ca734cc67e3c8ce20eb75dd1e45ae86e10be102b Author: Andrey Konovalov Date: Mon Jun 1 21:52:43 2020 -0700 kasan: fix clang compilation warning due to stack protector KASAN uses a single cc-option invocation to disable both conserve-stack and stack-protector flags. The former flag is not present in Clang, which causes cc-option to fail, and results in stack-protector being enabled. Fix by using separate cc-option calls for each flag. Also collect all flags in a variable to avoid calling cc-option multiple times for different files. Reported-by: Qian Cai Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Reviewed-by: Marco Elver Link: http://lkml.kernel.org/r/c2f0c8e4048852ae014f4a391d96ca42d27e3255.1590779332.git.andreyknvl@google.com Signed-off-by: Linus Torvalds commit 7f0a002b5a21302d9f4b29ba83c96cd433ff3769 Author: Joerg Roedel Date: Mon Jun 1 21:52:40 2020 -0700 x86/mm: remove vmalloc faulting Remove fault handling on vmalloc areas, as the vmalloc code now takes care of synchronizing changes to all page-tables in the system. Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dave Hansen Cc: "H . Peter Anvin" Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200515140023.25469-8-joro@8bytes.org Signed-off-by: Linus Torvalds commit 73f693c3a705756032c2863bfb37570276902d7d Author: Joerg Roedel Date: Mon Jun 1 21:52:36 2020 -0700 mm: remove vmalloc_sync_(un)mappings() These functions are not needed anymore because the vmalloc and ioremap mappings are now synchronized when they are created or torn down. Remove all callers and function definitions. Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Tested-by: Steven Rostedt (VMware) Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dave Hansen Cc: "H . Peter Anvin" Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Thomas Gleixner Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200515140023.25469-7-joro@8bytes.org Signed-off-by: Linus Torvalds commit 86cf69f1d893d48fdb0382a940f2523409406423 Author: Joerg Roedel Date: Mon Jun 1 21:52:33 2020 -0700 x86/mm/32: implement arch_sync_kernel_mappings() Implement the function to sync changes in vmalloc and ioremap ranges to all page-tables. Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dave Hansen Cc: "H . Peter Anvin" Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200515140023.25469-6-joro@8bytes.org Signed-off-by: Linus Torvalds commit 8e19843c36abae08e1e541a65ce53fd2e88499fc Author: Joerg Roedel Date: Mon Jun 1 21:52:29 2020 -0700 x86/mm/64: implement arch_sync_kernel_mappings() Implement the function to sync changes in vmalloc and ioremap ranges to all page-tables. Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dave Hansen Cc: "H . Peter Anvin" Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200515140023.25469-5-joro@8bytes.org Signed-off-by: Linus Torvalds commit 6c0c7d2b365b21a413f6d75772a8a4a2c7d36916 Author: Joerg Roedel Date: Mon Jun 1 21:52:26 2020 -0700 mm/ioremap: track which page-table levels were modified Track at which levels in the page-table entries were modified by ioremap_page_range(). After the page-table has been modified, use that information do decide whether the new arch_sync_kernel_mappings() needs to be called. The iounmap path re-uses vunmap(), which has already been taken care of. Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dave Hansen Cc: "H . Peter Anvin" Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200515140023.25469-4-joro@8bytes.org Signed-off-by: Linus Torvalds commit 2ba3e6947aed9bb9575eb1603c0ac6e39185d32a Author: Joerg Roedel Date: Mon Jun 1 21:52:22 2020 -0700 mm/vmalloc: track which page-table levels were modified Track at which levels in the page-table entries were modified by vmap/vunmap. After the page-table has been modified, use that information do decide whether the new arch_sync_kernel_mappings() needs to be called. [akpm@linux-foundation.org: map_kernel_range_noflush() needs the arch_sync_kernel_mappings() call] Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dave Hansen Cc: "H . Peter Anvin" Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Vlastimil Babka Link: http://lkml.kernel.org/r/20200515140023.25469-3-joro@8bytes.org Signed-off-by: Linus Torvalds commit d8626138009ba58ae2c22356966c2edaa1f1c3b5 Author: Joerg Roedel Date: Mon Jun 1 21:52:18 2020 -0700 mm: add functions to track page directory modifications Patch series "mm: Get rid of vmalloc_sync_(un)mappings()", v3. After the recent issue with vmalloc and tracing code[1] on x86 and a long history of previous issues related to the vmalloc_sync_mappings() interface, I thought the time has come to remove it. Please see [2], [3], and [4] for some other issues in the past. The patches add tracking of page-table directory changes to the vmalloc and ioremap code. Depending on which page-table levels changes have been made, a new per-arch function is called: arch_sync_kernel_mappings(). On x86-64 with 4-level paging, this function will not be called more than 64 times in a systems runtime (because vmalloc-space takes 64 PGD entries which are only populated, but never cleared). As a side effect this also allows to get rid of vmalloc faults on x86, making it safe to touch vmalloc'ed memory in the page-fault handler. Note that this potentially includes per-cpu memory. This patch (of 7): Add page-table allocation functions which will keep track of changed directory entries. They are needed for new PGD, P4D, PUD, and PMD entries and will be used in vmalloc and ioremap code to decide whether any changes in the kernel mappings need to be synchronized between page-tables in the system. Signed-off-by: Joerg Roedel Signed-off-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Cc: "H . Peter Anvin" Cc: Dave Hansen Cc: "Rafael J. Wysocki" Cc: Arnd Bergmann Cc: Steven Rostedt (VMware) Cc: Vlastimil Babka Cc: Michal Hocko Cc: Matthew Wilcox (Oracle) Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Christoph Hellwig Link: http://lkml.kernel.org/r/20200515140023.25469-1-joro@8bytes.org Link: http://lkml.kernel.org/r/20200515140023.25469-2-joro@8bytes.org Signed-off-by: Linus Torvalds commit b200f5b58c86aa75b8b6952ce9b89013c6660a57 Author: Christoph Hellwig Date: Mon Jun 1 21:52:14 2020 -0700 s390: use __vmalloc_node in stack_alloc stack_alloc can use a slightly higher level vmalloc function. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Christian Borntraeger Acked-by: Peter Zijlstra (Intel) Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: David Airlie Cc: Laura Abbott Cc: Sumit Semwal Cc: Sakari Ailus Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Christophe Leroy Cc: Daniel Vetter Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Johannes Weiner Cc: Mark Rutland Cc: Michael Kelley Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-30-hch@lst.de Signed-off-by: Linus Torvalds commit cb0849a990b2928760bc38561e8d33b554196e25 Author: Christoph Hellwig Date: Mon Jun 1 21:52:10 2020 -0700 powerpc: use __vmalloc_node in alloc_vm_stack alloc_vm_stack can use a slightly higher level vmalloc function. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-29-hch@lst.de Signed-off-by: Linus Torvalds commit ebcdd3074a729f9ba351278e1b42d7ae7fcdf236 Author: Christoph Hellwig Date: Mon Jun 1 21:52:06 2020 -0700 arm64: use __vmalloc_node in arch_alloc_vmap_stack arch_alloc_vmap_stack can use a slightly higher level vmalloc function. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-28-hch@lst.de Signed-off-by: Linus Torvalds commit 041de93ff86fc500aa73e5360039c95f4d31b95f Author: Christoph Hellwig Date: Mon Jun 1 21:52:02 2020 -0700 mm: remove vmalloc_user_node_flags Open code it in __bpf_map_area_alloc, which is the only caller. Also clean up __bpf_map_area_alloc to have a single vmalloc call with slightly different flags instead of the current two different calls. For this to compile for the nommu case add a __vmalloc_node_range stub to nommu.c. [akpm@linux-foundation.org: fix nommu.c build] Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/20200414131348.444715-27-hch@lst.de Signed-off-by: Linus Torvalds commit c3f896dcf1e47959aca4f8e6ac9537b478949126 Author: Christoph Hellwig Date: Mon Jun 1 21:51:57 2020 -0700 mm: switch the test_vmalloc module to use __vmalloc_node No need to export the very low-level __vmalloc_node_range when the test module can use a slightly higher level variant. [akpm@linux-foundation.org: add missing `node' arg] [akpm@linux-foundation.org: fix riscv nommu build] Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-26-hch@lst.de Signed-off-by: Linus Torvalds commit 2b9059489c839e67ca9254913325e18cea11a980 Author: Christoph Hellwig Date: Mon Jun 1 21:51:53 2020 -0700 mm: remove __vmalloc_node_flags_caller Just use __vmalloc_node instead which gets and extra argument. To be able to to use __vmalloc_node in all caller make it available outside of vmalloc and implement it in nommu.c. [akpm@linux-foundation.org: fix nommu build] Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Cc: Stephen Rothwell Link: http://lkml.kernel.org/r/20200414131348.444715-25-hch@lst.de Signed-off-by: Linus Torvalds commit 4d39d7285f45cc6c72b850f040d3addd626658e4 Author: Christoph Hellwig Date: Mon Jun 1 21:51:49 2020 -0700 mm: remove both instances of __vmalloc_node_flags The real version just had a few callers that can open code it and remove one layer of indirection. The nommu stub was public but only had a single caller, so remove it and avoid a CONFIG_MMU ifdef in vmalloc.h. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-24-hch@lst.de Signed-off-by: Linus Torvalds commit f38fcb9c1c5e9df20bf6d8aa9e9f36eb98d78c9f Author: Christoph Hellwig Date: Mon Jun 1 21:51:45 2020 -0700 mm: remove the prot argument to __vmalloc_node This is always PAGE_KERNEL now. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-23-hch@lst.de Signed-off-by: Linus Torvalds commit 88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Author: Christoph Hellwig Date: Mon Jun 1 21:51:40 2020 -0700 mm: remove the pgprot argument to __vmalloc The pgprot argument to __vmalloc is always PAGE_KERNEL now, so remove it. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Reviewed-by: Michael Kelley [hyperv] Acked-by: Gao Xiang [erofs] Acked-by: Peter Zijlstra (Intel) Acked-by: Wei Liu Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-22-hch@lst.de Signed-off-by: Linus Torvalds commit d28ff991b2e23049c30584c1d97681087193879f Author: Christoph Hellwig Date: Mon Jun 1 21:51:36 2020 -0700 gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc The non-cached vmalloc mapping was initially added as a hack for the first-gen amigaone platform (6xx/book32s), isn't fully supported upstream, and which used the legacy radeon driver together with non-coherent DMA. However this only ever worked reliably for DRI . Remove the hack as it is the last user of __vmalloc passing a page protection flag other than PAGE_KERNEL and didn't do anything for other platforms with non-coherent DMA. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Daniel Vetter Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-21-hch@lst.de Signed-off-by: Linus Torvalds commit cca98e9f8b5ebcd9640846a675172578249b11a0 Author: Christoph Hellwig Date: Mon Jun 1 21:51:32 2020 -0700 mm: enforce that vmap can't map pages executable To help enforcing the W^X protection don't allow remapping existing pages as executable. x86 bits from Peter Zijlstra, arm64 bits from Mark Rutland. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Mark Rutland . Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-20-hch@lst.de Signed-off-by: Linus Torvalds commit d4efd79a81abc7096a418ee3103f261cfb6ab634 Author: Christoph Hellwig Date: Mon Jun 1 21:51:27 2020 -0700 mm: remove the prot argument from vm_map_ram This is always PAGE_KERNEL - for long term mappings with other properties vmap should be used. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-19-hch@lst.de Signed-off-by: Linus Torvalds commit 855e57a11966722c67e631ae530c03e251fbcf8a Author: Christoph Hellwig Date: Mon Jun 1 21:51:23 2020 -0700 mm: remove unmap_vmap_area This function just has a single caller, open code it there. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-18-hch@lst.de Signed-off-by: Linus Torvalds commit ed1f324c5fed06c91f30a36aedb66f34244ab86e Author: Christoph Hellwig Date: Mon Jun 1 21:51:19 2020 -0700 mm: remove map_vm_range Switch all callers to map_kernel_range, which symmetric to the unmap side (as well as the _noflush versions). Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-17-hch@lst.de Signed-off-by: Linus Torvalds commit 60bb44652a0dcc44acfc2ed8ebb35e4a389e5421 Author: Christoph Hellwig Date: Mon Jun 1 21:51:15 2020 -0700 mm: don't return the number of pages from map_kernel_range{,_noflush} None of the callers needs the number of pages, and a 0 / -errno return value is a lot more intuitive. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-16-hch@lst.de Signed-off-by: Linus Torvalds commit a29adb6209cead1f6c34a8d72481fb183bfc2d68 Author: Christoph Hellwig Date: Mon Jun 1 21:51:11 2020 -0700 mm: rename vmap_page_range to map_kernel_range This matches the map_kernel_range_noflush API. Also change to pass a size instead of the end, similar to the noflush version. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-15-hch@lst.de Signed-off-by: Linus Torvalds commit b521c43f58e5234ee9b29817ed5e93523abcffa9 Author: Christoph Hellwig Date: Mon Jun 1 21:51:07 2020 -0700 mm: remove vmap_page_range_noflush and vunmap_page_range These have non-static aliases called map_kernel_range_noflush and unmap_kernel_range_noflush that just differ slightly in the calling conventions that pass addr + size instead of an end. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-14-hch@lst.de Signed-off-by: Linus Torvalds commit 78a0e8c4837f42e9c2b1127e9c450ceeb0efbde6 Author: Christoph Hellwig Date: Mon Jun 1 21:51:02 2020 -0700 mm: pass addr as unsigned long to vb_free Ever use of addr in vb_free casts to unsigned long first, and the caller has an unsigned long version of the address available anyway. Just pass that and avoid all the casts. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-13-hch@lst.de Signed-off-by: Linus Torvalds commit b607e6d17db5b91e6a807b4f9a2e849219d720a0 Author: Christoph Hellwig Date: Mon Jun 1 21:50:58 2020 -0700 mm: only allow page table mappings for built-in zsmalloc This allows to unexport map_vm_area and unmap_kernel_range, which are rather deep internal and should not be available to modules, as they for example allow fine grained control of mapping permissions, and also allow splitting the setup of a vmalloc area and the actual mapping and thus expose vmalloc internals. zsmalloc is typically built-in and continues to work (just like the percpu-vm code using a similar patter), while modular zsmalloc also continues to work, but must use copies. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-12-hch@lst.de Signed-off-by: Linus Torvalds commit 8b136018da7bf49b988a24064fc45c290baffd93 Author: Christoph Hellwig Date: Mon Jun 1 21:50:53 2020 -0700 mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING Rename the Kconfig variable to clarify the scope. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Minchan Kim Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-11-hch@lst.de Signed-off-by: Linus Torvalds commit 8f87cc9386dc7965de151605637eee939ea0d098 Author: Christoph Hellwig Date: Mon Jun 1 21:50:49 2020 -0700 mm: unexport unmap_kernel_range_noflush There are no modular users of this function. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-10-hch@lst.de Signed-off-by: Linus Torvalds commit 4926627793c0a7e7db2bc674e1d06777e86d8dab Author: Christoph Hellwig Date: Mon Jun 1 21:50:45 2020 -0700 mm: remove __get_vm_area Switch the two remaining callers to use __get_vm_area_caller instead. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-9-hch@lst.de Signed-off-by: Linus Torvalds commit 91f03f297c46bd2ced1e73fc9a668292145b1135 Author: Christoph Hellwig Date: Mon Jun 1 21:50:41 2020 -0700 powerpc: remove __ioremap_at and __iounmap_at These helpers are only used for remapping the ISA I/O base. Replace the mapping side with a remap_isa_range helper in isa-bridge.c that hard codes all the known arguments, and just remove __iounmap_at in favour of open coding it in the only caller. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-8-hch@lst.de Signed-off-by: Linus Torvalds commit b274014c6d191ec92c4921d5e84c90f6ed2f38a0 Author: Christoph Hellwig Date: Mon Jun 1 21:50:37 2020 -0700 powerpc: add an ioremap_phb helper Factor code shared between pci_64 and electra_cf into a ioremap_pbh helper that follows the normal ioremap semantics, and returns a useful __iomem pointer. Note that it opencodes __ioremap_at as we know from the callers the slab is available. Switch pci_64 to also store the result as __iomem pointer, and unmap the result using iounmap instead of force casting and using vmalloc APIs. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-7-hch@lst.de Signed-off-by: Linus Torvalds commit 515e5b6d90d410a3b0b433853c367936830a45a4 Author: Christoph Hellwig Date: Mon Jun 1 21:50:32 2020 -0700 dma-mapping: use vmap insted of reimplementing it Replace the open coded instance of vmap with the actual function. In the non-contiguous (IOMMU) case this requires an extra find_vm_area, but given that this isn't a fast path function that is a small price to pay. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-6-hch@lst.de Signed-off-by: Linus Torvalds commit f8092aa1752749b6d8b357050e840f76695e2361 Author: Christoph Hellwig Date: Mon Jun 1 21:50:28 2020 -0700 staging: media: ipu3: use vmap instead of reimplementing it Just use vmap instead of messing with vmalloc internals. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-5-hch@lst.de Signed-off-by: Linus Torvalds commit 5bf9917452112694b2c774465ee4dbe441c84b77 Author: Christoph Hellwig Date: Mon Jun 1 21:50:23 2020 -0700 staging: android: ion: use vmap instead of vm_map_ram vm_map_ram can keep mappings around after the vm_unmap_ram. Using that with non-PAGE_KERNEL mappings can lead to all kinds of aliasing issues. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Greg Kroah-Hartman Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-4-hch@lst.de Signed-off-by: Linus Torvalds commit 0348801151b5aefbcf9d6e9b9e30aceb3a2a7b13 Author: Christoph Hellwig Date: Mon Jun 1 21:50:19 2020 -0700 x86: fix vmap arguments in map_irq_stack vmap does not take a gfp_t, the flags argument is for VM_* flags. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Peter Zijlstra (Intel) Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-3-hch@lst.de Signed-off-by: Linus Torvalds commit 78bb17f76edc3959152334947deec4dcb56e3764 Author: Christoph Hellwig Date: Mon Jun 1 21:50:15 2020 -0700 x86/hyperv: use vmalloc_exec for the hypercall page Patch series "decruft the vmalloc API", v2. Peter noticed that with some dumb luck you can toast the kernel address space with exported vmalloc symbols. I used this as an opportunity to decruft the vmalloc.c API and make it much more systematic. This also removes any chance to create vmalloc mappings outside the designated areas or using executable permissions from modules. Besides that it removes more than 300 lines of code. This patch (of 29): Use the designated helper for allocating executable kernel memory, and remove the now unused PAGE_KERNEL_RX define. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Reviewed-by: Michael Kelley Acked-by: Wei Liu Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Catalin Marinas Cc: Will Deacon Cc: Heiko Carstens Cc: Vasily Gorbik Link: http://lkml.kernel.org/r/20200414131348.444715-1-hch@lst.de Link: http://lkml.kernel.org/r/20200414131348.444715-2-hch@lst.de Signed-off-by: Linus Torvalds commit 872e9a205c8491daf1a51ea3733c8c1d15d51e10 Author: Wetp Zhang Date: Mon Jun 1 21:50:11 2020 -0700 mm, memory_failure: don't send BUS_MCEERR_AO for action required error Some processes dont't want to be killed early, but in "Action Required" case, those also may be killed by BUS_MCEERR_AO when sharing memory with other which is accessing the fail memory. And sending SIGBUS with BUS_MCEERR_AO for action required error is strange, so ignore the non-current processes here. Suggested-by: Naoya Horiguchi Signed-off-by: Wetp Zhang Signed-off-by: Andrew Morton Acked-by: Naoya Horiguchi Acked-by: Pankaj Gupta Link: http://lkml.kernel.org/r/1590817116-21281-1-git-send-email-wetp.zy@linux.alibaba.com Signed-off-by: Linus Torvalds commit 6972f55c413fedb7d5701a65e751ea6f10d1e0a5 Author: chenqiwu Date: Mon Jun 1 21:50:08 2020 -0700 mm/memory: remove unnecessary pte_devmap case in copy_one_pte() Since commit 25b2995a35b6 ("mm: remove MEMORY_DEVICE_PUBLIC support"), the assignment to 'page' for pte_devmap case has been unnecessary. Let's remove it. [willy@infradead.org: changelog] Signed-off-by: chenqiwu Signed-off-by: Andrew Morton Reviewed-by: Matthew Wilcox Acked-by: Michal Hocko Link: http://lkml.kernel.org/r/1587349685-31712-1-git-send-email-qiwuchen55@gmail.com Signed-off-by: Linus Torvalds commit c94b6923fa0a954fbe14ea0168b9d324011fd817 Author: Huang Ying Date: Mon Jun 1 21:50:05 2020 -0700 /proc/PID/smaps: Add PMD migration entry parsing Now, when reading /proc/PID/smaps, the PMD migration entry in page table is simply ignored. To improve the accuracy of /proc/PID/smaps, its parsing and processing is added. To test the patch, we run pmbench to eat 400 MB memory in background, then run /usr/bin/migratepages and `cat /proc/PID/smaps` every second. The issue as follows can be reproduced within 60 seconds. Before the patch, for the fully populated 400 MB anonymous VMA, some THP pages under migration may be lost as below. 7f3f6a7e5000-7f3f837e5000 rw-p 00000000 00:00 0 Size: 409600 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 407552 kB Pss: 407552 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 407552 kB Referenced: 301056 kB Anonymous: 407552 kB LazyFree: 0 kB AnonHugePages: 405504 kB ShmemPmdMapped: 0 kB FilePmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB THPeligible: 1 VmFlags: rd wr mr mw me ac After the patch, it will be always, 7f3f6a7e5000-7f3f837e5000 rw-p 00000000 00:00 0 Size: 409600 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 409600 kB Pss: 409600 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 409600 kB Referenced: 294912 kB Anonymous: 409600 kB LazyFree: 0 kB AnonHugePages: 407552 kB ShmemPmdMapped: 0 kB FilePmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB THPeligible: 1 VmFlags: rd wr mr mw me ac Signed-off-by: "Huang, Ying" Signed-off-by: Andrew Morton Reviewed-by: Zi Yan Acked-by: Michal Hocko Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Alexey Dobriyan Cc: Konstantin Khlebnikov Cc: "Jérôme Glisse" Cc: Yang Shi Link: http://lkml.kernel.org/r/20200403123059.1846960-1-ying.huang@intel.com Signed-off-by: Linus Torvalds commit 99395ee3f7b4accc3a16a6aa4c2abb3774fc33ca Author: Steven Price Date: Mon Jun 1 21:50:01 2020 -0700 mm: ptdump: expand type of 'val' in note_page() The page table entry is passed in the 'val' argument to note_page(), however this was previously an "unsigned long" which is fine on 64-bit platforms. But for 32 bit x86 it is not always big enough to contain a page table entry which may be 64 bits. Change the type to u64 to ensure that it is always big enough. [akpm@linux-foundation.org: fix riscv] Reported-by: Jan Beulich Signed-off-by: Steven Price Signed-off-by: Andrew Morton Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Link: http://lkml.kernel.org/r/20200521152308.33096-3-steven.price@arm.com Signed-off-by: Linus Torvalds commit 1494e0c38ee903e83aefb58caf54a9217273d49a Author: Steven Price Date: Mon Jun 1 21:49:58 2020 -0700 x86: mm: ptdump: calculate effective permissions correctly Patch series "Fix W+X debug feature on x86" Jan alerted me[1] that the W+X detection debug feature was broken in x86 by my change[2] to switch x86 to use the generic ptdump infrastructure. Fundamentally the approach of trying to move the calculation of effective permissions into note_page() was broken because note_page() is only called for 'leaf' entries and the effective permissions are passed down via the internal nodes of the page tree. The solution I've taken here is to create a new (optional) callback which is called for all nodes of the page tree and therefore can calculate the effective permissions. Secondly on some configurations (32 bit with PAE) "unsigned long" is not large enough to store the table entries. The fix here is simple - let's just use a u64. [1] https://lore.kernel.org/lkml/d573dc7e-e742-84de-473d-f971142fa319@suse.com/ [2] 2ae27137b2db ("x86: mm: convert dump_pagetables to use walk_page_range") This patch (of 2): By switching the x86 page table dump code to use the generic code the effective permissions are no longer calculated correctly because the note_page() function is only called for *leaf* entries. To calculate the actual effective permissions it is necessary to observe the full hierarchy of the page tree. Introduce a new callback for ptdump which is called for every entry and can therefore update the prot_levels array correctly. note_page() can then simply access the appropriate element in the array. [steven.price@arm.com: make the assignment conditional on val != 0] Link: http://lkml.kernel.org/r/430c8ab4-e7cd-6933-dde6-087fac6db872@arm.com Fixes: 2ae27137b2db ("x86: mm: convert dump_pagetables to use walk_page_range") Reported-by: Jan Beulich Signed-off-by: Steven Price Signed-off-by: Andrew Morton Cc: Qian Cai Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Link: http://lkml.kernel.org/r/20200521152308.33096-1-steven.price@arm.com Link: http://lkml.kernel.org/r/20200521152308.33096-2-steven.price@arm.com Signed-off-by: Linus Torvalds commit 50d53d7c724330a0dc4df26c45de2a9a886c5d88 Author: Zefan Li Date: Mon Jun 1 21:49:55 2020 -0700 memcg: fix memcg_kmem_bypass() for remote memcg charging While trying to use remote memcg charging in an out-of-tree kernel module I found it's not working, because the current thread is a workqueue thread. As we will probably encounter this issue in the future as the users of memalloc_use_memcg() grow, and it's nothing wrong for this usage, it's better we fix it now. Signed-off-by: Zefan Li Signed-off-by: Andrew Morton Reviewed-by: Roman Gushchin Reviewed-by: Shakeel Butt Acked-by: Johannes Weiner Acked-by: Michal Hocko Cc: Vladimir Davydov Link: http://lkml.kernel.org/r/1d202a12-26fe-0012-ea14-f025ddcd044a@huawei.com Signed-off-by: Linus Torvalds commit 4b82ab4f28836646eca12cb37f408568d3cdc5c3 Author: Jakub Kicinski Date: Mon Jun 1 21:49:52 2020 -0700 mm/memcg: automatically penalize tasks with high swap use Add a memory.swap.high knob, which can be used to protect the system from SWAP exhaustion. The mechanism used for penalizing is similar to memory.high penalty (sleep on return to user space). That is not to say that the knob itself is equivalent to memory.high. The objective is more to protect the system from potentially buggy tasks consuming a lot of swap and impacting other tasks, or even bringing the whole system to stand still with complete SWAP exhaustion. Hopefully without the need to find per-task hard limits. Slowing misbehaving tasks down gradually allows user space oom killers or other protection mechanisms to react. oomd and earlyoom already do killing based on swap exhaustion, and memory.swap.high protection will help implement such userspace oom policies more reliably. We can use one counter for number of pages allocated under pressure to save struct task space and avoid two separate hierarchy walks on the hot path. The exact overage is calculated on return to user space, anyway. Take the new high limit into account when determining if swap is "full". Borrowing the explanation from Johannes: The idea behind "swap full" is that as long as the workload has plenty of swap space available and it's not changing its memory contents, it makes sense to generously hold on to copies of data in the swap device, even after the swapin. A later reclaim cycle can drop the page without any IO. Trading disk space for IO. But the only two ways to reclaim a swap slot is when they're faulted in and the references go away, or by scanning the virtual address space like swapoff does - which is very expensive (one could argue it's too expensive even for swapoff, it's often more practical to just reboot). So at some point in the fill level, we have to start freeing up swap slots on fault/swapin. Otherwise we could eventually run out of swap slots while they're filled with copies of data that is also in RAM. We don't want to OOM a workload because its available swap space is filled with redundant cache. Signed-off-by: Jakub Kicinski Signed-off-by: Andrew Morton Acked-by: Johannes Weiner Cc: Tejun Heo Cc: Chris Down Cc: Shakeel Butt Cc: Michal Hocko Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200527195846.102707-5-kuba@kernel.org Signed-off-by: Linus Torvalds commit d1663a907bd348f912b7f7088e83ca1b6fd3309f Author: Jakub Kicinski Date: Mon Jun 1 21:49:49 2020 -0700 mm/memcg: move cgroup high memory limit setting into struct page_counter High memory limit is currently recorded directly in struct mem_cgroup. We are about to add a high limit for swap, move the field to struct page_counter and add some helpers. Signed-off-by: Jakub Kicinski Signed-off-by: Andrew Morton Reviewed-by: Shakeel Butt Acked-by: Johannes Weiner Cc: Chris Down Cc: Hugh Dickins Cc: Michal Hocko Cc: Tejun Heo Link: http://lkml.kernel.org/r/20200527195846.102707-4-kuba@kernel.org Signed-off-by: Linus Torvalds commit ff144e69f7331eff070f31edf22bc9123d6d6d27 Author: Jakub Kicinski Date: Mon Jun 1 21:49:45 2020 -0700 mm/memcg: move penalty delay clamping out of calculate_high_delay() We will want to call calculate_high_delay() twice - once for memory and once for swap, and we should apply the clamp value to sum of the penalties. Clamping has to be applied outside of calculate_high_delay(). Signed-off-by: Jakub Kicinski Signed-off-by: Andrew Morton Reviewed-by: Shakeel Butt Acked-by: Johannes Weiner Cc: Chris Down Cc: Hugh Dickins Cc: Michal Hocko Cc: Tejun Heo Link: http://lkml.kernel.org/r/20200527195846.102707-3-kuba@kernel.org Signed-off-by: Linus Torvalds commit 8a5dbc657e1233c907f84f2c6192d3a3cf0026b3 Author: Jakub Kicinski Date: Mon Jun 1 21:49:42 2020 -0700 mm/memcg: prepare for swap over-high accounting and penalty calculation Patch series "memcg: Slow down swap allocation as the available space gets depleted", v6. Tejun describes the problem as follows: When swap runs out, there's an abrupt change in system behavior - the anonymous memory suddenly becomes unmanageable which readily breaks any sort of memory isolation and can bring down the whole system. To avoid that, oomd [1] monitors free swap space and triggers kills when it drops below the specific threshold (e.g. 15%). While this works, it's far from ideal: - Depending on IO performance and total swap size, a given headroom might not be enough or too much. - oomd has to monitor swap depletion in addition to the usual pressure metrics and it currently doesn't consider memory.swap.max. Solve this by adapting parts of the approach that memory.high uses - slow down allocation as the resource gets depleted turning the depletion behavior from abrupt cliff one to gradual degradation observable through memory pressure metric. [1] https://github.com/facebookincubator/oomd This patch (of 4): Slice the memory overage calculation logic a little bit so we can reuse it to apply a similar penalty to the swap. The logic which accesses the memory-specific fields (use and high values) has to be taken out of calculate_high_delay(). Signed-off-by: Jakub Kicinski Signed-off-by: Andrew Morton Reviewed-by: Shakeel Butt Acked-by: Johannes Weiner Cc: Hugh Dickins Cc: Chris Down Cc: Michal Hocko Cc: Tejun Heo Link: http://lkml.kernel.org/r/20200527195846.102707-1-kuba@kernel.org Link: http://lkml.kernel.org/r/20200527195846.102707-2-kuba@kernel.org Signed-off-by: Linus Torvalds commit 54b512e96d44664d0cdb75b4f6db6b821535dbf8 Author: Shakeel Butt Date: Mon Jun 1 21:49:39 2020 -0700 memcg: expose root cgroup's memory.stat One way to measure the efficiency of memory reclaim is to look at the ratio (pgscan+pfrefill)/pgsteal. However at the moment these stats are not updated consistently at the system level and the ratio of these are not very meaningful. The pgsteal and pgscan are updated for only global reclaim while pgrefill gets updated for global as well as cgroup reclaim. Please note that this difference is only for system level vmstats. The cgroup stats returned by memory.stat are actually consistent. The cgroup's pgsteal contains number of reclaimed pages for global as well as cgroup reclaim. So, one way to get the system level stats is to get these stats from root's memory.stat, so, expose memory.stat for the root cgroup. From Johannes Weiner: There are subtle differences between /proc/vmstat and memory.stat, and cgroup-aware code that wants to watch the full hierarchy currently has to know about these intricacies and translate semantics back and forth. Generally having the fully recursive memory.stat at the root level could help a broader range of usecases. Why not fix the stats by including both the global and cgroup reclaim activity instead of exposing root cgroup's memory.stat? The reason is the benefit of having metrics exposing the activity that happens purely due to machine capacity rather than localized activity that happens due to the limits throughout the cgroup tree. Additionally there are userspace tools like sysstat(sar) which reads these stats to inform about the system level reclaim activity. So, we should not break such use-cases. Suggested-by: Johannes Weiner Signed-off-by: Shakeel Butt Signed-off-by: Andrew Morton Acked-by: Johannes Weiner Acked-by: Yafang Shao Acked-by: Chris Down Cc: Mel Gorman Cc: Roman Gushchin Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200508170630.94406-1-shakeelb@google.com Signed-off-by: Linus Torvalds commit 1c4448edb71ab9da35a938244602cdd75809de2b Author: Kaixu Xia Date: Mon Jun 1 21:49:36 2020 -0700 mm: memcontrol: simplify value comparison between count and limit When the variables count and limit have the same value(count == limit), the result of min(margin, limit - count) statement should be 0 and the variable margin is set to 0. So in this case, the min() statement is not necessary and we can directly set the variable margin to 0. Signed-off-by: Kaixu Xia Signed-off-by: Andrew Morton Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Link: http://lkml.kernel.org/r/1587479661-27237-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Linus Torvalds commit a6f5576bb195c3b7508e3e1c98d2dcf6691f96e8 Author: Yafang Shao Date: Mon Jun 1 21:49:32 2020 -0700 mm, memcg: add workingset_restore in memory.stat There's a new workingset counter introduced in commit 1899ad18c607 ("mm: workingset: tell cache transitions from workingset thrashing"). With the help of this counter we can know the workingset is transitioning or thrashing. To leverage the benifit of this counter to memcg, we should introduce it into memory.stat. Then we could know the workingset of the workload inside a memcg better. Bellow is the verification of this new counter in memory.stat. Read a file into the memory and then read it again to make these pages be active. The size of this file is 1G. (memory.max is greater than file size) The counters in memory.stat will be inactive_file 0 active_file 1073639424 workingset_refault 0 workingset_activate 0 workingset_restore 0 workingset_nodereclaim 0 Trigger the memcg reclaim by setting a lower value to memory.high, and then some pages will be demoted into inactive list, and then some pages in the inactive list will be evicted into the storage. inactive_file 498094080 active_file 310063104 workingset_refault 0 workingset_activate 0 workingset_restore 0 workingset_nodereclaim 0 Then recover the memory.high and read the file into memory again. As a result of it, the transitioning will occur. Bellow is the result of this transitioning, inactive_file 498094080 active_file 575397888 workingset_refault 64746 workingset_activate 64746 workingset_restore 64746 workingset_nodereclaim 0 Signed-off-by: Yafang Shao Signed-off-by: Andrew Morton Acked-by: Johannes Weiner Acked-by: Michal Hocko Acked-by: Chris Down Cc: Peter Zijlstra (Intel) Cc: Suren Baghdasaryan Cc: Shakeel Butt Link: http://lkml.kernel.org/r/20200504153522.11553-1-laoar.shao@gmail.com Signed-off-by: Linus Torvalds commit 251af0cda614e5ad6bfda059bd120aed7432891d Author: Miaohe Lin Date: Mon Jun 1 21:49:29 2020 -0700 include/linux/swap.h: delete meaningless __add_to_swap_cache() declaration Since commit 8d93b41c09d1 ("mm: Convert add_to_swap_cache to XArray"), __add_to_swap_cache and add_to_swap_cache are combined into one function. There is no __add_to_swap_cache() anymore. Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: "Huang, Ying" Link: http://lkml.kernel.org/r/1590810326-2493-1-git-send-email-linmiaohe@huawei.com Signed-off-by: Linus Torvalds commit 6f7939405f61de7d0da7f6c90182e96c4f5ff6c1 Author: Randy Dunlap Date: Mon Jun 1 21:49:26 2020 -0700 mm: swapfile: fix /proc/swaps heading and Size/Used/Priority alignment Fix the heading and Size/Used/Priority field alignments in /proc/swaps. If the Size and/or Used value is >= 10000000 (8 bytes), then the alignment by using tab characters is broken. This patch maintains the use of tabs for alignment. If spaces are preferred, we can just use a Field Width specifier for the bytes and inuse fields. That way those fields don't have to be a multiple of 8 bytes in width. E.g., with a field width of 12, both Size and Used would always fit on the first line of an 80-column wide terminal (only Priority would be on the second line). There are actually 2 problems: heading alignment and field width. On an xterm, if Used is 7 bytes in length, the tab does nothing, and the display is like this, with no space/tab between the Used and Priority fields. (ugh) Filename Type Size Used Priority /dev/sda8 partition 16779260 2023012-1 To be clear, if one does 'cat /proc/swaps >/tmp/proc.swaps', it does look different, like so: Filename Type Size Used Priority /dev/sda8 partition 16779260 2086988 -1 Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Hugh Dickins Cc: Alexander Viro Link: http://lkml.kernel.org/r/c0ffb41a-81ac-ddfa-d452-a9229ecc0387@infradead.org Signed-off-by: Linus Torvalds commit 490705888107c3edf8c264ec930909107f76a984 Author: Huang Ying Date: Mon Jun 1 21:49:22 2020 -0700 swap: reduce lock contention on swap cache from swap slots allocation In some swap scalability test, it is found that there are heavy lock contention on swap cache even if we have split one swap cache radix tree per swap device to one swap cache radix tree every 64 MB trunk in commit 4b3ef9daa4fc ("mm/swap: split swap cache into 64MB trunks"). The reason is as follow. After the swap device becomes fragmented so that there's no free swap cluster, the swap device will be scanned linearly to find the free swap slots. swap_info_struct->cluster_next is the next scanning base that is shared by all CPUs. So nearby free swap slots will be allocated for different CPUs. The probability for multiple CPUs to operate on the same 64 MB trunk is high. This causes the lock contention on the swap cache. To solve the issue, in this patch, for SSD swap device, a percpu version next scanning base (cluster_next_cpu) is added. Every CPU will use its own per-cpu next scanning base. And after finishing scanning a 64MB trunk, the per-cpu scanning base will be changed to the beginning of another randomly selected 64MB trunk. In this way, the probability for multiple CPUs to operate on the same 64 MB trunk is reduced greatly. Thus the lock contention is reduced too. For HDD, because sequential access is more important for IO performance, the original shared next scanning base is used. To test the patch, we have run 16-process pmbench memory benchmark on a 2-socket server machine with 48 cores. One ram disk is configured as the swap device per socket. The pmbench working-set size is much larger than the available memory so that swapping is triggered. The memory read/write ratio is 80/20 and the accessing pattern is random. In the original implementation, the lock contention on the swap cache is heavy. The perf profiling data of the lock contention code path is as following, _raw_spin_lock_irq.add_to_swap_cache.add_to_swap.shrink_page_list: 7.91 _raw_spin_lock_irqsave.__remove_mapping.shrink_page_list: 7.11 _raw_spin_lock.swapcache_free_entries.free_swap_slot.__swap_entry_free: 2.51 _raw_spin_lock_irqsave.swap_cgroup_record.mem_cgroup_uncharge_swap: 1.66 _raw_spin_lock_irq.shrink_inactive_list.shrink_lruvec.shrink_node: 1.29 _raw_spin_lock.free_pcppages_bulk.drain_pages_zone.drain_pages: 1.03 _raw_spin_lock_irq.shrink_active_list.shrink_lruvec.shrink_node: 0.93 After applying this patch, it becomes, _raw_spin_lock.swapcache_free_entries.free_swap_slot.__swap_entry_free: 3.58 _raw_spin_lock_irq.shrink_inactive_list.shrink_lruvec.shrink_node: 2.3 _raw_spin_lock_irqsave.swap_cgroup_record.mem_cgroup_uncharge_swap: 2.26 _raw_spin_lock_irq.shrink_active_list.shrink_lruvec.shrink_node: 1.8 _raw_spin_lock.free_pcppages_bulk.drain_pages_zone.drain_pages: 1.19 The lock contention on the swap cache is almost eliminated. And the pmbench score increases 18.5%. The swapin throughput increases 18.7% from 2.96 GB/s to 3.51 GB/s. While the swapout throughput increases 18.5% from 2.99 GB/s to 3.54 GB/s. We need really fast disk to show the benefit. I have tried this on 2 Intel P3600 NVMe disks. The performance improvement is only about 1%. The improvement should be better on the faster disks, such as Intel Optane disk. [ying.huang@intel.com: fix cluster_next_cpu allocation and freeing, per Daniel] Link: http://lkml.kernel.org/r/20200525002648.336325-1-ying.huang@intel.com [ying.huang@intel.com: v4] Link: http://lkml.kernel.org/r/20200529010840.928819-1-ying.huang@intel.com Signed-off-by: "Huang, Ying" Signed-off-by: Andrew Morton Reviewed-by: Daniel Jordan Cc: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200520031502.175659-1-ying.huang@intel.com Signed-off-by: Linus Torvalds commit 09fe06ce0bf5abe53b77a9515d7fb7579edec9c0 Author: Huang Ying Date: Mon Jun 1 21:49:19 2020 -0700 mm/swapfile.c: use prandom_u32_max() To improve the code readability and take advantage of the common implementation. Signed-off-by: "Huang, Ying" Signed-off-by: Andrew Morton Acked-by: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200512081013.520201-1-ying.huang@intel.com Signed-off-by: Linus Torvalds commit 33e16272fe982084e986d4eb6d5b5ca51c0d214e Author: Wei Yang Date: Mon Jun 1 21:49:16 2020 -0700 mm/swapfile.c: __swap_entry_free() always free 1 entry __swap_entry_free() always frees 1 entry. Let's remove the usage. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200501015259.32237-2-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 4b4bb6bb451c8b0c1cbc38fa20a89a3988aa4e0b Author: Wei Yang Date: Mon Jun 1 21:49:13 2020 -0700 mm/swapfile.c: classify SWAP_MAP_XXX to make it more readable swap_info_struct->swap_map[] encodes some flag and count. And to do some condition check, it also introduces some special values. Currently those macros are defined with some magic order, which makes audience hard to understand the exact meaning. This patch split those macros into three categories: flag special value for first swap_map special value for continued swap_map May this help audiences a little. [akpm@linux-foundation.org: tweak capitalization in comments] Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200501015259.32237-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit ed43af10975eef7e21abbb81297d9735448ba4fa Author: Huang Ying Date: Mon Jun 1 21:49:10 2020 -0700 swap: try to scan more free slots even when fragmented Now, the scalability of swap code will drop much when the swap device becomes fragmented, because the swap slots allocation batching stops working. To solve the problem, in this patch, we will try to scan a little more swap slots with restricted effort to batch the swap slots allocation even if the swap device is fragmented. Test shows that the benchmark score can increase up to 37.1% with the patch. Details are as follows. The swap code has a per-cpu cache of swap slots. These batch swap space allocations to improve swap subsystem scaling. In the following code path, add_to_swap() get_swap_page() refill_swap_slots_cache() get_swap_pages() scan_swap_map_slots() scan_swap_map_slots() and get_swap_pages() can return multiple swap slots for each call. These slots will be cached in the per-CPU swap slots cache, so that several following swap slot requests will be fulfilled there to avoid the lock contention in the lower level swap space allocation/freeing code path. But this only works when there are free swap clusters. If a swap device becomes so fragmented that there's no free swap clusters, scan_swap_map_slots() and get_swap_pages() will return only one swap slot for each call in the above code path. Effectively, this falls back to the situation before the swap slots cache was introduced, the heavy lock contention on the swap related locks kills the scalability. Why does it work in this way? Because the swap device could be large, and the free swap slot scanning could be quite time consuming, to avoid taking too much time to scanning free swap slots, the conservative method was used. In fact, this can be improved via scanning a little more free slots with strictly restricted effort. Which is implemented in this patch. In scan_swap_map_slots(), after the first free swap slot is gotten, we will try to scan a little more, but only if we haven't scanned too many slots (< LATENCY_LIMIT). That is, the added scanning latency is strictly restricted. To test the patch, we have run 16-process pmbench memory benchmark on a 2-socket server machine with 48 cores. Multiple ram disks are configured as the swap devices. The pmbench working-set size is much larger than the available memory so that swapping is triggered. The memory read/write ratio is 80/20 and the accessing pattern is random, so the swap space becomes highly fragmented during the test. In the original implementation, the lock contention on swap related locks is very heavy. The perf profiling data of the lock contention code path is as following, _raw_spin_lock.get_swap_pages.get_swap_page.add_to_swap: 21.03 _raw_spin_lock_irq.shrink_inactive_list.shrink_lruvec.shrink_node: 1.92 _raw_spin_lock_irq.shrink_active_list.shrink_lruvec.shrink_node: 1.72 _raw_spin_lock.free_pcppages_bulk.drain_pages_zone.drain_pages: 0.69 While after applying this patch, it becomes, _raw_spin_lock_irq.shrink_inactive_list.shrink_lruvec.shrink_node: 4.89 _raw_spin_lock_irq.shrink_active_list.shrink_lruvec.shrink_node: 3.85 _raw_spin_lock.free_pcppages_bulk.drain_pages_zone.drain_pages: 1.1 _raw_spin_lock_irqsave.pagevec_lru_move_fn.__lru_cache_add.do_swap_page: 0.88 That is, the lock contention on the swap locks is eliminated. And the pmbench score increases 37.1%. The swapin throughput increases 45.7% from 2.02 GB/s to 2.94 GB/s. While the swapout throughput increases 45.3% from 2.04 GB/s to 2.97 GB/s. Signed-off-by: "Huang, Ying" Signed-off-by: Andrew Morton Acked-by: Tim Chen Cc: Dave Hansen Cc: Michal Hocko Cc: Minchan Kim Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200427030023.264780-1-ying.huang@intel.com Signed-off-by: Linus Torvalds commit 7b9e2de130954af174e6f7aff278cf1ec5f39675 Author: Wei Yang Date: Mon Jun 1 21:49:07 2020 -0700 mm/swapfile.c: omit a duplicate code by compare tmp and max first There are two duplicate code to handle the case when there is no available swap entry. To avoid this, we can compare tmp and max first and let the second guard do its job. No functional change is expected. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: "Huang, Ying" Cc: Tim Chen Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200421213824.8099-3-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit fdff1debb9650ea43617487500f48168ce432cb7 Author: Wei Yang Date: Mon Jun 1 21:49:04 2020 -0700 mm/swapfile.c: tmp is always smaller than max If tmp is bigger or equal to max, we would jump to new_cluster. Return true directly. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: "Huang, Ying" Cc: Tim Chen Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200421213824.8099-2-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 0fd0e19e4d0e9c84117584783535a57ec3ae98c6 Author: Wei Yang Date: Mon Jun 1 21:49:01 2020 -0700 mm/swapfile.c: found_free could be represented by (tmp < max) This is not necessary to use the variable found_free to record the status. Just check tmp and max is enough. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: "Huang, Ying" Cc: Tim Chen Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200421213824.8099-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit abca1c84b7575b470789c8686688b11ba3bf138d Author: Wei Yang Date: Mon Jun 1 21:48:58 2020 -0700 mm/swapfile.c: remove the extra check in scan_swap_map_slots() scan_swap_map_slots() is only called by scan_swap_map() and get_swap_pages(). Both ensure nr would not exceed SWAP_BATCH. Just remove it. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200325220309.9803-2-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit 08d3090fc8dadd7b726dbda99d1baa39382c3f2c Author: Wei Yang Date: Mon Jun 1 21:48:55 2020 -0700 mm/swapfile.c: simplify the calculation of n_goal Use min3() to simplify the comparison and make it more self-explaining. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200325220309.9803-1-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit bd2d18da4a4f182c3627a74dc768bd437e64c582 Author: Wei Yang Date: Mon Jun 1 21:48:52 2020 -0700 mm/swapfile.c: remove the unnecessary goto for SSD case Now we can see there is redundant goto for SSD case. In these two places, we can just let the code walk through to the correct tag instead of explicitly jump to it. Let's remove them for better readability. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Tim Chen Link: http://lkml.kernel.org/r/20200328060520.31449-4-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit f4eaf51a72e5c6d9dc895abdd02676a2ef4c3ae7 Author: Wei Yang Date: Mon Jun 1 21:48:49 2020 -0700 mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually exclusive The code shows if this is ssd, it will jump to specific tag and skip the following code for non-ssd. Let's use "else if" to explicitly show the mutually exclusion for ssd/non-ssd to reduce ambiguity. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Tim Chen Link: http://lkml.kernel.org/r/20200328060520.31449-3-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit ca2c55a7371ca3db64f5ac9ed2cb998682bf6fae Author: Wei Yang Date: Mon Jun 1 21:48:46 2020 -0700 mm/swapfile.c: offset is only used when there is more slots scan_swap_map_slots() is used to iterate swap_map[] array for an available swap entry. While after several optimizations, e.g. for ssd case, the logic of this function is a little not easy to catch. This patchset tries to clean up the logic a little: * shows the ssd/non-ssd case is handled mutually exclusively * remove some unnecessary goto for ssd case This patch (of 3): When si->cluster_nr is zero, function would reach done and return. The increased offset would not be used any more. This means we can move the offset increment into the if clause. This brings a further code cleanup possibility. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Tim Chen Link: http://lkml.kernel.org/r/20200328060520.31449-1-richard.weiyang@gmail.com Link: http://lkml.kernel.org/r/20200328060520.31449-2-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds commit ebc5951eea499314f6fbbde20e295f1345c67330 Author: Andrea Righi Date: Mon Jun 1 21:48:43 2020 -0700 mm: swap: properly update readahead statistics in unuse_pte_range() In unuse_pte_range() we blindly swap-in pages without checking if the swap entry is already present in the swap cache. By doing this, the hit/miss ratio used by the swap readahead heuristic is not properly updated and this leads to non-optimal performance during swapoff. Tracing the distribution of the readahead size returned by the swap readahead heuristic during swapoff shows that a small readahead size is used most of the time as if we had only misses (this happens both with cluster and vma readahead), for example: r::swapin_nr_pages(unsigned long offset):unsigned long:$retval COUNT EVENT 36948 $retval = 8 44151 $retval = 4 49290 $retval = 1 527771 $retval = 2 Checking if the swap entry is present in the swap cache, instead, allows to properly update the readahead statistics and the heuristic behaves in a better way during swapoff, selecting a bigger readahead size: r::swapin_nr_pages(unsigned long offset):unsigned long:$retval COUNT EVENT 1618 $retval = 1 4960 $retval = 2 41315 $retval = 4 103521 $retval = 8 In terms of swapoff performance the result is the following: Testing environment =================== - Host: CPU: 1.8GHz Intel Core i7-8565U (quad-core, 8MB cache) HDD: PC401 NVMe SK hynix 512GB MEM: 16GB - Guest (kvm): 8GB of RAM virtio block driver 16GB swap file on ext4 (/swapfile) Test case ========= - allocate 85% of memory - `systemctl hibernate` to force all the pages to be swapped-out to the swap file - resume the system - measure the time that swapoff takes to complete: # /usr/bin/time swapoff /swapfile Result (swapoff time) ====== 5.6 vanilla 5.6 w/ this patch ----------- ----------------- cluster-readahead 22.09s 12.19s vma-readahead 18.20s 15.33s Conclusion ========== The specific use case this patch is addressing is to improve swapoff performance in cloud environments when a VM has been hibernated, resumed and all the memory needs to be forced back to RAM by disabling swap. This change allows to better exploits the advantages of the readahead heuristic during swapoff and this improvement allows to to speed up the resume process of such VMs. [andrea.righi@canonical.com: update changelog] Link: http://lkml.kernel.org/r/20200418084705.GA147642@xps-13 Signed-off-by: Andrea Righi Signed-off-by: Andrew Morton Reviewed-by: "Huang, Ying" Cc: Minchan Kim Cc: Anchal Agarwal Cc: Hugh Dickins Cc: Vineeth Remanan Pillai Cc: Kelley Nielsen Link: http://lkml.kernel.org/r/20200416180132.GB3352@xps-13 Signed-off-by: Linus Torvalds commit d6c1f098f2a7ba62627c9bc17cda28f534ef9e4a Author: Qian Cai Date: Mon Jun 1 21:48:40 2020 -0700 mm/swap_state: fix a data race in swapin_nr_pages "prev_offset" is a static variable in swapin_nr_pages() that can be accessed concurrently with only mmap_sem held in read mode as noticed by KCSAN, BUG: KCSAN: data-race in swap_cluster_readahead / swap_cluster_readahead write to 0xffffffff92763830 of 8 bytes by task 14795 on cpu 17: swap_cluster_readahead+0x2a6/0x5e0 swapin_readahead+0x92/0x8dc do_swap_page+0x49b/0xf20 __handle_mm_fault+0xcfb/0xd70 handle_mm_fault+0xfc/0x2f0 do_page_fault+0x263/0x715 page_fault+0x34/0x40 1 lock held by (dnf)/14795: #0: ffff897bd2e98858 (&mm->mmap_sem#2){++++}-{3:3}, at: do_page_fault+0x143/0x715 do_user_addr_fault at arch/x86/mm/fault.c:1405 (inlined by) do_page_fault at arch/x86/mm/fault.c:1535 irq event stamp: 83493 count_memcg_event_mm+0x1a6/0x270 count_memcg_event_mm+0x119/0x270 __do_softirq+0x365/0x589 irq_exit+0xa2/0xc0 read to 0xffffffff92763830 of 8 bytes by task 1 on cpu 22: swap_cluster_readahead+0xfd/0x5e0 swapin_readahead+0x92/0x8dc do_swap_page+0x49b/0xf20 __handle_mm_fault+0xcfb/0xd70 handle_mm_fault+0xfc/0x2f0 do_page_fault+0x263/0x715 page_fault+0x34/0x40 1 lock held by systemd/1: #0: ffff897c38f14858 (&mm->mmap_sem#2){++++}-{3:3}, at: do_page_fault+0x143/0x715 irq event stamp: 43530289 count_memcg_event_mm+0x1a6/0x270 count_memcg_event_mm+0x119/0x270 __do_softirq+0x365/0x589 irq_exit+0xa2/0xc0 Signed-off-by: Qian Cai Signed-off-by: Andrew Morton Cc: Marco Elver Cc: Hugh Dickins Link: http://lkml.kernel.org/r/20200402213748.2237-1-cai@lca.pw Signed-off-by: Linus Torvalds commit 213516ac0752144ad1c82a0f8393f805c8abbc76 Author: chenqiwu Date: Mon Jun 1 21:48:36 2020 -0700 mm/swapfile: use list_{prev,next}_entry() instead of open-coding Use list_{prev,next}_entry() instead of list_entry() for better code readability. Signed-off-by: chenqiwu Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Wei Yang Cc: Michal Hocko Cc: Pankaj Gupta Cc: Yang Shi Cc: Qian Cai Cc: Baoquan He Link: http://lkml.kernel.org/r/1586599916-15456-2-git-send-email-qiwuchen55@gmail.com Signed-off-by: Linus Torvalds commit 548b6a1e5520d5647e3d39c0aaf1f83ab27e250f Author: Miles Chen Date: Mon Jun 1 21:48:33 2020 -0700 mm/gup.c: further document vma_permits_fault() Describe the caller's responsibilities when passing FAULT_FLAG_ALLOW_RETRY. Link: http://lkml.kernel.org/r/1586915606.5647.5.camel@mtkswgap22 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e792031019bdc3f1eb5cac5a4171f7ffb8586c1b Author: John Hubbard Date: Mon Jun 1 21:48:30 2020 -0700 ivtv: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Cc: Andy Walls Cc: Mauro Carvalho Chehab Link: http://lkml.kernel.org/r/20200518012157.1178336-3-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit 91429023342789a89f4b6ae95b47a7df71ab6d95 Author: John Hubbard Date: Mon Jun 1 21:48:27 2020 -0700 mm/gup: introduce pin_user_pages_unlocked Introduce pin_user_pages_unlocked(), which is nearly identical to the get_user_pages_unlocked() that it wraps, except that it sets FOLL_PIN and rejects FOLL_GET. Signed-off-by: John Hubbard Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Andy Walls Cc: Mauro Carvalho Chehab Link: http://lkml.kernel.org/r/20200518012157.1178336-2-jhubbard@nvidia.com Signed-off-by: Linus Torvalds commit adc8cb406e52f89071f488848b0fb3e7907ae332 Author: Souptick Joarder Date: Mon Jun 1 21:48:24 2020 -0700 mm/gup.c: update the documentation This patch is an attempt to update the documentation. - Add/ remove extra * based on type of function static/global. - Add description for functions and their input arguments. [akpm@linux-foundation.org: s@/*@/**@] Signed-off-by: Souptick Joarder Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/1588013630-4497-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Linus Torvalds commit 8d92890bd6b8502d6aee4b37430ae6444ade7a8c Author: NeilBrown Date: Mon Jun 1 21:48:21 2020 -0700 mm/writeback: discard NR_UNSTABLE_NFS, use NR_WRITEBACK instead After an NFS page has been written it is considered "unstable" until a COMMIT request succeeds. If the COMMIT fails, the page will be re-written. These "unstable" pages are currently accounted as "reclaimable", either in WB_RECLAIMABLE, or in NR_UNSTABLE_NFS which is included in a 'reclaimable' count. This might have made sense when sending the COMMIT required a separate action by the VFS/MM (e.g. releasepage() used to send a COMMIT). However now that all writes generated by ->writepages() will automatically be followed by a COMMIT (since commit 919e3bd9a875 ("NFS: Ensure we commit after writeback is complete")) it makes more sense to treat them as writeback pages. So this patch removes NR_UNSTABLE_NFS and accounts unstable pages in NR_WRITEBACK and WB_WRITEBACK. A particular effect of this change is that when wb_check_background_flush() calls wb_over_bg_threshold(), the latter will report 'true' a lot less often as the 'unstable' pages are no longer considered 'dirty' (as there is nothing that writeback can do about them anyway). Currently wb_check_background_flush() will trigger writeback to NFS even when there are relatively few dirty pages (if there are lots of unstable pages), this can result in small writes going to the server (10s of Kilobytes rather than a Megabyte) which hurts throughput. With this patch, there are fewer writes which are each larger on average. Where the NR_UNSTABLE_NFS count was included in statistics virtual-files, the entry is retained, but the value is hard-coded as zero. static trace points and warning printks which mentioned this counter no longer report it. [akpm@linux-foundation.org: re-layout comment] [akpm@linux-foundation.org: fix printk warning] Signed-off-by: NeilBrown Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Acked-by: Trond Myklebust Acked-by: Michal Hocko [mm] Cc: Christoph Hellwig Cc: Chuck Lever Link: http://lkml.kernel.org/r/87d06j7gqa.fsf@notabene.neil.brown.name Signed-off-by: Linus Torvalds commit a37b0715ddf3007734c4e2424c14bc7efcdd1190 Author: NeilBrown Date: Mon Jun 1 21:48:18 2020 -0700 mm/writeback: replace PF_LESS_THROTTLE with PF_LOCAL_THROTTLE PF_LESS_THROTTLE exists for loop-back nfsd (and a similar need in the loop block driver and callers of prctl(PR_SET_IO_FLUSHER)), where a daemon needs to write to one bdi (the final bdi) in order to free up writes queued to another bdi (the client bdi). The daemon sets PF_LESS_THROTTLE and gets a larger allowance of dirty pages, so that it can still dirty pages after other processses have been throttled. The purpose of this is to avoid deadlock that happen when the PF_LESS_THROTTLE process must write for any dirty pages to be freed, but it is being thottled and cannot write. This approach was designed when all threads were blocked equally, independently on which device they were writing to, or how fast it was. Since that time the writeback algorithm has changed substantially with different threads getting different allowances based on non-trivial heuristics. This means the simple "add 25%" heuristic is no longer reliable. The important issue is not that the daemon needs a *larger* dirty page allowance, but that it needs a *private* dirty page allowance, so that dirty pages for the "client" bdi that it is helping to clear (the bdi for an NFS filesystem or loop block device etc) do not affect the throttling of the daemon writing to the "final" bdi. This patch changes the heuristic so that the task is not throttled when the bdi it is writing to has a dirty page count below below (or equal to) the free-run threshold for that bdi. This ensures it will always be able to have some pages in flight, and so will not deadlock. In a steady-state, it is expected that PF_LOCAL_THROTTLE tasks might still be throttled by global threshold, but that is acceptable as it is only the deadlock state that is interesting for this flag. This approach of "only throttle when target bdi is busy" is consistent with the other use of PF_LESS_THROTTLE in current_may_throttle(), were it causes attention to be focussed only on the target bdi. So this patch - renames PF_LESS_THROTTLE to PF_LOCAL_THROTTLE, - removes the 25% bonus that that flag gives, and - If PF_LOCAL_THROTTLE is set, don't delay at all unless the global and the local free-run thresholds are exceeded. Note that previously realtime threads were treated the same as PF_LESS_THROTTLE threads. This patch does *not* change the behvaiour for real-time threads, so it is now different from the behaviour of nfsd and loop tasks. I don't know what is wanted for realtime. [akpm@linux-foundation.org: coding style fixes] Signed-off-by: NeilBrown Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Acked-by: Chuck Lever [nfsd] Cc: Christoph Hellwig Cc: Michal Hocko Cc: Trond Myklebust Link: http://lkml.kernel.org/r/87ftbf7gs3.fsf@notabene.neil.brown.name Signed-off-by: Linus Torvalds commit 28659cc8cc8766707b1b50906df38bd94dcf349b Author: Chao Yu Date: Mon Jun 1 21:48:15 2020 -0700 mm/page-writeback.c: remove unused variable Commit 64081362e8ff ("mm/page-writeback.c: fix range_cyclic writeback vs writepages deadlock") left unused variable, remove it. Signed-off-by: Chao Yu Signed-off-by: Andrew Morton Reviewed-by: David Hildenbrand Link: http://lkml.kernel.org/r/20200528033740.17269-1-yuchao0@huawei.com Signed-off-by: Linus Torvalds commit 74f4c89d81e57613848043fe0d38caf9547b0324 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:48:12 2020 -0700 mm/filemap.c: remove misleading comment We no longer return 0 here and the comment doesn't tell us anything that we don't already know (SIGBUS is a pretty good indicator that things didn't work out). Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: William Kucharski Link: http://lkml.kernel.org/r/20200529123243.20640-1-willy@infradead.org Signed-off-by: Linus Torvalds commit 60e65a6f42d0af33fa7361bd8723adc70539121b Author: Guoqing Jiang Date: Mon Jun 1 21:48:09 2020 -0700 mm_types.h: change set_page_private to inline function Change it to inline function to make callers use the proper argument. And no need for it to be macro per Andrew's comment [1]. [1] https://lore.kernel.org/lkml/20200518221235.1fa32c38e5766113f78e3f0d@linux-foundation.org/ Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Link: http://lkml.kernel.org/r/20200525203149.18802-1-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit cd0f37154443844256709f736754b1bace5b24d8 Author: Guoqing Jiang Date: Mon Jun 1 21:48:06 2020 -0700 mm/migrate.c: call detach_page_private to cleanup code We can cleanup code a little by call detach_page_private here. [akpm@linux-foundation.org: use attach_page_private(), per Dave] http://lkml.kernel.org/r/20200521225220.GV2005@dread.disaster.area [akpm@linux-foundation.org: clear PagePrivate] Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Chao Yu Cc: Cong Wang Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200519214049.15179-1-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 7b59435a2afed12dc9b2ec1b930efa2e94f1c397 Author: Guoqing Jiang Date: Mon Jun 1 21:48:03 2020 -0700 buffer_head.h: remove attach_page_buffers All the callers have replaced attach_page_buffers with the new function attach_page_private, so remove it. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Roman Gushchin Cc: Andreas Dilger Link: http://lkml.kernel.org/r/20200517214718.468-10-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 4c42be38c28837017248beb46012b6081f45cb38 Author: Guoqing Jiang Date: Mon Jun 1 21:48:00 2020 -0700 orangefs: use attach/detach_page_private Since the new pair function is introduced, we can call them to clean the code in orangefs. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Tested-by: Mike Marshall Reviewed-by: Andrew Morton Cc: Martin Brandenburg Link: http://lkml.kernel.org/r/20200517214718.468-9-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 14ed109e3f3daabb5689b32176a3b2194ae1b609 Author: Guoqing Jiang Date: Mon Jun 1 21:47:57 2020 -0700 ntfs: replace attach_page_buffers with attach_page_private Call the new function since attach_page_buffers will be removed. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Anton Altaparmakov Link: http://lkml.kernel.org/r/20200517214718.468-8-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 58aeb731963cb4cf4db35412723b5084799dbe06 Author: Guoqing Jiang Date: Mon Jun 1 21:47:54 2020 -0700 iomap: use attach/detach_page_private Since the new pair function is introduced, we can call them to clean the code in iomap. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Reviewed-by: Darrick J. Wong Cc: Christoph Hellwig Cc: Dave Chinner Link: http://lkml.kernel.org/r/20200517214718.468-7-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 7128cf9a25096a75139ec5dcd710ede182657210 Author: Guoqing Jiang Date: Mon Jun 1 21:47:51 2020 -0700 f2fs: use attach/detach_page_private Since the new pair function is introduced, we can call them to clean the code in f2fs.h. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Acked-by: Chao Yu Cc: Jaegeuk Kim Link: http://lkml.kernel.org/r/20200517214718.468-6-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 45dcfc27329f6b0e78ea7023ea7fb8c856d70129 Author: Guoqing Jiang Date: Mon Jun 1 21:47:48 2020 -0700 fs/buffer.c: use attach/detach_page_private Since the new pair function is introduced, we can call them to clean the code in buffer.c. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Alexander Viro Link: http://lkml.kernel.org/r/20200517214718.468-5-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit d1b89bc0426110138ddc80a6916f359d0174571d Author: Guoqing Jiang Date: Mon Jun 1 21:47:45 2020 -0700 btrfs: use attach/detach_page_private Since the new pair function is introduced, we can call them to clean the code in btrfs. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Acked-by: David Sterba Cc: Chris Mason Cc: Josef Bacik Link: http://lkml.kernel.org/r/20200517214718.468-4-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit db2c1d86cc93b8f2674c1e032bbf8ff0cbafe122 Author: Guoqing Jiang Date: Mon Jun 1 21:47:42 2020 -0700 md: remove __clear_page_buffers and use attach/detach_page_private After introduction attach/detach_page_private in pagemap.h, we can remove the duplicated code and call the new functions. Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Acked-by: Song Liu Link: http://lkml.kernel.org/r/20200517214718.468-3-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit b03143accd9274d9e024da42ed5857a71a6b6a27 Author: Guoqing Jiang Date: Mon Jun 1 21:47:38 2020 -0700 include/linux/pagemap.h: introduce attach/detach_page_private Patch series "Introduce attach/detach_page_private to cleanup code". This patch (of 10): The logic in attach_page_buffers and __clear_page_buffers are quite paired, but 1. they are located in different files. 2. attach_page_buffers is implemented in buffer_head.h, so it could be used by other files. But __clear_page_buffers is static function in buffer.c and other potential users can't call the function, md-bitmap even copied the function. So, introduce the new attach/detach_page_private to replace them. With the new pair of function, we will remove the usage of attach_page_buffers and __clear_page_buffers in next patches. Thanks for suggestions about the function name from Alexander Viro, Andreas Grünbacher, Christoph Hellwig and Matthew Wilcox. Suggested-by: Matthew Wilcox Signed-off-by: Guoqing Jiang Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: "Darrick J. Wong" Cc: William Kucharski Cc: "Kirill A. Shutemov" Cc: Andreas Gruenbacher Cc: Yang Shi Cc: Yafang Shao Cc: Song Liu Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: Alexander Viro Cc: Jaegeuk Kim Cc: Chao Yu Cc: Christoph Hellwig Cc: Anton Altaparmakov Cc: Mike Marshall Cc: Martin Brandenburg Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Roman Gushchin Cc: Andreas Dilger Cc: Chao Yu Cc: Dave Chinner Link: http://lkml.kernel.org/r/20200517214718.468-1-guoqing.jiang@cloud.ionos.com Link: http://lkml.kernel.org/r/20200517214718.468-2-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds commit 9d24a13a93d995e4c980fdaa389aa3e2f1ea0b12 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:34 2020 -0700 iomap: convert from readpages to readahead Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-26-willy@infradead.org Signed-off-by: Linus Torvalds commit 76a0294eb19b5f909b119500e60d72ef41cc4d8e Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:31 2020 -0700 fuse: convert from readpages to readahead Implement the new readahead operation in fuse by using __readahead_batch() to fill the array of pages in fuse_args_pages directly. This lets us inline fuse_readpages_fill() into fuse_readahead(). [willy@infradead.org: build fix] Link: http://lkml.kernel.org/r/20200415025938.GB5820@bombadil.infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Acked-by: Miklos Szeredi Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Link: http://lkml.kernel.org/r/20200414150233.24495-25-willy@infradead.org Signed-off-by: Linus Torvalds commit e20a7693644ebf6f8005d8cdc8c8ece49bb70253 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:27 2020 -0700 f2fs: pass the inode to f2fs_mpage_readpages This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Reviewed-by: Chao Yu Acked-by: Jaegeuk Kim Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Gao Xiang Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-24-willy@infradead.org Signed-off-by: Linus Torvalds commit 2332319625cc5c703f79d185ac9a53db20913748 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:23 2020 -0700 f2fs: convert from readpages to readahead Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Reviewed-by: Chao Yu Acked-by: Jaegeuk Kim Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Gao Xiang Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-23-willy@infradead.org Signed-off-by: Linus Torvalds commit a07f624bd69a2c1c455364ffdc751a534554b241 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:20 2020 -0700 ext4: pass the inode to ext4_mpage_readpages This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-22-willy@infradead.org Signed-off-by: Linus Torvalds commit 6311f91f76470b50c3f651475c344181adbeb869 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:16 2020 -0700 ext4: convert from readpages to readahead Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-21-willy@infradead.org Signed-off-by: Linus Torvalds commit 0615090c5044cbf3bd64bfc2c3c968eaf61ab2fd Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:13 2020 -0700 erofs: convert compressed files from readpages to readahead Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Reviewed-by: Chao Yu Acked-by: Gao Xiang Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-20-willy@infradead.org Signed-off-by: Linus Torvalds commit 0c07a9f91ec0367925985944e288993759fb1b07 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:09 2020 -0700 erofs: convert uncompressed files from readpages to readahead Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Reviewed-by: Chao Yu Acked-by: Gao Xiang Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-19-willy@infradead.org Signed-off-by: Linus Torvalds commit ba206a026ff4cd0f11033ccaa4bf99c30567ded4 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:05 2020 -0700 btrfs: convert from readpages to readahead Implement the new readahead method in btrfs using the new readahead_page_batch() function. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-18-willy@infradead.org Signed-off-by: Linus Torvalds commit d4388340ae0bc8397ef5b24342279f7739982918 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:47:02 2020 -0700 fs: convert mpage_readpages to mpage_readahead Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Junxiao Bi # ocfs2 Reviewed-by: Joseph Qi # ocfs2 Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-17-willy@infradead.org Signed-off-by: Linus Torvalds commit f2c817bed58d9be2051fad1d18e167e173c0c227 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:58 2020 -0700 mm: use memalloc_nofs_save in readahead path Ensure that memory allocations in the readahead path do not attempt to reclaim file-backed pages, which could lead to a deadlock. It is possible, though unlikely this is the root cause of a problem observed by Cong Wang. Reported-by: Cong Wang Suggested-by: Michal Hocko Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: William Kucharski Cc: Chao Yu Cc: Christoph Hellwig Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-16-willy@infradead.org Signed-off-by: Linus Torvalds commit 2d8163e4899dad92175eedd1c2326c875eaa74fa Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:54 2020 -0700 mm: document why we don't set PageReadahead If the page is already in cache, we don't set PageReadahead on it. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-15-willy@infradead.org Signed-off-by: Linus Torvalds commit 2c684234d36f7e8c80414e4a772911d407e821fa Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:51 2020 -0700 mm: add page_cache_readahead_unbounded ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Tested-by: Eric Biggers Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-14-willy@infradead.org Signed-off-by: Linus Torvalds commit b0f31d78cbc191058e654c8eb062a864b6c9a7eb Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:47 2020 -0700 mm: move end_index check out of readahead loop By reducing nr_to_read, we can eliminate this check from inside the loop. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: William Kucharski Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-13-willy@infradead.org Signed-off-by: Linus Torvalds commit 8151b4c8bee43cea7a28cb0300123df90880e60c Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:44 2020 -0700 mm: add readahead address space operation This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without changing all the filesystems that use a common helper function like mpage_readahead(). Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-12-willy@infradead.org Signed-off-by: Linus Torvalds commit c1f6925e10912c7e329840387730049e5e1848c8 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:40 2020 -0700 mm: put readahead pages in cache earlier When populating the page cache for readahead, mappings that use ->readpages must populate the page cache themselves as the pages are passed on a linked list which would normally be used for the page cache's LRU. For mappings that use ->readpage or the upcoming ->readahead method, we can put the pages into the page cache as soon as they're allocated, which solves a race between readahead and direct IO. It also lets us remove the gfp argument from read_pages(). Use the new readahead_page() API to implement the repeated calls to ->readpage(), just like most filesystems will. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-11-willy@infradead.org Signed-off-by: Linus Torvalds commit ef8153b609aa9302f1e727218068b84ac8b060e4 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:36 2020 -0700 mm: remove 'page_offset' from readahead loop Replace the page_offset variable with 'index + i'. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-10-willy@infradead.org Signed-off-by: Linus Torvalds commit c2c7ad74b16206e0e6e9e80af962e63da778acf9 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:32 2020 -0700 mm: rename readahead loop variable to 'i' Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Reviewed-by: Johannes Thumshirn Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-9-willy@infradead.org Signed-off-by: Linus Torvalds commit 08eb9658ae128df77c4cd4ca5323d84b6b6e3824 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:29 2020 -0700 mm: rename various 'offset' parameters to 'index' The word 'offset' is used ambiguously to mean 'byte offset within a page', 'byte offset from the start of the file' and 'page offset from the start of the file'. Use 'index' to mean 'page offset from the start of the file' throughout the readahead code. [ We should probably rename the 'pgoff_t' type to 'pgidx_t' too - Linus ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Zi Yan Reviewed-by: William Kucharski Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-8-willy@infradead.org Signed-off-by: Linus Torvalds commit a4d9653666b3212032e2794dd506b34f94a60d40 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:25 2020 -0700 mm: use readahead_control to pass arguments In this patch, only between __do_page_cache_readahead() and read_pages(), but it will be extended in upcoming patches. The read_pages() function becomes aops centric, as this makes the most sense by the end of the patchset. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Reviewed-by: Johannes Thumshirn Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-7-willy@infradead.org Signed-off-by: Linus Torvalds commit 042124cc64c33555deba0b11c6e0c612ae7a8653 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:21 2020 -0700 mm: add new readahead_control API Filesystems which implement the upcoming ->readahead method will get their pages by calling readahead_page() or readahead_page_batch(). These functions support large pages, even though none of the filesystems to be converted do yet. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-6-willy@infradead.org Signed-off-by: Linus Torvalds commit ad4ae1c732bc9159ffdeb225036c601dddbbbe75 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:18 2020 -0700 mm: move readahead nr_pages check into read_pages Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Reviewed-by: Johannes Thumshirn Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-5-willy@infradead.org Signed-off-by: Linus Torvalds commit a1ef8566525c78a9eca52e1ff91404f4595b85eb Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:14 2020 -0700 mm: ignore return value of ->readpages We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: William Kucharski Reviewed-by: Johannes Thumshirn Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-4-willy@infradead.org Signed-off-by: Linus Torvalds commit 9a42823a102eb10dd1cc09930dc7e20042698e23 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:10 2020 -0700 mm: return void from various readahead functions ondemand_readahead has two callers, neither of which use the return value. That means that both ra_submit and __do_page_cache_readahead() can return void, and we don't need to worry that a present page in the readahead window causes us to return a smaller nr_pages than we ought to have. Similarly, no caller uses the return value from force_page_cache_readahead(). Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-3-willy@infradead.org Signed-off-by: Linus Torvalds commit cee9a0c4e84db024d692d6b5c18f65465eb06905 Author: Matthew Wilcox (Oracle) Date: Mon Jun 1 21:46:07 2020 -0700 mm: move readahead prototypes from mm.h Patch series "Change readahead API", v11. This series adds a readahead address_space operation to replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a list to the readpages operation and having the filesystem add them to the page cache. It's a net reduction in code for each implementation, more efficient than walking a list, and solves the direct-write vs buffered-read problem reported by yu kuai at http://lkml.kernel.org/r/20200116063601.39201-1-yukuai3@huawei.com The only unconverted filesystems are those which use fscache. Their conversion is pending Dave Howells' rewrite which will make the conversion substantially easier. This should be completed by the end of the year. I want to thank the reviewers/testers; Dave Chinner, John Hubbard, Eric Biggers, Johannes Thumshirn, Dave Sterba, Zi Yan, Christoph Hellwig and Miklos Szeredi have done a marvellous job of providing constructive criticism. These patches pass an xfstests run on ext4, xfs & btrfs with no regressions that I can tell (some of the tests seem a little flaky before and remain flaky afterwards). This patch (of 25): The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones which were actively misleading. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Reviewed-by: Johannes Thumshirn Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-1-willy@infradead.org Link: http://lkml.kernel.org/r/20200414150233.24495-2-willy@infradead.org Signed-off-by: Linus Torvalds commit 002ae7057069538aa3afd500f6f60a429cb948b2 Author: Vlastimil Babka Date: Mon Jun 1 21:46:03 2020 -0700 mm, dump_page(): do not crash with invalid mapping pointer We have seen a following problem on a RPi4 with 1G RAM: BUG: Bad page state in process systemd-hwdb pfn:35601 page:ffff7e0000d58040 refcount:15 mapcount:131221 mapping:efd8fe765bc80080 index:0x1 compound_mapcount: -32767 Unable to handle kernel paging request at virtual address efd8fe765bc80080 Mem abort info: ESR = 0x96000004 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 [efd8fe765bc80080] address between user and kernel address ranges Internal error: Oops: 96000004 [#1] SMP Modules linked in: btrfs libcrc32c xor xor_neon zlib_deflate raid6_pq mmc_block xhci_pci xhci_hcd usbcore sdhci_iproc sdhci_pltfm sdhci mmc_core clk_raspberrypi gpio_raspberrypi_exp pcie_brcmstb bcm2835_dma gpio_regulator phy_generic fixed sg scsi_mod efivarfs Supported: No, Unreleased kernel CPU: 3 PID: 408 Comm: systemd-hwdb Not tainted 5.3.18-8-default #1 SLE15-SP2 (unreleased) Hardware name: raspberrypi rpi/rpi, BIOS 2020.01 02/21/2020 pstate: 40000085 (nZcv daIf -PAN -UAO) pc : __dump_page+0x268/0x368 lr : __dump_page+0xc4/0x368 sp : ffff000012563860 x29: ffff000012563860 x28: ffff80003ddc4300 x27: 0000000000000010 x26: 000000000000003f x25: ffff7e0000d58040 x24: 000000000000000f x23: efd8fe765bc80080 x22: 0000000000020095 x21: efd8fe765bc80080 x20: ffff000010ede8b0 x19: ffff7e0000d58040 x18: ffffffffffffffff x17: 0000000000000001 x16: 0000000000000007 x15: ffff000011689708 x14: 3030386362353637 x13: 6566386466653a67 x12: 6e697070616d2031 x11: 32323133313a746e x10: 756f6370616d2035 x9 : ffff00001168a840 x8 : ffff00001077a670 x7 : 000000000000013d x6 : ffff0000118a43b5 x5 : 0000000000000001 x4 : ffff80003dd9e2c8 x3 : ffff80003dd9e2c8 x2 : 911c8d7c2f483500 x1 : dead000000000100 x0 : efd8fe765bc80080 Call trace: __dump_page+0x268/0x368 bad_page+0xd4/0x168 check_new_page_bad+0x80/0xb8 rmqueue_bulk.constprop.26+0x4d8/0x788 get_page_from_freelist+0x4d4/0x1228 __alloc_pages_nodemask+0x134/0xe48 alloc_pages_vma+0x198/0x1c0 do_anonymous_page+0x1a4/0x4d8 __handle_mm_fault+0x4e8/0x560 handle_mm_fault+0x104/0x1e0 do_page_fault+0x1e8/0x4c0 do_translation_fault+0xb0/0xc0 do_mem_abort+0x50/0xb0 el0_da+0x24/0x28 Code: f9401025 8b8018a0 9a851005 17ffffca (f94002a0) Besides the underlying issue with page->mapping containing a bogus value for some reason, we can see that __dump_page() crashed by trying to read the pointer at mapping->host, turning a recoverable warning into full Oops. It can be expected that when page is reported as bad state for some reason, the pointers there should not be trusted blindly. So this patch treats all data in __dump_page() that depends on page->mapping as lava, using probe_kernel_read_strict(). Ideally this would include the dentry->d_parent recursively, but that would mean changing printk handler for %pd. Chances of reaching the dentry printing part with an initially bogus mapping pointer should be rather low, though. Also prefix printing mapping->a_ops with a description of what is being printed. In case the value is bogus, %ps will print raw value instead of the symbol name and then it's not obvious at all that it's printing a_ops. Reported-by: Petr Tesarik Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Acked-by: Kirill A. Shutemov Cc: Matthew Wilcox Cc: John Hubbard Link: http://lkml.kernel.org/r/20200331165454.12263-1-vbabka@suse.cz Signed-off-by: Linus Torvalds commit a3df69278c5052acf0a5335b3fc614e0a7e5ea93 Author: Andrew Morton Date: Mon Jun 1 21:46:00 2020 -0700 Documentation/vm/slub.rst: s/Toggle/Enable/ "toggle" means to change a boolean thing's state. This operation doesn't do that - it sets it to "true". Signed-off-by: Andrew Morton Acked-by: Rafael Aquini Cc: Christoph Lameter Cc: David Rientjes Cc: Joonsoo Kim Cc: Pekka Enberg Signed-off-by: Linus Torvalds commit a68ee0573991e90af2f1785db309206408bad3e5 Author: Qian Cai Date: Mon Jun 1 21:45:57 2020 -0700 mm/slub: fix stack overruns with SLUB_STATS There is no need to copy SLUB_STATS items from root memcg cache to new memcg cache copies. Doing so could result in stack overruns because the store function only accepts 0 to clear the stat and returns an error for everything else while the show method would print out the whole stat. Then, the mismatch of the lengths returns from show and store methods happens in memcg_propagate_slab_attrs(): else if (root_cache->max_attr_size < ARRAY_SIZE(mbuf)) buf = mbuf; max_attr_size is only 2 from slab_attr_store(), then, it uses mbuf[64] in show_stat() later where a bounch of sprintf() would overrun the stack variable. Fix it by always allocating a page of buffer to be used in show_stat() if SLUB_STATS=y which should only be used for debug purpose. # echo 1 > /sys/kernel/slab/fs_cache/shrink BUG: KASAN: stack-out-of-bounds in number+0x421/0x6e0 Write of size 1 at addr ffffc900256cfde0 by task kworker/76:0/53251 Hardware name: HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40 07/10/2019 Workqueue: memcg_kmem_cache memcg_kmem_cache_create_func Call Trace: number+0x421/0x6e0 vsnprintf+0x451/0x8e0 sprintf+0x9e/0xd0 show_stat+0x124/0x1d0 alloc_slowpath_show+0x13/0x20 __kmem_cache_create+0x47a/0x6b0 addr ffffc900256cfde0 is located in stack of task kworker/76:0/53251 at offset 0 in frame: process_one_work+0x0/0xb90 this frame has 1 object: [32, 72) 'lockdep_map' Memory state around the buggy address: ffffc900256cfc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900256cfd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900256cfd80: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ^ ffffc900256cfe00: 00 00 00 00 00 f2 f2 f2 00 00 00 00 00 00 00 00 ffffc900256cfe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: __kmem_cache_create+0x6ac/0x6b0 Workqueue: memcg_kmem_cache memcg_kmem_cache_create_func Call Trace: __kmem_cache_create+0x6ac/0x6b0 Fixes: 107dab5c92d5 ("slub: slub-specific propagation changes") Signed-off-by: Qian Cai Signed-off-by: Andrew Morton Cc: Glauber Costa Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200429222356.4322-1-cai@lca.pw Signed-off-by: Linus Torvalds commit aa456c7aebb14a4ff47611586397b5b3e84fbf37 Author: Christopher Lameter Date: Mon Jun 1 21:45:53 2020 -0700 slub: remove kmalloc under list_lock from list_slab_objects() V2 list_slab_objects() is called when a slab is destroyed and there are objects still left to list the objects in the syslog. This is a pretty rare event. And there it seems we take the list_lock and call kmalloc while holding that lock. Perform the allocation in free_partial() before the list_lock is taken. Fixes: bbd7d57bfe852d9788bae5fb171c7edb4021d8ac ("slub: Potential stack overflow") Signed-off-by: Christopher Lameter Signed-off-by: Andrew Morton Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: "Kirill A. Shutemov" Cc: Tetsuo Handa Cc: Yu Zhao Link: http://lkml.kernel.org/r/alpine.DEB.2.21.2002031721250.1668@www.lameter.com Signed-off-by: Linus Torvalds commit d7660ce5914d396242bfc56c8f45ef117101fb58 Author: Christoph Lameter Date: Mon Jun 1 21:45:50 2020 -0700 slub: Remove userspace notifier for cache add/remove I came across some unnecessary uevents once again which reminded me this. The patch seems to be lost in the leaves of the original discussion [1], so resending. [1] https://lore.kernel.org/r/alpine.DEB.2.21.2001281813130.745@www.lameter.com Kmem caches are internal kernel structures so it is strange that userspace notifiers would be needed. And I am not aware of any use of these notifiers. These notifiers may just exist because in the initial slub release the sysfs code was copied from another subsystem. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Acked-by: Vlastimil Babka Acked-by: Michal Koutný Acked-by: David Rientjes Cc: Pekka Enberg Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200423115721.19821-1-mkoutny@suse.com Signed-off-by: Linus Torvalds commit 52f23478081ae0dcdb95d1650ea1e7d52d586829 Author: Dongli Zhang Date: Mon Jun 1 21:45:47 2020 -0700 mm/slub.c: fix corrupted freechain in deactivate_slab() The slub_debug is able to fix the corrupted slab freelist/page. However, alloc_debug_processing() only checks the validity of current and next freepointer during allocation path. As a result, once some objects have their freepointers corrupted, deactivate_slab() may lead to page fault. Below is from a test kernel module when 'slub_debug=PUF,kmalloc-128 slub_nomerge'. The test kernel corrupts the freepointer of one free object on purpose. Unfortunately, deactivate_slab() does not detect it when iterating the freechain. BUG: unable to handle page fault for address: 00000000123456f8 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI ... ... RIP: 0010:deactivate_slab.isra.92+0xed/0x490 ... ... Call Trace: ___slab_alloc+0x536/0x570 __slab_alloc+0x17/0x30 __kmalloc+0x1d9/0x200 ext4_htree_store_dirent+0x30/0xf0 htree_dirblock_to_tree+0xcb/0x1c0 ext4_htree_fill_tree+0x1bc/0x2d0 ext4_readdir+0x54f/0x920 iterate_dir+0x88/0x190 __x64_sys_getdents+0xa6/0x140 do_syscall_64+0x49/0x170 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Therefore, this patch adds extra consistency check in deactivate_slab(). Once an object's freepointer is corrupted, all following objects starting at this object are isolated. [akpm@linux-foundation.org: fix build with CONFIG_SLAB_DEBUG=n] Signed-off-by: Dongli Zhang Signed-off-by: Andrew Morton Cc: Joe Jin Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200331031450.12182-1-dongli.zhang@oracle.com Signed-off-by: Linus Torvalds commit 49f2d2419d60a103752e5fbaf158cf8d07c0d884 Author: Vlastimil Babka Date: Mon Jun 1 21:45:43 2020 -0700 usercopy: mark dma-kmalloc caches as usercopy caches We have seen a "usercopy: Kernel memory overwrite attempt detected to SLUB object 'dma-kmalloc-1 k' (offset 0, size 11)!" error on s390x, as IUCV uses kmalloc() with __GFP_DMA because of memory address restrictions. The issue has been discussed [2] and it has been noted that if all the kmalloc caches are marked as usercopy, there's little reason not to mark dma-kmalloc caches too. The 'dma' part merely means that __GFP_DMA is used to restrict memory address range. As Jann Horn put it [3]: "I think dma-kmalloc slabs should be handled the same way as normal kmalloc slabs. When a dma-kmalloc allocation is freshly created, it is just normal kernel memory - even if it might later be used for DMA -, and it should be perfectly fine to copy_from_user() into such allocations at that point, and to copy_to_user() out of them at the end. If you look at the places where such allocations are created, you can see things like kmemdup(), memcpy() and so on - all normal operations that shouldn't conceptually be different from usercopy in any relevant way." Thus this patch marks the dma-kmalloc-* caches as usercopy. [1] https://bugzilla.suse.com/show_bug.cgi?id=1156053 [2] https://lore.kernel.org/kernel-hardening/bfca96db-bbd0-d958-7732-76e36c667c68@suse.cz/ [3] https://lore.kernel.org/kernel-hardening/CAG48ez1a4waGk9kB0WLaSbs4muSoK0AYAVk8=XYaKj4_+6e6Hg@mail.gmail.com/ Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton Acked-by: Christian Borntraeger Acked-by: Jiri Slaby Cc: Jann Horn Cc: Christoph Hellwig Cc: Christopher Lameter Cc: Julian Wiedmann Cc: Ursula Braun Cc: Alexander Viro Cc: David Windsor Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andy Lutomirski Cc: "David S. Miller" Cc: Laura Abbott Cc: Mark Rutland Cc: "Martin K. Petersen" Cc: Paolo Bonzini Cc: Christoffer Dall Cc: Dave Kleikamp Cc: Jan Kara Cc: Luis de Bethencourt Cc: Marc Zyngier Cc: Rik van Riel Cc: Matthew Garrett Cc: Michal Kubecek Link: http://lkml.kernel.org/r/7d810f6d-8085-ea2f-7805-47ba3842dc50@suse.cz Signed-off-by: Linus Torvalds commit 485e9605c05733759d3bd5aba4fbe561801f3658 Author: Jeff Layton Date: Mon Jun 1 21:45:40 2020 -0700 fs/buffer.c: record blockdev write errors in super_block that it backs When syncing out a block device (a'la __sync_blockdev), any error encountered will only be recorded in the bd_inode's mapping. When the blockdev contains a filesystem however, we'd like to also record the error in the super_block that's stored there. Make mark_buffer_write_io_error also record the error in the corresponding super_block when a writeback error occurs and the block device contains a mounted superblock. Since superblocks are RCU freed, hold the rcu_read_lock to ensure that the superblock doesn't go away while we're marking it. Signed-off-by: Jeff Layton Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Cc: Al Viro Cc: Andres Freund Cc: Matthew Wilcox Cc: David Howells Cc: Christoph Hellwig Cc: Dave Chinner Link: http://lkml.kernel.org/r/20200428135155.19223-3-jlayton@kernel.org Signed-off-by: Linus Torvalds commit 735e4ae5ba28c886d249ad04d3c8cc097dad6336 Author: Jeff Layton Date: Mon Jun 1 21:45:36 2020 -0700 vfs: track per-sb writeback errors and report them to syncfs Patch series "vfs: have syncfs() return error when there are writeback errors", v6. Currently, syncfs does not return errors when one of the inodes fails to be written back. It will return errors based on the legacy AS_EIO and AS_ENOSPC flags when syncing out the block device fails, but that's not particularly helpful for filesystems that aren't backed by a blockdev. It's also possible for a stray sync to lose those errors. The basic idea in this set is to track writeback errors at the superblock level, so that we can quickly and easily check whether something bad happened without having to fsync each file individually. syncfs is then changed to reliably report writeback errors after they occur, much in the same fashion as fsync does now. This patch (of 2): Usually we suggest that applications call fsync when they want to ensure that all data written to the file has made it to the backing store, but that can be inefficient when there are a lot of open files. Calling syncfs on the filesystem can be more efficient in some situations, but the error reporting doesn't currently work the way most people expect. If a single inode on a filesystem reports a writeback error, syncfs won't necessarily return an error. syncfs only returns an error if __sync_blockdev fails, and on some filesystems that's a no-op. It would be better if syncfs reported an error if there were any writeback failures. Then applications could call syncfs to see if there are any errors on any open files, and could then call fsync on all of the other descriptors to figure out which one failed. This patch adds a new errseq_t to struct super_block, and has mapping_set_error also record writeback errors there. To report those errors, we also need to keep an errseq_t in struct file to act as a cursor. This patch adds a dedicated field for that purpose, which slots nicely into 4 bytes of padding at the end of struct file on x86_64. An earlier version of this patch used an O_PATH file descriptor to cue the kernel that the open file should track the superblock error and not the inode's writeback error. I think that API is just too weird though. This is simpler and should make syncfs error reporting "just work" even if someone is multiplexing fsync and syncfs on the same fds. Signed-off-by: Jeff Layton Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Cc: Andres Freund Cc: Matthew Wilcox Cc: Al Viro Cc: Christoph Hellwig Cc: Dave Chinner Cc: David Howells Link: http://lkml.kernel.org/r/20200428135155.19223-1-jlayton@kernel.org Link: http://lkml.kernel.org/r/20200428135155.19223-2-jlayton@kernel.org Signed-off-by: Linus Torvalds commit 78128fabd022240852859c0b253972147593690b Author: Andrew Morton Date: Mon Jun 1 21:45:33 2020 -0700 arch/parisc/include/asm/pgtable.h: remove unused `old_pte' parisc's set_pte_at() macro has set-but-not-used variable: include/linux/pgtable.h: In function 'pte_clear_not_present_full': arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable] Reported-by: kbuild test robot Signed-off-by: Andrew Morton Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Mike Rapoport Signed-off-by: Linus Torvalds commit 912f655d78c5d4ad05eac287f23a435924df7144 Author: Gang He Date: Mon Jun 1 21:45:29 2020 -0700 ocfs2: mount shared volume without ha stack Usually we create and use a ocfs2 shared volume on the top of ha stack. For pcmk based ha stack, which includes DLM, corosync and pacemaker services. The customers complained they could not mount existent ocfs2 volume in the single node without ha stack, e.g. single node backup/restore scenario. Like this case, the customers just want to access the data from the existent ocfs2 volume quickly, but do not want to restart or setup ha stack. Then, I'd like to add a mount option "nocluster", if the users use this option to mount a ocfs2 shared volume, the whole mount will not depend on the ha related services. the command will mount the existent ocfs2 volume directly (like local mount), for avoiding setup the ha stack. Signed-off-by: Gang He Signed-off-by: Andrew Morton Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Cc: Changwei Ge Cc: Jun Piao Link: http://lkml.kernel.org/r/20200423053300.22661-1-ghe@suse.com Signed-off-by: Linus Torvalds commit 8f745e62a1926e57a671b0841241b60e80903dda Author: Jules Irenge Date: Mon Jun 1 21:45:26 2020 -0700 ocfs2: add missing annotation for dlm_empty_lockres() Sparse reports a warning at dlm_empty_lockres() warning: context imbalance in dlm_purge_lockres() - unexpected unlock The root cause is the missing annotation at dlm_purge_lockres() Add the missing __must_hold(&dlm->spinlock) Signed-off-by: Jules Irenge Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Link: http://lkml.kernel.org/r/20200403160505.2832-4-jbi.octave@gmail.com Signed-off-by: Linus Torvalds commit 93e72b3c612adcaca13d874fcc86c53e6c8da541 Author: Philippe Liard Date: Mon Jun 1 21:45:23 2020 -0700 squashfs: migrate from ll_rw_block usage to BIO ll_rw_block() function has been deprecated in favor of BIO which appears to come with large performance improvements. This patch decreases boot time by close to 40% when using squashfs for the root file-system. This is observed at least in the context of starting an Android VM on Chrome OS using crosvm. The patch was tested on 4.19 as well as master. This patch is largely based on Adrien Schildknecht's patch that was originally sent as https://lkml.org/lkml/2017/9/22/814 though with some significant changes and simplifications while also taking Phillip Lougher's feedback into account, around preserving support for FILE_CACHE in particular. [akpm@linux-foundation.org: fix build error reported by Randy] Link: http://lkml.kernel.org/r/319997c2-5fc8-f889-2ea3-d913308a7c1f@infradead.org Signed-off-by: Philippe Liard Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Cc: Adrien Schildknecht Cc: Phillip Lougher Cc: Guenter Roeck Cc: Daniel Rosenberg Link: https://chromium.googlesource.com/chromiumos/platform/crosvm Link: http://lkml.kernel.org/r/20191106074238.186023-1-pliard@google.com Signed-off-by: Linus Torvalds commit ea22eee4e6027d8927099de344f7fff43c507ef9 Author: Bob Peterson Date: Wed Apr 29 08:45:54 2020 -0500 gfs2: Allow lock_nolock mount to specify jid=X Before this patch, a simple typo accidentally added \n to the jid= string for lock_nolock mounts. This made it impossible to mount a gfs2 file system with a journal other than journal0. Thus: mount -tgfs2 -o hostdata="jid=1" Resulted in: mount: wrong fs type, bad option, bad superblock on In most cases this is not a problem. However, for debugging and testing purposes we sometimes want to test the integrity of other journals. This patch removes the unnecessary \n and thus allows lock_nolock users to specify an alternate journal. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit bbae10fac2dceb6c8585d385cc689f4e7ce81b1f Author: Bob Peterson Date: Fri May 8 09:18:03 2020 -0500 gfs2: Don't ignore inode write errors during inode_go_sync Before for this patch, function inode_go_sync ignored io errors during inode_go_sync, overwriting them with metadata write errors: error = filemap_fdatawait(mapping); mapping_set_error(mapping, error); } error = filemap_fdatawait(metamapping); ... return error; So any errors returned by the inode write would be forgotten if the metadata write succeeded. This patch still does both writes, but only sets error if it's still zero. That way, any errors will be reported by to the caller, do_xmote, which will take appropriate action and report the error. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 3700bec3323ebe90924156775be0124e93094f78 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:32:31 2020 +0200 docs: filesystems: convert gfs2-glocks.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Add table markups; - Use notes markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andreas Gruenbacher commit 17839856fd588f4ab6b789f482ed3ffd7c403e1f Author: Linus Torvalds Date: Wed May 27 18:29:34 2020 -0700 gup: document and work around "COW can break either way" issue Doing a "get_user_pages()" on a copy-on-write page for reading can be ambiguous: the page can be COW'ed at any time afterwards, and the direction of a COW event isn't defined. Yes, whoever writes to it will generally do the COW, but if the thread that did the get_user_pages() unmapped the page before the write (and that could happen due to memory pressure in addition to any outright action), the writer could also just take over the old page instead. End result: the get_user_pages() call might result in a page pointer that is no longer associated with the original VM, and is associated with - and controlled by - another VM having taken it over instead. So when doing a get_user_pages() on a COW mapping, the only really safe thing to do would be to break the COW when getting the page, even when only getting it for reading. At the same time, some users simply don't even care. For example, the perf code wants to look up the page not because it cares about the page, but because the code simply wants to look up the physical address of the access for informational purposes, and doesn't really care about races when a page might be unmapped and remapped elsewhere. This adds logic to force a COW event by setting FOLL_WRITE on any copy-on-write mapping when FOLL_GET (or FOLL_PIN) is used to get a page pointer as a result. The current semantics end up being: - __get_user_pages_fast(): no change. If you don't ask for a write, you won't break COW. You'd better know what you're doing. - get_user_pages_fast(): the fast-case "look it up in the page tables without anything getting mmap_sem" now refuses to follow a read-only page, since it might need COW breaking. Which happens in the slow path - the fast path doesn't know if the memory might be COW or not. - get_user_pages() (including the slow-path fallback for gup_fast()): for a COW mapping, turn on FOLL_WRITE for FOLL_GET/FOLL_PIN, with very similar semantics to FOLL_FORCE. If it turns out that we want finer granularity (ie "only break COW when it might actually matter" - things like the zero page are special and don't need to be broken) we might need to push these semantics deeper into the lookup fault path. So if people care enough, it's possible that we might end up adding a new internal FOLL_BREAK_COW flag to go with the internal FOLL_COW flag we already have for tracking "I had a COW". Alternatively, if it turns out that different callers might want to explicitly control the forced COW break behavior, we might even want to make such a flag visible to the users of get_user_pages() instead of using the above default semantics. But for now, this is mostly commentary on the issue (this commit message being a lot bigger than the patch, and that patch in turn is almost all comments), with that minimal "enable COW breaking early" logic using the existing FOLL_WRITE behavior. [ It might be worth noting that we've always had this ambiguity, and it could arguably be seen as a user-space issue. You only get private COW mappings that could break either way in situations where user space is doing cooperative things (ie fork() before an execve() etc), but it _is_ surprising and very subtle, and fork() is supposed to give you independent address spaces. So let's treat this as a kernel issue and make the semantics of get_user_pages() easier to understand. Note that obviously a true shared mapping will still get a page that can change under us, so this does _not_ mean that get_user_pages() somehow returns any "stable" page ] Reported-by: Jann Horn Tested-by: Christoph Hellwig Acked-by: Oleg Nesterov Acked-by: Kirill Shutemov Acked-by: Jan Kara Cc: Andrea Arcangeli Cc: Matthew Wilcox Signed-off-by: Linus Torvalds commit 3247bd10a4502a3075ce8e1c3c7d31ef76f193ce Author: Ashok Raj Date: Thu May 28 13:57:42 2020 -0700 PCI: Add ACS quirk for Intel Root Complex Integrated Endpoints All Intel platforms guarantee that all root complex implementations must send transactions up to IOMMU for address translations. Hence for Intel RCiEP devices, we can assume some ACS-type isolation even without an ACS capability. From the Intel VT-d spec, r3.1, sec 3.16 ("Root-Complex Peer to Peer Considerations"): When DMA remapping is enabled, peer-to-peer requests through the Root-Complex must be handled as follows: - The input address in the request is translated (through first-level, second-level or nested translation) to a host physical address (HPA). The address decoding for peer addresses must be done only on the translated HPA. Hardware implementations are free to further limit peer-to-peer accesses to specific host physical address regions (or to completely disallow peer-forwarding of translated requests). - Since address translation changes the contents (address field) of the PCI Express Transaction Layer Packet (TLP), for PCI Express peer-to-peer requests with ECRC, the Root-Complex hardware must use the new ECRC (re-computed with the translated address) if it decides to forward the TLP as a peer request. - Root-ports, and multi-function root-complex integrated endpoints, may support additional peer-to-peer control features by supporting PCI Express Access Control Services (ACS) capability. Refer to ACS capability in PCI Express specifications for details. Since Linux didn't give special treatment to allow this exception, certain RCiEP MFD devices were grouped in a single IOMMU group. This doesn't permit a single device to be assigned to a guest for instance. In one vendor system: Device 14.x were grouped in a single IOMMU group. /sys/kernel/iommu_groups/5/devices/0000:00:14.0 /sys/kernel/iommu_groups/5/devices/0000:00:14.2 /sys/kernel/iommu_groups/5/devices/0000:00:14.3 After this patch: /sys/kernel/iommu_groups/5/devices/0000:00:14.0 /sys/kernel/iommu_groups/5/devices/0000:00:14.2 /sys/kernel/iommu_groups/6/devices/0000:00:14.3 <<< new group 14.0 and 14.2 are integrated devices, but legacy end points, whereas 14.3 was a PCIe-compliant RCiEP. 00:14.3 Network controller: Intel Corporation Device 9df0 (rev 30) Capabilities: [40] Express (v2) Root Complex Integrated Endpoint, MSI 00 This permits assigning this device to a guest VM. [bhelgaas: drop "Fixes" tag since this doesn't fix a bug in that commit] Link: https://lore.kernel.org/r/1590699462-7131-1-git-send-email-ashok.raj@intel.com Tested-by: Darrel Goeddel Signed-off-by: Ashok Raj Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson Cc: stable@vger.kernel.org Cc: Lu Baolu Cc: Mark Scott , Cc: Romil Sharma commit d2353bad2c1eef7a1228645fbb21e7887c633d12 Author: Arnd Bergmann Date: Fri May 29 22:16:45 2020 +0200 ARM: omap2: fix omap5_realtime_timer_init definition There is one more regression introduced by the last build fix: arch/arm/mach-omap2/timer.c:170:6: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] void __init omap5_realtime_timer_init(void) ^ arch/arm/mach-omap2/common.h:118:20: note: previous definition is here static inline void omap5_realtime_timer_init(void) ^ arch/arm/mach-omap2/timer.c:170:13: error: redefinition of 'omap5_realtime_timer_init' void __init omap5_realtime_timer_init(void) ^ arch/arm/mach-omap2/common.h:118:20: note: previous definition is here static inline void omap5_realtime_timer_init(void) Address this by removing the now obsolete #ifdefs in that file and just building the entire file based on the flag that controls the omap5_realtime_timer_init function declaration. Link: https://lore.kernel.org/r/20200529201701.521933-1-arnd@arndb.de Fixes: d86ad463d670 ("ARM: OMAP2+: Fix regression for using local timer on non-SMP SoCs") Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 603986a7a486a041e82146f6fce5ac6439858b2a Merge: 36e29139cd47 7856488bd83b Author: Arnd Bergmann Date: Tue Jun 2 19:12:35 2020 +0200 Merge tag 'keystone_dts_for_5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into arm/dt ARM: Keystone DTS updates for 5.7 Add display support for K2G EVM Board * tag 'keystone_dts_for_5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: ARM: dts: keystone-k2g-evm: add HDMI video support ARM: dts: keystone-k2g: Add DSS node Signed-off-by: Arnd Bergmann commit 382561a0f11c4995d48ab82670412f8d6c418430 Author: Masami Hiramatsu Date: Thu May 28 23:52:37 2020 +0900 selftests/sysctl: Make sysctl test driver as a module Fix config file to require CONFIG_TEST_SYSCTL=m instead of y because this driver introduces a test sysctl interfaces which are normally not used, and only used for the selftest. Signed-off-by: Masami Hiramatsu Reviewed-by: Kees Cook Reviewed-by: Luis Chamberlain Signed-off-by: Shuah Khan commit eee470e0739a9d8e29460f6d355cefa1c9a0384a Author: Masami Hiramatsu Date: Thu May 28 23:52:26 2020 +0900 selftests/sysctl: Fix to load test_sysctl module Fix to load test_sysctl.ko module correctly. sysctl.sh checks whether the test module is embedded (or loaded already) or not at first, and if not, it returns skip error instead of trying modprobe. Thus, there is no chance to load the test_sysctl test module. Instead, this removes that module embedded check and returns skip error only if it ensures that there is no embedded test module *and* no loadable test module. This also avoid referring config file since that is not installed. Signed-off-by: Masami Hiramatsu Reviewed-by: Kees Cook Reviewed-by: Luis Chamberlain Signed-off-by: Shuah Khan commit 0df12a01f4857495816b05f048c4c31439446e35 Author: Tony Lindgren Date: Mon Jun 1 17:18:56 2020 -0700 ARM: dts: omap4-droid4: Fix spi configuration and increase rate We can currently sometimes get "RXS timed out" errors and "EOT timed out" errors with spi transfers. These errors can be made easy to reproduce by reading the cpcap iio values in a loop while keeping the CPUs busy by also reading /dev/urandom. The "RXS timed out" errors we can fix by adding spi-cpol and spi-cpha in addition to the spi-cs-high property we already have. The "EOT timed out" errors we can fix by increasing the spi clock rate to 9.6 MHz. Looks similar MC13783 PMIC says it works at spi clock rates up to 20 MHz, so let's assume we can pick any rate up to 20 MHz also for cpcap. Cc: maemo-leste@lists.dyne.org Cc: Merlijn Wajer Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Tony Lindgren commit 2f56f84511367ce5ffd4a1c88dcd770ef049ea96 Author: Masami Hiramatsu Date: Thu May 28 23:52:16 2020 +0900 lib: Make test_sysctl initialized as module test_sysctl.c is expected to be used as a module, but since it does not use module_init(), it never be registered as a module and not appeared under /sys/module/. In the result, the selftests/sysctl/sysctl.sh always fails to find the test module and is skipped. This makes test_sysctl.c initialized as a module by module_init() and allow sysctl.sh to find the test module is loaded. Signed-off-by: Masami Hiramatsu Reviewed-by: Luis Chamberlain Signed-off-by: Shuah Khan commit d0676871fd52f575cc2bfec4faa2fcbc8af370e8 Author: Masami Hiramatsu Date: Thu May 28 23:52:06 2020 +0900 lib: Make prime number generator independently selectable Make prime number generator independently selectable from kconfig. This allows us to enable CONFIG_PRIME_NUMBERS=m and run the tools/testing/selftests/lib/prime_numbers.sh without other DRM selftest modules. Signed-off-by: Masami Hiramatsu Reviewed-by: Kees Cook Reviewed-by: Luis Chamberlain Signed-off-by: Shuah Khan commit b6f61c31464940513ef4eccb3a030a405b4256d6 Author: David Howells Date: Tue May 12 14:03:53 2020 +0100 keys: Implement update for the big_key type Implement the ->update op for the big_key type. Signed-off-by: David Howells Acked-by: Jason A. Donenfeld commit 521fd61c84a19b31dfbaa8dde3d2577e4e115d12 Author: Jason A. Donenfeld Date: Mon May 11 15:51:01 2020 -0600 security/keys: rewrite big_key crypto to use library interface A while back, I noticed that the crypto and crypto API usage in big_keys were entirely broken in multiple ways, so I rewrote it. Now, I'm rewriting it again, but this time using the simpler ChaCha20Poly1305 library function. This makes the file considerably more simple; the diffstat alone should justify this commit. It also should be faster, since it no longer requires a mutex around the "aead api object" (nor allocations), allowing us to encrypt multiple items in parallel. We also benefit from being able to pass any type of pointer, so we can get rid of the ridiculously complex custom page allocator that big_key really doesn't need. [DH: Change the select CRYPTO_LIB_CHACHA20POLY1305 to a depends on as select doesn't propagate and the build can end up with an =y dependending on some =m pieces. The depends on CRYPTO also had to be removed otherwise the configurator complains about a recursive dependency.] Cc: Andy Lutomirski Cc: Greg KH Cc: Linus Torvalds Cc: kernel-hardening@lists.openwall.com Reviewed-by: Eric Biggers Signed-off-by: Jason A. Donenfeld Signed-off-by: David Howells commit 2ce113fa525faf62fc308a10d1e5af07456b7460 Author: Gustavo A. R. Silva Date: Thu May 7 13:57:10 2020 -0500 KEYS: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David Howells Reviewed-by: Jarkko Sakkinen commit 352780b61ebbd5fef845714c17246e1647c6904a Author: Ben Boeckel Date: Fri May 15 20:39:17 2020 -0400 Documentation: security: core.rst: add missing argument This argument was just never documented in the first place. Signed-off-by: Ben Boeckel Signed-off-by: David Howells Reviewed-by: Jarkko Sakkinen commit b3e2d20973db3ec87a6dd2fee0c88d3c2e7c2f61 Author: Kefeng Wang Date: Fri Apr 17 12:02:45 2020 +0800 rcuperf: Fix printk format warning Using "%zu" to fix following warning, kernel/rcu/rcuperf.c: In function ‘kfree_perf_init’: include/linux/kern_levels.h:5:18: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=] Signed-off-by: Kefeng Wang Signed-off-by: Paul E. McKenney commit 972eabb97aab8e5d86c79f28a707e0d1e8a1d1a0 Author: Sebastian Reichel Date: Tue Jun 2 16:49:08 2020 +0200 Revert "power: supply: sbs-battery: simplify read_read_string_data" The commit is a nice cleanup, but breaks booting on exynos5 based chromebooks. It's seems to come down to exynos5's i2c driver not implementing I2C_FUNC_SMBUS_READ_BLOCK_DATA. It's not yet clear why that breaks boot / massively slows it down when userspace starts, so revert the problematic patch. This reverts commit c4b12a2f3f3de670f6be5e96092a2cab0b877f1a. Signed-off-by: Sebastian Reichel commit cf1eb321d1cd134da0083f6430301a09f8012de1 Author: Sebastian Reichel Date: Tue Jun 2 16:36:24 2020 +0200 Revert "power: supply: sbs-battery: add PEC support" This depends on the simplification of sbs_read_string_data, which breaks booting exynos5 based chromebooks. More investigation is required, so this patch and the simplification patch are reverted for this merge window. Note, that this is only a partial revert, since sbs_update_presence() has not been removed. It is also required for the charger broadcast disabling. This reverts commit 79bcd5a4a66076a8a8dacd7f4a3be1952283aef4. Signed-off-by: Sebastian Reichel commit 5f68ea4aa98bcddb5ec5229d2a0933d84ed17732 Author: Aurelien Aptel Date: Wed Apr 22 15:58:57 2020 +0200 cifs: multichannel: move channel selection in function This commit moves channel picking code in separate function. Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit bbbf9eafbfdaa2af75fb5ed6d5ddb01be89e6d30 Author: Steve French Date: Sat May 30 17:29:50 2020 -0500 cifs: fix minor typos in comments and log messages Fix four minor typos in comments and log messages Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 3563a6f4683eb08f9a437e028dd027ac31092381 Author: Steve French Date: Sat May 30 17:10:16 2020 -0500 smb3: minor update to compression header definitions MS-SMB2 specification was updated in March. Make minor additions and corrections to compression related definitions in smb2pdu.h Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit c893de12e1ef17b581eb2cf8fc9018ec0cbd07df Author: Wei Li Date: Thu May 21 15:21:25 2020 +0800 kdb: Remove the misfeature 'KDBFLAGS' Currently, 'KDBFLAGS' is an internal variable of kdb, it is combined by 'KDBDEBUG' and state flags. It will be shown only when 'KDBDEBUG' is set, and the user can define an environment variable named 'KDBFLAGS' too. These are puzzling indeed. After communication with Daniel, it seems that 'KDBFLAGS' is a misfeature. So let's replace 'KDBFLAGS' with 'KDBDEBUG' to just show the value we wrote into. After this modification, we can use `md4c1 kdb_flags` instead, to observe the state flags. Suggested-by: Daniel Thompson Signed-off-by: Wei Li Link: https://lore.kernel.org/r/20200521072125.21103-1-liwei391@huawei.com [daniel.thompson@linaro.org: Make kdb_flags unsigned to avoid arithmetic right shift] Signed-off-by: Daniel Thompson commit 1b310030bb855b9b13d1c0a9feffdb54883b06ab Author: Douglas Anderson Date: Thu May 7 16:11:46 2020 -0700 kdb: Cleanup math with KDB_CMD_HISTORY_COUNT From code inspection the math in handle_ctrl_cmd() looks super sketchy because it subjects -1 from cmdptr and then does a "% KDB_CMD_HISTORY_COUNT". It turns out that this code works because "cmdptr" is unsigned and KDB_CMD_HISTORY_COUNT is a nice power of 2. Let's make this a little less sketchy. This patch should be a no-op. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200507161125.1.I2cce9ac66e141230c3644b8174b6c15d4e769232@changeid Reviewed-by: Sumit Garg Signed-off-by: Daniel Thompson commit 195867ffea13b755dc727b47eaa5beb0ffa6e0ce Author: Sumit Garg Date: Thu May 7 13:08:50 2020 -0700 serial: amba-pl011: Support kgdboc_earlycon Implement the read() function in the early console driver. With recently added kgdboc_earlycon feature, this allows you to use kgdb to debug fairly early into the system boot. We only bother implementing this if polling is enabled since kgdb can't be enabled without that. Signed-off-by: Sumit Garg Reviewed-by: Douglas Anderson Reviewed-by: Daniel Thompson Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200507130644.v4.12.I8ee0811f0e0816dd8bfe7f2f5540b3dba074fae8@changeid Signed-off-by: Daniel Thompson commit c5e7467d92b849450bd03d9215afb09665d76af6 Author: Douglas Anderson Date: Thu May 7 13:08:49 2020 -0700 serial: 8250_early: Support kgdboc_earlycon Implement the read() function in the early console driver. With recent kgdb patches this allows you to use kgdb to debug fairly early into the system boot. We only bother implementing this if polling is enabled since kgdb can't be enabled without that. Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.11.I8f668556c244776523320a95b09373a86eda11b7@changeid Signed-off-by: Daniel Thompson commit 205b5bdda2090d4730dabf9c0d9646cb32f2551d Author: Douglas Anderson Date: Thu May 7 13:08:48 2020 -0700 serial: qcom_geni_serial: Support kgdboc_earlycon Implement the read() function in the early console driver. With recent kgdb patches this allows you to use kgdb to debug fairly early into the system boot. We only bother implementing this if polling is enabled since kgdb can't be enabled without that. Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20200507130644.v4.10.If2deff9679a62c1ce1b8f2558a8635dc837adf8c@changeid Signed-off-by: Daniel Thompson commit a4912303ac6fede434acf5c23a9108cdaf79844a Author: Daniel Thompson Date: Thu Apr 30 17:17:41 2020 +0100 serial: kgdboc: Allow earlycon initialization to be deferred Currently there is no guarantee that an earlycon will be initialized before kgdboc tries to adopt it. Almost the opposite: on systems with ACPI then if earlycon has no arguments then it is guaranteed that earlycon will not be initialized. This patch mitigates the problem by giving kgdboc_earlycon a second chance during console_init(). This isn't quite as good as stopping during early parameter parsing but it is still early in the kernel boot. Signed-off-by: Daniel Thompson Link: https://lore.kernel.org/r/20200430161741.1832050-1-daniel.thompson@linaro.org Reviewed-by: Douglas Anderson commit f71fc3bc7b3279cb7d0ab78c1fcc78825779bb65 Author: Douglas Anderson Date: Thu May 7 13:08:47 2020 -0700 Documentation: kgdboc: Document new kgdboc_earlycon parameter The recent patch ("kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles") adds a new kernel command line parameter. Document it. Note that the patch adding the feature does some comparing/contrasting of "kgdboc_earlycon" vs. the existing "ekgdboc". See that patch for more details, but briefly "ekgdboc" can be used _instead_ of "kgdboc" and just makes "kgdboc" do its normal initialization early (only works if your tty driver is already ready). The new "kgdboc_earlycon" works in combination with "kgdboc" and is backed by boot consoles. Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.9.I7d5eb42c6180c831d47aef1af44d0b8be3fac559@changeid Signed-off-by: Daniel Thompson commit b1350132fef7e1f0ddfd5a985d516a6ed7a329fc Author: Douglas Anderson Date: Tue May 26 14:20:06 2020 -0700 kgdb: Don't call the deinit under spinlock When I combined kgdboc_earlycon with an inflight patch titled ("soc: qcom-geni-se: Add interconnect support to fix earlycon crash") [1] things went boom. Specifically I got a crash during the transition between kgdboc_earlycon and the main kgdboc that looked like this: Call trace: __schedule_bug+0x68/0x6c __schedule+0x75c/0x924 schedule+0x8c/0xbc schedule_timeout+0x9c/0xfc do_wait_for_common+0xd0/0x160 wait_for_completion_timeout+0x54/0x74 rpmh_write_batch+0x1fc/0x23c qcom_icc_bcm_voter_commit+0x1b4/0x388 qcom_icc_set+0x2c/0x3c apply_constraints+0x5c/0x98 icc_set_bw+0x204/0x3bc icc_put+0x30/0xf8 geni_remove_earlycon_icc_vote+0x6c/0x9c qcom_geni_serial_earlycon_exit+0x10/0x1c kgdboc_earlycon_deinit+0x38/0x58 kgdb_register_io_module+0x11c/0x194 configure_kgdboc+0x108/0x174 kgdboc_probe+0x38/0x60 platform_drv_probe+0x90/0xb0 really_probe+0x130/0x2fc ... The problem was that we were holding the "kgdb_registration_lock" while calling into code that didn't expect to be called in spinlock context. Let's slightly defer when we call the deinit code so that it's not done under spinlock. NOTE: this does mean that the "deinit" call of the old kgdb IO module is now made _after_ the init of the new IO module, but presumably that's OK. [1] https://lkml.kernel.org/r/1588919619-21355-3-git-send-email-akashast@codeaurora.org Fixes: 220995622da5 ("kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles") Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200526142001.1.I523dc33f96589cb9956f5679976d402c8cda36fa@changeid [daniel.thompson@linaro.org: Resolved merge issues by hand] Signed-off-by: Daniel Thompson commit 1feb48baf2fb2aff02aa734c04a3ba5c3297d2de Author: Douglas Anderson Date: Tue May 19 08:44:02 2020 -0700 kgdboc: Disable all the early code when kgdboc is a module When kgdboc is compiled as a module all of the "ekgdboc" and "kgdb_earlycon" code isn't useful and, in fact, breaks compilation. This is because early_param() isn't defined for modules and that's how this code gets configured. It turns out that this was broken by commit eae3e19ca930 ("kgdboc: Remove useless #ifdef CONFIG_KGDB_SERIAL_CONSOLE in kgdboc") and then made worse by commit 220995622da5 ("kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles"). I guess the #ifdef wasn't so useless, even if it wasn't obvious why it was useful. When kgdboc was compiled as a module only "CONFIG_KGDB_SERIAL_CONSOLE_MODULE" was defined, not "CONFIG_KGDB_SERIAL_CONSOLE". That meant that the old module. Let's basically do the same thing that the old code (pre-removal of the #ifdef) did but use "IS_BUILTIN(CONFIG_KGDB_SERIAL_CONSOLE)" to make it more obvious what the point of the check is. We'll fix kgdboc_earlycon in a similar way. Fixes: 220995622da5 ("kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles") Fixes: eae3e19ca930 ("kgdboc: Remove useless #ifdef CONFIG_KGDB_SERIAL_CONSOLE in kgdboc") Reported-by: Stephen Rothwell Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200519084345.1.I91670accc8a5ddabab227eb63bb4ad3e2e9d2b58@changeid Signed-off-by: Daniel Thompson commit 3e9b26dc2268cfbeef85bee095f883264c18425c Author: Tiezhu Yang Date: Tue Jun 2 12:15:04 2020 +0800 perf tools: Remove some duplicated includes There exists some duplicated includes in tools/perf, remove them. Signed-off-by: Tiezhu Yang Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: xuefeng li Link: http://lore.kernel.org/lkml/1591071304-19338-2-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 0affd0e5262b6d40f5f63466d88933e99698e240 Author: Adrian Hunter Date: Tue Jun 2 14:25:05 2020 +0300 perf symbols: Fix kernel maps for kcore and eBPF Adjust 'map->pgoff' also when moving a map's start address. Example with v5.4.34 based kernel: Before: $ sudo tools/perf/perf record -a --kcore -e intel_pt//k sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.958 MB perf.data ] $ sudo tools/perf/perf script --itrace=e >/dev/null Warning: 961 instruction trace errors After: $ sudo tools/perf/perf script --itrace=e >/dev/null $ Committer testing: # uname -a Linux seventh 5.6.10-100.fc30.x86_64 #1 SMP Mon May 4 15:36:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # Before: # perf record -a --kcore -e intel_pt//k sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.923 MB perf.data ] # perf script --itrace=e >/dev/null Warning: 295 instruction trace errors # After: # perf record -a --kcore -e intel_pt//k sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.919 MB perf.data ] # perf script --itrace=e >/dev/null # Fixes: fb5a88d4131a ("perf tools: Preserve eBPF maps when loading kcore") Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200602112505.1406-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3b1f47d6e7d3ce7116c5698accaf936b46c29e3b Author: Arnaldo Carvalho de Melo Date: Tue Jun 2 10:47:51 2020 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes in: 5cde265384ca ("perf/x86/rapl: Add AMD Fam17h RAPL support") Addressing this tools/perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h With this one will be able to use these new AMD MSRs in filters, by name, e.g.: # perf trace -e msr:* --filter="msr==AMD_PKG_ENERGY_STATUS || msr==AMD_RAPL_POWER_UNIT" Just like it is now possible with other MSRs: [root@five ~]# uname -a Linux five 5.5.17-200.fc31.x86_64 #1 SMP Mon Apr 13 15:29:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux [root@five ~]# grep 'model name' -m1 /proc/cpuinfo model name : AMD Ryzen 5 3600X 6-Core Processor [root@five ~]# [root@five ~]# perf trace -e msr:*/max-stack=16/ --filter="msr==AMD_PERF_CTL" --max-events=2 0.000 kworker/1:1-ev/2327824 msr:write_msr(msr: AMD_PERF_CTL, val: 2) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) [0xffffffffc01d71c3] ([acpi_cpufreq]) [0] ([unknown]) __cpufreq_driver_target ([kernel.kallsyms]) od_dbs_update ([kernel.kallsyms]) dbs_work_handler ([kernel.kallsyms]) process_one_work ([kernel.kallsyms]) worker_thread ([kernel.kallsyms]) kthread ([kernel.kallsyms]) ret_from_fork ([kernel.kallsyms]) 8.597 kworker/2:2-ev/2338099 msr:write_msr(msr: AMD_PERF_CTL, val: 2) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) [0] ([unknown]) [0] ([unknown]) __cpufreq_driver_target ([kernel.kallsyms]) od_dbs_update ([kernel.kallsyms]) dbs_work_handler ([kernel.kallsyms]) process_one_work ([kernel.kallsyms]) worker_thread ([kernel.kallsyms]) kthread ([kernel.kallsyms]) ret_from_fork ([kernel.kallsyms]) [root@five ~]# Longer explanation with what happens in the perf build process, automatically after this is made in synch with the kernel sources: $ make -C tools/perf O=/tmp/build/perf install-bin Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h make: Leaving directory '/home/acme/git/perf/tools/perf' $ $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ $ diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h --- tools/arch/x86/include/asm/msr-index.h 2020-06-02 10:46:36.217782288 -0300 +++ arch/x86/include/asm/msr-index.h 2020-05-28 10:41:23.313794627 -0300 @@ -301,6 +301,9 @@ #define MSR_PP1_ENERGY_STATUS 0x00000641 #define MSR_PP1_POLICY 0x00000642 +#define MSR_AMD_PKG_ENERGY_STATUS 0xc001029b +#define MSR_AMD_RAPL_POWER_UNIT 0xc0010299 + /* Config TDP MSRs */ #define MSR_CONFIG_TDP_NOMINAL 0x00000648 #define MSR_CONFIG_TDP_LEVEL_1 0x00000649 $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ $ make -C tools/perf O=/tmp/build/perf install-bin CC /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o LD /tmp/build/perf/trace/beauty/tracepoints/perf-in.o LD /tmp/build/perf/trace/beauty/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf make: Leaving directory '/home/acme/git/perf/tools/perf' $ $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after --- before 2020-06-02 10:47:08.486334348 -0300 +++ after 2020-06-02 10:47:33.075008948 -0300 @@ -286,6 +286,8 @@ [0xc0010240 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTL", [0xc0010241 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTR", [0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC", + [0xc0010299 - x86_AMD_V_KVM_MSRs_offset] = "AMD_RAPL_POWER_UNIT", + [0xc001029b - x86_AMD_V_KVM_MSRs_offset] = "AMD_PKG_ENERGY_STATUS", [0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL", [0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN", }; $ Cc: Adrian Hunter Cc: David Ahern Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: Wang Nan Signed-off-by: Arnaldo Carvalho de Melo commit d741cb045cb5552d9e636e7e447f237d3b1667ad Author: Thierry Reding Date: Tue Jun 2 14:29:01 2020 +0200 MAINTAINERS: Add Lee Jones as reviewer for the PWM subsystem Lee has kindly offered his help in sharing the patch review workload for the PWM subsystem. If this works out well between Lee, Uwe and myself it may be a good idea to maintain the subsystem as a group. Acked-by: Lee Jones Signed-off-by: Thierry Reding commit aef1a3799b5cb3ba4841f6034497b179646ccc70 Author: Uwe Kleine-König Date: Thu Apr 16 10:02:45 2020 +0200 pwm: imx27: Fix rounding behavior To not trigger the warnings provided by CONFIG_PWM_DEBUG - use up-rounding in .get_state() - don't divide by the result of a division - don't use the rounded counter value for the period length to calculate the counter value for the duty cycle Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit cad0f2960675261584c14e8f0026cd67c60f4864 Author: Rasmus Villemoes Date: Thu Sep 19 11:17:27 2019 +0200 pwm: rockchip: Simplify rockchip_pwm_get_state() The way state->enabled is computed is rather convoluted and hard to read - both branches of the if() actually do the exact same thing. So remove the if(), and further simplify " ? true : false" to "". Signed-off-by: Rasmus Villemoes Signed-off-by: Thierry Reding commit ca162ce98110b98e7d97b7157328d34dcfdd40a9 Author: Navid Emamdoost Date: Mon Jun 1 02:11:16 2020 -0500 pwm: img: Call pm_runtime_put() in pm_runtime_get_sync() failed case Even in failed case of pm_runtime_get_sync(), the usage_count is incremented. In order to keep the usage_count with correct value call appropriate pm_runtime_put(). Signed-off-by: Navid Emamdoost Signed-off-by: Thierry Reding commit f8665d797b1ce9bd81f7ed7744ef3a18d6b186ea Merge: 62b6e899a0ad cb7ee52284a2 Author: Joonas Lahtinen Date: Tue Jun 2 16:45:05 2020 +0300 Merge tag 'gvt-next-fixes-2020-05-28' of https://github.com/intel/gvt-linux into drm-intel-next-fixes gvt-next-fixes-2020-05-28 - Fix one clang warning on debug only function (Nathan) - Use ARRAY_SIZE for coccicheck warn (Aishwarya) Signed-off-by: Joonas Lahtinen From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20200528033559.GG23961@zhen-hp.sh.intel.com commit a9a1790247bdcf3b1c8e2e5f8fbfc08d77cfd054 Author: Jiri Olsa Date: Tue Jun 2 12:17:36 2020 +0200 perf stat: Ensure group is defined on top of the same cpu mask Jin Yao reported the issue (and posted first versions of this change) with groups being defined over events with different cpu mask. This causes assert aborts in get_group_fd, like: # perf stat -M "C2_Pkg_Residency" -a -- sleep 1 perf: util/evsel.c:1464: get_group_fd: Assertion `!(fd == -1)' failed. Aborted All the events in the group have to be defined over the same cpus so the group_fd can be found for every leader/member pair. Adding check to ensure this condition is met and removing the group (with warning) if we detect mixed cpus, like: $ sudo perf stat -e '{power/energy-cores/,cycles},{instructions,power/energy-cores/}' WARNING: event cpu maps do not match, disabling group: anon group { power/energy-cores/, cycles } anon group { instructions, power/energy-cores/ } Ian asked also for cpu maps details, it's displayed in verbose mode: $ sudo perf stat -e '{cycles,power/energy-cores/}' -v WARNING: group events cpu maps do not match, disabling group: anon group { power/energy-cores/, cycles } power/energy-cores/: 0 cycles: 0-7 anon group { instructions, power/energy-cores/ } instructions: 0-7 power/energy-cores/: 0 Committer testing: [root@seventh ~]# perf stat -e '{power/energy-cores/,cycles},{instructions,power/energy-cores/}' WARNING: grouped events cpus do not match, disabling group: anon group { power/energy-cores/, cycles } anon group { instructions, power/energy-cores/ } ^C Performance counter stats for 'system wide': 12.62 Joules power/energy-cores/ 106,920,637 cycles 80,228,899 instructions # 0.75 insn per cycle 12.62 Joules power/energy-cores/ 14.514476987 seconds time elapsed [root@seventh ~]# But if we put compatible events in each group it works: [root@seventh ~]# perf stat -e '{power/energy-cores/,power/energy-ram/},{instructions,cycles}' -a sleep 2 Performance counter stats for 'system wide': 1.95 Joules power/energy-cores/ 0.92 Joules power/energy-ram/ 29,305,715 instructions # 1.03 insn per cycle 28,423,338 cycles 2.001438142 seconds time elapsed [root@seventh ~]# This needs improvement tho: [root@seventh ~]# perf stat -e '{power/energy-cores/,power/energy-ram/},{instructions,cycles}' sleep 2 Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (power/energy-cores/). /bin/dmesg | grep -i perf may provide additional information. [root@seventh ~]# We need to emit a better message, one stating that the power/ events can't be used for a specific workload, instead it is per-cpu or system wide. Fixes: 6a4bb04caacc8 ("perf tools: Enable grouping logic for parsed events") Co-developed-by: Jin Yao Signed-off-by: Jiri Olsa Acked-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200602101736.GE1112120@krava Signed-off-by: Jin Yao Signed-off-by: Arnaldo Carvalho de Melo commit 62b6e899a0ad4863b2e799f3c10a77116e3cfadc Author: Jani Nikula Date: Tue Jun 2 00:55:09 2020 +0300 drm/i915/params: fix i915.fake_lmem_start module param sysfs permissions fake_lmem_start does not need to be mutable via module param sysfs. It's only used during driver probe. Fixes: 1629224324b6 ("drm/i915/lmem: add the fake lmem region") Cc: Matthew Auld Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200601215510.18379-2-jani.nikula@intel.com (cherry picked from commit f322e851f20e534cf5305332a9ad5eefadb55d56) Signed-off-by: Joonas Lahtinen commit ea2b383ded0f84f310fe330eb43d758f2807e728 Author: Jani Nikula Date: Tue Jun 2 00:55:08 2020 +0300 drm/i915/params: don't expose inject_probe_failure in debugfs The parameter only makes sense as a module parameter only. Fixes: c43c5a8818d4 ("drm/i915/params: add i915 parameters to debugfs") Cc: Juha-Pekka Heikkilä Cc: Venkata Sandeep Dhanalakota Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200601215510.18379-1-jani.nikula@intel.com (cherry picked from commit dbf4081ffb68c0d9b518a34c715a8d8681658411) Signed-off-by: Joonas Lahtinen commit 273500ae71711c040d258a7b3f4b6f44c368fff2 Author: Chris Wilson Date: Mon Jun 1 17:19:42 2020 +0100 drm/i915: Whitelist context-local timestamp in the gen9 cmdparser Allow batch buffers to read their own _local_ cumulative HW runtime of their logical context. Fixes: 0f2f39758341 ("drm/i915: Add gen9 BCS cmdparsing") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: # v5.4+ Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200601161942.30854-1-chris@chris-wilson.co.uk (cherry picked from commit f9496520df11de00fbafc3cbd693b9570d600ab3) Signed-off-by: Joonas Lahtinen commit 882f38b7f6c406e7229e72ee4328b7f1d5938ae7 Author: Ville Syrjälä Date: Wed May 27 23:02:45 2020 +0300 drm/i915: Fix global state use-after-frees with a refcount While the current locking/serialization of the global state suffices for protecting the obj->state access and the actual hardware reprogramming, we do have a problem with accessing the old/new states during nonblocking commits. The state computation and swap will be protected by the crtc locks, but the commit_tails can finish out of order, thus also causing the atomic states to be cleaned up out of order. This would mean the commit that started first but finished last has had its new state freed as the no-longer-needed old state by the other commit. To fix this let's just refcount the states. obj->state amounts to one reference, and the intel_atomic_state holds extra references to both its new and old global obj states. Fixes: 0ef1905ecf2e ("drm/i915: Introduce better global state handling") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200527200245.13184-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit f8c86ffa2800adc80adc679c84c45e0c6b027374) Signed-off-by: Joonas Lahtinen commit 1d7796bdb63a63c9cc8087ffc6daeb36a7c005e1 Author: Sandipan Patra Date: Mon Jun 1 10:50:36 2020 +0530 pwm: tegra: Support dynamic clock frequency configuration Added support for dynamic clock freq configuration in PWM kernel driver. Earlier the PWM driver used to cache boot time clock rate by PWM clock parent during probe. Hence dynamically changing PWM frequency was not possible for all the possible ranges. With this change, dynamic calculation is enabled and it is able to set the requested period from sysfs knob provided the value is supported by clock source. Changes mainly have 2 parts: - Tegra186 and later chips [1] - Tegra210 and prior chips [2] For [1] - Changes implemented to set pwm period dynamically and also checks added to allow only if requested period(ns) is below or equals to higher range. For [2] - Only checks if the requested period(ns) is below or equals to higher range defined by max clock limit. The limitation in Tegra210 or prior chips are due to the reason of having only one PWM controller supporting multiple channels. But later chips have multiple PWM controller instances each having single channel support. Signed-off-by: Sandipan Patra Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit 74db728c0b4c7c0781d439afa6ebc43c76a1f952 Author: Paul Cercueil Date: Wed May 27 13:52:25 2020 +0200 pwm: jz4740: Add support for the JZ4725B The PWM hardware in the JZ4725B works the same as in the JZ4740, but has only six channels available. Signed-off-by: Paul Cercueil Signed-off-by: Thierry Reding commit a020f22a4ff555386f136eb951e16e4cff709e01 Author: Paul Cercueil Date: Wed May 27 13:52:24 2020 +0200 pwm: jz4740: Make PWM start with the active part The PWM in Ingenic SoCs starts in inactive state until the internal timer reaches the duty value, then becomes active until the timer reaches the period value. In theory, we should then use (period - duty) as the real duty value, as a high duty value would otherwise result in the PWM pin being inactive most of the time. This is the reason why the duty value was inverted in the driver until now, but it still had the problem that it would not start with the active part. To address this remaining issue, the common trick is to invert the duty, and invert the polarity when the PWM is enabled. Since the duty was already inverted, and we invert it again, we now program the hardware for the requested duty, and simply invert the polarity when the PWM is enabled. Signed-off-by: Paul Cercueil Signed-off-by: Thierry Reding commit 9017dc4fbd59c09463019ce494cfe36d654495a8 Author: Paul Cercueil Date: Wed May 27 13:52:23 2020 +0200 pwm: jz4740: Enhance precision in calculation of duty cycle Calculating the hardware value for the duty from the hardware value of the period resulted in a precision loss versus calculating it from the clock rate directly. (Also remove a cast that doesn't really need to be here) Fixes: f6b8a5700057 ("pwm: Add Ingenic JZ4740 support") Cc: Suggested-by: Uwe Kleine-König Reviewed-by: Uwe Kleine-König Signed-off-by: Paul Cercueil Signed-off-by: Thierry Reding commit b48d49e0d53a15a82545ae68db54e8abe99a840a Author: Paul Cercueil Date: Wed May 27 13:52:22 2020 +0200 pwm: jz4740: Drop dependency on MACH_INGENIC Depending on MACH_INGENIC prevent us from creating a generic kernel that works on more than one MIPS board. Instead, we just depend on MIPS being set. Acked-by: Uwe Kleine-König Signed-off-by: Paul Cercueil Signed-off-by: Thierry Reding commit 01aa905d4791da7d3630f6030ff99d58105cca00 Author: Hans de Goede Date: Tue May 12 13:00:44 2020 +0200 pwm: lpss: Fix get_state runtime-pm reference handling Before commit cfc4c189bc70 ("pwm: Read initial hardware state at request time"), a driver's get_state callback would get called once per PWM from pwmchip_add(). pwm-lpss' runtime-pm code was relying on this, getting a runtime-pm ref for PWMs which are enabled at probe time from within its get_state callback, before enabling runtime-pm. The change to calling get_state at request time causes a number of problems: 1. PWMs enabled at probe time may get runtime suspended before they are requested, causing e.g. a LCD backlight controlled by the PWM to turn off. 2. When the request happens when the PWM has been runtime suspended, the ctrl register will read all 1 / 0xffffffff, causing get_state to store bogus values in the pwm_state. 3. get_state was using an async pm_runtime_get() call, because it assumed that runtime-pm has not been enabled yet. If shortly after the request an apply call is made, then the pwm_lpss_is_updating() check may trigger because the resume triggered by the pm_runtime_get() call is not complete yet, so the ctrl register still reads all 1 / 0xffffffff. This commit fixes these issues by moving the initial pm_runtime_get() call for PWMs which are enabled at probe time to the pwm_lpss_probe() function; and by making get_state take a runtime-pm ref before reading the ctrl reg. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1828927 Fixes: cfc4c189bc70 ("pwm: Read initial hardware state at request time") Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Thierry Reding commit 4336b9337824a60a0b10013c622caeee99460db5 Author: Oliver O'Halloran Date: Tue Apr 21 18:15:39 2020 +1000 powerpc/pseries: Make vio and ibmebus initcalls pseries specific The vio and ibmebus buses are used for pseries specific paravirtualised devices and currently they're initialised by the generic initcall types. This is mostly fine, but it can result in some nuisance errors in dmesg when booting on PowerNV on some OSes, e.g. [ 2.984439] synth uevent: /devices/vio: failed to send uevent [ 2.984442] vio vio: uevent: failed to send synthetic uevent [ 17.968551] synth uevent: /devices/vio: failed to send uevent [ 17.968554] vio vio: uevent: failed to send synthetic uevent We don't see anything similar for the ibmebus because that depends on !CONFIG_LITTLE_ENDIAN. This patch squashes those by switching to using machine_*_initcall() so the bus type is only registered when the kernel is running on a pseries machine. Signed-off-by: Oliver O'Halloran Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200421081539.7485-1-oohall@gmail.com commit 856c45d8c1a733e10ad82be817202eb32ea4e570 Author: Peter Vasil Date: Tue Apr 28 18:41:50 2020 +0200 pwm: sun4i: Support direct clock output on Allwinner A64 Allwinner A64 is capable of a direct clock output on PWM (see A64 User Manual chapter 3.10). Add support for this in the sun4i PWM driver. Signed-off-by: Peter Vasil Acked-by: Maxime Ripard Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 4296151d231eeee78514bf7f495c46683785255d Author: Eric Farman Date: Tue May 5 14:27:42 2020 +0200 vfio-ccw: Refactor IRQ handlers To simplify future expansion. Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-6-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit 24c986748ba670c903a9d6a11ee96de2b3f5f1b8 Author: Farhan Ali Date: Tue May 5 14:27:41 2020 +0200 vfio-ccw: Introduce a new schib region The schib region can be used by userspace to get the subchannel- information block (SCHIB) for the passthrough subchannel. This can be useful to get information such as channel path information via the SCHIB.PMCW fields. Signed-off-by: Farhan Ali Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-5-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit 600279b52659c8211c6625fb2c9cd8bf8de15061 Author: Eric Farman Date: Tue May 5 14:27:40 2020 +0200 vfio-ccw: Refactor the unregister of the async regions This is mostly for the purposes of a later patch, since we'll need to do the same thing later. While we are at it, move the resulting function call to ahead of the unregistering of the IOMMU notifier, so that it's done in the reverse order of how it was created. Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-4-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit b7701dfbf98327f34966a68c2532730353245d7b Author: Farhan Ali Date: Tue May 5 14:27:39 2020 +0200 vfio-ccw: Register a chp_event callback for vfio-ccw Register the chp_event callback to receive channel path related events for the subchannels managed by vfio-ccw. Signed-off-by: Farhan Ali Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-3-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit 9a44ce6c9b69e15c87c87ef1f1a6972837cff3db Author: Farhan Ali Date: Tue May 5 14:27:38 2020 +0200 vfio-ccw: Introduce new helper functions to free/destroy regions Consolidate some of the cleanup code for the regions, so that as more are added we reduce code duplication. Signed-off-by: Farhan Ali Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Message-Id: <20200505122745.53208-2-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit 430220b0bbcbaaaa03718111ff541ee8cd97c781 Author: Cornelia Huck Date: Tue Apr 7 13:16:05 2020 +0200 vfio-ccw: document possible errors Interacting with the I/O and the async regions can yield a number of errors, which had been undocumented so far. These are part of the api, so remedy that. Signed-off-by: Cornelia Huck Reviewed-by: Eric Farman Message-Id: <20200407111605.1795-1-cohuck@redhat.com> commit 725b94d74128cd208bfdd446ad6b5f4b38cf5395 Author: Jared Rossi Date: Wed May 6 17:24:40 2020 -0400 vfio-ccw: Enable transparent CCW IPL from DASD Remove the explicit prefetch check when using vfio-ccw devices. This check does not trigger in practice as all Linux channel programs are intended to use prefetch. It is expected that all ORBs issued by Linux will request prefetch. Although non-prefetching ORBs are not rejected, they will prefetch nonetheless. A warning is issued up to once per 5 seconds when a forced prefetch occurs. A non-prefetch ORB does not necessarily result in an error, however frequent encounters with non-prefetch ORBs indicate that channel programs are being executed in a way that is inconsistent with what the guest is requesting. While there is currently no known case of an error caused by forced prefetch, it is possible in theory that forced prefetch could result in an error if applied to a channel program that is dependent on non-prefetch. Signed-off-by: Jared Rossi Reviewed-by: Eric Farman Message-Id: <20200506212440.31323-2-jrossi@linux.ibm.com> Signed-off-by: Cornelia Huck commit f44b85da5e7450d0308695ba6f503d75fe6cc166 Author: Andrew Donnellan Date: Tue Jun 2 14:03:41 2020 +1000 cxl: Remove dead Kconfig options The CXL_AFU_DRIVER_OPS and CXL_LIB Kconfig options were added to coordinate merging of new features. They no longer serve any purpose, so remove them. Signed-off-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200602040341.10152-1-ajd@linux.ibm.com commit a3ea40d5c7365e7e5c7c85b6f30b15142b397571 Author: Alistair Popple Date: Thu May 21 11:43:41 2020 +1000 powerpc: Add POWER10 architected mode PVR value of 0x0F000006 means we are arch v3.1 compliant (i.e. POWER10). This is used by phyp and kvm when booting as a pseries guest to detect the presence of new P10 features and to enable the appropriate hwcap and facility bits. Signed-off-by: Alistair Popple Signed-off-by: Cédric Le Goater [mpe: Fall through to __init_FSCR rather than duplicating it, drop hack to set current->thread.fscr now that is handled elsewhere.] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521014341.29095-8-alistair@popple.id.au commit 87939d50e5888bd78478d9aa9455f56b919df658 Author: Alistair Popple Date: Thu May 21 11:43:40 2020 +1000 powerpc/dt_cpu_ftrs: Add MMA feature Matrix multiple assist (MMA) is a new feature added to ISAv3.1 and POWER10. Support on powernv can be selected via a firmware CPU device tree feature which enables it via a PCR bit. Signed-off-by: Alistair Popple Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521014341.29095-7-alistair@popple.id.au commit c63d688c3dabca973c5a7da73d17422ad13f3737 Author: Alistair Popple Date: Thu May 21 11:43:39 2020 +1000 powerpc/dt_cpu_ftrs: Enable Prefixed Instructions Prefix instructions have their own FSCR bit which needs to be enabled via a CPU feature. The kernel will save the FSCR for problem state but it needs to be enabled initially. Signed-off-by: Alistair Popple Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521014341.29095-6-alistair@popple.id.au commit 43d0d37acbe40a9a93d9891ca670638cd22116b1 Author: Alistair Popple Date: Thu May 21 11:43:37 2020 +1000 powerpc/dt_cpu_ftrs: Advertise support for ISA v3.1 if selected On powernv hardware support for ISAv3.1 is advertised via a cpu feature bit in the device tree. This patch enables the associated HWCAP bit if the device tree indicates ISAv3.1 is available. Signed-off-by: Alistair Popple Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521014341.29095-4-alistair@popple.id.au commit 3fd5836ee801ab9ac5b314c26550e209bafa5eaa Author: Alistair Popple Date: Thu May 21 11:43:36 2020 +1000 powerpc: Add support for ISA v3.1 Newer ISA versions are enabled by clearing all bits in the PCR associated with previous versions of the ISA. Enable ISA v3.1 support by updating the PCR mask to include ISA v3.0. This ensures all PCR bits corresponding to earlier architecture versions get cleared thereby enabling ISA v3.1 if supported by the hardware. Signed-off-by: Alistair Popple Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521014341.29095-3-alistair@popple.id.au commit ee988c11acf6f9464b7b44e9a091bf6afb3b3a49 Author: Alistair Popple Date: Thu May 21 11:43:35 2020 +1000 powerpc: Add new HWCAP bits POWER10 introduces two new architectural features - ISAv3.1 and matrix multiply assist (MMA) instructions. Userspace detects the presence of these features via two HWCAP bits introduced in this patch. These bits have been agreed to by the compiler and binutils team. According to ISAv3.1 MMA is an optional feature and software that makes use of it should first check for availability via this HWCAP bit and use alternate code paths if unavailable. Signed-off-by: Alistair Popple Tested-by: Michael Neuling Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521014341.29095-2-alistair@popple.id.au commit c887ef5707591e84f80271e95e99ff9fb38987b5 Author: Michael Ellerman Date: Thu May 28 00:58:43 2020 +1000 powerpc/64s: Don't set FSCR bits in INIT_THREAD Since the previous commit that saves the value of FSCR configured at boot into init_task.thread.fscr, the static initialisation in INIT_THREAD now no longer has any effect. So remove it. For non DT CPU features, the end result is the same, because __init_FSCR() is called on all CPUs that have an FSCR (Power8, Power9), and it sets FSCR_TAR & FSCR_EBB. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200527145843.2761782-4-mpe@ellerman.id.au commit 912c0a7f2b5daa3cbb2bc10f303981e493de73bd Author: Michael Ellerman Date: Thu May 28 00:58:42 2020 +1000 powerpc/64s: Save FSCR to init_task.thread.fscr after feature init At boot the FSCR is initialised via one of two paths. On most systems it's set to a hard coded value in __init_FSCR(). On newer skiboot systems we use the device tree CPU features binding, where firmware can tell Linux what bits to set in FSCR (and HFSCR). In both cases the value that's configured at boot is not propagated into the init_task.thread.fscr value prior to the initial fork of init (pid 1), which means the value is not used by any processes other than swapper (the idle task). For the __init_FSCR() case this is OK, because the value in init_task.thread.fscr is initialised to something sensible. However it does mean that the value set in __init_FSCR() is not used other than for swapper, which is odd and confusing. The bigger problem is for the device tree CPU features case it prevents firmware from setting (or clearing) FSCR bits for use by user space. This means all existing kernels can not have features enabled/disabled by firmware if those features require setting/clearing FSCR bits. We can handle both cases by saving the FSCR value into init_task.thread.fscr after we have initialised it at boot. This fixes the bug for device tree CPU features, and will allow us to simplify the initialisation for the __init_FSCR() case in a future patch. Fixes: 5a61ef74f269 ("powerpc/64s: Support new device tree binding for discovering CPU features") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200527145843.2761782-3-mpe@ellerman.id.au commit 993e3d96fd08c3ebf7566e43be9b8cd622063e6d Author: Michael Ellerman Date: Thu May 28 00:58:41 2020 +1000 powerpc/64s: Don't let DT CPU features set FSCR_DSCR The device tree CPU features binding includes FSCR bit numbers which Linux is instructed to set by firmware. Whether that's a good idea or not, in the case of the DSCR the Linux implementation has a hard requirement that the FSCR_DSCR bit not be set by default. We use it to track when a process reads/writes to DSCR, so it must be clear to begin with. So if firmware tells us to set FSCR_DSCR we must ignore it. Currently this does not cause a bug in our DSCR handling because the value of FSCR that the device tree CPU features code establishes is only used by swapper. All other tasks use the value hard coded in init_task.thread.fscr. However we'd like to fix that in a future commit, at which point this will become necessary. Fixes: 5a61ef74f269 ("powerpc/64s: Support new device tree binding for discovering CPU features") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200527145843.2761782-2-mpe@ellerman.id.au commit 0828137e8f16721842468e33df0460044a0c588b Author: Michael Ellerman Date: Thu May 28 00:58:40 2020 +1000 powerpc/64s: Don't init FSCR_DSCR in __init_FSCR() __init_FSCR() was added originally in commit 2468dcf641e4 ("powerpc: Add support for context switching the TAR register") (Feb 2013), and only set FSCR_TAR. At that point FSCR (Facility Status and Control Register) was not context switched, so the setting was permanent after boot. Later we added initialisation of FSCR_DSCR to __init_FSCR(), in commit 54c9b2253d34 ("powerpc: Set DSCR bit in FSCR setup") (Mar 2013), again that was permanent after boot. Then commit 2517617e0de6 ("powerpc: Fix context switch DSCR on POWER8") (Aug 2013) added a limited context switch of FSCR, just the FSCR_DSCR bit was context switched based on thread.dscr_inherit. That commit said "This clears the H/FSCR DSCR bit initially", but it didn't, it left the initialisation of FSCR_DSCR in __init_FSCR(). However the initial context switch from init_task to pid 1 would clear FSCR_DSCR because thread.dscr_inherit was 0. That commit also introduced the requirement that FSCR_DSCR be clear for user processes, so that we can take the facility unavailable interrupt in order to manage dscr_inherit. Then in commit 152d523e6307 ("powerpc: Create context switch helpers save_sprs() and restore_sprs()") (Dec 2015) FSCR was added to thread_struct. However it still wasn't fully context switched, we just took the existing value and set FSCR_DSCR if the new thread had dscr_inherit set. FSCR was still initialised at boot to FSCR_DSCR | FSCR_TAR, but that value was not propagated into the thread_struct, so the initial context switch set FSCR_DSCR back to 0. Finally commit b57bd2de8c6c ("powerpc: Improve FSCR init and context switching") (Jun 2016) added a full context switch of the FSCR, and added an initialisation of init_task.thread.fscr to FSCR_TAR | FSCR_EBB, but omitted FSCR_DSCR. The end result is that swapper runs with FSCR_DSCR set because of the initialisation in __init_FSCR(), but no other processes do, they use the value from init_task.thread.fscr. Having FSCR_DSCR set for swapper allows it to access SPR 3 from userspace, but swapper never runs userspace, so it has no useful effect. It's also confusing to have the value initialised in two places to two different values. So remove FSCR_DSCR from __init_FSCR(), this at least gets us to the point where there's a single value of FSCR, even if it's still set in two places. Signed-off-by: Michael Ellerman Tested-by: Alistair Popple Link: https://lore.kernel.org/r/20200527145843.2761782-1-mpe@ellerman.id.au commit 74016701fe5f873ae23bf02835407227138d874d Author: Christophe Leroy Date: Sat May 30 17:16:33 2020 +0000 powerpc/32s: Fix another build failure with CONFIG_PPC_KUAP_DEBUG 'thread' doesn't exist in kuap_check() macro. Use 'current' instead. Fixes: a68c31fc01ef ("powerpc/32s: Implement Kernel Userspace Access Protection") Cc: stable@vger.kernel.org Reported-by: kbuild test robot Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b459e1600b969047a74e34251a84a3d6fdf1f312.1590858925.git.christophe.leroy@csgroup.eu commit bd55e792de0844631d34487d43eaf3f13294ebfe Author: Naveen N. Rao Date: Tue Apr 21 23:05:45 2020 +0530 powerpc/module_64: Use special stub for _mcount() with -mprofile-kernel Since commit c55d7b5e64265f ("powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE"), powerpc kernels with -mprofile-kernel can crash in certain scenarios with a trace like below: BUG: Unable to handle kernel instruction fetch (NULL pointer?) Faulting instruction address: 0x00000000 Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV NIP [0000000000000000] 0x0 LR [c0080000102c0048] ext4_iomap_end+0x8/0x30 [ext4] Call Trace: iomap_apply+0x20c/0x920 (unreliable) iomap_bmap+0xfc/0x160 ext4_bmap+0xa4/0x180 [ext4] bmap+0x4c/0x80 jbd2_journal_init_inode+0x44/0x1a0 [jbd2] ext4_load_journal+0x440/0x860 [ext4] ext4_fill_super+0x342c/0x3ab0 [ext4] mount_bdev+0x25c/0x290 ext4_mount+0x28/0x50 [ext4] legacy_get_tree+0x4c/0xb0 vfs_get_tree+0x4c/0x130 do_mount+0xa18/0xc50 sys_mount+0x158/0x180 system_call+0x5c/0x68 The NIP points to NULL, or a random location (data even), while the LR always points to the LEP of a function (with an offset of 8), indicating that something went wrong with ftrace. However, ftrace is not necessarily active when such crashes occur. The kernel OOPS sometimes follows a warning from ftrace indicating that some module functions could not be patched with a nop. Other times, if a module is loaded early during boot, instruction patching can fail due to a separate bug, but the error is not reported due to missing error reporting. In all the above cases when instruction patching fails, ftrace will be disabled but certain kernel module functions will be left with default calls to _mcount(). This is not a problem with ELFv1. However, with -mprofile-kernel, the default stub is problematic since it depends on a valid module TOC in r2. If the kernel (or a different module) calls into a function that does not use the TOC, the function won't have a prologue to setup the module TOC. When that function calls into _mcount(), we will end up in the relocation stub that will use the previous TOC, and end up trying to jump into a random location. From the above trace: iomap_apply+0x20c/0x920 [kernel TOC] | V ext4_iomap_end+0x8/0x30 [no GEP == kernel TOC] | V _mcount() stub [uses kernel TOC -> random entry] To address this, let's change over to using the special stub that is used for ftrace_[regs_]caller() for _mcount(). This ensures that we are not dependent on a valid module TOC in r2 for default _mcount() handling. Reported-by: Qian Cai Signed-off-by: Naveen N. Rao Tested-by: Qian Cai Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8affd4298d22099bbd82544fab8185700a6222b1.1587488954.git.naveen.n.rao@linux.vnet.ibm.com commit 1f2aaed2db03150428dbcd2ddee02ae6cb4bac52 Author: Naveen N. Rao Date: Tue Apr 21 23:05:44 2020 +0530 powerpc/module_64: Simplify check for -mprofile-kernel ftrace relocations For -mprofile-kernel, we need special handling when generating stubs for ftrace calls such as _mcount(). To faciliate this, we check if a R_PPC64_REL24 relocation is for a symbol named "_mcount()" along with also checking the instruction sequence. The latter is not really required since "_mcount()" is an exported symbol and kernel modules cannot use it. As such, drop the additional checking and simplify the code. This helps unify stub creation for ftrace stubs with -mprofile-kernel and aids in code reuse. Also rename is_mprofile_mcount_callsite() to is_mprofile_ftrace_call() to reflect the checking being done. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7d9c316adfa1fb787ad268bb4691e7e4059ff2d5.1587488954.git.naveen.n.rao@linux.vnet.ibm.com commit 03b51416e876aea5e7638947e50831b6c988c246 Author: Naveen N. Rao Date: Tue Apr 21 23:05:43 2020 +0530 powerpc/module_64: Consolidate ftrace code module_trampoline_target() is only used by ftrace. Move the prototype within the appropriate #ifdef in the header. Also, move the function body to the end of module_64.c so as to consolidate all ftrace code in one place. No functional changes. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2527351f65c53c5866068ae130dc34c5d4ee8ad9.1587488954.git.naveen.n.rao@linux.vnet.ibm.com commit 888468ce725a4cd56d72dc7e5096078f7a9251a0 Author: Christophe Leroy Date: Thu May 28 10:17:04 2020 +0000 powerpc/32: Disable KASAN with pages bigger than 16k Mapping of early shadow area is implemented by using a single static page table having all entries pointing to the same early shadow page. The shadow area must therefore occupy full PGD entries. The shadow area has a size of 128MB starting at 0xf8000000. With 4k pages, a PGD entry is 4MB With 16k pages, a PGD entry is 64MB With 64k pages, a PGD entry is 1GB which is too big. Until we rework the early shadow mapping, disable KASAN when the page size is too big. Fixes: 2edb16efc899 ("powerpc/32: Add KASAN support") Cc: stable@vger.kernel.org # v5.2+ Reported-by: kbuild test robot Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7195fcde7314ccbf7a081b356084a69d421b10d4.1590660977.git.christophe.leroy@csgroup.eu commit c3ba4dbbd1d05b49ec01efe098e0a78857d3ce22 Author: Christophe Leroy Date: Wed Apr 15 14:57:11 2020 +0000 powerpc/uaccess: Don't set KUEP by default on book3s/32 On book3s/32, KUEP is an heavy process as it requires to set/unset the NX bit in each of the 12 user segments everytime the kernel is entered/exited from/to user space. Don't select KUEP by default on book3s/32. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1492bb150c1aaa53d99a604b49992e60ea20cd5f.1586962582.git.christophe.leroy@c-s.fr commit 547e687b2981a115814962506068873d24983af7 Author: Christophe Leroy Date: Wed Apr 15 14:57:09 2020 +0000 powerpc/uaccess: Don't set KUAP by default on book3s/32 On book3s/32, KUAP is an heavy process as it requires to determine which segments are impacted and unlock/lock each of them. And since the implementation of user_access_begin/end, it is even worth for the time being because unlike __get_user(), user_access_begin doesn't make difference between read and write and unlocks access also for read allthought that's unneeded on book3s/32. As shown by the size of a kernel built with KUAP and one without, the overhead is 64k bytes of code. As a comparison a similar build on an 8xx has an overhead of only 8k bytes of code. text data bss dec hex filename 7230416 1425868 837376 9493660 90dc9c vmlinux.kuap6xx 7165012 1425548 837376 9427936 8fdbe0 vmlinux.nokuap6xx 6519796 1960028 477464 8957288 88ad68 vmlinux.kuap8xx 6511664 1959864 477464 8948992 888d00 vmlinux.nokuap8xx Until a more optimised KUAP is implemented on book3s/32, don't select it by default. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/154a99399317b096ac1f04827b9f8d7a9179ddc1.1586962586.git.christophe.leroy@c-s.fr commit 332ce969b763553e9c4d55069e1e15aba4ea560f Author: Christophe Leroy Date: Wed Apr 15 10:06:09 2020 +0000 powerpc/8xx: Reduce time spent in allow_user_access() and friends To enable/disable kernel access to user space, the 8xx has to modify the properties of access group 1. This is done by writing predefined values into SPRN_Mx_AP registers. As of today, a __put_user() gives: 00000d64 : d64: 3d 20 4f ff lis r9,20479 d68: 61 29 ff ff ori r9,r9,65535 d6c: 7d 3a c3 a6 mtspr 794,r9 d70: 39 20 00 00 li r9,0 d74: 90 83 00 00 stw r4,0(r3) d78: 3d 20 6f ff lis r9,28671 d7c: 61 29 ff ff ori r9,r9,65535 d80: 7d 3a c3 a6 mtspr 794,r9 d84: 4e 80 00 20 blr Because only groups 0 and 1 are used, the definition of groups 2 to 15 doesn't matter. By setting unused bits to 0 instead on 1, one instruction is removed for each lock and unlock action: 00000d5c : d5c: 3d 20 40 00 lis r9,16384 d60: 7d 3a c3 a6 mtspr 794,r9 d64: 39 20 00 00 li r9,0 d68: 90 83 00 00 stw r4,0(r3) d6c: 3d 20 60 00 lis r9,24576 d70: 7d 3a c3 a6 mtspr 794,r9 d74: 4e 80 00 20 blr Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/57425c33dd72f292b1a23570244b81419072a7aa.1586945153.git.christophe.leroy@c-s.fr commit e51c3e13709fe55d4d0eb50ba435bc53a64152bf Author: Christophe Leroy Date: Tue Mar 31 16:03:47 2020 +0000 powerpc/entry32: Blacklist exception exit points for kprobe. kprobe does not handle events happening in real mode. The very last part of exception exits cannot support a trap. Blacklist them from kprobe. While we are at it, remove exc_exit_start symbol which is not used to avoid having to blacklist it. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/098b0fd3f6299aa1bd692bd576bd7012c84608de.1585670437.git.christophe.leroy@c-s.fr commit 7cdf4401388572f720403a7038a178a4b30ac14c Author: Christophe Leroy Date: Tue Mar 31 16:03:46 2020 +0000 powerpc/entry32: Blacklist syscall exit points for kprobe. kprobe does not handle events happening in real mode. The very last part of syscall cannot support a trap. Add a symbol syscall_exit_finish to identify that part and blacklist it from kprobe. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/23eddf49abb03d1359fa0be4206998eb3800f42c.1585670437.git.christophe.leroy@c-s.fr commit a616c442119f2ea5641e6abc215d7255b73b982b Author: Christophe Leroy Date: Tue Mar 31 16:03:45 2020 +0000 powerpc/entry32: Blacklist exception entry points for kprobe. kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. The handling of TLF_NAPPING and TLF_SLEEPING is moved before the CONFIG_TRACE_IRQFLAGS which contains 'reenable_mmu' because from there kprobe will be possible as the kernel will run with MMU enabled. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f61ac599855e674ebb592464d0ea32a3ba9c6644.1585670437.git.christophe.leroy@c-s.fr commit 5f32e8361cba8c58c4f272a389296f489ecc2823 Author: Christophe Leroy Date: Tue Mar 31 16:03:44 2020 +0000 powerpc/32: Blacklist functions running with MMU disabled for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3bf57066d05518644dee0840af69d36ab5086729.1585670437.git.christophe.leroy@c-s.fr commit 32746dfe4cf37f4077929601e8877a7fd02676e8 Author: Christophe Leroy Date: Tue Mar 31 16:03:43 2020 +0000 powerpc/rtas: Remove machine_check_in_rtas() machine_check_in_rtas() is just a trap. Do the trap directly in the machine check exception handler. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/78899f40f89cb3c4f69bdff7f04eb6ec7cb753d5.1585670437.git.christophe.leroy@c-s.fr commit e6209318d63e2774c5ab214b14b948079e040064 Author: Christophe Leroy Date: Tue Mar 31 16:03:42 2020 +0000 powerpc/32s: Blacklist functions running with MMU disabled for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/dabed523c1b8955dd425152ce260b390053e727a.1585670437.git.christophe.leroy@c-s.fr commit f892c21d2efb3b86ecbf8f5a95ea4abeedcc91b0 Author: Christophe Leroy Date: Tue Mar 31 16:03:41 2020 +0000 powerpc/32s: Make local symbols non visible in hash_low. In hash_low.S, a lot of named local symbols are used instead of numbers to ease code readability. However, they don't need to be visible. In order to ease blacklisting of functions running with MMU disabled for kprobe, rename the symbols to .Lsymbols in order to hide them as if they were numbered labels. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/90c430d9e0f7af772a58aaeaf17bcc6321265340.1585670437.git.christophe.leroy@c-s.fr commit a64371b5d4fb37199dcd04cb7bf0132894018e33 Author: Christophe Leroy Date: Tue Mar 31 16:03:40 2020 +0000 powerpc/mem: Blacklist flush_dcache_icache_phys() for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/eaab3bff961c3bfe149f1d0bd3593291ef939dcc.1585670437.git.christophe.leroy@c-s.fr commit 32a820670fa00419375a964ca8bc569e1499b90d Author: Christophe Leroy Date: Tue Mar 31 16:03:39 2020 +0000 powerpc/powermac: Blacklist functions running with MMU disabled for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6316e8883753499073f47301857e4e88b73c3ddd.1585670437.git.christophe.leroy@c-s.fr commit 7aa85127b1a170694b042cbc35a07afe3904173e Author: Christophe Leroy Date: Tue Mar 31 16:03:38 2020 +0000 powerpc/83xx: Blacklist mpc83xx_deep_resume() for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3ac4ab8dd7008b9706d9228a60645a1756fa84bf.1585670437.git.christophe.leroy@c-s.fr commit 1740f15a99d30a5e2710b2b0754e65fc5ba68d1d Author: Christophe Leroy Date: Tue Mar 31 16:03:37 2020 +0000 powerpc/82xx: Blacklist pq2_restart() for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5dca36682383577a3c2b2bca4d577e8654944461.1585670437.git.christophe.leroy@c-s.fr commit e83f01fdb9143a4f90b17fbf7d8b8b21efb2f968 Author: Christophe Leroy Date: Tue Mar 31 16:03:36 2020 +0000 powerpc/52xx: Blacklist functions running with MMU disabled for kprobe kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1ae02b6637b87fc5aaa1d5012c3e2cb30e62b4a3.1585670437.git.christophe.leroy@c-s.fr commit 9ed5df69b79a22b40b20bc2132ba2495708b19c4 Author: Christophe Leroy Date: Mon Feb 24 18:02:10 2020 +0000 powerpc/kprobes: Use probe_address() to read instructions In order to avoid Oopses, use probe_address() to read the instruction at the address where the trap happened. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7f24b5961a6839ff01df792816807f74ff236bf6.1582567319.git.christophe.leroy@c-s.fr commit 08b1add150a8863665676d0ac9c3ad2d34b2540c Author: Michael Neuling Date: Tue May 19 14:30:09 2020 +1000 powerpc/configs: Add LIBNVDIMM to ppc64_defconfig This gives us OF_PMEM which is useful in mambo. This adds 153K to the text of ppc64le_defconfig which 0.8% of the total text. LIBNVDIMM text data bss dec hex Without 18574833 5518150 1539240 25632223 1871ddf With 18727834 5546206 1539368 25813408 189e1a0 Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200519043009.3081885-1-mikey@neuling.org commit b664db8e3f976d9233cc9ea5e3f8a8c0bcabeb48 Author: Leonardo Bras Date: Mon May 18 20:42:45 2020 -0300 powerpc/rtas: Implement reentrant rtas call Implement rtas_call_reentrant() for reentrant rtas-calls: "ibm,int-on", "ibm,int-off",ibm,get-xive" and "ibm,set-xive". On LoPAPR Version 1.1 (March 24, 2016), from 7.3.10.1 to 7.3.10.4, items 2 and 3 say: 2 - For the PowerPC External Interrupt option: The * call must be reentrant to the number of processors on the platform. 3 - For the PowerPC External Interrupt option: The * argument call buffer for each simultaneous call must be physically unique. So, these rtas-calls can be called in a lockless way, if using a different buffer for each cpu doing such rtas call. For this, it was suggested to add the buffer (struct rtas_args) in the PACA struct, so each cpu can have it's own buffer. The PACA struct received a pointer to rtas buffer, which is allocated in the memory range available to rtas 32-bit. Reentrant rtas calls are useful to avoid deadlocks in crashing, where rtas-calls are needed, but some other thread crashed holding the rtas.lock. This is a backtrace of a deadlock from a kdump testing environment: #0 arch_spin_lock #1 lock_rtas () #2 rtas_call (token=8204, nargs=1, nret=1, outputs=0x0) #3 ics_rtas_mask_real_irq (hw_irq=4100) #4 machine_kexec_mask_interrupts #5 default_machine_crash_shutdown #6 machine_crash_shutdown #7 __crash_kexec #8 crash_kexec #9 oops_end Signed-off-by: Leonardo Bras [mpe: Move under #ifdef PSERIES to avoid build breakage] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200518234245.200672-3-leobras.c@gmail.com commit 783a015b747f606e803b798eb8b50c73c548691d Author: Leonardo Bras Date: Mon May 18 20:42:44 2020 -0300 powerpc/rtas: Move type/struct definitions from rtas.h into rtas-types.h In order to get any rtas* struct into other headers, including rtas.h may cause a lot of errors, regarding include dependency needed for inline functions. Create rtas-types.h and move there all type/struct definitions from rtas.h, then include rtas-types.h into rtas.h. Also, as suggested by checkpath.pl, replace uint8_t for u8. Signed-off-by: Leonardo Bras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200518234245.200672-2-leobras.c@gmail.com commit af2876b501e42c3fb5174cac9dd02598436f0fdf Author: Leonardo Bras Date: Tue May 12 18:45:35 2020 -0300 powerpc/crash: Use NMI context for printk when starting to crash Currently, if printk lock (logbuf_lock) is held by other thread during crash, there is a chance of deadlocking the crash on next printk, and blocking a possibly desired kdump. At the start of default_machine_crash_shutdown, make printk enter NMI context, as it will use per-cpu buffers to store the message, and avoid locking logbuf_lock. Suggested-by: Michael Ellerman Signed-off-by: Leonardo Bras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200512214533.93878-1-leobras.c@gmail.com commit b6eca183e23e7a6625a0d2cdb806b7cd1abcd2d2 Author: Leonardo Bras Date: Thu Apr 2 16:51:57 2020 -0300 powerpc/kernel: Enables memory hot-remove after reboot on pseries guests While providing guests, it's desirable to resize it's memory on demand. By now, it's possible to do so by creating a guest with a small base memory, hot-plugging all the rest, and using 'movable_node' kernel command-line parameter, which puts all hot-plugged memory in ZONE_MOVABLE, allowing it to be removed whenever needed. But there is an issue regarding guest reboot: If memory is hot-plugged, and then the guest is rebooted, all hot-plugged memory goes to ZONE_NORMAL, which offers no guaranteed hot-removal. It usually prevents this memory to be hot-removed from the guest. It's possible to use device-tree information to fix that behavior, as it stores flags for LMB ranges on ibm,dynamic-memory-vN. It involves marking each memblock with the correct flags as hotpluggable memory, which mm/memblock.c puts in ZONE_MOVABLE during boot if 'movable_node' is passed. For carrying such information, the new flag DRCONF_MEM_HOTREMOVABLE was proposed and accepted into Power Architecture documentation. This flag should be: - true (b=1) if the hypervisor may want to hot-remove it later, and - false (b=0) if it does not care. During boot, guest kernel reads the device-tree, early_init_drmem_lmb() is called for every added LMBs. Here, checking for this new flag and marking memblocks as hotplugable memory is enough to get the desirable behavior. This should cause no change if 'movable_node' parameter is not passed in kernel command-line. Signed-off-by: Leonardo Bras Reviewed-by: Bharata B Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200402195156.626430-1-leonardo@linux.ibm.com commit 0e7e92efe11bc5993def689e10f7bcb36f127651 Author: Michael Ellerman Date: Wed May 20 21:17:40 2020 +1000 powerpc/xmon: Show task->thread.regs in process display Show the address of the tasks regs in the process listing in xmon. The regs should always be on the stack page that we also print the address of, but it's still helpful not to have to find them by hand. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200520111740.953679-1-mpe@ellerman.id.au commit 598c01b5b2fca3a9de8ad3400edbff98ec22f0b2 Author: Michael Ellerman Date: Wed May 20 22:12:57 2020 +1000 powerpc/configs/64s: Enable CONFIG_PRINTK_CALLER This adds the CPU or thread number to printk messages. This helps a lot when deciphering concurrent oopses that have been interleaved. Example output, of PID1 (T1) triggering a warning: [ 1.581678][ T1] WARNING: CPU: 0 PID: 1 at crypto/rsa-pkcs1pad.c:539 pkcs1pad_verify+0x38/0x140 [ 1.581681][ T1] Modules linked in: [ 1.581693][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc5-gcc-8.2.0-00121-gf84c2e595927-dirty #1515 [ 1.581700][ T1] NIP: c000000000207d64 LR: c000000000207d3c CTR: c000000000207d2c [ 1.581708][ T1] REGS: c0000000fd2e7560 TRAP: 0700 Not tainted (5.5.0-rc5-gcc-8.2.0-00121-gf84c2e595927-dirty) [ 1.581712][ T1] MSR: 9000000000029033 CR: 44000222 XER: 00040000 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200520121257.961112-1-mpe@ellerman.id.au commit 82a7cebdd95cffa55449d6c1d97cc9b743a66056 Author: Michael Neuling Date: Fri May 29 09:07:31 2020 +1000 powerpc: Fix misleading small cores print Currently when we boot on a big core system, we get this print: [ 0.040500] Using small cores at SMT level This is misleading as we've actually detected big cores. This patch clears up the print to say we've detect big cores but are using small cores for scheduling. Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200528230731.1235752-1-mikey@neuling.org commit 9a2921e5baca1d25eb8d21f21d1e90581a6d0f68 Author: Hari Bathini Date: Wed May 27 15:14:35 2020 +0530 powerpc/fadump: Account for memory_limit while reserving memory If the memory chunk found for reserving memory overshoots the memory limit imposed, do not proceed with reserving memory. Default behavior was this until commit 140777a3d8df ("powerpc/fadump: consider reserved ranges while reserving memory") changed it unwittingly. Fixes: 140777a3d8df ("powerpc/fadump: consider reserved ranges while reserving memory") Cc: stable@vger.kernel.org Reported-by: kbuild test robot Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/159057266320.22331.6571453892066907320.stgit@hbathini.in.ibm.com commit be5470e0c285a68dc3afdea965032f5ddc8269d7 Author: Pingfan Liu Date: Wed Apr 1 22:00:44 2020 +0800 powerpc/crashkernel: Take "mem=" option into account 'mem=" option is an easy way to put high pressure on memory during some test. Hence after applying the memory limit, instead of total mem, the actual usable memory should be considered when reserving mem for crashkernel. Otherwise the boot up may experience OOM issue. E.g. it would reserve 4G prior to the change and 512M afterward, if passing crashkernel="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G", and mem=5G on a 256G machine. This issue is powerpc specific because it puts higher priority on fadump and kdump reservation than on "mem=". Referring the following code: if (fadump_reserve_mem() == 0) reserve_crashkernel(); ... /* Ensure that total memory size is page-aligned. */ limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE); memblock_enforce_memory_limit(limit); While on other arches, the effect of "mem=" takes a higher priority and pass through memblock_phys_mem_size() before calling reserve_crashkernel(). Signed-off-by: Pingfan Liu Reviewed-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1585749644-4148-1-git-send-email-kernelfans@gmail.com commit ef3534a94fdbdeab4c89d18d0164be2ad5d6dbb7 Author: Ravi Bangoria Date: Tue Jun 2 09:42:08 2020 +0530 hw-breakpoints: Fix build warnings with clang kbuild test robot reported some build warnings in the hw_breakpoint code when compiled with clang[1]. Some of them were introduced by the recent powerpc change to add arch_reserve_bp_slot() and arch_release_bp_slot(). Fix them all. kernel/events/hw_breakpoint.c:71:12: warning: no previous prototype for function 'hw_breakpoint_weight' kernel/events/hw_breakpoint.c:216:12: warning: no previous prototype for function 'arch_reserve_bp_slot' kernel/events/hw_breakpoint.c:221:13: warning: no previous prototype for function 'arch_release_bp_slot' kernel/events/hw_breakpoint.c:228:13: warning: no previous prototype for function 'arch_unregister_hw_breakpoint' [1]: https://lore.kernel.org/linuxppc-dev/202005192233.oi9CjRtA%25lkp@intel.com/ Fixes: 29da4f91c0c1 ("powerpc/watchpoint: Don't allow concurrent perf and ptrace events") Reported-by: kbuild test robot Signed-off-by: Ravi Bangoria [mpe: Drop extern, flesh out change log, add Fixes tag] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200602041208.128913-1-ravi.bangoria@linux.ibm.com commit 8bdd79dae1ff5397351b95e249abcae126572617 Author: Lingling Xu Date: Tue Jun 2 16:24:15 2020 +0800 spi: sprd: switch the sequence of setting WDG_LOAD_LOW and _HIGH The watchdog counter consists of WDG_LOAD_LOW and WDG_LOAD_HIGH, which would be loaded to watchdog counter once writing WDG_LOAD_LOW. Fixes: ac1775012058 ("spi: sprd: Add the support of restarting the system") Signed-off-by: Lingling Xu Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20200602082415.5848-1-zhang.lyra@gmail.com Signed-off-by: Mark Brown commit 25de110d148666752dc0e0da7a0b69de31cd7098 Author: Ingo Molnar Date: Tue Jun 2 12:08:39 2020 +0200 irq_work: Define irq_work_single() on !CONFIG_IRQ_WORK too Some SMP platforms don't have CONFIG_IRQ_WORK defined, resulting in a link error at build time. Define a stub and clean up the prototype definitions. Reported-by: kbuild test robot Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 16accae3d97f97d7f61c4ee5d0002bccdef59088 Author: Stephane Eranian Date: Thu May 28 13:16:14 2020 -0700 perf/x86/rapl: Fix RAPL config variable bug This patch fixes a bug introduced by: fd3ae1e1587d6 ("perf/x86/rapl: Move RAPL support to common x86 code") The Kconfig variable name was wrong. It was missing the CONFIG_ prefix. Signed-off-by: Stephane Eranian Signed-off-by: Ingo Molnar Tested-by: Kim Phillips Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200528201614.250182-1-eranian@google.com commit cc69fc4861705c27c0506d39189015d7404129ed Merge: 3d77e6a8804a c4e0f3b24004 79074f61c022 0299a1a81ca0 71974cfb6737 9f510d1e4299 edcc40d2ab5f 736c3333e397 Author: Joerg Roedel Date: Tue Jun 2 10:32:04 2020 +0200 Merge branches 'arm/msm', 'arm/allwinner', 'arm/smmu', 'x86/vt-d', 'hyper-v', 'core' and 'x86/amd' into next commit 5c1bd89b45d4c82316833a8d7ed36720ab89ee3d Author: David Hildenbrand Date: Tue Mar 10 12:54:11 2020 +0100 MAINTAINERS: Add myself as virtio-balloon co-maintainer As suggested by Michael, let's add me as co-maintainer of virtio-balloon. While at it, also add "include/linux/balloon_compaction.h" to the file list. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Greg Kroah-Hartman Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200310115411.12760-1-david@redhat.com Signed-off-by: Michael S. Tsirkin commit 213e77213867e4edbdb342c37ea822feedf4608f Author: Michael S. Tsirkin Date: Thu Apr 23 08:36:57 2020 -0400 vhost: revert "vhost: disable for OABI" This reverts commit d085eb8ce727 ("vhost: disable for OABI") With commit "virtio: force spec specified alignment on types" in place, we force proper alignment for all structures, so there's no longer a reason to blacklist OABI. Signed-off-by: Michael S. Tsirkin commit a865e420b9561235851c3f5d483c82ef389d29bd Author: Michael S. Tsirkin Date: Mon Apr 6 08:42:55 2020 -0400 virtio: force spec specified alignment on types The ring element addresses are passed between components with different alignments assumptions. Thus, if guest/userspace selects a pointer and host then gets and dereferences it, we might need to decrease the compiler-selected alignment to prevent compiler on the host from assuming pointer is aligned. This actually triggers on ARM with -mabi=apcs-gnu - which is a deprecated configuration, but it seems safer to handle this generally. Note that userspace that allocates the memory is actually OK and does not need to be fixed, but userspace that gets it from guest or another process does need to be fixed. The later doesn't generally talk to the kernel so while it might be buggy it's not talking to the kernel in the buggy way - it's just using the header in the buggy way - so fixing header and asking userspace to recompile is the best we can do. I verified that the produced kernel binary on x86 is exactly identical before and after the change. Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 0c35c67412f0ae9ebe1a87cb83bc9de8143438b7 Author: Markus Elfring Date: Sun Apr 5 19:14:10 2020 +0200 virtio-mmio: Delete an error message in vm_find_vqs() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Link: https://lore.kernel.org/r/9e27bc4a-cfa1-7818-dc25-8ad308816b30@web.de Signed-off-by: Michael S. Tsirkin commit e7c8cc35a64d1d21e6fb811c519eadbda30f4f77 Author: Matej Genci Date: Wed Sep 11 12:49:53 2019 +0000 virtio: add VIRTIO_RING_NO_LEGACY Add macro to disable legacy vring functions. Signed-off-by: Matej Genci Link: https://lore.kernel.org/r/20190911124942.243713-1-matej.genci@nutanix.com Signed-off-by: Michael S. Tsirkin commit 36f9967531da27ff8cc6f005d93760b578baffb9 Author: Stefano Stabellini Date: Thu May 21 12:32:42 2020 -0700 9p/xen: increase XEN_9PFS_RING_ORDER Increase XEN_9PFS_RING_ORDER to 9 for performance reason. Order 9 is the max allowed by the protocol. We can't assume that all backends will support order 9. The xenstore property max-ring-page-order specifies the max order supported by the backend. We'll use max-ring-page-order for the size of the ring. This means that the size of the ring is not static (XEN_FLEX_RING_SIZE(9)) anymore. Change XEN_9PFS_RING_SIZE to take an argument and base the calculation on the order chosen at setup time. Finally, modify p9_xen_trans.maxsize to be divided by 4 compared to the original value. We need to divide it by 2 because we have two rings coming off the same order allocation: the in and out rings. This was a mistake in the original code. Also divide it further by 2 because we don't want a single request/reply to fill up the entire ring. There can be multiple requests/replies outstanding at any given time and if we use the full ring with one, we risk forcing the backend to wait for the client to read back more replies before continuing, which is not performant. Link: http://lkml.kernel.org/r/20200521193242.15953-1-sstabellini@kernel.org Signed-off-by: Stefano Stabellini Signed-off-by: Dominique Martinet commit 1cb2c4a2c89b2004a36399860c85a1af9b3fcba7 Author: Rob Clark Date: Mon Jun 1 20:54:50 2020 -0700 Revert "drm/msm/dpu: add support for clk and bw scaling for display" This is causing multiple armv7 missing do_div() errors, so lets drop it for now. This reverts commit 04d9044f6c577948609c03b4e33b8fbc8b87c4b1. Cc: Kalyan Thota Signed-off-by: Rob Clark commit f359287765c04711ff54fbd11645271d8e5ff763 Merge: 8b39a57e9654 c8ffd8bcdd28 Author: Linus Torvalds Date: Mon Jun 1 16:44:06 2020 -0700 Merge branch 'from-miklos' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs updates from Al Viro: "Assorted patches from Miklos. An interesting part here is /proc/mounts stuff..." The "/proc/mounts stuff" is using a cursor for keeeping the location data while traversing the mount listing. Also probably worth noting is the addition of faccessat2(), which takes an additional set of flags to specify how the lookup is done (AT_EACCESS, AT_SYMLINK_NOFOLLOW, AT_EMPTY_PATH). * 'from-miklos' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: add faccessat2 syscall vfs: don't parse "silent" option vfs: don't parse "posixacl" option vfs: don't parse forbidden flags statx: add mount_root statx: add mount ID statx: don't clear STATX_ATIME on SB_RDONLY uapi: deprecate STATX_ALL utimensat: AT_EMPTY_PATH support vfs: split out access_override_creds() proc/mounts: add cursor aio: fix async fsync creds vfs: allow unprivileged whiteout creation commit 8b39a57e965403c12a27d0859901a8a7d1d7318f Merge: 062ea674ae8a 38cdabb7d835 Author: Linus Torvalds Date: Mon Jun 1 16:21:46 2020 -0700 Merge branch 'work.set_fs-exec' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/coredump updates from Al Viro: "set_fs() removal in coredump-related area - mostly Christoph's stuff..." * 'work.set_fs-exec' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: binfmt_elf_fdpic: remove the set_fs(KERNEL_DS) in elf_fdpic_core_dump binfmt_elf: remove the set_fs(KERNEL_DS) in elf_core_dump binfmt_elf: remove the set_fs in fill_siginfo_note signal: refactor copy_siginfo_to_user32 powerpc/spufs: simplify spufs core dumping powerpc/spufs: stop using access_ok powerpc/spufs: fix copy_to_user while atomic commit 062ea674ae8ad93530dbf7176c59daef098863df Merge: 56446efab9ce 0702e4f39034 Author: Linus Torvalds Date: Mon Jun 1 16:19:59 2020 -0700 Merge branch 'uaccess.__copy_to_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/__copy_to_user updates from Al Viro: "Getting rid of __copy_to_user() callers - stuff that doesn't fit into other series" * 'uaccess.__copy_to_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: dlmfs: convert dlmfs_file_read() to copy_to_user() esas2r: don't bother with __copy_to_user() commit 56446efab9ce4961fe0fe6bbc5bc66374b08b9f3 Merge: 4fdea5848b3c ff847781049c Author: Linus Torvalds Date: Mon Jun 1 16:18:46 2020 -0700 Merge branch 'uaccess.__copy_from_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/__copy_from_user updates from Al Viro: "Getting rid of __copy_from_user() callers - patches that don't fit into other series" * 'uaccess.__copy_from_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: pstore: switch to copy_from_user() firewire: switch ioctl_queue_iso to use of copy_from_user() commit 4fdea5848b3c7fb13a0bfd7f768dcf15b534dafe Merge: e148a8f948af ebe6976d3634 Author: Linus Torvalds Date: Mon Jun 1 16:17:04 2020 -0700 Merge branch 'uaccess.__put_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/__put-user updates from Al Viro: "Removal of __put_user() calls - misc patches that don't fit into any other series" * 'uaccess.__put_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: pcm_native: result of put_user() needs to be checked scsi_ioctl.c: switch SCSI_IOCTL_GET_IDLUN to copy_to_user() compat sysinfo(2): don't bother with field-by-field copyout commit e148a8f948afc0b1eeb5c157b23b3d0a4d4517a5 Merge: e0cd9206878a 5fb1514164de Author: Linus Torvalds Date: Mon Jun 1 16:11:38 2020 -0700 Merge branch 'uaccess.readdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/readdir updates from Al Viro: "Finishing the conversion of readdir.c to unsafe_... API. This includes the uaccess_{read,write}_begin series by Christophe Leroy" * 'uaccess.readdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: readdir.c: get rid of the last __put_user(), drop now-useless access_ok() readdir.c: get compat_filldir() more or less in sync with filldir() switch readdir(2) to unsafe_copy_dirent_name() drm/i915/gem: Replace user_access_begin by user_write_access_begin uaccess: Selectively open read or write user access uaccess: Add user_read_access_begin/end and user_write_access_begin/end commit e0cd9206878a3b95024602b355b254d142f5ce94 Merge: 4b01285e1672 87c233b8158a Author: Linus Torvalds Date: Mon Jun 1 16:09:43 2020 -0700 Merge branch 'uaccess.access_ok' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/access_ok updates from Al Viro: "Removals of trivially pointless access_ok() calls. Note: the fiemap stuff was removed from the series, since they are duplicates with part of ext4 series carried in Ted's tree" * 'uaccess.access_ok' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vmci_host: get rid of pointless access_ok() hfi1: get rid of pointless access_ok() usb: get rid of pointless access_ok() calls lpfc_debugfs: get rid of pointless access_ok() efi_test: get rid of pointless access_ok() drm_read(): get rid of pointless access_ok() via-pmu: don't bother with access_ok() drivers/crypto/ccp/sev-dev.c: get rid of pointless access_ok() omapfb: get rid of pointless access_ok() calls amifb: get rid of pointless access_ok() calls drivers/fpga/dfl-afu-dma-region.c: get rid of pointless access_ok() drivers/fpga/dfl-fme-pr.c: get rid of pointless access_ok() cm4000_cs.c cmm_ioctl(): get rid of pointless access_ok() nvram: drop useless access_ok() n_hdlc_tty_read(): remove pointless access_ok() tomoyo_write_control(): get rid of pointless access_ok() btrfs_ioctl_send(): don't bother with access_ok() fat_dir_ioctl(): hadn't needed that access_ok() for more than a decade... dlmfs_file_write(): get rid of pointless access_ok() commit 4b01285e1672ed9342ace952e92eb1e1db7134ae Merge: b23c4771ff62 001c1a655f0a Author: Linus Torvalds Date: Mon Jun 1 16:03:37 2020 -0700 Merge branch 'uaccess.csum' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull uaccess/csum updates from Al Viro: "Regularize the sitation with uaccess checksum primitives: - fold csum_partial_... into csum_and_copy_..._user() - on x86 collapse several access_ok()/stac()/clac() into user_access_begin()/user_access_end()" * 'uaccess.csum' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: default csum_and_copy_to_user(): don't bother with access_ok() take the dummy csum_and_copy_from_user() into net/checksum.h arm: switch to csum_and_copy_from_user() sh32: convert to csum_and_copy_from_user() m68k: convert to csum_and_copy_from_user() xtensa: switch to providing csum_and_copy_from_user() sparc: switch to providing csum_and_copy_from_user() parisc: turn csum_partial_copy_from_user() into csum_and_copy_from_user() alpha: turn csum_partial_copy_from_user() into csum_and_copy_from_user() ia64: turn csum_partial_copy_from_user() into csum_and_copy_from_user() ia64: csum_partial_copy_nocheck(): don't abuse csum_partial_copy_from_user() x86: switch 32bit csum_and_copy_to_user() to user_access_{begin,end}() x86: switch both 32bit and 64bit to providing csum_and_copy_from_user() x86_64: csum_..._copy_..._user(): switch to unsafe_..._user() get rid of csum_partial_copy_to_user() commit 2a975ac9c30c938ee6d4131988045dabca9c7367 Author: Anson Huang Date: Mon Jun 1 18:37:44 2020 +0800 dt-bindings: mailbox: Convert imx mu to json-schema Convert the i.MX MU binding to DT schema format using json-schema Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit e6b12afe659cc97ff3f160e215006e6ccbbd1060 Author: Anson Huang Date: Mon Jun 1 16:06:43 2020 +0800 dt-bindings: power: Convert imx gpcv2 to json-schema Convert the i.MX GPCv2 binding to DT schema format using json-schema Example is updated based on latest DT file and consumer's example is removed since it is NOT that useful. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 0c03fa00fd2f3124cf0d25bdeb5cae2da9888758 Author: Anson Huang Date: Mon Jun 1 16:06:42 2020 +0800 dt-bindings: power: Convert imx gpc to json-schema Convert the i.MX GPC binding to DT schema format using json-schema >From latest reference manual, there is actually ONLY 1 interrupt for GPC, so the additional GPC interrupt is removed. Consumer's example is also removed since it is NOT that useful. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 9a25c1df24a6fea9dc79eec950453c4e00f707fd Merge: efd7ed0f5f2d cf51abcded83 Author: David S. Miller Date: Mon Jun 1 15:53:08 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2020-06-01 The following pull-request contains BPF updates for your *net-next* tree. We've added 55 non-merge commits during the last 1 day(s) which contain a total of 91 files changed, 4986 insertions(+), 463 deletions(-). The main changes are: 1) Add rx_queue_mapping to bpf_sock from Amritha. 2) Add BPF ring buffer, from Andrii. 3) Attach and run programs through devmap, from David. 4) Allow SO_BINDTODEVICE opt in bpf_setsockopt, from Ferenc. 5) link based flow_dissector, from Jakub. 6) Use tracing helpers for lsm programs, from Jiri. 7) Several sk_msg fixes and extensions, from John. ==================== Signed-off-by: David S. Miller commit efd7ed0f5f2d07ccbb1853c5d46656cdfa1371fb Author: Jules Irenge Date: Mon Jun 1 19:45:52 2020 +0100 sfc: add missing annotation for efx_ef10_try_update_nic_stats_vf() Sparse reports a warning at efx_ef10_try_update_nic_stats_vf() warning: context imbalance in efx_ef10_try_update_nic_stats_vf() - unexpected unlock The root cause is the missing annotation at efx_ef10_try_update_nic_stats_vf() Add the missing _must_hold(&efx->stats_lock) annotation Signed-off-by: Jules Irenge Signed-off-by: David S. Miller commit 6abde0b241224347cd88e2ae75902e07f55c42cb Author: Vinay Kumar Yadav Date: Tue Jun 2 00:07:05 2020 +0530 crypto/chtls: IPv6 support for inline TLS Extends support to IPv6 for Inline TLS server. Signed-off-by: Vinay Kumar Yadav v1->v2: - cc'd tcp folks. v2->v3: - changed EXPORT_SYMBOL() to EXPORT_SYMBOL_GPL() Signed-off-by: David S. Miller commit a56772dc3f17f8137aa3227f898e482af2d3bffc Merge: 76d7728db724 055be6865dea Author: David S. Miller Date: Mon Jun 1 15:50:26 2020 -0700 Merge branch 'chelsio-crypto-fixes' Ayush Sawal says: ==================== Fixing compilation warnings and errors Patch 1: Fixes the warnings seen when compiling using sparse tool. Patch 2: Fixes a cocci check error introduced after commit 567be3a5d227 ("crypto: chelsio - Use multiple txq/rxq per tfm to process the requests"). V1->V2 patch1: Avoid type casting by using get_unaligned_be32() and put_unaligned_be16/32() functions. patch2: Modified subject of the patch. ==================== Signed-off-by: David S. Miller commit 055be6865dea6743b090d1c55c8d21a5e01df201 Author: Ayush Sawal Date: Mon Jun 1 23:11:59 2020 +0530 Crypto/chcr: Fixes a coccinile check error This fixes an error observed after running coccinile check. drivers/crypto/chelsio/chcr_algo.c:1462:5-8: Unneeded variable: "err". Return "0" on line 1480 This line is missed in the commit 567be3a5d227 ("crypto: chelsio - Use multiple txq/rxq per tfm to process the requests"). Fixes: 567be3a5d227 ("crypto: chelsio - Use multiple txq/rxq per tfm to process the requests"). V1->V2 -Modified subject. Signed-off-by: Ayush Sawal Signed-off-by: David S. Miller commit f3b140ad8575b74c78be50f34079e1cf43b0302d Author: Ayush Sawal Date: Mon Jun 1 23:11:58 2020 +0530 Crypto/chcr: Fixes compilations warnings This patch fixes the compilation warnings displayed by sparse tool for chcr driver. V1->V2 Avoid type casting by using get_unaligned_be32() and put_unaligned_be16/32() functions. The key which comes from stack is an u8 byte stream so we store it in an unsigned char array(ablkctx->key). The function get_aes_decrypt_key() is a used to calculate the reverse round key for decryption, for this operation the key has to be divided into 4 bytes, so to extract 4 bytes from an u8 byte stream and store it in an u32 variable, get_aligned_be32() is used. Similarly for copying back the key from u32 variable to the original u8 key stream, put_aligned_be32() is used. Signed-off-by: Ayush Sawal Signed-off-by: David S. Miller commit 76d7728db724466490c2c3dd4f84c3357f550615 Author: Rohit Maheshwari Date: Mon Jun 1 19:33:32 2020 +0530 crypto/chcr: IPV6 code needs to be in CONFIG_IPV6 Error messages seen while building kernel with CONFIG_IPV6 disabled. Signed-off-by: Rohit Maheshwari Signed-off-by: David S. Miller commit a3ac249a1ab57552cb2a63e70556ee87610a591d Author: Rohit Maheshwari Date: Mon Jun 1 13:08:29 2020 +0530 cxgb4/chcr: Enable ktls settings at run time Current design enables ktls setting from start, which is not efficient. Now the feature will be enabled when user demands TLS offload on any interface. v1->v2: - taking ULD module refcount till any single connection exists. - taking rtnl_lock() before clearing tls_devops. v2->v3: - cxgb4 is now registering to tlsdev_ops. - module refcount inc/dec in chcr. - refcount is only for connections. - removed new code from cxgb_set_feature(). v3->v4: - fixed warning message. Signed-off-by: Rohit Maheshwari Signed-off-by: David S. Miller commit 79a1f0ccdbb4ad700590f61b00525b390cb53905 Author: Hangbin Liu Date: Mon Jun 1 11:55:03 2020 +0800 ipv6: fix IPV6_ADDRFORM operation logic Socket option IPV6_ADDRFORM supports UDP/UDPLITE and TCP at present. Previously the checking logic looks like: if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE) do_some_check; else if (sk->sk_protocol != IPPROTO_TCP) break; After commit b6f6118901d1 ("ipv6: restrict IPV6_ADDRFORM operation"), TCP was blocked as the logic changed to: if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE) do_some_check; else if (sk->sk_protocol == IPPROTO_TCP) do_some_check; break; else break; Then after commit 82c9ae440857 ("ipv6: fix restrict IPV6_ADDRFORM operation") UDP/UDPLITE were blocked as the logic changed to: if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE) do_some_check; if (sk->sk_protocol == IPPROTO_TCP) do_some_check; if (sk->sk_protocol != IPPROTO_TCP) break; Fix it by using Eric's code and simply remove the break in TCP check, which looks like: if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE) do_some_check; else if (sk->sk_protocol == IPPROTO_TCP) do_some_check; else break; Fixes: 82c9ae440857 ("ipv6: fix restrict IPV6_ADDRFORM operation") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit b23c4771ff62de8ca9b5e4a2d64491b2fb6f8f69 Merge: c2b0fc847f31 e35b5a4c494a Author: Linus Torvalds Date: Mon Jun 1 15:45:27 2020 -0700 Merge tag 'docs-5.8' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "A fair amount of stuff this time around, dominated by yet another massive set from Mauro toward the completion of the RST conversion. I *really* hope we are getting close to the end of this. Meanwhile, those patches reach pretty far afield to update document references around the tree; there should be no actual code changes there. There will be, alas, more of the usual trivial merge conflicts. Beyond that we have more translations, improvements to the sphinx scripting, a number of additions to the sysctl documentation, and lots of fixes" * tag 'docs-5.8' of git://git.lwn.net/linux: (130 commits) Documentation: fixes to the maintainer-entry-profile template zswap: docs/vm: Fix typo accept_threshold_percent in zswap.rst tracing: Fix events.rst section numbering docs: acpi: fix old http link and improve document format docs: filesystems: add info about efivars content Documentation: LSM: Correct the basic LSM description mailmap: change email for Ricardo Ribalda docs: sysctl/kernel: document unaligned controls Documentation: admin-guide: update bug-hunting.rst docs: sysctl/kernel: document ngroups_max nvdimm: fixes to maintainter-entry-profile Documentation/features: Correct RISC-V kprobes support entry Documentation/features: Refresh the arch support status files Revert "docs: sysctl/kernel: document ngroups_max" docs: move locking-specific documents to locking/ docs: move digsig docs to the security book docs: move the kref doc into the core-api book docs: add IRQ documentation at the core-api book docs: debugging-via-ohci1394.txt: add it to the core-api book docs: fix references for ipmi.rst file ... commit c2b0fc847f3122e5a4176c3772626a7a8facced0 Merge: 533b220f7be4 fb597f2a3932 Author: Linus Torvalds Date: Mon Jun 1 15:36:32 2020 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - remove a now unnecessary usage of the KERNEL_DS for sys_oabi_epoll_ctl() - update my email address in a number of drivers - decompressor EFI updates from Ard Biesheuvel - module unwind section handling updates - sparsemem Kconfig cleanups - make act_mm macro respect THREAD_SIZE * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8980/1: Allow either FLATMEM or SPARSEMEM on the multiplatform build ARM: 8979/1: Remove redundant ARCH_SPARSEMEM_DEFAULT setting ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE ARM: decompressor: run decompressor in place if loaded via UEFI ARM: decompressor: move GOT into .data for EFI enabled builds ARM: decompressor: defer loading of the contents of the LC0 structure ARM: decompressor: split off _edata and stack base into separate object ARM: decompressor: move headroom variable out of LC0 ARM: 8976/1: module: allow arch overrides for .init section names ARM: 8975/1: module: fix handling of unwind init sections ARM: 8974/1: use SPARSMEM_STATIC when SPARSEMEM is enabled ARM: 8971/1: replace the sole use of a symbol with its definition ARM: 8969/1: decompressor: simplify libfdt builds Update rmk's email address in various drivers ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl() commit 4c21daae3dbc9f8536cc18e6e53627821fa2c90c Author: YueHaibing Date: Thu May 28 22:34:07 2020 +0800 tipc: Fix NULL pointer dereference in __tipc_sendstream() tipc_sendstream() may send zero length packet, then tipc_msg_append() do not alloc skb, skb_peek_tail() will get NULL, msg_set_ack_required will trigger NULL pointer dereference. Reported-by: syzbot+8eac6d030e7807c21d32@syzkaller.appspotmail.com Fixes: 0a3e060f340d ("tipc: add test for Nagle algorithm effectiveness") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit cf51abcded837ef209faa03a62b2ea44e45995e8 Merge: febeb6dff7be 06716e04a043 Author: Alexei Starovoitov Date: Mon Jun 1 15:21:03 2020 -0700 Merge branch 'Link-based-attach-to-netns' Jakub Sitnicki says: ==================== One of the pieces of feedback from recent review of BPF hooks for socket lookup [0] was that new program types should use bpf_link-based attachment. This series introduces new bpf_link type for attaching to network namespace. All link operations are supported. Errors returned from ops follow cgroup example. Patch 4 description goes into error semantics. The major change in v2 is a switch away from RCU to mutex-only synchronization. Andrii pointed out that it is not needed, and it makes sense to keep locking straightforward. Also, there were a couple of bugs in update_prog and fill_info initial implementation, one picked up by kbuild. Those are now fixed. Tests have been extended to cover them. Full changelog below. Series is organized as so: Patches 1-3 prepare a space in struct net to keep state for attached BPF programs, and massage the code in flow_dissector to make it attach type agnostic, to finally move it under kernel/bpf/. Patch 4, the most important one, introduces new bpf_link link type for attaching to network namespace. Patch 5 unifies the update error (ENOLINK) between BPF cgroup and netns. Patches 6-8 make libbpf and bpftool aware of the new link type. Patches 9-12 Add and extend tests to check that link low- and high-level API for operating on links to netns works as intended. Thanks to Alexei, Andrii, Lorenz, Marek, and Stanislav for feedback. -jkbs [0] https://lore.kernel.org/bpf/20200511185218.1422406-1-jakub@cloudflare.com/ Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Lorenz Bauer Cc: Marek Majkowski Cc: Stanislav Fomichev v1 -> v2: - Switch to mutex-only synchronization. Don't rely on RCU grace period guarantee when accessing struct net from link release / update / fill_info, and when accessing bpf_link from pernet pre_exit callback. (Andrii) - Drop patch 1, no longer needed with mutex-only synchronization. - Don't leak uninitialized variable contents from fill_info callback when link is in defunct state. (kbuild) - Make fill_info treat the link as defunct (i.e. no attached netns) when struct net refcount is 0, but link has not been yet auto-detached. - Add missing BPF_LINK_TYPE define in bpf_types.h for new link type. - Fix link update_prog callback to update the prog that will run, and not just the link itself. - Return EEXIST on prog attach when link already exists, and on link create when prog is already attached directly. (Andrii) - Return EINVAL on prog detach when link is attached. (Andrii) - Fold __netns_bpf_link_attach into its only caller. (Stanislav) - Get rid of a wrapper around container_of() (Andrii) - Use rcu_dereference_protected instead of rcu_access_pointer on update-side. (Stanislav) - Make return-on-success from netns_bpf_link_create less confusing. (Andrii) - Adapt bpf_link for cgroup to return ENOLINK when updating a defunct link. (Andrii, Alexei) - Order new exported symbols in libbpf.map alphabetically (Andrii) - Keep libbpf's "failed to attach link" warning message clear as to what we failed to attach to (cgroup vs netns). (Andrii) - Extract helpers for printing link attach type. (bpftool, Andrii) - Switch flow_dissector tests to BPF skeleton and extend them to exercise link-based flow dissector attachment. (Andrii) - Harden flow dissector attachment tests with prog query checks after prog attach/detach, or link create/update/close. - Extend flow dissector tests to cover fill_info for defunct links. - Rebase onto recent bpf-next ==================== Signed-off-by: Alexei Starovoitov commit 06716e04a043aa5e010f952a823ad038054b0e5c Author: Jakub Sitnicki Date: Sun May 31 10:28:46 2020 +0200 selftests/bpf: Extend test_flow_dissector to cover link creation Extend the existing flow_dissector test case to run tests once using direct prog attachments, and then for the second time using indirect attachment via link. The intention is to exercises the newly added high-level API for attaching programs to network namespace with links (bpf_program__attach_netns). Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-13-jakub@cloudflare.com commit b4b8a3bf9ef0fbbf343b624d68ea328dd4edd5c4 Author: Jakub Sitnicki Date: Sun May 31 10:28:45 2020 +0200 selftests/bpf: Convert test_flow_dissector to use BPF skeleton Switch flow dissector test setup from custom BPF object loader to BPF skeleton to save boilerplate and prepare for testing higher-level API for attaching flow dissector with bpf_link. To avoid depending on program order in the BPF object when populating the flow dissector PROG_ARRAY map, change the program section names to contain the program index into the map. This follows the example set by tailcall tests. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-12-jakub@cloudflare.com commit b8215dce7dfd817ca38807f55165bf502146cd68 Author: Jakub Sitnicki Date: Sun May 31 10:28:44 2020 +0200 selftests/bpf, flow_dissector: Close TAP device FD after the test test_flow_dissector leaves a TAP device after it's finished, potentially interfering with other tests that will run after it. Fix it by closing the TAP descriptor on cleanup. Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode") Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-11-jakub@cloudflare.com commit 1f043f87bb595bbe6c7e6b291d115284840a6c33 Author: Jakub Sitnicki Date: Sun May 31 10:28:43 2020 +0200 selftests/bpf: Add tests for attaching bpf_link to netns Extend the existing test case for flow dissector attaching to cover: - link creation, - link updates, - link info querying, - mixing links with direct prog attachment. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-10-jakub@cloudflare.com commit e948947a6e111b3d4bbe538105ee2f3611e032ad Author: Jakub Sitnicki Date: Sun May 31 10:28:42 2020 +0200 bpftool: Support link show for netns-attached links Make `bpf link show` aware of new link type, that is links attached to netns. When listing netns-attached links, display netns inode number as its identifier and link attach type. Sample session: # readlink /proc/self/ns/net net:[4026532251] # bpftool prog show 357: flow_dissector tag a04f5eef06a7f555 gpl loaded_at 2020-05-30T16:53:51+0200 uid 0 xlated 16B jited 37B memlock 4096B 358: flow_dissector tag a04f5eef06a7f555 gpl loaded_at 2020-05-30T16:53:51+0200 uid 0 xlated 16B jited 37B memlock 4096B # bpftool link show 108: netns prog 357 netns_ino 4026532251 attach_type flow_dissector # bpftool link -jp show [{ "id": 108, "type": "netns", "prog_id": 357, "netns_ino": 4026532251, "attach_type": "flow_dissector" } ] (... after netns is gone ...) # bpftool link show 108: netns prog 357 netns_ino 0 attach_type flow_dissector # bpftool link -jp show [{ "id": 108, "type": "netns", "prog_id": 357, "netns_ino": 0, "attach_type": "flow_dissector" } ] Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-9-jakub@cloudflare.com commit be6e19818ba626eb1b354490aee40a2cfc1a219f Author: Jakub Sitnicki Date: Sun May 31 10:28:41 2020 +0200 bpftool: Extract helpers for showing link attach type Code for printing link attach_type is duplicated in a couple of places, and likely will be duplicated for future link types as well. Create helpers to prevent duplication. Suggested-by: Andrii Nakryiko Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-8-jakub@cloudflare.com commit d60d81acc2c180e33244857e35ef60072573b000 Author: Jakub Sitnicki Date: Sun May 31 10:28:40 2020 +0200 libbpf: Add support for bpf_link-based netns attachment Add bpf_program__attach_nets(), which uses LINK_CREATE subcommand to create an FD-based kernel bpf_link, for attach types tied to network namespace, that is BPF_FLOW_DISSECTOR for the moment. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-7-jakub@cloudflare.com commit 0c047ecbb7bab4c1d2136f5f04bb47a66a9a12b8 Author: Jakub Sitnicki Date: Sun May 31 10:28:39 2020 +0200 bpf, cgroup: Return ENOLINK for auto-detached links on update Failure to update a bpf_link because it has been auto-detached by a dying cgroup currently results in EINVAL error, even though the arguments passed to bpf() syscall are not wrong. bpf_links attaching to netns in this case will return ENOLINK, which carries the message that the link is no longer attached to anything. Change cgroup bpf_links to do the same to keep the uAPI errors consistent. Fixes: 0c991ebc8c69 ("bpf: Implement bpf_prog replacement for an active bpf_cgroup_link") Suggested-by: Lorenz Bauer Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-6-jakub@cloudflare.com commit 7f045a49fee04b5662cbdeaf0838f9322ae8c63a Author: Jakub Sitnicki Date: Sun May 31 10:28:38 2020 +0200 bpf: Add link-based BPF program attachment to network namespace Extend bpf() syscall subcommands that operate on bpf_link, that is LINK_CREATE, LINK_UPDATE, OBJ_GET_INFO, to accept attach types tied to network namespaces (only flow dissector at the moment). Link-based and prog-based attachment can be used interchangeably, but only one can exist at a time. Attempts to attach a link when a prog is already attached directly, and the other way around, will be met with -EEXIST. Attempts to detach a program when link exists result in -EINVAL. Attachment of multiple links of same attach type to one netns is not supported with the intention to lift the restriction when a use-case presents itself. Because of that link create returns -E2BIG when trying to create another netns link, when one already exists. Link-based attachments to netns don't keep a netns alive by holding a ref to it. Instead links get auto-detached from netns when the latter is being destroyed, using a pernet pre_exit callback. When auto-detached, link lives in defunct state as long there are open FDs for it. -ENOLINK is returned if a user tries to update a defunct link. Because bpf_link to netns doesn't hold a ref to struct net, special care is taken when releasing, updating, or filling link info. The netns might be getting torn down when any of these link operations are in progress. That is why auto-detach and update/release/fill_info are synchronized by the same mutex. Also, link ops have to always check if auto-detach has not happened yet and if netns is still alive (refcnt > 0). Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-5-jakub@cloudflare.com commit b27f7bb590ba835b32ef122389db158e44cfda1e Author: Jakub Sitnicki Date: Sun May 31 10:28:37 2020 +0200 flow_dissector: Move out netns_bpf prog callbacks Move functions to manage BPF programs attached to netns that are not specific to flow dissector to a dedicated module named bpf/net_namespace.c. The set of functions will grow with the addition of bpf_link support for netns attached programs. This patch prepares ground by creating a place for it. This is a code move with no functional changes intended. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-4-jakub@cloudflare.com commit a3fd7ceee05431d2c51ed86c6cae015d236a51f0 Author: Jakub Sitnicki Date: Sun May 31 10:28:36 2020 +0200 net: Introduce netns_bpf for BPF programs attached to netns In order to: (1) attach more than one BPF program type to netns, or (2) support attaching BPF programs to netns with bpf_link, or (3) support multi-prog attach points for netns we will need to keep more state per netns than a single pointer like we have now for BPF flow dissector program. Prepare for the above by extracting netns_bpf that is part of struct net, for storing all state related to BPF programs attached to netns. Turn flow dissector callbacks for querying/attaching/detaching a program into generic ones that operate on netns_bpf. Next patch will move the generic callbacks into their own module. This is similar to how it is organized for cgroup with cgroup_bpf. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Cc: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20200531082846.2117903-3-jakub@cloudflare.com commit 171526f6fee84de0c39e2b7aa7e666ba0bbfd173 Author: Jakub Sitnicki Date: Sun May 31 10:28:35 2020 +0200 flow_dissector: Pull locking up from prog attach callback Split out the part of attach callback that happens with attach/detach lock acquired. This structures the prog attach callback in a way that opens up doors for moving the locking out of flow_dissector and into generic callbacks for attaching/detaching progs to netns in subsequent patches. Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Reviewed-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20200531082846.2117903-2-jakub@cloudflare.com commit 533b220f7be4e461a5222a223d169b42856741ef Merge: 3ee3723b40d5 082af5ec5080 Author: Linus Torvalds Date: Mon Jun 1 15:18:27 2020 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Will Deacon: "A sizeable pile of arm64 updates for 5.8. Summary below, but the big two features are support for Branch Target Identification and Clang's Shadow Call stack. The latter is currently arm64-only, but the high-level parts are all in core code so it could easily be adopted by other architectures pending toolchain support Branch Target Identification (BTI): - Support for ARMv8.5-BTI in both user- and kernel-space. This allows branch targets to limit the types of branch from which they can be called and additionally prevents branching to arbitrary code, although kernel support requires a very recent toolchain. - Function annotation via SYM_FUNC_START() so that assembly functions are wrapped with the relevant "landing pad" instructions. - BPF and vDSO updates to use the new instructions. - Addition of a new HWCAP and exposure of BTI capability to userspace via ID register emulation, along with ELF loader support for the BTI feature in .note.gnu.property. - Non-critical fixes to CFI unwind annotations in the sigreturn trampoline. Shadow Call Stack (SCS): - Support for Clang's Shadow Call Stack feature, which reserves platform register x18 to point at a separate stack for each task that holds only return addresses. This protects function return control flow from buffer overruns on the main stack. - Save/restore of x18 across problematic boundaries (user-mode, hypervisor, EFI, suspend, etc). - Core support for SCS, should other architectures want to use it too. - SCS overflow checking on context-switch as part of the existing stack limit check if CONFIG_SCHED_STACK_END_CHECK=y. CPU feature detection: - Removed numerous "SANITY CHECK" errors when running on a system with mismatched AArch32 support at EL1. This is primarily a concern for KVM, which disabled support for 32-bit guests on such a system. - Addition of new ID registers and fields as the architecture has been extended. Perf and PMU drivers: - Minor fixes and cleanups to system PMU drivers. Hardware errata: - Unify KVM workarounds for VHE and nVHE configurations. - Sort vendor errata entries in Kconfig. Secure Monitor Call Calling Convention (SMCCC): - Update to the latest specification from Arm (v1.2). - Allow PSCI code to query the SMCCC version. Software Delegated Exception Interface (SDEI): - Unexport a bunch of unused symbols. - Minor fixes to handling of firmware data. Pointer authentication: - Add support for dumping the kernel PAC mask in vmcoreinfo so that the stack can be unwound by tools such as kdump. - Simplification of key initialisation during CPU bringup. BPF backend: - Improve immediate generation for logical and add/sub instructions. vDSO: - Minor fixes to the linker flags for consistency with other architectures and support for LLVM's unwinder. - Clean up logic to initialise and map the vDSO into userspace. ACPI: - Work around for an ambiguity in the IORT specification relating to the "num_ids" field. - Support _DMA method for all named components rather than only PCIe root complexes. - Minor other IORT-related fixes. Miscellaneous: - Initialise debug traps early for KGDB and fix KDB cacheflushing deadlock. - Minor tweaks to early boot state (documentation update, set TEXT_OFFSET to 0x0, increase alignment of PE/COFF sections). - Refactoring and cleanup" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (148 commits) KVM: arm64: Move __load_guest_stage2 to kvm_mmu.h KVM: arm64: Check advertised Stage-2 page size capability arm64/cpufeature: Add get_arm64_ftr_reg_nowarn() ACPI/IORT: Remove the unused __get_pci_rid() arm64/cpuinfo: Add ID_MMFR4_EL1 into the cpuinfo_arm64 context arm64/cpufeature: Add remaining feature bits in ID_AA64PFR1 register arm64/cpufeature: Add remaining feature bits in ID_AA64PFR0 register arm64/cpufeature: Add remaining feature bits in ID_AA64ISAR0 register arm64/cpufeature: Add remaining feature bits in ID_MMFR4 register arm64/cpufeature: Add remaining feature bits in ID_PFR0 register arm64/cpufeature: Introduce ID_MMFR5 CPU register arm64/cpufeature: Introduce ID_DFR1 CPU register arm64/cpufeature: Introduce ID_PFR2 CPU register arm64/cpufeature: Make doublelock a signed feature in ID_AA64DFR0 arm64/cpufeature: Drop TraceFilt feature exposure from ID_DFR0 register arm64/cpufeature: Add explicit ftr_id_isar0[] for ID_ISAR0 register arm64: mm: Add asid_gen_match() helper firmware: smccc: Fix missing prototype warning for arm_smccc_version_init arm64: vdso: Fix CFI directives in sigreturn trampoline arm64: vdso: Don't prefix sigreturn trampoline with a BTI C instruction ... commit 3ee3723b40d55f473b8c82c60ed0e67f1f9ec6b9 Merge: 4e909124f8ed 3381df095419 Author: Linus Torvalds Date: Mon Jun 1 15:17:16 2020 -0700 Merge tag 'm68k-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - several Mac fixes - defconfig updates - minor cleanups and fixes * tag 'm68k-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: tools: Replace zero-length array with flexible-array member m68k: Add missing __user annotation in get_user() m68k: mac: Avoid stuck ISM IOP interrupt on Quadra 900/950 m68k: mac: Remove misleading comment m68k: mac: Don't call via_flush_cache() on Mac IIfx m68k: defconfig: Update defconfigs for v5.7-rc1 m68k: amiga: config: Replace zero-length array with flexible-array member m68k: amiga: config: Mark expected switch fall-through commit febeb6dff7beafcaf89521f6c8ff7b0adac08d54 Author: Andrii Nakryiko Date: Mon Jun 1 13:26:01 2020 -0700 libbpf: Add _GNU_SOURCE for reallocarray to ringbuf.c On systems with recent enough glibc, reallocarray compat won't kick in, so reallocarray() itself has to come from stdlib.h include. But _GNU_SOURCE is necessary to enable it. So add it. Fixes: bf99c936f947 ("libbpf: Add BPF ring buffer support") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200601202601.2139477-1-andriin@fb.com commit 958a3f2d2aff896ae2a622878e456114f4a4cd15 Author: Jiri Olsa Date: Sun May 31 17:42:55 2020 +0200 bpf: Use tracing helpers for lsm programs Currenty lsm uses bpf_tracing_func_proto helpers which do not include stack trace or perf event output. It's useful to have those for bpftrace lsm support [1]. Using tracing_prog_func_proto helpers for lsm programs. [1] https://github.com/iovisor/bpftrace/pull/1347 Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Cc: KP Singh Link: https://lore.kernel.org/bpf/20200531154255.896551-1-jolsa@kernel.org commit 1b698fa5d8ef958007c455e316aa44c37ab3c5fb Author: Lorenzo Bianconi Date: Thu May 28 22:47:29 2020 +0200 xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame In order to use standard 'xdp' prefix, rename convert_to_xdp_frame utility routine in xdp_convert_buff_to_frame and replace all the occurrences Signed-off-by: Lorenzo Bianconi Signed-off-by: Alexei Starovoitov Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/6344f739be0d1a08ab2b9607584c4d5478c8c083.1590698295.git.lorenzo@kernel.org commit fc37987265b5979129a72c672b20245119768fb8 Author: Lorenzo Bianconi Date: Thu May 28 22:47:28 2020 +0200 xdp: Introduce xdp_convert_frame_to_buff utility routine Introduce xdp_convert_frame_to_buff utility routine to initialize xdp_buff fields from xdp_frames ones. Rely on xdp_convert_frame_to_buff in veth xdp code. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi Signed-off-by: Alexei Starovoitov Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/87acf133073c4b2d4cbb8097e8c2480c0a0fac32.1590698295.git.lorenzo@kernel.org commit c48a24f00e7a8b90c817e3f7aa800a3150bb83d0 Merge: bb2359f4dbe9 9c441fe4c06a Author: Alexei Starovoitov Date: Mon Jun 1 14:57:15 2020 -0700 Merge branch 'bpf_setsockopt-SO_BINDTODEVICE' Ferenc Fejes says: ==================== This option makes it possible to programatically bind sockets to netdevices. With the help of this option sockets of VRF unaware applications could be distributed between multiple VRFs with an eBPF program. This lets the applications benefit from multiple possible routes. v2: - splitting up the patch to three parts - lock_sk parameter for optional locking in sock_bindtoindex - Stanislav Fomichev - testing the SO_BINDTODEVICE option - Andrii Nakryiko ==================== Signed-off-by: Alexei Starovoitov commit 9c441fe4c06a553ad770b6f21616327a3badf793 Author: Ferenc Fejes Date: Sat May 30 23:09:02 2020 +0200 selftests/bpf: Add test for SO_BINDTODEVICE opt of bpf_setsockopt This test intended to verify if SO_BINDTODEVICE option works in bpf_setsockopt. Because we already in the SOL_SOCKET level in this connect bpf prog its safe to verify the sanity in the beginning of the connect_v4_prog by calling the bind_to_device test helper. The testing environment already created by the test_sock_addr.sh script so this test assume that two netdevices already existing in the system: veth pair with names test_sock_addr1 and test_sock_addr2. The test will try to bind the socket to those devices first. Then the test assume there are no netdevice with "nonexistent_dev" name so the bpf_setsockopt will give use ENODEV error. At the end the test remove the device binding from the socket by binding it to an empty name. Signed-off-by: Ferenc Fejes Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/3f055b8e45c65639c5c73d0b4b6c589e60b86f15.1590871065.git.fejes@inf.elte.hu commit 70c58997c1e864c96dfdf072572047303db8f42a Author: Ferenc Fejes Date: Sat May 30 23:09:01 2020 +0200 bpf: Allow SO_BINDTODEVICE opt in bpf_setsockopt Extending the supported sockopts in bpf_setsockopt with SO_BINDTODEVICE. We call sock_bindtoindex with parameter lock_sk = false in this context because we already owning the socket. Signed-off-by: Ferenc Fejes Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/4149e304867b8d5a606a305bc59e29b063e51f49.1590871065.git.fejes@inf.elte.hu commit 8ea204c2b658eaef55b4716fde469fb66c589a3d Author: Ferenc Fejes Date: Sat May 30 23:09:00 2020 +0200 net: Make locking in sock_bindtoindex optional The sock_bindtoindex intended for kernel wide usage however it will lock the socket regardless of the context. This modification relax this behavior optionally: locking the socket will be optional by calling the sock_bindtoindex with lock_sk = true. The modification applied to all users of the sock_bindtoindex. Signed-off-by: Ferenc Fejes Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/bee6355da40d9e991b2f2d12b67d55ebb5f5b207.1590871065.git.fejes@inf.elte.hu commit 4e909124f8ed54b13e07e42273c3452b7deb5a0b Merge: 88bc1de11cf5 cd2f45b7514c Author: Linus Torvalds Date: Mon Jun 1 14:50:41 2020 -0700 Merge tag 'x86-vdso-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 vdso updates from Ingo Molnar: "Clean up various aspects of the vDSO code, no change in functionality intended" * tag 'x86-vdso-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/vdso/Makefile: Add vobjs32 x86/vdso/vdso2c: Convert iterators to unsigned x86/vdso/vdso2c: Correct error messages on file open commit bb2359f4dbe98e8863b4e885fc09269ef4682ec3 Author: Denis Efremov Date: Mon Jun 1 19:28:14 2020 +0300 bpf: Change kvfree to kfree in generic_map_lookup_batch() buf_prevkey in generic_map_lookup_batch() is allocated with kmalloc(). It's safe to free it with kfree(). Fixes: cb4d03ab499d ("bpf: Add generic support for lookup batch op") Signed-off-by: Denis Efremov Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200601162814.17426-1-efremov@linux.com Signed-off-by: Alexei Starovoitov commit 7b805819c412e822c0bd58252b46188cddc60300 Merge: df8fe57c071c 463bac5f1ca7 Author: Alexei Starovoitov Date: Mon Jun 1 14:16:48 2020 -0700 Merge branch 'fix-ktls-with-sk_skb_verdict' John Fastabend says: ==================== If a socket is running a BPF_SK_SKB_SREAM_VERDICT program and KTLS is enabled the data stream may be broken if both TLS stream parser and BPF stream parser try to handle data. Fix this here by making KTLS stream parser run first to ensure TLS messages are received correctly and then calling the verdict program. This analogous to how we handle a similar conflict on the TX side. Note, this is a fix but it doesn't make sense to push this late to bpf tree so targeting bpf-next and keeping fixes tags. ==================== Signed-off-by: Alexei Starovoitov commit df8fe57c071c58f355d0a4985ecd2fcaf99b050f Author: Alexei Starovoitov Date: Mon Jun 1 14:13:52 2020 -0700 tools/bpf: sync bpf.h Sync bpf.h into tool/include/uapi/ Signed-off-by: Alexei Starovoitov commit 463bac5f1ca79fcd964bf50426eab024fb4dd8a4 Author: John Fastabend Date: Fri May 29 16:07:19 2020 -0700 bpf, selftests: Add test for ktls with skb bpf ingress policy This adds a test for bpf ingress policy. To ensure data writes happen as expected with extra TLS headers we run these tests with data verification enabled by default. This will test receive packets have "PASS" stamped into the front of the payload. Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/159079363965.5745.3390806911628980210.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit 906312ca0d620cdcdb54d07594d26da0aed7eed2 Merge: b36e62eb8521 d39aec79e592 Author: Alexei Starovoitov Date: Mon Jun 1 13:49:33 2020 -0700 Merge branch 'xdp_devmap' David Ahern says: ==================== Implementation of Daniel's proposal for allowing DEVMAP entries to be a device index, program fd pair. Programs are run after XDP_REDIRECT and have access to both Rx device and Tx device. v4 - moved struct bpf_devmap_val from uapi to devmap.c, named the union and dropped the prefix from the elements - Jesper - fixed 2 bugs in selftests v3 - renamed struct to bpf_devmap_val - used offsetofend to check for expected map size, modification of Toke's comment - check for explicit value sizes - adjusted switch statement in dev_map_run_prog per Andrii's comment - changed SEC shortcut to xdp_devmap - changed selftests to use skeleton and new map declaration v2 - moved dev_map_ext_val definition to uapi to formalize the API for devmap extensions; add bpf_ prefix to the prog_fd and prog_id entries - changed devmap code to handle struct in a way that it can support future extensions - fixed subject in libbpf patch v1 - fixed prog put on invalid program - Toke - changed write value from id to fd per Toke's comments about capabilities - add test cases ==================== Signed-off-by: Alexei Starovoitov commit e91de6afa81c10e9f855c5695eb9a53168d96b73 Author: John Fastabend Date: Fri May 29 16:06:59 2020 -0700 bpf: Fix running sk_skb program types with ktls KTLS uses a stream parser to collect TLS messages and send them to the upper layer tls receive handler. This ensures the tls receiver has a full TLS header to parse when it is run. However, when a socket has BPF_SK_SKB_STREAM_VERDICT program attached before KTLS is enabled we end up with two stream parsers running on the same socket. The result is both try to run on the same socket. First the KTLS stream parser runs and calls read_sock() which will tcp_read_sock which in turn calls tcp_rcv_skb(). This dequeues the skb from the sk_receive_queue. When this is done KTLS code then data_ready() callback which because we stacked KTLS on top of the bpf stream verdict program has been replaced with sk_psock_start_strp(). This will in turn kick the stream parser again and eventually do the same thing KTLS did above calling into tcp_rcv_skb() and dequeuing a skb from the sk_receive_queue. At this point the data stream is broke. Part of the stream was handled by the KTLS side some other bytes may have been handled by the BPF side. Generally this results in either missing data or more likely a "Bad Message" complaint from the kTLS receive handler as the BPF program steals some bytes meant to be in a TLS header and/or the TLS header length is no longer correct. We've already broke the idealized model where we can stack ULPs in any order with generic callbacks on the TX side to handle this. So in this patch we do the same thing but for RX side. We add a sk_psock_strp_enabled() helper so TLS can learn a BPF verdict program is running and add a tls_sw_has_ctx_rx() helper so BPF side can learn there is a TLS ULP on the socket. Then on BPF side we omit calling our stream parser to avoid breaking the data stream for the KTLS receiver. Then on the KTLS side we call BPF_SK_SKB_STREAM_VERDICT once the KTLS receiver is done with the packet but before it posts the msg to userspace. This gives us symmetry between the TX and RX halfs and IMO makes it usable again. On the TX side we process packets in this order BPF -> TLS -> TCP and on the receive side in the reverse order TCP -> TLS -> BPF. Discovered while testing OpenSSL 3.0 Alpha2.0 release. Fixes: d829e9c4112b5 ("tls: convert to generic sk_msg interface") Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/159079361946.5745.605854335665044485.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit d39aec79e5923bf984df991ffe51d4a2b7a9e746 Author: David Ahern Date: Fri May 29 16:07:16 2020 -0600 selftest: Add tests for XDP programs in devmap entries Add tests to verify ability to add an XDP program to a entry in a DEVMAP. Add negative tests to show DEVMAP programs can not be attached to devices as a normal XDP program, and accesses to egress_ifindex require BPF_XDP_DEVMAP attach type. Signed-off-by: David Ahern Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200529220716.75383-6-dsahern@kernel.org Signed-off-by: Alexei Starovoitov commit ca2f5f21dbbd5e3a00cd3e97f728aa2ca0b2e011 Author: John Fastabend Date: Fri May 29 16:06:41 2020 -0700 bpf: Refactor sockmap redirect code so its easy to reuse We will need this block of code called from tls context shortly lets refactor the redirect logic so its easy to use. This also cleans up the switch stmt so we have fewer fallthrough cases. No logic changes are intended. Fixes: d829e9c4112b5 ("tls: convert to generic sk_msg interface") Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Reviewed-by: Jakub Sitnicki Acked-by: Song Liu Link: https://lore.kernel.org/bpf/159079360110.5745.7024009076049029819.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit 2778797037a658be71a6c55b54700bf58ba21eb7 Author: David Ahern Date: Fri May 29 16:07:15 2020 -0600 libbpf: Add SEC name for xdp programs attached to device map Support SEC("xdp_devmap*") as a short cut for loading the program with type BPF_PROG_TYPE_XDP and expected attach type BPF_XDP_DEVMAP. Signed-off-by: David Ahern Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200529220716.75383-5-dsahern@kernel.org Signed-off-by: Alexei Starovoitov commit 64b59025c15b244c0954cf52b24fbabfcf5ed8f6 Author: David Ahern Date: Fri May 29 16:07:14 2020 -0600 xdp: Add xdp_txq_info to xdp_buff Add xdp_txq_info as the Tx counterpart to xdp_rxq_info. At the moment only the device is added. Other fields (queue_index) can be added as use cases arise. >From a UAPI perspective, add egress_ifindex to xdp context for bpf programs to see the Tx device. Update the verifier to only allow accesses to egress_ifindex by XDP programs with BPF_XDP_DEVMAP expected attach type. Signed-off-by: David Ahern Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200529220716.75383-4-dsahern@kernel.org Signed-off-by: Alexei Starovoitov commit fbee97feed9b3e4acdf9590e1f6b4a2eefecfffe Author: David Ahern Date: Fri May 29 16:07:13 2020 -0600 bpf: Add support to attach bpf program to a devmap entry Add BPF_XDP_DEVMAP attach type for use with programs associated with a DEVMAP entry. Allow DEVMAPs to associate a program with a device entry by adding a bpf_prog.fd to 'struct bpf_devmap_val'. Values read show the program id, so the fd and id are a union. bpf programs can get access to the struct via vmlinux.h. The program associated with the fd must have type XDP with expected attach type BPF_XDP_DEVMAP. When a program is associated with a device index, the program is run on an XDP_REDIRECT and before the buffer is added to the per-cpu queue. At this point rxq data is still valid; the next patch adds tx device information allowing the prorgam to see both ingress and egress device indices. XDP generic is skb based and XDP programs do not work with skb's. Block the use case by walking maps used by a program that is to be attached via xdpgeneric and fail if any of them are DEVMAP / DEVMAP_HASH with Block attach of BPF_XDP_DEVMAP programs to devices. Signed-off-by: David Ahern Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200529220716.75383-3-dsahern@kernel.org Signed-off-by: Alexei Starovoitov commit b36e62eb85215a60916f910070f6d494b4f3e73a Author: Yonghong Song Date: Thu May 28 17:48:10 2020 -0700 bpf: Use strncpy_from_unsafe_strict() in bpf_seq_printf() helper In bpf_seq_printf() helper, when user specified a "%s" in the format string, strncpy_from_unsafe() is used to read the actual string to a buffer. The string could be a format string or a string in the kernel data structure. It is really unlikely that the string will reside in the user memory. This is different from Commit b2a5212fb634 ("bpf: Restrict bpf_trace_printk()'s %s usage and add %pks, %pus specifier") which still used strncpy_from_unsafe() for "%s" to preserve the old behavior. If in the future, bpf_seq_printf() indeed needs to read user memory, we can implement "%pus" format string. Based on discussion in [1], if the intent is to read kernel memory, strncpy_from_unsafe_strict() should be used. So this patch changed to use strncpy_from_unsafe_strict(). [1]: https://lore.kernel.org/bpf/20200521152301.2587579-1-hch@lst.de/T/ Fixes: 492e639f0c22 ("bpf: Add bpf_seq_printf and bpf_seq_write helpers") Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Cc: Christoph Hellwig Link: https://lore.kernel.org/bpf/20200529004810.3352219-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 7f1c04269fe7b3293dea38ea65da4fd6614d6f80 Author: David Ahern Date: Fri May 29 16:07:12 2020 -0600 devmap: Formalize map value as a named struct Add 'struct bpf_devmap_val' to formalize the expected values that can be passed in for a DEVMAP. Update devmap code to use the struct. Signed-off-by: David Ahern Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200529220716.75383-2-dsahern@kernel.org Signed-off-by: Alexei Starovoitov commit 88bc1de11cf5b5fa14dbeff7c613ce62fdfae7f6 Merge: 0a319ef75d93 33649bf4494c Author: Linus Torvalds Date: Mon Jun 1 14:48:20 2020 -0700 Merge tag 'x86-platform-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform updates from Ingo Molnar: "This tree cleans up various aspects of the UV platform support code, it removes unnecessary functions and cleans up the rest" * tag 'x86-platform-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic/uv: Remove code for unused distributed GRU mode x86/platform/uv: Remove the unused _uv_cpu_blade_processor_id() macro x86/platform/uv: Unexport uv_apicid_hibits x86/platform/uv: Remove _uv_hub_info_check() x86/platform/uv: Simplify uv_send_IPI_one() x86/platform/uv: Mark uv_min_hub_revision_id static x86/platform/uv: Mark is_uv_hubless() static x86/platform/uv: Remove the UV*_HUB_IS_SUPPORTED macros x86/platform/uv: Unexport symbols only used by x2apic_uv_x.c x86/platform/uv: Unexport sn_coherency_id x86/platform/uv: Remove the uv_partition_coherence_id() macro x86/platform/uv: Mark uv_bios_call() and uv_bios_call_irqsave() static commit 027690c75e8fd91b60a634d31c4891a6e39d45bd Author: J. Bruce Fields Date: Mon Jun 1 17:44:45 2020 -0400 nfsd4: make drc_slab global, not per-net I made every global per-network-namespace instead. But perhaps doing that to this slab was a step too far. The kmem_cache_create call in our net init method also seems to be responsible for this lockdep warning: [ 45.163710] Unable to find swap-space signature [ 45.375718] trinity-c1 (855): attempted to duplicate a private mapping with mremap. This is not supported. [ 46.055744] futex_wake_op: trinity-c1 tries to shift op by -209; fix this program [ 51.011723] [ 51.013378] ====================================================== [ 51.013875] WARNING: possible circular locking dependency detected [ 51.014378] 5.2.0-rc2 #1 Not tainted [ 51.014672] ------------------------------------------------------ [ 51.015182] trinity-c2/886 is trying to acquire lock: [ 51.015593] 000000005405f099 (slab_mutex){+.+.}, at: slab_attr_store+0xa2/0x130 [ 51.016190] [ 51.016190] but task is already holding lock: [ 51.016652] 00000000ac662005 (kn->count#43){++++}, at: kernfs_fop_write+0x286/0x500 [ 51.017266] [ 51.017266] which lock already depends on the new lock. [ 51.017266] [ 51.017909] [ 51.017909] the existing dependency chain (in reverse order) is: [ 51.018497] [ 51.018497] -> #1 (kn->count#43){++++}: [ 51.018956] __lock_acquire+0x7cf/0x1a20 [ 51.019317] lock_acquire+0x17d/0x390 [ 51.019658] __kernfs_remove+0x892/0xae0 [ 51.020020] kernfs_remove_by_name_ns+0x78/0x110 [ 51.020435] sysfs_remove_link+0x55/0xb0 [ 51.020832] sysfs_slab_add+0xc1/0x3e0 [ 51.021332] __kmem_cache_create+0x155/0x200 [ 51.021720] create_cache+0xf5/0x320 [ 51.022054] kmem_cache_create_usercopy+0x179/0x320 [ 51.022486] kmem_cache_create+0x1a/0x30 [ 51.022867] nfsd_reply_cache_init+0x278/0x560 [ 51.023266] nfsd_init_net+0x20f/0x5e0 [ 51.023623] ops_init+0xcb/0x4b0 [ 51.023928] setup_net+0x2fe/0x670 [ 51.024315] copy_net_ns+0x30a/0x3f0 [ 51.024653] create_new_namespaces+0x3c5/0x820 [ 51.025257] unshare_nsproxy_namespaces+0xd1/0x240 [ 51.025881] ksys_unshare+0x506/0x9c0 [ 51.026381] __x64_sys_unshare+0x3a/0x50 [ 51.026937] do_syscall_64+0x110/0x10b0 [ 51.027509] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 51.028175] [ 51.028175] -> #0 (slab_mutex){+.+.}: [ 51.028817] validate_chain+0x1c51/0x2cc0 [ 51.029422] __lock_acquire+0x7cf/0x1a20 [ 51.029947] lock_acquire+0x17d/0x390 [ 51.030438] __mutex_lock+0x100/0xfa0 [ 51.030995] mutex_lock_nested+0x27/0x30 [ 51.031516] slab_attr_store+0xa2/0x130 [ 51.032020] sysfs_kf_write+0x11d/0x180 [ 51.032529] kernfs_fop_write+0x32a/0x500 [ 51.033056] do_loop_readv_writev+0x21d/0x310 [ 51.033627] do_iter_write+0x2e5/0x380 [ 51.034148] vfs_writev+0x170/0x310 [ 51.034616] do_pwritev+0x13e/0x160 [ 51.035100] __x64_sys_pwritev+0xa3/0x110 [ 51.035633] do_syscall_64+0x110/0x10b0 [ 51.036200] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 51.036924] [ 51.036924] other info that might help us debug this: [ 51.036924] [ 51.037876] Possible unsafe locking scenario: [ 51.037876] [ 51.038556] CPU0 CPU1 [ 51.039130] ---- ---- [ 51.039676] lock(kn->count#43); [ 51.040084] lock(slab_mutex); [ 51.040597] lock(kn->count#43); [ 51.041062] lock(slab_mutex); [ 51.041320] [ 51.041320] *** DEADLOCK *** [ 51.041320] [ 51.041793] 3 locks held by trinity-c2/886: [ 51.042128] #0: 000000001f55e152 (sb_writers#5){.+.+}, at: vfs_writev+0x2b9/0x310 [ 51.042739] #1: 00000000c7d6c034 (&of->mutex){+.+.}, at: kernfs_fop_write+0x25b/0x500 [ 51.043400] #2: 00000000ac662005 (kn->count#43){++++}, at: kernfs_fop_write+0x286/0x500 Reported-by: kernel test robot Fixes: 3ba75830ce17 "drc containerization" Signed-off-by: J. Bruce Fields commit c3c16f2ea6d20159903cf93afbb1155f3d8348d5 Author: Amritha Nambiar Date: Tue May 26 17:34:36 2020 -0700 bpf: Add rx_queue_mapping to bpf_sock Add "rx_queue_mapping" to bpf_sock. This gives read access for the existing field (sk_rx_queue_mapping) of struct sock from bpf_sock. Semantics for the bpf_sock rx_queue_mapping access are similar to sk_rx_queue_get(), i.e the value NO_QUEUE_MAPPING is not allowed and -1 is returned in that case. This is useful for transmit queue selection based on the received queue index which is cached in the socket in the receive path. v3: Addressed review comments to add usecase in patch description, and fixed default value for rx_queue_mapping. v2: fixed build error for CONFIG_XPS wrapping, reported by kbuild test robot Signed-off-by: Amritha Nambiar Signed-off-by: Alexei Starovoitov commit e255d3273920dfd2d4e1cf2afe565b942c122219 Merge: 43dd115b1fff 97abb2b39682 Author: Daniel Borkmann Date: Fri May 29 17:11:09 2020 +0200 Merge branch 'bpf-ring-buffer' Andrii Nakryiko says: ==================== Implement a new BPF ring buffer, as presented at BPF virtual conference ([0]). It presents an alternative to perf buffer, following its semantics closely, but allowing sharing same instance of ring buffer across multiple CPUs efficiently. Most patches have extensive commentary explaining various aspects, so I'll keep cover letter short. Overall structure of the patch set: - patch #1 adds BPF ring buffer implementation to kernel and necessary verifier support; - patch #2 adds libbpf consumer implementation for BPF ringbuf; - patch #3 adds selftest, both for single BPF ring buf use case, as well as using it with array/hash of maps; - patch #4 adds extensive benchmarks and provide some analysis in commit message, it builds upon selftests/bpf's bench runner. - patch #5 adds most of patch #1 commit message as a doc under Documentation/bpf/ringbuf.rst. Litmus tests, validating consumer/producer protocols and memory orderings, were moved out as discussed in [1] and are going to be posted against -rcu tree and put under Documentation/litmus-tests/bpf-rb. [0] https://docs.google.com/presentation/d/18ITdg77Bj6YDOH2LghxrnFxiPWe0fAqcmJY95t_qr0w [1] https://lkml.org/lkml/2020/5/22/1011 v3->v4: - fix ringbuf freeing (vunmap, __free_page); verified with a trivial loop creating and closing ringbuf map endlessly (Daniel); v2->v3: - dropped unnecessary smp_wmb() (Paul); - verifier reference type enhancement patch was dropped (Alexei); - better verifier message for various memory access checks (Alexei); - clarified a bit roundup_len() bit shifting (Alexei); - converted doc to .rst (Alexei); - fixed warning on 32-bit arches regarding tautological ring area size check. v1->v2: - commit()/discard()/output() accept flags (NO_WAKEUP/FORCE_WAKEUP) (Stanislav); - bpf_ringbuf_query() added, returning available data size, ringbuf size, consumer/producer positions, needed to implement smarter notification policy (Stanislav); - added ringbuf UAPI constants to include/uapi/linux/bpf.h (Jonathan); - fixed sample size check, added proper ringbuf size check (Jonathan, Alexei); - wake_up_all() is done through irq_work (Alexei); - consistent use of smp_load_acquire/smp_store_release, no READ_ONCE/WRITE_ONCE (Alexei); - added Documentation/bpf/ringbuf.txt (Stanislav); - updated litmus test with smp_load_acquire/smp_store_release changes; - added ring_buffer__consume() API to libbpf for busy-polling; - ring_buffer__poll() on success returns number of records consumed; - fixed EPOLL notifications, don't assume available data, done similarly to perfbuf's implementation; - both ringbuf and perfbuf now have --rb-sampled mode, instead of pb-raw/pb-custom mode, updated benchmark results; - extended ringbuf selftests to validate epoll logic/manual notification logic, as well as bpf_ringbuf_query(). ==================== Signed-off-by: Daniel Borkmann commit 43dd115b1fffdd8d2c4cc15659c00b2a1addbc43 Author: Anton Protopopov Date: Wed May 27 18:57:00 2020 +0000 selftests/bpf: Add tests for write-only stacks/queues For write-only stacks and queues bpf_map_update_elem should be allowed, but bpf_map_lookup_elem and bpf_map_lookup_and_delete_elem should fail with EPERM. Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200527185700.14658-6-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov commit 97abb2b396821f21c21cee2d537bb4e0a0eef31b Author: Andrii Nakryiko Date: Fri May 29 00:54:24 2020 -0700 docs/bpf: Add BPF ring buffer design notes Add commit description from patch #1 as a stand-alone documentation under Documentation/bpf, as it might be more convenient format, in long term perspective. Suggested-by: Stanislav Fomichev Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200529075424.3139988-6-andriin@fb.com Signed-off-by: Alexei Starovoitov commit c97099b0f22722be7d0f290278a26d297cc4b7ca Author: Andrii Nakryiko Date: Fri May 29 00:54:23 2020 -0700 bpf: Add BPF ringbuf and perf buffer benchmarks Extend bench framework with ability to have benchmark-provided child argument parser for custom benchmark-specific parameters. This makes bench generic code modular and independent from any specific benchmark. Also implement a set of benchmarks for new BPF ring buffer and existing perf buffer. 4 benchmarks were implemented: 2 variations for each of BPF ringbuf and perfbuf:, - rb-libbpf utilizes stock libbpf ring_buffer manager for reading data; - rb-custom implements custom ring buffer setup and reading code, to eliminate overheads inherent in generic libbpf code due to callback functions and the need to update consumer position after each consumed record, instead of batching updates (due to pessimistic assumption that user callback might take long time and thus could unnecessarily hold ring buffer space for too long); - pb-libbpf uses stock libbpf perf_buffer code with all the default settings, though uses higher-performance raw event callback to minimize unnecessary overhead; - pb-custom implements its own custom consumer code to minimize any possible overhead of generic libbpf implementation and indirect function calls. All of the test support default, no data notification skipped, mode, as well as sampled mode (with --rb-sampled flag), which allows to trigger epoll notification less frequently and reduce overhead. As will be shown, this mode is especially critical for perf buffer, which suffers from high overhead of wakeups in kernel. Otherwise, all benchamrks implement similar way to generate a batch of records by using fentry/sys_getpgid BPF program, which pushes a bunch of records in a tight loop and records number of successful and dropped samples. Each record is a small 8-byte integer, to minimize the effect of memory copying with bpf_perf_event_output() and bpf_ringbuf_output(). Benchmarks that have only one producer implement optional back-to-back mode, in which record production and consumption is alternating on the same CPU. This is the highest-throughput happy case, showing ultimate performance achievable with either BPF ringbuf or perfbuf. All the below scenarios are implemented in a script in benchs/run_bench_ringbufs.sh. Tests were performed on 28-core/56-thread Intel Xeon CPU E5-2680 v4 @ 2.40GHz CPU. Single-producer, parallel producer ================================== rb-libbpf 12.054 ± 0.320M/s (drops 0.000 ± 0.000M/s) rb-custom 8.158 ± 0.118M/s (drops 0.001 ± 0.003M/s) pb-libbpf 0.931 ± 0.007M/s (drops 0.000 ± 0.000M/s) pb-custom 0.965 ± 0.003M/s (drops 0.000 ± 0.000M/s) Single-producer, parallel producer, sampled notification ======================================================== rb-libbpf 11.563 ± 0.067M/s (drops 0.000 ± 0.000M/s) rb-custom 15.895 ± 0.076M/s (drops 0.000 ± 0.000M/s) pb-libbpf 9.889 ± 0.032M/s (drops 0.000 ± 0.000M/s) pb-custom 9.866 ± 0.028M/s (drops 0.000 ± 0.000M/s) Single producer on one CPU, consumer on another one, both running at full speed. Curiously, rb-libbpf has higher throughput than objectively faster (due to more lightweight consumer code path) rb-custom. It appears that faster consumer causes kernel to send notifications more frequently, because consumer appears to be caught up more frequently. Performance of perfbuf suffers from default "no sampling" policy and huge overhead that causes. In sampled mode, rb-custom is winning very significantly eliminating too frequent in-kernel wakeups, the gain appears to be more than 2x. Perf buffer achieves even more impressive wins, compared to stock perfbuf settings, with 10x improvements in throughput with 1:500 sampling rate. The trade-off is that with sampling, application might not get next X events until X+1st arrives, which is not always acceptable. With steady influx of events, though, this shouldn't be a problem. Overall, single-producer performance of ring buffers seems to be better no matter the sampled/non-sampled modes, but it especially beats ring buffer without sampling due to its adaptive notification approach. Single-producer, back-to-back mode ================================== rb-libbpf 15.507 ± 0.247M/s (drops 0.000 ± 0.000M/s) rb-libbpf-sampled 14.692 ± 0.195M/s (drops 0.000 ± 0.000M/s) rb-custom 21.449 ± 0.157M/s (drops 0.000 ± 0.000M/s) rb-custom-sampled 20.024 ± 0.386M/s (drops 0.000 ± 0.000M/s) pb-libbpf 1.601 ± 0.015M/s (drops 0.000 ± 0.000M/s) pb-libbpf-sampled 8.545 ± 0.064M/s (drops 0.000 ± 0.000M/s) pb-custom 1.607 ± 0.022M/s (drops 0.000 ± 0.000M/s) pb-custom-sampled 8.988 ± 0.144M/s (drops 0.000 ± 0.000M/s) Here we test a back-to-back mode, which is arguably best-case scenario both for BPF ringbuf and perfbuf, because there is no contention and for ringbuf also no excessive notification, because consumer appears to be behind after the first record. For ringbuf, custom consumer code clearly wins with 21.5 vs 16 million records per second exchanged between producer and consumer. Sampled mode actually hurts a bit due to slightly slower producer logic (it needs to fetch amount of data available to decide whether to skip or force notification). Perfbuf with wakeup sampling gets 5.5x throughput increase, compared to no-sampling version. There also doesn't seem to be noticeable overhead from generic libbpf handling code. Perfbuf back-to-back, effect of sample rate =========================================== pb-sampled-1 1.035 ± 0.012M/s (drops 0.000 ± 0.000M/s) pb-sampled-5 3.476 ± 0.087M/s (drops 0.000 ± 0.000M/s) pb-sampled-10 5.094 ± 0.136M/s (drops 0.000 ± 0.000M/s) pb-sampled-25 7.118 ± 0.153M/s (drops 0.000 ± 0.000M/s) pb-sampled-50 8.169 ± 0.156M/s (drops 0.000 ± 0.000M/s) pb-sampled-100 8.887 ± 0.136M/s (drops 0.000 ± 0.000M/s) pb-sampled-250 9.180 ± 0.209M/s (drops 0.000 ± 0.000M/s) pb-sampled-500 9.353 ± 0.281M/s (drops 0.000 ± 0.000M/s) pb-sampled-1000 9.411 ± 0.217M/s (drops 0.000 ± 0.000M/s) pb-sampled-2000 9.464 ± 0.167M/s (drops 0.000 ± 0.000M/s) pb-sampled-3000 9.575 ± 0.273M/s (drops 0.000 ± 0.000M/s) This benchmark shows the effect of event sampling for perfbuf. Back-to-back mode for highest throughput. Just doing every 5th record notification gives 3.5x speed up. 250-500 appears to be the point of diminishing return, with almost 9x speed up. Most benchmarks use 500 as the default sampling for pb-raw and pb-custom. Ringbuf back-to-back, effect of sample rate =========================================== rb-sampled-1 1.106 ± 0.010M/s (drops 0.000 ± 0.000M/s) rb-sampled-5 4.746 ± 0.149M/s (drops 0.000 ± 0.000M/s) rb-sampled-10 7.706 ± 0.164M/s (drops 0.000 ± 0.000M/s) rb-sampled-25 12.893 ± 0.273M/s (drops 0.000 ± 0.000M/s) rb-sampled-50 15.961 ± 0.361M/s (drops 0.000 ± 0.000M/s) rb-sampled-100 18.203 ± 0.445M/s (drops 0.000 ± 0.000M/s) rb-sampled-250 19.962 ± 0.786M/s (drops 0.000 ± 0.000M/s) rb-sampled-500 20.881 ± 0.551M/s (drops 0.000 ± 0.000M/s) rb-sampled-1000 21.317 ± 0.532M/s (drops 0.000 ± 0.000M/s) rb-sampled-2000 21.331 ± 0.535M/s (drops 0.000 ± 0.000M/s) rb-sampled-3000 21.688 ± 0.392M/s (drops 0.000 ± 0.000M/s) Similar benchmark for ring buffer also shows a great advantage (in terms of throughput) of skipping notifications. Skipping every 5th one gives 4x boost. Also similar to perfbuf case, 250-500 seems to be the point of diminishing returns, giving roughly 20x better results. Keep in mind, for this test, notifications are controlled manually with BPF_RB_NO_WAKEUP and BPF_RB_FORCE_WAKEUP. As can be seen from previous benchmarks, adaptive notifications based on consumer's positions provides same (or even slightly better due to simpler load generator on BPF side) benefits in favorable back-to-back scenario. Over zealous and fast consumer, which is almost always caught up, will make thoughput numbers smaller. That's the case when manual notification control might prove to be extremely beneficial. Ringbuf back-to-back, reserve+commit vs output ============================================== reserve 22.819 ± 0.503M/s (drops 0.000 ± 0.000M/s) output 18.906 ± 0.433M/s (drops 0.000 ± 0.000M/s) Ringbuf sampled, reserve+commit vs output ========================================= reserve-sampled 15.350 ± 0.132M/s (drops 0.000 ± 0.000M/s) output-sampled 14.195 ± 0.144M/s (drops 0.000 ± 0.000M/s) BPF ringbuf supports two sets of APIs with various usability and performance tradeoffs: bpf_ringbuf_reserve()+bpf_ringbuf_commit() vs bpf_ringbuf_output(). This benchmark clearly shows superiority of reserve+commit approach, despite using a small 8-byte record size. Single-producer, consumer/producer competing on the same CPU, low batch count ============================================================================= rb-libbpf 3.045 ± 0.020M/s (drops 3.536 ± 0.148M/s) rb-custom 3.055 ± 0.022M/s (drops 3.893 ± 0.066M/s) pb-libbpf 1.393 ± 0.024M/s (drops 0.000 ± 0.000M/s) pb-custom 1.407 ± 0.016M/s (drops 0.000 ± 0.000M/s) This benchmark shows one of the worst-case scenarios, in which producer and consumer do not coordinate *and* fight for the same CPU. No batch count and sampling settings were able to eliminate drops for ringbuffer, producer is just too fast for consumer to keep up. But ringbuf and perfbuf still able to pass through quite a lot of messages, which is more than enough for a lot of applications. Ringbuf, multi-producer contention ================================== rb-libbpf nr_prod 1 10.916 ± 0.399M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 2 4.931 ± 0.030M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 3 4.880 ± 0.006M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 4 3.926 ± 0.004M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 8 4.011 ± 0.004M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 12 3.967 ± 0.016M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 16 2.604 ± 0.030M/s (drops 0.001 ± 0.002M/s) rb-libbpf nr_prod 20 2.233 ± 0.003M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 24 2.085 ± 0.015M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 28 2.055 ± 0.004M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 32 1.962 ± 0.004M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 36 2.089 ± 0.005M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 40 2.118 ± 0.006M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 44 2.105 ± 0.004M/s (drops 0.000 ± 0.000M/s) rb-libbpf nr_prod 48 2.120 ± 0.058M/s (drops 0.000 ± 0.001M/s) rb-libbpf nr_prod 52 2.074 ± 0.024M/s (drops 0.007 ± 0.014M/s) Ringbuf uses a very short-duration spinlock during reservation phase, to check few invariants, increment producer count and set record header. This is the biggest point of contention for ringbuf implementation. This benchmark evaluates the effect of multiple competing writers on overall throughput of a single shared ringbuffer. Overall throughput drops almost 2x when going from single to two highly-contended producers, gradually dropping with additional competing producers. Performance drop stabilizes at around 20 producers and hovers around 2mln even with 50+ fighting producers, which is a 5x drop compared to non-contended case. Good kernel implementation in kernel helps maintain decent performance here. Note, that in the intended real-world scenarios, it's not expected to get even close to such a high levels of contention. But if contention will become a problem, there is always an option of sharding few ring buffers across a set of CPUs. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200529075424.3139988-5-andriin@fb.com Signed-off-by: Alexei Starovoitov commit cb1c9ddd552520abd49031d47397c6e95bad882e Author: Andrii Nakryiko Date: Fri May 29 00:54:22 2020 -0700 selftests/bpf: Add BPF ringbuf selftests Both singleton BPF ringbuf and BPF ringbuf with map-in-map use cases are tested. Also reserve+submit/discards and output variants of API are validated. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200529075424.3139988-4-andriin@fb.com Signed-off-by: Alexei Starovoitov commit bf99c936f9478a05d51e9f101f90de70bee9a89c Author: Andrii Nakryiko Date: Fri May 29 00:54:21 2020 -0700 libbpf: Add BPF ring buffer support Declaring and instantiating BPF ring buffer doesn't require any changes to libbpf, as it's just another type of maps. So using existing BTF-defined maps syntax with __uint(type, BPF_MAP_TYPE_RINGBUF) and __uint(max_elements, ) is all that's necessary to create and use BPF ring buffer. This patch adds BPF ring buffer consumer to libbpf. It is very similar to perf_buffer implementation in terms of API, but also attempts to fix some minor problems and inconveniences with existing perf_buffer API. ring_buffer support both single ring buffer use case (with just using ring_buffer__new()), as well as allows to add more ring buffers, each with its own callback and context. This allows to efficiently poll and consume multiple, potentially completely independent, ring buffers, using single epoll instance. The latter is actually a problem in practice for applications that are using multiple sets of perf buffers. They have to create multiple instances for struct perf_buffer and poll them independently or in a loop, each approach having its own problems (e.g., inability to use a common poll timeout). struct ring_buffer eliminates this problem by aggregating many independent ring buffer instances under the single "ring buffer manager". Second, perf_buffer's callback can't return error, so applications that need to stop polling due to error in data or data signalling the end, have to use extra mechanisms to signal that polling has to stop. ring_buffer's callback can return error, which will be passed through back to user code and can be acted upon appropariately. Two APIs allow to consume ring buffer data: - ring_buffer__poll(), which will wait for data availability notification and will consume data only from reported ring buffer(s); this API allows to efficiently use resources by reading data only when it becomes available; - ring_buffer__consume(), will attempt to read new records regardless of data availablity notification sub-system. This API is useful for cases when lowest latency is required, in expense of burning CPU resources. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200529075424.3139988-3-andriin@fb.com Signed-off-by: Alexei Starovoitov commit 457f44363a8894135c85b7a9afd2bd8196db24ab Author: Andrii Nakryiko Date: Fri May 29 00:54:20 2020 -0700 bpf: Implement BPF ring buffer and verifier support for it This commit adds a new MPSC ring buffer implementation into BPF ecosystem, which allows multiple CPUs to submit data to a single shared ring buffer. On the consumption side, only single consumer is assumed. Motivation ---------- There are two distinctive motivators for this work, which are not satisfied by existing perf buffer, which prompted creation of a new ring buffer implementation. - more efficient memory utilization by sharing ring buffer across CPUs; - preserving ordering of events that happen sequentially in time, even across multiple CPUs (e.g., fork/exec/exit events for a task). These two problems are independent, but perf buffer fails to satisfy both. Both are a result of a choice to have per-CPU perf ring buffer. Both can be also solved by having an MPSC implementation of ring buffer. The ordering problem could technically be solved for perf buffer with some in-kernel counting, but given the first one requires an MPSC buffer, the same solution would solve the second problem automatically. Semantics and APIs ------------------ Single ring buffer is presented to BPF programs as an instance of BPF map of type BPF_MAP_TYPE_RINGBUF. Two other alternatives considered, but ultimately rejected. One way would be to, similar to BPF_MAP_TYPE_PERF_EVENT_ARRAY, make BPF_MAP_TYPE_RINGBUF could represent an array of ring buffers, but not enforce "same CPU only" rule. This would be more familiar interface compatible with existing perf buffer use in BPF, but would fail if application needed more advanced logic to lookup ring buffer by arbitrary key. HASH_OF_MAPS addresses this with current approach. Additionally, given the performance of BPF ringbuf, many use cases would just opt into a simple single ring buffer shared among all CPUs, for which current approach would be an overkill. Another approach could introduce a new concept, alongside BPF map, to represent generic "container" object, which doesn't necessarily have key/value interface with lookup/update/delete operations. This approach would add a lot of extra infrastructure that has to be built for observability and verifier support. It would also add another concept that BPF developers would have to familiarize themselves with, new syntax in libbpf, etc. But then would really provide no additional benefits over the approach of using a map. BPF_MAP_TYPE_RINGBUF doesn't support lookup/update/delete operations, but so doesn't few other map types (e.g., queue and stack; array doesn't support delete, etc). The approach chosen has an advantage of re-using existing BPF map infrastructure (introspection APIs in kernel, libbpf support, etc), being familiar concept (no need to teach users a new type of object in BPF program), and utilizing existing tooling (bpftool). For common scenario of using a single ring buffer for all CPUs, it's as simple and straightforward, as would be with a dedicated "container" object. On the other hand, by being a map, it can be combined with ARRAY_OF_MAPS and HASH_OF_MAPS map-in-maps to implement a wide variety of topologies, from one ring buffer for each CPU (e.g., as a replacement for perf buffer use cases), to a complicated application hashing/sharding of ring buffers (e.g., having a small pool of ring buffers with hashed task's tgid being a look up key to preserve order, but reduce contention). Key and value sizes are enforced to be zero. max_entries is used to specify the size of ring buffer and has to be a power of 2 value. There are a bunch of similarities between perf buffer (BPF_MAP_TYPE_PERF_EVENT_ARRAY) and new BPF ring buffer semantics: - variable-length records; - if there is no more space left in ring buffer, reservation fails, no blocking; - memory-mappable data area for user-space applications for ease of consumption and high performance; - epoll notifications for new incoming data; - but still the ability to do busy polling for new data to achieve the lowest latency, if necessary. BPF ringbuf provides two sets of APIs to BPF programs: - bpf_ringbuf_output() allows to *copy* data from one place to a ring buffer, similarly to bpf_perf_event_output(); - bpf_ringbuf_reserve()/bpf_ringbuf_commit()/bpf_ringbuf_discard() APIs split the whole process into two steps. First, a fixed amount of space is reserved. If successful, a pointer to a data inside ring buffer data area is returned, which BPF programs can use similarly to a data inside array/hash maps. Once ready, this piece of memory is either committed or discarded. Discard is similar to commit, but makes consumer ignore the record. bpf_ringbuf_output() has disadvantage of incurring extra memory copy, because record has to be prepared in some other place first. But it allows to submit records of the length that's not known to verifier beforehand. It also closely matches bpf_perf_event_output(), so will simplify migration significantly. bpf_ringbuf_reserve() avoids the extra copy of memory by providing a memory pointer directly to ring buffer memory. In a lot of cases records are larger than BPF stack space allows, so many programs have use extra per-CPU array as a temporary heap for preparing sample. bpf_ringbuf_reserve() avoid this needs completely. But in exchange, it only allows a known constant size of memory to be reserved, such that verifier can verify that BPF program can't access memory outside its reserved record space. bpf_ringbuf_output(), while slightly slower due to extra memory copy, covers some use cases that are not suitable for bpf_ringbuf_reserve(). The difference between commit and discard is very small. Discard just marks a record as discarded, and such records are supposed to be ignored by consumer code. Discard is useful for some advanced use-cases, such as ensuring all-or-nothing multi-record submission, or emulating temporary malloc()/free() within single BPF program invocation. Each reserved record is tracked by verifier through existing reference-tracking logic, similar to socket ref-tracking. It is thus impossible to reserve a record, but forget to submit (or discard) it. bpf_ringbuf_query() helper allows to query various properties of ring buffer. Currently 4 are supported: - BPF_RB_AVAIL_DATA returns amount of unconsumed data in ring buffer; - BPF_RB_RING_SIZE returns the size of ring buffer; - BPF_RB_CONS_POS/BPF_RB_PROD_POS returns current logical possition of consumer/producer, respectively. Returned values are momentarily snapshots of ring buffer state and could be off by the time helper returns, so this should be used only for debugging/reporting reasons or for implementing various heuristics, that take into account highly-changeable nature of some of those characteristics. One such heuristic might involve more fine-grained control over poll/epoll notifications about new data availability in ring buffer. Together with BPF_RB_NO_WAKEUP/BPF_RB_FORCE_WAKEUP flags for output/commit/discard helpers, it allows BPF program a high degree of control and, e.g., more efficient batched notifications. Default self-balancing strategy, though, should be adequate for most applications and will work reliable and efficiently already. Design and implementation ------------------------- This reserve/commit schema allows a natural way for multiple producers, either on different CPUs or even on the same CPU/in the same BPF program, to reserve independent records and work with them without blocking other producers. This means that if BPF program was interruped by another BPF program sharing the same ring buffer, they will both get a record reserved (provided there is enough space left) and can work with it and submit it independently. This applies to NMI context as well, except that due to using a spinlock during reservation, in NMI context, bpf_ringbuf_reserve() might fail to get a lock, in which case reservation will fail even if ring buffer is not full. The ring buffer itself internally is implemented as a power-of-2 sized circular buffer, with two logical and ever-increasing counters (which might wrap around on 32-bit architectures, that's not a problem): - consumer counter shows up to which logical position consumer consumed the data; - producer counter denotes amount of data reserved by all producers. Each time a record is reserved, producer that "owns" the record will successfully advance producer counter. At that point, data is still not yet ready to be consumed, though. Each record has 8 byte header, which contains the length of reserved record, as well as two extra bits: busy bit to denote that record is still being worked on, and discard bit, which might be set at commit time if record is discarded. In the latter case, consumer is supposed to skip the record and move on to the next one. Record header also encodes record's relative offset from the beginning of ring buffer data area (in pages). This allows bpf_ringbuf_commit()/bpf_ringbuf_discard() to accept only the pointer to the record itself, without requiring also the pointer to ring buffer itself. Ring buffer memory location will be restored from record metadata header. This significantly simplifies verifier, as well as improving API usability. Producer counter increments are serialized under spinlock, so there is a strict ordering between reservations. Commits, on the other hand, are completely lockless and independent. All records become available to consumer in the order of reservations, but only after all previous records where already committed. It is thus possible for slow producers to temporarily hold off submitted records, that were reserved later. Reservation/commit/consumer protocol is verified by litmus tests in Documentation/litmus-test/bpf-rb. One interesting implementation bit, that significantly simplifies (and thus speeds up as well) implementation of both producers and consumers is how data area is mapped twice contiguously back-to-back in the virtual memory. This allows to not take any special measures for samples that have to wrap around at the end of the circular buffer data area, because the next page after the last data page would be first data page again, and thus the sample will still appear completely contiguous in virtual memory. See comment and a simple ASCII diagram showing this visually in bpf_ringbuf_area_alloc(). Another feature that distinguishes BPF ringbuf from perf ring buffer is a self-pacing notifications of new data being availability. bpf_ringbuf_commit() implementation will send a notification of new record being available after commit only if consumer has already caught up right up to the record being committed. If not, consumer still has to catch up and thus will see new data anyways without needing an extra poll notification. Benchmarks (see tools/testing/selftests/bpf/benchs/bench_ringbuf.c) show that this allows to achieve a very high throughput without having to resort to tricks like "notify only every Nth sample", which are necessary with perf buffer. For extreme cases, when BPF program wants more manual control of notifications, commit/discard/output helpers accept BPF_RB_NO_WAKEUP and BPF_RB_FORCE_WAKEUP flags, which give full control over notifications of data availability, but require extra caution and diligence in using this API. Comparison to alternatives -------------------------- Before considering implementing BPF ring buffer from scratch existing alternatives in kernel were evaluated, but didn't seem to meet the needs. They largely fell into few categores: - per-CPU buffers (perf, ftrace, etc), which don't satisfy two motivations outlined above (ordering and memory consumption); - linked list-based implementations; while some were multi-producer designs, consuming these from user-space would be very complicated and most probably not performant; memory-mapping contiguous piece of memory is simpler and more performant for user-space consumers; - io_uring is SPSC, but also requires fixed-sized elements. Naively turning SPSC queue into MPSC w/ lock would have subpar performance compared to locked reserve + lockless commit, as with BPF ring buffer. Fixed sized elements would be too limiting for BPF programs, given existing BPF programs heavily rely on variable-sized perf buffer already; - specialized implementations (like a new printk ring buffer, [0]) with lots of printk-specific limitations and implications, that didn't seem to fit well for intended use with BPF programs. [0] https://lwn.net/Articles/779550/ Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200529075424.3139988-2-andriin@fb.com Signed-off-by: Alexei Starovoitov commit 1ea0f9120c8ce105ca181b070561df5cbd6bc049 Author: Anton Protopopov Date: Wed May 27 18:56:59 2020 +0000 bpf: Fix map permissions check The map_lookup_and_delete_elem() function should check for both FMODE_CAN_WRITE and FMODE_CAN_READ permissions because it returns a map element to user space. Fixes: bd513cd08f10 ("bpf: add MAP_LOOKUP_AND_DELETE_ELEM syscall") Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200527185700.14658-5-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov commit efbc3b8fe1e6259777670aadf931500545073c6c Author: Anton Protopopov Date: Wed May 27 18:56:58 2020 +0000 selftests/bpf: Cleanup comments in test_maps Make comments inside the test_map_rdonly and test_map_wronly tests consistent with logic. Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200527185700.14658-4-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov commit 36ef9a2d3f764a37cf3d8e619bfebf5c99c070a0 Author: Anton Protopopov Date: Wed May 27 18:56:57 2020 +0000 selftests/bpf: Cleanup some file descriptors in test_maps The test_map_rdonly and test_map_wronly tests should close file descriptors which they open. Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200527185700.14658-3-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov commit 204fb0413a92342d31f3e2557db0bb5babed586c Author: Anton Protopopov Date: Wed May 27 18:56:56 2020 +0000 selftests/bpf: Fix a typo in test_maps Trivial fix to a typo in the test_map_wronly test: "read" -> "write" Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200527185700.14658-2-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov commit 601b05ca6edb0422bf6ce313fbfd55ec7bbbc0fd Author: Eelco Chaudron Date: Wed May 27 10:42:00 2020 +0200 libbpf: Fix perf_buffer__free() API for sparse allocs In case the cpu_bufs are sparsely allocated they are not all free'ed. These changes will fix this. Fixes: fb84b8224655 ("libbpf: add perf buffer API") Signed-off-by: Eelco Chaudron Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159056888305.330763.9684536967379110349.stgit@ebuild Signed-off-by: Alexei Starovoitov commit ee103e9f1544e04ecd1db5eb5e9eb9a8b8698879 Author: John Fastabend Date: Sun May 24 09:51:57 2020 -0700 bpf, selftests: Test probe_* helpers from SCHED_CLS Lets test using probe* in SCHED_CLS network programs as well just to be sure these keep working. Its cheap to add the extra test and provides a second context to test outside of sk_msg after we generalized probe* helpers to all networking types. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159033911685.12355.15951980509828906214.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit 1d9c037a898b3c0344cfe5064ba6c482bf9b46b0 Author: John Fastabend Date: Sun May 24 09:51:36 2020 -0700 bpf, selftests: Add sk_msg helpers load and attach test The test itself is not particularly useful but it encodes a common pattern we have. Namely do a sk storage lookup then depending on data here decide if we need to do more work or alternatively allow packet to PASS. Then if we need to do more work consult task_struct for more information about the running task. Finally based on this additional information drop or pass the data. In this case the suspicious check is not so realisitic but it encodes the general pattern and uses the helpers so we test the workflow. This is a load test to ensure verifier correctly handles this case. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159033909665.12355.6166415847337547879.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit 13d70f5a5ecff367db2fb18ed4ebe433eab8a74c Author: John Fastabend Date: Sun May 24 09:51:15 2020 -0700 bpf, sk_msg: Add get socket storage helpers Add helpers to use local socket storage. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/159033907577.12355.14740125020572756560.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit f470378c7562a2818b45ed11c98973f2b89eedd3 Author: John Fastabend Date: Sun May 24 09:50:55 2020 -0700 bpf: Extend bpf_base_func_proto helpers with probe_* and *current_task* Often it is useful when applying policy to know something about the task. If the administrator has CAP_SYS_ADMIN rights then they can use kprobe + networking hook and link the two programs together to accomplish this. However, this is a bit clunky and also means we have to call both the network program and kprobe program when we could just use a single program and avoid passing metadata through sk_msg/skb->cb, socket, maps, etc. To accomplish this add probe_* helpers to bpf_base_func_proto programs guarded by a perfmon_capable() check. New supported helpers are the following, BPF_FUNC_get_current_task BPF_FUNC_probe_read_user BPF_FUNC_probe_read_kernel BPF_FUNC_probe_read_user_str BPF_FUNC_probe_read_kernel_str Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/159033905529.12355.4368381069655254932.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit abe3cac8706bffeda3ebc06e4a9fa6e9cadacf26 Author: John Fastabend Date: Sun May 24 09:50:33 2020 -0700 bpf, sk_msg: Add some generic helpers that may be useful from sk_msg Add these generic helpers that may be useful to use from sk_msg programs. The helpers do not depend on ctx so we can simply add them here, BPF_FUNC_perf_event_output BPF_FUNC_get_current_uid_gid BPF_FUNC_get_current_pid_tgid BPF_FUNC_get_current_cgroup_id BPF_FUNC_get_current_ancestor_cgroup_id BPF_FUNC_get_cgroup_classid Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/159033903373.12355.15489763099696629346.stgit@john-Precision-5820-Tower Signed-off-by: Alexei Starovoitov commit 55983299b7ea94d714c19cdfd8d969ba86e0d7e9 Author: Yauheni Kaliuta Date: Mon May 25 09:18:46 2020 +0300 libbpf: Use .so dynamic symbols for abi check Since dynamic symbols are used for dynamic linking it makes sense to use them (readelf --dyn-syms) for abi check. Found with some configuration on powerpc where linker puts local *.plt_call.* symbols into .so. Signed-off-by: Yauheni Kaliuta Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200525061846.16524-1-yauheni.kaliuta@redhat.com Signed-off-by: Alexei Starovoitov commit 0142dddcbe965450338076c486d0d757b3184352 Author: Chris Packham Date: Tue May 26 11:00:24 2020 +1200 bpf: Fix spelling in comment explaining ARG1 in ___bpf_prog_run Change 'handeled' to 'handled'. Signed-off-by: Chris Packham Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200525230025.14470-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Alexei Starovoitov commit 93581359e7aeb11358018f2e3a737776d1e899ae Author: Nikolay Borisov Date: Tue May 26 20:46:12 2020 +0300 libbpf: Install headers as part of make install Current 'make install' results in only pkg-config and library binaries being installed. For consistency also install headers as part of "make install" Signed-off-by: Nikolay Borisov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200526174612.5447-1-nborisov@suse.com Signed-off-by: Alexei Starovoitov commit 272d51af32890632134845ddf35318c11da20c7b Author: Eelco Chaudron Date: Tue May 26 11:21:42 2020 +0200 libbpf: Add API to consume the perf ring buffer content This new API, perf_buffer__consume, can be used as follows: - When you have a perf ring where wakeup_events is higher than 1, and you have remaining data in the rings you would like to pull out on exit (or maybe based on a timeout). - For low latency cases where you burn a CPU that constantly polls the queues. Signed-off-by: Eelco Chaudron Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159048487929.89441.7465713173442594608.stgit@ebuild Signed-off-by: Alexei Starovoitov commit 2b983b407a3a1f47f7d8595245066854ff352c65 Author: Lukas Bulwahn Date: Mon May 25 16:15:53 2020 +0200 MAINTAINERS: Adjust entry in XDP SOCKETS to actual file name Commit 2b43470add8c ("xsk: Introduce AF_XDP buffer allocation API") added a new header file include/net/xsk_buff_pool.h, but commit 28bee21dc04b ("MAINTAINERS, xsk: Update AF_XDP section after moves/adds") added a file entry referring to include/net/xsk_buffer_pool.h. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: include/net/xsk_buffer_pool.h Adjust the entry in XDP SOCKETS to the actual file name. Signed-off-by: Lukas Bulwahn Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200525141553.7035-1-lukas.bulwahn@gmail.com Signed-off-by: Alexei Starovoitov commit fe537393b5795ecbe5746eec0e16124bc998a594 Author: Jakub Sitnicki Date: Mon May 25 14:29:28 2020 +0200 bpf: Fix returned error sign when link doesn't support updates System calls encode returned errors as negative values. Fix a typo that breaks this convention for bpf(LINK_UPDATE) when bpf_link doesn't support update operation. Fixes: f9d041271cf4 ("bpf: Refactor bpf_link update handling") Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200525122928.1164495-1-jakub@cloudflare.com Signed-off-by: Alexei Starovoitov commit dc3ca5cf3e0be9fb73f4691247367d76a22bf30b Author: Tobias Klauser Date: Mon May 25 15:54:21 2020 +0200 tools, bpftool: Print correct error message when failing to load BTF btf__parse_raw and btf__parse_elf return negative error numbers wrapped in an ERR_PTR, so the extracted value needs to be negated before passing them to strerror which expects a positive error number. Before: Error: failed to load BTF from .../vmlinux: Unknown error -2 After: Error: failed to load BTF from .../vmlinux: No such file or directory Signed-off-by: Tobias Klauser Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200525135421.4154-1-tklauser@distanz.ch Signed-off-by: Alexei Starovoitov commit 73a4f0407e67cdfdf55dd94f573ed4ee2d0d62fe Author: Quentin Monnet Date: Sat May 23 02:02:47 2020 +0100 tools, bpftool: Make capability check account for new BPF caps Following the introduction of CAP_BPF, and the switch from CAP_SYS_ADMIN to other capabilities for various BPF features, update the capability checks (and potentially, drops) in bpftool for feature probes. Because bpftool and/or the system might not know of CAP_BPF yet, some caution is necessary: - If compiled and run on a system with CAP_BPF, check CAP_BPF, CAP_SYS_ADMIN, CAP_PERFMON, CAP_NET_ADMIN. - Guard against CAP_BPF being undefined, to allow compiling bpftool from latest sources on older systems. If the system where feature probes are run does not know of CAP_BPF, stop checking after CAP_SYS_ADMIN, as this should be the only capability required for all the BPF probing. - If compiled from latest sources on a system without CAP_BPF, but later executed on a newer system with CAP_BPF knowledge, then we only test CAP_SYS_ADMIN. Some probes may fail if the bpftool process has CAP_SYS_ADMIN but misses the other capabilities. The alternative would be to redefine the value for CAP_BPF in bpftool, but this does not look clean, and the case sounds relatively rare anyway. Note that libcap offers a cap_to_name() function to retrieve the name of a given capability (e.g. "cap_sys_admin"). We do not use it because deriving the names from the macros looks simpler than using cap_to_name() (doing a strdup() on the string) + cap_free() + handling the case of failed allocations, when we just want to use the name of the capability in an error message. The checks when compiling without libcap (i.e. root versus non-root) are unchanged. v2: - Do not allocate cap_list dynamically. - Drop BPF-related capabilities when running with "unprivileged", even if we didn't have the full set in the first place (in v1, we would skip dropping them in that case). - Keep track of what capabilities we have, print the names of the missing ones for privileged probing. - Attempt to drop only the capabilities we actually have. - Rename a couple variables. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200523010247.20654-1-quentin@isovalent.com Signed-off-by: Alexei Starovoitov commit 90040351a832acf862c8f1855c29411303d23755 Author: Quentin Monnet Date: Sat May 23 02:07:51 2020 +0100 tools, bpftool: Clean subcommand help messages This is a clean-up for the formatting of the do_help functions for bpftool's subcommands. The following fixes are included: - Do not use argv[-2] for "iter" help message, as the help is shown by default if no "iter" action is selected, resulting in messages looking like "./bpftool bpftool pin...". - Do not print unused HELP_SPEC_PROGRAM in help message for "bpftool link". - Andrii used argument indexing to avoid having multiple occurrences of bin_name and argv[-2] in the fprintf() for the help message, for "bpftool gen" and "bpftool link". Let's reuse this for all other help functions. We can remove up to thirty arguments for the "bpftool map" help message. - Harmonise all functions, e.g. use ending quotes-comma on a separate line. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200523010751.23465-1-quentin@isovalent.com Signed-off-by: Alexei Starovoitov commit dc1dad8e1a612650b1e786e992cb0c6e101e226a Author: Ilya Dryomov Date: Fri May 29 20:51:23 2020 +0200 rbd: compression_hint option Allow hinting to bluestore if the data should/should not be compressed. The default is to not hint (compression_hint=none). Signed-off-by: Ilya Dryomov Reviewed-by: Jason Dillaman commit d3798acc094c8ff2406e9acc7a9b2c09da994616 Author: Ilya Dryomov Date: Fri May 29 20:31:37 2020 +0200 libceph: support for alloc hint flags Allow indicating future I/O pattern via flags. This is supported since Kraken (and bluestore persists flags together with expected_object_size and expected_write_size). Signed-off-by: Ilya Dryomov Reviewed-by: Jason Dillaman commit 0a319ef75d931de0b21882ec17d8d70ece0aa871 Merge: eff5ddadab04 55e00fb66fd5 Author: Linus Torvalds Date: Mon Jun 1 14:09:26 2020 -0700 Merge tag 'x86-fpu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 FPU updates from Ingo Molnar: "Most of the changes here related to 'XSAVES supervisor state' support, which is a feature that allows kernel-only data to be automatically saved/restored by the FPU context switching code. CPU features that can be supported this way are Intel PT, 'PASID' and CET features" * tag 'x86-fpu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu/xstate: Restore supervisor states for signal return x86/fpu/xstate: Preserve supervisor states for the slow path in __fpu__restore_sig() x86/fpu: Introduce copy_supervisor_to_kernel() x86/fpu/xstate: Update copy_kernel_to_xregs_err() for supervisor states x86/fpu/xstate: Update sanitize_restored_xstate() for supervisor xstates x86/fpu/xstate: Define new functions for clearing fpregs and xstates x86/fpu/xstate: Introduce XSAVES supervisor states x86/fpu/xstate: Separate user and supervisor xfeatures mask x86/fpu/xstate: Define new macros for supervisor and user xstates x86/fpu/xstate: Rename validate_xstate_header() to validate_user_xstate_header() commit 775024cf49ff76c30757bac9a21f6e908b63f6b5 Author: Helge Deller Date: Mon Jun 1 23:03:27 2020 +0200 parisc: MAINTAINERS: Update references to parisc website The PA-RISC Linux project web page is now hosted at https://parisc.wiki.kernel.org Signed-off-by: Helge Deller commit 486a77c90346b6145353e69351803e17d91be3f6 Author: Helge Deller Date: Mon Jun 1 23:03:04 2020 +0200 parisc: module: Update references to parisc website The PA-RISC Linux project web page is now hosted at https://parisc.wiki.kernel.org Signed-off-by: Helge Deller commit 186cbb1737762b86b79a715662b17e6270f8c4f6 Author: Helge Deller Date: Mon Jun 1 23:02:39 2020 +0200 parisc: hardware: Update references to parisc website The PA-RISC Linux project web page is now hosted at https://parisc.wiki.kernel.org Signed-off-by: Helge Deller commit 861e93cf88b3722daf75947aa6c8ac342f238911 Author: Helge Deller Date: Mon Jun 1 23:02:11 2020 +0200 parisc: firmware: Update references to parisc website The PA-RISC Linux project web page is now hosted at https://parisc.wiki.kernel.org Signed-off-by: Helge Deller commit 24289f5601182974f20b9e46ce81eb2c51664518 Author: Helge Deller Date: Mon Jun 1 23:00:52 2020 +0200 parisc: Kconfig: Update references to parisc website The PA-RISC Linux project web page is now hosted at https://parisc.wiki.kernel.org Signed-off-by: Helge Deller commit eff5ddadab04dc7ae8c4588dd3eef2ecad770fd7 Merge: 17e0a7cb6a25 3d81b3d1e55a Author: Linus Torvalds Date: Mon Jun 1 13:57:51 2020 -0700 Merge tag 'x86-cpu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpu updates from Ingo Molnar: "Misc updates: - Extend the x86 family/model macros with a steppings dimension, because x86 life isn't complex enough and Intel uses steppings to differentiate between different CPUs. :-/ - Convert the TSC deadline timer quirks to the steppings macros. - Clean up asm mnemonics. - Fix the handling of an AMD erratum, or in other words, fix a kernel erratum" * tag 'x86-cpu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Use RDRAND and RDSEED mnemonics in archrandom.h x86/cpu: Use INVPCID mnemonic in invpcid.h x86/cpu/amd: Make erratum #1054 a legacy erratum x86/apic: Convert the TSC deadline timer matching to steppings macro x86/cpu: Add a X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS() macro x86/cpu: Add a steppings field to struct x86_cpu_id commit 17e0a7cb6a254c6d086562e7adf8b7ac24d267f3 Merge: bb548bedf5c5 2ca41f555e85 Author: Linus Torvalds Date: Mon Jun 1 13:47:10 2020 -0700 Merge tag 'x86-cleanups-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Ingo Molnar: "Misc cleanups, with an emphasis on removing obsolete/dead code" * tag 'x86-cleanups-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/spinlock: Remove obsolete ticket spinlock macros and types x86/mm: Drop deprecated DISCONTIGMEM support for 32-bit x86/apb_timer: Drop unused declaration and macro x86/apb_timer: Drop unused TSC calibration x86/io_apic: Remove unused function mp_init_irq_at_boot() x86/mm: Stop printing BRK addresses x86/audit: Fix a -Wmissing-prototypes warning for ia32_classify_syscall() x86/nmi: Remove edac.h include leftover mm: Remove MPX leftovers x86/mm/mmap: Fix -Wmissing-prototypes warnings x86/early_printk: Remove unused includes crash_dump: Remove no longer used saved_max_pfn x86/smpboot: Remove the last ICPU() macro commit bb548bedf5c596f72b6388804b3cbd2f78c9dc98 Merge: ae1a4113c244 38f3e775e9c2 Author: Linus Torvalds Date: Mon Jun 1 13:45:59 2020 -0700 Merge tag 'x86-build-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build updates from Ingo Molnar: "Misc dependency fixes, plus a documentation update about memory protection keys support" * tag 'x86-build-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/Kconfig: Update config and kernel doc for MPK feature on AMD x86/boot: Discard .discard.unreachable for arch/x86/boot/compressed/vmlinux x86/boot/build: Add phony targets in arch/x86/boot/Makefile to PHONY x86/boot/build: Make 'make bzlilo' not depend on vmlinux or $(obj)/bzImage x86/boot/build: Add cpustr.h to targets and remove clean-files commit ae1a4113c24470007424ea0e1d2e31336edd7296 Merge: d861f6e6829c 5214028dd89e Author: Linus Torvalds Date: Mon Jun 1 13:44:28 2020 -0700 Merge tag 'x86-boot-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 boot updates from Ingo Molnar: "Misc updates: - Add the initrdmem= boot option to specify an initrd embedded in RAM (flash most likely) - Sanitize the CS value earlier during boot, which also fixes SEV-ES - Various fixes and smaller cleanups" * tag 'x86-boot-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Correct relocation destination on old linkers x86/boot/compressed/64: Switch to __KERNEL_CS after GDT is loaded x86/boot: Fix -Wint-to-pointer-cast build warning x86/boot: Add kstrtoul() from lib/ x86/tboot: Mark tboot static x86/setup: Add an initrdmem= option to specify initrd physical address commit d861f6e6829ce586bcf5823ab7d348f09be3c8fb Merge: 58ff3b7604a4 fb7fb84a0c4e Author: Linus Torvalds Date: Mon Jun 1 13:38:55 2020 -0700 Merge tag 'smp-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull SMP updates from Ingo Molnar: "Misc cleanups in the SMP hotplug and cross-call code" * tag 'smp-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Remove __freeze_secondary_cpus() cpu/hotplug: Remove disable_nonboot_cpus() cpu/hotplug: Fix a typo in comment "broadacasted"->"broadcasted" smp: Use smp_call_func_t in on_each_cpu() commit 58ff3b7604a461a766a84348e620834dce9834a9 Merge: a7092c82042b e9524fb97ab5 Author: Linus Torvalds Date: Mon Jun 1 13:35:27 2020 -0700 Merge tag 'efi-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI updates from Ingo Molnar: "The EFI changes for this cycle are: - preliminary changes for RISC-V - Add support for setting the resolution on the EFI framebuffer - Simplify kernel image loading for arm64 - Move .bss into .data via the linker script instead of relying on symbol annotations. - Get rid of __pure getters to access global variables - Clean up the config table matching arrays - Rename pr_efi/pr_efi_err to efi_info/efi_err, and use them consistently - Simplify and unify initrd loading - Parse the builtin command line on x86 (if provided) - Implement printk() support, including support for wide character strings - Simplify GDT handling in early mixed mode thunking code - Some other minor fixes and cleanups" * tag 'efi-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (79 commits) efi/x86: Don't blow away existing initrd efi/x86: Drop the special GDT for the EFI thunk efi/libstub: Add missing prototype for PE/COFF entry point efi/efivars: Add missing kobject_put() in sysfs entry creation error path efi/libstub: Use pool allocation for the command line efi/libstub: Don't parse overlong command lines efi/libstub: Use snprintf with %ls to convert the command line efi/libstub: Get the exact UTF-8 length efi/libstub: Use %ls for filename efi/libstub: Add UTF-8 decoding to efi_puts efi/printf: Add support for wchar_t (UTF-16) efi/gop: Add an option to list out the available GOP modes efi/libstub: Add definitions for console input and events efi/libstub: Implement printk-style logging efi/printf: Turn vsprintf into vsnprintf efi/printf: Abort on invalid format efi/printf: Refactor code to consolidate padding and output efi/printf: Handle null string input efi/printf: Factor out integer argument retrieval efi/printf: Factor out width/precision parsing ... commit 6d6861d45e38d42a7df9db244c871ee3856acf57 Author: Anders Roxell Date: Mon May 11 15:14:42 2020 +0200 security: apparmor: default KUNIT_* fragments to KUNIT_ALL_TESTS This makes it easier to enable all KUnit fragments. Adding 'if !KUNIT_ALL_TESTS' so individual tests can not be turned off. Therefore if KUNIT_ALL_TESTS is enabled that will hide the prompt in menuconfig. Reviewed-by: David Gow Signed-off-by: Anders Roxell Acked-by: John Johansen Signed-off-by: Shuah Khan commit d194e12b3ed3c4799951072271f001cbd104b5e9 Author: Anders Roxell Date: Mon May 11 15:14:38 2020 +0200 fs: ext4: default KUNIT_* fragments to KUNIT_ALL_TESTS This makes it easier to enable all KUnit fragments. Adding 'if !KUNIT_ALL_TESTS' so individual tests can not be turned off. Therefore if KUNIT_ALL_TESTS is enabled that will hide the prompt in menuconfig. Reviewed-by: David Gow Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan commit bebe94b53eb7ee28f436f7b45324e37713690c0f Author: Anders Roxell Date: Mon May 11 15:14:33 2020 +0200 drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS This makes it easier to enable all KUnit fragments. Adding 'if !KUNIT_ALL_TESTS' so individual tests can not be turned off. Therefore if KUNIT_ALL_TESTS is enabled that will hide the prompt in menuconfig. Reviewed-by: David Gow Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan commit a7092c82042b4ba3000cf7b369d1032161c5d4c9 Merge: 69fc06f70f45 5cde265384ca Author: Linus Torvalds Date: Mon Jun 1 13:23:59 2020 -0700 Merge tag 'perf-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf updates from Ingo Molnar: "Kernel side changes: - Add AMD Fam17h RAPL support - Introduce CAP_PERFMON to kernel and user space - Add Zhaoxin CPU support - Misc fixes and cleanups Tooling changes: - perf record: Introduce '--switch-output-event' to use arbitrary events to be setup and read from a side band thread and, when they take place a signal be sent to the main 'perf record' thread, reusing the core for '--switch-output' to take perf.data snapshots from the ring buffer used for '--overwrite', e.g.: # perf record --overwrite -e sched:* \ --switch-output-event syscalls:*connect* \ workload will take perf.data.YYYYMMDDHHMMSS snapshots up to around the connect syscalls. Add '--num-synthesize-threads' option to control degree of parallelism of the synthesize_mmap() code which is scanning /proc/PID/task/PID/maps and can be time consuming. This mimics pre-existing behaviour in 'perf top'. - perf bench: Add a multi-threaded synthesize benchmark and kallsyms parsing benchmark. - Intel PT support: Stitch LBR records from multiple samples to get deeper backtraces, there are caveats, see the csets for details. Allow using Intel PT to synthesize callchains for regular events. Add support for synthesizing branch stacks for regular events (cycles, instructions, etc) from Intel PT data. Misc changes: - Updated perf vendor events for power9 and Coresight. - Add flamegraph.py script via 'perf flamegraph' - Misc other changes, fixes and cleanups - see the Git log for details Also, since over the last couple of years perf tooling has matured and decoupled from the kernel perf changes to a large degree, going forward Arnaldo is going to send perf tooling changes via direct pull requests" * tag 'perf-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (163 commits) perf/x86/rapl: Add AMD Fam17h RAPL support perf/x86/rapl: Make perf_probe_msr() more robust and flexible perf/x86/rapl: Flip logic on default events visibility perf/x86/rapl: Refactor to share the RAPL code between Intel and AMD CPUs perf/x86/rapl: Move RAPL support to common x86 code perf/core: Replace zero-length array with flexible-array perf/x86: Replace zero-length array with flexible-array perf/x86/intel: Add more available bits for OFFCORE_RESPONSE of Intel Tremont perf/x86/rapl: Add Ice Lake RAPL support perf flamegraph: Use /bin/bash for report and record scripts perf cs-etm: Move definition of 'traceid_list' global variable from header file libsymbols kallsyms: Move hex2u64 out of header libsymbols kallsyms: Parse using io api perf bench: Add kallsyms parsing perf: cs-etm: Update to build with latest opencsd version. perf symbol: Fix kernel symbol address display perf inject: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf annotate: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf trace: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf script: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() ... commit 5f215aab4ea0cf39e9fcdb721733a7814f3a3a50 Author: Anders Roxell Date: Mon May 11 15:14:29 2020 +0200 lib: Kconfig.debug: default KUNIT_* fragments to KUNIT_ALL_TESTS This makes it easier to enable all KUnit fragments. Adding 'if !KUNIT_ALL_TESTS' so individual tests can not be turned off. Therefore if KUNIT_ALL_TESTS is enabled that will hide the prompt in menuconfig. Reviewed-by: David Gow Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan commit beaed42c427dbe8fedba4518b2baf5203f5e398b Author: Anders Roxell Date: Mon May 11 15:14:25 2020 +0200 kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS This makes it easier to enable all KUnit fragments. Adding 'if !KUNIT_ALL_TESTS' so individual tests can not be turned off. Therefore if KUNIT_ALL_TESTS is enabled that will hide the prompt in menuconfig. Reviewed-by: David Gow Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan commit 92238b31bd054cc2a046df96507575f3f10c277f Author: Anders Roxell Date: Mon May 11 15:14:20 2020 +0200 kunit: Kconfig: enable a KUNIT_ALL_TESTS fragment Make it easier to enable all KUnit fragments. This is useful for kernel devs or testers, so its easy to get all KUnit tests enabled and if new gets added they will be enabled as well. Fragments that has to be builtin will be missed if CONFIG_KUNIT_ALL_TESTS is set as a module. Signed-off-by: Anders Roxell Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 01397e822af42f8485e876ba9d1309b63646d886 Author: Vitor Massaru Iha Date: Fri May 29 16:28:45 2020 -0300 kunit: Fix TabError, remove defconfig code and handle when there is no kunitconfig The identation before this code (`if not os.path.exists(cli_args.build_dir):``) was with spaces instead of tabs after fixed up merge conflits, this commit revert spaces to tabs: [iha@bbking linux]$ tools/testing/kunit/kunit.py run File "tools/testing/kunit/kunit.py", line 247 if not linux: ^ TabError: inconsistent use of tabs and spaces in indentation [iha@bbking linux]$ tools/testing/kunit/kunit.py run Traceback (most recent call last): File "tools/testing/kunit/kunit.py", line 338, in main(sys.argv[1:]) File "tools/testing/kunit/kunit.py", line 215, in main add_config_opts(config_parser) [iha@bbking linux]$ tools/testing/kunit/kunit.py run Traceback (most recent call last): File "tools/testing/kunit/kunit.py", line 337, in main(sys.argv[1:]) File "tools/testing/kunit/kunit.py", line 255, in main result = run_tests(linux, request) File "tools/testing/kunit/kunit.py", line 133, in run_tests request.defconfig, AttributeError: 'KunitRequest' object has no attribute 'defconfig' Handles when there is no .kunitconfig, the error due to merge conflicts between the following: commit 9bdf64b35117 ("kunit: use KUnit defconfig by default") commit 45ba7a893ad8 ("kunit: kunit_tool: Separate out config/build/exec/parse") [iha@bbking linux]$ tools/testing/kunit/kunit.py run Traceback (most recent call last): File "tools/testing/kunit/kunit.py", line 335, in main(sys.argv[1:]) File "tools/testing/kunit/kunit.py", line 246, in main linux = kunit_kernel.LinuxSourceTree() File "../tools/testing/kunit/kunit_kernel.py", line 109, in __init__ self._kconfig.read_from_file(kunitconfig_path) File "t../ools/testing/kunit/kunit_config.py", line 88, in read_from_file with open(path, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig' Signed-off-by: Vitor Massaru Iha Signed-off-by: Shuah Khan commit 69fc06f70f4569c9969f99fe25bdc9a6bb537b43 Merge: 60056060bede 0decf1f8de91 Author: Linus Torvalds Date: Mon Jun 1 13:13:00 2020 -0700 Merge tag 'objtool-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool updates from Ingo Molnar: "There are a lot of objtool changes in this cycle, all across the map: - Speed up objtool significantly, especially when there are large number of sections - Improve objtool's understanding of special instructions such as IRET, to reduce the number of annotations required - Implement 'noinstr' validation - Do baby steps for non-x86 objtool use - Simplify/fix retpoline decoding - Add vmlinux validation - Improve documentation - Fix various bugs and apply smaller cleanups" * tag 'objtool-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (54 commits) objtool: Enable compilation of objtool for all architectures objtool: Move struct objtool_file into arch-independent header objtool: Exit successfully when requesting help objtool: Add check_kcov_mode() to the uaccess safelist samples/ftrace: Fix asm function ELF annotations objtool: optimize add_dead_ends for split sections objtool: use gelf_getsymshndx to handle >64k sections objtool: Allow no-op CFI ops in alternatives x86/retpoline: Fix retpoline unwind x86: Change {JMP,CALL}_NOSPEC argument x86: Simplify retpoline declaration x86/speculation: Change FILL_RETURN_BUFFER to work with objtool objtool: Add support for intra-function calls objtool: Move the IRET hack into the arch decoder objtool: Remove INSN_STACK objtool: Make handle_insn_ops() unconditional objtool: Rework allocating stack_ops on decode objtool: UNWIND_HINT_RET_OFFSET should not check registers objtool: is_fentry_call() crashes if call has no destination x86,smap: Fix smap_{save,restore}() alternatives ... commit 60056060bede58c3073dccb8a5e73a6c40804aa9 Merge: 2227e5b21aec 19f545b6e07f Author: Linus Torvalds Date: Mon Jun 1 13:03:31 2020 -0700 Merge tag 'locking-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Ingo Molnar: "The biggest change to core locking facilities in this cycle is the introduction of local_lock_t - this primitive comes from the -rt project and identifies CPU-local locking dependencies normally handled opaquely beind preempt_disable() or local_irq_save/disable() critical sections. The generated code on mainline kernels doesn't change as a result, but still there are benefits: improved debugging and better documentation of data structure accesses. The new local_lock_t primitives are introduced and then utilized in a couple of kernel subsystems. No change in functionality is intended. There's also other smaller changes and cleanups" * tag 'locking-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: zram: Use local lock to protect per-CPU data zram: Allocate struct zcomp_strm as per-CPU memory connector/cn_proc: Protect send_msg() with a local lock squashfs: Make use of local lock in multi_cpu decompressor mm/swap: Use local_lock for protection radix-tree: Use local_lock for protection locking: Introduce local_lock() locking/lockdep: Replace zero-length array with flexible-array locking/rtmutex: Remove unused rt_mutex_cmpxchg_relaxed() commit 166e4b4841974465d73d650468895b725023c81e Merge: 5debcd01e28f d63ed4ff41bb 56fbeefe366e 571cfadcc628 353afa3a8d2e Author: Stephen Boyd Date: Mon Jun 1 13:00:56 2020 -0700 Merge branches 'clk-vc5', 'clk-hsdk', 'clk-mediatek' and 'clk-baikal' into clk-next - Support IDT VersaClock 5P49V5925 - Bunch of updates for HSDK clock generation unit (CGU) driver - New clk driver for Baikal-T1 SoCs * clk-vc5: dt: Add bindings for IDT VersaClock 5P49V5925 clk: vc5: Add support for IDT VersaClock 5P49V6965 * clk-hsdk: CLK: HSDK: CGU: add support for 148.5MHz clock CLK: HSDK: CGU: support PLL bypassing CLK: HSDK: CGU: check if PLL is bypassed first * clk-mediatek: clk: mediatek: assign the initial value to clk_init_data of mtk_mux clk: mediatek: Add MT6765 clock support clk: mediatek: add mt6765 clock IDs dt-bindings: clock: mediatek: document clk bindings vcodecsys for Mediatek MT6765 SoC dt-bindings: clock: mediatek: document clk bindings mipi0a for Mediatek MT6765 SoC dt-bindings: clock: mediatek: document clk bindings for Mediatek MT6765 SoC * clk-baikal: clk: Add Baikal-T1 CCU Dividers driver clk: Add Baikal-T1 CCU PLLs driver dt-bindings: clk: Add Baikal-T1 CCU Dividers binding dt-bindings: clk: Add Baikal-T1 CCU PLLs binding commit 5debcd01e28f34f0c212ed8d60f257630bec0588 Merge: b6f3162d0e9a 725262d29139 d036466330d1 e480fe10adfe b1e8d713e6b2 f9eec2ea7852 Author: Stephen Boyd Date: Mon Jun 1 13:00:28 2020 -0700 Merge branches 'clk-mmp', 'clk-intel', 'clk-ingenic', 'clk-qcom' and 'clk-silabs' into clk-next - Start making audio and GPU clks work on Marvell MMP2/MMP3 SoCs - Add support for X1830 and X1000 Ingenic SoC clk controllers - Add support for Qualcomm's MSM8939 Generic Clock Controller - Add some GPU, NPU, and UFS clks to Qualcomm SM8150 driver - Enable supply regulators for GPU gdscs on Qualcomm SoCs - Add support for Si5342, Si5344 and Si5345 chips * clk-mmp: clk: mmp2: Add audio clock controller driver dt-bindings: clock: Add Marvell MMP Audio Clock Controller binding clk: mmp2: Add support for power islands dt-bindings: marvell,mmp2: Add ids for the power domains dt-bindings: clock: Make marvell,mmp2-clock a power controller clk: mmp2: Add the audio clock clk: mmp2: Add the I2S clocks clk: mmp2: Rename mmp2_pll_init() to mmp2_main_clk_init() clk: mmp2: Move thermal register defines up a bit dt-bindings: marvell,mmp2: Add clock id for the Audio clock dt-bindings: marvell,mmp2: Add clock id for the I2S clocks clk: mmp: frac: Allow setting bits other than the numerator/denominator clk: mmp: frac: Do not lose last 4 digits of precision * clk-intel: clk: intel: remove redundant initialization of variable rate64 clk: intel: Add CGU clock driver for a new SoC dt-bindings: clk: intel: Add bindings document & header file for CGU * clk-ingenic: clk: ingenic: Mark ingenic_tcu_of_match as __maybe_unused clk: X1000: Add FIXDIV for SSI clock of X1000. dt-bindings: clock: Add and reorder ABI for X1000. clk: Ingenic: Add CGU driver for X1830. dt-bindings: clock: Add X1830 clock bindings. clk: Ingenic: Adjust cgu code to make it compatible with X1830. clk: Ingenic: Remove unnecessary spinlock when reading registers. * clk-qcom: clk: qcom: Add missing msm8998 ufs_unipro_core_clk_src dt-bindings: clock: Add YAML schemas for QCOM A53 PLL clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller clk: qcom: gcc: Add support for Secure control source clock dt-bindings: clock: Add gcc_sec_ctrl_clk_src clock ID clk: qcom: gcc: Add support for a new frequency for SC7180 clk: qcom: Add DT bindings for MSM8939 GCC clk: qcom: gcc: Add missing UFS clocks for SM8150 clk: qcom: gcc: Add GPU and NPU clocks for SM8150 clk: qcom: mmcc-msm8996: Properly describe GPU_GX gdsc clk: qcom: gdsc: Handle GDSC regulator supplies clk: qcom: msm8916: Fix the address location of pll->config_reg * clk-silabs: clk: clk-si5341: Add support for the Si5345 series commit b6f3162d0e9ab499e8912c7255596bfd8b9e94f7 Merge: 8c88e568b54a 2c1c9696450f 6f4d3c13b71c dc543267c7ad a403bbab1a73 2d491066ccd4 Author: Stephen Boyd Date: Mon Jun 1 13:00:21 2020 -0700 Merge branches 'clk-unisoc', 'clk-trivial', 'clk-bcm', 'clk-st' and 'clk-ast2600' into clk-next * clk-unisoc: clk: sprd: add mipi_csi_xx gate clocks clk: sprd: add dt-bindings include for mipi_csi_xx clocks dt-bindings: clk: sprd: add mipi_csi_xx clocks for SC9863A clk: sprd: check its parent status before reading gate clock clk: sprd: return correct type of value for _sprd_pll_recalc_rate clk: sprd: mark the local clock symbols static * clk-trivial: clk: versatile: remove redundant assignment to pointer clk clk: clk-xgene: Fix a typo in Kconfig clk: Remove unused inline function clk_debug_reparent * clk-bcm: clk: bcm2835: Constify struct debugfs_reg32 clk: bcm2835: Remove casting to bcm2835_clk_register clk: bcm2835: Fix return type of bcm2835_register_gate * clk-st: clk: clk-flexgen: fix clock-critical handling * clk-ast2600: clk: ast2600: Fix AHB clock divider for A1 commit 8c88e568b54ad92d21b5897f758a80c58df657e6 Merge: 3a57530b7ded c60037f0d780 5484bb83efaf 9d66e85784f1 80c6b7a0894f 03a1ee1dad0e c5bd76d93e72 Author: Stephen Boyd Date: Mon Jun 1 13:00:00 2020 -0700 Merge branches 'clk-tegra', 'clk-imx', 'clk-zynq', 'clk-socfpga', 'clk-at91' and 'clk-ti' into clk-next - Support custom flags in Xilinx zynq firmware - Various small fixes to the Xilinx clk driver - Support for Intel Agilex clks * clk-tegra: clk: tegra: Add Tegra210 CSI TPG clock gate clk: tegra30: Use custom CCLK implementation clk: tegra20: Use custom CCLK implementation clk: tegra: cclk: Add helpers for handling PLLX rate changes clk: tegra: pll: Add pre/post rate-change hooks clk: tegra: Add custom CCLK implementation clk: tegra: Remove the old emc_mux clock for Tegra210 clk: tegra: Implement Tegra210 EMC clock clk: tegra: Export functions for EMC clock scaling clk: tegra: Add PLLP_UD and PLLMB_UD for Tegra210 clk: tegra: Rename Tegra124 EMC clock source file dt-bindings: clock: tegra: Add clock ID for CSI TPG clock * clk-imx: clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice clk: imx: add imx8m_clk_hw_composite_bus clk: imx: add mux ops for i.MX8M composite clk clk: imx8m: migrate A53 clk root to use composite core clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code clk: imx8mp: Define gates for pll1/2 fixed dividers clk: imx: imx8mp: fix pll mux bit clk: imx8m: drop clk_hw_set_parent for A53 dt-bindings: clocks: imx8mp: Add ids for audiomix clocks clk: imx: Add helpers for passing the device as argument clk: imx: pll14xx: Add the device as argument when registering clk: imx: gate2: Allow single bit gating clock clk: imx: clk-pllv3: Use readl_relaxed_poll_timeout() for PLL lock wait clk: imx: clk-sscg-pll: Remove unnecessary blank lines clk: imx: drop the dependency on ARM64 for i.MX8M clk: imx7ulp: make it easy to change ARM core clk clk: imx: imx6ul: change flexcan clock to support CiA bitrates * clk-zynq: clk: zynqmp: Make zynqmp_clk_get_max_divisor static clk: zynqmp: Update fraction clock check from custom type flags clk: zynqmp: Add support for custom type flags clk: zynqmp: fix memory leak in zynqmp_register_clocks clk: zynqmp: Fix invalid clock name queries clk: zynqmp: Fix divider2 calculation clk: zynqmp: Limit bestdiv with maxdiv * clk-socfpga: clk: socfpga: agilex: add clock driver for the Agilex platform dt-bindings: documentation: add clock bindings information for Agilex clk: socfpga: add const to _ops data structures clk: socfpga: remove clk_ops enable/disable methods clk: socfpga: stratix10: use new parent data scheme * clk-at91: clk: at91: allow setting all PMC clock parents via DT clk: at91: allow setting PCKx parent via DT clk: at91: optimize pmc data allocation clk: at91: pmc: decrement node's refcount clk: at91: pmc: do not continue if compatible not located clk: at91: Add peripheral clock for PTC * clk-ti: clk: ti: dra7: remove two unused symbols clk: ti: dra7xx: fix RNG clock parent clk: ti: dra7xx: mark MCAN clock as DRA76x only clk: ti: dra7xx: fix gpu clkctrl parent clk: ti: omap5: Add proper parent clocks for l4-secure clocks clk: ti: omap4: Add proper parent clocks for l4-secure clocks clk: ti: composite: fix memory leak commit 3a57530b7ded7a75ebb963bbcc7e35b002478362 Merge: bc8c945e0ad2 07fbf0e58deb 571a6b4755e8 fe95d2e92efa 33b52f7cc99e Author: Stephen Boyd Date: Mon Jun 1 12:59:46 2020 -0700 Merge branches 'clk-selectable', 'clk-amlogic', 'clk-renesas', 'clk-samsung' and 'clk-allwinner' into clk-next - Allow the COMMON_CLK config to be selectable * clk-selectable: clk: Move HAVE_CLK config out of architecture layer MIPS: Loongson64: Drop asm/clock.h include ARM: mmp: Remove legacy clk code clk: Allow the common clk framework to be selectable mmc: meson-mx-sdio: Depend on OF_ADDRESS and not just OF MIPS: Remove redundant CLKDEV_LOOKUP selects h8300: Remove redundant CLKDEV_LOOKUP selects arm64: tegra: Remove redundant CLKDEV_LOOKUP selects ARM: Remove redundant CLKDEV_LOOKUP selects ARM: Remove redundant COMMON_CLK selects * clk-amlogic: clk: meson: meson8b: Don't rely on u-boot to init all GP_PLL registers clk: meson: meson8b: Make the CCF use the glitch-free VPU mux clk: meson: meson8b: Fix the vclk_div{1, 2, 4, 6, 12}_en gate bits clk: meson: meson8b: Fix the polarity of the RESET_N lines clk: meson: meson8b: Fix the first parent of vid_pll_in_sel clk: meson: g12a: Prepare the GPU clock tree to change at runtime clk: meson: gxbb: Prepare the GPU clock tree to change at runtime clk: meson: meson8b: make the hdmi_sys clock tree mutable clk: meson8b: export the HDMI system clock * clk-renesas: dt-bindings: clock: renesas: mstp: Convert to json-schema dt-bindings: clock: renesas: div6: Convert to json-schema clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling clk: renesas: rcar-gen2: Remove superfluous CLK_RENESAS_DIV6 selects clk: renesas: cpg-mssr: Add R8A7742 support dt-bindings: clock: renesas: cpg-mssr: Document r8a7742 binding clk: renesas: Add r8a7742 CPG Core Clock Definitions dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros MAINTAINERS: Add DT Bindings for Renesas Clock Generators clk: renesas: r9a06g032: Fix some typo in comments dt-bindings: clock: renesas: rcar-usb2-clock-sel: Add r8a77961 support * clk-samsung: clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1 ARM/SAMSUNG EXYNOS ARM ARCHITECTURES: Use fallthrough; clk: samsung: Fix CLK_SMMU_FIMCL3 clock name on Exynos542x clk: samsung: Mark top ISP and CAM clocks on Exynos542x as critical * clk-allwinner: clk: sunxi: Fix incorrect usage of round_down() commit 2227e5b21aec6c5f7f6491352f0c19fd02d19418 Merge: 0bd957eb11cf cb3cb6733fbd Author: Linus Torvalds Date: Mon Jun 1 12:56:29 2020 -0700 Merge tag 'core-rcu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RCU updates from Ingo Molnar: "The RCU updates for this cycle were: - RCU-tasks update, including addition of RCU Tasks Trace for BPF use and TASKS_RUDE_RCU - kfree_rcu() updates. - Remove scheduler locking restriction - RCU CPU stall warning updates. - Torture-test updates. - Miscellaneous fixes and other updates" * tag 'core-rcu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (103 commits) rcu: Allow for smp_call_function() running callbacks from idle rcu: Provide rcu_irq_exit_check_preempt() rcu: Abstract out rcu_irq_enter_check_tick() from rcu_nmi_enter() rcu: Provide __rcu_is_watching() rcu: Provide rcu_irq_exit_preempt() rcu: Make RCU IRQ enter/exit functions rely on in_nmi() rcu/tree: Mark the idle relevant functions noinstr x86: Replace ist_enter() with nmi_enter() x86/mce: Send #MC singal from task work x86/entry: Get rid of ist_begin/end_non_atomic() sched,rcu,tracing: Avoid tracing before in_nmi() is correct sh/ftrace: Move arch_ftrace_nmi_{enter,exit} into nmi exception lockdep: Always inline lockdep_{off,on}() hardirq/nmi: Allow nested nmi_enter() arm64: Prepare arch_nmi_enter() for recursion printk: Disallow instrumenting print_nmi_enter() printk: Prepare for nested printk_nmi_enter() rcutorture: Convert ULONG_CMP_LT() to time_before() torture: Add a --kasan argument torture: Save a few lines by using config_override_param initially ... commit 0bd957eb11cfeef23fcc240edde6dfe431731e69 Merge: 9bf9511e3d9f 66e9b0717102 Author: Linus Torvalds Date: Mon Jun 1 12:45:04 2020 -0700 Merge tag 'core-kprobes-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull kprobes updates from Ingo Molnar: "Various kprobes updates, mostly centered around cleaning up the no-instrumentation logic. Instead of the current per debug facility blacklist, use the more generic .noinstr.text approach, combined with a 'noinstr' marker for functions. Also add instrumentation_begin()/end() to better manage the exact place in entry code where instrumentation may be used. And add a kprobes blacklist for modules" * tag 'core-kprobes-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: kprobes: Prevent probes in .noinstr.text section vmlinux.lds.h: Create section for protection against instrumentation samples/kprobes: Add __kprobes and NOKPROBE_SYMBOL() for handlers. kprobes: Support NOKPROBE_SYMBOL() in modules kprobes: Support __kprobes blacklist in modules kprobes: Lock kprobe_mutex while showing kprobe_blacklist commit 9bf9511e3d9f328c03f6f79bfb741c3d18f2f2c0 Merge: ef34ba6d36af 0c4d5ba1b998 Author: Linus Torvalds Date: Mon Jun 1 12:24:14 2020 -0700 Merge tag 'x86_cache_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cache resource control updates from Borislav Petkov: "Add support for wider Memory Bandwidth Monitoring counters by querying their width from CPUID. As a prerequsite for that, streamline and unify the CPUID detection of the respective resource control attributes. By Reinette Chatre" * tag 'x86_cache_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/resctrl: Support wider MBM counters x86/resctrl: Support CPUID enumeration of MBM counter width x86/resctrl: Maintain MBM counter width per resource x86/resctrl: Query LLC monitoring properties once during boot x86/resctrl: Remove unnecessary RMID checks x86/cpu: Move resctrl CPUID code to resctrl/ x86/resctrl: Rename asm/resctrl_sched.h to asm/resctrl.h commit ef34ba6d36af9e6f5918f7f7e287be4b70a358b4 Merge: 8b11dd54add6 9adbf3c609af Author: Linus Torvalds Date: Mon Jun 1 12:22:53 2020 -0700 Merge tag 'x86_microcode_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode update from Borislav Petkov: "A single fix for late microcode loading to handle the correct return value from stop_machine(), from Mihai Carabas" * tag 'x86_microcode_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode: Fix return value for microcode late loading commit 8b11dd54add63aa398c4b239d31b7f4477a4b859 Merge: ca1f5df23f28 2a02ca0428cf Author: Linus Torvalds Date: Mon Jun 1 12:21:34 2020 -0700 Merge tag 'edac_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - Fix i10nm_edac loading on some Ice Lake and Tremont/Jacobsville steppings due to the offset change of the bus number configuration register, by Qiuxu Zhuo. - The usual cleanups and fixes all over the place. * tag 'edac_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/amd64: Remove redundant assignment to variable ret in hw_info_get() EDAC/skx: Use the mcmtr register to retrieve close_pg/bank_xor_enable EDAC/i10nm: Update driver to support different bus number config register offsets EDAC, {skx,i10nm}: Make some configurations CPU model specific EDAC/amd8131: Remove defined but not used bridge_str EDAC/thunderx: Make symbols static MAINTAINERS: Remove sifive_l2_cache.c from EDAC-SIFIVE pattern EDAC/xgene: Remove set but not used address local var EDAC/armada_xp: Fix some log messages commit eae9d3c0167df840e821317040efcf0ca6789cb9 Author: Vladimir Oltean Date: Sun May 31 21:25:51 2020 +0300 net: dsa: sja1105: suppress -Wmissing-prototypes in sja1105_vl.c Newer C compilers are complaining about the fact that there are no function prototypes in sja1105_vl.c for the non-static functions. Give them what they want. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ca1f5df23f28228c46aa45d934abad38c6b6ff2e Merge: 4d67829e1186 8b390ab725fd Author: Linus Torvalds Date: Mon Jun 1 12:13:30 2020 -0700 Merge tag 'printk-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Benjamin Herrenschmidt solved a problem with non-matched console aliases by first checking consoles defined on the command line. It is a more conservative approach than the previous attempts. - Benjamin also made sure that the console accessible via /dev/console always has CON_CONSDEV flag. - Andy Shevchenko added the %ptT modifier for printing struct time64_t. It extends the existing %ptR handling for struct rtc_time. - Bruno Meneguele fixed /dev/kmsg error value returned by unsupported SEEK_CUR. - Tetsuo Handa removed unused pr_cont_once(). ... and a few small fixes. * tag 'printk-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: Remove pr_cont_once() printk: handle blank console arguments passed in. kernel/printk: add kmsg SEEK_CUR handling printk: Fix a typo in comment "interator"->"iterator" usb: pulse8-cec: Switch to use %ptT ARM: bcm2835: Switch to use %ptT lib/vsprintf: Print time64_t in human readable format lib/vsprintf: update comment about simple_strto() functions printk: Correctly set CON_CONSDEV even when preferred console was not registered printk: Fix preferred console selection with multiple matches printk: Move console matching logic into a separate function printk: Convert a use of sprintf to snprintf in console_unlock commit 4d67829e11863072aec7cd1dd2939b1fd3eda17b Merge: afdb0f2ec57d 9cd6b593cfc9 Author: Linus Torvalds Date: Mon Jun 1 12:11:56 2020 -0700 Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fsverity updates from Eric Biggers: "Fix kerneldoc warnings and some coding style inconsistencies. This mirrors the similar cleanups being done in fs/crypto/" * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fs-verity: remove unnecessary extern keywords fs-verity: fix all kerneldoc warnings commit afdb0f2ec57d4899eda2c5e09fc3a005f2119690 Merge: 829f3b9401fe e3b1078bedd3 Author: Linus Torvalds Date: Mon Jun 1 12:10:17 2020 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fscrypt updates from Eric Biggers: - Add the IV_INO_LBLK_32 encryption policy flag which modifies the encryption to be optimized for eMMC inline encryption hardware. - Make the test_dummy_encryption mount option for ext4 and f2fs support v2 encryption policies. - Fix kerneldoc warnings and some coding style inconsistencies. * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: add support for IV_INO_LBLK_32 policies fscrypt: make test_dummy_encryption use v2 by default fscrypt: support test_dummy_encryption=v2 fscrypt: add fscrypt_add_test_dummy_key() linux/parser.h: add include guards fscrypt: remove unnecessary extern keywords fscrypt: name all function parameters fscrypt: fix all kerneldoc warnings commit 2a2e01e7b1e00ff36741fefcf3a526709355252b Merge: 03eaeda7806d b5e19a642b7e Author: David S. Miller Date: Mon Jun 1 12:09:08 2020 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-31 This series contains updates to the ice driver only. Brett modifies the driver to allow users to clear a VF's administratively set MAC address on the PF. Fixes the driver to recognize an existing VLAN tag when DMAC/SMAC is enabled in a packet. Fixes an issue, so that VF's are reset after any VF port VLAN modifications are made on the PF. Made sure the register QRXFLXP_CNTXT is cleared before writing a new value to ensure the previous value is not passed forward. Updates the PF to allow the VF to request a reset as soon as it has been initialized. Fixes an issue to ensure when a VSI is created, it uses the current coalesce value, not the default value. Paul allows untrusted VF's to add 16 filters. Dan increases the timeout needed after a PFR to allow ample time for package download. Chinh adjust the define value for the number of PHY speeds we currently support. Changes the driver to ignore EMODE error when configuring the PHY. Jesse fixes an issue which was preventing a user from configuring the interface before bringing it up. Henry fixes the logic for adding back perfect flows after flow director filter does a deletion. Bruce fixes line wrappings to make it more consistent. ==================== Signed-off-by: David S. Miller commit 829f3b9401fe7cc3c1f3642bb2520751a42a87df Merge: 81e8c10dac62 78c08247b9d3 Author: Linus Torvalds Date: Mon Jun 1 12:07:34 2020 -0700 Merge tag 'pstore-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore updates from Kees Cook: "Fixes and new features for pstore. This is a pretty big set of changes (relative to past pstore pulls), but it has been in -next for a while. The biggest change here is the ability to support a block device as a pstore backend, which has been desired for a while. A lot of additional fixes and refactorings are also included, mostly in support of the new features. - refactor pstore locking for safer module unloading (Kees Cook) - remove orphaned records from pstorefs when backend unloaded (Kees Cook) - refactor dump_oops parameter into max_reason (Pavel Tatashin) - introduce pstore/zone for common code for contiguous storage (WeiXiong Liao) - introduce pstore/blk for block device backend (WeiXiong Liao) - introduce mtd backend (WeiXiong Liao)" * tag 'pstore-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (35 commits) mtd: Support kmsg dumper based on pstore/blk pstore/blk: Introduce "best_effort" mode pstore/blk: Support non-block storage devices pstore/blk: Provide way to query pstore configuration pstore/zone: Provide way to skip "broken" zone for MTD devices Documentation: Add details for pstore/blk pstore/zone,blk: Add ftrace frontend support pstore/zone,blk: Add console frontend support pstore/zone,blk: Add support for pmsg frontend pstore/blk: Introduce backend for block devices pstore/zone: Introduce common layer to manage storage zones ramoops: Add "max-reason" optional field to ramoops DT node pstore/ram: Introduce max_reason and convert dump_oops pstore/platform: Pass max_reason to kmesg dump printk: Introduce kmsg_dump_reason_str() printk: honor the max_reason field in kmsg_dumper printk: Collapse shutdown types into a single dump reason pstore/ftrace: Provide ftrace log merging routine pstore/ram: Refactor ftrace buffer merging pstore/ram: Refactor DT size parsing ... commit 03eaeda7806dcafb221a66939fcec9748619d16a Author: Roopa Prabhu Date: Sat May 30 22:17:20 2020 -0700 vxlan: fix dereference of nexthop group in nexthop update path fix dereference of nexthop group in fdb nexthop group update validation path. Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Reported-by: Ido Schimmel Suggested-by: Ido Schimmel Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 547ce4cfb34cdecfa0ee19c29a5510329a7ac802 Author: Al Viro Date: Sun May 31 02:06:55 2020 +0100 switch cmsghdr_from_user_compat_to_kern() to copy_from_user() no point getting compat_cmsghdr field-by-field Signed-off-by: Al Viro Signed-off-by: David S. Miller commit a477605fdb282a38493a9ff10b6a9a4db138ae57 Merge: 3190ca3b5f51 07beb1651adc Author: David S. Miller Date: Mon Jun 1 12:04:32 2020 -0700 Merge branch 'dpaa2-eth-add-PFC-support' Ioana Ciornei says: ==================== dpaa2-eth: add PFC support This patch set adds support for Priority Flow Control in DPAA2 Ethernet devices. The first patch make the necessary changes so that multiple traffic classes are configured. The dequeue priority of the maximum 8 traffic classes is configured to be equal. The second patch adds a static distribution to said traffic classes based on the VLAN PCP field. In the future, this could be extended through the .setapp() DCB callback for dynamic configuration. Also, add support for the congestion group taildrop mechanism that allows us to control the number of frames that can accumulate on a group of Rx frame queues belonging to the same traffic class. The basic subset of the DCB ops is implemented so that the user can query the number of PFC capable traffic classes, their state and reconfigure them if necessary. Changes in v3: - add patches 6-7 which add the PFC functionality - patch 2/7: revert to explicitly cast mask to u16 * to not get into sparse warnings Changes in v4: - really fix the sparse warnings in 2/7 ==================== Signed-off-by: David S. Miller commit 07beb1651adcd324f4d91584d5cab75d5882a9c2 Author: Ioana Ciornei Date: Sun May 31 00:08:14 2020 +0300 dpaa2-eth: Keep congestion group taildrop enabled when PFC on Leave congestion group taildrop enabled for all traffic classes when PFC is enabled. Notification threshold is low enough such that it will be hit first and this also ensures that FQs on traffic classes which are not PFC enabled won't drain the buffer pool. FQ taildrop threshold is kept disabled as long as any form of flow control is on. Since FQ taildrop works with bytes, not number of frames, we can't guarantee it will not interfere with the congestion notification mechanism for all frame sizes. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit f395b69f40f580491ef56f2395a98e3189baa53c Author: Ioana Ciornei Date: Sun May 31 00:08:13 2020 +0300 dpaa2-eth: Add PFC support through DCB ops Add support in dpaa2-eth for PFC (Priority Flow Control) through the DCB ops. Instruct the hardware to respond to received PFC frames. Current firmware doesn't allow us to selectively enable PFC on the Rx side for some priorities only, so we will react to all incoming PFC frames (and stop transmitting on the traffic classes specified in the frame). Also, configure the hardware to generate PFC frames based on Rx congestion notifications. When a certain number of frames accumulate in the ingress queues corresponding to a traffic class, priority flow control frames are generated for that TC. The number of PFC traffic classes available can be queried through lldptool. Also, which of those traffic classes have PFC enabled is also controlled through the same dcbnl_rtnl_ops callbacks. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 3f8b826d705fc6f0f0602fcbe6ee3b646ed3316e Author: Ioana Radulescu Date: Sun May 31 00:08:12 2020 +0300 dpaa2-eth: Update FQ taildrop threshold and buffer pool count Now that we have congestion group taildrop configured at all times, we can afford to increase the frame queue taildrop threshold; this will ensure a better response when receiving bursts of large-sized frames. Also decouple the buffer pool count from the Rx FQ taildrop threshold, as above change would increase it too much. Instead, keep the old count as a hardcoded value. With the new limits, we try to ensure that: * we allow enough leeway for large frame bursts (by buffering enough of them in queues to avoid heavy dropping in case of bursty traffic, but when overall ingress bandwidth is manageable) * allow pending frames to be evenly spread between ingress FQs, regardless of frame size * avoid dropping frames due to the buffer pool being empty; this is not a bad behaviour per se, but system overall response is more linear and predictable when frames are dropped at frame queue/group level. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 2c8d1c8d7d62dfedab97927c22e9421f0d72de8e Author: Ioana Radulescu Date: Sun May 31 00:08:11 2020 +0300 dpaa2-eth: Add congestion group taildrop The increase in number of ingress frame queues means we now risk depleting the buffer pool before the FQ taildrop kicks in. Congestion group taildrop allows us to control the number of frames that can accumulate on a group of Rx frame queues belonging to the same traffic class. This setting coexists with the frame queue based taildrop: whichever limit gets hit first triggers the frame drop. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit ad054f265401d8279837a916e9b5a5aee2a1749d Author: Ioana Radulescu Date: Sun May 31 00:08:10 2020 +0300 dpaa2-eth: Add helper functions Add convenient helper functions that determines whether Rx/Tx pause frames are enabled based on link state flags received from firmware. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 6aa90fe2d96745b63d4ccc74c0c37b90d31b699e Author: Ioana Radulescu Date: Sun May 31 00:08:09 2020 +0300 dpaa2-eth: Distribute ingress frames based on VLAN prio Configure static ingress classification based on VLAN PCP field. If the DPNI doesn't have enough traffic classes to accommodate all priority levels, the lowest ones end up on TC 0 (default on miss). Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 685e39eaf4b5bf68167c799fe683e26cdc43a5ea Author: Ioana Radulescu Date: Sun May 31 00:08:08 2020 +0300 dpaa2-eth: Add support for Rx traffic classes The firmware reserves for each DPNI a number of RX frame queues equal to the number of configured flows x number of configured traffic classes. Current driver configuration directs all incoming traffic to FQs corresponding to TC0, leaving all other priority levels unused. Start adding support for multiple ingress traffic classes, by configuring the FQs associated with all priority levels, not just TC0. All settings that are per-TC, such as those related to hashing and flow steering, are also updated. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 3190ca3b5f51a0e471ee3f04c898401c81b00385 Author: Michael Walle Date: Sat May 30 22:34:04 2020 +0200 net: phy: broadcom: don't export RDB/legacy access methods Don't export __bcm_phy_enable_rdb_access() and __bcm_phy_enable_legacy_access() functions. They aren't used outside this module and it was forgotten to provide a prototype for these functions. Just make them static for now. Fixes: 11ecf8c55b91 ("net: phy: broadcom: add cable test support") Reported-by: kbuild test robot Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 96aa1b22bd6bb9fccf62f6261f390ed6f3e7967f Author: Willem de Bruijn Date: Sat May 30 15:41:31 2020 -0400 tun: correct header offsets in napi frags mode Tun in IFF_NAPI_FRAGS mode calls napi_gro_frags. Unlike netif_rx and netif_gro_receive, this expects skb->data to point to the mac layer. But skb_probe_transport_header, __skb_get_hash_symmetric, and xdp_do_generic in tun_get_user need skb->data to point to the network header. Flow dissection also needs skb->protocol set, so eth_type_trans has to be called. Ensure the link layer header lies in linear as eth_type_trans pulls ETH_HLEN. Then take the same code paths for frags as for not frags. Push the link layer header back just before calling napi_gro_frags. By pulling up to ETH_HLEN from frag0 into linear, this disables the frag0 optimization in the special case when IFF_NAPI_FRAGS is used with zero length iov[0] (and thus empty skb->linear). Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Willem de Bruijn Acked-by: Petar Penkov Signed-off-by: David S. Miller commit 4e4f4ce6abf5f6a8df0561776d3a790d60d519d0 Author: Guillaume Nault Date: Sat May 30 20:49:56 2020 +0200 cls_flower: remove mpls_opts_policy Compiling with W=1 gives the following warning: net/sched/cls_flower.c:731:1: warning: ‘mpls_opts_policy’ defined but not used [-Wunused-const-variable=] The TCA_FLOWER_KEY_MPLS_OPTS contains a list of TCA_FLOWER_KEY_MPLS_OPTS_LSE. Therefore, the attributes all have the same type and we can't parse the list with nla_parse*() and have the attributes validated automatically using an nla_policy. fl_set_key_mpls_opts() properly verifies that all attributes in the list are TCA_FLOWER_KEY_MPLS_OPTS_LSE. Then fl_set_key_mpls_lse() uses nla_parse_nested() on all these attributes, thus verifying that they have the NLA_F_NESTED flag. So we can safely drop the mpls_opts_policy. Reported-by: kbuild test robot Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 81e8c10dac62c427b25f6bbb07936806e4dd9e8a Merge: 729ea4e06420 58ca0060ec4e Author: Linus Torvalds Date: Mon Jun 1 12:00:10 2020 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Introduce crypto_shash_tfm_digest() and use it wherever possible. - Fix use-after-free and race in crypto_spawn_alg. - Add support for parallel and batch requests to crypto_engine. Algorithms: - Update jitter RNG for SP800-90B compliance. - Always use jitter RNG as seed in drbg. Drivers: - Add Arm CryptoCell driver cctrng. - Add support for SEV-ES to the PSP driver in ccp" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (114 commits) crypto: hisilicon - fix driver compatibility issue with different versions of devices crypto: engine - do not requeue in case of fatal error crypto: cavium/nitrox - Fix a typo in a comment crypto: hisilicon/qm - change debugfs file name from qm_regs to regs crypto: hisilicon/qm - add DebugFS for xQC and xQE dump crypto: hisilicon/zip - add debugfs for Hisilicon ZIP crypto: hisilicon/hpre - add debugfs for Hisilicon HPRE crypto: hisilicon/sec2 - add debugfs for Hisilicon SEC crypto: hisilicon/qm - add debugfs to the QM state machine crypto: hisilicon/qm - add debugfs for QM crypto: stm32/crc32 - protect from concurrent accesses crypto: stm32/crc32 - don't sleep in runtime pm crypto: stm32/crc32 - fix multi-instance crypto: stm32/crc32 - fix run-time self test issue. crypto: stm32/crc32 - fix ext4 chksum BUG_ON() crypto: hisilicon/zip - Use temporary sqe when doing work crypto: hisilicon - add device error report through abnormal irq crypto: hisilicon - remove codes of directly report device errors through MSI crypto: hisilicon - QM memory management optimization crypto: hisilicon - unify initial value assignment into QM ... commit 2a67ab99aad078504ded787211351a12717c6e96 Merge: 3e1c6846b9e1 c6676e7d62cf Author: David S. Miller Date: Mon Jun 1 11:56:11 2020 -0700 Merge branch 'bridge-mrp-Add-support-for-MRA-role' Horatiu Vultur says: ==================== bridge: mrp: Add support for MRA role This patch series extends the MRP with the MRA role. A node that has the MRA role can behave as a MRM or as a MRC. In case there are multiple nodes in the topology that has the MRA role then only one node can behave as MRM and all the others need to be have as MRC. The node that has the higher priority(lower value) will behave as MRM. A node that has the MRA role and behaves as MRC, it just needs to forward the MRP_Test frames between the ring ports but also it needs to detect in case it stops receiving MRP_Test frames. In that case it would try to behave as MRM. v2: - add new patch that fixes sparse warnings - fix parsing of prio attribute ==================== Signed-off-by: David S. Miller commit c6676e7d62cfb5cb7c1c5320a26f3634a11afdb0 Author: Horatiu Vultur Date: Sat May 30 18:09:48 2020 +0000 bridge: mrp: Add support for role MRA A node that has the MRA role, it can behave as MRM or MRC. Initially it starts as MRM and sends MRP_Test frames on both ring ports. If it detects that there are MRP_Test send by another MRM, then it checks if these frames have a lower priority than itself. In this case it would send MRP_Nack frames to notify the other node that it needs to stop sending MRP_Test frames. If it receives a MRP_Nack frame then it stops sending MRP_Test frames and starts to behave as a MRC but it would continue to monitor the MRP_Test frames send by MRM. If at a point the MRM stops to send MRP_Test frames it would get the MRM role and start to send MRP_Test frames. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 4b3a61b030d1131dcf3633a276158a3d0a435a47 Author: Horatiu Vultur Date: Sat May 30 18:09:47 2020 +0000 bridge: mrp: Set the priority of MRP instance Each MRP instance has a priority, a lower value means a higher priority. The priority of MRP instance is stored in MRP_Test frame in this way all the MRP nodes in the ring can see other nodes priority. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 7e89ed8ab3f74e0746d3ea80537d7a06b0e27732 Author: Horatiu Vultur Date: Sat May 30 18:09:46 2020 +0000 bridge: mrp: Update MRP frame type Replace u16/u32 with be16/be32 in the MRP frame types. This fixes sparse warnings like: warning: cast to restricted __be16 Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 729ea4e064202aeec149b034b459501ef0a5060e Merge: d30fc97c6068 b4203ce05563 Author: Linus Torvalds Date: Mon Jun 1 11:53:50 2020 -0700 Merge tag 'i3c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c update from Boris Brezillon: "Fix GETMRL's logic" * tag 'i3c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c master: GETMRL's 3rd byte is optional even with BCR_IBI_PAYLOAD commit 3e1c6846b9e108740ef8a37be80314053f5dd52a Author: Jia-Ju Bai Date: Sat May 30 10:41:50 2020 +0800 net: vmxnet3: fix possible buffer overflow caused by bad DMA value in vmxnet3_get_rss() The value adapter->rss_conf is stored in DMA memory, and it is assigned to rssConf, so rssConf->indTableSize can be modified at anytime by malicious hardware. Because rssConf->indTableSize is assigned to n, buffer overflow may occur when the code "rssConf->indTable[n]" is executed. To fix this possible bug, n is checked after being used. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 0af413bd3e2de73bcf0742ed556be4af83c71964 Author: Arnd Bergmann Date: Fri May 29 22:13:58 2020 +0200 flow_dissector: work around stack frame size warning The fl_flow_key structure is around 500 bytes, so having two of them on the stack in one function now exceeds the warning limit after an otherwise correct change: net/sched/cls_flower.c:298:12: error: stack frame size of 1056 bytes in function 'fl_classify' [-Werror,-Wframe-larger-than=] I suspect the fl_classify function could be reworked to only have one of them on the stack and modify it in place, but I could not work out how to do that. As a somewhat hacky workaround, move one of them into an out-of-line function to reduce its scope. This does not necessarily reduce the stack usage of the outer function, but at least the second copy is removed from the stack during most of it and does not add up to whatever is called from there. I now see 552 bytes of stack usage for fl_classify(), plus 528 bytes for fl_mask_lookup(). Fixes: 58cff782cc55 ("flow_dissector: Parse multiple MPLS Label Stack Entries") Signed-off-by: Arnd Bergmann Acked-by: Cong Wang Acked-by: Guillaume Nault Signed-off-by: David S. Miller commit 6f197fb63850b26ef8f70f1bfe5900e377910a5a Author: Roelof Berg Date: Fri May 29 21:30:02 2020 +0200 lan743x: Added fixed link and RGMII support Microchip lan7431 is frequently connected to a phy. However, it can also be directly connected to a MII remote peer without any phy in between. For supporting such a phyless hardware setup in Linux we utilized phylib, which supports a fixed-link configuration via the device tree. And we added support for defining the connection type R/GMII in the device tree. New behavior: ------------- . The automatic speed and duplex detection of the lan743x silicon between mac and phy is disabled. Instead phylib is used like in other typical Linux drivers. The usage of phylib allows to specify fixed-link parameters in the device tree. . The device tree entry phy-connection-type is supported now with the modes RGMII or (G)MII (default). Development state: ------------------ . Tested with fixed-phy configurations. Not yet tested in normal configurations with phy. Microchip kindly offered testing as soon as the Corona measures allow this. . All review findings of Andrew Lunn are included Example: -------- &pcie { status = "okay"; host@0 { reg = <0 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; ethernet@0 { compatible = "weyland-yutani,noscom1", "microchip,lan743x"; status = "okay"; reg = <0 0 0 0 0>; phy-connection-type = "rgmii"; fixed-link { speed = <100>; full-duplex; }; }; }; }; Signed-off-by: Roelof Berg Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit ff0f63832984bb665450e200a52b3455431255dd Merge: af0a2482fa0f 9959b389779a Author: David S. Miller Date: Mon Jun 1 11:49:24 2020 -0700 Merge branch 'devlink-Add-support-for-control-packet-traps' Ido Schimmel says: ==================== devlink: Add support for control packet traps So far device drivers were only able to register drop and exception packet traps with devlink. These traps are used for packets that were either dropped by the underlying device or encountered an exception (e.g., missing neighbour entry) during forwarding. However, in the steady state, the majority of the packets being trapped to the CPU are packets that are required for the correct functioning of the control plane. For example, ARP request and IGMP query packets. This patch set allows device drivers to register such control traps with devlink and expose their default control plane policy to user space. User space can then tune the packet trap policer settings according to its needs, as with existing packet traps. In a similar fashion to exception traps, the action associated with such traps cannot be changed as it can easily break the control plane. Unlike drop and exception traps, packets trapped via control traps are not reported to the kernel's drop monitor as they are not indicative of any problem. Patch set overview: Patches #1-#3 break out layer 3 exceptions to a different group to provide better granularity. A future patch set will make this completely configurable. Patch #4 adds a new trap action ('mirror') that is used for packets that are forwarded by the device and sent to the CPU. Such packets are marked by device drivers with 'skb->offload_fwd_mark = 1' in order to prevent the kernel from forwarding them again. Patch #5 adds the new trap type, 'control'. Patches #6-#8 gradually add various control traps to devlink with proper documentation. Patch #9 adds a few control traps to netdevsim, which are automatically exercised by existing devlink-trap selftest. Patches #10 performs small refactoring in mlxsw. Patches #11-#13 change mlxsw to register its existing control traps with devlink. Patch #14 adds a selftest over mlxsw that exercises all the registered control traps. ==================== Signed-off-by: David S. Miller commit 9959b389779a9e688d1a9272eed6377d999d8739 Author: Ido Schimmel Date: Fri May 29 21:36:49 2020 +0300 selftests: mlxsw: Add test for control packets Generate packets matching the various control traps and check that the traps' stats increase accordingly. Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 88e2774961d7854628fa9c403166c4162cebc12e Author: Ido Schimmel Date: Fri May 29 21:36:48 2020 +0300 mlxsw: spectrum_trap: Register ACL control traps In a similar fashion to other control traps, register ACL control traps with devlink. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 8110668ecd9a9e704b9b412302e76a9c6e1f4ce2 Author: Ido Schimmel Date: Fri May 29 21:36:47 2020 +0300 mlxsw: spectrum_trap: Register layer 3 control traps In a similar fashion to layer 2 control traps, register layer 3 control traps with devlink. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 39c10350cfc8ce23faae651877171e354b9006d4 Author: Ido Schimmel Date: Fri May 29 21:36:46 2020 +0300 mlxsw: spectrum_trap: Register layer 2 control traps In a similar fashion to other traps, register layer 2 control traps with devlink. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 45b1c87313cd2ab2843edd4e6467e3d6458e0c68 Author: Ido Schimmel Date: Fri May 29 21:36:45 2020 +0300 mlxsw: spectrum_trap: Factor out common Rx listener function We currently have an Rx listener function for exception traps that marks received skbs with 'offload_fwd_mark' and injects them to the kernel's Rx path. The marking is done because all these exceptions occur during L3 forwarding, after the packets were potentially flooded at L2. A subsequent patch will add support for control traps. Packets received via some of these control traps need different handling: 1. Packets might not need to be marked with 'offload_fwd_mark'. For example, if packet was trapped before L2 forwarding 2. Packets might not need to be injected to the kernel's Rx path. For example, sampled packets are reported to user space via the psample module Factor out a common Rx listener function that only reports trapped packets to devlink. Call it from mlxsw_sp_rx_no_mark_listener() and mlxsw_sp_rx_mark_listener() that will inject the packets to the kernel's Rx path, without and with the marking, respectively. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 1897936744f0ab366102170d7c76bfc8f7aeb2ba Author: Ido Schimmel Date: Fri May 29 21:36:44 2020 +0300 netdevsim: Register control traps Register two control traps with devlink. The existing selftest at tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh iterates over all registered traps and checks that the action of non-drop traps cannot be changed. Up until now only exception traps were tested, now control traps will be tested as well. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 5eb18a2b6c11bf165271644ef1ab812b10659c8f Author: Ido Schimmel Date: Fri May 29 21:36:43 2020 +0300 devlink: Add ACL control packet traps Add packet traps for packets that are sampled / trapped by ACLs, so that capable drivers could register them with devlink. Add documentation for every added packet trap and packet trap group. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit d77cfd162a346259222d0207a95bf1a0cc0c2520 Author: Ido Schimmel Date: Fri May 29 21:36:42 2020 +0300 devlink: Add layer 3 control packet traps Add layer 3 control packet traps such as ARP and DHCP, so that capable device drivers could register them with devlink. Add documentation for every added packet trap and packet trap group. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 515eac677fe119433c2a466443bef95c10c550cc Author: Ido Schimmel Date: Fri May 29 21:36:41 2020 +0300 devlink: Add layer 2 control packet traps Add layer 2 control packet traps such as STP and IGMP query, so that capable device drivers could register them with devlink. Add documentation for every added packet trap and packet trap group. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 30a4e9a29ab9aadfe6c5386ae4aa396b1d2556c2 Author: Ido Schimmel Date: Fri May 29 21:36:40 2020 +0300 devlink: Add 'control' trap type This type is used for traps that trap control packets such as ARP request and IGMP query to the CPU. Do not report such packets to the kernel's drop monitor as they were not dropped by the device no encountered an exception during forwarding. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 9eefeabed6f831018c15bd7e17d34967ee34d9dd Author: Ido Schimmel Date: Fri May 29 21:36:39 2020 +0300 devlink: Add 'mirror' trap action The action is used by control traps such as IGMP query. The packet is flooded by the device, but also trapped to the CPU in order for the software bridge to mark the receiving port as a multicast router port. Such packets are marked with 'skb->offload_fwd_mark = 1' in order to prevent the software bridge from flooding them again. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 85176f19f5ff579c8c1676b4c170a6535b782584 Author: Ido Schimmel Date: Fri May 29 21:36:38 2020 +0300 netdevsim: Move layer 3 exceptions to exceptions trap group The layer 3 exceptions are still subject to the same trap policer, so nothing changes, but user space can choose to assign a different one. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 1e292f5c11c1e2ef38f416b62c5d616f5768057f Author: Ido Schimmel Date: Fri May 29 21:36:37 2020 +0300 mlxsw: spectrum_trap: Move layer 3 exceptions to exceptions trap group The layer 3 exceptions are still subject to the same trap policer, so nothing changes, but user space can choose to assign a different one. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 678eb199cc9df3bf1cb12fb2da22768b8d1b6bf3 Author: Ido Schimmel Date: Fri May 29 21:36:36 2020 +0300 devlink: Create dedicated trap group for layer 3 exceptions Packets that hit exceptions during layer 3 forwarding must be trapped to the CPU for the control plane to function properly. Create a dedicated group for them, so that user space could choose to assign a different policer for them. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 37744feebc086908fd89760650f458ab19071750 Author: Arnd Bergmann Date: Mon Apr 20 11:37:12 2020 +0200 sh: remove sh5 support sh5 never became a product and has probably never really worked. Remove it by recursively deleting all associated Kconfig options and all corresponding files. Reviewed-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann Signed-off-by: Rich Felker commit d1f56f318d234fc5db230af2f3e0088f689ab3c0 Author: Kuninori Morimoto Date: Thu Dec 12 11:38:43 2019 +0900 sh: add missing EXPORT_SYMBOL() for __delay __delay() is used from kernel module. We need EXPORT_SYMBOL(), otherwise we will get compile error. ERROR: "__delay" [drivers/net/phy/mdio-cavium.ko] undefined! Signed-off-by: Kuninori Morimoto Signed-off-by: Rich Felker commit 3125ddc42487307b59e44c405a3282770475150d Author: Kuninori Morimoto Date: Mon Jan 20 10:22:21 2020 +0900 sh: Convert ins[bwl]/outs[bwl] macros to inline functions Macro ins[bwl]/outs[bwl] are just calling BUG(), but that results in unused variable warnings all over the place. This patch convert macro to inline to avoid warning We will get this kind of warning without this patch ${LINUX}/drivers/iio/adc/ad7606_par.c:21:23: \ warning: unused variable 'st' [-Wunused-variable] struct ad7606_state *st = iio_priv(indio_dev); ^~ Signed-off-by: Kuninori Morimoto Signed-off-by: Rich Felker commit 4580ba4ad2e6b8ddaada3db61d179d4dfac12047 Author: Kuninori Morimoto Date: Mon Jan 20 10:22:17 2020 +0900 sh: Convert iounmap() macros to inline functions Macro iounmap() do nothing, but that results in unused variable warnings all over the place. This patch convert it to inline to avoid warning We will get this warning without this patch ${LINUX}/drivers/thermal/broadcom/ns-thermal.c:78:21: \ warning: unused variable 'ns_thermal' [-Wunused-variable] struct ns_thermal *ns_thermal = platform_get_drvdata(pdev); ^~~~~~~~~~ Fixes: 98c90e5ea34e9 ("sh: remove __iounmap") Signed-off-by: Kuninori Morimoto Signed-off-by: Rich Felker commit 6410607b6eae1a56db4aba44ccc4eb5979cf60ae Author: Kuninori Morimoto Date: Mon Jan 20 10:22:13 2020 +0900 sh: Add missing DECLARE_EXPORT() for __ashiftrt_r4_xx __ashiftrt_r4_xx might be used from kernel module. We need DECLARE_EXPORT() for them, otherwise we will get compile error. This patch adds missing DECLARE_EXPORT() ERROR: "__ashiftrt_r4_25" [drivers/iio/pressure/bmp280.ko] undefined! ERROR: "__ashiftrt_r4_26" [drivers/iio/dac/ad5764.ko] undefined! ERROR: "__ashiftrt_r4_26" [drivers/iio/accel/mma7660.ko] undefined! ERROR: "__ashiftrt_r4_25" [drivers/iio/accel/dmard06.ko] undefined! ERROR: "__ashiftrt_r4_26" [drivers/iio/accel/bma220_spi.ko] undefined! ERROR: "__ashiftrt_r4_25" [drivers/crypto/hisilicon/sec/hisi_sec.ko] undefined! ERROR: "__ashiftrt_r4_26" [drivers/rtc/rtc-x1205.ko] undefined! ERROR: "__ashiftrt_r4_25" [drivers/rtc/rtc-pcf85063.ko] undefined! ERROR: "__ashiftrt_r4_25" [drivers/rtc/rtc-pcf2123.ko] undefined! ERROR: "__ashiftrt_r4_25" [drivers/input/tablet/gtco.ko] undefined! ERROR: "__ashiftrt_r4_26" [drivers/input/mouse/psmouse.ko] undefined! ERROR: "__ashiftrt_r4_28" [drivers/input/mouse/psmouse.ko] undefined! ERROR: "__ashiftrt_r4_28" [drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.ko] undefined! ERROR: "__ashiftrt_r4_28" [fs/udf/udf.ko] undefined! Signed-off-by: Kuninori Morimoto Signed-off-by: Rich Felker commit eface6c5d1a341f59fe6b264f6c798cb259df9b1 Author: Krzysztof Kozlowski Date: Mon Feb 17 17:54:55 2020 +0100 sh: configs: Cleanup old Kconfig IO scheduler options CONFIG_IOSCHED_DEADLINE and CONFIG_IOSCHED_CFQ are gone since commit f382fb0bcef4 ("block: remove legacy IO schedulers"). The IOSCHED_DEADLINE was replaced by MQ_IOSCHED_DEADLINE and it will be now enabled by default (along with MQ_IOSCHED_KYBER). The BFQ_GROUP_IOSCHED is the only multiqueue scheduler which comes with group scheduling so select it in configs previously choosing CFQ_GROUP_IOSCHED. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rich Felker commit 2bbb0e3cc8d4cd51fce9b306e207dba668d39c5f Author: Romain Naour Date: Sun Mar 15 18:51:07 2020 +0100 arch/sh: vmlinux.scr Since the patch [1], building the kernel using a toolchain built with Binutils 2.33.1 prevent booting a sh4 system under Qemu. Apply the patch provided by Alan Modra [2] that fix alignment of rodata. [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ebd2263ba9a9124d93bbc0ece63d7e0fae89b40e [2] https://www.sourceware.org/ml/binutils/2019-12/msg00112.html Signed-off-by: Romain Naour Cc: Alan Modra Signed-off-by: Rich Felker commit bd158322ba5f6190403e6aeb53c1e7b659f9ade8 Author: Bin Meng Date: Sat May 2 04:04:43 2020 -0700 sh: Replace CONFIG_MTD_M25P80 with CONFIG_MTD_SPI_NOR in sh7757lcr_defconfig CONFIG_MTD_M25P80 was removed and replaced by CONFIG_MTD_SPI_NOR in commit b35b9a10362d ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Signed-off-by: Bin Meng Signed-off-by: Rich Felker commit 01a4dc0d8dee90d156c6af6a0d970f5a8767a90f Author: Krzysztof Kozlowski Date: Wed May 27 22:53:41 2020 +0200 sh: sh4a: Bring back tmu3_device early device Commit 1399c195ef50 ("sh: Switch to new style TMU device") converted tmu3_device platform device to new style of platform data but removed it from sh7786_early_devices array effectively removing last three timers and causing a warning: arch/sh/kernel/cpu/sh4a/setup-sh7786.c:243:31: warning: ‘tmu3_device’ defined but not used [-Wunused-variable] Fixes: 1399c195ef50 ("sh: Switch to new style TMU device") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Signed-off-by: Rich Felker commit af0a2482fa0fe04c63cc63f6d064f011865385fd Merge: a74d19ba7c41 5b6743fb2c2a Author: David S. Miller Date: Mon Jun 1 11:46:30 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next to extend ctnetlink and the flowtable infrastructure: 1) Extend ctnetlink kernel side netlink dump filtering capabilities, from Romain Bellan. 2) Generalise the flowtable hook parser to take a hook list. 3) Pass a hook list to the flowtable hook registration/unregistration. 4) Add a helper function to release the flowtable hook list. 5) Update the flowtable event notifier to pass a flowtable hook list. 6) Allow users to add new devices to an existing flowtables. 7) Allow users to remove devices to an existing flowtables. 8) Allow for registering a flowtable with no initial devices. ==================== Signed-off-by: David S. Miller commit a74d19ba7c41b6c1e424ef4fb7d4600f43ff75e5 Author: Liu Xiang Date: Fri May 29 23:24:56 2020 +0800 net: fec: disable correct clk in the err path of fec_enet_clk_enable When enable clk_ref failed, clk_ptp should be disabled rather than clk_ref itself. Signed-off-by: Liu Xiang Signed-off-by: David S. Miller commit 0c34bb598c510e070160029f34efeeb217000f8d Author: Alexander Sverdlin Date: Fri May 29 14:17:10 2020 +0200 net: octeon: mgmt: Repair filling of RX ring The removal of mips_swiotlb_ops exposed a problem in octeon_mgmt Ethernet driver. mips_swiotlb_ops had an mb() after most of the operations and the removal of the ops had broken the receive functionality of the driver. My code inspection has shown no other places except octeon_mgmt_rx_fill_ring() where an explicit barrier would be obviously missing. The latter function however has to make sure that "ringing the bell" doesn't happen before RX ring entry is really written. The patch has been successfully tested on Octeon II. Fixes: a999933db9ed ("MIPS: remove mips_swiotlb_ops") Cc: stable@vger.kernel.org Signed-off-by: Alexander Sverdlin Signed-off-by: David S. Miller commit d30fc97c60682f9bf5d6898ab370de0007e96742 Merge: a36de5ebac2b 5fb565b69dab Author: Linus Torvalds Date: Mon Jun 1 11:45:02 2020 -0700 Merge tag 'regulator-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "The big change in this release is that Matti Vaittinen has factored out the linear ranges support into a separate library in lib/ since it is also useful for at least the power subsystem (and most likely others too), it helps subsystems which need to map register values into more useful real world values do so with minimal per-driver code. - Factoring out of the linear ranges support into a library in lib/ from Matti Vaittinen. - Trace points for bypass mode. - Use the consumer name in debugfs to make it easier to understand. - New drivers for Maxim MAX77826 and MAX8998" * tag 'regulator-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (23 commits) regulator: max8998: max8998_set_current_limit() can be static dt-bindings: regulator: Convert anatop regulator to json-schema regulator: core: Add regulator bypass trace points regulator: extract voltage balancing code to the separate function regulator/mfd: max8998: Document charger regulator regulator: max8998: Add charger regulator MAINTAINERS: Add maintainer entry for linear ranges helper regulator: bd718x7: remove voltage change restriction from BD71847 LDOs lib: linear_ranges: Add missing MODULE_LICENSE() regulator: use linear_ranges helper power: supply: bd70528: rename linear_range to avoid collision lib/test_linear_ranges: add a test for the 'linear_ranges' lib: add linear ranges helpers regulator: db8500-prcmu: Use true,false for bool variable regulator: bd718x7: remove voltage change restriction from BD71847 regulator: max77826: Remove erroneous additionalProperties regulator: qcom-rpmh: Fix typos in pm8150 and pm8150l regulator: Document bindings for max77826 regulator: max77826: Add max77826 regulator driver regulator: tps80031: remove redundant assignment to variables ret and val ... commit a36de5ebac2bea1d30e9ad103b4f841a2c4bb61b Merge: 213fd09e1aff fb02b9eb4e33 Author: Linus Torvalds Date: Mon Jun 1 11:42:38 2020 -0700 Merge tag 'spi-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "This has been a very active release for the DesignWare driver in particular - after a long period of inactivity we have had a lot of people actively working on it for unrelated reasons this cycle with some of that work still not landed. Otherwise it's been fairly quiet for the subsystem. Highlights include: - Lots of performance improvements and fixes for the DesignWare driver from Serge Semin, Andy Shevchenko, Wan Ahmad Zainie, Clement Leger, Dinh Nguyen and Jarkko Nikula. - Support for octal mode transfers in spidev. - Slave mode support for the Rockchip drivers. - Support for AMD controllers, Broadcom mspi and Raspberry Pi 4, and Intel Elkhart Lake" * tag 'spi-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (125 commits) spi: spi-fsl-dspi: fix native data copy spi: Convert DW SPI binding to DT schema spi: dw: Refactor mid_spi_dma_setup() to separate DMA and IRQ config spi: dw: Make DMA request line assignments explicit for Intel Medfield spi: bcm2835: Remove shared interrupt support dt-bindings: snps,dw-apb-ssi: add optional reset property spi: dw: add reset control spi: bcm2835: Enable shared interrupt support spi: bcm2835: Implement shutdown callback spi: dw: Use regset32 DebugFS method to create regdump file spi: dw: Add DMA support to the DW SPI MMIO driver spi: dw: Cleanup generic DW DMA code namings spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI spi: dw: Move Non-DMA code to the DW PCIe-SPI driver spi: dw: Add core suffix to the DW APB SSI core source file spi: dw: Fix Rx-only DMA transfers spi: dw: Use DMA max burst to set the request thresholds spi: dw: Parameterize the DMA Rx/Tx burst length spi: dw: Add SPI Rx-done wait method to DMA-based transfer ... commit 2aec17f1997b514bc84951f99f7dae9b4b6d8b26 Merge: a01c245438c5 709ffbe19b77 Author: David S. Miller Date: Mon Jun 1 11:42:01 2020 -0700 Merge branch 'fix-indirect-flow_block-infrastructure' Pablo Neira Ayuso says: ==================== the indirect flow_block infrastructure, revisited This series fixes b5140a36da78 ("netfilter: flowtable: add indr block setup support") that adds support for the indirect block for the flowtable. This patch crashes the kernel with the TC CT action. [ 630.908086] BUG: kernel NULL pointer dereference, address: 00000000000000f0 [ 630.908233] #PF: error_code(0x0000) - not-present page [ 630.908304] PGD 800000104addd067 P4D 800000104addd067 PUD 104311d067 PMD 0 [ 630.908380] Oops: 0000 [#1] SMP PTI [ 630.908615] RIP: 0010:nf_flow_table_indr_block_cb+0xc0/0x190 [nf_flow_table] [ 630.908690] Code: 5b 41 5c 41 5d 41 5e 41 5f 5d c3 4c 89 75 a0 4c 89 65 a8 4d 89 ee 49 89 dd 4c 89 fe 48 c7 c7 b7 64 36 a0 31 c0 e8 ce ed d8 e0 <49> 8b b7 f0 00 00 00 48 c7 c7 c8 64 36 a0 31 c0 e8 b9 ed d8 e0 49[ 630.908790] RSP: 0018:ffffc9000895f8c0 EFLAGS: 00010246 [...] [ 630.910774] Call Trace: [ 630.911192] ? mlx5e_rep_indr_setup_block+0x270/0x270 [mlx5_core] [ 630.911621] ? mlx5e_rep_indr_setup_block+0x270/0x270 [mlx5_core] [ 630.912040] ? mlx5e_rep_indr_setup_block+0x270/0x270 [mlx5_core] [ 630.912443] flow_block_cmd+0x51/0x80 [ 630.912844] __flow_indr_block_cb_register+0x26c/0x510 [ 630.913265] mlx5e_nic_rep_netdevice_event+0x9e/0x110 [mlx5_core] [ 630.913665] notifier_call_chain+0x53/0xa0 [ 630.914063] raw_notifier_call_chain+0x16/0x20 [ 630.914466] call_netdevice_notifiers_info+0x39/0x90 [ 630.914859] register_netdevice+0x484/0x550 [ 630.915256] __ip_tunnel_create+0x12b/0x1f0 [ip_tunnel] [ 630.915661] ip_tunnel_init_net+0x116/0x180 [ip_tunnel] [ 630.916062] ipgre_tap_init_net+0x22/0x30 [ip_gre] [ 630.916458] ops_init+0x44/0x110 [ 630.916851] register_pernet_operations+0x112/0x200 A workaround patch to cure this crash has been proposed. However, there is another problem: The indirect flow_block still does not work for the new TC CT action. The problem is that the existing flow_indr_block_entry callback assumes you can look up for the flowtable from the netdevice to get the flow_block. This flow_block allows you to offload the flows via TC_SETUP_CLSFLOWER. Unfortunately, it is not possible to get the flow_block from the TC CT flowtables because they are _not_ bound to any specific netdevice. = What is the indirect flow_block infrastructure? The indirect flow_block infrastructure allows drivers to offload tc/netfilter rules that belong to software tunnel netdevices, e.g. vxlan. This indirect flow_block infrastructure relates tunnel netdevices with drivers because there is no obvious way to relate these two things from the control plane. = How does the indirect flow_block work before this patchset? Front-ends register the indirect block callback through flow_indr_add_block_cb() if they support for offloading tunnel netdevices. == Setting up an indirect block 1) Drivers track tunnel netdevices via NETDEV_{REGISTER,UNREGISTER} events. If there is a new tunnel netdevice that the driver can offload, then the driver invokes __flow_indr_block_cb_register() with the new tunnel netdevice and the driver callback. The __flow_indr_block_cb_register() call iterates over the list of the front-end callbacks. 2) The front-end callback sets up the flow_block_offload structure and it invokes the driver callback to set up the flow_block. 3) The driver callback now registers the flow_block structure and it returns the flow_block back to the front-end. 4) The front-end gets the flow_block object and it is now ready to offload rules for this tunnel netdevice. A simplified callgraph is represented below. Front-end Driver NETDEV_REGISTER | __flow_indr_block_cb_register(netdev, cb_priv, driver_cb) | [1] .--------------frontend_indr_block_cb(cb_priv, driver_cb) | . setup_flow_block_offload(bo) | [2] driver_cb(bo, cb_priv) -----------. | \/ set up flow_blocks [3] | add rules to flow_block <---------- TC_SETUP_CLSFLOWER [4] == Releasing the indirect flow_block There are two possibilities, either tunnel netdevice is removed or a netdevice (port representor) is removed. === Tunnel netdevice is removed Driver waits for the NETDEV_UNREGISTER event that announces the tunnel netdevice removal. Then, it calls __flow_indr_block_cb_unregister() to remove the flow_block and rules. Callgraph is very similar to the one described above. === Netdevice is removed (port representor) Driver calls __flow_indr_block_cb_unregister() to remove the existing netfilter/tc rule that belong to the tunnel netdevice. = How does the indirect flow_block work after this patchset? Drivers register the indirect flow_block setup callback through flow_indr_dev_register() if they support for offloading tunnel netdevices. == Setting up an indirect flow_block 1) Frontends check if dev->netdev_ops->ndo_setup_tc is unset. If so, frontends call flow_indr_dev_setup_offload(). This call invokes the drivers' indirect flow_block setup callback. 2) The indirect flow_block setup callback sets up a flow_block structure which relates the tunnel netdevice and the driver. 3) The front-end uses flow_block and offload the rules. Note that the operational to set up (non-indirect) flow_block is very similar. == Releasing the indirect flow_block === Tunnel netdevice is removed This calls flow_indr_dev_setup_offload() to set down the flow_block and remove the offloaded rules. This alternate path is exercised if dev->netdev_ops->ndo_setup_tc is unset. === Netdevice is removed (port representor) If a netdevice is removed, then it might need to to clean up the offloaded tc/netfilter rules that belongs to the tunnel netdevice: 1) The driver invokes flow_indr_dev_unregister() when a netdevice is removed. 2) This call iterates over the existing indirect flow_blocks and it invokes the cleanup callback to let the front-end remove the tc/netfilter rules. The cleanup callback already provides the flow_block that the front-end needs to clean up. Front-end Driver | flow_indr_dev_unregister(...) | iterate over list of indirect flow_block and invoke cleanup callback | .----------------------------- | . frontend_flow_block_cleanup(flow_block) . | \/ remove rules to flow_block TC_SETUP_CLSFLOWER = About this patchset This patchset aims to address the existing TC CT problem while simplifying the indirect flow_block infrastructure. Saving 300 LoC in the flow_offload core and the drivers. The operational gets aligned with the (non-indirect) flow_blocks logic. Patchset is composed of: Patch #1 add nf_flow_table_gc_cleanup() which is required by the netfilter's flowtable new indirect flow_block approach. Patch #2 adds the flow_block_indr object which is actually part of of the flow_block object. This stores the indirect flow_block metadata such as the tunnel netdevice owner and the cleanup callback (in case the tunnel netdevice goes away). This patch adds flow_indr_dev_{un}register() to allow drivers to offer netdevice tunnel hardware offload to the front-ends. Then, front-ends call flow_indr_dev_setup_offload() to invoke the drivers to set up the (indirect) flow_block. Patch #3 add the tcf_block_offload_init() helper function, this is a preparation patch to adapt the tc front-end to use this new indirect flow_block infrastructure. Patch #4 updates the tc and netfilter front-ends to use the new indirect flow_block infrastructure. Patch #5 updates the mlx5 driver to use the new indirect flow_block infrastructure. Patch #6 updates the nfp driver to use the new indirect flow_block infrastructure. Patch #7 updates the bnxt driver to use the new indirect flow_block infrastructure. Patch #8 removes the indirect flow_block infrastructure version 1, now that frontends and drivers have been translated to version 2 (coming in this patchset). ==================== Signed-off-by: David S. Miller commit 709ffbe19b777e8fc952e2fdcfd8e6f50c8ef08c Author: Pablo Neira Ayuso Date: Fri May 29 02:25:41 2020 +0200 net: remove indirect block netdev event registration Drivers do not register to netdev events to set up indirect blocks anymore. Remove __flow_indr_block_cb_register() and __flow_indr_block_cb_unregister(). The frontends set up the callbacks through flow_indr_dev_setup_block() Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit e445e30cf7e6d68566db775ce186cbe63ef286e9 Author: Pablo Neira Ayuso Date: Fri May 29 02:25:40 2020 +0200 bnxt_tc: update indirect block support Register ndo callback via flow_indr_dev_register() and flow_indr_dev_unregister(). Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 50c1b1c9385fbb35c25b27608e00bcf89368e8ba Author: Pablo Neira Ayuso Date: Fri May 29 02:25:39 2020 +0200 nfp: update indirect block support Register ndo callback via flow_indr_dev_register() and flow_indr_dev_unregister(). Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 9eabd188716b2c53d8b9d23e969c6c17049f0fcc Author: Pablo Neira Ayuso Date: Fri May 29 02:25:38 2020 +0200 mlx5: update indirect block support Register ndo callback via flow_indr_dev_register() and flow_indr_dev_unregister(). No need for mlx5e_rep_indr_clean_block_privs() since flow_block_cb_free() already releases the internal mapping via ->release callback, which in this case is mlx5e_rep_indr_tc_block_unbind(). Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 0fdcf78d59737939ea449b512d02c3733a22c8e1 Author: Pablo Neira Ayuso Date: Fri May 29 02:25:37 2020 +0200 net: use flow_indr_dev_setup_offload() Update existing frontends to use flow_indr_dev_setup_offload(). This new function must be called if ->ndo_setup_tc is unset to deal with tunnel devices. If there is no driver that is subscribed to new tunnel device flow_block bindings, then this function bails out with EOPNOTSUPP. If the driver module is removed, the ->cleanup() callback removes the entries that belong to this tunnel device. This cleanup procedures is triggered when the device unregisters the tunnel device offload handler. Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 324a823b9962a0f290c40fb6314926d434193276 Author: Pablo Neira Ayuso Date: Fri May 29 02:25:36 2020 +0200 net: cls_api: add tcf_block_offload_init() Add a helper function to initialize the flow_block_offload structure. Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 1fac52da5942c58dd3e337fd7c5a550925ca752e Author: Pablo Neira Ayuso Date: Fri May 29 02:25:35 2020 +0200 net: flow_offload: consolidate indirect flow_block infrastructure Tunnel devices provide no dev->netdev_ops->ndo_setup_tc(...) interface. The tunnel device and route control plane does not provide an obvious way to relate tunnel and physical devices. This patch allows drivers to register a tunnel device offload handler for the tc and netfilter frontends through flow_indr_dev_register() and flow_indr_dev_unregister(). The frontend calls flow_indr_dev_setup_offload() that iterates over the list of drivers that are offering tunnel device hardware offload support and it sets up the flow block for this tunnel device. If the driver module is removed, the indirect flow_block ends up with a stale callback reference. The module removal path triggers the dev_shutdown() path to remove the qdisc and the flow_blocks for the physical devices. However, this is not useful for tunnel devices, where relation between the physical and the tunnel device is not explicit. This patch introduces a cleanup callback that is invoked when the driver module is removed to clean up the tunnel device flow_block. This patch defines struct flow_block_indr and it uses it from flow_block_cb to store the information that front-end requires to perform the flow_block_cb cleanup on module removal. Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit a8284c6899cf7321abbd258d970a9442978b0a4f Author: Pablo Neira Ayuso Date: Fri May 29 02:25:34 2020 +0200 netfilter: nf_flowtable: expose nf_flow_table_gc_cleanup() This function schedules the flow teardown state and it forces a gc run. Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 213fd09e1aff05433d6855287808a235c9801c1b Merge: 129b9a5c4058 9b98f92ca446 Author: Linus Torvalds Date: Mon Jun 1 11:39:37 2020 -0700 Merge tag 'regmap-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "This has been a very active release for the regmap API for some reason, a lot of it due to new devices with odd requirements that can sensibly be handled here. - Add support for buses implementing a custom reg_update_bits() method in case the bus has a native operation for this. - Support 16 bit register addresses in SMBus. - Allow customization of the device attached to regmap-irq. - Helpers for bitfield operations and per-port field initializations" * tag 'regmap-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: provide helpers for simple bit operations regmap: add helper for per-port regfield initialization regmap-i2c: add 16-bit width registers support regmap: Simplify implementation of the regmap_field_read_poll_timeout() macro regmap: Simplify implementation of the regmap_read_poll_timeout() macro regmap: add reg_sequence helpers regmap-irq: make it possible to add irq_chip do a specific device node regmap: Add bus reg_update_bits() support regmap: debugfs: check count when read regmap file commit a01c245438c59a44f3ece8440046c78675fa8b0b Author: Davide Caratti Date: Fri May 29 00:05:32 2020 +0200 net/sched: fix a couple of splats in the error path of tfc_gate_init() trying to configure TC 'act_gate' rules with invalid control actions, the following splat can be observed: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 1 PID: 2143 Comm: tc Not tainted 5.7.0-rc6+ #168 Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014 RIP: 0010:hrtimer_active+0x56/0x290 [...] Call Trace: hrtimer_try_to_cancel+0x6d/0x330 hrtimer_cancel+0x11/0x20 tcf_gate_cleanup+0x15/0x30 [act_gate] tcf_action_cleanup+0x58/0x170 __tcf_action_put+0xb0/0xe0 __tcf_idr_release+0x68/0x90 tcf_gate_init+0x7c7/0x19a0 [act_gate] tcf_action_init_1+0x60f/0x960 tcf_action_init+0x157/0x2a0 tcf_action_add+0xd9/0x2f0 tc_ctl_action+0x2a3/0x39d rtnetlink_rcv_msg+0x5f3/0x920 netlink_rcv_skb+0x121/0x350 netlink_unicast+0x439/0x630 netlink_sendmsg+0x714/0xbf0 sock_sendmsg+0xe2/0x110 ____sys_sendmsg+0x5b4/0x890 ___sys_sendmsg+0xe9/0x160 __sys_sendmsg+0xd3/0x170 do_syscall_64+0x9a/0x370 entry_SYSCALL_64_after_hwframe+0x44/0xa9 this is caused by hrtimer_cancel(), running before hrtimer_init(). Fix it ensuring to call hrtimer_cancel() only if clockid is valid, and the timer has been initialized. After fixing this splat, the same error path causes another problem: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 980 Comm: tc Not tainted 5.7.0-rc6+ #168 Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014 RIP: 0010:release_entry_list+0x4a/0x240 [act_gate] [...] Call Trace: tcf_action_cleanup+0x58/0x170 __tcf_action_put+0xb0/0xe0 __tcf_idr_release+0x68/0x90 tcf_gate_init+0x7ab/0x19a0 [act_gate] tcf_action_init_1+0x60f/0x960 tcf_action_init+0x157/0x2a0 tcf_action_add+0xd9/0x2f0 tc_ctl_action+0x2a3/0x39d rtnetlink_rcv_msg+0x5f3/0x920 netlink_rcv_skb+0x121/0x350 netlink_unicast+0x439/0x630 netlink_sendmsg+0x714/0xbf0 sock_sendmsg+0xe2/0x110 ____sys_sendmsg+0x5b4/0x890 ___sys_sendmsg+0xe9/0x160 __sys_sendmsg+0xd3/0x170 do_syscall_64+0x9a/0x370 entry_SYSCALL_64_after_hwframe+0x44/0xa9 the problem is similar: tcf_action_cleanup() was trying to release a list without initializing it first. Ensure that INIT_LIST_HEAD() is called for every newly created 'act_gate' action, same as what was done to 'act_ife' with commit 44c23d71599f ("net/sched: act_ife: initalize ife->metalist earlier"). Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit 7fccfecf24fd1248c619e2cd7d55916327bf8dc1 Author: Dmitry Panchenko Date: Mon Jun 1 13:22:24 2020 +0300 ALSA: usb-audio: Add Pioneer DJ DJM-900NXS2 support Pioneer DJ DJM-900NXS2 is a widely used DJ mixer with 2 audio USB interfaces. Both have a MIDI controller, 10 playback and 12 capture channels. Audio endpoints are vendor-specific and 3 files need to be patched. All playback and capture channels work fine with all supported sample rates (44.1k, 48k, 96k). Patches are attached. Signed-off-by: Dmitry Panchenko Link: https://lore.kernel.org/r/48ab19ff-3303-9bf8-ed0e-bcb31d8537eb@d-systems.ee Signed-off-by: Takashi Iwai commit e85093618c5ff32c08319d6c5248a5ed1de9ae65 Merge: bda6752f3de9 240f1ae40c65 Author: David S. Miller Date: Mon Jun 1 11:35:18 2020 -0700 Merge branch 'regmap-simple-bit-helpers' Bartosz Golaszewski says: ==================== regmap: provide simple bitops and use them in a driver I noticed that oftentimes I use regmap_update_bits() for simple bit setting or clearing. In this case the fourth argument is superfluous as it's always 0 or equal to the mask argument. This series proposes to add simple bit operations for setting, clearing and testing specific bits with regmap. The second patch uses all three in a driver that got recently picked into the net-next tree. The patches obviously target different trees so - if you're ok with the change itself - I propose you pick the first one into your regmap tree for v5.8 and then I'll resend the second patch to add the first user for these macros for v5.9. v1 -> v2: - convert the new macros to static inline functions v2 -> v3: - drop unneeded ternary operator ==================== Signed-off-by: David S. Miller commit 240f1ae40c659713a53f8fa5e4899e7b7350bfed Author: Bartosz Golaszewski Date: Thu May 28 17:45:03 2020 +0200 net: ethernet: mtk-star-emac: use regmap bitops Shrink the code visually by replacing regmap_update_bits() with appropriate regmap bit operations where applicable. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit bfad978116c2aa3b693701059923de4561196f9b Author: Bartosz Golaszewski Date: Thu May 28 17:45:02 2020 +0200 regmap: provide helpers for simple bit operations In many instances regmap_update_bits() is used for simple bit setting and clearing. In these cases the last argument is redundant and we can hide it with a static inline function. This adds three new helpers for simple bit operations: set_bits, clear_bits and test_bits (the last one defined as a regular function). Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 129b9a5c40582cb0dc00aa5b58d1d1bcc93d98a7 Merge: b6f91ab6a2ba 87976ce2825d Author: Linus Torvalds Date: Mon Jun 1 11:33:40 2020 -0700 Merge tag 'hwmon-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "Infrastructure: - Add notification support New drivers: - Baikal-T1 PVT sensor driver - amd_energy driver to report energy counters - Driver for Maxim MAX16601 - Gateworks System Controller Various: - applesmc: avoid overlong udelay() - dell-smm: Use one DMI match for all XPS models - ina2xx: Implement alert functions - lm70: Add support for ACPI - lm75: Fix coding-style warnings - lm90: Add max6654 support to lm90 driver - nct7802: Replace container_of() API - nct7904: Set default timeout - nct7904: Add watchdog function - pmbus: Improve initialization of 'currpage' and 'currphase'" * tag 'hwmon-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (24 commits) hwmon: Add Baikal-T1 PVT sensor driver hwmon: Add notification support dt-bindings: hwmon: Add Baikal-T1 PVT sensor binding hwmon: (applesmc) avoid overlong udelay() hwmon: (nct7904) Set default timeout hwmon: (amd_energy) Missing platform_driver_unregister() on error in amd_energy_init() MAINTAINERS: add entry for AMD energy driver hwmon: (amd_energy) Add documentation hwmon: Add amd_energy driver to report energy counters hwmon: (nct7802) Replace container_of() API hwmon: (lm90) Add max6654 support to lm90 driver hwmon : (nct6775) Use kobj_to_dev() API hwmon: (pmbus) Driver for Maxim MAX16601 hwmon: (pmbus) Improve initialization of 'currpage' and 'currphase' hwmon: (adt7411) update contact email hwmon: (lm75) Fix all coding-style warnings on lm75 driver hwmon: Reduce indentation level in __hwmon_device_register() hwmon: (ina2xx) Implement alert functions hwmon: (lm70) Add support for ACPI hwmon: (dell-smm) Use one DMI match for all XPS models ... commit bda6752f3de99e9d765638b89aacfb11c07cee06 Author: Dan Carpenter Date: Thu May 28 15:49:57 2020 +0300 cxgb4: cleanup error code in setup_sge_queues_uld() The caller doesn't care about the error codes, they only check for zero vs non-zero. Still, it's better to preserve the negative error codes from alloc_uld_rxqs() instead of changing it to 1. We can also return directly if there is a failure. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit b6f91ab6a2bac8580026fc4a5d4724f0b9eeb11f Merge: 3d77e6a8804a ab91c2a89f86 Author: Linus Torvalds Date: Mon Jun 1 11:30:28 2020 -0700 Merge tag 'tpmdd-next-20200522' of git://git.infradead.org/users/jjs/linux-tpmdd Pull tpm updates from Jarkko Sakkinen. * tag 'tpmdd-next-20200522' of git://git.infradead.org/users/jjs/linux-tpmdd: tpm: eventlog: Replace zero-length array with flexible-array member tpm/tpm_ftpm_tee: Use UUID API for exporting the UUID commit 7318234c8d7c0f209f993ee46a7ea148efdb28b9 Merge: f99e24a6778a 358c7c61fd04 Author: Takashi Iwai Date: Mon Jun 1 20:26:07 2020 +0200 Merge tag 'asoc-v5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.8 This has been another very active release with a bunch of new drivers, lots of fixes everywhere and continued core improvements from Morimoto-san: - Lots of core cleanups and refactorings from Morimoto-san, factoring out common operations and making the card abstraction more solid. - Continued work on cleaning up and improving the Intel drivers, along with some new platform support for them. - Fixes to make the Marvell SSPA driver work upstream. - Support for AMD Renoir ACP, Dialog DA7212, Freescale EASRC and i.MX8M, Intel Elkhard Lake, Maxim MAX98390, Nuvoton NAU8812 and NAU8814 and Realtek RT1016. commit d36ceaef8fc2e4ede43de425a7f503013b500e7f Merge: dafe2078a75a 8066e6b449e0 Author: David S. Miller Date: Mon Jun 1 11:08:41 2020 -0700 Merge branch 'Fix-infinite-loop-in-bridge-and-vxlan-modules' Ido Schimmel says: ==================== Fix infinite loop in bridge and vxlan modules When suppressing invalid IPv6 Neighbour Solicitation messages, it is possible for the bridge and vxlan modules to get stuck in an infinite loop. See the individual changelogs for detailed explanation of the problem and solution. The bug was originally reported against the bridge module, but after auditing the code base I found that the buggy code was copied from the vxlan module. This patch set fixes both modules. Could not find more instances of the problem. Please consider both patches for stable releases. ==================== Signed-off-by: David S. Miller commit 8066e6b449e050675df48e7c4b16c29f00507ff0 Author: Ido Schimmel Date: Mon Jun 1 15:58:55 2020 +0300 vxlan: Avoid infinite loop when suppressing NS messages with invalid options When proxy mode is enabled the vxlan device might reply to Neighbor Solicitation (NS) messages on behalf of remote hosts. In case the NS message includes the "Source link-layer address" option [1], the vxlan device will use the specified address as the link-layer destination address in its reply. To avoid an infinite loop, break out of the options parsing loop when encountering an option with length zero and disregard the NS message. This is consistent with the IPv6 ndisc code and RFC 4886 which states that "Nodes MUST silently discard an ND packet that contains an option with length zero" [2]. [1] https://tools.ietf.org/html/rfc4861#section-4.3 [2] https://tools.ietf.org/html/rfc4861#section-4.6 Fixes: 4b29dba9c085 ("vxlan: fix nonfunctional neigh_reduce()") Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 53fc685243bd6fb90d90305cea54598b78d3cbfc Author: Ido Schimmel Date: Mon Jun 1 15:58:54 2020 +0300 bridge: Avoid infinite loop when suppressing NS messages with invalid options When neighbor suppression is enabled the bridge device might reply to Neighbor Solicitation (NS) messages on behalf of remote hosts. In case the NS message includes the "Source link-layer address" option [1], the bridge device will use the specified address as the link-layer destination address in its reply. To avoid an infinite loop, break out of the options parsing loop when encountering an option with length zero and disregard the NS message. This is consistent with the IPv6 ndisc code and RFC 4886 which states that "Nodes MUST silently discard an ND packet that contains an option with length zero" [2]. [1] https://tools.ietf.org/html/rfc4861#section-4.3 [2] https://tools.ietf.org/html/rfc4861#section-4.6 Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports") Signed-off-by: Ido Schimmel Reported-by: Alla Segal Tested-by: Alla Segal Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit dafe2078a75af1abe4780313ef8dd8491ba8598f Author: Patrick Eigensatz Date: Mon Jun 1 13:12:01 2020 +0200 ipv4: nexthop: Fix deadcode issue by performing a proper NULL check After allocating the spare nexthop group it should be tested for kzalloc() returning NULL, instead the already used nexthop group (which cannot be NULL at this point) had been tested so far. Additionally, if kzalloc() fails, return ERR_PTR(-ENOMEM) instead of NULL. Coverity-id: 1463885 Reported-by: Coverity Signed-off-by: Patrick Eigensatz Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 07f6ecec65547099d0e5ea1b1fba748c4b90eaf0 Merge: 1806c13dc253 e5aeebddfc31 Author: David S. Miller Date: Mon Jun 1 11:01:09 2020 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2020-06-01 Here's one last bluetooth-next pull request for 5.8, which I hope can still be accepted. - Enabled Wide-Band Speech (WBS) support for Qualcomm wcn3991 - Multiple fixes/imprvovements to Qualcomm-based devices - Fix GAP/SEC/SEM/BI-10-C qualfication test case - Added support for Broadcom BCM4350C5 device - Several other smaller fixes & improvements Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit 3f5540032f5dfd0af1205370e4548d6bb90db900 Merge: a8dfb61d6349 e8aec15dd584 Author: Richard Weinberger Date: Mon Jun 1 19:51:58 2020 +0200 Merge tag 'spi-nor/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux into mtd/next SPI NOR core changes: - add, update support and fix few flashes - prepare BFPT parsing for JESD216 rev D - kernel doc fixes commit a8dfb61d6349b7b7173ec6829b920449239c472f Merge: 3d77e6a8804a 86f2b225adf4 Author: Richard Weinberger Date: Mon Jun 1 19:50:58 2020 +0200 Merge tag 'nand/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux into mtd/next Raw NAND core changes: * Stop using nand_release(), patched all drivers. * Give more information about the ECC weakness when not matching the chip's requirement. * MAINTAINERS updates. * Support emulated SLC mode on MLC NANDs. * Support "constrained" controllers, adapt the core and ONFI/JEDEC table parsing and Micron's code. * Take check_only into account. * Add an invalid ECC mode to discriminate with valid ones. * Return an enum from of_get_nand_ecc_algo(). * Drop OOB_FIRST placement scheme. * Introduce nand_extract_bits(). * Ensure a consistent bitflips numbering. * BCH lib: - Allow easy bit swapping. - Rework a little bit the exported function names. * Fix nand_gpio_waitrdy(). * Propage CS selection to sub operations. * Add a NAND_NO_BBM_QUIRK flag. * Give the possibility to verify a read operation is supported. * Add a helper to check supported operations. * Avoid indirect access to ->data_buf(). * Rename the use_bufpoi variables. * Fix comments about the use of bufpoi. * Rename a NAND chip option. * Reorder the nand_chip->options flags. * Translate obscure bitfields into readable macros. * Timings: - Fix default values. - Add mode information to the timings structure. Raw NAND controller driver changes: * Fixed many error paths. * Arasan - New driver * Au1550nd: - Various cleanups - Migration to ->exec_op() * brcmnand: - Misc cleanup. - Support v2.1-v2.2 controllers. - Remove unused including . - Correctly verify erased pages. - Fix Hamming OOB layout. * Cadence - Make cadence_nand_attach_chip static. * Cafe: - Set the NAND_NO_BBM_QUIRK flag * cmx270: - Remove this controller driver. * cs553x: - Misc cleanup - Migration to ->exec_op() * Davinci: - Misc cleanup. - Migration to ->exec_op() * Denali: - Add more delays before latching incoming data * Diskonchip: - Misc cleanup - Migration to ->exec_op() * Fsmc: - Change to non-atomic bit operations. * GPMI: - Use nand_extract_bits() - Fix runtime PM imbalance. * Ingenic: - Migration to exec_op() - Fix the RB gpio active-high property on qi, lb60 - Make qi_lb60_ooblayout_ops static. * Marvell: - Misc cleanup and small fixes * Nandsim: - Fix the error paths, driver wide. * Omap_elm: - Fix runtime PM imbalance. * STM32_FMC2: - Misc cleanups (error cases, comments, timeout valus, cosmetic changes). commit 9103aaf9b40c4c4e51c2a4631d221daeb7d12bad Author: Yicong Yang Date: Sat May 9 17:56:54 2020 +0800 PCI/DPC: Print IRQ number used by port Print IRQ number used by DPC port, like AER/PME does. It provides convenience to track DPC interrupts counts of certain port from /proc/interrupts. Link: https://lore.kernel.org/r/1589018214-52752-1-git-send-email-yangyicong@hisilicon.com Signed-off-by: Yicong Yang Signed-off-by: Bjorn Helgaas commit 07b2fbb565e2df7ccc41e5c977b19f5f1f9fe013 Author: Bjorn Helgaas Date: Fri May 29 17:56:09 2020 -0500 PCI/AER: Use "aer" variable for capability offset Previously we used "pos" or "aer_pos" for the offset of the AER Capability. Use "aer" consistently and initialize it the same way everywhere. No functional change intended. Link: https://lore.kernel.org/r/20200529230915.GA479883@bjorn-Precision-5520 Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit af10cce7ad515aa819ee8a4ef6777c28b19ddfb7 Author: Kuppuswamy Sathyanarayanan Date: Tue May 26 16:18:26 2020 -0700 PCI/AER: Remove redundant dev->aer_cap checks pcie_aer_get_firmware_first() checks dev->aer_cap, so we can remove redundant dev->aer_cap checks in the callers. Link: https://lore.kernel.org/r/d5ccc7a060ec9cdc234bdae7df8a0a4410f13f42.1590534843.git.sathyanarayanan.kuppuswamy@linux.intel.com Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Bjorn Helgaas commit 123f985aea0d603466518f041670d195eb2a4111 Author: Kuppuswamy Sathyanarayanan Date: Tue May 26 16:18:25 2020 -0700 PCI/AER: Remove redundant pci_is_pcie() checks AER is a PCIe Extended Capability, so dev->aer_cap will only be set for PCIe devices. Remove redundant pci_is_pcie() checks. Link: https://lore.kernel.org/r/361c622eabe5b845b8092e0bec04a3a2c262cb38.1590534843.git.sathyanarayanan.kuppuswamy@linux.intel.com Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Bjorn Helgaas commit 708b2000362476c9c7a3571c0cc774dffb91836a Author: Kuppuswamy Sathyanarayanan Date: Tue May 26 16:18:29 2020 -0700 PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership Commit c100beb9ccfb ("PCI/AER: Use only _OSC to determine AER ownership") removed the use of HEST in determining AER ownership, but the AER driver still used HEST to verify AER ownership in some of its APIs. Per the ACPI spec v6.3, sec 18.3.2.4, some HEST table entries contain a FIRMWARE_FIRST bit, but that bit does not tell us anything about ownership of the AER capability. Remove parsing of HEST to look for FIRMWARE_FIRST. Add pcie_aer_is_native() for the places that need to know whether the OS owns the AER capability. [bhelgaas: commit log, reorder patch, remove unused __aer_firmware_first] Link: https://lore.kernel.org/r/9a37f53a4e6ff4942ff8e18dbb20b00e16c47341.1590534843.git.sathyanarayanan.kuppuswamy@linux.intel.com Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Bjorn Helgaas commit f8a4bcabadd6b7b15606a049d8600f1cebb6b364 Merge: 3d77e6a8804a de308d1815c9 140fd4ac78d3 429ac8b75a0b Author: Ingo Molnar Date: Mon Jun 1 18:12:43 2020 +0200 Merge branches 'x86/apic', 'x86/misc' and 'x86/splitlock' into x86/urgent Pick up these single-commit branches. Signed-off-by: Ingo Molnar commit 73e5f9c0d3647bfba6bf5dd37a1b0eaed99999d1 Merge: 552abb884e97 6cc3d0e9a097 Author: Rafael J. Wysocki Date: Mon Jun 1 18:10:43 2020 +0200 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq updates for v5.8-rc1 (part 2) from Viresh Kumar: "This contains a single patch to enable CPUFREQ_NEED_INITIAL_FREQ_CHECK flag for tegra driver." * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: tegra186: add CPUFREQ_NEED_INITIAL_FREQ_CHECK flag commit abb30460bda232f304f642510adc8c6576ea51ea Author: Jens Axboe Date: Mon Jun 1 10:02:01 2020 -0600 block: mark bio_wouldblock_error() bio with BIO_QUIET We really don't care about triggering buffer errors for this condition. This avoids a spew of: Buffer I/O error on dev sdc, logical block 785929, async page read Buffer I/O error on dev sdc, logical block 759095, async page read Buffer I/O error on dev sdc, logical block 766922, async page read Buffer I/O error on dev sdc, logical block 17659, async page read Buffer I/O error on dev sdc, logical block 637571, async page read Buffer I/O error on dev sdc, logical block 39241, async page read Buffer I/O error on dev sdc, logical block 397241, async page read Buffer I/O error on dev sdc, logical block 763992, async page read from -EAGAIN conditions on request allocation for async reads. Signed-off-by: Jens Axboe commit 13ffbd8db1dd43d63d086517872a4e702a6bf309 Author: Vitaly Kuznetsov Date: Mon Jun 1 17:47:26 2020 +0200 KVM: selftests: fix rdtsc() for vmx_tsc_adjust_test vmx_tsc_adjust_test fails with: IA32_TSC_ADJUST is -4294969448 (-1 * TSC_ADJUST_VALUE + -2152). IA32_TSC_ADJUST is -4294969448 (-1 * TSC_ADJUST_VALUE + -2152). IA32_TSC_ADJUST is 281470681738540 (65534 * TSC_ADJUST_VALUE + 4294962476). ==== Test Assertion Failure ==== x86_64/vmx_tsc_adjust_test.c:153: false pid=19738 tid=19738 - Interrupted system call 1 0x0000000000401192: main at vmx_tsc_adjust_test.c:153 2 0x00007fe1ef8583d4: ?? ??:0 3 0x0000000000401201: _start at ??:? Failed guest assert: (adjust <= max) The problem is that is 'tsc_val' should be u64, not u32 or the reading gets truncated. Fixes: 8d7fbf01f9afc ("KVM: selftests: VMX preemption timer migration test") Signed-off-by: Vitaly Kuznetsov Message-Id: <20200601154726.261868-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit e35b5a4c494a75a683ddf4901a43e0a128d5bfe3 Author: Randy Dunlap Date: Tue May 26 18:17:13 2020 -0700 Documentation: fixes to the maintainer-entry-profile template Do some wordsmithing and copy editing on the maintainer-entry-profile profile (template, guide): - fix punctuation - fix some wording - use "-rc" consistently Signed-off-by: Randy Dunlap Cc: Dan Williams Cc: linux-nvdimm@lists.01.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/fbaa9b67-e7b8-d5e8-ecbb-6ae068234880@infradead.org Signed-off-by: Jonathan Corbet commit 9469b390720460c1fca26b1ab3343bd70f7d5f5d Author: Sedat Dilek Date: Mon Jun 1 02:59:11 2020 +0200 zswap: docs/vm: Fix typo accept_threshold_percent in zswap.rst Recently, I switched over from swap-file to zramswap. When reading the Documentation/vm/zswap.rst file I fell over this typo. The parameter is called accept_threshold_percent not accept_threhsold_percent in /sys/module/zswap/parameters/ directory. Fixes: 45190f01dd402 ("mm/zswap.c: add allocation hysteresis if pool limit is hit") Cc: Vitaly Wool Signed-off-by: Sedat Dilek Link: https://lore.kernel.org/r/20200601005911.31222-1-sedat.dilek@gmail.com Signed-off-by: Jonathan Corbet commit 5cf0e8ebc258de291c67148857ad0edc094ae424 Author: Ian Rogers Date: Fri May 29 15:52:32 2020 -0700 perf libdw: Fix off-by 1 relative directory includes This is currently working due to extra include paths in the build. Before: $ cd tools/perf/arch/arm64/util $ ls -la ../../util/unwind-libdw.h ls: cannot access '../../util/unwind-libdw.h': No such file or directory After: $ ls -la ../../../util/unwind-libdw.h -rw-r----- 1 irogers irogers 553 Apr 17 14:31 ../../../util/unwind-libdw.h Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200529225232.207532-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a54ca194981be3707213437a67792b88e08264fe Author: Tan Xiaojun Date: Sat May 30 20:24:42 2020 +0800 perf arm-spe: Support synthetic events After the commit ffd3d18c20b8 ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") has been merged, it supports to output raw data with option "--dump-raw-trace". However, it misses for support synthetic events so cannot output any statistical info. This patch is to improve the "perf report" support for ARM SPE for four types synthetic events: First level cache synthetic events, including L1 data cache accessing and missing events; Last level cache synthetic events, including last level cache accessing and missing events; TLB synthetic events, including TLB accessing and missing events; Remote access events, which is used to account load/store operations caused to another socket. Example usage: $ perf record -c 1024 -e arm_spe_0/branch_filter=1,ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ dd if=/dev/zero of=/dev/null count=10000 $ perf report --stdio # Samples: 59 of event 'l1d-miss' # Event count (approx.): 59 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. .................................. # 23.73% 23.73% dd [kernel.kallsyms] [k] perf_iterate_ctx.constprop.135 20.34% 20.34% dd [kernel.kallsyms] [k] filemap_map_pages 5.08% 5.08% dd [kernel.kallsyms] [k] perf_event_mmap 5.08% 5.08% dd [kernel.kallsyms] [k] unlock_page_memcg 5.08% 5.08% dd [kernel.kallsyms] [k] unmap_page_range 3.39% 3.39% dd [kernel.kallsyms] [k] PageHuge 3.39% 3.39% dd [kernel.kallsyms] [k] release_pages 3.39% 3.39% dd ld-2.28.so [.] 0x0000000000008b5c 1.69% 1.69% dd [kernel.kallsyms] [k] __alloc_fd [...] # Samples: 3K of event 'l1d-access' # Event count (approx.): 3980 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ...................................... # 26.98% 26.98% dd [kernel.kallsyms] [k] ret_to_user 10.53% 10.53% dd [kernel.kallsyms] [k] fsnotify 7.51% 7.51% dd [kernel.kallsyms] [k] new_sync_read 4.57% 4.57% dd [kernel.kallsyms] [k] vfs_read 4.35% 4.35% dd [kernel.kallsyms] [k] vfs_write 3.69% 3.69% dd [kernel.kallsyms] [k] __fget_light 3.69% 3.69% dd [kernel.kallsyms] [k] rw_verify_area 3.44% 3.44% dd [kernel.kallsyms] [k] security_file_permission 2.76% 2.76% dd [kernel.kallsyms] [k] __fsnotify_parent 2.44% 2.44% dd [kernel.kallsyms] [k] ksys_write 2.24% 2.24% dd [kernel.kallsyms] [k] iov_iter_zero 2.19% 2.19% dd [kernel.kallsyms] [k] read_iter_zero 1.81% 1.81% dd dd [.] 0x0000000000002960 1.78% 1.78% dd dd [.] 0x0000000000002980 [...] # Samples: 35 of event 'llc-miss' # Event count (approx.): 35 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ........................... # 34.29% 34.29% dd [kernel.kallsyms] [k] filemap_map_pages 8.57% 8.57% dd [kernel.kallsyms] [k] unlock_page_memcg 8.57% 8.57% dd [kernel.kallsyms] [k] unmap_page_range 5.71% 5.71% dd [kernel.kallsyms] [k] PageHuge 5.71% 5.71% dd [kernel.kallsyms] [k] release_pages 5.71% 5.71% dd ld-2.28.so [.] 0x0000000000008b5c 2.86% 2.86% dd [kernel.kallsyms] [k] __queue_work 2.86% 2.86% dd [kernel.kallsyms] [k] __radix_tree_lookup 2.86% 2.86% dd [kernel.kallsyms] [k] copy_page [...] # Samples: 2 of event 'llc-access' # Event count (approx.): 2 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ............. # 50.00% 50.00% dd [kernel.kallsyms] [k] copy_page 50.00% 50.00% dd libc-2.28.so [.] _dl_addr # Samples: 48 of event 'tlb-miss' # Event count (approx.): 48 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. .................................. # 20.83% 20.83% dd [kernel.kallsyms] [k] perf_iterate_ctx.constprop.135 12.50% 12.50% dd [kernel.kallsyms] [k] __arch_clear_user 10.42% 10.42% dd [kernel.kallsyms] [k] clear_page 4.17% 4.17% dd [kernel.kallsyms] [k] copy_page 4.17% 4.17% dd [kernel.kallsyms] [k] filemap_map_pages 2.08% 2.08% dd [kernel.kallsyms] [k] __alloc_fd 2.08% 2.08% dd [kernel.kallsyms] [k] __mod_memcg_state.part.70 2.08% 2.08% dd [kernel.kallsyms] [k] __queue_work 2.08% 2.08% dd [kernel.kallsyms] [k] __rcu_read_unlock 2.08% 2.08% dd [kernel.kallsyms] [k] d_path 2.08% 2.08% dd [kernel.kallsyms] [k] destroy_inode 2.08% 2.08% dd [kernel.kallsyms] [k] do_dentry_open [...] # Samples: 9K of event 'tlb-access' # Event count (approx.): 9573 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ...................................... # 25.79% 25.79% dd [kernel.kallsyms] [k] __arch_clear_user 11.22% 11.22% dd [kernel.kallsyms] [k] ret_to_user 8.56% 8.56% dd [kernel.kallsyms] [k] fsnotify 4.06% 4.06% dd [kernel.kallsyms] [k] new_sync_read 3.67% 3.67% dd [kernel.kallsyms] [k] el0_svc_common.constprop.2 3.04% 3.04% dd [kernel.kallsyms] [k] __fsnotify_parent 2.90% 2.90% dd [kernel.kallsyms] [k] vfs_write 2.82% 2.82% dd [kernel.kallsyms] [k] vfs_read 2.52% 2.52% dd libc-2.28.so [.] write 2.26% 2.26% dd [kernel.kallsyms] [k] security_file_permission 2.08% 2.08% dd [kernel.kallsyms] [k] ksys_write 1.96% 1.96% dd [kernel.kallsyms] [k] rw_verify_area 1.95% 1.95% dd [kernel.kallsyms] [k] read_iter_zero [...] # Samples: 9 of event 'branch-miss' # Event count (approx.): 9 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ......................... # 22.22% 22.22% dd libc-2.28.so [.] _dl_addr 11.11% 11.11% dd [kernel.kallsyms] [k] __arch_clear_user 11.11% 11.11% dd [kernel.kallsyms] [k] __arch_copy_from_user 11.11% 11.11% dd [kernel.kallsyms] [k] __dentry_kill 11.11% 11.11% dd [kernel.kallsyms] [k] __efistub_memcpy 11.11% 11.11% dd ld-2.28.so [.] 0x0000000000012b7c 11.11% 11.11% dd libc-2.28.so [.] 0x000000000002a980 11.11% 11.11% dd libc-2.28.so [.] 0x0000000000083340 # Samples: 29 of event 'remote-access' # Event count (approx.): 29 # # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ........................... # 41.38% 41.38% dd [kernel.kallsyms] [k] filemap_map_pages 10.34% 10.34% dd [kernel.kallsyms] [k] unlock_page_memcg 10.34% 10.34% dd [kernel.kallsyms] [k] unmap_page_range 6.90% 6.90% dd [kernel.kallsyms] [k] release_pages 3.45% 3.45% dd [kernel.kallsyms] [k] PageHuge 3.45% 3.45% dd [kernel.kallsyms] [k] __queue_work 3.45% 3.45% dd [kernel.kallsyms] [k] page_add_file_rmap 3.45% 3.45% dd [kernel.kallsyms] [k] page_counter_try_charge 3.45% 3.45% dd [kernel.kallsyms] [k] page_remove_rmap 3.45% 3.45% dd [kernel.kallsyms] [k] xas_start 3.45% 3.45% dd ld-2.28.so [.] 0x0000000000002a1c 3.45% 3.45% dd ld-2.28.so [.] 0x0000000000008b5c 3.45% 3.45% dd ld-2.28.so [.] 0x00000000000093cc Signed-off-by: Tan Xiaojun Tested-by: James Clark Cc: Adrian Hunter Cc: Al Grant Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200530122442.490-4-leo.yan@linaro.org Signed-off-by: James Clark Signed-off-by: Leo Yan Signed-off-by: Arnaldo Carvalho de Melo commit 9f74d770180db3eb7c7d4ec12aaaa3082e77e51e Author: Tan Xiaojun Date: Sat May 30 20:24:41 2020 +0800 perf auxtrace: Add four itrace options This patch is to add four options to synthesize events which are described as below: 'f': synthesize first level cache events 'm': synthesize last level cache events 't': synthesize TLB events 'a': synthesize remote access events This four options will be used by ARM SPE as their first consumer. Signed-off-by: Tan Xiaojun Tested-by: James Clark Acked-by: Adrian Hunter Cc: Al Grant Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200530122442.490-3-leo.yan@linaro.org Signed-off-by: James Clark Signed-off-by: Leo Yan Signed-off-by: Arnaldo Carvalho de Melo commit 4db25f669323f348f311b262c13f07f950b560c7 Author: Tan Xiaojun Date: Sat May 30 20:24:40 2020 +0800 perf tools: Move arm-spe-pkt-decoder.h/c to the new dir Create a new arm-spe-decoder directory for subsequent extensions and move arm-spe-pkt-decoder.h/c to this directory. No code changes. Signed-off-by: Tan Xiaojun Tested-by: James Clark Tested-by: Qi Liu Cc: Adrian Hunter Cc: Al Grant Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200530122442.490-2-leo.yan@linaro.org Signed-off-by: James Clark Signed-off-by: Leo Yan Signed-off-by: Arnaldo Carvalho de Melo commit 0fb0d615f310410502f7eac3b241374fbe8d9be8 Author: Ian Rogers Date: Sat May 30 01:20:15 2020 -0700 perf test: Initialize memory in dwarf-unwind Avoid a false positive caused by assembly code in arch/x86. In tests, zero the perf_event to avoid uninitialized memory uses. Warnings were caught using clang with -fsanitize=memory. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200530082015.39162-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8617e2e34fdec1eab373c578f7bdc341d0ca70fc Author: Ian Rogers Date: Sat May 30 01:20:14 2020 -0700 perf tests: Don't tail call optimize in unwind test The tail call optimization can unexpectedly make the stack smaller and cause the test to fail. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: clang-built-linux@googlegroups.com Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200530082015.39162-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 21f2b7c13335eeec498569927d87c7381c3b54fa Author: Ian Rogers Date: Sat May 30 01:20:13 2020 -0700 tools compiler.h: Add attribute to disable tail calls Tail call optimizations can remove stack frames that are used in unwinding tests. Add an attribute that can be used to disable the tail call optimization. Tested on clang and GCC. Committer notes: Old versions of clang don't like that __attribute__((optimize)), so add an ifdef to make it go away. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: clang-built-linux@googlegroups.com Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200530082015.39162-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 48ccdeddc54771ecdc46fac098bac689e9df24ca Merge: 228b79aa33ba 8fcc4ae6faf8 cc0594c4b0ef c41c36e900a3 7b52b200cf5b Author: Rafael J. Wysocki Date: Mon Jun 1 17:19:43 2020 +0200 Merge branches 'acpi-apei', 'acpi-pmic', 'acpi-video' and 'acpi-dptf' * acpi-apei: arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work ACPI: APEI: Kick the memory_failure() queue for synchronous errors mm/memory-failure: Add memory_failure_queue_kick() * acpi-pmic: ACPI / PMIC: Add i2c address for thermal control * acpi-video: ACPI: video: Use native backlight on Acer TravelMate 5735Z * acpi-dptf: ACPI: DPTF: Add battery participant driver ACPI: DPTF: Additional sysfs attributes for power participant driver commit 228b79aa33ba657460a9465596d8546c4d811dd4 Merge: 48c604151a55 496121c02127 4d8be4bc94f7 8e22c2e4a62e e5c399b0bd64 6dd10c47e912 Author: Rafael J. Wysocki Date: Mon Jun 1 17:19:06 2020 +0200 Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-dbg', 'acpi-misc' and 'acpi-pci' * acpi-processor: ACPI: processor: idle: Allow probing on platforms with one ACPI C-state * acpi-cppc: ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe() ACPI: CPPC: Make some symbols static * acpi-dbg: ACPI: debug: Make two functions static * acpi-misc: ACPI: GED: use correct trigger type field in _Exx / _Lxx handling ACPI: GED: add support for _Exx / _Lxx handler methods ACPI: Delete unused proc filename macros * acpi-pci: ACPI: hotplug: PCI: Use the new acpi_evaluate_reg() helper ACPI: utils: Add acpi_evaluate_reg() helper commit 10cdb15759540f03d056e2f73fe26377ed7dcfda Author: Lai Jiangshan Date: Mon Jun 1 08:44:40 2020 +0000 workqueue: use BUILD_BUG_ON() for compile time test instead of WARN_ON() Any runtime WARN_ON() has to be fixed, and BUILD_BUG_ON() can help you nitice it earlier. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit c39ba6b3a8d47be07c180f857564a25a0356d336 Author: Lai Jiangshan Date: Mon Jun 1 08:44:39 2020 +0000 workqueue: fix a piece of comment about reserved bits for work flags 8a2e8e5dec7e("workqueue: fix cwq->nr_active underflow") allocated one more bit from the work flags, and it updated partial of the comments (128 bytes -> 256 bytes), but it failed to update the info about the number of reserved bits. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 48c604151a55629ea0a2c22c51a331a3360dbdbc Merge: 6e6c25283dff 2d2feb681317 95722237cb2a Author: Rafael J. Wysocki Date: Mon Jun 1 15:22:05 2020 +0200 Merge branches 'acpica' and 'acpi-tables' * acpica: ACPICA: Update version to 20200430 ACPICA: Fix required parameters for _NIG and _NIH ACPICA: Dispatcher: add status checks ACPICA: Disassembler: ignore AE_ALREADY_EXISTS status when parsing create operators ACPICA: Move acpi_gbl_next_cmd_num definition to acglobal.h ACPICA: Make acpi_protocol_lengths static * acpi-tables: ACPI: sleep: Put the FACS table after using it ACPI: scan: Put SPCR and STAO table after using it ACPI: EC: Put the ACPI table after using it ACPI: APEI: Put the HEST table for error path ACPI: APEI: Put the error record serialization table for error path ACPI: APEI: Put the error injection table for error path and module exit ACPI: APEI: Put the boot error record table after parsing ACPI: watchdog: Put the watchdog action table after parsing ACPI: LPIT: Put the low power idle table after using it commit a34024d98eeaa78e2cd22017180df778800b83fc Merge: ac7ccfc75faf 86954c98fc30 03c3b413a14d 213081dadd30 5ed909b368fc Author: Rafael J. Wysocki Date: Mon Jun 1 15:20:45 2020 +0200 Merge branches 'pm-devfreq', 'powercap', 'pm-docs' and 'pm-tools' * pm-devfreq: PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR PM / devfreq: Replace strncpy with strscpy PM / devfreq: imx: Register interconnect device PM / devfreq: Add generic imx bus scaling driver PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe() PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting * powercap: powercap: RAPL: remove unused local MSR define powercap/intel_rapl: add support for ElkhartLake * pm-docs: Documentation: admin-guide: pm: Document intel-speed-select * pm-tools: cpupower: Remove unneeded semicolon commit ac7ccfc75faf2d82fe3176a100ed032621335b62 Merge: f1ecbf79554d 552abb884e97 Author: Rafael J. Wysocki Date: Mon Jun 1 15:19:39 2020 +0200 Merge branch 'pm-cpufreq' * pm-cpufreq: cpufreq: Fix up cpufreq_boost_set_sw() cpufreq: fix minor typo in struct cpufreq_driver doc comment cpufreq: qoriq: Add platform dependencies clk: qoriq: add cpufreq platform device cpufreq: qoriq: convert to a platform driver cpufreq: qcom: fix wrong compatible binding cpufreq: imx-cpufreq-dt: support i.MX7ULP cpufreq: dt: Add support for r8a7742 cpufreq: Add i.MX7ULP to cpufreq-dt-platdev blacklist cpufreq: omap: Build driver by default for ARCH_OMAP2PLUS cpufreq: intel_pstate: Use passive mode by default without HWP commit f1ecbf79554d30baef4bef770b9500a1b7c51b82 Merge: be6018a44c24 c343bf1ba5ef Author: Rafael J. Wysocki Date: Mon Jun 1 15:19:30 2020 +0200 Merge branch 'pm-cpuidle' * pm-cpuidle: cpuidle: Fix three reference count leaks cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver Documentation: ABI: make current_governer_ro as a candidate for removal Documentation: cpuidle: update the document cpuidle: sysfs: Remove sysfs_switch and switch attributes cpuidle: Make cpuidle governor switchable to be the default behaviour cpuidle: sysfs: Accept governor name with 15 characters cpuidle: sysfs: Fix the overlap for showing available governors cpuidle: psci: Fixup execution order when entering a domain idle state cpuidle: sysfs: Minor coding style corrections cpuidle: sysfs: Remove the unused define_one_r(o/w) macros commit be6018a44c2479d22fef40eb6f5a3442627b8bcb Merge: 5fcd73590192 9a7875461fd0 ad1e4f74c072 Author: Rafael J. Wysocki Date: Mon Jun 1 15:19:08 2020 +0200 Merge branches 'pm-core' and 'pm-sleep' * pm-core: PM: runtime: Replace pm_runtime_callbacks_present() PM: runtime: clk: Fix clk_pm_runtime_get() error path PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend() * pm-sleep: PM: hibernate: Restrict writes to the resume device PM: hibernate: Split off snapshot dev option PM: hibernate: Incorporate concurrency handling PM: sleep: Helpful edits for devices.rst documentation Documentation: PM: sleep: Update driver flags documentation PM: sleep: core: Rename DPM_FLAG_LEAVE_SUSPENDED PM: sleep: core: Rename DPM_FLAG_NEVER_SKIP PM: sleep: core: Rename dev_pm_smart_suspend_and_suspended() PM: sleep: core: Rename dev_pm_may_skip_resume() PM: sleep: core: Rework the power.may_skip_resume handling PM: sleep: core: Do not skip callbacks in the resume phase PM: sleep: core: Fold functions into their callers PM: sleep: core: Simplify the SMART_SUSPEND flag handling commit 95fb6317b3ab827aa35e7e52cb3a535b0cc6ec7e Author: Masahiro Yamada Date: Mon Jun 1 14:56:58 2020 +0900 kbuild: merge net-y and virt-y into drivers-y This will slightly change the link order; drivers-y from arch Makefile will be linked after virt/built-in.a, but I guess this is not a big deal. Signed-off-by: Masahiro Yamada commit 23febe375d94d55927019467b6ac5fd503d83b2d Author: Masahiro Yamada Date: Mon Jun 1 14:56:57 2020 +0900 kbuild: merge init-y into core-y No arch Makefile specifies init-y. Merge init-y into core-y. This does not change the link order. Signed-off-by: Masahiro Yamada commit f3908ab3ffd92c77af1bad7f699b8a1c14f462bf Author: Masahiro Yamada Date: Mon Jun 1 14:56:56 2020 +0900 kbuild: refactor tagets caluculation for KBUILD_{BUILTIN,KBUILD_MODULES} Remove lib-target, builtin-target, modorder-target, and modtargets. Instead, add targets-for-builtin and targets-for-modules. Signed-off-by: Masahiro Yamada commit 0a8820e7f807158670d3400974b20691cd8774d9 Author: Masahiro Yamada Date: Mon Jun 1 14:56:55 2020 +0900 kbuild: refactor subdir-ym calculation Remove the unneeded variables, __subdir-y and __subdir-m. Signed-off-by: Masahiro Yamada commit fb2d99be8919d63ff5c48f33bff4847387c6742b Author: Masahiro Yamada Date: Sun May 31 19:11:39 2020 +0900 kbuild: merge two 'ifdef CONFIG_TRIM_UNUSED_KSYMS' blocks This hunk has two 'ifdef CONFIG_TRIM_UNUSED_KSYMS ... endif' blocks with no other code interleaved. Merge them. Signed-off-by: Masahiro Yamada commit 4b50c8c4eaf06a825d1c005c0b1b4a8307087b83 Author: Masahiro Yamada Date: Sun May 31 17:47:06 2020 +0900 kbuild: force to build vmlinux if CONFIG_MODVERSION=y This code does not work as stated in the comment. $(CONFIG_MODVERSIONS) is always empty because it is expanded before include/config/auto.conf is included. Hence, 'make modules' with CONFIG_MODVERSION=y cannot record the version CRCs. This has been broken since 2003, commit ("kbuild: Enable modules to be build using the "make dir/" syntax"). [1] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=15c6240cdc44bbeef3c4797ec860f9765ef4f1a7 Cc: linux-stable # v2.5.71+ Signed-off-by: Masahiro Yamada commit c200784a08d4ea82f82a30678955b7f2c7550af4 Author: Steven Rostedt (VMware) Date: Fri May 29 10:46:32 2020 -0400 tracing: Add a trace print when traceoff_on_warning is triggered When "traceoff_on_warning" is enabled and a warning happens, there can still be many trace events happening on other CPUs between the time the warning occurred and the last trace event on that same CPU. This can cause confusion in examining the trace, as it may not be obvious where the warning happened. By adding a trace print into the trace just before disabling tracing, it makes it obvious where the warning occurred, and the developer doesn't have to look at other means to see what CPU it occurred on. Cc: Peter Zijlstra Signed-off-by: Steven Rostedt (VMware) commit 58f6e384480ec97b902e44399a44862907840ba9 Author: Peter Zijlstra Date: Thu May 28 16:52:40 2020 +0200 ftrace,bug: Improve traceoff_on_warn While doing some tracing, I found a huge portion of the per-cpu buffer was taken by printk/serial output because we're disabling the trace far too late (after printing the CUT string). Improve matters for architectures that have GENERIC_BUG + _BUG_FLAGS by killing the tracer in the exception handler before printing anything much. Link: https://lkml.kernel.org/r/20200528145240.GF706495@hirez.programming.kicks-ass.net Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Steven Rostedt (VMware) commit bea24f766efceb5322f704015c56596ff94642f7 Author: Tom Zanussi Date: Thu May 28 14:32:38 2020 -0500 selftests/ftrace: Distinguish between hist and synthetic event checks With synthetic events now a separate config item as a result of 'tracing: Move synthetic events to a separate file', tests that use both need to explicitly check for hist trigger support rather than relying on hist triggers to pull in synthetic events. Add an additional hist trigger check to all the trigger tests that now require it, otherwise they'll fail if synthetic events but not hist triggers are enabled. Link: http://lkml.kernel.org/r/af36c539006ef2768114b4ed38e6b054f7c7a3bd.1590693308.git.zanussi@kernel.org Acked-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 726721a51838e3983023f906580722fc83f804ee Author: Tom Zanussi Date: Thu May 28 14:32:37 2020 -0500 tracing: Move synthetic events to a separate file With the addition of the in-kernel synthetic event API, synthetic events are no longer specifically tied to the histogram triggers. The synthetic event code is also making trace_event_hist.c very bloated, so for those reasons, move it to a separate file, trace_events_synth.c, along with a new trace_synth.h header file. Because synthetic events are now independent from hist triggers, add a new CONFIG_SYNTH_EVENTS config option, and have CONFIG_HIST_TRIGGERS select it, and have CONFIG_SYNTH_EVENT_GEN_TEST depend on it. Link: http://lkml.kernel.org/r/4d1fa1f85ed5982706ac44844ac92451dcb04715.1590693308.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 5bbf959de408640a99a378d05107d510b866b3ca Author: Tom Zanussi Date: Mon May 18 13:29:24 2020 -0500 tracing: Fix events.rst section numbering The in-kernel trace event API should have its own section, and the duplicate section numbers need fixing as well. Link: https://lkml.kernel.org/r/90ea854dfb728390b50ddf8a8675238973ee014a.camel@kernel.org Reported-by: Li Xinhai Reviewed-by: Li Xinhai Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 0e386959272e4adf192867681a65cc0aa580c247 Author: Chris Wilson Date: Fri May 29 15:39:26 2020 +0100 drm/i915: Check for awaits on still currently executing requests With the advent of preempt-to-busy, a request may still be on the GPU as we unwind. And in the case of a unpreemptible [due to HW] request, that request will remain indefinitely on the GPU even though we have returned it back to our submission queue, and cleared the active bit. We only run the execution callbacks on transferring the request from our submission queue to the execution queue, but if this is a bonded request that the HW is waiting for, we will not submit it (as we wait for a fresh execution) even though it is still being executed. As we know that there are always preemption points between requests, we know that only the currently executing request may be still active even though we have cleared the flag. However, we do not precisely know which request is in ELSP[0] due to a delay in processing events, and furthermore we only store the last request in a context in our state tracker. Fixes: 22b7a426bbe1 ("drm/i915/execlists: Preempt-to-busy") Testcase: igt/gem_exec_balancer/bonded-dual Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200529143926.3245-1-chris@chris-wilson.co.uk (cherry picked from commit b55230e5e800868961fc271b26d9ce53ae1f691e) Signed-off-by: Joonas Lahtinen commit 631a6582b75ffac82bee76a65217caa856fafb5e Author: Chris Wilson Date: Tue May 26 10:07:53 2020 +0100 drm/i915/gt: Do not schedule normal requests immediately along virtual When we push a virtual request onto the HW, we update the rq->engine to point to the physical engine. A request that is then submitted by the user that waits upon the virtual engine, but along the physical engine in use, will then see that it is due to be submitted to the same engine and take a shortcut (and be queued without waiting for the completion fence). However, the virtual request may be preempted (either by higher priority users, or by timeslicing) and removed from the physical engine to be migrated over to one of its siblings. The dependent normal request however is oblivious to the removal of the virtual request and remains queued to execute on HW, believing that once it reaches the head of its queue all of its predecessors will have completed executing! v2: Beware restriction of signal->execution_mask prior to submission. Fixes: 6d06779e8672 ("drm/i915: Load balancing across a virtual engine") Testcase: igt/gem_exec_balancer/sliced Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.3+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200526090753.11329-2-chris@chris-wilson.co.uk (cherry picked from commit 511b6d9aed417739b6aa49d0b6b4354ad21020f1) Signed-off-by: Joonas Lahtinen commit 0906844545a2cbe0fabcff1c78ab9c6b0d0c2ca0 Author: Steven Rostedt (VMware) Date: Thu May 28 19:27:08 2020 -0400 tracing/doc: Fix typos in histogram-design.rst There's a few typos in the histogram-design.rst document that need need to be fixed. Cc: Tom Zanussi Acked-by: Randy Dunlap Signed-off-by: Steven Rostedt (VMware) commit 2d19bd79ae6509858582a9cade739c2e9a4fdca8 Author: Tom Zanussi Date: Fri Apr 3 14:31:21 2020 -0500 tracing: Add hist_debug trace event files for histogram debugging Add a new "hist_debug" file for each trace event, which when read will dump out a bunch of internal details about the hist triggers defined on that event. This is normally off but can be enabled by saying 'y' to the new CONFIG_HIST_TRIGGERS_DEBUG config option. This is in support of the new Documentation file describing histogram internals, Documentation/trace/histogram-design.rst, which was requested by developers trying to understand the internals when extending or making use of the hist triggers for higher-level tools. The histogram-design.rst documentation refers to the hist_debug files and demonstrates their use with output in the test examples. Link: http://lkml.kernel.org/r/77914c22b0ba493d9783c53bbfbc6087d6a7e1b1.1585941485.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit dd873dd51d8d7868887048545d48befdd6bea7ad Author: Chris Wilson Date: Tue May 26 10:07:52 2020 +0100 drm/i915: Reorder await_execution before await_request Reorder the code so that we can reuse the await_execution from a special case in await_request in the next patch. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200526090753.11329-1-chris@chris-wilson.co.uk (cherry picked from commit ffb0c600c240103f6f34e07892a7e0a75502b243) Signed-off-by: Joonas Lahtinen commit 16b585fe71924b3aebaef5548a291021efaf7c7f Author: Tom Zanussi Date: Fri Apr 3 14:31:20 2020 -0500 tracing: Add histogram-design document Add a new Documentation/trace/histogram-design.rst file describing the ftrace histogram low-level design, meant to help developers trying to understand the internals when extending or making use of the hist triggers for higher-level tools. This documentation refers to the hist_debug files implemented by 'tracing: Add hist_debug trace event files for histogram debugging' so users wishing to try out the test examples here should make sure CONFIG_HIST_TRIGGERS_DEBUG is enabled. Link: http://lkml.kernel.org/r/256b29c3274bb89a10157c4a8d1a8bce7e74849e.1585941485.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 1b94b3aed367ff2cdc84d325e0aa9d7cc9e3cf2a Author: Tom Zanussi Date: Fri Apr 3 14:31:19 2020 -0500 tracing: Check state.disabled in synth event trace functions Since trace_state.disabled is set in __synth_event_trace_start() at the same time -ENOENT is returned, don't bother returning -ENOENT - just have callers check trace_state.disabled instead, and avoid the extra return val munging. Link: http://lkml.kernel.org/r/87315c3889af870e8370e82b76cf48b426d70130.1585941485.git.zanussi@kernel.org Suggested-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 5fb565b69dabd5a256fc116702331b54a4621dc9 Merge: cc58045486d0 0b0c0bd818ef Author: Mark Brown Date: Mon Jun 1 13:01:44 2020 +0100 Merge remote-tracking branch 'regulator/for-5.8' into regulator-linus commit cc58045486d0f938662b01025c855fd4aea89ea6 Merge: 9cb1fd0efd19 906746ba26d0 Author: Mark Brown Date: Mon Jun 1 13:01:42 2020 +0100 Merge remote-tracking branch 'regulator/for-5.7' into regulator-linus commit 358c7c61fd04d324f83d7968daf8dd9a6ff86a9a Merge: a72ff08faf3d a6b675a89e51 Author: Mark Brown Date: Mon Jun 1 13:01:15 2020 +0100 Merge remote-tracking branch 'asoc/for-5.8' into asoc-linus commit a72ff08faf3d6b2a1c21c9b815bf02af44cc70ab Merge: 9cb1fd0efd19 f4aa5e214eea Author: Mark Brown Date: Mon Jun 1 13:01:13 2020 +0100 Merge remote-tracking branch 'asoc/for-5.7' into asoc-linus commit 0b0c0bd818ef76a20f58c3cb1ac96a3056ccb681 Author: kbuild test robot Date: Sat May 30 21:03:14 2020 +0800 regulator: max8998: max8998_set_current_limit() can be static Fixes: 4ffea5e083f8 ("regulator: max8998: Add charger regulator") Signed-off-by: kbuild test robot Link: https://lore.kernel.org/r/20200530130314.GA73557@d7d8dbfb64ff Signed-off-by: Mark Brown commit 53d860952c8215cf9ae1ea33409c8cb71ad6ad3d Author: Jens Thoms Toerring Date: Sun May 31 11:53:00 2020 +0200 regmap: fix alignment issue The assembly and disassembly of data to be sent to or received from a device invoke functions regmap_format_XX() and regmap_parse_XX() that extract or insert data items from or into a buffer, using assignments. In some cases the functions are called with a buffer pointer with an odd address. On architectures with strict alignment requirements this can result in a kernel crash. The assignments have been replaced by functions that take alignment into account. Signed-off-by: Jens Thoms Toerring Link: https://lore.kernel.org/r/20200531095300.GA27570@toerring.de Signed-off-by: Mark Brown commit 8ad44d5e0d1eda7e4a0ed382174888476dc81789 Author: Ilya Dryomov Date: Sat May 23 11:47:33 2020 +0200 libceph: read_from_replica option Expose replica reads through read_from_replica=balance and read_from_replica=localize. The default is to read from primary (read_from_replica=no). Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 117d96a04f007ce8fc2e292369056c3bd09f6f63 Author: Ilya Dryomov Date: Sat May 23 11:45:48 2020 +0200 libceph: support for balanced and localized reads OSD-side issues with reads from replica have been resolved in Octopus. Reading from replica should be safe wrt. unstable or uncommitted state now, so add support for balanced and localized reads. There are two cases when a read from replica can't be served: - OSD may silently drop the request, expecting the client to notice that the acting set has changed and resend via the usual means (handled with t->used_replica) - OSD may return EAGAIN, expecting the client to resend to the primary, ignoring replica read flags (see handle_reply()) Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 45e6aa9f5592cd127367074f4822039cd8a825c3 Author: Ilya Dryomov Date: Fri May 22 15:24:53 2020 +0200 libceph: crush_location infrastructure Allow expressing client's location in terms of CRUSH hierarchy as a set of (bucket type name, bucket name) pairs. The userspace syntax "crush_location = key1=value1 key2=value2" is incompatible with mount options and needed adaptation. Key-value pairs are separated by '|' and we use ':' instead of '=' to separate keys from values. So for: crush_location = host=foo rack=bar one would write: crush_location=host:foo|rack:bar As in userspace, "multipath" locations are supported, so indicating locality for parallel hierarchies is possible: crush_location=rack:foo1|rack:foo2|datacenter:bar Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 86403a92c3c5c6c395983fdbfc5e2f29dc39279b Author: Ilya Dryomov Date: Tue May 19 17:09:52 2020 +0200 libceph: decode CRUSH device/bucket types and names These would be matched with the provided client location to calculate the locality value. Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 8a4b863c876d9f135fa00cfe65774c3740970303 Author: Ilya Dryomov Date: Tue May 19 16:46:47 2020 +0200 libceph: add non-asserting rbtree insertion helper Needed for the next commit and useful for ceph_pg_pool_info tree as well. I'm leaving the asserting helper in for now, but we should look at getting rid of it in the future. Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit e64f44a884657358812e6c057957be546db03cbe Author: Xiubo Li Date: Wed May 27 09:09:27 2020 -0400 ceph: skip checking caps when session reconnecting and releasing reqs It make no sense to check the caps when reconnecting to mds. And for the async dirop caps, they will be put by its _cb() function, so when releasing the requests, it will make no sense too. URL: https://tracker.ceph.com/issues/45635 Signed-off-by: Xiubo Li Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit ea8412b284c09742d5b11721e225b4ff011aa397 Author: Xiubo Li Date: Wed May 20 03:51:19 2020 -0400 ceph: make sure mdsc->mutex is nested in s->s_mutex to fix dead lock send_mds_reconnect takes the s_mutex while the mdsc->mutex is already held. That inverts the locking order documented in mds_client.h. Drop the mdsc->mutex, acquire the s_mutex and then reacquire the mdsc->mutex to prevent a deadlock. URL: https://tracker.ceph.com/issues/45609 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 878dabb64117406abd40977b87544d05bb3031fc Author: Luis Henriques Date: Mon May 18 18:47:26 2020 +0100 ceph: don't return -ESTALE if there's still an open file Similarly to commit 03f219041fdb ("ceph: check i_nlink while converting a file handle to dentry"), this fixes another corner case with name_to_handle_at/open_by_handle_at. The issue has been detected by xfstest generic/467, when doing: - name_to_handle_at("/cephfs/myfile") - open("/cephfs/myfile") - unlink("/cephfs/myfile") - sync; sync; - drop caches - open_by_handle_at() The call to open_by_handle_at should not fail because the file hasn't been deleted yet (only unlinked) and we do have a valid handle to it. -ESTALE shall be returned only if i_nlink is 0 *and* i_count is 1. This patch also makes sure we have LINK caps before checking i_nlink. Signed-off-by: Luis Henriques Reviewed-by: Jeff Layton Acked-by: Amir Goldstein Signed-off-by: Ilya Dryomov commit 53ab8e7cd2d47594e68951994ac083d30f82fce4 Author: Gustavo A. R. Silva Date: Thu May 7 13:51:38 2020 -0500 libceph, rbd: replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit dffdcd71458e699e839f0bf47c3d42d64210b939 Author: Luis Henriques Date: Tue Apr 7 11:30:20 2020 +0100 ceph: allow rename operation under different quota realms Returning -EXDEV when trying to 'mv' files/directories from different quota realms results in copy+unlink operations instead of the faster CEPH_MDS_OP_RENAME. This will occur even when there aren't any quotas set in the destination directory, or if there's enough space left for the new file(s). This patch adds a new helper function to be called on rename operations which will allow these operations if they can be executed. This patch mimics userland fuse client commit b8954e5734b3 ("client: optimize rename operation under different quota root"). Since ceph_quota_is_same_realm() is now called only from this new helper, make it static. URL: https://tracker.ceph.com/issues/44791 Signed-off-by: Luis Henriques Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit daa668fbacfdb9147b1828fc0f97b685bf4a51e3 Author: Luis Henriques Date: Tue Apr 7 11:30:19 2020 +0100 ceph: normalize 'delta' parameter usage in check_quota_exceeded Function check_quota_exceeded() uses delta parameter only for the QUOTA_CHECK_MAX_BYTES_OP operation. Using this parameter also for MAX_FILES will makes the code cleaner and will be required to support cross-quota-tree renames. Signed-off-by: Luis Henriques Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 829ad4db952aac86d11a62647d2516ab46c2fcd2 Author: Jeff Layton Date: Fri Apr 3 13:09:07 2020 -0400 ceph: ceph_kick_flushing_caps needs the s_mutex The mdsc->cap_dirty_lock is not held while walking the list in ceph_kick_flushing_caps, which is not safe. ceph_early_kick_flushing_caps does something similar, but the s_mutex is held while it's called and I think that guards against changes to the list. Ensure we hold the s_mutex when calling ceph_kick_flushing_caps, and add some clarifying comments. Signed-off-by: Jeff Layton Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit d67c72e6cce99eab5ab9d62c599e33e5141ff8b4 Author: Jeff Layton Date: Wed Apr 1 18:27:25 2020 -0400 ceph: request expedited service on session's last cap flush When flushing a lot of caps to the MDS's at once (e.g. for syncfs), we can end up waiting a substantial amount of time for MDS replies, due to the fact that it may delay some of them so that it can batch them up together in a single journal transaction. This can lead to stalls when calling sync or syncfs. What we'd really like to do is request expedited service on the _last_ cap we're flushing back to the server. If the CHECK_CAPS_FLUSH flag is set on the request and the current inode was the last one on the session->s_cap_dirty list, then mark the request with CEPH_CLIENT_CAPS_SYNC. Note that this heuristic is not perfect. New inodes can race onto the list after we've started flushing, but it does seem to fix some common use cases. URL: https://tracker.ceph.com/issues/44744 Reported-by: Jan Fajerski Signed-off-by: Jeff Layton Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 1cf03a68e791b1673bc4daaa88a0820f34f538f8 Author: Jeff Layton Date: Wed Apr 1 17:07:52 2020 -0400 ceph: convert mdsc->cap_dirty to a per-session list This is a per-sb list now, but that makes it difficult to tell when the cap is the last dirty one associated with the session. Switch this to be a per-session list, but continue using the mdsc->cap_dirty_lock to protect the lists. This list is only ever walked in ceph_flush_dirty_caps, so change that to walk the sessions array and then flush the caps for inodes on each session's list. If the auth cap ever changes while the inode has dirty caps, then move the inode to the appropriate session for the new auth_cap. Also, ensure that we never remove an auth cap while the inode is still on the s_cap_dirty list. Signed-off-by: Jeff Layton Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 6f05b30ea063a2a05dda47a4105a69267ae5270f Author: Yan, Zheng Date: Mon Mar 30 19:56:37 2020 +0800 ceph: reset i_requested_max_size if file write is not wanted write can stuck at waiting for larger max_size in following sequence of events: - client opens a file and writes to position 'A' (larger than unit of max size increment) - client closes the file handle and updates wanted caps (not wanting file write caps) - client opens and truncates the file, writes to position 'A' again. At the 1st event, client set inode's requested_max_size to 'A'. At the 2nd event, mds removes client's writable range, but client does not reset requested_max_size. At the 3rd event, client does not request max size because requested_max_size is already larger than 'A'. Signed-off-by: "Yan, Zheng" Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 88828190f0073bd8f9aa5e2b1caf753d289c6d49 Author: Jeff Layton Date: Fri Mar 20 17:07:36 2020 -0400 ceph: throw a warning if we destroy session with mutex still locked Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit dc3da0461cc4b76f2d0c5b12247fcb3b520edbbf Author: Jeff Layton Date: Fri Mar 20 16:45:45 2020 -0400 ceph: fix potential race in ceph_check_caps Nothing ensures that session will still be valid by the time we dereference the pointer. Take and put a reference. In principle, we should always be able to get a reference here, but throw a warning if that's ever not the case. Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 4fb5dda39c26fa5b64059dac0a2c3340a4f6f11b Author: Jeff Layton Date: Thu Mar 19 15:34:13 2020 -0400 ceph: document what protects i_dirty_item and i_flushing_item Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 7833323363233c75fd8d10b5ceefbb9515cb3e32 Author: Jeff Layton Date: Thu Mar 19 12:00:16 2020 -0400 ceph: don't take i_ceph_lock in handle_cap_import Just take it before calling it. This means we have to do a couple of minor in-memory operations under the spinlock now, but those shouldn't be an issue. Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 7391fba2678c0288d0daf636ddc4f78de7704f81 Author: Jeff Layton Date: Wed Mar 18 16:43:30 2020 -0400 ceph: don't release i_ceph_lock in handle_cap_trunc There's no reason to do this here. Just have the caller handle it. Also, add a lockdep assertion. Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit d7dbfb4f2bdb037758f46271f75ea6c8d35626b4 Author: Jeff Layton Date: Wed Mar 18 15:34:20 2020 -0400 ceph: add comments for handle_cap_flush_ack logic Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 681ac634883ba162ce5c50c10120c8bf4df81574 Author: Jeff Layton Date: Wed Mar 18 15:29:34 2020 -0400 ceph: split up __finish_cap_flush This function takes a mdsc argument or ci argument, but if both are passed in, it ignores the ci arg. Fortunately, nothing does that, but there's no good reason to have the same function handle both cases. Also, get rid of some branches and just use |= to set the wake_* vals. Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 0a454bdd501ad1aa30bb72e9581efa338ad6ce5c Author: Jeff Layton Date: Tue Mar 17 08:47:31 2020 -0400 ceph: reorganize __send_cap for less spinlock abuse Get rid of the __releases annotation by breaking it up into two functions: __prep_cap which is done under the spinlock and __send_cap that is done outside it. Add new fields to cap_msg_args for the wake boolean and old_xattr_buf pointer. Nothing checks the return value from __send_cap, so make it void return. Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 70c948206f0616c7e46130a26165b6a5d98bade4 Author: Xiubo Li Date: Thu Mar 19 23:45:02 2020 -0400 ceph: add metadata perf metric support Add a new "r_ended" field to struct ceph_mds_request and use that to maintain the average latency of MDS requests. URL: https://tracker.ceph.com/issues/43215 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 97e27aaa9a2cbd6238c66b3251d397e0eacc9968 Author: Xiubo Li Date: Thu Mar 19 23:45:01 2020 -0400 ceph: add read/write latency metric support Calculate the latency for OSD read requests. Add a new r_end_stamp field to struct ceph_osd_request that will hold the time of that the reply was received. Use that to calculate the RTT for each call, and divide the sum of those by number of calls to get averate RTT. Keep a tally of RTT for OSD writes and number of calls to track average latency of OSD writes. URL: https://tracker.ceph.com/issues/43215 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 1af16d547f3080d71060092d22e79a34527d1d08 Author: Xiubo Li Date: Thu Mar 19 23:45:00 2020 -0400 ceph: add caps perf metric for each superblock Count hits and misses in the caps cache. If the client has all of the necessary caps when a task needs references, then it's counted as a hit. Any other situation is a miss. URL: https://tracker.ceph.com/issues/43215 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit f9009efac49c830460f55b9f6c08ee0d76f31b0d Author: Xiubo Li Date: Thu Mar 19 23:44:59 2020 -0400 ceph: add dentry lease metric support For dentry leases, only count the hit/miss info triggered from the vfs calls. For the cases like request reply handling and ceph_trim_dentries, ignore them. For now, these are only viewable using debugfs. Future patches will allow the client to send the stats to the MDS. The output looks like: item total miss hit ------------------------------------------------- d_lease 11 7 141 URL: https://tracker.ceph.com/issues/43215 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit a6b675a89e51a1cdad0481b809b7840d3f86e4b5 Author: John Stultz Date: Fri May 29 21:38:23 2020 +0000 ASoC: qcom: q6asm-dai: kCFI fix Fixes the following kCFI crash seen on db845c, caused by the function prototypes not matching the callback function prototype. [ 82.585661] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000001 [ 82.595387] Mem abort info: [ 82.599463] ESR = 0x96000005 [ 82.602658] EC = 0x25: DABT (current EL), IL = 32 bits [ 82.608177] SET = 0, FnV = 0 [ 82.611829] EA = 0, S1PTW = 0 [ 82.615369] Data abort info: [ 82.618751] ISV = 0, ISS = 0x00000005 [ 82.622641] CM = 0, WnR = 0 [ 82.625774] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000174259000 [ 82.632292] [0000000000000001] pgd=0000000000000000, pud=0000000000000000 [ 82.639167] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 82.644795] Modules linked in: hci_uart btqca xhci_plat_hcd xhci_pci_renesas xhci_pci xhci_hcd wcn36xx wcnss_ctrl wcd934x vctrl_regulator ufs_qcom syscon_reboot_e [ 82.644927] qcom_apcs_ipc_mailbox q6asm_dai q6routing q6asm q6afe_dai q6adm q6afe q6core q6dsp_common pm8941_pwrkey pm8916_wdt platform_mhu pinctrl_spmi_mpp pine [ 82.812982] CPU: 3 PID: 240 Comm: kworker/u16:4 Tainted: G W 5.6.0-rc7-mainline-00960-g0c34353d11b9-dirty #1 [ 82.824201] Hardware name: Thundercomm Dragonboard 845c (DT) [ 82.829937] Workqueue: qcom_apr_rx apr_rxwq [apr] [ 82.834698] pstate: 80c00005 (Nzcv daif +PAN +UAO) [ 82.839553] pc : __cfi_check_fail+0x4/0x1c [q6asm_dai] [ 82.844754] lr : __cfi_check+0x3a8/0x3b0 [q6asm_dai] [ 82.849767] sp : ffffffc0105f3c20 [ 82.853123] x29: ffffffc0105f3c30 x28: 0000000000000020 [ 82.858489] x27: ffffff80f4588400 x26: ffffff80f458ec94 [ 82.863854] x25: ffffff80f458ece8 x24: ffffffe3670c7000 [ 82.869220] x23: ffffff8094bb7b34 x22: ffffffe367137000 [ 82.874585] x21: bd07909b332eada6 x20: 0000000000000001 [ 82.879950] x19: ffffffe36713863c x18: ffffff80f8df4430 [ 82.885316] x17: 0000000000000001 x16: ffffffe39d15e660 [ 82.890681] x15: 0000000000000001 x14: 0000000000000027 [ 82.896047] x13: 0000000000000000 x12: ffffffe39e6465a0 [ 82.901413] x11: 0000000000000051 x10: 000000000000ffff [ 82.906779] x9 : 000ffffffe366c19 x8 : c3c5f18762d1ceef [ 82.912145] x7 : 0000000000000000 x6 : ffffffc010877698 [ 82.917511] x5 : ffffffc0105f3c00 x4 : 0000000000000000 [ 82.922877] x3 : 0000000000000000 x2 : 0000000000000001 [ 82.928243] x1 : ffffffe36713863c x0 : 0000000000000001 [ 82.933610] Call trace: [ 82.936099] __cfi_check_fail+0x4/0x1c [q6asm_dai] [ 82.940955] q6asm_srvc_callback+0x22c/0x618 [q6asm] [ 82.945973] apr_rxwq+0x1a8/0x27c [apr] [ 82.949861] process_one_work+0x2e8/0x54c [ 82.953919] worker_thread+0x27c/0x4d4 [ 82.957715] kthread+0x144/0x154 [ 82.960985] ret_from_fork+0x10/0x18 [ 82.964603] Code: a8c37bfd f85f8e5e d65f03c0 b40000a0 (39400008) [ 82.970762] ---[ end trace 410accb839617143 ]--- [ 82.975429] Kernel panic - not syncing: Fatal exception Signed-off-by: John Stultz Reviewed-by: Srinivas Kandagatla Cc: Patrick Lai Cc: Banajit Goswami Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Srinivas Kandagatla Cc: Vinod Koul Cc: Kuninori Morimoto Cc: Stephan Gerhold Cc: Sami Tolvanen Cc: Todd Kjos Cc: Alistair Delva Cc: Amit Pundir Cc: Sumit Semwal Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20200529213823.98812-1-john.stultz@linaro.org Signed-off-by: Mark Brown commit 4573e9ef51539905e713ce2b3148fe96b90b772d Merge: 9cb1fd0efd19 45679f9b508f Author: Rafael J. Wysocki Date: Mon Jun 1 12:54:18 2020 +0200 Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull operating performance points (OPP) framework changes for v5.8 from Viresh Kumar: "This contains: - support for interconnect bandwidth in the OPP core (Georgi Djakov, Saravana Kannan, Sibi Sankar, Viresh Kumar). - support for regulator enable/disable (Kamil Konieczny). This is based on three patches from the interconnect tree which shall get merged via Greg's tree." * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: opp: Don't parse icc paths unnecessarily opp: Remove bandwidth votes when target_freq is zero opp: core: add regulators enable and disable opp: Reorder the code for !target_freq case opp: Expose bandwidth information via debugfs cpufreq: dt: Add support for interconnect bandwidth scaling opp: Update the bandwidth on OPP frequency changes opp: Add sanity checks in _read_opp_key() opp: Add support for parsing interconnect bandwidth interconnect: Remove unused module exit code from core interconnect: Disallow interconnect core to be built as a module interconnect: Add of_icc_get_by_index() helper function OPP: Add helpers for reading the binding properties dt-bindings: opp: Introduce opp-peak-kBps and opp-avg-kBps bindings commit cb3cb6733fbd8fd8d2c716095fdca42dadba2063 Merge: 806f04e9fd2c 07325d4a90d2 Author: Ingo Molnar Date: Mon Jun 1 11:47:29 2020 +0200 Merge branch 'WIP.core/rcu' into core/rcu, to pick up two x86/entry dependencies Signed-off-by: Ingo Molnar commit 2a02ca0428cfe68cce600111acb4c6f7d85cf71f Merge: 3d77e6a8804a ce20670828c1 f00eb5ff2f6f Author: Borislav Petkov Date: Mon Jun 1 11:39:15 2020 +0200 Merge branches 'edac-i10nm' and 'edac-misc' into edac-updates-for-5.8 Signed-off-by: Borislav Petkov commit 47a94c551a7401a196cba881470dc9cb92573e82 Author: Stuart Hayes Date: Tue May 19 11:27:33 2020 -0400 platform/x86: dcdbas: Check SMBIOS for protected buffer address Add support for a new method for BIOS to provide the address and length of the protected SMI communication buffer, via SMBIOS OEM strings. Signed-off-by: Stuart Hayes Signed-off-by: Andy Shevchenko commit 30a44f7b80c0b48c582026803ac21cdd94936030 Merge: 7b91f1565fbf 873e391ff33e Author: Andy Shevchenko Date: Sat May 30 18:20:22 2020 +0300 Merge branch 'for-next' Merge branch 'for-next' of git@github.com:spandruvada/linux-kernel.git to update Intel SST tools. Signed-off-by: Andy Shevchenko commit 7b91f1565fbfbe5a162d91f8a1f6c5580c2fc1d0 Author: Chris Chiu Date: Fri May 22 15:44:24 2020 +0800 platform/x86: asus_wmi: Reserve more space for struct bias_args On the ASUS laptop UX325JA/UX425JA, most of the media keys are not working due to the ASUS WMI driver fails to be loaded. The ACPI error as follows leads to the failure of asus_wmi_evaluate_method. ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [IIA3] at bit offset/length 96/32 exceeds size of target Buffer (96 bits) (20200326/dsopcode-203) No Local Variables are initialized for Method [WMNB] ACPI Error: Aborting method \_SB.ATKD.WMNB due to previous error (AE_AML_BUFFER_LIMIT) (20200326/psparse-531) The DSDT for the WMNB part shows that 5 DWORD required for local variables and the 3rd variable IIA3 hit the buffer limit. Method (WMNB, 3, Serialized) { .. CreateDWordField (Arg2, Zero, IIA0) CreateDWordField (Arg2, 0x04, IIA1) CreateDWordField (Arg2, 0x08, IIA2) CreateDWordField (Arg2, 0x0C, IIA3) CreateDWordField (Arg2, 0x10, IIA4) Local0 = (Arg1 & 0xFFFFFFFF) If ((Local0 == 0x54494E49)) .. } The limitation is determined by the input acpi_buffer size passed to the wmi_evaluate_method. Since the struct bios_args is the data structure used as input buffer by default for all ASUS WMI calls, the size needs to be expanded to fix the problem. Signed-off-by: Chris Chiu Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko commit cfae58ed681c5fe0185db843013ecc71cd265ebf Author: Hans de Goede Date: Fri May 15 20:39:16 2020 +0200 platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type The HP Stream x360 11-p000nd no longer report SW_TABLET_MODE state / events with recent kernels. This model reports a chassis-type of 10 / "Notebook" which is not on the recently introduced chassis-type whitelist Commit de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") added a chassis-type whitelist and only listed 31 / "Convertible" as being capable of generating valid SW_TABLET_MOD events. Commit 1fac39fd0316 ("platform/x86: intel-vbtn: Also handle tablet-mode switch on "Detachable" and "Portable" chassis-types") extended the whitelist with chassis-types 8 / "Portable" and 32 / "Detachable". And now we need to exten the whitelist again with 10 / "Notebook"... The issue original fixed by the whitelist is really a ACPI DSDT bug on the Dell XPS 9360 where it has a VGBS which reports it is in tablet mode even though it is not a 2-in-1 at all, but a regular laptop. So since this is a workaround for a DSDT issue on that specific model, instead of extending the whitelist over and over again, lets switch to a blacklist and only blacklist the chassis-type of the model for which the chassis-type check was added. Note this also fixes the current version of the code no longer checking if dmi_get_system_info(DMI_CHASSIS_TYPE) returns NULL. Fixes: 1fac39fd0316 ("platform/x86: intel-vbtn: Also handle tablet-mode switch on "Detachable" and "Portable" chassis-types") Cc: Mario Limonciello Signed-off-by: Hans de Goede Reviewed-by: Mario Limonciello Signed-off-by: Andy Shevchenko commit 8fe63eb757ac6e661a384cc760792080bdc738dc Author: Nickolai Kozachenko Date: Sat May 30 22:07:20 2020 +0500 platform/x86: intel-hid: Add a quirk to support HP Spectre X2 (2015) HEBC method reports capabilities of 5 button array but HP Spectre X2 (2015) does not have this control method (the same was for Wacom MobileStudio Pro). Expand previous DMI quirk by Alex Hung to also enable 5 button array for this system. Signed-off-by: Nickolai Kozachenko Signed-off-by: Andy Shevchenko commit 477d07ef9864628e562aeb7071cd90267dc949c5 Author: Hans de Goede Date: Sun May 31 17:05:24 2020 +0200 platform/x86: touchscreen_dmi: Update Trekstor Twin 10.1 entry Add minimum values for the x and y axis, correct the max value for the x-axis and add support for the capacitive home-button these tablets have. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit fcee90cdf6f3a3a371add04d41528d5ba9c3b411 Author: Dinghao Liu Date: Thu May 21 10:47:09 2020 +0800 PCI: tegra: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Also, call pm_runtime_disable() when pm_runtime_get_sync() returns an error code. Link: https://lore.kernel.org/r/20200521024709.2368-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Signed-off-by: Lorenzo Pieralisi Acked-by: Thierry Reding commit f0a5ec1958176fc7bb5e7a0c9e906c467eec23e1 Merge: 380609445cff 45f08f4cd667 Author: Paolo Bonzini Date: Mon Jun 1 04:28:40 2020 -0400 Merge branch 'kvm-master' into HEAD This merge brings in a few fixes that I would have sent this week, had there been a 5.7-rc8 release. Signed-off-by: Paolo Bonzini commit 380609445cff6ee7b6c7e43bbdc953985b45a6ed Merge: 09d952c971a5 8f7f4fe756bd Author: Paolo Bonzini Date: Mon Jun 1 04:26:27 2020 -0400 Merge tag 'kvmarm-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for Linux 5.8: - Move the arch-specific code into arch/arm64/kvm - Start the post-32bit cleanup - Cherry-pick a few non-invasive pre-NV patches commit 09d952c971a58c897eb7ea7d41516e7d953bb65d Author: Paolo Bonzini Date: Mon Jun 1 04:17:45 2020 -0400 KVM: check userspace_addr for all memslots The userspace_addr alignment and range checks are not performed for private memory slots that are prepared by KVM itself. This is unnecessary and makes it questionable to use __*_user functions to access memory later on. We also rely on the userspace address being aligned since we have an entire family of functions to map gfn to pfn. Fortunately skipping the check is completely unnecessary. Only x86 uses private memslots and their userspace_addr is obtained from vm_mmap, therefore it must be below PAGE_OFFSET. In fact, any attempt to pass an address above PAGE_OFFSET would have failed because such an address would return true for kvm_is_error_hva. Reported-by: Linus Torvalds Signed-off-by: Paolo Bonzini commit fb0cb6a8211cfe00178614ae72a0b426bd1ff016 Author: Vitaly Kuznetsov Date: Fri May 29 16:45:43 2020 +0300 KVM: selftests: update hyperv_cpuid with SynDBG tests Update tests to reflect new CPUID capabilities with SYNDBG. Check that we get the right number of entries and that 0x40000000.EAX always returns the correct max leaf. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Jon Doron Message-Id: <20200529134543.1127440-7-arilou@gmail.com> Signed-off-by: Paolo Bonzini commit b187038b5e3f8404dbafce89fd169e66fe604df4 Author: Jon Doron Date: Fri May 29 16:45:42 2020 +0300 x86/kvm/hyper-v: Add support for synthetic debugger via hypercalls There is another mode for the synthetic debugger which uses hypercalls to send/recv network data instead of the MSR interface. This interface is much slower and less recommended since you might get a lot of VMExits while KDVM polling for new packets to recv, rather than simply checking the pending page to see if there is data avialble and then request. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Jon Doron Message-Id: <20200529134543.1127440-6-arilou@gmail.com> Signed-off-by: Paolo Bonzini commit 45c38973ed1868b8448079edd48bf24ab8b326fa Author: Jon Doron Date: Fri May 29 16:45:41 2020 +0300 x86/kvm/hyper-v: enable hypercalls regardless of hypercall page Microsoft's kdvm.dll dbgtransport module does not respect the hypercall page and simply identifies the CPU being used (AMD/Intel) and according to it simply makes hypercalls with the relevant instruction (vmmcall/vmcall respectively). The relevant function in kdvm is KdHvConnectHypervisor which first checks if the hypercall page has been enabled via HV_X64_MSR_HYPERCALL_ENABLE, and in case it was not it simply sets the HV_X64_MSR_GUEST_OS_ID to 0x1000101010001 which means: build_number = 0x0001 service_version = 0x01 minor_version = 0x01 major_version = 0x01 os_id = 0x00 (Undefined) vendor_id = 1 (Microsoft) os_type = 0 (A value of 0 indicates a proprietary, closed source OS) and starts issuing the hypercall without setting the hypercall page. To resolve this issue simply enable hypercalls also if the guest_os_id is not 0. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Jon Doron Message-Id: <20200529134543.1127440-5-arilou@gmail.com> Signed-off-by: Paolo Bonzini commit f97f5a56f5977311f3833056a73cdbb0ee56cb1e Author: Jon Doron Date: Fri May 29 16:45:40 2020 +0300 x86/kvm/hyper-v: Add support for synthetic debugger interface Add support for Hyper-V synthetic debugger (syndbg) interface. The syndbg interface is using MSRs to emulate a way to send/recv packets data. The debug transport dll (kdvm/kdnet) will identify if Hyper-V is enabled and if it supports the synthetic debugger interface it will attempt to use it, instead of trying to initialize a network adapter. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Jon Doron Message-Id: <20200529134543.1127440-4-arilou@gmail.com> Signed-off-by: Paolo Bonzini commit 22ad0026d0978d4211eb07a2be77f49fb40d86eb Author: Jon Doron Date: Fri May 29 16:45:39 2020 +0300 x86/hyper-v: Add synthetic debugger definitions Hyper-V synthetic debugger has two modes, one that uses MSRs and the other that use Hypercalls. Add all the required definitions to both types of synthetic debugger interface. Some of the required new CPUIDs and MSRs are not documented in the TLFS so they are in hyperv.h instead. The reason they are not documented is because they are subjected to be removed in future versions of Windows. Reviewed-by: Michael Kelley Signed-off-by: Jon Doron Message-Id: <20200529134543.1127440-3-arilou@gmail.com> Signed-off-by: Paolo Bonzini commit 8d7fbf01f9afc9ea1381de705013aa3ca453009f Author: Makarand Sonare Date: Tue May 26 14:51:07 2020 -0700 KVM: selftests: VMX preemption timer migration test When a nested VM with a VMX-preemption timer is migrated, verify that the nested VM and its parent VM observe the VMX-preemption timer exit close to the original expiration deadline. Signed-off-by: Makarand Sonare Reviewed-by: Jim Mattson Message-Id: <20200526215107.205814-3-makarandsonare@google.com> Signed-off-by: Paolo Bonzini commit 850448f35aaf45215276468d63c91ab1e230cf06 Author: Peter Shier Date: Tue May 26 14:51:06 2020 -0700 KVM: nVMX: Fix VMX preemption timer migration Add new field to hold preemption timer expiration deadline appended to struct kvm_vmx_nested_state_hdr. This is to prevent the first VM-Enter after migration from incorrectly restarting the timer with the full timer value instead of partially decayed timer value. KVM_SET_NESTED_STATE restarts timer using migrated state regardless of whether L1 sets VM_EXIT_SAVE_VMX_PREEMPTION_TIMER. Fixes: cf8b84f48a593 ("kvm: nVMX: Prepare for checkpointing L2 state") Signed-off-by: Peter Shier Signed-off-by: Makarand Sonare Message-Id: <20200526215107.205814-2-makarandsonare@google.com> Signed-off-by: Paolo Bonzini commit f7d31e65368aeef973fab788aa22c4f1d5a6af66 Author: Jon Doron Date: Fri Apr 24 14:37:40 2020 +0300 x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit The problem the patch is trying to address is the fact that 'struct kvm_hyperv_exit' has different layout on when compiling in 32 and 64 bit modes. In 64-bit mode the default alignment boundary is 64 bits thus forcing extra gaps after 'type' and 'msr' but in 32-bit mode the boundary is at 32 bits thus no extra gaps. This is an issue as even when the kernel is 64 bit, the userspace using the interface can be both 32 and 64 bit but the same 32 bit userspace has to work with 32 bit kernel. The issue is fixed by forcing the 64 bit layout, this leads to ABI change for 32 bit builds and while we are obviously breaking '32 bit userspace with 32 bit kernel' case, we're fixing the '32 bit userspace with 64 bit kernel' one. As the interface has no (known) users and 32 bit KVM is rather baroque nowadays, this seems like a reasonable decision. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Jon Doron Message-Id: <20200424113746.3473563-2-arilou@gmail.com> Reviewed-by: Roman Kagan Signed-off-by: Paolo Bonzini commit 27461da31089ace6966e4f1695cba7eb87ffbe4f Author: Like Xu Date: Fri May 29 15:43:45 2020 +0800 KVM: x86/pmu: Support full width counting Intel CPUs have a new alternative MSR range (starting from MSR_IA32_PMC0) for GP counters that allows writing the full counter width. Enable this range from a new capability bit (IA32_PERF_CAPABILITIES.FW_WRITE[bit 13]). The guest would query CPUID to get the counter width, and sign extends the counter values as needed. The traditional MSRs always limit to 32bit, even though the counter internally is larger (48 or 57 bits). When the new capability is set, use the alternative range which do not have these restrictions. This lowers the overhead of perf stat slightly because it has to do less interrupts to accumulate the counter value. Signed-off-by: Like Xu Message-Id: <20200529074347.124619-3-like.xu@linux.intel.com> Signed-off-by: Paolo Bonzini commit cbd717585b8038d93c309176bb563a5c6de60ac7 Author: Wei Wang Date: Fri May 29 15:43:44 2020 +0800 KVM: x86/pmu: Tweak kvm_pmu_get_msr to pass 'struct msr_data' in Change kvm_pmu_get_msr() to get the msr_data struct, as the host_initiated field from the struct could be used by get_msr. This also makes this API consistent with kvm_pmu_set_msr. No functional changes. Signed-off-by: Wei Wang Message-Id: <20200529074347.124619-2-like.xu@linux.intel.com> Signed-off-by: Paolo Bonzini commit 72de5fa4c16195827252b961ba44028a39dfeaff Author: Vitaly Kuznetsov Date: Mon May 25 16:41:22 2020 +0200 KVM: x86: announce KVM_FEATURE_ASYNC_PF_INT Introduce new capability to indicate that KVM supports interrupt based delivery of 'page ready' APF events. This includes support for both MSR_KVM_ASYNC_PF_INT and MSR_KVM_ASYNC_PF_ACK. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-8-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 557a961abbe06ed9dfd3b55ef7bd6e68295cda3d Author: Vitaly Kuznetsov Date: Mon May 25 16:41:21 2020 +0200 KVM: x86: acknowledgment mechanism for async pf page ready notifications If two page ready notifications happen back to back the second one is not delivered and the only mechanism we currently have is kvm_check_async_pf_completion() check in vcpu_run() loop. The check will only be performed with the next vmexit when it happens and in some cases it may take a while. With interrupt based page ready notification delivery the situation is even worse: unlike exceptions, interrupts are not handled immediately so we must check if the slot is empty. This is slow and unnecessary. Introduce dedicated MSR_KVM_ASYNC_PF_ACK MSR to communicate the fact that the slot is free and host should check its notification queue. Mandate using it for interrupt based 'page ready' APF event delivery. As kvm_check_async_pf_completion() is going away from vcpu_run() we need a way to communicate the fact that vcpu->async_pf.done queue has transitioned from empty to non-empty state. Introduce kvm_arch_async_page_present_queued() and KVM_REQ_APF_READY to do the job. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-7-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 2635b5c4a0e407b84f68e188c719f28ba0e9ae1b Author: Vitaly Kuznetsov Date: Mon May 25 16:41:20 2020 +0200 KVM: x86: interrupt based APF 'page ready' event delivery Concerns were expressed around APF delivery via synthetic #PF exception as in some cases such delivery may collide with real page fault. For 'page ready' notifications we can easily switch to using an interrupt instead. Introduce new MSR_KVM_ASYNC_PF_INT mechanism and deprecate the legacy one. One notable difference between the two mechanisms is that interrupt may not get handled immediately so whenever we would like to deliver next event (regardless of its type) we must be sure the guest had read and cleared previous event in the slot. While on it, get rid on 'type 1/type 2' names for APF events in the documentation as they are causing confusion. Use 'page not present' and 'page ready' everywhere instead. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-6-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 0958f0cefede403037653e44de0e3332d10b0e1a Author: Vitaly Kuznetsov Date: Mon May 25 16:41:19 2020 +0200 KVM: introduce kvm_read_guest_offset_cached() We already have kvm_write_guest_offset_cached(), introduce read analogue. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-5-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 7c0ade6c9023b2b90b757e2927b306bec1cc4ca6 Author: Vitaly Kuznetsov Date: Mon May 25 16:41:18 2020 +0200 KVM: rename kvm_arch_can_inject_async_page_present() to kvm_arch_can_dequeue_async_page_present() An innocent reader of the following x86 KVM code: bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) { if (!(vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED)) return true; ... may get very confused: if APF mechanism is not enabled, why do we report that we 'can inject async page present'? In reality, upon injection kvm_arch_async_page_present() will check the same condition again and, in case APF is disabled, will just drop the item. This is fine as the guest which deliberately disabled APF doesn't expect to get any APF notifications. Rename kvm_arch_can_inject_async_page_present() to kvm_arch_can_dequeue_async_page_present() to make it clear what we are checking: if the item can be dequeued (meaning either injected or just dropped). On s390 kvm_arch_can_inject_async_page_present() always returns 'true' so the rename doesn't matter much. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-4-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 68fd66f100d196d35ab3008d4c69af3a0d7e7200 Author: Vitaly Kuznetsov Date: Mon May 25 16:41:17 2020 +0200 KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info Currently, APF mechanism relies on the #PF abuse where the token is being passed through CR2. If we switch to using interrupts to deliver page-ready notifications we need a different way to pass the data. Extent the existing 'struct kvm_vcpu_pv_apf_data' with token information for page-ready notifications. While on it, rename 'reason' to 'flags'. This doesn't change the semantics as we only have reasons '1' and '2' and these can be treated as bit flags but KVM_PV_REASON_PAGE_READY is going away with interrupt based delivery making 'reason' name misleading. The newly introduced apf_put_user_ready() temporary puts both flags and token information, this will be changed to put token only when we switch to interrupt based notifications. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 84b09f33a5de528d05c007d9847403a364dfe35e Author: Vitaly Kuznetsov Date: Mon May 25 16:41:16 2020 +0200 Revert "KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously" Commit 9a6e7c39810e (""KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously") added a protection against 'page ready' notification coming before 'page not present' is delivered. This situation seems to be impossible since commit 2a266f23550b ("KVM MMU: check pending exception before injecting APF) which added 'vcpu->arch.exception.pending' check to kvm_can_do_async_pf. On x86, kvm_arch_async_page_present() has only one call site: kvm_check_async_pf_completion() loop and we only enter the loop when kvm_arch_can_inject_async_page_present(vcpu) which when async pf msr is enabled, translates into kvm_can_do_async_pf(). There is also one problem with the cancellation mechanism. We don't seem to check that the 'page not present' notification we're canceling matches the 'page ready' notification so in theory, we may erroneously drop two valid events. Revert the commit. Reviewed-by: Gavin Shan Signed-off-by: Vitaly Kuznetsov Message-Id: <20200525144125.143875-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit f4a9fdd5f12ad48700ad5dcb7a0dc7cf9a3bcd5a Author: Gustavo A. R. Silva Date: Thu May 7 13:56:18 2020 -0500 KVM: VMX: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Message-Id: <20200507185618.GA14831@embeddedor> Signed-off-by: Paolo Bonzini commit a8387d0b471f7c8d4d936af0d6dc44dff5c41c6c Author: Paolo Bonzini Date: Fri May 29 05:42:55 2020 -0400 Revert "KVM: No need to retry for hva_to_pfn_remapped()" This reverts commit 5b494aea13fe9ec67365510c0d75835428cbb303. If unlocked==true then the vma pointer could be invalidated, so the 2nd follow_pfn() is potentially racy: we do need to get out and redo find_vma_intersection(). Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit cc440cdad5b7a4c1de12dace725209eb3e0cf663 Author: Paolo Bonzini Date: Wed May 13 13:36:32 2020 -0400 KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE Similar to VMX, the state that is captured through the currently available IOCTLs is a mix of L1 and L2 state, dependent on whether the L2 guest was running at the moment when the process was interrupted to save its state. In particular, the SVM-specific state for nested virtualization includes the L1 saved state (including the interrupt flag), the cached L2 controls, and the GIF. Signed-off-by: Paolo Bonzini commit 8ec107c89b19bc37a7ec364f3e1c92ae4d961b78 Author: Vitaly Kuznetsov Date: Fri May 29 15:04:07 2020 +0200 selftests: kvm: fix smm test on SVM KVM_CAP_NESTED_STATE is now supported for AMD too but smm test acts like it is still Intel only. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200529130407.57176-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 10b910cb7edebac478d329244ca479b7962fb46e Author: Paolo Bonzini Date: Tue May 19 13:23:05 2020 -0400 selftests: kvm: add a SVM version of state-test The test is similar to the existing one for VMX, but simpler because we don't have to test shadow VMCS or vmptrld/vmptrst/vmclear. Signed-off-by: Paolo Bonzini commit ed881297338625f3799cce8774d198ef05a858e6 Author: Vitaly Kuznetsov Date: Fri May 29 15:04:06 2020 +0200 selftests: kvm: introduce cpu_has_svm() check Many tests will want to check if the CPU is Intel or AMD in guest code, add cpu_has_svm() and put it as static inline to svm_util.h. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200529130407.57176-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 929d1cfaa6926ccee28d8d4220e0b4e2defd9cd1 Author: Paolo Bonzini Date: Tue May 19 06:18:31 2020 -0400 KVM: MMU: pass arbitrary CR0/CR4/EFER to kvm_init_shadow_mmu This allows fetching the registers from the hsave area when setting up the NPT shadow MMU, and is needed for KVM_SET_NESTED_STATE (which runs long after the CR0, CR4 and EFER values in vcpu have been switched to hold L2 guest state). Signed-off-by: Paolo Bonzini commit c513f484c5582a8efadf3d72298e2285b041536e Author: Paolo Bonzini Date: Mon May 18 13:08:37 2020 -0400 KVM: nSVM: leave guest mode when clearing EFER.SVME According to the AMD manual, the effect of turning off EFER.SVME while a guest is running is undefined. We make it leave guest mode immediately, similar to the effect of clearing the VMX bit in MSR_IA32_FEAT_CTL. Signed-off-by: Paolo Bonzini commit ca46d739e3caf44dcd3db9eb8da30d0ff3aa9180 Author: Paolo Bonzini Date: Mon May 18 13:02:15 2020 -0400 KVM: nSVM: split nested_vmcb_check_controls The authoritative state does not come from the VMCB once in guest mode, but KVM_SET_NESTED_STATE can still perform checks on L1's provided SVM controls because we get them from userspace. Therefore, split out a function to do them. Signed-off-by: Paolo Bonzini commit 08245e6d2e589f2b6e9e275ddb343e2ec9ce94ec Author: Paolo Bonzini Date: Tue May 19 09:21:04 2020 -0400 KVM: nSVM: remove HF_HIF_MASK The L1 flags can be found in the save area of svm->nested.hsave, fish it from there so that there is one fewer thing to migrate. Signed-off-by: Paolo Bonzini commit e9fd761a46b8655aa5ff84b4adc0c8cf43952145 Author: Paolo Bonzini Date: Wed May 13 13:28:23 2020 -0400 KVM: nSVM: remove HF_VINTR_MASK Now that the int_ctl field is stored in svm->nested.ctl.int_ctl, we can use it instead of vcpu->arch.hflags to check whether L2 is running in V_INTR_MASKING mode. Signed-off-by: Paolo Bonzini commit 36e2e98363e6c13288de6824b51866292dbc151d Author: Paolo Bonzini Date: Fri May 22 06:04:57 2020 -0400 KVM: nSVM: synthesize correct EXITINTINFO on vmexit This bit was added to nested VMX right when nested_run_pending was introduced, but it is not yet there in nSVM. Since we can have pending events that L0 injected directly into L2 on vmentry, we have to transfer them into L1's queue. For this to work, one important change is required: svm_complete_interrupts (which clears the "injected" fields from the previous VMRUN, and updates them from svm->vmcb's EXITINTINFO) must be placed before we inject the vmexit. This is not too scary though; VMX even does it in vmx_vcpu_run. While at it, the nested_vmexit_inject tracepoint is moved towards the end of nested_svm_vmexit. This ensures that the synthesized EXITINTINFO is visible in the trace. Signed-off-by: Paolo Bonzini commit 91b7130cb6606d8c6b3b77e54426b3f3a83f48b1 Author: Paolo Bonzini Date: Fri May 22 12:28:52 2020 -0400 KVM: SVM: preserve VGIF across VMCB switch There is only one GIF flag for the whole processor, so make sure it is not clobbered when switching to L2 (in which case we also have to include the V_GIF_ENABLE_MASK, lest we confuse enable_gif/disable_gif/gif_set). When going back, L1 could in theory have entered L2 without issuing a CLGI so make sure the svm_set_gif is done last, after svm->vmcb->control.int_ctl has been copied back from hsave. Signed-off-by: Paolo Bonzini commit ffdf7f9e80ac1b6fea3bc6a65ea1f264bc226eab Author: Paolo Bonzini Date: Fri May 22 12:18:27 2020 -0400 KVM: nSVM: extract svm_set_gif Extract the code that is needed to implement CLGI and STGI, so that we can run it from VMRUN and vmexit (and in the future, KVM_SET_NESTED_STATE). Skip the request for KVM_REQ_EVENT unless needed, subsuming the evaluate_pending_interrupts optimization that is found in enter_svm_guest_mode. Signed-off-by: Paolo Bonzini commit 31031098feb9e1233176896d31eaf766c13429df Author: Paolo Bonzini Date: Fri May 22 12:33:52 2020 -0400 KVM: nSVM: remove unnecessary if kvm_vcpu_apicv_active must be false when nested virtualization is enabled, so there is no need to check it in clgi_interception. Signed-off-by: Paolo Bonzini commit 2d8a42be0e2b15a4e0b20349f27bb8288db5ebe6 Author: Paolo Bonzini Date: Fri May 22 03:50:14 2020 -0400 KVM: nSVM: synchronize VMCB controls updated by the processor on every vmexit The control state changes on every L2->L0 vmexit, and we will have to serialize it in the nested state. So keep it up to date in svm->nested.ctl and just copy them back to the nested VMCB in nested_svm_vmexit. Signed-off-by: Paolo Bonzini commit d8e4e58f4bd4bb55d2640a841c3606333930f0e1 Author: Paolo Bonzini Date: Fri May 22 07:38:20 2020 -0400 KVM: nSVM: restore clobbered INT_CTL fields after clearing VINTR Restore the INT_CTL value from the guest's VMCB once we've stopped using it, so that virtual interrupts can be injected as requested by L1. V_TPR is up-to-date however, and it can change if the guest writes to CR8, so keep it. Signed-off-by: Paolo Bonzini commit e670bf68f4b701506d51f007917ab633894294d0 Author: Paolo Bonzini Date: Wed May 13 13:16:12 2020 -0400 KVM: nSVM: save all control fields in svm->nested In preparation for nested SVM save/restore, store all data that matters from the VMCB control area into svm->nested. It will then become part of the nested SVM state that is saved by KVM_SET_NESTED_STATE and restored by KVM_GET_NESTED_STATE, just like the cached vmcs12 for nVMX. Signed-off-by: Paolo Bonzini commit 7923ef4f6ec4a25a902bd827446eac860b01fd1c Author: Paolo Bonzini Date: Mon May 18 15:24:46 2020 -0400 KVM: nSVM: remove trailing padding for struct vmcb_control_area Allow placing the VMCB structs on the stack or in other structs without wasting too much space. Add BUILD_BUG_ON as a quick safeguard against typos. Signed-off-by: Paolo Bonzini commit 2f675917efc8a4d469f8be95e6ea55b2310bfd0d Author: Paolo Bonzini Date: Mon May 18 15:21:22 2020 -0400 KVM: nSVM: pass vmcb_control_area to copy_vmcb_control_area This will come in handy when we put a struct vmcb_control_area in svm->nested. Signed-off-by: Paolo Bonzini commit 18fc6c55d1f449ff57778a4003c838a79d62b5a8 Author: Paolo Bonzini Date: Mon May 18 11:07:08 2020 -0400 KVM: nSVM: clean up tsc_offset update Use l1_tsc_offset to compute svm->vcpu.arch.tsc_offset and svm->vmcb->control.tsc_offset, instead of relying on hsave. Signed-off-by: Paolo Bonzini commit 69cb877487de3662e08081cf036f8fe0e4a3b806 Author: Paolo Bonzini Date: Fri May 22 05:27:46 2020 -0400 KVM: nSVM: move MMU setup to nested_prepare_vmcb_control Everything that is needed during nested state restore is now part of nested_prepare_vmcb_control. Signed-off-by: Paolo Bonzini commit f241d711b2d17f79ae5fad78c5644c674fce42ba Author: Paolo Bonzini Date: Mon May 18 10:56:43 2020 -0400 KVM: nSVM: extract preparation of VMCB for nested run Split out filling svm->vmcb.save and svm->vmcb.control before VMRUN. Only the latter will be useful when restoring nested SVM state. This patch introduces no semantic change, so the MMU setup is still done in nested_prepare_vmcb_save. The next patch will clean up things. Signed-off-by: Paolo Bonzini commit 3e06f0163f7f75364290bf338f4e279f6e3e404f Author: Paolo Bonzini Date: Wed May 13 13:07:26 2020 -0400 KVM: nSVM: extract load_nested_vmcb_control When restoring SVM nested state, the control state cache in svm->nested will have to be filled, but the save state will not have to be moved into svm->vmcb. Therefore, pull the code that handles the control area into a separate function. Signed-off-by: Paolo Bonzini commit 69c9dfa24bb7bac5c9e2bd4d3f631e35b91e3733 Author: Paolo Bonzini Date: Wed May 13 12:57:26 2020 -0400 KVM: nSVM: move map argument out of enter_svm_guest_mode Unmapping the nested VMCB in enter_svm_guest_mode is a bit of a wart, since the map argument is not used elsewhere in the function. There are just two callers, and those are also the place where kvm_vcpu_map is called, so it is cleaner to unmap there. Signed-off-by: Paolo Bonzini commit 45f08f4cd6679adebca9fb17a46df40e251cd2ff Author: Paolo Bonzini Date: Mon Jun 1 04:17:45 2020 -0400 KVM: check userspace_addr for all memslots The userspace_addr alignment and range checks are not performed for private memory slots that are prepared by KVM itself. This is unnecessary and makes it questionable to use __*_user functions to access memory later on. We also rely on the userspace address being aligned since we have an entire family of functions to map gfn to pfn. Fortunately skipping the check is completely unnecessary. Only x86 uses private memslots and their userspace_addr is obtained from vm_mmap, therefore it must be below PAGE_OFFSET. In fact, any attempt to pass an address above PAGE_OFFSET would have failed because such an address would return true for kvm_is_error_hva. Reported-by: Linus Torvalds Signed-off-by: Paolo Bonzini commit 8b390ab725fddc443bb0082a6c67e82e25bfba7e Merge: d053cf0d771f 5f1fcf8c0adc Author: Petr Mladek Date: Mon Jun 1 10:15:43 2020 +0200 Merge branch 'for-5.8-printf-time64_t' into for-linus commit d053cf0d771f6547cb0537759a9af63cf402908d Merge: 6a0af9fc8cce eb012d125a24 Author: Petr Mladek Date: Mon Jun 1 10:15:16 2020 +0200 Merge branch 'for-5.8' into for-linus commit 6a0af9fc8ccef5304ef88dc7e27362732e047076 Merge: e8cc2b97ca5a 33225d7b0ac9 Author: Petr Mladek Date: Mon Jun 1 10:13:51 2020 +0200 Merge branch 'for-5.7-preferred-console' into for-linus commit 098c4adf249c198519a4abebe482b1e6b8c50e47 Author: Lee Jones Date: Mon Jun 1 08:53:30 2020 +0100 mfd: mt6360: Remove duplicate REGMAP_IRQ_REG_LINE() entry Fixes the following build warning: >> drivers/mfd/mt6360-core.c:148:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] REGMAP_IRQ_REG_LINE(MT6360_CHG_TREG_EVT, 8), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/regmap.h:1191:10: note: expanded from macro 'REGMAP_IRQ_REG_LINE' [_id] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mfd/mt6360-core.c:124:2: note: previous initialization is here REGMAP_IRQ_REG_LINE(MT6360_CHG_TREG_EVT, 8), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/regmap.h:1191:10: note: expanded from macro 'REGMAP_IRQ_REG_LINE' [_id] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Reported-by: kbuild test robot Signed-off-by: Lee Jones commit d77aeb5d403d379ff458e04fc07b5b86700270f2 Author: Ingo Molnar Date: Mon Jun 1 09:45:27 2020 +0200 irqchip: Fix "Loongson HyperTransport Vector support" driver build on all non-MIPS platforms This commit: 818e915fbac5: ("irqchip: Add Loongson HyperTransport Vector support") Added a MIPS-only driver, but turned on compilation on all other architectures as well: config LOONGSON_HTVEC bool "Loongson3 HyperTransport Interrupt Vector Controller" depends on MACH_LOONGSON64 || COMPILE_TEST But this driver was never build tested on any other architecture than MIPS: drivers/irqchip/irq-loongson-htvec.c: In function ‘htvec_irq_dispatch’: drivers/irqchip/irq-loongson-htvec.c:59:3: error: implicit declaration of function ‘spurious_interrupt’; did you mean ‘smp_reboot_interrupt’? [-Werror=implicit-function-declaration] Because spurious_interrupt() only exists on MIPS. So make it MIPS-only. Signed-off-by: Ingo Molnar Cc: Jiaxun Yang Cc: Marc Zyngier Cc: Thomas Gleixner Signed-off-by: Ingo Molnar commit 45679f9b508f10c12a1e93cf2bdccbc1c594aa39 Author: Sibi Sankar Date: Thu May 28 00:54:18 2020 +0530 opp: Don't parse icc paths unnecessarily The DT node of the device may contain interconnect paths while the OPP table doesn't have the bandwidth values. There is no need to parse the paths in such cases. Signed-off-by: Sibi Sankar Tested-by: Sibi Sankar Reviewed-by: Sibi Sankar [ Viresh: Support the case of !opp_table and massaged changelog ] Signed-off-by: Viresh Kumar commit 0ad679d157aa69ddf0ee46b564c9fbb646cf6d4e Author: Ben Skeggs Date: Fri May 29 17:57:29 2020 +1000 drm/nouveau/kms/gt215-: fix race with audio driver runpm The audio driver can call into nouveau right while we're in the middle of re-fetching the EDID, and decide it no longer needs to be awake. Stop depending on EDID in the audio component get_eld() callback, and instead cache whether audio support is present from the prior modeset. Signed-off-by: Ben Skeggs commit a1ef8bad506e4ffa0c57ac5f8cb99ab5cbc3b1fc Author: Ben Skeggs Date: Fri May 29 15:18:47 2020 +1000 drm/nouveau/disp/gm200-: fix NV_PDISP_SOR_HDMI2_CTRL(n) selection This is a SOR register, and not indexed by the bound head. Fixes display not coming up on high-bandwidth HDMI displays under a number of configurations. Signed-off-by: Ben Skeggs commit 05c8a4fc44a916dd897769ca69b42381f9177ec4 Author: Oded Gabbay Date: Mon Jun 1 09:56:48 2020 +0300 habanalabs: correctly cast u64 to void* Use the u64_to_user_ptr(x) kernel macro to correctly cast u64 to void* Reported-by: kbuild test robot Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay Link: https://lore.kernel.org/r/20200601065648.8775-2-oded.gabbay@gmail.com Signed-off-by: Greg Kroah-Hartman commit c68f1baeaff4b21976191ba929f5ae26e1037a0a Author: Tomer Tayar Date: Mon Jun 1 09:56:47 2020 +0300 habanalabs: initialize variable to default value Fix the following smatch error in unmap_device_va(): error: uninitialized symbol 'rc'. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Link: https://lore.kernel.org/r/20200601065648.8775-1-oded.gabbay@gmail.com Signed-off-by: Greg Kroah-Hartman commit e5aeebddfc312ea7bb55dfe6c7264e71a3b43992 Author: Zijun Hu Date: Fri May 29 22:38:31 2020 +0800 Bluetooth: hci_qca: Fix QCA6390 memdump failure QCA6390 memdump VSE sometimes come to bluetooth driver with wrong sequence number as illustrated as follows: frame # in dec: frame data in hex 1396: ff fd 01 08 74 05 00 37 8f 14 1397: ff fd 01 08 75 05 00 ff bf 38 1414: ff fd 01 08 86 05 00 fb 5e 4b 1399: ff fd 01 08 77 05 00 f3 44 0a 1400: ff fd 01 08 78 05 00 ca f7 41 it is mistook for controller missing packets, so results in page fault after overwriting memdump buffer allocated. Fixed by ignoring QCA6390 sequence number check and checking buffer space before writing. Signed-off-by: Zijun Hu Tested-by: Zijun Hu Signed-off-by: Marcel Holtmann commit ae5c0585dfc2168c589de5878df2e591dfbd4bf0 Author: Lubomir Rintel Date: Thu May 21 11:13:48 2020 +0200 dt-bindings: mmc: Convert sdhci-pxa to json-schema Convert the sdhci-pxa binding to DT schema format using json-schema. At the same time, fix a couple of issues with the examples discovered by the validation tool -- a semicolon instead of a comma and wrong node names. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200521091356.2211020-2-lkundrak@v3.sk Reviewed-by: Rob Herring Signed-off-by: Ulf Hansson commit d3a0fe6b0988241c64ef4f6a1045423cc79a612a Author: Zijun Hu Date: Fri May 29 23:58:56 2020 +0800 Bluetooth: btmtkuart: Use serdev_device_write_buf() instead of serdev_device_write() serdev_device_write() is not appropriate at here because serdev_device_write_wakeup() is not used to release completion hold by the former at @write_wakeup member of struct serdev_device_ops. Fix by using serdev_device_write_buf() instead of serdev_device_write(). Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann commit 9253d71011c349d5f5cc0cebdf68b4a80811b92d Author: Veerabhadrarao Badiganti Date: Thu May 28 20:43:52 2020 +0530 mmc: sdhci-msm: Clear tuning done flag while hs400 tuning Clear tuning_done flag while executing tuning to ensure vendor specific HS400 settings are applied properly when the controller is re-initialized in HS400 mode. Without this, re-initialization of the qcom SDHC in HS400 mode fails while resuming the driver from runtime-suspend or system-suspend. Fixes: ff06ce417828 ("mmc: sdhci-msm: Add HS400 platform support") Cc: stable@vger.kernel.org Signed-off-by: Veerabhadrarao Badiganti Link: https://lore.kernel.org/r/1590678838-18099-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson commit 4942857b015ede4fab8b262931244a3c1006a2a6 Author: Zijun Hu Date: Fri May 29 22:46:13 2020 +0800 Bluetooth: hci_qca: Improve controller ID info log level Controller ID info got by VSC EDL_PATCH_GETVER is very important, so improve its log level from DEBUG to INFO. Signed-off-by: Zijun Hu Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit adbb2dafe732d4715a602ca727dedaa55c0df7a7 Author: Steve French Date: Sat May 30 16:45:11 2020 -0500 cifs: minor fix to two debug messages Joe Perches pointed out that we were missing a newline at the end of two debug messages Reported-by: Joe Perches Signed-off-by: Steve French commit a0a3036b81f1f66fa3333559ecfe18f5bbfa5076 Author: Joe Perches Date: Tue Apr 14 22:42:53 2020 -0700 cifs: Standardize logging output Use pr_fmt to standardize all logging for fs/cifs. Some logging output had no CIFS: specific prefix. Now all output has one of three prefixes: o CIFS: o CIFS: VFS: o Root-CIFS: Miscellanea: o Convert printks to pr_ o Neaten macro definitions o Remove embedded CIFS: prefixes from formats o Convert "illegal" to "invalid" o Coalesce formats o Add missing '\n' format terminations o Consolidate multiple cifs_dbg continuations into single calls o More consistent use of upper case first word output logging o Multiline statement argument alignment and wrapping Signed-off-by: Joe Perches Signed-off-by: Steve French commit 82e9367c43890cb6a870f700c9180c7eb2035684 Author: Steve French Date: Tue May 19 03:06:57 2020 -0500 smb3: Add new parm "nodelete" In order to handle workloads where it is important to make sure that a buggy app did not delete content on the drive, the new mount option "nodelete" allows standard permission checks on the server to work, but prevents on the client any attempts to unlink a file or delete a directory on that mount point. This can be helpful when running a little understood app on a network mount that contains important content that should not be deleted. Signed-off-by: Steve French CC: Stable Reviewed-by: Pavel Shilovsky commit b2ca6c2c9eddc41c09e49e8e83f8208bd80fdb8e Author: Ronnie Sahlberg Date: Thu May 21 15:03:15 2020 +1000 cifs: move some variables off the stack in smb2_ioctl_query_info Move some large data structures off the stack and into dynamically allocated memory in the function smb2_ioctl_query_info Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit a7d5c294628088781da9e91cbb034d61c3a71f71 Author: Ronnie Sahlberg Date: Wed May 20 12:19:59 2020 +1000 cifs: reduce stack use in smb2_compound_op Move a lot of structures and arrays off the stack and into a dynamically allocated structure instead. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit baf3f08ef4083b76ca67b143e135213a7f941879 Author: Paulo Alcantara Date: Tue May 19 15:38:29 2020 -0300 cifs: get rid of unused parameter in reconn_setup_dfs_targets() The target iterator parameter "it" is not used in reconn_setup_dfs_targets(), so just remove it. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit e4af35fa55b072190711c11e2bfff8326d313948 Author: Paulo Alcantara Date: Tue May 19 15:38:28 2020 -0300 cifs: handle hostnames that resolve to same ip in failover In order to support reconnect to hostnames that resolve to same ip address, besides relying on the currently set hostname to match DFS targets, attempt to resolve the targets and then match their addresses with the reconnected server ip address. For instance, if we have two hostnames "FOO" and "BAR", and both resolve to the same ip address, we would be able to handle failover in DFS paths like \\FOO\dfs\link1 -> [ \BAZ\share2 (*), \BAR\share1 ] \\FOO\dfs\link2 -> [ \BAZ\share2 (*), \FOO\share1 ] so when "BAZ" is no longer accessible, link1 and link2 would get reconnected despite having different target hostnames. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit aaa3aef34d3ab9499a5c7633823429f7a24e6dff Author: Paulo Alcantara Date: Tue May 19 15:38:27 2020 -0300 cifs: set up next DFS target before generic_ip_connect() If we mount a very specific DFS link \\FS0.FOO.COM\dfs\link -> \FS0\share1, \FS1\share2 where its target list contains NB names ("FS0" & "FS1") rather than FQDN ones ("FS0.FOO.COM" & "FS1.FOO.COM"), we end up connecting to \FOO\share1 but server->hostname will have "FOO.COM". The reason is because both "FS0" and "FS0.FOO.COM" resolve to same IP address and they share same TCP server connection, but "FS0.FOO.COM" was the first hostname set -- which is OK. However, if the echo thread timeouts and we still have a good connection to "FS0", in cifs_reconnect() rc = generic_ip_connect(server) -> success if (rc) { ... reconn_inval_dfs_target(server, cifs_sb, &tgt_list, &tgt_it); ... } ... it successfully reconnects to "FS0" server but does not set up next DFS target - which should be the same target server "\FS0\share1" - and server->hostname remains set to "FS0.FOO.COM" rather than "FS0", as reconn_inval_dfs_target() would have it set to "FS0" if called earlier. Finally, in __smb2_reconnect(), the reconnect of tcons would fail because tcon->ses->server->hostname (FS0.FOO.COM) does not match DFS target's hostname (FS0). Fix that by calling reconn_inval_dfs_target() before generic_ip_connect() so server->hostname will get updated correctly prior to reconnecting its tcons in __smb2_reconnect(). With "cifs: handle hostnames that resolve to same ip in failover" patch - The above problem would not occur. - We could save an DNS query to find out that they both resolve to the same ip address. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 136a5dc3309a53ee830cd649961d70c8bec55f38 Author: Colin Ian King Date: Wed May 27 13:50:31 2020 +0100 cifs: remove redundant initialization of variable rc The variable rc is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Steve French commit 8fd6e1d6941ce623ae62420d264c1b5505971b2b Author: Kenneth D'souza Date: Mon May 18 13:01:34 2020 +0530 cifs: handle "nolease" option for vers=1.0 The "nolease" mount option is only supported for SMB2+ mounts. Fail with appropriate error message if vers=1.0 option is passed. Signed-off-by: Kenneth D'souza Reviewed-by: Pavel Shilovsky Signed-off-by: Steve French commit 78c08247b9d3e03192f8b359aa079024e805a948 Author: WeiXiong Liao Date: Wed Mar 25 16:55:06 2020 +0800 mtd: Support kmsg dumper based on pstore/blk This introduces mtdpstore, which is similar to mtdoops but more powerful. It uses pstore/blk, and aims to store panic and oops logs to a flash partition, where pstore can later read back and present as files in the mounted pstore filesystem. To make mtdpstore work, the "blkdev" of pstore/blk should be set as MTD device name or MTD device number. For more details, see Documentation/admin-guide/pstore-blk.rst This solves a number of issues: - Work duplication: both of pstore and mtdoops do the same job storing panic/oops log. They have very similar logic, registering to kmsg dumper and storing logs to several chunks one by one. - Layer violations: drivers should provides methods instead of polices. MTD should provide read/write/erase operations, and allow a higher level drivers to provide the chunk management, kmsg dump configuration, etc. - Missing features: pstore provides many additional features, including presenting the logs as files, logging dump time and count, and supporting other frontends like pmsg, console, etc. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-11-keescook@chromium.org/ Link: https://lore.kernel.org/r/1589266715-4168-1-git-send-email-liaoweixiong@allwinnertech.com Signed-off-by: Kees Cook commit f8feafeaeedbf0a324c373c5fa29a2098a69c458 Author: Kees Cook Date: Fri May 8 08:34:01 2020 -0700 pstore/blk: Introduce "best_effort" mode In order to use arbitrary block devices as a pstore backend, provide a new module param named "best_effort", which will allow using any block device, even if it has not provided a panic_write callback. Link: https://lore.kernel.org/lkml/20200511233229.27745-12-keescook@chromium.org/ Signed-off-by: Kees Cook commit 7dcb7848ba110ff192efc917d1a6de66b4c9ca4f Author: WeiXiong Liao Date: Wed Mar 25 16:55:05 2020 +0800 pstore/blk: Support non-block storage devices Add support for non-block devices (e.g. MTD). A non-block driver calls pstore_blk_register_device() to register iself. In addition, pstore/zone is updated to handle non-block devices, where an erase must be done before a write. Without this, there is no way to remove records stored to an MTD. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-10-keescook@chromium.org/ Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit 1525fb3bb6d69028b3941d34363397c28345ffab Author: WeiXiong Liao Date: Wed Mar 25 16:55:04 2020 +0800 pstore/blk: Provide way to query pstore configuration In order to configure itself, the MTD backend needs to be able to query the current pstore configuration. Introduce pstore_blk_get_config() for this purpose. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-9-keescook@chromium.org/ Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit 335426c6dcdd338d6b7c939c2da15fc9c5dd4959 Author: WeiXiong Liao Date: Wed Mar 25 16:55:03 2020 +0800 pstore/zone: Provide way to skip "broken" zone for MTD devices One requirement to support MTD devices in pstore/zone is having a way to declare certain regions as broken. Add this support to pstore/zone. The MTD driver should return -ENOMSG when encountering a bad region, which tells pstore/zone to skip and try the next one. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-8-keescook@chromium.org/ Co-developed-by: Colin Ian King Signed-off-by: Colin Ian King Link: //lore.kernel.org/lkml/20200512173801.222666-1-colin.king@canonical.com Signed-off-by: Kees Cook commit 1806c13dc2532090d742ce03847b22367fb20ad6 Merge: 1079a34c56c5 bdc48fa11e46 Author: David S. Miller Date: Sun May 31 17:48:46 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net xdp_umem.c had overlapping changes between the 64-bit math fix for the calculation of npgs and the removal of the zerocopy memory type which got rid of the chunk_size_nohdr member. The mlx5 Kconfig conflict is a case where we just take the net-next copy of the Kconfig entry dependency as it takes on the ESWITCH dependency by one level of indirection which is what the 'net' conflicting change is trying to ensure. Signed-off-by: David S. Miller commit 1079a34c56c535c3e27df8def0d3c5069d2de129 Merge: 39884604b116 093a48d2aa4b Author: David S. Miller Date: Sun May 31 14:32:50 2020 -0700 Merge tag 'mac80211-next-for-davem-2020-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Another set of changes, including * many 6 GHz changes, though it's not _quite_ complete (I left out scanning for now, we're still discussing) * allow userspace SA-query processing for operating channel validation * TX status for control port TX, for AP-side operation * more per-STA/TID control options * move to kHz for channels, for future S1G operation * various other small changes ==================== Signed-off-by: David S. Miller commit 6bd140e14d9aaa734ec37985b8b20a96c0ece948 Author: Stafford Horne Date: Wed Apr 22 20:24:11 2020 +0900 openrisc: Fix issue with argument clobbering for clone/fork Working on the OpenRISC glibc port I found that sometimes clone was working strange. That the tls data argument sent in r7 was always wrong. Further investigation revealed that the arguments were getting clobbered in the entry code. This patch removes the code that writes to the argument registers. This was likely due to some old code hanging around. This patch fixes this up for clone and fork. This fork clobber is harmless but also useless so remove. Signed-off-by: Stafford Horne commit 3977e285ee89a94699255dbbf6eeea13889a1083 Merge: e32f88790195 56305aa9b6fa Author: Eric W. Biederman Date: Sun May 31 15:02:36 2020 -0500 exec: Remove the recomputation of bprm->cred Recomputing the uids, gids, capabilities, and related flags each time a new bprm->file is set is error prone and unnecessary. This set of changes splits per_clear temporarily into two separate variables. This is the last change necessary to ensure that everything that is computed from brpm->file in bprm->cred is recomputed every time a new bprm->file is set. Then the code is refactored to compute bprm->cred from bprm->file when the final brpm->file is known, removing the need for recomputation entirely. Doing this in two steps should allow anyone who has problems later to bisect and tell if it was the semantic change or the refactoring that caused them problems. Eric W. Biederman (2): exec: Add a per bprm->file version of per_clear exec: Compute file based creds only once fs/binfmt_misc.c | 2 +- fs/exec.c | 57 ++++++++++++++++++------------------------- include/linux/binfmts.h | 9 ++----- include/linux/lsm_hook_defs.h | 2 +- include/linux/lsm_hooks.h | 22 +++++++++-------- include/linux/security.h | 9 ++++--- security/commoncap.c | 22 +++++++++-------- security/security.c | 4 +-- 8 files changed, 59 insertions(+), 68 deletions(-) Merge branch 'exec-norecompute-v2' into exec-next commit a310082f6d0afe28797e148726cd52118a8a4428 Author: David Howells Date: Fri Mar 20 09:32:50 2020 +0000 afs: Rename struct afs_fs_cursor to afs_operation As a prelude to implementing asynchronous fileserver operations in the afs filesystem, rename struct afs_fs_cursor to afs_operation. This struct is going to form the core of the operation management and is going to acquire more members in later. Signed-off-by: David Howells commit 7126ead910aa9fcc9e16e9e7a8c9179658261f1d Author: David Howells Date: Wed Apr 8 16:49:08 2020 +0100 afs: Remove the error argument from afs_protocol_error() Remove the error argument from afs_protocol_error() as it's always -EBADMSG. Signed-off-by: David Howells commit 38355eec6a7d2b8f2f313f9174736dc877744e59 Author: David Howells Date: Wed Apr 8 16:13:20 2020 +0100 afs: Set error flag rather than return error from file status decode Set a flag in the call struct to indicate an unmarshalling error rather than return and handle an error from the decoding of file statuses. This flag is checked on a successful return from the delivery function. Signed-off-by: David Howells commit 8230fd8217b7ea76f838ae88e4a5a8e54f37099f Author: David Howells Date: Fri Mar 27 15:02:44 2020 +0000 afs: Make callback processing more efficient. afs_vol_interest objects represent the volume IDs currently being accessed from a fileserver. These hold lists of afs_cb_interest objects that repesent the superblocks using that volume ID on that server. When a callback notification from the server telling of a modification by another client arrives, the volume ID specified in the notification is looked up in the server's afs_vol_interest list. Through the afs_cb_interest list, the relevant superblocks can be iterated over and the specific inode looked up and marked in each one. Make the following efficiency improvements: (1) Hold rcu_read_lock() over the entire processing rather than locking it each time. (2) Do all the callbacks for each vid together rather than individually. Each volume then only needs to be looked up once. (3) afs_vol_interest objects are now stored in an rb_tree rather than a flat list to reduce the lookup step count. (4) afs_vol_interest lookup is now done with RCU, but because it's in an rb_tree which may rotate under us, a seqlock is used so that if it changes during the walk, we repeat the walk with a lock held. With this and the preceding patch which adds RCU-based lookups in the inode cache, target volumes/vnodes can be taken without the need to take any locks, except on the target itself. Signed-off-by: David Howells commit 6d043a578265e8c24384648f9c74c8874b429f28 Author: David Howells Date: Mon Apr 20 22:34:12 2020 +0100 afs: Show more information in /proc/net/afs/servers Show more information in /proc/net/afs/servers to make it easier to see what's going on with the server probing. Signed-off-by: David Howells commit f6cbb368bcb0bc4fa7c11554d5293658bb4b26a2 Author: David Howells Date: Fri Apr 24 15:10:00 2020 +0100 afs: Actively poll fileservers to maintain NAT or firewall openings When an AFS client accesses a file, it receives a limited-duration callback promise that the server will notify it if another client changes a file. This callback duration can be a few hours in length. If a client mounts a volume and then an application prevents it from being unmounted, say by chdir'ing into it, but then does nothing for some time, the rxrpc_peer record will expire and rxrpc-level keepalive will cease. If there is NAT or a firewall between the client and the server, the route back for the server may close after a comparatively short duration, meaning that attempts by the server to notify the client may then bounce. The client, however, may (so far as it knows) still have a valid unexpired promise and will then rely on its cached data and will not see changes made on the server by a third party until it incidentally rechecks the status or the promise needs renewal. To deal with this, the client needs to regularly probe the server. This has two effects: firstly, it keeps a route open back for the server, and secondly, it causes the server to disgorge any notifications that got queued up because they couldn't be sent. Fix this by adding a mechanism to emit regular probes. Two levels of probing are made available: Under normal circumstances the 'slow' queue will be used for a fileserver - this just probes the preferred address once every 5 mins or so; however, if server fails to respond to any probes, the server will shift to the 'fast' queue from which all its interfaces will be probed every 30s. When it finally responds, the record will switch back to the slow queue. Further notes: (1) Probing is now no longer driven from the fileserver rotation algorithm. (2) Probes are dispatched to all interfaces on a fileserver when that an afs_server object is set up to record it. (3) The afs_server object is removed from the probe queues when we start to probe it. afs_is_probing_server() returns true if it's not listed - ie. it's undergoing probing. (4) The afs_server object is added back on to the probe queue when the final outstanding probe completes, but the probed_at time is set when we're about to launch a probe so that it's not dependent on the probe duration. (5) The timer and the work item added for this must be handed a count on net->servers_outstanding, which they hand on or release. This makes sure that network namespace cleanup waits for them. Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") Reported-by: Dave Botsch Signed-off-by: David Howells commit 977e5f8ed0ab2786755f8d2a96b78a3c7320f7c4 Author: David Howells Date: Fri Apr 17 17:31:26 2020 +0100 afs: Split the usage count on struct afs_server Split the usage count on the afs_server struct to have an active count that registers who's actually using it separately from the reference count on the object. This allows a future patch to dispatch polling probes without advancing the "unuse" time into the future each time we emit a probe, which would otherwise prevent unused server records from expiring. Included in this: (1) The latter part of afs_destroy_server() in which the RCU destruction of afs_server objects is invoked and the outstanding server count is decremented is split out into __afs_put_server(). (2) afs_put_server() now calls __afs_put_server() rather then setting the management timer. (3) The calls begun by afs_fs_give_up_all_callbacks() and afs_fs_get_capabilities() can now take a ref on the server record, so afs_destroy_server() can just drop its ref and needn't wait for the completion of these calls. They'll put the ref when they're done. (4) Because of (3), afs_fs_probe_done() no longer needs to wake up afs_destroy_server() with server->probe_outstanding. (5) afs_gc_servers can be simplified. It only needs to check if server->active is 0 rather than playing games with the refcount. (6) afs_manage_servers() can propose a server for gc if usage == 0 rather than if ref == 1. The gc is effected by (5). Signed-off-by: David Howells commit 810068059234551b6973b46ca572e654f0c5e665 Author: David Howells Date: Thu Apr 16 17:05:28 2020 +0100 afs: Use the serverUnique field in the UVLDB record to reduce rpc ops The U-version VLDB volume record retrieved by the VL.GetEntryByNameU rpc op carries a change counter (the serverUnique field) for each fileserver listed in the record as backing that volume. This is incremented whenever the registration details for a fileserver change (such as its address list). Note that the same value will be seen in all UVLDB records that refer to that fileserver. This should be checked before calling the VL server to re-query the address list for a fileserver. If it's the same, there's no point doing the query. Reported-by: Jeffrey Altman Signed-off-by: David Howells commit 13fcc6356a94558a0a4857dc00cd26b3834a1b3e Author: David Howells Date: Thu Apr 16 14:20:32 2020 +0100 afs: Always include dir in bulk status fetch from afs_do_lookup() When a lookup is done in an AFS directory, the filesystem will speculate and fetch up to 49 other statuses for files in the same directory and fetch those as well, turning them into inodes or updating inodes that already exist. However, occasionally, a callback break might go missing due to NAT timing out, but the afs filesystem doesn't then realise that the directory is not up to date. Alleviate this by using one of the status slots to check the directory in which the lookup is being done. Reported-by: Dave Botsch Suggested-by: Jeffrey Altman Signed-off-by: David Howells commit 32f71aa497cfb23d37149c2ef16ad71fce2e45e2 Author: David Howells Date: Sat May 2 13:38:23 2020 +0100 rxrpc: Adjust /proc/net/rxrpc/calls to display call->debug_id not user_ID The user ID value isn't actually much use - and leaks a kernel pointer or a userspace value - so replace it with the call debug ID, which appears in trace points. Signed-off-by: David Howells commit 23e2db311a10ba66c439ddac7a703991309702ee Author: David Howells Date: Sat May 2 13:31:19 2020 +0100 rxrpc: Map the EACCES error produced by some ICMP6 to EHOSTUNREACH Map the EACCES error that is produced by some ICMP6 packets to EHOSTUNREACH when we get them as EACCES has other meanings within a filesystem context. Signed-off-by: David Howells commit 3f19b2ab97a97b413c24b66c67ae16daa4f56c35 Author: David Howells Date: Fri Dec 1 11:40:16 2017 +0000 vfs, afs, ext4: Make the inode hash table RCU searchable Make the inode hash table RCU searchable so that searches that want to access or modify an inode without taking a ref on that inode can do so without taking the inode hash table lock. The main thing this requires is some RCU annotation on the list manipulation operations. Inodes are already freed by RCU in most cases. Users of this interface must take care as the inode may be still under construction or may be being torn down around them. There are at least three instances where this can be of use: (1) Testing whether the inode number iunique() is going to return is currently unique (the iunique_lock is still held). (2) Ext4 date stamp updating. (3) AFS callback breaking. Signed-off-by: David Howells Acked-by: Konstantin Khlebnikov cc: linux-ext4@vger.kernel.org cc: linux-afs@lists.infradead.org commit 9bd0bd264578fe191bf5d2ff23f9887b91862536 Author: Chuanhong Guo Date: Sat Mar 28 12:14:57 2020 +0800 MIPS: ralink: drop ralink_clk_init for mt7621 ralink_clk_init is only called in arch/mips/ralink/clk.c which isn't compiled for mt7621. And it doesn't export a proper cpu clock. Drop this unused function. Signed-off-by: Chuanhong Guo Signed-off-by: Thomas Bogendoerfer commit 389500696810f5aa8fc1fe6f375b9dabd111e1d6 Author: Christophe JAILLET Date: Sun May 31 12:06:03 2020 +0200 MIPS: ralink: bootrom: mark a function as __init to save some memory 'bootrom_setup()' is only called via 'postcore_initcall'. It can be marked as __init to save a few bytes of memory. Signed-off-by: Christophe JAILLET Signed-off-by: Thomas Bogendoerfer commit b5e19a642b7ed3d9e6de746957226a7ae726d226 Author: Chinh T Cao Date: Fri May 15 17:55:06 2020 -0700 ice: Ignore EMODE when setting PHY config When setting the PHY cfg (CQ cmd 0x0601), if the firmware responds with an EMODE error, software will ignore the error as it simply means that manageability (ex: BMC) is in control of the link and that the new setting may not be applied. Signed-off-by: Chinh T Cao Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit d5329be9907723a646f8874388cdaaccba988b4d Author: Henry Tieman Date: Fri May 15 17:55:05 2020 -0700 ice: fix aRFS after flow director delete The logic was missing for adding back perfect flows after flow director filter delete. The code now adds perfect flows into the HW tables after filter delete. Signed-off-by: Henry Tieman Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit a039f6fcba452fba5973798f4c641eee1ef770a1 Author: Brett Creeley Date: Fri May 15 17:55:04 2020 -0700 ice: Use coalesce values from q_vector 0 when increasing q_vectors Currently when a VSI is built (i.e. reset, set channels, etc.) the coalesce settings will be preserved in most cases. However, when the number of q_vectors are increased the settings for the new q_vectors will be set to the driver defaults of AIM on, Rx/Tx ITR 50, and INTRL 0. This is causing issues with how the ethtool layer gets the current coalesce settings since it only uses q_vector 0. So, assume that the user set the coalesce settings globally (i.e. ethtool -C eth0) and use q_vector 0's settings for all of the new q_vectors. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1a9c561aa35534a03c0aa51c7fb1485731202a7c Author: Paul M Stillwell Jr Date: Fri May 15 17:55:03 2020 -0700 ice: fix PCI device serial number to be lowercase values Commit ceb2f00707f9 ("ice: Use pci_get_dsn()") changed the code to use a new function to get the Device Serial Number. It also changed the case of the filename for loading a package on a specific NIC from lowercase to uppercase. Change the filename back to lowercase since that is what we specified. Fixes: ceb2f00707f9 ("ice: Use pci_get_dsn()") Signed-off-by: Paul M Stillwell Jr Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit ebb462dc21eae79bed5b050afb225534992bd1f0 Author: Bruce Allan Date: Fri May 15 17:55:02 2020 -0700 ice: fix function signature style format Where possible, cuddle multiple lines of function signatures to be consistent throughout the code. Signed-off-by: Bruce Allan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 7dcc0fb8f64913c783c7c1f06065c47e39b19794 Author: Brett Creeley Date: Fri May 15 17:55:01 2020 -0700 ice: Allow VF to request reset as soon as it's initialized A VF driver has the ability to request reset via VIRTCHNL_OP_RESET_VF. This is a required step in VF driver load. Currently, the PF is only allowing a VF to request reset using this method after the VF has already communicated resources via VIRTCHNL_OP_GET_VF_RESOURCES. However, this is incorrect because the VF can request reset before requesting resources. Fix this by allowing the VF to request a reset once it has been initialized. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 765dd7a1827c687b782e6ab3dd6daf4d13a4780f Author: Jesse Brandeburg Date: Fri May 15 17:55:00 2020 -0700 ice: Fix inability to set channels when down Currently the driver prevents a user from doing modprobe ice ethtool -L eth0 combined 5 ip link set eth0 up The ethtool command fails, because the driver is checking to see if the interface is down before allowing the get_channels to proceed (even for a set_channels). Remove this check and allow the user to configure the interface before bringing it up, which is a much better usability case. Fixes: 87324e747fde ("ice: Implement ethtool ops for channels") Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 401ce33b32812a8fde6789588416d8c5b232138f Author: Brett Creeley Date: Fri May 15 17:54:59 2020 -0700 ice: Always clear QRXFLXP_CNTXT before writing new value Always clear the previous value in QRXFLXP_CNTXT before writing a new value. This will make it so re-used queues will not accidentally take the previously configured settings. Signed-off-by: Brett Creeley Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit cf0bf41dd6cb1d5461c71d2159c7c062fff3c8fd Author: Brett Creeley Date: Fri May 15 17:54:58 2020 -0700 ice: Reset VF for all port VLAN changes from host Currently the PF is modifying the VF's port VLAN on the fly when configured via iproute. This is okay for most cases, but if the VF already has guest VLANs configured the PF has to remove all of those filters so only VLAN tagged traffic that matches the port VLAN will pass. Instead of adding functionality to track which guest VLANs have been added, just reset the VF each time port VLAN parameters are modified. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit bff185e2406e10d2608857171537645714bea1f4 Author: Chinh T Cao Date: Fri May 15 17:51:21 2020 -0700 ice: Update ICE_PHY_TYPE_HIGH_MAX_INDEX value As currently, we are supporting only 5 PHY_SPEEDs for phy_type_high. Thus, we should adjust the value of ICE_PHY_TYPE_HIGH_MAX_INDEX to 5. Signed-off-by: Chinh T Cao Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c9a12d6d2091175fe2dc1707dd40d6ad781414fe Author: Dan Nowlin Date: Fri May 15 17:51:20 2020 -0700 ice: Increase timeout after PFR To allow for resets during package download, increase the timeout period after performing a PFR. The time waited is the global config lock timeout plus the normal PFSWR timeout. Signed-off-by: Dan Nowlin Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 2bb19d6e077190bafbfd50f3793333af3f07a7b1 Author: Brett Creeley Date: Fri May 15 17:51:19 2020 -0700 ice: Fix transmit for all software offloaded VLANs Currently the driver does not recognize when there is an 802.1AD VLAN tag right after the dmac/smac (outermost VLAN tag). If any DCB map is applied and/or DCB is enabled this is causing the hardware to insert a VLAN 0 tag after the 802.1AD VLAN tag that is already in the packet. Fix this by preventing VLAN tag 0 from being added when any VLAN is already present after dmac/smac (software offloaded) or skb (hardware offloaded). Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c1636a6e8a5e10190bd31ae085f9e8f8c5bc50a0 Author: Paul Greenwalt Date: Fri May 15 17:51:18 2020 -0700 ice: support adding 16 unicast/multicast filter on untrusted VF Allow untrusted VF to add 16 unicast/multicast filters. VF uses 1 filter for the default/perm_addr/LAA MAC, 1 for broadcast, and 16 additional unicast/multicast filters. Signed-off-by: Paul Greenwalt Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f109603a4be0578a8145c8ae7d6e10b0b5ab6df4 Author: Brett Creeley Date: Fri May 15 17:51:17 2020 -0700 ice: allow host to clear administratively set VF MAC Currently a user is not allowed to clear a VF's administratively set MAC on the PF. Fix this by allowing an all zero MAC address via "ip link set ${pf_eth} vf ${vf_id} mac 00:00:00:00:00:00". An example use case for this would be issuing a "virsh shutdown" command on a VM. The call to iproute mentioned above is part of this flow. Without this change the driver incorrectly rejects clearing the VF's administratively set MAC and prints unhelpful log messages. Also, improve the comments surrounding this change. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 7ae2f3db6167aa7184529fdacd1de72619baf93b Author: Marc Zyngier Date: Sat May 30 17:22:19 2020 +0100 KVM: arm64: Flush the instruction cache if not unmapping the VM on reboot On a system with FWB, we don't need to unmap Stage-2 on reboot, as even if userspace takes this opportunity to repaint the whole of memory, FWB ensures that the data side stays consistent even if the guest uses non-cacheable mappings. However, the I-side is not necessarily coherent with the D-side if CTR_EL0.DIC is 0. In this case, invalidate the i-cache to preserve coherency. Reported-by: Alexandru Elisei Reviewed-by: Alexandru Elisei Fixes: 892713e97ca1 ("KVM: arm64: Sidestep stage2_unmap_vm() on vcpu reset when S2FWB is supported") Signed-off-by: Marc Zyngier commit 093a48d2aa4b74db3134b61d7b7a061dbe79177b Author: Nathan Errera Date: Thu May 28 21:22:38 2020 +0200 cfg80211: support bigger kek/kck key length With some newer AKMs, the KCK and KEK are bigger, so allow that if the driver advertises support for it. In addition, add a new attribute for the AKM so we can use it for offloaded rekeying. Signed-off-by: Nathan Errera [reword commit message] Link: https://lore.kernel.org/r/20200528212237.5eb58b00a5d1.I61b09d77c4f382e8d58a05dcca78096e99a6bc15@changeid Signed-off-by: Johannes Berg commit 07c12d618f06c8876fe12a53217d92b32d7baf07 Author: Tova Mussai Date: Thu May 28 21:34:46 2020 +0200 mac80211: set short_slot for 6 GHz band Set short slot also for 6 GHz band, just like 5 GHz. Signed-off-by: Tova Mussai Link: https://lore.kernel.org/r/20200528213443.75f38e6f5efd.I272fbae402b03123f04e9ae69204eeab960c70cd@changeid Signed-off-by: Johannes Berg commit 6fcb56ce0f9036b08d1c3e35ff93b100d499771b Author: Ilan Peer Date: Thu May 28 21:34:45 2020 +0200 mac80211: Consider 6 GHz band when handling power constraint Treat it like the 5 GHz band. Signed-off-by: Ilan Peer Link: https://lore.kernel.org/r/20200528213443.889e5c9dd006.Id8ed3bb8000ba8738be5df05639415eb2e23c61a@changeid Signed-off-by: Johannes Berg commit 93382a0d119b3ab95e3ebca51ea15aa87187b493 Author: Johannes Berg Date: Thu May 28 21:34:44 2020 +0200 mac80211: accept aggregation sessions on 6 GHz On 6 GHz, stations don't have ht_supported set, but they can still do aggregation since they must have HE, allow that. Link: https://lore.kernel.org/r/20200528213443.776d3c891b64.Ifa099d450617b50c691832b3c4aa08959fab520a@changeid Signed-off-by: Johannes Berg commit f438136528482f98535889c9a6f99bbacdd92870 Author: Johannes Berg Date: Thu May 28 21:34:42 2020 +0200 cfg80211: require HE capabilities for 6 GHz band On 6 GHz band, HE capabilities must be available for all of the interface types, otherwise we shouldn't use 6 GHz. Check this. Link: https://lore.kernel.org/r/20200528213443.5881cb3c8c4a.I583b54172f91f98d44af64a16c5826fe458cbb27@changeid Signed-off-by: Johannes Berg commit 461ce35d5535c1479384f67fcf4bfc3f3610edca Author: Johannes Berg Date: Thu May 28 21:34:41 2020 +0200 cfg80211: reject HT/VHT capabilities on 6 GHz band On the 6 GHz band, HE should be used, but without any direct HT/VHT capabilities, instead the HE 6 GHz band capabilities will capture the relevant information. Reject HT/VHT capabilities here. Link: https://lore.kernel.org/r/20200528213443.bfe89c35459a.Ibba5e066fa0087fd49d13cfee89d196ea0c68ae2@changeid Signed-off-by: Johannes Berg commit ba8f6a037f790147438173029799f54c9d3065f2 Author: Johannes Berg Date: Thu May 28 21:34:40 2020 +0200 cfg80211: treat 6 GHz channels as valid regardless of capability If a 6 GHz channel exists, then we can probably safely assume that the device actually supports it, and then it should support most bandwidths. This will probably need to be extended to check the interface type and then dig into the HE capabilities for that though, to have the correct bandwidth check. Link: https://lore.kernel.org/r/20200528213443.d4864ef52e92.I82f09b2b14a56413ce20376d09967fe954a033eb@changeid Signed-off-by: Johannes Berg commit 2ad2274c58ee2dcaf9ccde5c63ff30f59b138f77 Author: Ilan Peer Date: Thu May 28 21:34:39 2020 +0200 mac80211: Add HE 6GHz capabilities element to probe request On 6 GHz, the 6 GHz capabilities element should be added, do that. Signed-off-by: Ilan Peer [add commit message] Link: https://lore.kernel.org/r/20200528213443.8ee764f0cde0.I2b0c66b60e11818c97c9803e04a6a197c6376243@changeid Signed-off-by: Johannes Berg commit 1bb9a8a4c81d0305c511a0919cd30ebfa91915ae Author: Johannes Berg Date: Thu May 28 21:34:38 2020 +0200 mac80211: use HE 6 GHz band capability and pass it to the driver In order to handle 6 GHz AP side, take the HE 6 GHz band capability data and pass it to the driver (which needs it for A-MPDU spacing and A-MPDU length). Link: https://lore.kernel.org/r/1589399105-25472-6-git-send-email-rmanohar@codeaurora.org Co-developed-by: Rajkumar Manoharan Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/20200528213443.784e4890d82f.I5f1230d5ab27e84e7bbe88e3645b24ea15a0c146@changeid Signed-off-by: Johannes Berg commit 3b3ec3d52e8f72ec8c40477b96f23440a89000be Author: Shaul Triebitz Date: Thu May 28 21:34:37 2020 +0200 mac80211: check the correct bit for EMA AP An AP supporting EMA (Enhanced Multi-BSSID advertisement) should set bit 83 in the extended capabilities IE (9.4.2.26 in the 802.11ax D5 spec). So the *3rd* bit of the 10th byte should be checked. Also, in one place, the wrong byte was checked. (cfg80211_find_ie returns a pointer to the beginning of the IE, so the data really starts at ie[2], so the 10th byte should be ie[12]. To avoid this confusion, use cfg80211_find_elem instead). Signed-off-by: Shaul Triebitz Link: https://lore.kernel.org/r/20200528213443.4316121fa2a3.I9745582f8d41ad8e689dac0fefcd70b276d7c1ea@changeid Signed-off-by: Johannes Berg commit 57fa5e85d53ce51e0cb06a7f320b79377d0fbe5f Author: Johannes Berg Date: Thu May 28 21:34:36 2020 +0200 mac80211: determine chandef from HE 6 GHz operation Support connecting to HE 6 GHz APs and mesh networks on 6 GHz, where the HT/VHT information is missing but instead the HE 6 GHz band capability is present, and the 6 GHz Operation information field is used to encode the channel configuration instead of the HT/VHT operation elements. Also add some other bits needed to connect to 6 GHz networks. Link: https://lore.kernel.org/r/1589399105-25472-10-git-send-email-rmanohar@codeaurora.org Co-developed-by: Rajkumar Manoharan Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/20200528213443.25687d2695bc.I3f9747c1147480f65445f13eda5c4a5ed4e86757@changeid Signed-off-by: Johannes Berg commit 2a333a0db24e37daa2e4eb9a542c07deda44ca5a Author: Johannes Berg Date: Thu May 28 21:34:35 2020 +0200 mac80211: avoid using ext NSS high BW if not supported If the AP advertises inconsistent data, namely it has CCFS1 or CCFS2, but doesn't advertise support for 160/80+80 bandwidth or "Extended NSS BW Support", then we cannot use any MCSes in the the higher bandwidth. Thus, avoid connecting with higher bandwidth since it's less efficient that way. Link: https://lore.kernel.org/r/20200528213443.0e55d40c3ccc.I6fd0b4708ebd087e5e46466c3e91f6efbcbef668@changeid Signed-off-by: Johannes Berg commit 607ca9ea3462719e256b60b24286f984e0d48c9b Author: Rajkumar Manoharan Date: Thu May 28 21:34:34 2020 +0200 mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode As HT/VHT elements are not allowed in 6 GHz band, do not include them in mesh beacon template formation. Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1589399105-25472-9-git-send-email-rmanohar@codeaurora.org Link: https://lore.kernel.org/r/20200528193455.76796-2-johannes@sipsolutions.net Signed-off-by: Johannes Berg commit d1b7524b3ea140e552658485d4e9dce5ee2953e1 Author: Rajkumar Manoharan Date: Thu May 28 21:34:33 2020 +0200 mac80211: build HE operation with 6 GHz oper information Add 6 GHz operation information (IEEE 802.11ax/D6.0, Figure 9-787k) while building HE operation element for non-HE AP. This field is used to determine channel information in the absence of HT/VHT IEs. Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1589399105-25472-8-git-send-email-rmanohar@codeaurora.org [fix skb allocation size] Link: https://lore.kernel.org/r/20200528193455.76796-1-johannes@sipsolutions.net Signed-off-by: Johannes Berg commit 24a2042cb22fdfc7feef0df9622f0d9d71b8ced1 Author: Rajkumar Manoharan Date: Thu May 28 21:34:32 2020 +0200 mac80211: add HE 6 GHz Band Capability element Construct HE 6 GHz band capability element (IEEE 802.11ax/D6.0, 9.4.2.261) for association request and mesh beacon. The 6 GHz capability information is passed by driver through iftypes caps. Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1589399105-25472-7-git-send-email-rmanohar@codeaurora.org [handle SMPS, adjust for previous patches, reserve SKB space properly, change to handle SKB directly] Link: https://lore.kernel.org/r/20200528213443.643aa8101111.I3f9747c1147480f65445f13eda5c4a5ed4e86757@changeid Signed-off-by: Johannes Berg commit 223952177296c34d9c8de9cde33204caffe55725 Author: Johannes Berg Date: Thu May 28 21:34:31 2020 +0200 cfg80211: add and expose HE 6 GHz band capabilities These capabilities cover what would otherwise be transported in HT/VHT capabilities, but only a subset thereof that is actually needed on 6 GHz with HE already present. Expose the capabilities to userspace, drivers are expected to set them as using the 6 GHz band (currently) requires HE capability. Link: https://lore.kernel.org/r/20200528213443.244cd5cb9db8.Icd8c773277a88c837e7e3af1d4d1013cc3b66543@changeid Signed-off-by: Johannes Berg commit a6cf28e05f0b3bda6ff0c58100324ac91aec6027 Author: Rajkumar Manoharan Date: Thu May 28 21:34:30 2020 +0200 mac80211: add HE 6 GHz Band Capabilities into parse extension Handle 6 GHz band capability element parsing for association. Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1589399105-25472-4-git-send-email-rmanohar@codeaurora.org [some renaming to be in line with previous patches] Link: https://lore.kernel.org/r/20200528213443.a13d7a0b85b0.Ia07584da4fc77aa77c4cc563248d2ce4234ffe5d@changeid Signed-off-by: Johannes Berg commit 43e64bf301fd8c54f0082d91c6ffd4de861baf96 Author: Rajkumar Manoharan Date: Thu May 28 21:34:29 2020 +0200 cfg80211: handle 6 GHz capability of new station Handle 6 GHz HE capability while adding new station. It will be used later in mac80211 station processing. Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1589399105-25472-2-git-send-email-rmanohar@codeaurora.org [handle nl80211_set_station, require WME, remove NL80211_HE_6GHZ_CAPABILITY_LEN] Link: https://lore.kernel.org/r/20200528213443.b6b711fd4312.Ic9b97d57b6c4f2b28d4b2d23d2849d8bc20bd8cc@changeid Signed-off-by: Johannes Berg commit 8b30808d9be4183fab17f0b0e68eea88c94ff15a Author: Johannes Berg Date: Thu May 28 21:34:28 2020 +0200 ieee80211: add HE ext EIDs and 6 GHz capability defines Add the HE extended element IDs and the definitions for the HE 6 GHz band capabilities element, from Draft 5.0. Link: https://lore.kernel.org/r/20200528213443.1a6689fe093f.Ifdc5400fb01779351354daf38663ebeea03c9ad9@changeid Signed-off-by: Johannes Berg commit 821273a5a502eebaae005557907d122d1e9b7b98 Author: Johannes Berg Date: Thu May 28 21:34:27 2020 +0200 ieee80211: add code to obtain and parse 6 GHz operation field Add some code to obtain and parse the 6 GHz operation field inside the HE operation element. While at it, fix the required length using sizeof() the new struct, which is 5 instead of 4 now. Link: https://lore.kernel.org/r/20200528213443.42ca72c45ca9.Id74bc1b03da9ea6574f9bc70deeb60dfc1634359@changeid Signed-off-by: Johannes Berg commit 372b38ea5911fc2500f0291b00140e80a26c0e36 Author: Tova Mussai Date: Thu May 28 21:34:26 2020 +0200 ieee80211: definitions for reduced neighbor reports Add the necessary definitions to parse reduced neighbor report elements. Signed-off-by: Tova Mussai [change struct name, remove IEEE80211_MIN_AP_NEIGHBOR_INFO_SIZE] Link: https://lore.kernel.org/r/20200528213443.4f9154461c06.I518d9898ad982f838112ea9ca14a20d6bbb16394@changeid Signed-off-by: Johannes Berg commit afbc9c9e8bfe71e8bd12a8c01bedd969fbab8f0e Author: Johannes Berg Date: Thu May 28 21:34:25 2020 +0200 cfg80211: add a helper to identify 6 GHz PSCs This allows identifying whether or not a channel is a PSC (preferred scanning channel). Link: https://lore.kernel.org/r/20200528213443.414363ecf62c.Ic15e681a0e249eab7350a06ceb582cca8bb9a080@changeid Signed-off-by: Johannes Berg commit 0e47901d78f0b91901f845c2fc575ae48d8ed395 Author: Johannes Berg Date: Thu May 28 21:34:24 2020 +0200 nl80211: really allow client-only BIGTK support My previous commit here was wrong, it didn't check the new flag in two necessary places, so things didn't work. Fix that. Fixes: 155d7c733807 ("nl80211: allow client-only BIGTK support") Link: https://lore.kernel.org/r/20200528213443.993f108e96ca.I0086ae42d672379380d04ac5effb2f3d5135731b@changeid Signed-off-by: Johannes Berg commit d1a1646c0de7b0083d42a1ada72a3ec243bfcc6d Author: Arend Van Spriel Date: Fri May 29 11:41:43 2020 +0200 cfg80211: adapt to new channelization of the 6GHz band The 6GHz band does not have regulatory approval yet, but things are moving forward. However, that has led to a change in the channelization of the 6GHz band which has been accepted in the 11ax specification. It also fixes a missing MHZ_TO_KHZ() macro for 6GHz channels while at it. This change is primarily thrown in to discuss how to deal with it. I noticed ath11k adding 6G support with old channelization and ditto for iw. It probably involves changes in hostapd as well. Cc: Pradeep Kumar Chitrapu Cc: Jouni Malinen Signed-off-by: Arend van Spriel Link: https://lore.kernel.org/r/edf07cdd-ad15-4012-3afd-d8b961a80b69@broadcom.com Signed-off-by: Johannes Berg commit 5e9cf0f0a3e98992184442de24253fe1b9c40f2e Author: Johannes Berg Date: Fri May 29 14:04:27 2020 +0200 cfg80211: fix 6 GHz frequencies to kHz The updates to change to kHz frequencies and the 6 GHz additions evidently overlapped (or rather, I didn't see it when applying the latter), so the 6 GHz is broken. Fix this. Fixes: 934f4c7dd3a5 ("cfg80211: express channels with a KHz component") Link: https://lore.kernel.org/r/20200529140425.1bf824f6911b.I4a1174916b8f5965af4366999eb9ffc7a0347470@changeid Signed-off-by: Johannes Berg commit dd25ed7361fb543d32f0da66e1e492563e64938e Author: WANG Xuerui Date: Sat May 30 15:32:43 2020 +0800 MIPS: Loongson64: Reorder CPUCFG model match arms Originally the match arms are ordered by model release date, however the LOONGSON_64R cores are even more reduced capability-wise. So put them at top of the switch block. Suggested-by: Huacai Chen Signed-off-by: WANG Xuerui Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit f06da27eb82e358ca389ccb9d13de61e94e77a47 Author: WANG Xuerui Date: Sat May 30 15:32:42 2020 +0800 MIPS: Expose Loongson CPUCFG availability via HWCAP The point is to allow userspace to probe for CPUCFG without possibly triggering invalid instructions. In addition to that, future Loongson feature bits could all be stuffed into CPUCFG bit fields (or "leaves" in x86-speak) if Loongson does not make mistakes, so ELF HWCAP bits are conserved. Userspace can determine native CPUCFG availability by checking the LCSRP (Loongson CSR Present) bit in CPUCFG output after seeing CPUCFG bit in HWCAP. Native CPUCFG always sets the LCSRP bit, as CPUCFG is part of the Loongson CSR ASE, while the emulation intentionally leaves this bit clear. The other existing Loongson-specific HWCAP bits are, to my best knowledge, unused, as (1) they are fairly recent additions, (2) Loongson never back-ported the patch into their kernel fork, and (3) Loongson's existing installed base rarely upgrade, if ever; However, they are still considered userspace ABI, hence unfortunately unremovable. But hopefully at least we could stop adding new Loongson HWCAP bits in the future. Cc: Paul Burton Cc: Jiaxun Yang Cc: Huacai Chen Signed-off-by: WANG Xuerui Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 86f2b225adf4ecd2edfdc8541a7342645556ac3b Author: Miquel Raynal Date: Tue May 26 21:56:18 2020 +0200 mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones NAND ECC modes (or providers) have their own enumeration but, unlike their algorithms counterpart, there is no invalid or uninitialized value to discriminate between an error and having chosen a no-ECC situation. Add an "invalid" entry for this purpose. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-7-miquel.raynal@bootlin.com commit dbc2f2e6d5f940970819f42dcbaf498a8f35a5b7 Author: Miquel Raynal Date: Tue May 26 21:56:17 2020 +0200 mtd: rawnand: Return an enum from of_get_nand_ecc_algo() There is an enumeration to list ECC algorithm, let's use it instead of returning an int. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-6-miquel.raynal@bootlin.com commit 74e24cd2376d9cc4cfc6edad8610780b79fd5def Author: Miquel Raynal Date: Tue May 26 21:56:15 2020 +0200 mtd: rawnand: Drop OOB_FIRST placement scheme This scheme has been introduced for the Davinci controller and means that the OOB area must be read *before* the rest of the data. This has nothing to do with the ECC in OOB placement as it could be understood and most importantly, there is no point in having this function out of the Davinci NAND controller driver. A DT property for this scheme has been added but never used, even by the Davinci driver which only uses this scheme to change the default nand_read_page(). Move the main read_page() helper into the Davinci driver and remove the remaining boilerplate. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-4-miquel.raynal@bootlin.com commit f66a6fd0dc7cc49c891a167937e161114f48a62e Author: Miquel Raynal Date: Tue May 26 21:56:14 2020 +0200 mtd: rawnand: Avoid a typedef In new code, the use of typedef is discouraged. Turn this one in the raw NAND core into a regular enumeration. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-3-miquel.raynal@bootlin.com commit 519494a9afabe68a0a86e4b3e264e3e607193a02 Author: Miquel Raynal Date: Tue May 26 21:56:13 2020 +0200 mtd: Fix typo in mtd_ooblayout_set_databytes() description Fix a probable copy/paste error: the function works like mtd_ooblayout_set_bytes(), not *_get_bytes(). Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-2-miquel.raynal@bootlin.com commit 9630a055256de420d528ecde9f35902a9dcd8750 Author: Miquel Raynal Date: Tue May 19 15:00:35 2020 +0200 mtd: rawnand: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Now that all drivers have been converted to do not use nand_release() anymore, let's remove this helper. Signed-off-by: Miquel Raynal Cc: Jonathan Corbet Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-63-miquel.raynal@bootlin.com commit 5724fa7f2e25a0f355063ba9271529fa00c32206 Author: Miquel Raynal Date: Mon May 25 10:58:51 2020 +0200 mtd: rawnand: nandsim: Reorganize ns_cleanup_module() Reorganize ns_cleanup_module() to fit the reworked exit path of ns_init_module(). There is no need for a ns_free_lists() function anymore, so drop it. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-18-miquel.raynal@bootlin.com commit f82d82e202fce7d461c2a6bdb55feaf28448a075 Author: Miquel Raynal Date: Mon May 25 10:58:50 2020 +0200 mtd: rawnand: nandsim: Rename a label in ns_init_module() Rename the "error" label to gave it a meaning. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-17-miquel.raynal@bootlin.com commit 73f2b68c51f4f6c3dbe621d263d6fd32526f2faf Author: Miquel Raynal Date: Mon May 25 10:58:49 2020 +0200 mtd: rawnand: nandsim: Manage lists on error in ns_init_module() Lists are filled with calls to ns_parse_weakblocks(), ns_parse_weakpages() and ns_parse_gravepages(). Handle them in the error path, all at the same time. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-16-miquel.raynal@bootlin.com commit dc2733dea2be78e03df1fbb5816b59d852b2291c Author: Miquel Raynal Date: Mon May 25 10:58:48 2020 +0200 mtd: rawnand: nandsim: Fix the label pointing on nand_cleanup() Drop the generic err_exit. The remaining operation to do from this goto statement is to cleanup the NAND allocations, so rename it. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-15-miquel.raynal@bootlin.com commit 5dcb5164b20eaa178dcea9572c8b0dccabef7a25 Author: Miquel Raynal Date: Mon May 25 10:58:47 2020 +0200 mtd: rawnand: nandsim: Free erase_block_wear on error Free erase_block_wear on error, which is allocated by ns_setup_wear_reporting(). Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-14-miquel.raynal@bootlin.com commit 82503f8412dfbcaf03e8a72663d2a416131f0113 Author: Miquel Raynal Date: Mon May 25 10:58:46 2020 +0200 mtd: rawnand: nandsim: Use an additional label when freeing the nandsim object Cosmetic change to give a meaning to all labels in this complicated error path. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-13-miquel.raynal@bootlin.com commit d6e4fd522461f490f49eda81b7e0fba86141ef20 Author: Miquel Raynal Date: Mon May 25 10:58:45 2020 +0200 mtd: rawnand: nandsim: Stop using nand_release() nand_release() basically calls mtd_device_unregister() and nand_cleanup(). Both helpers should be called after MTD device registration and NAND scan, respectively. Drop nand_release() and use the two helpers directly so that they fit the error path and the labels there. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-12-miquel.raynal@bootlin.com commit 72e840a15c66e89583f5bf35a8d890f6c77bb2db Author: Miquel Raynal Date: Mon May 25 10:58:44 2020 +0200 mtd: rawnand: nandsim: Free the partition names in ns_free() ns_free() is the helper that is called symmetrically to ns_init() and so should free the same objects, including the partition names. Now, callers of ns_free() do not need to free this partition names themselves. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-11-miquel.raynal@bootlin.com commit 161246ec066f3eee40feeb02a07992db4c4e86f7 Author: Miquel Raynal Date: Mon May 25 10:58:43 2020 +0200 mtd: rawnand: nandsim: Free the allocated device on error in ns_init() The nandsim device is allocated and initialized inside ns_init() by a call to ns_alloc_device(), free it on error. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-10-miquel.raynal@bootlin.com commit 52bc51c54ef8d8e9358f12666e9f107d9a44f394 Author: Miquel Raynal Date: Mon May 25 10:58:42 2020 +0200 mtd: rawnand: nandsim: Free partition names on error in ns_init() The ns_init() function shall free the partition names allocated by ns_get_partition_name() on error. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-9-miquel.raynal@bootlin.com commit 058018eb0202d144ae266e0497082366bfd6afff Author: Miquel Raynal Date: Mon May 25 10:58:41 2020 +0200 mtd: rawnand: nandsim: Fix the two ns_alloc_device() error paths The ns_alloc_device() helper has actually two distinct path. Handle errors in both of them. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-8-miquel.raynal@bootlin.com commit cde495f83959119d0d2c78e74118a61301b8af32 Author: Miquel Raynal Date: Mon May 25 10:58:40 2020 +0200 mtd: rawnand: nandsim: Remove debugfs entries at unload time Create a ns_debugfs_remove() helper for that and call it in ns_cleanup_module(). Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-7-miquel.raynal@bootlin.com commit 7f2a17369f046399a71da196726f1234b53ff7dc Author: Miquel Raynal Date: Mon May 25 10:58:39 2020 +0200 mtd: rawnand: nandsim: Keep track of the created debugfs entries Debugfs entries should be removed in the error path, so first, keep track of them. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-6-miquel.raynal@bootlin.com commit 052a7a5374bc1e41dd1588fcb861ec3d810fd160 Author: Miquel Raynal Date: Mon May 25 10:58:38 2020 +0200 mtd: rawnand: nandsim: Clean error handling Many function calls are done this way: if ((retval = func()) != 0) return retval; while we expect in the kernel function calls like: retval = func(); if (retval) return retval; Apply this change where possible and also use "ret" instead of "retval" in ns_init_module for consistency, as it is only used in this function. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-5-miquel.raynal@bootlin.com commit 88f9f3e89a8ad1594c4d9c599bdf9c904e3976fe Author: Miquel Raynal Date: Mon May 25 10:58:37 2020 +0200 mtd: rawnand: nandsim: Use a consistent ns_ prefix for all functions Some functions are prefixed "nandsim_", others "ns_" and many are simply not prefixed at all. Make this file consistent by prefixing all functions by "ns_". This is a mechanical change. Sometimes the line is a bit reworked as well to fit the kernel coding style. For instance, there are several places where displayed strings are cut. When one of this line is changed because of the naming update, the two parts of the strings gets concatenated. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-4-miquel.raynal@bootlin.com commit b81fa3c45e5c50af34777e0d383c6c16798d918c Author: Miquel Raynal Date: Mon May 25 10:58:36 2020 +0200 mtd: rawnand: nandsim: Use octal permissions Symbolic permissions 'S_IRUSR' are not preferred. Checkpatch.pl advises to use octal permissions '0400'. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-3-miquel.raynal@bootlin.com commit 6be834c667d3075a40dbbbd54ee211b8177e1530 Author: Miquel Raynal Date: Mon May 25 10:58:35 2020 +0200 mtd: rawnand: nandsim: Consistent use of 'ns' instead of 'dev' The nandsim object is called 'ns' almost everywhere, keep it that way everywhere for consistency. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-2-miquel.raynal@bootlin.com commit 7e7c7df5d50fe06469be106967fc5b5d62be8868 Author: Álvaro Fernández Rojas Date: Fri May 22 14:15:24 2020 +0200 mtd: rawnand: brcmnand: support v2.1-v2.2 controllers v2.1: tested on Netgear DGND3700v1 (BCM6368) v2.2: tested on Netgear DGND3700v2 (BCM6362) Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-6-noltari@gmail.com commit b1713b5b2c026dfac1ea433477ea4e383809333f Author: Álvaro Fernández Rojas Date: Fri May 22 14:15:23 2020 +0200 dt-bindings: mtd: brcmnand: add v2.1 and v2.2 support Add brcm,brcmnand-v2.1 and brcm,brcmnand-v2.2 as possible compatible strings to support brcmnand controllers v2.1 and v2.2. Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-5-noltari@gmail.com commit eeeac9cbc4ca5b8c245972f3a765d1cb5b7ef038 Author: Álvaro Fernández Rojas Date: Fri May 22 14:15:22 2020 +0200 mtd: rawnand: brcmnand: rename page sizes Current pages sizes apply to controllers after v3.4 Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-4-noltari@gmail.com commit 3d3fb3c5be9ce07fa85d8f67fb3922e4613b955b Author: Álvaro Fernández Rojas Date: Fri May 22 14:15:21 2020 +0200 mtd: rawnand: brcmnand: fix CS0 layout Only v3.3-v5.0 have a different CS0 layout. Controllers before v3.3 use the same layout for every CS. Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-3-noltari@gmail.com commit 4fd639092b17d4252368b6009573339aeab5c7bd Author: Álvaro Fernández Rojas Date: Fri May 22 14:15:20 2020 +0200 mtd: rawnand: brcmnand: rename v4 registers These registers are also used on v3.3. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Miquel Raynal Acked-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-2-noltari@gmail.com commit e5e5631cc88987a6f3cd8304660bd9190da95916 Author: Miquel Raynal Date: Fri May 8 19:18:05 2020 +0200 mtd: rawnand: gpmi: Use nand_extract_bits() Drop the use of gpmi_copy_bits() in favor of the NAND helper nand_extract_bits(). Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200508171805.8627-1-miquel.raynal@bootlin.com commit 37f7212148cf1d796135cdf8d0c7fee13067674b Author: Dinghao Liu Date: Fri May 22 18:40:06 2020 +0800 mtd: rawnand: omap_elm: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522104008.28340-1-dinghao.liu@zju.edu.cn commit 8e935b92d269826f1e4bcf31d3f688dbcdf71219 Author: Dinghao Liu Date: Fri May 22 18:17:13 2020 +0800 mtd: rawnand: gpmi: Fix runtime PM imbalance in gpmi_nand_probe There is no reason that the failure of __gpmi_enable_clk() could lead to PM usage counter decrement. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522101713.24350-1-dinghao.liu@zju.edu.cn commit 550e68ea36a6671a96576c0531685ce6e6c0d19d Author: Dinghao Liu Date: Fri May 22 17:51:39 2020 +0800 mtd: rawnand: gpmi: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522095139.19653-1-dinghao.liu@zju.edu.cn commit 5d55714fa5ac1ac93a9224821f289fbf46532d30 Author: Boris Brezillon Date: Wed May 20 01:24:54 2020 +0200 mtd: rawnand: ingenic: Convert the driver to exec_op() Let's convert the driver to exec_op() to have one less driver relying on the legacy interface. Signed-off-by: Boris Brezillon Tested-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519232454.374081-4-boris.brezillon@collabora.com commit 2e263011017cb22c0e7b65af791aae8cb5e1098a Author: Boris Brezillon Date: Wed May 20 01:24:53 2020 +0200 mtd: rawnand: ingenic: Fix the RB gpio active-high property on qi, lb60 The rb-gpios semantics was undocumented and qi,lb60 (along with the ingenic driver) got it wrong. The active state encodes the NAND ready state, which is high level. Since there's no signal inverter on this board, it should be active-high. Let's fix that here for older DTs so we can re-use the generic nand_gpio_waitrdy() helper, and be consistent with what other drivers do. Suggested-by: Paul Cercueil Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519232454.374081-3-boris.brezillon@collabora.com commit 9fdd78f7bcda3e6a9f53c355529b3bf037c0e24f Author: Miquel Raynal Date: Tue May 19 15:00:34 2020 +0200 mtd: rawnand: xway: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-62-miquel.raynal@bootlin.com commit 34531be5e804a8e1abf314a6c3a19fe342e4a154 Author: Miquel Raynal Date: Tue May 19 15:00:33 2020 +0200 mtd: rawnand: xway: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-61-miquel.raynal@bootlin.com commit d9f2a1af817d5c9ee5a6adf70c5a217a583d3af0 Author: Miquel Raynal Date: Tue May 19 15:00:32 2020 +0200 mtd: rawnand: vf610: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Cc: Stefan Agner Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-60-miquel.raynal@bootlin.com commit f6fc75978d882e9c8970f11082f9be7e5ba95e45 Author: Miquel Raynal Date: Tue May 19 15:00:31 2020 +0200 mtd: rawnand: txx9ndfmc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-59-miquel.raynal@bootlin.com commit f3e169f44bdb0c61aba0b9156e5b381a869e579b Author: Miquel Raynal Date: Tue May 19 15:00:30 2020 +0200 mtd: rawnand: tmio: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-58-miquel.raynal@bootlin.com commit 75e9a330a9bd48f97a55a08000236084fe3dae56 Author: Miquel Raynal Date: Tue May 19 15:00:29 2020 +0200 mtd: rawnand: tmio: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-57-miquel.raynal@bootlin.com commit ab135c51bb815c57e7f297b9f78f487c70d34899 Author: Miquel Raynal Date: Tue May 19 15:00:28 2020 +0200 mtd: rawnand: tango: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-56-miquel.raynal@bootlin.com commit 068d86ecd9d980b10532d8b141badaf5d8d6b7dc Author: Miquel Raynal Date: Tue May 19 15:00:27 2020 +0200 mtd: rawnand: sunxi: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-55-miquel.raynal@bootlin.com commit 3d84515ffd8fb657e10fa5b1215e9f095fa7efca Author: Miquel Raynal Date: Tue May 19 15:00:26 2020 +0200 mtd: rawnand: sunxi: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-54-miquel.raynal@bootlin.com commit 24acc3fa8b36f998b355bb7e337361f4e76160fb Author: Miquel Raynal Date: Tue May 19 15:00:25 2020 +0200 mtd: rawnand: stm32_fmc2: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Cc: Christophe Kerello Reviewed-by: Christophe Kerello Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-53-miquel.raynal@bootlin.com commit c121cb980c096229d400f08cb3908911900e281d Author: Miquel Raynal Date: Tue May 19 15:00:24 2020 +0200 mtd: rawnand: socrates: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-52-miquel.raynal@bootlin.com commit 9c6c2e5cc77119ce0dacb4f9feedb73ce0354421 Author: Miquel Raynal Date: Tue May 19 15:00:23 2020 +0200 mtd: rawnand: socrates: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-51-miquel.raynal@bootlin.com commit 35a37f9198e5ee594750f4331b29de34acf8c84c Author: Miquel Raynal Date: Tue May 19 15:00:22 2020 +0200 mtd: rawnand: sharpsl: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-50-miquel.raynal@bootlin.com commit 0f44b3275b3798ccb97a2f51ac85871c30d6fbbc Author: Miquel Raynal Date: Tue May 19 15:00:21 2020 +0200 mtd: rawnand: sharpsl: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-49-miquel.raynal@bootlin.com commit 50abacbb621f130c390c57d3a68f6f913d48ad07 Author: Miquel Raynal Date: Tue May 19 15:00:20 2020 +0200 mtd: rawnand: sh_flctl: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-48-miquel.raynal@bootlin.com commit 9748110bd22c59f6bcd9447cf752fa2d4c59d1e6 Author: Miquel Raynal Date: Tue May 19 15:00:19 2020 +0200 mtd: rawnand: s3c2410: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-47-miquel.raynal@bootlin.com commit 10b87750ae17920977d57333d39483ff2bed0bf9 Author: Miquel Raynal Date: Tue May 19 15:00:18 2020 +0200 mtd: rawnand: r852: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Cc: Maxim Levitsky Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-46-miquel.raynal@bootlin.com commit 0a2bc9919cf74e3436644cee88490bfd379127a1 Author: Miquel Raynal Date: Tue May 19 15:00:17 2020 +0200 mtd: rawnand: qcom: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-45-miquel.raynal@bootlin.com commit d1aae005a00e94e9f34f5c44d8c2c0afa72cba59 Author: Miquel Raynal Date: Tue May 19 15:00:16 2020 +0200 mtd: rawnand: plat_nand: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-44-miquel.raynal@bootlin.com commit 5284024b4dac5e94f7f374ca905c7580dbc455e9 Author: Miquel Raynal Date: Tue May 19 15:00:15 2020 +0200 mtd: rawnand: plat_nand: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible, hence pointing it as the commit to fix for backporting purposes, even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-43-miquel.raynal@bootlin.com commit 23cf3461501011759614b5494da390feeae3a1b3 Author: Miquel Raynal Date: Tue May 19 15:00:14 2020 +0200 mtd: rawnand: pasemi: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-42-miquel.raynal@bootlin.com commit f51466901c07e6930435d30b02a21f0841174f61 Author: Miquel Raynal Date: Tue May 19 15:00:13 2020 +0200 mtd: rawnand: pasemi: Fix the probe error path nand_cleanup() is supposed to be called on error after a successful call to nand_scan() to free all NAND resources. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible, hence pointing it as the commit to fix for backporting purposes, even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-41-miquel.raynal@bootlin.com commit 2d9cf6f129f8e6730d568628c920fe3b591a34be Author: Miquel Raynal Date: Tue May 19 15:00:12 2020 +0200 mtd: rawnand: oxnas: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-40-miquel.raynal@bootlin.com commit 0a5f45e57e35d0840bedb816974ce2e63406cd8b Author: Miquel Raynal Date: Tue May 19 15:00:11 2020 +0200 mtd: rawnand: oxnas: Release all devices in the _remove() path oxnans_nand_remove() should release all MTD devices and clean all NAND devices, not only the first one registered. Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-39-miquel.raynal@bootlin.com commit b60391eb17b2956ff2fc4c348e5a464da21ff9cb Author: Miquel Raynal Date: Tue May 19 15:00:10 2020 +0200 mtd: rawnand: oxnas: Unregister all devices on error On error, the oxnas probe path just frees the device which failed and aborts the probe, leaving unreleased resources. Fix this situation by calling mtd_device_unregister()/nand_cleanup() on these. Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-38-miquel.raynal@bootlin.com commit 154298e2a3f6c9ce1d76cdb48d89fd5b107ea1a3 Author: Miquel Raynal Date: Tue May 19 15:00:09 2020 +0200 mtd: rawnand: oxnas: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. While at it, be consistent and move the function call in the error path thanks to a goto statement. Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-37-miquel.raynal@bootlin.com commit 383fc3f613e7eac9f2e3c13b6f9fb8c1f39cb9d5 Author: Miquel Raynal Date: Tue May 19 15:00:08 2020 +0200 mtd: rawnand: oxnas: Keep track of registered devices All initialized and registered devices should be listed somewhere so that we can unregister/free them in the _remove() path. This patch is not a fix per-se but is needed to apply three other fixes coming right after, explaining the Fixes/Cc: stable tags. Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-36-miquel.raynal@bootlin.com commit f342df67b19a4545ee742301594ad1e9b6e5aa91 Author: Miquel Raynal Date: Tue May 19 15:00:07 2020 +0200 mtd: rawnand: orion: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-35-miquel.raynal@bootlin.com commit be238fbf78e4c7c586dac235ab967d3e565a4d1a Author: Miquel Raynal Date: Tue May 19 15:00:06 2020 +0200 mtd: rawnand: orion: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-34-miquel.raynal@bootlin.com commit b4533679c9587a522a871075a68fba14febd590e Author: Miquel Raynal Date: Tue May 19 15:00:05 2020 +0200 mtd: rawnand: omap2: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-33-miquel.raynal@bootlin.com commit a9384f95fe7767320842f8070b08ec865300c622 Author: Miquel Raynal Date: Tue May 19 15:00:04 2020 +0200 mtd: rawnand: ndfc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-32-miquel.raynal@bootlin.com commit 8fd507bb42104c1aabd557a9a993e8d0376c6fee Author: Miquel Raynal Date: Tue May 19 15:00:03 2020 +0200 mtd: rawnand: mxic: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-31-miquel.raynal@bootlin.com commit c6dc082793d2fc9609e36a7b165624c4ee57d36f Author: Miquel Raynal Date: Tue May 19 15:00:02 2020 +0200 mtd: rawnand: mxc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-30-miquel.raynal@bootlin.com commit 1fec333aadc2aec9293b7ec10d24e94f75a89b2e Author: Miquel Raynal Date: Tue May 19 15:00:01 2020 +0200 mtd: rawnand: mtk: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-29-miquel.raynal@bootlin.com commit 8a82bbcadec877f5f938c54026278dfc1f05a332 Author: Miquel Raynal Date: Tue May 19 15:00:00 2020 +0200 mtd: rawnand: mtk: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-28-miquel.raynal@bootlin.com commit 1a36a7f78898c45a34ce9e9d557f9559dd6618cc Author: Miquel Raynal Date: Tue May 19 14:59:59 2020 +0200 mtd: rawnand: mpc5121: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-27-miquel.raynal@bootlin.com commit 5ecbba617446dbe1ec3241fa6362cce68838671d Author: Miquel Raynal Date: Tue May 19 14:59:58 2020 +0200 mtd: rawnand: marvell: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-26-miquel.raynal@bootlin.com commit 21b7582777248ed3668c111811296ada4df295a9 Author: Miquel Raynal Date: Tue May 19 14:59:57 2020 +0200 mtd: rawnand: lpc32xx_slc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-25-miquel.raynal@bootlin.com commit 5f3bce3a52758227e2a0b51531b9c0b7069d1724 Author: Miquel Raynal Date: Tue May 19 14:59:56 2020 +0200 mtd: rawnand: lpc32xx_mlc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-24-miquel.raynal@bootlin.com commit 28dcc4e8a8318beb77a7b42bccb9ed57707c546d Author: Miquel Raynal Date: Tue May 19 14:59:55 2020 +0200 mtd: rawnand: ingenic: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Cc: Paul Cercueil Cc: Harvey Hunt Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-23-miquel.raynal@bootlin.com commit de17cade0e034e9b721a6db9b488014effac1e5a Author: Miquel Raynal Date: Tue May 19 14:59:54 2020 +0200 mtd: rawnand: ingenic: Fix the probe error path nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. Hence, pointing it as the commit to fix for backporting purposes, even if this commit is not introducing any bug makes sense. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Cc: Paul Cercueil Cc: Harvey Hunt Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-22-miquel.raynal@bootlin.com commit 71a4917b4d4bf7cf5f6033522b3136ac7c1b4155 Author: Miquel Raynal Date: Tue May 19 14:59:53 2020 +0200 mtd: rawnand: hisi504: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-21-miquel.raynal@bootlin.com commit 194f6c48cdd88d1da581d53527d000626a0d8203 Author: Miquel Raynal Date: Tue May 19 14:59:52 2020 +0200 mtd: rawnand: gpmi: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Cc: Han Xu Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-20-miquel.raynal@bootlin.com commit dbe0241570edc37fbc24ff2d4d5c11fa6a0712eb Author: Miquel Raynal Date: Tue May 19 14:59:51 2020 +0200 mtd: rawnand: gpio: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-19-miquel.raynal@bootlin.com commit 9cc02f4c0a87a9eba17e5c2cbbda375c9a4a2b06 Author: Miquel Raynal Date: Tue May 19 14:59:50 2020 +0200 mtd: rawnand: fsmc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-18-miquel.raynal@bootlin.com commit f6c4e661491ab3de80b4568e2bcdbf52fcbbaf33 Author: Miquel Raynal Date: Tue May 19 14:59:49 2020 +0200 mtd: rawnand: fsl_upm: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-17-miquel.raynal@bootlin.com commit e9f2f5a807541b6ad1f8ab73586650b0e1275cf1 Author: Miquel Raynal Date: Tue May 19 14:59:48 2020 +0200 mtd: rawnand: fsl_ifc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-16-miquel.raynal@bootlin.com commit 128bbbf0ac4d812c4bc4be89126e319bf6c6a480 Author: Miquel Raynal Date: Tue May 19 14:59:47 2020 +0200 mtd: rawnand: fsl_elbc: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-15-miquel.raynal@bootlin.com commit 63a1460768a1ae34746b3013940233afe5d88105 Author: Miquel Raynal Date: Tue May 19 14:59:46 2020 +0200 mtd: rawnand: diskonchip: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-14-miquel.raynal@bootlin.com commit c5be12e45940f1aa1b5dfa04db5d15ad24f7c896 Author: Miquel Raynal Date: Tue May 19 14:59:45 2020 +0200 mtd: rawnand: diskonchip: Fix the probe error path Not sure nand_cleanup() is the right function to call here but in any case it is not nand_release(). Indeed, even a comment says that calling nand_release() is a bit of a hack as there is no MTD device to unregister. So switch to nand_cleanup() for now and drop this comment. There is no Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if it did not intruce any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-13-miquel.raynal@bootlin.com commit 009e2e1d831897794e6ff7ea4767af8a420360d3 Author: Miquel Raynal Date: Tue May 19 14:59:44 2020 +0200 mtd: rawnand: denali: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Acked-by: Masahiro Yamada Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-12-miquel.raynal@bootlin.com commit 6ac64a17554ff98b5419af29ed139860a910ad0b Author: Miquel Raynal Date: Tue May 19 14:59:43 2020 +0200 mtd: rawnand: denali: Delete items from the list in the _remove() path Denali driver keeps track of devices with a list. Delete items of this list as long as they are not in use anymore. Signed-off-by: Miquel Raynal Acked-by: Masahiro Yamada Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-11-miquel.raynal@bootlin.com commit a9575c48e52042ccc06105e6b7fe4a26f49f0a67 Author: Miquel Raynal Date: Tue May 19 14:59:42 2020 +0200 mtd: rawnand: davinci: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-10-miquel.raynal@bootlin.com commit 970024f031aec4c761fde80572b8186c591af59c Author: Miquel Raynal Date: Tue May 19 14:59:41 2020 +0200 mtd: rawnand: cs553x: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-9-miquel.raynal@bootlin.com commit 544bac8999a691a7a4cf033f547160c7a00eee60 Author: Miquel Raynal Date: Tue May 19 14:59:39 2020 +0200 mtd: rawnand: cafe: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-7-miquel.raynal@bootlin.com commit 8b88f4e0a88b27caf1ca210533d167913745ccdd Author: Miquel Raynal Date: Tue May 19 14:59:38 2020 +0200 mtd: rawnand: cadence: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-6-miquel.raynal@bootlin.com commit 937d039dfdcf3140fe081ce0f28a634555859744 Author: Miquel Raynal Date: Tue May 19 14:59:37 2020 +0200 mtd: rawnand: brcmnand: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Cc: Brian Norris Cc: Kamal Dasu Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-5-miquel.raynal@bootlin.com commit 9369043059282dbe69853c414b0f4be522d1010e Author: Miquel Raynal Date: Tue May 19 14:59:36 2020 +0200 mtd: rawnand: bcm47xx: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-4-miquel.raynal@bootlin.com commit 4a3d21bc25c180a4f6a00e3244b54d9bf8c506be Author: Miquel Raynal Date: Tue May 19 14:59:35 2020 +0200 mtd: rawnand: au1550nd: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-3-miquel.raynal@bootlin.com commit 70768ebaa5872e11f68d71761bb9fa1546cb451e Author: WANG Xuerui Date: Sat May 30 15:32:41 2020 +0800 MIPS: Loongson64: Guard against future cores without CPUCFG Previously it was thought that all future Loongson cores would come with native CPUCFG. From new information shared by Huacai this is definitely not true (maybe some future 2K cores, for example), so collisions at PRID_REV level are inevitable. The CPU model matching needs to take PRID_IMP into consideration. The emulation logic needs to be disabled for those future cores as well, as we cannot possibly encode their non-discoverable features right now. Reported-by: Huacai Chen Cc: Jiaxun Yang Signed-off-by: WANG Xuerui Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit e8aec15dd5842b5b11b0e621a2293348d3574a61 Author: Mantas Pucka Date: Wed Apr 15 16:48:30 2020 +0300 mtd: spi-nor: winbond: Fix 4-byte opcode support for w25q256 There are 2 different chips (w25q256fv and w25q256jv) that share the same JEDEC ID. Only w25q256jv fully supports 4-byte opcodes. Use SFDP header version to differentiate between them. Fixes: 10050a02f7d5 ("mtd: spi-nor: Add 4B_OPCODES flag to w25q256") Signed-off-by: Mantas Pucka Signed-off-by: Tudor Ambarus commit 39884604b11692158ce0c559fc603510b96f8c2e Author: Paolo Abeni Date: Fri May 29 17:49:18 2020 +0200 mptcp: fix NULL ptr dereference in MP_JOIN error path When token lookup on MP_JOIN 3rd ack fails, the server socket closes with a reset the incoming child. Such socket has the 'is_mptcp' flag set, but no msk socket associated - due to the failed lookup. While crafting the reset packet mptcp_established_options_mp() will try to dereference the child's master socket, causing a NULL ptr dereference. This change addresses the issue with explicit fallback to TCP in such error path. Fixes: 729cd6436f35 ("mptcp: cope better with MP_JOIN failure") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit b0c19ed6088ab41dd2a727b60594b7297c15d6ce Author: Toke Høiland-Jørgensen Date: Fri May 29 14:43:44 2020 +0200 sch_cake: Take advantage of skb->hash where appropriate While the other fq-based qdiscs take advantage of skb->hash and doesn't recompute it if it is already set, sch_cake does not. This was a deliberate choice because sch_cake hashes various parts of the packet header to support its advanced flow isolation modes. However, foregoing the use of skb->hash entirely loses a few important benefits: - When skb->hash is set by hardware, a few CPU cycles can be saved by not hashing again in software. - Tunnel encapsulations will generally preserve the value of skb->hash from before the encapsulation, which allows flow-based qdiscs to distinguish between flows even though the outer packet header no longer has flow information. It turns out that we can preserve these desirable properties in many cases, while still supporting the advanced flow isolation properties of sch_cake. This patch does so by reusing the skb->hash value as the flow_hash part of the hashing procedure in cake_hash() only in the following conditions: - If the skb->hash is marked as covering the flow headers (skb->l4_hash is set) AND - NAT header rewriting is either disabled, or did not change any values used for hashing. The latter is important to match local-origin packets such as those of a tunnel endpoint. The immediate motivation for fixing this was the recent patch to WireGuard to preserve the skb->hash on encapsulation. As such, this is also what I tested against; with this patch, added latency under load for competing flows drops from ~8 ms to sub-1ms on an RRUL test over a WireGuard tunnel going through a virtual link shaped to 1Gbps using sch_cake. This matches the results we saw with a similar setup using sch_fq_codel when testing the WireGuard patch. Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc") Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 9b23203c32ee02cd316e39ba3ec243e0f7bf56de Author: Geert Uytterhoeven Date: Fri May 29 14:25:40 2020 +0200 ravb: Mask PHY mode to avoid inserting delays twice Until recently, the Micrel KSZ9031 PHY driver ignored any PHY mode ("RGMII-*ID") settings, but used the hardware defaults, augmented by explicit configuration of individual skew values using the "*-skew-ps" DT properties. The lack of PHY mode support was compensated by the EtherAVB MAC driver, which configures TX and/or RX internal delay itself, based on the PHY mode. However, now the KSZ9031 driver has gained PHY mode support, delays may be configured twice, causing regressions. E.g. on the Renesas Salvator-X board with R-Car M3-W ES1.0, TX performance dropped from ca. 400 Mbps to 0.1-0.3 Mbps, as measured by nuttcp. As internal delay configuration supported by the KSZ9031 PHY is too limited for some use cases, the ability to configure MAC internal delay is deemed useful and necessary. Hence a proper fix would involve splitting internal delay configuration in two parts, one for the PHY, and one for the MAC. However, this would require adding new DT properties, thus breaking DTB backwards-compatibility. Hence fix the regression in a backwards-compatibility way, by letting the EtherAVB driver mask the PHY mode when it has inserted a delay, to avoid the PHY driver adding a second delay. This also fixes messages like: Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: *-skew-ps values should be used only with phy-mode = "rgmii" as the PHY no longer sees the original RGMII-*ID mode. Solving the issue by splitting configuration in two parts can be handled in future patches, and would require retaining a backwards-compatibility mode anyway. Fixes: bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY") Signed-off-by: Geert Uytterhoeven Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e8c867c1d81909a82951c6e13d0c5ac2f98d96a4 Merge: 193025e861fd 3ed97037f063 Author: David S. Miller Date: Sat May 30 21:48:24 2020 -0700 Merge branch 'selftests-forwarding-Two-small-changes' Petr Machata says: ==================== selftests: forwarding: Two small changes Two unrelated changes in this patchset: - In patch #1, convert mirror tests from using ping directly to generating ICMP packets by mausezahn. Using ping in tests is error-prone, because ping is too smart. On a flaky system (notably in a simulator), when packets don't come quickly enough, more pings are sent, and that throws off counters. This was worked around in the past by just pinging more slowly, but using mausezahn avoids the issue as well without making the tests unnecessary slow. - A missing stats_update callback was recently added to act_pedit. Now that iproute2 supports JSON dumping for pedit, extend in patch #2 the pedit_dsfield selftest with a check that would have caught the fact that the callback was missing. ==================== Signed-off-by: David S. Miller commit 3ed97037f063b9130b56991f55f346597d27440d Author: Petr Machata Date: Fri May 29 14:16:54 2020 +0300 selftests: forwarding: pedit_dsfield: Check counter value A missing stats_update callback was recently added to act_pedit. Now that iproute2 supports JSON dumping for pedit, extend the pedit_dsfield selftest with a check that would have caught the fact that the callback was missing. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 1c0522b4a2e143fa6e55e4bd2308415c81184ec7 Author: Petr Machata Date: Fri May 29 14:16:53 2020 +0300 selftests: forwarding: mirror_lib: Use mausezahn Using ping in tests is error-prone, because ping is too smart. On a flaky system (notably in a simulator), when packets don't come quickly enough, more pings are sent, and that throws off counters. Instead use mausezahn to generate ICMP echo request packets. That allows us to send them in quicker succession as well, because the reason the ping was made slow in the first place was to make the tests work on simulated systems. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 193025e861fd24e0141760571beb7efd322d9fd8 Merge: d9f0d6605f30 79472fe873dd Author: David S. Miller Date: Sat May 30 21:47:08 2020 -0700 Merge branch 'vxlan-fdb-nexthop-misc-fixes' Roopa Prabhu says: ==================== vxlan fdb nexthop misc fixes Roopa Prabhu (2): vxlan: add check to prevent use of remote ip attributes with NDA_NH_ID vxlan: few locking fixes in nexthop event handler ==================== Signed-off-by: David S. Miller commit 79472fe873dd307101f9b1dbfe0fedebae42219a Author: Roopa Prabhu Date: Thu May 28 22:12:36 2020 -0700 vxlan: few locking fixes in nexthop event handler - remove fdb from nh_list before the rcu grace period - protect fdb->vdev with rcu - hold spin lock before destroying fdb Fixes: c7cdbe2efc40 ("vxlan: support for nexthop notifiers") Signed-off-by: Roopa Prabhu Reviewed-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 72b4868211a85d040c42444620f2197bb0094ac8 Author: Roopa Prabhu Date: Thu May 28 22:12:35 2020 -0700 vxlan: add check to prevent use of remote ip attributes with NDA_NH_ID NDA_NH_ID represents a remote ip or a group of remote ips. It allows use of nexthop groups in lieu of a remote ip or a list of remote ips supported by the fdb api. Current code ignores the other remote ip attrs when NDA_NH_ID is specified. In the spirit of strict checking, This commit adds a check to explicitly return an error on incorrect usage. Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit d9f0d6605f30feb2f137d6bc83fcb6c2853e7fd6 Merge: 370c63fc11a6 3726cce25890 Author: David S. Miller Date: Sat May 30 21:44:50 2020 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-28 This series contains updates to the ice driver only. Anirudh (Ani) adds a poll for reset completion before proceeding with driver initialization when the DDP package fails to load and the firmware issues a core reset. Jake cleans up unnecessary code, since ice_set_dflt_vsi_ctx() performs a memset to clear the info from the context structures. Fixed a potential double free during probe unrolling after a failure. Also fixed a potential NULL pointer dereference upon register_netdev() failure. Tony makes two functions static which are not called outside of their file. Brett refactors the ice_ena_vf_mappings(), which was doing the VF's MSIx and queue mapping in one function which was hard to digest. So create a new function to handle the enabling MSIx mappings and another function to handle the enabling of queue mappings. Simplify the code flow in ice_sriov_configure(). Created a helper function for clearing VPGEN_VFRTRIG register, as this needs to be done on reset to notify the VF that we are done resetting it. Fixed the initialization/creation and reset flows, which was unnecessarily complicated, so separate the two flows into their own functions. Renamed VF initialization functions to make it more clear what they do and why. Added functionality to set the VF trust mode bit on reset. Added helper functions to rebuild the VLAN and MAC configurations when resetting a VF. Refactored how the VF reset is handled to prevent VF reset timeouts. Paul cleaned up code not needed during a CORER/GLOBR reset. ==================== Signed-off-by: David S. Miller commit 370c63fc11a6e8bb9e21e5d05e6cb33116c26fe3 Merge: d7ad1415bda5 67ee63ef2b15 Author: David S. Miller Date: Sat May 30 21:36:55 2020 -0700 Merge branch 'r8169-again-few-improvements' Heiner Kallweit says: ==================== r8169: again few improvements Again a series with few r8169 improvements. ==================== Signed-off-by: David S. Miller commit 67ee63ef2b15fcb0cb692010083592672d18f0a8 Author: Heiner Kallweit Date: Sat May 30 23:59:58 2020 +0200 r8169: improve handling power management ops Simplify handling the power management callbacks. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 8ac8e8c64b539a548a5f22d6b21f999eea38b0ee Author: Heiner Kallweit Date: Sat May 30 23:58:35 2020 +0200 r8169: make rtl8169_down central chip quiesce function Functionality for quiescing the chip is spread across different functions currently. Move it to rtl8169_down(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit bac75d8565e800f7a4494d8c873e38dce33d6079 Author: Heiner Kallweit Date: Sat May 30 23:57:10 2020 +0200 r8169: move some calls to rtl8169_hw_reset Move calls that are needed before and after calling rtl8169_hw_reset() into this function. This requires to move the function in the code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 9fdd50c579802adad09028eba86e5a7ef7c9b738 Author: Heiner Kallweit Date: Sat May 30 23:56:14 2020 +0200 r8169: don't reset tx ring indexes in rtl8169_tx_clear In places where the indexes have to be reset, we call rtl8169_init_ring_indexes() anyway after rtl8169_tx_clear(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 01bd753d039553cf63830823d1dcc8a864174afc Author: Heiner Kallweit Date: Sat May 30 23:55:30 2020 +0200 r8169: enable WAKE_PHY as only WoL source when runtime-suspending We go to runtime-suspend few secs after cable removal. As cable is removed "physical link up" is the only meaningful WoL source. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 27dc36aefc73ce50a485c9d32c33b18832289203 Author: Heiner Kallweit Date: Sat May 30 23:54:36 2020 +0200 r8169: change driver data type Change driver private data type to struct rtl8169_private * to avoid some overhead. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 0fa712c9db96b2c453809f85614aa008740ca8ec Author: Sergei Shtylyov Date: Wed Apr 22 22:00:18 2020 +0300 mtd: spi-nor: sfdp: add/use local variable in spi_nor_parse_bfpt() Despite of how spi_nor_parse_bfpt() abuses the structure fields during their calculation, gcc manages to make some decent code out of that. :-) Yet adding a local variable to store the BFPT DWORDs during calculations still saves 12 bytes of the object code (AArch64 gcc 4.8.5)... Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit 5ce8aee81be6c8bc19051d7c7b0d3cbb7ac5fc3f Author: Tony Lindgren Date: Wed May 27 06:49:29 2020 -0700 bus: ti-sysc: Flush posted write on enable and disable Looks like we're missing flush of posted write after module enable and disable. I've seen occasional errors accessing various modules, and it is suspected that the lack of posted writes can also cause random reboots. The errors we can see are similar to the one below from spi for example: 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4CFG (Read): Data Access in User mode during Functional access ... mcspi_wait_for_reg_bit omap2_mcspi_transfer_one spi_transfer_one_message ... We also want to also flush posted write for disable. The clkctrl clock disable happens after module disable, and we don't want to have the module potentially stay active while we're trying to disable the clock. Fixes: d59b60564cbf ("bus: ti-sysc: Add generic enable/disable functions") Signed-off-by: Tony Lindgren commit d7ad1415bda5cd0a7a948720bf154ecb62a0e9c4 Merge: b8ded9de8db3 e948ed042799 Author: David S. Miller Date: Sat May 30 18:14:11 2020 -0700 Merge tag 'wireless-drivers-next-2020-05-30' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.8 Third set of patches for v5.8. Final new features before the merge window (most likely) opens, noteworthy here is adding WPA3 support to old drivers rt2800, b43 and b43_legacy. Major changes: ath10k * SDIO and SNOC busses are not experimental anymore ath9k * allow receive of broadcast Action frames ath9k_htc * allow receive of broadcast Action frames rt2800 * enable WPA3 support out of box b43 * enable WPA3 support b43_legacy * enable WPA3 support mwifiex * advertise max number of clients to user space mt76 * mt7663: add remain-on-channel support * mt7915: add spatial reuse support * add support for mt7611n hardware iwlwifi * add ACPI DSM support * support enabling 5.2GHz bands in Indonesia via ACPI * bump FW API version to 56 ==================== Signed-off-by: David S. Miller commit b8ded9de8db34dd209a3dece94cf54fc414e78f7 Author: Karsten Graul Date: Sat May 30 16:42:37 2020 +0200 net/smc: pre-fetch send buffer outside of send_lock Pre-fetch send buffer for the CDC validation message before entering the send_lock. Without that the send call might fail with -EBUSY because there are no free buffers and waiting for buffers is not possible under send_lock. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit b86a372201153326bad2c7048aef1bd7accbcbbc Merge: 4300c7e7fe15 99b981f43132 Author: David S. Miller Date: Sat May 30 18:00:36 2020 -0700 Merge branch 'Fix-2-non-critical-issues-in-SJA1105-DSA' Vladimir Oltean says: ==================== Fix 2 non-critical issues in SJA1105 DSA This small series suppresses the W=1 warnings in the sja1105 driver and it corrects some register offsets. I would like to target it against net-next since it would have non-trivial conflicts with net, and the problems it solves are not that big of a deal. ==================== Signed-off-by: David S. Miller commit 99b981f431323e31c279ee7aee20a4c501a1e89d Author: Vladimir Oltean Date: Sat May 30 13:29:53 2020 +0300 net: dsa: sja1105: fix port mirroring for P/Q/R/S The dynamic configuration interface for the General Params and the L2 Lookup Params tables was copy-pasted between E/T devices and P/Q/R/S devices. Nonetheless, these interfaces are bitwise different. The driver is using dynamic reconfiguration of the General Parameters table for the port mirroring feature, which was therefore broken on P/Q/R/S. Note that this patch can't be backported easily very far to stable trees (since it conflicts with some other development done since the introduction of the driver). So the Fixes: tag is purely informational. Fixes: 8aa9ebccae87 ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 53bd63afbd659017d20dfb7ac3a53ceb8cbb338a Author: Vladimir Oltean Date: Sat May 30 13:29:52 2020 +0300 net: dsa: sja1105: suppress -Wmissing-prototypes in sja1105_static_config.c Newer compilers complain with W=1 builds that there are non-static functions defined in sja1105_static_config.c that don't have a prototype, because their prototype is defined in sja1105.h which this translation unit does not include. I don't entirely understand what is the point of these warnings, since in principle there's nothing wrong with that. But let's move the prototypes to a header file that _is_ included by sja1105_static_config.c, since that will make these warnings go away. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 4300c7e7fe152be96b41b2135e3ace9a1e8db308 Merge: da4e15e31bae eb24387183d3 Author: David S. Miller Date: Sat May 30 17:53:57 2020 -0700 Merge tag 'mlx5-cleanup-2020-05-29' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-cleanup-2020-05-29 Accumulated cleanup patches and sparse warning fixes for mlx5 driver. 1) sync with mlx5-next branch 2) Eli Cohen declares mpls_entry_encode() helper in mpls.h as suggested by Jakub Kicinski and David Ahern, and use it in mlx5 3) Jesper Fixes xdp data_meta setup in mlx5 4) Many sparse and build warnings cleanup ==================== Signed-off-by: David S. Miller commit da4e15e31bae16d3a57c9eabe90eb2ab0e40f1a7 Merge: bc183dec08f9 996aade998ac Author: David S. Miller Date: Sat May 30 17:41:22 2020 -0700 Merge branch 'hns3-next' Huazhong Tan says: ==================== net: hns3: adds some cleanups for -next There are some cleanups for the HNS3 ethernet driver, fix an incorrect print format, an incorrect comment and some coding style issues, also remove some unused codes and macros. ==================== Signed-off-by: David S. Miller commit 996aade998ac0e9f6f0bf09531c32f1106d9d559 Author: Huazhong Tan Date: Sat May 30 09:08:32 2020 +0800 net: hns3: remove some unused codes in hns3_nic_set_features() NETIF_F_HW_VLAN_CTAG_FILTER is not set in netdev->hw_feature for the HNS3 driver, so the handler of NETIF_F_HW_VLAN_CTAG_FILTER in hns3_nic_set_features() won't be called, remove it. Reported-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 2adb8187e5439e5066c9893586e5079e89f9060a Author: Huazhong Tan Date: Sat May 30 09:08:31 2020 +0800 net: hns3: fix two coding style issues in hclgevf_main.c Remove a redundant blank line in hclgevf_cmd_set_promisc_mode(), and fix a reverse xmas tree coding style issue in hclgevf_set_rss_tc_mode(). Reported-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit ec4d9392207aad5db32cc518c4a5c8b7f1057fa1 Author: Huazhong Tan Date: Sat May 30 09:08:30 2020 +0800 net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev struct hclgevf_dev stands for VF device, its field num_tqps indicates the number of VF's task queue pairs, so the comment is incorrect, replace 'PF' with 'VF'. Reported-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit fc68aed15648c70db0377a6abd2b34ec328dd12a Author: Huazhong Tan Date: Sat May 30 09:08:29 2020 +0800 net: hns3: remove two unused macros in hclgevf_cmd.c Macro hclgevf_ring_to_dma_dir and hclgevf_is_csq defined in hclgevf_cmd.c, but not used, so remove them. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit d62805087e7fbbd7582403b972dd75581256e585 Author: Huazhong Tan Date: Sat May 30 09:08:28 2020 +0800 net: hns3: remove an unused macro hclge_is_csq Macro hclge_is_csq defined in hcgle_cmd.c has not been used, so remove it. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 1f4982ef56f794101cae7ec0fa3b7605f78bd25f Author: Huazhong Tan Date: Sat May 30 09:08:27 2020 +0800 net: hns3: fix a print format issue in hclge_mac_mdio_config() Use %d to print int variable 'ret' in hclge_mac_mdio_config(). Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit d61b7997ca467a8249d104f529194a3c6337e767 Author: Manivannan Sadhasivam Date: Wed May 20 14:18:54 2020 +0530 MAINTAINERS: Add entry for Qualcomm IPCC driver Add MAINTAINERS entry for Qualcomm IPCC driver and its binding. Reviewed-by: Bjorn Andersson Signed-off-by: Manivannan Sadhasivam Signed-off-by: Jassi Brar commit fa74a0257f45c5a92b82ae95c8455f06c598792f Author: Manivannan Sadhasivam Date: Sat May 30 18:15:12 2020 -0500 mailbox: Add support for Qualcomm IPCC Add support for the Inter-Processor Communication Controller (IPCC) block from Qualcomm that coordinates the interrupts (inbound & outbound) for Multiprocessor (MPROC), COMPUTE-Level0 (COMPUTE-L0) & COMPUTE-Level1 (COMPUTE-L1) protocols for the Application Processor Subsystem (APSS). This driver is modeled as an irqchip+mailbox driver. The irqchip part helps in receiving the interrupts from the IPCC clients such as modems, DSPs, PCI-E etc... and forwards them to respective entities in APSS. On the other hand, the mailbox part is used to send interrupts to the IPCC clients from the entities of APSS. Reviewed-by: Bjorn Andersson Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Venkata Narendra Kumar Gutta Signed-off-by: Bjorn Andersson [mani: moved to mailbox, added static mbox channels and cleanups] Signed-off-by: Manivannan Sadhasivam Signed-off-by: Jassi Brar commit a01822e94ee53e8ebc9632fe2764048b81921254 Author: Manivannan Sadhasivam Date: Wed May 20 14:18:52 2020 +0530 dt-bindings: mailbox: Add devicetree binding for Qcom IPCC Add devicetree YAML binding for Qualcomm Inter-Processor Communication Controller (IPCC) block. Reviewed-by: Bjorn Andersson Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Jassi Brar commit 445aeeb569f8d7904f8cf80b7c6826bb651ef80e Author: Wei Yongjun Date: Wed Apr 29 09:35:03 2020 +0000 mailbox: zynqmp-ipi: Fix NULL vs IS_ERR() check in zynqmp_ipi_mbox_probe() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). So we should check whether the return value of devm_ioremap() is NULL instead of IS_ERR. Fixes: 4981b82ba2ff ("mailbox: ZynqMP IPI mailbox controller") Signed-off-by: Wei Yongjun Signed-off-by: Jassi Brar commit 9d8ca628c0286a35e3f8382e44f8b79846a88603 Author: Peng Fan Date: Tue Apr 14 21:21:15 2020 +0800 mailbox: imx-mailbox: fix scu msg header size check The i.MX8 SCU message header size is the number of "u32" elements, not "u8", so fix the check. Reported-by: coverity-bot Addresses-Coverity-ID: 1461658 ("Memory - corruptions") Signed-off-by: Peng Fan Reviewed-by: Leonard Crestez Acked-by: Oleksij Rempel Signed-off-by: Jassi Brar commit ca27fc26cd2219d964b4fc0efac634ab237b6c8e Author: Baolin Wang Date: Fri May 22 21:31:09 2020 +0800 mailbox: sprd: Add Spreadtrum mailbox driver The Spreadtrum mailbox controller supports 8 channels to communicate with MCUs, and it contains 2 different parts: inbox and outbox, which are used to send and receive messages by IRQ mode. Signed-off-by: Baolin Wang Signed-off-by: Jassi Brar commit fa75386538e5284a2e3ec2afe0c15c0532fb54d2 Author: Baolin Wang Date: Fri May 22 21:31:08 2020 +0800 dt-bindings: mailbox: Add the Spreadtrum mailbox documentation Add the Spreadtrum mailbox documentation. Reviewed-by: Rob Herring Signed-off-by: Baolin Wang Signed-off-by: Jassi Brar commit ec32481b1669ad45480ae3b439e3dcde69bfaa68 Author: Markus Elfring Date: Sun Apr 5 15:10:16 2020 +0200 mailbox: ZynqMP IPI: Delete an error message in zynqmp_ipi_probe() The function platform_get_irq can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Jassi Brar commit 47303f9438954bc7bca593310ac8685d11297725 Author: Fabio Estevam Date: Sat May 30 17:56:28 2020 -0500 mailbox: imx: Disable the clock on devm_mbox_controller_register() failure devm_mbox_controller_register() may fail, and in the case of failure the priv->clk clock that was previously enabled, should be disabled. Fixes: 2bb7005696e2 ("mailbox: Add support for i.MX messaging unit") Signed-off-by: Fabio Estevam Reviewed-by: Peng Fan Acked-by: Oleksij Rempel [Jassi: fixed merge/am conflict] Signed-off-by: Jassi Brar commit fad5972a1eca71c797e2e209ec403ade9bf69384 Author: Wolfram Sang Date: Wed May 27 13:30:39 2020 +0200 i2c: add 'single-master' property to generic bindings It is useful to know if we are the only master on a given bus. Because this is a HW description of the bus, add it to the generic bindings. Signed-off-by: Wolfram Sang Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 1b3a347b7d56aa637157da1b7df225071af1421f Author: Dan Carpenter Date: Tue Apr 7 12:27:53 2020 +0300 mailbox: imx: Fix return in imx_mu_scu_xlate() This called from mbox_request_channel(). The caller is expecting error pointers and not NULL so this "return NULL;" will lead to an Oops. Fixes: 0a67003b1985 ("mailbox: imx: add SCU MU support") Signed-off-by: Dan Carpenter Signed-off-by: Jassi Brar commit 676f23eab75adbf72c029bdfb7b5a7b2f1129177 Author: Anson Huang Date: Mon Apr 13 20:25:30 2020 +0800 mailbox: imx: Support runtime PM Some power hungry sub-systems like VPU has its own MUs which also use mailbox driver, current mailbox driver uses platform driver model and MU's power will be ON after driver probed and left ON there, it may cause the whole sub-system can NOT enter lower power mode, take VPU driver for example, it has runtime PM support, but due to its MU always ON, the VPU sub-system will be always ON and consume many power during kernel idle. To save power in kernel idle, mailbox driver needs to support runtime PM in order to power off MU when it is unused. However, the runtime suspend/resume can ONLY be implemented in mailbox's .shutdown/.startup callback, so its consumer needs to call mbox_request_channel()/mbox_free_channel() in consumer driver's runtime PM callback, then the MU's power will be ON/OFF along with consumer's runtime PM status. Signed-off-by: Anson Huang Signed-off-by: Jassi Brar commit 00d9990acb23c4319a1dc961d4e29a9213923b67 Author: Jason Yan Date: Fri Apr 3 11:52:08 2020 +0800 mailbox: pcc: make pcc_mbox_driver static Fix the following sparse warning: drivers/mailbox/pcc.c:571:24: warning: symbol 'pcc_mbox_driver' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Jassi Brar commit fcb82a939df86018641f38124cb9a7811a5f8505 Author: Serge Semin Date: Thu May 28 12:33:21 2020 +0300 i2c: designware: Add Baikal-T1 System I2C support Baikal-T1 System Controller is equipped with a dedicated I2C Controller which functionality is based on the DW APB I2C IP-core, the only difference in a way it' registers are accessed. There are three access register provided in the System Controller registers map, which indirectly address the normal DW APB I2C registers space. So in order to have the Baikal-T1 System I2C Controller supported by the common DW APB I2C driver we created a dedicated Dw I2C controller model quirk, which retrieves the syscon regmap from the parental dt node and creates a new regmap based on it. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit b7c3d0777808cd7b5cee6078bd0ef51e82bd3db9 Author: Serge Semin Date: Thu May 28 12:33:20 2020 +0300 i2c: designware: Move reg-space remapping into a dedicated function This is a preparation patch before adding a quirk with custom registers map creation required for the Baikal-T1 System I2C support. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit fac25d7aaa03c4b5e11c7b7c1e286f85d21e008a Author: Serge Semin Date: Thu May 28 12:33:19 2020 +0300 i2c: designware: Retrieve quirk flags as early as possible Some platforms might need to activate the driver quirks at a very early probe stage. For instance, Baikal-T1 System I2C doesn't need to map the registers space as ones belong to the system controller. Instead it will request the syscon regmap from the parental DT node. In order to be able to do so let's retrieve the model flags right after the DW I2C private data is created. While at it replace the or-assignment with just assignment operator since or-ing is redundant at this stage. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 0daede80f870025141cbb16e6a826d5e7f43f4a5 Author: Serge Semin Date: Thu May 28 12:33:18 2020 +0300 i2c: designware: Convert driver to using regmap API Seeing the DW I2C driver is using flags-based accessors with two conditional clauses it would be better to replace them with the regmap API IO methods and to initialize the regmap object with read/write callbacks specific to the controller registers map implementation. This will be also handy for the drivers with non-standard registers mapping (like an embedded into the Baikal-T1 System Controller DW I2C block, which glue-driver is a part of this series). As before the driver tries to detect the mapping setup at probe stage and creates a regmap object accordingly, which will be used by the rest of the code to correctly access the controller registers. In two places it was appropriate to convert the hand-written read-modify-write and read-poll-loop design patterns to the corresponding regmap API ready-to-use methods. Note the regmap IO methods return value is checked only at the probe stage. The rest of the code won't do this because basically we have MMIO-based regmap so non of the read/write methods can fail (this also won't be needed for the Baikal-T1-specific I2C controller). Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Tested-by: Jarkko Nikula Acked-by: Jarkko Nikula Reviewed-by: Andy Shevchenko [wsa: fix type of 'rx_valid' and remove outdated kdoc var description] Signed-off-by: Wolfram Sang commit d63ed4ff41bb2d1f0738f801bcd9ff60dfc1eb7f Author: Adam Ford Date: Sat Apr 4 11:15:36 2020 -0500 dt: Add bindings for IDT VersaClock 5P49V5925 IDT VersaClock 5 5P49V6965 has 5 clock outputs, 4 fractional dividers. Signed-off-by: Adam Ford Link: https://lkml.kernel.org/r/20200404161537.2312297-2-aford173@gmail.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 2bda748e6ad89b786d337914f03a3ad2adea01fe Author: Adam Ford Date: Sat Apr 4 11:15:35 2020 -0500 clk: vc5: Add support for IDT VersaClock 5P49V6965 Update IDT VersaClock 5 driver to support 5P49V6965. Signed-off-by: Adam Ford Link: https://lore.kernel.org/r/20200404161537.2312297-1-aford173@gmail.com Signed-off-by: Stephen Boyd commit dec18bd8f4f2c600df581c075d59747e73bf6f3f Author: Pratyush Yadav Date: Mon May 25 14:45:32 2020 +0530 mtd: spi-nor: sfdp: prepare BFPT parsing for JESD216 rev D JESD216 rev D makes BFPT 20 DWORDs. Update the BFPT size define to reflect that. The check for rev A or later compared the BFPT header length with the maximum BFPT length, BFPT_DWORD_MAX. Since BFPT_DWORD_MAX was 16, and so was the BFPT length for both rev A and B, this check worked fine. But now, since BFPT_DWORD_MAX is 20, it means this check will also stop BFPT parsing for rev A or B, since their length is 16. So, instead check for BFPT_DWORD_MAX_JESD216 to stop BFPT parsing for the first JESD216 version, and check for BFPT_DWORD_MAX_JESD216B for the next two versions. Signed-off-by: Pratyush Yadav Signed-off-by: Tudor Ambarus commit 353afa3a8d2ef4a4b25db823ffd05d440b3530cb Author: Serge Semin Date: Wed May 27 01:20:56 2020 +0300 clk: Add Baikal-T1 CCU Dividers driver Nearly each Baikal-T1 IP-core is supposed to have a clock source of particular frequency. But since there are greater than five IP-blocks embedded into the SoC, the CCU PLLs can't fulfill all the needs. Baikal-T1 CCU provides a set of fixed and configurable clock dividers in order to generate a necessary signal for each chip sub-block. This driver creates the of-based hardware clocks for each divider available in Baikal-T1 CCU. The same way as for PLLs we split the functionality up into the clocks operations (gate, ungate, set rate, etc) and hardware clocks declaration/registration procedures. In accordance with the CCU documentation all its dividers are distributed into two CCU sub-blocks: AXI-bus and system devices reference clocks. The former sub-block is used to supply the clocks for AXI-bus interfaces (AXI clock domains) and the later one provides the SoC IP-cores reference clocks. Each sub-block is represented by a dedicated DT node, so they have different compatible strings to distinguish one from another. For some reason CCU provides the dividers of different types. Some dividers can be gateable some can't, some are fixed while the others are variable, some have special divider' limitations, some've got a non-standard register layout and so on. In order to cover all of these cases the hardware clocks driver is designed with an info-descriptor pattern. So there are special static descriptors declared for the dividers of each type with additional flags describing the block peculiarity. These descriptors are then used to create hardware clocks with proper operations. Some CCU dividers provide a way to reset a domain they generate a clock for. So the CCU AXI-bus and CCU system devices clock drivers also perform the reset controller registration. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200526222056.18072-5-Sergey.Semin@baikalelectronics.ru [sboyd@kernel.org: Drop return from void function, silence sparse warnings about initializing structs with NULL vs. integer] Signed-off-by: Stephen Boyd commit b7d950b9281f1dc5a5e37eaaf04cf33067e575f6 Author: Serge Semin Date: Wed May 27 01:20:55 2020 +0300 clk: Add Baikal-T1 CCU PLLs driver Baikal-T1 is supposed to be supplied with a high-frequency external oscillator. But in order to create signals suitable for each IP-block embedded into the SoC the oscillator output is primarily connected to a set of CCU PLLs. There are five of them to create clocks for the MIPS P5600 cores, an embedded DDR controller, SATA, Ethernet and PCIe domains. The last three domains though named by the biggest system interfaces in fact include nearly all of the rest SoC peripherals. Each of the PLLs is based on True Circuits TSMC CLN28HPM IP-core with an interface wrapper (so called safe PLL' clocks switcher) to simplify the PLL configuration procedure. This driver creates the of-based hardware clocks to use them then in the corresponding subsystems. In order to simplify the driver code we split the functionality up into the PLLs clocks operations and hardware clocks declaration/registration procedures. Even though the PLLs are based on the same IP-core, they may have some differences. In particular, some CCU PLLs support the output clock change without gating them (like CPU or PCIe PLLs), while the others don't, some CCU PLLs are critical and aren't supposed to be gated. In order to cover all of these cases the hardware clocks driver is designed with an info-descriptor pattern. So there are special static descriptors declared for each PLL, which is then used to create a hardware clock with proper operations. Additionally debugfs-files are provided for each PLL' field to make sure the implemented rate-PLLs-dividers calculation algorithm is correct. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200526222056.18072-4-Sergey.Semin@baikalelectronics.ru [sboyd@kernel.org: Silence sparse warning about initializing structs with NULL vs. integer] Signed-off-by: Stephen Boyd commit 11ea09b9e2ed0d9680a890f8fffa204dcb1a2654 Author: Serge Semin Date: Wed May 27 01:20:54 2020 +0300 dt-bindings: clk: Add Baikal-T1 CCU Dividers binding After being gained by the CCU PLLs the signals must be transformed to be suitable for the clock-consumers. This is done by a set of dividers embedded into the CCU. A first block of dividers is used to create reference clocks for AXI-bus of high-speed peripheral IP-cores of the chip. The second block dividers alter the PLLs output signals to be then consumed by SoC peripheral devices. Both block DT nodes are ordinary clock-providers with standard set of properties supported. But in addition to that each clock provider can be used to reset the corresponding clock domain. This makes the AXI-bus and System Devices CCU DT nodes to be also reset-providers. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Link: https://lore.kernel.org/r/20200526222056.18072-3-Sergey.Semin@baikalelectronics.ru Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit aec6adc560a0fa090659f23f7501e77d18306b84 Author: Serge Semin Date: Wed May 27 01:20:53 2020 +0300 dt-bindings: clk: Add Baikal-T1 CCU PLLs binding Baikal-T1 Clocks Control Unit is responsible for transformation of a signal coming from an external oscillator into clocks of various frequencies to propagate them then to the corresponding clocks consumers (either individual IP-blocks or clock domains). In order to create a set of high-frequency clocks the external signal is firstly handled by the embedded into CCU PLLs. So the corresponding dts-node is just a normal clock-provider node with standard set of properties. Note as being part of the Baikal-T1 System Controller its DT node is supposed to be a child the system controller node. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Link: https://lore.kernel.org/r/20200526222056.18072-2-Sergey.Semin@baikalelectronics.ru Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 649304c936cd4d2a2128bb877044772416c7d4f5 Author: WeiXiong Liao Date: Wed Mar 25 16:55:02 2020 +0800 Documentation: Add details for pstore/blk Add details on using pstore/blk, the new backend of pstore to record dumps to block devices, in Documentation/admin-guide/pstore-blk.rst Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-7-keescook@chromium.org/ Signed-off-by: Kees Cook commit 34327e9fd213414b35eb70aa512c4e39b2095907 Author: WeiXiong Liao Date: Wed Mar 25 16:55:01 2020 +0800 pstore/zone,blk: Add ftrace frontend support Support backend for ftrace. To enable ftrace backend, just make ftrace_size be greater than 0 and a multiple of 4096. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-6-keescook@chromium.org/ Co-developed-by: Colin Ian King Signed-off-by: Colin Ian King Link: https://lore.kernel.org/lkml/20200512170719.221514-1-colin.king@canonical.com Signed-off-by: Kees Cook commit cc9c4d1b5597167f8e8c92f6b61e1cda6d01884d Author: WeiXiong Liao Date: Wed Mar 25 16:55:00 2020 +0800 pstore/zone,blk: Add console frontend support Support backend for console. To enable console backend, just make console_size be greater than 0 and a multiple of 4096. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-5-keescook@chromium.org/ Signed-off-by: Kees Cook commit 0dc068265a1c5923ffebf40388fbe93050a77ad1 Author: WeiXiong Liao Date: Wed Mar 25 16:54:59 2020 +0800 pstore/zone,blk: Add support for pmsg frontend Add pmsg support to pstore/blk (through pstore/zone). To enable, pmsg_size must be greater than 0 and a multiple of 4096. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-4-keescook@chromium.org/ Co-developed-by: Colin Ian King Signed-off-by: Colin Ian King Link: https://lore.kernel.org/lkml/20200512171932.222102-1-colin.king@canonical.com Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit 17639f67c1d61aba3c05e7703f75cd468f9d484f Author: WeiXiong Liao Date: Wed Mar 25 16:54:57 2020 +0800 pstore/blk: Introduce backend for block devices pstore/blk is similar to pstore/ram, but uses a block device as the storage rather than persistent ram. The pstore/blk backend solves two common use-cases that used to preclude using pstore/ram: - not all devices have a battery that could be used to persist regular RAM across power failures. - most embedded intelligent equipment have no persistent ram, which increases costs, instead preferring cheaper solutions, like block devices. pstore/blk provides separate configurations for the end user and for the block drivers. User configuration determines how pstore/blk operates, such as record sizes, max kmsg dump reasons, etc. These can be set by Kconfig and/or module parameters, but module parameter have priority over Kconfig. Driver configuration covers all the details about the target block device, such as total size of the device and how to perform read/write operations. These are provided by block drivers, calling pstore_register_blkdev(), including an optional panic_write callback used to bypass regular IO APIs in an effort to avoid potentially destabilized kernel code during a panic. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-3-keescook@chromium.org/ Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit d26c3321fe18dc74517dc1f518d584aa33b0a851 Author: WeiXiong Liao Date: Wed Mar 25 16:54:56 2020 +0800 pstore/zone: Introduce common layer to manage storage zones Implement a common set of APIs needed to support pstore storage zones, based on how ramoops is designed. This will be used by pstore/blk with the intention of migrating pstore/ram in the future. Signed-off-by: WeiXiong Liao Link: https://lore.kernel.org/lkml/20200511233229.27745-2-keescook@chromium.org/ Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit acf12c5e58a45cb978d5de4628f767d326c3d740 Author: Pavel Tatashin Date: Tue May 5 11:45:10 2020 -0400 ramoops: Add "max-reason" optional field to ramoops DT node Currently, it is only possible to get kmsg dumps for panic and oops, or just panic, via "no-dump-oops". With "max-reason" it is possible to dump messages for other kmsg_dump events, for example emerg and shutdown. Signed-off-by: Pavel Tatashin Link: https://lore.kernel.org/lkml/20200515184434.8470-7-keescook@chromium.org/ Signed-off-by: Kees Cook commit 791205e3ec6081a8da6f00621e3453d622dc41e7 Author: Kees Cook Date: Wed May 13 14:35:03 2020 -0700 pstore/ram: Introduce max_reason and convert dump_oops Now that pstore_register() can correctly pass max_reason to the kmesg dump facility, introduce a new "max_reason" module parameter and "max-reason" Device Tree field. The "dump_oops" module parameter and "dump-oops" Device Tree field are now considered deprecated, but are now automatically converted to their corresponding max_reason values when present, though the new max_reason setting has precedence. For struct ramoops_platform_data, the "dump_oops" member is entirely replaced by a new "max_reason" member, with the only existing user updated in place. Additionally remove the "reason" filter logic from ramoops_pstore_write(), as that is not specifically needed anymore, though technically this is a change in behavior for any ramoops users also setting the printk.always_kmsg_dump boot param, which will cause ramoops to behave as if max_reason was set to KMSG_DUMP_MAX. Co-developed-by: Pavel Tatashin Signed-off-by: Pavel Tatashin Link: https://lore.kernel.org/lkml/20200515184434.8470-6-keescook@chromium.org/ Signed-off-by: Kees Cook commit 3524e688b8ee50b0edc76f0e020727eb6c684dbc Author: Pavel Tatashin Date: Tue May 5 11:45:07 2020 -0400 pstore/platform: Pass max_reason to kmesg dump Add a new member to struct pstore_info for passing information about kmesg dump maximum reason. This allows a finer control of what kmesg dumps are sent to pstore storage backends. Those backends that do not explicitly set this field (keeping it equal to 0), get the default behavior: store only Oopses and Panics, or everything if the printk.always_kmsg_dump boot param is set. Signed-off-by: Pavel Tatashin Link: https://lore.kernel.org/lkml/20200515184434.8470-5-keescook@chromium.org/ Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit fb13cb8a0482105a415e24042209d02a684255e2 Author: Kees Cook Date: Thu May 7 19:36:22 2020 -0700 printk: Introduce kmsg_dump_reason_str() The pstore subsystem already had a private version of this function. With the coming addition of the pstore/zone driver, this needs to be shared. As it really should live with printk, move it there instead. Link: https://lore.kernel.org/lkml/20200515184434.8470-4-keescook@chromium.org/ Acked-by: Petr Mladek Acked-by: Sergey Senozhatsky Reviewed-by: Pavel Tatashin Signed-off-by: Kees Cook commit b1f6f161b236d0e5a9222fb8b482e65aaff13689 Author: Pavel Tatashin Date: Tue May 5 11:45:06 2020 -0400 printk: honor the max_reason field in kmsg_dumper kmsg_dump() allows to dump kmesg buffer for various system events: oops, panic, reboot, etc. It provides an interface to register a callback call for clients, and in that callback interface there is a field "max_reason", but it was getting ignored when set to any "reason" higher than KMSG_DUMP_OOPS unless "always_kmsg_dump" was passed as kernel parameter. Allow clients to actually control their "max_reason", and keep the current behavior when "max_reason" is not set. Signed-off-by: Pavel Tatashin Link: https://lore.kernel.org/lkml/20200515184434.8470-3-keescook@chromium.org/ Reviewed-by: Petr Mladek Signed-off-by: Kees Cook commit 6d3cf962dd1a95df868c547b090bfc4c7977f4be Author: Kees Cook Date: Fri May 15 11:05:43 2020 -0700 printk: Collapse shutdown types into a single dump reason To turn the KMSG_DUMP_* reasons into a more ordered list, collapse the redundant KMSG_DUMP_(RESTART|HALT|POWEROFF) reasons into KMSG_DUMP_SHUTDOWN. The current users already don't meaningfully distinguish between them, so there's no need to, as discussed here: https://lore.kernel.org/lkml/CA+CK2bAPv5u1ih5y9t5FUnTyximtFCtDYXJCpuyjOyHNOkRdqw@mail.gmail.com/ Link: https://lore.kernel.org/lkml/20200515184434.8470-2-keescook@chromium.org/ Reviewed-by: Pavel Tatashin Reviewed-by: Petr Mladek Acked-by: Michael Ellerman (powerpc) Signed-off-by: Kees Cook commit 16a583079e937f6f5e6274ef7fda6dbf7dcb669f Author: Kees Cook Date: Fri May 8 08:42:12 2020 -0700 pstore/ftrace: Provide ftrace log merging routine Move the ftrace log merging logic out of pstore/ram into pstore/ftrace so other backends can use it, like pstore/zone. Link: https://lore.kernel.org/lkml/20200510202436.63222-7-keescook@chromium.org/ Signed-off-by: Kees Cook commit df9bf19d88965758c700f46ef75110336fea8654 Author: Kees Cook Date: Fri May 8 08:34:38 2020 -0700 pstore/ram: Refactor ftrace buffer merging This changes the ftrace record merging code to be agnostic of pstore/ram, as the first step to making it available as a generic routine for other backends to use, such as pstore/zone. Link: https://lore.kernel.org/lkml/20200510202436.63222-6-keescook@chromium.org/ Signed-off-by: Kees Cook commit 26961d76ff35aecb1af0fefd283fb5170786a812 Author: Kees Cook Date: Wed May 6 11:44:14 2020 -0700 pstore/ram: Refactor DT size parsing Refactor device tree size parsing routines to be able to pass a non-zero default value for providing a configurable default for the coming "max_reason" field. Also rename the helpers, since we're not always parsing a size -- we're parsing a u32 and making sure it's not greater than INT_MAX. Link: https://lore.kernel.org/lkml/20200506211523.15077-4-keescook@chromium.org/ Link: https://lore.kernel.org/lkml/20200521205223.175957-1-tyhicks@linux.microsoft.com Signed-off-by: Kees Cook commit f858b57f7dd28b5bb55e9dc3776fff58f38a7c91 Author: Kees Cook Date: Wed May 6 13:06:18 2020 -0700 pstore/ram: Adjust module param permissions to reflect reality A couple module parameters had 0600 permissions, but changing them would have no impact on ramoops, so switch these to 0400 to reflect reality. Link: https://lore.kernel.org/lkml/20200506211523.15077-7-keescook@chromium.org/ Signed-off-by: Kees Cook commit d973f7d83dc7360597373536b34e80eea306d15f Author: Kees Cook Date: Fri May 8 09:25:19 2020 -0700 pstore/platform: Move module params after declarations It is easier to see how module params are used if they're near the variables they use. Link: https://lore.kernel.org/lkml/20200510202436.63222-4-keescook@chromium.org/ Signed-off-by: Kees Cook commit d195c39052d1da278a00a6744ce59c383b67b191 Author: Kees Cook Date: Fri May 8 09:26:28 2020 -0700 pstore/platform: Use backend name for console registration If the pstore backend changes, there's no indication in the logs what the console is (it always says "pstore"). Instead, pass through the active backend's name. (Also adjust the selftest to match.) Link: https://lore.kernel.org/lkml/20200510202436.63222-5-keescook@chromium.org/ Link: https://lore.kernel.org/lkml/20200526135429.GQ12456@shao2-debian Signed-off-by: Kees Cook commit 563ca40ddf400dbf8c6254077f9b6887101d0f08 Author: Kees Cook Date: Fri May 8 09:16:02 2020 -0700 pstore/platform: Switch pstore_info::name to const In order to more cleanly pass around backend names, make the "name" member const. This means the module param needs to be dynamic (technically, it was before, so this actually cleans up a minor memory leak if a backend was specified and then gets unloaded.) Link: https://lore.kernel.org/lkml/20200510202436.63222-3-keescook@chromium.org/ Signed-off-by: Kees Cook commit b7753fc7f6f5626e51ee78156fd801fb52163af0 Author: Kees Cook Date: Wed May 6 16:34:42 2020 -0700 pstore: Make sure console capturing will restart The CON_ENABLED flag gets cleared during unregister_console(), so make sure we already reset the console flags before calling register_console(), otherwise unloading and reloading a pstore backend will not restart console logging. Signed-off-by: Kees Cook commit 609e28bb139e53621521130f0d4aea27a725d465 Author: Kees Cook Date: Mon May 4 19:46:53 2020 -0700 pstore: Remove filesystem records when backend is unregistered If a backend was unloaded without having first removed all its associated records in pstorefs, subsequent removals would crash while attempting to call into the now missing backend. Add automatic removal from the tree in pstore_unregister(), so that no references to the backend remain. Reported-by: Luis Henriques Link: https://lore.kernel.org/lkml/87o8yrmv69.fsf@suse.com Link: https://lore.kernel.org/lkml/20200506152114.50375-11-keescook@chromium.org/ Signed-off-by: Kees Cook commit 78c83c828c043f2e18929137c1e218e8977349b1 Author: Kees Cook Date: Tue May 5 21:36:15 2020 -0700 pstore: Do not leave timer disabled for next backend The pstore.update_ms value was being disabled during pstore_unregister(), which would cause any prior value to go unnoticed on the next pstore_register(). Instead, just let del_timer() stop the timer, which was always sufficient. This additionally refactors the timer reset code and allows the timer to be enabled if the module parameter is changed away from the default. Link: https://lore.kernel.org/lkml/20200506152114.50375-10-keescook@chromium.org/ Signed-off-by: Kees Cook commit 27e5041a87e8af2d0b6452dffe053d0253e914cc Author: Kees Cook Date: Mon May 4 19:43:41 2020 -0700 pstore: Add locking around superblock changes Nothing was protecting changes to the pstorefs superblock. Add locking and refactor away is_pstore_mounted(), instead using a helper to add a way to safely lock the pstorefs root inode during filesystem changes. Link: https://lore.kernel.org/lkml/20200506152114.50375-9-keescook@chromium.org/ Signed-off-by: Kees Cook commit f9acd7fa80be6ee14aecdc54429f2a48e56224e8 Author: Pratyush Yadav Date: Mon May 25 14:45:31 2020 +0530 mtd: spi-nor: sfdp: default to addr_width of 3 for configurable widths JESD216D.01 says that when the address width can be 3 or 4, it defaults to 3 and enters 4-byte mode when given the appropriate command. So, when we see a configurable width, default to 3 and let flash that default to 4 change it in a post-bfpt fixup. This fixes SMPT parsing for flashes with configurable address width. If the SMPT descriptor advertises variable address width, we use nor->addr_width as the address width. But since it was not set to any value from the SFDP table, the read command uses an address width of 0, resulting in an incorrect read being issued. Signed-off-by: Pratyush Yadav Signed-off-by: Tudor Ambarus commit ca7f76e680745d3b8a386638045f85dac1c4b2f4 Author: Chao Yu Date: Fri May 29 17:29:47 2020 +0800 f2fs: fix wrong discard space Under heavy fsstress, we may triggle panic while issuing discard, because __check_sit_bitmap() detects that discard command may earse valid data blocks, the root cause is as below race stack described, since we removed lock when flushing quota data, quota data writeback may race with write_checkpoint(), so that it causes inconsistency in between cached discard entry and segment bitmap. - f2fs_write_checkpoint - block_operations - set_sbi_flag(sbi, SBI_QUOTA_SKIP_FLUSH) - f2fs_flush_sit_entries - add_discard_addrs - __set_bit_le(i, (void *)de->discard_map); - f2fs_write_data_pages - f2fs_write_single_data_page : inode is quota one, cp_rwsem won't be locked - f2fs_do_write_data_page - f2fs_allocate_data_block - f2fs_wait_discard_bio : discard entry has not been added yet. - update_sit_entry - f2fs_clear_prefree_segments - f2fs_issue_discard : add discard entry In order to fix this, this patch uses node_write to serialize f2fs_allocate_data_block and checkpoint. Fixes: 435cbab95e39 ("f2fs: fix quota_sync failure due to f2fs_lock_op") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6b29030c6f9906cef2bbb1e7444329841d9a5527 Author: Bernhard Übelacker Date: Fri May 15 17:59:12 2020 +0200 platform/x86: touchscreen_dmi: Add info for the Trekstor Yourbook C11B Add touchscreen info for the Trekstor Yourbook C11B. It seems to use the same touchscreen as the Primebook C11, so we only add a new DMI match. Cc: Otmar Meier Reported-and-tested-by: Otmar Meier Signed-off-by: Bernhard Übelacker Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 5c556afebf49130004b9143f86794544b4074058 Author: Andy Shevchenko Date: Fri May 15 16:41:04 2020 +0300 platform/x86: hp-wmi: Introduce HPWMI_POWER_FW_OR_HW as convenient shortcut For hardware blocked wireless switch we check two bits. Introduce HPWMI_POWER_FW_OR_HW enum to increase readability and for easier maintenance. Signed-off-by: Andy Shevchenko commit 5cdc45ed3948042f0d73c6fec5ee9b59e637d0d2 Author: Andy Shevchenko Date: Fri May 15 16:27:04 2020 +0300 platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32() First of all, unsigned long can overflow u32 value on 64-bit machine. Second, simple_strtoul() doesn't check for overflow in the input. Convert simple_strtoul() to kstrtou32() to eliminate above issues. Signed-off-by: Andy Shevchenko commit 7640cd0b123f999f7845759dd2f78469bfe05b97 Author: Andy Shevchenko Date: Fri May 15 16:22:37 2020 +0300 platform/x86: hp-wmi: Refactor postcode_store() to follow standard patterns Refactor postcode_store() to follow standard patterns of error handling. While at it, switch to use kstrtobool(). Signed-off-by: Andy Shevchenko commit c0f61c51b78a68dbf06bf639f2f3164c13b28d98 Author: Chih-Wei Huang Date: Thu May 7 11:12:01 2020 +0800 platform/x86: acerhdf: replace space by * in modalias Using space in module alias makes it harder to parse modules.alias. Replace it by a star(*). Reviewed-by: Peter Kästle Signed-off-by: Chih-Wei Huang Signed-off-by: Andy Shevchenko commit 2adaec46178be3b499e133923af227abbc23fb57 Author: Srinivas Pandruvada Date: Wed May 13 15:24:34 2020 -0700 platform/x86: ISST: Increase timeout Fix timeout issue on some Ice Lake servers, where mail box command is timing out before the response, Signed-off-by: Srinivas Pandruvada Signed-off-by: Andy Shevchenko commit e948ed0427991d197c861fcac4961e699b978d5d Merge: 6bb986e940dc 37b76986ebd7 Author: Kalle Valo Date: Sat May 30 17:31:27 2020 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.8. Major changes: ath9k * allow receive of broadcast Action frames ath9k_htc * allow receive of broadcast Action frames commit 37b76986ebd72aae2c613b94b805e67eaea558b6 Author: Muna Sinada Date: Thu May 28 16:10:17 2020 -0700 ath11k: clear DCM max constellation tx value According to 11ax spec. draft 4.0. DCM Max Constellation Tx data field should be set to "Reserved" for an AP, therefore bit is cleared. Signed-off-by: Muna Sinada Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1590707417-29672-1-git-send-email-msinada@codeaurora.org commit 9529cba988b74091b3a67916b1c119f5b189b8b6 Author: Muna Sinada Date: Thu May 28 15:54:43 2020 -0700 ath11k: reset trigger frame MAC padding duration The value was 3 and it's reserved value. Corrected to maintain fw defaults. Signed-off-by: Muna Sinada Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1590706483-27609-1-git-send-email-msinada@codeaurora.org commit 23cc6bb5a2e6a9220c075824c8f68a91a633b547 Author: Douglas Anderson Date: Thu May 28 12:21:09 2020 -0700 ath10k: Remove ath10k_qmi_register_service_notifier() declaration The ath10k/qmi.h header file contains a declaration for the function ath10k_qmi_register_service_notifier(). This function doesn't exist. Remove the declaration. This patch is a no-op and was just found by code inspection. Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client") Signed-off-by: Douglas Anderson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200528122105.1.I31937dce728b441fd72cbe23447bc4710fd56ddb@changeid commit 2a9311b5d39ab7e60e612d75fd08c78e358caf4d Author: Jouni Malinen Date: Sun Apr 26 11:47:33 2020 +0300 ath9k_htc: Set RX filter based to allow broadcast Action frame RX Advertise support for multicast frame registration and update the RX filter based on the recently added FIF_MCAST_ACTION to allow broadcast Action frames to be received. This is needed for Device Provisioning Protocol (DPP) use cases that use broadcast Public Action frames. Signed-off-by: Jouni Malinen Reported-by: kbuild test robot Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200426084733.7889-2-jouni@codeaurora.org commit c01c320d24ac42802ee5e6db5342477d64a23e8f Author: Jouni Malinen Date: Sun Apr 26 11:47:32 2020 +0300 ath9k: Set RX filter based to allow broadcast Action frame RX Advertise support for multicast frame registration and update the RX filter based on the recently added FIF_MCAST_ACTION to allow broadcast Action frames to be received. This is needed for Device Provisioning Protocol (DPP) use cases that use broadcast Public Action frames. Signed-off-by: Jouni Malinen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200426084733.7889-1-jouni@codeaurora.org commit 7b53d59859bc932b37895d2d37388e7fa29af7a5 Author: Pavel Begunkov Date: Sat May 30 14:19:15 2020 +0300 io_uring: fix overflowed reqs cancellation Overflowed requests in io_uring_cancel_files() should be shed only of inflight and overflowed refs. All other left references are owned by someone else. If refcount_sub_and_test() fails, it will go further and put put extra ref, don't do that. Also, don't need to do io_wq_cancel_work() for overflowed reqs, they will be let go shortly anyway. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit bfe68a221905de37e65394a6d58c1e5f3e545d2f Author: Pavel Begunkov Date: Sat May 30 14:54:18 2020 +0300 io_uring: off timeouts based only on completions Offset timeouts wait not for sqe->off non-timeout CQEs, but rather sqe->off + number of prior inflight requests. Wait exactly for sqe->off non-timeout completions Reported-by: Jens Axboe Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 360428f8c0cd857006a8a3f515946285370489ac Author: Pavel Begunkov Date: Sat May 30 14:54:17 2020 +0300 io_uring: move timeouts flushing to a helper Separate flushing offset timeouts io_commit_cqring() by moving it into a helper. Just a preparation, makes following patches clearer. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit c615f5c65f622fb62df17d58485f46a544d6e07a Author: Serge Semin Date: Thu May 28 12:33:17 2020 +0300 i2c: designware: Discard Cherry Trail model flag A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C bus pm_disabled workaround"), but the flag most likely by mistake has been left in the Dw I2C drivers. Let's remove it. Since MODEL_MSCC_OCELOT is the only model-flag left, redefine it to be 0x100 so setting a very first bit in the MODEL_MASK bits range. Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit c2549011db2cd520b1d4ffb85a790a4ba22a80d1 Author: Serge Semin Date: Thu May 28 12:33:16 2020 +0300 i2c: designware: Add Baytrail sem config DW I2C platform dependency Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C platform driver. It's a bit confusing to see it's config in the menu at some separated place with no reference to the platform code. Let's move the config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the config menu will display the feature right below the DW I2C platform driver item and will indent it to the right so signifying its belonging. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 68fe6cedf02e381da96dcf3cd0a53e4b938a0660 Author: Serge Semin Date: Thu May 28 12:33:15 2020 +0300 i2c: designware: slave: Set DW I2C core module dependency DW APB I2C slave code in fact depends on the DW I2C driver core, but not on the platform code as it used to be before commit 90bc1ee6de9f ("i2c: designware: Allow slave mode for PCI enumerated devices"). Yes, the I2C slave interface is currently supported by both the platform and PCI versions of the IP core, but it still depends on the DW I2C core functionality and must be available only if the last one is enabled. So make sure the DW APB I2C slave config is only available if the I2C_DESIGNWARE_CORE config is enabled. Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit bbc5d36c5f66f19778d8e49a1e7d2c52e6873753 Author: Serge Semin Date: Thu May 28 12:33:14 2020 +0300 i2c: designware: Use `-y` to build multi-object modules Since commit 4f8272802739 ("Documentation: update kbuild loadable modules goals & examples") `-objs` is fitted for building host programs, lets change DW I2C core, platform and PCI driver kbuild directives to using `-y`, which more straightforward for device drivers. By doing so we can discard the ifeq construction in favor to the more natural and less bulky `-$(CONFIG_X) += x.o` Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 0029d097956e700b6b498ce39d6d745adc35b39c Author: Serge Semin Date: Thu May 28 12:33:13 2020 +0300 dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller Add the "baikal,bt1-sys-i2c" compatible string to the DW I2C binding. Even though the corresponding node is supposed to be a child of the Baikal-T1 System Controller, its reg property is left required for compatibility. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 25d11e9ebe0a5560dc057d1261215d9157c0ae8a Author: Serge Semin Date: Thu May 28 12:33:12 2020 +0300 dt-bindings: i2c: Convert DW I2C slave to the DW I2C master example dtc currently doesn't support I2C_OWN_SLAVE_ADDRESS flag set in the i2c "reg" property. If dtc finds an i2c-slave sub-node having an address higher than ten-bits wide it'll print an ugly warning: Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64: I2C bus unit address format error, expected "40000064" Warning (i2c_bus_reg): /example-2/i2c@1120000/eeprom@64:reg: I2C address must be less than 10-bits, got "0x40000064" In order to silence dtc up let's replace the corresponding DT binding example with a normal DW I2C master mode-based one. It's done by clearing the I2C_OWN_SLAVE_ADDRESS bit in the reg property and converting the sub-node to be compatible with normal EEPROM like "atmel,24c02". Just revert this commit when dtc is fixed. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 3264d9e5cf453fc9d392dfbaca3ba0afd1c54462 Author: Serge Semin Date: Thu May 28 12:33:11 2020 +0300 dt-bindings: i2c: Convert DW I2C binding to DT schema Modern device tree bindings are supposed to be created as YAML-files in accordance with dt-schema. This commit replaces Synopsys DW I2C legacy bare text bindings with YAML file. As before the bindings file states that the corresponding dts node is supposed to be compatible either with generic DW I2C controller or with Microsemi Ocelot SoC I2C one, to have registers, interrupts and clocks properties. In addition the node may have clock-frequency, i2c-sda-hold-time-ns, i2c-scl-falling-time-ns and i2c-sda-falling-time-ns optional properties. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit b3878a6aac1bfc52cf531d2568ae054348b2334a Author: Thomas Bogendoerfer Date: Sat May 30 10:55:25 2020 +0200 MIPS: Fix build warning about "PTR_STR" redefinition PTR_STR is redefined when CONFIG_TEST_PRINTF is set. This causes the following build warning: CC lib/test_printf.o lib/test_printf.c:214:0: warning: "PTR_STR" redefined #define PTR_STR "ffff0123456789ab" ^ In file included from ./arch/mips/include/asm/dsemul.h:11:0, from ./arch/mips/include/asm/processor.h:22, from ./arch/mips/include/asm/thread_info.h:16, from ./include/linux/thread_info.h:38, from ./include/asm-generic/preempt.h:5, from ./arch/mips/include/generated/asm/preempt.h:1, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:13, from lib/test_printf.c:10: ./arch/mips/include/asm/inst.h:20:0: note: this is the location of the previous definition #define PTR_STR ".dword" ^ Instead of renaming PTR_STR we move the unaligned macros to a new file, which is only included inside MIPS code. This way we can safely include asm.h and can use STR(PTR) again. Fixes: e701656ec4db ("MIPS: inst.h: Stop including asm.h to avoid various build failures") Cc: Maciej W. Rozycki" Reported-by: Tiezhu Yang Co-developed-by: Huacai Chen Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 76fe06c1e68b8f8dfb63d5b268623830dcb16ed0 Merge: 1d0326f352bb da10a4b62665 Author: Thomas Gleixner Date: Sat May 30 09:40:12 2020 +0200 Merge tag 'irqchip-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - A few new drivers for the Loongson MIPS platform (HTVEC, PIC, MSI) - A cleanup of the __irq_domain_add() API - A cleanup of the IRQ simulator to actually use some of the irq infrastructure - Some fixes for the Sifive PLIC when used in a multi-controller context - Fixes for the GICv3 ITS to spread interrupts according to the load of each CPU, and to honor managed interrupts - Numerous cleanups and documentation fixes commit eb24387183d37f2f4f456654ef92679b1556f8df Author: Saeed Mahameed Date: Fri May 29 00:36:10 2020 -0700 net/mlx5e: Make mlx5e_dcbnl_ops static Fix sparse warning: drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c:988:29: error: symbol 'mlx5e_dcbnl_ops' was not declared. Should it be static? Signed-off-by: Saeed Mahameed commit 58ff18e12c9b3bb860b32e9cac4dc8e12aec2695 Author: Saeed Mahameed Date: Thu May 28 00:22:12 2020 -0700 net/mlx5e: en_tc: Fix cast to restricted __be32 warning Fixes sparse warnings: warning: cast to restricted __be32 warning: restricted __be32 degrades to integer Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch commit c51323ee7ab4132c80db198b7d0956fef957e6ab Author: Saeed Mahameed Date: Wed May 27 23:41:03 2020 -0700 net/mlx5e: en_tc: Fix incorrect type in initializer warnings Fix some trivial warnings of the type: warning: incorrect type in initializer (different base types) Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch commit 44345c4c130ee3df9b9fbc366d59ab3ac707d7f8 Author: Saeed Mahameed Date: Fri May 29 00:47:12 2020 -0700 net/mlx5: IPSec: Fix incorrect type for spi spi is __be32, fix that. Fixes sparse warning: drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c:74:64 warning: incorrect type Signed-off-by: Saeed Mahameed commit aee3e9c457f172870bdb87e675faf6c4528190b1 Author: Saeed Mahameed Date: Thu May 28 18:42:40 2020 -0700 net/mlx5: Accel: fpga tls fix cast to __be64 and incorrect argument types tls handle and rcd_sn are actually big endian and not in host format. Fix that. Fix the following sparse warnings: drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c:177:21: warning: cast to restricted __be64 drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c:178:52: warning: incorrect type in argument 2 (different base types) expected unsigned int [usertype] handle got restricted __be32 [usertype] handle Signed-off-by: Saeed Mahameed commit 2553f421f44f4db7579f202b79b69046b579c7b5 Author: Saeed Mahameed Date: Wed May 27 23:16:02 2020 -0700 net/mlx5: cmd: Fix memset with byte count warning Fix sparse warning: drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1949:15: warning: memset with byte count of 271720 mlx5_cmd_stats array is too big to be held inline in mlx5_cmd. Allocate it separately. Signed-off-by: Saeed Mahameed commit 9ff2e92c466dc1aa4d970e5027dfd66b1f32b7bc Author: Saeed Mahameed Date: Thu May 28 01:14:31 2020 -0700 net/mlx5: DR: Fix incorrect type in return expression dr_ste_crc32_calc() calculates crc32 and should return it in HW format. It is being used to calculate a u32 index, hence we force the return value of u32 to avoid the sparse warning: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c:115:16: warning: incorrect type in return expression (different base types) expected unsigned int got restricted __be32 [usertype] Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch commit c2ba2c2287698bac36bf71e5c4f3be423371bee0 Author: Saeed Mahameed Date: Thu May 28 01:11:37 2020 -0700 net/mlx5: DR: Fix cast to restricted __be32 raw_ip actual type is __be32 and not u32. Fix that and get rid of the warning. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c:906:31: warning: cast to restricted __be32 Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch commit 618f88c4c40a9621a3105f3ff957a91a148e7d94 Author: Saeed Mahameed Date: Thu May 28 01:02:08 2020 -0700 net/mlx5: DR: Fix incorrect type in argument HW spec objects should receive a void ptr to work on, the MLX5_SET/GET macro will know how to handle it. No need to provide explicit or wrong pointer type in this case. warning: incorrect type in argument 1 (different base types) expected unsigned long long const [usertype] *sw_action got restricted __be64 [usertype] *[assigned] sw_action Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch commit f7e3ac424a2b3fc6fb3b490106cd874adb62ae4a Author: Eli Cohen Date: Wed May 27 08:38:03 2020 +0300 net/mlx5e: Use generic API to build MPLS label Make use of generic API mpls_entry_encode() to build mpls label and get rid of local function. Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed commit 86ae579cefffe18cb08928505d90fbc87367e8f5 Author: Eli Cohen Date: Wed May 27 08:35:03 2020 +0300 net: Make mpls_entry_encode() available for generic users Move mpls_entry_encode() from net/mpls/internal.h to include/net/mpls.h and make it available for other users. Specifically, hardware driver that offload MPLS can benefit from that. Suggested-by: Jakub Kicinski Suggested-by: David Ahern Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed commit e1167e16114f78f948078749aa1608a785f65807 Author: Arnd Bergmann Date: Tue Apr 28 23:23:47 2020 +0200 net/mlx5: reduce stack usage in qp_read_field Moving the mlx5_ifc_query_qp_out_bits structure on the stack was a bit excessive and now causes the compiler to complain on 32-bit architectures: drivers/net/ethernet/mellanox/mlx5/core/debugfs.c: In function 'qp_read_field': drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:274:1: error: the frame size of 1104 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Revert the previous patch partially to use dynamically allocation as the code did before. Unfortunately there is no good error handling in case the allocation fails. Fixes: 57a6c5e992f5 ("net/mlx5: Replace hand written QP context struct with automatic getters") Signed-off-by: Arnd Bergmann Acked-by: Saeed Mahameed Signed-off-by: Saeed Mahameed commit 2861904697de587c5b92c65a18a44ca3bbfd00ed Author: Nathan Chancellor Date: Wed May 27 00:50:22 2020 -0700 net/mlx5e: Don't use err uninitialized in mlx5e_attach_decap Clang warns: drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3712:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (IS_ERR(d->pkt_reformat)) { ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3718:6: note: uninitialized use occurs here if (err) ^~~ drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3712:2: note: remove the 'if' if its condition is always true if (IS_ERR(d->pkt_reformat)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3670:9: note: initialize the variable 'err' to silence this warning int err; ^ = 0 1 warning generated. It is not wrong, err is only ever initialized in if statements but this one is not in one. Initialize err to 0 to fix this. Fixes: 14e6b038afa0 ("net/mlx5e: Add support for hw decapsulation of MPLS over UDP") Link: https://github.com/ClangBuiltLinux/linux/issues/1037 Signed-off-by: Nathan Chancellor Signed-off-by: Saeed Mahameed commit 2950d1d64fd035726b4b060313f931ed52e3615f Author: Saeed Mahameed Date: Tue May 26 22:09:09 2020 -0700 net/mlx5: Kconfig: Fix spelling typo "mdoe"->"mode" Fixes: d956873f908c ("net/mlx5e: Introduce kconfig var for TC support") Signed-off-by: Saeed Mahameed Reported-by: Marcelo Ricardo Leitner commit 56e2287b4110fbb81456a346b1d4c12bee7cf044 Author: Jesper Dangaard Brouer Date: Wed May 27 15:44:09 2020 +0200 mlx5: fix xdp data_meta setup in mlx5e_fill_xdp_buff The helper function xdp_set_data_meta_invalid() must be called after setting xdp->data as it depends on it. The bug was introduced in the cited patch below, and cause the kernel to crash when using BPF helper bpf_xdp_adjust_head() on mlx5 driver. Fixes: 39d6443c8daf ("mlx5, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL") Reported-by: David Ahern Signed-off-by: Jesper Dangaard Brouer Tested-by: David Ahern Signed-off-by: Saeed Mahameed commit e4f9ba20d3b8c2b86ec71f326882e1a3c4e47953 Author: Ira Weiny Date: Thu Apr 30 07:41:38 2020 -0700 fs/xfs: Update xfs_ioctl_setattr_dax_invalidate() Because of the separation of FS_XFLAG_DAX from S_DAX and the delayed setting of S_DAX, data invalidation no longer needs to happen when FS_XFLAG_DAX is changed. Change xfs_ioctl_setattr_dax_invalidate() to be xfs_ioctl_dax_check_set_cache() and alter the code to reflect the new functionality. Furthermore, we no longer need the locking so we remove the join_flags logic. Signed-off-by: Ira Weiny Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b5df62843273f914c2ac7be8e33931a414df15d7 Author: Ira Weiny Date: Thu Apr 30 07:41:36 2020 -0700 fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags() The functionality in xfs_diflags_to_linux() and xfs_diflags_to_iflags() are nearly identical. The only difference is that *_to_linux() is called after inode setup and disallows changing the DAX flag. Combining them can be done with a flag which indicates if this is the initial setup to allow the DAX flag to be properly set only at init time. So remove xfs_diflags_to_linux() and call the modified xfs_diflags_to_iflags() directly. While we are here simplify xfs_diflags_to_iflags() to take struct xfs_inode and use xfs_ip2xflags() to ensure future diflags are included correctly. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit f7bf743714ab3f0a93c2c58e915541db83bebdee Author: Ira Weiny Date: Thu Apr 30 07:41:36 2020 -0700 fs/xfs: Create function xfs_inode_should_enable_dax() xfs_inode_supports_dax() should reflect if the inode can support DAX not that it is enabled for DAX. Change the use of xfs_inode_supports_dax() to reflect only if the inode and underlying storage support dax. Add a new function xfs_inode_should_enable_dax() which reflects if the inode should be enabled for DAX. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit 02beb2686ff964884756c581d513e103542dcc6a Author: Ira Weiny Date: Thu Apr 30 07:41:35 2020 -0700 fs/xfs: Make DAX mount option a tri-state As agreed upon[1]. We make the dax mount option a tri-state. '-o dax' continues to operate the same. We add 'always', 'never', and 'inode' (default). [1] https://lore.kernel.org/lkml/20200405061945.GA94792@iweiny-DESK2.sc.intel.com/ Signed-off-by: Ira Weiny Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fd58c62b65626934c5ac9f9a15e0a8d4bcf9ef47 Author: Ira Weiny Date: Thu Apr 30 07:41:35 2020 -0700 fs/xfs: Change XFS_MOUNT_DAX to XFS_MOUNT_DAX_ALWAYS In prep for the new tri-state mount option which then introduces XFS_MOUNT_DAX_NEVER. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit c5ec874e55ba87764357398d60e22bace0d2511d Author: Ira Weiny Date: Thu Apr 30 07:41:33 2020 -0700 fs/xfs: Remove unnecessary initialization of i_rwsem An earlier call of xfs_reinit_inode() from xfs_iget_cache_hit() already handles initialization of i_rwsem. Doing so again is unneeded. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit 56305aa9b6fab91a5555a45796b79c1b0a6353d1 Author: Eric W. Biederman Date: Fri May 29 22:00:54 2020 -0500 exec: Compute file based creds only once Move the computation of creds from prepare_binfmt into begin_new_exec so that the creds need only be computed once. This is just code reorganization no semantic changes of any kind are made. Moving the computation is safe. I have looked through the kernel and verified none of the binfmts look at bprm->cred directly, and that there are no helpers that look at bprm->cred indirectly. Which means that it is not a problem to compute the bprm->cred later in the execution flow as it is not used until it becomes current->cred. A new function bprm_creds_from_file is added to contain the work that needs to be done. bprm_creds_from_file first computes which file bprm->executable or most likely bprm->file that the bprm->creds will be computed from. The funciton bprm_fill_uid is updated to receive the file instead of accessing bprm->file. The now unnecessary work needed to reset the bprm->cred->euid, and bprm->cred->egid is removed from brpm_fill_uid. A small comment to document that bprm_fill_uid now only deals with the work to handle suid and sgid files. The default case is already heandled by prepare_exec_creds. The function security_bprm_repopulate_creds is renamed security_bprm_creds_from_file and now is explicitly passed the file from which to compute the creds. The documentation of the bprm_creds_from_file security hook is updated to explain when the hook is called and what it needs to do. The file is passed from cap_bprm_creds_from_file into get_file_caps so that the caps are computed for the appropriate file. The now unnecessary work in cap_bprm_creds_from_file to reset the ambient capabilites has been removed. A small comment to document that the work of cap_bprm_creds_from_file is to read capabilities from the files secureity attribute and derive capabilities from the fact the user had uid 0 has been added. Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit ac363ace16e044cc7a4da38611889091c4d6fecb Author: Kevin P. Fleming Date: Thu May 28 07:46:17 2020 -0400 rtc: abx80x: Add Device Tree matching table Enable automatic loading of the module when a Device Tree overlay specifies a device supported by this driver. Signed-off-by: Kevin P. Fleming Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20200528114617.166587-1-kevin+linux@km6g.us commit c3b29bf6f166f6ed5f04f9c125477358e0e25df8 Author: Chuhong Yuan Date: Thu May 28 18:39:50 2020 +0800 rtc: rv3028: Add missed check for devm_regmap_init_i2c() rv3028_probe() misses a check for devm_regmap_init_i2c(). Add the missed check to fix it. Fixes: e6e7376cfd7b ("rtc: rv3028: add new driver") Signed-off-by: Chuhong Yuan Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20200528103950.912353-1-hslester96@gmail.com commit 710e4a82d6f09ce75eb73e6adb8caf2b0d6cf4c6 Author: Tiezhu Yang Date: Mon May 25 09:39:48 2020 +0800 rtc: mpc5121: Use correct return value for mpc5121_rtc_probe() When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Signed-off-by: Tiezhu Yang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1590370788-15136-2-git-send-email-yangtiezhu@loongson.cn commit f4c29a09cccb954f027bf0793877fdd42e5db88f Author: Tiezhu Yang Date: Mon May 25 09:39:47 2020 +0800 rtc: goldfish: Use correct return value for goldfish_rtc_probe() When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Signed-off-by: Tiezhu Yang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1590370788-15136-1-git-send-email-yangtiezhu@loongson.cn commit a7868323c2638a7c6c5b30b37831b73cbdf0dc15 Author: Eric W. Biederman Date: Fri May 29 08:24:10 2020 -0500 exec: Add a per bprm->file version of per_clear There is a small bug in the code that recomputes parts of bprm->cred for every bprm->file. The code never recomputes the part of clear_dangerous_personality_flags it is responsible for. Which means that in practice if someone creates a sgid script the interpreter will not be able to use any of: READ_IMPLIES_EXEC ADDR_NO_RANDOMIZE ADDR_COMPAT_LAYOUT MMAP_PAGE_ZERO. This accentially clearing of personality flags probably does not matter in practice because no one has complained but it does make the code more difficult to understand. Further remaining bug compatible prevents the recomputation from being removed and replaced by simply computing bprm->cred once from the final bprm->file. Making this change removes the last behavior difference between computing bprm->creds from the final file and recomputing bprm->cred several times. Which allows this behavior change to be justified for it's own reasons, and for any but hunts looking into why the behavior changed to wind up here instead of in the code that will follow that computes bprm->cred from the final bprm->file. This small logic bug appears to have existed since the code started clearing dangerous personality bits. History Tree: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Fixes: 1bb0fa189c6a ("[PATCH] NX: clean up legacy binary support") Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit 4b957bde561f3a56865395be06f1be2c196b0b5e Author: Anson Huang Date: Fri May 22 10:19:56 2020 +0800 rtc: snvs: Add necessary clock operations for RTC APIs There could be still RTC registers access after RTC suspend with clock disabled, need to add clock operations for each RTC API to make sure accessing RTC registers is successfully. Signed-off-by: Anson Huang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1590113996-31845-2-git-send-email-Anson.Huang@nxp.com commit 20af67700bc39bccd838414128f63a72965de6e7 Author: Anson Huang Date: Fri May 22 10:19:55 2020 +0800 rtc: snvs: Make SNVS clock always prepared In IRQ handler, ONLY clock enable/disable is called due to clock prepare can NOT be called in interrupt context, but clock enable/disable will return failure if prepare count is 0, to fix this issue, just make SNVS clock always prepared there, the SNVS clock has no prepare function implemented, so it won't impact anything. Signed-off-by: Anson Huang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1590113996-31845-1-git-send-email-Anson.Huang@nxp.com commit fcbbcc325bc2dd90212de19b520c190b6fbeddae Author: Kuninori Morimoto Date: Thu May 28 10:50:46 2020 +0900 ASoC: soc-card: add snd_soc_card_remove_dai_link() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87mu5szv2h.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit cbc7a6b5a87a129084c643455d16699ea490fd2f Author: Kuninori Morimoto Date: Thu May 28 10:50:41 2020 +0900 ASoC: soc-card: add snd_soc_card_add_dai_link() Card related function should be implemented at soc-card now. This patch adds it. This patch adds missing return when error case. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87o8q8zv2m.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d41278ea0579a8c1e216c5321e2d207705ab3b54 Author: Kuninori Morimoto Date: Thu May 28 10:50:35 2020 +0900 ASoC: soc-card: add snd_soc_card_set_bias_level_post() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87pnaozv2s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 39caefda0a30cac8284264e5031a0dd478510ced Author: Kuninori Morimoto Date: Thu May 28 10:49:35 2020 +0900 ASoC: soc-card: add snd_soc_card_set_bias_level() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87sgfkzv4g.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b0275d956fab05a5088e20244c8d1eb433b7b90f Author: Kuninori Morimoto Date: Thu May 28 10:49:26 2020 +0900 ASoC: soc-card: add snd_soc_card_remove() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87tv00zv4p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5c0eac036dfd3e20dd09ab86343c3b2fb2a1ac86 Author: Kuninori Morimoto Date: Thu May 28 10:49:20 2020 +0900 ASoC: soc-card: add snd_soc_card_late_probe() Card related function should be implemented at soc-card now. This patch adds it. card has "card->probe" and "card->late_probe" callbacks, and "late_probe" callback is called after "probe". This means, we can set "card->probed" flag afer "late_probe" for all cases. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87v9kgzv4w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 73de4b026850da432b8bcfb73fc4af94674a8102 Author: Kuninori Morimoto Date: Thu May 28 10:49:11 2020 +0900 ASoC: soc-card: add snd_soc_card_probe() Card related function should be implemented at soc-card now. This patch adds it. One note here is that card has "card->probe" and "card->late_probe" callbacks. Because it needs to care "late_probe", "card->probed" flag is set under if (card->probe) at snd_soc_card_probe(). Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87wo4wzv54.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 27f07cacc9f1ddf955b85e5746f967351ab0b40b Author: Kuninori Morimoto Date: Thu May 28 10:50:21 2020 +0900 ASoC: soc-card: add probed bit field to snd_soc_card We already have bit field to control snd_soc_card. Let's add "probed" field on it instead of local variable. One note here is that soc_cleanup_card_resources() will be called as (A) formal cleanup or as (B) error handling, thus, it needs to distinguish these. In (A) case, card will have "instantiated" flag if all probe callback functions were called without error. Thus, snd_soc_unbind_card() is using it to judging card was probed. But this this patch removes it, because it is no longer needed. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87r1v4zv36.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 739443d1f162ce80eb717c695e58302958b51239 Author: Kuninori Morimoto Date: Thu May 28 10:49:02 2020 +0900 ASoC: soc-card: add snd_soc_card_resume_post() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87y2pczv5d.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 934c752c38b751663fe3dc18413db13e73b8b2b2 Author: Kuninori Morimoto Date: Thu May 28 10:48:55 2020 +0900 ASoC: soc-card: add snd_soc_card_resume_pre() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87zh9szv5k.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d17b60b2c46750ebfb6ea39a2b02d988b97484eb Author: Kuninori Morimoto Date: Thu May 28 10:48:48 2020 +0900 ASoC: soc-card: add snd_soc_card_suspend_post() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/871rn425j3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 130dc08c827db76f4a32fe7867075029fe9071d1 Author: Kuninori Morimoto Date: Thu May 28 10:48:39 2020 +0900 ASoC: soc-card: add snd_soc_card_suspend_pre() Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87367k25jc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit bf5bb8db5bf07b0a82cdcdc44e4494e55aaa4ed7 Author: Kuninori Morimoto Date: Thu May 28 10:48:28 2020 +0900 ASoC: soc-card: move snd_soc_card_subclass to soc-card Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/874ks025jn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 65a75718d68ea338b918328d471eff6f472192fc Author: Kuninori Morimoto Date: Thu May 28 10:48:20 2020 +0900 ASoC: soc-card: move snd_soc_card_get_codec_dai() to soc-card Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/875zcg25jv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 63efed582cc346c098adf6f5c852e2d5b0753783 Author: Kuninori Morimoto Date: Thu May 28 10:48:11 2020 +0900 ASoC: soc-card: move snd_soc_card_set/get_drvdata() to soc-card Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/877dww25k4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3359e9b6fa3eafeeb79d5f0ec8a04f3fe6986db1 Author: Kuninori Morimoto Date: Thu May 28 10:48:03 2020 +0900 ASoC: soc-card: move snd_soc_card_jack_new() to soc-card Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/878shc25kc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 209c6cdfd28360f030f88ae9adb69f633e6bcd2d Author: Kuninori Morimoto Date: Thu May 28 10:47:56 2020 +0900 ASoC: soc-card: move snd_soc_card_get_kcontrol() to soc-card Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87a71s25kj.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1793936bc9081d541da2ecd2af83eded7e6212a7 Author: Kuninori Morimoto Date: Thu May 28 10:47:46 2020 +0900 ASoC: add soc-card.c Current ALSA SoC has some snd_soc_card_xxx() functions, and card->xxx() callbacks. But, it is implemented randomly at random place. To collect all card related functions into one place, this patch creats new soc-card.c. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87blm825kt.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 317ec67593100f0ef0d017bcd73d42704d73fdb6 Author: Kuninori Morimoto Date: Thu May 28 10:47:37 2020 +0900 ASoC: soc.h: convert bool to bit field for snd_soc_card snd_soc_card has many bool, but it can be bit field. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87d06o25l2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 9e2b6ed41f8f99c97b13c9d15cbef235dbd97fb6 Author: Luc Van Oostenryck Date: Fri May 29 21:02:18 2020 +0200 m68k,nommu: fix implicit cast from __user in __{get,put}_user_asm() The assembly for __get_user_asm() & __put_user_asm() uses memcpy() when the size is 8. However, the pointer is always a __user one while memcpy() expects a plain one and so this cast creates a lot of warnings when using Sparse. So, fix this by adding a cast to 'void __force *' at memcpy()'s argument. Reported-by: kbuild test robot Signed-off-by: Luc Van Oostenryck Signed-off-by: Greg Ungerer commit ce3e83759c674ae7c04938d3577dbf0f3144c8f0 Author: Luc Van Oostenryck Date: Fri May 29 21:02:17 2020 +0200 m68k,nommu: add missing __user in uaccess' __ptr() macro The assembly for __get_user() & __put_user() uses a macro, __ptr(), to cast the pointer to 'unsigned long *' but the pointer is always a __user one and so this cast creates a lot of warnings when using Sparse. So, change to the cast to 'unsigned long __user *'. Reported-by: kbuild test robot Signed-off-by: Luc Van Oostenryck Signed-off-by: Greg Ungerer commit e00091071615378e66291c61ea02d02d15a2cc7e Author: Bin Meng Date: Fri May 1 21:30:21 2020 -0700 m68k: Drop CONFIG_MTD_M25P80 in stmark2_defconfig Drop CONFIG_MTD_M25P80 that was removed in commit b35b9a10362d ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Signed-off-by: Bin Meng Signed-off-by: Greg Ungerer commit bc183dec08f9cb177cf5206a010b7a9e7b22e567 Author: Florian Westphal Date: Fri May 29 00:01:52 2020 +0200 tcp: tcp_init_buffer_space can be static As of commit 98fa6271cfcb ("tcp: refactor setting the initial congestion window") this is called only from tcp_input.c, so it can be static. Signed-off-by: Florian Westphal Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit fd55199d3b762f9555c66a1bc4bf6eac3901fc2f Author: Andrew Lunn Date: Thu May 28 23:43:24 2020 +0200 net: ethtool: cabletest: Make ethnl_act_cable_test_tdr_cfg static kbuild test robot is reporting: net/ethtool/cabletest.c:230:5: warning: no previous prototype for Mark the function as static. Reported-by: kbuild test robot Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit f0b37fa613989dacbaba57010681218ed91e989b Author: Louis Peens Date: Thu May 28 16:18:46 2020 +0200 nfp: flower: fix incorrect flag assignment A previous refactoring missed some locations the flags were renamed but not moved from the previous flower_ext_feats to the new flower_en_feats variable. This lead to the FLOW_MERGE and LAG features not being enabled. Fixes: e09303d3c4d9 ("nfp: flower: renaming of feature bits") Signed-off-by: Louis Peens Signed-off-by: Simon Horman Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 91f3fd1124e002f970ef21c2459bf2ba4ac080ee Author: Bartosz Golaszewski Date: Thu May 28 15:59:02 2020 +0200 dt-bindings: net: rename the bindings document for MediaTek STAR EMAC The driver itself was renamed before getting merged into mainline, but the binding document kept the old name. This makes both names consistent. Signed-off-by: Bartosz Golaszewski Acked-by: Rob Herring Signed-off-by: David S. Miller commit 0688a9a9dbef53c81b800ec35adb4aefc458f42a Merge: 8298a419a006 29884aa6806c Author: David S. Miller Date: Fri May 29 17:01:26 2020 -0700 Merge branch 'net-ethernet-dwmac-add-ethernet-glue-logic-for-NXP-imx8-chip' Fugang Duan says: ==================== net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip NXP imx8 family like imx8mp/imx8dxl chips support Synopsys MAC 5.10a IP, the patch set is to add ethernet DWMAC glue layer including clocks, dwmac address width, phy interface mode selection and rgmii txclk rate adjustment in runtime. v1 -> v2: - suggested by Andrew: add the "snps,dwmac-5.10a" compatible string into NXP binding documentation. - suggested by David: adjust code sequences in order to have reverse christmas tree local variable ordering. Thanks Andrew and David for the review. ==================== Signed-off-by: David S. Miller commit 29884aa6806ce27460281d0ec1819683261e89cd Author: Fugang Duan Date: Thu May 28 16:26:25 2020 +0800 dt-bindings: net: imx-dwmac: Add NXP imx8 DWMAC glue layer Add description for NXP imx8 families like imx8mp/imx8dxl that integrate the Synopsys gmac IP version 5.10a. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 94abdad6974a5e108d921df2c38e35cae6179bb2 Author: Fugang Duan Date: Thu May 28 16:26:24 2020 +0800 net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip NXP imx8 family like imx8mp/imx8dxl chips support Synopsys MAC 5.10a IP. This patch adds settings for NXP imx8 glue layer: - clocks - dwmac address width - phy interface mode selection - adjust rgmii txclk rate v2: - adjust code sequences in order to have reverse christmas tree local variable ordering. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 139df98bdfef62868df3d626d27f1db9edd9830f Author: Fugang Duan Date: Thu May 28 16:26:23 2020 +0800 stmmac: platform: add "snps, dwmac-5.10a" IP compatible string Add "snps,dwmac-5.10a" compatible string for 5.10a version that can avoid to define some plat data in glue layer. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 8298a419a0064c6cd6c84a4a45de294a3eff0832 Author: YueHaibing Date: Thu May 28 07:43:59 2020 +0000 tipc: remove set but not used variable 'prev' Fixes gcc '-Wunused-but-set-variable' warning: net/tipc/msg.c: In function 'tipc_msg_append': net/tipc/msg.c:215:24: warning: variable 'prev' set but not used [-Wunused-but-set-variable] commit 0a3e060f340d ("tipc: add test for Nagle algorithm effectiveness") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit aef31718a923338aff610abef41114a9c0fd37ea Author: Vladimir Oltean Date: Wed May 27 20:20:38 2020 +0300 net: dsa: sja1105: avoid invalid state in sja1105_vlan_filtering Be there 2 switches spi/spi2.0 and spi/spi2.1 in a cross-chip setup, both under the same VLAN-filtering bridge, both in the SJA1105_VLAN_BEST_EFFORT state. If we try to change the VLAN state of one of the switches (to SJA1105_VLAN_FILTERING_FULL) we get the following error: devlink dev param set spi/spi2.1 name best_effort_vlan_filtering value false cmode runtime [ 38.325683] sja1105 spi2.1: Not allowed to overcommit frame memory. L2 memory partitions and VL memory partitions share the same space. The sum of all 16 memory partitions is not allowed to be larger than 929 128-byte blocks (or 910 with retagging). Please adjust l2-forwarding-parameters-table.part_spc and/or vl-forwarding-parameters-table.partspc. [ 38.356803] sja1105 spi2.1: Invalid config, cannot upload This is because the spi/spi2.1 switch doesn't support tagging anymore in the SJA1105_VLAN_FILTERING_FULL state, so it doesn't need to have any retagging rules defined. Great, so it can use more frame memory (retagging consumes extra memory). But the built-in low-level static config checker from the sja1105 driver says "not so fast, you've increased the frame memory to non-retagging values, but you still kept the retagging rules in the static config". So we need to rebuild the VLAN table immediately before re-uploading the static config, operation which will take care, based on the new VLAN state, of removing the retagging rules. Fixes: 3f01c91aab92 ("net: dsa: sja1105: implement VLAN retagging for dsa_8021q sub-VLANs") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 04198499b23f9d73a127a17b8576c9266c8f6f9b Author: Vladimir Oltean Date: Wed May 27 19:41:34 2020 +0300 net: dsa: tag_8021q: stop restoring VLANs from bridge Right now, our only tag_8021q user, sja1105, has the ability to restore bridge VLANs on its own, so this logic is unnecessary. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7e71609f64ec81b8367b7fa59ab06bb571d17e3b Author: Al Viro Date: Wed Feb 19 09:54:24 2020 -0500 pselect6() and friends: take handling the combined 6th/7th args into helper ... and use unsafe_get_user(), while we are at it. Signed-off-by: Al Viro commit fb02b9eb4e335f8965badd1e6ee24fdc284cb395 Merge: 0c0c5b8fabe5 263b81dc6c93 Author: Mark Brown Date: Sat May 30 00:03:53 2020 +0100 Merge remote-tracking branch 'spi/for-5.8' into spi-next commit 0c0c5b8fabe596a7322f0b9b93b88f489b3f4bb3 Merge: 9cb1fd0efd19 65e318e17358 Author: Mark Brown Date: Sat May 30 00:03:51 2020 +0100 Merge remote-tracking branch 'spi/for-5.7' into spi-linus commit 263b81dc6c932c8bc550d5e7bfc178d2b3fc491e Author: Angelo Dureghello Date: Fri May 29 21:57:56 2020 +0200 spi: spi-fsl-dspi: fix native data copy ColdFire is a big-endian cpu with a big-endian dspi hw module, so, it uses native access, but memcpy breaks the endianness. So, if i understand properly, by native copy we would mean be(cpu)->be(dspi) or le(cpu)->le(dspi) accesses, so my fix shouldn't break anything, but i couldn't test it on LS family, so every test is really appreciated. Fixes: 53fadb4d90c7 ("spi: spi-fsl-dspi: Simplify bytes_per_word gymnastics") Signed-off-by: Angelo Dureghello Tested-by: Vladimir Oltean Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20200529195756.184677-1-angelo.dureghello@timesys.com Signed-off-by: Mark Brown commit 4d89e1d112a90e38032a4a1591c335947f471e95 Author: Guoqing Jiang Date: Sat May 9 00:00:15 2020 +0200 blk-wbt: rename __wbt_update_limits to wbt_update_limits Now let's rename __wbt_update_limits to wbt_update_limits after the previous one is deleted. Signed-off-by: Guoqing Jiang Signed-off-by: Jens Axboe commit 26e0ca12e07677ca5946ed98a1e41255016f6910 Author: Guoqing Jiang Date: Sat May 9 00:00:14 2020 +0200 blk-wbt: remove wbt_update_limits No one call this function after commit 2af2783f2ea4f ("rq-qos: get rid of redundant wbt_update_limits()"), so remove it. Signed-off-by: Guoqing Jiang Signed-off-by: Jens Axboe commit 32e3374304c7c317c05a61f3ddc315dbd46424f2 Author: Guoqing Jiang Date: Sat May 9 00:00:13 2020 +0200 blk-throttle: remove tg_drain_bios After blk_throtl_drain is removed, there is no caller of tg_drain_bios, so remove it as well. Signed-off-by: Guoqing Jiang Signed-off-by: Jens Axboe commit b77412372b6812a05eaa996e1a93cafa2fa1eec2 Author: Guoqing Jiang Date: Sat May 9 00:00:12 2020 +0200 blk-throttle: remove blk_throtl_drain After the commit 5addeae1bedc4 ("blk-cgroup: remove blkcg_drain_queue"), there is no caller of blk_throtl_drain, so let's remove it. Signed-off-by: Guoqing Jiang Signed-off-by: Jens Axboe commit 8f8986e932c5f81e51aacc1e675393300a0a5b87 Author: Thierry Reding Date: Fri May 29 20:06:31 2020 +0200 dt-bindings: Merge gpio-usb-b-connector with usb-connector The binding for usb-connector is a superset of gpio-usb-b-connector. One major difference is that gpio-usb-b-connector requires at least one of the vbus-gpios and id-gpios properties to be specified. Merge the two bindings by adding the compatible string combination for the GPIO USB-B variant and an extra conditional for the required properties list to the usb-connector.yaml file. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring commit ea20868c7197827f2585a65800b9de7d2b2c4bee Merge: 95fc87b44104 aa8ba13cae31 Author: Alex Williamson Date: Fri May 29 16:17:33 2020 -0600 Merge branch 'qiushi-wu-mdev-ref-v1' into v5.8/vfio/next commit aa8ba13cae3134b8ef1c1b6879f66372531da738 Author: Qiushi Wu Date: Wed May 27 21:01:09 2020 -0500 vfio/mdev: Fix reference count leak in add_mdev_supported_type kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Thus, replace kfree() by kobject_put() to fix this issue. Previous commit "b8eb718348b8" fixed a similar problem. Fixes: 7b96953bc640 ("vfio: Mediated device Core driver") Signed-off-by: Qiushi Wu Reviewed-by: Cornelia Huck Reviewed-by: Kirti Wankhede Signed-off-by: Alex Williamson commit 971ae1ed0346658a70f5b411d59f528b94553009 Merge: c223c7f22cb1 6b646a7e4af6 Author: Saeed Mahameed Date: Fri May 29 14:38:02 2020 -0700 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux net/mlx5: Add ability to read and write ECE options net/mlx5: Add support for RDMA TX FT headers modifying net/mlx5: Move iseg access helper routines close to mlx5_core driver net/mlx5: Cleanup mlx5_ifc_fte_match_set_misc2_bits net/mlx5: Add support in forward to namespace {IB/net}/mlx5: Simplify don't trap code net/mlx5: Replace zero-length array with flexible-array Signed-off-by: Saeed Mahameed commit 41a053886b059d60945d3575e2328ff661599a04 Author: Geert Uytterhoeven Date: Tue May 5 17:51:27 2020 +0200 dt-bindings: timer: renesas: cmt: Convert to json-schema Convert the Renesas Compare Match Timer (CMT) Device Tree binding documentation to json-schema. Document missing properties. Update the example to match reality. Reviewed-by: Rob Herring Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit dff49d55e08a68f37aa0d0b94c6b586b4eb07333 Author: Anson Huang Date: Fri May 29 14:21:39 2020 +0800 dt-bindings: clock: Convert i.MX8QXP LPCG to json-schema Convert the i.MX8QXP LPCG binding to DT schema format using json-schema. Signed-off-by: Anson Huang [robh: add additionalProperties] Signed-off-by: Rob Herring commit df8cad689eae455dc92a573e91f2f84bfca0b2eb Author: Anson Huang Date: Fri May 29 10:04:42 2020 +0800 dt-bindings: timer: Convert i.MX GPT to json-schema Convert the i.MX GPT binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit fafcc40fd5261db9de1cef34f9a0694bad507504 Author: Lad Prabhakar Date: Wed May 27 22:18:37 2020 +0100 dt-bindings: thermal: rcar-thermal: Add device tree support for r8a7742 Add thermal sensor support for r8a7742 SoC. The Renesas RZ/G1H (r8a7742) thermal sensor module is identical to the R-Car Gen2 family. No driver change is needed due to the fallback compatible value "renesas,rcar-gen2-thermal". Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 41d455bda234a30e2948196d87ba03260f1d776d Author: Akash Asthana Date: Wed May 27 11:57:44 2020 +0530 dt-bindings: serial: Add binding for UART pin swap Add documentation to support RX-TX & CTS-RTS GPIO pin swap in HW. Signed-off-by: Akash Asthana Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring commit add953dc472d49e052964cf6ce517f353525b0aa Author: Akash Asthana Date: Wed May 27 11:57:43 2020 +0530 dt-bindings: geni-se: Add interconnect binding for GENI QUP Add documentation for the interconnect and interconnect-names properties for the GENI QUP. Signed-off-by: Akash Asthana Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring commit 3c2088430d27dec9a4fff82a722301d69cf72967 Author: Akash Asthana Date: Wed May 27 11:57:42 2020 +0530 dt-bindings: geni-se: Convert QUP geni-se bindings to YAML Convert QUP geni-se bindings to DT schema format using json-schema. Signed-off-by: Akash Asthana Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd [robh: Fix up example warnings] Signed-off-by: Rob Herring commit 81227f49bd272cbcd9bb4650b250519c8aa22065 Author: Anson Huang Date: Fri May 29 09:59:11 2020 +0800 dt-bindings: regulator: Convert anatop regulator to json-schema Convert the anatop regulator binding to DT schema format using json-schema. Signed-off-by: Anson Huang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1590717551-20772-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Mark Brown commit 6e28a0c3e073220b8966575325321df78faa4a0a Merge: b6f10d3f2e6d 1e7cb64b0ab5 Author: Mark Brown Date: Fri May 29 21:43:38 2020 +0100 Merge series "Kconfig updates for DMIC and SOF HDMI support" from Pierre-Louis Bossart : This series provides the following updates to the Intel machine driver Kconfig: 1. The first patch adds the explicit dependency on GPIOLIB when SND_SOC_DMIC is selected. 2. SND_SOC_SOF_HDA_AUDIO_CODEC is required for using the legacy HDA codec driver for HDMI support in SOF. The last 3 three patches make the required changes to account for this. changes since v1: first patch for DMIC was merged already rebase for HDMI on top of Arnd's RT5682 changes. Libin Yang (3): ASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common hdmi ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition ASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition sound/soc/intel/boards/Kconfig | 20 ++++++++++---------- sound/soc/intel/boards/sof_pcm512x.c | 9 --------- sound/soc/intel/boards/sof_sdw.c | 8 -------- sound/soc/intel/boards/sof_sdw_hdmi.c | 7 ------- 4 files changed, 10 insertions(+), 34 deletions(-) base-commit: 89d73ccab20a684d8446cea4d8ac6a2608c8d390 -- 2.20.1 commit b6f10d3f2e6dfccf58c54e81c8af586b66a80ce4 Author: Lad Prabhakar Date: Tue May 26 22:01:43 2020 +0100 dt-bindings: ASoC: renesas,rsnd: Add r8a7742 support Document RZ/G1H (R8A7742) SoC bindings. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Link: https://lore.kernel.org/r/1590526904-13855-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 0df556457748d160013e88202c11712c16a83b0c Author: John Hubbard Date: Fri May 22 20:59:09 2020 -0700 orangefs: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in a "Case 1" scenario (Direct IO), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Cc: Mike Marshall Cc: Martin Brandenburg Cc: devel@lists.orangefs.org Cc: linux-fsdevel@vger.kernel.org Signed-off-by: John Hubbard Signed-off-by: Mike Marshall commit 22ce85611fd5a793edf84bfc0a101077cbe85e4f Author: Colin Ian King Date: Sun May 24 23:48:02 2020 +0100 orangefs: remove redundant assignment to variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Mike Marshall commit 1e7cb64b0ab5a810b05ed49dd263605add41ac5d Author: Libin Yang Date: Fri May 29 14:35:47 2020 -0500 ASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition As CONFIG_SND_HDA_CODEC_HDMI is always enabled in sof_pcm512x, let's remove the test of CONFIG_SND_HDA_CODEC_HDMI in the sof_pcm512x driver. Signed-off-by: Libin Yang Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200529193547.6077-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 38acab2d61073ed4a684533d46505feba3eecf67 Author: Libin Yang Date: Fri May 29 14:35:46 2020 -0500 ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition As CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC is always enabled in sof-soundwire driver, let's remove the test of CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC in the code. Signed-off-by: Libin Yang Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200529193547.6077-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8f529f0175aa02266542714a569b885dd145b61c Author: Libin Yang Date: Fri May 29 14:35:45 2020 -0500 ASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common hdmi If the driver uses common hdmi, SND_SOC_SOF_HDA_AUDIO_CODEC is required to be enabled. Otherwise, the legacy hda codec driver will not be used. Signed-off-by: Libin Yang Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200529193547.6077-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 001c1a655f0a4e4ebe5d9beb47466dc5c6ab4871 Author: Al Viro Date: Sat Apr 25 18:01:30 2020 -0400 default csum_and_copy_to_user(): don't bother with access_ok() Signed-off-by: Al Viro commit 5904122c46581a5ccee54a51ef07e0d891fd7aef Author: Al Viro Date: Tue Feb 18 14:26:32 2020 -0500 take the dummy csum_and_copy_from_user() into net/checksum.h now that can be done conveniently - all non-trivial cases have _HAVE_ARCH_COPY_AND_CSUM_FROM_USER defined, so the fallback in net/checksum.h is used only for dummy (copy_from_user, then csum_partial) implementation. Allowing us to get rid of all dummy instances, both of csum_and_copy_from_user() and csum_partial_copy_from_user(). Signed-off-by: Al Viro commit 24f9aa928c3cc88bae573b39b6976844968f80a0 Author: Al Viro Date: Tue Feb 18 14:19:54 2020 -0500 arm: switch to csum_and_copy_from_user() Note that csum_partial_copy_from_user() is in assembler here, so I'm leaving it alone and just providing the wrapper for it. When/if we go for switching arm to user_access_{begin,end}() (doing domain switches in those), somebody well need to look into that one. Signed-off-by: Al Viro commit 7fe8970a78a1934545d53267281f1737eefea3bb Author: Al Viro Date: Tue Feb 18 14:18:09 2020 -0500 sh32: convert to csum_and_copy_from_user() Signed-off-by: Al Viro commit 8084c99b9af68621ff15562732bfc9f8e7cce93c Author: Al Viro Date: Tue Feb 18 14:15:37 2020 -0500 m68k: convert to csum_and_copy_from_user() trivial access_ok() there... Signed-off-by: Al Viro commit d341659f470b6c5536296a6bd575744c38610ce8 Author: Al Viro Date: Tue Feb 18 13:12:08 2020 -0500 xtensa: switch to providing csum_and_copy_from_user() Signed-off-by: Al Viro commit 76666be8c9df456373a4e00ce51d2547f1d90627 Author: Al Viro Date: Tue Feb 18 13:07:41 2020 -0500 sparc: switch to providing csum_and_copy_from_user() sparc64 already is equivalent to that (trivial access_ok()); add it into sparc32 csum_partial_copy_from_user() and we can rename both to csum_and_copy_fromUser() and be done with that. Signed-off-by: Al Viro commit 77a8710ba7ef7ffcb71f0618bddf78c1b04f01d3 Author: Al Viro Date: Tue Feb 18 13:01:02 2020 -0500 parisc: turn csum_partial_copy_from_user() into csum_and_copy_from_user() Already has the right semantics. Incidentally. failing copy_from_user() zeroes the tail of destination - no need to repeat that manually Signed-off-by: Al Viro commit 808b49da54e640cba5c5c92dee658018a529226b Author: Al Viro Date: Tue Feb 18 12:49:07 2020 -0500 alpha: turn csum_partial_copy_from_user() into csum_and_copy_from_user() It's already doing the right thing - it does access_ok() and the wrapper in net/checksum.h is pointless here. Just rename it and be done with that... Signed-off-by: Al Viro commit bfdaf029c9c95072359fd0870c282e53953220f6 Author: Al Viro Date: Tue Feb 18 12:56:09 2020 -0500 ia64: turn csum_partial_copy_from_user() into csum_and_copy_from_user() Just use copy_from_user() there, rather than relying upon the wrapper to have done access_ok() Signed-off-by: Al Viro commit cc03f19cfd45f44a75f0445c5be0073bbd3dda1c Author: Al Viro Date: Sun Feb 16 15:10:33 2020 -0500 ia64: csum_partial_copy_nocheck(): don't abuse csum_partial_copy_from_user() Just inline the call and use memcpy() instead of __copy_from_user() and note that the tail is precisely ia64 csum_partial(). Signed-off-by: Al Viro commit c281a6c1ac6b0867e4341ea801030fa9a62157f9 Author: Al Viro Date: Sun Feb 16 17:11:48 2020 -0500 x86: switch 32bit csum_and_copy_to_user() to user_access_{begin,end}() consolidate HAVE_CSUM_COPY_USER for 32bit and 64bit, while are at it Signed-off-by: Al Viro commit 0a5ea224b2fdf9dca9291ef7b5a12fd846a5dc34 Author: Al Viro Date: Sun Feb 16 16:50:00 2020 -0500 x86: switch both 32bit and 64bit to providing csum_and_copy_from_user() ... rather than messing with the wrapper. As a side effect, 32bit variant gets access_ok() into it and can be switched to user_access_begin()/user_access_end() Signed-off-by: Al Viro commit 73e800ecb67bf24c0508c63350c1dc509f00b1ce Author: Al Viro Date: Sun Feb 16 14:56:36 2020 -0500 x86_64: csum_..._copy_..._user(): switch to unsafe_..._user() We already have stac/clac pair around the calls of csum_partial_copy_generic(). Stretch that area back, so that it covers the preceding loop (and convert the loop body from __{get,put}_user() to unsafe_{get,put}_user()). That brings the beginning of the areas to the earlier access_ok(), which allows to convert them into user_access_{begin,end}() ones. Signed-off-by: Al Viro commit c223c7f22cb14f234b27c8cb6f09e318d1f5671f Merge: f26e9b2c0bf3 5a892ff2facb Author: David S. Miller Date: Fri May 29 13:10:39 2020 -0700 Merge branch 'remove-kernel_setsockopt-v4' Christoph Hellwig says: ==================== remove kernel_setsockopt v4 now that only the dlm calls to sctp are left for kernel_setsockopt, while we haven't really made much progress with the sctp setsockopt refactoring, how about this small series that splits out a sctp_setsockopt_bindx_kernel that takes a kernel space address array to share more code as requested by Marcelo. This should fit in with whatever variant of the refator of sctp setsockopt we go with, but just solved the immediate problem for now. Changes since v3: - dropped all the merged patches, just sctp setsockopt left now - factor out a new sctp_setsockopt_bindx_kernel helper instead of duplicating a small amount of logic Changes since v2: - drop the separately merged kernel_getopt_removal - drop the sctp patches, as there is conflicting cleanup going on - add an additional ACK for the rxrpc changes Changes since v1: - use ->getname for sctp sockets in dlm - add a new ->bind_add struct proto method for dlm/sctp - switch the ipv6 and remaining sctp helpers to inline function so that the ipv6 and sctp modules are not pulled in by any module that could potentially use ipv6 or sctp connections - remove arguments to various sock_* helpers that are always used with the same constant arguments ==================== Signed-off-by: David S. Miller commit 5a892ff2facb4548c17c05931ed899038a0da63e Author: Christoph Hellwig Date: Fri May 29 14:09:43 2020 +0200 net: remove kernel_setsockopt No users left. Signed-off-by: Christoph Hellwig Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit c0425a4249e9d313eec5f81c0bde8a286ebf9a63 Author: Christoph Hellwig Date: Fri May 29 14:09:42 2020 +0200 net: add a new bind_add method The SCTP protocol allows to bind multiple address to a socket. That feature is currently only exposed as a socket option. Add a bind_add method struct proto that allows to bind additional addresses, and switch the dlm code to use the method instead of going through the socket option from kernel space. Signed-off-by: Christoph Hellwig Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 05bfd3661448a46db3a258b316160d34cf0a1317 Author: Christoph Hellwig Date: Fri May 29 14:09:41 2020 +0200 sctp: refactor sctp_setsockopt_bindx Split out a sctp_setsockopt_bindx_kernel that takes a kernel pointer to the sockaddr and make sctp_setsockopt_bindx a small wrapper around it. This prepares for adding a new bind_add proto op. Signed-off-by: Christoph Hellwig Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 40ef92c6ec09bd8aaffccfa41a715d1df5625f95 Author: Christoph Hellwig Date: Fri May 29 14:09:40 2020 +0200 sctp: add sctp_sock_set_nodelay Add a helper to directly set the SCTP_NODELAY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit f26e9b2c0bf3a7a515b2e92763182bcd81628a5f Merge: 830f5ce266ce 7d4343d501f9 Author: David S. Miller Date: Fri May 29 13:02:33 2020 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2020-05-29 1) Add IPv6 encapsulation support for ESP over UDP and TCP. From Sabrina Dubroca. 2) Remove unneeded reference when initializing xfrm interfaces. From Nicolas Dichtel. 3) Remove some indirect calls from the state_afinfo. From Florian Westphal. Please note that this pull request has two merge conflicts between commit: 0c922a4850eb ("xfrm: Always set XFRM_TRANSFORMED in xfrm{4,6}_output_finish") from Linus' tree and commit: 2ab6096db2f1 ("xfrm: remove output_finish indirection from xfrm_state_afinfo") from the ipsec-next tree. and between commit: 3986912f6a9a ("ipv6: move SIOCADDRT and SIOCDELRT handling into ->compat_ioctl") from the net-next tree and commit: 0146dca70b87 ("xfrm: add support for UDPv6 encapsulation of ESP") from the ipsec-next tree. Both conflicts can be resolved as done in linux-next. ==================== Signed-off-by: David S. Miller commit 9300acc6fed8e957c8d60f6f8e4451b508feea2c Author: Arnaldo Carvalho de Melo Date: Fri May 29 16:25:34 2020 -0300 perf build: Add a LIBPFM4=1 build test entry So that when one runs: $ make -C tools/perf build-test We make sure that recent changes don't break that opt-in build. Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Budankov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Florian Fainelli Cc: Greg Kroah-Hartman Cc: Ian Rogers Cc: Igor Lubashev Cc: Jin Yao Cc: Jiri Olsa Cc: Jiwei Sun Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Yonghong Song Cc: yuzhoujian Signed-off-by: Arnaldo Carvalho de Melo commit 70943490784222b3fd26f5604cba71abb4d7ee6d Author: Stephane Eranian Date: Tue May 5 11:29:43 2020 -0700 perf tools: Add optional support for libpfm4 This patch links perf with the libpfm4 library if it is available and LIBPFM4 is passed to the build. The libpfm4 library contains hardware event tables for all processors supported by perf_events. It is a helper library that helps convert from a symbolic event name to the event encoding required by the underlying kernel interface. This library is open-source and available from: http://perfmon2.sf.net. With this patch, it is possible to specify full hardware events by name. Hardware filters are also supported. Events must be specified via the --pfm-events and not -e option. Both options are active at the same time and it is possible to mix and match: $ perf stat --pfm-events inst_retired:any_p:c=1:i -e cycles .... One needs to explicitely ask for its inclusion by using the LIBPFM4 make command line option, ie its opt-in rather than opt-out of feature detection and build support. Signed-off-by: Stephane Eranian Reviewed-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Budankov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Florian Fainelli Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jin Yao Cc: Jiri Olsa Cc: Jiwei Sun Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian Link: http://lore.kernel.org/lkml/20200505182943.218248-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 82352ae28fc9118ff539fc4c9cd8d94428b258bf Author: Ed Maste Date: Thu May 28 17:08:59 2020 +0000 perf tools: Correct license on jsmn JSON parser This header is part of the jsmn JSON parser, introduced in 867a979a83. Correct the SPDX tag to indicate that it is under the MIT license. Signed-off-by: Ed Maste Acked-by: Andi Kleen Cc: Greg Kroah-Hartman Link: http://lore.kernel.org/lkml/20200528170858.48457-1-emaste@freefall.freebsd.org Signed-off-by: Arnaldo Carvalho de Melo commit 1e4bd2ae4564adbf9f9b6d26fad65ddabd0147fc Author: Nick Gasson Date: Thu May 28 13:19:16 2020 +0800 perf jit: Fix inaccurate DWARF line table Fix an issue where addresses in the DWARF line table are offset by -0x40 (GEN_ELF_TEXT_OFFSET). This can be seen with `objdump -S` on the ELF files after perf inject. Committer notes: Ian added this in his Acked-by reply: --- Without too much knowledge this looks good to me. The original code came from oprofile's jit support: https://sourceforge.net/p/oprofile/oprofile/ci/master/tree/opjitconv/debug_line.c#l325 --- Signed-off-by: Nick Gasson Acked-by: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200528051916.6722-1-nick.gasson@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 7d7e503cac31541e52ee4adb0185391ef74e1636 Author: Nick Gasson Date: Thu May 28 13:40:49 2020 +0800 perf jvmti: Remove redundant jitdump line table entries For each PC/BCI pair in the JVMTI compiler inlining record table, the jitdump plugin emits debug line table entries for every source line in the method preceding that BCI. Instead only emit one source line per PC/BCI pair. Reported by Ian Rogers. This reduces the .dump size for SPECjbb from ~230MB to ~40MB. Signed-off-by: Nick Gasson Acked-by: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200528054049.13662-1-nick.gasson@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 60da3a12c53ba60fc82b85cd4a7a5abc562cf936 Author: Arnaldo Carvalho de Melo Date: Fri May 29 11:42:00 2020 -0300 perf build: Add NO_SDT=1 to the default set of build tests We forgot to add it, so one would have to explicitely ask for it to be run, fix that by adding it to the set of tests that are performed by default when one does: $ make -C tools/perf build-test It was being exercised only in the make_minimal test, this patch makes it be tested in isolation, i.e. disabling only this feature. Fixes: e26e63be64a1 ("perf build: Add sdt feature detection") Cc: Adrian Hunter Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 69fbadbe987a7f9abbc8ac457a1057ebb98e21db Author: Arnaldo Carvalho de Melo Date: Fri May 29 11:38:41 2020 -0300 perf build: Add NO_LIBCRYPTO=1 to the default set of build tests We forgot to add it, so one would have to explicitely ask for it to be run, fix that by adding it to the set of tests that are performed by default when one does: $ make -C tools/perf build-test It was being exercised only in the make_minimal test, this patch makes it be tested in isolation, i.e. disabling only this feature. Fixes: 8ee4646038e4 ("perf build: Add libcrypto feature detection") Cc: Stephane Eranian Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 5bc7aac3e7ca08008b7681f0794deee275d356ac Author: Arnaldo Carvalho de Melo Date: Fri May 29 11:31:23 2020 -0300 perf build: Add NO_SYSCALL_TABLE=1 to the build tests So that we make sure that even on x86-64 and other architectures where that is the default method we test build the fallback to libaudit that other architectures use. I.e. now this line got added to: $ make -C tools/perf build-test make_no_syscall_tbl_O: cd . && make NO_SYSCALL_TABLE=1 FEATURES_DUMP=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP -j12 O=/tmp/tmp.W0HtKR1mfr DESTDIR=/tmp/tmp.lNezgCVPzW $ Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit a88f70de1b5024db75e8dab42bcce5d648d81957 Author: Arnaldo Carvalho de Melo Date: Fri May 29 11:11:59 2020 -0300 perf build: Remove libaudit from the default feature checks Ingo reported that the libaudit was always appearing as OFF: Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ OFF ] And everything seemed to work, i.e. we were checking for a feature that we don't use, causing confusion for people building perf, so work to remove that nuisance while making sure that it works when an arch doesn't provide the alternative method to generate the syscall id/name conversion tables. Longer explanation of the new modus operandi: $ make -C tools/perf O=/tmp/build/perf NO_SYSCALL_TABLE=1 Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libbfd: [ on ] ... libcap: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ on ] ... disassembler-four-args: [ on ] Makefile.config:665: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev GEN /tmp/build/perf/common-cmds.h MKDIR /tmp/build/perf/fd/ MKDIR /tmp/build/perf/fs/ $ The libaudit test is forced and it fails when audit-libs-devel isn't available: $ cat /tmp/build/perf/feature/test-libaudit.make.output test-libaudit.c:2:10: fatal error: libaudit.h: No such file or directory 2 | #include | ^~~~~~~~~~~~ compilation terminated. $ If we install audit-libs-devel and rebuild it continues not to be shown as OFF in the main auto-detection summary, but again gets tested and this time: $ rpm -q audit-libs-devel audit-libs-devel-3.0-0.15.20191104git1c2f876.fc31.x86_64 $ The make output for the feature detection comes clean: $ cat /tmp/build/perf/feature/test-libaudit.make.output And the feature detection binary is successfully built and is dynamicly linked with libaudit: $ ldd /tmp/build/perf/feature/test-libaudit.bin | grep audit libaudit.so.1 => /lib64/libaudit.so.1 (0x00007f5bf5177000) $ As well as the resulting perf binary: $ ldd /tmp/build/perf/perf | grep audit libaudit.so.1 => /lib64/libaudit.so.1 (0x00007fad511c7000) $ And 'perf trace' works using the libaudit method: $ sudo /tmp/build/perf/perf trace -e nanosleep sleep 1 0.000 (1000.067 ms): sleep/281872 nanosleep(rqtp: 0x7ffedbbe69d0) = 0 $ If we leave audit-libs-devel installed but don't disable the use of the best method, the one using SYSCALL_TABLE, the default for architectures that provide the script to build the syscall id/name mapping using the .tbl files copied from the kernel sources, we get: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf $ make -C tools/perf O=/tmp/build/perf Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libbfd: [ on ] ... libcap: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ on ] ... disassembler-four-args: [ on ] GEN /tmp/build/perf/common-cmds.h $ Again, no mention of libaudit being on or OFF and: $ cat /tmp/build/perf/feature/test-libaudit.make.output cat: /tmp/build/perf/feature/test-libaudit.make.output: No such file or directory $ We didn't even bother checking for its availability, slightly speeding up the build process and: $ ldd /tmp/build/perf/perf | grep libaudit $ We don't link with it, also: $ sudo /tmp/build/perf/perf trace -e nanosleep sleep 1 0.000 (1000.053 ms): sleep/299125 nanosleep(rqtp: 0x7ffc24611b50) = 0 $ And globs become available: $ sudo /tmp/build/perf/perf trace -e *sleep sleep 1 0.000 (1000.072 ms): sleep/299136 nanosleep(rqtp: 0x7ffe7a3c4ff0) = 0 $ Reported-by: Ingo Molnar Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit d21cb73a9025ffa9ef4f5a0d4051780c264fa02e Author: Arnaldo Carvalho de Melo Date: Thu May 28 17:21:29 2020 -0300 perf trace: Grow the syscall table as needed when using libaudit The audit-libs API doesn't provide a way to figure out what is the syscall with the greatest number/id, take that into account when using that method to go on growing the syscall table as we the syscalls go on appearing on the radar. With this the libaudit based method is back working, i.e. when building with: $ make NO_SYSCALL_TABLE=1 O=/tmp/build/perf -C tools/perf install-bin Auto-detecting system features: ... libaudit: [ on ] ... libbfd: [ on ] ... libcap: [ on ] $ ldd ~/bin/perf | grep audit libaudit.so.1 => /lib64/libaudit.so.1 (0x00007faef22df000) $ perf trace is back working, which makes it functional in arches other than x86_64, powerpc, arm64 and s390, that provides these generators: $ find tools/perf/arch/ -name "*syscalltbl*" tools/perf/arch/x86/entry/syscalls/syscalltbl.sh tools/perf/arch/arm64/entry/syscalls/mksyscalltbl tools/perf/arch/s390/entry/syscalls/mksyscalltbl tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl $ Example output forcing the libaudit method on x86_64: # perf trace -e file,nanosleep sleep 0.001 ? ( ): sleep/859090 ... [continued]: execve()) = 0 0.045 ( 0.005 ms): sleep/859090 access(filename: 0x8733e850, mode: R) = -1 ENOENT (No such file or directory) 0.055 ( 0.005 ms): sleep/859090 openat(dfd: CWD, filename: 0x8733ba29, flags: RDONLY|CLOEXEC) = 3 0.079 ( 0.005 ms): sleep/859090 openat(dfd: CWD, filename: 0x87345d20, flags: RDONLY|CLOEXEC) = 3 0.085 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483f58, count: 832) = 832 0.090 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483b50, count: 784) = 784 0.094 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483b20, count: 32) = 32 0.098 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483ad0, count: 68) = 68 0.109 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483a50, count: 784) = 784 0.113 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483730, count: 32) = 32 0.117 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483710, count: 68) = 68 0.320 ( 0.008 ms): sleep/859090 openat(dfd: CWD, filename: 0x872c3660, flags: RDONLY|CLOEXEC) = 3 0.372 ( 1.057 ms): sleep/859090 nanosleep(rqtp: 0x7ffd9d484ac0) = 0 # There are still some limitations when using the libaudit method, that will be fixed at some point, i.e., this works with the mksyscalltbl method but not with libaudit's: # perf trace -e file,*sleep sleep 0.001 event syntax error: '*sleep' \___ parser error Run 'perf list' for a list of valid events Usage: perf trace [] [] or: perf trace [] -- [] or: perf trace record [] [] or: perf trace record [] -- [] -e, --event event/syscall selector. use 'perf list' to list available events # Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit a9e8c1f85696057e35fc316af3ae7aa00ddb7522 Author: Arnaldo Carvalho de Melo Date: Thu May 28 17:19:17 2020 -0300 perf trace: Use zalloc() to make sure all fields are zeroed in the syscalltbl constructor In the past this wasn't needed as the libaudit based code would use just one field, and the alternative constructor would fill in all the fields, but now that even when using the libaudit based method we need the other fields, switch to zalloc() to make sure the other fields are zeroed at instantiation time. Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit db6b8cc8912a8c7688429b711292e7a923556776 Author: Arnaldo Carvalho de Melo Date: Thu May 28 17:12:16 2020 -0300 perf trace: Remove union from syscalltbl, all the fields are needed When we moved to a syscalltbl generated from the kernel syscall tables (arch/..../syscall*.tbl) the idea was to either use it, when having the generator (e.g. tools/perf/arch/x86/entry/syscalls/syscalltbl.sh), or falling back to the previous audit-libs based way of mapping syscall ids to strings and the other way around. At first we just needed the audit_detect_machine() return to then use it to the str->id/id->str, or the other fields for the now used by default in the most well developed arches method of using the syscall table generator. The problem is that then the libaudit code fell into disrepair, and architectures where it is the method used are not working. Now, with NO_SYSCALL_TABLE=1 being possible to pass on the make command line we can automate the testing of that method even on x86-64, arm64, etc. And doing it I noted that we actually use fields in both entries in the union, oops, so ditch the union, as we need all those fields at the same time. Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 43de3869b5164c85f536297c24d0e7eba8e75120 Author: Arnaldo Carvalho de Melo Date: Thu May 28 12:03:40 2020 -0300 perf build: Allow explicitely disabling the NO_SYSCALL_TABLE variable This is useful to see if, on x86, the legacy libaudit still works, as it is used in architectures that don't have the SYSCALL_TABLE logic and we want to have it tested in 'make -C tools/perf/ build-test'. E.g.: Without having audit-libs-devel installed: $ make NO_SYSCALL_TABLE=1 O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j12' parallel build Auto-detecting system features: ... libaudit: [ OFF ] ... libbfd: [ on ] ... libcap: [ on ] Makefile.config:664: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev After installing it: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf $ time make NO_SYSCALL_TABLE=1 O=/tmp/build/perf -C tools/perf install-bin ; perf test python make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j12' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h' diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h Warning: Kernel ABI header at 'tools/perf/util/hashmap.c' differs from latest version at 'tools/lib/bpf/hashmap.c' diff -u tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c Auto-detecting system features: ... libaudit: [ on ] ... libbfd: [ on ] ... libcap: [ on ] $ ldd ~/bin/perf | grep audit libaudit.so.1 => /lib64/libaudit.so.1 (0x00007fc18978e000) $ Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Ingo Molnar Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20200529155552.463-3-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 830f5ce266ce79e18f0026c36c99319b1bc08e1b Author: Dan Carpenter Date: Fri May 29 13:02:07 2020 +0300 net: phy: marvell: unlock after phy_select_page() failure We need to call phy_restore_page() even if phy_select_page() fails. Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement is documented at the start of the phy_select_page() function. Fixes: a618e86da91d ("net : phy: marvell: Speedup TDR data retrieval by only changing page once") Signed-off-by: Dan Carpenter Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 9b90d9734ab72292de080a6e2a46f037994e0fb9 Author: Arnaldo Carvalho de Melo Date: Thu May 28 11:47:24 2020 -0300 perf build: Group the NO_SYSCALL_TABLE logic To help in allowing to disable it from the make command line. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20200529155552.463-2-acme@kernel.org [ Fixed the logic for the filter part, it should be ifeq, not ifneq ] Signed-off-by: Arnaldo Carvalho de Melo commit 2684bda34786b6ae0944a4bacb7f59b5955979a8 Author: Antoine Tenart Date: Fri May 29 11:49:09 2020 +0200 net: phy: mscc: fix PHYs using the vsc8574_probe PHYs using the vsc8574_probe fail to be initialized and their config_init return -EIO leading to errors like: "could not attach PHY: -5". This is because when the conversion of the MSCC PHY driver to use the shared PHY package helpers was done, the base address retrieval and the base PHY read and write helpers in the driver were modified. In particular, the base address retrieval logic was moved from the config_init to the probe. But the vsc8574_probe was forgotten. This patch fixes it. Fixes: deb04e9c0ff2 ("net: phy: mscc: use phy_package_shared") Signed-off-by: Antoine Tenart Reviewed-by: Michael Walle Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 09b547a7996e77d4141de27c1657d7c3adcb478e Author: Bartosz Golaszewski Date: Fri May 29 10:26:48 2020 +0200 net: ethernet: mtk-star-emac: remove unused variable The desc pointer is set but not used. Remove it. Reported-by: kbuild test robot Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit cdde95bc8952b57bc446fb90278a8ba83dd57c6f Merge: 36432797641f 6a3faa4d7e01 Author: David S. Miller Date: Fri May 29 12:17:45 2020 -0700 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2020-05-28 This series contains updates to e1000, e1000e, igc, igb, ixgbe and i40e. Takashi Iwai, from SUSE, replaces some uses of snprintf() with scnprintf() since the succeeding calls may go beyond the given buffer limit in i40e. Jesper Dangaard Brouer fixes up code comments in i40e_xsk.c Xie XiuQi, from Huawei, fixes a signed-integer-overflow warning ixgbe driver. Jason Yan, from Huawei, converts '==' expression to bool to resolve warnings, also fixed a warning for assigning 0/1 to a bool variable in the ixgbe driver. Converts functions that always return 0 to void in the igb and i40e drivers. YueHaibing, from Hauwei, cleans up dead code in ixgbe driver. Sasha cleans up more dead code which is not used in the igc driver. Added receive error counter to reflect the total number of non-filtered packets received with errors. Fixed a register define name to properly reflect the register address being used. Andre updates the igc driver to reject NFC rules that have multiple matches, which is not supported in i225 devices. Updates the total number of NFC rules supported and added a code comment to explain what is supported. Punit Agrawal, from Toshiba, relaxes the condition to trigger a reset for ME, which was leading to inconsistency between the state of the hardware as expected by the driver in e1000e. Hari, from the Linux community, cleaned up a code comment in the e1000 driver. ==================== Signed-off-by: David S. Miller commit 36432797641ff0013be9252eecf7ad1ba73171a2 Author: Ronak Doshi Date: Thu May 28 19:53:52 2020 -0700 vmxnet3: use correct hdr reference when packet is encapsulated 'Commit dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support")' added support for encapsulation offload. However, while preparing inner tso packet, it uses reference to outer ip headers. This patch fixes this issue by using correct reference for inner headers. Fixes: dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support") Signed-off-by: Ronak Doshi Signed-off-by: David S. Miller commit c7ff819aefea04944dfcec5f0731b97277df6a9c Author: Yamin Friedman Date: Wed May 27 11:34:53 2020 +0300 RDMA/core: Introduce shared CQ pool API Allow a ULP to ask the core to provide a completion queue based on a least-used search on a per-device CQ pools. The device CQ pools grow in a lazy fashion when more CQs are requested. This feature reduces the amount of interrupts when using many QPs. Using shared CQs allows for more effcient completion handling. It also reduces the amount of overhead needed for CQ contexts. Test setup: Intel(R) Xeon(R) Platinum 8176M CPU @ 2.10GHz servers. Running NVMeoF 4KB read IOs over ConnectX-5EX across Spectrum switch. TX-depth = 32. The patch was applied in the nvme driver on both the target and initiator. Four controllers are accessed from each core. In the current test case we have exposed sixteen NVMe namespaces using four different subsystems (four namespaces per subsystem) from one NVM port. Each controller allocated X queues (RDMA QPs) and attached to Y CQs. Before this series we had X == Y, i.e for four controllers we've created total of 4X QPs and 4X CQs. In the shared case, we've created 4X QPs and only X CQs which means that we have four controllers that share a completion queue per core. Until fourteen cores there is no significant change in performance and the number of interrupts per second is less than a million in the current case. ================================================== |Cores|Current KIOPs |Shared KIOPs |improvement| |-----|---------------|--------------|-----------| |14 |2332 |2723 |16.7% | |-----|---------------|--------------|-----------| |20 |2086 |2712 |30% | |-----|---------------|--------------|-----------| |28 |1971 |2669 |35.4% | |================================================= |Cores|Current avg lat|Shared avg lat|improvement| |-----|---------------|--------------|-----------| |14 |767us |657us |14.3% | |-----|---------------|--------------|-----------| |20 |1225us |943us |23% | |-----|---------------|--------------|-----------| |28 |1816us |1341us |26.1% | ======================================================== |Cores|Current interrupts|Shared interrupts|improvement| |-----|------------------|-----------------|-----------| |14 |1.6M/sec |0.4M/sec |72% | |-----|------------------|-----------------|-----------| |20 |2.8M/sec |0.6M/sec |72.4% | |-----|------------------|-----------------|-----------| |28 |2.9M/sec |0.8M/sec |63.4% | ==================================================================== |Cores|Current 99.99th PCTL lat|Shared 99.99th PCTL lat|improvement| |-----|------------------------|-----------------------|-----------| |14 |67ms |6ms |90.9% | |-----|------------------------|-----------------------|-----------| |20 |5ms |6ms |-10% | |-----|------------------------|-----------------------|-----------| |28 |8.7ms |6ms |25.9% | |=================================================================== Performance improvement with sixteen disks (sixteen CQs per core) is comparable. Link: https://lore.kernel.org/r/1590568495-101621-3-git-send-email-yaminf@mellanox.com Signed-off-by: Yamin Friedman Reviewed-by: Or Gerlitz Reviewed-by: Max Gurtovoy Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 164c05f03ffabe36564cb8959c1fad7c56f294dd Author: Serge Semin Date: Fri May 29 21:25:43 2020 +0300 spi: Convert DW SPI binding to DT schema Modern device tree bindings are supposed to be created as YAML-files in accordance with dt-schema. This commit replaces two DW SPI legacy bare text bindings with YAML file. As before the bindings file states that the corresponding dts node is supposed to be compatible either with generic DW APB SSI controller or with Microsemi/Amazon/Renesas/Intel vendors-specific controllers, to have registers, interrupts and clocks properties. Though in case of Microsemi version of the controller there must be two registers resources specified. Properties like clock-names, reg-io-width, cs-gpio, num-cs, DMA and slave device sub-nodes are optional. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Feng Tang Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Link: https://lore.kernel.org/r/20200529182544.9807-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 3d7db0f11c7ad19979a1a01cac1d379ff040e886 Author: Andy Shevchenko Date: Fri May 29 21:31:50 2020 +0300 spi: dw: Refactor mid_spi_dma_setup() to separate DMA and IRQ config It's better to understand what bits are set for DMA and for IRQ handling in mid_spi_dma_setup() if they are grouped accordingly. Thus, refactor mid_spi_dma_setup() to separate DMA and IRQ configuration. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200529183150.44149-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit b3f82dc26c0d4e1348ef81e0189cb8838b8b0d22 Author: Andy Shevchenko Date: Fri May 29 21:31:49 2020 +0300 spi: dw: Make DMA request line assignments explicit for Intel Medfield The 2afccbd283ae ("spi: dw: Discard static DW DMA slave structures") did a clean up of global variables, which is fine, but messed up with the carefully provided information in the custom DMA slave structures. There reader can find an assignment of the DMA request lines in use. Partially revert the above mentioned commit to restore readability and maintainability of the code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200529183150.44149-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 3446cbd2d523fdaf37f3772082071d1154c419d9 Author: Yamin Friedman Date: Wed May 27 11:34:52 2020 +0300 RDMA/core: Add protection for shared CQs used by ULPs A pre-step for adding shared CQs. Add the infrastructure to prevent shared CQ users from altering the CQ configurations. For now all cqs are marked as private (non-shared). The core driver should use the new force functions to perform resize/destroy/moderation changes that are not allowed for users of shared CQs. Link: https://lore.kernel.org/r/1590568495-101621-2-git-send-email-yaminf@mellanox.com Signed-off-by: Yamin Friedman Reviewed-by: Or Gerlitz Reviewed-by: Max Gurtovoy Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0b8e125e213204508e1b3c4bdfe69713280b7abd Author: Qiushi Wu Date: Wed May 27 22:02:30 2020 -0500 RDMA/core: Fix several reference count leaks. kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous commit b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject") fixed a similar problem. Link: https://lore.kernel.org/r/20200528030231.9082-1-wu000273@umn.edu Signed-off-by: Qiushi Wu Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit bcafcdfdaee7665267e56990e8040fbab588550f Author: Colin Ian King Date: Thu May 28 12:07:09 2020 +0100 IB/hfi1: Fix spelling mistake "enought" -> "enough" There is a spelling mistake in an error message. Fix it. Link: https://lore.kernel.org/r/20200528110709.400935-1-colin.king@canonical.com Signed-off-by: Colin Ian King Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit ffd7339a2fac98b9ff731e336c4411bf1ce57e22 Author: Jason Gunthorpe Date: Wed May 27 14:18:45 2020 -0300 RDMA/core: Use offsetofend() instead of open coding No reason to open code this. Link: https://lore.kernel.org/r/0-v1-0bc346e08476+585-drop_offsetofend_jgg@mellanox.com Signed-off-by: Jason Gunthorpe commit 8d485da0ddee79d0e6713405694253d401e41b93 Author: Matthew Garrett Date: Mon Apr 13 19:09:53 2020 -0700 thermal/int340x_thermal: Don't require IDSP to exist The IDSP method doesn't appear to exist on the most recent Intel platforms: instead, the IDSP data is included in the GDDV blob. Since we probably don't want to decompress and parse that in-kernel, just allow any UUID to be written if IDSP is missing. Signed-off-by: Matthew Garrett Tested-by: Pandruvada, Srinivas [ rzhang: fix checkpatch warning in changelog ] Signed-off-by: Zhang Rui Link: https://lore.kernel.org/r/20200414020953.255364-3-matthewgarrett@google.com commit 006f006f1e5c48e5ddd6515eab2c9a7b27ce1144 Author: Matthew Garrett Date: Mon Apr 13 19:09:52 2020 -0700 thermal/int340x_thermal: Export OEM vendor variables The platform vendor may expose an array of OEM-specific values to be used in determining DPTF policy. These are obtained via the ODVP method, and then simply exposed in sysfs. In addition, they are updated when a notification is received or when the DPTF policy is changed by userland. Conflicts: drivers/thermal/intel/int340x_thermal/int3400_thermal.c Signed-off-by: Matthew Garrett Tested-by: Pandruvada, Srinivas Signed-off-by: Zhang Rui Link: https://lore.kernel.org/r/20200414020953.255364-2-matthewgarrett@google.com commit 0ba13c763aacb27ab32bde5d559bf40e88465921 Author: Matthew Garrett Date: Mon Apr 13 19:09:51 2020 -0700 thermal/int340x_thermal: Export GDDV Implementing DPTF properly requires making use of firmware-provided information associated with the INT3400 device. Calling GDDV provides a buffer of information which userland can then interpret to determine appropriate DPTF policy. Conflicts: drivers/thermal/intel/int340x_thermal/int3400_thermal.c Signed-off-by: Matthew Garrett Tested-by: Pandruvada, Srinivas Signed-off-by: Zhang Rui Link: https://lore.kernel.org/r/20200414020953.255364-1-matthewgarrett@google.com commit 47fa116e5faec894f6238f87322c01dd41d21e23 Author: Yuantian Tang Date: Tue May 26 14:02:12 2020 +0800 thermal: qoriq: Update the settings for TMUv2 For TMU v2, TMSAR registers need to be set properly to get the accurate temperature values. Also the temperature read needs to be converted to degree Celsius since it is in degrees Kelvin. Signed-off-by: Yuantian Tang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200526060212.4118-1-andy.tang@nxp.com commit 48062b0a8ba0e0d7da2a96fe53028b7474e2dd26 Author: Colin Ian King Date: Thu May 28 16:04:27 2020 +0100 RDMA/hns: remove duplicate assignment to pointer raq The pointer raq is being assigned twice. Fix this by removing one of the redundant assignments. Fixes: 14ba87304bf9 ("RDMA/hns: Remove redundant type cast for general pointers") Link: https://lore.kernel.org/r/20200528150427.420624-1-colin.king@canonical.com Addressses-Coverity: ("Evaluation order violation") Signed-off-by: Colin Ian King Signed-off-by: Jason Gunthorpe commit 802dcc7fc5ec0932bea0f33db046cc744aecf233 Author: Mark Zhang Date: Wed May 27 08:50:14 2020 +0300 RDMA/mlx5: Support TX port affinity for VF drivers in LAG mode The mlx5 VF driver doesn't set QP tx port affinity because it doesn't know if the lag is active or not, since the "lag_active" works only for PF interfaces. In this case for VF interfaces only one lag is used which brings performance issue. Add a lag_tx_port_affinity CAP bit; When it is enabled and "num_lag_ports > 1", then driver always set QP tx affinity, regardless of lag state. Link: https://lore.kernel.org/r/20200527055014.355093-1-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 14ed1c908a7a623cc0cbf0203f8201d1b7d31d16 Author: Harry Wentland Date: Thu May 28 09:44:44 2020 -0400 Revert "drm/amd/display: disable dcn20 abm feature for bring up" This reverts commit 96cb7cf13d8530099c256c053648ad576588c387. This change was used for DCN2 bringup and is no longer desired. In fact it breaks backlight on DCN2 systems. Cc: Alexander Monakov Cc: Hersen Wu Cc: Anthony Koo Cc: Michael Chiu Signed-off-by: Harry Wentland Acked-by: Alex Deucher Reviewed-by: Nicholas Kazlauskas Reported-and-tested-by: Alexander Monakov Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit cc831b9781e871e2bde00e9ae0041152139ee304 Author: Evan Quan Date: Tue May 12 19:06:37 2020 +0800 drm/amd/powerplay: ack the SMUToHost interrupt on receive V2 There will be no further interrupt without proper ack for current one. V2: fix typo to really set ACK bit only Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9271dfd9e0f79e2969dcbe28568bce0fdc4f8f73 Author: Alex Deucher Date: Sun May 24 02:46:53 2020 -0400 drm/amdgpu/pm: return an error during GPU reset or suspend (v2) Return an error for sysfs and debugfs power interfaces during gpu reset and suspend. Prevents access to the hw while it may be in an unusable state. v2: squash in fix to drop suspend check Acked-by: Nirmoy Das Signed-off-by: Alex Deucher commit e0cca8b456e2319804c9187f237268b14c50d323 Author: Bart Van Assche Date: Mon May 25 10:22:12 2020 -0700 RDMA/srpt: Increase max_send_sge The ib_srpt driver limits max_send_sge to 16. Since that is a workaround for an mlx4 bug that has been fixed, increase max_send_sge. See also commit f95ccffc715b ("IB/mlx4: Use 4K pages for kernel QP's WQE buffer"). Link: https://lore.kernel.org/r/20200525172212.14413-5-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 66ced2eb2ab95f6ebe8033e2e0a2e61f2615377c Author: Bart Van Assche Date: Mon May 25 10:22:11 2020 -0700 RDMA/srpt: Reduce max_recv_sge to 1 Since srpt_post_recv() always sets num_sge to 1, reduce the max_recv_sge parameter that is used at queue pair allocation time to 1. Link: https://lore.kernel.org/r/20200525172212.14413-4-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit d4ee7f3a4445ec1b0b88af216f4032c4d30abf5a Author: Bart Van Assche Date: Mon May 25 10:22:10 2020 -0700 RDMA/srpt: Make debug output more detailed Since the session name by itself is not sufficient to uniquely identify a queue pair, include the queue pair number. Show the ASCII channel state name instead of the numeric value. This change makes the ib_srpt debug output more consistent. Link: https://lore.kernel.org/r/20200525172212.14413-3-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 87fee61c35133e41f28facf856e0481cbf1bb2bd Author: Bart Van Assche Date: Mon May 25 10:22:09 2020 -0700 RDMA/srp: Make the channel count configurable per target Increase the flexibility of the SRP initiator driver by making the channel count configurable per target instead of only providing a kernel module parameter for configuring the channel count. Link: https://lore.kernel.org/r/20200525172212.14413-2-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit d62069c22eda3caeca97f6713a9ed2662ef1346d Author: Mark Brown Date: Fri May 29 18:48:46 2020 +0100 spi: bcm2835: Remove shared interrupt support This reverts commit ecfbd3cf3b8b since Lukas Wunner noticed that we start operating on the hardware before we check to see if this is a spurious interrupt. Reported-by: Lukas Wunner Signed-off-by: Mark Brown commit 6bb986e940dcb3aa400a59028747b27c29ab8a52 Merge: 5cf2740f1d45 e6d4318c0495 Author: Kalle Valo Date: Fri May 29 20:43:07 2020 +0300 Merge tag 'iwlwifi-next-for-kalle-2020-05-29' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next Third set of iwlwifi patches intended for v5.8 * Update range request API; * Add ACPI DSM support; * Support enabling 5.2GHz bands in Indonesia via ACPI; * Bump FW API version to 56; * TX queues refactoring started; * Fix one memory leak; * Some other small fixes and clean-ups; # gpg: Signature made Fri 29 May 2020 10:38:28 AM EEST using RSA key ID 1A3CC5FA # gpg: Good signature from "Luciano Roth Coelho (Luca) " # gpg: aka "Luciano Roth Coelho (Intel) " commit 5cf2740f1d45f9e17061059812d819c512bba3b8 Merge: 982d7287f8da d9045b18cd44 Author: Kalle Valo Date: Fri May 29 20:42:30 2020 +0300 Merge tag 'mt76-for-kvalo-2020-05-28' of https://github.com/nbd168/wireless mt76 patches for 5.8 * fixes for sparse warnings * DBDC fixes * mt7663 remain-on-channel support * mt7915 spatial reuse support * mt7915 radiotap fix * station wcid allocation fix * mt7663 powersave fix * mt7663 scan fix * mt7611n support * cleanup # gpg: Signature made Thu 28 May 2020 07:02:21 PM EEST using DSA key ID 02A76EF5 # gpg: Good signature from "Felix Fietkau " # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 75D1 1A7D 91A7 710F 4900 42EF D77D 141D 02A7 6EF5 commit 32215469489ad2ad5139ab6fb779c9edfd61618d Author: Dongli Zhang Date: Fri May 29 10:31:08 2020 -0700 null_blk: force complete for timeout request The commit 7b11eab041da ("blk-mq: blk-mq: provide forced completion method") exports new API to force a request to complete without error injection. There should be no error injection when completing a request by timeout handler. Otherwise, the below would hang because timeout handler is failed. echo 100 > /sys/kernel/debug/fail_io_timeout/probability echo 1000 > /sys/kernel/debug/fail_io_timeout/times echo 1 > /sys/block/nullb0/io-timeout-fail dd if=/dev/zero of=/dev/nullb0 bs=512 count=1 oflag=direct With this patch, the timeout handler is able to complete the IO. Signed-off-by: Dongli Zhang Signed-off-by: Jens Axboe commit 982d7287f8dad2d5e1c57dc84aca83128e787666 Author: Pali Rohár Date: Thu May 21 14:35:59 2020 +0200 mwifiex: Add support for NL80211_ATTR_MAX_AP_ASSOC_STA SD8997 firmware sends TLV_TYPE_MAX_CONN with struct hw_spec_max_conn to inform kernel about maximum number of p2p connections and stations in AP mode. During initialization of SD8997 wifi chip kernel prints warning: mwifiex_sdio mmc0:0001:1: Unknown GET_HW_SPEC TLV type: 0x217 This patch adds support for parsing TLV_TYPE_MAX_CONN (0x217) and sets appropriate cfg80211 member 'max_ap_assoc_sta' from retrieved structure. It allows userspace to retrieve NL80211_ATTR_MAX_AP_ASSOC_STA attribute. Signed-off-by: Pali Rohár Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200521123559.29028-1-pali@kernel.org commit 86cffb2c0a59d72f66060253e123154416618fa2 Author: Pali Rohár Date: Thu May 21 14:34:44 2020 +0200 mwifiex: Parse all API_VER_ID properties During initialization of SD8997 wifi chip kernel prints warnings: mwifiex_sdio mmc0:0001:1: Unknown api_id: 3 mwifiex_sdio mmc0:0001:1: Unknown api_id: 4 This patch adds support for parsing all api ids provided by SD8997 firmware. Signed-off-by: Pali Rohár Acked-by: Ganapathi Bhat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200521123444.28957-1-pali@kernel.org commit f99e24a6778a065dad732b916b2648352609c79a Author: Thomas Ebeling Date: Fri May 29 19:32:56 2020 +0200 ALSA: usb-audio: Fixing usage of plain int instead of NULL As reported by kbuild test robot, mixer quirks for RME Babyface Pro used plain integer instead of NULL. Fixes: 3e8f3bd04716 ("ALSA: usb-audio: RME Babyface Pro mixer patch") Signed-off-by: Thomas Ebeling Reported-by: kbuild test robot Link: https://lore.kernel.org/r/20200529173248.zzawijfvw73kzjxt@bollie.ca9.eu Signed-off-by: Takashi Iwai commit 11e7a91994c29da96d847f676be023da6a2c1359 Author: Dan Carpenter Date: Wed May 27 21:48:30 2020 +0300 airo: Fix read overflows sending packets The problem is that we always copy a minimum of ETH_ZLEN (60) bytes from skb->data even when skb->len is less than ETH_ZLEN so it leads to a read overflow. The fix is to pad skb->data to at least ETH_ZLEN bytes. Cc: Reported-by: Hu Jiahui Signed-off-by: Dan Carpenter Reviewed-by: Eric Dumazet Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200527184830.GA1164846@mwanda commit 113a57a400a2d4974448760464f6443d52a1e498 Author: Double Lo Date: Thu May 28 22:49:38 2020 -0500 brcmfmac: 43012 Update MES Watermark Set MES watermark size to 0x50 for 43012. It fixes SDIO bus hang issue when running at high throughput. Signed-off-by: Double Lo Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529034938.124533-6-chi-hsien.lin@cypress.com commit df18c257bd6a3fe1906a9c87bcb0bb30cf87ef64 Author: Wright Feng Date: Thu May 28 22:49:37 2020 -0500 brcmfmac: fix 43455 CRC error under SDIO 3.0 SDR104 mode This patch fixes 43455 CRC error while running throughput test with suspend/resume stress test. The continuous failure messages before system crash: brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529034938.124533-5-chi-hsien.lin@cypress.com commit 2bee41270f3bafe475dd2cfe28fcc3f1ed6ab6ee Author: Frank Kao Date: Thu May 28 22:49:36 2020 -0500 brcmfmac: set F2 blocksize and watermark for 4354/4356 SDIO Set F2 blocksize to 256 bytes and watermark to 0x40 for 4354/4356 SDIO. Also enable and configure F1 MesBusyCtrl. It would resolve random driver crash issue. Signed-off-by: Frank Kao Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529034938.124533-4-chi-hsien.lin@cypress.com commit 528158a8d4522bed5a35bb1a942638a79bca6acd Author: Double Lo Date: Thu May 28 22:49:35 2020 -0500 brcmfmac: fix 4339 CRC error under SDIO 3.0 SDR104 mode This patch fixes 4339 CRC error while running Tput test with suspend/resume test script. The continuous failure messages before system crash: brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame Signed-off-by: Double Lo Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529034938.124533-3-chi-hsien.lin@cypress.com commit 2a7621ded321dfd70b5349bbfcd1af9e9df1f197 Author: Wright Feng Date: Thu May 28 22:49:34 2020 -0500 brcmfmac: set F2 blocksize for 4373 Set F2 blocksize to 256 bytes for 4373. It fixes DMA error while having UDP bi-directional traffic. Also use a defined F1 MesBusyCtrl value. Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529034938.124533-2-chi-hsien.lin@cypress.com commit da74b6933b3ba27c88fa0b7ccbd019e4f41ebfd4 Author: Dinghao Liu Date: Fri May 22 12:49:04 2020 +0800 wlcore: fix runtime pm imbalance in wlcore_irq_locked When wlcore_fw_status() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. It's the same for all error paths after wlcore_fw_status(). Signed-off-by: Dinghao Liu Acked-by: Tony Lindgren Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200522044906.29564-1-dinghao.liu@zju.edu.cn commit 7967af8de39d4572da2d15dfa12b1b08810d60a9 Author: Chien-Hsun Liao Date: Fri May 22 17:12:34 2020 +0800 rtw88: 8822c: remove CCK TX setting when switch channel The CCK TX setting when switch channel will fix the CCK to path A only, so if the antenna is configured to path B (e.g. iw phy set antenna 0x2 0x3 "TX B/RX AB"), then the CCK packets can never be delivered to the air if only path B is connected with an antenna (it can possibly be transmitted through path A, but as path B is configured, the expected behavior is incorrect). This can also solve the racing issue of CCK TX setting between driver and firmware. The CCK TX setting in driver should be removed. Otherwise, the CCK TX setting would be wrong when the racing occurs. Fixes: 297bcf8222f2 ("rtw88: add support for set/get antennas") Signed-off-by: Chien-Hsun Liao Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200522091234.24495-1-yhchuang@realtek.com commit 4e1a341580f2e51f7d1c992b50c28a6c4a242f7f Author: Yan-Hsuan Chuang Date: Fri May 22 11:55:21 2020 +0800 rtw88: 8822c: fix missing brace warning for old compilers For older versions of gcc, the array = {0}; will cause warnings: drivers/net/wireless/realtek/rtw88/rtw8822c.c: In function 'rtw8822c_power_trim': >> drivers/net/wireless/realtek/rtw88/rtw8822c.c:1039:2: warning: >> missing braces around initializer [-Wmissing-braces] s8 bb_gain[2][8] = {0}; ^ drivers/net/wireless/realtek/rtw88/rtw8822c.c:1039:2: warning: (near initialization for 'bb_gain[0]') [-Wmissing-braces] Fixes: 5ad4d8957b69 ("rtw88: set power trim according to efuse PG values") Reported-by: kbuild test robot Signed-off-by: Yan-Hsuan Chuang Acked-by: Sebastian Andrzej Siewior Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200522035521.12295-1-yhchuang@realtek.com commit 7a242fb69821ea428b89e381de63624abea68568 Author: Ping-Ke Shih Date: Fri May 29 10:50:09 2020 +0800 rtw88: fix EAPOL 4-way failure by finish IQK earlier Connecting to an AP with WPA2 security may fail. The IQK and the EAPOL 4-way handshake may overlap because the driver does IQK right after assoc success. For 802.11n devices, the IQK is done in the driver and it could require more than 100ms to complete. During IQK, any TX/RX events are paused. So if the EAPOL 4-way handshake started before IQK finished, then the 1/4 and 2/4 part of the handshake could be dropped. The AP will then issue deauth with reason IEEE8021X_FAILED (23). To resolve this, move IQK routine into managed TX prepare (ieee80211_ops::mgd_prepare_tx()). The callback is called before the managed frames (auth/assoc) are sent. This will make sure that the IQK is completed before the handshake starts. But don't do IQK during scanning because doing it on each channel will take too long. For 802.11ac devices, the IQK is done in firmware and it takes less time to complete. Therefore we don't see a failure during the EAPOL 4-way handshake. But it is still worth moving the IQK into ieee80211_ops::mgd_prepare_tx(). Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile") Tested-by: You-Sheng Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529025009.2468-4-yhchuang@realtek.com commit 2647d2827f2af6e054742f687cb21efaccab44f0 Author: Ping-Ke Shih Date: Fri May 29 10:50:08 2020 +0800 rtw88: coex: 8723d: handle BT inquiry cases Coex mechanism used to make BT have higher priority and more time to transfer data when BT inquiry-page, which leads to poor WiFi performance. Should take WiFi traffic into consideration. If the WiFi is having heavy traffic, use another parameter to make sure WiFi has more chance to TX/RX, while guarantee the priority of BT for inquiry. If the WiFi isn't busy (connected or not), set proper parameter to fix originals. Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile") Tested-by: You-Sheng Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529025009.2468-3-yhchuang@realtek.com commit efad661168c7f4c309f17b773ba2017b85348e9b Author: Ping-Ke Shih Date: Fri May 29 10:50:07 2020 +0800 rtw88: coex: 8723d: set antanna control owner Without setting antenna control owner, the WiFi could be disconnected if the BT has traffic. Because the antenna is switched to BT side for its traffic, and the WiFi will have no chance to transfer data. Set control owner to prevent WiFi disconnect issue. Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile") Tested-by: You-Sheng Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200529025009.2468-2-yhchuang@realtek.com commit 53df5271f2397706be85c3892246e3e726113902 Author: Dinghao Liu Date: Wed May 20 21:08:04 2020 +0800 wlcore: fix runtime pm imbalance in __wl1271_op_remove_interface When wl12xx_cmd_role_disable() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu Acked-by: Tony Lindgren Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520130806.14789-1-dinghao.liu@zju.edu.cn commit 3e69ed2b52fd0eeb1e812e20a667316d913e6a97 Author: Dinghao Liu Date: Wed May 20 20:57:22 2020 +0800 wlcore: fix runtime pm imbalance in wl1271_op_suspend When wlcore_hw_interrupt_notify() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu Acked-by: Tony Lindgren Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520125724.12832-1-dinghao.liu@zju.edu.cn commit 282a04bf1d8029eb98585cb5db3fd70fe8bc91f7 Author: Dinghao Liu Date: Wed May 20 20:46:47 2020 +0800 wlcore: fix runtime pm imbalance in wlcore_regdomain_config pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Acked-by: Tony Lindgren Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520124649.10848-1-dinghao.liu@zju.edu.cn commit 9604617e998b49f7695fea1479ed82421ef8c9f0 Author: Dinghao Liu Date: Wed May 20 20:42:38 2020 +0800 wlcore: fix runtime pm imbalance in wl1271_tx_work There are two error handling paths in this functon. When wlcore_tx_work_locked() returns an error code, we should decrease the runtime PM usage counter the same way as the error handling path beginning from pm_runtime_get_sync(). Signed-off-by: Dinghao Liu Acked-by: Tony Lindgren Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520124241.9931-1-dinghao.liu@zju.edu.cn commit 89d73ccab20a684d8446cea4d8ac6a2608c8d390 Author: Kai Vehmanen Date: Fri May 29 19:03:58 2020 +0300 ASoC: SOF: Intel: hda: fix generic hda codec support Add support for using generic codec driver with SOF. Generic driver is used if: - snd_sof_intel_hda_common.hda_model="generic" is set, or - fallback if no other codec driver is found The implementation is aligned with snd-hda-intel driver, and fixes audio support for systems like Acer Swift 3 SF314-57G, on which this issue was originally reported. Signed-off-by: Kai Vehmanen Reviewed-by: Hui Wang Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart BugLink: https://github.com/thesofproject/linux/issues/1807 BugLink: https://bugs.launchpad.net/bugs/1877757 Link: https://lore.kernel.org/r/20200529160358.12134-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit e78e5d18c65362a0e6ca383fad88ef950293fc2c Author: Pascal Terjan Date: Sat May 23 22:27:35 2020 +0100 atmel: Use shared constant for rfc1042 header This is one of the 9 drivers redefining rfc1042_header. Signed-off-by: Pascal Terjan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200523212735.32364-1-pterjan@google.com commit 729ef6b614a14043355c3e35569c62e08e1b9629 Author: Pascal Terjan Date: Sat May 23 22:26:28 2020 +0100 libertas: Use shared constant for rfc1042 header This is one of the 9 drivers redefining rfc1042_header. Signed-off-by: Pascal Terjan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200523212628.31526-1-pterjan@google.com commit 83cee4e625f8344a55b197e2bf9713088e571375 Author: Pali Rohár Date: Wed May 20 14:54:10 2020 +0200 cw1200: Remove local sdio VENDOR and DEVICE id definitions They are already present in linux/mmc/sdio_ids.h. Signed-off-by: Pali Rohár Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520125410.31757-1-pali@kernel.org commit 6a29d134c04a8acebb7a95251acea7ad7abba106 Author: Larry Finger Date: Tue May 26 10:59:09 2020 -0500 b43_legacy: Fix connection problem with WPA3 Since the driver was first introduced into the kernel, it has only handled the ciphers associated with WEP, WPA, and WPA2. It fails with WPA3 even though mac80211 can handle those additional ciphers in software, b43legacy did not report that it could handle them. By setting MFP_CAPABLE using ieee80211_set_hw(), the problem is fixed. With this change, b43legacy will handle the ciphers it knows in hardware, and let mac80211 handle the others in software. It is not necessary to use the module parameter NOHWCRYPT to turn hardware encryption off. Although this change essentially eliminates that module parameter, I am choosing to keep it for cases where the hardware is broken, and software encryption is required for all ciphers. Signed-off-by: Larry Finger Cc: Stable Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200526155909.5807-3-Larry.Finger@lwfinger.net commit 75d057bda1fbca6ade21378aa45db712e5f7d962 Author: Larry Finger Date: Tue May 26 10:59:08 2020 -0500 b43: Fix connection problem with WPA3 Since the driver was first introduced into the kernel, it has only handled the ciphers associated with WEP, WPA, and WPA2. It fails with WPA3 even though mac80211 can handle those additional ciphers in software, b43 did not report that it could handle them. By setting MFP_CAPABLE using ieee80211_set_hw(), the problem is fixed. With this change, b43 will handle the ciphers it knows in hardware, and let mac80211 handle the others in software. It is not necessary to use the module parameter NOHWCRYPT to turn hardware encryption off. Although this change essentially eliminates that module parameter, I am choosing to keep it for cases where the hardware is broken, and software encryption is required for all ciphers. Reported-and-tested-by: Rui Salvaterra Signed-off-by: Larry Finger Cc: Stable Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200526155909.5807-2-Larry.Finger@lwfinger.net commit d3b780da511d5a20ef0524f2112122d09d9f1d85 Author: Olivier Sobrie Date: Mon May 25 21:56:04 2020 +0200 dt-bindings: vendor-prefixes: Add Silex Insight vendor prefix Silex Insight is a microelectronic company whose headquarter is located in Belgium. Web site of the company: https://www.silexinsight.com/ Signed-off-by: Olivier Sobrie Signed-off-by: Rob Herring commit dba5a189bf6169dc3e7462df17fb2aee5ca37e90 Author: Yan-Hsuan Chuang Date: Wed May 20 13:53:50 2020 +0800 Revert "rtw88: no need to set registers for SDIO" This reverts commit 07d0f5534935e2daf63a4e1012af13d68e089fed. For rtw88 driver, the SDIO is going to be supported, so there is no need to remove the SDIO related power sequence settings. And while the power sequence parser will pass in the mask of the HCI, the SDIO part will not be used to set registers accordingly. Moreover, the power sequence table is released as a whole package, so the next time if we are going to update, the SDIO settings will be overwritten. So, revert this now. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520055350.23328-1-yhchuang@realtek.com commit 3a8855d8cfcb944032ce0eecba05b2d0e93f4fb1 Author: Sergey Matyukevich Date: Wed May 20 16:08:00 2020 +0300 MAINTAINERS: update qtnfmac maintainers I am leaving Quantenna, so I will no longer have access to firmware and hardware. Meanwhile I plan to participate in reviewing qtnfmac patches for a while until my firmware knowledge becomes completely obsolete. Adding myself as a reviewer using my personal email address. Signed-off-by: Sergey Matyukevich Signed-off-by: Igor Mitsyanko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200520130800.1902-1-sergey.matyukevich.os@quantenna.com commit 73b1e2170a9da9a12166ec15ac4bb20f94e870d4 Author: Johan Jonker Date: Wed May 20 09:33:27 2020 +0200 dt-bindings: input: touchscreen: edt-ft5x06: change reg property A test with the command below gives this error: arch/arm/boot/dts/rk3188-bqedison2qc.dt.yaml: touchscreen@3e: reg:0:0: 56 was expected The touchscreen chip on 'rk3188-bqedison2qc' and other BQ models was shipped with different addresses then the binding currently allows. Change the reg property that any address will pass. make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/input/touchscreen/ edt-ft5x06.yaml Signed-off-by: Johan Jonker Acked-by: Heiko Stuebner Signed-off-by: Rob Herring commit 08ba93064eab23974000737a06dd869cc8a7758f Merge: 2604d48702fe 8378449d1f79 Author: Mark Brown Date: Fri May 29 17:49:56 2020 +0100 Merge series "spi: dw: Add generic DW DMA controller support" from Serge Semin : Baikal-T1 SoC provides a DW DMA controller to perform low-speed peripherals Mem-to-Dev and Dev-to-Mem transaction. This is also applicable to the DW APB SSI devices embedded into the SoC. Currently the DMA-based transfers are supported by the DW APB SPI driver only as a middle layer code for Intel MID/Elkhart PCI devices. Seeing the same code can be used for normal platform DMAC device we introduced a set of patches to fix it within this series. First of all we need to add the Tx and Rx DMA channels support into the DW APB SSI binding. Then there are several fixes and cleanups provided as a initial preparation for the Generic DMA support integration: add Tx/Rx finish wait methods, clear DMAC register when done or stopped, Fix native CS being unset, enable interrupts in accordance with DMA xfer mode, discard static DW DMA slave structures, discard unused void priv pointer and dma_width member of the dw_spi structure, provide the DMA Tx/Rx burst length parametrisation and make sure it's optionally set in accordance with the DMA max-burst capability. In order to have the DW APB SSI MMIO driver working with DMA we need to initialize the paddr field with the physical base address of the DW APB SSI registers space. Then we unpin the Intel MID specific code from the generic DMA one and placed it into the spi-dw-pci.c driver, which is a better place for it anyway. After that the naming cleanups are performed since the code is going to be used for a generic DMAC device. Finally the Generic DMA initialization can be added to the generic version of the DW APB SSI IP. Last but not least we traditionally convert the legacy plain text-based dt-binding file with yaml-based one and as a cherry on a cake replace the manually written DebugFS registers read method with a ready-to-use for the same purpose regset32 DebugFS interface usage. This patchset is rebased and tested on the spi/for-next (5.7-rc5): base-commit: fe9fce6b2cf3 ("Merge remote-tracking branch 'spi/for-5.8' into spi-next") Link: https://lore.kernel.org/linux-spi/20200508132943.9826-1-Sergey.Semin@baikalelectronics.ru/ Changelog v2: - Rebase on top of the spi repository for-next branch. - Move bindings conversion patch to the tail of the series. - Move fixes to the head of the series. - Apply as many changes as possible to be applied the Generic DMA functionality support is added and the spi-dw-mid is moved to the spi-dw-dma driver. - Discard patch "spi: dw: Fix dma_slave_config used partly uninitialized" since the problem has already been fixed. - Add new patch "spi: dw: Discard unused void priv pointer". - Add new patch "spi: dw: Discard dma_width member of the dw_spi structure". n_bytes member of the DW SPI data can be used instead. - Build the DMA functionality into the DW APB SSI core if required instead of creating a separate kernel module. - Use conditional statement instead of the ternary operator in the ref clock getter. Link: https://lore.kernel.org/linux-spi/20200515104758.6934-1-Sergey.Semin@baikalelectronics.ru/ Changelog v3: - Use spi_delay_exec() method to wait for the DMA operation completion. - Explicitly initialize the dw_dma_slave members on stack. - Discard the dws->fifo_len utilization in the Tx FIFO DMA threshold setting from the patch where we just add the default burst length constants. - Use min() method to calculate the optimal burst values. - Add new patch which moves the spi-dw.c source file to spi-dw-core.c in order to preserve the DW APB SSI core driver name. - Add commas in the debugfs_reg32 structure initializer and after the last entry of the dw_spi_dbgfs_regs array. Link: https://lore.kernel.org/linux-spi/20200521012206.14472-1-Sergey.Semin@baikalelectronics.ru Changelog v4: - Get back ndelay() method to wait for an SPI transfer completion. spi_delay_exec() isn't suitable for the atomic context. Link: https://lore.kernel.org/linux-spi/20200522000806.7381-1-Sergey.Semin@baikalelectronics.ru Changelog v5: - Refactor the Tx/Rx DMA-based SPI transfers wait methods. - Add a new patch "spi: dw: Set xfer effective_speed_hz". - Add a new patch "spi: dw: Return any value retrieved from the dma_transfer callback" as a preparation patch before implementing the local DMA, Tx SPI and Rx SPI transfers wait methods. - Add a new patch "spi: dw: Locally wait for the DMA transactions completion", which provides a local DMA transaction complete method - Create a dedicated patch which adds the Rx-done wait method: "spi: dw: Add SPI Rx-done wait method to DMA-based transfer". - Add more detailed description of the problems the Tx/Rx-wait methods-related patches fix. - Wait for the SPI Tx and Rx transfers being finished in the mid_spi_dma_transfer() method executed in the task context. - Use spi_delay_exec() to wait for the SPI Tx/Rx completion, since now the driver calls the wait methods in the kernel thread context. - Use SPI_DELAY_UNIT_SCK spi_delay unit for Tx-wait delay, since SPI xfer's are now have the effective_speed_hz initialized. - Rx-wait for a delay correlated with the APB/SSI synchronous clock rate instead of using the SPI bus clock rate. Link: https://lore.kernel.org/linux-spi/20200529035915.20790-1-Sergey.Semin@baikalelectronics.ru Changelog v6: - Provide a more detailed description of the patch: 2901db35bea1 ("spi: dw: Locally wait for the DMA transfers completion") - Calculate the Rx delay with better accuracy by moving 4-multiplication to the head of the formulae: ns = 4U * NSEC_PER_SEC / dws->max_freq * nents. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-spi@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (16): spi: dw: Set xfer effective_speed_hz spi: dw: Return any value retrieved from the dma_transfer callback spi: dw: Locally wait for the DMA transfers completion spi: dw: Add SPI Tx-done wait method to DMA-based transfer spi: dw: Add SPI Rx-done wait method to DMA-based transfer spi: dw: Parameterize the DMA Rx/Tx burst length spi: dw: Use DMA max burst to set the request thresholds spi: dw: Fix Rx-only DMA transfers spi: dw: Add core suffix to the DW APB SSI core source file spi: dw: Move Non-DMA code to the DW PCIe-SPI driver spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core spi: dw: Cleanup generic DW DMA code namings spi: dw: Add DMA support to the DW SPI MMIO driver spi: dw: Use regset32 DebugFS method to create regdump file dt-bindings: spi: Convert DW SPI binding to DT schema .../bindings/spi/snps,dw-apb-ssi.txt | 44 -- .../bindings/spi/snps,dw-apb-ssi.yaml | 127 +++++ .../devicetree/bindings/spi/spi-dw.txt | 24 - drivers/spi/Kconfig | 15 +- drivers/spi/Makefile | 5 +- drivers/spi/{spi-dw.c => spi-dw-core.c} | 95 ++-- drivers/spi/spi-dw-dma.c | 482 ++++++++++++++++++ drivers/spi/spi-dw-mid.c | 382 -------------- drivers/spi/spi-dw-mmio.c | 4 + drivers/spi/spi-dw-pci.c | 50 +- drivers/spi/spi-dw.h | 20 +- 11 files changed, 719 insertions(+), 529 deletions(-) delete mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt create mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml delete mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt rename drivers/spi/{spi-dw.c => spi-dw-core.c} (82%) create mode 100644 drivers/spi/spi-dw-dma.c delete mode 100644 drivers/spi/spi-dw-mid.c -- 2.26.2 commit 2604d48702fe14fb3e97701269dd5e66b392b904 Author: Dinh Nguyen Date: Fri May 29 10:58:06 2020 -0500 dt-bindings: snps,dw-apb-ssi: add optional reset property Add optional reset property. Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20200529155806.16758-2-dinguyen@kernel.org Signed-off-by: Mark Brown commit 7830c0ef26cb73b653c2db2f3ca7be08f44fa046 Author: Dinh Nguyen Date: Fri May 29 10:58:05 2020 -0500 spi: dw: add reset control Add mechanism to get the reset control and deassert it in order to bring the IP out of reset. Signed-off-by: Liang Jin J Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20200529155806.16758-1-dinguyen@kernel.org Signed-off-by: Mark Brown commit ecfbd3cf3b8bb73ac6a80ddf430b5912fd4402a6 Author: Martin Sperl Date: Thu May 28 20:58:04 2020 +0200 spi: bcm2835: Enable shared interrupt support bcm2711, Rasberry Pi 4's SoC, shares one interrupt for multiple instances of the bcm2835 SPI controller. So this enables shared interrupt support for them. The early bail out in the interrupt routine avoids messing with buffers of transfers being done by other means. Otherwise, the driver can handle receiving interrupts asserted by other controllers during an IRQ based transfer. Signed-off-by: Martin Sperl Signed-off-by: Nicolas Saenz Julienne Tested-by: Florian Fainelli Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20200528185805.28991-1-nsaenzjulienne@suse.de Signed-off-by: Mark Brown commit 118eb0e52eb74b899053a0f46dfe7e178788d23b Author: Florian Fainelli Date: Thu May 28 12:06:05 2020 -0700 spi: bcm2835: Implement shutdown callback Make sure we clear the FIFOs, stop the block, disable the clock and release the DMA channel. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20200528190605.24850-1-f.fainelli@gmail.com Signed-off-by: Mark Brown commit bf0beec0607db3c6f6fb7bd2c6d503792b05cf3f Author: Ming Lei Date: Fri May 29 15:53:15 2020 +0200 blk-mq: drain I/O when all CPUs in a hctx are offline Most of blk-mq drivers depend on managed IRQ's auto-affinity to setup up queue mapping. Thomas mentioned the following point[1]: "That was the constraint of managed interrupts from the very beginning: The driver/subsystem has to quiesce the interrupt line and the associated queue _before_ it gets shutdown in CPU unplug and not fiddle with it until it's restarted by the core when the CPU is plugged in again." However, current blk-mq implementation doesn't quiesce hw queue before the last CPU in the hctx is shutdown. Even worse, CPUHP_BLK_MQ_DEAD is a cpuhp state handled after the CPU is down, so there isn't any chance to quiesce the hctx before shutting down the CPU. Add new CPUHP_AP_BLK_MQ_ONLINE state to stop allocating from blk-mq hctxs where the last CPU goes away, and wait for completion of in-flight requests. This guarantees that there is no inflight I/O before shutting down the managed IRQ. Add a BLK_MQ_F_STACKING and set it for dm-rq and loop, so we don't need to wait for completion of in-flight requests from these drivers to avoid a potential dead-lock. It is safe to do this for stacking drivers as those do not use interrupts at all and their I/O completions are triggered by underlying devices I/O completion. [1] https://lore.kernel.org/linux-block/alpine.DEB.2.21.1904051331270.1802@nanos.tec.linutronix.de/ [hch: different retry mechanism, merged two patches, minor cleanups] Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 602380d28e28b454683efac41dc4b2862d055d91 Author: Ming Lei Date: Fri May 29 15:53:14 2020 +0200 blk-mq: add blk_mq_all_tag_iter Add a new blk_mq_all_tag_iter function to iterate over all allocated scheduler tags and driver tags. This is more flexible than the existing blk_mq_all_tag_busy_iter function as it allows the callers to do whatever they want on allocated request instead of being limited to started requests. It will be used to implement draining allocated requests on specified hctx in this patchset. [hch: switch from the two booleans to a more readable flags field and consolidate the tags iter functions] Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Reviewed-by: Bart van Assche Signed-off-by: Jens Axboe commit 600c3b0cea784aaba77df3ed4a6b4f2ebfa935ce Author: Christoph Hellwig Date: Fri May 29 15:53:13 2020 +0200 blk-mq: open code __blk_mq_alloc_request in blk_mq_alloc_request_hctx blk_mq_alloc_request_hctx is only used for NVMeoF connect commands, so tailor it to the specific requirements, and don't bother the general fast path code with its special twinkles. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 766473681c131f2da81d62472864c8c97e021373 Author: Christoph Hellwig Date: Fri May 29 15:53:12 2020 +0200 blk-mq: use BLK_MQ_NO_TAG in more places Replace various magic -1 constants for tags with BLK_MQ_NO_TAG. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 419c3d5e8012928fbf9a086b07b618146cc9277b Author: Christoph Hellwig Date: Fri May 29 15:53:11 2020 +0200 blk-mq: rename BLK_MQ_TAG_FAIL to BLK_MQ_NO_TAG To prepare for wider use of this constant give it a more applicable name. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 7ea4d8a4d683298abd346abf89567774de2fa34a Author: Christoph Hellwig Date: Fri May 29 15:53:10 2020 +0200 blk-mq: move more request initialization to blk_mq_rq_ctx_init Don't split request initialization between __blk_mq_alloc_request and blk_mq_rq_ctx_init. Also remove the op argument as it can be derived from the blk_mq_alloc_data structure. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit e6e7abffe386b614a194ec32457a00c304c980f4 Author: Christoph Hellwig Date: Fri May 29 15:53:09 2020 +0200 blk-mq: simplify the blk_mq_get_request calling convention The bio argument is entirely unused, and the request_queue can be passed through the alloc_data, given that it needs to be filled out for the low-level tag allocation anyway. Also rename the function to __blk_mq_alloc_request as the switch between get and alloc in the call chains is rather confusing. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 5d9c305b8ea3fbc95bedfde01f7dd91e68082098 Author: Christoph Hellwig Date: Fri May 29 15:53:08 2020 +0200 blk-mq: remove the bio argument to ->prepare_request None of the I/O schedulers actually needs it. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 3382a567efd4015697f087f2e91ac08b90577876 Author: Keith Busch Date: Fri May 29 07:52:00 2020 -0700 nvme: force complete cancelled requests Use blk_mq_foce_complete_rq() to bypass fake timeout error injection so that request reclaim may proceed. Signed-off-by: Keith Busch Reviewed-by: Johannes Thumshirn Reviewed-by: Ming Lei Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 7b11eab041dacfeaaa6d27d9183b247a995bc16d Author: Keith Busch Date: Fri May 29 07:51:59 2020 -0700 blk-mq: blk-mq: provide forced completion method Drivers may need to bypass error injection for error recovery. Rename __blk_mq_complete_request() to blk_mq_force_complete_rq() and export that function so drivers may skip potential fake timeouts after they've reclaimed lost requests. Signed-off-by: Keith Busch Reviewed-by: Daniel Wagner Signed-off-by: Jens Axboe commit 48325655290869dbcdc356478bde4606d79d600e Author: Charles Keepax Date: Fri May 29 16:22:16 2020 +0100 regulator: core: Add regulator bypass trace points Add new trace points for the start and end of enabling bypass on a regulator, to allow monitoring of when regulators are moved into bypass and how long that takes. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20200529152216.9671-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit c343bf1ba5efcbf2266a1fe3baefec9cc82f867f Author: Qiushi Wu Date: Thu May 28 13:20:46 2020 -0500 cpuidle: Fix three reference count leaks kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous commit "b8eb718348b8" fixed a similar problem. Signed-off-by: Qiushi Wu [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki commit 3e5095eebe015d5a4d566aa5e03c8621add5f0a7 Author: Jon Derrick Date: Wed May 27 23:02:39 2020 -0400 PCI: vmd: Filter resource type bits from shadow register Versions of VMD with the Host Physical Address shadow register use this register to calculate the bus address offset needed to do guest passthrough of the domain. This register shadows the Host Physical Address registers including the resource type bits. After calculating the offset, the extra resource type bits lead to the VMD resources being over-provisioned at the front and under-provisioned at the back. Example: pci 10000:80:02.0: reg 0x10: [mem 0xf801fffc-0xf803fffb 64bit] Expected: pci 10000:80:02.0: reg 0x10: [mem 0xf8020000-0xf803ffff 64bit] If other devices are mapped in the over-provisioned front, it could lead to resource conflict issues with VMD or those devices. Link: https://lore.kernel.org/r/20200528030240.16024-3-jonathan.derrick@intel.com Fixes: a1a30170138c9 ("PCI: vmd: Fix shadow offsets to reflect spec changes") Signed-off-by: Jon Derrick Signed-off-by: Lorenzo Pieralisi commit 9a7875461fd0427dc86e3a87e93bd5723679b8b1 Author: Rafael J. Wysocki Date: Thu May 28 16:45:14 2020 +0200 PM: runtime: Replace pm_runtime_callbacks_present() The name of pm_runtime_callbacks_present() is confusing, because it suggests that the device has PM-runtime callbacks if 'true' is returned by that function, but in fact that may not be the case, so replace it with pm_runtime_has_no_callbacks() which is not ambiguous. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Ulf Hansson commit af89e7dac521f5e087b6b2706bb0623107f74c83 Author: Pierre-Louis Bossart Date: Fri May 29 10:04:08 2020 -0500 ASoC: SOF: Intel: Baytrail: fix 'defined but not used' warnings With the allmodconfig option, CONFIG_SND_SOC_SOF_BAYTRAIL is disabled due to mutual exclusion with the legacy driver. This generates 'defined by not used' warnings. suspend/resume/remove are only supported for Baytrail for now, so move the code under the CONFIG_SND_SOC_SOF_BAYTRAIL checks. Fixes: ddcccd543f5d ("ASoC: SOF: Intel: byt: Add PM callbacks") Reported-by: Stephen Rothwell Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200529150408.17236-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 68f8043ed13e636c6f04ac1c0831e17681d392ab Author: 朱灿灿 Date: Fri May 29 18:12:44 2020 +0800 Subject: [PATCH v2] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update FE state is SND_SOC_DPCM_STATE_PREPARE now, BE1 is used by FE. Later when new BE2 is added to FE by mixer update, it will call dpcm_run_update_startup() to update BE2's state, but unfortunately BE2 .prepare() meets error, it will disconnect all non started BE. This make BE1 dai skip .hw_free() and .shutdown(), and the BE1 users will never decrease to zero. Signed-off-by: zhucancan Link: https://lore.kernel.org/r/ALMAWwB5CP9aAcKXCU5FzqqF.1.1590747164172.Hmail.zhucancan@vivo.com Signed-off-by: Mark Brown commit 4969a3a2cd3c2dbb1bcdc6a3a516de9ff972372e Author: Boris Ostrovsky Date: Thu May 28 22:24:52 2020 -0400 xen/pci: Get rid of verbose_request and use dev_dbg() instead Information printed under verbose_request is clearly used for debugging only. Remove it and use dev_dbg() instead. Signed-off-by: Boris Ostrovsky Link: https://lore.kernel.org/r/1590719092-8578-1-git-send-email-boris.ostrovsky@oracle.com Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit b6b15e20421fefae9f78274f9fef80bc97bf5d5c Author: Rui Salvaterra Date: Mon May 25 14:49:07 2020 +0100 rt2800: enable MFP support unconditionally This gives us WPA3 support out of the box without having to manually disable hardware crypto. The driver will fall back to software crypto if the connection requires management frame protection. Suggested-by: Stanislaw Gruszka Signed-off-by: Rui Salvaterra Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200525134906.1672-1-rsalvaterra@gmail.com commit 96ec7b3142b467fb4af309adcb63c542bda727b1 Author: Sandeep Maheswaram Date: Wed Apr 1 10:45:42 2020 +0530 dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver Add documentation for the interconnects and interconnect-names properties for USB. Reviewed-by: Stephen Boyd Reviewed-by: Rob Herring Signed-off-by: Sandeep Maheswaram Signed-off-by: Rob Herring commit 736c3333e3970e7eb0c47a3811588ff0e760f19b Author: Joerg Roedel Date: Wed May 27 13:53:13 2020 +0200 iommu/amd: Remove redundant devid checks Checking the return value of get_device_id() in a code-path which has already done check_device() is not needed, as check_device() does the same check and bails out if it fails. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-11-joro@8bytes.org commit 05a0542b456e135f362ba83a17ccff73bac0b92f Author: Joerg Roedel Date: Wed May 27 13:53:12 2020 +0200 iommu/amd: Store dev_data as device iommu private data Do not use dev->archdata.iommu anymore and switch to using the private per-device pointer provided by the IOMMU core code. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-10-joro@8bytes.org commit 786dfe496e3b30b92d11cf7ae1d36d1a458702f6 Author: Joerg Roedel Date: Wed May 27 13:53:11 2020 +0200 iommu/amd: Merge private header files Merge amd_iommu_proto.h into amd_iommu.h. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-9-joro@8bytes.org commit e1980df36c5c94899df1fd71f0b0a6dba457051c Author: Joerg Roedel Date: Wed May 27 13:53:10 2020 +0200 iommu/amd: Remove PD_DMA_OPS_MASK This is covered by IOMMU_DOMAIN_DMA from the IOMMU core code already, so remove it. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-8-joro@8bytes.org commit 301441a0994689b56e98a0e8ecdc383b144ed258 Author: Joerg Roedel Date: Wed May 27 13:53:09 2020 +0200 iommu/amd: Consolidate domain allocation/freeing Merge the allocation code paths of DMA and UNMANAGED domains and remove code duplication. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-7-joro@8bytes.org commit 75b27745097dde18a0b8936d73cf72df61b2253b Author: Joerg Roedel Date: Wed May 27 13:53:08 2020 +0200 iommu/amd: Free page-table in protection_domain_free() Align release of the page-table with the place where it is allocated. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-6-joro@8bytes.org commit a71730e225be457dc51fc0b1fe155db18706d0fe Author: Joerg Roedel Date: Wed May 27 13:53:07 2020 +0200 iommu/amd: Allocate page-table in protection_domain_init() Consolidate the allocation of the domain page-table in one place. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-5-joro@8bytes.org commit 1226c370744613b17f7cd564087c4dcd56207a07 Author: Joerg Roedel Date: Wed May 27 13:53:06 2020 +0200 iommu/amd: Let free_pagetable() not rely on domain->pt_root Use 'struct domain_pgtable' instead to free_pagetable(). This solves the problem that amd_iommu_domain_direct_map() needs to restore domain->pt_root after the device table has been updated just to make free_pagetable release the domain page-table. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-4-joro@8bytes.org commit fb1b6955bbf3470d1a3dfb22efc729fa84c73a89 Author: Joerg Roedel Date: Wed May 27 13:53:05 2020 +0200 iommu/amd: Unexport get_dev_data() This function is internal to the AMD IOMMU driver and only exported because the amd_iommu_v2 modules calls it. But the reason it is called from there could better be handled by amd_iommu_is_attach_deferred(). So unexport get_dev_data() and use amd_iommu_is_attach_deferred() instead. Signed-off-by: Joerg Roedel Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20200527115313.7426-3-joro@8bytes.org commit 4c201d58cfee8631350888bad9e8bae33e628605 Merge: 555fb5ae0f39 9cb1fd0efd19 Author: Joerg Roedel Date: Fri May 29 17:10:09 2020 +0200 Merge tag 'v5.7-rc7' into x86/amd Linux 5.7-rc7 commit 87c233b8158a20a9c9ab1da96cb5cb1734d9006e Author: Al Viro Date: Thu May 7 23:28:15 2020 -0400 vmci_host: get rid of pointless access_ok() get_user_pages_fast() doesn't need the caller to check that. NB: reachable only from ioctl(2) and only under USER_DS Reviewed-by: Greg Kroah-Hartman Signed-off-by: Al Viro commit fd8ec4dd4a79d5ad51d31d4a7664b5f82d108316 Author: Al Viro Date: Thu May 7 21:39:29 2020 -0400 hfi1: get rid of pointless access_ok() pin_user_pages_fast() doesn't need that from its caller. NB: only reachable from ->ioctl(), and only under USER_DS Signed-off-by: Al Viro commit fe6bb59f4dd693ffb678224fe78fc69dda163c46 Author: Al Viro Date: Thu Apr 23 10:27:20 2020 -0400 usb: get rid of pointless access_ok() calls in all affected cases addresses are passed only to copy_from()_user or copy_to_user(). Reviewed-by: Greg Kroah-Hartman Signed-off-by: Al Viro commit e6c0433e270ae96fb62fd30cf7c2c7bf57d5391f Author: Al Viro Date: Wed Apr 22 23:20:52 2020 -0400 lpfc_debugfs: get rid of pointless access_ok() No, you do NOT need to "protect copy from user" that way. Incidentally, your userland ABI stinks. I understand that you wanted to accept "reset" and "reset\n" as equivalent, but I suspect that accepting "reset this, you !@^!@!" had been an accident. Nothing to do about that now - it is a userland ABI... Signed-off-by: Al Viro commit d2659e583eb32fddea4f27a346de84f88be6119f Author: Al Viro Date: Wed Apr 22 23:02:16 2020 -0400 efi_test: get rid of pointless access_ok() really, people - get_user(), copy_from_user(), memdup_user(), etc. all fail if access_ok() does. Signed-off-by: Al Viro commit a38547d435cd91060b0d07cc11e24eee4c3f31aa Author: Al Viro Date: Thu May 7 21:13:55 2020 -0400 drm_read(): get rid of pointless access_ok() address is passed only to copy_to_user() Signed-off-by: Al Viro commit d65aca9ff83b04fa1062800c7796d44729ef55af Author: Al Viro Date: Wed Apr 22 23:08:34 2020 -0400 via-pmu: don't bother with access_ok() we are using copy_to_user() for actual copying Signed-off-by: Al Viro commit 835ae3bb530a2e40dd5615c3728d4a78320f6fb8 Author: Al Viro Date: Wed Apr 22 22:56:59 2020 -0400 drivers/crypto/ccp/sev-dev.c: get rid of pointless access_ok() Contrary to the comments, those do *NOT* verify anything about writability of memory, etc. In all cases addresses are passed only to copy_to_user(). Signed-off-by: Al Viro commit 9053fc91e3e9609c36904b98a4befa2988d98301 Author: Al Viro Date: Thu Apr 23 10:29:49 2020 -0400 omapfb: get rid of pointless access_ok() calls address is passed only to copy_to_user() Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Al Viro commit 694b9a7157d4dfaaea70dc740e9f8d43b8a1e95b Author: Al Viro Date: Thu Apr 23 10:28:49 2020 -0400 amifb: get rid of pointless access_ok() calls addresses passed only to get_user() and put_user() Signed-off-by: Al Viro commit 83a4f2e70470be94c582b3d09e774fc9c4470b40 Author: Al Viro Date: Thu May 7 21:03:04 2020 -0400 drivers/fpga/dfl-afu-dma-region.c: get rid of pointless access_ok() Address is passed to get_user_pages_fast(), which does access_ok(). NB: this is called only from ->ioctl(), and only under USER_DS. Signed-off-by: Al Viro commit c9a4bb416676dc1d67acc7fed51f77d8b371ab51 Author: Al Viro Date: Wed Apr 22 23:05:57 2020 -0400 drivers/fpga/dfl-fme-pr.c: get rid of pointless access_ok() followed by copy_from_user() Signed-off-by: Al Viro commit 5f599098f7608deb4fa063486452f8f1dfd8a72c Author: Al Viro Date: Wed Apr 22 22:52:07 2020 -0400 cm4000_cs.c cmm_ioctl(): get rid of pointless access_ok() copy_to_user()/copy_from_user() for everything Signed-off-by: Al Viro commit 558cc8f7822ba25711142f5e7718be857b286793 Author: Al Viro Date: Wed Apr 22 21:52:17 2020 -0400 nvram: drop useless access_ok() we are using copy_to_user()/memdup_user() anyway Reviewed-by: Greg Kroah-Hartman Signed-off-by: Al Viro commit 1a4b8febb6c13766f1af91058b90fee876e11674 Author: Al Viro Date: Tue Feb 18 12:42:57 2020 -0500 n_hdlc_tty_read(): remove pointless access_ok() only copy_to_user() is done to the address in question Reviewed-by: Greg Kroah-Hartman Signed-off-by: Al Viro commit 00fca6b53a88f600c59bae3828e1c2fdce58be0d Author: Al Viro Date: Thu Apr 23 10:20:06 2020 -0400 tomoyo_write_control(): get rid of pointless access_ok() address is passed only to get_user() Signed-off-by: Al Viro commit 8378449d1f79add31be77e77fc7df9f639878e9c Author: Serge Semin Date: Fri May 29 16:12:04 2020 +0300 spi: dw: Use regset32 DebugFS method to create regdump file DebugFS kernel interface provides a dedicated method to create the registers dump file. Use it instead of creating a generic DebugFS file with manually written read callback function. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-16-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 0fdad596d46b28d5c3e39d1897c5e3878b64d9a2 Author: Serge Semin Date: Fri May 29 16:12:03 2020 +0300 spi: dw: Add DMA support to the DW SPI MMIO driver Since the common code in the spi-dw-dma.c driver is ready to be used by the MMIO driver and now provides a method to generically (on any DT or ACPI-based platforms) retrieve the Tx/Rx DMA channel handlers, we can use it and a set of the common DW SPI DMA callbacks to enable DMA at least for generic "snps,dw-apb-ssi" and "snps,dwc-ssi-1.01a" devices. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-15-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 57784411728ff4d72ae051fdbba1e54fcb1f8d6f Author: Serge Semin Date: Fri May 29 16:12:02 2020 +0300 spi: dw: Cleanup generic DW DMA code namings Since from now the former Intel MID platform layer is used as a generic DW SPI DMA module, let's alter the internal methods naming to be DMA-related instead of having the "mid_" prefix. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-14-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit ecb3a67edfd353837dc23b538fb250d1dfd88e7b Author: Serge Semin Date: Fri May 29 16:12:01 2020 +0300 spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core Seeing all of the DW SPI driver components like DW SPI DMA/PCI/MMIO depend on the DW SPI core code it's better to use the if-endif conditional kernel config statement to signify that common dependency. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-13-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 06cfadb8c51b05c6b91c2d43e0fe72b3d643dced Author: Serge Semin Date: Fri May 29 16:12:00 2020 +0300 spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI Since there is a generic method available to initialize the DW SPI DMA interface on any DT and ACPI-based platforms, which in general can be designed with not only DW DMAC but with any DMA engine on board, we can freely remove the CONFIG_DW_DMAC_PCI config from dependency list of CONFIG_SPI_DW_DMA. Especially seeing that we don't use anything DW DMAC specific in the new driver. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-12-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 6c710c0cb6725bdbe647b958756685aed0295936 Author: Serge Semin Date: Fri May 29 16:11:59 2020 +0300 spi: dw: Move Non-DMA code to the DW PCIe-SPI driver This is a preparation patch before adding the DW DMA support into the DW SPI MMIO driver. We need to unpin the Non-DMA-specific code from the intended to be generic DW APB SSI DMA code. This isn't that hard, since the most part of the spi-dw-mid.c driver in fact implements a generic DMA interface for the DW SPI controller driver. The only Intel MID specifics concern getting the max frequency from the MRST Clock Control Unit and fetching the DMA controller channels from corresponding PCIe DMA controller. Since first one is related with the SPI interface configuration we moved it' implementation into the DW PCIe-SPI driver module. After that former spi-dw-mid.c file can be just renamed to be the DW SPI DMA module optionally compiled in to the DW APB SSI core driver. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-11-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 77ccff803d27279ccc100dc906c6f456c8fa515c Author: Serge Semin Date: Fri May 29 16:11:58 2020 +0300 spi: dw: Add core suffix to the DW APB SSI core source file Generic DMA support is going to be part of the DW APB SSI core object. In order to preserve the kernel loadable module name as spi-dw.ko, let's add the "-core" suffix to the object with generic DW APB SSI code and build it into the target spi-dw.ko driver. Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Feng Tang Cc: Rob Herring Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-10-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 46164fde6b7890e7a3982d54549947c8394c0192 Author: Serge Semin Date: Fri May 29 16:11:57 2020 +0300 spi: dw: Fix Rx-only DMA transfers Tx-only DMA transfers are working perfectly fine since in this case the code just ignores the Rx FIFO overflow interrupts. But it turns out the SPI Rx-only transfers are broken since nothing pushing any data to the shift registers, so the Rx FIFO is left empty and the SPI core subsystems just returns a timeout error. Since DW DMAC driver doesn't support something like cyclic write operations of a single byte to a device register, the only way to support the Rx-only SPI transfers is to fake it by using a dummy Tx-buffer. This is what we intend to fix in this commit by setting the SPI_CONTROLLER_MUST_TX flag for DMA-capable platform. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-9-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 0b2b66514fc9971b3a6002ba038d74f77705fd34 Author: Serge Semin Date: Fri May 29 16:11:56 2020 +0300 spi: dw: Use DMA max burst to set the request thresholds Each channel of DMA controller may have a limited length of burst transaction (number of IO operations performed at ones in a single DMA client request). This parameter can be used to setup the most optimal DMA Tx/Rx data level values. In order to avoid the Tx buffer overrun we can set the DMA Tx level to be of FIFO depth minus the maximum burst transactions length. To prevent the Rx buffer underflow the DMA Rx level should be set to the maximum burst transactions length. This commit setups the DMA channels and the DW SPI DMA Tx/Rx levels in accordance with these rules. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-8-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit c534df9d6225314d1403e4330a22d68c35e0eb55 Author: Serge Semin Date: Fri May 29 16:11:55 2020 +0300 spi: dw: Parameterize the DMA Rx/Tx burst length It isn't good to have numeric literals in the code especially if there are multiple of them and they are related. Let's replace the Tx and Rx burst level literals with the corresponding constants. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 33726eff3d98e643f7d7a0940f4024844b430c82 Author: Serge Semin Date: Fri May 29 16:11:54 2020 +0300 spi: dw: Add SPI Rx-done wait method to DMA-based transfer Having any data left in the Rx FIFO after the DMA engine claimed it has finished all DMA transactions is an abnormal situation, since the DW SPI controller driver expects to have all the data being fetched and placed into the SPI Rx buffer at that moment. In case if that has happened we hopefully assume that the DMA engine may still be doing the data fetching, thus we give it sometime to finish. If after a short period of time the data is still left in the Rx FIFO, the driver will give up waiting and return an error indicating that the SPI controller/DMA engine must have hung up or failed at some point of doing their duties. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 1ade2d8a72f9240825f6be050f0d49c840f7daeb Author: Serge Semin Date: Fri May 29 16:11:53 2020 +0300 spi: dw: Add SPI Tx-done wait method to DMA-based transfer Since DMA transfers are performed asynchronously with actual SPI bus transfers, then even if DMA transactions are finished it doesn't mean all data is actually pushed to the SPI bus. Some data might still be in the controller FIFO. This is specifically true for Tx-only transfers. In this case if the next SPI transfer is recharged while a tail of the previous one is still in FIFO, we'll loose that tail data. In order to fix that problem let's add the wait procedure of the Tx SPI transfer completion after the DMA transactions are finished. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit bdbdf0f06337d3661b64c0288c291cb06624065e Author: Serge Semin Date: Fri May 29 16:11:52 2020 +0300 spi: dw: Locally wait for the DMA transfers completion In general each DMA-based SPI transfer can be split up into two stages: DMA data transmission/reception and SPI-bus transmission/reception. DMA asynchronous transactions completion can be tracked by means of the DMA async Tx-descriptor completion callback. But that callback being called indicates that the DMA transfer has been finished, it doesn't mean that SPI data transmission is also done. Moreover in fact it isn't for at least Tx-only SPI transfers. Upon DMA transfer completion some data is left in the Tx FIFO and being pushed out by the SPI controller. So in order to make sure that an SPI transfer is completely pushed to the SPI-bus, the driver has to wait for both DMA transaction and the SPI-bus transmission/reception are finished. Note if there is a way to asynchronously track the former event by means of the DMA async Tx callback, there isn't easy one for the later (IRQ-based solution won't work since SPI controller doesn't notify about Rx FIFO being empty). The DMA transfer completion callback isn't suitable to wait for the SPI controller activity finish either. The callback might (in case of DW DMAC it will) be called in the tasklet context. Waiting for the SPI controller to complete the transfer might take a considerable amount of time since SPI-bus might be pretty slow. In this case delaying the execution in the tasklet atomic context might cause significant system performance drop. So to speak the best option we've got to solve the problem is to consequently wait for both stages being finished in the locally implemented SPI transfer execution procedure even if it costs us of the local wait-function re-implementation. In this case we don't need to use the SPI-core transfer-wait functionality, but we'll make sure that all DMA and SPI-bus transactions are completely finished before the SPI-core transfer_one callback returns. In this commit we provide an implementation of the DMA-transfers completion wait functionality. The DW APB SSI DMA-specific SPI transfer_one function waits for both Tx and Rx DMA transfers being finished, and only then exits with zero returned signalling to the SPI core that the SPI transfer is finished. This implementation is fully equivalent to the currently used DMA-execution-SPI-core-wait algorithm. The SPI-bus transmission/reception wait methods will be added in the follow-up commits. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit f0410bbf7d0fb80149e3b17d11d31f5b5197873e Author: Serge Semin Date: Fri May 29 16:11:51 2020 +0300 spi: dw: Return any value retrieved from the dma_transfer callback DW APB SSI DMA-part of the driver may need to perform the requested SPI-transfer synchronously. In that case the dma_transfer() callback will return 0 as a marker of the SPI transfer being finished so the SPI core doesn't need to wait and may proceed with the SPI message trasnfers pumping procedure. This will be needed to fix the problem when DMA transactions are finished, but there is still data left in the SPI Tx/Rx FIFOs being sent/received. But for now make dma_transfer to return 1 as the normal dw_spi_transfer_one() method. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit de4c2875a5ff2c886df60f2086c6affca83f890a Author: Serge Semin Date: Fri May 29 16:11:50 2020 +0300 spi: dw: Set xfer effective_speed_hz Seeing DW APB SSI controller doesn't support setting the exactly requested SPI bus frequency, but only a rounded frequency determined by means of the odd-numbered half-worded reference clock divider, it would be good to tune the SPI core up and initialize the current transfer effective_speed_hz. By doing so the core will be able to execute the xfer-related delays with better accuracy. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 86954c98fc3092cb6679ffcf108761b94ecdff34 Merge: 9cb1fd0efd19 8fc0e48e0fae Author: Rafael J. Wysocki Date: Fri May 29 16:40:46 2020 +0200 Merge tag 'devfreq-next-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Pull devfreq updates for v5.8 from Chanwoo Choi: "1. Update devfreq core - Use lockdep function for checking mutex state instead of manual checking. - Replace strncpy with strscpy to fix the compile warning. 2. Update devfreq driver - Add new imx-bus.c devfreq driver for controlling the bus frequenncy and it registers the imx interconnect device which indicates the imx-bus.c as the parent device. This relation make the connection between imx-bus.c and imx interconnect nodes. In result, the imx-bus.c devfreq driver handles the DEV_PM_QOS_MIN_FREQUENCY requirements from imx interconnect nodes in order to support the minimum bus bandwidth of interconnect nodes. - Delete unneed error message and update the boosting on tegra30-devfreq.c." * tag 'devfreq-next-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR PM / devfreq: Replace strncpy with strscpy PM / devfreq: imx: Register interconnect device PM / devfreq: Add generic imx bus scaling driver PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe() PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting commit b1cb6ad7350e0fd5d722b04921a3c070d527d459 Merge: 50ce4c099beb 25ca180ad380 Author: Kalle Valo Date: Fri May 29 17:37:25 2020 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.8. Major changes: ath10k * SDIO and SNOC are not experimental anymore commit cc23402c1c2de8b1815212f3924cdbc3cda02b94 Author: Yufen Yu Date: Thu Mar 5 16:06:39 2020 +0800 fs: fix indentation in deactivate_super() Fix the breaked indent in deactive_super(). Signed-off-by: Yufen Yu Signed-off-by: Al Viro commit 5ad05cc8e0463f106be7ef5d1074dd877132d60a Author: Nikolay Borisov Date: Wed Mar 4 18:12:45 2020 +0200 vfs: Remove duplicated d_mountpoint check in __is_local_mountpoint This function acts as an out-of-line helper for is_local_mountpoint is only called after the latter verifies the dentry is not a mountpoint. There's no semantic changes and the resulting object code is smaller: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26 (-26) Function old new delta __is_local_mountpoint 147 121 -26 Total: Before=34161, After=34135, chg -0.08% Signed-off-by: Nikolay Borisov Signed-off-by: Al Viro commit b8f06b0444ec146e3ae98caac8039c77e5308ce2 Author: Lai Jiangshan Date: Fri May 29 06:59:02 2020 +0000 workqueue: remove useless unlock() and lock() in series This is no point to unlock() and then lock() the same mutex back to back. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 4f3f4cf388f8fda7ee8ea7c6af0ff0ebb2d05fe4 Author: Lai Jiangshan Date: Fri May 29 06:58:59 2020 +0000 workqueue: void unneeded requeuing the pwq in rescuer thread 008847f66c3 ("workqueue: allow rescuer thread to do more work.") made the rescuer worker requeue the pwq immediately if there may be more work items which need rescuing instead of waiting for the next mayday timer expiration. Unfortunately, it checks only whether the pool needs help from rescuers, but it doesn't check whether the pwq has work items in the pool (the real reason that this rescuer can help for the pool). The patch adds the check and void unneeded requeuing. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit bac42fb21259783cb748ae54227a5e755340a396 Author: Al Viro Date: Sun Apr 26 09:27:23 2020 -0400 comedi: get rid of compat_alloc_user_space() mess in COMEDI_CMD{,TEST} compat Signed-off-by: Al Viro commit 0a3ccc75a95ff682de9315dee7e55efde1d5e30c Author: Al Viro Date: Sun Apr 26 09:01:49 2020 -0400 comedi: do_cmd_ioctl(): lift copyin/copyout into the caller Signed-off-by: Al Viro commit f0e4de5cd0bb99a82445c5a3a876f162052689f8 Author: Al Viro Date: Sun Apr 26 08:56:55 2020 -0400 comedi: do_cmdtest_ioctl(): lift copyin/copyout into the caller Signed-off-by: Al Viro commit 00035beeec2c067a8094d3d86b34cc797c3d6b21 Author: Al Viro Date: Sun Apr 26 08:46:04 2020 -0400 comedi: lift copy_from_user() into callers of __comedi_get_user_cmd() Signed-off-by: Al Viro commit b8d47d8813055ce38c0d2ad913d5462017e52692 Author: Al Viro Date: Sat Apr 25 20:33:04 2020 -0400 comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSNLIST compat Signed-off-by: Al Viro commit aa332e6759fac21b454e4959703777c771a9cd93 Author: Al Viro Date: Sat Apr 25 20:11:57 2020 -0400 comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSN compat Just take copy_from_user() out of do_insn_ioctl() into the caller and have compat_insn() build a native version and pass it to do_insn_ioctl() directly. One difference from the previous commits is that the helper used to convert 32bit variant to native has two users - compat_insn() and compat_insnlist(). The latter will be converted in next commit; for now we simply split the helper in two variants - "userland 32bit to kernel native" and "userland 32bit to userland native". The latter is renamed old get_compat_insn(); it will be gone in the next commit. Signed-off-by: Al Viro commit 7e7bbddd029b644f00f0ffbfbc485ed71977d0d5 Author: Zijun Hu Date: Fri May 29 21:56:57 2020 +0800 Bluetooth: hci_qca: Fix qca6390 enable failure after warm reboot Warm reboot can not reset controller qca6390 due to lack of controllable power supply, so causes firmware download failure during enable. Fixed by sending VSC EDL_SOC_RESET to reset qca6390 within added device shutdown implementation. Signed-off-by: Zijun Hu Tested-by: Zijun Hu Signed-off-by: Marcel Holtmann commit a9b8a985294debae00f6c087dfec8c384d30a3b9 Author: Sebastian Andrzej Siewior Date: Wed May 27 21:46:33 2020 +0200 workqueue: Convert the pool::lock and wq_mayday_lock to raw_spinlock_t The workqueue code has it's internal spinlocks (pool::lock), which are acquired on most workqueue operations. These spinlocks are converted to 'sleeping' spinlocks on a RT-kernel. Workqueue functions can be invoked from contexts which are truly atomic even on a PREEMPT_RT enabled kernel. Taking sleeping locks from such contexts is forbidden. The pool::lock hold times are bound and the code sections are relatively short, which allows to convert pool::lock and as a consequence wq_mayday_lock to raw spinlocks which are truly spinning locks even on a PREEMPT_RT kernel. With the previous conversion of the manager waitqueue to a simple waitqueue workqueues are now fully RT compliant. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Lai Jiangshan Signed-off-by: Tejun Heo commit d8bb65ab70f702531aaaa11d9710f9450078e295 Author: Sebastian Andrzej Siewior Date: Wed May 27 21:46:32 2020 +0200 workqueue: Use rcuwait for wq_manager_wait The workqueue code has it's internal spinlock (pool::lock) and also implicit spinlock usage in the wq_manager waitqueue. These spinlocks are converted to 'sleeping' spinlocks on a RT-kernel. Workqueue functions can be invoked from contexts which are truly atomic even on a PREEMPT_RT enabled kernel. Taking sleeping locks from such contexts is forbidden. pool::lock can be converted to a raw spinlock as the lock held times are short. But the workqueue manager waitqueue is handled inside of pool::lock held regions which again violates the lock nesting rules of raw and regular spinlocks. The manager waitqueue has no special requirements like custom wakeup callbacks or mass wakeups. While it does not use exclusive wait mode explicitly there is no strict requirement to queue the waiters in a particular order as there is only one waiter at a time. This allows to replace the waitqueue with rcuwait which solves the locking problem because rcuwait relies on existing locking. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tejun Heo commit c1f615e4f463b1620fff51d1c08a5e83c1683d6b Merge: 0c680ffb99ea 752db83a5dfd Author: Mark Brown Date: Fri May 29 14:36:03 2020 +0100 Merge series "Fix regulators coupling for Exynos5800" from Marek Szyprowski : Hi! This patchset is another attempt to fix the regulator coupling on Exynos5800/5422 SoCs. Here are links to the previous attempts: https://lore.kernel.org/linux-samsung-soc/20191008101709.qVNy8eijBi0LynOteWFMnTg4GUwKG599n6OyYoX1Abs@z/ https://lore.kernel.org/lkml/20191017102758.8104-1-m.szyprowski@samsung.com/ https://lore.kernel.org/linux-pm/cover.1589528491.git.viresh.kumar@linaro.org/ https://lore.kernel.org/linux-pm/20200528131130.17984-1-m.szyprowski@samsung.com/ The problem is with "vdd_int" regulator coupled with "vdd_arm" on Odroid XU3/XU4 boards family. "vdd_arm" is handled by CPUfreq. "vdd_int" is handled by devfreq. CPUfreq initialized quite early during boot and it starts changing OPPs and "vdd_arm" value. Sometimes CPU activity during boot goes down and some low-frequency OPPs are selected, what in turn causes lowering "vdd_arm". This happens before devfreq applies its requirements on "vdd_int". Regulator balancing code reduces "vdd_arm" voltage value, what in turn causes lowering "vdd_int" value to the lowest possible value. This is much below the operation point of the wcore bus, which still runs at the highest frequency. The issue was hard to notice because in the most cases the board managed to boot properly, even when the regulator was set to lowest value allowed by the regulator constraints. However, it caused some random issues, which can be observed as "Unhandled prefetch abort" or low USB stability. Adding more and more special cases to the generic code has been rejected, so the only way to ensure the desired behavior on Exynos5800-based SoCs is to make a custom regulator coupler driver. Best regards, Marek Szyprowski Patch summary: Marek Szyprowski (2): regulator: extract voltage balancing code to separate function soc: samsung: Add simple voltage coupler for Exynos5800 arch/arm/mach-exynos/Kconfig | 1 + drivers/regulator/core.c | 49 ++++++++------- drivers/soc/samsung/Kconfig | 3 + drivers/soc/samsung/Makefile | 1 + .../soc/samsung/exynos-regulator-coupler.c | 59 +++++++++++++++++++ include/linux/regulator/coupler.h | 8 +++ 6 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 drivers/soc/samsung/exynos-regulator-coupler.c -- 2.17.1 base-commit: 8f3d9f354286745c751374f5f1fcafee6b3f3136 commit 752db83a5dfd4fd3a0624b9ab440ed947fa003ca Author: Marek Szyprowski Date: Fri May 29 14:49:39 2020 +0200 regulator: extract voltage balancing code to the separate function Move the coupled regulators voltage balancing code to the separate function and allow to call it from the custom regulator couplers. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200529124940.10675-2-m.szyprowski@samsung.com Signed-off-by: Mark Brown commit 28ff437a44fa618a14bc7402c7472b278af4c9eb Author: Pierre-Louis Bossart Date: Fri May 29 07:36:13 2020 -0500 ASoC: reduce verbosity of error messages for sof-dai and sof-link Recent changes result in multiple dmesg traces such as: [ 14.410435] Audio Port: ASoC: error at snd_soc_link_startup on Audio Port: 1 [ 14.410446] sst-mfld-platform sst-mfld-platform: ASoC: error at snd_soc_dai_startup on media-cpu-dai: 1 These messages are not really errors, when dai and dai-link callbacks return the value of e.g. snd_pcm_hw_constraint_single() the result is "Positive if the value is changed, zero if it's not changed, or a negative error code" Add a simple test to skip the checks for positive returned values Suggested-by: Kuninori Morimoto Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200529123613.13447-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f00eb5ff2f6ffc4a2f0fc0e829410082bff0f78e Author: Colin Ian King Date: Wed Apr 29 16:48:47 2020 +0100 EDAC/amd64: Remove redundant assignment to variable ret in hw_info_get() The variable ret is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant so remove it. Signed-off-by: Colin Ian King Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200429154847.287001-1-colin.king@canonical.com commit 71974cfb6737d45cba66189cdc0f8ba3397e8fe0 Author: Jacob Pan Date: Thu May 28 11:03:51 2020 -0700 iommu/vt-d: Fix compile warning Make intel_svm_unbind_mm() a static function. Fixes: 064a57d7ddfc ("iommu/vt-d: Replace intel SVM APIs with generic SVA APIs") Reported-by: kbuild test robot Signed-off-by: Jacob Pan Acked-by: Lu Baolu Link: https://lore.kernel.org/r/1590689031-79318-1-git-send-email-jacob.jun.pan@linux.intel.com Signed-off-by: Joerg Roedel commit bba9cc2cf82840bd3c9b3f4f7edac2dc8329c241 Author: Jon Derrick Date: Wed May 27 10:56:17 2020 -0600 iommu/vt-d: Remove real DMA lookup in find_domain By removing the real DMA indirection in find_domain(), we can allow sub-devices of a real DMA device to have their own valid device_domain_info. The dmar lookup and context entry removal paths have been fixed to account for sub-devices. Fixes: 2b0140c69637 ("iommu/vt-d: Use pci_real_dma_dev() for mapping") Signed-off-by: Jon Derrick Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200527165617.297470-4-jonathan.derrick@intel.com Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207575 Signed-off-by: Joerg Roedel commit 4fda230ecddc2573ed88632e98b69b0b9b68c0ad Author: Jon Derrick Date: Wed May 27 10:56:16 2020 -0600 iommu/vt-d: Allocate domain info for real DMA sub-devices Sub-devices of a real DMA device might exist on a separate segment than the real DMA device and its IOMMU. These devices should still have a valid device_domain_info, but the current dma alias model won't allocate info for the subdevice. This patch adds a segment member to struct device_domain_info and uses the sub-device's BDF so that these sub-devices won't alias to other devices. Fixes: 2b0140c69637e ("iommu/vt-d: Use pci_real_dma_dev() for mapping") Cc: stable@vger.kernel.org # v5.6+ Signed-off-by: Jon Derrick Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200527165617.297470-3-jonathan.derrick@intel.com Signed-off-by: Joerg Roedel commit 8038bdb8553313ad53bfcffcf8294dd0ab44618f Author: Jon Derrick Date: Wed May 27 10:56:15 2020 -0600 iommu/vt-d: Only clear real DMA device's context entries Domain context mapping can encounter issues with sub-devices of a real DMA device. A sub-device cannot have a valid context entry due to it potentially aliasing another device's 16-bit ID. It's expected that sub-devices of the real DMA device uses the real DMA device's requester when context mapping. This is an issue when a sub-device is removed where the context entry is cleared for all aliases. Other sub-devices are still valid, resulting in those sub-devices being stranded without valid context entries. The correct approach is to use the real DMA device when programming the context entries. The insertion path is correct because device_to_iommu() will return the bus and devfn of the real DMA device. The removal path needs to only operate on the real DMA device, otherwise the entire context entry would be cleared for all sub-devices of the real DMA device. This patch also adds a helper to determine if a struct device is a sub-device of a real DMA device. Fixes: 2b0140c69637e ("iommu/vt-d: Use pci_real_dma_dev() for mapping") Cc: stable@vger.kernel.org # v5.6+ Signed-off-by: Jon Derrick Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200527165617.297470-2-jonathan.derrick@intel.com Signed-off-by: Joerg Roedel commit 9b98f92ca446f4302607a88fbb67619af968f3cf Merge: 4bcc6a0bc8d7 93b929922dba Author: Mark Brown Date: Fri May 29 14:03:32 2020 +0100 Merge remote-tracking branch 'regmap/for-5.8' into regmap-next commit 4bcc6a0bc8d75c1d9f9c4b7c3acfb7a210321b74 Merge: 9cb1fd0efd19 74edd08a4fbf Author: Mark Brown Date: Fri May 29 14:03:30 2020 +0100 Merge remote-tracking branch 'regmap/for-5.7' into regmap-linus commit 93b929922dba3a42b0439ef13144c6032b7733c8 Merge: 626ceee334f9 aa2ff9dbaedd Author: Mark Brown Date: Fri May 29 14:00:44 2020 +0100 Merge series "regmap: provide simple bitops and use them in a driver" from Bartosz Golaszewski Bartosz Golaszewski : From: Bartosz Golaszewski I noticed that oftentimes I use regmap_update_bits() for simple bit setting or clearing. In this case the fourth argument is superfluous as it's always 0 or equal to the mask argument. This series proposes to add simple bit operations for setting, clearing and testing specific bits with regmap. The second patch uses all three in a driver that got recently picked into the net-next tree. The patches obviously target different trees so - if you're ok with the change itself - I propose you pick the first one into your regmap tree for v5.8 and then I'll resend the second patch to add the first user for these macros for v5.9. v1 -> v2: - convert the new macros to static inline functions v2 -> v3: - drop unneeded ternary operator Bartosz Golaszewski (2): regmap: provide helpers for simple bit operations net: ethernet: mtk-star-emac: use regmap bitops drivers/base/regmap/regmap.c | 22 +++++ drivers/net/ethernet/mediatek/mtk_star_emac.c | 80 ++++++++----------- include/linux/regmap.h | 36 +++++++++ 3 files changed, 93 insertions(+), 45 deletions(-) base-commit: 8f3d9f354286745c751374f5f1fcafee6b3f3136 -- 2.26.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel commit 626ceee334f94852a1864b54d376290298cf9e4c Merge: 82f25bd73c0b 8baebfc2aca2 Author: Mark Brown Date: Fri May 29 14:00:43 2020 +0100 Merge series "New DSA driver for VSC9953 Seville switch" from Vladimir Oltean : Looking at the Felix and Ocelot drivers, Maxim asked if it would be possible to use them as a base for a new driver for the switch inside NXP T1040. Turns out, it is! The result is a driver eerily similar to Felix. The biggest challenge seems to be getting register read/write API generic enough to cover such wild bitfield variations between hardware generations. There is a patch on the regmap core which I would like to get in through the networking subsystem, if possible (and if Mark is ok), since it's a trivial addition. Maxim Kochetkov (4): soc/mscc: ocelot: add MII registers description net: mscc: ocelot: convert SYS_PAUSE_CFG register access to regfield net: mscc: ocelot: extend watermark encoding function net: dsa: ocelot: introduce driver for Seville VSC9953 switch Vladimir Oltean (7): regmap: add helper for per-port regfield initialization net: mscc: ocelot: unexport ocelot_probe_port net: mscc: ocelot: convert port registers to regmap net: mscc: ocelot: convert QSYS_SWITCH_PORT_MODE and SYS_PORT_MODE to regfields net: dsa: ocelot: create a template for the DSA tags on xmit net: mscc: ocelot: split writes to pause frame enable bit and to thresholds net: mscc: ocelot: disable flow control on NPI interface drivers/net/dsa/ocelot/Kconfig | 12 + drivers/net/dsa/ocelot/Makefile | 6 + drivers/net/dsa/ocelot/felix.c | 49 +- drivers/net/dsa/ocelot/felix_vsc9959.c | 72 +- drivers/net/dsa/ocelot/seville.c | 742 +++++++++++++++ drivers/net/dsa/ocelot/seville.h | 50 + drivers/net/dsa/ocelot/seville_vsc9953.c | 1064 ++++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot.c | 87 +- drivers/net/ethernet/mscc/ocelot.h | 9 +- drivers/net/ethernet/mscc/ocelot_board.c | 21 +- drivers/net/ethernet/mscc/ocelot_io.c | 18 +- drivers/net/ethernet/mscc/ocelot_regs.c | 57 ++ include/linux/regmap.h | 8 + include/soc/mscc/ocelot.h | 68 +- include/soc/mscc/ocelot_dev.h | 78 -- include/soc/mscc/ocelot_qsys.h | 13 - include/soc/mscc/ocelot_sys.h | 23 - net/dsa/tag_ocelot.c | 21 +- 18 files changed, 2196 insertions(+), 202 deletions(-) create mode 100644 drivers/net/dsa/ocelot/seville.c create mode 100644 drivers/net/dsa/ocelot/seville.h create mode 100644 drivers/net/dsa/ocelot/seville_vsc9953.c base-commit: 8f3d9f354286745c751374f5f1fcafee6b3f3136 -- 2.25.1 commit aa2ff9dbaeddabb5ad166db5f9f1a0580a8bbba8 Author: Bartosz Golaszewski Date: Thu May 28 17:45:02 2020 +0200 regmap: provide helpers for simple bit operations In many instances regmap_update_bits() is used for simple bit setting and clearing. In these cases the last argument is redundant and we can hide it with a static inline function. This adds three new helpers for simple bit operations: set_bits, clear_bits and test_bits (the last one defined as a regular function). Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20200528154503.26304-2-brgl@bgdev.pl Signed-off-by: Mark Brown commit edcc40d2ab5f47f205c2dd2a9aeedd8c77de050a Author: Jean-Philippe Brucker Date: Thu Apr 23 14:53:30 2020 +0200 iommu: Remove iommu_sva_ops::mm_exit() After binding a device to an mm, device drivers currently need to register a mm_exit handler. This function is called when the mm exits, to gracefully stop DMA targeting the address space and flush page faults to the IOMMU. This is deemed too complex for the MMU release() notifier, which may be triggered by any mmput() invocation, from about 120 callsites [1]. The upcoming SVA module has an example of such complexity: the I/O Page Fault handler would need to call mmput_async() instead of mmput() after handling an IOPF, to avoid triggering the release() notifier which would in turn drain the IOPF queue and lock up. Another concern is the DMA stop function taking too long, up to several minutes [2]. For some mmput() callers this may disturb other users. For example, if the OOM killer picks the mm bound to a device as the victim and that mm's memory is locked, if the release() takes too long, it might choose additional innocent victims to kill. To simplify the MMU release notifier, don't forward the notification to device drivers. Since they don't stop DMA on mm exit anymore, the PASID lifetime is extended: (1) The device driver calls bind(). A PASID is allocated. Here any DMA fault is handled by mm, and on error we don't print anything to dmesg. Userspace can easily trigger errors by issuing DMA on unmapped buffers. (2) exit_mmap(), for example the process took a SIGKILL. This step doesn't happen during normal operations. Remove the pgd from the PASID table, since the page tables are about to be freed. Invalidate the IOTLBs. Here the device may still perform DMA on the address space. Incoming transactions are aborted but faults aren't printed out. ATS Translation Requests return Successful Translation Completions with R=W=0. PRI Page Requests return with Invalid Request. (3) The device driver stops DMA, possibly following release of a fd, and calls unbind(). PASID table is cleared, IOTLB invalidated if necessary. The page fault queues are drained, and the PASID is freed. If DMA for that PASID is still running here, something went seriously wrong and errors should be reported. For now remove iommu_sva_ops entirely. We might need to re-introduce them at some point, for example to notify device drivers of unhandled IOPF. [1] https://lore.kernel.org/linux-iommu/20200306174239.GM31668@ziepe.ca/ [2] https://lore.kernel.org/linux-iommu/4d68da96-0ad5-b412-5987-2f7a6aa796c3@amd.com/ Signed-off-by: Jean-Philippe Brucker Acked-by: Jacob Pan Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200423125329.782066-3-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit fb01562e5a8a731bb1807eba0a9fadb355ca2277 Author: Jean-Philippe Brucker Date: Thu Apr 23 14:53:28 2020 +0200 uacce: Remove mm_exit() op The mm_exit() op will be removed from the SVA API. When a process dies and its mm goes away, the IOMMU driver won't notify device drivers anymore. Drivers should expect to handle a lot more aborted DMA. On the upside, it does greatly simplify the queue management. The uacce_mm struct, that tracks all queues bound to an mm, was only used by the mm_exit() callback. Remove it. Signed-off-by: Jean-Philippe Brucker Acked-by: Jacob Pan Acked-by: Lu Baolu Acked-by: Zhangfei Gao Link: https://lore.kernel.org/r/20200423125329.782066-2-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 8baebfc2aca26e3fa67ab28343671b82be42b22c Author: Vladimir Oltean Date: Thu May 28 02:41:03 2020 +0300 regmap: add helper for per-port regfield initialization Similar to the standalone regfields, add an initializer for the users who need to set .id_size and .id_offset in order to use the regmap_fields_update_bits_base API. Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20200527234113.2491988-2-olteanv@gmail.com Signed-off-by: Mark Brown commit 67866ff9b7a7d9d4a3030efaadb079290ebaf967 Merge: 36124fb19f1a c2cbd0a7194d Author: Mark Brown Date: Fri May 29 13:30:08 2020 +0100 Merge series "ASoC topology header parsing refinement" from Keyon Jie : This small series is to optimize the header logging during the topology parsing. This is verified work fine on both SOF and SST drivers. Change History: v3: - Remove using the separated soc_pass_load() function and merge it to the soc_tplg_load_header() body. - Add more Tested-by tags. v2: - Change the internal used array to be 'static' to fix the issue reported by: kbuild test robot - Add testing coverage including Intel SST driver also. v1: - Initial version. Keyon Jie (2): ASoC: topology: refine and log the header in the correct pass ASoC: topology: remove the redundant pass checks sound/soc/soc-topology.c | 96 ++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 58 deletions(-) -- 2.25.1 commit 36124fb19f1ae68a500cd76a76d40c6e81bee346 Author: Xiyu Yang Date: Mon May 25 22:12:46 2020 +0800 ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed fsl_asrc_dma_hw_params() invokes dma_request_channel() or fsl_asrc_get_dma_channel(), which returns a reference of the specified dma_chan object to "pair->dma_chan[dir]" with increased refcnt. The reference counting issue happens in one exception handling path of fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End, the function forgets to decrease the refcnt increased by dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt leak. Fix this issue by calling dma_release_channel() when config DMA channel failed. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Link: https://lore.kernel.org/r/1590415966-52416-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Mark Brown commit 2aec8ccc1a814ca41b70710e1960afd034d1e3ab Author: derek.fang Date: Fri May 29 19:05:10 2020 +0800 ASoC: rt1015: Enable class-D silence and clock detections Avoid noise under bypass boost mode. Signed-off-by: derek.fang Link: https://lore.kernel.org/r/1590750310-30085-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown commit c8b47d63ad8755780b6b70dbe57ab8333bcc4a0f Author: Dan Murphy Date: Thu May 28 09:47:11 2020 -0500 ASoC: tlv320adcx140: Fix dt-binding-check issue Fix dt-binding-check issue ti,gpi-config:0:0: 4 is greater than the maximum of 1 ti,gpi-config:0:1: 5 is greater than the maximum of 1 ti,gpi-config:0:2: 6 is greater than the maximum of 1 ti,gpi-config:0:3: 7 is greater than the maximum of 1 Reported-by: Rob Herring Signed-off-by: Dan Murphy Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200528144711.18065-1-dmurphy@ti.com Signed-off-by: Mark Brown commit 65bd91dd6957390c42a0491b9622cf31a2cdb140 Author: Dinghao Liu Date: Fri May 29 09:22:28 2020 +0800 ASoC: img-i2s-out: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200529012230.5863-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit c2cbd0a7194d05be501fe2cb48bcd10ff468aa87 Author: Keyon Jie Date: Wed May 27 10:28:01 2020 +0800 ASoC: topology: remove the redundant pass checks As we have check the 'pass' in the soc_elem_pass_load(), so no need to check it again in each specific elem_load function, at the same time, the tplg->pos will be reset to the next header base when the pass is mismatched, so the increasing of the tplg->pos in these cases made no sense. Here remove all of them. Signed-off-by: Keyon Jie Tested-by: Vamshi Kerishna Gopal Tested-by: Cezary Rojewski Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200527022801.336264-3-yang.jie@linux.intel.com Signed-off-by: Mark Brown commit 82ed7418736ded9c24529987d5aa9a39c185e4e9 Author: Keyon Jie Date: Wed May 27 10:28:00 2020 +0800 ASoC: topology: refine and log the header in the correct pass The check (tplg->pass == le32_to_cpu(hdr->type)) makes no sense as it is comparing two different enums, refine the element loading functions, and log the information when the header is being parsed in the corresponding parsing pass. Signed-off-by: Keyon Jie Tested-by: Vamshi Kerishna Gopal Tested-by: Cezary Rojewski Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200527022801.336264-2-yang.jie@linux.intel.com Signed-off-by: Mark Brown commit 34765c19cce3cba0c94d471d2e84f71d4978996e Author: Viresh Kumar Date: Thu May 9 10:13:46 2019 +0530 i2c: sh_mobile: simplify code and remove false compilation warning This currently generates a warning: drivers/i2c/busses/i2c-sh_mobile.c: In function 'sh_mobile_i2c_isr': drivers/i2c/busses/i2c-sh_mobile.c:399:26: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized] Though the code looks okay and shouldn't ever use the variable uninitialized. Fix the warning by moving the code around and getting rid of 'data'. Signed-off-by: Viresh Kumar Tested-by: Wolfram Sang [wsa: minor updates to commit message] Signed-off-by: Wolfram Sang commit a1b44ea340b21c99b34c93acad233da727cb88ba Author: satya priya Date: Fri May 29 15:44:42 2020 +0530 tty: serial: qcom_geni_serial: Add 51.2MHz frequency support To support BT use case over UART at baud rate of 3.2 Mbps, we need SE clocks to run at 51.2MHz frequency. Previously this frequency was not available in clk src, so, we were requesting for 102.4 MHz and dividing it internally by 2 to get 51.2MHz. As now 51.2MHz frequency is made available in clk src, adding this frequency to UART frequency table. We will save significant amount of power, if 51.2 is used because it belongs to LowSVS range whereas 102.4 fall into Nominal category. Signed-off-by: satya priya Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/1590747282-5487-1-git-send-email-skakit@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit e6da0edc24eecef2f6964d92fa9044e1821deace Author: Sebastian Andrzej Siewior Date: Thu May 28 14:35:12 2020 +0200 Bluetooth: Acquire sk_lock.slock without disabling interrupts There was a lockdep which led to commit fad003b6c8e3d ("Bluetooth: Fix inconsistent lock state with RFCOMM") Lockdep noticed that `sk->sk_lock.slock' was acquired without disabling the softirq while the lock was also used in softirq context. Unfortunately the solution back then was to disable interrupts before acquiring the lock which however made lockdep happy. It would have been enough to simply disable the softirq. Disabling interrupts before acquiring a spinlock_t is not allowed on PREEMPT_RT because these locks are converted to 'sleeping' spinlocks. Use spin_lock_bh() in order to acquire the `sk_lock.slock'. Reported-by: Luis Claudio R. Goncalves Reported-by: kbuild test robot [missing unlock] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Marcel Holtmann commit 4803c54ca24923a30664bea2a7772db6e7303c51 Author: Chuhong Yuan Date: Fri May 29 10:27:26 2020 +0800 Bluetooth: btmtkuart: Improve exception handling in btmtuart_probe() Calls of the functions clk_disable_unprepare() and hci_free_dev() were missing for the exception handling. Thus add the missed function calls together with corresponding jump targets. Fixes: 055825614c6b ("Bluetooth: btmtkuart: add an implementation for clock osc property") Signed-off-by: Chuhong Yuan Signed-off-by: Marcel Holtmann commit feac90d756c03b03b83fabe83571bd88ecc96b78 Author: Zijun Hu Date: Fri May 29 04:31:07 2020 +0800 Bluetooth: hci_qca: Fix suspend/resume functionality failure @dev parameter of qca_suspend()/qca_resume() represents serdev_device, but it is mistook for hci_dev and causes succedent unexpected memory access. Fix by taking @dev as serdev_device. Fixes: 41d5b25fed0 ("Bluetooth: hci_qca: add PM support") Signed-off-by: Zijun Hu Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit d1d996afbd2bca3bf3c484fc1f7a738134d65207 Author: Matthias Schiffer Date: Thu May 28 17:47:47 2020 +0200 tty: serial: imx: clear Ageing Timer Interrupt in handler The AGTIM flag must be cleared explicitly, otherwise the IRQ handler will be called in an endless loop. Fortunately, this issue currently doesn't affect mainline kernels in practice, as the the RX FIFO trigger level is set to 1 in UFCR. When setting the trigger level to a higher number, the issue is trivially reproducible by any RX without DMA that doesn't fill the FIFO up to the configured level. Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20200528154747.14201-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman commit 423d9118c6240eabb78bd3c75fc91ba6e3151431 Author: Ji-Ze Hong (Peter Hong) Date: Thu May 28 10:24:29 2020 +0800 serial: 8250_fintek: Add F81966 Support Fintek F81966 is a LPC/eSPI to 6 UARTs SuperIO. It has fully compatible with F81866. It's also need check the IRQ mode with system assigned. F81966 IRQ Mode setting: 0xf0 Bit1: IRQ_MODE0 Bit0: Share mode (always on) 0xf6 Bit3: IRQ_MODE1 Level/Low: IRQ_MODE0:0, IRQ_MODE1:0 Edge/High: IRQ_MODE0:1, IRQ_MODE1:0 Signed-off-by: Ji-Ze Hong (Peter Hong) Cc: Ji-Ze Hong (Peter Hong) Link: https://lore.kernel.org/r/20200528022429.32078-1-hpeter+linux_kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 34f853b849eb6a509eb8f40f2f5946ebb1f62739 Author: Gao Xiang Date: Thu May 28 04:48:44 2020 -0400 erofs: suppress false positive last_block warning As Andrew mentioned, some rare specific gcc versions could report last_block uninitialized warning. Actually last_block doesn't need to be uninitialized first from its implementation due to bio == NULL condition. After a bio is allocated, last_block will be assigned then. The detailed analysis is in this thread [1]. So let's silence those confusing gccs simply. [1] https://lore.kernel.org/r/20200421072839.GA13867@hsiangkao-HP-ZHAN-66-Pro-G1 Cc: Andrew Morton Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20200528084844.23359-1-hsiangkao@redhat.com Signed-off-by: Gao Xiang commit f57a3fe44995a3820192e0cf7c3ebdecedd9586e Author: Chao Yu Date: Fri May 29 18:48:36 2020 +0800 erofs: convert to use the new mount fs_context api Convert the erofs to use new internal mount API as the old one will be obsoleted and removed. This allows greater flexibility in communication of mount parameters between userspace, the VFS and the filesystem. See Documentation/filesystems/mount_api.txt for more information. Cc: Al Viro Cc: David Howells Signed-off-by: Chao Yu Link: https://lore.kernel.org/r/20200529104836.17843-1-hsiangkao@redhat.com Signed-off-by: Gao Xiang commit 01590f361e94a01e9b9868fa81d4079d255c681f Author: Jean Delvare Date: Mon Mar 16 11:24:48 2020 +0100 i2c: i801: Instantiate SPD EEPROMs automatically Call the function to instantiate SPD EEPROMs automatically on the main SMBus controller. Multiplexed SMBus systems are excluded for now as they are more complex to handle. Signed-off-by: Jean Delvare Signed-off-by: Wolfram Sang commit 5ace60859e84113b7a185c117fbf2c429d381b59 Author: Jean Delvare Date: Mon Mar 16 11:22:24 2020 +0100 i2c: smbus: Add a way to instantiate SPD EEPROMs automatically In simple cases we can instantiate SPD EEPROMs on the SMBus automatically. Start with just DDR2, DDR3 and DDR4 on x86 for now, and only for systems with no more than 4 memory slots. These limitations may be lifted later. Signed-off-by: Jean Delvare [wsa: minor change for new API] Signed-off-by: Wolfram Sang commit 9eb90d57b55a0af499e8fee14ef942e80ad5f6f9 Author: Pascal Huerst Date: Fri May 29 07:50:58 2020 +0200 sc16is7xx: Add flag to activate IrDA mode This series of uart controllers is able to work in IrDA mode. Add per-port flag to the device-tree to enable that feature if needed. Signed-off-by: Pascal Huerst Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20200529055058.1606910-3-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit 4a9b984fe425cc48f24a4c00305cf10663dfe9f9 Author: Pascal Huerst Date: Fri May 29 07:50:57 2020 +0200 dt-bindings: sc16is7xx: Add flag to activate IrDA mode This series of uart controllers is able to work in IrDA mode. This adds a property to the device tree to enable that feature on selected ports if needed. Signed-off-by: Pascal Huerst Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200529055058.1606910-2-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit d58a2df3d8877b91ecbfb936a15da364251a228f Author: Lukas Wunner Date: Mon May 18 16:45:02 2020 +0200 serial: 8250: Support rs485 bus termination GPIO Commit e8759ad17d41 ("serial: uapi: Add support for bus termination") introduced the ability to enable rs485 bus termination from user space. So far the feature is only used by a single driver, 8250_exar.c, using a hardcoded GPIO pin specific to Siemens IOT2040 products. Provide for a more generic solution by allowing specification of an rs485 bus termination GPIO pin in the device tree: Amend the serial core to retrieve the GPIO from the device tree (or ACPI table) and amend the default ->rs485_config() callback for 8250 drivers to change the GPIO on request from user space. Perhaps 8250_exar.c can be converted to the generic approach in a follow-up patch. Signed-off-by: Lukas Wunner Reviewed-by: Andy Shevchenko Cc: Jan Kiszka Link: https://lore.kernel.org/r/94c6c800d1ca9fa04766dd1d43a8272c5ad4bedd.1589811297.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit f40a6be4a4e4985aef5365007e2459d757f26bdd Author: Heiko Stuebner Date: Sun May 17 23:56:06 2020 +0200 serial: 8520_port: Fix function param documentation The parameter is named p while the documentation talks about up. Fix the doc to be in line with the code. Fixes: 058bc104f7ca ("serial: 8250: Generalize rs485 software emulation") Suggested-by: Andy Shevchenko Signed-off-by: Heiko Stuebner Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200517215610.2131618-2-heiko@sntech.de Signed-off-by: Greg Kroah-Hartman commit 01c38ecff8b13947f7639cb7ca9998b21c2c0ae7 Author: Lukas Wunner Date: Mon May 18 16:45:01 2020 +0200 dt-bindings: serial: Add binding for rs485 bus termination GPIO Commit e8759ad17d41 ("serial: uapi: Add support for bus termination") introduced the ability to enable rs485 bus termination from user space. So far the feature is only used by a single driver, 8250_exar.c, using a hardcoded GPIO pin specific to Siemens IOT2040 products. Provide for a more generic solution by allowing specification of an rs485 bus termination GPIO pin in the device tree. An upcoming commit implements support for this pin for any 8250 driver. The binding is used in device trees of the "Revolution Pi" PLCs offered by KUNBUS. [Heiko Stuebner converted the binding to YAML, hence his Signed-off-by.] Signed-off-by: Heiko Stuebner Signed-off-by: Lukas Wunner Cc: Jan Kiszka Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/4f4411895dc52c846f766e7f7207ec412c4811b6.1589811297.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 254e175448b7dc2f40e41d8941ac925f07c5862b Author: Pali Rohár Date: Wed May 27 13:08:58 2020 +0200 mmc: core: Export device/vendor ids from Common CIS for SDIO cards Device/vendor ids from Common CIS (Card Information Structure) may be different as device/vendor ids from CIS on particular SDIO function. Kernel currently exports only device/vendor ids from SDIO functions and not "main" device/vendor ids from Common CIS. This patch exports "main" device/vendor ids for SDIO and SD combo cards at top level mmc device in sysfs hierarchy. Userspace can use e.g. udev rules to correctly match whole SDIO card based on Common CIS device/vendor id and not only one particular SDIO function. Having this information in userspace also helps developers to debug whole SDIO card as e.g. kernel mmc quirks use device/vendor ids from Common CIS and not from particular SDIO function. Also it allows to write userspace applications which list all connected SDIO cards based on CIS ids. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Link: https://lore.kernel.org/r/20200527110858.17504-2-pali@kernel.org Signed-off-by: Ulf Hansson commit c03ac5e6fad13c3ef9ce505191ae7419fda2fa4f Author: Pali Rohár Date: Wed May 27 13:08:57 2020 +0200 mmc: core: Do not export MMC_NAME= and MODALIAS=mmc:block for SDIO cards SDIO non-combo cards are not handled by mmc_block driver and do not have accessible CID register which is used for MMC_NAME= construction. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Link: https://lore.kernel.org/r/20200527110858.17504-1-pali@kernel.org Signed-off-by: Ulf Hansson commit dbdea70f71d672c12bc4454e7c258a8f78194d74 Author: Eugen Hristev Date: Wed May 27 13:56:59 2020 +0300 mmc: sdhci-of-at91: fix CALCR register being rewritten When enabling calibration at reset, the CALCR register was completely rewritten. This may cause certain bits being deleted unintentedly. Fix by issuing a read-modify-write operation. Fixes: 727d836a375a ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset") Signed-off-by: Eugen Hristev Link: https://lore.kernel.org/r/20200527105659.142560-1-eugen.hristev@microchip.com Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson commit 16e40e5b1e3c6646fd90d0c3186703d209216f03 Author: Haibo Chen Date: Tue May 26 18:22:02 2020 +0800 mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning In current code, we add 1ms dealy after each tuning command for standard tuning method. Adding this 1ms dealy is because USDHC default check the CMD CRC and DATA line. If detect the CMD CRC, USDHC standard tuning IC logic do not wait for the tuning data sending out by the card, trigger the buffer read ready interrupt immediately, and step to next cycle. So when next time the new tuning command send out by USDHC, card may still not send out the tuning data of the upper command,then some eMMC cards may stuck, can't response to any command, block the whole tuning procedure. If do not check the CMD CRC for tuning, then do not has this issue. USDHC will wait for the tuning data of each tuning command and check them. If the tuning data pass the check, it also means the CMD line also okay for tuning. So this patch disable the CMD CRC check for tuning, save some time for the whole tuning procedure. Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1590488522-9292-2-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 1194be8c949b8190b2882ad8335a5d98aa50c735 Author: Haibo Chen Date: Tue May 26 18:22:01 2020 +0800 mmc: sdhci-esdhc-imx: fix the mask for tuning start point According the RM, the bit[6~0] of register ESDHC_TUNING_CTRL is TUNING_START_TAP, bit[7] of this register is to disable the command CRC check for standard tuning. So fix it here. Fixes: d87fc9663688 ("mmc: sdhci-esdhc-imx: support setting tuning start point") Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1590488522-9292-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit f61404626113080863c904a459576ba0c03a49ba Author: Haibo Chen Date: Wed May 27 10:39:35 2020 +0800 mmc: host: sdhci-esdhc-imx: add wakeup feature for GPIO CD pin When use the specific GPIO to detect the card insert/remove, we can also add the GPIO as a wakeup source. When system suspend, insert or remove the card can wakeup the system. Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1590547175-15070-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 942d5e7bae36153a232102809bdf8b0a5ab110dc Author: Ludovic Barre Date: Tue May 26 17:51:03 2020 +0200 mmc: mmci_sdmmc: fix DMA API warning max segment size Turning on CONFIG_DMA_API_DEBUG_SG results in the following warning: WARNING: CPU: 1 PID: 85 at kernel/dma/debug.c:1302 debug_dma_map_sg+0x2a0/0x3cc mmci-pl18x 58005000.sdmmc: DMA-API: mapping sg segment longer than device claims to support [len=126976] [max=65536] dma api debug checks and compares the segment size to dma_get_max_seg_size (dev->dma_parms->max_segment_size), the sdmmc variant has an internal DMA and should define its max_segment_size constraint to avoid this warning. This Patch defines the dev->dma_parms->max_segment_size with the constraint already set for mmc core (host->mmc->max_seg_size). Signed-off-by: Ludovic Barre Link: https://lore.kernel.org/r/20200526155103.12514-3-ludovic.barre@st.com Signed-off-by: Ulf Hansson commit fe8d33bd33d527dee3155d2bccd714a655f37334 Author: Ludovic Barre Date: Tue May 26 17:51:02 2020 +0200 mmc: mmci_sdmmc: fix DMA API warning overlapping mappings Turning on CONFIG_DMA_API_DEBUG_SG results in the following warning: WARNING: CPU: 1 PID: 20 at kernel/dma/debug.c:500 add_dma_entry+0x16c/0x17c DMA-API: exceeded 7 overlapping mappings of cacheline 0x031d2645 Modules linked in: CPU: 1 PID: 20 Comm: kworker/1:1 Not tainted 5.5.0-rc2-00021-gdeda30999c2b-dirty #49 Hardware name: STM32 (Device Tree Support) Workqueue: events_freezable mmc_rescan [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xc0/0xd4) [] (dump_stack) from [] (__warn+0xd0/0xf8) [] (__warn) from [] (warn_slowpath_fmt+0x94/0xb8) [] (warn_slowpath_fmt) from [] (add_dma_entry+0x16c/0x17c) [] (add_dma_entry) from [] (debug_dma_map_sg+0xe4/0x3d4) [] (debug_dma_map_sg) from [] (sdmmc_idma_prep_data+0x94/0xf8) [] (sdmmc_idma_prep_data) from [] (mmci_prep_data+0x2c/0xb0) [] (mmci_prep_data) from [] (mmci_start_data+0x134/0x2f0) [] (mmci_start_data) from [] (mmci_request+0xe8/0x154) [] (mmci_request) from [] (mmc_start_request+0x94/0xbc) DMA api debug brings to light leaking dma-mappings, dma_map_sg and dma_unmap_sg are not correctly balanced. If a request is prepared, the dma_map/unmap are done in asynchronous call pre_req (prep_data) and post_req (unprep_data). In this case the dma-mapping is right balanced. But if the request was not prepared, the data->host_cookie is define to zero and the dma_map/unmap must be done in the request. The dma_map is called by mmci_dma_start (prep_data), but there is no dma_unmap in this case. This patch adds dma_unmap_sg when the dma is finalized and the data cookie is zero (request not prepared). Signed-off-by: Ludovic Barre Link: https://lore.kernel.org/r/20200526155103.12514-2-ludovic.barre@st.com Fixes: 46b723dd867d ("mmc: mmci: add stm32 sdmmc variant") Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson commit 36c6aadaae863024eae31dfce94db20a4514563d Author: Wan Ahmad Zainie Date: Tue May 26 14:27:57 2020 +0800 mmc: sdhci-of-arasan: Add support for Intel Keem Bay Intel Keem Bay SoC eMMC/SD/SDIO controller is based on Arasan SD 3.0 / eMMC 5.1 host controller IP. However, it does not support 64-bit access as its AXI interface has 32-bit address ports. Signed-off-by: Wan Ahmad Zainie Reviewed-by: Adrian Hunter Link: https://lore.kernel.org/r/20200526062758.17642-3-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Ulf Hansson commit ce3fefacfb028c9ce0fde464adf2e372fb156599 Author: Wan Ahmad Zainie Date: Tue May 26 14:27:56 2020 +0800 dt-bindings: mmc: arasan: Add compatible strings for Intel Keem Bay Add new compatible strings in sdhci-of-arasan.c to support Intel Keem Bay eMMC/SD/SDIO controller, based on Arasan SDHCI 5.1. Signed-off-by: Wan Ahmad Zainie Link: https://lore.kernel.org/r/20200526062758.17642-2-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Ulf Hansson commit f6bc8186a588627c7faf3f2f2615e4c0e4d454a6 Author: Vladimir Kondratiev Date: Mon May 25 10:40:53 2020 +0300 mmc: sdhci-cadence: fix PHY write Accordingly to Cadence documentation, PHY write procedure is: 1. Software sets the PHY Register Address (HRS04[5:0]) and the PHY Write Data (HRS04[15:8]) fields. 2. Software sets the PHY Write Transaction Request (HRS04[24]) field to 1. 3. Software waits as the PHY Write Transaction Acknowledge (HRS04[26]) field is equal to 0. 4. Hardware performs the write transaction to PHY register where HRS04[15:8] is a data written to register under HRS04[5:0] address. 5. Hardware sets the PHY Transaction Acknowledge (HRS04[26]) to 1 when transaction is completed. 6. Software clears the PHY Write Transaction Request (HRS04[24]) to 1 after noticing that the PHY Write Transaction Acknowledge (HRS04[26]) field is equal to 1. 7. Software waits for the PHY Acknowledge Register (HRS04[26]) field is equal to 0. Add missing steps 3 and 7. Lack of these steps causes integrity errors detested by hardware. Signed-off-by: Vladimir Kondratiev Link: https://lore.kernel.org/r/20200525074053.7309-1-vladimir.kondratiev@intel.com Signed-off-by: Ulf Hansson commit 798dd3c311f6c862719a3fc71c3c14eba192c64e Author: Pali Rohár Date: Fri May 22 16:44:12 2020 +0200 mmc: sdio: Sort all SDIO IDs in common include file Fix ordering of SDIO IDs to conform to the comment above, which says vendor first, device next. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-12-pali@kernel.org Signed-off-by: Ulf Hansson commit 1eb911258805695c8f85795d3d4cdbd1e84fc2d9 Author: Pali Rohár Date: Fri May 22 16:44:11 2020 +0200 mmc: sdio: Fix Cypress SDIO IDs macros in common include file All macro names for SDIO device IDs are prefixed by vendor name to which device ID belongs. So for consistency add Broadcom string vendor prefix to all Cypress macro names as they belong to SDIO Broadcom vendor ID. Change also Cypress 43012 value from decimal do hexadecimal notation to be consistent with all other values. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-11-pali@kernel.org Signed-off-by: Ulf Hansson commit 8baa6d1bce05cf26eec6b43bcd428735f33cb60e Author: Pali Rohár Date: Fri May 22 16:44:10 2020 +0200 mmc: sdio: Move SDIO IDs from b43-sdio driver to common include file Define appropriate macro names for consistency with other macros. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-10-pali@kernel.org Signed-off-by: Ulf Hansson commit 4dc28c948f480c5004613aab153c7160bd4f29ce Author: Pali Rohár Date: Fri May 22 16:44:09 2020 +0200 mmc: sdio: Move SDIO IDs from ath10k driver to common include file Also replace generic MANUFACTURER macros by proper SDIO IDs macros. Checks for device IDs are slightly modified to use SDIO device IDs. This allows removal of all custom MANUFACTURER macros from ath10k. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-9-pali@kernel.org Signed-off-by: Ulf Hansson commit ecc2f3962587aed327ccd3c32e99ccfc9e744fa0 Author: Pali Rohár Date: Fri May 22 16:44:08 2020 +0200 mmc: sdio: Move SDIO IDs from ath6kl driver to common include file Also replace generic MANUFACTURER macros by proper SDIO IDs macros. Check for "AR6003 or later" is slightly modified to use SDIO device IDs. This allows removal of all custom MANUFACTURER macros from ath6kl. Signed-off-by: Pali Rohár Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20200522144412.19712-8-pali@kernel.org Signed-off-by: Ulf Hansson commit b8c26a9663e1d888bbf4e14d3a62d033f286623e Author: Pali Rohár Date: Fri May 22 16:44:07 2020 +0200 mmc: sdio: Move SDIO IDs from smssdio driver to common include file Define appropriate macro names for consistency with other Siano macros. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-7-pali@kernel.org Signed-off-by: Ulf Hansson commit baaa110dcacfd704d182a275c4307baecb81423b Author: Pali Rohár Date: Fri May 22 16:44:06 2020 +0200 mmc: sdio: Move SDIO IDs from btmtksdio driver to common include file Define appropriate macro names for consistency with other macros. Signed-off-by: Pali Rohár Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20200522144412.19712-6-pali@kernel.org Signed-off-by: Ulf Hansson Acked-by: Ganapathi Bhat commit 649c7d76d87ca2285a82a65d86d99ddb60571e20 Author: Pali Rohár Date: Fri May 22 16:44:05 2020 +0200 mmc: sdio: Move SDIO IDs from btmrvl driver to common include file Define appropriate macro names for consistency with other Marvell macros. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-5-pali@kernel.org Signed-off-by: Ulf Hansson Acked-by: Ganapathi Bhat commit 7d14c687376e6bd33cf42028300838466b95e765 Author: Pali Rohár Date: Fri May 22 16:44:04 2020 +0200 mmc: sdio: Move SDIO IDs from mwifiex driver to common include file Add _WLAN suffix to macro names for consistency with other Marvell macros. These IDs represents wlan function of combo bt/wlan cards. Other functions of these cards have different IDs. Signed-off-by: Pali Rohár Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20200522144412.19712-4-pali@kernel.org Signed-off-by: Ulf Hansson Acked-by: Ganapathi Bhat commit 2849beec3343343b293f33267affbdd7c3f42814 Author: Pali Rohár Date: Fri May 22 16:44:03 2020 +0200 mmc: sdio: Change macro names for Marvell 8688 modules Add underscore as separator in Marvell 8688 macro names for better readability and consistency. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-3-pali@kernel.org Signed-off-by: Ulf Hansson Acked-by: Ganapathi Bhat commit 77f55d1305c11fb729b88f2c3f7881ba0831fa6f Author: Pascal Terjan Date: Wed May 27 21:51:00 2020 +0100 staging: rtl8723bs: Use common packet header constants This driver contains a local version of the rfc1042 header and bridge tunnel header constants which are available from cfg80211.h, switch to those. Signed-off-by: Pascal Terjan Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20200527205100.35794-1-pterjan@google.com Signed-off-by: Greg Kroah-Hartman commit a6011493c35fcd53ff3513adbc3957e917290684 Author: Igor Ribeiro Barbosa Duarte Date: Tue May 26 19:47:50 2020 -0300 staging: sm750fb: Add names to proc_setBLANK args Add names to proc_setBLANK args. Found using checkpatch.pl. Signed-off-by: Igor Ribeiro Barbosa Duarte Link: https://lore.kernel.org/r/20200526224750.GA29722@igor-Aspire-F5-573G Signed-off-by: Greg Kroah-Hartman commit 11974ace2d8681ae3efe027b4020869ccee48878 Author: Christian Gromm Date: Thu May 28 14:41:43 2020 +0200 staging: most: usb: init return value in default path of switch/case expression This patch avoids returning an uninitialized value in the default path of the switch expression. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590669703-20004-1-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1c1dbb2c02623db18a50c61b175f19aead800b4e Author: Dinghao Liu Date: Thu May 21 11:13:49 2020 +0800 PCI: tegra194: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Link: https://lore.kernel.org/r/20200521031355.7022-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Signed-off-by: Lorenzo Pieralisi Acked-by: Thierry Reding Acked-by: Vidya Sagar commit 347052e3bf1b62a25c11f7a673acfbaf554d67a1 Author: Martin Blumenstingl Date: Tue May 26 22:29:43 2020 +0200 usb: dwc3: meson-g12a: fix USB2 PHY initialization on G12A and A1 SoCs dwc3_meson_g12a_usb2_init_phy() crashes with NULL pointer on an SM1 board (which uses the same USB setup as G12A) dereference as reported by the Kernel CI bot. This is because of the following call flow: dwc3_meson_g12a_probe priv->drvdata->setup_regmaps dwc3_meson_g12a_setup_regmaps priv->usb2_ports is still 0 so priv->u2p_regmap[i] will be NULL dwc3_meson_g12a_get_phys initializes priv->usb2_ports priv->drvdata->usb_init dwc3_meson_g12a_usb_init dwc3_meson_g12a_usb_init_glue dwc3_meson_g12a_usb2_init priv->drvdata->usb2_init_phy dwc3_meson_g12a_usb2_init_phy dereferences priv->u2p_regmap[i] Call priv->drvdata->setup_regmaps only after dwc3_meson_g12a_get_phys so priv->usb2_ports is initialized and the regmaps will be set up correctly. This fixes the NULL dereference later on. Fixes: 013af227f58a97 ("usb: dwc3: meson-g12a: handle the phy and glue registers separately") Reported-by: "kernelci.org bot" Acked-by: Felipe Balbi Acked-by: Neil Armstrong Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200526202943.715220-3-martin.blumenstingl@googlemail.com Signed-off-by: Greg Kroah-Hartman commit be8c1001a7e681e8813882a42ed51c8dbffd8800 Author: Martin Blumenstingl Date: Tue May 26 22:29:42 2020 +0200 usb: dwc3: meson-g12a: fix error path when fetching the reset line fails Disable and unprepare the clocks when devm_reset_control_get_shared() fails. This fixes the error path as this must disable the clocks which were previously enabled. Fixes: 1e355f21d3fb96 ("usb: dwc3: Add Amlogic A1 DWC3 glue") Cc: Yue Wang Cc: Hanjie Lin Acked-by: Neil Armstrong Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200526202943.715220-2-martin.blumenstingl@googlemail.com Signed-off-by: Greg Kroah-Hartman commit fb6d8d12edea49bfa5c769be4f04c43570a1d197 Merge: d4014a6b46a5 9b5816b56af6 Author: Greg Kroah-Hartman Date: Fri May 29 10:42:38 2020 +0200 Merge tag 'gnss-5.8-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss into char-misc-next Johan writes: GNSS updates for 5.8-rc1 Here are the GNSS updates for 5.8-rc1, including: - a fix for two broken probe errors paths in the sirf driver - a flexible array conversion Both have been in linux-next with no reported issues. * tag 'gnss-5.8-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss: gnss: replace zero-length array with flexible-array gnss: sirf: fix error return code in sirf_probe() commit da10a4b626657387845f32d37141fc7d48ebbdb3 Author: Jiaxun Yang Date: Thu May 28 23:27:54 2020 +0800 dt-bindings: interrupt-controller: Add Loongson PCH MSI Add binding for Loongson PCH MSI controller. Signed-off-by: Jiaxun Yang Reviewed-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200528152757.1028711-7-jiaxun.yang@flygoat.com commit 632dcc2c75ef6de3272aa4ddd8f19da1f1ace323 Author: Jiaxun Yang Date: Thu May 28 23:27:53 2020 +0800 irqchip: Add Loongson PCH MSI controller This controller appears on Loongson LS7A family of PCH to transform interrupts from PCI MSI into HyperTransport vectorized interrrupts and send them to procrssor's HT vector controller. Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200528152757.1028711-6-jiaxun.yang@flygoat.com commit b6e4bc125fc517969f97d901b1845ebf47bbea26 Author: Jiaxun Yang Date: Thu May 28 23:27:52 2020 +0800 dt-bindings: interrupt-controller: Add Loongson PCH PIC Add binding for Loongson PCH PIC Controller. Reviewed-by: Rob Herring Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200528152757.1028711-5-jiaxun.yang@flygoat.com commit ef8c01eb64ca6719da449dab0aa9424e13c58bd0 Author: Jiaxun Yang Date: Thu May 28 23:27:51 2020 +0800 irqchip: Add Loongson PCH PIC controller This controller appears on Loongson LS7A family of PCH to transform interrupts from devices into HyperTransport vectorized interrrupts and send them to procrssor's HT vector controller. Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.yang@flygoat.com commit 6c2832c3c6edc38ab58bad29731b4951c0a90cf8 Author: Jiaxun Yang Date: Thu May 28 23:27:50 2020 +0800 dt-bindings: interrupt-controller: Add Loongson HTVEC Add binding for Loongson-3 HyperTransport Interrupt Vector Controller. Reviewed-by: Rob Herring Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200528152757.1028711-3-jiaxun.yang@flygoat.com commit 818e915fbac518e8c78e1877a0048d92d4965e5a Author: Jiaxun Yang Date: Thu May 28 23:27:49 2020 +0800 irqchip: Add Loongson HyperTransport Vector support This controller appears on Loongson-3 chips for receiving interrupt vectors from PCH's PIC and PCH's PCIe MSI interrupts. Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200528152757.1028711-2-jiaxun.yang@flygoat.com commit d4014a6b46a52a999cd8e06958d207c8fb9504b6 Merge: 0cfcfb314dec b2e5575a8d04 Author: Greg Kroah-Hartman Date: Fri May 29 10:42:03 2020 +0200 Merge tag 'extcon-next-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon for v5.8 Detailed description for this pull request: 1. Update extcon provider driver - Fix an error handling code by using devm_iio_channel_get() for extcon-adc-jac.c - Fix the usage counter imbalance of runtime PM for extcon-arizona.c. - Add proper dt-compatible string for extcon-max14577.c. 2. Update extcon core with minor updates: - Remove unneeded initialization of local variable in extcon_register_notifier * tag 'extcon-next-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: arizona: Fix runtime PM imbalance on error extcon: max14577: Add proper dt-compatible strings extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' extcon: remove redundant assignment to variable idx commit b2e5575a8d04028d17f6c914eea31036589bc79a Author: Dinghao Liu Date: Sat May 23 14:17:26 2020 +0800 extcon: arizona: Fix runtime PM imbalance on error When arizona_request_irq() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. For error paths after this function, things are the same. Also, remove calls to pm_runtime_disable() when pm_runtime_enable() has not been executed. Signed-off-by: Dinghao Liu Signed-off-by: Chanwoo Choi commit 3d6954dda499f73b0efb659d22b65428345753bf Author: Marek Szyprowski Date: Fri May 22 12:24:47 2020 +0200 extcon: max14577: Add proper dt-compatible strings Add device tree compatible strings and create proper modalias structures to let this driver load automatically if compiled as module, because max14577 MFD driver creates MFD cells with such compatible strings. Signed-off-by: Marek Szyprowski Signed-off-by: Chanwoo Choi commit bc84cff2c92ae5ccb2c37da73756e7174b1b430f Author: Christophe JAILLET Date: Sun May 10 11:53:03 2020 +0200 extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' In some error handling paths, a call to 'iio_channel_get()' is not balanced by a corresponding call to 'iio_channel_release()'. This can be achieved easily by using the devm_ variant of 'iio_channel_get()'. This has the extra benefit to simplify the remove function. Fixes: 19939860dcae ("extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices") Signed-off-by: Christophe JAILLET Signed-off-by: Chanwoo Choi commit 1fa80f182794bbefe8f1bffd74abda5470cdd973 Author: Colin Ian King Date: Thu Apr 16 00:08:21 2020 +0100 extcon: remove redundant assignment to variable idx The variable idx is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Chanwoo Choi commit de21ab70ee32a7da288d1e89a0c107e810cc9aef Merge: 906d0c8b89de 399ad9477c52 Author: Greg Kroah-Hartman Date: Fri May 29 10:32:04 2020 +0200 Merge tag 'usb-serial-5.8-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial fixes for 5.8-rc1 Here are some new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-5.8-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Telit LE910C1-EUX compositions USB: serial: qcserial: add DW5816e QDL support commit 906d0c8b89de833d98071b082252db7013fca659 Author: Greg Kroah-Hartman Date: Fri May 29 10:29:40 2020 +0200 Revert "dt-bindings: usb: qcom,dwc3: Convert USB DWC3 bindings" This reverts commit cd4b54e2ae1f47c72c004628788e84ffe7c71561 as the change should be coming in through Rob's tree instead. Reported-by: Stephen Rothwell Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Rob Herring Cc: Stephen Boyd Cc: Felipe Balbi Signed-off-by: Greg Kroah-Hartman commit 99d33ea7f8b0f0641abb1e4aa30ab66c407987e4 Author: Greg Kroah-Hartman Date: Fri May 29 10:28:48 2020 +0200 Revert "dt-bindings: usb: qcom,dwc3: Add compatible for SC7180" This reverts commit b88035625ec9594d4554a307e820aef4b759e35f as the file should be coming in through Rob's tree instead. Reported-by: Stephen Rothwell Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Rob Herring Cc: Stephen Boyd Cc: Felipe Balbi Signed-off-by: Greg Kroah-Hartman commit c4ff8628476937635b91500dc78a14e337facb7c Author: Greg Kroah-Hartman Date: Fri May 29 10:26:49 2020 +0200 Revert "dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver" This reverts commit 1805cdde37c8cc90b298c3d9afbc2aa4c9890635 as it should be going in through Rob's tree instead to resolve conflicts. Reported-by: Stephen Rothwell Cc: Rob Herring Cc: Stephen Boyd Cc: Sandeep Maheswaram Cc: Felipe Balbi Signed-off-by: Greg Kroah-Hartman commit 4b9d03131de3196fab550029836b0e2ff4419bf3 Merge: 97fe809934dd c432df155919 Author: Greg Kroah-Hartman Date: Fri May 29 09:40:58 2020 +0200 Merge tag 'usb-serial-5.8-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.8-rc1 Here are the USB-serial updates for 5.8-rc1, including: - a SPDX comment-style clean up - a fix usb_wwan modem drivers which could end up resubmitting the their read URBs in a tight loop on disconnect - a regression fix for a subset of quirky ch341 devices which would lock up on certain low line speeds when using the new divisor algorithm All have been in linux-next with no reported issues. * tag 'usb-serial-5.8-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: ch341: fix lockup of devices with limited prescaler USB: serial: ch341: add basis for quirk detection USB: serial: usb_wwan: do not resubmit rx urb on fatal errors USB: serial: Use the correct style for SPDX License Identifier commit e4df11cb99bff88cff976981eb8016ebd325a16f Author: Rob Herring Date: Thu Apr 9 16:18:29 2020 -0600 ARM: zynq: Don't select CONFIG_ICST CONFIG_ICST is for ARM Ltd reference platforms and isn't used by Zynq platform, so remove selecting it. It appears to be a copy-n-paste error. Cc: Michal Simek Signed-off-by: Rob Herring [arnd: remove the versatile clk driver change I added previously] Signed-off-by: Arnd Bergmann commit e6d4318c049574dcfa040725903add2790cfbd7b Author: Luca Coelho Date: Fri May 29 09:39:31 2020 +0300 iwlwifi: bump FW API to 56 for AX devices Start supporting API version 56 for AX devices. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.aabbc5b472ee.I88cb2c3d2d07e62eac3671335ff1fb80b73c5839@changeid commit 018971b11ab407c8d48c075ad38d2917587e97ab Author: Avraham Stern Date: Fri May 29 09:39:30 2020 +0300 iwlwifi: mvm: add support for range request version 10 Range request version 10 keeps the same command size as version 9 but uses 2 reserved fields for the responder beacon interval and station id (if exists). For now, since the beacon interval of unassoc APs is unknown, use a value of 100 TUs which is a common value for many APs. While at it, remove the definition for CCMP_256 cipher, since this is not supported. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.b7ccdad0805f.I59ea7f773caed85a66c61401066ae169008442e6@changeid commit f327236df2afc8c3c711e7e070f122c26974f4da Author: Sharon Date: Fri May 29 09:39:29 2020 +0300 iwlwifi: mvm: fix aux station leak When mvm is initialized we alloc aux station with aux queue. We later free the station memory when driver is stopped, but we never free the queue's memory, which casues a leak. Add a proper de-initialization of the station. Signed-off-by: Sharon Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.0121c5be55e9.Id7516fbb3482131d0c9dfb51ff20b226617ddb49@changeid commit 4f4822b7cd5ab818a62815cc8eeca495cf8ec872 Author: Mordechay Goodstein Date: Fri May 29 09:39:28 2020 +0300 iwlwifi: move txq-specific from trans_pcie to common trans We don't want to have txq code in the PCIe transport code, so move all the relevant elements to a new iwl_txq structure and store it in iwl_trans. spatch @ replace_pcie @ struct iwl_trans_pcie *trans_pcie; @@ ( -trans_pcie->queue_stopped +trans->txqs.queue_stopped | -trans_pcie->queue_used +trans->txqs.queue_used | -trans_pcie->txq +trans->txqs.txq | -trans_pcie->txq +trans->txqs.txq | -trans_pcie->cmd_queue +trans->txqs.cmd.q_id | -trans_pcie->cmd_fifo +trans->txqs.cmd.fifo | -trans_pcie->cmd_q_wdg_timeout +trans->txqs.cmd.wdg_timeout ) // clean all new unused variables @ depends on replace_pcie @ type T; identifier i; expression E; @@ - T i = E; ... when != i Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.a428d3c9d66f.Ie04ae55f33954636a39c98e7ae1e739c0507435b@changeid commit 4807e73685f1d52e9143977ee1763b9d050daef3 Author: Mordechay Goodstein Date: Fri May 29 09:39:27 2020 +0300 iwlwifi: move iwl_txq and substructures to a common trans header The txq code is not directly related to the PCIe transport, so move the structures it uses to the common iwl-trans.h header. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.d9d0082b8369.I8298f6e83804c1ea99217a79d95d23ef68b184d4@changeid commit 61576240558afce5abb8f391a88a6dfcf25ca7a1 Author: Johannes Berg Date: Fri May 29 09:39:26 2020 +0300 iwlwifi: pcie: gen3: indicate 8k/12k RB size to device Newer firmware versions will parse a few extra bits in the context info to be able to determine whether we are using bigger than 4k RBs, indicate 8k/12k to them if we actually use those (e.g. for sniffer based on the module parameter). Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.f83f994572ca.Ibcfd66c3f9b69e68a53b3b2df8331ffb225db655@changeid commit f5b1cb2e615f57a6bf00d600b1f31e9f8058daa5 Author: Gil Adam Date: Fri May 29 09:39:25 2020 +0300 iwlwifi: acpi: evaluate dsm to enable 5.2 bands in Indonesia Evaluate the appropriate DSM from ACPI to enable 5.15,5.35 GHz bands in Indonesia. If enabled send LARI_CONFIG_CHANGE cmd to fw. Signed-off-by: Gil Adam Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.f549b75bfdac.Iac74a6ffe45aff887cea13ee1d31b100ca11e249@changeid commit 9db93491f29eb4a4a68c72783dd6f078bdd94302 Author: Gil Adam Date: Fri May 29 09:39:24 2020 +0300 iwlwifi: acpi: support device specific method (DSM) ACPI Device Specific Method (DSM) allows standardized feature configuration through the ACPI interface without the namespace pollution of the usual mechanism (ACPI method for each feature). Add generic function for evaluating DSM objects and function for evaluating a DSM with no arguments and a single int return value. also implement the required backport for UUID. Signed-off-by: Gil Adam Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.c3242ff3ba5c.Icb48c8d61bede5dda7ef267bff10e4798e9dc77b@changeid commit fcac70029ccf36c5157b8f37817eff332e0145a7 Author: Mordechay Goodstein Date: Fri May 29 09:39:23 2020 +0300 iwlwifi: pcie: keep trans instead of trans_pcie in iwl_txq We used both the trans and the trans_pcie structures in iwl_txq, so we can keep the trans structure instead. This helps with the refactoring of txq code out of pcie. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.1f826d34339e.I23182a59bfbe089a1f659742d6fee6f64d2ed08c@changeid commit 771db3a10361ef67d59c00098a442be4a8395861 Author: Haim Dreyfuss Date: Fri May 29 09:39:22 2020 +0300 iwlwifi: pcie: don't count on the FW to set persistence mode Apparently the FW can't set the persistence in all flows. Don't count on the FW setting it in AX210 devices or above either to avoid potential resets on resume. Signed-off-by: Haim Dreyfuss Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.5405db448555.Ie3c110932ebbd5b6aca99938a5e0a1e4dfbaa848@changeid commit a224883cc97f0c476f1d1460ac8716bf0768070a Author: Haim Dreyfuss Date: Fri May 29 09:39:21 2020 +0300 iwlwifi: set NO_HE if the regulatory domain forbids it If the firmware's regulatory domain forbids HE operation, set it in the cfg80211 regdomain. Signed-off-by: Haim Dreyfuss Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200529092401.c3e50c36c628.I991bfa662c0ef35de5be9eaf5b78ef190b67cb56@changeid commit 5626de1e96f75cc4bede0743ac994e504e2e7726 Author: Liao Pingfang Date: Fri May 29 09:02:30 2020 +0800 reiserfs: Replace kmalloc with kcalloc in the comment Use kcalloc instead of kmalloc in the comment according to the previous kcalloc() call. Link: https://lore.kernel.org/r/1590714150-15895-1-git-send-email-wang.yi59@zte.com.cn Signed-off-by: Liao Pingfang Signed-off-by: Jan Kara commit bf8036a4098d1548cdccf9ed5c523ef4e83e3c68 Author: Aneesh Kumar K.V Date: Thu May 28 13:34:56 2020 +0530 powerpc/book3s64/kvm: Fix secondary page table walk warning during migration This patch fixes the below warning reported during migration: find_kvm_secondary_pte called with kvm mmu_lock not held CPU: 23 PID: 5341 Comm: qemu-system-ppc Tainted: G W 5.7.0-rc5-kvm-00211-g9ccf10d6d088 #432 NIP: c008000000fe848c LR: c008000000fe8488 CTR: 0000000000000000 REGS: c000001e19f077e0 TRAP: 0700 Tainted: G W (5.7.0-rc5-kvm-00211-g9ccf10d6d088) MSR: 9000000000029033 CR: 42222422 XER: 20040000 CFAR: c00000000012f5ac IRQMASK: 0 GPR00: c008000000fe8488 c000001e19f07a70 c008000000ffe200 0000000000000039 GPR04: 0000000000000001 c000001ffc8b4900 0000000000018840 0000000000000007 GPR08: 0000000000000003 0000000000000001 0000000000000007 0000000000000001 GPR12: 0000000000002000 c000001fff6d9400 000000011f884678 00007fff70b70000 GPR16: 00007fff7137cb90 00007fff7dcb4410 0000000000000001 0000000000000000 GPR20: 000000000ffe0000 0000000000000000 0000000000000001 0000000000000000 GPR24: 8000000000000000 0000000000000001 c000001e1f67e600 c000001e1fd82410 GPR28: 0000000000001000 c000001e2e410000 0000000000000fff 0000000000000ffe NIP [c008000000fe848c] kvmppc_hv_get_dirty_log_radix+0x2e4/0x340 [kvm_hv] LR [c008000000fe8488] kvmppc_hv_get_dirty_log_radix+0x2e0/0x340 [kvm_hv] Call Trace: [c000001e19f07a70] [c008000000fe8488] kvmppc_hv_get_dirty_log_radix+0x2e0/0x340 [kvm_hv] (unreliable) [c000001e19f07b50] [c008000000fd42e4] kvm_vm_ioctl_get_dirty_log_hv+0x33c/0x3c0 [kvm_hv] [c000001e19f07be0] [c008000000eea878] kvm_vm_ioctl_get_dirty_log+0x30/0x50 [kvm] [c000001e19f07c00] [c008000000edc818] kvm_vm_ioctl+0x2b0/0xc00 [kvm] [c000001e19f07d50] [c00000000046e148] ksys_ioctl+0xf8/0x150 [c000001e19f07da0] [c00000000046e1c8] sys_ioctl+0x28/0x80 [c000001e19f07dc0] [c00000000003652c] system_call_exception+0x16c/0x240 [c000001e19f07e20] [c00000000000d070] system_call_common+0xf0/0x278 Instruction dump: 7d3a512a 4200ffd0 7ffefb78 4bfffdc4 60000000 3c820000 e8848468 3c620000 e86384a8 38840010 4800673d e8410018 <0fe00000> 4bfffdd4 60000000 60000000 Reported-by: Paul Mackerras Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200528080456.87797-1-aneesh.kumar@linux.ibm.com commit b00e667a6d8b2b0f53098ec12ff1ffe7f7c9be20 Author: Viresh Kumar Date: Wed May 27 09:33:44 2020 +0530 opp: Remove bandwidth votes when target_freq is zero We already drop several votes when target_freq is set to zero, drop bandwidth votes as well. Reported-by: Sibi Sankar Reviewed-by: Georgi Djakov Tested-by: Georgi Djakov Reviewed-by: Sibi Sankar Tested-by: Sibi Sankar Signed-off-by: Viresh Kumar commit 8d45719caaf56c859be0172447f8559c0df40f93 Author: Kamil Konieczny Date: Fri Jul 19 17:05:32 2019 +0200 opp: core: add regulators enable and disable Add enable regulators to dev_pm_opp_set_regulators() and disable regulators to dev_pm_opp_put_regulators(). Even if bootloader leaves regulators enabled, they should be enabled in kernel in order to increase the reference count. Tested-by: Marek Szyprowski Acked-by: Clément Péron Tested-by: Clément Péron Signed-off-by: Kamil Konieczny [ Viresh: Enable the regulator only after it is programmed and add a flag to track its status. ] Signed-off-by: Viresh Kumar commit b23dfa3543f31fbb8c0098925bf90fc23193d17a Author: Viresh Kumar Date: Fri May 15 12:37:24 2020 +0530 opp: Reorder the code for !target_freq case Reorder the code a bit to make it more readable. Add additional comment as well. Tested-by: Marek Szyprowski Acked-by: Clément Péron Tested-by: Clément Péron Signed-off-by: Viresh Kumar commit 0430b1d5704b0f0f1d237236dde9c143f8669e49 Author: Viresh Kumar Date: Mon May 18 14:25:32 2020 +0300 opp: Expose bandwidth information via debugfs Expose the bandwidth information as well via debugfs. Signed-off-by: Viresh Kumar Signed-off-by: Georgi Djakov commit 8b17f17a097bdbc9546f5fdde3098b5f21cbfbff Author: Georgi Djakov Date: Tue May 12 15:53:24 2020 +0300 cpufreq: dt: Add support for interconnect bandwidth scaling In addition to clocks and regulators, some devices can scale the bandwidth of their on-chip interconnect - for example between CPU and DDR memory. Add support for that, so that platforms which support it can make use of it. Signed-off-by: Georgi Djakov Reviewed-by: Matthias Kaehlcke [ Viresh: Reused dev_pm_opp_of_find_icc_paths(). Also drop the depends on from Kconfig. ] Signed-off-by: Viresh Kumar fixup! cpufreq: dt: Add support for interconnect bandwidth scaling commit fe2af40250bfc3cca9120cd5c315e2ea7a1082ed Author: Georgi Djakov Date: Tue May 12 15:53:23 2020 +0300 opp: Update the bandwidth on OPP frequency changes If the OPP bandwidth values are populated, we want to switch also the interconnect bandwidth in addition to frequency and voltage. Signed-off-by: Georgi Djakov Reviewed-by: Matthias Kaehlcke Reviewed-by: Sibi Sankar Signed-off-by: Viresh Kumar commit 120e117bdc8483773fdae19dd326ef460b1ab4c2 Author: Georgi Djakov Date: Tue May 12 15:53:22 2020 +0300 opp: Add sanity checks in _read_opp_key() When we read the OPP keys, it would be nice to do some sanity checks of the values we get from DT and see if they match with the information that is populated in the OPP table. Let's pass a pointer of the table, so that we can do some validation. Signed-off-by: Georgi Djakov Reviewed-by: Matthias Kaehlcke Reviewed-by: Sibi Sankar [ Viresh: Fix rebase conflicts ] Signed-off-by: Viresh Kumar commit 6d3f922c46f2e91f63c92f8dd28381f097082912 Author: Georgi Djakov Date: Tue May 12 15:53:21 2020 +0300 opp: Add support for parsing interconnect bandwidth The OPP bindings now support bandwidth values, so add support to parse it from device tree and store it into the new dev_pm_opp_icc_bw struct, which is part of the dev_pm_opp. Signed-off-by: Georgi Djakov Reviewed-by: Matthias Kaehlcke [ Viresh: Create _read_bw() and use it, renamed _of_find_icc_paths() to dev_pm_opp_of_find_icc_paths(), exported it and made opp_table argument optional. Also drop the depends on from Kconfig. ] Signed-off-by: Viresh Kumar commit 571cfadcc628dd5591444f7289e27445ea732f4c Author: Weiyi Lu Date: Wed May 27 14:25:49 2020 +0800 clk: mediatek: assign the initial value to clk_init_data of mtk_mux When some new clock supports are introduced, e.g. [1] it might lead to an error although it should be NULL because clk_init_data is on the stack and it might have random values if using without initialization. Add the missing initial value to clk_init_data. [1] https://android-review.googlesource.com/c/kernel/common/+/1278046 Fixes: a3ae549917f1 ("clk: mediatek: Add new clkmux register API") Signed-off-by: Weiyi Lu Reviewed-by: Matthias Brugger Cc: Link: https://lore.kernel.org/r/1590560749-29136-1-git-send-email-weiyi.lu@mediatek.com Signed-off-by: Stephen Boyd commit 1aca9939bf72893887cb7e3455e44c864bada2f9 Author: Owen Chen Date: Fri Feb 21 17:52:22 2020 +0800 clk: mediatek: Add MT6765 clock support Add MT6765 clock support, include topckgen, apmixedsys, infracfg, mcucfg and subsystem clocks. Signed-off-by: Owen Chen Signed-off-by: Mars Cheng Signed-off-by: Macpaul Lin Link: https://lore.kernel.org/r/1582278742-1626-6-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Stephen Boyd commit eb7beb65ac30afb8385cfc4032ea67835c5e7d66 Author: Mars Cheng Date: Fri Feb 21 17:52:21 2020 +0800 clk: mediatek: add mt6765 clock IDs Add MT6765 clock dt-bindings, include topckgen, apmixedsys, infracfg, mcucfg and subsystem clocks. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1582278742-1626-5-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Stephen Boyd commit 0502f26c6441d82cf7299678198b644f3838e871 Author: Macpaul Lin Date: Fri Feb 21 17:52:20 2020 +0800 dt-bindings: clock: mediatek: document clk bindings vcodecsys for Mediatek MT6765 SoC This patch adds the binding documentation for vcodecsys. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Link: https://lore.kernel.org/r/1582278742-1626-4-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Stephen Boyd commit 626b134b58eb03c152cdba0a94c74ca3da0805e7 Author: Macpaul Lin Date: Fri Feb 21 17:52:19 2020 +0800 dt-bindings: clock: mediatek: document clk bindings mipi0a for Mediatek MT6765 SoC This patch adds the binding documentation for mipi0a. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Link: https://lore.kernel.org/r/1582278742-1626-3-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Stephen Boyd commit 7b9e111a5216640c86c206e6b419a0f4908c202b Author: Macpaul Lin Date: Fri Feb 21 17:52:18 2020 +0800 dt-bindings: clock: mediatek: document clk bindings for Mediatek MT6765 SoC This patch adds the binding documentation for apmixedsys, audsys, camsys, imgsys, infracfg, mmsys, pericfg, topckgen Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Rob Herring Link: https://lore.kernel.org/r/1582278742-1626-2-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Stephen Boyd commit 56fbeefe366e5920802f60f26b6b59b365c0569b Author: Eugeniy Paltsev Date: Wed Mar 11 16:41:15 2020 +0300 CLK: HSDK: CGU: add support for 148.5MHz clock Add support for 148.5MHz clock for HDMI PLL Signed-off-by: Eugeniy Paltsev Link: https://lkml.kernel.org/r/20200311134115.13257-4-Eugeniy.Paltsev@synopsys.com Signed-off-by: Stephen Boyd commit 423f042a65a2af82337af4e3c7f2cd828185e4f3 Author: Eugeniy Paltsev Date: Wed Mar 11 16:41:14 2020 +0300 CLK: HSDK: CGU: support PLL bypassing Support setting PLL to bypass mode to support output frequency equal to input one. Signed-off-by: Eugeniy Paltsev Link: https://lkml.kernel.org/r/20200311134115.13257-3-Eugeniy.Paltsev@synopsys.com Signed-off-by: Stephen Boyd commit 907f9291f937463c27e5ca9cb5f1d8eedf9a2738 Author: Eugeniy Paltsev Date: Wed Mar 11 16:41:13 2020 +0300 CLK: HSDK: CGU: check if PLL is bypassed first If PLL is bypassed the EN (enable) bit has no effect on output clock. Signed-off-by: Eugeniy Paltsev Link: https://lkml.kernel.org/r/20200311134115.13257-2-Eugeniy.Paltsev@synopsys.com Signed-off-by: Stephen Boyd commit f9eec2ea785204f139f0620f36ce1ab0851de499 Author: Mike Looijmans Date: Thu May 7 08:15:44 2020 +0200 clk: clk-si5341: Add support for the Si5345 series Add support for the Si5342, Si5344 and Si5345 chips. These are equivalent to the Si5341 family, but with more clock input options (which are not supported yet by this driver). Signed-off-by: Mike Looijmans Link: https://lkml.kernel.org/r/20200507061544.11388-1-mike.looijmans@topic.nl Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 6a3faa4d7e013af13fa0230f7537640dcb3abc38 Author: Hari Date: Sat May 23 18:43:26 2020 +0530 e1000: Fix typo in the comment Continuous Double "the" in a comment. Changed it to single "the" Signed-off-by: Hari Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 480b7a5a3fdb99afaf9a59681616bc70c1fbfe2f Author: Sasha Neftin Date: Thu May 28 10:25:21 2020 +0300 igc: Fix wrong register name Accordance to the i225 datasheet this register address used by Host Transmit Discarded Packet by MAC counter and not by not applicable Carrier Extension Error counter. This patch comes to fix this wrong definition. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit e2d0f2031effc8b08a162e6db64d2c97da4cf9f5 Author: Sasha Neftin Date: Thu May 28 10:11:11 2020 +0300 igc: Remove Sequence Error Counter Accordance to the i225 datasheet sequence error counter does not applicable to the i225 device. This patch comes to clean up this counter. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 51c657b42f58fcf061dfd6d01df26ff1701ae72c Author: Sasha Neftin Date: Tue May 19 17:55:42 2020 +0300 igc: Add Receive Error Counter Receive error counter reflect total number of non-filtered packets received with errors. This includes: CRC error, symbol error, Rx data error and carrier extend error. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 758b51e1e71e38257dfcb753edaf07d417611786 Author: Sasha Neftin Date: Tue May 19 17:36:34 2020 +0300 igc: Remove symbol error counter Accordance to the i225 datasheet symbol error counter does not applicable to the i225 device. This patch comes to clean up this counter. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 3f6023f77ad044a1a3e1b57ccaaff79432910a57 Author: Jason Yan Date: Wed May 6 14:18:35 2020 +0800 i40e: Make i40e_shutdown_adminq() return void Fix the following coccicheck warning: drivers/net/ethernet/intel/i40e/i40e_adminq.c:699:13-21: Unneeded variable: "ret_code". Return "0" on line 710 Signed-off-by: Jason Yan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit d601afcae2febc49665008e9a79e701248d56c50 Author: Punit Agrawal Date: Fri May 15 13:31:27 2020 +0900 e1000e: Relax condition to trigger reset for ME workaround It's an error if the value of the RX/TX tail descriptor does not match what was written. The error condition is true regardless the duration of the interference from ME. But the driver only performs the reset if E1000_ICH_FWSM_PCIM2PCI_COUNT (2000) iterations of 50us delay have transpired. The extra condition can lead to inconsistency between the state of hardware as expected by the driver. Fix this by dropping the check for number of delay iterations. While at it, also make __ew32_prepare() static as it's not used anywhere else. CC: stable Signed-off-by: Punit Agrawal Reviewed-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit e087d3bbc4bfb1458b28f77caa0eed092f632b2b Author: Andre Guedes Date: Tue May 12 10:35:53 2020 -0700 igc: Fix IGC_MAX_RXNFC_RULES IGC supports a total of 32 rules. 16 MAC address based, 8 VLAN priority based, and 8 Ethertype based. This patch fixes IGC_MAX_RXNFC_RULES accordingly. Signed-off-by: Andre Guedes Acked-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 3d3e9b6b6a878d01c04629eae8787de132056533 Author: Andre Guedes Date: Tue May 12 10:35:52 2020 -0700 igc: Reject NFC rules with multiple matches The way Rx queue assignment based on mac address, Ethertype and VLAN priority filtering operates in I225 doesn't allow us to properly support NFC rules with multiple matches. Consider the following example which assigns to queue 2 frames matching the address MACADDR *and* Ethertype ETYPE. $ ethtool -N eth0 flow-type ether dst proto queue 2 When such rule is applied, we have 2 unwanted behaviors: 1) Any frame matching MACADDR will be assigned to queue 2. It doesn't matter the ETYPE value. 2) Any accepted frame that has Ethertype equals to ETYPE, no matter the mac address, will be assigned to queue 2 as well. In current code, multiple-match filters are accepted by the driver, even though it doesn't support them properly. This patch adds a check for multiple-match rules in igc_ethtool_is_nfc_rule_valid() so they are rejected. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 2c3076f5ed3c17e06c2e09a442035906c99311b2 Author: Sasha Neftin Date: Sun May 10 18:52:00 2020 +0300 igc: Remove unused flags Transmit underrun, late and excess collision flags not in use. This patch comes to clean up these flags. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 49c65e95f331201d431386dcb7c652bf02b306d1 Author: Jason Yan Date: Thu May 7 19:09:15 2020 +0800 igb: make igb_set_fc_watermarks() return void This function always return 0 now, we can make it return void to simplify the code. This fixes the following coccicheck warning: drivers/net/ethernet/intel/igb/e1000_mac.c:728:5-12: Unneeded variable: "ret_val". Return "0" on line 751 Signed-off-by: Jason Yan Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit f2d9f294120fddec48e38e50d420c1d0a247661d Author: YueHaibing Date: Tue May 5 16:35:54 2020 +0800 ixgbe: Remove unused inline function ixgbe_irq_disable_queues commit b5f69ccf6765 ("ixgbe: avoid bringing rings up/down as macvlans are added/removed") left behind this, remove it. Signed-off-by: YueHaibing Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c2d77e598b1b7170a091b25e32710a0a9f9e4169 Author: Jason Yan Date: Tue May 5 15:43:37 2020 +0800 ixgbe: Use true, false for bool variable in __ixgbe_enable_sriov() Fix the following coccicheck warning: drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c:105:2-38: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 85c41c5b16ee5a4939a22ec833c6a76753e3d428 Author: Jason Yan Date: Tue May 5 15:41:57 2020 +0800 ixgbe: Remove conversion to bool in ixgbe_device_supports_autoneg_fc() No need to convert '==' expression to bool. This fixes the following coccicheck warning: drivers/net/ethernet/intel/ixgbe/ixgbe_common.c:68:11-16: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit bc6b83d636eb8b0083a166a6be6bae89440393c6 Author: Geert Uytterhoeven Date: Thu May 28 15:30:33 2020 +0200 dt-bindings: timer: renesas: mtu2: Convert to json-schema Convert the Renesas Multi-Function Timer Pulse Unit 2 (MTU2) Device Tree binding documentation to json-schema. Add missing properties. Update the example to match reality. Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 7536c7e03e745bcc6881d0af66e747040943560a Author: Qi Zheng Date: Thu May 28 21:25:41 2020 +0800 of/fdt: Remove redundant kbasename function call For version 1 to 3 of the device tree, this is the node full path as a zero terminated string, starting with "/". The following equation will not hold, since the node name has been processed in the fdt_get_name(). *pathp == '/' For version 16 and later, this is the node unit name only (or an empty string for the root node). So the above equation will still not hold. So the kbasename() is redundant, just remove it. Signed-off-by: Qi Zheng Signed-off-by: Rob Herring commit 3b70683fc4d68f5d915d9dc7e5ba72c732c7315c Author: Xie XiuQi Date: Tue May 5 10:45:21 2020 +0800 ixgbe: fix signed-integer-overflow warning ubsan report this warning, fix it by adding a unsigned suffix. UBSAN: signed-integer-overflow in drivers/net/ethernet/intel/ixgbe/ixgbe_common.c:2246:26 65535 * 65537 cannot be represented in type 'int' CPU: 21 PID: 7 Comm: kworker/u256:0 Not tainted 5.7.0-rc3-debug+ #39 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 03/27/2020 Workqueue: ixgbe ixgbe_service_task [ixgbe] Call trace: dump_backtrace+0x0/0x3f0 show_stack+0x28/0x38 dump_stack+0x154/0x1e4 ubsan_epilogue+0x18/0x60 handle_overflow+0xf8/0x148 __ubsan_handle_mul_overflow+0x34/0x48 ixgbe_fc_enable_generic+0x4d0/0x590 [ixgbe] ixgbe_service_task+0xc20/0x1f78 [ixgbe] process_one_work+0x8f0/0xf18 worker_thread+0x430/0x6d0 kthread+0x218/0x238 ret_from_fork+0x10/0x18 Reported-by: Hulk Robot Signed-off-by: Xie XiuQi Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit e92c0e0235c204a4787d186b541b33814a393d7f Author: Jesper Dangaard Brouer Date: Mon Mar 16 11:16:38 2020 +0100 i40e: trivial fixup of comments in i40e_xsk.c The comment above i40e_run_xdp_zc() was clearly copy-pasted from function i40e_xsk_umem_setup, which is just above. Signed-off-by: Jesper Dangaard Brouer Acked-by: Björn Töpel Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 67e35adf1b059a909a0800669736f74650464119 Author: Anson Huang Date: Thu May 28 15:27:59 2020 +0800 dt-bindings: clock: Convert i.MX1 clock to json-schema Convert the i.MX1 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 80540e16e9ac9aee487ae01ced90077c2368ca7c Author: Anson Huang Date: Thu May 28 15:27:58 2020 +0800 dt-bindings: clock: Convert i.MX21 clock to json-schema Convert the i.MX21 clock binding to DT schema format using json-schema, can NOT find any CCM interrupt info from reference manual and DT file, so interrupts property is removed from original binding doc. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 076026e9b4087044f658987f61d2717ed89e0fca Author: Anson Huang Date: Thu May 28 15:27:57 2020 +0800 dt-bindings: clock: Convert i.MX25 clock to json-schema Convert the i.MX25 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 1b51ec3ac98dcc7be6174e6afe50127c030e404a Author: Anson Huang Date: Thu May 28 15:27:56 2020 +0800 dt-bindings: clock: Convert i.MX27 clock to json-schema Convert the i.MX27 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit c28481a88cb38a3e1b7b533f53eb82e5e34f7597 Author: Takashi Iwai Date: Wed Mar 11 09:37:40 2020 +0100 i40e: Use scnprintf() for avoiding potential buffer overflow Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 40df60f140b374a3a55fdf296f2345a176c4fe12 Author: Anson Huang Date: Thu May 28 15:27:55 2020 +0800 dt-bindings: clock: Convert i.MX23 clock to json-schema Convert the i.MX23 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit fc95fd1ea4bb88969066613c47a3ddf1d1342975 Author: Anson Huang Date: Thu May 28 15:27:54 2020 +0800 dt-bindings: clock: Convert i.MX28 clock to json-schema Convert the i.MX28 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 69d52d893eac2b253a904d1ae757f03872cb5eaf Author: Anson Huang Date: Thu May 28 15:27:53 2020 +0800 dt-bindings: clock: Convert i.MX31 clock to json-schema Convert the i.MX31 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 91ab38f7e9d02cc4b95275da2904d1db01ada636 Author: Anson Huang Date: Thu May 28 15:27:52 2020 +0800 dt-bindings: clock: Convert i.MX35 clock to json-schema Convert the i.MX35 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 8d71c8c0ab8f8fdeef0067086b14afc95c11934f Author: Anson Huang Date: Thu May 28 15:27:51 2020 +0800 dt-bindings: clock: Convert i.MX5 clock to json-schema Convert the i.MX5 clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 3910c5809fba150b3ac1e6ba1b1c93ceeb2340ab Author: Jonathan Albrieux Date: Mon May 25 18:46:00 2020 +0200 dt-bindings: iio: imu: bmi160: convert format to yaml, add maintainer Converts documentation from txt format to yaml. Signed-off-by: Jonathan Albrieux Signed-off-by: Rob Herring commit 15ee65676f1e2bbb237e9ecd317b45d8eba29237 Author: Ira Weiny Date: Thu May 28 08:00:03 2020 -0700 Documentation/dax: Update DAX enablement for ext4 Update the document to reflect ext4 and xfs now behave the same. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-10-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit b383a73f2b832491a2f9e6e8ada26aad53b5763d Author: Ira Weiny Date: Thu May 28 08:00:02 2020 -0700 fs/ext4: Introduce DAX inode flag Add a flag ([EXT4|FS]_DAX_FL) to preserve FS_XFLAG_DAX in the ext4 inode. Set the flag to be user visible and changeable. Set the flag to be inherited. Allow applications to change the flag at any time except if it conflicts with the set of mutually exclusive flags (Currently VERITY, ENCRYPT, JOURNAL_DATA). Furthermore, restrict setting any of the exclusive flags if DAX is set. While conceptually possible, we do not allow setting EXT4_DAX_FL while at the same time clearing exclusion flags (or vice versa) for 2 reasons: 1) The DAX flag does not take effect immediately which introduces quite a bit of complexity 2) There is no clear use case for being this flexible Finally, on regular files, flag the inode to not be cached to facilitate changing S_DAX on the next creation of the inode. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-9-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit fcebc7949cd2ff97407e5b77ed99a7211674c6de Author: Ira Weiny Date: Thu May 28 08:00:01 2020 -0700 fs/ext4: Remove jflag variable The jflag variable serves almost no purpose. Remove it. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-8-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit 9cb20f94afcd2964944f9468e38da736ee855b19 Author: Ira Weiny Date: Thu May 28 08:00:00 2020 -0700 fs/ext4: Make DAX mount option a tri-state We add 'always', 'never', and 'inode' (default). '-o dax' continues to operate the same which is equivalent to 'always'. This new functionality is limited to ext4 only. Specifically we introduce a 2nd DAX mount flag EXT4_MOUNT2_DAX_NEVER and set it and EXT4_MOUNT_DAX_ALWAYS appropriately for the mode. We also force EXT4_MOUNT2_DAX_NEVER if !CONFIG_FS_DAX. Finally, EXT4_MOUNT2_DAX_INODE is used solely to detect if the user specified that option for printing. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-7-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit 043546e46dc70c25ff7e2cf6d09cbb0424fc9978 Author: Ira Weiny Date: Thu May 28 07:59:59 2020 -0700 fs/ext4: Only change S_DAX on inode load To prevent complications with in memory inodes we only set S_DAX on inode load. FS_XFLAG_DAX can be changed at any time and S_DAX will change after inode eviction and reload. Add init bool to ext4_set_inode_flags() to indicate if the inode is being newly initialized. Assert that S_DAX is not set on an inode which is just being loaded. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-6-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit a8ab6d3885ef5e2300d683b79a9e1999403eefd9 Author: Ira Weiny Date: Thu May 28 07:59:58 2020 -0700 fs/ext4: Update ext4_should_use_dax() S_DAX should only be enabled when the underlying block device supports dax. Cache the underlying support for DAX in the super block and modify ext4_should_use_dax() to check for device support prior to the over riding mount option. While we are at it change the function to ext4_should_enable_dax() as this better reflects the ask as well as matches xfs. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-5-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit fc626fe322f13ecdfac58cbfa6cfea797ed22623 Author: Ira Weiny Date: Thu May 28 07:59:57 2020 -0700 fs/ext4: Change EXT4_MOUNT_DAX to EXT4_MOUNT_DAX_ALWAYS In prep for the new tri-state mount option which then introduces EXT4_MOUNT_DAX_NEVER. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-4-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit 6c0d077ff8200a7b8e7131ca8e25315dec243a60 Author: Ira Weiny Date: Thu May 28 07:59:56 2020 -0700 fs/ext4: Disallow verity if inode is DAX Verity and DAX are incompatible. Changing the DAX mode due to a verity flag change is wrong without a corresponding address_space_operations update. Make the 2 options mutually exclusive by returning an error if DAX was set first. (Setting DAX is already disabled if Verity is set first.) Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-3-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit ff694ab60c29cfeba81b3d5068d3c908f22110ed Author: Ira Weiny Date: Thu May 28 07:59:55 2020 -0700 fs/ext4: Narrow scope of DAX check in setflags When preventing DAX and journaling on an inode. Use the effective DAX check rather than the mount option. This will be required to support per inode DAX flags. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20200528150003.828793-2-ira.weiny@intel.com Signed-off-by: Theodore Ts'o commit 388138764e2549520afd0b3b4e15de8deb592ff6 Author: Al Viro Date: Sat Apr 25 18:44:30 2020 -0400 comedi: get rid of compat_alloc_user_space() mess in COMEDI_RANGEINFO compat Just take copy_from_user() out of do_rangeing_ioctl() into the caller and have compat_rangeinfo() build a native version and pass it to do_rangeinfo_ioctl() directly. Signed-off-by: Al Viro commit 3fbfd2223a271426509830e6340c386a1054cfad Author: Al Viro Date: Sat Apr 25 18:35:03 2020 -0400 comedi: get rid of compat_alloc_user_space() mess in COMEDI_CHANINFO compat Just take copy_from_user() out of do_chaninfo_ioctl() into the caller and have compat_chaninfo() build a native version and pass it to do_chaninfo_ioctl() directly. Signed-off-by: Al Viro commit 5c6a8747e0cff47071d6ad3fcfe6f86713cf543a Author: Al Viro Date: Sat Apr 25 18:23:17 2020 -0400 comedi: get rid of indirection via translated_ioctl() Signed-off-by: Al Viro commit e0d0bf8a28eb04efd997478ef3d82319cdef9455 Author: Al Viro Date: Sat Apr 25 18:19:30 2020 -0400 comedi: move compat ioctl handling to native fops mechanical move Signed-off-by: Al Viro commit b1e8d713e6b2d59ee3a7b57c0dab88a19ec0cf33 Author: Jeffrey Hugo Date: Thu May 28 07:22:05 2020 -0700 clk: qcom: Add missing msm8998 ufs_unipro_core_clk_src ufs_unipro_core_clk_src is required to allow UFS to clock scale for power savings. Fixes: b5f5f525c547 ("clk: qcom: Add MSM8998 Global Clock Control (GCC) driver") Signed-off-by: Jeffrey Hugo Link: https://lkml.kernel.org/r/20200528142205.44003-1-jeffrey.l.hugo@gmail.com Signed-off-by: Stephen Boyd commit e480fe10adfe03c23b7eae811c46f6da6afba2ff Author: Stephen Boyd Date: Thu May 28 16:38:37 2020 -0700 clk: ingenic: Mark ingenic_tcu_of_match as __maybe_unused This device id table is passed to of_match_node() later on in probe, but on CONFIG_OF=n builds of_match_node() doesn't do anything with the arguments. Lets just mark the table unused so that the compiler doesn't complain about this. drivers/clk/ingenic/tcu.c:326:34: warning: unused variable 'ingenic_tcu_of_match' [-Wunused-const-variable] static const struct of_device_id ingenic_tcu_of_match[] __initconst = { ^ 1 warning generated. Reported-by: kbuild test robot Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200528233837.70269-1-sboyd@kernel.org commit 935796968ff8b69cb0c9f18c427899ebafd83509 Author: Lad Prabhakar Date: Sun May 24 22:37:54 2020 +0100 dt-bindings: usb: usb-xhci: Document r8a7742 support Document r8a7742 xhci support. The driver will use the fallback compatible string "renesas,rcar-gen2-xhci", therefore no driver change is needed. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit c092e1356b378e8567f9d6404ac27b57a4f47ae6 Author: Lad Prabhakar Date: Sun May 24 22:37:52 2020 +0100 dt-bindings: usb: renesas,usbhs: Add support for r8a7742 Document support for RZ/G1H (R8A7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit c6233c504974f131445a21891de725d1ac4d116c Author: Lad Prabhakar Date: Sun May 24 22:37:51 2020 +0100 dt-bindings: PCI: pci-rcar-gen2: Add device tree support for r8a7742 Add internal PCI bridge support for r8a7742 SoC. The Renesas RZ/G1H (R8A7742) internal PCI bridge is identical to the R-Car Gen2 family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 9184450a95f6f446dc435cad9c5409c06373eaf1 Author: Lad Prabhakar Date: Sun May 24 22:37:50 2020 +0100 dt-bindings: phy: rcar-gen2: Add r8a7742 support Add USB PHY support for r8a7742 SoC. Renesas RZ/G1H (R8A7742) USB PHY is identical to the R-Car Gen2 family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 760b17a69ffd8994d0f5f413a1cf56ef54cf5f58 Author: Matthias Brugger Date: Sat May 23 22:15:30 2020 +0200 dt-bindings: dma: uart: mtk: fix example The binding example is missing the fallback compatible. This is needed as the driver only matches against mt6577. Signed-off-by: Matthias Brugger Signed-off-by: Rob Herring commit 394f9ebf92c899b42207d4e71465869656981ba1 Merge: f4b992b461b3 ead38a8537bf Author: David S. Miller Date: Thu May 28 16:39:04 2020 -0700 Merge branch 'hns3-next' Huazhong Tan says: ==================== net: hns3: misc updates for -next This patchset includes some updates for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit ead38a8537bf87228917f23c2131c7a020fe0951 Author: Huazhong Tan Date: Thu May 28 21:48:19 2020 +0800 net: hns3: print out speed info when parsing speed fails When calling hclge_parse_speed() fails, printing out the speed is helpful for debugging. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 7c6643cac0ed78395ec10fe5b3b279e61b0ee51f Author: Huazhong Tan Date: Thu May 28 21:48:18 2020 +0800 net: hns3: remove some unused fields in struct hclge_dev Remove some fields in struct hclge_dev which have not been used. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 9cee2e8d303940a413d20c5d275bdaf418b09b17 Author: Huazhong Tan Date: Thu May 28 21:48:17 2020 +0800 net: hns3: remove two duplicated register macros in hclgevf_main.h HCLGEVF_CMDQ_INTR_SRC_REG and HCLGEVF_CMDQ_INTR_STS_REG are same as HCLGEVF_VECTOR0_CMDQ_SRC_REG and HCLGEVF_VECTOR0_CMDQ_STAT_REG, replace the former with the latter, and rename macro HCLGEVF_VECTOR0_CMDQ_STAT_REG since 'stat' is not abbreviation of 'state'. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 4828b5766a69e93ca76b15f820c97f03ebd3a48c Author: Huazhong Tan Date: Thu May 28 21:48:16 2020 +0800 net: hns3: remove unused struct hnae3_unic_private_info Since field .uinfo in struct hnae3_handle never be used, so remove it and its structure definition. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit c496299e0677fe8c12af8fd233783df1c8aa9c4e Author: Huazhong Tan Date: Thu May 28 21:48:15 2020 +0800 net: hns3; remove unused HNAE3_RESTORE_CLIENT in enum hnae3_reset_notify_type Remove HNAE3_RESTORE_CLIENT which is not needed now. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 5e86178dcead4941fcdadc963f31ed4e859e58ce Author: Huazhong Tan Date: Thu May 28 21:48:14 2020 +0800 net: hns3: remove some unused fields in struct hns3_nic_priv Remove some fileds which defined in struct hns3_nic_priv, but not used, and remove the related definition of struct hns3_udp_tunnel and enum hns3_udp_tnl_type. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit fb9e44d63dc33b455a50b772a37faf43e793da91 Author: Huazhong Tan Date: Thu May 28 21:48:13 2020 +0800 net: hns3: modify an incorrect type in struct hclgevf_cfg_gro_status_cmd Modify field .gro_en in struct hclgevf_cfg_gro_status_cmd to u8 according to the UM, otherwise, it will overwrite the reserved byte which may be used for other purpose. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 639d84d0c4281e6d8814bb2cc230bfe7ccf5019d Author: Huazhong Tan Date: Thu May 28 21:48:12 2020 +0800 net: hns3: modify an incorrect type in struct hclge_cfg_gro_status_cmd Modify field .gro_en in struct hclge_cfg_gro_status_cmd to u8 according to the UM, otherwise, it will overwrite the reserved byte which may be used for other purpose. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 5caa039f320d023fb2a40c8c7ededfca3ce85501 Author: Huazhong Tan Date: Thu May 28 21:48:11 2020 +0800 net: hns3: refactor hclge_query_bd_num_cmd_send() In order to improve code maintainability and readability, rewrite the process of BDs' initialization in hclge_query_bd_num_cmd_send(). Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 9f5a9816065f92683fd5f23cd8ec98719f20144f Author: Huazhong Tan Date: Thu May 28 21:48:10 2020 +0800 net: hns3: refactor hclge_config_tso() Since parameters 'tso_mss_min' and 'tso_mss_max' only indicate the minimum and maximum MSS, the hnae3_set_field() calls are meaningless, remove them and change the type of these two parameters to u16. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 9516352150c0cb896b3de3997b1dfe43fb96d8a5 Author: Huazhong Tan Date: Thu May 28 21:48:09 2020 +0800 net: hns3: add a missing mutex destroy in hclge_init_ad_dev() Add a mutex destroy call in hclge_init_ae_dev() when fails. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 2421ee24777e9f7effc4b6db29276eced7ca2114 Author: Huazhong Tan Date: Thu May 28 21:48:08 2020 +0800 net: hns3: remove an unnecessary 'goto' in hclge_init_ae_dev() Remove the redundant 'goto' and return -ENOMEM directly, when allocating memory for 'hdev' fails in hclge_init_ae_dev(). Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit f4b992b461b31910a0ef5acbad0af4906cbaaae0 Merge: 04d826213413 72628da6d634 Author: David S. Miller Date: Thu May 28 16:30:04 2020 -0700 Merge branch 'net-ks8851-Unify-KS8851-SPI-and-MLL-drivers' Marek Vasut says: ==================== net: ks8851: Unify KS8851 SPI and MLL drivers The KS8851SNL/SNLI and KS8851-16MLL/MLLI/MLLU are very much the same pieces of silicon, except the former has an SPI interface, while the later has a parallel bus interface. Thus far, Linux has two separate drivers for each and they are diverging considerably. This series unifies them into a single driver with small SPI and parallel bus specific parts. The approach here is to first separate out the SPI specific parts into a separate file, then add parallel bus accessors in another separate file and then finally remove the old parallel bus driver. The reason for replacing the old parallel bus driver is because the SPI bus driver is much higher quality. Note that I dropped "net: ks8851: Drop define debug and pr_fmt()" for now, will send it separatelly later. ==================== Signed-off-by: David S. Miller commit 72628da6d63413299a6369e71f5c97f0edea6a8b Author: Marek Vasut Date: Fri May 29 00:21:46 2020 +0200 net: ks8851: Remove ks8851_mll.c The ks8851_mll.c is replaced by ks8851_par.c, which is using common code from ks8851.c, just like ks8851_spi.c . Remove this old ad-hoc driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 797047f875b5463719cc70ba213eb691d453c946 Author: Marek Vasut Date: Fri May 29 00:21:45 2020 +0200 net: ks8851: Implement Parallel bus operations Implement accessors for KS8851-16MLL/MLLI/MLLU parallel bus variant of the KS8851. This is based off the ks8851_mll.c , which is a driver for exactly the same hardware, however the ks8851.c code is much higher quality. Hence, this patch pulls out the relevant information from the ks8851_mll.c on how to access the bus, but uses the common ks8851.c code. To make this patch reviewable, instead of rewriting ks8851_mll.c, ks8851_mll.c is removed in a separate subsequent patch. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b07f987a8d773c5c7dd5e5714e0468729abf132c Author: Marek Vasut Date: Fri May 29 00:21:44 2020 +0200 net: ks8851: Separate SPI operations into separate file Pull all the SPI bus specific code into a separate file, so that it is not mixed with the common code. Rename ks8851.c to ks8851_common.c. The ks8851_common.c is linked with ks8851_spi.c now, so it can call the accessors in the ks8851_spi.c without any pointer indirection. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 7a552c850c4581d698b8d47d9d03196fe572f32d Author: Marek Vasut Date: Fri May 29 00:21:43 2020 +0200 net: ks8851: Implement register, FIFO, lock accessor callbacks The register and FIFO accessors are bus specific, so is locking. Implement callbacks so that each variant of the KS8851 can implement matching accessors and locking, and use the rest of the common code. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit d2a1c643a00e881de3ceae7ebe70e90f791dbb22 Author: Marek Vasut Date: Fri May 29 00:21:42 2020 +0200 net: ks8851: Permit overridding interrupt enable register The parallel bus variant does not need to use the TX interrupt at all as it writes the TX FIFO directly with in .ndo_start_xmit, permit the drivers to configure the interrupt enable bits. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 144ad36c3d3b53045a2b3f334bd735f469cb8ea8 Author: Marek Vasut Date: Fri May 29 00:21:41 2020 +0200 net: ks8851: Factor out TX work flush function While the SPI version of the KS8851 requires a TX worker thread to pump data via SPI, the parallel bus version can write data into the TX FIFO directly in .ndo_start_xmit, as the parallel bus access is much faster and does not sleep. Factor out this TX work flush part, so it can be overridden by the parallel bus driver. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 24be72632c68e616c23ae01b08722d38242e552b Author: Marek Vasut Date: Fri May 29 00:21:40 2020 +0200 net: ks8851: Split out SPI specific code from probe() and remove() Factor out common code into ks8851_probe_common() and ks8851_remove_common() to permit both SPI and parallel bus driver variants to use the common code path for both probing and removal. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit d48b7634c692bc3df1aec413b4b4c823d55d7899 Author: Marek Vasut Date: Fri May 29 00:21:39 2020 +0200 net: ks8851: Split out SPI specific entries in struct ks8851_net Add a new struct ks8851_net_spi, which embeds the original struct ks8851_net and contains the entries specific only to the SPI variant of KS8851. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 18a3df73093287ed5ccf650e5d700b6afc3e0663 Author: Marek Vasut Date: Fri May 29 00:21:38 2020 +0200 net: ks8851: Factor out SKB receive function Factor out this netif_rx_ni(), so it could be overridden by the parallel bus variant of the KS8851 driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 22726020050beacc7a164eaaafef0048d302cf41 Author: Marek Vasut Date: Fri May 29 00:21:37 2020 +0200 net: ks8851: Factor out bus lock handling Pull out bus access locking code into separate functions, this is done in preparation for unifying the driver with the parallel bus one. The parallel bus driver does not need heavy mutex locking of the bus and works better with spinlocks, hence prepare these locking functions to be overridden then. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit aa39bf6730b72e495f711b0f06ca92e9673d648c Author: Marek Vasut Date: Fri May 29 00:21:36 2020 +0200 net: ks8851: Use 16-bit read of RXFC register The RXFC register is the only one being read using 8-bit accessors. To make it easier to support the 16-bit accesses used by the parallel bus variant of KS8851, use 16-bit accessor to read RXFC register as well as neighboring RXFCTR register. Remove ks8851_rdreg8() as it is not used anywhere anymore. There should be no functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 88cfedd0d7ab5ff047ac7eb8243fb9a69526fee7 Author: Marek Vasut Date: Fri May 29 00:21:35 2020 +0200 net: ks8851: Use 16-bit writes to program MAC address On the SPI variant of KS8851, the MAC address can be programmed with either 8/16/32-bit writes. To make it easier to support the 16-bit parallel option of KS8851 too, switch both the MAC address programming and readout to 16-bit operations. Remove ks8851_wrreg8() as it is not used anywhere anymore. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 806f66495e791eb349cd3ea286ee411bcf1df4d0 Author: Marek Vasut Date: Fri May 29 00:21:34 2020 +0200 net: ks8851: Remove ks8851_rdreg32() The ks8851_rdreg32() is used only in one place, to read two registers using a single read. To make it easier to support 16-bit accesses via parallel bus later on, replace this single read with two 16-bit reads from each of the registers and drop the ks8851_rdreg32() altogether. If this has noticeable performance impact on the SPI variant of KS8851, then we should consider using regmap to abstract the SPI and parallel bus options and in case of SPI, permit regmap to merge register reads of neighboring registers into single, longer, read. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2c5b0a86ac54dae5bcf854a93dbb086191368014 Author: Marek Vasut Date: Fri May 29 00:21:33 2020 +0200 net: ks8851: Use dev_{get,set}_drvdata() Replace spi_{get,set}_drvdata() with dev_{get,set}_drvdata(), which works for both SPI and platform drivers. This is done in preparation for unifying the KS8851 SPI and parallel bus drivers. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit b6948e1b7b094ccc86b1ae768beab734e5355ced Author: Marek Vasut Date: Fri May 29 00:21:32 2020 +0200 net: ks8851: Use devm_alloc_etherdev() Use device managed version of alloc_etherdev() to simplify the code. No functional change intended. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 848fc0ce6cb84430c4b1dd0a749015ad9af1b766 Author: Marek Vasut Date: Fri May 29 00:21:31 2020 +0200 net: ks8851: Pass device node into ks8851_init_mac() Since the driver probe function already has a struct device *dev pointer and can easily derive of_node pointer from it, pass the of_node pointer as a parameter to ks8851_init_mac() to avoid fishing it out from ks->spidev. This is the only reference to spidev in the function, so get rid of it. This is done in preparation for unifying the KS8851 SPI and parallel bus drivers. No functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2f3271c952bfa9486aa3746f591788c983fc280d Author: Marek Vasut Date: Fri May 29 00:21:30 2020 +0200 net: ks8851: Replace dev_err() with netdev_err() in IRQ handler Use netdev_err() instead of dev_err() to avoid accessing the spidev->dev in the interrupt handler. This is the only place which uses the spidev in this function, so replace it with netdev_err() to get rid of it. This is done in preparation for unifying the KS8851 SPI and parallel drivers. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit bfd1e0eb08f6ac25659e3d9bfd80b8ddffe57c94 Author: Marek Vasut Date: Fri May 29 00:21:29 2020 +0200 net: ks8851: Rename ndev to netdev in probe Rename ndev variable to netdev for the sake of consistency. No functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit d320692d9f8502e819e511ea5294552e0a8d3d9b Author: Marek Vasut Date: Fri May 29 00:21:28 2020 +0200 net: ks8851: Factor out spi->dev in probe()/remove() Pull out the spi->dev into one common place in the function instead of having it repeated over and over again. This is done in preparation for unifying ks8851 and ks8851-mll drivers. No functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing Signed-off-by: David S. Miller commit 04d826213413f727768a2f6ffa89b3f6d75afceb Merge: b113cabd4378 a31135e36ecc Author: David S. Miller Date: Thu May 28 16:26:49 2020 -0700 Merge branch 'vmxnet3-upgrade-to-version-4' Ronak Doshi says: ==================== vmxnet3: upgrade to version 4 vmxnet3 emulation has recently added several new features which includes offload support for tunnel packets, support for new commands the driver can issue to emulation, change in descriptor fields, etc. This patch series extends the vmxnet3 driver to leverage these new features. Compatibility is maintained using existing vmxnet3 versioning mechanism as follows: - new features added to vmxnet3 emulation are associated with new vmxnet3 version viz. vmxnet3 version 4. - emulation advertises all the versions it supports to the driver. - during initialization, vmxnet3 driver picks the highest version number supported by both the emulation and the driver and configures emulation to run at that version. In particular, following changes are introduced: Patch 1: This patch introduces utility macros for vmxnet3 version 4 comparison and updates Copyright information. Patch 2: This patch implements get_rss_hash_opts and set_rss_hash_opts methods to allow querying and configuring different Rx flow hash configurations which can be used to support UDP/ESP RSS. Patch 3: This patch introduces segmentation and checksum offload support for encapsulated packets. This avoids segmenting and calculating checksum for each segment and hence gives performance boost. Patch 4: With all vmxnet3 version 4 changes incorporated in the vmxnet3 driver, with this patch, the driver can configure emulation to run at vmxnet3 version 4. Changes in v3 -> v4: - Replaced BUG_ON() with WARN_ON_ONCE() Changes in v2 -> v3: - fixed get_rss_hash_opts to return correct values for udp rss Changes in v2: - Fixed compilation issue due to missing closed brace - added fallthrough comment ==================== Signed-off-by: David S. Miller commit a31135e36eccd0d16e500d3041f23c3ece62096f Author: Ronak Doshi Date: Thu May 28 14:53:22 2020 -0700 vmxnet3: update to version 4 With all vmxnet3 version 4 changes incorporated in the vmxnet3 driver, the driver can configure emulation to run at vmxnet3 version 4, provided the emulation advertises support for version 4. Signed-off-by: Ronak Doshi Signed-off-by: David S. Miller commit dacce2be33124df3c71f979ac47e3d6354a41125 Author: Ronak Doshi Date: Thu May 28 14:53:21 2020 -0700 vmxnet3: add geneve and vxlan tunnel offload support Vmxnet3 version 3 device supports checksum/TSO offload. Thus, vNIC to pNIC traffic can leverage hardware checksum/TSO offloads. However, vmxnet3 does not support checksum/TSO offload for Geneve/VXLAN encapsulated packets. Thus, for a vNIC configured with an overlay, the guest stack must first segment the inner packet, compute the inner checksum for each segment and encapsulate each segment before transmitting the packet via the vNIC. This results in significant performance penalty. This patch will enhance vmxnet3 to support Geneve/VXLAN TSO as well as checksum offload. Signed-off-by: Ronak Doshi Signed-off-by: David S. Miller commit d3a8a9e5c3b334d443e97daa59bb95c0b69f4794 Author: Ronak Doshi Date: Thu May 28 14:53:20 2020 -0700 vmxnet3: add support to get/set rx flow hash With vmxnet3 version 4, the emulation supports multiqueue(RSS) for UDP and ESP traffic. A guest can enable/disable RSS for UDP/ESP over IPv4/IPv6 by issuing commands introduced in this patch. ESP ipv6 is not yet supported in this patch. This patch implements get_rss_hash_opts and set_rss_hash_opts methods to allow querying and configuring different Rx flow hash configurations. Signed-off-by: Ronak Doshi Signed-off-by: David S. Miller commit 123db31d01219a4f794f3769e7bca6649d65ecb1 Author: Ronak Doshi Date: Thu May 28 14:53:19 2020 -0700 vmxnet3: prepare for version 4 changes vmxnet3 is currently at version 3 and this patch initiates the preparation to accommodate changes for version 4. Introduced utility macros for vmxnet3 version 4 comparison and update Copyright information. Signed-off-by: Ronak Doshi Signed-off-by: David S. Miller commit 3726cce258908ed6e30d52e2d4dfffe96ad2f962 Author: Brett Creeley Date: Fri May 15 17:51:16 2020 -0700 ice: Refactor VF VSI release and setup functions Currently when a VF VSI calls ice_vsi_release() and ice_vsi_setup() it subsequently clears/sets the VF cached variables for lan_vsi_idx and lan_vsi_num. This works fine, but can be improved by handling this in the VF specific VSI release and setup functions. Also, when a VF VSI is setup too many parameters are passed that can be derived from the VF. Fix this by only calling VF VSI setup with the bare minimum parameters. Also, add functionality to invalidate a VF's VSI when it's released and/or setup fails. This will make it so a VF VSI cannot be accessed via its cached vsi_idx/vsi_num in these cases. Finally when a VF's VSI is invalidated set the lan_vsi_idx and lan_vsi_num to ICE_NO_VSI to clearly show that there is no valid VSI associated with this VF. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 12bb018c538c3b9a050f69f62fa09fa6c9160bca Author: Brett Creeley Date: Fri May 15 17:51:15 2020 -0700 ice: Refactor VF reset Currently VF VSI are being reset twice during a PFR or greater. This is causing reset, specifically resetting all VFs, to take too long. This is causing various issues with VF drivers not being able to gracefully handle the VF reset timeout. Fix this by refactoring how VF reset is handled for the case mentioned previously and for the VFR/VFLR case. The refactor was done by doing the following: 1. Removing the call to ice_vsi_rebuild_by_type for ICE_VSI_VF VSI, which was causing the initial VSI rebuild. 2. Adding functions for pre/post VSI rebuild functions that can be called in both the reset all VFs case and reset individual VF case. 3. Adding VSI rebuild functions that are specific for the reset all VFs case and adding functions that are specific for the reset individual VF case. 4. Calling the pre-rebuild function, then the specific VSI rebuild function based on the reset type, and then calling the post-rebuild function to handle VF resets. This patch series makes some assumptions about how VSI are handling by FW during reset: 1. During a PFR or greater all VSI in FW will be cleared. 2. During a VFR/VFLR the VSI rebuild responsibility is in the hands of the PF software. 3. There is code in the ice_reset_all_vfs() case to amortize operations if possible. This was left intact. 4. PF software should not be replaying VSI based filters that were added other than host configured, PF software configured, or the VF's default/LAA MAC. This is the VF drivers job after it has been reset. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 440d7a6f73909f4d8fa9b442a3967973fc9d8fac Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:49 2020 +0800 clk: X1000: Add FIXDIV for SSI clock of X1000. 1.The SSI clock of X1000 not like JZ4770 and JZ4780, they are not directly derived from the output of SSIPLL, but from the clock obtained by dividing the frequency by 2. "X1000_CLK_SSIPLL_DIV2" is added for this purpose, and ensure that it initialized before "X1000_CLK_SSIMUX" when initializing the clocks. 2.Clocks of LCD, OTG, EMC, EFUSE, OST, TCU, and gates of CPU, PCLK are also added. 3.Use "CLK_OF_DECLARE_DRIVER" like the other CGU drivers. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Link: https://lkml.kernel.org/r/20200528031549.13846-8-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd commit 424c85e1ffea7a37808a0b6e03066fa7a248eef0 Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:48 2020 +0800 dt-bindings: clock: Add and reorder ABI for X1000. 1.The SSI clock of X1000 not like JZ4770 and JZ4780, they are not directly derived from the output of SSIPLL, but from the clock obtained by dividing the frequency by 2. "X1000_CLK_SSIPLL_DIV2" is added for this purpose, it must between "X1000_CLK_SSIPLL" and "X1000_CLK_SSIMUX", otherwise an error will occurs when initializing the clock. These ABIs are only used for X1000, and I'm sure that no other devicetree out there is using these ABIs, so we should be able to reorder them. 2.Clocks of LCD, OTG, EMC, EFUSE, OST, TCU are also added. Signed-off-by: 周琰杰 (Zhou Yanjie) Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200528031549.13846-7-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd commit ce1d86dc92496af8edf58b0870fd24980d63748e Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:47 2020 +0800 clk: Ingenic: Add CGU driver for X1830. Add support for the clocks provided by the CGU in the Ingenic X1830 SoC, making use of the cgu code to do the heavy lifting. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Link: https://lkml.kernel.org/r/20200528031549.13846-6-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd commit 9a618e6f8cdda286e49793b47f2d327878fdd827 Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:46 2020 +0800 dt-bindings: clock: Add X1830 clock bindings. Add the clock bindings for the X1830 Soc from Ingenic. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Rob Herring Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200528031549.13846-5-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd commit 9d9cc58aff468c1589df09ac12e4e79b1eaba6db Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:44 2020 +0800 clk: Ingenic: Adjust cgu code to make it compatible with X1830. The PLL of X1830 Soc from Ingenic has been greatly changed, the bypass control is placed in another register, so now two registers may needed to control the PLL. To this end, a new "bypass_reg" was introduced. In addition, when calculating rate, the PLL of X1830 introduced an extra 2x multiplier, so a new "rate_multiplier" was introduced. And adjust the code in jz47xx-cgu.c and x1000-cgu.c, make it to be compatible with the new cgu code. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Link: https://lkml.kernel.org/r/20200528031549.13846-3-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd commit 15e3ae36f71eb6564b5caa5cd02e0d0353db5b85 Author: 周琰杰 (Zhou Yanjie) Date: Thu May 28 11:15:43 2020 +0800 clk: Ingenic: Remove unnecessary spinlock when reading registers. It is not necessary to use spinlock when reading registers, so remove it from cgu.c. Suggested-by: Paul Cercueil Suggested-by: Paul Burton Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Link: https://lkml.kernel.org/r/20200528031549.13846-2-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd commit a58e1d817475eb45471869190ff72dd1b493a936 Author: Paul Greenwalt Date: Fri May 15 17:51:14 2020 -0700 ice: remove VM/VF disable command on CORER/GLOBR reset Remove VM/VF disable AQC (opcode 0x0C31) when resetting all VFs. This is not required for CORER/GLOBR reset. Signed-off-by: Paul Greenwalt Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 350e822cd54ff331bb421a59b6c096bb1739d22b Author: Brett Creeley Date: Fri May 15 17:51:13 2020 -0700 ice: Add functions to rebuild host VLAN/MAC config for a VF When resetting a VF the VLAN and MAC filter configurations need to be replayed. Add helper functions for this purpose. Signed-off-by: Brett Creeley Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit eb2af3ee94de7f493745adc34bb9d170ced8c5a9 Author: Brett Creeley Date: Fri May 15 17:51:12 2020 -0700 ice: Add function to set trust mode bit on reset As the title says, use a function to set trust mode bit on reset. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit ece9e0684ed17b146cd06d1e0b187ac3131e9365 Author: Lubomir Rintel Date: Thu May 21 11:13:56 2020 +0200 dt-bindings: usb: Convert ehci-mv to json-schema A straightforward conversion of the ehci-mv binding to DT schema format using json-schema. Signed-off-by: Lubomir Rintel [robh: add unevaluatedProperties] Signed-off-by: Rob Herring commit 7882d822b3f98db1b17fe90326e80c8f27d753af Author: Lubomir Rintel Date: Thu May 21 11:13:54 2020 +0200 dt-bindings: spi: Convert spi-pxa2xx to json-schema A straightforward conversion of the the spi-pxa2xx binding to DT schema format using json-schema. Signed-off-by: Lubomir Rintel [robh: add unevaluatedProperties] Signed-off-by: Rob Herring commit a06325a0901a887009d28e9fa06168d05c35c941 Author: Brett Creeley Date: Fri May 15 17:51:11 2020 -0700 ice: Renaming and simplification in VF init path Some function names weren't very clear and some portions of VF creation could be moved into functions for clarity. Fix this by renaming some functions and move pieces of code into clearly name functions. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 916c7fdf5e938052a869f78b35a0ca2214d25b12 Author: Brett Creeley Date: Fri May 15 17:51:10 2020 -0700 ice: Separate VF VSI initialization/creation from reset flow Currently the same flow is used for VF VSI initialization/creation and VF VSI reset. This makes the initialization/creation flow unnecessarily complicated. Fix this by separating the initialization/creation of the VF VSI from the reset flow. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 3591105b3c514813b6219f933aaeeb3988e0de35 Author: Lubomir Rintel Date: Thu May 21 11:13:52 2020 +0200 dt-bindings: media: Convert marvell,mmp2-ccic to json-schema Convert the marvell,mmp2-ccic binding to DT schema format using json-schema. While at that this drops the "func" and "phy" clocks. The driver consumes clocks with those names, but it's not clear what are they for and they are not used in DT systems. "phy" is probably a clock for the sensor and it would belong in the sensor node. Signed-off-by: Lubomir Rintel [robh: add additionalProperties] Signed-off-by: Rob Herring commit d036466330d13039a09e407b23a0dabec1a9533a Author: Colin Ian King Date: Thu May 28 23:12:19 2020 +0100 clk: intel: remove redundant initialization of variable rate64 The variable rate64 is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lkml.kernel.org/r/20200528221219.535804-1-colin.king@canonical.com Signed-off-by: Stephen Boyd commit cfcee02b6c15e8866d03cae3b80edc4e9ad8cc7d Author: Brett Creeley Date: Fri May 15 17:51:09 2020 -0700 ice: Add helper function for clearing VPGEN_VFRTRIG Create a helper function for clearing VPGEN_VFRTRIG as this needs to be done on reset to notify the VF that we are done resetting it. Also, it needs to be done on SR-IOV initialization/creation in case it was left in a bad state after SR-IOV tear down. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 09c0533d129ce460e6214c14f744ddbac3733889 Author: Palmer Dabbelt Date: Thu May 28 15:39:20 2020 -0700 soc: sifive: l2 cache: Mark l2_get_priv_group as static The kbuild test robot is firing a warning over a missing prototype. The function can just be static. Reported-by: kbuild test robot Signed-off-by: Palmer Dabbelt commit b4a4f036e84662bb5fca53ed09d65ac4f736be67 Author: Palmer Dabbelt Date: Thu May 28 14:18:12 2020 -0700 soc: sifive: l2 cache: Eliminate an unsigned zero compare warning GCC warns about this comparison, which is unnecessary. Signed-off-by: Palmer Dabbelt commit 02337f1f59148ad2d361feae0a11f6596b04632b Author: Brett Creeley Date: Fri May 15 17:51:08 2020 -0700 ice: Simplify ice_sriov_configure Add a new function for checking if SR-IOV can be configured based on the PF and/or device's state/capabilities. Also, simplify the flow in ice_sriov_configure(). Signed-off-by: Brett Creeley Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit ac3716134a40b04e18a2dda78800797129138005 Author: Brett Creeley Date: Fri May 15 17:51:07 2020 -0700 ice: Refactor ice_ena_vf_mappings to split MSIX and queue mappings Currently ice_ena_vf_mappings() does all of the VF's MSIX and queue mapping in one function. This makes it hard to digest. Fix this by creating a new function for enabling MSIX mappings and one for enabling queue mappings. Also, rename some variables in the functions for clarity. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit d3112cd1abec7a28bbe885c2151875bcff4e9092 Author: Tony Nguyen Date: Fri May 15 17:42:26 2020 -0700 ice: Declare functions static ice_get_pfa_module_tlv() and ice_read_sr_word() are not being called outside of their file. Declare them as static. Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c2b313b783e0441dab2441cc1ee216eb4b9447a6 Author: Jacob Keller Date: Fri May 15 17:42:25 2020 -0700 ice: fix kernel BUG if register_netdev fails If register_netdev() fails, the driver will attempt to cleanup the q_vectors and inadvertently trigger a kernel BUG due to a NULL pointer dereference. This occurs because cleaning up q_vectors attempts to call netif_napi_del on napi_structs which were never initialized. Resolve this by releasing the netdev in ice_cfg_netdev and setting vsi->netdev to NULL. This ensures that after ice_cfg_netdev fails the state is rewound to match as if ice_cfg_netdev was never called. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit bc3a024101ca497bea4c69be4054c32a5c349f1d Author: Jacob Keller Date: Fri May 15 17:42:24 2020 -0700 ice: fix potential double free in probe unrolling If ice_init_interrupt_scheme fails, ice_probe will jump to clearing up the interrupts. This can lead to some static analysis tools such as the compiler sanitizers complaining about double free problems. Since ice_init_interrupt_scheme already unrolls internally on failure, there is no need to call ice_clear_interrupt_scheme when it fails. Add a new unroll label and use that instead. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 072064a43ef38fab8559edfbf12f918f8acdd85b Author: Jacob Keller Date: Fri May 15 17:42:23 2020 -0700 ice: cleanup VSI context initialization Remove an unnecessary copy of vsi->info into ctxt->info in ice_vsi_init. This line is essentially a no-op because ice_set_dflt_vsi_ctx performs a memset to clear the info from the context structure. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 9918f2d22fd3ff1e76693512d29e743eba3dc8cb Author: Anirudh Venkataramanan Date: Fri May 15 17:42:22 2020 -0700 ice: Poll for reset completion when DDP load fails There are certain cases where the DDP load fails and the FW issues a core reset. For these cases, wait for reset to complete before proceeding with reset of the driver init. Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 805f64e8b5cf5838b1a0b4b9abce9084db2cf8f4 Author: Sebastian Reichel Date: Wed May 13 20:56:15 2020 +0200 dt-bindings: power: sbs-battery: Convert to yaml Convert sbs-battery bindings to YAML. Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 68956dbe6fb446ae1da60b368116e7e04f385dcb Author: Sebastian Reichel Date: Wed May 13 20:56:14 2020 +0200 power: supply: sbs-battery: constify power-supply property array Signed-off-by: Sebastian Reichel commit f9ca07a123c81b6b6e1070a515267d89956efc9e Author: Sebastian Reichel Date: Wed May 13 20:56:13 2020 +0200 power: supply: sbs-battery: switch to i2c's probe_new sbs-battery does not use the ID parameter, so switch to i2c's probe_new API. Signed-off-by: Sebastian Reichel commit 03b758ba36f0656d905f595eea33ab247d5fc945 Author: Sebastian Reichel Date: Wed May 13 20:56:12 2020 +0200 power: supply: sbs-battery: switch from of_property_* to device_property_* Switch from DT specific of_property_* API to generic and more modern device_property_* API. Signed-off-by: Sebastian Reichel commit 182fc88268f3e33fb81cbb373b30d656daf0cb48 Author: Jean-Francois Dagenais Date: Wed May 13 20:56:11 2020 +0200 power: supply: sbs-battery: add ability to disable charger broadcasts In certain designs, it is possible to add a battery on a populated i2c bus without an sbs compliant charger. In that case, the battery will unnecessarily and sometimes undesirably master the bus trying to write info in the charger. It is observed in many occasion that these battery "broadcasts" are even corrupting other ongoing master to slave communication. I.e. the multi-master support in the battery is inadequate. Thankfully, the CHARGER_MODE bit allows designers to disable that SBS battery behaviour. This needs to be done once when the battery is first seen on the bus. Signed-off-by: Jean-Francois Dagenais [rebased code] Signed-off-by: Sebastian Reichel commit f0318bc99c8107acddde3aa99a7f696c0999f37c Author: Sebastian Reichel Date: Wed May 13 20:56:10 2020 +0200 power: supply: sbs-battery: fix idle battery status A battery, that is neither charged, nor discharged is not always Full. If the charger is disabled for other reasons it might simply be idle and should be marked accordingly. Signed-off-by: Sebastian Reichel commit 6f72a07aa6e9fc0f7aa08b19f960be7748bad10f Author: Sebastian Reichel Date: Wed May 13 20:56:09 2020 +0200 power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support Add support for reporting the SBS battery's condition flag to userspace using the new "Calibration required" health status. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 7721c2fd2668c751f9ba33b35db08b86293869e5 Author: Sebastian Reichel Date: Wed May 13 20:56:08 2020 +0200 power: supply: sbs-battery: add MANUFACTURE_DATE support Expose the battery's manufacture date to userspace. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 787fdbcf5b8bce9eea96315eb618f38bf849a76c Author: Sebastian Reichel Date: Wed May 13 20:56:07 2020 +0200 power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support Expose maximum charge current/voltage information requested by the battery. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 3e9544f7a3428a524f8877f6fd99d50848c765ff Author: Sebastian Reichel Date: Wed May 13 20:56:06 2020 +0200 power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support This reads the battery chemistry from the battery chip instead of incorrectly hardcoding the type to be Li-Ion. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 8ce6ee43bd6e8ec0dc1f4bcbfeb103e634233d28 Author: Sebastian Reichel Date: Wed May 13 20:56:05 2020 +0200 power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support Expose averaged current information, which is part of the SBS standard and should be supported by all batteries. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 79bcd5a4a66076a8a8dacd7f4a3be1952283aef4 Author: Sebastian Reichel Date: Wed May 13 20:56:04 2020 +0200 power: supply: sbs-battery: add PEC support SBS batteries optionally have support for PEC. This enables PEC handling based on the implemented SBS version as suggested by the standard. The support for PEC is re-evaluated when the battery is hotplugged into the system, since there might be systems supporting batteries from different SBS generations. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit c4b12a2f3f3de670f6be5e96092a2cab0b877f1a Author: Sebastian Reichel Date: Wed May 13 20:56:03 2020 +0200 power: supply: sbs-battery: simplify read_read_string_data The SBS battery implements SMBus block reads. Currently the driver "emulates" this by doing an I2C byte read for the length followed by an I2C block read. The I2C subsystem actually provides a proper API for doing SMBus block reads, which can and should be used instead. The current implementation does not properly handle packet error checking (PEC). This change requires, that I2C bus drivers support I2C_M_RECV_LEN or directly provide the SMBus API to access device manufacturer and model name. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit d6f56321089203a9f740c7dd7eba4de88f98f993 Author: Sebastian Reichel Date: Wed May 13 20:56:02 2020 +0200 power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support Add support for reporting the MaxError register from battery fuel gauges following the smart battery standard. Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 037e910b52b04fbd41990f643dff97c7e43b0e47 Author: Xiyu Yang Date: Mon May 25 22:17:02 2020 +0800 SUNRPC: Remove unreachable error condition in rpcb_getport_async() rpcb_getport_async() invokes rpcb_call_async(), which return the value of rpc_run_task() to "child". Since rpc_run_task() is impossible to return an ERR pointer, there is no need to add the IS_ERR() condition on "child" here. So we need to remove it. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: J. Bruce Fields commit a4abc6b12eb1f7a533c2e7484cfa555454ff0977 Author: Xiyu Yang Date: Mon May 25 22:15:41 2020 +0800 nfsd: Fix svc_xprt refcnt leak when setup callback client failed nfsd4_process_cb_update() invokes svc_xprt_get(), which increases the refcount of the "c->cn_xprt". The reference counting issue happens in one exception handling path of nfsd4_process_cb_update(). When setup callback client failed, the function forgets to decrease the refcnt increased by svc_xprt_get(), causing a refcnt leak. Fix this issue by calling svc_xprt_put() when setup callback client failed. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: J. Bruce Fields commit 24c5efe41c29ee3e55bcf5a1c9f61ca8709622e8 Author: NeilBrown Date: Fri May 22 12:01:33 2020 +1000 sunrpc: clean up properly in gss_mech_unregister() gss_mech_register() calls svcauth_gss_register_pseudoflavor() for each flavour, but gss_mech_unregister() does not call auth_domain_put(). This is unbalanced and makes it impossible to reload the module. Change svcauth_gss_register_pseudoflavor() to return the registered auth_domain, and save it for later release. Cc: stable@vger.kernel.org (v2.6.12+) Link: https://bugzilla.kernel.org/show_bug.cgi?id=206651 Signed-off-by: NeilBrown Signed-off-by: J. Bruce Fields commit d47a5dc2888fd1b94adf1553068b8dad76cec96c Author: NeilBrown Date: Fri May 22 12:01:33 2020 +1000 sunrpc: svcauth_gss_register_pseudoflavor must reject duplicate registrations. There is no valid case for supporting duplicate pseudoflavor registrations. Currently the silent acceptance of such registrations is hiding a bug. The rpcsec_gss_krb5 module registers 2 flavours but does not unregister them, so if you load, unload, reload the module, it will happily continue to use the old registration which now has pointers to the memory were the module was originally loaded. This could lead to unexpected results. So disallow duplicate registrations. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206651 Cc: stable@vger.kernel.org (v2.6.12+) Signed-off-by: NeilBrown Signed-off-by: J. Bruce Fields commit f45db2b909c7e76f35850e78f017221f30282b8e Author: NeilBrown Date: Fri May 22 12:01:32 2020 +1000 sunrpc: check that domain table is empty at module unload. The domain table should be empty at module unload. If it isn't there is a bug somewhere. So check and report. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206651 Signed-off-by: NeilBrown Signed-off-by: J. Bruce Fields commit 6d97d497d48ba88e49dc5ce19c00d5df8eca3d73 Author: Anson Huang Date: Wed May 20 17:42:17 2020 +0800 dt-bindings: thermal: Convert i.MX to json-schema Convert the i.MX thermal binding to DT schema format using json-schema Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Rob Herring commit 95fc87b44104d9a524ff3e975bbfbd7c1f1a2dd5 Author: Kirti Wankhede Date: Fri May 29 02:00:54 2020 +0530 vfio: Selective dirty page tracking if IOMMU backed device pins pages Added a check such that only singleton IOMMU groups can pin pages. >From the point when vendor driver pins any pages, consider IOMMU group dirty page scope to be limited to pinned pages. To optimize to avoid walking list often, added flag pinned_page_dirty_scope to indicate if all of the vfio_groups for each vfio_domain in the domain_list dirty page scope is limited to pinned pages. This flag is updated on first pinned pages request for that IOMMU group and on attaching/detaching group. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit ad721705d09c62f0d108a6b4f59867ebfd592c90 Author: Kirti Wankhede Date: Fri May 29 02:00:53 2020 +0530 vfio iommu: Add migration capability to report supported features Added migration capability in IOMMU info chain. User application should check IOMMU info chain for migration capability to use dirty page tracking feature provided by kernel module. User application must check page sizes supported and maximum dirty bitmap size returned by this capability structure for ioctls used to get dirty bitmap. Signed-off-by: Kirti Wankhede Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit 331e33d2960c8292bad8b02578fcfac18f721517 Author: Kirti Wankhede Date: Fri May 29 02:00:52 2020 +0530 vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap DMA mapped pages, including those pinned by mdev vendor drivers, might get unpinned and unmapped while migration is active and device is still running. For example, in pre-copy phase while guest driver could access those pages, host device or vendor driver can dirty these mapped pages. Such pages should be marked dirty so as to maintain memory consistency for a user making use of dirty page tracking. To get bitmap during unmap, user should allocate memory for bitmap, set it all zeros, set size of allocated memory, set page size to be considered for bitmap and set flag VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit d6a4c185660cb978f76e46e3f5f6b08dc00ecc8f Author: Kirti Wankhede Date: Fri May 29 02:00:51 2020 +0530 vfio iommu: Implementation of ioctl for dirty pages tracking VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: - Start dirty pages tracking while migration is active - Stop dirty pages tracking. - Get dirty pages bitmap. Its user space application's responsibility to copy content of dirty pages from source to destination during migration. To prevent DoS attack, memory for bitmap is allocated per vfio_dma structure. Bitmap size is calculated considering smallest supported page size. Bitmap is allocated for all vfio_dmas when dirty logging is enabled Bitmap is populated for already pinned pages when bitmap is allocated for a vfio_dma with the smallest supported page size. Update bitmap from pinning functions when tracking is enabled. When user application queries bitmap, check if requested page size is same as page size used to populated bitmap. If it is equal, copy bitmap, but if not equal, return error. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Yan Zhao Fixed error reported by build bot by changing pgsize type from uint64_t to size_t. Reported-by: kbuild test robot Signed-off-by: Alex Williamson commit b704fd14a06f678f080e44db28061f1bcb1f595c Author: Kirti Wankhede Date: Fri May 29 02:00:50 2020 +0530 vfio iommu: Add ioctl definition for dirty pages tracking IOMMU container maintains a list of all pages pinned by vfio_pin_pages API. All pages pinned by vendor driver through this API should be considered as dirty during migration. When container consists of IOMMU capable device and all pages are pinned and mapped, then all pages are marked dirty. Added support to start/stop dirtied pages tracking and to get bitmap of all dirtied pages for requested IO virtual address range. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit cade075f265b25c3d6c13486e1bf0fbed9935a4a Author: Kirti Wankhede Date: Fri May 29 02:00:49 2020 +0530 vfio iommu: Cache pgsize_bitmap in struct vfio_iommu Calculate and cache pgsize_bitmap when iommu->domain_list is updated and iommu->external_domain is set for mdev device. Add iommu->lock protection when cached pgsize_bitmap is accessed. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit 6581708586c812460ea4798216d9dd2897ad105c Author: Kirti Wankhede Date: Fri May 29 02:00:48 2020 +0530 vfio iommu: Remove atomicity of ref_count of pinned pages vfio_pfn.ref_count is always updated while holding iommu->lock, using atomic variable is overkill. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Eric Auger Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit a8a24f3f6e38103b77cf399c38eb54e1219d00d6 Author: Kirti Wankhede Date: Fri May 29 02:00:47 2020 +0530 vfio: UAPI for migration interface for device state - Defined MIGRATION region type and sub-type. - Defined vfio_device_migration_info structure which will be placed at the 0th offset of migration region to get/set VFIO device related information. Defined members of structure and usage on read/write access. - Defined device states and state transition details. - Defined sequence to be followed while saving and resuming VFIO device. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson commit 3449aae343666e570168706ce3737d8cdd9a415f Author: Paul Cercueil Date: Wed May 20 02:22:34 2020 +0200 dt-bindings: mtd: Convert ingenic,jz4780-nand.txt to YAML Convert the ingenic,jz4780-nand.txt doc file to ingenic,nand.yaml. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 9484492c84d1e18ca1424de50f1206439ebcf635 Author: Paul Cercueil Date: Wed May 20 02:22:33 2020 +0200 dt-bindings: memory: Convert ingenic,jz4780-nemc.txt to YAML Convert the ingenic,jz4780-nemc.txt doc file to ingenic,nemc.yaml. The ingenic,jz4725b-nemc compatible string was added in the process, with a fallback to ingenic,jz4740-nemc. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit a8173820f441ab3e2a45c4bb66b70da9a57a349e Author: Maulik Shah Date: Sat May 23 22:41:10 2020 +0530 gpio: gpiolib: Allow GPIO IRQs to lazy disable With 'commit 461c1a7d4733 ("gpiolib: override irq_enable/disable")' gpiolib overrides irqchip's irq_enable and irq_disable callbacks. If irq_disable callback is implemented then genirq takes unlazy path to disable irq. Underlying irqchip may not want to implement irq_disable callback to lazy disable irq when client drivers invokes disable_irq(). By overriding irq_disable callback, gpiolib ends up always unlazy disabling IRQ. Allow gpiolib to lazy disable IRQs by overriding irq_disable callback only if irqchip implemented irq_disable. In cases where irq_disable is not implemented irq_mask is overridden. Similarly override irq_enable callback only if irqchip implemented irq_enable otherwise irq_unmask is overridden. Fixes: 461c1a7d4733 ("gpiolib: override irq_enable/disable") Signed-off-by: Maulik Shah Tested-by: Hans Verkuil Link: https://lore.kernel.org/r/1590253873-11556-2-git-send-email-mkshah@codeaurora.org Signed-off-by: Linus Walleij commit 1ade7d1f9558805c4b3c5922f3fca2ee16f5caf7 Author: Anson Huang Date: Wed May 20 08:20:35 2020 +0800 dt-bindings: gpio: Convert mxs to json-schema Convert the MXS GPIO binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 4b74c424a1b1d272e8677f26aeb5d37924fe7384 Author: Geert Uytterhoeven Date: Tue May 19 10:09:45 2020 +0200 dt-bindings: serial: Add renesas,em-uart bindings Document Device Tree bindings for the Renesas EMMA Mobile UART Interface. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Rob Herring commit 8d6c65bd91bdccf98109916dc2d558af6c89396a Author: Geert Uytterhoeven Date: Tue May 19 10:08:12 2020 +0200 dt-bindings: memory-controllers: renesas,dbsc: Convert to json-schema Convert the Renesas DDR Bus Controller Device Tree binding documentation to json-schema. Drop referrals to driver behavior. Make power-domains required, as it is present for all current users. Update the example to match reality. Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit c95d5e138f4eb93a537bc588d3f8b899adcaf46c Author: Geert Uytterhoeven Date: Tue May 19 10:05:19 2020 +0200 dt-bindings: interrupt-controller: arm,gic: Document resets property A generic GIC block embedded in an SoC may be connected to an on-SoC reset controller. Hence allow the DTS writer to describe this relation, by documenting the optional presence of a "reset" property. This gets rid of "make dtbs_check" warnings like: arch/arm/boot/dts/r8a7791-porter.dt.yaml: interrupt-controller@f1001000: 'resets' does not match any of the regexes: '^v2m@[0-9a-f]+$', 'pinctrl-[0-9]+' Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 451a044519c354a72dc9207457729df3167e52cc Author: Geert Uytterhoeven Date: Tue May 19 09:58:58 2020 +0200 ASoC: fsi: Add missing properties to DT bindings make dtbs_check: arch/arm/boot/dts/r8a7740-armadillo800eva.dt.yaml: sound@fe1f0000: '#sound-dai-cells', 'clocks', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+' Fix this by documenting the missing properties. Update the example to match reality. While at it, improve the document title, and comment the various compatible values with the corresponding SoC names. Fixes: 2f52475bac7e1572 ("ASoC: fsi: switch to yaml base Documentation") Signed-off-by: Geert Uytterhoeven Acked-by: Mark Brown Signed-off-by: Rob Herring commit ccc5d0c9d26f6458339d4b9b5239ab89249b766c Author: Geert Uytterhoeven Date: Tue May 19 09:49:53 2020 +0200 dt-bindings: rtc: rtc-sh: Add missing power-domains property make dtbs_check: arch/arm/boot/dts/r7s72100-rskrza1.dt.yaml: rtc@fcff1000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' Fix this by documenting the missing power-domains property. Update the example to match reality. Fixes: 7ae8b2f5dfb357f0 ("dt-bindings: rtc: rtc-sh: convert bindings to json-schema") Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit edaa9c460996068a128775f58e71bcd104c8203e Author: Geert Uytterhoeven Date: Tue May 19 09:42:29 2020 +0200 dt-bindings: media: Add missing clock domain description make dtbs_check: arch/arm/boot/dts/r7s72100-genmai.dt.yaml: camera@e8210000: 'clocks', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+' Fix this by documenting the missing properties. Update the example to match reality. Fixes: 58361eaa11d561f3 ("dt-bindings: media: renesas,ceu: Convert to yaml") Signed-off-by: Geert Uytterhoeven Acked-by: Jacopo Mondi Signed-off-by: Rob Herring commit 1be96d14b7a4c747952a693003250f242b4cc49a Author: Anson Huang Date: Tue May 19 11:55:47 2020 +0800 dt-bindings: timer: Convert i.MX SYSCTR to json-schema Convert the i.MX SYSCTR binding to DT schema format using json-schema. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Rob Herring commit 8f2d90100ad0f710ad9c529b366c7421778ea6fe Author: Anson Huang Date: Tue May 19 11:55:46 2020 +0800 dt-bindings: timer: Convert i.MX TPM to json-schema Convert the i.MX TPM binding to DT schema format using json-schema. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Rob Herring commit 268b7e3cdb57378145ccffef6cf00e2c45a68f2c Author: Jonathan McDowell Date: Mon May 18 19:09:31 2020 +0100 dt-bindings: vendor-prefixes: Add MikroTik MikroTik (SIA Mikrotīkls) is a Latvian company who develop routers and wireless ISP systems. Signed-off-by: Jonathan McDowell Signed-off-by: Rob Herring commit 5b7c92e31fd722b75056747d51f789030cef945a Author: Anson Huang Date: Mon May 18 22:52:34 2020 +0800 dt-bindings: clock: Convert i.MX7D clock to json-schema Convert the i.MX7D clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit d86ad463d6706d35167418660ae3293207ee9d1c Author: Tony Lindgren Date: Thu May 28 08:54:53 2020 -0700 ARM: OMAP2+: Fix regression for using local timer on non-SMP SoCs On am437x we use also an ARM timer in addition to the dmtimer. As am437x is not an SMP SoC, we need tick_broadcast() implemented. With the recent dmtimer changes, Arnd started to see link failures for non-SMP am437x configuration: kernel/time/tick-broadcast.o: in function `tick_device_uses_broadcast': tick-broadcast.c:(.text+0x130): undefined reference to `tick_broadcast' Let's fix the issue by reverting dmtimer related changes that started building timer.c only for CONFIG_SOC_HAS_REALTIME_COUNTER. We still always need timer.c built-in for omap5 and dra7 for timer_probe(). And let's also move am437x tick_broadcast() to board-generic.c as that's where we now call timer_probe() for am437x. This way we avoid adding back more ifdefs to timer.c. Fixes: 2ee04b88547a ("ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter") Reported-by: Arnd Bergmann Signed-off-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 9ecee1d6b43f9a58046f593e71da55f49ad36bcd Author: Anson Huang Date: Mon May 18 16:35:57 2020 +0800 dt-bindings: interrupt-controller: Convert imx irqsteer to json-schema Convert the i.MX IRQSTEER binding to DT schema format using json-schema. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Rob Herring commit 78f7d98be7a869fd6f99c1c2abe7ce2adc3198e0 Merge: 0d583273b49a 22e795b470ae Author: Arnd Bergmann Date: Thu May 28 22:17:49 2020 +0200 Merge branch 'baikal/drivers' into arm/drivers These are mainly fixups for comments that collided with me already merging v3 of the series, and one patch that I had forgotten to pick up. * baikal/drivers: bus: bt1-axi: Build the driver into the kernel bus: bt1-apb: Build the driver into the kernel bus: bt1-axi: Use sysfs_streq instead of strncmp bus: bt1-axi: Optimize the return points in the driver bus: bt1-apb: Use sysfs_streq instead of strncmp bus: bt1-apb: Use PTR_ERR_OR_ZERO to return from request-regs method bus: bt1-apb: Fix show/store callback identations bus: bt1-apb: Include linux/io.h dt-bindings: memory: Add Baikal-T1 L2-cache Control Block binding Signed-off-by: Arnd Bergmann commit 22e795b470aebef4c01346e3b43e0af49c7638be Author: Serge Semin Date: Thu May 28 22:31:13 2020 +0300 bus: bt1-axi: Build the driver into the kernel Alas the method trigger_all_cpu_backtrace() isn't exported by the kernel, but we need to have it called in case of the bus errors detected to get a better description of a possible cause of the error. Let's disable the ability to build the driver as a loadable kernel module then. Note In future the driver will support the AXI-bus interconnect capability, so we'd have to make it built into the kernel anyway. Link: https://lore.kernel.org/r/20200528193113.17372-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit dc20e93b935e43e9315128626f20962039fda7d9 Author: Serge Semin Date: Thu May 28 22:31:12 2020 +0300 bus: bt1-apb: Build the driver into the kernel Seeing trigger_all_cpu_backtrace() isn't exported from the kernel and since calling it is a very important part of driver, which may provide a better description of a possible cause of the error, let's disable the ability to build the driver as a loadable kernel module. Link: https://lore.kernel.org/r/20200528193113.17372-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 39c7c93de02c2c0c150ff41f33068c201b964050 Author: Lad Prabhakar Date: Fri May 15 16:45:27 2020 +0100 dt-bindings: gpio: renesas, rcar-gpio: Add r8a7742 (RZ/G1H) support Renesas RZ/G1H (R8A7742) SoC GPIO blocks are identical to the R-Car Gen2 family. Add support for its GPIO controllers. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Rob Herring commit a08790960382c24d92af43a34626ed0f3899d299 Author: Lad Prabhakar Date: Fri May 15 16:08:54 2020 +0100 dt-bindings: power: renesas,apmu: Document r8a7742 support Document APMU and SMP enable method for RZ/G1H (also known as r8a7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 75d728ed2b1e48b9801b6856147bbe26c28f3143 Author: Lad Prabhakar Date: Fri May 15 16:08:51 2020 +0100 dt-bindings: net: renesas,ether: Document R8A7742 SoC Document RZ/G1H (R8A7742) SoC bindings. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 9c95312aad21bf5c6f23a5158d1cd7f42d4560e2 Author: Lad Prabhakar Date: Fri May 15 16:08:50 2020 +0100 dt-bindings: net: renesas, ravb: Add support for r8a7742 SoC Document RZ/G1H (R8A7742) SoC bindings. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 33e70291d1ded119313ac1c20346a1f9f3b3b66f Author: Lad Prabhakar Date: Fri May 15 16:08:48 2020 +0100 dt-bindings: ata: renesas,rcar-sata: Add r8a7742 support Document SATA support for the RZ/G1H, which is compatible with R-Car Gen2 SoC family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 90f90af71876914f03e4740e263c4738b703fa89 Author: Lad Prabhakar Date: Fri May 15 16:08:42 2020 +0100 dt-bindings: i2c: renesas, iic: Document r8a7742 support Document IIC controller for RZ/G1H (R8A7742) SoC, which is compatible with R-Car Gen2 SoC family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 315148547563856f48907633cf89da4dd680f72a Author: Lad Prabhakar Date: Fri May 15 16:08:41 2020 +0100 dt-bindings: i2c: renesas, i2c: Document r8a7742 support Document i2c controller for RZ/G1H (R8A7742) SoC, which is compatible with R-Car Gen2 SoC family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit b113cabd4378ddd98dccdd7748a16f9f1f094ef0 Author: Arnd Bergmann Date: Wed May 27 15:41:06 2020 +0200 sfc: avoid an unused-variable warning 'nic_data' is no longer used outside of the #ifdef block in efx_ef10_set_mac_address: drivers/net/ethernet/sfc/ef10.c:3231:28: error: unused variable 'nic_data' [-Werror,-Wunused-variable] struct efx_ef10_nic_data *nic_data = efx->nic_data; Move the variable into a local scope. Fixes: dfcabb078847 ("sfc: move vport_id to struct efx_nic") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 186835952e934de40993c4d4ca2cd9950302b558 Author: Geert Uytterhoeven Date: Fri May 15 15:12:02 2020 +0200 dt-bindings: serial: renesas,scifa: Remove part numbers from comments The conversion to json-schema accidentally retained some SoC part numbers in comments for compatible values. Drop them, as they're part of the compatible values anyway. Fixes: 384d00fae8e51f8f ("dt-bindings: serial: sh-sci: Convert to json-schema") Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 0280a04ed9dbdaaae552b79b7a704625bd8e27cf Author: Lad Prabhakar Date: Sun May 3 22:46:47 2020 +0100 dt-bindings: serial: renesas,scifa: Document r8a7742 bindings RZ/G1H (R8A7742) SoC also has the R-Car gen2 compatible SCIFA ports, so document the SoC specific bindings. Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Lad Prabhakar Signed-off-by: Rob Herring commit 2ca41f555e857ec5beef6063bfa43a17ee76d7ec Author: Waiman Long Date: Tue May 26 08:20:14 2020 -0400 x86/spinlock: Remove obsolete ticket spinlock macros and types Even though the x86 ticket spinlock code has been removed with cfd8983f03c7 ("x86, locking/spinlocks: Remove ticket (spin)lock implementation") a while ago, there are still some ticket spinlock specific macros and types left in the asm/spinlock_types.h header file that are no longer used. Remove those as well to avoid confusion. Signed-off-by: Waiman Long Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200526122014.25241-1-longman@redhat.com commit 429ac8b75a0b1c3478ffd584de8a63075cbe25e7 Author: Fenghua Yu Date: Thu Apr 30 16:46:35 2020 -0700 x86/split_lock: Add Icelake microserver and Tigerlake CPU models Icelake microserver CPU supports split lock detection while it doesn't have the split lock enumeration bit in IA32_CORE_CAPABILITIES. Tigerlake CPUs do enumerate the MSR. [ bp: Merge the two model-adding patches into one. ] Signed-off-by: Fenghua Yu Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/1588290395-2677-1-git-send-email-fenghua.yu@intel.com commit dc35d73a42291b2a68f5b9a12b2b095b82194c1f Author: Chao Yu Date: Tue May 26 09:55:02 2020 +0800 f2fs: compress: don't compress any datas after cp stop While compressed data writeback, we need to drop dirty pages like we did for non-compressed pages if cp stops, however it's not needed to compress any data in such case, so let's detect cp stop condition in cluster_may_compress() to avoid redundant compressing and let following f2fs_write_raw_pages() drops dirty pages correctly. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 47d0d7d76437ca9f48314844bc44dd08615302a1 Author: Chao Yu Date: Wed May 27 18:27:52 2020 +0800 f2fs: remove unneeded return value of __insert_discard_tree() We never use return value of __insert_discard_tree(), so remove it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 84597b1f9b051ff75a3471c0331b6875e94b1f7e Author: Chao Yu Date: Wed May 27 18:27:51 2020 +0800 f2fs: fix wrong value of tracepoint parameter In f2fs_lookup(), we should set @err correctly before printing it in tracepoint. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit fd6126484ceaa9d94db196931c10454090f3d677 Author: Daeho Jeong Date: Wed May 27 13:02:31 2020 +0900 f2fs: protect new segment allocation in expand_inode_data Found a new segemnt allocation without f2fs_lock_op() in expand_inode_data(). So, when we do fallocate() for a pinned file and trigger checkpoint very frequently and simultaneously. F2FS gets stuck in the below code of do_checkpoint() forever. f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO); /* Wait for all dirty meta pages to be submitted for IO */ <= if fallocate() here, f2fs_wait_on_all_pages(sbi, F2FS_DIRTY_META); <= it'll wait forever. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 62c027883c736d56bbde559f755b1221263a43f2 Merge: 1e372dbd683d 3f0d97cdfe6e Author: David S. Miller Date: Thu May 28 11:17:20 2020 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-27 This series contains updates to the ice driver only. Jesse fixes a number of issues, starting with fixing the remaining signed versus unsigned comparison issues. Cleaned up an unused code define. Fixed the implementation of the manage MAC write command, to simplify it by using a simple array to represent the MAC address when writing it. Paul fixes the setting of the VF default LAN address, by removing a check that assumed that the address had been deleted and zeroed. Surabhi prevents a memory leak on filter management initialization failures and during queue initialization and buffer allocation failures. Brett adds additional receive error counters that are reported by ethtool. Fixed the enabling and disabling of VLAN stripping when the PVID has been set. Evan fixes a race condition between the firmware and software, which can occur between the admin queue setup and the first command sent. Marta fixes the driver when XDP transmit rings are destroyed, also make sure the XDP transmit queues are also destroyed. Update the statistics when XDP transmit programs are loaded and packets are sent. Changed the number of XDP transmit queues to match the number of receive queues, instead of matching the number of transmit queues. Bruce avoids undefined behavior by not writing the 8-bit element init_q_state with the associated internal-to-hardware field which is 122-bits. Anirudh (Ani) refactors the receive checksum checks. Krzysztof notifies the user if the fill queue is not long enough to prepare all buffers before packet processing starts and allocates the buffers during the NAPI poll. ==================== Signed-off-by: David S. Miller commit 1e372dbd683dbecbaa7b0c0ac392d13bf07c7aad Merge: 1eba1110f0a7 095ae612530c Author: David S. Miller Date: Thu May 28 11:11:46 2020 -0700 Merge branch 'remove-most-callers-of-kernel_setsockopt-v3' Christoph Hellwig says: ==================== remove most callers of kernel_setsockopt v3 this series removes most callers of the kernel_setsockopt functions, and instead switches their users to small functions that implement setting a sockopt directly using a normal kernel function call with type safety and all the other benefits of not having a function call. In some cases these functions seem pretty heavy handed as they do a lock_sock even for just setting a single variable, but this mirrors the real setsockopt implementation unlike a few drivers that just set set the fields directly. Changes since v2: - drop the separately merged kernel_getopt_removal - drop the sctp patches, as there is conflicting cleanup going on - add an additional ACK for the rxrpc changes Changes since v1: - use ->getname for sctp sockets in dlm - add a new ->bind_add struct proto method for dlm/sctp - switch the ipv6 and remaining sctp helpers to inline function so that the ipv6 and sctp modules are not pulled in by any module that could potentially use ipv6 or sctp connections - remove arguments to various sock_* helpers that are always used with the same constant arguments ==================== Signed-off-by: David S. Miller commit 095ae612530c9465df6d372d688cb30c6abfc5f5 Author: Christoph Hellwig Date: Thu May 28 07:12:36 2020 +0200 tipc: call tsk_set_importance from tipc_topsrv_create_listener Avoid using kernel_setsockopt for the TIPC_IMPORTANCE option when we can just use the internal helper. The only change needed is to pass a struct sock instead of tipc_sock, which is private to socket.c Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 298cd88a66a02c899772ffafbf648786ceb5ab95 Author: Christoph Hellwig Date: Thu May 28 07:12:35 2020 +0200 rxrpc: add rxrpc_sock_set_min_security_level Add a helper to directly set the RXRPC_MIN_SECURITY_LEVEL sockopt from kernel space without going through a fake uaccess. Thanks to David Howells for the documentation updates. Signed-off-by: Christoph Hellwig Acked-by: David Howells Signed-off-by: David S. Miller commit 7d7207c2d57080af93fc323dc6a85bd79207b4c6 Author: Christoph Hellwig Date: Thu May 28 07:12:34 2020 +0200 ipv6: add ip6_sock_set_recvpktinfo Add a helper to directly set the IPV6_RECVPKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 18d5ad62327576cbb1e5b9938a59d63ac0c15832 Author: Christoph Hellwig Date: Thu May 28 07:12:33 2020 +0200 ipv6: add ip6_sock_set_addr_preferences Add a helper to directly set the IPV6_ADD_PREFERENCES sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit fce934949c0f0003c1777fbf8c0706ba82a8cf7e Author: Christoph Hellwig Date: Thu May 28 07:12:32 2020 +0200 ipv6: add ip6_sock_set_recverr Add a helper to directly set the IPV6_RECVERR sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells Signed-off-by: David S. Miller commit 9b115749acb24d11083ded4fe947ddd654a940e3 Author: Christoph Hellwig Date: Thu May 28 07:12:31 2020 +0200 ipv6: add ip6_sock_set_v6only Add a helper to directly set the IPV6_V6ONLY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit c1f9ec5776dd05eaf62cf6788ecdfc905dc8ec2b Author: Christoph Hellwig Date: Thu May 28 07:12:30 2020 +0200 ipv4: add ip_sock_set_pktinfo Add a helper to directly set the IP_PKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 2de569bda2a66d1308ad3f205bb29cf4f95f5636 Author: Christoph Hellwig Date: Thu May 28 07:12:29 2020 +0200 ipv4: add ip_sock_set_mtu_discover Add a helper to directly set the IP_MTU_DISCOVER sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells [rxrpc bits] Signed-off-by: David S. Miller commit db45c0ef258ef6c7ef3c1b8ea9e06e133e083c27 Author: Christoph Hellwig Date: Thu May 28 07:12:28 2020 +0200 ipv4: add ip_sock_set_recverr Add a helper to directly set the IP_RECVERR sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells Signed-off-by: David S. Miller commit c4e446bf5a06a1db24b4f0115a89f0380a495c62 Author: Christoph Hellwig Date: Thu May 28 07:12:27 2020 +0200 ipv4: add ip_sock_set_freebind Add a helper to directly set the IP_FREEBIND sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 6ebf71bab9fb476fc8132be4c12b88201278f0ca Author: Christoph Hellwig Date: Thu May 28 07:12:26 2020 +0200 ipv4: add ip_sock_set_tos Add a helper to directly set the IP_TOS sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Signed-off-by: David S. Miller commit 480aeb9639d6a077c611b303a22f9b1e5937d081 Author: Christoph Hellwig Date: Thu May 28 07:12:25 2020 +0200 tcp: add tcp_sock_set_keepcnt Add a helper to directly set the TCP_KEEPCNT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit d41ecaac903c9f4658a71d4e7a708673cfb5abba Author: Christoph Hellwig Date: Thu May 28 07:12:24 2020 +0200 tcp: add tcp_sock_set_keepintvl Add a helper to directly set the TCP_KEEPINTVL sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 71c48eb81c9ecb6fed49dc33e7c9b621fdcb7bf8 Author: Christoph Hellwig Date: Thu May 28 07:12:23 2020 +0200 tcp: add tcp_sock_set_keepidle Add a helper to directly set the TCP_KEEP_IDLE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit c488aeadcbd002a992593e6090d54e8ac27c4310 Author: Christoph Hellwig Date: Thu May 28 07:12:22 2020 +0200 tcp: add tcp_sock_set_user_timeout Add a helper to directly set the TCP_USER_TIMEOUT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 557eadfcc5ee8f8fa98a795e05ed21db58a65db5 Author: Christoph Hellwig Date: Thu May 28 07:12:21 2020 +0200 tcp: add tcp_sock_set_syncnt Add a helper to directly set the TCP_SYNCNT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Signed-off-by: David S. Miller commit ddd061b8daed3ce0c01109a69c9a2a9f9669f01a Author: Christoph Hellwig Date: Thu May 28 07:12:20 2020 +0200 tcp: add tcp_sock_set_quickack Add a helper to directly set the TCP_QUICKACK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 12abc5ee7873a085cc280240822b8ac53c86fecd Author: Christoph Hellwig Date: Thu May 28 07:12:19 2020 +0200 tcp: add tcp_sock_set_nodelay Add a helper to directly set the TCP_NODELAY sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Acked-by: Jason Gunthorpe Signed-off-by: David S. Miller commit db10538a4b997a77a1fd561adaaa58afc7dcfa2f Author: Christoph Hellwig Date: Thu May 28 07:12:18 2020 +0200 tcp: add tcp_sock_set_cork Add a helper to directly set the TCP_CORK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit fe31a326a4aadb4a3ba2b21deacc380d06802737 Author: Christoph Hellwig Date: Thu May 28 07:12:17 2020 +0200 net: add sock_set_reuseport Add a helper to directly set the SO_REUSEPORT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 26cfabf9cdd273650126d84a48a7f8dedbcded48 Author: Christoph Hellwig Date: Thu May 28 07:12:16 2020 +0200 net: add sock_set_rcvbuf Add a helper to directly set the SO_RCVBUFFORCE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit ce3d9544cecacd40389c399d2b7ca31acc533b70 Author: Christoph Hellwig Date: Thu May 28 07:12:15 2020 +0200 net: add sock_set_keepalive Add a helper to directly set the SO_KEEPALIVE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 783da70e83967efeacf3c02c9dcfdc2b17bd62eb Author: Christoph Hellwig Date: Thu May 28 07:12:14 2020 +0200 net: add sock_enable_timestamps Add a helper to directly enable timestamps instead of setting the SO_TIMESTAMP* sockopts from kernel space and going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 7594888c782e735f8a7b110094307a4dbe7b3f03 Author: Christoph Hellwig Date: Thu May 28 07:12:13 2020 +0200 net: add sock_bindtoindex Add a helper to directly set the SO_BINDTOIFINDEX sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 76ee0785f42afbc0418072b7179d95f450d3c9a8 Author: Christoph Hellwig Date: Thu May 28 07:12:12 2020 +0200 net: add sock_set_sndtimeo Add a helper to directly set the SO_SNDTIMEO_NEW sockopt from kernel space without going through a fake uaccess. The interface is simplified to only pass the seconds value, as that is the only thing needed at the moment. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 6e43496745e75ac49d644df984d2f4ee5b5b6b4e Author: Christoph Hellwig Date: Thu May 28 07:12:11 2020 +0200 net: add sock_set_priority Add a helper to directly set the SO_PRIORITY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Signed-off-by: David S. Miller commit c433594c07457d2b2e41a87014bfad9bec279abf Author: Christoph Hellwig Date: Thu May 28 07:12:10 2020 +0200 net: add sock_no_linger Add a helper to directly set the SO_LINGER sockopt from kernel space with onoff set to true and a linger time of 0 without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Signed-off-by: David S. Miller commit b58f0e8f38c0a44afa59601a115bd231f23471e1 Author: Christoph Hellwig Date: Thu May 28 07:12:09 2020 +0200 net: add sock_set_reuseaddr Add a helper to directly set the SO_REUSEADDR sockopt from kernel space without going through a fake uaccess. For this the iscsi target now has to formally depend on inet to avoid a mostly theoretical compile failure. For actual operation it already did depend on having ipv4 or ipv6 support. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Signed-off-by: David S. Miller commit 10e68b02c861ccf2b3adb59d3f0c10dc6b5e3ace Author: Nick Desaulniers Date: Tue May 26 10:18:29 2020 -0700 Makefile: support compressed debug info As debug information gets larger and larger, it helps significantly save the size of vmlinux images to compress the information in the debug information sections. Note: this debug info is typically split off from the final compressed kernel image, which is why vmlinux is what's used in conjunction with GDB. Minimizing the debug info size should have no impact on boot times, or final compressed kernel image size. All of the debug sections will have a `C` flag set. $ readelf -S $ bloaty vmlinux.gcc75.compressed.dwarf4 -- \ vmlinux.gcc75.uncompressed.dwarf4 FILE SIZE VM SIZE -------------- -------------- +0.0% +18 [ = ] 0 [Unmapped] -73.3% -114Ki [ = ] 0 .debug_aranges -76.2% -2.01Mi [ = ] 0 .debug_frame -73.6% -2.89Mi [ = ] 0 .debug_str -80.7% -4.66Mi [ = ] 0 .debug_abbrev -82.9% -4.88Mi [ = ] 0 .debug_ranges -70.5% -9.04Mi [ = ] 0 .debug_line -79.3% -10.9Mi [ = ] 0 .debug_loc -39.5% -88.6Mi [ = ] 0 .debug_info -18.2% -123Mi [ = ] 0 TOTAL $ bloaty vmlinux.clang11.compressed.dwarf4 -- \ vmlinux.clang11.uncompressed.dwarf4 FILE SIZE VM SIZE -------------- -------------- +0.0% +23 [ = ] 0 [Unmapped] -65.6% -871 [ = ] 0 .debug_aranges -77.4% -1.84Mi [ = ] 0 .debug_frame -82.9% -2.33Mi [ = ] 0 .debug_abbrev -73.1% -2.43Mi [ = ] 0 .debug_str -84.8% -3.07Mi [ = ] 0 .debug_ranges -65.9% -8.62Mi [ = ] 0 .debug_line -86.2% -40.0Mi [ = ] 0 .debug_loc -42.0% -64.1Mi [ = ] 0 .debug_info -22.1% -122Mi [ = ] 0 TOTAL For x86_64 defconfig + LLVM=1 (before): Elapsed (wall clock) time (h:mm:ss or m:ss): 3:22.03 Maximum resident set size (kbytes): 43856 For x86_64 defconfig + LLVM=1 (after): Elapsed (wall clock) time (h:mm:ss or m:ss): 3:32.52 Maximum resident set size (kbytes): 1566776 Thanks to: Nick Clifton helped us to provide the minimal binutils version. Sedat Dilek found an increase in size of debug .deb package. Cc: Nick Clifton Suggested-by: David Blaikie Reviewed-by: Fangrui Song Tested-by: Sedat Dilek Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 565587d8d5b518234652063820561587fc269c11 Author: Masahiro Yamada Date: Mon May 25 14:47:05 2020 +0900 modpost: refactor sech_name() Use sym_get_data_by_offset() helper to get access to the .shstrtab section data. No functional change is intended because elf->sechdrs[elf->secindex_strings].sh_addr is 0 for both ET_REL and ET_EXEC object types. Signed-off-by: Masahiro Yamada commit d2e4d05cf1a1f8bfe168ea29b217355be7a4e9ec Author: Masahiro Yamada Date: Mon May 25 14:47:04 2020 +0900 modpost: fix potential segmentation fault for addend_i386_rel() This may not be a practical problem, but the second pass of ARCH=i386 modpost causes segmentation fault if the -s option is not passed. MODPOST 12 modules Segmentation fault (core dumped) make[2]: *** [scripts/Makefile.modpost:94: __modpost] Error 139 make[1]: *** [Makefile:1339: modules] Error 2 make[1]: *** Waiting for unfinished jobs.... The segmentation fault occurs when section_rel() is called for vmlinux, which is untested in regular builds. The cause of the problem is reloc_location() returning a wrong pointer for ET_EXEC object type. In this case, you need to subtract sechdr->sh_addr, otherwise it would get access beyond the mmap'ed memory. Add sym_get_data_by_offset() helper to avoid code duplication. Signed-off-by: Masahiro Yamada commit e9e81b634303b215e83beced03f04f02f7893442 Author: Masahiro Yamada Date: Mon May 25 00:42:15 2020 +0900 kbuild: disallow multi-word in M= or KBUILD_EXTMOD $(firstword ...) in scripts/Makefile.modpost was added by commit 3f3fd3c05585 ("[PATCH] kbuild: allow multi-word $M in Makefile.modpost") to build multiple external module directories. It was a solution to resolve symbol dependencies when an external module depends on another external module. Commit 0d96fb20b7ed ("kbuild: Add new Kbuild variable KBUILD_EXTRA_SYMBOLS") introduced another solution by passing symbol info via KBUILD_EXTRA_SYMBOLS, then broke the multi-word M= support. include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile) ... does not work if KBUILD_EXTMOD contains multiple words. This feature has been broken for more than a decade. Remove the bitrotten code, and stop parsing if M or KBUILD_EXTMOD contains multiple words. As Documentation/kbuild/modules.rst explains, if your module depends on another one, there are two solutions: - add a common top-level Kbuild file - use KBUILD_EXTRA_SYMBOLS Signed-off-by: Masahiro Yamada commit 1eba1110f0a7a2faa88b8bd1fc5516870bda387b Merge: d29245692a44 ed03a418abe8 Author: David S. Miller Date: Thu May 28 11:04:12 2020 -0700 Merge tag 'mlx5-updates-2020-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2020-05-26 Updates highlights: 1) From Vu Pham (8): Support VM traffics failover with bonded VF representors and e-switch egress/ingress ACLs This series introduce the support for Virtual Machine running I/O traffic over direct/fast VF path and failing over to slower paravirtualized path using the following features: __________________________________ | VM _________________ | | |FAILOVER device | | | |________________| | | | | | ____|_____ | | | | | | ______ |___ ____|_______ | | | VF PT | |VIRTIO-NET | | | | device | | device | | | |_________| |___________| | |___________|______________|________| | | | HYPERVISOR | | ____|______ | | macvtap | | |virtio BE | | |___________| | | | ____|_____ | |host VF | | |_________| | | _____|______ _____|_____ | PT VF | | host VF | |representor| |representor| |___________| |___________| \ / \ / \ / \ / _________________ \_______/ | | _______|________ | V-SWITCH | |VF representors |________________| (OVS) | | bond | |________________| |________________| | ________|________ | Uplink | | representor | |_________________| Summary: -------- Problem statement: ------------------ Currently in above topology, when netfailover device is configured using VFs and eswitch VF representors, and when traffic fails over to stand-by VF which is exposed using macvtap device to guest VM, eswitch fails to switch the traffic to the stand-by VF representor. This occurs because there is no knowledge at eswitch level of the stand-by representor device. Solution: --------- Using standard bonding driver, a bond netdevice is created over VF representor device which is used for offloading tc rules. Two VF representors are bonded together, one for the passthrough VF device and another one for the stand-by VF device. With this solution, mlx5 driver listens to the failover events occuring at the bond device level to failover traffic to either of the active VF representor of the bond. a. VM with netfailover device of VF pass-thru (PT) device and virtio-net paravirtualized device with same MAC-address to handle failover traffics at VM level. b. Host bond is active-standby mode, with the lower devices being the VM VF PT representor, and the representor of the 2nd VF to handle failover traffics at Hypervisor/V-Switch OVS level. - During the steady state (fast datapath): set the bond active device to be the VM PT VF representor. - During failover: apply bond failover to the second VF representor device which connects to the VM non-accelerated path. c. E-Switch ingress/egress ACL tables to support failover traffics at E-Switch level I. E-Switch egress ACL with forward-to-vport rule: - By default, eswitch vport egress acl forward packets to its counterpart NIC vport. - During port failover, the egress acl forward-to-vport rule will be added to e-switch vport of passive/in-active slave VF representor to forward packets to other e-switch vport ie. the active slave representor's e-switch vport to handle egress "failover" traffics. - Using lower change netdev event to detect a representor is a lower dev (slave) of bond and becomes active, adding egress acl forward-to-vport rule of all other slave netdevs to forward to this representor's vport. - Using upper change netdev event to detect a representor unslaving from bond device to delete its vport's egress acl forward-to-vport rule. II. E-Switch ingress ACL metadata reg_c for match - Bonded representors' vorts sharing tc block have the same root ingress acl table and a unique metadata for match. - Traffics from both representors's vports will be tagged with same unique metadata reg_c. - Using upper change netdev event to detect a representor enslaving/unslaving from bond device to setup shared root ingress acl and unique metadata. 2) From Alex Vesker (2): Slpit RX and TX lock for parallel rule insertion in software steering 3) Eli Britstein (2): Optimize performance for IPv4/IPv6 ethertype use the HW ip_version register rather than parsing eth frames for ethertype. ==================== Signed-off-by: David S. Miller commit d29245692a44d71d5e2e0770463184a693696232 Author: Eric Dumazet Date: Wed May 27 17:34:58 2020 -0700 tcp: ipv6: support RFC 6069 (TCP-LD) Make tcp_ld_RTO_revert() helper available to IPv6, and implement RFC 6069 : Quoting this RFC : 3. Connectivity Disruption Indication For Internet Protocol version 6 (IPv6) [RFC2460], the counterpart of the ICMP destination unreachable message of code 0 (net unreachable) and of code 1 (host unreachable) is the ICMPv6 destination unreachable message of code 0 (no route to destination) [RFC4443]. As with IPv4, a router should generate an ICMPv6 destination unreachable message of code 0 in response to a packet that cannot be delivered to its destination address because it lacks a matching entry in its routing table. Signed-off-by: Eric Dumazet Acked-by: Yuchung Cheng Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 4d7525085a9ba86b9d78561d379b2ff8c0b30468 Author: Vladimir Oltean Date: Thu May 28 03:27:58 2020 +0300 net: dsa: sja1105: offload the Credit-Based Shaper qdisc SJA1105, being AVB/TSN switches, provide hardware assist for the Credit-Based Shaper as described in the IEEE 8021Q-2018 document. First generation has 10 shapers, freely assignable to any of the 4 external ports and 8 traffic classes, and second generation has 16 shapers. The Credit-Based Shaper tables are accessed through the dynamic reconfiguration interface, so we have to restore them manually after a switch reset. The tables are backed up by the static config only on P/Q/R/S, and we don't want to add custom code only for that family, since the procedure that is in place now works for both. Tested with the following commands: data_rate_kbps=67000 port_transmit_rate_kbps=1000000 idleslope=$data_rate_kbps sendslope=$(($idleslope - $port_transmit_rate_kbps)) locredit=$((-0x80000000)) hicredit=$((0x7fffffff)) tc qdisc add dev swp2 root handle 1: mqprio hw 0 num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 tc qdisc replace dev swp2 parent 1:1 cbs \ idleslope $idleslope \ sendslope $sendslope \ hicredit $hicredit \ locredit $locredit \ offload 1 Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7c741868ceab825bb99cf6c72859e9364d54a07c Author: David Ahern Date: Wed May 27 18:03:44 2020 -0600 selftests: Add torture tests to nexthop tests Add Nik's torture tests as a new set to stress the replace and cleanup paths. Torture test created by Nikolay Aleksandrov and then I adapted to selftest and added IPv6 version. Signed-off-by: David Ahern Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 0ff969158ac7167d19a0e86e365086c093836544 Author: Sebastian Reichel Date: Wed May 13 20:56:01 2020 +0200 power: supply: sbs-battery: Add TI BQ20Z65 support Add support for BQ20Z65 manufacturer data to the sbs-battery driver. Implementation has been verified using the public TRM available from [0] and tested using a GE Flex 3S2P battery. [0] http://www.ti.com/lit/pdf/sluu386 Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit 601c2a543f02da484362b3ff9074b2cfe08750de Author: Sebastian Reichel Date: Wed May 13 20:56:00 2020 +0200 power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED Some battery fuel gauges know when the battery needs to be recalibrated before providing usable values. This should be reported via the health property. Signed-off-by: Sebastian Reichel commit feabe49e46bb556b8d43e28d4a0d459940f7a5cb Author: Sebastian Reichel Date: Wed May 13 20:55:59 2020 +0200 power: supply: core: add manufacture date properties Some smart batteries store their manufacture date, which is useful to identify the battery and/or to know about the cell quality. Signed-off-by: Sebastian Reichel commit bac705abcf345c28e419157cfcd1c44032cc9db2 Author: Sebastian Reichel Date: Wed May 13 20:55:58 2020 +0200 power: supply: core: add capacity error margin property Add a property for reporting the error margin expected by fuel gauge chips. Signed-off-by: Sebastian Reichel commit 655078f5f5286fe0ab38e90c4695001a0e15e9dd Author: Sebastian Reichel Date: Wed May 13 20:55:57 2020 +0200 kobject: increase allowed number of uevent variables SBS battery driver exposes 32 power supply properties now, which will result in uevent failure on (un)plugging the battery. Other drivers (e.g. bq27xxx) are also coming close to this limit, so increase it. Acked-by: Greg Kroah-Hartman Reviewed-by: Emil Velikov Signed-off-by: Sebastian Reichel commit 082af5ec5080b028f7d0846a6c27cbb87f288205 Merge: c350717ec7de 258c3d628fe9 Author: Will Deacon Date: Thu May 28 18:03:40 2020 +0100 Merge branch 'for-next/scs' into for-next/core Support for Clang's Shadow Call Stack in the kernel (Sami Tolvanen and Will Deacon) * for-next/scs: arm64: entry-ftrace.S: Update comment to indicate that x18 is live scs: Move DEFINE_SCS macro into core code scs: Remove references to asm/scs.h from core code scs: Move scs_overflow_check() out of architecture code arm64: scs: Use 'scs_sp' register alias for x18 scs: Move accounting into alloc/free functions arm64: scs: Store absolute SCS stack pointer value in thread_info efi/libstub: Disable Shadow Call Stack arm64: scs: Add shadow stacks for SDEI arm64: Implement Shadow Call Stack arm64: Disable SCS for hypervisor code arm64: vdso: Disable Shadow Call Stack arm64: efi: Restore register x18 if it was corrupted arm64: Preserve register x18 when CPU is suspended arm64: Reserve register x18 from general allocation with SCS scs: Disable when function graph tracing is enabled scs: Add support for stack usage debugging scs: Add page accounting for shadow call stack allocations scs: Add support for Clang's Shadow Call Stack (SCS) commit 2e9bcaccef40e81f052e4f228df91feaedd7b26c Author: Samuel Zou Date: Mon May 11 19:12:57 2020 +0800 power: supply: Make bd9995x_chip_reset static Fix the following sparse warning: drivers/power/supply/bd99954-charger.c:1028:6: warning: symbol 'bd9995x_chip_reset' was not declared. The bd9995x_chip_reset() has only one call site within bd99954-charger.c It should be static Fixes: 0902f8366491 ("power: supply: Support ROHM bd99954 charger") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Reviewed-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit c350717ec7de67daad26d996efe7f3d97d95aa9c Merge: d27865279f12 fe677be98914 Author: Will Deacon Date: Thu May 28 18:02:51 2020 +0100 Merge branch 'for-next/kvm/errata' into for-next/core KVM CPU errata rework (Andrew Scull and Marc Zyngier) * for-next/kvm/errata: KVM: arm64: Move __load_guest_stage2 to kvm_mmu.h arm64: Unify WORKAROUND_SPECULATIVE_AT_{NVHE,VHE} commit d27865279f12035c730818aa1a0280fada866a37 Merge: 342403bcb4df a4eb355a3fda Author: Will Deacon Date: Thu May 28 18:00:51 2020 +0100 Merge branch 'for-next/bti' into for-next/core Support for Branch Target Identification (BTI) in user and kernel (Mark Brown and others) * for-next/bti: (39 commits) arm64: vdso: Fix CFI directives in sigreturn trampoline arm64: vdso: Don't prefix sigreturn trampoline with a BTI C instruction arm64: bti: Fix support for userspace only BTI arm64: kconfig: Update and comment GCC version check for kernel BTI arm64: vdso: Map the vDSO text with guarded pages when built for BTI arm64: vdso: Force the vDSO to be linked as BTI when built for BTI arm64: vdso: Annotate for BTI arm64: asm: Provide a mechanism for generating ELF note for BTI arm64: bti: Provide Kconfig for kernel mode BTI arm64: mm: Mark executable text as guarded pages arm64: bpf: Annotate JITed code for BTI arm64: Set GP bit in kernel page tables to enable BTI for the kernel arm64: asm: Override SYM_FUNC_START when building the kernel with BTI arm64: bti: Support building kernel C code using BTI arm64: Document why we enable PAC support for leaf functions arm64: insn: Report PAC and BTI instructions as skippable arm64: insn: Don't assume unrecognized HINTs are skippable arm64: insn: Provide a better name for aarch64_insn_is_nop() arm64: insn: Add constants for new HINT instruction decode arm64: Disable old style assembly annotations ... commit 342403bcb4dfe41324a0f6f4cb5a8d324f31c725 Merge: 09cda9a71350 fd868f148189 b130a8f70cbb 184dbc152e39 357dd8a2aff2 4fc92254bf86 10f6cd2af21b c0fc00ec6304 472de63b0b83 269fd61e15d7 7e9f5e6629f6 Author: Will Deacon Date: Thu May 28 17:47:34 2020 +0100 Merge branches 'for-next/acpi', 'for-next/bpf', 'for-next/cpufeature', 'for-next/docs', 'for-next/kconfig', 'for-next/misc', 'for-next/perf', 'for-next/ptr-auth', 'for-next/sdei', 'for-next/smccc' and 'for-next/vdso' into for-next/core ACPI and IORT updates (Lorenzo Pieralisi) * for-next/acpi: ACPI/IORT: Remove the unused __get_pci_rid() ACPI/IORT: Fix PMCG node single ID mapping handling ACPI: IORT: Add comments for not calling acpi_put_table() ACPI: GTDT: Put GTDT table after parsing ACPI: IORT: Add extra message "applying workaround" for off-by-1 issue ACPI/IORT: work around num_ids ambiguity Revert "ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map()" ACPI/IORT: take _DMA methods into account for named components BPF JIT optimisations for immediate value generation (Luke Nelson) * for-next/bpf: bpf, arm64: Optimize ADD,SUB,JMP BPF_K using arm64 add/sub immediates bpf, arm64: Optimize AND,OR,XOR,JSET BPF_K using arm64 logical immediates arm64: insn: Fix two bugs in encoding 32-bit logical immediates Addition of new CPU ID register fields and removal of some benign sanity checks (Anshuman Khandual and others) * for-next/cpufeature: (27 commits) KVM: arm64: Check advertised Stage-2 page size capability arm64/cpufeature: Add get_arm64_ftr_reg_nowarn() arm64/cpuinfo: Add ID_MMFR4_EL1 into the cpuinfo_arm64 context arm64/cpufeature: Add remaining feature bits in ID_AA64PFR1 register arm64/cpufeature: Add remaining feature bits in ID_AA64PFR0 register arm64/cpufeature: Add remaining feature bits in ID_AA64ISAR0 register arm64/cpufeature: Add remaining feature bits in ID_MMFR4 register arm64/cpufeature: Add remaining feature bits in ID_PFR0 register arm64/cpufeature: Introduce ID_MMFR5 CPU register arm64/cpufeature: Introduce ID_DFR1 CPU register arm64/cpufeature: Introduce ID_PFR2 CPU register arm64/cpufeature: Make doublelock a signed feature in ID_AA64DFR0 arm64/cpufeature: Drop TraceFilt feature exposure from ID_DFR0 register arm64/cpufeature: Add explicit ftr_id_isar0[] for ID_ISAR0 register arm64/cpufeature: Drop open encodings while extracting parange arm64/cpufeature: Validate hypervisor capabilities during CPU hotplug arm64: cpufeature: Group indexed system register definitions by name arm64: cpufeature: Extend comment to describe absence of field info arm64: drop duplicate definitions of ID_AA64MMFR0_TGRAN constants arm64: cpufeature: Add an overview comment for the cpufeature framework ... Minor documentation tweaks for silicon errata and booting requirements (Rob Herring and Will Deacon) * for-next/docs: arm64: silicon-errata.rst: Sort the Cortex-A55 entries arm64: docs: Mandate that the I-cache doesn't hold stale kernel text Minor Kconfig cleanups (Geert Uytterhoeven) * for-next/kconfig: arm64: cpufeature: Add "or" to mitigations for multiple errata arm64: Sort vendor-specific errata Miscellaneous updates (Ard Biesheuvel and others) * for-next/misc: arm64: mm: Add asid_gen_match() helper arm64: stacktrace: Factor out some common code into on_stack() arm64: Call debug_traps_init() from trap_init() to help early kgdb arm64: cacheflush: Fix KGDB trap detection arm64/cpuinfo: Move device_initcall() near cpuinfo_regs_init() arm64: kexec_file: print appropriate variable arm: mm: use __pfn_to_section() to get mem_section arm64: Reorder the macro arguments in the copy routines efi/libstub/arm64: align PE/COFF sections to segment alignment KVM: arm64: Drop PTE_S2_MEMATTR_MASK arm64/kernel: Fix range on invalidating dcache for boot page tables arm64: set TEXT_OFFSET to 0x0 in preparation for removing it entirely arm64: lib: Consistently enable crc32 extension arm64/mm: Use phys_to_page() to access pgtable memory arm64: smp: Make cpus_stuck_in_kernel static arm64: entry: remove unneeded semicolon in el1_sync_handler() arm64/kernel: vmlinux.lds: drop redundant discard/keep macros arm64: drop GZFLAGS definition and export arm64: kexec_file: Avoid temp buffer for RNG seed arm64: rename stext to primary_entry Perf PMU driver updates (Tang Bin and others) * for-next/perf: pmu/smmuv3: Clear IRQ affinity hint on device removal drivers/perf: hisi: Permit modular builds of HiSilicon uncore drivers drivers/perf: hisi: Fix typo in events attribute array drivers/perf: arm_spe_pmu: Avoid duplicate printouts drivers/perf: arm_dsu_pmu: Avoid duplicate printouts Pointer authentication updates and support for vmcoreinfo (Amit Daniel Kachhap and Mark Rutland) * for-next/ptr-auth: Documentation/vmcoreinfo: Add documentation for 'KERNELPACMASK' arm64/crash_core: Export KERNELPACMASK in vmcoreinfo arm64: simplify ptrauth initialization arm64: remove ptrauth_keys_install_kernel sync arg SDEI cleanup and non-critical fixes (James Morse and others) * for-next/sdei: firmware: arm_sdei: Document the motivation behind these set_fs() calls firmware: arm_sdei: remove unused interfaces firmware: arm_sdei: Put the SDEI table after using it firmware: arm_sdei: Drop check for /firmware/ node and always register driver SMCCC updates and refactoring (Sudeep Holla) * for-next/smccc: firmware: smccc: Fix missing prototype warning for arm_smccc_version_init firmware: smccc: Add function to fetch SMCCC version firmware: smccc: Refactor SMCCC specific bits into separate file firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead firmware: smccc: Add the definition for SMCCCv1.2 version/error codes firmware: smccc: Update link to latest SMCCC specification firmware: smccc: Add HAVE_ARM_SMCCC_DISCOVERY to identify SMCCC v1.1 and above vDSO cleanup and non-critical fixes (Mark Rutland and Vincenzo Frascino) * for-next/vdso: arm64: vdso: Add --eh-frame-hdr to ldflags arm64: vdso: use consistent 'map' nomenclature arm64: vdso: use consistent 'abi' nomenclature arm64: vdso: simplify arch_vdso_type ifdeffery arm64: vdso: remove aarch32_vdso_pages[] arm64: vdso: Add '-Bsymbolic' to ldflags commit 431732651cc16caebcd334b7b7476bfe0c4a2903 Author: Mike Rapoport Date: Sun Feb 23 11:43:22 2020 +0200 x86/mm: Drop deprecated DISCONTIGMEM support for 32-bit The DISCONTIGMEM support was marked as deprecated in v5.2 and since there were no complaints about it for almost 5 releases it can be completely removed. Signed-off-by: Mike Rapoport Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/20200223094322.15206-1-rppt@kernel.org commit eeab133e1f144f3e7326019ca3ec11bdce44c210 Author: Kunihiko Hayashi Date: Thu May 14 21:03:20 2020 +0900 dt-bindings: PCI: Add UniPhier PCIe endpoint controller description Add DT bindings for PCIe controller implemented in UniPhier SoCs when configured in endpoint mode. This controller is based on the DesignWare PCIe core. Link: https://lore.kernel.org/r/1589457801-12796-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Kunihiko Hayashi Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit fe677be989146b8a8c0f26fe626c6567c4cd3837 Author: Marc Zyngier Date: Thu May 28 14:12:59 2020 +0100 KVM: arm64: Move __load_guest_stage2 to kvm_mmu.h Having __load_guest_stage2 in kvm_hyp.h is quickly going to trigger a circular include problem. In order to avoid this, let's move it to kvm_mmu.h, where it will be a better fit anyway. In the process, drop the __hyp_text annotation, which doesn't help as the function is marked as __always_inline. Reviewed-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit b130a8f70cbbf907c399799bd1073a78763ca0e7 Author: Marc Zyngier Date: Thu May 28 14:12:58 2020 +0100 KVM: arm64: Check advertised Stage-2 page size capability With ARMv8.5-GTG, the hardware (or more likely a hypervisor) can advertise the supported Stage-2 page sizes. Let's check this at boot time. Reviewed-by: Suzuki K Poulose Reviewed-by: Alexandru Elisei Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 38f3e775e9c242f5430a9c08c11be7577f63a41c Author: Babu Moger Date: Thu May 28 11:08:23 2020 -0500 x86/Kconfig: Update config and kernel doc for MPK feature on AMD AMD's next generation of EPYC processors support the MPK (Memory Protection Keys) feature. Update the dependency and documentation. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/159068199556.26992.17733929401377275140.stgit@naples-babu.amd.com commit 619ee76f5c9f6a1d601d1a056a454d62bf676ae4 Author: Masami Hiramatsu Date: Mon May 25 19:20:57 2020 +0900 selftests/ftrace: Return unsupported if no error_log file Check whether error_log file exists in tracing/error_log testcase and return UNSUPPORTED if no error_log file. This can happen if we run the ftracetest on the older stable kernel. Fixes: 4eab1cc461a6 ("selftests/ftrace: Add tracing/error_log testcase") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu Signed-off-by: Shuah Khan commit 8e923a2168afd221ea26e3d9716f21e9578b5c4d Author: Masami Hiramatsu Date: Mon May 11 22:36:27 2020 +0900 selftests/ftrace: Use printf for backslash included command Since the built-in echo has different behavior in POSIX shell (dash) and bash, kprobe_syntax_errors.tc can fail on dash which interpret backslash escape automatically. To fix this issue, we explicitly use printf "%s" (not interpret backslash escapes) if the command string can include backslash. Reported-by: Liu Yiding Suggested-by: Xiao Yang Signed-off-by: Masami Hiramatsu Signed-off-by: Shuah Khan commit 7df915e540ec51ce9ac5f2d2d9801d0356b617da Author: Wolfram Sang Date: Mon May 25 14:05:04 2020 +0200 i2c: avoid confusing naming in header i2c_client pointers are usually named 'client'. Use it here to get rid of the ambiguity of 'dev->dev'. Signed-off-by: Wolfram Sang commit 468ed57fd29918305d5c3f3953dcd81be6710aa7 Author: Wolfram Sang Date: Mon May 25 11:59:34 2020 +0200 i2c: slave-eeprom: update documentation to recent changes Support for 16-bit addresses has been added, so remove it from the todo list. Also, in the introductory sentence, may clear we talk about "slave IP cores" to make reading easier. Fixes: 82d514815441 ("i2c-eeprom_slave: Add support for more eeprom models") Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit bee0d92c899b8600102eedf5e6e5e88a43c0ffdf Author: Wolfram Sang Date: Mon May 25 11:59:33 2020 +0200 i2c: slave-eeprom: skip useless initialization We have a kzalloced struct, no need to init to 0. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 3e34b5135b39c4d530494e08d56b12f5b1396aa6 Author: Andy Shevchenko Date: Thu May 28 17:18:58 2020 +0300 i2c: acpi: Drop double check for ACPI companion device acpi_dev_get_resources() does perform the NULL pointer check against ACPI companion device which is given as function parameter. Thus, there is no need to duplicate this check in the caller. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit d9045b18cd445e0d0a53903ffd5d79793d9df59e Author: YueHaibing Date: Thu May 28 07:48:29 2020 +0000 mt76: mt7915: remove set but not used variable 'msta' Cc: linux-wireless@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/mediatek/mt76/mt7915/mcu.c: In function 'mt7915_mcu_sta_txbf_type': drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1805:21: warning: variable 'msta' set but not used [-Wunused-but-set-variable] It is never used, so can be removed. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Felix Fietkau commit 194a1508e082582159e312f818e11ab0f8e96e50 Author: YueHaibing Date: Thu May 28 07:48:56 2020 +0000 mt76: mt7615: Use kmemdup in mt7615_queue_key_update() Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing Signed-off-by: Felix Fietkau commit f473b42ac516befcb3ba6b0a5ef16f865f7579c9 Author: Felix Fietkau Date: Sun May 24 14:44:52 2020 +0200 mt76: only iterate over initialized rx queues Fixes the following reported crash: [ 2.361127] BUG: spinlock bad magic on CPU#0, modprobe/456 [ 2.361583] lock: 0xffffa1287525b3b8, .magic: 00000000, .owner: /-1, .owner_cpu: 0 [ 2.362250] CPU: 0 PID: 456 Comm: modprobe Not tainted 4.14.177 #5 [ 2.362751] Hardware name: HP Meep/Meep, BIOS Google_Meep.11297.75.0 06/17/2019 [ 2.363343] Call Trace: [ 2.363552] dump_stack+0x97/0xdb [ 2.363826] ? spin_bug+0xa6/0xb3 [ 2.364096] do_raw_spin_lock+0x6a/0x9a [ 2.364417] mt76_dma_rx_fill+0x44/0x1de [mt76] [ 2.364787] ? mt76_dma_kick_queue+0x18/0x18 [mt76] [ 2.365184] mt76_dma_init+0x53/0x85 [mt76] [ 2.365532] mt7615_dma_init+0x3d7/0x546 [mt7615e] [ 2.365928] mt7615_register_device+0xe6/0x1a0 [mt7615e] [ 2.366364] mt7615_mmio_probe+0x14b/0x171 [mt7615e] [ 2.366771] mt7615_pci_probe+0x118/0x13b [mt7615e] [ 2.367169] pci_device_probe+0xaf/0x13d [ 2.367491] driver_probe_device+0x284/0x2ca [ 2.367840] __driver_attach+0x7a/0x9e [ 2.368146] ? driver_attach+0x1f/0x1f [ 2.368451] bus_for_each_dev+0xa0/0xdb [ 2.368765] bus_add_driver+0x132/0x204 [ 2.369078] driver_register+0x8e/0xcd [ 2.369384] do_one_initcall+0x160/0x257 [ 2.369706] ? 0xffffffffc0240000 [ 2.369980] do_init_module+0x60/0x1bb [ 2.370286] load_module+0x18c2/0x1a2b [ 2.370596] ? kernel_read_file+0x141/0x1b9 [ 2.370937] ? kernel_read_file_from_fd+0x46/0x71 [ 2.371320] SyS_finit_module+0xcc/0xf0 [ 2.371636] do_syscall_64+0x6b/0xf7 [ 2.371930] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [ 2.372344] RIP: 0033:0x7da218ae4199 [ 2.372637] RSP: 002b:00007fffd0608398 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2.373252] RAX: ffffffffffffffda RBX: 00005a705449df90 RCX: 00007da218ae4199 [ 2.373833] RDX: 0000000000000000 RSI: 00005a7052e73bd8 RDI: 0000000000000006 [ 2.374411] RBP: 00007fffd06083e0 R08: 0000000000000000 R09: 00005a705449d540 [ 2.374989] R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000000 [ 2.375569] R13: 00005a705449def0 R14: 00005a7052e73bd8 R15: 0000000000000000 Reported-by: Sean Wang Fixes: d3377b78cec6 ("mt76: add HE phy modes and hardware queue") Signed-off-by: Felix Fietkau commit e47f2245375feef8f72ff119a939865fe5e830fd Author: DENG Qingfang Date: Sun May 24 11:41:10 2020 +0800 mt76: mt7615: add support for MT7611N MT7611N is basically the same as MT7615N, except it only supports 5GHz It is used by some TP-Link and Mercury wireless routers Signed-off-by: DENG Qingfang Signed-off-by: Felix Fietkau commit 5e616ad216ef560b2a856c858137c772351eee9f Author: Felix Fietkau Date: Sat May 23 14:40:57 2020 +0200 mt76: fix wcid allocation issues mt76 core uses ffs() to find the next free bit. This works well for 32 bit architectures where BITS_PER_LONG is 32. ffs only checks 32 bit values, so allocation fails on 64 bit architectures. Additionally, the wcid mask array was too small in cases where the array was not a multiple of BITS_PER_LONG. Fix this by making the wcid mask array u32 instead and use DIV_ROUND_UP for the size, just in case we ever bump it to a value that's not a multiple of 32. Reported-by: Ryder Lee Signed-off-by: Felix Fietkau commit ec2bb3a570ec5bfafb71113b3617929434de5ff0 Author: Lorenzo Bianconi Date: Fri May 22 09:26:06 2020 +0200 mt76: mt7915: fix possible NULL pointer dereference in mt7915_register_ext_phy Fix a NULL pointer dereference in mt7915_register_ext_phy since phy data structure is allocated by mt76_alloc_phy routine Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit eca026555f01e16011eeb6a7f63ceabd8da4f4a8 Author: Sean Wang Date: Fri May 22 09:10:24 2020 +0200 mt76: mt7615: fix hw_scan with ssid_type for specified SSID only Fix hw_scan with ssid_type for specified SSID only The definition for ssid_type in current firmware is that ssid_type BIT(2) set actually for specified SSID + wildcard SSID. ssid_type BIT(2) and ssid_type_ext BIT(0) both set actually for specified SSID only; Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 6f4bd8528c36e9abecddf698600696c7a5578f2e Author: Colin Ian King Date: Tue May 19 23:48:20 2020 +0100 mt76: mt7915: fix a handful of spelling mistakes There are some spelling mistakes in some literal strings. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Felix Fietkau commit a5e0aa78f5c44e30562a33662eeb4a594a920ce9 Author: Lorenzo Bianconi Date: Tue May 19 10:42:11 2020 +0200 mt76: mt7615: switch to per-vif power_save support switch to per-vif ps support since mt7615 offload firmware can handle it properly. This patch allows enabling/disabling power-save support on p2p interface Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit b62db09aa81c148328843afac9fcbaefdaba6913 Author: Ryder Lee Date: Tue May 19 02:07:38 2020 +0800 mt76: mt7915: fix some sparse warnings drivers/net/wireless/mediatek/mt76/mt7915/main.c:694:1: sparse: sparse: context imbalance in 'mt7915_sta_rc_update' - wrong count at exit drivers/net/wireless/mediatek/mt76/mt7915/mac.c:303:43: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:304:43: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:305:43: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:319:35: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:327:35: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:345:41: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:355:33: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: sparse: invalid assignment: |= drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: left side has type unsigned int drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: right side has type restricted __le32 Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Reported-by: kbuild test robot Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 238f5d6fc0285053a1684cbb676b9f507080633d Author: Felix Fietkau Date: Wed May 20 08:04:47 2020 +0200 mt76: fix per-driver wcid range checks after wcid array size bump All drivers before MT7915 have a limit of 128 WCID entries. Stop relying on ARRAY_SIZE(dev->mt76.wcid), since it no longer reflects that limit. Fixes: 49e649c3e0a6 ("mt76: adjust wcid size to support new 802.11ax generation") Reported-by: kbuild test robot Signed-off-by: Felix Fietkau commit ae4027a798988ba001584d77cc57e6b4cd77ddec Author: Ryder Lee Date: Wed May 13 18:50:55 2020 +0800 mt76: mt7915: fix decoded radiotap HE flags Move assignment of .data1 and .data2 to a single place and fix overwriting of values from the template Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 4c04f25dd449a825fbcd7610c7f20be1e51b088d Author: Lorenzo Bianconi Date: Sat May 16 14:56:33 2020 +0200 mt76: mt7615: fix NULL pointer deref in mt7615_register_ext_phy Fix following NULL pointer dereference in mt7615_register_ext_phy routine [ 27.648860] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000060 [ 27.657697] Mem abort info: [ 27.660495] ESR = 0x96000046 [ 27.663549] EC = 0x25: DABT (current EL), IL = 32 bits [ 27.668857] SET = 0, FnV = 0 [ 27.671910] EA = 0, S1PTW = 0 [ 27.675040] Data abort info: [ 27.677918] ISV = 0, ISS = 0x00000046 [ 27.681751] CM = 0, WnR = 1 [ 27.684717] user pgtable: 4k pages, 39-bit VAs, pgdp=000000007d8cc000 [ 27.691156] [0000000000000060] pgd=000000007d281003, pud=000000007d281003, pmd=0000000000000000 [ 27.699857] Internal error: Oops: 96000046 [#1] SMP [ 27.774939] CPU: 1 PID: 701 Comm: ash Not tainted 5.4.41 #0 [ 27.780500] Hardware name: Bananapi BPI-R64 (DT) [ 27.785108] pstate: 60000005 (nZCv daif -PAN -UAO) [ 27.789897] pc : mt7615_register_ext_phy+0x60/0x2c8 [mt7615_common] [ 27.796156] lr : mt7615_init_debugfs+0x99c/0x18e0 [mt7615_common] [ 27.802237] sp : ffffffc0115dbcb0 [ 27.805541] x29: ffffffc0115dbcb0 x28: ffffff803e309600 [ 27.810843] x27: 0000000000000000 x26: 0000000000000000 [ 27.816144] x25: ffffff803d936928 x24: ffffff803d936950 [ 27.821447] x23: 0000000000000000 x22: 0000000fffffffe0 [ 27.826749] x21: 0000000000000002 x20: ffffff8001e82620 [ 27.832050] x19: 0000000000000000 x18: 0000000000000000 [ 27.837352] x17: 0000000000000000 x16: 0000000000000000 [ 27.842653] x15: 0000000000000000 x14: 0000000000000000 [ 27.847955] x13: 0000000000000000 x12: 0000000000000000 [ 27.853256] x11: 0000000000000000 x10: 0000000000000040 [ 27.858558] x9 : ffffffc0112b3eb0 x8 : ffffffc0112b3ea8 [ 27.863859] x7 : ffffff803e400048 x6 : 0000000000000000 [ 27.869161] x5 : ffffff803e400000 x4 : 0000000000000000 [ 27.874462] x3 : 0000000000000001 x2 : 0000000000007615 [ 27.879764] x1 : 0000000000000068 x0 : ffffffc0088ccc58 [ 27.885066] Call trace: [ 27.887505] mt7615_register_ext_phy+0x60/0x2c8 [mt7615_common] [ 27.893416] mt7615_init_debugfs+0x99c/0x18e0 [mt7615_common] [ 27.899156] simple_attr_write+0xf0/0x178 [ 27.903158] debugfs_attr_write+0x4c/0x70 [ 27.907159] full_proxy_write+0x60/0x90 [ 27.910987] __vfs_write+0x18/0x40 [ 27.914379] vfs_write+0xb0/0x1b8 [ 27.917685] ksys_write+0x4c/0xc8 [ 27.920989] __arm64_sys_write+0x18/0x20 Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 19e29c69cc4760c0d340ac1fa7f8c423fcd70a08 Author: Ryder Lee Date: Sat May 16 17:05:19 2020 +0800 mt76: mt7915: fix sparse warnings: incorrect type initializer drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2317:31: sparse: sparse: incorrect type in initializer (different base types) Fixes: 5517f78b0063 ("mt76: mt7915: enable firmware module debug support") Reported-by: kbuild test robot Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit f9a5c0561029c856afe5860495a9dfe8e9004b02 Author: Ryder Lee Date: Sat May 16 17:05:18 2020 +0800 mt76: mt7915: fix some sparse warnings This fixes the following sparse warning: drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse: sparse: mixing different enum types: drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse: unsigned int enum mt7915_txq_id drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse: unsigned int enum mt76_txq_id drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse: sparse: incorrect type in argument 2 (different address spaces) drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse: expected unsigned char const [usertype] *ies drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse: got unsigned char const [noderef] * drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: sparse: incorrect type in argument 1 (different base types) drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: expected unsigned int w drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: got restricted __le32 [usertype] supp_ht_mcs drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: sparse: restricted __le32 degrades to integer drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1429:60: sparse: sparse: bad assignment (>>=) to restricted __le16 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1773:16: sparse: sparse: restricted __le32 degrades to integer Fixes: 6094f86fb371 ("mt76: mt7915: add HE bss_conf support for interfaces") Reported-by: kbuild test robot Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 06acdd380a7d3893a1115c6a6ef83961cee21f98 Author: Ryder Lee Date: Sat May 16 03:33:28 2020 +0800 mt76: mt7915: add spatial reuse support Enable or disable OBSS PD when the bss config changes or we assoc to an AP that broadcasts the IE. With this patch, we can get ~20% gain in OBSS OTA environment. Tested-by: Evelyn Tsai Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 802b836a01cf4a4c8a0ac67f2567a8f743b50701 Author: Lorenzo Bianconi Date: Fri May 15 19:05:59 2020 +0200 mt76: mt76x02: remove check in mt76x02_mcu_msg_send mt76x02_mcu_msg_send is run just by mmio code so get rid of mt76_is_mmio() check Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 7307f29687fda5486fa3bf2f9a5abe7a352bbce3 Author: Lorenzo Bianconi Date: Fri May 15 19:03:42 2020 +0200 mt76: mt7615: introduce remain_on_channel support Introduce remain_on_channel support to mt7615 driver if the device is running offload firmware Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit df7e0681dd8acfa8d07816eaef232ded816d8a8c Author: Paolo Bonzini Date: Wed May 20 08:37:37 2020 -0400 KVM: nVMX: always update CR3 in VMCS vmx_load_mmu_pgd is delaying the write of GUEST_CR3 to prepare_vmcs02 as an optimization, but this is only correct before the nested vmentry. If userspace is modifying CR3 with KVM_SET_SREGS after the VM has already been put in guest mode, the value of CR3 will not be updated. Remove the optimization, which almost never triggers anyway. Fixes: 04f11ef45810 ("KVM: nVMX: Always write vmcs02.GUEST_CR3 during nested VM-Enter") Signed-off-by: Paolo Bonzini commit 978ce5837c7ed50e4ea30cc0fa20f2f820edf8ea Author: Paolo Bonzini Date: Wed May 20 08:37:37 2020 -0400 KVM: SVM: always update CR3 in VMCB svm_load_mmu_pgd is delaying the write of GUEST_CR3 to prepare_vmcs02 as an optimization, but this is only correct before the nested vmentry. If userspace is modifying CR3 with KVM_SET_SREGS after the VM has already been put in guest mode, the value of CR3 will not be updated. Remove the optimization, which almost never triggers anyway. This was was added in commit 689f3bf21628 ("KVM: x86: unify callbacks to load paging root", 2020-03-16) just to keep the two vendor-specific modules closer, but we'll fix VMX too. Fixes: 689f3bf21628 ("KVM: x86: unify callbacks to load paging root") Signed-off-by: Paolo Bonzini commit 5b672408660e309ce7d54462eea050d5e5d0fc3d Author: Paolo Bonzini Date: Sat May 16 08:50:35 2020 -0400 KVM: nSVM: correctly inject INIT vmexits The usual drill at this point, except there is no code to remove because this case was not handled at all. Signed-off-by: Paolo Bonzini commit bd279629f73f27f0931d09cd3da904b923fb6f35 Author: Paolo Bonzini Date: Sat May 16 08:46:00 2020 -0400 KVM: nSVM: remove exit_required All events now inject vmexits before vmentry rather than after vmexit. Therefore, exit_required is not set anymore and we can remove it. Signed-off-by: Paolo Bonzini commit 7c86663b68bab393633d8312a0d25a3d004de182 Author: Paolo Bonzini Date: Sat May 16 08:42:28 2020 -0400 KVM: nSVM: inject exceptions via svm_check_nested_events This allows exceptions injected by the emulator to be properly delivered as vmexits. The code also becomes simpler, because we can just let all L0-intercepted exceptions go through the usual path. In particular, our emulation of the VMX #DB exit qualification is very much simplified, because the vmexit injection path can use kvm_deliver_exception_payload to update DR6. Signed-off-by: Paolo Bonzini commit c9d40913ac5a21eb2b976bb221a4677540e84eba Author: Paolo Bonzini Date: Fri May 22 11:21:49 2020 -0400 KVM: x86: enable event window in inject_pending_event In case an interrupt arrives after nested.check_events but before the call to kvm_cpu_has_injectable_intr, we could end up enabling the interrupt window even if the interrupt is actually going to be a vmexit. This is useless rather than harmful, but it really complicates reasoning about SVM's handling of the VINTR intercept. We'd like to never bother with the VINTR intercept if V_INTR_MASKING=1 && INTERCEPT_INTR=1, because in that case there is no interrupt window and we can just exit the nested guest whenever we want. This patch moves the opening of the interrupt window inside inject_pending_event. This consolidates the check for pending interrupt/NMI/SMI in one place, and makes KVM's usage of immediate exits more consistent, extending it beyond just nested virtualization. There are two functional changes here. They only affect corner cases, but overall they simplify the inject_pending_event. - re-injection of still-pending events will also use req_immediate_exit instead of using interrupt-window intercepts. This should have no impact on performance on Intel since it simply replaces an interrupt-window or NMI-window exit for a preemption-timer exit. On AMD, which has no equivalent of the preemption time, it may incur some overhead but an actual effect on performance should only be visible in pathological cases. - kvm_arch_interrupt_allowed and kvm_vcpu_has_events will return true if an interrupt, NMI or SMI is blocked by nested_run_pending. This makes sense because entering the VM will allow it to make progress and deliver the event. Signed-off-by: Paolo Bonzini commit 6457d644260da69baf48b934df73ead8d0631fb9 Author: Anson Huang Date: Thu May 14 19:41:10 2020 +0800 dt-bindings: pwm: Convert mxs pwm to json-schema Convert the mxs pwm binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 30b1e7c4e24b401f3421f07478bd0902b7b0dac1 Author: Geert Uytterhoeven Date: Thu May 14 13:30:02 2020 +0200 dt-bindings: auxdisplay: hd44780: Convert to json-schema Convert the Hitachi HD44780 Character LCD Controller Device Tree binding documentation to json-schema. Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit b07de4461adeadbf108a4b0900c9313e9848ff51 Author: Ricardo Cañuelo Date: Thu May 14 12:12:35 2020 +0200 dt-bindings: display: anx7814.txt: convert to yaml This converts the Analogix ANX7814 bridge DT binding to yaml. Port definitions and descriptions were expanded, apart from that it's a direct translation from the original binding. Signed-off-by: Ricardo Cañuelo Acked-by: Sam Ravnborg Reviewed-by: Enric Balletbo i Serra Signed-off-by: Rob Herring commit 87976ce2825d9f1ca2e70ee7d38dec490ad5a6e2 Author: Serge Semin Date: Thu May 28 17:28:05 2020 +0300 hwmon: Add Baikal-T1 PVT sensor driver Baikal-T1 SoC provides an embedded process, voltage and temperature sensor to monitor an internal SoC environment (chip temperature, supply voltage and process monitor) and on time detect critical situations, which may cause the system instability and even damages. The IP-block is based on the Analog Bits PVT sensor, but is equipped with a dedicated control wrapper, which provides a MMIO registers-based access to the sensor core functionality (APB3-bus based) and exposes an additional functions like thresholds/data ready interrupts, its status and masks, measurements timeout. All of these is used to create a hwmon driver being added to the kernel by this commit. The driver implements support for the hardware monitoring capabilities of Baikal-T1 process, voltage and temperature sensors. PVT IP-core consists of one temperature and four voltage sensors, each of which is implemented as a dedicated hwmon channel config. The driver can optionally provide the hwmon alarms for each sensor the PVT controller supports. The alarms functionality is made compile-time configurable due to the hardware interface implementation peculiarity, which is connected with an ability to convert data from only one sensor at a time. Additional limitation is that the controller performs the thresholds checking synchronously with the data conversion procedure. Due to these limitations in order to have the hwmon alarms automatically detected the driver code must switch from one sensor to another, read converted data and manually check the threshold status bits. Depending on the measurements timeout settings this design may cause additional burden on the system performance. By default if the alarms kernel config is disabled the data conversion is performed by the driver on demand when read operation is requested via corresponding _input-file. Co-developed-by: Maxim Kaurkin Signed-off-by: Maxim Kaurkin Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Guenter Roeck commit 1597b374af22266266e1e20612208c4b11359ad4 Author: Guenter Roeck Date: Thu May 28 17:28:04 2020 +0300 hwmon: Add notification support For hwmon drivers using the hwmon_device_register_with_info() API, it is desirable to have a generic notification mechanism available. This mechanism can be used to notify userspace as well as the thermal subsystem if the driver experiences any events, such as warning or critical alarms. Implement hwmon_notify_event() to provide this mechanism. The function generates a sysfs event and a udev event. If the device is registered with the thermal subsystem and the event is associated with a temperature sensor, also notify the thermal subsystem that a thermal event occurred. Signed-off-by: Guenter Roeck Signed-off-by: Serge Semin Cc: Maxim Kaurkin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Guenter Roeck commit ddc65caa56660813af1c8cff979bdc80f81456f2 Author: Serge Semin Date: Thu May 28 17:28:03 2020 +0300 dt-bindings: hwmon: Add Baikal-T1 PVT sensor binding Baikal-T1 SoC is equipped with an embedded process, voltage and temperature sensor to monitor the chip internal environment like temperature, supply voltage and transistors performance. This bindings describes the external Baikal-T1 PVT control interfaces like MMIO registers space, interrupt request number and clocks source. These are then used by the corresponding hwmon device driver to implement the sysfs files-based access to the sensors functionality. Co-developed-by: Maxim Kaurkin Signed-off-by: Maxim Kaurkin Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Signed-off-by: Guenter Roeck commit 91920088536fa1cf01ceedbfb96219699d088756 Author: Serge Semin Date: Thu May 28 17:50:50 2020 +0300 bus: bt1-axi: Use sysfs_streq instead of strncmp There is a ready-to-use method to compare a retrieved from a sysfs node string with another string. It treats both NUL and newline-then-NUL as equivalent string terminations. So use it instead of manually truncating the line length in the strncmp() method. Link: https://lore.kernel.org/r/20200528145050.5203-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: Andy Shevchenko Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 7f57416f2aebe6f8b6ad105b4ca58b347fb2dd2c Author: Serge Semin Date: Thu May 28 17:50:49 2020 +0300 bus: bt1-axi: Optimize the return points in the driver It's better to have a single return statement where it's applicable instead of returning from a conditional statement if-clause. Let's do this in the request registers, clock and IRQ methods. Link: https://lore.kernel.org/r/20200528145050.5203-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: Andy Shevchenko Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit b7cb430d5f11b24c1c5809ab46a098ff299b975f Author: Serge Semin Date: Thu May 28 17:50:48 2020 +0300 bus: bt1-apb: Use sysfs_streq instead of strncmp There is a ready-to-use method to compare a retrieved from a sysfs node string with another string. It treats both NUL and newline-then-NUL as equivalent string terminations. So use it instead of manually truncating the line length in the strncmp() method. Link: https://lore.kernel.org/r/20200528145050.5203-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: Andy Shevchenko Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 75341b3d358d27f7c22e48bcd92926c49f79e9be Author: Serge Semin Date: Thu May 28 17:50:47 2020 +0300 bus: bt1-apb: Use PTR_ERR_OR_ZERO to return from request-regs method Indeed it's more optimal to use the PTR_ERR_OR_ZERO() macro there instead of having two return points. Link: https://lore.kernel.org/r/20200528145050.5203-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: Andy Shevchenko Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit b19dc1b79993a7e6a2c0aa1725f679bb9ae8ad89 Author: Serge Semin Date: Thu May 28 17:50:46 2020 +0300 bus: bt1-apb: Fix show/store callback identations After fixing the sysfs calback return value the functions argumnets identations have been left as before the fix. That made the argments declarations being unaligned with respect to the space surrounded by the parentheses. Link: https://lore.kernel.org/r/20200528145050.5203-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: Andy Shevchenko Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 1c8ceb16bcb924c8bceb638b2d6cde4c104a8114 Author: Serge Semin Date: Thu May 28 17:50:45 2020 +0300 bus: bt1-apb: Include linux/io.h It must be included since we are using readl() method here. Link: https://lore.kernel.org/r/20200528145050.5203-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Olof Johansson Cc: Andy Shevchenko Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 2313fca7b44df96d262c0b38af3c57690b65a4e6 Author: Serge Semin Date: Tue May 26 15:59:25 2020 +0300 dt-bindings: memory: Add Baikal-T1 L2-cache Control Block binding There is a single register provided by the SoC system controller, which can be used to tune the L2-cache RAM up. It only provides a way to change the L2-RAM access latencies. So aside from "be,bt1-l2-ctl" compatible string the device node can be optionally equipped with the properties of Tag/Data/WS latencies. Link: https://lore.kernel.org/r/20200526125928.17096-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Paul Burton Cc: Olof Johansson Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Reviewed-by: Rob Herring Signed-off-by: Arnd Bergmann commit dc35ada4251f183137ee3a524543c9329d7a4fa2 Author: Christoph Hellwig Date: Thu May 28 15:41:23 2020 +0200 block: fix a warning when blkdev.h is included for !CONFIG_BLOCK builds disk_start_io_acct and disk_end_io_acct need at least a struct gendisk forward declaration, but for weird historic reasons much of blkdev.h is stubbed out for CONFIG_BLOCK=n. Fix this by stubbing more out for now, but eventually this header will need a massive cleanup. Fixes: 956d510ee78 ("block: add disk/bio-based accounting helpers") Reported-by: Stephen Rothwell Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 9b2d2066ddf6f38c79aa38321544999fa943f0e0 Author: Adrian Hunter Date: Thu May 28 15:08:59 2020 +0300 perf intel-pt: Refine kernel decoding only warning message Stop the message displaying when user space is not being traced. Example: Prerequisites: sudo setcap "cap_sys_rawio,cap_sys_admin,cap_sys_ptrace,cap_syslog,cap_ipc_lock=ep" ~/bin/perf sudo chmod +r /proc/kcore Before: $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001 Warning: Intel Processor Trace decoding will not be possible except for kernel tracing! [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.838 MB perf.data ] After: $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.068 MB perf.data ] $ sudo chmod go-r /proc/kcore $ sudo setcap -r ~/bin/perf Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Cc: Mathieu Poirier Link: http://lore.kernel.org/lkml/20200528120859.21604-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d0684fd0bd79395e074dd668feee5d53b134b1a3 Author: Gustavo A. R. Silva Date: Mon May 25 11:43:19 2020 -0500 PCI: hv: Use struct_size() helper One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct hv_dr_state { ... struct hv_pcidev_description func[]; }; struct pci_bus_relations { ... struct pci_function_description func[]; } __packed; Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. So, replace the following forms: offsetof(struct hv_dr_state, func) + (sizeof(struct hv_pcidev_description) * (relations->device_count)) offsetof(struct pci_bus_relations, func) + (sizeof(struct pci_function_description) * (bus_rel->device_count)) with: struct_size(dr, func, relations->device_count) and struct_size(bus_rel, func, bus_rel->device_count) respectively. Link: https://lore.kernel.org/r/20200525164319.GA13596@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Lorenzo Pieralisi Reviewed-by: Wei Liu commit 16b4b4e1a0038365a6734a4f50aba77e57865c8e Author: Adrian Hunter Date: Thu May 28 15:08:58 2020 +0300 perf record: Respect --no-switch-events Context switch events are added automatically by Intel PT and Coresight. Make it possible to suppress them. That is useful for tracing the scheduler without the disturbance that the switch event processing creates. Example: Prerequisites: $ which perf ~/bin/perf $ sudo setcap "cap_sys_rawio,cap_sys_admin,cap_sys_ptrace,cap_syslog,cap_ipc_lock=ep" ~/bin/perf $ sudo chmod +r /proc/kcore Before: $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.938 MB perf.data ] $ perf script -D | grep PERF_RECORD_SWITCH | wc -l 572 After: $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001 Warning: Intel Processor Trace decoding will not be possible except for kernel tracing! [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.838 MB perf.data ] $ perf script -D | grep PERF_RECORD_SWITCH | wc -l 0 $ sudo chmod go-r /proc/kcore $ sudo setcap -r ~/bin/perf Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Jiri Olsa Cc: Mathieu Poirier Link: http://lore.kernel.org/lkml/20200528120859.21604-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b51640854df12c361719ea1d8bdcf026009bd89d Author: Adrian Hunter Date: Wed May 27 21:02:50 2020 +0300 perf script: Fix --call-trace for Intel PT Make process_attr() respect -F-ip, noting also that the condition in process_attr() (callchain_param.record_mode != CALLCHAIN_NONE) is always true so test the sample type directly. Example: Before: $ perf record -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.033 MB perf.data ] $ perf script --call-trace | head -5 uname 30992 [006] 41758.313696574: cbr: 42 freq: 4219 MHz (156%) 0 [unknown] ([unknown] ) uname 30992 [006] 41758.313696907: _start 7f71792c4100 _start+0x0 (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) uname 30992 [006] 41758.313699574: _dl_start 7f71792c4103 _start+0x3 (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) uname 30992 [006] 41758.313699907: _dl_start 7f71792c4e18 _dl_start+0x28 (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) uname 30992 [006] 41758.313701574: _dl_start 7f71792c5128 _dl_start+0x338 (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) After: $ perf script --call-trace | head -5 uname 30992 [006] 41758.313696574: cbr: 42 freq: 4219 MHz (156%) uname 30992 [006] 41758.313696907: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _start uname 30992 [006] 41758.313699574: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start uname 30992 [006] 41758.313699907: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start uname 30992 [006] 41758.313701574: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start Fixes: f288e8e1aa4f ("perf script: Enable IP fields for callchains") Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200527180250.16723-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 936f2a70f2077f64fab1dcb3eca71879e82ecd3f Author: Boris Burkov Date: Wed May 27 14:43:19 2020 -0700 cgroup: add cpu.stat file to root cgroup Currently, the root cgroup does not have a cpu.stat file. Add one which is consistent with /proc/stat to capture global cpu statistics that might not fall under cgroup accounting. We haven't done this in the past because the data are already presented in /proc/stat and we didn't want to add overhead from collecting root cgroup stats when cgroups are configured, but no cgroups have been created. By keeping the data consistent with /proc/stat, I think we avoid the first problem, while improving the usability of cgroups stats. We avoid the second problem by computing the contents of cpu.stat from existing data collected for /proc/stat anyway. Signed-off-by: Boris Burkov Suggested-by: Tejun Heo Signed-off-by: Tejun Heo commit 1d0326f352bb094771df17f045bdbadff89a43e6 Author: Marek Vasut Date: Thu May 14 02:25:55 2020 +0200 genirq: Check irq_data_get_irq_chip() return value before use irq_data_get_irq_chip() can return NULL, however it is expected that this never happens. If a buggy driver leads to NULL being returned from irq_data_get_irq_chip(), warn about it instead of crashing the machine. Signed-off-by: Marek Vasut Signed-off-by: Thomas Gleixner To: linux-arm-kernel@lists.infradead.org commit 094235222d41d68d35de18170058d94a96a82628 Author: Ram Pai Date: Mon Feb 24 01:09:48 2020 -0500 powerpc/xive: Share the event-queue page with the Hypervisor. XIVE interrupt controller uses an Event Queue (EQ) to enqueue event notifications when an exception occurs. The EQ is a single memory page provided by the O/S defining a circular buffer, one per server and priority couple. On baremetal, the EQ page is configured with an OPAL call. On pseries, an extra hop is necessary and the guest OS uses the hcall H_INT_SET_QUEUE_CONFIG to configure the XIVE interrupt controller. The XIVE controller being Hypervisor privileged, it will not be allowed to enqueue event notifications for a Secure VM unless the EQ pages are shared by the Secure VM. Hypervisor/Ultravisor still requires support for the TIMA and ESB page fault handlers. Until this is complete, QEMU can use the emulated XIVE device for Secure VMs, option "kernel_irqchip=off" on the QEMU pseries machine. Signed-off-by: Ram Pai Reviewed-by: Cedric Le Goater Reviewed-by: Greg Kurz Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200426020518.GC5853@oc0525413822.ibm.com commit 373b373053384f12951ae9f916043d955501d482 Author: Kajol Jain Date: Mon May 25 16:13:07 2020 +0530 powerpc/pseries: Update hv-24x7 information after migration Function 'read_sys_info_pseries()' is added to get system parameter values like number of sockets and chips per socket. and it gets these details via rtas_call with token "PROCESSOR_MODULE_INFO". Incase lpar migrate from one system to another, system parameter details like chips per sockets or number of sockets might change. So, it needs to be re-initialized otherwise, these values corresponds to previous system values. This patch adds a call to 'read_sys_info_pseries()' from 'post-mobility_fixup()' to re-init the physsockets and physchips values Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200525104308.9814-6-kjain@linux.ibm.com commit 15cd1d35ba4a59832df693858ef046457107bd8d Author: Kajol Jain Date: Mon May 25 16:13:06 2020 +0530 Documentation/ABI: Add ABI documentation for chips and sockets Add documentation for the following sysfs files: /sys/devices/hv_24x7/interface/chipspersocket, /sys/devices/hv_24x7/interface/sockets, /sys/devices/hv_24x7/interface/coresperchip Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200525104308.9814-5-kjain@linux.ibm.com commit 60beb65da1efd4cc23d05141181c39b98487950f Author: Kajol Jain Date: Mon May 25 16:13:05 2020 +0530 powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details To expose the system dependent parameter like total number of sockets and numbers of chips per socket, patch adds two sysfs files. "sockets" and "chips" are added to /sys/devices/hv_24x7/interface/ of the "hv_24x7" pmu. Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200525104308.9814-4-kjain@linux.ibm.com commit 8ba21426738207711347335b2cf3e99c690fc777 Author: Kajol Jain Date: Mon May 25 16:13:04 2020 +0530 powerpc/hv-24x7: Add rtas call in hv-24x7 driver to get processor details For hv_24x7 socket/chip level events, specific chip-id to which the data requested should be added as part of pmu events. But number of chips/socket in the system details are not exposed. Patch implements read_24x7_sys_info() to get system parameter values like number of sockets, cores per chip and chips per socket. Rtas_call with token "PROCESSOR_MODULE_INFO" is used to get these values. Subsequent patch exports these values via sysfs. Patch also make these parameters default to 1. Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200525104308.9814-3-kjain@linux.ibm.com commit b4ac18eead28611ff470d0f47a35c4e0ac080d9c Author: Kajol Jain Date: Mon May 25 16:13:03 2020 +0530 powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run Commit 2b206ee6b0df ("powerpc/perf/hv-24x7: Display change in counter values")' added to print _change_ in the counter value rather then raw value for 24x7 counters. Incase of transactions, the event count is set to 0 at the beginning of the transaction. It also sets the event's prev_count to the raw value at the time of initialization. Because of setting event count to 0, we are seeing some weird behaviour, whenever we run multiple 24x7 events at a time. For example: command#: ./perf stat -e "{hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/, hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/}" -C 0 -I 1000 sleep 100 1.000121704 120 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 1.000121704 5 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 2.000357733 8 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 2.000357733 10 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 3.000495215 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 3.000495215 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 4.000641884 56 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 4.000641884 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 5.000791887 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ Getting these large values in case we do -I. As we are setting event_count to 0, for interval case, overall event_count is not coming in incremental order. As we may can get new delta lesser then previous count. Because of which when we print intervals, we are getting negative value which create these large values. This patch removes part where we set event_count to 0 in function 'h_24x7_event_read'. There won't be much impact as we do set event->hw.prev_count to the raw value at the time of initialization to print change value. With this patch In power9 platform command#: ./perf stat -e "{hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/, hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/}" -C 0 -I 1000 sleep 100 1.000117685 93 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 1.000117685 1 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 2.000349331 98 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 2.000349331 2 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 3.000495900 131 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 3.000495900 4 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 4.000645920 204 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ 4.000645920 61 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/ 4.284169997 22 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/ Suggested-by: Sukadev Bhattiprolu Signed-off-by: Kajol Jain Tested-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200525104308.9814-2-kjain@linux.ibm.com commit 6ae8aedf8fa932541f48a85219d75ca041c22080 Author: Oliver O'Halloran Date: Fri Apr 17 17:35:08 2020 +1000 powerpc/powernv/pci: Sprinkle around some WARN_ON()s pnv_pci_ioda_configure_bus() should now only ever be called when a device is added to the bus so add a WARN_ON() to the empty bus check. Similarly, pnv_pci_ioda_setup_bus_PE() should only ever be called for an unconfigured PE, so add a WARN_ON() for that case too. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200417073508.30356-5-oohall@gmail.com commit 718d249aeadff058f79c2e6b25212dd45bd711ae Author: Oliver O'Halloran Date: Fri Apr 17 17:35:07 2020 +1000 powerpc/powernv/pci: Reserve the root bus PE during init Doing it once during boot rather than doing it on the fly and drop the janky populated logic. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200417073508.30356-4-oohall@gmail.com commit dc3d8f85bb571c3640ebba24b82a527cf2cb3f24 Author: Oliver O'Halloran Date: Fri Apr 17 17:35:06 2020 +1000 powerpc/powernv/pci: Re-work bus PE configuration For normal PHBs IODA PEs are handled on a per-bus basis so all the devices on that bus will share a PE. Which PE specificly is determined by the location of the MMIO BARs for the devices on the bus so we can't actually configure the bus PEs until after MMIO resources are allocated. As a result PEs are currently configured by pcibios_setup_bridge(), which is called just before the bridge windows are programmed into the bus' parent bridge. Configuring the bus PE here causes a few problems: 1. The root bus doesn't have a parent bridge so setting up the PE for the root bus requires some hacks. 2. The PELT-V isn't setup correctly because pnv_ioda_set_peltv() assumes that PEs will be configured in root-to-leaf order. This assumption is broken because resource assignment is performed depth-first so the leaf bridges are setup before their parents are. The hack mentioned in 1) results in the "correct" PELT-V for busses immediately below the root port, but not for devices below a switch. 3. It's possible to break the sysfs PCI rescan feature by removing all the devices on a bus. When the last device is removed from a PE its will be de-configured. Rescanning the devices on a bus does not cause the bridge to be reconfigured rendering the devices on that bus unusable. We can address most of these problems by moving the PE setup out of pcibios_setup_bridge() and into pcibios_bus_add_device(). This fixes 1) and 2) because pcibios_bus_add_device() is called on each device in root-to-leaf order so PEs for parent buses will always be configured before their children. It also fixes 3) by ensuring the PE is configured before initialising DMA for the device. In the event the PE was de-configured due to removing all the devices in that PE it will now be reconfigured when a new device is added since there's no dependecy on the bridge_setup() hook being called. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200417073508.30356-3-oohall@gmail.com commit a8d7d5fc2e1672924a391aa37ef8c02d1ec84a4e Author: Oliver O'Halloran Date: Fri Apr 17 17:35:05 2020 +1000 powerpc/powernv/pci: Add helper to find ioda_pe from BDFN For each PHB we maintain a reverse-map that can be used to find the PE that a BDFN is currently mapped to. Add a helper for doing this lookup so we can check if a PE has been configured without looking at pdn->pe_number. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200417073508.30356-2-oohall@gmail.com commit 9d0879a2dbc3d0c15f8c71490079c1c38f9f3800 Author: Oliver O'Halloran Date: Wed Apr 15 09:35:02 2020 +1000 powerpc/powernv/pci: Add an explaination for PNV_IODA_PE_BUS_ALL It's pretty obsecure and confused me for a long time so I figured it's worth documenting properly. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200414233502.758-1-oohall@gmail.com commit e5500ab657c51bec5af8dcf564a096de48e7a132 Author: Oliver O'Halloran Date: Wed Apr 8 21:22:13 2020 +1000 powerpc/powernv: Add a print indicating when an IODA PE is released Quite useful to know in some cases. Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200408112213.5549-1-oohall@gmail.com commit 03b7bf341c18ff19129cc2825b62bb0e212463f1 Author: Oliver O'Halloran Date: Mon Apr 6 13:07:45 2020 +1000 powerpc/powernv/npu: Move IOMMU group setup into npu-dma.c The NVlink IOMMU group setup is only relevant to NVLink devices so move it into the NPU containment zone. This let us remove some prototypes in pci.h and staticfy some function definitions. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-8-oohall@gmail.com commit 96e2006a9dbc02cb1c103521405d457438a2e260 Author: Oliver O'Halloran Date: Mon Apr 6 13:07:44 2020 +1000 powerpc/powernv/pci: Move tce size parsing to pci-ioda-tce.c Move it in with the rest of the TCE wrangling rather than carting around a static prototype in pci-ioda.c Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-7-oohall@gmail.com commit f39b8b10fcc5d4617d2be5f2910e017a55444b43 Author: Oliver O'Halloran Date: Mon Apr 6 13:07:43 2020 +1000 powerpc/powernv/pci: Delete old iommu recursive iommu setup No longer used. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-6-oohall@gmail.com commit 84d8cc076723058cc294f4360db6ff7758c25b74 Author: Oliver O'Halloran Date: Mon Apr 6 13:07:42 2020 +1000 powerpc/powernv/pci: Add device to iommu group during dma_dev_setup() Historically adding devices to their respective iommu group has been handled by the post-init phb fixup for most devices. This was done because: 1) The IOMMU group is tied to the PE (usually) so we can only setup the iommu groups after we've done resource allocation since BAR location determines the device's PE, and: 2) The sysfs directory for the pci_dev needs to be available since iommu_add_device() wants to add an attribute for the iommu group. However, since commit 30d87ef8b38d ("powerpc/pci: Fix pcibios_setup_device() ordering") both conditions are met when hose->ops->dma_dev_setup() is called so there's no real need to do this in the fixup. Moving the call to iommu_add_device() into pnv_pci_ioda_dma_setup_dev() is a nice cleanup since it puts all the per-device IOMMU setup into one place. It also results in all (non-nvlink) devices getting their iommu group via a common path rather than relying on the bus notifier hack in pnv_tce_iommu_bus_notifier() to handle the adding VFs and hotplugged devices to their group. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-5-oohall@gmail.com commit 9b9408c55935ecc3b1c27b3eeb5a507394113cbb Author: Oliver O'Halloran Date: Mon Apr 6 13:07:41 2020 +1000 powerpc/powernv/pci: Register iommu group at PE DMA setup Move the registration of IOMMU groups out of the post-phb init fixup and into when we configure DMA for a PE. For most devices this doesn't result in any functional changes, but for NVLink attached GPUs it requires a bit of care. When the GPU is probed an IOMMU group would be created for the PE that contains it. We need to ensure that group is removed before we add the PE to the compound group that's used to keep the translations see by the PCIe and NVLink buses the same. No functional changes. Probably. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-4-oohall@gmail.com commit 6cff91b2b97b1b40a52971c9b1e99980dd49fd54 Author: Oliver O'Halloran Date: Mon Apr 6 13:07:40 2020 +1000 powerpc/powernv/iov: Don't add VFs to iommu group during PE config In pnv_ioda_setup_vf_PE() we register an iommu group for the VF PE then call pnv_ioda_setup_bus_iommu_group() to add devices to that group. However, this function is called before the VFs are scanned so there's no devices to add. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-3-oohall@gmail.com commit 6984856865b55c9c1ee0814c30296119cd8ba511 Author: Oliver O'Halloran Date: Mon Apr 6 13:07:39 2020 +1000 powerpc/powernv/npu: Clean up compound table group initialisation Re-work the control flow a bit so what's going on is a little clearer. This also ensures the table_group is only initialised once in the P9 case. This shouldn't be a functional change since all the GPU PCI devices should have the same table_group configuration, but it does look strange. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200406030745.24595-2-oohall@gmail.com commit d4539074b0e9c5fa6508e8c33aaf51abc8ff6e91 Author: Nicholas Piggin Date: Wed Apr 29 16:56:54 2020 +1000 powerpc/64s/kuap: Conditionally restore AMR in kuap_restore_amr asm Similar to the C code change, make the AMR restore conditional on whether the register has changed. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429065654.1677541-7-npiggin@gmail.com commit 579940bb451c2dd33396d2d56ce6ef5d92154b3b Author: Nicholas Piggin Date: Wed Apr 29 16:56:51 2020 +1000 powerpc/64/kuap: Conditionally restore AMR in interrupt exit The AMR update is made conditional on AMR actually changing, which should be the less common case on most workloads (though kernel page faults on uaccess could be frequent, this doesn't significantly slow down that case). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429065654.1677541-4-npiggin@gmail.com commit cb2b53cbffe3c388cd676b63f34e54ceb2643ae2 Author: Nicholas Piggin Date: Wed Apr 29 16:56:50 2020 +1000 powerpc/64s/kuap: Add missing isync to KUAP restore paths Writing the AMR register is documented to require context synchronizing operations before and after, for it to take effect as expected. The KUAP restore at interrupt exit time deliberately avoids the isync after the AMR update because it only needs to take effect after the context synchronizing RFID that soon follows. Add a comment for this. The missing isync before the update doesn't have an obvious justification, and seems it could theoretically allow a rogue user access to leak past the AMR update. Add isyncs for these. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429065654.1677541-3-npiggin@gmail.com commit bcec081ecc940fc38730b29c743bbee661164161 Author: huhai Date: Thu May 21 17:26:48 2020 +1000 powerpc/4xx: Don't unmap NULL mbase Signed-off-by: huhai Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200521072648.1254699-1-mpe@ellerman.id.au commit 3aacaa719b7bf135551cabde2480e8f7bfdf7c7d Author: Christophe Leroy Date: Thu May 21 16:56:04 2020 +0000 powerpc/40x: Don't save CR in SPRN_SPRG_SCRATCH6 We have r12 available, use it to keep CR around and don't save it in SPRN_SPRG_SCRATCH6. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/019f314a98c107c4ca46e46c1cf402e9a44114a7.1590079969.git.christophe.leroy@csgroup.eu commit 797f4016f6da4a90ac83e32b213b68ff7be3812b Author: Christophe Leroy Date: Thu May 21 16:56:03 2020 +0000 powerpc/40x: Avoid using r12 in TLB miss handlers Let's reduce the number of registers used in TLB miss handlers. We have both r9 and r12 available for any temporary use. r9 is enough, avoid using r12. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7f330e971952abb2645fb9ca4310c0f527e84dcb.1590079969.git.christophe.leroy@csgroup.eu commit 455531e9d88048c025ff9099796413df748d92b9 Author: Christophe Leroy Date: Thu May 21 16:56:02 2020 +0000 powerpc: Remove IBM405 Erratum #77 This erratum is dedicated to IBM 405GP and STB03xxx which are now gone. Remove this erratum. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/44dbc08e9034681eb28324cbabc086e97044c36c.1590079969.git.christophe.leroy@csgroup.eu commit 59fb463b48e904dfdfff64c7dd4d67f20ae27170 Author: Christophe Leroy Date: Thu May 21 16:56:01 2020 +0000 powerpc/40x: Remove IBM405 Erratum #51 This erratum was for IBM 403GCX, 405EP and STB03xxx which are now gone. Remove this erratum. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1b6c9916514ef3e084bba57925ad9eb444627566.1590079969.git.christophe.leroy@csgroup.eu commit 7d372d4ccdd55d5ead4d4ecbc336af4dd7d04344 Author: Christophe Leroy Date: Thu May 21 16:56:00 2020 +0000 powerpc/40x: Remove support for IBM 405GP All platforms selecting the obsolete processor are gone now. Remove support for it. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/906c6a6df710f2826e332b8a0cd5d2859a913a1c.1590079969.git.christophe.leroy@csgroup.eu commit 2874ec75708eed59a47a9a986c02add747ae6e9b Author: Christophe Leroy Date: Thu May 21 16:55:59 2020 +0000 powerpc/40x: Remove support for ISS Simulator ISS4xx has support for 405GP which is obsolete. Remote it. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7380974bf5952af825ae2552d0a987c0c1c8b506.1590079969.git.christophe.leroy@csgroup.eu commit 548f5244f1064c9facb19c5e97c21e1e80102ea0 Author: Christophe Leroy Date: Thu May 21 16:55:58 2020 +0000 powerpc/40x: Remove EP405 EP405 is an old type of board based on a 405GP which is obsolete. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e9534caa51f327c841b3db5f48043a47ad70d246.1590079968.git.christophe.leroy@csgroup.eu commit 5786074b96e38691a0cb3d3644ca2aa5d6d8830d Author: Christophe Leroy Date: Thu May 21 16:55:57 2020 +0000 powerpc/40x: Remove WALNUT CONFIG_WALNUT is not selected by any config and is based on 405GP which is obsolete. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ab46013d8d33346af68faf30a719a586c3befad9.1590079968.git.christophe.leroy@csgroup.eu commit 7583b63c343c1076c89b2012fd8758473f046f5f Author: Christophe Leroy Date: Thu May 21 16:55:56 2020 +0000 powerpc/40x: Remove STB03xxx CONFIG_STB03xxx is not user selectable and is not selected by any config. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d7d73f9a8ee3a890566abace568101e9b4836016.1590079968.git.christophe.leroy@csgroup.eu commit 1b5c0967ab8aa9424cdd5108de4e055d8aeaa9d0 Author: Christophe Leroy Date: Thu May 21 16:55:55 2020 +0000 powerpc/40x: Remove support for IBM 403GCX CONFIG_403GCX is not user selectable and is not selected by any platform. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/635f8f5ce9d1f761b3bd8dc3e8ddad500cea26c4.1590079968.git.christophe.leroy@csgroup.eu commit 4e1df545e2fae53e07c93b835c3dcc9d4917c849 Author: Christophe Leroy Date: Thu May 21 16:55:54 2020 +0000 powerpc/pgtable: Drop PTE_ATOMIC_UPDATES 40x was the last user of PTE_ATOMIC_UPDATES. Drop everything related to PTE_ATOMIC_UPDATES. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/dbe8438fd1ed3e500132c8ab70269d4e6cc84531.1590079968.git.christophe.leroy@csgroup.eu commit 2c74e2586bb96012ffc05f1c819b05d9cad86d6e Author: Christophe Leroy Date: Thu May 21 16:55:53 2020 +0000 powerpc/40x: Rework 40x PTE access and TLB miss Commit 1bc54c03117b ("powerpc: rework 4xx PTE access and TLB miss") reworked 44x PTE access to avoid atomic pte updates, and left 8xx, 40x and fsl booke with atomic pte updates. Commit 6cfd8990e27d ("powerpc: rework FSL Book-E PTE access and TLB miss") removed atomic pte updates on fsl booke. It went away on 8xx with commit ddfc20a3b9ae ("powerpc/8xx: Remove PTE_ATOMIC_UPDATES"). 40x is the last platform setting PTE_ATOMIC_UPDATES. Rework PTE access and TLB miss to remove PTE_ATOMIC_UPDATES for 40x: - Always handle DSI as a fault. - Bail out of TLB miss handler when CONFIG_SWAP is set and _PAGE_ACCESSED is not set. - Bail out of ITLB miss handler when _PAGE_EXEC is not set. - Only set WR bit when both _PAGE_RW and _PAGE_DIRTY are set. - Remove _PAGE_HWWRITE - Don't require PTE_ATOMIC_UPDATES anymore Reported-by: kbuild test robot Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/99a0fcd337ef67088140d1647d75fea026a70413.1590079968.git.christophe.leroy@csgroup.eu commit f16dca3e30c14aff545a834a7c1a1bb02b9edb48 Author: Michal Simek Date: Mon Mar 30 15:32:16 2020 +0200 sound: ac97: Remove sound driver for ancient platform Xilinx PowerPC platforms are no longer supported and none is really testing these platforms that's why remove them. If someone has any issue with it these patches can be reverted. Signed-off-by: Michal Simek Acked-by: Takashi Iwai Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/31a3b884dde2c47a30bb2b92355978b97ea70f86.1585575111.git.michal.simek@xilinx.com commit 7ade8495dcfd788a76e6877c9ea86f5207369ea4 Author: Michal Simek Date: Thu May 21 16:55:52 2020 +0000 powerpc: Remove Xilinx PPC405/PPC440 support The latest Xilinx design tools called ISE and EDK has been released in October 2013. New tool doesn't support any PPC405/PPC440 new designs. These platforms are no longer supported and tested. PowerPC 405/440 port is orphan from 2013 by commit cdeb89943bfc ("MAINTAINERS: Fix incorrect status tag") and commit 19624236cce1 ("MAINTAINERS: Update Grant's email address and maintainership") that's why it is time to remove the support fot these platforms. Signed-off-by: Michal Simek Signed-off-by: Christophe Leroy Acked-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8c593895e2cb57d232d85ce4d8c3a1aa7f0869cc.1590079968.git.christophe.leroy@csgroup.eu commit 0bdad33d6bd7b80722e2f9e588d3d7c6d6e34978 Author: Nicholas Piggin Date: Wed Apr 29 16:24:21 2020 +1000 powerpc/64: Refactor interrupt exit irq disabling sequence The same complicated sequence for juggling EE, RI, soft mask, and irq tracing is repeated 3 times, tidy these up into one function. This differs qiute a bit between sub architectures, so this makes the ppc32 port cleaner as well. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429062421.1675400-1-npiggin@gmail.com commit 18594f9b8c45484bd527ebc6b08383b95f58ba73 Author: Nicholas Piggin Date: Mon May 4 22:29:07 2020 +1000 powerpc/64s/radix: Don't prefetch DAR in update_mmu_cache The idea behind this prefetch was to kick off a page table walk before returning from the fault, getting some pipelining advantage. But this never showed up any noticable performance advantage, and in fact with KUAP the prefetches are actually blocked and cause some kind of micro-architectural fault. Removing this improves page fault microbenchmark performance by about 9%. Signed-off-by: Nicholas Piggin [mpe: Keep the early return in update_mmu_cache()] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200504122907.49304-1-npiggin@gmail.com commit e4f4ffa8a98c24a4ab482669b1e2b4cfce3f52f4 Author: Nathan Chancellor Date: Mon May 18 11:10:43 2020 -0700 input: i8042 - Remove special PowerPC handling This causes a build error with CONFIG_WALNUT because kb_cs and kb_data were removed in commit 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc"). ld.lld: error: undefined symbol: kb_cs > referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28) > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a > referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28) > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a > referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28) > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a ld.lld: error: undefined symbol: kb_data > referenced by i8042.c:309 (drivers/input/serio/i8042.c:309) > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a > referenced by i8042-ppcio.h:33 (drivers/input/serio/i8042-ppcio.h:33) > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a > referenced by i8042.c:319 (drivers/input/serio/i8042.c:319) > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a > referenced 15 more times Presumably since nobody has noticed this for the last 12 years, there is not anyone actually trying to use this driver so we can just remove this special walnut code and use the generic header so it builds for all configurations. Fixes: 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc") Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Signed-off-by: Michael Ellerman Acked-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20200518181043.3363953-1-natechancellor@gmail.com commit 0c444d98efad89e2a189d1a5a188e0385edac647 Author: Dmitry Torokhov Date: Wed Oct 2 14:48:54 2019 -0700 macintosh/ams-input: switch to using input device polling mode Now that instances of input_dev support polling mode natively, we no longer need to create input_polled_dev instance. Signed-off-by: Dmitry Torokhov Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20191002214854.GA114387@dtor-ws commit 0755e85570a4615ca674ad6489d44d63916f1f3e Author: Cédric Le Goater Date: Wed Apr 29 09:51:22 2020 +0200 powerpc/xive: Do not expose a debugfs file when XIVE is disabled The XIVE interrupt mode can be disabled with the "xive=off" kernel parameter, in which case there is nothing to present to the user in the associated /sys/kernel/debug/powerpc/xive file. Fixes: 930914b7d528 ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429075122.1216388-4-clg@kaod.org commit 87cf8360735e8107198dc7d29a309fefe9eb5452 Author: Adrian Hunter Date: Tue May 12 15:19:17 2020 +0300 perf evlist: Disable 'immediate' events last Events marked as 'immediate' are started before other events to ensure that there is context at the start of the main tracing events. The same is true at the end of tracing, so disable 'immediate' events after other events. Signed-off-by: Adrian Hunter Cc: Alexander Shishkin Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: x86@kernel.org Link: http://lore.kernel.org/lkml/20200512121922.8997-11-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 61f82e3fb697a8e85f22fdec786528af73dc36d1 Author: Adrian Hunter Date: Tue May 12 15:19:16 2020 +0300 perf kcore_copy: Fix module map when there are no modules loaded In the absence of any modules, no "modules" map is created, but there are other executable pages to map, due to eBPF JIT, kprobe or ftrace. Map them by recognizing that the first "module" symbol is not necessarily from a module, and adjust the map accordingly. Signed-off-by: Adrian Hunter Cc: Alexander Shishkin Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: x86@kernel.org Link: http://lore.kernel.org/lkml/20200512121922.8997-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 0bdf31811be08f93a4bea015d6666df4455c5180 Author: Nick Gasson Date: Mon Apr 27 14:15:16 2020 +0800 perf jvmti: Fix demangling Java symbols For a Java method signature like: Ljava/lang/AbstractStringBuilder;appendChars(Ljava/lang/String;II)V The demangler produces: void class java.lang.AbstractStringBuilder.appendChars(class java.lang., shorttring., int, int) The arguments should be (java.lang.String, int, int) but the demangler interprets the "S" in String as the type code for "short". Correct this and two other minor things: - There is no "bool" type in Java, should be "boolean". - The demangler prepends "class" to every Java class name. This is not standard Java syntax and it wastes a lot of horizontal space if the signature is long. Remove this as there isn't any ambiguity between class names and primitives. Committer notes: This was split from a larger patch that also added a java demangler 'perf test' entry, that, before this patch shows the error being fixed by it: $ perf test java 65: Demangle Java : FAILED! $ perf test -v java Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc 65: Demangle Java : --- start --- test child forked, pid 307264 FAILED: Ljava/lang/StringLatin1;equals([B[B)Z: bool class java.lang.StringLatin1.equals(byte[], byte[]) != boolean java.lang.StringLatin1.equals(byte[], byte[]) FAILED: Ljava/util/zip/ZipUtils;CENSIZ([BI)J: long class java.util.zip.ZipUtils.CENSIZ(byte[], int) != long java.util.zip.ZipUtils.CENSIZ(byte[], int) FAILED: Ljava/util/regex/Pattern$BmpCharProperty;match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z: bool class java.util.regex.Pattern$BmpCharProperty.match(class java.util.regex.Matcher., int, class java.lang., charhar, shortequence) != boolean java.util.regex.Pattern$BmpCharProperty.match(java.util.regex.Matcher, int, java.lang.CharSequence) FAILED: Ljava/lang/AbstractStringBuilder;appendChars(Ljava/lang/String;II)V: void class java.lang.AbstractStringBuilder.appendChars(class java.lang., shorttring., int, int) != void java.lang.AbstractStringBuilder.appendChars(java.lang.String, int, int) FAILED: Ljava/lang/Object;()V: void class java.lang.Object() != void java.lang.Object() test child finished with -1 ---- end ---- Demangle Java: FAILED! $ After applying this patch: $ perf test java 65: Demangle Java : Ok $ Signed-off-by: Nick Gasson Reviewed-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Tested-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200427061520.24905-4-nick.gasson@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 525c821de0a6e45dc31cd5313555df628d80b2a4 Author: Nick Gasson Date: Mon Apr 27 14:15:16 2020 +0800 perf tests: Add test for the java demangler Split from a larger patch that was also fixing a problem with the java demangler, so, before applying that patch we see: $ perf test java 65: Demangle Java : FAILED! $ perf test -v java 65: Demangle Java : --- start --- test child forked, pid 307264 FAILED: Ljava/lang/StringLatin1;equals([B[B)Z: bool class java.lang.StringLatin1.equals(byte[], byte[]) != boolean java.lang.StringLatin1.equals(byte[], byte[]) FAILED: Ljava/util/zip/ZipUtils;CENSIZ([BI)J: long class java.util.zip.ZipUtils.CENSIZ(byte[], int) != long java.util.zip.ZipUtils.CENSIZ(byte[], int) FAILED: Ljava/util/regex/Pattern$BmpCharProperty;match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z: bool class java.util.regex.Pattern$BmpCharProperty.match(class java.util.regex.Matcher., int, class java.lang., charhar, shortequence) != boolean java.util.regex.Pattern$BmpCharProperty.match(java.util.regex.Matcher, int, java.lang.CharSequence) FAILED: Ljava/lang/AbstractStringBuilder;appendChars(Ljava/lang/String;II)V: void class java.lang.AbstractStringBuilder.appendChars(class java.lang., shorttring., int, int) != void java.lang.AbstractStringBuilder.appendChars(java.lang.String, int, int) FAILED: Ljava/lang/Object;()V: void class java.lang.Object() != void java.lang.Object() test child finished with -1 ---- end ---- Demangle Java: FAILED! $ Next patch should fix this. Signed-off-by: Nick Gasson Reviewed-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Tested-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200427061520.24905-4-nick.gasson@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 959f8ed4c1a82acf0b339f1509686ddfe2e48e29 Author: Nick Gasson Date: Mon Apr 27 14:15:15 2020 +0800 perf jvmti: Do not report error when missing debug information If the Java sources are compiled with -g:none to disable debug information the perf JVMTI plugin reports a lot of errors like: java: GetLineNumberTable failed with JVMTI_ERROR_ABSENT_INFORMATION java: GetLineNumberTable failed with JVMTI_ERROR_ABSENT_INFORMATION java: GetLineNumberTable failed with JVMTI_ERROR_ABSENT_INFORMATION java: GetLineNumberTable failed with JVMTI_ERROR_ABSENT_INFORMATION java: GetLineNumberTable failed with JVMTI_ERROR_ABSENT_INFORMATION Instead if GetLineNumberTable returns JVMTI_ERROR_ABSENT_INFORMATION simply skip emitting line number information for that method. Unlike the previous patch these errors don't affect the jitdump generation, they just generate a lot of noise. Similarly for native methods which also don't have line tables. Signed-off-by: Nick Gasson Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200427061520.24905-3-nick.gasson@arm.com [ Moved || operator to the end of the line, not at the start of 2nd if condition ] Signed-off-by: Arnaldo Carvalho de Melo commit 953e92402a523102899d15f0083a508006220859 Author: Nick Gasson Date: Mon Apr 27 14:15:14 2020 +0800 perf jvmti: Fix jitdump for methods without debug info If a Java class is compiled with -g:none to omit debug information, the JVMTI plugin won't write jitdump entries for any method in this class and prints a lot of errors like: java: GetSourceFileName failed with JVMTI_ERROR_ABSENT_INFORMATION The call to GetSourceFileName is used to derive the file name `fn`, but this value is not actually used since commit ca58d7e64bdf ("perf jvmti: Generate correct debug information for inlined code") which moved the file name lookup into fill_source_filenames(). So the call to GetSourceFileName and related code can be safely removed. Signed-off-by: Nick Gasson Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200427061520.24905-2-nick.gasson@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 85afd35575a3c1a3a905722dde5ee70b49282e70 Author: Adrian Hunter Date: Tue May 26 18:52:07 2020 +0300 perf symbols: Fix debuginfo search for Ubuntu Reportedly, from 19.10 Ubuntu has begun mixing up the location of some debug symbol files, putting files expected to be in /usr/lib/debug/usr/lib into /usr/lib/debug/lib instead. Fix by adding another dso_binary_type. Example on Ubuntu 20.04 Before: $ perf record -e intel_pt//u uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.030 MB perf.data ] $ perf script --call-trace | head -5 uname 14003 [005] 15321.764958566: cbr: 42 freq: 4219 MHz (156%) uname 14003 [005] 15321.764958566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc4100 uname 14003 [005] 15321.764961566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc4df0 uname 14003 [005] 15321.764961900: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc4e18 uname 14003 [005] 15321.764963233: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc5128 After: $ perf script --call-trace | head -5 uname 14003 [005] 15321.764958566: cbr: 42 freq: 4219 MHz (156%) uname 14003 [005] 15321.764958566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _start uname 14003 [005] 15321.764961566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start uname 14003 [005] 15321.764961900: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start uname 14003 [005] 15321.764963233: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start Reported-by: Travis Downs Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/20200526155207.9172-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1244a32736f8f6a12e0959aa897813744122d690 Author: Jiri Olsa Date: Mon May 25 00:42:08 2020 +0200 perf parse: Add 'struct parse_events_state' pointer to scanner We need to pass more data to the scanner so let's start with having it to take pointer to 'struct parse_events_state' object instead of just start token. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200524224219.234847-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5f09ca5a1484632d1d3dc533d626d12c4370dbbc Author: Jiri Olsa Date: Mon May 25 00:42:07 2020 +0200 perf stat: Do not pass avg to generic_metric There's no need to pass the given evsel's count to metric data, because it will be pushed again within the following metric_events loop. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200524224219.234847-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d685e6c1b8724e3441dec160b770536537d58ba0 Author: Jiri Olsa Date: Mon May 25 00:42:06 2020 +0200 perf tests: Consider subtests when searching for user specified tests It's now possible to put subtest name as a test filter: $ perf test 'PMU event table sanity' 10: PMU events : 10.1: PMU event table sanity : Ok Committer testing: Before: $ perf test 'PMU event table sanity' $ After: $ perf test 'PMU event table sanity' 10: PMU events : 10.1: PMU event table sanity : Ok $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200524224219.234847-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a90a1c54a6e95d8d55a895a3d76563a19f3e7ae2 Author: Ian Rogers Date: Thu May 21 23:45:46 2020 -0700 perf list: Add metrics to command line usage Before: Usage: perf list [] [hw|sw|cache|tracepoint|pmu|sdt|event_glob] After: Usage: perf list [] [hw|sw|cache|tracepoint|pmu|sdt|metric|metricgroup|event_glob] Committer testing: Before and after we get these outputs on a Lenovo t480s (i7-8650U): # perf list metricgroup List of pre-defined events (to be used in -e): Metric Groups: BrMispredicts BrMispredicts_SMT Branches Cache_Misses DSB FLOPS FLOPS_SMT Fetch_BW IcMiss Instruction_Type Memory_BW Memory_Bound Memory_Lat No_group PGO Pipeline Power Retire SMT Summary TLB TLB_SMT TopDownL1 TopDownL1_SMT TopdownL1 TopdownL1_SMT # # perf list metric | head -11 Metrics: Backend_Bound [This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend] Backend_Bound_SMT [This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. SMT version; use when SMT is enabled and measuring per logical CPU] Bad_Speculation [This category represents fraction of slots wasted due to incorrect speculations] Bad_Speculation_SMT [This category represents fraction of slots wasted due to incorrect speculations. SMT version; use when SMT is enabled and measuring per logical CPU] # Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200522064546.164259-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8c3e05c827ef687215723680862ebd2d431dee49 Author: Andi Kleen Date: Thu May 21 19:09:14 2020 -0700 perf script: Don't force less for non tty output with --xed --xed currently forces less. When piping the output to other scripts this can waste a lot of CPU time because less is rather slow. I've seen it using up a full core on its own in a pipeline. Only force less when the output is actually a terminal. Signed-off-by: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200522020914.527564-1-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo commit e2ce1059b0b3d032aa07cc51c24d28ec498feb5f Author: Ian Rogers Date: Wed May 20 11:20:11 2020 -0700 perf metricgroup: Remove unnecessary ',' from events Remove unnecessary commas from events before they are parsed. This avoids ',' being echoed by parse-events.l. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 05530a7921c0f5149a01e34c4e031c5b18bdc1cc Author: Ian Rogers Date: Wed May 20 11:20:10 2020 -0700 perf metricgroup: Add options to not group or merge Add --metric-no-group that causes all events within metrics to not be grouped. This can allow the event to get more time when multiplexed, but may also lower accuracy. Add --metric-no-merge option. By default events in different metrics may be shared if the group of events for one metric is the same or larger than that of the second. Sharing may increase or lower accuracy and so is now configurable. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2440689d62e93574ca71c87129f7d523ddff7679 Author: Ian Rogers Date: Wed May 20 11:20:09 2020 -0700 perf metricgroup: Remove duped metric group events A metric group contains multiple metrics. These metrics may use the same events. If metrics use separate events then it leads to more multiplexing and overall metric counts fail to sum to 100%. Modify how metrics are associated with events so that if the events in an earlier group satisfy the current metric, the same events are used. A record of used events is kept and at the end of processing unnecessary events are eliminated. Before: $ perf stat -a -M TopDownL1 sleep 1 Performance counter stats for 'system wide': 920,211,343 uops_issued.any # 0.5 Backend_Bound (16.56%) 1,977,733,128 idq_uops_not_delivered.core (16.56%) 51,668,510 int_misc.recovery_cycles (16.56%) 732,305,692 uops_retired.retire_slots (16.56%) 1,497,621,849 cycles (16.56%) 721,098,274 uops_issued.any # 0.1 Bad_Speculation (16.79%) 1,332,681,791 cycles (16.79%) 552,475,482 uops_retired.retire_slots (16.79%) 47,708,340 int_misc.recovery_cycles (16.79%) 1,383,713,292 cycles # 0.4 Frontend_Bound (16.76%) 2,013,757,701 idq_uops_not_delivered.core (16.76%) 1,373,363,790 cycles # 0.1 Retiring (33.54%) 577,302,589 uops_retired.retire_slots (33.54%) 392,766,987 inst_retired.any # 0.3 IPC (50.24%) 1,351,873,350 cpu_clk_unhalted.thread (50.24%) 1,332,510,318 cycles # 5330041272.0 SLOTS (49.90%) 1.006336145 seconds time elapsed After: $ perf stat -a -M TopDownL1 sleep 1 Performance counter stats for 'system wide': 765,949,145 uops_issued.any # 0.1 Bad_Speculation # 0.5 Backend_Bound (50.09%) 1,883,830,591 idq_uops_not_delivered.core # 0.3 Frontend_Bound (50.09%) 48,237,080 int_misc.recovery_cycles (50.09%) 581,798,385 uops_retired.retire_slots # 0.1 Retiring (50.09%) 1,361,628,527 cycles # 5446514108.0 SLOTS (50.09%) 391,415,714 inst_retired.any # 0.3 IPC (49.91%) 1,336,486,781 cpu_clk_unhalted.thread (49.91%) 1.005469298 seconds time elapsed Note: Bad_Speculation + Backend_Bound + Frontend_Bound + Retiring = 100% after, where as before it is 110%. After there are 2 groups, whereas before there are 6. After the cycles event appears once, before it appeared 5 times. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6bf2102bec4e600e72f87569d2c8e01a3efb340e Author: Ian Rogers Date: Wed May 20 11:20:08 2020 -0700 perf metricgroup: Order event groups by size When adding event groups to the group list, insert them in size order. This performs an insertion sort on the group list. By placing the largest groups at the front of the group list it is possible to see if a larger group contains the same events as a later group. This can make the later group redundant - it can reuse the events from the large group. A later patch will add this sharing. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7f9eca51c1e8e5acc4264f960c2cdec150f597f9 Author: Ian Rogers Date: Wed May 20 11:20:07 2020 -0700 perf metricgroup: Delay events string creation Currently event groups are placed into groups_list at the same time as the events string containing the events is built. Separate these two operations and build the groups_list first, then the event string from the groups_list. This adds an ability to reorder the groups_list that will be used in a later patch. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 908103991a9970a8e033e9f3aedd092a2c993f49 Author: Ian Rogers Date: Wed May 20 11:20:06 2020 -0700 perf metricgroup: Use early return in add_metric Use early return in metricgroup__add_metric and try to make the intent of the returns more intention revealing. Suggested-by: Jiri Olsa Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4e21c13aca38b69c4470b68ef29d198802e7d74e Author: Ian Rogers Date: Wed May 20 11:20:05 2020 -0700 perf metricgroup: Always place duration_time last If a metric contains the duration_time event then the event is placed outside of the metric's group of events. Rather than split the group, make it so the duration_time is immediately after the group. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520182011.32236-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a159e2fe89b4d1f9fb54b0ae418b961e239bf617 Author: Ian Rogers Date: Thu May 7 22:36:24 2020 -0700 perf metricgroup: Free metric_events on error Avoid a simple memory leak. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Cc: Vince Weaver Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: kp singh Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200508053629.210324-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit fa99ce828291cbbf8782284665365bc2c48e9318 Author: Li Bin Date: Thu May 21 21:32:18 2020 +0800 perf util: Fix potential SEGFAULT in put_tracepoints_path error path This patch fix potential segment fault triggered in put_tracepoints_path() when the address of the local variable 'path' be freed in error path of record_saved_cmdline. Signed-off-by: Li Bin Cc: Alexander Shishkin Cc: Hongbo Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Xie XiuQi Link: http://lore.kernel.org/lkml/20200521133218.30150-5-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 07e9a6f538cbeecaf5c55b6f2991416f873cdcbd Author: Xie XiuQi Date: Thu May 21 21:32:17 2020 +0800 perf util: Fix memory leak of prefix_if_not_in Need to free "str" before return when asprintf() failed to avoid memory leak. Signed-off-by: Xie XiuQi Cc: Alexander Shishkin Cc: Hongbo Yao Cc: Jiri Olsa Cc: Li Bin Cc: Mark Rutland Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20200521133218.30150-4-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 51a09d8f9aa05a9dc56baaec3f160df2802b0f7b Author: Changbin Du Date: Sun May 10 23:06:11 2020 +0800 perf ftrace: Detect workload failure Currently there's no error message prompted if we failed to start workload. And we still get some trace which is confusing. Let's tell users what happened. Committer testing: Before: # perf ftrace nonsense |& head 5) | switch_mm_irqs_off() { 5) 0.400 us | load_new_mm_cr3(); 5) 3.261 us | } ------------------------------------------ 5) -0 => <...>-3494 ------------------------------------------ 5) | finish_task_switch() { 5) ==========> | 5) | smp_irq_work_interrupt() { # type nonsense -bash: type: nonsense: not found # After: # perf ftrace nonsense |& head workload failed: No such file or directory # type nonsense -bash: type: nonsense: not found # Signed-off-by: Changbin Du Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Link: http://lore.kernel.org/lkml/20200510150628.16610-3-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 452b0d160ad150c1b97982e438a2a69571d320f3 Author: Changbin Du Date: Sun May 10 23:06:10 2020 +0800 perf ftrace: Trace system wide if no target is given This align ftrace to other perf sub-commands that if no target specified then we trace all functions. Signed-off-by: Changbin Du Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Link: http://lore.kernel.org/lkml/20200510150628.16610-2-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit ffe7428e6dc85c66026a76123f02348dac335454 Author: Gustavo A. R. Silva Date: Wed May 20 14:16:13 2020 -0500 perf branch: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle and audited _manually_. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Cc: Alexander Shishkin Cc: Gustavo A. R. Silva Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520191613.GA26869@embeddedor Signed-off-by: Arnaldo Carvalho de Melo commit d778a778a816cc9c910ac50dd665566b841df5f0 Author: Paul A. Clarke Date: Wed May 20 11:23:35 2020 -0500 perf config: Add stat.big-num support Add support for new "stat.big-num" boolean option. This allows a user to set a default for "--no-big-num" for "perf stat" commands. -- $ perf config stat.big-num $ perf stat --event cycles /bin/true Performance counter stats for '/bin/true': 778,849 cycles [...] $ perf config stat.big-num=false $ perf config stat.big-num stat.big-num=false $ perf stat --event cycles /bin/true Performance counter stats for '/bin/true': 769622 cycles [...] -- There is an interaction with "--field-separator" that must be accommodated, such that specifying "--big-num --field-separator={x}" still reports an invalid combination of options. Documentation for perf-config and perf-stat updated. Signed-off-by: Paul Clarke Tested-by: Arnaldo Carvalho de Melo Link: http://lore.kernel.org/lkml/1589991815-17951-1-git-send-email-pc@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 04f9bf2bac72480ca1d289b751b956dd1707a5d5 Author: Wang ShaoBo Date: Wed May 20 11:32:16 2020 +0800 perf bpf-loader: Add missing '*' for key_scan_pos key_scan_pos is a pointer for getting scan position in bpf__obj_config_map() for each BPF map configuration term, but it's misused when error not happened. Committer notes: The point is that the only user of this is: tools/perf/util/parse-events.c err = bpf__config_obj(obj, term, parse_state->evlist, &error_pos); if (err) bpf__strerror_config_obj(obj, term, parse_state->evlist, &error_pos, err, errbuf, sizeof(errbuf)); And then: int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused, struct parse_events_term *term __maybe_unused, struct evlist *evlist __maybe_unused, int *error_pos __maybe_unused, int err, char *buf, size_t size) { bpf__strerror_head(err, buf, size); bpf__strerror_entry(BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE, "Can't use this config term with this map type"); bpf__strerror_end(buf, size); return 0; } So this is infrastructure that Wang Nan put in place for providing better error messages but that he ended up not using, so I'll apply the fix, its correct even not fixing any real problem at this time. Fixes: 066dacbf2a32 ("perf bpf: Add API to set values to map entries in a bpf object") Signed-off-by: Wang ShaoBo Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Cheng Jian Cc: Hanjun Guo Cc: Li Bin Cc: Mark Rutland Cc: Wang Nan Cc: Xie XiuQi Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520033216.48310-1-bobo.shaobowang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit c7e5b328a8d46f754910cd3caaf96e2a9f7e901e Author: Jin Yao Date: Wed May 20 12:27:37 2020 +0800 perf stat: Report summary for interval mode Currently 'perf stat' supports to print counts at regular interval (-I), but it's not very easy for user to get the overall statistics. The patch uses 'evsel->prev_raw_counts' to get counts for summary. Copy the counts to 'evsel->counts' after printing the interval results. Next, we just follow the non-interval processing. Let's see some examples, root@kbl-ppc:~# perf stat -e cycles -I1000 --interval-count 2 # time counts unit events 1.000412064 2,281,114 cycles 2.001383658 2,547,880 cycles Performance counter stats for 'system wide': 4,828,994 cycles 2.002860349 seconds time elapsed root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2 # time counts unit events 1.000389902 1,536,093 cycles 1.000389902 420,226 instructions # 0.27 insn per cycle 2.001433453 2,213,952 cycles 2.001433453 735,465 instructions # 0.33 insn per cycle Performance counter stats for 'system wide': 3,750,045 cycles 1,155,691 instructions # 0.31 insn per cycle 2.003023361 seconds time elapsed root@kbl-ppc:~# perf stat -M CPI,IPC -I1000 --interval-count 2 # time counts unit events 1.000435121 905,303 inst_retired.any # 2.9 CPI 1.000435121 2,663,333 cycles 1.000435121 914,702 inst_retired.any # 0.3 IPC 1.000435121 2,676,559 cpu_clk_unhalted.thread 2.001615941 1,951,092 inst_retired.any # 1.8 CPI 2.001615941 3,551,357 cycles 2.001615941 1,950,837 inst_retired.any # 0.5 IPC 2.001615941 3,551,044 cpu_clk_unhalted.thread Performance counter stats for 'system wide': 2,856,395 inst_retired.any # 2.2 CPI 6,214,690 cycles 2,865,539 inst_retired.any # 0.5 IPC 6,227,603 cpu_clk_unhalted.thread 2.003403078 seconds time elapsed Committer testing: Before: # perf stat -e cycles -I1000 --interval-count 2 # time counts unit events 1.000618627 26,877,408 cycles 2.001417968 233,672,829 cycles # After: # perf stat -e cycles -I1000 --interval-count 2 # time counts unit events 1.001531815 5,341,388,792 cycles 2.002936530 100,073,912 cycles Performance counter stats for 'system wide': 5,441,462,704 cycles 2.004893794 seconds time elapsed # Signed-off-by: Jin Yao Reviewed-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520042737.24160-6-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 905365f493e3469dc0dfea459a3beb34129357e8 Author: Jin Yao Date: Wed May 20 12:27:36 2020 +0800 perf stat: Save aggr value to first member of prev_raw_counts To collect the overall statistics for interval mode, we copy the counts from evsel->prev_raw_counts to evsel->counts. For AGGR_GLOBAL mode, because the perf_stat_process_counter creates aggr values from per cpu values, but the per cpu values are 0, so the calculated aggr values will be always 0. This patch uses a trick that saves the previous aggr value to the first member of perf_counts, then aggr calculation in process_counter_values can work correctly for AGGR_GLOBAL. v6: --- Add comments in perf_evlist__save_aggr_prev_raw_counts. Signed-off-by: Jin Yao Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520042737.24160-5-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 297767ac0ce598dece202e5c9e3f22e034cb4821 Author: Jin Yao Date: Wed May 20 12:27:35 2020 +0800 perf stat: Copy counts from prev_raw_counts to evsel->counts It would be useful to support the overall statistics for perf-stat interval mode. For example, report the summary at the end of "perf-stat -I" output. But since perf-stat can support many aggregation modes, such as --per-thread, --per-socket, -M and etc, we need a solution which doesn't bring much complexity. The idea is to use 'evsel->prev_raw_counts' which is updated in each interval and it's saved with the latest counts. Before reporting the summary, we copy the counts from evsel->prev_raw_counts to evsel->counts, and next we just follow non-interval processing. v5: --- Don't save the previous aggr value to the member of [cpu0,thread0] in perf_counts. Originally that was a trick because the perf_stat_process_counter would create aggr values from per cpu values. But we don't need to do that all the time. We will handle it in next patch. Signed-off-by: Jin Yao Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520042737.24160-4-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit cf4d9bd67cb1531a775599d04b9258c5e16b3fc6 Author: Jin Yao Date: Wed May 20 12:27:34 2020 +0800 perf counts: Reset prev_raw_counts counts When we want to reset the evsel->prev_raw_counts, zeroing the aggr is not enough, we need to reset the perf_counts too. The perf_counts__reset zeros the perf_counts, and it should zero the aggr too. This patch changes perf_counts__reset to non-static, and calls it in evsel__reset_prev_raw_counts to reset the prev_raw_counts. Signed-off-by: Jin Yao Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520042737.24160-3-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 72f02a947e89223b1b4a7825b68b2ba8fd2852c8 Author: Jin Yao Date: Wed May 20 12:27:33 2020 +0800 perf stat: Fix wrong per-thread runtime stat for interval mode root@kbl-ppc:~# perf stat --per-thread -e cycles,instructions -I1000 --interval-count 2 1.004171683 perf-3696 8,747,311 cycles ... 1.004171683 perf-3696 691,730 instructions # 0.08 insn per cycle ... 2.006490373 perf-3696 1,749,936 cycles ... 2.006490373 perf-3696 1,484,582 instructions # 0.28 insn per cycle ... Let's see interval 2.006490373 perf-3696 1,749,936 cycles perf-3696 1,484,582 instructions # 0.28 insn per cycle insn per cycle = 1,484,582 / 1,749,936 = 0.85. But now it's 0.28, that's not correct. stat_config.stats[] records the per-thread runtime stat. But for interval mode, it should be reset for each interval. So now, with this patch, root@kbl-ppc:~# perf stat --per-thread -e cycles,instructions -I1000 --interval-count 2 1.005818121 perf-8633 9,898,045 cycles ... 1.005818121 perf-8633 693,298 instructions # 0.07 insn per cycle ... 2.007863743 perf-8633 1,551,619 cycles ... 2.007863743 perf-8633 1,317,514 instructions # 0.85 insn per cycle ... Let's check interval 2.007863743. insn per cycle = 1,317,514 / 1,551,619 = 0.85. It's correct. This patch creates runtime_stat_reset, places it next to untime_stat_new/runtime_stat_delete and moves all runtime_stat functions before process_interval. Committer testing: After the patch: # perf stat --per-thread -e cycles,instructions -I1000 --interval-count 2 |& grep sssd_nss-1130 2.011309774 sssd_nss-1130 56,585 cycles 2.011309774 sssd_nss-1130 13,121 instructions # 0.23 insn per cycle # python >>> 13121.0 / 56585 0.23188124061146947 >>> Fixes: commit 14e72a21c783 ("perf stat: Update or print per-thread stats") Signed-off-by: Jin Yao Reviewed-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520042737.24160-2-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a45badc7392b4613708748f6a2cc0c6f63a1c8d6 Author: Ian Rogers Date: Tue May 19 23:36:52 2020 -0700 perf expr: Allow numbers to be followed by a dot Metrics like UNC_M_POWER_SELF_REFRESH encode 100 as "100." and consequently the 100 is treated as a symbol. Alter the regular expression to allow the dot to be before or after the number. Note, this passed the pmu-events test as that tests the validity of a number using strtod rather than lex code. strtod allows the dot after. Add a test for this behavior. Fixes: 26226a97724d (perf expr: Move expr lexer to flex) Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Signed-off-by: Arnaldo Carvalho de Melo commit 45db55f2ef5e98ef096096efad975dc684a9493f Author: Ian Rogers Date: Wed May 20 00:28:08 2020 -0700 perf metricgroup: Make 'evlist_used' variable a bitmap instead of array of bools Use a bitmap rather than an array of bools. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Song Liu Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Vince Weaver Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520072814.128267-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ae7626418d71ae551fd1f0a85ae7ad9d8b2d4f28 Author: Jiri Olsa Date: Wed May 20 09:40:50 2020 +0200 perf stat: Fail on extra comma while parsing events Ian reported that we allow to parse following: $ perf stat -e ,cycles true which is wrong and we should fail, like we do with this fix: $ perf stat -e ,cycles true event syntax error: ',cycles' \___ parser error The reason is that we don't have rule for ',' in 'event' start condition and it's matched and accepted by default rule. Add scanner debug support (that Ian already added for expr code), which was really useful for finding this. It's enabled together with bison debug via 'make PARSER_DEBUG=1'. Reported-by: Ian Rogers Signed-off-by: Jiri Olsa Acked-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200520074050.156988-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 498ef715a00bb87ca65a89e7893c644499bb309c Author: Paul A. Clarke Date: Tue May 19 12:58:22 2020 -0500 perf script: Better align register values in dump Before: $ perf script --dump-raw-trace [...] 2492031077254920 0x1e08 [0x308]: PERF_RECORD_SAMPLE(IP, 0x1): 47557/47557: 0xc00000000012eeb0 period: 1 addr: 0 ... user regs: mask 0x1fffffffffff ABI 64-bit .... r0 0xb .... r1 0x7ffff3b90fa0 .... r2 0x7fffbabf7300 .... r3 0x7ffff3b9ed60 .... r4 0x7ffff3b95cc0 .... r5 0x1000c5a2940 .... r6 0xfefefefefefefeff .... r7 0x7f7f7f7f7f7f7f7f .... r8 0x7ffff3b9ed60 .... r9 0x0 [...] After: [...] 2492031077254920 0x1e08 [0x308]: PERF_RECORD_SAMPLE(IP, 0x1): 47557/47557: 0xc00000000012eeb0 period: 1 addr: 0 ... user regs: mask 0x1fffffffffff ABI 64-bit .... r0 0x000000000000000b .... r1 0x00007ffff3b90fa0 .... r2 0x00007fffbabf7300 .... r3 0x00007ffff3b9ed60 .... r4 0x00007ffff3b95cc0 .... r5 0x000001000c5a2940 .... r6 0xfefefefefefefeff .... r7 0x7f7f7f7f7f7f7f7f .... r8 0x00007ffff3b9ed60 .... r9 0x0000000000000000 [...] Committer testing: Full set of instructions, testing on x86_64: # perf record -I ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 2.855 MB perf.data (4902 samples) ] # perf evlist -v cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ID|CPU|PERIOD|REGS_INTR, read_format: ID, disabled: 1, inherit: 1, freq: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, sample_regs_intr: 0xff0fff dummy:HG: type: 1, size: 120, config: 0x9, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ID|CPU|PERIOD|REGS_INTR, read_format: ID, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, sample_regs_intr: 0xff0fff # Before: # perf script --dump-raw-trace [...] 0 1542674658099675 0x1cb700 [0xe0]: PERF_RECORD_SAMPLE(IP, 0x4001): 1825/1825: 0xffffffff9506e544 period: 1 addr: 0 ... intr regs: mask 0xff0fff ABI 64-bit .... AX 0xf .... BX 0xffff96e1064125a0 .... CX 0x38f .... DX 0x7 .... SI 0xf .... DI 0x38f .... BP 0x1 .... SP 0xfffffe000000bdf0 .... IP 0xffffffff9506e544 .... FLAGS 0xa .... CS 0x10 .... SS 0x18 .... R8 0x0 .... R9 0x0 .... R10 0xfffffe00000260c8 .... R11 0xfffffe000000bef8 .... R12 0x1 .... R13 0x64 .... R14 0x390 .... R15 0xffff96e1064125a0 ... thread: perf:1825 ...... dso: /proc/kcore perf 1825 [000] 1542674.658099: 1 cycles: ffffffff9506e544 native_write_msr+0x4 (vmlinux [...] After: # perf script --dump-raw-trace [...] 0 1542674658096068 0x1cb620 [0xe0]: PERF_RECORD_SAMPLE(IP, 0x4001): 1825/1825: 0xffffffff9506e544 period: 1 addr: 0 ... intr regs: mask 0xff0fff ABI 64-bit .... AX 0x000000000000000f .... BX 0xffff96e1064125a0 .... CX 0x000000000000038f .... DX 0x0000000000000007 .... SI 0x000000000000000f .... DI 0x000000000000038f .... BP 0x0000000000000000 .... SP 0xffffb3e788fb7c20 .... IP 0xffffffff9506e544 .... FLAGS 0x000000000000000a .... CS 0x0000000000000010 .... SS 0x0000000000000018 .... R8 0x00057b0deeffdfe3 .... R9 0xffff96e106432480 .... R10 0x0000000000000000 .... R11 0xffff96e106412cc0 .... R12 0xffffb3e788fb7d00 .... R13 0xffff96e106432408 .... R14 0xffff96e106432400 .... R15 0xffff96e0e09a4800 ... thread: perf:1825 ...... dso: /proc/kcore perf 1825 [000] 1542674.658096: 1 cycles: ffffffff9506e544 native_write_msr+0x4 (vmlinux) [...] Signed-off-by: Paul Clarke Reviewed-by: Andi Kleen Tested-by: Arnaldo Carvalho de Melo Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim LPU-Reference: 1589911102-9460-1-git-send-email-pc@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit acd1ac23156e0c7f08e99be47b2828b0ad71f020 Author: Paul A. Clarke Date: Tue May 19 14:18:06 2020 -0500 perf stat: POWER9 metrics: expand "ICT" acronym Uses of "ICT" and "Ict" are expanded to "Instruction Completion Table". Signed-off-by: Paul Clarke Cc: Ananth N Mavinakayanahalli Cc: Ian Rogers Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Naveen N. Rao Cc: Sukadev Bhattiprolu Link: http://lore.kernel.org/lkml/1589915886-22992-1-git-send-email-pc@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6549a8c0c3d94500a9a1bb66fc237f7c01c41753 Author: Gustavo A. R. Silva Date: Fri May 15 12:29:26 2020 -0500 perf tools: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Gustavo A. R. Silva Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200515172926.GA31976@embeddedor Signed-off-by: Arnaldo Carvalho de Melo commit 961224db0470c9be08ef64b14913452a5e865d00 Author: Adrian Hunter Date: Sat May 16 15:35:48 2020 +0300 perf intel-pt: Use allocated branch stack for PEBS sample To avoid having struct branch_stack as a non-last structure member, use allocated branch stack for PEBS sample. Signed-off-by: Adrian Hunter Acked-by: Gustavo A. R. Silva Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/2540ed9a-89f1-6d59-10c9-a66cc90db5d2@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit bd7c1c6671b2ef5dd9e23744ba13645961956878 Author: Alexey Budankov Date: Thu Apr 30 10:16:34 2020 +0300 perf docs: Introduce security.txt file to document related issues Publish instructions on how to apply LSM hooks for access control to perf_event_open() syscall on Fedora distro with Targeted SELinux policy and then manage access to the syscall. Signed-off-by: Alexey Budankov Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/290ded0a-c422-3749-5180-918fed1ee30f@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c1034eb069201f3f3c40f34f3d937ecb8049d0cf Author: Alexey Budankov Date: Thu Apr 30 10:15:57 2020 +0300 perf tool: Make perf tool aware of SELinux access control Implement selinux sysfs check to see the system is in enforcing mode and print warning message with pointer to check audit logs. Signed-off-by: Alexey Budankov Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/819338ce-d160-4a2f-f1aa-d756a2e7c6fc@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a885f3cc6f83a00cadcc80749440a5e2fcf17073 Author: Alexey Budankov Date: Thu Apr 30 10:15:21 2020 +0300 perf docs: Extend CAP_SYS_ADMIN with CAP_PERFMON where needed Extend CAP_SYS_ADMIN with CAP_PERFMON in the docs. Signed-off-by: Alexey Budankov Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/3b19cf79-f02d-04b4-b8b1-0039ac023b2c@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ded80bda8bc9bb65a344b79b36d5acf45a907b25 Author: Ian Rogers Date: Fri May 15 15:17:32 2020 -0700 perf expr: Migrate expr ids table to a hashmap Use a hashmap between a char* string and a double* value. While bpf's hashmap entries are size_t in size, we can't guarantee sizeof(size_t) >= sizeof(double). Avoid a memory allocation when gathering ids by making 0.0 a special value encoded as NULL. Original map suggestion by Andi Kleen: https://lore.kernel.org/lkml/20200224210308.GQ160988@tassilo.jf.intel.com/ and seconded by Jiri Olsa: https://lore.kernel.org/lkml/20200423112915.GH1136647@krava/ Committer notes: There are fixes that need to land upstream before we can use libbpf's headers, for now use our copy unconditionally, since the data structures at this point are exactly the same, no problem. When the fixes for libbpf's hashmap land upstream, we can fix this up. Testing it: Building with LIBBPF=1, i.e. the default: $ perf -vv | grep -i bpf bpf: [ on ] # HAVE_LIBBPF_SUPPORT $ nm ~/bin/perf | grep -i libbpf_ | wc -l 39 $ nm ~/bin/perf | grep -i hashmap_ | wc -l 17 $ Explicitely building without LIBBPF: $ perf -vv | grep -i bpf bpf: [ OFF ] # HAVE_LIBBPF_SUPPORT $ $ nm ~/bin/perf | grep -i libbpf_ | wc -l 0 $ nm ~/bin/perf | grep -i hashmap_ | wc -l 9 $ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Cong Wang Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: kp singh Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200515221732.44078-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit eee19501926d98c894f15c1644b815c7d1fbd187 Author: Ian Rogers Date: Fri May 15 15:17:29 2020 -0700 perf tools: Grab a copy of libbpf's hashmap Allow use of hashmap in perf. Modify perf's check-headers.sh script to check that the files are kept in sync, in the same way kernel headers are checked. This will warn if they are out of sync at the start of a perf build. Committer note: This starts out of synch as a fix went thru the bpf tree, namely the one removing the needless libbpf_internal.h include in hashmap.h. There is also another change related to __WORDSIZE, that as is in tools/lib/bpf/hashmap.h causes the tools/perf/ build to fail in systems such as Alpine Linus, that uses the Musl libc, so we need an alternative way of having __WORDSIZE available, use the one used by tools/include/linux/bitops.h, that builds in all the systems I have build containers for. These differences will be resolved at some point, so keep the warning in check-headers.sh as a reminder. Signed-off-by: Ian Rogers Acked-by: Andrii Nakryiko Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Cong Wang Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: kp singh Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200515221732.44078-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ea9eb1f456a08c18feb485894185f7a4e31cc8a4 Author: Jiri Olsa Date: Mon May 18 15:14:45 2020 +0200 perf stat: Fix duration_time value for higher intervals Joakim reported wrong duration_time value for interval bigger than 4000 [1]. The problem is in the interval value we pass to update_stats function, which is typed as 'unsigned int' and overflows when we get over 2^32 (happens between intervals 4000 and 5000). Retyping the passed value to unsigned long long. [1] https://www.spinics.net/lists/linux-perf-users/msg11777.html Fixes: b90f1333ef08 ("perf stat: Update walltime_nsecs_stats in interval mode") Reported-by: Joakim Zhang Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200518131445.3745083-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit beb6420300046a959082b32851fedaab2973be23 Author: Jiri Olsa Date: Mon May 18 16:10:27 2020 +0200 perf trace: Fix compilation error for make NO_LIBBPF=1 DEBUG=1 The perf compilation fails for NO_LIBBPF=1 DEBUG=1 with: $ make NO_LIBBPF=1 DEBUG=1 BUILD: Doing 'make -j8' parallel build CC builtin-trace.o LD perf-in.o LINK perf /usr/bin/ld: perf-in.o: in function `trace__find_bpf_map_by_name': /home/jolsa/kernel/linux-perf/tools/perf/builtin-trace.c:4608: undefined reference to `bpf_object__find_map_by_name' collect2: error: ld returned 1 exit status make[2]: *** [Makefile.perf:631: perf] Error 1 make[1]: *** [Makefile.perf:225: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 Move trace__find_bpf_map_by_name calls under HAVE_LIBBPF_SUPPORT ifdef and add make test for this. Committer notes: Add missing: run += make_no_libbpf_DEBUG Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200518141027.3765877-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6d1f916265aa615218d341ba5d3fd39dfe931cde Author: Ian Rogers Date: Thu Mar 5 23:11:10 2020 -0800 perf beauty: Allow the CC used in the arch errno names script to acccept CFLAGS Allow the CC compiler to accept a CFLAGS environment variable. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexios Zavras Cc: Andi Kleen Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Wei Li Link: http://lore.kernel.org/lkml/20200306071110.130202-4-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 7597ce89b3ed239f7a3408b930d2a6c7a4c938a1 Author: Ian Rogers Date: Thu Mar 5 23:11:10 2020 -0800 perf trace: Fix the selection for architectures to generate the errno name tables Make the architecture test directory agree with the code comment. Committer notes: This was split from a larger patch. The code was assuming the developer always worked from tools/perf/, so make sure we do the test -d having $toolsdir/perf/arch/$arch, to match the intent expressed in the comment, just above that loop. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexios Zavras Cc: Andi Kleen Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Wei Li Link: http://lore.kernel.org/lkml/20200306071110.130202-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 06392aaad592cadf4335617a2bb8e45722e3df33 Author: Ian Rogers Date: Wed May 13 14:29:33 2020 -0700 perf test: Improve pmu event metric testing Break pmu-events test into 2 and add a test to verify that all pmu metric expressions simply parse. Try to parse all metric ids/events, skip/warn if metrics for the current architecture fail to parse. To support warning for a skip, and an ability for a subtest to describe why it skips. Tested on power9, skylakex, haswell, broadwell, westmere, sandybridge and ivybridge. May skip/warn on other architectures if metrics are invalid. In particular s390 is untested, but its expressions are trivial. The untested architectures with expressions are power8, cascadelakex, tremontx, skylake, jaketown, ivytown and variants of haswell and broadwell. v3. addresses review comments from John Garry , Jiri Olsa and Arnaldo Carvalho de Melo . v2. changes the commit message as event parsing errors no longer cause the test to fail. Committer notes: Check the return value of strtod() to fix the build in systems where that function is declared with attribute warn_unused_result. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200513212933.41273-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 3b536651eeb7667808de7651f0858c932a3c4138 Author: Ian Rogers Date: Wed May 13 14:29:33 2020 -0700 perf test: Provide a subtest callback to ask for the reason for skipping a subtest Now subtests can inform why a test was skipped. The upcoming patch improvint PMU event metric testing will use it. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200513212933.41273-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 4ac22b484d4c79e876fc262941deb2edb1d7516f Author: Ian Rogers Date: Wed May 13 15:06:35 2020 -0700 perf parse-events: Make add PMU verbose output clearer On a CPU like skylakex an uncore_iio_0 PMU may alias with uncore_iio_free_running_0. The latter PMU doesn't support fc_mask as a parameter and so pmu_config_term fails. Typically parse_events_add_pmu is called in a loop where if one alias succeeds errors are ignored, however, if multiple errors occur parse_events__handle_error will currently give a WARN_ONCE. This change removes the WARN_ONCE in parse_events__handle_error and makes it a pr_debug. It adds verbose messages to parse_events_add_pmu warning that non-fatal errors may occur, while giving details on the pmu and config terms for useful context. pmu_config_term is altered so the failing term and pmu are present in the case of the 'unknown term' error which makes spotting the free_running case more straightforward. Before: $ perf --debug verbose=3 stat -M llc_misses.pcie_read sleep 1 Using CPUID GenuineIntel-6-55-4 metric expr unc_iio_data_req_of_cpu.mem_read.part0 + unc_iio_data_req_of_cpu.mem_read.part1 + unc_iio_data_req_of_cpu.mem_read.part2 + unc_iio_data_req_of_cpu.mem_read.part3 for LLC_MISSES.PCIE_READ found event unc_iio_data_req_of_cpu.mem_read.part0 found event unc_iio_data_req_of_cpu.mem_read.part1 found event unc_iio_data_req_of_cpu.mem_read.part2 found event unc_iio_data_req_of_cpu.mem_read.part3 metric expr unc_iio_data_req_of_cpu.mem_read.part0 + unc_iio_data_req_of_cpu.mem_read.part1 + unc_iio_data_req_of_cpu.mem_read.part2 + unc_iio_data_req_of_cpu.mem_read.part3 for LLC_MISSES.PCIE_READ found event unc_iio_data_req_of_cpu.mem_read.part0 found event unc_iio_data_req_of_cpu.mem_read.part1 found event unc_iio_data_req_of_cpu.mem_read.part2 found event unc_iio_data_req_of_cpu.mem_read.part3 adding {unc_iio_data_req_of_cpu.mem_read.part0,unc_iio_data_req_of_cpu.mem_read.part1,unc_iio_data_req_of_cpu.mem_read.part2,unc_iio_data_req_of_cpu.mem_read.part3}:W,{unc_iio_data_req_of_cpu.mem_read.part0,unc_iio_data_req_of_cpu.mem_read.part1,unc_iio_data_req_of_cpu.mem_read.part2,unc_iio_data_req_of_cpu.mem_read.part3}:W intel_pt default config: tsc,mtc,mtc_period=3,psb_period=3,pt,branch WARNING: multiple event parsing errors ... Invalid event/parameter 'fc_mask' ... After: $ perf --debug verbose=3 stat -M llc_misses.pcie_read sleep 1 Using CPUID GenuineIntel-6-55-4 metric expr unc_iio_data_req_of_cpu.mem_read.part0 + unc_iio_data_req_of_cpu.mem_read.part1 + unc_iio_data_req_of_cpu.mem_read.part2 + unc_iio_data_req_of_cpu.mem_read.part3 for LLC_MISSES.PCIE_READ found event unc_iio_data_req_of_cpu.mem_read.part0 found event unc_iio_data_req_of_cpu.mem_read.part1 found event unc_iio_data_req_of_cpu.mem_read.part2 found event unc_iio_data_req_of_cpu.mem_read.part3 metric expr unc_iio_data_req_of_cpu.mem_read.part0 + unc_iio_data_req_of_cpu.mem_read.part1 + unc_iio_data_req_of_cpu.mem_read.part2 + unc_iio_data_req_of_cpu.mem_read.part3 for LLC_MISSES.PCIE_READ found event unc_iio_data_req_of_cpu.mem_read.part0 found event unc_iio_data_req_of_cpu.mem_read.part1 found event unc_iio_data_req_of_cpu.mem_read.part2 found event unc_iio_data_req_of_cpu.mem_read.part3 adding {unc_iio_data_req_of_cpu.mem_read.part0,unc_iio_data_req_of_cpu.mem_read.part1,unc_iio_data_req_of_cpu.mem_read.part2,unc_iio_data_req_of_cpu.mem_read.part3}:W,{unc_iio_data_req_of_cpu.mem_read.part0,unc_iio_data_req_of_cpu.mem_read.part1,unc_iio_data_req_of_cpu.mem_read.part2,unc_iio_data_req_of_cpu.mem_read.part3}:W intel_pt default config: tsc,mtc,mtc_period=3,psb_period=3,pt,branch Attempting to add event pmu 'uncore_iio_free_running_5' with 'unc_iio_data_req_of_cpu.mem_read.part0,' that may result in non-fatal errors After aliases, add event pmu 'uncore_iio_free_running_5' with 'fc_mask,ch_mask,umask,event,' that may result in non-fatal errors Attempting to add event pmu 'uncore_iio_free_running_3' with 'unc_iio_data_req_of_cpu.mem_read.part0,' that may result in non-fatal errors After aliases, add event pmu 'uncore_iio_free_running_3' with 'fc_mask,ch_mask,umask,event,' that may result in non-fatal errors Attempting to add event pmu 'uncore_iio_free_running_1' with 'unc_iio_data_req_of_cpu.mem_read.part0,' that may result in non-fatal errors After aliases, add event pmu 'uncore_iio_free_running_1' with 'fc_mask,ch_mask,umask,event,' that may result in non-fatal errors Multiple errors dropping message: unknown term 'fc_mask' for pmu 'uncore_iio_free_running_3' (valid terms: event,umask,config,config1,config2,name,period,percore) ... So before you see a 'WARNING: multiple event parsing errors' and 'Invalid event/parameter'. After you see 'Attempting... that may result in non-fatal errors' then 'Multiple errors...' with details that 'fc_mask' wasn't known to a free running counter. While not completely clean, this makes it clearer that an error hasn't really occurred. v2. addresses review feedback from Jiri Olsa . Signed-off-by: Ian Rogers Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Jin Yao Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200513220635.54700-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6365757894d5e7ada8a1d074a21fdaf2973dd5ae Author: Ian Rogers Date: Tue May 12 17:03:18 2020 -0700 perf expr: Fix memory leaks in metric bison Add a destructor for strings to reclaim memory in the event of errors. Free the ID given for a lookup, it was previously strdup-ed in the lex code. Signed-off-by: Ian Rogers Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200513000318.15166-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 39548e50e689edb76761a89e25ced7854795133d Author: Ravi Bangoria Date: Sat May 9 16:51:13 2020 +0530 perf powerpc: Don't ignore sym-handling.c file Commit 7eec00a74720 ("perf symbols: Consolidate symbol fixup issue") removed powerpc specific sym-handling.c file from Build. This wasn't caught by build CI because all functions in this file are declared as __weak in common code. Fix it. Fixes: 7eec00a74720 ("perf symbols: Consolidate symbol fixup issue") Reported-by: Sandipan Das Signed-off-by: Ravi Bangoria Reviewed-by: Leo Yan Reviewed-by: Naveen N. Rao Acked-by: Sandipan Das Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200509112113.174745-1-ravi.bangoria@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 63f11355a6ee7febc7b3fdad8a7009c0e16748df Author: Ian Rogers Date: Tue May 12 23:27:51 2020 -0700 perf expr: Test parsing of floating point numbers Add test for fix in: commit 5741da3dee4c ("perf expr: Parse numbers as doubles") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200513062752.3681-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit da231338ec9c098707c8a1e4d8a50e2400e2fe17 Author: Anand K Mistry Date: Wed May 13 12:20:23 2020 +1000 perf record: Use an eventfd to wakeup when done The setting and checking of 'done' contains a rare race where the signal handler setting 'done' is run after checking to break the loop, but before waiting in evlist__poll(). In this case, the main loop won't wake up until either another signal is sent, or the perf data fd causes a wake up. The following simple script can trigger this condition (but you might need to run it for several hours): for ((i = 0; i >= 0; i++)) ; do echo "Loop $i" delay=$(echo "scale=4; 0.1 * $RANDOM/32768" | bc) ./perf record -- sleep 30000000 >/dev/null& pid=$! sleep $delay kill -TERM $pid echo "PID $pid" wait $pid done At some point, the loop will stall. Adding logging, even though perf has received the SIGTERM and set 'done = 1', perf will remain sleeping until a second signal is sent. Committer notes: Make this dependent on HAVE_EVENTFD_SUPPORT, so that we continue building on older systems without the eventfd syscall. Signed-off-by: Anand K Mistry Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200513122012.v3.1.I4d7421c6bbb1f83ea58419082481082e19097841@changeid Signed-off-by: Arnaldo Carvalho de Melo commit ba35fe9358dfb961c74f3677a468148add9b23cb Author: Arnaldo Carvalho de Melo Date: Wed May 20 12:21:07 2020 -0300 tools feature: Rename HAVE_EVENTFD to HAVE_EVENTFD_SUPPORT To be consistent with other such auto-detected features. Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Anand K Mistry Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Signed-off-by: Arnaldo Carvalho de Melo commit f0aef4759be5efe525660055925b726efcd7cf27 Author: Arnaldo Carvalho de Melo Date: Wed May 13 11:00:04 2020 -0300 perf evsel: Initialize evsel->per_pkg_mask to NULL in evsel__init() Just like with the other fields, this probably isn't fixing anything observable as evsel__new() uses zalloc() for the whole 'struct evsel', but since evsels can be embedded in larger structures and maybe those larger structures don't use zalloc() for some reason, init it to NULL just in case. Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Signed-off-by: Arnaldo Carvalho de Melo commit 3efc899d9afb3d03604f191a0be9669eabbfc4aa Author: Ian Rogers Date: Tue May 12 16:59:18 2020 -0700 perf evsel: Fix 2 memory leaks If allocated, perf_pkg_mask and metric_events need freeing. Signed-off-by: Ian Rogers Reviewed-by: Andi Kleen Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200512235918.10732-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7fcdccd4237724931d9773d1e3039bfe053a6f52 Author: Arnaldo Carvalho de Melo Date: Wed May 13 10:20:26 2020 -0300 perf parse-events: Fix incorrect conversion of 'if () free()' to 'zfree()' When applying a patch by Ian I incorrectly converted to zfree() an expression that involved testing some other struct member, not the one being freed, which lead to bugs reproduceable by: $ perf stat -e i/bs,tsc,L2/o sleep 1 WARNING: multiple event parsing errors Segmentation fault (core dumped) $ Fix it by restoring the test for pos->free_str before freeing pos->val.str, but continue using zfree(&pos->val.str) to set that member to NULL after freeing it. Reported-by: Ian Rogers Fixes: e8dfb81838b1 ("perf parse-events: Fix memory leaks found on parse_events") Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: clang-built-linux@googlegroups.com Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Signed-off-by: Arnaldo Carvalho de Melo commit e12a89ef73b227e9f56c41502aefcee59fd2a05b Author: Jiri Olsa Date: Tue May 12 14:23:10 2020 +0200 perf tools: Fix is_bpf_image function logic Adrian reported that is_bpf_image is not working the way it was intended - passing on trampolines and dispatcher names. Instead it returned true for all the bpf names. The reason even this logic worked properly is that all bpf objects, even trampolines and dispatcher, were assigned DSO_BINARY_TYPE__BPF_IMAGE binary_type. The later for bpf_prog objects, the binary_type was fixed in bpf load event processing, which is executed after the ksymbol code. Fixing the is_bpf_image logic, so it properly recognizes trampoline and dispatcher objects. Fixes: 3c29d4483e85 ("perf annotate: Add basic support for bpf_image") Reported-by: Adrian Hunter Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200512122310.3154754-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b027cc6fdf1bb41f4572e99e96ff95bbf8cb5783 Author: Ian Rogers Date: Thu May 7 15:06:04 2020 -0700 perf c2c: Fix 'perf c2c record -e list' to show the default events used When the event is passed as list, the default events should be listed as per 'perf mem record -e list'. Previous behavior is: $ perf c2c record -e list failed: event 'list' not found, use '-e list' to get list of available events Usage: perf c2c record [] [] or: perf c2c record [] -- [] -e, --event event selector. Use 'perf mem record -e list' to list available events $ New behavior: $ perf c2c record -e list ldlat-loads : available ldlat-stores : available v3: is a rebase. v2: addresses review comments by Jiri Olsa. https://lore.kernel.org/lkml/20191127081844.GH32367@krava/ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200507220604.3391-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 63b5930f4a4e8b5cce25f4ad78561f28b129aaac Author: Paul A. Clarke Date: Thu May 7 11:28:58 2020 -0500 perf vendor events power9: Add missing metrics to POWER9 'cpi_breakdown' Add the following metrics to the POWER9 'cpi_breakdown' metricgroup: - ict_noslot_br_mpred_cpi - ict_noslot_br_mpred_icmiss_cpi - ict_noslot_cyc_other_cpi - ict_noslot_disp_held_cpi - ict_noslot_disp_held_hb_full_cpi - ict_noslot_disp_held_issq_cpi - ict_noslot_disp_held_other_cpi - ict_noslot_disp_held_sync_cpi - ict_noslot_disp_held_tbegin_cpi - ict_noslot_ic_l2_cpi - ict_noslot_ic_l3_cpi - ict_noslot_ic_l3miss_cpi - ict_noslot_ic_miss_cpi Signed-off-by: Paul Clarke Cc: Ananth N Mavinakayanahalli Reviewed-by: Kajol Jain Tested-by: Ian Rogers Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Naveen N. Rao Cc: Sukadev Bhattiprolu Link: http://lore.kernel.org/lkml/1588868938-21933-3-git-send-email-pc@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0a892c1c947230f9373c9a3c94df1babe989861f Author: Ian Rogers Date: Wed Apr 22 10:36:15 2020 -0700 perf record: Add dummy event during system wide synthesis During the processing of /proc during event synthesis new processes may start. Add a dummy event if /proc is to be processed, to capture mmaps for starting processes. This reuses the existing logic for initial-delay. v3 fixes the attr test of test-record-C0 v2 fixes the dummy event configuration and a branch stack issue. Suggested-by: Stephane Eranian Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200422173615.59436-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 5885a202d04482427bc4079981680b30e3e5bbab Author: Ian Rogers Date: Fri May 8 14:08:03 2020 -0300 perf evsel: Dummy events never triggers, no need to ask for PERF_SAMPLE_BRANCH_STACK A dummy event never triggers any actual counter and therefore cannot be used with branch_stack Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200422173615.59436-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 8510895bafdbf7c4dd24c22946d925691135c2b2 Author: Jin Yao Date: Thu Apr 30 08:36:18 2020 +0800 perf parse-events: Use strcmp() to compare the PMU name A big uncore event group is split into multiple small groups which only include the uncore events from the same PMU. This has been supported in the commit 3cdc5c2cb924a ("perf parse-events: Handle uncore event aliases in small groups properly"). If the event's PMU name starts to repeat, it must be a new event. That can be used to distinguish the leader from other members. But now it only compares the pointer of pmu_name (leader->pmu_name == evsel->pmu_name). If we use "perf stat -M LLC_MISSES.PCIE_WRITE -a" on cascadelakex, the event list is: evsel->name evsel->pmu_name --------------------------------------------------------------- unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_4 (as leader) unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_2 unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_0 unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_5 unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_3 unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_1 unc_iio_data_req_of_cpu.mem_write.part1 uncore_iio_4 ...... For the event "unc_iio_data_req_of_cpu.mem_write.part1" with "uncore_iio_4", it should be the event from PMU "uncore_iio_4". It's not a new leader for this PMU. But if we use "(leader->pmu_name == evsel->pmu_name)", the check would be failed and the event is stored to leaders[] as a new PMU leader. So this patch uses strcmp to compare the PMU name between events. Fixes: d4953f7ef1a2 ("perf parse-events: Fix 3 use after frees found with clang ASAN") Signed-off-by: Jin Yao Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200430003618.17002-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d4d5ca0baac3de82c00ebc7677ee84537c31ba3c Author: Paul A. Clarke Date: Thu May 7 09:18:07 2020 -0500 perf stat: Increase perf metric output resolution Add another digit of precision to the perf metrics output. Before: $ /usr/bin/perf stat --metrics run_cpi /bin/ls [...] 4,345,526 pm_run_cyc # 1.1 run_cpi 3,818,069 pm_run_inst_cmpl [...] $ /usr/bin/perf stat --metrics run_cpi --metric-only /bin/ls [...] run_cpi 1.1 [...] After: $ perf stat --metrics run_cpi /bin/ls [...] 4,280,882 pm_run_cyc # 1.12 run_cpi 3,817,016 pm_run_inst_cmpl [...] $ perf stat --metrics run_cpi --metric-only /bin/ls [...] run_cpi 1.06 [...] Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Signed-off-by: Paul Clarke LPU-Reference: 1588861087-31280-1-git-send-email-pc@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9be27a5d416925aef4ff816379c31b8cd18ff55d Author: Ian Rogers Date: Fri May 1 10:33:31 2020 -0700 perf expr: Print a debug message for division by zero If an expression yields 0 and is then divided-by/modulus-by then the parsing aborts. Add a debug error message to better enable debugging when this happens. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f2682a8fe9b0429eef9fb3cc96e33c4b136a15bb Author: Ian Rogers Date: Fri May 1 10:33:30 2020 -0700 perf metrics: Fix parse errors in power9 metrics Mismatched parentheses. Fixes: 7f3cf5ac7743 (perf vendor events power9: Cpi_breakdown & estimated_dcache_miss_cpi metrics) Signed-off-by: Ian Rogers Reviewed-by: Paul Clarke Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 981d169f9008bf15caf6814708e7b5207d103089 Author: Ian Rogers Date: Fri May 1 10:33:29 2020 -0700 perf metrics: Fix parse errors in power8 metrics Mismatched parentheses. Fixes: dd81eafacc52 (perf vendor events power8: Cpi_breakdown & estimated_dcache_miss_cpi metrics) Signed-off-by: Ian Rogers Reviewed-by: Paul Clarke Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e5e0e63528f2d302c8190fc909baf97f250acb70 Author: Ian Rogers Date: Fri May 1 10:33:28 2020 -0700 perf expr: Debug lex if debugging yacc Only effects parser debugging (disabled by default). Enables displaying '--accepting rule at line .. ("..."). Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7db2fd0b211394be8b4c7caadc943d0d7ca86357 Author: Ian Rogers Date: Fri May 1 10:33:27 2020 -0700 perf expr: Parse numbers as doubles This is expected in expr.y and metrics use floating point values such as x86 broadwell IFetch_Line_Utilization. Fixes: 26226a97724d (perf expr: Move expr lexer to flex) Signed-off-by: Ian Rogers Tested-by: Kajol Jain Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f59d3f84a03c54bc394ba9727bf15818e4f86286 Author: Ian Rogers Date: Fri May 1 10:33:26 2020 -0700 perf expr: Increase max other Large metrics such as Branch_Misprediction_Cost_SMT on x86 broadwell need more space. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cb59fa793e3c837ea6843dcec3bd6a0ea649f06b Author: Ian Rogers Date: Fri May 1 10:33:25 2020 -0700 perf expr: Allow ',' to be an other token Corrects parse errors in expr__find_other of expressions with min. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7db61f384dae23217d9a31ca2c996ce10bc6c764 Author: Ian Rogers Date: Fri May 1 10:33:24 2020 -0700 perf metrics: Fix parse errors in skylake metrics Remove over escaping with \\. Fixes: fd5500989c8f (perf vendor events intel: Update metrics from TMAM 3.5) Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 92aa1c2bdb96da996d558cb4ec5e9ecf5afe8dcb Author: Ian Rogers Date: Fri May 1 10:33:23 2020 -0700 perf metrics: Fix parse errors in cascade lake metrics Remove over escaping with \\. Remove extraneous if 1 if 0 == 1 else 0 else 0. Fixes: fd5500989c8f (perf vendor events intel: Update metrics from TMAM 3.5) Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5b3141d02645a36ccf9f08a67e08e8186dfef12c Author: Ian Rogers Date: Fri May 1 10:33:22 2020 -0700 perf expr: Allow for unlimited escaped characters in a symbol Current expression allows 2 escaped '-,=' characters. However, some metrics require more, for example Haswell DRAM_BW_Use. Fixes: 26226a97724d (perf expr: Move expr lexer to flex) Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Tested-by: Kajol Jain Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Haiyan Song Cc: Jin Yao Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200501173333.227162-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 53fb18941d81522a3e6eec1a5f21a70da1515e56 Author: Jiri Olsa Date: Thu May 7 11:50:24 2020 +0200 perf script: Enable IP fields for callchains In case the callchains were deleted in pipe mode, we need to ensure that the IP fields are enabled, otherwise the callchain is not displayed. Enabling IP and SYM, which should be enough for callchains. Committer testing: Before: Committer Testing: before: # ls # perf record -g -e 'syscalls:*' sleep 0.1 2>/dev/null | perf script | tail sleep 5677 [0] 5034.295882: syscalls:sys_exit_mmap: 0x7fcbcfa74000 sleep 5677 [0] 5034.295885: syscalls:sys_enter_close: fd: 0x00000003 sleep 5677 [0] 5034.295886: syscalls:sys_exit_close: 0x0 sleep 5677 [0] 5034.295911: syscalls:sys_enter_nanosleep: rqtp: 0x7fff775b33a0, rmtp: 0x00000000 sleep 5677 [0] 5034.396021: syscalls:sys_exit_nanosleep: 0x0 sleep 5677 [0] 5034.396027: syscalls:sys_enter_close: fd: 0x00000001 sleep 5677 [0] 5034.396028: syscalls:sys_exit_close: 0x0 sleep 5677 [0] 5034.396029: syscalls:sys_enter_close: fd: 0x00000002 sleep 5677 [0] 5034.396029: syscalls:sys_exit_close: 0x0 sleep 5677 [0] 5034.396032: syscalls:sys_enter_exit_group: error_code: 0x00000000 # # ls # After: # perf record --call-graph=dwarf -e 'syscalls:sys_enter*' sleep 0.1 2>/dev/null | perf script | tail -37 sleep 33010 [000] 5400.625269: syscalls:sys_enter_nanosleep: rqtp: 0x7fff2d0e7860, rmtp: 0x00000000 7f1406f131a7 __GI___nanosleep (inlined) 561c4f996966 [unknown] 561c4f99673f [unknown] 561c4f9937af [unknown] 7f1406e6c1a2 __libc_start_main 561c4f99388d [unknown] sleep 33010 [000] 5400.725391: syscalls:sys_enter_close: fd: 0x00000001 7f1406f3c3cb __GI___close_nocancel (inlined) 7f1406ec7d6f _IO_new_file_close_it (inlined) 7f1406ebafa5 _IO_new_fclose (inlined) 561c4f996a40 [unknown] 561c4f993d79 [unknown] 7f1406e83e86 __run_exit_handlers 7f1406e8403f __GI_exit (inlined) 7f1406e6c1a9 __libc_start_main 561c4f99388d [unknown] sleep 33010 [000] 5400.725395: syscalls:sys_enter_close: fd: 0x00000002 7f1406f3c3cb __GI___close_nocancel (inlined) 7f1406ec7d6f _IO_new_file_close_it (inlined) 7f1406ebafa5 _IO_new_fclose (inlined) 561c4f996a40 [unknown] 561c4f993da2 [unknown] 7f1406e83e86 __run_exit_handlers 7f1406e8403f __GI_exit (inlined) 7f1406e6c1a9 __libc_start_main 561c4f99388d [unknown] sleep 33010 [000] 5400.725399: syscalls:sys_enter_exit_group: error_code: 0x00000000 7f1406f13466 __GI__exit (inlined) 7f1406e83fa1 __run_exit_handlers 7f1406e8403f __GI_exit (inlined) 7f1406e6c1a9 __libc_start_main 561c4f99388d [unknown] # And, if we install coreutils-debuginfo, we'll have those [unknown] resolved, those are for the /usr/bin/sleep binary, use: # dnf debuginfo-install coreutils On Fedora and derivatives, then: # perf record --call-graph=dwarf -e 'syscalls:sys_enter*' sleep 0.1 2>/dev/null | perf script | tail -37 sleep 33046 [009] 5533.910074: syscalls:sys_enter_nanosleep: rqtp: 0x7ffea6fa7ab0, rmtp: 0x00000000 7f5f786e81a7 __GI___nanosleep (inlined) 564472454966 rpl_nanosleep 56447245473f xnanosleep 5644724517af main 7f5f786411a2 __libc_start_main 56447245188d _start sleep 33046 [009] 5534.010218: syscalls:sys_enter_close: fd: 0x00000001 7f5f787113cb __GI___close_nocancel (inlined) 7f5f7869cd6f _IO_new_file_close_it (inlined) 7f5f7868ffa5 _IO_new_fclose (inlined) 564472454a40 close_stream 564472451d79 close_stdout 7f5f78658e86 __run_exit_handlers 7f5f7865903f __GI_exit (inlined) 7f5f786411a9 __libc_start_main 56447245188d _start sleep 33046 [009] 5534.010224: syscalls:sys_enter_close: fd: 0x00000002 7f5f787113cb __GI___close_nocancel (inlined) 7f5f7869cd6f _IO_new_file_close_it (inlined) 7f5f7868ffa5 _IO_new_fclose (inlined) 564472454a40 close_stream 564472451da2 close_stdout 7f5f78658e86 __run_exit_handlers 7f5f7865903f __GI_exit (inlined) 7f5f786411a9 __libc_start_main 56447245188d _start sleep 33046 [009] 5534.010229: syscalls:sys_enter_exit_group: error_code: 0x00000000 7f5f786e8466 __GI__exit (inlined) 7f5f78658fa1 __run_exit_handlers 7f5f7865903f __GI_exit (inlined) 7f5f786411a9 __libc_start_main 56447245188d _start # Reported-by: Paul Khuong Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200507095024.2789147-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0d71a2b242b36732d31323d74809f6c8b25e18da Author: Jiri Olsa Date: Thu May 7 11:50:23 2020 +0200 perf callchain: Setup callchain properly in pipe mode Callchains are automatically initialized by checking on event's sample_type. For pipe mode we need to put this check into attr event code. Moving the callchains setup code into callchain_param_setup function and calling it from attr event process code. This enables pipe output having callchains, like: # perf record -g -e 'raw_syscalls:sys_enter' true | perf script # perf record -g -e 'raw_syscalls:sys_enter' true | perf report Committer notes: We still need the next patch for the above output to work. Reported-by: Paul Khuong Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200507095024.2789147-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 14d3d54052539a1e833b5b615add5bc9ac3ef76a Author: Jiri Olsa Date: Thu May 7 11:50:22 2020 +0200 perf session: Try to read pipe data from file Ian came with the idea of having support to read the pipe data also from file. Currently pipe mode files fail like: $ perf record -o - sleep 1 > /tmp/perf.pipe.data $ perf report -i /tmp/perf.pipe.data incompatible file format (rerun with -v to learn more) This patch adds the support to do that by trying the pipe header first, and if its successfully detected, switching the perf data to pipe mode. Committer testing: # ls # perf record -a -o - sleep 1 > /tmp/perf.pipe.data [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] # ls # perf report -i /tmp/perf.pipe.data | head -25 # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 511 of event 'cycles' # Event count (approx.): 178447276 # # Overhead Command Shared Object Symbol # ........ ........ ................. ........................................................................................... # 65.49% swapper [kernel.kallsyms] [k] native_safe_halt 6.45% chromium libblink_core.so [.] blink::SelectorChecker::CheckOne 4.08% chromium libblink_core.so [.] blink::SelectorQuery::ExecuteForTraverseRoot 2.25% chromium libblink_core.so [.] blink::SelectorQuery::FindTraverseRootsAndExecute 2.11% chromium libblink_core.so [.] blink::SelectorChecker::MatchSelector 1.91% chromium libblink_core.so [.] blink::Node::OwnerShadowHost 1.31% chromium libblink_core.so [.] blink::Node::parentNode@plt 1.22% chromium libblink_core.so [.] blink::Node::parentNode 0.59% chromium libblink_core.so [.] blink::AnyAttributeMatches 0.58% chromium libv8.so [.] v8::internal::GlobalHandles::Create 0.58% chromium libblink_core.so [.] blink::NodeTraversal::NextAncestorSibling 0.55% chromium libv8.so [.] v8::internal::RegExpGlobalCache::RegExpGlobalCache 0.55% chromium libblink_core.so [.] blink::Node::ContainingShadowRoot 0.55% chromium libblink_core.so [.] blink::NodeTraversal::NextAncestorSibling@plt # Original-patch-by: Ian Rogers Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Khuong Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200507095024.2789147-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b491198db8fd8db0aacb880964dea891f0b6c04e Author: Jiri Olsa Date: Thu May 7 11:50:21 2020 +0200 perf tools: Do not seek in pipe fd during tracing data processing There's no need to set 'fd' position in pipe mode, the file descriptor is already in proper place. Moreover the lseek will fail on pipe descriptor and that's why it's been working properly. I was tempted to remove the lseek calls completely, because it seems that tracing data event was always synthesized only in pipe mode, so there's no need for 'file' mode handling. But I guess there was a reason behind this and there might (however unlikely) be a perf.data that we could break processing for. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Khuong Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200507095024.2789147-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fdb071f8661141b6869b9d52b4446019ea8601ad Author: Jiri Olsa Date: Thu May 7 11:50:20 2020 +0200 perf tools: Do not display extra info when there is nothing to build Even with fully built tree, we still display extra output when make is invoked, like: $ make BUILD: Doing 'make -j8' parallel build DESCEND plugins make[3]: Nothing to be done for 'plugins/libtraceevent-dynamic-list'. Changing the make descend directly to plugins directory, which quiets those messages down. Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ian Rogers Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Khuong Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200507095024.2789147-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f41ebe9defacddeae96a872a33f0f22ced0bfcef Author: Masami Hiramatsu Date: Thu Apr 23 20:01:22 2020 +0900 perf probe: Do not show the skipped events When a probe point is expanded to several places (like inlined) and if some of them are skipped because of blacklisted or __init function, those trace_events has no event name. It must be skipped while showing results. Without this fix, you can see "(null):(null)" on the list, # ./perf probe request_resource reserve_setup is out of .text, skip it. Added new events: (null):(null) (on request_resource) probe:request_resource (on request_resource) You can now use it in all perf tools, such as: perf record -e probe:request_resource -aR sleep 1 # With this fix, it is ignored: # ./perf probe request_resource reserve_setup is out of .text, skip it. Added new events: probe:request_resource (on request_resource) You can now use it in all perf tools, such as: perf record -e probe:request_resource -aR sleep 1 # Fixes: 5a51fcd1f30c ("perf probe: Skip kernel symbols which is out of .text") Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/158763968263.30755.12800484151476026340.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo commit 2ae5d0d7d8868df7c05c2013c0b9cddd4d40610e Author: Masami Hiramatsu Date: Thu Apr 23 20:01:13 2020 +0900 perf probe: Check address correctness by map instead of _etext Since commit 03db8b583d1c ("perf tools: Fix maps__find_symbol_by_name()") introduced map address range check in maps__find_symbol_by_name(), we can not get "_etext" from kernel map because _etext is placed on the edge of the kernel .text section (= kernel map in perf.) To fix this issue, this checks the address correctness by map address range information (map->start and map->end) instead of using _etext address. This can cause an error if the target inlined function is embedded in both __init function and normal function. For exaample, request_resource() is a normal function but also embedded in __init reserve_setup(). In this case, the probe point in reserve_setup() must be skipped. However, without this fix, it failes to setup all probe points: # ./perf probe -v request_resource probe-definition(0): request_resource symbol:request_resource file:(null) line:0 offset:0 return:0 lazy:(null) 0 arguments Looking at the vmlinux_path (8 entries long) Using /usr/lib/debug/lib/modules/5.5.17-200.fc31.x86_64/vmlinux for symbols Open Debuginfo file: /usr/lib/debug/lib/modules/5.5.17-200.fc31.x86_64/vmlinux Try to find probe point from debuginfo. Matched function: request_resource [15e29ad] found inline addr: 0xffffffff82fbf892 Probe point found: reserve_setup+204 found inline addr: 0xffffffff810e9790 Probe point found: request_resource+0 Found 2 probe_trace_events. Opening /sys/kernel/debug/tracing//kprobe_events write=1 Opening /sys/kernel/debug/tracing//README write=0 Writing event: p:probe/request_resource _text+33290386 Failed to write event: Invalid argument Error: Failed to add events. Reason: Invalid argument (Code: -22) # With this fix, # ./perf probe request_resource reserve_setup is out of .text, skip it. Added new events: (null):(null) (on request_resource) probe:request_resource (on request_resource) You can now use it in all perf tools, such as: perf record -e probe:request_resource -aR sleep 1 # Fixes: 03db8b583d1c ("perf tools: Fix maps__find_symbol_by_name()") Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/158763967332.30755.4922496724365529088.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo commit 80526491c2ca6abc028c0f0dbb0707a1f35fb18a Author: Masami Hiramatsu Date: Thu Apr 23 20:01:04 2020 +0900 perf probe: Fix to check blacklist address correctly Fix to check kprobe blacklist address correctly with relocated address by adjusting debuginfo address. Since the address in the debuginfo is same as objdump, it is different from relocated kernel address with KASLR. Thus, 'perf probe' always misses to catch the blacklisted addresses. Without this patch, 'perf probe' can not detect the blacklist addresses on a KASLR enabled kernel. # perf probe kprobe_dispatcher Failed to write event: Invalid argument Error: Failed to add events. # With this patch, it correctly shows the error message. # perf probe kprobe_dispatcher kprobe_dispatcher is blacklisted function, skip it. Probe point 'kprobe_dispatcher' not found. Error: Failed to add events. # Fixes: 9aaf5a5f479b ("perf probe: Check kprobes blacklist when adding new events") Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/158763966411.30755.5882376357738273695.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo commit c6aab66a728b6518772c74bd9dff66e1a1c652fd Author: Masami Hiramatsu Date: Wed May 6 23:29:12 2020 +0900 perf probe: Accept the instance number of kretprobe event Since the commit 6a13a0d7b4d1 ("ftrace/kprobe: Show the maxactive number on kprobe_events") introduced to show the instance number of kretprobe events, the length of the 1st format of the kprobe event will not 1, but it can be longer. This caused a parser error in perf-probe. Skip the length check the 1st format of the kprobe event to accept this instance number. Without this fix: # perf probe -a vfs_read%return Added new event: probe:vfs_read__return (on vfs_read%return) You can now use it in all perf tools, such as: perf record -e probe:vfs_read__return -aR sleep 1 # perf probe -l Semantic error :Failed to parse event name: r16:probe/vfs_read__return Error: Failed to show event list. And with this fixes: # perf probe -a vfs_read%return ... # perf probe -l probe:vfs_read__return (on vfs_read%return) Fixes: 6a13a0d7b4d1 ("ftrace/kprobe: Show the maxactive number on kprobe_events") Reported-by: Yuxuan Shui Signed-off-by: Masami Hiramatsu Tested-by: Yuxuan Shui Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207587 Link: http://lore.kernel.org/lkml/158877535215.26469.1113127926699134067.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo commit 7d1e239e911f57180c4c3aa8f6d4f87c306e2cfd Author: Arnaldo Carvalho de Melo Date: Wed May 6 13:38:26 2020 -0300 perf counts: Rename perf_evsel__*counts() to evsel__*counts() As these are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit c64e85e14b51a0afb9d12ca2bb2fe049ec6931bf Author: Arnaldo Carvalho de Melo Date: Wed May 6 13:32:23 2020 -0300 perf evsel: Rename perf_evsel__[hs]w_cache* to evsel__[hs]w_cache* As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 8f6725a2c95c8b8719a95e72d68698b68401980f Author: Arnaldo Carvalho de Melo Date: Wed May 6 13:27:04 2020 -0300 perf evsel: Rename perf_evsel__new*() to evsel__new*() As these are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 35ac0cad7d6c9d4b8c656bbe6d4136de07ecd14d Author: Arnaldo Carvalho de Melo Date: Wed May 6 13:05:08 2020 -0300 perf evsel: Rename *perf_evsel__get_config_term() & friends to evsel__env() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 2dbfc94517379b4a55dcca70ed4ace902b0987a6 Author: Arnaldo Carvalho de Melo Date: Wed May 6 13:00:39 2020 -0300 perf evsel: Rename perf_evsel__fprintf() to evsel__fprintf() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 10c513f798d6482c51f943cf2bac8f7605558262 Author: Arnaldo Carvalho de Melo Date: Wed May 6 12:58:55 2020 -0300 perf evsel: Rename perf_evsel__resort*() to evsel__resort*() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 4c70382824beafe81b9437c6a07dbef7798eb85e Author: Arnaldo Carvalho de Melo Date: Wed May 6 12:55:06 2020 -0300 perf evsel: Rename perf_evsel__object_config() to evsel__object_config() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit b7d73cb63cbac70746ee0d506aa2fa16b5dc75a0 Merge: 117858bd63fb bcd8e7761ec9 Author: Mark Brown Date: Thu May 28 14:01:17 2020 +0100 Merge series "add ecspi ERR009165 for i.mx6/7 soc family" from Robin Gong : There is ecspi ERR009165 on i.mx6/7 soc family, which cause FIFO transfer to be send twice in DMA mode. Please get more information from: https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf. The workaround is adding new sdma ram script which works in XCH mode as PIO inside sdma instead of SMC mode, meanwhile, 'TX_THRESHOLD' should be 0. The issue should be exist on all legacy i.mx6/7 soc family before i.mx6ul. NXP fix this design issue from i.mx6ul, so newer chips including i.mx6ul/ 6ull/6sll do not need this workaroud anymore. All other i.mx6/7/8 chips still need this workaroud. This patch set add new 'fsl,imx6ul-ecspi' for ecspi driver and 'ecspi_fixed' in sdma driver to choose if need errata or not. The first two reverted patches should be the same issue, though, it seems 'fixed' by changing to other shp script. Hope Sean or Sascha could have the chance to test this patch set if could fix their issues. Besides, enable sdma support for i.mx8mm/8mq and fix ecspi1 not work on i.mx8mm because the event id is zero. PS: Please get sdma firmware from below linux-firmware and copy it to your local rootfs /lib/firmware/imx/sdma. https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma v2: 1.Add commit log for reverted patches. 2.Add comment for 'ecspi_fixed' in sdma driver. 3.Add 'fsl,imx6sll-ecspi' compatible instead of 'fsl,imx6ul-ecspi' rather than remove. v3: 1.Confirm with design team make sure ERR009165 fixed on i.mx6ul/i.mx6ull /i.mx6sll, not fixed on i.mx8m/8mm and other i.mx6/7 legacy chips. Correct dts related dts patch in v2. 2.Clean eratta information in binding doc and new 'tx_glitch_fixed' flag in spi-imx driver to state ERR009165 fixed or not. 3.Enlarge burst size to fifo size for tx since tx_wml set to 0 in the errata workaroud, thus improve performance as possible. v4: 1.Add Ack tag from Mark and Vinod 2.Remove checking 'event_id1' zero as 'event_id0'. v5: 1.Add the last patch for compatible with the current uart driver which using rom script, so both uart ram script and rom script supported in latest firmware, by default uart rom script used. UART driver will be broken without this patch. v6: 1.Resend after rebase the latest next branch. 2.Remove below No.13~No.15 patches of v5 because they were mergered. ARM: dts: imx6ul: add dma support on ecspi ARM: dts: imx6sll: correct sdma compatible arm64: defconfig: Enable SDMA on i.mx8mq/8mm 3.Revert "dmaengine: imx-sdma: fix context cache" since 'context_loaded' removed. v7: 1.Put the last patch 13/13 'Revert "dmaengine: imx-sdma: fix context cache"' to the ahead of 03/13 'Revert "dmaengine: imx-sdma: refine to load context only once" so that no building waring during comes out during bisect. 2.Address Sascha's comments, including eliminating any i.mx6sx in this series, adding new 'is_imx6ul_ecspi()' instead imx in imx51 and taking care SMC bit for PIO. 3.Add back missing 'Reviewed-by' tag on 08/15(v5):09/13(v7) 'spi: imx: add new i.mx6ul compatible name in binding doc' v8: 1.remove 0003-Revert-dmaengine-imx-sdma-fix-context-cache.patch and merge it into 04/13 of v7 2.add 0005-spi-imx-fallback-to-PIO-if-dma-setup-failure.patch for no any ecspi function broken even if sdma firmware not updated. 3.merge 'tx.dst_maxburst' changes in the two continous patches into one patch to avoid confusion. 4.fix typo 'duplicated'. Robin Gong (13): Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Revert "dmaengine: imx-sdma: refine to load context only once" dmaengine: imx-sdma: remove duplicated sdma_load_context spi: imx: fallback to PIO if dma setup failure dmaengine: imx-sdma: add mcu_2_ecspi script spi: imx: fix ERR009165 spi: imx: remove ERR009165 workaround on i.mx6ul spi: imx: add new i.mx6ul compatible name in binding doc dmaengine: imx-sdma: remove ERR009165 on i.mx6ul dma: imx-sdma: add i.mx6ul compatible name dmaengine: imx-sdma: fix ecspi1 rx dma not work on i.mx8mm dmaengine: imx-sdma: add uart rom script .../devicetree/bindings/dma/fsl-imx-sdma.txt | 1 + .../devicetree/bindings/spi/fsl-imx-cspi.txt | 1 + arch/arm/boot/dts/imx6q.dtsi | 2 +- arch/arm/boot/dts/imx6qdl.dtsi | 8 +- drivers/dma/imx-sdma.c | 67 ++++++++++------ drivers/spi/spi-imx.c | 92 +++++++++++++++++++--- include/linux/platform_data/dma-imx-sdma.h | 8 +- 7 files changed, 135 insertions(+), 44 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel commit 117858bd63fb2ebcdfcc27b09fd65cb44511ea4c Author: Dinghao Liu Date: Sat May 23 20:47:58 2020 +0800 spi: tegra20-sflash: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200523124758.28604-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit faedcc17ad183acfa5d74758ebc4f21aef341f11 Author: Dinghao Liu Date: Sat May 23 20:29:09 2020 +0800 spi: tegra20-slink: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200523122909.25247-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit cddc36f3fd706b1046a4d4608359c0003f72db32 Author: Dinghao Liu Date: Sat May 23 20:57:04 2020 +0800 spi: tegra114: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200523125704.30300-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit bcd8e7761ec9c128b9102b0833d9c7052ae2dbcf Author: Robin Gong Date: Thu May 21 04:34:17 2020 +0800 spi: imx: fallback to PIO if dma setup failure Fallback to PIO in case dma setup failed. For example, sdma firmware not updated but ERR009165 workaroud added in kernel. Signed-off-by: Robin Gong Acked-by: Sascha Hauer Link: https://lore.kernel.org/r/1590006865-20900-6-git-send-email-yibin.gong@nxp.com Signed-off-by: Mark Brown commit 4a0434502191347ba8f99468f2fb2cdddc20d381 Author: Ravulapati Vishnu vardhan rao Date: Thu May 28 13:22:16 2020 +0530 ASoC: amd: Removing unnecessary instance initialization In DMA pointer the initialzation of instance is of no use. In fact it will reinitialize the instance variable which is already opened and functional. Signed-off-by: Ravulapati Vishnu vardhan rao Link: https://lore.kernel.org/r/1590652337-21587-1-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown commit 8dc1011470315501914a4527276b7b93301f3d38 Author: Chuhong Yuan Date: Thu May 28 18:20:04 2020 +0800 ASoC: sta32x: add missed function calls in error paths sta32x_probe() forgets to call undo functions when it fails, add the missed function calls to fix it. Signed-off-by: Chuhong Yuan Link: https://lore.kernel.org/r/20200528102004.911653-1-hslester96@gmail.com Signed-off-by: Mark Brown commit a50067d4f3c1d60d3fa07584aa6a0f897c1ac5b6 Author: Arnd Bergmann Date: Thu May 28 11:17:17 2020 +0200 ASoC: rt5682: split i2c driver into separate module With SND_SOC_AMD_RV_RT5682_MACH using the i2c version of the driver, we can easily get a build failure when I2C is built-in but soundwire is not: WARNING: unmet direct dependencies detected for SND_SOC_RT5682 Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (I2C [=y] || SOUNDWIRE [=m]) && (SOUNDWIRE [=m] || !SOUNDWIRE [=m]) && (I2C [=y] || !I2C [=y]) Selected by [y]: - SND_SOC_AMD_RV_RT5682_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_ACP3x [=y] && I2C [=y] && CROS_EC [=y] Selected by [m]: - SND_SOC_RT5682_SDW [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SOUNDWIRE [=m] && (I2C [=y] || !I2C [=y]) Rework the driver to have three separate modules, with the main driver just dealing with the common bits and the actual initialization as part of i2c and sdw specific modules. The conversion is fairly mechanical to keep it easy to review, i.e. it moves code around with the minimal required renaming and changes. Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform") Fixes: fd443a20c2f0 ("ASoC: rt5682: fix I2C/Soundwire dependencies") Signed-off-by: Arnd Bergmann Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200528091851.2889754-1-arnd@arndb.de Signed-off-by: Mark Brown commit 2b1878afc8fb778a881e9a1d7d17b14e13f579dc Author: Seven Lee Date: Thu May 28 15:05:10 2020 +0800 ASoC: nau8810: add I2C device and compatible ID The nau8810 driver can also compatible with nau8812 and nau8814. Signed-off-by: Seven Lee Link: https://lore.kernel.org/r/20200528070510.29959-1-wtli@nuvoton.com Signed-off-by: Mark Brown commit e6825bae26812e981c4d6f93214f0259ca9a4977 Author: Paul Cercueil Date: Sat May 23 14:54:55 2020 +0200 ASoC: ingenic: Unconditionally depend on devicetree All boards with Ingenic SoCs probe with devicetree already, we have no use for a non-devicetree path. This solves some compilation warnings that were caused by unused variables in the case where CONFIG_OF was disabled. Reported-by: kbuild test robot Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200523125455.12392-1-paul@crapouillou.net Signed-off-by: Mark Brown commit e9524fb97ab5b41b85e1d3408f8e513433798f3c Author: Arvind Sankar Date: Wed May 27 19:26:02 2020 -0400 efi/x86: Don't blow away existing initrd Commit 987053a30016 ("efi/x86: Move command-line initrd loading to efi_main") moved the command-line initrd loading into efi_main(), with a check to ensure that it was attempted only if the EFI stub was booted via efi_pe_entry rather than the EFI handover entry. However, in the case where it was booted via handover entry, and thus an initrd may have already been loaded by the bootloader, it then wrote 0 for the initrd address and size, removing any existing initrd. Fix this by checking if size is positive before setting the fields in the bootparams structure. Fixes: 987053a30016 ("efi/x86: Move command-line initrd loading to efi_main") Reported-by: Dan Williams Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Reviewed-by: Ard Biesheuvel Tested-by: Dan Williams Link: https://lkml.kernel.org/r/20200527232602.21596-1-nivedita@alum.mit.edu commit 0d583273b49a2305d6f5fff668575bdbf9e85c70 Merge: 9536a3155bf0 83ca8b3e8f21 Author: Arnd Bergmann Date: Thu May 28 14:18:11 2020 +0200 Merge branch 'baikal/drivers' into arm/drivers [arnd: This is a patch series from Serge Semin to add a few drivers that don't have any other subsystem maintainer tree to go through, so I'm picking them up through the soc tree, full series description from the mailing list below] Baikal-T1 SoC CPU is based on two MIPS Warrior P5600 cores. Their main memory Non-Coherent IO interface is connected to the OCP2AXI bridge, which in turn is then connected to the DW AMBA 3 AXI Interconnect (so called Main Interconnect) with nine masters and four slaves ports. Main Interconnect is responsible for the AXI-bus traffic arbitration (QoS) and its routing from one component to another. In addition there is a Errors Handler Block (EHB) accesible by means of the Baikal-T1 SoC System Controller responsible to detect AXI protocol errors and device not responding situations built on top the interconnect. Baikal-T1 AXI-bus driver included in this patchset will be responsible for working with that functionality, though currently it doesn't support QoS tuning. Instead it's capable of detecting the error events, reporting an info about them to the system log, injecting artificial errors to test the driver functionality. Since AXI Interconnect doesn't provide a way to find out which devices are connected to it, so its DT node is supposed to be compatible with "simple-bus" driver, while sub-nodes shall represent the masters attached to the bus. One of the AXI Interconnect slaves is an AXI-APB bridge used to access the Baikal-T1 SoC subsystems CSRs. MMIO request from CPU and DMAC masters are routed there if they are detected to be within [0x08000000 0x1FFFFFFF] range of the physical memory. In case if an attempted APB transaction stays with no response for a pre-defined time it will be detected by the APB-bus Errors Handler Block (EHB), which will raise an interrupt, then the bus gets freed for a next operation. The APB-bus driver provides the interrupt handler to detect the erroneous address, update an errors counter and prints an error message about the faulty address. The counter and the APB-bus operations timeout can be accessed via corresponding sysfs nodes. A dedicated sysfs-node can be also used to artificially cause the bus errors described above. Since APB-bus is a platform bus, it doesn't provide a way to detect slave devices connected to it, so similarly to the AXI-bus it's also supposed to be compatible with "simple-bus" driver. Aside from PCIe/SATA/DDR/I2C/EHB/CPU/reboot specific settings the Baikal-T1 System Controller provides a MIPS P5600 CM2 L2-cache tuning block. It is responsible for the setting up the Tag/Data/WS L2-to-RAM latencies. The last small patch in this patchset provides a driver and DT-schema-based binding for the described device. So that the latencies can be tuned up by means of dedicated DT properties and sysfs nodes. This patchset is rebased and tested on the mainline Linux kernel 5.7-rc4. Changelog v2 (AXI/APB bus): - Assign dual GPL/BSD licenses to the bindings. - Use single lined copyright headers in the bindings. - Replace "additionalProperties: false" property with "unevaluatedProperties: false" in the bindings. - Don't use a multi-arg clock phandle reference in DT binding examples. Thus remove includes from there. - Fix some commit message and Kconfig help text spelling. - Move drivers from soc to the bus subsystem. - Convert a simple EHB drivers to the Baikal-T1 AXI and APB bus ones. - Convert APB bus driver to using regmap MMIO API. - Use syscon regmap to access the AXI-bus erroneous address. - Add reset line support. - Add Main Interconnect clock support to the AXI-bus driver. - Remove probe-status info string printout. - Discard of_match_ptr() macro utilization. - Don't print error-message if no platform IRQ found. Just return an error. - Use generic FIELD_{GET,PREP} macros instead of handwritten ones in the AXI-bus driver. Changelog v2 (l2 driver): - Fix some commit message and Kconfig help text spelling. - Move the driver to the memory subsystem. - Assign dual GPL/BSD license to the DT binding. - Use single lined copyright header in the binding. - Discard reg property and syscon compatible string. - Move "allOf" restrictions to the root level of the properties. - The DT node is supposed to be a child of the Baikal-T1 system controller node. So regmap will be fetched from there. - Use generic FIELD_{GET,PREP} macro. - Remove probe-status info string printout. - Since the driver depends on the OF config we can remove of_match_ptr() macro utilization. Changelog v3: - Combine l2 and AXI/APB bus patches in a single patchset. - Retrieve AXI-bus QoS registers by resource name "qos". - Discard CONFIG_OF dependency since there is none at compile-time. - Add syscon EHB registers range to the AXI-bus reg property as optional entry. - Fix invalid of_property_read_u32() return value test in the l2-ctl driver. - Get the reg property back into the l2-ctl DT bindings even though the driver is using the parental syscon regmap. - The l2-ctl DT schema will live separately from the system controller, but the corresponding sub-node of the later DT schema will $ref this one. - Set non-default latencies in the l2-ctl DT example. * baikal/drivers: memory: Add Baikal-T1 L2-cache Control Block driver bus: Add Baikal-T1 APB-bus driver bus: Add Baikal-T1 AXI-bus driver dt-bindings: bus: Add Baikal-T1 APB-bus binding dt-bindings: bus: Add Baikal-T1 AXI-bus binding Link: https://lore.kernel.org/lkml/20200526130841.ap6qlxv7hqmabnh5@mobilestation/ Signed-off-by: Arnd Bergmann commit 83ca8b3e8f213f49cc68b5c1fbcf88ebb24671eb Author: Serge Semin Date: Tue May 26 15:59:28 2020 +0300 memory: Add Baikal-T1 L2-cache Control Block driver Baikal-T1 SoC provides a way to tune the MIPS P5600 CM2 L2-cache performance up. It can be done by changing the L2-RAM Data/Tag/WS latencies in a dedicated register exposed by the system controller. The driver added by this commit provides a dts properties-based and sysfs-based interface for it. The device DT node is supposed to be a child of Baikal-T1 System Controller node. Link: https://lore.kernel.org/r/20200526125928.17096-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Paul Burton Cc: Olof Johansson Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Arnd Bergmann commit 8f7f4fe756bd5cfef73cf8234445081385bdbf7d Author: Marc Zyngier Date: Wed May 27 11:38:57 2020 +0100 KVM: arm64: Drop obsolete comment about sys_reg ordering The general comment about keeping the enum order in sync with the save/restore code has been obsolete for many years now. Just drop it. Note that there are other ordering requirements in the enum, such as the PtrAuth and PMU registers, which are still valid. Reported-by: James Morse Signed-off-by: Marc Zyngier commit d9d7d84d9906e1bc886c5e0fc66aaad26008264b Author: Marc Zyngier Date: Tue Apr 21 18:32:02 2020 +0100 KVM: arm64: Parametrize exception entry with a target EL We currently assume that an exception is delivered to EL1, always. Once we emulate EL2, this no longer will be the case. To prepare for this, add a target_mode parameter. While we're at it, merge the computing of the target PC and PSTATE in a single function that updates both PC and CPSR after saving their previous values in the corresponding ELR/SPSR. This ensures that they are updated in the correct order (a pretty common source of bugs...). Reviewed-by: Mark Rutland Signed-off-by: Marc Zyngier commit 8f93662d8324940e8925a0e492c587dbcf7c7fee Author: Serge Semin Date: Tue May 26 15:59:27 2020 +0300 bus: Add Baikal-T1 APB-bus driver Baikal-T1 AXI-APB bridge is used to access the SoC subsystem CSRs. IO requests are routed to this bus by means of the DW AMBA 3 AXI Interconnect. In case if an attempted APB transaction stays with no response for a pre-defined time an interrupt occurs and the bus gets freed for a next operation. This driver provides the interrupt handler to detect the erroneous address, prints an error message about the address fault, updates an errors counter. The counter and the APB-bus operations timeout can be accessed via corresponding sysfs nodes. A dedicated sysfs-node can be also used to artificially cause the bus errors described above. [arnd: fix build warnings for missing includes and wrong return types] Link: https://lore.kernel.org/r/20200526125928.17096-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Paul Burton Cc: Olof Johansson Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Cc: devicetree@vger.kernel.org Reported-by: kbuild test robot Reported-by: kbuild test robot Signed-off-by: Arnd Bergmann commit 63cb77136e04ff24ca520e46f5ff57d351dadbdb Author: Serge Semin Date: Tue May 26 15:59:26 2020 +0300 bus: Add Baikal-T1 AXI-bus driver AXI3-bus is the main communication bus connecting all high-speed peripheral IP-cores with RAM controller and MIPS P5600 cores on Baikal-T1 SoC. Bus traffic arbitration is done by means of DW AMBA 3 AXI Interconnect (so called AXI Main Interconnect) routing IO requests from one SoC block to another. This driver provides a way to detect any bus protocol errors and device not responding situations by means of an embedded on top of the interconnect errors handler block (EHB). AXI Interconnect QoS arbitration tuning is currently unsupported. The bus doesn't provide a way to detect the interconnected devices, so they are supposed to be statically defined like by means of the simple-bus sub-nodes. [arnd: fix build warnings for missing includes and wrong return types] Link: https://lore.kernel.org/r/20200526125928.17096-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Paul Burton Cc: Olof Johansson Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Cc: devicetree@vger.kernel.org Reported-by: kbuild test robot Reported-by: kbuild test robot Signed-off-by: Arnd Bergmann commit 2166e5edce9ac1edf3b113d6091ef72fcac2d6c4 Author: Filipe Manana Date: Wed May 27 11:16:19 2020 +0100 btrfs: fix space_info bytes_may_use underflow during space cache writeout We always preallocate a data extent for writing a free space cache, which causes writeback to always try the nocow path first, since the free space inode has the prealloc bit set in its flags. However if the block group that contains the data extent for the space cache has been turned to RO mode due to a running scrub or balance for example, we have to fallback to the cow path. In that case once a new data extent is allocated we end up calling btrfs_add_reserved_bytes(), which decrements the counter named bytes_may_use from the data space_info object with the expection that this counter was previously incremented with the same amount (the size of the data extent). However when we started writeout of the space cache at cache_save_setup(), we incremented the value of the bytes_may_use counter through a call to btrfs_check_data_free_space() and then decremented it through a call to btrfs_prealloc_file_range_trans() immediately after. So when starting the writeback if we fallback to cow mode we have to increment the counter bytes_may_use of the data space_info again to compensate for the extent allocation done by the cow path. When this issue happens we are incorrectly decrementing the bytes_may_use counter and when its current value is smaller then the amount we try to subtract we end up with the following warning: ------------[ cut here ]------------ WARNING: CPU: 3 PID: 657 at fs/btrfs/space-info.h:115 btrfs_add_reserved_bytes+0x3d6/0x4e0 [btrfs] Modules linked in: btrfs blake2b_generic xor raid6_pq libcrc32c (...) CPU: 3 PID: 657 Comm: kworker/u8:7 Tainted: G W 5.6.0-rc7-btrfs-next-58 #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Workqueue: writeback wb_workfn (flush-btrfs-1591) RIP: 0010:btrfs_add_reserved_bytes+0x3d6/0x4e0 [btrfs] Code: ff ff 48 (...) RSP: 0000:ffffa41608f13660 EFLAGS: 00010287 RAX: 0000000000001000 RBX: ffff9615b93ae400 RCX: 0000000000000000 RDX: 0000000000000002 RSI: 0000000000000000 RDI: ffff9615b96ab410 RBP: fffffffffffee000 R08: 0000000000000001 R09: 0000000000000000 R10: ffff961585e62a40 R11: 0000000000000000 R12: ffff9615b96ab400 R13: ffff9615a1a2a000 R14: 0000000000012000 R15: ffff9615b93ae400 FS: 0000000000000000(0000) GS:ffff9615bb200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055cbbc2ae178 CR3: 0000000115794006 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: find_free_extent+0x4a0/0x16c0 [btrfs] btrfs_reserve_extent+0x91/0x180 [btrfs] cow_file_range+0x12d/0x490 [btrfs] btrfs_run_delalloc_range+0x9f/0x6d0 [btrfs] ? find_lock_delalloc_range+0x221/0x250 [btrfs] writepage_delalloc+0xe8/0x150 [btrfs] __extent_writepage+0xe8/0x4c0 [btrfs] extent_write_cache_pages+0x237/0x530 [btrfs] extent_writepages+0x44/0xa0 [btrfs] do_writepages+0x23/0x80 __writeback_single_inode+0x59/0x700 writeback_sb_inodes+0x267/0x5f0 __writeback_inodes_wb+0x87/0xe0 wb_writeback+0x382/0x590 ? wb_workfn+0x4a2/0x6c0 wb_workfn+0x4a2/0x6c0 process_one_work+0x26d/0x6a0 worker_thread+0x4f/0x3e0 ? process_one_work+0x6a0/0x6a0 kthread+0x103/0x140 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x3a/0x50 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0x74f/0x2020 softirqs last enabled at (0): [] copy_process+0x74f/0x2020 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace bd7c03622e0b0a52 ]--- ------------[ cut here ]------------ So fix this by incrementing the bytes_may_use counter of the data space_info when we fallback to the cow path. If the cow path is successful the counter is decremented after extent allocation (by btrfs_add_reserved_bytes()), if it fails it ends up being decremented as well when clearing the delalloc range (extent_clear_unlock_delalloc()). This could be triggered sporadically by the test case btrfs/061 from fstests. Fixes: 82d5902d9c681b ("Btrfs: Support reading/writing on disk free ino cache") CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 467dc47ea99c56e966e99d09dae54869850abeeb Author: Filipe Manana Date: Wed May 27 11:16:07 2020 +0100 btrfs: fix space_info bytes_may_use underflow after nocow buffered write When doing a buffered write we always try to reserve data space for it, even when the file has the NOCOW bit set or the write falls into a file range covered by a prealloc extent. This is done both because it is expensive to check if we can do a nocow write (checking if an extent is shared through reflinks or if there's a hole in the range for example), and because when writeback starts we might actually need to fallback to COW mode (for example the block group containing the target extents was turned into RO mode due to a scrub or balance). When we are unable to reserve data space we check if we can do a nocow write, and if we can, we proceed with dirtying the pages and setting up the range for delalloc. In this case the bytes_may_use counter of the data space_info object is not incremented, unlike in the case where we are able to reserve data space (done through btrfs_check_data_free_space() which calls btrfs_alloc_data_chunk_ondemand()). Later when running delalloc we attempt to start writeback in nocow mode but we might revert back to cow mode, for example because in the meanwhile a block group was turned into RO mode by a scrub or relocation. The cow path after successfully allocating an extent ends up calling btrfs_add_reserved_bytes(), which expects the bytes_may_use counter of the data space_info object to have been incremented before - but we did not do it when the buffered write started, since there was not enough available data space. So btrfs_add_reserved_bytes() ends up decrementing the bytes_may_use counter anyway, and when the counter's current value is smaller then the size of the allocated extent we get a stack trace like the following: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 20138 at fs/btrfs/space-info.h:115 btrfs_add_reserved_bytes+0x3d6/0x4e0 [btrfs] Modules linked in: btrfs blake2b_generic xor raid6_pq libcrc32c (...) CPU: 0 PID: 20138 Comm: kworker/u8:15 Not tainted 5.6.0-rc7-btrfs-next-58 #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Workqueue: writeback wb_workfn (flush-btrfs-1754) RIP: 0010:btrfs_add_reserved_bytes+0x3d6/0x4e0 [btrfs] Code: ff ff 48 (...) RSP: 0018:ffffbda18a4b3568 EFLAGS: 00010287 RAX: 0000000000000000 RBX: ffff9ca076f5d800 RCX: 0000000000000000 RDX: 0000000000000002 RSI: 0000000000000000 RDI: ffff9ca068470410 RBP: fffffffffffff000 R08: 0000000000000001 R09: 0000000000000000 R10: ffff9ca079d58040 R11: 0000000000000000 R12: ffff9ca068470400 R13: ffff9ca0408b2000 R14: 0000000000001000 R15: ffff9ca076f5d800 FS: 0000000000000000(0000) GS:ffff9ca07a600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005605dbfe7048 CR3: 0000000138570006 CR4: 00000000003606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: find_free_extent+0x4a0/0x16c0 [btrfs] btrfs_reserve_extent+0x91/0x180 [btrfs] cow_file_range+0x12d/0x490 [btrfs] run_delalloc_nocow+0x341/0xa40 [btrfs] btrfs_run_delalloc_range+0x1ea/0x6d0 [btrfs] ? find_lock_delalloc_range+0x221/0x250 [btrfs] writepage_delalloc+0xe8/0x150 [btrfs] __extent_writepage+0xe8/0x4c0 [btrfs] extent_write_cache_pages+0x237/0x530 [btrfs] ? btrfs_wq_submit_bio+0x9f/0xc0 [btrfs] extent_writepages+0x44/0xa0 [btrfs] do_writepages+0x23/0x80 __writeback_single_inode+0x59/0x700 writeback_sb_inodes+0x267/0x5f0 __writeback_inodes_wb+0x87/0xe0 wb_writeback+0x382/0x590 ? wb_workfn+0x4a2/0x6c0 wb_workfn+0x4a2/0x6c0 process_one_work+0x26d/0x6a0 worker_thread+0x4f/0x3e0 ? process_one_work+0x6a0/0x6a0 kthread+0x103/0x140 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x3a/0x50 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0x74f/0x2020 softirqs last enabled at (0): [] copy_process+0x74f/0x2020 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace f9f6ef8ec4cd8ec9 ]--- So to fix this, when falling back into cow mode check if space was not reserved, by testing for the bit EXTENT_NORESERVE in the respective file range, and if not, increment the bytes_may_use counter for the data space_info object. Also clear the EXTENT_NORESERVE bit from the range, so that if the cow path fails it decrements the bytes_may_use counter when clearing the delalloc range (through the btrfs_clear_delalloc_extent() callback). Fixes: 7ee9e4405f264e ("Btrfs: check if we can nocow if we don't have data space") CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e2c8e92d1140754073ad3799eb6620c76bab2078 Author: Filipe Manana Date: Wed May 27 11:15:53 2020 +0100 btrfs: fix wrong file range cleanup after an error filling dealloc range If an error happens while running dellaloc in COW mode for a range, we can end up calling extent_clear_unlock_delalloc() for a range that goes beyond our range's end offset by 1 byte, which affects 1 extra page. This results in clearing bits and doing page operations (such as a page unlock) outside our target range. Fix that by calling extent_clear_unlock_delalloc() with an inclusive end offset, instead of an exclusive end offset, at cow_file_range(). Fixes: a315e68f6e8b30 ("Btrfs: fix invalid attempt to free reserved space on failure to cow range") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 213ff4b72a9c7509dd85979db64c66774f4f26c1 Author: Nikolay Borisov Date: Wed May 27 13:10:59 2020 +0300 btrfs: remove redundant local variable in read_block_for_search The local 'b' variable is only used to directly read values from passed extent buffer. So eliminate it and directly use the input parameter. Furthermore this shrinks the size of the following functions: ./scripts/bloat-o-meter ctree.orig fs/btrfs/ctree.o add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-73 (-73) Function old new delta read_block_for_search.isra 876 871 -5 push_node_left 1112 1044 -68 Total: Before=50348, After=50275, chg -0.14% Reviewed-by: Johannes Thumshirn Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 995e9a166b6909c9bb4af8f51b9502f8b8c18291 Author: Nikolay Borisov Date: Wed May 27 13:10:53 2020 +0300 btrfs: open code key_search This function wraps the optimisation implemented by d7396f07358a ("Btrfs: optimize key searches in btrfs_search_slot") however this optimisation is really used in only one place - btrfs_search_slot. Just open code the optimisation and also add a comment explaining how it works since it's not clear just by looking at the code - the key point here is it depends on an internal invariant that BTRFS' btree provides, namely intermediate pointers always contain the key at slot0 at the child node. So in the case of exact match we can safely assume that the given key will always be in slot 0 on lower levels. Furthermore this results in a reduction of btrfs_search_slot's size: ./scripts/bloat-o-meter ctree.orig fs/btrfs/ctree.o add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-75 (-75) Function old new delta btrfs_search_slot 2783 2708 -75 Total: Before=50423, After=50348, chg -0.15% Reviewed-by: Johannes Thumshirn Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit d8f3e73587ce574f7a9bc165e0db69b0b148f6f8 Author: Christoph Hellwig Date: Tue May 19 09:46:29 2020 -0500 btrfs: split btrfs_direct_IO to read and write part The read and write versions don't have anything in common except for the call to iomap_dio_rw. So split this function, and merge each half into its only caller. Signed-off-by: Christoph Hellwig Signed-off-by: Goldwyn Rodrigues Signed-off-by: David Sterba commit 5f008163a559d566a0ee1190a0a24f3eec6f1ea7 Author: Goldwyn Rodrigues Date: Wed Dec 4 05:58:53 2019 -0600 btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK Since we now perform direct reads using i_rwsem, we can remove this inode flag used to co-ordinate unlocked reads. The truncate call takes i_rwsem. This means it is correctly synchronized with concurrent direct reads. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: Goldwyn Rodrigues Signed-off-by: David Sterba commit b75b7ca7c27dfd61dba368f390b7d4dc20b3a8cb Author: Goldwyn Rodrigues Date: Mon Nov 25 13:24:03 2019 -0600 fs: remove dio_end_io() Since we removed the last user of dio_end_io(), remove the helper function dio_end_io(). Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit a43a67a2d715540c1368b9501a22b0373b5874c0 Author: Goldwyn Rodrigues Date: Tue May 19 09:14:18 2020 -0500 btrfs: switch to iomap_dio_rw() for dio Switch from __blockdev_direct_IO() to iomap_dio_rw(). Rename btrfs_get_blocks_direct() to btrfs_dio_iomap_begin() and use it as iomap_begin() for iomap direct I/O functions. This function allocates and locks all the blocks required for the I/O. btrfs_submit_direct() is used as the submit_io() hook for direct I/O ops. Since we need direct I/O reads to go through iomap_dio_rw(), we change file_operations.read_iter() to a btrfs_file_read_iter() which calls btrfs_direct_IO() for direct reads and falls back to generic_file_buffered_read() for incomplete reads and buffered reads. We don't need address_space.direct_IO() anymore so set it to noop. Similarly, we don't need flags used in __blockdev_direct_IO(). iomap is capable of direct I/O reads from a hole, so we don't need to return -ENOENT. BTRFS direct I/O is now done under i_rwsem, shared in case of reads and exclusive in case of writes. This guards against simultaneous truncates. Use iomap->iomap_end() to check for failed or incomplete direct I/O: - for writes, call __endio_write_update_ordered() - for reads, unlock extents btrfs_dio_data is now hooked in iomap->private and not current->journal_info. It carries the reservation variable and the amount of data submitted, so we can calculate the amount of data to call __endio_write_update_ordered in case of an error. This patch removes last use of struct buffer_head from btrfs. Signed-off-by: Goldwyn Rodrigues Signed-off-by: David Sterba commit a1c13784d25111d8c8e98a4dae6dadd41ce4df3d Author: Serge Semin Date: Tue May 26 15:59:24 2020 +0300 dt-bindings: bus: Add Baikal-T1 APB-bus binding Baikal-T1 CPU or DMAC MMIO requests are handled by the AMBA 3 AXI Interconnect which routes them to the AXI-APB bridge, which in turn serializes accesses and routes them to the corresponding APB slave device. This binding describes the AXI-APB bridge considered as the APB-bus. It is supposed to be compatible with "be,bt1-apb" and "simple-bus" drivers, should be equipped with EHB MMIO region and a region with no slave device mapped, interrupts line number, APB reference clock and domain reset line. Link: https://lore.kernel.org/r/20200526125928.17096-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Paul Burton Cc: Olof Johansson Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 78c43a059a718c1ef12f6bb826d2e39a6d22024e Author: Serge Semin Date: Tue May 26 15:59:23 2020 +0300 dt-bindings: bus: Add Baikal-T1 AXI-bus binding AXI3-bus is the main communication bus connecting all high-speed peripheral IP-cores with RAM controller and with MIPS P5600 cores on Baikal-T1 SoC. This binding describes the DW AMBA 3 AXI Inteconnect and Errors Handler Block synthesized on top of it, which are responsible for the AXI-bus traffic arbitration and errors reporting upstream to CPU. Baikal-T1 AXI-bus DT node is supposed to be compatible with "be,bt1-axi" and "simple-bus" drivers, should have reg property with AXI-bus QOS registers space, syscon phandle reference to the Baikal-T1 System Controller, IRQ line declared, AXI Interconnect reference clock and reset line. Link: https://lore.kernel.org/r/20200526125928.17096-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Paul Burton Cc: Olof Johansson Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Signed-off-by: Arnd Bergmann commit 4d8be4bc94f74bb7d096e1c2e44457b530d5a170 Author: Qiushi Wu Date: Wed May 27 17:35:51 2020 -0500 ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe() kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous commit "b8eb718348b8" fixed a similar problem. Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance") Signed-off-by: Qiushi Wu Cc: 4.10+ # 4.10+ Signed-off-by: Rafael J. Wysocki commit 6e6c25283dff866308c87b49434c7dbad4774cc0 Author: Qiushi Wu Date: Wed May 27 16:17:17 2020 -0500 ACPI: sysfs: Fix reference count leak in acpi_sysfs_add_hotplug_profile() kobject_init_and_add() takes reference even when it fails. Thus, when kobject_init_and_add() returns an error, kobject_put() must be called to properly clean up the kobject. Fixes: 3f8055c35836 ("ACPI / hotplug: Introduce user space interface for hotplug profiles") Signed-off-by: Qiushi Wu Cc: 3.10+ # 3.10+ Signed-off-by: Rafael J. Wysocki commit c3b9c0043d25f66a73ebd8cbf34e7d6a9a2ccbb4 Author: Tiezhu Yang Date: Thu May 28 19:29:11 2020 +0800 MIPS: Loongson64: Remove not used pci.c After commit 6423e59a64e7 ("MIPS: Loongson64: Switch to generic PCI driver"), arch/mips/loongson64/pci.c is not used any more, remove it. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 5f55f1fb187ddb7d58bc01a68b93a5e109730378 Author: Rob Herring Date: Wed May 27 12:13:07 2020 -0600 clk: versatile: Fix kconfig dependency on COMMON_CLK_VERSATILE If COMPILE_TEST is enabled, then COMMON_CLK_VERSATILE can be disabled when dependent options like ICST are selected resulting in kconfig warnings: WARNING: unmet direct dependencies detected for ICST Depends on [n]: COMMON_CLK [=y] && COMMON_CLK_VERSATILE [=n] Selected by [y]: - ARCH_REALVIEW [=y] && (ARCH_MULTI_V5 [=n] || ARCH_MULTI_V6 [=n] || ARCH_MULTI_V7 [=y]) - ARCH_VEXPRESS [=y] && ARCH_MULTI_V7 [=y] - ARCH_ZYNQ [=y] && ARCH_MULTI_V7 [=y] WARNING: unmet direct dependencies detected for CLK_SP810 Depends on [n]: COMMON_CLK [=y] && COMMON_CLK_VERSATILE [=n] Selected by [y]: - ARCH_REALVIEW [=y] && (ARCH_MULTI_V5 [=n] || ARCH_MULTI_V6 [=n] || ARCH_MULTI_V7 [=y]) Fix this by dropping COMMON_CLK_VERSATILE and just using 'menu' instead of 'menuconfig'. [arnd: add ZYNQ to the dependency list] Link: https://lore.kernel.org/r/20200527181307.2482167-1-robh@kernel.org Fixes: 81134fb541d4 ("clk: versatile: Rework kconfig structure") Cc: Linus Walleij Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org Cc: linux-clk@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Arnd Bergmann commit 36e29139cd472a91978b14c3045ce25869172ab9 Merge: 3908895f412a 644c5a582261 Author: Arnd Bergmann Date: Thu May 28 13:11:22 2020 +0200 Merge tag 'keystone_dts_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into arm/dt ARM: dts: Keystone update for v5.8 - Rename "msmram" node to "sram" * tag 'keystone_dts_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: ARM: dts: keystone: Rename "msmram" node to "sram" Link: https://lore.kernel.org/r/1590638489-12023-2-git-send-email-santosh.shilimkar@oracle.com Signed-off-by: Arnd Bergmann commit 9536a3155bf098db6252198a278221c81029cfc9 Merge: 1f46d85ffa75 b8b38a8e3cae Author: Arnd Bergmann Date: Thu May 28 13:08:14 2020 +0200 Merge tag 'drivers_soc_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into arm/drivers soc: ARM TI update for v5.8 - Platform chipid driver support and associated dts doc update - Sparse warning fix in Navigator driver * tag 'drivers_soc_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: drivers: soc: ti: knav_qmss_queue: Make knav_gp_range_ops static soc: ti: add k3 platforms chipid module driver dt-bindings: soc: ti: add binding for k3 platforms chipid module Link: https://lore.kernel.org/r/1590638489-12023-1-git-send-email-santosh.shilimkar@oracle.com Signed-off-by: Arnd Bergmann commit 1f46d85ffa75ddf0403387eb731c73cd3e713f43 Author: Arnd Bergmann Date: Thu May 28 00:13:06 2020 +0200 staging: tegra-video: fix V4L2 dependency Rather than using a dependency on VIDEO_V4L2, this driver uses "select", which fails when other dependencies are missing: WARNING: unmet direct dependencies detected for VIDEO_V4L2 Depends on [n]: MEDIA_SUPPORT [=y] && (I2C [=y] || I2C [=y]=n) && VIDEO_DEV [=n] Selected by [y]: - VIDEO_TEGRA [=y] && STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=y] && TEGRA_HOST1X [=y] (plus an endless stream of link errors for other drivers that depend on VIDEO_V4L2 but are now lacking their dependencies) Link: https://lore.kernel.org/r/20200527221327.3339232-1-arnd@arndb.de Fixes: 3d8a97eabef0 ("media: tegra-video: Add Tegra210 Video input driver") Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Arnd Bergmann commit 349c330ced9764667678f4d2804fd4ebc16110c9 Author: Marc Zyngier Date: Sun Apr 12 18:49:31 2020 +0100 KVM: arm64: Don't use empty structures as CPU reset state Keeping empty structure as the vcpu state initializer is slightly wasteful: we only want to set pstate, and zero everything else. Just do that. Signed-off-by: Marc Zyngier commit bb44a8dbea259bc1dc2177b4bc90ca4e8fcbf659 Author: Marc Zyngier Date: Mon Jan 27 11:21:17 2020 +0000 KVM: arm64: Move sysreg reset check to boot time Our sysreg reset check has become a bit silly, as it only checks whether a reset callback actually exists for a given sysreg entry, and apply the method if available. Doing the check at each vcpu reset is pretty dumb, as the tables never change. It is thus perfectly possible to do the same checks at boot time. This also allows us to introduce a sparse sys_regs[] array, something that will be required with ARMv8.4-NV. Signed-off-by: Marc Zyngier commit 7ccadf23b8613c946f67e2b3c5e7f436858021aa Author: Marc Zyngier Date: Mon Jan 27 11:54:42 2020 +0000 KVM: arm64: Add missing reset handlers for PMU emulation As we're about to become a bit more harsh when it comes to the lack of reset callbacks, let's add the missing PMU reset handlers. Note that these only cover *CLR registers that were always covered by their *SET counterpart, so there is no semantic change here. Reviewed-by: James Morse Signed-off-by: Marc Zyngier commit 7ea90bdd70c9cf82dfbaa54e7d9f296928679224 Author: Marc Zyngier Date: Thu Jun 20 11:17:00 2019 +0100 KVM: arm64: Refactor vcpu_{read,write}_sys_reg Extract the direct HW accessors for later reuse. Reviewed-by: James Morse Signed-off-by: Marc Zyngier commit fc5d1f1a42fba6266ab95dc3b84937933a9b5a66 Author: Christoffer Dall Date: Sat Dec 1 08:41:28 2018 -0800 KVM: arm64: vgic-v3: Take cpu_if pointer directly instead of vcpu If we move the used_lrs field to the version-specific cpu interface structure, the following functions only operate on the struct vgic_v3_cpu_if and not the full vcpu: __vgic_v3_save_state __vgic_v3_restore_state __vgic_v3_activate_traps __vgic_v3_deactivate_traps __vgic_v3_save_aprs __vgic_v3_restore_aprs This is going to be very useful for nested virt, so move the used_lrs field and change the prototypes and implementations of these functions to take the cpu_if parameter directly. No functional change. Reviewed-by: James Morse Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit fb6c05b08b1a672cdc749b78f4e63cbfdfdd0ee8 Merge: 60b4000f5464 e9e4ef9116b1 Author: Arnd Bergmann Date: Thu May 28 12:45:25 2020 +0200 Merge tag 'soc-fsl-next-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/drivers NXP/FSL SoC driver updates for v5.8 DPAA2 DPIO driver - Prefer the CPU affined DPIO QUICC Engine drivers - Replace one-element array and use struct_size() helper Cleanups in various drivers * tag 'soc-fsl-next-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: dpio: Remove unused inline function qbman_write_eqcr_am_rt_register soc: fsl: qe: clean up an indentation issue soc: fsl: dpio: Prefer the CPU affine DPIO soc: fsl: qbman: Remove unused inline function qm_eqcr_get_ci_stashing soc: fsl: qe: Replace one-element array and use struct_size() helper treewide: Replace zero-length array with flexible-array Link: https://lore.kernel.org/r/20200527215740.9279-1-leoyang.li@nxp.com Signed-off-by: Arnd Bergmann commit 60b4000f54649546b4780ac61b67e5601382225d Author: Arnd Bergmann Date: Wed May 27 15:39:16 2020 +0200 tee: fix crypto select When selecting a crypto cipher, we also need to select the subsystem itself: WARNING: unmet direct dependencies detected for CRYPTO_SHA1 Depends on [m]: CRYPTO [=m] Selected by [y]: - TEE [=y] && (HAVE_ARM_SMCCC [=n] || COMPILE_TEST [=y] || CPU_SUP_AMD [=y]) Selected by [m]: - CRYPTO_DEV_QAT [=m] && CRYPTO [=m] && CRYPTO_HW [=y] - CRYPTO_DEV_MEDIATEK [=m] && CRYPTO [=m] && CRYPTO_HW [=y] && (ARM && ARCH_MEDIATEK || COMPILE_TEST [=y]) - CRYPTO_DEV_SAFEXCEL [=m] && CRYPTO [=m] && CRYPTO_HW [=y] && (OF [=y] || PCI [=y] || COMPILE_TEST [=y]) && HAS_IOMEM [=y] - CRYPTO_DEV_CCREE [=m] && CRYPTO [=m] && CRYPTO_HW [=y] && OF [=y] && HAS_DMA [=y] - CRYPTO_DEV_SP_CCP [=y] && CRYPTO [=m] && CRYPTO_HW [=y] && CRYPTO_DEV_CCP [=y] && CRYPTO_DEV_CCP_DD [=m] && DMADEVICES [=y] Link: https://lore.kernel.org/r/20200527133924.724819-1-arnd@arndb.de Fixes: e33bcbab16d1 ("tee: add support for session's client UUID generation") Signed-off-by: Arnd Bergmann Reviewed-by: Vesa Jääskeläinen Signed-off-by: Arnd Bergmann commit 147922f91965e734664374a3f226adfeaa586d72 Author: Arnd Bergmann Date: Wed May 27 15:37:34 2020 +0200 ARM: davinci: fix build failure without I2C The two supplies are referenced outside of #ifdef CONFIG_I2C but defined inside, which breaks the build if that is not built-in: mach-davinci/board-dm644x-evm.c:861:21: error: use of undeclared identifier 'fixed_supplies_1_8v' ARRAY_SIZE(fixed_supplies_1_8v), 1800000); ^ mach-davinci/board-dm644x-evm.c:861:21: error: use of undeclared identifier 'fixed_supplies_1_8v' mach-davinci/board-dm644x-evm.c:861:21: error: use of undeclared identifier 'fixed_supplies_1_8v' mach-davinci/board-dm644x-evm.c:860:49: error: use of undeclared identifier 'fixed_supplies_1_8v' regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v, I don't know if the regulators are used anywhere without I2C, but always registering them seems to be the safe choice here. On a related note, it might be best to also deal with CONFIG_I2C=m across the file, unless this is going to be moved to DT and removed really soon anyway. Link: https://lore.kernel.org/r/20200527133746.643895-1-arnd@arndb.de Fixes: 5e06d19694a4 ("ARM: davinci: dm644x-evm: Add Fixed regulators needed for tlv320aic33") Signed-off-by: Arnd Bergmann commit d0c7dc1739692888c6ea271fde7a4a69a31945c7 Author: Anders Roxell Date: Wed May 27 13:26:07 2020 +0200 power: reset: vexpress: fix build issue An allmodconfig kernel makes CONFIG_VEXPRESS_CONFIG a module and CONFIG_POWER_RESET_VEXPRESS builtin. That makes us see this build error: aarch64-linux-gnu-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe': ../drivers/power/reset/vexpress-poweroff.c:119: undefined reference to `devm_regmap_init_vexpress_config' ../drivers/power/reset/vexpress-poweroff.c:119:(.text+0x48c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `devm_regmap_init_vexpress_config' make[1]: *** [/srv/src/kernel/next/Makefile:1126: vmlinux] Error 1 Rework so that POWER_RESET_VEXPRESS depends on 'VEXPRESS_CONFIG=y'. Link: https://lore.kernel.org/r/20200527112608.3886105-5-anders.roxell@linaro.org Fixes: d06cfe3f123c ("bus: vexpress-config: Merge vexpress-syscfg into vexpress-config") Signed-off-by: Anders Roxell Acked-by: Rob Herring Signed-off-by: Arnd Bergmann commit a90d990452302ce3dac4d373d60a031439cc1885 Author: Anders Roxell Date: Wed May 27 13:26:05 2020 +0200 power: vexpress: cleanup: use builtin_platform_driver Use the helper macro for builtin drivers taht don't do anything special in driver init. This removes some boilerplate code. Link: https://lore.kernel.org/r/20200527112608.3886105-3-anders.roxell@linaro.org Signed-off-by: Anders Roxell Signed-off-by: Arnd Bergmann commit 73174acc9c75960af2daa7dcbdb9781fc0d135cb Author: Anders Roxell Date: Wed May 27 13:26:04 2020 +0200 power: vexpress: add suppress_bind_attrs to true Make sure that the POWER_RESET_VEXPRESS driver won't have bind/unbind attributes available via the sysfs, so lets be explicit here and use ".suppress_bind_attrs = true" to prevent userspace from doing something silly. Link: https://lore.kernel.org/r/20200527112608.3886105-2-anders.roxell@linaro.org Cc: stable@vger.kernel.org Signed-off-by: Anders Roxell Signed-off-by: Arnd Bergmann commit 56f292ad66321ec2b06fbbe8a4ac5d520257fb41 Author: Anders Roxell Date: Wed May 27 13:26:06 2020 +0200 Revert "ARM: vexpress: Don't select VEXPRESS_CONFIG" This reverts commit 848685c25da99d871bbd87369f3c3d6eead661ac. Due to when I set 'depends on VEXPRESS_CONFOG=Y' in 'config POWER_RESET_VEXPRESS' to get an allmodconfig build on arm64 to build, and allmodconfig build on arm fails if this patch isn't reverted. Link: https://lore.kernel.org/r/20200527112608.3886105-4-anders.roxell@linaro.org Signed-off-by: Anders Roxell Signed-off-by: Arnd Bergmann commit e1750a3d9abbea2ece29cac8dc5a6f5bc19c1492 Author: Petr Tesarik Date: Fri May 22 20:39:22 2020 +0200 s390/pci: Log new handle in clp_disable_fh() After disabling a function, the original handle is logged instead of the disabled handle. Link: https://lkml.kernel.org/r/20200522183922.5253-1-ptesarik@suse.com Fixes: 17cdec960cf7 ("s390/pci: Recover handle in clp_set_pci_fn()") Reviewed-by: Pierre Morel Signed-off-by: Petr Tesarik Signed-off-by: Vasily Gorbik commit a0138f59265aff4a21356ba9319171f421575b52 Author: Alexandra Winter Date: Thu Apr 16 15:08:41 2020 +0200 s390/cio, s390/qeth: cleanup PNSO CHSC CHSC3D (PNSO - perform network subchannel operation) is used for OC0 (Store-network-bridging-information) as well as for OC3 (Store-network-address-information). So common fields are renamed from *brinfo* to *pnso*. Also *_bridge_host_* is changed into *_addr_change_*, e.g. qeth_bridge_host_event to qeth_addr_change_event, for the same reasons. The keywords in the card traces are changed accordingly. Remove unused L3 types, as PNSO will only return Layer2 entries. Make PNSO CHSC implementation more consistent with existing API usage: Add new function ccw_device_pnso() to drivers/s390/cio/device_ops.c and the function declaration to arch/s390/include/asm/ccwdev.h, which takes a struct ccw_device * as parameter instead of schid and calls chsc_pnso(). PNSO CHSC has no strict relationship to qdio. So move the calling function from qdio to qeth_l2 and move the necessary structures to a new file arch/s390/include/asm/chsc.h. Do response code evaluation only in chsc_error_from_response() and use return code in all other places. qeth_anset_makerc() was meant to evaluate the PNSO response code, but never did, because pnso_rc was already non-zero. Indentation was corrected in some places. Signed-off-by: Alexandra Winter Reviewed-by: Peter Oberparleiter Reviewed-by: Vineeth Vijayan Reviewed-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit cafebf8653b3d689b3411daa0d3d7b67fc4f2edb Author: Julian Wiedmann Date: Thu May 7 10:21:53 2020 +0200 s390/qdio: remove q->first_to_kick q->first_to_kick is obsolete, and can be replaced by q->first_to_check. Both cursors start off at 0. Out of the three code paths that update first_to_check, the qdio_inspect_queue() path is irrelevant as it doesn't even touch first_to_kick anymore. This leaves us with the two tasklet-driven code paths. Here any update to first_to_check is followed by a call to qdio_kick_handler(), which advances first_to_kick by the same amount. So the two cursors will differ only for a tiny moment. Drivers have no way of deterministically observing this difference, and thus it doesn't matter which of the cursors we use for reporting an error to q->handler. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 0623b7dda24f313bf210119ee6c5a4bdec6ce52d Author: Julian Wiedmann Date: Sat May 9 15:12:05 2020 +0200 s390/qdio: fix up qdio_start_irq() kerneldoc Document the actual semantics, correcting an old copy & paste mistake. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 0b0ed657fe003fdf4df3766b898e8869950aa1ce Author: Sven Schnelle Date: Thu Feb 20 12:09:36 2020 +0100 s390: remove critical section cleanup from entry.S The current code is rather complex and caused a lot of subtle and hard to debug bugs in the past. Simplify the code by calling the system_call handler with interrupts disabled, save machine state, and re-enable them later. This requires significant changes to the machine check handling code as well. When the machine check interrupt arrived while being in kernel mode the new code will signal pending machine checks with a SIGP external call. When userspace was interrupted, the handler will switch to the kernel stack and directly execute s390_handle_mcck(). Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 11886c199d8d62e2469cb404235a4ee7266f01c7 Author: Sven Schnelle Date: Tue Mar 17 13:37:49 2020 +0100 s390: add machine check SIGP This will be used with the upcoming entry.S changes to signal that there's a machine check pending that cannot be handled in the Machine check handler itself. Reviewed-by: Christian Borntraeger Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 4bc90f492230af6661bc2021dddd501f7c842334 Author: Pali Rohár Date: Fri May 22 16:44:02 2020 +0200 mmc: sdio: Fix macro name for Marvell device with ID 0x9134 Marvell SDIO device ID 0x9134 is used in SDIO Common CIS (Card Information Structure) and not in SDIO wlan function (with ID 1). SDIO Common CIS is accessed by function ID 0. So change this misleading macro name to SDIO_DEVICE_ID_MARVELL_8887_F0 as it does not refer to wlan function. It refers to function 0. Wlan module on this SDIO card is available at function ID 1 and is identified by different SDIO device ID 0x9135. Kernel quirks for SDIO devices are matched against device ID from SDIO Common CIS. Therefore device ID used in quirk is correct, just has misleading name. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200522144412.19712-2-pali@kernel.org Signed-off-by: Ulf Hansson commit b303c16cf3aa840c4abdda3b015313bfd83dad62 Merge: 91132078a38d 202500d21654 Author: Ulf Hansson Date: Thu May 28 11:22:22 2020 +0200 Merge branch 'fixes' into next commit 91132078a38d9455b3832da1d68329e91b63ba25 Author: Angelo Dureghello Date: Mon May 25 12:23:24 2020 +0200 m68k: coldfire/clk.c: move m5441x specific code Moving specific m5441x clk-related code in more appropriate location, since breaking compilation for other targets. Signed-off-by: Angelo Dureghello Link: https://lore.kernel.org/r/20200525102324.2723438-1-angelo.dureghello@timesys.com Signed-off-by: Ulf Hansson commit 47e9e107fa31fcdd9eb82b22b7b0ab3c987eb576 Author: Yangbo Lu Date: Fri May 22 11:12:56 2020 +0800 mmc: sdhci-of-esdhc: exit HS400 properly before setting any speed mode The eSDHC HS400 timing requires many specific registers setting, unlike other speed modes which need to set only host controller 2 register. When driver needs to downgrade HS400 mode to other speed mode, the controller have to exit HS400 timing properly first. This patch is to support the procedure of HS400 exiting at the beginning of esdhc_set_uhs_signaling. Signed-off-by: Yangbo Lu Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200522031256.856-1-yangbo.lu@nxp.com Signed-off-by: Ulf Hansson commit 16d18d893c20564cf097099ade0d6505c835dea5 Author: Sarthak Garg Date: Fri May 22 15:02:30 2020 +0530 mmc: sdhci-msm: dump vendor specific registers during error Implement dump_vendor_registers host operation to print the vendor specific registers in addition to standard SDHC register during error conditions. Signed-off-by: Sahitya Tummala Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590139950-7288-9-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit d1fe0762f3c6191bd182d20b5d9c287cb46e667b Author: Sarthak Garg Date: Fri May 22 15:02:29 2020 +0530 mmc: sdhci-msm: Introduce new ops to dump vendor specific registers Introduce new sdhci ops to dump vendor specific registers in the sdhci_dumpregs during error. Signed-off-by: Sahitya Tummala Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590139950-7288-8-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit 03591160ca192df258890d411f16fe20ec196940 Author: Sarthak Garg Date: Fri May 22 15:02:28 2020 +0530 mmc: sdhci-msm: Read and use DLL Config property from device tree file Certain platforms require different settings in the SDCC_HC_REG_DLL_CONFIG register. This setting can change from platform to platform. So the driver should check whether a particular platform require a different setting by reading the DT file and use it. Also use msm_cm_dll_set_freq only when DLL not supplied. Signed-off-by: Bao D. Nguyen Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590139950-7288-7-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit 1dfbe3ff81f941bb0b39ea6b9f2e8771ef4cb3ea Author: Sarthak Garg Date: Fri May 22 15:02:27 2020 +0530 mmc: sdhci-msm: Update DDR_CONFIG as per device tree file Certain platforms require different settings in the SDCC_HC_REG_DDR_CONFIG register. This setting can change from platform to platform. So the driver should check whether a particular platform require a different setting by reading the device tree file and use it. Signed-off-by: Bao D. Nguyen Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590139950-7288-6-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit 04816e672d46a1aabb1a35d73ca5f90d6d252ca3 Author: Sarthak Garg Date: Fri May 22 15:02:26 2020 +0530 mmc: sdhci-msm: Update dll_config_3 as per HSR Update dll_config_3 as per the host clock frequency as specified in the DLL Hardware Reference Guide. Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590139950-7288-5-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit 5c30f340f9e0b8ecebb82e911a89819d349a8d03 Author: Veerabhadrarao Badiganti Date: Fri May 22 15:02:25 2020 +0530 mmc: host: sdhci-msm: Configure dll-user-control in dll init sequence With SDCC v5.1.0, additional setting needed for enabling DLL output. The dll-user-control register need to be configured during dll initialization for getting proper dll output. Without this configuration, we don't get the DLL lock status properly. Also update the DLL register settings according to the SDCC Hardware Programming Guide. Signed-off-by: Veerabhadrarao Badiganti Signed-off-by: Sarthak Garg Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590139950-7288-4-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit 97306b631d838667204bd6eaa59e72df1aabbd68 Author: Sarthak Garg Date: Fri May 22 15:02:24 2020 +0530 dt-bindings: mmc: Add information for DLL register properties Add information regarding DLL register properties for getting board specific configurations. These DLL register settings may vary from board to board. Signed-off-by: Sarthak Garg Link: https://lore.kernel.org/r/1590139950-7288-3-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit b91da9290979fee2fe2a67f9445d957861fadf6a Author: Sarthak Garg Date: Fri May 22 15:02:23 2020 +0530 dt-bindings: mmc: Add new compatible string for sm8250 target Add new compatible string for sm8250 target. Signed-off-by: Sarthak Garg Link: https://lore.kernel.org/r/1590139950-7288-2-git-send-email-sartgarg@codeaurora.org Signed-off-by: Ulf Hansson commit aebbf577e5d1b9ea551669400355dcf5c631c60f Author: Sowjanya Komatineni Date: Wed May 20 13:08:57 2020 -0700 sdhci: tegra: Avoid reading autocal timeout values when not applicable When auto calibration timeouts, calibration is disabled and fail-safe drive strength values are programmed based on the signal voltage. Different fail-safe drive strength values based on voltage are applicable only for SoCs supporting 3V3 and 1V8 pad controls. So, this patch avoids reading these properties from the device tree for SoCs not using pad controls and the warning of missing properties will not show up on these SoC platforms. Signed-off-by: Sowjanya Komatineni Tested-by: Dmitry Osipenko Acked-by: Thierry Reding Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1590005337-1087-1-git-send-email-skomatineni@nvidia.com Signed-off-by: Ulf Hansson commit d42c9fff1ecbec635f068cb1fc5baaeb6fd9a943 Author: Wolfram Sang Date: Tue May 19 18:42:51 2020 +0200 mmc: renesas_sdhi: remove manual clk handling The SDHI driver en-/disabled its main clock on its own, e.g. during probe() and remove(). Now, we leave all handling to RPM. clk_summary before: sd0 1 1 0 12480000 0 0 50000 sdif0 2 2 0 12480000 0 0 50000 clk_summary after: sd0 1 1 0 12480000 0 0 50000 sdif0 1 1 0 12480000 0 0 50000 Reported-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20200519164251.5430-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson Tested-by: Geert Uytterhoeven commit 63fd8ef3947c1f61897841748d196b8687b03cdd Author: Ulf Hansson Date: Tue May 19 17:24:45 2020 +0200 mmc: tmio: Make sure the PM domain is 'started' while probing If the tmio device is attached to a genpd (PM domain), that genpd may have ->start|stop() callback assigned to it. To make sure the device is accessible during ->probe(), genpd's ->start() callback must be invoked, which is currently managed by tmio_mmc_host_probe(). However, it's likely that may be too late for some cases, as registers may be read and written way before that point. To fix the behaviour, let's move the call to dev_pm_domain_start() from tmio_mmc_host_probe() into those clients that needs it. From discussions at linux-mmc mailing list, it turned out that it should be sufficient to do this for the SDHI renesas variants, hence the call is move to renesas_sdhi_probe(). Signed-off-by: Ulf Hansson Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Link: https://lore.kernel.org/r/20200519152445.6922-1-ulf.hansson@linaro.org Tested-by: Geert Uytterhoeven commit 4bd784411aca022622e484eb262f5a0540ae732c Author: Ulf Hansson Date: Tue May 19 17:24:34 2020 +0200 mmc: tmio: Further fixup runtime PM management at remove Before calling tmio_mmc_host_probe(), the caller is required to enable clocks for its device, as to make it accessible when reading/writing registers during probe. Therefore, the responsibility to disable these clocks, in the error path of ->probe() and during ->remove(), is better managed outside tmio_mmc_host_remove(). As a matter of fact, callers of tmio_mmc_host_remove() already expects this to be the behaviour. However, there's a problem with tmio_mmc_host_remove() when the Kconfig option, CONFIG_PM, is set. More precisely, tmio_mmc_host_remove() may then disable the clock via runtime PM, which leads to clock enable/disable imbalance problems, when the caller of tmio_mmc_host_remove() also tries to disable the same clocks. To solve the problem, let's make sure tmio_mmc_host_remove() leaves the device with clocks enabled, but also make sure to disable the IRQs, as we normally do at ->runtime_suspend(). Reported-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Ulf Hansson Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200519152434.6867-1-ulf.hansson@linaro.org Tested-by: Geert Uytterhoeven commit c5dce4f52d7918c5ce3ab2a63ab5978c24405a05 Author: Angelo Dureghello Date: Mon May 18 21:17:42 2020 +0200 MAINTAINERS: add myself to maintain M5441X mmc host driver Since actively working on Freescale ColdFire M5441X, adding myself as a maintainer of this driver. Signed-off-by: Angelo Dureghello Link: https://lore.kernel.org/r/20200518191742.1251440-4-angelo.dureghello@timesys.com Signed-off-by: Ulf Hansson commit a5a944d24cbce13f86932f6d9ae4ac4586fe543a Author: Angelo Dureghello Date: Mon May 18 21:17:41 2020 +0200 mmc: host: add Coldfire esdhc support This driver has been developed as a separate module starting from the similar sdhci-esdhc-imx.c. Reasons for a separate sdchi-esdhc-mcf driver: - m68K architecture does not support devicetrees, so modifying sdhci-of-esdhc.c that is devicetree-related adding platform data seems not appropriate, - clock-related part, has to be implemented specifically for mcf5441x family (see esdhc_mcf_pltfm_set_clock()), - this is a big endian cpu accessing a big endian controller, but about sdma, this controller does not support hw swap, which needs to be handled with specific code, - some other minor differences but mainly to avoid risks on tweaking inside largely used imx driver. Adding just a small size ColdFire-specific driver, with benefits in a further less risky maintenance. Signed-off-by: Angelo Dureghello Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200518191742.1251440-3-angelo.dureghello@timesys.com Signed-off-by: Ulf Hansson commit e93577ecde8f3cbd12a2eaa0522d5c85e0dbdd53 Author: Angelo Dureghello Date: Mon May 18 21:17:40 2020 +0200 mmc: sdhci: add quirks for be to le byte swapping Some controller as the ColdFire eshdc may require an endianness byte swap, because DMA read endianness is not configurable. Facilitate using the bounce buffer for this by adding ->copy_to_bounce_buffer(). Signed-off-by: Angelo Dureghello Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200518191742.1251440-2-angelo.dureghello@timesys.com Signed-off-by: Ulf Hansson commit 991f5c4dd2422881c933ec3c7c19f3a2a1858cc4 Author: Angelo Dureghello Date: Mon May 18 21:17:39 2020 +0200 m68k: mcf5441x: add support for esdhc mmc controller Add support for sdhci-edshc mmc controller. Signed-off-by: Angelo Dureghello Acked-by: Greg Ungerer Link: https://lore.kernel.org/r/20200518191742.1251440-1-angelo.dureghello@timesys.com Signed-off-by: Ulf Hansson commit 1f8153ee031d0d4756daa985788bf0a960e588a6 Author: Lad Prabhakar Date: Fri May 15 16:08:44 2020 +0100 dt-bindings: mmc: renesas,sdhi: Document r8a7742 support Document SDHI controller for RZ/G1H (R8A7742) SoC, which is compatible with R-Car Gen2 SoC family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1589555337-5498-5-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Ulf Hansson commit 7d79735d56a2f425f8c40054da0042b35c678839 Author: Martin Blumenstingl Date: Mon May 18 00:29:07 2020 +0200 mmc: meson-mx-sdhc: Don't use literal 0 to initialize structs Kbuild test robot reports the following warning in lines 56 and 87 of drivers/mmc/host/meson-mx-sdhc-clkc.c: Using plain integer as NULL pointer Drop the integer value from the struct initialization to fix that warning. This will still ensure that the compiler will zero out the struct so it's in a well-defined state. Reported-by: kbuild test robot Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200517222907.1277787-2-martin.blumenstingl@googlemail.com Signed-off-by: Ulf Hansson commit c70805dca13970d18a4a9960bdc1d2f10de59057 Author: Martin Blumenstingl Date: Mon May 18 00:29:06 2020 +0200 mmc: meson-mx-sdhc: Fix manual RX FIFO flushing For Meson8 and Meson8b SoCs the vendor driver follows the following pattern: - for eMMC and SD cards in .set_pdma it sets: pdma->rxfifo_manual_flush = 1; - for SDIO cards in .set_pdma it sets: pdma->rxfifo_manual_flush = 0; - before syncing the DMA read buffer is sets: pdma->rxfifo_manual_flush |= 0x02; Set the second bit of MESON_SDHC_PDMA_RXFIFO_MANUAL_FLUSH without clearing the first bit before syncing the DMA read buffer. This fixes a problem where Meson8 and Meson8b SoCs would read random garbage from SD cards. It is not clear why it worked for eMMC cards. This manifested in the following errors when plugging in an SD card: unrecognised SCR structure version Cc: Thomas Graichen Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200517222907.1277787-1-martin.blumenstingl@googlemail.com Signed-off-by: Ulf Hansson commit 86b59671deba640d77335ef75f7c3ca388372860 Author: Haibo Chen Date: Fri May 15 15:28:23 2020 +0800 mmc: sdhci-esdhc-imx: Add HS400 support for i.MX6SLL i.MX6SLL support MMC up to V5.0, which means support HS400 mode. Signed-off-by: Haibo Chen Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1589527703-19108-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 67c7daec6981d9b15ba85018b20ff8bcc3bcd193 Author: Martin Blumenstingl Date: Mon May 18 08:08:11 2020 +0200 mmc: meson-mx-sdhc: Fix building with CONFIG_MMC_MESON_MX_SDHC=m For an x86_64 allmodconfig build Stephen reports that building meson-mx-sdhc-clkc.o warns that MODULE_LICENSE is missing and when linking meson_mx_sdhc_register_clkc cannot be found. Compile the MMC controller driver together with the build-in clock controller driver into one module rather than using two separate modules to fix these issues. Reported-by: Stephen Rothwell Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200518060811.1499962-1-martin.blumenstingl@googlemail.com Signed-off-by: Ulf Hansson commit bccce2ec77901c771cd7acd83cb99626ab1edf07 Author: Jisheng Zhang Date: Fri May 15 14:19:26 2020 +0800 mmc: sdhci-of-dwcmshc: add suspend/resume support Add dwcmshc specific system-level suspend and resume support. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20200515141926.52e088fe@xhacker.debian Signed-off-by: Ulf Hansson commit 554232e8d59f3df842fdd9cc68a22e827b286d52 Author: Jisheng Zhang Date: Wed May 13 18:26:02 2020 +0800 mmc: sdhci-of-dwcmshc: implement specific set_uhs_signaling We need a different set_uhs_signaling implementation for MMC_TIMING_MMC_HS and MMC_TIMING_MMC_HS400. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20200513182602.3636a551@xhacker.debian Signed-off-by: Ulf Hansson commit e4bf1b0970ef96135c78c7dcf4e14484ce3b9804 Author: Martin Blumenstingl Date: Tue May 12 22:41:47 2020 +0200 mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host The SDHC MMC host controller on Amlogic SoCs provides an eMMC and MMC card interface with 1/4/8-bit bus width. It supports eMMC spec 4.4x/4.5x including HS200 (up to 100MHz clock). The public S805 datasheet [0] contains a short documentation about the registers. Unfortunately it does not describe how to use the registers to make the hardware work. Thus this driver is based on reading (and understanding) the Amlogic 3.10 GPL kernel code. Some hardware details are not easy to see. Jianxin Pan was kind enough to answer my questions: The hardware has built-in busy timeout support. The maximum timeout is 30 seconds. This is only documented in Amlogic's internal documentation. The controller only works with very specific clock configurations. The details are not part of the public datasheet. In my own words the supported configurations are: - 399.812kHz: clkin = 850MHz div = 2126 sd_rx_phase = 63 - 1MHz: clkin = 850MHz div = 850 sd_rx_phase = 55 - 5.986MHz: clkin = 850MHz div = 142 sd_rx_phase = 24 - 25MHz: clkin = 850MHz div = 34 sd_rx_phase = 15 - 47.222MHz: clkin = 850MHz div = 18 sd_rx_phase = 11/15 (SDR50/HS) - 53.125MHz: clkin = 850MHz div = 16 sd_rx_phase = (tuning) - 70.833MHz: clkin = 850MHz div = 12 sd_rx_phase = (tuning) - 85MHz: clkin = 850MHz div = 10 sd_rx_phase = (tuning) - 94.44MHz: clkin = 850MHz div = 9 sd_rx_phase = (tuning) - 106.25MHz: clkin = 850MHz div = 8 sd_rx_phase = (tuning) - 127.5MHz: clkin = 1275MHz div = 10 sd_rx_phase = (tuning) - 141.667MHz: clkin = 850MHz div = 6 sd_rx_phase = (tuning) - 159.375MHz: clkin = 1275MHz div = 8 sd_rx_phase = (tuning) - 212.5MHz: clkin = 1275MHz div = 6 sd_rx_phase = (tuning) - (sd_tx_phase is always 1, 94.44MHz is not listed in the datasheet but this is what the 3.10 BSP kernel on Odroid-C1 actually uses) NOTE: CMD23 support is disabled for now because it results in command timeouts and thus decreases read performance. Tested-by: Wei Wang Tested-by: Xin Yin Reviewed-by: Xin Yin Tested-by: Anand Moon Signed-off-by: Martin Blumenstingl Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20200512204147.504087-3-martin.blumenstingl@googlemail.com Signed-off-by: Ulf Hansson commit e5f31378862e5d0e879809bd50a84790ea14a0bc Author: Martin Blumenstingl Date: Tue May 12 22:41:46 2020 +0200 dt-bindings: mmc: Document the Amlogic Meson SDHC MMC host controller This documents the devicetree bindings for the SDHC MMC host controller found in Meson6, Meson8, Meson8b and Meson8m2 SoCs. It can use a bus-width of 1/4/8-bit and it supports eMMC spec 4.4x/4.5x including HS200 mode (up to 100MHz clock). It embeds an internal clock controller which outputs four clocks (mod_clk, sd_clk, tx_clk and rx_clk) and is fed by four external input clocks (clkin[0-3]). "pclk" is the module register clock, it has to be enabled to access the registers. Signed-off-by: Martin Blumenstingl Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200512204147.504087-2-martin.blumenstingl@googlemail.com Signed-off-by: Ulf Hansson commit 83fc5dd57f86c3ec7d6d22565a6ff6c948853b64 Author: Jérôme Pouiller Date: Mon May 11 18:19:02 2020 +0200 mmc: fix compilation of user API The definitions of MMC_IOC_CMD and of MMC_IOC_MULTI_CMD rely on MMC_BLOCK_MAJOR: #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd) #define MMC_IOC_MULTI_CMD _IOWR(MMC_BLOCK_MAJOR, 1, struct mmc_ioc_multi_cmd) However, MMC_BLOCK_MAJOR is defined in linux/major.h and linux/mmc/ioctl.h did not include it. Signed-off-by: Jérôme Pouiller Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200511161902.191405-1-Jerome.Pouiller@silabs.com Signed-off-by: Ulf Hansson commit 804a65b3dfdd6d853364a835698870fb20f7a81a Author: Masahiro Yamada Date: Mon May 11 15:28:27 2020 +0900 mmc: sdhci: use FIELD_GET/PREP for current capabilities bit masks Use FIELD_GET and FIELD_PREP to get access to the register fields. Delete the shift macros and use GENMASK() for the touched macros. Note that, this has the side-effect of changing the constants to 64-bit on 64-bit platforms. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200511062828.1791484-1-yamada.masahiro@socionext.com Signed-off-by: Ulf Hansson commit 5d1f42e14b135773c0cc1d82e904c5b223783a9d Author: Masahiro Yamada Date: Mon May 11 15:21:58 2020 +0900 mmc: uniphier-sd: call devm_request_irq() after tmio_mmc_host_probe() Currently, tmio_mmc_irq() handler is registered before the host is fully initialized by tmio_mmc_host_probe(). I did not previously notice this problem. The boot ROM of a new Socionext SoC unmasks interrupts (CTL_IRQ_MASK) somehow. The handler is invoked before tmio_mmc_host_probe(), then emits noisy call trace. Move devm_request_irq() below tmio_mmc_host_probe(). Fixes: 3fd784f745dd ("mmc: uniphier-sd: add UniPhier SD/eMMC controller driver") Signed-off-by: Masahiro Yamada Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200511062158.1790924-1-yamada.masahiro@socionext.com Signed-off-by: Ulf Hansson commit 1ae1d2d6e555e809945b691eccb1055595845a59 Author: Ben Chuang Date: Fri May 8 14:41:54 2020 +0800 mmc: sdhci-pci-gli: Add Genesys Logic GL9763E support GL9763E supports High Speed SDR, High Speed DDR, HS200, HS400, Enhanced Strobe in HS400 mode, 1/4/8 bits data bus and 3.3/1.8V. Signed-off-by: Ben Chuang Link: https://lore.kernel.org/r/20200508064154.13473-1-benchuanggli@gmail.com Signed-off-by: Ulf Hansson commit 1be64c7963f89afbd6f96f27effea20900650dfe Author: Ulf Hansson Date: Fri May 8 13:29:02 2020 +0200 mmc: host: Drop redundant MMC_CAP_ERASE The MMC_CAP_ERASE bit is no longer used by the mmc core as erase, discard and trim operations are now always supported. Therefore, drop the bit and move all mmc hosts away from using it. Signed-off-by: Ulf Hansson Reviewed-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20200508112902.23575-1-ulf.hansson@linaro.org Reviewed-by: Linus Walleij commit 94fe2580a2f3bb055fdca86a2adf156d01f15764 Author: Ulf Hansson Date: Fri May 8 13:28:53 2020 +0200 mmc: core: Enable erase/discard/trim support for all mmc hosts Step by step, mmc host drivers and the mmc core have been improved in regards to support erase/discard/trim operations. We have now reached a point when it no longer seems reasonable to use an opt-in approach to enable the functionality. Therefore, let's switch to make the operations always supported. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200508112853.23525-1-ulf.hansson@linaro.org Reviewed-by: Linus Walleij commit 04f2f45f410f4c1f591482afa1ab6a8c44f0b713 Author: Ulf Hansson Date: Fri May 8 11:52:28 2020 +0200 mmc: sdricoh_cs: Respect the cmd->busy_timeout from the mmc core Using a fixed 1s polling timeout for all commands is a bit problematic. For some commands it means waiting longer than needed for the polling to be aborted, which may not a big issue, but still. For other commands, like for an erase (CMD38) that uses a R1B response, may require longer timeouts than 1s. In these cases, we may end up treating the command as it failed, while it just needed some more time to complete successfully. Fix the problem by respecting the cmd->busy_timeout, which is provided by the mmc core. Note that, even if the sdricoh_cs driver may currently not support HW busy detection on DAT0, some comments in the code refer to that the HW may support it. Therefore, it seems better to be proactive in this case. Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200508095228.14230-1-ulf.hansson@linaro.org commit 3eea697c1da58f169b3abfebaa6d07cff7cb1c8d Author: Ulf Hansson Date: Fri May 8 11:52:18 2020 +0200 mmc: sdricoh_cs: Throttle polling rate for commands Rather than to poll in a busy-loop, let's convert into using read_poll_timeout() and insert a small delay between each polling attempts. In particular, this avoids hogging the CPU. Additionally, to convert to read_poll_timeout() we also need to switch from using a specific number of polling attempts, into a specific timeout in us instead. The previous 100000 attempts, is translated into a total timeout of total 1s, as that seemed like reasonable value to pick. Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200508095218.14177-1-ulf.hansson@linaro.org commit eadb7897652d5bf9fbab393b3774598a04846aff Author: Ulf Hansson Date: Fri May 8 11:52:10 2020 +0200 mmc: sdricoh_cs: Throttle polling rate for data transfers Rather than to poll in a busy-loop, let's convert into using read_poll_timeout() and insert a small delay between each polling attempts. In particular, this avoids hogging the CPU. Additionally, to convert to read_poll_timeout() we also need to switch from using a specific number of polling attempts, into a specific timeout in us instead. The previous 100000 attempts, is translated into a total timeout of total 1s, as that seemed like reasonable value to pick. Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200508095210.14123-1-ulf.hansson@linaro.org commit 85a3f77c1be5ee143615e47f98f653d65806b8ae Author: Ulf Hansson Date: Tue Apr 14 18:14:00 2020 +0200 mmc: cb710: Inform the mmc core about the maximum busy timeout Some commands uses R1B responses, which means the card may assert the DAT0 line to signal busy for a period of time, after it has received the command. The mmc core normally specifies the busy period for the command in the cmd->busy_timeout. Ideally the driver should respect it, but that requires quite some update of the code, so let's defer that to someone with the HW at hand. Instead, let's inform the mmc core about the maximum supported busy timeout in ->max_busy_timeout during ->probe(). This value corresponds to the fixed ~2s timeout of the polling loop, implemented in cb710_wait_for_event(). In this way, we let the mmc core validate the needed timeout, which may lead to that it converts from a R1B into a R1 response and then use CMD13 to poll for busy completion. In other words, this change enables support for commands with longer busy periods than 2s, like erase (CMD38) for example. Cc: Michał Mirosław Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-7-ulf.hansson@linaro.org commit f4f20d6897b1c047c5d38b2cfc50928e83d8fd83 Author: Gustavo A. R. Silva Date: Thu May 7 14:22:18 2020 -0500 memstick: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507192218.GA16315@embeddedor Signed-off-by: Ulf Hansson commit 91995b904ec2e44b5c159ac6a5d3f154345a4de7 Author: Martin Blumenstingl Date: Mon May 4 00:28:05 2020 +0200 mmc: meson-mx-sdio: trigger a soft reset after a timeout or CRC error The vendor driver (from the 3.10 kernel) triggers a soft reset every time before starting a new command. While this fixes a problem where SDIO cards are not detected at all (because all commands simply timed out) this hurts SD card read performance a bit (in my tests between 10% to 20%). Trigger a soft reset after we got a CRC error or if the previous command timed out (just like the vendor driver from the same 3.10 kernel for the newer SDHC controller IP does). This fixes detection of SDIO cards and doesn't hurt SD card read performance at the same time. With this patch the initialization of an RTL8723BS SDIO card looks like this: req done (CMD52): -110: 00000000 00000000 00000000 00000000 clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 1 timing 0 starting CMD0 arg 00000000 flags 000000c0 req done (CMD0): 0: 00000000 00000000 00000000 00000000 clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 0 starting CMD8 arg 000001aa flags 000002f5 req done (CMD8): -110: 00000000 00000000 00000000 00000000 starting CMD5 arg 00000000 flags 000002e1 req done (CMD5): 0: 90ff0000 00000000 00000000 00000000 starting CMD5 arg 00200000 flags 000002e1 req done (CMD5): 0: 90ff0000 00000000 00000000 00000000 starting CMD3 arg 00000000 flags 00000075 req done (CMD3): 0: 00010000 00000000 00000000 00000000 starting CMD7 arg 00010000 flags 00000015 req done (CMD7): 0: 00001e00 00000000 00000000 00000000 starting CMD52 arg 00000000 flags 00000195 req done (CMD52): 0: 00001032 00000000 00000000 00000000 [... more CMD52 omitted ...] clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 2 clock 50000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 2 starting CMD52 arg 00000e00 flags 00000195 req done (CMD52): 0: 00001000 00000000 00000000 00000000 starting CMD52 arg 80000e02 flags 00000195 req done (CMD52): 0: 00001002 00000000 00000000 00000000 clock 50000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 4 timing 2 starting CMD52 arg 00020000 flags 00000195 req done (CMD52): 0: 00001007 00000000 00000000 00000000 [... more CMD52 omitted ...] new high speed SDIO card at address 0001 Fixes: ed80a13bb4c4c9 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs") Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200503222805.2668941-1-martin.blumenstingl@googlemail.com Tested-by: Tobias Baumann <017623705678@o2online.de> Signed-off-by: Ulf Hansson commit 194f9b21ad64740eb9675703037fe42113cea65c Author: Lad Prabhakar Date: Wed May 6 20:51:27 2020 +0100 dt-bindings: mmc: renesas,mmcif: Document r8a7742 DT bindings Add support for r8a7742 SoC. Renesas RZ/G1H (R8A7742) MMCIF is identical to the R-Car Gen2 family. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1588794695-27852-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Ulf Hansson commit 30e1028dcef9ac981c20df83983e0e77a4df2dc4 Author: Wolfram Sang Date: Sat May 2 16:28:25 2020 +0200 mmc: sdhci-esdhc: update contact email The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: Wolfram Sang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200502142840.19418-1-wsa@kernel.org Signed-off-by: Ulf Hansson commit 064f7e58ee42372be05ec87fdf57864c7475ba93 Author: Krishna Konda Date: Fri May 1 19:23:01 2020 +0530 mmc: core: expose info about enhanced rpmb support Following eMMC JEDEC JESD84-B51 standard, an enhanced form of rpmb is supported. What this enhanced mode supports is in addition to be able to write one rpmb or two rpmb frames at a time, 32 frames can be written at a time. Expose this information present in ext csd field so that the user space application that wants to make use of this can do so. Signed-off-by: Krishna Konda Signed-off-by: Veerabhadrarao Badiganti Link: https://lore.kernel.org/r/1588341189-4371-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson commit 1dc5a61559e73472cd84bc8aa5b297ec0deba4de Author: Ulf Hansson Date: Thu Apr 30 11:16:40 2020 +0200 mmc: sdio: Align the initialization commands in retry path for UHS-I According to the comment in mmc_sdio_reinit_card(), some SDIO cards may require a "[CMD5,5,3,7] init sequence", which isn't always obeyed in mmc_sdio_init_card(). Especially, when we end up retrying the UHS-I specific initialization, there is a missing CMD5. Let's update the code to make the behaviour consistent and let's also take the opportunity to clean up the code a bit, to avoid open coding. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200430091640.455-5-ulf.hansson@linaro.org commit fa1e3191922bb6b59a64a1a03e461cde07ae1e62 Author: Ulf Hansson Date: Thu Apr 30 11:16:39 2020 +0200 mmc: sdio: Re-use negotiated OCR mask when re-sending CMD8 While initializing an SDIO card in mmc_sdio_init_card(), we may need to retry the UHS-I specific initialization, in case the first attempt fails. This leads to resending a CMD8, but also to restart from scratch with the so called OCR mask negotiations. This is unnecessary as we already have a negotiated OCR mask, so let's use that instead. In this way, the behaviour also becomes more consistent with other similar paths. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200430091640.455-4-ulf.hansson@linaro.org commit a94a59f43749b4f8cd81b8be87c95f9ef898d19d Author: Ulf Hansson Date: Thu Apr 30 11:16:38 2020 +0200 mmc: sdio: Fix several potential memory leaks in mmc_sdio_init_card() Over the years, the code in mmc_sdio_init_card() has grown to become quite messy. Unfortunate this has also lead to that several paths are leaking memory in form of an allocated struct mmc_card, which includes additional data, such as initialized struct device for example. Unfortunate, it's a too complex task find each offending commit. Therefore, this change fixes all memory leaks at once. Cc: Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200430091640.455-3-ulf.hansson@linaro.org commit f04086c225da11ad16d7f9a2fbca6483ab16dded Author: Ulf Hansson Date: Thu Apr 30 11:16:37 2020 +0200 mmc: sdio: Fix potential NULL pointer error in mmc_sdio_init_card() During some scenarios mmc_sdio_init_card() runs a retry path for the UHS-I specific initialization, which leads to removal of the previously allocated card. A new card is then re-allocated while retrying. However, in one of the corresponding error paths we may end up to remove an already removed card, which likely leads to a NULL pointer exception. So, let's fix this. Fixes: 5fc3d80ef496 ("mmc: sdio: don't use rocr to check if the card could support UHS mode") Cc: Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200430091640.455-2-ulf.hansson@linaro.org commit c2b613d03b060993be71b480a3ebb6156604d658 Author: Rajendra Nayak Date: Tue Apr 28 19:02:57 2020 +0530 mmc: sdhci-msm: Fix error handling for dev_pm_opp_of_add_table() Even though specifying OPP's in device tree is optional, ignoring all errors reported by dev_pm_opp_of_add_table() means we can't distinguish between a missing OPP table and a wrong/buggy OPP table. While missing OPP table (dev_pm_opp_of_add_table() returns a -ENODEV in such case) can be ignored, a wrong/buggy OPP table in device tree should make the driver error out. while we fix that, lets also fix the variable names for opp/opp_table to avoid confusion and name them opp_table/has_opp_table instead. Suggested-by: Matthias Kaehlcke Signed-off-by: Rajendra Nayak Link: https://lore.kernel.org/r/1588080785-6812-10-git-send-email-rnayak@codeaurora.org Signed-off-by: Ulf Hansson commit a38c078fea0b1393fd2acb50e91057d7e429d9aa Author: Takeshi Saito Date: Thu Apr 23 15:04:32 2020 +0200 mmc: renesas_sdhi: Avoid bad TAP in HS400 With R-Car Gen3, CRC error occue at the following TAPs. H3, M3W 1.3, M3N... TAP=2,3,6,7 M3W 3.0 ... TAP=1,3,5,7 (Note: for 4tap SoCs, the numbers get divided by 2) Do not use these TAPs in HS400, and also don't use auto correction but manual correction. We check for bad taps in two places: 1) After tuning HS400: Then, we select a neighbouring TAP. One of them must be good, because there are never three bad taps in a row. Retuning won't help because we just finished tuning. 2) After a manual correction request: Here, we can't switch to the requested TAP. But we can retune (if the HS200 tuning was good) because the environment might have changed since the last tuning. If not, we stay on the same TAP. Signed-off-by: Takeshi Saito [wsa: refactored to match upstream driver, reworded commit msg] Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20200423130432.9990-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit f583da4013a7e694fb0c3c5916537a72989e82a3 Author: Wolfram Sang Date: Thu Apr 23 15:04:31 2020 +0200 mmc: renesas_sdhi: handle M3-W ES1.2 and 1.3 revisions For ES1.2, add a comment explaining the situation. For ES1.3 (and later, although unlikely), add a new entry defining it as 4tap. Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20200423130432.9990-2-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 5671ad667ebbe5e2aef77a89c775e9623b6bf4b8 Author: Ulf Hansson Date: Tue Apr 14 18:14:12 2020 +0200 mmc: mmc_spi: Respect the cmd->busy_timeout from the mmc core Using a fixed 3s polling timeout for all commands with R1B responses is a bit problematic. For some commands it means waiting longer than needed for the polling to be aborted, which may not a big issue, but still. For other commands, like for an erase (CMD38), may require longer timeouts than 3s. In these cases, we may end up treating the command as it failed, while it just needed some more time to complete successfully. Fix the problem by respecting the cmd->busy_timeout, which is provided by the mmc core. Cc: Jonathan Neuschäfer Cc: Linus Walleij Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-19-ulf.hansson@linaro.org commit 78a67b9224ade6da7d2d83c23a9858cb4dfcd64a Author: Ulf Hansson Date: Tue Apr 14 18:14:11 2020 +0200 mmc: mmc_spi: Add/rename defines for timeouts Clarify the use of r1b_timeout, by renaming it to MMC_SPI_R1B_TIMEOUT_MS and by dropping the corresponding confusing comment about it. Additionally, let's also add a new define, MMC_SPI_INIT_TIMEOUT_MS and use it during the initialization. Even if these two defines are given the same value, the split makes it easier to understand them. Cc: Jonathan Neuschäfer Cc: Linus Walleij Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-18-ulf.hansson@linaro.org commit 966244ccd2919e28f25555a77f204cd1c109cad8 Author: Ulf Hansson Date: Tue Apr 14 18:14:10 2020 +0200 mmc: via-sdmmc: Respect the cmd->busy_timeout from the mmc core Using a fixed 1s timeout for all commands (and data transfers) is a bit problematic. For some commands it means waiting longer than needed for the timer to expire, which may not a big issue, but still. For other commands, like for an erase (CMD38) that uses a R1B response, may require longer timeouts than 1s. In these cases, we may end up treating the command as it failed, while it just needed some more time to complete successfully. Fix the problem by respecting the cmd->busy_timeout, which is provided by the mmc core. Cc: Bruce Chang Cc: Harald Welte Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-17-ulf.hansson@linaro.org commit 0b05c9770501e949887abfe1c31c571e946eab64 Author: Ulf Hansson Date: Tue Apr 14 18:14:09 2020 +0200 mmc: tifm_sd: Inform the mmc core about the maximum busy timeout Some commands uses R1B responses, which means the card may assert the DAT0 line to signal busy for a period of time, after it has received the command. The mmc core normally specifies the busy period for the command in the cmd->busy_timeout. Ideally the driver should respect it, but that requires quite some update of the code, so let's defer that to someone with the HW at hand. Instead, let's inform the mmc core about the maximum supported busy timeout in ->max_busy_timeout during ->probe(). This value corresponds to the fixed 1s timeout used by tifm_sd. In this way, we let the mmc core validate the needed timeout, which may lead to that it converts from a R1B into a R1 response and then use CMD13 to poll for busy completion. In other words, this change enables support for commands with longer busy periods than 1s, like erase (CMD38) for example. Cc: Alex Dubov Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-16-ulf.hansson@linaro.org commit 6ccff65a29459fbc251f471ae4e20af425b2f0b1 Author: Ulf Hansson Date: Tue Apr 14 18:14:05 2020 +0200 mmc: sdricoh_cs: Drop redundant in-parameter to sdricoh_query_status() The in-parameter timeout is always set to TRANSFER_TIMEOUT by the callers of sdricoh_query_status(), hence let's drop it. Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-12-ulf.hansson@linaro.org commit 4b4c7daec4f92327e321d22347076a7e4d8320b0 Author: Ulf Hansson Date: Tue Apr 14 18:14:04 2020 +0200 mmc: sdricoh_cs: Move MMC_APP_CMD handling to sdricoh_mmc_cmd() Move MMC_APP_CMD specific handling to be managed by sdricoh_mmc_cmd(), as this makes the code a bit cleaner. Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-11-ulf.hansson@linaro.org commit cfa2c1dc7bb43cf3d00f27ec90022f6fb8f0bf42 Author: Ulf Hansson Date: Tue Apr 14 18:14:03 2020 +0200 mmc: sdricoh_cs: Use MMC_APP_CMD rather than a hardcoded number Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-10-ulf.hansson@linaro.org commit 710c7ff9a6815ca565b6acb08501ad18ca151429 Author: Ulf Hansson Date: Tue Apr 14 18:14:02 2020 +0200 mmc: sdricoh_cs: Drop unused defines Cc: Sascha Sommer Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-9-ulf.hansson@linaro.org commit f37ac1ae3ca93d0995553ad9604a25eadfe9406d Author: Ulf Hansson Date: Tue Apr 14 18:14:01 2020 +0200 mmc: owl-mmc: Respect the cmd->busy_timeout from the mmc core For commands that doesn't involve to prepare a data transfer, owl-mmc is using a fixed 30s response timeout. This is a bit problematic. For some commands it means waiting longer than needed for the completion to expire, which may not a big issue, but still. For other commands, like for an erase (CMD38) that uses a R1B response, may require longer timeouts than 30s. In these cases, we may end up treating the command as it failed, while it just needed some more time to complete successfully. Fix the problem by respecting the cmd->busy_timeout, which is provided by the mmc core. Cc: Manivannan Sadhasivam Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-8-ulf.hansson@linaro.org commit d422f8b9ed4e470214477239066ae8f8f3f7fa6d Author: Ulf Hansson Date: Tue Apr 14 18:13:58 2020 +0200 mmc: jz4740: Inform the mmc core about the maximum busy timeout Some commands uses R1B responses, which means the card may assert the DAT0 line to signal busy for a period of time, after it has received the command. The mmc core normally specifies the busy period for the command in the cmd->busy_timeout. Ideally the driver should respect it, but that requires quite some update of the code, so let's defer that to someone with the HW at hand. Instead, let's inform the mmc core about the maximum supported busy timeout in ->max_busy_timeout during ->probe(). This value corresponds to the fixed 5s timeout used by jz4740. In this way, we let the mmc core validate the needed timeout, which may lead to that it converts from a R1B into a R1 response and then use CMD13 to poll for busy completion. In other words, this change enables support for commands with longer busy periods than 5s, like erase (CMD38) for example. Cc: Paul Cercueil Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200414161413.3036-5-ulf.hansson@linaro.org commit 580b946ed030e6c148842e1981a75dbf5720efd5 Author: Zou Wei Date: Thu Apr 23 14:43:19 2020 +0800 mmc: sdhci-pci-o2micro: Make some symbols static Fix the following sparse warning: drivers/mmc/host/sdhci-pci-o2micro.c:497:6: warning: symbol 'sdhci_pci_o2_set_clock' was not declared. Should it be static? drivers/mmc/host/sdhci-pci-o2micro.c:512:5: warning: symbol 'sdhci_pci_o2_probe_slot' was not declared. Should it be static? drivers/mmc/host/sdhci-pci-o2micro.c:581:5: warning: symbol 'sdhci_pci_o2_probe' was not declared. Should it be static? drivers/mmc/host/sdhci-pci-o2micro.c:786:5: warning: symbol 'sdhci_pci_o2_resume' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1587624199-96926-1-git-send-email-zou_wei@huawei.com Signed-off-by: Ulf Hansson commit 43170255321f83d8e8a3964f70040c49b3d19df0 Author: Zou Wei Date: Thu Apr 23 17:15:19 2020 +0800 mmc: core: Use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE Fixes coccicheck warning: drivers/mmc/core/debugfs.c:222:0-23: WARNING: mmc_clock_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files Fixes: 703aae3d09a4b ("mmc: add a file to debugfs for changing host clock at runtime") Fixes: a04c50aaa916f ("mmc: core: no need to check return value of debugfs_create functions") Reported-by: Hulk Robot Signed-off-by: Zou Wei Link: https://lore.kernel.org/r/1587633319-19835-1-git-send-email-zou_wei@huawei.com Signed-off-by: Ulf Hansson commit ca2d13ec6ee9c3d7edc6563dc753f891521f791b Author: Masahiro Yamada Date: Thu Apr 23 00:34:01 2020 +0900 mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK If sdhci-of-at91.c is compiled without CONFIG_HAVE_CLK, the line caps1 |= FIELD_PREP(SDHCI_CLOCK_MUL_MASK, clk_mul); ... emits "FIELD_PREP: value too large for the field" warning. The compiler seems to decide clk_mul is constant (unsigned int)-1, because clk_get_rate() returns 0 when CONFIG_HAVE_CLK is disabled. Add HAVE_CLK to the depenency since this driver does not work without the clock APIs anyway. Reported-by: Randy Dunlap Suggested-by: Adrian Hunter Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20200422153401.7913-1-yamada.masahiro@socionext.com Signed-off-by: Ulf Hansson Acked-by: Randy Dunlap # build-tested commit 74f6bdb864f2235effa3af587c6c90c6eb5f21d3 Author: Wolfram Sang Date: Mon Apr 20 19:02:30 2020 +0200 mmc: renesas_sdhi: shorten types after refactorization After TAP refactorization, we can use 'unsigned int' for two more variables because all the calculations work on this type now. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20200420170230.9091-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 33ba6fec0012e47f4e72bfab922b99327373f210 Author: Ludovic Barre Date: Mon Apr 20 18:18:31 2020 +0200 mmc: mmci_sdmmc: fix power on issue due to pwr_reg initialization This patch fix a power-on issue, and avoid to retry the power sequence. In power off sequence: sdmmc must set pwr_reg in "power-cycle" state (value 0x2), to prevent the card from being supplied through the signal lines (all the lines are driven low). In power on sequence: when the power is stable, sdmmc must set pwr_reg in "power-off" state (value 0x0) to drive all signal to high before to set "power-on". To avoid writing the same value to the power register several times, this register is cached by the pwr_reg variable. At probe pwr_reg is initialized to 0 by kzalloc of mmc_alloc_host. Like pwr_reg value is 0 at probing, the power on sequence fail because the "power-off" state is not writes (value 0x0) and the lines remain drive to low. This patch initializes "pwr_reg" variable with power register value. This it done in sdmmc variant init to not disturb default mmci behavior. Signed-off-by: Ludovic Barre Link: https://lore.kernel.org/r/20200420161831.5043-1-ludovic.barre@st.com Signed-off-by: Ulf Hansson commit 0472f8d3c054a0ff58122fc9d2dbf84f197a284f Author: Rajendra Nayak Date: Fri Apr 17 19:34:31 2020 +0530 mmc: sdhci-msm: Use OPP API to set clk/perf state On some qualcomm SoCs we need to vote on a performance state of a power domain depending on the clock rates. Hence move to using OPP api to set the clock rate and performance state specified in the OPP table. On platforms without an OPP table, dev_pm_opp_set_rate() is eqvivalent to clk_set_rate() Signed-off-by: Rajendra Nayak Link: https://lore.kernel.org/r/1587132279-27659-10-git-send-email-rnayak@codeaurora.org Signed-off-by: Ulf Hansson commit a389087ee9f195fcf2f31cd771e9ec5f02c16650 Author: Ulf Hansson Date: Tue Apr 14 18:14:13 2020 +0200 staging: greybus: sdio: Respect the cmd->busy_timeout from the mmc core Using a fixed 1s timeout for all commands is a bit problematic. For some commands it means waiting longer than needed for the timeout to expire, which may not a big issue, but still. For other commands, like for an erase (CMD38) that uses a R1B response, may require longer timeouts than 1s. In these cases, we may end up treating the command as it failed, while it just needed some more time to complete successfully. Fix the problem by respecting the cmd->busy_timeout, which is provided by the mmc core. Cc: Rui Miguel Silva Cc: Johan Hovold Cc: Alex Elder Cc: Greg Kroah-Hartman Cc: greybus-dev@lists.linaro.org Signed-off-by: Ulf Hansson Acked-by: Rui Miguel Silva Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20200414161413.3036-20-ulf.hansson@linaro.org Signed-off-by: Ulf Hansson commit 4c2e04d728046d693fa1ef60ca38aedd382bc0e3 Author: Ulf Hansson Date: Tue Apr 14 18:13:59 2020 +0200 mmc: usdhi6rol0: Inform the mmc core about the maximum busy timeout Some commands uses R1B responses, which means the card may assert the DAT0 line to signal busy for a period of time, after it has received the command. The mmc core normally specifies the busy period for the command in the cmd->busy_timeout. Ideally the driver should respect it, but that requires quite some update of the code, so let's defer that to someone with the HW at hand. Instead, let's inform the mmc core about the maximum supported busy timeout in ->max_busy_timeout during ->probe(). This value corresponds to the fixed 4s timeout used by usdhi6rol0. In this way, we let the mmc core validate the needed timeout, which may lead to that it converts from a R1B into a R1 response and then use CMD13 to poll for busy completion. In other words, this change enables support for commands with longer busy periods than 4s, like erase (CMD38) for example. Cc: Jesper Nilsson Cc: Lars Persson Signed-off-by: Ulf Hansson Acked-by: Jesper Nilsson Link: https://lore.kernel.org/r/20200414161413.3036-6-ulf.hansson@linaro.org Signed-off-by: Ulf Hansson commit ef5053bdf5b64db714f3e8ee8fc9a6e37116365c Author: Ulf Hansson Date: Tue Apr 14 18:13:57 2020 +0200 mmc: atmel-mci: Respect the cmd->busy_timeout from the mmc core Using a fixed 2s timeout for all commands is a bit problematic. For some commands it means waiting longer than needed for the timer to expire, which may not a big issue, but still. For other commands, like for an erase (CMD38) that uses a R1B response, may require longer timeouts than 2s. In these cases, we may end up treating the command as it failed, while it just needed some more time to complete successfully. Fix the problem by respecting the cmd->busy_timeout, which is provided by the mmc core. Cc: Ludovic Desroches Cc: Nicolas Ferre Signed-off-by: Ulf Hansson Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200414161413.3036-4-ulf.hansson@linaro.org Signed-off-by: Ulf Hansson commit ab5d94f73bcbbcd85959b4db948cc3d37255c23c Author: Ulf Hansson Date: Tue Apr 14 18:13:56 2020 +0200 mmc: atmel-mci: Set the timer per command rather than per request Setting the timer on a per request basis, is rather limiting as the timer really depends on what commands that is to be sent as part of the request. Therefore improve the behaviour by programming the timer per command basis instead. Cc: Ludovic Desroches Cc: Nicolas Ferre Signed-off-by: Ulf Hansson Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200414161413.3036-3-ulf.hansson@linaro.org Signed-off-by: Ulf Hansson commit 740e6499324dcf71bd4e6d4242ae008135ab8397 Author: Ulf Hansson Date: Tue Apr 14 18:13:55 2020 +0200 mmc: atmel-mci: Keep timer enabled when queuing a next request When atmci_request_end() is about to finish a request for one slot, there is a possibility that there is new request queued for another slot. If this turns out to be the case, the new request is started and the timer is re-programmed for it. Although, a few lines below in atmci_request_end(), this timer becomes deleted, likely corresponding to the other recently completed request. This looks wrong, so let's fix it. Cc: Ludovic Desroches Cc: Nicolas Ferre Signed-off-by: Ulf Hansson Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200414161413.3036-2-ulf.hansson@linaro.org Signed-off-by: Ulf Hansson commit 946932d91da14cfe2a0522c9bc9317c2db60a280 Author: Veerabhadrarao Badiganti Date: Mon Apr 20 11:50:25 2020 +0530 mmc: sdhci-msm: Enable ADMA length mismatch error interrupt ADMA_ERR_SIZE_EN bit of VENDOR_SPECIFIC_FUNC register controls ADMA length mismatch error interrupt. Enable it by default. And update all bit shift defines with BIT macro. Signed-off-by: Veerabhadrarao Badiganti Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1587363626-20413-4-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson commit d863cb03fb2aac07f017b2a1d923cdbc35021280 Author: Veerabhadrarao Badiganti Date: Mon Apr 20 11:50:24 2020 +0530 mmc: sdhci-msm: Set SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 quirk sdhci-msm can support auto cmd12. So enable SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 quirk. Signed-off-by: Veerabhadrarao Badiganti Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1587363626-20413-3-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson commit 49769d4d350ddf3a25eb722019964b5e16b3efdc Author: Haibo Chen Date: Wed Apr 15 17:00:55 2020 +0800 mmc: sdhci: add spin lock for sdhci_set_default_irqs in sdhci_init When use one SDIO wifi which enable the runtime PM feature on i.MX6SX, we meet system hang. This hang happened during the usdhc runtime resume, in sdhci_init(), when call the sdhci_set_default_irqs. One interrupt (SDHCI_INT_CARD_INT) triggered just after the host->ier update and before the write of register SDHCI_SIGNAL_ENABLE. So in sdhci_irq, it will skip the call of sdio_signal_irq() because current host->ier do not set the SDHCI_INT_CARD_INT. So this SDIO wifi interrupt always keep triggered, let the system stuck in irq handle, can't response any other thread. This patch add spin lock for the sdhci_set_default_irqs to fix this issue. Signed-off-by: Haibo Chen Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1586941255-9237-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 61ab64e2f54f4c607428667f83f411cb659843a3 Author: Baolin Wang Date: Mon Apr 13 10:46:05 2020 +0800 mmc: host: sdhci-sprd: Implement the request_atomic() API Implement the request_atomic() API for nonremovable cards, that means we can submit next request in the irq hard handler context to reduce latency. Moreover factor out the AUTO CMD23 checking into a separate function to reduce duplicate code. Signed-off-by: Baolin Wang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/60142fe6c6c1dbba2696e775564ae2166786f0bc.1586744073.git.baolin.wang7@gmail.com Signed-off-by: Ulf Hansson commit 48ef8a2a1e5e6a2a189009e880e341ddb452971d Author: Baolin Wang Date: Mon Apr 13 10:46:04 2020 +0800 mmc: host: sdhci: Implement the request_atomic() API Implement the request_atomic() ops for the sdhci driver to process one request in the atomic context if the card is nonremovable. Moreover, we should return BUSY flag if controller has not released the inhibit bits to allow HSQ trying to send request again in non-atomic context. Suggested-by: Adrian Hunter Signed-off-by: Baolin Wang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/9ed34afa9fb42e0c234065cac5401d7826942b55.1586744073.git.baolin.wang7@gmail.com Signed-off-by: Ulf Hansson commit 6db96e5810e0a6a345b7d78549de7676ae5b2662 Author: Baolin Wang Date: Mon Apr 13 10:46:03 2020 +0800 mmc: host: Introduce the request_atomic() for the host The SD host controller can process one request in the atomic context if the card is nonremovable, which means we can submit next request in the irq hard handler when using the MMC host software queue to reduce the latency. Thus this patch adds a new API request_atomic() for the host controller, as well as adding support for host software queue to submit a request by the new request_atomic() API. Moreover there is an unusual case that the card is busy when trying to send a command, and we can not polling the card status in interrupt context by using request_atomic() to dispatch requests. Thus we should queue a work to try again in the non-atomic context in case the host releases the busy signal later. Suggested-by: Adrian Hunter Acked-by: Adrian Hunter Signed-off-by: Baolin Wang Link: https://lore.kernel.org/r/a344e27e506cb2329073cbd5cf65e15cc3cbeba9.1586744073.git.baolin.wang7@gmail.com Signed-off-by: Ulf Hansson commit 845c939ee22943786a6eb1d13d03c77b19fcc2c8 Author: Adrian Hunter Date: Sun Apr 12 12:03:49 2020 +0300 mmc: sdhci: Reduce maximum time under spinlock in sdhci_send_command() Spending time under spinlock increases IRQ latencies and also response times because preemption is disabled. sdhci_send_command() waits up to 10 ms under spinlock for inhibit bits to clear. In general inhibit bits will not be set, but there may be corner cases, especially in the face of errors, where waiting helps. There might also be dysfunctional hardware that needs the waiting. So retain the legacy behaviour but do not wait for inhibit bits while under spinlock. Instead adjust the logic to enable waiting while not under spinlock. That is mostly straight forward, but in the interrupt handler it requires deferring an "inhibited" command to the IRQ thread where sleeping is allowed. Signed-off-by: Adrian Hunter Tested-by: Baolin Wang Link: https://lore.kernel.org/r/20200412090349.1607-6-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit e872f1e22ea5f678ae42812949477387fda6725b Author: Adrian Hunter Date: Sun Apr 12 12:03:48 2020 +0300 mmc: sdhci: Tidy sdhci_request() a bit In preparation for further changes, tidy sdhci_request() a bit. Signed-off-by: Adrian Hunter Tested-by: Baolin Wang Link: https://lore.kernel.org/r/20200412090349.1607-5-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 98a2642f91a47dcd1215d037c14e0e5de33a247d Author: Adrian Hunter Date: Sun Apr 12 12:03:47 2020 +0300 mmc: sdhci: Remove unneeded forward declaration of sdhci_finish_data() sdhci_finish_data() is defined before it is referenced, so forward declaration is not necessary. Signed-off-by: Adrian Hunter Tested-by: Baolin Wang Link: https://lore.kernel.org/r/20200412090349.1607-4-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit a374a72baa817388a04825118b7c1ba13064c8c6 Author: Adrian Hunter Date: Sun Apr 12 12:03:46 2020 +0300 mmc: sdhci: Stop exporting sdhci_send_command() sdhci_send_command() has not been used outside of sdhci.c for many years. Stop exporting it. Signed-off-by: Adrian Hunter Tested-by: Baolin Wang Link: https://lore.kernel.org/r/20200412090349.1607-3-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit ed6330330276cba39058e8dbdb28ab8d013d926e Author: Adrian Hunter Date: Sun Apr 12 12:03:45 2020 +0300 mmc: sdhci: Add helpers for the auto-CMD23 flag Add 2 helper functions to make the use of the auto-CMD23 flag more readable. Signed-off-by: Adrian Hunter Tested-by: Baolin Wang Link: https://lore.kernel.org/r/20200412090349.1607-2-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 9d624f4f6df5d358b5ab7eb99ef3ae5e2f091f0c Author: Jisheng Zhang Date: Fri Apr 10 14:57:12 2020 +0800 mmc: sd: use HIGH_SPEED_BUS_SPEED in mmc_sd_switch_hs() Use the well defined HIGH_SPEED_BUS_SPEED macro in mmc_sd_switch_hs() to make code more readable. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20200410145643.630b0731@xhacker.debian Signed-off-by: Ulf Hansson commit 3e09a81e166c0a5544832459be17561a6b231ac7 Author: Marek Vasut Date: Thu Apr 16 18:36:49 2020 +0200 mmc: mmci: Switch to mmc_regulator_set_vqmmc() Instead of reimplementing the logic in mmc_regulator_set_vqmmc(), use the mmc code function directly. This also allows us to fix a related issue on STM32MP1, when a voltage switch of 1.8V is done for the eMMC, but the current level is already set to 1.8V. More precisely, in this scenario the call to the ->post_sig_volt_switch() hangs, indefinitely waiting for the voltage switch to complete. Fix this problem by checking if mmc_regulator_set_vqmmc() returned 1 and then skip invoking the callback. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20200416163649.336967-3-marex@denx.de [Ulf: Updated the commit message] Signed-off-by: Ulf Hansson commit 17a0751e60b123ce1a266155abf72acd936b7ecc Author: Marek Vasut Date: Thu Apr 16 18:36:48 2020 +0200 mmc: core: Return 1 from mmc_regulator_set_vqmmc() if switch skipped Adjust mmc_regulator_set_vqmmc() to return 1 if the voltage switch was skipped because the regulator voltage was already correct. This allows drivers to detect such condition and possibly skip various voltage switching extras. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20200416163649.336967-2-marex@denx.de Signed-off-by: Ulf Hansson commit 9cbe0fc8cd9c156ff187231dbb38b02ee20fc8c6 Author: Marek Vasut Date: Thu Apr 16 18:36:47 2020 +0200 mmc: host: Prepare host drivers for mmc_regulator_set_vqmmc() returning > 0 Patch all drivers which use mmc_regulator_set_vqmmc() and prepare them for the fact that mmc_regulator_set_vqmmc() can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20200416163649.336967-1-marex@denx.de [Ulf: Re-worked/simplified the code a bit] Signed-off-by: Ulf Hansson commit 098c408b040d49158dc6aea52db7493187ac5e09 Author: Nathan Chancellor Date: Thu Apr 16 11:24:02 2020 -0700 mmc: sdhci-of-arasan: Remove uninitialized ret variables Clang warns: drivers/mmc/host/sdhci-of-arasan.c:784:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized] return ret; ^~~ drivers/mmc/host/sdhci-of-arasan.c:738:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 drivers/mmc/host/sdhci-of-arasan.c:860:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized] return ret; ^~~ drivers/mmc/host/sdhci-of-arasan.c:810:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 2 warnings generated. This looks like a copy paste error. Neither function has handling that needs ret so just remove it and return 0 directly. Link: https://github.com/ClangBuiltLinux/linux/issues/996 Reported-by: kernelci.org bot Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20200416182402.16858-1-natechancellor@gmail.com Signed-off-by: Ulf Hansson commit bcf89cb8e0467a6183a4a2a70e71d3c09edfb34a Author: Wolfram Sang Date: Wed Apr 8 16:22:52 2020 +0200 mmc: renesas_sdhi: simplify summary output No need to call platform_get_resource twice when we still have the pointer from before. Also, use '%pa' for a resource_size_t pointer. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20200408142252.21958-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson Reviewed-by: Geert Uytterhoeven commit 5fb6bf51f6d153c188087c7fef21f6a8cd481951 Author: Wolfram Sang Date: Wed Apr 8 11:46:38 2020 +0200 mmc: renesas_sdhi: improve TAP selection if all TAPs are good When tuning HS400, if all TAPS are good, we can utilize the SMPCMP register to select the optimal TAP. For that, we populate a second bitmap with SMPCMP results and query it in case the regular bitmap is full (= all good). Signed-off-by: Masaharu Hayakawa Signed-off-by: Takeshi Saito Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20200408094638.10375-4-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit ec4fc1acf363985882c37278bfe8881c4e0ec121 Author: Wolfram Sang Date: Wed Apr 8 11:46:37 2020 +0200 mmc: renesas_sdhi: clarify handling of selecting TAPs The comment and the define about how TAPs are selected were confusing to me because the good TAP was only valid if it was bigger than a *_MAX_* value. Rename the define and adapt the comment to what really happens. Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20200408094638.10375-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 92fa2a567d520ed71bb810a3b24c6b60f8ef329c Author: Wolfram Sang Date: Wed Apr 8 11:46:36 2020 +0200 mmc: renesas_sdhi: refactor calculation of best TAP To select the best TAP, we need to find the longest stream of set bits in a bit field. There is now a helper function for bitmaps which iterates over all region of set bits. Using it makes the code much more concise and easier to understand. Double so, because we need to handle two bitmaps in the near future. Remove a superfluous comment while here. Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20200408094638.10375-2-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit a8e809ecaeb49fd53bbbed05a8257d35b9858c31 Author: Masahiro Yamada Date: Wed Apr 8 16:21:05 2020 +0900 mmc: sdhci: use FIELD_GET/PREP for capabilities bit masks Use FIELD_GET and FIELD_PREP to get access to the register fields. Delete the shift macros and use GENMASK() for the touched macros. Note that, this has the side-effect of changing the constants to 64-bit on 64-bit platforms. Signed-off-by: Masahiro Yamada Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200408072105.422-2-yamada.masahiro@socionext.com Signed-off-by: Ulf Hansson commit 2941e4ca2057d6ebba1d93ff1930c6e4c18b63fb Author: Masahiro Yamada Date: Wed Apr 8 16:21:04 2020 +0900 mmc: sdhci: move SDHCI_CAPABILITIES_1 to a more suitable place In the SDHCI specification, the Capabilities Register (Offset 0x40h) is the 64-bit width register, but in Linux, it is represented as two registers, SDHCI_CAPABILITIES and SDHCI_CAPABILITIES_1 so that drivers can use 32-bit register accessors. The upper 32-bit field is associated with SDHCI_CAPABILITIES_1. Move the definition of SDHCI_CAPABILITIES_1 to the correct place. Signed-off-by: Masahiro Yamada Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200408072105.422-1-yamada.masahiro@socionext.com Signed-off-by: Ulf Hansson commit 4908460ef16e1a5b7597c2a9871661e827ef8ee7 Author: Manish Narani Date: Mon Apr 6 23:13:35 2020 +0530 mmc: sdhci-of-arasan: Fix kernel-doc warnings Modify code to fix the warnings reported by kernel-doc for better documentation. Signed-off-by: Manish Narani Link: https://lore.kernel.org/r/1586195015-128992-7-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 16ada730a759d693bfa3724767d2b4d61d645222 Author: Manish Narani Date: Mon Apr 6 23:13:34 2020 +0530 mmc: sdhci-of-arasan: Modify clock operations handling The SDHCI clock operations are platform specific. So it better to define them separately for particular platform. This will prevent multiple if..else conditions and will make it easy for user to add their own clock operations handlers. Signed-off-by: Manish Narani Link: https://lore.kernel.org/r/1586195015-128992-6-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 37d3ee7c5dc03944bdcb05d5c654dda3abd31795 Author: Manish Narani Date: Mon Apr 6 23:13:33 2020 +0530 mmc: sdhci-of-arasan: Rearrange the platform data structs for modularity Existing driver code has the platform specific structures scattered throughout the driver code. Rearrange the platform specific data structures for more modularity and readability. This will help in adding new static functions with more ease. Signed-off-by: Manish Narani Link: https://lore.kernel.org/r/1586195015-128992-5-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 19ee441f2cab760921b15df11cb7ea2fb4751567 Author: Manish Narani Date: Mon Apr 6 23:13:32 2020 +0530 mmc: sdhci-of-arasan: Rename sdhci_arasan_data to avoid confusion There is 'struct sdhci_arasan_data' but also 'struct sdhci_arasan_of_data sdhci_arasan_data'. Rename the latter to avoid confusion with the name of the struct. Reported-by: Adrian Hunter Signed-off-by: Manish Narani Link: https://lore.kernel.org/r/1586195015-128992-4-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 1a470721c8f5a73e272fffb590debda5e65a2eaf Author: Manish Narani Date: Mon Apr 6 23:13:31 2020 +0530 sdhci: arasan: Add support for Versal Tap Delays Add support to set tap delays for Xilinx Versal SD controller. The tap delay registers have moved to SD controller space in Versal. Make the changes accordingly. Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1586195015-128992-3-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 1fd7b984f56858e0e4aebbba821c1b1e8693a06c Author: Manish Narani Date: Mon Apr 6 23:13:30 2020 +0530 dt-bindings: mmc: arasan: Document 'xlnx,versal-8.9a' controller Add documentation for 'xlnx,versal-8.9a' SDHCI controller followed by example. Signed-off-by: Manish Narani Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1586195015-128992-2-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson commit 2871ec99ee18ab72f5426bf3082bd5775d4e93c2 Author: Ulf Hansson Date: Thu Apr 9 14:54:22 2020 +0200 mmc: wbsd: Replace hardcoded command numbers with existing defines Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200409125422.21842-1-ulf.hansson@linaro.org commit f51167c010ea848160c01aa90ed172d8f569c27c Author: Ulf Hansson Date: Tue Apr 7 16:39:03 2020 +0200 mmc: s3cmci: Drop redundant code in s3cmci_setup_data() The in-parameter struct mmc_data *data is never NULL, because the caller always provides a valid pointer. Hence drop the corresponding redundant code. Signed-off-by: Ulf Hansson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200407143903.22477-1-ulf.hansson@linaro.org commit 4c3965aa995bd31d0454fa5e20314f1eeead8413 Author: Ulf Hansson Date: Mon Apr 6 13:43:37 2020 +0200 mmc: au1xmmc: Drop redundant code in au1xmmc_send_command() The in-parameter "wait" is always set to 0 by the caller, hence just drop it and its corresponding code. Signed-off-by: Ulf Hansson Acked-by: Manuel Lauss Link: https://lore.kernel.org/r/20200406114337.8802-1-ulf.hansson@linaro.org commit a049b5aeb7449ab41c3894ea8f37ed015507591c Author: Ulf Hansson Date: Mon Apr 6 13:37:24 2020 +0200 mmc: sdhci-sprd: Drop redundant cap flags The MMC_CAP_ERASE and MMC_CAP_CMD23 flags are already being set in the common sdhci_setup_host(). This makes it redundant to set them for sdhci-sprd, so let's drop them. Signed-off-by: Ulf Hansson Reviewed-by: Baolin Wang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200406113724.8504-1-ulf.hansson@linaro.org commit a08373de21b46894df366a29f217df9f5ea35211 Author: Ulf Hansson Date: Wed Apr 1 16:55:31 2020 +0200 mmc: android-goldfish: Enable MMC_CAP2_NO_SDIO Instead of explicitly checking for SDIO specific requests and then returning an error code, let's set MMC_CAP2_NO_SDIO to tell the mmc core to prevent them altogether. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200401145531.23247-1-ulf.hansson@linaro.org commit 1f8db4150536431b031585ecc2a6793f69245de2 Author: Ingo Molnar Date: Thu May 28 11:01:34 2020 +0200 sched/headers: Split out open-coded prototypes into kernel/sched/smp.h Move the prototypes for sched_ttwu_pending() and send_call_function_single_ipi() into the newly created kernel/sched/smp.h header, to make sure they are all the same, and to architectures happy that use -Wmissing-prototypes. Signed-off-by: Ingo Molnar commit 8fc0e48e0faefef5064f3cb803d3d12314e16ec4 Author: Krzysztof Kozlowski Date: Tue May 12 08:41:58 2020 +0200 PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex Instead of warning when mutex_is_locked(), just use the lockdep framework. The code is smaller and checks could be disabled for production environments (it is useful only during development). Put asserts at beginning of function, even before validating arguments. The behavior of update_devfreq() is now changed because lockdep assert will only print a warning, not return with EINVAL. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 48bbf6375131155d329eb8e06ae962e27cbba032 Author: Gustavo A. R. Silva Date: Thu May 7 08:12:45 2020 -0500 PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc(). The proper pointer to be passed as argument to PTR_ERR() is priv->icc_pdev. This bug was detected with the help of Coccinelle. Fixes: 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Dong Aisheng [cw00.choi: Edit the patch title from 'imx' to 'imx-bus'] Signed-off-by: Chanwoo Choi commit a316b5ca9ead8065ac873e655c313248ecd732bc Author: Dmitry Osipenko Date: Thu Feb 27 20:08:54 2020 +0300 PM / devfreq: Replace strncpy with strscpy GCC produces this warning when kernel compiled using `make W=1`: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] 772 | strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN); The strncpy doesn't take care of NULL-termination of the destination buffer, while the strscpy does. Signed-off-by: Dmitry Osipenko Signed-off-by: Chanwoo Choi commit 02355216b4c00b1fe3f1e969aa15eca99240f8f3 Author: Leonard Crestez Date: Mon Apr 6 15:03:08 2020 +0300 PM / devfreq: imx: Register interconnect device There is no single device which can represent the imx interconnect. Instead of adding a virtual one just make the main &noc act as the global interconnect provider. The imx interconnect provider driver will scale the NOC and DDRC based on bandwidth request. More scalable nodes can be added in the future, for example for audio/display/vpu/gpu NICs. Signed-off-by: Leonard Crestez Tested-by: Martin Kepplinger Acked-by: Chanwoo Choi Signed-off-by: Chanwoo Choi commit 5173a9756c8df9c387e04e49da0c4061951bbfec Author: Leonard Crestez Date: Mon Apr 6 15:03:07 2020 +0300 PM / devfreq: Add generic imx bus scaling driver Add initial support for dynamic frequency switching on pieces of the imx interconnect fabric. All this driver does is set a clk rate based on an opp table, it does not map register areas. Signed-off-by: Leonard Crestez Tested-by: Martin Kepplinger Acked-by: Chanwoo Choi Signed-off-by: Chanwoo Choi commit 0716f9fdb3b65b396531e490a42a4f58a69e1c8f Author: Markus Elfring Date: Sat Apr 4 20:34:02 2020 +0200 PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Dmitry Osipenko Signed-off-by: Chanwoo Choi commit d2216ba3ebea8d8864c5094526b8f9302c01021c Author: Dmitry Osipenko Date: Fri Apr 3 01:24:48 2020 +0300 PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting We're taking into account both HW memory-accesses + CPU activity based on current CPU's frequency. For memory-accesses there is a kind of hysteresis in a form of "boosting" which is managed by the tegra30-devfreq driver. If current HW memory activity is higher than activity judged based of the CPU's frequency, then there is no need to schedule cpufreq_update_work because the result of the work will be a NO-OP. And thus, tegra_actmon_cpufreq_contribution() should return 0, meaning that at the moment CPU frequency doesn't contribute anything to the final decision about required memory clock rate. Signed-off-by: Dmitry Osipenko Signed-off-by: Chanwoo Choi commit a148866489fbe243c936fe43e4525d8dbfa0318f Author: Peter Zijlstra Date: Tue May 26 18:11:04 2020 +0200 sched: Replace rq::wake_list The recent commit: 90b5363acd47 ("sched: Clean up scheduler_ipi()") got smp_call_function_single_async() subtly wrong. Even though it will return -EBUSY when trying to re-use a csd, that condition is not atomic and still requires external serialization. The change in ttwu_queue_remote() got this wrong. While on first reading ttwu_queue_remote() has an atomic test-and-set that appears to serialize the use, the matching 'release' is not in the right place to actually guarantee this serialization. The actual race is vs the sched_ttwu_pending() call in the idle loop; that can run the wakeup-list without consuming the CSD. Instead of trying to chain the lists, merge them. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200526161908.129371594@infradead.org commit 126c2092e5c8b28623cb890cd2930aa292410676 Author: Peter Zijlstra Date: Tue May 26 18:11:03 2020 +0200 sched: Add rq::ttwu_pending In preparation of removing rq->wake_list, replace the !list_empty(rq->wake_list) with rq->ttwu_pending. This is not fully equivalent as this new variable is racy. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200526161908.070399698@infradead.org commit 4b44a21dd640b692d4e9b12d3e37c24825f90baa Author: Peter Zijlstra Date: Tue May 26 18:11:02 2020 +0200 irq_work, smp: Allow irq_work on call_single_queue Currently irq_work_queue_on() will issue an unconditional arch_send_call_function_single_ipi() and has the handler do irq_work_run(). This is unfortunate in that it makes the IPI handler look at a second cacheline and it misses the opportunity to avoid the IPI. Instead note that struct irq_work and struct __call_single_data are very similar in layout, so use a few bits in the flags word to encode a type and stick the irq_work on the call_single_queue list. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200526161908.011635912@infradead.org commit b2a02fc43a1f40ef4eb2fb2b06357382608d4d84 Author: Peter Zijlstra Date: Tue May 26 18:11:01 2020 +0200 smp: Optimize send_call_function_single_ipi() Just like the ttwu_queue_remote() IPI, make use of _TIF_POLLING_NRFLAG to avoid sending IPIs to idle CPUs. [ mingo: Fix UP build bug. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200526161907.953304789@infradead.org commit afaa653c564da38c0b34c4baba31e88c46a8764c Author: Peter Zijlstra Date: Tue May 26 18:11:00 2020 +0200 smp: Move irq_work_run() out of flush_smp_call_function_queue() This ensures flush_smp_call_function_queue() is strictly about call_single_queue. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200526161907.895109676@infradead.org commit 52103be07d8b08311955f8c30e535c2dda290cf4 Author: Peter Zijlstra Date: Tue May 26 18:10:59 2020 +0200 smp: Optimize flush_smp_call_function_queue() The call_single_queue can contain (two) different callbacks, synchronous and asynchronous. The current interrupt handler runs them in-order, which means that remote CPUs that are waiting for their synchronous call can be delayed by running asynchronous callbacks. Rework the interrupt handler to first run the synchonous callbacks. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200526161907.836818381@infradead.org commit 19a1f5ec699954d21be10f74ff71c2a7079e99ad Author: Peter Zijlstra Date: Tue May 26 18:10:58 2020 +0200 sched: Fix smp_call_function_single_async() usage for ILB The recent commit: 90b5363acd47 ("sched: Clean up scheduler_ipi()") got smp_call_function_single_async() subtly wrong. Even though it will return -EBUSY when trying to re-use a csd, that condition is not atomic and still requires external serialization. The change in kick_ilb() got this wrong. While on first reading kick_ilb() has an atomic test-and-set that appears to serialize the use, the matching 'release' is not in the right place to actually guarantee this serialization. Rework the nohz_idle_balance() trigger so that the release is in the IPI callback and thus guarantees the required serialization for the CSD. Fixes: 90b5363acd47 ("sched: Clean up scheduler_ipi()") Reported-by: Qian Cai Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Frederic Weisbecker Cc: mgorman@techsingularity.net Link: https://lore.kernel.org/r/20200526161907.778543557@infradead.org commit 58ef57b16d9e91cce1c640a6fe8a21d53a85181d Merge: 498bdcdb949e 806f04e9fd2c Author: Ingo Molnar Date: Thu May 28 10:52:53 2020 +0200 Merge branch 'core/rcu' into sched/core, to pick up dependency We are going to rely on the loosening of RCU callback semantics, introduced by this commit: 806f04e9fd2c: ("rcu: Allow for smp_call_function() running callbacks from idle") Signed-off-by: Ingo Molnar commit 498bdcdb949e879d4a45f415468aef802a3dff4a Merge: 2ebb17717550 18f855e574d9 Author: Ingo Molnar Date: Thu May 28 10:52:37 2020 +0200 Merge branch 'sched/urgent' into sched/core, to pick up fix Signed-off-by: Ingo Molnar commit 806f04e9fd2c6ad1e39bc2dba77155be0e4becde Author: Peter Zijlstra Date: Wed May 27 19:12:36 2020 +0200 rcu: Allow for smp_call_function() running callbacks from idle Current RCU hard relies on smp_call_function() callbacks running from interrupt context. A pending optimization is going to break that, it will allow idle CPUs to run the callbacks from the idle loop. This avoids raising the IPI on the requesting CPU and avoids handling an exception on the receiving CPU. Change rcu_is_cpu_rrupt_from_idle() to also accept task context, provided it is the idle task. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20200527171236.GC706495@hirez.programming.kicks-ass.net commit 19f545b6e07f753c4dc639c2f0ab52345733b6a8 Author: Mike Galbraith Date: Wed May 27 22:11:19 2020 +0200 zram: Use local lock to protect per-CPU data The zcomp driver uses per-CPU compression. The per-CPU data pointer is acquired with get_cpu_ptr() which implicitly disables preemption. It allocates memory inside the preempt disabled region which conflicts with the PREEMPT_RT semantics. Replace the implicit preemption control with an explicit local lock. This allows RT kernels to substitute it with a real per CPU lock, which serializes the access but keeps the code section preemptible. On non RT kernels this maps to preempt_disable() as before, i.e. no functional change. [bigeasy: Use local_lock(), description, drop reordering] Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-8-bigeasy@linutronix.de commit ed19f19256be2949af1ab5634e62178d30a355c2 Author: Sebastian Andrzej Siewior Date: Wed May 27 22:11:18 2020 +0200 zram: Allocate struct zcomp_strm as per-CPU memory zcomp::stream is a per-CPU pointer, pointing to struct zcomp_strm which contains two pointers. Having struct zcomp_strm allocated directly as per-CPU memory would avoid one additional memory allocation and a pointer dereference. This also simplifies the addition of a local_lock to struct zcomp_strm. Allocate zcomp::stream directly as per-CPU memory. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-7-bigeasy@linutronix.de commit 3e92fd7bd2b8418b53cb7304855b8b69bedbe2b4 Author: Mike Galbraith Date: Wed May 27 22:11:17 2020 +0200 connector/cn_proc: Protect send_msg() with a local lock send_msg() disables preemption to avoid out-of-order messages. As the code inside the preempt disabled section acquires regular spinlocks, which are converted to 'sleeping' spinlocks on a PREEMPT_RT kernel and eventually calls into a memory allocator, this conflicts with the RT semantics. Convert it to a local_lock which allows RT kernels to substitute them with a real per CPU lock. On non RT kernels this maps to preempt_disable() as before. No functional change. [bigeasy: Patch description] Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-6-bigeasy@linutronix.de commit fd56200a16c72c7c3ec3e54e06160dfaa5b8dee8 Author: Julia Cartwright Date: Wed May 27 22:11:16 2020 +0200 squashfs: Make use of local lock in multi_cpu decompressor The squashfs multi CPU decompressor makes use of get_cpu_ptr() to acquire a pointer to per-CPU data. get_cpu_ptr() implicitly disables preemption which serializes the access to the per-CPU data. But decompression can take quite some time depending on the size. The observed preempt disabled times in real world scenarios went up to 8ms, causing massive wakeup latencies. This happens on all CPUs as the decompression is fully parallelized. Replace the implicit preemption control with an explicit local lock. This allows RT kernels to substitute it with a real per CPU lock, which serializes the access but keeps the code section preemptible. On non RT kernels this maps to preempt_disable() as before, i.e. no functional change. [ bigeasy: Use local_lock(), patch description] Reported-by: Alexander Stein Signed-off-by: Julia Cartwright Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Tested-by: Alexander Stein Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-5-bigeasy@linutronix.de commit b01b2141999936ac3e4746b7f76c0f204ae4b445 Author: Ingo Molnar Date: Wed May 27 22:11:15 2020 +0200 mm/swap: Use local_lock for protection The various struct pagevec per CPU variables are protected by disabling either preemption or interrupts across the critical sections. Inside these sections spinlocks have to be acquired. These spinlocks are regular spinlock_t types which are converted to "sleeping" spinlocks on PREEMPT_RT enabled kernels. Obviously sleeping locks cannot be acquired in preemption or interrupt disabled sections. local locks provide a trivial way to substitute preempt and interrupt disable instances. On a non PREEMPT_RT enabled kernel local_lock() maps to preempt_disable() and local_lock_irq() to local_irq_disable(). Create lru_rotate_pvecs containing the pagevec and the locallock. Create lru_pvecs containing the remaining pagevecs and the locallock. Add lru_add_drain_cpu_zone() which is used from compact_zone() to avoid exporting the pvec structure. Change the relevant call sites to acquire these locks instead of using preempt_disable() / get_cpu() / get_cpu_var() and local_irq_disable() / local_irq_save(). There is neither a functional change nor a change in the generated binary code for non PREEMPT_RT enabled non-debug kernels. When lockdep is enabled local locks have lockdep maps embedded. These allow lockdep to validate the protections, i.e. inappropriate usage of a preemption only protected sections would result in a lockdep warning while the same problem would not be noticed with a plain preempt_disable() based protection. local locks also improve readability as they provide a named scope for the protections while preempt/interrupt disable are opaque scopeless. Finally local locks allow PREEMPT_RT to substitute them with real locking primitives to ensure the correctness of operation in a fully preemptible kernel. [ bigeasy: Adopted to use local_lock ] Signed-off-by: Ingo Molnar Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-4-bigeasy@linutronix.de commit cfa6705d89b6562f79c40c249f8d94073c4276e4 Author: Sebastian Andrzej Siewior Date: Wed May 27 22:11:14 2020 +0200 radix-tree: Use local_lock for protection The radix-tree and idr preload mechanisms use preempt_disable() to protect the complete operation between xxx_preload() and xxx_preload_end(). As the code inside the preempt disabled section acquires regular spinlocks, which are converted to 'sleeping' spinlocks on a PREEMPT_RT kernel and eventually calls into a memory allocator, this conflicts with the RT semantics. Convert it to a local_lock which allows RT kernels to substitute them with a real per CPU lock. On non RT kernels this maps to preempt_disable() as before, but provides also lockdep coverage of the critical region. No functional change. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-3-bigeasy@linutronix.de commit 91710728d1725de51d06b40674abf6e860d592c7 Author: Thomas Gleixner Date: Wed May 27 22:11:13 2020 +0200 locking: Introduce local_lock() preempt_disable() and local_irq_disable/save() are in principle per CPU big kernel locks. This has several downsides: - The protection scope is unknown - Violation of protection rules is hard to detect by instrumentation - For PREEMPT_RT such sections, unless in low level critical code, can violate the preemptability constraints. To address this PREEMPT_RT introduced the concept of local_locks which are strictly per CPU. The lock operations map to preempt_disable(), local_irq_disable/save() and the enabling counterparts on non RT enabled kernels. If lockdep is enabled local locks gain a lock map which tracks the usage context. This will catch cases where an area is protected by preempt_disable() but the access also happens from interrupt context. local locks have identified quite a few such issues over the years, the most recent example is: b7d5dc21072cd ("random: add a spinlock_t to struct batched_entropy") Aside of the lockdep coverage this also improves code readability as it precisely annotates the protection scope. PREEMPT_RT substitutes these local locks with 'sleeping' spinlocks to protect such sections while maintaining preemtability and CPU locality. local locks can replace: - preempt_enable()/disable() pairs - local_irq_disable/enable() pairs - local_irq_save/restore() pairs They are also used to replace code which implicitly disables preemption like: - get_cpu()/put_cpu() - get_cpu_var()/put_cpu_var() with PREEMPT_RT friendly constructs. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20200527201119.1692513-2-bigeasy@linutronix.de commit 4f470fff6768ed860819aa36d0c8199385364155 Merge: db78538c75e4 9cb1fd0efd19 Author: Ingo Molnar Date: Thu May 28 10:30:40 2020 +0200 Merge tag 'v5.7-rc7' into WIP.locking/core, to refresh the tree Signed-off-by: Ingo Molnar commit bf0ddd104167bfc08a5a169b3669f06c9052c1b0 Author: Azamat H. Hackimov Date: Sun May 24 20:41:29 2020 +0300 Bluetooth: btbcm: Added 003.006.007, changed 001.003.015 Added new Broadcom device BCM4350C5, changed BCM4354A2 to BCM4356A2. Based on Broadcom Windows drivers 001.003.015 should be BCM4356A2. I have user report that firmware name is misplaced (https://github.com/winterheart/broadcom-bt-firmware/issues/3). Signed-off-by: Azamat H. Hackimov Signed-off-by: Marcel Holtmann commit 8191743d5f9a34c0665046937eff262bffdad9a9 Author: Takashi Iwai Date: Wed May 27 08:12:27 2020 +0200 ALSA: usb-audio: Clean up quirk entries with macros Introduced a couple of macros to simplify some quirk entries. Just cosmetic, no functional changes. Link: https://lore.kernel.org/r/20200527061227.24915-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6d2848402619f33895e419430ad43a223c4866fc Merge: e0b2db351bc7 630e36126e42 Author: Takashi Iwai Date: Thu May 28 10:08:46 2020 +0200 Merge branch 'for-linus' into for-next Back-merge 5.7-devel branch for further development. Signed-off-by: Takashi Iwai commit 8a2644d5f3608822925c9204a3d19a8e3025fd4a Author: Sascha Hauer Date: Fri Apr 24 08:56:26 2020 +0200 mtd: spi-nor: Add support for Cypress cy15x104q The Cypress cy15b104q and cy15v104q are 4Mbit serial SPI F-RAM devices. Add support for them to the spi-nor driver. The actual Device ID of this chip is 7f 7f 7f 7f 7f 7f c2 2c 04. That is six times the continuation code 7f followed by c2 for Ramtron. Unfortunately the chip sends the Device ID in reversed order, so the continuation code is not at the beginning, but instead at the end. Even more unfortunate is that when reading further the chip sends more 7f codes which means we are not even able to count the continuation codes. We can only hope that this reversed Device ID will never match any other devices ID. Collisions are improbable as of now, the solution from above is good enough. In case of future collisions one can introduce an INFO9 macro, with the downsize that struct flash_info would grow and we have lots of flashes. A more elegant solution would be to introduce dedicated flash ID tables for each bank in JESP106BA. Signed-off-by: Sascha Hauer [tudor.ambarus@microchip.com: amend commit description with possible future solutions in case collisions occur.] Signed-off-by: Tudor Ambarus commit 1ac71ec0130cce5bed3ec11ffc88651097a24173 Author: Tudor Ambarus Date: Tue Apr 28 08:47:43 2020 +0000 mtd: spi-nor: Fix SPI NOR acronym The correct terminology is serial NOR flash or SPI NOR. s/SPI-NOR/SPI NOR and s/spi-nor/SPI NOR across the subsystem. Signed-off-by: Tudor Ambarus Reviewed-by: Sergei Shtylyov commit 075fd6dff24acf51997597669e4642db6a919014 Author: Tudor Ambarus Date: Wed Apr 29 07:11:01 2020 +0000 mtd: spi-nor: spansion: Differentiate between s25fl256s and s25fs256s s25fs256s was identified as s25fl256s. Differentiate between them by the Family ID using the INFO6 macro. Fixes: b199489d37b2 ("mtd: spi-nor: add the framework for SPI NOR") Signed-off-by: Tudor Ambarus Reviewed-by: Alexander Sverdlin commit c26d0d87f175b8283b8606d2122603232028cbf2 Author: Yicong Yang Date: Wed Apr 22 17:13:29 2020 +0800 mtd: spi-nor: Add support for s25fs128s1 Add support for Cypress s25fs128s1 flash. Previously the flash is decoded as s25fl129p1 by mistake. Add it in the flash info list to correctly decode. The flash also needs a fixup for s25fs-s family. Further capability of the flash will be parsed from bfpt. The flash has been tested under SPI/DUAL/QUAD mode on hisi-sfc-v3xx controller, all the write/read/erase works well. Signed-off-by: Yicong Yang Signed-off-by: Tudor Ambarus commit 482cd90cd781c9b5607ed9c9f8641dc95a9d4cce Author: Jiaxun Yang Date: Wed May 27 21:17:21 2020 +0800 MIPS: Loongson64: Define PCI_IOBASE PCI_IOBASE is used to create VM maps for PCI I/O ports, it is required by generic PCI drivers to make memory mapped I/O range work. To deal with legacy drivers that have fixed I/O ports range we reserved 0x10000 in PCI_IOBASE, should be enough for i8259 i8042 stuff. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit a202bf71f08b3ef15356db30535e30b03cf23aec Author: Lichao Liu Date: Thu May 28 09:10:31 2020 +0800 MIPS: CPU_LOONGSON2EF need software to maintain cache consistency CPU_LOONGSON2EF need software to maintain cache consistency, so modify the 'cpu_needs_post_dma_flush' function to return true when the cpu type is CPU_LOONGSON2EF. Cc: stable@vger.kernel.org Signed-off-by: Lichao Liu Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 9c43783c702fd68c96342e83ed3bb8828484a5e0 Author: Tiezhu Yang Date: Thu May 28 09:59:01 2020 +0800 MIPS: DTS: Fix build errors used with various configs If CONFIG_MIPS_MALTA is not set but CONFIG_LEGACY_BOARD_SEAD3 is set, the subdir arch/mips/boot/dts/mti will not be built, so the sead3.dts which depends on CONFIG_LEGACY_BOARD_SEAD3 in this subdir is also not built, and then there exists the following build error, fix it. LD .tmp_vmlinux.kallsyms1 arch/mips/generic/board-sead3.o:(.mips.machines.init+0x4): undefined reference to `__dtb_sead3_begin' Makefile:1106: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 Additionally, add CONFIG_FIT_IMAGE_FDT_BOSTON check for subdir img to fix the following build error when CONFIG_MACH_PISTACHIO is not set but CONFIG_FIT_IMAGE_FDT_BOSTON is set. FATAL ERROR: Couldn't open "boot/dts/img/boston.dtb": No such file or directory Reported-by: kbuild test robot Reported-by: Guenter Roeck Fixes: 41528ba6afe6 ("MIPS: DTS: Only build subdir of current platform") Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 58ca0060ec4e51208d2eee12198fc55fd9e4feb3 Author: Weili Qian Date: Wed May 20 17:19:50 2020 +0800 crypto: hisilicon - fix driver compatibility issue with different versions of devices In order to be compatible with devices of different versions, V1 in the accelerator driver is now isolated, and other versions are the previous V2 processing flow. Signed-off-by: Weili Qian Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit d1c72f6e4c051620f44b170dff991240117dd911 Author: Iuliana Prodan Date: Wed May 20 01:17:25 2020 +0300 crypto: engine - do not requeue in case of fatal error Now, in crypto-engine, if hardware queue is full (-ENOSPC), requeue request regardless of MAY_BACKLOG flag. If hardware throws any other error code (like -EIO, -EINVAL, -ENOMEM, etc.) only MAY_BACKLOG requests are enqueued back into crypto-engine's queue, since the others can be dropped. The latter case can be fatal error, so those cannot be recovered from. For example, in CAAM driver, -EIO is returned in case the job descriptor is broken, so there is no possibility to fix the job descriptor. Therefore, these errors might be fatal error, so we shouldn’t requeue the request. This will just be pass back and forth between crypto-engine and hardware. Fixes: 6a89f492f8e5 ("crypto: engine - support for parallel requests based on retry mechanism") Signed-off-by: Iuliana Prodan Reported-by: Horia Geantă Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu commit ae4052c59c2d12ee68b3e48eeef1d5ef202b1a0a Author: Christophe JAILLET Date: Tue May 19 22:36:54 2020 +0200 crypto: cavium/nitrox - Fix a typo in a comment s/NITORX/NITROX/ Signed-off-by: Christophe JAILLET Signed-off-by: Herbert Xu commit fac1cd327b627a0761d10bb93a2b0d0075452ff9 Author: Marek Szyprowski Date: Fri May 22 12:24:48 2020 +0200 power: charger: max14577: Add proper dt-compatible strings Add device tree compatible strings and create proper modalias structures to let this driver load automatically if compiled as module, because max14577 MFD driver creates MFD cells with such compatible strings. Signed-off-by: Marek Szyprowski Signed-off-by: Sebastian Reichel commit 6c2fe5cae53a4b32276b71a72b003fb3ec83c7f9 Merge: c3d80522237b 904ac71f4b0c Author: Sebastian Reichel Date: Thu May 28 09:04:26 2020 +0200 Merge tag 'tags/ib-mfd-iio-power-v5.8' into psy-next This merges the MP2629 battery charge management immutable branch between MFD, IIO and power-supply due for the v5.8 merge window into power-supply for-next branch. Signed-off-by: Sebastian Reichel commit a7528198add88a6f51b8ade17a5cf86804b8f7ee Author: Markus Theil Date: Wed May 27 18:03:34 2020 +0200 mac80211: support control port TX status reporting Add support for TX status reporting for the control port TX API; this will be used by hostapd when it moves to the control port TX API. Signed-off-by: Markus Theil Link: https://lore.kernel.org/r/20200527160334.19224-1-markus.theil@tu-ilmenau.de [fix commit message, it was referring to nl80211] Signed-off-by: Johannes Berg commit 5587fa489747a8e6cbd0558890458c862b797485 Author: Sergei Shtylyov Date: Mon Apr 20 22:13:58 2020 +0300 mtd: spi-nor: spansion: fix writes on S25FS512S Spansion S25FS-S family has an issue in the Basic Flash Parameter Table (BFPT): Dword-11 bits 7:4 specify a page size of 512 bytes. Actually this is configurable in the vendor unique register (CR3V) and even the factory default setting is to "wrap at 256 bytes", so blindly relying on BFPT breaks the page writes on these chips. Add the post-BFPT fixup which restores the default page size of 256 bytes -- to properly read CR3V this early is quite intrusive and should better be done as a new feature; Alexander Sverdlin had the patch doing that: https://patchwork.ozlabs.org/project/linux-mtd/patch/20200227123657.26030-1-alexander.sverdlin@nokia.com/ Fixes: dfd2b74530e ("mtd: spi-nor: add Spansion S25FS512S ID") Signed-off-by: Sergei Shtylyov Reviewed-by: Alexander Sverdlin Tested-by: Kuldeep Singh Signed-off-by: Tudor Ambarus commit c3d80522237b71480109fc397975fe4146ed2550 Author: Serge Semin Date: Tue May 26 16:51:01 2020 +0300 power: reset: syscon-reboot: Add parental syscon support Since normally syscon-reboot block is supposed to be a part of a system controller, lets look for the syscon regmap in a parental DT node if regmap property isn't specified. DT binding from now considers the regmap property as deprecated. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Signed-off-by: Sebastian Reichel commit 2140d68d69d45e4a74ec09ca381d2c8879165d2d Author: Serge Semin Date: Tue May 26 16:51:00 2020 +0300 dt-bindings: power: reset: Unrequire regmap property in syscon-reboot node Since normally syscon-reboot block is supposed to be a part of a system controller, lets mark the regmap property as deprecated and recommend the syscon-reboot node to be a sub-node of SYSCON. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Signed-off-by: Sebastian Reichel commit 9ca1f474cea0edc14a1d7ec933e5472c0ff115d3 Merge: 5afeb97a1844 185082b679b4 Author: Dave Airlie Date: Thu May 28 16:10:16 2020 +1000 Merge tag 'amd-drm-next-5.8-2020-05-27' of git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-next-5.8-2020-05-27: amdgpu: - SRIOV fixes - RAS fixes - VCN 2.5 DPG (Dynamic PowerGating) fixes - FP16 updates for display - CTF cleanups - Display fixes - Fix pcie bw sysfs handling - Enable resizeable BAR support for gmc 10.x - GFXOFF fixes for Raven - PM sysfs handling fixes amdkfd: - Fix a race condition - Warning fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200527231219.3930-1-alexander.deucher@amd.com commit 5cde265384cad739b162cf08afba6da8857778bd Author: Stephane Eranian Date: Wed May 27 15:46:59 2020 -0700 perf/x86/rapl: Add AMD Fam17h RAPL support This patch enables AMD Fam17h RAPL support for the Package level metric. The support is as per AMD Fam17h Model31h (Zen2) and model 00-ffh (Zen1) PPR. The same output is available via the energy-pkg pseudo event: $ perf stat -a -I 1000 --per-socket -e power/energy-pkg/ Signed-off-by: Stephane Eranian Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200527224659.206129-6-eranian@google.com commit 4c953f879460bf65ea3c119354026b126fe8ee57 Author: Stephane Eranian Date: Wed May 27 15:46:58 2020 -0700 perf/x86/rapl: Make perf_probe_msr() more robust and flexible This patch modifies perf_probe_msr() by allowing passing of struct perf_msr array where some entries are not populated, i.e., they have either an msr address of 0 or no attribute_group pointer. This helps with certain call paths, e.g., RAPL. In case the grp is NULL, the default sysfs visibility rule applies which is to make the group visible. Without the patch, you would get a kernel crash with a NULL group. Signed-off-by: Stephane Eranian Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200527224659.206129-5-eranian@google.com commit 2a3e3f73a23b4ff2c0065d3a42edc18ad94b7851 Author: Stephane Eranian Date: Wed May 27 15:46:57 2020 -0700 perf/x86/rapl: Flip logic on default events visibility This patch modifies the default visibility of the attribute_group for each RAPL event. By default if the grp.is_visible field is NULL, sysfs considers that it must display the attribute group. If the field is not NULL (callback function), then the return value of the callback determines the visibility (0 = not visible). The RAPL attribute groups had the field set to NULL, meaning that unless they failed the probing from perf_msr_probe(), they would be visible. We want to avoid having to specify attribute groups that are not supported by the HW in the rapl_msrs[] array, they don't have an MSR address to begin with. Therefore, we intialize the visible field of all RAPL attribute groups to a callback that returns 0. If the RAPL msr goes through probing and succeeds the is_visible field will be set back to NULL (visible). If the probing fails the field is set to a callback that return 0 (not visible). Signed-off-by: Stephane Eranian Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200527224659.206129-4-eranian@google.com commit 5c95c68949880035b68e5c48fdf4899ec0989631 Author: Stephane Eranian Date: Wed May 27 15:46:56 2020 -0700 perf/x86/rapl: Refactor to share the RAPL code between Intel and AMD CPUs This patch modifies the rapl_model struct to include architecture specific knowledge in this previously Intel specific structure, and in particular it adds the MSR for POWER_UNIT and the rapl_msrs array. No functional changes. Signed-off-by: Stephane Eranian Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200527224659.206129-3-eranian@google.com commit fd3ae1e1587d64ef8cc8e361903d33625458073e Author: Stephane Eranian Date: Wed May 27 15:46:55 2020 -0700 perf/x86/rapl: Move RAPL support to common x86 code To prepare for support of both Intel and AMD RAPL. As per the AMD PPR, Fam17h support Package RAPL counters to monitor power usage. The RAPL counter operates as with Intel RAPL, and as such it is beneficial to share the code. No change in functionality. Signed-off-by: Stephane Eranian Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200527224659.206129-2-eranian@google.com commit 0bffedbce90818228f554651baf8d7c75f2876d8 Merge: c50c75e9b879 9cb1fd0efd19 Author: Ingo Molnar Date: Thu May 28 07:58:12 2020 +0200 Merge tag 'v5.7-rc7' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit 5afeb97a1844dd32c3065fa03e9ef121a6b37c18 Merge: 7dbbdd37f2ae 6f27e4c287d7 Author: Dave Airlie Date: Thu May 28 15:38:26 2020 +1000 Merge tag 'drm-misc-next-fixes-2020-05-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Short summary of fixes pull (less than what git shortlog provides): There's a fix for panel brighness on Lenovo X13 Yoga devices and a fix for -Wformat warnings on architectures where atomic-64 counters are not of type unsigned long long. Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200527080123.GA8186@linux-uq9g commit b8b38a8e3cae100f292d756e32c78ab288db8a7d Author: Samuel Zou Date: Wed May 27 20:39:14 2020 -0700 drivers: soc: ti: knav_qmss_queue: Make knav_gp_range_ops static Fix the following sparse warning: drivers/soc/ti/knav_qmss_queue.c:412:23: warning: symbol 'knav_gp_range_ops' was not declared. The knav_acc_firmwares has only call site within knav_qmss_queue.c It should be static Fixes: 41f93af900a2 ("soc: ti: add Keystone Navigator QMSS driver") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: Santosh Shilimkar commit 907a2b7e2fc746ac3b57b7eb64c220b81d74fc42 Author: Grygorii Strashko Date: Wed May 27 20:39:14 2020 -0700 soc: ti: add k3 platforms chipid module driver The Texas Instruments K3 Multicore SoC platforms have chipid module which is represented by CTRLMMR_xxx_JTAGID register and contains information about SoC id and revision. Bits: 31-28 VARIANT Device variant 27-12 PARTNO Part number 11-1 MFG Indicates TI as manufacturer (0x17) 1 Always 1 This patch adds corresponding driver to identify the TI K3 SoC family and revision, and registers this information with the SoC bus. It is available under /sys/devices/soc0/ for user space, and can be checked, where needed, in Kernel using soc_device_match(). Identification is done by: - checking MFG to be TI ID - retrieving Device variant (revision) - retrieving Part number and convert it to the family - retrieving machine from DT "/model" Example J721E: # cat /sys/devices/soc0/{machine,family,revision} Texas Instruments K3 J721E SoC J721E SR1.0 Example AM65x: # cat /sys/devices/soc0/{machine,family,revision} Texas Instruments AM654 Base Board AM65X SR1.0 Cc: Arnd Bergmann Signed-off-by: Grygorii Strashko Reviewed-by: Lokesh Vutla Reviewed-by: Tero Kristo Signed-off-by: Santosh Shilimkar commit 232150cc32ea375dc5d6b0a05ecab224c87ca7ee Author: Grygorii Strashko Date: Wed May 27 20:39:13 2020 -0700 dt-bindings: soc: ti: add binding for k3 platforms chipid module Add DT binding for Texas Instruments K3 Multicore SoC platforms chipid module which is represented by CTRLMMR_xxx_JTAGID register and contains information about SoC id and revision. Signed-off-by: Grygorii Strashko Reviewed-by: Lokesh Vutla Reviewed-by: Tero Kristo Signed-off-by: Santosh Shilimkar commit e32f8879019535b899bc3d51f371e17526f208d1 Merge: 011593480d29 a4ae32c71fe9 Author: Eric W. Biederman Date: Wed May 27 22:37:33 2020 -0500 Merge commit a4ae32c71fe9 ("exec: Always set cap_ambient in cap_bprm_set_creds") This is a bug fix and one of two places where I have found that the result of calling security_bprm_repopulate_creds more than once on different bprm->files depends on all of the bprm->files not just the file bprm->file. I intend to fix both of those cases and then modify the code to only call security_bprm_repopulate_creds on the final bprm file. So merge this change in so I hopefully reduce conflicts for others and I make it possible to build on top of this change. Signed-off-by: "Eric W. Biederman" commit 644c5a582261ecdf1df41b11d05d10a1cccc0a66 Author: Krzysztof Kozlowski Date: Wed May 27 20:36:32 2020 -0700 ARM: dts: keystone: Rename "msmram" node to "sram" The device node name should reflect generic class of a device so rename the "msmram" node and its children to "sram". This will be also in sync with upcoming DT schema. No functional change. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Santosh Shilimkar commit 44f50b8d40588d5e065d1d349ea639954d5be05a Author: Anson Huang Date: Thu May 14 14:54:19 2020 +0800 dt-bindings: pwm: Convert imx tpm pwm to json-schema Convert the imx tpm pwm binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit f1ea970395618e73d9f9ba83d7cc7e7da0f91355 Author: Anson Huang Date: Thu May 14 14:54:18 2020 +0800 dt-bindings: pwm: Convert imx pwm to json-schema Convert the imx pwm binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit abc9e16f4953810f22fb92a43dd223f809589e0c Author: Anson Huang Date: Thu May 14 14:13:25 2020 +0800 dt-bindings: rtc: Convert MXC RTC V2 to json-schema Convert the MXC RTC V2 binding to DT schema format using json-schema. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Rob Herring commit b82f8cc72ba27ee36c7f91ec73546bf294efda0c Author: Anson Huang Date: Thu May 14 14:13:24 2020 +0800 dt-bindings: rtc: Convert MXC RTC to json-schema Convert the MXC RTC binding to DT schema format using json-schema. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Rob Herring commit 37d1e94692e06a35c53ff052e2d0983548ef0395 Author: Niklas Söderlund Date: Wed May 13 17:12:01 2020 +0200 dt-bindings: thermal: rcar-gen3-thermal: Convert bindings to json-schema Convert Renesas R-Car Gen3 Thermal bindings documentation to json-schema. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 2cb80529811bcfa9250388543a33ac75c37ae632 Author: Charles Keepax Date: Wed May 13 10:57:20 2020 +0100 mfd: madera: Move binding over to dtschema Signed-off-by: Charles Keepax [robh: Drop $ref on *-supply] Signed-off-by: Rob Herring commit 067243bab999be65c6ef4cffa982a053dc399b79 Author: Charles Keepax Date: Wed May 13 10:57:19 2020 +0100 pinctrl: madera: Move binding over to dtschema Signed-off-by: Charles Keepax Reviewed-by: Linus Walleij Signed-off-by: Rob Herring commit 8b3f0ed9e07ff227b3187f9b397fc5cb6498ca68 Author: Charles Keepax Date: Wed May 13 10:57:18 2020 +0100 ASoC: madera: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit fc543f5367f37e6038437a9fce8e9d120e76e516 Author: Charles Keepax Date: Wed May 13 10:57:17 2020 +0100 mfd: arizona: Move binding over to dtschema Signed-off-by: Charles Keepax [robh: Drop ref from *-supply] Signed-off-by: Rob Herring commit 575a29ed8f960e0cd618c63eb7972e46b18a58ef Author: Charles Keepax Date: Wed May 13 10:57:16 2020 +0100 ASoC: arizona: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit 0c906c92b7a3b9ae1bf40ef8f80df75addd59689 Author: Charles Keepax Date: Wed May 13 10:57:15 2020 +0100 extcon: arizona: Move binding over to dtschema Acked-by: Chanwoo Choi Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit afd9ee0e97b6d2ef7a6f13ed3fafc7a6323a4eaa Author: Charles Keepax Date: Wed May 13 10:57:14 2020 +0100 regulator: arizona-regulator: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit b5e47184c37279dc525114287d68b40998ca548c Author: Kunihiko Hayashi Date: Wed May 13 14:42:25 2020 +0900 dt-bindings: watchdog: Convert UniPhier watchdog timer to json-schema Convert UniPhier watchdog timer binding to DT schema format. Cc: Keiji Hayashibara Signed-off-by: Kunihiko Hayashi Signed-off-by: Rob Herring commit f9a529b9d6f15a065f2ccf5ec67180df431b0c6f Author: Qi Zheng Date: Sun May 24 23:26:14 2020 +0800 dt/platform: Fix comment in of_dev_lookup() The code is using of_dev_lookup() rather than of_devname_lookup(). Signed-off-by: Qi Zheng Signed-off-by: Rob Herring commit 8a325dd06f2358ea0888e4ff1c9ca4bc23bd53f3 Author: Dan Carpenter Date: Wed May 20 15:04:14 2020 +0300 of: Fix a refcounting bug in __of_attach_node_sysfs() The problem in this code is that if kobject_add() fails, then it should call of_node_put(np) to drop the reference count. I've actually moved the of_node_get(np) later in the function to avoid needing to do clean up. Fixes: 5b2c2f5a0ea3 ("of: overlay: add missing of_node_get() in __of_attach_node_sysfs") Signed-off-by: Dan Carpenter Signed-off-by: Rob Herring commit 9dae090f4b0aad9e97b621f61ee75e24e2432ac7 Author: Charles Keepax Date: Tue May 12 16:23:58 2020 +0100 mfd: lochnagar: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit e0a99c55d08bf1d4c05cb2d388d39f25e819eff2 Author: Charles Keepax Date: Tue May 12 16:23:57 2020 +0100 clk: lochnagar: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit 96c1517e0edae9888005683bf6befcffb2fc35d6 Author: Charles Keepax Date: Tue May 12 16:23:56 2020 +0100 pinctrl: lochnagar: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit e1bfa75df229eac201aaa62012126e4ce3a3ee08 Author: Charles Keepax Date: Tue May 12 16:23:55 2020 +0100 ASoC: lochnagar: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit 9826fb4db0d7e141578ad70fe2fd00706948ab6c Author: Charles Keepax Date: Tue May 12 16:23:54 2020 +0100 hwmon: lochnagar: Move binding over to dtschema Signed-off-by: Charles Keepax Signed-off-by: Rob Herring commit 06c3b7a60b4b248ed12229ea39399be0501532de Author: Lad Prabhakar Date: Wed May 27 17:29:27 2020 +0100 dt-bindings: watchdog: renesas,wdt: Document r8a7742 support RZ/G1H (R8A7742) watchdog implementation is compatible with R-Car Gen2, therefore add relevant documentation. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Signed-off-by: Rob Herring commit 122952665b455eb6b399e1e4b5f82fb62601f449 Author: Nikita Travkin Date: Mon May 11 16:11:26 2020 +0500 dt-bindings: vendor-prefixes: Add Shanghai Awinic Technology Co., Ltd. Add the "awinic" vendor prefix for Shanghai Awinic Technology Co., Ltd. Website: https://www.awinic.com/ Reviewed-by: Rob Herring Signed-off-by: Nikita Travkin Signed-off-by: Rob Herring commit 2bcfe2e0bc4ab9d35a82b66aedceabe8f85fc537 Author: Anson Huang Date: Wed May 13 08:11:24 2020 +0800 dt-bindings: clock: Convert i.MX6UL clock to json-schema Convert the i.MX6UL clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Acked-by: Stephen Boyd Signed-off-by: Rob Herring commit cd71b9e59a2ebd7712b53a0859908b30a6ea26f4 Author: Anson Huang Date: Wed May 13 08:11:23 2020 +0800 dt-bindings: clock: Convert i.MX6SLL clock to json-schema Convert the i.MX6SLL clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Acked-by: Stephen Boyd Signed-off-by: Rob Herring commit f41610309affd8a077c54b0949b7dcd79b0bc20b Author: Anson Huang Date: Wed May 13 08:11:22 2020 +0800 dt-bindings: clock: Convert i.MX6SL clock to json-schema Convert the i.MX6SL clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Acked-by: Stephen Boyd Signed-off-by: Rob Herring commit b9e267524b16806fdfcf9e4d31f7f5d5e4f3a35d Author: Anson Huang Date: Wed May 13 08:11:21 2020 +0800 dt-bindings: clock: Convert i.MX6SX clock to json-schema Convert the i.MX6SX clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Acked-by: Stephen Boyd Signed-off-by: Rob Herring commit 9254bf1007d5dea70044a7a1212b40461e8f8d85 Author: Anson Huang Date: Wed May 13 08:11:20 2020 +0800 dt-bindings: clock: Convert i.MX6Q clock to json-schema Convert the i.MX6Q clock binding to DT schema format using json-schema. Signed-off-by: Anson Huang Acked-by: Stephen Boyd Signed-off-by: Rob Herring commit dffe5115047ece396c1df6d47283f1f986e2ff3f Author: Sandeep Maheswaram Date: Thu May 21 21:08:19 2020 +0530 dt-bindings: usb: qcom,dwc3: Add compatible for SC7180 Add compatible for SC7180 in usb dwc3 bindings. Signed-off-by: Sandeep Maheswaram Reviewed-by: Douglas Anderson Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring commit 3828026c9ec898ccb1ddf8a5dbc83b2f25db4b48 Author: Sandeep Maheswaram Date: Thu May 21 21:08:18 2020 +0530 dt-bindings: usb: qcom,dwc3: Convert USB DWC3 bindings Convert USB DWC3 bindings to DT schema format using json-schema. Signed-off-by: Sandeep Maheswaram [robh: fixup example warnings] Signed-off-by: Rob Herring commit 3f0d97cdfe6e900a5c71817b0dfb77247afee36d Author: Krzysztof Kazimierczak Date: Fri May 15 17:42:20 2020 -0700 ice: Check UMEM FQ size when allocating bufs If a UMEM is present on a queue when an interface/queue pair is being enabled, the driver will try to prepare the Rx buffers in advance to improve performance. However, if fill queue is shorter than HW Rx ring, the driver will report failure after getting the last address from the fill queue. This still lets the driver process the packets correctly during the NAPI poll, but leads to a constant NAPI rescheduling. Not allocating the buffers in advance would result in a potential performance decrease. Commit d57d76428ae9 ("xsk: Add API to check for available entries in FQ") provides an API that lets drivers check the number of addresses that the fill queue holds. Notify the user if fill queue is not long enough to prepare all buffers before packet processing starts, and allocate the buffers during the NAPI poll. If the fill queue size is sufficient, prepare Rx buffers in advance. Signed-off-by: Krzysztof Kazimierczak Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit ed03a418abe8e5a3ba541a805314bbf8a9eadda3 Author: Alex Vesker Date: Wed May 20 18:09:35 2020 +0300 net/mlx5: DR, Split RX and TX lock for parallel insertion Change the locking flow to support RX and TX locks, splitting the single lock to two will allow inserting rules in parallel for RX and TX parts of the FDB. Locking the dr_domain will be done by locking the RX domain and the TX domain locks, this is mostly used for control operations on the dr_domain. When inserting rules for RX or TX the single nic_doamin RX or TX lock will be used. Splitting the lock is safe since RX and TX domains are logically separated from each other, shared objects such the send-ring and memory pool are protected by locks. Signed-off-by: Alex Vesker Reviewed-by: Mark Bloch Reviewed-by: Erez Shitrit Signed-off-by: Saeed Mahameed commit cedb28191fdfb4fc1da0a7612465624998de7da2 Author: Alex Vesker Date: Wed May 20 18:09:14 2020 +0300 net/mlx5: DR, Add a spinlock to protect the send ring Adding this lock will allow writing steering entries without locking the dr_domain and allow parallel insertion. Signed-off-by: Alex Vesker Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit fca533041aac0426f5b5618a564aeb588fc125e9 Author: Eli Britstein Date: Tue May 19 05:55:59 2020 +0000 net/mlx5e: Optimize performance for IPv4/IPv6 ethertype The HW is optimized for IPv4/IPv6. For such cases, pending capability, avoid matching on ethertype, and use ip_version field instead. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 4a5d5d7392106a48c7db345a3843e854b66ea0ff Author: Eli Britstein Date: Mon May 11 19:20:29 2020 +0000 net/mlx5e: Helper function to set ethertype Set ethertype match in a helper function as a pre-step towards optimizing it. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 810cbb25549b81f0c0848320f8a1614106d3a0e1 Author: Parav Pandit Date: Thu May 14 23:42:45 2020 -0500 net/mlx5: Add missing mutex destroy Add mutex destroy calls to balance with mutex_init() done in the init path. Signed-off-by: Parav Pandit Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 9728366f53d283be943ee99d5989f155e55fc077 Author: Vu Pham Date: Thu Mar 12 10:26:25 2020 -0700 net/mlx5e: Use change upper event to setup representors' bond_metadata Use change upper event to detect slave representor from enslaving/unslaving to/from lag device. On enslaving event, call mlx5_enslave_rep() API to create, add this slave representor shadow entry to the slaves list of bond_metadata structure representing master lag device and use its metadata to setup ingress acl metadata header. On unslaving event, resetting the vport of unslaved representor to use its default ingress/egress acls and rx rules with its default_metadata. The last slave will free the shared bond_metadata and its unique metadata. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 88e96e533cfa11e996c59a44bbb6b0e0b9891970 Author: Vu Pham Date: Mon Mar 2 10:33:49 2020 -0800 net/mlx5e: Slave representors sharing unique metadata for match Bonded slave representors' vports must share a unique metadata for match. On enslaving event of slave representor to lag device, allocate new unique "bond_metadata" for match if this is the first slave. The subsequent enslaved representors will share the same unique "bond_metadata". On unslaving event of slave representor, reset the slave representor's vport to use its own default metadata. Replace ingress acl and rx rules of the slave representors' vports using new vport->bond_metadata. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 133dcfc577eaec6538db4ebd8b9205b361f59018 Author: Vu Pham Date: Fri Feb 28 16:10:34 2020 -0800 net/mlx5: E-Switch, Alloc and free unique metadata for match Introduce infrastructure to create unique metadata for match for vport without depending on vport_num. Vport uses its default metadata for match in standalone configuration but will share a different unique "bond_metadata" for match with other vports in bond configuration. Using ida to generate unique metadata for match for vports in default and bond configurations. Introduce APIs to generate, free metadata for match. Introduce APIs to set vport's bond_metadata and replace its ingress acl rules with bond_metatada. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d97555e1452943264295cd3c1f066474bc3660dd Author: Vu Pham Date: Fri Feb 28 14:28:27 2020 -0800 net/mlx5e: Add bond_metadata and its slave entries Adding bond_metadata and its slave entries to represent a lag device and its slaves VF representors. Bond_metadata structure includes a unique metadata shared by slaves VF respresentors, and a list of slaves representors slave entries. On enslaving event, create a bond_metadata structure representing the upper lag device of this slave representor if it has not been created yet. Create and add entry for the slave representor to the slaves list. On unslaving event, free the slave entry of the slave representor. On the last unslave event, free the bond_metadata structure and its resources. Introduce APIs to create and remove bond_metadata and its resources, enslave and unslave VF representor slave entries. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit d34eb2fcd00472323d9e26ee0aec498c2c6f5b6f Author: Or Gerlitz Date: Tue Mar 5 21:11:14 2019 +0200 net/mlx5e: Offload flow rules to active lower representor When a bond device is created over one or more non uplink representors, and when a flow rule is offloaded to such bond device, offload a rule to the active lower device. Assuming that this is active-backup lag, the rules should be offloaded to the active lower device which is the representor of the direct path (not the failover). Signed-off-by: Or Gerlitz Signed-off-by: Parav Pandit Signed-off-by: Vu Pham Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 553f9328385d954644d74dedb655f85b687a9470 Author: Vu Pham Date: Fri Aug 2 16:13:10 2019 -0700 net/mlx5e: Support tc block sharing for representors Currently offloading a rule over a tc block shared by multiple representors fails because an e-switch global hashtable to keep the mapping from tc cookies to mlx5e flow instances is used, and tc block sharing offloads the same rule/cookie multiple times, each time for different representor sharing the tc block. Changing the implementation and behavior by acknowledging and returning success if the same rule/cookie is offloaded again to other slave representor sharing the tc block by setting, checking and comparing the netdev that added the rule first. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 7e51891a237f9ea319f53f9beb83afb0077d88e6 Author: Or Gerlitz Date: Fri Jun 21 13:23:44 2019 -0700 net/mlx5e: Use netdev events to set/del egress acl forward-to-vport rule Register a notifier block to handle netdev events for bond device of non-uplink representors to support eswitch vports bonding. When a non-uplink representor is a lower dev (slave) of bond and becomes active, adding egress acl forward-to-vport rule of all slave netdevs (active + standby) to forward to this representor's vport. Use change lower netdev event to do this. Use change upper event to detect slave representor unslaved from lag device to delete its vport egress acl forward rule if any. Signed-off-by: Or Gerlitz Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit bf773dc0e6d55a828a9111124b1d7836f2d4492c Author: Vu Pham Date: Mon Mar 16 17:32:50 2020 -0700 net/mlx5: E-Switch, Introduce APIs to enable egress acl forward-to-vport rule By default, e-switch vport's egress acl just forward packets to its counterpart NIC vport using existing egress acl table. During port failover in bonding scenario where two VFs representors are bonded, the egress acl forward-to-vport rule will be added to the existing egress acl table of e-switch vport of passive/inactive slave representor to forward packets to other NIC vport ie. the active slave representor's NIC vport to handle egress "failover" traffic. Enable egress acl and have APIs to create and destroy egress acl forward-to-vport rule and group. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 07bab9502641dff9c3c864162270d12c6dd0e834 Author: Vu Pham Date: Fri Mar 27 23:12:22 2020 -0700 net/mlx5: E-Switch, Refactor eswitch ingress acl codes Restructure the eswitch ingress acl codes into eswitch directory and different files: . Acl ingress helper functions to acl_helper.c/h . Acl ingress functions used in offloads mode to acl_ingress_ofld.c . Acl ingress functions used in legacy mode to acl_ingress_lgy.c This patch does not change any functionality. Signed-off-by: Vu Pham commit ea651a86d46895a8b342664db66c3dee3412ad34 Author: Vu Pham Date: Wed Nov 6 09:57:12 2019 -0800 net/mlx5: E-Switch, Refactor eswitch egress acl codes Refactor the egress acl codes so that offloads and legacy modes can configure specifically their own needs of egress acl table, groups and rules. While at it, restructure the eswitch egress acl codes into eswitch directory and different files: . Acl egress helper functions to acl_helper.c/h . Acl egress functions used in offloads mode to acl_egress_ofld.c . Acl egress functions used in legacy mode to acl_egress_lgy.c This patch does not change any functionality. Signed-off-by: Vu Pham Signed-off-by: Saeed Mahameed commit 13f90b393f7338e6a2b2646fa1b677cc8b50cd23 Author: Anirudh Venkataramanan Date: Fri May 15 17:42:19 2020 -0700 ice: Refactor Rx checksum checks We don't need both rx_status and rx_error parameters, as the latter is a subset of the former. Remove rx_error completely and check the right bit in rx_status. Rename rx_status to rx_status0, and rx_status_err1 to rx_status1. This naming more closely reflects the specification. Signed-off-by: Anirudh Venkataramanan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 7e34786a74e14038faadabb24b0d7f4436961c6b Author: Bruce Allan Date: Fri May 15 17:42:18 2020 -0700 ice: avoid undefined behavior When writing the driver's struct ice_tlan_ctx structure, do not write the 8-bit element int_q_state with the associated internal-to-hardware field which is 122-bits, otherwise the helper function ice_write_byte() will use undefined behavior when setting the mask used for that write. This should not cause any functional change and will avoid use of undefined behavior. Also, update a comment to highlight this structure element is not written. Signed-off-by: Bruce Allan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 11362b1befeadaae4d159a8cddcdaf6b8afe08f9 Author: Paul Mackerras Date: Thu May 28 10:56:42 2020 +1000 KVM: PPC: Book3S HV: Close race with page faults around memslot flushes There is a potential race condition between hypervisor page faults and flushing a memslot. It is possible for a page fault to read the memslot before a memslot is updated and then write a PTE to the partition-scoped page tables after kvmppc_radix_flush_memslot has completed. (Note that this race has never been explicitly observed.) To close this race, it is sufficient to increment the MMU sequence number while the kvm->mmu_lock is held. That will cause mmu_notifier_retry() to return true, and the page fault will then return to the guest without inserting a PTE. Signed-off-by: Paul Mackerras commit ae15e0ba1b333f391ab0d678abb752cb6a7f2782 Author: Marta Plantykow Date: Fri May 15 17:42:17 2020 -0700 ice: Change number of XDP Tx queues to match number of Rx queues In current implementation number of XDP Tx queues is the same as the number of transmit queues, which is not always true. This patch changes this number to match the number of receive queues. XDP programs are running on Rx rings, so what we actually need to provide is the XDP Tx ring per each Rx ring so that the whole XDP ecosystem is functional, e.g. if the result of XDP prog is XDP_TX then you have the need to access the XDP Tx ring. Signed-off-by: Marta Plantykow Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 725262d29139cc8dd0c7dddbbd097c02361d0e5e Author: Lubomir Rintel Date: Wed May 20 00:41:51 2020 +0200 clk: mmp2: Add audio clock controller driver This is a driver for a block that generates master and bit clocks for the I2S interface. It's separate from the PMUs that generate clocks for the peripherals. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-14-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit e787c5b72517428cd1159637a454c64c3b0c90fb Author: Lubomir Rintel Date: Wed May 20 00:41:50 2020 +0200 dt-bindings: clock: Add Marvell MMP Audio Clock Controller binding This describes the bindings for a controller that generates master and bit clocks for the I2S interface. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-13-lkundrak@v3.sk Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit ee4df2363439c80bef693a2255ede06f5bc42ce6 Author: Lubomir Rintel Date: Wed May 20 00:41:49 2020 +0200 clk: mmp2: Add support for power islands Apart from the clocks and resets, the PMU hardware also controls power to peripherals that are on separate power islands. On MMP2, that's the GC860 GPU and the SSPA audio interface, while on MMP3 also the camera interface is on a separate island, along with the pair of GC2000 and GC300 GPUs and the SSPA. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-12-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 17d43046fd4c939448576480f02423686524adb0 Author: Lubomir Rintel Date: Wed May 20 00:41:48 2020 +0200 dt-bindings: marvell,mmp2: Add ids for the power domains On MMP2 the audio and GPU blocks are on separate power islands. On MMP3 the camera block's power is also controlled separately. Add the numbers that we could use to refer to the power domains for respective power islands from the device tree. Signed-off-by: Lubomir Rintel Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200519224151.2074597-11-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit ec6bbddef634224f1e6cdd8a225d7f87d53cb1b1 Author: Lubomir Rintel Date: Wed May 20 00:41:47 2020 +0200 dt-bindings: clock: Make marvell,mmp2-clock a power controller This is a binding for the MMP2 power management units. As such apart from providing the clocks, they also manage the power islands. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-10-lkundrak@v3.sk Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 232a3134353bbdc7e6a777f408b18488607bcf20 Author: Lubomir Rintel Date: Wed May 20 00:41:46 2020 +0200 clk: mmp2: Add the audio clock This clocks the Audio block. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-9-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 71d8254af9d1c84d88523a28e6ab03878612e4a5 Author: Lubomir Rintel Date: Wed May 20 00:41:45 2020 +0200 clk: mmp2: Add the I2S clocks A pair of fractional clock sources for PLLs and gates. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-8-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 2766c198150e33018e2e008c6a3355e8c19e6af4 Author: Lubomir Rintel Date: Wed May 20 00:41:44 2020 +0200 clk: mmp2: Rename mmp2_pll_init() to mmp2_main_clk_init() This is a trivial rename for a routine that registers more clock sources than the PLLs -- there's also a XO. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-7-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 8c2427b8f7c814564bc9e4d483b8b00debb32ab5 Author: Lubomir Rintel Date: Wed May 20 00:41:43 2020 +0200 clk: mmp2: Move thermal register defines up a bit A trivial change to keep the sorting sane. The APBC registers are happier when they are grouped together, instead of mixed with the APMU ones. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-6-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit c227df7a097a13508eb4c3dd6c84da56d8989aa6 Author: Lubomir Rintel Date: Wed May 20 00:41:42 2020 +0200 dt-bindings: marvell,mmp2: Add clock id for the Audio clock This clocks the Audio block. Signed-off-by: Lubomir Rintel Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200519224151.2074597-5-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit edcec4a8691966962f3213089516bf00a5dc4f5c Author: Lubomir Rintel Date: Wed May 20 00:41:41 2020 +0200 dt-bindings: marvell,mmp2: Add clock id for the I2S clocks There are two of these on a MMP2. Signed-off-by: Lubomir Rintel Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200519224151.2074597-4-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 5278acc4418bad18ed677952ca7cd56ce312a87d Author: Lubomir Rintel Date: Wed May 20 00:41:40 2020 +0200 clk: mmp: frac: Allow setting bits other than the numerator/denominator For the I2S fractional clocks, there are more bits that need to be set for the clock to run. Their actual meaning is unknown. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-3-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 06030c4e33babd63b6630d358a04f3dfb34cc29c Author: Lubomir Rintel Date: Wed May 20 00:41:39 2020 +0200 clk: mmp: frac: Do not lose last 4 digits of precision While calculating the output rate of a fractional divider clock, the value is divided and multipled by 10000, discarding the least significant digits -- presumably to fit the intermediate value within 32 bits. The precision we're losing is, however, not insignificant for things like I2S clock. Maybe also elsewhere, now that since commit ea56ad60260e ("clk: mmp2: Stop pretending PLL outputs are constant") the parent rates are more precise and no longer rounded to 10000s. Signed-off-by: Lubomir Rintel Link: https://lkml.kernel.org/r/20200519224151.2074597-2-lkundrak@v3.sk Signed-off-by: Stephen Boyd commit 49d358e0e746dc24bfb1b1cf98c17064e5177424 Author: Marta Plantykow Date: Fri May 15 17:42:16 2020 -0700 ice: Add XDP Tx to VSI ring stats When XDP Tx program is loaded and packets are sent from interface, VSI statistics are not updated. This patch adds packets sent on Tx XDP ring to VSI ring stats. Signed-off-by: Marta Plantykow Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c8f135c6ee7851ad72bd4d877216950fcbd45fb6 Author: Marta Plantykow Date: Fri May 15 17:42:15 2020 -0700 ice: Change number of XDP TxQ to 0 when destroying rings When XDP Tx rings are destroyed the number of XDP Tx queues is not changing. This patch is changing this number to 0. Signed-off-by: Marta Plantykow Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit b5c7f857e5c98c21271678992fb2634df38292f5 Author: Evan Swanson Date: Fri May 15 17:42:14 2020 -0700 ice: Handle critical FW error during admin queue initialization A race condition between FW and SW can occur between admin queue setup and the first command sent. A link event may occur and FW attempts to notify a non-existent queue. FW will set the critical error bit and disable the queue. When this happens retry queue setup. Signed-off-by: Evan Swanson Signed-off-by: Anirudh Venkataramanan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 3d89c2ef24f0772b7806ed289bef482b24083de6 Author: Paul Mackerras Date: Thu May 28 10:48:18 2020 +1000 KVM: PPC: Book3S HV: Remove user-triggerable WARN_ON Although in general we do not expect valid PTEs to be found in kvmppc_create_pte when we are inserting a large page mapping, there is one situation where this can occur. That is when dirty page logging is turned off for a memslot while the VM is running. Because the new memslots are installed before the old memslot is flushed in kvmppc_core_commit_memory_region_hv(), there is a window where a hypervisor page fault can try to install a 2MB (or 1GB) page where there are already small page mappings which were installed while dirty page logging was enabled and which have not yet been flushed. Since we have a situation where valid PTEs can legitimately be found by kvmppc_unmap_free_pte, and which can be triggered by userspace, just remove the WARN_ON_ONCE, since it is undesirable to have userspace able to trigger a kernel warning. Signed-off-by: Paul Mackerras commit 1960827570c7ed83fb0725debf856b06f46e1a77 Author: Brett Creeley Date: Fri May 15 17:42:13 2020 -0700 ice: Don't allow VLAN stripping change when pvid set Currently, if the PVID is set in the VLAN handling section of the VSI context the driver still allows VLAN stripping to be enabled/disabled. VLAN stripping should only be modifiable when the PVID is not set. Fix this by preventing VLAN stripping modification when PVID is set. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4f1fe43c920b92ac41c34f151fe452d46936b79d Author: Brett Creeley Date: Fri May 15 17:36:44 2020 -0700 ice: Add more Rx errors to netdev's rx_error counter Currently we are only including illegal_bytes and rx_crc_errors in the PF netdev's rx_error counter. There are many more causes of Rx errors that the device supports and reports via Ethtool. Accumulate all Rx errors in the PF netdev's rx_error counter. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 68d270783742783f96e89ef92ac24ab3c7fb1d31 Author: Surabhi Boob Date: Fri May 15 17:36:43 2020 -0700 ice: Fix for memory leaks and modify ICE_FREE_CQ_BUFS Handle memory leaks during control queue initialization and buffer allocation failures. The macro ICE_FREE_CQ_BUFS is modified to re-use for this fix. Signed-off-by: Surabhi Boob Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1aaef2bc4e0a5ce9e4dd86359e6a0bf52c6aa64f Author: Surabhi Boob Date: Fri May 15 17:36:42 2020 -0700 ice: Fix memory leak Handle memory leak on filter management initialization failure. Signed-off-by: Surabhi Boob Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 5df42c8267418bfb8da54cc4772b397ea4c88aea Author: Jesse Brandeburg Date: Fri May 15 17:36:41 2020 -0700 ice: fix MAC write command The manage MAC write command was implemented in an overly complex way that actually didn't work, as it wasn't symmetric to the manage MAC read command, and was feeding bytes out of order to the firmware. Fix the implementation by just using a simple array to represent the MAC address when it is being written via firmware command. Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit bf8987df8aa57da884276b07a64307eac577eaaf Author: Paul Greenwalt Date: Fri May 15 17:36:40 2020 -0700 ice: set VF default LAN address Remove is_zero_ether_add() check when setting the VF default LAN address. This check assumed that the address had been delete and zeroed before calling ice_vc_add_mac_addr(). Now the default LAN address will be set to the last unicast MAC address added by the VF. The default LAN address is reported by the PF via ndo_get_vf_config. Signed-off-by: Paul Greenwalt Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f0cbbb9c6e06532fc839770de20e1e94e0d999dd Author: Jesse Brandeburg Date: Fri May 15 17:36:39 2020 -0700 ice: remove unused macro The driver had an unused define that can be removed. Found by compiler -Werror=unused-macros check. Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 22bef5e78f1193b664f59834361704cb22f9d5d7 Author: Jesse Brandeburg Date: Fri May 15 17:36:38 2020 -0700 ice: fix signed vs unsigned comparisons Fix the remaining signed vs unsigned issues, which appear when compiling with -Werror=sign-compare. Many of these are because there is an external interface that is passing an int to us (which we can't change) but that we (rightfully) store and compare against as an unsigned in our data structures. Signed-off-by: Jesse Brandeburg Signed-off-by: Bruce Allan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 2a556ce779e39b15cbb74e896ca640e86baeb1a1 Author: Corey Minyard Date: Wed May 27 18:25:56 2020 -0500 ipmi:ssif: Remove dynamic platform device handing Platform devices can only come in through the DMI interface, and that will get done before initialization is complete. Therefore there is no reason to hande getting a device in new_ssif_client after initialization. Dynamic entries can still come in through the i2c interfaces, but that's handled differently. Signed-off-by: Corey Minyard commit 185082b679b4bd6dfb69764eaa89213b26f6f703 Author: Aric Cyr Date: Tue May 12 11:48:48 2020 -0400 drm/amd/display: Fix potential integer wraparound resulting in a hang [Why] If VUPDATE_END is before VUPDATE_START the delay calculated can become very large, causing a soft hang. [How] Take the absolute value of the difference between START and END. Signed-off-by: Aric Cyr Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit 8d43e3966b31df1986342dc8b69072ee26f0589b Author: Simon Ser Date: Sat May 23 11:53:41 2020 +0000 drm/amd/display: drop cursor position check in atomic test get_cursor_position already handles the case where the cursor has negative off-screen coordinates by not setting dc_cursor_position.enabled. Signed-off-by: Simon Ser Fixes: 626bf90fe03f ("drm/amd/display: add basic atomic check for cursor plane") Cc: Alex Deucher Cc: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 64b3eaf3715d24e9215e9552779334b0807eb823 Author: Bjorn Helgaas Date: Wed May 27 12:43:26 2020 -0500 xenbus: Use dev_printk() when possible Use dev_printk() when possible to include device and driver information in the conventional format. Add "#define dev_fmt" to preserve KBUILD_MODNAME in messages. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200527174326.254329-3-helgaas@kernel.org Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 69049454206ac7f7e6e0683bc7fd43eb61746479 Author: Bjorn Helgaas Date: Wed May 27 12:43:25 2020 -0500 xen-pciback: Use dev_printk() when possible Use dev_printk() when possible to include device and driver information in the conventional format. Add "#define dev_fmt" when needed to preserve DRV_NAME or KBUILD_MODNAME in messages. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200527174326.254329-2-helgaas@kernel.org Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit ae920e83a079bc0ed883d6b709f8f6433ce86745 Merge: 50ce4c099beb 7a15b2e013f5 Author: David S. Miller Date: Wed May 27 15:11:33 2020 -0700 Merge branch 'remove-kernel_getsockopt' Christoph Hellwig says: ==================== remove kernel_getsockopt this series reduces scope from the last round and just removes kernel_getsockopt to avoid conflicting with the sctp cleanup series. ==================== Signed-off-by: David S. Miller commit 7a15b2e013f535a125ad7351ffc808c79bc6de35 Author: Christoph Hellwig Date: Wed May 27 20:22:29 2020 +0200 net: remove kernel_getsockopt No users left. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 0774dc7643db525f0bb9d0aa212cbfad3a412fc6 Author: Christoph Hellwig Date: Wed May 27 20:22:28 2020 +0200 dlm: use the tcp version of accept_from_sock for sctp as well The only difference between a few missing fixes applied to the SCTP one is that TCP uses ->getpeername to get the remote address, while SCTP uses kernel_getsockopt(.. SCTP_PRIMARY_ADDR). But given that getpeername is defined to return the primary address for sctp, there doesn't seem to be any reason for the different way of quering the peername, or all the code duplication. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 50ce4c099bebf56be86c9448f7f4bcd34f33663c Author: Jonas Falkevik Date: Wed May 27 11:59:43 2020 +0200 sctp: fix typo sctp_ulpevent_nofity_peer_addr_change change typo in function name "nofity" to "notify" sctp_ulpevent_nofity_peer_addr_change -> sctp_ulpevent_notify_peer_addr_change Signed-off-by: Jonas Falkevik Signed-off-by: David S. Miller commit b3ae2459f89773adcbf16fef4b68deaaa3be1929 Author: Tariq Toukan Date: Wed May 27 12:25:26 2020 +0300 net/tls: Add force_resync for driver resync This patch adds a field to the tls rx offload context which enables drivers to force a send_resync call. This field can be used by drivers to request a resync at the next possible tls record. It is beneficial for hardware that provides the resync sequence number asynchronously. In such cases, the packet that triggered the resync does not contain the information required for a resync. Instead, the driver requests resync for all the following TLS record until the asynchronous notification with the resync request TCP sequence arrives. A following series for mlx5e ConnectX-6DX TLS RX offload support will use this mechanism. Signed-off-by: Boris Pismenny Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Signed-off-by: David S. Miller commit bdad7f944170703b72c9fca942df5b85201d4e89 Merge: b3037ac50130 759ae57f1b7b Author: David S. Miller Date: Wed May 27 15:05:50 2020 -0700 Merge branch 'net_sched-reduce-the-number-of-qdisc-resets' Cong Wang says: ==================== net_sched: reduce the number of qdisc resets This patchset aims to reduce the number of qdisc resets during qdisc tear down. Patch 1~3 are preparation for their following patches, especially patch 2 and patch 3 add a few tracepoints so that we can observe the whole lifetime of qdisc's. Patch 4 and patch 5 are the ones do the actual work. Please find more details in each patch description. Vaclav Zindulka tested this patchset and his large ruleset with over 13k qdiscs defined got from 22s to 520ms. ==================== Signed-off-by: David S. Miller commit 759ae57f1b7bf5dfea1816f786f568d69efe34e2 Author: Cong Wang Date: Tue May 26 21:35:27 2020 -0700 net_sched: get rid of unnecessary dev_qdisc_reset() Resetting old qdisc on dev_queue->qdisc_sleeping in dev_qdisc_reset() is redundant, because this qdisc, even if not same with dev_queue->qdisc, is reset via qdisc_put() right after calling dev_graft_qdisc() when hitting refcnt 0. This is very easy to observe with qdisc_reset() tracepoint and stack traces. Reported-by: Václav Zindulka Tested-by: Václav Zindulka Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 70f50965338a12e17454c31ad5ece27069719358 Author: Cong Wang Date: Tue May 26 21:35:26 2020 -0700 net_sched: avoid resetting active qdisc for multiple times Except for sch_mq and sch_mqprio, each dev queue points to the same root qdisc, so when we reset the dev queues with netdev_for_each_tx_queue() we end up resetting the same instance of the root qdisc for multiple times. Avoid this by checking the __QDISC_STATE_DEACTIVATED bit in each iteration, so for sch_mq/sch_mqprio, we still reset all of them like before, for the rest, we only reset it once. Reported-by: Václav Zindulka Tested-by: Václav Zindulka Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit f5a7833e83628f18c1ee94e6ffcb1d232f029be9 Author: Cong Wang Date: Tue May 26 21:35:25 2020 -0700 net_sched: add a tracepoint for qdisc creation With this tracepoint, we could know when qdisc's are created, especially those default qdisc's. Sample output: tc-736 [001] ...1 56.230107: qdisc_create: dev=ens3 kind=pfifo parent=1:0 tc-736 [001] ...1 56.230113: qdisc_create: dev=ens3 kind=hfsc parent=ffff:ffff tc-738 [001] ...1 56.256816: qdisc_create: dev=ens3 kind=pfifo parent=1:100 tc-739 [001] ...1 56.267584: qdisc_create: dev=ens3 kind=pfifo parent=1:200 tc-740 [001] ...1 56.279649: qdisc_create: dev=ens3 kind=fq_codel parent=1:100 tc-741 [001] ...1 56.289996: qdisc_create: dev=ens3 kind=pfifo_fast parent=1:200 tc-745 [000] .N.1 111.687483: qdisc_create: dev=ens3 kind=ingress parent=ffff:fff1 Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit a34dac0b9055202cf9c64e08d8d8dc5e23029d3a Author: Cong Wang Date: Tue May 26 21:35:24 2020 -0700 net_sched: add tracepoints for qdisc_reset() and qdisc_destroy() Add two tracepoints for qdisc_reset() and qdisc_destroy() to track qdisc resetting and destroying. Sample output: tc-756 [000] ...3 138.355662: qdisc_reset: dev=ens3 kind=pfifo_fast parent=ffff:ffff handle=0:0 tc-756 [000] ...1 138.355720: qdisc_reset: dev=ens3 kind=pfifo_fast parent=ffff:ffff handle=0:0 tc-756 [000] ...1 138.355867: qdisc_reset: dev=ens3 kind=pfifo_fast parent=ffff:ffff handle=0:0 tc-756 [000] ...1 138.355930: qdisc_destroy: dev=ens3 kind=pfifo_fast parent=ffff:ffff handle=0:0 tc-757 [000] ...2 143.073780: qdisc_reset: dev=ens3 kind=fq_codel parent=ffff:ffff handle=8001:0 tc-757 [000] ...1 143.073878: qdisc_reset: dev=ens3 kind=fq_codel parent=ffff:ffff handle=8001:0 tc-757 [000] ...1 143.074114: qdisc_reset: dev=ens3 kind=fq_codel parent=ffff:ffff handle=8001:0 tc-757 [000] ...1 143.074228: qdisc_destroy: dev=ens3 kind=fq_codel parent=ffff:ffff handle=8001:0 Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 4909daba37846317ec7dcba16fba009636f7fe21 Author: Cong Wang Date: Tue May 26 21:35:23 2020 -0700 net_sched: use qdisc_reset() in qdisc_destroy() qdisc_destroy() calls ops->reset() and cleans up qdisc->gso_skb and qdisc->skb_bad_txq, these are nearly same with qdisc_reset(), so just call it directly, and cosolidate the code for the next patch. Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 011593480d2931392bc167f7a20c82a6c34114fd Author: Arnd Bergmann Date: Wed May 27 15:49:01 2020 +0200 binfmt_elf_fdpic: fix execfd build regression The change to bprm->have_execfd was incomplete, leading to a build failure: fs/binfmt_elf_fdpic.c: In function 'create_elf_fdpic_tables': fs/binfmt_elf_fdpic.c:591:27: error: 'BINPRM_FLAGS_EXECFD' undeclared Change the last user of BINPRM_FLAGS_EXECFD in a corresponding way. Reported-by: Valdis Klētnieks Fixes: b8a61c9e7b4a ("exec: Generic execfd support") Signed-off-by: Arnd Bergmann Signed-off-by: Eric W. Biederman commit b3037ac50130a169c3980e63f8df2f0b599db411 Author: Wang Wenhu Date: Tue May 26 20:32:22 2020 -0700 drivers: ipa: remove discription of nonexistent element No element named "client" exists within "struct ipa_endpoint". It might be a heritage forgotten to be removed. Delete it now. Signed-off-by: Wang Wenhu Signed-off-by: David S. Miller commit 8fa54b1160721e5d94a039cd736aa0c63044d58a Author: Wang Wenhu Date: Tue May 26 20:19:24 2020 -0700 drivers: ipa: fix typoes for ipa Change "transactio" -> "transaction". Also an alignment correction. Signed-off-by: Wang Wenhu Signed-off-by: David S. Miller commit be372e919c5ec8408f982ac3b7b5ac9fc63d7c40 Merge: d6a3511b60e7 a12daf13a449 Author: David S. Miller Date: Wed May 27 14:57:27 2020 -0700 Merge branch 'tcp-tcp_v4_err-cleanups' Eric Dumazet says: ==================== tcp: tcp_v4_err() cleanups This series is a followup of patch 239174945dac ("tcp: tcp_v4_err() icmp skb is named icmp_skb"). Move the RFC 6069 code into a helper, and rename icmp_skb to standard skb name so that tcp_v4_err() and tcp_v6_err() are using consistent names. ==================== Signed-off-by: David S. Miller commit a12daf13a4492bb7fb26231e52afb381927f938e Author: Eric Dumazet Date: Tue May 26 19:48:50 2020 -0700 tcp: rename tcp_v4_err() skb parameter This essentially reverts 4d1a2d9ec1c1 ("Revert Backoff [v3]: Rename skb to icmp_skb in tcp_v4_err()") Now we have tcp_ld_RTO_revert() helper, we can use the usual name for sk_buff parameter, so that tcp_v4_err() and tcp_v6_err() use similar names. Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit f745664257b62f6ba29f45fd21fbe7193b4da57b Author: Eric Dumazet Date: Tue May 26 19:48:49 2020 -0700 tcp: add tcp_ld_RTO_revert() helper RFC 6069 logic has been implemented for IPv4 only so far, right in the middle of tcp_v4_err() and was error prone. Move this code to one helper, to make tcp_v4_err() more readable and to eventually expand RFC 6069 to IPv6 in the future. Also perform sock_owned_by_user() check a bit sooner. Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Tested-by: Neal Cardwell Signed-off-by: David S. Miller commit d6a3511b60e74655f0a3d7d46cb0b4969e8c335d Merge: 4a11c551a64a 6f45a9bdd2ae Author: David S. Miller Date: Wed May 27 14:56:08 2020 -0700 Merge branch 'hns3-next' Huazhong Tan says: ==================== net: hns3: misc updates for -next This patchset includes some misc updates for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 6f45a9bdd2aee6cc1e4223fdc9e4f548a3f54595 Author: Huazhong Tan Date: Wed May 27 08:59:17 2020 +0800 net: hns3: add a print for initializing CMDQ when reset pending When initializing CMDQ fails because of reset pending, there is no hint for debugging, so adds a log for it. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 01952206e17ee34b5fe32f211619ac59ec043990 Author: Yufeng Mo Date: Wed May 27 08:59:16 2020 +0800 net: hns3: remove unnecessary MAC enable in app loopback Packets will not pass through MAC during app loopback. Therefore, it is meaningless to enable MAC while doing app loopback. This patch removes this unnecessary action. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 60c800c64d8fdd2fc5b8c62686fb08c6a6fb1045 Author: Yufeng Mo Date: Wed May 27 08:59:15 2020 +0800 net: hns3: change the order of reinitializing RoCE and NIC client during reset The HNS RDMA driver will support VF device later, whose re-initialization should be done after PF's. This patch changes the order of hclge_reset_prepare_up() and hclge_notify_roce_client(), so that PF's RoCE client will be reinitialized before VF's. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 4cd5beaa89a95b331e5586d55469f5569faa18f6 Author: Guangbin Huang Date: Wed May 27 08:59:14 2020 +0800 net: hns3: add a resetting check in hclgevf_init_nic_client_instance() To prevent from initializing VF NIC client in reset handling state, this patch adds resetting check in hclgevf_init_nic_client_instance(). Signed-off-by: Guangbin Huang Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 4a11c551a64ad4dbbda81bf5b4832a972fbca442 Merge: 626a83238e6a b2e118f638fb Author: David S. Miller Date: Wed May 27 14:54:32 2020 -0700 Merge branch 'net-mscc-allow-forwarding-ioctl-operations-to-attached-PHYs' Antoine Tenart says: ==================== net: mscc: allow forwarding ioctl operations to attached PHYs These two patches allow forwarding ioctl to the PHY MII implementation, and support is added for offloading timestamping operations to compatible attached PHYs. ==================== Signed-off-by: David S. Miller commit b2e118f638fb8984e430624a8cf27483cc23cf8d Author: Antoine Tenart Date: Tue May 26 17:01:49 2020 +0200 net: mscc: allow offloading timestamping operations to the PHY This patch adds support for offloading timestamping operations not only to the Ocelot switch (as already supported) but to compatible PHYs. When both the PHY and the Ocelot switch support timestamping operations, the PHY implementation is chosen as the timestamp will happen closer to the medium. Signed-off-by: Antoine Tenart Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 7ff4f3f315db361e35c1d61a6fdbfddbe345b633 Author: Antoine Tenart Date: Tue May 26 17:01:48 2020 +0200 net: mscc: use the PHY MII ioctl interface when possible Allow ioctl to be implemented by the PHY, when a PHY is attached to the Ocelot switch. In case the ioctl is a request to set or get the hardware timestamp, use the Ocelot switch implementation for now. Signed-off-by: Antoine Tenart Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3910ebaca8eae0cb9d41a20efe1bcb375ec64dfb Author: Krzysztof Wilczyński Date: Tue May 26 21:39:05 2020 +0000 PCI: Rename _DSM constants to align with spec Rename PCI-related _DSM constants to align them with the PCI Firmware Spec, r3.2, sec 4.6. No functional change intended. Link: https://lore.kernel.org/r/20200526213905.2479381-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit 5727043c73fdfe04597971b5f3f4850d879c1f4f Author: Kevin Buettner Date: Sun May 24 00:35:29 2020 -0700 PCI: Avoid FLR for AMD Starship USB 3.0 The AMD Starship USB 3.0 host controller advertises Function Level Reset support, but it apparently doesn't work. Add a quirk to prevent use of FLR on this device. Without this quirk, when attempting to assign (pass through) an AMD Starship USB 3.0 host controller to a guest OS, the system becomes increasingly unresponsive over the course of several minutes, eventually requiring a hard reset. Shortly after attempting to start the guest, I see these messages: vfio-pci 0000:05:00.3: not ready 1023ms after FLR; waiting vfio-pci 0000:05:00.3: not ready 2047ms after FLR; waiting vfio-pci 0000:05:00.3: not ready 4095ms after FLR; waiting vfio-pci 0000:05:00.3: not ready 8191ms after FLR; waiting And then eventually: vfio-pci 0000:05:00.3: not ready 65535ms after FLR; giving up INFO: NMI handler (perf_event_nmi_handler) took too long to run: 0.000 msecs perf: interrupt took too long (642744 > 2500), lowering kernel.perf_event_max_sample_rate to 1000 INFO: NMI handler (perf_event_nmi_handler) took too long to run: 82.270 msecs INFO: NMI handler (perf_event_nmi_handler) took too long to run: 680.608 msecs INFO: NMI handler (perf_event_nmi_handler) took too long to run: 100.952 msecs ... watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [qemu-system-x86:7487] Tested on a Micro-Star International Co., Ltd. MS-7C59/Creator TRX40 motherboard with an AMD Ryzen Threadripper 3970X. Link: https://lore.kernel.org/r/20200524003529.598434ff@f31-4.lan Signed-off-by: Kevin Buettner Signed-off-by: Bjorn Helgaas commit 0d14f06cd6657ba3446a5eb780672da487b068e7 Author: Marcos Scriven Date: Wed May 20 18:23:30 2020 -0500 PCI: Avoid FLR for AMD Matisse HD Audio & USB 3.0 The AMD Matisse HD Audio & USB 3.0 devices advertise Function Level Reset support, but hang when an FLR is triggered. To reproduce the problem, attach the device to a VM, then detach and try to attach again. Rename the existing quirk_intel_no_flr(), which was not Intel-specific, to quirk_no_flr(), and apply it to prevent the use of FLR on these AMD devices. Link: https://lore.kernel.org/r/CAAri2DpkcuQZYbT6XsALhx2e6vRqPHwtbjHYeiH7MNp4zmt1RA@mail.gmail.com Signed-off-by: Marcos Scriven Signed-off-by: Bjorn Helgaas commit 60369a4f8d61bacd437adab0518581afb90bea24 Author: Wei Liu Date: Tue Apr 28 15:36:40 2020 +0000 x86/PCI: Drop unused xen_register_pirq() gsi_override parameter All callers of xen_register_pirq() pass -1 (no override) for the gsi_override parameter. Remove it and related code. Link: https://lore.kernel.org/r/20200428153640.76476-1-wei.liu@kernel.org Signed-off-by: Wei Liu Signed-off-by: Bjorn Helgaas Reviewed-by: Boris Ostrovsky commit 5b6743fb2c2a1fcb31c8b227558f537095dbece4 Author: Pablo Neira Ayuso Date: Sat May 23 12:05:22 2020 +0200 netfilter: nf_tables: skip flowtable hooknum and priority on device updates On device updates, the hooknum and priority attributes are not required. This patch makes optional these two netlink attributes. Moreover, bail out with EOPNOTSUPP if userspace tries to update the hooknum and priority for existing flowtables. While at this, turn EINVAL into EOPNOTSUPP in case the hooknum is not ingress. EINVAL is reserved for missing netlink attribute / malformed netlink messages. Signed-off-by: Pablo Neira Ayuso commit 05abe4456fa376040f6cc3cc6830d2e328723478 Author: Pablo Neira Ayuso Date: Wed May 20 15:44:37 2020 +0200 netfilter: nf_tables: allow to register flowtable with no devices A flowtable might be composed of dynamic interfaces only. Such dynamic interfaces might show up at a later stage. This patch allows users to register a flowtable with no devices. Once the dynamic interface becomes available, the user adds the dynamic devices to the flowtable. Signed-off-by: Pablo Neira Ayuso commit abadb2f865d72a223d691fc68e006943ecadf0d9 Author: Pablo Neira Ayuso Date: Wed May 20 13:46:51 2020 +0200 netfilter: nf_tables: delete devices from flowtable This patch allows users to delete devices from existing flowtables. Signed-off-by: Pablo Neira Ayuso commit 78d9f48f7f44431a25da2b46b3a8812f6ff2b981 Author: Pablo Neira Ayuso Date: Wed May 20 13:46:47 2020 +0200 netfilter: nf_tables: add devices to existing flowtable This patch allows users to add devices to an existing flowtable. Signed-off-by: Pablo Neira Ayuso commit c42d8bda69e291c5551497a02db71b50d95510d4 Author: Pablo Neira Ayuso Date: Wed May 20 13:44:18 2020 +0200 netfilter: nf_tables: pass hook list to flowtable event notifier Update the flowtable netlink notifier to take the list of hooks as input. This allows to reuse this function in incremental flowtable hook updates. Signed-off-by: Pablo Neira Ayuso commit 389a2cbcb7f15e2af9babdc0c63cec318537e7ed Author: Pablo Neira Ayuso Date: Wed May 20 13:43:43 2020 +0200 netfilter: nf_tables: add nft_flowtable_hooks_destroy() This patch adds a helper function destroy the flowtable hooks. Signed-off-by: Pablo Neira Ayuso commit f9382669cf5e75ebc7636bd78e637facf27d53f7 Author: Pablo Neira Ayuso Date: Tue May 19 01:00:07 2020 +0200 netfilter: nf_tables: pass hook list to nft_{un,}register_flowtable_net_hooks() This patch prepares for incremental flowtable hook updates. Signed-off-by: Pablo Neira Ayuso commit d9246a53752fdb777ed176d5f091c4ac0e482bba Author: Pablo Neira Ayuso Date: Wed May 20 13:42:44 2020 +0200 netfilter: nf_tables: generalise flowtable hook parsing Update nft_flowtable_parse_hook() to take the flowtable hook list as parameter. This allows to reuse this function to update the hooks. Signed-off-by: Pablo Neira Ayuso commit cb8aa9a3affb7d23b11b11fbed41e2feaabc4b0a Author: Romain Bellan Date: Mon May 4 21:34:29 2020 +0200 netfilter: ctnetlink: add kernel side filtering for dump Conntrack dump does not support kernel side filtering (only get exists, but it returns only one entry. And user has to give a full valid tuple) It means that userspace has to implement filtering after receiving many irrelevant entries, consuming resources (conntrack table is sometimes very huge, much more than a routing table for example). This patch adds filtering in kernel side. To achieve this goal, we: * Add a new CTA_FILTER netlink attributes, actually a flag list to parametize filtering * Convert some *nlattr_to_tuple() functions, to allow a partial parsing of CTA_TUPLE_ORIG and CTA_TUPLE_REPLY (so nf_conntrack_tuple it not fully set) Filtering is now possible on: * IP SRC/DST values * Ports for TCP and UDP flows * IMCP(v6) codes types and IDs Filtering is done as an "AND" operator. For example, when flags PROTO_SRC_PORT, PROTO_NUM and IP_SRC are sets, only entries matching all values are dumped. Changes since v1: Set NLM_F_DUMP_FILTERED in nlm flags if entries are filtered Changes since v2: Move several constants to nf_internals.h Move a fix on netlink values check in a separate patch Add a check on not-supported flags Return EOPNOTSUPP if CDA_FILTER is set in ctnetlink_flush_conntrack (not yet implemented) Code style issues Changes since v3: Fix compilation warning reported by kbuild test robot Changes since v4: Fix a regression introduced in v3 (returned EINVAL for valid netlink messages without CTA_MARK) Changes since v5: Change definition of CTA_FILTER_F_ALL Fix a regression when CTA_TUPLE_ZONE is not set Signed-off-by: Romain Bellan Signed-off-by: Florent Fourcot Signed-off-by: Pablo Neira Ayuso commit 50aec2c3135efd985291adc2e4d1278d52b03de9 Author: Leon Romanovsky Date: Tue May 26 14:54:40 2020 +0300 RDMA/mlx5: Return ECE data after modify QP After users sets the ECE option, FW will return the agreed/supported bits through an output structures of modify QP stages for regular QPs or through create QP for the DCT. Link: https://lore.kernel.org/r/20200526115440.205922-9-leon@kernel.org Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5f62a521ff20e0b47a8d33421334bd245d6714ff Author: Leon Romanovsky Date: Tue May 26 14:54:39 2020 +0300 RDMA/mlx5: Set ECE options during modify QP The most common way to set ECE option will be during modify QP command in INIT2RTR, RTR2RTS and RTS2RTS stages, so update mlx5 to support it. The new bit in the comp_mask is needed to mark that kernel supports ECE and can receive data instead of "reserved" field in the struct mlx5_ib_modify_qp. Link: https://lore.kernel.org/r/20200526115440.205922-8-leon@kernel.org Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f18e26af6aba778b888044859d9c69bb9bbc7bc1 Author: Leon Romanovsky Date: Tue May 26 14:54:38 2020 +0300 RDMA/mlx5: Convert modify QP to use MLX5_SET macros Instead of hand crafted mlx5_qp_context and mlx5_qp_path use common MLX5_SET() macros. Link: https://lore.kernel.org/r/20200526115440.205922-7-leon@kernel.org Reviewed-by: Maor Gottlieb Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 70bd7fb8762528ac0e69a8ae0f485298dff57043 Author: Leon Romanovsky Date: Tue May 26 14:54:37 2020 +0300 RDMA/mlx5: Remove manually crafted QP context the query call As a preparation to removal hand crafted mlx5_qp_context, convert query_qp_attr() to use proper MLX5_GET() macros. Link: https://lore.kernel.org/r/20200526115440.205922-6-leon@kernel.org Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 64bae2d455f6058572ac4d23a8ea9e47c9d10f03 Author: Leon Romanovsky Date: Tue May 26 14:54:36 2020 +0300 RDMA/mlx5: Use direct modify QP implementation As a preparation to removal hand crafted mlx5_qp_context, convert counter code to use mlx5_cmd_exec_in() directly. Link: https://lore.kernel.org/r/20200526115440.205922-5-leon@kernel.org Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e383085c24255821e79d3c2aa6302d804b6a1c48 Author: Leon Romanovsky Date: Tue May 26 14:54:35 2020 +0300 RDMA/mlx5: Set ECE options during QP create Allow users to ask creation of QPs with specific ECE options. Such early set even before RDMA-CM connection is established is useful if user knows exactly which option he needs. Link: https://lore.kernel.org/r/20200526115440.205922-4-leon@kernel.org Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 3e09a427ae7ac347e08dca5ffac64c902860d675 Author: Leon Romanovsky Date: Tue May 26 14:54:34 2020 +0300 RDMA/mlx5: Get ECE options from FW during create QP Supported ECE options are returned from FW in the create_qp phase and zero means that field is not valid. Such default value allows us to reuse reserved field without worries about comp_mask. Update create QP API to return ECE options. Link: https://lore.kernel.org/r/20200526115440.205922-3-leon@kernel.org Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a Author: Leon Romanovsky Date: Tue May 26 13:33:04 2020 +0300 RDMA/cma: Provide ECE reject reason IBTA declares "vendor option not supported" reject reason in REJ messages if passive side doesn't want to accept proposed ECE options. Due to the fact that ECE is managed by userspace, there is a need to let users to provide such rejected reason. Link: https://lore.kernel.org/r/20200526103304.196371-7-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0cb15372a615a9835893f43e86ae45399eb63996 Author: Leon Romanovsky Date: Tue May 26 13:33:03 2020 +0300 RDMA/cma: Connect ECE to rdma_accept The rdma_accept() is called by both passive and active sides of CMID connection to mark readiness to start data transfer. For passive side, this is called explicitly, for active side, it is called implicitly while receiving REP message. Provide ECE data to rdma_accept function needed for passive side to send that REP message. Link: https://lore.kernel.org/r/20200526103304.196371-6-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a20652e175f2c5cea74c90503eeaeafabd08abed Author: Leon Romanovsky Date: Tue May 26 13:33:02 2020 +0300 RDMA/cm: Send and receive ECE parameter over the wire ECE parameters are exchanged through REQ->REP/SIDR_REP messages, this patch adds the data to provide to other side of CMID communication channel. Link: https://lore.kernel.org/r/20200526103304.196371-5-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 93531ee7b9d1313227d2b4f354989895e8d57b72 Author: Leon Romanovsky Date: Tue May 26 13:33:01 2020 +0300 RDMA/ucma: Deliver ECE parameters through UCMA events Passive side of CMID connection receives ECE request through REQ message and needs to respond with relevant REP message which will be forwarded to active side. The UCMA events interface is responsible for such communication with the user space (librdmacm). Extend it to provide ECE wire data. Link: https://lore.kernel.org/r/20200526103304.196371-4-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 34e2ab57a911f8b32b22580d11a02f0b79108245 Author: Leon Romanovsky Date: Tue May 26 13:33:00 2020 +0300 RDMA/ucma: Extend ucma_connect to receive ECE parameters Active side of CMID initiates connection through librdmacm's rdma_connect() and kernel's ucma_connect(). Extend UCMA interface to handle those new parameters. Link: https://lore.kernel.org/r/20200526103304.196371-3-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fef17f91da7d4af11dde1ff832b82d6a64f89562 Author: Leon Romanovsky Date: Tue May 26 13:32:59 2020 +0300 RDMA/cm: Add Enhanced Connection Establishment (ECE) bits Extend REQ (request for communications), REP (reply to request for communication), rejected reason and SIDR_REP (service ID resolution response) structures with hardware vendor ID bits according to IBTA v1.4. Link: https://lore.kernel.org/r/20200526103304.196371-2-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e4fdf7625b68f32681240b3a43cb82b9f3555bf6 Merge: d246a3061528 6b646a7e4af6 Author: Jason Gunthorpe Date: Wed May 27 16:01:17 2020 -0300 Merge branch 'mellanox/mlx5-next' into rdma.git for/next From the mlx5-next branch at git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Required for dependencies in following patches * branch 'mellanox/mlx5-next': net/mlx5: Add ability to read and write ECE options net/mlx5: Add support for RDMA TX FT headers modifying net/mlx5: Move iseg access helper routines close to mlx5_core driver net/mlx5: Cleanup mlx5_ifc_fte_match_set_misc2_bits Signed-off-by: Jason Gunthorpe commit d246a3061528be6d852156d25c02ea69d6db7e65 Author: Mark Zhang Date: Wed May 27 16:57:03 2020 +0300 IB/mlx5: Fix DEVX support for MLX5_CMD_OP_INIT2INIT_QP command The commit citied in the Fixes line wasn't complete and solved only part of the problems. Update the mlx5_ib to properly support MLX5_CMD_OP_INIT2INIT_QP command in the DEVX, that is required when modify the QP tx_port_affinity. Fixes: 819f7427bafd ("RDMA/mlx5: Add init2init as a modify command") Link: https://lore.kernel.org/r/20200527135703.482501-1-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 626a83238e6a63d88a5b5291febe797b244b5f18 Author: Vladimir Oltean Date: Wed May 27 19:45:38 2020 +0300 net: dsa: felix: accept VLAN config regardless of bridge VLAN awareness state The ocelot core library is written with the idea in mind that the VLAN table is populated by the bridge. Otherwise, not even a sane default pvid is provided: in standalone mode, the default pvid is 0, and the core expects the bridge layer to change it to 1. So without this patch, the VLAN table is completely empty at the end of the commands below, and traffic is broken as a result: ip link add dev br0 type bridge vlan_filtering 0 && ip link set dev br0 up for eth in $(ls /sys/bus/pci/devices/0000\:00\:00.5/net/); do ip link set dev $eth master br0 ip link set dev $eth up done ip link set dev br0 type bridge vlan_filtering 1 Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5a1b72cebc774ec68854dab59c6838d795ee9370 Author: Stephen Worley Date: Wed May 27 12:41:42 2020 -0400 net: add large ecmp group nexthop tests Add a couple large ecmp group nexthop selftests to cover the remnant fixed by d69100b8eee27c2d60ee52df76e0b80a8d492d34. The tests create 100 x32 ecmp groups of ipv4 and ipv6 and then dump them. On kernels without the fix, they will fail due to data remnant during the dump. Signed-off-by: Stephen Worley Reviewed-by: David Ahern Reviewed-by: David Ahern Signed-off-by: David S. Miller commit f99c0646ef83076dba88255c42482d1b4325f890 Author: Arnd Bergmann Date: Wed May 27 15:34:45 2020 +0200 mtk-star-emac: mark PM functions as __maybe_unused Without CONFIG_PM, the compiler warns about two unused functions: drivers/net/ethernet/mediatek/mtk_star_emac.c:1472:12: error: unused function 'mtk_star_suspend' [-Werror,-Wunused-function] drivers/net/ethernet/mediatek/mtk_star_emac.c:1488:12: error: unused function 'mtk_star_resume' [-Werror,-Wunused-function] Mark these as __maybe_unused. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Arnd Bergmann Acked-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 20f6a05ef63594feb0c6dfbd629da0448b43124d Author: Horatiu Vultur Date: Wed May 27 12:34:30 2020 +0000 bridge: mrp: Rework the MRP netlink interface This patch reworks the MRP netlink interface. Before, each attribute represented a binary structure which made it hard to be extended. Therefore update the MRP netlink interface such that each existing attribute to be a nested attribute which contains the fields of the binary structures. In this way the MRP netlink interface can be extended without breaking the backwards compatibility. It is also using strict checking for attributes under the MRP top attribute. Signed-off-by: Horatiu Vultur Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 9f01a71c5cbec10b851588457089d17c20dc5a40 Author: Colin Ian King Date: Wed May 27 13:01:29 2020 +0100 net: dsa: b53: remove redundant premature assignment to new_pvid Variable new_pvid is being assigned with a value that is never read, the following if statement updates new_pvid with a new value in both of the if paths. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit f96e9641e92b54de27b93d1af03d74b8304ce00a Author: Bartosz Golaszewski Date: Wed May 27 11:24:04 2020 +0200 net: ethernet: mtk-star-emac: fix error path in RX handling The dma_addr field in desc_data must not be overwritten until after the new skb is mapped. Currently we do replace it with uninitialized value in error path. This change fixes it by moving the assignment before the label to which we jump after mapping or allocation errors. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Reported-by: Nathan Chancellor Signed-off-by: Bartosz Golaszewski Tested-by: Nathan Chancellor # build Signed-off-by: David S. Miller commit 7cf4eda481b235cbc7c210715cce19fde3d23d55 Author: Colin Ian King Date: Wed May 27 09:15:55 2020 +0100 mlxsw: spectrum_router: remove redundant initialization of pointer br_dev The pointer br_dev is being initialized with a value that is never read and is being updated with a new value later on. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit d8e79f1dbcee8032667c0718a654c749d64f6304 Author: Nathan Chancellor Date: Wed May 27 01:00:20 2020 -0700 nexthop: Fix type of event_type in call_nexthop_notifiers Clang warns: net/ipv4/nexthop.c:841:30: warning: implicit conversion from enumeration type 'enum nexthop_event_type' to different enumeration type 'enum fib_event_type' [-Wenum-conversion] call_nexthop_notifiers(net, NEXTHOP_EVENT_DEL, nh); ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~ 1 warning generated. Use the right type for event_type so that clang does not warn. Fixes: 8590ceedb701 ("nexthop: add support for notifiers") Link: https://github.com/ClangBuiltLinux/linux/issues/1038 Signed-off-by: Nathan Chancellor Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c6b22f59d694d0caf61aefb262d9639b3d9661d5 Author: Paolo Bonzini Date: Tue May 26 09:05:27 2020 -0400 KVM: x86: track manually whether an event has been injected Instead of calling kvm_event_needs_reinjection, track its future return value in a variable. This will be useful in the next patch. Signed-off-by: Paolo Bonzini commit b6162e82aef19fee9c32cb3fe9ac30d9116a8c73 Author: Vitaly Kuznetsov Date: Wed May 27 11:01:02 2020 +0200 KVM: nSVM: Preserve registers modifications done before nested_svm_vmexit() L2 guest hang is observed after 'exit_required' was dropped and nSVM switched to check_nested_events() completely. The hang is a busy loop when e.g. KVM is emulating an instruction (e.g. L2 is accessing MMIO space and we drop to userspace). After nested_svm_vmexit() and when L1 is doing VMRUN nested guest's RIP is not advanced so KVM goes into emulating the same instruction which caused nested_svm_vmexit() and the loop continues. nested_svm_vmexit() is not new, however, with check_nested_events() we're now calling it later than before. In case by that time KVM has modified register state we may pick stale values from VMCB when trying to save nested guest state to nested VMCB. nVMX code handles this case correctly: sync_vmcs02_to_vmcs12() called from nested_vmx_vmexit() does e.g 'vmcs12->guest_rip = kvm_rip_read(vcpu)' and this ensures KVM-made modifications are preserved. Do the same for nSVM. Generally, nested_vmx_vmexit()/nested_svm_vmexit() need to pick up all nested guest state modifications done by KVM after vmexit. It would be great to find a way to express this in a way which would not require to manually track these changes, e.g. nested_{vmcb,vmcs}_get_field(). Co-debugged-with: Paolo Bonzini Signed-off-by: Vitaly Kuznetsov Message-Id: <20200527090102.220647-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 7d2e8748af62b0de7c7bbcb0d62f937e88fd7027 Author: Sean Christopherson Date: Wed May 27 01:54:00 2020 -0700 KVM: x86: Initialize tdp_level during vCPU creation Initialize vcpu->arch.tdp_level during vCPU creation to avoid consuming garbage if userspace calls KVM_RUN without first calling KVM_SET_CPUID. Fixes: e93fd3b3e89e9 ("KVM: x86/mmu: Capture TDP level when updating CPUID") Reported-by: syzbot+904752567107eefb728c@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Message-Id: <20200527085400.23759-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 6c0238c4a62b3a0b1201aeb7e33a4636d552a436 Author: Paolo Bonzini Date: Wed May 20 08:02:17 2020 -0400 KVM: nSVM: leave ASID aside in copy_vmcb_control_area Restoring the ASID from the hsave area on VMEXIT is wrong, because its value depends on the handling of TLB flushes. Just skipping the field in copy_vmcb_control_area will do. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit a3535be731c2a343912578465021f50937f7b099 Author: Paolo Bonzini Date: Sat May 16 09:19:06 2020 -0400 KVM: nSVM: fix condition for filtering async PF Async page faults have to be trapped in the host (L1 in this case), since the APF reason was passed from L0 to L1 and stored in the L1 APF data page. This was completely reversed: the page faults were passed to the guest, a L2 hypervisor. Cc: stable@vger.kernel.org Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 88197e6ab33a909e54f683b5e3a2e45cc307108a Author: 彭浩(Richard) Date: Thu May 21 05:57:49 2020 +0000 kvm/x86: Remove redundant function implementations pic_in_kernel(), ioapic_in_kernel() and irqchip_kernel() have the same implementation. Signed-off-by: Peng Hao Message-Id: Signed-off-by: Paolo Bonzini commit 80bc97f2d84dbec6df6b36d6bbc0715c14f80c61 Author: Haiwei Li Date: Mon May 18 09:31:38 2020 +0800 KVM: Fix the indentation to match coding style There is a bad indentation in next&queue branch. The patch looks like fixes nothing though it fixes the indentation. Before fixing: if (!handle_fastpath_set_x2apic_icr_irqoff(vcpu, data)) { kvm_skip_emulated_instruction(vcpu); ret = EXIT_FASTPATH_EXIT_HANDLED; } break; case MSR_IA32_TSCDEADLINE: After fixing: if (!handle_fastpath_set_x2apic_icr_irqoff(vcpu, data)) { kvm_skip_emulated_instruction(vcpu); ret = EXIT_FASTPATH_EXIT_HANDLED; } break; case MSR_IA32_TSCDEADLINE: Signed-off-by: Haiwei Li Message-Id: <2f78457e-f3a7-3bc9-e237-3132ee87f71e@gmail.com> Signed-off-by: Paolo Bonzini commit a8cfbae59284ef20f38936a135f82a4d8d9105d2 Author: Miaohe Lin Date: Wed Feb 19 10:45:48 2020 +0800 KVM: VMX: replace "fall through" with "return" to indicate different case The second "/* fall through */" in rmode_exception() makes code harder to read. Replace it with "return" to indicate they are different cases, only the #DB and #BP check vcpu->guest_debug, while others don't care. And this also improves the readability. Suggested-by: Vitaly Kuznetsov Reviewed-by: Vitaly Kuznetsov Signed-off-by: Miaohe Lin Message-Id: <1582080348-20827-1-git-send-email-linmiaohe@huawei.com> Signed-off-by: Paolo Bonzini commit cb97c2d680dd9cefd2b36cafd2426f52d85b27e7 Author: Sean Christopherson Date: Tue Feb 18 15:40:11 2020 -0800 KVM: x86: Take an unsigned 32-bit int for has_emulated_msr()'s index Take a u32 for the index in has_emulated_msr() to match hardware, which treats MSR indices as unsigned 32-bit values. Functionally, taking a signed int doesn't cause problems with the current code base, but could theoretically cause problems with 32-bit KVM, e.g. if the index were checked via a less-than statement, which would evaluate incorrectly for MSR indices with bit 31 set. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200218234012.7110-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 7cb85fc465fdb91e88eff02b496150b1270952cf Author: Sean Christopherson Date: Tue Feb 18 15:40:10 2020 -0800 KVM: x86: Remove superfluous brackets from case statement Remove unnecessary brackets from a case statement that unintentionally encapsulates unrelated case statements in the same switch statement. While technically legal and functionally correct syntax, the brackets are visually confusing and potentially dangerous, e.g. the last of the encapsulated case statements has an undocumented fall-through that isn't flagged by compilers due the encapsulation. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200218234012.7110-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit df2a69af85bef169ab6810cc57f6b6b943941e7e Author: Paolo Bonzini Date: Tue May 19 12:51:32 2020 -0400 KVM: x86: allow KVM_STATE_NESTED_MTF_PENDING in kvm_state flags The migration functionality was left incomplete in commit 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing instruction emulation", 2020-02-23), fix it. Fixes: 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing instruction emulation") Cc: stable@vger.kernel.org Reviewed-by: Oliver Upton Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 7529e767c2a94b33a689ff9c1293e351ecc234ee Merge: 4c7ccc3bf746 e7581caca4c1 Author: Paolo Bonzini Date: Wed May 27 13:10:29 2020 -0400 Merge branch 'kvm-master' into HEAD Merge AMD fixes before doing more development work. commit 4c7ccc3bf746c625cfb352a1d6082f6460cbbce0 Merge: 9d5272f5e361 0b545fd17f84 Author: Paolo Bonzini Date: Wed May 27 13:10:21 2020 -0400 Merge tag 'kvm-s390-next-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Cleanups for 5.8 - vsie (nesting) cleanups - remove unneeded semicolon commit e7581caca4c105d81a490a3e15cf46d6407e3fa7 Author: Paolo Bonzini Date: Tue May 19 05:04:49 2020 -0400 KVM: x86: simplify is_mmio_spte We can simply look at bits 52-53 to identify MMIO entries in KVM's page tables. Therefore, there is no need to pass a mask to kvm_mmu_set_mmio_spte_mask. Signed-off-by: Paolo Bonzini commit f4cfcd2d5aea4e96c5d483c476f3057b6b7baf6a Author: Maxim Levitsky Date: Sat May 23 19:14:55 2020 +0300 KVM: x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception. Cc: stable@vger.kernel.org Fixes: 6e3ba4abce ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL") Signed-off-by: Maxim Levitsky Message-Id: <20200523161455.3940-3-mlevitsk@redhat.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 0abcc8f65cc23b65bc8d1614cc64b02b1641ed7c Author: Maxim Levitsky Date: Sat May 23 19:14:54 2020 +0300 KVM: VMX: enable X86_FEATURE_WAITPKG in KVM capabilities Even though we might not allow the guest to use WAITPKG's new instructions, we should tell KVM that the feature is supported by the host CPU. Note that vmx_waitpkg_supported checks that WAITPKG _can_ be set in secondary execution controls as specified by VMX capability MSR, rather that we actually enable it for a guest. Cc: stable@vger.kernel.org Fixes: e69e72faa3a0 ("KVM: x86: Add support for user wait instructions") Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Message-Id: <20200523161455.3940-2-mlevitsk@redhat.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 6129ed877d409037b79866327102c9dc59a302fe Author: Sean Christopherson Date: Wed May 27 01:49:09 2020 -0700 KVM: x86/mmu: Set mmio_value to '0' if reserved #PF can't be generated Set the mmio_value to '0' instead of simply clearing the present bit to squash a benign warning in kvm_mmu_set_mmio_spte_mask() that complains about the mmio_value overlapping the lower GFN mask on systems with 52 bits of PA space. Opportunistically clean up the code and comments. Cc: stable@vger.kernel.org Fixes: d43e2675e96fc ("KVM: x86: only do L1TF workaround on affected processors") Signed-off-by: Sean Christopherson Message-Id: <20200527084909.23492-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit bebcfe85f4338ba1434561a460169a5e0af78f98 Author: Gustavo A. R. Silva Date: Wed May 27 09:41:52 2020 -0500 RDMA/core: Use sizeof_field() helper Make use of the sizeof_field() helper instead of an open-coded version. Link: https://lore.kernel.org/r/20200527144152.GA22605@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jason Gunthorpe commit fff2d0f701e6753591609739f8ab9be1c8e80ebb Author: Arnd Bergmann Date: Wed May 27 15:51:57 2020 +0200 hwmon: (applesmc) avoid overlong udelay() Building this driver with "clang -O3" produces a link error after the compiler partially unrolls the loop and 256ms becomes a compile-time constant that triggers the check in udelay(): ld.lld: error: undefined symbol: __bad_udelay >>> referenced by applesmc.c >>> hwmon/applesmc.o:(read_smc) in archive drivers/built-in.a I can see no reason against using a sleeping function here, as no part of the driver runs in atomic context, so instead use usleep_range() with a wide range and use jiffies for the end condition. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200527135207.1118624-1-arnd@arndb.de Signed-off-by: Guenter Roeck commit ad1e4f74c072eaa2c6d77dd710db31aafecd614f Author: Domenico Andreoli Date: Tue May 19 20:14:10 2020 +0200 PM: hibernate: Restrict writes to the resume device Hibernation via snapshot device requires write permission to the swap block device, the one that more often (but not necessarily) is used to store the hibernation image. With this patch, such permissions are granted iff: 1) snapshot device config option is enabled 2) swap partition is used as resume device In other circumstances the swap device is not writable from userspace. In order to achieve this, every write attempt to a swap device is checked against the device configured as part of the uswsusp API [0] using a pointer to the inode struct in memory. If the swap device being written was not configured for resuming, the write request is denied. NOTE: this implementation works only for swap block devices, where the inode configured by swapon (which sets S_SWAPFILE) is the same used by SNAPSHOT_SET_SWAP_AREA. In case of swap file, SNAPSHOT_SET_SWAP_AREA indeed receives the inode of the block device containing the filesystem where the swap file is located (+ offset in it) which is never passed to swapon and then has not set S_SWAPFILE. As result, the swap file itself (as a file) has never an option to be written from userspace. Instead it remains writable if accessed directly from the containing block device, which is always writeable from root. [0] Documentation/power/userland-swsusp.rst v2: - rename is_hibernate_snapshot_dev() to is_hibernate_resume_dev() - fix description so to correctly refer to the resume device Signed-off-by: Domenico Andreoli Acked-by: Darrick J. Wong Signed-off-by: Rafael J. Wysocki commit e5c399b0bd6490c12c0af2a9eaa9d7cd805d52c9 Author: Ard Biesheuvel Date: Wed May 27 13:37:00 2020 +0200 ACPI: GED: use correct trigger type field in _Exx / _Lxx handling Commit ea6f3af4c5e63f69 ("ACPI: GED: add support for _Exx / _Lxx handler methods") added a reference to the 'triggering' field of either the normal or the extended ACPI IRQ resource struct, but inadvertently used the wrong pointer in the latter case. Note that both pointers refer to the same union, and the 'triggering' field appears at the same offset in both struct types, so it currently happens to work by accident. But let's fix it nonetheless Fixes: ea6f3af4c5e63f69 ("ACPI: GED: add support for _Exx / _Lxx handler methods") Signed-off-by: Ard Biesheuvel Signed-off-by: Rafael J. Wysocki commit 6dcde60efd946e38fac8d276a6ca47492103e856 Author: Darrick J. Wong Date: Tue May 26 09:33:11 2020 -0700 xfs: more lockdep whackamole with kmem_alloc* Dave Airlie reported the following lockdep complaint: > ====================================================== > WARNING: possible circular locking dependency detected > 5.7.0-0.rc5.20200515git1ae7efb38854.1.fc33.x86_64 #1 Not tainted > ------------------------------------------------------ > kswapd0/159 is trying to acquire lock: > ffff9b38d01a4470 (&xfs_nondir_ilock_class){++++}-{3:3}, > at: xfs_ilock+0xde/0x2c0 [xfs] > > but task is already holding lock: > ffffffffbbb8bd00 (fs_reclaim){+.+.}-{0:0}, at: > __fs_reclaim_acquire+0x5/0x30 > > which lock already depends on the new lock. > > > the existing dependency chain (in reverse order) is: > > -> #1 (fs_reclaim){+.+.}-{0:0}: > fs_reclaim_acquire+0x34/0x40 > __kmalloc+0x4f/0x270 > kmem_alloc+0x93/0x1d0 [xfs] > kmem_alloc_large+0x4c/0x130 [xfs] > xfs_attr_copy_value+0x74/0xa0 [xfs] > xfs_attr_get+0x9d/0xc0 [xfs] > xfs_get_acl+0xb6/0x200 [xfs] > get_acl+0x81/0x160 > posix_acl_xattr_get+0x3f/0xd0 > vfs_getxattr+0x148/0x170 > getxattr+0xa7/0x240 > path_getxattr+0x52/0x80 > do_syscall_64+0x5c/0xa0 > entry_SYSCALL_64_after_hwframe+0x49/0xb3 > > -> #0 (&xfs_nondir_ilock_class){++++}-{3:3}: > __lock_acquire+0x1257/0x20d0 > lock_acquire+0xb0/0x310 > down_write_nested+0x49/0x120 > xfs_ilock+0xde/0x2c0 [xfs] > xfs_reclaim_inode+0x3f/0x400 [xfs] > xfs_reclaim_inodes_ag+0x20b/0x410 [xfs] > xfs_reclaim_inodes_nr+0x31/0x40 [xfs] > super_cache_scan+0x190/0x1e0 > do_shrink_slab+0x184/0x420 > shrink_slab+0x182/0x290 > shrink_node+0x174/0x680 > balance_pgdat+0x2d0/0x5f0 > kswapd+0x21f/0x510 > kthread+0x131/0x150 > ret_from_fork+0x3a/0x50 > > other info that might help us debug this: > > Possible unsafe locking scenario: > > CPU0 CPU1 > ---- ---- > lock(fs_reclaim); > lock(&xfs_nondir_ilock_class); > lock(fs_reclaim); > lock(&xfs_nondir_ilock_class); > > *** DEADLOCK *** > > 4 locks held by kswapd0/159: > #0: ffffffffbbb8bd00 (fs_reclaim){+.+.}-{0:0}, at: > __fs_reclaim_acquire+0x5/0x30 > #1: ffffffffbbb7cef8 (shrinker_rwsem){++++}-{3:3}, at: > shrink_slab+0x115/0x290 > #2: ffff9b39f07a50e8 > (&type->s_umount_key#56){++++}-{3:3}, at: super_cache_scan+0x38/0x1e0 > #3: ffff9b39f077f258 > (&pag->pag_ici_reclaim_lock){+.+.}-{3:3}, at: > xfs_reclaim_inodes_ag+0x82/0x410 [xfs] This is a known false positive because inodes cannot simultaneously be getting reclaimed and the target of a getxattr operation, but lockdep doesn't know that. We can (selectively) shut up lockdep until either it gets smarter or we change inode reclaim not to require the ILOCK by applying a stupid GFP_NOLOCKDEP bandaid. Reported-by: Dave Airlie Signed-off-by: Darrick J. Wong Tested-by: Dave Airlie Reviewed-by: Brian Foster commit a5949d3faedf492fa7863b914da408047ab46eb0 Author: Darrick J. Wong Date: Sat May 23 09:43:31 2020 -0700 xfs: force writes to delalloc regions to unwritten When writing to a delalloc region in the data fork, commit the new allocations (of the da reservation) as unwritten so that the mappings are only marked written once writeback completes successfully. This fixes the problem of stale data exposure if the system goes down during targeted writeback of a specific region of a file, as tested by generic/042. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 590b16516ef38e2e88674fe0a0cea39927a8ee2e Author: Darrick J. Wong Date: Sat May 23 09:43:30 2020 -0700 xfs: refactor xfs_iomap_prealloc_size Refactor xfs_iomap_prealloc_size to be the function that dynamically computes the per-file preallocation size by moving the allocsize= case to the caller. Break up the huge comment preceding the function to annotate the relevant parts of the code, and remove the impossible check_writeio case. Suggested-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit f0322c7cc05eb23ef034775f9b39254cbd4f3678 Author: Darrick J. Wong Date: Sat May 23 09:43:30 2020 -0700 xfs: measure all contiguous previous extents for prealloc size When we're estimating a new speculative preallocation length for an extending write, we should walk backwards through the extent list to determine the number of number of blocks that are physically and logically contiguous with the write offset, and use that as an input to the preallocation size computation. This way, preallocation length is truly measured by the effectiveness of the allocator in giving us contiguous allocations without being influenced by the state of a given extent. This fixes both the problem where ZERO_RANGE within an EOF can reduce preallocation, and prevents the unnecessary shrinkage of preallocation when delalloc extents are turned into unwritten extents. This was found as a regression in xfs/014 after changing delalloc writes to create unwritten extents during writeback. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 1edd2c055dff9710b1e29d4df01902abb0a55f1f Author: Darrick J. Wong Date: Sat May 23 09:43:30 2020 -0700 xfs: don't fail unwritten extent conversion on writeback due to edquot During writeback, it's possible for the quota block reservation in xfs_iomap_write_unwritten to fail with EDQUOT because we hit the quota limit. This causes writeback errors for data that was already written to disk, when it's not even guaranteed that the bmbt will expand to exceed the quota limit. Irritatingly, this condition is reported to userspace as EIO by fsync, which is confusing. We wrote the data, so allow the reservation. That might put us slightly above the hard limit, but it's better than losing data after a write. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 964176bd32da9847112b505f57ee6e602ee5c84d Author: Darrick J. Wong Date: Thu May 21 13:08:50 2020 -0700 xfs: rearrange xfs_inode_walk_ag parameters The perag structure already has a pointer to the xfs_mount, so we don't need to pass that separately and can drop it. Having done that, move iter_flags so that the argument order is the same between xfs_inode_walk and xfs_inode_walk_ag. The latter will make things less confusing for a future patch that enables background scanning work to be done in parallel. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 042f65f4a79c819d74309c2607959fccacc4094a Author: Darrick J. Wong Date: Thu May 21 13:08:50 2020 -0700 xfs: straighten out all the naming around incore inode tree walks We're not very consistent about function names for the incore inode iteration function. Turn them all into xfs_inode_walk* variants. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 5662d38ccdbd9e5c816f5c0b7f490a29729217b0 Author: Darrick J. Wong Date: Thu May 21 13:08:50 2020 -0700 xfs: move xfs_inode_ag_iterator to be closer to the perag walking code Move the xfs_inode_ag_iterator function to be nearer xfs_inode_ag_walk so that we don't have to scroll back and forth to figure out how the incore inode walking function works. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 7e88d31423e2874be03f8ebc6274c917f674743a Author: Darrick J. Wong Date: Thu May 21 13:08:49 2020 -0700 xfs: use bool for done in xfs_inode_ag_walk This is a boolean variable, so use the bool type. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 39b1cfd75b278f5cb1e58517f6ec1ac9ef16d9f4 Author: Darrick J. Wong Date: Thu May 21 13:08:49 2020 -0700 xfs: fix inode ag walk predicate function return values There are a number of predicate functions that help the incore inode walking code decide if we really want to apply the iteration function to the inode. These are boolean decisions, so change the return types to boolean to match. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit a91bf9928e1e16dd175ff363efa54ebc9e38d53d Author: Darrick J. Wong Date: Thu May 21 13:08:48 2020 -0700 xfs: refactor eofb matching into a single helper Refactor the two eofb-matching logics into a single helper so that we don't repeat ourselves. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 8921a0fda54adf0a45ef15a9507594829e4ec6f5 Author: Darrick J. Wong Date: Thu May 21 13:08:48 2020 -0700 xfs: remove __xfs_icache_free_eofblocks This is now a pointless wrapper, so kill it. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 390600f811f1adfb9158e9b670b81219a9d94d72 Author: Darrick J. Wong Date: Thu May 21 13:08:48 2020 -0700 xfs: remove flags argument from xfs_inode_ag_walk The incore inode walk code passes a flags argument and a pointer from the xfs_inode_ag_iterator caller all the way to the iteration function. We can reduce the function complexity by passing flags through the private pointer. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 9be0590453cdae1b7aa2eb08515cc140ecc850c3 Author: Darrick J. Wong Date: Thu May 21 13:08:47 2020 -0700 xfs: remove xfs_inode_ag_iterator_flags Combine xfs_inode_ag_iterator_flags and xfs_inode_ag_iterator_tag into a single wrapper function since there's only one caller of the _flags variant. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 43d24bcf19d139b904752b5727def241920cff37 Author: Darrick J. Wong Date: Thu May 21 13:08:47 2020 -0700 xfs: remove unused xfs_inode_ag_iterator function Not used by anyone, so get rid of it. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit fc96be95e6c612eb77c0c0306cef2da1b8a243f9 Author: Darrick J. Wong Date: Thu May 21 13:08:47 2020 -0700 xfs: replace open-coded XFS_ICI_NO_TAG Use XFS_ICI_NO_TAG instead of -1 when appropriate. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit 3737bb2c67770afea6362aeaf4f48a969d119777 Author: Darrick J. Wong Date: Thu May 21 13:08:46 2020 -0700 xfs: move eofblocks conversion function to xfs_ioctl.c Move xfs_fs_eofblocks_from_user into the only file that actually uses it, so that we don't have this function cluttering up the header file. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster commit df42ce64dc3eb7f01f8b601abd3881c6dddfbbaa Author: Eric Sandeen Date: Thu May 21 13:07:01 2020 -0700 xfs: allow individual quota grace period extension The only grace period which can be set in the kernel today is for id 0, i.e. the default grace period for all users. However, setting an individual grace period is useful; for example: Alice has a soft quota of 100 inodes, and a hard quota of 200 inodes Alice uses 150 inodes, and enters a short grace period Alice really needs to use those 150 inodes past the grace period The administrator extends Alice's grace period until next Monday vfs quota users such as ext4 can do this today, with setquota -T To enable this for XFS, we simply move the timelimit assignment out from under the (id == 0) test. Default setting remains under (id == 0). Note that this now is consistent with how we set warnings. (Userspace requires updates to enable this as well; xfs_quota needs to parse new options, and setquota needs to set appropriate field flags.) Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e850301f0981741c47f5ee423380a2a963fce563 Author: Eric Sandeen Date: Thu May 21 13:07:01 2020 -0700 xfs: per-type quota timers and warn limits Move timers and warnings out of xfs_quotainfo and into xfs_def_quota so that we can utilize them on a per-type basis, rather than enforcing them based on the values found in the first enabled quota type. Signed-off-by: Eric Sandeen [zlang: new way to get defquota in xfs_qm_init_timelimits] [zlang: remove redundant defq assign] Signed-off-by: Zorro Lang Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ce6e7e79ced35a8ba4576d70bb999e8835f95769 Author: Eric Sandeen Date: Thu May 21 13:07:00 2020 -0700 xfs: switch xfs_get_defquota to take explicit type xfs_get_defquota() currently takes an xfs_dquot, and from that obtains the type of default quota we should get (user/group/project). But early in init, we don't have access to a fully set up quota, so that's not possible. The next patch needs go set up default quota timers early, so switch xfs_get_defquota to take an explicit type and add a helper function to obtain that type from an xfs_dquot for the existing callers. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3dbb9aa310089702ac1023296d26672f36ea4096 Author: Eric Sandeen Date: Thu May 21 13:07:00 2020 -0700 xfs: pass xfs_dquot to xfs_qm_adjust_dqtimers Pass xfs_dquot rather than xfs_disk_dquot to xfs_qm_adjust_dqtimers; this makes it symmetric with xfs_qm_adjust_dqlimits and will help the next patch. Signed-off-by: Eric Sandeen Reviewed-by: Allison Collins Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8d077f5bfc273a85ea4c665d4f15b7fd06b97c20 Author: Eric Sandeen Date: Thu May 21 13:07:00 2020 -0700 xfs: fix up some whitespace in quota code There is a fair bit of whitespace damage in the quota code, so fix up enough of it that subsequent patches are restricted to functional change to aid review. Signed-off-by: Eric Sandeen Reviewed-by: Allison Collins Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit dcf1ccc99e6db06a3a3cc9f72161f7d084a38d40 Author: Eric Sandeen Date: Thu May 21 13:06:59 2020 -0700 xfs: always return -ENOSPC on project quota reservation failure XFS project quota treats project hierarchies as "mini filesysems" and so rather than -EDQUOT, the intent is to return -ENOSPC when a quota reservation fails, but this behavior is not consistent. The only place we make a decision between -EDQUOT and -ENOSPC returns based on quota type is in xfs_trans_dqresv(). This behavior is currently controlled by whether or not the XFS_QMOPT_ENOSPC flag gets passed into the quota reservation. However, its use is not consistent; paths such as xfs_create() and xfs_symlink() don't set the flag, so a reservation failure will return -EDQUOT for project quota reservation failures rather than -ENOSPC for these sorts of operations, even for project quota: # mkdir mnt/project # xfs_quota -x -c "project -s -p mnt/project 42" mnt # xfs_quota -x -c 'limit -p isoft=2 ihard=3 42' mnt # touch mnt/project/file{1,2,3} touch: cannot touch ‘mnt/project/file3’: Disk quota exceeded We can make this consistent by not requiring the flag to be set at the top of the callchain; instead we can simply test whether we are reserving a project quota with XFS_QM_ISPDQ in xfs_trans_dqresv and if so, return -ENOSPC for that failure. This removes the need for the XFS_QMOPT_ENOSPC altogether and simplifies the code a fair bit. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c8d329f311c4d3d8f8e6dc5897ec235e37f48ae8 Author: Eric Sandeen Date: Thu May 21 13:06:59 2020 -0700 xfs: group quota should return EDQUOT when prj quota enabled Long ago, group & project quota were mutually exclusive, and so when we turned on XFS_QMOPT_ENOSPC ("return ENOSPC if project quota is exceeded") when project quota was enabled, we only needed to disable it again for user quota. When group & project quota got separated, this got missed, and as a result if project quota is enabled and group quota is exceeded, the error code returned is incorrectly returned as ENOSPC not EDQUOT. Fix this by stripping XFS_QMOPT_ENOSPC out of flags for group quota when we try to reserve the space. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b41b46c20c0bd32cd0a3795fcd2b892213cb6f5e Author: Dave Chinner Date: Wed May 20 13:17:11 2020 -0700 xfs: remove the m_active_trans counter It's a global atomic counter, and we are hitting it at a rate of half a million transactions a second, so it's bouncing the counter cacheline all over the place on large machines. We don't actually need it anymore - it used to be required because the VFS freeze code could not track/prevent filesystem transactions that were running, but that problem no longer exists. Hence to remove the counter, we simply have to ensure that nothing calls xfs_sync_sb() while we are trying to quiesce the filesytem. That only happens if the log worker is still running when we call xfs_quiesce_attr(). The log worker is cancelled at the end of xfs_quiesce_attr() by calling xfs_log_quiesce(), so just call it early here and then we can remove the counter altogether. Concurrent create, 50 million inodes, identical 16p/16GB virtual machines on different physical hosts. Machine A has twice the CPU cores per socket of machine B: unpatched patched machine A: 3m16s 2m00s machine B: 4m04s 4m05s Create rates: unpatched patched machine A: 282k+/-31k 468k+/-21k machine B: 231k+/-8k 233k+/-11k Concurrent rm of same 50 million inodes: unpatched patched machine A: 6m42s 2m33s machine B: 4m47s 4m47s The transaction rate on the fast machine went from just under 300k/sec to 700k/sec, which indicates just how much of a bottleneck this atomic counter was. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b0dff466c00975a3e3ec97e6b0266bfd3e4805d6 Author: Dave Chinner Date: Wed May 20 13:17:11 2020 -0700 xfs: separate read-only variables in struct xfs_mount Seeing massive cpu usage from xfs_agino_range() on one machine; instruction level profiles look similar to another machine running the same workload, only one machine is consuming 10x as much CPU as the other and going much slower. The only real difference between the two machines is core count per socket. Both are running identical 16p/16GB virtual machine configurations Machine A: 25.83% [k] xfs_agino_range 12.68% [k] __xfs_dir3_data_check 6.95% [k] xfs_verify_ino 6.78% [k] xfs_dir2_data_entry_tag_p 3.56% [k] xfs_buf_find 2.31% [k] xfs_verify_dir_ino 2.02% [k] xfs_dabuf_map.constprop.0 1.65% [k] xfs_ag_block_count And takes around 13 minutes to remove 50 million inodes. Machine B: 13.90% [k] __pv_queued_spin_lock_slowpath 3.76% [k] do_raw_spin_lock 2.83% [k] xfs_dir3_leaf_check_int 2.75% [k] xfs_agino_range 2.51% [k] __raw_callee_save___pv_queued_spin_unlock 2.18% [k] __xfs_dir3_data_check 2.02% [k] xfs_log_commit_cil And takes around 5m30s to remove 50 million inodes. Suspect is cacheline contention on m_sectbb_log which is used in one of the macros in xfs_agino_range. This is a read-only variable but shares a cacheline with m_active_trans which is a global atomic that gets bounced all around the machine. The workload is trying to run hundreds of thousands of transactions per second and hence cacheline contention will be occurring on this atomic counter. Hence xfs_agino_range() is likely just be an innocent bystander as the cache coherency protocol fights over the cacheline between CPU cores and sockets. On machine A, this rearrangement of the struct xfs_mount results in the profile changing to: 9.77% [kernel] [k] xfs_agino_range 6.27% [kernel] [k] __xfs_dir3_data_check 5.31% [kernel] [k] __pv_queued_spin_lock_slowpath 4.54% [kernel] [k] xfs_buf_find 3.79% [kernel] [k] do_raw_spin_lock 3.39% [kernel] [k] xfs_verify_ino 2.73% [kernel] [k] __raw_callee_save___pv_queued_spin_unlock Vastly less CPU usage in xfs_agino_range(), but still 3x the amount of machine B and still runs substantially slower than it should. Current rm -rf of 50 million files: vanilla patched machine A 13m20s 6m42s machine B 5m30s 5m02s It's an improvement, hence indicating that separation and further optimisation of read-only global filesystem data is worthwhile, but it clearly isn't the underlying issue causing this specific performance degradation. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f18c9a9030972d892a244968c653aceb98e27c70 Author: Dave Chinner Date: Wed May 20 13:17:11 2020 -0700 xfs: reduce free inode accounting overhead Shaokun Zhang reported that XFS was using substantial CPU time in percpu_count_sum() when running a single threaded benchmark on a high CPU count (128p) machine from xfs_mod_ifree(). The issue is that the filesystem is empty when the benchmark runs, so inode allocation is running with a very low inode free count. With the percpu counter batching, this means comparisons when the counter is less that 128 * 256 = 32768 use the slow path of adding up all the counters across the CPUs, and this is expensive on high CPU count machines. The summing in xfs_mod_ifree() is only used to fire an assert if an underrun occurs. The error is ignored by the higher level code. Hence this is really just debug code and we don't need to run it on production kernels, nor do we need such debug checks to return error values just to trigger an assert. Finally, xfs_mod_icount/xfs_mod_ifree are only called from xfs_trans_unreserve_and_mod_sb(), so get rid of them and just directly call the percpu_counter_add/percpu_counter_compare functions. The compare functions are now run only on debug builds as they are internal to ASSERT() checks and so only compiled in when ASSERTs are active (CONFIG_XFS_DEBUG=y or CONFIG_XFS_WARN=y). Reported-by: Shaokun Zhang Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit dc3ffbb14060c943469d5e12900db3a60bc3fa64 Author: Dave Chinner Date: Wed May 20 13:17:10 2020 -0700 xfs: gut error handling in xfs_trans_unreserve_and_mod_sb() xfs: gut error handling in xfs_trans_unreserve_and_mod_sb() From: Dave Chinner The error handling in xfs_trans_unreserve_and_mod_sb() is largely incorrect - rolling back the changes in the transaction if only one counter underruns makes all the other counters incorrect. We still allow the change to proceed and committing the transaction, except now we have multiple incorrect counters instead of a single underflow. Further, we don't actually report the error to the caller, so this is completely silent except on debug kernels that will assert on failure before we even get to the rollback code. Hence this error handling is broken, untested, and largely unnecessary complexity. Just remove it. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a34d5e56315007519f6c748e3ca0cb367264bbda Author: Andy Shevchenko Date: Mon May 25 22:40:28 2020 +0300 gpiolib: Separate GPIO_GET_LINEINFO_WATCH_IOCTL conditional We already have two conditionals inside the outer one to check if the command is GPIO_GET_LINEINFO_WATCH_IOCTL. I think it's time to actually do what I have proposed in the first place, i.e. to separate GPIO_GET_LINEINFO_WATCH_IOCTL from GPIO_GET_LINEINFO_IOCTL. It's +13 LOCs, and surprisingly only +13 bytes of binary on x86_32, but for the price of much better readability. Signed-off-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20200525194028.74236-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit ce1d966a302229a88bcb4398a5ca76d657b06848 Merge: f8af9113b1cf 9cb1fd0efd19 Author: Linus Walleij Date: Wed May 27 16:15:52 2020 +0200 Merge tag 'v5.7-rc7' into devel Linux 5.7-rc7 commit ef31d878b2e7856cb5d2f76f14b37f4b834eb0f3 Author: Chen Zhou Date: Fri May 8 20:22:41 2020 +0800 NFS: remove duplicate headers Remove duplicate headers which are included twice. Signed-off-by: Chen Zhou Signed-off-by: Anna Schumaker commit 1ad8dd939a9826ff6f8c69ac13e4e1dbba076703 Author: Gustavo A. R. Silva Date: Thu May 7 14:02:23 2020 -0500 NFS: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Anna Schumaker commit 1c709b766e73e54d64b1dde1b7cfbcf25bcb15b9 Author: Olga Kornievskaia Date: Sun Apr 26 11:30:00 2020 -0400 NFSv4.1 fix rpc_call_done assignment for BIND_CONN_TO_SESSION Fixes: 02a95dee8cf0 ("NFS add callback_ops to nfs4_proc_bind_conn_to_session_callback") Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 1f9b0f3afb4f804f26d60c373e589eb9b2d247af Author: Nishad Kamdar Date: Sat Apr 25 18:57:58 2020 +0530 NFS: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header file related to NFS Client support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Anna Schumaker commit d04659db7b8089531ccbee364c52909fe4670408 Author: Zheng Bin Date: Fri Apr 24 16:17:23 2020 +0800 nfs4: Remove unneeded semicolon Fixes coccicheck warning: include/linux/nfs4.h:298:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Anna Schumaker commit 118917d696dc59fd3e1741012c2f9db2294bed6f Author: Fedor Tokarev Date: Sat Mar 28 14:56:55 2020 +0300 net: sunrpc: Fix off-by-one issues in 'rpc_ntop6' Fix off-by-one issues in 'rpc_ntop6': - 'snprintf' returns the number of characters which would have been written if enough space had been available, excluding the terminating null byte. Thus, a return value of 'sizeof(scopebuf)' means that the last character was dropped. - 'strcat' adds a terminating null byte to the string, thus if len == buflen, the null byte is written past the end of the buffer. Signed-off-by: Fedor Tokarev Signed-off-by: Anna Schumaker commit 00a7a00e2d2fc2ebbaf2c3ef25427ae13e0f94da Author: Xu Wang Date: Tue Mar 3 18:30:52 2020 +0800 NFS: move dprintk after nfs_alloc_fattr in nfs3_proc_lookup In nfs3_proc_lookup, if nfs_alloc_fattr fails, will only print "NFS call lookup". This may be confusing, move dprintk after nfs_alloc_fattr. Signed-off-by: Xu Wang Signed-off-by: Anna Schumaker commit 342ed2400b78072cc01c0130ce41240dec60d56d Author: Zhang Qiang Date: Wed May 27 15:57:15 2020 +0800 workqueue: Remove unnecessary kfree() call in rcu_free_wq() The data structure member "wq->rescuer" was reset to a null pointer in one if branch. It was passed to a call of the function "kfree" in the callback function "rcu_free_wq" (which was eventually executed). The function "kfree" does not perform more meaningful data processing for a passed null pointer (besides immediately returning from such a call). Thus delete this function call which became unnecessary with the referenced software update. Fixes: def98c84b6cd ("workqueue: Fix spurious sanity check failures in destroy_workqueue()") Suggested-by: Markus Elfring Signed-off-by: Zhang Qiang Signed-off-by: Tejun Heo commit 93e0f69a40c821449ff3cd6b5bb61fce64e8dbb2 Merge: 185457632ba3 3d2e5c480742 Author: Mark Brown Date: Wed May 27 14:48:57 2020 +0100 Merge series "ASoC: SOF: finalize Baytrail/CherryTrail support" from Pierre-Louis Bossart : This long-overdue patchset adds missing system suspend/resume support and hardens the IPC to solve module load/unload issues on specific devices such as Cyan Chromebook. With this series SOF is finally iso-feature with the legacy driver. Thanks to Ranjani and Keyon for the basic patches and Enric for testing. The last part needed for Baytrail/Cherrytrail is simplification of the driver/card names and turn-key UCM support (on-going work with Jaroslav). Keyon Jie (1): ASoC: SOF: Intel: BYT: harden IPC initialization and handling Pierre-Louis Bossart (3): ASoC: Intel: bytcr_rt5640/51: remove .ignore_suspend ASoC: Intel: byt/cht: add .pm_ops ASoC: SOF: Intel: BYT: mask BUSY or DONE interrupts in handler Ranjani Sridharan (4): ASoC: SOF: Intel: byt: Add PM callbacks ASoC: SOF: pm: handle resume on legacy Intel platforms ASoC: SOF: ipc: ignore DSP replies received when they are not expected ASoC: SOF: Intel: BYT: add .remove op sound/soc/intel/boards/bytcht_cx2072x.c | 3 + sound/soc/intel/boards/bytcht_da7213.c | 3 + sound/soc/intel/boards/bytcht_es8316.c | 3 + sound/soc/intel/boards/bytcr_rt5640.c | 7 +- sound/soc/intel/boards/bytcr_rt5651.c | 6 +- sound/soc/intel/boards/cht_bsw_max98090_ti.c | 3 + sound/soc/intel/boards/cht_bsw_nau8824.c | 3 + sound/soc/intel/boards/cht_bsw_rt5645.c | 3 + sound/soc/intel/boards/cht_bsw_rt5672.c | 3 + sound/soc/sof/intel/byt.c | 116 ++++++++++++++----- sound/soc/sof/ipc.c | 9 +- sound/soc/sof/pm.c | 8 +- sound/soc/sof/sof-priv.h | 2 +- 13 files changed, 122 insertions(+), 47 deletions(-) base-commit: 0d71a5cf691a8226151ceeb79fb872925f053df5 -- 2.20.1 commit 185457632ba344d3100e6bdd8ba839b959521813 Author: Wei Yongjun Date: Wed May 27 03:02:10 2020 +0000 ASoC: mmp-sspa: Fix return value check in asoc_mmp_sspa_probe() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200527030210.124393-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit 850ba84b5c6d4ad4d1259584ebc0338eb769f2ef Author: Dan Murphy Date: Tue May 26 12:52:47 2020 -0500 ASoC: tlv320adcx140: Fix warnings when using W=1 Fix the warnings when using the W=1 compiler flag. sound/soc/codecs/tlv320adcx140.c: In function ‘adcx140_reset’: sound/soc/codecs/tlv320adcx140.c:570:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 570 | int ret = 0; | ^~~ This was set but only used in case where the reset GPIO is not defined. Have the function return the value of ret. sound/soc/codecs/tlv320adcx140.c: In function ‘adcx140_codec_probe’: sound/soc/codecs/tlv320adcx140.c:778:18: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 778 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF || | ^ sound/soc/codecs/tlv320adcx140.c:789:18: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 789 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V || This condition will not occur since if the dt property is not set then the *_source variable is set to the default value. So there is no way that *_source can be less then 0. Which is what each #define is set to. The code just needs to make sure that the dt property is not out of the upper bounds. Reported-by: kbuild test robot Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200526175247.15309-1-dmurphy@ti.com Signed-off-by: Mark Brown commit 920bef64cc5fa0e955be357bfc876179729df216 Author: Dinghao Liu Date: Wed May 27 10:46:22 2020 +0800 ASoC: wm8962: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20200527024625.9937-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit 53865b3259554389e40aeead392151c819b52a71 Author: Dinghao Liu Date: Wed May 27 16:43:24 2020 +0800 ASoC: img-spdif-in: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200527084326.4131-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit 3c35e79cead31c3bd79875ae90f9655dc77ad13c Author: Dan Murphy Date: Tue May 26 15:09:17 2020 -0500 ASoC: tlv320adcx140: Add support for configuring GPI pins Add support to configure the GPI pins to the specific configuration. The pins can be disabled or be configured as data input for any of the digital mic channels. In addition the GPI can be used a a general purpose input, a Master clock input or an ASI input for daisy chaining devices. Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200526200917.10385-2-dmurphy@ti.com Signed-off-by: Mark Brown commit 2465d32bea35d1d56c6cfb08a96ebea3b475d8ec Author: Dan Murphy Date: Tue May 26 15:09:16 2020 -0500 dt-bindings: sound: tlv320adcx140: Add GPI config property Add an array property that configures the General Purpose Input (GPI) register. The device has 4 GPI pins and each pin can be configured in 1 of 7 different ways. Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200526200917.10385-1-dmurphy@ti.com Signed-off-by: Mark Brown commit 9ad61b5c804090022444719d1f16e1029e002430 Author: Dinghao Liu Date: Wed May 27 16:46:08 2020 +0800 ASoC: img-spdif-out: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200527084610.4790-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit f8af9113b1cf71cd21b0a027d38b06c15989c789 Merge: 6f8cd2464115 e33a58a29c6a Author: Linus Walleij Date: Wed May 27 15:39:27 2020 +0200 Merge tag 'gpio-updates-for-v5.8-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel gpio: updates for v5.8 - part 2 - fix the initialization ordering in gpio-max730x - make gpio-pxa buildable for compile testing - make gpio-pca953x buildable as a module commit 3d2e5c480742b4a22534e72e2647b6c8c98a94a4 Author: Keyon Jie Date: Tue May 26 15:36:40 2020 -0500 ASoC: SOF: Intel: BYT: harden IPC initialization and handling On probe and reset, we should not touch the SHIM_IMRD register since it is configured by firmware. The driver only configures SHIM_IMRX with the BUSY interrupt enabled by default and DONE interrupt disabled. When sending an IPC message, the DONE interrupt is enabled until the DSP response is provided. This sequence hardens the IPC communication and avoid interrupt-related issues when adding/removing modules or during system suspend-resume transitions. Signed-off-by: Keyon Jie Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200526203640.25980-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3d3d1fb9ce34bc045b9d140a5f2ec531eff6a0fe Author: Pierre-Louis Bossart Date: Tue May 26 15:36:39 2020 -0500 ASoC: SOF: Intel: BYT: mask BUSY or DONE interrupts in handler The DSP may send the same interrupt multiple times before it's handled in the interrupt thread. Rather than masking it in the thread, mask it in the handler directly. This patch also removes useless checks that cannot happen, and masks that are set don't need to be re-tested. Suggested-by: Keyon Jie Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Reviewed-by: Ranjani Sridharan BugLink: https://github.com/thesofproject/linux/issues/1492 Link: https://lore.kernel.org/r/20200526203640.25980-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c691f0c6e267da4207392b1082d011323c3f8606 Author: Ranjani Sridharan Date: Tue May 26 15:36:38 2020 -0500 ASoC: SOF: Intel: BYT: add .remove op Add .remove op that disables interrupts and reset the DSP for BYT and CHT platforms. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200526203640.25980-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d7a1ed268993f4bc758fa509b22fc730af1623f9 Author: Ranjani Sridharan Date: Tue May 26 15:36:37 2020 -0500 ASoC: SOF: ipc: ignore DSP replies received when they are not expected We currently ignore the reply messages from the DSP when they are not expected but call it out as an error. Change the error message to a debug message. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200526203640.25980-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 68224376bc2a0508f57bff67c8dcd2b5761dc939 Author: Pierre-Louis Bossart Date: Tue May 26 15:36:36 2020 -0500 ASoC: Intel: byt/cht: add .pm_ops Add required .pm_ops to support suspend/resume on baytrail/cherrytrail machines. This .pm_ops is conditionally-added to avoid impacting the legacy driver where power management is handled differently. Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200526203640.25980-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 512e76724ffd07c6a5eb7d93c79d160e85465228 Author: Pierre-Louis Bossart Date: Tue May 26 15:36:35 2020 -0500 ASoC: Intel: bytcr_rt5640/51: remove .ignore_suspend Low-power playback was never enabled on Baytrail devices, remove what looks like copy/paste from other machine drivers which were never submitted upstream. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200526203640.25980-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fc907cc527e6568b7486309188e545161891e1f2 Author: Ranjani Sridharan Date: Tue May 26 15:36:34 2020 -0500 ASoC: SOF: pm: handle resume on legacy Intel platforms Add new case when set_power_state() is not supported, e.g. for Intel Baytrail/Cherrytrail legacy platforms. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200526203640.25980-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ddcccd543f5dbd841fe305452651b0f8c1d74f0f Author: Ranjani Sridharan Date: Tue May 26 15:36:33 2020 -0500 ASoC: SOF: Intel: byt: Add PM callbacks Add the PM callbacks for BYT/CHT platforms. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Tested-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200526203640.25980-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c432df155919582a3cefa35a8f86256c830fa9a4 Author: Johan Hovold Date: Thu May 14 11:36:45 2020 +0200 USB: serial: ch341: fix lockup of devices with limited prescaler Michael Hanselmann reports that [a] subset of all CH341 devices stop responding to bulk transfers, usually after the third byte, when the highest prescaler bit (0b100) is set. There is one exception, namely a prescaler of exactly 0b111 (fact=1, ps=3). Fix this by forcing a lower base clock (fact = 0) whenever needed. This specifically makes the standard rates 110, 134 and 200 bps work again with these devices. Fixes: 35714565089e ("USB: serial: ch341: reimplement line-speed handling") Cc: stable # 5.5 Reported-by: Michael Hanselmann Link: https://lore.kernel.org/r/20200514141743.GE25962@localhost Signed-off-by: Johan Hovold commit c404bf4aa9236cb4d1068e499ae42acf48a6ff97 Author: Michael Hanselmann Date: Tue Mar 31 23:37:18 2020 +0000 USB: serial: ch341: add basis for quirk detection A subset of CH341 devices does not support all features, namely the prescaler is limited to a reduced precision and there is no support for sending a RS232 break condition. This patch adds a detection function which will be extended to set quirk flags as they're implemented. The author's affected device has an imprint of "340" on the turquoise-colored plug, but not all such devices appear to be affected. Signed-off-by: Michael Hanselmann Link: https://lore.kernel.org/r/1e1ae0da6082bb528a44ef323d4e1d3733d38858.1585697281.git.public@hansmi.ch [ johan: use long type for quirks; rephrase and use port device for messages; handle short reads; set quirk flags directly in helper function ] Cc: stable # 5.5 Signed-off-by: Johan Hovold commit 79074f61c022e822451f0e7ac0c8c6e213f75f18 Author: Rikard Falkeborn Date: Mon May 25 23:49:58 2020 +0200 iommu/sun50i: Constify sun50i_iommu_ops The struct sun50i_iommu_ops is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 14358 2501 64 16923 421b drivers/iommu/sun50i-iommu.o After: text data bss dec hex filename 14726 2117 64 16907 420b drivers/iommu/sun50i-iommu.o Signed-off-by: Rikard Falkeborn Acked-by: Maxime Ripard Link: https://lore.kernel.org/r/20200525214958.30015-3-rikard.falkeborn@gmail.com Signed-off-by: Joerg Roedel commit 9f510d1e4299169e01efeac2275d0792850db956 Author: Rikard Falkeborn Date: Mon May 25 23:49:57 2020 +0200 iommu/hyper-v: Constify hyperv_ir_domain_ops The struct hyperv_ir_domain_ops is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 2916 1180 1120 5216 1460 drivers/iommu/hyperv-iommu.o After: text data bss dec hex filename 3044 1052 1120 5216 1460 drivers/iommu/hyperv-iommu.o Signed-off-by: Rikard Falkeborn Acked-by: Wei Liu Link: https://lore.kernel.org/r/20200525214958.30015-2-rikard.falkeborn@gmail.com Signed-off-by: Joerg Roedel commit da656a042568ffbc30881c43a832277f275eea4a Author: Jean-Philippe Brucker Date: Wed May 20 17:22:03 2020 +0200 iommu/vt-d: Use pci_ats_supported() The pci_ats_supported() helper checks if a device supports ATS and is allowed to use it. By checking the ATS capability it also integrates the pci_ats_disabled() check from pci_ats_init(). Simplify the vt-d checks. Signed-off-by: Jean-Philippe Brucker Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200520152201.3309416-5-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 0b2527a654190a987d45e2cc9e5c6946eea11fc5 Author: Jean-Philippe Brucker Date: Wed May 20 17:22:02 2020 +0200 iommu/arm-smmu-v3: Use pci_ats_supported() The new pci_ats_supported() function checks if a device supports ATS and is allowed to use it. Signed-off-by: Jean-Philippe Brucker Acked-by: Will Deacon Link: https://lore.kernel.org/r/20200520152201.3309416-4-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 7a441b2110527851f630144ec76ab8409e1d6c61 Author: Jean-Philippe Brucker Date: Wed May 20 17:22:01 2020 +0200 iommu/amd: Use pci_ats_supported() The pci_ats_supported() function checks if a device supports ATS and is allowed to use it. In addition to checking that the device has an ATS capability and that the global pci=noats is not set (pci_ats_disabled()), it also checks if a device is untrusted. A device is untrusted if it is plugged into an external-facing port such as Thunderbolt and could be spoofing an existing device to exploit weaknesses in the IOMMU configuration. By calling pci_ats_supported() we keep DTE[I]=0 for untrusted devices and abort transactions with Pretranslated Addresses. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Joerg Roedel Link: https://lore.kernel.org/r/20200520152201.3309416-3-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 521376741b2c26fe53a1ec24d02da24d477eb739 Author: Jean-Philippe Brucker Date: Wed May 20 17:22:00 2020 +0200 PCI/ATS: Only enable ATS for trusted devices Add pci_ats_supported(), which checks whether a device has an ATS capability, and whether it is trusted. A device is untrusted if it is plugged into an external-facing port such as Thunderbolt and could be spoofing an existing device to exploit weaknesses in the IOMMU configuration. PCIe ATS is one such weaknesses since it allows endpoints to cache IOMMU translations and emit transactions with 'Translated' Address Type (10b) that partially bypass the IOMMU translation. The SMMUv3 and VT-d IOMMU drivers already disallow ATS and transactions with 'Translated' Address Type for untrusted devices. Add the check to pci_enable_ats() to let other drivers (AMD IOMMU for now) benefit from it. By checking ats_cap, the pci_ats_supported() helper also returns whether ATS was globally disabled with pci=noats, and could later include more things, for example whether the whole PCIe hierarchy down to the endpoint supports ATS. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Joerg Roedel Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200520152201.3309416-2-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit f4aa5e214eeaf7f1c7f157526a5aa29784cb6a1f Author: Charles Keepax Date: Tue May 26 17:19:30 2020 +0100 ASoC: dapm: Move dai_link widgets to runtime to fix use after free The newly added CODEC to CODEC DAI link widget pointers in snd_soc_dai_link are better placed in snd_soc_pcm_runtime. snd_soc_dai_link is really intended for static configuration of the DAI, and the runtime for dynamic data. The snd_soc_dai_link structures are not destroyed if the card is unbound. The widgets are cleared up on unbind, however if the card is rebound as the snd_soc_dai_link structures are reused these pointers will be left at their old values, causing access to freed memory. Fixes: 595571cca4de ("ASoC: dapm: Fix regression introducing multiple copies of DAI widgets") Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20200526161930.30759-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 36cf583eaff3458abbfac144c5e4d417a23fa1a1 Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:15 2020 +0200 staging: vchiq: Get rid of VCHIQ_SERVICE_OPENEND callback reason Nobody uses it and it's routinely discarded in vchi. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-11-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit 05147c15dfb36479f58b42daa83f08088e85a934 Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:14 2020 +0200 staging: vchiq: move vchiq_release_message() into vchiq For messages with a reason different from VCHIQ_MESSAGE_AVAILABLE the responsibility for releasing them is kept in vchi, in other words, services don't need to worry about it. As we're trying to unify vchi and vchiq, move the release code into vchiq. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-10-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit 8d24d19e35f9bddd1fd01d4fb5940ae1efaab1bd Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:13 2020 +0200 staging: vchi: Get rid of C++ guards This is an include only used by the Linux kernel, so no need to worry about C++ compatibility. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-9-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit b6d90ef9a439b4ef73a350789bf766a1339a703d Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:12 2020 +0200 staging: vchi: Get rid of not implemented function declarations They don't exist, they have no users, get rid of them. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-8-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit 1755d10000a40862d29812218893488edf6aaa40 Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:11 2020 +0200 staging: vchi: Get rid of vchiq_status_to_vchi() vchiq functions return an enum and vchi's ints. Those are compatible, no need to explicitly cast them. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-7-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit f7f0ecfbef33e47d7468bb3a66efc237a0ed6469 Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:10 2020 +0200 staging: vchi: Get rid of vchi_service_set_option() There are no users for that function. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-6-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit d74f2b7fe6c3b40408a85cf383907da3905fbbc9 Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:09 2020 +0200 staging: vchi: Merge vchi_msg_queue() into vchi_queue_kernel_message() There are no gains from that extra indirection level. Also, get rid of the function description, the whole file will disappear soon. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-5-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit a224f284d03b707a1f6f4aea279a4fecbd61246a Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:08 2020 +0200 staging: vchiq: Move copy callback handling into vchiq All vchi users use the kernel variant of the copy callback. The only user for the user space variant of the copy callback is in the ioctl implementation. So move all this copying logic into vchiq, and expose a new function that explicitly passes kernel messages. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-4-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit 6620ce704e6365bea2f66019b891fd49812fa482 Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:07 2020 +0200 staging: vchi: Get rid of vchi_queue_user_message() The function has no users. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-3-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit ddf0f124ae0a252a8d0d10ead52e205e9a58aa0d Author: Nicolas Saenz Julienne Date: Wed May 27 13:53:06 2020 +0200 staging: vchi: Get rid of vchi_service_destroy() The function has no users. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200527115400.31391-2-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman commit 7d6d283777838462083412edb1e674a32eb6341c Author: Jiaxun Yang Date: Wed May 27 14:34:34 2020 +0800 MIPS: Loongson64: select NO_EXCEPT_FILL Loongson64 load kernel at 0x82000000 and allocate exception vectors by ebase. So we don't need to reserve space for exception vectors at head of kernel. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 3577dd37c703e0d599e8c244917b8e369f38a45a Author: Anshuman Khandual Date: Wed May 27 15:34:36 2020 +0530 arm64/cpufeature: Add get_arm64_ftr_reg_nowarn() There is no way to proceed when requested register could not be searched in arm64_ftr_reg[]. Requesting for a non present register would be an error as well. Hence lets just WARN_ON() when search fails in get_arm64_ftr_reg() rather than checking for return value and doing a BUG_ON() instead in some individual callers. But there are also caller instances that dont error out when register search fails. Add a new helper get_arm64_ftr_reg_nowarn() for such cases. Signed-off-by: Anshuman Khandual Reviewed-by: Catalin Marinas Cc: Catalin Marinas Cc: Will Deacon Cc: Suzuki K Poulose Cc: Mark Brown Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/1590573876-19120-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit e7ecc142e9f33f5a8808b13fb0afa14f36aeeca3 Author: Colin Ian King Date: Tue May 26 23:49:02 2020 +0100 block: blk-crypto-fallback: remove redundant initialization of variable err The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King Reviewed-by: Eric Biggers Reviewed-by: Satya Tangirala Addresses-Coverity: ("Unused value") Signed-off-by: Jens Axboe commit 27a6f70173ac996d891e622c69730bd6c1f82a5e Author: Kai-Heng Feng Date: Tue Apr 14 17:18:42 2020 +0800 HID: multitouch: Remove MT_CLS_WIN_8_DUAL After commit c23e2043d5f7 ("HID: multitouch: do not filter mice nodes"), MT_CLS_WIN_8 also supports mouse nodes, hence make MT_CLS_WIN_8_DUAL redundant. Remove MT_CLS_WIN_8_DUAL accordingly. Signed-off-by: Kai-Heng Feng Signed-off-by: Benjamin Tissoires commit 524f9ffd6a4d3622aa48ca286ff85a30ed1cdbcf Author: Christoph Hellwig Date: Wed May 27 07:24:19 2020 +0200 block: reduce part_stat_lock() scope We only need the stats lock (aka preempt_disable()) for updating the states, not for looking up or dropping the hd_struct reference. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit b2d76adbc0828e0f108567973bcc500ed1abc139 Author: Konstantin Khlebnikov Date: Wed May 27 07:24:18 2020 +0200 block: use __this_cpu_add() instead of access by smp_processor_id() Most architectures have fast path to access percpu for current cpu. The required preempt_disable() is provided by part_stat_lock(). [hch: rebased] Signed-off-by: Konstantin Khlebnikov Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 8ab1d40a646e753adb6814642432a093d93dbf47 Author: Konstantin Khlebnikov Date: Wed May 27 07:24:17 2020 +0200 block: remove rcu_read_lock() from part_stat_lock() The RCU lock is required only in disk_map_sector_rcu() to lookup the partition. After that request holds reference to related hd_struct. Replace get_cpu() with preempt_disable() - returned cpu index is unused. [hch: rebased] Signed-off-by: Konstantin Khlebnikov Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b5af37ab3a2b143e278340d2c6fa5790d53817e7 Author: Konstantin Khlebnikov Date: Wed May 27 07:24:16 2020 +0200 block: add a blk_account_io_merge_bio helper Move the non-"new_io" branch of blk_account_io_start() into separate function. Fix merge accounting for discards (they were counted as write merges). The new blk_account_io_merge_bio() doesn't call update_io_ticks() unlike blk_account_io_start(), as there is no reason for that. [hch: rebased] Signed-off-by: Konstantin Khlebnikov Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b9c54f5660e7eff10dd2ddd1eae554573105b15d Author: Konstantin Khlebnikov Date: Wed May 27 07:24:15 2020 +0200 block: account merge of two requests Also rename blk_account_io_merge() into blk_account_io_merge_request() to distinguish it from merging request and bio. [hch: rebased] Signed-off-by: Konstantin Khlebnikov Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 58d4f14fc30ac26288cfed74d7e566921c22cf59 Author: Christoph Hellwig Date: Wed May 27 07:24:14 2020 +0200 block: always use a percpu variable for disk stats percpu variables have a perfectly fine working stub implementation for UP kernels, so use that. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 9123bf6f21b015cce16f3ce066c72aac9fc78d2f Author: Christoph Hellwig Date: Wed May 27 07:24:13 2020 +0200 block: move update_io_ticks to blk-core.c All callers are in blk-core.c, so move update_io_ticks over. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit e722fff238bbfe6308d7778a8c2163c181bf998a Author: Christoph Hellwig Date: Wed May 27 07:24:12 2020 +0200 block: remove generic_{start,end}_io_acct Remove these now unused functions. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit d7614e4480fad946ceb1f3f7003850497549d73f Author: Christoph Hellwig Date: Wed May 27 07:24:11 2020 +0200 zram: nvdimm: use bio_{start,end}_io_acct and disk_{start,end}_io_acct Switch zram to use the nicer bio accounting helpers, and as part of that ensure each bio is counted as a single I/O request. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 0fd92f89a44d3ba32c1056f3ceaba8f8bdc08712 Author: Christoph Hellwig Date: Wed May 27 07:24:10 2020 +0200 nvdimm: use bio_{start,end}_io_acct Switch dm to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 86240d5b6813d6855845959b133d5b4a95c60f92 Author: Christoph Hellwig Date: Wed May 27 07:24:09 2020 +0200 dm: use bio_{start,end}_io_acct Switch dm to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 85750aeb748fd17a393d1f510f7b33e3336c395e Author: Christoph Hellwig Date: Wed May 27 07:24:08 2020 +0200 bcache: use bio_{start,end}_io_acct Switch bcache to use the nicer bio accounting helpers, and call the routines where we also sample the start time to give coherent accounting results. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Acked-by: Coly Li Signed-off-by: Jens Axboe commit a8e45650f7053f44ab64a9de0aa76d7523967e37 Author: Christoph Hellwig Date: Wed May 27 07:24:07 2020 +0200 lightnvm/pblk: use bio_{start,end}_io_acct Switch rsxx to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 421716bccd2abce8ce0bc2e7507cb178de80b026 Author: Christoph Hellwig Date: Wed May 27 07:24:06 2020 +0200 rsxx: use bio_{start,end}_io_acct Switch rsxx to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 24d69293d9a561645e0b4d78c2fb179827e35f53 Author: Christoph Hellwig Date: Wed May 27 07:24:05 2020 +0200 drbd: use bio_{start,end}_io_acct Switch drbd to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 956d510ee78caebc83c0eaeb892db5b239a36a06 Author: Christoph Hellwig Date: Wed May 27 07:24:04 2020 +0200 block: add disk/bio-based accounting helpers Add two new helpers to simplify I/O accounting for bio based drivers. Currently these drivers use the generic_start_io_acct and generic_end_io_acct helpers which have very cumbersome calling conventions, don't actually return the time they started accounting, and try to deal with accounting for partitions, which can't happen for bio based drivers. The new helpers will be used to subsequently replace uses of the old helpers. The main API is the bio based wrappes in blkdev.h, but for zram which wants to account rw_page based I/O lower level routines are provided as well. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 0c8d3fceade2ab1bbac68bca013e62bfdb851d19 Author: Coly Li Date: Wed May 27 12:01:55 2020 +0800 bcache: configure the asynchronous registertion to be experimental In order to avoid the experimental async registration interface to be treated as new kernel ABI for common users, this patch makes it as an experimental kernel configure BCACHE_ASYNC_REGISTRAION. This interface is for extreme large cached data situation, to make sure the bcache device can always created without the udev timeout issue. For normal users the async or sync registration does not make difference. In future when we decide to use the asynchronous registration as default behavior, this experimental interface may be removed. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 9e23ccf8f0a22e5b86a9e0d8ecbb49fe2fa73ae9 Author: Coly Li Date: Wed May 27 12:01:54 2020 +0800 bcache: asynchronous devices registration When there is a lot of data cached on cache device, the bcach internal btree can take a very long to validate during the backing device and cache device registration. In my test, it may takes 55+ minutes to check all the internal btree nodes. The problem is that the registration is invoked by udev rules and the udevd has 180 seconds timeout by default. If the btree node checking time is longer than udevd timeout, the registering process will be killed by udevd with SIGKILL. If the registering process has pending sigal, creating kthread for bcache will fail and the device registration will fail. The result is, for bcache device which cached a lot of data on cache device, the bcache device node like /dev/bcache won't create always due to the very long btree checking time. A solution to avoid the udevd 180 seconds timeout is to register devices in an asynchronous way. Which is, after writing cache or backing device path into /sys/fs/bcache/register_async, the kernel code will create a kworker and move all the btree node checking (for cache device) or dirty data counting (for cached device) in the kwork context. Then the kworder is scheduled on system_wq and the registration code just returned to user space udev rule task. By this asynchronous way, the udev task for bcache rule will complete in seconds, no matter how long time spent in the kworker context, it won't be killed by udevd for a timeout. After all the checking and counting are done asynchronously in the kworker, the bcache device will eventually be created successfully. This patch does the above chagne and add a register sysfs file /sys/fs/bcache/register_async. Writing the registering device path into this sysfs file will do the asynchronous registration. The register_async interface is for very rare condition and won't be used for common users. In future I plan to make the asynchronous registration as default behavior, which depends on feedback for this patch. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 86da9f736740eba602389908574dfbb0f517baa5 Author: Coly Li Date: Wed May 27 12:01:53 2020 +0800 bcache: fix refcount underflow in bcache_device_free() The problematic code piece in bcache_device_free() is, 785 static void bcache_device_free(struct bcache_device *d) 786 { 787 struct gendisk *disk = d->disk; [snipped] 799 if (disk) { 800 if (disk->flags & GENHD_FL_UP) 801 del_gendisk(disk); 802 803 if (disk->queue) 804 blk_cleanup_queue(disk->queue); 805 806 ida_simple_remove(&bcache_device_idx, 807 first_minor_to_idx(disk->first_minor)); 808 put_disk(disk); 809 } [snipped] 816 } At line 808, put_disk(disk) may encounter kobject refcount of 'disk' being underflow. Here is how to reproduce the issue, - Attche the backing device to a cache device and do random write to make the cache being dirty. - Stop the bcache device while the cache device has dirty data of the backing device. - Only register the backing device back, NOT register cache device. - The bcache device node /dev/bcache0 won't show up, because backing device waits for the cache device shows up for the missing dirty data. - Now echo 1 into /sys/fs/bcache/pendings_cleanup, to stop the pending backing device. - After the pending backing device stopped, use 'dmesg' to check kernel message, a use-after-free warning from KASA reported the refcount of kobject linked to the 'disk' is underflow. The dropping refcount at line 808 in the above code piece is added by add_disk(d->disk) in bch_cached_dev_run(). But in the above condition the cache device is not registered, bch_cached_dev_run() has no chance to be called and the refcount is not added. The put_disk() for a non- added refcount of gendisk kobject triggers a underflow warning. This patch checks whether GENHD_FL_UP is set in disk->flags, if it is not set then the bcache device was not added, don't call put_disk() and the the underflow issue can be avoided. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 46f5aa8806e34f2e48de852cc7db2c74c3a5cd8d Author: Joe Perches Date: Wed May 27 12:01:52 2020 +0800 bcache: Convert pr_ uses to a more typical style Remove the trailing newline from the define of pr_fmt and add newlines to the uses. Miscellanea: o Convert bch_bkey_dump from multiple uses of pr_err to pr_cont as the earlier conversion was inappropriate done causing multiple lines to be emitted where only a single output line was desired o Use vsprintf extension %pV in bch_cache_set_error to avoid multiple line output where only a single line output was desired o Coalesce formats Fixes: 6ae63e3501c4 ("bcache: replace printk() by pr_*() routines") Signed-off-by: Joe Perches Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 3b5b7b1f70e79fb060d485412b3c748f0a83111b Author: Colin Ian King Date: Wed May 27 12:01:51 2020 +0800 bcache: remove redundant variables i and n Variables i and n are being assigned but are never used. They are redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Coly Li Addresses-Coverity: ("Unused value") Signed-off-by: Jens Axboe commit d92f79a55232405d66ca343294f873cefd04ddd7 Merge: 263c61581a38 6b6e89636f51 Author: Jens Axboe Date: Wed May 27 05:17:10 2020 -0600 Merge branch 'nvme-5.8' of git://git.infradead.org/nvme into for-5.8/drivers Pull NVMe updates from Christoph: "The second large batch of nvme updates: - t10 protection information support for nvme-rdma and nvmet-rdma (Israel Rukshin and Max Gurtovoy) - target side AEN improvements (Chaitanya Kulkarni) - various fixes and minor improvements all over, icluding the nvme part of the lpfc driver" * 'nvme-5.8' of git://git.infradead.org/nvme: (38 commits) lpfc: Fix return value in __lpfc_nvme_ls_abort lpfc: fix axchg pointer reference after free and double frees lpfc: Fix pointer checks and comments in LS receive refactoring nvme: set dma alignment to qword nvmet: cleanups the loop in nvmet_async_events_process nvmet: fix memory leak when removing namespaces and controllers concurrently nvmet-rdma: add metadata/T10-PI support nvmet: add metadata support for block devices nvmet: add metadata/T10-PI support nvme: add Metadata Capabilities enumerations nvmet: rename nvmet_check_data_len to nvmet_check_transfer_len nvmet: rename nvmet_rw_len to nvmet_rw_data_len nvmet: add metadata characteristics for a namespace nvme-rdma: add metadata/T10-PI support nvme-rdma: introduce nvme_rdma_sgl structure nvme: introduce NVME_INLINE_METADATA_SG_CNT nvme: enforce extended LBA format for fabrics metadata nvme: introduce max_integrity_segments ctrl attribute nvme: make nvme_ns_has_pi accessible to transports nvme: introduce NVME_NS_METADATA_SUPPORTED flag ... commit e027a2bc934fd05d52ec5b77d159efdfc485b5b3 Author: Johan Hovold Date: Wed May 13 12:09:44 2020 +0200 x86/apb_timer: Drop unused declaration and macro Drop an extern declaration that has never been used and a no longer needed macro. Signed-off-by: Johan Hovold Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200513100944.9171-2-johan@kernel.org commit 31e1b3efa802f97a17628dde280006c4cee4ce5e Author: YuanJunQing Date: Wed May 27 14:11:30 2020 +0800 MIPS: Fix IRQ tracing when call handle_fpe() and handle_msa_fpe() Register "a1" is unsaved in this function, when CONFIG_TRACE_IRQFLAGS is enabled, the TRACE_IRQS_OFF macro will call trace_hardirqs_off(), and this may change register "a1". The changed register "a1" as argument will be send to do_fpe() and do_msa_fpe(). Signed-off-by: YuanJunQing Signed-off-by: Thomas Bogendoerfer commit 6b646a7e4af69814dd1a3340fca0f02d4977420d Author: Leon Romanovsky Date: Mon Mar 9 16:44:25 2020 +0200 net/mlx5: Add ability to read and write ECE options The end result of RDMA-CM ECE handshake is ECE options, which is needed to be used while configuring data QPs. Such options can come in any QP state, so add in/out fields to set and query ECE options. OUT fields: * create_qp() - default ECE options for that type of QP. * modify_qp() - enabled ECE options after QP state transition. IN fields: * create_qp() - create QP with this ECE option. * modify_qp() - requested options. For unconnected QPs, the FW will return an error if ECE is already configured with any options that not equal to previously set. Reviewed-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky commit 273b5fa00fadabd587fac858ea61a17b3653892d Author: Bibo Mao Date: Wed May 27 10:25:20 2020 +0800 MIPS: mm: add page valid judgement in function pte_modify If original PTE has _PAGE_ACCESSED bit set, and new pte has no _PAGE_NO_READ bit set, we can add _PAGE_SILENT_READ bit to enable page valid bit. Signed-off-by: Bibo Mao Signed-off-by: Thomas Bogendoerfer commit 44bf431b47b4298d8aaba7b02d0ad29fc609a03c Author: Bibo Mao Date: Wed May 27 10:25:19 2020 +0800 mm/memory.c: Add memory read privilege on page fault handling Here add pte_sw_mkyoung function to make page readable on MIPS platform during page fault handling. This patch improves page fault latency about 10% on my MIPS machine with lmbench lat_pagefault case. It is noop function on other arches, there is no negative influence on those architectures. Signed-off-by: Bibo Mao Acked-by: Andrew Morton Signed-off-by: Thomas Bogendoerfer commit 7df676974359f927056b882e10a5b24d2033169b Author: Bibo Mao Date: Wed May 27 10:25:18 2020 +0800 mm/memory.c: Update local TLB if PTE entry exists If two threads concurrently fault at the same page, the thread that won the race updates the PTE and its local TLB. For now, the other thread gives up, simply does nothing, and continues. It could happen that this second thread triggers another fault, whereby it only updates its local TLB while handling the fault. Instead of triggering another fault, let's directly update the local TLB of the second thread. Function update_mmu_tlb is used here to update local TLB on the second thread, and it is defined as empty on other arches. Signed-off-by: Bibo Mao Acked-by: Andrew Morton Signed-off-by: Thomas Bogendoerfer commit 003d80535180f74f262c40462b9fccd7f004901a Author: Johan Hovold Date: Wed May 13 12:09:43 2020 +0200 x86/apb_timer: Drop unused TSC calibration Drop the APB-timer TSC calibration, which hasn't been used since the removal of Moorestown support by commit 1a8359e411eb ("x86/mid: Remove Intel Moorestown"). Signed-off-by: Johan Hovold Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200513100944.9171-1-johan@kernel.org commit 4dd7683ea1d66975fb258d02f2b74a7e9a32b131 Author: Bibo Mao Date: Wed May 27 10:25:17 2020 +0800 MIPS: Do not flush tlb page when updating PTE entry It is not necessary to flush tlb page on all CPUs if suitable PTE entry exists already during page fault handling, just updating TLB is fine. Here redefine flush_tlb_fix_spurious_fault as empty on MIPS system. Signed-off-by: Bibo Mao Signed-off-by: Thomas Bogendoerfer commit 62249209a77222e1cfb38dde310bd5a877524f7d Author: Paul Cercueil Date: Mon May 25 19:41:55 2020 +0200 MIPS: ingenic: Default to a generic board Having a generic board option makes it possible to create a kernel that will run on various Ingenic SoCs, as long as the right devicetree is provided. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit d653d1ffba8ecd472a78a5f0210a04672060b27b Author: Paul Cercueil Date: Mon May 25 19:41:54 2020 +0200 MIPS: ingenic: Add support for GCW Zero prototype Add support for the GCW Zero prototype. The only (?) difference is that it only has 256 MiB of RAM, compared to the 512 MiB of RAM of the retail device. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 963287e48314d334d3c5b377dca8ea0dec4ac718 Author: Paul Cercueil Date: Mon May 25 19:41:53 2020 +0200 MIPS: ingenic: DTS: Add memory info of GCW Zero Add memory info of the GCW Zero in its devicetree. The bootloader generally provides this information, but since it is fixed to 512 MiB, it doesn't hurt to have it in devicetree. It allows the kernel to boot without any parameter passed as argument. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 6423e59a64e7b490499d9d1fb1c2323eea5f134c Author: Jiaxun Yang Date: Tue May 26 17:21:16 2020 +0800 MIPS: Loongson64: Switch to generic PCI driver We can now enable generic PCI driver in Kconfig, and remove legacy PCI driver code. Radeon vbios quirk is moved to the platform folder to fit the new structure. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit d8242e6a71bac37b6cde52c0add533615eef8c5e Author: Jiaxun Yang Date: Tue May 26 17:21:15 2020 +0800 MIPS: DTS: Loongson64: Add PCI Controller Node Add PCI Host controller node for Loongson64 with RS780E PCH dts. Note that PCI interrupts are probed via legacy way, as different machine have different interrupt arrangement, we can't cover all of them in dt. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 83e757ecfd5d73a33d30d546b2463851854c8628 Author: Jiaxun Yang Date: Tue May 26 17:21:14 2020 +0800 dt-bindings: Document Loongson PCI Host Controller PCI host controller found on Loongson PCHs and SoCs. Signed-off-by: Jiaxun Yang Reviewed-by: Rob Herring Signed-off-by: Thomas Bogendoerfer commit 1f58cca5cf2ba27ab448cc95df48070e069d5451 Author: Jiaxun Yang Date: Tue May 26 17:21:13 2020 +0800 PCI: Add Loongson PCI Controller support This controller can be found on Loongson-2K SoC, Loongson-3 systems with RS780E/LS7A PCH. The RS780E part of code was previously located at arch/mips/pci/ops-loongson3.c and now it can use generic PCI driver implementation. Signed-off-by: Jiaxun Yang Reviewed-by: Rob Herring Acked-by: Lorenzo Pieralisi Signed-off-by: Thomas Bogendoerfer commit b6caa1d8c80cb71b6162cb1f1ec13aa655026c9f Author: Jiaxun Yang Date: Tue May 26 17:21:12 2020 +0800 PCI: Don't disable decoding when mmio_always_on is set Don't disable MEM/IO decoding when a device have both non_compliant_bars and mmio_always_on. That would allow us quirk devices with junk in BARs but can't disable their decoding. Signed-off-by: Jiaxun Yang Acked-by: Bjorn Helgaas Signed-off-by: Thomas Bogendoerfer commit 2038e0416518b30bb40857fbafa3733a6bae93ca Author: Álvaro Fernández Rojas Date: Tue May 26 13:03:24 2020 +0200 MIPS: BCM63xx: fix 6328 boot selection bit MISC_STRAP_BUS_BOOT_SEL_SHIFT is 18 according to Broadcom's GPL source code. Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 549d2db7021933bc88189ca30792f12cf6de2db1 Author: Christian Gromm Date: Wed May 27 11:06:27 2020 +0200 staging: most: usb: use function sysfs_streq This patch replaces function strcmp() with sysfs_streq() to compare strings provided via sysfs. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-11-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit f1f48239cde4373c5410c065f2a51b3ce15aa3b6 Author: Christian Gromm Date: Wed May 27 11:06:26 2020 +0200 staging: most: usb: add missing put_device calls This patch adds the missing put_device() function calls to properly free allocated resources and maintain reference counts. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-10-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit f470a5b01bab175dc14ac078ffe1130ae975a6fd Author: Christian Gromm Date: Wed May 27 11:06:25 2020 +0200 staging: most: usb: use correct error codes This patch uses the -EINVAL return code where -EFAULT is wrongly being used. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-9-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1fd4fb8c62d34db0d82bbb948b4cfd006c9256fb Author: Christian Gromm Date: Wed May 27 11:06:24 2020 +0200 staging: most: usb: replace code to calculate array index This patch removes the expression that makes use of a priori knowledge about channel numbers to calculate an array index. The expression 'peer = 1 - channel' utilizes the fact that an USB interface that operates on the asynchronous data of the Network only has two endpoints. Hence, channel being 0 or 1. The replacement is more simple and less confusing when reading the code. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-8-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 6405fe214229c0ac798ffe5940f53a4cfc3a641f Author: Christian Gromm Date: Wed May 27 11:06:23 2020 +0200 staging: most: usb: don't use error path to exit function on success This patch makes it transparent whether the function is exiting with an error or successful. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-7-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 8bf56cfafac12de3087633470b25cada5bdfc7aa Author: Christian Gromm Date: Wed May 27 11:06:22 2020 +0200 staging: most: usb: move allocation of URB out of critical section This patch puts the call to usb_alloc_urb() before the critical section starts that is protected with the io_mutex lock. This is to make the section as short as possible and to use the regular GFP_KERNEL flag. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-6-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 2c069b61a843dc9c3d2296b54c4baa9730286530 Author: Christian Gromm Date: Wed May 27 11:06:21 2020 +0200 staging: most: usb: return 0 instead of variable This patch returns 0 instead of variable in case of invalid parameter has been passed to function to increase readability. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-5-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit ffd069ec04238119f5d4884406b403c599b6eeec Author: Christian Gromm Date: Wed May 27 11:06:20 2020 +0200 staging: most: usb: change return value of function drci_rd_reg This patch makes function drci_rd_reg return 0 in case of success and a negative number else. As no caller is evaluating the number of bytes transferred by function usb_control_msg this information is being omitted. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-4-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit a0dbe1b24c9b66102243ba8b49783f960edc8663 Author: Christian Gromm Date: Wed May 27 11:06:19 2020 +0200 staging: most: usb: don't use expressions that might fail in a declaration This patch moves function calls that can fail out of the declararion block of a function body. This is done to enhance readability. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-3-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1c538a417977ec102d47297e8c0f4619100f42c2 Author: Christian Gromm Date: Wed May 27 11:06:18 2020 +0200 staging: most: usb: change order of function parameters This patch swaps the arguments of function get_stream_frame_size to have the struct device as first parameter. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1590570387-27069-2-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 3466a8c15be8a0acea399f78fbe3764e14d7c11a Author: Malcolm Priestley Date: Wed May 27 10:35:46 2020 +0100 staging: vt6656: Fix warning: unused variable vnt_frame_time In commit 61bb798767e4 ("staging: vt6656: vnt_get_rtscts_rsvtime_le replace with rts/cts duration.") not quite all of the code was removed. Remove unused vnt_frame_time variable. Reported-by: kbuild test robot Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/5096f399-03e7-77e1-b334-947aabc44d14@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5f46e3cde5a42502595effbc7ba7d4e902bff2f0 Author: Malcolm Priestley Date: Wed May 27 09:54:44 2020 +0100 staging: vt6656: Move vnt_tx_usb_header to vnt_tx_context Move the USB element out of vnt_tx_packet and vnt_beacon_xmit to vnt_tx_context with sk_buff passed in parameters with the data now between skb->data and skb->len. The vnt_tx_usb header is moved from vnt_tx_buffer to usbpipe.h with the size added to extra_tx_headroom the largest possible size. The CONTEXT enums types are aligned with usb ones and CONTEXT_MGMT_PACKET is removed and is never be used. The skb_push in vnt_tx_packet is now only ever used with vnt_get_hdr_size with variables tx_bytes and tx_header_size removed. buf_len in vnt_usb_send_context is no longer used and replaced with urb->actual_length in vnt_tx_context_complete. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/aa6257eb-1758-4e75-ab39-2a15ff6ffa7c@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7077256b525928f5176fdb19eb34c85b76da133d Author: Malcolm Priestley Date: Wed May 27 09:49:18 2020 +0100 staging: vt6656: vnt_tx_packet use skb_clone to preserve sk_buff. The sk_buff needs to preserved for copying to various parts of context and passing back to mac80211 clone sk_buff in context so to continue to writing to orginal sk_buff data area to send in vnt_tx_context. dev_kfree_skb the context on error or dev_kfree_skb the orignal when done. The error handling continues as before. Only one place in function needs to change from ieee80211_get_hdrlen_from_skb to ieee80211_hdrlen(hdr) which is already to pointing to correct position. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/b87e8cc1-f584-989d-830b-609d712f08c7@gmail.com Signed-off-by: Greg Kroah-Hartman commit b86dab054059b970111b5516ae548efaae5b3aae Author: Dmitry Torokhov Date: Mon May 25 16:27:40 2020 -0700 vt: keyboard: avoid signed integer overflow in k_ascii When k_ascii is invoked several times in a row there is a potential for signed integer overflow: UBSAN: Undefined behaviour in drivers/tty/vt/keyboard.c:888:19 signed integer overflow: 10 * 1111111111 cannot be represented in type 'int' CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.11 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xce/0x128 lib/dump_stack.c:118 ubsan_epilogue+0xe/0x30 lib/ubsan.c:154 handle_overflow+0xdc/0xf0 lib/ubsan.c:184 __ubsan_handle_mul_overflow+0x2a/0x40 lib/ubsan.c:205 k_ascii+0xbf/0xd0 drivers/tty/vt/keyboard.c:888 kbd_keycode drivers/tty/vt/keyboard.c:1477 [inline] kbd_event+0x888/0x3be0 drivers/tty/vt/keyboard.c:1495 While it can be worked around by using check_mul_overflow()/ check_add_overflow(), it is better to introduce a separate flag to signal that number pad is being used to compose a symbol, and change type of the accumulator from signed to unsigned, thus avoiding undefined behavior when it overflows. Reported-by: Kyungtae Kim Signed-off-by: Dmitry Torokhov Cc: stable Link: https://lore.kernel.org/r/20200525232740.GA262061@dtor-ws Signed-off-by: Greg Kroah-Hartman commit 8c3e315d4296421cd26b3300ee0ac117f0877f20 Author: Saravana Kannan Date: Tue May 26 15:09:27 2020 -0700 driver core: Update device link status correctly for SYNC_STATE_ONLY links When SYNC_STATE_ONLY support was added in commit 05ef983e0d65 ("driver core: Add device link support for SYNC_STATE_ONLY flag"), SYNC_STATE_ONLY links were treated similar to STATELESS links in terms of not blocking consumer probe if the supplier hasn't probed yet. That caused a SYNC_STATE_ONLY device link's status to not get updated. Since SYNC_STATE_ONLY device link is no longer useful once the consumer probes, commit 21c27f06587d ("driver core: Fix SYNC_STATE_ONLY device link implementation") addresses the status update issue by deleting the SYNC_STATE_ONLY device link instead of complicating the status update code. However, there are still some cases where we need to update the status of a SYNC_STATE_ONLY device link. This is because a SYNC_STATE_ONLY device link can later get converted into a normal MANAGED device link when a normal MANAGED device link is created between a supplier and consumer that already have a SYNC_STATE_ONLY device link between them. If a SYNC_STATE_ONLY device link's status isn't maintained correctly till it's converted to a normal MANAGED device link, then the normal MANAGED device link will end up with a wrong link status. This can cause a warning stack trace[1] when the consumer device probes successfully. This commit fixes the SYNC_STATE_ONLY device link status update issue where it wouldn't transition correctly from DL_STATE_DORMANT or DL_STATE_AVAILABLE to DL_STATE_CONSUMER_PROBE. It also resets the status back to DL_STATE_DORMANT or DL_STATE_AVAILABLE if the consumer probe fails. [1] - https://lore.kernel.org/lkml/20200522204120.3b3c9ed6@apollo/ Fixes: 05ef983e0d65 ("driver core: Add device link support for SYNC_STATE_ONLY flag") Fixes: 21c27f06587d ("driver core: Fix SYNC_STATE_ONLY device link implementation") Reported-by: Michael Walle Tested-by: Michael Walle Signed-off-by: Saravana Kannan Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20200526220928.49939-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit c2c076166b5880eabe068ce1cab30bf6edeeea1a Author: Scott Branden Date: Fri May 22 16:12:02 2020 -0700 firmware_loader: change enum fw_opt to u32 "enum fw_opt" is not used as an enum. Change fw_opt to u32 as FW_OPT_* values are OR'd together. Signed-off-by: Scott Branden Acked-by: Luis Chamberlain Link: https://lore.kernel.org/r/20200522231202.13681-1-scott.branden@broadcom.com Signed-off-by: Greg Kroah-Hartman commit 0cfcfb314dec614aeee04cac0563c2b31ff9d1ef Author: H. Nikolaus Schaller Date: Sat May 23 19:32:57 2020 +0200 w1: omap-hdq: print dev_err if irq flags are not cleared If irq flags are not cleared for certain operations we print an error message. Since this should never occur in normal operation, this patch is an optional safety-net and debugging tool. Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/2de305d3046c7281a7123347899abbaa64c54fb8.1590255176.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman commit 13db4c40fe0b20b80c7d1c91a9da8411e26b5c27 Author: H. Nikolaus Schaller Date: Sat May 23 19:32:56 2020 +0200 w1: omap-hdq: fix interrupt handling which did show spurious timeouts Since commit 27d13da8782a ("w1: omap-hdq: Simplify driver with PM runtime autosuspend") was applied, I did see timeouts and wrong values when reading a bq27000 connected to hdq of the omap3. This occurred mainly after boot but remained and only sometimes settled down after several reads. root@letux:~# time cat /sys/class/power_supply/bq27000-battery/uevent POWER_SUPPLY_NAME=bq27000-battery POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_VOLTAGE_NOW=0 POWER_SUPPLY_CURRENT_NOW=0 POWER_SUPPLY_CAPACITY=0 POWER_SUPPLY_CAPACITY_LEVEL=Normal POWER_SUPPLY_TEMP=-2731 POWER_SUPPLY_TIME_TO_EMPTY_NOW=0 POWER_SUPPLY_TIME_TO_EMPTY_AVG=0 POWER_SUPPLY_TIME_TO_FULL_NOW=0 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CHARGE_FULL=0 POWER_SUPPLY_CHARGE_NOW=0 POWER_SUPPLY_CHARGE_FULL_DESIGN=0 POWER_SUPPLY_CYCLE_COUNT=0 POWER_SUPPLY_ENERGY_NOW=0 POWER_SUPPLY_POWER_AVG=0 POWER_SUPPLY_HEALTH=Good POWER_SUPPLY_MANUFACTURER=Texas Instruments real    0m15.761s user    0m0.001s sys     0m0.025s root@letux:~# Sometimes the effect did disappear after accessing the device multiple times, speed went up and results became correct. All this indicates that some interrupts from the hdq controller are lost by the driver. Enabling debugging revealed that there were spurious tx and rx timeouts, i.e. the driver does not always recognise interrupts. The main problem is that rx and tx interrupts share a single variable which was sometimes reset to 0 wiping out other interrupts. And it was overwritten by a second interrupt, independent of whether the previous interrupt was already processed or not. This patch improves interrupt handling to avoid such races and loss of interrupt flags. The ideas are: * only the hdq_isr() sets bits in hdq_status * it does not reset any bits * it does wake_up() if any interrupt is pending * bits are only reset by the read/write/break functions if they were waited for * this makes sure that no interrupts can be lost * rx/tx/timeout bits are completely decoupled from each other (and not reset all after waiting for any of them) * which bits to reset is now specified by a new parameter to hdq_reset_irqstatus() * hdq_reset_irqstatus() also returns the state before resetting so that we can encapsulate the spinlock * this should now handle the case that the write and read are both already finished quickly before the hdq_write_byte() ends. * Or that two interrupts occur in succession before they are processed by the driver. Old code may have reset all status bits making the next hdq_read_byte() timeout. * the spinlock now always protects changing of bits in function hdq_reset_irqstatus() which could become a read-write-modify problem if the interrupt handler tries to read-modify-write exactly at the same moment * we add mutex protection also for hdq_write_byte() just to be safe to not to disturb a hdq_read_byte() triggered by some other thread/process. This patch was tested on a GTA04 and results in no boot problems any more. And first read after boot is now ok: root@letux:~# time cat /sys/class/power_supply/bq27000-battery/uevent POWER_SUPPLY_NAME=bq27000-battery POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_VOLTAGE_NOW=3970000 POWER_SUPPLY_CURRENT_NOW=354144 POWER_SUPPLY_CAPACITY=82 POWER_SUPPLY_CAPACITY_LEVEL=Normal POWER_SUPPLY_TEMP=266 POWER_SUPPLY_TIME_TO_EMPTY_NOW=7680 POWER_SUPPLY_TIME_TO_EMPTY_AVG=7380 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CHARGE_FULL=934856 POWER_SUPPLY_CHARGE_NOW=763976 POWER_SUPPLY_CHARGE_FULL_DESIGN=1233792 POWER_SUPPLY_CYCLE_COUNT=82 POWER_SUPPLY_ENERGY_NOW=2852840 POWER_SUPPLY_POWER_AVG=1392840 POWER_SUPPLY_HEALTH=Good POWER_SUPPLY_MANUFACTURER=Texas Instruments real 0m0.233s user 0m0.000s sys 0m0.025s root@letux:~# It was also tested with dev_dbg enabled and more printk that all activities behave correctly, especially hdq_write_byte(), hdq_read_byte(), omap_hdq_break(). Not tested is omap_w1_triplet(). Fixes: 27d13da8782a ("w1: omap-hdq: Simplify driver with PM runtime autosuspend") Cc: stable@vger.kernel.org # v5.6+ Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/68fc8623ae741878beef049273696d2377526165.1590255176.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman commit 2d4100632fa1947bf3e8d7a091e94e2cf21923af Author: H. Nikolaus Schaller Date: Sat May 23 19:32:55 2020 +0200 w1: omap-hdq: fix return value to be -1 if there is a timeout omap_w1_read_byte() should return -1 (or 0xff) in case of error (e.g. missing battery). The code accidentially overwrites the variable ret and not val, which is returned. So it will return the initial value 0 instead of -1. Fixes: 27d13da8782a ("w1: omap-hdq: Simplify driver with PM runtime autosuspend") Cc: stable@vger.kernel.org # v5.6+ Acked-by: Tony Lindgren Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/b2c2192b461fbb9b8e9bea4ad514a49557a7210b.1590255176.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman commit 5e02f3b31704e24537697bce54f8156bdb72b7a6 Author: H. Nikolaus Schaller Date: Sat May 23 19:32:54 2020 +0200 w1: omap-hdq: cleanup to add missing newline for some dev_dbg Otherwise it will corrupt the console log during debugging. Fixes: 7b5362a603a1 ("w1: omap_hdq: Fix some error/debug handling.") Cc: stable@vger.kernel.org Acked-by: Tony Lindgren Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/cd0d55749a091214106575f6e1d363c6db56622f.1590255176.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman commit ed2ac8116ff25d5b234f983ffbb0c3f5ec2930aa Author: Aishwarya Ramakrishnan Date: Tue May 5 20:22:30 2020 +0530 i2c: nvidia-gpu: Use PTR_ERR_OR_ZERO() to simplify code PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Aishwarya Ramakrishnan Reviewed-by: Ajay Gupta Signed-off-by: Wolfram Sang commit dd4f2ca965ecd72f181c81e84c5cb89950405d38 Author: Wolfram Sang Date: Tue May 19 13:48:09 2020 +0200 i2c: save a variable in i2c_detect() No need to populate a variable if it is used only in debug output which may get compiled away anyhow. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 40d5bb87377a599d0405af765290f28aaa6abb1e Author: Benjamin Tissoires Date: Tue May 26 17:07:17 2020 +0200 HID: multitouch: enable multi-input as a quirk for some devices Two touchpad/trackstick combos are currently not behaving properly. They define a mouse emulation collection, as per Win8 requirements, but also define a separate mouse collection for the trackstick. The way the kernel currently treat the collections is that it merges both in one device. However, given that the first mouse collection already defines X,Y and left, right buttons, when mapping the events from the second mouse collection, hid-multitouch sees that these events are already mapped, and simply ignores them. To be able to report events from the tracktick, add a new quirked class for it, and manually add the 2 devices we know about. Link: https://bugzilla.kernel.org/show_bug.cgi?id=207235 Cc: stable@vger.kernel.org Tested-by: Kai-Heng Feng Signed-off-by: Benjamin Tissoires commit 3234ac664a870e6ea69ae3a57d824cd7edbeacc5 Author: Dan Williams Date: Thu May 21 14:06:17 2020 -0700 /dev/mem: Revoke mappings when a driver claims the region Close the hole of holding a mapping over kernel driver takeover event of a given address range. Commit 90a545e98126 ("restrict /dev/mem to idle io memory ranges") introduced CONFIG_IO_STRICT_DEVMEM with the goal of protecting the kernel against scenarios where a /dev/mem user tramples memory that a kernel driver owns. However, this protection only prevents *new* read(), write() and mmap() requests. Established mappings prior to the driver calling request_mem_region() are left alone. Especially with persistent memory, and the core kernel metadata that is stored there, there are plentiful scenarios for a /dev/mem user to violate the expectations of the driver and cause amplified damage. Teach request_mem_region() to find and shoot down active /dev/mem mappings that it believes it has successfully claimed for the exclusive use of the driver. Effectively a driver call to request_mem_region() becomes a hole-punch on the /dev/mem device. The typical usage of unmap_mapping_range() is part of truncate_pagecache() to punch a hole in a file, but in this case the implementation is only doing the "first half" of a hole punch. Namely it is just evacuating current established mappings of the "hole", and it relies on the fact that /dev/mem establishes mappings in terms of absolute physical address offsets. Once existing mmap users are invalidated they can attempt to re-establish the mapping, or attempt to continue issuing read(2) / write(2) to the invalidated extent, but they will then be subject to the CONFIG_IO_STRICT_DEVMEM checking that can block those subsequent accesses. Cc: Arnd Bergmann Cc: Ingo Molnar Cc: Kees Cook Cc: Matthew Wilcox Cc: Russell King Cc: Andrew Morton Cc: Greg Kroah-Hartman Fixes: 90a545e98126 ("restrict /dev/mem to idle io memory ranges") Signed-off-by: Dan Williams Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/159009507306.847224.8502634072429766747.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Greg Kroah-Hartman commit 03358b0f7bc7b5868bbb30f47224a937e2e4d6d3 Author: John Hubbard Date: Tue May 26 18:26:28 2020 -0700 misc: xilinx-sdfec: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in approximately a "Case 1" scenario (Direct IO), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Cc: Derek Kiernan Cc: Dragan Cvetic Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: John Hubbard Link: https://lore.kernel.org/r/20200527012628.1100649-4-jhubbard@nvidia.com Signed-off-by: Greg Kroah-Hartman commit d25594d764613ad58656bbe74a86706204813a9f Author: John Hubbard Date: Tue May 26 18:26:27 2020 -0700 misc: xilinx-sdfec: cleanup return value in xsdfec_table_write() Return 0 for success, rather than the value of an incrementing "reg" index. The reg value was never actually used, so this simplifies the caller slightly. Cc: Derek Kiernan Cc: Dragan Cvetic Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: John Hubbard Link: https://lore.kernel.org/r/20200527012628.1100649-3-jhubbard@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 57343d51613227373759f5b0f2eede257fd4b82e Author: John Hubbard Date: Tue May 26 18:26:26 2020 -0700 misc: xilinx-sdfec: improve get_user_pages_fast() error handling This fixes the case of get_user_pages_fast() returning a -errno. The result needs to be stored in a signed integer. And for safe signed/unsigned comparisons, it's best to keep everything signed. And get_user_pages_fast() also expects a signed value for number of pages to pin. Therefore, change most relevant variables, from u32 to int. Leave "n" unsigned, for convenience in checking for overflow. And provide a WARN_ON_ONCE() and early return, if overflow occurs. Also, as long as we're tidying up: rename the page array from page, to pages, in order to match the conventions used in most other call sites. Fixes: 20ec628e8007e ("misc: xilinx_sdfec: Add ability to configure LDPC") Cc: Derek Kiernan Cc: Dragan Cvetic Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: John Hubbard Link: https://lore.kernel.org/r/20200527012628.1100649-2-jhubbard@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 8d9eb0d6d59a5d7028c80a30831143d3e75515a7 Author: Srinivas Kandagatla Date: Fri May 22 12:33:41 2020 +0100 nvmem: qfprom: remove incorrect write support qfprom has different address spaces for read and write. Reads are always done from corrected address space, where as writes are done on raw address space. Writing to corrected address space is invalid and ignored, so it does not make sense to have this support in the driver which only supports corrected address space regions at the moment. Fixes: 4ab11996b489 ("nvmem: qfprom: Add Qualcomm QFPROM support.") Signed-off-by: Srinivas Kandagatla Reviewed-by: Douglas Anderson Cc: stable Link: https://lore.kernel.org/r/20200522113341.7728-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 15a3f03d5ec0118f1e5db3fc1018686e72744e37 Author: Josh Triplett Date: Tue May 26 09:13:57 2020 -0700 serial: 8250: Enable 16550A variants by default on non-x86 Some embedded devices still use these serial ports; make sure they're still enabled by default on architectures more likely to have them, to avoid rendering someone's console unavailable. Reported-by: Vladimir Oltean Reported-by: Maxim Kochetkov Fixes: dc56ecb81a0a ("serial: 8250: Support disabling mdelay-filled probes of 16550A variants") Cc: stable Signed-off-by: Josh Triplett Link: https://lore.kernel.org/r/a20b5fb7dd295cfb48160eecf4bdebd76332d67d.1590509426.git.josh@joshtriplett.org Signed-off-by: Greg Kroah-Hartman commit 24eb2377f977fe06d84fca558f891f95bc28a449 Author: Jiri Slaby Date: Tue May 26 16:56:32 2020 +0200 tty: hvc_console, fix crashes on parallel open/close hvc_open sets tty->driver_data to NULL when open fails at some point. Typically, the failure happens in hp->ops->notifier_add(). If there is a racing process which tries to open such mangled tty, which was not closed yet, the process will crash in hvc_open as tty->driver_data is NULL. All this happens because close wants to know whether open failed or not. But ->open should not NULL this and other tty fields for ->close to be happy. ->open should call tty_port_set_initialized(true) and close should check by tty_port_initialized() instead. So do this properly in this driver. So this patch removes these from ->open: * tty_port_tty_set(&hp->port, NULL). This happens on last close. * tty->driver_data = NULL. Dtto. * tty_port_put(&hp->port). This happens in shutdown and until now, this must have been causing a reference underflow, if I am not missing something. Signed-off-by: Jiri Slaby Cc: stable Reported-and-tested-by: Raghavendra Link: https://lore.kernel.org/r/20200526145632.13879-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 8f065acec7573672dd15916e31d1e9b2e785566c Author: Andy Shevchenko Date: Mon May 25 13:59:52 2020 +0300 serial: imx: Initialize lock for non-registered console The commit a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") changed a bit logic behind lock initialization since for most of the console driver it's supposed to have lock already initialized even if console is not enabled. However, it's not the case for Freescale IMX console. Initialize lock explicitly in the ->probe(). Note, there is still an open question should or shouldn't not this driver register console properly. Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") Reported-by: Guenter Roeck Cc: stable Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200525105952.13744-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e7cda1ee94f464e02e356319aec7d83ccba8cab4 Author: Chengguang Xu Date: Tue May 26 17:03:43 2020 +0800 erofs: code cleanup by removing ifdef macro surrounding Define erofs_listxattr and erofs_xattr_handlers to NULL when CONFIG_EROFS_FS_XATTR is not enabled, then we can remove many ugly ifdef macros in the code. Signed-off-by: Chengguang Xu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20200526090343.22794-1-cgxu519@mykernel.net Signed-off-by: Gao Xiang commit 2d491066ccd4286538450c227fc5094ceb04b494 Author: Eddie James Date: Wed Apr 8 15:36:16 2020 -0500 clk: ast2600: Fix AHB clock divider for A1 The latest specs for the AST2600 A1 chip include some different bit definitions for calculating the AHB clock divider. Implement these in order to get the correct AHB clock value in Linux. Signed-off-by: Eddie James Link: https://lkml.kernel.org/r/20200408203616.4031-1-eajames@linux.ibm.com Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC") Signed-off-by: Stephen Boyd commit 97fe809934dd2b0b37dfef3a2fc70417f485d7af Author: Oliver Neukum Date: Tue May 26 14:44:20 2020 +0200 CDC-ACM: heed quirk also in error handling If buffers are iterated over in the error case, the lower limits for quirky devices must be heeded. Signed-off-by: Oliver Neukum Reported-by: Jean Rene Dawin Fixes: a4e7279cd1d19 ("cdc-acm: introduce a cool down") Cc: stable Link: https://lore.kernel.org/r/20200526124420.22160-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman commit 3b75d8bd3be49ffb4878f2370dc565a36e11fe07 Author: Till Varoquaux Date: Mon May 25 02:10:43 2020 -0400 staging: greybus: loopback: fix a spelling error. Successed -> succeeded. Signed-off-by: Till Varoquaux Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20200518051314.1785567-1-till.varoquaux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 398999dabc8cfc51c7274639cb87e2a316138859 Author: Jérôme Pouiller Date: Tue May 26 19:18:17 2020 +0200 staging: wfx: split wfx_get_ps_timeout() from wfx_update_pm() In the next commit, we will have to compute the PS timeout without changing the power save status of the device. This patch introduces wfx_get_ps_timeout() for that job and make wfx_update_pm() relies on it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200526171821.934581-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9a9cd090e996f80ec9edbd8ea58192f25e21ec74 Author: Jérôme Pouiller Date: Tue May 26 19:18:16 2020 +0200 staging: wfx: retrieve the PS status from the vif The Power Save status is stored for each virtual interface and for the whole device. The WF200 is able to handle power saving per interface, so use the value stored in vif. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200526171821.934581-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit c791f746c88f9d4ac7171807f15d4eaa724855a5 Author: Jérôme Pouiller Date: Tue May 26 19:18:15 2020 +0200 staging: wfx: add support for tx_power_loop During the calibration of the RF amplifier, the device is able to provide some data about the status of the amplifier. Record these data and expose them in debugfs. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200526171821.934581-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit be2e96222fb69b6e0c38888f10824200124c6d0d Author: Jérôme Pouiller Date: Tue May 26 19:18:14 2020 +0200 staging: wfx: drop unused function wfx_pending_requeue() The function wfx_pending_requeue() is not used anymore since the commit 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Fixes: 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200526171821.934581-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 5998b72a9f6172c29e7a11bd86d0d4cefd0fc4b2 Author: Jérôme Pouiller Date: Tue May 26 19:18:13 2020 +0200 staging: wfx: do not declare variables inside loops The local variables should be declared at beginning of the functions. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200526171821.934581-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 100c06f5dfc300ee67d08786c1a646c0fe327a86 Author: Jérôme Pouiller Date: Tue May 26 19:18:12 2020 +0200 staging: wfx: drop unused variable Since the commit 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies"), the variable "count" is no more used in wfx_tx_policy_build(). Notice that there were two instances of the variable "count" in wfx_tx_policy_build(). This patch also solves this cosmetic issue. Reported-by: kbuild test robot Fixes: 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200526171821.934581-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit c630fa6e7bb67a23c715be90944b1831d6b01dd0 Author: Michael Straube Date: Sun May 24 12:15:14 2020 +0200 staging: rtl8188eu: make some arrays static const Make some arrays in phy_iq_calibrate() static const and adjust the functions that take these arrays as parameters accordingly. Reduces object file size by 84 bytes (GCC 9.3.1 x86_64). Suggested-by: Joe Perches Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200524101514.20557-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 529d45bf314f87559ddd19ab1e7a64bc13314f1e Author: Michael Straube Date: Sun May 24 12:15:13 2020 +0200 staging: rtl8188eu: clean up some declarations Clean up some array declarations in phy_iq_calibrate() to reduce indentation and clear line over 80 characters checkpatch warnings. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200524101514.20557-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 671ec4a59e11b9b024a0d926acd82476b4082a6b Author: Oscar Carter Date: Sun May 24 11:15:15 2020 +0200 staging/rtl8192e: Remove function callback casts In an effort to enable -Wcast-function-type in the top-level Makefile to support Control Flow Integrity builds, remove all the function callback casts. To do this modify the function prototypes accordingly. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200524091515.21799-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit a069cd178f63374327ded3cb1a279a317fe65496 Author: Malcolm Priestley Date: Sun May 24 00:12:41 2020 +0100 staging: vt6656: Fix vnt_tx_usb_header static checker warning drivers/staging/vt6656/rxtx.c:729 vnt_beacon_xmit() warn: struct type mismatch 'vnt_beacon_buffer vs vnt_tx_usb_header' Since the only part of vnt_beacon_buffer is used remove and replace it with vnt_tx_usb_header. Reported-by: Dan Carpenter Signed-off-by: Malcolm Priestley Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/9818e564-81f6-a683-caa0-69423fded401@gmail.com Signed-off-by: Greg Kroah-Hartman commit 15ea976a1f12b5fd76b1bd6ff3eb5132fd28047f Author: Pascal Terjan Date: Sat May 23 22:12:47 2020 +0100 staging: rtl8712: Fix IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK The value in shared headers was fixed 9 years ago in commit 8d661f1e462d ("ieee80211: correct IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK macro") and while looking at using shared headers for other duplicated constants I noticed this driver uses the old value. The macros are also defined twice in this file so I am deleting the second definition. Signed-off-by: Pascal Terjan Cc: stable Link: https://lore.kernel.org/r/20200523211247.23262-1-pterjan@google.com Signed-off-by: Greg Kroah-Hartman commit e785e87b65434a243ee2197bb5038a67f8ea1426 Author: John Oldman Date: Sat May 23 18:28:12 2020 +0100 staging: rtl8192e: Using comparison to true is error prone clear below issues reported by checkpatch.pl: CHECK: Using comparison to false is error prone Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200523172812.16473-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit a403bbab1a73d798728d76931cab3ff0399b9560 Author: Alain Volmat Date: Sun Mar 22 15:07:40 2020 +0100 clk: clk-flexgen: fix clock-critical handling Fixes an issue leading to having all clocks following a critical clocks marked as well as criticals. Fixes: fa6415affe20 ("clk: st: clk-flexgen: Detect critical clocks") Signed-off-by: Alain Volmat Link: https://lkml.kernel.org/r/20200322140740.3970-1-avolmat@me.com Reviewed-by: Patrice Chotard Signed-off-by: Stephen Boyd commit 119aadf816f5373dc82ca4109d6d5b777e00475b Author: Ramon Fontes Date: Fri May 15 13:46:40 2020 -0300 mac80211_hwsim: report the WIPHY_FLAG_SUPPORTS_5_10_MHZ capability Signed-off-by: Ramon Fontes Link: https://lore.kernel.org/r/20200515164640.97276-1-ramonreisfontes@gmail.com [fix indentation to use tabs] Signed-off-by: Johannes Berg commit c11299243370580832c27882dcedf2604f9f48f8 Author: Johannes Berg Date: Tue May 26 14:33:48 2020 +0200 mac80211: fix HT-Control field reception for management frames If we receive management frames with an HT-Control field, we cannot parse them properly, as we assume a fixed length management header. Since we don't even need the HTC field (for these frames, or really at all), just remove it at the beginning of RX. Reported-by: Haggai Abramovsky Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200526143346.cf5ce70521c5.I333251a084ec4cfe67b7ef7efe2d2f1a33883931@changeid Signed-off-by: Johannes Berg commit 1b9ae0c92925ac40489be526d67d0010d0724ce0 Author: Hauke Mehrtens Date: Thu May 21 22:14:22 2020 +0200 wireless: Use linux/stddef.h instead of stddef.h When compiling inside the kernel include linux/stddef.h instead of stddef.h. When I compile this header file in backports for power PC I run into a conflict with ptrdiff_t. I was unable to reproduce this in mainline kernel. I still would like to fix this problem in the kernel. Fixes: 6989310f5d43 ("wireless: Use offsetof instead of custom macro.") Signed-off-by: Hauke Mehrtens Link: https://lore.kernel.org/r/20200521201422.16493-1-hauke@hauke-m.de Signed-off-by: Johannes Berg commit a3b018febccd3686c39e86e98b5081bde014fc66 Author: Patrick Steinhardt Date: Sun May 17 18:30:19 2020 +0200 cfg80211: fix CFG82011_CRDA_SUPPORT still mentioning internal regdb Back with commit c8c240e284b3 (cfg80211: reg: remove support for built-in regdb, 2015-10-15), support for using CFG80211_INTERNAL_REGDB was removed in favor of loading the regulatory database as firmware file. The documentation of CFG80211_CRDA_SUPPORT was not adjusted, though, which is why it still mentions mentions the old way of loading via the internal regulatory database. Remove it so that the kernel option only mentions using the firmware file. Signed-off-by: Patrick Steinhardt Link: https://lore.kernel.org/r/c56e60207fbd0512029de8c6276ee00f73491924.1589732954.git.ps@pks.im Signed-off-by: Johannes Berg commit 9a5f6488623730dc16cca0836ade23869761adee Author: Tamizh Chelvam Date: Wed May 13 13:41:44 2020 +0530 nl80211: Add support to configure TID specific Tx rate configuration This patch adds support to configure per TID Tx Rate configuration through NL80211_TID_CONFIG_ATTR_TX_RATE* attributes. And it uses nl80211_parse_tx_bitrate_mask api to validate the Tx rate mask. Signed-off-by: Tamizh Chelvam Link: https://lore.kernel.org/r/1589357504-10175-1-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg commit 1ea02224afc29431880a67b8c3198146cc01d33e Author: Johannes Berg Date: Tue May 26 10:31:33 2020 +0200 mac80211: allow SA-QUERY processing in userspace As discussed with Mathy almost two years ago in http://lore.kernel.org/r/20180806224857.14853-1-Mathy.Vanhoef@cs.kuleuven.be we should let userspace process SA-QUERY frames if it wants to, so that it can handle OCV (operating channel validation) which mac80211 doesn't know how to. Evidently I had been expecting Mathy to (re)send such a patch, but he never did, perhaps expecting me to do it after our discussion. In any case, this came up now with OCV getting more attention, so move the code around as discussed there to let userspace handle it, and do it properly. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200526103131.1f9cf7e5b6db.Iae5b42b09ad2b1cbcbe13492002c43f0d1d51dfc@changeid Signed-off-by: Johannes Berg commit dca9ca2d588bd2c0989c671f048540b82e57cf1e Author: Markus Theil Date: Fri May 8 16:42:00 2020 +0200 nl80211: add ability to report TX status for control port TX This adds the necessary capabilities in nl80211 to allow drivers to assign a cookie to control port TX frames (returned via extack in the netlink ACK message of the command) and then later report the frame's status. Signed-off-by: Markus Theil Link: https://lore.kernel.org/r/20200508144202.7678-2-markus.theil@tu-ilmenau.de [use extack cookie instead of explicit message, recombine patches] Signed-off-by: Johannes Berg commit 3c23215ba8c70c0e9b16beffb7f700a401391e38 Author: Gustavo A. R. Silva Date: Thu May 7 13:59:07 2020 -0500 mac80211: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507185907.GA15102@embeddedor Signed-off-by: Johannes Berg commit 396fba0a59f3c94d6fd6443fbeabd8bd9e3956eb Author: Gustavo A. R. Silva Date: Thu May 7 13:39:09 2020 -0500 cfg80211: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507183909.GA12993@embeddedor Signed-off-by: Johannes Berg commit fedd0fe4e89b009f31eb53ec36dbdf1e457616c0 Author: Tamizh Chelvam Date: Mon May 4 22:34:59 2020 +0530 mac80211: Add new AMPDU factor macro for HE peer caps Add IEEE80211_HE_VHT_MAX_AMPDU_FACTOR and IEEE80211_HE_HT_MAX_AMPDU_FACTOR as per spec to use for peer max ampdu factor. Signed-off-by: Tamizh Chelvam Link: https://lore.kernel.org/r/1588611900-21185-1-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg commit d6fb67ff86bb991d5ac18471e5f739bc32e5090e Author: Thomas Pedersen Date: Thu Apr 30 10:25:53 2020 -0700 ieee80211: S1G defines These are found in IEEE-802.11ah-2016. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200430172554.18383-5-thomas@adapt-ip.com Signed-off-by: Johannes Berg commit 2032f3b2f943256ff40df23182913dfc7e73ec6a Author: Thomas Pedersen Date: Thu Apr 30 10:25:52 2020 -0700 nl80211: support scan frequencies in KHz If the driver advertises NL80211_EXT_FEATURE_SCAN_FREQ_KHZ userspace can omit NL80211_ATTR_SCAN_FREQUENCIES in favor of an NL80211_ATTR_SCAN_FREQ_KHZ. To get scan results in KHz userspace must also set the NL80211_SCAN_FLAG_FREQ_KHZ. This lets nl80211 remain compatible with older userspaces while not requring and sending redundant (and potentially incorrect) scan frequency sets. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200430172554.18383-4-thomas@adapt-ip.com [use just nla_nest_start() (not _noflag) for NL80211_ATTR_SCAN_FREQ_KHZ] Signed-off-by: Johannes Berg commit 942ba88ba9c87f5e225574f1f0d6548f0105ed73 Author: Thomas Pedersen Date: Thu Apr 30 10:25:51 2020 -0700 nl80211: add KHz frequency offset for most wifi commands cfg80211 recently gained the ability to understand a frequency offset component in KHz. Expose this in nl80211 through the new attributes NL80211_ATTR_WIPHY_FREQ_OFFSET, NL80211_FREQUENCY_ATTR_OFFSET, NL80211_ATTR_CENTER_FREQ1_OFFSET, and NL80211_BSS_FREQUENCY_OFFSET. These add support to send and receive a KHz offset component with the following NL80211 commands: - NL80211_CMD_FRAME - NL80211_CMD_GET_SCAN - NL80211_CMD_AUTHENTICATE - NL80211_CMD_ASSOCIATE - NL80211_CMD_CONNECT Along with any other command which takes a chandef, ie: - NL80211_CMD_SET_CHANNEL - NL80211_CMD_SET_WIPHY - NL80211_CMD_START_AP - NL80211_CMD_RADAR_DETECT - NL80211_CMD_NOTIFY_RADAR - NL80211_CMD_CHANNEL_SWITCH - NL80211_JOIN_IBSS - NL80211_CMD_REMAIN_ON_CHANNEL - NL80211_CMD_JOIN_OCB - NL80211_CMD_JOIN_MESH - NL80211_CMD_TDLS_CHANNEL_SWITCH If the driver advertises a band containing channels with frequency offset, it must also verify support for frequency offset channels in its cfg80211 ops, or return an error. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200430172554.18383-3-thomas@adapt-ip.com Signed-off-by: Johannes Berg commit e76fede8bf7c90d92c799d9ceb092dec48346e2c Author: Thomas Pedersen Date: Thu Apr 30 10:25:50 2020 -0700 cfg80211: add KHz variants of frame RX API Drivers may wish to report the RX frequency in units of KHz. Provide cfg80211_rx_mgmt_khz() and wrap it with cfg80211_rx_mgmt() so exisiting drivers which can't report KHz anyway don't need to change. Add a similar wrapper for cfg80211_report_obss_beacon() so the frequency units stay somewhat consistent. This doesn't actually change the nl80211 API yet. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200430172554.18383-2-thomas@adapt-ip.com [fix mac80211 calling the non-khz version of obss beacon report, drop trace point name changes] Signed-off-by: Johannes Berg commit c03369558c435f7e82f7c06b0173fa73c1ed15c0 Author: Sergey Matyukevich Date: Fri Apr 24 14:29:04 2020 +0300 nl80211: simplify peer specific TID configuration Current rule for applying TID configuration for specific peer looks overly complicated. No need to reject new TID configuration when override flag is specified. Another call with the same TID configuration, but without override flag, allows to apply new configuration anyway. Use the same approach as for the 'all peers' case: if override flag is specified, then reset existing TID configuration and immediately apply a new one. Signed-off-by: Sergey Matyukevich Link: https://lore.kernel.org/r/20200424112905.26770-5-sergey.matyukevich.os@quantenna.com Signed-off-by: Johannes Berg commit 33462e68231bccfe563a87614f4c4dd5d333837c Author: Sergey Matyukevich Date: Fri Apr 24 14:29:03 2020 +0300 cfg80211: add support for TID specific AMSDU configuration This patch adds support to control per TID MSDU aggregation using the NL80211_TID_CONFIG_ATTR_AMSDU_CTRL attribute. Signed-off-by: Sergey Matyukevich Link: https://lore.kernel.org/r/20200424112905.26770-4-sergey.matyukevich.os@quantenna.com Signed-off-by: Johannes Berg commit 60c2ef0ef07f319504763eaaed8cb003af879008 Author: Sergey Matyukevich Date: Fri Apr 24 14:29:02 2020 +0300 mac80211: fix variable names in TID config methods Fix all variable names from 'tid' to 'tids' to avoid confusion. Now this is not TID number, but TID mask. Signed-off-by: Sergey Matyukevich Link: https://lore.kernel.org/r/20200424112905.26770-3-sergey.matyukevich.os@quantenna.com Signed-off-by: Johannes Berg commit 2d5d9b7ff49f52ab3ec66ffdc841471a1353ea1b Author: Sergey Matyukevich Date: Fri Apr 24 14:29:01 2020 +0300 cfg80211: fix mask type in cfg80211_tid_cfg structure TIDs mask type is u64 in wiphy settings and nl80211 processing, see: - wiphy TIDs mask sizes in tid_config_support structure - prepare driver command in parse_tid_conf Use the same type for TIDs mask in cfg80211_tid_cfg. Signed-off-by: Sergey Matyukevich Link: https://lore.kernel.org/r/20200424112905.26770-2-sergey.matyukevich.os@quantenna.com Signed-off-by: Johannes Berg commit 399ad9477c523f721f8e51d4f824bdf7267f120c Author: Daniele Palmas Date: Mon May 25 23:11:06 2020 +0200 USB: serial: option: add Telit LE910C1-EUX compositions Add Telit LE910C1-EUX compositions: 0x1031: tty, tty, tty, rmnet 0x1033: tty, tty, tty, ecm Signed-off-by: Daniele Palmas Link: https://lore.kernel.org/r/20200525211106.27338-1-dnlplm@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit dc543267c7adcad139a439230052b4e609f7018b Author: Rikard Falkeborn Date: Sat May 9 00:02:38 2020 +0200 clk: bcm2835: Constify struct debugfs_reg32 bcm2835_debugfs_clock_reg32 is never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 26598 16088 64 42750 a6fe drivers/clk/bcm/clk-bcm2835.o After: text data bss dec hex filename 26662 16024 64 42750 a6fe drivers/clk/bcm/clk-bcm2835.o Signed-off-by: Rikard Falkeborn Link: https://lkml.kernel.org/r/20200508220238.4883-1-rikard.falkeborn@gmail.com Signed-off-by: Stephen Boyd commit 156ad7f9e0b39cfa0ed02e42c6e1c258c4e81e05 Author: Yuechao Zhao Date: Wed May 27 06:16:59 2020 +0000 hwmon: (nct7904) Set default timeout The timeout module parameter should not be used for setting the default timeout. Because, if you set the timeout = 0, the default timeout will be meaningless. And the timeout module parameter of 0 means "no timeout module parameter specified". Signed-off-by: Yuechao Zhao Link: https://lore.kernel.org/r/1590560219-41328-1-git-send-email-yuechao.zhao@advantech.com.cn Signed-off-by: Guenter Roeck commit 7edd363421dab1d4806802ac65613d1c0ec85824 Author: Gene Chen Date: Thu Apr 23 19:24:52 2020 +0800 mfd: Add support for PMIC MT6360 Add MFD driver for mt6360 pmic chip include Battery Charger/ USB_PD/Flash, LED/RGB and LED/LDO/Buck Signed-off-by: Gene Chen Signed-off-by: Lee Jones commit 2c1c9696450ff6743f01dc6ae29aecf7b1f8bc54 Author: Chunyan Zhang Date: Wed May 27 13:36:38 2020 +0800 clk: sprd: add mipi_csi_xx gate clocks mipi_csi_xx clocks are used by camera sensors. Signed-off-by: Chunyan Zhang Link: https://lkml.kernel.org/r/20200527053638.31439-5-zhang.lyra@gmail.com Signed-off-by: Stephen Boyd commit d7160288f962a63e968d1955fb6a97b79e8317fe Author: Chunyan Zhang Date: Wed May 27 13:36:37 2020 +0800 clk: sprd: add dt-bindings include for mipi_csi_xx clocks mipi_csi_xx clocks are used by camera sensors. Signed-off-by: Chunyan Zhang Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200527053638.31439-4-zhang.lyra@gmail.com Signed-off-by: Stephen Boyd commit 82a4d4a78e59a6604aa1a7f6fe4870c595e5a761 Author: Chunyan Zhang Date: Wed May 27 13:36:36 2020 +0800 dt-bindings: clk: sprd: add mipi_csi_xx clocks for SC9863A mipi_csi_xx clocks are used by camera sensors. Signed-off-by: Chunyan Zhang Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20200527053638.31439-3-zhang.lyra@gmail.com Signed-off-by: Stephen Boyd commit 8b4f6b8d59c614477ce65da15a4f5ddc31b2c398 Author: Chunyan Zhang Date: Wed May 27 13:36:35 2020 +0800 clk: sprd: check its parent status before reading gate clock Some clocks only can be accessed if their parent is enabled. mipi_csi_xx clocks on SC9863A are an examples. We have to ensure the parent clock is enabled when reading those clocks. Signed-off-by: Chunyan Zhang Link: https://lkml.kernel.org/r/20200527053638.31439-2-zhang.lyra@gmail.com Signed-off-by: Stephen Boyd commit 6f4d3c13b71c6ebd4d04d0adca53859131c595eb Author: Colin Ian King Date: Tue May 26 23:41:16 2020 +0100 clk: versatile: remove redundant assignment to pointer clk The pointer clk is being initialized with a value that is never read and is being updated with a new value later on. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lkml.kernel.org/r/20200526224116.63549-1-colin.king@canonical.com Reviewed-by: Linus Walleij Signed-off-by: Stephen Boyd commit dc0f3ed1973f101508957b59e529e03da1349e09 Author: Oleksij Rempel Date: Wed May 27 07:08:43 2020 +0200 net: phy: at803x: add cable diagnostics support for ATH9331 and ATH8032 Add support for Atheros 100Base-T PHYs. The only difference seems to be the ability to test 2 pairs instead of 4 and the lack of 1000Base-T specific register. Only the ATH9331 was tested with this patch. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 943bbe1de5fcdec06765de182f30b1b2d05f9c43 Merge: 53c0ec4f4db1 db8668a19519 Author: David S. Miller Date: Tue May 26 23:22:28 2020 -0700 Merge branch 'Raw-PHY-TDR-data' Andrew Lunn says: ==================== Raw PHY TDR data Some ethernet PHYs allow access to raw TDR data in addition to summary diagnostics information. Add support for retrieving this data via netlink ethtool. The basic structure in the core is the same as for normal phy diagnostics, the PHY driver simply uses different helpers to fill the netlink message with different data. There is a graphical tool under development, as well a ethtool(1) which can dump the data as text and JSON. A patched ethtool(1) can be found in https://github.com/lunn/ethtool.git feature/cable-test-v5 Thanks for Chris Healy for lots of testing. v2: See the individual patches but: Pass distances in centimeters, not meters Allow the PHY to round distances to what it supports and report what it actually used along with the results. Make the Marvell PHY use steps a multiple of 0.805 meters, its native step size. v3: Move the TDR configuration into a structure Add a range check on step Use NL_SET_ERR_MSG_ATTR() when appropriate Move TDR configuration into a nest Document attributes in the request Unsquash the last two patches ==================== Signed-off-by: David S. Miller commit db8668a1951954156c039b9f8fe2881d428a522c Author: Andrew Lunn Date: Wed May 27 00:21:43 2020 +0200 net: phy: marvell: Configure TDR pulse based on measurement length When performing a TDR measurement for a short distance, the pulse width should be low, to help differentiate between the outgoing pulse and any reflection. For longer distances, the pulse should be wider, to help with attenuation. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit a618e86da91d259374caff065cc557899dc181ce Author: Andrew Lunn Date: Wed May 27 00:21:42 2020 +0200 net : phy: marvell: Speedup TDR data retrieval by only changing page once Getting the TDR data requires a large number of MDIO bus transactions. The number can however be reduced if the page is only changed once. Add the needed locking to allow this, and make use of unlocked read/write methods where needed. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit f2bc8ad31a7f814237bc6301d59296d76505a688 Author: Andrew Lunn Date: Wed May 27 00:21:41 2020 +0200 net: ethtool: Allow PHY cable test TDR data to configured Allow the user to configure where on the cable the TDR data should be retrieved, in terms of first and last sample, and the step between samples. Also add the ability to ask for TDR data for just one pair. If this configuration is not provided, it defaults to 1-150m at 1m intervals for all pairs. Signed-off-by: Andrew Lunn v3: Move the TDR configuration into a structure Add a range check on step Use NL_SET_ERR_MSG_ATTR() when appropriate Move TDR configuration into a nest Document attributes in the request Signed-off-by: David S. Miller commit 0c9bcc1d2394acef2c6e89e652d984cc845c7bea Author: Andrew Lunn Date: Wed May 27 00:21:40 2020 +0200 net: phy: marvell: Add support for amplitude graph The Marvell PHYs can measure the amplitude of the returned signal for a given distance. Implement this option of the cable test infrastructure. When reporting the step, convert the distance into cm. Signed-off-by: Andrew Lunn v2: Step based on the measurement resolution, and convert this to cm. Signed-off-by: David S. Miller commit 6b4a0fc106521e480c00b55a7ef38c89f02dc4e8 Author: Andrew Lunn Date: Wed May 27 00:21:39 2020 +0200 net: ethtool: Add helpers for cable test TDR data Add helpers for returning raw TDR helpers in netlink messages. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 1a644de29f712771c2ec00e52caa391544eb6141 Author: Andrew Lunn Date: Wed May 27 00:21:38 2020 +0200 net: ethtool: Add generic parts of cable test TDR Add the generic parts of the code used to trigger a cable test and return raw TDR data. Any PHY driver which support this must implement the new driver op. Signed-off-by: Andrew Lunn v2 Update nxp-tja11xx for API change. Signed-off-by: David S. Miller commit a331172b156b23e83dfb556ade0ca23426c3f149 Author: Andrew Lunn Date: Wed May 27 00:21:37 2020 +0200 net: ethtool: Add attributes for cable test TDR data Some Ethernet PHYs can return the raw time domain reflectromatry data. Add the attributes to allow this data to be requested and returned via netlink ethtool. Signed-off-by: Andrew Lunn v2: m -> cm Report what the PHY actually used for start/stop/step. Signed-off-by: David S. Miller commit 53c0ec4f4db19d430570bbbfc80ce899419d29f4 Author: Armin Wolf Date: Tue May 26 20:03:02 2020 +0200 ne2k-pci: Fix various coding-style issues and improve printk() usage Fixed a ton of minor checkpatch errors/warnings and remove version printing at module init/when device is found and use MODULE_VERSION instead. Also modifying the RTL8029 PCI string to include the compatible RTL8029AS nic. The only mayor issue remaining is the missing SPDX tag, but since the exact version of the GPL is not stated anywhere inside the file, its impossible to add such a tag at the moment. But maybe it is possible, since 8390.h states Donald Becker's 8390 drivers are licensed under GPL 2.2 only (= GPL-2.0-only ?). The kernel module containing this patch compiles and runs without problems on a RTL8029AS-based NE2000 clone card with kernel 5.7.0-rc6. Signed-off-by: Armin Wolf Signed-off-by: David S. Miller commit 81f3dc9349ce0bf7b8447f147f45e70f0a5b36a6 Author: Alexander Sverdlin Date: Tue May 26 14:27:51 2020 +0200 macvlan: Skip loopback packets in RX handler Ignore loopback-originatig packets soon enough and don't try to process L2 header where it doesn't exist. The very similar br_handle_frame() in bridge code performs exactly the same check. This is an example of such ICMPv6 packet: skb len=96 headroom=40 headlen=96 tailroom=56 mac=(40,0) net=(40,40) trans=80 shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0)) csum(0xae2e9a2f ip_summed=1 complete_sw=0 valid=0 level=0) hash(0xc97ebd88 sw=1 l4=1) proto=0x86dd pkttype=5 iif=24 dev name=etha01.212 feat=0x0x0000000040005000 skb headroom: 00000000: 00 7c 86 52 84 88 ff ff 00 00 00 00 00 00 08 00 skb headroom: 00000010: 45 00 00 9e 5d 5c 40 00 40 11 33 33 00 00 00 01 skb headroom: 00000020: 02 40 43 80 00 00 86 dd skb linear: 00000000: 60 09 88 bd 00 38 3a ff fe 80 00 00 00 00 00 00 skb linear: 00000010: 00 40 43 ff fe 80 00 00 ff 02 00 00 00 00 00 00 skb linear: 00000020: 00 00 00 00 00 00 00 01 86 00 61 00 40 00 00 2d skb linear: 00000030: 00 00 00 00 00 00 00 00 03 04 40 e0 00 00 01 2c skb linear: 00000040: 00 00 00 78 00 00 00 00 fd 5f 42 68 23 87 a8 81 skb linear: 00000050: 00 00 00 00 00 00 00 00 01 01 02 40 43 80 00 00 skb tailroom: 00000000: ... skb tailroom: 00000010: ... skb tailroom: 00000020: ... skb tailroom: 00000030: ... Call Trace, how it happens exactly: ... macvlan_handle_frame+0x321/0x425 [macvlan] ? macvlan_forward_source+0x110/0x110 [macvlan] __netif_receive_skb_core+0x545/0xda0 ? enqueue_task_fair+0xe5/0x8e0 ? __netif_receive_skb_one_core+0x36/0x70 __netif_receive_skb_one_core+0x36/0x70 process_backlog+0x97/0x140 net_rx_action+0x1eb/0x350 ? __hrtimer_run_queues+0x136/0x2e0 __do_softirq+0xe3/0x383 do_softirq_own_stack+0x2a/0x40 do_softirq.part.4+0x4e/0x50 netif_rx_ni+0x60/0xd0 dev_loopback_xmit+0x83/0xf0 ip6_finish_output2+0x575/0x590 [ipv6] ? ip6_cork_release.isra.1+0x64/0x90 [ipv6] ? __ip6_make_skb+0x38d/0x680 [ipv6] ? ip6_output+0x6c/0x140 [ipv6] ip6_output+0x6c/0x140 [ipv6] ip6_send_skb+0x1e/0x60 [ipv6] rawv6_sendmsg+0xc4b/0xe10 [ipv6] ? proc_put_long+0xd0/0xd0 ? rw_copy_check_uvector+0x4e/0x110 ? sock_sendmsg+0x36/0x40 sock_sendmsg+0x36/0x40 ___sys_sendmsg+0x2b6/0x2d0 ? proc_dointvec+0x23/0x30 ? addrconf_sysctl_forward+0x8d/0x250 [ipv6] ? dev_forward_change+0x130/0x130 [ipv6] ? _raw_spin_unlock+0x12/0x30 ? proc_sys_call_handler.isra.14+0x9f/0x110 ? __call_rcu+0x213/0x510 ? get_max_files+0x10/0x10 ? trace_hardirqs_on+0x2c/0xe0 ? __sys_sendmsg+0x63/0xa0 __sys_sendmsg+0x63/0xa0 do_syscall_64+0x6c/0x1e0 entry_SYSCALL_64_after_hwframe+0x49/0xbe Signed-off-by: Alexander Sverdlin Signed-off-by: David S. Miller commit 6b6e89636f51581895922780c3c4fd51bb9e1483 Author: James Smart Date: Wed May 20 11:59:29 2020 -0700 lpfc: Fix return value in __lpfc_nvme_ls_abort A static checker reported the following issue: drivers/scsi/lpfc/lpfc_nvmet.c:1366 lpfc_nvmet_ls_abort() warn: 'ret' can be either negative or positive The comment indicates a non-zero value indicates error in the form of -Exxx, but the code is returning "1". Fix the code to return -EINVAL to be compliant to comment. Fixes: e96a22b0b7c2 ("lpfc: Refactor Send LS Abort support") Reported-by: Dan Carpenter Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Dan Carpenter Signed-off-by: Christoph Hellwig commit 4e57e0b9f343fd14497ab04b2bc08c1784830b9d Author: James Smart Date: Wed May 20 11:59:28 2020 -0700 lpfc: fix axchg pointer reference after free and double frees The axchg structure is a structure allocated early in the lpfc_nvme_unsol_ls_handler() to represent the newly received exchange. Upon error, the out_fail path in the routine unconditionally frees the pointer, yet subsequently passes the pointer to the abort routine. Additionally, the abort routine, lpfc_nvme_unsol_ls_issue_abort(), also has a failure path that will attempt to delete the pointer on error. Fix these errors by: - Removing the unconditional free so that it stays valid if passed to the abort routine. - Revise the abort routine to not free the pointer. Instead, return a success/failure status. Note: if success, the later completion of the abort frees the structure. - Back in the unsol_ls_handler() error path, if the abort routine was skipped (thus no possible reference) or the abort routine returned error, free the pointer. Fixes: 3a8070c567aa ("lpfc: Refactor NVME LS receive handling") Reported-by: Dan Carpenter Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Dan Carpenter Signed-off-by: Christoph Hellwig commit fcdd14b86f6b891b5e894bf1dbeaf02cc79bdbce Author: James Smart Date: Wed May 20 11:59:27 2020 -0700 lpfc: Fix pointer checks and comments in LS receive refactoring Additional testing encountered null pointers that weren't fully qualified in lpfc_nvmet_xmt_ls_abort_cmp() and lpfc_nvmet_unsol_issue_abort(). The same error was detected and reported by static checker reporting: drivers/scsi/lpfc/lpfc_sli.c:2905 lpfc_nvme_unsol_ls_handler() error: we previously assumed 'phba->targetport' could be null (see line 2837) Fix by making phba->nvmet_support and phba->targetport validity checks in lpfc_nvmet_xmt_ls_abort_cmp() and lpfc_nvmet_unsol_issue_abort(). Fixes: 3a8070c567aaa (“lpfc: Refactor NVME LS receive handling”) Reported-by: Dan Carpenter Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Dan Carpenter Signed-off-by: Christoph Hellwig commit 3b2a1ebceba3e03b17ef0970bb7757a3a64cdc8b Author: Keith Busch Date: Wed May 20 19:22:53 2020 -0700 nvme: set dma alignment to qword The default dma alignment mask is 511, which is much larger than any nvme controller requires. NVMe controllers accept qword aligned DMA addresses, so set the request_queue constraints to that. This can help avoid bounce buffers on user passthrough commands. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 1cdf9f7670a7d74e27177d5c390c2f8b3b9ba338 Author: David Milburn Date: Mon May 18 13:59:55 2020 -0500 nvmet: cleanups the loop in nvmet_async_events_process Based-on-a-patch-by: Christoph Hellwig Tested-by: Yi Zhang Signed-off-by: David Milburn Signed-off-by: Christoph Hellwig commit 64f5e9cdd711b030b05062c17b2ecfbce890cf4c Author: Sagi Grimberg Date: Wed May 20 12:48:12 2020 -0700 nvmet: fix memory leak when removing namespaces and controllers concurrently When removing a namespace, we add an NS_CHANGE async event, however if the controller admin queue is removed after the event was added but not yet processed, we won't free the aens, resulting in the below memory leak [1]. Fix that by moving nvmet_async_event_free to the final controller release after it is detached from subsys->ctrls ensuring no async events are added, and modify it to simply remove all pending aens. -- $ cat /sys/kernel/debug/kmemleak unreferenced object 0xffff888c1af2c000 (size 32): comm "nvmetcli", pid 5164, jiffies 4295220864 (age 6829.924s) hex dump (first 32 bytes): 28 01 82 3b 8b 88 ff ff 28 01 82 3b 8b 88 ff ff (..;....(..;.... 02 00 04 65 76 65 6e 74 5f 66 69 6c 65 00 00 00 ...event_file... backtrace: [<00000000217ae580>] nvmet_add_async_event+0x57/0x290 [nvmet] [<0000000012aa2ea9>] nvmet_ns_changed+0x206/0x300 [nvmet] [<00000000bb3fd52e>] nvmet_ns_disable+0x367/0x4f0 [nvmet] [<00000000e91ca9ec>] nvmet_ns_free+0x15/0x180 [nvmet] [<00000000a15deb52>] config_item_release+0xf1/0x1c0 [<000000007e148432>] configfs_rmdir+0x555/0x7c0 [<00000000f4506ea6>] vfs_rmdir+0x142/0x3c0 [<0000000000acaaf0>] do_rmdir+0x2b2/0x340 [<0000000034d1aa52>] do_syscall_64+0xa5/0x4d0 [<00000000211f13bc>] entry_SYSCALL_64_after_hwframe+0x6a/0xdf Fixes: a07b4970f464 ("nvmet: add a generic NVMe target") Reported-by: David Milburn Signed-off-by: Sagi Grimberg Tested-by: David Milburn Signed-off-by: Christoph Hellwig commit b09160c3996c11d62a08f9534c755103a10a89b4 Author: Israel Rukshin Date: Tue May 19 17:06:03 2020 +0300 nvmet-rdma: add metadata/T10-PI support For capable HCAs (e.g. ConnectX-5/ConnectX-6) this will allow end-to-end protection information passthrough and validation for NVMe over RDMA transport. Metadata support was implemented over the new RDMA signature verbs API. Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit c6e3f13398123a008cd2ee28f93510b113a32791 Author: Israel Rukshin Date: Tue May 19 17:06:02 2020 +0300 nvmet: add metadata support for block devices Allocate the metadata SGL buffers and set metadata fields for the request. Then create a block IO request for the metadata from the protection SG list. Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit ea52ac1c6605fbd25347fabf46233e260dd92eb2 Author: Israel Rukshin Date: Tue May 19 17:06:01 2020 +0300 nvmet: add metadata/T10-PI support Expose the namespace metadata format when PI is enabled. The user needs to enable the capability per subsystem and per port. The other metadata properties are taken from the namespace/bdev. Usage example: echo 1 > /config/nvmet/subsystems/${NAME}/attr_pi_enable echo 1 > /config/nvmet/ports/${PORT_NUM}/param_pi_enable Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 39481fbd14ee272edd419d73a98bc637e2a3fd35 Author: Israel Rukshin Date: Tue May 19 17:06:00 2020 +0300 nvme: add Metadata Capabilities enumerations The enumerations will be used to expose the namespace metadata format by the target. Suggested-by: Christoph Hellwig Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: James Smart Reviewed-by: Martin K. Petersen Signed-off-by: Christoph Hellwig commit 136cc1ffcf0a3309c59d844cb1a4ddad964ea3d8 Author: Israel Rukshin Date: Tue May 19 17:05:59 2020 +0300 nvmet: rename nvmet_check_data_len to nvmet_check_transfer_len The function doesn't check only the data length, because the transfer length includes also the metadata length in some cases. This is preparation for adding metadata (T10-PI) support. Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 26af180c1bd9cdd6f9b96d8df58b51d5900a2978 Author: Israel Rukshin Date: Tue May 19 17:05:58 2020 +0300 nvmet: rename nvmet_rw_len to nvmet_rw_data_len The function doesn't add the metadata length (only data length is calculated). This is preparation for adding metadata (T10-PI) support. Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit d2d1c454a4a44010cac627fd63945ff5e7dd3b4c Author: Israel Rukshin Date: Tue May 19 17:05:57 2020 +0300 nvmet: add metadata characteristics for a namespace Fill those namespace fields from the block device format for adding metadata (T10-PI) over fabric support with block devices. Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: Martin K. Petersen Signed-off-by: Christoph Hellwig commit 5ec5d3bddc6b912b7de9e3eb6c1f2397faeca2bc Author: Max Gurtovoy Date: Tue May 19 17:05:56 2020 +0300 nvme-rdma: add metadata/T10-PI support For capable HCAs (e.g. ConnectX-5/ConnectX-6) this will allow end-to-end protection information passthrough and validation for NVMe over RDMA transport. Metadata offload support was implemented over the new RDMA signature verbs API and it is enabled for capable controllers. Signed-off-by: Max Gurtovoy Signed-off-by: Israel Rukshin Signed-off-by: Christoph Hellwig commit 324d9e7814dd9c76bb3aebf2529b02149c340d48 Author: Israel Rukshin Date: Tue May 19 17:05:55 2020 +0300 nvme-rdma: introduce nvme_rdma_sgl structure Remove first_sgl pointer from struct nvme_rdma_request and use pointer arithmetic instead. The inline scatterlist, if exists, will be located right after the nvme_rdma_request. This patch is needed as a preparation for adding PI support. Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit ba7ca2ae029607c7eb2c18e37e8bc0d2252d3d12 Author: Israel Rukshin Date: Tue May 19 17:05:54 2020 +0300 nvme: introduce NVME_INLINE_METADATA_SG_CNT SGL size of metadata is usually small. Thus, 1 inline sg should cover most cases. The macro will be used for pre-allocate a single SGL entry for metadata. The preallocation of small inline SGLs depends on SG_CHAIN capability so if the ARCH doesn't support SG_CHAIN, use the runtime allocation for the SGL. This patch is a preparation for adding metadata (T10-PI) over fabric support. Signed-off-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: Martin K. Petersen Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 33cfdc2aa6969829f42640f758357e4b015e9f7d Author: Max Gurtovoy Date: Tue May 19 17:05:53 2020 +0300 nvme: enforce extended LBA format for fabrics metadata An extended LBA is a larger LBA that is created when metadata associated with the LBA is transferred contiguously with the LBA data (AKA interleaved). The metadata may be either transferred as part of the LBA (creating an extended LBA) or it may be transferred as a separate contiguous buffer of data. According to the NVMeoF spec, a fabrics ctrl supports only an Extended LBA format. Fail revalidation in case we have a spec violation. Also add a flag that will imply on capable transports and controllers as part of a preparation for allowing end-to-end protection information for fabric controllers. Suggested-by: Christoph Hellwig Signed-off-by: Max Gurtovoy Signed-off-by: Israel Rukshin Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 95093350394a394e7c4e778176194b14b76ec5d8 Author: Max Gurtovoy Date: Tue May 19 17:05:52 2020 +0300 nvme: introduce max_integrity_segments ctrl attribute This patch doesn't change any logic, and is needed as a preparation for adding PI support for fabrics drivers that will use an extended LBA format for metadata and will support more than 1 integrity segment. Signed-off-by: Max Gurtovoy Signed-off-by: Israel Rukshin Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 4d2ce68835649afebbc5e8816b79426fb04c639f Author: James Smart Date: Tue May 19 17:05:51 2020 +0300 nvme: make nvme_ns_has_pi accessible to transports Move the nvme_ns_has_pi() inline from core.c to the nvme.h header. This allows use by the transports. Signed-off-by: James Smart [maxg: added a comment for nvme_ns_has_pi()] Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Reviewed-by: Martin K. Petersen Signed-off-by: Christoph Hellwig commit b29f84857a0f1cb4355363d0307d2b83897e8955 Author: Max Gurtovoy Date: Tue May 19 17:05:50 2020 +0300 nvme: introduce NVME_NS_METADATA_SUPPORTED flag This is a preparation for adding support for metadata in fabric controllers. New flag will imply that NVMe namespace supports getting metadata that was originally generated by host's block layer. Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Reviewed-by: Martin K. Petersen Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit ffc89b1d3ca45669e8d2226f5fd4dde756f7ad17 Author: Max Gurtovoy Date: Tue May 19 17:05:49 2020 +0300 nvme: introduce namespace features flag Replace the specific ext boolean (that implies on extended LBA format) with a feature in the new namespace features flag. This is a preparation for adding more namespace features (such as metadata specific features). Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Reviewed-by: Martin K. Petersen Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit c295ee4742fda49de598a304ef9a95cf8da6b1f5 Author: Max Gurtovoy Date: Tue May 19 17:05:48 2020 +0300 block: always define struct blk_integrity in genhd.h This will reduce the amount of ifdefs inside the source code for various drivers and also will reduce the amount of stub functions that were created for the !CONFIG_BLK_DEV_INTEGRITY case. Suggested-by: Christoph Hellwig Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Reviewed-by: Martin K. Petersen Signed-off-by: Christoph Hellwig commit 1f357548ec79a34e069716716b71194ce8b53e10 Author: Chaitanya Kulkarni Date: Tue May 19 01:06:29 2020 -0700 nvmet: revalidate-ns & generate AEN from configfs Add a new attribute "revalidate_size" for the namespace which allows user to revalidate and generate the AEN if needed. This attribute is needed so that we can install userspace rules with systemd service based on inotify/fsnotify/uevent. The registered callback for such a service will end up writing to this attribute to generate AEN if needed. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit de124f427347b0a1eb9708b1007251fc4c8a222f Author: Chaitanya Kulkarni Date: Tue May 19 01:06:28 2020 -0700 nvmet: generate AEN for ns revalidate size change The newly added function nvmet_ns_revalidate() does update the ns size in the identify namespace in-core target data structure when host issues id-ns command. This can lead to host having inconsistencies between size of the namespace present in the id-ns command result and size of the corresponding block device until host scans the namespaces explicitly. To avoid this scenario generate AEN if old size is not same as the new one in nvmet_ns_revalidate(). This will allow automatic AEN generation when host calls id-ns command and also allows target to install userspace rules so that it can trigger nvmet_ns_revalidate() (using configfs interface with the help of next patch) resulting in appropriate AEN generation when underlying namespace size change is detected. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 463c5fabb8dfca4941c4c50365bb7749ac5c9916 Author: Chaitanya Kulkarni Date: Tue May 19 01:06:27 2020 -0700 nvmet: add helper to revalidate bdev and file ns This patch adds a wrapper helper to indicate size change in the bdev & file-backed namespace when revalidating ns. This helper is needed in order to minimize code repetition in the next patch for configfs.c and existing admin-cmd.c.   Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 696ece751366e7a02a81fa0228125fe25a47969d Author: Chaitanya Kulkarni Date: Tue May 19 01:06:30 2020 -0700 nvmet: add async event tracing support This adds a new tracepoint for the target to trace async event. This is helpful in debugging and comparing host and target side async events especially when host is connected to different targets on different machines and now that we rely on userspace components to generate AEN.  Signed-off-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit ec0862ac5aa03961fd2027f861689beccd91c5d1 Author: Dan Carpenter Date: Fri May 15 15:06:59 2020 +0300 nvme: delete an unnecessary declaration The nvme_put_ctrl() is implemented earlier as an inline function so this declaration isn't required. Signed-off-by: Dan Carpenter Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit f1e71d75f04792721d411170168e68019ccb7de3 Author: Gustavo A. R. Silva Date: Thu May 7 14:04:52 2020 -0500 nvme: replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Christoph Hellwig commit 68ab60ca2d6bd8e6b1ecc2857a174c1c2b9451e9 Author: Damien Le Moal Date: Thu May 14 14:56:26 2020 +0900 nvme: fix io_opt limit setting Currently, a namespace io_opt queue limit is set by default to the physical sector size of the namespace and to the the write optimal size (NOWS) when the namespace reports optimal IO sizes. This causes problems with block limits stacking in blk_stack_limits() when a namespace block device is combined with an HDD which generally do not report any optimal transfer size (io_opt limit is 0). The code: /* Optimal I/O a multiple of the physical block size? */ if (t->io_opt & (t->physical_block_size - 1)) { t->io_opt = 0; t->misaligned = 1; ret = -1; } in blk_stack_limits() results in an error return for this function when the combined devices have different but compatible physical sector sizes (e.g. 512B sector SSD with 4KB sector disks). Fix this by not setting the optimal IO size queue limit if the namespace does not report an optimal write size value. Signed-off-by: Damien Le Moal Reviewed-by: Bart van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 84e4c204b6a0e81f56bd7d1254123390ef0498c8 Author: Wu Bo Date: Wed May 13 16:18:13 2020 +0800 nvme: disable streams when get stream params failed Disable streams again if getting the stream params fails. Signed-off-by: Wu Bo Signed-off-by: Christoph Hellwig commit 614fc1c0d980423a131bfb5c93d8d53e5272f587 Author: Martin George Date: Tue May 12 22:17:04 2020 +0530 nvme-fc: print proper nvme-fc devloss_tmo value The nvme-fc devloss_tmo is computed as the min of either the ctrl_loss_tmo (max_retries * reconnect_delay) or the remote port's devloss_tmo. But what gets printed as the nvme-fc devloss_tmo in nvme_fc_reconnect_or_delete() is always the remote port's devloss_tmo value. So correct this by printing the min value instead. Signed-off-by: Martin George Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit 9c9e76d5792b121f10c3b8ddbb639617e49197f7 Author: Weiping Zhang Date: Sat May 9 14:22:08 2020 +0800 nvme-pci: make sure write/poll_queues less or equal then cpu count Check module parameter write/poll_queues before using it to catch too large values. Reproducer: modprobe -r nvme modprobe nvme write_queues=`nproc` echo $((`nproc`+1)) > /sys/module/nvme/parameters/write_queues echo 1 > /sys/block/nvme0n1/device/reset_controller [ 657.069000] ------------[ cut here ]------------ [ 657.069022] WARNING: CPU: 10 PID: 1163 at kernel/irq/affinity.c:390 irq_create_affinity_masks+0x47c/0x4a0 [ 657.069056] dm_region_hash dm_log dm_mod [ 657.069059] CPU: 10 PID: 1163 Comm: kworker/u193:9 Kdump: loaded Tainted: G W 5.6.0+ #8 [ 657.069060] Hardware name: Inspur SA5212M5/YZMB-00882-104, BIOS 4.0.9 08/27/2019 [ 657.069064] Workqueue: nvme-reset-wq nvme_reset_work [nvme] [ 657.069066] RIP: 0010:irq_create_affinity_masks+0x47c/0x4a0 [ 657.069067] Code: fe ff ff 48 c7 c0 b0 89 14 95 48 89 46 20 e9 e9 fb ff ff 31 c0 e9 90 fc ff ff 0f 0b 48 c7 44 24 08 00 00 00 00 e9 e9 fc ff ff <0f> 0b e9 87 fe ff ff 48 8b 7c 24 28 e8 33 a0 80 00 e9 b6 fc ff ff [ 657.069068] RSP: 0018:ffffb505ce1ffc78 EFLAGS: 00010202 [ 657.069069] RAX: 0000000000000060 RBX: ffff9b97921fe5c0 RCX: 0000000000000000 [ 657.069069] RDX: ffff9b67bad80000 RSI: 00000000ffffffa0 RDI: 0000000000000000 [ 657.069070] RBP: 0000000000000000 R08: 0000000000000000 R09: ffff9b97921fe718 [ 657.069070] R10: ffff9b97921fe710 R11: 0000000000000001 R12: 0000000000000064 [ 657.069070] R13: 0000000000000060 R14: 0000000000000000 R15: 0000000000000001 [ 657.069071] FS: 0000000000000000(0000) GS:ffff9b67c0880000(0000) knlGS:0000000000000000 [ 657.069072] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 657.069072] CR2: 0000559eac6fc238 CR3: 000000057860a002 CR4: 00000000007606e0 [ 657.069073] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 657.069073] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 657.069073] PKRU: 55555554 [ 657.069074] Call Trace: [ 657.069080] __pci_enable_msix_range+0x233/0x5a0 [ 657.069085] ? kernfs_put+0xec/0x190 [ 657.069086] pci_alloc_irq_vectors_affinity+0xbb/0x130 [ 657.069089] nvme_reset_work+0x6e6/0xeab [nvme] [ 657.069093] ? __switch_to_asm+0x34/0x70 [ 657.069094] ? __switch_to_asm+0x40/0x70 [ 657.069095] ? nvme_irq_check+0x30/0x30 [nvme] [ 657.069098] process_one_work+0x1a7/0x370 [ 657.069101] worker_thread+0x1c9/0x380 [ 657.069102] ? max_active_store+0x80/0x80 [ 657.069103] kthread+0x112/0x130 [ 657.069104] ? __kthread_parkme+0x70/0x70 [ 657.069105] ret_from_fork+0x35/0x40 [ 657.069106] ---[ end trace f4f06b7d24513d06 ]--- [ 657.077110] nvme nvme0: 95/1/0 default/read/poll queues Signed-off-by: Weiping Zhang Signed-off-by: Christoph Hellwig commit 0236d3437909ff888e5c79228e2d5a851651c4c6 Author: Sagi Grimberg Date: Mon May 18 10:47:48 2020 -0700 nvmet-tcp: move send/recv error handling in the send/recv methods instead of call-sites Have routines handle errors and just bail out of the poll loop. This simplifies the code and will help as we may enhance the poll loop logic and these are somewhat in the way. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit f381ab1f26aa33f14412cb9b7cb7f947b88a55b2 Author: Sagi Grimberg Date: Tue May 12 18:01:43 2020 -0700 nvmet-tcp: set MSG_EOR if we send last payload in the batch when trying to send the pdu data digest, we should set this flag. Reported-by: Christoph Hellwig Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 4eea804364628c30facd99c30499b2b01c6272c6 Author: Sagi Grimberg Date: Mon May 4 22:20:02 2020 -0700 nvmet-tcp: set MSG_SENDPAGE_NOTLAST with MSG_MORE when we have more to send We can signal the stack that this is not the last page coming and the stack can build a larger tso segment, so go ahead and use it. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 5bb052d7aad1f4063631f2aa05452c700139f0f3 Author: Sagi Grimberg Date: Mon May 4 22:20:01 2020 -0700 nvme-tcp: set MSG_SENDPAGE_NOTLAST with MSG_MORE when we have more to send We can signal the stack that this is not the last page coming and the stack can build a larger tso segment, so go ahead and use it. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 7425596945d7f8bf79f42b2a9c8463d16e24fc34 Author: Christoph Hellwig Date: Tue May 12 18:19:13 2020 +0200 nvmet: mark nvmet_ana_state static Signed-off-by: Christoph Hellwig Reviewed-by: Max Gurtovoy Reviewed-by: Chaitanya Kulkarni commit 09bb8986c99cd3395e96635df9e712f5da45bc07 Author: Chen Zhou Date: Fri May 8 19:59:06 2020 +0800 nvmet: replace kstrndup() with kmemdup_nul() It is more efficient to use kmemdup_nul() if the size is known exactly. The doc in kernel: "Note: Use kmemdup_nul() instead if the size is known exactly." Signed-off-by: Chen Zhou Signed-off-by: Christoph Hellwig commit 4fdd2dbc7cad2863c8c44793a383182f75442dfb Merge: 4e637c70b503 10d3757fcb07 Author: David S. Miller Date: Tue May 26 20:33:59 2020 -0700 Merge branch 'mlxsw-Various-trap-changes-part-2' Ido Schimmel says: ==================== mlxsw: Various trap changes - part 2 This patch set contains another set of small changes in mlxsw trap configuration. It is the last set before exposing control traps (e.g., IGMP query, ARP request) via devlink-trap. Tested with existing devlink-trap selftests. Please see individual patches for a detailed changelog. ==================== Signed-off-by: David S. Miller commit 10d3757fcb07a83101b6578a33bd800e81d27eea Author: Ido Schimmel Date: Tue May 26 02:05:56 2020 +0300 mlxsw: spectrum_router: Allow programming link-local prefix routes The device has a trap for IPv6 packets that need be routed and have a unicast link-local destination IP (i.e., fe80::/10). This allows mlxsw to ignore link-local routes, as the packets will be trapped to the CPU in any case. However, since link-local routes are not programmed, it is possible for routed packets to hit the default route which might also be programmed to trap packets. This means that packets with a link-local destination IP might be trapped for the wrong reason. To overcome this, allow programming link-local prefix routes (usually one fe80::/64 per-table), so that the packets will be forwarded until reaching the link-local trap. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 9785b92b4443f2862495c9aa0ee8caed6f43523d Author: Ido Schimmel Date: Tue May 26 02:05:55 2020 +0300 mlxsw: spectrum: Add packet traps for BFD packets Bidirectional Forwarding Detection (BFD) provides "low-overhead, short-duration detection of failures in the path between adjacent forwarding engines" (RFC 5880). This is accomplished by exchanging BFD packets between the two forwarding engines. Up until now these packets were trapped via the general local delivery (i.e., IP2ME) trap which also traps a lot of other packets that are not as time-sensitive as BFD packets. Expose dedicated traps for BFD packets so that user space could configure a dedicated policer for them. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit dacc4e3acf542ce4c8a6dcc1a350decb443cf7f3 Author: Ido Schimmel Date: Tue May 26 02:05:54 2020 +0300 mlxsw: spectrum: Treat IPv6 link-local SIP as an exception IPv6 packets that need to be forwarded and have a link-local source IP are dropped by the kernel and an ICMPv6 "Destination unreachable" is sent to the sending host. As such, change the trap group of such packets so that they do not interfere with IPv6 management packets. In the future this trap will be exposed as an exception via devlink-trap. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 1260e083d4cff4dc223bb0913c35ba5e92d1b379 Author: Ido Schimmel Date: Tue May 26 02:05:53 2020 +0300 mlxsw: spectrum: Share one group for all locally delivered packets Routed IP packets with the Router Alert option need to be trapped to the CPU as they might need to be locally delivered to raw sockets with the IP_ROUTER_ALERT / IPV6_ROUTER_ALERT socket option. Move them to the same group with other packets that might need to be trapped following route lookup. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 500769bebef7a3b1a60c3f6028690677332446c6 Author: Ido Schimmel Date: Tue May 26 02:05:52 2020 +0300 mlxsw: reg: Move all trap groups under the same enum After the previous patch the split is no longer necessary and all the trap groups can be moved under the same enum. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit b87bde80daf77649efba90ef0b1079b84be92d39 Author: Ido Schimmel Date: Tue May 26 02:05:51 2020 +0300 mlxsw: spectrum_trap: Do not hard code "thin" policer identifier As explained in commit e612523041ab ("mlxsw: spectrum_trap: Introduce dummy group with thin policer"), the purpose of the "thin" policer is to pass as less packets as possible to the CPU. The identifier of this policer is currently set according to the maximum number of used trap groups, but this is fragile: On Spectrum-1 the maximum number of policers is less than the maximum number of trap groups, which might result in an invalid policer identifier in case the number of used trap groups grows beyond the policer limit. Solve this by dynamically allocating the policer identifier. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 03cb0ce0ddc8c00b7c4c5becff7fb7cf44b00a91 Author: Ido Schimmel Date: Tue May 26 02:05:50 2020 +0300 mlxsw: switchx2: Move SwitchX-2 trap groups out of main enum The number of Spectrum trap groups is not infinite, but two identifiers are occupied by SwitchX-2 specific trap groups. Free these identifiers by moving them out of the main enum. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 025b7de7f4e9b26c31c511e84a7cef14605e70ef Author: Ido Schimmel Date: Tue May 26 02:05:49 2020 +0300 mlxsw: spectrum: Reduce priority of locally delivered packets To align with recent recommended values. Will be configurable by future patches. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 1e3cd589421af8fed677c017f12a5f78f59aa427 Author: Ido Schimmel Date: Tue May 26 02:05:48 2020 +0300 mlxsw: spectrum: Use same trap group for local routes and link-local destination Packets with an IPv6 link-local destination (i.e., fe80::/10) should not be forwarded and are therefore trapped to the CPU for local delivery. Since these packets are trapped for the same logical reason as packets hitting local routes, associate both traps with the same group. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit d322309d726b77226cc4880ee6c38c26c1dac999 Author: Ido Schimmel Date: Tue May 26 02:05:47 2020 +0300 mlxsw: spectrum: Use separate trap group for FID miss When a packet enters the device it is classified to a filtering identifier (FID) based on the ingress port and VLAN. The FID miss trap is used to trap packets for which a FID could not be found. In mlxsw this trap should only be triggered when a port is enslaved to an OVS bridge and a matching ACL rule could not be found, so as to trigger learning. These packets are therefore completely unrelated to packets hitting local routes and should be in a different group. Move them. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 954eef26778cb878327bb38b937a0fcf51b8445b Author: Ido Schimmel Date: Tue May 26 02:05:46 2020 +0300 mlxsw: spectrum: Use same trap group for various IPv6 packets Group these various IPv6 packets (e.g., router solicitations, router advertisement) together and subject them to the same policer. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 412df3d1bb03e1fb97fee5ec9a9dc39e7ea459be Author: Ido Schimmel Date: Tue May 26 02:05:45 2020 +0300 mlxsw: spectrum: Rename IPv6 ND trap group The IPv6 Neighbour Discovery (ND) group will be used for various IPv6 packets, not all of which fall under the definition of ND, so rename it to "IPV6" which is more appropriate. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 761bc42fbecff8cfb8e529451fd0f13800d050c4 Author: Ido Schimmel Date: Tue May 26 02:05:44 2020 +0300 mlxsw: spectrum: Use same switch case for identical groups Trap groups that use the same policer settings can share the same switch case. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 3c2d8a046a4cd0bc835f2e6cfbc12f41d7f4323e Author: Ido Schimmel Date: Tue May 26 02:05:43 2020 +0300 mlxsw: spectrum: Use dedicated trap group for ACL trap Packets that are trapped via tc's trap action are currently subject to the same policer as packets hitting local routes. The latter are critical to the correct functioning of the control plane, while the former are mainly used for traffic inspection. Split the ACL trap to a separate group with its own policer. Use a higher priority for these traps than for traps using mirror action (e.g., ARP, IGMP). Otherwise, packets matching both traps will not be forwarded in hardware (because of trap action) and also not forwarded in software because they will be marked with 'offload_fwd_mark'. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 4e637c70b503b686aae45716a25a94dc3a434f3a Author: Florian Westphal Date: Mon May 25 23:41:13 2020 +0200 mptcp: attempt coalescing when moving skbs to mptcp rx queue We can try to coalesce skbs we take from the subflows rx queue with the tail of the mptcp rx queue. If successful, the skb head can be discarded early. We can also free the skb extensions, we do not access them after this. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 12b1bc75cd460c30652db0d4a3bd3fc59c16742c Author: Heiner Kallweit Date: Mon May 25 21:54:00 2020 +0200 r8169: improve rtl_remove_one Don't call netif_napi_del() manually, free_netdev() does this for us. In addition reorder calls to match reverse order of calls in probe(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 59dd36f41ea6a5c69c1f737125251df2ff8eb5ce Author: Wei Yongjun Date: Wed May 27 02:24:17 2020 +0000 hwmon: (amd_energy) Missing platform_driver_unregister() on error in amd_energy_init() Add the missing platform_driver_unregister() before return from amd_energy_init() in the error handling case. Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Acked-by: Naveen krishna Chatradhi Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200527022417.105620-1-weiyongjun1@huawei.com Signed-off-by: Guenter Roeck commit c5bd76d93e72be90b4682979b2236f56b567885d Author: Jason Yan Date: Fri Apr 17 15:35:23 2020 +0800 clk: ti: dra7: remove two unused symbols Fix the following gcc warning: drivers/clk/ti/clk-7xx.c:320:43: warning: ‘dra7_gpu_sys_clk_data’ defined but not used [-Wunused-const-variable=] static const struct omap_clkctrl_div_data dra7_gpu_sys_clk_data __initconst = { ^~~~~~~~~~~~~~~~~~~~~ drivers/clk/ti/clk-7xx.c:315:27: warning: ‘dra7_gpu_sys_clk_parents’ defined but not used [-Wunused-const-variable=] static const char * const dra7_gpu_sys_clk_parents[] __initconst = { ^~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lkml.kernel.org/r/20200417073523.42520-1-yanaijie@huawei.com Acked-by: Tony Lindgren Signed-off-by: Stephen Boyd commit 03a1ee1dad0e39390ca397fff0cf84a3b1de1beb Author: Michał Mirosław Date: Tue May 5 00:37:57 2020 +0200 clk: at91: allow setting all PMC clock parents via DT We need to have clocks accessible via phandle to select them as peripheral clock parent using assigned-clock-parents in DT. Add support for PLLACK/PLLBCK/AUDIOPLLCK clocks where available. Signed-off-by: Michał Mirosław Acked-by: Alexandre Belloni Link: https://lkml.kernel.org/r/fa39cc10dab8341ea4bc2b7152be9217b2cd34a5.1588630999.git.mirq-linux@rere.qmqm.pl Signed-off-by: Stephen Boyd commit 99767cd4406fd620d33fa7f820f50764453dc897 Author: Michał Mirosław Date: Tue May 5 00:37:56 2020 +0200 clk: at91: allow setting PCKx parent via DT This exposes PROGx clocks for use in assigned-clocks DeviceTree property for selecting PCKx parent clock. Signed-off-by: Michał Mirosław Link: https://lkml.kernel.org/r/0054532c00163ddf405dad658b32f0d7d97fcc8e.1588630999.git.mirq-linux@rere.qmqm.pl Acked-by: Alexandre Belloni Signed-off-by: Stephen Boyd commit 7425f246f725e51c8a64802851303d1e2c25abd1 Author: Michał Mirosław Date: Tue May 5 00:37:56 2020 +0200 clk: at91: optimize pmc data allocation Alloc whole data structure in one block. This makes the code shorter, more efficient and easier to extend in following patch. Signed-off-by: Michał Mirosław Link: https://lkml.kernel.org/r/fc6f6d67b8cee0beace4a9d9cca7431e5efa769d.1588630999.git.mirq-linux@rere.qmqm.pl Acked-by: Alexandre Belloni Signed-off-by: Stephen Boyd commit e218325ff9c31de191d4a617f8fddd3cf78b5550 Author: Claudiu Beznea Date: Sun May 3 15:18:09 2020 +0300 clk: at91: pmc: decrement node's refcount of_find_matching_node() increment node's refcount. Call of_node_put() to decrement it after it was used. Signed-off-by: Claudiu Beznea Link: https://lkml.kernel.org/r/1588508289-10140-2-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit f6363c437dc6e287259c05849286bf0faefb0fdd Author: Claudiu Beznea Date: Sun May 3 15:18:08 2020 +0300 clk: at91: pmc: do not continue if compatible not located pmc_register_ops() is called for all AT91 devices. Return -ENODEV in case of_find_matching_node() returns NULL. Signed-off-by: Claudiu Beznea Link: https://lkml.kernel.org/r/1588508289-10140-1-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit 394fe485f8650afba404a31fe202ec822c243943 Merge: 09d0310f0767 f099b8b7531f Author: David S. Miller Date: Tue May 26 20:21:43 2020 -0700 Merge branch 'net-ethernet-fec-move-GPR-register-offset-and-bit-into-DT' Fugang Duan says: ==================== net: ethernet: fec: move GPR register offset and bit into DT The commit da722186f654 (net: fec: set GPR bit on suspend by DT configuration) set the GPR reigster offset and bit in driver for wol feature support. It brings trouble to enable wol feature on imx6sx/imx6ul/imx7d platforms that have multiple ethernet instances with different GPR bit for stop mode control. So the patch set is to move GPR register offset and bit define into DT, and enable imx6q/imx6dl imx6qp/imx6sx/imx6ul/imx7d stop mode support. Currently, below NXP i.MX boards support wol: - imx6q/imx6dl/imx6qp sabresd - imx6sx sabreauto - imx7d sdb imx6q/imx6dl/imx6qp sabresd board dts file miss the property "fsl,magic-packet;", so patch#4 is to add the property for stop mode support. v1 -> v2: - driver: switch back to store the quirks bitmask in driver_data - dt-bindings: rename 'gpr' property string to 'fsl,stop-mode' - imx6/7 dtsi: add imx6sx/imx6ul/imx7d ethernet stop mode property v2 -> v3: - driver: suggested by Sascha Hauer, use a struct fec_devinfo for abstracting differences between different hardware variants, it can give more freedom to describe the differences. - imx6/7 dtsi: correct one typo pointed out by Andrew. Thanks Martin, Andrew and Sascha Hauer for the review. ==================== Signed-off-by: David S. Miller commit f099b8b7531f86d28dbbb8e43534fd79131b62e9 Author: Fugang Duan Date: Tue May 26 00:27:13 2020 +0800 ARM: dts: imx6qdl-sabresd: enable fec wake-on-lan Enable ethernet wake-on-lan feature for imx6q/dl/qp sabresd boards since the PHY clock is supplied by external osc. Reviewed-by: Andrew Lunn Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit d009a621b92d9aea851a6d8df1c4142f423c41e6 Author: Fugang Duan Date: Tue May 26 00:27:12 2020 +0800 ARM: dts: imx: add ethernet stop mode property - Update the imx6qdl gpr property to define gpr register offset and bit in DT. - Add imx6sx/imx6ul/imx7d ethernet stop mode property. Reviewed-by: Andrew Lunn Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 998ec26b66c0fafdeec07288ef8973726c297478 Author: Fugang Duan Date: Tue May 26 00:27:11 2020 +0800 dt-bindings: fec: update the gpr property - rename the 'gpr' property string to 'fsl,stop-mode'. - Update the property to define gpr register offset and bit in DT, since different instance have different gpr bit. v2: * rename 'gpr' property string to 'fsl,stop-mode'. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 8a448bf832af537d26aa557d183a16943dce4510 Author: Fugang Duan Date: Tue May 26 00:27:10 2020 +0800 net: ethernet: fec: move GPR register offset and bit into DT The commit da722186f654 (net: fec: set GPR bit on suspend by DT configuration) set the GPR reigster offset and bit in driver for wake on lan feature. But it introduces two issues here: - one SOC has two instances, they have different bit - different SOCs may have different offset and bit So to support wake-on-lan feature on other i.MX platforms, it should configure the GPR reigster offset and bit from DT. So the patch is to improve the commit da722186f654 (net: fec: set GPR bit on suspend by DT configuration) to support multiple ethernet instances on i.MX series. v2: * switch back to store the quirks bitmask in driver_data v3: * suggested by Sascha Hauer, use a struct fec_devinfo for abstracting differences between different hardware variants, it can give more freedom to describe the differences. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 99e107439eea0dcd993f6d92f3db530772979861 Author: Codrin Ciubotariu Date: Fri May 15 17:27:20 2020 +0300 clk: at91: Add peripheral clock for PTC PMC generates the peripheral clock for the PTC. Signed-off-by: Codrin Ciubotariu Link: https://lkml.kernel.org/r/20200515142720.290206-1-codrin.ciubotariu@microchip.com Signed-off-by: Stephen Boyd commit 09d0310f07672b7e3e60cf719b96c803f4830e5c Author: Dmitry Vyukov Date: Mon May 25 17:31:58 2020 +0200 net/smc: mark smc_pnet_policy as const Netlink policies are generally declared as const. This is safer and prevents potential bugs. Signed-off-by: Dmitry Vyukov Signed-off-by: David S. Miller commit 745bd6f44cd3413f429ed3e2c7744c8abf8630d5 Merge: 0e3481195b15 60689de46c7f Author: David S. Miller Date: Tue May 26 20:17:35 2020 -0700 Merge tag 'mac80211-next-for-net-next-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== One batch of changes, containing: * hwsim improvements from Jouni and myself, to be able to test more scenarios easily * some more HE (802.11ax) support * some initial S1G (sub 1 GHz) work for fractional MHz channels * some (action) frame registration updates to help DPP support * along with other various improvements/fixes ==================== Signed-off-by: David S. Miller commit c2f30986d418f26abefc2eec90ebf06716c970d2 Author: Chunyan Zhang Date: Tue May 19 11:00:36 2020 +0800 clk: sprd: return correct type of value for _sprd_pll_recalc_rate The function _sprd_pll_recalc_rate() defines return value to unsigned long, but it would return a negative value when malloc fail, changing to return its parent_rate makes more sense, since if the callback .recalc_rate() is not set, the framework returns the parent_rate as well. Fixes: 3e37b005580b ("clk: sprd: add adjustable pll support") Signed-off-by: Chunyan Zhang Link: https://lkml.kernel.org/r/20200519030036.1785-2-zhang.lyra@gmail.com Reviewed-by: Baolin Wang Signed-off-by: Stephen Boyd commit 3aff9b5492475621e13ca83bdbf3dc8b823fc5a3 Author: Chunyan Zhang Date: Tue May 19 11:00:35 2020 +0800 clk: sprd: mark the local clock symbols static There's a few pll gate clocks which were not marked with static, and those clock are used only in the current file, so add static key word for them. Fixes: 0e4b8a2349f3 ("clk: sprd: add clocks support for SC9863A") Signed-off-by: Chunyan Zhang Link: https://lkml.kernel.org/r/20200519030036.1785-1-zhang.lyra@gmail.com Reviewed-by: Baolin Wang Signed-off-by: Stephen Boyd commit d058fd9e8984cd9f18564f7fec38e07ce671c8b8 Author: Rahul Tanwar Date: Fri Apr 17 13:54:47 2020 +0800 clk: intel: Add CGU clock driver for a new SoC Clock Generation Unit(CGU) is a new clock controller IP of a forthcoming Intel network processor SoC named Lightning Mountain(LGM). It provides programming interfaces to control & configure all CPU & peripheral clocks. Add common clock framework based clock controller driver for CGU. Signed-off-by: Rahul Tanwar Link: https://lkml.kernel.org/r/42a4f71847714df482bacffdcd84341a4052800b.1587102634.git.rahul.tanwar@linux.intel.com [sboyd@kernel.org: Kill init function to alloc and cleanup newline] Signed-off-by: Stephen Boyd commit d33b7eb8506a056a866461f83e5ef4c65d0ab9b9 Author: Sivaprakash Murugesan Date: Mon May 4 12:00:03 2020 +0530 dt-bindings: clock: Add YAML schemas for QCOM A53 PLL This patch adds schema for primary CPU PLL found on few Qualcomm platforms. Signed-off-by: Sivaprakash Murugesan Link: https://lkml.kernel.org/r/1588573803-3823-1-git-send-email-sivaprak@codeaurora.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 1664014e467923992f6f1cdb73b85fe1bb9a5f01 Author: Bryan O'Donoghue Date: Sun May 17 14:13:48 2020 +0100 clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller This patch adds support for the MSM8939 GCC. The MSM8939 is based on the MSM8916. MSM8939 is compatible in several ways with MSM8916 but, has additional functional blocks added which require additional PLL sources. In some cases functional blocks from the MSM8916 have different clock sources or different supported frequencies. Cc: Andy Gross Cc: Bjorn Andersson Cc: Michael Turquette Cc: Stephen Boyd Cc: Rob Herring Cc: Philipp Zabel Cc: linux-arm-msm@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Co-developed-by: Shawn Guo Signed-off-by: Shawn Guo Tested-by: Vincent Knecht Signed-off-by: Bryan O'Donoghue Link: https://lkml.kernel.org/r/20200517131348.688405-3-bryan.odonoghue@linaro.org Tested-by: Konrad Dybcio [sboyd@kernel.org: Drop ret in probe function to remove unused variable] Signed-off-by: Stephen Boyd commit bd4bb225eb3a149d37098cf0e17cd5170d863a37 Author: Taniya Das Date: Sun May 17 15:34:21 2020 +0530 clk: qcom: gcc: Add support for Secure control source clock The secure controller driver requires to request for various frequencies on the source clock, thus add support for the same. Signed-off-by: Taniya Das Link: https://lkml.kernel.org/r/1589709861-27580-4-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit 3005b17c5e2f426576530e3a69af2f7df16efb60 Author: Taniya Das Date: Sun May 17 15:34:20 2020 +0530 dt-bindings: clock: Add gcc_sec_ctrl_clk_src clock ID The gcc_sec_ctrl_clk_src clock is required to be controlled by the secure controller driver. Signed-off-by: Taniya Das Link: https://lkml.kernel.org/r/1589709861-27580-3-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit 1b70061f5939ff1cacd728821b4f378cb0fb7961 Author: Taniya Das Date: Sun May 17 15:34:19 2020 +0530 clk: qcom: gcc: Add support for a new frequency for SC7180 There is a requirement to support 51.2MHz from GPLL6 for qup clocks, thus update the frequency table and parent data/map to use the GPLL6 source PLL. Fixes: 17269568f7267 ("clk: qcom: Add Global Clock controller (GCC) driver for SC7180") Signed-off-by: Taniya Das Link: https://lkml.kernel.org/r/1589709861-27580-2-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit 80c6b7a0894ffdf3c781f047479752015e5d5b27 Author: Dinh Nguyen Date: Tue May 12 13:16:47 2020 -0500 clk: socfpga: agilex: add clock driver for the Agilex platform For the most part the Agilex clock structure is very similar to Stratix10, so we re-use most of the Stratix10 clock driver. Signed-off-by: Dinh Nguyen Link: https://lkml.kernel.org/r/20200512181647.5071-5-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 6b3c59780ed301f132e3f10ceb49a9984c22da01 Author: Dinh Nguyen Date: Tue May 12 13:16:46 2020 -0500 dt-bindings: documentation: add clock bindings information for Agilex Document the Agilex clock bindings, and add the clock header file. The clock header is an enumeration of all the different clocks on the Agilex platform. Signed-off-by: Dinh Nguyen Reviewed-by: Rob Herring Link: https://lkml.kernel.org/r/20200512181647.5071-4-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit d52579ce21e0f8b915cb62501789716677f9264a Author: Dinh Nguyen Date: Tue May 12 13:16:45 2020 -0500 clk: socfpga: add const to _ops data structures All the static clk_ops data structure need a const. Signed-off-by: Dinh Nguyen Link: https://lkml.kernel.org/r/20200512181647.5071-3-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 535d936f6103caee3daa0fb2be180aaed322a8b9 Author: Dinh Nguyen Date: Tue May 12 13:16:44 2020 -0500 clk: socfpga: remove clk_ops enable/disable methods The enable/disable clock ops are already defined in the standard clock ops, so we don't need to assign them. Signed-off-by: Dinh Nguyen Link: https://lkml.kernel.org/r/20200512181647.5071-2-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 762d961aee4042282b83db557edff305eb8a1713 Author: Dinh Nguyen Date: Tue May 12 13:16:43 2020 -0500 clk: socfpga: stratix10: use new parent data scheme Convert, where possible, the stratix10 clock driver to the new parent data scheme by specifying the parent data for clocks that have multiple parents. Signed-off-by: Dinh Nguyen Link: https://lkml.kernel.org/r/20200512181647.5071-1-dinguyen@kernel.org Signed-off-by: Stephen Boyd commit 195f406543e555611330b98ea8c21f113a192fc3 Author: Chengguang Xu Date: Tue May 26 17:05:43 2020 +0800 f2fs: code cleanup by removing ifdef macro surrounding Define f2fs_listxattr and to NULL when CONFIG_F2FS_FS_XATTR is not enabled, then we can remove many ugly ifdef macros in the code. Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e2266f4c3881d7dfc0eceeb0066831fefcbdbba2 Author: Rahul Tanwar Date: Fri Apr 17 13:54:46 2020 +0800 dt-bindings: clk: intel: Add bindings document & header file for CGU Clock generation unit(CGU) is a clock controller IP of Intel's Lightning Mountain(LGM) SoC. Add DT bindings include file and document for CGU clock controller driver of LGM. Reviewed-by: Rob Herring Signed-off-by: Rahul Tanwar Link: https://lkml.kernel.org/r/8dce2be13195aab20c6b11fca6af0fffe22d5241.1587102634.git.rahul.tanwar@linux.intel.com Signed-off-by: Stephen Boyd commit 9d66e85784f196fb7442193a1d7f3896ed418806 Author: YueHaibing Date: Fri Apr 3 16:30:40 2020 +0800 clk: zynqmp: Make zynqmp_clk_get_max_divisor static Fix sparse warning: drivers/clk/zynqmp/divider.c:259:5: warning: symbol 'zynqmp_clk_get_max_divisor' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Link: https://lkml.kernel.org/r/20200403083040.37748-1-yuehaibing@huawei.com Reviewed-by: Michal Simek Signed-off-by: Stephen Boyd commit e3326ae3d59e443a379367c6936941d6ab55d316 Author: Laurent Dufour Date: Wed May 20 19:43:08 2020 +0200 KVM: PPC: Book3S HV: Relax check on H_SVM_INIT_ABORT The commit 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") added checks of secure bit of SRR1 to filter out the Hcall reserved to the Ultravisor. However, the Hcall H_SVM_INIT_ABORT is made by the Ultravisor passing the context of the VM calling UV_ESM. This allows the Hypervisor to return to the guest without going through the Ultravisor. Thus the Secure bit of SRR1 is not set in that particular case. In the case a regular VM is calling H_SVM_INIT_ABORT, this hcall will be filtered out in kvmppc_h_svm_init_abort() because kvm->arch.secure_guest is not set in that case. Fixes: 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") Signed-off-by: Laurent Dufour Reviewed-by: Greg Kurz Reviewed-by: Ram Pai Signed-off-by: Paul Mackerras commit ab8b65be183180c3eef405d449163964ecc4b571 Author: Qian Cai Date: Sun May 10 01:18:34 2020 -0400 KVM: PPC: Book3S: Fix some RCU-list locks It is unsafe to traverse kvm->arch.spapr_tce_tables and stt->iommu_tables without the RCU read lock held. Also, add cond_resched_rcu() in places with the RCU read lock held that could take a while to finish. arch/powerpc/kvm/book3s_64_vio.c:76 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 no locks held by qemu-kvm/4265. stack backtrace: CPU: 96 PID: 4265 Comm: qemu-kvm Not tainted 5.7.0-rc4-next-20200508+ #2 Call Trace: [c000201a8690f720] [c000000000715948] dump_stack+0xfc/0x174 (unreliable) [c000201a8690f770] [c0000000001d9470] lockdep_rcu_suspicious+0x140/0x164 [c000201a8690f7f0] [c008000010b9fb48] kvm_spapr_tce_release_iommu_group+0x1f0/0x220 [kvm] [c000201a8690f870] [c008000010b8462c] kvm_spapr_tce_release_vfio_group+0x54/0xb0 [kvm] [c000201a8690f8a0] [c008000010b84710] kvm_vfio_destroy+0x88/0x140 [kvm] [c000201a8690f8f0] [c008000010b7d488] kvm_put_kvm+0x370/0x600 [kvm] [c000201a8690f990] [c008000010b7e3c0] kvm_vm_release+0x38/0x60 [kvm] [c000201a8690f9c0] [c0000000005223f4] __fput+0x124/0x330 [c000201a8690fa20] [c000000000151cd8] task_work_run+0xb8/0x130 [c000201a8690fa70] [c0000000001197e8] do_exit+0x4e8/0xfa0 [c000201a8690fb70] [c00000000011a374] do_group_exit+0x64/0xd0 [c000201a8690fbb0] [c000000000132c90] get_signal+0x1f0/0x1200 [c000201a8690fcc0] [c000000000020690] do_notify_resume+0x130/0x3c0 [c000201a8690fda0] [c000000000038d64] syscall_exit_prepare+0x1a4/0x280 [c000201a8690fe20] [c00000000000c8f8] system_call_common+0xf8/0x278 ==== arch/powerpc/kvm/book3s_64_vio.c:368 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 2 locks held by qemu-kvm/4264: #0: c000201ae2d000d8 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0xdc/0x950 [kvm] #1: c000200c9ed0c468 (&kvm->srcu){....}-{0:0}, at: kvmppc_h_put_tce+0x88/0x340 [kvm] ==== arch/powerpc/kvm/book3s_64_vio.c:108 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by qemu-kvm/4257: #0: c000200b1b363a40 (&kv->lock){+.+.}-{3:3}, at: kvm_vfio_set_attr+0x598/0x6c0 [kvm] ==== arch/powerpc/kvm/book3s_64_vio.c:146 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by qemu-kvm/4257: #0: c000200b1b363a40 (&kv->lock){+.+.}-{3:3}, at: kvm_vfio_set_attr+0x598/0x6c0 [kvm] Signed-off-by: Qian Cai Signed-off-by: Paul Mackerras commit 0aca8a5575544bd21b3363058afb8f1e81505150 Author: Qian Cai Date: Wed May 13 09:39:15 2020 -0400 KVM: PPC: Book3S HV: Ignore kmemleak false positives kvmppc_pmd_alloc() and kvmppc_pte_alloc() allocate some memory but then pud_populate() and pmd_populate() will use __pa() to reference the newly allocated memory. Since kmemleak is unable to track the physical memory resulting in false positives, silence those by using kmemleak_ignore(). unreferenced object 0xc000201c382a1000 (size 4096): comm "qemu-kvm", pid 124828, jiffies 4295733767 (age 341.250s) hex dump (first 32 bytes): c0 00 20 09 f4 60 03 87 c0 00 20 10 72 a0 03 87 .. ..`.... .r... c0 00 20 0e 13 a0 03 87 c0 00 20 1b dc c0 03 87 .. ....... ..... backtrace: [<000000004cc2790f>] kvmppc_create_pte+0x838/0xd20 [kvm_hv] kvmppc_pmd_alloc at arch/powerpc/kvm/book3s_64_mmu_radix.c:366 (inlined by) kvmppc_create_pte at arch/powerpc/kvm/book3s_64_mmu_radix.c:590 [<00000000d123c49a>] kvmppc_book3s_instantiate_page+0x2e0/0x8c0 [kvm_hv] [<00000000bb549087>] kvmppc_book3s_radix_page_fault+0x1b4/0x2b0 [kvm_hv] [<0000000086dddc0e>] kvmppc_book3s_hv_page_fault+0x214/0x12a0 [kvm_hv] [<000000005ae9ccc2>] kvmppc_vcpu_run_hv+0xc5c/0x15f0 [kvm_hv] [<00000000d22162ff>] kvmppc_vcpu_run+0x34/0x48 [kvm] [<00000000d6953bc4>] kvm_arch_vcpu_ioctl_run+0x314/0x420 [kvm] [<000000002543dd54>] kvm_vcpu_ioctl+0x33c/0x950 [kvm] [<0000000048155cd6>] ksys_ioctl+0xd8/0x130 [<0000000041ffeaa7>] sys_ioctl+0x28/0x40 [<000000004afc4310>] system_call_exception+0x114/0x1e0 [<00000000fb70a873>] system_call_common+0xf0/0x278 unreferenced object 0xc0002001f0c03900 (size 256): comm "qemu-kvm", pid 124830, jiffies 4295735235 (age 326.570s) hex dump (first 32 bytes): c0 00 20 10 fa a0 03 87 c0 00 20 10 fa a1 03 87 .. ....... ..... c0 00 20 10 fa a2 03 87 c0 00 20 10 fa a3 03 87 .. ....... ..... backtrace: [<0000000023f675b8>] kvmppc_create_pte+0x854/0xd20 [kvm_hv] kvmppc_pte_alloc at arch/powerpc/kvm/book3s_64_mmu_radix.c:356 (inlined by) kvmppc_create_pte at arch/powerpc/kvm/book3s_64_mmu_radix.c:593 [<00000000d123c49a>] kvmppc_book3s_instantiate_page+0x2e0/0x8c0 [kvm_hv] [<00000000bb549087>] kvmppc_book3s_radix_page_fault+0x1b4/0x2b0 [kvm_hv] [<0000000086dddc0e>] kvmppc_book3s_hv_page_fault+0x214/0x12a0 [kvm_hv] [<000000005ae9ccc2>] kvmppc_vcpu_run_hv+0xc5c/0x15f0 [kvm_hv] [<00000000d22162ff>] kvmppc_vcpu_run+0x34/0x48 [kvm] [<00000000d6953bc4>] kvm_arch_vcpu_ioctl_run+0x314/0x420 [kvm] [<000000002543dd54>] kvm_vcpu_ioctl+0x33c/0x950 [kvm] [<0000000048155cd6>] ksys_ioctl+0xd8/0x130 [<0000000041ffeaa7>] sys_ioctl+0x28/0x40 [<000000004afc4310>] system_call_exception+0x114/0x1e0 [<00000000fb70a873>] system_call_common+0xf0/0x278 Signed-off-by: Qian Cai Signed-off-by: Paul Mackerras commit 8c99d34578628b50233210dae5fc9600eea20b8e Author: Tianjia Zhang Date: Mon Apr 27 12:35:11 2020 +0800 KVM: PPC: Clean up redundant 'kvm_run' parameters In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' structure. For historical reasons, many kvm-related function parameters retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This patch does a unified cleanup of these remaining redundant parameters. Signed-off-by: Tianjia Zhang Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paul Mackerras Signed-off-by: Paul Mackerras commit 2610a57f64d55b5d09340c2b716cf20922b88605 Author: Tianjia Zhang Date: Mon Apr 27 12:35:10 2020 +0800 KVM: PPC: Remove redundant kvm_run from vcpu_arch The 'kvm_run' field already exists in the 'vcpu' structure, which is the same structure as the 'kvm_run' in the 'vcpu_arch' and should be deleted. Signed-off-by: Tianjia Zhang Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paul Mackerras Signed-off-by: Paul Mackerras commit 512721d2fcdb1bcfd87a0ffa7822c0ea37e3c65f Author: Laurent Dufour Date: Thu Apr 16 18:27:15 2020 +0200 KVM: PPC: Book3S HV: Read ibm,secure-memory nodes The newly introduced ibm,secure-memory nodes supersede the ibm,uv-firmware's property secure-memory-ranges. Firmware will no more expose the secure-memory-ranges property so first read the new one and if not found rollback to the older one. Signed-off-by: Laurent Dufour Signed-off-by: Paul Mackerras commit 32e594f9a63f6bc7fdd396d9bc0a77b18208332b Author: Chen Zhou Date: Wed Apr 1 21:09:03 2020 +0800 KVM: PPC: Book3S HV: Remove redundant NULL check Free function kfree() already does NULL check, so the additional check is unnecessary, just remove it. Signed-off-by: Chen Zhou Signed-off-by: Paul Mackerras commit 22617e21633142dd2b81541cb3b95d6fb59aa85f Author: Vignesh Raghavendra Date: Tue May 26 15:33:40 2020 +0530 scsi: ufs: ti-j721e-ufs: Fix unwinding of pm_runtime changes Fix unwinding of pm_runtime changes when bailing out of driver probe due to a failure and also on removal of driver. Link: https://lore.kernel.org/r/20200526100340.15032-1-vigneshr@ti.com Fixes: 6979e56cec97 ("scsi: ufs: Add driver for TI wrapper for Cadence UFS IP") Reported-by: Dinghao Liu Signed-off-by: Vignesh Raghavendra Signed-off-by: Martin K. Petersen commit b6170a49c59c27a10efed26c5a2969403e69aaba Author: Dan Carpenter Date: Thu May 21 15:12:21 2020 +0300 scsi: cxgb3i: Fix some leaks in init_act_open() There wasn't any clean up done if cxgb3_alloc_atid() failed and also the original code didn't release "csk->l2t". Link: https://lore.kernel.org/r/20200521121221.GA247492@mwanda Fixes: 6f7efaabefeb ("[SCSI] cxgb3i: change cxgb3i to use libcxgbi") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 1f93ad177d24e23480194a1ea34e3c5d8a47ef92 Author: Chen Tao Date: Wed May 20 17:10:36 2020 +0800 scsi: ibmvscsi: Make some functions static Fix the following warning: drivers/scsi/ibmvscsi/ibmvscsi.c:2387:12: warning: symbol 'ibmvscsi_module_init' was not declared. Should it be static? drivers/scsi/ibmvscsi/ibmvscsi.c:2409:13: warning: symbol 'ibmvscsi_module_exit' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200520091036.247286-1-chentao107@huawei.com Signed-off-by: Chen Tao Signed-off-by: Martin K. Petersen commit 7e7cd796f2776d055351d80328f45633bbb0aae5 Author: Gabriel Krisman Bertazi Date: Tue May 19 22:29:59 2020 -0400 scsi: iscsi: Fix deadlock on recovery path during GFP_IO reclaim iSCSI suffers from a deadlock in case a management command submitted via the netlink socket sleeps on an allocation while holding the rx_queue_mutex if that allocation causes a memory reclaim that writebacks to a failed iSCSI device. The recovery procedure can never make progress to recover the failed disk or abort outstanding IO operations to complete the reclaim (since rx_queue_mutex is locked), thus locking the system. Nevertheless, just marking all allocations under rx_queue_mutex as GFP_NOIO (or locking the userspace process with something like PF_MEMALLOC_NOIO) is not enough, since the iSCSI command code relies on other subsystems that try to grab locked mutexes, whose threads are GFP_IO, leading to the same deadlock. One instance where this situation can be observed is in the backtraces below, stitched from multiple bugs reports, involving the kobj uevent sent when a session is created. The root of the problem is not the fact that iSCSI does GFP_IO allocations, that is acceptable. The actual problem is that rx_queue_mutex has a very large granularity, covering every unrelated netlink command execution at the same time as the error recovery path. The proposed fix leverages the recently added mechanism to stop failed connections from the kernel, by enabling it to execute even though a management command from the netlink socket is being run (rx_queue_mutex is held), provided that the command is known to be safe. It splits the rx_queue_mutex in two mutexes, one protecting from concurrent command execution from the netlink socket, and one protecting stop_conn from racing with other connection management operations that might conflict with it. It is not very pretty, but it is the simplest way to resolve the deadlock. I considered making it a lock per connection, but some external mutex would still be needed to deal with iscsi_if_destroy_conn. The patch was tested by forcing a memory shrinker (unrelated, but used bufio/dm-verity) to reclaim iSCSI pages every time ISCSI_UEVENT_CREATE_SESSION happens, which is reasonable to simulate reclaims that might happen with GFP_KERNEL on that path. Then, a faulty hung target causes a connection to fail during intensive IO, at the same time a new session is added by iscsid. The following stacktraces are stiches from several bug reports, showing a case where the deadlock can happen. iSCSI-write holding: rx_queue_mutex waiting: uevent_sock_mutex kobject_uevent_env+0x1bd/0x419 kobject_uevent+0xb/0xd device_add+0x48a/0x678 scsi_add_host_with_dma+0xc5/0x22d iscsi_host_add+0x53/0x55 iscsi_sw_tcp_session_create+0xa6/0x129 iscsi_if_rx+0x100/0x1247 netlink_unicast+0x213/0x4f0 netlink_sendmsg+0x230/0x3c0 iscsi_fail iscsi_conn_failure waiting: rx_queue_mutex schedule_preempt_disabled+0x325/0x734 __mutex_lock_slowpath+0x18b/0x230 mutex_lock+0x22/0x40 iscsi_conn_failure+0x42/0x149 worker_thread+0x24a/0xbc0 EventManager_ holding: uevent_sock_mutex waiting: dm_bufio_client->lock dm_bufio_lock+0xe/0x10 shrink+0x34/0xf7 shrink_slab+0x177/0x5d0 do_try_to_free_pages+0x129/0x470 try_to_free_mem_cgroup_pages+0x14f/0x210 memcg_kmem_newpage_charge+0xa6d/0x13b0 __alloc_pages_nodemask+0x4a3/0x1a70 fallback_alloc+0x1b2/0x36c __kmalloc_node_track_caller+0xb9/0x10d0 __alloc_skb+0x83/0x2f0 kobject_uevent_env+0x26b/0x419 dm_kobject_uevent+0x70/0x79 dev_suspend+0x1a9/0x1e7 ctl_ioctl+0x3e9/0x411 dm_ctl_ioctl+0x13/0x17 do_vfs_ioctl+0xb3/0x460 SyS_ioctl+0x5e/0x90 MemcgReclaimerD" holding: dm_bufio_client->lock waiting: stuck io to finish (needs iscsi_fail thread to progress) schedule at ffffffffbd603618 io_schedule at ffffffffbd603ba4 do_io_schedule at ffffffffbdaf0d94 __wait_on_bit at ffffffffbd6008a6 out_of_line_wait_on_bit at ffffffffbd600960 wait_on_bit.constprop.10 at ffffffffbdaf0f17 __make_buffer_clean at ffffffffbdaf18ba __cleanup_old_buffer at ffffffffbdaf192f shrink at ffffffffbdaf19fd do_shrink_slab at ffffffffbd6ec000 shrink_slab at ffffffffbd6ec24a do_try_to_free_pages at ffffffffbd6eda09 try_to_free_mem_cgroup_pages at ffffffffbd6ede7e mem_cgroup_resize_limit at ffffffffbd7024c0 mem_cgroup_write at ffffffffbd703149 cgroup_file_write at ffffffffbd6d9c6e sys_write at ffffffffbd6662ea system_call_fastpath at ffffffffbdbc34a2 Link: https://lore.kernel.org/r/20200520022959.1912856-1-krisman@collabora.com Reported-by: Khazhismel Kumykov Reviewed-by: Lee Duncan Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Martin K. Petersen commit 51dd905bd2f617f5d6e60273bb5f0940bbd86611 Author: Stanley Chu Date: Fri May 22 16:32:12 2020 +0800 scsi: ufs: Fix WriteBooster flush during runtime suspend Currently UFS host driver promises VCC supply if UFS device needs to do WriteBooster flush during runtime suspend. However the UFS specification mentions: "While the flushing operation is in progress, the device is in Active power mode." Therefore UFS host driver needs to promise more: Keep UFS device as "Active power mode", otherwise UFS device shall not do any flush if device enters Sleep or PowerDown power mode. Similarly, the same promises shall be applied if device needs urgent BKOP during runtime suspend. Fix this by not changing device power mode if WriteBooster flush or urgent BKOP is required in ufshcd_suspend(). Now, if device finishes its job but is not resumed for a very long time, system will have unnecessary power drain because VCC is still supplied. A method to re-check the threshold of keeping VCC supply is required to fix the power drain. However, the threshold re-check needs to re-activate the link first because the decision depends on the latest device status. Also introduce a delayed work to force runtime resume after a certain delay during runtime suspend. This makes threshold re-check happen natually in the entry of the next runtime-suspend. The device can continue its WriteBooster flush or urgent BKOP jobs soon after resumed if device has no upcoming requests and link enters hibern8 state either by Auto-Hibern8 or hibern8 during clk-gating scheme. This solution not only prevents power drain but also makes as much use of time as possible for device's background jobs. Link: https://lore.kernel.org/r/20200522083212.4008-5-stanley.chu@mediatek.com Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit e31011ab370989022abf216c606f947a3b02a53a Author: Stanley Chu Date: Fri May 22 16:32:11 2020 +0800 scsi: ufs: Fix index of attributes query for WriteBooster feature For WriteBooster feature related attributes, the index used by query shall be LUN ID if LU Dedicated buffer mode is enabled. Link: https://lore.kernel.org/r/20200522083212.4008-4-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit c7cee3e746a5b5a79d415112f7b7af90e8259fa1 Author: Stanley Chu Date: Fri May 22 16:32:10 2020 +0800 scsi: ufs: Allow WriteBooster on UFS 2.2 devices According to the UFS specification, WriteBooster is officially supported by UFS 2.2. Since UFS 2.2 specification has been finalized in JEDEC and such devices have also showed up in the market, modify the checking rule for ufshcd_wb_probe() to allow these devices to enable WriteBooster. Link: https://lore.kernel.org/r/20200522083212.4008-3-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 3a66ae512b09971410abf9f1d546944c07b852ec Author: Stanley Chu Date: Fri May 22 16:32:09 2020 +0800 scsi: ufs: Remove unnecessary memset for dev_info The whole UFS host instance has been zero-initialized by scsi_host_alloc(), thus UFS driver does not need to clear "dev_info" member specifically in ufshcd_device_params_init(). Simply remove the unnecessary code. Link: https://lore.kernel.org/r/20200522083212.4008-2-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 2ce7e495dab4647055f6cf300bc66870dc8a7cab Author: Tejas Patel Date: Thu Mar 12 14:31:39 2020 -0700 clk: zynqmp: Update fraction clock check from custom type flags Older firmware version sets BIT(13) in clkflag to mark a divider as fractional divider. Updated firmware version sets BIT(4) in type flags to mark a divider as fractional divider since BIT(13) is defined as CLK_DUTY_CYCLE_PARENT in the common clk framework flags. To support both old and new firmware version, consider BIT(13) from clkflag and BIT(4) from type_flag to check if divider is fractional or not. To maintain compatibility BIT(13) of clkflag in firmware will not be used in future for any purpose and will be marked as unused. Signed-off-by: Tejas Patel Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lkml.kernel.org/r/1584048699-24186-3-git-send-email-jolly.shah@xilinx.com Signed-off-by: Stephen Boyd commit e605fa9c4a0c1218e5604b42bef59de0a3a4f813 Author: Rajan Vaja Date: Thu Mar 12 14:31:38 2020 -0700 clk: zynqmp: Add support for custom type flags Store extra custom type flags received from firmware. Signed-off-by: Rajan Vaja Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lkml.kernel.org/r/1584048699-24186-2-git-send-email-jolly.shah@xilinx.com Signed-off-by: Stephen Boyd commit 58b0fb86260063f86afecaebf4056c876fff2a19 Author: Quanyang Wang Date: Mon Mar 2 13:50:43 2020 -0800 clk: zynqmp: fix memory leak in zynqmp_register_clocks This is detected by kmemleak running on zcu102 board: unreferenced object 0xffffffc877e48180 (size 128): comm "swapper/0", pid 1, jiffies 4294892909 (age 315.436s) hex dump (first 32 bytes): 64 70 5f 76 69 64 65 6f 5f 72 65 66 5f 64 69 76 dp_video_ref_div 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1............... backtrace: [<00000000c9be883b>] __kmalloc_track_caller+0x200/0x380 [<00000000f02c3809>] kvasprintf+0x7c/0x100 [<00000000e51dde4d>] kasprintf+0x60/0x80 [<0000000092298b05>] zynqmp_register_clocks+0x29c/0x398 [<00000000faaff182>] zynqmp_clock_probe+0x3cc/0x4c0 [<000000005f5986f0>] platform_drv_probe+0x58/0xa8 [<00000000d5810136>] really_probe+0xd8/0x2a8 [<00000000f5b671be>] driver_probe_device+0x5c/0x100 [<0000000038f91fcf>] __device_attach_driver+0x98/0xb8 [<000000008a3f2ac2>] bus_for_each_drv+0x74/0xd8 [<000000001cb2783d>] __device_attach+0xe0/0x140 [<00000000c268031b>] device_initial_probe+0x24/0x30 [<000000006998de4b>] bus_probe_device+0x9c/0xa8 [<00000000647ae6ff>] device_add+0x3c0/0x610 [<0000000071c14bb8>] of_device_add+0x40/0x50 [<000000004bb5d132>] of_platform_device_create_pdata+0xbc/0x138 This is because that when num_nodes is larger than 1, clk_out is allocated using kasprintf for these nodes but only the last node's clk_out is freed. Signed-off-by: Quanyang Wang Signed-off-by: Michal Simek Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lkml.kernel.org/r/1583185843-20707-5-git-send-email-jolly.shah@xilinx.com Signed-off-by: Stephen Boyd commit 5268aa1c561f64c5af0daaaee87425ef9ce210d3 Author: Rajan Vaja Date: Mon Mar 2 13:50:42 2020 -0800 clk: zynqmp: Fix invalid clock name queries The clock driver makes EEMI call to get the name of invalid clk when executing versal_get_clock_info() function. This results in error messages. Added check for validating clock before saving clock attribute and calling zynqmp_pm_clock_get_name() in versal_get_clock_info() function. Signed-off-by: Rajan Vaja Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lkml.kernel.org/r/1583185843-20707-4-git-send-email-jolly.shah@xilinx.com Signed-off-by: Stephen Boyd commit b8c1049c68d634a412ed5980ae666ed7c8839305 Author: Tejas Patel Date: Mon Mar 2 13:50:41 2020 -0800 clk: zynqmp: Fix divider2 calculation zynqmp_get_divider2_val() calculates, divider value of type DIV2 clock, considering best possible combination of DIV1 and DIV2. To find best possible values of DIV1 and DIV2, DIV1's parent rate should be consider and not DIV2's parent rate since it would rate of div1 clock. Consider a below topology, out_clk->div2_clk->div1_clk->fixed_parent where out_clk = (fixed_parent/div1_clk) / div2_clk, so parent clock of div1_clk (i.e. out_clk) should be divided by div1_clk and div2_clk. Existing code divides parent rate of div2_clk's clock instead of div1_clk's parent rate, which is wrong. Fix the same by considering div1's parent clock rate. Fixes: 4ebd92d2e228 ("clk: zynqmp: Fix divider calculation") Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lkml.kernel.org/r/1583185843-20707-3-git-send-email-jolly.shah@xilinx.com Signed-off-by: Stephen Boyd commit 0541e0217ac8daef32650ba8477ff0a55f9a94b1 Author: Rajan Vaja Date: Mon Mar 2 13:50:40 2020 -0800 clk: zynqmp: Limit bestdiv with maxdiv Clock divider value should not be greater than maximum divider value. So use minimum of best divider or maximum divider value. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lkml.kernel.org/r/1583185843-20707-2-git-send-email-jolly.shah@xilinx.com Signed-off-by: Stephen Boyd commit 3be60b564de49875e47974c37fabced893cd0931 Author: Jeffrey Hugo Date: Mon May 25 13:41:25 2020 -0700 scsi: ufs-qcom: Fix scheduling while atomic issue ufs_qcom_dump_dbg_regs() uses usleep_range, a sleeping function, but can be called from atomic context in the following flow: ufshcd_intr -> ufshcd_sl_intr -> ufshcd_check_errors -> ufshcd_print_host_regs -> ufshcd_vops_dbg_register_dump -> ufs_qcom_dump_dbg_regs This causes a boot crash on the Lenovo Miix 630 when the interrupt is handled on the idle thread. Fix the issue by switching to udelay(). Link: https://lore.kernel.org/r/20200525204125.46171-1-jeffrey.l.hugo@gmail.com Fixes: 9c46b8676271 ("scsi: ufs-qcom: dump additional testbus registers") Reviewed-by: Bean Huo Reviewed-by: Avri Altman Signed-off-by: Jeffrey Hugo Signed-off-by: Martin K. Petersen commit f56577e8c7d0f3054f97d1f0d1cbe9a4d179cc47 Author: Suganath Prabu S Date: Fri May 22 06:35:58 2020 -0400 scsi: mpt3sas: Fix reply queue count in non RDPQ mode For non RDPQ mode, the driver allocates a single contiguous block of memory pool for all reply descriptor post queues and passes down a single address in the ReplyDescriptorPostQueueAddress field of the IOC Init Request Message to the firmware. So reply_post queue will have only one entry which holds the address of this single contiguous block of memory pool. While allocating the reply descriptor post queue pool, driver should loop only once in non-RDPQ mode. But the driver is looping for ioc->reply_queue_count number of times even though reply_post queue's queue depth is only one in non-RDPQ mode. This leads to 'BUG: KASAN: use-after-free in base_alloc_rdpq_dma_pool'. The fix is to loop only once while allocating memory for the reply descriptor post queue in non-RDPQ mode Fixes: 8012209eb26b ("scsi: mpt3sas: Handle RDPQ DMA allocation in same 4G region") Link: https://lore.kernel.org/r/20200522103558.5710-1-suganath-prabu.subramani@broadcom.com Reported-by: Tomas Henzl Reviewed-by: Tomas Henzl Signed-off-by: Suganath Prabu S Signed-off-by: Martin K. Petersen commit 99a1ae29360980e79fa2d616819a6fe7411e4eda Author: Nathan Chancellor Date: Sat May 16 01:08:07 2020 -0700 clk: bcm2835: Remove casting to bcm2835_clk_register There are four different callback functions that are used for the clk_register callback that all have different second parameter types. bcm2835_register_pll -> struct bcm2835_pll_data bcm2835_register_pll_divider -> struct bcm2835_pll_divider_data bcm2835_register_clock -> struct bcm2835_clock_data bcm2835_register_date -> struct bcm2835_gate_data These callbacks are cast to bcm2835_clk_register so that there is no error about incompatible pointer types. Unfortunately, this is a control flow integrity violation, which verifies that the callback function's types match the prototypes exactly before jumping. [ 0.857913] CFI failure (target: 0xffffff9334a81820): [ 0.857977] WARNING: CPU: 3 PID: 35 at kernel/cfi.c:29 __cfi_check_fail+0x50/0x58 [ 0.857985] Modules linked in: [ 0.858007] CPU: 3 PID: 35 Comm: kworker/3:1 Not tainted 4.19.123-v8-01301-gdbb48f16956e4-dirty #1 [ 0.858015] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT) [ 0.858031] Workqueue: events 0xffffff9334a925c8 [ 0.858046] pstate: 60000005 (nZCv daif -PAN -UAO) [ 0.858058] pc : __cfi_check_fail+0x50/0x58 [ 0.858070] lr : __cfi_check_fail+0x50/0x58 [ 0.858078] sp : ffffff800814ba90 [ 0.858086] x29: ffffff800814ba90 x28: 000fffffffdfff3d [ 0.858101] x27: 00000000002000c2 x26: ffffff93355fdb18 [ 0.858116] x25: 0000000000000000 x24: ffffff9334a81820 [ 0.858131] x23: ffffff93357f3580 x22: ffffff9334af1000 [ 0.858146] x21: a79b57e88f8ebc81 x20: ffffff93357f3580 [ 0.858161] x19: ffffff9334a81820 x18: fffffff679769070 [ 0.858175] x17: 0000000000000000 x16: 0000000000000000 [ 0.858190] x15: 0000000000000004 x14: 000000000000003c [ 0.858205] x13: 0000000000003044 x12: 0000000000000000 [ 0.858220] x11: b57e91cd641bae00 x10: b57e91cd641bae00 [ 0.858235] x9 : b57e91cd641bae00 x8 : b57e91cd641bae00 [ 0.858250] x7 : 0000000000000000 x6 : ffffff933591d4e5 [ 0.858264] x5 : 0000000000000000 x4 : 0000000000000000 [ 0.858279] x3 : ffffff800814b718 x2 : ffffff9334a84818 [ 0.858293] x1 : ffffff9334bba66c x0 : 0000000000000029 [ 0.858308] Call trace: [ 0.858321] __cfi_check_fail+0x50/0x58 [ 0.858337] __cfi_check+0x3ab3c/0x4467c [ 0.858351] bcm2835_clk_probe+0x210/0x2dc [ 0.858369] platform_drv_probe+0xb0/0xfc [ 0.858380] really_probe+0x4a0/0x5a8 [ 0.858391] driver_probe_device+0x68/0x104 [ 0.858403] __device_attach_driver+0x100/0x148 [ 0.858418] bus_for_each_drv+0xb0/0x12c [ 0.858431] __device_attach.llvm.17225159516306086099+0xc0/0x168 [ 0.858443] bus_probe_device+0x44/0xfc [ 0.858455] deferred_probe_work_func+0xa0/0xe0 [ 0.858472] process_one_work+0x210/0x538 [ 0.858485] worker_thread+0x2e8/0x478 [ 0.858500] kthread+0x154/0x164 [ 0.858515] ret_from_fork+0x10/0x18 To fix this, change the second parameter of all functions void * and use a local variable with the correct type so that everything works properly. With this, the only use of bcm2835_clk_register is in struct bcm2835_clk_desc so we can just remove it and use the type directly. Fixes: 56eb3a2ed972 ("clk: bcm2835: remove use of BCM2835_CLOCK_COUNT in driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1028 Signed-off-by: Nathan Chancellor Link: https://lkml.kernel.org/r/20200516080806.1459784-2-natechancellor@gmail.com Signed-off-by: Stephen Boyd commit f376c43bec4f8ee8d1ba5c5c4cfbd6e84fb279cb Author: Nathan Chancellor Date: Sat May 16 01:08:06 2020 -0700 clk: bcm2835: Fix return type of bcm2835_register_gate bcm2835_register_gate is used as a callback for the clk_register member of bcm2835_clk_desc, which expects a struct clk_hw * return type but bcm2835_register_gate returns a struct clk *. This discrepancy is hidden by the fact that bcm2835_register_gate is cast to the typedef bcm2835_clk_register by the _REGISTER macro. This turns out to be a control flow integrity violation, which is how this was noticed. Change the return type of bcm2835_register_gate to be struct clk_hw * and use clk_hw_register_gate to do so. This should be a non-functional change as clk_register_gate calls clk_hw_register_gate anyways but this is needed to avoid issues with further changes. Fixes: b19f009d4510 ("clk: bcm2835: Migrate to clk_hw based registration and OF APIs") Link: https://github.com/ClangBuiltLinux/linux/issues/1028 Signed-off-by: Nathan Chancellor Link: https://lkml.kernel.org/r/20200516080806.1459784-1-natechancellor@gmail.com Signed-off-by: Stephen Boyd commit 6f88cc176a3358c54bb6c38c8afee3f3a42faf54 Author: Bijan Mottahedeh Date: Fri May 22 21:31:19 2020 -0700 statx: hide interfaces no longer used by io_uring The io_uring interfaces have been replaced by do_statx() and are no longer needed. Signed-off-by: Bijan Mottahedeh Signed-off-by: Jens Axboe commit e62753e4e2926f249d088cc0517be5ed4efec6d6 Author: Bijan Mottahedeh Date: Fri May 22 21:31:18 2020 -0700 io_uring: call statx directly Calling statx directly both simplifies the interface and avoids potential incompatibilities between sync and async invokations. Signed-off-by: Bijan Mottahedeh Signed-off-by: Jens Axboe commit 0018784fc84f636d473a0d2a65a34f9d01893c0a Author: Bijan Mottahedeh Date: Fri May 22 21:31:17 2020 -0700 statx: allow system call to be invoked from io_uring This is a prepatory patch to allow io_uring to invoke statx directly. Signed-off-by: Bijan Mottahedeh Signed-off-by: Jens Axboe commit 1d9e1288039a47dc1189c3c1fed5cf3c215e94b7 Author: Bijan Mottahedeh Date: Fri May 22 21:31:16 2020 -0700 io_uring: add io_statx structure Separate statx data from open in io_kiocb. No functional changes. Signed-off-by: Bijan Mottahedeh Signed-off-by: Jens Axboe commit 0e3481195b155da4b9b94ad4d64bbf531ce62d16 Merge: 90ce665c6a40 a021ada2b7a3 Author: David S. Miller Date: Tue May 26 15:33:57 2020 -0700 Merge branch 'net-phy-mscc-miim-reduce-waiting-time-between-MDIO-transactions' Antoine Tenart says: ==================== net: phy: mscc-miim: reduce waiting time between MDIO transactions This series aims at reducing the waiting time between MDIO transactions when using the MSCC MIIM MDIO controller. I'm not sure we need patch 4/4 and we could reasonably drop it from the series. I'm including the patch as it could help to ensure the system is functional with a non optimal configuration. We needed to improve the driver's performances as when using a PHY requiring lots of registers accesses (such as the VSC85xx family), delays would add up and ended up to be quite large which would cause issues such as: a slow initialization of the PHY, and issues when using timestamping operations (this feature will be sent quite soon to the mailing lists). ==================== Signed-off-by: David S. Miller commit a021ada2b7a3a79394ed2f476ec7615a184bb488 Author: Antoine Tenart Date: Tue May 26 18:22:56 2020 +0200 net: phy: mscc-miim: read poll when high resolution timers are disabled The driver uses a read polling mechanism to check the status of the MDIO bus, to know if it is ready to accept next commands. This polling mechanism uses usleep_delay() under the hood between reads which is fine as long as high resolution timers are enabled. Otherwise the delays will end up to be much longer than expected. This patch fixes this by using udelay() under the hood when CONFIG_HIGH_RES_TIMERS isn't enabled. This increases CPU usage. Signed-off-by: Antoine Tenart Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit d9c6de35e051c17474ec8a1fe2fdb8cd2b6f1a87 Author: Antoine Tenart Date: Tue May 26 18:22:55 2020 +0200 net: phy: mscc-miim: improve waiting logic The MSCC MIIM MDIO driver uses a waiting logic to wait for the MDIO bus to be ready to accept next commands. It does so by polling the BUSY status bit which indicates the MDIO bus has completed all pending operations. This can take time, and the controller supports writing the next command as soon as there are no pending commands (which happens while the MDIO bus is busy completing its current command). This patch implements this improved logic by adding an helper to poll the PENDING status bit, and by adjusting where we should wait for the bus to not be busy or to not be pending. Signed-off-by: Antoine Tenart Reviewed-by: Alexandre Belloni Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit f5112c8ae22f8d5796b10d9f5db0014b3546dd00 Author: Antoine Tenart Date: Tue May 26 18:22:54 2020 +0200 net: phy: mscc-miim: remove redundant timeout check readl_poll_timeout already returns -ETIMEDOUT if the condition isn't satisfied, there's no need to check again the condition after calling it. Remove the redundant timeout check. Signed-off-by: Antoine Tenart Reviewed-by: Alexandre Belloni Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 9513167e6c3343f4ec8e04eb89e9b130eb90e58a Author: Antoine Tenart Date: Tue May 26 18:22:53 2020 +0200 net: phy: mscc-miim: use more reasonable delays The MSCC MIIM MDIO driver uses delays to read poll a status register. I made multiple tests on a Ocelot PCS120 platform which led me to reduce those delays. The delay in between which the polling function is allowed to sleep is reduced from 100us to 50us which in almost all cases is a good value to succeed at the first retry. The overall delay is also lowered as the prior value was really way to high, 10000us is large enough. Signed-off-by: Antoine Tenart Reviewed-by: Alexandre Belloni Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 90ce665c6a40dc1be771bf5f86e624c0acf3a76f Author: Russell King Date: Tue May 26 16:29:36 2020 +0100 net: mdiobus: add clause 45 mdiobus accessors There is a recurring pattern throughout some of the PHY code converting a devad and regnum to our packed clause 45 representation. Rather than having this scattered around the code, let's put a common translation function in mdio.h, and provide some register accessors. Convert the phylib core, phylink, bcm87xx and cortina to use these. Signed-off-by: Russell King Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 8928e19ad8598ba2e93905a73f39121513ddf4cb Merge: fb8ddaa91539 61aec25a6db5 Author: David S. Miller Date: Tue May 26 15:22:58 2020 -0700 Merge branch 'flow-mpls' Guillaume Nault says: ==================== flow_dissector, cls_flower: Add support for multiple MPLS Label Stack Entries Currently, the flow dissector and the Flower classifier can only handle the first entry of an MPLS label stack. This patch series generalises the code to allow parsing and matching the Label Stack Entries that follow. Patch 1 extends the flow dissector to parse MPLS LSEs until the Bottom Of Stack bit is reached. The number of parsed LSEs is capped at FLOW_DIS_MPLS_MAX (arbitrarily set to 7). Flower and the NFP driver are updated to take into account the new layout of struct flow_dissector_key_mpls. Patch 2 extends Flower. It defines new netlink attributes, which are independent from the previous MPLS ones. Mixing the old and the new attributes in a same filter is not allowed. For backward compatibility, the old attributes are used when dumping filters that don't require the new ones. Changes since v2: * Fix compilation with the new MLX5 bareudp tunnel code. Changes since v1: * Fix compilation of NFP driver (kbuild test robot). * Fix sparse warning with entropy label (kbuild test robot). ==================== Signed-off-by: David S. Miller commit 61aec25a6db5d0c2e8ab5da6d2d152269d0d9d69 Author: Guillaume Nault Date: Tue May 26 14:29:04 2020 +0200 cls_flower: Support filtering on multiple MPLS Label Stack Entries With struct flow_dissector_key_mpls now recording the first FLOW_DIS_MPLS_MAX labels, we can extend Flower to filter on any of these LSEs independently. In order to avoid creating new netlink attributes for every possible depth, let's define a new TCA_FLOWER_KEY_MPLS_OPTS nested attribute that contains the list of LSEs to match. Each LSE is represented by another attribute, TCA_FLOWER_KEY_MPLS_OPTS_LSE, which then contains the attributes representing the depth and the MPLS fields to match at this depth (label, TTL, etc.). For each MPLS field, the mask is always set to all-ones, as this is what the original API did. We could allow user configurable masks in the future if there is demand for more flexibility. The new API also allows to only specify an LSE depth. In that case, Flower only verifies that the MPLS label stack depth is greater or equal to the provided depth (that is, an LSE exists at this depth). Filters that only match on one (or more) fields of the first LSE are dumped using the old netlink attributes, to avoid confusing user space programs that don't understand the new API. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 58cff782cc55eb755826c649976aea9f5f8b3086 Author: Guillaume Nault Date: Tue May 26 14:29:00 2020 +0200 flow_dissector: Parse multiple MPLS Label Stack Entries The current MPLS dissector only parses the first MPLS Label Stack Entry (second LSE can be parsed too, but only to set a key_id). This patch adds the possibility to parse several LSEs by making __skb_flow_dissect_mpls() return FLOW_DISSECT_RET_PROTO_AGAIN as long as the Bottom Of Stack bit hasn't been seen, up to a maximum of FLOW_DIS_MPLS_MAX entries. FLOW_DIS_MPLS_MAX is arbitrarily set to 7. This should be enough for many practical purposes, without wasting too much space. To record the parsed values, flow_dissector_key_mpls is modified to store an array of stack entries, instead of just the values of the first one. A bit field, "used_lses", is also added to keep track of the LSEs that have been set. The objective is to avoid defining a new FLOW_DISSECTOR_KEY_MPLS_XX for each level of the MPLS stack. TC flower is adapted for the new struct flow_dissector_key_mpls layout. Matching on several MPLS Label Stack Entries will be added in the next patch. The NFP and MLX5 drivers are also adapted: nfp_flower_compile_mac() and mlx5's parse_tunnel() now verify that the rule only uses the first LSE and fail if it doesn't. Finally, the behaviour of the FLOW_DISSECTOR_KEY_MPLS_ENTROPY key is slightly modified. Instead of recording the first Entropy Label, it now records the last one. This shouldn't have any consequences since there doesn't seem to have any user of FLOW_DISSECTOR_KEY_MPLS_ENTROPY in the tree. We'd probably better do a hash of all parsed MPLS labels instead (excluding reserved labels) anyway. That'd give better entropy and would probably also simplify the code. But that's not the purpose of this patch, so I'm keeping that as a future possible improvement. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit fb8ddaa915395c97f234340f465a4c424a7be090 Merge: 6a862a44fd0c 9ad346c90509 Author: David S. Miller Date: Tue May 26 15:19:29 2020 -0700 Merge tag 'batadv-next-for-davem-20200526' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - Fix revert dynamic lockdep key changes for batman-adv, by Sven Eckelmann - use rcu_replace_pointer() where appropriate, by Antonio Quartulli - Revert "disable ethtool link speed detection when auto negotiation off", by Sven Eckelmann ==================== Signed-off-by: David S. Miller commit 6a862a44fd0c963f1bcb2ac9299609e1d8c011c2 Merge: ff937b916eb6 0a3e060f340d Author: David S. Miller Date: Tue May 26 15:16:52 2020 -0700 Merge branch 'tipc-add-some-improvements' Tuong Lien says: ==================== tipc: add some improvements This series adds some improvements to TIPC. The first patch improves the TIPC broadcast's performance with the 'Gap ACK blocks' mechanism similar to unicast before, while the others give support on tracing & statistics for broadcast links, and an alternative to carry broadcast retransmissions via unicast which might be useful in some cases. Besides, the Nagle algorithm can now automatically 'adjust' itself depending on the specific network condition a stream connection runs by the last patch. ==================== Signed-off-by: David S. Miller commit 0a3e060f340dbe232ffa290c40f879b7f7db595b Author: Tuong Lien Date: Tue May 26 16:38:38 2020 +0700 tipc: add test for Nagle algorithm effectiveness When streaming in Nagle mode, we try to bundle small messages from user as many as possible if there is one outstanding buffer, i.e. not ACK-ed by the receiving side, which helps boost up the overall throughput. So, the algorithm's effectiveness really depends on when Nagle ACK comes or what the specific network latency (RTT) is, compared to the user's message sending rate. In a bad case, the user's sending rate is low or the network latency is small, there will not be many bundles, so making a Nagle ACK or waiting for it is not meaningful. For example: a user sends its messages every 100ms and the RTT is 50ms, then for each messages, we require one Nagle ACK but then there is only one user message sent without any bundles. In a better case, even if we have a few bundles (e.g. the RTT = 300ms), but now the user sends messages in medium size, then there will not be any difference at all, that says 3 x 1000-byte data messages if bundled will still result in 3 bundles with MTU = 1500. When Nagle is ineffective, the delay in user message sending is clearly wasted instead of sending directly. Besides, adding Nagle ACKs will consume some processor load on both the sending and receiving sides. This commit adds a test on the effectiveness of the Nagle algorithm for an individual connection in the network on which it actually runs. Particularly, upon receipt of a Nagle ACK we will compare the number of bundles in the backlog queue to the number of user messages which would be sent directly without Nagle. If the ratio is good (e.g. >= 2), Nagle mode will be kept for further message sending. Otherwise, we will leave Nagle and put a 'penalty' on the connection, so it will have to spend more 'one-way' messages before being able to re-enter Nagle. In addition, the 'ack-required' bit is only set when really needed that the number of Nagle ACKs will be reduced during Nagle mode. Testing with benchmark showed that with the patch, there was not much difference in throughput for small messages since the tool continuously sends messages without a break, so Nagle would still take in effect. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit 03b6fefd9bb4844c75faeb10df8496794e2fd5da Author: Tuong Lien Date: Tue May 26 16:38:37 2020 +0700 tipc: add support for broadcast rcv stats dumping This commit enables dumping the statistics of a broadcast-receiver link like the traditional 'broadcast-link' one (which is for broadcast- sender). The link dumping can be triggered via netlink (e.g. the iproute2/tipc tool) by the link flag - 'TIPC_NLA_LINK_BROADCAST' as the indicator. The name of a broadcast-receiver link of a specific peer will be in the format: 'broadcast-link:'. For example: Link Window:50 packets RX packets:7841 fragments:2408/440 bundles:0/0 TX packets:0 fragments:0/0 bundles:0/0 RX naks:0 defs:124 dups:0 TX naks:21 acks:0 retrans:0 Congestion link:0 Send queue max:0 avg:0 In addition, the broadcast-receiver link statistics can be reset in the usual way via netlink by specifying that link name in command. Note: the 'tipc_link_name_ext()' is removed because the link name can now be retrieved simply via the 'l->name'. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit a91d55d162b86fb983b88f44296149752db7efbd Author: Tuong Lien Date: Tue May 26 16:38:36 2020 +0700 tipc: enable broadcast retrans via unicast In some environment, broadcast traffic is suppressed at high rate (i.e. a kind of bandwidth limit setting). When it is applied, TIPC broadcast can still run successfully. However, when it comes to a high load, some packets will be dropped first and TIPC tries to retransmit them but the packet retransmission is intentionally broadcast too, so making things worse and not helpful at all. This commit enables the broadcast retransmission via unicast which only retransmits packets to the specific peer that has really reported a gap i.e. not broadcasting to all nodes in the cluster, so will prevent from being suppressed, and also reduce some overheads on the other peers due to duplicates, finally improve the overall TIPC broadcast performance. Note: the functionality can be turned on/off via the sysctl file: echo 1 > /proc/sys/net/tipc/bc_retruni echo 0 > /proc/sys/net/tipc/bc_retruni Default is '0', i.e. the broadcast retransmission still works as usual. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit c6ed7a5cc2d68c36287c09260dc211173e0447d7 Author: Tuong Lien Date: Tue May 26 16:38:35 2020 +0700 tipc: add back link trace events In the previous commit ("tipc: add Gap ACK blocks support for broadcast link"), we have removed the following link trace events due to the code changes: - tipc_link_bc_ack - tipc_link_retrans This commit adds them back along with some minor changes to adapt to the new code. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit d7626b5acff9227e2a65da636a53e09bdafdc0aa Author: Tuong Lien Date: Tue May 26 16:38:34 2020 +0700 tipc: introduce Gap ACK blocks for broadcast link As achieved through commit 9195948fbf34 ("tipc: improve TIPC throughput by Gap ACK blocks"), we apply the same mechanism for the broadcast link as well. The 'Gap ACK blocks' data field in a 'PROTOCOL/STATE_MSG' will consist of two parts built for both the broadcast and unicast types: 31 16 15 0 +-------------+-------------+-------------+-------------+ | bgack_cnt | ugack_cnt | len | +-------------+-------------+-------------+-------------+ - | gap | ack | | +-------------+-------------+-------------+-------------+ > bc gacks : : : | +-------------+-------------+-------------+-------------+ - | gap | ack | | +-------------+-------------+-------------+-------------+ > uc gacks : : : | +-------------+-------------+-------------+-------------+ - which is "automatically" backward-compatible. We also increase the max number of Gap ACK blocks to 128, allowing upto 64 blocks per type (total buffer size = 516 bytes). Besides, the 'tipc_link_advance_transmq()' function is refactored which is applicable for both the unicast and broadcast cases now, so some old functions can be removed and the code is optimized. With the patch, TIPC broadcast is more robust regardless of packet loss or disorder, latency, ... in the underlying network. Its performance is boost up significantly. For example, experiment with a 5% packet loss rate results: $ time tipc-pipe --mc --rdm --data_size 123 --data_num 1500000 real 0m 42.46s user 0m 1.16s sys 0m 17.67s Without the patch: $ time tipc-pipe --mc --rdm --data_size 123 --data_num 1500000 real 8m 27.94s user 0m 0.55s sys 0m 2.38s Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit ff937b916eb6316fe4644564a572ed3b5867bc1f Author: Yuval Basson Date: Tue May 26 09:41:20 2020 +0300 qed: Add EDPM mode type for user-fw compatibility In older FW versions the completion flag was treated as the ack flag in edpm messages. Expose the FW option of setting which mode the QP is in by adding a flag to the qedr <-> qed API. Flag is added for backward compatibility with libqedr. This flag will be set by qedr after determining whether the libqedr is using the updated version. Fixes: f10939403352 ("qed: Add support for QP verbs") Signed-off-by: Yuval Basson Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller commit 46d26819a5056f4831649c5887ad5c71a16d86f7 Author: Greg Kroah-Hartman Date: Sun May 24 17:30:40 2020 +0200 software node: implement software_node_unregister() Sometimes it is better to unregister individual nodes instead of trying to do them all at once with software_node_unregister_nodes(), so create software_node_unregister() so that you can unregister them one at a time. This is especially important when creating nodes in a hierarchy, with parent -> children representations. Children always need to be removed before a parent is, as the swnode logic assumes this is going to be the case. Fix up the lib/test_printf.c fwnode_pointer() test which to use this new function as it had the problem of tearing things down in the backwards order. Fixes: f1ce39df508d ("lib/test_printf: Add tests for %pfw printk modifier") Cc: stable Cc: Andy Shevchenko Cc: Brendan Higgins Cc: Dmitry Torokhov Cc: Petr Mladek Cc: Rafael J. Wysocki Cc: Rasmus Villemoes Cc: Sakari Ailus Cc: Sergey Senozhatsky Cc: Steven Rostedt Reported-by: Naresh Kamboju Reported-by: kernel test robot Reported-by: Randy Dunlap Tested-by: Petr Mladek Tested-by: Randy Dunlap Tested-by: Guenter Roeck Reviewed-by: Heikki Krogerus Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20200524153041.2361-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 239174945dac8cb9613db7755103d5fb6c32241d Author: Eric Dumazet Date: Mon May 25 20:15:24 2020 -0700 tcp: tcp_v4_err() icmp skb is named icmp_skb I missed the fact that tcp_v4_err() differs from tcp_v6_err(). After commit 4d1a2d9ec1c1 ("Rename skb to icmp_skb in tcp_v4_err()") the skb argument has been renamed to icmp_skb only in one function. I will in a future patch reconciliate these functions to avoid this kind of confusion. Fixes: 45af29ca761c ("tcp: allow traceroute -Mtcp for unpriv users") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 5484bb83efafd3fef7c2cd1a8a220a9ca06f7c2c Merge: 8f3d9f354286 b1657ad708f7 Author: Stephen Boyd Date: Tue May 26 15:00:43 2020 -0700 Merge tag 'clk-imx-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into clk-imx Pull i.MX clk driver updates from Shawn Guo: - A few patches from Abel Vesa as preparation of adding audiomix clock support - A couple of cleanups from Anson Huang on clk-sscg-pll and clk-pllv3 driver - Update imx7ulp clock driver to use imx_clk_hw_cpu() for making the change of ARM core clock easier - Drop dependency on ARM64 for i.MX8M clock driver, as there is a move to support aarch32 mode on aarch64 hardware - A series from Peng Fan to improve i.MX8M clock drivers, using composite clock for core and bus clk slice - Set a better parent clock for flexcan on i.MX6UL to support CiA102 defined bit rates * tag 'clk-imx-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice clk: imx: add imx8m_clk_hw_composite_bus clk: imx: add mux ops for i.MX8M composite clk clk: imx8m: migrate A53 clk root to use composite core clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code clk: imx8mp: Define gates for pll1/2 fixed dividers clk: imx: imx8mp: fix pll mux bit clk: imx8m: drop clk_hw_set_parent for A53 dt-bindings: clocks: imx8mp: Add ids for audiomix clocks clk: imx: Add helpers for passing the device as argument clk: imx: pll14xx: Add the device as argument when registering clk: imx: gate2: Allow single bit gating clock clk: imx: clk-pllv3: Use readl_relaxed_poll_timeout() for PLL lock wait clk: imx: clk-sscg-pll: Remove unnecessary blank lines clk: imx: drop the dependency on ARM64 for i.MX8M clk: imx7ulp: make it easy to change ARM core clk clk: imx: imx6ul: change flexcan clock to support CiA bitrates commit 263c61581a38d0a5ad1f5f4a9143b27d68caeffd Author: Jiri Kosina Date: Tue May 26 11:49:18 2020 +0200 block/floppy: fix contended case in floppy_queue_rq() Since the switch of floppy driver to blk-mq, the contended (fdc_busy) case in floppy_queue_rq() is not handled correctly. In case we reach floppy_queue_rq() with fdc_busy set (i.e. with the floppy locked due to another request still being in-flight), we put the request on the list of requests and return BLK_STS_OK to the block core, without actually scheduling delayed work / doing further processing of the request. This means that processing of this request is postponed until another request comes and passess uncontended. Which in some cases might actually never happen and we keep waiting indefinitely. The simple testcase is for i in `seq 1 2000`; do echo -en $i '\r'; blkid --info /dev/fd0 2> /dev/null; done run in quemu. That reliably causes blkid eventually indefinitely hanging in __floppy_read_block_0() waiting for completion, as the BIO callback never happens, and no further IO is ever submitted on the (non-existent) floppy device. This was observed reliably on qemu-emulated device. Fix that by not queuing the request in the contended case, and return BLK_STS_RESOURCE instead, so that blk core handles the request rescheduling and let it pass properly non-contended later. Fixes: a9f38e1dec107a ("floppy: convert to blk-mq") Cc: stable@vger.kernel.org Tested-by: Libor Pechacek Signed-off-by: Jiri Kosina Signed-off-by: Jens Axboe commit 7217e6e694da3aae6d17db8a7f7460c8d4817ebf Author: Xiyu Yang Date: Mon May 25 22:16:24 2020 +0800 scsi: lpfc: Fix lpfc_nodelist leak when processing unsolicited event In order to create or activate a new node, lpfc_els_unsol_buffer() invokes lpfc_nlp_init() or lpfc_enable_node() or lpfc_nlp_get(), all of them will return a reference of the specified lpfc_nodelist object to "ndlp" with increased refcnt. When lpfc_els_unsol_buffer() returns, local variable "ndlp" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of lpfc_els_unsol_buffer(). When "ndlp" in DEV_LOSS, the function forgets to decrease the refcnt increased by lpfc_nlp_init() or lpfc_enable_node() or lpfc_nlp_get(), causing a refcnt leak. Fix this issue by calling lpfc_nlp_put() when "ndlp" in DEV_LOSS. Link: https://lore.kernel.org/r/1590416184-52592-1-git-send-email-xiyuyang19@fudan.edu.cn Reviewed-by: Daniel Wagner Reviewed-by: James Smart Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: Martin K. Petersen commit 9d7464b18892332e35ff37f0b024429a1a9835e6 Author: Dan Carpenter Date: Sat May 23 13:11:29 2020 +0300 scsi: target: tcmu: Fix a use after free in tcmu_check_expired_queue_cmd() The pr_debug() dereferences "cmd" after we already freed it by calling tcmu_free_cmd(cmd). The debug printk needs to be done earlier. Link: https://lore.kernel.org/r/20200523101129.GB98132@mwanda Fixes: 61fb24822166 ("scsi: target: tcmu: Userspace must not complete queued commands") Reviewed-by: Mike Christie Reviewed-by: David Disseldorp Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 5ae6a6a915033bfee79e76e0c374d4f927909edc Author: Sudhakar Panneerselvam Date: Fri May 22 16:51:57 2020 +0000 scsi: vhost: Notify TCM about the maximum sg entries supported per command vhost-scsi pre-allocates the maximum sg entries per command and if a command requires more than VHOST_SCSI_PREALLOC_SGLS entries, then that command is failed by it. This patch lets vhost communicate the max sg limit when it registers vhost_scsi_ops with TCM. With this change, TCM would report the max sg entries through "Block Limits" VPD page which will be typically queried by the SCSI initiator during device discovery. By knowing this limit, the initiator could ensure the maximum transfer length is less than or equal to what is reported by vhost-scsi. Link: https://lore.kernel.org/r/1590166317-953-1-git-send-email-sudhakar.panneerselvam@oracle.com Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Reviewed-by: Mike Christie Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Martin K. Petersen commit ba02fd6b1ce5536ad8d052468166dd9eb083c2b9 Author: Kevin Wang Date: Fri May 22 22:06:17 2020 +0800 drm/amdgpu: fix device attribute node create failed with multi gpu the origin design will use varible of "attr->states" to save node supported states on current gpu device, but for multi gpu device, when probe second gpu device, the driver will check attribute node states from previous gpu device wthether to create attribute node. it will cause other gpu device create attribute node faild. 1. add member attr_list into amdgpu_device to link supported device attribute node. 2. add new structure "struct amdgpu_device_attr_entry{}" to track device attribute state. 3. drop member "states" from amdgpu_device_attr. v2: 1. move "attr_list" into amdgpu_pm and rename to "pm_attr_list". 2. refine create & remove device node functions parameter. fix: drm/amdgpu: optimize amdgpu device attribute code Signed-off-by: Kevin Wang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ac988c49367a52b466285239361ede0f74c672da Author: Daniel Wagner Date: Wed May 20 15:08:19 2020 +0200 scsi: qla2xxx: Remove return value from qla_nvme_ls() The function always returns QLA_SUCCESS and the caller qla2x00_start_sp() doesn't even evalute the return value. So there is no point in returning a status. Link: https://lore.kernel.org/r/20200520130819.90625-1-dwagner@suse.de Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Signed-off-by: Daniel Wagner Signed-off-by: Martin K. Petersen commit ce9a9321c11817e54ab36d75c2fab62537fcc993 Author: Bart Van Assche Date: Tue May 19 21:07:38 2020 -0700 scsi: qla2xxx: Remove an unused function This was detected by building the qla2xxx driver with clang. See also commit a9083016a531 ("[SCSI] qla2xxx: Add ISP82XX support"). Link: https://lore.kernel.org/r/20200520040738.1017-1-bvanassche@acm.org Cc: Arun Easi Cc: Nilesh Javali Cc: Himanshu Madhani Cc: Hannes Reinecke Cc: Daniel Wagner Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Reviewed-by: Daniel Wagner Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 09cda9a71350e61d8803058470697b95f3d3b4cb Author: Zenghui Yu Date: Sat May 9 17:34:30 2020 +0800 ACPI/IORT: Remove the unused __get_pci_rid() Since commit bc8648d49a95 ("ACPI/IORT: Handle PCI aliases properly for IOMMUs"), __get_pci_rid() has become actually unused and can be removed. Signed-off-by: Zenghui Yu Acked-by: Lorenzo Pieralisi Acked-by: Hanjun Guo Link: https://lore.kernel.org/r/20200509093430.1983-1-yuzenghui@huawei.com Signed-off-by: Will Deacon commit 3ce419662dd4c9cf8db7869c4972ad51ccdf2ee3 Author: Bob Liu Date: Tue May 5 09:19:08 2020 +0800 scsi: iscsi: Register sysfs for iscsi workqueue This patch enables setting cpu affinity through "cpumask" for iscsi workqueues (iscsi_q_xx and iscsi_eh), so as to get performance isolation. The max number of active worker was changed form 1 to 2, because "cpumask" of ordered workqueue isn't allowed to change. Link: https://lore.kernel.org/r/20200505011908.15538-1-bob.liu@oracle.com Reviewed-by: Lee Duncan Signed-off-by: Bob Liu Signed-off-by: Martin K. Petersen commit 08f25cd767e1086266453fb2f4a3ded05b9cc8a7 Author: Miquel Raynal Date: Tue May 19 14:59:34 2020 +0200 mtd: rawnand: ams-delta: Stop using nand_release() This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-2-miquel.raynal@bootlin.com commit 88ffef1b65cf989b2dfea6374caff804fca6ec32 Author: Miquel Raynal Date: Tue May 19 09:45:49 2020 +0200 mtd: rawnand: arasan: Support the hardware BCH ECC engine Add support for the hardware ECC BCH engine. Please mind that this engine has an important limitation: BCH implementation does not inform the user when an uncorrectable ECC error occurs. To workaround this, we avoid using the hardware engine in the read path and do the computation with the software BCH implementation, which is faster than mixing hardware (for correction) and software (for verification). Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-9-miquel.raynal@bootlin.com commit 0bf0eefdab52d9f9f3a1eeda32a4fc7afe4e9219 Author: Pavel Begunkov Date: Tue May 26 20:34:06 2020 +0300 io_uring: get rid of manual punting in io_close io_close() was punting async manually to skip grabbing files. Use REQ_F_NO_FILE_TABLE instead, and pass it through the generic path with -EAGAIN. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 0451894522108d6c72934aff6ef89023743a9ed4 Author: Pavel Begunkov Date: Tue May 26 20:34:05 2020 +0300 io_uring: separate DRAIN flushing into a cold path io_commit_cqring() assembly doesn't look good with extra code handling drained requests. IOSQE_IO_DRAIN is slow and discouraged to be used in a hot path, so try to minimise its impact by putting it into a helper and doing a fast check. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 56080b02ed6e71fbc0add2d05a32ed7361dd736a Author: Pavel Begunkov Date: Tue May 26 20:34:04 2020 +0300 io_uring: don't re-read sqe->off in timeout_prep() SQEs are user writable, don't read sqe->off twice in io_timeout_prep() Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 733f5c95e6fdabd05b8dfc15e04512809c9652c2 Author: Pavel Begunkov Date: Tue May 26 20:34:03 2020 +0300 io_uring: simplify io_timeout locking Move spin_lock_irq() earlier to have only 1 call site of it in io_timeout(). It makes the flow easier. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 4518a3cc273cf82efdd36522fb1f13baad173c70 Author: Pavel Begunkov Date: Tue May 26 20:34:02 2020 +0300 io_uring: fix flush req->refs underflow In io_uring_cancel_files(), after refcount_sub_and_test() leaves 0 req->refs, it calls io_put_req(), which would also put a ref. Call io_free_req() instead. Cc: stable@vger.kernel.org Fixes: 2ca10259b418 ("io_uring: prune request from overflow list on flush") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 6b6ebb34744b21467aa01be7c53cc570fc41f70d Author: Zefan Li Date: Wed May 13 10:13:11 2020 +0800 cgroup: Remove stale comments - The default root is where we can create v2 cgroups. - The __DEVEL__sane_behavior mount option has been removed long long ago. Signed-off-by: Li Zefan Signed-off-by: Tejun Heo commit 07325d4a90d2d84de45cc07b134fd0f023dbb971 Author: Thomas Gleixner Date: Thu May 21 22:05:16 2020 +0200 rcu: Provide rcu_irq_exit_check_preempt() Provide a debug check which can be invoked from exception return to kernel mode before an attempt is made to schedule. Warn if RCU is not ready for this. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Cc: Paul E. McKenney Link: https://lore.kernel.org/r/20200521202117.089709607@linutronix.de commit aaf2bc50df1f4bfc6857fc601fc7b21d5a18c6a1 Author: Paul E. McKenney Date: Thu May 21 22:05:15 2020 +0200 rcu: Abstract out rcu_irq_enter_check_tick() from rcu_nmi_enter() There will likely be exception handlers that can sleep, which rules out the usual approach of invoking rcu_nmi_enter() on entry and also rcu_nmi_exit() on all exit paths. However, the alternative approach of just not calling anything can prevent RCU from coaxing quiescent states from nohz_full CPUs that are looping in the kernel: RCU must instead IPI them explicitly. It would be better to enable the scheduler tick on such CPUs to interact with RCU in a lighter-weight manner, and this enabling is one of the things that rcu_nmi_enter() currently does. What is needed is something that helps RCU coax quiescent states while not preventing subsequent sleeps. This commit therefore splits out the nohz_full scheduler-tick enabling from the rest of the rcu_nmi_enter() logic into a new function named rcu_irq_enter_check_tick(). [ tglx: Renamed the function and made it a nop when context tracking is off ] [ mingo: Fixed a CONFIG_NO_HZ_FULL assumption, harmonized and fixed all the comment blocks and cleaned up rcu_nmi_enter()/exit() definitions. ] Suggested-by: Andy Lutomirski Signed-off-by: Paul E. McKenney Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200521202116.996113173@linutronix.de commit 8d728808194a12186ce5af0b72c8a47b42476bc3 Author: Dinghao Liu Date: Sat May 23 21:38:59 2020 +0800 spi: spi-fsl-lpspi: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200523133859.5625-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit c373643b8688836c1627a805875994fe0012fc17 Author: Mark Brown Date: Mon May 25 14:31:20 2020 +0100 spi: Remove note about transfer limit for spi_write_then_read() Originally spi_write_then_read() used a fixed statically allocated buffer which limited the maximum message size it could handle. This restriction was removed a while ago so that we could dynamically allocate a buffer if required but the kerneldoc was not updated to reflect this, do so. Reported-by: Marc Kleine-Budde Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200525133120.57273-1-broonie@kernel.org Signed-off-by: Mark Brown commit cd34b82e6ef09aaf789eb9c040e3d0f92d28c969 Merge: 9cb1fd0efd19 abafbc551fdd bc138db1b962 1518ac272e78 Author: Alex Williamson Date: Tue May 26 10:27:15 2020 -0600 Merge branches 'v5.8/vfio/alex-block-mmio-v3', 'v5.8/vfio/alex-zero-cap-v2' and 'v5.8/vfio/qian-leak-fixes' into v5.8/vfio/next commit 1518ac272e789cae8c555d69951b032a275b7602 Author: Qian Cai Date: Mon May 11 00:34:50 2020 -0400 vfio/pci: fix memory leaks of eventfd ctx Finished a qemu-kvm (-device vfio-pci,host=0001:01:00.0) triggers a few memory leaks after a while because vfio_pci_set_ctx_trigger_single() calls eventfd_ctx_fdget() without the matching eventfd_ctx_put() later. Fix it by calling eventfd_ctx_put() for those memory in vfio_pci_release() before vfio_device_release(). unreferenced object 0xebff008981cc2b00 (size 128): comm "qemu-kvm", pid 4043, jiffies 4294994816 (age 9796.310s) hex dump (first 32 bytes): 01 00 00 00 6b 6b 6b 6b 00 00 00 00 ad 4e ad de ....kkkk.....N.. ff ff ff ff 6b 6b 6b 6b ff ff ff ff ff ff ff ff ....kkkk........ backtrace: [<00000000917e8f8d>] slab_post_alloc_hook+0x74/0x9c [<00000000df0f2aa2>] kmem_cache_alloc_trace+0x2b4/0x3d4 [<000000005fcec025>] do_eventfd+0x54/0x1ac [<0000000082791a69>] __arm64_sys_eventfd2+0x34/0x44 [<00000000b819758c>] do_el0_svc+0x128/0x1dc [<00000000b244e810>] el0_sync_handler+0xd0/0x268 [<00000000d495ef94>] el0_sync+0x164/0x180 unreferenced object 0x29ff008981cc4180 (size 128): comm "qemu-kvm", pid 4043, jiffies 4294994818 (age 9796.290s) hex dump (first 32 bytes): 01 00 00 00 6b 6b 6b 6b 00 00 00 00 ad 4e ad de ....kkkk.....N.. ff ff ff ff 6b 6b 6b 6b ff ff ff ff ff ff ff ff ....kkkk........ backtrace: [<00000000917e8f8d>] slab_post_alloc_hook+0x74/0x9c [<00000000df0f2aa2>] kmem_cache_alloc_trace+0x2b4/0x3d4 [<000000005fcec025>] do_eventfd+0x54/0x1ac [<0000000082791a69>] __arm64_sys_eventfd2+0x34/0x44 [<00000000b819758c>] do_el0_svc+0x128/0x1dc [<00000000b244e810>] el0_sync_handler+0xd0/0x268 [<00000000d495ef94>] el0_sync+0x164/0x180 Signed-off-by: Qian Cai Signed-off-by: Alex Williamson commit 0d71a5cf691a8226151ceeb79fb872925f053df5 Author: Dinghao Liu Date: Mon May 25 15:17:30 2020 +0800 ASoC: tas2552: Fix runtime PM imbalance in tas2552_component_probe pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200525071732.5887-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit 25bf943e4e7b47282bd86ae7d39e039217ebb007 Author: Qiushi Wu Date: Mon May 25 00:50:11 2020 -0500 ASoC: fix incomplete error-handling in img_i2s_in_probe. Function "pm_runtime_get_sync()" is not handled by "pm_runtime_put()" if "PTR_ERR(rst) == -EPROBE_DEFER". Fix this issue by adding "pm_runtime_put()" into this error path. Fixes: f65bb92ca12e ("ASoC: img-i2s-in: Add runtime PM") Signed-off-by: Qiushi Wu Link: https://lore.kernel.org/r/20200525055011.31925-1-wu000273@umn.edu Signed-off-by: Mark Brown commit c553d290577093553098a56c954e516950c35c59 Author: Dinghao Liu Date: Mon May 25 16:58:48 2020 +0800 ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src When clk_set_parent() returns an error code, a pairing runtime PM usage counter increment is needed to keep the counter balanced. Signed-off-by: Dinghao Liu Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200525085848.4227-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit fd52a75ca3545c965ff58a78b6ff0b0dc7d8d228 Author: YueHaibing Date: Fri May 8 22:08:08 2020 +0800 x86/io_apic: Remove unused function mp_init_irq_at_boot() There are no callers in-tree anymore since ef9e56d894ea ("x86/ioapic: Remove obsolete post hotplug update") so remove it. Signed-off-by: YueHaibing Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200508140808.49428-1-yuehaibing@huawei.com commit 65e318e17358a3fd4fcb5a69d89b14016dee2f06 Author: Lukas Wunner Date: Mon May 25 14:25:03 2020 +0200 spi: pxa2xx: Fix runtime PM ref imbalance on probe error The PXA2xx SPI driver releases a runtime PM ref in the probe error path even though it hasn't acquired a ref earlier. Apparently commit e2b714afee32 ("spi: pxa2xx: Disable runtime PM if controller registration fails") sought to copy-paste the invocation of pm_runtime_disable() from pxa2xx_spi_remove(), but erroneously copied the call to pm_runtime_put_noidle() as well. Drop it. Fixes: e2b714afee32 ("spi: pxa2xx: Disable runtime PM if controller registration fails") Signed-off-by: Lukas Wunner Reviewed-by: Jarkko Nikula Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v4.17+ Cc: Jarkko Nikula Link: https://lore.kernel.org/r/58b2ac6942ca1f91aaeeafe512144bc5343e1d84.1590408496.git.lukas@wunner.de Signed-off-by: Mark Brown commit 32e5b57232c0411e7dea96625c415510430ac079 Author: Lukas Wunner Date: Mon May 25 14:25:02 2020 +0200 spi: pxa2xx: Fix controller unregister order The PXA2xx SPI driver uses devm_spi_register_controller() on bind. As a consequence, on unbind, __device_release_driver() first invokes pxa2xx_spi_remove() before unregistering the SPI controller via devres_release_all(). This order is incorrect: pxa2xx_spi_remove() disables the chip, rendering the SPI bus inaccessible even though the SPI controller is still registered. When the SPI controller is subsequently unregistered, it unbinds all its slave devices. Because their drivers cannot access the SPI bus, e.g. to quiesce interrupts, the slave devices may be left in an improper state. As a rule, devm_spi_register_controller() must not be used if the ->remove() hook performs teardown steps which shall be performed after unregistering the controller and specifically after unbinding of slaves. Fix by reverting to the non-devm variant of spi_register_controller(). An alternative approach would be to use device-managed functions for all steps in pxa2xx_spi_remove(), e.g. by calling devm_add_action_or_reset() on probe. However that approach would add more LoC to the driver and it wouldn't lend itself as well to backporting to stable. The improper use of devm_spi_register_controller() was introduced in 2013 by commit a807fcd090d6 ("spi: pxa2xx: use devm_spi_register_master()"), but all earlier versions of the driver going back to 2006 were likewise broken because they invoked spi_unregister_master() at the end of pxa2xx_spi_remove(), rather than at the beginning. Fixes: e0c9905e87ac ("[PATCH] SPI: add PXA2xx SSP SPI Driver") Signed-off-by: Lukas Wunner Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v2.6.17+ Cc: Tsuchiya Yuto Link: https://bugzilla.kernel.org/show_bug.cgi?id=206403#c1 Link: https://lore.kernel.org/r/834c446b1cf3284d2660f1bee1ebe3e737cd02a9.1590408496.git.lukas@wunner.de Signed-off-by: Mark Brown commit ca8b19d61e3fce5d2d7790cde27a0b57bcb3f341 Author: Lukas Wunner Date: Mon May 25 14:25:01 2020 +0200 spi: dw: Fix controller unregister order The Designware SPI driver uses devm_spi_register_controller() on bind. As a consequence, on unbind, __device_release_driver() first invokes dw_spi_remove_host() before unregistering the SPI controller via devres_release_all(). This order is incorrect: dw_spi_remove_host() shuts down the chip, rendering the SPI bus inaccessible even though the SPI controller is still registered. When the SPI controller is subsequently unregistered, it unbinds all its slave devices. Because their drivers cannot access the SPI bus, e.g. to quiesce interrupts, the slave devices may be left in an improper state. As a rule, devm_spi_register_controller() must not be used if the ->remove() hook performs teardown steps which shall be performed after unregistering the controller and specifically after unbinding of slaves. Fix by reverting to the non-devm variant of spi_register_controller(). An alternative approach would be to use device-managed functions for all steps in dw_spi_remove_host(), e.g. by calling devm_add_action_or_reset() on probe. However that approach would add more LoC to the driver and it wouldn't lend itself as well to backporting to stable. Fixes: 04f421e7b0b1 ("spi: dw: use managed resources") Signed-off-by: Lukas Wunner Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v3.14+ Cc: Baruch Siach Link: https://lore.kernel.org/r/3fff8cb8ae44a9893840d0688be15bb88c090a14.1590408496.git.lukas@wunner.de Signed-off-by: Mark Brown commit a101950fcb78b0ba20cd487be6627dea58d55c2b Author: Cédric Le Goater Date: Wed Apr 29 09:51:20 2020 +0200 powerpc/xive: Clear the page tables for the ESB IO mapping Commit 1ca3dec2b2df ("powerpc/xive: Prevent page fault issues in the machine crash handler") fixed an issue in the FW assisted dump of machines using hash MMU and the XIVE interrupt mode under the POWER hypervisor. It forced the mapping of the ESB page of interrupts being mapped in the Linux IRQ number space to make sure the 'crash kexec' sequence worked during such an event. But it didn't handle the un-mapping. This mapping is now blocking the removal of a passthrough IO adapter under the POWER hypervisor because it expects the guest OS to have cleared all page table entries related to the adapter. If some are still present, the RTAS call which isolates the PCI slot returns error 9001 "valid outstanding translations". Remove these mapping in the IRQ data cleanup routine. Under KVM, this cleanup is not required because the ESB pages for the adapter interrupts are un-mapped from the guest by the hypervisor in the KVM XIVE native device. This is now redundant but it's harmless. Fixes: 1ca3dec2b2df ("powerpc/xive: Prevent page fault issues in the machine crash handler") Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429075122.1216388-2-clg@kaod.org commit 16ef9767e4dc5cf03a71ae7bc2bc588dbbe7983e Author: Michael Ellerman Date: Tue May 26 17:26:30 2020 +1000 powerpc: Add ppc_inst_as_u64() The code patching code wants to get the value of a struct ppc_inst as a u64 when the instruction is prefixed, so we can pass the u64 down to __put_user_asm() and write it with a single store. The optprobes code wants to load a struct ppc_inst as an immediate into a register so it is useful to have it as a u64 to use the existing helper function. Currently this is a bit awkward because the value differs based on the CPU endianness, so add a helper to do the conversion. This fixes the usage in arch_prepare_optimized_kprobe() which was previously incorrect on big endian. Fixes: 650b55b707fd ("powerpc: Add prefixed instructions to instruction data type") Signed-off-by: Michael Ellerman Tested-by: Jordan Niethe Link: https://lore.kernel.org/r/20200526072630.2487363-1-mpe@ellerman.id.au commit c5ff46d69c410f7fac173e4fde3eea484b4b4eda Author: Michael Ellerman Date: Fri May 22 23:33:18 2020 +1000 powerpc: Add ppc_inst_next() In a few places we want to calculate the address of the next instruction. Previously that was simple, we just added 4 bytes, or if using a u32 * we incremented that pointer by 1. But prefixed instructions make it more complicated, we need to advance by either 4 or 8 bytes depending on the actual instruction. We also can't do pointer arithmetic using struct ppc_inst, because it is always 8 bytes in size on 64-bit, even though we might only need to advance by 4 bytes. So add a ppc_inst_next() helper which calculates the location of the next instruction, if the given instruction was located at the given address. Note the instruction doesn't need to actually be at the address in memory. Although it would seem natural for the value to be passed by value, that makes it too easy to write a loop that will read off the end of a page, eg: for (; src < end; src = ppc_inst_next(src, *src), dest = ppc_inst_next(dest, *dest)) As noticed by Christophe and Jordan, if end is the exact end of a page, and the next page is not mapped, this will fault, because *dest will read 8 bytes, 4 bytes into the next page. So value is passed by reference, so the helper can be careful to use ppc_inst_read() on it. Signed-off-by: Michael Ellerman Reviewed-by: Jordan Niethe Link: https://lore.kernel.org/r/20200522133318.1681406-1-mpe@ellerman.id.au commit baddc87d6824cda18037881352fe97382fdb0867 Merge: bb5f33c06940 595d153dd102 Author: Michael Ellerman Date: Tue May 26 22:56:03 2020 +1000 Merge branch 'fixes' into next Merge our fixes branch from this cycle. It contains several important fixes we need in next for testing purposes, and also some that will conflict with upcoming changes. commit bb5f33c069402035a3d6a2091ee68cac6999d774 Merge: 82a1b8ed5604 7974c4732642 Author: Michael Ellerman Date: Tue May 26 22:54:27 2020 +1000 Merge "Use hugepages to map kernel mem on 8xx" into next Merge Christophe's large series to use huge pages for the linear mapping on 8xx. From his cover letter: The main purpose of this big series is to: - reorganise huge page handling to avoid using mm_slices. - use huge pages to map kernel memory on the 8xx. The 8xx supports 4 page sizes: 4k, 16k, 512k and 8M. It uses 2 Level page tables, PGD having 1024 entries, each entry covering 4M address space. Then each page table has 1024 entries. At the time being, page sizes are managed in PGD entries, implying the use of mm_slices as it can't mix several pages of the same size in one page table. The first purpose of this series is to reorganise things so that standard page tables can also handle 512k pages. This is done by adding a new _PAGE_HUGE flag which will be copied into the Level 1 entry in the TLB miss handler. That done, we have 2 types of pages: - PGD entries to regular page tables handling 4k/16k and 512k pages - PGD entries to hugepd tables handling 8M pages. There is no need to mix 8M pages with other sizes, because a 8M page will use more than what a single PGD covers. Then comes the second purpose of this series. At the time being, the 8xx has implemented special handling in the TLB miss handlers in order to transparently map kernel linear address space and the IMMR using huge pages by building the TLB entries in assembly at the time of the exception. As mm_slices is only for user space pages, and also because it would anyway not be convenient to slice kernel address space, it was not possible to use huge pages for kernel address space. But after step one of the series, it is now more flexible to use huge pages. This series drop all assembly 'just in time' handling of huge pages and use huge pages in page tables instead. Once the above is done, then comes icing on the cake: - Use huge pages for KASAN shadow mapping - Allow pinned TLBs with strict kernel rwx - Allow pinned TLBs with debug pagealloc Then, last but not least, those modifications for the 8xx allows the following improvement on book3s/32: - Mapping KASAN shadow with BATs - Allowing BATs with debug pagealloc All this allows to considerably simplify TLB miss handlers and associated initialisation. The overhead of reading page tables is negligible compared to the reduction of the miss handlers. While we were at touching pte_update(), some cleanup was done there too. Tested widely on 8xx and 832x. Boot tested on QEMU MAC99. commit 7974c4732642f710b5111165ae1f7f7fed822282 Author: Christophe Leroy Date: Tue May 19 05:49:29 2020 +0000 powerpc/32s: Implement dedicated kasan_init_region() Implement a kasan_init_region() dedicated to book3s/32 that allocates KASAN regions using BATs. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/709e821602b48a1d7c211a9b156da26db98c3e9d.1589866984.git.christophe.leroy@csgroup.eu commit 2b279c0348af62f42be346c1ea6d70bac98df0f9 Author: Christophe Leroy Date: Tue May 19 05:49:28 2020 +0000 powerpc/32s: Allow mapping with BATs with DEBUG_PAGEALLOC DEBUG_PAGEALLOC only manages RW data. Text and RO data can still be mapped with BATs. In order to map with BATs, also enforce data alignment. Set by default to 256M which is a good compromise for keeping enough BATs for also KASAN and IMMR. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fd29c1718ee44d82115d0e835ced808eb4ccbf51.1589866984.git.christophe.leroy@csgroup.eu commit a2feeb2c2ecbd9c9206d66f238ca710b760c9ef5 Author: Christophe Leroy Date: Tue May 19 05:49:27 2020 +0000 powerpc/8xx: Implement dedicated kasan_init_region() Implement a kasan_init_region() dedicated to 8xx that allocates KASAN regions using huge pages. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d2d60202a8821dc81cffe6ff59cc13c15b7e4bb6.1589866984.git.christophe.leroy@csgroup.eu commit fcdafd10a363cf3278ce29c6c9a92930380c6cd8 Author: Christophe Leroy Date: Tue May 19 05:49:26 2020 +0000 powerpc/8xx: Allow large TLBs with DEBUG_PAGEALLOC DEBUG_PAGEALLOC only manages RW data. Text and RO data can still be mapped with hugepages and pinned TLB. In order to map with hugepages, also enforce a 512kB data alignment minimum. That's a trade-off between size of speed, taking into account that DEBUG_PAGEALLOC is a debug option. Anyway the alignment is still tunable. We also allow tuning of alignment for book3s to limit the complexity of the test in Kconfig that will anyway disappear in the following patches once DEBUG_PAGEALLOC is handled together with BATs. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c13256f2d356a316715da61fe089b3623ef217a5.1589866984.git.christophe.leroy@csgroup.eu commit da1adea07576722da4597b0df7d00931f0203229 Author: Christophe Leroy Date: Tue May 19 05:49:25 2020 +0000 powerpc/8xx: Allow STRICT_KERNEL_RwX with pinned TLB Pinned TLB are 8M. Now that there is no strict boundary anymore between text and RO data, it is possible to use 8M pinned executable TLB that covers both text and RO data. When PIN_TLB_DATA or PIN_TLB_TEXT is selected, enforce 8M RW data alignment and allow STRICT_KERNEL_RWX. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c535fc97bf0dd8693192e25feeed8088701e00c6.1589866984.git.christophe.leroy@csgroup.eu commit cf209951fa7f2e7a8ec92f45f27ea11bc024bbfc Author: Christophe Leroy Date: Tue May 19 05:49:24 2020 +0000 powerpc/8xx: Map linear memory with huge pages Map linear memory space with 512k and 8M pages whenever possible. Three mappings are performed: - One for kernel text - One for RO data - One for the rest Separating the mappings is done to be able to update the protection later when using STRICT_KERNEL_RWX. The ITLB miss handler now need to also handle huge TLBs unless kernel text in pinned. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c44f0ab5510474f25123d904cd1f4e5c6aa3c1ac.1589866984.git.christophe.leroy@csgroup.eu commit a623bb5861dc442dc8de9edc9b3116f8b7c235c4 Author: Christophe Leroy Date: Tue May 19 05:49:23 2020 +0000 powerpc/8xx: Map IMMR with a huge page Map the IMMR area with a single 512k huge page. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9495dba06669da40e133f24607758fa6dcc65f66.1589866984.git.christophe.leroy@csgroup.eu commit 34536d78068318def0a370462cbc3319e1ca9014 Author: Christophe Leroy Date: Tue May 19 05:49:22 2020 +0000 powerpc/8xx: Add a function to early map kernel via huge pages Add a function to early map kernel memory using huge pages. For 512k pages, just use standard page table and map in using 512k pages. For 8M pages, create a hugepd table and populate the two PGD entries with it. This function can only be used to create page tables at startup. Once the regular SLAB allocation functions replace memblock functions, this function cannot allocate new pages anymore. However it can still update existing mappings with new protections. hugepd_none() macro is moved into asm/hugetlb.h to be usable outside of mm/hugetlbpage.c early_pte_alloc_kernel() is made visible. _PAGE_HUGE flag is now displayed by ptdump. Signed-off-by: Christophe Leroy [mpe: Change ptdump display to use "huge"] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/68325bcd3b6f93127f7810418a2352c3519066d6.1589866984.git.christophe.leroy@csgroup.eu commit c8bef10a9f17b2b9549e37878b2bcd48039c136b Author: Christophe Leroy Date: Tue May 19 05:49:20 2020 +0000 powerpc/8xx: Refactor kernel address boundary comparison Now that linear and IMMR dedicated TLB handling is gone, kernel boundary address comparison is similar in ITLB miss handler and in DTLB miss handler. Create a macro named compare_to_kernel_boundary. When TASK_SIZE is strictly below 0x80000000 and PAGE_OFFSET is above 0x80000000, it is enough to compare to 0x8000000, and this can be done with a single instruction. Using not. instruction, we get to use 'blt' conditional branch as when doing a regular comparison: 0x00000000 <= addr <= 0x7fffffff ==> 0xffffffff >= NOT(addr) >= 0x80000000 The above test corresponds to a 'blt' Otherwise, do a regular comparison using two instructions. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6312575d06a8813105e6564a3b12e1d373aa1b2f.1589866984.git.christophe.leroy@csgroup.eu commit a0591b60eef965f7f5255ad4696bbba9af4b43d0 Author: Christophe Leroy Date: Tue May 19 05:49:19 2020 +0000 powerpc/mm: Don't be too strict with _etext alignment on PPC32 Similar to PPC64, accept to map RO data as ROX as a trade off between between security and memory usage. Having RO data executable is not a high risk as RO data can't be modified to forge an exploit. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8c4a0d89d944eed984dd941e509614031a5ace2b.1589866984.git.christophe.leroy@csgroup.eu commit 0c8c2c9c201b44eed6c10d7c5c8d25fe5aab87ce Author: Christophe Leroy Date: Tue May 19 05:49:18 2020 +0000 powerpc/8xx: Move DTLB perf handling closer. Now that space have been freed next to the DTLB miss handler, it's associated DTLB perf handling can be brought back in the same place. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/97f48cc1a2ea6b895bfac0752cbe59deaf2eecda.1589866984.git.christophe.leroy@csgroup.eu commit 1251288e64ba44969e1c4d59e5ee88a6e873447b Author: Christophe Leroy Date: Tue May 19 05:49:17 2020 +0000 powerpc/8xx: Remove now unused TLB miss functions The code to setup linear and IMMR mapping via huge TLB entries is not called anymore. Remove it. Also remove the handling of removed code exits in the perf driver. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/75750d25849cb8e73ca519866bb892d7eb9649c0.1589866984.git.christophe.leroy@csgroup.eu commit 400dc0f86102d2ad11d3601f1948fbb02e926431 Author: Christophe Leroy Date: Tue May 19 05:49:16 2020 +0000 powerpc/8xx: Drop special handling of Linear and IMMR mappings in I/D TLB handlers Up to now, linear and IMMR mappings are managed via huge TLB entries through specific code directly in TLB miss handlers. This implies some patching of the TLB miss handlers at startup, and a lot of dedicated code. Remove all this specific dedicated code. For now we are back to normal handling via standard 4k pages. In the next patches, linear memory mapping and IMMR mapping will be managed through huge pages. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/221b7e3ead80a5969629938c023f8cfe45fdd2fb.1589866984.git.christophe.leroy@csgroup.eu commit 684c1664e0de63398aceb748343541b48d398710 Author: Christophe Leroy Date: Tue May 19 05:49:15 2020 +0000 powerpc/8xx: Always pin TLBs at startup. At startup, map 32 Mbytes of memory through 4 pages of 8M, and PIN them inconditionnaly. They need to be pinned because KASAN is using page tables early and the TLBs might be dynamically replaced otherwise. Remove RSV4I flag after installing mappings unless CONFIG_PIN_TLB_XXXX is selected. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b27c5767d18053b59f7eefddc189fcc3acf7b9c2.1589866984.git.christophe.leroy@csgroup.eu commit 136a9a0f74d2e0d9de5515190fe80344b86b45cf Author: Christophe Leroy Date: Tue May 19 05:49:14 2020 +0000 powerpc/8xx: Don't set IMMR map anymore at boot Only early debug requires IMMR to be mapped early. No need to set it up and pin it in assembly. Map it through page tables at udbg init when necessary. If CONFIG_PIN_TLB_IMMR is selected, pin it once we don't need the 32 Mb pinned RAM anymore. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/13c1e8539fdf363d3146f4884e5c3c76c6c308b5.1589866984.git.christophe.leroy@csgroup.eu commit f76c8f6d257cefda60221c83af7f97d9f74cb3ce Author: Christophe Leroy Date: Tue May 19 05:49:13 2020 +0000 powerpc/8xx: Add function to set pinned TLBs Pinned TLBs cannot be modified when the MMU is enabled. Create a function to rewrite the pinned TLB entries with MMU off. To set pinned TLB, we have to turn off MMU, disable pinning, do a TLB flush (Either with tlbie and tlbia) then reprogam the TLB entries, enable pinning and turn on MMU. If using tlbie, it cleared entries in both instruction and data TLB regardless whether pinning is disabled or not. If using tlbia, it clears all entries of the TLB which has disabled pinning. To make it easy, just clear all entries in both TLBs, and reprogram them. The function takes two arguments, the top of the memory to consider and whether data is RO under _sinittext. When DEBUG_PAGEALLOC is set, the top is the end of kernel rodata. Otherwise, that's the top of physical RAM. Everything below _sinittext is set RX, over _sinittext that's RW. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c17806014bb1c06513ad1e1d510faea31984b177.1589866984.git.christophe.leroy@csgroup.eu commit 5d4656696c30cef56b2ab506b203533c818af04d Author: Christophe Leroy Date: Tue May 19 05:49:12 2020 +0000 powerpc/8xx: Move PPC_PIN_TLB options into 8xx Kconfig PPC_PIN_TLB options are dedicated to the 8xx, move them into the 8xx Kconfig. While we are at it, add some text to explain what it does. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1ece39fac6312e1d14e6a67b3f9d9f9f91990a7b.1589866984.git.christophe.leroy@csgroup.eu commit 555904d07eef3a2e5fc458419edf6174362c4ddd Author: Christophe Leroy Date: Tue May 19 05:49:11 2020 +0000 powerpc/8xx: MM_SLICE is not needed anymore As the 8xx now manages 512k pages in standard page tables, it doesn't need CONFIG_PPC_MM_SLICES anymore. Don't select it anymore and remove all related code. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/98e8ccd424476ea73cced2b89ba38eb2ed8144fb.1589866984.git.christophe.leroy@csgroup.eu commit d4870b89acd7c362ded08f9295e8d143cf7e0024 Author: Christophe Leroy Date: Tue May 19 05:49:10 2020 +0000 powerpc/8xx: Only 8M pages are hugepte pages now 512k pages are now standard pages, so only 8M pages are hugepte. No more handling of normal page tables through hugepd allocation and freeing, and hugepte helpers can also be simplified. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2c6135d57fb76eebf70673fbac3dc9e740767879.1589866984.git.christophe.leroy@csgroup.eu commit b250c8c08c79d1eb5354c7eaa84b7505f5f2d921 Author: Christophe Leroy Date: Tue May 19 05:49:09 2020 +0000 powerpc/8xx: Manage 512k huge pages as standard pages. At the time being, 512k huge pages are handled through hugepd page tables. The PMD entry is flagged as a hugepd pointer and it means that only 512k hugepages can be managed in that 4M block. However, the hugepd table has the same size as a normal page table, and 512k entries can therefore be nested with normal pages. On the 8xx, TLB loading is performed by software and allthough the page tables are organised to match the L1 and L2 level defined by the HW, all TLB entries have both L1 and L2 independent entries. It means that even if two TLB entries are associated with the same PMD entry, they can be loaded with different values in L1 part. The L1 entry contains the page size (PS field): - 00 for 4k and 16 pages - 01 for 512k pages - 11 for 8M pages By adding a flag for hugepages in the PTE (_PAGE_HUGE) and copying it into the lower bit of PS, we can then manage 512k pages with normal page tables: - PMD entry has PS=11 for 8M pages - PMD entry has PS=00 for other pages. As a PMD entry covers 4M areas, a PMD will either point to a hugepd table having a single entry to an 8M page, or the PMD will point to a standard page table which will have either entries to 4k or 16k or 512k pages. For 512k pages, as the L1 entry will not know it is a 512k page before the PTE is read, there will be 128 entries in the PTE as if it was 4k pages. But when loading the TLB, it will be flagged as a 512k page. Note that we can't use pmd_ptr() in asm/nohash/32/pgtable.h because it is not defined yet. In ITLB miss, we keep the possibility to opt it out as when kernel text is pinned and no user hugepages are used, we can save several instruction by not using r11. In DTLB miss, that's just one instruction so it's not worth bothering with it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/002819e8e166bf81d24b24782d98de7c40905d8f.1589866984.git.christophe.leroy@csgroup.eu commit a891c43b97d315ee5f9fe8e797d3d48fc351e053 Author: Christophe Leroy Date: Tue May 19 05:49:08 2020 +0000 powerpc/8xx: Prepare handlers for _PAGE_HUGE for 512k pages. Prepare ITLB handler to handle _PAGE_HUGE when CONFIG_HUGETLBFS is enabled. This means that the L1 entry has to be kept in r11 until L2 entry is read, in order to insert _PAGE_HUGE into it. Also move pgd_offset helpers before pte_update() as they will be needed there in next patch. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/21fd1de8fba781bededa9474a5a9374aefb1f849.1589866984.git.christophe.leroy@csgroup.eu commit d3efcd38c0b99162d889e36a30425345a18edb33 Author: Christophe Leroy Date: Tue May 19 05:49:07 2020 +0000 powerpc/8xx: Drop CONFIG_8xx_COPYBACK option CONFIG_8xx_COPYBACK was there to help disabling copyback cache mode for debuging hardware. But nobody will design new boards with 8xx now. All 8xx platforms select it, so make it the default and remove the option. Also remove the Mx_RESETVAL values which are pretty useless and hide the real value while reading code. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bcc968cda075516eb76e2f25e09821f582c566b4.1589866984.git.christophe.leroy@csgroup.eu commit b12c07a4bb064c0a8db7554557b89d40f57c936f Author: Christophe Leroy Date: Tue May 19 05:49:06 2020 +0000 powerpc/mm: Reduce hugepd size for 8M hugepages on 8xx Commit 55c8fc3f4930 ("powerpc/8xx: reintroduce 16K pages with HW assistance") redefined pte_t as a struct of 4 pte_basic_t, because in 16K pages mode there are four identical entries in the page table. But hugepd entries for 8M pages require only one entry of size pte_basic_t. So there is no point in creating a cache for 4 entries page tables. Calculate PTE_T_ORDER using the size of pte_basic_t instead of pte_t. Define specific huge_pte helpers (set_huge_pte_at(), huge_pte_clear(), huge_ptep_set_wrprotect()) to write the pte in a single entry instead of using set_pte_at() which writes 4 identical entries in 16k pages mode. Also make sure that __ptep_set_access_flags() properly handle the huge_pte case. Define set_pte_filter() inline otherwise GCC doesn't inline it anymore because it is now used twice, and that gives a pretty suboptimal code because of pte_t being a struct of 4 entries. Those functions are also used for 512k pages which only require one entry as well allthough replicating it four times was harmless as 512k pages entries are spread every 128 bytes in the table. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/43050d1a0c2d6e1541cab9c1126fc80bc7015ebd.1589866984.git.christophe.leroy@csgroup.eu commit 6ad41bfbc907be0cd414f09fa5382d2133376595 Author: Christophe Leroy Date: Tue May 19 05:49:05 2020 +0000 powerpc/mm: Create a dedicated pte_update() for 8xx pte_update() is a bit special for the 8xx. At the time being, that's an #ifdef inside the nohash/32 pte_update(). As we are going to make it even more special in the coming patches, create a dedicated version for pte_update() for 8xx. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a103be0099ac2360f8c44f4a1a63cc03713a1360.1589866984.git.christophe.leroy@csgroup.eu commit 06f52524870122fb43b214d27e8f4546da36f8ba Author: Christophe Leroy Date: Tue May 19 05:49:04 2020 +0000 powerpc/mm: Standardise pte_update() prototype between PPC32 and PPC64 PPC64 takes 3 additional parameters compared to PPC32: - mm - address - huge These 3 parameters will be needed in order to perform different action depending on the page size on the 8xx. Make pte_update() prototype identical for PPC32 and PPC64. This allows dropping an #ifdef in huge_ptep_get_and_clear(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/38111acf6841047a8addde37c63e92d611ee38c2.1589866984.git.christophe.leroy@csgroup.eu commit c7fa77016eb6093df38fdabdb7a89bb9617e7185 Author: Christophe Leroy Date: Tue May 19 05:49:03 2020 +0000 powerpc/mm: Standardise __ptep_test_and_clear_young() params between PPC32 and PPC64 On PPC32, __ptep_test_and_clear_young() takes the mm->context.id In preparation of standardising pte_update() params between PPC32 and PPC64, __ptep_test_and_clear_young() need mm instead of mm->context.id Replace context param by mm. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0a65470e50a14373b7c2291184514aa982462255.1589866984.git.christophe.leroy@csgroup.eu commit 1c1bf294882bd12669e39ccd7680c4ce34b7c15c Author: Christophe Leroy Date: Tue May 19 05:49:02 2020 +0000 powerpc/mm: Refactor pte_update() on book3s/32 When CONFIG_PTE_64BIT is set, pte_update() operates on 'unsigned long long' When CONFIG_PTE_64BIT is not set, pte_update() operates on 'unsigned long' In asm/page.h, we have pte_basic_t which is 'unsigned long long' when CONFIG_PTE_64BIT is set and 'unsigned long' otherwise. Refactor pte_update() using pte_basic_t. While we are at it, drop the comment on 44x which is not applicable to book3s version of pte_update(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c78912bc8613fb249c3d80aeb1062796b5c49400.1589866984.git.christophe.leroy@csgroup.eu commit 2db99aeb63dd6e8808dc054d181c4d0e8645bbe0 Author: Christophe Leroy Date: Tue May 19 05:49:01 2020 +0000 powerpc/mm: Refactor pte_update() on nohash/32 When CONFIG_PTE_64BIT is set, pte_update() operates on 'unsigned long long' When CONFIG_PTE_64BIT is not set, pte_update() operates on 'unsigned long' In asm/page.h, we have pte_basic_t which is 'unsigned long long' when CONFIG_PTE_64BIT is set and 'unsigned long' otherwise. Refactor pte_update() using pte_basic_t. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/590d67994a2847cd9fe088f7d974499e3a18b6ac.1589866984.git.christophe.leroy@csgroup.eu commit fadaac67c9007cad9fc485e36dcc54460d6d5886 Author: Christophe Leroy Date: Tue May 19 05:49:00 2020 +0000 powerpc/mm: PTE_ATOMIC_UPDATES is only for 40x Only 40x still uses PTE_ATOMIC_UPDATES. 40x cannot not select CONFIG_PTE64_BIT. Drop handling of PTE_ATOMIC_UPDATES: - In nohash/64 - In nohash/32 for CONFIG_PTE_64BIT Keep PTE_ATOMIC_UPDATES only for nohash/32 for !CONFIG_PTE_64BIT Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d6f8e1f46583f1842de24581a68b0496feb15516.1589866984.git.christophe.leroy@csgroup.eu commit 4e3319c23a66dabfd6c35f4d2633d64d99b68096 Author: Christophe Leroy Date: Tue May 19 05:48:59 2020 +0000 powerpc/mm: Fix conditions to perform MMU specific management by blocks on PPC32. Setting init mem to NX shall depend on sinittext being mapped by block, not on stext being mapped by block. Setting text and rodata to RO shall depend on stext being mapped by block, not on sinittext being mapped by block. Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7d565fb8f51b18a3d98445a830b2f6548cb2da2a.1589866984.git.christophe.leroy@csgroup.eu commit 925ac141d106b55acbe112a9272f970631a3c082 Author: Christophe Leroy Date: Tue May 19 05:48:58 2020 +0000 powerpc/mm: Allocate static page tables for fixmap Allocate static page tables for the fixmap area. This allows setting mappings through page tables before memblock is ready. That's needed to use early_ioremap() early and to use standard page mappings with fixmap. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4f4b1412d34de6801b8e925cb88fc69d056ff536.1589866984.git.christophe.leroy@csgroup.eu commit 4b19f96a81bceaf0bcf44d79c0855c61158065ec Author: Christophe Leroy Date: Tue May 19 05:48:56 2020 +0000 powerpc/32s: Don't warn when mapping RO data ROX. Mapping RO data as ROX is not an issue since that data cannot be modified to introduce an exploit. PPC64 accepts to have RO data mapped ROX, as a trade off between kernel size and strictness of protection. On PPC32, kernel size is even more critical as amount of memory is usually small. Depending on the number of available IBATs, the last IBATs might overflow the end of text. Only warn if it crosses the end of RO data. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6499f8eeb2a36330e5c9fc1cee9a79374875bd54.1589866984.git.christophe.leroy@csgroup.eu commit 6b789a26d7da2e0256d199da980369ef8fb49ec6 Author: Christophe Leroy Date: Tue May 19 05:48:55 2020 +0000 powerpc/ptdump: Handle hugepd at PGD level The 8xx is about to map kernel linear space and IMMR using huge pages. In order to display those pages properly, ptdump needs to handle hugepd tables at PGD level. For the time being do it only at PGD level. Further patches may add handling of hugepd tables at lower level for other platforms when needed in the future. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/630728289158dcfeb06b14d40ed7c4c4e7148cf1.1589866984.git.christophe.leroy@csgroup.eu commit b00ff6d8c1c3898b0f768cbb38ef722d25bd2f39 Author: Christophe Leroy Date: Tue May 19 05:48:54 2020 +0000 powerpc/ptdump: Properly handle non standard page size In order to properly display information regardless of the page size, it is necessary to take into account real page size. Fixes: cabe8138b23c ("powerpc: dump as a single line areas mapping a single physical page.") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a53b2a0ffd042a8d85464bf90d55bc5b970e00a1.1589866984.git.christophe.leroy@csgroup.eu commit 8961a2a5353cca5451f648f4838cd848a3b2354c Author: Christophe Leroy Date: Tue May 19 05:48:53 2020 +0000 powerpc/ptdump: Standardise display of BAT flags Display BAT flags the same way as page flags: rwx and wimg Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a07585f353c167b8db9597d83f992a5cb4fbf4c4.1589866984.git.christophe.leroy@csgroup.eu commit 6b30830e2003d9d77696084ebe2fc19dbe7d6f70 Author: Christophe Leroy Date: Tue May 19 05:48:52 2020 +0000 powerpc/ptdump: Display size of BATs Display the size of areas mapped with BATs. For that, the size display for pages is refactorised. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/acf764eee231f0358e66ca9e819f052804055acc.1589866984.git.christophe.leroy@csgroup.eu commit 3af4786eb429b2df76cbd7ce3bae21467ac3e4fb Author: Christophe Leroy Date: Tue May 19 05:48:51 2020 +0000 powerpc/ptdump: Add _PAGE_COHERENT flag For platforms using shared.c (4xx, Book3e, Book3s/32), also handle the _PAGE_COHERENT flag which corresponds to the M bit of the WIMG flags. Signed-off-by: Christophe Leroy [mpe: Make it more verbose, use "coherent" rather than "m"] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/324c3d860717e8e91fca3bb6c0f8b23e1644a404.1589866984.git.christophe.leroy@csgroup.eu commit fb597f2a393294f3d3012ecb314f43b60fa48359 Author: Gregory Fong Date: Fri May 22 15:12:30 2020 +0100 ARM: 8980/1: Allow either FLATMEM or SPARSEMEM on the multiplatform build ARMv7 chips with LPAE can often benefit from SPARSEMEM, as portions of system memory can be located deep in the 36-bit address space. Allow FLATMEM or SPARSEMEM to be selectable at compile time; FLATMEM remains the default. This is based on Kevin's "[PATCH 3/3] ARM: Allow either FLATMEM or SPARSEMEM on the multi-v7 build" from [1] and shamelessly rips off his commit message text above. As Arnd pointed out at [2] there doesn't seem to be any reason to tie this specifically to ARMv7, so this has been changed to apply to all multiplatform kernels. The addition of this option does not change the defaults and a build with any defconfig will behave the same way as previously. The only effect this change has is to enable user to change "Memory model" selection in interactive kernel configuration (menuconfig, xconfig etc). [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-September/286837.html [2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-October/298950.html [ rppt: added ARCH_SELECT_MEMORY_MODEL and updated the changelog ] Cc: Kevin Cernekee Tested-by: Stephen Boyd Signed-off-by: Gregory Fong Signed-off-by: Doug Berger Signed-off-by: Florian Fainelli Signed-off-by: Mike Rapoport Signed-off-by: Russell King commit 98f3f7e51338db90f88940d99d9384a2855cc317 Author: Kevin Cernekee Date: Fri May 22 15:09:56 2020 +0100 ARM: 8979/1: Remove redundant ARCH_SPARSEMEM_DEFAULT setting If ARCH_SPARSEMEM_ENABLE=y and ARCH_{FLATMEM,DISCONTIGMEM}_ENABLE=n, then the logic in mm/Kconfig already makes CONFIG_SPARSEMEM the only choice. This is true for all of the existing ARM users of ARCH_SPARSEMEM_ENABLE. Forcing ARCH_SPARSEMEM_DEFAULT=y if ARCH_SPARSEMEM_ENABLE=y prevents us from ever defaulting to FLATMEM, so we should remove this setting. Link: https://lkml.org/lkml/2015/6/4/757 Signed-off-by: Kevin Cernekee Tested-by: Stephen Boyd Acked-by: Arnd Bergmann Signed-off-by: Gregory Fong Signed-off-by: Doug Berger Signed-off-by: Florian Fainelli Signed-off-by: Mike Rapoport Signed-off-by: Russell King commit e1de94380af588bdf6ad6f0cc1f75004c35bc096 Author: Linus Walleij Date: Tue May 19 12:59:12 2020 +0100 ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE Recent work with KASan exposed the folling hard-coded bitmask in arch/arm/mm/proc-macros.S: bic rd, sp, #8128 bic rd, rd, #63 This forms the bitmask 0x1FFF that is coinciding with (PAGE_SIZE << THREAD_SIZE_ORDER) - 1, this code was assuming that THREAD_SIZE is always 8K (8192). As KASan was increasing THREAD_SIZE_ORDER to 2, I ran into this bug. Fix it by this little oneline suggested by Ard: bic rd, sp, #(THREAD_SIZE - 1) & ~63 Where THREAD_SIZE is defined using THREAD_SIZE_ORDER. We have to also include since the THREAD_SIZE expands to use the _AC() macro. Cc: Ard Biesheuvel Cc: Florian Fainelli Suggested-by: Ard Biesheuvel Signed-off-by: Linus Walleij Signed-off-by: Russell King commit d19c64b3d0978e741a9b18273ff8a9b52f1a8ca0 Merge: 37f6c193e626 4caf2511ec49 Author: Greg Kroah-Hartman Date: Tue May 26 12:19:36 2020 +0200 Merge tag 'thunderbolt-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v5.8 merge window This adds support for Intel Tiger Lake Thunderbolt controller using firmware based connection manager. In addition the driver can now be built on non-x86 architectures as well. Then there are a couple of commits that make the driver work across kexec, replace a zero length array with flexible one, and revert one change that is not needed anymore because of NVMem subsystem improvements. * tag 'thunderbolt-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Add trivial .shutdown thunderbolt: Update Kconfig to allow building on other architectures. thunderbolt: Replace zero-length array with flexible-array thunderbolt: Add support for Intel Tiger Lake Revert "thunderbolt: Prevent crash if non-active NVMem file is read" commit edc475bee00b18f6de16ce3e6da8fdec8b476302 Author: kbuild test robot Date: Tue May 26 02:43:51 2020 +0800 ASoC: fix semicolon.cocci warnings sound/soc/codecs/zl38060.c:298:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 52e8a94baf90 ("ASoC: Add initial ZL38060 driver") Signed-off-by: kbuild test robot CC: Sven Van Asbroeck Link: https://lore.kernel.org/r/20200525184351.GA37386@5cf39b9a5cc3 Signed-off-by: Mark Brown commit fce2bc254adbfe0449ab6bfb51bffba9d3c42689 Merge: 2318976619da d0f9ca9be11f Author: Russell King Date: Tue May 26 10:52:26 2020 +0100 Merge tag 'efi-arm-no-relocate-for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux into misc Simplify EFI handover to decompressor The EFI stub in the ARM kernel runs in the context of the firmware, which means it usually runs with the caches and MMU on. Currently, we relocate the zImage so it appears in the first 128 MiB, disable the MMU and caches and invoke the decompressor via its ordinary entry point. However, since we can pass the base of DRAM directly, there is no need to relocate the zImage, which also means there is no need to disable and re-enable the caches and create new page tables etc. This also allows systems whose DRAM start address is not a round multiple of 128 MB to decompress the kernel proper to the base of memory, ensuring that all memory is usable at runtime. commit 12e5bf757a1fd03c5d736942428732be641daa1c Author: Thierry Reding Date: Fri Apr 17 19:09:13 2020 +0200 mfd: max77620: Use single-byte writes on MAX77620 The MAX77620 doesn't support bulk writes, so make sure the regmap code breaks bulk writes into multiple single-byte writes. Note that this is mostly cosmetic because currently only the RTC sub- driver uses bulk writes and the RTC driver ends up using a different regmap on the MAX77620 anyway. However, it seems like a good idea to make this change now in order to avoid running into issues if bulk writes are ever used by other sub-drivers sometime down the road. Signed-off-by: Thierry Reding Acked-by: Jon Hunter Tested-by: Jon Hunter Signed-off-by: Lee Jones commit 652b7b6740eb52d98377a881c7730e36997f00ab Author: Wei Yongjun Date: Mon Apr 27 12:29:22 2020 +0000 mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc It's not necessary to free memory allocated with devm_kzalloc and using kfree leads to a double free. Fixes: 6ac7e4d7ad70 ("mfd: wcd934x: Add support to wcd9340/wcd9341 codec") Signed-off-by: Wei Yongjun Signed-off-by: Lee Jones commit 97eda5dcc2cde5dcc778bef7a9344db3b6bf8ef5 Author: Amelie Delaunay Date: Wed Apr 22 11:08:33 2020 +0200 mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt When STMFX supply is stopped, spurious interrupt can occur. To avoid that, disable the interrupt in suspend before disabling the regulator and re-enable it at the end of resume. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay Signed-off-by: Lee Jones commit 60c2c4bcb9202acad4cc26af20b44b6bd7874f7b Author: Amelie Delaunay Date: Wed Apr 22 11:08:32 2020 +0200 mfd: stmfx: Fix stmfx_irq_init error path In case the interrupt signal can't be configured, IRQ domain needs to be removed. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay Signed-off-by: Lee Jones commit e583649d87ec090444aa5347af0927cd6e8581ae Author: Amelie Delaunay Date: Wed Apr 22 11:08:31 2020 +0200 mfd: stmfx: Reset chip on resume as supply was disabled STMFX supply is disabled during suspend. To avoid a too early access to the STMFX firmware on resume, reset the chip and wait for its firmware to be loaded. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay Signed-off-by: Lee Jones commit 7ff864e1ad343dc0960f454a58af48883c5f0f5d Author: Marek Szyprowski Date: Mon Apr 27 09:48:31 2020 +0200 mfd: wm8994: Silence warning about supplies during deferred probe Don't confuse user with meaningless warning about the failure in getting supplies in case of deferred probe. Signed-off-by: Marek Szyprowski Acked-by: Charles Keepax Signed-off-by: Lee Jones commit f4a1954036c1a256e89fb087eb39cb719336e7c4 Author: Marek Szyprowski Date: Mon Apr 27 09:48:30 2020 +0200 mfd: wm8994: Fix unbalanced calls to regulator_bulk_disable() When runtime PM is enabled, regulators are being controlled by the driver's suspend and resume callbacks. They are also unconditionally enabled at driver's probe(), and disabled in remove() functions. Add more calls to runtime PM framework to ensure that the device's runtime PM state matches the regulators state: 1. at the end of probe() function: set runtime PM state to active, so there will be no spurious call to resume(); 2. in remove(), ensure that resume() is called before disabling runtime PM management and unconditionally disabling the regulators. Signed-off-by: Marek Szyprowski Acked-by: Charles Keepax Signed-off-by: Lee Jones commit d4f9b5428b53dd67f49ee8deed8d4366ed6b1933 Author: Marek Szyprowski Date: Mon Apr 27 09:48:29 2020 +0200 mfd: wm8994: Fix driver operation if loaded as modules WM8994 chip has built-in regulators, which might be used for chip operation. They are controlled by a separate wm8994-regulator driver, which should be loaded before this driver calls regulator_get(), because that driver also provides consumer-supply mapping for the them. If that driver is not yet loaded, regulator core substitute them with dummy regulator, what breaks chip operation, because the built-in regulators are never enabled. Fix this by annotating this driver with MODULE_SOFTDEP() "pre" dependency to "wm8994_regulator" module. Signed-off-by: Marek Szyprowski Acked-by: Charles Keepax Signed-off-by: Lee Jones commit 5037941f31516276e1e95d6aafebd6d9992b24a8 Author: Matthias Brugger Date: Fri Jan 10 15:59:51 2020 +0100 dt-bindings: mfd: mediatek: Add MT6397 Pin Controller The MT6397 mfd includes a pin controller. Add binding a description for it. Signed-off-by: Matthias Brugger Reviewed-by: Nicolas Boichat Acked-by: Rob Herring Signed-off-by: Lee Jones commit 9aa8759960e36291e7663288d58b47ee4927b6f5 Author: Tomas Winkler Date: Sat May 16 14:06:08 2020 +0300 mfd: Constify properties in mfd_cell Constify 'struct property_entry *properties' in mfd_cell. It is always passed around as a pointer const struct. Signed-off-by: Tomas Winkler Signed-off-by: Lee Jones commit 8d7de077834f978ea0adc9727c43a69129b6f107 Author: Peter Ujfalusi Date: Tue Jan 7 12:59:59 2020 +0200 mfd: stm32-timers: Use dma_request_chan() instead dma_request_slave_channel() dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. By using dma_request_chan() directly the driver can support deferred probing against DMA. Signed-off-by: Peter Ujfalusi Acked-by: Fabrice Gasnier Signed-off-by: Lee Jones commit c085c664155ef6bd2e0ae9a030751b66cf307606 Author: Baolin Wang Date: Wed Apr 29 17:45:37 2020 +0800 mfd: sprd: Remove unnecessary spi_bus_type setting The spi_register_driver() will set the spi_bus_type for the spi_driver, thus remove the redundant setting in this driver. Signed-off-by: Baolin Wang Signed-off-by: Lee Jones commit 9a875245f0c7fe2884ac4b58339c8da3ab9952f8 Author: Andy Shevchenko Date: Tue Apr 14 12:51:34 2020 +0300 mfd: intel-lpss: Update LPSS UART #2 PCI ID for Jasper Lake It appears that preliminary documentation has a typo in the ID list, i.e. LPSS UART #2 had been advertised wrongly. Fix the driver according to the EDS v0.9. Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones commit ff8bd0b59cfdabb9bc4c0941724fafaf9a508c07 Author: Christophe JAILLET Date: Sun Apr 12 23:30:47 2020 +0200 mfd: tqmx86: Fix a typo in MODULE_DESCRIPTION Based on the file name and code of the driver, it is likely that this module is related to TQMx86 and not TQx86. Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Lunn Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit 0c09e712b38d2bb9df5d58027fccebebee7aa15b Author: YueHaibing Date: Fri Apr 10 19:55:14 2020 +0800 mfd: stpmic1: Make stpmic1_regmap_config static Fix sparse warning: drivers/mfd/stpmic1.c:62:28: warning: symbol 'stpmic1_regmap_config' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Lee Jones commit 8bc401f3f56e69a0bf854952a028fd2335ae5cdc Author: Wolfram Sang Date: Thu Mar 26 22:10:09 2020 +0100 mfd: htc-i2cpld: Convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Signed-off-by: Lee Jones commit e8a6f4acae064063255af91ac7e8d6ee5e04e471 Merge: 2f72d35ea75e 29ee40091e27 904ac71f4b0c 3bce5377ef66 Author: Lee Jones Date: Tue May 26 10:50:51 2020 +0100 Merge branches 'ib-mfd-x86-usb-watchdog-5.8', 'ib-mfd-power-rtc-5.8', 'ib-mfd-iio-power-5.8' and 'ib-mfd-hwmon-5.8' into ibs-for-mfd-merged commit 904ac71f4b0c1c26ec47ff597cb3d3c7d36e618d Author: Saravanan Sekar Date: Tue May 26 11:06:46 2020 +0200 MAINTAINERS: Add entry for mp2629 Battery Charger driver Add MAINTAINERS entry for Monolithic Power Systems mp2629 Charger driver. Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Reviewed-by: Sebastian Reichel Signed-off-by: Lee Jones commit fe27f04e0cdc841e3a0b2387b27bf57ef99c5740 Author: Saravanan Sekar Date: Tue May 26 11:06:45 2020 +0200 power: supply: mp2629: Add impedance compensation config Allows the user to compensate the intrinsic resistance of the battery to accelerate the charging cycle. Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Reviewed-by: Sebastian Reichel Signed-off-by: Lee Jones commit 3bc6d790c39dfc4539c36525e6bcb617abbae467 Author: Saravanan Sekar Date: Tue May 26 11:06:44 2020 +0200 power: supply: Add support for mps mp2629 battery charger The mp2629 provides switching-mode battery charge management for single-cell Li-ion or Li-polymer battery. Driver supports the access/control input source and battery charging parameters. Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Reviewed-by: Sebastian Reichel Signed-off-by: Lee Jones commit 7abd9fb6468225f5c7f83149ce279cc1a912a68a Author: Saravanan Sekar Date: Tue May 26 11:06:43 2020 +0200 iio: adc: mp2629: Add support for mp2629 ADC driver Add support for 8-bit resolution ADC readings for input power supply and battery charging measurement. Provides voltage, current readings to mp2629 power supply driver. Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Reviewed-by: Jonathan Cameron Signed-off-by: Lee Jones commit 06081646450e46efcc1ca58c3b227bd60083cd3e Author: Saravanan Sekar Date: Tue May 26 11:06:42 2020 +0200 mfd: mp2629: Add support for mps battery charger mp2629 is a highly-integrated switching-mode battery charge management device for single-cell Li-ion or Li-polymer battery. Add MFD core enables chip access for ADC driver for battery readings, and a power supply battery-charger driver Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Reviewed-by: Jonathan Cameron Signed-off-by: Lee Jones commit 25c8c452ff45e9376c0b664d549fe2f57ee9d602 Author: Saravanan Sekar Date: Tue May 26 11:06:41 2020 +0200 dt-bindings: mfd: Add document bindings for mp2629 Add device tree binding information for mp2629 mfd driver. Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit e72455b898ac678667c5674668186b4670d87d11 Author: Scott Shumate Date: Wed May 13 13:39:26 2020 -0500 HID: sony: Fix for broken buttons on DS3 USB dongles Fix for non-working buttons on knock-off USB dongles for Sony controllers. These USB dongles are used to connect older Sony DA/DS1/DS2 controllers via USB and are common on Amazon, AliExpress, etc. Without the patch, the square, X, and circle buttons do not function. These dongles used to work prior to kernel 4.10 but removing the global DS3 report fixup in commit e19a267b9987 ("HID: sony: DS3 comply to Linux gamepad spec") exposed the problem. Many people reported the problem on the Ubuntu forums and are working around the problem by falling back to the 4.9 hid-sony driver. The problem stems from these dongles incorrectly reporting their button count as 13 instead of 16. This patch fixes up the report descriptor by changing the button report count to 16 and removing 3 padding bits. Cc: stable@vger.kernel.org Fixes: e19a267b9987 ("HID: sony: DS3 comply to Linux gamepad spec") Signed-off-by: Scott Shumate Signed-off-by: Jiri Kosina commit de308d1815c9e8fe602a958c5c76142ff6501d75 Author: Borislav Petkov Date: Mon May 25 12:38:39 2020 +0200 x86/apic: Make TSC deadline timer detection message visible The commit c84cb3735fd5 ("x86/apic: Move TSC deadline timer debug printk") removed the message which said that the deadline timer was enabled. It added a pr_debug() message which is issued when deadline timer validation succeeds. Well, issued only when CONFIG_DYNAMIC_DEBUG is enabled - otherwise pr_debug() calls get optimized away if DEBUG is not defined in the compilation unit. Therefore, make the above message pr_info() so that it is visible in dmesg. Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200525104218.27018-1-bp@alien8.de commit 64c7d7ea22d86cacb65d0c097cc447bc0e6d8abd Author: Rafael J. Wysocki Date: Thu May 21 19:08:09 2020 +0200 PM: runtime: clk: Fix clk_pm_runtime_get() error path clk_pm_runtime_get() assumes that the PM-runtime usage counter will be dropped by pm_runtime_get_sync() on errors, which is not the case, so PM-runtime references to devices acquired by the former are leaked on errors returned by the latter. Fix this by modifying clk_pm_runtime_get() to drop the reference if pm_runtime_get_sync() returns an error. Fixes: 9a34b45397e5 clk: Add support for runtime PM Cc: 4.15+ # 4.15+ Signed-off-by: Rafael J. Wysocki Reviewed-by: Ulf Hansson commit a871be6b8eee13a35a3e8e56c62770ef17ee9220 Author: Stephan Gerhold Date: Thu Apr 16 10:58:21 2020 +0200 cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver The Qualcomm SPM cpuidle driver seems to be the last driver still using the generic ARM CPUidle infrastructure. Converting it actually allows us to simplify the driver, and we end up being able to remove more lines than adding new ones: - We can parse the CPUidle states in the device tree directly with dt_idle_states (and don't need to duplicate that functionality into the spm driver). - Each "saw" device managed by the SPM driver now directly registers its own cpuidle driver, removing the need for any global (per cpu) state. The device tree binding is the same, so the driver stays compatible with all old device trees. Signed-off-by: Stephan Gerhold Reviewed-by: Lina Iyer Reviewed-by: Ulf Hansson Acked-by: Bjorn Andersson Signed-off-by: Rafael J. Wysocki commit 37f6c193e626c93c018e93dc4fe9e4fb454e73d1 Merge: e4befc121df0 6dbbbccdba61 Author: Greg Kroah-Hartman Date: Tue May 26 10:27:14 2020 +0200 Merge tag 'usb-ci-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: - Some improvments for ci_hdrc_usb2.c - Support imx7d USB charger - Add software sg support for UDC - Enable user trigger role switch * tag 'usb-ci-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb: usb: chipidea: Enable user-space triggered role-switching usb: chipidea: udc: add software sg list support usb: chipidea: usbmisc_imx: using different ops for imx7d and imx7ulp usb: chipidea: pull down dp for possible charger detection operation usb: chipidea: introduce imx7d USB charger detection usb: chipidea: introduce CI_HDRC_CONTROLLER_VBUS_EVENT glue layer use usb: chipidea: usb2: remove unneeded semicolon usb: chipidea: allow disabling glue drivers if EMBEDDED usb: chipidea: usb2: absorb zevio glue driver usb: chipidea: usb2: make clock optional usb: chipidea: usb2: fix formatting usb: chipidea: usb2: constify zynq_pdata usb: chipidea: core: show the real pointer value for register usb: chipidea: core: refine the description for this driver usb: chipidea: udc: fix the kernel doc for udc.h commit 11399346ac39a26ade2a90303d38ad318163c665 Author: Gustavo A. R. Silva Date: Thu May 7 14:00:33 2020 -0500 mtd: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Acked-by: Miquel Raynal Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20200507190033.GA15215@embeddedor commit 9ad346c90509ebd983f60da7d082f261ad329507 Author: Sven Eckelmann Date: Mon Nov 25 10:46:50 2019 +0100 batman-adv: Revert "disable ethtool link speed detection when auto negotiation off" The commit 8c46fcd78308 ("batman-adv: disable ethtool link speed detection when auto negotiation off") disabled the usage of ethtool's link_ksetting when auto negotation was enabled due to invalid values when used with tun/tap virtual net_devices. According to the patch, automatic measurements should be used for these kind of interfaces. But there are major flaws with this argumentation: * automatic measurements are not implemented * auto negotiation has nothing to do with the validity of the retrieved values The first point has to be fixed by a longer patch series. The "validity" part of the second point must be addressed in the same patch series by dropping the usage of ethtool's link_ksetting (thus always doing automatic measurements over ethernet). Drop the patch again to have more default values for various net_device types/configurations. The user can still overwrite them using the batadv_hardif's BATADV_ATTR_THROUGHPUT_OVERRIDE. Reported-by: Matthias Schiffer Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 7dbbdd37f2ae7dd4175ba3f86f4335c463b18403 Author: Dave Airlie Date: Tue May 26 14:18:27 2020 +1000 drm/nouveau: use correct conflicting framebuffer API nouveau was calling the fbdev API which has issues with modules and built-ins. Call the correct API. Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Fixes: 2dd4d163cd9c ("drm/nouveau: remove open-coded version of remove_conflicting_pci_framebuffers()") Link: https://lore.kernel.org/lkml/21b52c28-3ace-cd13-d8ce-f38f2c6b2a96@infradead.org/T/#u Signed-off-by: Dave Airlie commit d52caf0404e625bcda352ebea53be25e91f9de02 Merge: 3248044ecf9f d05890c5aed0 Author: David S. Miller Date: Mon May 25 18:21:10 2020 -0700 Merge branch 'r8169-sync-hw-config-for-few-chip-versions-with-r8168-vendor-driver' Heiner Kallweit says: ==================== r8169: sync hw config for few chip versions with r8168 vendor driver Sync hw config for few chip versions with r8168 vendor driver. ==================== Signed-off-by: David S. Miller commit d05890c5aed0dd4709f27525862765f1c6ddec1a Author: Heiner Kallweit Date: Mon May 25 19:52:27 2020 +0200 r8169: sync RTL8168f/RTL8411 hw config with vendor driver Sync hw config for RTL8168f/RTL8411 with r8168 vendor driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 33b00ca1da49969da068f672e7c2430f16f1f85f Author: Heiner Kallweit Date: Mon May 25 19:50:38 2020 +0200 r8169: sync RTL8168evl hw config with vendor driver Sync hw config for RTL8168evl with r8168 vendor driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ee1350f94e5c7885142d736370e5fa7dc2c7747a Author: Heiner Kallweit Date: Mon May 25 19:49:55 2020 +0200 r8169: sync RTL8168h hw config with vendor driver Sync hw config for RTL8168h with r8168 vendor driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit d29d5ff9daee41a2553843574257e5a6724d5453 Author: Heiner Kallweit Date: Mon May 25 19:49:15 2020 +0200 r8169: sync RTL8168g hw config with vendor driver Sync hw config for RTL8168g with r8168 vendor driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3248044ecf9f91900be5678919966715f1fb8834 Merge: 617504c67e01 472f0a240250 Author: David S. Miller Date: Mon May 25 18:15:16 2020 -0700 Merge tag 'wireless-drivers-next-2020-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.8 Second set of patches for v5.8. Lots of new features and new supported hardware for mt76. Also rtw88 got new hardware support. Major changes: rtw88 * add support for Realtek 8723DE PCI adapter * rename rtw88.ko/rtwpci.ko to rtw88_core.ko/rtw88_pci.ko iwlwifi * stop supporting swcrypto and bt_coex_active module parameters on mvm devices * enable A-AMSDU in low latency mt76 * new devices for mt76x0/mt76x2 * support for non-offload firmware on mt7663 * hw/sched scan support for mt7663 * mt7615/mt7663 MSI support * TDLS support * mt7603/mt7615 rate control fixes * new driver for mt7915 * wowlan support for mt7663 * suspend/resume support for mt7663 ==================== Signed-off-by: David S. Miller commit 617504c67e01d30310558442777a4112ea6d587d Author: Horatiu Vultur Date: Mon May 25 09:55:41 2020 +0000 bridge: mrp: Fix out-of-bounds read in br_mrp_parse The issue was reported by syzbot. When the function br_mrp_parse was called with a valid net_bridge_port, the net_bridge was an invalid pointer. Therefore the check br->stp_enabled could pass/fail depending where it was pointing in memory. The fix consists of setting the net_bridge pointer if the port is a valid pointer. Reported-by: syzbot+9c6f0f1f8e32223df9a4@syzkaller.appspotmail.com Fixes: 6536993371fa ("bridge: mrp: Integrate MRP into the bridge") Signed-off-by: Horatiu Vultur Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 07153961f82878dee73717f64761d67dff9546c1 Author: Wang Wenhu Date: Sun May 24 23:29:51 2020 -0700 drivers: ipa: print dev_err info accurately Print certain name string instead of hard-coded "memory" for dev_err output, which would be more accurate and helpful for debugging. Signed-off-by: Wang Wenhu Cc: Alex Elder Reviewed-by: Alex Elder Signed-off-by: David S. Miller commit b8170fad6e5fe8a695fbba9305a1e5ede278a2db Author: Tom Zanussi Date: Mon May 18 13:29:24 2020 -0500 tracing: Fix events.rst section numbering The in-kernel trace event API should have its own section, and the duplicate section numbers need fixing as well. Reported-by: Li Xinhai Signed-off-by: Tom Zanussi Acked-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/r/90ea854dfb728390b50ddf8a8675238973ee014a.camel@kernel.org Signed-off-by: Jonathan Corbet commit dd9a41bc61cc62d38306465ed62373b98df0049e Author: Flavio Suligoi Date: Tue May 19 10:41:28 2020 +0200 docs: acpi: fix old http link and improve document format The website: http://wiki.minnowboard.org doesn't exist anymore. The same pages are moved to: https://www.elinux.org/Minnowboard Other improvements concern the introduction of some rst semantic markup in the document. Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/20200519084128.12756-2-f.suligoi@asem.it Signed-off-by: Jonathan Corbet commit 2dcc51b3fe1708d3cda1b3fe9a30c09550791387 Author: Flavio Suligoi Date: Tue May 19 10:41:27 2020 +0200 docs: filesystems: add info about efivars content When an EFI variable is reading from: /sys/firmware/efi/efivars (for example using "hexdump"), the first 4 bytes of the output are not the real EFI variable data, but the variable attributes (in little-endian format). Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/20200519084128.12756-1-f.suligoi@asem.it Signed-off-by: Jonathan Corbet commit e2d467de34228db978683dd1a20fe3fe23018e0c Author: Casey Schaufler Date: Tue Apr 21 14:48:34 2020 -0700 Documentation: LSM: Correct the basic LSM description This is a first pass at updating the basic documentation on Linux Security Modules (LSM), which is frighteningly out of date. Remove untrue statements about the LSM framework. Replace them with true statements where it is convenient to do so. This is the beginnig of a larger effort to bring the LSM documentation up to date. Signed-off-by: Casey Schaufler Link: https://lore.kernel.org/r/4c053d72-2d58-612f-6d6b-f04226d0181e@schaufler-ca.com Signed-off-by: Jonathan Corbet commit cea0fad0f8b41481c0052a1f30d296d6d6dd0b2e Author: Ricardo Ribalda Date: Thu Apr 30 15:52:24 2020 +0200 mailmap: change email for Ricardo Ribalda Modify emails to ribalda@kernel.org and unify my surname in all the files. Signed-off-by: Ricardo Ribalda Link: https://lore.kernel.org/r/20200430135224.362700-1-ricardo@ribalda.com Signed-off-by: Jonathan Corbet commit 997c798e1444ad02e8af8b18c869fff5c61867da Author: Stephen Kitt Date: Fri May 15 23:24:44 2020 +0200 docs: sysctl/kernel: document unaligned controls This documents ignore-unaligned-usertrap, unaligned-dump-stack, and unaligned-trap, based on arch/arc/kernel/unaligned.c, arch/ia64/kernel/unaligned.c, and arch/parisc/kernel/unaligned.c. While we're at it, integrate unaligned-memory-access.txt into the docs tree. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200515212443.5012-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit 4eb9241127a0b5ac3aaaf1b246728009527ebc86 Author: Randy Dunlap Date: Sat May 16 20:43:39 2020 -0700 Documentation: admin-guide: update bug-hunting.rst Update Documentation/admin-guide/bug-hunting.rst: - add a small section on "Modules linked in" and their possible flags; - delete all references to ksymoops since it is no longer applicable; - fix spello, grammar, and punctuation; - note that get_maintainers.pl only provides recent patchers if it is run inside a git tree; - add mention of scripts/decode_stacktrace.sh; Signed-off-by: Randy Dunlap Cc: greg@wind.rmcc.com Link: https://lore.kernel.org/r/c629a9ef-3867-c3d1-f6c9-2c3b0e4ac68a@infradead.org Signed-off-by: Jonathan Corbet commit 17444d9b0b5bf7ba1d7e19411d0cb5883eac40b4 Author: Stephen Kitt Date: Mon May 18 16:58:36 2020 +0200 docs: sysctl/kernel: document ngroups_max This is a read-only export of NGROUPS_MAX. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200518145836.15816-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit eabd5c9dd0c0b8d471d144801c8302a4eff6eb27 Author: Richard Cochran Date: Sun May 24 11:27:10 2020 -0700 ptp_clock: Let the ADJ_OFFSET interface respect the ADJ_NANO flag for PHC devices. In commit 184ecc9eb260d5a3bcdddc5bebd18f285ac004e9 ("ptp: Add adjphase function to support phase offset control.") the PTP Hardware Clock interface expanded to support the ADJ_OFFSET offset mode. However, the implementation did not respect the traditional yet pedantic distinction between units of microseconds and nanoseconds signaled by the ADJ_NANO flag. This patch fixes the issue by adding logic to handle that flag. Signed-off-by: Richard Cochran Reviewed-by: Vincent Cheng Signed-off-by: David S. Miller commit 45af29ca761c275e350cca659856bc56f1035ef9 Author: Eric Dumazet Date: Sun May 24 11:00:02 2020 -0700 tcp: allow traceroute -Mtcp for unpriv users Unpriv users can use traceroute over plain UDP sockets, but not TCP ones. $ traceroute -Mtcp 8.8.8.8 You do not have enough privileges to use this traceroute method. $ traceroute -n -Mudp 8.8.8.8 traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets 1 192.168.86.1 3.631 ms 3.512 ms 3.405 ms 2 10.1.10.1 4.183 ms 4.125 ms 4.072 ms 3 96.120.88.125 20.621 ms 19.462 ms 20.553 ms 4 96.110.177.65 24.271 ms 25.351 ms 25.250 ms 5 69.139.199.197 44.492 ms 43.075 ms 44.346 ms 6 68.86.143.93 27.969 ms 25.184 ms 25.092 ms 7 96.112.146.18 25.323 ms 96.112.146.22 25.583 ms 96.112.146.26 24.502 ms 8 72.14.239.204 24.405 ms 74.125.37.224 16.326 ms 17.194 ms 9 209.85.251.9 18.154 ms 209.85.247.55 14.449 ms 209.85.251.9 26.296 ms^C We can easily support traceroute over TCP, by queueing an error message into socket error queue. Note that applications need to set IP_RECVERR/IPV6_RECVERR option to enable this feature, and that the error message is only queued while in SYN_SNT state. socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 3 setsockopt(3, SOL_IPV6, IPV6_RECVERR, [1], 4) = 0 setsockopt(3, SOL_SOCKET, SO_TIMESTAMP_OLD, [1], 4) = 0 setsockopt(3, SOL_IPV6, IPV6_UNICAST_HOPS, [5], 4) = 0 connect(3, {sa_family=AF_INET6, sin6_port=htons(8787), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2002:a05:6608:297::", &sin6_addr), sin6_scope_id=0}, 28) = -1 EHOSTUNREACH (No route to host) recvmsg(3, {msg_name={sa_family=AF_INET6, sin6_port=htons(8787), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2002:a05:6608:297::", &sin6_addr), sin6_scope_id=0}, msg_namelen=1024->28, msg_iov=[{iov_base="`\r\337\320\0004\6\1&\7\370\260\200\231\16\27\0\0\0\0\0\0\0\0 \2\n\5f\10\2\227"..., iov_len=1024}], msg_iovlen=1, msg_control=[{cmsg_len=32, cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD, cmsg_data={tv_sec=1590340680, tv_usec=272424}}, {cmsg_len=60, cmsg_level=SOL_IPV6, cmsg_type=IPV6_RECVERR}], msg_controllen=96, msg_flags=MSG_ERRQUEUE}, MSG_ERRQUEUE) = 144 Suggested-by: Maciej Żenczykowski Cc: Willem de Bruijn Reviewed-by: Maciej Żenczykowski Signed-off-by: David S. Miller commit 880f8f99d12ca89d3ec76f688e0d92612054cbb1 Author: Eric Dumazet Date: Sat May 23 12:46:49 2020 -0700 bnx2x: allow bnx2x_bsc_read() to schedule bnx2x_warpcore_read_sfp_module_eeprom() can call bnx2x_bsc_read() three times before giving up. This causes latency blips of at least 31 ms (58 ms being reported by our teams) Convert the long lasting loops of udelay() to usleep_range() ones, and breaks the loops on precise time tracking. Signed-off-by: Eric Dumazet Cc: Ariel Elior Cc: Sudarsana Kalluru Signed-off-by: David S. Miller commit 6a1015b0b4b1f3a0de9e40d2ba86877d13f50918 Author: Dan Carpenter Date: Sat May 23 20:46:48 2020 +0300 ipv4: potential underflow in compat_ip_setsockopt() The value of "n" is capped at 0x1ffffff but it checked for negative values. I don't think this causes a problem but I'm not certain and it's harmless to prevent it. Fixes: 2e04172875c9 ("ipv4: do compat setsockopt for MCAST_MSFILTER directly") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit ca23cb0bc50faae0d48786b2f9f702dbb528b925 Author: Sven Auhagen Date: Sat May 23 12:14:08 2020 +0200 mvneta: MVNETA_SKB_HEADROOM set last 3 bits to zero For XDP the MVNETA_SKB_HEADROOM is used as an offset for the received data. The MVNETA manual states that the last 3 bits assumed to be 0. This is currently the case but lets make it explicit in the definition to prevent future problems. Signed-off-by: Sven Auhagen Signed-off-by: David S. Miller commit 3ead2f97bd44a9a106572d306cb04a878c569cb2 Author: Chris Packham Date: Tue May 26 11:04:13 2020 +1200 xtensa: Fix spelling/grammar in comment Change 'excpetion' to 'exception', 'handeled' to 'handled' and 'the the' to 'the'. Signed-off-by: Chris Packham Message-Id: <20200525230413.15551-1-chris.packham@alliedtelesis.co.nz> Signed-off-by: Max Filippov commit e1d908a7612806b5a2f71213a918a14149e7f37d Merge: 7b972f383061 4acaa93ef643 Author: Arnd Bergmann Date: Tue May 26 00:32:10 2020 +0200 Merge tag 'hisi-drivers-for-5.8' of git://github.com/hisilicon/linux-hisi into arm/drivers ARM64: hisi: SoC driver updates for 5.8 - Generate consistent behaviour for logic_pio by defining and using generic _inX() and _outX() in asm-generic/io.h which have per-arch overrideable barriers. * tag 'hisi-drivers-for-5.8' of git://github.com/hisilicon/linux-hisi: logic_pio: Use _inX() and _outX() logic_pio: Improve macro argument name io: Provide _inX() and _outX() commit 3908895f412ab081d1ab8ddd90076a41b1abade3 Merge: 28ed0a0b4475 21eb9ec7c3e6 Author: Arnd Bergmann Date: Tue May 26 00:24:39 2020 +0200 Merge tag 'v5.7-next-dts64.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt mt8183: - add PMIC mt6358 - add MMC node mt2712: - enable APDMA for the uart node - add ethernet gmac node mmsys: - change node name to syscon as mmsys no longer represents only clocks but also the DRM subsystem * tag 'v5.7-next-dts64.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: dts: mt2712: add uart APDMA to device tree arm64: dts: mt8183: add mmc node arm64: dts: mt2712: add ethernet device node arm64: dts: mt6358: add PMIC MT6358 related nodes arm64: dts: mt6797: Fix mmsys node name arm64: dts: mt8173: Fix mmsys node name Link: https://lore.kernel.org/r/7c9f85c7-5b13-38e3-7a1f-a3cd6461b095@gmail.com Signed-off-by: Arnd Bergmann commit 28ed0a0b4475ec0cc811d46842462c2becca1e18 Merge: d39b6ae4be3f 48ffd4ebc1da Author: Arnd Bergmann Date: Tue May 26 00:23:39 2020 +0200 Merge tag 'imx-dt64-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm64 device tree changes: - New support of Beacon i.MX8m-Mini development kit. - Add secondary cpus supply on imx8mm-evk and imx8mn-ddr4-evk for completeness. - Add thermal zones for imx8mp and lx2160a, PMIC thermal zone for imx8qxp-mek board. - Update VDD_ARM 1.2GHz setpoint voltage for imx8mn. - Add SRC device interrupt for i.MX8 SoCs. - Use 0.9V for VDD_GPU on imx8mq-librem5-devkit, since there is no need to support overclocking to 1GHz. - Update imx8qxp SCU device to use MU channel with less interrupt triggering, one RX interrupt for a RX and one TX interrupt for a TX. - Specify DMA channels for LS1028A DSPI controllers. - Add QE and DS26522 device support for fsl-ls1043a-rdb board. - Misc random update and cleanup. * tag 'imx-dt64-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (25 commits) arm64: dts: Add ds26522 node to dts to ls1043ardb arm64: dts: add qe node to ls1043ardb arm64: dts: ls1028a: sl28: keep switch port names consistent arm64: dts: imx8mp: Add src node interrupts arm64: dts: imx8mq: Add src node interrupts arm64: dts: imx8m: assign clocks for A53 arm64: dts: freescale: sl28: enable LPUART1 arm64: dts: ls1043a-rdb: add compatible for board arm64: dts: imx8mp: add "fsl,imx6sx-fec" compatible string arm64: dts: imx8qxp-mek: Do not use underscore in node name arm64: dts: fsl: add fsl,extts-fifo property for fman ptp arm64: dts: imx8mn: Update VDD_ARM 1.2GHz setpoint voltage arm64: dts: lx2160a: add more thermal zone support arm64: dts: imx8qxp-mek: Add PMIC thermal zone support arm64: dts: imx8qxp-mek: Sort labels alphabetically arm64: dts: imx8mm: specify #sound-dai-cells for SAI nodes arm64: dts: imx8qxp: support scu mailbox channel arm64: dts: imx8mp: Add thermal zones support arm64: dts: ls1012a: Add QSPI node properties arm64: dts: imx: Add Beacon i.MX8m-Mini development kit ... Link: https://lore.kernel.org/r/20200523032516.11016-5-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit d39b6ae4be3f57bfea5b36d81e88dd5429086ddf Merge: 48d44c2e5f30 103515d91832 Author: Arnd Bergmann Date: Tue May 26 00:22:39 2020 +0200 Merge tag 'imx-dt-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX device tree changes for 5.8: - A series from Anson Huang updating SRC devices to match bindings schema definition. - Correct CPU supply name and add cpu1 supply for i.MX7D. - Convert thermal device to use nvmem interface to get fuse data for imx6qdl and imx6sl. - A series from Tim Harvey to update imx6qdl-gw devices, adding support of LSM9DS1 IIO imu/magn, USB OTG, bcm4330-bt, etc. - Add input MUX for ENET2 MDIO into IMX7D pin functions. - Misc random device addition or update. * tag 'imx-dt-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (22 commits) ARM: dts: imx53-cx9020: Group port definitions for the dvi-converter ARM: dts: imx5: make src node name generic ARM: dts: imx50: Add src node interrupt ARM: dts: imx: make src node name generic ARM: dts: imx7d-pinfunc: add input mux for ENET2 mdio ARM: dts: imx6sl: Use nvmem interface to get fuse data ARM: dts: imx6qdl: Use nvmem interface to get fuse data ARM: dts: imx6qdl-gw5910: fix wlan regulator ARM: dts: imx6qdl-gw5910: add support for bcm4330-bt ARM: dts: imx6qdl-gw5904: add lsm9ds1 iio imu/magn support ARM: dts: imx6qdl-gw560x: add lsm9ds1 iio imu/magn support ARM: dts: imx53: Add src node interrupt ARM: dts: imx51: Add src node interrupt ARM: dts: imx50: Remove unused iomuxc-gpr node ARM: dts: imx6qdl-gw552x: add USB OTG support ARM: dts: imx6-sr-som: add ethernet PHY configuration arm: dts: ls1021atwr: Add QSPI node properties ARM: dts: e60k02: add interrupt for PMIC ARM: dts: colibri: introduce device trees with UHS-I support ARM: dts: imx7d: Add cpu1 supply ... Link: https://lore.kernel.org/r/20200523032516.11016-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 48d44c2e5f305a3bab92b9901384d62c463be6e4 Merge: 4cafc5d9c9db 9c4b24db828a Author: Arnd Bergmann Date: Tue May 26 00:22:14 2020 +0200 Merge tag 'imx-bindings-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX bindings change for 5.8: - Add Kontron SMARC module compatibles to DT schema. - Add Colibri iMX6S/DL V1.1x devicetree compatibles. * tag 'imx-bindings-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: arm: imx: add kontron smarc to schema dt-bindings: arm: fsl: add nxp based toradex colibri bindings Link: https://lore.kernel.org/r/20200523032516.11016-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 4cafc5d9c9dbca9b84b2494eb6677271a5eb5ddb Merge: 34a07a8da3a0 358a6777f5dd Author: Arnd Bergmann Date: Tue May 26 00:21:15 2020 +0200 Merge tag 'tegra-for-5.8-arm64-dt-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt arm64: tegra: Device tree changes for v5.8-rc1 This contains a couple of fixes for minor issues, enables XUDC support on Tegra194, and enables EMC frequency scaling and video capture on Tegra210. * tag 'tegra-for-5.8-arm64-dt-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Make the RTC a wakeup source on Jetson Nano and TX1 arm64: tegra: Make the RTC a wakeup source on Jetson TX2 arm64: tegra: Enable VI I2C on Jetson Nano arm64: tegra: Fix flag for 64-bit resources in 'ranges' property arm64: tegra: Add Tegra VI CSI support in device tree arm64: tegra: Add reset-cells to memory controller arm64: tegra: Fix SOR powergate clocks and reset arm64: tegra: Allow the PMIC RTC to wakeup Jetson Xavier arm64: tegra: Fix ethernet phy-mode for Jetson Xavier arm64: tegra: Hook up EMC cooling device arm64: tegra: Add external memory controller node for Tegra210 arm64: tegra: Add XUDC node on Tegra194 arm64: tegra: Kill off "simple-panel" compatibles Link: https://lore.kernel.org/r/20200522142846.2376224-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 34a07a8da3a0cafe3799f74a76597081fd184842 Merge: 06273547dddc 0b928e4e412b Author: Arnd Bergmann Date: Tue May 26 00:20:16 2020 +0200 Merge tag 'amlogic-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/dt arm64: dts: Amlogic updates for v5.8 Highlights: - new boards :Beelink GT-King Pro (G12B SoC), Smartlabs SML-5442TW (S905D), Hardkernel ODROID-C4 (SM1) - audio: support for GX-family SoCs - audio: internal DAC support - use the new USB control driver for GXL and GXM * tag 'amlogic-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: (33 commits) arm64: dts: meson-g12b-gtking-pro: add initial device-tree dt-bindings: arm: amlogic: add support for the Beelink GT-King Pro arm64: dts: meson-g12b-gtking: add initial device-tree dt-bindings: arm: amlogic: add support for the Beelink GT-King arm64: dts: meson: convert ugoos-am6 to common w400 dtsi arm64: dts: meson: add ethernet interrupt to wetek dtsi arm64: dts: meson: add support for the Smartlabs SML-5442TW dt-bindings: arm: amlogic: add support for the Smartlabs SML-5442TW dt-bindings: add vendor prefix for Smartlabs LLC arm64: dts: meson: g12: add internal DAC glue arm64: dts: meson: g12: add internal DAC arm64: dts: meson: libretech-pc: add internal DAC support arm64: dts: meson: libretech-ac: add internal DAC support arm64: dts: meson: libretech-cc: add internal DAC support arm64: dts: meson: p230-q200: add internal DAC support arm64: dts: meson: gxl: add acodec support arm64: dts: meson-sm1: add support for Hardkernel ODROID-C4 dt-bindings: arm: amlogic: add odroid-c4 bindings arm64: dts: meson-sm1: add cpu thermal nodes arm64: dts: meson-g12b: move G12B thermal nodes to meson-g12b.dtsi ... Link: https://lore.kernel.org/r/5ec6f56a.1c69fb81.fc5d5.9ca6@mx.google.com Signed-off-by: Arnd Bergmann commit 06273547dddc30afd7597eb4df5146bc0200387f Merge: 9eddc06a3bc7 005231128e9e Author: Arnd Bergmann Date: Tue May 26 00:19:42 2020 +0200 Merge tag 'amlogic-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/dt ARM: dts: Amlogic updates for v5.8 - eth PHY and USB PHY updates * tag 'amlogic-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: ARM: dts: meson: Switch existing boards with RGMII PHY to "rgmii-id" ARM: dts: meson: Add the Ethernet "timing-adjustment" clock ARM: dts: meson8m2: Use the Meson8m2 specific USB2 PHY compatible ARM: dts: meson: add the gadget mode properties to the USB0 controller Link: https://lore.kernel.org/r/5ec6f524.1c69fb81.b979a.ae15@mx.google.com Signed-off-by: Arnd Bergmann commit f11d7cb47f157b6af61cea8e4c571c8f81d670b4 Merge: 8ce538ef2b60 5b4bf802427e Author: Arnd Bergmann Date: Tue May 26 00:17:11 2020 +0200 Merge tag 'imx-defconfig-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/defconfig i.MX defconfig update for 5.8: - Enable RTC and ADC support of RN5T618 PMIC in imx_v6_v7_defconfig. - Enable i.MX8DXL pinctrl driver support in arm64 defconfig. * tag 'imx-defconfig-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: extend RN5T618 PMIC family support arm64: defconfig: Enable CONFIG_PINCTRL_IMX8DXL by default Link: https://lore.kernel.org/r/20200523032516.11016-6-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 8ce538ef2b6071ad05f0dc21eb7742ebf2d342fc Merge: fec6111ae322 fa4aa8a530b2 Author: Arnd Bergmann Date: Tue May 26 00:15:00 2020 +0200 Merge tag 'arm64_defconfig_for_v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/defconfig ARM64 defconfig update for v5.8 - Add LEDS_TRIGGER_TIMER * tag 'arm64_defconfig_for_v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: defconfig: Add LEDS_TRIGGER_TIMER Link: https://lore.kernel.org/r/20200515193029.11318-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 063731c87a2c6c1caf42482c05349763ea87d3a7 Merge: ac7864936a91 0b973c65d2f2 Author: Arnd Bergmann Date: Tue May 26 00:13:21 2020 +0200 Merge tag 'v5.8-rockchip-soc32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/soc A spelling fix and stop using clk_provider.h when of_clk.h is enough as the soc file is only a clock user, not a provider. * tag 'v5.8-rockchip-soc32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: rockchip: fix spelling mistake "to" -> "too" ARM: rockchip: Replace by Link: https://lore.kernel.org/r/2307012.mB7vfBFN1M@phil Signed-off-by: Arnd Bergmann commit ac7864936a918ff023261040bfa9fe31e51506ec Merge: 24320a7ff39e b5321c304eb5 Author: Arnd Bergmann Date: Tue May 26 00:11:55 2020 +0200 Merge tag 'mvebu-arm-5.8-1' of git://git.infradead.org/linux-mvebu into arm/soc mvebu arm for 5.8 (part 1) Update MAINTAINERS file for Dove * tag 'mvebu-arm-5.8-1' of git://git.infradead.org/linux-mvebu: MAINTAINERS: clarify maintenance of ARM Dove drivers Link: https://lore.kernel.org/r/87eereefic.fsf@FE-laptop Signed-off-by: Arnd Bergmann commit 24320a7ff39e2f3e79e6d26c33875dfc664f1854 Author: Robert Jarzmik Date: Thu May 21 20:51:38 2020 +0200 MAINTAINERS: pxa: remove Compulab arm/pxa support These boards support is removed from the kernel, so remove the MAINTAINERS entry for them. Link: https://lore.kernel.org/r/20200521185140.27276-2-robert.jarzmik@free.fr Signed-off-by: Robert Jarzmik Acked-by: Mike Rapoport Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit 9d3239147d6d44dd6fd3c13338dcc3ce36c442ef Author: Robert Jarzmik Date: Thu May 21 20:51:37 2020 +0200 ARM: pxa: remove Compulab pxa2xx boards As these boards have no more users nor testers, and patching them has become a burden, be that because of the PCI part or the MTD NAND support, let's remove them. The cm-x300 will for now remain and represent Compulab boards at its best in the PXA department. Link: https://lore.kernel.org/r/20200521185140.27276-1-robert.jarzmik@free.fr Signed-off-by: Robert Jarzmik Acked-by: Mike Rapoport Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit 803b504bf5527775d00a45182fd996e6dd665e8c Merge: 66ee9359b0d4 1a5428119bc3 Author: Arnd Bergmann Date: Tue May 26 00:04:19 2020 +0200 Merge tag 'omap-for-v5.8/timer-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc System timer changes for omaps for v5.8 merge window This series of changes finally gets the legacy omap dual-mode timer and 32k counter system timer updated to use drivers/clocksource and device tree data. And we can now remove the unused legacy platform data. These changes are based on an immutable clocksource branch set up by Daniel Lezcano. * tag 'omap-for-v5.8/timer-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: bus: ti-sysc: Timers no longer need legacy quirk handling ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter ARM: dts: Configure system timers for omap2 ARM: dts: Configure system timers for ti81xx ARM: dts: Configure system timers for omap3 ARM: dts: Configure system timers for omap5 and dra7 ARM: dts: Configure system timers for omap4 ARM: dts: Configure system timers for am437x ARM: dts: Configure system timers for am335x ARM: OMAP2+: Add omap_init_time_of() bus: ti-sysc: Ignore timer12 on secure omap3 clk: ti: dm816: enable sysclk6_ck on init clocksource/drivers/timer-ti-dm: Fix warning for set but not used clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support clocksource/drivers/timer-ti-32k: Add support for initializing directly Link: https://lore.kernel.org/r/pull-1590169577-735045@atomide.com Signed-off-by: Arnd Bergmann commit 66ee9359b0d43b1ba3c3548c9e20789ab9da3365 Merge: 97a2f40e3801 52102a3ba6a6 Author: Arnd Bergmann Date: Tue May 26 00:03:12 2020 +0200 Merge tag 'imx-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/soc i.MX SoC changes for 5.8: - Add soc device support for Vybrid/VF platform. - Move the i.MX soc device registration code from mach-imx to drivers/soc/imx for possible future consolidation with i.MX8 code. - A small fixup to make pcm970_sja1000_platform_data static. * tag 'imx-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: move cpu code to drivers/soc/imx ARM: imx: move cpu definitions into a header ARM: imx: use device_initcall for imx_soc_device_init ARM: imx: pcm037: make pcm970_sja1000_platform_data static ARM: vf610: report soc info via soc device Link: https://lore.kernel.org/r/20200523032516.11016-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 97a2f40e3801905c7221df8ce2f2231632ce8ce4 Author: Wei Yongjun Date: Mon May 25 11:16:34 2020 +0200 bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe() In case of error, the function of_find_matching_node() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Link: https://lore.kernel.org/r/20200525091634.8274-1-linus.walleij@linaro.org Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200520032150.165388-1-weiyongjun1@huawei.com Signed-off-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 7b972f383061b8a527f3af52bc9beeb50083616a Merge: e26552c5e054 89f12d6509bf Author: Arnd Bergmann Date: Tue May 26 00:00:46 2020 +0200 Merge tag 'imx-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers i.MX drivers update for 5.8: - Optimize imx-scu driver to use one TX and one RX instead of four for talking to SCU. - Fix one possible message header corruption where the response is longer than the request. - Move System Control defines into dt-bindings header, so that DT can use them as well. - A couple of small fixups. * tag 'imx-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: firmware: imx: scu: Fix possible memory leak in imx_scu_probe() dt-bindings: firmware: imx: Add more system controls and PM clock types dt-bindings: firmware: imx: Move system control into dt-binding headfile firmware: imx: scu: Fix corruption of header firmware: imx-scu: Support one TX and one RX soc: imx8m: No need to put node when of_find_compatible_node() failed Link: https://lore.kernel.org/r/20200523032516.11016-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit e26552c5e054efe54242ce110aca79cc36033848 Merge: 9ffc30a66da1 df701a76a641 Author: Arnd Bergmann Date: Mon May 25 23:57:13 2020 +0200 Merge tag 'tegra-for-5.8-soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers soc/tegra: Changes for v5.8-rc1 Enables Tegra210, Tegra186 and Tegra194 to be woken from suspend by the PMIC and exports a bit more information about SoCs via sysfs. * tag 'tegra-for-5.8-soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Enable PMIC wake event on Tegra210 soc: tegra: Fix tegra_pmc_get_suspend_mode definition soc/tegra: pmc: Enable PMIC wake event on Tegra194 soc/tegra: pmc: Select GENERIC_PINCONF soc/tegra: fuse: Update the SoC revision attribute to display a name soc/tegra: fuse: Trivial clean-up of tegra_init_revision() soc/tegra: fuse: Add custom SoC attributes soc/tegra: pmc: Enable PMIC wake event on Tegra186 Link: https://lore.kernel.org/r/20200522142846.2376224-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 9ffc30a66da1653e4ce0cb58f6289a31584b6f9b Merge: 19207ea8e099 ba8f6682bcb3 Author: Arnd Bergmann Date: Mon May 25 23:28:35 2020 +0200 Merge tag 'tegra-for-5.8-media' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers media: tegra: Changes for v5.8-rc1 This contains a V4L2 video capture driver for Tegra210. * tag 'tegra-for-5.8-media' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: media: tegra-video: Do not enable COMPILE_TEST MAINTAINERS: correct path in TEGRA VIDEO DRIVER media: tegra-video: Make tegra210_video_formats static MAINTAINERS: Add Tegra Video driver section media: tegra-video: Add Tegra210 Video input driver dt-bindings: i2c: tegra: Document Tegra210 VI I2C dt-bindings: tegra: Add VI and CSI bindings dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30 dt-bindings: memory: tegra: Add external memory controller binding for Tegra210 dt-bindings: clock: tegra: Remove PMC clock IDs dt-bindings: clock: tegra: Add clock ID for CSI TPG clock Link: https://lore.kernel.org/r/20200515145311.1580134-7-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 19207ea8e09914c63a330de8282fc45333cddae2 Merge: 2e60fac70375 4a470f00e10e Author: Arnd Bergmann Date: Mon May 25 23:27:17 2020 +0200 Merge tag 'tegra-for-5.8-of' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers of: Changes for v5.8-rc1 These changes add support for multiple reserved-memory regions per device. * tag 'tegra-for-5.8-of' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: of: Make self-contained of: reserved-memory: Support multiple regions per device of: reserved-memory: Support lookup of regions by name Link: https://lore.kernel.org/r/20200515145311.1580134-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 2e60fac703757e9da2682005d5aff1eceb9710f4 Merge: 9b127573b409 fafd62e76880 Author: Arnd Bergmann Date: Mon May 25 23:26:02 2020 +0200 Merge tag 'tegra-for-5.8-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers cpuidle: Changes for v5.8-rc1 These changes add support for cluster power-down on Tegra30. * tag 'tegra-for-5.8-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: cpuidle: tegra: Support CPU cluster power-down state on Tegra30 ARM: tegra: Do not fully reinitialize L2 on resume ARM: tegra: Initialize r0 register for firmware wake-up Link: https://lore.kernel.org/r/20200515145311.1580134-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 9b127573b40939ad8a3f2116ca2863d07ae655d4 Merge: 84684272394e 9ce274630495 Author: Arnd Bergmann Date: Mon May 25 23:24:55 2020 +0200 Merge tag 'tegra-for-5.8-cpufreq' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers cpufreq: Changes for v5.8-rc1 This change move Tegra20 and Tegra30 to the generic DT CPU frequency scaling driver. * tag 'tegra-for-5.8-cpufreq' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: cpufreq: tegra20: Use generic cpufreq-dt driver (Tegra30 supported now) Link: https://lore.kernel.org/r/20200515145311.1580134-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 84684272394e5b5013612910939ca5112bfcf1e0 Merge: 502afe7f0432 108c31e77594 Author: Arnd Bergmann Date: Mon May 25 23:23:16 2020 +0200 Merge tag 'samsung-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers Samsung SoC drivers changes for v5.8 Fix and minor cleanup of Exynos5422 DMC (Dynamic Memory Controller) driver. * tag 'samsung-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: memory: samsung: exynos5422-dmc: Reduce protected code area in IRQ handler memory: samsung: exynos5422-dmc: Fix tFAW timings alignment Link: https://lore.kernel.org/r/20200519070111.6265-1-krzk@kernel.org Signed-off-by: Arnd Bergmann commit 502afe7f0432248c9ee18263f404cf491d91f604 Merge: 372542d708e5 1f7a3eb785e4 Author: Arnd Bergmann Date: Mon May 25 23:19:05 2020 +0200 Merge tag 'qcom-drivers-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers Qualcomm driver updates for v5.8 This contains a large set of cleanups, bug fixes, general improvements and documentation fixes for the RPMH driver. It adds a debugfs mechanism for inspecting Command DB. Socinfo got the "soc_id" attribute defines and definitions for a various variants of MSM8939. RPMH, RPMPD and RPMHPD where made possible to build as modules, but RPMH had to be reverted due to a compilation issue when tracing is enabled. RPMHPD gained power-domains for the SM8250 voltage corners. The SCM driver gained fixes for two build warnings and the SMP2P had an unnecessary error print removed. * tag 'qcom-drivers-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (42 commits) Revert "soc: qcom: rpmh: Allow RPMH driver to be loaded as a module" soc: qcom: rpmh-rsc: Remove the pm_lock soc: qcom: rpmh-rsc: Simplify locking by eliminating the per-TCS lock kernel/cpu_pm: Fix uninitted local in cpu_pm soc: qcom: rpmh-rsc: We aren't notified of our own failure w/ NOTIFY_BAD soc: qcom: rpmh-rsc: Correctly ignore CPU_CLUSTER_PM notifications firmware: qcom_scm-legacy: Replace zero-length array with flexible-array soc: qcom: rpmh-rsc: Timeout after 1 second in write_tcs_reg_sync() soc: qcom: rpmh-rsc: Factor "tcs_reg_addr" and "tcs_cmd_addr" calculation soc: qcom: socinfo: add msm8936/39 and apq8036/39 soc ids soc: qcom: aoss: Add SM8250 compatible soc: qcom: pdr: Remove impossible error condition soc: qcom: rpmh: Dirt can only make you dirtier, not cleaner soc: qcom: rpmhpd: Add SM8250 power domains firmware: qcom_scm: fix bogous abuse of dma-direct internals dt-bindings: soc: qcom: apr: Use generic node names for APR services firmware: qcom_scm: Remove unneeded conversion to bool soc: qcom: cmd-db: Properly endian swap the slv_id for debugfs soc: qcom: cmd-db: Use 5 digits for printing address soc: qcom: cmd-db: Cast sizeof() to int to silence field width warning ... Link: https://lore.kernel.org/r/20200519052533.1250024-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 372542d708e568ae137a650f9f22e4a6287013e9 Merge: be4ad166b4e2 32956dda9757 Author: Arnd Bergmann Date: Mon May 25 23:17:07 2020 +0200 Merge tag 'v5.7-next-soc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/drivers - make mmsys kconfig entry to depend on ARCH_MEDIATEK instead of a specific SoC - move clock driver to bind against the new mmsys driver (mt2712, mt2701, mt8183, mt6797 and mt6779) * tag 'v5.7-next-soc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: clk/soc: mediatek: mt6779: Bind clock driver from platform device clk/soc: mediatek: mt6797: Bind clock driver from platform device clk/soc: mediatek: mt8183: Bind clock driver from platform device clk / soc: mediatek: Bind clock and gpu driver for mt2701 clk / soc: mediatek: Bind clock and gpu driver for mt2712 soc: mediatek: Enable mmsys driver by default if Mediatek arch is selected Link: https://lore.kernel.org/r/d2eb19f4-589a-89c1-02ad-9f19a6cfb09a@gmail.com Signed-off-by: Arnd Bergmann commit be4ad166b4e229ba7f129c5e3bd5ff0347652422 Merge: 0417a5c6a4c5 c5b4312bea5d Author: Arnd Bergmann Date: Mon May 25 23:15:02 2020 +0200 Merge tag 'tee-login-for-5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers Adds utility function in TEE subsystem for client UUID generation. This function is also used in the optee driver. * tag 'tee-login-for-5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: Add support for session login client UUID generation tee: add support for session's client UUID generation Link: https://lore.kernel.org/r/20200512131243.GA10028@jade Signed-off-by: Arnd Bergmann commit ebd6e96b33a23fe84d1a64441a04d7bc91ccc519 Author: Kamal Heib Date: Mon May 25 16:03:05 2020 +0300 RDMA/ipoib: Remove can_sleep parameter from iboib_mcast_alloc can_sleep is always 0 when iboib_mcast_alloc() is called, so remove it and use GFP_ATOMIC instead of GFP_KERNEL. Link: https://lore.kernel.org/r/20200525130305.171509-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 49ea0c036ede81f126f1a9389d377999fdf5c5a1 Author: Potnuri Bharat Teja Date: Mon May 25 00:38:14 2020 +0530 RDMA/iw_cxgb4: cleanup device debugfs entries on ULD remove Remove device specific debugfs entries immediately if LLD detaches a particular ULD device in case of fatal PCI errors. Link: https://lore.kernel.org/r/20200524190814.17599-1-bharat@chelsio.com Signed-off-by: Potnuri Bharat Teja Signed-off-by: Jason Gunthorpe commit e1b43f07c0d4c82fd5591ae24d045fee2b00edf3 Author: Yixian Liu Date: Fri May 22 21:02:59 2020 +0800 RDMA/hns: Make the end of sge process more clear Instead of i with the sge number of wr will make the comparision more clear, that is, when the sge number in wr is small than the maximum supported sge number in the queue, then a stop sge needed to be filled at the end of sges in wr. Link: https://lore.kernel.org/r/1590152579-32364-5-git-send-email-liweihang@huawei.com Signed-off-by: Yixian Liu Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit e4aaf4bad4651358a923ad756f8b0c9d447ea21f Author: Lang Cheng Date: Fri May 22 21:02:58 2020 +0800 RDMA/hns: Simplify process related to poll cq Set hns_roce_v2_cq_set_ci to inline type and remove unnecessary next_cqe_sw_v2(). Link: https://lore.kernel.org/r/1590152579-32364-4-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit f226f6765f7fe435e033da67698565ca876c2b8d Author: Wenpeng Liang Date: Fri May 22 21:02:57 2020 +0800 RDMA/hns: Remove redundant parameters from free_srq/qp_wrid() The redundant parameters "hr_dev" need to be removed from free_kernel_wrid() and free_srq_wrid(). Link: https://lore.kernel.org/r/1590152579-32364-3-git-send-email-liweihang@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 14ba87304bf98a0a0c069708bb14e92a616420d1 Author: Weihang Li Date: Fri May 22 21:02:56 2020 +0800 RDMA/hns: Remove redundant type cast for general pointers There is no need to do a type cast on genernal pointers, they could be assigned to any type of variables. In addition, optimize initialization of some variables and adjust order of them. Link: https://lore.kernel.org/r/1590152579-32364-2-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 8e029d386bcef651bb89091c8a48375c2506aefe Author: Xi Wang Date: Wed May 20 21:53:19 2020 +0800 RDMA/hns: Optimize the usage of MTR Currently, the MTR region is configed before hns_roce_mtr_map() is invoked, but in some scenarios, the region is configed at MTR creation, the caller need to store this config and call hns_roce_mtr_map() later. So optimize the usage by wrapping the MTR region config into MTR. Link: https://lore.kernel.org/r/1589982799-28728-10-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 494c3b312255a39d4450f37ec2e675f142a76c8c Author: Xi Wang Date: Wed May 20 21:53:18 2020 +0800 RDMA/hns: Refactor the QP context filling process related to WQE buffer configure Split the code related to WQE buffer configure from the QPC filling process into two functions: config_qp_sq_buf() and config_qp_rq_buf(), this will make the code more readable. Link: https://lore.kernel.org/r/1589982799-28728-9-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 13aa13dddd5f06d47c35f9de46343e740f7d8b90 Author: Weihang Li Date: Wed May 20 21:53:17 2020 +0800 RDMA/hns: Change variables representing quantity to unsigned Number of sge/eqe is always non-negative, they should be defined in type of unsigned. Link: https://lore.kernel.org/r/1589982799-28728-8-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 82d07a4e466fa2e3cc0ac5479beeb739abaa7438 Author: Weihang Li Date: Wed May 20 21:53:16 2020 +0800 RDMA/hns: Change all page_shift to unsigned page_shift is used to calculate the page size, it's always non-negative, and should be in type of unsigned. Link: https://lore.kernel.org/r/1589982799-28728-7-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit e9f2cd28250cd9e77db2c0dc8efe0412f6971a76 Author: Xi Wang Date: Wed May 20 21:53:15 2020 +0800 RDMA/hns: Rename QP buffer related function Rename the function related to QP buffer to make the code more readable. Link: https://lore.kernel.org/r/1589982799-28728-6-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit b9c93e3aad13048c673999e65acbde0378600317 Author: Yangyang Li Date: Wed May 20 21:53:14 2020 +0800 RDMA/hns: Remove unused code about assert The codes related to assert are no longer used and need to be deleted. Link: https://lore.kernel.org/r/1589982799-28728-5-git-send-email-liweihang@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 0db6570947f43a39664ab8665f58101f112cedf3 Author: Lang Cheng Date: Wed May 20 21:53:13 2020 +0800 RDMA/hns: Optimize post and poll process Add unlikely() and likely() to optimize main I/O process code. Link: https://lore.kernel.org/r/1589982799-28728-4-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 05e6a5a63579d4c55cc996e5148bd6da9ed48860 Author: Lang Cheng Date: Wed May 20 21:53:12 2020 +0800 RDMA/hns: Add CQ flag instead of independent enable flag It's easier to understand and maintain enable flags of cq using a single field in type of u32 than defining a field for every flags in the structure hns_roce_cq, and we can add new flags for features more conveniently in the future. Link: https://lore.kernel.org/r/1589982799-28728-3-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 25966e893143f1cf9b1294bc6e33e3a6b51ed2ad Author: Lang Cheng Date: Wed May 20 21:53:11 2020 +0800 RDMA/hns: Let software PI/CI grow naturally The hardware can truncate PI/CI when posting or polling, the driver does not need to do truncation. Therefore keep the software's PI/CI consistent with it in the hardware. Link: https://lore.kernel.org/r/1589982799-28728-2-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit f45ab53f7aed660302bcc69ac86af23b439d5ede Author: Randy Dunlap Date: Thu May 21 09:51:37 2020 -0700 nvdimm: fixes to maintainter-entry-profile Fix punctuation and wording in a few places. Signed-off-by: Randy Dunlap Cc: Dan Williams Link: https://lore.kernel.org/r/103a0e71-28b5-e4c2-fdf2-80d2dd005b44@infradead.org Signed-off-by: Jonathan Corbet commit 5f7859c1cfaeeb1677075a72e36a0f0e8b05e9a8 Author: Björn Töpel Date: Sat May 23 23:00:05 2020 +0200 Documentation/features: Correct RISC-V kprobes support entry The Documentation/features/debug/kprobes/arch-support.txt incorrectly states that RISC-V has kprobes support. This is not the case. Note that entries that have been incorrectly marked with 'ok' will not be changed back to 'TODO' by the features-refresh.sh script. Fixes: 7156fc292850 ("Documentation/features: Refresh the arch support status files in place") Signed-off-by: Björn Töpel Link: https://lore.kernel.org/r/20200523210005.59140-1-bjorn.topel@gmail.com Signed-off-by: Jonathan Corbet commit 75a49a5e4f92d38d99b1d6b24cf9bbf0a6c05791 Author: Björn Töpel Date: Sat May 23 21:11:35 2020 +0200 Documentation/features: Refresh the arch support status files I was manually editing the arch-support.txt for eBPF-JIT, when I realized the refresh script [1] has not been run for a while. Let's fix that, so that the entries are more up-to-date. [1] Documentation/features/scripts/features-refresh.sh Signed-off-by: Björn Töpel Link: https://lore.kernel.org/r/20200523191135.21889-1-bjorn.topel@gmail.com Signed-off-by: Jonathan Corbet commit 140fd4ac78d385e6c8e6a5757585f6c707085f87 Author: Hill Ma Date: Sat Apr 25 13:06:41 2020 -0700 x86/reboot/quirks: Add MacBook6,1 reboot quirk On MacBook6,1 reboot would hang unless parameter reboot=pci is added. Make it automatic. Signed-off-by: Hill Ma Signed-off-by: Borislav Petkov Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200425200641.GA1554@cslab.localdomain commit 0a78791c0d12fcd5d3f486668defb9ab055e3729 Author: Andrew Scull Date: Tue May 19 11:40:36 2020 +0100 KVM: arm64: Remove obsolete kvm_virt_to_phys abstraction This abstraction was introduced to hide the difference between arm and arm64 but, with the former no longer supported, this abstraction can be removed and the canonical kernel API used directly instead. Signed-off-by: Andrew Scull Signed-off-by: Marc Zyngier CC: Marc Zyngier CC: James Morse CC: Suzuki K Poulose Link: https://lore.kernel.org/r/20200519104036.259917-1-ascull@google.com commit 438f711ce1d889632467be80779c8f5762b107d7 Author: David Brazdil Date: Fri May 15 16:25:50 2020 +0100 KVM: arm64: Fix incorrect comment on kvm_get_hyp_vector() The comment used to say that kvm_get_hyp_vector is only called on VHE systems. In fact, it is also called from the nVHE init function cpu_init_hyp_mode(). Fix the comment to stop confusing devs. Signed-off-by: David Brazdil Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200515152550.83810-1-dbrazdil@google.com commit 71b3ec5f221b8b3ff545639be83ddfcd5d7c9800 Author: David Brazdil Date: Fri May 15 16:20:56 2020 +0100 KVM: arm64: Clean up cpu_init_hyp_mode() Pull bits of code to the only place where it is used. Remove empty function __cpu_init_stage2(). Remove redundant has_vhe() check since this function is nVHE-only. No functional changes intended. Signed-off-by: David Brazdil Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200515152056.83158-1-dbrazdil@google.com commit 454753d9f67ae40b6a2142ddb6b4dbdcc9654aa9 Author: Masahiro Yamada Date: Fri May 22 11:00:02 2020 +0900 kbuild: make modules.order rule consistent with built-in.a built-in.a contains the built-in object paths from the current and sub directories. module.order collects the module paths from the current and sub directories. Make their build rules look more symmetrical. Signed-off-by: Masahiro Yamada commit aaa385ba9afe7aca25a1545a609963ee59b6c76b Author: Masahiro Yamada Date: Fri May 22 11:00:01 2020 +0900 kbuild: rename subdir-obj-y to subdir-builtin I think subdir-builtin is clearer. While I was here, I made its build rule explicit. Signed-off-by: Masahiro Yamada commit 6ba3bcb01393777d38c8b466249e4a3e6ffc8adb Author: Masahiro Yamada Date: Fri May 22 11:00:00 2020 +0900 kbuild: move subdir-obj-y to scripts/Makefile.build Save $(addprefix ...) for subdir-obj-y. Signed-off-by: Masahiro Yamada commit b480fec988b051df792633e99bf622fc63a305f6 Author: Masahiro Yamada Date: Fri May 22 10:59:59 2020 +0900 kbuild: clear KBUILD_MODULES in top Makefile if CONFIG_MODULES=n Do not try to build any module-related artifacts when CONFIG_MODULES is disabled. Signed-off-by: Masahiro Yamada commit e578edc72276280b8fae57f6bf79cb443ceee7a2 Author: Masahiro Yamada Date: Fri May 22 10:59:58 2020 +0900 kbuild: remove ifdef builtin-target / lib-target I do not see a good reason to add ifdef here. Signed-off-by: Masahiro Yamada commit 9504bbe91efc163e4c46496ae790da60353b23b4 Author: Masahiro Yamada Date: Thu May 21 13:31:17 2020 +0900 kbuild: doc: remove documentation about copying Module.symvers around This is a left-over of commit 39808e451fdf ("kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers"). Kbuild no longer supports this way. Signed-off-by: Masahiro Yamada commit 8451791d1ff0fd229e3f5ef267a32423f5b5540f Author: Masahiro Yamada Date: Mon May 11 13:21:49 2020 +0900 kbuild: make module name conflict fatal error I think all the warnings have been fixed by now. Make it a fatal error. Check it before modpost because we need to stop building *.ko files. Also, pass modules.order via a script parameter. Signed-off-by: Masahiro Yamada commit 121c2a137767df5f9f301795e7d3757d1af04b21 Author: Masahiro Yamada Date: Mon May 11 12:50:13 2020 +0900 kbuild: error out if targets prefixed with '__' are directly run Some targets are internal-use only. It is tedious to care about "what if __build_one_by_one is contained in $(MAKECMDGOALS)?" etc. Prefix internal targets with double underscores. Stop parsing Makefile if they are directly run. Signed-off-by: Masahiro Yamada commit 93fdddfefc831981c8cffc3db90275e9b1d8a0e5 Author: Masahiro Yamada Date: Mon May 11 12:50:12 2020 +0900 kbuild: add this-makefile as a shorthand for $(lastword $(MAKEFILE_LIST)) Make it clearer, and self-documenting. Signed-off-by: Masahiro Yamada commit 827365ffdaa9aa9c0b423800c4d0e72b1fbb938e Author: Masahiro Yamada Date: Sun May 10 11:00:44 2020 +0900 gcc-plugins: remove always-false $(if ...) in Makefile This is the remnant of commit c17d6179ad5a ("gcc-plugins: remove unused GCC_PLUGIN_SUBDIR"). The conditional $(if $(findstring /,$(p)),...) is always false because none of plugins contains '/' in the file name. Clean up the code. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook commit 9f64fbdb774838db1445268fa8c46041fb1c28ab Author: Valdis Kletnieks Date: Sat May 9 00:47:19 2020 -0400 bpfilter: document build requirements for bpfilter_umh It's not intuitively obvious that bpfilter_umh is a statically linked binary. Mention the toolchain requirement in the Kconfig help, so people have an easier time figuring out what's needed. Signed-off-by: Valdis Kletnieks Signed-off-by: Masahiro Yamada commit 6ce16f2bc879fb8943d2165f81862c6f89ec1b77 Author: Maninder Singh Date: Fri May 8 16:33:17 2020 +0530 scripts/checkstack.pl: fix arm sp regex if objdump has below entries; c01ed608 : c01ed614: e24ddff7 sub sp, sp, #120 ; 0x78 c01f0d50 : c01f0d50: e24dd094 sub sp, sp, #140 ; 0x8c scripts fails to read stack usage. so making regex $re for ARM similar to aarch64 Co-developed-by: Vaneet Narang Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh Signed-off-by: Masahiro Yamada commit 3311eeebae94b37a21b37af4410bb5e2fe3dc0c0 Author: Maninder Singh Date: Fri May 8 16:33:16 2020 +0530 scripts/checkstack.pl: add arm push handling for stack usage To count stack usage of push {*, fp, ip, lr, pc} instruction in ARM, if FRAME POINTER is enabled. e.g. c01f0d48: e92ddff0 push {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc} c01f0d50 : c01f0d44: e1a0c00d mov ip, sp c01f0d48: e92ddff0 push {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc} c01f0d4c: e24cb004 sub fp, ip, #4 c01f0d50: e24dd094 sub sp, sp, #448 ; 0x1C0 $ cat dump | scripts/checkstack.pl arm 0xc01f0d50 Y []: 448 added subroutine frame work for this. After change: 0xc01f0d500 Y []: 492 Co-developed-by: Vaneet Narang Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh Signed-off-by: Masahiro Yamada commit 572220aad525bd3650f796d7e29cc06d41df4235 Author: Maninder Singh Date: Fri May 8 16:33:15 2020 +0530 scripts/checkstack.pl: Add argument to print stacks greather than value. Add arguments support to print stacks which are greater than argument value only. Co-developed-by: Vaneet Narang Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh Signed-off-by: Masahiro Yamada commit 677f1410e05813fde62d724d9210fce04c505fc7 Author: Maninder Singh Date: Fri May 8 16:33:14 2020 +0530 scripts/checkstack.pl: don't display $dre as different entity currently script prints stack usage for functions in two ways:($re and $dre) dre breaks sorting mechanism. 0xffffa00011f26f88 sunxi_mux_clk_setup.isra.0 [vmlinux]:Dynamic (0x140) .. 0xffffa00011f27210 sunxi_divs_clk_setup [vmlinux]: Dynamic (0x1d0) so we can print it in decimal only. Also address before function name is changed to function start address rather than stack consumption address. Because in next patch, arm has two ways to use stack which can be clubbed and printed in one function only. All symbols whose stack by adding(re and dre) is greater than 100, will be printed. 0xffffa00011f2720c0 sunxi_divs_clk_setup [vmlinux]: 464 ... 0xffffa00011f26f840 sunxi_mux_clk_setup.isra.0 [vmlinux]:320 Co-developed-by: Vaneet Narang Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh Signed-off-by: Masahiro Yamada commit 859c81750130844590a83eff847c6c55e2340ab1 Author: Gustavo A. R. Silva Date: Thu May 7 13:56:01 2020 -0500 modpost,fixdep: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Masahiro Yamada commit 5967577231f9b19acd5a59485e9075964065bbe3 Author: Siddharth Gupta Date: Tue May 5 18:52:37 2020 -0700 scripts: headers_install: Exit with error on config leak Misuse of CONFIG_* in UAPI headers should result in an error. These config options can be set in userspace by the user application which includes these headers to control the APIs and structures being used in a kernel which supports multiple targets. Signed-off-by: Siddharth Gupta Signed-off-by: Masahiro Yamada commit 0663c68c4d2d3b74055b4c1cf7d8ae4782774e53 Author: Masahiro Yamada Date: Mon May 4 17:08:07 2020 +0900 kbuild: remove {CLEAN,MRPROPER,DISTCLEAN}_DIRS Merge {CLEAN,MRPROPER,DISTCLEAN}_DIRS into {CLEAN,MRPROPER,DISTCLEAN}_FILES because the difference is just the -r option passed to the 'rm' command. Do likewise as commit 1634f2bfdb84 ("kbuild: remove clean-dirs syntax"). Signed-off-by: Masahiro Yamada commit 610134b750bb33675864a9041090886cd787bd04 Author: Masahiro Yamada Date: Mon May 4 17:08:06 2020 +0900 kbuild: remove misleading stale FIXME comment This comment was added by commit ("kbuild: Restore build nr, improve vmlinux link") [1]. It was talking about if_changed_rule at that time. Now, it is unclear what to fix. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=ea52ca1b3e3882b499cc6c043f384958b88b62ff Signed-off-by: Masahiro Yamada commit 3044dd05289d6c768c7c5d00f58208fc1f3927f3 Author: Masahiro Yamada Date: Fri May 1 15:01:41 2020 +0900 kbuild: invoke syncconfig if autoconf.h is missing If include/generated/autoconf.h is accidentally lost somehow, there is no clear way to fix it. Make it self-healing. Signed-off-by: Masahiro Yamada commit bcfefb61cd2bc86329915a4074f7b4c48b00b33a Author: Masahiro Yamada Date: Thu Apr 30 15:18:45 2020 +0900 kconfig: announce removal of 'kvmconfig' and 'xenconfig' shorthands kvmconfig' is a shorthand for kvm_guest.config to save 7 character typing. xenconfig' is a shorthand for xen.config to save 1 character typing. There is nothing more than that. There are more files in kernel/configs/, so it is not maintainable to wire-up every config fragment to the Kconfig Makefile. Hence, we should not do this at all. These will be removed after Linux 5.10. Meanwhile, the following warning message will be displayed if they are used. WARNING: 'make kvmconfig' will be removed after Linux 5.10 Please use 'make kvm_guest.config' instead. Signed-off-by: Masahiro Yamada commit 0417a5c6a4c51185fd14a87bf26fa96105ce65a1 Merge: 93f9fb1e4a7e 697fa27dc5fb Author: Arnd Bergmann Date: Mon May 25 17:01:33 2020 +0200 Merge tag 'reset-for-v5.8' of git://git.pengutronix.de/pza/linux into arm/drivers Reset controller updates for v5.8 This tag adds support for i.MX8MP and i.MX8MN SoCs to the i.MX7 reset controller driver, extends the Hi6220 reset driver to support the AO reset controller used to bring the Mali450 GPU out of reset, and adds a define for the internal DAC reset line on Amlogic GXL SoCs. * tag 'reset-for-v5.8' of git://git.pengutronix.de/pza/linux: reset: hi6220: Add support for AO reset controller reset: imx7: Add support for i.MX8MP SoC dt-bindings: reset: imx7: Document usage on i.MX8MP SoC dt-bindings: reset: imx7: Add support for i.MX8MN dt-bindings: reset: meson: add gxl internal dac reset Link: https://lore.kernel.org/r/20200515143844.GA17201@pengutronix.de Signed-off-by: Arnd Bergmann commit 93f9fb1e4a7eb03e6c163b874a22d3db9569b64f Merge: 6d83d800b245 53773f2dfd9c Author: Arnd Bergmann Date: Mon May 25 16:57:24 2020 +0200 Merge tag 'amlogic-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/drivers soc: amlogic: driver updates for v5.8 - support GX SoCs in the EE power-controller driver * tag 'amlogic-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: soc: amlogic: meson-ee-pwrc: add support for the Meson GX SoCs soc: amlogic: meson-ee-pwrc: add support for Meson8/Meson8b/Meson8m2 dt-bindings: power: meson-ee-pwrc: add support for the Meson GX SoCs dt-bindings: power: meson-ee-pwrc: add support for Meson8/8b/8m2 Link: https://lore.kernel.org/r/5ec6f570.1c69fb81.a3753.711b@mx.google.com Signed-off-by: Arnd Bergmann commit 6d83d800b2456122299dcfce4a7da4b86d7cec8e Merge: b4e3b881b983 1115899e7aad Author: Arnd Bergmann Date: Mon May 25 16:56:33 2020 +0200 Merge tag 'tee-smatch-for-5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers tee: remove unnecessary NULL check in tee_shm_alloc() * tag 'tee-smatch-for-5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: remove unnecessary NULL check in tee_shm_alloc() Link: https://lore.kernel.org/r/20200504181333.GA11018@jade Signed-off-by: Arnd Bergmann commit aee67fe879e5030a2f5e1d9af3cb5b2a1027e78a Author: dillon min Date: Mon May 25 11:45:48 2020 +0800 spi: flags 'SPI_CONTROLLER_MUST_RX' and 'SPI_CONTROLLER_MUST_TX' can't be coexit with 'SPI_3WIRE' mode since chip spi driver need get the transfer direction by 'tx_buf' and 'rx_buf' of 'struct spi_transfer' in 'SPI_3WIRE' mode. so, we need bypass 'SPI_CONTROLLER_MUST_RX' and 'SPI_CONTROLLER_MUST_TX' feature in 'SPI_3WIRE' mode Signed-off-by: dillon min Link: https://lore.kernel.org/r/1590378348-8115-9-git-send-email-dillon.minfei@gmail.com Signed-off-by: Mark Brown commit 61367d0b8f5edf5146059ba8b79ce4e4485340b2 Author: dillon min Date: Mon May 25 11:45:47 2020 +0800 spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4 in l3gd20 driver startup, there is a setup failed error return from stm32 spi driver " [ 2.687630] st-gyro-spi spi0.0: supply vdd not found, using dummy regulator [ 2.696869] st-gyro-spi spi0.0: supply vddio not found, using dummy regulator [ 2.706707] spi_stm32 40015000.spi: SPI transfer setup failed [ 2.713741] st-gyro-spi spi0.0: SPI transfer failed: -22 [ 2.721096] spi_master spi0: failed to transfer one message from queue [ 2.729268] iio iio:device0: failed to read Who-Am-I register. [ 2.737504] st-gyro-spi: probe of spi0.0 failed with error -22 " after debug into spi-stm32 driver, st-gyro-spi split two steps to read l3gd20 id first: send command to l3gd20 with read id command in tx_buf, rx_buf is null. second: read id with tx_buf is null, rx_buf not null. so, for second step, stm32 driver recongise this process as 'SPI_SIMPLE_RX' from stm32_spi_communication_type(), but there is no related process for this type in stm32f4_spi_set_mode(), then we get error from stm32_spi_transfer_one_setup(). we can use two method to fix this bug. 1, use stm32 spi's "In unidirectional receive-only mode (BIDIMODE=0 and RXONLY=1)". but as our code running in sdram, the read latency is too large to get so many receive overrun error in interrupts handler. 2, use stm32 spi's "In full-duplex (BIDIMODE=0 and RXONLY=0)", as tx_buf is null, so add flag 'SPI_MASTER_MUST_TX' to spi master. Change since V4: 1 remove dummy data sent out by stm32 spi driver 2 add flag 'SPI_MASTER_MUST_TX' to spi master Signed-off-by: dillon min Link: https://lore.kernel.org/r/1590378348-8115-8-git-send-email-dillon.minfei@gmail.com Signed-off-by: Mark Brown commit b4e3b881b9831c4d27804fee21ee2956858aa1cd Merge: fff4a87f4419 154910f88676 Author: Arnd Bergmann Date: Mon May 25 16:53:25 2020 +0200 Merge tag 'v5.7-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/drivers Refactor the mmsys to reflect that it's a clock driver and the entry point for the DRM subsystem. Replace clk-provider.h include with of_clk.h for mach-mediatek * tag 'v5.7-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: ARM: mediatek: Replace by soc: mediatek: Missing platform_device_unregister() on error in mtk_mmsys_probe() soc: mediatek: mmsys: Drop soc / drm: mediatek: Fix mediatek-drm device probing soc / drm: mediatek: Move routing control to mmsys device clk / soc: mediatek: Move mt8173 MMSYS to platform driver dt-bindings: mediatek: Update mmsys binding to reflect it is a system controller drm/mediatek: Omit warning on probe defers Link: https://lore.kernel.org/r/2cf27d33-59c6-023b-9993-57a2639824ea@gmail.com Signed-off-by: Arnd Bergmann commit fff4a87f4419c52120ad5375f3f4b80c44a28ca3 Merge: 8222d4c31576 10b200668133 Author: Arnd Bergmann Date: Mon May 25 16:51:11 2020 +0200 Merge tag 'tegra-for-5.8-firmware-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers firmware: tegra: Changes for v5.8-rc1 This contains a change that makes the BPMP driver a regular driver, which fixes some weird suspend/resume ordering issues. Another fix is also included to implement another way of enabling the L2 cache after LP2 suspend. * tag 'tegra-for-5.8-firmware-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: Defer BPMP probe if shared memory not available firmware: tf: Different way of L2 cache enabling after LP2 suspend firmware: tegra: Make BPMP a regular driver Link: https://lore.kernel.org/r/20200515145311.1580134-6-thierry.reding@gmail.com Link: https://lore.kernel.org/r/20200522142846.2376224-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 8222d4c31576ecf8af7e0c24abe24d201635c938 Merge: b4ad9a32b204 cdc8abe763c9 Author: Arnd Bergmann Date: Mon May 25 16:49:58 2020 +0200 Merge tag 'renesas-drivers-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.8 (take two) - Add the main config option for the RZ/G1H SoC. * tag 'renesas-drivers-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Add Renesas R8A7742 config option Link: https://lore.kernel.org/r/20200515100547.14671-5-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit b4ad9a32b2042ac6be38d33e8317fb8fc712619e Merge: acb09eca328d 104edb94cc4b Author: Arnd Bergmann Date: Mon May 25 16:38:01 2020 +0200 Merge tag 'tee-subsys-for-5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers TEE subsystem work - Reserve GlobalPlatform implementation defined logon method range - Add support to register kernel memory with TEE to allow TEE bus drivers to register memory references. * tag 'tee-subsys-for-5.8' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: add private login method for kernel clients tee: enable support to register kernel memory Link: https://lore.kernel.org/r/20200504181049.GA10860@jade Signed-off-by: Arnd Bergmann commit f202272cabf276441174dc05ad8b94d3c1174877 Merge: 3ca570da2035 eab810f37ff5 Author: Mark Brown Date: Mon May 25 15:31:13 2020 +0100 Merge series "ASoC: add soc-link" from Kuninori Morimoto : Hi Mark Current ALSA SoC is handling dai_link related operation, but it is implmemented directly without using function/macro, and at random place. This v4 patch-set creates new snd_soc_link_xxx() functions which handles dai_link related operation, and implmement these at new soc-link.c. v3 -> v4 - add Reviewed-by from Ranjani and Pierre-Louis - fix bisection error at [2/7] v2 -> v3 - add missing #include in soc-link.c v1 -> v2 - #include is added on each c source file instead of soc.h - not have extra error message after snd_soc_link_xxx(), because it already indicate it via snc_link_ret() - snd_soc_link_compr_xxx() doesn't have rtd parameter, because it can be created from cstream Link: https://lore.kernel.org/r/87lflk4yk3.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/874ksa59wc.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/877dx868op.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (7): ASoC: add soc-link.c ASoC: soc-link: move soc_rtd_xxx() ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx() ASoC: soc-link: add snd_soc_link_be_hw_params_fixup() ASoC: soc-link: add snd_soc_link_compr_startup() ASoC: soc-link: add snd_soc_link_compr_shutdown() ASoC: soc-link: add snd_soc_link_compr_set_params() include/sound/soc-link.h | 27 +++++++ sound/soc/Makefile | 2 +- sound/soc/soc-compress.c | 46 ++++-------- sound/soc/soc-core.c | 18 ++--- sound/soc/soc-dai.c | 9 ++- sound/soc/soc-link.c | 150 +++++++++++++++++++++++++++++++++++++++ sound/soc/soc-pcm.c | 86 ++++------------------ 7 files changed, 219 insertions(+), 119 deletions(-) create mode 100644 include/sound/soc-link.h create mode 100644 sound/soc/soc-link.c -- 2.17.1 Thank you for your help !! Best regards --- Kuninori Morimoto commit 3ca570da20357c4b317fb08897f4ac311cbc7dbe Merge: 393dc21d0f25 4c4a975178ef Author: Mark Brown Date: Mon May 25 15:31:12 2020 +0100 Merge series "ASoC: SOF: extended manifest support for 5.8" from Kai Vehmanen : Hello, extended firmware manifest is a method to retrieve capabilities directly from the firmware file instead of routing the information via the DSP and reading it back via IPC (latter mechanism still supported but will be deprecated). This feature was briefly merged to 5.8 with the series sent on 2020-Apr-15, but due to a regression hit with exporting uapi headers, the patches got dropped. Here's an update with the uapi header issue fixed, rebased to latest 'for-5.8' and a few minor fixes. This has been sitting in sof-dev for some weeks and no further issues have been found. We also added a check for the uapi-export case to SOF CI, so such errors would not slip through again in the future. Tooling support to create firmware files with an extended header is available in SOF firmware repository (see the rimage tool) and this part is already merged. Karol Trzcinski (5): ASoC: SOF: loader: Adjust validation condition for fw_offset ASoC: SOF: Introduce extended manifest ASoC: SOF: ext_manifest: parse firmware version ASoC: SOF: ext_manifest: parse windows ASoC: SOF: ext_manifest: parse compiler version include/sound/sof/ext_manifest.h | 95 +++++++++++++++++ sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/loader.c | 176 ++++++++++++++++++++++++++++++- 3 files changed, 269 insertions(+), 4 deletions(-) create mode 100644 include/sound/sof/ext_manifest.h -- 2.26.2 commit 393dc21d0f25e8fcde8baca78b8a38afe61db2a7 Author: Shengjiu Wang Date: Fri May 22 17:57:24 2020 +0800 ASoC: fsl_asrc: Merge suspend/resume function to runtime_suspend/resume With dedicated power domain for asrc, power can be disabled after probe and pm runtime suspend, then the value of all registers need to be restored in pm runtime resume. So we can merge suspend/resume function to runtime_suspend/resume function and enable regcache only in end of probe. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/1590141444-28668-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 085c02d355ac585184ef4f00eb333cd86f6add80 Author: Tang Bin Date: Wed May 13 19:14:08 2020 +0800 ASoC: fsl: imx-audmix: Fix unused assignment to variable 'ret' Omit unused initialized value, because 'ret' will be assigined by the function snd_soc_component_read(). Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200513111408.11452-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit cff1f8b4f8e119a9dbd9872d7a04fedef8d0c1a2 Author: shengjiu wang Date: Mon May 25 17:03:32 2020 +0800 ASoC: fsl_asrc: Fix -Wmissing-prototypes warning COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 sound/soc/fsl/fsl_asrc.c:557:18: warning: no previous prototype for function 'fsl_asrc_get_dma_channel' [-Wmissing-prototypes] struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir) ^ sound/soc/fsl/fsl_asrc.c:557:1: note: declare 'static' if the function is not intended to be used outside of this translation unit struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir) ^ static Fixes: be7bd03f0201 ("ASoC: fsl_asrc: Move common definition to fsl_asrc_common") Reported-by: kbuild test robot Signed-off-by: shengjiu wang Link: https://lore.kernel.org/r/1590397412-12966-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit a6e3f4f34cdbf0ae33731cff047542982a1195b0 Author: Steve Lee Date: Mon May 18 09:50:38 2020 +0900 ASoC: max98390: Added Amplifier Driver This is the initial amplifier driver for max98390. Reported-by: kbuild test robot Signed-off-by: Steve Lee Link: https://lore.kernel.org/r/20200518005038.21074-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown commit acb09eca328d7ca67362acfe1423fdc1ea64505e Merge: a7afae50e2ab 2f71832755a9 Author: Arnd Bergmann Date: Mon May 25 16:25:11 2020 +0200 Merge tag 'renesas-drivers-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.8 - Add System Controller (SYSC) and Reset (RST) support for the new RZ/G1H (R8A7742) SoC. * tag 'renesas-drivers-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: rcar-rst: Add support for RZ/G1H soc: renesas: rcar-sysc: Add R8A7742 support clk: renesas: Add r8a7742 CPG Core Clock Definitions dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros Link: https://lore.kernel.org/r/20200430084849.1457-5-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit a7afae50e2abc65462f6336ea2005f748829227b Merge: 0e698dfa2822 5a897e3ab429 Author: Arnd Bergmann Date: Mon May 25 16:23:55 2020 +0200 Merge tag 'scmi-updates-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers ARM SCMI/SCPI updates for v5.8 1. Addition of ARM SMC/HVC as SCMI transport type with required abstraction already in place 2. Initial infrastructure support to add SCMI notifications from platform to agents 3. Miscellaneous fix adding header include guards * tag 'scmi-updates-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: fix psci dependency firmware: arm_scmi: Fix return error code in smc_send_message firmware: arm_scmi: Fix handling of unexpected delayed responses firmware: arm_scmi: Clear channel for delayed responses firmware: arm_scmi: Clear channel on reception of unexpected responses firmware: arm_scmi: Rename .clear_notification() transport_ops firmware: arm_scmi: Add support for notifications message processing firmware: arm_scmi: Add notifications support in transport layer firmware: arm_scmi: Update protocol commands and notification list firmware: arm_scmi: Add receive buffer support for notifications firmware: arm_scpi: Add include guard to linux/scpi_protocol.h firmware: arm_scmi: Add include guard to linux/scmi_protocol.h firmware: arm_scmi: Drop checking for shmem property in parent node firmware: arm_scmi: Check shmem property for channel availablity firmware: arm_scmi: Drop empty stub for smc_mark_txdone firmware: arm_scmi: Make mutex channel specific firmware: arm_scmi: Add smc/hvc transport dt-bindings: arm: Add smc/hvc transport for SCMI Link: https://lore.kernel.org/r/20200512110357.GA26454@bogus Signed-off-by: Arnd Bergmann commit 4c4a975178ef06324c80baef0e95209f431645a5 Author: Karol Trzcinski Date: Wed May 20 19:59:11 2020 +0300 ASoC: SOF: ext_manifest: parse compiler version The compiler version and description can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200520165911.21696-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 8d809c15acf23bb2863ec08578ab72de860b3abc Author: Karol Trzcinski Date: Wed May 20 19:59:10 2020 +0300 ASoC: SOF: ext_manifest: parse windows The window description can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200520165911.21696-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 3e2a89d3ee052ef5346ba933e557c807333ced11 Author: Karol Trzcinski Date: Wed May 20 19:59:09 2020 +0300 ASoC: SOF: ext_manifest: parse firmware version The firmware version can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200520165911.21696-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit a80cf1987a6e728b4d5c8e5041132d46e89c7a45 Author: Karol Trzcinski Date: Wed May 20 19:59:08 2020 +0300 ASoC: SOF: Introduce extended manifest Extended manifest is a place to store build time known firmware metadata, for example firmware version or used compiler description. Given information is read on host side before firmware startup. This part of output binary is located as a first structure in binary file. Extended manifest should be skipped in firmware loading routine. Signed-off-by: Karol Trzcinski Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200520165911.21696-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 523773b9ea9f430810332aa117ea48f8feafce9a Author: Karol Trzcinski Date: Wed May 20 19:59:07 2020 +0300 ASoC: SOF: loader: Adjust validation condition for fw_offset Condition in if statement should be same as trace message and FW size equal to zero (after skipping offset) should be marked as invalid. Signed-off-by: Karol Trzcinski Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200520165911.21696-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 938b29db3aa9c293c7c1366b16e55e308f1a1ddd Author: Sakari Ailus Date: Sun May 17 00:39:36 2020 +0200 media: Documentation: media: Refer to mbus format documentation from CSI-2 docs The media bus formats to be used on serial busses are documented but there was no reference from CSI-2 documentation. Add that now. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 142d06489fc7952976841ec888a655c3735e66fd Author: Gustavo A. R. Silva Date: Thu May 7 21:20:00 2020 +0200 media: s5k5baf: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit cd25993988491f97a42b3db490fdb2599c67edc8 Author: Geert Uytterhoeven Date: Wed May 6 14:03:04 2020 +0200 media: i2c: imx219: Drop and The IMX219 camera driver is not a clock provider, but merely a clock consumer, and thus does not need to include and . Signed-off-by: Geert Uytterhoeven Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 866edc895171f1256aad3e81dce193447955c202 Author: Bingbu Cao Date: Mon May 11 15:41:14 2020 +0200 media: i2c: Add ov2740 image sensor driver OminiVision ov2740 is a 2 megapixels RAW RGB image sensor which can deliver 1920x1080@60fps frames. This driver add the support of vertical blanking, exposure, test pattern, digital and analog gain control for sensor. Signed-off-by: Bingbu Cao Signed-off-by: Shawn Tu Signed-off-by: Qiu, Tianshu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 96b5b11aeb6ac859d4a8603a82a35d9250ea460d Author: Robert Foss Date: Mon May 11 13:03:50 2020 +0200 media: ov8856: Implement sensor module revision identification Query the sensor for its module revision, and compare it to known revisions. Currently 2A and 1B revision indentification is supported. [Sakari Ailus: Wrap a line over 80, alignment, use %u for printing u32] Signed-off-by: Robert Foss Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0c2c7a1e0d69221b9d489bfd8cf53262d6f82446 Author: Robert Foss Date: Mon May 11 13:03:49 2020 +0200 media: ov8856: Add devicetree support Add match table, enable ov8856_probe() to support both ACPI and DT modes. ACPI and DT modes are primarily distinguished from by checking for ACPI mode and by having resource like be NULL. Signed-off-by: Robert Foss Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 932300e6c3e0ce80d7fb275ce32a93db41e90546 Author: Dongchun Zhu Date: Mon May 11 13:03:48 2020 +0200 media: dt-bindings: ov8856: Document YAML bindings This patch adds documentation of device tree in YAML schema for the OV8856 CMOS image sensor. Signed-off-by: Dongchun Zhu Signed-off-by: Robert Foss Reviewed-by: Maxime Ripard Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 79659190ee972c05498c338e48d80cb45490c533 Author: Joerg Roedel Date: Mon May 25 15:01:22 2020 +0200 iommu: Don't take group reference in iommu_alloc_default_domain() The iommu_alloc_default_domain() function takes a reference to an IOMMU group without releasing it. This causes the group to never be released, with undefined side effects. The function has only one call-site, which takes a group reference on its own, so to fix this leak, do not take another reference in iommu_alloc_default_domain() and pass the group as a function parameter instead. Fixes: 6e1aa2049154 ("iommu: Move default domain allocation to iommu_probe_device()") Reported-by: Sai Prakash Ranjan Signed-off-by: Joerg Roedel Tested-by: Sai Prakash Ranjan Cc: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20200525130122.380-1-joro@8bytes.org Reference: https://lore.kernel.org/lkml/20200522130145.30067-1-saiprakash.ranjan@codeaurora.org/ commit eab810f37ff5fd76172ac903e5e732d6b72fc834 Author: Kuninori Morimoto Date: Mon May 25 09:57:50 2020 +0900 ASoC: soc-link: add snd_soc_link_compr_set_params() dai_link related function should be implemented at soc-link.c. This patch adds snd_soc_link_compr_set_params(). Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87sgfo3k6q.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0e532c99b468d6e4fc4e1d29b45ffe2749db6d07 Author: Kuninori Morimoto Date: Mon May 25 09:57:45 2020 +0900 ASoC: soc-link: add snd_soc_link_compr_shutdown() dai_link related function should be implemented at soc-link.c. This patch adds snd_soc_link_compr_shutdown(). Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87tv043k6u.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 9ab711cb84d4b77fb3929fabc5e3756d5010af14 Author: Kuninori Morimoto Date: Mon May 25 09:57:41 2020 +0900 ASoC: soc-link: add snd_soc_link_compr_startup() dai_link related function should be implemented at soc-link.c. This patch adds snd_soc_link_compr_startup(). Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87v9kk3k6y.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0cbbf8a0399518e5b865f9a1320d704c1d621703 Author: Kuninori Morimoto Date: Mon May 25 09:57:36 2020 +0900 ASoC: soc-link: add snd_soc_link_be_hw_params_fixup() dai_link related function should be implemented at soc-link.c. This patch adds snd_soc_link_be_hw_params_fixup(). Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87wo503k73.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7cf3c5b4a04f4b27d964089630290beccc115f9f Author: Kuninori Morimoto Date: Mon May 25 09:57:31 2020 +0900 ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx() "rtd" can be created from "substream". Let's cleanup snd_soc_link_xxx(). Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87y2pg3k78.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a5e6c1090001b8a14e797364dde7c84236465fc7 Author: Kuninori Morimoto Date: Mon May 25 09:57:19 2020 +0900 ASoC: soc-link: move soc_rtd_xxx() dai_link related function should be implemented at soc-link.c. This patch moves soc-pcm soc_rtd_xxx() to soc-link as snd_soc_link_xxx() Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87zh9w3k7k.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 02e756363fc936917bed7320199c80729b2a825c Author: Kuninori Morimoto Date: Mon May 25 09:57:14 2020 +0900 ASoC: add soc-link.c Current ALSA SoC has many dai_link->xxx() functions. But, it is implemented randomly at random place. This patch creats new soc-link.c and collect dai_link related operation into it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/871rn84ys5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d1343da330f6ff3f40abf1f360d4701af784b85a Merge: a5d8e55b2c7d 9241dfe7f277 Author: Ingo Molnar Date: Mon May 25 15:11:14 2020 +0200 Merge tag 'efi-changes-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/core More EFI changes for v5.8: - Rename pr_efi/pr_efi_err to efi_info/efi_err, and use them consistently - Simplify and unify initrd loading - Parse the builtin command line on x86 (if provided) - Implement printk() support, including support for wide character strings - Some fixes for issues introduced by the first batch of v5.8 changes - Fix a missing prototypes warning - Simplify GDT handling in early mixed mode thunking code - Some other minor fixes and cleanups Conflicts: drivers/firmware/efi/libstub/efistub.h Signed-off-by: Ingo Molnar commit a5d8e55b2c7d3d18d7837af0ef8d1477eeeb919c Merge: 4da0b2b7e675 9cb1fd0efd19 Author: Ingo Molnar Date: Mon May 25 15:10:37 2020 +0200 Merge tag 'v5.7-rc7' into efi/core, to refresh the branch and pick up fixes Signed-off-by: Ingo Molnar commit 6af2aa7f6695ba73436083ce2e4c1a4ebc6af765 Author: Daniel González Cabanelas Date: Sun May 24 20:59:53 2020 +0200 MIPS: BCM63XX: fix BCM6358 GPIO count The BCM6358 SoC has only 38 available GPIOs. Fix it. Signed-off-by: Daniel González Cabanelas Signed-off-by: Thomas Bogendoerfer commit 0e5596c54aa2fbfd22842096d3ebb6753b2a220a Author: Greg Kroah-Hartman Date: Sun May 24 17:30:41 2020 +0200 kobject: send KOBJ_REMOVE uevent when the object is removed from sysfs It is possible for a KOBJ_REMOVE uevent to be sent to userspace way after the files are actually gone from sysfs, due to how reference counting for kobjects work. This should not be a problem, but it would be good to properly send the information when things are going away, not at some later point in time in the future. Before this move, if a kobject's parent was torn down before the child, when the call to kobject_uevent() happened, the parent walk to try to reconstruct the full path of the kobject could be a total mess and cause crashes. It's not good to try to tear down a kobject tree from top down, but let's at least try to not to crash if a user does so. Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20200524153041.2361-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 757a9395f33c51c4e6eff2c7c0fbd50226a58224 Author: Chris Wilson Date: Fri May 22 14:27:06 2020 +0100 drm/i915/gem: Avoid iterating an empty list Our __sgt_iter assumes that the scattergather list has at least one element. But during construction we may fail in allocating the first page, and so mark the first element as the terminator. This is unexpected! [22555.524752] RIP: 0010:shmem_get_pages+0x506/0x710 [i915] [22555.524759] Code: 49 8b 2c 24 31 c0 66 89 44 24 40 48 85 ed 0f 84 62 01 00 00 4c 8b 75 00 8b 5d 08 44 8b 7d 0c 48 8b 0d 7e 34 07 e2 49 83 e6 fc <49> 8b 16 41 01 df 48 89 cf 48 89 d0 48 c1 e8 2d 48 85 c9 0f 84 c8 [22555.524765] RSP: 0018:ffffc9000053f9d0 EFLAGS: 00010246 [22555.524770] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8881ffffa000 [22555.524774] RDX: fffffffffffffff4 RSI: ffffffffffffffff RDI: ffffffff821efe00 [22555.524778] RBP: ffff8881b099ab00 R08: 0000000000000000 R09: 00000000fffffff4 [22555.524782] R10: 0000000000000002 R11: 00000000ffec0a02 R12: ffff8881cd3c8d60 [22555.524786] R13: 00000000fffffff4 R14: 0000000000000000 R15: 0000000000000000 [22555.524790] FS: 00007f4fbeb9b9c0(0000) GS:ffff8881f8580000(0000) knlGS:0000000000000000 [22555.524795] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [22555.524799] CR2: 0000000000000000 CR3: 00000001ec7f0004 CR4: 00000000001606e0 [22555.524803] Call Trace: [22555.524919] __i915_gem_object_get_pages+0x4f/0x60 [i915] Fixes: 85d1225ec066 ("drm/i915: Introduce & use new lightweight SGL iterators") Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Tvrtko Ursulin Cc: # v4.8+ Reviewed-by: Matthew Auld Reviewed-by: Maciej Patelczyk Link: https://patchwork.freedesktop.org/patch/msgid/20200522132706.5133-1-chris@chris-wilson.co.uk (cherry picked from commit 957ad9a02be6faa87594c58ac09460cd3d190d0e) Signed-off-by: Joonas Lahtinen commit ef29440b3ccb93f44cf664311b30fbd5f84d9683 Author: Chris Wilson Date: Thu May 21 15:06:17 2020 +0100 drm/i915: Avoid using rq->engine after free during i915_fence_release In order to be valid to dereference during the i915_fence_release, after retiring the fence and releasing its refererences, we assume that rq->engine can only be a real engine (that stay intact until the device is shutdown after all fences have been flushed). However, due to a quirk of preempt-to-busy, we may retire a request that still belongs to a virtual engine and so eventually free it with rq->engine being invalid. To avoid dereferencing that invalid engine, we look at the execution_mask which if it indicates it may be executed on more than one engine, we know it originated on a virtual engine and may still be on one. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1906 Fixes: 43acd6516ca9 ("drm/i915: Keep a per-engine request pool") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200521140617.30015-2-chris@chris-wilson.co.uk (cherry picked from commit 32a4605b38c30689a6a18f3f4c7d3133ac9d3277) Signed-off-by: Joonas Lahtinen commit 9ef36fc2d0347f04f75b9d70c0ecc2e3b403bb7f Author: Chris Wilson Date: Thu May 21 15:06:16 2020 +0100 drm/i915: Disable semaphore inter-engine sync without timeslicing Since the removal of the no-semaphore boosting, we rely on timeslicing to reorder passed inter-dependency hogs across the engines. However, we require preemption to support timeslicing into user payloads, and not all machine support preemption so we do not universally enable timeslicing, even when it would correctly preempt our own inter-engine semaphores. Since timeslicing and semaphore priority deboosting is now disabled on Broadwell/Braswell, we have to follow suite and not use semaphores. Testcase: igt/gem_exec_schedule/semaphore-codependency # bdw/bsw Fixes: 18e4af04d218 ("drm/i915: Drop no-semaphore boosting") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200521140617.30015-1-chris@chris-wilson.co.uk (cherry picked from commit 0eb670aac27b1d615004c29efec595616e3e091a) Signed-off-by: Joonas Lahtinen commit b7ccc7858a33ddb3c5516f39b104a9156957c8bb Author: Chris Wilson Date: Wed May 20 08:30:48 2020 +0100 drm/i915/gt: Remove errant assertion in __intel_context_do_pin This assertion was removed in commit b412c63f1cba ("drm/i915/gt: Report context-is-closed prior to pinning"), but accidentally restored by a cherry-pick into drm-next and now has percolated back to drm-intel-next-queued. Fixes: 2e46a2a0b014 ("drm/i915: Use explicit flag to mark unreachable intel_context") Fixes: 2b703bbda271 ("Merge drm/drm-next into drm-intel-next-queued") References: b412c63f1cba ("drm/i915/gt: Report context-is-closed prior to pinning") Signed-off-by: Chris Wilson Cc: Rodrigo Vivi Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200520073048.2394034-1-chris@chris-wilson.co.uk (cherry picked from commit f2c1061a3677b400a945d9238f17bf33d669acff) Signed-off-by: Joonas Lahtinen commit 0fad590fd98f308c903fe8205c0f07a649a0b72e Author: Chris Wilson Date: Tue May 19 07:31:12 2020 +0100 drm/i915: Don't set queue-priority hint when supressing the reschedule We recorded the execlists->queue_priority_hint update for the inflight request without kicking the tasklet. The next submitted request then failed to be scheduled as it had a lower priority than the hint, leaving the HW running with only the inflight request. Fixes: 6cebcf746f3f ("drm/i915: Tweak scheduler's kick_submission()") Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200519063123.20673-1-chris@chris-wilson.co.uk (cherry picked from commit b86fc6e5e89e5645b43f57171c26740ef38f9f4a) Signed-off-by: Joonas Lahtinen commit a2b02e4623fb127fa65a13e4ac5aa56e4ae16291 Author: Peter Rosin Date: Mon May 25 12:43:52 2020 +0200 spi: mux: repair mux usage It is not valid to cache/short out selection of the mux. mux_control_select() only locks the mux until mux_control_deselect() is called. mux_control_deselect() may put the mux in some low power state or some other user of the mux might select it for other purposes. These things are probably not happening in the original setting where this driver was developed, but it is said to be a generic SPI mux. Also, the mux framework will short out the actual low level muxing operation when/if that is possible. Fixes: e9e40543ad5b ("spi: Add generic SPI multiplexer") Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/20200525104352.26807-1-peda@axentia.se Signed-off-by: Mark Brown commit 7809c4d5805b1d331acfe0047dd9695691d428d4 Author: Qian Cai Date: Thu May 21 17:50:30 2020 -0400 iommu/vt-d: fix a GCC warning The commit 6ee1b77ba3ac ("iommu/vt-d: Add svm/sva invalidate function") introduced a GCC warning, drivers/iommu/intel-iommu.c:5330:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] const static int ^~~~~ Fixes: 6ee1b77ba3ac0 ("iommu/vt-d: Add svm/sva invalidate function") Signed-off-by: Qian Cai Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200521215030.16938-1-cai@lca.pw Signed-off-by: Joerg Roedel commit bfe6240dfe4f16c20db94bc7c0ab9ffa316fb926 Author: Lu Baolu Date: Tue May 19 09:34:23 2020 +0800 iommu/vt-d: Fix pointer cast warnings on 32 bit Pointers should be casted to unsigned long to avoid "cast from pointer to integer of different size" warnings. drivers/iommu/intel-pasid.c:818:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/iommu/intel-pasid.c:821:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/iommu/intel-pasid.c:824:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/iommu/intel-svm.c:343:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Fixes: b0d1f8741b81 ("iommu/vt-d: Add nested translation helper function") Fixes: 56722a4398a3 ("iommu/vt-d: Add bind guest PASID support") Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200519013423.11971-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 70b8170e55d3ca9503a53211967faee6b5f18b19 Author: Joerg Roedel Date: Tue May 19 15:28:24 2020 +0200 iommu: Don't call .probe_finalize() under group->mutex The .probe_finalize() call-back of some IOMMU drivers calls into arm_iommu_attach_device(). This function will call back into the IOMMU core code, where it tries to take group->mutex again, resulting in a deadlock. As there is no reason why .probe_finalize() needs to be called under that mutex, move it after the lock has been released to fix the deadlock. Fixes: deac0b3bed26 ("iommu: Split off default domain allocation from group assignment") Reported-by: Yong Wu Tested-by: Yong Wu Signed-off-by: Joerg Roedel Cc: Yong Wu Link: https://lore.kernel.org/r/20200519132824.15163-1-joro@8bytes.org commit e682fcc769709e563ab2ebea5a2af62bcbd7f8cc Author: Tiezhu Yang Date: Sat May 23 19:45:26 2020 +0800 pinctrl: at91-pio4: Add COMPILE_TEST support Add COMPILE_TEST support to the AT91 PIO4 pinctrl driver for better compile testing coverage. Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1590234326-2194-2-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Linus Walleij commit b5d9ff10dca49f4d4b7846c3751c6bec50d07375 Author: Tiezhu Yang Date: Sat May 23 19:45:25 2020 +0800 pinctrl: Fix return value about devm_platform_ioremap_resource() When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Fixes: 4b024225c4a8 ("pinctrl: use devm_platform_ioremap_resource() to simplify code") Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1590234326-2194-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Linus Walleij commit e4befc121df03dc8ed2ac1031c98f9538e244bae Author: Dinghao Liu Date: Sun May 24 21:50:49 2020 -0500 usb: musb: Fix runtime PM imbalance on error When copy_from_user() returns an error code, there is a runtime PM usage counter imbalance. Fix this by moving copy_from_user() to the beginning of this function. Fixes: 7b6c1b4c0e1e ("usb: musb: fix runtime PM in debugfs") Signed-off-by: Dinghao Liu Cc: stable@vger.kernel.org Signed-off-by: Bin Liu Link: https://lore.kernel.org/r/20200525025049.3400-7-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman commit 685f5f24108a5f3481da70ee75a1b18b9de34257 Author: Paul Cercueil Date: Sun May 24 21:50:48 2020 -0500 usb: musb: jz4740: Prevent lockup when CONFIG_SMP is set The function dma_controller_irq() locks up the exact same spinlock we locked before calling it, which obviously resulted in a deadlock when CONFIG_SMP was enabled. This flew under the radar as none of the boards supported by this driver needs SMP. Fixes: 57aadb46bd63 ("usb: musb: jz4740: Add support for DMA") Cc: stable@vger.kernel.org Signed-off-by: Paul Cercueil Signed-off-by: Bin Liu Link: https://lore.kernel.org/r/20200525025049.3400-6-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman commit 402bcac4b25b520c89ba60db85eb6316f36e797f Author: Macpaul Lin Date: Sun May 24 21:50:47 2020 -0500 usb: musb: mediatek: add reset FADDR to zero in reset interrupt handle When receiving reset interrupt, FADDR need to be reset to zero in peripheral mode. Otherwise ep0 cannot do enumeration when re-plugging USB cable. Signed-off-by: Macpaul Lin Acked-by: Min Guo Signed-off-by: Bin Liu Link: https://lore.kernel.org/r/20200525025049.3400-5-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman commit e62361c721453b5cf76ce3bb8680fb8bc0832098 Author: Jason Yan Date: Sun May 24 21:50:46 2020 -0500 usb: musb: use true for 'use_dma' Fix the following coccicheck warning: drivers/usb/musb/musb_core.c:1798:12-19: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Bin Liu Link: https://lore.kernel.org/r/20200525025049.3400-4-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman commit 7f88a5ac393f39319f69b8b20cc8d5759878d1a1 Author: Bin Liu Date: Sun May 24 21:50:45 2020 -0500 usb: musb: start session in resume for host port Commit 17539f2f4f0b ("usb: musb: fix enumeration after resume") replaced musb_start() in musb_resume() to not override softconnect bit, but it doesn't restart the session for host port which was done in musb_start(). The session could be disabled in musb_suspend(), which leads the host port doesn't stay in host mode. So let's start the session specifically for host port in musb_resume(). Fixes: 17539f2f4f0b ("usb: musb: fix enumeration after resume") Cc: stable@vger.kernel.org Signed-off-by: Bin Liu Link: https://lore.kernel.org/r/20200525025049.3400-3-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman commit 1b967691ecdcf512bc33c0783158f760e5c1a9cf Author: Bin Liu Date: Sun May 24 21:50:44 2020 -0500 usb: musb: return -ESHUTDOWN in urb when three-strikes error happened When a USB device attached to a hub got disconnected, MUSB controller generates RXCSR_RX_ERROR interrupt for the 3-strikes-out error. Currently the MUSB host driver returns -EPROTO in current URB, then the USB device driver could immediately resubmit the URB which causes MUSB generate RXCSR_RX_ERROR interrupt again. This circle causes interrupt storm then the hub never got a chance to report the USB device detach. To fix the interrupt storm, change the URB return code to -ESHUTDOWN for MUSB_RXCSR_H_ERROR interrupt, so that the USB device driver will not immediately resubmit the URB. Signed-off-by: Bin Liu Link: https://lore.kernel.org/r/20200525025049.3400-2-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman commit 6f8cd246411575703d9312888b70705c396b53a9 Author: Dinghao Liu Date: Fri May 22 16:08:38 2020 +0800 gpio: rcar: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200522080839.32612-1-dinghao.liu@zju.edu.cn Signed-off-by: Linus Walleij commit ca681aa49200422a4144ee376a2079a9f717bf11 Merge: 14f3a5ccacdb 1c11e74e9079 Author: Greg Kroah-Hartman Date: Mon May 25 13:28:20 2020 +0200 Merge tag 'usb-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: USB: changes for v5.8 merge window Rather busy cycle. We have a total 99 non-merge commits going into v5.8 merge window. The majority of the changes are in dwc3 this around (31.7% of all changes). It's composed mostly Thinh's recent updates to get dwc3 to behave correctly with stream transfers. We have also have Roger's for Keystone platforms and Neil's updates for the meson glue layer. Apart from those, we have the usual set of non-critical fixes, new device IDs, spelling fixes all over the place. Signed-off-by: Felipe Balbi * tag 'usb-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (99 commits) usb: dwc3: keystone: Turn on USB3 PHY before controller dt-bindings: usb: ti,keystone-dwc3.yaml: Add USB3.0 PHY property dt-bindings: usb: convert keystone-usb.txt to YAML usb: dwc3: gadget: Check for prepared TRBs usb: gadget: Fix issue with config_ep_by_speed function usb: cdns3: ep0: delete the redundant status stage usb: dwc2: Update Core Reset programming flow. usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe() usb: gadget: fix potential double-free in m66592_probe. usb: cdns3: Fix runtime PM imbalance on error usb: gadget: lpc32xx_udc: don't dereference ep pointer before null check usb: dwc3: Increase timeout for CmdAct cleared by device controller USB: dummy-hcd: use configurable endpoint naming scheme usb: cdns3: gadget: assign interrupt number to USB gadget structure usb: gadget: core: sync interrupt before unbind the udc arm64: dts: qcom: sc7180: Add interconnect properties for USB arm64: dts: qcom: sdm845: Add interconnect properties for USB dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver ARM: dts: at91: Remove the USB EP child node dt-bindings: usb: atmel: Mark EP child node as deprecated ... commit 344235f55707f6f7538378e9790cec58e86ebbca Merge: 2aa916e67db3 9cb1fd0efd19 Author: Greg Kroah-Hartman Date: Mon May 25 13:22:05 2020 +0200 Merge 5.7-rc7 into tty-next We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 3ad99bec6e82e32fa9faf2f84e74b134586b46f7 Author: Goldwyn Rodrigues Date: Sat Nov 30 09:59:25 2019 -0600 iomap: remove lockdep_assert_held() Filesystems such as btrfs can perform direct I/O without holding the inode->i_rwsem in some of the cases like writing within i_size. So, remove the check for lockdep_assert_held() in iomap_dio_rw(). Reviewed-by: Darrick J. Wong Signed-off-by: Goldwyn Rodrigues Signed-off-by: David Sterba commit 8cecd0ba854799cda72d03a470e7de9eed3ed6c4 Author: Goldwyn Rodrigues Date: Tue May 14 18:54:27 2019 -0500 iomap: add a filesystem hook for direct I/O bio submission This helps filesystems to perform tasks on the bio while submitting for I/O. This could be post-write operations such as data CRC or data replication for fs-handled RAID. Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Goldwyn Rodrigues Signed-off-by: David Sterba commit d85dc2e116fdce776280224ed2bee4c78e5e5af2 Author: Goldwyn Rodrigues Date: Fri Aug 30 12:09:24 2019 -0500 fs: export generic_file_buffered_read() Export generic_file_buffered_read() to be used to supplement incomplete direct reads. Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit 59ea3c9faf3235b66bc31ca883d59ce58b8b2b27 Author: Nikita Travkin Date: Mon May 11 16:11:28 2020 +0500 leds: add aw2013 driver This commit adds support for AWINIC AW2013 3-channel LED driver. The chip supports 3 PWM channels and is controlled with I2C. Signed-off-by: Nikita Travkin Signed-off-by: Pavel Machek commit 9f6b72e46af593bfc980978322db0256a7d2b6d3 Author: Nikita Travkin Date: Mon May 11 16:11:27 2020 +0500 dt-bindings: leds: Add binding for aw2013 Add YAML devicetree binding for AWINIC AW2013 3-channel led driver Signed-off-by: Nikita Travkin Reviewed-by: Rob Herring Signed-off-by: Pavel Machek commit 5fcd7359019248b4de54379720847bd41bcc42aa Author: Rafael J. Wysocki Date: Tue May 19 14:33:10 2020 +0200 ACPI: EC: PM: s2idle: Extend GPE dispatching debug message Add the "ACPI" string to the "EC GPE dispatched" message as it is ACPI-related. Signed-off-by: Rafael J. Wysocki commit 3441362b08dc16669adc0e7d3f3454ae38619229 Author: Rafael J. Wysocki Date: Tue May 19 13:36:48 2020 +0200 ACPI: PM: s2idle: Print type of wakeup debug messages Since acpi_s2idle_wake() knows the category of wakeup causing the system to resume from suspend-to-idle, make it print a unique message for each of them to help diagnose wakeup issues. Signed-off-by: Rafael J. Wysocki commit 7b52b200cf5bdd04f3ee22121960bd6f4ec5efa1 Author: Srinivas Pandruvada Date: Fri May 22 14:45:09 2020 -0700 ACPI: DPTF: Add battery participant driver This driver adds support for Dynamic Platform and Thermal Framework battery participant device support. These attributes are presented via sysfs interface under the platform device for the battery participant: $ls /sys/bus/platform/devices/INT3532:00/dptf_battery current_discharge_capbility_ma max_platform_power_mw no_load_voltage_mv high_freq_impedance_mohm max_steady_state_power_mw Refer to the documentation at Documentation/ABI/testing/sysfs-platform-dptf for details. Here the implementation reuses existing dptf-power.c as the motivation and processing is same. It also shares one ACPI method. Here this change is using participant type, "PTYP" method to identify and do different processing. By using participant type, create/delete either "dptf_power" or "dptf_battery" attribute group and send notifications. The particpant type for for the battery participant is 0x0C. ACPI methods description: PMAX (Intel(R) Dynamic Tuning Platform Max Power Supplied by Battery): This object evaluates to the maximum platform power that can be supported by the battery in milli watts. PBSS (Intel(R) Dynamic Tuning Power Battery Steady State): This object returns the max sustained power for battery in milli watts. RBHF (Intel(R) Dynamic Tuning High Frequency Impedance): This object returns high frequency impedance value that can be obtained from battery fuel gauge. VBNL (Intel(R) Dynamic Tuning No-Load Voltage) This object returns battery instantaneous no-load voltage that can be obtained from battery fuel gauge in milli volts CMPP (Intel(R) Dynamic Tuning Current Discharge Capability) This object returns battery discharge current capability obtained from battery fuel gauge milli amps. Notifications: 0x80: PMAX change. Used to notify Intel(R)Dynamic Tuning Battery participant driver when the PMAX has changed by 250mw. 0x83: PBSS change. Used to notify Intel(R) Dynamic Tuning Battery participant driver when the power source has changed. 0x85: RBHF change. Used to notify Intel(R)Dynamic Tuning Battery participant driver when the RBHF has changed over a threshold by 5mOhm. 0x86: Battery Capability change. Used to notify Intel(R)Dynamic Tuning Battery participant driver when the battery capability has changed. Signed-off-by: Srinivas Pandruvada [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki commit 668ce99e4ed4c07bb14465f80492bc6cf76ed3c9 Author: Srinivas Pandruvada Date: Thu May 21 13:30:15 2020 -0700 ACPI: DPTF: Additional sysfs attributes for power participant driver Add two additional attributes to the existing power participant driver: rest_of_platform_power_mw: (RO) Shows the rest of worst case platform power in mW outside of S0C. This will help in power distribution to SoC and rest of the system. For example on a test system, this value is 2.5W with a 15W TDP SoC. Based on the adapter rating (adapter_rating_mw), user space software can decide on proper power allocation to SoC to improve short term performance via powercap/RAPL interface. prochot_confirm: (WO) Confirm EC about a prochot notification. Also userspace is notified via sysfs_notify(), whenever power source or rest of the platform power is changed. So user space can use poll() system call on those attributes. The ACPI methods used in this patch are as follows: PROP This object evaluates to the rest of worst case platform power in mW. Bits: 23:0 Worst case rest of platform power in mW. PBOK PBOK is a method designed to provide a mechanism for OSPM to change power setting before EC can de-assert a PROCHOT from a device. The EC may receive several PROCHOTs, so it has a sequence number attached to PSRC (read via existing attribute "platform_power_source"). Once OSPM takes action for a PSRC change notification, it can call PBOK method to confirm with the sequence number. Bits: 3:0 Power Delivery State Change Sequence number 30 Reserved 31 0 – Not OK to de-assert PROCHOT 1 – OK to de-assert PROCHOT PSRC (Platform Power Source): Not new in this patch but for documentation for new bits This object evaluates to an integer that represents the system power source as well as the power delivery state change sequence number. Bits: 3:0 The current power source as an integer for AC, DC, USB, Wireless. 0 = DC, 1 = AC, 2 = USB, 3 = Wireless Charging 7:4 Power Delivery State Change Sequence Number. Default value is 0 Notifications: 0x81: (Power State Change) Used to notify when the power source has changed. 0x84: (PROP change) Used to notify when the platform rest of power has changed. Signed-off-by: Srinivas Pandruvada [ rjw: Subject, minor ABI documentation edit ] Signed-off-by: Rafael J. Wysocki commit c41c36e900a337b4132b12ccabc97f5578248b44 Author: Paul Menzel Date: Fri May 22 14:22:28 2020 +0200 ACPI: video: Use native backlight on Acer TravelMate 5735Z Currently, changing the brightness of the internal display of the Acer TravelMate 5735Z does not work. Pressing the function keys or changing the slider, GNOME Shell 3.36.2 displays the OSD (five steps), but the brightness does not change. The Acer TravelMate 5735Z shipped with Windows 7 and as such does not trigger our "win8 ready" heuristic for preferring the native backlight interface. Still ACPI backlight control doesn't work on this model, where as the native (intel_video) backlight interface does work by adding `acpi_backlight=native` or `acpi_backlight=none` to Linux’ command line. So, add a quirk to force using native backlight control on this model. Link: https://bugzilla.kernel.org/show_bug.cgi?id=207835 Reviewed-by: Hans de Goede Signed-off-by: Paul Menzel Signed-off-by: Rafael J. Wysocki commit 0e375f51017bcc86c23979118b10445c424ef5ad Author: Anup Patel Date: Mon May 18 14:44:41 2020 +0530 irqchip/sifive-plic: Improve boot prints for multiple PLIC instances We improve PLIC banner to help distinguish multiple PLIC instances in boot time prints. Signed-off-by: Anup Patel Signed-off-by: Marc Zyngier Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20200518091441.94843-4-anup.patel@wdc.com commit e33a58a29c6ad6f844cdc184210aa1feb5e2fbe0 Author: Andy Shevchenko Date: Thu May 21 00:19:15 2020 +0300 gpio: pca935x: Allow IRQ support for driver built as a module Perhaps by some historical reasons the IRQ support has been allowed only for built-in driver. However, there is nothing prevents us to build it as module an use as IRQ chip. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 2234ae846ccb9ebdf4c391824cb79e73674dceda Author: Anup Patel Date: Mon May 18 14:44:40 2020 +0530 irqchip/sifive-plic: Setup cpuhp once after boot CPU handler is present For multiple PLIC instances, the plic_init() is called once for each PLIC instance. Due to this we have two issues: 1. cpuhp_setup_state() is called multiple times 2. plic_starting_cpu() can crash for boot CPU if cpuhp_setup_state() is called before boot CPU PLIC handler is available. Address both issues by only initializing the HP notifiers when the boot CPU setup is complete. Fixes: f1ad1133b18f ("irqchip/sifive-plic: Add support for multiple PLICs") Signed-off-by: Anup Patel Signed-off-by: Marc Zyngier Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200518091441.94843-3-anup.patel@wdc.com commit 3429444abdd9dbd5faebd9bee552ec6162b17ad6 Author: Matt Jolly Date: Thu May 21 10:43:58 2020 +1000 USB: serial: qcserial: add DW5816e QDL support Add support for Dell Wireless 5816e Download Mode (AKA boot & hold mode / QDL download mode) to drivers/usb/serial/qcserial.c This is required to update device firmware. Signed-off-by: Matt Jolly Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 2458ed31e9b9ab40d78a452ab2650a0857556e85 Author: Anup Patel Date: Mon May 18 14:44:39 2020 +0530 irqchip/sifive-plic: Set default irq affinity in plic_irqdomain_map() For multiple PLIC instances, each PLIC can only target a subset of CPUs which is represented by "lmask" in the "struct plic_priv". Currently, the default irq affinity for each PLIC interrupt is all online CPUs which is illegal value for default irq affinity when we have multiple PLIC instances. To fix this, we now set "lmask" as the default irq affinity in for each interrupt in plic_irqdomain_map(). Fixes: f1ad1133b18f ("irqchip/sifive-plic: Add support for multiple PLICs") Signed-off-by: Anup Patel Signed-off-by: Marc Zyngier Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200518091441.94843-2-anup.patel@wdc.com commit cc86432aa8cc5a81f99d79eea2a29099da694df3 Author: Valentin Schneider Date: Thu May 21 23:35:00 2020 +0100 irqchip/gic-v2, v3: Drop extra IRQ_NOAUTOEN setting for (E)PPIs (E)PPIs are per-CPU interrupts, so we want each CPU to go and enable them via enable_percpu_irq(); this also means we want IRQ_NOAUTOEN for them as the autoenable would lead to calling irq_enable() instead of the more appropriate irq_percpu_enable(). Calling irq_set_percpu_devid() is enough to get just that since it trickles down to irq_set_percpu_devid_flags(), which gives us IRQ_NOAUTOEN (and a few others). Setting IRQ_NOAUTOEN *again* right after this call is just redundant, so don't do it. Signed-off-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200521223500.834-1-valentin.schneider@arm.com commit bbcd1f4d52587d4f6a90692d896cf06a37b6554a Author: Filipe Manana Date: Mon May 18 17:34:23 2020 +0100 btrfs: turn space cache writeout failure messages into debug messages Since commit 1afb648e945428 ("btrfs: use standard debug config option to enable free-space-cache debug prints"), we started to log error messages that were never logged before since there was no DEBUG macro defined anywhere. This started to make test case btrfs/187 to fail very often, as it greps for any btrfs error messages in dmesg/syslog and fails if any is found: (...) btrfs/186 1s ... 2s btrfs/187 - output mismatch (see .../results//btrfs/187.out.bad) \--- tests/btrfs/187.out 2019-05-17 12:48:32.537340749 +0100 \+++ /home/fdmanana/git/hub/xfstests/results//btrfs/187.out.bad ... \@@ -1,3 +1,8 @@ QA output created by 187 Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +[268364.139958] BTRFS error (device sdc): failed to write free space cache for block group 30408704 +[268380.156503] BTRFS error (device sdc): failed to write free space cache for block group 30408704 +[268380.161703] BTRFS error (device sdc): failed to write free space cache for block group 30408704 +[268380.253180] BTRFS error (device sdc): failed to write free space cache for block group 30408704 ... (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/187.out ... btrfs/188 4s ... 2s (...) The space cache write failures happen due to ENOSPC when attempting to update the free space cache items in the root tree. This happens because when starting or joining a transaction we don't know how many block groups we will end up changing (due to extent allocation or release) and therefore never reserve space for updating free space cache items. More often than not, the free space cache writeout succeeds since the metadata space info is not yet full nor very close to being full, but when it is, the space cache writeout fails with ENOSPC. Occasional failures to write space caches are not considered critical since they can be rebuilt when mounting the filesystem or the next attempt to write a free space cache in the next transaction commit might succeed, so we used to hide those error messages with a preprocessor check for the existence of the DEBUG macro that was never enabled anywhere. A few other generic test cases also trigger the error messages due to ENOSPC failure when writing free space caches as well, however they don't fail since they don't grep dmesg/syslog for any btrfs specific error messages. So change the messages from 'error' level to 'debug' level, as it doesn't make much sense to have error messages triggered only if the debug macro is enabled plus, more importantly, the error is not serious nor highly unexpected. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2e69a7a60d8d93b19f520bf4179614188a6cfdf5 Author: Filipe Manana Date: Mon May 18 17:34:11 2020 +0100 btrfs: include error on messages about failure to write space/inode caches Currently the error messages logged when we fail to write a free space cache or an inode cache are not very useful as they don't mention what was the error. So include the error number in the messages. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 918cdf442326e5eaa808258e403c6a6e2dc23113 Author: Filipe Manana Date: Mon May 18 12:15:18 2020 +0100 btrfs: remove useless 'fail_unlock' label from btrfs_csum_file_blocks() The label 'fail_unlock' is pointless, all it does is to jump to the label 'out', so just remove it. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7e4a3f7ed5d54926ec671bbb13e171cfe179cc50 Author: Filipe Manana Date: Mon May 18 12:15:09 2020 +0100 btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums We are currently treating any non-zero return value from btrfs_next_leaf() the same way, by going to the code that inserts a new checksum item in the tree. However if btrfs_next_leaf() returns an error (a value < 0), we should just stop and return the error, and not behave as if nothing has happened, since in that case we do not have a way to know if there is a next leaf or we are currently at the last leaf already. So fix that by returning the error from btrfs_next_leaf(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit cc14600c1516f6c679cab1c503a34841d58050a6 Author: Filipe Manana Date: Mon May 18 12:15:00 2020 +0100 btrfs: make checksum item extension more efficient When we want to add checksums into the checksums tree, or a log tree, we try whenever possible to extend existing checksum items, as this helps reduce amount of metadata space used, since adding a new item uses extra metadata space for a btrfs_item structure (25 bytes). However we have two inefficiencies in the current approach: 1) After finding a checksum item that covers a range with an end offset that matches the start offset of the checksum range we want to insert, we release the search path populated by btrfs_lookup_csum() and then do another COW search on tree with the goal of getting additional space for at least one checksum. Doing this path release and then searching again is a waste of time because very often the leaf already has enough free space for at least one more checksum; 2) After the COW search that guarantees we get free space in the leaf for at least one more checksum, we end up not doing the extension of the previous checksum item, and fallback to insertion of a new checksum item, if the leaf doesn't have an amount of free space larger then the space required for 2 checksums plus one btrfs_item structure - this is pointless for two reasons: a) We want to extend an existing item, so we don't need to account for a btrfs_item structure (25 bytes); b) We made the COW search with an insertion size for 1 single checksum, so if the leaf ends up with a free space amount smaller then 2 checksums plus the size of a btrfs_item structure, we give up on the extension of the existing item and jump to the 'insert' label, where we end up releasing the path and then doing yet another search to insert a new checksum item for a single checksum. Fix these inefficiencies by doing the following: - For case 1), before releasing the path just check if the leaf already has enough space for at least 1 more checksum, and if it does, jump directly to the item extension code, with releasing our current path, which was already COWed by btrfs_lookup_csum(); - For case 2), fix the logic so that for item extension we require only that the leaf has enough free space for 1 checksum, and not a minimum of 2 checksums plus space for a btrfs_item structure. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e289f03ea79bbc6574b78ac25682555423a91cbb Author: Filipe Manana Date: Mon May 18 12:14:50 2020 +0100 btrfs: fix corrupt log due to concurrent fsync of inodes with shared extents When we have extents shared amongst different inodes in the same subvolume, if we fsync them in parallel we can end up with checksum items in the log tree that represent ranges which overlap. For example, consider we have inodes A and B, both sharing an extent that covers the logical range from X to X + 64KiB: 1) Task A starts an fsync on inode A; 2) Task B starts an fsync on inode B; 3) Task A calls btrfs_csum_file_blocks(), and the first search in the log tree, through btrfs_lookup_csum(), returns -EFBIG because it finds an existing checksum item that covers the range from X - 64KiB to X; 4) Task A checks that the checksum item has not reached the maximum possible size (MAX_CSUM_ITEMS) and then releases the search path before it does another path search for insertion (through a direct call to btrfs_search_slot()); 5) As soon as task A releases the path and before it does the search for insertion, task B calls btrfs_csum_file_blocks() and gets -EFBIG too, because there is an existing checksum item that has an end offset that matches the start offset (X) of the checksum range we want to log; 6) Task B releases the path; 7) Task A does the path search for insertion (through btrfs_search_slot()) and then verifies that the checksum item that ends at offset X still exists and extends its size to insert the checksums for the range from X to X + 64KiB; 8) Task A releases the path and returns from btrfs_csum_file_blocks(), having inserted the checksums into an existing checksum item that got its size extended. At this point we have one checksum item in the log tree that covers the logical range from X - 64KiB to X + 64KiB; 9) Task B now does a search for insertion using btrfs_search_slot() too, but it finds that the previous checksum item no longer ends at the offset X, it now ends at an of offset X + 64KiB, so it leaves that item untouched. Then it releases the path and calls btrfs_insert_empty_item() that inserts a checksum item with a key offset corresponding to X and a size for inserting a single checksum (4 bytes in case of crc32c). Subsequent iterations end up extending this new checksum item so that it contains the checksums for the range from X to X + 64KiB. So after task B returns from btrfs_csum_file_blocks() we end up with two checksum items in the log tree that have overlapping ranges, one for the range from X - 64KiB to X + 64KiB, and another for the range from X to X + 64KiB. Having checksum items that represent ranges which overlap, regardless of being in the log tree or in the chekcsums tree, can lead to problems where checksums for a file range end up not being found. This type of problem has happened a few times in the past and the following commits fixed them and explain in detail why having checksum items with overlapping ranges is problematic: 27b9a8122ff71a "Btrfs: fix csum tree corruption, duplicate and outdated checksums" b84b8390d6009c "Btrfs: fix file read corruption after extent cloning and fsync" 40e046acbd2f36 "Btrfs: fix missing data checksums after replaying a log tree" Since this specific instance of the problem can only happen when logging inodes, because it is the only case where concurrent attempts to insert checksums for the same range can happen, fix the issue by using an extent io tree as a range lock to serialize checksum insertion during inode logging. This issue could often be reproduced by the test case generic/457 from fstests. When it happens it produces the following trace: BTRFS critical (device dm-0): corrupt leaf: root=18446744073709551610 block=30625792 slot=42, csum end range (15020032) goes beyond the start range (15015936) of the next csum item BTRFS info (device dm-0): leaf 30625792 gen 7 total ptrs 49 free space 2402 owner 18446744073709551610 BTRFS info (device dm-0): refs 1 lock (w:0 r:0 bw:0 br:0 sw:0 sr:0) lock_owner 0 current 15884 item 0 key (18446744073709551606 128 13979648) itemoff 3991 itemsize 4 item 1 key (18446744073709551606 128 13983744) itemoff 3987 itemsize 4 item 2 key (18446744073709551606 128 13987840) itemoff 3983 itemsize 4 item 3 key (18446744073709551606 128 13991936) itemoff 3979 itemsize 4 item 4 key (18446744073709551606 128 13996032) itemoff 3975 itemsize 4 item 5 key (18446744073709551606 128 14000128) itemoff 3971 itemsize 4 (...) BTRFS error (device dm-0): block=30625792 write time tree block corruption detected ------------[ cut here ]------------ WARNING: CPU: 1 PID: 15884 at fs/btrfs/disk-io.c:539 btree_csum_one_bio+0x268/0x2d0 [btrfs] Modules linked in: btrfs dm_thin_pool ... CPU: 1 PID: 15884 Comm: fsx Tainted: G W 5.6.0-rc7-btrfs-next-58 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 RIP: 0010:btree_csum_one_bio+0x268/0x2d0 [btrfs] Code: c7 c7 ... RSP: 0018:ffffbb0109e6f8e0 EFLAGS: 00010296 RAX: 0000000000000000 RBX: ffffe1c0847b6080 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffffaa963988 RDI: 0000000000000001 RBP: ffff956a4f4d2000 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000526 R11: 0000000000000000 R12: ffff956a5cd28bb0 R13: 0000000000000000 R14: ffff956a649c9388 R15: 000000011ed82000 FS: 00007fb419959e80(0000) GS:ffff956a7aa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000fe6d54 CR3: 0000000138696005 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btree_submit_bio_hook+0x67/0xc0 [btrfs] submit_one_bio+0x31/0x50 [btrfs] btree_write_cache_pages+0x2db/0x4b0 [btrfs] ? __filemap_fdatawrite_range+0xb1/0x110 do_writepages+0x23/0x80 __filemap_fdatawrite_range+0xd2/0x110 btrfs_write_marked_extents+0x15e/0x180 [btrfs] btrfs_sync_log+0x206/0x10a0 [btrfs] ? kmem_cache_free+0x315/0x3b0 ? btrfs_log_inode+0x1e8/0xf90 [btrfs] ? __mutex_unlock_slowpath+0x45/0x2a0 ? lockref_put_or_lock+0x9/0x30 ? dput+0x2d/0x580 ? dput+0xb5/0x580 ? btrfs_sync_file+0x464/0x4d0 [btrfs] btrfs_sync_file+0x464/0x4d0 [btrfs] do_fsync+0x38/0x60 __x64_sys_fsync+0x10/0x20 do_syscall_64+0x5c/0x280 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fb41953a6d0 Code: 48 3d ... RSP: 002b:00007ffcc86bd218 EFLAGS: 00000246 ORIG_RAX: 000000000000004a RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007fb41953a6d0 RDX: 0000000000000009 RSI: 0000000000040000 RDI: 0000000000000003 RBP: 0000000000040000 R08: 0000000000000001 R09: 0000000000000009 R10: 0000000000000064 R11: 0000000000000246 R12: 0000556cf4b2c060 R13: 0000000000000100 R14: 0000000000000000 R15: 0000556cf322b420 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0x74f/0x2020 softirqs last enabled at (0): [] copy_process+0x74f/0x2020 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace d543fc76f5ad7fd8 ]--- In that trace the tree checker detected the overlapping checksum items at the time when we triggered writeback for the log tree when syncing the log. Another trace that can happen is due to BUG_ON() when deleting checksum items while logging an inode: BTRFS critical (device dm-0): slot 81 key (18446744073709551606 128 13635584) new key (18446744073709551606 128 13635584) BTRFS info (device dm-0): leaf 30949376 gen 7 total ptrs 98 free space 8527 owner 18446744073709551610 BTRFS info (device dm-0): refs 4 lock (w:1 r:0 bw:0 br:0 sw:1 sr:0) lock_owner 13473 current 13473 item 0 key (257 1 0) itemoff 16123 itemsize 160 inode generation 7 size 262144 mode 100600 item 1 key (257 12 256) itemoff 16103 itemsize 20 item 2 key (257 108 0) itemoff 16050 itemsize 53 extent data disk bytenr 13631488 nr 4096 extent data offset 0 nr 131072 ram 131072 (...) ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.c:3153! invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI CPU: 1 PID: 13473 Comm: fsx Not tainted 5.6.0-rc7-btrfs-next-58 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 RIP: 0010:btrfs_set_item_key_safe+0x1ea/0x270 [btrfs] Code: 0f b6 ... RSP: 0018:ffff95e3889179d0 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000051 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffffb7763988 RDI: 0000000000000001 RBP: fffffffffffffff6 R08: 0000000000000000 R09: 0000000000000001 R10: 00000000000009ef R11: 0000000000000000 R12: ffff8912a8ba5a08 R13: ffff95e388917a06 R14: ffff89138dcf68c8 R15: ffff95e388917ace FS: 00007fe587084e80(0000) GS:ffff8913baa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe587091000 CR3: 0000000126dac005 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_del_csums+0x2f4/0x540 [btrfs] copy_items+0x4b5/0x560 [btrfs] btrfs_log_inode+0x910/0xf90 [btrfs] btrfs_log_inode_parent+0x2a0/0xe40 [btrfs] ? dget_parent+0x5/0x370 btrfs_log_dentry_safe+0x4a/0x70 [btrfs] btrfs_sync_file+0x42b/0x4d0 [btrfs] __x64_sys_msync+0x199/0x200 do_syscall_64+0x5c/0x280 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fe586c65760 Code: 00 f7 ... RSP: 002b:00007ffe250f98b8 EFLAGS: 00000246 ORIG_RAX: 000000000000001a RAX: ffffffffffffffda RBX: 00000000000040e1 RCX: 00007fe586c65760 RDX: 0000000000000004 RSI: 0000000000006b51 RDI: 00007fe58708b000 RBP: 0000000000006a70 R08: 0000000000000003 R09: 00007fe58700cb61 R10: 0000000000000100 R11: 0000000000000246 R12: 00000000000000e1 R13: 00007fe58708b000 R14: 0000000000006b51 R15: 0000558de021a420 Modules linked in: dm_log_writes ... ---[ end trace c92a7f447a8515f5 ]--- CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit adbab6420c973f37079b1ce9b7e8a12f54810250 Author: Anand Jain Date: Mon May 11 22:37:51 2020 -0700 btrfs: unexport btrfs_compress_set_level() btrfs_compress_set_level() can be static function in the file compression.c. Reviewed-by: Johannes Thumshirn Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0202e83fdab05b3bf641804afea57a2bfcbcbd70 Author: David Sterba Date: Fri May 15 19:35:59 2020 +0200 btrfs: simplify iget helpers The inode lookup starting at btrfs_iget takes the full location key, while only the objectid is used to match the inode, because the lookup happens inside the given root thus the inode number is unique. The entire location key is properly set up in btrfs_init_locked_inode. Simplify the helpers and pass only inode number, renaming it to 'ino' instead of 'objectid'. This allows to remove temporary variables key, saving some stack space. Signed-off-by: David Sterba commit a820feb546842a4ab5678279a62d4450320e6696 Author: David Sterba Date: Fri May 15 19:35:57 2020 +0200 btrfs: open code read_fs_root After the update to btrfs_get_fs_root, read_fs_root has become trivial wrapper that can be open coded. Signed-off-by: David Sterba commit 56e9357a1e8167134388d4c70654795353765c7b Author: David Sterba Date: Fri May 15 19:35:55 2020 +0200 btrfs: simplify root lookup by id The main function to lookup a root by its id btrfs_get_fs_root takes the whole key, while only using the objectid. The value of offset is preset to (u64)-1 but not actually used until btrfs_find_root that does the actual search. Switch btrfs_get_fs_root to use only objectid and remove all local variables that existed just for the lookup. The actual key for search is set up in btrfs_get_fs_root, reusing another key variable. Signed-off-by: David Sterba commit 1dae7e0e58b484eaa43d530f211098fdeeb0f404 Author: Qu Wenruo Date: Wed May 20 14:58:51 2020 +0800 btrfs: reloc: clear DEAD_RELOC_TREE bit for orphan roots to prevent runaway balance [BUG] There are several reported runaway balance, that balance is flooding the log with "found X extents" where the X never changes. [CAUSE] Commit d2311e698578 ("btrfs: relocation: Delay reloc tree deletion after merge_reloc_roots") introduced BTRFS_ROOT_DEAD_RELOC_TREE bit to indicate that one subvolume has finished its tree blocks swap with its reloc tree. However if balance is canceled or hits ENOSPC halfway, we didn't clear the BTRFS_ROOT_DEAD_RELOC_TREE bit, leaving that bit hanging forever until unmount. Any subvolume root with that bit, would cause backref cache to skip this tree block, as it has finished its tree block swap. This would cause all tree blocks of that root be ignored by balance, leading to runaway balance. [FIX] Fix the problem by also clearing the BTRFS_ROOT_DEAD_RELOC_TREE bit for the original subvolume of orphan reloc root. Add an umount check for the stale bit still set. Fixes: d2311e698578 ("btrfs: relocation: Delay reloc tree deletion after merge_reloc_roots") Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 51415b6c1b117e223bc083e30af675cb5c5498f3 Author: Qu Wenruo Date: Tue May 19 10:13:20 2020 +0800 btrfs: reloc: fix reloc root leak and NULL pointer dereference [BUG] When balance is canceled, there is a pretty high chance that unmounting the fs can lead to lead the NULL pointer dereference: BTRFS warning (device dm-3): page private not zero on page 223158272 ... BTRFS warning (device dm-3): page private not zero on page 223162368 BTRFS error (device dm-3): leaked root 18446744073709551608-304 refcount 1 BUG: kernel NULL pointer dereference, address: 0000000000000168 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 2 PID: 5793 Comm: umount Tainted: G O 5.7.0-rc5-custom+ #53 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:__lock_acquire+0x5dc/0x24c0 Call Trace: lock_acquire+0xab/0x390 _raw_spin_lock+0x39/0x80 btrfs_release_extent_buffer_pages+0xd7/0x200 [btrfs] release_extent_buffer+0xb2/0x170 [btrfs] free_extent_buffer+0x66/0xb0 [btrfs] btrfs_put_root+0x8e/0x130 [btrfs] btrfs_check_leaked_roots.cold+0x5/0x5d [btrfs] btrfs_free_fs_info+0xe5/0x120 [btrfs] btrfs_kill_super+0x1f/0x30 [btrfs] deactivate_locked_super+0x3b/0x80 deactivate_super+0x3e/0x50 cleanup_mnt+0x109/0x160 __cleanup_mnt+0x12/0x20 task_work_run+0x67/0xa0 exit_to_usermode_loop+0xc5/0xd0 syscall_return_slowpath+0x205/0x360 do_syscall_64+0x6e/0xb0 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x7fd028ef740b [CAUSE] When balance is canceled, all reloc roots are marked as orphan, and orphan reloc roots are going to be cleaned up. However for orphan reloc roots and merged reloc roots, their lifespan are quite different: Merged reloc roots | Orphan reloc roots by cancel -------------------------------------------------------------------- create_reloc_root() | create_reloc_root() |- refs == 1 | |- refs == 1 | btrfs_grab_root(reloc_root); | btrfs_grab_root(reloc_root); |- refs == 2 | |- refs == 2 | root->reloc_root = reloc_root; | root->reloc_root = reloc_root; >>> No difference so far <<< | prepare_to_merge() | prepare_to_merge() |- btrfs_set_root_refs(item, 1);| |- if (!err) (err == -EINTR) | merge_reloc_roots() | merge_reloc_roots() |- merge_reloc_root() | |- Doing nothing to put reloc root |- insert_dirty_subvol() | |- refs == 2 |- __del_reloc_root() | |- btrfs_put_root() | |- refs == 1 | >>> Now orphan reloc roots still have refs 2 <<< | clean_dirty_subvols() | clean_dirty_subvols() |- btrfs_drop_snapshot() | |- btrfS_drop_snapshot() |- reloc_root get freed | |- reloc_root still has refs 2 | related ebs get freed, but | reloc_root still recorded in | allocated_roots btrfs_check_leaked_roots() | btrfs_check_leaked_roots() |- No leaked roots | |- Leaked reloc_roots detected | |- btrfs_put_root() | |- free_extent_buffer(root->node); | |- eb already freed, caused NULL | pointer dereference [FIX] The fix is to clear fs_root->reloc_root and put it at merge_reloc_roots() time, so that we won't leak reloc roots. Fixes: d2311e698578 ("btrfs: relocation: Delay reloc tree deletion after merge_reloc_roots") CC: stable@vger.kernel.org # 5.1+ Tested-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit c11fbb6ed0ddc11b992f9c668b79505d31956368 Author: Robbie Ko Date: Thu May 14 17:19:18 2020 +0800 btrfs: reduce lock contention when creating snapshot When creating a snapshot, ordered extents need to be flushed and this can take a long time. In create_snapshot there are two locks held when this happens: 1. Destination directory inode lock 2. Global subvolume semaphore This will unnecessarily block other operations like subvolume destroy, create, or setflag until the snapshot is created. We can fix that by moving the flush outside the locked section as this does not depend on the aforementioned locks. The code factors out the snapshot related work from create_snapshot to btrfs_mksnapshot. __btrfs_ioctl_snap_create btrfs_mksubvol create_subvol btrfs_mksnapshot btrfs_mksubvol create_snapshot Reviewed-by: Filipe Manana Signed-off-by: Robbie Ko Reviewed-by: David Sterba Signed-off-by: David Sterba commit aeb935a455812e0ec15e15801f7a42d887e6c22f Author: Qu Wenruo Date: Fri May 15 14:01:42 2020 +0800 btrfs: don't set SHAREABLE flag for data reloc tree SHAREABLE flag is set for subvolumes because users can create snapshot for subvolumes, thus sharing tree blocks of them. But data reloc tree is not exposed to user space, as it's only an internal tree for data relocation, thus it doesn't need the full path replacement handling at all. This patch will make data reloc tree a non-shareable tree, and add btrfs_fs_info::data_reloc_root for data reloc tree, so relocation code can grab it from fs_info directly. This would slightly improve tree relocation, as now data reloc tree can go through regular COW routine to get relocated, without bothering the complex tree reloc tree routine. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 82028e0a2a9b7a3db6ef1f1885c580a37ab9eebb Author: Qu Wenruo Date: Fri May 15 14:01:41 2020 +0800 btrfs: inode: cleanup the log-tree exceptions in btrfs_truncate_inode_items() There are a lot of root owner checks in btrfs_truncate_inode_items() like: if (test_bit(BTRFS_ROOT_SHAREABLE, &root->state) || root == fs_info->tree_root) But considering that, only these trees can have INODE_ITEMs: - tree root (for v1 space cache) - subvolume trees - tree reloc trees - data reloc tree - log trees And since subvolume/tree reloc/data reloc trees all have SHAREABLE bit, and we're checking tree root manually, so above check is just excluding log trees. This patch will replace two of such checks to a simpler one: if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) This would merge btrfs_drop_extent_cache() and lock_extent_bits() call into the same if branch. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 92a7cc4252231d1641b36c38cf845cfc50308ab0 Author: Qu Wenruo Date: Fri May 15 14:01:40 2020 +0800 btrfs: rename BTRFS_ROOT_REF_COWS to BTRFS_ROOT_SHAREABLE The name BTRFS_ROOT_REF_COWS is not very clear about the meaning. In fact, that bit can only be set to those trees: - Subvolume roots - Data reloc root - Reloc roots for above roots All other trees won't get this bit set. So just by the result, it is obvious that, roots with this bit set can have tree blocks shared with other trees. Either shared by snapshots, or by reloc roots (an special snapshot created by relocation). This patch will rename BTRFS_ROOT_REF_COWS to BTRFS_ROOT_SHAREABLE to make it easier to understand, and update all comment mentioning "reference counted" to follow the rename. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ae3e715f85fff878b317369b898cf4b89785c80a Author: Anand Jain Date: Thu May 14 01:42:45 2020 +0800 btrfs: drop stale reference to volume_mutex Commit dccdb07bc996 ("btrfs: kill btrfs_fs_info::volume_mutex") removed the last use of the volume_mutex, forgetting to update the comment. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 583e4a2384db843fa8ae9a67aff8ea0eed140e61 Author: David Sterba Date: Wed May 6 20:54:13 2020 +0200 btrfs: update documentation of set/get helpers Signed-off-by: David Sterba commit f472d3c28385397b1a2891c4ec264b90cd6d2187 Author: David Sterba Date: Thu Apr 30 17:57:55 2020 +0200 btrfs: optimize split page write in btrfs_set_token_##bits The fallback path calls helper write_extent_buffer to do write of the data spanning two extent buffer pages. As the size is known, we can do the write directly in two steps. This removes one function call and compiler can optimize memcpy as the sizes are known at compile time. The cached token address is set to the second page. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit f4ca8c51d12631f1297d093f767c3a5ce5b95aff Author: David Sterba Date: Thu Apr 30 17:57:55 2020 +0200 btrfs: optimize split page write in btrfs_set_##bits The helper write_extent_buffer is called to do write of the data spanning two extent buffer pages. As the size is known, we can do the write directly in two steps. This removes one function call and compiler can optimize memcpy as the sizes are known at compile time. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit ba8a9a0537770df69d9dc38c11312c9b0f840cf2 Author: David Sterba Date: Thu Apr 30 17:57:55 2020 +0200 btrfs: optimize split page read in btrfs_get_token_##bits The fallback path calls helper read_extent_buffer to do read of the data spanning two extent buffer pages. As the size is known, we can do the read directly in two steps. This removes one function call and compiler can optimize memcpy as the sizes are known at compile time. The cached token address is set to the second page. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 84da071f3df5a9c0df0352d1c52b0c36ddb1c53f Author: David Sterba Date: Thu Apr 30 17:57:55 2020 +0200 btrfs: optimize split page read in btrfs_get_##bits The helper read_extent_buffer is called to do read of the data spanning two extent buffer pages. As the size is known, we can do the read directly in two steps. This removes one function call and compiler can optimize memcpy as the sizes are known at compile time. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit c60ac0ffd682fc04f564dd6f4cc1a77c0f94608b Author: David Sterba Date: Wed Apr 29 23:41:20 2020 +0200 btrfs: drop unnecessary offset_in_page in extent buffer helpers Helpers that iterate over extent buffer pages set up several variables, one of them is finding out offset of the extent buffer start within a page. Right now we have extent buffers aligned to page sizes so this is effectively storing zero. This makes the code harder the follow and can be simplified. The same change is done in all the helpers: * remove: size_t start_offset = offset_in_page(eb->start); * simplify code using start_offset Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 2b48966a4da4bcb35f0883bc23dcaf63fcb8557f Author: David Sterba Date: Wed Apr 29 03:04:10 2020 +0200 btrfs: constify extent_buffer in the API functions There are many helpers around extent buffers, found in extent_io.h and ctree.h. Most of them can be converted to take constified eb as there are no changes to the extent buffer structure itself but rather the pages. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit db3756c879773c4c7986fce3dac8355f210df807 Author: David Sterba Date: Wed Apr 29 23:36:03 2020 +0200 btrfs: remove unused map_private_extent_buffer All uses of map_private_extent_buffer have been replaced by more effective way. The set/get helpers have their own bounds checker. The function name was confusing since the non-private helper was removed in a65917156e34 ("Btrfs: stop using highmem for extent_buffers") many years ago. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 5cd17f343bd1c47dc673260fa2973abc14ecc549 Author: David Sterba Date: Wed Apr 29 23:23:37 2020 +0200 btrfs: speed up and simplify generic_bin_search The bin search jumps over the extent buffer item keys, comparing directly the bytes if the key is in one page, or storing it in a temporary buffer in case it spans two pages. The mapping start and length are obtained from map_private_extent_buffer, which is heavy weight compared to what we need. We know the key size and can find out the eb page in a simple way. For keys spanning two pages the fallback read_extent_buffer is used. The temporary variables are reduced and moved to the scope of use. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit ce7afe8782a5293edbf4bc2165ac4a866ed430db Author: David Sterba Date: Wed Apr 29 18:23:37 2020 +0200 btrfs: speed up btrfs_set_token_##bits helpers The set/get token helpers either use the cached address in the token or unconditionally call map_private_extent_buffer to get the address of page containing the requested offset plus the mapping start and length. Depending on the return value, the fast path uses unaligned put to write data within a page, or fall back to write_extent_buffer that can handle writes spanning more pages. This is all wasteful. We know the number of bytes to write, 1/2/4/8 and can find out the page. Then simply check if it's contained or the fallback is needed. The token address is updated to the page, or the on the next index, expecting that the next write will use that. This saves one function call to map_private_extent_buffer and several unnecessary temporary variables. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 029e4a42a2b22f3c82e5b325820219963aa3f13b Author: David Sterba Date: Wed Apr 29 18:07:04 2020 +0200 btrfs: speed up btrfs_set_##bits helpers The helpers unconditionally call map_private_extent_buffer to get the address of page containing the requested offset plus the mapping start and length. Depending on the return value, the fast path uses unaligned put to write data within a page, or fall back to write_extent_buffer that can handle writes spanning more pages. This is all wasteful. We know the number of bytes to write, 1/2/4/8 and can find out the page. Then simply check if it's contained or the fallback is needed. This saves one function call to map_private_extent_buffer and several unnecessary temporary variables. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 8f9da810ee1fac6b587e3b871ee73696906bcba3 Author: David Sterba Date: Wed Apr 29 17:45:33 2020 +0200 btrfs: speed up btrfs_get_token_##bits helpers The set/get token helpers either use the cached address in the token or unconditionally call map_private_extent_buffer to get the address of page containing the requested offset plus the mapping start and length. Depending on the return value, the fast path uses unaligned read to get data within a page, or fall back to read_extent_buffer that can handle reads spanning more pages. This is all wasteful. We know the number of bytes to read, 1/2/4/8 and can find out the page. Then simply check if it's contained or the fallback is needed. The token address is updated to the page, or the on the next index, expecting that the next read will use that. This saves one function call to map_private_extent_buffer and several unnecessary temporary variables. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 1441ed9b7a0f53f47afd0b5ccdcb447e50559165 Author: David Sterba Date: Wed Apr 29 16:04:44 2020 +0200 btrfs: speed up btrfs_get_##bits helpers The helpers unconditionally call map_private_extent_buffer to get the address of page containing the requested offset plus the mapping start and length. Depending on the return value, the fast path uses unaligned read to get data within a page, or fall back to read_extent_buffer that can handle reads spanning more pages. This is all wasteful. We know the number of bytes to read, 1/2/4/8 and can find out the page. Then simply check if it's contained or the fallback is needed. This saves one function call to map_private_extent_buffer and several unnecessary temporary variables. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 5e3946890c184a17b4d74baec89c96dce518f002 Author: David Sterba Date: Thu Apr 30 23:38:11 2020 +0200 btrfs: add separate bounds checker for set/get helpers The bounds checking is now done in map_private_extent_buffer but that will be removed in following patches and some sanity checks should still be done. There are two separate checks to see the kind of out of bounds access: partial (start offset is in the buffer) or complete (both start and end are out). Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 870b388db02cac33eebe40a1cbeb056cf13e9f40 Author: David Sterba Date: Wed Apr 29 19:29:04 2020 +0200 btrfs: preset set/get token with first page and drop condition All the set/get helpers first check if the token contains a cached address. After first use the address is always valid, but the extra check is done for each call. The token initialization can optimistically set it to the first extent buffer page, that we know always exists. Then the condition in all btrfs_token_*/btrfs_set_token_* can be simplified by removing the address check from the condition, but for development the assertion still makes sure it's valid. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit a31356b9e263b723d4991383efc87b71c6e87991 Author: David Sterba Date: Wed Apr 29 22:56:01 2020 +0200 btrfs: don't use set/get token in leaf_space_used The token is supposed to cache the last page used by the set/get helpers. In leaf_space_used the first and last items are accessed, it's not likely they'd be on the same page so there's some overhead caused updating the token address but not using it. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 60d48e2e4575dd848a43ceeda6cbc38a87427330 Author: David Sterba Date: Wed Apr 29 15:29:53 2020 +0200 btrfs: don't use set/get token for single assignment in overwrite_item The set/get token is supposed to cache the last page that was accessed so it speeds up subsequential access to the eb. It does not make sense to use that for just one change, which is the case of inode size in overwrite_item. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit cc4c13d55cba8a0b81bc18243eabc57be1aa44d2 Author: David Sterba Date: Wed Apr 29 02:15:56 2020 +0200 btrfs: drop eb parameter from set/get token helpers Now that all set/get helpers use the eb from the token, we don't need to pass it to many btrfs_token_*/btrfs_set_token_* helpers, saving some stack space. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 4dae666a6286ce5d9f4890f8b88af646473686f0 Author: David Sterba Date: Wed Apr 29 02:13:57 2020 +0200 btrfs: use the token::eb for all set/get helpers The token stores a copy of the extent buffer pointer but does not make any use of it besides sanity checks. We can use it and drop the eb parameter from several functions, this patch only switches the use inside the set/get helpers. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit f2998ebd32e25e432e3d0058552e4777c5aba75a Author: Tiezhu Yang Date: Tue May 12 11:55:03 2020 +0800 btrfs: remove duplicated include in block-group.c disk-io.h is included more than once in block-group.c, remove it. Reviewed-by: Johannes Thumshirn Signed-off-by: Tiezhu Yang Signed-off-by: David Sterba commit 3be4d8efe3cf218350cf2c3f39136a636698c572 Author: Qu Wenruo Date: Tue May 5 07:58:23 2020 +0800 btrfs: block-group: rename write_one_cache_group() The name of this function contains the word "cache", which is left from the times where btrfs_block_group was called btrfs_block_group_cache. Now this "cache" doesn't match anything, and we have better namings for functions like read/insert/remove_block_group_item(). Rename it to update_block_group_item(). Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 97f4728af88822ddd13941c3ac84a4ce3a9ff823 Author: Qu Wenruo Date: Tue May 5 07:58:22 2020 +0800 btrfs: block-group: refactor how we insert a block group item Currently the block group item insert is pretty straight forward, fill the block group item structure and insert it into extent tree. However the incoming skinny block group feature is going to change this, so this patch will refactor insertion into a new function, insert_block_group_item(), to make the incoming feature easier to add. Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7357623a7f4beb4ac76005f8fac9fc0230f9a67e Author: Qu Wenruo Date: Tue May 5 07:58:21 2020 +0800 btrfs: block-group: refactor how we delete one block group item When deleting a block group item, it's pretty straight forward, just delete the item pointed by the key. However it will not be that straight-forward for incoming skinny block group item. So refactor the block group item deletion into a new function, remove_block_group_item(), also to make the already lengthy btrfs_remove_block_group() a little shorter. Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9afc66498a0b5f76928f9823b58c55c5dfb06ae5 Author: Qu Wenruo Date: Tue May 5 07:58:20 2020 +0800 btrfs: block-group: refactor how we read one block group item Structure btrfs_block_group has the following members which are currently read from on-disk block group item and key: - length - from item key - used - flags - from block group item However for incoming skinny block group tree, we are going to read those members from different sources. This patch will refactor such read by: - Don't initialize btrfs_block_group::length at allocation Caller should initialize them manually. Also to avoid possible (well, only two callers) missing initialization, add extra ASSERT() in btrfs_add_block_group_cache(). - Refactor length/used/flags initialization into one function The new function, fill_one_block_group() will handle the initialization of such members. - Use btrfs_block_group::length to replace key::offset Since skinny block group item would have a different meaning for its key offset. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 83fe9e12b0558eae519351cff00da1e06bc054d2 Author: Qu Wenruo Date: Tue May 5 07:58:19 2020 +0800 btrfs: block-group: don't set the wrong READA flag for btrfs_read_block_groups() Regular block group items in extent tree are scattered inside the huge tree, thus forward readahead makes no sense. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 89efda52e6b6930f80f5adda9c3c9edfb1397191 Author: Marcos Paulo de Souza Date: Sun May 10 23:15:07 2020 -0300 btrfs: send: emit file capabilities after chown Whenever a chown is executed, all capabilities of the file being touched are lost. When doing incremental send with a file with capabilities, there is a situation where the capability can be lost on the receiving side. The sequence of actions bellow shows the problem: $ mount /dev/sda fs1 $ mount /dev/sdb fs2 $ touch fs1/foo.bar $ setcap cap_sys_nice+ep fs1/foo.bar $ btrfs subvolume snapshot -r fs1 fs1/snap_init $ btrfs send fs1/snap_init | btrfs receive fs2 $ chgrp adm fs1/foo.bar $ setcap cap_sys_nice+ep fs1/foo.bar $ btrfs subvolume snapshot -r fs1 fs1/snap_complete $ btrfs subvolume snapshot -r fs1 fs1/snap_incremental $ btrfs send fs1/snap_complete | btrfs receive fs2 $ btrfs send -p fs1/snap_init fs1/snap_incremental | btrfs receive fs2 At this point, only a chown was emitted by "btrfs send" since only the group was changed. This makes the cap_sys_nice capability to be dropped from fs2/snap_incremental/foo.bar To fix that, only emit capabilities after chown is emitted. The current code first checks for xattrs that are new/changed, emits them, and later emit the chown. Now, __process_new_xattr skips capabilities, letting only finish_inode_if_needed to emit them, if they exist, for the inode being processed. This behavior was being worked around in "btrfs receive" side by caching the capability and only applying it after chown. Now, xattrs are only emmited _after_ chown, making that workaround not needed anymore. Link: https://github.com/kdave/btrfs-progs/issues/202 CC: stable@vger.kernel.org # 4.4+ Suggested-by: Filipe Manana Reviewed-by: Filipe Manana Signed-off-by: Marcos Paulo de Souza Signed-off-by: David Sterba commit 89490303a4294238b84c83541c140e540faa17ba Author: Filipe Manana Date: Fri May 8 11:02:07 2020 +0100 btrfs: scrub, only lookup for csums if we are dealing with a data extent When scrubbing a stripe, whenever we find an extent we lookup for its checksums in the checksum tree. However we do it even for metadata extents which don't have checksum items stored in the checksum tree, that is only for data extents. So make the lookup for checksums only if we are processing with a data extent. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 684b752b0933ac287fdd1f4cdc53c4a937e90e46 Author: Filipe Manana Date: Fri May 8 11:01:59 2020 +0100 btrfs: move the block group freeze/unfreeze helpers into block-group.c The helpers btrfs_freeze_block_group() and btrfs_unfreeze_block_group() used to be named btrfs_get_block_group_trimming() and btrfs_put_block_group_trimming() respectively. At the time they were added to free-space-cache.c, by commit e33e17ee1098 ("btrfs: add missing discards when unpinning extents with -o discard") because all the trimming related functions were in free-space-cache.c. Now that the helpers were renamed and are used in scrub context as well, move them to block-group.c, a much more logical location for them. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6b7304af62d02d77d740defd4cfddf2ef3188067 Author: Filipe Manana Date: Fri May 8 11:01:47 2020 +0100 btrfs: rename member 'trimming' of block group to a more generic name Back in 2014, commit 04216820fe83d5 ("Btrfs: fix race between fs trimming and block group remove/allocation"), I added the 'trimming' member to the block group structure. Its purpose was to prevent races between trimming and block group deletion/allocation by pinning the block group in a way that prevents its logical address and device extents from being reused while trimming is in progress for a block group, so that if another task deletes the block group and then another task allocates a new block group that gets the same logical address and device extents while the trimming task is still in progress. After the previous fix for scrub (patch "btrfs: fix a race between scrub and block group removal/allocation"), scrub now also has the same needs that trimming has, so the member name 'trimming' no longer makes sense. Since there is already a 'pinned' member in the block group that refers to space reservations (pinned bytes), rename the member to 'frozen', add a comment on top of it to describe its general purpose and rename the helpers to increment and decrement the counter as well, to match the new member name. The next patch in the series will move the helpers into a more suitable file (from free-space-cache.c to block-group.c). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2473d24f2b77da0ffabcbb916793e58e7f57440b Author: Filipe Manana Date: Fri May 8 11:01:10 2020 +0100 btrfs: fix a race between scrub and block group removal/allocation When scrub is verifying the extents of a block group for a device, it is possible that the corresponding block group gets removed and its logical address and device extents get used for a new block group allocation. When this happens scrub incorrectly reports that errors were detected and, if the the new block group has a different profile then the old one, deleted block group, we can crash due to a null pointer dereference. Possibly other unexpected and weird consequences can happen as well. Consider the following sequence of actions that leads to the null pointer dereference crash when scrub is running in parallel with balance: 1) Balance sets block group X to read-only mode and starts relocating it. Block group X is a metadata block group, has a raid1 profile (two device extents, each one in a different device) and a logical address of 19424870400; 2) Scrub is running and finds device extent E, which belongs to block group X. It enters scrub_stripe() to find all extents allocated to block group X, the search is done using the extent tree; 3) Balance finishes relocating block group X and removes block group X; 4) Balance starts relocating another block group and when trying to commit the current transaction as part of the preparation step (prepare_to_relocate()), it blocks because scrub is running; 5) The scrub task finds the metadata extent at the logical address 19425001472 and marks the pages of the extent to be read by a bio (struct scrub_bio). The extent item's flags, which have the bit BTRFS_EXTENT_FLAG_TREE_BLOCK set, are added to each page (struct scrub_page). It is these flags in the scrub pages that tells the bio's end io function (scrub_bio_end_io_worker) which type of extent it is dealing with. At this point we end up with 4 pages in a bio which is ready for submission (the metadata extent has a size of 16Kb, so that gives 4 pages on x86); 6) At the next iteration of scrub_stripe(), scrub checks that there is a pause request from the relocation task trying to commit a transaction, therefore it submits the pending bio and pauses, waiting for the transaction commit to complete before resuming; 7) The relocation task commits the transaction. The device extent E, that was used by our block group X, is now available for allocation, since the commit root for the device tree was swapped by the transaction commit; 8) Another task doing a direct IO write allocates a new data block group Y which ends using device extent E. This new block group Y also ends up getting the same logical address that block group X had: 19424870400. This happens because block group X was the block group with the highest logical address and, when allocating Y, find_next_chunk() returns the end offset of the current last block group to be used as the logical address for the new block group, which is 18351128576 + 1073741824 = 19424870400 So our new block group Y has the same logical address and device extent that block group X had. However Y is a data block group, while X was a metadata one, and Y has a raid0 profile, while X had a raid1 profile; 9) After allocating block group Y, the direct IO submits a bio to write to device extent E; 10) The read bio submitted by scrub reads the 4 pages (16Kb) from device extent E, which now correspond to the data written by the task that did a direct IO write. Then at the end io function associated with the bio, scrub_bio_end_io_worker(), we call scrub_block_complete() which calls scrub_checksum(). This later function checks the flags of the first page, and sees that the bit BTRFS_EXTENT_FLAG_TREE_BLOCK is set in the flags, so it assumes it has a metadata extent and then calls scrub_checksum_tree_block(). That functions returns an error, since interpreting data as a metadata extent causes the checksum verification to fail. So this makes scrub_checksum() call scrub_handle_errored_block(), which determines 'failed_mirror_index' to be 1, since the device extent E was allocated as the second mirror of block group X. It allocates BTRFS_MAX_MIRRORS scrub_block structures as an array at 'sblocks_for_recheck', and all the memory is initialized to zeroes by kcalloc(). After that it calls scrub_setup_recheck_block(), which is responsible for filling each of those structures. However, when that function calls btrfs_map_sblock() against the logical address of the metadata extent, 19425001472, it gets a struct btrfs_bio ('bbio') that matches the current block group Y. However block group Y has a raid0 profile and not a raid1 profile like X had, so the following call returns 1: scrub_nr_raid_mirrors(bbio) And as a result scrub_setup_recheck_block() only initializes the first (index 0) scrub_block structure in 'sblocks_for_recheck'. Then scrub_recheck_block() is called by scrub_handle_errored_block() with the second (index 1) scrub_block structure as the argument, because 'failed_mirror_index' was previously set to 1. This scrub_block was not initialized by scrub_setup_recheck_block(), so it has zero pages, its 'page_count' member is 0 and its 'pagev' page array has all members pointing to NULL. Finally when scrub_recheck_block() calls scrub_recheck_block_checksum() we have a NULL pointer dereference when accessing the flags of the first page, as pavev[0] is NULL: static void scrub_recheck_block_checksum(struct scrub_block *sblock) { (...) if (sblock->pagev[0]->flags & BTRFS_EXTENT_FLAG_DATA) scrub_checksum_data(sblock); (...) } Producing a stack trace like the following: [542998.008985] BUG: kernel NULL pointer dereference, address: 0000000000000028 [542998.010238] #PF: supervisor read access in kernel mode [542998.010878] #PF: error_code(0x0000) - not-present page [542998.011516] PGD 0 P4D 0 [542998.011929] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI [542998.012786] CPU: 3 PID: 4846 Comm: kworker/u8:1 Tainted: G B W 5.6.0-rc7-btrfs-next-58 #1 [542998.014524] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [542998.016065] Workqueue: btrfs-scrub btrfs_work_helper [btrfs] [542998.017255] RIP: 0010:scrub_recheck_block_checksum+0xf/0x20 [btrfs] [542998.018474] Code: 4c 89 e6 ... [542998.021419] RSP: 0018:ffffa7af0375fbd8 EFLAGS: 00010202 [542998.022120] RAX: 0000000000000000 RBX: ffff9792e674d120 RCX: 0000000000000000 [542998.023178] RDX: 0000000000000001 RSI: ffff9792e674d120 RDI: ffff9792e674d120 [542998.024465] RBP: 0000000000000000 R08: 0000000000000067 R09: 0000000000000001 [542998.025462] R10: ffffa7af0375fa50 R11: 0000000000000000 R12: ffff9791f61fe800 [542998.026357] R13: ffff9792e674d120 R14: 0000000000000001 R15: ffffffffc0e3dfc0 [542998.027237] FS: 0000000000000000(0000) GS:ffff9792fb200000(0000) knlGS:0000000000000000 [542998.028327] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [542998.029261] CR2: 0000000000000028 CR3: 00000000b3b18003 CR4: 00000000003606e0 [542998.030301] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [542998.031316] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [542998.032380] Call Trace: [542998.032752] scrub_recheck_block+0x162/0x400 [btrfs] [542998.033500] ? __alloc_pages_nodemask+0x31e/0x460 [542998.034228] scrub_handle_errored_block+0x6f8/0x1920 [btrfs] [542998.035170] scrub_bio_end_io_worker+0x100/0x520 [btrfs] [542998.035991] btrfs_work_helper+0xaa/0x720 [btrfs] [542998.036735] process_one_work+0x26d/0x6a0 [542998.037275] worker_thread+0x4f/0x3e0 [542998.037740] ? process_one_work+0x6a0/0x6a0 [542998.038378] kthread+0x103/0x140 [542998.038789] ? kthread_create_worker_on_cpu+0x70/0x70 [542998.039419] ret_from_fork+0x3a/0x50 [542998.039875] Modules linked in: dm_snapshot dm_thin_pool ... [542998.047288] CR2: 0000000000000028 [542998.047724] ---[ end trace bde186e176c7f96a ]--- This issue has been around for a long time, possibly since scrub exists. The last time I ran into it was over 2 years ago. After recently fixing fstests to pass the "--full-balance" command line option to btrfs-progs when doing balance, several tests started to more heavily exercise balance with fsstress, scrub and other operations in parallel, and therefore started to hit this issue again (with btrfs/061 for example). Fix this by having scrub increment the 'trimming' counter of the block group, which pins the block group in such a way that it guarantees neither its logical address nor device extents can be reused by future block group allocations until we decrement the 'trimming' counter. Also make sure that on each iteration of scrub_stripe() we stop scrubbing the block group if it was removed already. A later patch in the series will rename the block group's 'trimming' counter and its helpers to a more generic name, since now it is not used exclusively for pinning while trimming anymore. CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 31344b2fcead3239c5b801016d9bae82506b92c2 Author: David Sterba Date: Mon May 11 14:49:10 2020 +0200 btrfs: remove more obsolete v0 extent ref declarations The extent references v0 have been superseded long time go, there are some unused declarations of access helpers. We can safely remove them now. The struct btrfs_extent_ref_v0 is not used anywhere, but struct btrfs_extent_item_v0 is still part of a backward compatibility check in relocation.c and thus not removed. Signed-off-by: David Sterba commit 943aeb0dae9903ec70157129daed246086e8e111 Author: YueHaibing Date: Sat May 9 19:22:43 2020 +0800 btrfs: remove unused function btrfs_dev_extent_chunk_tree_uuid There's no callers in-tree anymore since commit d24ee97b96db ("btrfs: use new helpers to set uuids in eb") Signed-off-by: YueHaibing Reviewed-by: David Sterba Signed-off-by: David Sterba commit cbab8ade585a18c4334b085564d9d046e01a3f70 Author: Qu Wenruo Date: Thu Apr 2 14:37:35 2020 +0800 btrfs: qgroup: mark qgroup inconsistent if we're inherting snapshot to a new qgroup [BUG] For the following operation, qgroup is guaranteed to be screwed up due to snapshot adding to a new qgroup: # mkfs.btrfs -f $dev # mount $dev $mnt # btrfs qgroup en $mnt # btrfs subv create $mnt/src # xfs_io -f -c "pwrite 0 1m" $mnt/src/file # sync # btrfs qgroup create 1/0 $mnt/src # btrfs subv snapshot -i 1/0 $mnt/src $mnt/snapshot # btrfs qgroup show -prce $mnt/src qgroupid rfer excl max_rfer max_excl parent child -------- ---- ---- -------- -------- ------ ----- 0/5 16.00KiB 16.00KiB none none --- --- 0/257 1.02MiB 16.00KiB none none --- --- 0/258 1.02MiB 16.00KiB none none 1/0 --- 1/0 0.00B 0.00B none none --- 0/258 ^^^^^^^^^^^^^^^^^^^^ [CAUSE] The problem is in btrfs_qgroup_inherit(), we don't have good enough check to determine if the new relation would break the existing accounting. Unlike btrfs_add_qgroup_relation(), which has proper check to determine if we can do quick update without a rescan, in btrfs_qgroup_inherit() we can even assign a snapshot to multiple qgroups. [FIX] Fix it by manually marking qgroup inconsistent for snapshot inheritance. For subvolume creation, since all its extents are exclusively owned, we don't need to rescan. In theory, we should call relation check like quick_update_accounting() when doing qgroup inheritance and inform user about qgroup accounting inconsistency. But we don't have good mechanism to relay that back to the user in the snapshot creation context, thus we can only silently mark the qgroup inconsistent. Anyway, user shouldn't use qgroup inheritance during snapshot creation, and should add qgroup relationship after snapshot creation by 'btrfs qgroup assign', which has a much better UI to inform user about qgroup inconsistent and kick in rescan automatically. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a619b3c7abdd585cdd003effa1773e627aa8a44e Author: Robbie Ko Date: Thu May 7 10:54:40 2020 +0800 btrfs: speedup dead root detection during orphan cleanup When mounting, we handle deleted subvolume and orphan items. First, find add orphan roots, then add them to fs_root radix tree. Second, in tree-root, process each orphan item, skip if it is dead root. The original algorithm is based on the list of dead_roots, one by one to visit and check whether the objectid is consistent, the time complexity is O (n ^ 2). When processing 50000 deleted subvols, it takes about 120s. Because btrfs_find_orphan_roots has already ran before us, and added deleted subvol to fs_roots radix tree. The fs root will only be removed from the fs_roots radix tree after the cleaner process is started, and the cleaner will only start execution after the mount is complete. btrfs_orphan_cleanup can be called during the whole filesystem mount lifetime, but only "tree root" will be used in this section of code, and only mount time will be brought into tree root. So we can quickly check whether the orphan item is dead root through the fs_roots radix tree. Reviewed-by: Filipe Manana Signed-off-by: Robbie Ko Signed-off-by: David Sterba commit eec5b6e097cbcaf8d42209b6ef059cee8aa00790 Author: YueHaibing Date: Wed May 6 21:22:39 2020 +0800 btrfs: remove unused function heads_to_leaves There's no callers in-tree anymore since commit 64403612b73a ("btrfs: rework btrfs_check_space_for_delayed_refs") Signed-off-by: YueHaibing Reviewed-by: David Sterba Signed-off-by: David Sterba commit fb8521caa8f21f3153c5dc9feb055b6cd3e45c89 Author: David Sterba Date: Tue Apr 28 17:10:29 2020 +0200 btrfs: add more codes to decoder table I've grepped logs for 'errno=.*unknown' and found -95, -117 and -122, now added to the table. The wording is adjusted so it makes sense in context of filesystem. Reviewed-by: Anand Jain Signed-off-by: David Sterba commit d54f814434c5f87356d35bc377f43ef8d0556f15 Author: David Sterba Date: Tue Apr 28 17:10:27 2020 +0200 btrfs: sort error decoder entries Add the raw errnos and sort them accordingly. Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 7f551d969037cc128eca60688d9c5a300d84e665 Author: Anand Jain Date: Tue May 5 02:58:26 2020 +0800 btrfs: free alien device after device add When an old device has new fsid through 'btrfs device add -f ' our fs_devices list has an alien device in one of the fs_devices lists. By having an alien device in fs_devices, we have two issues so far 1. missing device does not not show as missing in the userland 2. degraded mount will fail Both issues are caused by the fact that there's an alien device in the fs_devices list. (Alien means that it does not belong to the filesystem, identified by fsid, or does not contain btrfs filesystem at all, eg. due to overwrite). A device can be scanned/added through the control device ioctls SCAN_DEV, DEVICES_READY or by ADD_DEV. And device coming through the control device is checked against the all other devices in the lists, but this was not the case for ADD_DEV. This patch fixes both issues above by removing the alien device. CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 998a0671961f66e9fad4990ed75f80ba3088c2f1 Author: Anand Jain Date: Tue May 5 02:58:25 2020 +0800 btrfs: include non-missing as a qualifier for the latest_bdev btrfs_free_extra_devids() updates fs_devices::latest_bdev to point to the bdev with greatest device::generation number. For a typical-missing device the generation number is zero so fs_devices::latest_bdev will never point to it. But if the missing device is due to alienation [1], then device::generation is not zero and if it is greater or equal to the rest of device generations in the list, then fs_devices::latest_bdev ends up pointing to the missing device and reports the error like [2]. [1] We maintain devices of a fsid (as in fs_device::fsid) in the fs_devices::devices list, a device is considered as an alien device if its fsid does not match with the fs_device::fsid Consider a working filesystem with raid1: $ mkfs.btrfs -f -d raid1 -m raid1 /dev/sda /dev/sdb $ mount /dev/sda /mnt-raid1 $ umount /mnt-raid1 While mnt-raid1 was unmounted the user force-adds one of its devices to another btrfs filesystem: $ mkfs.btrfs -f /dev/sdc $ mount /dev/sdc /mnt-single $ btrfs dev add -f /dev/sda /mnt-single Now the original mnt-raid1 fails to mount in degraded mode, because fs_devices::latest_bdev is pointing to the alien device. $ mount -o degraded /dev/sdb /mnt-raid1 [2] mount: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. kernel: BTRFS warning (device sdb): devid 1 uuid 072a0192-675b-4d5a-8640-a5cf2b2c704d is missing kernel: BTRFS error (device sdb): failed to read devices kernel: BTRFS error (device sdb): open_ctree failed Fix the root cause by checking if the device is not missing before it can be considered for the fs_devices::latest_bdev. CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit fd08001f17c7f0a5b19bf4026bbaace19d8fbdb6 Author: Eric Biggers Date: Thu Apr 30 23:51:59 2020 -0700 btrfs: use crypto_shash_digest() instead of open coding Use crypto_shash_digest() instead of crypto_shash_init() + crypto_shash_update() + crypto_shash_final(). This is more efficient. Signed-off-by: Eric Biggers Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1ed802c972c6c676412e34d168e313a17c3d931e Author: Anand Jain Date: Tue Apr 28 23:22:25 2020 +0800 btrfs: drop useless goto in open_fs_devices There is no need of goto out in open_fs_devices() as there is nothing special done there. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0bc2d3c08e2b970117cc2b7c529291123978cae6 Author: Filipe Manana Date: Tue Apr 21 11:25:31 2020 +0100 btrfs: remove useless check for copy_items() return value At btrfs_log_prealloc_extents() we are checking if copy_items() returns a value greater than 0. That used to happen in the past to signal the caller that the path given to it was released and reused for other searches, but as of commit 0e56315ca147b3 ("Btrfs: fix missing hole after hole punching and fsync when using NO_HOLES"), the copy_items() function does not have that behaviour anymore and always returns 0 or a negative value. So just remove that check at btrfs_log_prealloc_extents(), which the previously mentioned commit forgot to remove. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 77d5d6893106ea7b19709bed2491f93ff10a86d7 Author: Omar Sandoval Date: Thu Apr 16 14:46:25 2020 -0700 btrfs: unify buffered and direct I/O read repair Currently, direct I/O has its own versions of bio_readpage_error() and btrfs_check_repairable() (dio_read_error() and btrfs_check_dio_repairable(), respectively). The main difference is that the direct I/O version doesn't do read validation. The rework of direct I/O repair makes it possible to do validation, so we can get rid of btrfs_check_dio_repairable() and combine bio_readpage_error() and dio_read_error() into a new helper, btrfs_submit_read_repair(). Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 5c047a699aa9433ad92136343a9306d985134c24 Author: Omar Sandoval Date: Thu Apr 16 14:46:24 2020 -0700 btrfs: get rid of endio_repair_workers This was originally added in commit 8b110e393c5a ("Btrfs: implement repair function when direct read fails") to avoid a deadlock. In that commit, the direct I/O read endio executes on the endio_workers workqueue, submits a repair bio, and waits for it to complete. The repair bio endio must execute on a different workqueue, otherwise it could block on the endio_workers workqueue becoming available, which won't happen because the original endio is blocked on the repair bio. As of the previous commit, the original endio doesn't wait for the repair bio, so this separate workqueue is unnecessary. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit fd9d6670edba68cedd87b3db04cbdcdfc492cc0a Author: Omar Sandoval Date: Thu Apr 16 14:46:23 2020 -0700 btrfs: simplify direct I/O read repair Direct I/O read repair was originally implemented in commit 8b110e393c5a ("Btrfs: implement repair function when direct read fails"). This implementation is unnecessarily complicated. There is major code duplication between __btrfs_subio_endio_read() (checks checksums and handles I/O errors for files with checksums), __btrfs_correct_data_nocsum() (handles I/O errors for files without checksums), btrfs_retry_endio() (checks checksums and handles I/O errors for retries of files with checksums), and btrfs_retry_endio_nocsum() (handles I/O errors for retries of files without checksum). If it sounds like these should be one function, that's because they should. Additionally, these functions are very hard to follow due to their excessive use of goto. This commit replaces the original implementation. After the previous commit getting rid of orig_bio, we can reuse the same endio callback for repair I/O and the original I/O, we just need to track the file offset and original iterator in the repair bio. We can also unify the handling of files with and without checksums and simplify the control flow. We also no longer have to wait for each repair I/O to complete one by one. Reviewed-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 769b4f2497bdb31cd2c7b53d171bc7c13ef4e793 Author: Omar Sandoval Date: Thu Apr 16 14:46:22 2020 -0700 btrfs: get rid of one layer of bios in direct I/O In the worst case, there are _4_ layers of bios in the Btrfs direct I/O path: 1. The bio created by the generic direct I/O code (dio_bio). 2. A clone of dio_bio we create in btrfs_submit_direct() to represent the entire direct I/O range (orig_bio). 3. A partial clone of orig_bio limited to the size of a RAID stripe that we create in btrfs_submit_direct_hook(). 4. Clones of each of those split bios for each RAID stripe that we create in btrfs_map_bio(). As of the previous commit, the second layer (orig_bio) is no longer needed for anything: we can split dio_bio instead, and complete dio_bio directly when all of the cloned bios complete. This lets us clean up a bunch of cruft, including dip->subio_endio and dip->errors (we can use dio_bio->bi_status instead). It also enables the next big cleanup of direct I/O read repair. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 85879573fc8b06e8f70698686e3bc17c9e6225ba Author: Omar Sandoval Date: Thu Apr 16 14:46:21 2020 -0700 btrfs: put direct I/O checksums in btrfs_dio_private instead of bio The next commit will get rid of btrfs_dio_private->orig_bio. The only thing we really need it for is containing all of the checksums, but we can easily put the checksum array in btrfs_dio_private and have the submitted bios reference the array. We can also look the checksums up while we're setting up instead of the current awkward logic that looks them up for orig_bio when the first split bio is submitted. (Interestingly, btrfs_dio_private did contain the checksums before commit 23ea8e5a0767 ("Btrfs: load checksum data once when submitting a direct read io"), but it didn't look them up up front.) Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit e3b318d14df7d6d04f37ce10f9a2f33ca3d550be Author: Omar Sandoval Date: Thu Apr 16 14:46:20 2020 -0700 btrfs: convert btrfs_dio_private->pending_bios to refcount_t This is really a reference count now, so convert it to refcount_t and rename it to refs. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 2390a6daf92d241b23bc02687bfb9fabdf93f117 Author: Omar Sandoval Date: Thu Apr 16 14:46:19 2020 -0700 btrfs: remove unused btrfs_dio_private::private We haven't used this since commit 9be3395bcd4a ("Btrfs: use a btrfs bioset instead of abusing bio internals"). Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit ce06d3ec2b5aed70b95ee080a7a3d55ef08ce7f3 Author: Omar Sandoval Date: Thu Apr 16 14:46:18 2020 -0700 btrfs: make btrfs_check_repairable() static Since its introduction in commit 2fe6303e7cd0 ("Btrfs: split bio_readpage_error into several functions"), btrfs_check_repairable() has only been used from extent_io.c where it is defined. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 47df7765a803a3333dda7f1452581e1641f984b0 Author: Omar Sandoval Date: Thu Apr 16 14:46:17 2020 -0700 btrfs: rename __readpage_endio_check to check_data_csum __readpage_endio_check() is also used from the direct I/O read code, so give it a more descriptive name. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit fb30f4707d421add0f4bf9a08bb228daac273b9f Author: Omar Sandoval Date: Thu Apr 16 14:46:16 2020 -0700 btrfs: clarify btrfs_lookup_bio_sums documentation Fix a couple of issues in the btrfs_lookup_bio_sums documentation: * The bio doesn't need to be a btrfs_io_bio if dst was provided. Move the declaration in the code to make that clear, too. * dst must be large enough to hold nblocks * csum_size, not just csum_size. Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit f337bd7478178f4c5e2b825fdb8dfaa266c344a2 Author: Omar Sandoval Date: Thu Apr 16 14:46:15 2020 -0700 btrfs: don't do repair validation for checksum errors The purpose of the validation step is to distinguish between good and bad sectors in a failed multi-sector read. If a multi-sector read succeeded but some of those sectors had checksum errors, we don't need to validate anything; we know the sectors with bad checksums need to be repaired. Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit c7333972b9b571a03bf9aecd1aeecfab81243e8d Author: Omar Sandoval Date: Thu Apr 16 14:46:14 2020 -0700 btrfs: look at full bi_io_vec for repair decision Read repair does two things: it finds a good copy of data to return to the reader, and it corrects the bad copy on disk. If a read of multiple sectors has an I/O error, repair does an extra "validation" step that issues a separate read for each sector. This allows us to find the exact failing sectors and only rewrite those. This heuristic is implemented in bio_readpage_error()/btrfs_check_repairable() as: failed_bio_pages = failed_bio->bi_iter.bi_size >> PAGE_SHIFT; if (failed_bio_pages > 1) do validation However, at this point, bi_iter may have already been advanced. This means that we'll skip the validation step and rewrite the entire failed read. Fix it by getting the actual size from the biovec (which we can do because this is only called for non-cloned bios, although that will change in a later commit). Fixes: 8a2ee44a371c ("btrfs: look at bi_size for repair decisions") Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit c36cac28cb94e58f7e21ff43bdc6064346dab32c Author: Omar Sandoval Date: Thu Apr 16 14:46:13 2020 -0700 btrfs: fix double __endio_write_update_ordered in direct I/O In btrfs_submit_direct(), if we fail to allocate the btrfs_dio_private, we complete the ordered extent range. However, we don't mark that the range doesn't need to be cleaned up from btrfs_direct_IO() until later. Therefore, if we fail to allocate the btrfs_dio_private, we complete the ordered extent range twice. We could fix this by updating unsubmitted_oe_range earlier, but it's cleaner to reorganize the code so that creating the btrfs_dio_private and submitting the bios are separate, and once the btrfs_dio_private is created, cleanup always happens through the btrfs_dio_private. The logic around unsubmitted_oe_range_end and unsubmitted_oe_range_start is really subtle. We have the following: 1. btrfs_direct_IO sets those two to the same value. 2. When we call __blockdev_direct_IO unless btrfs_get_blocks_direct->btrfs_get_blocks_direct_write is called to modify unsubmitted_oe_range_start so that start < end. Cleanup won't happen. 3. We come into btrfs_submit_direct - if it dip allocation fails we'd return with oe_range_end now modified so cleanup will happen. 4. If we manage to allocate the dip we reset the unsubmitted range members to be equal so that cleanup happens from btrfs_endio_direct_write. This 4-step logic is not really obvious, especially given it's scattered across 3 functions. Fixes: f28a49287817 ("Btrfs: fix leaking of ordered extents after direct IO write error") Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval [ add range start/end logic explanation from Nikolay ] Signed-off-by: David Sterba commit 6d3113a193e3385c72240096fe397618ecab6e43 Author: Omar Sandoval Date: Thu Apr 16 14:46:12 2020 -0700 btrfs: fix error handling when submitting direct I/O bio In btrfs_submit_direct_hook(), if a direct I/O write doesn't span a RAID stripe or chunk, we submit orig_bio without cloning it. In this case, we don't increment pending_bios. Then, if btrfs_submit_dio_bio() fails, we decrement pending_bios to -1, and we never complete orig_bio. Fix it by initializing pending_bios to 1 instead of incrementing later. Fixing this exposes another bug: we put orig_bio prematurely and then put it again from end_io. Fix it by not putting orig_bio. After this change, pending_bios is really more of a reference count, but I'll leave that cleanup separate to keep the fix small. Fixes: e65e15355429 ("btrfs: fix panic caused by direct IO") CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 1072c12d7d58b5512b6c05c2268f57d32f1ab76c Author: Omar Sandoval Date: Thu Apr 16 14:46:11 2020 -0700 block: add bio_for_each_bvec_all() An upcoming Btrfs fix needs to know the original size of a non-cloned bios. Rather than accessing the bvec table directly, let's add a bio_for_each_bvec_all() accessor. Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 534cf531ccf6331b6e63a054f2ceb8e1ccff1ec9 Author: Filipe Manana Date: Fri Apr 17 16:36:50 2020 +0100 btrfs: simplify error handling of clean_pinned_extents() At clean_pinned_extents(), whether we end up returning success or failure, we pretty much have to do the same things: 1) unlock unused_bg_unpin_mutex 2) decrement reference count on the previous transaction We also call btrfs_dec_block_group_ro() in case of failure, but that is better done in its caller, btrfs_delete_unused_bgs(), since its the caller that calls inc_block_group_ro(), so it should be responsible for the decrement operation, as it is in case any of the other functions it calls fail. So move the call to btrfs_dec_block_group_ro() from clean_pinned_extents() into btrfs_delete_unused_bgs() and unify the error and success return paths for clean_pinned_extents(), reducing duplicated code and making it simpler. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e3b8336117e515a260da32fa10bb3354ba12c429 Author: Qu Wenruo Date: Fri Apr 17 15:08:21 2020 +0800 btrfs: remove the redundant parameter level in btrfs_bin_search() All callers pass the eb::level so we can get read it directly inside the btrfs_bin_search and key_search. This is inspired by the work of Marek in U-boot. CC: Marek Behun Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b335eab890ed4c5b8e45e4b3d12f303686298850 Author: Nikolay Borisov Date: Wed Apr 15 15:53:46 2020 +0300 btrfs: make btrfs_read_disk_super return struct btrfs_disk_super Instead of returning both the page and the super block structure, make btrfs_read_disk_super just return a pointer to struct btrfs_disk_super. As a result the function signature is simplified. Also, read_cache_page_gfp can never return NULL so check its return value only for IS_ERR. Reviewed-by: Johannes Thumshirn Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit a7571232b2aa8a43a137f827d77941634c309144 Author: Nikolay Borisov Date: Fri Feb 21 15:11:24 2020 +0200 btrfs: use list_for_each_entry_safe in free_reloc_roots The function always works on a local copy of the reloc root list, which cannot be modified outside of it so using list_for_each_entry is fine. Additionally the macro handles empty lists so drop list_empty checks of callers. No semantic changes. Reviewed-by: Qu Wenruo Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7c09c03091ac562ddca2b393e5d65c1d37da79f1 Author: David Sterba Date: Tue Feb 25 15:05:53 2020 +0100 btrfs: don't force read-only after error in drop snapshot Deleting a subvolume on a full filesystem leads to ENOSPC followed by a forced read-only. This is not a transaction abort and the filesystem is otherwise ok, so the error should be just propagated to the callers. This is caused by unnecessary call to btrfs_handle_fs_error for all errors, except EAGAIN. This does not make sense as the standard transaction abort mechanism is in btrfs_drop_snapshot so all relevant failures are handled. Originally in commit cb1b69f4508a ("Btrfs: forced readonly when btrfs_drop_snapshot() fails") there was no return value at all, so the btrfs_std_error made some sense but once the error handling and propagation has been implemented we don't need it anymore. Signed-off-by: David Sterba commit 2d9faa5a8aaaf4a0559be46cccdbed7dbb10bad0 Author: Filipe Manana Date: Tue Apr 7 11:38:58 2020 +0100 btrfs: remove pointless assertion on reclaim_size counter The reclaim_size counter of a space_info object is unsigned. So its value can never be negative, it's pointless to have an assertion that checks its value is >= 0, therefore remove it. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 72f4f078de3fa81b089522fb8090b08e3ffdd148 Author: Zheng Wei Date: Mon Mar 16 11:45:57 2020 +0800 btrfs: tree-checker: remove duplicate definition of 'inode_item_err' Remove the duplicate definition of 'inode_item_err' in the file tree-checker.c that got there by accident in c23c77b097dc ("btrfs: tree-checker: Refactor inode key check into seperate function"). Reviewed-by: Nikolay Borisov Signed-off-by: Zheng Wei Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9c343784c4328781129bcf9e671645f69fe4b38a Author: Josef Bacik Date: Fri Mar 13 15:28:48 2020 -0400 btrfs: force chunk allocation if our global rsv is larger than metadata Nikolay noticed a bunch of test failures with my global rsv steal patches. At first he thought they were introduced by them, but they've been failing for a while with 64k nodes. The problem is with 64k nodes we have a global reserve that calculates out to 13MiB on a freshly made file system, which only has 8MiB of metadata space. Because of changes I previously made we no longer account for the global reserve in the overcommit logic, which means we correctly allow overcommit to happen even though we are already overcommitted. However in some corner cases, for example btrfs/170, we will allocate the entire file system up with data chunks before we have enough space pressure to allocate a metadata chunk. Then once the fs is full we ENOSPC out because we cannot overcommit and the global reserve is taking up all of the available space. The most ideal way to deal with this is to change our space reservation stuff to take into account the height of the tree's that we're modifying, so that our global reserve calculation does not end up so obscenely large. However that is a huge undertaking. Instead fix this by forcing a chunk allocation if the global reserve is larger than the total metadata space. This gives us essentially the same behavior that happened before, we get a chunk allocated and these tests can pass. This is meant to be a stop-gap measure until we can tackle the "tree height only" project. Fixes: 0096420adb03 ("btrfs: do not account global reserve in can_overcommit") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 42a72cb75374634ef714514b4742a8844391fd9e Author: Josef Bacik Date: Fri Mar 13 15:58:09 2020 -0400 btrfs: run btrfs_try_granting_tickets if a priority ticket fails With normal tickets we could have a large reservation at the front of the list that is unable to be satisfied, but a smaller ticket later on that can be satisfied. The way we handle this is to run btrfs_try_granting_tickets() in maybe_fail_all_tickets(). However no such protection exists for priority tickets. Fix this by handling it in handle_reserve_ticket(). If we've returned after attempting to flush space in a priority related way, we'll still be on the priority list and need to be removed. We rely on the flushing to free up space and wake the ticket, but if there is not enough space to reclaim _but_ there's enough space in the space_info to handle subsequent reservations then we would have gotten an ENOSPC erroneously. Address this by catching where we are still on the list, meaning we were a priority ticket, and removing ourselves and then running btrfs_try_granting_tickets(). This will handle this particular corner case. Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 666daa9f977d46010e2597a3b4f6524ba4d28129 Author: Josef Bacik Date: Fri Mar 13 15:58:08 2020 -0400 btrfs: only check priority tickets for priority flushing In debugging a generic/320 failure on ppc64, Nikolay noticed that sometimes we'd ENOSPC out with plenty of space to reclaim if we had committed the transaction. He further discovered that this was because there was a priority ticket that was small enough to fit in the free space currently in the space_info. Consider the following scenario. There is no more space to reclaim in the fs without committing the transaction. Assume there's 1MiB of space free in the space info, but there are pending normal tickets with 2MiB reservations. Now a priority ticket comes in with a .5MiB reservation. Because we have normal tickets pending we add ourselves to the priority list, despite the fact that we could satisfy this reservation. The flushing machinery now gets to the point where it wants to commit the transaction, but because there's a .5MiB ticket on the priority list and we have 1MiB of free space we assume the ticket will be granted soon, so we bail without committing the transaction. Meanwhile the priority flushing does not commit the transaction, and eventually fails with an ENOSPC. Then all other tickets are failed with ENOSPC because we were never able to actually commit the transaction. The fix for this is we should have simply granted the priority flusher his reservation, because there was space to make the reservation. Priority flushers by definition take priority, so they are allowed to make their reservations before any previous normal tickets. By not adding this priority ticket to the list the normal flushing mechanisms will then commit the transaction and everything will continue normally. We still need to serialize ourselves with other priority tickets, so if there are any tickets on the priority list then we need to add ourselves to that list in order to maintain the serialization between priority tickets. Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit bb4f58a747f0421b10645fbf75a6acc88da0de50 Author: Josef Bacik Date: Fri Mar 13 15:58:07 2020 -0400 btrfs: account for trans_block_rsv in may_commit_transaction On ppc64le with 64k page size (respectively 64k block size) generic/320 was failing and debug output showed we were getting a premature ENOSPC with a bunch of space in btrfs_fs_info::trans_block_rsv. This meant there were still open transaction handles holding space, yet the flusher didn't commit the transaction because it deemed the freed space won't be enough to satisfy the current reserve ticket. Fix this by accounting for space in trans_block_rsv when deciding whether the current transaction should be committed or not. Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit e6549c2aabb9875cf7827bb2283905aaab5b0523 Author: Josef Bacik Date: Fri Mar 13 15:58:06 2020 -0400 btrfs: allow to use up to 90% of the global block rsv for unlink We previously had a limit of stealing 50% of the global reserve for unlink. This was from a time when the global reserve was used for the delayed refs as well. However now those reservations are kept separate, so the global reserve can be depleted much more to allow us to make progress for space restoring operations like unlink. Change the minimum amount of space required to be left in the global reserve to 10%. Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7f9fe614407692f670601a634621138233ac00d7 Author: Josef Bacik Date: Fri Mar 13 15:58:05 2020 -0400 btrfs: improve global reserve stealing logic For unlink transactions and block group removal btrfs_start_transaction_fallback_global_rsv will first try to start an ordinary transaction and if it fails it will fall back to reserving the required amount by stealing from the global reserve. This is problematic because of all the same reasons we had with previous iterations of the ENOSPC handling, thundering herd. We get a bunch of failures all at once, everybody tries to allocate from the global reserve, some win and some lose, we get an ENSOPC. Fix this behavior by introducing BTRFS_RESERVE_FLUSH_ALL_STEAL. It's used to mark unlink reservation. To fix this we need to integrate this logic into the normal ENOSPC infrastructure. We still go through all of the normal flushing work, and at the moment we begin to fail all the tickets we try to satisfy any tickets that are allowed to steal by stealing from the global reserve. If this works we start the flushing system over again just like we would with a normal ticket satisfaction. This serializes our global reserve stealing, so we don't have the thundering herd problem. Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 876de781b0da240fcf8d29514c34607e147e5a94 Author: Qu Wenruo Date: Mon Mar 16 14:10:01 2020 +0800 btrfs: backref: distinguish reloc and non-reloc use of indirect resolution For relocation tree detection, relocation backref cache uses btrfs_should_ignore_reloc_root() which uses relocation-specific checks like checking the DEAD_RELOC_ROOT bit. However for general purpose backref cache, we can rely on that check, as it's possible that relocation is also running. For generic purposed backref cache, we detect reloc root by SHARED_BLOCK_REF item. Only reloc root node has its parent bytenr pointing back to itself. And in that case, backref cache will mark the reloc root node useless, dropping any child orphan nodes. So only call btrfs_should_ignore_reloc_root() if the backref cache is for relocation. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1b23ea180b6b4186ff79db767dcbec612477968f Author: Qu Wenruo Date: Mon Mar 23 16:57:15 2020 +0800 btrfs: reloc: move error handling of build_backref_tree() to backref.c The error cleanup will be extracted as a new function, btrfs_backref_error_cleanup(), and moved to backref.c and exported for later usage. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit fc997ed05a9f9d2185b8804fb2d0273e6d9e921a Author: Qu Wenruo Date: Mon Mar 23 16:14:08 2020 +0800 btrfs: backref: rename and move finish_upper_links() This the the 2nd major part of generic backref cache. Move it to backref.c so we can reuse it. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1b60d2ec982a35c2953d81d035e1d7fc7c89f42a Author: Qu Wenruo Date: Mon Mar 23 16:08:34 2020 +0800 btrfs: backref: rename and move handle_one_tree_block() This function is the major part of backref cache build process, move it to backref.c so we can reuse it later. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit d36e7f0e8fedd0675789b4fc5869d8d48d33e18a Author: Qu Wenruo Date: Thu Mar 5 15:16:09 2020 +0800 btrfs: reloc: open code read_fs_root() for handle_indirect_tree_backref() The backref code is going to be moved to backref.c, and read_fs_root() is just a simple wrapper, open-code it to prepare to the incoming code move. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 55465730bcea75606c2c281ca55701c7fc20a000 Author: Qu Wenruo Date: Tue Mar 3 14:26:02 2020 +0800 btrfs: backref: rename and move should_ignore_root() This function is mostly single purpose to relocation backref cache, but since we're moving the main part of backref cache to backref.c, we need to export such function. And to avoid confusion, rename the function to btrfs_should_ignore_reloc_root() make the name a little more clear. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 982c92cbd51cf6ab1319e1e94dfd4902d3678d9a Author: Qu Wenruo Date: Thu Mar 26 14:21:36 2020 +0800 btrfs: backref: rename and move backref_tree_panic() Also change the parameter, since all callers can easily grab an fs_info, there is no need for all the pointer chasing. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 13fe1bdb22f8302afa5e588e89a7a94606ef35fb Author: Qu Wenruo Date: Tue Mar 3 13:55:12 2020 +0800 btrfs: backref: rename and move backref_cache_cleanup() Since we're releasing all existing nodes/edges, other than cleanup the mess after error, "release" is a more proper naming here. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 023acb07bc996636b39c70e07966f70e70c0a008 Author: Qu Wenruo Date: Mon Mar 23 15:42:25 2020 +0800 btrfs: backref: rename and move remove_backref_node() Also add comment explaining the cleanup progress, to differ it from btrfs_backref_drop_node(). Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b0fe7078d62c23bc94d0203887d9ad7b128f684b Author: Qu Wenruo Date: Tue Mar 3 13:35:27 2020 +0800 btrfs: backref: rename and move drop_backref_node() With extra comment for drop_backref_node() as it has some similarity with remove_backref_node(), thus we need extra comment explaining the difference. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 741188d3a549af328cc7946ce9650dd33a25087b Author: Qu Wenruo Date: Tue Mar 3 13:26:12 2020 +0800 btrfs: backref: rename and move free_backref_(node|edge) Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f39911e5527e8be7ab56cadde306237092bcc78f Author: Qu Wenruo Date: Tue Mar 3 13:24:06 2020 +0800 btrfs: backref: rename and move link_backref_edge() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 47254d07f37590fddc1516006e3e79453e755424 Author: Qu Wenruo Date: Tue Mar 3 13:22:57 2020 +0800 btrfs: backref: rename and move alloc_backref_edge() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b1818dab9bda1da8f3ea5a13230b5d91ae964f00 Author: Qu Wenruo Date: Tue Mar 3 13:21:30 2020 +0800 btrfs: backref: rename and move alloc_backref_node() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 584fb12187f087f4909f74fa91dbb61856107684 Author: Qu Wenruo Date: Tue Mar 3 13:14:41 2020 +0800 btrfs: backref: rename and move backref_cache_init() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit e9a28dc52af31d8af1883afe08e724a303b3c4eb Author: Qu Wenruo Date: Thu Mar 26 14:11:09 2020 +0800 btrfs: rename tree_entry to rb_simple_node and export it Structure tree_entry provides a very simple rb_tree which only uses bytenr as search index. That tree_entry is used in 3 structures: backref_node, mapping_node and tree_block. Since we're going to make backref_node independnt from relocation, it's a good time to extract the tree_entry into rb_simple_node, and export it into misc.h. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7053544146ac7eb71de6cee1ffda678714f905d8 Author: Qu Wenruo Date: Mon Mar 23 15:03:56 2020 +0800 btrfs: backref: move btrfs_backref_(node|edge|cache) structures to backref.h These 3 structures are the main part of btrfs backref cache, move them to backref.h to build the basis for later reuse. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a26195a5230d61e4c214b17cc611e3ac7cc64c33 Author: Qu Wenruo Date: Mon Mar 23 14:59:06 2020 +0800 btrfs: reloc: add btrfs_ prefix for backref_node/edge/cache Those three structures are the main elements of backref cache. Add the "btrfs_" prefix for later export. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 29db137b6bb2f79851d86fa267ad8d6e6540a855 Author: Qu Wenruo Date: Wed Feb 26 13:08:36 2020 +0800 btrfs: reloc: refactor useless nodes handling into its own function This patch will also add some comment for the cleanup. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1f872924663f9a15924cc7169932608c1d697ee1 Author: Qu Wenruo Date: Tue Feb 25 14:20:13 2020 +0800 btrfs: reloc: refactor finishing part of upper linkage into finish_upper_links() After handle_one_tree_backref(), all newly added (not cached) edges and nodes have the following features: - Only backref_edge::list[LOWER] is linked. This means, we can only iterate from botton to top, not the other direction. - Newly added nodes are not added to cache rb_tree yet So to finish the backref cache, we still need to finish the links and add all nodes into backref cache rb_tree. This patch will refactor the existing code into finish_upper_links(), add more comments of each branch, and why we need to do all the work. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit e7d571c7b004dc20f385d53d0c89e99d078e0415 Author: Qu Wenruo Date: Thu Mar 5 14:49:29 2020 +0800 btrfs: reloc: remove the open-coded goto loop for breadth-first search build_backref_tree() uses "goto again;" to implement a breadth-first search to build backref cache. This patch will extract most of its work into a wrapper, handle_one_tree_block(), and use a do {} while() loop to implement the same thing. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0304f2d8cce7fc23baf9e005c095beff7a29847d Author: Qu Wenruo Date: Mon Feb 24 09:34:55 2020 +0800 btrfs: reloc: pass essential members for alloc_backref_node() Bytenr and level are essential parameters for backref_node, thus it makes sense to initialize them at allocation time. Reviewed-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2a979612d594c16953ca512f2de7f0bb385ffb65 Author: Qu Wenruo Date: Mon Feb 24 09:19:02 2020 +0800 btrfs: reloc: use wrapper to replace open-coded edge linking Since backref_edge is used to connect upper and lower backref nodes, and needs to access both nodes, some code can look pretty nasty: list_add_tail(&edge->list[LOWER], &cur->upper); The above code will link @cur to the LOWER side of the edge, while both "LOWER" and "upper" words show up. This can sometimes be very confusing for reader to grasp. This patch introduces a new wrapper, link_backref_edge(), to handle the linking behavior. Which also has extra ASSERT() to ensure caller won't pass wrong nodes. Also, this updates the comment of related lists of backref_node and backref_edge, to make it more clear that each list points to what. Reviewed-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4d81ea8bb4fc40903f4950b082955c709d785467 Author: Qu Wenruo Date: Thu Mar 5 14:22:43 2020 +0800 btrfs: reloc: refactor indirect tree backref processing into its own function The processing of indirect tree backref (TREE_BLOCK_REF) is the most complex work. We need to grab the fs root, do a tree search to locate all its parent nodes, link all needed edges, and put all uncached edges to pending edge list. This is definitely worth a helper function. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4007ea87d900e20a7986cdcdcfdc866e8f8bd473 Author: Qu Wenruo Date: Thu Mar 5 14:06:29 2020 +0800 btrfs: reloc: refactor direct tree backref processing into its own function For BTRFS_SHARED_BLOCK_REF_KEY, its processing is straightforward, as we now the parent node bytenr directly. If the parent is already cached, or a root, call it a day. If the parent is not cached, add it pending list. This patch will just refactor this part into its own function, handle_direct_tree_backref() and add some comment explaining the @ref_key parameter. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2433bea592d26daf6bd15492ce4262b598a7f804 Author: Qu Wenruo Date: Fri Mar 6 14:04:12 2020 +0800 btrfs: reloc: make reloc root search-specific for relocation backref cache find_reloc_root() searches reloc_control::reloc_root_tree to find the reloc root. This behavior is only useful for relocation backref cache. For the incoming more generic purpose backref cache, we don't care about who owns the reloc root, but only care if it's a reloc root. So this patch makes the following modifications to make the reloc root search more specific to relocation backref: - Add backref_node::is_reloc_root This will be an extra indicator for generic purposed backref cache. User doesn't need to read root key from backref_node::root to determine if it's a reloc root. Also for reloc tree root, it's useless and will be queued to useless list. - Add backref_cache::is_reloc This will allow backref cache code to do different behavior for generic purpose backref cache and relocation backref cache. - Pass fs_info to find_reloc_root() - Export find_reloc_root() So backref.c can utilize this function. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 33a0f1f716973ae87d94e03e597d0c46fd032541 Author: Qu Wenruo Date: Thu Mar 5 13:54:11 2020 +0800 btrfs: reloc: add backref_cache::fs_info member Add this member so that we can grab fs_info without the help from reloc_control. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 84780289335fe614057e5ddf796050ce15751f4a Author: Qu Wenruo Date: Thu Mar 5 13:48:31 2020 +0800 btrfs: reloc: add backref_cache::pending_edge and backref_cache::useless_node These two new members will act the same as the existing local lists, @useless and @list in build_backref_tree(). Currently build_backref_tree() is only executed serially, thus moving such local list into backref_cache is still safe. Also since we're here, use list_first_entry() to replace a lot of list_entry() calls after !list_empty(). Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9569cc203d23ddaed7f7f2ca986a7cda7f1c33c0 Author: Qu Wenruo Date: Thu Feb 20 15:16:16 2020 +0800 btrfs: reloc: rename mark_block_processed and __mark_block_processed These two functions are weirdly named, mark_block_processed() in fact just marks a range dirty unconditionally, while __mark_block_processed() does extra check before doing the marking. This patch will open code old mark_block_processed, and rename __mark_block_processed() to remove the "__" prefix. Since we're here, also kill the forward declaration, which could also kill in_block_group() with in_range() macro. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 71f572a9e82fb7ed6f8c625e2682160f3a498db3 Author: Qu Wenruo Date: Fri Feb 14 13:48:20 2020 +0800 btrfs: reloc: use btrfs_backref_iter infrastructure In the core function of relocation, build_backref_tree, it needs to iterate all backref items of one tree block. Use btrfs_backref_iter infrastructure to do the loop and make the code more readable. The backref items look would be much more easier to read: ret = btrfs_backref_iter_start(iter, cur->bytenr); for (; ret == 0; ret = btrfs_backref_iter_next(iter)) { /* The really important work */ } Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit c39c2ddc67024979915c4df4e30da96a3e7619b0 Author: Qu Wenruo Date: Thu Feb 13 15:04:04 2020 +0800 btrfs: backref: implement btrfs_backref_iter_next() This function will go to the next inline/keyed backref for btrfs_backref_iter infrastructure. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a37f232b7b65789cadc9834d389f6390de11b583 Author: Qu Wenruo Date: Thu Feb 13 14:11:04 2020 +0800 btrfs: backref: introduce the skeleton of btrfs_backref_iter Due to the complex nature of btrfs extent tree, when we want to iterate all backrefs of one extent, this involves quite a lot of work, like searching the EXTENT_ITEM/METADATA_ITEM, iteration through inline and keyed backrefs. Normally this would result in a complex code, something like: btrfs_search_slot() /* Ensure we are at EXTENT_ITEM/METADATA_ITEM */ while (1) { /* Loop for extent tree items */ while (ptr < end) { /* Loop for inlined items */ /* Real work here */ } next: ret = btrfs_next_item() /* Ensure we're still at keyed item for specified bytenr */ } The idea of btrfs_backref_iter is to avoid such complex and hard to read code structure, but something like the following: iter = btrfs_backref_iter_alloc(); ret = btrfs_backref_iter_start(iter, bytenr); if (ret < 0) goto out; for (; ; ret = btrfs_backref_iter_next(iter)) { /* Real work here */ } out: btrfs_backref_iter_free(iter); This patch is just the skeleton + btrfs_backref_iter_start() code. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 78d933c79cb649906577715af15400c7724ca633 Author: Jules Irenge Date: Tue Mar 31 21:46:42 2020 +0100 btrfs: add missing annotation for btrfs_tree_lock() Sparse reports a warning at btrfs_tree_lock() warning: context imbalance in btrfs_tree_lock() - wrong count at exit The root cause is the missing annotation at btrfs_tree_lock() Add the missing __acquires(&eb->lock) annotation Signed-off-by: Jules Irenge Reviewed-by: David Sterba Signed-off-by: David Sterba commit c142c6a449c7765b0d3b6ecce0be8d783a19abcb Author: Jules Irenge Date: Tue Mar 31 21:46:41 2020 +0100 btrfs: add missing annotation for btrfs_lock_cluster() Sparse reports a warning at btrfs_lock_cluster() warning: context imbalance in btrfs_lock_cluster() - wrong count The root cause is the missing annotation at btrfs_lock_cluster() Add the missing __acquires(&cluster->refill_lock) annotation. Signed-off-by: Jules Irenge Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6fe7c07a9a807445a02e88ce9545fa17910d8505 Merge: d04996eac538 dfae0422de12 Author: Linus Walleij Date: Mon May 25 11:19:44 2020 +0200 Merge tag 'sh-pfc-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: sh-pfc: Updates for v5.8 (take two) - Add support for the new RZ/G1H (r8a7742) SoC, - Minor fixes and improvements. commit 22e4ebd05890cf2d9423ed7a35f18b0937c0cb3b Author: Tiezhu Yang Date: Fri May 22 12:12:20 2020 +0800 gpio: pxa: Add COMPILE_TEST support Add COMPILE_TEST support to the PXA GPIO driver for better compile testing coverage. Signed-off-by: Tiezhu Yang Signed-off-by: Bartosz Golaszewski commit c22fc62b516de5eeea7b518a68e258948e6276ce Author: Geert Uytterhoeven Date: Tue May 19 10:11:57 2020 +0200 dt-bindings: gpio: Add renesas,em-gio bindings Document Device Tree bindings for the Renesas EMMA Mobile General Purpose I/O Interface. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20200519081157.29095-1-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 563a6d2c37a0ca28eb66c6f9ad281798a9cc6956 Author: Andy Shevchenko Date: Wed May 20 15:09:55 2020 +0300 MAINTAINERS: Fix file name for DesignWare GPIO DT schema The commit 657a06df993c ("dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema") missed MAINTAINERS update. Fixes: 657a06df993c ("dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema") Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Cc: Serge Semin Link: https://lore.kernel.org/r/20200520120955.68427-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 551cb86cbb7d85a3d16d10f6fb4fb954f13a7556 Author: Andy Shevchenko Date: Tue May 19 16:12:33 2020 +0300 gpio: dwapb: Remove unneeded has_irq member in struct dwapb_port_property has_irq member of struct dwapb_port_property is used only in one place, so, make it local test instead and remove from the structure. This local test is using memchr_inv() which is quite efficient in comparison to the original loop and possible little overhead can be neglected. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Acked-by: Lee Jones Acked-by: Serge Semin Link: https://lore.kernel.org/r/20200519131233.59032-4-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit aa90939d22973765cc6318c6748c272b954e202f Author: Andy Shevchenko Date: Tue May 19 16:12:32 2020 +0300 gpio: dwapb: Don't use IRQ 0 as valid Linux interrupt IRQ 0 is not valid in Linux interrupt number space. Refactor the code with this kept in mind. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Acked-by: Serge Semin Link: https://lore.kernel.org/r/20200519131233.59032-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit d7cc23604f367c0d0f272f0af55e2032de50a053 Author: Andy Shevchenko Date: Tue May 19 16:12:31 2020 +0300 gpio: dwapb: avoid error message for optional IRQ platform_get_irq() will generate an error message if the requested IRQ is not present. Use platform_get_irq_optional() to avoid the error message being generated. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Acked-by: Serge Semin Link: https://lore.kernel.org/r/20200519131233.59032-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 494a94e38dcf62543a32a4424d646ff80b4b28bd Author: Andy Shevchenko Date: Tue May 19 16:12:30 2020 +0300 gpio: dwapb: Call acpi_gpiochip_free_interrupts() on GPIO chip de-registration Add missed acpi_gpiochip_free_interrupts() call when unregistering ports. While at it, drop extra check to call acpi_gpiochip_request_interrupts(). There is no need to have an additional check to call acpi_gpiochip_request_interrupts(). Even without any interrupts available the registered ACPI Event handlers can be useful for debugging purposes. Fixes: e6cb3486f5a1 ("gpio: dwapb: add gpio-signaled acpi event support") Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Acked-by: Serge Semin Link: https://lore.kernel.org/r/20200519131233.59032-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 03c3b413a14d8bbf0afc8e069cf2a65df580c30c Author: Sumeet Pawnikar Date: Thu May 21 12:14:26 2020 +0530 powercap: RAPL: remove unused local MSR define Remove unused PLATFORM_POWER_LIMIT MSR local definition from file intel_rapl_common.c. This was missed while splitting old RAPL code intel_rapl.c file into two new files intel_rapl_msr.c and intel_rapl_common.c as per the commit 3382388d7148 ("intel_rapl: abstract RAPL common code"). Currently, this #define entry is being used only in intel_rapl_msr.c file and local definition present in this file. Signed-off-by: Sumeet Pawnikar Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 3381df0954199458fa3993db72fb427f0ed1e43b Author: Gustavo A. R. Silva Date: Thu May 21 13:57:07 2020 -0500 m68k: tools: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200521185707.GA3661@embeddedor Signed-off-by: Geert Uytterhoeven commit 2941a4731fd24d5e43ef437cca90818f87fd4851 Author: Jason Wang Date: Wed May 20 14:57:50 2020 +0800 m68k: Add missing __user annotation in get_user() The ptr is a pointer to userspace memory. So we need annotate it with __user otherwise we may get sparse warnings like: drivers/vhost/vhost.c:1603:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got unsigned int [noderef] [usertypvoid const *__gu_ptr @@ drivers/vhost/vhost.c:1603:13: sparse: expected void const *__gu_ptr drivers/vhost/vhost.c:1603:13: sparse: got unsigned int [noderef] [usertype] *idxp Reported-by: kbuild test robot Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20200520065750.8401-1-jasowang@redhat.com Fixes: 7124330dabe5b3cb ("m68k/uaccess: Revive 64-bit get_user()") Signed-off-by: Geert Uytterhoeven commit b2003c7a811c765f18d1495c01251c20f9e6c93a Author: Finn Thain Date: Wed May 20 14:32:02 2020 +1000 m68k: mac: Avoid stuck ISM IOP interrupt on Quadra 900/950 On a Quadra 900/950, the ISM IOP IRQ output pin is connected to an edge-triggered input on VIA2. It is theoretically possible that this signal could fail to produce the expected VIA2 interrupt. The two IOP interrupt flags can be asserted in any order but the logic in iop_ism_irq() does not allow for that. In particular, INT0 can be asserted right after INT0 is checked and before INT1 is cleared. Such an interrupt would produce no new edge and VIA2 would detect no further interrupts from the IOP. Avoid this by looping over the INT0/1 handlers so an edge can be produced. Signed-off-by: Finn Thain Tested-by: Stan Johnson Cc: Joshua Thompson Link: https://lore.kernel.org/r/bfbb71db52c5e162d3afa25a28fc5d535ca87138.1589949122.git.fthain@telegraphics.com.au Signed-off-by: Geert Uytterhoeven commit bf6c68ead314bd2339aea84d77bacada03df757a Author: Finn Thain Date: Wed May 20 14:32:02 2020 +1000 m68k: mac: Remove misleading comment This code path was tested on a Quadra 950 a long time ago and the comment isn't needed. Signed-off-by: Finn Thain Cc: Joshua Thompson Link: https://lore.kernel.org/r/10dff3e7c17d363a4b239aae7b3ebab32bef3547.1589949122.git.fthain@telegraphics.com.au Signed-off-by: Geert Uytterhoeven commit bcc44f6b74106b31f0b0408b70305a40360d63b7 Author: Finn Thain Date: Wed May 20 14:32:02 2020 +1000 m68k: mac: Don't call via_flush_cache() on Mac IIfx There is no VIA2 chip on the Mac IIfx, so don't call via_flush_cache(). This avoids a boot crash which appeared in v5.4. printk: console [ttyS0] enabled printk: bootconsole [debug0] disabled printk: bootconsole [debug0] disabled Calibrating delay loop... 9.61 BogoMIPS (lpj=48064) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) devtmpfs: initialized random: get_random_u32 called from bucket_table_alloc.isra.27+0x68/0x194 with crng_init=0 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 256 (order: -1, 3072 bytes, linear) NET: Registered protocol family 16 Data read fault at 0x00000000 in Super Data (pc=0x8a6a) BAD KERNEL BUSERR Oops: 00000000 Modules linked in: PC: [<00008a6a>] via_flush_cache+0x12/0x2c SR: 2700 SP: 01c1fe3c a2: 01c24000 d0: 00001119 d1: 0000000c d2: 00012000 d3: 0000000f d4: 01c06840 d5: 00033b92 a0: 00000000 a1: 00000000 Process swapper (pid: 1, task=01c24000) Frame format=B ssw=0755 isc=0200 isb=fff7 daddr=00000000 dobuf=01c1fed0 baddr=00008a6e dibuf=0000004e ver=f Stack from 01c1fec4: 01c1fed0 00007d7e 00010080 01c1fedc 0000792e 00000001 01c1fef4 00006b40 01c80000 00040000 00000006 00000003 01c1ff1c 004a545e 004ff200 00040000 00000000 00000003 01c06840 00033b92 004a5410 004b6c88 01c1ff84 000021e2 00000073 00000003 01c06840 00033b92 0038507a 004bb094 004b6ca8 004b6c88 004b6ca4 004b6c88 000021ae 00020002 00000000 01c0685d 00000000 01c1ffb4 0049f938 00409c85 01c06840 0045bd40 00000073 00000002 00000002 00000000 Call Trace: [<00007d7e>] mac_cache_card_flush+0x12/0x1c [<00010080>] fix_dnrm+0x2/0x18 [<0000792e>] cache_push+0x46/0x5a [<00006b40>] arch_dma_prep_coherent+0x60/0x6e [<00040000>] switched_to_dl+0x76/0xd0 [<004a545e>] dma_atomic_pool_init+0x4e/0x188 [<00040000>] switched_to_dl+0x76/0xd0 [<00033b92>] parse_args+0x0/0x370 [<004a5410>] dma_atomic_pool_init+0x0/0x188 [<000021e2>] do_one_initcall+0x34/0x1be [<00033b92>] parse_args+0x0/0x370 [<0038507a>] strcpy+0x0/0x1e [<000021ae>] do_one_initcall+0x0/0x1be [<00020002>] do_proc_dointvec_conv+0x54/0x74 [<0049f938>] kernel_init_freeable+0x126/0x190 [<0049f94c>] kernel_init_freeable+0x13a/0x190 [<004a5410>] dma_atomic_pool_init+0x0/0x188 [<00041798>] complete+0x0/0x3c [<000b9b0c>] kfree+0x0/0x20a [<0038df98>] schedule+0x0/0xd0 [<0038d604>] kernel_init+0x0/0xda [<0038d610>] kernel_init+0xc/0xda [<0038d604>] kernel_init+0x0/0xda [<00002d38>] ret_from_kernel_thread+0xc/0x14 Code: 0000 2079 0048 10da 2279 0048 10c8 d3c8 <1011> 0200 fff7 1280 d1f9 0048 10c8 1010 0000 0008 1080 4e5e 4e75 4e56 0000 2039 Disabling lock debugging due to kernel taint Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Thanks to Stan Johnson for capturing the console log and running git bisect. Git bisect said commit 8e3a68fb55e0 ("dma-mapping: make dma_atomic_pool_init self-contained") is the first "bad" commit. I don't know why. Perhaps mach_l2_flush first became reachable with that commit. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-and-tested-by: Stan Johnson Signed-off-by: Finn Thain Cc: Joshua Thompson Link: https://lore.kernel.org/r/b8bbeef197d6b3898e82ed0d231ad08f575a4b34.1589949122.git.fthain@telegraphics.com.au Signed-off-by: Geert Uytterhoeven commit 3618bbaaa898cf48e859736120a775fcb56f3838 Author: Andy Shevchenko Date: Fri May 22 18:09:55 2020 +0300 PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend() rpm_suspend() simple bails out when conditions are wrong. But this is not immediately obvious from the code. Make it clear what we do when conditions are wrong in rpm_suspend(). Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit eb012d125a2419786f5bcaaf8a901babc7b6e3d7 Author: Tetsuo Handa Date: Mon May 25 00:32:43 2020 +0900 printk: Remove pr_cont_once() pr_cont_once() does not make sense; at least emitting module name using pr_fmt() into middle of a line (after e.g. pr_info_once()) does not make sense. Let's remove unused pr_cont_once(). Link: https://lore.kernel.org/r/20200524153243.11690-1-penguin-kernel@I-love.SAKURA.ne.jp Cc: Joe Perches Signed-off-by: Tetsuo Handa Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 4caf2511ec498277333d229f8a7ad1fa9331df65 Author: Maxim Levitsky Date: Wed May 20 21:52:21 2020 +0300 thunderbolt: Add trivial .shutdown On my machine, a kexec with this driver loaded in the old kernel causes a very long delay on boot in the kexec'ed kernel, most likely due to unclean shutdown prior to that. Unloading thunderbolt driver prior to kexec allows kexec to work as fast as regular kernel boot, as well as adding this .shutdown pointer. Shutting a device prior to the shutdown completely is always a good idea IMHO to help with kexec, and this one-liner patch implements it. Signed-off-by: Maxim Levitsky Signed-off-by: Mika Westerberg commit 2f02fd3fa13e51713b630164f8a8e5b42de8283b Author: Amir Goldstein Date: Sun May 24 10:24:41 2020 +0300 fanotify: fix ignore mask logic for events on child and on dir The comments in fanotify_group_event_mask() say: "If the event is on dir/child and this mark doesn't care about events on dir/child, don't send it!" Specifically, mount and filesystem marks do not care about events on child, but they can still specify an ignore mask for those events. For example, a group that has: - A mount mark with mask 0 and ignore_mask FAN_OPEN - An inode mark on a directory with mask FAN_OPEN | FAN_OPEN_EXEC with flag FAN_EVENT_ON_CHILD A child file open for exec would be reported to group with the FAN_OPEN event despite the fact that FAN_OPEN is in ignore mask of mount mark, because the mark iteration loop skips over non-inode marks for events on child when calculating the ignore mask. Move ignore mask calculation to the top of the iteration loop block before excluding marks for events on dir/child. Link: https://lore.kernel.org/r/20200524072441.18258-1-amir73il@gmail.com Reported-by: Jan Kara Link: https://lore.kernel.org/linux-fsdevel/20200521162443.GA26052@quack2.suse.cz/ Fixes: 55bf882c7f13 "fanotify: fix merging marks masks with FAN_ONDIR" Fixes: b469e7e47c8a "fanotify: fix handling of events on child..." Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 5ed909b368fcf118ce208a6c03826d4e70e482ae Merge: 9cb1fd0efd19 7b0bf99b9ee4 Author: Rafael J. Wysocki Date: Mon May 25 10:42:31 2020 +0200 Merge tag 'linux-cpupower-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux Pull cpupower utility updates for v5.8-rc1 from Shuah Khan: "This cpupower update for Linux 5.8-rc1 consists of a single patch to fix coccicheck unneeded semicolon warning." * tag 'linux-cpupower-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: Remove unneeded semicolon commit 1c11e74e9079289d8aaccc34b74cbf6463c0b791 Author: Roger Quadros Date: Mon May 25 10:10:48 2020 +0300 usb: dwc3: keystone: Turn on USB3 PHY before controller The Local Power Sleep Controller (LPSC) dependency on AM65 requires SERDES0 to be powered on before USB. We need to power up SERDES0 power domain and hold it on throughout the reset, init, power on sequence. Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi commit 15aeb360e4a0d144cb64e2adb6f71b444bafc238 Author: Roger Quadros Date: Mon May 25 10:10:47 2020 +0300 dt-bindings: usb: ti,keystone-dwc3.yaml: Add USB3.0 PHY property AM654 SoC requires USB3.0 PHY to be turned on before the USB controller. For this SoC, the 'phys' property is used to provide the USB3.0 reference. Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi commit 1883a934e15638efc39cf444908c928bef51b2a0 Author: Roger Quadros Date: Wed May 13 16:07:07 2020 +0300 dt-bindings: usb: convert keystone-usb.txt to YAML Convert keystone-usb documentation to YAML format. Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi commit 63c7bb299fc9c430070c0177f0879635e9ee23d0 Author: Thinh Nguyen Date: Fri May 15 16:40:46 2020 -0700 usb: dwc3: gadget: Check for prepared TRBs There are cases where the endpoint needs to be restarted. For example, it may need to restart for NoStream rejection to reinitiate stream. If so, check and make sure we don't prepare beyond the current transfer when we restart the endpoint. DWC_usb32 internal burst transfer feature will look into TRBs beyond a transfer. Other controllers will stop on the last TRB, but not DWC_usb32. This may cause the controller to incorrectly process TRBs of a different transfer. Make sure to explicitly prevent preparing TRBs of a different transfer. This should only affect DWC_usb32 releases prior to v1.00a since it doesn't use SET_ENDPOINT_PRIME to reinitiate stream. However, it's better to be cautious in case users don't want to use SET_ENDPOINT_PRIME command. Also, it's possible other controller IPs may share the same features as DWC_usb32 in new releases. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 5d363120aa548ba52d58907a295eee25f8207ed2 Author: Pawel Laszczak Date: Mon May 18 12:08:45 2020 +0200 usb: gadget: Fix issue with config_ep_by_speed function This patch adds new config_ep_by_speed_and_alt function which extends the config_ep_by_speed about alt parameter. This additional parameter allows to find proper usb_ss_ep_comp_descriptor. Problem has appeared during testing f_tcm (BOT/UAS) driver function. f_tcm function for SS use array of headers for both BOT/UAS alternate setting: static struct usb_descriptor_header *uasp_ss_function_desc[] = { (struct usb_descriptor_header *) &bot_intf_desc, (struct usb_descriptor_header *) &uasp_ss_bi_desc, (struct usb_descriptor_header *) &bot_bi_ep_comp_desc, (struct usb_descriptor_header *) &uasp_ss_bo_desc, (struct usb_descriptor_header *) &bot_bo_ep_comp_desc, (struct usb_descriptor_header *) &uasp_intf_desc, (struct usb_descriptor_header *) &uasp_ss_bi_desc, (struct usb_descriptor_header *) &uasp_bi_ep_comp_desc, (struct usb_descriptor_header *) &uasp_bi_pipe_desc, (struct usb_descriptor_header *) &uasp_ss_bo_desc, (struct usb_descriptor_header *) &uasp_bo_ep_comp_desc, (struct usb_descriptor_header *) &uasp_bo_pipe_desc, (struct usb_descriptor_header *) &uasp_ss_status_desc, (struct usb_descriptor_header *) &uasp_status_in_ep_comp_desc, (struct usb_descriptor_header *) &uasp_status_pipe_desc, (struct usb_descriptor_header *) &uasp_ss_cmd_desc, (struct usb_descriptor_header *) &uasp_cmd_comp_desc, (struct usb_descriptor_header *) &uasp_cmd_pipe_desc, NULL, }; The first 5 descriptors are associated with BOT alternate setting, and others are associated with UAS. During handling UAS alternate setting f_tcm driver invokes config_ep_by_speed and this function sets incorrect companion endpoint descriptor in usb_ep object. Instead setting ep->comp_desc to uasp_bi_ep_comp_desc function in this case set ep->comp_desc to uasp_ss_bi_desc. This is due to the fact that it searches endpoint based on endpoint address: for_each_ep_desc(speed_desc, d_spd) { chosen_desc = (struct usb_endpoint_descriptor *)*d_spd; if (chosen_desc->bEndpoitAddress == _ep->address) goto ep_found; } And in result it uses the descriptor from BOT alternate setting instead UAS. Finally, it causes that controller driver during enabling endpoints detect that just enabled endpoint for bot. Signed-off-by: Jayshri Pawar Signed-off-by: Pawel Laszczak Signed-off-by: Felipe Balbi commit 8b5b9adbff131bf0c809696474f7a24409b4da63 Author: Peter Chen Date: Sun Apr 26 21:07:51 2020 +0800 usb: cdns3: ep0: delete the redundant status stage Each setup stage will prepare status stage at cdns3_ep0_setup_phase, it doesn't need to add extra status stage for test mode handling, otherwise, the controller can't enter the test mode. Through the Lecroy bus analyzer log, the controller will always wait status stage even it is prepared by software later than the test mode is set by software. If we comment out the status stage at cdns3_ep0_setup_phase, the controller will not enter test mode even the test mode is set beforehand. Reviewed-by: Pawel Laszczak Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 65dc2e725286106f99c6f6b78e3d9c52c15f3a9c Author: Minas Harutyunyan Date: Thu May 21 10:05:44 2020 +0400 usb: dwc2: Update Core Reset programming flow. Starting from core version 4.20a Core Reset flow is changed. Introduced new bit in GRSTCTL register - GRSTCTL_CSFTRST_DONE. Core Reset new programming flow steps are follow: 1. Set GRSTCTL_CSFTRST bit. 2. Wait for bit GRSTCTL_CSFTRST_DONE is set. 3. Clear GRSTCTL_CSFTRST and GRSTCTL_CSFTRST_DONE bits. Check core version functionality separated from dwc2_get_hwparams() to new dwc2_check_core_version() function because Core Reset flow depend on SNPSID. Signed-off-by: Minas Harutyunyan Signed-off-by: Felipe Balbi commit 4cda340a455b425f7df9657aaaa78a75757d940d Author: Tang Bin Date: Fri Apr 10 09:58:32 2020 +0800 usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe() If the function "platform_get_irq()" failed, the negative value returned will not be detected here, including "-EPROBE_DEFER", which causes the application to fail to get the correct error message. Thus it must be fixed. Acked-by: Li Yang Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang Signed-off-by: Felipe Balbi commit 44734a594196bf1d474212f38fe3a0d37a73278b Author: Qiushi Wu Date: Fri May 22 23:06:25 2020 -0500 usb: gadget: fix potential double-free in m66592_probe. m66592_free_request() is called under label "err_add_udc" and "clean_up", and m66592->ep0_req is not set to NULL after first free, leading to a double-free. Fix this issue by setting m66592->ep0_req to NULL after the first free. Fixes: 0f91349b89f3 ("usb: gadget: convert all users to the new udc infrastructure") Signed-off-by: Qiushi Wu Signed-off-by: Felipe Balbi commit e5b913496099527abe46e175e5e2c844367bded0 Author: Dinghao Liu Date: Thu May 21 15:39:19 2020 +0800 usb: cdns3: Fix runtime PM imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Reviewed-by: Peter Chen Signed-off-by: Dinghao Liu Signed-off-by: Felipe Balbi commit eafa80041645cd7604c4357b1a0cd4a3c81f2227 Author: Colin Ian King Date: Thu May 21 16:13:00 2020 +0100 usb: gadget: lpc32xx_udc: don't dereference ep pointer before null check Currently pointer ep is being dereferenced before it is null checked leading to a null pointer dereference issue. Fix this by only assigning pointer udc once ep is known to be not null. Also remove a debug message that requires a valid udc which may not be possible at that point. Addresses-Coverity: ("Dereference before null check") Fixes: 24a28e428351 ("USB: gadget driver for LPC32xx") Signed-off-by: Colin Ian King Signed-off-by: Felipe Balbi commit 1c0e69ae1b9f9004fd72978612ae3463791edc56 Author: Yu Chen Date: Thu May 21 16:46:43 2020 +0800 usb: dwc3: Increase timeout for CmdAct cleared by device controller If the SS PHY is in P3, there is no pipe_clk, HW may use suspend_clk for function, as suspend_clk is slow so EP command need more time to complete, e.g, imx8M suspend_clk is 32K, set ep configuration will take about 380us per below trace time stamp(44.286278 - 44.285897 = 0.000381): configfs_acm.sh-822 [000] d..1 44.285896: dwc3_writel: addr 000000006d59aae1 value 00000401 configfs_acm.sh-822 [000] d..1 44.285897: dwc3_readl: addr 000000006d59aae1 value 00000401 ... ... configfs_acm.sh-822 [000] d..1 44.286278: dwc3_readl: addr 000000006d59aae1 value 00000001 configfs_acm.sh-822 [000] d..1 44.286279: dwc3_gadget_ep_cmd: ep0out: cmd 'Set Endpoint Configuration' [401] params 00001000 00000500 00000000 --> status: Successful This was originally found on Hisilicon Kirin Soc that need more time for the device controller to clear the CmdAct of DEPCMD. Signed-off-by: Yu Chen Signed-off-by: John Stultz Signed-off-by: Li Jun Signed-off-by: Felipe Balbi commit eccba1edeebf0cf4525a680e1585ccf97dfc4c87 Author: Andrey Konovalov Date: Wed May 13 22:52:56 2020 +0200 USB: dummy-hcd: use configurable endpoint naming scheme USB gadget subsystem uses the following naming convention for UDC endpoints: - "ep-a" names for fully configurable endpoints (address, direction and transfer type can be changed); - "ep1in", "ep12out-bulk" names for fixed function endpoints (fixed address, direction and/or transfer type). Dummy UDC endpoints are capable of full configuration, but named using the second scheme. This patch changes the names of generic Dummy UDC endpoints to "ep-aout", "ep-bin", etc., to advertise that they have configurable addresses and transfer types (except that Dummy UDC doesn't support ISO transfers), but fixed direction. This is required for Raw Gadget (and perhaps for some other drivers), that reasons about whether an endpoint has configurable address based on its name. Suggested-by: Alan Stern Acked-by: Alan Stern Signed-off-by: Andrey Konovalov Signed-off-by: Felipe Balbi commit 77f30ff49761acbb3d90aca0004f393fd81b63a8 Author: Peter Chen Date: Sun May 10 13:30:42 2020 +0800 usb: cdns3: gadget: assign interrupt number to USB gadget structure Assign interrupt number to USB gadget structure. Reviewed-by: Jun Li Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 3c73bc52195def14165c3a7d91bdbb33b51725f5 Author: Peter Chen Date: Sun May 10 13:30:41 2020 +0800 usb: gadget: core: sync interrupt before unbind the udc The threaded interrupt handler may still be called after the usb_gadget_disconnect is called, it causes the structures used at interrupt handler was freed before it uses, eg the usb_request. This issue usually occurs we remove the udc function during the transfer. Below is the example when doing stress test for android switch function, the EP0's request is freed by .unbind (configfs_composite_unbind -> composite_dev_cleanup), but the threaded handler accesses this request during handling setup packet request. In fact, there is no protection between unbind the udc and udc interrupt handling, so we have to avoid the interrupt handler is occurred or scheduled during the .unbind flow. init: Sending signal 9 to service 'adbd' (pid 18077) process group... android_work: did not send uevent (0 0 000000007bec2039) libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 6ms init: Service 'adbd' (pid 18077) received signal 9 init: Sending signal 9 to service 'adbd' (pid 18077) process group... libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 0ms init: processing action (init.svc.adbd=stopped) from (/init.usb.configfs.rc:14) init: Received control message 'start' for 'adbd' from pid: 399 (/vendor/bin/hw/android.hardware.usb@1. init: starting service 'adbd'... read descriptors read strings Unable to handle kernel read from unreadable memory at virtual address 000000000000002a android_work: sent uevent USB_STATE=CONNECTED Mem abort info: ESR = 0x96000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=00000000e97f1000 using random self ethernet address [000000000000002a] pgd=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 232 Comm: irq/68-5b110000 Not tainted 5.4.24-06075-g94a6b52b5815 #92 Hardware name: Freescale i.MX8QXP MEK (DT) pstate: 00400085 (nzcv daIf +PAN -UAO) using random host ethernet address pc : composite_setup+0x5c/0x1730 lr : android_setup+0xc0/0x148 sp : ffff80001349bba0 x29: ffff80001349bba0 x28: ffff00083a50da00 x27: ffff8000124e6000 x26: ffff800010177950 x25: 0000000000000040 x24: ffff000834e18010 x23: 0000000000000000 x22: 0000000000000000 x21: ffff00083a50da00 x20: ffff00082e75ec40 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000001 x11: ffff80001180fb58 x10: 0000000000000040 x9 : ffff8000120fc980 x8 : 0000000000000000 x7 : ffff00083f98df50 x6 : 0000000000000100 x5 : 00000307e8978431 x4 : ffff800011386788 x3 : 0000000000000000 x2 : ffff800012342000 x1 : 0000000000000000 x0 : ffff800010c6d3a0 Call trace: composite_setup+0x5c/0x1730 android_setup+0xc0/0x148 cdns3_ep0_delegate_req+0x64/0x90 cdns3_check_ep0_interrupt_proceed+0x384/0x738 cdns3_device_thread_irq_handler+0x124/0x6e0 cdns3_thread_irq+0x94/0xa0 irq_thread_fn+0x30/0xa0 irq_thread+0x150/0x248 kthread+0xfc/0x128 ret_from_fork+0x10/0x18 Code: 910e8000 f9400693 12001ed7 79400f79 (3940aa61) ---[ end trace c685db37f8773fba ]--- Kernel panic - not syncing: Fatal exception SMP: stopping secondary CPUs Kernel Offset: disabled CPU features: 0x0002,20002008 Memory Limit: none Rebooting in 5 seconds.. Reviewed-by: Jun Li Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 5d48fe6140d8be52ccab3ca2588200ebba558f68 Author: Sandeep Maheswaram Date: Wed Apr 1 10:45:45 2020 +0530 arm64: dts: qcom: sc7180: Add interconnect properties for USB Populate USB DT nodes with interconnect properties. Reviewed-by: Stephen Boyd Signed-off-by: Sandeep Maheswaram Signed-off-by: Felipe Balbi commit 11a8b115feee846df03612fdf06bf554f46b80a5 Author: Sandeep Maheswaram Date: Wed Apr 1 10:45:44 2020 +0530 arm64: dts: qcom: sdm845: Add interconnect properties for USB Populate USB DT nodes with interconnect properties. Reviewed-by: Stephen Boyd Signed-off-by: Sandeep Maheswaram Signed-off-by: Felipe Balbi commit 1805cdde37c8cc90b298c3d9afbc2aa4c9890635 Author: Sandeep Maheswaram Date: Wed Apr 1 10:45:42 2020 +0530 dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver Add documentation for the interconnects and interconnect-names properties for USB. Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Sandeep Maheswaram Signed-off-by: Felipe Balbi commit a5c4c29d24c69b2d589f1bdfc0ad9ba8798b6e13 Author: Gregory CLEMENT Date: Thu May 7 17:56:51 2020 +0200 ARM: dts: at91: Remove the USB EP child node The endpoint configuration used to be stored in the device tree, however the configuration depend on the "version" of the controller itself. Then the EP child node are useless and describe as deprecated in the documentation binding: remove all the nodes from the SoC device tree file. Remove also the #address-cells and #size-cells properties that are no longer needed. Signed-off-by: Gregory CLEMENT Signed-off-by: Felipe Balbi commit 4db120d93d53f668770f07a41567a404b88891fb Author: Gregory CLEMENT Date: Thu May 7 17:56:50 2020 +0200 dt-bindings: usb: atmel: Mark EP child node as deprecated There is no need to describe the end point in the deice tree. These properties won't be use anymore, so mark them as deprecated to keep the old device tree documented. Reviewed-by: Rob Herring Signed-off-by: Gregory CLEMENT Signed-off-by: Felipe Balbi commit e78355b577c4ba623707fca2a36ddb4dc9f6ee29 Author: Gregory CLEMENT Date: Thu May 7 17:56:49 2020 +0200 usb: gadget: udc: atmel: Don't use DT to configure end point The endpoint configuration used to be stored in the device tree, however the configuration depend on the "version" of the controller itself. This information is already documented by the compatible string. It then possible to just rely on the compatible string and completely remove the full ep configuration done in the device tree as it was already the case for all the other USB device controller. Acked-by: Cristian Birsan Signed-off-by: Gregory CLEMENT Signed-off-by: Felipe Balbi commit b10e1c2535777fa393c494d6fa2096c7c3219250 Author: Thinh Nguyen Date: Tue May 5 19:47:15 2020 -0700 usb: dwc3: gadget: Use SET_EP_PRIME for NoStream DWC_usb32 v1.00a and later can use SET_EP_PRIME command to reinitiate a stream. Use the command to handle NoStream rejection instead of ending and restarting the endpoint. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 140ca4cfea8a7aeff89c8969a4cc7ce125a04159 Author: Thinh Nguyen Date: Tue May 5 19:47:09 2020 -0700 usb: dwc3: gadget: Handle stream transfers Overview of stream transfer requirement: * A transfer will have a set of TRBs of the same stream ID. * A transfer is started with a stream ID in START_TRANSFER command. * A new stream will only start when the previous completes. Overview of stream events: * A "prime" from host indicates that its endpoints are active (buffers prepared and ready to receive/transmit data). The controller automatically initiates stream if it sees this. * A "NoStream" rejection event indicates that the host isn't ready. Host will put the endpoint back to idle state. Device may need to reinitiate the stream to start transfer again. * A Stream Found event means host accepted device initiated stream. Nothing needs to be done from driver. To initiate a stream, the driver will issue START_TRANSFER command with a stream ID. To reinitiate the stream, the driver must issue END_TRANSFER and restart the transfer with START_TRANSFER command with the same stream ID. This implementation handles device-initated streams (e.g. UASP driver). It also handles some hosts' quirky behavior where they only prime each endpoint once. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit aefe3d232b6629cb0ac92cc3d4238a5133dd9fec Author: Thinh Nguyen Date: Tue May 5 19:47:03 2020 -0700 usb: dwc3: gadget: Don't prepare beyond a transfer Don't prepare TRBs beyond a transfer. In DWC_usb32, its transfer burst capability may try to read and use TRBs beyond the active transfer. For other controllers, they don't process the next transfer TRBs until the current transfer is completed. Explicitly prevent preparing TRBs ahead for all controllers. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit e0d19563eb6c191ca5539789173fb0e8fc5e69ed Author: Thinh Nguyen Date: Tue May 5 19:46:57 2020 -0700 usb: dwc3: gadget: Wait for transfer completion If a transfer is in-progress, any new request should not kick off another transfer. The driver needs to wait for the current transfer to complete before starting off the next transfer. Introduce a new flag DWC3_EP_WAIT_TRANSFER_COMPLETE for this. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 3eaecd0c2333aa9eeefce2ff130c9323cde53178 Author: Thinh Nguyen Date: Tue May 5 19:46:51 2020 -0700 usb: dwc3: gadget: Handle XferComplete for streams In DWC3, to prepare TRBs for streams, all the TRBs of a transfer will use the same stream ID. To start a new stream, the driver needs to wait for the current transfer to complete or ended (by END_TRANFER command). As a result, inform the controller of the last TRB of a transfer so that it knows when a transfer completes and start a new transfer of a new stream. Even though the transfer completion handling can be applied for other non-isoc endpoints, only do it for streams due to its requirement. It's better to keep the controller's TRB cache full than waiting for transfer completion and starting a new transfer. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 548f8b31656363c21867a0a0769932b6b3f0f8b6 Author: Thinh Nguyen Date: Tue May 5 19:46:45 2020 -0700 usb: dwc3: gadget: Enable XferComplete event To switch from one stream to another, this requires the driver to start a new transfer with a specific stream ID. For a transfer to complete, the driver needs to indicate the last TRB of a transfer, and it needs to enable XferComplete event to handle completed TRBs of a transfer. Let's enable this event only for stream capable endpoints. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 2e6e9e4b2ed70a9d7b1f860a349b5273ed73f9fa Author: Thinh Nguyen Date: Tue May 5 19:46:39 2020 -0700 usb: dwc3: gadget: Refactor TRB completion handler To prepare for handling of XferComplete event, let's refactor and split up dwc3_gadget_endpoint_transfer_in_progress() to handle TRBs completion for different events. The handling of TRBs completion will be the same, but the status of XferComplete event is different than XferInProgress. No functional change in this commit. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit b6842d4938c3101cb54dc262a6a89a5445f8fba8 Author: Thinh Nguyen Date: Tue May 5 19:46:33 2020 -0700 usb: dwc3: gadget: Check for in-progress END_TRANSFER While handling TRBs completion, if a END_TRANSFER command isn't completed, don't kick new transfer or issue END_TRANSFER command. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 27b31b91b04bf7b76103d222bd2cbe37c9e59ed0 Author: Thinh Nguyen Date: Tue May 5 19:46:19 2020 -0700 usb: gadget: f_tcm: Inform last stream request Set the request->is_last to each stream request to indicate that the request is the last stream request of a transfer. The DWC3 controller needs to know this info to properly switch streams. The current implementation of f_tcm uses a single request per transfer, so every stream request is the last of its stream. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 5469fd64efcfbc2b9b2edb92c4f906912736d5b0 Author: Thinh Nguyen Date: Tue May 5 19:46:13 2020 -0700 usb: gadget: Introduce usb_request->is_last To take advantage of DWC3 internal TRB prefetch and cache for performance, inform the controller the last request with stream_id before switching to a different stream transfer. This allows the controller to maintain its transfer burst within the stream ID. Introduce the usb-request is_last field to help inform the DWC3 controller of this. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 4244ba02edb850f880fafe178abccd9231cb0e4a Author: Thinh Nguyen Date: Sat Apr 11 19:20:07 2020 -0700 usb: dwc3: Get MDWIDTH for DWC_usb32 DWC_usb32 supports MDWIDTH value larger than 255 and up to 1023. The field HWPARAMS6[9:8] stores the upper 2-bit values of the DWC_usb32's MDWIDTH. Check that parameter and properly get the MDWIDTH for DWC_usb32. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 9af21dd6faeba593fb47f5cceaf69b1e5a3ff95f Author: Thinh Nguyen Date: Sat Apr 11 19:20:01 2020 -0700 usb: dwc3: Add support for DWC_usb32 IP Synopsys introduces a new controller DWC_usb32. It supports dual-lane and speed up to 20 Gbps, and the DWC3 driver will drive this controller. Currently the driver uses a single field dwc->revision to ID both DWC_usb3 and DWC_usb31 and their version number. This was sufficient for two IPs, but this method doesn't work with additional IPs. As a result, let's separate the dwc->revision field to 2 separate fields: ip and revision. The ip field now stores the ID of the controller's IP while the revision field stores the controller's version number. This new scheme enforces DWC3 to compare the revision within the same IP only. As a result, we must update all the revision check of the controller to check its corresponding IP. To help with this enforcement, we create a few macros to help with the common version checks: DWC3_IP_IS(IP) DWC3_VER_IS(IP, VERSION) DWC3_VER_IS_PRIOR(IP, VERSION) DWC3_VER_IS_WITHIN(IP, LOWER_VERSION, UPPER_VERSION) DWC3_VER_TYPE_IS_WITHIN(IP, VERSION, LOWER_VERSION_TYPE, UPPER_VERSION_TYPE) The DWC_usb32 controller operates using the same programming model and with very similar configurations as its previous controllers. Please note that the various IP and revision checks in this patch match the current checks for DWC_usb31 version 1.90a. Additional configurations that are unique to DWC_usb32 are applied separately. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 88607a821ffc04034dea91747f79f2d83fe5c232 Author: Nagarjuna Kristam Date: Mon May 4 12:04:41 2020 +0530 usb: gadget: tegra-xudc: add port_speed_quirk OTG port on Tegra194 supports GEN1 speeds when in device mode and GEN2 speeds when in host mode. dd port_speed_quirk that configures port to GEN1/GEN2 speds, corresponding to the mode. Based on work by WayneChang Signed-off-by: Nagarjuna Kristam Signed-off-by: Felipe Balbi commit 9584a60a3b34f3408690bd3f310137494727f10a Author: Nagarjuna Kristam Date: Mon May 4 12:04:40 2020 +0530 usb: gadget: tegra-xudc: Add Tegra194 support This commit adds support for XUSB device mode controller support on Tegra194 SoC. This is very similar to the existing Tegra186 XUDC, with lpm support added in addition. Signed-off-by: Nagarjuna Kristam Acked-by: Thierry Reding Signed-off-by: Felipe Balbi commit 394b012a422d4bb00b69dadcf63148acf3b5d459 Author: Nagarjuna Kristam Date: Mon May 4 12:04:39 2020 +0530 dt-bindings: usb: tegra-xudc: Add Tegra194 XUSB controller support Extend the Tegra XUSB controller device tree binding with Tegra194 support. Signed-off-by: Nagarjuna Kristam Acked-by: Thierry Reding Acked-by: Rob Herring Signed-off-by: Felipe Balbi commit 7aca4393e6818311e26fe41909fad2f8577c9679 Author: Jules Irenge Date: Wed Apr 29 11:05:27 2020 +0100 USB: dummy-hcd: Add missing annotation for set_link_state() Sparse reports a warning at set_link_state() warning: context imbalance in set_link_state() - unexpected unlock The root cause is the missing annotation at set_link_state() Add the missing __must_hold(&dum->lock) Signed-off-by: Jules Irenge Signed-off-by: Felipe Balbi commit 66bd76e79e41eb79452e10d62f2099742a7feeb0 Author: Jules Irenge Date: Wed Apr 29 11:05:23 2020 +0100 usb: gadget: Add missing annotation for xudc_handle_setup() Sparse reports a warning at xudc_handle_setup() warning: context imbalance in xudc_handle_setup() - unexpected unlock The root cause is the missing annotation at xudc_handle_setup() Add the missing __must_hold(&udc->lock) annotation Signed-off-by: Jules Irenge Signed-off-by: Felipe Balbi commit 46b11a91124d481ff4754ec624fc5393a515a361 Author: Wei Yongjun Date: Tue Apr 28 13:39:34 2020 +0000 usb: gadget: mass_storage: use module_usb_composite_driver to simplify the code module_usb_composite_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun Signed-off-by: Felipe Balbi commit 55ee1bf91d6301a979c2981d626d6255bb367bdd Author: Jason Yan Date: Tue Apr 28 14:33:46 2020 +0800 usb: gadget: omap_udc: remove unneeded semicolon Fix the following coccicheck warning: drivers/usb/gadget/udc/omap_udc.c:2579:2-3: Unneeded semicolon Signed-off-by: Jason Yan Signed-off-by: Felipe Balbi commit 30755dd5047620a715c08f021f3b30e46cb8cc47 Author: Jason Yan Date: Sun Apr 26 17:42:19 2020 +0800 usb: gadget: udc: remove comparison to bool in mv_u3d_core.c Fix the following coccicheck warning: drivers/usb/gadget/udc/mv_u3d_core.c:1551:5-13: WARNING: Comparison to bool Signed-off-by: Jason Yan Signed-off-by: Felipe Balbi commit fe4ff11798dfb0f6a7f7657c8f01b52837c4b184 Author: Jason Yan Date: Sun Apr 26 17:42:10 2020 +0800 usb: gadget: net2272: use false for 'use_dma' Fix the following coccicheck warning: drivers/usb/gadget/udc/net2272.c:57:12-19: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Felipe Balbi commit c685114f63b1e5eae598855ada597321c3e80547 Author: Jason Yan Date: Sun Apr 26 17:41:56 2020 +0800 usb: dwc3: use true,false for dwc->otg_restart_host Fix the following coccicheck warning: drivers/usb/dwc3/drd.c:85:3-24: WARNING: Assignment of 0/1 to bool variable drivers/usb/dwc3/drd.c:59:2-23: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Felipe Balbi commit ded0d399754dbcae7ca0153ba87c68e66021f36a Author: Colin Ian King Date: Fri Apr 24 12:35:06 2020 +0100 usb: gadget: function: remove redundant assignment to variable 'status' The variable status is being assigned a value that is never read and it is being updated later with a new value. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Felipe Balbi commit 7a0fbcf7c308920bc6116b3a5fb21c8cc5fec128 Author: Nathan Chancellor Date: Thu Apr 23 09:29:24 2020 -0700 USB: gadget: udc: s3c2410_udc: Remove pointless NULL check in s3c2410_udc_nuke Clang warns: drivers/usb/gadget/udc/s3c2410_udc.c:255:11: warning: comparison of address of 'ep->queue' equal to a null pointer is always false [-Wtautological-pointer-compare] if (&ep->queue == NULL) ~~~~^~~~~ ~~~~ 1 warning generated. It is not wrong, queue is not a pointer so if ep is not NULL, the address of queue cannot be NULL. No other driver does a check like this and this check has been around since the driver was first introduced, presumably with no issues so it does not seem like this check should be something else. Just remove it. Commit afe956c577b2d ("kbuild: Enable -Wtautological-compare") exposed this but it is not the root cause of the warning. Fixes: 3fc154b6b8134 ("USB Gadget driver for Samsung s3c2410 ARM SoC") Link: https://github.com/ClangBuiltLinux/linux/issues/1004 Reviewed-by: Nick Desaulniers Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Signed-off-by: Felipe Balbi commit 3affccdd5ed118042553927654a8c8d897cc1a98 Author: Fabrice Gasnier Date: Thu Apr 23 13:55:56 2020 +0200 usb: gadget: f_acm: add suspend resume callbacks Add suspend resume callbacks to notify u_serial of the bus suspend/resume state. Signed-off-by: Fabrice Gasnier Signed-off-by: Felipe Balbi commit e702a7c346344733824e27c943cbef59b74aef6f Author: Fabrice Gasnier Date: Thu Apr 23 13:55:55 2020 +0200 usb: gadget: f_serial: add suspend resume callbacks Add suspend resume callbacks to notify u_serial of the bus suspend/resume state. Signed-off-by: Fabrice Gasnier Signed-off-by: Felipe Balbi commit aba3a8d01d623a5efef48ab8e78752d58d4c90c3 Author: Fabrice Gasnier Date: Thu Apr 23 13:55:54 2020 +0200 usb: gadget: u_serial: add suspend resume callbacks Add suspend resume callbacks to handle the case seen when the bus is suspended by the HOST, and the device opens the port (cat /dev/ttyGS0). Gadget controller (like DWC2) doesn't accept usb requests to be queued in this case (when in L2 state), from the gs_open() call. Error log is printed - configfs-gadget gadget: acm ttyGS0 can't notify serial state, -11 If the HOST resumes (opens) the bus, the port still isn't functional. Use suspend/resume callbacks to monitor the gadget suspended state by using 'suspended' flag. In case the port gets opened (cat /dev/ttyGS0), the I/O stream will be delayed until the bus gets resumed by the HOST. Signed-off-by: Fabrice Gasnier Signed-off-by: Felipe Balbi commit 8c935deacebb8fac8f41378701eb79d12f3c2e2d Author: Fabrice Gasnier Date: Thu Apr 23 13:55:53 2020 +0200 usb: dwc2: gadget: move gadget resume after the core is in L0 state When the remote wakeup interrupt is triggered, lx_state is resumed from L2 to L0 state. But when the gadget resume is called, lx_state is still L2. This prevents the resume callback to queue any request. Any attempt to queue a request from resume callback will result in: - "submit request only in active state" debug message to be issued - dwc2_hsotg_ep_queue() returns -EAGAIN Call the gadget resume routine after the core is in L0 state. Fixes: f81f46e1f530 ("usb: dwc2: implement hibernation during bus suspend/resume") Acked-by: Minas Harutyunyan Signed-off-by: Fabrice Gasnier Signed-off-by: Felipe Balbi commit 43cd0023872efbb6a86bdc03fb520de3de55c7b0 Author: Michael Grzeschik Date: Tue Apr 21 15:28:14 2020 +0200 usb: gadget: uvc_video: add worker to handle the frame pumping This patch changes the function uvc_video_pump to be a separate scheduled worker. This way the completion handler of each usb request and every direct caller of the pump has only to schedule the worker instead of doing the request handling by itself. Moving the request handling to one thread solves the locking problems between the three queueing cases in the completion handler, v4l2_qbuf and video_enable. Many drivers handle the completion handlers directly in their interrupt handlers. This patch also reduces the workload on each interrupt. Signed-off-by: Michael Grzeschik Signed-off-by: Felipe Balbi commit 7edd9cba9653c7d40d7baf34c0688d669207f880 Author: Nishad Kamdar Date: Sun Apr 19 18:27:10 2020 +0530 usb: renesas_usbhs: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to Renesas USBHS Controller Drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Reviewed-by: Yoshihiro Shimoda Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Felipe Balbi commit a54177d2dc76154546e5ff6395a65f25e069fdef Author: Jason Yan Date: Sat Apr 18 16:18:07 2020 +0800 usb: gadget: f_fs: remove unneeded semicolon in __ffs_data_got_descs() Fix the following coccicheck warning: drivers/usb/gadget/function/f_fs.c:2507:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Felipe Balbi commit 0bcf42d3d0531e9a97c454faff3b07194320b25c Author: Martin Blumenstingl Date: Thu Apr 16 14:19:10 2020 +0200 dt-bindings: usb: dwc3: remove old DWC3 wrapper There is now an updated bindings for these SoCs making the old compatible obsolete. Acked-by: Rob Herring Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 55b209c5c4a76d3dd1677e52de80a8b47136970a Author: Neil Armstrong Date: Thu Apr 16 14:19:09 2020 +0200 doc: dt: bindings: usb: dwc3: remove amlogic compatible entries Acked-by: Rob Herring Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit f4cc91ddd856e51c3a234f958c80fe8f3409e850 Author: Martin Blumenstingl Date: Thu Apr 16 14:19:08 2020 +0200 usb: dwc3: of-simple: remove Amlogic GXL and AXG compatibles There is now a dedicated driver for these SoCs making the old compatible obsolete. Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 40f6706862c4c99c7432cd2a99404fb70a876c55 Author: Martin Blumenstingl Date: Thu Apr 16 14:19:07 2020 +0200 phy: amlogic: meson-gxl-usb3: remove code for non-existing PHY The registers which are managed by the meson-gxl-usb3 PHY driver are actually "USB control" registers (which are "glue" registers which manage OTG detection and routing of the OTG capable port between the DWC2 peripheral-only controller and the DWC3 host-only controller). Drop the meson-gxl-usb3 PHY driver now that the dwc3-meson-g12a-usb driver supports the USB control registers on GXL and GXM SoCs (these were previously managed by the meson-gxl-usb3 PHY driver). Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 3245a5229c3fcac1fd5bd57fac8eb0853b1d2b6c Author: Martin Blumenstingl Date: Thu Apr 16 14:19:06 2020 +0200 arm64: dts: amlogic: use the new USB control driver for GXL and GXM Add the correcly architectured USB Glue node and adapt all the Amlogic GXL and GXM board to the new organization. Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit a9fc15e0fd78ac57535c2e4fcddfafd9df32e37a Author: Neil Armstrong Date: Thu Apr 16 14:19:05 2020 +0200 usb: dwc3: meson-g12a: add support for GXL and GXM SoCs In order to add support for the Amlogic GXL/GXM USB Glue, this adds the corresponding : - PHY names - clock names - USB2 PHY init and mode set - regmap setup Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit df7e374581515c10857d72c409cc8cac4021259b Author: Neil Armstrong Date: Thu Apr 16 14:19:04 2020 +0200 usb: dwc3: meson-g12a: support the GXL/GXM DWC3 host phy disconnect On the Amlogic GXL/GXM SoCs, the OTG PHY status signals are always connected to the DWC3 controller, thus crashing the controller when switching to OTG mode when port is not populated with a device/cable to Host. Amlogic added a bit to disconnect the OTG PHY status signals from the DWC3 to be used when switching the OTG PHY as Device to the DWC2 controller. The drawback is that it makes the DWC3 port state machine stall and needs a full reset of the DWC3 controller to get connect status to the port connected to the OTG PHY, but not the other one. Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 5b0ba0caaf3acc2665e58184349447eaa47bf3d5 Author: Neil Armstrong Date: Thu Apr 16 14:19:03 2020 +0200 usb: dwc3: meson-g12a: refactor usb init Refactor the USB init code patch to handle the Amlogic GXL/GXM needing to initialize the OTG port as Peripheral mode for the DWC2 IP to probe correctly. A secondary, post_init callback is added to setup the OTG PHY mode after powering up the PHYs and before probing the DWC2 and DWC3 controllers. Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 4ae2262e796653acd58100dc7a18be8f2ebce098 Author: Jason Yan Date: Fri Apr 17 15:31:37 2020 +0800 usb: gadget: udc: remove unused 'driver_desc' Fix the following gcc warning: drivers/usb/gadget/udc/gr_udc.c:51:19: warning: ‘driver_desc’ defined but not used [-Wunused-const-variable=] static const char driver_desc[] = DRIVER_DESC; ^~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Felipe Balbi commit 82b3fba2316469f28ee1e042f6fb8e4c39ec9b25 Author: Christophe JAILLET Date: Sat Apr 11 08:56:21 2020 +0200 usb: gadget: max3420: Add a missing '\n' in a log message Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 48ba02b2e2b1 ("usb: gadget: add udc driver for max3420") Signed-off-by: Christophe JAILLET Signed-off-by: Felipe Balbi commit 80c1024ba6ff851224905dd7735d939714291d63 Author: Nishad Kamdar Date: Sat Apr 4 16:07:31 2020 +0530 USB: mtu3: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to MediaTek USB3 Dual Role controller. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Reviewed-by: Chunfeng Yun Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Felipe Balbi commit a55b8dce5cb53e5b9479b7738f8ec4784aa08d38 Author: Peter Chen Date: Tue Mar 31 16:10:05 2020 +0800 usb: cdns3: change dev_info to dev_dbg for debug message During device mode initialization, lots of device information are printed to console, see below. Change them as debug message. cdns-usb3 5b130000.cdns3: Initialized ep0 support: cdns-usb3 5b130000.cdns3: Initialized ep1out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep2out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep3out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep4out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep5out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep6out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep7out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep1in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep2in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep3in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep4in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep5in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep6in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep7in support: BULK, INT ISO Reviewed-by: Roger Quadros Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 27905be24218c70f27fcc23399483f937bfefa87 Author: Peter Chen Date: Tue Mar 31 16:10:04 2020 +0800 usb: cdns3: change "cdsn3" to"cdns3" And delete cdsn3_hw_role_state_machine declare which doesn't be needed. Reviewed-by: Roger Quadros Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 160c163482974f4608c735b6a9745dd5140608df Author: Peter Chen Date: Tue Mar 31 16:10:03 2020 +0800 usb: cdns3: delete role_override In short, we have three kinds of role switches: - Based on SoC: ID and VBUS - Based on external connnctor, eg, Type-C or GPIO Connector - Based on user choices through sysfs Since HW handling and usb-role-switch handling are at different places, we do not need role_override any more, and this flag could not judge external connector case well. With role_override deleted, We use cdns3_hw_role_switch for the 1st use case, and usb-role-switch for the 2nd and 3rd cases. Reviewed-by: Roger Quadros Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit 23d6dd6c2ab6e177bc9ac19cb2bad9b8d120353c Author: Peter Chen Date: Tue Mar 31 16:10:02 2020 +0800 usb: cdns3: core: get role switch node from firmware After that, the role switch device (eg, Type-C device) could call cdns3_role_set to finish the role switch. Reviewed-by: Roger Quadros Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi commit d9feef974e0d8cb6842533c92476a1b32a41ba31 Author: Thinh Nguyen Date: Tue Mar 31 01:40:42 2020 -0700 usb: dwc3: gadget: Continue to process pending requests If there are still pending requests because no TRB was available, prepare more when started requests are completed. Introduce dwc3_gadget_ep_should_continue() to check for incomplete and pending requests to resume updating new TRBs to the controller's TRB cache. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit ac82b56bda5fe8a851b8ab18df380d74e9b7fca2 Author: Nagarjuna Kristam Date: Thu May 14 11:52:37 2020 +0530 usb: gadget: tegra-xudc: Add vbus_draw support Register vbus_draw to gadget ops and update corresponding vbus draw current to usb_phy. Signed-off-by: Nagarjuna Kristam Signed-off-by: Felipe Balbi commit c2312ff575fcaed96889d5bb5392afcc604c9442 Merge: a3975dea1696 9cb1fd0efd19 Author: Greg Kroah-Hartman Date: Mon May 25 09:11:19 2020 +0200 Merge 5.7-rc7 into staging-next We need the staging/iio fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 528b1a1ab244d9fc130f8f3899b79cea8bd760dc Author: Dirk Nehring Date: Mon May 11 10:29:53 2020 +0200 media: dvb-usb: Add Cinergy S2 PCIe Dual Port support Terratec Cinergy S2 PCIe Dual is a PCIe device with two tuners that actually contains two USB devices. The devices are visible in the lsusb printout. Bus 004 Device 002: ID 153b:1182 TerraTec Electronic GmbH Cinergy S2 PCIe Dual Port 2 Bus 003 Device 002: ID 153b:1181 TerraTec Electronic GmbH Cinergy S2 PCIe Dual Port 1 The devices use the Montage M88DS3000/M88TS2022 demod/tuner. Signed-off-by: Dirk Nehring Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 9f984cacf4f4d53fd8a3f44d7f13528b81c1f6a8 Author: Brad Love Date: Thu May 14 18:40:43 2020 +0200 media: dvbdev: Fix tuner->demod media controller link Fixes bug exposed by: [a3fbc2e6bb0: media: mc-entity.c: use WARN_ON, validate link pads] The dvbdev incorrectly requests a tuner sink pad to connect to a demux sink pad. The media controller failure percolates back and the dvb device creation fails. Fix this by requesting a tuner source pad. Instead of forcing that pad to be index zero, check if a negative integer error is returned. A note is added that first source pad found is chosen. Affected bridges cx231xx and em28xx printed the below warning[s] when a variety of media controller dvb enabled devices were connected. The warning returns an error causing all affected devices to fail DVB device creation. [ 253.138332] ------------[ cut here ]------------ [ 253.138339] WARNING: CPU: 0 PID: 1550 at drivers/media/mc/mc-entity.c:669 media_create_pad_link+0x1e0/0x200 [mc] [ 253.138339] Modules linked in: si2168 em28xx_dvb(+) em28xx si2157 lgdt3306a cx231xx_dvb dvb_core cx231xx_alsa cx25840 cx231xx tveeprom cx2341x i2c_mux videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc ir_rc5_decoder rc_hauppauge mceusb rc_core eda c_mce_amd kvm nls_iso8859_1 crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper efi_pstore wmi_bmof k10temp asix usbnet mii nouveau snd_hda_codec_realtek snd_hda_codec_generic input_leds ledtrig_audio snd_hda_codec_hdmi mxm_wmi snd_hda_in tel video snd_intel_dspcfg ttm snd_hda_codec drm_kms_helper snd_hda_core drm snd_hwdep snd_seq_midi snd_seq_midi_event i2c_algo_bit snd_pcm snd_rawmidi fb_sys_fops snd_seq syscopyarea sysfillrect snd_seq_device sysimgblt snd_timer snd soundcore ccp mac_hid sch_fq_codel parport_p c ppdev lp parport ip_tables x_tables autofs4 vfio_pci irqbypass vfio_virqfd vfio_iommu_type1 vfio hid_generic usbhid hid i2c_piix4 ahci libahci wmi gpio_amdpt [ 253.138370] gpio_generic [ 253.138372] CPU: 0 PID: 1550 Comm: modprobe Tainted: G W 5.7.0-rc2+ #181 [ 253.138373] Hardware name: MSI MS-7A39/B350M GAMING PRO (MS-7A39), BIOS 2.G0 04/27/2018 [ 253.138376] RIP: 0010:media_create_pad_link+0x1e0/0x200 [mc] [ 253.138378] Code: 26 fd ff ff 44 8b 4d d0 eb d9 0f 0b 41 b9 ea ff ff ff 44 89 c8 c3 0f 0b 41 b9 ea ff ff ff eb f2 0f 0b 41 b9 ea ff ff ff eb e8 <0f> 0b 41 b9 ea ff ff ff eb af 0f 0b 41 b9 ea ff ff ff eb a5 66 90 [ 253.138379] RSP: 0018:ffffb9ecc0ee7a78 EFLAGS: 00010246 [ 253.138380] RAX: ffff943f706c99d8 RBX: 0000000000000000 RCX: 0000000000000000 [ 253.138381] RDX: ffff943f613e0180 RSI: 0000000000000000 RDI: ffff943f706c9958 [ 253.138381] RBP: ffffb9ecc0ee7ab0 R08: 0000000000000001 R09: ffff943f613e0180 [ 253.138382] R10: ffff943f613e0180 R11: ffff943f706c9400 R12: 0000000000000000 [ 253.138383] R13: 0000000000000001 R14: ffff943f706c9958 R15: 0000000000000001 [ 253.138384] FS: 00007f3cd29ba540(0000) GS:ffff943f8ec00000(0000) knlGS:0000000000000000 [ 253.138385] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 253.138385] CR2: 000055f7de0ca830 CR3: 00000003dd208000 CR4: 00000000003406f0 [ 253.138386] Call Trace: [ 253.138392] media_create_pad_links+0x104/0x1b0 [mc] [ 253.138397] dvb_create_media_graph+0x350/0x5f0 [dvb_core] [ 253.138402] em28xx_dvb_init+0x5ea/0x2600 [em28xx_dvb] [ 253.138408] em28xx_register_extension+0x63/0xc0 [em28xx] [ 253.138410] ? 0xffffffffc039c000 [ 253.138412] em28xx_dvb_register+0x15/0x1000 [em28xx_dvb] [ 253.138416] do_one_initcall+0x71/0x250 [ 253.138418] ? do_init_module+0x27/0x22e [ 253.138421] ? _cond_resched+0x1a/0x50 [ 253.138423] ? kmem_cache_alloc_trace+0x1ec/0x270 [ 253.138425] ? __vunmap+0x1e3/0x240 [ 253.138427] do_init_module+0x5f/0x22e [ 253.138430] load_module+0x2525/0x2d40 [ 253.138436] __do_sys_finit_module+0xe5/0x120 [ 253.138438] ? __do_sys_finit_module+0xe5/0x120 [ 253.138442] __x64_sys_finit_module+0x1a/0x20 [ 253.138443] do_syscall_64+0x57/0x1b0 [ 253.138445] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 253.138446] RIP: 0033:0x7f3cd24dc839 [ 253.138448] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48 [ 253.138449] RSP: 002b:00007ffe4fc514d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 253.138450] RAX: ffffffffffffffda RBX: 000055a9237f63f0 RCX: 00007f3cd24dc839 [ 253.138451] RDX: 0000000000000000 RSI: 000055a922c3ad2e RDI: 0000000000000000 [ 253.138451] RBP: 000055a922c3ad2e R08: 0000000000000000 R09: 0000000000000000 [ 253.138452] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 253.138453] R13: 000055a9237f5550 R14: 0000000000040000 R15: 000055a9237f63f0 [ 253.138456] ---[ end trace a60f19c54aa96ec4 ]--- [ 234.915628] ------------[ cut here ]------------ [ 234.915640] WARNING: CPU: 0 PID: 1502 at drivers/media/mc/mc-entity.c:669 media_create_pad_link+0x1e0/0x200 [mc] [ 234.915641] Modules linked in: si2157 lgdt3306a cx231xx_dvb(+) dvb_core cx231xx_alsa cx25840 cx231xx tveeprom cx2341x i2c_mux videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc ir_rc5_decoder rc_hauppauge mceusb rc_core edac_mce_amd kvm nls_iso8859 _1 crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper efi_pstore wmi_bmof k10temp asix usbnet mii nouveau snd_hda_codec_realtek snd_hda_codec_generic input_leds ledtrig_audio snd_hda_codec_hdmi mxm_wmi snd_hda_intel video snd_intel_dspcf g ttm snd_hda_codec drm_kms_helper snd_hda_core drm snd_hwdep snd_seq_midi snd_seq_midi_event i2c_algo_bit snd_pcm snd_rawmidi fb_sys_fops snd_seq syscopyarea sysfillrect snd_seq_device sysimgblt snd_timer snd soundcore ccp mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tab les x_tables autofs4 vfio_pci irqbypass vfio_virqfd vfio_iommu_type1 vfio hid_generic usbhid hid i2c_piix4 ahci libahci wmi gpio_amdpt gpio_generic [ 234.915700] CPU: 0 PID: 1502 Comm: modprobe Not tainted 5.7.0-rc2+ #181 [ 234.915702] Hardware name: MSI MS-7A39/B350M GAMING PRO (MS-7A39), BIOS 2.G0 04/27/2018 [ 234.915709] RIP: 0010:media_create_pad_link+0x1e0/0x200 [mc] [ 234.915712] Code: 26 fd ff ff 44 8b 4d d0 eb d9 0f 0b 41 b9 ea ff ff ff 44 89 c8 c3 0f 0b 41 b9 ea ff ff ff eb f2 0f 0b 41 b9 ea ff ff ff eb e8 <0f> 0b 41 b9 ea ff ff ff eb af 0f 0b 41 b9 ea ff ff ff eb a5 66 90 [ 234.915714] RSP: 0018:ffffb9ecc1b6fa50 EFLAGS: 00010246 [ 234.915717] RAX: ffff943f8c94a9d8 RBX: 0000000000000000 RCX: 0000000000000000 [ 234.915719] RDX: ffff943f613e0900 RSI: 0000000000000000 RDI: ffff943f8c94a958 [ 234.915721] RBP: ffffb9ecc1b6fa88 R08: 0000000000000001 R09: ffff943f613e0900 [ 234.915723] R10: ffff943f613e0900 R11: ffff943f6b590c00 R12: 0000000000000000 [ 234.915724] R13: 0000000000000001 R14: ffff943f8c94a958 R15: 0000000000000001 [ 234.915727] FS: 00007f4ca3646540(0000) GS:ffff943f8ec00000(0000) knlGS:0000000000000000 [ 234.915729] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 234.915731] CR2: 00007fff7a53ba18 CR3: 00000003da614000 CR4: 00000000003406f0 [ 234.915733] Call Trace: [ 234.915745] media_create_pad_links+0x104/0x1b0 [mc] [ 234.915756] dvb_create_media_graph+0x350/0x5f0 [dvb_core] [ 234.915766] dvb_init.part.4+0x691/0x1360 [cx231xx_dvb] [ 234.915780] dvb_init+0x1a/0x20 [cx231xx_dvb] [ 234.915787] cx231xx_register_extension+0x71/0xa0 [cx231xx] [ 234.915791] ? 0xffffffffc042f000 [ 234.915796] cx231xx_dvb_register+0x15/0x1000 [cx231xx_dvb] [ 234.915802] do_one_initcall+0x71/0x250 [ 234.915807] ? do_init_module+0x27/0x22e [ 234.915811] ? _cond_resched+0x1a/0x50 [ 234.915816] ? kmem_cache_alloc_trace+0x1ec/0x270 [ 234.915820] ? __vunmap+0x1e3/0x240 [ 234.915826] do_init_module+0x5f/0x22e [ 234.915831] load_module+0x2525/0x2d40 [ 234.915848] __do_sys_finit_module+0xe5/0x120 [ 234.915850] ? __do_sys_finit_module+0xe5/0x120 [ 234.915862] __x64_sys_finit_module+0x1a/0x20 [ 234.915865] do_syscall_64+0x57/0x1b0 [ 234.915870] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 234.915872] RIP: 0033:0x7f4ca3168839 [ 234.915876] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48 [ 234.915878] RSP: 002b:00007ffcea3db3b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 234.915881] RAX: ffffffffffffffda RBX: 000055af22c29340 RCX: 00007f4ca3168839 [ 234.915882] RDX: 0000000000000000 RSI: 000055af22c38390 RDI: 0000000000000001 [ 234.915884] RBP: 000055af22c38390 R08: 0000000000000000 R09: 0000000000000000 [ 234.915885] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 [ 234.915887] R13: 000055af22c29060 R14: 0000000000040000 R15: 0000000000000000 [ 234.915896] ---[ end trace a60f19c54aa96ec3 ]--- Signed-off-by: Brad Love Reviewed-by: Laurent Pinchart Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 072cb8b628d312f5785ffdf324286a0519aed910 Author: Thomas Gleixner Date: Fri May 8 21:26:58 2020 +0200 watchdog: m54xx: Add missing include A recent cleanup removed the mm.h include from uaccess_no.h in m68k. This breaks the build of the m54xx watchdog driver: drivers/watchdog/m54xx_wdt.c:49:9: error: implicit declaration of function '__raw_readl' Due to magic include chains the inclusion of mm.h in uaccess_no.h pulled in io.h. Include 'linux/io.h' explicitely to fix this. Fixes: 9e860351550b ("m68knommu: Remove mm.h include from uaccess_no.h") Reported-by: kbuild test robot Signed-off-by: Thomas Gleixner Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: linux-watchdog@vger.kernel.org Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/87blmyjjtf.fsf@nanos.tec.linutronix.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ff1ee6fb276c90b1b610978736693abe24f0a897 Author: Lad Prabhakar Date: Fri May 15 16:08:56 2020 +0100 dt-bindings: watchdog: renesas,wdt: Document r8a7742 support RZ/G1H (R8A7742) watchdog implementation is compatible with R-Car Gen2, therefore add relevant documentation. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1589555337-5498-17-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a22573740d93f31c30b57a40b334a1ec6b789f67 Author: Dinghao Liu Date: Thu May 21 16:01:41 2020 +0800 watchdog: Fix runtime PM imbalance on error When watchdog_register_device() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200521080141.24373-1-dinghao.liu@zju.edu.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5e31896a33c5ad5ad5c533e6bdff6510d136b1ef Author: Jason Yan Date: Tue Apr 28 14:33:33 2020 +0800 watchdog: riowd: remove unneeded semicolon Fix the following coccicheck warning: drivers/watchdog/riowd.c:144:2-3: Unneeded semicolon Signed-off-by: Jason Yan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200428063333.2743-1-yanaijie@huawei.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 72a9e7fea5866fc471fda78f05f166595c8c6ba6 Author: Julius Werner Date: Tue May 5 13:13:31 2020 +1000 watchdog: Add new arm_smc_wdt watchdog driver This patch adds a watchdog driver that can be used on ARM systems with the appropriate watchdog implemented in Secure Monitor firmware. The driver communicates with firmware via a Secure Monitor Call. This may be useful for platforms using TrustZone that want the Secure Monitor firmware to have the final control over the watchdog. This is implemented on mt8173 chromebook devices oak, elm and hana in arm trusted firmware file plat/mediatek/mt8173/drivers/wdt/wdt.c. Signed-off-by: Julius Werner Signed-off-by: Evan Benn Reviewed-by: Julius Werner Tested-by: Xingyu Chen Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200505131242.v6.2.Ia92bb4d4ce84bcefeba1d00aaa1c1e919b6164ef@changeid Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5c24a28b4eb842ad1256496be6ae01bab15f1dcb Author: Evan Benn Date: Tue May 5 13:13:30 2020 +1000 dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog This watchdog can be used on ARM systems with a Secure Monitor firmware to forward watchdog operations to firmware via a Secure Monitor Call. Signed-off-by: Evan Benn Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200505131242.v6.1.Id96574f1f52479d7a2f3b866b8a0552ab8c03d7f@changeid Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 62c35b44f294d35f3e5d0e76c1cde75ab189ef28 Author: Wolfram Sang Date: Sat May 2 16:26:53 2020 +0200 watchdog: imx2_wdt: update contact email The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: Wolfram Sang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200502142653.19144-1-wsa@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b30c1a464c29baf646a5726d90ea3537e775ac85 Author: Arnd Bergmann Date: Tue Apr 28 23:29:11 2020 +0200 watchdog: iTCO: fix link error When the MFD driver is a loadable module, the watchdog driver fails to get linked into the kernel: drivers/watchdog/iTCO_wdt.o: In function `update_no_reboot_bit_pmc': iTCO_wdt.c:(.text+0x54f): undefined reference to `intel_pmc_gcr_update' The code is written to support operation without the MFD driver, so add a Kconfig dependency that allows this, while disallowing the watchdog to be built-in when the MFD driver is a module. Fixes: 25f1ca31e230 ("platform/x86: intel_pmc_ipc: Convert to MFD") Signed-off-by: Arnd Bergmann Acked-by: Guenter Roeck Reviewed-by: Mika Westerberg Link: https://lore.kernel.org/r/20200428212959.2993304-1-arnd@arndb.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a0948ddba65f4f6d3cfb5e2b84685485d0452966 Author: Stefan Riedmueller Date: Fri Apr 3 15:07:28 2020 +0200 watchdog: da9062: No need to ping manually before setting timeout There is actually no need to ping the watchdog before disabling it during timeout change. Disabling the watchdog already takes care of resetting the counter. This fixes an issue during boot when the userspace watchdog handler takes over and the watchdog is already running. Opening the watchdog in this case leads to the first ping and directly after that without the required heartbeat delay a second ping issued by the set_timeout call. Due to the missing delay this resulted in a reset. Signed-off-by: Stefan Riedmueller Reviewed-by: Guenter Roeck Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20200403130728.39260-3-s.riedmueller@phytec.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c4718308d77782bb438287f67a45ed9e9df712cf Author: Stefan Riedmueller Date: Fri Apr 3 15:07:27 2020 +0200 watchdog: da9063: Make use of pre-configured timeout during probe The watchdog might already be running during boot with a timeout set by e.g. the bootloader. Make use of this pre-configured timeout instead of falling back to the default timeout if no device tree value is given. Signed-off-by: Stefan Riedmueller Reviewed-by: Adam Thomson Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200403130728.39260-2-s.riedmueller@phytec.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e8799ce85992defa341613c5c6f083fa412266f3 Author: Stefan Riedmueller Date: Fri Apr 3 15:07:26 2020 +0200 watchdog: da9062: Initialize timeout during probe During probe try to set the timeout from device tree and fall back to either the pre-configured timeout set by e.g. the bootloader in case the watchdog is already running or the default value. If the watchdog is already running make sure to update the timeout and tell the framework about the running state to make sure the watchdog is handled correctly until user space takes over. Updating the timeout also removes the need for an additional manual ping so we can remove that as well. Signed-off-by: Stefan Riedmueller Reviewed-by: Adam Thomson Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200403130728.39260-1-s.riedmueller@phytec.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f249eef9e66e46065a42a0c164ecc3a40f52102a Author: Bumsik Kim Date: Fri Apr 3 12:15:07 2020 +0900 watchdog: clarify that stop() is optional The commit d0684c8a9354 ("watchdog: Make stop function optional") made stop function not mandatory, but the comments and the doc weren't reflected. Fix it to clarify. Signed-off-by: Bumsik Kim Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200403031507.63487-1-k.bumsik@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e56d48e92b1017b6a8dbe64923a889283733fd96 Author: Fabio Estevam Date: Sun Apr 12 20:01:22 2020 -0300 watchdog: imx_sc_wdt: Fix reboot on crash Currently when running the samples/watchdog/watchdog-simple.c application and forcing a kernel crash by doing: # ./watchdog-simple & # echo c > /proc/sysrq-trigger The system does not reboot as expected. Fix it by calling imx_sc_wdt_set_timeout() to configure the i.MX8QXP watchdog with a proper timeout. Cc: Fixes: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support") Reported-by: Breno Lima Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck Tested-by: Breno Lima Link: https://lore.kernel.org/r/20200412230122.5601-1-festevam@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 0f0dbd9b36bbca6ffc0852d7859edc0ac8f11727 Author: Shyam Saini Date: Tue Apr 7 03:20:08 2020 +0530 watchdog: ts72xx_wdt: fix build error If TS72XX_WATCHDOG is y and WATCHDOG_CORE is not enabled or its m, then building fails: drivers/watchdog/ts72xx_wdt.o: in function `ts72xx_wdt_probe': ts72xx_wdt.c:(.text+0x14c): undefined reference to \ `watchdog_init_timeout' ts72xx_wdt.c:(.text+0x15c): undefined reference to \ `devm_watchdog_register_device' Select WATCHDOG_CORE to fix this. Signed-off-by: Shyam Saini Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200406215008.30468-1-shyam.saini@savoirfairelinux.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f7d8f3f092d001f8d91552d2697643e727694942 Merge: 2cd38fd15e4e 9cb1fd0efd19 Author: Greg Kroah-Hartman Date: Mon May 25 08:55:12 2020 +0200 Merge 5.7-rc7 into driver-core-next We need the driver core fixes in here as well Signed-off-by: Greg Kroah-Hartman commit 18cbc336ec1a640ef4e62107d627bf1cf26ac6b9 Merge: 709b41b56a16 8ff5f4fd40df Author: Greg Kroah-Hartman Date: Mon May 25 08:49:43 2020 +0200 Merge tag 'misc-habanalabs-next-2020-05-25' of git://people.freedesktop.org/~gabbayo/linux into char-misc-next Oded writes: This tag contains the following changes for kernel 5.8: - Improve MMU cache invalidation code and handle case where the invalidation doesn't finish in a reasonable time. - Remove the option to perform soft-reset to GAUDI. Soft-reset is where the driver only resets the compute and DMA engines of the ASIC. This is not relevant to GAUDI as we must also reset the NIC ports. And when we reset the NIC ports, we must also reset other stuff so we prefer to just do hard-reset (where we reset the entire ASIC except for PCIe). - Fail the hard-reset procedure in case we still have user processes which have active file-descriptors on a device. Doing hard-reset in that case can result in a kernel panic because of gen_pool checks - Don't initialize the default wait callback of dma_buf with the default wait function as that's the default... * tag 'misc-habanalabs-next-2020-05-25' of git://people.freedesktop.org/~gabbayo/linux: habanalabs: handle MMU cache invalidation timeout habanalabs: don't allow hard reset with open processes habanalabs: GAUDI does not support soft-reset habanalabs: add print for soft reset due to event habanalabs: improve MMU cache invalidation code habanalabs: don't set default fence_ops->wait commit e0b2db351bc708037571deb3fc82c7d9043b4ea8 Author: Takashi Sakamoto Date: Sat May 23 16:17:33 2020 +0900 ALSA: firewire-motu: add support for MOTU UltraLite-mk3 (FireWire only model) UltraLite-mk3 was shipped 2008 by MOTU. This model has two lineups; FireWire-only and FireWire/USB2.0 Hybrid model. Additionally, the latter has two variants in respect of the type of IEEE 1394 connector; alpha and beta connector. This commit adds support for the FireWire-only model, which is already discontinued. $ python3 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 0410353a bus_info_length 4, crc_length 16, crc 13626 404 31333934 bus_name "1394" 408 20ff7000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 7 (256) 40c 0001f200 company_id 0001f2 | 410 000902c7 device_id 00000902c7 | EUI-64 0001f200000902c7 root directory ----------------------------------------------------------------- 414 0004ef04 directory_length 4, crc 61188 418 030001f2 vendor 41c 0c0083c0 node capabilities per IEEE 1394 420 d1000002 --> unit directory at 428 424 8d000005 --> eui-64 leaf at 438 unit directory at 428 ----------------------------------------------------------------- 428 00035556 directory_length 3, crc 21846 42c 120001f2 specifier id 430 13000019 version 434 17100800 model eui-64 leaf at 438 ----------------------------------------------------------------- 438 0002f3c5 leaf_length 2, crc 62405 43c 0001f200 company_id 0001f2 | 440 000902c7 device_id 00000902c7 | EUI-64 0001f200000902c7 Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200523071733.170129-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 8ff5f4fd40df9525675ea0e512da4cec65d646eb Author: Omer Shpigelman Date: Sun May 24 23:06:59 2020 +0300 habanalabs: handle MMU cache invalidation timeout MMU cache invalidation timeout indicates that the device is unstable and therefore unusable. Hence in such case do hard reset and return an error to the user if was called from ioctl. In addition, change the print to error level and rephrase its text. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 36fafe87edd636292a4ed6a3af9608f2c7d0d0fb Author: Omer Shpigelman Date: Mon May 18 22:27:46 2020 +0300 habanalabs: don't allow hard reset with open processes When the MMU is heavily used by the engines, unmapping might take a lot of time due to a full MMU cache invalidation done as part of the unmap flow. Hence we might not be able to kill all open processes before going to hard reset the device, as it involves unmapping of all user memory. In case of a failure in killing all open processes, we should stop the hard reset flow as it might lead to a kernel crash - one thread (killing of a process) is updating MMU structures that other thread (hard reset) is freeing. Stopping a hard reset flow leaves the device as nonoperational and the user can then initiate a hard reset via sysfs to reinitialize the device. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 66446820df1864bc371ece679c11152f5f22362c Author: Oded Gabbay Date: Mon May 18 16:48:01 2020 +0300 habanalabs: GAUDI does not support soft-reset GAUDI does not support soft-reset as it leaves the NIC ports in an awkward state, where their QMANs were reset but the NIC itself is still working. In addition, there is not much sense in doing soft-reset when training is done on multiple GAUDIs. Signed-off-by: Oded Gabbay Reviewed-by: Tomer Tayar commit d798507988da3d40032c57cb87244450842e4be1 Author: Omer Shpigelman Date: Sun May 17 23:01:22 2020 +0300 habanalabs: add print for soft reset due to event Print the event name that caused the soft reset. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 42d0b0b95f9822fc02440c0ae5f9192c0ebe54bf Author: Omer Shpigelman Date: Sun May 17 17:35:39 2020 +0300 habanalabs: improve MMU cache invalidation code A new sequence is introduced to invalidate the MMU cache in order to avoid timeouts. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ed65bfd9fd86dec3772570b0320ca85b9fb69f2e Author: Daniel Vetter Date: Mon May 11 11:11:42 2020 +0200 habanalabs: don't set default fence_ops->wait It's the default. Also so much for "we're not going to tell the graphics people how to review their code", dma_fence is a pretty core piece of gpu driver infrastructure. And it's very much uapi relevant, including piles of corresponding userspace protocols and libraries for how to pass these around. Would be great if habanalabs would not use this (from a quick look it's not needed at all), since open source the userspace and playing by the usual rules isn't on the table. If that's not possible (because it's actually using the uapi part of dma_fence to interact with gpu drivers) then we have exactly what everyone promised we'd want to avoid. Signed-off-by: Daniel Vetter Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2ebb17717550607bcd85fb8cf7d24ac870e9d762 Author: Mel Gorman Date: Sun May 24 21:29:56 2020 +0100 sched/core: Offload wakee task activation if it the wakee is descheduling The previous commit: c6e7bd7afaeb: ("sched/core: Optimize ttwu() spinning on p->on_cpu") avoids spinning on p->on_rq when the task is descheduling, but only if the wakee is on a CPU that does not share cache with the waker. This patch offloads the activation of the wakee to the CPU that is about to go idle if the task is the only one on the runqueue. This potentially allows the waker task to continue making progress when the wakeup is not strictly synchronous. This is very obvious with netperf UDP_STREAM running on localhost. The waker is sending packets as quickly as possible without waiting for any reply. It frequently wakes the server for the processing of packets and when netserver is using local memory, it quickly completes the processing and goes back to idle. The waker often observes that netserver is on_rq and spins excessively leading to a drop in throughput. This is a comparison of 5.7-rc6 against "sched: Optimize ttwu() spinning on p->on_cpu" and against this patch labeled vanilla, optttwu-v1r1 and localwakelist-v1r2 respectively. 5.7.0-rc6 5.7.0-rc6 5.7.0-rc6 vanilla optttwu-v1r1 localwakelist-v1r2 Hmean send-64 251.49 ( 0.00%) 258.05 * 2.61%* 305.59 * 21.51%* Hmean send-128 497.86 ( 0.00%) 519.89 * 4.43%* 600.25 * 20.57%* Hmean send-256 944.90 ( 0.00%) 997.45 * 5.56%* 1140.19 * 20.67%* Hmean send-1024 3779.03 ( 0.00%) 3859.18 * 2.12%* 4518.19 * 19.56%* Hmean send-2048 7030.81 ( 0.00%) 7315.99 * 4.06%* 8683.01 * 23.50%* Hmean send-3312 10847.44 ( 0.00%) 11149.43 * 2.78%* 12896.71 * 18.89%* Hmean send-4096 13436.19 ( 0.00%) 13614.09 ( 1.32%) 15041.09 * 11.94%* Hmean send-8192 22624.49 ( 0.00%) 23265.32 * 2.83%* 24534.96 * 8.44%* Hmean send-16384 34441.87 ( 0.00%) 36457.15 * 5.85%* 35986.21 * 4.48%* Note that this benefit is not universal to all wakeups, it only applies to the case where the waker often spins on p->on_rq. The impact can be seen from a "perf sched latency" report generated from a single iteration of one packet size: ----------------------------------------------------------------------------------------------------------------- Task | Runtime ms | Switches | Average delay ms | Maximum delay ms | Maximum delay at | ----------------------------------------------------------------------------------------------------------------- vanilla netperf:4337 | 21709.193 ms | 2932 | avg: 0.002 ms | max: 0.041 ms | max at: 112.154512 s netserver:4338 | 14629.459 ms | 5146990 | avg: 0.001 ms | max: 1615.864 ms | max at: 140.134496 s localwakelist-v1r2 netperf:4339 | 29789.717 ms | 2460 | avg: 0.002 ms | max: 0.059 ms | max at: 138.205389 s netserver:4340 | 18858.767 ms | 7279005 | avg: 0.001 ms | max: 0.362 ms | max at: 135.709683 s ----------------------------------------------------------------------------------------------------------------- Note that the average wakeup delay is quite small on both the vanilla kernel and with the two patches applied. However, there are significant outliers with the vanilla kernel with the maximum one measured as 1615 milliseconds with a vanilla kernel but never worse than 0.362 ms with both patches applied and a much higher rate of context switching. Similarly a separate profile of cycles showed that 2.83% of all cycles were spent in try_to_wake_up() with almost half of the cycles spent on spinning on p->on_rq. With the two patches, the percentage of cycles spent in try_to_wake_up() drops to 1.13% Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Jirka Hladky Cc: Vincent Guittot Cc: valentin.schneider@arm.com Cc: Hillf Danton Cc: Rik van Riel Link: https://lore.kernel.org/r/20200524202956.27665-3-mgorman@techsingularity.net commit c6e7bd7afaeb3af55ffac122828035f1c01d1d7b Author: Peter Zijlstra Date: Sun May 24 21:29:55 2020 +0100 sched/core: Optimize ttwu() spinning on p->on_cpu Both Rik and Mel reported seeing ttwu() spend significant time on: smp_cond_load_acquire(&p->on_cpu, !VAL); Attempt to avoid this by queueing the wakeup on the CPU that owns the p->on_cpu value. This will then allow the ttwu() to complete without further waiting. Since we run schedule() with interrupts disabled, the IPI is guaranteed to happen after p->on_cpu is cleared, this is what makes it safe to queue early. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Cc: Jirka Hladky Cc: Vincent Guittot Cc: valentin.schneider@arm.com Cc: Hillf Danton Cc: Rik van Riel Link: https://lore.kernel.org/r/20200524202956.27665-2-mgorman@techsingularity.net commit 6d7c865c2714b122a940774990cfb1d87b57294a Author: Jaegeuk Kim Date: Mon May 18 18:00:33 2020 -0700 f2fs: avoid inifinite loop to wait for flushing node pages at cp_error Shutdown test is somtimes hung, since it keeps trying to flush dirty node pages in an inifinite loop. Let's drop dirty pages at umount in that case. Signed-off-by: Jaegeuk Kim commit 06ec313eea4f7dcda209b7136618b802c5b30ef8 Author: Ido Schimmel Date: Mon May 25 00:38:56 2020 +0300 vxlan: Do not assume RTNL is held in vxlan_fdb_info() vxlan_fdb_info() is not always called with RTNL held or from an RCU read-side critical section. For example, in the following call path: vxlan_cleanup() vxlan_fdb_destroy() vxlan_fdb_notify() __vxlan_fdb_notify() vxlan_fdb_info() The use of rtnl_dereference() can therefore result in the following splat [1]. Fix this by dereferencing the nexthop under RCU read-side critical section. [1] [May24 22:56] ============================= [ +0.004676] WARNING: suspicious RCU usage [ +0.004614] 5.7.0-rc5-custom-16219-g201392003491 #2772 Not tainted [ +0.007116] ----------------------------- [ +0.004657] drivers/net/vxlan.c:276 suspicious rcu_dereference_check() usage! [ +0.008164] other info that might help us debug this: [ +0.009126] rcu_scheduler_active = 2, debug_locks = 1 [ +0.007504] 5 locks held by bash/6892: [ +0.004392] #0: ffff8881d47e3410 (&sig->cred_guard_mutex){+.+.}-{3:3}, at: __do_execve_file.isra.27+0x392/0x23c0 [ +0.011795] #1: ffff8881d47e34b0 (&sig->exec_update_mutex){+.+.}-{3:3}, at: flush_old_exec+0x510/0x2030 [ +0.010947] #2: ffff8881a141b0b0 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x9c0/0x2590 [ +0.010585] #3: ffff888230009d50 ((&vxlan->age_timer)){+.-.}-{0:0}, at: call_timer_fn+0xe8/0x800 [ +0.010192] #4: ffff888183729bc8 (&vxlan->hash_lock[h]){+.-.}-{2:2}, at: vxlan_cleanup+0x133/0x4a0 [ +0.010382] stack backtrace: [ +0.005103] CPU: 1 PID: 6892 Comm: bash Not tainted 5.7.0-rc5-custom-16219-g201392003491 #2772 [ +0.009675] Hardware name: Mellanox Technologies Ltd. MSN2100-CB2FO/SA001017, BIOS 5.6.5 06/07/2016 [ +0.010155] Call Trace: [ +0.002775] [ +0.002313] dump_stack+0xfd/0x178 [ +0.003895] lockdep_rcu_suspicious+0x14a/0x153 [ +0.005157] vxlan_fdb_info+0xe39/0x12a0 [ +0.004775] __vxlan_fdb_notify+0xb8/0x160 [ +0.004672] vxlan_fdb_notify+0x8e/0xe0 [ +0.004370] vxlan_fdb_destroy+0x117/0x330 [ +0.004662] vxlan_cleanup+0x1aa/0x4a0 [ +0.004329] call_timer_fn+0x1c4/0x800 [ +0.004357] run_timer_softirq+0x129d/0x17e0 [ +0.004762] __do_softirq+0x24c/0xaef [ +0.004232] irq_exit+0x167/0x190 [ +0.003767] smp_apic_timer_interrupt+0x1dd/0x6a0 [ +0.005340] apic_timer_interrupt+0xf/0x20 [ +0.004620] Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Signed-off-by: Ido Schimmel Reported-by: Amit Cohen Acked-by: Roopa Prabhu Signed-off-by: David S. Miller commit f36221e86694e2506ca21966a4b95ebf9e534d4a Merge: 13209a8f7304 154388e11255 Author: David S. Miller Date: Sun May 24 19:32:23 2020 -0700 Merge branch 'mlxsw-Various-trap-changes-part-1' Ido Schimmel says: ==================== mlxsw: Various trap changes - part 1 This patch set contains various changes in mlxsw trap configuration. Another set will perform similar changes before exposing control traps (e.g., IGMP query, ARP request) via devlink-trap. Tested with existing devlink-trap selftests. Please see individual patches for a detailed changelog. ==================== Signed-off-by: David S. Miller commit 154388e11255dbbcf68906fe8058fe72af346634 Author: Ido Schimmel Date: Mon May 25 00:51:07 2020 +0300 mlxsw: spectrum: Fix spelling mistake in trap's name Fix incorrect spelling of "advertisement". Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit ce3c3bf0bfad4bb8652f3c3f5770d38a10ce2894 Author: Ido Schimmel Date: Mon May 25 00:51:06 2020 +0300 mlxsw: spectrum: Use dedicated trap group for sampled packets The rate with which packets are sampled is determined by user space, so there is no need to associate such packets with a policer. Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b33f5d9fb71a65dde1477417b0e11205a2d21adc Author: Ido Schimmel Date: Mon May 25 00:51:05 2020 +0300 mlxsw: spectrum: Use same trap group for IPv6 ND and ARP packets Both packet types are needed for the same reason (neighbour discovery), so associate them with the same trap group. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 32446438cc5bb09aa5ca43c18b0d13dc88569850 Author: Ido Schimmel Date: Mon May 25 00:51:04 2020 +0300 mlxsw: spectrum: Rename ARP trap group The ARP trap group will be used for IPv6 ND traps in the next patch, so rename it to "NEIGH_DISCOVERY" which is more appropriate. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit d88f8cc158b9c3812172431a3761e86b92f2d53d Author: Ido Schimmel Date: Mon May 25 00:51:03 2020 +0300 mlxsw: spectrum_trap: Remove unnecessary field Now that traffic class (TC) and priority are set to the same value, there is no need to store both. Remove the first. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 5047d819f5b1ad244675ba69b36af1ac44c76e34 Author: Ido Schimmel Date: Mon May 25 00:51:02 2020 +0300 mlxsw: spectrum: Align TC and trap priority The traffic class (TC) attribute of packet traps determines through which TC a packet trap will be scheduled through the CPU port. The priority attribute determines which trap will be triggered in case several packet traps match a packet. We try to configure these attributes to the same value for all packet traps as there is little reason not to. Some packet traps did not use the same value, so rectify that now. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit e0d848477a68ab940caf8a880d3181b5ef9e4e0e Author: Ido Schimmel Date: Mon May 25 00:51:01 2020 +0300 mlxsw: spectrum_buffers: Assign non-zero quotas to TC 0 of the CPU port As explained in commit 9ffcc3725f09 ("mlxsw: spectrum: Allow packets to be trapped from any PG"), incoming packets can be admitted to the shared buffer and forwarded / trapped, if: (Ingress{Port}.Usage < Thres && Ingress{Port,PG}.Usage < Thres && Egress{Port}.Usage < Thres && Egress{Port,TC}.Usage < Thres) || (Ingress{Port}.Usage < Min || Ingress{Port,PG} < Min || Egress{Port}.Usage < Min || Egress{Port,TC}.Usage < Min) Trapped packets are scheduled to transmission through the CPU port. Currently, the minimum and maximum quotas of traffic class (TC) 0 of the CPU port are 0, which means it is not usable. Assign non-zero quotas to TC 0 of the CPU port, so that it could be utilized by subsequent patches. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 938e6d0b7672317e54836610d9b9535dda19e90b Author: Ido Schimmel Date: Mon May 25 00:51:00 2020 +0300 mlxsw: spectrum: Change default rate and priority of DHCP packets Reduce the default acceptable rate of DHCP packets to 128 packets per second and reduce their priority. This is reasonable given the Spectrum ASICs are limited to 128 ports at the moment. These are only the default values. Users will be able to modify them via devlink-trap. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 0ecb947412d7e95128a007f791b020a37ce5e9be Author: Ido Schimmel Date: Mon May 25 00:50:59 2020 +0300 mlxsw: spectrum: Trap IPv4 DHCP packets in router Currently, IPv4 DHCP packets are trapped during L2 forwarding, which means that packets might be trapped unnecessarily. Instead, only trap the DHCP packets that reach the router. Either because they were flooded to the router port or forwarded to it by the FDB. This is consistent with the corresponding IPv6 trap. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 99129069b7123c22ca14529972946216757077ee Author: Ido Schimmel Date: Mon May 25 00:50:58 2020 +0300 mlxsw: spectrum: Use same trap group for MLD and IGMP packets Both packet types are needed for the same reason (multicast snooping), so associate them with the same trap group. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit debb7af6867f1331f72745732b4849c748e929a6 Author: Ido Schimmel Date: Mon May 25 00:50:57 2020 +0300 mlxsw: spectrum: Rename IGMP trap group The IGMP trap group will be used for MLD traps in the next patch, so rename it to "MC_SNOOPING" which is more appropriate. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit c3f4ec050f56eeab7c1f290321f9b762c95bd332 Author: Christophe JAILLET Date: Sat Apr 18 09:07:51 2020 +0200 m68k/PCI: Fix a memory leak in an error handling path If 'ioremap' fails, we must free 'bridge', as done in other error handling path bellow. Fixes: 19cc4c843f40 ("m68k/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks") Signed-off-by: Christophe JAILLET Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit 13209a8f7304a34158f4366e8ea07a1965c05ac7 Merge: 316107119f47 98790bbac4db Author: David S. Miller Date: Sun May 24 13:47:27 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net The MSCC bug fix in 'net' had to be slightly adjusted because the register accesses are done slightly differently in net-next. Signed-off-by: David S. Miller commit 197b88fecc50ee3c7a22415db81eae0b9126f20e Author: Miquel Raynal Date: Tue May 19 09:45:48 2020 +0200 mtd: rawnand: arasan: Add new Arasan NAND controller Add the Arasan NAND controller driver. This brings only NAND controller support. The ECC engine being a bit subtle, hardware ECC support will be added in a second time. This work is based on contributions from Naga Sureshkumar Relli. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-8-miquel.raynal@bootlin.com commit 8201c579ec781a46b406158966030aba987d2dca Author: Miquel Raynal Date: Tue May 19 09:45:47 2020 +0200 dt-bindings: mtd: Document ARASAN NAND bindings Document the Arasan NAND controller bindings. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-7-miquel.raynal@bootlin.com commit ce33bd4c8c3f2ce063ce6f946cd5f6fa9693776a Author: Miquel Raynal Date: Tue May 19 09:45:46 2020 +0200 MAINTAINERS: Add Arasan NAND controller and bindings Fill a new entry for the Arasan NAND controller. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-6-miquel.raynal@bootlin.com commit d7904619ea0636411f40fb1f34057288c0783ecf Author: Miquel Raynal Date: Tue May 19 09:45:45 2020 +0200 mtd: rawnand: Add nand_extract_bits() There are cases where ECC bytes are not byte-aligned. Indeed, BCH implies using a number of ECC bits, which are not always a multiple of 8. We then need a helper like nand_extract_bits() to extract these syndromes from a buffer. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-5-miquel.raynal@bootlin.com commit 0651ed5082bc5af45be9f79cabcbc32c1cf4e599 Author: Miquel Raynal Date: Tue May 19 09:45:44 2020 +0200 mtd: rawnand: Ensure the number of bitflips is consistent The main NAND read page function can loop over "page reads" many times in if the reading reports uncorrectable error(s) and if the chip supports the read_retry feature. In this case, the number of bitflips is summarized between attempts. Fix this by re-initializing the entire mtd_ecc_stats object each time we retry. Suggested-by: Boris Brezillon Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-4-miquel.raynal@bootlin.com commit 1759279ad138cb0a903224a89f4bf40f69c417e8 Author: Miquel Raynal Date: Tue May 19 09:45:43 2020 +0200 lib/bch: Allow easy bit swapping It seems that several hardware ECC engine use a swapped representation of bytes compared to software. This might having to do with how the ECC engine is wired to the NAND controller or the order the bits are passed to the hardware BCH logic. This means that when the software BCH engine is working in conjunction with data generated with hardware, sometimes we might need to swap the bits inside bytes, eg: 0x0A = b0000_1010 -> b0101_0000 = 0x50 Make it possible by adding a boolean to the BCH initialization routine. Regarding the implementation itself, this is a rather simple approach that can probably be enhanced in the future by preparing the ->a_{mod,pow}_tab tables with the swapping in mind. Suggested-by: Boris Brezillon Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-3-miquel.raynal@bootlin.com commit c8ae3f744ddca0da164bcacee42d1d4b6fe7027d Author: Miquel Raynal Date: Tue May 19 09:45:42 2020 +0200 lib/bch: Rework a little bit the exported function names There are four exported functions, all suffixed by _bch, which is clearly not the norm. Let's rename them by prefixing them with bch_ instead. This is a mechanical change: init_bch -> bch_init free_bch -> bch_free encode_bch -> bch_encode decode_bch -> bch_decode Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-2-miquel.raynal@bootlin.com commit f0689802850beaf02dab79029a60eafdc617697f Author: Miquel Raynal Date: Tue May 19 15:08:34 2020 +0200 mtd: rawnand: micron: Adapt the PAGE READ flow to constraint controllers There are controllers not able to just read data cycles on the bus. There are controllers not able to do a change column. If we want to support both, we need to check which operation is supported first. This is the exact same mechanism that is in use for parameter page reads (ONFI/JEDEC) as the same problem occurs. Speed testing does not show any throughput penalty so we do not optimize more than that. However it is likely that, in the future, a more robust and exhaustive test will run at boot time to avoid re-checking what is supported and what is not at every call. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200519130834.2918-1-miquel.raynal@bootlin.com commit 767727b927aa48e429c6fa92d4b55cc235fffe95 Author: Boris Brezillon Date: Mon May 18 18:33:00 2020 +0200 mtd: rawnand: Remove the cmx270 NAND controller driver The CM-X270 board has been removed, we can remove the custom NAND driver as well. Signed-off-by: Boris Brezillon Acked-by: Robert Jarzmik Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200518163300.304732-1-boris.brezillon@collabora.com commit e45a4b652dbd2f8b5a3b8e97e89f602a58cb28aa Author: Boris Brezillon Date: Mon May 18 17:52:37 2020 +0200 mtd: rawnand: Fix nand_gpio_waitrdy() Mimic what's done in nand_soft_waitrdy() and add one to the jiffies timeout so we don't end up waiting less than actually required. Reported-by: Tudor Ambarus Fixes: b0e137ad24b6c ("mtd: rawnand: Provide helper for polling GPIO R/B pin") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200518155237.297549-1-boris.brezillon@collabora.com commit dbf15080ff2d0656304acb9595ecd8397f17b36d Author: Boris Brezillon Date: Wed May 13 19:22:48 2020 +0200 mtd: rawnand: davinci: Get rid of the legacy interface implementation Now that exec_op() is implemented we can get rid of the legacy interface implementation. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Tested-by: Bartosz Golaszewski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200513172248.141402-4-boris.brezillon@collabora.com commit 547aa7c262a4883ce45d1ea1e3acbff942041e45 Author: Boris Brezillon Date: Wed May 13 19:22:47 2020 +0200 mtd: rawnand: davinci: Implement exec_op() Implement exec_op() so we can later get rid of the legacy interface implementation. Signed-off-by: Boris Brezillon Tested-by: Bartosz Golaszewski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200513172248.141402-3-boris.brezillon@collabora.com commit 4f426e6e070fb29974f97a15876aa09501e56e09 Author: Boris Brezillon Date: Wed May 13 19:22:46 2020 +0200 mtd: rawnand: davinci: Stop using nand_chip.legacy.IO_ADDR_{R, W} We can use info->current_cs directly instead of doing this weird IO_ADDR_{R,W} re-assignment dance. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Tested-by: Bartosz Golaszewski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200513172248.141402-2-boris.brezillon@collabora.com commit 3626fdcf0904c9c6bb1cc2b4446bc016a8af1435 Author: Boris Brezillon Date: Wed May 13 19:22:45 2020 +0200 mtd: rawnand: davinci: Inherit from nand_controller Let's not rely on the dummy_controller embedded in nand_chip.legacy and explicitly inherit from nand_controller instead. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Tested-by: Bartosz Golaszewski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200513172248.141402-1-boris.brezillon@collabora.com commit dcb351c03f2fa6a599de1061b174167e03ee312b Author: Álvaro Fernández Rojas Date: Tue May 12 10:24:51 2020 +0200 mtd: rawnand: brcmnand: correctly verify erased pages The current code checks that the whole OOB area is erased. This is a problem when JFFS2 cleanmarkers are added to the OOB, since it will fail due to the usable OOB bytes not being 0xff. Correct this by only checking that data and ECC bytes aren't 0xff. Fixes: 02b88eea9f9c ("mtd: brcmnand: Add check for erased page bitflips") Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200512082451.771212-1-noltari@gmail.com commit d00358d7a1c50718232799e1ee10955bcd73795a Author: Álvaro Fernández Rojas Date: Tue May 12 09:57:33 2020 +0200 mtd: rawnand: brcmnand: improve hamming oob layout The current code generates 8 oob sections: S1 1-5 ECC 6-8 S2 9-15 S3 16-21 ECC 22-24 S4 25-31 S5 32-37 ECC 38-40 S6 41-47 S7 48-53 ECC 54-56 S8 57-63 Change it by merging continuous sections: S1 1-5 ECC 6-8 S2 9-21 ECC 22-24 S3 25-37 ECC 38-40 S4 41-53 ECC 54-56 S5 57-63 Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200512075733.745374-3-noltari@gmail.com commit 130bbde4809b011faf64f99dddc14b4b01f440c3 Author: Álvaro Fernández Rojas Date: Tue May 12 09:57:32 2020 +0200 mtd: rawnand: brcmnand: fix hamming oob layout First 2 bytes are used in large-page nand. Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops") Cc: stable@vger.kernel.org Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200512075733.745374-2-noltari@gmail.com commit 2d1b77281f36aa8adce00260918058a4440c889c Author: Miquel Raynal Date: Sun May 10 23:18:09 2020 +0200 MAINTAINERS: Remove Xiaolei Li and mark MTK NFC as orphaned Xiaolei's address is bouncing, remove him from MAINTAINERS and mark the driver he was maintaining, Mediatek's, as orphaned. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200510211809.15610-2-miquel.raynal@bootlin.com commit 0584d025829c5e3be98f41e7b930cd5154b319c5 Author: Miquel Raynal Date: Sun May 10 23:18:08 2020 +0200 MAINTAINERS: Remove Piotr Sroka and mark Cadence NFC as orphaned Piotr's address is bouncing, remove him from MAINTAINERS and mark the driver he was maintaining, Cadence's, as orphaned. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200510211809.15610-1-miquel.raynal@bootlin.com commit 1f1ec622623fe8e49a1036d4127b895a0f0e2c43 Author: Boris Brezillon Date: Tue May 5 12:13:35 2020 +0200 mtd: rawnand: Propage CS selection to sub operations Some controller using the instruction parse infrastructure might need to know which CS a specific sub-operation is targeting. Let's propagate this information. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200505101353.1776394-2-boris.brezillon@collabora.com commit 699d3e6a87d1ea37cb47343fa54f074a9e0a2391 Author: Christophe Kerello Date: Tue May 12 13:47:48 2020 +0200 mtd: rawnand: stm32_fmc2: use FIELD_PREP/FIELD_GET macros This patch removes custom macros and uses FIELD_PREP and FIELD_GET macros. Signed-off-by: Christophe Kerello Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1589284068-4079-3-git-send-email-christophe.kerello@st.com commit 743f05572e7f81dcccfecf454bc7d9e10edbbaca Author: Christophe Kerello Date: Tue May 12 13:47:47 2020 +0200 mtd: rawnand: stm32_fmc2: cosmetic change to use nfc instead of fmc2 where relevant This patch renames functions and local variables. This cleanup is done to get all functions starting by stm32_fmc2_nfc in the FMC2 raw NAND driver when all functions will start by stm32_fmc2_ebi in the FMC2 EBI driver. Signed-off-by: Christophe Kerello Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1589284068-4079-2-git-send-email-christophe.kerello@st.com commit d29b92f57ecee125a86587919a22152a702a6411 Author: Colin Ian King Date: Sun May 24 17:10:43 2020 +0100 loop: remove redundant assignment to variable error The variable error is being assigned a value that is never read so the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Jens Axboe commit f33a0b941017b9cb5a4e975af198b855b2f2b455 Author: Kaige Li Date: Thu May 14 20:59:41 2020 +0800 MIPS: tools: Fix resource leak in elf-entry.c There is a file descriptor resource leak in elf-entry.c, fix this by adding fclose() before return and die. Signed-off-by: Kaige Li Signed-off-by: Thomas Bogendoerfer commit b34a1a712024cd1cf50e405102eb9f71961fd6cd Author: Joshua Kinard Date: Sun May 17 19:24:39 2020 -0400 MIPS: SGI-IP30: Reorder the macros in war.h Fix the ordering of the macros in arch/mips/mach-ip30/war.h to match those in arch/mips/mach-ip27/war.h. Signed-off-by: Joshua Kinard Signed-off-by: Thomas Bogendoerfer commit ec7a93188a75b57b9f704db6862e7137f01aa80b Author: WANG Xuerui Date: Sat May 23 21:37:01 2020 +0800 MIPS: emulate CPUCFG instruction on older Loongson64 cores CPUCFG is the instruction for querying processor characteristics on newer Loongson processors, much like CPUID of x86. Since the instruction is supposedly designed to provide a unified way to do feature detection (without having to, for example, parse /proc/cpuinfo which is too heavyweight), it is important to provide compatibility for older cores without native support. Fortunately, most of the fields can be synthesized without changes to semantics. Performance is not really big a concern, because feature detection logic is not expected to be invoked very often in typical userland applications. The instruction can't be emulated on LOONGSON_2EF cores, according to FlyGoat's experiments. Because the LWC2 opcode is assigned to other valid instructions on 2E and 2F, no RI exception is raised for us to intercept. So compatibility is only extended back furthest to Loongson-3A1000. Loongson-2K is covered too, as it is basically a remix of various blocks from the 3A/3B models from a kernel perspective. This is lightly based on Loongson's work on their Linux 3.10 fork, for being the authority on the right feature flags to fill in, where things aren't otherwise discoverable. Signed-off-by: WANG Xuerui Reviewed-by: Jiaxun Yang Cc: Huacai Chen Cc: Jiaxun Yang Cc: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 8267e78f020a8de2752754c42ec1d56e92431477 Author: Huacai Chen Date: Sat May 23 15:51:45 2020 +0800 MIPS: Tidy up CP0.Config6 bits definition CP0.Config6 is a Vendor-defined register whose bits definitions are different from one to another. Recently, Xuerui's Loongson-3 patch and Serge's P5600 patch make the definitions inconsistency and unclear. To make life easy, this patch tidy the definition up: 1, Add a _MTI_ infix for proAptiv/P5600 feature bits; 2, Add a _LOONGSON_ infix for Loongson-3 feature bits; 3, Add bit6/bit7 definition for Loongson-3 which will be used later. All existing users of these macros are updated. Cc: WANG Xuerui Cc: Serge Semin Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 41528ba6afe62d472a729b223f8542ccc1156df1 Author: Tiezhu Yang Date: Thu May 21 10:15:06 2020 +0800 MIPS: DTS: Only build subdir of current platform Add config check in Makefile to only build the subdir of current platform. E.g. without this patch: AR arch/mips/built-in.a AR arch/mips/boot/dts/brcm/built-in.a AR arch/mips/boot/dts/cavium-octeon/built-in.a AR arch/mips/boot/dts/img/built-in.a AR arch/mips/boot/dts/ingenic/built-in.a AR arch/mips/boot/dts/lantiq/built-in.a DTC arch/mips/boot/dts/loongson/loongson3_4core_rs780e.dtb DTB arch/mips/boot/dts/loongson/loongson3_4core_rs780e.dtb.S AS arch/mips/boot/dts/loongson/loongson3_4core_rs780e.dtb.o DTC arch/mips/boot/dts/loongson/loongson3_8core_rs780e.dtb DTB arch/mips/boot/dts/loongson/loongson3_8core_rs780e.dtb.S AS arch/mips/boot/dts/loongson/loongson3_8core_rs780e.dtb.o AR arch/mips/boot/dts/loongson/built-in.a AR arch/mips/boot/dts/mscc/built-in.a AR arch/mips/boot/dts/mti/built-in.a AR arch/mips/boot/dts/netlogic/built-in.a AR arch/mips/boot/dts/ni/built-in.a AR arch/mips/boot/dts/pic32/built-in.a AR arch/mips/boot/dts/qca/built-in.a AR arch/mips/boot/dts/ralink/built-in.a AR arch/mips/boot/dts/xilfpga/built-in.a AR arch/mips/boot/dts/built-in.a With this patch: AR arch/mips/built-in.a DTC arch/mips/boot/dts/loongson/loongson3_4core_rs780e.dtb DTB arch/mips/boot/dts/loongson/loongson3_4core_rs780e.dtb.S AS arch/mips/boot/dts/loongson/loongson3_4core_rs780e.dtb.o DTC arch/mips/boot/dts/loongson/loongson3_8core_rs780e.dtb DTB arch/mips/boot/dts/loongson/loongson3_8core_rs780e.dtb.S AS arch/mips/boot/dts/loongson/loongson3_8core_rs780e.dtb.o AR arch/mips/boot/dts/loongson/built-in.a AR arch/mips/boot/dts/built-in.a Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit f39293fd37fff74c531b7a52d0459cc77db85e7f Author: Ben Hutchings Date: Sat May 23 23:50:34 2020 +0800 MIPS: Fix exception handler memcpy() The exception handler subroutines are declared as a single char, but when copied to the required addresses the copy length is 0x80. When range checks are enabled for memcpy() this results in a build failure, with error messages such as: In file included from arch/mips/mti-malta/malta-init.c:15: In function 'memcpy', inlined from 'mips_nmi_setup' at arch/mips/mti-malta/malta-init.c:98:2: include/linux/string.h:376:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter 376 | __read_overflow2(); | ^~~~~~~~~~~~~~~~~~ Change the declarations to use type char[]. Signed-off-by: Ben Hutchings Signed-off-by: YunQiang Su Signed-off-by: Thomas Bogendoerfer commit 316107119f473e764cf5e50437333c8b83bec0da Author: Heiner Kallweit Date: Sat May 23 17:40:25 2020 +0200 ethtool: propagate get_coalesce return value get_coalesce returns 0 or ERRNO, but the return value isn't checked. The returned coalesce data may be invalid if an ERRNO is set, therefore better check and propagate the return value. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit c0096a28588d5a72fa290a74593cf9737c0b1cfb Merge: 54b9aca08c9a 9250dccc119e Author: David S. Miller Date: Sat May 23 16:56:17 2020 -0700 Merge branch 'net-provide-a-devres-variant-of-register_netdev' Bartosz Golaszewski says: ==================== net: provide a devres variant of register_netdev() Using devres helpers allows to shrink the probing code, avoid memory leaks in error paths make sure the order in which resources are freed is the exact opposite of their allocation. This series proposes to add a devres variant of register_netdev() that will only work with net_device structures whose memory is also managed. First we add the missing documentation entry for the only other networking devres helper: devm_alloc_etherdev(). Next we move devm_alloc_etherdev() into a separate source file. We then use a proxy structure in devm_alloc_etherdev() to improve readability. Last: we implement devm_register_netdev() and use it in mtk-eth-mac driver. v1 -> v2: - rebase on top of net-next after driver rename, no functional changes ==================== Signed-off-by: David S. Miller commit 9250dccc119e72aecb0dfa786c94b4d8eb67ea29 Author: Bartosz Golaszewski Date: Sat May 23 15:27:11 2020 +0200 net: ethernet: mtk_star_emac: use devm_register_netdev() Use the new devres variant of register_netdev() in the mtk-star-emac driver and shrink the code by a couple lines. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit cd16627fc0468564fdd60f20ad52420b87195127 Author: Bartosz Golaszewski Date: Sat May 23 15:27:10 2020 +0200 net: devres: provide devm_register_netdev() Provide devm_register_netdev() - a device resource managed variant of register_netdev(). This new helper will only work for net_device structs that are also already managed by devres. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit f75063abc39441585a13fcc5b9ef3af993e9ac40 Author: Bartosz Golaszewski Date: Sat May 23 15:27:09 2020 +0200 net: devres: define a separate devres structure for devm_alloc_etherdev() Not using a proxy structure to store struct net_device doesn't save anything in terms of compiled code size or memory usage but significantly decreases the readability of the code with all the pointer casting. Define struct net_device_devres and use it in devm_alloc_etherdev_mqs(). Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit cb8a14b205699fee1053a406e1e3fce330b6bdc3 Author: Bartosz Golaszewski Date: Sat May 23 15:27:08 2020 +0200 net: move devres helpers into a separate source file There's currently only a single devres helper in net/ - devm variant of alloc_etherdev. Let's move it to net/devres.c with the intention of assing a second one: devm_register_netdev(). This new routine will need to know the address of the release function of devm_alloc_etherdev() so that it can verify (using devres_find()) that the struct net_device that's being passed to it is also resource managed. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 7eef3d095abe11fd7f99fa86c0be7c14b8852fae Author: Bartosz Golaszewski Date: Sat May 23 15:27:07 2020 +0200 Documentation: devres: add a missing section for networking helpers Add a new section for networking devres helpers to devres.rst and list the two existing devm functions. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 54b9aca08c9a141f48beb533ccb9ebcee679e855 Merge: 2b1a7f741a95 787c0c04f4c2 Author: David S. Miller Date: Sat May 23 16:54:35 2020 -0700 Merge branch 'r8169-remove-mask-argument-from-few-ERI-OCP-functions' Heiner Kallweit says: ==================== r8169: remove mask argument from few ERI/OCP functions Few ERI/OCP functions have a mask argument that isn't needed. Remove it to simplify the functions. ==================== Signed-off-by: David S. Miller commit 787c0c04f4c28d10a1c49bcbd625c24a3e9155d1 Author: Heiner Kallweit Date: Sat May 23 13:23:21 2020 +0200 r8169: remove mask argument from r8168ep_ocp_read Remove the mask argument as it's not used by r8168ep_ocp_read(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit a15aaa038b8ed213da7547f31c98345e2fe06d64 Author: Heiner Kallweit Date: Sat May 23 13:22:22 2020 +0200 r8169: remove mask argument from r8168dp_ocp_read All callers read the full 32bit value, therefore the mask argument can be removed. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 54113ded67126a7f81245de7c9cd73f49c6b2d0c Author: Heiner Kallweit Date: Sat May 23 13:21:36 2020 +0200 r8169: remove mask argument from rtl_w0w1_eri rtl_eri_read() returns the full 32bit value, therefore there's no benefit in writing back parts of it only. handle it like the vendor driver and write the full 32 bit always. Omitting the mask argument avoids some overhead and makes the code better readable. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 2b1a7f741a95cd6ab0554a3942e215c3eeb8a108 Merge: 098205f3c688 c1e0883012a7 Author: David S. Miller Date: Sat May 23 16:51:26 2020 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-22 This series contains updates to virtchnl and the ice driver. Geert Uytterhoeven fixes a data structure alignment issue in the virtchnl structures. Henry adds Flow Director support which allows for the redirection on ntuple rules over six patches. Initially Henry adds the initial infrastructure for Flow Director, and then later adds IPv4 and IPv6 support, as well as being able to display the ntuple rules. Bret add Accelerated Receive Flow Steering (aRFS) support which is used to steer receive flows to a specific queue. Fixes a transmit timeout when the VF link transitions from up/down/up because the transmit and receive queue interrupts are not enabled as part of VF's link up. Fixed an issue when the default VF LAN address is changed and after reset the PF will attempt to add the new MAC, which fails because it already exists. This causes the VF to be disabled completely until it is removed and enabled via sysfs. Anirudh (Ani) makes a fix where the ice driver needs to call set_mac_cfg to enable jumbo frames, so ensure it gets called during initialization and after reset. Fix bad register reads during a register dump in ethtool by removing the bad registers. Paul fixes an issue where the receive Malicious Driver Detection (MDD) auto reset message was not being logged because it occurred after the VF reset. Victor adds a check for compatibility between the Dynamic Device Personalization (DDP) package and the NIC firmware to ensure that everything aligns. Jesse fixes a administrative queue string call with the appropriate error reporting variable. Also fixed the loop variables that are comparing or assigning signed against unsigned values. ==================== Signed-off-by: David S. Miller commit 098205f3c688885394ed1f670a6a7cb4a58728a3 Merge: 46c54f9500af e086ba2fccda Author: David S. Miller Date: Sat May 23 16:47:41 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-05-22 This series contains updates to e1000e, igc and igb. Many of the patches in this series are fixes, but many of the igc fixes are based on the recent filter rule handling Andre has been working, which will not backport to earlier/stable kernels. The remaining fixes for e1000e and igb have CC'd stable where applicable. Andre continue with his refactoring of the filter rule code to help with reducing the complexity, in multiple patches. Fix the inconsistent size of a struct field. Fixed an issue where filter rules stay active in the hardware, even after it was deleted, so make sure to disable the filter rule before deleting. Fixed an issue with NFC rules which were dropping valid multicast MAC address. Fixed how the NFC rules are restored after the NIC is reset or brought up, so that they are restored in the same order they were initially setup in. Fix a potential memory leak when the driver is unloaded and the NFC rules are not flushed from memory properly. Fixed how NFC rule validation handles when a request to overwrite an existing rule. Changed the locking around the NFC rule API calls from spin_locks to mutex locks to avoid unnecessary busy waiting on lock contention. Sasha clean up more unused code in the igc driver. Kai-Heng Feng from Canonical provides three fixes, first has igb report the speed and duplex as unknown when in runtime suspend. Fixed e1000e to pass up the error when disabling ULP mode. Fixed e1000e performance by disabling TSO by default for certain MACs. Vitaly disables S0ix entry and exit flows for ME systems. ==================== Signed-off-by: David S. Miller commit 46c54f9500afad6128e19138c7d97fa4900331f6 Merge: 07a7f3081947 582234b465ed Author: David S. Miller Date: Sat May 23 16:37:00 2020 -0700 Merge tag 'mlx5-updates-2020-05-22' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2020-05-22 This series includes two updates and one cleanup patch 1) Tang Bim, clean-up with IS_ERR() usage 2) Vlad introduces a new mlx5 kconfig flag for TC support This is required due to the high volume of current and upcoming development in the eswitch and representors areas where some of the feature are TC based such as the downstream patches of MPLSoUDP and the following representor bonding support for VF live migration and uplink representor dynamic loading. For this Vlad kept TC specific code in tc.c and rep/tc.c and organized non TC code in representors specific files. 3) Eli Cohen adds support for MPLS over UPD encap and decap TC offloads. ==================== Signed-off-by: David S. Miller commit 07a7f30819475a6f058df6bba5150c50e7942cfb Author: Randy Dunlap Date: Fri May 22 13:05:26 2020 -0700 net: psample: fix build error when CONFIG_INET is not enabled Fix psample build error when CONFIG_INET is not set/enabled by bracketing the tunnel code in #ifdef CONFIG_NET / #endif. ../net/psample/psample.c: In function ‘__psample_ip_tun_to_nlattr’: ../net/psample/psample.c:216:25: error: implicit declaration of function ‘ip_tunnel_info_opts’; did you mean ‘ip_tunnel_info_opts_set’? [-Werror=implicit-function-declaration] Signed-off-by: Randy Dunlap Cc: Yotam Gigi Cc: Cong Wang Signed-off-by: David S. Miller commit 0465d8f830dc40714db6c02e1db28b30206a82f7 Author: Michael Walle Date: Fri May 22 11:53:31 2020 +0200 net: phy: at803x: fix PHY ID masks Ever since its first commit 0ca7111a38f05 ("phy: add AT803x driver") the PHY ID mask was set to 0xffffffef. It is unclear to me why this mask was chosen in the first place. Both the AR8031/AR8033 and the AR8035 datasheets mention it is always the given value: - for AR8031/AR8033 its 0x004d/0xd074 - for AR8035 its 0x004d/0xd072 Unfortunately, I don't have a datasheet for the AR8030. Therefore, we leave its PHY ID mask untouched. For the PHYs mentioned before use the handy PHY_ID_MATCH_EXACT() macro. I've tried to contact the author of the initial commit, but received no answer so far. Cc: Matus Ujhelyi Signed-off-by: Michael Walle Signed-off-by: David S. Miller commit 9241dfe7f2772fc73c82eb950afb1c795d2c012c Author: Arvind Sankar Date: Sat May 23 18:15:13 2020 -0400 efi/x86: Drop the special GDT for the EFI thunk Instead of using efi_gdt64 to switch back to 64-bit mode and then switching to the real boot-time GDT, just switch to the boot-time GDT directly. The two GDT's are identical other than efi_gdt64 not including the 32-bit code segment. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200523221513.1642948-1-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit d9e19d7966a31ae70edfe0cb7cb044e20343a0c9 Author: Jonathan Marek Date: Fri May 22 18:29:08 2020 -0400 drm/msm/a6xx: skip HFI set freq if GMU is powered down Also skip the newly added HFI set freq path if the GMU is powered down, which was missing because of patches crossing paths. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit fb212ad6cc58c0fd8c0f76578d4392f71e595bd5 Author: Jordan Crouse Date: Fri May 22 16:03:16 2020 -0600 drm/msm: Update the MMU helper function APIs Instead of using a bare unsigned type for the length value for map/unmap functions pass in a size_t to more correctly match up with the underlying APIs. Signed-off-by: Jordan Crouse Tested-by: Shawn Guo Signed-off-by: Rob Clark commit ccac7ce373c1b5175bcf733fe6223129b8975788 Author: Jordan Crouse Date: Fri May 22 16:03:15 2020 -0600 drm/msm: Refactor address space initialization Refactor how address space initialization works. Instead of having the address space function create the MMU object (and thus require separate but equal functions for gpummu and iommu) use a single function and pass the MMU struct in. Make the generic code cleaner by using target specific functions to create the address space so a2xx can do its own thing in its own space. For all the other targets use a generic helper to initialize IOMMU but leave the door open for newer targets to use customization if they need it. Reviewed-by: Rob Clark Signed-off-by: Jordan Crouse Tested-by: Shawn Guo [squash in rebase fixups] Signed-off-by: Rob Clark commit 52da6d513183cf543df6efc95bf504aee0da70d6 Author: Jordan Crouse Date: Fri May 22 16:03:14 2020 -0600 drm/msm: Attach the IOMMU device during initialization Everywhere an IOMMU object is created by msm_gpu_create_address_space the IOMMU device is attached immediately after. Instead of carrying around the infrastructure to do the attach from the device specific code do it directly in the msm_iommu_init() function. This gets it out of the way for more aggressive cleanups that follow. Reviewed-by: Rob Clark Signed-off-by: Jordan Crouse Tested-by: Shawn Guo [squash in rebase fixups and fix for unused fxn] Signed-off-by: Rob Clark commit 21eb9ec7c3e6f5c6ddae2e19768fd7eab2cd3b63 Author: Long Cheng Date: Sat Apr 27 11:36:31 2019 +0800 arm: dts: mt2712: add uart APDMA to device tree 1. add uart APDMA controller device node 2. add uart 0/1/2/3/4/5 DMA function Signed-off-by: Long Cheng Link: https://lore.kernel.org/r/1556336193-15198-3-git-send-email-long.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 5e6cdf0051f824c76a8065c8e6dc25829aedd993 Author: jjian zhou Date: Wed Apr 10 17:25:41 2019 +0800 arm64: dts: mt8183: add mmc node Add mmc DTS node to the mt8183 and mt8183-evb. Signed-off-by: Jjian Zhou Link: https://lore.kernel.org/r/1554888341-5249-1-git-send-email-jjian.zhou@mediatek.com Signed-off-by: Matthias Brugger commit e9cabfd046d55d05f11d05fccc4019aa4bad29c6 Author: Biao Huang Date: Wed Oct 9 15:10:22 2019 +0800 arm64: dts: mt2712: add ethernet device node This patch add device node for mt2712 ethernet. Signed-off-by: Biao Huang Signed-off-by: Matthias Brugger commit 33649bf4494c1feaf1956a84895fcc0621aafd90 Author: Steve Wahl Date: Wed May 13 17:11:23 2020 -0500 x86/apic/uv: Remove code for unused distributed GRU mode Distributed GRU mode appeared in only one generation of UV hardware, and no version of the BIOS has shipped with this feature enabled, and we have no plans to ever change that. The gru.s3.mode check has always been and will continue to be false. So remove this dead code. Signed-off-by: Steve Wahl Signed-off-by: Borislav Petkov Acked-by: Dimitri Sivanich Link: https://lkml.kernel.org/r/20200513221123.GJ3240@raspberrypi commit afaa33da08abd10be8978781d7c99a9e67d2bbff Author: Andrea Parri (Microsoft) Date: Fri May 22 19:19:01 2020 +0200 Drivers: hv: vmbus: Resolve more races involving init_vp_index() init_vp_index() uses the (per-node) hv_numa_map[] masks to record the CPUs allocated for channel interrupts at a given time, and distribute the performance-critical channels across the available CPUs: in part., the mask of "candidate" target CPUs in a given NUMA node, for a newly offered channel, is determined by XOR-ing the node's CPU mask and the node's hv_numa_map. This operation/mechanism assumes that no offline CPUs is set in the hv_numa_map mask, an assumption that does not hold since such mask is currently not updated when a channel is removed or assigned to a different CPU. To address the issues described above, this adds hooks in the channel removal path (hv_process_channel_removal()) and in target_cpu_store() in order to clear, resp. to update, the hv_numa_map[] masks as needed. This also adds a (missed) update of the masks in init_vp_index() (cf., e.g., the memory-allocation failure path in this function). Like in the case of init_vp_index(), such hooks require to determine if the given channel is performance critical. init_vp_index() does this by parsing the channel's offer, it can not rely on the device data structure (device_obj) to retrieve such information because the device data structure has not been allocated/linked with the channel by the time that init_vp_index() executes. A similar situation may hold in hv_is_alloced_cpu() (defined below); the adopted approach is to "cache" the device type of the channel, as computed by parsing the channel's offer, in the channel structure itself. Fixes: 7527810573436f ("Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type") Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200522171901.204127-3-parri.andrea@gmail.com Signed-off-by: Wei Liu commit a949e86c0d7802c05b2ae726a84fae89ddb5be7d Author: Andrea Parri (Microsoft) Date: Fri May 22 19:19:00 2020 +0200 Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug vmbus_process_offer() does two things (among others): 1) first, it sets the channel's target CPU with cpu_hotplug_lock; 2) it then adds the channel to the channel list(s) with channel_mutex. Since cpu_hotplug_lock is released before (2), the channel's target CPU (as designated in (1)) can be deemed "free" by hv_synic_cleanup() and go offline before the channel is added to the list. Fix the race condition by "extending" the cpu_hotplug_lock critical section to include (2) (and (1)), nesting the channel_mutex critical section within the cpu_hotplug_lock critical section as done elsewhere (hv_synic_cleanup(), target_cpu_store()) in the hyperv drivers code. Move even further by extending the channel_mutex critical section to include (1) (and (2)): this change allows to remove (the now redundant) bind_channel_to_cpu_lock, and generally simplifies the handling of the target CPUs (that are now always modified with channel_mutex held). Fixes: d570aec0f2154e ("Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug") Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200522171901.204127-2-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 6e99d3213b10ee18428d6d20715ad6c0e89ead4d Author: Ard Biesheuvel Date: Sat May 23 11:01:57 2020 +0200 efi/libstub: Add missing prototype for PE/COFF entry point Fix a missing prototype warning by adding a forward declaration for the PE/COFF entrypoint, and while at it, align the function name between the x86 and ARM versions of the stub. Signed-off-by: Ard Biesheuvel commit a3975dea1696b7c81319dc4b66e3c378dd47ccfb Merge: 1dfb74b1ea6d 13e945631c2f Author: Greg Kroah-Hartman Date: Sat May 23 10:40:06 2020 +0200 Merge tag 'iio-for-5.8c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Third set of IIO new device support, cleanups etc for the 5.8 cycle. A rather late final set to pick up a couple of new drivers, a bunch of cleanup and some fixes that can wait for the merge window. In particularly I'd like to highlight the great core and driver cleanup work that the Alex and the team at Analog devices are currently doing. Should see lots more of that in the next cycle give what is currently under review. This pull also has the first few fixes squashing a class of alignment and small kernel data leak bugs that Lars-Peter Clausen picked up on in a review. Quite a few more of those to come. They've been there a long time so we aren't rushing the reviews. New device support * atlas ezo - new driver supporting this range of chemical and similar sensors with the odd interface of ascii strings over i2c. * bma180 - bma023, bma150 and smb380 support. Note these are currently also supported by a driver in input which we will hopefully remove (eventually). There are Kconfig protections to avoid a clash in the meantime. * vcnl3020 - new driver for this proximity sensor. Core change * during buffer updates, change the current state variable before we actually call pre and post enable callbacks so drivers can know where we are going. Note this is a precursor to only exposing one enable callback to drivers. The (false) logic behind having two such callbacks has long been fixed, but only now is the mess getting cleaned up. Features * exynos adc. - add reporting of channels scale values. Cleanups and minor fixes. * core - drop now unused attrcount_orig variable. * ad5360, ad5446, ad5449, ad5755, ad5761, ad5764, ad5380, ad5421, ad5592, ad5686 and vf610_dac - remove direct use of iio_dev->mlock from all these drivers. Its semantics used to be poorly defined, but now it is for core use only. Removing it's use in drivers has been a long process of which this is the latest step! * exynos_adc - drop a pointless check on the phy as the driver doesn't access it. * ping - avoid a dance from iio_priv and iio_priv_to_dev back again by just passing the iio_dev into the functions. * pms7003 - alignment and potential data leak fix. * sps30 - alignment bug fix. * tag 'iio-for-5.8c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (31 commits) iio:chemical:pms7003: Fix timestamp alignment and prevent data leak. iio:chemical:sps30: Fix timestamp alignment iio: adc: stm32-adc: fix a wrong error message when probing interrupts iio: light: gp2ap002: Take runtime PM reference on light read iio: proximity: ping: pass reference to IIO device as param to ping_read() iio: dac: ad5592r-base: Replace indio_dev->mlock with own device lock iio: proximity: Add driver support for vcnl3020 proximity sensor dt-bindings: proximity: provide vcnl3020 device tree binding document iio: buffer: remove attrcount_orig var from sysfs creation iio: chemical: add atlas-ezo-sensor initial support dt-bindings: iio: chemical: add CO2 EZO module documentation iio: adc: exynos: Simplify Exynos7-specific init iio: adc: Add scaling support to exynos adc driver iio: __iio_update_buffers: Update mode before preenable/after postdisable iio: dac: vf610_dac: Replace indio_dev->mlock with own device lock iio: dac: ad5686: Replace indio_dev->mlock with own device lock iio: dac: ad5421: Replace indio_dev->mlock with own device lock iio: dac: ad5380: Replace indio_dev->mlock with own device lock iio: dac: ad5764: Replace indio_dev->mlock with own device lock iio: dac: ad5761: Replace indio_dev->mlock with own device lock ... commit 67d631b7c05eff955ccff4139327f0f92a5117e5 Author: Arvind Sankar Date: Sat Feb 29 18:11:20 2020 -0500 x86/mm: Stop printing BRK addresses This currently leaks kernel physical addresses into userspace. Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Acked-by: Kees Cook Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/20200229231120.1147527-1-nivedita@alum.mit.edu commit c1e0883012a75a04180a6ebf23a869172187c506 Author: Jesse Brandeburg Date: Fri May 15 17:36:37 2020 -0700 ice: cleanup unsigned loops Fix loop variables that are comparing or assigning signed against unsigned values, mostly by declaring loop counters as unsigned. Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 9d68a79c3b8fe88c1444c401aaf3496f7ed2a05d Author: Jesse Brandeburg Date: Fri May 15 17:36:36 2020 -0700 ice: fix usage of incorrect variable The driver was using rq_last_status where it should have been using sq_last_status. Fix the string to be using the correct error reporting variable. Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1fba4a8a92706c89716449b1aab1b6879f438d34 Author: Anirudh Venkataramanan Date: Fri May 15 17:36:35 2020 -0700 ice: Fix bad register reads The "ethtool -d" handler reads registers in the ice_regs_dump_list array and returns read values back to the userspace. The register offsets PFINT0_ITR* are not valid as per the specification and reading these causes a "unable to handle kernel paging request" bug in the driver. Remove these registers from ice_regs_dump_list. Signed-off-by: Anirudh Venkataramanan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit b82729195892f5fc1dd69a8cfb23731d3ef55578 Author: Victor Raj Date: Fri May 15 17:36:34 2020 -0700 ice: check for compatibility between DDP package and firmware Require the Dynamic Device Personalization (DDP) file to have the same major version number and the same or older minor number than the firmware version major and minor, respectively. Check the OS and NVM package versions before downloading the package. If the OS package version is not compatible with NVM then return an appropriate error. Split the 32-byte segment name into a 28-byte segment name and a 4-byte Track-ID. Older packages will still work with this change because no package has a name that will take up more than 28 bytes; in this case the Track-ID will be 0. Note that the driver will store the segment name as 32-bytes in the ice_hw structure, in order to normalize the length of the various package name strings that it uses. Also add section ID and structure for the segment metadata section. Signed-off-by: Victor Raj Signed-off-by: Dan Nowlin Signed-off-by: Bruce Allan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 47ebc7b02485aa0c0e18f96368e6f6958735fcea Author: Brett Creeley Date: Fri May 15 17:36:33 2020 -0700 ice: Check if unicast MAC exists before setting VF MAC Currently if a unicast MAC is set via ndo_set_vf_mac, the PF driver will set the VF's dflt_lan_addr.addr once some basic checks have passed. The VF is then reset. During reset the PF driver will attempt to program the VF's MAC from the dflt_lan_addr.addr field. This fails when the MAC already exists on the PF's switch. This is causing the VF to be completely disabled until removing/enabling any VFs via sysfs. Fix this by checking if the unicast MAC exists before triggering a VF reset directly in ndo_set_vf_mac. Also, add a check if the unicast MAC is set to the same value as before and return 0 if that is the case. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4dc926d3a59e73b8c4adf51b261f1a1bbd48a989 Author: Brett Creeley Date: Fri May 15 17:36:32 2020 -0700 ice: Fix Tx timeout when link is toggled on a VF's interface Currently if the iavf is loaded and a VF link transitions from up to down to up again a Tx timeout will be triggered. This happens because Tx/Rx queue interrupts are only enabled when receiving the VIRTCHNL_OP_CONFIG_MAP_IRQ message, which happens on reset or initial iavf driver load, but not when bringing link up. This is problematic because they are disabled on the VIRTCHNL_OP_DISABLE_QUEUES message, which is part of bringing a VF's link down. However, they are not enabled on the VIRTCHNL_OP_ENABLE_QUEUES message, which is part of bringing a VF's link up. Fix this by re-enabling the VF's Rx and Tx queue interrupts when they were previously configured. This is done by first checking to make sure the previous value in QINT_[R|T]QCTL.MSIX_INDX is not 0, which is used to represent the OICR in the VF's interrupt space. If the MSIX_INDX is non-zero then enable the interrupt by setting the QINT_[R|T]CTL.CAUSE_ENA bit to 1. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 7438a3b0947a2ef43c16bfb7b5b19048d6d92b14 Author: Paul Greenwalt Date: Fri May 15 17:36:31 2020 -0700 ice: print Rx MDD auto reset message before VF reset Rx MDD auto reset message was not being logged because logging occurred after the VF reset and the VF MDD data was reinitialized. Log the Rx MDD auto reset message before triggering the VF reset. Signed-off-by: Paul Greenwalt Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4244910568ed2fed3532d86aa7fc910d2583fa41 Author: Anirudh Venkataramanan Date: Fri May 15 17:36:30 2020 -0700 ice: Call ice_aq_set_mac_cfg As per the specification, the driver needs to call set_mac_cfg (opcode 0x0603) to be able to exercise jumbo frames. Call the function during initialization and the post reset rebuild flow. Signed-off-by: Anirudh Venkataramanan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 28bf26724fdb0e02267d19e280d6717ee810a10d Author: Brett Creeley Date: Mon May 11 18:01:46 2020 -0700 ice: Implement aRFS Enable accelerated Receive Flow Steering (aRFS). It is used to steer Rx flows to a specific queue. This functionality is triggered by the network stack through ndo_rx_flow_steer and requires Flow Director (ntuple on) to function. The fltr_info is used to add/remove/update flow rules in the HW, the fltr_state is used to determine what to do with the filter with respect to HW and/or SW, and the flow_id is used in co-ordination with the network stack. The work for aRFS is split into two paths: the ndo_rx_flow_steer operation and the ice_service_task. The former is where the kernel hands us an Rx SKB among other items to setup aRFS and the latter is where the driver adds/updates/removes filter rules from HW and updates filter state. In the Rx path the following things can happen: 1. New aRFS entries are added to the hash table and the state is set to ICE_ARFS_INACTIVE so the filter can be updated in HW by the ice_service_task path. 2. aRFS entries have their Rx Queue updated if we receive a pre-existing flow_id and the filter state is ICE_ARFS_ACTIVE. The state is set to ICE_ARFS_INACTIVE so the filter can be updated in HW by the ice_service_task path. 3. aRFS entries marked as ICE_ARFS_TODEL are deleted In the ice_service_task path the following things can happen: 1. New aRFS entries marked as ICE_ARFS_INACTIVE are added or updated in HW. and their state is updated to ICE_ARFS_ACTIVE. 2. aRFS entries are deleted from HW and their state is updated to ICE_ARFS_TODEL. Signed-off-by: Brett Creeley Signed-off-by: Madhu Chittim Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 83af00395190bc2db05a67a417a2ea0d5967b74d Author: Henry Tieman Date: Mon May 11 18:01:45 2020 -0700 ice: Restore filters following reset Following a reset, Flow Director filters are cleared from the hardware. Rebuild the filters using the software structures containing the filter rules. Signed-off-by: Henry Tieman Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 2c57ffcb199004825184f96081fbf036d3b2426a Author: Henry Tieman Date: Mon May 11 18:01:44 2020 -0700 ice: Enable flex-bytes support Flex-bytes allows for packet matching based on an offset and value. This is supported via the ethtool user-def option. It is specified by providing an offset followed by a 2 byte match value. Offset is measured from the start of the MAC address. The following restrictions apply to flex-bytes. The specified offset must be an even number and be smaller than 0x1fe. Example usage: ethtool -N eth0 flow-type tcp4 src-ip 192.168.0.55 dst-ip 172.16.0.55 \ src-port 12 dst-port 13 user-def 0x10ffff action 32 Signed-off-by: Henry Tieman Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 165d80d6adab51b6a2f9c40ad0c8d3dec18d7bef Author: Henry Tieman Date: Mon May 11 18:01:43 2020 -0700 ice: Support IPv6 Flow Director filters Extend supported filters to allow for IPv6 filters. Supported fields are: src-ip, dst-ip, src-port, and dst-port Supported flow-types are: tcp6, udp6, sctp6, ip6 Example usage: ethtool -N eth0 flow-type tcp6 src-port 12 dst-port 13 \ src-ip fce0::1:34 dst-ip fce0::1:35 action 32 Signed-off-by: Henry Tieman Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit cac2a27cd9ab1638e21df11ec583d2bc919a3ae3 Author: Henry Tieman Date: Mon May 11 18:01:42 2020 -0700 ice: Support IPv4 Flow Director filters Support the addition and deletion of IPv4 filters. Supported fields are: src-ip, dst-ip, src-port, and dst-port Supported flow-types are: tcp4, udp4, sctp4, ip4 Example usage: ethtool -N eth0 flow-type tcp4 src-ip 192.168.0.55 dst-ip 172.16.0.55 \ src-port 16 dst-port 12 action 32 Signed-off-by: Henry Tieman Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4ab956462f67763be4049b03a414aa7c9b2d4c96 Author: Henry Tieman Date: Mon May 11 18:01:41 2020 -0700 ice: Support displaying ntuple rules Add functionality for ethtool --show-ntuple, allowing for filters to be displayed when set functionality is added. Add statistics related to Flow Director matches and status. Signed-off-by: Henry Tieman Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 148beb612031255156d68b342170140524afb36e Author: Henry Tieman Date: Mon May 11 18:01:40 2020 -0700 ice: Initialize Flow Director resources Flow Director allows for redirection based on ntuple rules. Rules are programmed using the ethtool set-ntuple interface. Supported actions are redirect to queue and drop. Setup the initial framework to process Flow Director filters. Create and allocate resources to manage and program filters to the hardware. Filters are processed via a sideband interface; a control VSI is created to manage communication and process requests through the sideband. Upon allocation of resources, update the hardware tables to accept perfect filters. Signed-off-by: Henry Tieman Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 65ece6de0114fc84fbc0487bf68cae91d535dd78 Author: Geert Uytterhoeven Date: Thu Apr 16 11:50:49 2020 +0200 virtchnl: Add missing explicit padding to structures On e.g. m68k, the alignment of 32-bit values is only 2 bytes, leading to the following: ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero] { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:577:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter); ^~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:577:32: error: enumerator value for ‘virtchnl_static_assert_virtchnl_filter’ is not an integer constant VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter); ^~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero] { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:619:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_pf_event); ^~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:619:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_pf_event’ is not an integer constant VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_pf_event); ^~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero] { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:640:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info); ^~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:640:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_iwarp_qv_info’ is not an integer constant VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info); ^~~~~~~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero] { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ ./include/linux/avf/virtchnl.h:647:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_iwarp_qvlist_info); ^~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:647:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_iwarp_qvlist_info’ is not an integer constant VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_iwarp_qvlist_info); ^~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’ { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } ^ Fix this by adding explicit padding to structures with holes. Reported-by: Signed-off-by: Geert Uytterhoeven Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit a152b85984a03e7f83b9d8bcf908c29597d898fc Merge: 1e6a70526640 a5dfaa2ab940 Author: David S. Miller Date: Fri May 22 18:30:34 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2020-05-23 The following pull-request contains BPF updates for your *net-next* tree. We've added 50 non-merge commits during the last 8 day(s) which contain a total of 109 files changed, 2776 insertions(+), 2887 deletions(-). The main changes are: 1) Add a new AF_XDP buffer allocation API to the core in order to help lowering the bar for drivers adopting AF_XDP support. i40e, ice, ixgbe as well as mlx5 have been moved over to the new API and also gained a small improvement in performance, from Björn Töpel and Magnus Karlsson. 2) Add getpeername()/getsockname() attach types for BPF sock_addr programs in order to allow for e.g. reverse translation of load-balancer backend to service address/port tuple from a connected peer, from Daniel Borkmann. 3) Improve the BPF verifier is_branch_taken() logic to evaluate pointers being non-NULL, e.g. if after an initial test another non-NULL test on that pointer follows in a given path, then it can be pruned right away, from John Fastabend. 4) Larger rework of BPF sockmap selftests to make output easier to understand and to reduce overall runtime as well as adding new BPF kTLS selftests that run in combination with sockmap, also from John Fastabend. 5) Batch of misc updates to BPF selftests including fixing up test_align to match verifier output again and moving it under test_progs, allowing bpf_iter selftest to compile on machines with older vmlinux.h, and updating config options for lirc and v6 segment routing helpers, from Stanislav Fomichev, Andrii Nakryiko and Alan Maguire. 6) Conversion of BPF tracing samples outdated internal BPF loader to use libbpf API instead, from Daniel T. Lee. 7) Follow-up to BPF kernel test infrastructure in order to fix a flake in the XDP selftests, from Jesper Dangaard Brouer. 8) Minor improvements to libbpf's internal hashmap implementation, from Ian Rogers. ==================== Signed-off-by: David S. Miller commit e086ba2fccda4c196b84a167493f67f089d0ebdc Author: Vitaly Lifshits Date: Thu May 7 20:14:06 2020 +0300 e1000e: disable s0ix entry and exit flows for ME systems Since ME systems do not support SLP_S0 in S0ix state, and S0ix entry and exit flows may cause errors on them it is best to avoid using e1000e_s0ix_entry_flow and e1000e_s0ix_exit_flow functions. This was done by creating a struct of all devices that comes with ME and by checking if the current device has ME. Signed-off-by: Vitaly Lifshits Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit f29801030ac67bf98b7a65d3aea67b30769d4f7c Author: Kai-Heng Feng Date: Thu May 7 22:21:07 2020 +0800 e1000e: Disable TSO for buffer overrun workaround Commit b10effb92e27 ("e1000e: fix buffer overrun while the I219 is processing DMA transactions") imposes roughly 30% performance penalty. The commit log states that "Disabling TSO eliminates performance loss for TCP traffic without a noticeable impact on CPU performance", so let's disable TSO by default to regain the loss. CC: stable Fixes: b10effb92e27 ("e1000e: fix buffer overrun while the I219 is processing DMA transactions") BugLink: https://bugs.launchpad.net/bugs/1802691 Signed-off-by: Kai-Heng Feng Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 0c80cdbf33207c7aea1aec9027ad8011bd6178ad Author: Kai-Heng Feng Date: Thu May 7 14:25:45 2020 +0800 e1000e: Warn if disabling ULP failed The hardware may stop working if driver failed to disable ULP mode. Take the return value of e1000_disable_ulp_lpt_lp() into account, and pass up the error if it fails. Signed-off-by: Kai-Heng Feng Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 165ae7a8feb53dc47fb041357e4b253bfc927cf9 Author: Kai-Heng Feng Date: Tue May 5 12:01:54 2020 +0800 igb: Report speed and duplex as unknown when device is runtime suspended igb device gets runtime suspended when there's no link partner. We can't get correct speed under that state: $ cat /sys/class/net/enp3s0/speed 1000 In addition to that, an error can also be spotted in dmesg: [ 385.991957] igb 0000:03:00.0 enp3s0: PCIe link lost Since device can only be runtime suspended when there's no link partner, we can skip reading register and let the following logic set speed and duplex with correct status. The more generic approach will be wrap get_link_ksettings() with begin() and complete() callbacks. However, for this particular issue, begin() calls igb_runtime_resume() , which tries to rtnl_lock() while the lock is already hold by upper ethtool layer. So let's take this approach until the igb_runtime_resume() no longer needs to hold rtnl_lock. CC: stable Suggested-by: Alexander Duyck Signed-off-by: Kai-Heng Feng Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 14ec06b02e260b2e78785741d0e734f4b04db1fe Author: Sasha Neftin Date: Mon May 4 09:29:25 2020 +0300 igc: Remove unused descriptor's flags Enable Tidv register, Report Packet Sent, Report Status and Ethernet CRC flags not in use. This patch comes to clean up these flags. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 5c739e77ca338a37765370290e02cb270651380b Author: Andre Guedes Date: Fri Apr 24 13:16:23 2020 -0700 igc: Remove igc_nfc_rule_exit() During igc_down(), we call igc_nfc_rule_exit() which traverse the NFC rule list disabling filters one by one. Later on in igc_down() flow we issue an hardware reset which also clear all filters. Since we already reset the hardware, we don't actually need to disable each filter manually. In order to simplify the code, this patch removes igc_nfc_rule() altogether. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 42fc5dc042796a825d9e2db8ee4cd977b12f73d1 Author: Andre Guedes Date: Fri Apr 24 13:16:22 2020 -0700 igc: Change adapter->nfc_rule_lock to mutex This patch changes adapter->nfc_rule_lock type from spin_lock to mutex so we avoid unnecessary busy waiting on lock contention. A closer look at the execution context of NFC rule API users shows that all of them run in process context. The API users are: ethtool ops, igc_configure(), called when interface is brought up by user or reset workequeue thread, igc_down(), called when interface is brought down, and igc_remove(), called when driver is unloaded. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit acda576f72b8a2eed44aa3840561daa0ce837744 Author: Andre Guedes Date: Fri Apr 24 13:16:21 2020 -0700 igc: Change return type from igc_disable_nfc_rule() None of igc_disable_nfc_rule() callers actually check its returning value. A closer look at why this function would fail shows that the only situation is when we try to delete an Ethertype or MAC filter that doesn't exist. That situation is very unlikely so we can change igc_del_etype_filter() and igc_del_mac_filter() logic to "if the filter doesn't exist, we are done", and keep the logic in igc_disable_nfc_rule() callers simple. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 1894df0ccb6ac7ba8b2c799e7d74b5db1180c518 Author: Andre Guedes Date: Fri Apr 24 13:16:20 2020 -0700 igc: Fix NFC rule validation If we try to overwrite an existing rule with the same filter but different action, we get EEXIST error as shown below. $ ethtool -N eth0 flow-type ether dst action 1 loc 10 $ ethtool -N eth0 flow-type ether dst action 2 loc 10 rmgr: Cannot insert RX class rule: File exists The second command is expected to overwrite the previous rule in location 10 and succeed. This patch fixes igc_ethtool_check_nfc_rule() so it also checks the rules location. In case they match, the rule under evaluation should not be considered invalid. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit e256ec83fabd5803a576c46e03289e519d087fda Author: Andre Guedes Date: Fri Apr 24 13:16:19 2020 -0700 igc: Fix NFC rules leak when driver is unloaded If we have RFC rules in adapter->nfc_rule_list when the IGC driver is unloaded, all rules are leaked. This patch fixes the issue by introducing the helper igc_flush_nfc_rules() and calling it in igc_remove(). It also updates igc_set_features() so is reuses the new helper instead of re-implementing it. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 36fa21520f33317fe51bf80bc154873e922c2a26 Author: Andre Guedes Date: Fri Apr 24 13:16:18 2020 -0700 igc: Refactor igc_ethtool_update_nfc_rule() Current implementation of igc_ethtool_update_nfc_rule() is a bit convoluted since it handles too many things: rule lookup, deletion and addition. This patch breaks it into three functions so we simplify the code and improve code reuse. Code related to rule lookup is refactored out to a new function called igc_get_nfc_rule(). Code related to rule addition is refactored out to a new function called igc_add_nfc_rule(). This function enables the rule in hardware and adds it to the adapter's list. Code related to rule deletion is refactored out to a new function called igc_del_nfc_rule(). This function disables the rule in hardware, removes it from adapter's list, and deletes it. As a byproduct of this refactoring, igc_enable_nfc_rule() and igc_disable_nfc_rule() are moved to igc_main.c since they are not used in igc_ethtool.c anymore, and igc_restore_nfc_rules() and igc_nfc_rule_ exit() are moved around to avoid forward declaration. Also, since this patch already touches igc_ethtool_get_nfc_rule(), it takes the opportunity to remove the 'match_flags' check. Empty flags are not allowed to be added so no need to check that. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit d957c6010a907d86d41d1bee024a9827e385c4fa Author: Andre Guedes Date: Fri Apr 24 13:16:17 2020 -0700 igc: Fix NFC rules restoration When network interface is brought up, the driver re-enables the NFC rules previously configured. However, this is done in reverse order the rules were added and hardware filters are configured differently. For example, consider the following rules: $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:AA queue 0 $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:BB queue 1 $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:CC queue 2 $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:DD queue 3 RAL/RAH registers are configure so filter index 1 has address ending with AA, filter index 2 has address ending in BB, and so on. If we bring the interface down and up again, RAL/RAH registers are configured so filter index 1 has address ending in DD, filter index 2 has CC, and so on. IOW, in reverse order we had before bringing the interface down. This issue can be fixed by traversing adapter->nfc_rule_list in backwards when restoring the rules. Since hlist doesn't support backwards traversal, this patch replaces it by list_head and fixes igc_restore_nfc_rules() accordingly. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 39707c16e6b34fb70b3f170d5733245256d768e5 Author: Andre Guedes Date: Fri Apr 24 13:16:16 2020 -0700 igc: Fix NFC rules with multicast addresses Multicast MAC addresses are valid address for NFC rules but igc_add_mac_filter() is currently rejecting them. In fact, the I225 controller doesn't impose any constraint on the address value so this patch gets rid of the address validation check in MAC filter APIs. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 4bdf89e85ed3881e8c40510ebad918dded9e5831 Author: Andre Guedes Date: Fri Apr 24 13:16:15 2020 -0700 igc: Fix NFC rule overwrite cases When the 'loc' argument is passed in ethtool, the input rule overwrites any rule present in that location. In this situation we must disable the old rule otherwise it is left enabled in hardware. This patch fixes the issue by always calling igc_disable_nfc_rule() when deleting the old rule, no matter the value of 'input' argument. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit b500350a36ae6e83a03931723b787b771f411817 Author: Andre Guedes Date: Fri Apr 24 13:16:14 2020 -0700 igc: Fix locking issue when retrieving NFC rules Access to NFC rules stored in adapter->nfc_rule_list is protect by adapter->nfc_rule_lock. The functions igc_ethtool_get_nfc_rule() and igc_ethtool_get_nfc_rules() are missing to hold the lock while accessing rule objects. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit d3ba9e6f6157e6fa047d853936dabb981e315080 Author: Andre Guedes Date: Fri Apr 24 13:16:13 2020 -0700 igc: Fix 'sw_idx' type in struct igc_nfc_rule The 'sw_idx' field from 'struct igc_nfc_rule' is u16 type but it is assigned an u32 value in igc_ethtool_init_nfc_rule(). This patch changes 'sw_idx' type to u32 so they match. Also, it makes more sense to call this field 'location' since it holds the NFC rule location. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 16fdc16c6bff6764fc8c9a5f10640dfdb7ce201a Author: Andre Guedes Date: Fri Apr 24 13:16:12 2020 -0700 igc: Refactor igc_ethtool_add_nfc_rule() Current implementation of igc_ethtool_add_nfc_rule() is quite long and a bit convoluted so this patch does a code refactoring to improve the code. Code related to NFC rule object initialization is refactored out to the local helper function igc_ethtool_init_nfc_rule(). Likewise, code related to NFC rule validation is refactored out to another local helper, igc_ethtool_is_nfc_rule_valid(). RX_CLS_FLOW_DISC check is removed since it is redundant. The macro is defined as the max value fsp->ring_cookie can have, so checking if fsp->ring_cookie >= adapter->num_rx_queues is already sufficient. Finally, some log messages are improved or added, and obvious comments are removed. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 582234b465edfa12835b20477c0aa2bc91a02e18 Author: Eli Cohen Date: Wed Apr 8 09:01:33 2020 +0300 net/mlx5e: Support pedit on mpls over UDP decap Allow to modify ethernet headers while decapsulating mpls over UDP packets. This is implemented using the same reformat object used for decapsulation. Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit 14e6b038afa014ac2288a2f3d692697f708ba344 Author: Eli Cohen Date: Mon Feb 3 13:44:14 2020 +0200 net/mlx5e: Add support for hw decapsulation of MPLS over UDP MPLS over UDP is supported in hardware by using a packet reformat object with reformat type equal L3_TUNNEL_TO_L2 which both decapsulates the outer L3, L4 and MPLS headers, and allows for setting the L2 headers of the resulting decapsulated packet. For the hardware to operate correctly, the configuration of the firmware must have FLEX_PARSER_PROFILE_ENABLE = 1. Example tc rule: tc filter add dev bareudp0 protocol all prio 1 root flower enc_dst_port \ 6635 enc_src_ip 8.8.8.23 action mpls pop protocol ip pipe \ action pedit ex munge eth dst set 00:11:22:33:44:21 pipe action \ mirred egress redirect dev enp59s0f0_0 We use pedit to set the correct destination MAC. For MPLS over UDP decapsulation to take place, the driver logic requires the following: 1. flower filter added on bareudp device. 2. action mpls pop 3. zero or more pedit munge actions 4. one redirect action Current implementation supports only IPv4 and no VLAN. tc filter show output looks like this: filter protocol all pref 1 flower chain 0 filter protocol all pref 1 flower chain 0 handle 0x1 enc_src_ip 8.8.8.24 enc_dst_port 6635 in_hw in_hw_count 1 action order 1: mpls pop protocol ip pipe index 2 ref 1 bind 1 action order 2: pedit action pipe keys 2 index 1 ref 1 bind 1 key #0 at eth+0: val 00112233 mask 00000000 key #1 at eth+4: val 44210000 mask 0000ffff action order 3: mirred (Egress Redirect to device enp59s0f0_0) stolen index 2 ref 1 bind 1 Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Reviewed-by: Eli Britstein Reviewed-by: Vlad Buslov Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit 72046a91d13469ef35885323a84938dce35ade94 Author: Eli Cohen Date: Wed Jan 29 16:21:16 2020 +0200 net/mlx5e: Allow to match on mpls parameters Support matching on MPLS over UDP parameters using misc2 section of match parameters. Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit f828ca6a2fb6f6c861e5113d3c91d3bca68db28e Author: Eli Cohen Date: Sun Nov 17 15:32:24 2019 +0200 net/mlx5e: Add support for hw encapsulation of MPLS over UDP MPLS over UDP is supported by adding a rule on a representor net device which does tunnel_key set, push mpls and forward to a baredup device. At the hardware level we use a packet_reformat_context object to do the encapsulation of the packet. The resulting packet looks as follows (left side transmitted first): outer L2 | outer IP | UDP | MPLS | inner L3 and data | Example usage: tc filter add dev $rep0 protocol ip prio 1 root flower skip_sw \ action tunnel_key set src_ip 8.8.8.21 dst_ip 8.8.8.24 id 555 \ dst_port 6635 tos 4 ttl 6 csum action mpls push protocol 0x8847 \ label 555 tc 3 action mirred egress redirect dev bareudp0 This is how the filter is shown with tc filter show: tc filter show dev enp59s0f0_0 ingress filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 skip_sw in_hw in_hw_count 1 action order 1: tunnel_key set src_ip 8.8.8.21 dst_ip 8.8.8.24 key_id 555 dst_port 6635 csum tos 0x4 ttl 6 pipe index 1 ref 1 bind 1 action order 2: mpls push protocol mpls_uc label 555 tc 3 ttl 255 pipe index 1 ref 1 bind 1 action order 3: mirred (Egress Redirect to device bareudp0) stolen index 1 ref 1 bind 1 Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit d43600c01c4c69f9d0ac4626f03599196b845ce1 Author: Eli Cohen Date: Sun Nov 17 14:35:42 2019 +0200 net: Add netif_is_bareudp() API to identify bareudp devices Add netif_is_bareudp() so the device can be identified as a bareudp one. Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Reviewed-by: Eli Britstein Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit d956873f908cff46dd55976dbd9442a027e9d9d1 Author: Vlad Buslov Date: Tue May 12 18:24:11 2020 +0300 net/mlx5e: Introduce kconfig var for TC support In order to improve code maintainability and readability, introduce new CONFIG_MLX5_CLS_ACT kconfig variable to control compilation of TC hardware offloads implementation. This allows distinguishing between features that require TC support (MPLSoUDP, etc.) and features that just rely on representor functionality (rep_bond for live migration, etc.). Modify rep_tc.h, rep_neigh.h, en_tc.h and chains.h files to provide stubs for functions that are called from generic code. Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit e2394a61d243d74ec7d0bfd4c6e25171fba54caa Author: Vlad Buslov Date: Tue May 12 18:08:41 2020 +0300 net/mlx5e: Move TC-specific code from en_main.c to en_tc.c As a preparation for introducing new kconfig option that controls compilation of all TC offloads code in mlx5, extract TC-specific code from en_main.c to en_tc.c. This allows easily compiling out the code by only including new source in make file when corresponding kconfig is enabled instead of adding multiple ifdef blocks to en_main. Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 549c243e4e010067a075e248f4d72e8dda844e12 Author: Vlad Buslov Date: Tue May 12 17:29:22 2020 +0300 net/mlx5e: Extract neigh-specific code from en_rep.c to rep/neigh.c As a preparation for introducing new kconfig option that controls compilation of all TC offloads code in mlx5, extract neigh-specific code from en_rep.c to standalone file. This allows easily compiling out the code by only including new source in make file when corresponding kconfig is enabled instead of adding multiple ifdef blocks to en_rep. Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 768c3667e6f36bc9db0dac854aa198651b27412f Author: Vlad Buslov Date: Tue May 12 16:41:41 2020 +0300 net/mlx5e: Extract TC-specific code from en_rep.c to rep/tc.c As a preparation for introducing new kconfig option that controls compilation of all TC offloads code in mlx5, extract TC-specific code from en_rep.c to standalone file. This allows easily compiling out the code by only including new source in make file when corresponding kconfig is enabled instead of adding multiple ifdef blocks to en_rep. Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 2639324a8fb69e1db88ef985e7def18a6bc106d1 Author: Tang Bin Date: Sat May 16 07:06:33 2020 +0800 net/mlx5e: Use IS_ERR() to check and simplify code Use IS_ERR() and PTR_ERR() instead of PTR_ERR_OR_ZERO() to simplify code, avoid redundant judgements. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 1e6a705266409e0dbe020ac10107d265b73e5ca9 Merge: a74707396c91 4fb13499d3a0 Author: David S. Miller Date: Fri May 22 16:17:15 2020 -0700 Merge branch 'bridge-mrp-Add-br_mrp_unique_ifindex-function' Horatiu Vultur says: ==================== bridge: mrp: Add br_mrp_unique_ifindex function This patch series adds small fixes to MRP implementation. The following are fixed in this patch series: - now is not allow to add the same port to multiple MRP rings - remove unused variable - restore the port state according to the bridge state when the MRP instance is deleted v2: - use rtnl_dereference instead of rcu_dereference in the first patch ==================== Signed-off-by: David S. Miller commit 4fb13499d3a0cc74cf9820c052481f0ccda2bb23 Author: Horatiu Vultur Date: Thu May 21 23:19:07 2020 +0000 bridge: mrp: Restore port state when deleting MRP instance When a MRP instance is deleted, then restore the port according to the bridge state. If the bridge is up then the ports will be in forwarding state otherwise will be in disabled state. Fixes: 9a9f26e8f7ea ("bridge: mrp: Connect MRP API with the switchdev API") Acked-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 89c1e111cb4860b51efef50474cd259c2702edc6 Author: Horatiu Vultur Date: Thu May 21 23:19:06 2020 +0000 switchdev: mrp: Remove the variable mrp_ring_state Remove the variable mrp_ring_state from switchdev_attr because is not used anywhere. The ring state is set using SWITCHDEV_OBJ_ID_RING_STATE_MRP. Fixes: c284b5459008 ("switchdev: mrp: Extend switchdev API to offload MRP") Acked-by: Ivan Vecera Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 7aa38018be1fa4cff3e631f26bc821086ba90d29 Author: Horatiu Vultur Date: Thu May 21 23:19:05 2020 +0000 bridge: mrp: Add br_mrp_unique_ifindex function It is not allow to have the same net bridge port part of multiple MRP rings. Therefore add a check if the port is used already in a different MRP. In that case return failure. Fixes: 9a9f26e8f7ea ("bridge: mrp: Connect MRP API with the switchdev API") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit a74707396c9185cbbca0ae0a115b95b5a8b6bfa1 Merge: 593532668f63 0eaf8ccf2047 Author: David S. Miller Date: Fri May 22 16:13:10 2020 -0700 Merge branch 'DP83869-Enhancements' Dan Murphy says: ==================== DP83869 Enhancements These are improvements to the DP83869 Ethernet PHY driver. OP-mode and port mirroring may be strapped on the device but the software only retrives these settings from the device tree. Reading the straps and initializing the associated stored variables so when setting the PHY up and down the PHY's configuration values will be retained. ==================== Signed-off-by: David S. Miller commit 0eaf8ccf2047d60f8725d3cfa005ee6170f1fdce Author: Dan Murphy Date: Thu May 21 12:47:38 2020 -0500 net: phy: dp83869: Set opmode from straps If the op-mode for the device is not set in the device tree then set the strapped op-mode and store it for later configuration. Reviewed-by: Florian Fainelli Signed-off-by: Dan Murphy Signed-off-by: David S. Miller commit c4566aec6e8088b28687d006a48469498b9f2af8 Author: Dan Murphy Date: Thu May 21 12:47:37 2020 -0500 net: phy: dp83869: Update port-mirroring to read straps The device tree may not have the property set for port mirroring because the hardware may have it strapped. If the property is not in the DT then check the straps and set the port mirroring bit appropriately. Reviewed-by: Florian Fainelli Signed-off-by: Dan Murphy Signed-off-by: David S. Miller commit a5dfaa2ab94057dd75c7911143482a0a85593c14 Author: Alan Maguire Date: Fri May 22 12:36:29 2020 +0100 selftests/bpf: CONFIG_LIRC required for test_lirc_mode2.sh test_lirc_mode2.sh assumes presence of /sys/class/rc/rc0/lirc*/uevent which will not be present unless CONFIG_LIRC=y Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program") Signed-off-by: Alan Maguire Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1590147389-26482-3-git-send-email-alan.maguire@oracle.com commit 3c8e8cf4b18b3a7034fab4c4504fc4b54e4b6195 Author: Alan Maguire Date: Fri May 22 12:36:28 2020 +0100 selftests/bpf: CONFIG_IPV6_SEG6_BPF required for test_seg6_loop.o test_seg6_loop.o uses the helper bpf_lwt_seg6_adjust_srh(); it will not be present if CONFIG_IPV6_SEG6_BPF is not specified. Fixes: b061017f8b4d ("selftests/bpf: add realistic loop tests") Signed-off-by: Alan Maguire Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1590147389-26482-2-git-send-email-alan.maguire@oracle.com commit 6736aa793c2b5fb6c64884d2623c66aa1b9bfa92 Author: Alan Maguire Date: Fri May 22 12:24:34 2020 +0100 selftests/bpf: Add general instructions for test execution Getting a clean BPF selftests run involves ensuring latest trunk LLVM/clang are used, pahole is recent (>=1.16) and config matches the specified config file as closely as possible. Add to bpf_devel_QA.rst and point tools/testing/selftests/bpf/README.rst to it. Signed-off-by: Alan Maguire Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1590146674-25485-1-git-send-email-alan.maguire@oracle.com commit e9e4ef9116b12951eaee3f8447ba9bbb40ab3620 Author: YueHaibing Date: Fri May 8 22:09:47 2020 +0800 soc: fsl: dpio: Remove unused inline function qbman_write_eqcr_am_rt_register There's no callers in-tree anymore since commit 3b2abda7d28c ("soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue") Signed-off-by: YueHaibing Signed-off-by: Li Yang commit 593532668f635d19d207510e0fbb5c2250f56b6f Author: David S. Miller Date: Fri May 22 16:09:42 2020 -0700 Revert "net: mvneta: speed down the PHY, if WoL used, to save energy" This reverts commit 5e3768a436bb70c9c3e27aaba6b73f8ef8f5dcf3. On request from Russell King, this is a layering violation. Signed-off-by: David S. Miller commit 2adf5352a34ac65a776d709607939bc82cf9819e Author: Max Filippov Date: Fri May 22 11:40:20 2020 -0700 xtensa: add missing __user annotations to asm/uaccess.h clear_user, strncpy_user, strnlen_user and their helpers operate on user pointers, but don't have their arguments marked as __user. Add __user annotation to userspace pointers of those functions. Fix open-coded access check in the strnlen_user while at it. Signed-off-by: Max Filippov commit 9afcc71b4f85ee9c9604c9b8349bac0eed44aa63 Author: Max Filippov Date: Fri May 22 15:52:03 2020 -0700 xtensa: fix error paths in __get_user_{check,size} Error paths in __get_user_check and __get_user_size directly assing 0 to the result. It causes the following sparse warnings: sparse: warning: Using plain integer as NULL pointer Convert 0 to the type pointed to by the user pointer before assigning it. Signed-off-by: Max Filippov commit 93a09e74574b2b75319938ef4155fe841335e436 Author: Potnuri Bharat Teja Date: Thu May 21 16:04:29 2020 +0530 cxgb4: add adapter hotplug support for ULDs Upon adapter hotplug, cxgb4 registers ULD devices for all the ULDs that are already loaded, ensuring that ULD's can enumerate the hotplugged adapter without reloading the ULD. Signed-off-by: Potnuri Bharat Teja Signed-off-by: David S. Miller commit b25511ef134af3b2926d5c79141c9dbabe416f02 Author: Colin Ian King Date: Fri Mar 27 16:13:49 2020 +0000 soc: fsl: qe: clean up an indentation issue There is a statement that not indented correctly, remove the extraneous space. Signed-off-by: Colin Ian King Signed-off-by: Li Yang commit d0bab301a0462ae46f65fea0af01b938d709aba7 Author: Roy Pledge Date: Fri Apr 24 14:51:12 2020 +0300 soc: fsl: dpio: Prefer the CPU affine DPIO Use the cpu affine DPIO unless there isn't one which can happen if less DPIOs than cores are assign to the kernel. Signed-off-by: Roy Pledge Signed-off-by: Ioana Ciornei Signed-off-by: Li Yang commit 060b6381efe58478e1d7dfff7a1e76a73a6377db Author: Edward Cree Date: Wed May 20 19:18:10 2020 +0100 net: flow_offload: simplify hw stats check handling Make FLOW_ACTION_HW_STATS_DONT_CARE be all bits, rather than none, so that drivers and __flow_action_hw_stats_check can use simple bitwise checks. Pre-fill all actions with DONT_CARE in flow_rule_alloc(), rather than relying on implicit semantics of zero from kzalloc, so that callers which don't configure action stats themselves (i.e. netfilter) get the correct behaviour by default. Only the kernel's internal API semantics change; the TC uAPI is unaffected. v4: move DONT_CARE setting to flow_rule_alloc() for robustness and simplicity. v3: set DONT_CARE in nft and ct offload. v2: rebased on net-next, removed RFC tags. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit df0651f8c0cc29603598f1de99426fd862365fc2 Merge: 87566b446b77 1515aa70c041 Author: David S. Miller Date: Fri May 22 15:49:31 2020 -0700 Merge branch 'ip6_tunnel-add-MPLS-support' Vadim Fedorenko says: ==================== ip6_tunnel: add MPLS support The support for MPLS-in-IPv4 was added earlier. This patchset adds support for MPLS-in-IPv6. Changes in v2: - Eliminate ifdefs IS_ENABLE(CONFIG_MPLS) ==================== Signed-off-by: David S. Miller commit 1515aa70c04151676a7dfefecfcf1d36ff52bc67 Author: Vadim Fedorenko Date: Wed May 20 18:21:39 2020 +0300 mpls: Add support for IPv6 tunnels Add support for IPv6 tunnel devices in AF_MPLS. Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit f200e98d9716ce52464838dbaa2856e5ecc52194 Author: Vadim Fedorenko Date: Wed May 20 18:21:38 2020 +0300 ip6_tunnel: add generic MPLS receive support Add support for MPLS in receive side. Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit f234efac2c6220f32cbc446e75dc1d27b04166c3 Author: Vadim Fedorenko Date: Wed May 20 18:21:37 2020 +0300 tunnel6: support for IPPROTO_MPLS This patch is just preparation for MPLS support in ip6_tunnel Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit 6c11fbf97e69d2164406fc634758f90d34501ece Author: Vadim Fedorenko Date: Wed May 20 18:21:36 2020 +0300 ip6_tunnel: add MPLS transmit support Add ETH_P_MPLS_UC as supported protocol. Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit e7bb18e6c8b7ed35746af8c7c708447a66ee385c Author: Vadim Fedorenko Date: Wed May 20 18:21:35 2020 +0300 ip6_tunnel: simplify transmit path Merge ip{4,6}ip6_tnl_xmit functions into one universal ipxip6_tnl_xmit in preparation for adding MPLS support. Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit 9bdf64b35117cc10813d24e1842cd8ee40ecbf19 Author: Vitor Massaru Iha Date: Tue Apr 14 20:37:53 2020 -0300 kunit: use KUnit defconfig by default To improve the usability of KUnit, defconfig is used by default if no kunitconfig is present. * https://bugzilla.kernel.org/show_bug.cgi?id=205259 Fixed up minor merge conflicts - Shuah Khan Signed-off-by: Vitor Massaru Iha Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 809eb4e9bf9d84eb5b703358afd0d564d514f6d2 Author: Geert Uytterhoeven Date: Tue May 19 10:11:01 2020 +0200 dt-bindings: timer: Add renesas,em-sti bindings Document Device Tree bindings for the Renesas EMMA Mobile System Timer. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200519081101.28973-1-geert+renesas@glider.be commit 7a3768c206a006525afc090f92d4d618d8356b92 Author: Saravana Kannan Date: Tue Mar 24 12:53:02 2020 -0700 clocksource/drivers/timer-versatile: Clear OF_POPULATED flag The commit 4f41fe386a94 ("clocksource/drivers/timer-probe: Avoid creating dead devices") broke the handling of arm,vexpress-sysreg [1]. The arm,vexpress-sysreg device is handled by both timer-versatile.c and drivers/mfd/vexpress-sysreg.c. While the timer driver doesn't use the device, the mfd driver still needs a device to probe. So, this patch clears the OF_POPULATED flag to continue creating the device. [1] - https://lore.kernel.org/lkml/20200324175955.GA16972@arm.com/ Fixes: 4f41fe386a94 ("clocksource/drivers/timer-probe: Avoid creating dead devices") Signed-off-by: Saravana Kannan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200324195302.203115-1-saravanak@google.com commit 7d7de1a65349811b24971c5e8e040e6aac192dd4 Author: Serge Semin Date: Thu May 21 23:48:17 2020 +0300 clocksource: mips-gic-timer: Mark GIC timer as unstable if ref clock changes Currently clocksource framework doesn't support the clocks with variable frequency. Since MIPS GIC timer ticks rate might be unstable on some platforms, we must make sure that it justifies the clocksource requirements. MIPS GIC timer is incremented with the CPU cluster reference clocks rate. So in case if CPU frequency changes, the MIPS GIC tick rate changes synchronously. Due to this the clocksource subsystem can't rely on the timer to measure system clocks anymore. This commit marks the MIPS GIC based clocksource as unstable if reference clock (normally it's a CPU reference clocks) rate changes. The clocksource will execute a watchdog thread, which lowers the MIPS GIC timer rating to zero and fallbacks to a new stable one. Note we don't need to set the CLOCK_SOURCE_MUST_VERIFY flag to the MIPS GIC clocksource since normally the timer is stable. The only reason why it gets unstable is due to the ref clock rate change, which event we detect here in the driver by means of the clocks event notifier. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-9-Sergey.Semin@baikalelectronics.ru commit 48016e78d328998b1f00bcfb639adeabca51abe5 Author: Paul Burton Date: Thu May 21 23:48:16 2020 +0300 clocksource: mips-gic-timer: Register as sched_clock The MIPS GIC timer is well suited for use as sched_clock, so register it as such. Whilst the existing gic_read_count() function matches the prototype needed by sched_clock_register() already, we split it into 2 functions in order to remove the need to evaluate the mips_cm_is64 condition within each call since sched_clock should be as fast as possible. Note the sched clock framework needs the clock source being stable in order to rely on it. So we register the MIPS GIC timer as schedule clocks only if it's, if either the system doesn't have CPU-frequency enabled or the CPU frequency is changed by means of the CPC core clock divider available on the platforms with CM3 or newer. Signed-off-by: Paul Burton Co-developed-by: Serge Semin [Sergey.Semin@baikalelectronics.ru: Register sched-clock if CM3 or !CPU-freq] Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Ralf Baechle Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-8-Sergey.Semin@baikalelectronics.ru commit 6d2e16a3181bafb77b535095c39ad1c8b9558c8c Author: Serge Semin Date: Thu May 21 23:48:15 2020 +0300 clocksource: dw_apb_timer_of: Fix missing clockevent timers Commit 100214889973 ("clocksource: dw_apb_timer_of: use clocksource_of_init") replaced a publicly available driver initialization method with one called by the timer_probe() method available after CLKSRC_OF. In current implementation it traverses all the timers available in the system and calls their initialization methods if corresponding devices were either in dtb or in acpi. But if before the commit any number of available timers would be installed as clockevent and clocksource devices, after that there would be at most two. The rest are just ignored since default case branch doesn't do anything. I don't see a reason of such behaviour, neither the commit message explains it. Moreover this might be wrong if on some platforms these timers might be used for different purpose, as virtually CPU-local clockevent timers and as an independent broadcast timer. So in order to keep the compatibility with the platforms where the order of the timers detection has some meaning, lets add the secondly discovered timer to be of clocksource/sched_clock type, while the very first and the others would provide the clockevents service. Fixes: 100214889973 ("clocksource: dw_apb_timer_of: use clocksource_of_init") Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-7-Sergey.Semin@baikalelectronics.ru commit 65e0f876405ef4f0ff25eb1c5ff3e9b536d68805 Author: Serge Semin Date: Thu May 21 23:48:14 2020 +0300 clocksource: dw_apb_timer: Affiliate of-based timer with any CPU Currently any DW APB Timer device detected in OF is bound to CPU #0. Doing so is redundant since DW APB Timer isn't CPU-local timer, but as having APB interface is normally accessible from any CPU in the system. By artificially affiliating the DW timer to the very first CPU we may and in our case will make the clockevent subsystem to decline the more performant real CPU-local timers selection in favor of in fact non-local and accessible over a slow bus - DW APB Timers. Let's not affiliate the of-detected DW APB Timers to any CPU. By doing so the clockevent framework would prefer to select the real CPU-local timer instead of DW APB one. Otherwise if there is no other than DW APB device for clockevents tracking then it will be selected. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-6-Sergey.Semin@baikalelectronics.ru commit cee43dbf2ee3f430434e2b66994eff8a1aeda889 Author: Serge Semin Date: Thu May 21 23:48:13 2020 +0300 clocksource: dw_apb_timer: Make CPU-affiliation being optional Currently the DW APB Timer driver binds each clockevent timers to a particular CPU. This isn't good for multiple reasons. First of all seeing the device is placed on APB bus (which makes it accessible from any CPU core), accessible over MMIO and having the DYNIRQ flag set we can be sure that manually binding the timer to any CPU just isn't correct. By doing so we just set an extra limitation on device usage. This also doesn't reflect the device actual capability, since by setting the IRQ affinity we can make it virtually local to any CPU. Secondly imagine if you had a real CPU-local timer with the same rating and the same CPU-affinity. In this case if DW APB timer was registered first, then due to the clockevent framework tick-timer selection procedure we'll end up with the real CPU-local timer being left unselected for clock-events tracking. But on most of the platforms (MIPS/ARM/etc) such timers are normally embedded into the CPU core and are accessible with much better performance then devices placed on APB. For instance in MIPS architectures there is r4k-timer, which is CPU-local, assigned with the same rating, and normally its clockevent device is registered after the platform-specific one. So in order to fix all of these issues let's make the DW APB Timer CPU affinity being optional and deactivated by passing a negative CPU id, which will effectively set the DW APB clockevent timer cpumask to 'cpu_possible_mask'. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-5-Sergey.Semin@baikalelectronics.ru commit e69bc8999662a3fa6d856820dd09717afff1cbb0 Author: Serge Semin Date: Thu May 21 23:48:11 2020 +0300 dt-bindings: timer: Move snps,dw-apb-timer DT schema from rtc This binding file doesn't belong to the rtc seeing it's a pure timer with no rtc facilities like days/months/years counting and alarms. So move the YAML-file to the Documentation/devicetree/bindings/timer/ directory. Signed-off-by: Serge Semin Acked-by: Alexandre Belloni Acked-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-3-Sergey.Semin@baikalelectronics.ru commit b33aaf5cd68d0fa0f0d6aa15831a1e82e2ef98e1 Author: Serge Semin Date: Thu May 21 23:48:10 2020 +0300 dt-bindings: rtc: Convert snps,dw-apb-timer to DT schema Modern device tree bindings are supposed to be created as YAML-files in accordance with DT schema. This commit replaces Synopsys DW Timer legacy bare text binding with YAML file. As before the binding file states that the corresponding dts node is supposed to be compatible with generic DW APB Timer indicated by the "snps,dw-apb-timer" compatible string and to provide a mandatory registers memory range, one timer interrupt, either reference clock source or a fixed clock rate value. It may also have an optional APB bus reference clock phandle specified. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Thomas Gleixner Cc: Daniel Lezcano Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200521204818.25436-2-Sergey.Semin@baikalelectronics.ru commit 264418e20d1fedbed8ad79683b63caa3d72c3b2e Author: Lokesh Vutla Date: Mon Apr 27 22:58:31 2020 +0530 clocksource/drivers/timer-ti-dm: Do one override clock parent in prepare() omap_dm_timer_prepare() is setting up the parent 32KHz clock. This prepare() gets called by request_timer in the client's driver. Because of this, the timer clock parent that is set with assigned-clock-parent is being overwritten. So drop this default setting of parent in prepare(). Signed-off-by: Lokesh Vutla Reviewed-by: Suman Anna Acked-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200427172831.16546-1-lokeshvutla@ti.com commit b4d86d1994725b468772975f6294d37515e66dcc Merge: ac593e62b0cf ac819eda7cc9 Author: Daniel Lezcano Date: Sat May 23 00:01:50 2020 +0200 Merge branch 'omap-for-v5.8/dt-timer' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into timers/drivers/next commit ac593e62b0cfcbc53502be8b6c7e40fed8baff8c Author: Colin Ian King Date: Tue May 19 23:44:28 2020 +0100 clocksource/drivers/timer-ti-dm: Fix spelling mistake "detectt" -> "detect" There is a spelling mistake in a pr_err message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200519224428.6195-1-colin.king@canonical.com commit 1f422417945d08731e2915e0addb976f11b3a85a Merge: c177e2975430 6d15120b282e Author: Daniel Lezcano Date: Sat May 23 00:01:13 2020 +0200 Merge branch 'timers/drivers/timer-ti' into timers/drivers/next commit c177e2975430cec296aa52a0d413e447417d6cf9 Author: Tony Lindgren Date: Tue May 19 08:51:57 2020 -0700 clocksource/drivers/timer-ti-dm: Fix warning for set but not used We can get a warning for dmtimer_clocksource_init() with 'pa' set but not used. This was used in the earlier revisions of the code but no longer needed, so let's remove the unused pa and of_translate_address(). Let's also do it for dmtimer_clockevent_init() that has a similar issue. Reported-by: kbuild test robot Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200519155157.12804-1-tony@atomide.com commit 52762fbd1c4778ac9b173624ca0faacd22ef4724 Author: Tony Lindgren Date: Thu May 7 10:23:18 2020 -0700 clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support We can move the TI dmtimer clockevent and clocksource to live under drivers/clocksource if we rely only on the clock framework, and handle the module configuration directly in the clocksource driver based on the device tree data. This removes the early dependency with system timers to the interconnect related code, and we can probe pretty much everything else later on at the module_init level. Let's first add a new driver for timer-ti-dm-systimer based on existing arch/arm/mach-omap2/timer.c. Then let's start moving SoCs to probe with device tree data while still keeping the old timer.c. And eventually we can just drop the old timer.c. Let's take the opportunity to switch to use readl/writel as pointed out by Daniel Lezcano . This allows further clean-up of the timer-ti-dm code the a lot of the shared helpers can just become static to the non-syster related code. Note the boards can optionally configure different timer source clocks if needed with assigned-clocks and assigned-clock-parents. Cc: linux-kernel@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Cc: Thomas Gleixner Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200507172330.18679-3-tony@atomide.com commit 46b30515f97ece3da661b251e4a0ad9ac7a338d3 Author: Tony Lindgren Date: Thu May 7 10:23:17 2020 -0700 clocksource/drivers/timer-ti-32k: Add support for initializing directly Let's allow probing the 32k counter directly based on devicetree data to prepare for dropping the related legacy platform code. Let's only do this if the parent node is compatible with ti-sysc to make sure we have the related devicetree data available. Let's also show the 32k counter information before registering the clocksource, now we see it after the clocksource information which is a bit confusing. Cc: linux-kernel@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Cc: Thomas Gleixner Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200507172330.18679-2-tony@atomide.com commit d1b5e55208fd8e1c73876ab6ad1ce93485e3f5a2 Author: Dejin Zheng Date: Wed Apr 29 23:35:59 2020 +0800 drivers/clocksource/arm_arch_timer: Remove duplicate error message The function acpi_gtdt_init() prints a message in case of error. Remove the error message after testing if the function fails, otherwise it is a duplicate message. Signed-off-by: Dejin Zheng Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200429153559.21189-1-zhengdejin5@gmail.com commit 311fb70aa55174ddebb5c6022b23e58b85e9f116 Author: Dejin Zheng Date: Wed Apr 29 23:12:23 2020 +0800 clocksource/drivers/arc_timer: Remove duplicate error message The function arc_get_timer_clk() prints an error message if it fails, remove the second error message if the function fails. Signed-off-by: Dejin Zheng Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200429151223.3120-1-zhengdejin5@gmail.com commit 83cba9536905e4f82b726a98fe404400f0c9eb76 Author: Johan Hovold Date: Wed May 13 14:25:48 2020 +0200 clocksource/drivers/rda: drop redundant Kconfig dependency Since commit 2f8a26c166eb ("clocksource: Improve GENERIC_CLOCKEVENTS dependency") all clocksource drivers depend on GENERIC_CLOCKEVENTS so drop the redundant attribute from the RDA-timer entry which was added later. Signed-off-by: Johan Hovold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200513122548.16974-1-johan@kernel.org commit 162b323c3d0820617289bd67d1895d5e7541cc3a Author: YueHaibing Date: Fri May 8 22:08:46 2020 +0800 soc: fsl: qbman: Remove unused inline function qm_eqcr_get_ci_stashing There's no callers in-tree anymore. Signed-off-by: YueHaibing Signed-off-by: Li Yang commit c22f9075044057f130f6b73a0638a2eb78f459ad Author: Max Filippov Date: Fri May 22 13:20:05 2020 -0700 xtensa: fix type conversion in __get_user_size 8-byte access in __get_user_size converts pointer to temporary variable to the type of original user pointer and then dereferences it, resulting in the following sparse warning: sparse: warning: dereference of noderef expression Instead dereference the original user pointer under the __typeof__ and add indirection outside. Signed-off-by: Max Filippov commit 3ac4a615bdb10ee7df8818ff107f974322e4c190 Author: Max Filippov Date: Fri May 22 10:54:32 2020 -0700 xtensa: add missing __user annotations to __{get,put}_user_check __get_user_check and __put_user_check use temporary pointer but don't mark it as __user, resulting in sparse warnings: sparse: warning: incorrect type in initializer (different address spaces) sparse: expected long *__pu_addr sparse: got long [noderef] *ret sparse: warning: incorrect type in argument 1 (different address spaces) sparse: expected void [noderef] *to sparse: got long *__pu_addr Add __user annotation to temporary pointer in __get_user_check and __put_user_check. Reported-by: kbuild test robot Reported-by: Arnd Bergmann Signed-off-by: Max Filippov commit 661ea25e5319d0ceaeba80dbc2e083245d91f57a Author: Gustavo A. R. Silva Date: Mon May 18 17:19:04 2020 -0500 soc: fsl: qe: Replace one-element array and use struct_size() helper The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size; memcpy(instance->data, source, size); but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. So, replace the one-element array with a flexible-array member. Also, make use of the new struct_size() helper to properly calculate the size of struct qe_firmware. This issue was found with the help of Coccinelle and, audited and fixed _manually_. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Qiang Zhao Signed-off-by: Li Yang commit 87566b446b77fdd20a36832511a70ffe3227091e Merge: 199671eadd47 4e4ad6862de5 Author: David S. Miller Date: Fri May 22 14:20:12 2020 -0700 Merge branch 'mediatek-add-support-for-MediaTek-Ethernet-MAC' Bartosz Golaszewski says: ==================== mediatek: add support for MediaTek Ethernet MAC This series adds support for the STAR Ethernet Controller present on MediaTeK SoCs from the MT8* family. First we convert the existing DT bindings for the PERICFG controller to YAML and add a new compatible string for mt8516 variant of it. Then we add the DT bindings for the MAC. Next we do some cleanup of the mediatek ethernet drivers directory. The largest patch in the series adds the actual new driver. The rest of the patches add DT fixups for the boards already supported upstream. v1 -> v2: - add a generic helper for retrieving the net_device associated with given private data - fix several typos in commit messages - remove MTK_MAC_VERSION and don't set the driver version - use NET_IP_ALIGN instead of a magic number (2) but redefine it as it defaults to 0 on arm64 - don't manually turn the carrier off in mtk_mac_enable() - process TX cleanup in napi poll callback - configure pause in the adjust_link callback - use regmap_read_poll_timeout() instead of handcoding the polling - use devres_find() to verify that struct net_device is managed by devres in devm_register_netdev() - add a patch moving all networking devres helpers into net/devres.c - tweak the dma barriers: remove where unnecessary and add comments to the remaining barriers - don't reset internal counters when enabling the NIC - set the net_device's mtu size instead of checking the framesize in ndo_start_xmit() callback - fix a race condition in waking up the netif queue - don't emit log messages on OOM errors - use dma_set_mask_and_coherent() - use eth_hw_addr_random() - rework the receive callback so that we reuse the previous skb if unmapping fails, like we already do if skb allocation fails - rework hash table operations: add proper timeout handling and clear bits when appropriate v2 -> v3: - drop the patch adding priv_to_netdev() and store the netdev pointer in the driver private data - add an additional dma_wmb() after reseting the descriptor in mtk_mac_ring_pop_tail() - check the return value of dma_set_mask_and_coherent() - improve the DT bindings for mtk-eth-mac: make the reg property in the example use single-cell address and size, extend the description of the PERICFG phandle and document the mdio sub-node - add a patch converting the old .txt bindings for PERICFG to yaml - limit reading the DMA memory by storing the mapped addresses in the driver private structure - add a patch documenting the existing networking devres helpers v3 -> v4: - drop the devres patches: they will be sent separately - call netdev_sent_queue() & netdev_completed_queue() where appropriate - don't redefine NET_IP_ALIGN: define a private constant in the driver - fix a couple typos - only disabe/enable the MAC in suspend/resume if netif is running - drop the count field from the ring structure and instead calculate the number of used descriptors from the tail and head indicies - rework the locking used to protect the ring structures from concurrent access: use cheaper spin_lock_bh() and completely disable the internal spinlock used by regmap - rework the interrupt handling to make it more fine-grained: onle re-enable TX and RX interrupts while they're needed, process the stats updates in a workqueue, not in napi context - shrink the code responsible for unmapping and freeing skb memory - rework the barriers as advised by Arnd v4 -> v5: - rename the driver to make it less confusing with the existing mtk_eth_soc ethernet driver - unregister the mdiobus at device's detachment - open-code spin lock calls to avoid calling the _bh variants where unnecessary - limit read-modify-write operations where possible when accessing descriptor memory - use READ_ONCE/WRITE_ONCE when modifying the status and data_ptr descriptor fields ==================== Signed-off-by: David S. Miller commit 4e4ad6862de5dda0174f3a60c98c8cded0beb64d Author: Bartosz Golaszewski Date: Fri May 22 14:07:00 2020 +0200 ARM64: dts: mediatek: enable ethernet on pumpkin boards Add remaining properties to the ethernet node and enable it. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 7c20f7f36e6a3a93dcdb9cb5d790494cd7f22a1b Author: Bartosz Golaszewski Date: Fri May 22 14:06:59 2020 +0200 ARM64: dts: mediatek: add ethernet pins for pumpkin boards Setup the pin control for the Ethernet MAC. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit b3f5758f0d59b51a95d13724c9627bce77eff139 Author: Bartosz Golaszewski Date: Fri May 22 14:06:58 2020 +0200 ARM64: dts: mediatek: add an alias for ethernet0 for pumpkin boards Add the ethernet0 alias for ethernet so that u-boot can find this node and fill in the MAC address. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit fe3b2107ae91f1c63047bafb4303c67fef1780ae Author: Bartosz Golaszewski Date: Fri May 22 14:06:57 2020 +0200 ARM64: dts: mediatek: add the ethernet node to mt8516.dtsi Add the Ethernet MAC node to mt8516.dtsi. This defines parameters common to all the boards based on this SoC. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit e56e82da172b4b17675c56dc156938d8f5f1b3c2 Author: Bartosz Golaszewski Date: Fri May 22 14:06:56 2020 +0200 ARM64: dts: mediatek: add pericfg syscon to mt8516.dtsi This adds support for the PERICFG register range as a syscon. This will soon be used by the MediaTek Ethernet MAC driver for NIC configuration. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 8c7bd5a454ffc2b0518d1499c4af95f00291d2af Author: Bartosz Golaszewski Date: Fri May 22 14:06:55 2020 +0200 net: ethernet: mtk-star-emac: new driver This adds the driver for the MediaTek STAR Ethernet MAC currently used on the MT8* SoC family. For now we only support full-duplex. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 22f076a279ecf78f4dc5697396a075651942ae5b Author: Bartosz Golaszewski Date: Fri May 22 14:06:54 2020 +0200 net: ethernet: mediatek: remove unnecessary spaces from Makefile The Makefile formatting in the kernel tree usually doesn't use tabs, so remove them before we add a second driver. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit d3d6974bc539d2a4311a20230892a5e4b2fd5e8d Author: Bartosz Golaszewski Date: Fri May 22 14:06:53 2020 +0200 net: ethernet: mediatek: rename Kconfig prompt We'll soon by adding a second MediaTek Ethernet driver so modify the Kconfig prompt. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 1d1ba1469243012ba961b887da9c12b196049b77 Author: Bartosz Golaszewski Date: Fri May 22 14:06:52 2020 +0200 dt-bindings: net: add a binding document for MediaTek STAR Ethernet MAC This adds yaml DT bindings for the MediaTek STAR Ethernet MAC present on the mt8* family of SoCs. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit fbc5d5ed96551df1700acebc5c31c8de300ccc50 Author: Bartosz Golaszewski Date: Fri May 22 14:06:51 2020 +0200 dt-bindings: add new compatible to mediatek,pericfg The PERICFG controller is present on the MT8516 SoC. Add an appropriate compatible variant. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit 9f9d1e63dc551bf2799fab2f3925cb836410c6d5 Author: Bartosz Golaszewski Date: Fri May 22 14:06:50 2020 +0200 dt-bindings: convert the binding document for mediatek PERICFG to yaml Convert the DT binding .txt file for MediaTek's peripheral configuration controller to YAML. There's one special case where the compatible has three positions. Otherwise, it's a pretty normal syscon. Signed-off-by: Bartosz Golaszewski Signed-off-by: David S. Miller commit d3e81989c0f028aa80cb97fcba83df40585b640d Author: Gustavo A. R. Silva Date: Thu May 7 13:53:01 2020 -0500 treewide: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Li Yang commit 199671eadd47181583a72b1630ee0a76a5990afe Merge: b79f91f15721 4bb7f4cf60e3 Author: David S. Miller Date: Fri May 22 14:12:49 2020 -0700 Merge branch 'ENA-features-and-cosmetic-changes' Arthur Kiyanovski says: ==================== ENA features and cosmetic changes Diff from V1 of this patchset: Removed error prints patch This patchset includes: 1. new rx offset feature 2. reduction of the driver load time 3. multiple cosmetic changes to the code ==================== Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 4bb7f4cf60e38a00965d22aa5979ab143193d41f Author: Arthur Kiyanovski Date: Fri May 22 12:09:05 2020 +0300 net: ena: reduce driver load time This commit reduces the driver load time by using usec resolution instead of msec when polling for hardware state change. Also add back-off mechanism to handle cases where minimal sleep time is not enough. Signed-off-by: Josh Triplett Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit b0ae3ac4847c6009e7b1963899cd121e84e5082a Author: Arthur Kiyanovski Date: Fri May 22 12:09:04 2020 +0300 net: ena: cosmetic: minor code changes 1. Use BIT macro instead of shift operator for code clarity 2. Replace multiple flag assignments to a single assignment of multiple flags in ena_com_add_single_rx_desc() 3. Move ENA_HASH_KEY_SIZE from ena_netdev.h to ena_com.h Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 6d0862e0ec92d05e0b5bb9e46133e7460c0c675a Author: Arthur Kiyanovski Date: Fri May 22 12:09:03 2020 +0300 net: ena: cosmetic: fix spacing issues 1. Add leading and trailing spaces to several comments for better readability 2. Make tabs and spaces uniform in enum defines in ena_admin_defs.h Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 0a39a35f3f27f833282a2a87c26894167f336ba2 Author: Arthur Kiyanovski Date: Fri May 22 12:09:02 2020 +0300 net: ena: cosmetic: code reorderings 1. Reorder sanity checks in get_comp_ctxt() to make more sense 2. Reorder variables in ena_com_fill_hash_function() and ena_calc_io_queue_size() in reverse christmas tree. 3. Move around member initializations. Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit f3020447471c40024fbb4e5d720861b25ce46717 Author: Arthur Kiyanovski Date: Fri May 22 12:09:01 2020 +0300 net: ena: cosmetic: remove unnecessary code 1. Remove unused definition of DRV_MODULE_VERSION 2. Remove {} from single line-of-code ifs 3. Remove unnecessary comments from ena_get/set_coalesce() 4. Remove unnecessary extra spaces and newlines Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 46143e58884025292bd977ca8bc0fdd9dac47c4c Author: Arthur Kiyanovski Date: Fri May 22 12:09:00 2020 +0300 net: ena: cosmetic: fix line break issues 1. Join unnecessarily broken short lines in ena_com.c ena_netdev.c 2. Fix Indentations of broken lines Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 13830937ccf68519ec3a40d8a8675af136cea8be Author: Arthur Kiyanovski Date: Fri May 22 12:08:59 2020 +0300 net: ena: cosmetic: fix spelling and grammar mistakes in comments fix spelling and grammar mistakes in comments in ena_com.h, ena_com.c and ena_netdev.c Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit ba6f6b4191f850ddf9363a4aa946f2432a28fb30 Author: Arthur Kiyanovski Date: Fri May 22 12:08:58 2020 +0300 net: ena: cosmetic: set queue sizes to u32 for consistency Make all types of variables that convey the number and sizeof queues to be u32, for consistency with the API between the driver and device via ena_admin_defs.h:ena_admin_get_feat_resp.max_queue_ext fields. Current code sometimes uses int and there are multiple assignments between these variables with different types. Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 95d0fcb5704aa179c1aa8e5ea54f7715f0252383 Author: Arthur Kiyanovski Date: Fri May 22 12:08:57 2020 +0300 net: ena: cosmetic: rename ena_update_tx/rx_rings_intr_moderation() Rename ena_update_tx/rx_rings_intr_moderation() to ena_update_tx/rx_rings_nonadaptive_intr_moderation() to distinguish between adaptive and non adaptive interrupt moderaion. Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit da447b3b542f2d89e368c8991203ae6aa025ddeb Author: Arthur Kiyanovski Date: Fri May 22 12:08:56 2020 +0300 net: ena: simplify ena_com_update_intr_delay_resolution() Initialize prev_intr_delay_resolution with ena_dev->intr_delay_resolution unconditionally, since it is initialized with ENA_DEFAULT_INTR_DELAY_RESOLUTION in ena_probe(). This approach makes much more sense than handling errors of not initializing it. Also added unlikely to if condition. Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit adb3fb388933e03c61e941bce4a0dac4a6ae98c0 Author: Arthur Kiyanovski Date: Fri May 22 12:08:55 2020 +0300 net: ena: fix ena_com_comp_status_to_errno() return value Default return value should be -EINVAL since the input in this case was unexpected. Also remove the now redundant check in the beginning of the function. Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit f391503b7a11c6ca033a6e916cee23b85e21a1f1 Author: Arthur Kiyanovski Date: Fri May 22 12:08:54 2020 +0300 net: ena: use explicit variable size for clarity Use u64 instead of unsigned long long for clarity Signed-off-by: Shai Brandes Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 7cfe9a55934627deb95da87e35c552bd6241133e Author: Arthur Kiyanovski Date: Fri May 22 12:08:53 2020 +0300 net: ena: rename ena_com_free_desc to make API more uniform Rename ena_com_free_desc to ena_com_free_q_entries to match the LLQ mode. In non-LLQ mode, an entry in an IO ring corresponds to a a descriptor. In LLQ mode an entry may correspond to several descriptors (per LLQ definition). Signed-off-by: Igor Chauskin Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 68f236df93a986379e61191157848b4e7d303285 Author: Arthur Kiyanovski Date: Fri May 22 12:08:52 2020 +0300 net: ena: add support for the rx offset feature Newer ENA devices can write data to rx buffers with an offset from the beginning of the buffer. This commit adds support for this feature in the driver. Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit b79f91f15721f3378e618c690c7ad9a477cd7900 Merge: 59b8d2770533 40f05e5b0d0e Author: David S. Miller Date: Fri May 22 14:08:29 2020 -0700 Merge branch 'net-atlantic-QoS-implementation' Igor Russkikh says: ==================== net: atlantic: QoS implementation This patch series adds support for mqprio rate limiters and multi-TC: * max_rate is supported on both A1 and A2; * min_rate is supported on A2 only; This is a joint work of Mark and Dmitry. To implement this feature, a couple of rearrangements and code improvements were done, in areas of TC/ring management, allocation control, etc. One of the problems we faced is conflicting ptp functionality, which consumes a whole traffic class due to hardware limitations. Patches below have a more detailed description on how PTP and multi-TC co-exist right now. v2: * accommodated review comments (-Wmissing-prototypes and -Wunused-but-set-variable findings); * added user notification in case of conflicting multi-TC<->PTP configuration; * added automatic PTP disabling, if a conflicting configuration is detected; * removed module param, which was used for PTP disabling in v1; v1: https://patchwork.ozlabs.org/cover/1294380/ ==================== Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 40f05e5b0d0e6ed5cc868cd09fa976495716b8f9 Author: Mark Starovoytov Date: Fri May 22 11:19:48 2020 +0300 net: atlantic: proper rss_ctrl1 (54c0) initialization This patch fixes an inconsistency between code and spec, which was found while working on the QoS implementation. When 8TCs are used, 2 is the maximum supported number of index bits. In a 4TC mode, we do support 3, but we shouldn't really use the bytes, which are intended for the 8TC mode. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 2deac71ac492a6025b163701436e0aa39435a05f Author: Mark Starovoytov Date: Fri May 22 11:19:47 2020 +0300 net: atlantic: QoS implementation: min_rate This patch adds support for mqprio min_rate limiters. A2 HW supports Weighted Strict Priority (WSP) arbitration for Tx Descriptor Queue scheduling among TCs, which can be used for min_rate shaping. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit b64f2ac9955bcd3547329c30d8f7a55f84297df8 Author: Mark Starovoytov Date: Fri May 22 11:19:46 2020 +0300 net: atlantic: change the order of arguments for TC weight/credit setters This patch changes the order of arguments for TC weight/credit setter functions. Having the "value to be set" on the right is slightly more robust in a sense that it's more natural for the humans, so it's a bit more error-proof this way. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 5479e8436f32cdbe76d63119459a7d651c1c39ed Author: Mark Starovoytov Date: Fri May 22 11:19:45 2020 +0300 net: atlantic: always use random TC-queue mapping for TX on A2. This patch changes the TC-queue mapping mechanism used on A2. Configure the A2 HW in such a way that we can keep queue index mapping exactly as it was on A1. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 14ef766b13822001087d468aa41f22caa2a42022 Author: Mark Starovoytov Date: Fri May 22 11:19:44 2020 +0300 net: atlantic: automatically downgrade the number of queues if necessary This patch adds support for automatic queue number downgrade. On A2: this is a must have, because only TC0/TC1 support more than 4Q. Other TCs support 4Qs maximum. Thus, on A2 we must downgrade the number of queues per TC to 4, if more than 2 TCs are requested. On A1: this allows using 8TCs even on systems with cpu count >= 8, when we have 8 queues by default. We will just automatically switch to 8TCx4Q mode in this case. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 7327699f35f8e90b32c03080b5cba4e9aa95e087 Author: Mark Starovoytov Date: Fri May 22 11:19:43 2020 +0300 net: atlantic: QoS implementation: max_rate This patch adds initial support for mqprio rate limiters (max_rate only). Atlantic HW supports Rate-Shaping for time-sensitive traffic at per Traffic Class (TC) granularity. Target rate is defined by: * nominal link rate (always 10G); * rate factor (ratio between nominal rate and max allowed). Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit b9e989262a3e2e9b795361a7e7978d64851eb98f Author: Mark Starovoytov Date: Fri May 22 11:19:42 2020 +0300 net: atlantic: make TCVEC2RING accept nic_cfg This patch updates TCVEC2RING to accept nic_cfg, which is needed to be able to use it from hw_atl. The name is updated to reflect the changes. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 4272ba8b11f88be8daca5e2477bfe110145d559c Author: Mark Starovoytov Date: Fri May 22 11:19:41 2020 +0300 net: atlantic: per-TC queue statistics This patch adds support for per-TC queue statistics. By default (single TC), the output is the same as it used to be, e.g.: Queue[0] InPackets: 2 Queue[0] OutPackets: 8 Queue[0] Restarts: 0 Queue[0] InJumboPackets: 0 Queue[0] InLroPackets: 0 Queue[0] InErrors: 0 If several TCs are enabled, then each queue statistics line is prefixed with TC number, e.g.: TC0 Queue[0] InPackets: 6 TC0 Queue[0] OutPackets: 11 Queue numbering is end-to-end, so: TC1 Queue[4] InPackets: 0 TC1 Queue[4] OutPackets: 22 Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit a83fe6b6ad6b10f6912025ae23bd5c2596a4e7f4 Author: Dmitry Bezrukov Date: Fri May 22 11:19:40 2020 +0300 net: atlantic: QoS implementation: multi-TC support This patch adds multi-TC support. PTP is automatically disabled when the user enables more than 2 TCs, otherwise traffic on TC2 won't quite work, because it's reserved for PTP. Signed-off-by: Dmitry Bezrukov Co-developed-by: Dmitry Bogdanov Signed-off-by: Dmitry Bogdanov Co-developed-by: Mark Starovoytov Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 0aa7bc3ee4652e0790f9b42c93c769b59b9f2308 Author: Dmitry Bezrukov Date: Fri May 22 11:19:39 2020 +0300 net: atlantic: changes for multi-TC support This patch contains the following changes: * add cfg->is_ptp (used for PTP enable/disable switch, which is described in more details below); * add cfg->tc_mode (A1 supports 2 HW modes only); * setup queue to TC mapping based on TC mode on A2; * remove hw_tx_tc_mode_get / hw_rx_tc_mode_get hw_ops. In the first generation of our hardware (A1), a whole traffic class is consumed for PTP handling in FW (FW uses it to send the ptp data and to send back timestamps). The 'is_ptp' flag introduced in this patch will be used in to automatically disable PTP when a conflicting configuration is detected, e.g. when multiple TCs are enabled. Signed-off-by: Dmitry Bezrukov Co-developed-by: Mark Starovoytov Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 593dd0fc202eed27de07c5df9ef24a3c00cf0c09 Author: Dmitry Bezrukov Date: Fri May 22 11:19:38 2020 +0300 net: atlantic: move PTP TC initialization to a separate function This patch moves the PTP TC initialization into a separate function. Signed-off-by: Dmitry Bezrukov Co-developed-by: Mark Starovoytov Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 8ce84271697a2346e88582480b26b7e244a8603a Author: Dmitry Bezrukov Date: Fri May 22 11:19:37 2020 +0300 net: atlantic: changes for multi-TC support This patch contains the following changes: * access cfg via aq_nic_get_cfg() in aq_nic_start() and aq_nic_map_skb(); * call aq_nic_get_dev() just once in aq_nic_map_skb(); * move ring allocation/deallocation out of aq_vec_alloc()/aq_vec_free(); * add the missing aq_nic_deinit() in atl_resume_common(); * rename 'tcs' field to 'tcs_max' in aq_hw_caps_s to differentiate it from the 'tcs' field in aq_nic_cfg_s, which is used for the current number of TCs; * update _TC_MAX defines to the actual number of supported TCs; * move tx_tc_mode register defines slightly higher (just to keep the order of definitions); * separate variables for TX/RX buff_size in hw_atl*_hw_qos_set(); * use AQ_HW_*_TC instead of hardcoded magic numbers; * actually use the 'ret' value in aq_mdo_add_secy(); Signed-off-by: Dmitry Bezrukov Co-developed-by: Mark Starovoytov Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 59b8d27705331fed60b7161dc38121708572672a Merge: 4001f1f02e43 5757cc7c8b71 Author: David S. Miller Date: Fri May 22 14:05:05 2020 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-21 This series contains updates to ice driver only. Several of the changes are fixes, which could be backported to stable, of which, only one was marked for stable because of the memory leak potential. Jake exposes the information in the flash memory used for link management, which is called the netlist module. Henry and Tony add support for tunnel offloads. Brett adds promiscuous support in VF's which is based on VF trust and the new vf-true-promisc flag. Avinash fixes an issue where a transmit timeout for a queue that belongs to a PFC enabled TC is not a true transmit timeout, but because the PFC is in action. Dave fixes the check for contiguous TCs to allow for various UP2TC mapping configurations. Also fixed an issue when changing the pause parameters would could multiple link drop/down's in succession, which in turn caused the firmware to not generate a link interrupt for the driver to respond to. Anirudh (Ani) fixed a potential race condition in probe/open due to a bit being cleared too early. Lihong updates an error message to make it more meaningful instead of just printing out the numerical value of the status/error code. Also fixed an incorrect return value if deleting a filter does not find a match to delete or when adding a filter that already exists. Karol fixes casting issues and precision loss in the driver. Jesse make the sign usage more consistent in the driver by making sure all instances of vf_id are unsigned, since it can never be negative. Eric fixes a potential memory leak in ice_add_prof_id_vsig() where was not cleaning up resources properly when an error occurs. Michal to help organize the filtering code in the driver, refactor the code into a separate file and add functions to prepare the filter information. Bruce cleaned up a conditional statement that always resulted in true and provided a comment to make it more obvious. Also cleaned up redundant code checks. Tony helps with potential namespace issues by renaming a 'ice' specific function with the driver name prepended. ==================== Signed-off-by: David S. Miller commit 4001f1f02e43a015d881e285759a04064a4cf257 Merge: 7b1b843a1e41 0534c5489c11 Author: David S. Miller Date: Fri May 22 14:00:39 2020 -0700 Merge branch 'Support-for-fdb-ECMP-nexthop-groups' Roopa Prabhu says: ==================== Support for fdb ECMP nexthop groups This series introduces ecmp nexthops and nexthop groups for mac fdb entries. In subsequent patches this is used by the vxlan driver fdb entries. The use case is E-VPN multihoming [1,2,3] which requires bridged vxlan traffic to be load balanced to remote switches (vteps) belonging to the same multi-homed ethernet segment (This is analogous to a multi-homed LAG but over vxlan). Changes include new nexthop flag NHA_FDB for nexthops referenced by fdb entries. These nexthops only have ip. The patches make sure that routes dont reference such nexthops. example: $ip nexthop add id 12 via 172.16.1.2 fdb $ip nexthop add id 13 via 172.16.1.3 fdb $ip nexthop add id 102 group 12/13 fdb $bridge fdb add 02:02:00:00:00:13 dev vxlan1000 nhid 101 self [1] E-VPN https://tools.ietf.org/html/rfc7432 [2] E-VPN VxLAN: https://tools.ietf.org/html/rfc8365 [3] LPC talk with mention of nexthop groups for L2 ecmp http://vger.kernel.org/lpc_net2018_talks/scaling_bridge_fdb_database_slidesV3.pdf v4 - - fix error path free_skb in vxlan_xmit_nh - fix atomic notifier initialization issue (Reported-by: kernel test robot ) The reported error was easy to locate and fix, but i was not able to re-test with the robot reproducer script due to some other issues with running the script on my test system. v3 - fix wording in selftest print as pointed out by davidA v2 - - dropped nikolays fixes for nexthop multipath null pointer deref (he will send those separately) - added negative tests for route add with fdb nexthop + a few more - Fixes for a few fdb replace conditions found during more testing - Moved to rcu_dereference_rtnl in vxlan_fdb_info and consolidate rcu dereferences - Fixes to build failures Reported-by: kbuild test robot - DavidA, I am going to send a separate patch for the neighbor code validation for NDA_NH_ID if thats ok. ==================== Signed-off-by: David S. Miller commit 0534c5489c11cbda0bd2d9719a121a0f90433905 Author: Roopa Prabhu Date: Thu May 21 22:26:17 2020 -0700 selftests: net: add fdb nexthop tests This commit adds ipv4 and ipv6 fdb nexthop api tests to fib_nexthops.sh. Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c7cdbe2efc40b366be748cd5786279ac395de181 Author: Roopa Prabhu Date: Thu May 21 22:26:16 2020 -0700 vxlan: support for nexthop notifiers vxlan driver registers for nexthop add/del notifiers to cleanup fdb entries pointing to such nexthops. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 8590ceedb70181ad9de5a3dc2cfe50ca33a9576a Author: Roopa Prabhu Date: Thu May 21 22:26:15 2020 -0700 nexthop: add support for notifiers This patch adds nexthop add/del notifiers. To be used by vxlan driver in a later patch. Could possibly be used by switchdev drivers in the future. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 1274e1cc42264d4e629841e4f182795cb0becfd2 Author: Roopa Prabhu Date: Thu May 21 22:26:14 2020 -0700 vxlan: ecmp support for mac fdb entries Todays vxlan mac fdb entries can point to multiple remote ips (rdsts) with the sole purpose of replicating broadcast-multicast and unknown unicast packets to those remote ips. E-VPN multihoming [1,2,3] requires bridged vxlan traffic to be load balanced to remote switches (vteps) belonging to the same multi-homed ethernet segment (E-VPN multihoming is analogous to multi-homed LAG implementations, but with the inter-switch peerlink replaced with a vxlan tunnel). In other words it needs support for mac ecmp. Furthermore, for faster convergence, E-VPN multihoming needs the ability to update fdb ecmp nexthops independent of the fdb entries. New route nexthop API is perfect for this usecase. This patch extends the vxlan fdb code to take a nexthop id pointing to an ecmp nexthop group. Changes include: - New NDA_NH_ID attribute for fdbs - Use the newly added fdb nexthop groups - makes vxlan rdsts and nexthop handling code mutually exclusive - since this is a new use-case and the requirement is for ecmp nexthop groups, the fdb add and update path checks that the nexthop is really an ecmp nexthop group. This check can be relaxed in the future, if we want to introduce replication fdb nexthop groups and allow its use in lieu of current rdst lists. - fdb update requests with nexthop id's only allowed for existing fdb's that have nexthop id's - learning will not override an existing fdb entry with nexthop group - I have wrapped the switchdev offload code around the presence of rdst [1] E-VPN RFC https://tools.ietf.org/html/rfc7432 [2] E-VPN with vxlan https://tools.ietf.org/html/rfc8365 [3] http://vger.kernel.org/lpc_net2018_talks/scaling_bridge_fdb_database_slidesV3.pdf Includes a null check fix in vxlan_xmit from Nikolay v2 - Fixed build issue: Reported-by: kbuild test robot Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 38428d68719c454d269cb03b776d8a4b0ad66111 Author: Roopa Prabhu Date: Thu May 21 22:26:13 2020 -0700 nexthop: support for fdb ecmp nexthops This patch introduces ecmp nexthops and nexthop groups for mac fdb entries. In subsequent patches this is used by the vxlan driver fdb entries. The use case is E-VPN multihoming [1,2,3] which requires bridged vxlan traffic to be load balanced to remote switches (vteps) belonging to the same multi-homed ethernet segment (This is analogous to a multi-homed LAG but over vxlan). Changes include new nexthop flag NHA_FDB for nexthops referenced by fdb entries. These nexthops only have ip. This patch includes appropriate checks to avoid routes referencing such nexthops. example: $ip nexthop add id 12 via 172.16.1.2 fdb $ip nexthop add id 13 via 172.16.1.3 fdb $ip nexthop add id 102 group 12/13 fdb $bridge fdb add 02:02:00:00:00:13 dev vxlan1000 nhid 101 self [1] E-VPN https://tools.ietf.org/html/rfc7432 [2] E-VPN VxLAN: https://tools.ietf.org/html/rfc8365 [3] LPC talk with mention of nexthop groups for L2 ecmp http://vger.kernel.org/lpc_net2018_talks/scaling_bridge_fdb_database_slidesV3.pdf v4 - fixed uninitialized variable reported by kernel test robot Reported-by: kernel test robot Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit ddbd60c779b4ddaa87173a160ce90146933fb8f9 Author: Vitor Massaru Iha Date: Tue Apr 14 20:09:50 2020 -0300 kunit: use --build_dir=.kunit as default To make KUnit easier to use, and to avoid overwriting object and .config files, the default KUnit build directory is set to .kunit * Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205221 Fixed up minor merge conflicts - Shuah Khan Signed-off-by: Vitor Massaru Iha Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 7b1b843a1e413d0d796cdd557c2592eb0ccd35c9 Merge: 2a330b533462 c983e3271923 Author: David S. Miller Date: Fri May 22 13:48:24 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-05-21 This series contains updates to igc and e1000. Andre cleans up code that was left over from the igb driver that handled MAC address filters based on the source address, which is not currently supported. Simplifies the MAC address filtering code and prepare the igc driver for future source address support. Updated the MAC address filter internal APIs to support filters based on source address. Added support for Network Flow Classification (NFC) rules based on source MAC address. Cleaned up the 'cookie' field which is not used anywhere in the code and cleaned up a wrapper function that was not needed. Simplified the filtering code for readability and aligned the ethtool functions, so that function names were consistent. Alex provides a fix for e1000 to resolve a deadlock issue when NAPI is being disabled. Sasha does additional cleanup of the igc driver of dead code that is not used or needed. v2: Fix the function header comment in patch 3 of the series, based on the feedback from Jakub Kicinski. ==================== Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit c4714b0045ac74f3b578851e312f9fbccfb382db Author: Lothar Rubusch Date: Wed Apr 15 20:16:53 2020 +0000 Documentation: test.h - fix warnings Fix warnings at 'make htmldocs', and formatting issues in the resulting documentation. - test.h: Fix annotation in kernel-doc parameter description. - Documentation/*.rst: Fixing formatting issues, and a duplicate label issue due to usage of sphinx.ext.autosectionlabel and identical labels within one document (sphinx warning) Signed-off-by: Lothar Rubusch Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 558ae0355a91c7d28fdf4c0011bee6ebb5118632 Author: Andrei Vagin Date: Thu May 21 00:52:52 2020 -0700 selftests/timens: handle a case when alarm clocks are not supported This can happen if a testing node doesn't have RTC (real time clock) hardware or it doesn't support alarms. Fixes: 61c57676035d ("selftests/timens: Add Time Namespace test for supported clocks") Acked-by: Vincenzo Frascino Reported-by: Vincenzo Frascino Signed-off-by: Andrei Vagin Signed-off-by: Shuah Khan commit 5627f9cffee73dca9762135b6a8c7ab7213f31e2 Author: Nikita Sobolev Date: Thu May 21 17:43:44 2020 +0300 Kernel selftests: Add check if TPM devices are supported TPM2 tests set uses /dev/tpm0 and /dev/tpmrm0 without check if they are available. In case, when these devices are not available test fails, but expected behaviour is skipped test. Signed-off-by: Nikita Sobolev Reviewed-by: Jarkko Sakkinen Reviewed-by: Petr Vorel Signed-off-by: Shuah Khan commit b03628b73564cf54e05b7611e22d9886a8822877 Author: Niklas Söderlund Date: Thu May 14 17:25:05 2020 +0200 thermal: rcar_thermal: Clean up rcar_thermal_update_temp() Moving the ctemp variable out of the private data structure made it possible to clean up rcar_thermal_update_temp(). Initialize the local ctemp to the error code to return if the reading fails and just return it at the end of the function. It's OK to change the datatype of old, new and ctemp to int as all values are ANDed with CTEMP (0x3f) before being stored. While at it change the datatype of the loop variable 'i' to to unsigned int. Suggested-by: Geert Uytterhoeven Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200514152505.1927634-1-niklas.soderlund+renesas@ragnatech.se commit 8fede89f853a7bfc671f9d8f069ccfe4190061f3 Author: Mark Brown Date: Fri May 22 16:50:05 2020 +0100 spi: Make spi_delay_exec() warn if called from atomic context If the delay used is long enough the spi_delay_exec() will use a sleeping function to implement it. Add a might_sleep() here to help avoid callers using this from an atomic context and running into problems at runtime on other systems. Suggested-by: Serge Semin Signed-off-by: Mark Brown Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200522155005.46099-1-broonie@kernel.org Signed-off-by: Mark Brown commit a94dae867c5663f36c950b82832e146a6c2f0e42 Author: Danil Kipnis Date: Fri May 22 07:39:24 2020 +0200 RDMA/rtrs: Get rid of the do_next_path while_next_path macros The macros do_each_path/while_each_path lead to a smatch warning: drivers/infiniband/ulp/rtrs/rtrs-clt.c:1196 rtrs_clt_failover_req() warn: inconsistent indenting drivers/infiniband/ulp/rtrs/rtrs-clt.c:2890 rtrs_clt_request() warn: inconsistent indenting Also checkpatch complains: ERROR: Macros with multiple statements should be enclosed in a do - while loop The macros are used only in two places: for a normal IO path and for the failover path triggered after errors. Get rid of the macros and just use a for loop iterating over the list of paths in both places. It is easier to read and also less lines of code. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Link: https://lore.kernel.org/r/20200522053924.528980-1-danil.kipnis@cloud.ionos.com Reported-by: kbuild test robot Signed-off-by: Danil Kipnis Signed-off-by: Jason Gunthorpe commit e172037be757dc7ab6ee67932c6663a2ff8cfd27 Author: Md Haris Iqbal Date: Fri May 22 08:28:33 2020 +0000 RDMA/rtrs: server: Use already dereferenced rtrs_sess structure The rtrs_sess structure has already been extracted above from the rtrs_srv_sess structure. Use that to avoid redundant dereferencing. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Link: https://lore.kernel.org/r/20200522082833.1480551-1-haris.phnx@gmail.com Signed-off-by: Md Haris Iqbal Acked-by: Danil Kipnis Signed-off-by: Jason Gunthorpe commit cdb685cb9158fa67f6f4584ea39279ed7ae39253 Author: Danil Kipnis Date: Thu May 21 20:59:09 2020 +0200 RDMA/rnbd: Fix compilation error when CONFIG_MODULES is disabled module_is_live function is only defined when CONFIG_MODULES is enabled. Use try_module_get instead to check whether the module is being removed. When module unload and manuall unmapping is happening in parallel, we can try removing the symlink twice: rnbd_client_exit vs. rnbd_clt_unmap_dev_store. This is probably not the best way to deal with this race in general, but for now this fixes the compilation issue when CONFIG_MODULES is disabled and has no functional impact. Regression tests passed. Fixes: 1eb54f8f5dd8 ("block/rnbd: client: sysfs interface functions") Link: https://lore.kernel.org/r/20200521185909.457245-1-danil.kipnis@cloud.ionos.com Reported-by: Randy Dunlap Suggested-by: Guoqing Jiang Signed-off-by: Danil Kipnis Acked-by: Randy Dunlap Signed-off-by: Jason Gunthorpe commit 8eb613c0b8f19627ba1846dcf78bb2c85edbe8dd Author: Mimi Zohar Date: Sun May 3 01:00:02 2020 -0400 ima: verify mprotect change is consistent with mmap policy Files can be mmap'ed read/write and later changed to execute to circumvent IMA's mmap appraise policy rules. Due to locking issues (mmap semaphore would be taken prior to i_mutex), files can not be measured or appraised at this point. Eliminate this integrity gap, by denying the mprotect PROT_EXECUTE change, if an mmap appraise policy rule exists. On mprotect change success, return 0. On failure, return -EACESS. Reviewed-by: Lakshmi Ramasubramanian Signed-off-by: Mimi Zohar commit 63a3345c2d42a9b29e1ce2d3a4043689b3995cea Author: Maor Gottlieb Date: Thu May 21 10:26:50 2020 +0300 IB/cma: Fix ports memory leak in cma_configfs The allocated ports structure in never freed. The free function should be called by release_cma_ports_group, but the group is never released since we don't remove its default group. Remove default groups when device group is deleted. Fixes: 045959db65c6 ("IB/cma: Add configfs for rdma_cm") Link: https://lore.kernel.org/r/20200521072650.567908-1-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6f27e4c287d7bdcad1f24efcaace044617aac2f3 Author: Lyude Paul Date: Thu May 21 16:46:47 2020 -0400 drm/vblank: Fix -Wformat compile warnings on some arches On some architectures like ppc64le and aarch64, compiling with -Wformat=1 will throw the following warnings: In file included from drivers/gpu/drm/drm_vblank.c:33: drivers/gpu/drm/drm_vblank.c: In function 'drm_update_vblank_count': drivers/gpu/drm/drm_vblank.c:273:16: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'long int' [-Wformat=] DRM_DEBUG_VBL("updating vblank count on crtc %u:" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/drm/drm_print.h:407:22: note: in definition of macro 'DRM_DEBUG_VBL' drm_dbg(DRM_UT_VBL, fmt, ##__VA_ARGS__) ^~~ drivers/gpu/drm/drm_vblank.c:274:22: note: format string is defined here " current=%llu, diff=%u, hw=%u hw_last=%u\n", ~~~^ %lu So, fix that with a typecast. Co-developed-by: Dave Airlie Signed-off-by: Lyude Paul Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200521204647.2578479-1-lyude@redhat.com commit 873e391ff33e742189cd7da5ed4bfd941e83edd7 Author: Srinivas Pandruvada Date: Tue May 19 16:28:34 2020 -0700 tools/power/x86/intel-speed-select: Fix invalid core mask The core mask display is wrong in some cases. This is showing more cpus than the mask has. This is because mask is 64 bit but it used with BIT() macro to get the presence of CPU which doesn't support unsigned long long. Added a new macro for BIT_ULL and use that to get the presence of a CPU. Signed-off-by: Srinivas Pandruvada commit e16ea66365e43d5e3b338ba8d406dec38c6c3d39 Author: Srinivas Pandruvada Date: Fri May 15 12:46:37 2020 -0700 tools/power/x86/intel-speed-select: Increase CPU count Increase CPU count so that more than 64 is supported in one request. For example: sudo ./intel-speed-select -d --cpu 0-66 core-power assoc -clos 0 The above command stops at 63. With this change, it can support more CPU numbers from 0-255. Signed-off-by: Srinivas Pandruvada commit aa8b650b1aa2cb3cc9869795eac0ba8ffe4ea524 Author: Prarit Bhargava Date: Mon May 11 15:06:28 2020 -0400 tools/power/x86/intel-speed-select: Fix json perf-profile output output The 'intel-speed-select -f json perf-profile get-lock-status' command outputs the package, die, and cpu data as separate fields. ex) "package-0": { "die-0": { "cpu-0": { Commit 74062363f855 ("tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json") prettied this output so that it is a single line for some json output commands and the same should be done for other commands. Output package, die, and cpu info in a single line when using json output. Signed-off-by: Prarit Bhargava Cc: Srinivas Pandruvada Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Srinivas Pandruvada commit 29c859df7b52080f0809b8a0b9d7b86fff379ef9 Author: Pavel Dobias Date: Fri May 22 16:29:57 2020 +0200 ASoC: max9867: keep ADCs and DACs always on Updating power management register requires toggling the shutdown bit otherwise it causes unexpected behavior of the codec. However, toggling the shutdown bit results in loud speaker crackling. Setup the power management register only at startup to avoid that. Signed-off-by: Pavel Dobias Link: https://lore.kernel.org/r/20200522142957.18364-3-dobias@2n.cz Signed-off-by: Mark Brown commit 980b63f8d040a791e8d751b8065d12ad7865f976 Author: Pavel Dobias Date: Fri May 22 16:29:56 2020 +0200 ASoC: max9867: add digital microphone controls MAX9867 codec has a possibility of connecting digital microphones. Add DAPM controls to be able to enable them. Signed-off-by: Pavel Dobias Link: https://lore.kernel.org/r/20200522142957.18364-2-dobias@2n.cz Signed-off-by: Mark Brown commit 90ca78deb004abe75b5024968a199acb96bb70f9 Author: Felix Kuehling Date: Tue May 19 21:02:45 2020 -0400 drm/amdgpu: Sync with VM root BO when switching VM to CPU update mode This fixes an intermittent bug where a root PD clear operation still in progress could overwrite a PDE update done by the CPU, resulting in a VM fault. Fixes: 108b4d928c03 ("drm/amd/amdgpu: Update VM function pointer") Reported-by: Jay Cornwall Tested-by: Jay Cornwall Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit cdaae8371aa9d4ea1648a299b1a75946b9556944 Author: Bhawanpreet Lakha Date: Mon May 11 14:21:17 2020 -0400 drm/amd/display: Handle GPU reset for DC block [Why] Previously we used the s3 codepath for gpu reset. This can lead to issues in certain case where we end of waiting for fences which will never come (because parts of the hw are off due to gpu reset) and we end up waiting forever causing a deadlock. [How] Handle GPU reset separately from normal s3 case. We essentially need to redo everything we do in s3, but avoid any drm calls. For GPU reset case suspend: -Acquire DC lock -Cache current dc_state -Commit 0 stream/planes to dc (this puts dc into a state where it can be powered off) -Disable interrupts resume -Edit cached state to force full update -Commit cached state from suspend -Build stream and plane updates from the cached state -Commit stream/plane updates -Enable interrupts -Release DC lock v2: -Formatting -Release dc_state Signed-off-by: Bhawanpreet Lakha Acked-by: Alex Deucher Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 54f78a7655e20792253fdf6969513c5f9169c897 Author: Alex Deucher Date: Fri May 15 14:18:29 2020 -0400 drm/amdgpu: add apu flags (v2) Add some APU flags to simplify handling of different APU variants. It's easier to understand the special cases if we use names flags rather than checking device ids and silicon revisions. v2: rebase on latest code Acked-by: Evan Quan Acked-by: Christian König Signed-off-by: Alex Deucher commit cbd2d08c7463e78d625a69e9db27ad3004cbbd99 Author: chen gong Date: Thu May 21 17:15:34 2020 +0800 drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven [Problem description] 1. Boot up picasso platform, launches desktop, Don't do anything (APU enter into "gfxoff" state) 2. Remote login to platform using SSH, then type the command line: sudo su -c "echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level" sudo su -c "echo 2 > /sys/class/drm/card0/device/pp_dpm_sclk" (fix SCLK to 1400MHz) 3. Move the mouse around in Window 4. Phenomenon : The screen frozen Tester will switch sclk level during glmark2 run time. APU will enter "gfxoff" state intermittently during glmark2 run time. The system got hanged if fix GFXCLK to 1400MHz when APU is in "gfxoff" state. [Debug] 1. Fix SCLK to X MHz 1400: screen frozen, screen black, then OS will reboot. 1300: screen frozen. 1200: screen frozen, screen black. 1100: screen frozen, screen black, then OS will reboot. 1000: screen frozen, screen black. 900: screen frozen, screen black, then OS will reboot. 800: Situation Nomal, issue disappear. 700: Situation Nomal, issue disappear. 2. SBIOS setting: AMD CBS --> SMU Debug Options -->SMU Debug --> "GFX DLDO Psm Margin Control": 50 : Situation Nomal, issue disappear. 45 : Situation Nomal, issue disappear. 40 : Situation Nomal, issue disappear. 35 : Situation Nomal, issue disappear. 30 : screen black. 25 : screen frozen, then blurred screen. 20 : screen frozen. 15 : screen black. 10 : screen frozen. 5 : screen frozen, then blurred screen. 3. Disable GFXOFF feature Situation Nomal, issue disappear. [Why] Through a period of time debugging with Sys Eng team and SMU team, Sys Eng team said this is voltage/frequency marginal issue not a F/W or H/W bug. This experiment proves that default targetPsm [for f=1400MHz] is not sufficient when GFXOFF is enabled on Picasso. SMU team think it is an odd test conditions to force sclk="1400MHz" when GPU is in "gfxoff" state,then wake up the GFX. SCLK should be in the "lowest frequency" when gfxoff. [How] Disable gfxoff when setting manual mode. Enable gfxoff when setting other mode(exiting manual mode) again. By the way, from the user point of view, now that user switch to manual mode and force SCLK Frequency, he don't want SCLK be controlled by workload.It becomes meaningless to "switch to manual mode" if APU enter "gfxoff" due to lack of workload at this point. Tips: Same issue observed on Raven. Signed-off-by: chen gong Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d5c8ffb966377b6f8c0e1a8b9b040ade89b151b1 Author: Alex Deucher Date: Thu May 21 10:08:11 2020 -0400 drm/amdgpu: fix pm sysfs node handling (v2) Fix typos that prevented them from showing up. v2: switch other files in addition to pp_clk_voltage Fixes: 4e01847c38f7a5 ("drm/amdgpu: optimize amdgpu device attribute code") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1150 Signed-off-by: Alex Deucher Acked-by: Evan Quan commit 6e29c227a4976460ec6d4cc70b998e3a8c30c873 Author: Alex Deucher Date: Fri May 15 14:04:17 2020 -0400 drm/amdgpu: move gpu_info parsing after common early init We need to get the silicon revision id before we parse the firmware in order to load the correct gpu info firmware for raven2 variants. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1103 Acked-by: Christian König Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 6ba57b7a8f94fcf3df6883db362642a0075d185b Author: Alex Deucher Date: Fri May 15 14:00:11 2020 -0400 drm/amdgpu: move discovery gfx config fetching Move it into the fw_info function since it's logically part of the same functionality. Acked-by: Christian König Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 2e9a97256616f2f7280f8bed8c98e57bfd745a4d Author: Mark Brown Date: Fri May 22 17:21:39 2020 +0100 selftests: vdso: Add a selftest for vDSO getcpu() Provide a very basic selftest for getcpu() which similarly to our existing test for gettimeofday() looks up the function in the vDSO and prints the results it gets if the function exists and succeeds. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit cd76ca4dd63768385fb81927fdc3087ad3bfeefb Author: Mark Brown Date: Fri May 22 17:21:38 2020 +0100 selftests: vdso: Use a header file to prototype parse_vdso API Both vdso_test_gettimeofday and vdso_standalone_test_x86 use the library in parse_vdso.c but each separately declares the API it offers which is not ideal. Create a header file with prototypes of the functions and use it in both the library and the tests to ensure that the same prototypes are used throughout. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit 1ab20c0e53fa2167357bd90b7f7f7019cad9daaa Author: Geert Uytterhoeven Date: Thu May 7 13:29:55 2020 +0200 thermal: qoriq: Add platform dependencies The QorIQ Thermal Monitoring Unit is only present on Freescale E500MC and Layerscape SoCs, and on NXP i.MX8 SoCs. Add platform dependencies to the QORIQ_THERMAL config symbol, to avoid asking the user about it when configuring a kernel without support for any of the aforementioned SoCs. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Li Yang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200507112955.23520-5-geert+renesas@glider.be commit a7ff82976122eb6d1fd286dc34f09b6ecd756b60 Author: Amit Kucheria Date: Wed Apr 29 23:44:17 2020 +0530 drivers: thermal: tsens: Merge tsens-common.c into tsens.c tsens-common.c has outlived its usefuless. It was created expecting lots of custom routines per version of the TSENS IP. We haven't needed those, there is now only data in the version-specific files. Merge the code for tsens-common.c into tsens.c. As a result, - Remove any unnecessary forward declarations in tsens.h. - Add a Linaro copyright to tsens.c. - Fixup the Makefile to remove tsens-common.c. - Where it made sense, fix some 80-column alignments in the tsens-common.c code being copied over. There is no functional change with this patch. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/e30e2ba6fa5c007983afd4d7d4e0311c0b57917a.1588183879.git.amit.kucheria@linaro.org commit 14adf6c83f7c6953a136d9d4beda79004191e729 Author: Amit Kucheria Date: Mon May 11 17:55:02 2020 +0530 thermal/of: Rename of-thermal.c Core thermal framework code files should start with thermal_*. of-thermal.c does not follow this pattern and can easily be confused with platform driver. Fix this by renaming it to thermal_of.c Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/f5e233d5c5dcc7c7cb56b3448da255cb2c9ef0d1.1589199124.git.amit.kucheria@linaro.org commit 0015d9a2a72745308ef9728a746ff7b1e82138bc Author: Amit Kucheria Date: Mon May 11 17:55:01 2020 +0530 thermal/governors: Prefix all source files with gov_ Bang-bang governor source file is prefixed with gov_. Do the same for other governors for consistency so they're easy to find in the sources. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/b9a85d3204712f14e320504948c12712dc0b291b.1589199124.git.amit.kucheria@linaro.org commit 6abea5d2af4cdd508b04d94ed9382c3710b99dfc Author: Amit Kucheria Date: Mon May 11 17:55:00 2020 +0530 thermal/drivers/user_space: Sort headers alphabetically Sort headers to make it easier to read and find duplicate headers. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/406d0c7c961e997b42e25adf4e432fe4f57b315a.1589199124.git.amit.kucheria@linaro.org commit 2b61314e76671e125b3d53a02eec3912204c5418 Author: Amit Kucheria Date: Mon May 11 17:54:59 2020 +0530 thermal/drivers/of-thermal: Sort headers alphabetically Sort headers to make it easier to read and find duplicate headers. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/f9f9d8117f1659872114ba65bbfa9ed4b813128f.1589199124.git.amit.kucheria@linaro.org commit c65f83c0667ae1b0013fa87918f009c4380443d5 Author: Amit Kucheria Date: Mon May 11 17:54:58 2020 +0530 thermal/drivers/cpufreq_cooling: Replace module.h with export.h cpufreq_cooling cannot be modular, remove the unnecessary module.h include and replace with export.h to handle EXPORT_SYMBOL family of macros. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/7a439e41e91d8bc5ff99207f99723fcf04ca36eb.1589199124.git.amit.kucheria@linaro.org commit 5ccb451e47fa6da8ae6cd6710b91758280197073 Author: Amit Kucheria Date: Mon May 11 17:54:57 2020 +0530 thermal/drivers/cpufreq_cooling: Sort headers alphabetically Sort headers to make it easier to read and find duplicate headers. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/4231f5dfe758b9bf716981be71cadf9642c83528.1589199124.git.amit.kucheria@linaro.org commit 1628d4b8ca9a877577aaf4116c02f1f45ea18a89 Author: Amit Kucheria Date: Mon May 11 17:54:56 2020 +0530 thermal/drivers/clock_cooling: Include export.h It is preferrable to include export.h when you are using EXPORT_SYMBOL family of macros. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/25f16415ab7b7587a052f1bce4133da318d58192.1589199124.git.amit.kucheria@linaro.org commit d5d1f6e759dfc8218ae9500af222e280ead1aeec Author: Amit Kucheria Date: Mon May 11 17:54:55 2020 +0530 thermal/drivers/clock_cooling: Sort headers alphabetically Sort headers to make it easier to read and find duplicate headers. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/f8e1258fd8b882bab018de63c7e713b4334fec30.1589199124.git.amit.kucheria@linaro.org commit e5ebf357bbfc73d4bfca14195e104e0726c5a729 Author: Amit Kucheria Date: Mon May 11 17:54:54 2020 +0530 thermal/drivers/thermal_hwmon: Include export.h It is preferable to include export.h when you are using EXPORT_SYMBOL family of macros. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/f542962494a8441fdc8e550a11d0e535b92362a0.1589199124.git.amit.kucheria@linaro.org commit 1330e04f423661ed05a4d2a5235505e0332b8026 Author: Amit Kucheria Date: Mon May 11 17:54:53 2020 +0530 thermal/drivers/thermal_hwmon: Sort headers alphabetically Sort headers to make it easier to read and find duplicate headers. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/29b64f1fe81e674c753c8f8309c310acd782ebea.1589199124.git.amit.kucheria@linaro.org commit 3a74c882dcc15c959e1cc14c3f62877d2f09aef8 Author: Amit Kucheria Date: Mon May 11 17:54:52 2020 +0530 thermal/drivers/thermal_helpers: Include export.h It is preferable to include export.h when you are using EXPORT_SYMBOL family of macros. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/fd3443f00dbba6ca90f35726c7451ae52145d2d4.1589199124.git.amit.kucheria@linaro.org commit 231b98af4da050138657febdd506951928981722 Author: Amit Kucheria Date: Mon May 11 17:54:51 2020 +0530 thermal/drivers/thermal_helpers: Sort headers alphabetically Sort headers to make it easier to read and find duplicate headers. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/133db154796f354e6c51e6310095f679e1f45441.1589199124.git.amit.kucheria@linaro.org commit 3f0cfea3dd6ed7cd176376bb4a5488b75b938d96 Author: Amit Kucheria Date: Mon May 11 17:54:50 2020 +0530 thermal/core: Replace module.h with export.h Thermal core cannot be modular, remove the unnecessary module.h include and replace with export.h to handle EXPORT_SYMBOL family of macros. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/33af23406dcdb0c62dae1e6401446b997ccb449f.1589199124.git.amit.kucheria@linaro.org commit 869495ccf52a707a21870ba5cba1cfd5ca720dd9 Author: Amit Kucheria Date: Mon May 11 17:54:49 2020 +0530 thermal/core: Get rid of MODULE_* tags The thermal framework can no longer be compiled as a module as of commit 554b3529fe01 ("thermal/drivers/core: Remove the module Kconfig's option"). Remove the MODULE_* tags. Rui is mentioned in the copyright line at the top of the file and the license is mentioned in the SPDX tags. So no loss of information. Signed-off-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/74339a09a55f8f3d86c4074fc2bf853a302d6186.1589199124.git.amit.kucheria@linaro.org commit f740e64c6cd6d9c26b4b9fc0a8d339b215147af7 Author: Gustavo A. R. Silva Date: Thu May 7 14:25:17 2020 -0500 thermal: imx8mm: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200507192517.GA16557@embeddedor commit b6bea24d41519e8c31e4798f1c1a3f67e540c5d0 Author: Alexander Monakov Date: Sun May 10 20:48:42 2020 +0000 EDAC/amd64: Add AMD family 17h model 60h PCI IDs Add support for AMD Renoir (4000-series Ryzen CPUs). Signed-off-by: Alexander Monakov Signed-off-by: Borislav Petkov Acked-by: Yazen Ghannam Link: https://lkml.kernel.org/r/20200510204842.2603-4-amonakov@ispras.ru commit 279f0b3a4b80660fba6faadc2ca2fa426bf3f7e9 Author: Alexander Monakov Date: Sun May 10 20:48:41 2020 +0000 hwmon: (k10temp) Add AMD family 17h model 60h PCI match Add support for retrieving Tdie and Tctl on AMD Renoir (4000-series Ryzen CPUs). It appears SMU offsets for reading current/voltage and CCD temperature have changed for this generation (reads from currently used offsets yield zeros), so those features cannot be enabled so trivially. Signed-off-by: Alexander Monakov Signed-off-by: Borislav Petkov Acked-by: Guenter Roeck Link: https://lkml.kernel.org/r/20200510204842.2603-3-amonakov@ispras.ru commit 13e945631c2ffb946c0af342812a3cd39227de6e Author: Jonathan Cameron Date: Sun May 17 18:30:00 2020 +0100 iio:chemical:pms7003: Fix timestamp alignment and prevent data leak. One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment explicitly requested. This data is allocated with kzalloc so no data can leak appart from previous readings. Fixes: a1d642266c14 ("iio: chemical: add support for Plantower PMS7003 sensor") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Cc: Acked-by: Tomasz Duszynski commit a5bf6fdd19c327bcfd9073a8740fa19ca4525fd4 Author: Jonathan Cameron Date: Sun May 17 18:29:59 2020 +0100 iio:chemical:sps30: Fix timestamp alignment One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. Fixes: 232e0f6ddeae ("iio: chemical: add support for Sensirion SPS30 sensor") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Cc: Acked-by: Tomasz Duszynski commit 10134ec3f8cefa6a40fe84987f1795e9e0da9715 Author: Fabrice Gasnier Date: Tue May 12 15:27:05 2020 +0200 iio: adc: stm32-adc: fix a wrong error message when probing interrupts A wrong error message is printed out currently, like on STM32MP15: - stm32-adc-core 48003000.adc: IRQ index 2 not found. This is seen since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"). The STM32 ADC core driver wrongly requests up to 3 interrupt lines. It should request only the necessary IRQs, based on the compatible: - stm32f4/h7 ADCs share a common interrupt - stm32mp1, has one interrupt line per ADC. So add the number of required interrupts to the compatible data. Fixes: d58c67d1d851 ("iio: adc: stm32-adc: add support for STM32MP1") Signed-off-by: Fabrice Gasnier Cc: Signed-off-by: Jonathan Cameron commit a4e91825d7e1252f7cba005f1451e5464b23c15d Author: Alexander Monakov Date: Sun May 10 20:48:40 2020 +0000 x86/amd_nb: Add AMD family 17h model 60h PCI IDs Add PCI IDs for AMD Renoir (4000-series Ryzen CPUs). This is necessary to enable support for temperature sensors via the k10temp module. Signed-off-by: Alexander Monakov Signed-off-by: Borislav Petkov Acked-by: Yazen Ghannam Acked-by: Guenter Roeck Link: https://lkml.kernel.org/r/20200510204842.2603-2-amonakov@ispras.ru commit f6dbf83c17cb223ceabd7c42d441414f3e0e8a86 Author: Jonathan Bakker Date: Sun May 10 08:58:18 2020 -0700 iio: light: gp2ap002: Take runtime PM reference on light read The light sensor needs the regulators to be enabled which means the runtime PM needs to be on. This only happened when the proximity part of the chip was enabled. As fallout from this change, only report changes to the prox state in the interrupt handler when it is explicitly enabled. Fixes: 97d642e23037 ("iio: light: Add a driver for Sharp GP2AP002x00F") Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron commit d8bd8c6e2cfab8b78b537715255be8d7557791c0 Author: Ard Biesheuvel Date: Fri May 22 18:15:49 2020 +0200 efi/efivars: Add missing kobject_put() in sysfs entry creation error path The documentation provided by kobject_init_and_add() clearly spells out the need to call kobject_put() on the kobject if an error is returned. Add this missing call to the error path. Cc: Reported-by: 亿一 Signed-off-by: Ard Biesheuvel commit 7d4eedb03fc754625e0e0c482f42bfeabce685ce Author: kbuild test robot Date: Thu May 21 15:11:13 2020 +0800 drm/msm/dpu: dpu_setup_dspp_pcc() can be static Fixes: 4259ff7ae509 ("drm/msm/dpu: add support for pcc color block in dpu driver") Signed-off-by: kbuild test robot Signed-off-by: Rob Clark commit d9aeccec85ec39c4da90cc4b899cbd1961416a0d Author: kbuild test robot Date: Thu May 21 16:30:19 2020 +0800 drm/msm/a6xx: a6xx_hfi_send_start() can be static Fixes: 8167e6fa76c8 ("drm/msm/a6xx: HFI v2 for A640 and A650") Signed-off-by: kbuild test robot Signed-off-by: Rob Clark commit b4756d43a1dd2cfb778eb3cef3ba2efd2dcd5263 Author: Hannes Reinecke Date: Fri May 22 10:58:53 2020 +0200 dm zoned: remove leftover hunk for switching to sequential zones Remove a leftover hunk to switch from random zones to sequential zones when selecting a reclaim zone; the logic has moved into the caller and this hunk is now pointless. Fixes: 34f5affd04c4 ("dm zoned: separate random and cache zones") Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 1202a442a31fd2e53cde1a9677d9f7005e48fd6e Author: Amit Kucheria Date: Fri Apr 3 12:31:48 2020 +0530 dt-bindings: thermal: Add yaml bindings for thermal zones As part of moving the thermal bindings to YAML, split it up into 3 bindings: thermal sensors, cooling devices and thermal zones. The thermal-zone binding is a software abstraction to capture the properties of each zone - how often they should be checked, the temperature thresholds (trips) at which mitigation actions need to be taken and the level of mitigation needed at those thresholds. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Lukasz Luba Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/44e5c68bc654ccaf88945f70dc875fa186dd1480.1585748882.git.amit.kucheria@linaro.org commit 73c46acf915385e27f3312e77717d27eff74c08a Author: Amit Kucheria Date: Fri Apr 3 12:31:47 2020 +0530 dt-bindings: thermal: Add yaml bindings for thermal cooling-devices As part of moving the thermal bindings to YAML, split it up into 3 bindings: thermal sensors, cooling devices and thermal zones. The property #cooling-cells is required in each device that acts as a cooling device - whether active or passive. So any device that can throttle its performance to passively reduce heat dissipation (e.g. CPUs, GPUs) and any device that can actively dissipate heat at different levels (e.g. fans) will contain this property. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Lukasz Luba Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/7a9ead7fb67585fb70ab3ffd481e7d567e96970e.1585748882.git.amit.kucheria@linaro.org commit c1bba2c94decdec382c6a07d9ba722cefd617575 Author: Amit Kucheria Date: Fri Apr 3 12:31:46 2020 +0530 dt-bindings: thermal: Add yaml bindings for thermal sensors As part of moving the thermal bindings to YAML, split it up into 3 bindings: thermal sensors, cooling devices and thermal zones. The property #thermal-sensor-cells is required in each device that acts as a thermal sensor. It is used to uniquely identify the instance of the thermal sensor inside the system. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Lukasz Luba Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/a91b5603caea5b8854cc9f5325448e4c7228c328.1585748882.git.amit.kucheria@linaro.org commit ab91c2a89f86be2898cee208d492816ec238b2cf Author: Gustavo A. R. Silva Date: Fri May 8 11:38:26 2020 -0500 tpm: eventlog: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. Also, the following issue shows up due to the flexible-array member having incomplete type[4]: drivers/char/tpm/eventlog/tpm2.c: In function ‘tpm2_bios_measurements_start’: drivers/char/tpm/eventlog/tpm2.c:54:46: error: invalid application of ‘sizeof’ to incomplete type ‘u8[]’ {aka ‘unsigned char[]’} 54 | size = sizeof(struct tcg_pcr_event) - sizeof(event_header->event) | ^ drivers/char/tpm/eventlog/tpm2.c: In function ‘tpm2_bios_measurements_next’: drivers/char/tpm/eventlog/tpm2.c:102:10: error: invalid application of ‘sizeof’ to incomplete type ‘u8[]’ {aka ‘unsigned char[]’} 102 | sizeof(event_header->event) + event_header->event_size; | ^ drivers/char/tpm/eventlog/tpm2.c: In function ‘tpm2_binary_bios_measurements_show’: drivers/char/tpm/eventlog/tpm2.c:140:10: error: invalid application of ‘sizeof’ to incomplete type ‘u8[]’ {aka ‘unsigned char[]’} 140 | sizeof(event_header->event) + event_header->event_size; | ^ scripts/Makefile.build:266: recipe for target 'drivers/char/tpm/eventlog/tpm2.o' failed make[3]: *** [drivers/char/tpm/eventlog/tpm2.o] Error 1 As mentioned above: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] As in "sizeof(event_header->event) always evaluated to 0, so removing it has no effect". Lastly, make use of the struct_size() helper to deal with the flexible array member and its host structure. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") [4] https://github.com/KSPP/linux/issues/43 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 8c872863b4400d0c8e31a2ac16389fcaaede5e3c Author: Andy Shevchenko Date: Wed Apr 22 16:01:35 2020 +0300 tpm/tpm_ftpm_tee: Use UUID API for exporting the UUID There is export_uuid() function which exports uuid_t to the u8 array. Use it instead of open coding variant. This allows to hide the uuid_t internals. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit babf8a978d497af2fe4111cc80866b9e436bf785 Author: Mark Brown Date: Thu May 21 21:37:05 2020 +0100 selftests: vdso: Rename vdso_test to vdso_test_gettimeofday Currently the vDSO kselftests have a test called vdso_test which tests the vDSO implementation of gettimeofday(). In preparation for adding tests for other vDSO functionality rename this test to reflect what's going on. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit 61016db15b8e20f371352db6a75b044ec3183fe7 Author: Kees Cook Date: Sun May 17 21:47:43 2020 -0700 selftests/exec: Verify execve of non-regular files fail Add a named pipe as an exec target to make sure that non-regular files are rejected by execve() with EACCES. This can help verify commit 73601ea5b7b1 ("fs/open.c: allow opening only regular files during execve()"). Signed-off-by: Kees Cook Signed-off-by: Shuah Khan commit d1fdeb314e82fb782ab918ea6bfe41b429343725 Author: Tang Bin Date: Wed Apr 15 22:06:40 2020 +0800 i2c: efm32: Avoid unnecessary check in efm32_i2c_probe() The function efm32_i2c_probe() is only called with an openfirmware platform device.Therefore there is no need to check that it has an openfirmware node. Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Signed-off-by: Wolfram Sang commit 79f7ab3a64fd92b86ebc992b333815400942a3b7 Author: Tang Bin Date: Wed Apr 15 21:57:34 2020 +0800 i2c: efm32: Omit superfluous error message in efm32_i2c_probe() In the function efm32_i2c_probe(),when get irq failed,the function platform_get_irq() logs an error message,so remove redundant message here. Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Acked-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit 27cd5511feffea3956d081585316272795e45bce Author: Ard Biesheuvel Date: Tue May 19 10:43:01 2020 +0200 efi/libstub: Use pool allocation for the command line Now that we removed the memory limit for the allocation of the command line, there is no longer a need to use the page based allocator so switch to a pool allocation instead. Signed-off-by: Ard Biesheuvel commit 47a3734b03904bbccbba0c8f78cf2b0f0aa157e7 Author: Rodrigo Alencar <455.rodrigo.alencar@gmail.com> Date: Thu May 14 10:00:12 2020 -0300 gpio: max730x: bring gpiochip_add_data after port config gpiochip_add_data being called before might cause premature calls of the gpiochip operations before the port_config values are initialized, which would possibily write zeros to port configuration registers, an operation not allowed. For example, if there are gpio-hog nodes in a device-tree, the sequence of function calls are performed gpiochip_add_data of_gpiochip_add of_gpiochip_scan_gpios of_gpiochip_add_hog gpiod_hog gpiochip_request_own_desc gpiod_configure_flags gpiod_direction_output/gpiod_direction_input which would call later the gpiochip operation direction_output or direction_input prior the port_config[] initialization. Moreover, gpiochip_get_data is replaced by the container_of macro inside the gpiochip operations, which would allow the calling of max7301_direction_input prior to gpiochip_add_data Signed-off-by: Rodrigo Alencar <455.rodrigo.alencar@gmail.com> [Bartosz: tweaked the commit message] Signed-off-by: Bartosz Golaszewski commit 2ea81c0064fe2bbf7c66d3ddeb9f5c5ba0befdc4 Author: Wolfram Sang Date: Fri May 22 16:57:59 2020 +0200 Revert "dt-binding: i2c: add bus-supply property" This reverts commit 6aab46bc52a8f579879d491c9d8062e03caa5c61. Testing in linux-next showed it needs some more time. Signed-off-by: Wolfram Sang commit 7a4e63cb0905672fd52e7316a885f19d4aeed976 Author: Wolfram Sang Date: Fri May 22 16:56:58 2020 +0200 Revert "i2c: core: support bus regulator controlling in adapter" This reverts commit 6fe12cdbcfe35ad4726a619a9546822d34fc934c. Testing in linux-next showed it needs some more time. Signed-off-by: Wolfram Sang commit 506ad56a59086751eee28b6b6e5dff5572cd669f Author: Takashi Sakamoto Date: Tue May 19 20:16:41 2020 +0900 ALSA: firewire-motu: refactoring protocol v2 for fetching mode switch This commit splits the method to switch fetching mode for protocol version 2 so that model-dependent operations are explicitly defined. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-15-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 7b47c0d719f47e990a4130534182058780f7322a Author: Takashi Sakamoto Date: Tue May 19 20:16:40 2020 +0900 ALSA: firewire-motu: refactoring protocol v3 for clock source getter This commit splits the method to get clock source for protocol version 3 so that model-dependent operations are explicitly defined. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-14-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 2b8f050e4ea97bd9851d023935e0ca5229e6905b Author: Takashi Sakamoto Date: Tue May 19 20:16:39 2020 +0900 ALSA: firewire-motu: refactoring protocol v2 for clock source getter This commit splits the method to get clock source for protocol version 2 so that model-dependent operations are explicitly defined. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-13-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 739bdbaec76ae7e6e2de80c06e1d4ca31e7c96b9 Author: Takashi Sakamoto Date: Tue May 19 20:16:38 2020 +0900 ALSA: firewire-motu: remove obsoleted codes The way to decide CIP payload size by calculation with any flag is now obsoleted. This commit removes the codes. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-12-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 88e8f89dcc66eafcd4c11fd41988ebe22b793df1 Author: Takashi Sakamoto Date: Tue May 19 20:16:37 2020 +0900 ALSA: firewire-motu: use table-based calculation of packet formats for stream management This commit uses table-based calculation of packet formats for stream management. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-11-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 9883b3850fba6c2842a15ac3b38e36b214e03ddf Author: Takashi Sakamoto Date: Tue May 19 20:16:36 2020 +0900 ALSA: firewire-motu: use table-based calculation of packet formats for proc This commit uses table-based calculation of packet formats for proc nodes. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-10-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 0090c1c5f327da077f371f5f8675a576bca6ebf9 Author: Takashi Sakamoto Date: Tue May 19 20:16:35 2020 +0900 ALSA: firewire-motu: add alternative functions to detect packet format for protocol v3 This commit adds alternative functions to detect packet format so that each function corresponds to each model. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-9-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 28c8d3c91af79de34b2ea540b5385b2da4999e80 Author: Takashi Sakamoto Date: Tue May 19 20:16:34 2020 +0900 ALSA: firewire-motu: add alternative functions to detect packet format for protocol v2 This commit adds alternative functions to detect packet format so that each function corresponds to each model. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-8-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit dfbaa4dc11eb93e3662dcefbf00a14235c4c1e8e Author: Takashi Sakamoto Date: Tue May 19 20:16:33 2020 +0900 ALSA: firewire-motu: add model-specific table of chunk count In MOTU protocol, data block consists of SPH and 24-bit chunks aligned to quadlet. The number of chunks per data block is specific to model. For models with optical interface, the number differs depending on I/O settings for the interface (ADAT, TOSLINK). Currently the number is calculated from flags in model-specific data. However this is weak in the case that the model has quirks. Actually, for quirks of some models, flags are used against their original meanings. This commit adds model-specific table of chunk count. For future integration, this table is based on the calculation. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 562f0c6700cfeb28b7a95d4b7cb6b0496d0b2fb5 Author: Takashi Sakamoto Date: Tue May 19 20:16:32 2020 +0900 ALSA: firewire-motu: drop protocol structure Now protocol structure becomes useless. This commit drops it. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit ff222b7e45eb1ffb2931269abf66b9d3576c9eeb Author: Takashi Sakamoto Date: Tue May 19 20:16:31 2020 +0900 ALSA: firewire-motu: add wrapper functions for protocol-dependent operations This commit adds helper functions which wraps function call for each protocol. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-5-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 61d79c70c976a14cb321e537c39d147f7069e86a Author: Takashi Sakamoto Date: Tue May 19 20:16:30 2020 +0900 ALSA: firewire-motu: localize protocol data This commit adds enumerations of protocol version to localize protocol data. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit c806a0e228318dec8384d765462764443bdc4786 Author: Takashi Sakamoto Date: Tue May 19 20:16:29 2020 +0900 ALSA: firewire-motu: move spec data to v3 protocol file The most of members in spec data is used in each protocol file. It's better to capsulate the data to the file. This commit moves the data to the file for protocol version 3. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 0a7c7b47e44f7062069f23a4d674c81eb7f4ad56 Author: Takashi Sakamoto Date: Tue May 19 20:16:28 2020 +0900 ALSA: firewire-motu: move spec data to v2 protocol file The most of members in spec data is used in each protocol file. It's better to capsulate the data to the file. This commit moves the data to the file for protocol version 2. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200519111641.123211-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 47393fb57ba7b914c869f70010326c8b8940c3a0 Author: Dan Carpenter Date: Tue May 19 15:03:47 2020 +0300 block/rnbd: Fix an IS_ERR() vs NULL check in find_or_create_sess() The alloc_sess() function returns error pointers, it never returns NULL. Fixes: f7a7a5c228d4 ("block/rnbd: client: main functionality") Link: https://lore.kernel.org/r/20200519120347.GD42765@mwanda Signed-off-by: Dan Carpenter Reviewed-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 3f35064a7cfef4ed8d25cdb16da0abfbbd525f63 Author: Andy Shevchenko Date: Tue May 19 15:50:43 2020 +0300 i2c: designware: Drop hard coded FIFO depth assignment It's not clear why the commit fe20ff5c7e9c ("i2c-designware: Add support for Designware core behind PCI devices.") followed by commit b61b14154b19 ("i2c-designware: add support for Intel Lynxpoint") chose to hard code FIFO depth size. The FIFO depth on all hardware, I have tested on, can be nicely detected automatically. Thus, we may safely drop hard coded FIFO sizes from the driver. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 64d0a0755c7deeb600d8ee287cfb84469aa37ac8 Author: Andy Shevchenko Date: Tue May 19 15:50:42 2020 +0300 i2c: designware: Read counters from ACPI for PCI driver PCI devices may have been backed with ACPI handle which supplies an additional information to the drivers, such as counters. Call for ACPI configuration from PCI driver in order to utilize counters provided by ACPI. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit f9288fcc5c6154959de4dd83be1b91abcf5e0c17 Author: Andy Shevchenko Date: Tue May 19 15:50:41 2020 +0300 i2c: designware: Move ACPI parts into common module For possible code reuse in the future, move ACPI parts into common module. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 462cfcb4aa1c92239cb16177fd3ceb65326955ff Author: Andy Shevchenko Date: Tue May 19 15:50:40 2020 +0300 i2c: designware: Drop unneeded condition in i2c_dw_validate_speed() We may bailout directly from the loop instead of breaking it and testing a loop counter. This also gives advantages such as decreased indentation level along with dropped unneeded condition. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 20ee1d9020c9233129ba84094e7dd6fe4651cfad Author: Andy Shevchenko Date: Tue May 19 15:50:39 2020 +0300 i2c: designware: Move i2c_dw_validate_speed() helper to a common code In order to export array supported speed for wider use, move it to a header along with i2c_dw_validate_speed() helper moved to a common code. No functional changes intended. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit a19f133f694c8f5549d46b43e4b30343b35c3aa5 Author: Andy Shevchenko Date: Tue May 19 15:50:38 2020 +0300 i2c: designware: Include proper headers in i2c-desingware-core.h This header is a user of some generic ones, include them respectively. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit ab0ef8bac10db48b1045e5d492a21511e54babaf Author: Andy Shevchenko Date: Tue May 19 15:50:37 2020 +0300 i2c: designware: Get rid of PCI driver specifics in common code Do not spread PCI specifics over common code. It seems to be a layering violation which can be easily avoided. Refactor PCI driver and drop PCI specifics from common code. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 80b1bfe1cb2f20225fb2d8f11d44af4a9d765396 Author: Arvind Sankar Date: Wed May 20 20:29:21 2020 -0400 efi/libstub: Don't parse overlong command lines Check if the command line passed in is larger than COMMAND_LINE_SIZE, and truncate it to the last full argument if so. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200521002921.69650-1-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit c81b49d4d6ca3876fad42fe99e685605294f757c Author: Christoph Hellwig Date: Wed May 13 14:36:01 2020 +0200 block: remove the disk and queue NULL checks in blkdev_issue_flush Both of these never can be NULL for a live block device. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 9398554fb3979852512ff4f1405e759889b45c16 Author: Christoph Hellwig Date: Wed May 13 14:36:00 2020 +0200 block: remove the error_sector argument to blkdev_issue_flush The argument isn't used by any caller, and drivers don't fill out bi_sector for flush requests either. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 988453fb2f18be3f3915220e4c6f18018186aa89 Author: Shukun Tan Date: Fri May 15 17:14:00 2020 +0800 crypto: hisilicon/qm - change debugfs file name from qm_regs to regs The debugfs qm_regs file is already in the qm directory, so no qm_ prefix is required. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit c31dc9fe165d1b53c0494e0260a798d491de7bb4 Author: Shukun Tan Date: Fri May 15 17:13:59 2020 +0800 crypto: hisilicon/qm - add DebugFS for xQC and xQE dump Add dump information of SQC/CQC/EQC/AEQC/SQE/CQE/EQE/AEQE. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 6621e6492fbdf55d25ea7dd09c8a4cd520c0028d Author: Longfang Liu Date: Fri May 15 17:13:58 2020 +0800 crypto: hisilicon/zip - add debugfs for Hisilicon ZIP Hisilicon ZIP engine driver uses debugfs to provides IO operation debug information Signed-off-by: Longfang Liu Signed-off-by: Shukun Tan Reviewed-by: Zaibo Xu Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 64a6301ebee769073e84daa14eeee01125aef79d Author: Hui Tang Date: Fri May 15 17:13:57 2020 +0800 crypto: hisilicon/hpre - add debugfs for Hisilicon HPRE Add debugfs to provides IO operation debug information and add BD processing timeout count function Signed-off-by: Hui Tang Signed-off-by: Longfang Liu Signed-off-by: Shukun Tan Reviewed-by: Zaibo Xu Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 8213a1a60c5329501ff903339b248ceb84278cc3 Author: Kai Ye Date: Fri May 15 17:13:56 2020 +0800 crypto: hisilicon/sec2 - add debugfs for Hisilicon SEC Hisilicon SEC engine driver uses debugfs to provides IO operation debug information Signed-off-by: Kai Ye Signed-off-by: Longfang Liu Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 0a3a3960210b4bc6cfe5db45b4af714ee4a010e1 Author: Longfang Liu Date: Fri May 15 17:13:55 2020 +0800 crypto: hisilicon/qm - add debugfs to the QM state machine The QM driver uses debugfs to provides the current state of the QM state machine Signed-off-by: Longfang Liu Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 8502652542c6684dd142f74c1bd1772730f653bd Author: Longfang Liu Date: Fri May 15 17:13:54 2020 +0800 crypto: hisilicon/qm - add debugfs for QM Add DebugFS method to get the information of IRQ/Requests/QP .etc of QM for HPRE/ZIP/SEC drivers. Signed-off-by: Longfang Liu Signed-off-by: Shukun Tan Reviewed-by: Zaibo Xu Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 7795c0baf5ac25e104fec8677ad134066a8fb8d3 Author: Nicolas Toromanoff Date: Tue May 12 16:11:13 2020 +0200 crypto: stm32/crc32 - protect from concurrent accesses Protect STM32 CRC device from concurrent accesses. As we create a spinlocked section that increase with buffer size, we provide a module parameter to release the pressure by splitting critical section in chunks. Size of each chunk is defined in burst_size module parameter. By default burst_size=0, i.e. don't split incoming buffer. Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 100f84beee4874234d04a1ea642b8c9738d7020d Author: Nicolas Toromanoff Date: Tue May 12 16:11:12 2020 +0200 crypto: stm32/crc32 - don't sleep in runtime pm Ensure stm32_crc_update() and stm32_crc_init() can be called in atomic context and can't sleep. Add pm_runtime_irq_safe() to make pm_runtime_get_sync() atomic. Change runtime pm to call clk_enable()/clk_disable() and change system pm to unprepare/prepare the clock and force runtime pm suspend/resume. Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 10b89c43a64eb0d236903b79a3bc9d8f6cbfd9c7 Author: Nicolas Toromanoff Date: Tue May 12 16:11:11 2020 +0200 crypto: stm32/crc32 - fix multi-instance Ensure CRC algorithm is registered only once in crypto framework when there are several instances of CRC devices. Update the CRC device list management to avoid that only the first CRC instance is used. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit a8cc3128bf2c01c4d448fe17149e87132113b445 Author: Nicolas Toromanoff Date: Tue May 12 16:11:10 2020 +0200 crypto: stm32/crc32 - fix run-time self test issue. Fix wrong crc32 initialisation value: "alg: shash: stm32_crc32 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer" cra_name="crc32c" expects an init value of 0XFFFFFFFF, cra_name="crc32" expects an init value of 0. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 49c2c082e00e0bc4f5cbb7c21c7f0f873b35ab09 Author: Nicolas Toromanoff Date: Tue May 12 16:11:09 2020 +0200 crypto: stm32/crc32 - fix ext4 chksum BUG_ON() Allow use of crc_update without prior call to crc_init. And change (and fix) driver to use CRC device even on unaligned buffers. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 03f8c1b350d001db4e3912095f09a68740a7ff23 Author: Kishon Vijay Abraham I Date: Fri Dec 20 15:35:50 2019 +0530 PCI: dwc: Use private data pointer of "struct irq_domain" to get pcie_port No functional change. Get "struct pcie_port *" from private data pointer of "struct irq_domain" in dw_pcie_irq_domain_free() to make it look similar to how "struct pcie_port *" is obtained in dw_pcie_irq_domain_alloc() Link: https://lore.kernel.org/r/20191220100550.777-1-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Acked-by: Gustavo Pimentel commit 87dccf09323fc363bd0d072fcc12b96622ab8c69 Author: Marc Zyngier Date: Wed Apr 29 17:42:30 2020 +0100 PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link The vim3l board does not work with a standard PCIe switch (ASM1184e), spitting all kind of errors - hinting at HW misconfiguration (no link, port enumeration issues, etc). According to the the Synopsys DWC PCIe Reference Manual, in the section dedicated to the PLCR register, bit 7 is described (FAST_LINK_MODE) as: "Sets all internal timers to fast mode for simulation purposes." it is sound to set this bit from a simulation perspective, but on actual silicon, which expects timers to have a nominal value, it is not. Make sure the FAST_LINK_MODE bit is cleared when configuring the RC to solve this problem. Link: https://lore.kernel.org/r/20200429164230.309922-1-maz@kernel.org Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") Signed-off-by: Marc Zyngier [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Neil Armstrong Acked-by: Rob Herring commit 0414b93e78d87ecc24ae1a7e61fe97deb29fa2f4 Author: Marc Zyngier Date: Fri May 1 12:39:21 2020 +0100 PCI: dwc: Fix inner MSI IRQ domain registration On a system that uses the internal DWC MSI widget, I get this warning from debugfs when CONFIG_GENERIC_IRQ_DEBUGFS is selected: debugfs: File ':soc:pcie@fc000000' in directory 'domains' already present! This is due to the fact that the DWC MSI code tries to register two IRQ domains for the same firmware node, without telling the low level code how to distinguish them (by setting a bus token). This further confuses debugfs which tries to create corresponding files for each domain. Fix it by tagging the inner domain as DOMAIN_BUS_NEXUS, which is the closest thing we have as to "generic MSI". Link: https://lore.kernel.org/r/20200501113921.366597-1-maz@kernel.org Signed-off-by: Marc Zyngier Signed-off-by: Lorenzo Pieralisi Acked-by: Jingoo Han commit c8a119779f5609de8dcd98630f71cc7f1b2e4e8c Author: Wei Yongjun Date: Wed Apr 29 01:50:27 2020 +0000 PCI: dwc: pci-dra7xx: Use devm_platform_ioremap_resource_byname() platform_get_resource() may fail and return NULL, so we had better check its return value to avoid a NULL pointer dereference a bit later in the code. Fix it to use devm_platform_ioremap_resource_byname() instead of calling platform_get_resource_byname() and devm_ioremap(). Link: https://lore.kernel.org/r/20200429015027.134485-1-weiyongjun1@huawei.com Signed-off-by: Wei Yongjun [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi commit 558c1225a2f33a46ee31fba6f2bc4c4838d58752 Author: Jason Yan Date: Wed Apr 15 16:49:53 2020 +0800 PCI: dwc: intel: Make intel_pcie_cpu_addr() static Fix the following sparse warning: drivers/pci/controller/dwc/pcie-intel-gw.c:456:5: warning: symbol 'intel_pcie_cpu_addr' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200415084953.6533-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Lorenzo Pieralisi commit 668b4490a3a56f062172096692ebe9d12e26be5c Author: Alan Mikhak Date: Wed Apr 1 16:58:13 2020 -0700 PCI: dwc: Program outbound ATU upper limit register Function dw_pcie_prog_outbound_atu_unroll() does not program the upper 32-bit ATU limit register. Since ATU programming functions limit the size of the translated region to 4GB by using a u32 size parameter, these issues may combine into undefined behavior for resource sizes with non-zero upper 32-bits. For example, a 128GB address space starting at physical CPU address of 0x2000000000 with size of 0x2000000000 needs the following values programmed into the lower and upper 32-bit limit registers: 0x3fffffff in the upper 32-bit limit register 0xffffffff in the lower 32-bit limit register Currently, only the lower 32-bit limit register is programmed with a value of 0xffffffff but the upper 32-bit limit register is not being programmed. As a result, the upper 32-bit limit register remains at its default value after reset of 0x0. These issues may combine to produce undefined behavior since the ATU limit address may be lower than the ATU base address. Programming the upper ATU limit address register prevents such undefined behavior despite the region size getting truncated due to the 32-bit size limit. Link: https://lore.kernel.org/r/1585785493-23210-1-git-send-email-alan.mikhak@sifive.com Signed-off-by: Alan Mikhak Signed-off-by: Lorenzo Pieralisi Acked-by: Gustavo Pimentel commit 8054eadca71492f1c9421bcd58ac40f61d5e6e61 Merge: 4e17f63e2c58 3bce5377ef66 Author: Guenter Roeck Date: Fri May 22 06:29:55 2020 -0700 Merge tag 'ib-mfd-hwmon-v5.8' into hwmon-next Immutable branch between MFD and HWMON due for the v5.8 merge window commit 4e17f63e2c58d57e11f547fc9e833f4e5e5c067e Author: Naveen Krishna Chatradhi Date: Tue May 19 21:20:11 2020 +0530 MAINTAINERS: add entry for AMD energy driver The kernel driver is part of HWMON subsystem. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20200519155011.56184-3-nchatrad@amd.com Signed-off-by: Guenter Roeck commit b968279625a95fc6ae544713282c28a56a50d37e Author: Naveen Krishna Chatradhi Date: Tue May 19 21:20:10 2020 +0530 hwmon: (amd_energy) Add documentation Document amd_energy driver with energy sensors supported by it. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20200519155011.56184-2-nchatrad@amd.com Signed-off-by: Guenter Roeck commit 8abee9566b7e8eecf566c4daf6be062a27369890 Author: Naveen Krishna Chatradhi Date: Tue May 19 21:20:09 2020 +0530 hwmon: Add amd_energy driver to report energy counters This patch adds hwmon based amd_energy driver support for family 17h processors from AMD. The driver provides following interface to the userspace 1. Reports the per core consumption * file: "energy%d_input", label: "Ecore%03d" 2. Reports per socket energy consumption * file: "energy%d_input", label: "Esocket%d" 3. To, increase the wrap around time of the socket energy counters, a 64bit accumultor is implemented. 4. Reports scaled energy value in Joules. Cc: Guenter Roeck Signed-off-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20200519155011.56184-1-nchatrad@amd.com Signed-off-by: Guenter Roeck commit d06f9e6c8960d1b27245e3fe149c3a32a4894d4b Author: hailizheng Date: Tue May 19 08:25:19 2020 -0400 hwmon: (nct7802) Replace container_of() API Replace container_of() API with kobj_to_dev(). Signed-off-by: hailizheng Link: https://lore.kernel.org/r/1589891119-16508-1-git-send-email-haili.zheng@powercore.com.cn Signed-off-by: Guenter Roeck commit 229d495d8189ae785dacee72e5633a58edc25ddf Author: Josh Lehan Date: Wed May 13 11:42:48 2020 -0700 hwmon: (lm90) Add max6654 support to lm90 driver Add support for the Maxim MAX6654 to the lm90 driver. The MAX6654 is a temperature sensor, similar to the others, but with some differences regarding the configuration register, and the sampling rate at which extended resolution becomes possible. Signed-off-by: Josh Lehan Link: https://lore.kernel.org/r/20200513184248.145765-1-krellan@google.com Signed-off-by: Guenter Roeck commit 036855a4c3b3703ef44b5edb83b794d1b99d51f6 Author: zhouchuangao Date: Mon May 11 11:43:06 2020 +0800 hwmon : (nct6775) Use kobj_to_dev() API Use kobj_to_dev() API instead of container_of(). Signed-off-by: zhouchuangao Signed-off-by: Guenter Roeck commit 2138f8853a00b2d680889a684e92556074fcf901 Author: Guenter Roeck Date: Sat Dec 14 06:37:31 2019 -0800 hwmon: (pmbus) Driver for Maxim MAX16601 MAX16601 is a VR13.HC Dual-Output Voltage Regulator Chipset, implementing a (8+1) multiphase synchronous buck converter. Cc: Alex Qiu Signed-off-by: Guenter Roeck commit d86f3c9bba20426ebb31c3a3d061dd4a8b12c85b Author: Guenter Roeck Date: Thu May 7 10:21:33 2020 -0700 hwmon: (pmbus) Improve initialization of 'currpage' and 'currphase' The 'currpage' and 'currphase' variables in struct pmbus_data are used by the PMBus core to determine if the phase or page value has changed. Both are initialized with values which are never expected to be set in the code to ensure that the first page/phase write operation is actually performed. This is not well explained and occasionally causes confusion. Change the type of both variables to s16 and initialize with -1 to ensure that the initial value never matches a requested value, and clarify that this value means "unknown/unset". Cc: Alex Qiu Signed-off-by: Guenter Roeck commit 6e0498dd5c8dc0c25d7426842e3bf5236ea39914 Author: Wolfram Sang Date: Sat May 2 16:27:00 2020 +0200 hwmon: (adt7411) update contact email My 'pengutronix' address is defunct for years. Merge the entries and use the proper contact address. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20200502142700.19254-1-wsa@kernel.org Signed-off-by: Guenter Roeck commit 8cbf217223fba3753c6425c6c1686580347c9b42 Author: Michal Orzel Date: Thu Apr 30 16:05:34 2020 +0200 hwmon: (lm75) Fix all coding-style warnings on lm75 driver Check/fix all warnings generated by checkpatch.pl script on LM75 driver. Signed-off-by: Michal Orzel Signed-off-by: Guenter Roeck commit 44e3ad882bb268563766c45cd842a229dd3a4902 Author: Akinobu Mita Date: Mon May 4 23:57:44 2020 +0900 hwmon: Reduce indentation level in __hwmon_device_register() Reduce indentation level in __hwmon_device_register() by preparing a helper function. This just improves code readability. No functional change. Cc: Jean Delvare Cc: Guenter Roeck Signed-off-by: Akinobu Mita Signed-off-by: Guenter Roeck commit 5a56a39be7ffb416dd5ec5e1489d5a3a8b6a63f2 Author: Alex Qiu Date: Mon May 4 17:59:45 2020 -0700 hwmon: (ina2xx) Implement alert functions Implement alert functions for INA226, INA230 and INA231. Expose 06h Mask/Enable and 07h Alert Limit registers via alert setting and alarm files. Signed-off-by: Alex Qiu Signed-off-by: Guenter Roeck commit b58bd4c6dfe709646ed9efcbba2a70643f9bc873 Author: Andrej Picej Date: Thu Apr 23 15:27:33 2020 +0200 hwmon: (lm70) Add support for ACPI This commit adds support for lm70 commpatible drivers with systems that use ACPI. Signed-off-by: Andrej Picej [groeck: Fix various issues seen if CONFIG_ACPI=n] Signed-off-by: Guenter Roeck commit b8a13e5e8f37eeca28da8ce027df7ab7f4a79cb4 Author: Thomas Hebb Date: Sat Apr 4 16:49:00 2020 -0400 hwmon: (dell-smm) Use one DMI match for all XPS models Currently, each new XPS has to be added manually for module autoloading to work. Since fan multiplier autodetection should work fine on all XPS models, just match them all with one block like is done for Precision and Studio. The only match we replace that doesn't already use autodetection is "XPS13" which, according to Google, only matches the XPS 13 9333. (All other XPS 13 models have "XPS" as its own word, surrounded by spaces.) According to the thread at [1], autodetection works for the XPS 13 9333, meaning this shouldn't regress it. I do not own one to confirm with, though. Tested on an XPS 13 9350 and confirmed the module now autoloads and reports reasonable-looking data. I am using BIOS 1.12.2 and do not see any freezes when querying fan speed. [1] https://lore.kernel.org/patchwork/patch/525367/ Signed-off-by: Thomas Hebb Acked-by: Pali Rohár Link: https://lore.kernel.org/r/5d7e498b83e89ce7c41a449b61919c65d0770b73.1586033337.git.tommyhebb@gmail.com Signed-off-by: Guenter Roeck commit 77849a552d142ef5fdc52ac573852b2c1f568eb7 Author: Yuechao Zhao Date: Tue Mar 31 05:28:50 2020 +0000 hwmon: (nct7904) Add watchdog function Implement watchdog functionality for NCT7904. Signed-off-by: Yuechao Zhao Link: https://lore.kernel.org/r/20200331052850.5419-1-yuechao.zhao@advantech.com.cn [groeck: Squashed fixup patch] Signed-off-by: Guenter Roeck commit 36f8f189b8252164bea1e9bf8c9569208bdbdd71 Merge: 39690c8d1fa3 4fdc03a9bc47 Author: Mark Brown Date: Fri May 22 14:13:18 2020 +0100 Merge series "spi: dw: Add generic DW DMA controller support" from Serge Semin : Baikal-T1 SoC provides a DW DMA controller to perform low-speed peripherals Mem-to-Dev and Dev-to-Mem transaction. This is also applicable to the DW APB SSI devices embedded into the SoC. Currently the DMA-based transfers are supported by the DW APB SPI driver only as a middle layer code for Intel MID/Elkhart PCI devices. Seeing the same code can be used for normal platform DMAC device we introduced a set of patches to fix it within this series. First of all we need to add the Tx and Rx DMA channels support into the DW APB SSI binding. Then there are several fixes and cleanups provided as a initial preparation for the Generic DMA support integration: add Tx/Rx finish wait methods, clear DMAC register when done or stopped, Fix native CS being unset, enable interrupts in accordance with DMA xfer mode, discard static DW DMA slave structures, discard unused void priv pointer and dma_width member of the dw_spi structure, provide the DMA Tx/Rx burst length parametrisation and make sure it's optionally set in accordance with the DMA max-burst capability. In order to have the DW APB SSI MMIO driver working with DMA we need to initialize the paddr field with the physical base address of the DW APB SSI registers space. Then we unpin the Intel MID specific code from the generic DMA one and placed it into the spi-dw-pci.c driver, which is a better place for it anyway. After that the naming cleanups are performed since the code is going to be used for a generic DMAC device. Finally the Generic DMA initialization can be added to the generic version of the DW APB SSI IP. Last but not least we traditionally convert the legacy plain text-based dt-binding file with yaml-based one and as a cherry on a cake replace the manually written DebugFS registers read method with a ready-to-use for the same purpose regset32 DebugFS interface usage. This patchset is rebased and tested on the spi/for-next (5.7-rc5): base-commit: fe9fce6b2cf3 ("Merge remote-tracking branch 'spi/for-5.8' into spi-next") Link: https://lore.kernel.org/linux-spi/20200508132943.9826-1-Sergey.Semin@baikalelectronics.ru/ Changelog v2: - Rebase on top of the spi repository for-next branch. - Move bindings conversion patch to the tail of the series. - Move fixes to the head of the series. - Apply as many changes as possible to be applied the Generic DMA functionality support is added and the spi-dw-mid is moved to the spi-dw-dma driver. - Discard patch "spi: dw: Fix dma_slave_config used partly uninitialized" since the problem has already been fixed. - Add new patch "spi: dw: Discard unused void priv pointer". - Add new patch "spi: dw: Discard dma_width member of the dw_spi structure". n_bytes member of the DW SPI data can be used instead. - Build the DMA functionality into the DW APB SSI core if required instead of creating a separate kernel module. - Use conditional statement instead of the ternary operator in the ref clock getter. Link: https://lore.kernel.org/linux-spi/20200515104758.6934-1-Sergey.Semin@baikalelectronics.ru/ Changelog v3: - Use spi_delay_exec() method to wait for the DMA operation completion. - Explicitly initialize the dw_dma_slave members on stack. - Discard the dws->fifo_len utilization in the Tx FIFO DMA threshold setting from the patch where we just add the default burst length constants. - Use min() method to calculate the optimal burst values. - Add new patch which moves the spi-dw.c source file to spi-dw-core.c in order to preserve the DW APB SSI core driver name. - Add commas in the debugfs_reg32 structure initializer and after the last entry of the dw_spi_dbgfs_regs array. Link: https://lore.kernel.org/linux-spi/20200521012206.14472-1-Sergey.Semin@baikalelectronics.ru Changelog v4: - Get back ndelay() method to wait for an SPI transfer completion. spi_delay_exec() isn't suitable for the atomic context. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-spi@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (16): spi: dw: Add Tx/Rx finish wait methods to the MID DMA spi: dw: Enable interrupts in accordance with DMA xfer mode spi: dw: Discard static DW DMA slave structures spi: dw: Discard unused void priv pointer spi: dw: Discard dma_width member of the dw_spi structure spi: dw: Parameterize the DMA Rx/Tx burst length spi: dw: Use DMA max burst to set the request thresholds spi: dw: Fix Rx-only DMA transfers spi: dw: Add core suffix to the DW APB SSI core source file spi: dw: Move Non-DMA code to the DW PCIe-SPI driver spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core spi: dw: Cleanup generic DW DMA code namings spi: dw: Add DMA support to the DW SPI MMIO driver spi: dw: Use regset32 DebugFS method to create regdump file dt-bindings: spi: Convert DW SPI binding to DT schema .../bindings/spi/snps,dw-apb-ssi.txt | 44 --- .../bindings/spi/snps,dw-apb-ssi.yaml | 127 +++++++++ .../devicetree/bindings/spi/spi-dw.txt | 24 -- drivers/spi/Kconfig | 15 +- drivers/spi/Makefile | 5 +- drivers/spi/{spi-dw.c => spi-dw-core.c} | 88 ++---- drivers/spi/{spi-dw-mid.c => spi-dw-dma.c} | 261 ++++++++++-------- drivers/spi/spi-dw-mmio.c | 4 + drivers/spi/spi-dw-pci.c | 50 +++- drivers/spi/spi-dw.h | 33 ++- 10 files changed, 392 insertions(+), 259 deletions(-) delete mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt create mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml delete mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt rename drivers/spi/{spi-dw.c => spi-dw-core.c} (82%) rename drivers/spi/{spi-dw-mid.c => spi-dw-dma.c} (55%) -- 2.25.1 commit 39690c8d1fa3cda70aaed9afc8cba3c0a8eb1f53 Author: Christopher Hill Date: Thu May 21 14:36:31 2020 -0400 spi: rb4xx: add corresponding device tree documentation This patch adds the correcsponding MikroTik vendor and device tree documentation Signed-off-by: Christopher Hill Link: https://lore.kernel.org/r/20200521183631.37806-3-ch6574@gmail.com Signed-off-by: Mark Brown commit 9a436c62fbb4c57c6f0be01e4fc368ed5da6b730 Author: Christopher Hill Date: Thu May 21 14:36:30 2020 -0400 spi: rb4xx: update driver to be device tree aware This patch updates the spi driver spi-rb4xx.c to be device tree aware Signed-off-by: Christopher Hill Link: https://lore.kernel.org/r/20200521183631.37806-2-ch6574@gmail.com Signed-off-by: Mark Brown commit 678e5e1e42d74f77a6e2e9feb6f95ed72a996251 Author: Christopher Hill Date: Thu May 21 14:36:29 2020 -0400 spi: rb4xx: null pointer bug fix This patch fixes a null pointer bug in the spi driver spi-rb4xx.c by moving the private data initialization to earlier in probe Signed-off-by: Christopher Hill Link: https://lore.kernel.org/r/20200521183631.37806-1-ch6574@gmail.com Signed-off-by: Mark Brown commit 91a087153d9db2aaabd4fddcb3fa12fa10168136 Author: Chengguang Xu Date: Fri May 22 12:40:35 2020 +0800 ext2: code cleanup by removing ifdef macro surrounding Define ext2_listxattr to NULL when CONFIG_EROFS_FS_XATTR is not enabled, then we can remove many ugly ifdef macros in the code. Link: https://lore.kernel.org/r/20200522044035.24190-2-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara commit 10b2006681333a14a907a06a0e213c568fa8e7f4 Author: Jon Hunter Date: Wed May 20 16:12:06 2020 +0100 firmware: tegra: Defer BPMP probe if shared memory not available Since commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when adding all top level devices") was added, the probing of the Tegra SRAM device has occurred later in the boot sequence, after the BPMP has been probed. The BPMP uses sections of the SRAM for shared memory and if the BPMP is probed before the SRAM then it fails to probe and never tries again. This is causing a boot failure on Tegra186 and Tegra194. Fix this by allowing the probe of the BPMP to be deferred if the SRAM is not available yet. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 358a6777f5dd293bc3c075af6fc8c0dd18774c96 Author: Jon Hunter Date: Wed May 20 16:13:18 2020 +0100 arm64: tegra: Make the RTC a wakeup source on Jetson Nano and TX1 The RTC found on the MAX77620 PMIC can be used as a wakeup source on Jetson Nano and TX1, which is useful to wake the system from suspend at a given time. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit df701a76a6419e66b566457a5b3fcdd314e48fd9 Author: Jon Hunter Date: Wed May 20 16:13:17 2020 +0100 soc/tegra: pmc: Enable PMIC wake event on Tegra210 The PMIC wake event can be used to bring the system out of suspend based on certain events happening on the PMIC (such as an RTC alarm). Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 4fdc03a9bc47b6cf35a8821e545075d9f5f24906 Author: Serge Semin Date: Fri May 22 03:07:54 2020 +0300 spi: dw: Discard dma_width member of the dw_spi structure This member has exactly the same value as n_bytes of the DW SPI private data object, it's calculated at the same point of the transfer method, n_bytes isn't changed during the whole transfer, and they even serve for the same purpose - keep number of bytes per transfer word, though the dma_width is used only to calculate the DMA source/destination addresses width, which n_bytes could be also utilized for. Taking all of these into account let's replace the dma_width member usage with n_bytes one and remove the former. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200522000806.7381-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 595c19d4543fed18384fd7d1edf6f381d4eed34e Author: Serge Semin Date: Fri May 22 03:07:53 2020 +0300 spi: dw: Discard unused void priv pointer Seeing the "void *priv" member of the dw_spi data structure is unused let's remove it. The glue-layers can embed the DW APB SSI controller descriptor into their private data object. MMIO driver for instance already utilizes that design pattern. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200522000806.7381-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 2afccbd283ae63072391ea17ac1d772ed9d33749 Author: Serge Semin Date: Fri May 22 03:07:52 2020 +0300 spi: dw: Discard static DW DMA slave structures Having them declared is redundant since each struct dw_dma_chan has the same structure embedded and the structure from the passed dma_chan private pointer will be copied there as a result of the next calls chain: dma_request_channel() -> find_candidate() -> dma_chan_get() -> device_alloc_chan_resources() = dwc_alloc_chan_resources() -> dw_dma_filter(). So just remove the static dw_dma_chan structures and use a locally declared data instance with dst_id/src_id set to the same values as the static copies used to have. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200522000806.7381-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 43dba9f3f98c2b184a19f856f06fe22817bfd9e0 Author: Serge Semin Date: Fri May 22 03:07:51 2020 +0300 spi: dw: Enable interrupts in accordance with DMA xfer mode It's pointless to track the Tx overrun interrupts if Rx-only SPI transfer is issued. Similarly there is no need in handling the Rx overrun/underrun interrupts if Tx-only SPI transfer is executed. So lets unmask the interrupts only if corresponding SPI transactions are implied. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200522000806.7381-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 472f0a240250df443ffc4f39835e829916193ca1 Author: YueHaibing Date: Fri May 22 11:45:33 2020 +0800 mt76: mt7915: Fix build error In file included from ./include/linux/firmware.h:6:0, from drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:4: In function ‘__mt7915_mcu_msg_send’, inlined from ‘mt7915_mcu_send_message’ at drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:370:6: ./include/linux/compiler.h:396:38: error: call to ‘__compiletime_assert_545’ declared with attribute error: BUILD_BUG_ON failed: cmd == MCU_EXT_CMD_EFUSE_ACCESS && mcu_txd->set_query != MCU_Q_QUERY _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ ./include/linux/compiler.h:377:4: note: in definition of macro ‘__compiletime_assert’ prefix ## suffix(); \ ^~~~~~ ./include/linux/compiler.h:396:2: note: in expansion of macro ‘_compiletime_assert’ _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) ^~~~~~~~~~~~~~~~ drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:280:2: note: in expansion of macro ‘BUILD_BUG_ON’ BUILD_BUG_ON(cmd == MCU_EXT_CMD_EFUSE_ACCESS && ^~~~~~~~~~~~ BUILD_BUG_ON is meaningless here, chang it to WARN_ON. Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Signed-off-by: YueHaibing Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200522034533.61716-1-yuehaibing@huawei.com commit 8939a3af5c08daca7914c53d9f99c222569b6509 Author: Chengguang Xu Date: Fri May 22 12:40:34 2020 +0800 ext2: Fix i_op setting for special inode Let's always set special inode i_op to &ext2_special_inode_operations regardless of CONFIG_EXT2_FS_XATTR setting. It makes sence to be able to query extended inode flags (needing ->setattr and ->getattr callbacks) even when CONFIG_EXT2_FS_XATTR is not set. Link: https://lore.kernel.org/r/20200522044035.24190-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara commit cf78bb0bbcef3fbe1abf118f14b81dad36eaa94e Author: Antonio Quartulli Date: Wed May 20 10:41:40 2020 +0200 batman-adv: use rcu_replace_pointer() where appropriate In commit a63fc6b75cca ("rcu: Upgrade rcu_swap_protected() to rcu_replace_pointer()") a new helper macro named rcu_replace_pointer() was introduced to simplify code requiring to switch an rcu pointer to a new value while extracting the old one. Use rcu_replace_pointer() where appropriate to make code slimer. Signed-off-by: Antonio Quartulli Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 2092c910e2399c9e13b199c07421133681b9eaff Author: Sven Eckelmann Date: Wed May 6 22:13:30 2020 +0200 batman-adv: Revert "Drop lockdep.h include for soft-interface.c" The commit 1a33e10e4a95 ("net: partially revert dynamic lockdep key changes") reverts the commit ab92d68fc22f ("net: core: add generic lockdep keys"). But it forgot to also revert the commit 5759af0682b3 ("batman-adv: Drop lockdep.h include for soft-interface.c") which depends on the latter. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 0c680ffb99ea4022b97fbbf831da46b0f90958a5 Author: Jonathan Bakker Date: Sat May 16 12:47:58 2020 -0700 regulator/mfd: max8998: Document charger regulator max8998 has a current regulator for control of its charging current. Document it. Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/BN6PR04MB06600D05B27BAE69970E3C30A3BA0@BN6PR04MB0660.namprd04.prod.outlook.com Signed-off-by: Mark Brown commit 4ffea5e083f8125fe273cf331ecb10d901eb64a2 Author: Jonathan Bakker Date: Sat May 16 12:47:59 2020 -0700 regulator: max8998: Add charger regulator The max8998 has a current regulator for charging control. The charger driver in drivers/power/supply/max8998_charger.c has a comment in it stating that 'charger control is done by a current regulator "CHARGER"', but this regulator was never added until now. The current values have been extracted from a downstream driver for the SGH-T959V. Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/BN6PR04MB0660E1F4A3D5A348BE88311CA3BA0@BN6PR04MB0660.namprd04.prod.outlook.com Signed-off-by: Mark Brown commit 168aac9de09551bb0ac9bd3b7a311cd681894fc3 Author: Robert Jarzmik Date: Thu May 21 20:51:39 2020 +0200 ASoC: pxa: remove Compulab pxa2xx boards As these boards have been removed from the pxa tree, amend accordingly the sound subsystem. Signed-off-by: Robert Jarzmik Acked-by: Mike Rapoport Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200521185140.27276-3-robert.jarzmik@free.fr Signed-off-by: Mark Brown commit 1446978d560fd708af4dfc10863109bc098e5b26 Author: Jon Derrick Date: Mon May 11 12:21:17 2020 -0400 PCI: pci-bridge-emul: Eliminate the 'reserved' member Per PCIe 5.0 r1.0, Terms and Acronyms, Page 80: Reserved register fields must be read only and must return 0 (all 0's for multi-bit fields) when read. Reserved encodings for register and packet fields must not be used. Any implementation dependence on a Reserved field value or encoding will result in an implementation that is not PCI Express-compliant. This patch ensures reads will return 0 for any bit not in the Read-Only, Read-Write, or Write-1-to-Clear bitmasks. Link: https://lore.kernel.org/r/20200511162117.6674-5-jonathan.derrick@intel.com Signed-off-by: Jon Derrick Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 2960865127d77bce085d349c94d49faf51517df3 Author: Jon Derrick Date: Mon May 11 12:21:16 2020 -0400 PCI: pci-bridge-emul: Update for PCIe 5.0 r1.0 Add missing bits from PCIe 4.0 and updates for PCIe 5.0 r1.0. PCIe 4.0: Device Status bit 6 - W1C - Emergency Power Reduction Detected Link Control bits 15:14 - RW - DRS Signaling Control Slot Control bit 13 - RW - Auto Slow Power Limit Disable PCIe 5.0: Slot Control bit 14 - RW - In-Band PD Disable Link: https://lore.kernel.org/r/20200511162117.6674-4-jonathan.derrick@intel.com Signed-off-by: Jon Derrick Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit f61959b6e240640d46b65b4dd93b3144d3895ef6 Author: Jon Derrick Date: Mon May 11 12:21:15 2020 -0400 PCI: pci-bridge-emul: Fix Root Cap/Status comment The upper 16-bits of Root Control contain the Root Capabilities register. The code instead describes the Root Status register in the upper 16-bits, although it uses the correct bit definition for Root Capabilities, and for Root Status in the next definition. Fix this comment and add a comment describing the Root Status register. Link: https://lore.kernel.org/r/20200511162117.6674-3-jonathan.derrick@intel.com Signed-off-by: Jon Derrick Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit c88d19181771bd189147681ef38fc1533ebeff4c Author: Jon Derrick Date: Mon May 11 12:21:14 2020 -0400 PCI: pci-bridge-emul: Fix PCIe bit conflicts This patch fixes two bit conflicts in the pci-bridge-emul driver: 1. Bit 3 of Device Status (19 of Device Control) is marked as both Write-1-to-Clear and Read-Only. It should be Write-1-to-Clear. The Read-Only and Reserved bitmasks are shifted by 1 bit due to this error. 2. Bit 12 of Slot Control is marked as both Read-Write and Reserved. It should be Read-Write. Link: https://lore.kernel.org/r/20200511162117.6674-2-jonathan.derrick@intel.com Signed-off-by: Jon Derrick Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 56ad4a1b368a56d7b8f4613fabd90f63099b9bb2 Author: Lad Prabhakar Date: Thu May 7 13:33:19 2020 +0100 MAINTAINERS: Add file patterns for rcar PCI device tree bindings Add file pattern entry for rcar PCI devicetree binding, so that when people run ./scripts/get_maintainer.pl the rcar PCI maintainers could also be listed. Link: https://lore.kernel.org/r/1588854799-13710-9-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda commit 2a6d0d63d99956a66f6605832f11755d74a41951 Author: Lad Prabhakar Date: Thu May 7 13:33:18 2020 +0100 PCI: rcar: Add endpoint mode support Add support for R-Car PCIe controller to work in endpoint mode. Link: https://lore.kernel.org/r/1588854799-13710-8-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda commit 4c0f80920923f1033e9fe048f44b6e1ffe18c58d Author: Lad Prabhakar Date: Thu May 7 13:33:17 2020 +0100 dt-bindings: PCI: rcar: Add bindings for R-Car PCIe endpoint controller This patch adds the bindings for the R-Car PCIe endpoint driver. Link: https://lore.kernel.org/r/1588854799-13710-7-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Reviewed-by: Yoshihiro Shimoda commit d45e3c1a5979efd40dbbac9a5c3586f4fa41f734 Author: Lad Prabhakar Date: Thu May 7 13:33:16 2020 +0100 PCI: endpoint: Add support to handle multiple base for mapping outbound memory R-Car PCIe controller has support to map multiple memory regions for mapping the outbound memory in local system also the controller limits single allocation for each region (that is, once a chunk is used from the region it cannot be used to allocate a new one). This features inspires to add support for handling multiple memory bases in endpoint framework. With this patch pci_epc_mem_init() initializes address space for endpoint controller which support single window and pci_epc_multi_mem_init() initializes multiple windows supported by endpoint controller. Link: https://lore.kernel.org/r/1588854799-13710-6-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda Acked-by: Kishon Vijay Abraham I commit d6ee6529436a15a0541aff6e1697989ee7dc2c44 Author: Fangrui Song Date: Wed May 20 11:20:10 2020 -0700 x86/boot: Discard .discard.unreachable for arch/x86/boot/compressed/vmlinux With commit ce5e3f909fc0 ("efi/printf: Add 64-bit and 8-bit integer support") arch/x86/boot/compressed/vmlinux may have an undesired .discard.unreachable section coming from drivers/firmware/efi/libstub/vsprintf.stub.o. That section gets generated from unreachable() annotations when CONFIG_STACK_VALIDATION is enabled. .discard.unreachable contains an R_X86_64_PC32 relocation which will be warned about by LLD: a non-SHF_ALLOC section (.discard.unreachable) is not part of the memory image, thus conceptually the distance between a non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at link time: % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds ... -o arch/x86/boot/compressed/vmlinux ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol '' Reuse the DISCARDS macro which includes .discard.* to drop .discard.unreachable. [ bp: Massage and complete the commit message. ] Reported-by: kbuild test robot Signed-off-by: Fangrui Song Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Tested-by: Arvind Sankar Tested-by: Sedat Dilek Link: https://lkml.kernel.org/r/20200520182010.242489-1-maskray@google.com commit 2aa916e67db3e625cc0bfe577f67034a46f81c8a Author: Daniel Mack Date: Thu May 21 11:11:52 2020 +0200 sc16is7xx: Read the LSR register for basic device presence check Currently, the driver probes just fine and binds all its resources even if the physical device is not present. As the device lacks an identification register, let's at least read the LSR register to check whether a device at the configured address responds to the request at all. Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20200521091152.404404-7-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit 2d12fc792cdd43da8502de4a425a98e520b1c302 Author: Daniel Mack Date: Thu May 21 11:11:51 2020 +0200 sc16is7xx: Allow sharing the IRQ line When the interrupt line is shared with other devices, the IRQ must be level-triggered, as only one device can trigger a falling edge. To support this, try to acquire the IRQ with IRQF_TRIGGER_LOW|IRQF_SHARED first. Interrupt controllers that lack support for level-triggers will return an error, in which case the driver will now retry the acqusition with IRQF_TRIGGER_FALLING, which was also the default before. Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20200521091152.404404-6-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit 6393ff1c4435acc343b1481f5b834b918cb42b12 Author: Daniel Mack Date: Thu May 21 11:11:50 2020 +0200 sc16is7xx: Use threaded IRQ Use a threaded IRQ handler to get rid of the irq_work kthread. This also allows for the driver to use interrupts generated by a threaded controller. Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20200521091152.404404-5-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit 37f3965d74d5b5c914f8f8a108ae1d94ab5ffae3 Author: Daniel Mack Date: Thu May 21 11:11:49 2020 +0200 sc16is7xx: Always use falling edge IRQ The driver currently only uses IRQF_TRIGGER_FALLING if the probing happened without a device-tree setup. The device however will always generate falling edges on its IRQ line, so let's use that flag in all cases. Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20200521091152.404404-4-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit 1dfb74b1ea6d8e5977a9bdc0915f22934b33d8ea Author: Malcolm Priestley Date: Thu May 21 10:57:47 2020 +0100 staging: vt6656: move key frag controls to vnt_fill_txkey vnt_fill_txkey now has access to tx_buffer move cipher frag controls The icv_len is the only thing needed from hw_key in vnt_tx_packet. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/bb91b159-387a-005b-f614-c541de128c40@gmail.com Signed-off-by: Greg Kroah-Hartman commit dc6490b0c5058c44868b3921cfd3b2a223ee038c Author: Malcolm Priestley Date: Thu May 21 10:54:29 2020 +0100 staging: vt6656: Move calling point of vnt_fill_txkey. Change vnt_fill_txkey to return true if mic_hdr is needed and change calling point at where it is to be placed. tx_buffer is already in tx_context. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/f08a6f07-a77e-0b8e-cb05-505a1f995683@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4f1b5df4205b0f42019b635e00cc5eeff99481ce Author: Malcolm Priestley Date: Thu May 21 10:49:41 2020 +0100 staging: vt6656: Move tx_key inside vnt_fill_txkey. tx_key can be got directly from info. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/1b964a6c-5cf7-e675-cf53-3a632acc0be9@gmail.com Signed-off-by: Greg Kroah-Hartman commit f79c9fa340c27a48fefc9f5141fad0277db33eb4 Author: Malcolm Priestley Date: Thu May 21 10:47:25 2020 +0100 staging: vt6656: move tx_body_size/payload_len to skb->len both variables can be removed and replaced with skb->len. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/12e96cb5-a2a5-de3c-ebe7-ca5a4e2b5594@gmail.com Signed-off-by: Greg Kroah-Hartman commit cf51f55311f49303a3c6159f37dc80a00c2b967a Author: Malcolm Priestley Date: Thu May 21 10:43:57 2020 +0100 staging: vt6656: Move key_buffer inside vnt_fill_txkey. Use vnt_tx_fifo_head to point directly at tx_key removing key_buffer. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/3631f327-1386-90a2-ba9a-bb62617f3c66@gmail.com Signed-off-by: Greg Kroah-Hartman commit e76d9db0cba142721bad17a1aba4599d23810a74 Author: Malcolm Priestley Date: Thu May 21 10:42:14 2020 +0100 staging: vt6656: rxtx use ieee80211_tx_info for rts/cts control Use the control for rts/cts exhanges replacing need_rts and use_cts_prot for packet type PK_TYPE_11GB / PK_TYPE_11GA Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/1b21b3db-b9ef-c167-8f88-b32646ba5a19@gmail.com Signed-off-by: Greg Kroah-Hartman commit 017af521a7138270ac56199b499390b72a28cc47 Author: Malcolm Priestley Date: Thu May 21 10:40:16 2020 +0100 staging: vt6656: use ieee80211_tx_info to replace need_mic Use the info->control.hw_key to replace need mic which is only present when info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/e8969f47-ffc7-6eb6-9f3c-72b06970c1b8@gmail.com Signed-off-by: Greg Kroah-Hartman commit 272c25c62eafcac921530cc8adc79bf000388e22 Author: Malcolm Priestley Date: Thu May 21 10:38:26 2020 +0100 staging: vt6656: Move vnt_mic_hdr pointers to vnt_fill_txkey mic_hdr has three possible locations ieee80211_tx_info can controls these with control.use_cts_prot for rts or cts exchange or otherwise the rts/data position. Removing double pointer. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/6420a6ae-82eb-f794-fa7c-bac419222ad6@gmail.com Signed-off-by: Greg Kroah-Hartman commit a0b44f1422197f5103889205f171a61024864522 Author: Malcolm Priestley Date: Thu May 21 10:33:11 2020 +0100 staging: vt6656: rxtx remove unused need_ack need_ack is no longer used by driver remove it. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/f19dfbde-23a6-ba79-d988-576d2e3bcf62@gmail.com Signed-off-by: Greg Kroah-Hartman commit 461aac1cbc8217bfc319c839798e7f18eba447c0 Author: Malcolm Priestley Date: Thu May 21 10:31:36 2020 +0100 staging: vt6656: remove ieee80211_hdr from vnt_usb_send_context. It is only used in one place were it can be pointed to at skb->data. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/556fab01-aa1e-154e-149e-c04feeb76efa@gmail.com Signed-off-by: Greg Kroah-Hartman commit 20edb44179e94c918eb9d5bfbe98d395d3cbe4d7 Author: Colin Ian King Date: Thu May 21 14:50:38 2020 +0100 staging: fbtft: fb_st7789v: make HSD20_IPS numeric and not a string Currently HSD20_IPS is defined as "true" and will always result in a non-zero result even if it is defined as "false" because it is an array and that will never be zero. Fix this by defining it as an integer 1 rather than a literal string. Addessses-Coverity: ("Array compared against 0") Fixes: f03c9b788472 ("staging: fbtft: fb_st7789v: Initialize the Display") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200521135038.345878-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 48021f98130880dd74286459a1ef48b5e9bc374f Author: Shreyas Joshi Date: Fri May 22 16:53:06 2020 +1000 printk: handle blank console arguments passed in. If uboot passes a blank string to console_setup then it results in a trashed memory. Ultimately, the kernel crashes during freeing up the memory. This fix checks if there is a blank parameter being passed to console_setup from uboot. In case it detects that the console parameter is blank then it doesn't setup the serial device and it gracefully exits. Link: https://lore.kernel.org/r/20200522065306.83-1-shreyas.joshi@biamp.com Signed-off-by: Shreyas Joshi Acked-by: Sergey Senozhatsky [pmladek@suse.com: Better format the commit message and code, remove unnecessary brackets.] Signed-off-by: Petr Mladek commit 709b41b56a16a5901a89dcaeb75d2233f80d9e55 Author: Bjorn Helgaas Date: Thu May 21 13:05:45 2020 -0500 misc: rtsx: Remove unnecessary rts5249_set_aspm(), rts5260_set_aspm() rts5249_set_aspm() and rts5260_set_aspm() do nothing more than the default rtsx_comm_set_aspm() does, so remove them and use the default. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200521180545.1159896-7-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman commit 05ffe36a092935bf50d573842ce62c9ad9893005 Author: Bjorn Helgaas Date: Thu May 21 13:05:44 2020 -0500 misc: rtsx: Simplify rtsx_comm_set_aspm() Simplify rtsx_comm_set_aspm() and remove the now-unused rtsx_pci_enable_aspm(). rtsx_pci_disable_aspm() is still used by rtsx_pci_init_hw(). Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200521180545.1159896-6-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3d1e7aa80d1c0e7ce8313f21c1e9c14a12d3ba48 Author: Bjorn Helgaas Date: Thu May 21 13:05:43 2020 -0500 misc: rtsx: Use pcie_capability_clear_and_set_word() for PCI_EXP_LNKCTL Instead of using the driver-specific rtsx_pci_update_cfg_byte() to update the PCIe Link Control Register, use pcie_capability_clear_and_set_word() like the rest of the kernel does. This makes it easier to maintain ASPM across the PCI core and drivers. Remove the now-unused rtsx_pci_update_cfg_byte() and ASPM_MASK_NEG definitions. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200521180545.1159896-5-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9ae577047e5bae5f2adf41eb3f02a1e3d75134e1 Author: Bjorn Helgaas Date: Thu May 21 13:05:42 2020 -0500 misc: rtsx: Use ASPM_MASK_NEG instead of hard-coded value Use ASPM_MASK_NEG instead of hard-coded value, as other callers of rtsx_pci_update_cfg_byte() do. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200521180545.1159896-4-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman commit 51876e22bf7f8f5d2b9ca7d2b3dcbfaaac2991a9 Author: Bjorn Helgaas Date: Thu May 21 13:05:41 2020 -0500 misc: rtsx: Removed unused dev_aspm_mode The struct rtsx_cr_option.dev_aspm_mode member is never set to anything other than DEV_ASPM_DYNAMIC (0). Remove it and code that tests it. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200521180545.1159896-3-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8786eda9a97763c768e2e81cfd7b4f420281b6e1 Author: Bjorn Helgaas Date: Thu May 21 13:05:40 2020 -0500 misc: rtsx: Remove unused pcr_ops Remove the following unused function pointers from struct pcr_ops: int (*set_ltr_latency)(struct rtsx_pcr *pcr, u32 latency); int (*set_l1off_sub)(struct rtsx_pcr *pcr, u8 val); void (*full_on)(struct rtsx_pcr *pcr); void (*power_saving)(struct rtsx_pcr *pcr); Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20200521180545.1159896-2-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman commit e18d4e9fa79bb27de6447c0c172bb1c428a52bb2 Author: Jeffrey Hugo Date: Thu May 21 22:32:49 2020 +0530 bus: mhi: core: Handle syserr during power_up The MHI device may be in the syserr state when we attempt to init it in power_up(). Since we have no local state, the handling is simple - reset the device and wait for it to transition out of the reset state. Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-15-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3bc1a5f431618a656bbf674a4627ef4da3a0d893 Author: Hemant Kumar Date: Thu May 21 22:32:48 2020 +0530 bus: mhi: core: Handle write lock properly in mhi_pm_m0_transition Take write lock only to protect db_mode member of mhi channel. This allows rest of the mhi channels to just take read lock which fine grains the locking. It prevents channel readers to starve if they try to enter critical section after a writer. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-14-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 30b7892417c50a05bf4a2ad56c2e1355d4d1404a Author: Hemant Kumar Date: Thu May 21 22:32:47 2020 +0530 bus: mhi: core: Do not process SYS_ERROR if RDDM is supported Devices that support RDDM do not require processing SYS_ERROR as it is deemed redundant. Avoid SYS_ERROR processing if RDDM is supported by the device. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-13-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit ada5e1def5da623cbf5709c921fd22cc321cd233 Author: Hemant Kumar Date: Thu May 21 22:32:46 2020 +0530 bus: mhi: core: Skip handling BHI irq if MHI reg access is not allowed Driver continues handling of BHI interrupt even if MHI register access is not allowed. By doing so it calls the status call back and performs early notification for the MHI client. This is not needed when MHI register access is not allowed. Hence skip the handling in this case and return. Also add debug log to print device state, local EE and device EE when reg access is valid. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-12-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3c1bd0047124f506294520341cfe03e19ea773e3 Author: Hemant Kumar Date: Thu May 21 22:32:45 2020 +0530 bus: mhi: core: Handle disable transitions in state worker Mission mode transition is handled by state worker thread but power off is not. There is a possibility while mission mode transition is in progress which calls MHI client driver probe, power off is issued by MHI controller. This results into client driver probe and remove running in parallel and causes use after free situation. By queuing disable transition work when mission mode is in progress prevents the race condition. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-11-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit bc7ccce5a5192cf277da0aef05e45cd92c81c79a Author: Hemant Kumar Date: Thu May 21 22:32:44 2020 +0530 bus: mhi: core: Remove the system error worker thread Remove the system error worker thread and instead have the execution environment worker handle that transition to serialize processing and avoid any possible race conditions during shutdown. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-10-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0ab9fcd0e7b2b45dd407e145f50fd55091405d3c Author: Bhaumik Bhatt Date: Thu May 21 22:32:43 2020 +0530 bus: mhi: core: Ensure non-zero session or sequence ID values are used While writing any sequence or session identifiers, it is possible that the host could write a zero value, whereas only non-zero values should be supported writes to those registers. Ensure that the host does not write a non-zero value for them and also log them in debug messages. A macro is introduced to simplify this check and the existing checks are also converted to use this macro. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-9-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0a895f091ebd943555efce3d7b0e96d667208fdc Author: Bhaumik Bhatt Date: Thu May 21 22:32:42 2020 +0530 bus: mhi: core: Improve debug logs for loading firmware Add log messages to track boot flow errors and timeouts in SBL or AMSS firmware loading to aid in debug. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-8-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit a21eaf592fad132cb60173ed494e54c5b9c82c9a Author: Bhaumik Bhatt Date: Thu May 21 22:32:41 2020 +0530 bus: mhi: core: Return appropriate error codes for AMSS load failure When loading AMSS firmware using BHIe protocol, return -ETIMEDOUT if no response is received within the timeout or return -EIO in case of a protocol returned failure or an MHI error state. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-7-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 560e3a045961ed0c7184ef9f6a93b95bd38c1c48 Author: Bhaumik Bhatt Date: Thu May 21 22:32:40 2020 +0530 bus: mhi: core: Handle firmware load using state worker Upon power up, driver queues firmware worker thread if the execution environment is PBL. Firmware worker is blocked with a timeout until state worker gets a chance to run and unblock firmware worker. An endpoint power up failure can be seen if state worker gets a chance to run after firmware worker has timed out. Remove this dependency and handle firmware load directly using state worker thread. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-6-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit ee75cedf82d832561af8ba8380aeffd00a9eea77 Author: Hemant Kumar Date: Thu May 21 22:32:39 2020 +0530 bus: mhi: core: Read transfer length from an event properly When MHI Driver receives an EOT event, it reads xfer_len from the event in the last TRE. The value is under control of the MHI device and never validated by Host MHI driver. The value should never be larger than the real size of the buffer but a malicious device can set the value 0xFFFF as maximum. This causes driver to memory overflow (both read or write). Fix this issue by reading minimum of transfer length from event and the buffer length provided. Signed-off-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-5-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 020960685041fc09ab6a23cf244477cdcbb75c5f Author: Hemant Kumar Date: Thu May 21 22:32:38 2020 +0530 bus: mhi: core: Add range check for channel id received in event ring MHI data completion handler function reads channel id from event ring element. Value is under the control of MHI devices and can be any value between 0 and 255. In order to prevent out of bound access add a bound check against the max channel supported by controller and skip processing of that event ring element. Signed-off-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-4-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 44d4e063d18b87c0fef1b19f7883f10e71c544b6 Author: Hemant Kumar Date: Thu May 21 22:32:37 2020 +0530 bus: mhi: core: Cache intmod from mhi event to mhi channel Driver is using zero initialized intmod value from mhi channel when configuring TRE for bei field. This prevents interrupt moderation to take effect in case it is supported by an event ring. Fix this by copying intmod value from associated event ring to mhi channel upon registering mhi controller. Signed-off-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit cd116318803f5ee222301f3525578241a04822ee Author: Hemant Kumar Date: Thu May 21 22:32:36 2020 +0530 bus: mhi: core: Refactor mhi queue APIs Move all the common code to generate TRE from mhi_queue_buf, mhi_queue_dma and mhi_queue_skb to mhi_gen_tre. This helps to centralize the TRE generation code which makes any future bug fixing easier to manage in these APIs. Suggested-by: Jeffrey Hugo Signed-off-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200521170249.21795-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 14f3a5ccacdb4268764474d834ee353219dbd1a2 Merge: e9ccc35b8665 ac0a95a3ea78 Author: Greg Kroah-Hartman Date: Fri May 22 09:28:16 2020 +0200 Merge tag 'phy-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into usb-next Kishon writes: phy: for 5.8 *) Add new PHY driver to support Cadence SALVO PHY which supports USB3 & USB2 *) Add new PHY driver to support Intel ComboPhy which supports PCIe, SATA and EMAC *) Add new PHY driver for Qualcomm IPQ40xx USB PHY *) Add new PHY driver for Synopsys FemtoPHY V2 driver used in Qualcomm SOCs *) Add support for Qualcomm SM8250 UFS PHY and SM8150 QMP USB3 PHY in qcom-qmp-phy driver *) Add support for Amlogic USB2 PHY on Meson8m2 in phy-meson8b-usb2 driver *) Add DisplayPort mode support in Wiz (TI Cadence PHY wrapper), to enable eDP in TI's J721E SoC *) Add support for super speed USB PHY in TI's AM654 SoC *) Add fix in Broadcom Stingray USB PHY to get USB PHY PLL lock reliably *) Add fix in Samsung phy-s5pv210-usb2 to get USB working on s5pv210 *) Add fix in Amlogic phy-meson8b-usb2 to get host only mode working on Meson8 *) Add fix in Cadence phy-cadence-sierra to get USB3 device disconnect issue *) Convert meson8b-usb2-phy, qcom-qmp-phy, rcar-gen3-phy-usb2 and rcar-gen3-phy-usb3 device tree binding to YAML schema *) Minor fixes and cleanups in phy-cpcap-usb, j721e-wiz, omap-usb2, phy-bcm-sr-usb, phy-brcm-usb PHY driver Signed-off-by: Kishon Vijay Abraham I * tag 'phy-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (43 commits) phy: intel: Add driver support for ComboPhy dt-bindings: phy: Add YAML schemas for Intel ComboPhy dt-bindings: phy: Add PHY_TYPE_XPCS definition phy: qcom-qmp: Add QMP V3 USB3 PHY support for SC7180 dt-bindings: phy: qcom,qmp-usb3-dp: Add support for SC7180 dt-bindings: phy: qcom,qmp-usb3-dp: Add dt bindings for USB3 DP PHY dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml phy: cadence: sierra: Fix for USB3 U1/U2 state phy: ti: am654: add support for USB super-speed phy: ti: am654: show up in regmap debugfs drivers: phy: sr-usb: do not use internal fsm for USB2 phy init dt-bindings: phy: renesas: usb3-phy: add r8a77961 support dt-bindings: phy: renesas: usb3-phy: convert bindings to json-schema dt-bindings: phy: renesas: usb2-phy: add r8a77961 support dt-bindings: phy: renesas: usb2-phy: convert bindings to json-schema phy: qcom-qmp: Ensure register indirection arrays initialized phy: omap-usb2: Clean up exported header phy: phy-bcm-ns2-usbdrd: Constify phy_ops phy: phy-brcm-usb: Constify static structs phy: sr-usb: Constify phy_ops ... commit ddc0aef01a90ee8431f1a47f7b35e84d36ab8913 Merge: c9cf27d9dee2 fcbcf1f7b568 Author: Greg Kroah-Hartman Date: Fri May 22 09:25:25 2020 +0200 Merge tag 'soundwire-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for v5.8-rc1 This contains sdw_master_device patches and other updates done by Intel folks. Details: - sdw_master_device to represent the master instances. - sysfs properties for sdw_master_device and sdw_slave. - Documentation update for TDM modes. - some code cleanup patches and odd updates. * tag 'soundwire-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: intel: use a single module soundwire: fix spelling mistake soundwire: fix trailing line in sysfs_slave.c soundwire: add Slave sysfs support soundwire: master: add sysfs support soundwire: disco: s/ch/channels/ soundwire: master: add runtime pm support soundwire: bus_type: add sdw_master_device support soundwire: bus: add unique bus id soundwire: bus_type: introduce sdw_slave_type and sdw_master_type soundwire: bus: rename sdw_bus_master_add/delete, add arguments soundwire: intel: (cosmetic) remove multiple superfluous "else" statements soundwire: (cosmetic) remove multiple superfluous "else" statements soundwire: qcom: Use IRQF_ONESHOT soundwire: bus: reduce verbosity on enumeration soundwire: debugfs: clarify SDPX license with GPL-2.0-only soundwire: slave: don't init debugfs on device registration error Documentation: SoundWire: clarify TDM mode support soundwire: qcom: fix error handling in probe soundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer commit 21e1a03e1dbed20e03d88aa077163cd6ceaa128f Author: Serge Semin Date: Thu May 21 17:07:24 2020 +0300 mips: cevt-r4k: Update the r4k-clockevent frequency in sync with CPU Due to being embedded into the CPU cores MIPS count/compare timer frequency is changed together with the CPU clocks alteration. In case if frequency really changes the kernel clockevent framework must be notified, otherwise the kernel timers won't work correctly. Fix this by calling clockevents_update_freq() for each r4k clockevent handlers registered per available CPUs. Traditionally MIPS r4k-clock are clocked with CPU frequency divided by 2. But this isn't true for some of the platforms. Due to this we have to save the basic CPU frequency, so then use it to scale the initial timer frequency (mips_hpt_frequency) and pass the updated value further to the clockevent framework. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 3858642805973d194935c0641d8e825f9192d384 Author: Serge Semin Date: Thu May 21 17:07:23 2020 +0300 mips: csrc-r4k: Mark R4K timer as unstable if CPU freq changes Commit 07d69579e7fe ("MIPS: Don't register r4k sched clock when CPUFREQ enabled") disabled the r4k-clock usage for scheduler ticks counting due to the scheduler being non-tolerant for unstable clocks sources. For the same reason the clock should be used in the system clocksource framework with care. As soon as CPU frequency changes the clocksource framework should be notified about this by marking the R4K timer being unstable (which it really is, since the ticks rate has been changed synchronously with the CPU frequency). Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit c9cf27d9dee20193660b6582e4e6d6b315bff217 Merge: f37d13d52c05 b35da2e86f25 Author: Greg Kroah-Hartman Date: Fri May 22 09:14:03 2020 +0200 Merge tag 'icc-5.8-rc1' of https://git.linaro.org/people/georgi.djakov/linux into char-misc-next Georgi writes: interconnect changes for 5.8 These are the interconnect changes for the 5.8-rc1 merge window: Core changes: - Convert the framework core from tristate to bool to make handling dependencies between other core frameworks easier - Add of_icc_get_by_index() - Add devm_of_icc_get() helper function - Add icc_enable() and icc_disable() helpers New drivers: - Platform driver for NXP i.MX8MM SoC - Platform driver for NXP i.MX8MN SoC - Platform driver for NXP i.MX8MQ SoC Signed-off-by: Georgi Djakov * tag 'icc-5.8-rc1' of https://git.linaro.org/people/georgi.djakov/linux: interconnect: Remove unused module exit code from core interconnect: Disallow interconnect core to be built as a module interconnect: Add of_icc_get_by_index() helper function interconnect: Add helpers for enabling/disabling a path interconnect: imx: Fix return value check in imx_icc_node_init_qos() interconnect: imx: Add platform driver for imx8mn interconnect: imx: Add platform driver for imx8mq interconnect: imx: Add platform driver for imx8mm interconnect: Add imx core driver dt-bindings: interconnect: Add bindings for imx8m noc interconnect: Add devm_of_icc_get() as exported API for users commit ed26aacfb5f71eecb20a51c4467da440cb719d66 Author: Serge Semin Date: Thu May 21 17:07:22 2020 +0300 mips: Add udelay lpj numbers adjustment Loops-per-jiffies is a special number which represents a number of noop-loop cycles per CPU-scheduler quantum - jiffies. As you understand aside from CPU-specific implementation it depends on the CPU frequency. So when a platform has the CPU frequency fixed, we have no problem and the current udelay interface will work just fine. But as soon as CPU-freq driver is enabled and the cores frequency changes, we'll end up with distorted udelay's. In order to fix this we have to accordinly adjust the per-CPU udelay_val (the same as the global loops_per_jiffy) number. This can be done in the CPU-freq transition event handler. We subscribe to that event in the MIPS arch time-inititalization method. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Reviewed-by: Jiaxun Yang Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit ad42e0a8d4d5abd7243597b1a4f5ab4ede09f25a Author: Serge Semin Date: Thu May 21 17:07:19 2020 +0300 mips: Add CPS_NS16550_WIDTH config On some platforms IO-memory might require to use a proper load/store instructions (like Baikal-T1 IO-memory). To fix the cps-vec UART debug printout let's add the CONFIG_CPS_NS16550_WIDTH config to determine which instructions lb/sb, lh/sh or lw/sw are required for MMIO operations. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 999079c851b46fd945a8b074d115f9f08a056ca9 Author: Serge Semin Date: Thu May 21 17:07:18 2020 +0300 mips: Add CONFIG/CONFIG6/Cause reg fields macro There are bit fields which persist in the MIPS CONFIG and CONFIG6 registers, but haven't been described in the generic mipsregs.h header so far. In particular, the generic CONFIG bitfields are BE - endian mode, BM - burst mode, SB - SimpleBE, OCP interface mode indicator, UDI - user-defined "CorExtend" instructions, DSP - data scratch pad RAM present, ISP - instruction scratch pad RAM present, etc. The core-specific CONFIG6 bitfields are JRCD - jump register cache prediction disable, R6 - MIPSr6 extensions enable, IFUPerfCtl - IFU performance control, SPCD - sleep state performance counter, DLSB - disable load/store bonding. A new exception code reported in the ExcCode field of the Cause register: 30 - Parity/ECC error exception happened on either fetch, load or cache refill. Lets add them to the mipsregs.h header to be used in future platform code, which have them utilized. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 742318ad5eeecace49e95da5d3cf4571b0b26b36 Author: Serge Semin Date: Thu May 21 17:07:17 2020 +0300 mips: Add CP0 Write Merge config support CP0 config register may indicate whether write-through merging is allowed. Currently there are two types of the merging available: SysAD Valid and Full modes. Whether each of them are supported by the core is implementation dependent. Moreover whether the ability to change the mode also depends on the chip family instance. Taking into account all of this we created a dedicated mm_config() method to detect and enable merging if it's supported. It is called for MIPS-type processors at CPU-probe stage and attempts to detect whether the write merging is available. If it's known to be supported and switchable, then switch on the full mode. Otherwise just perform the CP0.Config.MM field analysis. In addition there are platforms like InterAptiv/ProAptiv, which do have the MM bit field set by default, but having write-through cacheing unsupported makes write-merging also unsupported. In this case we just ignore the MM field value. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit a2ac81c6ef4018ea49c034ce165bb9ea1cf99f3e Author: Serge Semin Date: Thu May 21 17:07:16 2020 +0300 mips: Fix cpu_has_mips64r1/2 activation for MIPS32 CPUs Commit 1aeba347b3a9 ("MIPS: Hardcode cpu_has_mips* where target ISA allows") updated the cpu_has_mips* macro to be replaced with a constant expression where it's possible. By mistake it wasn't done correctly for cpu_has_mips64r1/cpu_has_mips64r2 macro. They are defined to be replaced with conditional expression __isa_range_or_flag(), which means either ISA revision being within the range or the corresponding CPU options flag was set at the probe stage or both being true at the same time. But the ISA level value doesn't indicate whether the ISA is MIPS32 or MIPS64. Due to this if we select MIPS32r1 - MIPS32r5 architectures the __isa_range() macro will activate the cpu_has_mips64rX flags, which is incorrect. In order to fix the problem we make sure the 64bits CPU support is enabled by means of checking the flag cpu_has_64bits aside with proper ISA range and specific Revision flag being set. Fixes: 1aeba347b3a9 ("MIPS: Hardcode cpu_has_mips* where target ISA allows") Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 281e3aea35e521a90b0b05face3196da23758092 Author: Serge Semin Date: Thu May 21 17:07:15 2020 +0300 mips: Add MIPS Warrior P5600 support This is a MIPS32 Release 5 based IP core with XPA, EVA, dual/quad issue exec pipes, MMU with two-levels TLB, UCA, MSA, MDU core level features and system level features like up to six P5600 calculation cores, CM2 with L2 cache, IOCU/IOMMU (though might be unused depending on the system-specific IP core configuration), GIC, CPC, virtualisation module, eJTAG and PDtrace. As being MIPS32 Release 5 based core it provides all the features available by the CPU_MIPS32_R5 config, while adding a few more like UCA attribute support, availability of CPU-freq (by means of L2/CM clock ratio setting), EI/VI GIC modes detection at runtime. In addition to this if P5600 architecture is enabled modern GNU GCC provides a specific tuning for P5600 processors with respect to the classic MIPS32 Release 5. First of all branch-likely avoidance is activated only when the code is compiled with the speed optimization (avoidance is always enabled for the pure MIPS32 Release 5 architecture). Secondly the madd/msub avoidance is enabled since madd/msub utilization isn't profitable due to overhead of getting the result out of the HI/LO registers. Multiply-accumulate instructions are activated and utilized together with the necessary code reorder when multiply-add/multiply-subtract statements are met. Finally load/store bonding is activated by default. All of these optimizations may make the code relatively faster than if just MIP32 release 5 architecture was requested. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit ab7c01fdc3cfe02256e777a36366b70e2a539c27 Author: Serge Semin Date: Thu May 21 17:07:14 2020 +0300 mips: Add MIPS Release 5 support There are five MIPS32/64 architecture releases currently available: from 1 to 6 except fourth one, which was intentionally skipped. Three of them can be called as major: 1st, 2nd and 6th, that not only have some system level alterations, but also introduced significant core/ISA level updates. The rest of the MIPS architecture releases are minor. Even though they don't have as much ISA/system/core level changes as the major ones with respect to the previous releases, they still provide a set of updates (I'd say they were intended to be the intermediate releases before a major one) that might be useful for the kernel and user-level code, when activated by the kernel or compiler. In particular the following features were introduced or ended up being available at/after MIPS32/64 Release 5 architecture: + the last release of the misaligned memory access instructions, + virtualisation - VZ ASE - is optional component of the arch, + SIMD - MSA ASE - is optional component of the arch, + DSP ASE is optional component of the arch, + CP0.Status.FR=1 for CP1.FIR.F64=1 (pure 64-bit FPU general registers) must be available if FPU is implemented, + CP1.FIR.Has2008 support is required so CP1.FCSR.{ABS2008,NAN2008} bits are available. + UFR/UNFR aliases to access CP0.Status.FR from user-space by means of ctc1/cfc1 instructions (enabled by CP0.Config5.UFR), + CP0.COnfig5.LLB=1 and eretnc instruction are implemented to without accidentally clearing LL-bit when returning from an interrupt, exception, or error trap, + XPA feature together with extended versions of CPx registers is introduced, which needs to have mfhc0/mthc0 instructions available. So due to these changes GNU GCC provides an extended instructions set support for MIPS32/64 Release 5 by default like eretnc/mfhc0/mthc0. Even though the architecture alteration isn't that big, it still worth to be taken into account by the kernel software. Finally we can't deny that some optimization/limitations might be found in future and implemented on some level in kernel or compiler. In this case having even intermediate MIPS architecture releases support would be more than useful. So the most of the changes provided by this commit can be split into either compile- or runtime configs related. The compile-time related changes are caused by adding the new CONFIG_CPU_MIPS32_R5/CONFIG_CPU_MIPSR5 configs and concern the code activating MIPSR2 or MIPSR6 already implemented features (like eretnc/LLbit, mthc0/mfhc0). In addition CPU_HAS_MSA can be now freely enabled for MIPS32/64 release 5 based platforms as this is done for CPU_MIPS32_R6 CPUs. The runtime changes concerns the features which are handled with respect to the MIPS ISA revision detected at run-time by means of CP0.Config.{AT,AR} bits. Alas these fields can be used to detect either r1 or r2 or r6 releases. But since we know which CPUs in fact support the R5 arch, we can manually set MIPS_CPU_ISA_M32R5/MIPS_CPU_ISA_M64R5 bit of c->isa_level and then use cpu_has_mips32r5/cpu_has_mips64r5 where it's appropriate. Since XPA/EVA provide too complex alterationss and to have them used with MIPS32 Release 2 charged kernels (for compatibility with current platform configs) they are left to be setup as a separate kernel configs. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 5757cc7c8b71d5114aca0034cee42d22e6977d19 Author: Tony Nguyen Date: Thu May 7 17:41:13 2020 -0700 ice: Rename build_ctob to ice_build_ctob To make the function easier to identify as being part of the ice driver, prepend ice to the function name. Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c522d1f686752d9f85cedc3e3bb7423c5abd03e5 Author: Bruce Allan Date: Thu May 7 17:41:12 2020 -0700 ice: remove unnecessary backslash Self-explanatory. Signed-off-by: Bruce Allan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 86a2e00d20bd4f7fd0efd1cccd8d5a5d7270b640 Author: Bruce Allan Date: Thu May 7 17:41:11 2020 -0700 ice: remove unnecessary check The variable status cannot be zero due to a prior check of it; remove this check. Signed-off-by: Bruce Allan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 92ace4824c1cf0cf2094e51501e3c48176a4f2a2 Author: Bruce Allan Date: Thu May 7 17:41:10 2020 -0700 ice: remove unnecessary expression that is always true The else conditional expression is always true due to the if conditional expression; remove it and add a comment to make it obvious still. Signed-off-by: Bruce Allan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 757976ab16be0d07e316998182d82ea7fcf561e2 Author: Lihong Yang Date: Thu May 7 17:41:09 2020 -0700 ice: Fix check for removing/adding mac filters In function ice_set_mac_address, we will remove old dev_addr before adding the new MAC. In the removing and adding process of the MAC, there is no need to return error if the check finds the to-be-removed dev_addr does not exist in the MAC filter list or the to-be-added mac already exists, keep going or return success accordingly. Signed-off-by: Lihong Yang Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1b8f15b64a006b5fbbfbc898c612a48a86fff6de Author: Michal Swiatkowski Date: Thu May 7 17:41:08 2020 -0700 ice: refactor filter functions Move filter functions to separate file. Add functions that prepare suitable ice_fltr_info struct depending on the filter type and add this struct to earlier created list: - ice_fltr_add_mac_to_list - ice_fltr_add_vlan_to_list - ice_fltr_add_eth_to_list This functions are used in adding and removing filters. Create wrappers for functions mentioned above that alloc list, add suitable ice_fltr_info to it and call add or remove function. - ice_fltr_prepare_mac - ice_fltr_prepare_mac_and_broadcast - ice_fltr_prepare_vlan - ice_fltr_prepare_eth Signed-off-by: Michal Swiatkowski Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 857a4f0e9f4956fffc0cedcaa2ba187a2e987153 Author: Eric Joyner Date: Thu May 7 17:41:07 2020 -0700 ice: Fix resource leak on early exit from function Memory allocated in the ice_add_prof_id_vsig() function wasn't being properly freed if an error occurred inside the for-loop in the function. In particular, 'p' wasn't being freed if an error occurred before it was added to the resource list at the end of the for-loop. Signed-off-by: Eric Joyner Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 53bb66983f34d4ff0af179fe228e2c55e1e45921 Author: Jesse Brandeburg Date: Thu May 7 17:41:06 2020 -0700 ice: cleanup vf_id signedness The vf_id variable is dealt with in the code in inconsistent ways of sign usage, preventing compilation with -Werror=sign-compare. Fix this problem in the code by always treating vf_id as unsigned, since there are no valid values of vf_id that are negative. Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 88865fc4bbd61e48d04e2747d59b85d2014cca82 Author: Karol Kolacinski Date: Thu May 7 17:41:05 2020 -0700 ice: Fix casting issues Change min() macros to min_t() which has compare type specified and it helps avoid precision loss. In some cases there was precision loss during calls or assignments. Some fields in structs were unnecessarily large and gave multiple warnings. There were also some minor type differences which are now fixed as well as some cases where a simple cast was needed. Callers were were passing data that is a u16 to ice_sched_cfg_node_bw_alloc() but the function was truncating that to a u8. Fix that by changing the function to take a u16. Signed-off-by: Karol Kolacinski Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 0fee35774d8f2277cfb101dd1d9d0d5e39015b93 Author: Lihong Yang Date: Thu May 7 17:41:04 2020 -0700 ice: Provide more meaningful error message When printing the ice status or AQ error codes, instead of printing out the numerical value, provide the description of the error code. This provides more info about the issue than a number. Signed-off-by: Lihong Yang Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit de75135b5c04c96dc8bbb005511b7a79d952d7eb Author: Anirudh Venkataramanan Date: Thu May 7 17:41:03 2020 -0700 ice: Fix probe/open race condition As soon as the driver registers the PF netdev, userspace utilities like NetworkManager try to bring up the associated interface. When this happens, the driver may not have finished initializing fully, resulting in a bunch of errors in the interface up flow. The driver already has a mechanism to indicate if it's not up yet; by setting the __ICE_DOWN bit in pf->state, but this bit gets cleared too early in the current flow. So clear this bit only when the driver is fully up. Also check for the same bit in the ice_open flow, and return -EBUSY if the bit is set. Also in ice_open, replace references of vsi->back with a local variable. Signed-off-by: Anirudh Venkataramanan Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 46a316500e060abd4c5745f45ffdc28d426dc99b Author: Dave Ertman Date: Thu May 7 17:41:02 2020 -0700 ice: only drop link once when setting pauseparams Currently, the ice driver is setting a PHY configuration, which causes a link drop, and then additionally it calls for a nway_reset, which restarts auto-negotiation on the link, which also causes a link drop. These two link events in such close timing is causing the FW to not be able to generate a link interrupt for the driver to respond to. Remove the unnecessary auto-negotiation restart from the set pauseparams flow. Also remove error path that would have performed an ice_down/ice_up as that is also unnecessary. Signed-off-by: Dave Ertman Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 891540024bb959c3ce8b71b851ba24cd3ad9423f Author: Dave Ertman Date: Thu May 7 17:41:01 2020 -0700 ice: Fix check for contiguous TCs The current implementation for contiguous TC check is assuming that the UPs will be mapped to TCs in a linear progressing fashion. This is obviously not always true. Change the check to allow for various UP2TC mapping configurations. Signed-off-by: Dave Ertman Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 610ed0e93e7dd107afc2398d54de6b6fe9513f8d Author: Avinash JD Date: Thu May 7 17:41:00 2020 -0700 ice: Don't reset and rebuild for Tx timeout on PFC enabled queue When there's a Tx timeout for a queue which belongs to a PFC enabled TC, then it's not because the queue is hung but because PFC is in action. In PFC, peer sends a pause frame for a specified period of time when its buffer threshold is exceeded (due to congestion). Netdev on the other hand checks if ACK is received within a specified time for a TX packet, if not, it'll invoke the tx_timeout routine. Signed-off-by: Avinash JD Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 01b5e89aab498dad5a38d04a71beca2b562d9449 Author: Brett Creeley Date: Thu May 7 17:40:59 2020 -0700 ice: Add VF promiscuous support Implement promiscuous support for VF VSIs. Behaviour of promiscuous support is based on VF trust as well as the, introduced, vf-true-promisc flag. A trusted VF with vf-true-promisc disabled will be the default VSI, which means that all traffic without a matching destination MAC address in the device's internal switch will be forwarded to this VF VSI. A trusted VF with vf-true-promisc enabled will go into "true promiscuous mode". This amounts to the VF receiving all ingress and egress traffic that hits the device's internal switch. An untrusted VF will only receive traffic destined for that VF. The vf-true-promisc-support flag cannot be toggled while any VF is in promiscuous mode. This flag should be set prior to loading the iavf driver or spawning VF(s). Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit a4e82a81f57387803f950cc3d9d112bcc5553a3d Author: Tony Nguyen Date: Wed May 6 09:32:30 2020 -0700 ice: Add support for tunnel offloads Create a boost TCAM entry for each tunnel port in order to get a tunnel PTYPE. Update netdev feature flags and implement the appropriate logic to get and set values for hardware offloads. Signed-off-by: Tony Nguyen Signed-off-by: Henry Tieman Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f45a645fa6af37abb5484a8d8be779283a38fb53 Author: Jacob Keller Date: Tue May 5 15:55:37 2020 -0700 ice: report netlist version in .info_get The flash memory for the ice hardware contains a block of information used for link management called the Netlist module. As this essentially represents another section of firmware, add its version information to the output of the driver's .info_get handler. This includes both a version and the first few bytes of a hash of the module contents. fw.netlist -> the version information extracted from the netlist module fw.netlist.build-> first 4 bytes of the hash of the contents, similar to fw.mgmt.build Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 918b73dcfc69f976d6210028dcb50fbcd15c15ae Merge: 5f0ed4f8f684 dc455f4c8883 Author: Dave Airlie Date: Fri May 22 13:17:05 2020 +1000 Merge branch 'linux-5.8' of git://github.com/skeggsb/linux into drm-next - HD audio fixes on recent systems - vGPU detection (fail probe if we're on one, for now) - Interlaced mode fixes (mostly avoidance on Turing, which doesn't support it) - SVM improvements/fixes - NVIDIA format modifier support - Misc other fixes. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/ Date: Fri May 22 12:20:07 2020 +1000 Merge tag 'mediatek-drm-next-5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 5.8 This include dpi pin mode swap, config mipi_tx current and impedance, and some fixup. Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20200521014612.17175-1-chunkuang.hu@kernel.org commit dc455f4c888365595c0a13da445e092422d55b8d Author: Dinghao Liu Date: Wed May 20 18:47:48 2020 +0800 drm/nouveau/dispnv50: fix runtime pm imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Ben Skeggs commit d3faddc7dcd326c0edc906f907f83a8454986d99 Author: Dinghao Liu Date: Wed May 20 18:36:04 2020 +0800 drm/nouveau: fix runtime pm imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Ben Skeggs commit d7372dfb3f7f1602b87e0663e8b8646da23ebca7 Author: Dinghao Liu Date: Wed May 20 18:25:49 2020 +0800 drm/nouveau: fix runtime pm imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Ben Skeggs commit 00583fbe8031f69bba8b0a9a861efb75fb7131af Author: Dinghao Liu Date: Wed May 20 18:14:53 2020 +0800 drm/nouveau/debugfs: fix runtime pm imbalance on error pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Ben Skeggs commit 9d4296a7d4b329016e6b5b59a7fb3f8afa36ac05 Author: Ralph Campbell Date: Wed May 20 11:36:52 2020 -0700 drm/nouveau/nouveau/hmm: fix migrate zero page to GPU When calling OpenCL clEnqueueSVMMigrateMem() on a region of memory that is backed by pte_none() or zero pages, migrate_vma_setup() will fill the source PFN array with an entry indicating the source page is zero. Use this to optimize migration to device private memory by allocating GPU memory and zero filling it instead of failing to migrate the page. Signed-off-by: Ralph Campbell Signed-off-by: Ben Skeggs commit 1d7f940c3a16623adb25706b10d81f8b822d53f9 Author: Ralph Campbell Date: Tue Apr 21 16:11:07 2020 -0700 drm/nouveau/nouveau/hmm: fix nouveau_dmem_chunk allocations In nouveau_dmem_init(), a number of struct nouveau_dmem_chunk are allocated and put on the dmem->chunk_empty list. Then in nouveau_dmem_pages_alloc(), a nouveau_dmem_chunk is removed from the list and GPU memory is allocated. However, the nouveau_dmem_chunk is never removed from the chunk_empty list nor placed on the chunk_free or chunk_full lists. This results in only one chunk ever being actually used (2MB) and quickly leads to migration to device private memory failures. Fix this by having just one list of free device private pages and if no pages are free, allocate a chunk of device private pages and GPU memory. Signed-off-by: Ralph Campbell Signed-off-by: Ben Skeggs commit d6a9efece7248d3cbd7bf65d3a8325e8e5dceec0 Author: Lyude Paul Date: Mon May 11 18:41:27 2020 -0400 drm/nouveau/kms/nv50-: Share DP SST mode_valid() handling with MST Currently, the nv50_mstc_mode_valid() function is happy to take any and all modes, even the ones we can't actually support sometimes like interlaced modes. Luckily, the only difference between the mode validation that needs to be performed for MST vs. SST is that eventually we'll need to check the minimum PBN against the MSTB's full PBN capabilities (remember-we don't care about the current bw state here). Otherwise, all of the other code can be shared. So, we move all of the common mode validation in nouveau_connector_mode_valid() into a separate helper, nv50_dp_mode_valid(), and use that from both nv50_mstc_mode_valid() and nouveau_connector_mode_valid(). Note that we allow for returning the calculated clock that nv50_dp_mode_valid() came up with, since we'll eventually want to use that for PBN calculation in nv50_mstc_mode_valid(). Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs commit bbdf6a5891fc46b23a91c16941cc8b18ff37ac43 Author: Lyude Paul Date: Mon May 11 18:41:26 2020 -0400 drm/nouveau/kms/nv50-: Move 8BPC limit for MST into nv50_mstc_get_modes() This just limits the BPC for MST connectors to a maximum of 8 from nv50_mstc_get_modes(), instead of doing so during nv50_msto_atomic_check(). This doesn't introduce any functional changes yet (other then userspace now lying about the max bpc, but we can't support that yet anyway so meh). But, we'll need this in a moment so that we can share mode validation between SST and MST which will fix some real world issues. Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs commit af620cf083cd29dfafb8021d423d567ab57654b1 Author: Lyude Paul Date: Mon May 11 18:41:25 2020 -0400 drm/nouveau/kms/gv100-: Add support for interlaced modes We advertise being able to set interlaced modes, so let's actually make sure to do that. Otherwise, we'll end up hanging the display engine due to trying to set a mode with timings adjusted for interlacing without telling the hardware it's actually an interlaced mode. Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs commit 4a2cb4181b077cf028c955d1f61d9244b2e93263 Author: Lyude Paul Date: Mon May 11 18:41:24 2020 -0400 drm/nouveau/kms/nv50-: Probe SOR and PIOR caps for DP interlacing support Right now, we make the mistake of allowing interlacing on all connectors. Nvidia hardware does not always support interlacing with DP though, so we need to make sure that we don't allow interlaced modes to be set in such situations as otherwise we'll end up accidentally hanging the display HW. This fixes some hangs with Turing, which would be caused by attempting to set an interlaced mode on hardware that doesn't support it. This patch likely fixes other hardware hanging in the same way as well. Note that we say we probe PIOR caps, but they don't actually have any interlacing caps. So, the get_caps() function for PIORs just sets interlacing support to true. Changes since v1: * Actually probe caps correctly this time, both on EVO and NVDisplay. Changes since v2: * Fix probing for < GF119 * Use vfunc table, in prep for adding more caps in the future. Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs commit fa1232ea84515533a8c52f9b88151d2bef4c913d Author: Lyude Paul Date: Mon May 11 18:41:23 2020 -0400 drm/nouveau/kms/nv50-: Initialize core channel in nouveau_display_create() We'll need the core channel initialized and ready by the time that we start creating modesetting objects, so that we can call the NV507D_GET_CAPABILITIES method to make the hardware expose it's modesetting capabilities for later probing. So, when loading the driver prepare the core channel from within nouveau_display_create(). Everywhere else, we initialize the core channel during resume. Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs commit 0435d7c69271a2ed93984f68af452e584aa43e4d Author: Ben Skeggs Date: Wed May 6 14:41:01 2020 +1000 drm/nouveau/disp/hda/gv100-: NV_PDISP_SF_AUDIO_CNTRL0 register moved Signed-off-by: Ben Skeggs commit 7ec60c044069ac40fd0f28e2469b9dde9ea6e4ca Author: Ben Skeggs Date: Wed May 6 14:40:58 2020 +1000 drm/nouveau/disp/hda/gf119-: select HDA device entry based on bound head Signed-off-by: Ben Skeggs commit d4115d17cd91c137b713b0e1482613093d6007c1 Author: Ben Skeggs Date: Wed May 6 14:40:56 2020 +1000 drm/nouveau/disp/hda/gf119-: add HAL for programming device entry in SF Register has moved on GV100. Signed-off-by: Ben Skeggs commit 1404e56a49f0dd6f50ded3290d37b795e3cbd6e9 Author: Ben Skeggs Date: Wed May 6 14:40:52 2020 +1000 drm/nouveau/disp/hda/gt215-: pass head to nvkm_ior.hda.eld() We're going to use the bound head to select HDA device entry. Signed-off-by: Ben Skeggs commit 18d8cf93093e207b22770f165120f2115c83f73a Author: Ben Skeggs Date: Wed May 6 14:40:45 2020 +1000 drm/nouveau/disp/nv50-: increase timeout on pio channel free() polling Signed-off-by: Ben Skeggs commit 61a41097e4bd4bf5d4abf3b3b58d5bf0856ce144 Author: Takashi Iwai Date: Thu Apr 16 09:54:28 2020 +0200 drm/nouveau/kms: Fix regression by audio component transition Since the commit 742db30c4ee6 ("drm/nouveau: Add HD-audio component notifier support"), the nouveau driver notifies and pokes the HD-audio HPD and ELD via audio component, but this seems broken. The culprit is the naive assumption that crtc->index corresponds to the HDA pin. Actually this rather corresponds to the MST dev_id (alias "pipe" in the audio component framework) while the actual port number is given from the output ior id number. This patch corrects the assignment of port and dev_id arguments in the audio component ops to recover from the HDMI/DP audio regression. Fixes: 742db30c4ee6 ("drm/nouveau: Add HD-audio component notifier support") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207223 Cc: Signed-off-by: Takashi Iwai Signed-off-by: Ben Skeggs commit 0f85bbb6ae517d9a4308527188afe35c2012bbc9 Author: Ben Skeggs Date: Thu Apr 30 14:08:53 2020 +1000 drm/nouveau/device: use regular PRI accessors in chipset detection Signed-off-by: Ben Skeggs commit 2924779bcaead13828ce3101e573eb5663900b92 Author: Karol Herbst Date: Tue Apr 28 18:54:04 2020 +0200 drm/nouveau/device: detect vGPUs Using ENODEV as this prevents probe failed errors in dmesg. v2: move check further down Signed-off-by: Karol Herbst Signed-off-by: Ben Skeggs commit 51c05340e407b14b7d8ca5c6ad7027f269fc617b Author: Karol Herbst Date: Tue Apr 28 18:54:03 2020 +0200 drm/nouveau/device: detect if changing endianness failed v2: relax the checks a little Signed-off-by: Karol Herbst Signed-off-by: Ben Skeggs commit 24d5ff40a732633dceab68c6559ba723784f4a68 Author: Karol Herbst Date: Tue Apr 28 18:54:02 2020 +0200 drm/nouveau/device: rework mmio mapping code to get rid of second map Fixes warnings on GPUs with smaller a smaller mmio region like vGPUs. Signed-off-by: Karol Herbst Signed-off-by: Ben Skeggs commit 94db9a3b0f6d1e87e315515744db46c6c86680d0 Author: Zheng Bin Date: Fri Apr 24 15:36:01 2020 +0800 drm/nouveau/mmu: Remove unneeded semicolon Fixes coccicheck warning: drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h:307:2-3: Unneeded semicolon drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:583:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Ben Skeggs commit ccfc2d5cdb02459ac8878125dd5e1a8367e8bd79 Author: Kai-Heng Feng Date: Thu Apr 23 14:23:58 2020 +0800 drm/nouveau: Use generic helper to check _PR3 presence Replace nouveau_pr3_present() in favor of a more generic one, pci_pr3_present(). Also the presence of upstream bridge _PR3 doesn't need to go hand in hand with device's _DSM, so check _PR3 before _DSM. Signed-off-by: Kai-Heng Feng Signed-off-by: Ben Skeggs commit 75a708918a92e30765d793b78b323efae12ef2b0 Author: Zou Wei Date: Tue Apr 21 20:37:31 2020 +0800 drm/nouveau/acr: Use kmemdup instead of kmalloc and memcpy Fixes coccicheck warning: drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c:103:23-30: WARNING opportunity for kmemdup drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c:113:22-29: WARNING opportunity for kmemdup Fixes: 22dcda45a3d1 ("drm/nouveau/acr: implement new subdev to replace "secure boot"") Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Ben Skeggs commit cf0f64ff4f28b4ed0cae9a3a907eda95cbe69cfe Author: Colin Ian King Date: Sat Feb 29 00:53:07 2020 +0000 drm/nouveau/core/memory: remove redundant assignments to variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Ben Skeggs commit e3d8b08904694e9ccae5163d0bb7d35fa66e5bdc Author: Ralph Campbell Date: Tue Mar 3 16:13:39 2020 -0800 drm/nouveau/svm: map pages after migration When memory is migrated to the GPU, it is likely to be accessed by GPU code soon afterwards. Instead of waiting for a GPU fault, map the migrated memory into the GPU page tables with the same access permissions as the source CPU page table entries. This preserves copy on write semantics. Signed-off-by: Ralph Campbell Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: "Jérôme Glisse" Cc: Ben Skeggs Signed-off-by: Ben Skeggs commit 9c1c08a68dcdea3a933948b4e7927bdbc56aac4c Author: Ben Skeggs Date: Thu Feb 13 09:39:34 2020 +1000 drm/nouveau/disp/gv100-: expose capabilities class Signed-off-by: Ben Skeggs commit b950c8c5d082d822b0134d1fc058101ab346e503 Author: Ben Skeggs Date: Wed Jan 29 18:27:39 2020 +1000 drm/nouveau/bios: move ACPI _ROM handling Signed-off-by: Ben Skeggs commit 2dd4d163cd9c15432524aa9863155bc03a821361 Author: Ben Skeggs Date: Sun Feb 2 13:55:23 2020 +1000 drm/nouveau: remove open-coded version of remove_conflicting_pci_framebuffers() Signed-off-by: Ben Skeggs commit fb172f5fe880cd0ddb4370b2fcc9ad4848c98bbb Author: Ben Skeggs Date: Fri Feb 7 12:39:25 2020 +1000 drm/nouveau/gr/gk20a: move MODULE_FIRMWARE firmware definitions Signed-off-by: Ben Skeggs commit d2bcfce7f8a4ba8df28d3bebb81225bd7f9c046f Author: Ben Skeggs Date: Tue Feb 11 17:36:49 2020 +1000 drm/nouveau/ibus: use nvkm_subdev_new_() Signed-off-by: Ben Skeggs commit f02ca8425a5c49a3751ca0045f1ec14b3c84a05f Author: Ben Skeggs Date: Tue Feb 11 17:34:58 2020 +1000 drm/nouveau/core: add nvkm_subdev_new_() for bare subdevs Signed-off-by: Ben Skeggs commit fa4f4c213f5f7807360c41f2501a3031a9940f3a Author: James Jones Date: Mon Feb 10 15:15:55 2020 -0800 drm/nouveau/kms: Support NVIDIA format modifiers Allow setting the block layout of a nouveau FB object using DRM format modifiers. When specified, the format modifier block layout and kind overrides the GEM buffer's implicit layout and kind. The specified format modifier is validated against the list of modifiers supported by the target display hardware. v2: Used Tesla family instead of NV50 chipset compare v4: Do not cache kind, tile_mode in nouveau_framebuffer v5: Resolved against nouveau_framebuffer cleanup Signed-off-by: James Jones Signed-off-by: Ben Skeggs commit 4f5746c863db1a98535964009da19c6f7a842c55 Author: James Jones Date: Mon Feb 10 15:15:54 2020 -0800 drm/nouveau/kms: Check framebuffer size against bo Make sure framebuffer dimensions and tiling parameters will not result in accesses beyond the end of the GEM buffer they are bound to. v3: Return EINVAL when creating FB against BO with unsupported tiling v5: Resolved against nouveau_framebuffer cleanup Signed-off-by: James Jones Signed-off-by: Ben Skeggs commit c586f30bf74cb580c1748222b05a0bad57d7dcd4 Author: James Jones Date: Mon Feb 10 15:15:53 2020 -0800 drm/nouveau/kms: Add format mod prop to base/ovly/nvdisp Advertise support for the full list of format modifiers supported by each class of NVIDIA desktop GPU display hardware. Stash the array of modifiers in the nouveau_display struct for use when validating userspace framebuffer creation requests, which will be supportd in a subsequent change. Signed-off-by: James Jones Signed-off-by: Ben Skeggs commit fd44028ff145ffb2d03c877d74f479da04ac2c62 Author: Ben Skeggs Date: Tue Feb 11 08:45:04 2020 +1000 drm/nouveau/acr: ensure falcon providing acr functions is bootstrapped first Signed-off-by: Ben Skeggs commit 559c9eb6a6698db8ba355edf79afd7c10b89026c Author: Thomas Zimmermann Date: Thu Feb 6 11:19:42 2020 +0100 drm/nouveau/kms: Remove struct nouveau_framebuffer After its cleanup, struct nouveau_framebuffer is only a wrapper around struct drm_framebuffer. Use the latter directly. Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit 183405879255919c879edb37db70becfac9a4033 Author: Thomas Zimmermann Date: Thu Feb 6 11:19:41 2020 +0100 drm/nouveau/kms: Remove field nvbo from struct nouveau_framebuffer The buffer object stored in nvbo is also available GEM object in obj[0] of struct drm_framebuffer. Therefore remove nvbo in favor obj[0] and replace all references accordingly. This may require an additional cast. With this change we can already replace nouveau_user_framebuffer_destroy() and nouveau_user_framebuffer_create_handle() with generic GEM helpers. Calls to nouveau_framebuffer_new() receive a GEM object. Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit 84c862b572f88dd41dfd06df63454fb1010fee05 Author: Thomas Zimmermann Date: Thu Feb 6 11:19:40 2020 +0100 drm/nouveau/kms: Move struct nouveau_framebuffer.vma to struct nouveau_fbdev The vma field of struct nouveau_framebuffer is a special field for the the accelerated fbdev console. Hence there's at most one single instance for the active console. Moving it into struct nouveau_fbdev makes struct nouveau_framebuffer slightly smaller and brings it closer to struct drm_framebuffer. Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit e27ad35e69f6289561d0de699c58a90e4d9200c2 Author: Thomas Zimmermann Date: Thu Feb 6 11:19:39 2020 +0100 drm/nouveau/kms: Remove unused fields from struct nouveau_framebuffer Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit bbd540c072a8f7ad7aa4ba6a67ad5b30322e188b Author: Ben Skeggs Date: Wed Jan 29 17:32:22 2020 +1000 drm/nouveau: fix out-of-tree module build The $(srctree) addition a while back busted building the out-of-tree version of the module, and I've been hacking it up ever since. This allows us to work around the issue. Signed-off-by: Ben Skeggs commit 82c8c4ddcae74460f4ea484ab9ad97ddb466e469 Author: James Jones Date: Wed Dec 11 12:55:47 2019 -0800 drm: Generalized NV Block Linear DRM format mod Builds upon the existing NVIDIA 16Bx2 block linear format modifiers by adding more "fields" to the existing parameterized DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK format modifier macro that allow fully defining a unique-across- all-NVIDIA-hardware bit layout using a minimal set of fields and values. The new modifier macro DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D is effectively backwards compatible with the existing macro, introducing a superset of the previously definable format modifiers. Backwards compatibility has two quirks. First, the zero value for the "kind" field, which is implied by the DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK macro, must be special cased in drivers and assumed to map to the pre-Turing generic kind of 0xfe, since a kind of "zero" is reserved for linear buffer layouts on all GPUs. Second, it is assumed backwards compatibility is only needed when running on Tegra GPUs, and specifically Tegra GPUs prior to Xavier. This is based on two assertions: -Tegra GPUs prior to Xavier used a slightly different raw bit layout than desktop GPUs, making it impossible to directly share block linear buffers between the two. -Support for the existing block linear modifiers was incomplete, making them useful only for exporting buffers created by nouveau and importing them to Tegra DRM as framebuffers for scan out. There was no support for adding framebuffers using format modifiers in nouveau, nor importing dma-buf/PRIME GEM objects into nouveau userspace drivers with modifiers in Mesa. Hence it is assumed the prior modifiers were not intended for use on desktop GPUs, and as a corollary, were not intended to support sharing block linear buffers across two different NVIDIA GPUs. v2: - Added canonicalize helper function v3: - Added additional bit to compression field to support Tesla (NV5x,G8x,G9x,GT1xx,GT2xx) class chips. Signed-off-by: James Jones Signed-off-by: Ben Skeggs commit 29ae90d221755c7ddb3b7e4de2a73f76a4fdd500 Merge: 79917b242c3f d844a71bff0f Author: Alexei Starovoitov Date: Thu May 21 17:44:25 2020 -0700 Merge branch 'improve-branch_taken' John Fastabend says: ==================== This series adds logic to the verifier to handle the case where a pointer is known to be non-null but then the verifier encountesr a instruction, such as 'if ptr == 0 goto X' or 'if ptr != 0 goto X', where the pointer is compared against 0. Because the verifier tracks if a pointer may be null in many cases we can improve the branch tracking by following the case known to be true. The first patch adds the verifier logic and patches 2-4 add the test cases. v1->v2: fix verifier logic to return -1 indicating both paths must still be walked if value is not zero. Move mark_precision skip for this case into caller of mark_precision to ensure mark_precision can still catch other misuses. And add PTR_TYPE_BTF_ID to our list of supported types. Finally add one more test to catch the value not equal zero case. Thanks to Andrii for original review. Also fixed up commit messages hopefully its better now. ==================== Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov commit d844a71bff0fd899146e5981ec44b618afd17d83 Author: John Fastabend Date: Thu May 21 13:08:26 2020 -0700 bpf: Selftests, add printk to test_sk_lookup_kern to encode null ptr check Adding a printk to test_sk_lookup_kern created the reported failure where a pointer type is checked twice for NULL. Lets add it to the progs test test_sk_lookup_kern.c so we test the case from C all the way into the verifier. We already have printk's in selftests so seems OK to add another one. Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159009170603.6313.1715279795045285176.stgit@john-Precision-5820-Tower commit f9b16ec0eeb75337aef38954a4066e6eecd7cfe5 Author: John Fastabend Date: Thu May 21 13:08:06 2020 -0700 bpf: Selftests, verifier case for non null pointer map value branch When we have pointer type that is known to be non-null we only follow the non-null branch. This adds tests to cover the map_value pointer returned from a map lookup. To force an error if both branches are followed we do an ALU op on R10. Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159009168650.6313.7434084136067263554.stgit@john-Precision-5820-Tower commit c72b5cbb09bd76634b8d19695db2219964e24128 Author: John Fastabend Date: Thu May 21 13:07:46 2020 -0700 bpf: Selftests, verifier case for non null pointer check branch taken When we have pointer type that is known to be non-null and comparing against zero we only follow the non-null branch. This adds tests to cover this case for reference tracking. Also add the other case when comparison against a non-zero value and ensure we still fail with unreleased reference. Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/159009166599.6313.1593680633787453767.stgit@john-Precision-5820-Tower commit cac616db39c207dc63465a4e05c6ce0e60b2cce4 Author: John Fastabend Date: Thu May 21 13:07:26 2020 -0700 bpf: Verifier track null pointer branch_taken with JNE and JEQ Currently, when considering the branches that may be taken for a jump instruction if the register being compared is a pointer the verifier assumes both branches may be taken. But, if the jump instruction is comparing if a pointer is NULL we have this information in the verifier encoded in the reg->type so we can do better in these cases. Specifically, these two common cases can be handled. * If the instruction is BPF_JEQ and we are comparing against a zero value. This test is 'if ptr == 0 goto +X' then using the type information in reg->type we can decide if the ptr is not null. This allows us to avoid pushing both branches onto the stack and instead only use the != 0 case. For example PTR_TO_SOCK and PTR_TO_SOCK_OR_NULL encode the null pointer. Note if the type is PTR_TO_SOCK_OR_NULL we can not learn anything. And also if the value is non-zero we learn nothing because it could be any arbitrary value a different pointer for example * If the instruction is BPF_JNE and ware comparing against a zero value then a similar analysis as above can be done. The test in asm looks like 'if ptr != 0 goto +X'. Again using the type information if the non null type is set (from above PTR_TO_SOCK) we know the jump is taken. In this patch we extend is_branch_taken() to consider this extra information and to return only the branch that will be taken. This resolves a verifier issue reported with C code like the following. See progs/test_sk_lookup_kern.c in selftests. sk = bpf_sk_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); bpf_printk("sk=%d\n", sk ? 1 : 0); if (sk) bpf_sk_release(sk); return sk ? TC_ACT_OK : TC_ACT_UNSPEC; In the above the bpf_printk() will resolve the pointer from PTR_TO_SOCK_OR_NULL to PTR_TO_SOCK. Then the second test guarding the release will cause the verifier to walk both paths resulting in the an unreleased sock reference. See verifier/ref_tracking.c in selftests for an assembly version of the above. After the above additional logic is added the C code above passes as expected. Reported-by: Andrey Ignatov Suggested-by: Alexei Starovoitov Signed-off-by: John Fastabend Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/159009164651.6313.380418298578070501.stgit@john-Precision-5820-Tower commit 79917b242c3fe0d89e4752bc25ffef4574c2194b Merge: dda18a5c0b75 28bee21dc04b Author: Alexei Starovoitov Date: Thu May 21 17:31:27 2020 -0700 Merge branch 'af_xdp-common-alloc' Björn Töpel says: ==================== Overview ======== Driver adoption for AF_XDP has been slow. The amount of code required to proper support AF_XDP is substantial and the driver/core APIs are vague or even non-existing. Drivers have to manually adjust data offsets, updating AF_XDP handles differently for different modes (aligned/unaligned). This series attempts to improve the situation by introducing an AF_XDP buffer allocation API. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer is allocated using the xsk_buff_alloc() function, and returned using xsk_buff_free(). If a buffer is disassociated with the pool, e.g. when a buffer is passed to an AF_XDP socket, a buffer is said to be released. Currently, the release function is only used by the AF_XDP internals and not visible to the driver. Drivers using this API should register the XDP memory model with the new MEM_TYPE_XSK_BUFF_POOL type, which will supersede the MEM_TYPE_ZERO_COPY type. The buffer type is struct xdp_buff, and follows the lifetime of regular xdp_buffs, i.e. the lifetime of an xdp_buff is restricted to a NAPI context. In other words, the API is not replacing xdp_frames. DMA mapping/synching is folded into the buffer handling as well. @JeffK The Intel drivers changes should go through the bpf-next tree, and not your regular Intel tree, since multiple (non-Intel) drivers are affected. The outline of the series is as following: Patch 1 is a fix for xsk_umem_xdp_frame_sz(). Patch 2 to 4 are restructures/clean ups. The XSKMAP implementation is moved to net/xdp/. Functions/defines/enums that are only used by the AF_XDP internals are moved from the global include/net/xdp_sock.h to net/xdp/xsk.h. We are also introducing a new "driver include file", include/net/xdp_sock_drv.h, which is the only file NIC driver developers adding AF_XDP zero-copy support should care about. Patch 5 adds the new API, and migrates the "copy-mode"/skb-mode AF_XDP path to the new API. Patch 6 to 11 migrates the existing zero-copy drivers to the new API. Patch 12 removes the MEM_TYPE_ZERO_COPY memory type, and the "handle" member of struct xdp_buff. Patch 13 simplifies the xdp_return_{frame,frame_rx_napi,buff} functions. Patch 14 is a performance patch, where some functions are inlined. Finally, patch 15 updates the MAINTAINERS file to correctly mirror the new file layout. Note that this series removes the "handle" member from struct xdp_buff, which reduces the xdp_buff size. After this series, the diff stat of drivers/net/ is: 27 files changed, 419 insertions(+), 1288 deletions(-) This series is a first step of simplifying the driver side of AF_XDP. I think more of the AF_XDP logic can be moved from the drivers to the AF_XDP core, e.g. the "need wakeup" set/clear functionality. Statistics when allocation fails can now be added to the socket statistics via the XDP_STATISTICS getsockopt(). This will be added in a follow up series. Performance =========== As a nice side effect, performance is up a bit as well. * i40e: 3% higher pps for rxdrop, zero-copy, aligned and unaligned (40 GbE, 64B packets). * mlx5: RX +0.8 Mpps, TX +0.4 Mpps Changelog ========= v4->v5: * Fix various kdoc and GCC warnings (W=1). (Jakub) v3->v4: * mlx5: Remove unused variable num_xsk_frames. (Jakub) * i40e: Made i40e_fd_handle_status() static. (kbuild test robot) v2->v3: * Added xsk_umem_xdp_frame_sz() fix to the series. (Björn) * Initialize struct xdp_buff member frame_sz. (Björn) * Add API to query the DMA address of a frame. (Maxim) * Do DMA sync for CPU till the end of the frame to handle possible growth (frame_sz). (Maxim) * mlx5: Handle frame_sz, use xsk_buff_xdp_get_frame_dma, use xsk_buff API for DMA sync on TX, add performance numbers. (Maxim) v1->v2: * mlx5: Fix DMA address handling, set XDP metadata to invalid. (Maxim) * ixgbe: Fixed xdp_buff data_end update. (Björn) * Swapped SoBs in patch 4. (Maxim) rfc->v1: * Fixed build errors/warnings for m68k and riscv. (kbuild test robot) * Added headroom/chunk size getter. (Maxim/Björn) * mlx5: Put back the sanity check for XSK params, use XSK API to get the total headroom size. (Maxim) * Fixed spelling in commit message. (Björn) * Make sure xp_validate_desc() is inlined for Tx perf. (Maxim) * Sorted file entries. (Joe) * Added xdp_return_{frame,frame_rx_napi,buff} simplification (Björn) Thanks for all the comments/input/help! ==================== Signed-off-by: Alexei Starovoitov commit 28bee21dc04b39e587af3b68938e68caed02d552 Author: Björn Töpel Date: Wed May 20 21:21:03 2020 +0200 MAINTAINERS, xsk: Update AF_XDP section after moves/adds Update MAINTAINERS to correctly mirror the current AF_XDP socket file layout. Also, add the AF_XDP files of libbpf. rfc->v1: Sorted file entries. (Joe) Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Cc: Joe Perches Link: https://lore.kernel.org/bpf/20200520192103.355233-16-bjorn.topel@gmail.com commit 26062b185eee49142adc45f9aa187d909d02d961 Author: Björn Töpel Date: Wed May 20 21:21:02 2020 +0200 xsk: Explicitly inline functions and move definitions In order to reduce the number of function calls, the struct xsk_buff_pool definition is moved to xsk_buff_pool.h. The functions xp_get_dma(), xp_dma_sync_for_cpu(), xp_dma_sync_for_device(), xp_validate_desc() and various helper functions are explicitly inlined. Further, move xp_get_handle() and xp_release() to xsk.c, to allow for the compiler to perform inlining. rfc->v1: Make sure xp_validate_desc() is inlined for Tx perf. (Maxim) Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-15-bjorn.topel@gmail.com commit 82c41671ca4f597b6ff05bd5d118161deec26e07 Author: Björn Töpel Date: Wed May 20 21:21:01 2020 +0200 xdp: Simplify xdp_return_{frame, frame_rx_napi, buff} The xdp_return_{frame,frame_rx_napi,buff} function are never used, except in xdp_convert_zc_to_xdp_frame(), by the MEM_TYPE_XSK_BUFF_POOL memory type. To simplify and reduce code, change so that xdp_convert_zc_to_xdp_frame() calls xsk_buff_free() directly since the type is know, and remove MEM_TYPE_XSK_BUFF_POOL from the switch statement in __xdp_return() function. Suggested-by: Maxim Mikityanskiy Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-14-bjorn.topel@gmail.com commit 0807892ecb35734b7ce6f7c29b078f1b60151c94 Author: Björn Töpel Date: Wed May 20 21:21:00 2020 +0200 xsk: Remove MEM_TYPE_ZERO_COPY and corresponding code There are no users of MEM_TYPE_ZERO_COPY. Remove all corresponding code, including the "handle" member of struct xdp_buff. rfc->v1: Fixed spelling in commit message. (Björn) Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-13-bjorn.topel@gmail.com commit 39d6443c8daf9fefcfcf89de7ae87240956a0b84 Author: Björn Töpel Date: Wed May 20 21:20:59 2020 +0200 mlx5, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_COPY in mlx5e. It allows to drop a lot of code from the driver (which is now common in AF_XDP core and was related to XSK RX frame allocation, DMA mapping, etc.) and slightly improve performance (RX +0.8 Mpps, TX +0.4 Mpps). rfc->v1: Put back the sanity check for XSK params, use XSK API to get the total headroom size. (Maxim) v1->v2: Fix DMA address handling, set XDP metadata to invalid. (Maxim) v2->v3: Handle frame_sz, use xsk_buff_xdp_get_frame_dma, use xsk_buff API for DMA sync on TX, add performance numbers. (Maxim) v3->v4: Remove unused variable num_xsk_frames. (Jakub) Signed-off-by: Björn Töpel Signed-off-by: Maxim Mikityanskiy Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-12-bjorn.topel@gmail.com commit 7117132b22538d24728295ffafa183a0a782fe03 Author: Björn Töpel Date: Wed May 20 21:20:58 2020 +0200 ixgbe, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL Remove MEM_TYPE_ZERO_COPY in favor of the new MEM_TYPE_XSK_BUFF_POOL APIs. v1->v2: Fixed xdp_buff data_end update. (Björn) Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Link: https://lore.kernel.org/bpf/20200520192103.355233-11-bjorn.topel@gmail.com commit 175fc430670be92c00317b9aada8bf39b47b717e Author: Björn Töpel Date: Wed May 20 21:20:57 2020 +0200 ice, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL Remove MEM_TYPE_ZERO_COPY in favor of the new MEM_TYPE_XSK_BUFF_POOL APIs. v4->v5: Fixed "warning: Excess function parameter 'alloc' description in 'ice_alloc_rx_bufs_zc'" and "warning: Excess function parameter 'xdp' description in 'ice_construct_skb_zc'". (Jakub) Signed-off-by: Maciej Fijalkowski Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Link: https://lore.kernel.org/bpf/20200520192103.355233-10-bjorn.topel@gmail.com commit 3b4f0b66c2b3dceea01bd26efa8c4c6f01b4961f Author: Björn Töpel Date: Wed May 20 21:20:56 2020 +0200 i40e, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL Remove MEM_TYPE_ZERO_COPY in favor of the new MEM_TYPE_XSK_BUFF_POOL APIs. The AF_XDP zero-copy rx_bi ring is now simply a struct xdp_buff pointer. v4->v5: Fixed "warning: Excess function parameter 'bi' description in 'i40e_construct_skb_zc'". (Jakub) Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Link: https://lore.kernel.org/bpf/20200520192103.355233-9-bjorn.topel@gmail.com commit be1222b585fdc410b8c1dbcc57dd03a00f04eff5 Author: Björn Töpel Date: Wed May 20 21:20:55 2020 +0200 i40e: Separate kernel allocated rx_bi rings from AF_XDP rings Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well. v3->v4: Made i40e_fd_handle_status() static. (kbuild test robot) v4->v5: Fix kdoc for i40e_clean_programming_status(). (Jakub) Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Link: https://lore.kernel.org/bpf/20200520192103.355233-8-bjorn.topel@gmail.com commit e1675f97367bed74d4dcfe08de9ce9b5d6b288c1 Author: Björn Töpel Date: Wed May 20 21:20:54 2020 +0200 i40e: Refactor rx_bi accesses As a first step to migrate i40e to the new MEM_TYPE_XSK_BUFF_POOL APIs, code that accesses the rx_bi (SW/shadow ring) is refactored to use an accessor function. Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Link: https://lore.kernel.org/bpf/20200520192103.355233-7-bjorn.topel@gmail.com commit 2b43470add8c8ff1e1ee28dffc5c5df97e955d09 Author: Björn Töpel Date: Wed May 20 21:20:53 2020 +0200 xsk: Introduce AF_XDP buffer allocation API In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer is allocated using the xsk_buff_alloc() function, and returned using xsk_buff_free(). If a buffer is disassociated with the pool, e.g. when a buffer is passed to an AF_XDP socket, a buffer is said to be released. Currently, the release function is only used by the AF_XDP internals and not visible to the driver. Drivers using this API should register the XDP memory model with the new MEM_TYPE_XSK_BUFF_POOL type. The API is defined in net/xdp_sock_drv.h. The buffer type is struct xdp_buff, and follows the lifetime of regular xdp_buffs, i.e. the lifetime of an xdp_buff is restricted to a NAPI context. In other words, the API is not replacing xdp_frames. In addition to introducing the API and implementations, the AF_XDP core is migrated to use the new APIs. rfc->v1: Fixed build errors/warnings for m68k and riscv. (kbuild test robot) Added headroom/chunk size getter. (Maxim/Björn) v1->v2: Swapped SoBs. (Maxim) v2->v3: Initialize struct xdp_buff member frame_sz. (Björn) Add API to query the DMA address of a frame. (Maxim) Do DMA sync for CPU till the end of the frame to handle possible growth (frame_sz). (Maxim) Signed-off-by: Björn Töpel Signed-off-by: Maxim Mikityanskiy Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-6-bjorn.topel@gmail.com commit 89e4a376e3a3dab639a3947a6c7cf5d461d1aa4c Author: Björn Töpel Date: Wed May 20 21:20:52 2020 +0200 xsk: Move defines only used by AF_XDP internals to xsk.h Move the XSK_NEXT_PG_CONTIG_{MASK,SHIFT}, and XDP_UMEM_USES_NEED_WAKEUP defines from xdp_sock.h to the AF_XDP internal xsk.h file. Also, start using the BIT{,_ULL} macro instead of explicit shifts. Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-5-bjorn.topel@gmail.com commit a71506a4fda92a39c8ece119876bc7ccde6d3c9d Author: Magnus Karlsson Date: Wed May 20 21:20:51 2020 +0200 xsk: Move driver interface to xdp_sock_drv.h Move the AF_XDP zero-copy driver interface to its own include file called xdp_sock_drv.h. This, hopefully, will make it more clear for NIC driver implementors to know what functions to use for zero-copy support. v4->v5: Fix -Wmissing-prototypes by include header file. (Jakub) Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-4-bjorn.topel@gmail.com commit d20a1676df7e4c3c23d73299159811a50e4854bc Author: Björn Töpel Date: Wed May 20 21:20:50 2020 +0200 xsk: Move xskmap.c to net/xdp/ The XSKMAP is partly implemented by net/xdp/xsk.c. Move xskmap.c from kernel/bpf/ to net/xdp/, which is the logical place for AF_XDP related code. Also, move AF_XDP struct definitions, and function declarations only used by AF_XDP internals into net/xdp/xsk.h. Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-3-bjorn.topel@gmail.com commit 44ac082b30dc2a05a7e23ed7e17b5f9513873386 Author: Björn Töpel Date: Wed May 20 21:20:49 2020 +0200 xsk: Fix xsk_umem_xdp_frame_sz() Calculating the "data_hard_end" for an XDP buffer coming from AF_XDP zero-copy mode, the return value of xsk_umem_xdp_frame_sz() is added to "data_hard_start". Currently, the chunk size of the UMEM is returned by xsk_umem_xdp_frame_sz(). This is not correct, if the fixed UMEM headroom is non-zero. Fix this by returning the chunk_size without the UMEM headroom. Fixes: 2a637c5b1aaf ("xdp: For Intel AF_XDP drivers add XDP frame_sz") Signed-off-by: Björn Töpel Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200520192103.355233-2-bjorn.topel@gmail.com commit 2a330b533462bea0967e723ff12787daa5a608f8 Merge: b0301a5a288d 68ff5e14759e Author: David S. Miller Date: Thu May 21 17:18:00 2020 -0700 Merge branch 'provide-KAPI-for-SQI' Oleksij Rempel says: ==================== provide KAPI for SQI This patches are extending ethtool netlink interface to export Signal Quality Index (SQI). SQI provided by 100Base-T1 PHYs and can be used for cable diagnostic. Compared to a typical cable tests, this value can be only used after link is established. changes v3: - rename __ethtool_get_sqi* to linkstate_get_sqi*. And move this functions to the net/ethtool/linkstate.c - protect linkstate_get_sqi* with locking changes v2: - use u32 instead of u8 for SQI - add SQI_MAX field and callbacks - some style fixes in the rst. - do not convert index to shifted index. ==================== Signed-off-by: David S. Miller commit 68ff5e14759e7ac1aac7bc75ac5b935e390fa2b3 Author: Oleksij Rempel Date: Wed May 20 08:29:15 2020 +0200 net: phy: tja11xx: add SQI support This patch implements reading of the Signal Quality Index for better cable/link troubleshooting. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8066021915924f58ed338bf38208215f5a7355f6 Author: Oleksij Rempel Date: Wed May 20 08:29:14 2020 +0200 ethtool: provide UAPI for PHY Signal Quality Index (SQI) Signal Quality Index is a mandatory value required by "OPEN Alliance SIG" for the 100Base-T1 PHYs [1]. This indicator can be used for cable integrity diagnostic and investigating other noise sources and implement by at least two vendors: NXP[2] and TI[3]. [1] http://www.opensig.org/download/document/218/Advanced_PHY_features_for_automotive_Ethernet_V1.0.pdf [2] https://www.nxp.com/docs/en/data-sheet/TJA1100.pdf [3] https://www.ti.com/product/DP83TC811R-Q1 Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit b0301a5a288d804374b194e755180967ff7a295b Merge: d8bed686ab96 7bfb399eca46 Author: David S. Miller Date: Thu May 21 17:08:25 2020 -0700 Merge branch 'qed-next' Yuval Basson says: ==================== qed: Add xrc core support for RoCE This patch adds support for configuring XRC and provides the necessary APIs for rdma upper layer driver (qedr) to enable the XRC feature. ==================== Signed-off-by: David S. Miller commit 7bfb399eca460500f048098bf427c45b40e17cae Author: Yuval Basson Date: Tue May 19 23:51:26 2020 +0300 qed: Add XRC to RoCE Add support for XRC-SRQ's and XRC-QP's for upper layer driver. We maintain separate bitmaps for resource management for srq and xrc-srq, However, the range in FW is one, The xrc-srq's are first and then the srq's follow. Therefore we maintain a srq-id offset. v2: perform cleanups if XRC bitmpas allocation fail. Signed-off-by: Michal Kalderon Signed-off-by: Yuval Bason Signed-off-by: David S. Miller commit b8204ad878ce7f49870669283de348e458a97ac4 Author: Yuval Basson Date: Tue May 19 23:51:25 2020 +0300 qed: changes to ILT to support XRC First ILT page for TSDM client is allocated for XRC-SRQ's. For regular SRQ's skip first ILT page that is reserved for XRC-SRQ's. Signed-off-by: Michal Kalderon Signed-off-by: Yuval Bason Signed-off-by: David S. Miller commit d8bed686ab96169ac80b497d1cbed89300d97f83 Author: Chris Mi Date: Tue May 19 22:45:20 2020 +0800 net: psample: Add tunnel support Currently, psample can only send the packet bits after decapsulation. The tunnel information is lost. Add the tunnel support. If the sampled packet has no tunnel info, the behavior is the same as before. If it has, add a nested metadata field named PSAMPLE_ATTR_TUNNEL and include the tunnel subfields if applicable. Increase the metadata length for sampled packet with the tunnel info. If new subfields of tunnel info should be included, update the metadata length accordingly. Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 6d1e7ba241e990b5c6ba7fdaa03d466f852f3c9e Author: Yishai Hadas Date: Tue May 19 10:27:11 2020 +0300 IB/uverbs: Introduce create/destroy QP commands over ioctl Introduce create/destroy QP commands over the ioctl interface to let it be extended to get an asynchronous event FD. Link: https://lore.kernel.org/r/20200519072711.257271-8-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ef3bc084a8ed461e3d1f82481f47dacb96596f8f Author: Yishai Hadas Date: Tue May 19 10:27:10 2020 +0300 IB/uverbs: Introduce create/destroy WQ commands over ioctl Introduce create/destroy WQ commands over the ioctl interface to let it be extended to get an asynchronous event FD. Link: https://lore.kernel.org/r/20200519072711.257271-7-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c3eab946aba443f0b44a08f446735c74495610a9 Author: Yishai Hadas Date: Tue May 19 10:27:09 2020 +0300 IB/uverbs: Introduce create/destroy SRQ commands over ioctl Introduce create/destroy SRQ commands over the ioctl interface to let it be extended to get an asynchronous event FD. Link: https://lore.kernel.org/r/20200519072711.257271-6-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 175ba58d62c84e1216cdf8b4f49f79e55e1ed04b Author: Yishai Hadas Date: Tue May 19 10:27:08 2020 +0300 IB/uverbs: Move QP, SRQ, WQ type and flags to UAPI These constants are going to be used in the ioctl interface in coming patches so they are part of the UAPI, place them in the correct header for clarity. Link: https://lore.kernel.org/r/20200519072711.257271-5-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cda9ee494248b890973f5d31cf7851c0d21755b9 Author: Yishai Hadas Date: Tue May 19 10:27:07 2020 +0300 IB/uverbs: Extend CQ to get its own asynchronous event FD Extend CQ to get its own asynchronous event FD. The event FD is an optional attribute, in case wasn't given the ufile event FD will be used. Link: https://lore.kernel.org/r/20200519072711.257271-4-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 98a8890f73489416a1ea49a644565a244d3f729a Author: Yishai Hadas Date: Tue May 19 10:27:06 2020 +0300 IB/uverbs: Refactor related objects to use their own asynchronous event FD Refactor related objects to use their own asynchronous event FD. The ufile event FD will be the default in case an object won't have its own event FD. Link: https://lore.kernel.org/r/20200519072711.257271-3-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c983e3271923c96cd5f90de0b580f1b210f7f8b6 Author: Andre Guedes Date: Fri Apr 24 13:16:11 2020 -0700 igc: Change byte order in struct igc_nfc_filter Every time we access the 'etype' and 'vlan_tci' fields from struct igc_nfc_filter to enable or disable filters in hardware we have to convert them from big endian to host order so it makes more sense to simply have these fields in host order. The byte order conversion should take place in igc_ethtool_get_nfc_ rule() and igc_ethtool_add_nfc_rule(), which are called by .get_rxnfc and .set_rxnfc ethtool ops, since ethtool subsystem is the one who deals with them in big endian order. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 97700bc86d068442ee19ca6d31fc0a600cdbd672 Author: Andre Guedes Date: Fri Apr 24 13:16:10 2020 -0700 igc: Align terms used in NFC support code The Network Flow Classification (NFC) support code from IGC driver uses terms such as 'rule', 'filter', 'entry', 'input' interchangeably when referring to NFC rules, making it harder to follow the code. This patch renames IGC's internal APIs, structs, and variables so we stick with the term 'rule' since this is the term used in ethtool APIs. It also removes some not applicable comments along the way. No functionality is changed by this patch. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 7df76bd1918188c80ee0bb2e849756d07ce71507 Author: Andre Guedes Date: Fri Apr 24 13:16:09 2020 -0700 igc: Add 'igc_ethtool_' prefix to functions in igc_ethtool.c This patch adds the prefix 'igc_ethtool_' to all functions defined in igc_ethtool.c so they align with the name convention already followed by other parts of the driver (e.g. igc_tsn, igc_ptp). Also, this avoids some name clashing with functions added to igc_main.c by upcoming patches in this series. No functionality is changed by this patch, just function renaming. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 876ea04db7675391baa8011795188e55d154aa4e Author: Andre Guedes Date: Fri Apr 24 13:16:08 2020 -0700 igc: Early return in igc_get_ethtool_nfc_entry() This patch re-writes the second half of igc_ethtool_get_nfc_entry() to follow the 'return early' pattern seen in other parts of the driver and removes some duplicate comments. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 8b9c23cdf04f927d591f3fbc3b846d941557e886 Author: Andre Guedes Date: Fri Apr 24 13:16:07 2020 -0700 igc: Cleanup _get|set_rxnfc ethtool ops This patch does a trivial change in igc_ethtool_get_rxnfc() and igc_ethtool_set_rxnfc() to simplify their logic. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 4d0710c241dddf0db62b4be533347d3acd9e8c96 Author: Andre Guedes Date: Fri Apr 24 13:16:06 2020 -0700 igc: Get rid of igc_max_channels() The local function igc_max_channels() is a pointless wrapper around igc_get_max_rss_queues(). This patch removes it and updates the callers accordingly. It also does some cleanup on igc_get_max_rss_queues(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 8e34cad1677a45211d5112ea2bab770656139d20 Author: Andre Guedes Date: Fri Apr 24 13:16:05 2020 -0700 igc: Remove unused field from igc_nfc_filter The 'cookie' field is not used anywhere in the code so this patch removes it from struct igc_nfc_filter. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 281380a6fd8a202635c484c5ac978c468c006cbd Author: Sasha Neftin Date: Wed Apr 22 13:46:47 2020 +0300 igc: Remove per queue good transmited counter register Per queue good transmitted packet counter not applicable for i225 device. This patch comes to clean up this register. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit d1fe569f517e8ee402f5faac28e65c3a72790d0e Author: Sasha Neftin Date: Wed Apr 22 11:41:55 2020 +0300 igc: Remove header redirection register Header redirection missed packet counter not applicable for i225 device. This patch comes to clean up this register. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 3b5fc88f78ea5bc6d2da06c6acff8fe6ba0e7e40 Author: Sasha Neftin Date: Mon Apr 20 14:38:53 2020 +0300 igc: Remove obsolete circuit breaker registers Part of circuit breaker registers is obsolete and not applicable for i225 device. This patch comes to clean up these registers. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 49ee3c2ab5234757bfb56a0b3a3cb422f427e3a3 Author: Alexander Duyck Date: Fri Apr 17 09:35:31 2020 -0700 e1000: Do not perform reset in reset_task if we are already down We are seeing a deadlock in e1000 down when NAPI is being disabled. Looking over the kernel function trace of the system it appears that the interface is being closed and then a reset is hitting which deadlocks the interface as the NAPI interface is already disabled. To prevent this from happening I am disabling the reset task when __E1000_DOWN is already set. In addition code has been added so that we set the __E1000_DOWN while holding the __E1000_RESET flag in e1000_close in order to guarantee that the reset task will not run after we have started the close call. Signed-off-by: Alexander Duyck Tested-by: Maxim Zhukov Signed-off-by: Jeff Kirsher commit 8eb2449d839079f979eded636dabcd6b815ff28f Author: Andre Guedes Date: Mon Apr 13 09:00:50 2020 -0700 igc: Enable NFC rules based source MAC address This patch adds support for Network Flow Classification (NFC) rules based on source MAC address. Note that the controller doesn't support rules with both source and destination addresses set, so this special case is checked in igc_add_ethtool_nfc_entry(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 750433d0aa097265432a2b30a8a984604bd76e7f Author: Andre Guedes Date: Fri Apr 10 17:28:33 2020 -0700 igc: Add support for source address filters in core This patch extends MAC address filter internal APIs igc_add_mac_filter() and igc_del_mac_filter(), as well as local helpers, to support filters based on source address. A new parameters 'type' is added to the APIs to indicate if the filter type is source or destination. In case it is source type, the RAH register is configured accordingly in igc_set_mac_filter_hw(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 2abb65a39bcca0629437bb83e583889f9e1ad696 Author: Roger Pau Monne Date: Tue Mar 24 16:00:15 2020 +0100 xen: enable BALLOON_MEMORY_HOTPLUG by default Without it a PVH dom0 is mostly useless, as it would balloon down huge amounts of RAM in order get physical address space to map foreign memory and grants, ultimately leading to an out of memory situation. Such option is also needed for HVM or PVH driver domains, since they also require mapping grants into physical memory regions. Suggested-by: Ian Jackson Signed-off-by: Roger Pau Monné Link: https://lore.kernel.org/r/20200324150015.50496-2-roger.pau@citrix.com Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 0df683ff7456eb6401c9035c054b7a58c93dd215 Author: Roger Pau Monne Date: Tue Mar 24 16:00:14 2020 +0100 xen: expand BALLOON_MEMORY_HOTPLUG description To mention it's also useful for PVH or HVM domains that require mapping foreign memory or grants. [boris: "non PV" instead of "translated" at Juergen's request] Signed-off-by: Roger Pau Monné Link: https://lore.kernel.org/r/20200324150015.50496-1-roger.pau@citrix.com Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 0ac8903cbbe618d947b5815d6e0f7b044ee83aa3 Author: Jason Gunthorpe Date: Tue May 19 10:27:05 2020 +0300 RDMA/core: Allow the ioctl layer to abort a fully created uobject While creating a uobject every create reaches a point where the uobject is fully initialized. For ioctls that go on to copy_to_user this means they need to open code the destruction of a fully created uobject - ie the RDMA_REMOVE_DESTROY sort of flow. Open coding this creates bugs, eg the CQ does not properly flush the events list when it does its error unwind. Provide a uverbs_finalize_uobj_create() function which indicates that the uobject is fully initialized and that abort should call to destroy_hw to destroy the uobj->object and related. Methods can call this function if they go on to have error cases after setting uobj->object. Once done those error cases can simply do return, without an error unwind. Link: https://lore.kernel.org/r/20200519072711.257271-2-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c60037f0d78088f2f542ac23fb30a0bb68b68ed1 Merge: 8f3d9f354286 dec396322d25 Author: Stephen Boyd Date: Thu May 21 15:52:41 2020 -0700 Merge tag 'for-5.8-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into clk-tegra Pull Tegra clk driver updates from Thierry Reding: These are a couple of changes to implement EMC frequency scaling on Tegra210, CPU frequency scaling on Tegra20 and Tegra30 as well as a special clock gate for the CSI test pattern generator on Tegra210. * tag 'for-5.8-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: clk: tegra: Add Tegra210 CSI TPG clock gate clk: tegra30: Use custom CCLK implementation clk: tegra20: Use custom CCLK implementation clk: tegra: cclk: Add helpers for handling PLLX rate changes clk: tegra: pll: Add pre/post rate-change hooks clk: tegra: Add custom CCLK implementation clk: tegra: Remove the old emc_mux clock for Tegra210 clk: tegra: Implement Tegra210 EMC clock clk: tegra: Export functions for EMC clock scaling clk: tegra: Add PLLP_UD and PLLMB_UD for Tegra210 clk: tegra: Rename Tegra124 EMC clock source file dt-bindings: clock: tegra: Add clock ID for CSI TPG clock commit 33b52f7cc99ee526b61c081e3a20d94bca41ffac Merge: 8f3d9f354286 ee25d9742dab Author: Stephen Boyd Date: Thu May 21 15:47:37 2020 -0700 Merge tag 'sunxi-clk-for-5.8-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull an Allwinner clk driver fix from Maxime Ripard: - a single minor rounding fix for the legacy Allwinner clock support * tag 'sunxi-clk-for-5.8-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi: Fix incorrect usage of round_down() commit fe95d2e92efad656cdbbda3980e829892fc30c9d Merge: 8f3d9f354286 25bdae0f1c66 Author: Stephen Boyd Date: Thu May 21 15:43:32 2020 -0700 Merge tag 'clk-v5.8-samsung' of https://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk into clk-samsung Pull Samsung clk driver updates from Sylwester Nawrocki: - Regression fixes for exynos542x and exynos5433 SoCs - use of fallthrough; attribute for s3c24xx * tag 'clk-v5.8-samsung' of https://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk: clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1 ARM/SAMSUNG EXYNOS ARM ARCHITECTURES: Use fallthrough; clk: samsung: Fix CLK_SMMU_FIMCL3 clock name on Exynos542x clk: samsung: Mark top ISP and CAM clocks on Exynos542x as critical commit 571a6b4755e85fe5266ac66fddfaf6db9b4891cc Merge: e8b81b1ea356 9b9df63b5030 Author: Stephen Boyd Date: Thu May 21 15:37:54 2020 -0700 Merge tag 'clk-renesas-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates from Geert Uytterhoeven: - A minor fix for the currently unused suspend/resume handling on RZ/A1 and RZ/A2 - Two more conversions of Renesas DT bindings to json-schema * tag 'clk-renesas-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: dt-bindings: clock: renesas: mstp: Convert to json-schema dt-bindings: clock: renesas: div6: Convert to json-schema clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling commit 78b7dfd9cebe2bca986a88a3b0978557221b1dc4 Author: Alan Swanson Date: Thu May 21 21:29:30 2020 +0100 drm/amdgpu: resize VRAM BAR for CPU access on gfx10 Try to resize BAR0 to let CPU access all of VRAM on Navi. Syncs code with previous gfx generations from commit d6895ad39f3b39 ("drm/amdgpu: resize VRAM BAR for CPU access v6"). Signed-off-by: Alan Swanson Signed-off-by: Alex Deucher commit d3a3763432c5577fb46d45861eba489b0e76412e Author: Alex Deucher Date: Tue May 19 17:06:20 2020 -0400 drm/amdgpu: drop navi pcie bw callback It's not implemented yet so just drop it so the sysfs pcie bw file returns an appropriate error instead of garbage. Reviewed-by: Yong Zhao Reviewed-By: Kent Russell Signed-off-by: Alex Deucher commit d08d692ebbc0fccb96506b80b5063b9309f219a7 Author: Alex Deucher Date: Tue May 19 16:54:55 2020 -0400 drm/amdgpu: improve error handling in pcie_bw 1. Initialize the counters to 0 in case the callback fails to initialize them. 2. The counters don't exist on APUs so return an error for them. 3. Return an error if the callback doesn't exist. Reviewed-by: Yong Zhao Reviewed-By: Kent Russell Signed-off-by: Alex Deucher commit f7646585a30ed8ef5ab300d4dc3b0c1d6afbe71d Author: Philip Yang Date: Thu May 21 09:56:58 2020 -0400 drm/amdkfd: fix restore worker race condition In free memory of gpu path, remove bo from validate_list to make sure restore worker don't access the BO any more, then unregister bo MMU interval notifier. Otherwise, the restore worker will crash in the middle of validating BO user pages if MMU interval notifer is gone. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit fec6111ae32257bab9e218bfd8a30e135591717e Merge: 93d2fa6a035b 528443e32a3d Author: Arnd Bergmann Date: Thu May 21 23:56:21 2020 +0200 Merge tag 'hisi-arm64-defconfig-for-5.8' of git://github.com/hisilicon/linux-hisi into arm/defconfig ARM64: hisilicon: defconfig updates for 5.8 - Enable PCI PASID as built-in module and UACCE/SEC2/HPRE as loadable modules to support UACCE use case for the D06CS board * tag 'hisi-arm64-defconfig-for-5.8' of git://github.com/hisilicon/linux-hisi: arm64: defconfig: Enable UACCE/PCI PASID/SEC2/HPRE configs Link: https://lore.kernel.org/r/5EBE4217.6000900@hisilicon.com Signed-off-by: Arnd Bergmann commit 93d2fa6a035be8d697bc837dfe4f672c41943041 Merge: 72a790ac7c99 38f58fc51d12 Author: Arnd Bergmann Date: Thu May 21 23:54:21 2020 +0200 Merge tag 'amlogic-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/defconfig arm64: defconfig: Amlogic updates for v5.8 - enable meson gx audio as module * tag 'amlogic-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: arm64: defconfig: enable meson gx audio as module Link: https://lore.kernel.org/r/5ec6f4f6.1c69fb81.3fe34.b693@mx.google.com Signed-off-by: Arnd Bergmann commit 72a790ac7c9911792ef226f7ca959886c118518b Merge: 88b1542b06eb 5ef3c35809ec Author: Arnd Bergmann Date: Thu May 21 23:53:06 2020 +0200 Merge tag 'qcom-arm64-defconfig-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM64 defconfig updates for v5.8 This enables SM8250 GCC clock driver, SC7180 GCC clock driver and SC7180 TLMM pinctrl driver, the IPA and RMNET drivers, CCI, camera subsystem and camera clock drivers and removes the now depricated GLINK_SSR entry. * tag 'qcom-arm64-defconfig-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: enable Qualcomm IPA and RMNet modules arm64: defconfig: Enable Qualcomm SC7180 pinctrl and gcc arm64: defconfig: Remove QCOM_GLINK_SSR arm64: defconfig: Enable SM8250 GCC driver arm64: defconfig: Enable Qualcomm CAMCC, CAMSS and CCI drivers Link: https://lore.kernel.org/r/20200519052502.1249888-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 88b1542b06ebaf4ba867d7e14277b0dbdc6e4647 Merge: 6e15f0a9c498 6a2ab88ca789 Author: Arnd Bergmann Date: Thu May 21 23:52:40 2020 +0200 Merge tag 'at91-5.8-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/defconfig AT91 defconfig for 5.8 - Add PIOBU and MCP16502 regulator to sama5 defconfig * tag 'at91-5.8-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: configs: at91: sama5: enable MCP16502 regulator ARM: configs: at91: sama5: enable SAMA5D2_PIOBU Link: https://lore.kernel.org/r/20200518213254.GA26598@piout.net Signed-off-by: Arnd Bergmann commit 6e15f0a9c49896d8db4aa0b258efb255af14294e Merge: c0feb184a71d cdaeaa2560a9 Author: Arnd Bergmann Date: Thu May 21 23:52:10 2020 +0200 Merge tag 'sunxi-config-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/defconfig Two patches to enable the new cpufreq support on the H6 for the arm64 defconfig to enable the audio codec in sunxi_defconfig. * tag 'sunxi-config-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: configs: Enable sun50i cpufreq nvmem ARM: configs: sunxi: Add sun8i analog codec Link: https://lore.kernel.org/r/9fd4d403-f6c8-420d-8b03-62e8485a0b3d.lettre@localhost Signed-off-by: Arnd Bergmann commit c0feb184a71dfc22f25311e97ad378e3363f0699 Merge: 66fa76a7dbd8 44b6141ebe93 Author: Arnd Bergmann Date: Thu May 21 23:50:17 2020 +0200 Merge tag 'renesas-arm-defconfig-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/defconfig Renesas ARM defconfig updates for v5.8 (take two) - Enable support for the new RZ/G1H SoC in the shmobile and multi_v7 defconfigs. * tag 'renesas-arm-defconfig-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: multi_v7_defconfig: Enable r8a7742 SoC ARM: shmobile: defconfig: Enable r8a7742 SoC Link: https://lore.kernel.org/r/20200515100547.14671-2-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 66fa76a7dbd88719c2125e478c93d6fbe50f37f6 Merge: 016eae21a317 a8360727870b Author: Arnd Bergmann Date: Thu May 21 23:45:08 2020 +0200 Merge tag 'samsung-defconfig-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/defconfig Samsung defconfig changes for v5.8 1. Enable drivers for Exynos3250 Rinato Bluetooth, 2. Build WiFi mac80211 framework as module so it will get loaded the same time as regulatory data. * tag 'samsung-defconfig-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: exynos_defconfig: Compile MAC80211/CFG80211 as modules ARM: exynos_defconfig: Enable serial bus and BCM HCIUART drivers Link: https://lore.kernel.org/r/20200512122922.5700-1-krzk@kernel.org Signed-off-by: Arnd Bergmann commit 016eae21a31735409438e55ee7b8adfb8371133e Merge: 929379dd0fa0 35cdc3fa00ee Author: Arnd Bergmann Date: Thu May 21 23:44:04 2020 +0200 Merge tag 'arm-soc/for-5.8/defconfig' of https://github.com/Broadcom/stblinux into arm/defconfig This pull request contains Broadcom ARM-based SoCs defconfig file updates for v5.8, please pull the following: - Nicolas enables the fixed-regulator in bcm2835_defconfig which is need to control the Raspberry Pi 4 SD car power supply * tag 'arm-soc/for-5.8/defconfig' of https://github.com/Broadcom/stblinux: ARM: bcm2835_defconfig: Enable fixed-regulator Link: https://lore.kernel.org/r/20200511210522.28243-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 929379dd0fa00ab8a63d49e4e2a92a54f07d68ae Merge: 962abbc0847b 4c427ab28fd1 Author: Arnd Bergmann Date: Thu May 21 23:43:08 2020 +0200 Merge tag 'renesas-arm-defconfig-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/defconfig Renesas ARM defconfig updates for v5.8 - Refresh shmobile_defconfig for v5.7-rc1. * tag 'renesas-arm-defconfig-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: defconfig: Refresh for v5.7-rc1 Link: https://lore.kernel.org/r/20200430084849.1457-2-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 962abbc0847bc657a11040b23659f7a5b090ae3e Merge: b9bbe6ed63b2 288d3f142bd6 Author: Arnd Bergmann Date: Thu May 21 23:42:34 2020 +0200 Merge tag 'ux500-defconfig-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into arm/defconfig Ux500 defconfig changes for functionality merged in the v5.7 merge window: - Enable drivers for the Golden and Skomer mobile phones. - Enable drivers for the HREF520 reference design. * tag 'ux500-defconfig-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: ARM: defconfig: u8500: Enable new drivers for ux500 ARM: defconfig: u8500: Enable new drivers for samsung-golden Link: https://lore.kernel.org/r/CACRpkdaxT8dc=mhAd51+KtQ0K4Uj5tttt36bYJLqP_hNfWXP8w@mail.gmail.com Signed-off-by: Arnd Bergmann commit 9eddc06a3bc79402f50176703237ed045ae77b16 Merge: ed365a4a84a0 24cf6eef79a7 Author: Arnd Bergmann Date: Thu May 21 23:37:22 2020 +0200 Merge branch 'mmp/fixes' into arm/dt These were queued for v5.7 as bugfixes, merge them here as well to resolve the conflicts. * mmp/fixes: ARM: dts: mmp3: Drop usb-nop-xceiv from HSIC phy ARM: dts: mmp3-dell-ariel: Fix the SPI devices ARM: dts: mmp3: Use the MMP3 compatible string for /clocks Signed-off-by: Arnd Bergmann commit ed365a4a84a016077d4c07796c75971e45edbbb8 Author: Lubomir Rintel Date: Sun Apr 19 19:11:54 2020 +0200 ARM: dts: mmp3: Add the fifth SD HCI There's one extra SDHCI on MMP3, used by the internal SD card on OLPC XO-4. Add it to the device tree. Signed-off-by: Lubomir Rintel Signed-off-by: Arnd Bergmann commit dd95b542b74c774598a4ef2f61cd914c99028ccc Author: Lubomir Rintel Date: Sun Apr 19 19:11:53 2020 +0200 ARM: dts: berlin*: Fix up the SDHCI node names The node name preferred by mmc-controller.yaml binding spec is "mmc": berlin2-sony-nsz-gs7.dt.yaml: sdhci@ab0000: $nodename:0: 'sdhci@ab0000' does not match '^mmc(@.*)?$' berlin2-sony-nsz-gs7.dt.yaml: sdhci@ab0800: $nodename:0: 'sdhci@ab0800' does not match '^mmc(@.*)?$' berlin2-sony-nsz-gs7.dt.yaml: sdhci@ab1000: $nodename:0: 'sdhci@ab1000' does not match '^mmc(@.*)?$' berlin2cd-google-chromecast.dt.yaml: sdhci@ab0000: $nodename:0: 'sdhci@ab0000' does not match '^mmc(@.*)?$' berlin2cd-valve-steamlink.dt.yaml: sdhci@ab0000: $nodename:0: 'sdhci@ab0000' does not match '^mmc(@.*)?$' berlin2q-marvell-dmp.dt.yaml: sdhci@ab0000: $nodename:0: 'sdhci@ab0000' does not match '^mmc(@.*)?$' berlin2q-marvell-dmp.dt.yaml: sdhci@ab0800: $nodename:0: 'sdhci@ab0800' does not match '^mmc(@.*)?$' berlin2q-marvell-dmp.dt.yaml: sdhci@ab1000: $nodename:0: 'sdhci@ab1000' does not match '^mmc(@.*)?$' Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit bbbea1f2a9b16c7f85e94e4c2d90eee005cfae61 Author: Lubomir Rintel Date: Sun Apr 19 19:11:52 2020 +0200 ARM: dts: mmp3: Fix USB & USB PHY node names There are better generic ones and the validation is going to complain: mmp3-dell-ariel.dt.yaml: hsic@f0001000: $nodename:0: 'hsic@f0001000' does not match '^usb(@.*)?' mmp3-dell-ariel.dt.yaml: hsic@f0002000: $nodename:0: 'hsic@f0002000' does not match '^usb(@.*)?' ... Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 7df3a1ee12ebccd13c4b2d0def7b0403216db4f0 Author: Lubomir Rintel Date: Sun Apr 19 19:11:51 2020 +0200 ARM: dts: mmp3: Fix L2 cache controller node name The current one makes validation unhappy: mmp3-dell-ariel.dt.yaml: l2-cache-controller@d0020000: $nodename:0: 'l2-cache-controller@d0020000' does not match '^(cache-controller|cpu)(@[0-9a-f,]+)*$' Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 4989fd577d0720c334ddbd01748a21a9adc7d197 Author: Lubomir Rintel Date: Sun Apr 19 19:11:50 2020 +0200 ARM: dts: mmp*: Fix up encoding of the /rtc interrupts property This way the device tree validator learns that each cell of the property constitutes a separate item. Otherwise it gets unnecessairly upset: mmp3-dell-ariel.dt.yaml: rtc@d4010000: interrupts: [[1, 0]] is too short Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 2e7167d17bcdc9968e0a103f7cb01b2820f86345 Author: Lubomir Rintel Date: Sun Apr 19 19:11:49 2020 +0200 ARM: dts: pxa*: Fix up encoding of the /rtc interrupts property This way the device tree validator learns that each cell of the property constitutes a separate item. Otherwise it gets unnecessairly upset: pxa168-aspenite.dt.yaml: rtc@d4010000: interrupts: [[5, 6]] is too short pxa910-dkb.dt.yaml: rtc@d4010000: interrupts: [[5, 6]] is too short Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit c911cadfab50a67beff9cb036c3de9f8c81ff976 Author: Lubomir Rintel Date: Sun Apr 19 19:11:48 2020 +0200 ARM: dts: pxa910: Fix the gpio interrupt cell number gpio-pxa uses two cell to encode the interrupt source: the pin number and the trigger type. Adjust the device node accordingly. Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 55d26c38442e8f23491085b5cebddd352dea9e9a Author: Lubomir Rintel Date: Sun Apr 19 19:11:47 2020 +0200 ARM: dts: pxa3xx: Fix up encoding of the /gpio interrupts property This way the device tree validator learns that each cell of the property constitutes a separate item. Otherwise it gets unnecessairly upset: pxa300-raumfeld-speaker-s.dt.yaml: gpio@40e00000: interrupts: [[8, 9, 10]] is too short Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Reviewed-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 51d6bba66113f7da02f2c0b645c721f1ba6b98eb Author: Lubomir Rintel Date: Sun Apr 19 19:11:46 2020 +0200 ARM: dts: pxa168: Fix the gpio interrupt cell number gpio-pxa uses two cell to encode the interrupt source: the pin number and the trigger type. Adjust the device node accordingly. Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 4fade3403e5a8f1750a444023d9ed175e2960a37 Author: Lubomir Rintel Date: Sun Apr 19 19:11:45 2020 +0200 ARM: dts: pxa168: Add missing address/size cells to i2c nodes This makes the nodes compatible with the generic i2c binding without the board DTS files having to supply the necessary properties themselves. Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit a857caa9d95b8645a38113db79e37b6bcefd35c8 Author: Lubomir Rintel Date: Sun Apr 19 19:11:44 2020 +0200 ARM: dts: dove: Fix interrupt controller node name The current ones makes validation unhappy: dove-d3plug.dt.yaml: main-interrupt-ctrl@20200: $nodename:0: 'main-interrupt-ctrl@20200' does not match '^interrupt-controller(@[0-9a-f,]+)*$' Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 6656e163535530098f85651e5987f0a68705875b Author: Lubomir Rintel Date: Sun Apr 19 19:11:43 2020 +0200 ARM: dts: kirkwood: Fix interrupt controller node name The current ones makes validation unhappy: kirkwood-lsxhl.dt.yaml: main-interrupt-ctrl@20200: $nodename:0: 'main-interrupt-ctrl@20200' does not match '^interrupt-controller(@[0-9a-f,]+)*$' Signed-off-by: Lubomir Rintel Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 9440d8acb5acf991d1e0c5ba3d1594cdcf6a17d8 Merge: f0c59fd97c6e 54b1a4e07033 Author: Arnd Bergmann Date: Thu May 21 23:16:36 2020 +0200 Merge tag 'v5.8-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt RGA node for rk322x, wifi node for rk3229-xms6 and some cleanups. * tag 'v5.8-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: add rga node for rk322x ARM: dts: remove disable-wp from rk3229-xms6 emmc ARM: dts: enable WLAN for Mecer Xtreme Mini S6 ARM: dts: rockchip: remove identical #include from rk3288.dtsi ARM: dts: rockchip: rename and label gpio-led subnodes Link: https://lore.kernel.org/r/3735080.6Cexqc3t0Y@phil Signed-off-by: Arnd Bergmann commit f0c59fd97c6e45d04fe8ac258e6cbccc5480d316 Merge: 87b990ab6272 b2cb68e86422 Author: Arnd Bergmann Date: Thu May 21 23:14:10 2020 +0200 Merge tag 'v5.8-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt New soc variant the rk3326 which is essentially a px30 with only one display controller and a new board using it, the Odroid Advance Go. sdcard regulator for the rockpro64 and a lot of devicetree fixes making the dt-binding check a lot happier. * tag 'v5.8-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (22 commits) arm64: dts: rockchip: fix pinctrl-names for gpio-leds node on rk3326-odroid-go2 arm64: dts: rockchip: fix pd_tcpc0 and pd_tcpc1 node position on rk3399 arm64: dts: rockchip: add bus-width properties to mmc nodes for px30 arm64: dts: rockchip: remove disable-wp from rk3308-roc-cc emmc node arm64: dts: rockchip: rename and label gpio-led subnodes arm64: dts: rockchip: fix defines in pd_vio node for rk3399 arm64: dts: rockchip: fix &pinctrl phy sub nodename for rk3399-orangepi arm64: dts: rockchip: fix rtl8211e nodename for rk3399-orangepi arm64: dts: rockchip: fix &pinctrl phy sub nodename for rk3399-nanopi4 arm64: dts: rockchip: fix rtl8211e nodename for rk3399-nanopi4 arm64: dts: rockchip: fix rtl8211f nodename for rk3328 Beelink A1 arm64: dts: rockchip: fix phy nodename for rk3328 include: dt-bindings: rockchip: remove unused defines arm64: dts: rockchip: replace RK_FUNC defines in rk3326-odroid-go2 arm64: dts: rockchip: Define the rockchip Video Decoder node on rk3399 arm64: dts: rockchip: remove #sound-dai-cells from &spdif node of rk3399-hugsun-x99.dts arm64: dts: rockchip: remove #sound-dai-cells from &i2s1 node of rk3399-pinebook-pro.dts arm64: dts: rockchip: add Odroid Advance Go dt-bindings: Add binding for Hardkernel Odroid Go Advance arm64: dts: rockchip: add core devicetree for rk3326 ... Link: https://lore.kernel.org/r/1970481.V9vR1fIhX2@phil Signed-off-by: Arnd Bergmann commit 87b990ab62722a8a3cb0691107971ab1bd7bddb5 Merge: 65ad1cafe71c c2671acbbbd8 Author: Arnd Bergmann Date: Thu May 21 23:10:17 2020 +0200 Merge tag 'mvebu-dt64-5.8-1' of git://git.infradead.org/linux-mvebu into arm/dt mvebu dt64 for 5.8 (part 1) Armada 3720 based SoC: + Fix PCIe support allowing to use Compex wifi cards + Turris MOX board: - fix SFP binding - forbid SDR104 on SDIO to pass electromagnetic interference certifications + uDPU board: add i2c recovery support Armada 8040 based SoC: SolidRun 8040: update phy interface * tag 'mvebu-dt64-5.8-1' of git://git.infradead.org/linux-mvebu: arm64: dts: armada-3720-turris-mox: fix SFP binding arm64: dts: armada-3720-turris-mox: forbid SDR104 on SDIO for FCC purposes arm64: dts: add uDPU i2c bus recovery arm64: dts: marvell: drop i2c timeout-ms property arm64: dts: marvell: armada-37xx: Move PCIe max-link-speed property arm64: dts: marvell: armada-37xx: Move PCIe comphy handle property arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function arm64: dts: update SolidRun Armada 8040 phy interface types Link: https://lore.kernel.org/r/878shmeffd.fsf@FE-laptop Signed-off-by: Arnd Bergmann commit 65ad1cafe71c9bb4614b61e24c81fc667d72a8b3 Merge: 564ef853419c 1383d42cffa6 Author: Arnd Bergmann Date: Thu May 21 23:09:18 2020 +0200 Merge tag 'mvebu-dt-5.8-1' of git://git.infradead.org/linux-mvebu into arm/dt mvebu dt for 5.8 (part 1) Add LCP panel support on ReadyNAS NV+v2 Add new board: Check Point L-50, kirkwood based SoC router Remove unused property 'timeout-ms' in i2c nodes * tag 'mvebu-dt-5.8-1' of git://git.infradead.org/linux-mvebu: ARM: dts: kirkwood: ReadyNAS NV+v2: Add LCD panel ARM: dts: kirkwood: Add Check Point L-50 board ARM: dts: marvell: drop i2c timeout-ms property Link: https://lore.kernel.org/r/87blmiefgw.fsf@FE-laptop Signed-off-by: Arnd Bergmann commit 564ef853419cbad6ffd03110bd8a3b94be896f93 Merge: 430640a659e0 94cc3f1baaba Author: Arnd Bergmann Date: Thu May 21 23:07:21 2020 +0200 Merge tag 'juno-updates-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/dt ARMv8 Juno/Vexpress/Fast Models updates for v5.8 Various miscellaneous device tree source fixes to make them fully binding compliant. It includes fixing various device node names, order of interrupt properties, compatible names, address and size cell fields and their aligment with children nodes as well as moving some fixed devices out of bus node. * tag 'juno-updates-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm64: dts: juno: Fix SCPI shared mem node name arm64: dts: vexpress: Fix VExpress LED names arm64: dts: juno: Fix GPU interrupt order arm64: dts: fvp/juno: Fix bus node names arm64: dts: fvp: Fix SMMU DT node arm64: dts: fvp/juno: Fix serial node names arm64: dts: juno: Use proper DT node name for USB arm64: dts: fvp: Fix ITS node names and #msi-cells arm64: dts: fvp: Fix GIC child nodes arm64: dts: juno: Fix GIC child nodes arm64: dts: fvp: Fix GIC compatible names arm64: dts: juno: Fix mem-timer arm64: dts: juno: Move fixed devices out of bus node arm64: dts: fvp: Move fixed clocks out of bus node arm64: dts: vexpress: Move fixed devices out of bus node arm64: dts: fvp: Move fixed devices out of bus node arm64: dts: fvp/juno: Fix node address fields Link: https://lore.kernel.org/r/20200519094702.GA32975@bogus Signed-off-by: Arnd Bergmann commit bd35c77e32e4359580207891c0f7a438ad4b42df Author: Krzysztof Piecuch Date: Thu Jan 23 16:09:26 2020 +0000 x86/tsc: Add tsc_early_khz command line parameter Changing base clock frequency directly impacts TSC Hz but not CPUID.16h value. An overclocked CPU supporting CPUID.16h and with partial CPUID.15h support will set TSC KHZ according to "best guess" given by CPUID.16h relying on tsc_refine_calibration_work to give better numbers later. tsc_refine_calibration_work will refuse to do its work when the outcome is off the early TSC KHZ value by more than 1% which is certain to happen on an overclocked system. Fix this by adding a tsc_early_khz command line parameter that makes the kernel skip early TSC calibration and use the given value instead. This allows the user to provide the expected TSC frequency that is closer to reality than the one reported by the hardware, enabling tsc_refine_calibration_work to do meaningful error checking. [ tglx: Made the variable __initdata as it's only used on init and removed the error checking in the argument parser because kstrto*() only stores to the variable if the string is valid ] Signed-off-by: Krzysztof Piecuch Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/O2CpIOrqLZHgNRkfjRpz_LGqnc1ix_seNIiOCvHY4RHoulOVRo6kMXKuLOfBVTi0SMMevg6Go1uZ_cL9fLYtYdTRNH78ChaFaZyG3VAyYz8=@protonmail.com commit 430640a659e05f55412a28a353fccb5ededfee13 Merge: 1cb00f8c3b36 cd13c72c1853 Author: Arnd Bergmann Date: Thu May 21 23:06:20 2020 +0200 Merge tag 'qcom-dts-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM dts updates for v5.8 This adds SCM firmware node for IPQ806x and fixes the high resolution timer for IPQ4019. Samsung Galaxy S5 gains regulators, eMMC and USB support. * tag 'qcom-dts-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: dts: qcom: msm8974-klte: Add max77826 pmic node ARM: dts: qcom: msm8974-klte: Add USB node ARM: dts: qcom: msm8974-klte: Add sdhci1 node ARM: dts: qcom: msm8974-klte: Add gpio-keys nodes ARM: dts: qcom: msm8974-klte: Remove inherited vreg_boost node ARM: dts: qcom: msm8974-klte: Add pma8084 regulator nodes ARM: dts: qcom: ipq4019: fix high resolution timer ARM: dts: qcom: add scm definition to ipq806x Link: https://lore.kernel.org/r/20200519052538.1250076-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 11fdcf05032812bd23cdc42850d1f650376ec09d Author: Krzysztof Wilczynski Date: Wed May 20 18:34:11 2020 +0000 pcmcia: Use CardBus window names (PCI_CB_BRIDGE_IO_0_WINDOW etc) when freeing Remove the loop used to free CardBus resources and replace it with a yenta_free_res() helper used to release bridge resources explicitly. Link: https://lore.kernel.org/r/20200520183411.1534621-3-kw@linux.com Signed-off-by: Krzysztof Wilczynski Signed-off-by: Bjorn Helgaas Acked-by: Dominik Brodowski commit 6e0688dbff625f1e49e3ddb028720ae9fd606f0b Author: Krzysztof Wilczynski Date: Wed May 20 18:34:10 2020 +0000 PCI: Use bridge window names (PCI_BRIDGE_IO_WINDOW etc) Use bridge resource definitions instead of using the PCI_BRIDGE_RESOURCES constant with an integer offeset. Link: https://lore.kernel.org/r/20200520183411.1534621-2-kw@linux.com Signed-off-by: Krzysztof Wilczynski Signed-off-by: Bjorn Helgaas commit 7b38fd9760f51cc83d80eed2cfbde8b5ead9e93a Author: Bjorn Helgaas Date: Thu May 21 15:40:07 2020 -0500 PCI/PTM: Inherit Switch Downstream Port PTM settings from Upstream Port Except for Endpoints, we enable PTM at enumeration-time. Previously we did not account for the fact that Switch Downstream Ports are not permitted to have a PTM capability; their PTM behavior is controlled by the Upstream Port (PCIe r5.0, sec 7.9.16). Since Downstream Ports don't have a PTM capability, we did not mark them as "ptm_enabled", which meant that pci_enable_ptm() on an Endpoint failed because there was no PTM path to it. Mark Downstream Ports as "ptm_enabled" if their Upstream Port has PTM enabled. Fixes: eec097d43100 ("PCI: Add pci_enable_ptm() for drivers to enable PTM on endpoints") Reported-by: Aditya Paluri Signed-off-by: Bjorn Helgaas commit 1cb00f8c3b36e6ae026fb58d1cd2ccd78b81aa9f Merge: a9418e891170 7d2f29e49477 Author: Arnd Bergmann Date: Thu May 21 22:50:40 2020 +0200 Merge tag 'qcom-arm64-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM64 DT updates for v5.8 For SDM845 this defines the IPA network accelerator and the CCI camera control bus, it defines the required UFS reset and adds WiFi for the Lenovo Yoga C630 and defines GPIO pin names and adds OV8856 and OC7251 camera nodes for DB845c. For SC7180 it adds GPU support, defines the modem remoteproc, adds the IPA network accelerator, Coresight and ETM support, adds cpuidle low power states and updates the CPUs' compatible. For SM8250 it adds regulators from the PM8150, PM8150L and PM8009 and adds voltage corners, it defines the nodes for UFS PHY and controller and finally corrects a typo in the PDC node to make SPMI functional. For MSM8916 I2C1 and I2C5 are defined, a node for the CCI camera control interface bus is added and Coresight is disabled by default to match some product configurations. The Samsung A3U gained display support and Samsung A5U gained touchscreen support. MSM8996 now property describes the power supply chain for the GPU, the CCI camera control interface bus is added and the DB820c has the regulators of the secondary PMIC defined. For QCS404 USB PHYs and controllers are defined and wired up for the EVB. SDM630/SDM660 platform support is added and the Xiaomi Redmi Note 7 defined. It also contains a number of changes throughout to improve DT binding compliance. * tag 'qcom-arm64-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (68 commits) arm64: dts: qcom: sc7180: Correct the pdc interrupt ranges arm64: dts: qcom: sc7180: add IPA information arm64: dts: qcom: sc7180: Fix ETMv4 power management patch arm64: dts: qcom: sc7180: Add A618 gpu dt blob dt-bindings: arm-smmu: Add sc7180 compatible string arm64: dts: qcom: msm8996: Make GPU node control GPU_GX GDSC arm64: dts: qcom: db820c: Add vdd_gfx and tie it into mmcc arm64: dts: qcom: apq8016-sbc: merge -pins.dtsi into main .dtsi arm64: dts: qcom: msm8916: move gpu opp table to gpu node arm64: dts: qcom: msm8916: avoid using _ in node names arm64: dts: qcom: c630: Specify UFS device reset arm64: dts: qcom: c630: Add WiFi node arm64: dts: qcom: msm8916-samsung-a3u: add nodes for display panel arm64: dts: qcom: db820c: Fix invalid pm8994 supplies arm64: dts: qcom: db820c: Add pmi8994 RPM regulators arm64: dts: qcom: msm8916: Disable coresight by default arm64: dts: qcom: sc7180: Add "no-map" to cmd_db reserved area arm64: dts: qcom: msm8916-samsung-a5u: Add touchscreen arm64: dts: qcom: msm8916-samsung-a2015: Add touchscreen regulator arm64: dts: qcom: msm8916: Add blsp_i2c5 ... Link: https://lore.kernel.org/r/20200519052528.1249950-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit a9418e8911704ca7e3093c65e54c22625ded571d Merge: c8128b5c07a5 88d801aec6e9 Author: Arnd Bergmann Date: Thu May 21 22:49:06 2020 +0200 Merge tag 'at91-5.8-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 DT for 5.8 - New board: Microchip SAMA5D2 Industrial Connectivity Platform - All SoCs are now converted to the new PMC device tree binding - sama5d2 flexcom nodes are now fully described in sama5d2.dtsi * tag 'at91-5.8-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: (35 commits) ARM: dts: at91: sama5d2_xplained: Add aliases for the dedicated I2C IPs ARM: dts: at91: Configure I2C SCL gpio as open drain ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases ARM: dts: at91: sama5d2_xplained: Add alias for DBGU ARM: dts: at91: sama5d2: Add missing flexcom definitions ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions ARM: dts: at91: sama5d27_wlsom1: Add alias for i2c0 ARM: dts: at91: sama5d2-icp: add SAMA5D2-ICP ... Link: https://lore.kernel.org/r/20200518212844.GA26356@piout.net Signed-off-by: Arnd Bergmann commit c8128b5c07a5420cd35a60af0ed0e818ef166007 Merge: 184a28331177 7d5620d31ecc Author: Arnd Bergmann Date: Thu May 21 22:48:15 2020 +0200 Merge tag 'uniphier-dt64-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into arm/dt UniPhier ARM64 SoC DT updates for v5.8 - add DMA controller nodes - add Akebi96 board support * tag 'uniphier-dt64-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier: arm64: dts: uniphier: Add support for Akebi96 dt-bindings: arm: Add Akebi96 board support arm64: dts: uniphier: add #address-cells and #size-cells to SPI nodes arm64: dts: uniphier: Stabilize Ethernet RGMII mode of PXs3 ref board arm64: dts: uniphier: Add ethernet aliases arm64: dts: uniphier: Add XDMAC node Link: https://lore.kernel.org/r/CAK7LNARUL52pBhg8AD9XeScVqhD8qr2eVEfu4+1v8D+KPyOwNw@mail.gmail.com Signed-off-by: Arnd Bergmann commit 184a28331177c2ed2c8ec994e0803bded967939b Merge: 622a380d621f 137a1cecb89a Author: Arnd Bergmann Date: Thu May 21 22:47:19 2020 +0200 Merge tag 'uniphier-dt-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into arm/dt UniPhier ARM SoC DT updates for v5.8 - add DMA controller nodes * tag 'uniphier-dt-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier: ARM: dts: uniphier: add #address-cells and #size-cells to SPI nodes ARM: dts: uniphier: Add ethernet aliases ARM: dts: uniphier: Add XDMAC node Link: https://lore.kernel.org/r/CAK7LNAQXSpg4s0e0d-tp9j85Sj01t13zAa5+rqsOWu4ZvkpYhg@mail.gmail.com Signed-off-by: Arnd Bergmann commit 622a380d621fa79c962cac6ac1a0518ca5a07a1c Merge: 409b62942019 f0e5405b9ebf Author: Arnd Bergmann Date: Thu May 21 22:41:59 2020 +0200 Merge tag 'v5.7-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt MT2712: - replace deprecated compatible for the usb PHY MT6797: - switch to SPDX identifier - add and enable I2C device for x20 development board - add I2C compatible to the binding description MT7622: - add Wi-Fi device and enable it for the Bananpi-R64 MT8173: - add CPU capacities based on Dhryston benchmark - fix DT build warnings - set throtteling range to limitless - add Elm and Hana devices on which several chromebooks are based - add Global Command Queue entries to the users MT8183: - split cpuidle states in two as the clusters have different target residencies * tag 'v5.7-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm64: dts: mt8173: Add capacity-dmips-mhz attributes arm64: dts: mt2712: use non-empty ranges for usb-phy arm64: dts: mt8173: fix mdp aliases property name arm64: dts: mediatek: Switch to SPDX license identifier for MT6797 SoC arm64: dts: mediatek: Enable I2C support for 96Boards X20 Development board arm64: dts: mediatek: Add I2C support for MT6797 SoC dt-bindings: i2c: Document I2C controller binding for MT6797 SoC arm64: dts: mt8173: fix cooling device range arm64: dts: mediatek: add mt8173 elm and hana board arm64: dts: mt8173: fix unit name warnings arm64: dts: mt8173: add uart aliases dt-bindings: arm64: dts: mediatek: Add mt8173 elm and hana arm64: dts: mt8183: adjust cpuidle target residency arm64: dts: mt8173: Add gce setting in mmsys and display node arm64: dts: mt7622: add built-in Wi-Fi device nodes Link: https://lore.kernel.org/r/2794a8db-c14f-ac34-9e28-9f3700db6c4c@gmail.com Signed-off-by: Arnd Bergmann commit 409b62942019333a1a435cc9e6a9f20282e38459 Merge: 25880899bf9d 4908471e1ed7 Author: Arnd Bergmann Date: Thu May 21 22:41:15 2020 +0200 Merge tag 'ux500-dts-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into arm/dt Ux500 DTS updates for the v5.8 kernel series: - Add proximity sensor and magnetometer to the Samsung Golden devicetree. - Add magnetometer and touchscreen to the Samsung Skomer devicetree. * tag 'ux500-dts-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: ARM: dts: ux500: Add touchscreen to the Skomer ARM: dts: ux500: samsung-skomer: Add magnetometer ARM: dts: ux500: samsung-golden: Add magnetometer ARM: dts: ux500: samsung-golden: Add proximity sensor Link: https://lore.kernel.org/r/CACRpkdbukO33SxAZ_yn-1N8=hq3hF5OBOtP_V0fbjRT-fAa87A@mail.gmail.com Signed-off-by: Arnd Bergmann commit 25880899bf9d7aad55647933bc2182cba79c93e6 Merge: e9f981c79432 189881af810d Author: Arnd Bergmann Date: Thu May 21 22:40:27 2020 +0200 Merge tag 'v5.7-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt MT2701: - add MUSB device to the SoC and the EVB MT7623: - add Mali-450 device node and bindings - add phy to gmac2 * tag 'v5.7-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: dts: mt2701: Add usb2 device nodes dt-bindings: gpu: mali-utgard: add mediatek, mt7623-mali compatible arm: dts: mt7623: add Mali-450 device node arm: dts: mt7623: add phy-mode property for gmac2 Link: https://lore.kernel.org/r/ec17cf62-5463-9537-6618-2db9b2b5036e@gmail.com Signed-off-by: Arnd Bergmann commit e9f981c7943207f56c7f7ab8d05a05044d3fa25e Merge: 0e909f186104 29aed3ef6d49 Author: Arnd Bergmann Date: Thu May 21 22:39:46 2020 +0200 Merge tag 'socfpga_dts_update_for_v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/dt SoCFPGA DTS updates for v5.8 - Leave the FPGA bridges disabled in base dtsi - Add fpga2hps and fpga2sdram bridges on base Cyclone5/Arria5 dtsi * tag 'socfpga_dts_update_for_v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: ARM: dts: socfpga: Add fpga2hps and fpga2sdram bridges ARM: dts: socfgpa: set bridges status to disabled Link: https://lore.kernel.org/r/20200515193029.11318-2-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 0e909f1861043c6570ddd0b6a34160ddeb4eb050 Merge: 9c1acf5174bd b3a0a2f910c7 Author: Arnd Bergmann Date: Thu May 21 22:35:34 2020 +0200 Merge tag 'sunxi-dt-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/dt Our usual number of patches to improve the Allwinner Device Tree support, including: - Support for the IOMMU on the H6 - Support for cpufreq / thermal throttling on the H6 - Support for the mailbox on the A64, A83t, H3, H5 and H6 - New boards: A20-OLinuXino-LIME-eMMC * tag 'sunxi-dt-for-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (23 commits) arm64: dts: allwinner: h6: Add IOMMU arm64: dts: allwinner: h6: Enable CPU opp tables for Tanix TX6 arm64: dts: allwinner: h6: add voltage range to OPP table arm64: dts: allwinner: sun50i-a64: Add missing address/size-cells arm64: dts: allwinner: h6: Enable CPU opp tables for Pine H64 arm64: dts: allwinner: Sort Pine H64 device-tree nodes arm64: dts: allwinner: h6: Enable CPU opp tables for Orange Pi 3 arm64: dts: allwinner: h6: Enable CPU opp tables for Beelink GS1 arm64: dts: allwinner: h6: Add CPU Operating Performance Points table arm64: dts: allwinner: h6: Add thermal trip points/cooling map arm64: dts: allwinner: h6: Add clock to CPU cores arm64: allwinner: h6: orangepi-lite2: Support BT+WIFI combo module arm64: dts: allwinner: h6: orangepi: Disable OTG mode arm64: dts: allwinner: h6: orangepi: Add gpio power supply ARM: dts: sun8i-h2-plus-bananapi-m2-zero: Fix led polarity arm64: dts: allwinner: h6: Add msgbox node arm64: dts: allwinner: a64: Add msgbox node ARM: dts: sunxi: h3/h5: Add msgbox node ARM: dts: sunxi: a83t: Add msgbox node ARM: dts: sun8i-h3: add opp table for mali gpu ... Link: https://lore.kernel.org/r/cfa66bd9-f74c-4614-9ea5-9ef8546cc571.lettre@localhost Signed-off-by: Arnd Bergmann commit 9c1acf5174bd094cb6c1d51298ffce0e0f061ffd Merge: 22c328b1bc18 94ea9681a9f5 Author: Arnd Bergmann Date: Thu May 21 22:34:59 2020 +0200 Merge tag 'tegra-for-5.8-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt ARM: tegra: Device tree changes for v5.8-rc1 This contains a bit of cleanup and CPU frequency scaling support for the Tegra30 Beaver board. * tag 'tegra-for-5.8-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: dts: tegra30: beaver: Add CPU Operating Performance Points ARM: dts: tegra30: beaver: Set up voltage regulators for DVFS ARM: tegra: Kill off "simple-panel" compatibles Link: https://lore.kernel.org/r/20200515145311.1580134-11-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 22c328b1bc182426d7c5345824a50f4388ee132a Merge: a2a3e46cfb11 4e79691d050e Author: Arnd Bergmann Date: Thu May 21 22:30:18 2020 +0200 Merge tag 'tegra-for-5.8-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt dt-bindings: Changes for v5.8-rc1 This adds bindings for the CSI TPG clock on Tegra210, moves various clocks from the clock and reset controller to the PMC where their controls really are, adds bindings for the external memory controller and video capture controller on Tegra210, as well as CPU frequency scaling on Tegra20 and Tegra30. * tag 'tegra-for-5.8-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: i2c: tegra: Document Tegra210 VI I2C dt-bindings: tegra: Add VI and CSI bindings dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30 dt-bindings: memory: tegra: Add external memory controller binding for Tegra210 dt-bindings: clock: tegra: Remove PMC clock IDs dt-bindings: clock: tegra: Add clock ID for CSI TPG clock Link: https://lore.kernel.org/r/20200515145311.1580134-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit cfbd83d02da73d984bee314ed3b96bdd3bbe7115 Author: Krzysztof Wilczynski Date: Thu May 21 19:04:57 2020 +0000 PCI: shpchp: Make shpchp_unconfigure_device() void shpchp_unconfigure_device() always returned 0, so there's no reason for a return value. In addition, remove_board() checked the return value for possible error which is unnecessary. Convert shpchp_unconfigure_device() to a void function and remove the return value check. This addresses the following Coccinelle warning: drivers/pci/hotplug/shpchp_pci.c:66:5-7: Unneeded variable: "rc". Return "0" on line 86 Link: https://lore.kernel.org/r/20200521190457.1066600-1-kw@linux.com Signed-off-by: Krzysztof Wilczynski Signed-off-by: Bjorn Helgaas commit b8af85492fbf1acfb63b1f83e4faafbaa11c73eb Author: Krzysztof Wilczynski Date: Thu May 21 20:04:39 2020 +0000 PCI/switchtec: Correct bool variable type assignment Use "true" instead of 1 to initialize "bool use_dma_mrpc". This resolves the following Coccinelle warning: drivers/pci/switch/switchtec.c:28:12-24: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200521200439.1076672-1-kw@linux.com Signed-off-by: Krzysztof Wilczynski Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit eafd47fc200ee759c0e8d205b9cc7342bd0f4199 Merge: 0ad45e5fdc52 b9bbe6ed63b2 Author: Jason Gunthorpe Date: Thu May 21 17:07:21 2020 -0300 Merge tag 'v5.7-rc6' into rdma.git for-next Linux 5.7-rc6 Conflict in drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c resolved by deleting dr_cq_event, matching how netdev resolved it. Required for dependencies in the following patches. Signed-off-by: Jason Gunthorpe commit 5dda3ba6fc9c5d784b48687a3f3003023a0d7c74 Author: Jay Fang Date: Sat May 16 15:00:14 2020 +0800 PCI/PME: Fix kernel-doc of pcie_pme_resume() and pcie_pme_remove() Fix kernel-doc of the "srv" parameter to pcie_pme_resume() and pcie_pme_remove(). Building with W=1 produced these warnings: drivers/pci/pcie/pme.c:414: warning: Function parameter or member 'srv' not described in 'pcie_pme_resume' drivers/pci/pcie/pme.c:437: warning: Function parameter or member 'srv' not described in 'pcie_pme_remove' Link: https://lore.kernel.org/r/1589612414-61682-1-git-send-email-f.fangjian@huawei.com Signed-off-by: Jay Fang Signed-off-by: Bjorn Helgaas commit 1ecca8a9a4989b693f2f6d349bf54c0fdfc10e8e Author: Alexandru Ardelean Date: Mon May 18 16:38:13 2020 +0300 iio: proximity: ping: pass reference to IIO device as param to ping_read() Since there will be some changes to how iio_priv_to_dev() is implemented, it could be that the helper becomes a bit slower, as it will be hidden away in the IIO core. But even without that rework, this looks like it can pass the 'indio_dev' object to ping_read() and obtain the state struct via iio_priv() which is a preferred practice than going back-n-forth (getting the state-struct, then using iio_priv_to_dev() to get the indio_dev object back). Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 33c53cbf8f7bc8d62f6146a19da97c8594376ff0 Author: Sergiu Cuciurean Date: Wed May 20 15:02:01 2020 +0300 iio: dac: ad5592r-base: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This also removes unused iio_dev pointers. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit ac101e6b315bfeb5a4f43a962f589e567855c177 Author: Ivan Mikhaylov Date: Sun May 10 21:45:37 2020 +0300 iio: proximity: Add driver support for vcnl3020 proximity sensor Proximity sensor driver based on light/vcnl4000.c code. For now supports only the single on-demand measurement. The VCNL3020 is a fully integrated proximity sensor. Fully integrated means that the infrared emitter is included in the package. It has 16-bit resolution. It includes a signal processing IC and features standard I2C communication interface. It features an interrupt function. Datasheet: http://www.vishay.com/docs/84150/vcnl3020.pdf Signed-off-by: Ivan Mikhaylov Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 9ecd11812e384c21e12dad05972ac9332fceece0 Author: Ivan Mikhaylov Date: Sun May 10 21:45:36 2020 +0300 dt-bindings: proximity: provide vcnl3020 device tree binding document Mostly standard i2c driver with some additional led-current option for vcnl3020. Signed-off-by: Ivan Mikhaylov Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 5333875301d64e96d1400592a500f56ac7a33f27 Author: YueHaibing Date: Fri Apr 10 19:56:20 2020 +0800 xen/pvcalls: Make pvcalls_back_global static Fix sparse warning: drivers/xen/pvcalls-back.c:30:3: warning: symbol 'pvcalls_back_global' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200410115620.33024-1-yuehaibing@huawei.com Reviewed-by: Stefano Stabellini Signed-off-by: Boris Ostrovsky commit c54b071c192dfe8061336f650ceaf358e6386e0b Author: Boris Ostrovsky Date: Fri May 8 18:28:43 2020 -0400 xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests Commit a926f81d2f6c ("xen/cpuhotplug: Replace cpu_up/down() with device_online/offline()") replaced cpu_down() with device_offline() call which requires that the CPU has been registered before. This registration, however, happens later from topology_init() which is called as subsys_initcall(). setup_vcpu_hotplug_event(), on the other hand, is invoked earlier, during arch_initcall(). As result, booting a PV(H) guest with vcpus < maxvcpus causes a crash. Move setup_vcpu_hotplug_event() (and therefore setup_cpu_watcher()) to late_initcall(). In addition, instead of performing all offlining steps in setup_cpu_watcher() simply call disable_hotplug_cpu(). Fixes: a926f81d2f6c (xen/cpuhotplug: Replace cpu_up/down() with device_online/offline()" Signed-off-by: Boris Ostrovsky Link: https://lore.kernel.org/r/1588976923-3667-1-git-send-email-boris.ostrovsky@oracle.com Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit c17db64044e34ae6c2df56cc4837787f9d48edd5 Author: Rikard Falkeborn Date: Sat May 9 15:47:55 2020 +0200 xen-platform: Constify dev_pm_ops dev_pm_ops is never modified, so mark it const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 2457 1668 256 4381 111d drivers/xen/platform-pci.o After: text data bss dec hex filename 2681 1444 256 4381 111d drivers/xen/platform-pci.o Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200509134755.15038-1-rikard.falkeborn@gmail.com Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit c8d70a29d6bbc956013f3401f92a4431a9385a3c Author: Juergen Gross Date: Mon May 11 09:42:31 2020 +0200 xen/pvcalls-back: test for errors when calling backend_connect() backend_connect() can fail, so switch the device to connected only if no error occurred. Fixes: 0a9c75c2c7258f2 ("xen/pvcalls: xenbus state handling") Cc: stable@vger.kernel.org Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20200511074231.19794-1-jgross@suse.com Reviewed-by: Stefano Stabellini Signed-off-by: Boris Ostrovsky commit 62cc895c02fb9d1170f02dc1dfa3c2135ebe100b Author: Dan Carpenter Date: Wed May 20 18:25:56 2020 +0300 drm/amdgpu: off by one in amdgpu_device_attr_create_groups() error handling This loop in the error handling code should start a "i - 1" and end at "i == 0". Currently it starts a "i" and ends at "i == 1". The result is that it removes one attribute that wasn't created yet, and leaks the zeroeth attribute. Fixes: 4e01847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code") Acked-by: Michael J. Ruhl Reviewed-by: Christian König Reviewed-by: Kevin Wang Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 94f2026bd82ed00b86b0423ec40d9e8b95052121 Author: Gustavo A. R. Silva Date: Tue May 19 17:55:45 2020 -0500 drm/amdgpu/smu10: Replace one-element array and use struct_size() helper The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size; memcpy(instance->data, source, size); but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. So, replace the one-element array with a flexible-array member. Also, make use of the new struct_size() helper to properly calculate the size of struct smu10_voltage_dependency_table. This issue was found with the help of Coccinelle and, audited and fixed _manually_. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Acked-by: Christian König Signed-off-by: Gustavo A. R. Silva Signed-off-by: Alex Deucher commit 4cf7c42739ccafca753ed942ed1c96cc445c728b Author: Jinze Xu Date: Thu May 7 15:19:37 2020 +0800 drm/amd/display: Set/Reset avmute when disable/enable stream [Why] When disconnect fe from be, something such as unstable clock may cause garbage occurs. [How] Send set avmute at the beginning of disable stream and send reset avmute at the end of enable stream. Signed-off-by: Jinze Xu Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Acked-by: Tony Cheng Signed-off-by: Alex Deucher commit cbd14ae7ea934fd9d9f95103a0601a7fea243573 Author: Stylon Wang Date: Thu Apr 30 16:40:09 2020 +0800 drm/amd/display: Fix incorrectly pruned modes with deep color [Why] When "max bpc" is set to enable deep color, some modes are removed from the list if they fail validation on max bpc. These modes should be kept if they validates fine with lower bpc. [How] - Retry with lower bpc in mode validation. - Same in atomic commit to apply working bpc, not necessarily max bpc. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit fdcf62fbfb288f4cb050c02c5ab9bc58fc53a872 Author: Dmytro Laktyushkin Date: Mon May 4 15:34:30 2020 -0400 drm/amd/display: correct rn NUM_VMID Save the correct num vmid during resource creation and fix RN gpuvm level from 1 to 16 vmid entries. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b6dbb8ff9dbfdf55ee88e668099d9d7517f109a5 Author: Nicholas Kazlauskas Date: Wed May 6 14:21:35 2020 -0400 drm/amd/display: Avoid pipe split when plane is too small [Why] The minimum plane size we can support in DML is 16x16. If we try to pass a 16x16 plane with dynamic pipe split then validation will fail since it tries to split it into two pipes, each 8x8. Some userspace doesn't check that the commit fails and because the commit fails the old state is retained, resulting in corruption. [How] Add a workaround to avoid pipe split if any plane is 16x16 or smaller. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 63731e73dae413d535fd4cef3d8a77203c13f3f4 Author: Nicholas Kazlauskas Date: Mon May 4 16:49:28 2020 -0400 drm/amd/display: Defer cursor lock until after VUPDATE [Why] We dropped the delay after changed the cursor functions locking the entire pipe to locking just the CURSOR registers to fix page flip stuttering - this introduced cursor stuttering instead, and an underflow issue. The cursor update can be delayed indefinitely if the cursor update repeatedly happens right around VUPDATE. The underflow issue can happen if we do a viewport update on a pipe on the same frame where a cursor update happens around VUPDATE - the old cursor registers are retained which can be in an invalid position. This can cause a pipe hang and indefinite underflow. [How] The complex, ideal solution to the problem would be a software triple buffering mechanism from the DM layer to program only one cursor update per frame just before VUPDATE. The simple workaround until we have that infrastructure in place is this change - bring back the delay until VUPDATE before locking, but with some corrections to the calculations. This didn't work for all timings before because the calculation for VUPDATE was wrong - it was using the offset from VSTARTUP instead and didn't correctly handle the case where VUPDATE could be in the back porch. Add a new hardware sequencer function to use the existing helper to calculate the real VUPDATE start and VUPDATE end - VUPDATE can last multiple lines after all. Change the udelay to incorporate the width of VUPDATE as well. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7d1ee78f033a1b478cfa78eb4e11dd40e060f977 Author: Vladimir Stempen Date: Tue Apr 28 13:04:35 2020 -0400 drm/amd/display: DP training to set properly SCRAMBLING_DISABLE [Why] DP training sequence to set SCRAMBLING_DISABLE bit properly based on training pattern - per DP Spec. [How] Update dpcd_pattern.v1_4.SCRAMBLING_DISABLE with 1 for TPS1, TPS2, TPS3, but not for TPS4. Signed-off-by: Vladimir Stempen Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit c38606ab1250aad05829e0daa8fa9a002161eb2a Author: Rodrigo Siqueira Date: Fri Apr 24 09:53:07 2020 -0400 drm/amd/display: Remove dml_common_def file During the rework for removing the FPU issues, I found the following warning: [..] dml_common_defs.o: warning: objtool: dml_round()+0x9: FPU instruction outside of kernel_fpu_{begin,end}() This file has a single function that does not need to be in a specific file. This commit drop dml_common_defs file, and move dml_round function to dml_inline_defs. CC: Christian König CC: Alexander Deucher CC: Peter Zijlstra CC: Tony Cheng CC: Harry Wentland Signed-off-by: Rodrigo Siqueira Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 570bc18c2966b05f556bedca24245a497db5ed13 Author: Dmytro Laktyushkin Date: Mon Apr 27 14:55:08 2020 -0400 drm/amd/display: fix and simplify pipe split logic Current odm/mpc combine logic to detect which pipes need to split logically is flawed leading to incorrect pipe merge/split operations being taken. This change cleans up the logic and fixes the logical errors. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 14e49bb316789ceea35940b834c89ab54ec7b064 Author: Nikola Cornij Date: Thu Nov 28 14:14:56 2019 -0500 drm/amd/display: Minimize DSC resource re-assignment [why] Assigning a different DSC resource than the one previosly used is currently not handled. This causes black screen on mode change when more than one monitor is connected on some ASICs. [how] - Acquire the previously used DSC if available - Make sure re-program is triggered if new DSC is used Acked-by: Rodrigo Siqueira Signed-off-by: Nikola Cornij Signed-off-by: Alex Deucher commit 0bcfa78c262a5195f0ba6f89c116e03c20e9c1bc Author: Likun Gao Date: Mon May 18 18:19:30 2020 +0800 drm/amdgpu: add condition to set MP1 state on gpu reset Only ras supportted need to set MP1 state to prepare for unload before reloading SMU FW. Signed-off-by: Likun Gao Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 997769fa806b62cbc1eff4b777aee088b5997508 Author: Evan Quan Date: Thu May 21 11:30:28 2020 +0800 drm/amdkfd: report the real PCI bus number Since the PCI bus number retrieved by PCI_BUS_NUM(pdev->devfn) is wrong. Signed-off-by: Evan Quan Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a89b5dae3e68e5a543c5bcbeb04cf9a1dec2e687 Author: Jack Zhang Date: Mon May 18 11:15:52 2020 +0800 drm/amdgpu fix incorrect sysfs remove behavior for xgmi Under xgmi setup,some sysfs fail to create for the second time of kmd driver loading. It's due to sysfs nodes are not removed appropriately in the last unlod time. Changes of this patch: 1. remove sysfs for dev_attr_xgmi_error 2. remove sysfs_link adev->dev->kobj with target name. And it only needs to be removed once for a xgmi setup 3. remove sysfs_link hive->kobj with target name In amdgpu_xgmi_remove_device: 1. amdgpu_xgmi_sysfs_rem_dev_info needs to be run per device 2. amdgpu_xgmi_sysfs_destroy needs to be run on the last node of device. v2: initialize array with memset Signed-off-by: Jack Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 27a468eac53186fea97997e02510a6ff9a53558a Author: Evan Quan Date: Wed May 20 18:13:50 2020 +0800 drm/amd/powerplay: unify the prompts on thermal interrupts The prompts will contain pci address(segment/bus/port/function), severity(warn or error) and some keywords(GPU, amdgpu). Also this address the issue that pci bus retrieved by PCI_BUS_NUM(adev->pdev->devfn) is wrong. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fa63ed81705a1c280e049441f5e05a4c30ce9b11 Author: Mario Kleiner Date: Fri May 15 07:19:24 2020 +0200 drm/amd/display: Enable fp16 also on DCE-11.0 - DCE-12. (v2) Testing on a Polaris11 gpu with DCE-11.2 suggests that it seems to work fine there, so optimistically enable it for DCE-11 and later. v2: drop DCE 11.0 hunk. Carrizo (DCE 11.0) has a HW bug where FP16 scaling doesn't work. The upscale and downscale factors were intended to block those FP16 cases and reject the commit but nobody ever added those to atomic check. Once those are added to atomic check, this can be re-enabled. Signed-off-by: Mario Kleiner Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 2a5195dca0b7058e65443416a20680be985d8753 Author: Mario Kleiner Date: Fri May 15 07:19:23 2020 +0200 drm/amd/display: Expose support for xBGR ordered fp16 formats. Expose support for DRM_FORMAT_ABGR16161616F and DRM_FORMAT_XBGR16161616F to the DRM core, complementing the already existing xRGB ordered fp16 formats. These are especially useful for creating presentable swapchains in Vulkan for VK_FORMAT_R16G16B16A16_SFLOAT. Signed-off-by: Mario Kleiner Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit fdf64b0d821e5ee786893e14cf503cb70f5c1b04 Author: James Zhu Date: Tue May 19 10:25:01 2020 -0400 drm/amdgpu/vcn2.5: Remove old DPG workaround SCRATCH2 is used to keep decode wptr as a workaround which fix a hardware DPG decode wptr update bug for vcn2.5 beforehand. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit ab01cf03f245c6e5ef547b0897d58709662d118d Author: James Zhu Date: Tue May 19 10:11:05 2020 -0400 drm/amdgpu/jpeg2.5: Remove JPEG_ENC_MASK from clock ungating Remove JPEG_ENC_MASK from clock ungating since MJPEG encoder hasn't been support yet. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 30c296e1c19923f6469b7c0f16b6922cf27254ef Author: John Clements Date: Wed May 20 10:28:51 2020 +0800 drm/amdgpu: resolve ras recovery vs smi race condition during ras recovery block smu access via smi Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 8c8e1f6984083cdb6b59134baeefeb10ce5ce070 Author: Aishwarya Ramakrishnan Date: Mon May 18 21:53:12 2020 +0530 drm/amdkfd: Fix boolreturn.cocci warnings Return statements in functions returning bool should use true/false instead of 1/0. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c:40:9-10: WARNING: return of 0/1 in function 'event_interrupt_isr_v9' with return type bool Generated by: scripts/coccinelle/misc/boolreturn.cocci Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: Alex Deucher commit f99d8762501df5ee8095d890400481ccadae7491 Author: Harry Wentland Date: Thu May 7 11:34:08 2020 -0400 drm/amd/display: Respect PP_STUTTER_MODE but don't override DC_DISABLE_STUTTER Signed-off-by: Harry Wentland Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 087a1ff8fbd0164bd4c4d57343c8e51411aa098e Author: Harry Wentland Date: Thu May 7 09:48:06 2020 -0400 drm/amd/display: Fix disable_stutter debug option [Why & How] One call was forcing stutter on instead of looking at the debug option. Ensure we always check the debug option unless we want to force stutter off. Signed-off-by: Harry Wentland Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 8a791dabea181607f27aacb89c5e75a2eaaf0586 Author: Harry Wentland Date: Fri May 1 14:23:37 2020 -0400 drm/amd/display: Add DC Debug mask to disable features for bringup [Why] At bringup we want to be able to disable various power features. [How] These features are already exposed as dc_debug_options and exercised on other OSes. Create a new dc_debug_mask module parameter and expose relevant bits, in particular * DC_DISABLE_PIPE_SPLIT * DC_DISABLE_STUTTER * DC_DISABLE_DSC * DC_DISABLE_CLOCK_GATING Signed-off-by: Harry Wentland Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 9f76f7e87871230698901f8e2b459366f36da49a Author: Kevin Wang Date: Thu May 7 12:39:18 2020 +0800 drm/amdgpu: cleanup unnecessary virt sriov check in amdgpu attribute the amdgpu device attribute node will be created accordding to sriov vf mode at runtime. cleanup unnecessary sriov check in attribute operation function. Signed-off-by: Kevin Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b081320f0693cce0394f7c8bad9fba0b25982186 Author: Kees Cook Date: Wed May 20 02:05:56 2020 -0700 selftests/exec: Add binfmt_script regression test While working on commit b5372fe5dc84 ("exec: load_script: Do not exec truncated interpreter path"), I wrote a series of test scripts to verify corner cases. However, soon after, commit 6eb3c3d0a52d ("exec: increase BINPRM_BUF_SIZE to 256") landed, resulting in the tests needing to be refactored for the larger BINPRM_BUF_SIZE, which got lost on my TODO list. During the recent exec refactoring work[1], the need for these tests resurfaced, so I've finished them up for addition to the kernel selftests. [1] https://lore.kernel.org/lkml/202005191144.E3112135@keescook/ Link: https://lkml.kernel.org/r/202005200204.D07DF079@keescook Signed-off-by: Kees Cook Signed-off-by: Eric W. Biederman commit 9d9488d4d7c85a76e9fd30d7a070ed018f767233 Merge: b127c16d0603 bc2bf338d54b Author: Eric W. Biederman Date: Thu May 21 10:23:52 2020 -0500 exec: Control flow simplifications It is hard to follow the control flow in exec.c as the code has evolved over time and something that used to work one way now works another. This set of changes attempts to address the worst of that, to remove unnecessary work and to make the code a little easier to follow. The churn is a bit higher than the last version of this patchset, with renaming and cleaning up of comments. I have split security_bprm_set_creds into security_bprm_creds_for_exec and security_bprm_repopulate_creds. My goal was to make it clear that one hook completes its work while the other recaculates it's work each time a new interpreter is selected. I have added a new change at the beginning to make it clear that neither security_bprm_creds_for_exec nor security_bprm_repopulate_creds needs to be implemented as prepare_exec_creds properly does the work of setting up credentials unless something special is going on. I have made the execfd support generic and moved out of binfmt_misc so that I can remove the recursion. I have moved reassigning bprm->file into the loop that replaces the recursion. In doing so I discovered that binfmt_misc was naughty and was returning -ENOEXEC in such a way that the search_binary_handler loop could not continue. So I added a change to remove that naughtiness. Eric W. Biederman (8): exec: Teach prepare_exec_creds how exec treats uids & gids exec: Factor security_bprm_creds_for_exec out of security_bprm_set_creds exec: Convert security_bprm_set_creds into security_bprm_repopulate_creds exec: Allow load_misc_binary to call prepare_binfmt unconditionally exec: Move the call of prepare_binprm into search_binary_handler exec/binfmt_script: Don't modify bprm->buf and then return -ENOEXEC exec: Generic execfd support exec: Remove recursion from search_binary_handler arch/alpha/kernel/binfmt_loader.c | 11 +---- fs/binfmt_elf.c | 4 +- fs/binfmt_elf_fdpic.c | 4 +- fs/binfmt_em86.c | 13 +---- fs/binfmt_misc.c | 69 ++++----------------------- fs/binfmt_script.c | 82 ++++++++++++++------------------ fs/exec.c | 97 ++++++++++++++++++++++++++------------ include/linux/binfmts.h | 36 ++++++-------- include/linux/lsm_hook_defs.h | 3 +- include/linux/lsm_hooks.h | 52 +++++++++++--------- include/linux/security.h | 14 ++++-- kernel/cred.c | 3 ++ security/apparmor/domain.c | 7 +-- security/apparmor/include/domain.h | 2 +- security/apparmor/lsm.c | 2 +- security/commoncap.c | 9 ++-- security/security.c | 9 +++- security/selinux/hooks.c | 8 ++-- security/smack/smack_lsm.c | 9 ++-- security/tomoyo/tomoyo.c | 12 ++--- 20 files changed, 202 insertions(+), 244 deletions(-) Link: https://lkml.kernel.org/r/877dx822er.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Signed-off-by: "Eric W. Biederman" commit bc2bf338d54b7aadaed49bb45b9e10d4592b2a46 Author: Eric W. Biederman Date: Mon May 18 18:43:20 2020 -0500 exec: Remove recursion from search_binary_handler Recursion in kernel code is generally a bad idea as it can overflow the kernel stack. Recursion in exec also hides that the code is looping and that the loop changes bprm->file. Instead of recursing in search_binary_handler have the methods that would recurse set bprm->interpreter and return 0. Modify exec_binprm to loop when bprm->interpreter is set. Consolidate all of the reassignments of bprm->file in that loop to make it clear what is going on. The structure of the new loop in exec_binprm is that all errors return immediately, while successful completion (ret == 0 && !bprm->interpreter) just breaks out of the loop and runs what exec_bprm has always run upon successful completion. Fail if the an interpreter is being call after execfd has been set. The code has never properly handled an interpreter being called with execfd being set and with reassignments of bprm->file and the assignment of bprm->executable in generic code it has finally become possible to test and fail when if this problematic condition happens. With the reassignments of bprm->file and the assignment of bprm->executable moved into the generic code add a test to see if bprm->executable is being reassigned. In search_binary_handler remove the test for !bprm->file. With all reassignments of bprm->file moved to exec_binprm bprm->file can never be NULL in search_binary_handler. Link: https://lkml.kernel.org/r/87sgfwyd84.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit b8a61c9e7b4a0fec493d191429e9653d66a79ccc Author: Eric W. Biederman Date: Thu May 14 15:17:40 2020 -0500 exec: Generic execfd support Most of the support for passing the file descriptor of an executable to an interpreter already lives in the generic code and in binfmt_elf. Rework the fields in binfmt_elf that deal with executable file descriptor passing to make executable file descriptor passing a first class concept. Move the fd_install from binfmt_misc into begin_new_exec after the new creds have been installed. This means that accessing the file through /proc//fd/N is able to see the creds for the new executable before allowing access to the new executables files. Performing the install of the executables file descriptor after the point of no return also means that nothing special needs to be done on error. The exiting of the process will close all of it's open files. Move the would_dump from binfmt_misc into begin_new_exec right after would_dump is called on the bprm->file. This makes it obvious this case exists and that no nesting of bprm->file is currently supported. In binfmt_misc the movement of fd_install into generic code means that it's special error exit path is no longer needed. Link: https://lkml.kernel.org/r/87y2poyd91.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit ccbb18b67323b5c70b5f07177381d14cd002621f Author: Eric W. Biederman Date: Mon May 18 10:11:10 2020 -0500 exec/binfmt_script: Don't modify bprm->buf and then return -ENOEXEC The return code -ENOEXEC serves to tell search_binary_handler that it should continue searching for the binfmt to handle a given file. This makes return -ENOEXEC with a bprm->buf that is needed to continue the search problematic. The current binfmt_script manages to escape problems as it closes and clears bprm->file before return -ENOEXEC with bprm->buf modified. This prevents search_binary_handler from looping as it explicitly handles a NULL bprm->file. I plan on moving all of the bprm->file managment into fs/exec.c and out of the binary handlers so this will become a problem. Move closing bprm->file and the test for BINPRM_PATH_INACCESSIBLE down below the last return of -ENOEXEC. Introduce i_sep and i_end to track the end of the first argument and the end of the parameters respectively. Using those, constification of all char * pointers, and the helpers next_terminator and next_non_spacetab guarantee the parameter parsing will not modify bprm->buf. Only modify bprm->buf to terminate the strings i_arg and i_name with '\0' for passing to copy_strings_kernel. When replacing loops with next_non_spacetab and next_terminator care has been take that the logic of the parsing code (short of replacing characters by '\0') remains the same. Link: https://lkml.kernel.org/r/874ksczru6.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit 8b72ca9004ed35104deb80b07990da5503bc5252 Author: Eric W. Biederman Date: Wed May 13 22:25:20 2020 -0500 exec: Move the call of prepare_binprm into search_binary_handler The code in prepare_binary_handler needs to be run every time search_binary_handler is called so move the call into search_binary_handler itself to make the code simpler and easier to understand. Link: https://lkml.kernel.org/r/87d070zrvx.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Reviewed-by: James Morris Signed-off-by: "Eric W. Biederman" commit a16b3357b2b8e910bb614254d8a7e84d2bd59b4c Author: Eric W. Biederman Date: Sat May 16 06:02:54 2020 -0500 exec: Allow load_misc_binary to call prepare_binprm unconditionally Add a flag preserve_creds that binfmt_misc can set to prevent credentials from being updated. This allows binfmt_misc to always call prepare_binprm. Allowing the credential computation logic to be consolidated. Not replacing the credentials with the interpreters credentials is safe because because an open file descriptor to the executable is passed to the interpreter. As the interpreter does not need to reopen the executable it is guaranteed to see the same file that exec sees. Ref: c407c033de84 ("[PATCH] binfmt_misc: improve calculation of interpreter's credentials") Link: https://lkml.kernel.org/r/87imgszrwo.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit 112b7147592e8f46bd1da4f961773e6d974f38a8 Author: Eric W. Biederman Date: Thu May 14 12:53:44 2020 -0500 exec: Convert security_bprm_set_creds into security_bprm_repopulate_creds Rename bprm->cap_elevated to bprm->active_secureexec and initialize it in prepare_binprm instead of in cap_bprm_set_creds. Initializing bprm->active_secureexec in prepare_binprm allows multiple implementations of security_bprm_repopulate_creds to play nicely with each other. Rename security_bprm_set_creds to security_bprm_reopulate_creds to emphasize that this path recomputes part of bprm->cred. This recomputation avoids the time of check vs time of use problems that are inherent in unix #! interpreters. In short two renames and a move in the location of initializing bprm->active_secureexec. Link: https://lkml.kernel.org/r/87o8qkzrxp.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit 6670ee2ef219ac9e1c836a277dda0c949ad8b1ff Merge: 746c6237ece6 f2453978a4f2 Author: J. Bruce Fields Date: Thu May 21 10:58:15 2020 -0400 Merge branch 'nfsd-5.8' of git://linux-nfs.org/~cel/cel-2.6 into for-5.8-incoming Highlights of this series: * Remove serialization of sending RPC/RDMA Replies * Convert the TCP socket send path to use xdr_buf::bvecs (pre-requisite for RPC-on-TLS) * Fix svcrdma backchannel sendto return code * Convert a number of dprintk call sites to use tracepoints * Fix the "suggest braces around empty body in an 'else' statement" warning commit 858b8a8039d001d0bae23ceb7227b322b451fb07 Author: Anshuman Khandual Date: Tue May 19 15:10:54 2020 +0530 arm64/cpuinfo: Add ID_MMFR4_EL1 into the cpuinfo_arm64 context ID_MMFR4_EL1 has been missing in the CPU context (i.e cpuinfo_arm64). This just adds the register along with other required changes. Cc: Catalin Marinas Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Will Deacon Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-18-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 14e270fa5c4cde8f6cc0240a2ab007b58a367f16 Author: Anshuman Khandual Date: Tue May 19 15:10:48 2020 +0530 arm64/cpufeature: Add remaining feature bits in ID_AA64PFR1 register Enable the following features bits in ID_AA64PFR1 register as per ARM DDI 0487F.a specification. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Will Deacon Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-12-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 011e5f5bf529f8ec2988ef7667d1a52f83273c36 Author: Anshuman Khandual Date: Tue May 19 15:10:47 2020 +0530 arm64/cpufeature: Add remaining feature bits in ID_AA64PFR0 register Enable MPAM and SEL2 features bits in ID_AA64PFR0 register as per ARM DDI 0487F.a specification. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Will Deacon Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1589881254-10082-11-git-send-email-anshuman.khandual@arm.com [will: Make SEL2 a NONSTRICT feature per Suzuki] Signed-off-by: Will Deacon commit 7cd51a5a84d115cd49c43e90b083ca60873874e5 Author: Anshuman Khandual Date: Tue May 19 15:10:46 2020 +0530 arm64/cpufeature: Add remaining feature bits in ID_AA64ISAR0 register Enable TLB features bit in ID_AA64ISAR0 register as per ARM DDI 0487F.a specification. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Will Deacon Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-10-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit fcd6535322cccf21830031f389c302346f767c47 Author: Anshuman Khandual Date: Tue May 19 15:10:45 2020 +0530 arm64/cpufeature: Add remaining feature bits in ID_MMFR4 register Enable all remaining feature bits like EVT, CCIDX, LSM, HPDS, CnP, XNX, SpecSEI in ID_MMFR4 register per ARM DDI 0487F.a. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Mark Rutland Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-9-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 0ae43a99fe91399d9e5b2d0756e16e97b21cc187 Author: Anshuman Khandual Date: Tue May 19 15:10:44 2020 +0530 arm64/cpufeature: Add remaining feature bits in ID_PFR0 register Enable DIT and CSV2 feature bits in ID_PFR0 register as per ARM DDI 0487F.a specification. Except RAS and AMU, all other feature bits are now enabled. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Mark Rutland Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-8-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 152accf8476f0447de57d9ffaf0c5ab578ed3d40 Author: Anshuman Khandual Date: Tue May 19 15:10:43 2020 +0530 arm64/cpufeature: Introduce ID_MMFR5 CPU register This adds basic building blocks required for ID_MMFR5 CPU register which provides information about the implemented memory model and memory management support in AArch32 state. This is added per ARM DDI 0487F.a specification. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Will Deacon Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-7-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit dd35ec07045753adcc86f89d485e589d860e298f Author: Anshuman Khandual Date: Tue May 19 15:10:42 2020 +0530 arm64/cpufeature: Introduce ID_DFR1 CPU register This adds basic building blocks required for ID_DFR1 CPU register which provides top level information about the debug system in AArch32 state. We hide the register from KVM guests, as we don't emulate the 'MTPMU' feature. This is added per ARM DDI 0487F.a specification. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Will Deacon Reviewed-by : Suzuki K Poulose Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1589881254-10082-6-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 16824085a7dd426408d4403284374da90671e749 Author: Anshuman Khandual Date: Tue May 19 15:10:41 2020 +0530 arm64/cpufeature: Introduce ID_PFR2 CPU register This adds basic building blocks required for ID_PFR2 CPU register which provides information about the AArch32 programmers model which must be interpreted along with ID_PFR0 and ID_PFR1 CPU registers. This is added per ARM DDI 0487F.a specification. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Mark Rutland Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-5-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit e965bcb0625626c691677e9283cee354c5b2433a Author: Anshuman Khandual Date: Tue May 19 15:10:40 2020 +0530 arm64/cpufeature: Make doublelock a signed feature in ID_AA64DFR0 Double lock feature can have the following possible values. 0b0000 - Double lock implemented 0b1111 - Double lock not implemented But in case of a conflict the safe value should be 0b1111. Hence this must be a signed feature instead. Also change FTR_EXACT to FTR_LOWER_SAFE. While here, fix the erroneous bit width value from 28 to 4. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-4-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 1ed1b90a0594c8c9d31e8bb8be25a2b37717dc9e Author: Anshuman Khandual Date: Tue May 19 15:10:39 2020 +0530 arm64/cpufeature: Drop TraceFilt feature exposure from ID_DFR0 register ID_DFR0 based TraceFilt feature should not be exposed to guests. Hence lets drop it. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Mark Rutland Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-3-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 2a5bc6c47bc3b1bcdab5bef7e74fbb74d17dc618 Author: Anshuman Khandual Date: Tue May 19 15:10:38 2020 +0530 arm64/cpufeature: Add explicit ftr_id_isar0[] for ID_ISAR0 register ID_ISAR0[31..28] bits are RES0 in ARMv8, Reserved/UNK in ARMv7. Currently these bits get exposed through generic_id_ftr32[] which is not desirable. Hence define an explicit ftr_id_isar0[] array for ID_ISAR0 register where those bits can be hidden. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Mark Rutland Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1589881254-10082-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit b1657ad708f761f9ca6d166d4dda685ca39b1254 Author: Peng Fan Date: Thu May 7 13:56:18 2020 +0800 clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice Switch the bus clk use imx8m_clk_hw_composite_bus, then we could avoid possible issue when setting mux of the clk. Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 0e40198dc28b620ead39de6e42db291418cd1183 Author: Peng Fan Date: Thu May 7 13:56:17 2020 +0800 clk: imx: add imx8m_clk_hw_composite_bus Introduce imx8m_clk_hw_composite_bus api for bus clk root slice usage. Because the mux switch sequence issue, we could not reuse Peripheral Clock Slice code, need use composite specific mux operation. Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit f90b68d6c8b008549a4538f608575ff3f9ed2905 Author: Peng Fan Date: Thu May 7 13:56:16 2020 +0800 clk: imx: add mux ops for i.MX8M composite clk The CORE/BUS root slice has following design, simplied graph: The difference is core not have pre_div block. A composite core/bus clk has 8 inputs for mux to select, saying clk[0-7]. It support target(smart) interface and normal interface. Target interface is exported for programmer easy to configure ccm root. Normal interface is also exported, but we not use it in our driver, because it will introduce more complexity compared with target interface. The normal interface simplified as below: SEL_A GA +--+ +-+ | +->+ +------+ CLK[0-7]--->+ | +-+ | | | | +----v---+ +----+ | +--+ |pre_diva+----> | +---------+ | +--------+ |mux +--+post_div | | +--+ |pre_divb+--->+ | +---------+ | | | +----^---+ +----+ +--->+ | +-+ | | +->+ +------+ +--+ +-+ SEL_B GB The mux in the upper pic is not the target interface MUX, target interface MUX is hiding SEL_A and SEL_B. When you choose clk[0-7], you are actually writing SEL_A or SEL_B depends on the internal counter which will also control the internal "mux". The target interface simplified as below which is used by Linux Kernel: CLK[0-7]--->MUX-->Gate-->pre_div-->post_div A requirement of the Target Interface's software is that the target clock source is active, it means when setting SEL_A, the current input clk to SEL_A must be active, same to SEL_B. We touch target interface, but hardware logic actually also need configure normal interface. There will be system hang, when doing the following steps: The initial state: SEL_A/SEL_B are both sourcing from clk0, the internal counter choose SEL_A. 1. switch mux from clk0 to clk1 The hardware logic will choose SEL_B and configure SEL_B to clk1. SEL_A no changed. 2. gate off clk0 Disable clk0, then the input to SEL_A is off. 3. swtich from clk1 to clk2 The hardware logic will choose SEL_A and configure SEL_A to clk2, however the current SEL_A input clk0 is off, the system hang. The solution to fix the issue is in step 1, write twice to target interface MUX, it will make SEL_A/SEL_B both sources from clk1, then no need to care about the state of clk0. And finally system performs well. Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 0ad45e5fdc522b26242882abfca1b4b3c840961d Author: Piotr Stankiewicz Date: Mon May 11 12:07:13 2020 -0400 IB/hfi1: Enable the transmit side of the datagram ipoib netdev This patch hooks the transmit side of the datagram netdev with ipoib by setting the rdma_netdev_get_params function for the hfi1 ib_device_ops structue. It also enables the receiving side by adding the AIP capability into the default capabilities. Link: https://lore.kernel.org/r/20200511160712.173205.65700.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Piotr Stankiewicz Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 8f149b684764662bca3e08f340202b7bd67736fc Author: Gary Leshner Date: Mon May 11 12:07:06 2020 -0400 IB/ipoib: Add capability to switch between datagram and connected mode This is the prerequisite modification to the ipoib ulp to allow a rdma netdev to obtain the default ndo ops for init/uninit/open/close. This is accomplished by setting the netdev ops field within the callback function passed to the netdev allocation routine which in turn was passed into the rdma netdev allocation routine. This allows the rdma netdev to call back into the ulp to create the resources required for connected mode operation. Additionally as the ulp is not re-entrant, when switching modes, the number of real tx queues is set to 1 for the connected mode. For datagram mode the number of real tx queues is set to the actual number of tx queues specified at the netdev's allocation. For the internal ulp netdev the number of tx queues defaults to 1. It is up to the rdma netdev to specify the actual number it can support. When the driver does not support a rdma netdev for acceleration, (-ENOTSUPPORTED return code or the verbs function for allocation is NULL) the ipoib ulp functions are unaffected by using the internal netdev allocated by the ipoib ulp. Link: https://lore.kernel.org/r/20200511160706.173205.19086.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Gary Leshner Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 7638c0e965f48d773d8684d38e0967e4d0ee238c Author: Grzegorz Andrejczuk Date: Mon May 11 12:07:01 2020 -0400 IB/hfi1: Add packet histogram trace event Add a simple trace event taking context number and building simple histogram to print packets distribution between contexts. Link: https://lore.kernel.org/r/20200511160700.173205.84270.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit b7e159eb008eb8b0bb83c09990b648bd2c4081df Author: Gary Leshner Date: Mon May 11 12:06:55 2020 -0400 IB/{hfi1, ipoib, rdma}: Broadcast ping sent packets which exceeded mtu size When in connected mode ipoib sent broadcast pings which exceeded the mtu size for broadcast addresses. Add an mtu attribute to the rdma_netdev structure which ipoib sets to its mcast mtu size. The RDMA netdev uses this value to determine if the skb length is too long for the mtu specified and if it is, drops the packet and logs an error about the errant packet. Link: https://lore.kernel.org/r/20200511160655.173205.14546.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Gary Leshner Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 4730f4a6c6b2065589c0822af00aa45e639bbc36 Author: Grzegorz Andrejczuk Date: Mon May 11 12:06:49 2020 -0400 IB/hfi1: Activate the dummy netdev As described in earlier patches, ipoib netdev will share receive contexts with existing VNIC netdev through a dummy netdev. The following changes are made to achieve that: - Set up netdev receive contexts after user contexts. A function is added to count the available netdev receive contexts. - Add functions to set/get receive map table free index. - Rename NUM_VNIC_MAP_ENTRIES as NUM_NETDEV_MAP_ENTRIES. - Let the dummy netdev own the receive contexts instead of VNIC. - Allocate the dummy netdev when the hfi1 device is added and free it when the device is removed. - Initialize AIP RSM rules when the IpoIb rxq is initialized and remove the rules when it is de-initialized. - Convert VNIC to use the dummy netdev. Link: https://lore.kernel.org/r/20200511160649.173205.4626.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Sadanand Warrier Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 370caa5b5880cd988645735c2d5d1d597c258e39 Author: Grzegorz Andrejczuk Date: Mon May 11 12:06:43 2020 -0400 IB/hfi1: Add rx functions for dummy netdev This patch adds the rx functions for the dummy netdev: - Functions to allocate/free the dummy netdev. - Functions to allocate/free receiving contexts for the netdev. - Functions to initialize/de-initialize the receive queue. - Functions to enable/disable the receive queue. Link: https://lore.kernel.org/r/20200511160643.173205.75087.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Sadanand Warrier Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 0bae02d56bba6cc3836a9d8dfbbe53787af19a58 Author: Grzegorz Andrejczuk Date: Mon May 11 12:06:37 2020 -0400 IB/hfi1: Add interrupt handler functions for accelerated ipoib This patch adds the interrupt handler function, the NAPI poll function, and its associated helper functions for receiving accelerated ipoib packets. While we are here, fix the formats of two error printouts. Link: https://lore.kernel.org/r/20200511160637.173205.64890.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Sadanand Warrier Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 6991abcb993cf6c0711237b9d393d4f0a2008f1f Author: Kaike Wan Date: Mon May 11 12:06:31 2020 -0400 IB/hfi1: Add functions to receive accelerated ipoib packets Ipoib netdev will share receive contexts with existing VNIC netdev. To achieve that, a dummy netdev is allocated with hfi1_devdata to own the receive contexts, and ipoib and VNIC netdevs will be put on top of it. Each receive context is associated with a single NAPI object. This patch adds the functions to receive incoming packets for accelerated ipoib. Link: https://lore.kernel.org/r/20200511160631.173205.54184.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Sadanand Warrier Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 89dcaa366bffb9fcef39b97d08cc26d0a115ee35 Author: Grzegorz Andrejczuk Date: Mon May 11 12:06:25 2020 -0400 IB/hfi1: Rename num_vnic_contexts as num_netdev_contexts Rename num_vnic_contexts as num_ndetdev_contexts since VNIC and ipoib will share the same set of receive contexts. Link: https://lore.kernel.org/r/20200511160625.173205.53306.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Sadanand Warrier Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 6d72344cf6c47010cc2055a832e16c7fcdd16f82 Author: Kaike Wan Date: Mon May 11 12:06:18 2020 -0400 IB/ipoib: Increase ipoib Datagram mode MTU's upper limit Currently the ipoib UD mtu is restricted to 4K bytes. Remove this limitation so that the IPOIB module can potentially use an MTU (in UD mode) that is bounded by the MTU of the underlying device. A field is added to the ib_port_attr structure to indicate the maximum physical MTU the underlying device supports. Link: https://lore.kernel.org/r/20200511160618.173205.23053.stgit@awfm-01.aw.intel.com Reviewed-by: Dennis Dalessandro Reviewed-by: Mike Marciniszyn Signed-off-by: Sadanand Warrier Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 19d8b90a509f7fd9a3224cca6df160a413a4d521 Author: Grzegorz Andrejczuk Date: Mon May 11 12:06:12 2020 -0400 IB/hfi1: RSM rules for AIP This is implementation of RSM rule for AIP packets. AIP rule will use rule RSM2 and will match standard Infiniband packet containg BTH (LNH==BTH) and having Dest QPN prefixed with value 0x81. Spread between receive contexts will be done using source QPN bits. VNIC and AIP will share receive contexts, so their rules will point to the same RMT entries and their shared code is moved to separate functions. If any of the rules is active RMT mapping will be skipped for latter. Changed function hfi1_vnic_is_rsm_full to be more general and moved it from main header to chip.c. Changed the order of RSM rules because AIP rule as more specific one is needed to be placed before more general QOS rule. Rules are occupying two last RSM registers. Link: https://lore.kernel.org/r/20200511160612.173205.73002.stgit@awfm-01.aw.intel.com Reviewed-by: Dennis Dalessandro Reviewed-by: Mike Marciniszyn Signed-off-by: Grzegorz Andrejczuk Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 7f90a5a069f8dff9c76505b9853f95667d117c15 Author: Gary Leshner Date: Mon May 11 12:06:07 2020 -0400 IB/{rdmavt, hfi1}: Implement creation of accelerated UD QPs Adds capability to create a qpn to be recognized as an accelerated UD QP for ipoib. This is accomplished by reserving 0x81 in byte[0] of the qpn as the prefix for these qp types and reserving qpns between 0x810000 and 0x81ffff. The hfi1 capability mask already contained a flag for the VNIC netdev. This has been renamed and extended to include both VNIC and ipoib. The rvt code to allocate qps now recognizes this flag and sets 0x81 into byte[0] of the qpn. The code to allocate qpns is modified to reset the qpn numbering when it is detected that a value is located in byte[0] for a UD QP and it is a qpn being requested for net dev use. If it is a regular UD QP then it is allowable to have bits set in byte[0] of the qpn and provide the previously normal behavior. The code to free the qpn now checks for the AIP prefix value of 0x81 and removes it from the qpn before being freed so that the lower 16 bit number can be reused. This patch requires minor changes in the IB core and ipoib to facilitate the creation of accelerated UP QPs. Link: https://lore.kernel.org/r/20200511160607.173205.11757.stgit@awfm-01.aw.intel.com Reviewed-by: Dennis Dalessandro Reviewed-by: Mike Marciniszyn Signed-off-by: Gary Leshner Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 84e3b19a27f8f37c8cf98f8b7cdf3f8674bf8e97 Author: Gary Leshner Date: Mon May 11 12:06:00 2020 -0400 IB/hfi1: Remove module parameter for KDETH qpns The module parameter for KDETH qpns is being removed in favor of always using the default value of 0x80 as the qpn prefix. Defines have been added for various KDETH values including the prefix of 0x80. The reserved range now starts at the base value for KDETH qpns (0x80) and extends up to and including the last qpn for other reserved QP prefixed types. Adjust other QP prefixed define names to match KDETH defined names. Link: https://lore.kernel.org/r/20200511160600.173205.27508.stgit@awfm-01.aw.intel.com Reviewed-by: Dennis Dalessandro Reviewed-by: Mike Marciniszyn Signed-off-by: Gary Leshner Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 438d7dda9841ec42ef7d9024dc45347f9526016a Author: Gary Leshner Date: Mon May 11 12:05:54 2020 -0400 IB/hfi1: Add the transmit side of a datagram ipoib RDMA netdev This implements the transmit side of the multiple transmit queue RDMA netdev used to accelerate ipoib. The receive side remains the ipoib internal implementation. The init/unint/open/stop netdev operations are saved off and called by the versions within the hfi1 netdev in order to initialize the connected mode resources present in ipoib thus allowing us to switch modes between datagram and connected. The datagram queue pair instantiated by the ipoib ulp is used by this implementation for its queue pair number and to register with multicast. The above queue pair is not used on transmit other than its qpn as the verbs layer is skipped and packets are directly submitted to the sdma engines. Link: https://lore.kernel.org/r/20200511160554.173205.1369.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Gary Leshner Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit d99dc602e2a55a99940ba9506a7126dfa54d54ea Author: Gary Leshner Date: Mon May 11 12:05:48 2020 -0400 IB/hfi1: Add functions to transmit datagram ipoib packets This patch implements the mechanism to accelerate the transmit side of a multiple transmit queue RDMA netdev by submitting the packets to the SDMA engine directly instead of sending through the verbs layer. This patch also changes the UD/SEND_ONLY op to output the entropy value in byte 0 of deth[1]. UD/SEND_ONLY_WITH_IMMEDIATE uses the previous behavior with no entropy value being output. The code in the ipoib rdma netdev which submits tx requests upon successful submission will call trace_sdma_output_ibhdr to output the ibhdr to the trace buffer. Link: https://lore.kernel.org/r/20200511160548.173205.45616.stgit@awfm-01.aw.intel.com Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Gary Leshner Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit fe810b509c5f62b5b3d5681ea6f5d36349ced979 Author: Kaike Wan Date: Mon May 11 12:05:41 2020 -0400 IB/hfi1: Add accelerated IP capability bit The accelerated IP capability bit is added to allow users to control which feature is enabled and disabled. Link: https://lore.kernel.org/r/20200511160541.173205.96870.stgit@awfm-01.aw.intel.com Reviewed-by: Dennis Dalessandro Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 3783daeb1d24696ff00125050353cfce4f5b6239 Author: Christoph Hellwig Date: Tue May 19 16:33:21 2020 +0200 block: remove ioctl_by_bdev No callers left. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 26d7e28e38206b1b3207af1409eee2269ab36f82 Author: Stefan Haberland Date: Tue May 19 16:22:59 2020 +0200 s390/dasd: remove ioctl_by_bdev calls The IBM partition parser requires device type specific information only available to the DASD driver to correctly register partitions. The current approach of using ioctl_by_bdev with a fake user space pointer is discouraged. Fix this by replacing IOCTL calls with direct in-kernel function calls. Suggested-by: Christoph Hellwig Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Reviewed-by: Peter Oberparleiter Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 9353848c6589ffe6373d03f3a58feaeda1009641 Author: Christoph Hellwig Date: Tue May 19 16:22:58 2020 +0200 dasd: refactor dasd_ioctl_information Prepare for in-kernel callers of this functionality. Signed-off-by: Christoph Hellwig [sth@de.ibm.com: remove leftover kfree] Signed-off-by: Stefan Haberland Reviewed-by: Peter Oberparleiter Reviewed-by: Jan Hoeppner Signed-off-by: Jens Axboe commit 3448914e8cc550ba792d4ccc74471d1ca4293aae Author: Martijn Coenen Date: Wed May 13 15:38:45 2020 +0200 loop: Add LOOP_CONFIGURE ioctl This allows userspace to completely setup a loop device with a single ioctl, removing the in-between state where the device can be partially configured - eg the loop device has a backing file associated with it, but is reading from the wrong offset. Besides removing the intermediate state, another big benefit of this ioctl is that LOOP_SET_STATUS can be slow; the main reason for this slowness is that LOOP_SET_STATUS(64) calls blk_mq_freeze_queue() to freeze the associated queue; this requires waiting for RCU synchronization, which I've measured can take about 15-20ms on this device on average. In addition to doing what LOOP_SET_STATUS can do, LOOP_CONFIGURE can also be used to: - Set the correct block size immediately by setting loop_config.block_size (avoids LOOP_SET_BLOCK_SIZE) - Explicitly request direct I/O mode by setting LO_FLAGS_DIRECT_IO in loop_config.info.lo_flags (avoids LOOP_SET_DIRECT_IO) - Explicitly request read-only mode by setting LO_FLAGS_READ_ONLY in loop_config.info.lo_flags Here's setting up ~70 regular loop devices with an offset on an x86 Android device, using LOOP_SET_FD and LOOP_SET_STATUS: vsoc_x86:/system/apex # time for i in `seq 30 100`; do losetup -r -o 4096 /dev/block/loop$i com.android.adbd.apex; done 0m03.40s real 0m00.02s user 0m00.03s system Here's configuring ~70 devices in the same way, but using a modified losetup that uses the new LOOP_CONFIGURE ioctl: vsoc_x86:/system/apex # time for i in `seq 30 100`; do losetup -r -o 4096 /dev/block/loop$i com.android.adbd.apex; done 0m01.94s real 0m00.01s user 0m00.01s system Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit faf1d25440d6ad06d509dada4b6fe62fea844370 Author: Martijn Coenen Date: Wed May 13 15:38:44 2020 +0200 loop: Clean up LOOP_SET_STATUS lo_flags handling LOOP_SET_STATUS(64) will actually allow some lo_flags to be modified; in particular, LO_FLAGS_AUTOCLEAR can be set and cleared, whereas LO_FLAGS_PARTSCAN can be set to request a partition scan. Make this explicit by updating the UAPI to include the flags that can be set/cleared using this ioctl. The implementation can then blindly take over the passed in flags, and use the previous flags for those flags that can't be set / cleared using LOOP_SET_STATUS. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 571fae6e290d64a3e8132c455e7786c99c467ed1 Author: Martijn Coenen Date: Wed May 13 15:38:43 2020 +0200 loop: Rework lo_ioctl() __user argument casting In preparation for a new ioctl that needs to copy_from_user(); makes the code easier to read as well. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 62ab466ca881fe200c21aa74b65f8bd83ec482dc Author: Martijn Coenen Date: Wed May 13 15:38:42 2020 +0200 loop: Move loop_set_status_from_info() and friends up So we can use it without forward declaration. This is a separate commit to make it easier to verify that this is just a move, without functional modifications. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0c3796c244598122a5d59d56f30d19390096817f Author: Martijn Coenen Date: Wed May 13 15:38:41 2020 +0200 loop: Factor out configuring loop from status Factor out this code into a separate function, so it can be reused by other code more easily. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0a6ed1b5ff6757f11ad2d57906ceb40488a5ee52 Author: Martijn Coenen Date: Wed May 13 15:38:40 2020 +0200 loop: Remove figure_loop_size() This function was now only used by loop_set_capacity(). Just open code the remaining code in the caller instead. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b0bd158dd630bd47640e0e418c062cda1e0da5ad Author: Martijn Coenen Date: Wed May 13 15:38:39 2020 +0200 loop: Refactor loop_set_status() size calculation figure_loop_size() calculates the loop size based on the passed in parameters, but at the same time it updates the offset and sizelimit parameters in the loop device configuration. That is a somewhat unexpected side effect of a function with this name, and it is only only needed by one of the two callers of this function - loop_set_status(). Move the lo_offset and lo_sizelimit assignment back into loop_set_status(), and use the newly factored out functions to validate and apply the newly calculated size. This allows us to get rid of figure_loop_size() in a follow-up commit. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 716ad0986cbd1d3b2ab3f6d23144a94638dac20b Author: Martijn Coenen Date: Wed May 13 15:38:38 2020 +0200 loop: Switch to set_capacity_revalidate_and_notify() This was recently added to block/genhd.c, and takes care of both updating the capacity and notifying userspace of the new size. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5795b6f5607f7e4db62ddea144727780cb351a9b Author: Martijn Coenen Date: Wed May 13 15:38:37 2020 +0200 loop: Factor out setting loop device size This code is used repeatedly. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 083a6a50783ef54256eec3499e6575237e0e3d53 Author: Martijn Coenen Date: Wed May 13 15:38:36 2020 +0200 loop: Remove sector_t truncation checks sector_t is now always u64, so we don't need to check for truncation. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7c5014b0987a30e4989c90633c198aced454c0ec Author: Martijn Coenen Date: Wed May 13 15:38:35 2020 +0200 loop: Call loop_config_discard() only after new config is applied loop_set_status() calls loop_config_discard() to configure discard for the loop device; however, the discard configuration depends on whether the loop device uses encryption, and when we call it the encryption configuration has not been updated yet. Move the call down so we apply the correct discard configuration based on the new configuration. Signed-off-by: Martijn Coenen Reviewed-by: Christoph Hellwig Reviewed-by: Bob Liu Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit a2a3e46cfb11518a6abe7f7add98aec94d3a8069 Merge: 863c0b59f06a cae809434da1 Author: Arnd Bergmann Date: Thu May 21 16:03:55 2020 +0200 Merge tag 'ti-k3-dt-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kristo/linux into arm/dt Texas Instruments K3 SoC DT updates for v5.8 - Add DSS support for both AM65x and J721e - Add watchdog support for J721e - Add EHRPWM support for AM65x - Add Thermal support for AM65x * tag 'ti-k3-dt-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kristo/linux: arm64: dts: ti: k3-j721e-main: Add main domain watchdog entries arm64: dts: ti: k3-am65-main: Add ehrpwm nodes arm64: dts: ti: am654: Add thermal zones arm64: dts: ti: am65-wakeup: Add VTM node arm64: dts: ti: k3-j721e-common-proc-board: add assigned clks for DSS arm64: dts: ti: k3-j721e-main: Add DSS node arm64: dts: ti: am654: Add DSS node Link: https://lore.kernel.org/r/7484d3c9-323f-36a3-f0df-1287586f356d@ti.com Signed-off-by: Arnd Bergmann commit 863c0b59f06a3d222adb51cd25e0aa9b162d63d0 Merge: de12d92147c1 0b5832238d36 Author: Arnd Bergmann Date: Thu May 21 16:03:21 2020 +0200 Merge tag 'renesas-dt-bindings-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.8 (take two) - Document support for the RZ/G1H-based iWave RainboW Qseven SOM (G21M) and board (G21D). * tag 'renesas-dt-bindings-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: arm: renesas: Document iW-RainboW-G21D-Qseven-RZG1H board dt-bindings: arm: renesas: Document iW-RainboW-G21M-Qseven-RZG1H SoM Link: https://lore.kernel.org/r/20200515100547.14671-6-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit de12d92147c1d413fa2fbe9449afbecdb33dbb0a Merge: aff195d0ec65 0e36587c0832 Author: Arnd Bergmann Date: Thu May 21 16:02:11 2020 +0200 Merge tag 'renesas-arm-dt-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.8 (take two) - Initial support for the Renesas RZ/G1H SoC on the iWave RainboW Qseven SOM (G21M) and board (G21D), - Support for the AISTARVISION MIPI Adapter V2.1 camera board on the Silicon Linux EK874 RZ/G2E evaluation kit. * tag 'renesas-arm-dt-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: r8a774c0-cat874: Add support for AISTARVISION MIPI Adapter V2.1 ARM: dts: r8a7742: Add GPIO nodes ARM: dts: r8a7742: Add [H]SCIF{A|B} support ARM: dts: r8a7742: Add IRQC support ARM: dts: r8a7742-iwg21d-q7: Add iWave G21D-Q7 board based on RZ/G1H ARM: dts: r8a7742-iwg21m: Add iWave RZ/G1H Qseven SOM ARM: dts: r8a7742: Initial SoC device tree clk: renesas: Add r8a7742 CPG Core Clock Definitions dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros Link: https://lore.kernel.org/r/20200515100547.14671-3-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit aff195d0ec653d83e168bc34561d5707f672d32b Merge: ca6bc7a19241 7e76f82acd9e Author: Arnd Bergmann Date: Thu May 21 16:00:46 2020 +0200 Merge tag 'stm32-dt-for-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into arm/dt STM32 DT updates for v5.8, round 1 Highlights: ---------- MCU part: -fix a typo for DAC io-channel-cells on f429 and h743 MPU part: -Generic: -Bump tp PSCI 1.0 -Fix a typo for DAC io-channel-cells -Add M4 pdds for deep sleep mode -Add I2C fatmode plus support -Add new Octavio lxa-mc1 board based on OSDMP15x SiP -Add new Stinger96 board support. It is a 96Boards IoT Extended board based on stm32mp157a SoC. Some figures: 256MB DDR, 125MB and flash, Onboard BG96 modem... -Add IoT Box board support based on stinger96 board + Wifi/BT, CCS811 VOC sensor, 2 digitals microphones ... -DH: -Adapt dhcom-som and dhcom-pdk2 dts(i) files to STM32MP15 SoC diversity -Add GPIO led and GPIO keys support on PDK2 board -AV96: -Major rework to support official avenger96 board based on DHCOR SOM. -Prototype board is no more supported * tag 'stm32-dt-for-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: (58 commits) ARM: dts: stm32: Split Avenger96 into DHCOR SoM and Avenger96 board ARM: dts: stm32: Split SoC-independent parts of DHCOM SOM and PDK2 ARM: dts: stm32: Add GPIO LEDs for STM32MP1 DHCOM PDK2 ARM: dts: stm32: Add GPIO keys for STM32MP1 DHCOM PDK2 ARM: dts: stm32: Add IoT Box board support dt-bindings: arm: stm32: Document IoT Box compatible ARM: dts: stm32: Add Stinger96 board support dt-bindings: arm: stm32: Document Stinger96 compatible ARM: dts: stm32: Add missing pinctrl entries for STM32MP15 dt-bindings: Add vendor prefix for Shiratech Solutions ARM: dts: stm32: Add bindings for SPI2 on AV96 ARM: dts: stm32: Add alternate pinmux for SPI2 pins ARM: dts: stm32: Add bindings for ADC on AV96 ARM: dts: stm32: Add alternate pinmux for ADC pins ARM: dts: stm32: Add bindings for FDCAN2 on AV96 ARM: dts: stm32: Add alternate pinmux for FDCAN2 pins ARM: dts: stm32: Add bindings for FDCAN1 on AV96 ARM: dts: stm32: Add alternate pinmux for FDCAN1 pins ARM: dts: stm32: Repair I2C2 operation on AV96 ARM: dts: stm32: Add alternate pinmux for I2C2 pins ... Link: https://lore.kernel.org/r/19160355-364d-170c-7ae2-5ba7f714103f@st.com Signed-off-by: Arnd Bergmann commit 0299a1a81ca056e79c1a7fb751f936ec0d5c7afe Author: Jean-Philippe Brucker Date: Tue May 19 19:54:46 2020 +0200 iommu/arm-smmu-v3: Manage ASIDs with xarray In preparation for sharing some ASIDs with the CPU, use a global xarray to store ASIDs and their context. ASID#0 is now reserved, and the ASID space is global. Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20200519175502.2504091-9-jean-philippe@linaro.org Signed-off-by: Will Deacon commit ca6bc7a19241459a77c148ea28fac1632b363763 Merge: c380981efbcd c9ed436fd69b Author: Arnd Bergmann Date: Thu May 21 15:51:39 2020 +0200 Merge tag 'samsung-dt-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM changes for v5.8 1. Add DTS for Exynos4210-based Samsung Galaxy S2 (GT-I9100) mobile phone, 2. Enable WiFi and Bluetooth in multiple boards, 3. Add new features to S5Pv210-based Aries family of mobile phones (e.g. Samsung Galaxy S): necessary configuration for suspend, audio support, USB mux, touch keys, panel, i2c-gpio adapters, FM radio, ADC, 4. Many minor fixes (e.g. GPIO polarity, interrupts). * tag 'samsung-dt-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: (29 commits) ARM: dts: s5pv210: Set MAX8998 GPIO pulls on Aries boards ARM: dts: s5pv210: Correct FIMC definitions ARM: dts: s5pv210: Assign clocks to MMC devices on Aries boards ARM: dts: s5pv210: Enable ADC on Aries boards ARM: dts: s5pv210: Add an ADC node ARM: dts: s5pv210: Disable pull for vibrator enable GPIO on Aries boards ARM: dts: s5pv210: Add si470x FM radio to Galaxy S ARM: dts: s5pv210: Add remaining i2c-gpio adapters to Aries boards ARM: dts: s5pv210: Add panel support to Aries boards ARM: dts: s5pv210: Add touchkey support to Aries boards ARM: dts: s5pv210: Add FSA9480 support to Aries boards ARM: dts: s5pv210: Add WM8994 support to Aries boards ARM: dts: s5pv210: Disable pulls on GPIO I2C adapters for Aries ARM: dts: s5pv210: Set keep-power-in-suspend for SDHCI1 on Aries ARM: dts: s5pv210: Correct gpi pinctrl node name ARM: dts: s5pv210: Add sleep GPIO configuration for Galaxy S ARM: dts: s5pv210: Add sleep GPIO configuration for Fascinate4G ARM: dts: s5pv210: Add helper define for sleep gpio config ARM: dts: exynos: Enable WLAN support for the UniversalC210 board ARM: dts: exynos: Enable WLAN support for the Rinato board ... Link: https://lore.kernel.org/r/20200512122922.5700-2-krzk@kernel.org Signed-off-by: Arnd Bergmann commit 4fc92254bf86b19ac1ef81f61f4e690fccfcba4a Author: Jean-Philippe Brucker Date: Tue May 19 19:54:43 2020 +0200 arm64: mm: Add asid_gen_match() helper Add a macro to check if an ASID is from the current generation, since a subsequent patch will introduce a third user for this test. Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20200519175502.2504091-6-jean-philippe@linaro.org Signed-off-by: Will Deacon commit c380981efbcdba99b876e72eb3d88a8641180a5f Merge: 9c7ae8edb958 460227c329e5 Author: Arnd Bergmann Date: Thu May 21 15:45:59 2020 +0200 Merge tag 'arm-soc/for-5.8/devicetree' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM-based SoCs Device Tree changes for v5.8, please pull the following: - Nicolas updates the Raspberry Pi 4 board DTS to include the GPIO controlling power to the SD card, adds support for the vmmc regulator for the emmc2 controller and finally updates the power management provider for V3D to use the firmware to solve instabilities. * tag 'arm-soc/for-5.8/devicetree' of https://github.com/Broadcom/stblinux: ARM: dts: bcm283x: Use firmware PM driver for V3D ARM: dts: bcm2711: Add vmmc regulator in emmc2 ARM: dts: bcm2711: Update expgpio's GPIO labels Link: https://lore.kernel.org/r/20200511210522.28243-2-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 9c7ae8edb9588ea661db22a284ba8453fc2d1ae9 Merge: 8c915019e3e0 fd955a7eac36 Author: Arnd Bergmann Date: Thu May 21 15:43:45 2020 +0200 Merge tag 'hisi-arm64-dt-for-5.8' of git://github.com/hisilicon/linux-hisi into arm/dt ARM64: DT: Hisilicon SoCs DT updates for 5.8 - Add pinconf for spi2 and spi3 nodes and increase the drive strength to achieve the max speed for the Hikey960 board - Add CTI nodes for the Hikey620 board * tag 'hisi-arm64-dt-for-5.8' of git://github.com/hisilicon/linux-hisi: arm64: dts: hi6220: Add CTI options arm64: dts: hikey960: pinctrl: Fix spi2/spi3 pinconf Link: https://lore.kernel.org/r/5EBE430E.6090508@hisilicon.com Signed-off-by: Arnd Bergmann commit 269fd61e15d785b9e20786672765400732dde8a0 Author: Sudeep Holla Date: Thu May 21 12:08:36 2020 +0100 firmware: smccc: Fix missing prototype warning for arm_smccc_version_init Commit f2ae97062a48 ("firmware: smccc: Refactor SMCCC specific bits into separate file") introduced the following build warning: drivers/firmware/smccc/smccc.c:14:13: warning: no previous prototype for function 'arm_smccc_version_init' [-Wmissing-prototypes] void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit) ^~~~~~~~~~~~~~~~~~~~~~ Fix the same by adding the missing prototype in arm-smccc.h Reported-by: kbuild test robot Signed-off-by: Sudeep Holla Link: https://lore.kernel.org/r/20200521110836.57252-1-sudeep.holla@arm.com Signed-off-by: Will Deacon commit e1ca01a902fedebd72978f606f4be767ea4a26ea Author: Gal Pressman Date: Tue May 12 18:22:04 2020 +0300 RDMA/efa: Report host information to the device The host info feature allows the driver to infrom the EFA device firmware with system configuration for debugging and troubleshooting purposes. The host info buffer is passed as an admin command DMA mapped control buffer, and is unmapped and freed once the command CQE is consumed. Currently, the setting of host info is done for each device on its probe. Failing to set the host info for the device shall not disturb the probe flow, any errors will be discarded. Link: https://lore.kernel.org/r/20200512152204.93091-3-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Guy Tzalik Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit cc8a635e24acf2793605f243c913c51b8c3702ab Author: Gal Pressman Date: Tue May 12 18:22:03 2020 +0300 RDMA/efa: Fix setting of wrong bit in get/set_feature commands When using a control buffer the ctrl_data bit should be set in order to indicate the control buffer address is valid, not ctrl_data_indirect which is used when the control buffer itself is indirect. Fixes: e9c6c5373088 ("RDMA/efa: Add common command handlers") Link: https://lore.kernel.org/r/20200512152204.93091-2-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit a4eb355a3fdad85d16e4b098e8d56bb28b812ce0 Author: Will Deacon Date: Tue May 19 12:56:05 2020 +0100 arm64: vdso: Fix CFI directives in sigreturn trampoline Daniel reports that the .cfi_startproc is misplaced for the sigreturn trampoline, which causes LLVM's unwinder to misbehave: | I run into this with LLVM’s unwinder. | This combination was always broken. This prompted Dave to question our use of CFI directives more generally, and I ended up going down a rabbit hole trying to figure out how this very poorly documented stuff gets used. Move the CFI directives so that the "mysterious NOP" is included in the .cfi_{start,end}proc block and add a bunch of comments so that I can save myself another headache in future. Cc: Tamas Zsoldos Reported-by: Dave Martin Reported-by: Daniel Kiss Tested-by: Daniel Kiss Signed-off-by: Will Deacon commit 9a964285572b5a3ea268bd744bb6837aecf09640 Author: Will Deacon Date: Tue May 19 12:38:33 2020 +0100 arm64: vdso: Don't prefix sigreturn trampoline with a BTI C instruction For better or worse, GDB relies on the exact instruction sequence in the VDSO sigreturn trampoline in order to unwind from signals correctly. Commit c91db232da48 ("arm64: vdso: Convert to modern assembler annotations") unfortunately added a BTI C instruction to the start of __kernel_rt_sigreturn, which breaks this check. Thankfully, it's also not required, since the trampoline is called from a RET instruction when returning from the signal handler Remove the unnecessary BTI C instruction from __kernel_rt_sigreturn, and do the same for the 32-bit VDSO as well for good measure. Cc: Daniel Kiss Cc: Tamas Zsoldos Reviewed-by: Dave Martin Reviewed-by: Mark Brown Fixes: c91db232da48 ("arm64: vdso: Convert to modern assembler annotations") Signed-off-by: Will Deacon commit 8ece3b3eb576a78d2e67ad4c3a80a39fa6708809 Author: Bruno Meneguele Date: Tue Mar 17 07:33:44 2020 -0300 kernel/printk: add kmsg SEEK_CUR handling Userspace libraries, e.g. glibc's dprintf(), perform a SEEK_CUR operation over any file descriptor requested to make sure the current position isn't pointing to junk due to previous manipulation of that same fd. And whenever that fd doesn't have support for such operation, the userspace code expects -ESPIPE to be returned. However, when the fd in question references the /dev/kmsg interface, the current kernel code state returns -EINVAL instead, causing an unexpected behavior in userspace: in the case of glibc, when -ESPIPE is returned it gets ignored and the call completes successfully, while returning -EINVAL forces dprintf to fail without performing any action over that fd: if (_IO_SEEKOFF (fp, (off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD && errno != ESPIPE) return NULL; With this patch we make sure to return the correct value when SEEK_CUR is requested over kmsg and also add some kernel doc information to formalize this behavior. Link: https://lore.kernel.org/r/20200317103344.574277-1-bmeneg@redhat.com Cc: linux-kernel@vger.kernel.org Cc: rostedt@goodmis.org, Cc: David.Laight@ACULAB.COM Signed-off-by: Bruno Meneguele Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 325606af573152e02f44d791f152b7f9564bcb30 Author: Ethon Paul Date: Sat Apr 18 19:35:36 2020 +0800 printk: Fix a typo in comment "interator"->"iterator" There is a typo in comment, fix it. Signed-off-by: Ethon Paul Cc: Steven Rostedt Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 8c915019e3e01a2191b7787bb5929fbc84908a9b Merge: 18e48cc0ba9c 378788120bed Author: Arnd Bergmann Date: Thu May 21 12:34:22 2020 +0200 Merge tag 'realtek-dt-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek into arm/dt Realtek Arm based SoC DT for v5.8 Add RTD1195, RTD1395 and RTD1619 SoCs as well as Xnano X5 TV box. Clean up memory nodes and /soc ranges. Factor out r-bus and partition it into CRT, Iso, Misc, SB2 and SCPU Wrapper blocks. * tag 'realtek-dt-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek: (35 commits) dt-bindings: reset: rtd1295: Add SB2 reset arm64: dts: realtek: rtd16xx: Add SB2 and SCPU Wrapper syscon nodes arm64: dts: realtek: rtd139x: Add SB2 and SCPU Wrapper syscon nodes arm64: dts: realtek: rtd129x: Add SB2 and SCPU Wrapper syscon nodes ARM: dts: rtd1195: Add SB2 and SCPU Wrapper syscon nodes arm64: dts: realtek: rtd16xx: Add CRT syscon node ARM: dts: rtd1195: Add UART resets ARM: dts: rtd1195: Add reset nodes dt-bindings: reset: Add Realtek RTD1195 ARM: dts: rtd1195: Add CRT syscon node arm64: dts: realtek: rtd16xx: Introduce iso and misc syscon arm64: dts: realtek: rtd139x: Introduce CRT, iso and misc syscon arm64: dts: realtek: rtd129x: Introduce CRT, iso and misc syscon ARM: dts: rtd1195: Introduce iso and misc syscon arm64: dts: realtek: rtd1295: Add Xnano X5 dt-bindings: arm: realtek: Add Xnano X5 dt-bindings: vendor-prefixes: Add Xnano arm64: dts: realtek: rtd16xx: Add memory reservations arm64: dts: realtek: rtd16xx: Carve out boot ROM from memory arm64: dts: realtek: Add RTD1619 SoC and Realtek Mjolnir EVB ... Link: https://lore.kernel.org/r/20200510232158.18477-2-afaerber@suse.de Signed-off-by: Arnd Bergmann commit 18e48cc0ba9cf24eae73858c7c44a78f9a53bef0 Merge: 4875d9e230cc fa4c8ec6feaa Author: Arnd Bergmann Date: Thu May 21 12:19:04 2020 +0200 Merge tag 'aspeed-5.8-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed into arm/dt ASPEED device tree updates for 5.8 New machines: - YADRO's ast2500 OpenPower P9 Nicole BMC - Facebook's ast2500 x86 Yosemite V2 BMC The AST2600 machines Rainier and Tacoma were fleshed out. Machines have started describing the GPIO names as userspace attempts to use the GPIO chardev API. * tag 'aspeed-5.8-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed: (32 commits) ARM: dts: aspeed: Change KCS nodes to v2 binding ARM: dts: Aspeed: AST2600: Add XDMA PCI-E root control reset ARM: dts: aspeed: ast2600: Add XDMA Engine ARM: dts: aspeed: ast2500: Add XDMA Engine ARM: dts: aspeed: Adding Facebook Yosemite V2 BMC ARM: dts: aspeed: Add YADRO Nicole BMC ARM: dts: aspeed: mihawk: add aliases for i2c ARM: dts: aspeed: tacoma: Add TPM ARM: dts: aspeed: tacoma: Enable the second VUART ARM: dts: aspeed: tacoma: Add iio-hwmon nodes for IIO devices ARM: dts: aspeed: rainier: Add VGA reserved memory region ARM: dts: aspeed: rainier: Add gpio line names ARM: dts: aspeed: tacoma: Add gpio line names ARM: dts: aspeed: zaius: Add gpio line names ARM: dts: aspeed: romulus: Add gpio line names ARM: dts: aspeed: witherspoon: Add gpio line names ARM: dts: aspeed: ast2600: Set arch timer always-on ARM: dts: aspeed: tacoma: Add GPIOs for FSI ARM: dts: aspeed: mihawk: Change the name of leds ARM: dts: aspeed: rainier: Remove regulators ... Link: https://lore.kernel.org/r/CACPK8Xd-=XFREvvS-mK_ECyn14y0GPAMyy5BpEEUYfaw4jAgsw@mail.gmail.com Signed-off-by: Arnd Bergmann commit 4875d9e230cc95d71d0db8b66654e605e43ba6e5 Merge: 5971e53cf0c9 e88ba436e561 Author: Arnd Bergmann Date: Thu May 21 12:03:23 2020 +0200 Merge tag 'omap-for-v5.8/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt DTS changes for omaps for v5.8 merge window We add support for beaglebone-ai board that's am5729 based devices. Then we have a series changes to configure more hardware acceletators found on omap variants. With the recent ti-sysc related changes, we can now better configure the accelerators with help of the clock framework and reset driver. So with a series of changes from Suman Anna and Tero Kristo, let's configure IPUs and DSPs for dra7 devices like beagle-x15. And let's also configure the missing crypto accelerators for omap5 as those have been missing. Note that there are still some pending driver related patches to use IPU and DSP related features with mainline kernel, but those are independent of the devicetree changes. Then there is a display related change for am57xx-idk for tc358778 bridge, and a change to configure the missing clock source for some PWM timers. * tag 'omap-for-v5.8/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (26 commits) ARM: OMAP5: Make L4SEC clock domain SWSUP only ARM: OMAP4: Make L4SEC clock domain SWSUP only ARM: dts: omap5: add DES crypto accelerator node ARM: dts: omap5: add SHA crypto accelerator node ARM: dts: omap5: add aes2 entry ARM: dts: omap5: add aes1 entry ARM: dts: dra7-ipu-dsp-common: Add watchdog timers to IPU and DSP nodes ARM: dts: am571x-idk: Add CMA pools and enable IPUs & DSP1 rprocs ARM: dts: am572x-idk-common: Add CMA pools and enable IPU & DSP rprocs ARM: dts: beagle-x15-common: Add CMA pools and enable IPU & DSP rprocs ARM: dts: dra76-evm: Add CMA pools and enable IPU & DSP rprocs ARM: dts: dra71-evm: Add CMA pools and enable IPUs & DSP1 rprocs ARM: dts: dra72-evm-revc: Add CMA pools and enable IPUs & DSP1 rprocs ARM: dts: dra72-evm: Add CMA pools and enable IPUs & DSP1 rprocs ARM: dts: dra7-evm: Add CMA pools and enable IPU & DSP rprocs ARM: dts: dra7-ipu-dsp-common: Add timers to IPU and DSP nodes ARM: dts: dra7-ipu-dsp-common: Add mailboxes to IPU and DSP nodes ARM: dts: dra7-ipu-dsp-common: Move mailboxes into common files ARM: dts: DRA72x: Add aliases for rproc nodes ARM: dts: DRA74x: Add aliases for rproc nodes ... Link: https://lore.kernel.org/r/pull-1588873628-477615@atomide.com Signed-off-by: Arnd Bergmann commit 5971e53cf0c97233e12e3b67fd4534aebd60ac40 Merge: 71dbe9524dcd 9e01d74ce0a1 Author: Arnd Bergmann Date: Thu May 21 11:55:28 2020 +0200 Merge tag 'renesas-dt-bindings-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.8 - Document System Controller (SYSC) and Reset (RST) support for RZ/G1H. * tag 'renesas-dt-bindings-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: reset: rcar-rst: Document r8a7742 reset module dt-bindings: power: rcar-sysc: Document r8a7742 SYSC binding Link: https://lore.kernel.org/r/20200430084849.1457-6-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 71dbe9524dcd6246732595d7adcc0c53e2506f7d Merge: 3f0be4df50a7 cf8ae446bbcb Author: Arnd Bergmann Date: Thu May 21 11:54:41 2020 +0200 Merge tag 'renesas-arm-dt-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.8 - USB, UART, PWM, and PCIe support for R-Car M3-W+, - PWM (16-bit Timer Pulse Unit and PWM Timers) support for R-Car M2-W, - Minor fixes and cleanups. * tag 'renesas-arm-dt-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: Fix IOMMU device node names ARM: dts: renesas: Fix IOMMU device node names ARM: dts: shmobile: Update CMT1 compatible values ARM: dts: r8a7791: Add PWM device nodes ARM: dts: r8a7791: Add TPU device node arm64: dts: renesas: r8a77961: Add PCIe device nodes arm64: dts: renesas: r8a77961: Add PWM device nodes arm64: dts: renesas: r8a77961: Add SCIF and HSCIF nodes arm64: dts: renesas: r8a77961: Add USB3.0 device nodes arm64: dts: renesas: r8a77961: Add USB2.0 device nodes Link: https://lore.kernel.org/r/20200430084849.1457-3-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 3f0be4df50a7854a831c80a74d7cf2cfd61f2fde Merge: dca296dd1504 d67ef24adf3c Author: Arnd Bergmann Date: Thu May 21 11:53:19 2020 +0200 Merge tag 'versatile-dts-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into arm/dt Versatile DTS updates for the v5.8 kernel: Create a new device tree for the Integrator/AP with the IM-PD1 expansion module fitted in the first slot. If we want to augment the slot where it is sitting, we can alter the device tree or make the bootloader do so. * tag 'versatile-dts-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator: ARM: dts: Add devicetree for Integrator/AP with IM-PD1 Link: https://lore.kernel.org/r/CACRpkdZ-28o+pPdP7i_fc+7g4ndPWf+SWTsjnhFEegTggiXVSg@mail.gmail.com Signed-off-by: Arnd Bergmann commit 9ed78b05f998050784ae863bd5ba4aea2e2141ed Author: Andy Shevchenko Date: Wed May 20 19:49:27 2020 +0300 irqdomain: Allow software nodes for IRQ domain creation In some cases we need to have an IRQ domain created out of software node. One of such cases is DesignWare GPIO driver when it's instantiated from half-baked ACPI table (alas, we can't fix it for devices which are few years on market) and thus using software nodes to quirk this. But the driver is using IRQ domains based on per GPIO port firmware nodes, which are in the above case software ones. This brings a warning message to be printed [ 73.957183] irq: Invalid fwnode type for irqdomain and creates an anonymous IRQ domain without a debugfs entry. Allowing software nodes to be valid for IRQ domains rids us of the warning and debugs gets correctly populated. % ls -1 /sys/kernel/debug/irq/domains/ ... intel-quark-dw-apb-gpio:portA Signed-off-by: Andy Shevchenko [maz: refactored commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200520164927.39090-3-andriy.shevchenko@linux.intel.com commit 87526603c89256e18ad2c23821fdaf376b072fc8 Author: Andy Shevchenko Date: Wed May 20 19:49:26 2020 +0300 irqdomain: Get rid of special treatment for ACPI in __irq_domain_add() Now that __irq_domain_add() is able to better deals with generic fwnodes, there is no need to special-case ACPI anymore. Get rid of the special treatment for ACPI. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200520164927.39090-2-andriy.shevchenko@linux.intel.com commit dca296dd1504974fd377fb7f9035ebe353343f27 Merge: 161af8fd02fd 7f21a85085b7 Author: Arnd Bergmann Date: Thu May 21 11:51:28 2020 +0200 Merge tag 'sti-dt-for-v5.8-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti into arm/dt STi DT fixes: - Remove duplicated rng node in stih407-family.dtsi - Fix complain about IRQ_TYPE_NONE usage in stih418.dtsi * tag 'sti-dt-for-v5.8-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti: dts: arm: stih407-family: remove duplicated rng nodes dts: arm: stih418: Fix complain about IRQ_TYPE_NONE usage Link: https://lore.kernel.org/r/4b0c02e7-a247-50c0-d729-88d16b9dd7fd@st.com Signed-off-by: Arnd Bergmann commit 161af8fd02fd8bbade8d8c97e48ea7ba32704311 Author: Chunyan Zhang Date: Tue Apr 14 18:16:36 2020 +0800 arm64: dts: Add SC9863A emmc and sd card nodes Add emmc and sd card devicetree nodes for SC9863A. Link: https://lore.kernel.org/r/20200414101636.24503-3-zhang.lyra@gmail.com Signed-off-by: Chunyan Zhang Signed-off-by: Arnd Bergmann commit 78efc0199f3a952a5465f5649e6246118ab88037 Author: Chunyan Zhang Date: Tue Apr 14 18:16:35 2020 +0800 arm64: dts: Add SC9863A clock nodes add clock devicetree nodes for SC9863A. Link: https://lore.kernel.org/r/20200414101636.24503-2-zhang.lyra@gmail.com Signed-off-by: Chunyan Zhang Signed-off-by: Arnd Bergmann commit 181e9d4efaf6aa8d1e7d510aeb7114c0f276fad7 Author: Andy Shevchenko Date: Wed May 20 19:49:25 2020 +0300 irqdomain: Make __irq_domain_add() less OF-dependent __irq_domain_add() relies in some places on the fact that the fwnode can be only of type OF. This prevents refactoring of the code to support other types of fwnode. Make it less OF-dependent by switching it to use the fwnode directly where it makes sense. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200520164927.39090-1-andriy.shevchenko@linux.intel.com commit 9f8872221674f4733b41022490de973d9778da59 Author: Hsin-Hsiung Wang Date: Tue Apr 21 11:00:12 2020 +0800 arm64: dts: mt6358: add PMIC MT6358 related nodes add PMIC MT6358 related nodes which is for MT8183 platform Signed-off-by: Hsin-Hsiung Wang Link: https://lore.kernel.org/r/1587438012-24832-7-git-send-email-hsin-hsiung.wang@mediatek.com Signed-off-by: Matthias Brugger commit 2cd38fd15e4ebcfe917a443734820269f8b5ba2b Author: Saravana Kannan Date: Tue May 19 20:48:21 2020 -0700 driver core: Remove unnecessary is_fwnode_dev variable in device_add() That variable is no longer necessary. Remove it and also fix a minor typo in comments. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200520034824.79049-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 114dbb4fa7c4053a51964d112e2851e818e085c6 Author: Andy Shevchenko Date: Wed May 20 13:29:59 2020 +0300 drivers property: When no children in primary, try secondary Software firmware nodes can provide a child node to its parent. Since software node can be secondary, we need a mechanism to access the children. The idea is to list children of the primary node first and when they are finished, continue with secondary node if available. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Acked-by: Sakari Ailus Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200520102959.34812-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c82c83c330654c5639960ebc3dabbae53c43f79e Author: Tang Bin Date: Wed May 20 22:12:02 2020 +0800 driver core: platform: Fix spelling errors in platform.c There is a word spelling mistake of 'Unegisters', thus it should be fixed. Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200520141202.19568-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit bf04362fc3e41d0887090ce174a8373653811a7c Author: John Oldman Date: Thu May 21 09:47:32 2020 +0100 staging: rtl8192e: Using comparison to true is error prone clear below issues reported by checkpatch.pl: CHECK: Using comparison to true is error prone CHECK: Using comparison to false is error prone Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200521084732.12576-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit f37d13d52c0560bd2bac40b22466af538e61a5ce Author: Colin Ian King Date: Tue May 19 16:45:53 2020 +0100 w1_therm: remove redundant assignments to variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200519154553.873413-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit e420637b81f78d0fbacf539bdb1b341eba602aea Author: Dan Carpenter Date: Wed May 20 15:00:19 2020 +0300 w1_therm: Free the correct variable The problem is that we change "p_args" to point to the middle of the string so when we free it at the end of the function it's not freeing the same pointer that we originally allocated. Fixes: e2c94d6f5720 ("w1_therm: adding alarm sysfs entry") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200520120019.GA172354@mwanda Signed-off-by: Greg Kroah-Hartman commit 728774f7801629226a0c7bd9f9af6ff1dfcb5ca5 Author: Mitchell Tasman Date: Mon May 18 20:45:31 2020 -0400 staging: vchiq_arm: cast with __force as needed In several cases where a pointer marked as __user is (intentionally) assigned or passed to a non-marked target, cast to the target pointer type with a __force directive to quiet warnings from sparse. Signed-off-by: Mitchell Tasman Link: https://lore.kernel.org/r/20200519004531.33158-1-tasman@leaflabs.com Signed-off-by: Greg Kroah-Hartman commit 49f09554fd861d1d47c28d6b0add088c80898238 Author: John Oldman Date: Wed May 20 17:37:19 2020 +0100 staging: rtl8192e: Using comparison to true is error prone fix below issue reported by checkpatch.pl: CHECK: Using comparison to true is error prone CHECK: Using comparison to false is error prone Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200520163719.14463-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit 29ee40091e27615530c0ba7773a2879d8266381e Author: Ran Bi Date: Tue Apr 21 11:00:11 2020 +0800 rtc: mt6397: Add support for the MediaTek MT6358 RTC This add support for the MediaTek MT6358 RTC. Driver using compatible data to store different RTC_WRTGR address offset. This replace RTC_WRTGR to RTC_WRTGR_MT6323 in mt6323-poweroff driver which only needed by armv7 CPU without ATF. Signed-off-by: Ran Bi Signed-off-by: Hsin-Hsiung Wang Reviewed-by: Nicolas Boichat Acked-by: Alexandre Belloni Acked-by: Sebastian Reichel Reviewed-by: Yingjoe Chen Signed-off-by: Lee Jones commit 2b91c28f2abd9471aac4aa6cd8de7896ef469153 Author: Hsin-Hsiung Wang Date: Tue Apr 21 11:00:10 2020 +0800 mfd: Add support for the MediaTek MT6358 PMIC This adds support for the MediaTek MT6358 PMIC. This is a multifunction device with the following sub modules: - Regulator - RTC - Codec - Interrupt It is interfaced to the host controller using SPI interface by a proprietary hardware called PMIC wrapper or pwrap. MT6358 MFD is a child device of the pwrap. Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Lee Jones commit 6c3d5c97d260177bfe24b533e80df8500115be2f Author: Hsin-Hsiung Wang Date: Tue Apr 21 11:00:09 2020 +0800 dt-bindings: mfd: Add compatible for the MediaTek MT6358 PMIC This adds compatible for the MediaTek MT6358 PMIC. Signed-off-by: Hsin-Hsiung Wang Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit d0c7347dc78f059fa2579a32f444b378589ad7f0 Author: Hsin-Hsiung Wang Date: Tue Apr 21 11:00:08 2020 +0800 mfd: mt6397: Trim probe function to support different chips more cleanly Add new struct members for mfd-cells and irq initial function, so we can call devm_mfd_add_devices() only once. Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Lee Jones commit 4e2e7cfec13afa41fcbed1d9b93d83432aa0154f Author: Hsin-Hsiung Wang Date: Tue Apr 21 11:00:07 2020 +0800 mfd: mt6397: Modify suspend/resume behavior Some pmics don't need backup interrupt settings, so we change to use pm notifier for the pmics which are necessary to store settings. Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Lee Jones commit e9ccc35b86653cb15e9bffbe2cbef8781ea2c1dd Author: Bryan O'Donoghue Date: Wed May 20 16:36:17 2020 +0100 usb: typec: Ensure USB_ROLE_SWITCH is set as a dependency for tps6598x When I switched on USB role switching for the tps6598x I completely forgot to add the Kconfig dependency. Ensure USB_ROLE_SWITCH is selected to prevent the typs6598x driver being compiled in but the role-switch driver being compiled as a module, leading to link error. Suggested-by: Heikki Krogerus Signed-off-by: Bryan O'Donoghue Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200520153617.610909-1-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit bbb5946eb545fab8ad8f46bce8a803e1c0c39d47 Author: Serge Semin Date: Thu May 21 03:34:37 2020 +0300 mips: MAAR: Use more precise address mask Indeed according to the MIPS32 Privileged Resource Architecgture the MAAR pair register address field either takes [12:31] bits for non-XPA systems and [12:55] otherwise. In any case the current address mask is just wrong for 64-bit and 32-bits XPA chips. So lets extend it to 59-bits of physical address value. This shall cover the 64-bits architecture and systems with XPA enabled, and won't cause any problem for non-XPA 32-bit systems, since address values exceeding the architecture specific MAAR mask will be just truncated with setting zeros in the unsupported upper bits. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 37e2bc4433a9d68f6d4c8e3fe5ef3a77609bbe8d Author: Tiezhu Yang Date: Wed May 20 15:08:02 2020 +0800 MIPS: SGI-IP27: Remove not used definition TICK_SIZE in ip27-timer.c After commit f5ff0a280201 ("[MIPS] Use generic NTP code for all MIPS platforms"), TICK_SIZE is not used in ip27-timer.c for many years, remove it. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit d66358cae25efbd35518d661991fce67af2945e7 Author: Andre Guedes Date: Fri Apr 10 17:28:32 2020 -0700 igc: Remove mac_table from igc_adapter In igc_adapter we keep a sort of shadow copy of RAL and RAH registers. There is not much benefit in keeping it, at the cost of maintainability, since adding/removing MAC address filters is not hot path, and we already keep filters information in adapter->nfc_filter_list for cleanup and restoration purposes. So in order to simplify the MAC address filtering code and prepare it for source address support, this patch removes the mac_table from igc_adapter. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 1c3739cb6e7ac5b5372438bf91b3d0404d18ecf9 Author: Andre Guedes Date: Fri Apr 10 17:28:31 2020 -0700 igc: Remove IGC_MAC_STATE_SRC_ADDR flag MAC address filters based on source address are not currently supported by the IGC driver. Despite of that, the driver have some dangling code to handle it, inherited from IGB driver. This patch removes that code to prepare for a follow up patch that adds proper source MAC address filter support. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit de1b99ef2aa1e982c86b15853e013c6e3dbc1e7a Merge: c536fc74b4b4 e5264212eb62 Author: David S. Miller Date: Wed May 20 19:27:57 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-05-19 This series contains updates to igc only. Sasha cleans up the igc driver code that is not used or needed. Vitaly cleans up driver code that was used to support Virtualization on a device that is not supported by igc, so remove the dead code. Andre renames a few macros to align with register and field names described in the data sheet. Also adds the VLAN Priority Queue Fliter and EType Queue Filter registers to the list of registers dumped by igc_get_regs(). Added additional debug messages and updated return codes for unsupported features. Refactored the VLAN priority filtering code to move the core logic into igc_main.c. Cleaned up duplicate code and useless code. ==================== Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit c536fc74b4b41ca5cfdebad60943be1ecd092ba1 Merge: f78cdbd75a57 0edecc020b33 Author: David S. Miller Date: Wed May 20 19:07:25 2020 -0700 Merge branch 'uaccess.net' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Al Viro says: ==================== uaccess-related stuff in net/* Assorted uaccess-related work in net/*. First, there's getting rid of compat_alloc_user_space() mess in MCAST_... [gs]etsockopt() - no need to play with copying to/from temporary object on userland stack, etc., when ->compat_[sg]etsockopt() instances in question can easly do everything without that. That's the first 13 patches. Then there's a trivial bit in net/batman-adv (completely unrelated to everything else) and finally getting the atm compat ioctls into simpler shape. ==================== Signed-off-by: David S. Miller commit c41219fda6e04255c44d37fd2c0d898c1c46abf1 Merge: e20bb857dea2 d96536f0fe69 Author: Dave Airlie Date: Thu May 21 10:44:32 2020 +1000 Merge tag 'drm-intel-next-fixes-2020-05-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Fix for TypeC power domain toggling on resets (Cc: stable). Two compile time warning fixes. Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200520123227.GA21104@jlahtine-desk.ger.corp.intel.com commit 0edecc020b33f8e31d8baa80735b45e8e8434700 Author: Al Viro Date: Sun May 10 18:13:56 2020 -0400 atm: switch do_atmif_sioc() to direct use of atm_dev_ioctl() Signed-off-by: Al Viro commit 8cacb4165985444c275a6f813f91f08479bdbfad Author: Al Viro Date: Sun May 10 17:53:35 2020 -0400 atm: lift copyin from atm_dev_ioctl() Signed-off-by: Al Viro commit 36085049bc0acb6f2e784f430c2cc66944a2ef07 Author: Al Viro Date: Sun May 10 17:41:51 2020 -0400 atm: switch do_atm_iobuf() to direct use of atm_getnames() ... and sod the compat_alloc_user_space() with its complications Signed-off-by: Al Viro commit a3929484af75ee524419edbbc4e9ce012c3d67c9 Author: Al Viro Date: Sun May 10 17:34:20 2020 -0400 atm: move copyin from atm_getnames() into the caller Signed-off-by: Al Viro commit 8c2348e36af0da79477b0726781da297263269a4 Author: Al Viro Date: Sun May 10 17:20:49 2020 -0400 atm: separate ATM_GETNAMES handling from the rest of atm_dev_ioctl() atm_dev_ioctl() does copyin in two different ways - one for ATM_GETNAMES, another for everything else. Start with separating the former into a new helper (atm_getnames()). The next step will be to lift the copyin into the callers. Signed-off-by: Al Viro commit 38c53ca3c114fa2a7030f0d1f54feaf044957609 Author: Al Viro Date: Thu Apr 23 10:19:04 2020 -0400 batadv_socket_read(): get rid of pointless access_ok() address is passed only to copy_to_user() Signed-off-by: Al Viro commit bbced07d9952ca290e8de3957c75b8b401d7a867 Author: Al Viro Date: Mon Apr 27 11:37:02 2020 -0400 get rid of compat_mc_setsockopt() not used anymore Signed-off-by: Al Viro commit b212c322c8d73c48062340dc4cbe150c4ce97fb8 Author: Al Viro Date: Mon Apr 27 11:37:02 2020 -0400 handle the group_source_req options directly Native ->setsockopt() handling of these options (MCAST_..._SOURCE_GROUP and MCAST_{,UN}BLOCK_SOURCE) consists of copyin + call of a helper that does the actual work. The only change needed for ->compat_setsockopt() is a slightly different copyin - the helpers can be reused as-is. Signed-off-by: Al Viro commit fcfa0b09d3f794af66cf8bcee03ddb7055934742 Author: Al Viro Date: Mon Apr 27 11:00:01 2020 -0400 ipv6: take handling of group_source_req options into a helper Signed-off-by: Al Viro commit 2bbf8c1ead651c65bd0f7b6ba6d57cb09e2d1a57 Author: Al Viro Date: Mon Apr 27 10:49:26 2020 -0400 ipv4: take handling of group_source_req options into a helper Signed-off-by: Al Viro commit 2f984f11fdc06bcfd5bb528d07a93c20301dd068 Author: Al Viro Date: Sun Apr 26 19:56:22 2020 -0400 ipv[46]: do compat setsockopt for MCAST_{JOIN,LEAVE}_GROUP directly direct parallel to the way these two are handled in the native ->setsockopt() instances - the helpers that do the real work are already separated and can be reused as-is in this case. Signed-off-by: Al Viro commit 168a2cca81438aef819e43feb161614488dee97b Author: Al Viro Date: Mon Mar 30 16:40:04 2020 -0400 ipv6: do compat setsockopt for MCAST_MSFILTER directly similar to the ipv4 counterpart of that patch - the same trick used to align the tail array properly. Signed-off-by: Al Viro commit d59eb177c84f9572a6b51024c0b2611c3b5a27c5 Author: Al Viro Date: Mon Mar 30 15:43:10 2020 -0400 ip6_mc_msfilter(): pass the address list separately that way we'll be able to reuse it for compat case Signed-off-by: Al Viro commit 2e04172875c9daf929659eb5c3ef4b98fdf34396 Author: Al Viro Date: Mon Mar 30 15:39:43 2020 -0400 ipv4: do compat setsockopt for MCAST_MSFILTER directly Parallel to what the native setsockopt() does, except that unlike the native setsockopt() we do not use memdup_user() - we want the sockaddr_storage fields properly aligned, so we allocate 4 bytes more and copy compat_group_filter at the offset 4, which yields the proper alignments. Signed-off-by: Al Viro commit e986d4dabcb8fab87b36b607bc710e42fe206baf Author: Al Viro Date: Sun Mar 29 22:37:56 2020 -0400 set_mcast_msfilter(): take the guts of setsockopt(MCAST_MSFILTER) into a helper Signed-off-by: Al Viro commit 0dfe6581a7e35bafe5fc4d9b84edd0e66b4fd78a Author: Al Viro Date: Sun Mar 29 22:08:59 2020 -0400 get rid of compat_mc_getsockopt() now we can do MCAST_MSFILTER in compat ->getsockopt() without playing silly buggers with copying things back and forth. We can form a native struct group_filter (sans the variable-length tail) on stack, pass that + pointer to the tail of original request to the helper doing the bulk of the work, then do the rest of copyout - same as the native getsockopt() does. Signed-off-by: Al Viro commit 931ca7ab7fe804d77bc6952f1512950c0d870f26 Author: Al Viro Date: Sun Mar 29 17:18:30 2020 -0400 ip*_mc_gsfget(): lift copyout of struct group_filter into callers pass the userland pointer to the array in its tail, so that part gets copied out by our functions; copyout of everything else is done in the callers. Rationale: reuse for compat; the array is the same in native and compat, the layout of parts before it is different for compat. Signed-off-by: Al Viro commit e9c375fb5edeb550786d1436784db909bf672e9f Author: Al Viro Date: Sat May 9 21:16:36 2020 -0400 compat_ip{,v6}_setsockopt(): enumerate MCAST_... options explicitly We want to check if optname is among the MCAST_... ones; do that as an explicit switch. Signed-off-by: Al Viro commit 63287de66df11308d239483415d67fe94079f47b Author: Al Viro Date: Sat May 9 20:58:17 2020 -0400 lift compat definitions of mcast [sg]etsockopt requests into net/compat.h We want to get rid of compat_mc_[sg]etsockopt() and to have that stuff handled without compat_alloc_user_space(), extra copying through userland, etc. To do that we'll need ipv4 and ipv6 instances of ->compat_[sg]etsockopt() to manipulate the 32bit variants of mcast requests, so we need to move the definitions of those out of net/compat.c and into a public header. This patch just does a mechanical move to include/net/compat.h Signed-off-by: Al Viro commit e20bb857dea2f620ff37ae541ed8aee70e3c89f1 Merge: 6cf991611bc7 f84e1ba336a4 Author: Dave Airlie Date: Thu May 21 10:24:37 2020 +1000 Merge tag 'exynos-drm-next-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Check imported buffer mapping in generic way - This patch reworks exynos_drm_gem_prime_import_sg_table function, which checks if the imported buffer has been mapped as contiguous or not in generic way, and flag a exynos gem buffer type properly according to the mapped way. Fixups - Drop a reference count to in_bridge_node correctly. - Enable the runtime power management correctly. . The runtime pm should be enabled before calling compont_add(). Cleanups - Do not register "by hand" a sysfs file, and use dev_groups instead. - Drop internal 'pages' array which aren't needed. - Remove dead-code. - Correct type casting. - Drop unnecessary error messages. Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/1589952785-24210-1-git-send-email-inki.dae@samsung.com commit b2cb68e864222eb3cc1d7c3c06edc40469699983 Author: Johan Jonker Date: Tue May 19 13:14:44 2020 +0200 arm64: dts: rockchip: fix pinctrl-names for gpio-leds node on rk3326-odroid-go2 The 'pinctrl-names' property should contain a list of names to the assigned states. The value 'led_pins' in the gpio-leds node on rk3326-odroid-go2 is not a state that is normally used, so change it the common name 'default'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200519111444.2208-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 0df3ff451287d71c620384eb7bb2cd3a8106412c Author: Mark Pearson Date: Mon May 18 22:56:35 2020 -0400 drm/dp: Lenovo X13 Yoga OLED panel brightness fix Add another panel that needs the edid quirk to the list so that brightness control works correctly. Fixes issue seen on Lenovo X13 Yoga with OLED panel Co-developed-by: jendrina@lenovo.com Signed-off-by: Mark Pearson [fixed commit message, sobs] Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200519025635.22846-1-mpearson@lenovo.com commit 9d44a121c5a79bc8a9d67c058456bd52a83c79e7 Author: Richard Guy Briggs Date: Wed May 20 14:47:13 2020 -0400 audit: add subj creds to NETFILTER_CFG record to Some table unregister actions seem to be initiated by the kernel to garbage collect unused tables that are not initiated by any userspace actions. It was found to be necessary to add the subject credentials to cover this case to reveal the source of these actions. A sample record: The uid, auid, tty, ses and exe fields have not been included since they are in the SYSCALL record and contain nothing useful in the non-user context. Here are two sample orphaned records: type=NETFILTER_CFG msg=audit(2020-05-20 12:14:36.505:5) : table=filter family=ipv4 entries=0 op=register pid=1 subj=kernel comm=swapper/0 type=NETFILTER_CFG msg=audit(2020-05-20 12:15:27.701:301) : table=nat family=bridge entries=0 op=unregister pid=30 subj=system_u:system_r:kernel_t:s0 comm=kworker/u4:1 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 4a3a37331248d85df9e05e9b1d8210dc5ec81f4e Author: Yash Shah Date: Thu Feb 20 10:45:19 2020 +0530 riscv: Add support to determine no. of L2 cache way enabled In order to determine the number of L2 cache ways enabled at runtime, implement a private attribute ("number_of_ways_enabled"). Reading this attribute returns the number of enabled L2 cache ways at runtime. Using riscv_set_cacheinfo_ops() hook a custom function, that returns this private attribute, to the generic ops structure which is used by cache_get_priv_group() in cacheinfo framework. Signed-off-by: Yash Shah Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 087958a17658dcd92cdc9292e6ce4319a25198fb Author: Yash Shah Date: Thu Feb 20 10:45:18 2020 +0530 riscv: cacheinfo: Implement cache_get_priv_group with a generic ops structure Implement cache_get_priv_group() that will make use of a generic ops structure to return a private attribute group for custom cache info. Using riscv_set_cacheinfo_ops() users can hook their own custom function to return the private attribute group for cacheinfo. In future we can add more ops to this generic ops structure for SOC specific cacheinfo. Signed-off-by: Yash Shah Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 0b928e4e412b1eb9e79e02cf3580b9254d338aae Author: Christian Hewitt Date: Wed May 20 01:43:29 2020 +0000 arm64: dts: meson-g12b-gtking-pro: add initial device-tree The Shenzen AZW (Beelink) GT-King Pro is based on the Amlogic W400 reference board with an S922X chip. - 4GB LPDDR4 RAM - 64GB eMMC storage - 10/100/1000 Base-T Ethernet - AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1) - HDMI 2.1 video - Analogue audio output - 1x RS232 port - 2x USB 2.0 port - 2x USB 3.0 ports - IR receiver - 1x micro SD card slot - 1x Power on/off button Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200520014329.12469-6-christianshewitt@gmail.com commit 8d4b8772296f88e0b6bf5d091ebf25a54e51882c Author: Christian Hewitt Date: Wed May 20 01:43:28 2020 +0000 dt-bindings: arm: amlogic: add support for the Beelink GT-King Pro The Shenzen AZW (Beelink) GT-King Pro is based on the Amlogic W400 reference board with an S922X chip. Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200520014329.12469-5-christianshewitt@gmail.com commit c5522ff9c7299f9845df3fd521d51a1ef7617ac7 Author: Christian Hewitt Date: Wed May 20 01:43:27 2020 +0000 arm64: dts: meson-g12b-gtking: add initial device-tree The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference board with an S922X chip. - 4GB LPDDR4 RAM - 64GB eMMC storage - 10/100/1000 Base-T Ethernet - AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1) - HDMI 2.1 video - S/PDIF optical output - Analogue audio output - 1x USB 2.0 port - 2x USB 3.0 ports - IR receiver - 1x micro SD card slot Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200520014329.12469-4-christianshewitt@gmail.com commit 3a90ef281f852db9900024116e8ea93a49115df9 Author: Christian Hewitt Date: Wed May 20 01:43:26 2020 +0000 dt-bindings: arm: amlogic: add support for the Beelink GT-King The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference board with an S922X chip. Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200520014329.12469-3-christianshewitt@gmail.com commit 3cb74db9b2561a25701b9024b9d5c0077c43e214 Author: Christian Hewitt Date: Wed May 20 01:43:25 2020 +0000 arm64: dts: meson: convert ugoos-am6 to common w400 dtsi Convert the Ugoos AM6 dts into meson-g12b-w400.dtsi, and then create a new AM6 dts that references it. This is in preparation for several new G12B devices that will share the common w400 dtsi. Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200520014329.12469-2-christianshewitt@gmail.com commit f2453978a4f2ddb1938fa80e9bf0c9d6252bd5f8 Author: Chuck Lever Date: Mon Apr 6 16:01:42 2020 -0400 NFSD: Fix improperly-formatted Doxygen comments fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'file' not described in 'write_unlock_ip' fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'buf' not described in 'write_unlock_ip' fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'size' not described in 'write_unlock_ip' fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'file' not described in 'write_unlock_fs' fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'buf' not described in 'write_unlock_fs' fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'size' not described in 'write_unlock_fs' fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'file' not described in 'write_filehandle' fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'buf' not described in 'write_filehandle' fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'size' not described in 'write_filehandle' fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'file' not described in 'write_threads' fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'buf' not described in 'write_threads' fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'size' not described in 'write_threads' fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'file' not described in 'write_pool_threads' fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'buf' not described in 'write_pool_threads' fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'size' not described in 'write_pool_threads' fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'file' not described in 'write_versions' fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'buf' not described in 'write_versions' fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'size' not described in 'write_versions' fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'file' not described in 'write_ports' fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'buf' not described in 'write_ports' fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'size' not described in 'write_ports' fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'file' not described in 'write_maxblksize' fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'buf' not described in 'write_maxblksize' fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'size' not described in 'write_maxblksize' fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'file' not described in 'write_maxconn' fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'buf' not described in 'write_maxconn' fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'size' not described in 'write_maxconn' fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'file' not described in 'write_leasetime' fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'buf' not described in 'write_leasetime' fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'size' not described in 'write_leasetime' fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'file' not described in 'write_gracetime' fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'buf' not described in 'write_gracetime' fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'size' not described in 'write_gracetime' fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'file' not described in 'write_recoverydir' fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'buf' not described in 'write_recoverydir' fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'size' not described in 'write_recoverydir' fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'file' not described in 'write_v4_end_grace' fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'buf' not described in 'write_v4_end_grace' fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'size' not described in 'write_v4_end_grace' fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'nss' not described in 'nfsd4_interssc_connect' fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'rqstp' not described in 'nfsd4_interssc_connect' fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'mount' not described in 'nfsd4_interssc_connect' fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'rqstp' not described in 'nfsd4_setup_inter_ssc' fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'cstate' not described in 'nfsd4_setup_inter_ssc' fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'copy' not described in 'nfsd4_setup_inter_ssc' fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'mount' not described in 'nfsd4_setup_inter_ssc' Signed-off-by: Chuck Lever commit 45f56da8224e6bc472320b154ca8821e50fc1819 Author: Chuck Lever Date: Sun Apr 5 14:40:25 2020 -0400 NFSD: Squash an annoying compiler warning Clean up: Fix gcc empty-body warning when -Wextra is used. ../fs/nfsd/nfs4state.c:3898:3: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] Signed-off-by: Chuck Lever commit 8954c5c212d321404a7aaf5b48f04a49655c928d Author: Chuck Lever Date: Wed Apr 15 09:05:26 2020 -0400 SUNRPC: Clean up request deferral tracepoints - Rename these so they are easy to enable and search for as a set - Move the tracepoints to get a more accurate sense of control flow - Tracepoints should not fire on xprt shutdown - Display memory address in case data structure had been corrupted - Abandon dprintk in these paths I haven't ever gotten one of these tracepoints to trigger. I wonder if we should simply remove them. Signed-off-by: Chuck Lever commit 1eace0d1e9d0db393be87572f79f6a07405461e9 Author: Chuck Lever Date: Sun Apr 5 14:15:29 2020 -0400 NFSD: Add tracepoints for monitoring NFSD callbacks Signed-off-by: Chuck Lever commit dd5e3fbc1f472951afd7e7643ace5d1672b31358 Author: Chuck Lever Date: Sun Apr 5 11:42:29 2020 -0400 NFSD: Add tracepoints to the NFSD state management code Capture obvious events and replace dprintk() call sites. Introduce infrastructure so that adding more tracepoints in this code later is simplified. Signed-off-by: Chuck Lever commit 0b175b18648ebedfe255b11a7792f1d76848a8f7 Author: Chuck Lever Date: Sat May 2 11:34:40 2020 -0400 NFSD: Add tracepoints to NFSD's duplicate reply cache Try to capture DRC failures. Two additional clean-ups: - Introduce Doxygen-style comments for the main entry points - Remove a dprintk that fires for an allocation failure. This was the only dprintk in the REPCACHE class. Reported-by: kbuild test robot [ cel: force typecast for display of checksum values ] Signed-off-by: Chuck Lever commit d88ff9587bce1c962835017d2b2c449b2e6bb500 Author: Chuck Lever Date: Wed Apr 15 09:47:41 2020 -0400 SUNRPC: svc_show_status() macro should have enum definitions Clean up: Add missing TRACE_DEFINE_ENUMs in include/trace/events/sunrpc.h Signed-off-by: Chuck Lever commit fff1ebb269b6c18b21bc0ddab7dd8b0c5e68e0a1 Author: Chuck Lever Date: Wed May 20 17:30:24 2020 -0400 SUNRPC: Restructure svc_udp_recvfrom() Clean up. At this point, we are not ready yet to support bio_vecs in the UDP transport implementation. However, we can clean up svc_udp_recvfrom() to match the tracing and straight-lining recently changes made in svc_tcp_recvfrom(). Signed-off-by: Chuck Lever commit ca07eda33e01eafa7a26ec06974f7eacee6a89c8 Author: Chuck Lever Date: Wed May 20 17:30:12 2020 -0400 SUNRPC: Refactor svc_recvfrom() This function is not currently "generic" so remove the documenting comment and rename it appropriately. Its internals are converted to use bio_vecs for reading from the transport socket. In existing typical sunrpc uses of bio_vecs, the bio_vec array is allocated dynamically. Here, instead, an array of bio_vecs is added to svc_rqst. The lifetime of this array can be greater than one call to xpo_recvfrom(): - Multiple calls to xpo_recvfrom() might be needed to read an RPC message completely. - At some later point, rq_arg.bvecs will point to this array and it will carry the received message into svc_process(). I also expect that a future optimization will remove either the rq_vec or rq_pages array in favor of rq_bvec, thus conserving the size of struct svc_rqst. Signed-off-by: Chuck Lever commit a16b7dee302d2040d9e1fedff2161d1aceda0e8c Author: Hannes Reinecke Date: Tue May 19 10:14:23 2020 +0200 dm zoned: terminate reclaim on congestion When dmz_get_chunk_mapping() selects a zone which is under reclaim we should terminate the reclaim copy process. Since we're changing the zone itself, reclaim needs to run afterwards again anyway. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit c5c7885952927384837a070793698d996cb0fbf3 Author: Hannes Reinecke Date: Tue May 19 10:14:22 2020 +0200 dm zoned: start reclaim with sequential zones Sequential zones perform better for reclaim, so start off using them and only use random zones as a fallback when cache zones are present. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 90a9b8693f1b84a695864f2b416cba9bde107268 Author: Hannes Reinecke Date: Tue May 19 10:14:21 2020 +0200 dm zoned: reclaim random zones when idle When the system is idle we should be starting reclaiming random zones, too. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 34f5affd04c4a16d9df19c369bcec6e873e57ffe Author: Hannes Reinecke Date: Tue May 19 10:14:20 2020 +0200 dm zoned: separate random and cache zones Instead of lumping emulated zones together with random zones we should be handling them as separate 'cache' zones. This improves code readability and allows an easier implementation of different cache policies. Also add additional allocation flags, to separate the type (cache, random, or sequential) from the purpose (eg reclaim). Also switch the allocation policy to not use random zones as buffer zones if cache zones are present. This avoids a performance drop when all cache zones are used. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 489dc0f06a5837f87482c0ce61d830d24e17082e Author: Hannes Reinecke Date: Tue May 19 10:14:19 2020 +0200 dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone The only case where dmz_get_zone_for_reclaim() cannot return a zone is if the respective lists are empty. So we should just return a simple NULL value here as we really don't have an error code which would make sense. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 42c689f671233371f5c8c1685ab77bd66c274932 Author: Nathan Chancellor Date: Wed May 13 01:45:22 2020 -0700 dm zoned: Avoid 64-bit division error in dmz_fixup_devices When building arm32 allyesconfig: ld.lld: error: undefined symbol: __aeabi_uldivmod >>> referenced by dm-zoned-target.c >>> md/dm-zoned-target.o:(dmz_ctr) in archive drivers/built-in.a dmz_fixup_devices uses DIV_ROUND_UP with variables of type sector_t. As such, it should be using DIV_ROUND_UP_SECTOR_T, which handles this automatically. Fixes: 70978208ec91 ("dm zoned: metadata version 2") Signed-off-by: Nathan Chancellor Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit ac75b09fc62df441eee90fecfe9b2a6ca24976f2 Author: Mike Snitzer Date: Thu May 14 12:55:39 2020 -0400 dm: use DMDEBUG macros now that they use pr_debug variants Now that DMDEBUG uses pr_debug and DMDEBUG_LIMIT uses pr_debug_ratelimited cleanup DM's 2 direct pr_debug callers to use them to get the benefit of consistent DM_FMT formatting of debugging messages. While doing so, dm-mpath.c:dm_report_EIO() was switched over to using DMDEBUG_LIMIT due to the potential for error handling floods in the IO completion path. Signed-off-by: Mike Snitzer commit 49de3b7d21ef12e03358aa77ad6bff4aaf5ac3f5 Author: Hannes Reinecke Date: Thu May 14 08:09:29 2020 +0200 dm zoned: remove spurious newlines from debugging messages DMDEBUG will already add a newline to the logging messages, so we shouldn't be adding it to the message itself. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 74244b59a82358b9f51c80981a99c5951ea3028f Author: Hannes Reinecke Date: Thu May 14 08:09:28 2020 +0200 dm: use dynamic debug instead of compile-time config option Switch to use dynamic debug to avoid having recompile the kernel just to enable debugging messages. Signed-off-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit b18ae8dd9d7685233d7be472c043c545f18d015a Author: Gustavo A. R. Silva Date: Thu May 7 13:51:58 2020 -0500 dm: replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mike Snitzer commit bd5c40313a1467e4683d92456fc5219d94823f24 Author: Hannes Reinecke Date: Mon May 11 10:24:30 2020 +0200 dm zoned: metadata version 2 Implement handling for metadata version 2. The new metadata adds a label and UUID for the device mapper device, and additional UUID for the underlying block devices. It also allows for an additional regular drive to be used for emulating random access zones. The emulated zones will be placed logically in front of the zones from the zoned block device, causing the superblocks and metadata to be stored on that device. The first zone of the original zoned device will be used to hold another, tertiary copy of the metadata; this copy carries a generation number of 0 and is never updated; it's just used for identification. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit f78cdbd75a57245ecc68f5a40e470933426a082b Author: John Hubbard Date: Wed May 20 12:41:47 2020 -0700 rds: fix crash in rds_info_getsockopt() The conversion to pin_user_pages() had a bug: it overlooked the case of allocation of pages failing. Fix that by restoring an equivalent check. Reported-by: syzbot+118ac0af4ac7f785a45b@syzkaller.appspotmail.com Fixes: dbfe7d74376e ("rds: convert get_user_pages() --> pin_user_pages()") Cc: David S. Miller Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: linux-rdma@vger.kernel.org Cc: rds-devel@oss.oracle.com Signed-off-by: John Hubbard Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit dc076c838f65723325001c977b39e55fc6ba0fa7 Author: Hannes Reinecke Date: Mon May 11 10:24:29 2020 +0200 dm zoned: ignore metadata zone in dmz_alloc_zone() When looking up zones in dmz_alloc_zone() we need to ignore metadata zones so as not to accidentally overwrite metadata. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit ae3c1f1171467f83849c7e8c5e0e632c5078ca2f Author: Hannes Reinecke Date: Mon May 11 10:24:28 2020 +0200 dm zoned: Reduce logging output on startup dm-zoned is becoming quite chatty during startup; reduce the noise by moving some information to 'debug' level. Suggested-by: Mike Snitzer Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit ca1a70450a969c63dd19f0a34504fa1bd227e730 Author: Hannes Reinecke Date: Mon May 11 10:24:27 2020 +0200 dm zoned: add metadata logging functions Use the metadata label for logging and not the underlying device. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit b8bff599261c930630385ee21d3f98e7ce7d4843 Author: Eric W. Biederman Date: Sun Mar 22 15:46:24 2020 -0500 exec: Factor security_bprm_creds_for_exec out of security_bprm_set_creds Today security_bprm_set_creds has several implementations: apparmor_bprm_set_creds, cap_bprm_set_creds, selinux_bprm_set_creds, smack_bprm_set_creds, and tomoyo_bprm_set_creds. Except for cap_bprm_set_creds they all test bprm->called_set_creds and return immediately if it is true. The function cap_bprm_set_creds ignores bprm->calld_sed_creds entirely. Create a new LSM hook security_bprm_creds_for_exec that is called just before prepare_binprm in __do_execve_file, resulting in a LSM hook that is called exactly once for the entire of exec. Modify the bits of security_bprm_set_creds that only want to be called once per exec into security_bprm_creds_for_exec, leaving only cap_bprm_set_creds behind. Remove bprm->called_set_creds all of it's former users have been moved to security_bprm_creds_for_exec. Add or upate comments a appropriate to bring them up to date and to reflect this change. Link: https://lkml.kernel.org/r/87v9kszrzh.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Acked-by: Casey Schaufler # For the LSM and Smack bits Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit 87b047d2be417b271d80f5e490a825c6fd53ecad Author: Eric W. Biederman Date: Mon Mar 16 12:21:12 2020 -0500 exec: Teach prepare_exec_creds how exec treats uids & gids It is almost possible to use the result of prepare_exec_creds with no modifications during exec. Update prepare_exec_creds to initialize the suid and the fsuid to the euid, and the sgid and the fsgid to the egid. This is all that is needed to handle the common case of exec when nothing special like a setuid exec is happening. That this preserves the existing behavior of exec can be verified by examing bprm_fill_uid and cap_bprm_set_creds. This change makes it clear that the later parts of exec that update bprm->cred are just need to handle special cases such as setuid exec and change of domains. Link: https://lkml.kernel.org/r/871rng22dm.fsf_-_@x220.int.ebiederm.org Acked-by: Linus Torvalds Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit cca557a5a60faaf307bbb76035dd90ec47cf0e0c Author: Chuck Lever Date: Wed May 20 12:53:05 2020 -0400 SUNRPC: Clean up svc_release_skb() functions Rename these functions using the convention used for other xpo method entry points. Signed-off-by: Chuck Lever commit 6be8c5949149ff45c86dd9e49dfab920078bfcd5 Author: Chuck Lever Date: Wed May 20 12:29:13 2020 -0400 SUNRPC: Refactor recvfrom path dealing with incomplete TCP receives Clean up: move exception processing out of the main path. Signed-off-by: Chuck Lever commit 7dae1dd726aac7871d9cc56ed9d13fa09c0212f9 Author: Chuck Lever Date: Wed May 20 13:41:02 2020 -0400 SUNRPC: Replace dprintk() call sites in TCP receive path Signed-off-by: Chuck Lever commit 7dcef3988eedbfb40e7e95a821966a029a5a465b Author: Dan Carpenter Date: Wed May 20 15:07:05 2020 +0300 remoteproc: Fix an error code in devm_rproc_alloc() The comments say that this function should return NULL on error and the caller expects NULL returns as well so I have modified the code to match. Returning an ERR_PTR(-ENOMEM) would lead to an OOps. Reviewed-by: Paul Cercueil Reviewed-by: Bjorn Andersson Fixes: 305ac5a766b1 ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200520120705.GH172354@mwanda Signed-off-by: Bjorn Andersson commit a4fb17465182c9fc13104e4df04d050892055205 Author: Sudeep Holla Date: Mon May 18 10:12:21 2020 +0100 firmware: smccc: Add function to fetch SMCCC version For backward compatibility reasons, PSCI maintains SMCCC version as SMCCC didn't provide ARM_SMCCC_VERSION_FUNC_ID until v1.1. PSCI initialises both the SMCCC version and conduit. Similar to the conduit, let us provide accessors to fetch the SMCCC version also so that other SMCCC v1.1+ features can use it. Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Steven Price Reviewed-by: Etienne Carriere Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200518091222.27467-7-sudeep.holla@arm.com Signed-off-by: Will Deacon commit f2ae97062a48b114bcf8fb2e99574d9ed2c2cd1b Author: Sudeep Holla Date: Mon May 18 10:12:20 2020 +0100 firmware: smccc: Refactor SMCCC specific bits into separate file In order to add newer SMCCC v1.1+ functionality and to avoid cluttering PSCI firmware driver with SMCCC bits, let us move the SMCCC specific details under drivers/firmware/smccc/smccc.c We can also drop conduit and smccc_version from psci_operations structure as SMCCC was the sole user and now it maintains those. No functionality change in this patch though. Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Etienne Carriere Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200518091222.27467-6-sudeep.holla@arm.com Signed-off-by: Will Deacon commit ad5a57dfe434b02ab28852703d7ad5510998ccef Author: Sudeep Holla Date: Mon May 18 10:12:19 2020 +0100 firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead Instead of maintaining 2 sets of enums/macros for tracking SMCCC version, let us drop smccc_version enum and use ARM_SMCCC_VERSION_1_x directly instead. This is in preparation to drop smccc_version here and move it separately under drivers/firmware/smccc. Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Steven Price Reviewed-by: Etienne Carriere Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200518091222.27467-5-sudeep.holla@arm.com Signed-off-by: Will Deacon commit 0441bfe7f00acaae7c4937ba0ca48ee1de9b709f Author: Sudeep Holla Date: Mon May 18 10:12:18 2020 +0100 firmware: smccc: Add the definition for SMCCCv1.2 version/error codes Add the definition for SMCCC v1.2 version and new error code added. While at it, also add a note that ARM DEN 0070A is deprecated and is now merged into the main SMCCC specification(ARM DEN 0028C). Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Steven Price Reviewed-by: Etienne Carriere Link: https://lore.kernel.org/r/20200518091222.27467-4-sudeep.holla@arm.com Signed-off-by: Will Deacon commit 15c704ab6244ac95be54b2c05411b70501d50e8f Author: Sudeep Holla Date: Mon May 18 10:12:17 2020 +0100 firmware: smccc: Update link to latest SMCCC specification The current link gets redirected to the revision B published in November 2016 though it actually points to the original revision A published in June 2013. Let us update the link to point to the latest version, so that it doesn't get stale anytime soon. Currently it points to v1.2 published in March 2020(i.e. DEN0028C). Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Steven Price Reviewed-by: Etienne Carriere Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200518091222.27467-3-sudeep.holla@arm.com Signed-off-by: Will Deacon commit e5bfb21d98b660580b8cdd8a442d12d38d655d11 Author: Sudeep Holla Date: Mon May 18 10:12:16 2020 +0100 firmware: smccc: Add HAVE_ARM_SMCCC_DISCOVERY to identify SMCCC v1.1 and above SMCCC v1.0 lacked discoverability of version and features. To accelerate adoption of few mitigations and protect systems more rapidly from various vulnerability, PSCI v1.0 was updated to add SMCCC discovery mechanism though the PSCI firmware implementation of PSCI_FEATURES(SMCCC_VERSION) which returns success on firmware compliant to SMCCC v1.1 and above. This inturn makes SMCCC v1.1 and above dependent on ARM_PSCI_FW for backward compatibility. Let us introduce a new hidden config for the same to build more features on top of SMCCC v1.1 and above. While at it, also sort alphabetically the psci entry. Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Etienne Carriere Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200518091222.27467-2-sudeep.holla@arm.com Signed-off-by: Will Deacon commit 50c8ab8d9fbf5b18d5162a797ca26568afc0af1a Author: Tuan Phan Date: Wed May 20 10:13:07 2020 -0700 ACPI/IORT: Fix PMCG node single ID mapping handling An IORT PMCG node can have no ID mapping if its overflow interrupt is wire based therefore the code that parses the PMCG node can not assume the node will always have a single mapping present at index 0. Fix iort_get_id_mapping_index() by checking for an overflow interrupt and mapping count. Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG") Signed-off-by: Tuan Phan Reviewed-by: Hanjun Guo Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/1589994787-28637-1-git-send-email-tuanphan@os.amperecomputing.com Signed-off-by: Will Deacon commit f73531f0257f6bac44a8c9d5c2f3a3ccaea3d1e9 Author: Anshuman Khandual Date: Wed May 13 14:33:34 2020 +0530 arm64/cpufeature: Drop open encodings while extracting parange Currently there are multiple instances of parange feature width mask open encodings while fetching it's value. Even the width mask value (0x7) itself is not accurate. It should be (0xf) per ID_AA64MMFR0_EL1.PARange[3:0] as in ARM ARM (0487F.a). Replace them with cpuid_feature_extract_unsigned_field() which can extract given standard feature (4 bits width i.e 0xf mask) field. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: James Morse Cc: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Acked-by: Marc Zyngier Acked-by: Will Deacon Link: https://lore.kernel.org/r/1589360614-1164-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit cf51e129b96847f969bfb8af1ee1516a01a70b39 Author: Al Viro Date: Sun May 17 12:20:40 2020 -0400 sparc32: fix register window handling in genregs32_[gs]et() It needs access_process_vm() if the traced process does not share mm with the caller. Solution is similar to what sparc64 does. Note that genregs32_set() is only ever called with pos being 0 or 32 * sizeof(u32) (the latter - as part of PTRACE_SETREGS handling). Cc: stable@kernel.org Signed-off-by: Al Viro commit 05897c710e8e095abf80937e23068deb600f7b0c Author: Lukas Wunner Date: Fri May 15 17:58:04 2020 +0200 spi: bcm2835: Tear down DMA before turning off SPI controller On unbind of the BCM2835 SPI driver, the SPI controller is disabled first and the DMA channels are terminated and torn down afterwards. This seems backwards: In the theoretical case that DMA is active, it might try to fill the SPI FIFOs even after the controller has been disabled. Reverse the order, thereby mirroring what's done on ->probe(). Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/ac79f1e3d6fd9a1f5e0cb4008c43b98ea70be3c2.1589557526.git.lukas@wunner.de Signed-off-by: Mark Brown commit 85e90d9391f57436b6f7f00503de370a657420ba Author: Abhishek Pandit-Subedi Date: Wed May 20 09:32:28 2020 -0700 Bluetooth: hci_qca: Fix uninitialized access to hdev hdev is always allocated and not only when power control is required. Reported-by: Dan Carpenter Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann commit 04b24409b42a9fcae2379a6ddcf9c827b9af7a45 Author: Arvind Sankar Date: Mon May 18 15:07:16 2020 -0400 efi/libstub: Use snprintf with %ls to convert the command line Now we can use snprintf to do the UTF-16 to UTF-8 translation for the command line. Drop the special "zero" trick to handle an empty command line. This was unnecessary even before this since with options_chars == 0, efi_utf16_to_utf8 would not have accessed options at all. snprintf won't access it either with a precision of 0. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-25-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 15c316bcbc23b777eae4e21f129526190aa20af1 Author: Arvind Sankar Date: Mon May 18 15:07:15 2020 -0400 efi/libstub: Get the exact UTF-8 length efi_convert_cmdline currently overestimates the length of the equivalent UTF-8 encoding. snprintf can now be used to do the conversion to UTF-8, however, it does not have a way to specify the size of the UTF-16 string, only the size of the resulting UTF-8 string. So in order to use it, we need to precalculate the exact UTF-8 size. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-24-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit a713979e443d4036e76e13bb3d30e9fa248915aa Author: Arvind Sankar Date: Mon May 18 15:07:14 2020 -0400 efi/libstub: Use %ls for filename efi_printk can now handle the UTF-16 filename, so print it using efi_err instead of a separate efi_char16_puts call. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-23-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 4b75bd363de3f3429c62359be4e4aa4da7fa233b Author: Arvind Sankar Date: Mon May 18 15:07:13 2020 -0400 efi/libstub: Add UTF-8 decoding to efi_puts In order to be able to use the UTF-16 support added to vsprintf in the previous commit, enhance efi_puts to decode UTF-8 into UTF-16. Invalid UTF-8 encodings are passed through unchanged. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-22-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit d850a2ff918be0691f8d0544a2156c856c42da5b Author: Arvind Sankar Date: Mon May 18 15:07:12 2020 -0400 efi/printf: Add support for wchar_t (UTF-16) Support %lc and %ls to output UTF-16 strings (converted to UTF-8). Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-21-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 14c574f35cfbc9272fc67b41f074c847db139652 Author: Arvind Sankar Date: Mon May 18 15:07:11 2020 -0400 efi/gop: Add an option to list out the available GOP modes Add video=efifb:list option to list the modes that are available. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-20-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 9b47c5275614a16fd64359fab73fe6c736bf57a0 Author: Arvind Sankar Date: Mon May 18 15:07:10 2020 -0400 efi/libstub: Add definitions for console input and events Add the required typedefs etc for using con_in's simple text input protocol, and for using the boottime event services. Also add the prototype for the "stall" boot service. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-19-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 23d5b73fbfd787c4c63841912b079eac000a7414 Author: Arvind Sankar Date: Wed May 20 19:07:54 2020 +0200 efi/libstub: Implement printk-style logging Use the efi_printk function in efi_info/efi_err, and add efi_debug. This allows formatted output at different log levels. Add the notion of a loglevel instead of just quiet/not-quiet, and parse the efi=debug kernel parameter in addition to quiet. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200520170223.GA3333632@rani.riverdale.lan/ Signed-off-by: Ard Biesheuvel commit c38a4905caaf78fd7ce8ecece6d3a966933968db Merge: 73da2352075a b9dd3f6d4172 Author: Mark Brown Date: Wed May 20 17:55:07 2020 +0100 Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.8 commit c928f642c29a5ffb02e16f2430b42b876dde69de Author: Christoph Hellwig Date: Wed May 20 17:58:16 2020 +0200 fs: rename pipe_buf ->steal to ->try_steal And replace the arcane return value convention with a simple bool where true means success and false means failure. [AV: braino fix folded in] Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit b8d9e7f2411b0744df2ec33e80d7698180fef21a Author: Christoph Hellwig Date: Wed May 20 17:58:15 2020 +0200 fs: make the pipe_buf_operations ->confirm operation optional Just return 0 for success if it is not present. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 76887c256744740d6121af9bc4aa787712a1f694 Author: Christoph Hellwig Date: Wed May 20 17:58:14 2020 +0200 fs: make the pipe_buf_operations ->steal operation optional Just return 1 for failure if it is not present. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 6797d97ab9d1b0ef94bf6063920669409dc2d730 Author: Christoph Hellwig Date: Wed May 20 17:58:13 2020 +0200 trace: remove tracing_pipe_buf_ops tracing_pipe_buf_ops has identical ops to default_pipe_buf_ops, so use that instead. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit f6dd975583bd8ce088400648fd9819e4691c8958 Author: Christoph Hellwig Date: Wed May 20 17:58:12 2020 +0200 pipe: merge anon_pipe_buf*_ops All the op vectors are exactly the same, they are just used to encode packet or nomerge behavior. There already is a flag for the packet behavior, so just add a new one to allow for merging. Inverting it vs the previous nomerge special casing actually allows for much nicer code. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 00c285d0d0fe4606d20fe88f1c824962475ba880 Author: Christoph Hellwig Date: Wed May 20 17:58:11 2020 +0200 fs: simplify do_splice_from No need for a local function pointer when we can trivial branch on the ->splice_write presence. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 2bc010600d0a8add4470eb37e1ccca8aaa3d0070 Author: Christoph Hellwig Date: Wed May 20 17:58:10 2020 +0200 fs: simplify do_splice_to No need for a local function pointer when we can trivial branch on the ->splice_read presence. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 3852489c79abe31101f07e395c63cce64de0c6d6 Author: Bernard Zhao Date: Wed May 6 05:42:55 2020 -0700 drm/mediatek: Eliminate the magic number in array size Eiminate the magic number in array size, there macro defines in hdmi.h. Signed-off-by: Bernard Zhao Signed-off-by: Chun-Kuang Hu commit 3cda3d31c50cb03d41880d8c5d83ed16e16b3a9d Author: Bernard Zhao Date: Wed May 6 05:33:55 2020 -0700 drm/mediatek: Cleanup coding style in mediatek a bit This code change is to make code bit more readable. Signed-off-by: Bernard Zhao Signed-off-by: Chun-Kuang Hu commit 9a67bc4aac82d18132e8a5677926f05d43e44e77 Author: Anand K Mistry Date: Mon Apr 20 16:08:34 2020 +1000 drm/mediatek: Stop iterating dma addresses when sg_dma_len() == 0 If dma_map_sg() merges pages when creating the mapping, only the first entries will have a valid sg_dma_address() and sg_dma_len(), followed by entries with sg_dma_len() == 0. Signed-off-by: Anand K Mistry Signed-off-by: Anand K Mistry Signed-off-by: Chun-Kuang Hu commit 7c9ec2c5251851f5a3888d1a7fbb2eaf700a538a Author: Russell King Date: Wed May 13 10:33:12 2020 +0100 i2c: pxa: implement generic i2c bus recovery Implement generic GPIO-based I2C bus recovery for the PXA I2C driver. Reviewed-by: Andrew Lunn Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit a24490e0170e4cc6d4fd1f37691f19a106b694ae Merge: 9bcbabafa19b 7e73861eb40d Author: Mark Brown Date: Wed May 20 16:09:02 2020 +0100 Merge series "MAINTAINER entries for few ROHM power devices" from Matti Vaittinen : Add maintainer entries to a few ROHM devices and Linear Ranges Linear Ranges helpers were refactored out of regulator core to lib so that other drivers could utilize them too. (I guess power/supply drivers and possibly clk drivers can benefit from them). As regulators is currently the main user it makes sense the changes to linear_ranges go through Mark's tree. During past two years few ROHM PMIC drivers have been added to mainstream. They deserve a supporter from ROHM side too :) Patch 1: Maintainer entries for few ROHM IC drivers Patch 2: Maintainer entry for linear ranges helpers --- Matti Vaittinen (2): MAINTAINERS: Add entry for ROHM power management ICs MAINTAINERS: Add maintainer entry for linear ranges helper MAINTAINERS | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) base-commit: b9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce -- 2.21.0 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =] commit 7e73861eb40d591a98628592c6f0182fbf2f6c4d Author: Matti Vaittinen Date: Wed May 20 09:12:30 2020 +0300 MAINTAINERS: Add maintainer entry for linear ranges helper The linear ranges helpers were refactored out of regulator core for other drivers to enjoy. Add regulator maintainer Mark Brown as maintainer and myself as a reviewer. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/fbbbee249c6b9df3ba63bb51ea53526b22921e84.1589866138.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 52102a3ba6a617449f4b057880d73be93310a7c7 Author: Peng Fan Date: Wed May 20 13:51:29 2020 +0800 soc: imx: move cpu code to drivers/soc/imx Move the soc device register code to drivers/soc/imx to align with i.MX8. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit f72130c6b62e45df18ca7568d13f5402c2f58115 Author: Peng Fan Date: Wed May 20 13:51:28 2020 +0800 ARM: imx: move cpu definitions into a header The soc device register code will be moved to drivers/soc/imx/, the code needs the cpu type definitions. So let's move the cpu type definitions to a header. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit d2199b34871b859d33cd08398af5f1530241cb4e Author: Peng Fan Date: Wed May 20 13:51:27 2020 +0800 ARM: imx: use device_initcall for imx_soc_device_init This is preparation to move imx_soc_device_init to drivers/soc/imx/ There is no reason to must put dt devices under /sys/devices/soc0, they could also be under /sys/devices/platform, so we could pass NULL as parent when calling of_platform_default_populate. Following soc-imx8.c soc-imx-scu.c using device_initcall, need to change return type to int type for imx_soc_device_init. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 48ffd4ebc1daf7eac054cf282ed0c2632abc2e20 Author: Zhao Qiang Date: Wed May 20 12:02:21 2020 +0800 arm64: dts: Add ds26522 node to dts to ls1043ardb Add ds26522 node to fsl-ls1043a-rdb.dts Signed-off-by: Zhao Qiang Signed-off-by: Shawn Guo commit 76afd7dbbdb34824ac51bb51fca6c68cacd73eb3 Author: Zhao Qiang Date: Wed May 20 12:02:20 2020 +0800 arm64: dts: add qe node to ls1043ardb Add qe node to fsl-ls1043a.dtsi and fsl-ls1043a-rdb.dts Signed-off-by: Zhao Qiang Signed-off-by: Shawn Guo commit c73433fc630cda102f6527d4e5dfd289a9baec08 Author: Anshuman Khandual Date: Tue May 12 07:27:27 2020 +0530 arm64/cpufeature: Validate hypervisor capabilities during CPU hotplug This validates hypervisor capabilities like VMID width, IPA range for any hot plug CPU against system finalized values. KVM's view of the IPA space is used while allowing a given CPU to come up. While here, it factors out get_vmid_bits() for general use. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org Suggested-by: Suzuki Poulose Signed-off-by: Anshuman Khandual Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/1589248647-22925-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 0d99633fd04f6bdfc3ff8ed6632aad27e742821c Author: Michael Walle Date: Tue May 19 23:03:19 2020 +0200 arm64: dts: ls1028a: sl28: keep switch port names consistent Keep the switch port labels consistent across the different board variants. If the user wants to rename them, it should be done in user-space. Fixes: ab43f0307449 ("arm64: dts: ls1028a: sl28: add support for variant 2") Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit 80b9fa4dead406f9a0aef5b364eb237872986c2c Author: Pavel Dobias Date: Wed May 20 09:19:03 2020 +0200 ASoC: max9867: add mono playback switch Add Mono Playback switch to codec controls which enables codec's capability of mixing left and right channel at the DAC output. Signed-off-by: Pavel Dobias Link: https://lore.kernel.org/r/20200520071904.15801-5-dobias@2n.cz Signed-off-by: Mark Brown commit af53d5738cb0fd61da0bc3f5a884df7af237d20d Author: Pavel Dobias Date: Wed May 20 09:19:01 2020 +0200 ASoC: max9867: add filter controls Adding missing codec controls - ADC/DAC IIR filter selection. Signed-off-by: Pavel Dobias Link: https://lore.kernel.org/r/20200520071904.15801-3-dobias@2n.cz Signed-off-by: Mark Brown commit d0de8c69f90196fb872f1739756bb0348144d18c Author: Pavel Dobias Date: Wed May 20 09:19:00 2020 +0200 ASoC: max9867: don't use regmap defaults MAX9867 codec doesn't have reset pin, so the registers don't have default values in the case of reboot without powering off. Remove the reg_defaults struct and let the regmap read initial state of the registers at startup instead of taking them from reg_defaults struct. Signed-off-by: Pavel Dobias Link: https://lore.kernel.org/r/20200520071904.15801-2-dobias@2n.cz Signed-off-by: Mark Brown commit 6ea460d52299f7febd408f2710d7c43ce505bc2c Author: Lubomir Rintel Date: Wed May 20 10:35:16 2020 +0200 ASoC: mmp-sspa: Fix the error handling in probe() If we fail after pm_runtime_enable(), we fail to undo it. Same with clk_prepare_enable(). Let's order them after all things that can fail. Fixes: 7d98cc648253 ("ASoC: mmp-sspa: Add support for the runtime power management") Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200520083516.2120802-1-lkundrak@v3.sk Signed-off-by: Mark Brown commit 6b668c9b7fc6fc0c313cdaee8b75d17f4d954ab5 Author: Xiaoguang Wang Date: Wed May 20 15:35:03 2020 +0800 io_uring: don't submit sqes when ctx->refs is dying When IORING_SETUP_SQPOLL is enabled, io_ring_ctx_wait_and_kill() will wait for sq thread to idle by busy loop: while (ctx->sqo_thread && !wq_has_sleeper(&ctx->sqo_wait)) cond_resched(); Above loop isn't very CPU friendly, it may introduce a short cpu burst on the current cpu. If ctx->refs is dying, we forbid sq_thread from submitting any further SQEs. Instead they just get discarded when we exit. Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 755dfcbca83710fa967d0efa7c5bb601f871a747 Author: Luiz Augusto von Dentz Date: Tue May 19 13:25:17 2020 -0700 Bluetooth: Fix assuming EIR flags can result in SSP authentication EIR flags should just hint if SSP may be supported but we shall verify this with use of the actual features as the SSP bits may be disabled in the lower layers which would result in legacy authentication to be used. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 Author: Luiz Augusto von Dentz Date: Tue May 19 13:25:19 2020 -0700 Bluetooth: Consolidate encryption handling in hci_encrypt_cfm This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection state is BT_CONFIG so callers don't have to check the state. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 0decf1f8de919782b152daf9c991967a2bac54f0 Author: Matt Helsley Date: Tue May 19 13:55:33 2020 -0700 objtool: Enable compilation of objtool for all architectures Objtool currently only compiles for x86 architectures. This is fine as it presently does not support tooling for other architectures. However, we would like to be able to convert other kernel tools to run as objtool sub commands because they too process ELF object files. This will allow us to convert tools such as recordmcount to use objtool's ELF code. Since much of recordmcount's ELF code is copy-paste code to/from a variety of other kernel tools (look at modpost for example) this means that if we can convert recordmcount we can convert more. We define weak definitions for subcommand entry functions and other weak definitions for shared functions critical to building existing subcommands. These return 127 when the command is missing which signify tools that do not exist on all architectures. In this case the "check" and "orc" tools do not exist on all architectures so we only add them for x86. Future changes adding support for "check", to arm64 for example, can then modify the SUBCMD_CHECK variable when building for arm64. Objtool is not currently wired in to KConfig to be built for other architectures because it's not needed for those architectures and there are no commands it supports other than those for x86. As more command support is enabled on various architectures the necessary KConfig changes can be made (e.g. adding "STACK_VALIDATION") to trigger building objtool. [ jpoimboe: remove aliases, add __weak macro, add error messages ] Cc: Julien Thierry Signed-off-by: Matt Helsley Signed-off-by: Josh Poimboeuf commit b9dd3f6d417258ad0beeb292a1bc74200149f15d Author: Lukas Wunner Date: Fri May 15 17:58:03 2020 +0200 spi: bcm2835aux: Fix controller unregister order The BCM2835aux SPI driver uses devm_spi_register_master() on bind. As a consequence, on unbind, __device_release_driver() first invokes bcm2835aux_spi_remove() before unregistering the SPI controller via devres_release_all(). This order is incorrect: bcm2835aux_spi_remove() turns off the SPI controller, including its interrupts and clock. The SPI controller is thus no longer usable. When the SPI controller is subsequently unregistered, it unbinds all its slave devices. If their drivers need to access the SPI bus, e.g. to quiesce their interrupts, unbinding will fail. As a rule, devm_spi_register_master() must not be used if the ->remove() hook performs teardown steps which shall be performed after unbinding of slaves. Fix by using the non-devm variant spi_register_master(). Note that the struct spi_master as well as the driver-private data are not freed until after bcm2835aux_spi_remove() has finished, so accessing them is safe. Fixes: 1ea29b39f4c8 ("spi: bcm2835aux: add bcm2835 auxiliary spi device driver") Signed-off-by: Lukas Wunner Cc: stable@vger.kernel.org # v4.4+ Cc: Martin Sperl Link: https://lore.kernel.org/r/32f27f4d8242e4d75f9a53f7e8f1f77483b08669.1589557526.git.lukas@wunner.de Signed-off-by: Mark Brown commit 9dd277ff92d06f6aa95b39936ad83981d781f49b Author: Lukas Wunner Date: Fri May 15 17:58:02 2020 +0200 spi: bcm2835: Fix controller unregister order The BCM2835 SPI driver uses devm_spi_register_controller() on bind. As a consequence, on unbind, __device_release_driver() first invokes bcm2835_spi_remove() before unregistering the SPI controller via devres_release_all(). This order is incorrect: bcm2835_spi_remove() tears down the DMA channels and turns off the SPI controller, including its interrupts and clock. The SPI controller is thus no longer usable. When the SPI controller is subsequently unregistered, it unbinds all its slave devices. If their drivers need to access the SPI bus, e.g. to quiesce their interrupts, unbinding will fail. As a rule, devm_spi_register_controller() must not be used if the ->remove() hook performs teardown steps which shall be performed after unbinding of slaves. Fix by using the non-devm variant spi_register_controller(). Note that the struct spi_controller as well as the driver-private data are not freed until after bcm2835_spi_remove() has finished, so accessing them is safe. Fixes: 247263dba208 ("spi: bcm2835: use devm_spi_register_master()") Signed-off-by: Lukas Wunner Cc: stable@vger.kernel.org # v3.13+ Link: https://lore.kernel.org/r/2397dd70cdbe95e0bc4da2b9fca0f31cb94e5aed.1589557526.git.lukas@wunner.de Signed-off-by: Mark Brown commit 84855678add8aba927faf76bc2f130a40f94b6f7 Author: Lukas Wunner Date: Fri May 15 17:58:01 2020 +0200 spi: Fix controller unregister order When an SPI controller unregisters, it unbinds all its slave devices. For this, their drivers may need to access the SPI bus, e.g. to quiesce interrupts. However since commit ffbbdd21329f ("spi: create a message queueing infrastructure"), spi_destroy_queue() is executed before unbinding the slaves. It sets ctlr->running = false, thereby preventing SPI bus access and causing unbinding of slave devices to fail. Fix by unbinding slaves before calling spi_destroy_queue(). Fixes: ffbbdd21329f ("spi: create a message queueing infrastructure") Signed-off-by: Lukas Wunner Cc: stable@vger.kernel.org # v3.4+ Cc: Linus Walleij Link: https://lore.kernel.org/r/8aaf9d44c153fe233b17bc2dec4eb679898d7e7b.1589557526.git.lukas@wunner.de Signed-off-by: Mark Brown commit fcbcf1f7b56855ffe1cec768cb1013c5a4c854c3 Author: Rander Wang Date: Wed May 20 03:19:02 2020 +0800 soundwire: intel: use a single module It's not clear why we have two modules for the Intel controller/master support when there is a single Kconfig. This adds complexity for no good reason, the two parts need to work together anyways. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20200519191903.6557-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 53a58bf96bcdd47c670a957920f3a1bcf7215b39 Author: Pavel Dobias Date: Wed May 20 09:18:59 2020 +0200 ASoC: max9867: fix ADC level control Fix swapped channels in ADC level control. Signed-off-by: Pavel Dobias Link: https://lore.kernel.org/r/20200520071904.15801-1-dobias@2n.cz Signed-off-by: Mark Brown commit ec97d022f621c6c850aec46d8818b49c6aae95ad Author: Christophe Leroy Date: Tue May 19 05:48:48 2020 +0000 powerpc/kasan: Declare kasan_init_region() weak In order to alloc sub-arches to alloc KASAN regions using optimised methods (Huge pages on 8xx, BATs on BOOK3S, ...), declare kasan_init_region() weak. Also make kasan_init_shadow_page_tables() accessible from outside, so that it can be called from the specific kasan_init_region() functions if needed. And populate remaining KASAN address space only once performed the region mapping, to allow 8xx to allocate hugepd instead of standard page tables for mapping via 8M hugepages. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3c1ce419fa1b5a4171b92d7fb16455ca17e1b96d.1589866984.git.christophe.leroy@csgroup.eu commit 7dec42ab57f2f59feba82abf0353164479bfde4c Author: Christophe Leroy Date: Tue May 19 05:48:47 2020 +0000 powerpc/kasan: Refactor update of early shadow mappings kasan_remap_early_shadow_ro() and kasan_unmap_early_shadow_vmalloc() are both updating the early shadow mapping: the first one sets the mapping read-only while the other clears the mapping. Refactor and create kasan_update_early_region() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8c496c0828de2608c7c940c45525d177e91b6f1b.1589866984.git.christophe.leroy@csgroup.eu commit 7c31c05e00fc5ff2067332c5f80e525573e7269c Author: Christophe Leroy Date: Tue May 19 05:48:46 2020 +0000 powerpc/kasan: Remove unnecessary page table locking Commit 45ff3c559585 ("powerpc/kasan: Fix parallel loading of modules.") added spinlocks to manage parallele module loading. Since then commit 47febbeeec44 ("powerpc/32: Force KASAN_VMALLOC for modules") converted the module loading to KASAN_VMALLOC. The spinlocking has then become unneeded and can be removed to simplify kasan_init_shadow_page_tables() Also remove inclusion of linux/moduleloader.h and linux/vmalloc.h which are not needed anymore since the removal of modules management. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/81a4d3aee8b82bc1355595935c8f4ad9d3b22a83.1589866984.git.christophe.leroy@csgroup.eu commit d2a91cef9bbdeb87b7449fdab1a6be6000930210 Author: Christophe Leroy Date: Tue May 19 05:48:45 2020 +0000 powerpc/kasan: Fix shadow pages allocation failure Doing kasan pages allocation in MMU_init is too early, kernel doesn't have access yet to the entire memory space and memblock_alloc() fails when the kernel is a bit big. Do it from kasan_init() instead. Fixes: 2edb16efc899 ("powerpc/32: Add KASAN support") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c24163ee5d5f8cdf52fefa45055ceb35435b8f15.1589866984.git.christophe.leroy@csgroup.eu commit 3a66a24f6060e6775f8c02ac52329ea0152d7e58 Author: Christophe Leroy Date: Tue May 19 05:48:44 2020 +0000 powerpc/kasan: Fix issues by lowering KASAN_SHADOW_END At the time being, KASAN_SHADOW_END is 0x100000000, which is 0 in 32 bits representation. This leads to a couple of issues: - kasan_remap_early_shadow_ro() does nothing because the comparison k_cur < k_end is always false. - In ptdump, address comparison for markers display fails and the marker's name is printed at the start of the KASAN area instead of being printed at the end. However, there is no need to shadow the KASAN shadow area itself, so the KASAN shadow area can stop shadowing memory at the start of itself. With a PAGE_OFFSET set to 0xc0000000, KASAN shadow area is then going from 0xf8000000 to 0xff000000. Fixes: cbd18991e24f ("powerpc/mm: Fix an Oops in kasan_mmu_init()") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ae1a3c0d19a37410c209c3fc453634cfcc0ee318.1589866984.git.christophe.leroy@csgroup.eu commit d132443a73d7a131775df46f33000f67ed92de1e Author: Christophe Leroy Date: Tue May 19 05:48:43 2020 +0000 powerpc/kasan: Fix error detection on memory allocation In case (k_start & PAGE_MASK) doesn't equal (kstart), 'va' will never be NULL allthough 'block' is NULL Check the return of memblock_alloc() directly instead of the resulting address in the loop. Fixes: 509cd3f2b473 ("powerpc/32: Simplify KASAN init") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7cb8ca82042bfc45a5cfe726c921cd7e7eeb12a3.1589866984.git.christophe.leroy@csgroup.eu commit 82a1b8ed5604cccf30b6ff03bcd61640cd26369b Author: Nicholas Piggin Date: Mon May 11 22:58:24 2020 +1000 powerpc/64s/hash: Add stress_slb kernel boot option to increase SLB faults This option increases the number of SLB misses by limiting the number of kernel SLB entries, and increased flushing of cached lookaside information. This helps stress test difficult to hit paths in the kernel. Reported-by: kbuild test robot Signed-off-by: Nicholas Piggin [mpe: Relocate the code into arch/powerpc/mm, s/torture/stress/] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200511125825.3081305-1-mpe@ellerman.id.au commit a0594e89c9dc8e37883cc0d6642d1baad9c0744e Author: Andrew Donnellan Date: Wed Feb 26 15:39:23 2020 +1100 ocxl: Fix misleading comment In ocxl_context_free() we note that the AFU reference we're releasing was taken in "ocxl_context_init", a function that no longer exists. Fix it to say ocxl_context_alloc() instead, which is the new name for ocxl_context_init(), since it was renamed. Fixes: b9721d275cc2 ("ocxl: Allow external drivers to use OpenCAPI contexts") Signed-off-by: Andrew Donnellan Acked-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200226043923.5481-1-ajd@linux.ibm.com commit b8707e2374f68cac79de553ae1ee5c35913813bd Author: Michael Neuling Date: Wed Mar 25 15:05:46 2020 +1100 powerpc/tm: Document h/rfid and mtmsrd quirk The ISA has a quirk that's useful for the Linux implementation. Document it here so others are less likely to trip over it. Suggested-by: Michael Ellerman Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200325040546.3091563-1-mikey@neuling.org commit 91ffeaa7e5dd62753e23a1204dc7ecd11f26eadc Author: Nathan Chancellor Date: Mon Apr 13 12:06:45 2020 -0700 powerpc/wii: Fix declaration made after definition A 0day randconfig uncovered an error with clang, trimmed for brevity: arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] if (!machine_is(wii)) ^ The macro machine_is declares mach_##name but define_machine actually defines mach_##name, hence the warning. To fix this, move define_machine after the is_machine usage. Fixes: 5a7ee3198dfa ("powerpc: wii: platform support") Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Signed-off-by: Michael Ellerman Link: https://github.com/ClangBuiltLinux/linux/issues/989 Link: https://lore.kernel.org/r/20200413190644.16757-1-natechancellor@gmail.com commit c2e929b18cea6cbf71364f22d742d9aad7f4677a Author: Qian Cai Date: Thu Mar 5 23:48:52 2020 -0500 powerpc/64s/pgtable: fix an undefined behaviour Booting a power9 server with hash MMU could trigger an undefined behaviour because pud_offset(p4d, 0) will do, 0 >> (PAGE_SHIFT:16 + PTE_INDEX_SIZE:8 + H_PMD_INDEX_SIZE:10) Fix it by converting pud_index() and friends to static inline functions. UBSAN: shift-out-of-bounds in arch/powerpc/mm/ptdump/ptdump.c:282:15 shift exponent 34 is too large for 32-bit type 'int' CPU: 6 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc4-next-20200303+ #13 Call Trace: dump_stack+0xf4/0x164 (unreliable) ubsan_epilogue+0x18/0x78 __ubsan_handle_shift_out_of_bounds+0x160/0x21c walk_pagetables+0x2cc/0x700 walk_pud at arch/powerpc/mm/ptdump/ptdump.c:282 (inlined by) walk_pagetables at arch/powerpc/mm/ptdump/ptdump.c:311 ptdump_check_wx+0x8c/0xf0 mark_rodata_ro+0x48/0x80 kernel_init+0x74/0x194 ret_from_kernel_thread+0x5c/0x74 Suggested-by: Christophe Leroy Signed-off-by: Qian Cai Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/20200306044852.3236-1-cai@lca.pw commit 9384e552aabb647ec22acb00181ca1715b0fcdfe Author: Nicholas Piggin Date: Wed Apr 29 17:02:47 2020 +1000 powerpc/64s: Fix early_init_mmu section mismatch Christian reports: MODPOST vmlinux.o WARNING: modpost: vmlinux.o(.text.unlikely+0x1a0): Section mismatch in reference from the function .early_init_mmu() to the function .init.text:.radix__early_init_mmu() The function .early_init_mmu() references the function __init .radix__early_init_mmu(). This is often because .early_init_mmu lacks a __init annotation or the annotation of .radix__early_init_mmu is wrong. WARNING: modpost: vmlinux.o(.text.unlikely+0x1ac): Section mismatch in reference from the function .early_init_mmu() to the function .init.text:.hash__early_init_mmu() The function .early_init_mmu() references the function __init .hash__early_init_mmu(). This is often because .early_init_mmu lacks a __init annotation or the annotation of .hash__early_init_mmu is wrong. The compiler is uninlining early_init_mmu and not putting it in an init section because there is no annotation. Add it. Reported-by: Christian Zigotzky Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Tested-by: Christian Zigotzky Link: https://lore.kernel.org/r/20200429070247.1678172-1-npiggin@gmail.com commit ceffa63acce7165c442395b7d64a11ab8b5c5dca Author: Chen Zhou Date: Sat May 9 10:08:38 2020 +0800 powerpc/powernv: add NULL check after kzalloc Fixes coccicheck warning: ./arch/powerpc/platforms/powernv/opal.c:813:1-5: alloc with no test, possible model on line 814 Add NULL check after kzalloc. Signed-off-by: Chen Zhou Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200509020838.121660-1-chenzhou10@huawei.com commit aa3bc365ee73765af5059678bf55b0f3e4a3e6c4 Author: Geoff Levand Date: Sat May 16 09:20:46 2020 -0700 powerpc/ps3: Add check for otheros image size The ps3's otheros flash loader has a size limit of 16 MiB for the uncompressed image. If that limit will be reached output the flash image file as 'otheros-too-big.bld'. Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/897c2a59-378e-7c9b-3976-d0a0def90913@infradead.org commit 8f53f9c0f68ab2168f637494b9e24034899c1310 Author: Aneesh Kumar K.V Date: Wed May 13 08:36:16 2020 +0530 powerpc/book3s64/radix/tlb: Determine hugepage flush correctly With a 64K page size flush with start and end: (start, end) = (721f680d0000, 721f680e0000) results in: (hstart, hend) = (721f68200000, 721f68000000) ie. hstart is above hend, which indicates no huge page flush is needed. However the current logic incorrectly sets hflush = true in this case, because hstart != hend. That causes us to call __tlbie_va_range() passing hstart/hend, to do a huge page flush even though we don't need to. __tlbie_va_range() will skip the actual tlbie operation for start > end. But it will still end up calling fixup_tlbie_va_range() and doing the TLB fixups in there, which is harmless but unnecessary work. Reported-by: Bharata B Rao Signed-off-by: Aneesh Kumar K.V Reviewed-by: Nicholas Piggin [mpe: Drop else case, hflush is already false, flesh out change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200513030616.152288-1-aneesh.kumar@linux.ibm.com commit 787a2b682d18997e71efc2ae92ce158ca3e319e9 Merge: 217ba7dccef8 b1f9be9392f0 Author: Michael Ellerman Date: Wed May 20 23:38:13 2020 +1000 Merge branch 'topic/ppc-kvm' into next Merge our topic branch shared with the kvm-ppc tree. This brings in one commit that touches the XIVE interrupt controller logic across core and KVM code. commit 217ba7dccef8e811eee43003bfef24f1902f37c9 Merge: 30df74d67d48 e2a8b49e7955 Author: Michael Ellerman Date: Wed May 20 23:37:33 2020 +1000 Merge branch 'topic/uaccess-ppc' into next Merge our uaccess-ppc topic branch. It is based on the uaccess topic branch that we're sharing with Viro. This includes the addition of user_[read|write]_access_begin(), as well as some powerpc specific changes to our uaccess routines that would conflict badly if merged separately. commit 4f118a7e4686062bd4df4a37e24c22cd71495b5f Merge: ab1c6093f689 c73178b93754 Author: Wolfram Sang Date: Wed May 20 15:37:21 2020 +0200 Merge tag 'for-5.8-i2c' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into i2c/for-5.8 i2c: tegra: Changes for v5.8-rc1 This includes a few improvements to make the Tegra I2C controller behave properly on suspend/resume, does a bit of cleanup and adds support for the VI-variant of the I2C controller that is used primarily for video capture purposes. commit d37c90d47fc4657423d2ff1c3ed3fd70612a9b43 Author: Matt Helsley Date: Tue May 19 13:55:32 2020 -0700 objtool: Move struct objtool_file into arch-independent header The objtool_file structure describes the files objtool works on, is used by the check subcommand, and the check.h header is included by the orc subcommands so it's presently used by all subcommands. Since the structure will be useful in all subcommands besides check, and some subcommands may not want to include check.h to get the definition, split the structure out into a new header meant for use by all objtool subcommands. Signed-off-by: Matt Helsley Reviewed-by: Julien Thierry Signed-off-by: Josh Poimboeuf commit f15c648f202cd0232d4a9c98627bc08bcd6d11ee Author: Matt Helsley Date: Tue May 19 13:55:31 2020 -0700 objtool: Exit successfully when requesting help When the user requests help it's not an error so do not exit with a non-zero exit code. This is not especially useful for a user but any script that might wish to check that objtool --help is at least available can't rely on the exit code to crudely check that, for example, building an objtool executable succeeds. Signed-off-by: Matt Helsley Signed-off-by: Josh Poimboeuf commit ae033f088f277efd5b3c6d681ce9e7682380efff Author: Josh Poimboeuf Date: Wed Apr 29 14:09:04 2020 -0500 objtool: Add check_kcov_mode() to the uaccess safelist check_kcov_mode() is called by write_comp_data() and __sanitizer_cov_trace_pc(), which are already on the uaccess safe list. It's notrace and doesn't call out to anything else, so add it to the list too. This fixes the following warnings: kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc()+0x15: call to check_kcov_mode() with UACCESS enabled kernel/kcov.o: warning: objtool: write_comp_data()+0x1b: call to check_kcov_mode() with UACCESS enabled Reported-by: Arnd Bergmann Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) commit 9d907f1ae80b8a67d5397e26912b9d56d0b70a02 Author: Josh Poimboeuf Date: Fri Apr 24 15:40:43 2020 -0500 samples/ftrace: Fix asm function ELF annotations Enable objtool coverage for the sample ftrace modules by adding ELF annotations to the asm trampoline functions. samples/ftrace/ftrace-direct.o: warning: objtool: .text+0x0: unreachable instruction samples/ftrace/ftrace-direct-modify.o: warning: objtool: .text+0x0: unreachable instruction samples/ftrace/ftrace-direct-too.o: warning: objtool: .text+0x0: unreachable instruction Reported-by: Randy Dunlap Signed-off-by: Josh Poimboeuf commit ab1c6093f689c48bb28889b3c23888289afd5c34 Author: Atsushi Nemoto Date: Fri May 8 22:14:36 2020 +0900 i2c: altera: cleanup spinlock Protect altr_i2c_int_enable() by the mutex and remove unneeded spinlock. Signed-off-by: Atsushi Nemoto Reviewed-by: Thor Thayer Signed-off-by: Wolfram Sang commit f89c326dcaa0cb8c3af7764e75eeed4e3f3c879a Merge: 6fe12cdbcfe3 efa7fb4c6c8e Author: Wolfram Sang Date: Wed May 20 15:27:45 2020 +0200 Merge branch 'i2c/for-current-fixed' into i2c/for-5.8 commit e9bdccb0bdf9169771d79cd72182210e2b2a0df9 Author: Thierry Reding Date: Fri Apr 17 19:11:17 2020 +0200 arm64: tegra: Make the RTC a wakeup source on Jetson TX2 The RTC found on the MAX77620 PMIC can be used as a wakeup source on Jetson TX2, which is useful to wake the system from suspend at a given time. Signed-off-by: Thierry Reding Acked-by: Jon Hunter Tested-by: Jon Hunter commit ce8a85968dc492cdabf3eab2ce1b8a13fc102905 Author: Thierry Reding Date: Fri Jun 7 16:00:20 2019 +0200 arm64: tegra: Enable VI I2C on Jetson Nano Enable the VI I2C so that the peripherals connected to it (such as the camera connector, an INA3221 power monitor and the USB 3.1 4-port hub) can be accessed. Signed-off-by: Thierry Reding commit 3482a7afb261e2de9269a7f9ad0f4a3a82a83a53 Author: Vidya Sagar Date: Thu May 14 19:24:37 2020 +0530 arm64: tegra: Fix flag for 64-bit resources in 'ranges' property Fix flag in PCIe controllers device-tree nodes 'ranges' property to correctly represent 64-bit resources. Fixes: 2602c32f15e7 ("arm64: tegra: Add P2U and PCIe controller nodes to Tegra194 DT") Signed-off-by: Vidya Sagar Signed-off-by: Thierry Reding commit c415388539495479ad5f905d939cc28d28c567ab Author: Sowjanya Komatineni Date: Mon May 4 19:32:00 2020 -0700 arm64: tegra: Add Tegra VI CSI support in device tree Tegra210 contains VI controller for video input capture from MIPI CSI camera sensors and also supports built-in test pattern generator. CSI ports can be one-to-one mapped to VI channels for capturing from an external sensor or from built-in test pattern generator. This patch adds support for VI and CSI and enables them in Tegra210 device tree. Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 2eb8e1a4b1dad1331e438923fefd56a7d6ca6488 Author: Sowjanya Komatineni Date: Mon May 4 19:31:53 2020 -0700 arm64: tegra: Add reset-cells to memory controller Tegra210 device tree is missing reset-cells property for the memory controller node. This patch adds it. Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit b4f99176a501ac34c7f5c9322910e248a2f43397 Author: Sowjanya Komatineni Date: Mon May 4 19:31:52 2020 -0700 arm64: tegra: Fix SOR powergate clocks and reset Tegra210 device tree lists CSI clock and reset under SOR powergate node. But Tegra210 has CSICIL in SOR partition and CSI in VENC partition. So, this patch includes fix for SOR powergate node. Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 4012ab12b3cbd3efbd7254f04de40903c624a237 Author: Jon Hunter Date: Thu May 7 11:13:49 2020 +0100 arm64: tegra: Allow the PMIC RTC to wakeup Jetson Xavier The PMIC RTC is currently unable to wakeup Tegra194 on the Jetson Xavier platform because the interrupt from the PMIC is not usin the PMC as the interrupt parent but the GIC directly. Update the PMIC interrupt to use the PMC as the interrupt parent so that the PMIC RTC alarms can wakeup the device. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit bba25915b172c72f6fa635f091624d799e3c9cae Author: Jon Hunter Date: Fri May 1 08:27:56 2020 +0100 arm64: tegra: Fix ethernet phy-mode for Jetson Xavier The 'phy-mode' property is currently defined as 'rgmii' for Jetson Xavier. This indicates that the RGMII RX and TX delays are set by the MAC and the internal delays set by the PHY are not used. If the Marvell PHY driver is enabled, such that it is used and not the generic PHY, ethernet failures are seen (DHCP is failing to obtain an IP address) and this is caused because the Marvell PHY driver is disabling the internal RX and TX delays. For Jetson Xavier the internal PHY RX and TX delay should be used and so fix this by setting the 'phy-mode' to 'rgmii-id' and not 'rgmii'. Fixes: f89b58ce71a9 ("arm64: tegra: Add ethernet controller on Tegra194") Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit e12325f699e6fb396870e9479007fb0069574235 Author: Thierry Reding Date: Thu Apr 9 19:34:29 2020 +0200 arm64: tegra: Hook up EMC cooling device The external memory controller can be used as a cooling device for the LPDDR chips. Hook it up to the "mem" thermal zone of the SOCTHERM block so that temperature polling can be enabled on the EMC when a given temperature is exceeded. Signed-off-by: Thierry Reding commit cd9350c55b5b76a758eadd057891f1c4c4986fce Author: Joseph Lo Date: Wed May 29 16:21:39 2019 +0800 arm64: tegra: Add external memory controller node for Tegra210 Add external memory controller (EMC) node for Tegra210 Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding commit 6fe12cdbcfe35ad4726a619a9546822d34fc934c Author: Bibby Hsieh Date: Tue May 19 15:27:29 2020 +0800 i2c: core: support bus regulator controlling in adapter Although in the most platforms, the bus power of i2c are alway on, some platforms disable the i2c bus power in order to meet low power request. We get and enable bulk regulator in i2c adapter device. Signed-off-by: Bibby Hsieh Reviewed-by: Tomasz Figa Signed-off-by: Wolfram Sang commit 6aab46bc52a8f579879d491c9d8062e03caa5c61 Author: Bibby Hsieh Date: Tue May 19 15:27:28 2020 +0800 dt-binding: i2c: add bus-supply property In some platforms, they disable the power-supply of i2c due to power consumption reduction. This patch add bus-supply property. Signed-off-by: Bibby Hsieh Acked-by: Rob Herring [wsa: rebased to i2c/for-next] Signed-off-by: Wolfram Sang commit df7b4d6f7d5fff53d4dcf8d972f331dbbb7d49e0 Author: Wolfram Sang Date: Tue May 5 18:01:01 2020 +0200 i2c: reword explanation about atomic transfers Atomic transfers are not only about sending messages like the original wording suggested. Speak of 'accessing' now like in i2c.h. Reported-by: Michał Mirosław Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 5c71ca4d4f9872e0db105141e3bce25eec2be233 Author: Wolfram Sang Date: Tue May 12 16:20:46 2020 +0200 i2c: slave-eeprom: add support for 24c512 EEPROMs I don't plan to support every EEPROM type, but the 24c512 ones need a tiny code update, so let's have that upstream. Reported-by: Patrick Williams Signed-off-by: Wolfram Sang Reviewed-by: Patrick Williams Signed-off-by: Wolfram Sang commit be5ce0e97cc7a5c0d2da45d617b7bc567c3d3fa1 Author: Qii Wang Date: Thu May 14 21:09:05 2020 +0800 i2c: mediatek: Add i2c ac-timing adjust support This patch adds a algorithm to calculate some ac-timing parameters which can fully meet I2C Spec. Signed-off-by: Qii Wang Signed-off-by: Wolfram Sang commit 960b2dee908b0fc51cf670841de13b40b44aaaae Author: Helen Koike Date: Fri Apr 3 18:15:34 2020 +0200 media: dt-bindings: phy: phy-rockchip-dphy-rx0: move rockchip dphy rx0 bindings out of staging Move phy-rockchip-dphy-rx0 bindings to Documentation/devicetree/bindings/phy Verified with: make ARCH=arm64 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/phy/rockchip-mipi-dphy-rx0.yaml Signed-off-by: Helen Koike Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 00994f0ceca30be576393ebfb84454d067577652 Author: Helen Koike Date: Fri Apr 3 18:15:33 2020 +0200 media: staging: dt-bindings: phy-rockchip-dphy-rx0: remove non-used reg property reg property is not used in Rockchip MIPI DPHY RX0 bindings, thus remove it. Suggested-by: Johan Jonker Signed-off-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8c8664264b97cade6f9ab332450ccbeb1a450d34 Author: Mauro Carvalho Chehab Date: Wed May 20 12:01:52 2020 +0200 media: atomisp: unify the version for isp2401 a0 and b0 versions Based on Yocto Aero's repository, the file name for the isp2401 is the same for the B0 release. So, unify it at the driver. Signed-off-by: Mauro Carvalho Chehab commit 645626791e7eb91d961ff77dfc73f38319222365 Author: Mauro Carvalho Chehab Date: Wed May 20 12:00:22 2020 +0200 media: atomisp: update TODO with the current data The TODO list doesn't reflect the current status of the driver. Update it. Signed-off-by: Mauro Carvalho Chehab commit 27333dadef57ad36199945fa47f4206d60a4866c Author: Mauro Carvalho Chehab Date: Wed May 20 07:28:50 2020 +0200 media: atomisp: adjust some code at sh_css that could be broken When checking sh_css.c against the Yocto Aero's version, it can be noticed that some isp2401 dependencies may have been taken wrongly. Change the code to work like the Yocto Aero, as this driver was tested in the past with an ISP2401 device. Signed-off-by: Mauro Carvalho Chehab commit 58d6ccc264ed527377434e53ffadfdebed6cf915 Author: Mauro Carvalho Chehab Date: Wed May 20 08:46:17 2020 +0200 media: atomisp: don't produce errs for ignored IRQs Depending on the ISP-specific HAS_NO_INPUT_FORMATTER macro, some IRQs will be ignored by the driver. Yet, those keep happening, as reported by this debug print: [ 61.620746] atomisp-isp2 0000:00:03.0: atomisp_css_irq_enable: css irq info 0x00000004: disable. Causing this warning: [ 61.620749] atomisp-isp2 0000:00:03.0: atomisp_css_irq_enable:Invalid irq info. Well, if this is a normal situation, just ignore it without warnings. Signed-off-by: Mauro Carvalho Chehab commit cf3cd3b05ea9ea09d96cbb7d1cd914e7d7db4b77 Author: Mauro Carvalho Chehab Date: Wed May 20 08:37:08 2020 +0200 media: atomisp: print IRQ when debugging Add a debug printk to show what IRQ is popping up. Signed-off-by: Mauro Carvalho Chehab commit 1985e93802d271bd658833585fffb896c4976910 Author: Mauro Carvalho Chehab Date: Wed May 20 07:55:45 2020 +0200 media: atomisp: isp_mmu: don't use kmem_cache Instead of using it only if system memory is below 2GB, don't use it at all. The problem is that the code there is not compatible anymore with modern Kernels: [ 179.552797] virt_to_cache: Object is not a Slab page! [ 179.552821] WARNING: CPU: 0 PID: 1414 at mm/slab.h:475 cache_from_obj+0xab/0xf0 [ 179.552824] Modules linked in: ccm(E) nft_fib_inet(E) nft_fib_ipv4(E) nft_fib_ipv6(E) nft_fib(E) nft_reject_inet(E) nf_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) nft_chain_nat(E) ip6table_nat(E) ip6table_mangle(E) ip6table_raw(E) ip6table_security(E) iptable_nat(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) libcrc32c(E) nf_defrag_ipv4(E) iptable_mangle(E) iptable_raw(E) iptable_security(E) ip_set(E) nf_tables(E) nfnetlink(E) ip6table_filter(E) ip6_tables(E) iptable_filter(E) cmac(E) bnep(E) sunrpc(E) vfat(E) fat(E) mei_hdcp(E) snd_soc_sst_cht_bsw_rt5645(E) gpio_keys(E) intel_rapl_msr(E) intel_powerclamp(E) coretemp(E) kvm_intel(E) kvm(E) irqbypass(E) crct10dif_pclmul(E) crc32_pclmul(E) asus_nb_wmi(E) ath10k_pci(E) ghash_clmulni_intel(E) ath10k_core(E) intel_cstate(E) wdat_wdt(E) pcspkr(E) ath(E) mac80211(E) intel_chtdc_ti_pwrbtn(E) joydev(E) btusb(E) btrtl(E) btbcm(E) btintel(E) libarc4(E) bluetooth(E) cfg80211(E) ecdh_generic(E) ecc(E) mei_txe(E) mei(E) lpc_ich(E) [ 179.552887] hid_sensor_accel_3d(E) hid_sensor_gyro_3d(E) hid_sensor_trigger(E) hid_sensor_iio_common(E) industrialio_triggered_buffer(E) kfifo_buf(E) industrialio(E) atomisp_ov2680(CE) snd_soc_rt5645(E) snd_intel_sst_acpi(E) snd_soc_rl6231(E) snd_intel_sst_core(E) snd_soc_sst_atom_hifi2_platform(E) intel_hid(E) snd_soc_acpi_intel_match(E) spi_pxa2xx_platform(E) snd_soc_acpi(E) snd_soc_core(E) snd_compress(E) dw_dmac(E) snd_hdmi_lpe_audio(E) int3400_thermal(E) int3406_thermal(E) snd_seq(E) acpi_thermal_rel(E) int3403_thermal(E) atomisp(CE) snd_seq_device(E) snd_pcm(E) intel_int0002_vgpio(E) soc_button_array(E) acpi_pad(E) intel_xhci_usb_role_switch(E) snd_timer(E) videobuf_vmalloc(E) videobuf_core(E) snd(E) atomisp_gmin_platform(CE) soundcore(E) videodev(E) processor_thermal_device(E) intel_soc_dts_iosf(E) mc(E) intel_rapl_common(E) int340x_thermal_zone(E) ip_tables(E) hid_sensor_hub(E) intel_ishtp_loader(E) intel_ishtp_hid(E) mmc_block(E) hid_multitouch(E) crc32c_intel(E) i915(E) [ 179.552936] hid_asus(E) i2c_algo_bit(E) asus_wmi(E) sparse_keymap(E) rfkill(E) drm_kms_helper(E) intel_ish_ipc(E) intel_ishtp(E) drm(E) wmi(E) video(E) i2c_hid(E) pwm_lpss_platform(E) pwm_lpss(E) sdhci_acpi(E) sdhci(E) mmc_core(E) fuse(E) [ 179.552961] CPU: 0 PID: 1414 Comm: v4l2grab Tainted: G C EL 5.7.0-rc2+ #42 [ 179.552963] Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.306 04/23/2019 [ 179.552968] RIP: 0010:cache_from_obj+0xab/0xf0 [ 179.552973] Code: c3 31 c0 80 3d 1c 38 72 01 00 75 f0 48 c7 c6 20 12 06 9f 48 c7 c7 10 f3 37 9f 48 89 04 24 c6 05 01 38 72 01 01 e8 2c 99 e0 ff <0f> 0b 48 8b 04 24 eb ca 48 8b 57 58 48 8b 48 58 48 c7 c6 30 12 06 [ 179.552976] RSP: 0018:ffffaf1f00c3fae0 EFLAGS: 00010282 [ 179.552980] RAX: 0000000000000029 RBX: 00000000000003ff RCX: 0000000000000007 [ 179.552983] RDX: 00000000fffffff8 RSI: 0000000000000082 RDI: ffff9cb6bbc19cc0 [ 179.552985] RBP: 0000000001000000 R08: 00000000000005a4 R09: ffffaf1f00c3f970 [ 179.552988] R10: 0000000000000005 R11: 0000000000000000 R12: ffffffffc0713da0 [ 179.552991] R13: ffff9cb5a7bb1000 R14: 0000000001000000 R15: ffff9cb5a7bb1000 [ 179.552995] FS: 0000000000000000(0000) GS:ffff9cb6bbc00000(0000) knlGS:0000000000000000 [ 179.552998] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 179.553000] CR2: 00007fe780544400 CR3: 000000002480a000 CR4: 00000000001006f0 [ 179.553003] Call Trace: [ 179.553015] kmem_cache_free+0x19/0x180 [ 179.553070] mmu_l2_unmap+0xd1/0x100 [atomisp] [ 179.553113] ? __bo_merge+0x8f/0xa0 [atomisp] [ 179.553155] mmu_unmap+0xd0/0xf0 [atomisp] [ 179.553198] hmm_bo_unbind+0x62/0xb0 [atomisp] [ 179.553240] hmm_free+0x44/0x60 [atomisp] Signed-off-by: Mauro Carvalho Chehab commit c03496b3bd9281524d11462dc24a7b660ec176c6 Author: Mauro Carvalho Chehab Date: Tue May 12 14:23:28 2020 +0200 media: atomisp: add a notice about possible leak resources Calling acpi_bus_get_device() may end allocating resources that aren't freed. So, add a notice about that, as, if those drivers get out of staging, we may need some changes. Fixes: 0d64e9420583 ("media: atomisp: Add some ACPI detection info") Signed-off-by: Mauro Carvalho Chehab commit 5f1fcf8c0adc94a334832a7fdf925801b8c339b4 Author: Andy Shevchenko Date: Wed Apr 15 20:00:46 2020 +0300 usb: pulse8-cec: Switch to use %ptT Use %ptT instead of open coded variant to print content of time64_t type in human readable format. Link: https://lore.kernel.org/r/20200415170046.33374-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Hans Verkuil Acked-by: Sergey Senozhatsky Rewieved-by: Petr Mladek Signed-off-by: Petr Mladek commit 4a60f58ee00266ebee652e991954e48d060ea950 Author: Andy Shevchenko Date: Wed Apr 15 20:00:45 2020 +0300 ARM: bcm2835: Switch to use %ptT Use %ptT instead of open coded variant to print content of time64_t type in human readable format. Link: https://lore.kernel.org/r/20200415170046.33374-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Sergey Senozhatsky Rewieved-by: Petr Mladek Signed-off-by: Petr Mladek commit 7daac5b2fdf88e3c3e84cf0d577f524beb0244ab Author: Andy Shevchenko Date: Wed Apr 15 20:00:44 2020 +0300 lib/vsprintf: Print time64_t in human readable format There are users which print time and date represented by content of time64_t type in human readable format. Instead of open coding that each time introduce %ptT[dt][r] specifier. Few test cases for %ptT specifier has been added as well. Link: https://lore.kernel.org/r/20200415170046.33374-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reviewed-by: Alexandre Belloni Acked-by: Sergey Senozhatsky Rewieved-by: Petr Mladek Signed-off-by: Petr Mladek commit 814634b8e81ff54bfed69bba14656fc703221bd0 Author: Mauro Carvalho Chehab Date: Wed May 20 06:53:08 2020 +0200 media: atomisp: disable the dynamic and reserved pools The memory management code for atomisp is complex: it has 2 extra pools (plus some ION-specific code). The code for those extra pools are complex, and there are even some parts of code over there that were forked from some mm/ code, probably from Kernel 3.10. Let's just use a single one, in order to make the driver simpler. Signed-off-by: Mauro Carvalho Chehab commit eda1310b4087d6793c3e02c425e2292941f24631 Author: Mauro Carvalho Chehab Date: Tue May 19 18:21:49 2020 +0200 media: atomisp: turn on camera before setting it Camera cannot be set on power off mode. Signed-off-by: Mauro Carvalho Chehab commit 1bc075cbaf642e3ed74540aa54e7ef6c5274e2b1 Author: Mauro Carvalho Chehab Date: Tue May 19 17:43:57 2020 +0200 media: atomisp: simplify ov2680 array write logic Instead of trying to send multiple bytes at the same time, just go one by one, like the upstream driver does. Signed-off-by: Mauro Carvalho Chehab commit b0ac238396c41e78025d05d9167027940fbef2b4 Author: Mauro Carvalho Chehab Date: Tue May 19 17:31:50 2020 +0200 media: atomisp-ov2680: get rid of the type field This isn't really used, so get rid, in order to make the code simpler. Signed-off-by: Mauro Carvalho Chehab commit 4f78f0840ffe4cfb03ea7bc5152b86a1efbdcfb0 Author: Mauro Carvalho Chehab Date: Tue May 19 12:30:27 2020 +0200 media: atomisp: use read/write routines from mainstream There is an ov2680 driver mainstream. Use the read/write routines from it, as the ones inside this driver are generating some errors: ov2680 i2c-OVTI2680:00: ov2680_i2c_write: i2c write reg=0x3086, value 0x00, error -121 Maybe the code that changes from/to BE are not right. Signed-off-by: Mauro Carvalho Chehab commit 5589ea0745ef4fd00c2df83bad82b2aa75f50535 Author: Mauro Carvalho Chehab Date: Tue May 19 11:13:05 2020 +0200 media: atomisp: ov2680: improve debug messages Change some code at ov2680 for it to better report what's happening there at sensor's level. Signed-off-by: Mauro Carvalho Chehab commit 1d6e5c3040c1a2b561dddc235233ef6b176a97b8 Author: Mauro Carvalho Chehab Date: Tue May 19 10:35:38 2020 +0200 media: atomisp: change the code to properly wait for sensor The sensor should finish its init before atomisp driver, as otherwise the atomisp driver won't be able to talk with it. So, we need to turn atomisp_gmin_platform into a module again, for it to not depend on atomisp driver to finish probing, and add some delay at atomisp to let the sensor driver to finish probing. Yeah, this is hacky. The real solution here would be to use the async framework, but for now, our goal is to make the driver to work. So, let's postpone such change to be done later. Signed-off-by: Mauro Carvalho Chehab commit 95d1f398c4dc3f55e9007c89452ccc16301205fc Author: Mauro Carvalho Chehab Date: Tue May 19 09:15:41 2020 +0200 media: atomisp: keep the ISP powered on when setting it The current code causes ISP2401 to power down and never return back to live, causing the driver to crash. Fix it by commenting out the bad code. It should be noticed that the Yocto Aero code has something similar to it. Maybe the issue is related to an ISP bug (or maybe PM is controlled on a different way for this hardware). Signed-off-by: Mauro Carvalho Chehab commit 39c91e18c1408e3a0ccb43d17dc983b8f2932f4c Author: Mauro Carvalho Chehab Date: Mon May 18 18:09:53 2020 +0200 media: atomisp: fix the value for CamClk on Asus T101HA The value returned by BIOS is 1. Fix it at the driver, as it won't read this from EFI. Signed-off-by: Mauro Carvalho Chehab commit 7f98b894595eeeaba41e28c0b0ee235ce1ecfdf9 Author: Mauro Carvalho Chehab Date: Wed May 13 11:31:20 2020 +0200 media: atomisp: fix a slab error due to a wrong free The mmu mapping logic uses a different logic depending on the RAM size: if it is lower than 2GB, it uses kmem_cache_zalloc(), but if memory is bigger than that, it uses its own way to allocate memory. Yet, when freeing, it uses kmem_cache_free() for any cases. On recent Kernels, slab tracks the memory allocated on it, with causes those warnings: virt_to_cache: Object is not a Slab page! WARNING: CPU: 0 PID: 758 at mm/slab.h:475 cache_from_obj+0xab/0xf0 Modules linked in: snd_soc_sst_cht_bsw_rt5645(E) mei_hdcp(E) gpio_keys(E) intel_rapl_msr(E) intel_powerclamp(E) coretemp(E) kvm_intel(E) kvm(E) irqbypass(E) crct10dif_pclmul(E) crc32_pclmul(E) ghash_clmulni_intel(E) atomisp_ov2680(CE) intel_cstate(E) asus_nb_wmi(E) wdat_wdt(E) pcspkr(E) ath10k_pci(E) ath10k_core(E) intel_chtdc_ti_pwrbtn(E) ath(E) mac80211(E) btusb(E) joydev(E) btrtl(E) btbcm(E) btintel(E) bluetooth(E) libarc4(E) ecdh_generic(E) cfg80211(E) ecc(E) hid_sensor_gyro_3d(E) hid_sensor_accel_3d(E) hid_sensor_trigger(E) hid_sensor_iio_common(E) industrialio_triggered_buffer(E) kfifo_buf(E) industrialio(E) atomisp(CE) videobuf_vmalloc(E) videobuf_core(E) videodev(E) mc(E) snd_soc_rt5645(E) snd_soc_rl6231(E) snd_intel_sst_acpi(E) snd_intel_sst_core(E) snd_soc_sst_atom_hifi2_platform(E) snd_soc_acpi_intel_match(E) intel_hid(E) spi_pxa2xx_platform(E) snd_soc_acpi(E) snd_soc_core(E) snd_compress(E) dw_dmac(E) intel_xhci_usb_role_switch(E) int3406_thermal(E) snd_hdmi_lpe_audio(E) int3403_thermal(E) int3400_thermal(E) acpi_thermal_rel(E) snd_seq(E) intel_int0002_vgpio(E) soc_button_array(E) snd_seq_device(E) acpi_pad(E) snd_pcm(E) snd_timer(E) snd(E) soundcore(E) lpc_ich(E) mei_txe(E) mei(E) processor_thermal_device(E) intel_soc_dts_iosf(E) intel_rapl_common(E) int340x_thermal_zone(E) ip_tables(E) hid_sensor_hub(E) intel_ishtp_loader(E) intel_ishtp_hid(E) mmc_block(E) hid_multitouch(E) crc32c_intel(E) i915(E) i2c_algo_bit(E) drm_kms_helper(E) hid_asus(E) asus_wmi(E) sparse_keymap(E) rfkill(E) drm(E) intel_ish_ipc(E) intel_ishtp(E) wmi(E) video(E) i2c_hid(E) sdhci_acpi(E) sdhci(E) mmc_core(E) pwm_lpss_platform(E) pwm_lpss(E) fuse(E) CPU: 0 PID: 758 Comm: v4l_id Tainted: G C E 5.7.0-rc2+ #40 Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.306 04/23/2019 RIP: 0010:cache_from_obj+0xab/0xf0 Code: c3 31 c0 80 3d 1c 38 72 01 00 75 f0 48 c7 c6 20 12 06 b5 48 c7 c7 10 f3 37 b5 48 89 04 24 c6 05 01 38 72 01 01 e8 2c 99 e0 ff <0f> 0b 48 8b 04 24 eb ca 48 8b 57 58 48 8b 48 58 48 c7 c6 30 12 06 RSP: 0018:ffffb0a4c07cfb10 EFLAGS: 00010282 RAX: 0000000000000029 RBX: 0000000000000048 RCX: 0000000000000000 RDX: ffffa004fbca5b80 RSI: ffffa004fbc19cc8 RDI: ffffa004fbc19cc8 RBP: 0000000000c49000 R08: 00000000000004f7 R09: 0000000000000001 R10: 0000000000aaaaaa R11: ffffffffb50e0600 R12: ffffffffc0be0a00 R13: ffffa003f2448000 R14: 0000000000c49000 R15: ffffa003f2448000 FS: 00007f9060c9cb80(0000) GS:ffffa004fbc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000559fc55b8000 CR3: 0000000165b02000 CR4: 00000000001006f0 Call Trace: kmem_cache_free+0x19/0x180 mmu_l2_unmap+0xd1/0x100 [atomisp] mmu_unmap+0xd0/0xf0 [atomisp] hmm_bo_unbind+0x62/0xb0 [atomisp] hmm_free+0x44/0x60 [atomisp] ia_css_spctrl_unload_fw+0x30/0x50 [atomisp] ia_css_uninit+0x3a/0x90 [atomisp] atomisp_open+0x50b/0x5c0 [atomisp] v4l2_open+0x85/0xf0 [videodev] chrdev_open+0xdd/0x210 ? cdev_device_add+0xc0/0xc0 do_dentry_open+0x13a/0x380 path_openat+0xa9a/0xfe0 do_filp_open+0x75/0x100 ? __check_object_size+0x12e/0x13c ? __alloc_fd+0x44/0x150 do_sys_openat2+0x8a/0x130 __x64_sys_openat+0x46/0x70 do_syscall_64+0x5b/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Solve it by calling free_page() directly Signed-off-by: Mauro Carvalho Chehab commit 5f1e9dd555ee733a6ecb613f914840fb93dc25d6 Author: Mauro Carvalho Chehab Date: Wed May 13 11:29:21 2020 +0200 media: atomisp: get rid of __bo_alloc() macro Simplify the hmm_bo a little bit by removing this macro. This will avoid printing twice errors when allocations happen. Signed-off-by: Mauro Carvalho Chehab commit 983e5aca98bf569e45a98905e3f604f4c8fc58c8 Author: Mauro Carvalho Chehab Date: Tue May 12 23:02:58 2020 +0200 media: atomisp: get rid of spmem_dump.c Those files seem to be firmware-dependent, probably being used by some debug interface. Well, their contents are not really used by atomisp, so let's just send them to the trash can, as it shouldn't have any usage upstream. Signed-off-by: Mauro Carvalho Chehab commit 3117ddda1ecef96e646b120681a606b41247df52 Author: Mauro Carvalho Chehab Date: Tue May 12 20:32:51 2020 +0200 media: atomisp: fix an inverted logic When changing the IFs to select isp2401 at runtime, one of the conditions ended by being written wrong. Code double-checked on both Yocto Aero's driver version and against the previous code. Signed-off-by: Mauro Carvalho Chehab commit 1351ea6b04c8488d0bfde4a2ee55ae111f4a0b0d Author: Mauro Carvalho Chehab Date: Wed May 13 08:04:18 2020 +0200 media: atomisp: remove a misplaced #endif There is an endif in the middle of a comment at ia_css_xnr3.host.c. Remove it. Signed-off-by: Mauro Carvalho Chehab commit 0f441fd70b1e7d1a4e035410f9effbfdf5c273fa Author: Mauro Carvalho Chehab Date: Tue May 12 15:13:50 2020 +0200 media: atomisp: simplify the power down/up code Use the version from intel_atomisp2_pm.c for power up/down, removing some code duplication and using just one kAPI call for modifying the ISPSSPM0 register. Signed-off-by: Mauro Carvalho Chehab commit a27b5811819705910220c70239dd5eec49fefa2d Author: Mauro Carvalho Chehab Date: Tue May 12 14:07:19 2020 +0200 media: atomisp: use pcim_enable_device() again Changing to pci_enable_device() didn't produce the expected result. It could also eventually led to problems when driver is removed, due to object lifetime issues. So, let's just return to the previous behavior. Suggested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 4877b19e13a3a550819349ea0d46b5f0b775ed3f Author: Mauro Carvalho Chehab Date: Tue May 12 12:45:40 2020 +0200 media: atomisp: spctrl: be sure to zero .code_addr after free We need that to avoid trying to double-free the driver. Signed-off-by: Mauro Carvalho Chehab commit b4dc4e139beb406784c4ef2f1bc359eac37de5be Author: Mauro Carvalho Chehab Date: Mon May 11 14:07:26 2020 +0200 media: atomisp: add support for different PMIC configurations This patch required lots of research and work. The existing atomisp driver at staging assumed that all Intel PMIC would be using regulators, but upstream didn't follow it. Instead, the intel_pmic.c driver added a hack, instead of using i2c_transfer, it writes I2C values directly via regmapped registers. Oh, well... At least, it provided a common API for doing that. The PMIC settings used here came from the driver at the yocto Aero distribution: https://download.01.org/aero/deb/pool/main/l/linux-4.4.76-aero-1.3/ The logic itself was re-written, in order to use the I2C address detected by the probing part. Signed-off-by: Mauro Carvalho Chehab commit 0741bf667f3cf2e9cf6ec88985e14495a95f1540 Author: Mauro Carvalho Chehab Date: Mon May 11 11:47:25 2020 +0200 media: atomisp: move atomisp_gmin_platform.c to pci/ dir The atomisp_gmin_platform.c is not a platform driver anymore, but it is, instead, part of the atomisp driver. Move it to be together with the driver. As a bonus, as the atomisp i2c drivers depends on its contents, probing them should load automatically the atomisp core. This should likely avoid some possible race conditions. Signed-off-by: Mauro Carvalho Chehab commit 93e24ec6bfe6eeb5e74915e2761136c25cf6cd8d Author: Mauro Carvalho Chehab Date: Sun May 10 22:04:37 2020 +0200 media: atomisp: detect the PMIC type Sub-device's power management can be provided via different ways. Instead of hardcoding it, add a code that would be detecting it. This uses a code similar to what's found at the atomisp driver inside the Intel Aero repository: https://github.com/intel-aero/meta-intel-aero.git (driver was removed on some commit, but it can be found on git history). Signed-off-by: Mauro Carvalho Chehab commit a79afb97e0227f7224bbf2e0ee12f2a4f719cc0a Author: Mauro Carvalho Chehab Date: Sun May 10 17:23:03 2020 +0200 media: atomisp: warn if unsupported subdevs are found Right now, the driver supports just one VCM and just one flash device. Warn if more than one such devices were probed. Signed-off-by: Mauro Carvalho Chehab commit 09d87466655d00526cf818b3f3b267884c591702 Author: Mauro Carvalho Chehab Date: Sun May 10 16:06:53 2020 +0200 media: atomisp: reduce the risk of a race condition This driver is really on bad shape. One of the problems is that, as soon as the I2C transfers start to happen, it timeouts detecting a camera: ov2680 i2c-OVTI2680:00: ov2680_probe: ACPI detected it on bus ID=CAM1, HID=OVTI2680 atomisp-isp2 0000:00:03.0: no camera attached or fail to detect ov2680 i2c-OVTI2680:00: gmin: initializing atomisp module subdev data using PMIC regulator ... The right fix here would be to use defer probe, but driver is still on too bad shape. Signed-off-by: Mauro Carvalho Chehab commit d03f2e248c416cd07105ad25fe1809c14fbb47c1 Author: Mauro Carvalho Chehab Date: Sun May 10 15:49:41 2020 +0200 media: atomisp: print the type of PMIC that will be used While the current code is hardcoded to just one specific type of PMIC, it can support several types. Those should be board-dependent. Instead of just printing a number, change the message to display what type of PMIC control is used at runtime. Signed-off-by: Mauro Carvalho Chehab commit 85df8457b31c4c277f59b80c1e2a636d34f0c8ce Author: Mauro Carvalho Chehab Date: Sun May 10 13:39:18 2020 +0200 media: atomisp: better display DMI and EFI found entries There are several device-specific data that are obtained either via DMI or EFI, with changes the driver's behavior. Display what has been detected, as such info may help identifying troubles at the driver. Signed-off-by: Mauro Carvalho Chehab commit 0d64e9420583cbc3c4a3f949ebe38fd8f7769281 Author: Mauro Carvalho Chehab Date: Sun May 10 10:29:57 2020 +0200 media: atomisp: Add some ACPI detection info When someone would report problems with a new device, we need to know the DMI product ID and the ACPI name for the detected sensor. So, print them at dmesg. Signed-off-by: Mauro Carvalho Chehab commit 88a4711e7973836e3802e75e954e3cd1b07b3fba Author: Mauro Carvalho Chehab Date: Sat May 9 09:59:54 2020 +0200 media: atomisp: add -dDEBUG when building this driver This driver still has lots of issues. Let's enable debug there inconditionally, as we need more information in order to address the pending issues. Signed-off-by: Mauro Carvalho Chehab commit 9972311643ac9c8f550272410a0cd4d6a2671eee Author: Mauro Carvalho Chehab Date: Sat May 9 09:48:37 2020 +0200 media: atomisp: make dfs_config_merr_117a struct const This setting is used only for one of te Merryfield PCI IDs. As this is an ISP2400, we can just get rid of a version test, writing the right value directly inside the struct. Signed-off-by: Mauro Carvalho Chehab commit 25bccb98ae05c06edc0c31cb82e6bf105124855c Author: Mauro Carvalho Chehab Date: Fri May 8 11:27:39 2020 +0200 media: atomisp: free PCI resources when probing fail The atomisp probe error logic is incomplete. Add the missing bits to return the PCI device to its original state. Signed-off-by: Mauro Carvalho Chehab commit 33c24f8f5a2716824bb0af959d7eb87c94133cfc Author: Mauro Carvalho Chehab Date: Fri May 8 12:38:37 2020 +0200 media: atomisp: relax firmware version detection criteria As getting the exact version used by the driver is not easy, let's relax the version detection and hope for the best, producing just a warning. Signed-off-by: Mauro Carvalho Chehab commit ca133c395f2f6ccf7980677d6583224d23711897 Author: Mauro Carvalho Chehab Date: Fri May 8 11:27:02 2020 +0200 media: atomisp: improve device detection code - Remove useless check if !dev at the probe function: if such function is called, the device is defined. - Cleanup the PCI ID table using macros. - Use the same macros at the version-dependent part of the atomisp_v4l2.c file; - Add print messages to help understand what model the driver detect; - If device is not valid, better explain why. Signed-off-by: Mauro Carvalho Chehehab commit 128516e49de67d10d52fba62ef8d482b220ac4b0 Author: Dan Carpenter Date: Wed May 20 15:03:06 2020 +0300 iio: dummy_evgen: Fix use after free on error in iio_dummy_evgen_create() We need to preserve the "iio_evgen->irq_sim_domain" error code before we free "iio_evgen" otherwise it leads to a use after free. Fixes: 337cbeb2c13e ("genirq/irq_sim: Simplify the API") Signed-off-by: Dan Carpenter Signed-off-by: Marc Zyngier commit 9b9df63b50306b9602954d2f40fa8e05c0c27fda Author: Geert Uytterhoeven Date: Fri May 8 12:03:21 2020 +0200 dt-bindings: clock: renesas: mstp: Convert to json-schema Convert the Renesas Clock Pulse Generator (CPG) Module Stop (MSTP) Clocks Device Tree binding documentation to json-schema. Drop R-Car Gen2 compatible values, which were obsoleted by the unified "Renesas Clock Pulse Generator / Module Standby and Software Reset" DT bindings. Replace the obsolete example for R-Car H2 by an example that is still valid. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200508100321.6720-1-geert+renesas@glider.be commit dfae0422de12265ae7c9bf57b34990200dea0c83 Author: Geert Uytterhoeven Date: Mon May 18 10:18:36 2020 +0200 MAINTAINERS: Renesas Pin Controllers are supported Change "PIN CONTROLLER - RENESAS" section from Maintained to Supported. This brings it in line with my other "+renesas" entries. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200518081836.23890-1-geert+renesas@glider.be commit 84091304a48c6d86a910b5a7d187592097da150f Author: Vinod Koul Date: Wed May 20 17:27:45 2020 +0530 soundwire: fix spelling mistake Fix typo for paranoia spelled as paranioa Fixes: bcac59029955 ("soundwire: add Slave sysfs support") Signed-off-by: Vinod Koul commit 7541765df14b2a705cafbe46632069a4f71af1c4 Author: Vinod Koul Date: Wed May 20 17:27:45 2020 +0530 soundwire: fix trailing line in sysfs_slave.c Commit bcac59029955 ("soundwire: add Slave sysfs support") added trailing line in file sysfs_slave.c, so remove it Fixes: bcac59029955 ("soundwire: add Slave sysfs support") Signed-off-by: Vinod Koul commit bcac59029955ae57d3c660a0a1d6d4c7ae78fb49 Author: Pierre-Louis Bossart Date: Tue May 19 04:35:51 2020 +0800 soundwire: add Slave sysfs support Expose MIPI DisCo Slave properties in sysfs. For Slave properties and Data Port 0, the attributes are managed with simple devm_ support. A Slave Device may have more than one Data Port (DPN), and each Data Port can be sink or source. The attributes are created dynamically using pre-canned macros, but still use devm_ with a name attribute group to avoid creating kobjects - as requested by GregKH. In the _show function, we use container_of() to retrieve port number and direction required to extract the information. Audio modes are not supported for now. Depending on the discussions the SoundWire Device Class, we may add it later as is or follow the new specification. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20200518203551.2053-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit c5778ca49a19420c67dbeff0744a3b3b75ef4e1a Author: Pierre-Louis Bossart Date: Tue May 19 04:35:50 2020 +0800 soundwire: master: add sysfs support Add the master properties as attributes. The description is directly derived from the MIPI DisCo specification. Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20200518203551.2053-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 6bf393c577c4a6e324ab103425fbf71126e5385b Author: Pierre-Louis Bossart Date: Tue May 19 04:35:49 2020 +0800 soundwire: disco: s/ch/channels/ Use more meaningful member names in preparation for sysfs support. No functionality change. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20200518203551.2053-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 32956dda97577f0960eb3d9d9aff7338d0cf4cc4 Author: Matthias Brugger Date: Mon May 18 13:31:55 2020 +0200 clk/soc: mediatek: mt6779: Bind clock driver from platform device The mmsys driver is now the top level entry point for the multimedia system (mmsys), we bind the clock driver by creating a platform device. We also bind the MediaTek DRM driver which is not yet implement and therefor will errror out for now. Signed-off-by: Matthias Brugger Reviewed-by: Chun-Kuang Hu Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20200518113156.25009-3-matthias.bgg@kernel.org Signed-off-by: Matthias Brugger commit cad4e3790a987867c3779b59521f19ff75b8d8b6 Author: Matthias Brugger Date: Mon May 18 13:31:54 2020 +0200 clk/soc: mediatek: mt6797: Bind clock driver from platform device The mmsys driver is now the top level entry point for the multimedia system (mmsys), we bind the clock driver by creating a platform device. We also bind the MediaTek DRM driver which is not yet implement and therefor will errror out for now. Signed-off-by: Matthias Brugger Reviewed-by: Chun-Kuang Hu Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20200518113156.25009-2-matthias.bgg@kernel.org Signed-off-by: Matthias Brugger commit 1f9adbc72824ff07bbffd776d8b51f91f5a82c18 Author: Matthias Brugger Date: Mon May 18 13:31:53 2020 +0200 clk/soc: mediatek: mt8183: Bind clock driver from platform device The mmsys driver is now the top level entry point for the multimedia system (mmsys), we bind the clock driver by creating a platform device. We also bind the MediaTek DRM driver which is not yet implement and therefor will errror out for now. Signed-off-by: Matthias Brugger Reviewed-by: Chun-Kuang Hu Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20200518113156.25009-1-matthias.bgg@kernel.org Signed-off-by: Matthias Brugger commit 0607a30d5f8b80cab57c32ffb3ed6733c66edf7e Author: Matthias Brugger Date: Mon May 18 13:31:56 2020 +0200 arm64: dts: mt6797: Fix mmsys node name Node names are supposed to match the class of the device. The mmsys node is a syscon as it provides more then just a clock controller. Update the name. Signed-off-by: Matthias Brugger Reviewed-by: Chun-Kuang Hu Link: https://lore.kernel.org/r/20200518113156.25009-4-matthias.bgg@kernel.org Signed-off-by: Matthias Brugger commit ae167ae25b37deb05978cfe56e6e43ff59fc3d57 Author: Enric Balletbo i Serra Date: Wed Apr 1 22:17:36 2020 +0200 arm64: dts: mt8173: Fix mmsys node name Node names are supposed to match the class of the device, mmsys is a system controller (syscon) not a clock controller, so change the node name accordingly. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chun-Kuang Hu Link: https://lore.kernel.org/r/20200401201736.2980433-4-enric.balletbo@collabora.com Signed-off-by: Matthias Brugger commit c292b133b58b49d9c5d6a838a8de7831fd97f58d Author: Enric Balletbo i Serra Date: Wed Apr 1 22:17:35 2020 +0200 clk / soc: mediatek: Bind clock and gpu driver for mt2701 Now that the mmsys driver is the top-level entry point for the multimedia subsystem, we could bind the clock and the gpu driver on those devices that is expected to work, so the drm driver is intantiated by the mmsys driver and display, hopefully, working again. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chun-Kuang Hu Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20200401201736.2980433-3-enric.balletbo@collabora.com Signed-off-by: Matthias Brugger commit 9c5a0a3a8f0403c911ed4f02d4f4a81fe3c22889 Author: Enric Balletbo i Serra Date: Wed Apr 1 22:17:34 2020 +0200 clk / soc: mediatek: Bind clock and gpu driver for mt2712 Now that the mmsys driver is the top-level entry point for the multimedia subsystem, we could bind the clock and the gpu driver on those devices that is expected to work, so the drm driver is intantiated by the mmsys driver and display, hopefully, working again on those devices. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chun-Kuang Hu Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20200401201736.2980433-2-enric.balletbo@collabora.com Signed-off-by: Matthias Brugger commit 52660e568518b07daf15d117ef5a704909ea2513 Author: Enric Balletbo i Serra Date: Wed Apr 1 22:17:33 2020 +0200 soc: mediatek: Enable mmsys driver by default if Mediatek arch is selected The mmsys driver supports only MT8173 device for now, but like other system controllers is an important piece for other Mediatek devices. Actually it depends on the mt8173 clock specific driver but that dependency is not real as it can build without the clock driver. Instead of depends on a specific model, make the driver depends on the generic ARCH_MEDIATEK and enable by default so other Mediatek devices can start using it without flood the Kconfig. Signed-off-by: Enric Balletbo i Serra Tested-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20200401201736.2980433-1-enric.balletbo@collabora.com Signed-off-by: Matthias Brugger commit 9b7632e8fe7f7e0d75a61dccf2917e55022ecb66 Author: Mauro Carvalho Chehab Date: Fri May 8 08:55:19 2020 +0200 media: atomisp: fix clock rate frequency setting changeset d5426f4c2eba ("media: staging: atomisp: use clock framework for camera clocks") removed a platform-specific code to set the clock rate, in favor of using the Kernel clock framework. However, instead of passing the frequency for clk_set_rate(), it is passing either 0 or 1. Looking at the original patchset, it seems that there are two possible configurations for the ISP: 0 - it will use a 25 MHz XTAL to provide the clock; 1 - it will use a PLL with is set to 19.2 MHz (only for the CHT version?) Eventually, different XTALs and/or PLL frequencies might be possible some day, so, re-implent the logic for it to be more generic. Fixes: d5426f4c2eba ("media: staging: atomisp: use clock framework for camera clocks") Signed-off-by: Mauro Carvalho Chehab commit f770e91a7b64043dd730b59b5e62d82e71faec63 Author: Mauro Carvalho Chehab Date: Thu May 7 20:05:38 2020 +0200 media: atomisp: limit the name of the firmware file The firmware header has 64 bytes. Properly limit it to such size. Signed-off-by: Mauro Carvalho Chehab commit 8568fe630066a733456fb1ffc8e1402191d7e27c Author: Mauro Carvalho Chehab Date: Thu May 7 18:33:29 2020 +0200 media: atomisp: print a better message when fw version is wrong The printed message when a firmware version is wrong says nothing usefull: atomisp-isp2 0000:00:03.0: Fw version check failed. atomisp-isp2: probe of 0000:00:03.0 failed with error -22 Print the expected and the received firmware version instead. In order to do that, the firmware functions will need at least a struct device pointer, so pass it. While writing this patch, it was noticed that some of the abstraction layers of this driver have functions that are never called, but use this interface. Get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 1ab709827c08619c7b2401ea7e0769a9b70846fe Author: Mauro Carvalho Chehab Date: Thu May 7 10:19:59 2020 -0400 media: atomisp: disable the dummy PM driver is atomisp driver is built As the atomisp driver should already be handling the ISP PCI ID, there's no sense on keeping the dummy driver enabled in tis case. Signed-off-by: Mauro Carvalho Chehab commit 32efca3d55799b3e644e1ceca10e2f3b6b6eb76a Author: Mauro Carvalho Chehab Date: Sun May 3 17:02:51 2020 +0200 media: atomisp: move ia_css_configure_sc() implementation With the changes, this function is now undefined if built for ISP2400. So, move its implementation to the file which calls it. Reported-by: Francescodario Cuzzocrea Signed-off-by: Mauro Carvalho Chehab commit 8ac171401531a18016c3eb8258a6316aef65047b Author: Mauro Carvalho Chehab Date: Sat May 2 18:15:48 2020 +0200 media: atomisp: fix querycap initialization logic Some recent changes at V4L2 core changed the way querycap is handled. Due to that, this warning is generated: WARNING: CPU: 1 PID: 503 at drivers/media/v4l2-core/v4l2-dev.c:885 __video_register_device+0x93e/0x1120 [videodev] as introduced by this commit: commit 3c1350501c21db8e3b1a38d9e97db29694305c3b Author: Hans Verkuil Date: Tue Jul 23 04:21:25 2019 -0400 media: v4l2-dev/ioctl: require non-zero device_caps, verify sane querycap results Now that all V4L2 drivers set device_caps in struct video_device, we can add a check for this to ensure all future drivers fill this in. The fix is simple: we just need to initialize dev_caps before registering the V4L2 dev. While here, solve other problems at VIDIOC_QUERYCAP ioctl. Reported-by: Patrik Gfeller Signed-off-by: Mauro Carvalho Chehab commit ac378c94c7c6b2af7ad4afdb4c97f37976cdcc5b Author: Mauro Carvalho Chehab Date: Fri May 1 22:50:36 2020 +0200 media: atomisp: use add_qos_request instead of update It doesn't make senst to update a request that was not created. So, instead of using cpu_latency_qos_update_request(), let's use, instead cpu_latency_qos_add_request() at device probing code. This should fix this issue: [ 9.691775] cpu_latency_qos_update_request called for unknown object [ 9.695279] WARNING: CPU: 3 PID: 523 at kernel/power/qos.c:296 cpu_latency_qos_update_request+0x3a/0xb0 [ 9.698826] Modules linked in: snd_soc_acpi_intel_match snd_rawmidi snd_soc_acpi snd_soc_rl6231 snd_soc_core ath mac80211 snd_compress snd_hdmi_lpe_audio ac97_bus hid_sensor_accel_3d snd_pcm_dmaengine hid_sensor_gyro_3d hid_sensor_trigger industrialio_triggered_buffer kfifo_buf hid_sensor_iio_common processor_thermal_device industrialio cfg80211 snd_pcm snd_seq intel_rapl_common atomisp(C+) libarc4 intel_soc_dts_iosf cros_ec_ishtp intel_xhci_usb_role_switch mei_txe cros_ec videobuf_vmalloc mei roles atomisp_ov2680(C) videobuf_core snd_seq_device snd_timer spi_pxa2xx_platform videodev snd mc dw_dmac intel_hid dw_dmac_core 8250_dw soundcore int3406_thermal int3400_thermal intel_int0002_vgpio acpi_pad acpi_thermal_rel soc_button_array int3403_thermal int340x_thermal_zone mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_sensor_custom hid_sensor_hub intel_ishtp_loader intel_ishtp_hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 mmc_block i2c_algo_bit [ 9.698885] aesni_intel crypto_simd drm_kms_helper cryptd syscopyarea sysfillrect glue_helper sysimgblt fb_sys_fops cec intel_ish_ipc drm lpc_ich intel_ishtp hid_asus intel_soc_pmic_chtdc_ti asus_wmi i2c_hid sparse_keymap sdhci_acpi wmi video sdhci hid_generic usbhid hid [ 9.736699] CPU: 3 PID: 523 Comm: systemd-udevd Tainted: G C 5.7.0-rc1+ #2 [ 9.741309] Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.305 01/24/2018 [ 9.745962] RIP: 0010:cpu_latency_qos_update_request+0x3a/0xb0 [ 9.750615] Code: 89 e5 41 55 41 54 41 89 f4 53 48 89 fb 48 81 7f 28 e0 7f c6 9e 74 1c 48 c7 c6 60 f3 65 9e 48 c7 c7 e8 a9 99 9e e8 b2 a6 f9 ff <0f> 0b 5b 41 5c 41 5d 5d c3 0f 1f 44 00 00 44 3b 23 74 ef 44 89 e2 [ 9.760065] RSP: 0018:ffffa865404f39c0 EFLAGS: 00010282 [ 9.764734] RAX: 0000000000000000 RBX: ffff9d2aefc84350 RCX: 0000000000000000 [ 9.769435] RDX: ffff9d2afbfa97c0 RSI: ffff9d2afbf99808 RDI: ffff9d2afbf99808 [ 9.774125] RBP: ffffa865404f39d8 R08: 0000000000000304 R09: 0000000000aaaaaa [ 9.778804] R10: 0000000000000000 R11: 0000000000000001 R12: 00000000ffffffff [ 9.783491] R13: ffff9d2afb4640b0 R14: ffffffffc07ecf20 R15: 0000000091000000 [ 9.788187] FS: 00007efe67ff8880(0000) GS:ffff9d2afbf80000(0000) knlGS:0000000000000000 [ 9.792864] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9.797482] CR2: 00007ffc6424bdc8 CR3: 0000000178998000 CR4: 00000000001006e0 [ 9.802126] Call Trace: [ 9.806775] atomisp_pci_probe.cold.19+0x15f/0x116f [atomisp] [ 9.811441] local_pci_probe+0x47/0x80 [ 9.816085] pci_device_probe+0xff/0x1b0 [ 9.820706] really_probe+0x1c8/0x3e0 [ 9.825247] driver_probe_device+0xd9/0x120 [ 9.829769] device_driver_attach+0x58/0x60 [ 9.834294] __driver_attach+0x8f/0x150 [ 9.838782] ? device_driver_attach+0x60/0x60 [ 9.843205] ? device_driver_attach+0x60/0x60 [ 9.847634] bus_for_each_dev+0x79/0xc0 [ 9.852033] ? kmem_cache_alloc_trace+0x167/0x230 [ 9.856462] driver_attach+0x1e/0x20 Reported-by: Patrik Gfeller Signed-off-by: Mauro Carvalho Chehab commit 0057131fea6ddf9583baf9b7defa0ce2e51e9b7e Author: Mauro Carvalho Chehab Date: Fri May 1 14:17:21 2020 +0200 media: atomisp: remove some file duplication and do more dir renames There are currently two identical copies of some files, one at css_2401_csi2p_system/ and another one at css_2401_system/. Get rid of one of them, moving the remaining files to the directory with the shortest name. While here, do more renames, in order to get smaller path names. Signed-off-by: Mauro Carvalho Chehab commit bbf3f7827ef5ae262f6ef44d8dcc6e77fd1edac5 Author: Mauro Carvalho Chehab Date: Fri May 1 11:17:06 2020 +0200 media: atomisp: add firmware load code for ISP2401 rev B0 The Asus Transformer T101HA comes with a newer hardware version. Add support to load firmware for it. Signed-off-by: Mauro Carvalho Chehab commit 3c0538fbad9f1d07d588f631e380256d941e3d3a Author: Mauro Carvalho Chehab Date: Thu Apr 30 13:56:47 2020 +0200 media: atomisp: get rid of most checks for ISP2401 version There are lots of places inside this driver checking for ISP2400/ISP2401 verison. Get rid of most of those, while keep building for both. Most of stuff in this patch is trivial to solve. Signed-off-by: Mauro Carvalho Chehab commit f0648058c59ac23792561d1036f563518557e00a Author: Mauro Carvalho Chehab Date: Thu Apr 30 14:21:15 2020 +0200 media: atomisp: cleanup contents of css_2401_system Everything there is for ISP2401 only. So, we can trivially solve all ifdefs at once. Signed-off-by: Mauro Carvalho Chehab commit f172f6eef1ff7d8bc8c9353d410376f258031bdb Author: Mauro Carvalho Chehab Date: Thu Apr 30 14:19:44 2020 +0200 media: atomisp: cleanup contents of css_2401_csi2p_system Everything there is for ISP2401 only. So, we can trivially solve all ifdefs at once. Signed-off-by: Mauro Carvalho Chehab commit 9935e2928ae6cf52bb813a001817515605250f2d Author: Mauro Carvalho Chehab Date: Thu Apr 30 14:15:18 2020 +0200 media: atomisp: cleanup contents of css_2400_system/ Everything there is for ISP2400 only. So, we can trivially solve all ifdefs at once Signed-off-by: Mauro Carvalho Chehab commit 085093606320ac76a062c99cf12e33c010417b4b Author: Mauro Carvalho Chehab Date: Thu Apr 30 11:32:18 2020 +0200 media: atomisp: allow building for isp2401 Now that everything needed to build for ISP2401 is solved, we can setup atomisp to build either for ISP2400 or ISP2401. Signed-off-by: Mauro Carvalho Chehab commit fe4586ca23ae68e307b75a8d7d7ee248e1a59949 Author: Mauro Carvalho Chehab Date: Thu Apr 30 12:30:07 2020 +0200 media: atomisp: change function worders and fix include With the current way, it will produce lots of errors because the public header contains wrong definitions and the private one has functions defined at the wrong order. Signed-off-by: Mauro Carvalho Chehab commit 8d4af3102d648df0d3d8e9ee8a36f7137b2e9a1c Author: Mauro Carvalho Chehab Date: Thu Apr 30 12:12:25 2020 +0200 media: atomisp: get rid of some broken code Probably due to some version conflicts while the atomisp code were generated, some things don't build for ISP2401. So, use the ISP2400 variant when available, or get rid of the code that doesn't build. Signed-off-by: Mauro Carvalho Chehab commit 9d4fa1a16b28b1d12b0378993d2d48f572a045d9 Author: Mauro Carvalho Chehab Date: Thu Apr 30 09:49:43 2020 +0200 media: atomisp: cleanup directory hierarchy This driver has very long directories without a good reason (IMHO). Let's drop two directories from such hierarchy, in order to simplify things a little bit and make the dir output a bit more readable. Signed-off-by: Mauro Carvalho Chehab commit d8763340d2cb6262fb86424315a1f92cabc0e23c Author: Mauro Carvalho Chehab Date: Thu Apr 30 09:25:26 2020 +0200 media: atomisp: simplify makefiles Remove an uneeded define and Makefile. Signed-off-by: Mauro Carvalho Chehab commit b82cd6b7f587bb6638d6a1cc5254437a9f69a4be Author: Mauro Carvalho Chehab Date: Wed Apr 29 21:55:48 2020 +0200 media: atomisp: make all file names unique at atomisp driver The *system_*.h files contain ISP-specific definitions, and are used everywhere. While the best would be to get rid of those in favor of some ISP-specific structs, a change like that would require lots of changes. So, instead, let's rename those files replacing them by new ones with ISP ifdefs on it, in order to select between the two different versions. We shall later convert this to some abrstraction layer, but this change should help to be able to build support for either ISP2400 or ISP2401. Signed-off-by: Mauro Carvalho Chehab commit c6552aebbe6cae982fd33bd885fcc111da3eeed8 Author: Mauro Carvalho Chehab Date: Wed Apr 29 14:24:48 2020 +0200 media: atomisp: get rid of __ISP define tests This is not defined anywhere, so just get rid of the dead source code. Signed-off-by: Mauro Carvalho Chehab commit e3292f808b75fa0e01b4391c1ce1972855143509 Author: Mauro Carvalho Chehab Date: Wed Apr 29 14:12:27 2020 +0200 media: atomisp: get rid of ISP_VMEM_IS_BAMEM unused defines There are several defines on ISP-specific definition sets that are unused, related to VMEM_BAMEM. Get rid of those. Signed-off-by: Mauro Carvalho Chehab commit 8022c2e2921499816f13ccb46663e8b4e6986299 Author: Mauro Carvalho Chehab Date: Wed Apr 29 11:50:52 2020 +0200 media: atomisp: get rid of ia_css_sc_param.h version dependency That's the last header file which had ifdefs for ISP2401. The problem is that the conflicting dependencies were on another file (sh_css_defs.h). Move the conflicting code to it, adding a prefix which would describe what version the macro applies. Then, ensure that binary.c will use the right version, according with the hardware version. Signed-off-by: Mauro Carvalho Chehab commit e6c1310370138b9f9ef091bc13d04e99e51e60f3 Author: Mauro Carvalho Chehab Date: Wed Apr 29 11:43:07 2020 +0200 media: atomisp: get rid of trivial version checks at *.h Most of the remaining ifdefs check for ISP2401 are trivial. Get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 1360fa6fa2b185c92a2c7f2332c5ee362b618971 Author: Mauro Carvalho Chehab Date: Wed Apr 29 11:06:27 2020 +0200 media: atomisp: remove unused duplicated files Those files aren't used. So, just get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 33c04118f2fe2e4a4d699f128708d17096a0b622 Author: Mauro Carvalho Chehab Date: Wed Apr 29 11:15:59 2020 +0200 media: atomisp: get rid of io_ls/ subdir The contents of this file is identical to ipu2_io_ls, except for the bayer directory, with is only at ipu2_io_ls. So, get rid of the duplicated code. Signed-off-by: Mauro Carvalho Chehab commit 5254591b4ec594223c65d6134ef4f9d4a8b04544 Author: Mauro Carvalho Chehab Date: Wed Apr 29 10:57:27 2020 +0200 media: atomisp: rename anr2 param header file This file is different than the anr1 version. So, let's name it differently. Signed-off-by: Mauro Carvalho Chehab commit 3a5e9f4c4d5a0e670bf72044e20b14536ebaa968 Author: Mauro Carvalho Chehab Date: Wed Apr 29 10:35:30 2020 +0200 media: atomisp: remove bayer_io_ls duplication There are two instances of those, one for isp2401 and another one for isp2400, both with identical contents, except for comments and an ifdef. Get rid of one of them. Signed-off-by: Mauro Carvalho Chehab commit 5060e35ee5a81576b4c682eeb2131f2936fe5ffb Author: Mauro Carvalho Chehab Date: Wed Apr 29 01:05:47 2020 +0200 media: atomisp: use regulator_get_optional() for first attempt Some BIOSes seem to use different names for some regulators. Use regulator_get_optional() for the first attempt, in order to avoid using the dummy regulator and produce a warning, in the case that the first attempt fails. Signed-off-by: Mauro Carvalho Chehab commit 0a76fd8e8d202dcaabc714850205d5d75c9b8271 Author: Mauro Carvalho Chehab Date: Sat Apr 25 13:47:56 2020 +0200 media: atomisp: add Asus Transform T101HA ACPI vars Those were extracted from an ACPI dump: * Original Table Header: * Signature "DSDT" * Length 0x0001A0BD (106685) * Revision 0x02 * Checksum 0x76 * OEM ID "_ASUS_" * OEM Table ID "Notebook" * OEM Revision 0x01072009 (17244169) * Compiler ID "INTL" * Compiler Version 0x20120913 (538052883) */ DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x01072009) ... Local0 = Package (0x12) { "CamId", "ov2680", "CamType", "1", "CsiPort", "0", "CsiLanes", "1", "CsiFmt", "15", "CsiBayer", "0", "CamClk", "1", "Regulator1p8v", "0", "Regulator2p8v", "0" } Note: the DMI_MATCH() line probably needs to be tweaked. Signed-off-by: Mauro Carvalho Chehab commit c343a51e167807ec8b1d8d28fe2a83045131a10f Author: Mauro Carvalho Chehab Date: Tue Apr 28 23:48:32 2020 +0200 media: atomisp: get finish de-duplication of hrt/hive*.h The last header (hive_isp_css_2401_irq_types_hrt.h) is also almost identical, except by an if ISP2400 inside a comment block. Remove the duplication and keep just one file. Signed-off-by: Mauro Carvalho Chehab commit 14131db2ea1a88d0b9d0e5f8781e929928a69dc7 Author: Mauro Carvalho Chehab Date: Tue Apr 28 23:25:12 2020 +0200 media: atomisp: hive_isp_css_defs.h: keep just one copy of it While those headers are different, the different fields aren't used at the driver. So, remove those different unused fields, rename one define and use just one header for all 3 different versions of the ISP. Signed-off-by: Mauro Carvalho Chehab commit ecdb2e34b295bf2e8aeb27e60e3842c87b8c3c8c Author: Mauro Carvalho Chehab Date: Tue Apr 28 22:53:28 2020 +0200 media: atomisp: remove unused hive_isp_css_host_ids_hrt.h Nothing here is really used by the driver. So, let's just get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 7c2b6c1e3456acfb2dc3ed6fe3d7e3f64324358b Author: Mauro Carvalho Chehab Date: Tue Apr 28 18:38:04 2020 +0200 media: atomisp: remove several duplicated files Those files have identical contents, but are located at different parts of the driver. As their contents are identical, we can simply remove them. Signed-off-by: Mauro Carvalho Chehab commit c8b1a84e38c2416ade54be662af036e99a9b2e91 Author: Mauro Carvalho Chehab Date: Tue Apr 28 22:25:02 2020 +0200 media: atomisp: remove unused definitions at */isp_capture_defs.h The isp_capture_defs.h contain several unused defines. Get rid of some of them, making all 3 instances identical. Signed-off-by: Mauro Carvalho Chehab commit 4dcf78197aed6495ceea43b34d1b30ac25427082 Author: Mauro Carvalho Chehab Date: Tue Apr 28 18:31:31 2020 +0200 media: atomisp: get rid of unused header files Those 4 header files aren't used anyware. So, send them to the trash can. Signed-off-by: Mauro Carvalho Chehab commit 8fba22fbdfc3cad85b5795f2e05b2527fc44e358 Author: Mauro Carvalho Chehab Date: Tue Apr 28 14:06:20 2020 +0200 media: atomisp: get rid of trivial ISP2401 dependencies on header files On several header files, the dependency for ISP2401 is trivial: for example, it just adds new fields on structs or declare new functions. Get rid of those trivial cases. Signed-off-by: Mauro Carvalho Chehab commit d4cf9939a614a79a876782ea57f6ca7a64562c03 Author: Mauro Carvalho Chehab Date: Tue Apr 28 18:26:45 2020 +0200 media: atomisp: get rid of several typedef-style defines Those vars aren't used anymore at this driver. Get rid of them. Signed-off-by: Mauro Carvalho Chehab commit badd9b3a95101594298aa20d019b441cd68f6a06 Author: Mauro Carvalho Chehab Date: Tue Apr 28 18:08:28 2020 +0200 media: atomisp: isp_const.h: get rid of an unused big define list None of those SH_CSS_BINARY_ID_* symbols are used by this driver anymore. So, get rid of all of them. Signed-off-by: Mauro Carvalho Chehab commit 406ae76079036fa9f335b70037cb971c14305cad Author: Mauro Carvalho Chehab Date: Tue Apr 28 10:14:07 2020 +0200 media: atomisp: sh_css: detect ISP version at runtime Get rid of all those ifdefs that were checking for ISP2401 inside sh_css.c. Signed-off-by: Mauro Carvalho Chehab commit 7535c68d179fa11ef7320d9f13affb94562919b1 Author: Mauro Carvalho Chehab Date: Tue Apr 28 09:30:26 2020 +0200 media: atomisp: make util.c work with ISP2401 runtime detection Don't hide those small functions behind ifdefs. Signed-off-by: Mauro Carvalho Chehab commit 8a85fe11c2182168e61cda53f8abded802371b6f Author: Mauro Carvalho Chehab Date: Tue Apr 28 08:23:31 2020 +0200 media: atomisp: get rid of some non-existing functions for ISP2401 There are no ia_css_set_system_mode() nor ia_css_is_system_mode_suspend_or_resume() functions at the driver. So, get rid of the code that would try to call it. Signed-off-by: Mauro Carvalho Chehab commit c06e212da091388fcf715bcf365e83ec20b425cb Author: Mauro Carvalho Chehab Date: Sun Apr 26 18:56:54 2020 +0200 media: atomisp: ia_css_binary_get_shading_info(): don't test version It doesn't make any sense to change the number of parameters for this function depending on the ISP version. Signed-off-by: Mauro Carvalho Chehab commit bd3016e92455a3b07ecf73399a1e7864bc05a307 Author: Mauro Carvalho Chehab Date: Sun Apr 26 12:06:20 2020 +0200 media: atomisp: css_trace.h: use the newest tracing code The css_trace header for ISP2401 also builds on older versions, and seems to be compatible with all versions. So, remove all ifdefs in favor of the CSP2401 version. Signed-off-by: Mauro Carvalho Chehab commit 1c874c13cd54448f9af7ccfd59ca7e03f49f66ac Author: Mauro Carvalho Chehab Date: Sat Apr 25 13:39:24 2020 +0200 media: atomisp: add support for possible new names This patch addresses what it sounds to be a change at the name of some ACPI registers on newer ACPI tables. Signed-off-by: Mauro Carvalho Chehab commit fe670b2a79b8f676f3a01771e8a79a7e37fa51a5 Author: Mauro Carvalho Chehab Date: Thu Apr 23 09:47:26 2020 +0200 media: atomisp: print css_version in runtime The CSS version returned by ISP2400 is different than the one returned by ISP2401. While we could return just one version for both, as this sounds like just an informative string, for now, let's keep returning different versions, as we don't know if this would affect userspace. Signed-off-by: Mauro Carvalho Chehab commit 1e972929f055db297cc6b76515a32682a2e6dc39 Author: Mauro Carvalho Chehab Date: Thu Apr 23 09:41:01 2020 +0200 media: atomisp: sh_css_param_dvs.h remove ISP version macros As namespaces aren't duplicated here, just remove the ifdefs. Signed-off-by: Mauro Carvalho Chehab commit 19801a18a0c751f569a518d1cab8fe9b9a04cdda Author: Mauro Carvalho Chehab Date: Thu Apr 23 09:37:27 2020 +0200 media: atomisp: unify sh_css_params_shading_id_table_generate() Instead of packing parameters differently on ISP2400 and ISP2401, use just one way of passing them for both. Signed-off-by: Mauro Carvalho Chehab commit 5e0947450d16de5fd59fa43d04a53c5df037d54b Author: Mauro Carvalho Chehab Date: Thu Apr 23 09:29:54 2020 +0200 media: atomisp: remove table duplication from dfs tables The way atomisp_dfs_tables.h is defined, it ends by duplicating all data structs there on both atomisp_v4l2.c and atomisp_cmd.c. Change the logic in order to place the definitions only on a single place. Signed-off-by: Mauro Carvalho Chehab commit 6a2782c0b2a0a2ed1d877d3a708308b36496950c Author: Mauro Carvalho Chehab Date: Thu Apr 23 09:29:45 2020 +0200 media: atomisp: remove ISP version macros from sh_css_legacy.h This header is really version-independent. So, just get rid of the macros from it. Signed-off-by: Mauro Carvalho Chehab commit 4f744a573db32b277fe55284b7bb70342522d464 Author: Mauro Carvalho Chehab Date: Thu Apr 23 09:11:01 2020 +0200 media: atomisp: make sh_css_sp_init_pipeline() ISP version independent This function call has two parameters that are used only with ISP2401, enclosed on some ugly ifdefs. Make the function independent, passing NULL values for ISP2400. Signed-off-by: Mauro Carvalho Chehab commit 977e77c0b5c2fa1050a7307648ca1d208caed83c Author: Mauro Carvalho Chehab Date: Thu Apr 23 08:38:49 2020 +0200 media: atomisp: make sh_css_struct.h independent of ISP version Use the same struct for both ISP2400 and ISP2401. Signed-off-by: Mauro Carvalho Chehab commit ffa123612a13fb0e3cad765675f13943275171ff Author: Mauro Carvalho Chehab Date: Wed Apr 22 15:17:30 2020 +0200 media: atomisp: sh_css_defs.h: get rid of build time dependencies There are several #ifdefs checking for ISP version there. Some of them are just two different ways to represent the same contants, while 3 parameters are actually different, depending on the ISP version. Change the header in a way that it will be compatible with both versions, and change dependent code to keep running, removing ifdefs there only when possible. Signed-off-by: Mauro Carvalho Chehab commit 483f5215a2f48e500717862f9dbb18823221894e Author: Mauro Carvalho Chehab Date: Wed Apr 22 14:33:07 2020 +0200 media: atomisp: atomisp_compat_ioctl32.c: be independent of ISP version There are two ioctls that are only available with ISP2401. Yet, at the compat level, we don't really need to take care, as the native ioctl handler will already return an error code if the ioctl doesn't exist. So, let's just remove the ifdefs here. Signed-off-by: Mauro Carvalho Chehab commit 7ef17aa55fc381a6f3280203cd85175cb14b631f Author: Mauro Carvalho Chehab Date: Wed Apr 22 14:28:47 2020 +0200 media: atomisp: atomisp_compat_css20.c: detect ISP at runtime Remove ifdefs that check ISP version from the code, switching to specific ISP-dependent code at runtime. Signed-off-by: Mauro Carvalho Chehab commit 78e2888ccb2920e2b782e6b07a7563800dabe7fe Author: Mauro Carvalho Chehab Date: Wed Apr 22 14:20:14 2020 +0200 media: atomisp: atomisp_csi2.c: remove useless ifdefs The ifdefs there are meaningless. Just remove them for good. Signed-off-by: Mauro Carvalho Chehab commit 02c392332cb906689d2e259895a509020a6f99b7 Author: Mauro Carvalho Chehab Date: Wed Apr 22 14:17:45 2020 +0200 media: atomisp: atomisp_subdev.c check ISP version on runtime Remove ISP-version-dependent ifdefs. Signed-off-by: Mauro Carvalho Chehab commit a19b190e32dfcdd909555df3c009e0bc66f8353d Author: Mauro Carvalho Chehab Date: Wed Apr 22 14:06:58 2020 +0200 media: atomisp: atomisp_v4l2.c: set wdt timers according with ISP version Add a runtime check to use the proper wdt timer init at runtime, depending on the chipset revision. For now, we can't get rid of the remaining version checks, as the rest of the code is not prepared yet to detect the ISP version on runtime. Signed-off-by: Mauro Carvalho Chehab commit 9ace178dee15432712fc70a5f84cb00695fc70b9 Author: Mauro Carvalho Chehab Date: Wed Apr 22 13:49:34 2020 +0200 media: atomisp: atomisp_ioctl.c: get rid of a ISP2400/ISP2401 dependency Replace #ifdef occurrences there with runtime checks. Signed-off-by: Mauro Carvalho Chehab commit 643405b0fff41787834c122660d77d9ebdb5c3a4 Author: Mauro Carvalho Chehab Date: Mon Apr 20 12:33:51 2020 +0200 media: atomisp: pci/atomisp2/*.h remove #ifdef ISP2401 Those ifs can easily be removed without breaking the code. Signed-off-by: Mauro Carvalho Chehab commit 268ff5bf6b2b4b560fb65a9527f14098de87b3a5 Author: Mauro Carvalho Chehab Date: Mon Apr 20 12:42:52 2020 +0200 media: atomisp: atomisp_dfs_tables.h: don't depend on ISP version There's a dependency on this header for the ISP model. While this sounds really weird (as just one resolution needs it), as we don't know what's the right value, let's just keep it. Signed-off-by: Mauro Carvalho Chehab commit ea419fdae5eb2edce2cdb790e1faa1b91d224f22 Author: Mauro Carvalho Chehab Date: Mon Apr 20 10:33:36 2020 +0200 media: atomisp: atomisp_cmd.c test ISP version in runtime The logic there has lots of ifdef dependencies if the hardware is either ISP2400 or ISP2041. Replace them by runtime checks. Signed-off-by: Mauro Carvalho Chehab commit e1ac35b39ac13814146559f80fe003977383d933 Author: Mauro Carvalho Chehab Date: Mon Apr 20 09:19:56 2020 +0200 media: atomisp: add a way for the driver to know the chipset version The atomisp supports two different chipsets: ISP2400 and ISP2401. Right now, this is controlled by ugly #defines inside the driver. Add a global bolean to identify the type of hardware. While this is hacky, it would be a quick way to start removing the ugly ifdefs. Signed-off-by: Mauro Carvalho Chehab commit 9a0d7fb5ece6d61b4b943db3216a3ecbb31f0917 Author: Mauro Carvalho Chehab Date: Sun Apr 19 19:12:04 2020 +0200 media: atomisp: simplify math_support.h There are some uneeded defines there. Simplify it, and make it independent of defines. Signed-off-by: Mauro Carvalho Chehab commit 02330fb0107a6fd5c00f4ea9022567540bc05b84 Author: Mauro Carvalho Chehab Date: Sun Apr 19 18:27:51 2020 +0200 media: atomisp: remove some dead code There are several parts of atomisp that are meant to be built on different environments, tested using ifdefs. Remove some of them, as this code should build only on Linux. Signed-off-by: Mauro Carvalho Chehab commit eaa399eb542cdfc5748a32634ba3d5cffb5517cd Author: Mauro Carvalho Chehab Date: Sun Apr 19 17:51:29 2020 +0200 media: atomisp: do lots of other coding style cleanups Use some auto-reformat tools to make the atomisp style a little better. There are still lots of weird things there, but this will hopefully reduce the number of pure coding style patches submitted upstream. Signed-off-by: Mauro Carvalho Chehab commit bdfe0beb95eebc864f341fd0c5e903672b90b1a2 Author: Mauro Carvalho Chehab Date: Sun Apr 19 16:06:45 2020 +0200 media: atomisp: fix several coding style issues Use checkpatch.pl --fix-inplace --strict to solve several coding style issues, manually reviewing the produced code and fixing some troubles caused by checkpatch. Signed-off-by: Mauro Carvalho Chehab commit 4636a85cff86b2c014752c6b8fece018558b0d08 Author: Mauro Carvalho Chehab Date: Sun Apr 19 14:38:57 2020 +0200 media: atomisp: fix several typos Running checkpatch.pl codespell logic found several typos at atomisp driver. Fix them using --fix-inline. Signed-off-by: Mauro Carvalho Chehab commit fd3218f513eba27ce68dc5e1198238dc0bb59cef Author: Mauro Carvalho Chehab Date: Wed May 20 12:30:23 2020 +0200 media: atomisp: select IOSF_MBI dependency This driver needs IOSF_MBI in order to talk with some PM registers. Select it at compile time. Signed-off-by: Mauro Carvalho Chehab commit aa31f6514047da6460e3db8247c2cefe3e08f6d9 Author: Mauro Carvalho Chehab Date: Sun Apr 19 14:33:52 2020 +0200 media: atomisp: allow building the driver again The atomisp driver builds again. So, remove depends on BROKEN. Signed-off-by: Mauro Carvalho Chehab commit e7b955f8e0184c54aae27e91ce3c385ff95377b8 Author: Mauro Carvalho Chehab Date: Sun Apr 19 14:02:03 2020 +0200 media: atomisp: fix a broken compat32 code There's a typo at the compat32 code, with forgot to get the pointer address, causing the driver to not build. Not sure why this didn't produce an error back when the driver got removed. Signed-off-by: Mauro Carvalho Chehab commit c1b70ae094d37e379e0c4e14db513e50a8e5bb6f Author: Mauro Carvalho Chehab Date: Sun Apr 19 14:28:10 2020 +0200 media: atomisp: use new ida API The old ida API got replaced by a new one, with avoids locking issues. As the old API was removed, start using the new one, as defined by changeset b03f8e43c926 ("ida: Remove old API"). Fixes: b03f8e43c926 ("ida: Remove old API") Signed-off-by: Mauro Carvalho Chehab commit 8d564cd28cfcbea636b44a96a1edfe0e3395ef60 Author: Mauro Carvalho Chehab Date: Sun Apr 19 13:17:14 2020 +0200 media: atomisp: use cpu_latency_qos_*() instead of pm_qos_update*() Those functions got renamed. Update them on atomisp driver. Fixes: 67b06ba01857 ("PM: QoS: Drop PM_QOS_CPU_DMA_LATENCY and rename related functions") Signed-off-by: Mauro Carvalho Chehab commit a9d7bbcc6bb8358a8e2e7f3e8db918baf221c2bf Author: Mauro Carvalho Chehab Date: Sun Apr 19 13:05:47 2020 +0200 media: atomisp: Fix support for time 64 API The time 64 API patchset changed the ts stamp to u64. Update this driver accordingly. Fixes: 15a40b27beb0 ("media: videobuf: use u64 for the timestamp internally") Signed-off-by: Mauro Carvalho Chehab commit e58eeb5a7335218498218cde8e96bcf3b7ae4a4a Author: Mauro Carvalho Chehab Date: Sun Apr 19 12:49:32 2020 +0200 media: atomisp: replace VFL_TYPE_GRABBER by VFL_TYPE_VIDEO This type was renamed in the past by a more meaningul name. Change it on atomisp too. Fixes: 238e4a5baa36 ("media: rename VFL_TYPE_GRABBER to _VIDEO") Signed-off-by: Mauro Carvalho Chehab commit 1aeb9583d3babf59d3240e6182453bcd4c47f258 Author: Mauro Carvalho Chehab Date: Sun Apr 19 12:46:57 2020 +0200 media: atomisp: totalram_pages is now a function Fix the usage of totalram_pages, as this is now a function. Fixes: ca79b0c211af ("mm: convert totalram_pages and totalhigh_pages variables to atomic") Signed-off-by: Mauro Carvalho Chehab commit 60e5c189453f8dde622cf2b8f6da5a4bb7bad6ce Author: Mauro Carvalho Chehab Date: Sun Apr 19 12:43:55 2020 +0200 media: atomisp: fix usage of access_ok() kAPI This macro had its first parameter lost. Remove it. While on it, fix the alignments where this macro is used. Fixes: 96d4f267e40f ("Remove 'type' argument from access_ok() function") Signed-off-by: Mauro Carvalho Chehab commit 99da46648a3000fd246b8a81f4b754495358dbe9 Author: Mauro Carvalho Chehab Date: Wed May 20 11:26:17 2020 +0200 MAINTAINERS: adjust atomisp maintainership From now on, I'll be maintaining the atomisp driver, and Sakari will be reviewing it. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ad85094b293e40e7a2f831b0311a389d952ebd5e Author: Mauro Carvalho Chehab Date: Sun Apr 19 12:18:13 2020 +0200 Revert "media: staging: atomisp: Remove driver" There are some interest on having this driver back, and I can probably dedicate some time to address its issue. So, let's ressurect it. For now, the driver causes a recursive error and doesn't build, so, make it depend on BROKEN. This reverts commit 51b8dc5163d2ff2bf04019f8bf7e3bd0e75bb654. Signed-off-by: Mauro Carvalho Chehab commit c5d6082d35e0bcc20a26a067ffcfddcb5257e580 Author: Marc Zyngier Date: Fri May 15 17:57:52 2020 +0100 irqchip/gic-v3-its: Balance initial LPI affinity across CPUs When mapping a LPI, the ITS driver picks the first possible affinity, which is in most cases CPU0, assuming that if that's not suitable, someone will come and set the affinity to something more interesting. It apparently isn't the case, and people complain of poor performance when many interrupts are glued to the same CPU. So let's place the interrupts by finding the "least loaded" CPU (that is, the one that has the fewer LPIs mapped to it). So called 'managed' interrupts are an interesting case where the affinity is actually dictated by the kernel itself, and we should honor this. Reported-by: John Garry Signed-off-by: Marc Zyngier Tested-by: John Garry Link: https://lore.kernel.org/r/1575642904-58295-1-git-send-email-john.garry@huawei.com Link: https://lore.kernel.org/r/20200515165752.121296-3-maz@kernel.org commit 9b46418c40fe910e6537618f9932a8be78a3dd6c Author: Miklos Szeredi Date: Wed May 20 11:39:35 2020 +0200 fuse: copy_file_range should truncate cache After the copy operation completes the cache is not up-to-date. Truncate all pages in the interval that has successfully been copied. Truncating completely copied dirty pages is okay, since the data has been overwritten anyway. Truncating partially copied dirty pages is not okay; add a comment for now. Fixes: 88bc7d5097a1 ("fuse: add support for copy_file_range()") Signed-off-by: Miklos Szeredi commit 2c4656dfd994538176db30ce09c02cc0dfc361ae Author: Miklos Szeredi Date: Wed May 20 11:39:35 2020 +0200 fuse: fix copy_file_range cache issues a) Dirty cache needs to be written back not just in the writeback_cache case, since the dirty pages may come from memory maps. b) The fuse_writeback_range() helper takes an inclusive interval, so the end position needs to be pos+len-1 instead of pos+len. Fixes: 88bc7d5097a1 ("fuse: add support for copy_file_range()") Signed-off-by: Miklos Szeredi commit 3bce5377ef66a8700dcf7a9cb89b7aeb99326cb7 Author: Tim Harvey Date: Fri May 15 10:57:08 2020 -0700 hwmon: Add Gateworks System Controller support The Gateworks System Controller has a hwmon sub-component that exposes up to 16 ADC's, some of which are temperature sensors, others which are voltage inputs. The ADC configuration (register mapping and name) is configured via device-tree and varies board to board. Signed-off-by: Tim Harvey Reviewed-by: Guenter Roeck Signed-off-by: Lee Jones commit d85234994b2fb2d88fadd3d9e60385b02b244dac Author: Tim Harvey Date: Fri May 15 10:57:07 2020 -0700 mfd: Add Gateworks System Controller core driver The Gateworks System Controller (GSC) is an I2C slave controller implemented with an MSP430 micro-controller whose firmware embeds the following features: - I/O expander (16 GPIO's) using PCA955x protocol - Real Time Clock using DS1672 protocol - User EEPROM using AT24 protocol - HWMON using custom protocol - Interrupt controller with tamper detect, user pushbotton - Watchdog controller capable of full board power-cycle - Power Control capable of full board power-cycle see http://trac.gateworks.com/wiki/gsc for more details Signed-off-by: Tim Harvey Signed-off-by: Lee Jones commit 3e6cae8e5d40b8bdee1815124b5e36abcc746f56 Author: Tim Harvey Date: Fri May 15 10:57:06 2020 -0700 dt-bindings: mfd: Add Gateworks System Controller bindings This patch adds documentation of device-tree bindings for the Gateworks System Controller (GSC). Signed-off-by: Tim Harvey Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit db5871e85533f06ffe1795c1cb9b9153860d1e4f Author: Gustavo A. R. Silva Date: Thu May 7 13:53:23 2020 -0500 vmbus: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507185323.GA14416@embeddedor Signed-off-by: Wei Liu commit 723c425f2947dd0ecdde270cb8463b22b3e59603 Author: Wei Liu Date: Wed May 6 16:08:05 2020 +0000 Driver: hv: vmbus: drop a no long applicable comment None of the things mentioned in the comment is initialized in hv_init. They've been moved elsewhere. Signed-off-by: Wei Liu Link: https://lore.kernel.org/r/20200506160806.118965-1-wei.liu@kernel.org Reviewed-by: Michael Kelley commit b7d18c57c94a38a81c1dbcfee0d63153ffaf1856 Author: Andy Shevchenko Date: Thu Apr 23 16:45:05 2020 +0300 hyper-v: Switch to use UUID types directly uuid_le is an alias for guid_t and is going to be removed in the future. Replace it with original type. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200423134505.78221-4-andriy.shevchenko@linux.intel.com Signed-off-by: Wei Liu commit 0027e3fd6d907c81097ab656de2521854f37b9a6 Author: Andy Shevchenko Date: Thu Apr 23 16:45:04 2020 +0300 hyper-v: Replace open-coded variant of %*phN specifier printf() like functions in the kernel have extensions, such as %*phN to dump small pieces of memory as hex values. Replace print_alias_name() with the direct use of %*phN. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200423134505.78221-3-andriy.shevchenko@linux.intel.com Signed-off-by: Wei Liu commit 458c4475be9ae42e248963b2db732266d40408b7 Author: Andy Shevchenko Date: Thu Apr 23 16:45:03 2020 +0300 hyper-v: Supply GUID pointer to printf() like functions Drop dereference when printing the GUID with printf() like functions. This allows to hide the uuid_t internals. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200423134505.78221-2-andriy.shevchenko@linux.intel.com Signed-off-by: Wei Liu commit 69f57058badded5c523871bbaaaf60b637bcf623 Author: Andy Shevchenko Date: Thu Apr 23 16:45:02 2020 +0300 hyper-v: Use UUID API for exporting the GUID (part 2) This is a follow up to the commit 1d3c9c075462 ("hyper-v: Use UUID API for exporting the GUID") which starts the conversion. There is export_guid() function which exports guid_t to the u8 array. Use it instead of open coding variant. This allows to hide the uuid_t internals. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200423134505.78221-1-andriy.shevchenko@linux.intel.com Signed-off-by: Wei Liu commit 88b42da6e3dc9adbdc3d7e1a9293ddf3d84f1021 Author: Michael Kelley Date: Wed Apr 22 12:57:37 2020 -0700 asm-generic/hyperv: Add definitions for Get/SetVpRegister hypercalls Add definitions for GetVpRegister and SetVpRegister hypercalls, which are implemented for both x86 and ARM64. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/20200422195737.10223-5-mikelley@microsoft.com Signed-off-by: Wei Liu commit c55a844f46f958b4df804eccd734b86795e40359 Author: Michael Kelley Date: Wed Apr 22 12:57:36 2020 -0700 x86/hyperv: Split hyperv-tlfs.h into arch dependent and independent files In preparation for adding ARM64 support, split hyperv-tlfs.h into architecture dependent and architecture independent files, similar to what has been done with mshyperv.h. Move architecture independent definitions into include/asm-generic/hyperv-tlfs.h. The split will avoid duplicating significant lines of code in the ARM64 version of hyperv-tlfs.h. The split has no functional impact. Some of the common definitions have "X64" in the symbol name. Change these to remove the "X64" in the architecture independent version of hyperv-tlfs.h, but add aliases with the "X64" in the x86 version so that x86 code will continue to compile. A later patch set will change all the references and allow removal of the aliases. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/20200422195737.10223-4-mikelley@microsoft.com Signed-off-by: Wei Liu commit a8a42d0284f18a64d540a604aecec9f961964e3b Author: Michael Kelley Date: Wed Apr 22 12:57:35 2020 -0700 x86/hyperv: Remove HV_PROCESSOR_POWER_STATE #defines The HV_PROCESSOR_POWER_STATE_C #defines date back to year 2010, but they are not in the TLFS v6.0 document and are not used anywhere in Linux. Remove them. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/20200422195737.10223-3-mikelley@microsoft.com Signed-off-by: Wei Liu commit 7357b1df744c2a3bcbe00cea0eef1509d004f488 Author: Michael Kelley Date: Wed Apr 22 12:57:34 2020 -0700 KVM: x86: hyperv: Remove duplicate definitions of Reference TSC Page The Hyper-V Reference TSC Page structure is defined twice. struct ms_hyperv_tsc_page has padding out to a full 4 Kbyte page size. But the padding is not needed because the declaration includes a union with HV_HYP_PAGE_SIZE. KVM uses the second definition, which is struct _HV_REFERENCE_TSC_PAGE, because it does not have the padding. Fix the duplication by removing the padding from ms_hyperv_tsc_page. Fix up the KVM code to use it. Remove the no longer used struct _HV_REFERENCE_TSC_PAGE. There is no functional change. Signed-off-by: Michael Kelley Acked-by: Paolo Bonzini Reviewed-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20200422195737.10223-2-mikelley@microsoft.com Signed-off-by: Wei Liu commit 677b0ce5d66c5445440f3cedd3c20ff1665c0f46 Author: Colin Ian King Date: Tue Apr 14 16:23:43 2020 +0100 drivers: hv: remove redundant assignment to pointer primary_channel The pointer primary_channel is being assigned with a value that is never used. The assignment is redundant and can be removed. Move the definition of primary_channel to a narrower scope. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200414152343.243166-1-colin.king@canonical.com [ wei: move primary_channel and update commit message ] Signed-off-by: Wei Liu commit 7769e18c201aa88eade5556faf9da7f2bc15bb8a Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:14 2020 +0200 scsi: storvsc: Re-init stor_chns when a channel interrupt is re-assigned For each storvsc_device, storvsc keeps track of the channel target CPUs associated to the device (alloced_cpus) and it uses this information to fill a "cache" (stor_chns) mapping CPU->channel according to a certain heuristic. Update the alloced_cpus mask and the stor_chns array when a channel of the storvsc device is re-assigned to a different CPU. Signed-off-by: Andrea Parri (Microsoft) Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Link: https://lore.kernel.org/r/20200406001514.19876-12-parri.andrea@gmail.com Reviewed-by; Long Li Reviewed-by: Michael Kelley [ wei: fix a small issue reported by kbuild test robot ] Signed-off-by: Wei Liu commit 472de63b0b8383565e103f809f5df37d1c4390ab Author: James Morse Date: Tue May 19 19:21:08 2020 +0100 firmware: arm_sdei: Document the motivation behind these set_fs() calls The SDEI handler save/restores the addr_limit using set_fs(). It isn't very clear why. The reason is to mirror the arch code's entry assembly. The arch code does this because perf may access user-space, and inheriting the addr_limit may be a problem. Add a comment explaining why this is here. Suggested-by: Christoph Hellwig Signed-off-by: James Morse Link: https://bugs.chromium.org/p/project-zero/issues/detail?id=822 Link: https://lore.kernel.org/r/20200519182108.13693-4-james.morse@arm.com Signed-off-by: Will Deacon commit 82b2077afccd2a46ce15a43a50f2bfbf1b295de5 Author: Christoph Hellwig Date: Tue May 19 19:21:07 2020 +0100 firmware: arm_sdei: remove unused interfaces The export symbols to register/unregister and enable/disable events aren't used upstream, remove them. [ dropped the parts of Christoph's patch that made the API static too ] Signed-off-by: Christoph Hellwig Signed-off-by: James Morse Link: https://lore.kernel.org/linux-arm-kernel/20200504164224.2842960-1-hch@lst.de/ Link: https://lore.kernel.org/r/20200519182108.13693-3-james.morse@arm.com Signed-off-by: Will Deacon commit 70e6352aefb18e6158f334af2e0291f133562b62 Author: Hanjun Guo Date: Tue May 19 19:21:06 2020 +0100 firmware: arm_sdei: Put the SDEI table after using it The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used for runtime after the initialization to release the table mapping, put the SDEI table after using it. Signed-off-by: Hanjun Guo Signed-off-by: James Morse Link: https://lore.kernel.org/linux-arm-kernel/1589021566-46373-1-git-send-email-guohanjun@huawei.com/ Link: https://lore.kernel.org/r/20200519182108.13693-2-james.morse@arm.com Signed-off-by: Will Deacon commit a999eb96fdd4da488ac3085c40e20d61de26f6af Author: Niklas Schnelle Date: Fri Feb 28 10:27:22 2020 +0100 s390/pci: ioremap() align with generic code Let's use the same signature and parameter names as in the generic ioremap() definition making the physical address' type explicit. Add a check against address wrap around as in the generic lib/ioremap.c:ioremap_prot() code. Finally use free_vm_area() instead of vunmap() as in the generic code. Besides being clearer free_vm_area() can also skip a few additional checks compared with vunmap(). Signed-off-by: Niklas Schnelle Reviewed-by: Gerald Schaefer Signed-off-by: Vasily Gorbik commit bc4b295e87a86bf14333753daeb1c84909197c46 Author: Harald Freudenberger Date: Fri May 8 15:51:19 2020 +0200 s390/ap: introduce new ap function ap_get_qdev() Provide a new interface function to be used by the ap drivers: struct ap_queue *ap_get_qdev(ap_qid_t qid); Returns ptr to the struct ap_queue device or NULL if there was no ap_queue device with this qid found. When something is found, the reference count of the embedded device is increased. So the caller has to decrease the reference count after use with a call to put_device(&aq->ap_dev.device). With this patch also the ap_card_list is removed from the ap core code and a new hashtable is introduced which stores hnodes of all the ap queues known to the ap bus. The hashtable approach and a first implementation of this interface comes from a previous patch from Anthony Krowiak and an idea from Halil Pasic. Signed-off-by: Harald Freudenberger Suggested-by: Tony Krowiak Suggested-by: Halil Pasic Reviewed-by: Tony Krowiak Signed-off-by: Vasily Gorbik commit d03756aa0535f347f321c681ab0ca0fc7ba335bc Author: Gerald Schaefer Date: Thu May 7 16:21:37 2020 +0200 Documentation/s390: Update / remove developerWorks web links s390 documentation now lives in IBM Knowledge Center, so update the link in the zfcpdump documentation. Also, remove the old developerWorks links from the appldata source code. Those were not really documentation related, but rather a reminder to the developer that some documentation has to be adjusted when changing the record layout, which should still be pretty obvious from the remaining comment. Signed-off-by: Gerald Schaefer Signed-off-by: Vasily Gorbik commit 4765600fc7aa2f650951c3d0ed19e04e4c9e4b06 Author: David Hildenbrand Date: Fri Apr 24 10:39:04 2020 +0200 s390: simplify memory notifier for protecting kdump crash kernel area Assume we have a crashkernel area of 256MB reserved: root@vm0:~# cat /proc/iomem 00000000-6fffffff : System RAM 0f258000-0fcfffff : Kernel code 0fd00000-101d10e3 : Kernel data 105b3000-1068dfff : Kernel bss 70000000-7fffffff : Crash kernel This exactly corresponds to memory block 7 (memory block size is 256MB). Trying to offline that memory block results in: root@vm0:~# echo "offline" > /sys/devices/system/memory/memory7/state -bash: echo: write error: Device or resource busy [ 128.458762] page:000003d081c00000 refcount:1 mapcount:0 mapping:00000000d01cecd4 index:0x0 [ 128.458773] flags: 0x1ffff00000001000(reserved) [ 128.458781] raw: 1ffff00000001000 000003d081c00008 000003d081c00008 0000000000000000 [ 128.458781] raw: 0000000000000000 0000000000000000 ffffffff00000001 0000000000000000 [ 128.458783] page dumped because: unmovable page The craskernel area is marked reserved in the bootmem allocator. This results in the memmap getting initialized (refcount=1, PG_reserved), but the pages are never freed to the page allocator. So these pages look like allocated pages that are unmovable (esp. PG_reserved), and therefore, memory offlining fails early, when trying to isolate the page range. We only have to care about the exchange area, make that clear. Signed-off-by: David Hildenbrand Reviewed-by: Gerald Schaefer Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Philipp Rudo Cc: Gerald Schaefer Cc: Eric W. Biederman Cc: Michal Hocko Link: https://lore.kernel.org/r/20200424083904.8587-1-david@redhat.com Signed-off-by: Christian Borntraeger Signed-off-by: Vasily Gorbik commit e5794cf1a270d813a5b9373a6876487d4d154195 Author: Niklas Schnelle Date: Tue Apr 28 11:54:46 2020 +0200 s390/pci: create links between PFs and VFs On s390 PCI Virtual Functions (VFs) are scanned by firmware and are made available to Linux via the hot-plug interface. As such the common code path of doing the scan directly using the parent Physical Function (PF) is not used and fenced off with the no_vf_scan attribute. Even if the partition created the VFs itself e.g. using the sriov_numvfs attribute of a PF, the PF/VF links thus need to be established after the fact. To do this when a VF is plugged we scan through all functions on the same zbus and test whether they are the parent PF in which case we establish the necessary links. With these links established there is now no more need to fence off pci_iov_remove_virtfn() for pdev->no_vf_scan as the common code now works fine. Signed-off-by: Niklas Schnelle Acked-by: Bjorn Helgaas Reviewed-by: Pierre Morel Link: https://lore.kernel.org/r/20200506154139.90609-3-schnelle@linux.ibm.com Signed-off-by: Vasily Gorbik commit a1ceea67f2e5b73cebd456e7fb463b3052bc6344 Author: Niklas Schnelle Date: Mon Apr 27 16:25:27 2020 +0200 PCI/IOV: Introduce pci_iov_sysfs_link() function Currently pci_iov_add_virtfn() scans the SR-IOV BARs, adds the VF to the bus and also creates the sysfs links between the newly added VF and its parent PF. With pdev->no_vf_scan fencing off the entire pci_iov_add_virtfn() call s390 as the sole pdev->no_vf_scan user thus ends up missing these sysfs links which are required for example by QEMU/libvirt. Instead of duplicating the code refactor pci_iov_add_virtfn() to make sysfs link creation callable separately. Signed-off-by: Niklas Schnelle Acked-by: Bjorn Helgaas Reviewed-by: Pierre Morel Link: https://lore.kernel.org/r/20200506154139.90609-1-schnelle@linux.ibm.com Signed-off-by: Vasily Gorbik commit c70d82e96644bd660ea53209c19f75cd86c560d6 Author: Julian Wiedmann Date: Tue Apr 21 10:38:18 2020 +0200 s390/qdio: add IRQ reduction for error SBALs SBALs in PRIMED or ERROR state represent new work on the Input Queue. But while inbound_primed() does all sorts of ACK management for new PRIMED work, the same handling is currently missing for ERROR work. In particular the path for ERROR work doesn't clear up _old_ ACKs. Treat ERROR work the same as PRIMED work, but consider that the QEBSM auto-ACK feature doesn't apply here. So we need to set the ACK manually, as if it was a non-QEBSM device. Note that this doesn't aspire to actually improve performance, the main goal is to just unify the code paths and have consistent behaviour. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 1db85d0e73f3b017c63afcdec1197d4d0736c362 Author: Julian Wiedmann Date: Tue Apr 21 10:26:22 2020 +0200 s390/qdio: refactor ACK processing for primed SBALs inbound_primed() currently has two code paths - one for QEBSM that knows how to deal with multiple ACKs, and a non-QEBSM path that strictly assumes a single ACK on the queue. In preparation for a subsequent patch, slightly adjust the non-QEBSM path so that it can manage a queue with multiple ACKs. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit 9de6c08700ce9fab4589c1a44cec2a21812ab565 Author: Julian Wiedmann Date: Tue Apr 21 10:22:01 2020 +0200 s390/qdio: simplify overlap calculation on Input refill Refilling the Input Queue requires additional checks, as the refilled SBALs can overlap with the ACKs that qdio maintains on the queue. This code path is way too complex, and does a whole bunch of wrap-around checks that the modulo arithmetic in sub_buf() takes care of by itself. So shrink down all that code into a few lines of equivalent functionality. Signed-off-by: Julian Wiedmann Signed-off-by: Vasily Gorbik commit fee36576656f662dcfa4788eaeb033a4c5dd870b Author: YueHaibing Date: Tue May 12 09:26:39 2020 +0200 s390/cio: Remove unused inline function idset_sch_get_first commit 8ebd51a705c5 ("s390/cio: idset.c: remove some unused functions") left behind this, remove it Link: https://lkml.kernel.org/r/20200508140643.30540-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Reviewed-by: Vineeth Vijayan [vneethv@linux.ibm.com: Slight modification in the title] Signed-off-by: Vineeth Vijayan Signed-off-by: Vasily Gorbik commit 55d7b4b8292bf7b698e947b1cfe263e4acac6cec Author: YueHaibing Date: Fri May 8 22:07:24 2020 +0800 s390: Remove two unused inline functions commit 657480d9c015 ("s390: support KPROBES_ON_FTRACE") left behind this, remove it. Signed-off-by: YueHaibing Acked-by: Sven Schnelle Link: https://lore.kernel.org/r/20200508140724.11324-1-yuehaibing@huawei.com Signed-off-by: Christian Borntraeger Signed-off-by: Vasily Gorbik commit 9d5272f5e36155bcead69417fd12e98624e7faef Merge: febd668d375c 3a7c8fafd1b4 Author: Paolo Bonzini Date: Wed May 20 03:40:09 2020 -0400 Merge tag 'noinstr-x86-kvm-2020-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into HEAD commit febd668d375caf13a7fcd93b3498366854de854a Author: Paolo Bonzini Date: Mon May 18 06:30:09 2020 -0400 rcuwait: avoid lockdep splats from rcuwait_active() rcuwait_active only returns whether w->task is not NULL. This is exactly one of the usecases that are mentioned in the documentation for rcu_access_pointer() where it is correct to bypass lockdep checks. This avoids a splat from kvm_vcpu_on_spin(). Reported-by: Wanpeng Li Tested-by: Wanpeng Li Acked-by: Davidlohr Bueso Cc: Peter Zijlstra Signed-off-by: Paolo Bonzini commit c9c2e9c596e90fcf9ee0bf16672f7b938f39b913 Author: Paul Cercueil Date: Tue May 19 23:22:30 2020 +0200 MIPS: ingenic: Add missing include Add missing include which adds the prototype to plat_time_init(). Fixes: f932449c11da ("MIPS: ingenic: Drop obsolete code, merge the rest in setup.c") Signed-off-by: Paul Cercueil Reported-by: kbuild test robot Signed-off-by: Thomas Bogendoerfer commit 866c70f28e49e6d757a2af67f300dcd343c28e7e Author: Tiezhu Yang Date: Wed May 20 13:12:37 2020 +0800 MIPS: SGI-IP27: Remove not used includes and comment in ip27-timer.c After commit 0ce5ebd24d25 ("mfd: ioc3: Add driver for SGI IOC3 chip"), the related includes and comment about ioc3 are not used any more in ip27-timer.c, remove them. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 6cf991611bc72c077f0cc64e23987341ad7ef41e Merge: bfbe1744e441 3a36aa237e4e Author: Dave Airlie Date: Wed May 20 13:36:44 2020 +1000 Merge tag 'drm-intel-next-2020-05-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - drm/i915: Show per-engine default property values in sysfs By providing the default values configured into the kernel via sysfs, it is much more convenient for userspace to restore those sane defaults, or at least know what are considered good baseline. This is useful, for example, to cleanup after any failed userspace prior to commencing new jobs. Cross-subsystem Changes: - video/hdmi: Add Unpack only function for DRM infoframe - Includes pull request gvt-next-2020-05-12 Driver Changes: - Restore Cherryview back to full-ppgtt (Chris, Mika) - Document locking guidelines for i915 (Chris, Daniel, Joonas) - Fix GitLab #1746: Handle idling during i915_gem_evict_something busy loops (Chris) - Display WA #1105: Require linear fb stride to be multiple of 512 bytes on gen9/glk (Ville) - Add Wa_14010685332 for ICP/ICL (Matt R) - Restrict w/a 1607087056 for EHL/JSL (Swathi) - Fix interrupt handling for DP AUX transactions on Tigerlake (Imre) - Revert "drm/i915/tgl: Include ro parts of l3 to invalidate" (Mika) - Fix HDC pipeline flush hardware bit on Gen12 (Mika) - Flush L3 when flushing render on Gen12 (Mika) - Invalidate aux table entries forcibly between BB on Gen12 (Mika) - Add aux table invalidate for all engines on Gen12 (Mika) - Force pte cacheline to main memory Gen8+ (Mika) - Add and enable TGL+ SAGV support (Stanislav) - Implement vm_ops->access on i915 mmaps for GDB (Chris, Kristian) - Replace zero-length array with flexible-array (Gustavo) - Improve batch buffer pool effectiveness to mitigate soft-rc6 hit (Chris) - Remove wait priority boosting (Chris) - Keep driver module referenced when PMU is active (Chris) - Sanitize RPS interrupts upon resume (Chris) - Extend pcode read timeout to 20 ms (Chris) - Wait for ACT sent before enabling MST pipe (Ville) - Extend support to async relocations to SNB (Chris) - Remove CNL pre-prod workarounds (Ville) - Don't enable WaIncreaseLatencyIPCEnabled when IPC is disabled (Sultan) - Record the active CCID from before reset (Chris) - Mark concurrent submissions with a weak-dependency (Chris) - Peel dma-fence-chains for await to allow engine-to-engine sync (Lionel) - Prevent using semaphores to chain up to external fences (Chris) - Fix GLK watermark calculations (Ville) - Emit await(batch) before MI_BB_START (Chris) - Reset execlists registers before HWSP (Chris) - Drop no-semaphore boosting in favor of fast timeslicing (Chris) - Fix enabled infoframe states of lspcon (Gwan-gyeong) - Program DP SDPs on pipe updates (Gwan-gyeong) - Stop sending DP SDPs on ddi disable (Gwan-gyeong) - Store CS timestamp frequency in Hz (Ville) - Remove unused HAS_FWTABLE macro (Pascal) - Use batchbuffer chaining for relocations to save ring space (Chris) - Try different engines for relocs if MI ops not supported (Chris, Tvrtko) - Lazily acquire the device wakeref for freeing objects (Chris) - Streamline display code arithmetics around rounding etc. (Ville) - Use bw state for per crtc SAGV evaluation (Stanislav) - Track active_pipes in bw_state (Stanislav) - Nuke mode.vrefresh usage (Ville) - Warn if the FBC is still writing to stolen on removal (Chris) - Added new PCode commands prepping for QGV rescricting (Stansilav) - Stop holding onto the pinned_default_state (Chris) - Propagate error from completed fences (Chris) - Ignore submit-fences on the same timeline (Chris) - Pull waiting on an external dma-fence into its routine (Chris) - Replace the hardcoded I915_FENCE_TIMEOUT with Kconfig (Chris) - Mark up the racy read of execlists->context_tag (Chris) - Tidy up the return handling for completed dma-fences (Chris) - Introduce skl_plane_wm_level accessor (Stanislav) - Extract SKL SAGV checking (Stanislav) - Make active_pipes check skl specific (Stanislav) - Suspend tasklets before resume sanitization (Chris) - Remove redundant exec_fence (Chris) - Mark the addition of the initial-breadcrumb in the request (Chris) - Transfer old virtual breadcrumbs to irq_worker (Chris) - Read the DP SDPs from the video DIP (Gwan-gyeong) - Program DP SDPs with computed configs (Gwan-gyeong) - Add state readout for DP VSC and DP HDR Metadata Infoframe SDP (Gwan-gyeong) - Add compute routine for DP PSR VSC SDP (Gwan-gyeong) - Use new DP VSC SDP compute routine on PSR (Gwan-gyeong) - Restrict qgv points which don't have enough bandwidth. (Stanislav) - Nuke pointless div by 64bit (Ville) - Static checker code fixes (Nathan, Mika, Chris) - Add logging function for DP VSC SDP (Gwan-gyeong) - Include HDMI DRM infoframe, DP HDR metadata and DP VSC SDP in the crtc state dump (Gwan-gyeong) - Make timeslicing explicit engine property (Chris, Tvrtko) - Selftest and debugging improvements (Chris) - Align variable names with BSpec (Ville) - Tidy up gen8+ breadcrumb emission code (Chris) - Turn intel_digital_port_connected() in a vfunc (Ville) - Use stashed away hpd isr bits in intel_digital_port_connected() (Ville) - Extract i915_cs_timestamp_{ns_to_ticks,tick_to_ns}() (Ville) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200515160703.GA19043@jlahtine-desk.ger.corp.intel.com commit 89f12d6509bff004852c51cb713a439a86816b24 Author: Wei Yongjun Date: Wed May 6 05:14:10 2020 +0000 firmware: imx: scu: Fix possible memory leak in imx_scu_probe() 'chan_name' is malloced in imx_scu_probe() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: edbee095fafb ("firmware: imx: add SCU firmware driver support") Signed-off-by: Wei Yongjun Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit bfbe1744e4417986419236719922a9a7fda224d1 Merge: 1493bddcca4d 43c8546bcd85 Author: Dave Airlie Date: Wed May 20 13:28:04 2020 +1000 Merge tag 'amd-drm-next-5.8-2020-05-19' of git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-next-5.8-2020-05-19: amdgpu: - Improved handling for CTF (Critical Thermal Fault) situations - Clarify AC/DC mode switches - SR-IOV fixes - XGMI fixes for RAS - Misc cleanups - Add autodump debugfs node to aid in GPU hang debugging UAPI: - Add a MEM_SYNC IB flag for handling proper acquire memory semantics if UMDs expect the kernel to handle this Used by AMDVLK: https://github.com/GPUOpen-Drivers/pal/blob/dev/src/core/os/amdgpu/amdgpuQueue.cpp#L1262 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200519202505.4126-1-alexander.deucher@amd.com commit 103515d91832bb837159c37f0cb69d59d68a1dc2 Author: Ricardo Cañuelo Date: Thu May 14 16:36:10 2020 +0200 ARM: dts: imx53-cx9020: Group port definitions for the dvi-converter Group the port definitions of the dvi-converter in a 'ports' node to make it compliant with the ti,tfp410 binding. Signed-off-by: Ricardo Cañuelo Signed-off-by: Shawn Guo commit 4f65e2f483b6f764c15094d14dd53dda048a4048 Author: Eric Dumazet Date: Tue May 19 15:50:12 2020 -0700 net: unexport skb_gro_receive() skb_gro_receive() used to be used by SCTP, it is no longer the case. skb_gro_receive_list() is in the same category : never used from modules. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 6a3153e1e0b7d514dcec2833a6b3d7946864508d Author: Anson Huang Date: Mon May 18 20:54:20 2020 +0800 ARM: dts: imx5: make src node name generic Node name should be generic, use "reset-controller" instead of "src" for i.MX5 SoCs src nodes. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 1ebc662f5da64aae9a2ad6ca2133ad233ec0682d Author: Anson Huang Date: Mon May 18 20:54:19 2020 +0800 ARM: dts: imx50: Add src node interrupt Interrupt is a required property according to SRC binding, add it for SRC node. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit eb998547a0bd8663245400ca197e28945bd289fe Author: Anson Huang Date: Mon May 18 20:39:53 2020 +0800 ARM: dts: imx: make src node name generic Node name should be generic, use "reset-controller" instead of "src" for i.MX6/i.MX7 SoCs src nodes. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit fbf40f4e64ba7eb814aa02b6c4c76a032f877ad6 Author: Steffen Trumtrar Date: Fri May 15 13:41:51 2020 +0200 ARM: dts: imx7d-pinfunc: add input mux for ENET2 mdio Add the missing input mux for ENET2 mdio. Without this setting, it is not possible to read the MDIO answers back from the PHY. Signed-off-by: Steffen Trumtrar Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit b6ff8ca733500a7394d926c74ac20b428b225db7 Author: Douglas Gilbert Date: Tue May 12 21:39:43 2020 -0400 scsi: scsi_debug: Parser tables and code interaction This patch is in response to a static analyser report from Dan Carpenter titled: "[bug report] scsi: scsi_debug: Add per_host_store option". This code may not clear the static analyzer reports, but may shed light on why they occur. Amongst other things this driver has a table driven SCSI command parser which also involves some C code. There are some invariants between the table entries and the corresponding C code (i.e. the resp_*() functions) that, if broken, may lead to a NULL dereference. And the report is valid, at least in the case of the PRE-FETCH command. Alas, that is not one of the cases that the static analyzer reported. In this particular corner case: when the fake_rw flag is set and the table entry for a "store"-accessing command does not have the required F_FAKE_RW flag set, do the following. Call BUG_ON() in the devip2sip() very close to a comment block explaining why it was called and how to fix it. checkpatch.pl complains about the BUG_ON() but there is no reasonable remedial action that can be taken at run time. This change allows the code reported by the static analyzer to be simplified. Comments were also added to the table flags (e.g. F_FAKE_RW) so developers who add commands might be more inclined to use them (properly). Link: https://lore.kernel.org/r/20200513013943.25285-1-dgilbert@interlog.com Reported-by: Dan Carpenter Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit d7e1c2b081b08dbcd8717613407dd9f99f3b9c0f Author: Anson Huang Date: Thu May 14 09:08:48 2020 +0800 ARM: dts: imx6sl: Use nvmem interface to get fuse data Although ocotp clock is always ON for i.MX6SL, OCOTP can be accessed directly, but since i.MX6SL nvmem interface is supported, and fsl,tempmon-data is deprecated, use it instead of getting fuse data by reading ocotp directly, this makes all i.MX6 SoCs aligned. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit d8a6511d988a80dc7b1a83bcc213c6340def3590 Author: Anson Huang Date: Thu May 14 09:08:47 2020 +0800 ARM: dts: imx6qdl: Use nvmem interface to get fuse data Although ocotp clock is always ON for i.MX6QDL, OCOTP can be accessed directly, but since i.MX6QDL nvmem interface is supported, and fsl,tempmon-data is deprecated, use it instead of getting fuse data by reading ocotp directly, this makes all i.MX6 SoCs aligned. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 4792ff641cc8993606013d27d84cda59d8cc76c5 Author: Tim Harvey Date: Tue May 12 15:02:34 2020 -0700 ARM: dts: imx6qdl-gw5910: fix wlan regulator Connect the wl_reg regulator to usdhc2 such that it can be enabled and disabled as needed. There is no need for this to be always-on. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit d40edafe80569c5b4d8893c1cdd1060c54ef433c Author: Tim Harvey Date: Tue May 12 14:54:15 2020 -0700 ARM: dts: imx6qdl-gw5910: add support for bcm4330-bt The Sterling-LWB has a BCM4330 which has a UART based bluetooth HCI. Add support for binding to the bcm_hci driver to take care of handling the shutdown gpio and loading firmware. Because the shutdown gpio is more of an enable than a regulator go ahead and replace the regulator with a shutdown-gpio. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit c8756cbad816954be912ba32277ccd55fe7acc01 Author: Tim Harvey Date: Tue May 12 13:59:56 2020 -0700 ARM: dts: imx6qdl-gw5904: add lsm9ds1 iio imu/magn support Add one node for the accel/gyro i2c device and another for the separate magnetometer device in the lsm9ds1. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 9e72702a3d9a967edac02d8e937bce2b68b77814 Author: Tim Harvey Date: Tue May 12 13:59:37 2020 -0700 ARM: dts: imx6qdl-gw560x: add lsm9ds1 iio imu/magn support Add one node for the accel/gyro i2c device and another for the separate magnetometer device in the lsm9ds1. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 840e1b55bb752c6617a85eb01d15432bebe8c559 Author: Ye Bin Date: Mon May 18 15:47:32 2020 +0800 scsi: core: Refactor scsi_mq_setup_tags function shost->tag_set is used too many times, introduce temporary parameter tag_set instead of &shost->tag_set. Link: https://lore.kernel.org/r/20200518074732.39679-1-yebin10@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Ye Bin Signed-off-by: Martin K. Petersen commit 4dea170f4fb225984b4f2f1cf0a41d485177b905 Author: Ye Bin Date: Mon May 18 15:44:20 2020 +0800 scsi: core: Fix incorrect usage of shost_for_each_device shost_for_each_device(sdev, shost) \ for ((sdev) = __scsi_iterate_devices((shost), NULL); \ (sdev); \ (sdev) = __scsi_iterate_devices((shost), (sdev))) When terminating shost_for_each_device() iteration with break or return, scsi_device_put() should be used to prevent stale scsi device references from being left behind. Link: https://lore.kernel.org/r/20200518074420.39275-1-yebin10@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Ye Bin Signed-off-by: Martin K. Petersen commit 012d1c246f1f821762404196f04591411fc17e22 Author: Anson Huang Date: Tue May 12 10:25:07 2020 +0800 ARM: dts: imx53: Add src node interrupt Interrupt is a required property according to SRC binding, add it for SRC node. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 905d3d25c18a44f9e69fa5b1c2a6467df0471fe2 Author: Anson Huang Date: Tue May 12 10:25:06 2020 +0800 ARM: dts: imx51: Add src node interrupt Interrupt is a required property according to SRC binding, add it for SRC node. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 7ffa5b939751b6638e4a99518775c8503fbb46be Author: Bart Van Assche Date: Mon May 18 14:17:12 2020 -0700 scsi: qla2xxx: Fix endianness annotations in source files Fix all endianness complaints reported by sparse (C=2) without affecting the behavior of the code on little endian CPUs. Link: https://lore.kernel.org/r/20200518211712.11395-16-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Daniel Wagner Cc: Roman Bolshakov Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 21038b0900d1b8728ec77d9286d7b0b57ca7b585 Author: Bart Van Assche Date: Mon May 18 14:17:11 2020 -0700 scsi: qla2xxx: Fix endianness annotations in header files Annotate members of FC protocol and firmware dump data structures as big endian. Annotate members of RISC control structures as little endian. Annotate mailbox registers as little endian. Annotate the mb[] arrays as CPU-endian because communication of the mb[] values with the hardware happens through the readw() and writew() functions. readw() converts from __le16 to u16 and writew() converts from u16 to __le16. Annotate 'handles' as CPU-endian because for the firmware these are opaque values. Link: https://lore.kernel.org/r/20200518211712.11395-15-bvanassche@acm.org CC: Hannes Reinecke Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2a4b684ab0aa2a8f8efede77ca1525042c2c0e01 Author: Bart Van Assche Date: Mon May 18 14:17:10 2020 -0700 scsi: qla2xxx: Use make_handle() instead of open-coding it Link: https://lore.kernel.org/r/20200518211712.11395-14-bvanassche@acm.org Cc: Arun Easi Cc: Nilesh Javali Cc: Martin Wilck Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Roman Bolshakov Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ab053c09ee2066a2fe62a755f1e64dbc8eddc17c Author: Bart Van Assche Date: Mon May 18 14:17:09 2020 -0700 scsi: qla2xxx: Cast explicitly to uint16_t / uint32_t Casting a pointer to void * and relying on an implicit cast from void * to uint16_t or uint32_t suppresses sparse warnings about endianness. Hence cast explicitly to uint16_t and uint32_t. Additionally, remove superfluous void * casts. Link: https://lore.kernel.org/r/20200518211712.11395-13-bvanassche@acm.org Cc: Arun Easi Cc: Nilesh Javali Cc: Daniel Wagner Cc: Himanshu Madhani Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 04474d3a1c968119e7214c312b273dee01258cad Author: Bart Van Assche Date: Mon May 18 14:17:08 2020 -0700 scsi: qla2xxx: Change {RD,WRT}_REG_*() function names from upper case into lower case This was suggested by Daniel Wagner. Link: https://lore.kernel.org/r/20200518211712.11395-12-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Arun Easi Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 37139da1b097e06841d40a6055db64c78755aea9 Author: Bart Van Assche Date: Mon May 18 14:17:07 2020 -0700 scsi: qla2xxx: Fix the code that reads from mailbox registers Make the MMIO accessors strongly typed such that the compiler checks whether the accessor function is used that matches the register width. Fix those MMIO accesses where another number of bits was read or written than the size of the register. Link: https://lore.kernel.org/r/20200518211712.11395-11-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c3888416221849ed46fd35413c7a1d00ee291cbe Author: Bart Van Assche Date: Mon May 18 14:17:06 2020 -0700 scsi: qla2xxx: Use register names instead of register offsets Make qla27xx_write_remote_reg() easier to read by using register names instead of register offsets. The 'pahole' tool has been used to convert register offsets into register names. See also commit cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling"). Link: https://lore.kernel.org/r/20200518211712.11395-10-bvanassche@acm.org Cc: Arun Easi Cc: Nilesh Javali Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e544b720ef3191cdb6d3ea2915f82973d6372bca Author: Bart Van Assche Date: Mon May 18 14:17:05 2020 -0700 scsi: qla2xxx: Change two hardcoded constants into offsetof() / sizeof() expressions This patch does not change any functionality. Link: https://lore.kernel.org/r/20200518211712.11395-9-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Arun Easi Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d9ab5f1f05fc147682d4fd1f1f1c5af00b766e33 Author: Bart Van Assche Date: Mon May 18 14:17:04 2020 -0700 scsi: qla2xxx: Increase the size of struct qla_fcp_prio_cfg to FCP_PRIO_CFG_SIZE This patch fixes the following Coverity complaint without changing any functionality: CID 337793 (#1 of 1): Wrong size argument (SIZEOF_MISMATCH) suspicious_sizeof: Passing argument ha->fcp_prio_cfg of type struct qla_fcp_prio_cfg * and argument 32768UL to function memset is suspicious because a multiple of sizeof (struct qla_fcp_prio_cfg) /*48*/ is expected. memset(ha->fcp_prio_cfg, 0, FCP_PRIO_CFG_SIZE); Link: https://lore.kernel.org/r/20200518211712.11395-8-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 66f86367771507c88a970644d13646f6b57e82e5 Author: Bart Van Assche Date: Mon May 18 14:17:03 2020 -0700 scsi: qla2xxx: Make a gap in struct qla2xxx_offld_chain explicit This patch makes struct qla2xxx_offld_chain compatible with ARCH=i386. Link: https://lore.kernel.org/r/20200518211712.11395-7-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Hannes Reinecke Reviewed-by: Arun Easi Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8a73a0e002b318d8ad79fe0e6b48e27ca30e527a Author: Bart Van Assche Date: Mon May 18 14:17:02 2020 -0700 scsi: qla2xxx: Add more BUILD_BUG_ON() statements Before fixing the endianness annotations in data structures, make the compiler verify the size of FC protocol and firmware data structures. Link: https://lore.kernel.org/r/20200518211712.11395-6-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 59d23cf3f2e4c100ac21f7e00e5817d5e8a3a2e2 Author: Bart Van Assche Date: Mon May 18 14:17:01 2020 -0700 scsi: qla2xxx: Sort BUILD_BUG_ON() statements alphabetically Before adding more BUILD_BUG_ON() statements, sort the existing statements alphabetically. Link: https://lore.kernel.org/r/20200518211712.11395-5-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Arun Easi Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8ae178760b23e2055aecf8b8a54629cec7ccc58e Author: Bart Van Assche Date: Mon May 18 14:17:00 2020 -0700 scsi: qla2xxx: Simplify the functions for dumping firmware Instead of passing an argument to the firmware dumping functions that tells these functions whether or not to obtain the hardware lock, obtain that lock before calling these functions. This patch fixes the following recently introduced C=2 build error: CHECK drivers/scsi/qla2xxx/qla_tmpl.c drivers/scsi/qla2xxx/qla_tmpl.c:1133:1: error: Expected ; at end of statement drivers/scsi/qla2xxx/qla_tmpl.c:1133:1: error: got } drivers/scsi/qla2xxx/qla_tmpl.h:247:0: error: Expected } at end of function drivers/scsi/qla2xxx/qla_tmpl.h:247:0: error: got end-of-input Link: https://lore.kernel.org/r/20200518211712.11395-4-bvanassche@acm.org Fixes: cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling") Cc: Arun Easi Cc: Nilesh Javali Cc: Himanshu Madhani Cc: Martin Wilck Cc: Roman Bolshakov Reviewed-by: Hannes Reinecke Reviewed-by: Daniel Wagner Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit fbbc95a49d5b00a66d82ea34b7f029963b6c91f3 Author: Bart Van Assche Date: Mon May 18 14:16:59 2020 -0700 scsi: qla2xxx: Suppress two recently introduced compiler warnings Suppress the following two compiler warnings because these are not useful: In file included from ./include/trace/define_trace.h:102, from ./include/trace/events/qla.h:39, from drivers/scsi/qla2xxx/qla_dbg.c:77: ./include/trace/events/qla.h: In function 'trace_event_raw_event_qla_log_event': ./include/trace/trace_events.h:691:9: warning: function 'trace_event_raw_event_qla_log_event' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] 691 | struct trace_event_raw_##call *entry; \ | ^~~~~~~~~~~~~~~~ ./include/trace/events/qla.h:12:1: note: in expansion of macro 'DECLARE_EVENT_CLASS' 12 | DECLARE_EVENT_CLASS(qla_log_event, | ^~~~~~~~~~~~~~~~~~~ In file included from ./include/trace/define_trace.h:103, from ./include/trace/events/qla.h:39, from drivers/scsi/qla2xxx/qla_dbg.c:77: ./include/trace/events/qla.h: In function 'perf_trace_qla_log_event': ./include/trace/perf.h:41:9: warning: function 'perf_trace_qla_log_event' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] 41 | struct hlist_head *head; \ | ^~~~~~~~~~ ./include/trace/events/qla.h:12:1: note: in expansion of macro 'DECLARE_EVENT_CLASS' Link: https://lore.kernel.org/r/20200518211712.11395-3-bvanassche@acm.org Fixes: 598a90f2002c ("scsi: qla2xxx: add ring buffer for tracing debug logs") Cc: Rajan Shanmugavelu Cc: Joe Jin Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Arun Easi Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 246ee22583ed4847dcdd9a2f307eeca856f42882 Author: Bart Van Assche Date: Mon May 18 14:16:58 2020 -0700 scsi: qla2xxx: Fix spelling of a variable name Change "offet" into "offset" in a variable name. Link: https://lore.kernel.org/r/20200518211712.11395-2-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Martin Wilck Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Arun Easi Reviewed-by: Roman Bolshakov Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 64d7bf58e72be362ce2f2682e1250dcf2e61a1e6 Author: Ma Feng Date: Mon May 11 20:36:04 2020 +0800 ARM: imx: pcm037: make pcm970_sja1000_platform_data static Fix sparse warning: arch/arm/mach-imx/mach-pcm037.c:407:30: warning: symbol 'pcm970_sja1000_platform_data' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Ma Feng Signed-off-by: Shawn Guo commit 61fb2482216679b9e1e797440c148bb143a5040a Author: Bodo Stroesser Date: Mon May 18 18:48:33 2020 +0200 scsi: target: tcmu: Userspace must not complete queued commands When tcmu queues a new command - no matter whether in command ring or in qfull_queue - a cmd_id from IDR udev->commands is assigned to the command. If userspace sends a wrong command completion containing the cmd_id of a command on the qfull_queue, tcmu_handle_completions() finds the command in the IDR and calls tcmu_handle_completion() for it. This might do some nasty things because commands in qfull_queue do not have a valid dbi list. To fix this bug, we no longer add queued commands to the idr. Instead the cmd_id is assign when a command is written to the command ring. Due to this change I had to adapt the source code at several places where up to now an idr_for_each had been done. [mkp: fix checkpatch warnings] Link: https://lore.kernel.org/r/20200518164833.12775-1-bstroesser@ts.fujitsu.com Acked-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit 1641b2347070da6d3ae96c7c77a68f98053d03f2 Author: Anson Huang Date: Sat May 9 16:17:51 2020 +0800 arm64: dts: imx8mp: Add src node interrupts Interrupts is a required property according to SRC binding, add it for SRC node. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit d0955f66494100d3109c36a3244cc7e374e3a4af Author: Anson Huang Date: Sat May 9 16:17:50 2020 +0800 arm64: dts: imx8mq: Add src node interrupts Interrupts is a required property according to SRC binding, add it for SRC node. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 5b4bf802427e3f49b9bca5e02ec7154e4d3d63ad Author: Andreas Kemnade Date: Thu May 7 22:43:39 2020 +0200 ARM: imx_v6_v7_defconfig: extend RN5T618 PMIC family support There are new drivers for functionality of that family (RTC and ADC), so enable them, since they are used by various i.MX6 boards. Signed-off-by: Andreas Kemnade Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 5482d56bfedf1a2ce6450076e844676e20ab4e0a Author: Lance Digby Date: Mon May 18 11:02:16 2020 +1000 scsi: target: core: Add initiatorname to NON_EXISTENT_LUN error The NON_EXISTENT_LUN error can be written without an error condition on the initiator responsible. Adding the initiatorname to this message will reduce the effort required to fix this when many initiators are supported by a target. This version ensures the initiator name is also printed on the same message in transport_lookup_tmr_lun for consistency. Link: https://lore.kernel.org/r/9b13bb2e1f52f1792cd81850ee95bf3781bb5363.1589759816.git.lance.digby@gmail.com Reviewed-by: Mike Christie Signed-off-by: Lance Digby Signed-off-by: Martin K. Petersen commit b737beddb32994ad878cff4ccfd24d68e082dcb7 Author: Peng Fan Date: Thu May 7 13:56:15 2020 +0800 clk: imx8m: migrate A53 clk root to use composite core Migrate A53 clk root to use composite core clk type. It will simplify code and make it easy to use composite specific mux operation. Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 8c83a8ff4dd92878c2e1163a1b4a12ce29f8fa68 Author: Peng Fan Date: Thu May 7 13:56:14 2020 +0800 clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code Use imx8m_clk_hw_composite_core to simpliy clks that belong to core clk slice. Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 77f5d2d97353149d43b401ae98bd0c071cdd2fb6 Author: Peng Fan Date: Thu May 7 13:56:13 2020 +0800 clk: imx8mp: Define gates for pll1/2 fixed dividers Inspried from commit e8688fe8df7d ("clk: imx8mn: Define gates for pll1/2 fixed dividers") On imx8mp there are 9 fixed-factor dividers for SYS_PLL1 and SYS_PLL2 each with their own gate. Only one of these gates (the one "dividing" by one) is currently defined and it's incorrectly set as the parent of all the fixed-factor dividers. Add the other 8 gates to the clock tree between sys_pll1/2_bypass and the fixed dividers. Reviewed-by: Dong Aisheng Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit dc6e21da340297604f217bcff016389cf78b2a49 Author: Peng Fan Date: Thu May 7 13:56:12 2020 +0800 clk: imx: imx8mp: fix pll mux bit Same to i.MX8MN/i.MX8MM, pll BYPASS bit should be kept inside pll driver for glitchless freq setting following spec. If exposing the bit, that means pll driver and clk driver has two paths to touch this bit, which is wrong. So use EXT_BYPASS bit here. Reviewed-by: Dong Aisheng Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit cccc46474227eaaa7cd8f5601bba58489e237991 Author: Peng Fan Date: Thu May 7 13:56:11 2020 +0800 clk: imx8m: drop clk_hw_set_parent for A53 The parent settings have been moved to dtsi, we no need to set parent here. And clk_hw_set_parent will trigger lockdep warning, because this api not have prepare_lock. Reported-by: Leonard Crestez Reviewed-by: Dong Aisheng Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 9e6337e6fdb1573ed0371557505d2292cb78245d Author: Peng Fan Date: Thu May 7 13:56:10 2020 +0800 arm64: dts: imx8m: assign clocks for A53 Assign IMX8M*_CLK_A53_SRC's parent to system pll1 and assign IMX8M*_CLK_A53_CORE's parent to arm pll out as what is done in drivers/clk/imx/clk-imx8m*.c, then we could remove the settings in driver which triggers lockdep warning. Reported-by: Leonard Crestez Reviewed-by: Dong Aisheng Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 1cdee004426164d1b00b66d3f6e7308c3714def6 Author: John Garry Date: Fri May 15 22:13:45 2020 +0800 scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw() The error codes are never checked, stop returning them. Link: https://lore.kernel.org/r/1589552025-165012-5-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 1a0efb55b2bb9e970b8842030ce65d645ddba90c Author: Luo Jiaxing Date: Fri May 15 22:13:44 2020 +0800 scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list Register SAS_RAS_INTR0 can help us to figure out which ECC error has occurred. This register is helpful to identify RAS issue, so we add it to the list of debugfs register name list for easier retrieval. Link: https://lore.kernel.org/r/1589552025-165012-4-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 1e954d1f002db802937deb87a868c3f62fe1badf Author: Luo Jiaxing Date: Fri May 15 22:13:43 2020 +0800 scsi: hisi_sas: Modify the commit information for DSM method Make it clear that BIOS may modify some register settings. Link: https://lore.kernel.org/r/1589552025-165012-3-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit e16b9ed61e078d836a0f24a82080cf29d7539c7e Author: Luo Jiaxing Date: Fri May 15 22:13:42 2020 +0800 scsi: hisi_sas: Do not reset phy timer to wait for stray phy up We found out that after phy up, the hardware reports another oob interrupt but did not follow a phy up interrupt: oob ready -> phy up -> DEV found -> oob read -> wait phy up -> timeout We run link reset when wait phy up timeout, and it send a normal disk into reset processing. So we made some circumvention action in the code, so that this abnormal oob interrupt will not start the timer to wait for phy up. Link: https://lore.kernel.org/r/1589552025-165012-2-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit c5f8852273dd7df45d3fe12cf0e2ec68cacfad80 Author: Damien Le Moal Date: Fri May 15 14:48:56 2020 +0900 scsi: sd: Add zoned capabilities device attribute Export through sysfs as a scsi_disk attribute the zoned capabilities of a disk ("zoned_cap" attribute file). This new attribute indicates in human readable form (i.e. a string) the zoned block capabilities implemented by the disk as found in the ZONED field of the disk block device characteristics VPD page. The possible values are: - "none": ZONED=00b (not reported), regular disk - "host-aware": ZONED=01b, host-aware ZBC disk - "drive-managed": ZONED=10b, drive-managed ZBC disk (regular disk interface) For completeness, also add the following value which is detected using the device type rather than the ZONED field: - "host-managed": device type = 0x14 (TYPE_ZBC), host-managed ZBC disk This new sysfs attribute is purely informational and complementary to the "zoned" device request queue sysfs attribute as it allows applications and user daemons (e.g. udev) to easily differentiate regular disks from drive-managed SMR disks without the need for direct access tools such as provided by sg3utils. Link: https://lore.kernel.org/r/20200515054856.1408575-1-damien.lemoal@wdc.com Reviewed-by: Johannes Thumshirn Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit a0a44420e5441ae980b7c941d027b01b8cb37218 Author: Michael Walle Date: Tue May 5 17:00:37 2020 +0200 arm64: dts: freescale: sl28: enable LPUART1 Now that the LPUART has support for the LS1028A SoC, also enable it on our board. Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit fc9d276f22330e9322a9c592c71e0571810205f7 Author: Julia Lawall Date: Thu May 7 21:30:08 2020 +0200 tracing/probe: reverse arguments to list_add Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses a trace_probe_event.probes object as the second argument of list_for_each_entry, ie as a list head, while the list_for_each_entry iterates over the list fields of the trace_probe structures, making them the list elements. So, exchange the arguments on the list_add call to put the list head in the second argument. Since both list_head structures were just initialized, this problem did not cause any loss of information. Link: https://lkml.kernel.org/r/1588879808-24488-1-git-send-email-Julia.Lawall@inria.fr Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe") Acked-by: Masami Hiramatsu Signed-off-by: Julia Lawall Signed-off-by: Steven Rostedt (VMware) commit 98d0a685cf8bcde23f4b0d1aa0a348fcef84569b Author: Masami Hiramatsu Date: Sat May 9 09:58:25 2020 +0900 tools/bootconfig: Add a summary of test cases and return error Add summary lines of test cases and return an error code if any test case fails so that tester don't have to monitor the output. Link: https://lkml.kernel.org/r/158898590533.22749.10269622752797822320.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit c143b7753b308d5f7d03b165a7fdff1dda1f271d Author: Cheng Jian Date: Fri May 15 10:08:28 2020 +0000 ftrace: show debugging information when panic_on_warn set When an anomaly is detected in the function call modification code, ftrace_bug() is called to disable function tracing as well as give some warn and information that may help debug the problem. But currently, we call FTRACE_WARN_ON_ONCE() first in ftrace_bug(), so when panic_on_warn is set, we can't see the debugging information here. Call FTRACE_WARN_ON_ONCE() at the end of ftrace_bug() to ensure that the debugging information is displayed first. after this patch, the dmesg looks like: ------------[ ftrace bug ]------------ ftrace failed to modify [] bcm2835_handle_irq+0x4/0x58 actual: 1f:20:03:d5 Setting ftrace call site to call ftrace function ftrace record flags: 80000001 (1) expected tramp: ffff80001009d6f0 ------------[ cut here ]------------ WARNING: CPU: 2 PID: 1635 at kernel/trace/ftrace.c:2078 ftrace_bug+0x204/0x238 Kernel panic - not syncing: panic_on_warn set ... CPU: 2 PID: 1635 Comm: sh Not tainted 5.7.0-rc5-00033-gb922183867f5 #14 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x1b0 show_stack+0x20/0x30 dump_stack+0xc0/0x10c panic+0x16c/0x368 __warn+0x120/0x160 report_bug+0xc8/0x160 bug_handler+0x28/0x98 brk_handler+0x70/0xd0 do_debug_exception+0xcc/0x1ac el1_sync_handler+0xe4/0x120 el1_sync+0x7c/0x100 ftrace_bug+0x204/0x238 Link: https://lkml.kernel.org/r/20200515100828.7091-1-cj.chengjian@huawei.com Signed-off-by: Cheng Jian Signed-off-by: Steven Rostedt (VMware) commit 5cac1095cf289f7623f835a9212b9ec0ad3b85b3 Author: Bart Van Assche Date: Thu May 7 15:27:50 2020 -0700 scsi: ufs: Make ufshcd_wait_for_register() sleep instead of busy-waiting The ufshcd_wait_for_register() function either sleeps or spins until the specified register has reached the desired value. Busy-waiting is not only considered a bad practice but also has a bad impact on energy consumption. Always sleep instead of spinning by making sure that all ufshcd_wait_for_register() calls happen from a context where it is allowed to sleep. The only function call that has to be moved is the ufshcd_hba_stop() call in ufshcd_host_reset_and_restore(). Link: https://lore.kernel.org/r/20200507222750.19113-1-bvanassche@acm.org Cc: Can Guo Cc: Avri Altman Cc: Bean Huo Cc: Alim Akhtar Cc: Asutosh Das Tested-by: Bean Huo Reviewed-by: Stanley Chu Reviewed-by: Bean Huo Reviewed-by: Asutosh Das Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d0b1e4a638d670a09f42017a3e567dc846931ba8 Author: Wei Yongjun Date: Tue Apr 28 14:18:55 2020 +0000 scsi: cxlflash: Fix error return code in cxlflash_probe() Fix to return negative error code -ENOMEM from create_afu error handling case instead of 0, as done elsewhere in this function. Link: https://lore.kernel.org/r/20200428141855.88704-1-weiyongjun1@huawei.com Acked-by: Matthew R. Ochs Signed-off-by: Wei Yongjun Signed-off-by: Martin K. Petersen commit 16d6b91a4b2a817ab0b8e224cffa0c838b16a8df Author: Fabio Estevam Date: Fri May 1 17:37:47 2020 -0300 ARM: dts: imx50: Remove unused iomuxc-gpr node The iomuxc-gpr node is not used and causes the following dtc warning with W=1: arch/arm/boot/dts/imx50.dtsi:286.28-289.6: Warning (unique_unit_address): /soc/bus@50000000/iomuxc@53fa8000: duplicate unit-address (also used in node /soc/bus@50000000/iomuxc-gpr@53fa8000) Remove the node to fix the warning. Signed-off-by: Fabio Estevam Reviewed-by: Abel Vesa Signed-off-by: Shawn Guo commit fa578d4e9fbef8928a45edd904dafb1e3334417e Author: Yangbo Lu Date: Thu Apr 30 10:56:46 2020 +0800 arm64: dts: ls1043a-rdb: add compatible for board Add compatible for board to identify. Signed-off-by: Yangbo Lu Signed-off-by: Shawn Guo commit 819f7427bafd494ef7ca4942ec6322db20722d7b Author: Aharon Landau Date: Wed May 13 12:55:50 2020 +0300 RDMA/mlx5: Add init2init as a modify command Missing INIT2INIT entry in the list of modify commands caused DEVX applications to be unable to modify_qp for this transition state. Add the MLX5_CMD_OP_INIT2INIT_QP opcode to the list of allowed DEVX opcodes. Fixes: e662e14d801b ("IB/mlx5: Add DEVX support for modify and query commands") Link: https://lore.kernel.org/r/20200513095550.211345-1-leon@kernel.org Signed-off-by: Aharon Landau Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 711195e57d341e58133d92cf8aaab1db24e4768d Author: Lijun Ou Date: Fri May 8 17:45:59 2020 +0800 RDMA/hns: Reserve one sge in order to avoid local length error When rq/srq sge length is smaller than sq sge length, it will produce a local length error and may cause the bus to hang. Therefore, for rq wqe and srq wqe, one reserved sge pointing to a reserved mr is used to avoid this error. Link: https://lore.kernel.org/r/1588931159-56875-10-git-send-email-liweihang@huawei.com Signed-off-by: Lijun Ou Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 9581a356ccadb24d4a18c62c5c8327997e47241e Author: Xi Wang Date: Fri May 8 17:45:58 2020 +0800 RDMA/hns: Rename macro for defining hns hardware page size Rename the PAGE_ADDR_SHIFT as HNS_HW_PAGE_SHIFT to make code more readable. Link: https://lore.kernel.org/r/1588931159-56875-9-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 252067e95035151372f21c0c8626bf6fed9c5f0b Author: Weihang Li Date: Fri May 8 17:45:57 2020 +0800 RDMA/hns: Remove redundant memcpy() srq_context is a local variables and is only used to get some fields from buffer of mailbox. It's meaningless to copy mailbox's buffer's contents back to it. Link: https://lore.kernel.org/r/1588931159-56875-8-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 7b611d2f6e8b99b699996c52b823454f4a74978f Author: Lang Cheng Date: Fri May 8 17:45:56 2020 +0800 RDMA/hns: Store mr len information into mr obj The length information should be stored in the struct ib_mr object, otherwise the length value of a valid mr object would always be 0. Link: https://lore.kernel.org/r/1588931159-56875-7-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit d4d813874156063eae6542c66da2a6971592e46f Author: Weihang Li Date: Fri May 8 17:45:55 2020 +0800 RDMA/hns: Fix error with to_hr_hem_entries_count() For ilog2(x), if x is 0 and not a constant variable, it will return -1. And there will be an error as below: hns3 0000:7d:00.0 hns_0: Local work queue 0x8 catast error, sub_event type is: 2 So modify to_hr_hem_entries_shift() to return 0 if conut is 0. Fixes: 54d6638765b0 ("RDMA/hns: Optimize WQE buffer size calculating process") Link: https://lore.kernel.org/r/1588931159-56875-6-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 6968aeb5aa64a46175f408fa91e49c19e9558428 Author: Weihang Li Date: Fri May 8 17:45:54 2020 +0800 RDMA/hns: Fix wrong assignment of SRQ's max_wr srq's attribute max_wr should be 1 less than the total count of wqe. Fixes: ffb1308b88b6 ("RDMA/hns: Move SRQ code to the reasonable place") Link: https://lore.kernel.org/r/1588931159-56875-5-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 053c0acf52edf97cae7d53c9f249f7c2eb565ed9 Author: Wenpeng Liang Date: Fri May 8 17:45:53 2020 +0800 RDMA/hns: Fix assignment to ba_pg_sz of eqe When allocating eq buffer, the size of base address page should be defined by eqe_ba_pg_sz instead of srqwqe_ba_pg_sz. Fixes: 477a0a387072 ("RDMA/hns: Optimize 0 hop addressing for EQE buffer") Link: https://lore.kernel.org/r/1588931159-56875-4-git-send-email-liweihang@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 441c88d5b3ff80108ff536c6cf80591187015403 Author: Lang Cheng Date: Fri May 8 17:45:52 2020 +0800 RDMA/hns: Fix cmdq parameter of querying pf timer resource The firmware has reduced the number of descriptions of command HNS_ROCE_OPC_QUERY_PF_TIMER_RES to 1. The driver needs to adapt, otherwise the hardware will report error 4(CMD_NEXT_ERR). Fixes: 0e40dc2f70cd ("RDMA/hns: Add timer allocation support for hip08") Link: https://lore.kernel.org/r/1588931159-56875-3-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 349be276509455ac2f19fa4051ed773082c6a27e Author: Lijun Ou Date: Fri May 8 17:45:51 2020 +0800 RDMA/hns: Bugfix for querying qkey The qkey queried through the query ud qp verb is a fixed value and it should be read from qp context. Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC") Link: https://lore.kernel.org/r/1588931159-56875-2-git-send-email-liweihang@huawei.com Signed-off-by: Lijun Ou Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit bd25c8066fc2e0868228b3cb0563d6c1b65505b2 Author: Gustavo A. R. Silva Date: Tue May 19 18:30:18 2020 -0500 RDMA/siw: Replace one-element array and use struct_size() helper The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size; memcpy(instance->data, source, size); but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. So, replace the one-element array with a flexible-array member. Also, make use of the new struct_size() helper to properly calculate the size of struct siw_pbl. This issue was found with the help of Coccinelle and, audited and fixed _manually_. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/20200519233018.GA6105@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jason Gunthorpe commit d6ea395072457153f2120e2361657e00f3c0958d Author: Danil Kipnis Date: Tue May 19 13:14:19 2020 +0200 rnbd/rtrs: Pass max segment size from blk user to the rdma library When Block Device Layer is disabled, BLK_MAX_SEGMENT_SIZE is undefined. The rtrs is a transport library and should compile independently of the block layer. The desired max segment size should be passed down by the user. Introduce max_segment_size parameter for the rtrs_clt_open() call. Fixes: f7a7a5c228d4 ("block/rnbd: client: main functionality") Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Fixes: cb80329c9434 ("RDMA/rtrs: client: private header with client structs and functions") Fixes: b5c27cdb094e ("RDMA/rtrs: public interface header to establish RDMA connections") Link: https://lore.kernel.org/r/20200519111419.924170-1-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Signed-off-by: Jason Gunthorpe commit 6b31afcef51e578e936e66c347ab333c024963da Author: Wei Yongjun Date: Tue May 19 09:19:12 2020 +0000 RDMA/rtrs: server: Fix some error return code Fix to return negative error code -ENOMEM from the some error handling cases instead of 0, as done elsewhere in this function. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Fixes: 91b11610af8d ("RDMA/rtrs: server: sysfs interface functions") Link: https://lore.kernel.org/r/20200519091912.134358-1-weiyongjun1@huawei.com Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Danil Kipnis Signed-off-by: Jason Gunthorpe commit e19840867013f0f4081265fdb65b31e80b7bcb5b Author: Gustavo A. R. Silva Date: Tue May 19 11:36:12 2020 -0500 RDMA/rtrs: client: Fix function return on success Remove the if-statement and return the value contained in _err_, unconditionally. Link: https://lore.kernel.org/r/20200519163612.GA6043@embeddedor Addresses-Coverity-ID: 1493753 ("Identical code for different branches") Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit bf1d8edb38bbf0628c1f2de7d13ab98533c1fe60 Author: Dan Carpenter Date: Tue May 19 18:45:25 2020 +0300 RDMA/rtrs: Fix a couple off by one bugs in rtrs_srv_rdma_done() These > comparisons should be >= to prevent accessing one element beyond the end of the buffer. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Link: https://lore.kernel.org/r/20200519154525.GA66801@mwanda Signed-off-by: Dan Carpenter Acked-by: Danil Kipnis Signed-off-by: Jason Gunthorpe commit b386cd65d961e29710ef6ad84bc788f0a7e9d64e Author: Dan Carpenter Date: Tue May 19 16:32:23 2020 +0300 RDMA/rtrs: Fix some signedness bugs in error handling The problem is that "req->sg_cnt" is an unsigned int so if "nr" is negative, it gets type promoted to a high positive value and the condition is false. This patch fixes it by handling negatives separately. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Link: https://lore.kernel.org/r/20200519133223.GN2078@kadam Signed-off-by: Dan Carpenter Reviewed-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 647e1643d61312ce08172e466fa1c8d8a5c8fbc8 Author: Christian Hewitt Date: Mon May 18 02:54:51 2020 +0000 arm64: dts: meson: add ethernet interrupt to wetek dtsi Add Ethernet interrupt details to the WeTek Hub/Play2 dtsi to resolve an issue with Ethernet probing in mainline u-boot. Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200518025451.16401-1-christianshewitt@gmail.com commit 1d6ece87b750cf26fed4eb794ea0b2fc7ff2be10 Author: Christian Hewitt Date: Sun May 10 12:41:29 2020 +0000 arm64: dts: meson: add support for the Smartlabs SML-5442TW The Smartlabs SML-5442TW is based on the Amlogic P231 reference design but with the following differences: - The Yellow and Blue LEDs are available but disabled - The Red and Green LEDs are used to signal off/on status - uart_AO can be accessed after opening the case; soldered pins exist - QCA9377 instead of the usual Ampak/Broadcom module Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200510124129.31575-4-christianshewitt@gmail.com commit 341e85047bdbc0196c91ccb4612ffab87bae9cfe Author: Christian Hewitt Date: Sun May 10 12:41:28 2020 +0000 dt-bindings: arm: amlogic: add support for the Smartlabs SML-5442TW The SML-5442TW is an STB for O2 Czech IPTV/VOD and DVB-T/T2 based on the Amlogic P231 reference design using the S905D chipset. Specs: 2GB DDR3 RAM 8GB eMMC storage 10/100 Base-T Ethernet 802.11 a/b/g/n/ac + BT 4.1 HS sdio wireless module (QCA9377) 2x single colour and 1x dual colour LEDs on the front panel 1x reset button on the front panel HDMI 2.0 (4k@60p) video Composite video + 2-channel audio output on 3.5mm jack S/PDIF audio output Single DVB-T/T2 tuner (AVL6762/MxL608) 2x USB 2.0 ports 1x micro SD card slot UART pins (internal) Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200510124129.31575-3-christianshewitt@gmail.com commit bc15895e142396fed5ebf1f60139d9ca9a56a4e4 Author: Christian Hewitt Date: Sun May 10 12:41:27 2020 +0000 dt-bindings: add vendor prefix for Smartlabs LLC Smartlabs LLC are a professional integrator of Interactive TV solutions and IPTV/VOD devices [1]. [1] https://www.smartlabs.tv/en/about/ Signed-off-by: Christian Hewitt Signed-off-by: Kevin Hilman Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200510124129.31575-2-christianshewitt@gmail.com commit dbffd7f9bdb463437d3c3f7c3e1bd4379a785fe4 Author: Jerome Brunet Date: Thu May 7 00:16:56 2020 +0200 arm64: dts: meson: g12: add internal DAC glue add the internal DAC glue support on the g12 and sm1 family This glue connects the different TDM interfaces of the SoC to the internal audio DAC codec. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-8-jbrunet@baylibre.com commit 457fa78771a23ecedf3bcd9ce9946a5183472ff6 Author: Jerome Brunet Date: Thu May 7 00:16:55 2020 +0200 arm64: dts: meson: g12: add internal DAC add internal audio DAC support on the g12 and sm1 SoC family Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-7-jbrunet@baylibre.com commit 2989a2d6c7f36da2bddffdb293bdf123e735d5f7 Author: Jerome Brunet Date: Thu May 7 00:16:54 2020 +0200 arm64: dts: meson: libretech-pc: add internal DAC support Add the internal DAC support on the libretech CC. The output of this DAC is provided on the 9J4 connector. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-6-jbrunet@baylibre.com commit 451323f8bc9e9b701b87b4598ec1cac8eff82d15 Author: Jerome Brunet Date: Thu May 7 00:16:53 2020 +0200 arm64: dts: meson: libretech-ac: add internal DAC support Add the internal DAC support on the libretech CC. The output of this DAC is provided on the 9J5 connector. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-5-jbrunet@baylibre.com commit 249ce3777c25b383702e91a6547ffc676dc004a5 Author: Jerome Brunet Date: Thu May 7 00:16:52 2020 +0200 arm64: dts: meson: libretech-cc: add internal DAC support Add the internal DAC support on the libretech CC. The output of this DAC is provided on the 3.5mm jack connector. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-4-jbrunet@baylibre.com commit f3c35382259f67c2ae878de2142fb58b94df0525 Author: Jerome Brunet Date: Thu May 7 00:16:51 2020 +0200 arm64: dts: meson: p230-q200: add internal DAC support Add the necessary bits to support the internal audio DAC the p230/q200 reference design derivated boards. The output of this DAC is provided on the 3.5mm jack connector Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-3-jbrunet@baylibre.com commit a66d4ae3144a18476626dd8de8b8dff5f523daee Author: Jerome Brunet Date: Thu May 7 00:16:50 2020 +0200 arm64: dts: meson: gxl: add acodec support Add the internal audio DAC to the gxl SoC DT Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506221656.477379-2-jbrunet@baylibre.com commit 326e57518b0dc8789d78e59563afbb3f4107e6e1 Author: Dongjin Kim Date: Wed May 6 10:07:02 2020 +0200 arm64: dts: meson-sm1: add support for Hardkernel ODROID-C4 Add the board support for the Hardkernel Odroid-C4 single board computer. The Odroid-C4 is the Odroid-C2 successor with same form factor, but using a modern Amlogic S905X3 (SM1) SoC and 4x USB3 ports. Signed-off-by: Dongjin Kim Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200506080702.6645-3-narmstrong@baylibre.com commit 838f0905aaeefce443eca124b27e6474e6862aa3 Author: Neil Armstrong Date: Wed May 6 10:07:01 2020 +0200 dt-bindings: arm: amlogic: add odroid-c4 bindings Add the board bindings for the Hardkernel Odroid-C4 single board computer. Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200506080702.6645-2-narmstrong@baylibre.com commit c30dd9270197d060dae9e6d8f0b7f7864341cb2c Author: Neil Armstrong Date: Tue May 12 11:39:16 2020 +0200 arm64: dts: meson-sm1: add cpu thermal nodes Add thermal nodes for the Amlogic SM1 SoCs based on the G12A and G12B thermal nodes. Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200512093916.19676-3-narmstrong@baylibre.com commit fc9eab4b4276481ab1625d56bde57a87d73987bb Author: Neil Armstrong Date: Tue May 12 11:39:15 2020 +0200 arm64: dts: meson-g12b: move G12B thermal nodes to meson-g12b.dtsi The G12B thermal nodes should be in the meson-g12b.dtsi file. Fixes: 195f140318a9 ("arm64: dts: meson: g12b: add cooling properties") Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200512093916.19676-2-narmstrong@baylibre.com commit d8e8e66ea5339c855dd85c2c33c384344fa83431 Author: Jerome Brunet Date: Tue Apr 21 18:39:35 2020 +0200 arm64: dts: meson: libretech-pc: add initial audio playback support Add initial audio support limited to HDMI i2s. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Link: https://lore.kernel.org/r/20200421163935.775935-7-jbrunet@baylibre.com commit c755c7913ce7016bedd026a080d591a22e3096bc Author: Jerome Brunet Date: Tue Apr 21 18:39:34 2020 +0200 arm64: dts: meson: libretech-ac: add initial audio playback support Add initial audio support limited to HDMI i2s. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Link: https://lore.kernel.org/r/20200421163935.775935-6-jbrunet@baylibre.com commit a3ff86dcbbe811b6b6e8718c26db7ac389d3463b Author: Jerome Brunet Date: Tue Apr 21 18:39:33 2020 +0200 arm64: dts: meson: libretech-cc: add initial audio playback support Add initial audio support limited to HDMI i2s. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Link: https://lore.kernel.org/r/20200421163935.775935-5-jbrunet@baylibre.com commit 3ffeb9532d42c0cf9d91ec60259177e04c7062aa Author: Jerome Brunet Date: Tue Apr 21 18:39:32 2020 +0200 arm64: dts: meson: p230-q200: add initial audio playback support Add basic audio support on the p230/q200 reference design. This initial support is limited to HDMI i2s and SPDIF (LPCM). Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Link: https://lore.kernel.org/r/20200421163935.775935-4-jbrunet@baylibre.com commit 4cc1b2659dd2f33a3b4999fc002e72cc801724b6 Author: Jerome Brunet Date: Tue Apr 21 18:39:31 2020 +0200 arm64: dts: meson-gx: add aiu support Add the AIU audio device to the Amlogic GX SoC family DT. ATM, this device provides the i2s and spdif output stages and also the hdmi and internal codec glues. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Link: https://lore.kernel.org/r/20200421163935.775935-3-jbrunet@baylibre.com commit 25c14afeea936b7bcbec0731e0a6e639bd1555c9 Merge: f31505089497 3a5fc2520bc6 Author: Kevin Hilman Date: Tue May 19 16:31:43 2020 -0700 Merge branch 'reset/meson-gxl-dac' of git://git.pengutronix.de/pza/linux into HEAD * 'reset/meson-gxl-dac' of git://git.pengutronix.de/pza/linux: dt-bindings: reset: meson: add gxl internal dac reset commit 005231128e9e97461e81fa32421957a7664317ca Author: Martin Blumenstingl Date: Tue May 12 23:51:48 2020 +0200 ARM: dts: meson: Switch existing boards with RGMII PHY to "rgmii-id" Let the PHY generate the RX and TX delay on the Odroid-C1 and MXIII Plus. Previously we did not know that these boards used an RX delay. We assumed that setting the TX delay on the MAC side It turns out that these boards also require an RX delay of 2ns (verified on Odroid-C1, but the u-boot code uses the same setup on both boards). Ethernet only worked because u-boot added this RX delay on the MAC side. The 4ns TX delay was also wrong and the result of using an unsupported RGMII TX clock divider setting. This has been fixed in the driver with commit bd6f48546b9cb7 ("net: stmmac: dwmac-meson8b: Fix the RGMII TX delay on Meson8b/8m2 SoCs"). Switch to phy-mode "rgmii-id" to let the PHY side handle all the delays, (as recommended by the Ethernet maintainers anyways) to correctly describe the need for a 2ns RX as well as 2ns TX delay on these boards. This fixes the Ethernet performance on Odroid-C1 where there was a huge amount of packet loss when transmitting data due to the incorrect TX delay. Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200512215148.540322-3-martin.blumenstingl@googlemail.com commit b632506c5af22a9a7c63674fc605d24cf94d585b Author: Martin Blumenstingl Date: Tue May 12 23:51:47 2020 +0200 ARM: dts: meson: Add the Ethernet "timing-adjustment" clock Add the "timing-adjusment" clock now that we now that this is connected to the PRG_ETHERNET registers. It is used internally to generate the RGMII RX delay no the MAC side (if needed). Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200512215148.540322-2-martin.blumenstingl@googlemail.com commit f5a7382d6f176e29e4fd9d733b93d5b93771a7e4 Author: Martin Blumenstingl Date: Fri May 15 22:25:20 2020 +0200 ARM: dts: meson8m2: Use the Meson8m2 specific USB2 PHY compatible Use the Meson8m2 specific USB2 PHY compatible string. The 3.10 vendor kernel has at least one known difference between Meson8 and Meson8m2: Meson8m2 sets the ACA_ENABLE bit while Meson8 doesn't. Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200515202520.1487514-1-martin.blumenstingl@googlemail.com commit 9530dcf1082da23438ee557291c07d475128f63a Author: Martin Blumenstingl Date: Mon May 4 21:51:05 2020 +0200 ARM: dts: meson: add the gadget mode properties to the USB0 controller Testing with a USB RNDIS connection and iperf3 gives the following results: - From the host computer to the device at ~250Mbit/s - From the device to the host computer at ~76Mbit/s Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200504195105.2909711-1-martin.blumenstingl@googlemail.com commit 53773f2dfd9c847304b184d5617e36aeafdf5d87 Author: Martin Blumenstingl Date: Fri May 15 22:47:09 2020 +0200 soc: amlogic: meson-ee-pwrc: add support for the Meson GX SoCs Add support for the Meson GX SoCs to the meson-ee-pwrc driver. The power domains on the GX SoCs are very similar to G12A. The only known differences so far are: - The GX SoCs do not have the HHI_VPU_MEM_PD_REG2 register (for the VPU power-domain) - The GX SoCs have an additional reset line called "dvin" Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20200515204709.1505498-5-martin.blumenstingl@googlemail.com commit 34217df28db7cddb52120da57fd1d469e896af3d Author: Martin Blumenstingl Date: Fri May 15 22:47:08 2020 +0200 soc: amlogic: meson-ee-pwrc: add support for Meson8/Meson8b/Meson8m2 This adds support for the power domains on Meson8/Meson8b/Meson8m2. Meson8 doesn't use any reset lines while Meson8b and Meson8m2 use the same set of reset lines (which is different from the newer SoCs). Add dedicated compatible strings for Meson8, Meson8b and Meson8m2 to support these differences. Notable differences between Meson8 and G12A are: - there is no HHI_VPU_MEM_PD_REG2 on the 32-bit SoCs - the Meson8b datasheet describes an "audio DSP memory" power domain which is used for the hardware audio decoder - the "amlogic,ao-sysctrl" only includes the power management related registers on the 32-bit SoCs, meaning the for example the AO_RTI_GEN_PWR_SLEEP0 register is at offset (0x2 << 2) rather than (0x3a << 2). As result of this (0x38 << 2) is subtracted from the register offsets, which is the start of the power management related registers. Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200515204709.1505498-4-martin.blumenstingl@googlemail.com commit cc9ca02a40e549402eebdf151a8f0ca5027e0f7c Author: Martin Blumenstingl Date: Fri May 15 22:47:07 2020 +0200 dt-bindings: power: meson-ee-pwrc: add support for the Meson GX SoCs The power domains on the GX SoCs are very similar to G12A. The only known differences so far are: - The GX SoCs do not have the HHI_VPU_MEM_PD_REG2 register (for the VPU power-domain) - The GX SoCs have an additional reset line called "dvin" Add a new compatible string and adjust the reset line expectations for these SoCs. Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200515204709.1505498-3-martin.blumenstingl@googlemail.com commit 18dfc0bf8167fb0dc729da4a6a816e34d754318b Author: Martin Blumenstingl Date: Fri May 15 22:47:06 2020 +0200 dt-bindings: power: meson-ee-pwrc: add support for Meson8/8b/8m2 The power domains on the 32-bit Meson8/Meson8b/Meson8m2 SoCs are very similar to what G12A still uses. The (known) differences are: - Meson8 doesn't use any reset lines at all - Meson8b and Meson8m2 use the same reset lines, which are different from what the 64-bit SoCs use - there is no "vapb" clock on the older SoCs - amlogic,ao-sysctrl cannot point to the whole AO sysctrl region but only the power management related registers Add a new compatible string and adjust clock and reset line expectations for each SoC. Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200515204709.1505498-2-martin.blumenstingl@googlemail.com commit e5264212eb622fbc5704571c8e490c2b5fc718b9 Author: Sasha Neftin Date: Sun Apr 12 17:21:58 2020 +0300 igc: Remove unused registers Tx data FIFO Head/Tail, Saved and Packet Count registers not applicable for i225 LAN controller. This patch comes to clean up these registers. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 551555a7614abda5db60221c012d6c19a7a2d016 Author: Sasha Neftin Date: Sun Apr 12 09:28:29 2020 +0300 igc: Remove unused IGC_ICS_DRSTA define Device reset assert for interrupt cause register not in use for i225 device. This patch comes to clean up this define. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 81e330619e45fac4abeb01be1eb88f18c53aad46 Author: Andre Guedes Date: Tue Apr 7 14:07:11 2020 -0700 igc: Dump ETQF registers This patch adds the EType Queue Filter (ETQF) registers to the list of registers dumped by igc_get_regs(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit aa7ca7266fc49966844ac1f868085a49092b9b5d Author: Andre Guedes Date: Tue Apr 7 14:07:10 2020 -0700 igc: Refactor ethertype filtering code The whole ethertype filtering code is implemented in igc_ethtool.c and mixes logic from ethtool and core parts. This patch refactors it so core logic is moved to igc_main.c, aligning the ethertype filtering code organization with the rest of the filtering code from the driver (MAC address and VLAN priority). Besides moving code to igc_main.c, this patch also does some minor improvements to the code. Below are some highlights. In case all filters are already in use and the user tries to add another filter, we return -ENOSPC instead of -EINVAL so a more meaningful error code is provided. This also aligns with the behavior implemented in MAC address filtering code. With this code refactoring, 'etype_bitmap' array in struct igc_adapter and 'etype_reg_index' in struct igc_nfc_filter are not needed anymore and are removed. Log messages are added to help debugging the ethertype filtering code. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit a890761798169d817ad41340313dd3472ad3ea38 Merge: befb270f5076 8e3db0bbb29a Author: David S. Miller Date: Tue May 19 15:45:12 2020 -0700 Merge branch 'ndo_tunnel_ioctl' Christoph Hellwig says: ==================== add a new ->ndo_tunnel_ctl method to avoid a few set_fs calls v2 both the ipv4 and ipv6 code have an ioctl each that can be used to create a tunnel using code that doesn't live in the core kernel or ipv6 module. Currently they call ioctls on the tunnel devices to create these, for which the code needs to override the address limit, which is a "feature" I plan to get rid of. Instead this patchset adds a new ->ndo_tunnel_ctl that can be used for the tunnel configuration using struct ip_tunnel_parm. The method is either invoked from a helper that does the uaccess and can be wired up as ndo_do_ioctl method, or directly from the magic IPV4/6 ioctls that create tunnels with kernel space arguments. Changes since v2: - properly propagate errors in ipip6_tunnel_prl_ctl ==================== Signed-off-by: David S. Miller commit 8e3db0bbb29aa8d135341c5327bae738e93932a7 Author: Christoph Hellwig Date: Tue May 19 15:03:19 2020 +0200 ipv6: use ->ndo_tunnel_ctl in addrconf_set_dstaddr Use the new ->ndo_tunnel_ctl instead of overriding the address limit and using ->ndo_do_ioctl just to do a pointless user copy. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 68ad6886dd3fb7d0b336363a90ace55b22f0dcb9 Author: Christoph Hellwig Date: Tue May 19 15:03:18 2020 +0200 ipv6: streamline addrconf_set_dstaddr Factor out a addrconf_set_sit_dstaddr helper for the actual work if we found a SIT device, and only hold the rtnl lock around the device lookup and that new helper, as there is no point in holding it over a copy_from_user call. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit f098846044c9edb359bf2dae4bcf0d537dda22fe Author: Christoph Hellwig Date: Tue May 19 15:03:17 2020 +0200 ipv6: stub out even more of addrconf_set_dstaddr if SIT is disabled There is no point in copying the structure from userspace or looking up a device if SIT support is not disabled and we'll eventually return -ENODEV anyway. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit f60fe2df931d6c0b41c3d4f8ec3f7a429f977a3f Author: Christoph Hellwig Date: Tue May 19 15:03:16 2020 +0200 sit: impement ->ndo_tunnel_ctl Implement the ->ndo_tunnel_ctl method, and use ip_tunnel_ioctl to handle userspace requests for the SIOCGETTUNNEL, SIOCADDTUNNEL, SIOCCHGTUNNEL and SIOCDELTUNNEL ioctls. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit fd5d687b76b32543f6b2024ebe21f988ed1f8859 Author: Christoph Hellwig Date: Tue May 19 15:03:15 2020 +0200 sit: refactor ipip6_tunnel_ioctl Split the ioctl handler into one function per command instead of having a all the logic sit in one giant switch statement. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit c7e3670516042bfd8147151d9008b5874a6eb73e Author: Christoph Hellwig Date: Tue May 19 15:03:14 2020 +0200 impr: use ->ndo_tunnel_ctl in ipmr_new_tunnel Use the new ->ndo_tunnel_ctl instead of overriding the address limit and using ->ndo_do_ioctl just to do a pointless user copy. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 607259a695312cdfac2b52fb9d5b5890c834d573 Author: Christoph Hellwig Date: Tue May 19 15:03:13 2020 +0200 net: add a new ndo_tunnel_ioctl method This method is used to properly allow kernel callers of the IPv4 route management ioctls. The exsting ip_tunnel_ioctl helper is renamed to ip_tunnel_ctl to better reflect that it doesn't directly implement ioctls touching user memory, and is used for the guts of ndo_tunnel_ctl implementations. A new ip_tunnel_ioctl helper is added that can be wired up directly to the ndo_do_ioctl method and takes care of the copy to and from userspace. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit c1fd1182c43692022a7938d6b496fa21fcd49717 Author: Christoph Hellwig Date: Tue May 19 15:03:12 2020 +0200 ipv4: consolidate the VIFF_TUNNEL handling in ipmr_new_tunnel Also move the dev_set_allmulti call and the error handling into the ioctl helper. This allows reusing already looked up tunnel_dev pointer and the set up argument structure for the deletion in the error handler. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit c384b8a70c59d85f83a05c8963e71d35da2607b9 Author: Christoph Hellwig Date: Tue May 19 15:03:11 2020 +0200 ipv4: streamline ipmr_new_tunnel Reduce a few level of indentation to simplify the function. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit b4d48d96eaec9bff4139dcbeb9590869fc765aa9 Author: Andre Guedes Date: Tue Apr 7 14:07:09 2020 -0700 igc: Fix MAX_ETYPE_FILTER value The I225 controller has 8 ethertype filters, not 4. This patch fixes the MAX_ETYPE_FILTER macro accordingly. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 1664ef3e62271dede7d51056b9ba36697b57d714 Author: Andre Guedes Date: Tue Apr 7 14:07:08 2020 -0700 igc: Remove ethertype filter in PTP code The driver only supports hardware timestamping for all incoming traffic (HWTSTAMP_FILTER_ALL) which is enabled via Rx Time Sync Control (TSYNCRXCTL) register already. Therefore, the ethertype filter set in in igc_ptp_set_timestamp_mode() is useless so this patch removes it. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 09a2b50a49798611df55f85b0428278d58b089ad Author: Andre Guedes Date: Tue Apr 7 14:07:07 2020 -0700 igc: Remove duplicated IGC_RXPBS macro This patch remove the IGC_RXPBS macro defined in line 233 since it is already defined in line 18 with the exactly same value. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit befb270f50763816d5bd027df35a9a416158a2b9 Merge: f8e48fca49cc a1eae9f677a6 Author: David S. Miller Date: Tue May 19 15:32:24 2020 -0700 Merge branch 'realtek-ethernet-use-generic-power-management' Vaibhav Gupta says: ==================== realtek ethernet : use generic power management. The purpose of this patch series is to remove legacy power management callbacks from realtek ethernet drivers. The callbacks performing suspend() and resume() operations are still calling pci_save_state(), pci_set_power_state(), etc. and handling the powermanagement themselves, which is not recommended. The conversion requires the removal of the those function calls and change the callback definition accordingly. All Changes are compile-tested only. ==================== Signed-off-by: David S. Miller commit a1eae9f677a694c97c232f8c1b3b826ec68a0c11 Author: Vaibhav Gupta Date: Mon May 18 20:32:14 2020 +0530 realtek/8139cp: use generic power management compile-tested only With legacy PM hooks, it was the responsibility of a driver to manage PCI states and also device's power state. The generic approach is to let PCI core handle the work. The suspend callback enables/disables PCI wake on the basis of "cp->wol_enabled" variable which is unknown to PCI core. To utilise its need, call device_set_wakeup_enable(). Signed-off-by: Vaibhav Gupta Signed-off-by: David S. Miller commit 6ad70c7686d4ad14cbea4f9930037cabea0cdb7a Author: Vaibhav Gupta Date: Mon May 18 20:32:13 2020 +0530 realtek/8139too: use generic power management compile-tested only With legacy PM hooks, it was the responsibility of a driver to manage PCI states and also device's power state. The generic approach is to let PCI core handle the work. PCI core passes "struct device*" as an argument to the .suspend() and .resume() callbacks. As these callabcks work with "struct net_device*", extract it from "struct device*" using dev_get_drv_data(). Signed-off-by: Vaibhav Gupta Signed-off-by: David S. Miller commit 12ddee68d058792602d017ea940a69fe6969edbe Author: Andre Guedes Date: Thu Apr 23 18:11:19 2020 -0700 igc: Refactor VLAN priority filtering code The whole VLAN priority filtering code is implemented in igc_ethtool.c and mixes logic from ethtool and core parts. This patch refactors it so core logic is moved to igc_main.c, aligning the VLAN priority filtering code organization with the MAC address filtering code. This patch also takes the opportunity to add some log messages to ease debugging. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit f8e48fca49cc52626e904d46f86680cb90ad5f48 Merge: 85bac6a52fb8 465957c257f3 Author: David S. Miller Date: Tue May 19 15:27:22 2020 -0700 Merge branch 'nfp-flower-feature-bit-updates' Simon Horman says: ==================== nfp: flower: feature bit updates this short series has two parts. * The first patch cleans up the treatment of existing feature bits. There are two distinct methods used and the code now reflects this more clearly. * The second patch informs firmware of flower features. This allows the firmware to disable certain features in the absence of of host support. Changes since v1 - Add now-first patch to clean up existing implementation - Address Jakub's feedback ==================== Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 465957c257f3083785fe8e954724cfac2e5d33e9 Author: Louis Peens Date: Tue May 19 16:15:02 2020 +0200 nfp: flower: inform firmware of flower features For backwards compatibility it may be required for the firmware to disable certain features depending on the features supported by the host. Combine the host feature bits and firmware feature bits and write this back to the firmware. Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit e09303d3c4d9d9f71657550d61eb00bc84c13859 Author: Louis Peens Date: Tue May 19 16:15:01 2020 +0200 nfp: flower: renaming of feature bits Clean up name aliasing. Some features gets enabled using a slightly different method, but the bitmap for these were stored in the same field. Rename their #defines and move the bitmap to a new variable. Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 2e4f1716f31f3486fa454fd3174f3de982b1dcaa Author: Andre Guedes Date: Fri Apr 3 11:17:42 2020 -0700 igc: Return -EOPNOTSUPP when VLAN mask doesn't match The I225 controller supports Rx queue assignment based on VLAN priority only. Other Tag Control Information (TCI) are valid, but not supported by the driver. So this patch changes the returning code from igc_add_ ethtool_nfc_entry() to -EOPNOTSUPP in order to provide more meaningful information on why the function failed. It also adds a debug messages to give the user a hint about what went wrong with the NFC setup. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit fbee4760ec4fc9f885ad0737f7b371cc6b73f573 Author: Andre Guedes Date: Fri Apr 3 11:17:41 2020 -0700 igc: Dump VLANPQF register This patch adds the VLAN Priority Queue Filter Register (VLANPQF) to the list of registers dumped by igc_get_regs(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit bbfaa141d211c86441f7e91454e0a306fb5296de Author: Andre Guedes Date: Fri Apr 3 11:17:40 2020 -0700 igc: Rename IGC_VLAPQF macro This patch renames the IGC_VLAPQF macro to IGC_VLANPQF as well as related macros so they match the register name and fields described in the data sheet. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit a5f304670b80973dfce5bc86cacff20244926cf6 Author: Veronika Kabatova Date: Tue May 19 22:00:45 2020 +0200 selftests: introduce gen_tar Makefile target The gen_kselftest_tar.sh always packages *all* selftests and doesn't pass along any variables to `make install` to influence what should be built. This can result in an early error on the command line ("Unknown tarball format TARGETS=XXX"), or unexpected test failures as the tarball contains tests people wanted to skip on purpose. Since the makefile already contains all the logic, we can add a target for packaging. Keep the default .gz target the script uses, and actually extend the supported formats by using tar's autodetection. To not break current workflows, keep the gen_kselftest_tar.sh script as it is, with an added suggestion to use the makefile target instead. Signed-off-by: Veronika Kabatova Reviewed-by: Stefano Brivio Signed-off-by: Shuah Khan commit 1032095053b34d474aa20f2625d97dd306e0991b Author: Qiuxu Zhuo Date: Fri May 15 20:34:06 2020 +0800 EDAC/skx: Use the mcmtr register to retrieve close_pg/bank_xor_enable The skx_edac driver wrongly uses the mtr register to retrieve two fields close_pg and bank_xor_enable. Fix it by using the correct mcmtr register to get the two fields. Cc: Signed-off-by: Qiuxu Zhuo Reported-by: Matthew Riley Acked-by: Aristeu Rozanski Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20200515210146.1337-1-tony.luck@intel.com commit 65b9ee1b928f2b679319c547c52986b8869855df Author: Sasha Neftin Date: Wed Apr 1 14:38:44 2020 +0300 igc: Clean up obsolete NVM defines Packet buffer allocation, reserved word and pointer guard not applicable for i225 parts. This patch comes to clean up these obsolete defines Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 3c215fb18e700344d96f3bde606b4492c70eaf56 Author: Vitaly Lifshits Date: Wed Apr 1 12:16:44 2020 +0300 igc: remove IGC_REMOVED function igc driver has leftovers from the previous device that supported Virtualization. This can be found in the function IGC_REMOVED which became obsolete, and can be removed. Signed-off-by: Vitaly Lifshits Acked-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 472abd3240918278d2da817e064e9b6c8fb4faf2 Author: Sasha Neftin Date: Wed Apr 1 11:43:20 2020 +0300 igc: Remove PCIe Control register GCR (PCIe Control) register not in use and should be removed This patch clean up this register Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit dda18a5c0b75461d1ed228f80b59c67434b8d601 Author: Andrii Nakryiko Date: Tue May 19 12:23:41 2020 -0700 selftests/bpf: Convert bpf_iter_test_kern{3, 4}.c to define own bpf_iter_meta b9f4c01f3e0b ("selftest/bpf: Make bpf_iter selftest compilable against old vmlinux.h") missed the fact that bpf_iter_test_kern{3,4}.c are not just including bpf_iter_test_kern_common.h and need similar bpf_iter_meta re-definition explicitly. Fixes: b9f4c01f3e0b ("selftest/bpf: Make bpf_iter selftest compilable against old vmlinux.h") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200519192341.134360-1-andriin@fb.com commit d81bb8726c247c3e7719d21bf213c5400de29e03 Author: Lubomir Rintel Date: Mon May 11 23:01:33 2020 +0200 ASoC: Add Marvell MMP SSPA binding Add binding documentation for the audio serial port interface (I2S) on Marvell MMP SoCs. Signed-off-by: Lubomir Rintel Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200511210134.1224532-11-lkundrak@v3.sk Signed-off-by: Mark Brown commit a97e384ba78fd8bf7ba8c32718424d8a7536416e Author: Lubomir Rintel Date: Mon May 11 23:01:34 2020 +0200 ASoC: mmp-sspa: Add Device Tree support This makes it possible to select CONFIG_SND_MMP_SOC_SSPA directly, as opposed to via CONFIG_SND_MMP_SOC, and for the driver to bind to a device tree node. That makes the driver useful on Device Tree based systems, with audio-graph-card or simple-card. The aforementioned card drivers control the master clock themselves and don't call the set_dai_sysclk() or set_dai_pll(), thus the respective handlers don't serve any purpose anymore. Instead, they return early and the hw_params() handler sets the appropriate bitclk itself. The register range is split into two -- for the RX block and for the TX block. On a MMP2 there are two pairs of them; the first one has the clock controller in the middle, while the second just has a hole: 0xd42a0c00 - 0xd42a0c30 RX1 0xd42a0c30 - 0xd42a0c40 Clocks 0xd42a0c80 - 0xd42a0cb0 TX1 0xd42a0d00 - 0xd42a0d30 RX2 0xd42a0d80 - 0xd42a0cb0 TX2 For this reason, mmp_sspa_write_reg() and mmp_sspa_read_reg() are replaced with direct calls to I/O routines. Tested on a MMP2-based OLPC XO-1.75 laptop with rt5631 coded, mmp_tdma DMA engine and MMP2 clock controller glued together with audio-graph-card. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-12-lkundrak@v3.sk Signed-off-by: Mark Brown commit 85bac6a52fb8aff6eb533cbb4a2d26c31af541b1 Merge: 2de499258659 e9a36ca5f6f3 Author: David S. Miller Date: Tue May 19 12:50:14 2020 -0700 Merge branch 'iucv-next' Julian Wiedmann says: ==================== net/iucv: updates 2020-05-19 please apply the following patch series for iucv to netdev's net-next tree. s390 dropped its support for power management, this removes the relevant iucv code. Also, some easy cleanups I found mouldering in an old branch. ==================== Signed-off-by: David S. Miller commit e9a36ca5f6f302675e7e36101ffa0ca7f9b8779b Author: Julian Wiedmann Date: Tue May 19 21:10:12 2020 +0200 net/af_iucv: clean up function prototypes Remove a bunch of forward declarations (trivially shifting code around where needed), and make a few functions static. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit dca1262f97499337489da7f5aa0bc6fec247a83f Author: Julian Wiedmann Date: Tue May 19 21:10:11 2020 +0200 net/af_iucv: remove a redundant zero initialization txmsg is declared as {0}, no need to clear individual fields later on. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 0d1c7664ed2044048d5ed790b943affa296bc3a4 Author: Julian Wiedmann Date: Tue May 19 21:10:10 2020 +0200 net/af_iucv: replace open-coded U16_MAX Improve the readability of a range check. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 585bc2209539501674b77de68f58e98039892501 Author: Julian Wiedmann Date: Tue May 19 21:10:09 2020 +0200 net/af_iucv: remove pm support commit 394216275c7d ("s390: remove broken hibernate / power management support") removed support for ARCH_HIBERNATION_POSSIBLE from s390. So drop the unused pm ops from the s390-only af_iucv socket code. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 4b32f86bf1673acb16441dd55d7b325609f54897 Author: Julian Wiedmann Date: Tue May 19 21:10:08 2020 +0200 net/iucv: remove pm support commit 394216275c7d ("s390: remove broken hibernate / power management support") removed support for ARCH_HIBERNATION_POSSIBLE from s390. So drop the unused pm ops from the s390-only iucv bus driver. CC: Hendrik Brueckner Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 2de499258659823b3c7207c5bda089c822b67d69 Merge: fa14b9b0c026 97ccf6f9ae69 Author: David S. Miller Date: Tue May 19 12:48:39 2020 -0700 Merge branch 's390-next' Julian Wiedmann says: ==================== s390/net: updates 2020-05-19 please apply the following patch series to netdev's net-next tree. s390 dropped its support for power management, this removes the relevant code from the s390 network drivers. ==================== Signed-off-by: David S. Miller commit 97ccf6f9ae6959ec473079977d9575f2b0ba7338 Author: Julian Wiedmann Date: Tue May 19 21:09:04 2020 +0200 s390/net: remove pm support from iucv drivers Commit 394216275c7d ("s390: remove broken hibernate / power management support") removed support for ARCH_HIBERNATION_POSSIBLE on s390. So drop the unused pm ops from the iucv drivers. CC: Hendrik Brueckner Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit fc4a4515acac072a69465d01ba45969323a9c50d Author: Julian Wiedmann Date: Tue May 19 21:09:03 2020 +0200 s390/net: remove pm ops from ccwgroup drivers commit 5e1fb45ec8e2 ("s390/ccwgroup: remove pm support") removed power management support from the ccwgroup bus driver. So remove the associated callbacks from all ccwgroup drivers. CC: Vineeth Vijayan Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit f07e2f6be37a750737b93f5635485171ad459eb9 Author: Ralph Campbell Date: Wed Apr 22 12:50:28 2020 -0700 MAINTAINERS: add HMM selftests Add files for HMM selftests. Link: https://lore.kernel.org/r/20200422195028.3684-4-rcampbell@nvidia.com Signed-off-by: Ralph Campbell Signed-off-by: Jason Gunthorpe commit fee9f6d1b8df35ce4ec14a49f27a7d9e4e06fd57 Author: Ralph Campbell Date: Wed Apr 22 12:50:27 2020 -0700 mm/hmm/test: add selftests for HMM Add some basic stand alone self tests for HMM. The test program and shell scripts use the test_hmm.ko driver to exercise HMM functionality in the kernel. Link: https://lore.kernel.org/r/20200422195028.3684-3-rcampbell@nvidia.com Signed-off-by: Ralph Campbell Signed-off-by: Jason Gunthorpe commit b2ef9f5a5cb37643ca5def3516c546457074b882 Author: Ralph Campbell Date: Wed Apr 22 12:50:26 2020 -0700 mm/hmm/test: add selftest driver for HMM This driver is for testing device private memory migration and devices which use hmm_range_fault() to access system memory via device page tables. Link: https://lore.kernel.org/r/20200422195028.3684-2-rcampbell@nvidia.com Link: https://lore.kernel.org/r/20200516010424.2013-1-rcampbell@nvidia.com Signed-off-by: Ralph Campbell Signed-off-by: Jérôme Glisse Link: https://lore.kernel.org/r/20200509030225.14592-1-weiyongjun1@huawei.com Link: https://lore.kernel.org/r/20200509030234.14747-1-weiyongjun1@huawei.com Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200511183704.GA225608@mwanda Signed-off-by: Dan Carpenter Signed-off-by: Jason Gunthorpe commit fa14b9b0c02624766bbc4c4be315169a0cfa4be9 Merge: 5cdfe8306631 5ddb2747ae2e Author: David S. Miller Date: Tue May 19 12:02:29 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-05-18 This series contains updates to igc driver only. Sasha adds ECN support for TSO by adding the NETIF_F_TSO_ECN flag, which aligns with other Intel drivers. Also cleaned up defines that are not supported or used in the igc driver. Andre does most of the changes with updating the log messages for igc driver. Vitaly adds support for EEPROM, register and link ethtool self-tests. v2: Fixed up the added ethtool self-tests based on feedback from the community. Dropped the four patches that removed '\n' from log messages. v3: Reverted the debug message changes in patch 2 for messages in igc_probe, also made reg_test[] static in patch 3 based on community feedback v4: Updated the patch description for patch 2, which referred to changes that no longer existed in the patch v5: Scrubbed patches 4-7 patch description, which also referred to changes that no longer existed in the patch ==================== Signed-off-by: David S. Miller commit df5f3b6f5357202b86ed96071d258a9b8659154d Author: Etienne Carriere Date: Tue May 12 15:13:34 2020 +0200 dt-bindings: nvmem: stm32: new property for data access Introduce boolean property st,non-secure-otp for OTP data located in a factory programmed area that only secure firmware can access by default and that shall be reachable from the non-secure world. This change also allows additional properties for NVMEM nodes that were forbidden prior this change. Signed-off-by: Etienne Carriere Signed-off-by: Rob Herring commit cf4bc4686c6f9508a719282dd08aba86aa072848 Author: Geert Uytterhoeven Date: Tue May 12 14:24:47 2020 +0200 dt-bindings: eeprom: at24: Fix list of page sizes for writing "258" is an odd power-of-two ;-) Obviously this is a typo, and the intended value is "256". Fixes: 7f3bf4203774013b ("dt-bindings: at24: convert the binding document to yaml") Signed-off-by: Geert Uytterhoeven Reviewed-by: Bartosz Golaszewski Reviewed-by: Wolfram Sang Signed-off-by: Rob Herring commit ce5955866d971864a6cd8d012411ec96b048a696 Author: Vijendar Mukunda Date: Tue May 19 22:34:22 2020 +0800 ASoC: amd: return error when acp de-init fails Return error when acp de-init fails during suspend. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20200519143422.18255-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 19cc20bd644f7baf279671c0647ef79c36f259a3 Author: Vijendar Mukunda Date: Tue May 19 22:34:21 2020 +0800 ASoC: amd: refactoring dai_hw_params() callback Removed api config_pdm_stream_params(). Modified switch case for channel check. Default case should return -EINVAL. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20200519143422.18255-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit fdae433e5129c4ca87716de08fdcc0034d5aabc8 Author: Vijendar Mukunda Date: Tue May 19 22:34:20 2020 +0800 ASoC: amd: fix kernel warning Removed unused variable from code to fix the kernel warning. Reported-by: kbuild test robot Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20200519143422.18255-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit b9f4c01f3e0b06579a8074dcc8638fae89a1ca67 Author: Andrii Nakryiko Date: Mon May 18 16:45:16 2020 -0700 selftest/bpf: Make bpf_iter selftest compilable against old vmlinux.h It's good to be able to compile bpf_iter selftest even on systems that don't have the very latest vmlinux.h, e.g., for libbpf tests against older kernels in Travis CI. To that extent, re-define bpf_iter_meta and corresponding bpf_iter context structs in each selftest. To avoid type clashes with vmlinux.h, rename vmlinux.h's definitions to get them out of the way. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20200518234516.3915052-1-andriin@fb.com commit fb53d3b63743585ce918094d6109a3865fa66e5f Author: Alexei Starovoitov Date: Tue May 19 11:39:53 2020 -0700 tools/bpf: sync bpf.h Sync tools/include/uapi/linux/bpf.h from include/uapi. Signed-off-by: Alexei Starovoitov commit 0e5633acc59573994d9aca02ad1b2f3a3de44181 Merge: d800bad67d4c 566fc3f5d1c6 Author: Alexei Starovoitov Date: Tue May 19 11:32:04 2020 -0700 Merge branch 'getpeername' Daniel Borkmann says: ==================== Trivial patch to add get{peer,sock}name cgroup attach types to the BPF sock_addr programs in order to enable rewriting sockaddr structs from both calls along with libbpf and bpftool support as well as selftests. Thanks! v1 -> v2: - use __u16 for ports in start_server_with_port() signature and in expected_{local,peer} ports in the test case (Andrey) - Added both Andrii's and Andrey's ACKs ==================== Signed-off-by: Alexei Starovoitov commit db78538c75e49c09b002a2cd96a19ae0c39be771 Author: Gustavo A. R. Silva Date: Thu May 7 13:58:04 2020 -0500 locking/lockdep: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200507185804.GA15036@embeddedor commit c50c75e9b87946499a62bffc021e95c87a1d57cd Author: Gustavo A. R. Silva Date: Mon May 11 15:12:27 2020 -0500 perf/core: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200511201227.GA14041@embeddedor commit 8ac7571a8cd3c11da24c3c3555f6e40e33049609 Author: Gustavo A. R. Silva Date: Mon May 11 15:09:11 2020 -0500 perf/x86: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200511200911.GA13149@embeddedor commit 0813c40556fce1eeefb996e020cc5339e0b84137 Author: Kan Liang Date: Fri May 1 05:54:42 2020 -0700 perf/x86/intel: Add more available bits for OFFCORE_RESPONSE of Intel Tremont The mask in the extra_regs for Intel Tremont need to be extended to allow more defined bits. "Outstanding Requests" (bit 63) is only available on MSR_OFFCORE_RSP0; Fixes: 6daeb8737f8a ("perf/x86/intel: Add Tremont core PMU support") Reported-by: Stephane Eranian Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200501125442.7030-1-kan.liang@linux.intel.com commit f649fc2eefdef7a67698a3c584222c5c8c5a6785 Author: Kan Liang Date: Thu May 7 06:14:18 2020 -0700 perf/x86/rapl: Add Ice Lake RAPL support Enable RAPL support for Intel Ice Lake X and Ice Lake D. For RAPL support, it is identical to Sky Lake X. Reported-by: Stephane Eranian Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1588857258-38213-1-git-send-email-kan.liang@linux.intel.com commit d505b8af58912ae1e1a211fabc9995b19bd40828 Author: Huaixin Chang Date: Sat Apr 25 18:52:48 2020 +0800 sched: Defend cfs and rt bandwidth quota against overflow When users write some huge number into cpu.cfs_quota_us or cpu.rt_runtime_us, overflow might happen during to_ratio() shifts of schedulable checks. to_ratio() could be altered to avoid unnecessary internal overflow, but min_cfs_quota_period is less than 1 << BW_SHIFT, so a cutoff would still be needed. Set a cap MAX_BW for cfs_quota_us and rt_runtime_us to prevent overflow. Signed-off-by: Huaixin Chang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Link: https://lkml.kernel.org/r/20200425105248.60093-1-changhuaixin@linux.alibaba.com commit dbe9337109c2705f08e6a00392f991eb2d2570a5 Author: Muchun Song Date: Mon Apr 20 15:04:53 2020 +0800 sched/cpuacct: Fix charge cpuacct.usage_sys The user_mode(task_pt_regs(tsk)) always return true for user thread, and false for kernel thread. So it means that the cpuacct.usage_sys is the time that kernel thread uses not the time that thread uses in the kernel mode. We can try get_irq_regs() first, if it is NULL, then we can fall back to task_pt_regs(). Signed-off-by: Muchun Song Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200420070453.76815-1-songmuchun@bytedance.com commit 04f5c362ec6d3ff0e14f1c05230b550da7f528a4 Author: Gustavo A. R. Silva Date: Thu May 7 14:21:41 2020 -0500 sched/fair: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200507192141.GA16183@embeddedor commit 95d685935a2edf209fc68f52494ede4a382a6c2b Author: Vincent Guittot Date: Wed May 6 17:53:01 2020 +0200 sched/pelt: Sync util/runnable_sum with PELT window when propagating update_tg_cfs_*() propagate the impact of the attach/detach of an entity down into the cfs_rq hierarchy and must keep the sync with the current pelt window. Even if we can't sync child cfs_rq and its group se, we can sync the group se and its parent cfs_rq with current position in the PELT window. In fact, we must keep them sync in order to stay also synced with others entities and group entities that are already attached to the cfs_rq. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200506155301.14288-1-vincent.guittot@linaro.org commit 12aa2587388de6697fd2e585ae6a90f70249540b Author: Muchun Song Date: Thu May 7 11:10:39 2020 +0800 sched/cpuacct: Use __this_cpu_add() instead of this_cpu_ptr() The cpuacct_charge() and cpuacct_account_field() are called with rq->lock held, and this means preemption(and IRQs) are indeed disabled, so it is safe to use __this_cpu_*() to allow for better code-generation. Signed-off-by: Muchun Song Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200507031039.32615-1-songmuchun@bytedance.com commit 7d148be69e3a0eaa9d029a3c51b545e322116a99 Author: Vincent Guittot Date: Wed May 13 15:55:02 2020 +0200 sched/fair: Optimize enqueue_task_fair() enqueue_task_fair jumps to enqueue_throttle label when cfs_rq_of(se) is throttled which means that se can't be NULL in such case and we can move the label after the if (!se) statement. Futhermore, the latter can be removed because se is always NULL when reaching this point. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Phil Auld Link: https://lkml.kernel.org/r/20200513135502.4672-1-vincent.guittot@linaro.org commit 9013196a467e770e1470cccee6c0fe435ef37c66 Merge: 2a0a24ebb499 39f23ce07b93 Author: Peter Zijlstra Date: Tue May 19 20:34:12 2020 +0200 Merge branch 'sched/urgent' commit 566fc3f5d1c641b510ec487cf274a047f8a1e849 Author: Daniel Borkmann Date: Tue May 19 00:45:48 2020 +0200 bpf, testing: Add get{peer, sock}name selftests to test_progs Extend the existing connect_force_port test to assert get{peer,sock}name programs as well. The workflow for e.g. IPv4 is as follows: i) server binds to concrete port, ii) client calls getsockname() on server fd which exposes 1.2.3.4:60000 to client, iii) client connects to service address 1.2.3.4:60000 binds to concrete local address (127.0.0.1:22222) and remaps service address to a concrete backend address (127.0.0.1:60123), iv) client then calls getsockname() on its own fd to verify local address (127.0.0.1:22222) and getpeername() on its own fd which then publishes service address (1.2.3.4:60000) instead of actual backend. Same workflow is done for IPv6 just with different address/port tuples. # ./test_progs -t connect_force_port #14 connect_force_port:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Andrey Ignatov Link: https://lore.kernel.org/bpf/3343da6ad08df81af715a95d61a84fb4a960f2bf.1589841594.git.daniel@iogearbox.net commit 05ee19c18c2bb3dea69e29219017367c4a77e65a Author: Daniel Borkmann Date: Tue May 19 00:45:47 2020 +0200 bpf, bpftool: Enable get{peer, sock}name attach types Make bpftool aware and add the new get{peer,sock}name attach types to its cli, documentation and bash completion to allow attachment/detachment of sock_addr programs there. Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Andrey Ignatov Link: https://lore.kernel.org/bpf/9765b3d03e4c29210c4df56a9cc7e52f5f7bb5ef.1589841594.git.daniel@iogearbox.net commit f15ed0185de7d471e907783739dffbe397a93142 Author: Daniel Borkmann Date: Tue May 19 00:45:46 2020 +0200 bpf, libbpf: Enable get{peer, sock}name attach types Trivial patch to add the new get{peer,sock}name attach types to the section definitions in order to hook them up to sock_addr cgroup program type. Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Andrey Ignatov Link: https://lore.kernel.org/bpf/7fcd4b1e41a8ebb364754a5975c75a7795051bd2.1589841594.git.daniel@iogearbox.net commit 1b66d253610c7f8f257103808a9460223a087469 Author: Daniel Borkmann Date: Tue May 19 00:45:45 2020 +0200 bpf: Add get{peer, sock}name attach types for sock_addr As stated in 983695fa6765 ("bpf: fix unconnected udp hooks"), the objective for the existing cgroup connect/sendmsg/recvmsg/bind BPF hooks is to be transparent to applications. In Cilium we make use of these hooks [0] in order to enable E-W load balancing for existing Kubernetes service types for all Cilium managed nodes in the cluster. Those backends can be local or remote. The main advantage of this approach is that it operates as close as possible to the socket, and therefore allows to avoid packet-based NAT given in connect/sendmsg/recvmsg hooks we only need to xlate sock addresses. This also allows to expose NodePort services on loopback addresses in the host namespace, for example. As another advantage, this also efficiently blocks bind requests for applications in the host namespace for exposed ports. However, one missing item is that we also need to perform reverse xlation for inet{,6}_getname() hooks such that we can return the service IP/port tuple back to the application instead of the remote peer address. The vast majority of applications does not bother about getpeername(), but in a few occasions we've seen breakage when validating the peer's address since it returns unexpectedly the backend tuple instead of the service one. Therefore, this trivial patch allows to customise and adds a getpeername() as well as getsockname() BPF cgroup hook for both IPv4 and IPv6 in order to address this situation. Simple example: # ./cilium/cilium service list ID Frontend Service Type Backend 1 1.2.3.4:80 ClusterIP 1 => 10.0.0.10:80 Before; curl's verbose output example, no getpeername() reverse xlation: # curl --verbose 1.2.3.4 * Rebuilt URL to: 1.2.3.4/ * Trying 1.2.3.4... * TCP_NODELAY set * Connected to 1.2.3.4 (10.0.0.10) port 80 (#0) > GET / HTTP/1.1 > Host: 1.2.3.4 > User-Agent: curl/7.58.0 > Accept: */* [...] After; with getpeername() reverse xlation: # curl --verbose 1.2.3.4 * Rebuilt URL to: 1.2.3.4/ * Trying 1.2.3.4... * TCP_NODELAY set * Connected to 1.2.3.4 (1.2.3.4) port 80 (#0) > GET / HTTP/1.1 > Host: 1.2.3.4 > User-Agent: curl/7.58.0 > Accept: */* [...] Originally, I had both under a BPF_CGROUP_INET{4,6}_GETNAME type and exposed peer to the context similar as in inet{,6}_getname() fashion, but API-wise this is suboptimal as it always enforces programs having to test for ctx->peer which can easily be missed, hence BPF_CGROUP_INET{4,6}_GET{PEER,SOCK}NAME split. Similarly, the checked return code is on tnum_range(1, 1), but if a use case comes up in future, it can easily be changed to return an error code instead. Helper and ctx member access is the same as with connect/sendmsg/etc hooks. [0] https://github.com/cilium/cilium/blob/master/bpf/bpf_sock.c Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Andrey Ignatov Link: https://lore.kernel.org/bpf/61a479d759b2482ae3efb45546490bacd796a220.1589841594.git.daniel@iogearbox.net commit c8813f7ec01c676a8995c894ce49d40f5de62ed0 Author: chenqiwu Date: Mon May 11 23:04:57 2020 +0800 drivers/of: keep description of function consistent with function name Currently, there are some descriptions of function not consistent with function name, fixing them will make the code more readable. Signed-off-by: chenqiwu Signed-off-by: Rob Herring commit 98ece19f247159a51003796ede7112fef2df5d7f Author: Tero Kristo Date: Thu May 14 10:37:18 2020 +0300 soc: ti: omap-prm: use atomic iopoll instead of sleeping one The reset handling APIs for omap-prm can be invoked PM runtime which runs in atomic context. For this to work properly, switch to atomic iopoll version instead of the current which can sleep. Otherwise, this throws a "BUG: scheduling while atomic" warning. Issue is seen rather easily when CONFIG_PREEMPT is enabled. Signed-off-by: Tero Kristo Acked-by: Santosh Shilimkar Signed-off-by: Tony Lindgren commit 213081dadd308d5d41a5110c2dc87fd8ba42de5e Author: Srinivas Pandruvada Date: Mon May 11 16:57:31 2020 -0700 Documentation: admin-guide: pm: Document intel-speed-select Added documentation to configure servers to use Intel(R) Speed Select Technology using intel-speed-select tool. Signed-off-by: Srinivas Pandruvada Acked-by: Andriy Shevchenko Signed-off-by: Rafael J. Wysocki commit 8fcc4ae6faf8b455eeef00bc9ae70744e3b0f462 Author: James Morse Date: Fri May 1 17:45:43 2020 +0100 arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work APEI is unable to do all of its error handling work in nmi-context, so it defers non-fatal work onto the irq_work queue. arch_irq_work_raise() sends an IPI to the calling cpu, but this is not guaranteed to be taken before returning to user-space. Unless the exception interrupted a context with irqs-masked, irq_work_run() can run immediately. Otherwise return -EINPROGRESS to indicate ghes_notify_sea() found some work to do, but it hasn't finished yet. With this apei_claim_sea() returning '0' means this external-abort was also notification of a firmware-first RAS error, and that APEI has processed the CPER records. Signed-off-by: James Morse Tested-by: Tyler Baicar Acked-by: Catalin Marinas Signed-off-by: Rafael J. Wysocki commit 7f17b4a121d0d50eca22cb1edebf0a157f3e43bf Author: James Morse Date: Fri May 1 17:45:42 2020 +0100 ACPI: APEI: Kick the memory_failure() queue for synchronous errors memory_failure() offlines or repairs pages of memory that have been discovered to be corrupt. These may be detected by an external component, (e.g. the memory controller), and notified via an IRQ. In this case the work is queued as not all of memory_failure()s work can happen in IRQ context. If the error was detected as a result of user-space accessing a corrupt memory location the CPU may take an abort instead. On arm64 this is a 'synchronous external abort', and on a firmware first system it is replayed using NOTIFY_SEA. This notification has NMI like properties, (it can interrupt IRQ-masked code), so the memory_failure() work is queued. If we return to user-space before the queued memory_failure() work is processed, we will take the fault again. This loop may cause platform firmware to exceed some threshold and reboot when Linux could have recovered from this error. For NMIlike notifications keep track of whether memory_failure() work was queued, and make task_work pending to flush out the queue. To save memory allocations, the task_work is allocated as part of the ghes_estatus_node, and free()ing it back to the pool is deferred. Signed-off-by: James Morse Tested-by: Tyler Baicar Signed-off-by: Rafael J. Wysocki commit 062022315e8ad9e0628515dfc756ab54b5fdb26b Author: James Morse Date: Fri May 1 17:45:41 2020 +0100 mm/memory-failure: Add memory_failure_queue_kick() The GHES code calls memory_failure_queue() from IRQ context to schedule work on the current CPU so that memory_failure() can sleep. For synchronous memory errors the arch code needs to know any signals that memory_failure() will trigger are pending before it returns to user-space, possibly when exiting from the IRQ. Add a helper to kick the memory failure queue, to ensure the scheduled work has happened. This has to be called from process context, so may have been migrated from the original cpu. Pass the cpu the work was queued on. Change memory_failure_work_func() to permit being called on the 'wrong' cpu. Signed-off-by: James Morse Tested-by: Tyler Baicar Acked-by: Naoya Horiguchi Signed-off-by: Rafael J. Wysocki commit aa821c8dc0d76fa9f827becf1186bfd824f1fcfb Author: Hannes Reinecke Date: Mon May 11 10:24:26 2020 +0200 dm zoned: use dmz_zone_to_dev() when handling metadata I/O Use accessors to retrieve the device pointer in preparation for adding an additional block device. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit 52d6775888c65be66f3577ccd0f14b51691df7f9 Author: Hannes Reinecke Date: Mon May 11 10:24:25 2020 +0200 dm zoned: replace 'target' pointer in the bio context Replace the 'target' pointer in the bio context with the device pointer as this is what's actually used. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 6c805f77f161d65364cfc4e4734f7057a621fee4 Author: Hannes Reinecke Date: Mon May 11 10:24:24 2020 +0200 dm zoned: remove 'dev' argument from reclaim Use the dmz_zone_to_dev() mapping function to remove the 'dev' argument from reclaim. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit ef8385128d4b31a382d496b1c433697993bd0bfb Author: Christoph Hellwig Date: Mon May 18 10:29:27 2020 -0700 xfs: cleanup xfs_idestroy_fork Move freeing the dynamically allocated attr and COW fork, as well as zeroing the pointers where actually needed into the callers, and just pass the xfs_ifork structure to xfs_idestroy_fork. Also simplify the kmem_free calls by not checking for NULL first. Signed-off-by: Christoph Hellwig Reviewed-by: Chandan Babu R Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f7e67b20ecbbcb9180c888a5c4fde267935e075f Author: Christoph Hellwig Date: Mon May 18 10:28:05 2020 -0700 xfs: move the fork format fields into struct xfs_ifork Both the data and attr fork have a format that is stored in the legacy idinode. Move it into the xfs_ifork structure instead, where it uses up padding. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit daf83964a3681cf1f1f255ad6095c0b60cba7dca Author: Christoph Hellwig Date: Mon May 18 10:27:22 2020 -0700 xfs: move the per-fork nextents fields into struct xfs_ifork There are there are three extents counters per inode, one for each of the forks. Two are in the legacy icdinode and one is directly in struct xfs_inode. Switch to a single counter in the xfs_ifork structure where it uses up padding at the end of the structure. This simplifies various bits of code that just wants the number of extents counter and can now directly dereference it. Signed-off-by: Christoph Hellwig Reviewed-by: Chandan Babu R Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b2c20045b67bf37aa63be9bd9463708dfb38cbcc Author: Christoph Hellwig Date: Mon May 18 10:27:21 2020 -0700 xfs: remove xfs_ifree_local_data xfs_ifree only need to free inline data in the data fork, as we've already taken care of the attr fork before (and in fact freed the fork structure). Just open code the freeing of the inline data. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 09c38edd54c16657093a73a3169342f9f9080bb3 Author: Christoph Hellwig Date: Mon May 18 10:27:21 2020 -0700 xfs: remove the XFS_DFORK_Q macro Just checking di_forkoff directly is a little easier to follow. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 5fd68bdb5a87c929fff5f7bbd947034368f36f4f Author: Darrick J. Wong Date: Sat May 16 10:19:29 2020 -0700 xfs: clean up xchk_bmap_check_rmaps usage of XFS_IFORK_Q XFS_IFORK_Q is supposed to be a predicate, not a function returning a value. Its usage is in xchk_bmap_check_rmaps is incorrect, but that function only cares about whether or not the "size" of the data is zero or not. Convert that logic to use a proper boolean, and teach the caller to skip the call entirely if the end result would be that we'd do nothing anyway. This avoids a crash later in this series. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig [hch: generalized the NULL ifor check] Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster commit 4b516ff4e772993a99fc9bf36503d23ce5bd5ba9 Author: Christoph Hellwig Date: Thu May 14 14:06:41 2020 -0700 xfs: remove the NULL fork handling in xfs_bmapi_read Now that we fully verify the inode forks before they are added to the inode cache, the crash reported in https://bugzilla.kernel.org/show_bug.cgi?id=204031 can't happen anymore, as we'll never let an inode that has inconsistent nextents counts vs the presence of an in-core attr fork leak into the inactivate code path. So remove the work around to try to handle the case, and just return an error and warn if the fork is not present. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1a1c57b2826f8b408feb733d3321490591a6e4c9 Author: Christoph Hellwig Date: Thu May 14 14:06:40 2020 -0700 xfs: remove the special COW fork handling in xfs_bmapi_read We don't call xfs_bmapi_read for the COW fork anymore, so remove the special casing. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0f45a1b20cd8f9cfc985a1f91a1e7a86e5e14dd6 Author: Christoph Hellwig Date: Thu May 14 14:01:31 2020 -0700 xfs: improve local fork verification Call the data/attr local fork verifiers as soon as we are ready for them. This keeps them close to the code setting up the forks, and avoids a few branches later on. Also open code xfs_inode_verify_forks in the only remaining caller. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7c7ba2186305d6bee5eb5b8fb95a61d8de14de4f Author: Christoph Hellwig Date: Thu May 14 14:01:19 2020 -0700 xfs: refactor xfs_inode_verify_forks The split between xfs_inode_verify_forks and the two helpers implementing the actual functionality is a little strange. Reshuffle it so that xfs_inode_verify_forks verifies if the data and attr forks are actually in local format and only call the low-level helpers if that is the case. Handle the actual error reporting in the low-level handlers to streamline the caller. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1934c8bd81bee4c239478b03a59addf5fe8e2785 Author: Christoph Hellwig Date: Thu May 14 14:01:19 2020 -0700 xfs: remove xfs_ifork_ops xfs_ifork_ops add up to two indirect calls per inode read and flush, despite just having a single instance in the kernel. In xfsprogs phase6 in xfs_repair overrides the verify_dir method to deal with inodes that do not have a valid parent, but that can be fixed pretty easily by ensuring they always have a valid looking parent. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit bb8a66af4fff1cecb7631c68af761ea8e1a41ac2 Author: Christoph Hellwig Date: Thu May 14 14:01:19 2020 -0700 xfs: remove xfs_iread There is not much point in the xfs_iread function, as it has a single caller and not a whole lot of code. Move it into the only caller, and trim down the overdocumentation to just documenting the important "why" instead of a lot of redundant "what". Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7f0290123506e2b248fe06fa7cdc17c1b5b603b5 Author: Christoph Hellwig Date: Thu May 14 14:01:18 2020 -0700 xfs: don't reset i_delayed_blks in xfs_iread i_delayed_blks is set to 0 in xfs_inode_alloc and can't have anything assigned to it until the inode is visible to the VFS. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2d6051d4965308c3367bf5a2468dff969872a96e Author: Christoph Hellwig Date: Thu May 14 14:01:18 2020 -0700 xfs: call xfs_dinode_verify from xfs_inode_from_disk Keep the code dealing with the dinode together, and also ensure we verify the dinode in the owner change log recovery case as well. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0bce8173fdcf203c92a4d57dc7d3bb642ed478a1 Author: Christoph Hellwig Date: Thu May 14 14:01:17 2020 -0700 xfs: handle unallocated inodes in xfs_inode_from_disk Handle inodes with a 0 di_mode in xfs_inode_from_disk, instead of partially duplicating inode reading in xfs_iread. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9229d18e801bdbdf79d963d8c944980fc77b5d6b Author: Christoph Hellwig Date: Thu May 14 14:01:17 2020 -0700 xfs: split xfs_iformat_fork xfs_iformat_fork is a weird catchall. Split it into one helper for the data fork and one for the attr fork, and then call both helper as well as the COW fork initialization from xfs_inode_from_disk. Order the COW fork initialization after the attr fork initialization given that it can't fail to simplify the error handling. Note that the newly split helpers are moved down the file in xfs_inode_fork.c to avoid the need for forward declarations. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit cb7d58594412fff106cde550dd9e0a7999cc2a0c Author: Christoph Hellwig Date: Thu May 14 14:00:02 2020 -0700 xfs: call xfs_iformat_fork from xfs_inode_from_disk We always need to fill out the fork structures when reading the inode, so call xfs_iformat_fork from the tail of xfs_inode_from_disk. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b90c2a9c8b4422bb9398b50fe3d6163e46dcddec Author: Christoph Hellwig Date: Thu May 14 13:59:51 2020 -0700 xfs: xfs_bmapi_read doesn't take a fork id as the last argument The last argument to xfs_bmapi_raad contains XFS_BMAPI_* flags, not the fork. Given that XFS_DATA_FORK evaluates to 0 no real harm is done, but let's fix this anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 14506f7a91d8f4d13fc07126ac8d14c6519f00e3 Author: Kaixu Xia Date: Mon May 11 08:32:19 2020 -0700 xfs: fix the warning message in xfs_validate_sb_common() Fix this error message to complain about project and group quota flag bits instead of "PUOTA" and "QUOTA". Signed-off-by: Kaixu Xia Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 765d3c393c222c3bb281885ea211c8ebc08250b4 Author: Darrick J. Wong Date: Tue May 12 16:42:51 2020 -0700 xfs: don't allow SWAPEXT if we'd screw up quota accounting Since the old SWAPEXT ioctl doesn't know how to adjust quota ids, bail out of the ids don't match and quotas are enabled. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Christoph Hellwig commit 78bba5c812cc651cee51b64b786be926ab7fe2a9 Author: Darrick J. Wong Date: Wed May 13 15:33:27 2020 -0700 xfs: use ordered buffers to initialize dquot buffers during quotacheck While QAing the new xfs_repair quotacheck code, I uncovered a quota corruption bug resulting from a bad interaction between dquot buffer initialization and quotacheck. The bug can be reproduced with the following sequence: # mkfs.xfs -f /dev/sdf # mount /dev/sdf /opt -o usrquota # su nobody -s /bin/bash -c 'touch /opt/barf' # sync # xfs_quota -x -c 'report -ahi' /opt User quota on /opt (/dev/sdf) Inodes User ID Used Soft Hard Warn/Grace ---------- --------------------------------- root 3 0 0 00 [------] nobody 1 0 0 00 [------] # xfs_io -x -c 'shutdown' /opt # umount /opt # mount /dev/sdf /opt -o usrquota # touch /opt/man2 # xfs_quota -x -c 'report -ahi' /opt User quota on /opt (/dev/sdf) Inodes User ID Used Soft Hard Warn/Grace ---------- --------------------------------- root 1 0 0 00 [------] nobody 1 0 0 00 [------] # umount /opt Notice how the initial quotacheck set the root dquot icount to 3 (rootino, rbmino, rsumino), but after shutdown -> remount -> recovery, xfs_quota reports that the root dquot has only 1 icount. We haven't deleted anything from the filesystem, which means that quota is now under-counting. This behavior is not limited to icount or the root dquot, but this is the shortest reproducer. I traced the cause of this discrepancy to the way that we handle ondisk dquot updates during quotacheck vs. regular fs activity. Normally, when we allocate a disk block for a dquot, we log the buffer as a regular (dquot) buffer. Subsequent updates to the dquots backed by that block are done via separate dquot log item updates, which means that they depend on the logged buffer update being written to disk before the dquot items. Because individual dquots have their own LSN fields, that initial dquot buffer must always be recovered. However, the story changes for quotacheck, which can cause dquot block allocations but persists the final dquot counter values via a delwri list. Because recovery doesn't gate dquot buffer replay on an LSN, this means that the initial dquot buffer can be replayed over the (newer) contents that were delwritten at the end of quotacheck. In effect, this re-initializes the dquot counters after they've been updated. If the log does not contain any other dquot items to recover, the obsolete dquot contents will not be corrected by log recovery. Because quotacheck uses a transaction to log the setting of the CHKD flags in the superblock, we skip quotacheck during the second mount call, which allows the incorrect icount to remain. Fix this by changing the ondisk dquot initialization function to use ordered buffers to write out fresh dquot blocks if it detects that we're running quotacheck. If the system goes down before quotacheck can complete, the CHKD flags will not be set in the superblock and the next mount will run quotacheck again, which can fix uninitialized dquot buffers. This requires amending the defer code to maintaine ordered buffer state across defer rolls for the sake of the dquot allocation code. For regular operations we preserve the current behavior since the dquot items require properly initialized ondisk dquot records. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 1a5428119bc36b0a882e87fe2620c769ba655763 Author: Tony Lindgren Date: Thu May 7 09:43:08 2020 -0700 bus: ti-sysc: Timers no longer need legacy quirk handling As timers no longer need legacy quirk handling, let's move them to the CONFIG_DEBUG section to make it easier to see which drivers still need more work. Let's also add detection for few more older timer revisions while at it as that makes CONFIG_DEBUG output easier to read with proper names. Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 2ee04b88547ab4c46aa2a258efd0f91fc705b6d6 Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter With dmtimer and 32k counter being initialized based on devicetree data, we can just drop the old timer code. This still leaves the omap5 and dra7 realtime_counter_init() that depend on the smc calls and control module platform code for the dra7 quirk init. Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 64dbc3d55d60fd115e058e9f1689542daa37356c Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for omap2 We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Let's also update the dts file to use #include while at it. Cc: devicetree@vger.kernel.org Cc: Aaro Koskinen Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 83bd18b46600a37d977e811dca1334e09a6e03eb Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for ti81xx We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Note that for ti81xx, also timer1 is of type 2 unlike on am335x where timer1 is type1 while the rest of the timers are type 2. Cc: devicetree@vger.kernel.org Cc: Brian Hutchinson Cc: Graeme Smecher Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit e428e250fde683ad3a658f8476f0914714e7eb6f Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for omap3 We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Let's also update the dts file to use #include while at it. Cc: devicetree@vger.kernel.org Cc: Adam Ford Cc: Andreas Kemnade Cc: Grygorii Strashko Cc: "H. Nikolaus Schaller" Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 036a3d42bb8f28ae3cdd7c9570135c243724fbd6 Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for omap5 and dra7 We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Note that similar to omap_init_time_of(), we now need to call omap_clk_init() also from omap5_realtime_timer_init(). Cc: devicetree@vger.kernel.org Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 14b1925a721992d781f5e9d28db26b85174e3927 Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for omap4 We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Cc: devicetree@vger.kernel.org Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 545a95582e80a2c66527dbf7f0ae495902fc083a Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for am437x We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Cc: devicetree@vger.kernel.org Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit e20ef23dd6937c38df2cfddf15270668153c8177 Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: dts: Configure system timers for am335x We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Cc: devicetree@vger.kernel.org Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit e69b4e1a7577c169e9f52edf977401734a6a29eb Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 ARM: OMAP2+: Add omap_init_time_of() This allows us to move the SoCs to probe system timers one SoC at at time. As arch/arm/mach-omap2/timer.c will be eventually gone, let's just add omap_init_time_of() to board-generic.c directly. Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 4bba9bf08ff41d78b91581937d97664638bd6bb8 Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 bus: ti-sysc: Ignore timer12 on secure omap3 Some early omap3 boards use timer12 for system timer, but for secure SoCs like on n900 it's not accessible. Likely we will be configuring unavailable devices for other SoCs too based on runtime SoC detection, so let's use a switch to start with. Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 16aed29d7c01a261b6061da43b5c83908b356688 Author: Tony Lindgren Date: Thu May 7 09:59:31 2020 -0700 clk: ti: dm816: enable sysclk6_ck on init We need sysclk6_ck enabled early as it is needed by l4_ls and system timers early on boot. This removes the dependency of system timers to the interconnect related code that can be then probed later on when suitable at module_init time. Cc: linux-clk@vger.kernel.org Cc: Grygorii Strashko Cc: Michael Turquette Cc: Rob Herring Cc: Stephen Boyd Cc: Tero Kristo Acked-by: Stephen Boyd Signed-off-by: Tony Lindgren commit e3b1078bedd323df343894a27eb3b3c34944dfd1 Author: Eric Biggers Date: Fri May 15 13:41:41 2020 -0700 fscrypt: add support for IV_INO_LBLK_32 policies The eMMC inline crypto standard will only specify 32 DUN bits (a.k.a. IV bits), unlike UFS's 64. IV_INO_LBLK_64 is therefore not applicable, but an encryption format which uses one key per policy and permits the moving of encrypted file contents (as f2fs's garbage collector requires) is still desirable. To support such hardware, add a new encryption format IV_INO_LBLK_32 that makes the best use of the 32 bits: the IV is set to 'SipHash-2-4(inode_number) + file_logical_block_number mod 2^32', where the SipHash key is derived from the fscrypt master key. We hash only the inode number and not also the block number, because we need to maintain contiguity of DUNs to merge bios. Unlike with IV_INO_LBLK_64, with this format IV reuse is possible; this is unavoidable given the size of the DUN. This means this format should only be used where the requirements of the first paragraph apply. However, the hash spreads out the IVs in the whole usable range, and the use of a keyed hash makes it difficult for an attacker to determine which files use which IVs. Besides the above differences, this flag works like IV_INO_LBLK_64 in that on ext4 it is only allowed if the stable_inodes feature has been enabled to prevent inode numbers and the filesystem UUID from changing. Link: https://lore.kernel.org/r/20200515204141.251098-1-ebiggers@kernel.org Reviewed-by: Theodore Ts'o Reviewed-by: Paul Crowley Signed-off-by: Eric Biggers commit 6d15120b282e49811a47f2f6d6b749d178be7e99 Author: Tony Lindgren Date: Tue May 19 08:51:57 2020 -0700 clocksource/drivers/timer-ti-dm: Fix warning for set but not used We can get a warning for dmtimer_clocksource_init() with 'pa' set but not used. This was used in the earlier revisions of the code but no longer needed, so let's remove the unused pa and of_translate_address(). Let's also do it for dmtimer_clockevent_init() that has a similar issue. Reported-by: kbuild test robot Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200519155157.12804-1-tony@atomide.com commit d0f9ca9be11f25ef4151195eab7ea36d136084f6 Author: Ard Biesheuvel Date: Mon Apr 13 18:21:35 2020 +0200 ARM: decompressor: run decompressor in place if loaded via UEFI The decompressor can load from anywhere in memory, and the only reason the EFI stub code relocates it is to ensure it appears within the first 128 MiB of memory, so that the uncompressed kernel ends up at the right offset in memory. We can short circuit this, and simply jump into the decompressor startup code at the point where it knows where the base of memory lives. This also means there is no need to disable the MMU and caches, create new page tables and re-enable them. Signed-off-by: Ard Biesheuvel Reviewed-by: Nicolas Pitre commit 35d57d1215ed0da3349180275b845f0c2ee62d08 Author: Ard Biesheuvel Date: Mon Apr 13 18:21:34 2020 +0200 ARM: decompressor: move GOT into .data for EFI enabled builds We will be running the decompressor in place after a future patch, instead of copying it around first. This means we no longer have to disable and re-enable the MMU and caches either. However, this means we will be loaded with the restricted permissions set by the UEFI firmware, which means that we have to move the GOT table into the data section in order for the contents to be writable by the code itself. Signed-off-by: Ard Biesheuvel Reviewed-by: Nicolas Pitre commit f1f012b033e6651cd5c5b43d1722976cf6baf973 Author: Ard Biesheuvel Date: Mon Apr 13 18:21:33 2020 +0200 ARM: decompressor: defer loading of the contents of the LC0 structure The remaining contents of LC0 are only used after the point in the decompressor startup code where we enter via 'wont_overwrite'. So move the loading of the LC0 structure after it. This will allow us to jump to wont_overwrite directly from the EFI stub, and execute the decompressor in place at the offset it was loaded by the UEFI firmware. Signed-off-by: Ard Biesheuvel Reviewed-by: Geert Uytterhoeven Reviewed-by: Nicolas Pitre commit 161e04a5bae58a65d2b13642845f250888a845a1 Author: Ard Biesheuvel Date: Mon Apr 13 18:21:32 2020 +0200 ARM: decompressor: split off _edata and stack base into separate object In preparation of moving the handling of the LC0 object to a later stage in the decompressor startup code, move out _edata and the initial value of the stack pointer, which are needed earlier than the remaining contents of LC0. Signed-off-by: Ard Biesheuvel Reviewed-by: Geert Uytterhoeven Reviewed-by: Nicolas Pitre commit f28cef9e4daca11337cb9f144cdebedaab69d78c Author: Brian Foster Date: Thu May 14 13:50:25 2020 -0700 xfs: don't fail verifier on empty attr3 leaf block The attr fork can transition from shortform to leaf format while empty if the first xattr doesn't fit in shortform. While this empty leaf block state is intended to be transient, it is technically not due to the transactional implementation of the xattr set operation. We historically have a couple of bandaids to work around this problem. The first is to hold the buffer after the format conversion to prevent premature writeback of the empty leaf buffer and the second is to bypass the xattr count check in the verifier during recovery. The latter assumes that the xattr set is also in the log and will be recovered into the buffer soon after the empty leaf buffer is reconstructed. This is not guaranteed, however. If the filesystem crashes after the format conversion but before the xattr set that induced it, only the format conversion may exist in the log. When recovered, this creates a latent corrupted state on the inode as any subsequent attempts to read the buffer fail due to verifier failure. This includes further attempts to set xattrs on the inode or attempts to destroy the attr fork, which prevents the inode from ever being removed from the unlinked list. To avoid this condition, accept that an empty attr leaf block is a valid state and remove the count check from the verifier. This means that on rare occasions an attr fork might exist in an unexpected state, but is otherwise consistent and functional. Note that we retain the logic to avoid racing with metadata writeback to reduce the window where this can occur. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 0e5e3d4461a22d739fb2284a6e313fb6cecf2871 Author: Benjamin Thiel Date: Sat May 16 14:38:16 2020 +0200 x86/audit: Fix a -Wmissing-prototypes warning for ia32_classify_syscall() Lift the prototype of ia32_classify_syscall() into its own header. Signed-off-by: Benjamin Thiel Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200516123816.2680-1-b.thiel@posteo.de commit d800bad67d4c21aaf11722f04e0f7547fb915ab5 Author: Jesper Dangaard Brouer Date: Mon May 18 15:05:27 2020 +0200 bpf: Fix too large copy from user in bpf_test_init Commit bc56c919fce7 ("bpf: Add xdp.frame_sz in bpf_prog_test_run_xdp().") recently changed bpf_prog_test_run_xdp() to use larger frames for XDP in order to test tail growing frames (via bpf_xdp_adjust_tail) and to have memory backing frame better resemble drivers. The commit contains a bug, as it tries to copy the max data size from userspace, instead of the size provided by userspace. This cause XDP unit tests to fail sporadically with EFAULT, an unfortunate behavior. The fix is to only copy the size specified by userspace. Fixes: bc56c919fce7 ("bpf: Add xdp.frame_sz in bpf_prog_test_run_xdp().") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/158980712729.256597.6115007718472928659.stgit@firesoul commit 0b4edf111870b83ea77b1d7e16b8ceac29f9f388 Author: Faiz Abbas Date: Wed May 13 02:08:04 2020 +0530 ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver Move mmc nodes to be compatible with the sdhci-omap driver. The following modifications are required for omap_hsmmc specific properties: ti,non-removable: convert to the generic mmc non-removable ti,needs-special-reset: co-opted into the sdhci-omap driver ti,dual-volt: removed. Legacy property not used in am335x or am43xx ti,needs-special-hs-handling: removed. Legacy property not used in am335x or am43xx Also since the sdhci-omap driver does not support runtime PM, explicitly disable the mmc3 instance in the dtsi. Signed-off-by: Faiz Abbas Signed-off-by: Tony Lindgren commit c4f39a6c74389fcc93ac39056ef342f32ab57a23 Author: Domenico Andreoli Date: Thu May 7 09:19:53 2020 +0200 PM: hibernate: Split off snapshot dev option Make it possible to reduce the attack surface in case the snapshot device is not to be used from userspace. Signed-off-by: Domenico Andreoli Signed-off-by: Rafael J. Wysocki commit ab7e9b067f3d9cbec28cfca51d341efb421b7a51 Author: Domenico Andreoli Date: Thu May 7 09:19:52 2020 +0200 PM: hibernate: Incorporate concurrency handling Hibernation concurrency handling is currently delegated to user.c, where it's also used for regulating the access to the snapshot device. In the prospective of making user.c a separate configuration option, such mutual exclusion is brought into hibernate.c and made available through accessor helpers hereby introduced. Signed-off-by: Domenico Andreoli Signed-off-by: Rafael J. Wysocki commit 172ce41db4b2d6fa5956c4baa63475b15f5d4bd8 Author: Baolin Wang Date: Sun May 17 19:49:41 2020 +0800 block: Remove unused flush_queue_delayed in struct blk_flush_queue The flush_queue_delayed was introdued to hold queue if flush is running for non-queueable flush drive by commit 3ac0cc450870 ("hold queue if flush is running for non-queueable flush drive"), but the non mq parts of the flush code had been removed by commit 7e992f847a08 ("block: remove non mq parts from the flush code"), as well as removing the usage of the flush_queue_delayed flag. Thus remove the unused flush_queue_delayed flag. Signed-off-by: Baolin Wang Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit a0bd8a2780fab2c8008e128e8a55995d8923e638 Author: Hanjun Guo Date: Tue May 19 14:25:25 2020 +0800 Documentation: ABI: make current_governer_ro as a candidate for removal Since both current_governor and current_governor_ro co-exist under /sys/devices/system/cpu/cpuidle/ file, and it's duplicate, make current_governer_ro as a candidate for removal. Signed-off-by: Hanjun Guo Reviewed-by: Doug Smythies Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 7395683a2498c7000120cdee8e4fb0c632e5561b Author: Hanjun Guo Date: Tue May 19 14:25:24 2020 +0800 Documentation: cpuidle: update the document Update the document after the remove of cpuidle_sysfs_switch. Signed-off-by: Hanjun Guo Reviewed-by: Doug Smythies Signed-off-by: Rafael J. Wysocki commit cce55cc902baa3e6b6bab5f72f3ce826cb8dc9a9 Author: Hanjun Guo Date: Tue May 19 14:25:23 2020 +0800 cpuidle: sysfs: Remove sysfs_switch and switch attributes Since the cpuidle governor can be switched via sysfs in default, remove sysfs_switch and cpuidle_switch_attrs. Signed-off-by: Hanjun Guo Reviewed-by: Doug Smythies Tested-by: Doug Smythies Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit b52e93e4e86c600492f977badad3c9e0f0303cb2 Author: Hanjun Guo Date: Tue May 19 14:25:22 2020 +0800 cpuidle: Make cpuidle governor switchable to be the default behaviour For now cpuidle governor can be switched via sysfs only when the boot option "cpuidle_sysfs_switch" is passed, but it's important to switch the governor to adapt to different workloads, especially after TEO and haltpoll governor were introduced. Add available_governors and current_governor into the default attributes, but reserve the current_governor_ro for compatiblity. Signed-off-by: Hanjun Guo Reviewed-by: Doug Smythies Tested-by: Doug Smythies Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit ef7e7d65eb808b5d37b4596974526962a741e930 Author: Hanjun Guo Date: Tue May 19 14:25:21 2020 +0800 cpuidle: sysfs: Accept governor name with 15 characters CPUIDLE_NAME_LEN is 16, so it's possible to accept governor name with 15 characters, but now store_current_governor() rejects governor name with 15 characters as it returns -EINVAL if count equals CPUIDLE_NAME_LEN. Refactor the code to accept such case and simplify the code. Signed-off-by: Hanjun Guo Reviewed-by: Doug Smythies Tested-by: Doug Smythies Signed-off-by: Rafael J. Wysocki commit 3f9f8daad3422809d1db47ef1ca5b1400c889f9d Author: Hanjun Guo Date: Tue May 19 14:25:20 2020 +0800 cpuidle: sysfs: Fix the overlap for showing available governors When showing the available governors, it's "%s " in scnprintf(), not "%s", so if the governor name has 15 characters, it will overlap with the later one, fix it by adding one more for the size. While we are at it, fix the minor coding style issue and remove the "/sizeof(char)" since sizeof(char) always equals 1. Signed-off-by: Hanjun Guo Reviewed-by: Doug Smythies Tested-by: Doug Smythies Signed-off-by: Rafael J. Wysocki commit cecbc9ce80e71a2894c7dfae6254b39cd4b8ba60 Author: Bart Van Assche Date: Mon May 18 21:07:37 2020 -0700 null_blk: Zero-initialize read buffers in non-memory-backed mode This patch suppresses an uninteresting KMSAN complaint without affecting performance of the null_blk driver if CONFIG_KMSAN is disabled. Reported-by: Alexander Potapenko Signed-off-by: Bart Van Assche Tested-by: Alexander Potapenko Cc: Christoph Hellwig Cc: Ming Lei Cc: Damien Le Moal Cc: Chaitanya Kulkarni Cc: Alexander Potapenko Signed-off-by: Jens Axboe commit 854b5f01dc6a7b59f0dddd646a80b1fcd767a8db Author: Bart Van Assche Date: Mon May 18 21:07:36 2020 -0700 block: Document the bio_vec properties Since it is nontrivial that nth_page() does not have to be used for a bio_vec, document this. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig CC: Christoph Hellwig Cc: Ming Lei Signed-off-by: Jens Axboe commit c1527c0e12d461ff4c603996f77983f37b85c286 Author: Bart Van Assche Date: Mon May 18 21:07:35 2020 -0700 bio.h: Declare the arguments of the bio iteration functions const This change makes it possible to pass 'const struct bio *' arguments to these functions. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Cc: Ming Lei Cc: Damien Le Moal Cc: Chaitanya Kulkarni Cc: Alexander Potapenko Signed-off-by: Jens Axboe commit c8210a57655a64c0a9b53c58c2ad5d8426c15097 Author: Bart Van Assche Date: Mon May 18 21:07:34 2020 -0700 block: Fix type of first compat_put_{,u}long() argument This patch fixes the following sparse warnings: block/ioctl.c:209:16: warning: incorrect type in argument 1 (different address spaces) block/ioctl.c:209:16: expected void const volatile [noderef] * block/ioctl.c:209:16: got signed int [usertype] *argp block/ioctl.c:214:16: warning: incorrect type in argument 1 (different address spaces) block/ioctl.c:214:16: expected void const volatile [noderef] * block/ioctl.c:214:16: got unsigned int [usertype] *argp block/ioctl.c:666:40: warning: incorrect type in argument 1 (different address spaces) block/ioctl.c:666:40: expected signed int [usertype] *argp block/ioctl.c:666:40: got void [noderef] *argp block/ioctl.c:672:41: warning: incorrect type in argument 1 (different address spaces) block/ioctl.c:672:41: expected unsigned int [usertype] *argp block/ioctl.c:672:41: got void [noderef] *argp Fixes: 9b81648cb5e3 ("compat_ioctl: simplify up block/ioctl.c") Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Acked-by: Arnd Bergmann Cc: Arnd Bergmann Signed-off-by: Jens Axboe commit 9ee195fd1be87719e5fcda4cbd7ba4454249f04f Author: Serge Semin Date: Wed May 6 20:42:30 2020 +0300 mips: MAAR: Add XPA mode support When XPA mode is enabled the normally 32-bits MAAR pair registers are extended to be of 64-bits width as in pure 64-bits MIPS architecture. In this case the MAAR registers can enable the speculative loads/stores for addresses of up to 39-bits width. But in this case the process of the MAAR initialization changes a bit. The upper 32-bits of the registers are supposed to be accessed by mean of the dedicated instructions mfhc0/mthc0 and there is a CP0.MAAR.VH bit which should be set together with CP0.MAAR.VL as indication of the boundary validity. All of these peculiarities were taken into account in this commit so the speculative loads/stores would work when XPA mode is enabled. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-pm@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit bd6e38983bb76a48604b7a4f0740354158217bd3 Author: Zhi Li Date: Mon May 18 15:08:08 2020 +0800 MIPS: Remove useless parameter of bootcmdline_init() The parameter "cmdline_p" is useless in bootcmdline_init(),remove it. Signed-off-by: Zhi Li Signed-off-by: Thomas Bogendoerfer commit 10ec5e86f9b840b7070b9146257a199dd0227d7e Author: Christoph Hellwig Date: Wed May 13 12:49:35 2020 +0200 block: merge part_{inc,dev}_in_flight into their only callers part_inc_in_flight and part_dec_in_flight only have one caller each, and those callers are purely for bio based drivers. Merge each function into the only caller, and remove the superflous blk-mq checks. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 76268f3ac0a69e76270af5f67ab239ccd796ae56 Author: Christoph Hellwig Date: Wed May 13 12:49:34 2020 +0200 block: don't call part_{inc,dec}_in_flight for blk-mq devices part_inc_in_flight and part_dec_in_flight are no-ops for blk-mq queues, so remove the calls in purely blk-mq callers. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b2f609e191edc9c7a9dec603318461eeb23f8a6b Author: Christoph Hellwig Date: Wed May 13 12:49:33 2020 +0200 block: move the blk-mq calls out of part_in_flight{,_rw} Don't bother to call part_in_flight / part_in_flight_rw on blk-mq devices, just call the blk-mq versions directly. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit f1394b79881458c3cfb12c1cac813085549f2c7d Author: Christoph Hellwig Date: Wed May 13 12:49:32 2020 +0200 block: mark blk_account_io_completion static Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 860f02f13cf9b72fdc48f978723347f54c5364f2 Author: Tiezhu Yang Date: Tue May 19 20:28:11 2020 +0800 MIPS: SGI-IP27: Remove duplicated include in ip27-timer.c After commit 9d0aaf98dc24 ("MIPS: SGI-IP27: Move all shared IP27 declarations to ip27-common.h"), ip27-common.h is included more than once in ip27-timer.c, remove it. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit ac7c5675fa45a372fab27d78a72d2e10e4734959 Author: Christoph Hellwig Date: Sat May 16 20:28:01 2020 +0200 blk-mq: allow blk_mq_make_request to consume the q_usage_counter reference blk_mq_make_request currently needs to grab an q_usage_counter reference when allocating a request. This is because the block layer grabs one before calling blk_mq_make_request, but also releases it as soon as blk_mq_make_request returns. Remove the blk_queue_exit call after blk_mq_make_request returns, and instead let it consume the reference. This works perfectly fine for the block layer caller, just device mapper needs an extra reference as the old problem still persists there. Open code blk_queue_enter_live in device mapper, as there should be no other callers and this allows better documenting why we do a non-try get. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 35b371ff01410ec7c73312f1c1c320de35fcfd0f Author: Christoph Hellwig Date: Sat May 16 20:28:00 2020 +0200 blk-mq: remove a pointless queue enter pair in blk_mq_alloc_request_hctx No need for two queue references. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit 22fa792cd8c67958adbddc9d436b850e148a623b Author: Christoph Hellwig Date: Sat May 16 20:27:59 2020 +0200 blk-mq: remove a pointless queue enter pair in blk_mq_alloc_request No need for two queue references. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit a5ea5811058ddb91da604afe77acd5ff29babe29 Author: Christoph Hellwig Date: Sat May 16 20:27:58 2020 +0200 blk-mq: move the call to blk_queue_enter_live out of blk_mq_get_request Move the blk_queue_enter_live calls into the callers, where they can successively be cleaned up. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit 59929cd1fec508a48ea2a04d8f2e4fdef907a2cd Author: Daniel T. Lee Date: Sat May 16 13:06:08 2020 +0900 samples, bpf: Refactor kprobe, tail call kern progs map definition Because the previous two commit replaced the bpf_load implementation of the user program with libbpf, the corresponding kernel program's MAP definition can be replaced with new BTF-defined map syntax. This commit only updates the samples which uses libbpf API for loading bpf program not with bpf_load. Signed-off-by: Daniel T. Lee Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200516040608.1377876-6-danieltimlee@gmail.com commit 14846dda634e28cc0430f1fbbfa6c758a2e5f873 Author: Daniel T. Lee Date: Sat May 16 13:06:07 2020 +0900 samples, bpf: Add tracex7 test file to .gitignore This commit adds tracex7 test file (testfile.img) to .gitignore which comes from test_override_return.sh. Signed-off-by: Daniel T. Lee Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200516040608.1377876-5-danieltimlee@gmail.com commit bc1a85977b950407d67cd1e5b74f261a4bee3284 Author: Daniel T. Lee Date: Sat May 16 13:06:06 2020 +0900 samples, bpf: Refactor tail call user progs with libbpf BPF tail call uses the BPF_MAP_TYPE_PROG_ARRAY type map for calling into other BPF programs and this PROG_ARRAY should be filled prior to use. Currently, samples with the PROG_ARRAY type MAP fill this program array with bpf_load. For bpf_load to fill this map, kernel BPF program must specify the section with specific format of / (e.g. SEC("socket/0")) But by using libbpf instead of bpf_load, user program can specify which programs should be added to PROG_ARRAY. The advantage of this approach is that you can selectively add only the programs you want, rather than adding all of them to PROG_ARRAY, and it's much more intuitive than the traditional approach. This commit refactors user programs with the PROG_ARRAY type MAP with libbpf instead of using bpf_load. Signed-off-by: Daniel T. Lee Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200516040608.1377876-4-danieltimlee@gmail.com commit 63841bc0833623ecd4f758ec055b543cf1bc56ba Author: Daniel T. Lee Date: Sat May 16 13:06:05 2020 +0900 samples, bpf: Refactor kprobe tracing user progs with libbpf Currently, the kprobe BPF program attachment method for bpf_load is quite old. The implementation of bpf_load "directly" controls and manages(create, delete) the kprobe events of DEBUGFS. On the other hand, using using the libbpf automatically manages the kprobe event. (under bpf_link interface) By calling bpf_program__attach(_kprobe) in libbpf, the corresponding kprobe is created and the BPF program will be attached to this kprobe. To remove this, by simply invoking bpf_link__destroy will clean up the event. This commit refactors kprobe tracing programs (tracex{1~7}_user.c) with libbpf using bpf_link interface and bpf_program__attach. tracex2_kern.c, which tracks system calls (sys_*), has been modified to append prefix depending on architecture. Signed-off-by: Daniel T. Lee Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200516040608.1377876-3-danieltimlee@gmail.com commit 0efdcefb00d768442efef21560ea4c44d481fa5c Author: Daniel T. Lee Date: Sat May 16 13:06:04 2020 +0900 samples, bpf: Refactor pointer error check with libbpf Current method of checking pointer error is not user friendly. Especially the __must_check define makes this less intuitive. Since, libbpf has an API libbpf_get_error() which checks pointer error, this commit refactors existing pointer error check logic with libbpf. Signed-off-by: Daniel T. Lee Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200516040608.1377876-2-danieltimlee@gmail.com commit 8da047603bbcfddda6eb6ebbee0dc52c34badc6e Author: Pascal Terjan Date: Tue May 19 16:00:42 2020 +0100 staging: rtl8192u: Merge almost duplicate code This causes a change in behaviour: - stats also get updated when reordering, this seems like it should be the case but those lines were commented out. - sub_skb NULL check now happens early in both cases, previously it happened only after dereferencing it 12 times, so it may not actually be needed. Signed-off-by: Pascal Terjan Link: https://lore.kernel.org/r/20200519150042.199690-1-pterjan@google.com Signed-off-by: Greg Kroah-Hartman commit 25bdae0f1c6609ceaf55fe6700654f0be2253d8e Author: Marek Szyprowski Date: Tue May 19 12:26:52 2020 +0200 clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1 Mark the SCLK clock for Exynos5433 I2S1 device with IGNORE_UNUSED flag to match its behaviour with SCLK clock for AUD_I2S (I2S0) device until a proper fix for Exynos I2S driver is ready. This fixes the following synchronous abort issue revealed by the probe order change caused by the commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when adding all top level devices") Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 50 Comm: kworker/0:1 Not tainted 5.7.0-rc5+ #701 Hardware name: Samsung TM2E board (DT) Workqueue: events deferred_probe_work_func pstate: 60000005 (nZCv daif -PAN -UAO) pc : samsung_i2s_probe+0x768/0x8f0 lr : samsung_i2s_probe+0x688/0x8f0 ... Call trace: samsung_i2s_probe+0x768/0x8f0 platform_drv_probe+0x50/0xa8 really_probe+0x108/0x370 driver_probe_device+0x54/0xb8 __device_attach_driver+0x90/0xc0 bus_for_each_drv+0x70/0xc8 __device_attach+0xdc/0x140 device_initial_probe+0x10/0x18 bus_probe_device+0x94/0xa0 deferred_probe_work_func+0x70/0xa8 process_one_work+0x2a8/0x718 worker_thread+0x48/0x470 kthread+0x134/0x160 ret_from_fork+0x10/0x1c Code: 17ffffaf d503201f f94086c0 91003000 (88dffc00) ---[ end trace ccf721c9400ddbd6 ]--- Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki commit 81eeae43c3f61ce875c9ceab1be47bd02b0099a2 Author: Joe Perches Date: Tue Mar 10 21:51:24 2020 -0700 ARM/SAMSUNG EXYNOS ARM ARCHITECTURES: Use fallthrough; Convert the various uses of fallthrough comments to fallthrough; Done via script Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/ Signed-off-by: Joe Perches Reviewed-by: Stephen Boyd Acked-by: Wolfram Sang # for the I2C part Signed-off-by: Sylwester Nawrocki commit 691cbe5ba5f77f3759f3491b971a96f9998dcd9d Author: Ard Biesheuvel Date: Mon Apr 13 18:21:31 2020 +0200 ARM: decompressor: move headroom variable out of LC0 Before breaking up LC0 into different pieces, move out the variable that is already place-relative (given that it subtracts 'restart' in the expression) and so its value does not need to be added to the runtime address of the LC0 symbol itself. Signed-off-by: Ard Biesheuvel Reviewed-by: Geert Uytterhoeven Reviewed-by: Nicolas Pitre commit ac0a95a3ea7811f5cc4489924ddb54f0ea0f3007 Author: Dilip Kota Date: Tue May 19 14:19:21 2020 +0800 phy: intel: Add driver support for ComboPhy ComboPhy subsystem provides PHYs for various controllers like PCIe, SATA and EMAC. Signed-off-by: Dilip Kota Acked-By: Vinod Koul Link: https://lore.kernel.org/r/7b313826f46b9006a3ba98c0613e8f88f293a074.1589868358.git.eswara.kota@linux.intel.com Signed-off-by: Kishon Vijay Abraham I commit 1d51a2caa79d7d9aa91991638b8269dfb88a151d Author: Dilip Kota Date: Tue May 19 14:19:20 2020 +0800 dt-bindings: phy: Add YAML schemas for Intel ComboPhy ComboPhy subsystem provides PHY support to various controllers, viz. PCIe, SATA and EMAC. Adding YAML schemas for the same. Signed-off-by: Dilip Kota Reviewed-by: Rob Herring Acked-By: Vinod Koul Link: https://lore.kernel.org/r/e8cc2038f8fe417ddf8c3298eebae722ee5d8fe2.1589868358.git.eswara.kota@linux.intel.com Signed-off-by: Kishon Vijay Abraham I commit c5d3cdad688ed75fb311a3a671eb30ba7106d7d3 Author: Dilip Kota Date: Tue May 19 14:19:19 2020 +0800 dt-bindings: phy: Add PHY_TYPE_XPCS definition Add definition for Ethernet PCS phy type. Signed-off-by: Dilip Kota Acked-by: Rob Herring Acked-By: Vinod Koul Link: https://lore.kernel.org/r/6091f0d2a1046f1e3656d9e33b6cc433d5465eaf.1589868358.git.eswara.kota@linux.intel.com Signed-off-by: Kishon Vijay Abraham I commit d96536f0fe699729a0974eb5b65eb0d87cc747e1 Author: Imre Deak Date: Thu May 14 23:45:53 2020 +0300 drm/i915: Fix AUX power domain toggling across TypeC mode resets Make sure to select the port's AUX power domain while holding the TC port lock. The domain depends on the port's current TC mode, which may get changed under us if we're not holding the lock. This was left out from commit 8c10e2262663 ("drm/i915: Keep the TypeC port mode fixed for detect/AUX transfers") Cc: # v5.4+ Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200514204553.27193-1-imre.deak@intel.com (cherry picked from commit ae9b6cfe1352da25931bce3ea4acfd4dc1ac8a85) Signed-off-by: Joonas Lahtinen commit f159c647b13b3cc9ae682f455b2858d2e1abd6be Author: Nathan Chancellor Date: Fri May 15 19:35:45 2020 -0700 drm/i915: Mark check_shadow_context_ppgtt as maybe unused When CONFIG_DRM_I915_DEBUG_GEM is not set, clang warns: drivers/gpu/drm/i915/gvt/scheduler.c:884:1: warning: function 'check_shadow_context_ppgtt' is not needed and will not be emitted [-Wunneeded-internal-declaration] check_shadow_context_ppgtt(struct execlist_ring_context *c, struct intel_vgpu_mm *m) ^ 1 warning generated. This warning is similar to -Wunused-function but rather than warning that the function is completely unused, it warns that it is used in some expression within the file but that expression will be evaluated to a constant or be optimized away in the final assembly, essentially making it appeared used but really isn't. Usually, this happens when a function or variable is only used in sizeof, where it will appear to be used but will be evaluated at compile time and not be required to be emitted. In this case, the function is only used in GEM_BUG_ON, which is defined as BUILD_BUG_ON_INVALID, which intentionally follows this pattern. To fix this warning, add __maybe_unused to make it clear that this is intentional depending on the configuration. Fixes: bec3df930fbd ("drm/i915/gvt: Support PPGTT table load command") Link: https://github.com/ClangBuiltLinux/linux/issues/1027 Signed-off-by: Nathan Chancellor Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200516023545.3332334-1-natechancellor@gmail.com (cherry picked from commit 993fa32eb3d5ffb79e86a770ca982eb9c9f54011) Signed-off-by: Joonas Lahtinen commit aa7b3df8fa0ed7ffbbf008466efb06259d0f59c1 Author: Arnd Bergmann Date: Tue Apr 28 23:30:50 2020 +0200 drm/i915: avoid unused scale_user_to_hw() warning After the function is no longer marked 'inline', there is now a new warning pointing out that the only caller is inside of an #ifdef: drivers/gpu/drm/i915/display/intel_panel.c:493:12: warning: 'scale_user_to_hw' defined but not used [-Wunused-function] 493 | static u32 scale_user_to_hw(struct intel_connector *connector, | ^~~~~~~~~~~~~~~~ Move the function itself into that #ifdef as well. Fixes: 81b55ef1f47b ("drm/i915: drop a bunch of superfluous inlines") Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200428213106.3139170-1-arnd@arndb.de (cherry picked from commit 794bdcf71f47b98f6e003190069d5064123067ed) Signed-off-by: Joonas Lahtinen commit fefcfc968723caf93318613a08e1f3ad07a6154f Author: Saravana Kannan Date: Sun May 17 10:34:53 2020 -0700 driver core: Remove check in driver_deferred_probe_force_trigger() The whole point behind adding driver_deferred_probe_force_trigger() in commit 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing") was to skip the check for driver_deferred_probe_enable. Otherwise, it's identical to driver_deferred_probe_trigger(). Delete the check in driver_deferred_probe_force_trigger() so that fw_devlink_pause() and fw_devlink_resume() can kick off deferred probe as intended. Without doing this forced deferred probe trigger, some platforms seem to be crashing during boot because they assume probe order of devices. Fixes: 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing") Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200517173453.157703-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit a8478a602913dc89a7cd2060e613edecd07e1dbd Author: David Howells Date: Tue Jan 14 17:07:13 2020 +0000 smack: Implement the watch_key and post_notification hooks Implement the watch_key security hook in Smack to make sure that a key grants the caller Read permission in order to set a watch on a key. Also implement the post_notification security hook to make sure that the notification source is granted Write permission by the watch queue. For the moment, the watch_devices security hook is left unimplemented as it's not obvious what the object should be since the queue is global and didn't previously exist. Signed-off-by: David Howells Acked-by: Casey Schaufler commit 3e412ccc22e25666772094fb5ca01af056c54471 Author: David Howells Date: Tue Jan 14 17:07:13 2020 +0000 selinux: Implement the watch_key security hook Implement the watch_key security hook to make sure that a key grants the caller View permission in order to set a watch on a key. For the moment, the watch_devices security hook is left unimplemented as it's not obvious what the object should be since the queue is global and didn't previously exist. Signed-off-by: David Howells Acked-by: Stephen Smalley Reviewed-by: James Morris commit c9d7e3da1f3c4cf5dddfc5d7ce4d76d013aba1cc Author: Souptick Joarder Date: Mon May 18 23:49:51 2020 +0530 fpga: dfl: afu: Corrected error handling levels Corrected error handling goto sequnece. Level put_pages should be called when pinned pages >= 0 && pinned != npages. Level free_pages should be called when pinned pages < 0. Fixes: fa8dda1edef9 ("fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support") Signed-off-by: Souptick Joarder Acked-by: Wu Hao Reviewed-by: Xu Yilun Link: https://lore.kernel.org/r/1589825991-3545-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b03025c57396b23fe2423384c25aa580000e9883 Author: Lad Prabhakar Date: Thu May 14 23:03:29 2020 +0100 misc: pci_endpoint_test: Add Device ID for RZ/G2E PCIe controller Add Renesas R8A774C0 in pci_device_id table so that pci-epf-test can be used for testing PCIe EP on RZ/G2E. Signed-off-by: Lad Prabhakar Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1589493809-2602-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit ddae1423bc2ddf87d1e51746ebfa9034c8e323f1 Author: John Hubbard Date: Sun May 17 18:52:37 2020 -0700 genwqe: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Cc: Frank Haverkamp Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: John Hubbard Link: https://lore.kernel.org/r/20200518015237.1568940-1-jhubbard@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 5459ceedb3940df460a6048762cc49d549049d6f Author: John Hubbard Date: Sun May 17 21:13:07 2020 -0700 drivers/mic/scif: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. Note that this effectively changes the code's behavior as well: it now ultimately calls set_page_dirty_lock(), instead of SetPageDirty(). This is probably more accurate. As Christoph Hellwig put it, "set_page_dirty() is only safe if we are dealing with a file backed page where we have reference on the inode it hangs off." [3] [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ [3] https://lore.kernel.org/r/20190723153640.GB720@lst.de Signed-off-by: John Hubbard Link: https://lore.kernel.org/r/20200518041307.1987328-1-jhubbard@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 8c0637e950d68933a67f7438f779d79b049b5e5c Author: David Howells Date: Tue May 12 15:16:29 2020 +0100 keys: Make the KEY_NEED_* perms an enum rather than a mask Since the meaning of combining the KEY_NEED_* constants is undefined, make it so that you can't do that by turning them into an enum. The enum is also given some extra values to represent special circumstances, such as: (1) The '0' value is reserved and causes a warning to trap the parameter being unset. (2) The key is to be unlinked and we require no permissions on it, only the keyring, (this replaces the KEY_LOOKUP_FOR_UNLINK flag). (3) An override due to CAP_SYS_ADMIN. (4) An override due to an instantiation token being present. (5) The permissions check is being deferred to later key_permission() calls. The extra values give the opportunity for LSMs to audit these situations. [Note: This really needs overhauling so that lookup_user_key() tells key_task_permission() and the LSM what operation is being done and leaves it to those functions to decide how to map that onto the available permits. However, I don't really want to make these change in the middle of the notifications patchset.] Signed-off-by: David Howells cc: Jarkko Sakkinen cc: Paul Moore cc: Stephen Smalley cc: Casey Schaufler cc: keyrings@vger.kernel.org cc: selinux@vger.kernel.org commit e7d553d69cf63aec7de0f38fed49ccbb30922e1e Author: David Howells Date: Tue Jan 14 17:07:12 2020 +0000 pipe: Add notification lossage handling Add handling for loss of notifications by having read() insert a loss-notification message after it has read the pipe buffer that was last in the ring when the loss occurred. Lossage can come about either by running out of notification descriptors or by running out of space in the pipe ring. Signed-off-by: David Howells commit 8cfba76383e902acbed95092163052b1572f17a8 Author: David Howells Date: Tue Jan 14 17:07:11 2020 +0000 pipe: Allow buffers to be marked read-whole-or-error for notifications Allow a buffer to be marked such that read() must return the entire buffer in one go or return ENOBUFS. Multiple buffers can be amalgamated into a single read, but a short read will occur if the next "whole" buffer won't fit. This is useful for watch queue notifications to make sure we don't split a notification across multiple reads, especially given that we need to fabricate an overrun record under some circumstances - and that isn't in the buffers. Signed-off-by: David Howells commit f5b5a164f9a11aab5b225f082b33a8f03c07516c Author: David Howells Date: Tue Jan 14 17:07:11 2020 +0000 Add sample notification program The sample program is run like: ./samples/watch_queue/watch_test and watches "/" for mount changes and the current session keyring for key changes: # keyctl add user a a @s 1035096409 # keyctl unlink 1035096409 @s producing: # ./watch_test read() = 16 NOTIFY[000]: ty=000001 sy=02 i=00000110 KEY 2ffc2e5d change=2[linked] aux=1035096409 read() = 16 NOTIFY[000]: ty=000001 sy=02 i=00000110 KEY 2ffc2e5d change=3[unlinked] aux=1035096409 Other events may be produced, such as with a failing disk: read() = 22 NOTIFY[000]: ty=000003 sy=02 i=00000416 USB 3-7.7 dev-reset e=0 r=0 read() = 24 NOTIFY[000]: ty=000002 sy=06 i=00000418 BLOCK 00800050 e=6[critical medium] s=64000ef8 This corresponds to: blk_update_request: critical medium error, dev sdf, sector 1677725432 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 in dmesg. Signed-off-by: David Howells commit 6a0953ce7de918b06f7fed561754ad114fd964c1 Author: Mike Leach Date: Mon May 18 12:02:42 2020 -0600 coresight: cti: Add CPU idle pm notifer to CTI devices Adds a notify callback for CPU PM events to the CTI driver - for CPU bound CTI devices. Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-24-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit e9b880581d555c8f7b58c7d19cc3f8f9016a1b5f Author: Mike Leach Date: Mon May 18 12:02:41 2020 -0600 coresight: cti: Add CPU Hotplug handling to CTI driver Adds registration of CPU start and stop functions to CPU hotplug mechanisms - for any CPU bound CTI. Sets CTI powered flag according to state. Will enable CTI on CPU start if there are existing enable requests. Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-23-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3f4943d422c5febbb3c764670011a00eb2a86238 Author: Suzuki K Poulose Date: Mon May 18 12:02:40 2020 -0600 coresight: etm4x: Fix use-after-free of per-cpu etm drvdata etm probe could be deferred due to the dependency in the trace path chain and may be retried. We need to clear the per-cpu etmdrvdata entry for the etm in case of a failure to avoid use-after-free cases as reported below: KASAN use-after-free bug in etm4_cpu_pm_notify(): [ 8.574566] coresight etm0: CPU0: ETM v4.2 initialized [ 8.581920] BUG: KASAN: use-after-free in etm4_cpu_pm_notify+0x580/0x2024 [ 8.581925] Read of size 8 at addr ffffff813304f8c8 by task swapper/3/0 [ 8.581927] [ 8.581934] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G S W 5.4.28 #314 [ 8.587775] coresight etm1: CPU1: ETM v4.2 initialized [ 8.594195] Call trace: [ 8.594205] dump_backtrace+0x0/0x188 [ 8.594209] show_stack+0x20/0x2c [ 8.594216] dump_stack+0xdc/0x144 [ 8.594227] print_address_description+0x3c/0x494 [ 8.594232] __kasan_report+0x144/0x168 [ 8.601598] coresight etm2: CPU2: ETM v4.2 initialized [ 8.602563] kasan_report+0x10/0x18 [ 8.602568] check_memory_region+0x1a4/0x1b4 [ 8.602572] __kasan_check_read+0x18/0x24 [ 8.602577] etm4_cpu_pm_notify+0x580/0x2024 [ 8.665945] notifier_call_chain+0x5c/0x90 [ 8.670166] __atomic_notifier_call_chain+0x90/0xf8 [ 8.675182] cpu_pm_notify+0x40/0x6c [ 8.678858] cpu_pm_enter+0x38/0x80 [ 8.682451] psci_enter_idle_state+0x34/0x70 [ 8.686844] cpuidle_enter_state+0xb8/0x20c [ 8.691143] cpuidle_enter+0x38/0x4c [ 8.694820] call_cpuidle+0x3c/0x68 [ 8.698408] do_idle+0x1a0/0x280 [ 8.701729] cpu_startup_entry+0x24/0x28 [ 8.705768] secondary_start_kernel+0x15c/0x170 [ 8.710423] [ 8.711972] Allocated by task 242: [ 8.715473] __kasan_kmalloc+0xf0/0x1ac [ 8.719426] kasan_slab_alloc+0x14/0x1c [ 8.723375] __kmalloc_track_caller+0x23c/0x388 [ 8.728040] devm_kmalloc+0x38/0x94 [ 8.731632] etm4_probe+0x48/0x3c8 [ 8.735140] amba_probe+0xbc/0x158 [ 8.738645] really_probe+0x144/0x408 [ 8.742412] driver_probe_device+0x70/0x140 [ 8.746716] __device_attach_driver+0x9c/0x110 [ 8.751287] bus_for_each_drv+0x90/0xd8 [ 8.755236] __device_attach+0xb4/0x164 [ 8.759188] device_initial_probe+0x20/0x2c [ 8.763490] bus_probe_device+0x34/0x94 [ 8.767436] device_add+0x34c/0x3e0 [ 8.771029] amba_device_try_add+0x68/0x440 [ 8.775332] amba_deferred_retry_func+0x48/0xc8 [ 8.779997] process_one_work+0x344/0x648 [ 8.784127] worker_thread+0x2ac/0x47c [ 8.787987] kthread+0x128/0x138 [ 8.791313] ret_from_fork+0x10/0x18 [ 8.794993] [ 8.796532] Freed by task 242: [ 8.799684] __kasan_slab_free+0x15c/0x22c [ 8.803897] kasan_slab_free+0x10/0x1c [ 8.807761] kfree+0x25c/0x4bc [ 8.810913] release_nodes+0x240/0x2b0 [ 8.814767] devres_release_all+0x3c/0x54 [ 8.818887] really_probe+0x178/0x408 [ 8.822661] driver_probe_device+0x70/0x140 [ 8.826963] __device_attach_driver+0x9c/0x110 [ 8.831539] bus_for_each_drv+0x90/0xd8 [ 8.835487] __device_attach+0xb4/0x164 [ 8.839431] device_initial_probe+0x20/0x2c [ 8.843732] bus_probe_device+0x34/0x94 [ 8.847678] device_add+0x34c/0x3e0 [ 8.851274] amba_device_try_add+0x68/0x440 [ 8.855576] amba_deferred_retry_func+0x48/0xc8 [ 8.860240] process_one_work+0x344/0x648 [ 8.864366] worker_thread+0x2ac/0x47c [ 8.868228] kthread+0x128/0x138 [ 8.871557] ret_from_fork+0x10/0x18 [ 8.875231] [ 8.876782] The buggy address belongs to the object at ffffff813304f800 [ 8.876782] which belongs to the cache kmalloc-1k of size 1024 [ 8.889632] The buggy address is located 200 bytes inside of [ 8.889632] 1024-byte region [ffffff813304f800, ffffff813304fc00) [ 8.901761] The buggy address belongs to the page: [ 8.906695] page:ffffffff04ac1200 refcount:1 mapcount:0 mapping:ffffff8146c03800 index:0x0 compound_mapcount: 0 [ 8.917047] flags: 0x4000000000010200(slab|head) [ 8.921799] raw: 4000000000010200 dead000000000100 dead000000000122 ffffff8146c03800 [ 8.929753] raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 [ 8.937703] page dumped because: kasan: bad access detected [ 8.943433] [ 8.944974] Memory state around the buggy address: [ 8.949903] ffffff813304f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 8.957320] ffffff813304f800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 8.964742] >ffffff813304f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 8.972157] ^ [ 8.977886] ffffff813304f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 8.985298] ffffff813304f980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 8.992713] ================================================================== Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Reported-by: Sai Prakash Ranjan Tested-by: Sai Prakash Ranjan Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-22-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9712c092cf06be9934e92ee2919e901afb981b6a Author: Stephen Boyd Date: Mon May 18 12:02:39 2020 -0600 coresight: Avoid casting void pointers We don't need to cast void pointers, such as the amba_id data. Assign to a local variable to make the code prettier and also return NULL instead of 0 to make sparse happy. Cc: Suzuki K Poulose Cc: Mike Leach Reviewed-by: Joe Perches Signed-off-by: Stephen Boyd Reviewed-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-21-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 298754c56ce1e554eec568059d3a5adf8abc4ab5 Author: Stephen Boyd Date: Mon May 18 12:02:38 2020 -0600 coresight: Include required headers in C files We should include headers that C files use in the C files that use them and avoid relying on implicit includes as much as possible. This helps avoid compiler errors in the future about missing declarations when header files change includes in the future. Cc: Douglas Anderson Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-20-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit bab223f9a97a0efe647b746fc46ccd28383d6ead Author: Stephen Boyd Date: Mon May 18 12:02:37 2020 -0600 coresight: Initialize arg in sparse friendly way Sparse gets annoyed when this initializer is 0 but the first struct member is a pointer. Just use { } to initialize instead so that sparse is quiet. Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-19-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0e34dc7618103e81ca77555d22493ee3e0a0e998 Author: Stephen Boyd Date: Mon May 18 12:02:36 2020 -0600 coresight: Don't initialize variables unnecessarily These variables are assigned again before they're used. Leave them unassigned at first so that the compiler can detect problems in the future with use before initialization. Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-18-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit e54d9c77d26649d7ed99b03873b20c8ffd5aecfe Author: Stephen Boyd Date: Mon May 18 12:02:35 2020 -0600 coresight: Mark some functions static These functions aren't used outside the file they're in. Mark them static to indicate as such and silence tools like sparse. Cc: Suzuki K Poulose Cc: Mike Leach Signed-off-by: Stephen Boyd [Dropped changes in coresight-cti.c and coresight-etb10.c] Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-17-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit fac28c4d34ca81bc77170fbbaaf1f6bedb3fa133 Author: Anurag Koul Date: Mon May 18 12:02:34 2020 -0600 coresight: etm4x: Add support for Neoverse N1 ETM Add PID for Arm Neoverse N1 ETM to the list of supported/known ETMs. Signed-off-by: Anurag Koul Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-16-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit ae2041510d5d5fc4f06109559ff40882955b24db Author: Mike Leach Date: Mon May 18 12:02:33 2020 -0600 coresight: etmv4: Update default filter and initialisation Differing default states set on driver init / perf init and as a result of a sysfs reset. The ETMv4 can be programmed to trace the entire instruction address range without the need to use address comparator filter resources. (Described in the ETMv4.x technical reference manual) sysfs reset was using this method, perf and default driver init were setup with an address range comparator for the entire address range. The perf / driver init has been altered to use the method without needing any comparator address hardware. Minor adjustment to the vinst_ctrl register initialisation to ensure correct zero initialisation. Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-15-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 347adb0d6385c3220dc01ab61807a5b1892901cc Author: Sai Prakash Ranjan Date: Mon May 18 12:02:32 2020 -0600 coresight: tmc: Fix TMC mode read in tmc_read_prepare_etb() On some QCOM platforms like SC7180, SDM845 and SM8150, reading TMC mode register without proper coresight power management can lead to async exceptions like the one in the call trace below in tmc_read_prepare_etb(). This can happen if the user tries to read the TMC etf data via device node without setting up source and the sink first. Fix this by having a check for coresight sysfs mode before reading TMC mode management register. Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 7 PID: 2605 Comm: hexdump Tainted: G S 5.4.30 #122 Call trace: dump_backtrace+0x0/0x188 show_stack+0x20/0x2c dump_stack+0xdc/0x144 panic+0x168/0x36c panic+0x0/0x36c arm64_serror_panic+0x78/0x84 do_serror+0x130/0x138 el1_error+0x84/0xf8 tmc_read_prepare_etb+0x88/0xb8 tmc_open+0x40/0xd8 misc_open+0x120/0x158 chrdev_open+0xb8/0x1a4 do_dentry_open+0x268/0x3a0 vfs_open+0x34/0x40 path_openat+0x39c/0xdf4 do_filp_open+0x90/0x10c do_sys_open+0x150/0x3e8 __arm64_compat_sys_openat+0x28/0x34 el0_svc_common+0xa8/0x160 el0_svc_compat_handler+0x2c/0x38 el0_svc_compat+0x8/0x10 Fixes: 4525412a5046 ("coresight: tmc: making prepare/unprepare functions generic") Reported-by: Stephen Boyd Suggested-by: Mathieu Poirier Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-14-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit d375b356e687f2eefb51ddc3f1f2414cfa498f86 Author: Suzuki K Poulose Date: Mon May 18 12:02:31 2020 -0600 coresight: Fix support for sparsely populated ports On some systems the firmware may not describe all the ports connected to a component (e.g, for security reasons). This could be especially problematic for "funnels" where we could end up in modifying memory beyond the allocated space for refcounts. e.g, for a funnel with input ports listed 0, 3, 5, nr_inport = 3. However the we could access refcnts[5] while checking for references, like : [ 526.110401] ================================================================== [ 526.117988] BUG: KASAN: slab-out-of-bounds in funnel_enable+0x54/0x1b0 [ 526.124706] Read of size 4 at addr ffffff8135f9549c by task bash/1114 [ 526.131324] [ 526.132886] CPU: 3 PID: 1114 Comm: bash Tainted: G S 5.4.25 #232 [ 526.140397] Hardware name: Qualcomm Technologies, Inc. SC7180 IDP (DT) [ 526.147113] Call trace: [ 526.149653] dump_backtrace+0x0/0x188 [ 526.153431] show_stack+0x20/0x2c [ 526.156852] dump_stack+0xdc/0x144 [ 526.160370] print_address_description+0x3c/0x494 [ 526.165211] __kasan_report+0x144/0x168 [ 526.169170] kasan_report+0x10/0x18 [ 526.172769] check_memory_region+0x1a4/0x1b4 [ 526.177164] __kasan_check_read+0x18/0x24 [ 526.181292] funnel_enable+0x54/0x1b0 [ 526.185072] coresight_enable_path+0x104/0x198 [ 526.189649] coresight_enable+0x118/0x26c ... [ 526.237782] Allocated by task 280: [ 526.241298] __kasan_kmalloc+0xf0/0x1ac [ 526.245249] kasan_kmalloc+0xc/0x14 [ 526.248849] __kmalloc+0x28c/0x3b4 [ 526.252361] coresight_register+0x88/0x250 [ 526.256587] funnel_probe+0x15c/0x228 [ 526.260365] dynamic_funnel_probe+0x20/0x2c [ 526.264679] amba_probe+0xbc/0x158 [ 526.268193] really_probe+0x144/0x408 [ 526.271970] driver_probe_device+0x70/0x140 ... [ 526.316810] [ 526.318364] Freed by task 0: [ 526.321344] (stack is not available) [ 526.325024] [ 526.326580] The buggy address belongs to the object at ffffff8135f95480 [ 526.326580] which belongs to the cache kmalloc-128 of size 128 [ 526.339439] The buggy address is located 28 bytes inside of [ 526.339439] 128-byte region [ffffff8135f95480, ffffff8135f95500) [ 526.351399] The buggy address belongs to the page: [ 526.356342] page:ffffffff04b7e500 refcount:1 mapcount:0 mapping:ffffff814b00c380 index:0x0 compound_mapcount: 0 [ 526.366711] flags: 0x4000000000010200(slab|head) [ 526.371475] raw: 4000000000010200 ffffffff05034008 ffffffff0501eb08 ffffff814b00c380 [ 526.379435] raw: 0000000000000000 0000000000190019 00000001ffffffff 0000000000000000 [ 526.387393] page dumped because: kasan: bad access detected [ 526.393128] [ 526.394681] Memory state around the buggy address: [ 526.399619] ffffff8135f95380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 526.407046] ffffff8135f95400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 526.414473] >ffffff8135f95480: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 526.421900] ^ [ 526.426029] ffffff8135f95500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 526.433456] ffffff8135f95580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 526.440883] ================================================================== To keep the code simple, we now track the maximum number of possible input/output connections to/from this component @ nr_inport and nr_outport in platform_data, respectively. Thus the output connections could be sparse and code is adjusted to skip the unspecified connections. Cc: Mathieu Poirier Cc: Mike Leach Reported-by: Sai Prakash Ranjan Tested-by: Sai Prakash Ranjan Tested-by: Stephen Boyd Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-13-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1c33c65cfea76d3dd92730353aac20f876c45747 Author: Jason Yan Date: Mon May 18 12:02:30 2020 -0600 coresight: etb10: Make coresight_etb_groups static Fix the following sparse warning: drivers/hwtracing/coresight/coresight-etb10.c:720:30: warning: symbol 'coresight_etb_groups' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-12-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit ebd9b6785099ffd029c7ec2ddb133dea53a65f2b Author: Jason Yan Date: Mon May 18 12:02:29 2020 -0600 coresight: cti: Make some symbols static Fix the following sparse warning: drivers/hwtracing/coresight/coresight-cti.c:22:1: warning: symbol 'ect_net' was not declared. Should it be static? drivers/hwtracing/coresight/coresight-cti.c:625:32: warning: symbol 'cti_ops_ect' was not declared. Should it be static? drivers/hwtracing/coresight/coresight-cti.c:630:28: warning: symbol 'cti_ops' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-11-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 41e8c7205cfd38014d4849b2c1d81f5712ec2c56 Author: Sai Prakash Ranjan Date: Mon May 18 12:02:28 2020 -0600 coresight: etm4x: Replace ETM PIDs with UCI IDs for Kryo385 Replace the AMBA ETM PIDs with UCI IDs to avoid future conflicts when adding the CTI support for QCOM Kryo385 CPU cores. Fixes: 17b4add0d4e0 ("coresight: etm4x: Add ETM PIDs for SDM845 and MSM8996") Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-10-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 63314ca20fe4353ea63a08b8cd83a1cdcd7c7c96 Author: Sai Prakash Ranjan Date: Mon May 18 12:02:27 2020 -0600 coresight: etm4x: Add support for Qualcomm SC7180 SoC Add ETM UCI IDs for Qualcomm SC7180 SoC. It has 2 big CPU cores based on Cortex-A76 and 6 LITTLE CPU cores based on Cortex-A55. Signed-off-by: Sai Prakash Ranjan Reviewed-by: Stephen Boyd Tested-by: Stephen Boyd Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-9-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7f06a1c989e565eaa80c0a2082d274e8bd7de570 Author: Mauro Carvalho Chehab Date: Mon May 18 12:02:26 2020 -0600 docs: trace: coresight-ect.rst: Fix a build warning Sphinx wants a line after "..", as otherwise it complains with: Documentation/trace/coresight/coresight-ect.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-8-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5153e57bf8b371d75c35fe37928bbd88a1b4bbe8 Author: Mike Leach Date: Mon May 18 12:02:25 2020 -0600 coresight: docs: Add information about the topology representations Update the CoreSight documents to describe the new connections directory and the links between CoreSight devices in this directory. Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-7-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 73274abb6557c934d4e1c852fe078c73b38eb114 Author: Mike Leach Date: Mon May 18 12:02:24 2020 -0600 coresight: cti: Add in sysfs links to other coresight devices Adds in sysfs links for connections where the connected device is another coresight device. This allows examination of the coresight topology. Non-coresight connections remain just as a reference name. Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-6-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8a7365c2d41898f2376efa929aadf2723dc281b0 Author: Suzuki K Poulose Date: Mon May 18 12:02:23 2020 -0600 coresight: Expose device connections via sysfs Coresight device connections are a bit complicated and is not exposed currently to the user. One has to look at the platform descriptions (DT bindings or ACPI bindings) to make an understanding. Given the new naming scheme, it will be helpful to have this information to choose the appropriate devices for tracing. This patch exposes the device connections via links in the sysfs directories. e.g, for a connection devA[OutputPort_X] -> devB[InputPort_Y] is represented as two symlinks: /sys/bus/coresight/.../devA/out:X -> /sys/bus/coresight/.../devB /sys/bus/coresight/.../devB/in:Y -> /sys/bus/coresight/.../devA Signed-off-by: Suzuki K Poulose [Revised to use the generic sysfs links functions & link structures. Provides a connections sysfs group in each device to hold the links.] Co-developed-by: Mike Leach Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-5-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 80961525880e58e0efcf536fd357d642c68f4176 Author: Mike Leach Date: Mon May 18 12:02:22 2020 -0600 coresight: Add generic sysfs link creation functions To allow the connections between coresight components to be represented in sysfs, generic methods for creating sysfs links between two coresight devices are added. Signed-off-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-4-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 68a5d5fccb4a010675a122d9ad0b5089a9896d1f Author: Suzuki K Poulose Date: Mon May 18 12:02:21 2020 -0600 coresight: Add return value for fixup connections Handle failures in fixing up connections for a newly registered device. This will be useful to handle cases where we fail to expose the links via sysfs for the connections. Signed-off-by: Suzuki K Poulose Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-3-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit d60250a459bb94b649986da369cacaed032ed653 Author: Suzuki K Poulose Date: Mon May 18 12:02:20 2020 -0600 coresight: Pass coresight_device for coresight_release_platform_data As we prepare to expose the links between the devices in sysfs, pass the coresight_device instance to the coresight_release_platform_data in order to free up the connections when the device is removed. No functional changes as such in this patch. Signed-off-by: Suzuki K Poulose Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200518180242.7916-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2bd7d8df3e5928138195a50aa51a47eff13502b2 Merge: 57c76221d5af 87eaea1cf8b3 Author: Greg Kroah-Hartman Date: Tue May 19 16:22:38 2020 +0200 Merge tag 'misc-habanalabs-next-2020-05-19' of git://people.freedesktop.org/~gabbayo/linux into char-misc-next Oded writes: This tag contains the following changes for kernel 5.8: - GAUDI ASIC support. The tag contains code and header files needed to initialize the GAUDI ASIC and run workloads on it. There are changes to the common code that are needed for GAUDI and there is the addition of new ASIC-dependent code of GAUDI. - Add new feature of signal/wait command submissions. This is relevant to GAUDI only and allows the user to sync between streams (queues) inside the device. - Allow user to retrieve the device time alongside the host time, to allow a user application to synchronize device time together with host time during profiling. - Change ASIC's CPU initialization by loading its boot loader code from the Host memory (instead of it being programmed on the on-board FLASH). - Expose more attributes through HWMON. - Move the ASIC event handling code to be "common code". This will be shared between GAUDI and future ASICs. Goya will still use its own code. - Fix bug in command submission parsing in Goya. - Small fixes to security configuration (open up some registers for user access). - Improvements to ASIC reset code. * tag 'misc-habanalabs-next-2020-05-19' of git://people.freedesktop.org/~gabbayo/linux: (38 commits) habanalabs: update patched_cb_size for Wreg32 habanalabs: move event handling to common firmware file habanalabs: enable gaudi code in driver habanalabs: add gaudi profiler module habanalabs: add gaudi security module habanalabs: add hwmgr module for gaudi habanalabs: add gaudi asic-dependent code uapi: habanalabs: add gaudi defines habanalabs: add gaudi asic registers header files habanalabs: get card type, location from F/W habanalabs: support clock gating enable/disable habanalabs: set PM profile to auto only for goya habanalabs: add dedicated define for hard reset habanalabs: check if CoreSight is supported habanalabs: add signal/wait to CS IOCTL operations habanalabs: handle the h/w sync object habanalabs: define ASIC-dependent interface for signal/wait uapi: habanalabs: add signal/wait operations habanalabs: add missing MODULE_DEVICE_TABLE habanalabs: print all CB handles as hex numbers ... commit 4dd31f1ffec6c370c3c2e0c605628bf5e16d5c46 Author: Gregory CLEMENT Date: Mon May 18 10:45:13 2020 +0200 tty: n_gsm: Fix bogus i++ in gsm_data_kick When submitting the previous fix "tty: n_gsm: Fix waking up upper tty layer when room available". It was suggested to switch from a while to a for loop, but when doing it, there was a remaining bogus i++. This patch removes this i++ and also reorganizes the code making it more compact. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20200518084517.2173242-3-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 57626ff1c9135211b92dfbea1923333c7b6dd12c Author: Gregory CLEMENT Date: Mon May 18 10:45:12 2020 +0200 tty: n_gsm: Remove unnecessary test in gsm_print_packet() If the length is zero then the print_hex_dump_bytes won't output anything, so testing the length before the call is unnecessary. Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20200518084517.2173242-2-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman commit f7e47677e39a03057dcced2016c92a9c868693ec Author: David Howells Date: Tue Jan 14 17:07:11 2020 +0000 watch_queue: Add a key/keyring notification facility Add a key/keyring change notification facility whereby notifications about changes in key and keyring content and attributes can be received. Firstly, an event queue needs to be created: pipe2(fds, O_NOTIFICATION_PIPE); ioctl(fds[1], IOC_WATCH_QUEUE_SET_SIZE, 256); then a notification can be set up to report notifications via that queue: struct watch_notification_filter filter = { .nr_filters = 1, .filters = { [0] = { .type = WATCH_TYPE_KEY_NOTIFY, .subtype_filter[0] = UINT_MAX, }, }, }; ioctl(fds[1], IOC_WATCH_QUEUE_SET_FILTER, &filter); keyctl_watch_key(KEY_SPEC_SESSION_KEYRING, fds[1], 0x01); After that, records will be placed into the queue when events occur in which keys are changed in some way. Records are of the following format: struct key_notification { struct watch_notification watch; __u32 key_id; __u32 aux; } *n; Where: n->watch.type will be WATCH_TYPE_KEY_NOTIFY. n->watch.subtype will indicate the type of event, such as NOTIFY_KEY_REVOKED. n->watch.info & WATCH_INFO_LENGTH will indicate the length of the record. n->watch.info & WATCH_INFO_ID will be the second argument to keyctl_watch_key(), shifted. n->key will be the ID of the affected key. n->aux will hold subtype-dependent information, such as the key being linked into the keyring specified by n->key in the case of NOTIFY_KEY_LINKED. Note that it is permissible for event records to be of variable length - or, at least, the length may be dependent on the subtype. Note also that the queue can be shared between multiple notifications of various types. Signed-off-by: David Howells Reviewed-by: James Morris commit cf5ffd22e409e2cb7a7adc1f69fbcb92c335e273 Author: Malcolm Priestley Date: Sat May 16 11:50:39 2020 +0100 staging: vt6656: use usb_anchor for tx queue. Use usb_anchor to track tx submitted urbs and initialize the urb as needed in vnt_tx_context. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/077f42f8-4f7f-adc4-5a14-955165cef9f1@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9786f8b2f79c61afb518c205663a78ecfcab0c64 Author: Malcolm Priestley Date: Sat May 16 11:44:57 2020 +0100 staging: vt6656: vnt_usb_send_context remove variable data. A limit is also placed in vnt_tx_context of MAX_TOTAL_SIZE_WITH_ALL_HEADERS limiting size. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/9416e1a8-bd72-ffb1-5366-78361d053907@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9deca1e3e2b682a2b1e40f8970f36e1703e27bfc Author: Malcolm Priestley Date: Sat May 16 11:39:34 2020 +0100 staging: vt6656: vnt_beacon_xmit use extra_tx_headroom. Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header. The struct ieee80211_mgmt is not longer in the header and is at the initial skb->data point. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/5f00d319-9242-65b2-d100-dcfe9b0e32be@gmail.com Signed-off-by: Greg Kroah-Hartman commit abfd23743d479137ad9912597ca13383f73f01f8 Author: Malcolm Priestley Date: Sat May 16 11:35:22 2020 +0100 staging: vt6656: Use sk_buff buffer for tx header mac80211 can provide space for the driver to put a tx header on the skb buffer instead coping the entire frame on to a local buffer with the header. To use this extra_tx_headroom must be set in mac80211 with the largest possible header which is struct vnt_tx_buffer. The driver has 8 possible combinations of tx header size which are found in vnt_get_hdr_size replacing vnt_mac_hdr_pos. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/7b967bfc-1d4b-4b45-efab-d54f16cca226@gmail.com Signed-off-by: Greg Kroah-Hartman commit 998f50407ffc9370565c7ed3fcd1366adccdfbbf Author: David Howells Date: Wed Feb 12 13:58:35 2020 +0000 security: Add hooks to rule on setting a watch Add security hooks that will allow an LSM to rule on whether or not a watch may be set. More than one hook is required as the watches watch different types of object. Signed-off-by: David Howells Acked-by: James Morris cc: Casey Schaufler cc: Stephen Smalley cc: linux-security-module@vger.kernel.org commit 16438cf707c924a675afba15d05a19ac2843e7d2 Author: Mohamed Dawod Date: Mon May 18 08:24:45 2020 +0200 staging: wfx: Typo fix Fixing some typo errors in traces.h file Signed-off-by: Mohamed Dawod Link: https://lore.kernel.org/r/20200518062445.GA13044@dinux Signed-off-by: Greg Kroah-Hartman commit 811eb344d5b092c4f4d0e0d61508743894cf2be0 Author: Xiangyang Zhang Date: Sun May 17 13:46:38 2020 +0800 staging: qlge: unmap dma when lock failed DMA not unmapped when lock failed, this patch fixed it. Signed-off-by: Xiangyang Zhang Fixes: 4322c5bee85e ("qlge: Expand coverage of hw lock for config register.") Link: https://lore.kernel.org/r/20200517054638.10764-1-xyz.sun.ok@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2493c61ed5de836c235ef9d4c56fdfeb012e2b59 Author: John Oldman Date: Sat May 16 17:33:27 2020 +0100 staging: rtl8192u: Using comparison to true is error prone fix below issue reported by checkpatch: CHECK: Using comparison to true is error prone CHECK: Using comparison to false is error prone Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200516163327.9197-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit 3ac5add11555cb93abd3c16b89c5a41be74cbb91 Author: John Oldman Date: Fri May 15 18:31:08 2020 +0100 staging: rtl8723bs: Using comparison to true is error prone fix below issue reported by checkpatch CHECK: Using comparison to true is error prone CHECK: Using comparison to false is error prone Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200515173108.14739-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit addf21ea64d1c0ccd5df77a7bad40a10e918e4c0 Author: John Oldman Date: Fri May 15 17:56:46 2020 +0100 Staging: rtl8723bs: os_de: if-else coding style issue Coding style issues: This patch clears the checkpatch.pl "braces {} are not necessary for single statement blocks" and "else_should_follow_close_brace" warnings. Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200515165646.12867-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit c73be61cede5882f9605a852414db559c0ebedfd Author: David Howells Date: Tue Jan 14 17:07:11 2020 +0000 pipe: Add general notification queue support Make it possible to have a general notification queue built on top of a standard pipe. Notifications are 'spliced' into the pipe and then read out. splice(), vmsplice() and sendfile() are forbidden on pipes used for notifications as post_one_notification() cannot take pipe->mutex. This means that notifications could be posted in between individual pipe buffers, making iov_iter_revert() difficult to effect. The way the notification queue is used is: (1) An application opens a pipe with a special flag and indicates the number of messages it wishes to be able to queue at once (this can only be set once): pipe2(fds, O_NOTIFICATION_PIPE); ioctl(fds[0], IOC_WATCH_QUEUE_SET_SIZE, queue_depth); (2) The application then uses poll() and read() as normal to extract data from the pipe. read() will return multiple notifications if the buffer is big enough, but it will not split a notification across buffers - rather it will return a short read or EMSGSIZE. Notification messages include a length in the header so that the caller can split them up. Each message has a header that describes it: struct watch_notification { __u32 type:24; __u32 subtype:8; __u32 info; }; The type indicates the source (eg. mount tree changes, superblock events, keyring changes, block layer events) and the subtype indicates the event type (eg. mount, unmount; EIO, EDQUOT; link, unlink). The info field indicates a number of things, including the entry length, an ID assigned to a watchpoint contributing to this buffer and type-specific flags. Supplementary data, such as the key ID that generated an event, can be attached in additional slots. The maximum message size is 127 bytes. Messages may not be padded or aligned, so there is no guarantee, for example, that the notification type will be on a 4-byte bounary. Signed-off-by: David Howells commit b580b93664f91db8cb503429030df0f1c1e53528 Author: David Howells Date: Wed Feb 12 13:58:35 2020 +0000 pipe: Add O_NOTIFICATION_PIPE Add an O_NOTIFICATION_PIPE flag that can be passed to pipe2() to indicate that the pipe being created is going to be used for notifications. This suppresses the use of splice(), vmsplice(), tee() and sendfile() on the pipe as calling iov_iter_revert() on a pipe when a kernel notification message has been inserted into the middle of a multi-buffer splice will be messy. The flag is given the same value as O_EXCL as it seems unlikely that this flag will ever be applicable to pipes and I don't want to use up another O_* bit unnecessarily. An alternative could be to add a pipe3() system call. Signed-off-by: David Howells commit 344fa64ef8f6740e99b32ab788b6e3742d7284b3 Author: David Howells Date: Wed Feb 12 13:58:35 2020 +0000 security: Add a hook for the point of notification insertion Add a security hook that allows an LSM to rule on whether a notification message is allowed to be inserted into a particular watch queue. The hook is given the following information: (1) The credentials of the triggerer (which may be init_cred for a system notification, eg. a hardware error). (2) The credentials of the whoever set the watch. (3) The notification message. Signed-off-by: David Howells Acked-by: James Morris cc: Casey Schaufler cc: Stephen Smalley cc: linux-security-module@vger.kernel.org commit 0858caa419e6cf9d31e734d09d70b34f64443ef6 Author: David Howells Date: Wed Feb 12 13:58:35 2020 +0000 uapi: General notification queue definitions Add UAPI definitions for the general notification queue, including the following pieces: (*) struct watch_notification. This is the metadata header for notification messages. It includes a type and subtype that indicate the source of the message (eg. WATCH_TYPE_MOUNT_NOTIFY) and the kind of the message (eg. NOTIFY_MOUNT_NEW_MOUNT). The header also contains an information field that conveys the following information: - WATCH_INFO_LENGTH. The size of the entry (entries are variable length). - WATCH_INFO_ID. The watch ID specified when the watchpoint was set. - WATCH_INFO_TYPE_INFO. (Sub)type-specific information. - WATCH_INFO_FLAG_*. Flag bits overlain on the type-specific information. For use by the type. All the information in the header can be used in filtering messages at the point of writing into the buffer. (*) struct watch_notification_removal This is an extended watch-removal notification record that includes an 'id' field that can indicate the identifier of the object being removed if available (for instance, a keyring serial number). Signed-off-by: David Howells commit 66e9b0717102507e64f638790eaece88765cc9e5 Author: Thomas Gleixner Date: Tue Mar 10 14:04:34 2020 +0100 kprobes: Prevent probes in .noinstr.text section Instrumentation is forbidden in the .noinstr.text section. Make kprobes respect this. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Masami Hiramatsu Link: https://lkml.kernel.org/r/20200505134100.179862032@linutronix.de commit 4e321b7746e54283362bfa41c833d9f9d5470a3b Merge: d85eaa941147 655389666643 Author: Thomas Gleixner Date: Tue May 19 15:55:45 2020 +0200 Merge tag 'noinstr-lds-2020-05-19' into core/kprobes Get the noinstr section and markers to base the kprobe changes on. commit 3a7c8fafd1b42adea229fd204132f6a2fb3cd2d9 Author: Thomas Gleixner Date: Fri Apr 24 09:57:56 2020 +0200 x86/kvm: Restrict ASYNC_PF to user space The async page fault injection into kernel space creates more problems than it solves. The host has absolutely no knowledge about the state of the guest if the fault happens in CPL0. The only restriction for the host is interrupt disabled state. If interrupts are enabled in the guest then the exception can hit arbitrary code. The HALT based wait in non-preemotible code is a hacky replacement for a proper hypercall. For the ongoing work to restrict instrumentation and make the RCU idle interaction well defined the required extra work for supporting async pagefault in CPL0 is just not justified and creates complexity for a dubious benefit. The CPL3 injection is well defined and does not cause any issues as it is more or less the same as a regular page fault from CPL3. Suggested-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Paolo Bonzini Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.369802541@linutronix.de commit 6bca69ada4bc20fa27eb44a5e09da3363d1752af Author: Thomas Gleixner Date: Sat Mar 7 00:42:06 2020 +0100 x86/kvm: Sanitize kvm_async_pf_task_wait() While working on the entry consolidation I stumbled over the KVM async page fault handler and kvm_async_pf_task_wait() in particular. It took me a while to realize that the randomly sprinkled around rcu_irq_enter()/exit() invocations are just cargo cult programming. Several patches "fixed" RCU splats by curing the symptoms without noticing that the code is flawed from a design perspective. The main problem is that this async injection is not based on a proper handshake mechanism and only respects the minimal requirement, i.e. the guest is not in a state where it has interrupts disabled. Aside of that the actual code is a convoluted one fits it all swiss army knife. It is invoked from different places with different RCU constraints: 1) Host side: vcpu_enter_guest() kvm_x86_ops->handle_exit() kvm_handle_page_fault() kvm_async_pf_task_wait() The invocation happens from fully preemptible context. 2) Guest side: The async page fault interrupted: a) user space b) preemptible kernel code which is not in a RCU read side critical section c) non-preemtible kernel code or a RCU read side critical section or kernel code with CONFIG_PREEMPTION=n which allows not to differentiate between #2b and #2c. RCU is watching for: #1 The vCPU exited and current is definitely not the idle task #2a The #PF entry code on the guest went through enter_from_user_mode() which reactivates RCU #2b There is no preemptible, interrupts enabled code in the kernel which can run with RCU looking away. (The idle task is always non preemptible). I.e. all schedulable states (#1, #2a, #2b) do not need any of this RCU voodoo at all. In #2c RCU is eventually not watching, but as that state cannot schedule anyway there is no point to worry about it so it has to invoke rcu_irq_enter() before running that code. This can be optimized, but this will be done as an extra step in course of the entry code consolidation work. So the proper solution for this is to: - Split kvm_async_pf_task_wait() into schedule and halt based waiting interfaces which share the enqueueing code. - Add comments (condensed form of this changelog) to spare others the time waste and pain of reverse engineering all of this with the help of uncomprehensible changelogs and code history. - Invoke kvm_async_pf_task_wait_schedule() from kvm_handle_page_fault(), user mode and schedulable kernel side async page faults (#1, #2a, #2b) - Invoke kvm_async_pf_task_wait_halt() for the non schedulable kernel case (#2c). For this case also remove the rcu_irq_exit()/enter() pair around the halt as it is just a pointless exercise: - vCPUs can VMEXIT at any random point and can be scheduled out for an arbitrary amount of time by the host and this is not any different except that it voluntary triggers the exit via halt. - The interrupted context could have RCU watching already. So the rcu_irq_exit() before the halt is not gaining anything aside of confusing the reader. Claiming that this might prevent RCU stalls is just an illusion. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Paolo Bonzini Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.262701431@linutronix.de commit ef68017eb5704eb2b0577c3aa6619e13caf2b59f Author: Andy Lutomirski Date: Fri Feb 28 10:42:48 2020 -0800 x86/kvm: Handle async page faults directly through do_page_fault() KVM overloads #PF to indicate two types of not-actually-page-fault events. Right now, the KVM guest code intercepts them by modifying the IDT and hooking the #PF vector. This makes the already fragile fault code even harder to understand, and it also pollutes call traces with async_page_fault and do_async_page_fault for normal page faults. Clean it up by moving the logic into do_page_fault() using a static branch. This gets rid of the platform trap_init override mechanism completely. [ tglx: Fixed up 32bit, removed error code from the async functions and massaged coding style ] Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Paolo Bonzini Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.169270470@linutronix.de commit 55484fcc5061c3f41b2f8f37b4a5754d3682f1a5 Author: Erwan Le Ray Date: Tue May 19 11:41:04 2020 +0200 serial: stm32: add no_console_suspend support In order to display console messages in low power mode, console pins must be kept active after suspend call. Initial patch "serial: stm32: add support for no_console_suspend" was part of "STM32 usart power improvement" series, but as dependancy to console_suspend pinctl state has been removed to fit with Rob comment [1], this patch has no more dependancy with any other patch of this series. [1] https://lkml.org/lkml/2019/7/9/451 Signed-off-by: Erwan Le Ray Link: https://lore.kernel.org/r/20200519094104.27082-1-erwan.leray@st.com Signed-off-by: Greg Kroah-Hartman commit b1fcf9b83c4149c63d1e0c699e85f93cbe28e211 Author: Thomas Gleixner Date: Tue May 12 09:44:43 2020 +0200 rcu: Provide __rcu_is_watching() Same as rcu_is_watching() but without the preempt_disable/enable() pair inside the function. It is merked noinstr so it ends up in the non-instrumentable text section. This is useful for non-preemptible code especially in the low level entry section. Using rcu_is_watching() there results in a call to the preempt_schedule_notrace() thunk which triggers noinstr section warnings in objtool. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200512213810.518709291@linutronix.de commit 8ae0ae6737ad449c8ae21e2bb01d9736f360a933 Author: Thomas Gleixner Date: Sun May 3 15:08:52 2020 +0200 rcu: Provide rcu_irq_exit_preempt() Interrupts and exceptions invoke rcu_irq_enter() on entry and need to invoke rcu_irq_exit() before they either return to the interrupted code or invoke the scheduler due to preemption. The general assumption is that RCU idle code has to have preemption disabled so that a return from interrupt cannot schedule. So the return from interrupt code invokes rcu_irq_exit() and preempt_schedule_irq(). If there is any imbalance in the rcu_irq/nmi* invocations or RCU idle code had preemption enabled then this goes unnoticed until the CPU goes idle or some other RCU check is executed. Provide rcu_irq_exit_preempt() which can be invoked from the interrupt/exception return code in case that preemption is enabled. It invokes rcu_irq_exit() and contains a few sanity checks in case that CONFIG_PROVE_RCU is enabled to catch such issues directly. Signed-off-by: Thomas Gleixner Reviewed-by: Paul E. McKenney Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134904.364456424@linutronix.de commit 9ea366f669ded353ae49754216c042e7d2f72ba6 Author: Paul E. McKenney Date: Thu Feb 13 12:31:16 2020 -0800 rcu: Make RCU IRQ enter/exit functions rely on in_nmi() The rcu_nmi_enter_common() and rcu_nmi_exit_common() functions take an "irq" parameter that indicates whether these functions have been invoked from an irq handler (irq==true) or an NMI handler (irq==false). However, recent changes have applied notrace to a few critical functions such that rcu_nmi_enter_common() and rcu_nmi_exit_common() many now rely on in_nmi(). Note that in_nmi() works no differently than before, but rather that tracing is now prohibited in code regions where in_nmi() would incorrectly report NMI state. Therefore remove the "irq" parameter and inline rcu_nmi_enter_common() and rcu_nmi_exit_common() into rcu_nmi_enter() and rcu_nmi_exit(), respectively. Signed-off-by: Paul E. McKenney Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134101.617130349@linutronix.de commit ff5c4f5cad33061b07c3fb9187506783c0f3cb66 Author: Thomas Gleixner Date: Fri Mar 13 17:32:17 2020 +0100 rcu/tree: Mark the idle relevant functions noinstr These functions are invoked from context tracking and other places in the low level entry code. Move them into the .noinstr.text section to exclude them from instrumentation. Mark the places which are safe to invoke traceable functions with instrumentation_begin/end() so objtool won't complain. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Acked-by: Paul E. McKenney Link: https://lkml.kernel.org/r/20200505134100.575356107@linutronix.de commit 0d00449c7a28a1514595630735df383dec606812 Author: Peter Zijlstra Date: Wed Feb 19 09:46:43 2020 +0100 x86: Replace ist_enter() with nmi_enter() A few exceptions (like #DB and #BP) can happen at any location in the code, this then means that tracers should treat events from these exceptions as NMI-like. The interrupted context could be holding locks with interrupts disabled for instance. Similarly, #MC is an actual NMI-like exception. All of them use ist_enter() which only concerns itself with RCU, but does not do any of the other setup that NMIs need. This means things like: printk() raw_spin_lock_irq(&logbuf_lock); <#DB/#BP/#MC> printk() raw_spin_lock_irq(&logbuf_lock); are entirely possible (well, not really since printk tries hard to play nice, but the concept stands). So replace ist_enter() with nmi_enter(). Also observe that any nmi_enter() caller must be both notrace and NOKPROBE, or in the noinstr text section. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134101.525508608@linutronix.de commit 5567d11c21a1d508a91a8cb64a819783a0835d9f Author: Peter Zijlstra Date: Wed Feb 19 10:22:06 2020 +0100 x86/mce: Send #MC singal from task work Convert #MC over to using task_work_add(); it will run the same code slightly later, on the return to user path of the same exception. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134100.957390899@linutronix.de commit b052df3da821adfd6be26a6eb16624fb50e90e56 Author: Thomas Gleixner Date: Thu Mar 5 00:52:41 2020 +0100 x86/entry: Get rid of ist_begin/end_non_atomic() This is completely overengineered and definitely not an interface which should be made available to anything else than this particular MCE case. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.462640294@linutronix.de commit f93524eb9c54f49be150167918f6546b0a2e09b1 Author: Peter Zijlstra Date: Wed Feb 12 21:01:16 2020 +0100 sched,rcu,tracing: Avoid tracing before in_nmi() is correct If a tracer is invoked before in_nmi() becomes true, the tracer can no longer detect it is called from NMI context and behave correctly. Therefore change nmi_{enter,exit}() to use __preempt_count_{add,sub}() as the normal preempt_count_{add,sub}() have a (desired) function trace entry. This fixes a potential issue with the current code; when the function-tracer has stack-tracing enabled __trace_stack() will malfunction when it hits the preempt_count_add() function entry from NMI context. Suggested-by: Steven Rostedt (VMware) Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Steven Rostedt (VMware) Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134101.434193525@linutronix.de commit 178ba00c354eb15cec6806a812771e60a5ae3ea1 Author: Peter Zijlstra Date: Mon Feb 24 22:26:21 2020 +0100 sh/ftrace: Move arch_ftrace_nmi_{enter,exit} into nmi exception SuperH is the last remaining user of arch_ftrace_nmi_{enter,exit}(), remove it from the generic code and into the SuperH code. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Steven Rostedt (VMware) Cc: Rich Felker Cc: Yoshinori Sato Link: https://lkml.kernel.org/r/20200505134101.248881738@linutronix.de commit e616cb8daadf637175af4fe53138a94c190c4816 Author: Peter Zijlstra Date: Mon Feb 24 22:14:51 2020 +0100 lockdep: Always inline lockdep_{off,on}() These functions are called {early,late} in nmi_{enter,exit} and should not be traced or probed. They are also puny, so 'inline' them. Reported-by: Steven Rostedt Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134101.048523500@linutronix.de commit 69ea03b56ed2c7189ccd0b5910ad39f3cad1df21 Author: Peter Zijlstra Date: Wed Feb 19 09:46:47 2020 +0100 hardirq/nmi: Allow nested nmi_enter() Since there are already a number of sites (ARM64, PowerPC) that effectively nest nmi_enter(), make the primitive support this before adding even more. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Marc Zyngier Acked-by: Will Deacon Cc: Michael Ellerman Link: https://lkml.kernel.org/r/20200505134100.864179229@linutronix.de commit 28f6bf9e247fe23d177cfdbf7e709270e8cc7fa6 Author: Frederic Weisbecker Date: Thu Feb 27 09:51:40 2020 +0100 arm64: Prepare arch_nmi_enter() for recursion When using nmi_enter() recursively, arch_nmi_enter() must also be recursion safe. In particular, it must be ensured that HCR_TGE is always set while in NMI context when in HYP mode, and be restored to it's former state when done. The current code fails this when interleaved wrong. Notably it overwrites the original hcr state on nesting. Introduce a nesting counter to make sure to store the original value. Signed-off-by: Frederic Weisbecker Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Cc: Will Deacon Cc: Catalin Marinas Link: https://lkml.kernel.org/r/20200505134100.771491291@linutronix.de commit b0f51883f551b900a04a80f49fb0886caf7e9a12 Author: Peter Zijlstra Date: Mon Feb 24 22:25:03 2020 +0100 printk: Disallow instrumenting print_nmi_enter() It happens early in nmi_enter(), no tracing, probing or other funnies allowed. Specifically as nmi_enter() will be used in do_debug(), which would cause recursive exceptions when kprobed. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134101.139720912@linutronix.de commit 8c4e93c362ff114def211d4629b120af86eb1275 Author: Petr Mladek Date: Mon Feb 24 13:13:31 2020 +0100 printk: Prepare for nested printk_nmi_enter() There is plenty of space in the printk_context variable. Reserve one byte there for the NMI context to be on the safe side. It should never overflow. The BUG_ON(in_nmi() == NMI_MASK) in nmi_enter() will trigger much earlier. Signed-off-by: Petr Mladek Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134100.681374113@linutronix.de commit 1ed0948eea079a4c802d08cdb2e8db1eee0860f1 Merge: 68f0f2690e18 655389666643 Author: Thomas Gleixner Date: Tue May 19 15:50:34 2020 +0200 Merge tag 'noinstr-lds-2020-05-19' into core/rcu Get the noinstr section and annotation markers to base the RCU parts on. commit af1e56b78534c38bb0e0c712ca70e59f816b74e9 Author: Thomas Gleixner Date: Thu Mar 19 14:53:56 2020 +0100 context_tracking: Make guest_enter/exit() .noinstr ready Force inlining of the helpers and mark the instrumentable parts accordingly. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134341.672545766@linutronix.de commit c86e9b987cea3dd0209203e714553a47f5d7c6dd Author: Peter Zijlstra Date: Wed Mar 18 14:22:03 2020 +0100 lockdep: Prepare for noinstr sections Force inlining and prevent instrumentation of all sorts by marking the functions which are invoked from low level entry code with 'noinstr'. Split the irqflags tracking into two parts. One which does the heavy lifting while RCU is watching and the final one which can be invoked after RCU is turned off. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134100.484532537@linutronix.de commit 0995a5dfbe49badff78e78761fb66f46579f2f9a Author: Thomas Gleixner Date: Wed Mar 4 13:09:50 2020 +0100 tracing: Provide lockdep less trace_hardirqs_on/off() variants trace_hardirqs_on/off() is only partially safe vs. RCU idle. The tracer core itself is safe, but the resulting tracepoints can be utilized by e.g. BPF which is unsafe. Provide variants which do not contain the lockdep invocation so the lockdep and tracer invocations can be split at the call site and placed properly. This is required because lockdep needs to be aware of the state before switching away from RCU idle and after switching to RCU idle because these transitions can take locks. As these code pathes are going to be non-instrumentable the tracer can be invoked after RCU is turned on and before the switch to RCU idle. So for these new variants there is no need to invoke the rcuidle aware tracer functions. Name them so they match the lockdep counterparts. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134100.270771162@linutronix.de commit 6553896666433e7efec589838b400a2a652b3ffa Author: Thomas Gleixner Date: Mon Mar 9 22:47:17 2020 +0100 vmlinux.lds.h: Create section for protection against instrumentation Some code pathes, especially the low level entry code, must be protected against instrumentation for various reasons: - Low level entry code can be a fragile beast, especially on x86. - With NO_HZ_FULL RCU state needs to be established before using it. Having a dedicated section for such code allows to validate with tooling that no unsafe functions are invoked. Add the .noinstr.text section and the noinstr attribute to mark functions. noinstr implies notrace. Kprobes will gain a section check later. Provide also a set of markers: instrumentation_begin()/end() These are used to mark code inside a noinstr function which calls into regular instrumentable text section as safe. The instrumentation markers are only active when CONFIG_DEBUG_ENTRY is enabled as the end marker emits a NOP to prevent the compiler from merging the annotation points. This means the objtool verification requires a kernel compiled with this option. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134100.075416272@linutronix.de commit 73da2352075adb24868229f9463736a5dd331b95 Author: Kangmin Park Date: Tue May 19 16:32:21 2020 +0900 spi: ti_qspi: fix unit address Fix unit address to match the first address specified in the reg property of the node in example. Signed-off-by: Kangmin Park Link: https://lore.kernel.org/r/1589873541-5587-1-git-send-email-l4stpr0gr4m@gmail.com Signed-off-by: Mark Brown commit 95325ab34c87f36d4940ea8101c122cbe512896e Merge: a62ed9606aae 1d3776669323 Author: Mark Brown Date: Tue May 19 14:18:53 2020 +0100 Merge series "Add Renoir ACP driver" from Vijendar Mukunda : This adds an ASoC driver for the ACP (Audio CoProcessor) block on AMD Renoir APUs. V3: - Changed PCI driver PM runtime sequence - Removed redundant code in Renoir machine driver V2: - Removed empty declaration of dai_ops - Removed SNDRV_PCM_INFO_BATCH flag - Defined Macros for delay and counter and corrected dma stop sequence. - Changed PCI driver pm runtime sequence - Removed redundant code Vijendar Mukunda (14): ASoC: amd: add Renoir ACP3x IP register header ASoC: amd: add Renoir ACP PCI driver ASoC: amd: add acp init/de-init functions ASoC: amd: create acp3x pdm platform device ASoC: amd: add ACP3x PDM platform driver ASoC: amd: irq handler changes for ACP3x PDM dma driver ASoC: amd: add acp3x pdm driver dma ops ASoC: amd: add ACP PDM DMA driver dai ops ASoC: amd: add Renoir ACP PCI driver PM ops ASoC: amd: add ACP PDM DMA driver pm ops ASoC: amd: enable Renoir acp3x drivers build ASoC: amd: create platform devices for Renoir ASoC: amd: RN machine driver using dmic ASoC: amd: enable build for RN machine driver sound/soc/amd/Kconfig | 13 + sound/soc/amd/Makefile | 1 + sound/soc/amd/renoir/Makefile | 7 + sound/soc/amd/renoir/acp3x-pdm-dma.c | 530 +++++++++++++++++++++ sound/soc/amd/renoir/acp3x-rn.c | 77 +++ sound/soc/amd/renoir/rn-pci-acp3x.c | 344 +++++++++++++ sound/soc/amd/renoir/rn_acp3x.h | 88 ++++ sound/soc/amd/renoir/rn_chip_offset_byte.h | 349 ++++++++++++++ 8 files changed, 1409 insertions(+) create mode 100644 sound/soc/amd/renoir/Makefile create mode 100644 sound/soc/amd/renoir/acp3x-pdm-dma.c create mode 100644 sound/soc/amd/renoir/acp3x-rn.c create mode 100644 sound/soc/amd/renoir/rn-pci-acp3x.c create mode 100644 sound/soc/amd/renoir/rn_acp3x.h create mode 100644 sound/soc/amd/renoir/rn_chip_offset_byte.h -- 2.26.2 commit a62ed9606aaebef00ca32da01e552bc0162c29b5 Author: Fabio Estevam Date: Mon May 18 15:54:48 2020 -0300 ASoC: fsl_micfil: Do not pass irq numbers in comments The IRQ numbers may change depending on the SoC, so do not pass the IRQ numbers in the comments. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200518185448.6116-2-festevam@gmail.com Signed-off-by: Mark Brown commit 1a90a659865299c04ba97b299ab02238dc392d5f Author: Fabio Estevam Date: Mon May 18 15:54:47 2020 -0300 ASoC: fsl_micfil: Remove unneeded ifdef's There is no need to use ifdef's around the power managament related functions, as they are already using the __maybe_unused notation. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200518185448.6116-1-festevam@gmail.com Signed-off-by: Mark Brown commit f8953043e6e24f9425249464605a541d00950709 Author: Shengjiu Wang Date: Tue May 12 18:22:59 2020 +0800 ASoC: fsl_asrc: Set ASR76K and ASR56K based on processing clock The processing clock is different for platforms, so it is better to set ASR76K and ASR56K based on processing clock, rather than hard coding the value for them. Signed-off-by: Shengjiu Wang Signed-off-by: Mihai Serban Link: https://lore.kernel.org/r/1589278979-31008-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit d49292025f79693d3348f8e2029a8b4703be0f0a Author: Tang Bin Date: Wed May 13 21:26:47 2020 +0800 USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe() The function ehci_mxc_drv_probe() does not perform sufficient error checking after executing platform_get_irq(), thus fix it. Fixes: 7e8d5cd93fac ("USB: Add EHCI support for MX27 and MX31 based boards") Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20200513132647.5456-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit a7f40c233a6b0540d28743267560df9cfb571ca9 Author: Colin Ian King Date: Fri May 15 17:54:53 2020 +0100 USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int The comparison of hcd->irq to less than zero for an error check will never be true because hcd->irq is an unsigned int. Fix this by assigning the int retval to the return of platform_get_irq and checking this for the -ve error condition and assigning hcd->irq to retval. Addresses-Coverity: ("Unsigned compared against 0") Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200515165453.104028-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 6b2fb79963fbed7db3ef850926d913518fd5c62f Author: Maxim Patlasov Date: Thu Sep 19 17:11:20 2019 +0300 fuse: optimize writepages search Re-work fi->writepages, replacing list with rb-tree. This improves performance because kernel fuse iterates through fi->writepages for each writeback page and typical number of entries is about 800 (for 100MB of fuse writeback). Before patch: 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 41.3473 s, 260 MB/s 2 1 0 57445400 40416 6323676 0 0 33 374743 8633 19210 1 8 88 3 0 29.86% [kernel] [k] _raw_spin_lock 26.62% [fuse] [k] fuse_page_is_writeback After patch: 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 21.4954 s, 500 MB/s 2 9 0 53676040 31744 10265984 0 0 64 854790 10956 48387 1 6 88 6 0 23.55% [kernel] [k] copy_user_enhanced_fast_string 9.87% [kernel] [k] __memcpy 3.10% [kernel] [k] _raw_spin_lock Signed-off-by: Maxim Patlasov Signed-off-by: Vasily Averin Signed-off-by: Miklos Szeredi commit 5ddd9ced9aef6cfa76af27d384c17c9e2d610ce8 Author: Miklos Szeredi Date: Tue May 19 14:50:38 2020 +0200 fuse: update attr_version counter on fuse_notify_inval_inode() A GETATTR request can race with FUSE_NOTIFY_INVAL_INODE, resulting in the attribute cache being updated with stale information after the invalidation. Fix this by bumping the attribute version in fuse_reverse_inval_inode(). Reported-by: Krzysztof Rusek Signed-off-by: Miklos Szeredi commit 32f98877c57bee6bc27f443a96f49678a2cd6a50 Author: Miklos Szeredi Date: Tue May 19 14:50:37 2020 +0200 fuse: don't check refcount after stealing page page_count() is unstable. Unless there has been an RCU grace period between when the page was removed from the page cache and now, a speculative reference may exist from the page cache. Reported-by: Matthew Wilcox Signed-off-by: Miklos Szeredi commit a5005c3cda6eeb6b95645e6cc32f58dafeffc976 Author: Miklos Szeredi Date: Tue May 19 14:50:37 2020 +0200 fuse: fix weird page warning When PageWaiters was added, updating this check was missed. Reported-by: Nikolaus Rath Reported-by: Hugh Dickins Fixes: 62906027091f ("mm: add PageWaiters indicating tasks are waiting for a page bit") Signed-off-by: Miklos Szeredi commit 00589386172ac577e64e3d67a3c5d4968174dcad Author: Miklos Szeredi Date: Tue May 19 14:50:37 2020 +0200 fuse: use dump_page Instead of custom page dumping, use the standard helper. Reported-by: Matthew Wilcox Signed-off-by: Miklos Szeredi commit 7fd3abfa8dd7c08ecacd25b2f9f9e1d3fb642440 Author: Vivek Goyal Date: Mon May 4 14:33:15 2020 -0400 virtiofs: do not use fuse_fill_super_common() for device installation fuse_fill_super_common() allocates and installs one fuse_device. Hence virtiofs allocates and install all fuse devices by itself except one. This makes logic little twisted. There does not seem to be any real need that why virtiofs can't allocate and install all fuse devices itself. So opt out of fuse device allocation and installation while calling fuse_fill_super_common(). Regular fuse still wants fuse_fill_super_common() to install fuse_device. It needs to prevent against races where two mounters are trying to mount fuse using same fd. In that case one will succeed while other will get -EINVAL. virtiofs does not have this issue because sget_fc() resolves the race w.r.t multiple mounters and only one instance of virtio_fs_fill_super() should be in progress for same filesystem. Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 5157da2ca42cbeca01709e29ce7b797cffed2432 Author: Miklos Szeredi Date: Tue May 19 14:50:37 2020 +0200 fuse: always allow query of st_dev Fuse mounts without "allow_other" are off-limits to all non-owners. Yet it makes sense to allow querying st_dev on the root, since this value is provided by the kernel, not the userspace filesystem. Allow statx(2) with a zero request mask to succeed on a fuse mounts for all users. Reported-by: Nikolaus Rath Signed-off-by: Miklos Szeredi commit 614c026e8a46636198da93ec30719f93975bb26a Author: Miklos Szeredi Date: Tue May 19 14:50:37 2020 +0200 fuse: always flush dirty data on close(2) We want cached data to synced with the userspace filesystem on close(), for example to allow getting correct st_blocks value. Do this regardless of whether the userspace filesystem implements a FLUSH method or not. Signed-off-by: Miklos Szeredi commit cf576c58b3a283333fc6e9a7c1c8e5342fa59b97 Author: Eryu Guan Date: Tue May 12 10:29:04 2020 +0800 fuse: invalidate inode attr in writeback cache mode Under writeback mode, inode->i_blocks is not updated, making utils du read st.blocks as 0. For example, when using virtiofs (cache=always & nondax mode) with writeback_cache enabled, writing a new file and check its disk usage with du, du reports 0 usage. # uname -r 5.6.0-rc6+ # mount -t virtiofs virtiofs /mnt/virtiofs # rm -f /mnt/virtiofs/testfile # create new file and do extend write # xfs_io -fc "pwrite 0 4k" /mnt/virtiofs/testfile wrote 4096/4096 bytes at offset 0 4 KiB, 1 ops; 0.0001 sec (28.103 MiB/sec and 7194.2446 ops/sec) # du -k /mnt/virtiofs/testfile 0 <==== disk usage is 0 # stat -c %s,%b /mnt/virtiofs/testfile 4096,0 <==== i_size is correct, but st_blocks is 0 Fix it by invalidating attr in fuse_flush(), so we get up-to-date attr from server on next getattr. Signed-off-by: Eryu Guan Signed-off-by: Miklos Szeredi commit 1d3776669323e71b00c99a178317fc46edbd09bb Author: Vijendar Mukunda Date: Tue May 19 01:17:04 2020 +0800 ASoC: amd: enable build for RN machine driver This patch enables build for RN machine driver. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-15-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 7ca448a518cf40e161051f0fb69f550a1a636324 Author: Vijendar Mukunda Date: Tue May 19 01:17:03 2020 +0800 ASoC: amd: RN machine driver using dmic This patch adds Renoir Machine driver for dmic support. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-14-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit b208c3bc33542ab5a689f9b7a5f6ffc1a3da2944 Author: Vijendar Mukunda Date: Tue May 19 01:17:02 2020 +0800 ASoC: amd: create platform devices for Renoir Create platform devices for generic dmic codec driver and machine driver. These platform devices required for creation of sound card. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-13-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit c15f258e6791e62c57d340c961de89261e48dc0a Author: Vijendar Mukunda Date: Tue May 19 01:17:01 2020 +0800 ASoC: amd: enable Renoir acp3x drivers build Renoir ACP3x drivers can be built by selecting necessary kernel config option. The patch enables build support of the same. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-12-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 35e4be1136e69710ffe559d173c9d66ff7d32730 Author: Vijendar Mukunda Date: Tue May 19 01:17:00 2020 +0800 ASoC: amd: add ACP PDM DMA driver pm ops Add ACP PDM DMA driver pm ops. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-11-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit c346e768f92cd6dbed474adf2f5eb3c9763a8bfa Author: Vijendar Mukunda Date: Tue May 19 01:16:59 2020 +0800 ASoC: amd: add Renoir ACP PCI driver PM ops Add Renoir ACP Pci driver pm ops. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-10-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 370e7dde5b3d71820e142b566683306940daeffe Author: Vijendar Mukunda Date: Tue May 19 01:16:58 2020 +0800 ASoC: amd: add ACP PDM DMA driver dai ops This patch adds ACP3x PDM DMA driver DAI operations. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-9-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 4a767b1d039a855c491c4853013804323c06f728 Author: Vijendar Mukunda Date: Tue May 19 01:16:57 2020 +0800 ASoC: amd: add acp3x pdm driver dma ops This patch adds PDM driver DMA operations. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-8-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit b9901654a90a367a74c34c76e0c8b4156bf539af Author: Vijendar Mukunda Date: Tue May 19 01:16:56 2020 +0800 ASoC: amd: irq handler changes for ACP3x PDM dma driver Whenever audio data equal to the PDM watermark level are consumed, interrupt is generated. Acknowledge the interrupt. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-7-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit f621a3676d3f52fcb8b7d8db8acbcc28423bcdb7 Author: Vijendar Mukunda Date: Tue May 19 01:16:55 2020 +0800 ASoC: amd: add ACP3x PDM platform driver PDM platform driver binds to the platform device created by ACP3x PCI device. PDM driver registers ALSA DMA and CPU DAI components with ASoC framework. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-6-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 66c4f558aa3a1b6f2b90981c364173af2f3d2c33 Author: Vijendar Mukunda Date: Tue May 19 01:16:54 2020 +0800 ASoC: amd: create acp3x pdm platform device ACP 3x IP has PDM decoder as one of IP blocks. Create a platform device for it, so that the PDM platform driver can be bound to this device. Pass PCI resources like MMIO, irq to this platform device. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-5-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 85ded495640e63282aa83583ab64304a9912303d Author: Vijendar Mukunda Date: Tue May 19 01:16:53 2020 +0800 ASoC: amd: add acp init/de-init functions Add Renoir ACP PCI driver init/deinit functions. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 1eb2852efe05abfa94cd78cc9865389643726ee9 Author: Vijendar Mukunda Date: Tue May 19 01:16:52 2020 +0800 ASoC: amd: add Renoir ACP PCI driver ACP is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 9b5e98e21467cd0a6c689db5ef971d7a61c73929 Author: Vijendar Mukunda Date: Tue May 19 01:16:51 2020 +0800 ASoC: amd: add Renoir ACP3x IP register header Add register header for ACP3x IP in Renoir platform. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518171704.24999-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 2bc61fbcc192f0b2e10e51e38f4f485ba5b293ca Author: Yong Wu Date: Tue May 19 15:57:44 2020 +0800 iommu/mediatek-v1: Fix a build warning for a unused variable 'data' This patch fixes a build warning: drivers/iommu/mtk_iommu_v1.c: In function 'mtk_iommu_release_device': >> drivers/iommu/mtk_iommu_v1.c:467:25: warning: variable 'data' set but >> not used [-Wunused-but-set-variable] 467 | struct mtk_iommu_data *data; | ^~~~ It's reported at: https://lore.kernel.org/linux-iommu/202005191458.gY38V8bU%25lkp@intel.com/T/#u Reported-by: kbuild test robot Signed-off-by: Yong Wu Link: https://lore.kernel.org/r/1589875064-662-1-git-send-email-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 78ef1b1ea193d1b977864f8c20968fcf4f1dbff4 Author: Vinod Koul Date: Tue May 19 15:00:02 2020 +0530 usb: xhci: make symbols static When renesas module is not built, we get compiler warning on xhci driver with W=1 CC [M] drivers/usb/host/xhci-rcar.o drivers/usb/host/xhci-pci.h:13:5: warning: no previous prototype for ‘renesas_xhci_check_request_fw’ [-Wmissing-prototypes] int renesas_xhci_check_request_fw(struct pci_dev *dev, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/usb/host/xhci-pci.h:19:6: warning: no previous prototype for ‘renesas_xhci_pci_exit’ [-Wmissing-prototypes] void renesas_xhci_pci_exit(struct pci_dev *dev) { }; ^~~~~~~~~~~~~~~~~~~~~ We have defined these symbols when CONFIG_USB_XHCI_PCI_RENESAS is not defined, but missed making then static. Reported-by: kbuild test robot Fixes: 8bd5741e3145 ("usb: renesas-xhci: Add the renesas xhci driver") Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200519093002.1152144-1-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit 5214028dd89e49ba27007c3ee475279e584261f0 Author: Arvind Sankar Date: Fri Feb 7 16:49:26 2020 -0500 x86/boot: Correct relocation destination on old linkers For the 32-bit kernel, as described in 6d92bc9d483a ("x86/build: Build compressed x86 kernels as PIE"), pre-2.26 binutils generates R_386_32 relocations in PIE mode. Since the startup code does not perform relocation, any reloc entry with R_386_32 will remain as 0 in the executing code. Commit 974f221c84b0 ("x86/boot: Move compressed kernel to the end of the decompression buffer") added a new symbol _end but did not mark it hidden, which doesn't give the correct offset on older linkers. This causes the compressed kernel to be copied beyond the end of the decompression buffer, rather than flush against it. This region of memory may be reserved or already allocated for other purposes by the bootloader. Mark _end as hidden to fix. This changes the relocation from R_386_32 to R_386_RELATIVE even on the pre-2.26 binutils. For 64-bit, this is not strictly necessary, as the 64-bit kernel is only built as PIE if the linker supports -z noreloc-overflow, which implies binutils-2.27+, but for consistency, mark _end as hidden here too. The below illustrates the before/after impact of the patch using binutils-2.25 and gcc-4.6.4 (locally compiled from source) and QEMU. Disassembly before patch: 48: 8b 86 60 02 00 00 mov 0x260(%esi),%eax 4e: 2d 00 00 00 00 sub $0x0,%eax 4f: R_386_32 _end Disassembly after patch: 48: 8b 86 60 02 00 00 mov 0x260(%esi),%eax 4e: 2d 00 f0 76 00 sub $0x76f000,%eax 4f: R_386_RELATIVE *ABS* Dump from extract_kernel before patch: early console in extract_kernel input_data: 0x0207c098 <--- this is at output + init_size input_len: 0x0074fef1 output: 0x01000000 output_len: 0x00fa63d0 kernel_total_size: 0x0107c000 needed_size: 0x0107c000 Dump from extract_kernel after patch: early console in extract_kernel input_data: 0x0190d098 <--- this is at output + init_size - _end input_len: 0x0074fef1 output: 0x01000000 output_len: 0x00fa63d0 kernel_total_size: 0x0107c000 needed_size: 0x0107c000 Fixes: 974f221c84b0 ("x86/boot: Move compressed kernel to the end of the decompression buffer") Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200207214926.3564079-1-nivedita@alum.mit.edu commit 9d78edeaec759f997c303f286ecd39daee166f2a Author: Alexey Gladkov Date: Mon May 18 20:07:38 2020 +0200 proc: proc_pid_ns takes super_block as an argument syzbot found that touch /proc/testfile causes NULL pointer dereference at tomoyo_get_local_path() because inode of the dentry is NULL. Before c59f415a7cb6, Tomoyo received pid_ns from proc's s_fs_info directly. Since proc_pid_ns() can only work with inode, using it in the tomoyo_get_local_path() was wrong. To avoid creating more functions for getting proc_ns, change the argument type of the proc_pid_ns() function. Then, Tomoyo can use the existing super_block to get pid_ns. Link: https://lkml.kernel.org/r/0000000000002f0c7505a5b0e04c@google.com Link: https://lkml.kernel.org/r/20200518180738.2939611-1-gladkov.alexey@gmail.com Reported-by: syzbot+c1af344512918c61362c@syzkaller.appspotmail.com Fixes: c59f415a7cb6 ("Use proc_pid_ns() to get pid_namespace from the proc superblock") Signed-off-by: Alexey Gladkov Signed-off-by: Eric W. Biederman commit ae7d292324b4be60b6d39d2e06bf2a63752f3fcd Author: Wei Yongjun Date: Tue May 19 09:18:57 2020 +0000 iommu/sun50i: Fix return value check in sun50i_iommu_probe() In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() not NULL. The NULL test in the return value check must be replaced with IS_ERR(). Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Acked-by: Maxime Ripard Link: https://lore.kernel.org/r/20200519091857.134170-1-weiyongjun1@huawei.com Signed-off-by: Joerg Roedel commit 87eaea1cf8b3357eed49fe93539788307bf8d971 Author: Rachel Stahl Date: Sun May 17 08:33:54 2020 +0300 habanalabs: update patched_cb_size for Wreg32 The patch_cb_size is not updated for Wreg32 in its validate function, so updated in goya_validate_cb. Signed-off-by: Rachel Stahl Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ebd8d1225165122162cab2826cdb015f68458971 Author: Ofir Bitton Date: Sun May 10 13:41:28 2020 +0300 habanalabs: move event handling to common firmware file Instead of writing similar event handling code for each ASIC, move the code to the common firmware file. This code will be used for GAUDI and all future ASICs. In addition, add two new fields to the auto-generated events file: valid and description. This will save the need to manually write the events description in the source code and simplify the code. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit af57cb81a6df58a3085fbe91f597f69efd4dea37 Author: Oded Gabbay Date: Mon May 11 10:47:05 2020 +0300 habanalabs: enable gaudi code in driver Enable the GAUDI ASIC code in the pci probe callback of the driver so the driver will handle GAUDI ASICs. Signed-off-by: Oded Gabbay commit 79fc7a9fffa8f6166315df6929c0cef5c9a04580 Author: Omer Shpigelman Date: Mon May 11 10:46:29 2020 +0300 habanalabs: add gaudi profiler module Add the GAUDI code to initialize the ASIC's profiler. The profile receives its initialization values from the user, same as in Goya, but the code to initialize is in the driver because the configuration space of the device is not directly exposed to the user. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3a3a5bf19639aff2a322105de8501ccfe944af4e Author: Omer Shpigelman Date: Mon May 11 10:45:12 2020 +0300 habanalabs: add gaudi security module Add the code to initialize the security module of GAUDI. Similar to Goya, we have two dedicated mechanisms for security: Range Registers and Protection bits. Those mechanisms protect sensitive memory and configuration areas inside the device. In addition, in Gaudi we moved to a 3-level security scheme, where the F/W runs with the highest security level (Privileged), the driver runs with a less secured level (Secured) and the user is neither privileged nor secured. The security module in the driver configures the Secured parts so the user won't be able to access them. The Privileged parts are configured by the F/W. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit bcaf415204e231be000d76c07f6dde22edabea6a Author: Oded Gabbay Date: Mon May 11 10:41:37 2020 +0300 habanalabs: add hwmgr module for gaudi The hwmgr module is responsible for messages sent to GAUDI F/W that are not common to all habanalabs ASICs. In GAUDI, we provide the user a simplified mode of controlling the ASIC clock frequency. Instead of three different clocks, we present a single clock property that the user can configure via sysfs. Signed-off-by: Oded Gabbay commit ac0ae6a96aa58eeba4aed97b12ef1dea8c5bf399 Author: Oded Gabbay Date: Mon May 11 10:29:27 2020 +0300 habanalabs: add gaudi asic-dependent code Add the ASIC-dependent code for GAUDI. Supply (almost) all of the function callbacks that the driver's common code need to initialize, finalize and submit workloads to the GAUDI ASIC. It also contains the code to initialize the F/W of the GAUDI ASIC and to receive events from the F/W. Signed-off-by: Oded Gabbay commit 466c7822b054ffe5bb425c8f98d08676501836e8 Author: Oded Gabbay Date: Mon May 11 10:32:10 2020 +0300 uapi: habanalabs: add gaudi defines Add the new defines for GAUDI uapi interface. It includes the queue IDs, the engine IDs, SRAM reserved space and Sync Manager reserved resources. There is no new IOCTL or additional operations in existing IOCTLs. Signed-off-by: Oded Gabbay commit 2aad2bf81c3341431e62d6c564508504324120a0 Author: Oded Gabbay Date: Sun May 3 17:33:40 2020 +0300 habanalabs: add gaudi asic registers header files Add the relevant GAUDI ASIC registers header files. These files are generated automatically from a tool maintained by the VLSI engineers. There are more files which are not upstreamed because only very few defines from those files are used in the driver. For those files, we copied the relevant defines into gaudi_regs.h and gaudi_masks.h, to reduce the size of this patch. Signed-off-by: Oded Gabbay commit fca72fbb661f95bed34aff2b9eb8806acab4643e Author: Omer Shpigelman Date: Sun May 3 17:35:54 2020 +0300 habanalabs: get card type, location from F/W For Gaudi the driver gets two new additional properties from the F/W: 1. The card's type - PCI or PMC 2. The card's location in the Gaudi's box (relevant only for PMC). The card's location is also passed to the user in the HW IP info structure as it needs this property for establishing communication between Gaudis. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ca62433f53d1ff48a4f77ef96332122558f90ad3 Author: Oded Gabbay Date: Sat May 9 12:17:21 2020 +0300 habanalabs: support clock gating enable/disable In Gaudi there is a feature of clock gating certain engines. Therefore, add this property to the device structure. In addition, due to a limitation of this feature, the driver needs to dynamically enable or disable this feature during run-time. Therefore, add ASIC interface functions to enable/disable this function from the common code. Moreover, this feature must be turned off when the user wishes to debug the ASIC by reading/writing registers and/or memory through the driver's debugfs. Therefore, add an option to enable/disable clock gating via the debugfs interface. Signed-off-by: Oded Gabbay commit 803917f960c2a34d16fb0aa6debb80fed59a58b7 Author: Oded Gabbay Date: Sat May 9 12:18:26 2020 +0300 habanalabs: set PM profile to auto only for goya For Gaudi, the driver doesn't change the PM profile automatically due to device-controlled PM capabilities. Therefore, set the PM profile to auto only for Goya so the driver's code to automatically change the profile won't run on Gaudi. Signed-off-by: Oded Gabbay commit e09498b078f85bbad8eccb665786bea847af93d4 Author: Omer Shpigelman Date: Sat May 9 12:18:01 2020 +0300 habanalabs: add dedicated define for hard reset Gaudi requires longer waiting during reset due to closing of network ports. Add this explanation to the relevant comment in the code and add a dedicated define for this reset timeout period, instead of multiplying another define. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9e5e49cd5b90cf53a6a403a04f003b8a9a084e46 Author: Omer Shpigelman Date: Sun May 10 14:10:15 2020 +0300 habanalabs: check if CoreSight is supported Coresight is not supported on simulator, therefore add a boolean for checking that (currently used by un-upstreamed code). Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b75f22505ac97ea680bcc3e23dcd56f421252b43 Author: Omer Shpigelman Date: Thu May 7 14:31:49 2020 +0300 habanalabs: add signal/wait to CS IOCTL operations Add the following two operations to the CS IOCTL: Signal: The signal operation is basically a command submission, that is created by the driver upon user request. It will be implemented using a dedicated PQE that will increment a specific SOB. There will be a new flag: HL_CS_FLAGS_SIGNAL. When the user set this flag in the CS IOCTL structure, the driver will execute a dedicated code path that will prepare this special PQE and submit it. The user only needs to provide a queue index on which to put the signal. Wait: The wait operation is also a command submission that is created by the driver upon user request. It will be implemented using a dedicated PQE that will contain packets of "ARM a monitor" + FENCE packet. There will be a new flag: HL_CS_FLAGS_WAIT. When the user set this flag in the CS structure, the driver will execute a dedicated code path that will prepare this special PQE and submit it. The user needs to provide the following parameters: 1. queue ID 2. an array of signal_seq numbers and the number of signals to wait on (the length of signal_seq_arr). The IOCTL will return the CS sequence number of the wait it put on the queue ID. Currently, the code supports signal_seq_nr==1. But this API definition will allow us to put a single PQE that waits on multiple signals. To correctly configure the monitor and fence, the driver will need to retrieve the specified signal CS object that contains the relevant SOB and its expected value. In case the signal CS has already been completed, there is no point of adding a wait operation. In this case, the driver will return to the user *without* putting anything on the PQ. The return code should reflect to the user that the signal was completed, as we won't return a CS sequence number for this wait. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b0b5d92579c0970ad1f96cd6d6297c8d8ed8ed92 Author: Omer Shpigelman Date: Thu May 7 13:57:36 2020 +0300 habanalabs: handle the h/w sync object Define a structure representing the h/w sync object (SOB). a SOB can contain up to 2^15 values. Each signal CS will increment the SOB by 1, so after some time we will reach the maximum number the SOB can represent. When that happens, the driver needs to move to a different SOB for the signal operation. A SOB can be in 1 of 4 states: 1. Working state with value < 2^15 2. We reached a value of 2^15, but the signal operations weren't completed yet OR there are pending waits on this signal. For the next submission, the driver will move to another SOB. 3. ALL the signal operations on the SOB have finished AND there are no more pending waits on the SOB AND we reached a value of 2^15 (This basically means the refcnt of the SOB is 0 - see explanation below). When that happens, the driver can clear the SOB by simply doing WREG32 0 to it and set the refcnt back to 1. 4. The SOB is cleared and can be used next time by the driver when it needs to reuse an SOB. Per SOB, the driver will maintain a single refcnt, that will be initialized to 1. When a signal or wait operation on this SOB is submitted to the PQ, the refcnt will be incremented. When a signal or wait operation on this SOB completes, the refcnt will be decremented. After the submission of the signal operation that increments the SOB to a value of 2^15, the refcnt is also decremented. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ec2f8a306ae96cba2a7437e783cc71f234789aa3 Author: Omer Shpigelman Date: Thu May 7 13:43:05 2020 +0300 habanalabs: define ASIC-dependent interface for signal/wait This feature requires handling h/w resources which are a bit different from one ASIC to the other. Therefore, we need to define a set of interfaces the ASIC code provides to the common code to signal, wait, reset sync object and to reset and init a queue. As this feature is not supported in Goya, provide an empty implementation of those functions. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f9e5f29518c1821d794bb7ec7e7c91650f4ded14 Author: Omer Shpigelman Date: Thu May 7 13:41:16 2020 +0300 uapi: habanalabs: add signal/wait operations This is a pre-requisite to upstreaming GAUDI support. Signal/wait operations are done by the user to perform sync between two Primary Queues (PQs). The sync is done using the sync manager and it is usually resolved inside the device, but sometimes it can be resolved in the host, i.e. the user should be able to wait in the host until a signal has been completed. The mechanism to define signal and wait operations is done by the driver because it needs atomicity and serialization, which is already done in the driver when submitting work to the different queues. To implement this feature, the driver "takes" a couple of h/w resources, and this is reflected by the defines added to the uapi file. The signal/wait operations are done via the existing CS IOCTL, and they use the same data structure. There is a difference in the meaning of some of the parameters, and for that we added unions to make the code more readable. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 824b4578391b08f6570e6259ba570b9f9d1f1438 Author: Oded Gabbay Date: Sun May 3 15:30:55 2020 +0300 habanalabs: add missing MODULE_DEVICE_TABLE PCI drivers should use this define to declare their PCI ID table. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit 0a62c3926ef560d78077abb301b755e725af1137 Author: Dotan Barak Date: Tue Apr 28 08:43:19 2020 +0300 habanalabs: print all CB handles as hex numbers Make all the CB handles printed in the same way and not some as decimal and some as hex numbers. Signed-off-by: Dotan Barak Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 010a118cfeb4909a443d08b4052b1f30a6ae1de1 Author: Oded Gabbay Date: Wed Apr 22 13:42:28 2020 +0300 habanalabs: update F/W register map Update the mapping to the latest one used by the Firmware. No impact on the driver in this update. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit aa9dd58bccbfd25ef17087c33530f9ee5153cfb0 Author: Adam Aharon Date: Wed Apr 22 09:37:54 2020 +0300 habanalabs: enable trace data compression (profiler) Set the STMTCSR.COMPEN bit to enable leading-zero trace data compression functionality for the extended stimulus ports. Signed-off-by: Adam Aharon Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 47f6b41cddf8497e19bc7dc46ab2e56aa8e875c9 Author: Ofir Bitton Date: Thu Apr 16 13:47:15 2020 +0300 habanalabs: load CPU device boot loader from host Load CPU device boot loader during driver boot time in order to avoid flash write for every boot loader update. To preserve backward-compatibility, skip the device boot load if the device doesn't request it. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 39b425170d35ff0841084007423f1b82f3b3e5ac Author: Oded Gabbay Date: Fri Apr 17 12:12:13 2020 +0300 habanalabs: leave space for 2xMSG_PROT in CB The user must leave space for 2xMSG_PROT in the external CB, so adjust the define of max size accordingly. The driver, however, can still create a CB with the maximum size of 2MB. Therefore, we need to add a check specifically for the user requested size. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit 8e708af2846fd1183ce2e5690e46155ee1342d25 Author: Christine Gharzuzi Date: Thu Apr 16 16:43:26 2020 +0300 habanalabs: support hwmon_reset_history attribute Support hwmon_temp_reset_histroy, hwmon_in_reset_history and hwmon_curr_reset attribute which resets the historical highest value. Signed-off-by: Christine Gharzuzi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 79c823c57e69d9e584a5ee4ee6406eb3854393ae Author: Tomer Tayar Date: Wed Apr 1 19:30:29 2020 +0300 habanalabs: Align protection bits configuration of all TPCs Align the protection bits configuration of all TPC cores to be as of TPC core 0. Fixes: a513f9a7eca5 ("habanalabs: make tpc registers secured") Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit eef544f746171eda1eb7e825cd41a6728dc60218 Author: Tomer Tayar Date: Tue Mar 31 20:00:30 2020 +0300 habanalabs: Allow access to TPC LFSR register Allow user access to TPC LFSR register, as it might be accessed by TPC kernels. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 25e7aeba601c1776cd21d610e3afc8768d0c7f2e Author: Tomer Tayar Date: Tue Mar 31 22:46:36 2020 +0300 habanalabs: Add INFO IOCTL opcode for time sync information Add a new opcode to the INFO IOCTL that retrieves the device time alongside the host time, to allow a user application that want to measure device time together with host time (such as a profiler) to synchronize these times. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ba7193c952f604a4e00a3f533d36733b47609e48 Author: kbuild test robot Date: Mon Apr 6 00:01:31 2020 +0800 habanalabs: hl_pci_set_dma_mask() can be static set function to be static as it is not called from outside its file. Signed-off-by: kbuild test robot Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fc7a3d9e9cd01e2679076c655f2bc4b04efbfa01 Author: Daniel Lezcano Date: Wed Apr 29 12:36:42 2020 +0200 thermal: cpuidle: Register cpuidle cooling device The cpuidle driver can be used as a cooling device by injecting idle cycles. When the property is set, register the cpuidle driver with the idle state node pointer as a cooling device. The thermal framework will do the association automatically with the thermal zone via the cooling-device defined in the device tree cooling-maps section. Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba Reviewed-by: Amit Kucheria Acked-by: Sudeep Holla Link: https://lore.kernel.org/r/20200429103644.5492-4-daniel.lezcano@linaro.org commit dfd0bda3703cdaf1fccd5da72cb7101a4fedfe68 Author: Daniel Lezcano Date: Wed Apr 29 12:36:41 2020 +0200 thermal/drivers/cpuidle_cooling: Change the registration function Today, there is no user for the cpuidle cooling device. The targetted platform is ARM and ARM64. The cpuidle and the cpufreq cooling device are based on the device tree. As the cpuidle cooling device can have its own configuration depending on the platform and the available idle states. The DT node description will give the optional properties to set the cooling device up. Do no longer rely on the CPU node which is prone to error and will lead to a confusion in the DT because the cpufreq cooling device is also using it. Let initialize the cpuidle cooling device with the DT binding. This was tested on: - hikey960 - hikey6220 - rock960 - db845c Acked-by: Viresh Kumar Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba Reviewed-by: Amit Kucheria Tested-by: Amit Kucheria Link: https://lore.kernel.org/r/20200429103644.5492-3-daniel.lezcano@linaro.org commit 3b25846fbbca2ee3aaa67fe5abb750806d28a98e Author: Daniel Lezcano Date: Wed Apr 29 12:36:40 2020 +0200 dt-bindings: thermal: Add the idle cooling device Some devices are not able to cool down by reducing their voltage / frequency because it could be not available or the system does not allow voltage scaling. In this configuration, it is not possible to use this strategy and the idle injection cooling device can be used instead. One idle cooling device is now present for the CPU as implemented by the combination of the idle injection framework belonging to the power capping framework and the thermal cooling device. The missing part is the DT binding providing a way to describe how the cooling device will work on the system. A first iteration was done by making the cooling device to point to the idle state. Unfortunately it does not make sense because it would need to duplicate the idle state description for each CPU in order to have a different phandle and make the thermal internal framework happy. It was proposed to add an cooling-cells to <3>, unfortunately the thermal framework is expecting a value of <2> as stated by the documentation and it is not possible from the cooling device generic code to loop this third value to the back end cooling device. Another proposal was to add a child 'thermal-idle' node as the SCMI does. This approach allows to have a self-contained configuration for the idle cooling device without colliding with the cpufreq cooling device which is based on the CPU node. In addition, it allows to have the cpufreq cooling device and the idle cooling device to co-exist together as shown in the example. Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Link: https://lore.kernel.org/r/20200429103644.5492-2-daniel.lezcano@linaro.org commit 333cff6c963fbc8b9820ca2b6a8b2e22a572cd43 Author: Daniel Lezcano Date: Wed Apr 29 12:36:39 2020 +0200 powercap/drivers/idle_inject: Specify idle state max latency Currently the idle injection framework uses the play_idle() function which puts the current CPU in an idle state. The idle state is the deepest one, as specified by the latency constraint when calling the subsequent play_idle_precise() function with the INT_MAX. The idle_injection is used by the cpuidle_cooling device which computes the idle / run duration to mitigate the temperature by injecting idle cycles. The cooling device has no control on the depth of the idle state. Allow finer control of the idle injection mechanism by allowing to specify the latency for the idle state. Thus the cooling device has the ability to have a guarantee on the exit latency of the idle states it is injecting. Acked-by: Rafael J. Wysocki Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Link: https://lore.kernel.org/r/20200429103644.5492-1-daniel.lezcano@linaro.org commit 2318976619daf0e868de5b8aff19c1fd8d585867 Author: Vincent Whitchurch Date: Thu May 14 11:36:41 2020 +0100 ARM: 8976/1: module: allow arch overrides for .init section names ARM stores unwind information for .init.text in sections named .ARM.extab.init.text and .ARM.exidx.init.text. Since those aren't currently recognized as init sections, they're allocated along with the core section, and relocation fails if the core and the init section are allocated from different regions and can't reach other. final section addresses: ... 0x7f800000 .init.text .. 0xcbb54078 .ARM.exidx.init.text .. section 16 reloc 0 sym '': relocation 42 out of range (0xcbb54078 -> 0x7f800000) Allow architectures to override the section name so that ARM can fix this. Acked-by: Jessica Yu Signed-off-by: Vincent Whitchurch Signed-off-by: Russell King commit cdcb07e45a911a5be9d38bb1aff1f6de019503b2 Author: Vincent Whitchurch Date: Thu May 14 11:36:42 2020 +0100 ARM: 8975/1: module: fix handling of unwind init sections Unwind information for init sections is placed in .ARM.exidx.init.text and .ARM.extab.init.text. The module core doesn't know that these are init sections so they are allocated along with the core sections, and if the core and init sections get allocated in different memory regions (which is possible with CONFIG_ARM_MODULE_PLTS=y) and they can't reach each other, relocation fails: final section addresses: ... 0x7f800000 .init.text .. 0xcbb54078 .ARM.exidx.init.text .. section 16 reloc 0 sym '': relocation 42 out of range (0xcbb54078 -> 0x7f800000) Fix this by informing the module core that these sections are init sections, and by removing the init unwind tables before the module core frees the init sections. Signed-off-by: Vincent Whitchurch Signed-off-by: Russell King commit 0697e5e06ea0d96e2d1508104ff3b13e4dddc4bb Author: Mike Rapoport Date: Tue May 12 18:11:19 2020 +0100 ARM: 8974/1: use SPARSMEM_STATIC when SPARSEMEM is enabled The commit 3e347261a80b5 ("[PATCH] sparsemem extreme implementation") made SPARSMEM_EXTREME the default option for configurations that enable SPARSEMEM. For ARM systems with handful of memory banks SPARSEMEM_EXTREME is an overkill. Ensure that SPARSMEM_STATIC is enabled in the configurations that use SPARSEMEM. Fixes: 3e347261a80b5 ("[PATCH] sparsemem extreme implementation") Acked-by: Florian Fainelli Signed-off-by: Mike Rapoport Signed-off-by: Russell King commit d43e2675e96fc6ae1a633b6a69d296394448cc32 Author: Paolo Bonzini Date: Tue May 19 05:34:41 2020 -0400 KVM: x86: only do L1TF workaround on affected processors KVM stores the gfn in MMIO SPTEs as a caching optimization. These are split in two parts, as in "[high 11111 low]", to thwart any attempt to use these bits in an L1TF attack. This works as long as there are 5 free bits between MAXPHYADDR and bit 50 (inclusive), leaving bit 51 free so that the MMIO access triggers a reserved-bit-set page fault. The bit positions however were computed wrongly for AMD processors that have encryption support. In this case, x86_phys_bits is reduced (for example from 48 to 43, to account for the C bit at position 47 and four bits used internally to store the SEV ASID and other stuff) while x86_cache_bits in would remain set to 48, and _all_ bits between the reduced MAXPHYADDR and bit 51 are set. Then low_phys_bits would also cover some of the bits that are set in the shadow_mmio_value, terribly confusing the gfn caching mechanism. To fix this, avoid splitting gfns as long as the processor does not have the L1TF bug (which includes all AMD processors). When there is no splitting, low_phys_bits can be set to the reduced MAXPHYADDR removing the overlap. This fixes "npt=0" operation on EPYC processors. Thanks to Maxim Levitsky for bisecting this bug. Cc: stable@vger.kernel.org Fixes: 52918ed5fcf0 ("KVM: SVM: Override default MMIO mask if memory encryption is enabled") Signed-off-by: Paolo Bonzini commit cb7ee52284a244fd14caec73df0d49e02891aac4 Author: Aishwarya Ramakrishnan Date: Mon May 18 20:33:36 2020 +0530 drm/i915/gvt: Use ARRAY_SIZE for vgpu_types Prefer ARRAY_SIZE instead of using sizeof Fixes coccicheck warning: Use ARRAY_SIZE Reviewed-by: Chris Wilson Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200518150336.15265-1-aishwaryarj100@gmail.com commit 116788689bf8ca3c3337d8dd1a742c08342d2f62 Author: Nathan Chancellor Date: Fri May 15 19:35:45 2020 -0700 drm/i915: Mark check_shadow_context_ppgtt as maybe unused When CONFIG_DRM_I915_DEBUG_GEM is not set, clang warns: drivers/gpu/drm/i915/gvt/scheduler.c:884:1: warning: function 'check_shadow_context_ppgtt' is not needed and will not be emitted [-Wunneeded-internal-declaration] check_shadow_context_ppgtt(struct execlist_ring_context *c, struct intel_vgpu_mm *m) ^ 1 warning generated. This warning is similar to -Wunused-function but rather than warning that the function is completely unused, it warns that it is used in some expression within the file but that expression will be evaluated to a constant or be optimized away in the final assembly, essentially making it appeared used but really isn't. Usually, this happens when a function or variable is only used in sizeof, where it will appear to be used but will be evaluated at compile time and not be required to be emitted. In this case, the function is only used in GEM_BUG_ON, which is defined as BUILD_BUG_ON_INVALID, which intentionally follows this pattern. To fix this warning, add __maybe_unused to make it clear that this is intentional depending on the configuration. Fixes: bec3df930fbd ("drm/i915/gvt: Support PPGTT table load command") Link: https://github.com/ClangBuiltLinux/linux/issues/1027 Acked-by: Zhenyu Wang Signed-off-by: Nathan Chancellor Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200516023545.3332334-1-natechancellor@gmail.com commit d04996eac538611c1ac1fb7759d379f0d9358f74 Merge: e695dea067fc f354157a7d18 Author: Linus Walleij Date: Tue May 19 10:45:50 2020 +0200 Merge tag 'samsung-pinctrl-5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v5.8 Two fixes for S5Pv210 pinctrl driver: setting proper external interrupt wakeup mask and restoring external interrupt mask value after system suspend. commit 8fb331e10b63888e944a8a0dcf79b17e93b475ba Author: Arvind Sankar Date: Mon May 18 15:07:08 2020 -0400 efi/printf: Turn vsprintf into vsnprintf Implement vsnprintf instead of vsprintf to avoid the possibility of a buffer overflow. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-17-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit f97ca2c816748e3b7dee58775632f9e9269071e6 Author: Arvind Sankar Date: Mon May 18 15:07:07 2020 -0400 efi/printf: Abort on invalid format If we get an invalid conversion specifier, bail out instead of trying to fix it up. The format string likely has a typo or assumed we support something that we don't, in either case the remaining arguments won't match up with the remaining format string. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-16-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 6c4bcd8a46a98856c06ca3ba8a80f03a61e23960 Author: Arvind Sankar Date: Mon May 18 15:07:06 2020 -0400 efi/printf: Refactor code to consolidate padding and output Consolidate the actual output of the formatted text into one place. Fix a couple of edge cases: 1. If 0 is printed with a precision of 0, the printf specification says that nothing should be output, with one exception (2b). 2. The specification for octal alternate format (%#o) adds the leading zero not as a prefix as the 0x for hexadecimal is, but by increasing the precision if necessary to add the zero. This means that a. %#.2o turns 8 into "010", but 1 into "01" rather than "001". b. %#.o prints 0 as "0" rather than "", unlike the situation for decimal, hexadecimal and regular octal format, which all output an empty string. Reduce the space allocated for printing a number to the maximum actually required (22 bytes for a 64-bit number in octal), instead of the 66 bytes previously allocated. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-15-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit fb031937a86874e6d663542bdbd83e310c13610e Author: Arvind Sankar Date: Mon May 18 15:07:05 2020 -0400 efi/printf: Handle null string input Print "(null)" for 's' if the input is a NULL pointer. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-14-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit dec6119952eab7257624de5bd116a9e301ead5b7 Author: Arvind Sankar Date: Mon May 18 15:07:04 2020 -0400 efi/printf: Factor out integer argument retrieval Factor out the code to get the correct type of numeric argument into a helper function. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-13-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 3fbcf75bb41a0ff02189f6e873ba4c5d7c54c6a9 Author: Arvind Sankar Date: Mon May 18 15:07:03 2020 -0400 efi/printf: Factor out width/precision parsing Factor out the width/precision parsing into a helper function. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-12-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 7c30fd79168aeb83d11260246d93f8a293052007 Author: Arvind Sankar Date: Mon May 18 15:07:02 2020 -0400 efi/printf: Merge 'p' with the integer formats Treat 'p' as a hexadecimal integer with precision equal to the number of digits in void *. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-11-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 77e48db04a02ebd00229281c26575979b0b465e0 Author: Arvind Sankar Date: Mon May 18 15:07:01 2020 -0400 efi/printf: Fix minor bug in precision handling A negative precision should be ignored completely, and the presence of a valid precision should turn off the 0 flag. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-10-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 3b8350959cba0df4070741618e50c367319793bb Author: Arvind Sankar Date: Mon May 18 15:07:00 2020 -0400 efi/printf: Factor out flags parsing and handle '%' earlier Move flags parsing code out into a helper function. The '%%' case can be handled up front: it is not allowed to have flags, width etc. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-9-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit ce5e3f909fc0ed67e58367b9c56a54c20a51080b Author: Arvind Sankar Date: Mon May 18 15:06:59 2020 -0400 efi/printf: Add 64-bit and 8-bit integer support Support 'll' qualifier for long long by copying the decimal printing code from lib/vsprintf.c. For simplicity, the 32-bit code is used on 64-bit architectures as well. Support 'hh' qualifier for signed/unsigned char type integers. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-8-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 29a2806653360f1ba0f7608ef64d65d441a575f7 Author: Arvind Sankar Date: Mon May 18 15:06:58 2020 -0400 efi/printf: Drop %n format and L qualifier %n is unused and deprecated. The L qualifer is parsed but not actually implemented. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-7-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit bbf8e8b0fe0401e1952c77088692fd273a9635a1 Author: Arvind Sankar Date: Mon May 18 15:06:57 2020 -0400 efi/libstub: Optimize for size instead of speed Reclaim the bloat from the addition of printf by optimizing the stub for size. With gcc 9, the text size of the stub is: ARCH before +printf -Os arm 35197 37889 34638 arm64 34883 38159 34479 i386 18571 21657 17025 x86_64 25677 29328 22144 Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-6-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 2c7d1e30e5884dc6f6727ecd9417491c9f321b59 Author: Arvind Sankar Date: Mon May 18 15:06:56 2020 -0400 efi/libstub: Add a basic printf implementation Copy vsprintf from arch/x86/boot/printf.c to get a simple printf implementation. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-5-nivedita@alum.mit.edu [ardb: add some missing braces in if...else clauses] Signed-off-by: Ard Biesheuvel commit 2b99e6196663199409540fb95798dba464e34343 Author: Johan Jonker Date: Tue Apr 28 22:30:03 2020 +0200 arm64: dts: rockchip: fix pd_tcpc0 and pd_tcpc1 node position on rk3399 The pd_tcpc0 and pd_tcpc1 nodes are currently a sub node of pd_vio. In the rk3399 TRM figure of the 'Power Domain Partition' and in the table of 'Power Domain and Voltage Domain Summary' these power domains are positioned directly under VD_LOGIC, so fix that in 'rk3399.dtsi'. Signed-off-by: Johan Jonker Reviewed-by: Caesar Wang Link: https://lore.kernel.org/r/20200428203003.3318-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 986c1748c84d7727defeaeca74a73b37f7d5cce1 Author: Bin Liu Date: Wed May 13 16:36:46 2020 -0500 USB: serial: usb_wwan: do not resubmit rx urb on fatal errors usb_wwan_indat_callback() shouldn't resubmit rx urb if the previous urb status is a fatal error. Or the usb controller would keep processing the new urbs then run into interrupt storm, and has no chance to recover. Fixes: 6c1ee66a0b2b ("USB-Serial: Fix error handling of usb_wwan") Cc: stable@vger.kernel.org Signed-off-by: Bin Liu Signed-off-by: Johan Hovold commit fd0528a24958b7e8d55669cf50749776308d4c5a Author: Arvind Sankar Date: Mon May 18 15:06:55 2020 -0400 efi/libstub: Buffer output of efi_puts Use a buffer to convert the string to UTF-16. This will reduce the number of firmware calls required to print the string from one per character to one per string in most cases. Cast the input char to unsigned char before converting to efi_char16_t to avoid sign-extension in case there are any non-ASCII characters in the input. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-4-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit cb8c90a08c7f2f761919190093fca0611c1cece4 Author: Arvind Sankar Date: Mon May 18 15:06:54 2020 -0400 efi/libstub: Rename efi_[char16_]printk to efi_[char16_]puts These functions do not support formatting, unlike printk. Rename them to puts to make that clear. Move the implementations of these two functions next to each other. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-3-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 0b76735380224497e1c78a1bed606cbda83e3427 Author: Arvind Sankar Date: Mon May 18 15:06:53 2020 -0400 efi/libstub: Include dependencies of efistub.h Add #include directives for include files that efistub.h depends on, instead of relying on them having been included by the C source files prior to efistub.h. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200518190716.751506-2-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 26d970225d876437287ec47a60cf4a07fe08733d Author: Bard Liao Date: Tue May 19 01:43:22 2020 +0800 soundwire: master: add runtime pm support We need to enable runtime_pm on master device with generic helpers, so that a Slave-initiated wake is propagated to the bus parent. Signed-off-by: Bard Liao Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20200518174322.31561-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 7ceaa40b930e462ba0477ca6af34ec04d08181dc Author: Pierre-Louis Bossart Date: Tue May 19 01:43:21 2020 +0800 soundwire: bus_type: add sdw_master_device support In the existing SoundWire code, Master Devices are not explicitly represented - only SoundWire Slave Devices are exposed (the use of capital letters follows the SoundWire specification conventions). With the existing code, the bus is handled without using a proper device, and bus->dev typically points to a platform device. The right thing to do as discussed in multiple reviews is use a device for each bus. The sdw_master_device addition is done with minimal internal plumbing and not exposed externally. The existing API based on sdw_bus_master_add() and sdw_bus_master_delete() will deal with the sdw_master_device life cycle, which minimizes changes to existing drivers. Note that the Intel code will be modified in follow-up patches (no impact on any platform since the connection with ASoC is not supported upstream so far). Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20200518174322.31561-5-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit dbb50c7a9949506f750d59d9ba4d58f0ce8ccd42 Author: Bard Liao Date: Tue May 19 01:43:20 2020 +0800 soundwire: bus: add unique bus id Adding an unique id for each bus. Suggested-by: Vinod Koul Signed-off-by: Bard Liao Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20200518174322.31561-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 90acca1d54ad566b4af5f1030b4a4a2420ce2ef0 Author: Pierre-Louis Bossart Date: Tue May 19 01:43:19 2020 +0800 soundwire: bus_type: introduce sdw_slave_type and sdw_master_type this is a preparatory patch before the introduction of the sdw_master_type. The SoundWire slave support is slightly modified with the use of a sdw_slave_type, and the uevent handling move to slave.c (since it's not necessary for the master). No functionality change other than moving code around. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20200518174322.31561-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 5cab3ff2489ede5abffa6ad730708e087dc45a4d Author: Pierre-Louis Bossart Date: Tue May 19 01:43:18 2020 +0800 soundwire: bus: rename sdw_bus_master_add/delete, add arguments In preparation for future extensions, rename functions to use sdw_bus_master prefix and add a parent and fwnode argument to sdw_bus_master_add to help with device registration in follow-up patches. No functionality change, just renames and additional arguments. The Intel code is currently unused, the two additional arguments are only needed for compilation. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20200518174322.31561-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 25ca180ad380a0c7286442a922e7fbcc6a9f6083 Author: Christophe JAILLET Date: Wed May 13 22:14:54 2020 +0200 ath11k: Fix some resource leaks in error path in 'ath11k_thermal_register()' If 'thermal_cooling_device_register()' fails, we must undo what has been allocated so far. So we must go to 'err_thermal_destroy' instead of returning directly In case of error in 'ath11k_thermal_register()', the previous 'thermal_cooling_device_register()' call must also be undone. Move the 'ar->thermal.cdev = cdev' a few lines above in order for this to be done in 'ath11k_thermal_unregister()' which is called in the error handling path. Fixes: 2a63bbca06b2 ("ath11k: add thermal cooling device support") Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200513201454.258111-1-christophe.jaillet@wanadoo.fr commit df00731cffa0edb454ee0c490696ce0c1745e680 Author: Vinod Koul Date: Tue May 19 10:36:22 2020 +0530 usb: xhci: fix USB_XHCI_PCI depends The xhci-pci-renesas module exports symbols for xhci-pci to load the RAM/ROM on renesas xhci controllers. We had dependency which works when both the modules are builtin or modules. But if xhci-pci is inbuilt and xhci-pci-renesas in module, we get below linker error: drivers/usb/host/xhci-pci.o: In function `xhci_pci_remove': drivers/usb/host/xhci-pci.c:411: undefined reference to `renesas_xhci_pci_exit' drivers/usb/host/xhci-pci.o: In function `xhci_pci_probe': drivers/usb/host/xhci-pci.c:345: undefined reference to `renesas_xhci_check_request_fw' Fix this by adding USB_XHCI_PCI having depends on USB_XHCI_PCI_RENESAS || !USB_XHCI_PCI_RENESAS so that both can be either inbuilt or modules. Reported-by: Anders Roxell Fixes: a66d21d7dba8 ("usb: xhci: Add support for Renesas controller with memory") Tested-by: Anders Roxell Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200519050622.994908-1-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit d30b16a556b62e921c0b1750f0e214118a28f31f Author: Sandeep Maheswaram Date: Fri May 15 08:09:18 2020 +0530 phy: qcom-qmp: Add QMP V3 USB3 PHY support for SC7180 Adding QMP v3 USB3 PHY support for SC7180. Adding only usb phy reset in the list to avoid reset of DP block. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1589510358-3865-5-git-send-email-sanm@codeaurora.org Signed-off-by: Vinod Koul commit 4ad7d7eeed3a86846f6fd583a532fbbdf6f47fff Author: Sandeep Maheswaram Date: Fri May 15 08:09:17 2020 +0530 dt-bindings: phy: qcom,qmp-usb3-dp: Add support for SC7180 Add compatible for SC7180 in QMP USB3 DP PHY bindings. Signed-off-by: Sandeep Maheswaram Link: https://lore.kernel.org/r/1589510358-3865-4-git-send-email-sanm@codeaurora.org Signed-off-by: Vinod Koul commit 59351049ad15b3cb1285260b32af6b9439932c99 Author: Sandeep Maheswaram Date: Fri May 15 08:09:16 2020 +0530 dt-bindings: phy: qcom,qmp-usb3-dp: Add dt bindings for USB3 DP PHY Split out the dt bindings for USB3 DP PHY from qcom,qmp bindings for modularity. Signed-off-by: Sandeep Maheswaram Link: https://lore.kernel.org/r/1589510358-3865-3-git-send-email-sanm@codeaurora.org Signed-off-by: Vinod Koul commit ccf51c1cedfd5bd1a0ecf6a33059dbdab3d3a9ef Author: Sandeep Maheswaram Date: Fri May 15 08:09:15 2020 +0530 dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml Convert QMP PHY bindings to DT schema format using json-schema. Signed-off-by: Sandeep Maheswaram Link: https://lore.kernel.org/r/1589510358-3865-2-git-send-email-sanm@codeaurora.org Signed-off-by: Vinod Koul commit 0ca2ddb0cd3c587ca50a29af7969bbfecbc3d663 Author: Eric Biggers Date: Tue May 12 16:32:51 2020 -0700 fscrypt: make test_dummy_encryption use v2 by default Since v1 encryption policies are deprecated, make test_dummy_encryption test v2 policies by default. Note that this causes ext4/023 and ext4/028 to start failing due to known bugs in those tests (see previous commit). Link: https://lore.kernel.org/r/20200512233251.118314-5-ebiggers@kernel.org Reviewed-by: Jaegeuk Kim Reviewed-by: Theodore Ts'o Signed-off-by: Eric Biggers commit ed318a6cc0b620440e65f48eb527dc3df7269ce4 Author: Eric Biggers Date: Tue May 12 16:32:50 2020 -0700 fscrypt: support test_dummy_encryption=v2 v1 encryption policies are deprecated in favor of v2, and some new features (e.g. encryption+casefolding) are only being added for v2. Therefore, the "test_dummy_encryption" mount option (which is used for encryption I/O testing with xfstests) needs to support v2 policies. To do this, extend its syntax to be "test_dummy_encryption=v1" or "test_dummy_encryption=v2". The existing "test_dummy_encryption" (no argument) also continues to be accepted, to specify the default setting -- currently v1, but the next patch changes it to v2. To cleanly support both v1 and v2 while also making it easy to support specifying other encryption settings in the future (say, accepting "$contents_mode:$filenames_mode:v2"), make ext4 and f2fs maintain a pointer to the dummy fscrypt_context rather than using mount flags. To avoid concurrency issues, don't allow test_dummy_encryption to be set or changed during a remount. (The former restriction is new, but xfstests doesn't run into it, so no one should notice.) Tested with 'gce-xfstests -c {ext4,f2fs}/encrypt -g auto'. On ext4, there are two regressions, both of which are test bugs: ext4/023 and ext4/028 fail because they set an xattr and expect it to be stored inline, but the increase in size of the fscrypt_context from 24 to 40 bytes causes this xattr to be spilled into an external block. Link: https://lore.kernel.org/r/20200512233251.118314-4-ebiggers@kernel.org Acked-by: Jaegeuk Kim Reviewed-by: Theodore Ts'o Signed-off-by: Eric Biggers commit 7d2f29e49477aa51339e719cf73f0945c39c8a9e Author: Maulik Shah Date: Mon May 18 17:50:02 2020 +0530 arm64: dts: qcom: sc7180: Correct the pdc interrupt ranges Few PDC interrupts do not map to respective parent GIC interrupt. Fix this by correcting the pdc interrupt map. Fixes: 22f185ee81d2 ("arm64: dts: qcom: sc7180: Add pdc interrupt controller") Cc: devicetree@vger.kernel.org Signed-off-by: Maulik Shah Link: https://lore.kernel.org/r/1589804402-27130-1-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit 5cdfe8306631b2224e3f81fc5a1e2721c7a1948b Author: Heiner Kallweit Date: Mon May 18 22:47:16 2020 +0200 r8169: work around an irq coalescing related tx timeout In [0] a user reported reproducible tx timeouts on RTL8168f except PktCntrDisable is set and irq coalescing is enabled. Realtek told me that they are not aware of any related hw issue on this chip version, therefore root cause is still unknown. It's not clear whether the issue affects one or more chip versions in general, or whether issue is specific to reporter's system. Due to this level of uncertainty, and due to the fact that I'm aware of this one report only, let's apply the workaround on net-next only. After this change setting irq coalescing via ethtool can reliably avoid the issue on the affected system. [0] https://bugzilla.kernel.org/show_bug.cgi?id=207205 Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit e2e5fb8d2f7aedb66fea0722f0f712cd37592a5d Author: Heiner Kallweit Date: Mon May 18 22:22:09 2020 +0200 r8169: improve rtl8169_mark_to_asic Let the compiler decide about inlining, and as confirmed by Eric it's better to use WRITE_ONCE here to ensure that the descriptor ownership is transferred to NIC immediately. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 588c7e5cc04805fae17cac51e77107841b0c62b0 Author: Heiner Kallweit Date: Mon May 18 22:14:21 2020 +0200 r8169: make rtl_rx better readable Avoid the goto from the rx error handling branch into the else branch, and in general avoid having the main rx work in the else branch. In addition ensure proper reverse xmas tree order of variables in the for loop. No functional change intended. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 35e43c392bf8bb38eb96ddada984bbdfd9e102a0 Author: Andy Shevchenko Date: Mon May 18 22:21:28 2020 +0300 net: seeq: Use %pM format specifier for MAC addresses Convert to %pM instead of using custom code. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 0992b49023d0ae3c2786e81821619504c57e7629 Author: Andy Shevchenko Date: Mon May 18 22:18:31 2020 +0300 cxgb4: Use %pM format specifier for MAC addresses Convert to %pM instead of using custom code. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 19acc9c5d02bac9e8cbd3670c2bd579e148cf535 Merge: a307593a6444 dc13c8761c91 Author: David S. Miller Date: Mon May 18 17:35:02 2020 -0700 Merge branch 'move-the-SIOCDELRT-and-SIOCADDRT-compat_ioctl-handlers-v3' Christoph Hellwig says: ==================== move the SIOCDELRT and SIOCADDRT compat_ioctl handlers v3 this series moves the compat_ioctl handlers into the protocol handlers, avoiding the need to override the address space limited as in the current handler. Changes since v3: - moar variable reordering Changes since v1: - reorder a bunch of variable declarations ==================== Signed-off-by: David S. Miller commit dc13c8761c91c06acd3d98cd107f371cba9811b9 Author: Christoph Hellwig Date: Mon May 18 08:28:08 2020 +0200 ipv4,appletalk: move SIOCADDRT and SIOCDELRT handling into ->compat_ioctl To prepare removing the global routing_ioctl hack start lifting the code into the ipv4 and appletalk ->compat_ioctl handlers. Unlike the existing handler we don't bother copying in the name - there are no compat issues for char arrays. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit a50049235483b0337d129e2878e99750e4da3ac2 Author: Christoph Hellwig Date: Mon May 18 08:28:07 2020 +0200 appletalk: factor out a atrtr_ioctl_addrt helper Add a helper than can be shared with the upcoming compat ioctl handler. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 3986912f6a9aae50945fc9d3513c621381eba1aa Author: Christoph Hellwig Date: Mon May 18 08:28:06 2020 +0200 ipv6: move SIOCADDRT and SIOCDELRT handling into ->compat_ioctl To prepare removing the global routing_ioctl hack start lifting the code into a newly added ipv6 ->compat_ioctl handler. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 7c1552da900c159a13473a2106c7547746ebe4a1 Author: Christoph Hellwig Date: Mon May 18 08:28:05 2020 +0200 ipv6: lift copy_from_user out of ipv6_route_ioctl Prepare for better compat ioctl handling by moving the user copy out of ipv6_route_ioctl. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 5ddb2747ae2e6141edd3b1dd2ed96d4468394cc2 Author: Sasha Neftin Date: Sun Mar 29 14:35:54 2020 +0300 igc: Remove unneeded register Flow control status register not applicable for i225 parts so clean up the unneeded define. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 3494480ad503068d2c14a65e45a37c785a73349f Author: Sasha Neftin Date: Sun Mar 29 12:01:51 2020 +0300 igc: Remove unneeded definition PHY_FORCE_LIMIT definition not in use and could be removed i225 parts support auto negotiation mechanism Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit faf82d5bb1589fe4da36fc0e5b1119def97d887a Author: Andre Guedes Date: Tue Mar 24 17:38:19 2020 -0700 igc: Use netdev log helpers in igc_base.c This patch coverts one pr_debug() call to hw_dbg() in order to keep log output aligned with the rest of the driver. hw_dbg() is actually a macro defined in igc_hw.h that expands to netdev_dbg(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 5c32bac98c705ce409ac26b5120c14ece8bd9209 Author: Andre Guedes Date: Tue Mar 24 17:38:18 2020 -0700 igc: Use netdev log helpers in igc_dump.c In igc_dump.c we print log messages using dev_* and pr_* helpers, generating inconsistent output with the rest of the driver. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense out of the logs. This patch converts all dev_* and pr_* calls to netdev_*. Quick note about igc_rings_dump(): This function is always called with valid adapter->netdev so there is not need to check it. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 916a3c650763fbe1e1d37af105a82fee26da45a5 Author: Andre Guedes Date: Tue Mar 24 17:38:17 2020 -0700 igc: Use netdev log helpers in igc_ptp.c In igc_ptp.c we print log messages using dev_* helpers, generating inconsistent output with the rest of the driver. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense out of the logs. This patch converts all dev_* calls to netdev_*. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 95f96a9f2d04b20c26fca405f640acea07cf8b53 Author: Andre Guedes Date: Tue Mar 24 17:38:16 2020 -0700 igc: Use netdev log helpers in igc_ethtool.c In igc_ethtool.c we print log messages using dev_* helpers, generating inconsistent output with the rest of the driver. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense the of the logs. This patch converts all dev_* calls to netdev_*. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 1ec5dbef6803293974f262f69b63f19d2ed4f6ba Author: Paul Cercueil Date: Fri May 15 12:43:40 2020 +0200 MAINTAINERS: Add myself as reviewer for Ingenic rproc driver Add myself as the reviewer for the Ingenic VPU remoteproc driver. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200515104340.10473-5-paul@crapouillou.net Signed-off-by: Bjorn Andersson commit 48f0a1bbb7586c94e0f15116b06f8179df2fd60f Author: Paul Cercueil Date: Fri May 15 12:43:39 2020 +0200 remoteproc: ingenic: Added remoteproc driver This driver is used to boot, communicate with and load firmwares to the MIPS co-processor found in the VPU hardware of the JZ47xx SoCs from Ingenic. Signed-off-by: Paul Cercueil Acked-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200515104340.10473-4-paul@crapouillou.net Signed-off-by: Bjorn Andersson commit a307593a644443db12888f45eed0dafb5869e2cc Author: Doug Berger Date: Mon May 18 15:23:59 2020 -0700 net: phy: simplify phy_link_change arguments This function was introduced to allow for different handling of link up and link down events particularly with regard to the netif_carrier. The third argument do_carrier allowed the flag to be left unchanged. Since then the phylink has introduced an implementation that completely ignores the third parameter since it never wants to change the flag and the phylib always sets the third parameter to true so the flag is always changed. Therefore the third argument (i.e. do_carrier) is no longer necessary and can be removed. This also means that the phylib phy_link_down() function no longer needs its second argument. Signed-off-by: Doug Berger Signed-off-by: David S. Miller commit a99a37f6cd5a74d5b22c08544aa6c5890813c8ba Author: Paul Cercueil Date: Fri May 15 12:43:38 2020 +0200 remoteproc: Add support for runtime PM Call pm_runtime_get_sync() before the firmware is loaded, and pm_runtime_put() after the remote processor has been stopped. Even though the remoteproc device has no PM callbacks, this allows the parent device's PM callbacks to be properly called. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200515104340.10473-3-paul@crapouillou.net Signed-off-by: Bjorn Andersson commit 4e399b3ba8b937aaa49df836117ce4dc39bf3fcd Author: Paul Cercueil Date: Fri May 15 12:43:36 2020 +0200 dt-bindings: Document JZ47xx VPU auxiliary processor Inside the Video Processing Unit (VPU) of the recent JZ47xx SoCs from Ingenic is a second Xburst MIPS CPU very similar to the main core. This document describes the devicetree bindings for this auxiliary processor. Signed-off-by: Paul Cercueil Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200515104340.10473-1-paul@crapouillou.net Signed-off-by: Bjorn Andersson commit 5ef3c35809ec74ab41a5cf93a5b6d60167661113 Author: Alex Elder Date: Mon May 18 16:54:55 2020 -0500 arm64: defconfig: enable Qualcomm IPA and RMNet modules Enable building the Qualcomm IPA driver as a kernel module. To be useful, the IPA driver also requires RMNet, so enable building that as a module as well. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20200518215455.10095-1-elder@linaro.org Signed-off-by: Bjorn Andersson commit d82fade846aa8bb34956120e3792f494058ec35e Author: Alex Elder Date: Mon May 18 16:49:39 2020 -0500 arm64: dts: qcom: sc7180: add IPA information Add IPA-related nodes and definitions to "sc7180.dtsi". Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20200518214939.9730-1-elder@linaro.org Signed-off-by: Bjorn Andersson commit 54b1a4e070330c3fba5becfb0b619bf360bc2657 Author: Justin Swartz Date: Sun Apr 19 12:51:33 2020 +0000 ARM: dts: rockchip: add rga node for rk322x Add a node to define the presence of RGA, a 2D raster graphic acceleration unit. Signed-off-by: Justin Swartz Link: https://lore.kernel.org/r/20200419125134.29923-2-justin.swartz@risingedge.co.za Signed-off-by: Heiko Stuebner commit 2dd579fc969882c0036433a74446ba5e57ffab2d Author: Justin Swartz Date: Mon Apr 6 13:50:05 2020 +0000 ARM: dts: remove disable-wp from rk3229-xms6 emmc Remove the disable-wp attribute from &emmc as it is, according to Documentation/devicetree/bindings/mmc/mmc-controller.yaml: "Not used in combination with eMMC or SDIO." Suggested-by: Johan Jonker Signed-off-by: Justin Swartz Link: https://lore.kernel.org/r/20200406135006.23759-2-justin.swartz@risingedge.co.za Signed-off-by: Heiko Stuebner commit 6067ec2c7ffacab4689ddfed3df74a467d112efe Author: Justin Swartz Date: Mon Apr 6 13:50:04 2020 +0000 ARM: dts: enable WLAN for Mecer Xtreme Mini S6 The Mecer Xtreme Mini S6 features a wireless module, based on a Realtek 8723BS, which provides WLAN and Bluetooth connectivity via SDIO and UART interfaces respectively. Define a simple MMC power sequence that declares the GPIO pins connected to the module's WLAN Disable and Bluetooth Disable pins as active low reset signals, because both signals must be deasserted for WLAN radio operation. Configure the host's SDIO interface for High Speed mode with 1.8v I/O signalling and IRQ detection over a 4-bit wide bus. Signed-off-by: Justin Swartz Link: https://lore.kernel.org/r/20200406135006.23759-1-justin.swartz@risingedge.co.za Signed-off-by: Heiko Stuebner commit fb0ab17f1ab750d9662ec6b9fb3aa541a8ac1f5c Author: Johan Jonker Date: Thu Apr 16 20:30:53 2020 +0200 arm64: dts: rockchip: add bus-width properties to mmc nodes for px30 'bus-width' and pinctrl containing the bus-pins should be in the same file, so add them to all mmc nodes in 'px30.dtsi'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200416183053.6045-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 439062737bc06232761196f07046872d0ce3f3d6 Author: Johan Jonker Date: Fri Apr 3 20:01:56 2020 +0200 ARM: dts: rockchip: remove identical #include from rk3288.dtsi There are 2 identical '#include' for 'rk3288-power.h', so remove one of them. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200403180159.13387-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit f0344b33546cee3ea887d41e07900226dec6a23a Author: Johan Jonker Date: Tue Apr 28 16:49:32 2020 +0200 ARM: dts: rockchip: rename and label gpio-led subnodes Current dts files with 'gpio-led' nodes were manually verified. In order to automate this process leds-gpio.txt has been converted to yaml. With this conversion a check for pattern properties was added. A test with the command below gives a screen full of warnings like: arch/arm/boot/dts/rk3188-radxarock.dt.yaml: gpio-leds: 'blue', 'green', 'sleep' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' Fix these errors with help of the following rules: 1: Add nodename in the preferred form. 2: Always add a label that ends with '_led' to prevent conflicts with other labels such as 'power' and 'mmc' 3: If leds need pinctrl add a label that ends with '_led_pin' also to prevent conflicts with other labels. patternProperties: # The first form is preferred, but fall back to just 'led' # anywhere in the node name to at least catch some child nodes. "(^led-[0-9a-f]$|led)": make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/ leds-gpio.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200428144933.10953-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 1fab4cf51e48e9525cf70a9604e90dd3dd666a2f Author: Johan Jonker Date: Thu Dec 19 13:19:54 2019 +0100 arm64: dts: rockchip: remove disable-wp from rk3308-roc-cc emmc node The mmc-controller.yaml didn't explicitly say disable-wp is for SD card slot only, but that is what it was designed for in the first place. Remove all disable-wp from emmc or sdio controllers. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20191219121954.2450-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit e916d85b922fed7be861f63e388214bba6f20719 Author: Johan Jonker Date: Tue Apr 28 16:49:33 2020 +0200 arm64: dts: rockchip: rename and label gpio-led subnodes Current dts files with 'gpio-led' nodes were manually verified. In order to automate this process leds-gpio.txt has been converted to yaml. With this conversion a check for pattern properties was added. A test with the command below gives a screen full of warnings like: arch/arm64/boot/dts/rockchip/rk3368-r88.dt.yaml: gpio-leds: 'work' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' Fix these errors with help of the following rules: 1: Add nodename in the preferred form. 2: Always add a label that ends with '_led' to prevent conflicts with other labels such as 'power' and 'mmc' 3: If leds need pinctrl add a label that ends with '_led_pin' also to prevent conflicts with other labels. patternProperties: # The first form is preferred, but fall back to just 'led' # anywhere in the node name to at least catch some child nodes. "(^led-[0-9a-f]$|led)": make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/ leds-gpio.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200428144933.10953-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 84836ded76ec9a6f25d1d0acebaad44977e0ec6f Author: Johan Jonker Date: Tue Apr 28 22:30:02 2020 +0200 arm64: dts: rockchip: fix defines in pd_vio node for rk3399 A test with the command below gives for example this error: arch/arm64/boot/dts/rockchip/rk3399-evb.dt.yaml: pd_vio@15: 'pd_tcpc0@RK3399_PD_TCPC0', 'pd_tcpc1@RK3399_PD_TCPC1' do not match any of the regexes: '.*-names$', '.*-supply$', '^#.*-cells$', '^#[a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+(,[0-9a-fA-F]+)*$', '^__.*__$', 'pinctrl-[0-9]+' Fix error by replacing the wrong defines by the ones mentioned in 'rk3399-power.h'. make -k ARCH=arm64 dtbs_check Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200428203003.3318-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit f026d8ca2904622298c5387c384dce04f119e87a Author: Vitaly Lifshits Date: Tue May 5 17:06:38 2020 +0300 igc: add support to eeprom, registers and link self-tests Introduced igc_diag.c and igc_diag.h, these files have the diagnostics functionality of igc driver. For the time being these files are being used by ethtool self-test callbacks. Which mean that eeprom, registers and link self-tests for ethtool were implemented. Signed-off-by: Vitaly Lifshits Reported-by: kbuild test robot Reported-by: Dan Carpenter Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 25f06eff7582ae41c7fdaa30a4a2348122f7a907 Author: Andre Guedes Date: Tue Mar 24 17:38:15 2020 -0700 igc: Use netdev log helpers in igc_main.c In igc_main.c we print log messages using both dev_* and netdev_* helpers, generating inconsistent output. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense out of the logs. This patch converts all dev_* calls to netdev_*. There is only two exceptions: 1) calls wihtin igc_probe (net_device has not been registered yet) 2) calls in igc_init_module (module initialization). It also takes this opportunity to improve some messages. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 8e8204a4f3e32ffb1804196f2aa252684ee663e8 Author: Sasha Neftin Date: Sun Mar 22 09:58:46 2020 +0200 igc: Add ECN support for TSO Align with other Intel drivers and add ECN support for TSO. Add NETIF_F_TSO_ECN flag Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 302a729c84b59c835f7857ec378efecbda58b9b3 Author: Johan Jonker Date: Sat Mar 21 22:54:23 2020 +0100 arm64: dts: rockchip: fix &pinctrl phy sub nodename for rk3399-orangepi A test with the command below this error: arch/arm64/boot/dts/rockchip/rk3399-orangepi.dt.yaml: phy: '#phy-cells' is a required property 'phy' is a reserved nodename and should not be used for pinctrl, so change it to 'gmac'. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200321215423.12176-6-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit b2bb769100d49c6acbfb2756cc4748aac09209c9 Author: Johan Jonker Date: Sat Mar 21 22:54:22 2020 +0100 arm64: dts: rockchip: fix rtl8211e nodename for rk3399-orangepi A test with the command below gives this error: arch/arm64/boot/dts/rockchip/rk3399-orangepi.dt.yaml: phy@1: '#phy-cells' is a required property The phy nodename is used by a phy-handle. The parent node is compatible with "snps,dwmac-mdio", so change nodename to 'ethernet-phy', for which '#phy-cells' is not a required property make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200321215423.12176-5-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 737157f9618b40c7147cf697aec431ce9dd178a0 Author: Johan Jonker Date: Sat Mar 21 22:54:21 2020 +0100 arm64: dts: rockchip: fix &pinctrl phy sub nodename for rk3399-nanopi4 A test with the command below gives for example this error: arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dt.yaml: phy: '#phy-cells' is a required property arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4.dt.yaml: phy: '#phy-cells' is a required property arch/arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dt.yaml: phy: '#phy-cells' is a required property 'phy' is a reserved nodename and should not be used for pinctrl, so change it to 'gmac'. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200321215423.12176-4-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit b450d1c566bd726f93bc72a3cf3155cecebc1b75 Author: Johan Jonker Date: Sat Mar 21 22:54:20 2020 +0100 arm64: dts: rockchip: fix rtl8211e nodename for rk3399-nanopi4 A test with the command below gives these errors: arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dt.yaml: phy@1: '#phy-cells' is a required property arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4.dt.yaml: phy@1: '#phy-cells' is a required property arch/arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dt.yaml: phy@1: '#phy-cells' is a required property The rtl8211e node is used by a phy-handle. The parent node is compatible with "snps,dwmac-mdio", so change nodename to 'ethernet-phy', for which '#phy-cells' is not a required property. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200321215423.12176-3-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 63834d1edb96e2016191e53444934299bbc06bb1 Author: Johan Jonker Date: Sat Mar 21 22:54:19 2020 +0100 arm64: dts: rockchip: fix rtl8211f nodename for rk3328 Beelink A1 A test with the command below gives this error: arch/arm64/boot/dts/rockchip/rk3328-a1.dt.yaml: phy@0: '#phy-cells' is a required property The rtl8211f node is used by a phy-handle. The parent node is compatible with "snps,dwmac-mdio", so change nodename to 'ethernet-phy', for which '#phy-cells' is not a required property. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200321215423.12176-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 8370cc5533b3baa5e0f18075ae638b050458aabd Author: Johan Jonker Date: Sat Mar 21 22:54:18 2020 +0100 arm64: dts: rockchip: fix phy nodename for rk3328 A test with the command below gives for example this error: arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: phy@0: '#phy-cells' is a required property The phy nodename is normally used by a phy-handle. This node is however compatible with "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22" which is just been added to 'ethernet-phy.yaml'. So change nodename to 'ethernet-phy' for which '#phy-cells' is not a required property make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200321215423.12176-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit d09855bdd8c4d4eb6e58b8546318ebb5859a513c Author: Johan Jonker Date: Tue May 12 22:35:24 2020 +0200 include: dt-bindings: rockchip: remove unused defines The Rockchip dtsi and dts files have been bulk-converted for the remaining raw gpio numbers into their descriptive counterparts and also got rid of the unhelpful RK_FUNC_x -> x and RK_GPIOx -> x mappings, so remove the unused defines in 'rockchip.h' to prevent that someone start using them again. Signed-off-by: Johan Jonker Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20200512203524.7317-3-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 213f272b754f4e27aeab9d1265c775610e612bb7 Author: Johan Jonker Date: Tue May 12 22:35:22 2020 +0200 arm64: dts: rockchip: replace RK_FUNC defines in rk3326-odroid-go2 The defines RK_FUNC_1 and RK_FUNC_2 are deprecated, so replace them with the preferred form. Restyle properties in the same line. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200512203524.7317-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 24921a8f184708600a03bcbf5143fb1b7bb281a7 Author: Kangmin Park Date: Mon May 11 04:58:21 2020 +0900 docs/devicetree/i2c: brcm,bcm2835: fix node id in example This is a trivial patch to fix node id to match the reg in example. Signed-off-by: Kangmin Park Signed-off-by: Rob Herring commit 909bc56cb0085c1ad3c787a7bebe80ed754ff608 Author: Bjorn Andersson Date: Mon May 18 11:44:57 2020 -0700 arm64: dts: qcom: sc7180: Fix ETMv4 power management patch The lack of unique context in '0f1decaa83b7 ("arm64: dts: qcom: sc7180: Support ETMv4 power management")' caused the patch to be applied off-by-one. Move the "arm,coresight-loses-context-with-cpu" properties down one node, so that it applies to the ETMs and not the replicator. Reported-by: Sai Prakash Ranjan Signed-off-by: Bjorn Andersson commit 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 Author: Zong Li Date: Tue Apr 21 15:30:01 2020 +0800 riscv: Use text_mutex instead of patch_lock We don't need the additional lock protection when patching the text. There are two patching interfaces here: - patch_text: patch code and always synchronize with stop_machine() - patch_text_nosync: patch code without synchronization, it's caller's responsibility to synchronize all CPUs if needed. For the first one, stop_machine() is protected by its own mutex, and also the irq is already disabled here. For the second one, in risc-v real case now, it would be used to ftrace patching the mcount function, since it already running under kstop_machine(), no other thread will run, so we could use text_mutex on ftrace side. Signed-off-by: Zong Li Reviewed-by: Masami Hiramatsu Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit 5303df244cbf2d9e5d37816c91c595a7afb7649a Author: Zong Li Date: Tue Apr 21 15:30:00 2020 +0800 riscv: Use NOKPROBE_SYMBOL() instead of __krpobes annotation The __kprobes annotation is old style, so change it to NOKPROBE_SYMBOL(). Signed-off-by: Zong Li Reviewed-by: Masami Hiramatsu Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit b80b3d582ebd8c7c49687319b3c624e03c4b2b93 Author: Zong Li Date: Tue Apr 21 15:29:59 2020 +0800 riscv: Remove the 'riscv_' prefix of function name Refactor the function name by removing the 'riscv_' prefix, it would be better unless it could mix up with arch-independent functions. Signed-off-by: Zong Li Reviewed-by: Masami Hiramatsu Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit edde5584c7ab5d18b87f092fe6fe8a72590e7100 Author: Vincent Chen Date: Thu Apr 16 10:38:08 2020 +0800 riscv: Add SW single-step support for KDB In KGDB, the GDB in the host is responsible for the single-step operation of the software. In other words, KGDB does not need to derive the next pc address when performing a software single-step operation. KGDB just inserts the break instruction at the indicated address according to the GDB instructions. This approach does not work in KDB because the GDB does not involve the KDB process. Therefore, this patch provides KDB a software single-step mechanism to use. Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit d96575709cc7056f34fdd5cdc16bcffe5bdb573d Author: Vincent Chen Date: Thu Apr 16 10:38:07 2020 +0800 riscv: Use the XML target descriptions to report 3 system registers The $status, $badaddr, and $cause registers belong to the thread context, so KGDB can obtain their contents from pt_regs in each trap. However, the sequential number of these registers in the gdb register list is far from the general-purpose registers. If riscv port uses the existing method to report these three registers, many trivial registers with sequence numbers in the middle of them will also be packaged to the reply packets. To solve this problem, the riscv port wants to introduce the GDB target description mechanism to customize the reported register list. By the list, the KGDB can ignore the intermediate registers and just reports the general-purpose registers and these three system registers. Signed-off-by: Vincent Chen Signed-off-by: Palmer Dabbelt commit fe89bd2be8667d4d876329dd534dd59158e33b1f Author: Vincent Chen Date: Thu Apr 16 10:38:05 2020 +0800 riscv: Add KGDB support The skeleton of RISC-V KGDB port. Signed-off-by: Vincent Chen Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit f83b04d36e52cc3d941120ec859374fcda36eb31 Author: Vincent Chen Date: Thu Apr 16 10:38:04 2020 +0800 kgdb: Add kgdb_has_hit_break function The break instruction in RISC-V does not have an immediate value field, so the kernel cannot identify the purpose of each trap exception through the opcode. This makes the existing identification schemes in other architecture unsuitable for the RISC-V kernel. To solve this problem, this patch adds kgdb_has_hit_break(), which can help RISC-V kernel identify the KGDB trap exception. Signed-off-by: Vincent Chen Reviewed-by: Palmer Dabbelt Acked-by: Daniel Thompson Signed-off-by: Palmer Dabbelt commit eb077c9c387f931767d7b737bdf696b753c57e46 Author: Palmer Dabbelt Date: Tue Apr 7 11:33:40 2020 -0700 RISC-V: Skip setting up PMPs on traps The RISC-V ISA manual says that PMPs are WARL, but it appears the K210 doesn't implement them and instead traps on the unsupported accesses. This patch handles those traps by just skipping the PMP initialization entirely, under the theory that machines that trap on PMP accesses must allow memory accesses as otherwise they're pretty useless. Signed-off-by: Palmer Dabbelt commit 045c654220e5772b6bc59e89b5700fa4673c6450 Author: Damien Le Moal Date: Tue Apr 14 13:43:26 2020 +0900 riscv: K210: Update defconfig Update the Kendryte K210 default kernel configuration file nommu_k210_defconfig to enable builtin DTB by default. Signed-off-by: Damien Le Moal Signed-off-by: Palmer Dabbelt commit 8bb6617427761c04b9670f8554fa63a1ef2d2807 Author: Palmer Dabbelt Date: Tue Apr 14 13:43:25 2020 +0900 riscv: K210: Add a built-in device tree The K210's bootloader does not provide a device tree. Give the ability to providea builtin one with the SOC_KENDRYTE_K210_BUILTIN_DTB option. If selected, this option result in the definition of a builtin DTB entry in the k210 sysctl driver. If defined, the builtin DTB entry points to the default k210.dts device tree file and is keyed with the vendor ID 0x4B5, the arch ID 0xE59889E6A5A04149 ("Canaan AI" in UTF-8 coded Chinese) and the impl ID 0x4D41495832303030 ("MAIX200"). These values are reported by the SiPEED MAIXDUINO board, the SiPEED MAIX Go board and the SiPEED Dan Dock board. [Thanks to Damien for the K210 IDs] Signed-off-by: Damien Le Moal Signed-off-by: Palmer Dabbelt commit 2d2682512f0faf4d09a696184bf3c0bb6838baca Author: Palmer Dabbelt Date: Tue Apr 14 13:43:24 2020 +0900 riscv: Allow device trees to be built into the kernel Some systems don't provide a useful device tree to the kernel on boot. Chasing around bootloaders for these systems is a headache, so instead le't's just keep a device tree table in the kernel, keyed by the SOC's unique identifier, that contains the relevant DTB. This is only implemented for M mode right now. While we could implement this via the SBI calls that allow access to these identifiers, we don't have any systems that need this right now. Signed-off-by: Palmer Dabbelt commit d0ac7079d5fcaaaf3eb99c197a08ac1b399754f4 Author: Jeff LaBundy Date: Mon May 18 11:32:18 2020 -0700 Input: iqs269a - add missing I2C dependency If CONFIG_INPUT_IQS269A is selected yet CONFIG_I2C is not, the build fails. To solve this problem, add I2C as a dependency. Signed-off-by: Jeff LaBundy Reported-by: kbuild test robot Fixes: 04e49867fad1 ("Input: add support for Azoteq IQS269A") Link: https://lore.kernel.org/r/1589809466-22748-1-git-send-email-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 907dd4539707060df0b93da4b16bccb89b1ff64c Author: Oleksij Rempel Date: Sun May 10 07:15:22 2020 +0200 dt-bindings: serial: qca,ar9330-uart: Convert to json-schema Convert the Qualcomm Atheros AR9330 High-Speed UART Device Tree binding documentation to json-schema. Signed-off-by: Oleksij Rempel Signed-off-by: Rob Herring commit 3d81b3d1e55a518837c3d1f722c6d93abe34aa85 Author: Uros Bizjak Date: Fri May 8 12:58:17 2020 +0200 x86/cpu: Use RDRAND and RDSEED mnemonics in archrandom.h Current minimum required version of binutils is 2.23, which supports RDRAND and RDSEED instruction mnemonics. Replace the byte-wise specification of RDRAND and RDSEED with these proper mnemonics. Signed-off-by: Uros Bizjak Signed-off-by: Borislav Petkov Reviewed-by: H. Peter Anvin (Intel) Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200508105817.207887-1-ubizjak@gmail.com commit 0e0e10fde0e9808d1991268f5dca69fb36c025f7 Author: Hans de Goede Date: Mon May 18 09:24:16 2020 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet The Toshiba Encore WT8-A tablet almost fully works with the default settings for non-CR Bay Trail devices. The only problem is that its jack-detect switch is not inverted (it is active high instead of the normal active low). Add a quirk for this model using the default settings + BYT_RT5640_JD_NOT_INV. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200518072416.5348-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 9c30df7c5a304e383592587cb2a41bb2ab0ac80d Author: Jaegeuk Kim Date: Wed May 13 21:12:53 2020 -0700 f2fs: flush dirty meta pages when flushing them Let's guarantee flusing dirty meta pages to avoid infinite loop. Signed-off-by: Jaegeuk Kim commit 1ae18f71cb522684bac1718f5c188fb5e30eb23d Author: Jaegeuk Kim Date: Fri May 15 17:20:50 2020 -0700 f2fs: fix checkpoint=disable:%u%% When parsing the mount option, we don't have sbi->user_block_count. Should do it after getting it. Cc: Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8ba4dc3cff8cbe2c571063a5fd7116e8bde563ca Author: Pavel Dobias Date: Fri May 15 14:07:57 2020 +0200 ASoC: max9867: fix volume controls The xmax values for Master Playback Volume and Mic Boost Capture Volume are specified incorrectly (one greater) which results in the wrong dB gain being shown to the user in the case of Master Playback Volume. Signed-off-by: Pavel Dobias Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200515120757.24669-1-dobias@2n.cz Signed-off-by: Mark Brown commit 10f6cd2af21bb44faab31a50ec3361d7649e5a39 Author: Jean-Philippe Brucker Date: Wed Apr 22 10:48:06 2020 +0200 pmu/smmuv3: Clear IRQ affinity hint on device removal Currently when trying to remove the SMMUv3 PMU module we get a WARN_ON_ONCE from free_irq(), because the affinity hint set during probe hasn't been properly cleared. [ 238.878383] WARNING: CPU: 0 PID: 175 at kernel/irq/manage.c:1744 free_irq+0x324/0x358 ... [ 238.897263] Call trace: [ 238.897998] free_irq+0x324/0x358 [ 238.898792] devm_irq_release+0x18/0x28 [ 238.899189] release_nodes+0x1b0/0x228 [ 238.899984] devres_release_all+0x38/0x60 [ 238.900779] device_release_driver_internal+0x10c/0x1d0 [ 238.901574] driver_detach+0x50/0xe0 [ 238.902368] bus_remove_driver+0x5c/0xd8 [ 238.903448] driver_unregister+0x30/0x60 [ 238.903958] platform_driver_unregister+0x14/0x20 [ 238.905075] arm_smmu_pmu_exit+0x1c/0xecc [arm_smmuv3_pmu] [ 238.905547] __arm64_sys_delete_module+0x14c/0x260 [ 238.906342] el0_svc_common.constprop.0+0x74/0x178 [ 238.907355] do_el0_svc+0x24/0x90 [ 238.907932] el0_sync_handler+0x11c/0x198 [ 238.908979] el0_sync+0x158/0x180 Just like the other perf drivers, clear the affinity hint before releasing the device. Fixes: 7d839b4b9e00 ("perf/smmuv3: Add arm64 smmuv3 pmu driver") Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20200422084805.237738-1-jean-philippe@linaro.org Signed-off-by: Will Deacon commit 97807325a02b41de2f641d98dda1041549a23cd8 Author: Zhou Wang Date: Thu May 7 10:58:25 2020 +0800 drivers/perf: hisi: Permit modular builds of HiSilicon uncore drivers This patch lets HiSilicon uncore PMU driver can be built as modules. A common module and three specific uncore PMU driver modules will be built. Export necessary functions in hisi_uncore_pmu module, and change irq_set_affinity to irq_set_affinity_hint to pass compile. Signed-off-by: Zhou Wang Tested-by: Qi Liu Reviewed-by: Shaokun Zhang Link: https://lore.kernel.org/r/1588820305-174479-1-git-send-email-wangzhou1@hisilicon.com Signed-off-by: Will Deacon commit 701dafe0670c736c0131328c0fd64c1190f0bb0c Author: Hanjun Guo Date: Fri May 8 12:05:53 2020 +0800 ACPI: IORT: Add comments for not calling acpi_put_table() The iort_table will be used at runtime after acpi_iort_init(), so add some comments to clarify this to make it less confusing. Signed-off-by: Hanjun Guo Link: https://lore.kernel.org/r/1588910753-18543-2-git-send-email-guohanjun@huawei.com Signed-off-by: Will Deacon commit 5ec605108ff4901aedd62ee1bdd4250f2f7cf978 Author: Hanjun Guo Date: Fri May 8 12:05:52 2020 +0800 ACPI: GTDT: Put GTDT table after parsing The mapped GTDT table needs to be released after the driver init. Signed-off-by: Hanjun Guo Link: https://lore.kernel.org/r/1588910753-18543-1-git-send-email-guohanjun@huawei.com Signed-off-by: Will Deacon commit bd4298c72b56d7faf0ee3671739f3a704a962d0f Author: Yunfeng Ye Date: Fri May 8 11:15:45 2020 +0800 arm64: stacktrace: Factor out some common code into on_stack() There are some common codes for stack checking, so factors it out into the function on_stack(). No functional change. Signed-off-by: Yunfeng Ye Link: https://lore.kernel.org/r/07b3b0e6-3f58-4fed-07ea-7d17b7508948@huawei.com Signed-off-by: Will Deacon commit aba1ad05da088944a62eb87fb0cd8391152e8985 Author: Tony Lindgren Date: Thu May 7 10:23:18 2020 -0700 clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support We can move the TI dmtimer clockevent and clocksource to live under drivers/clocksource if we rely only on the clock framework, and handle the module configuration directly in the clocksource driver based on the device tree data. This removes the early dependency with system timers to the interconnect related code, and we can probe pretty much everything else later on at the module_init level. Let's first add a new driver for timer-ti-dm-systimer based on existing arch/arm/mach-omap2/timer.c. Then let's start moving SoCs to probe with device tree data while still keeping the old timer.c. And eventually we can just drop the old timer.c. Let's take the opportunity to switch to use readl/writel as pointed out by Daniel Lezcano . This allows further clean-up of the timer-ti-dm code the a lot of the shared helpers can just become static to the non-syster related code. Note the boards can optionally configure different timer source clocks if needed with assigned-clocks and assigned-clock-parents. Cc: linux-kernel@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Cc: Thomas Gleixner Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200507172330.18679-3-tony@atomide.com commit d15483bb49bae0f9cbb67c54becec252545752d3 Author: Tony Lindgren Date: Thu May 7 10:23:17 2020 -0700 clocksource/drivers/timer-ti-32k: Add support for initializing directly Let's allow probing the 32k counter directly based on devicetree data to prepare for dropping the related legacy platform code. Let's only do this if the parent node is compatible with ti-sysc to make sure we have the related devicetree data available. Let's also show the 32k counter information before registering the clocksource, now we see it after the clocksource information which is a bit confusing. Cc: linux-kernel@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Lokesh Vutla Cc: Rob Herring Cc: Tero Kristo Cc: Thomas Gleixner Signed-off-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200507172330.18679-2-tony@atomide.com commit b322c65f8ca37396cfd7d4d0ac2f7f2dc08fa9eb Author: Douglas Anderson Date: Wed May 13 16:06:37 2020 -0700 arm64: Call debug_traps_init() from trap_init() to help early kgdb A new kgdb feature will soon land (kgdb_earlycon) that lets us run kgdb much earlier. In order for everything to work properly it's important that the break hook is setup by the time we process "kgdbwait". Right now the break hook is setup in debug_traps_init() and that's called from arch_initcall(). That's a bit too late since kgdb_earlycon really needs things to be setup by the time the system calls dbg_late_init(). We could fix this by adding call_break_hook() into early_brk64() and that works fine. However, it's a little ugly. Instead, let's just add a call to debug_traps_init() straight from trap_init(). There's already a documented dependency between trap_init() and debug_traps_init() and this makes the dependency more obvious rather than just relying on a comment. NOTE: this solution isn't early enough to let us select the "ARCH_HAS_EARLY_DEBUG" KConfig option that is introduced by the kgdb_earlycon patch series. That would only be set if we could do breakpoints when early params are parsed. This patch only enables "late early" breakpoints, AKA breakpoints when dbg_late_init() is called. It's expected that this should be fine for most people. It should also be noted that if you crash you can still end up in kgdb earlier than debug_traps_init(). Since you don't need breakpoints to debug a crash that's fine. Suggested-by: Will Deacon Signed-off-by: Douglas Anderson Acked-by: Will Deacon Cc: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/r/20200513160501.1.I0b5edf030cc6ebef6ab4829f8867cdaea42485d8@changeid Signed-off-by: Will Deacon commit 220995622da5317714b5fe659165735f7b44b87e Author: Douglas Anderson Date: Thu May 7 13:08:46 2020 -0700 kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles We want to enable kgdb to debug the early parts of the kernel. Unfortunately kgdb normally is a client of the tty API in the kernel and serial drivers don't register to the tty layer until fairly late in the boot process. Serial drivers do, however, commonly register a boot console. Let's enable the kgdboc driver to work with boot consoles to provide early debugging. This change co-opts the existing read() function pointer that's part of "struct console". It's assumed that if a boot console (with the flag CON_BOOT) has implemented read() that both the read() and write() function are polling functions. That means they work without interrupts and read() will return immediately (with 0 bytes read) if there's nothing to read. This should be a safe assumption since it appears that no current boot consoles implement read() right now and there seems no reason to do so unless they wanted to support "kgdboc_earlycon". The normal/expected way to make all this work is to use "kgdboc_earlycon" and "kgdboc" together. You should point them both to the same physical serial connection. At boot time, as the system transitions from the boot console to the normal console (and registers a tty), kgdb will switch over. One awkward part of all this, though, is that there can be a window where the boot console goes away and we can't quite transtion over to the main kgdboc that uses the tty layer. There are two main problems: 1. The act of registering the tty doesn't cause any call into kgdboc so there is a window of time when the tty is there but kgdboc's init code hasn't been called so we can't transition to it. 2. On some serial drivers the normal console inits (and replaces the boot console) quite early in the system. Presumably these drivers were coded up before earlycon worked as well as it does today and probably they don't need to do this anymore, but it causes us problems nontheless. Problem #1 is not too big of a deal somewhat due to the luck of probe ordering. kgdboc is last in the tty/serial/Makefile so its probe gets right after all other tty devices. It's not fun to rely on this, but it does work for the most part. Problem #2 is a big deal, but only for some serial drivers. Other serial drivers end up registering the console (which gets rid of the boot console) and tty at nearly the same time. The way we'll deal with the window when the system has stopped using the boot console and the time when we're setup using the tty is to keep using the boot console. This may sound surprising, but it has been found to work well in practice. If it doesn't work, it shouldn't be too hard for a given serial driver to make it keep working. Specifically, it's expected that the read()/write() function provided in the boot console should be the same (or nearly the same) as the normal kgdb polling functions. That means continuing to use them should work just fine. To make things even more likely to work work we'll also trap the recently added exit() function in the boot console we're using and delay any calls to it until we're all done with the boot console. NOTE: there could be ways to use all this in weird / unexpected ways. If you do something like this, it's a bit of a buyer beware situation. Specifically: - If you specify only "kgdboc_earlycon" but not "kgdboc" then (depending on your serial driver) things will probably work OK, but you'll get a warning printed the first time you use kgdb after the boot console is gone. You'd only be able to do this, of course, if the serial driver you're running atop provided an early boot console. - If your "kgdboc_earlycon" and "kgdboc" devices are not the same device things should work OK, but it'll be your job to switch over which device you're monitoring (including figuring out how to switch over gdb in-flight if you're using it). When trying to enable "kgdboc_earlycon" it should be noted that the names that are registered through the boot console layer and the tty layer are not the same for the same port. For example when debugging on one board I'd need to pass "kgdboc_earlycon=qcom_geni kgdboc=ttyMSM0" to enable things properly. Since digging up the boot console name is a pain and there will rarely be more than one boot console enabled, you can provide the "kgdboc_earlycon" parameter without specifying the name of the boot console. In this case we'll just pick the first boot that implements read() that we find. This new "kgdboc_earlycon" parameter should be contrasted to the existing "ekgdboc" parameter. While both provide a way to debug very early, the usage and mechanisms are quite different. Specifically "kgdboc_earlycon" is meant to be used in tandem with "kgdboc" and there is a transition from one to the other. The "ekgdboc" parameter, on the other hand, replaces the "kgdboc" parameter. It runs the same logic as the "kgdboc" parameter but just relies on your TTY driver being present super early. The only known usage of the old "ekgdboc" parameter is documented as "ekgdboc=kbd earlyprintk=vga". It should be noted that "kbd" has special treatment allowing it to init early as a tty device. Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Tested-by: Sumit Garg Link: https://lore.kernel.org/r/20200507130644.v4.8.I8fba5961bf452ab92350654aa61957f23ecf0100@changeid Signed-off-by: Daniel Thompson commit eae3e19ca930a56c726fbf4dc3adc198b8f5d61d Author: Douglas Anderson Date: Thu May 7 13:08:45 2020 -0700 kgdboc: Remove useless #ifdef CONFIG_KGDB_SERIAL_CONSOLE in kgdboc This file is only ever compiled if that config is on since the Makefile says: obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o Let's get rid of the useless #ifdef. Reported-by: Daniel Thompson Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200507130644.v4.7.Icb528f03d0026d957e60f537aa711ada6fd219dc@changeid Signed-off-by: Daniel Thompson commit 3ca676e4ca60d1834bb77535dafe24169cadacef Author: Douglas Anderson Date: Thu May 7 13:08:44 2020 -0700 kgdb: Prevent infinite recursive entries to the debugger If we detect that we recursively entered the debugger we should hack our I/O ops to NULL so that the panic() in the next line won't actually cause another recursion into the debugger. The first line of kgdb_panic() will check this and return. Signed-off-by: Douglas Anderson Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.6.I89de39f68736c9de610e6f241e68d8dbc44bc266@changeid Signed-off-by: Daniel Thompson commit b1a57bbfcc17c87e5cc76695ebb0565380c7501a Author: Douglas Anderson Date: Thu May 7 13:08:42 2020 -0700 kgdb: Delay "kgdbwait" to dbg_late_init() by default Using kgdb requires at least some level of architecture-level initialization. If nothing else, it relies on the architecture to pass breakpoints / crashes onto kgdb. On some architectures this all works super early, specifically it starts working at some point in time before Linux parses early_params's. On other architectures it doesn't. A survey of a few platforms: a) x86: Presumably it all works early since "ekgdboc" is documented to work here. b) arm64: Catching crashes works; with a simple patch breakpoints can also be made to work. c) arm: Nothing in kgdb works until paging_init() -> devicemaps_init() -> early_trap_init() Let's be conservative and, by default, process "kgdbwait" (which tells the kernel to drop into the debugger ASAP at boot) a bit later at dbg_late_init() time. If an architecture has tested it and wants to re-enable super early debugging, they can select the ARCH_HAS_EARLY_DEBUG KConfig option. We'll do this for x86 to start. It should be noted that dbg_late_init() is still called quite early in the system. Note that this patch doesn't affect when kgdb runs its init. If kgdb is set to initialize early it will still initialize when parsing early_param's. This patch _only_ inhibits the initial breakpoint from "kgdbwait". This means: * Without any extra patches arm64 platforms will at least catch crashes after kgdb inits. * arm platforms will catch crashes (and could handle a hardcoded kgdb_breakpoint()) any time after early_trap_init() runs, even before dbg_late_init(). Signed-off-by: Douglas Anderson Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20200507130644.v4.4.I3113aea1b08d8ce36dc3720209392ae8b815201b@changeid Signed-off-by: Daniel Thompson commit 68e55f61c13842baf825958129698c5371db432c Author: Douglas Anderson Date: Thu May 7 13:08:41 2020 -0700 kgdboc: Use a platform device to handle tty drivers showing up late If you build CONFIG_KGDB_SERIAL_CONSOLE into the kernel then you should be able to have KGDB init itself at bootup by specifying the "kgdboc=..." kernel command line parameter. This has worked OK for me for many years, but on a new device I switched to it stopped working. The problem is that on this new device the serial driver gets its probe deferred. Now when kgdb initializes it can't find the tty driver and when it gives up it never tries again. We could try to find ways to move up the initialization of the serial driver and such a thing might be worthwhile, but it's nice to be robust against serial drivers that load late. We could move kgdb to init itself later but that penalizes our ability to debug early boot code on systems where the driver inits early. We could roll our own system of detecting when new tty drivers get loaded and then use that to figure out when kgdb can init, but that's ugly. Instead, let's jump on the -EPROBE_DEFER bandwagon. We'll create a singleton instance of a "kgdboc" platform device. If we can't find our tty device when the singleton "kgdboc" probes we'll return -EPROBE_DEFER which means that the system will call us back later to try again when the tty device might be there. We won't fully transition all of the kgdboc to a platform device because early kgdb initialization (via the "ekgdboc" kernel command line parameter) still runs before the platform device has been created. The kgdb platform device is merely used as a convenient way to hook into the system's normal probe deferral mechanisms. As part of this, we'll ever-so-slightly change how the "kgdboc=..." kernel command line parameter works. Previously if you booted up and kgdb couldn't find the tty driver then later reading '/sys/module/kgdboc/parameters/kgdboc' would return a blank string. Now kgdb will keep track of the string that came as part of the command line and give it back to you. It's expected that this should be an OK change. Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.3.I4a493cfb0f9f740ce8fd2ab58e62dc92d18fed30@changeid [daniel.thompson@linaro.org: Make config_mutex static] Signed-off-by: Daniel Thompson commit 258c3d628fe9e7512d98a0000709773457c66ef1 Author: Will Deacon Date: Mon May 18 14:01:01 2020 +0100 arm64: entry-ftrace.S: Update comment to indicate that x18 is live The Shadow Call Stack pointer is held in x18, so update the ftrace entry comment to indicate that it cannot be safely clobbered. Reported-by: Mark Rutland Signed-off-by: Will Deacon commit 871e100e432c651c9c46fb9c3184b4577e0de3ae Author: Will Deacon Date: Fri May 15 16:17:12 2020 +0100 scs: Move DEFINE_SCS macro into core code Defining static shadow call stacks is not architecture-specific, so move the DEFINE_SCS() macro into the core header file. Tested-by: Sami Tolvanen Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit aa7a65ae5b8f459617e5ed1422301386e7f12274 Author: Will Deacon Date: Fri May 15 16:15:46 2020 +0100 scs: Remove references to asm/scs.h from core code asm/scs.h is no longer needed by the core code, so remove a redundant header inclusion and update the stale Kconfig text. Tested-by: Sami Tolvanen Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit 88485be531f4aee841ddc53b56e2f6e6a338854d Author: Will Deacon Date: Fri May 15 14:56:05 2020 +0100 scs: Move scs_overflow_check() out of architecture code There is nothing architecture-specific about scs_overflow_check() as it's just a trivial wrapper around scs_corrupted(). For parity with task_stack_end_corrupted(), rename scs_corrupted() to task_scs_end_corrupted() and call it from schedule_debug() when CONFIG_SCHED_STACK_END_CHECK_is enabled, which better reflects its purpose as a debug feature to catch inadvertent overflow of the SCS. Finally, remove the unused scs_overflow_check() function entirely. This has absolutely no impact on architectures that do not support SCS (currently arm64 only). Tested-by: Sami Tolvanen Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit 711e8b0de0d63c70c825b473da01288b661a2386 Author: Will Deacon Date: Fri May 15 14:46:46 2020 +0100 arm64: scs: Use 'scs_sp' register alias for x18 x18 holds the SCS stack pointer value, so introduce a register alias to make this easier to read in assembly code. Tested-by: Sami Tolvanen Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit bee348fab099b0f551caa874663e82a7f3bb64b3 Author: Will Deacon Date: Fri May 15 14:43:11 2020 +0100 scs: Move accounting into alloc/free functions There's no need to perform the shadow stack page accounting independently of the lifetime of the underlying allocation, so call the accounting code from the {alloc,free}() functions and simplify the code in the process. Tested-by: Sami Tolvanen Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit 51189c7a7ed1b4ed4493e27275d466ff60406d3a Author: Will Deacon Date: Fri May 15 14:11:05 2020 +0100 arm64: scs: Store absolute SCS stack pointer value in thread_info Storing the SCS information in thread_info as a {base,offset} pair introduces an additional load instruction on the ret-to-user path, since the SCS stack pointer in x18 has to be converted back to an offset by subtracting the base. Replace the offset with the absolute SCS stack pointer value instead and avoid the redundant load. Tested-by: Sami Tolvanen Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit d3b68ddf1d38366d3dd5afae21f167aaf5161d32 Author: Shawn Guo Date: Sat May 9 20:38:46 2020 +0800 drm/msm/a4xx: add a405_registers for a405 device A405 device has a different set of registers than a4xx_registers. It has no VMIDMT or XPU registers, and VBIF registers are different. Let's add a405_registers for a405 device. As adreno_is_a405() works only after adreno_gpu_init() gets called, the assignments get moved down after adreno_gpu_init(). Signed-off-by: Shawn Guo Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit dc0fa5eb765d881977bab7568245f653407481be Author: Shawn Guo Date: Sat May 9 20:38:45 2020 +0800 drm/msm/a4xx: add adreno a405 support It adds support for adreno a405 found on MSM8939. The adreno_is_a430() check in adreno_submit() needs an extension to cover a405. The downstream driver suggests it should cover the whole a4xx generation. That's why it gets changed to adreno_is_a4xx(), while a420 is not tested though. Signed-off-by: Shawn Guo Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 24e6938ec604b7dc0306c972c1aa029ff03bb36a Author: Jonathan Marek Date: Thu Apr 23 17:09:21 2020 -0400 drm/msm/a6xx: update a6xx_hw_init for A640 and A650 Adreno 640 and 650 GPUs need some registers set differently. Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit ad4968d51dd3a22a5a85728fec76bb8711c9c995 Author: Jonathan Marek Date: Thu Apr 23 17:09:20 2020 -0400 drm/msm/a6xx: enable GMU log This is required for a650 to work. Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 02ef80c54e7cd70fe1f422b0315fd1534033e382 Author: Jonathan Marek Date: Thu Apr 23 17:09:19 2020 -0400 drm/msm/a6xx: update pdc/rscc GMU registers for A640/A650 Update the gmu_pdc registers for A640 and A650. Some of the RSCC registers on A650 are in a separate region. Note this also changes the address of these registers: RSCC_TCS1_DRV0_STATUS RSCC_TCS2_DRV0_STATUS RSCC_TCS3_DRV0_STATUS Based on the values in msm-4.14 and msm-4.19 kernels. v3: replaced adreno_is_a650 around ->rscc with checks for "rscc" resource Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit c6ed04f856a4ebbbd8276ea871d8c98590abb0d0 Author: Jonathan Marek Date: Thu Apr 23 17:09:18 2020 -0400 drm/msm/a6xx: A640/A650 GMU firmware path Newer GPUs have different GMU firmware path. v3: updated a6xx_gmu_fw_load based on feedback, including gmu_write_bulk, and removed extra whitespace change Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 8167e6fa76c8f7174dc9643f60c63bc083b35787 Author: Jonathan Marek Date: Thu Apr 23 17:09:17 2020 -0400 drm/msm/a6xx: HFI v2 for A640 and A650 Add HFI v2 code paths required by Adreno 640 and 650 GPUs. Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit a83366ef19eaac14913ec89789638e32ee656480 Author: Jonathan Marek Date: Thu Apr 23 17:09:16 2020 -0400 drm/msm/a6xx: add A640/A650 to gpulist Add Adreno 640 and 650 GPU info to the gpulist. Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 29ac8979cdf7205bf70ec9be60bd2442acc0422a Author: Jonathan Marek Date: Thu Apr 23 17:09:15 2020 -0400 drm/msm/a6xx: use msm_gem for GMU memory objects This gives more fine-grained control over how memory is allocated over the DMA api. In particular, it allows using an address range or pinning to a fixed address. Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 0b462d7a71c07e96b8f02cbc2d134fdc6e80ef34 Author: Jonathan Marek Date: Thu Apr 23 17:09:14 2020 -0400 drm/msm: add internal MSM_BO_MAP_PRIV flag This flag sets IOMMU_PRIV, which is required for some a6xx GMU objects. Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit d3b8877e57247c628966b155c02b4ed2e61b88f2 Author: Jonathan Marek Date: Thu Apr 23 17:09:13 2020 -0400 drm/msm: add msm_gem_get_and_pin_iova_range This function allows pinning iova to a specific page range (for a6xx GMU). Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit eadf79286a4badebc95af7061530bdb50a7e6f38 Author: Jordan Crouse Date: Fri May 1 13:43:26 2020 -0600 drm/msm: Check for powered down HW in the devfreq callbacks Writing to the devfreq sysfs nodes while the GPU is powered down can result in a system crash (on a5xx) or a nasty GMU error (on a6xx): $ /sys/class/devfreq/5000000.gpu# echo 500000000 > min_freq [ 104.841625] platform 506a000.gmu: [drm:a6xx_gmu_set_oob] *ERROR* Timeout waiting for GMU OOB set GPU_DCVS: 0x0 Despite the fact that we carefully try to suspend the devfreq device when the hardware is powered down there are lots of holes in the governors that don't check for the suspend state and blindly call into the devfreq callbacks that end up triggering hardware reads in the GPU driver. Call pm_runtime_get_if_in_use() in the gpu_busy() and gpu_set_freq() callbacks to skip the hardware access if it isn't active. v3: Only check pm_runtime_get_if_in_use() for == 0 per Eric Anholt v2: Use pm_runtime_get_if_in_use() per Eric Anholt Cc: stable@vger.kernel.org Reviewed-by: Eric Anholt Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 71dc6c08e4c53d37e3756502b1793f440f4d4030 Author: Krishna Manikandan Date: Mon May 4 19:01:03 2020 +0530 drm/msm/dpu: update bandwidth threshold check Maximum allowed bandwidth has no dependency on the type of panel used. Hence, cleanup the code to use max_bw_high as the threshold value for bandwidth checks. Update the maximum allowed bandwidth as 6.8Gbps for SC7180 target. Signed-off-by: Krishna Manikandan Signed-off-by: Rob Clark commit 04d9044f6c577948609c03b4e33b8fbc8b87c4b1 Author: Kalyan Thota Date: Wed Apr 1 14:18:18 2020 +0530 drm/msm/dpu: add support for clk and bw scaling for display This change adds support to scale src clk and bandwidth as per composition requirements. Interconnect registration for bw has been moved to mdp device node from mdss to facilitate the scaling. Signed-off-by: Kalyan Thota Signed-off-by: Rob Clark commit 4259ff7ae509ed880b3a7bb685972c3a3bf4b74b Author: Kalyan Thota Date: Tue Mar 24 15:31:19 2020 +0530 drm/msm/dpu: add support for pcc color block in dpu driver This change adds support for color correction sub block for SC7180 device. Signed-off-by: Kalyan Thota Tested-by: Fritz Koenig Signed-off-by: Rob Clark commit e47616df008b1059c57892fb34883403a6933231 Author: Kalyan Thota Date: Tue Mar 24 15:31:18 2020 +0530 drm/msm/dpu: add support for color processing blocks in dpu driver This change adds support to configure dspp blocks in the dpu driver. Macro description of the changes coming in this patch. 1) Add dspp definitions in the hw catalog. 2) Add capability to reserve dspp blocks in the display data path. 3) Attach the reserved block to the encoder. Signed-off-by: Kalyan Thota Tested-by: Fritz Koenig Signed-off-by: Rob Clark commit e4337877c5d578722c0716f131fb774522013cf5 Author: Roy Spliet Date: Tue Apr 7 18:07:37 2020 +0100 drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation When allocation for mdp5_kms fails, calling mdp5_destroy() leads to undefined behaviour, likely a nullptr exception or use-after-free troubles. Signed-off-by: Roy Spliet Reviewed-by: Abhinav Kumar Signed-off-by: Rob Clark commit e4b397f6a54c1b653b65c3dbcf3d3a157f580355 Author: Christophe JAILLET Date: Sun Apr 12 16:35:09 2020 +0200 drm/msm: Fix typo Duplicated 'we' Signed-off-by: Christophe JAILLET Reviewed-by: Abhinav Kumar Signed-off-by: Rob Clark commit 20aebe83698feb107d5a66b6cfd1d54459ccdfcf Author: Bjorn Andersson Date: Thu Apr 30 12:24:27 2020 -0700 drm/msm: Fix undefined "rd_full" link error rd_full should be defined outside the CONFIG_DEBUG_FS region, in order to be able to link the msm driver even when CONFIG_DEBUG_FS is disabled. Fixes: e515af8d4a6f ("drm/msm: devcoredump should dump MSM_SUBMIT_BO_DUMP buffers") Reported-by: Stephen Rothwell Signed-off-by: Bjorn Andersson Reviewed-by: Rob Clark Signed-off-by: Rob Clark commit ab723b7a992a19b843f798b183f53f7472f598c8 Author: Bas Nieuwenhuizen Date: Fri Jan 24 00:57:10 2020 +0100 drm/msm: Add syncobj support. This 1) Enables core DRM syncobj support. 2) Adds options to the submission ioctl to wait/signal syncobjs. Just like the wait fence fd, this does inline waits. Using the scheduler would be nice but I believe it is out of scope for this work. Support for timeline syncobjs is implemented and the interface is ready for it, but I'm not enabling it yet until there is some code for turnip to use it. The reset is mostly in there because in the presence of waiting and signalling the same semaphores, resetting them after signalling can become very annoying. v2: - Fixed style issues - Removed a cleanup issue in a failure case - Moved to a copy_from_user per syncobj v3: - Fixed a missing declaration introduced in v2 - Reworked to use ERR_PTR/PTR_ERR - Simplified failure gotos. Used by: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769 Signed-off-by: Bas Nieuwenhuizen Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 6a523388a2d4a1a00ec4153592be997066fb596e Author: Hongbo Yao Date: Wed Dec 4 13:45:48 2019 +0800 drm/msm/dpu: Fix compile warnings Using the following command will get compile warnings: make W=1 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.o ARCH=arm64 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘_dpu_crtc_program_lm_output_roi’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:91:19: warning: variable ‘dpu_crtc’ set but not used [-Wunused-but-set-variable] struct dpu_crtc *dpu_crtc; ^~~~~~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_atomic_begin’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:428:35: warning: variable ‘smmu_state’ set but not used [-Wunused-but-set-variable] struct dpu_crtc_smmu_state_data *smmu_state; ^~~~~~~~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_atomic_flush’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:489:25: warning: variable ‘event_thread’ set but not used [-Wunused-but-set-variable] struct msm_drm_thread *event_thread; ^~~~~~~~~~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_destroy_state’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:565:19: warning: variable ‘dpu_crtc’ set but not used [-Wunused-but-set-variable] struct dpu_crtc *dpu_crtc; ^~~~~~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_duplicate_state’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:664:19: warning: variable ‘dpu_crtc’ set but not used [-Wunused-but-set-variable] struct dpu_crtc *dpu_crtc; ^~~~~~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_disable’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:693:26: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable] struct msm_drm_private *priv; ^~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:691:27: warning: variable ‘mode’ set but not used [-Wunused-but-set-variable] struct drm_display_mode *mode; ^~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_enable’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:766:26: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable] struct msm_drm_private *priv; ^~~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c: In function ‘dpu_crtc_init’: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:1292:18: warning: variable ‘kms’ set but not used [-Wunused-but-set-variable] struct dpu_kms *kms = NULL; ^~~ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:663: warning: Excess function parameter 'Returns' description in 'dpu_crtc_duplicate_state' Reported-by: Hulk Robot Signed-off-by: Hongbo Yao Signed-off-by: Rob Clark commit 09b4138ec2878d504c28a35f0c4c9bb4a0b0c5f4 Author: Christophe JAILLET Date: Wed Dec 4 07:02:20 2019 +0100 drm/msm/a6xx: Fix a typo in an error message 'in' is duplicated in the error message. Axe one of them. While at it, slighly improve indentation. Signed-off-by: Christophe JAILLET Signed-off-by: Rob Clark commit 81c4389e4835ad14280718f477cf30b64643b721 Author: Konrad Dybcio Date: Sat May 9 12:48:10 2020 +0200 drm/msm/mdp5: Add MDP5 configuration for MSM8x36. This change adds MDP5 configuration for MSM8x36-based SoCs, like MSM8936, 8939 and their APQ variants. The configuration is based on MSM8916's, but adds some notable features, like ad and pp blocks, along with some register changes. changes since v1: - add an ad block - add a second mixer @ 0x47000 - adjust .max_width - write a more descriptive commit message Signed-off-by: Konrad Dybcio Reviewed-by: Shawn Guo Signed-off-by: Rob Clark commit ecf814e0e19b5616048391eac359a50c1e9d5174 Author: Michael Guralnik Date: Fri May 15 15:16:54 2020 -0700 net/mlx5: Add support for RDMA TX FT headers modifying Support adding header modifying actions to the RDMA TX flow table. Signed-off-by: Michael Guralnik Reviewed-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 555af0c3fa0b632be73c241cc932129af4b70d27 Author: Parav Pandit Date: Fri May 15 15:16:53 2020 -0700 net/mlx5: Move iseg access helper routines close to mlx5_core driver Only mlx5_core driver handles fw initialization check and command interface revision check. Hence move them inside the mlx5_core driver where it is used. This avoid exposing these helpers to all mlx5 drivers. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 356d411c26735bcc62718c4c9181014255dc302d Author: Raed Salem Date: Fri May 15 15:16:52 2020 -0700 net/mlx5: Cleanup mlx5_ifc_fte_match_set_misc2_bits Remove the "metadata_reg_b" field and all uses of this field in code to match the device specification. As this field is not in use in SW steering it is safe to remove it. Signed-off-by: Raed Salem Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 16bdc04cc98ab0c74392ceef2475ecc5e73fcf49 Author: Qais Yousef Date: Mon May 18 16:49:31 2020 +0100 usb/ehci-platform: Set PM runtime as active on resume Follow suit of ohci-platform.c and perform pm_runtime_set_active() on resume. ohci-platform.c had a warning reported due to the missing pm_runtime_set_active() [1]. [1] https://lore.kernel.org/lkml/20200323143857.db5zphxhq4hz3hmd@e107158-lin.cambridge.arm.com/ Acked-by: Alan Stern Signed-off-by: Qais Yousef CC: Tony Prisk CC: Greg Kroah-Hartman CC: Mathias Nyman CC: Oliver Neukum CC: linux-arm-kernel@lists.infradead.org CC: linux-usb@vger.kernel.org CC: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20200518154931.6144-3-qais.yousef@arm.com Signed-off-by: Greg Kroah-Hartman commit 79112cc3c29f4a8c73a21428fbcbcb0afb005e3e Author: Qais Yousef Date: Mon May 18 16:49:30 2020 +0100 usb/xhci-plat: Set PM runtime as active on resume Follow suit of ohci-platform.c and perform pm_runtime_set_active() on resume. ohci-platform.c had a warning reported due to the missing pm_runtime_set_active() [1]. [1] https://lore.kernel.org/lkml/20200323143857.db5zphxhq4hz3hmd@e107158-lin.cambridge.arm.com/ Signed-off-by: Qais Yousef CC: Tony Prisk CC: Greg Kroah-Hartman CC: Mathias Nyman CC: Oliver Neukum CC: linux-arm-kernel@lists.infradead.org CC: linux-usb@vger.kernel.org CC: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20200518154931.6144-2-qais.yousef@arm.com Signed-off-by: Greg Kroah-Hartman commit 1cb3b0095c3d0bb96912bfbbce4fc006d41f367c Author: Qais Yousef Date: Mon May 18 16:49:29 2020 +0100 usb/ohci-platform: Fix a warning when hibernating The following warning was observed when attempting to suspend to disk using a USB flash as a swap device. [ 111.779649] ------------[ cut here ]------------ [ 111.788382] URB (____ptrval____) submitted while active [ 111.796646] WARNING: CPU: 3 PID: 365 at drivers/usb/core/urb.c:363 usb_submit_urb+0x3d8/0x590 [ 111.805417] Modules linked in: [ 111.808584] CPU: 3 PID: 365 Comm: kworker/3:2 Not tainted 5.6.0-rc6-00002-gdfd1731f9a3e-dirty #545 [ 111.817796] Hardware name: ARM Juno development board (r2) (DT) [ 111.823896] Workqueue: usb_hub_wq hub_event [ 111.828217] pstate: 60000005 (nZCv daif -PAN -UAO) [ 111.833156] pc : usb_submit_urb+0x3d8/0x590 [ 111.837471] lr : usb_submit_urb+0x3d8/0x590 [ 111.841783] sp : ffff800018de38b0 [ 111.845205] x29: ffff800018de38b0 x28: 0000000000000003 [ 111.850682] x27: ffff000970530b20 x26: ffff8000133fd000 [ 111.856159] x25: ffff8000133fd000 x24: ffff800018de3b38 [ 111.861635] x23: 0000000000000004 x22: 0000000000000c00 [ 111.867112] x21: 0000000000000000 x20: 00000000fffffff0 [ 111.872589] x19: ffff0009704e7a00 x18: ffffffffffffffff [ 111.878065] x17: 00000000a7c8f4bc x16: 000000002af33de8 [ 111.883542] x15: ffff8000133fda88 x14: 0720072007200720 [ 111.889019] x13: 0720072007200720 x12: 0720072007200720 [ 111.894496] x11: 0000000000000000 x10: 00000000a5286134 [ 111.899973] x9 : 0000000000000002 x8 : ffff000970c837a0 [ 111.905449] x7 : 0000000000000000 x6 : ffff800018de3570 [ 111.910926] x5 : 0000000000000001 x4 : 0000000000000003 [ 111.916401] x3 : 0000000000000000 x2 : ffff800013427118 [ 111.921879] x1 : 9d4e965b4b7d7c00 x0 : 0000000000000000 [ 111.927356] Call trace: [ 111.929892] usb_submit_urb+0x3d8/0x590 [ 111.933852] hub_activate+0x108/0x7f0 [ 111.937633] hub_resume+0xac/0x148 [ 111.941149] usb_resume_interface.isra.10+0x60/0x138 [ 111.946265] usb_resume_both+0xe4/0x140 [ 111.950225] usb_runtime_resume+0x24/0x30 [ 111.954365] __rpm_callback+0xdc/0x138 [ 111.958236] rpm_callback+0x34/0x98 [ 111.961841] rpm_resume+0x4a8/0x720 [ 111.965445] rpm_resume+0x50c/0x720 [ 111.969049] __pm_runtime_resume+0x4c/0xb8 [ 111.973276] usb_autopm_get_interface+0x28/0x60 [ 111.977948] hub_event+0x80/0x16d8 [ 111.981466] process_one_work+0x2a4/0x748 [ 111.985604] worker_thread+0x48/0x498 [ 111.989387] kthread+0x13c/0x140 [ 111.992725] ret_from_fork+0x10/0x18 [ 111.996415] irq event stamp: 354 [ 111.999756] hardirqs last enabled at (353): [] console_unlock+0x504/0x5b8 [ 112.008441] hardirqs last disabled at (354): [] do_debug_exception+0x1a8/0x258 [ 112.017479] softirqs last enabled at (350): [] __do_softirq+0x4bc/0x568 [ 112.025984] softirqs last disabled at (343): [] irq_exit+0x144/0x150 [ 112.034129] ---[ end trace dc96030b9cf6c8a3 ]--- The problem was tracked down to a missing call to pm_runtime_set_active() on resume in ohci-platform. Link: https://lore.kernel.org/lkml/20200323143857.db5zphxhq4hz3hmd@e107158-lin.cambridge.arm.com/ Acked-by: Alan Stern Signed-off-by: Qais Yousef CC: Tony Prisk CC: Greg Kroah-Hartman CC: Mathias Nyman CC: Oliver Neukum CC: linux-arm-kernel@lists.infradead.org CC: linux-usb@vger.kernel.org CC: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20200518154931.6144-1-qais.yousef@arm.com Signed-off-by: Greg Kroah-Hartman commit 94cc3f1baabac5e5c4dcc6c2f070353f8315d0ee Author: Andre Przywara Date: Wed May 13 11:30:14 2020 +0100 arm64: dts: juno: Fix SCPI shared mem node name The SRAM DT binding requires child nodes to use a certain node name scheme. Change the naming from scp-shmem to scp-sram to comply with that. Link: https://lore.kernel.org/r/20200513103016.130417-19-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 3b42c06061cde145c9b4feb933d9d416c94e05d0 Author: Andre Przywara Date: Wed May 13 11:30:13 2020 +0100 arm64: dts: vexpress: Fix VExpress LED names The common LED binding wants the LED node names to start with led- and then have just a single number. Changing the naming for the 8 user LEDs from using user to led-. Also there is no default-trigger named "mmc0" in the kernel, so use the more generic "disk-activity". Link: https://lore.kernel.org/r/20200513103016.130417-18-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 36d48981d6adf2d3a1d9713df7c145b6f4b4ef22 Author: Andre Przywara Date: Wed May 13 11:30:12 2020 +0100 arm64: dts: juno: Fix GPU interrupt order The Mali binding insists on the GPU interrupts to be in ordered as: job, mmu, gpu. Sort the GPU interrupts and interrupt-names properties accordingly. Link: https://lore.kernel.org/r/20200513103016.130417-17-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 9d0a36ddcc523e8c64781ac4b38cae8410736c56 Author: Andre Przywara Date: Wed May 13 11:30:11 2020 +0100 arm64: dts: fvp/juno: Fix bus node names Most Arm Ltd. boards are employing a layered bus structure, to map the hardware design (SoC, motherboard, IOFPGA) and structure the DTs. The "simple-bus" nodes only allow a limited set of node names. Switch to use *-bus to be binding compliant. This relies on a pending dt-schema.git fix for now: https://github.com/devicetree-org/dt-schema/pull/38 Link: https://lore.kernel.org/r/20200513103016.130417-16-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 906e6dd481cb96941b4c4a93db5b57c1eb9eced3 Author: Andre Przywara Date: Wed May 13 11:30:10 2020 +0100 arm64: dts: fvp: Fix SMMU DT node The SMMU name in the RevC FVP DT file was not fully binding compliant. Adjust the node name to match the binding's list of allowed names, also shuffle the order of the interrupts to comply with the expected order. Link: https://lore.kernel.org/r/20200513103016.130417-15-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 608f1b6cf366a3d429dab08c67117a9699c982c1 Author: Andre Przywara Date: Wed May 13 11:30:09 2020 +0100 arm64: dts: fvp/juno: Fix serial node names The UARTs for all Arm Ltd. boards were using "uart" as their node name stub. Replace that with the required "serial" string, to comply with the PL011 DT binding. Link: https://lore.kernel.org/r/20200513103016.130417-14-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit edfac966f60df8b612db5fde0e9b6f54818d7f60 Author: Andre Przywara Date: Wed May 13 11:30:08 2020 +0100 arm64: dts: juno: Use proper DT node name for USB The EHCI/OCHI DT binding requires to use "usb" as the node name stub. Replace the existing name with "usb" to comply with the binding. Link: https://lore.kernel.org/r/20200513103016.130417-13-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 3e63b94b6274324ff2e7d8615df31586de827c4e Author: Qian Cai Date: Sun May 10 12:16:56 2020 -0400 vfio/pci: fix memory leaks in alloc_perm_bits() vfio_pci_disable() calls vfio_config_free() but forgets to call free_perm_bits() resulting in memory leaks, unreferenced object 0xc000000c4db2dee0 (size 16): comm "qemu-kvm", pid 4305, jiffies 4295020272 (age 3463.780s) hex dump (first 16 bytes): 00 00 ff 00 ff ff ff ff ff ff ff ff ff ff 00 00 ................ backtrace: [<00000000a6a4552d>] alloc_perm_bits+0x58/0xe0 [vfio_pci] [<00000000ac990549>] vfio_config_init+0xdf0/0x11b0 [vfio_pci] init_pci_cap_msi_perm at drivers/vfio/pci/vfio_pci_config.c:1125 (inlined by) vfio_msi_cap_len at drivers/vfio/pci/vfio_pci_config.c:1180 (inlined by) vfio_cap_len at drivers/vfio/pci/vfio_pci_config.c:1241 (inlined by) vfio_cap_init at drivers/vfio/pci/vfio_pci_config.c:1468 (inlined by) vfio_config_init at drivers/vfio/pci/vfio_pci_config.c:1707 [<000000006db873a1>] vfio_pci_open+0x234/0x700 [vfio_pci] [<00000000630e1906>] vfio_group_fops_unl_ioctl+0x8e0/0xb84 [vfio] [<000000009e34c54f>] ksys_ioctl+0xd8/0x130 [<000000006577923d>] sys_ioctl+0x28/0x40 [<000000006d7b1cf2>] system_call_exception+0x114/0x1e0 [<0000000008ea7dd5>] system_call_common+0xf0/0x278 unreferenced object 0xc000000c4db2e330 (size 16): comm "qemu-kvm", pid 4305, jiffies 4295020272 (age 3463.780s) hex dump (first 16 bytes): 00 ff ff 00 ff ff ff ff ff ff ff ff ff ff 00 00 ................ backtrace: [<000000004c71914f>] alloc_perm_bits+0x44/0xe0 [vfio_pci] [<00000000ac990549>] vfio_config_init+0xdf0/0x11b0 [vfio_pci] [<000000006db873a1>] vfio_pci_open+0x234/0x700 [vfio_pci] [<00000000630e1906>] vfio_group_fops_unl_ioctl+0x8e0/0xb84 [vfio] [<000000009e34c54f>] ksys_ioctl+0xd8/0x130 [<000000006577923d>] sys_ioctl+0x28/0x40 [<000000006d7b1cf2>] system_call_exception+0x114/0x1e0 [<0000000008ea7dd5>] system_call_common+0xf0/0x278 Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver") Signed-off-by: Qian Cai [aw: rolled in follow-up patch] Signed-off-by: Alex Williamson commit bc138db1b96264b9c1779cf18d5a3b186aa90066 Author: Alex Williamson Date: Wed Apr 8 11:45:28 2020 -0600 vfio-pci: Mask cap zero The PCI Code and ID Assignment Specification changed capability ID 0 from reserved to a NULL capability in the v1.1 revision. The NULL capability is defined to include only the 16-bit capability header, ie. only the ID and next pointer. Unfortunately vfio-pci creates a map of config space, where ID 0 is used to reserve the standard type 0 header. Finding an actual capability with this ID therefore results in a bogus range marked in that map and conflicts with subsequent capabilities. As this seems to be a dummy capability anyway and we already support dropping capabilities, let's hide this one rather than delving into the potentially subtle dependencies within our map. Seen on an NVIDIA Tesla T4. Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson commit abafbc551fddede3e0a08dee1dcde08fc0eb8476 Author: Alex Williamson Date: Wed Apr 22 13:48:11 2020 -0600 vfio-pci: Invalidate mmaps and block MMIO access on disabled memory Accessing the disabled memory space of a PCI device would typically result in a master abort response on conventional PCI, or an unsupported request on PCI express. The user would generally see these as a -1 response for the read return data and the write would be silently discarded, possibly with an uncorrected, non-fatal AER error triggered on the host. Some systems however take it upon themselves to bring down the entire system when they see something that might indicate a loss of data, such as this discarded write to a disabled memory space. To avoid this, we want to try to block the user from accessing memory spaces while they're disabled. We start with a semaphore around the memory enable bit, where writers modify the memory enable state and must be serialized, while readers make use of the memory region and can access in parallel. Writers include both direct manipulation via the command register, as well as any reset path where the internal mechanics of the reset may both explicitly and implicitly disable memory access, and manipulation of the MSI-X configuration, where the MSI-X vector table resides in MMIO space of the device. Readers include the read and write file ops to access the vfio device fd offsets as well as memory mapped access. In the latter case, we make use of our new vma list support to zap, or invalidate, those memory mappings in order to force them to be faulted back in on access. Our semaphore usage will stall user access to MMIO spaces across internal operations like reset, but the user might experience new behavior when trying to access the MMIO space while disabled via the PCI command register. Access via read or write while disabled will return -EIO and access via memory maps will result in a SIGBUS. This is expected to be compatible with known use cases and potentially provides better error handling capabilities than present in the hardware, while avoiding the more readily accessible and severe platform error responses that might otherwise occur. Fixes: CVE-2020-12888 Reviewed-by: Peter Xu Signed-off-by: Alex Williamson commit 11c4cd07ba111a09f49625f9e4c851d83daf0a22 Author: Alex Williamson Date: Tue Apr 28 13:12:20 2020 -0600 vfio-pci: Fault mmaps to enable vma tracking Rather than calling remap_pfn_range() when a region is mmap'd, setup a vm_ops handler to support dynamic faulting of the range on access. This allows us to manage a list of vmas actively mapping the area that we can later use to invalidate those mappings. The open callback invalidates the vma range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson commit 41311242221e3482b20bfed10fa4d9db98d87016 Author: Alex Williamson Date: Tue Apr 28 17:02:24 2020 -0600 vfio/type1: Support faulting PFNMAP vmas With conversion to follow_pfn(), DMA mapping a PFNMAP range depends on the range being faulted into the vma. Add support to manually provide that, in the same way as done on KVM with hva_to_pfn_remapped(). Reviewed-by: Peter Xu Signed-off-by: Alex Williamson commit 4ace9a0ec7293b0b2052da7e39651fb1f4d8eaef Merge: 9bb93a40d958 99cb681e7b8e Author: Mark Brown Date: Mon May 18 16:43:50 2020 +0100 Merge series "ASoC: SOF: Intel and IMX updates for 5.8" from Kai Vehmanen : Hi, here's a series of minor fixes and improvements to SOF. Add support for smart amplifier component type. Cover more systems by relaxing match rules for the generic Soundwire machine driver. Fix issues with driver unload and address a few compiler warnings. Daniel Baluta (2): ASoC: SOF: Do nothing when DSP PM callbacks are not set ASoC: SOF: define INFO_ flags in dsp_ops Keyon Jie (1): ASoC: SOF: topology: add support to smart amplifier Marcin Rajwa (2): ASoC: SOF: add a power_down_notify method ASoC: SOF: inform DSP that driver is going to be removed Pierre-Louis Bossart (2): ASoC: SOF: imx: make dsp_ops static ASoC: SOF: imx: make imx8m_dsp_ops static randerwang (1): ASoC: SOF: Intel: sdw: relax sdw machine select constraints include/sound/sof/topology.h | 2 ++ sound/soc/sof/core.c | 6 ++++++ sound/soc/sof/imx/imx8.c | 2 +- sound/soc/sof/imx/imx8m.c | 8 +++++++- sound/soc/sof/intel/hda.c | 10 +++++++++- sound/soc/sof/pm.c | 19 +++++++++++++++++-- sound/soc/sof/sof-priv.h | 1 + sound/soc/sof/topology.c | 1 + 8 files changed, 44 insertions(+), 5 deletions(-) -- 2.26.0 commit 9bb93a40d95863e2576ccc2b8f05467659c9faf1 Merge: a1c3ec70ee10 0812a08ac8d0 Author: Mark Brown Date: Mon May 18 16:43:49 2020 +0100 Merge series "ASoC: cleanup DAI/Component activity" from Kuninori Morimoto : Hi Mark These are v3 of DAI/Component activity cleanup. This patch-set exchanges soc-dapm.c :: snd_soc_dai_link_event_xxx() behavior which updates dai->active but not cares other actives. But I think original code was wrong. So, I believe these works correctly, but maybe need some tests or deep review. v1 -> v2 - function naming "activity" -> "active" v2 -> v3 - macro -> inline function - added Reviewed-by from Ranjani, Acked-by from Peter Link: https://lore.kernel.org/r/875zd39frp.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87blmq9alx.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (21): ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro ASoC: soc-dai: add snd_soc_dai_action() ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate() ASoC: soc-dai: add snd_soc_dai_active() ASoC: soc-component: add snd_soc_component_active() ASoC: soc-dai: add snd_soc_dai_stream_active() ASoC: use snd_soc_xxx_active() ASoC: atomel: use snd_soc_xxx_active() ASoC: bcm: use snd_soc_xxx_active() ASoC: cirrus: use snd_soc_xxx_active() ASoC: codecs: use snd_soc_xxx_active() ASoC: fsl: use snd_soc_xxx_active() ASoC: intel: use snd_soc_xxx_active() ASoC: jz4740: use snd_soc_xxx_active() ASoC: mediatek: use snd_soc_xxx_active() ASoC: meson: use snd_soc_xxx_active() ASoC: pxa: use snd_soc_xxx_active() ASoC: ti: use snd_soc_xxx_active() ASoC: uniphier: use snd_soc_xxx_active() ASoC: dwc: use snd_soc_xxx_active() ASoC: cleanup dai / component active code include/sound/soc-component.h | 6 +- include/sound/soc-dai.h | 21 +++++- include/sound/soc.h | 15 ++++- sound/soc/atmel/atmel_ssc_dai.c | 4 +- sound/soc/bcm/bcm2835-i2s.c | 6 +- sound/soc/bcm/cygnus-ssp.c | 4 +- sound/soc/cirrus/ep93xx-i2s.c | 4 +- sound/soc/codecs/adav80x.c | 4 +- sound/soc/codecs/arizona.c | 2 +- sound/soc/codecs/cs4271.c | 4 +- sound/soc/codecs/madera.c | 2 +- sound/soc/codecs/max98090.c | 6 +- sound/soc/codecs/tlv320aic23.c | 2 +- sound/soc/codecs/tlv320dac33.c | 2 +- sound/soc/codecs/uda1380.c | 2 +- sound/soc/codecs/wl1273.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8753.c | 4 +- sound/soc/dwc/dwc-i2s.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_spdif.c | 4 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 14 ++-- sound/soc/jz4740/jz4740-i2s.c | 8 +-- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 8 +-- sound/soc/meson/axg-tdm-interface.c | 2 +- sound/soc/pxa/pxa-ssp.c | 8 +-- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/soc-compress.c | 4 +- sound/soc/soc-core.c | 11 +-- sound/soc/soc-dai.c | 23 +++++++ sound/soc/soc-dapm.c | 8 +-- sound/soc/soc-pcm.c | 70 +++++++------------- sound/soc/ti/davinci-mcasp.c | 2 +- sound/soc/ti/omap-dmic.c | 4 +- sound/soc/ti/omap-mcbsp.c | 4 +- sound/soc/ti/omap-mcpdm.c | 8 +-- sound/soc/uniphier/aio-cpu.c | 4 +- 37 files changed, 155 insertions(+), 125 deletions(-) -- 2.17.1 commit a1c3ec70ee10c4309cfb3d913af9bf0acb448766 Merge: 3cd4de03c7ce ee5866222ab5 Author: Mark Brown Date: Mon May 18 16:43:48 2020 +0100 Merge series "ASoC: codecs: rt*-sdw: memory leaks and simplifications" from Pierre-Louis Bossart : While debugging unrelated memory corruption errors, I detected issues related to the interaction with the SoundWire and ASoC cores, here are 3 small patches to fix all this. Pierre-Louis Bossart (3): ASoC: codecs: rt*-sdw: don't assign slave_ops ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream() ASoC: codecs: rt1308-sdw: remove duplicate allocation sound/soc/codecs/rt1308-sdw.c | 11 +++-------- sound/soc/codecs/rt5682-sdw.c | 3 --- sound/soc/codecs/rt5682.c | 3 +++ sound/soc/codecs/rt700-sdw.c | 3 --- sound/soc/codecs/rt700.c | 3 +++ sound/soc/codecs/rt711-sdw.c | 3 --- sound/soc/codecs/rt711.c | 3 +++ sound/soc/codecs/rt715-sdw.c | 3 --- sound/soc/codecs/rt715.c | 3 +++ 9 files changed, 15 insertions(+), 20 deletions(-) base-commit: d731c1a0f935dbebf4a851e072f8c7309eb2b8c5 -- 2.20.1 commit 3cd4de03c7ce93009e7a489dbcde5cd14cabd057 Merge: 949531d9b88c 47f98c55a50c Author: Mark Brown Date: Mon May 18 16:43:46 2020 +0100 Merge series "ASoC: Intel: minor fixes to machine drivers" from Pierre-Louis Bossart : Minor button remap changes, inspired by recent Chromebook patches, typo in component string reported by Jaroslav and driver name change not submitted in last wm8804 contribution. Pierre-Louis Bossart (5): ASoC: Intel: soc-acpi: change machine driver name for WM8804 platforms ASoC: Intel: sof_sdw: fix typo in components string ASoC: Intel: sof_sdw_rt711: remap buttons ASoC: Intel: sof_sdw_rt700: remap buttons ASoC: Intel: cht_bsw_nau8824: remap BTN_0 as KEY_PLAYPAUSE sound/soc/intel/boards/cht_bsw_nau8824.c | 4 ++-- sound/soc/intel/boards/sof_sdw.c | 2 +- sound/soc/intel/boards/sof_sdw_rt700.c | 8 ++++---- sound/soc/intel/boards/sof_sdw_rt711.c | 8 ++++---- sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) base-commit: d731c1a0f935dbebf4a851e072f8c7309eb2b8c5 -- 2.20.1 commit 949531d9b88ca176c5d1893b0c87325b592d9c81 Merge: 15b5c496ff99 f7a8ae295ca8 Author: Mark Brown Date: Mon May 18 16:43:45 2020 +0100 Merge series "ASoC: da7213: support for usage with simple-card" from Sebastian Reichel : Hi, This extends the da7213 driver to be used with simple-audio-card in combination with a fixed clock. Here is a snippet of the downstream board's DT, that is supposed to be supported by this patchset. --------------------------------------------------------------------- / { sound { compatible = "simple-audio-card"; simple-audio-card,name = "audio-card"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&dailink_master>; simple-audio-card,frame-master = <&dailink_master>; simple-audio-card,widgets = "Speaker", "Ext Spk"; simple-audio-card,audio-routing = "Ext Spk", "LINE"; simple-audio-card,cpu { sound-dai = <&ssi1>; }; dailink_master: simple-audio-card,codec { sound-dai = <&codec>; }; }; clk_ext_audio_codec: clock-codec { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <12288000>; }; }; &i2c1 { codec: audio-codec@1a { compatible = "dlg,da7212"; reg = <0x1a>; #sound-dai-cells = <0>; VDDA-supply = <®_2v5_audio>; VDDSP-supply = <®_5v0_audio>; VDDMIC-supply = <®_3v3_audio>; VDDIO-supply = <®_3v3_audio>; clocks = <&clk_ext_audio_codec>; clock-names = "mclk"; }; }; --------------------------------------------------------------------- This is mostly a resend of PATCHv2. There was quite a bit of discussion for the last patch. As far as I can see no better solution was found and the patch is fine as is. Sorry for the delay in sending another revision. Changes since PATCHv2: * https://lore.kernel.org/alsa-devel/20191120152406.2744-1-sebastian.reichel@collabora.com/ * dropped patch converting DA7213 into selectable Kconfig option (merged) * fix compatible string in patch 1 (DT binding) as pointed out by Adam Thomson * collected Reviewed-by from Adam Thomson for patch 2-4 Changes since PATCHv1: * https://lore.kernel.org/alsa-devel/20191108174843.11227-1-sebastian.reichel@collabora.com/ * add patch adding da7212 compatible to DT bindings * update regulator patch, so that VDDA is enabled together with VDDIO while the device is enabled to avoid device reset * update clock patch, so that automatic PLL handling is not enabled when PLL is configured manually * update clock patch, so that automatic PLL is disabled when the device is suspended * update clock patch, so that automatic PLL is configured into bypass mode when possible -- Sebastian Sebastian Reichel (5): ASoC: da7213: Add da7212 DT compatible ASoC: da7213: Add regulator support ASoC: da7213: move set_sysclk to codec level ASoC: da7213: move set_pll to codec level ASoC: da7213: add default clock handling .../devicetree/bindings/sound/da7213.txt | 8 +- sound/soc/codecs/da7213.c | 172 ++++++++++++++++-- sound/soc/codecs/da7213.h | 11 ++ 3 files changed, 175 insertions(+), 16 deletions(-) -- 2.26.2 commit 15b5c496ff99ce99ab3c5e98e96981d015b3168a Author: Tang Bin Date: Mon May 18 19:00:40 2020 +0800 ASoC: fsl_micfil: Fix unused assignment in fsl_set_clock_params() Delete unused initialized value of 'ret', because it will be assigned by the function fsl_micfil_set_mclk_rate(). Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200518110040.18036-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit f0a77d2b0e1ccad7e4086094f67d138e8c3050a2 Author: Akshu Agrawal Date: Mon May 18 10:09:05 2020 +0530 ASoC: amd: raven: Make the driver name consistent across files This fixes the issue of driver not getting auto loaded with MODULE_ALIAS. With this patch: $find /sys/devices -name modalias -print0 | xargs -0 grep -i acp3x /sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_i2s_playcap.2/ modalias:platform:acp3x_i2s_playcap /sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_i2s_playcap.0/ modalias:platform:acp3x_i2s_playcap /sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_rv_i2s_dma.0/ modalias:platform:acp3x_rv_i2s_dma /sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_i2s_playcap.1/ modalias:platform:acp3x_i2s_playcap Signed-off-by: Akshu Agrawal Link: https://lore.kernel.org/r/20200518043913.40646-1-akshu.agrawal@amd.com Signed-off-by: Mark Brown commit 11106cb37ade76719bb3feac9fa6ba68173a38a0 Author: Tang Bin Date: Mon May 18 18:59:51 2020 +0800 ASoC: fsl_micfil: Fix indentation to put on one line affected code In the function fsl_micfil_startup(), the two lines of dev_err() can be shortened to one line. Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200518105951.19200-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit 357abc1d6b832bdb6a7d27ed258f6d2be27d096d Author: Vinod Koul Date: Sat May 16 21:55:16 2020 +0530 usb: renesas-xhci: include correct header for get_unaligned_le16() get_unaligned_le16() is defined in linux/unaligned/access_ok.h header but it uses symbols which may not be available, leading to build failures on ia64. Using asm/unaligned.h seem to be the right thing and used in other drivers. This fixes below error reported by kbuild test robot In file included from drivers/usb/host/xhci-pci-renesas.c:9: >> include/linux/unaligned/access_ok.h:8:28: error: redefinition of 'get_unaligned_le16' 8 | static __always_inline u16 get_unaligned_le16(const void *p) | ^~~~~~~~~~~~~~~~~~ In file included from arch/ia64/include/asm/unaligned.h:5, from arch/ia64/include/asm/io.h:23, from arch/ia64/include/asm/smp.h:21, from include/linux/smp.h:67, from include/linux/percpu.h:7, from include/linux/arch_topology.h:9, from include/linux/topology.h:30, from include/linux/gfp.h:9, from include/linux/xarray.h:14, from include/linux/radix-tree.h:18, from include/linux/idr.h:15, from include/linux/kernfs.h:13, from include/linux/sysfs.h:16, from include/linux/kobject.h:20, from include/linux/of.h:17, from include/linux/irqdomain.h:35, from include/linux/acpi.h:13, from drivers/usb/host/xhci-pci-renesas.c:4: include/linux/unaligned/le_struct.h:7:19: note: previous definition of 'get_unaligned_le16' was here 7 | static inline u16 get_unaligned_le16(const void *p) | ^~~~~~~~~~~~~~~~~~ In file included from drivers/usb/host/xhci-pci-renesas.c:9: include/linux/unaligned/access_ok.h:13:28: error: redefinition of 'get_unaligned_le32' 13 | static __always_inline u32 get_unaligned_le32(const void *p) | ^~~~~~~~~~~~~~~~~~ In file included from arch/ia64/include/asm/unaligned.h:5, from arch/ia64/include/asm/io.h:23, from arch/ia64/include/asm/smp.h:21, from include/linux/smp.h:67, from include/linux/percpu.h:7, from include/linux/arch_topology.h:9, from include/linux/topology.h:30, from include/linux/gfp.h:9, from include/linux/xarray.h:14, from include/linux/radix-tree.h:18, from include/linux/idr.h:15, from include/linux/kernfs.h:13, from include/linux/sysfs.h:16, from include/linux/kobject.h:20, from include/linux/of.h:17, from include/linux/irqdomain.h:35, from include/linux/acpi.h:13, from drivers/usb/host/xhci-pci-renesas.c:4: include/linux/unaligned/le_struct.h:12:19: note: previous definition of 'get_unaligned_le32' was here Fixes: 8bd5741e3145 ("usb: renesas-xhci: Add the renesas xhci driver") Reported-by: kbuild test robot Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200516162516.385149-1-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit 43c8546bcd854806736d8a635a0d696504dd4c21 Author: Andrey Grodzovsky Date: Tue Apr 28 01:28:43 2020 -0400 drm/amdgpu: Add a UAPI flag for user to call mem_sync When this flag is set in the CS IB flags, it causes a memory cache flush of the GFX. v2: Move new flag to drm_amdgpu_cs_chunk_ib.flags Bump up UAPI version Remove condition on job != null to emit mem_sync Signed-off-by: Andrey Grodzovsky Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit d35745bbec0958ec09a6580dea537828a571c632 Author: Marek Olšák Date: Mon Apr 27 16:04:47 2020 -0400 drm/amdgpu: apply AMDGPU_IB_FLAG_EMIT_MEM_SYNC to compute IBs too (v3) Compute IBs need this too. v2: split out version bump v3: squash in emit frame count fixes Signed-off-by: Marek Olšák Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2f9ce2a3860588803dc2ce4c866c06b29f5a201c Author: Andrey Grodzovsky Date: Fri May 8 14:34:26 2020 -0400 drm/amdgpu: Add mem_sync implementation for all the ASICs. Implement the .mem_sync hook defined earlier. v2: Rename functions Signed-off-by: Andrey Grodzovsky Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 22301177dbcb99eb1101ed5698c5b2239d024f8f Author: Andrey Grodzovsky Date: Tue Mar 24 16:37:01 2020 -0400 drm/amdgpu: Add new ring callback to insert memory sync Used to flush and invalidate various caches. v2: Rename function hook Signed-off-by: Andrey Grodzovsky Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 4e01847c38f7a5e2b0ffa8ff74d6bf0e85924240 Author: Kevin Wang Date: Mon Apr 27 23:45:49 2020 +0800 drm/amdgpu: optimize amdgpu device attribute code unified amdgpu device attribute node functions: 1. add some helper functions to create amdgpu device attribute node. 2. create device node according to device attr flags on different VF mode. 3. rename some functions name to adapt a new interface. v2: 1. remove ATTR_STATE_DEAD, ATTR_STATE_ALIVE enum. 2. rename callback function perform to attr_update. 3. modify some variable names Signed-off-by: Kevin Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a7f28103374787ae43b936cd2ec2f8388958668e Author: Kevin Wang Date: Wed Apr 29 18:49:23 2020 +0800 drm/amdgpu: add amdgpu_virt_get_vf_mode helper function the swsmu or powerplay(hwmgr) need to handle task according to different VF mode, this function to help query vf mode. vf mode: 1. SRIOV_VF_MODE_BARE_METAL: the driver work on host OS (PF) 2. SRIOV_VF_MODE_ONE_VF : the driver work on guest OS with one VF 3. SRIOV_VF_MODE_MULTI_VF : the driver work on guest OS with multi VF Signed-off-by: Kevin Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 728e7e0cd61899208e924472b9e641dbeb0775c4 Author: Jiange Zhao Date: Sun Apr 26 17:57:00 2020 +0800 drm/amdgpu: Add autodump debugfs node for gpu reset v8 When GPU got timeout, it would notify an interested part of an opportunity to dump info before actual GPU reset. A usermode app would open 'autodump' node under debugfs system and poll() for readable/writable. When a GPU reset is due, amdgpu would notify usermode app through wait_queue_head and give it 10 minutes to dump info. After usermode app has done its work, this 'autodump' node is closed. On node closure, amdgpu gets to know the dump is done through the completion that is triggered in release(). There is no write or read callback because necessary info can be obtained through dmesg and umr. Messages back and forth between usermode app and amdgpu are unnecessary. v2: (1) changed 'registered' to 'app_listening' (2) add a mutex in open() to prevent race condition v3 (chk): grab the reset lock to avoid race in autodump_open, rename debugfs file to amdgpu_autodump, provide autodump_read as well, style and code cleanups v4: add 'bool app_listening' to differentiate situations, so that the node can be reopened; also, there is no need to wait for completion when no app is waiting for a dump. v5: change 'bool app_listening' to 'enum amdgpu_autodump_state' add 'app_state_mutex' for race conditions: (1)Only 1 user can open this file node (2)wait_dump() can only take effect after poll() executed. (3)eliminated the race condition between release() and wait_dump() v6: removed 'enum amdgpu_autodump_state' and 'app_state_mutex' removed state checking in amdgpu_debugfs_wait_dump Improve on top of version 3 so that the node can be reopened. v7: move reinit_completion into open() so that only one user can open it. v8: remove complete_all() from amdgpu_debugfs_wait_dump(). Signed-off-by: Jiange Zhao Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 0812a08ac8d054efc6cf2895d3b0e82c8731f8e9 Author: Kuninori Morimoto Date: Fri May 15 09:48:02 2020 +0900 ASoC: cleanup dai / component active code No one is using dai->active, snd_soc_component_is_active(). Let's remove these. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87imgy58hp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8db4f94fb3088528a8a64e2c39c8bf764a9433b0 Author: Kuninori Morimoto Date: Fri May 15 09:47:57 2020 +0900 ASoC: dwc: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87k11e58hu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 25d6755213f42ecf0c89f8619747be45e71382ac Author: Kuninori Morimoto Date: Fri May 15 09:47:53 2020 +0900 ASoC: uniphier: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87lflu58hy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 36ad1a87104e4a54f6acaffbe2d9533f80179e74 Author: Kuninori Morimoto Date: Fri May 15 09:47:48 2020 +0900 ASoC: ti: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/87mu6a58i3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit aaeb5fb59965217789258486080105337483a9e7 Author: Kuninori Morimoto Date: Fri May 15 09:47:41 2020 +0900 ASoC: pxa: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87o8qq58ia.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1f79aab5a44871286d414eb2a289aaeea4236fd1 Author: Kuninori Morimoto Date: Fri May 15 09:47:36 2020 +0900 ASoC: meson: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87pnb658if.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7995981bcfbc150902395af4191a77c9f4b842cd Author: Kuninori Morimoto Date: Fri May 15 09:47:31 2020 +0900 ASoC: mediatek: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87r1vm58ik.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 48afb287853effb07253bb2ccad2123f37770a8f Author: Kuninori Morimoto Date: Fri May 15 09:47:27 2020 +0900 ASoC: jz4740: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87sgg258io.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 846d0a17a8042ea753387b7571731d8265b87868 Author: Kuninori Morimoto Date: Fri May 15 09:47:22 2020 +0900 ASoC: intel: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87tv0i58it.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1d9fb19d8f644bfa17c79660b823b7ad07b0b046 Author: Kuninori Morimoto Date: Fri May 15 09:47:17 2020 +0900 ASoC: fsl: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87v9ky58iy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5e518eddd11e8f71aaffc954dc7ee9572fc59808 Author: Kuninori Morimoto Date: Fri May 15 09:47:11 2020 +0900 ASoC: codecs: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87wo5e58j4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 90a61a549df10082463c1ec37bc378799febe8a9 Author: Kuninori Morimoto Date: Fri May 15 09:47:05 2020 +0900 ASoC: cirrus: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87y2pu58ja.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8ca4602d38c5140ae2cbeec9f1dd7803b0c4d61d Author: Kuninori Morimoto Date: Fri May 15 09:47:01 2020 +0900 ASoC: bcm: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87zhaa58je.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e1c7e1faa404df564e64785c0b5cb7f1ee2d785d Author: Kuninori Morimoto Date: Fri May 15 09:46:56 2020 +0900 ASoC: atomel: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/871rnm6n3z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b3dea624b52e8b18cd49f804ce70fe50374aa5db Author: Kuninori Morimoto Date: Fri May 15 09:46:51 2020 +0900 ASoC: use snd_soc_xxx_active() We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/8736826n44.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5552f8d72893cea29a0074a3ea0a1a5766858fcd Author: Kuninori Morimoto Date: Fri May 15 09:46:47 2020 +0900 ASoC: soc-dai: add snd_soc_dai_stream_active() Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/874ksi6n48.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 488b2ca599f96d46d4a4d730845a247328cb6a28 Author: Kuninori Morimoto Date: Fri May 15 09:46:42 2020 +0900 ASoC: soc-component: add snd_soc_component_active() Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/875zcy6n4d.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit efffd9b344adbf813e3ae6f6136df80000bf2833 Author: Kuninori Morimoto Date: Fri May 15 09:46:37 2020 +0900 ASoC: soc-dai: add snd_soc_dai_active() Current snd_soc_dai_action() is updating dai->stream_active for Playback/Capture (A), dai->active for DAI (B) void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action) { (A) dai->stream_active[stream] += action; (B) dai->active += action; dai->component->active += action; } But, these are very verbose, because we can calculate DAI active from stream_active. This patch adds snd_soc_dai_active() which calculate DAI active from DAI stream_active. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/877dxe6n4i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 45eb8666e52d2d1733fda7353e48906d34a71e5d Author: Kuninori Morimoto Date: Fri May 15 09:46:33 2020 +0900 ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate() soc-dapm.c :: snd_soc_dai_link_event_pre_pmu() / snd_soc_dai_link_event() are directly updating dai->active without caring about stream_active / component->active. It is breaking xxx_active count balance. This patch uses snd_soc_dai_action() for it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/878shu6n4n.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit dc82910682ef06d5e5a81b4b359945b6f669ee3b Author: Kuninori Morimoto Date: Fri May 15 09:46:27 2020 +0900 ASoC: soc-dai: add snd_soc_dai_action() snd_soc_runtime_action() updates DAI's xxx_active. We should update these in the same time, and it can be implemented at soc-dai.c. This patch adds snd_soc_dai_action() for it. This is prepare for xxx_active cleanup. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87a72a6n4s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d9051d86ad30ca1ef1fc99e29854daeeb3944f8f Author: Kuninori Morimoto Date: Fri May 15 09:46:21 2020 +0900 ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro snd_soc_runtime_activate()/deactivate() are implemented by global function which are just calling snd_soc_runtime_action(). We can replace it to macro, and this patch do it. This patch is prepare for xxx_active cleanup. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87blmq6n4y.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7fb39bf2a1de9dc9e0846a1e3fe74e959a693a0d Author: Kishon Vijay Abraham I Date: Fri May 8 18:36:45 2020 +0530 PCI: cadence: Fix to read 32-bit Vendor ID/Device ID property from DT The PCI Bus Binding specification (IEEE Std 1275-1994 Revision 2.1 [1]) defines both Vendor ID and Device ID to be 32-bits. Fix pcie-cadence-host.c driver to read 32-bit Vendor ID and Device ID properties from device tree. [1] -> https://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf Link: https://lore.kernel.org/r/20200508130646.23939-4-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring Acked-by: Tom Joseph commit 9e2618c3f1a9499a921131a913b25d1347f16261 Author: Kishon Vijay Abraham I Date: Fri May 8 18:36:44 2020 +0530 PCI: cadence: Remove "cdns,max-outbound-regions" DT property "cdns,max-outbound-regions" device tree property provides the maximum number of outbound regions supported by the Host PCIe controller. However the outbound regions are configured based on what is populated in the "ranges" DT property. Avoid using two properties for configuring outbound regions and use only "ranges" property instead. Link: https://lore.kernel.org/r/20200508130646.23939-3-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring Acked-by: Tom Joseph commit fb5f8f3ca5f853568a1872c9aeb432e1743ebd18 Author: Kishon Vijay Abraham I Date: Fri May 8 18:36:43 2020 +0530 dt-bindings: PCI: cadence: Deprecate inbound/outbound specific bindings Deprecate cdns,max-outbound-regions and cdns,no-bar-match-nbits for host mode as both these could be derived from "ranges" and "dma-ranges" property. "cdns,max-outbound-regions" property would still be required for EP mode. Link: https://lore.kernel.org/r/20200508130646.23939-2-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Tom Joseph commit 88d801aec6e971c15a0bfb4d46d02476dde9e8aa Author: Tudor Ambarus Date: Mon May 18 11:49:21 2020 +0000 ARM: dts: at91: sama5d2_xplained: Add aliases for the dedicated I2C IPs The sama5d2 SoC has two dedicated I2C IPs that are enabled on sama5d2_xplained. Add alias for the i2c devices to not rely on probe order for the i2c device numbering. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200518114802.253660-1-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 52f3fab0067d6fa9e99c1b7f63265dd48ca76046 Author: Jean-Philippe Brucker Date: Wed May 13 13:02:57 2020 +0200 iommu/arm-smmu-v3: Don't reserve implementation defined register space Some SMMUv3 implementation embed the Perf Monitor Group Registers (PMCG) inside the first 64kB region of the SMMU. Since PMCG are managed by a separate driver, this layout causes resource reservation conflicts during boot. To avoid this conflict, don't reserve the MMIO regions that are implementation defined. Although devm_ioremap_resource() still works on full pages under the hood, this way we benefit from resource conflict checks. Fixes: 7d839b4b9e00 ("perf/smmuv3: Add arm64 smmuv3 pmu driver") Signed-off-by: Jean-Philippe Brucker Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20200513110255.597203-1-jean-philippe@linaro.org Signed-off-by: Will Deacon commit d100ff3843b731c5c0c974bc9210cf092a7ec9b6 Author: Sibi Sankar Date: Mon May 11 23:25:32 2020 +0530 iommu/arm-smmu-qcom: Request direct mapping for modem device The modem remote processor has two access paths to DDR. One path is directly connected to DDR and another path goes through an SMMU. The SMMU path is configured to be a direct mapping because it's used by various peripherals in the modem subsystem. Typically this direct mapping is configured statically at EL2 by QHEE (Qualcomm's Hypervisor Execution Environment) before the kernel is entered. In certain firmware configuration, especially when the kernel is already in full control of the SMMU, defer programming the modem SIDs to the kernel. Let's add compatibles here so that we can have the kernel program the SIDs for the modem in these cases. Signed-off-by: Sibi Sankar Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200511175532.25874-1-sibis@codeaurora.org Signed-off-by: Will Deacon commit 333564add0e553da9619a6591ae3cdbd561449b0 Author: Douglas Anderson Date: Thu May 7 13:08:40 2020 -0700 Revert "kgdboc: disable the console lock when in kgdb" This reverts commit 81eaadcae81b4c1bf01649a3053d1f54e2d81cf1. Commit 81eaadcae81b ("kgdboc: disable the console lock when in kgdb") is no longer needed now that we have the patch ("kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb"). Revert it. Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.2.I02258eee1497e55bcbe8dc477de90369c7c7c2c5@changeid Signed-off-by: Daniel Thompson commit 202164fbfa2b2ffa3e66b504e0f126ba9a745006 Author: Douglas Anderson Date: Thu May 7 13:08:39 2020 -0700 kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb In commit 81eaadcae81b ("kgdboc: disable the console lock when in kgdb") we avoided the WARN_CONSOLE_UNLOCKED() yell when we were in kgdboc. That still works fine, but it turns out that we get a similar yell when using other I/O drivers. One example is the "I/O driver" for the kgdb test suite (kgdbts). When I enabled that I again got the same yells. Even though "kgdbts" doesn't actually interact with the user over the console, using it still causes kgdb to print to the consoles. That trips the same warning: con_is_visible+0x60/0x68 con_scroll+0x110/0x1b8 lf+0x4c/0xc8 vt_console_print+0x1b8/0x348 vkdb_printf+0x320/0x89c kdb_printf+0x68/0x90 kdb_main_loop+0x190/0x860 kdb_stub+0x2cc/0x3ec kgdb_cpu_enter+0x268/0x744 kgdb_handle_exception+0x1a4/0x200 kgdb_compiled_brk_fn+0x34/0x44 brk_handler+0x7c/0xb8 do_debug_exception+0x1b4/0x228 Let's increment/decrement the "ignore_console_lock_warning" variable all the time when we enter the debugger. This will allow us to later revert commit 81eaadcae81b ("kgdboc: disable the console lock when in kgdb"). Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.1.Ied2b058357152ebcc8bf68edd6f20a11d98d7d4e@changeid Signed-off-by: Daniel Thompson commit a5cda73e49aaaac58b25750f4b591c0dc9726a44 Author: Chuck Lever Date: Mon Mar 16 14:53:04 2020 -0400 SUNRPC: Restructure svc_tcp_recv_record() Refactor: svc_recvfrom() is going to be converted to read into bio_vecs in a moment. Unhook the only other caller, svc_tcp_recv_record(), which just wants to read the 4-byte stream record marker into a kvec. While we're in the area, streamline this helper by straight-lining the hot path, replace dprintk call sites with tracepoints, and reduce the number of atomic bit operations in this path. Signed-off-by: Chuck Lever commit 02648908d19a99532b0839959e38ae53d95d2798 Author: Chuck Lever Date: Tue Mar 17 14:12:15 2020 -0400 SUNRPC: Rename svc_sock::sk_reclen Clean up. I find the name of the svc_sock::sk_reclen field confusing, so I've changed it to better reflect its function. This field is not read directly to get the record length. Rather, it is a buffer containing a record marker that needs to be decoded. Signed-off-by: Chuck Lever commit b4af59328c25bdd585bc1da14f25d8ba4ebc616c Author: Chuck Lever Date: Sat May 2 11:59:37 2020 -0400 SUNRPC: Trace server-side rpcbind registration events Signed-off-by: Chuck Lever commit a0469f46faab786e8ec9f8c8526a185357b38772 Author: Chuck Lever Date: Wed Mar 18 11:20:50 2020 -0400 SUNRPC: Replace dprintk call sites in TCP state change callouts Report TCP socket state changes and accept failures via tracepoints, replacing dprintk() call sites. No tracepoint is added in svc_tcp_listen_data_ready. There's no information available there that isn't also reported by the svcsock_new_socket and the accept failure tracepoints. Signed-off-by: Chuck Lever commit 998024dee197944a7018a0bdc85b83b569ddec22 Author: Chuck Lever Date: Tue Mar 17 15:06:31 2020 -0400 SUNRPC: Add more svcsock tracepoints In addition to tracing recently-updated socket sendto events, this commit adds a trace event class that can be used for additional svcsock-related tracepoints in subsequent patches. Signed-off-by: Chuck Lever commit d998882b4b1b08e72f4414d8eb6647af72bffe2f Author: Chuck Lever Date: Fri May 1 10:40:47 2020 -0400 SUNRPC: Remove "#include " Clean up: Commit 850cbaddb52d ("udp: use it's own memory accounting schema") removed the last skb-related tracepoint from svcsock.c, so it is no longer necessary to include trace/events/skb.h. Signed-off-by: Chuck Lever commit 11bbb0f76e995cb617f582e7a4ec6cb8f6daf910 Author: Chuck Lever Date: Tue Mar 17 17:41:43 2020 -0400 SUNRPC: Trace a few more generic svc_xprt events In lieu of dprintks or tracepoints in each individual transport implementation, introduce tracepoints in the generic part of the RPC layer. These typically fire for connection lifetime events, so shouldn't contribute a lot of noise. Signed-off-by: Chuck Lever commit 4b8f380e46e4d3f8e9f6f9545fe2b78b872b6070 Author: Chuck Lever Date: Tue Apr 28 17:13:32 2020 -0400 SUNRPC: Tracepoint to record errors in svc_xpo_create() Capture transport creation failures. Signed-off-by: Chuck Lever commit e3e67621e307920c338393d9a33ccb902354ca31 Author: Chuck Lever Date: Tue Apr 28 17:38:13 2020 -0400 SUNRPC: Remove kernel memory address from svc_xprt tracepoints Clean up: The xprt=%p was meant to distinguish events from different transports, but the addr=%s does that just as well and does not expose kernel memory addresses. Signed-off-by: Chuck Lever commit e979a173a0b8dc1a41bc3194e34b92d79c049ad3 Author: Chuck Lever Date: Thu Apr 30 15:25:01 2020 -0400 svcrdma: Add tracepoints to report ->xpo_accept failures Failure to accept a connection is typically due to a problem specific to a transport type. Also, ->xpo_accept returns NULL on error rather than reporting a specific problem. So, add failure-specific tracepoints in svc_rdma_accept(). Signed-off-by: Chuck Lever commit decc13f7eb258b8c5c564ec1f11a24f14af275f8 Author: Chuck Lever Date: Sat May 2 10:42:47 2020 -0400 svcrdma: Displayed remote IP address should match stored address Clean up: After commit 1e091c3bbf51 ("svcrdma: Ignore source port when computing DRC hash"), the IP address stored in xpt_remote always has a port number of zero. Thus, there's no need to display the port number when displaying the IP address of a remote NFS/RDMA client. Signed-off-by: Chuck Lever commit 08e3c9f181bfb78d842c4f432888116d66e07c2f Author: Chuck Lever Date: Wed Apr 29 16:00:12 2020 -0400 svcrdma: Remove the SVCRDMA_DEBUG macro Clean up: Commit d21b05f101ae ("rdma: SVCRMDA Header File") introduced the SVCRDMA_DEBUG macro, but it doesn't seem to have been used. Signed-off-by: Chuck Lever commit 27ce6294445aebe314ff3baefea7c720b50fcc8a Author: Chuck Lever Date: Mon Mar 23 16:33:16 2020 -0400 svcrdma: Rename tracepoints that record header decoding errors Clean up: Use a consistent naming convention so that these trace points can be enabled quickly via a glob. Signed-off-by: Chuck Lever commit f5046b8f43d180d6f4c9129a750b98f9a503de2d Author: Chuck Lever Date: Fri Mar 20 15:11:56 2020 -0400 svcrdma: Remove backchannel dprintk call sites Clean up. Signed-off-by: Chuck Lever commit ea740bd5f58e2912e74f401fd01a9d6aa985ca05 Author: Chuck Lever Date: Fri Mar 20 17:32:41 2020 -0400 svcrdma: Fix backchannel return code Way back when I was writing the RPC/RDMA server-side backchannel code, I misread the TCP backchannel reply handler logic. When svc_tcp_recvfrom() successfully receives a backchannel reply, it does not return -EAGAIN. It sets XPT_DATA and returns zero. Update svc_rdma_recvfrom() to return zero. Here, XPT_DATA doesn't need to be set again: it is set whenever a new message is received, behind a spin lock in a single threaded context. Also, if handling the cb reply is not successful, the message is simply dropped. There's no special message framing to deal with as there is in the TCP case. Now that the handle_bc_reply() return value is ignored, I've removed the dprintk call sites in the error exit of handle_bc_reply() in favor of trace points in other areas that already report the error cases. Signed-off-by: Chuck Lever commit dbc17acd5d42be457c7311c141f993d9ba5be014 Author: Chuck Lever Date: Fri Mar 20 14:36:44 2020 -0400 svcrdma: trace undersized Write chunks Clean up: Replace a dprintk call site. This is the last remaining dprintk call site in svc_rdma_rw.c, so remove dprintk infrastructure as well. Signed-off-by: Chuck Lever commit 9d20063892624a98bab093725fae6999cfcb328e Author: Chuck Lever Date: Fri Mar 20 14:33:05 2020 -0400 svcrdma: Trace page overruns when constructing RDMA Reads Clean up: Replace a dprintk call site with a tracepoint. Signed-off-by: Chuck Lever commit f4e53e1ce3e56a799c47fef5f4f94cb815b52804 Author: Chuck Lever Date: Fri Mar 20 14:23:13 2020 -0400 svcrdma: Clean up handling of get_rw_ctx errors Clean up: Replace two dprintk call sites with a tracepoint. Signed-off-by: Chuck Lever commit 2abfbe7e3a725380f22f572c69da41515a0dd43b Author: Chuck Lever Date: Fri Mar 20 14:02:49 2020 -0400 svcrdma: Clean up the tracing for rw_ctx_init errors - De-duplicate code - Rename the tracepoint with "_err" to allow enabling via glob - Report the sg_cnt for the failing rw_ctx - Fix a dumb signage issue Signed-off-by: Chuck Lever commit ca4faf543a33373bed3650812d5f0cd0bd295b1a Author: Chuck Lever Date: Sat May 2 10:37:44 2020 -0400 SUNRPC: Move xpt_mutex into socket xpo_sendto methods It appears that the RPC/RDMA transport does not need serialization of calls to its xpo_sendto method. Move the mutex into the socket methods that still need that serialization. Tail latencies are unambiguously better with this patch applied. fio randrw 8KB 70/30 on NFSv3, smaller numbers are better: clat percentiles (usec): With xpt_mutex: r | 99.99th=[ 8848] w | 99.99th=[ 9634] Without xpt_mutex: r | 99.99th=[ 8586] w | 99.99th=[ 8979] Serializing the construction of RPC/RDMA transport headers is not really necessary at this point, because the Linux NFS server implementation never changes its credit grant on a connection. If that should change, then svc_rdma_sendto will need to serialize access to the transport's credit grant fields. Reported-by: kbuild test robot [ cel: fix uninitialized variable warning ] Signed-off-by: Chuck Lever commit 30df74d67d48949da87e3a5b57c381763e8fd526 Author: Ravi Bangoria Date: Thu May 14 16:47:41 2020 +0530 powerpc/watchpoint/xmon: Support 2nd DAWR Add support for 2nd DAWR in xmon. With this, we can have two simultaneous breakpoints from xmon. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-17-ravi.bangoria@linux.ibm.com commit 514db915e7b33e7eaf8e40192b93380f79b319b5 Author: Ravi Bangoria Date: Thu May 14 16:47:40 2020 +0530 powerpc/watchpoint/xmon: Don't allow breakpoint overwriting Xmon allows overwriting breakpoints because it's supported by only one DAWR. But with multiple DAWRs, overwriting becomes ambiguous or unnecessary complicated. So let's not allow it. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-16-ravi.bangoria@linux.ibm.com commit 29da4f91c0c1fbda12b8a31be0d564930208c92e Author: Ravi Bangoria Date: Thu May 14 16:47:39 2020 +0530 powerpc/watchpoint: Don't allow concurrent perf and ptrace events With Book3s DAWR, ptrace and perf watchpoints on powerpc behaves differently. Ptrace watchpoint works in one-shot mode and generates signal before executing instruction. It's ptrace user's job to single-step the instruction and re-enable the watchpoint. OTOH, in case of perf watchpoint, kernel emulates/single-steps the instruction and then generates event. If perf and ptrace creates two events with same or overlapping address ranges, it's ambiguous to decide who should single-step the instruction. Because of this issue, don't allow perf and ptrace watchpoint at the same time if their address range overlaps. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-15-ravi.bangoria@linux.ibm.com commit 74c6881019b7d56c327fffc268d97adb5eb1b4f9 Author: Ravi Bangoria Date: Thu May 14 16:47:38 2020 +0530 powerpc/watchpoint: Prepare handler to handle more than one watchpoint Currently we assume that we have only one watchpoint supported by hw. Get rid of that assumption and use dynamic loop instead. This should make supporting more watchpoints very easy. With more than one watchpoint, exception handler needs to know which DAWR caused the exception, and hw currently does not provide it. So we need sw logic for the same. To figure out which DAWR caused the exception, check all different combinations of user specified range, DAWR address range, actual access range and DAWRX constrains. For ex, if user specified range and actual access range overlaps but DAWRX is configured for readonly watchpoint and the instruction is store, this DAWR must not have caused exception. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling [mpe: Unsplit multi-line printk() strings, fix some sparse warnings] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200514111741.97993-14-ravi.bangoria@linux.ibm.com commit e68ef121c1f4c38edf87a3354661ceb99d522729 Author: Ravi Bangoria Date: Thu May 14 16:47:37 2020 +0530 powerpc/watchpoint: Use builtin ALIGN*() macros Currently we calculate hw aligned start and end addresses manually. Replace them with builtin ALIGN_DOWN() and ALIGN() macros. So far end_addr was inclusive but this patch makes it exclusive (by avoiding -1) for better readability. Suggested-by: Christophe Leroy Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-13-ravi.bangoria@linux.ibm.com commit c9e82aeb197df2d93b1b4234bc0c80943fa594e8 Author: Ravi Bangoria Date: Thu May 14 16:47:36 2020 +0530 powerpc/watchpoint: Introduce is_ptrace_bp() function Introduce is_ptrace_bp() function and move the check inside the function. It will be utilize more in later set of patches. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-12-ravi.bangoria@linux.ibm.com commit 6b424efa119d5ea06b15ff240dddc3b4b9f9cdfb Author: Ravi Bangoria Date: Thu May 14 16:47:35 2020 +0530 powerpc/watchpoint: Use loop for thread_struct->ptrace_bps ptrace_bps is already an array of size HBP_NUM_MAX. But we use hardcoded index 0 while fetching/updating it. Convert such code to loop over array. ptrace interface to use multiple watchpoint remains same. eg: two PPC_PTRACE_SETHWDEBUG calls will create two watchpoint if underneath hw supports it. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-11-ravi.bangoria@linux.ibm.com commit 303e6a9ddcdc168e92253c78cdb4bbe1e10d78b3 Author: Ravi Bangoria Date: Thu May 14 16:47:34 2020 +0530 powerpc/watchpoint: Convert thread_struct->hw_brk to an array So far powerpc hw supported only one watchpoint. But Power10 is introducing 2nd DAWR. Convert thread_struct->hw_brk into an array. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-10-ravi.bangoria@linux.ibm.com commit 22a214e461c5cc9428b86915d9cfcf84c6e11ad7 Author: Ravi Bangoria Date: Thu May 14 16:47:33 2020 +0530 powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable Instead of disabling only first watchpoint, disable all available watchpoints while clearing dawr_force_enable. Callback function is used only for disabling watchpoint, rename it to disable_dawrs_cb(). And null_brk parameter is not really required while disabling watchpoint, remove it. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-9-ravi.bangoria@linux.ibm.com commit c2919132734f29a7a33e1339bef8a67b11f322eb Author: Ravi Bangoria Date: Thu May 14 16:47:32 2020 +0530 powerpc/watchpoint: Get watchpoint count dynamically while disabling them Instead of disabling only one watchpoint, get num of available watchpoints dynamically and disable all of them. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-8-ravi.bangoria@linux.ibm.com commit 4a8a9379f2af4c9928529b3959bc2d8f7023c6bc Author: Ravi Bangoria Date: Thu May 14 16:47:31 2020 +0530 powerpc/watchpoint: Provide DAWR number to __set_breakpoint Introduce new parameter 'nr' to __set_breakpoint() which indicates which DAWR should be programed. Also convert current_brk variable to an array. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-7-ravi.bangoria@linux.ibm.com commit a18b834625d345bfa89c4e2754dd6cbb0133c4d7 Author: Ravi Bangoria Date: Thu May 14 16:47:30 2020 +0530 powerpc/watchpoint: Provide DAWR number to set_dawr Introduce new parameter 'nr' to set_dawr() which indicates which DAWR should be programed. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-6-ravi.bangoria@linux.ibm.com commit 45093b382e0ac25c206b4dcd210c6be1f5e56e60 Author: Ravi Bangoria Date: Thu May 14 16:47:29 2020 +0530 powerpc/watchpoint/ptrace: Return actual num of available watchpoints User can ask for num of available watchpoints(dbginfo.num_data_bps) using ptrace(PPC_PTRACE_GETHWDBGINFO). Return actual number of available watchpoints on the machine rather than hardcoded 1. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-5-ravi.bangoria@linux.ibm.com commit a6ba44e8799230e36c8ab06fda7f77f421e9e795 Author: Ravi Bangoria Date: Thu May 14 16:47:28 2020 +0530 powerpc/watchpoint: Introduce function to get nr watchpoints dynamically So far we had only one watchpoint, so we have hardcoded HBP_NUM to 1. But Power10 is introducing 2nd DAWR and thus kernel should be able to dynamically find actual number of watchpoints supported by hw it's running on. Introduce function for the same. Also convert HBP_NUM macro to HBP_NUM_MAX, which will now represent maximum number of watchpoints supported by Powerpc. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-4-ravi.bangoria@linux.ibm.com commit 4a4ec2289a5d748cb64ff67ca8d74535a76a8436 Author: Ravi Bangoria Date: Thu May 14 16:47:27 2020 +0530 powerpc/watchpoint: Add SPRN macros for second DAWR Power10 is introducing second DAWR. Add SPRN_ macros for the same. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-3-ravi.bangoria@linux.ibm.com commit 09f82b063aa9c248a3ef919aeec361054e7b044a Author: Ravi Bangoria Date: Thu May 14 16:47:26 2020 +0530 powerpc/watchpoint: Rename current DAWR macros Power10 is introducing second DAWR. Use real register names from ISA for current macros: s/SPRN_DAWR/SPRN_DAWR0/ s/SPRN_DAWRX/SPRN_DAWRX0/ Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Reviewed-by: Michael Neuling Link: https://lore.kernel.org/r/20200514111741.97993-2-ravi.bangoria@linux.ibm.com commit 3920742b92f5ea19a220edb947b6f33c99f501da Author: Jordan Niethe Date: Wed May 6 13:40:50 2020 +1000 powerpc sstep: Add support for prefixed fixed-point arithmetic This adds emulation support for the following prefixed Fixed-Point Arithmetic instructions: * Prefixed Add Immediate (paddi) Signed-off-by: Jordan Niethe Reviewed-by: Balamuruhan S [mpe: Squash in get_op() usage] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-31-jniethe5@gmail.com commit 50b80a12e4ccff46d53b93754d817acd98bc9ae0 Author: Jordan Niethe Date: Wed May 6 13:40:49 2020 +1000 powerpc sstep: Add support for prefixed load/stores This adds emulation support for the following prefixed integer load/stores: * Prefixed Load Byte and Zero (plbz) * Prefixed Load Halfword and Zero (plhz) * Prefixed Load Halfword Algebraic (plha) * Prefixed Load Word and Zero (plwz) * Prefixed Load Word Algebraic (plwa) * Prefixed Load Doubleword (pld) * Prefixed Store Byte (pstb) * Prefixed Store Halfword (psth) * Prefixed Store Word (pstw) * Prefixed Store Doubleword (pstd) * Prefixed Load Quadword (plq) * Prefixed Store Quadword (pstq) the follow prefixed floating-point load/stores: * Prefixed Load Floating-Point Single (plfs) * Prefixed Load Floating-Point Double (plfd) * Prefixed Store Floating-Point Single (pstfs) * Prefixed Store Floating-Point Double (pstfd) and for the following prefixed VSX load/stores: * Prefixed Load VSX Scalar Doubleword (plxsd) * Prefixed Load VSX Scalar Single-Precision (plxssp) * Prefixed Load VSX Vector [0|1] (plxv, plxv0, plxv1) * Prefixed Store VSX Scalar Doubleword (pstxsd) * Prefixed Store VSX Scalar Single-Precision (pstxssp) * Prefixed Store VSX Vector [0|1] (pstxv, pstxv0, pstxv1) Signed-off-by: Jordan Niethe Reviewed-by: Balamuruhan S [mpe: Use CONFIG_PPC64 not __powerpc64__, use get_op()] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-30-jniethe5@gmail.com commit 9409d2f9dad2f0679d67dc24d8116dd3e837b035 Author: Jordan Niethe Date: Wed May 6 13:40:48 2020 +1000 powerpc: Support prefixed instructions in alignment handler If a prefixed instruction results in an alignment exception, the SRR1_PREFIXED bit is set. The handler attempts to emulate the responsible instruction and then increment the NIP past it. Use SRR1_PREFIXED to determine by how much the NIP should be incremented. Prefixed instructions are not permitted to cross 64-byte boundaries. If they do the alignment interrupt is invoked with SRR1 BOUNDARY bit set. If this occurs send a SIGBUS to the offending process if in user mode. If in kernel mode call bad_page_fault(). Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-29-jniethe5@gmail.com commit b4657f7650babc9bfb41ce875abe41b18604a105 Author: Jordan Niethe Date: Wed May 6 13:40:47 2020 +1000 powerpc/kprobes: Don't allow breakpoints on suffixes Do not allow inserting breakpoints on the suffix of a prefix instruction in kprobes. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-28-jniethe5@gmail.com commit c9c831aebd8663d0129bbcee4d76be889f0627fe Author: Jordan Niethe Date: Wed May 6 13:40:46 2020 +1000 powerpc/xmon: Don't allow breakpoints on suffixes Do not allow placing xmon breakpoints on the suffix of a prefix instruction. Signed-off-by: Jordan Niethe [mpe: Don't split printf strings across lines] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-27-jniethe5@gmail.com commit 785b79d1e02873c2088ee1301154c66dace66ce5 Author: Jordan Niethe Date: Wed May 6 13:40:45 2020 +1000 powerpc: Test prefixed instructions in feature fixups Expand the feature-fixups self-tests to includes tests for prefixed instructions. Signed-off-by: Jordan Niethe [mpe: Use CONFIG_PPC64 not __powerpc64__, add empty inlines] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-26-jniethe5@gmail.com commit f77f8ff7f13e6411c2e0ba25bb7e012a5ae6c927 Author: Jordan Niethe Date: Wed May 6 13:40:44 2020 +1000 powerpc: Test prefixed code patching Expand the code-patching self-tests to includes tests for patching prefixed instructions. Signed-off-by: Jordan Niethe [mpe: Use CONFIG_PPC64 not __powerpc64__] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-25-jniethe5@gmail.com commit 650b55b707fdfa764e9f2b81314d3eb4216fb962 Author: Jordan Niethe Date: Fri May 15 12:12:55 2020 +1000 powerpc: Add prefixed instructions to instruction data type For powerpc64, redefine the ppc_inst type so both word and prefixed instructions can be represented. On powerpc32 the type will remain the same. Update places which had assumed instructions to be 4 bytes long. Signed-off-by: Jordan Niethe Reviewed-by: Alistair Popple [mpe: Rework the get_user_inst() macros to be parameterised, and don't assign to the dest if an error occurred. Use CONFIG_PPC64 not __powerpc64__ in a few places. Address other comments from Christophe. Fix some sparse complaints.] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-24-jniethe5@gmail.com commit 7a8818e0df5c6b53c89c7c928498668a2bbb3de0 Author: Jordan Niethe Date: Fri May 15 11:15:28 2020 +1000 powerpc/optprobes: Add register argument to patch_imm64_load_insns() Currently patch_imm32_load_insns() is used to load an instruction to r4 to be emulated by emulate_step(). For prefixed instructions we would like to be able to load a 64bit immediate to r4. To prepare for this make patch_imm64_load_insns() take an argument that decides which register to load an immediate to - rather than hardcoding r3. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200516115449.4168796-1-mpe@ellerman.id.au commit b691505ef9232a6e82f1c160911afcb4cb20487b Author: Jordan Niethe Date: Wed May 6 13:40:42 2020 +1000 powerpc: Define new SRR1 bits for a ISA v3.1 Add the BOUNDARY SRR1 bit definition for when the cause of an alignment exception is a prefixed instruction that crosses a 64-byte boundary. Add the PREFIXED SRR1 bit definition for exceptions caused by prefixed instructions. Bit 35 of SRR1 is called SRR1_ISI_N_OR_G. This name comes from it being used to indicate that an ISI was due to the access being no-exec or guarded. ISA v3.1 adds another purpose. It is also set if there is an access in a cache-inhibited location for prefixed instruction. Rename from SRR1_ISI_N_OR_G to SRR1_ISI_N_G_OR_CIP. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-23-jniethe5@gmail.com commit 2aa6195e43b3740258ead93aee42ac719dd4c4b0 Author: Alistair Popple Date: Wed May 6 13:40:41 2020 +1000 powerpc: Enable Prefixed Instructions Prefix instructions have their own FSCR bit which needs to enabled via a CPU feature. The kernel will save the FSCR for problem state but it needs to be enabled initially. If prefixed instructions are made unavailable by the [H]FSCR, attempting to use them will cause a facility unavailable exception. Add "PREFIX" to the facility_strings[]. Currently there are no prefixed instructions that are actually emulated by emulate_instruction() within facility_unavailable_exception(). However, when caused by a prefixed instructions the SRR1 PREFIXED bit is set. Prepare for dealing with emulated prefixed instructions by checking for this bit. Signed-off-by: Alistair Popple Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Link: https://lore.kernel.org/r/20200506034050.24806-22-jniethe5@gmail.com commit 0b582db5490a1f250ef63337dd46d5c7599dae80 Author: Jordan Niethe Date: Wed May 6 13:40:40 2020 +1000 powerpc: Make test_translate_branch() independent of instruction length test_translate_branch() uses two pointers to instructions within a buffer, p and q, to test patch_branch(). The pointer arithmetic done on them assumes a size of 4. This will not work if the instruction length changes. Instead do the arithmetic relative to the void * to the buffer. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-21-jniethe5@gmail.com commit 7fccfcfba04f9cb46438f368755d368f6c57f3a0 Author: Jordan Niethe Date: Wed May 6 13:40:39 2020 +1000 powerpc/xmon: Move insertion of breakpoint for xol'ing When a new breakpoint is created, the second instruction of that breakpoint is patched with a trap instruction. This assumes the length of the instruction is always the same. In preparation for prefixed instructions, remove this assumption. Insert the trap instruction at the same time the first instruction is inserted. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-20-jniethe5@gmail.com commit 6c7a4f0a9f66fc7fdc6e208559e5d562f53e0991 Author: Jordan Niethe Date: Wed May 6 13:40:38 2020 +1000 powerpc/xmon: Use a function for reading instructions Currently in xmon, mread() is used for reading instructions. In preparation for prefixed instructions, create and use a new function, mread_instr(), especially for reading instructions. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-19-jniethe5@gmail.com commit 622cf6f436a12338bbcfbb3474629755547fd112 Author: Jordan Niethe Date: Wed May 6 13:40:37 2020 +1000 powerpc: Introduce a function for reporting instruction length Currently all instructions have the same length, but in preparation for prefixed instructions introduce a function for returning instruction length. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-18-jniethe5@gmail.com commit 5249385ad7f0ac178433f0ae9cc5b64612c8ff77 Author: Jordan Niethe Date: Wed May 6 13:40:36 2020 +1000 powerpc: Define and use get_user_instr() et. al. Define specialised get_user_instr(), __get_user_instr() and __get_user_instr_inatomic() macros for reading instructions from user and/or kernel space. Signed-off-by: Jordan Niethe Reviewed-by: Alistair Popple [mpe: Squash in addition of get_user_instr() & __user annotations] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-17-jniethe5@gmail.com commit a8646f43ba5046e7f5c4396125d5136bfcb17b49 Author: Jordan Niethe Date: Wed May 6 13:40:35 2020 +1000 powerpc/kprobes: Use patch_instruction() Instead of using memcpy() and flush_icache_range() use patch_instruction() which not only accomplishes both of these steps but will also make it easier to add support for prefixed instructions. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-16-jniethe5@gmail.com commit 95b980a00d1220ca67550a933166704db8bc5c14 Author: Jordan Niethe Date: Wed May 6 13:40:34 2020 +1000 powerpc: Add a probe_kernel_read_inst() function Introduce a probe_kernel_read_inst() function to use in cases where probe_kernel_read() is used for getting an instruction. This will be more useful for prefixed instructions. Signed-off-by: Jordan Niethe Reviewed-by: Alistair Popple [mpe: Don't write to *inst on error] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-15-jniethe5@gmail.com commit 7ba68b2172c19031fdc2a2caf37328edd146e299 Author: Jordan Niethe Date: Wed May 6 13:40:33 2020 +1000 powerpc: Add a probe_user_read_inst() function Introduce a probe_user_read_inst() function to use in cases where probe_user_read() is used for getting an instruction. This will be more useful for prefixed instructions. Signed-off-by: Jordan Niethe Reviewed-by: Alistair Popple [mpe: Don't write to *inst on error, fold in __user annotations] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-14-jniethe5@gmail.com commit f8faaffaa7d99028e457ef2d1dcb43a98f736938 Author: Jordan Niethe Date: Wed May 6 13:40:32 2020 +1000 powerpc: Use a function for reading instructions Prefixed instructions will mean there are instructions of different length. As a result dereferencing a pointer to an instruction will not necessarily give the desired result. Introduce a function for reading instructions from memory into the instruction data type. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-13-jniethe5@gmail.com commit 94afd069d937d84fb4f696eb9a78db4084e43d21 Author: Jordan Niethe Date: Wed May 6 13:40:31 2020 +1000 powerpc: Use a datatype for instructions Currently unsigned ints are used to represent instructions on powerpc. This has worked well as instructions have always been 4 byte words. However, ISA v3.1 introduces some changes to instructions that mean this scheme will no longer work as well. This change is Prefixed Instructions. A prefixed instruction is made up of a word prefix followed by a word suffix to make an 8 byte double word instruction. No matter the endianness of the system the prefix always comes first. Prefixed instructions are only planned for powerpc64. Introduce a ppc_inst type to represent both prefixed and word instructions on powerpc64 while keeping it possible to exclusively have word instructions on powerpc32. Signed-off-by: Jordan Niethe [mpe: Fix compile error in emulate_spe()] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-12-jniethe5@gmail.com commit 217862d9b98bf08958d57fd7b31b9de0f1a9477d Author: Jordan Niethe Date: Wed May 6 13:40:30 2020 +1000 powerpc: Introduce functions for instruction equality In preparation for an instruction data type that can not be directly used with the '==' operator use functions for checking equality. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Balamuruhan S Link: https://lore.kernel.org/r/20200506034050.24806-11-jniethe5@gmail.com commit aabd2233b6aefeee6d7a2f667076d8346be1d30a Author: Jordan Niethe Date: Wed May 6 13:40:29 2020 +1000 powerpc: Use a function for byte swapping instructions Use a function for byte swapping instructions in preparation of a more complicated instruction type. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Balamuruhan S Link: https://lore.kernel.org/r/20200506034050.24806-10-jniethe5@gmail.com commit 8094892d1aff14269d3b7bfcd8b941217eecd81f Author: Jordan Niethe Date: Wed May 6 13:40:28 2020 +1000 powerpc: Use a function for getting the instruction op code In preparation for using a data type for instructions that can not be directly used with the '>>' operator use a function for getting the op code of an instruction. Signed-off-by: Jordan Niethe Reviewed-by: Alistair Popple Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-9-jniethe5@gmail.com commit 777e26f0edf8dab58b8dd474d35d83bde0ac6d76 Author: Jordan Niethe Date: Wed May 6 13:40:27 2020 +1000 powerpc: Use an accessor for instructions In preparation for introducing a more complicated instruction type to accommodate prefixed instructions use an accessor for getting an instruction as a u32. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-8-jniethe5@gmail.com commit 753462512868674a788ecc77bb96752efb818785 Author: Jordan Niethe Date: Wed May 6 13:40:26 2020 +1000 powerpc: Use a macro for creating instructions from u32s In preparation for instructions having a more complex data type start using a macro, ppc_inst(), for making an instruction out of a u32. A macro is used so that instructions can be used as initializer elements. Currently this does nothing, but it will allow for creating a data type that can represent prefixed instructions. Signed-off-by: Jordan Niethe [mpe: Change include guard to _ASM_POWERPC_INST_H] Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-7-jniethe5@gmail.com commit 7c95d8893fb55869882c9f68f4c94840dc43f18f Author: Jordan Niethe Date: Wed May 6 13:40:25 2020 +1000 powerpc: Change calling convention for create_branch() et. al. create_branch(), create_cond_branch() and translate_branch() return the instruction that they create, or return 0 to signal an error. Separate these concerns in preparation for an instruction type that is not just an unsigned int. Fill the created instruction to a pointer passed as the first parameter to the function and use a non-zero return value to signify an error. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-6-jniethe5@gmail.com commit 5a7fdcab54ef17c395fc47e73c828a1432e51683 Author: Jordan Niethe Date: Wed May 6 13:40:24 2020 +1000 powerpc/xmon: Use bitwise calculations in_breakpoint_table() A modulo operation is used for calculating the current offset from a breakpoint within the breakpoint table. As instruction lengths are always a power of 2, this can be replaced with a bitwise 'and'. The current check for word alignment can be replaced with checking that the lower 2 bits are not set. Suggested-by: Christophe Leroy Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-5-jniethe5@gmail.com commit 4eff2b4f32a309e2171bfe53db3e93b5614f77cb Author: Jordan Niethe Date: Wed May 6 13:40:23 2020 +1000 powerpc/xmon: Move breakpoints to text section The instructions for xmon's breakpoint are stored bpt_table[] which is in the data section. This is problematic as the data section may be marked as no execute. Move bpt_table[] to the text section. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200506034050.24806-4-jniethe5@gmail.com commit 51c9ba11f17f25ace1ea6bbfd4586c59105432de Author: Jordan Niethe Date: Wed May 6 13:40:22 2020 +1000 powerpc/xmon: Move breakpoint instructions to own array To execute an instruction out of line after a breakpoint, the NIP is set to the address of struct bpt::instr. Here a copy of the instruction that was replaced with a breakpoint is kept, along with a trap so normal flow can be resumed after XOLing. The struct bpt's are located within the data section. This is problematic as the data section may be marked as no execute. Instead of each struct bpt holding the instructions to be XOL'd, make a new array, bpt_table[], with enough space to hold instructions for the number of supported breakpoints. A later patch will move this to the text section. Make struct bpt::instr a pointer to the instructions in bpt_table[] associated with that breakpoint. This association is a simple mapping: bpts[n] -> bpt_table[n * words per breakpoint]. Currently we only need the copied instruction followed by a trap, so 2 words per breakpoint. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Alistair Popple Link: https://lore.kernel.org/r/20200506034050.24806-3-jniethe5@gmail.com commit 802268fd82676ffce432776f60b93a0b15e58e0c Author: Jordan Niethe Date: Wed May 6 13:40:21 2020 +1000 powerpc/xmon: Remove store_inst() for patch_instruction() For modifying instructions in xmon, patch_instruction() can serve the same role that store_inst() is performing with the advantage of not being specific to xmon. In some places patch_instruction() is already being using followed by store_inst(). In these cases just remove the store_inst(). Otherwise replace store_inst() with patch_instruction(). Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Link: https://lore.kernel.org/r/20200506034050.24806-2-jniethe5@gmail.com commit 126554465d93b10662742128918a5fc338cda4aa Author: Geoff Levand Date: Sat May 9 18:58:32 2020 +0000 powerpc/ps3: Fix kexec shutdown hang The ps3_mm_region_destroy() and ps3_mm_vas_destroy() routines are called very late in the shutdown via kexec's mmu_cleanup_all routine. By the time mmu_cleanup_all runs it is too late to use udbg_printf, and calling it will cause PS3 systems to hang. Remove all debugging statements from ps3_mm_region_destroy() and ps3_mm_vas_destroy() and replace any error reporting with calls to lv1_panic. With this change builds with 'DEBUG' defined will not cause kexec reboots to hang, and builds with 'DEBUG' defined or not will end in lv1_panic if an error is encountered. Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7325c4af2b4c989c19d6a26b90b1fec9c0615ddf.1589049250.git.geoff@infradead.org commit 720bc316690bd27dea9d71510b50f0cd698ffc32 Author: Emmanuel Nicolet Date: Sat May 9 18:58:32 2020 +0000 ps3disk: use the default segment boundary Since commit dcebd755926b ("block: use bio_for_each_bvec() to compute multi-page bvec count"), the kernel will bug_on on the PS3 because bio_split() is called with sectors == 0: kernel BUG at block/bio.c:1853! Oops: Exception in kernel mode, sig: 5 [#1] BE PAGE_SIZE=4K MMU=Hash PREEMPT SMP NR_CPUS=8 NUMA PS3 Modules linked in: firewire_sbp2 rtc_ps3(+) soundcore ps3_gelic(+) \ ps3rom(+) firewire_core ps3vram(+) usb_common crc_itu_t CPU: 0 PID: 97 Comm: blkid Not tainted 5.3.0-rc4 #1 NIP: c00000000027d0d0 LR: c00000000027d0b0 CTR: 0000000000000000 REGS: c00000000135ae90 TRAP: 0700 Not tainted (5.3.0-rc4) MSR: 8000000000028032 CR: 44008240 XER: 20000000 IRQMASK: 0 GPR00: c000000000289368 c00000000135b120 c00000000084a500 c000000004ff8300 GPR04: 0000000000000c00 c000000004c905e0 c000000004c905e0 000000000000ffff GPR08: 0000000000000000 0000000000000001 0000000000000000 000000000000ffff GPR12: 0000000000000000 c0000000008ef000 000000000000003e 0000000000080001 GPR16: 0000000000000100 000000000000ffff 0000000000000000 0000000000000004 GPR20: c00000000062fd7e 0000000000000001 000000000000ffff 0000000000000080 GPR24: c000000000781788 c00000000135b350 0000000000000080 c000000004c905e0 GPR28: c00000000135b348 c000000004ff8300 0000000000000000 c000000004c90000 NIP [c00000000027d0d0] .bio_split+0x28/0xac LR [c00000000027d0b0] .bio_split+0x8/0xac Call Trace: [c00000000135b120] [c00000000027d130] .bio_split+0x88/0xac (unreliable) [c00000000135b1b0] [c000000000289368] .__blk_queue_split+0x11c/0x53c [c00000000135b2d0] [c00000000028f614] .blk_mq_make_request+0x80/0x7d4 [c00000000135b3d0] [c000000000283a8c] .generic_make_request+0x118/0x294 [c00000000135b4b0] [c000000000283d34] .submit_bio+0x12c/0x174 [c00000000135b580] [c000000000205a44] .mpage_bio_submit+0x3c/0x4c [c00000000135b600] [c000000000206184] .mpage_readpages+0xa4/0x184 [c00000000135b750] [c0000000001ff8fc] .blkdev_readpages+0x24/0x38 [c00000000135b7c0] [c0000000001589f0] .read_pages+0x6c/0x1a8 [c00000000135b8b0] [c000000000158c74] .__do_page_cache_readahead+0x118/0x184 [c00000000135b9b0] [c0000000001591a8] .force_page_cache_readahead+0xe4/0xe8 [c00000000135ba50] [c00000000014fc24] .generic_file_read_iter+0x1d8/0x830 [c00000000135bb50] [c0000000001ffadc] .blkdev_read_iter+0x40/0x5c [c00000000135bbc0] [c0000000001b9e00] .new_sync_read+0x144/0x1a0 [c00000000135bcd0] [c0000000001bc454] .vfs_read+0xa0/0x124 [c00000000135bd70] [c0000000001bc7a4] .ksys_read+0x70/0xd8 [c00000000135be20] [c00000000000a524] system_call+0x5c/0x70 Instruction dump: 7fe3fb78 482e30dc 7c0802a6 482e3085 7c9e2378 f821ff71 7ca42b78 7d3e00d0 7c7d1b78 79290fe0 7cc53378 69290001 <0b090000> 81230028 7bca0020 7929ba62 [ end trace 313fec760f30aa1f ]--- The problem originates from setting the segment boundary of the request queue to -1UL. This makes get_max_segment_size() return zero when offset is zero, whatever the max segment size. The test with BLK_SEG_BOUNDARY_MASK fails and 'mask - (mask & offset) + 1' overflows to zero in the return statement. Not setting the segment boundary and using the default value (BLK_SEG_BOUNDARY_MASK) fixes the problem. Signed-off-by: Emmanuel Nicolet Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/060a416c43138f45105c0540eff1a45539f7e2fc.1589049250.git.geoff@infradead.org commit 7b27b95a894d6a85c076f8d1f00e35316739bf51 Author: Markus Elfring Date: Sat May 9 18:58:32 2020 +0000 net/ps3_gelic_net: Remove duplicate error message Remove an extra message for a memory allocation failure in function gelic_descr_prepare_rx(). Signed-off-by: Markus Elfring Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ba4bea4da97308c804fd3a0fae3773dde27b20ce.1589049250.git.geoff@infradead.org commit 6a8aa782cece2330322c33452a767f53f8ba38c9 Author: Markus Elfring Date: Sat May 9 18:58:31 2020 +0000 drivers/ps3: Remove duplicate error messages Remove duplicate memory allocation failure error messages. Signed-off-by: Markus Elfring Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c763425d8e6f680d3180b3246c9e77727df179d0.1589049250.git.geoff@infradead.org commit 331aa46aaf51325d8532a4948f5127b2edc441a5 Author: Geoff Levand Date: Sat May 9 18:58:31 2020 +0000 powerpc/head_check: Avoid broken pipe Remove the '-m4' option to grep to allow grep to process all of nm's output. This avoids the nm warning: nm terminated with signal 13 [Broken pipe] Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/872b6c84a4250ff140e476c62cabe9e56a02b6c2.1589049250.git.geoff@infradead.org commit f61200d3e3386e78d49677dfb3911c9d7c0dfe4b Author: Geoff Levand Date: Sat May 9 18:58:31 2020 +0000 powerpc/wrapper: Output linker map file To aid debugging wrapper troubles, output a linker map file 'wrapper.map' when the build is verbose. Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fb477f5e91c6b74a1dec98df3cc0a1c91632d94d.1589049250.git.geoff@infradead.org commit 4c592a34391ea4987d29c1718f931b50416ca015 Author: Geoff Levand Date: Sat May 9 18:58:31 2020 +0000 powerpc/head_check: Automatic verbosity To aid debugging build problems turn on shell tracing for the head_check script when the build is verbose. Signed-off-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1ae1aed811ba6760af2e46d331285dd6a4de5b80.1589049250.git.geoff@infradead.org commit 265d6e588d87194c2fe2d6c240247f0264e0c19b Author: Nicholas Piggin Date: Fri May 8 14:34:07 2020 +1000 powerpc/traps: Make unrecoverable NMIs die instead of panic System Reset and Machine Check interrupts that are not recoverable due to being nested or interrupting when RI=0 currently panic. This is not necessary, and can often just kill the current context and recover. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/20200508043408.886394-16-npiggin@gmail.com commit bbbc8032b00f8ef287894425fbdb691049e28d39 Author: Nicholas Piggin Date: Fri May 8 14:34:06 2020 +1000 powerpc/traps: Do not trace system reset Similarly to the previous patch, do not trace system reset. This code is used when there is a crash or hang, and tracing disturbs the system more and has been known to crash in the crash handling path. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Acked-by: Naveen N. Rao Link: https://lore.kernel.org/r/20200508043408.886394-15-npiggin@gmail.com commit abd106fb437ad1cd8c8df8ccabd0fa941ef6342a Author: Nicholas Piggin Date: Fri May 8 14:34:05 2020 +1000 powerpc/64s: machine check do not trace real-mode handler Rather than notrace annotations throughout a significant part of the machine check code across kernel/ pseries/ and powernv/ which can easily be broken and is infrequently tested, use paca->ftrace_enabled to blanket-disable tracing of the real-mode non-maskable handler. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Acked-by: Naveen N. Rao Link: https://lore.kernel.org/r/20200508043408.886394-14-npiggin@gmail.com commit f2d7f62e4abdb03de3f4267361d96c417312d05c Author: Nicholas Piggin Date: Fri May 8 14:34:04 2020 +1000 powerpc: Implement ftrace_enabled() helpers Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/20200508043408.886394-13-npiggin@gmail.com commit 116ac378bb3ff844df333e7609e7604651a0db9d Author: Nicholas Piggin Date: Fri May 8 14:34:03 2020 +1000 powerpc/64s: machine check interrupt update NMI accounting machine_check_early() is taken as an NMI, so nmi_enter() is used there. machine_check_exception() is no longer taken as an NMI (it's invoked via irq_work in the case a machine check hits in kernel mode), so remove the nmi_enter() from that case. In NMI context, hash faults don't try to refill the hash table, which can lead to crashes accessing non-pinned kernel pages. System reset still has this potential problem. Signed-off-by: Nicholas Piggin [mpe: Drop change in show_regs() which breaks Book3E] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-12-npiggin@gmail.com commit 2576f5f9169620bf329cf1e91086e6041b98e4b2 Author: Nicholas Piggin Date: Fri May 8 14:34:02 2020 +1000 powerpc/pseries: Machine check use rtas_call_unlocked() with args on stack With the previous patch, machine checks can use rtas_call_unlocked() which avoids the RTAS spinlock which would deadlock if a machine check hits while making an RTAS call. This also avoids the complex RTAS error logging which has more RTAS calls and includes kmalloc (which can return memory beyond RMA, which would also crash). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-11-npiggin@gmail.com commit d2cbbd45d433b96e41711a293e59cff259143694 Author: Nicholas Piggin Date: Fri May 8 14:34:01 2020 +1000 powerpc/pseries: Limit machine check stack to 4GB This allows rtas_args to be put on the machine check stack, which avoids a lot of complications with re-entrancy deadlocks. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Reviewed-by: Mahesh Salgaonkar Link: https://lore.kernel.org/r/20200508043408.886394-10-npiggin@gmail.com commit d7b14c5c042865070a1411078ab49ea17bad0b41 Author: Nicholas Piggin Date: Fri May 8 14:34:00 2020 +1000 powerpc/pseries/ras: fwnmi sreset should not interlock PAPR does not specify that fwnmi sreset should be interlocked, and PowerVM (and therefore now QEMU) do not require it. These "ibm,nmi-interlock" calls are ignored by firmware, but there is a possibility that the sreset could have interrupted a machine check and release the machine check's interlock too early, corrupting it if another machine check came in. This is an extremely rare case, but it should be fixed for clarity and reducing the code executed in the sreset path. Firmware also does not provide error information for the sreset case to look at, so remove that comment. Signed-off-by: Nicholas Piggin [mpe: Use __be64 to silence some sparse warnings] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-9-npiggin@gmail.com commit 2bcf14ca1a2f3202954f812f380c7fa8127fbd7f Author: Sanket Parmar Date: Mon May 18 14:14:13 2020 +0200 phy: cadence: sierra: Fix for USB3 U1/U2 state Updated values of USB3 related Sierra PHY registers. This change fixes USB3 device disconnect issue observed while enternig U1/U2 state. Signed-off-by: Sanket Parmar Link: https://lore.kernel.org/r/1589804053-14302-1-git-send-email-sparmar@cadence.com Reviewed-by: Roger Quadros Signed-off-by: Kishon Vijay Abraham I commit 257d0be3f04019fa013eac503a8c752f0d4d12d7 Author: Roger Quadros Date: Wed May 13 16:12:54 2020 +0300 phy: ti: am654: add support for USB super-speed The SERDES PHY can support USB super-speed lane. Add support for that. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20200513131254.10497-3-rogerq@ti.com Signed-off-by: Kishon Vijay Abraham I commit 24dcb6a6637660cd77d294986b9832a813a630c2 Author: Roger Quadros Date: Wed May 13 16:12:53 2020 +0300 phy: ti: am654: show up in regmap debugfs The max_register property must be set in order to show up the registers in debugfs. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20200513131254.10497-2-rogerq@ti.com Signed-off-by: Kishon Vijay Abraham I commit 6f0577d1411337a0d97d545abe4a784e9e611516 Author: Bharat Gooty Date: Wed May 13 23:09:47 2020 +0530 drivers: phy: sr-usb: do not use internal fsm for USB2 phy init During different reboot cycles, USB PHY PLL may not always lock during initialization and therefore can cause USB to be not usable. Hence do not use internal FSM programming sequence for the USB PHY initialization. Fixes: 4dcddbb38b64 ("phy: sr-usb: Add Stingray USB PHY driver") Signed-off-by: Bharat Gooty Signed-off-by: Rayagonda Kokatanur Link: https://lore.kernel.org/r/20200513173947.10919-1-rayagonda.kokatanur@broadcom.com Signed-off-by: Kishon Vijay Abraham I commit 42aed917819d58bf202e7e2df7707fd5c2a4ef5c Author: Yoshihiro Shimoda Date: Fri Mar 27 18:33:56 2020 +0900 dt-bindings: phy: renesas: usb3-phy: add r8a77961 support This patch adds support for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1585301636-24399-5-git-send-email-yoshihiro.shimoda.uh@renesas.com Acked-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 007e358094bfb48f206c32b5c82777d980913d2f Author: Yoshihiro Shimoda Date: Fri Mar 27 18:33:55 2020 +0900 dt-bindings: phy: renesas: usb3-phy: convert bindings to json-schema Convert Renesas R-Car generation 3 USB 3.0 PHY bindings documentation to json-schema. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1585301636-24399-4-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Kishon Vijay Abraham I commit ca432812d9344a79f7c58375e07ad1936e9f0fc6 Author: Yoshihiro Shimoda Date: Fri Mar 27 18:33:54 2020 +0900 dt-bindings: phy: renesas: usb2-phy: add r8a77961 support This patch adds support for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1585301636-24399-3-git-send-email-yoshihiro.shimoda.uh@renesas.com Acked-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 45037dd681577e876b6085bad1aa44415b0cbe93 Author: Yoshihiro Shimoda Date: Fri Mar 27 18:33:53 2020 +0900 dt-bindings: phy: renesas: usb2-phy: convert bindings to json-schema Convert Renesas R-Car generation 3 USB 2.0 PHY bindings documentation to json-schema. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1585301636-24399-2-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Kishon Vijay Abraham I commit 72f039db491e59396edbaa39595d0865aee055ee Author: Bjorn Andersson Date: Thu May 14 18:36:43 2020 -0700 phy: qcom-qmp: Ensure register indirection arrays initialized It's possible that struct qmp_phy_cfg->regs references an array that is smaller than the possible register lookups that is going to be performed, with the resulting out-of-bounds read resulting in undefined behavior. One such example is when during qcom_qmp_phy_com_init() performs a qphy_setbits() on entry QPHY_PCS_POWER_DOWN_CONTROL (i.e. 17) with msm8996_ufsphy_regs_layout only being 12 entries long. Solve this by inflating all "regs_layout" arrays to ensure that any remaining entries are zero-initialized, as expected by the code. Fixes: e4d8b05ad5f9 ("phy: qcom-qmp: Use proper PWRDOWN offset for sm8150 USB") Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200515013643.2081941-1-bjorn.andersson@linaro.org Signed-off-by: Kishon Vijay Abraham I commit 81530a38a36d411e01ea99116503901f75aa758b Author: Roger Quadros Date: Fri May 15 11:05:15 2020 +0300 phy: omap-usb2: Clean up exported header Move private definitions from header to phy-omap-usb2.c file. Get rid of unused data structures usb_dpll_params and omap_usb_phy_type. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20200515080518.26870-2-rogerq@ti.com Signed-off-by: Kishon Vijay Abraham I commit 728ac1ba2eb4c8c33e17159ade916e504ae03316 Author: Rikard Falkeborn Date: Sat May 16 14:04:39 2020 +0200 phy: phy-bcm-ns2-usbdrd: Constify phy_ops phy_ops are never modified and can therefore be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 7831 3144 128 11103 2b5f drivers/phy/broadcom/phy-bcm-ns2-usbdrd.o After: text data bss dec hex filename 7959 3016 128 11103 2b5f drivers/phy/broadcom/phy-bcm-ns2-usbdrd.o Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200516120441.7627-2-rikard.falkeborn@gmail.com Signed-off-by: Kishon Vijay Abraham I commit c79cc3d55c4bf94e9028d6818d449fbdc488eac5 Author: Rikard Falkeborn Date: Sat May 16 14:04:41 2020 +0200 phy: phy-brcm-usb: Constify static structs A number of structs were not modified and can therefore be made const to allow the compiler to put them in read-only memory. In order to do so, update a few functions that don't modify there input to take pointers to const. Before: text data bss dec hex filename 15511 6448 64 22023 5607 drivers/phy/broadcom/phy-brcm-usb.o After: text data bss dec hex filename 16058 5936 64 22058 562a drivers/phy/broadcom/phy-brcm-usb.o Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200516120441.7627-4-rikard.falkeborn@gmail.com Signed-off-by: Kishon Vijay Abraham I commit cbe72af1a713f40e2ecd7f0b2c4580a7ab70fcd6 Author: Rikard Falkeborn Date: Sat May 16 14:04:40 2020 +0200 phy: sr-usb: Constify phy_ops phy_ops are never modified and can therefore be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 4310 1244 0 5554 15b2 drivers/phy/broadcom/phy-bcm-sr-usb.o After: text data bss dec hex filename 4438 1116 0 5554 15b2 drivers/phy/broadcom/phy-bcm-sr-usb.o Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200516120441.7627-3-rikard.falkeborn@gmail.com Signed-off-by: Kishon Vijay Abraham I commit 06020196c82e26e835b739dfa91a2717b0d37148 Author: Chen Zhou Date: Fri May 8 09:49:55 2020 +0800 iommu/arm-smmu-v3: remove set but not used variable 'smmu' Fixes gcc '-Wunused-but-set-variable' warning: drivers/iommu/arm-smmu-v3.c:2989:26: warning: variable ‘smmu’ set but not used [-Wunused-but-set-variable] struct arm_smmu_device *smmu; Reported-by: Hulk Robot Signed-off-by: Chen Zhou Link: https://lore.kernel.org/r/20200508014955.87630-1-chenzhou10@huawei.com Signed-off-by: Will Deacon commit 8bbe13f52cb79666ada12033f04bdeb4741b7188 Author: Yong Wu Date: Fri May 15 16:08:43 2020 +0800 iommu/mediatek-v1: Add def_domain_type The MediaTek V1 IOMMU is arm32 whose default domain type is IOMMU_DOMAIN_UNMANAGED. Add this to satisfy the bus_iommu_probe to enter "probe_finalize". The iommu framework will create a iommu domain for each a device. But all the devices share a iommu domain here, thus we skip all the other domains in the "attach_device" except the domain we create internally with arm_iommu_create_mapping. Also a minor change: in the attach_device, "data" always is not null. Remove "if (!data) return". Signed-off-by: Yong Wu Link: https://lore.kernel.org/r/1589530123-30240-1-git-send-email-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit e89897c9dec7f859a93b8364709851c3a7418ac3 Author: Marek Behún Date: Thu Apr 30 10:06:22 2020 +0200 dt-bindings: PCI: aardvark: Describe new properties Document the possibility to reference a PHY and reset-gpios and to set max-link-speed property. Link: https://lore.kernel.org/r/20200430080625.26070-10-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Thomas Petazzoni Cc: Rob Herring Cc: devicetree@vger.kernel.org commit 96be36dbffacea0aa9e6ec4839583e79faa141a1 Author: Pali Rohár Date: Thu Apr 30 10:06:21 2020 +0200 PCI: aardvark: Replace custom macros by standard linux/pci_regs.h macros PCI-E capability macros are already defined in linux/pci_regs.h. Remove their reimplementation in pcie-aardvark. Link: https://lore.kernel.org/r/20200430080625.26070-9-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Thomas Petazzoni commit 366697018c9a2aa67d457bfdc495115cface6ae8 Author: Marek Behún Date: Thu Apr 30 10:06:20 2020 +0200 PCI: aardvark: Add PHY support With recent proposed changes for U-Boot it is possible that bootloader won't initialize the PHY for this controller (currently the PHY is initialized regardless whether PCI is used in U-Boot, but with these proposed changes the PHY is initialized only on request). Since the mvebu-a3700-comphy driver by Miquèl Raynal supports enabling PCIe PHY, and since Linux' functionality should be independent on what bootloader did, add code for enabling generic PHY if found in device OF node. The mvebu-a3700-comphy driver does PHY powering via SMC calls to ARM Trusted Firmware. The corresponding code in ARM Trusted Firmware skips one register write which U-Boot does not: step 7 ("Enable TX"), see [1]. Instead ARM Trusted Firmware expects PCIe driver to do this step, probably because the register is in PCIe controller address space, instead of PHY address space. We therefore add this step into the advk_pcie_setup_hw function. [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/drivers/marvell/comphy/phy-comphy-3700.c?h=v2.3-rc2#n836 Link: https://lore.kernel.org/r/20200430080625.26070-8-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Thomas Petazzoni Cc: Miquèl Raynal commit b2a56469d550cdcbbaeacba86fdf8bcf6af4d084 Author: Pali Rohár Date: Thu Apr 30 10:06:19 2020 +0200 PCI: aardvark: Add FIXME comment for PCIE_CORE_CMD_STATUS_REG access This register is applicable only when the controller is configured for Endpoint mode, which is not the case for the current version of this driver. Attempting to remove this code though caused some ath10k cards to stop working, so for some unknown reason it is needed here. This should be investigated and a comment explaining this should be put before the code, so we add a FIXME comment for now. Link: https://lore.kernel.org/r/20200430080625.26070-7-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring Acked-by: Thomas Petazzoni commit 5169a9851daaa2782a7bd2bb83d5b1bd224b2879 Author: Pali Rohár Date: Thu Apr 30 10:06:18 2020 +0200 PCI: aardvark: Issue PERST via GPIO Add support for issuing PERST via GPIO specified in 'reset-gpios' property (as described in PCI device tree bindings). Some buggy cards (e.g. Compex WLE900VX or WLE1216) are not detected after reboot when PERST is not issued during driver initialization. If bootloader already enabled link training then issuing PERST has no effect for some buggy cards (e.g. Compex WLE900VX) and these cards are not detected. We therefore clear the LINK_TRAINING_EN register before. It was observed that Compex WLE900VX card needs to be in PERST reset for at least 10ms if bootloader enabled link training. Tested on Turris MOX. Link: https://lore.kernel.org/r/20200430080625.26070-6-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Thomas Petazzoni commit 43fc679ced18006b12d918d7a8a4af392b7fbfe7 Author: Marek Behún Date: Thu Apr 30 10:06:17 2020 +0200 PCI: aardvark: Improve link training Currently the aardvark driver trains link in PCIe gen2 mode. This may cause some buggy gen1 cards (such as Compex WLE900VX) to be unstable or even not detected. Moreover when ASPM code tries to retrain link second time, these cards may stop responding and link goes down. If gen1 is used this does not happen. Unconditionally forcing gen1 is not a good solution since it may have performance impact on gen2 cards. To overcome this, read 'max-link-speed' property (as defined in PCI device tree bindings) and use this as max gen mode. Then iteratively try link training at this mode or lower until successful. After successful link training choose final controller gen based on Negotiated Link Speed from Link Status register, which should match card speed. Link: https://lore.kernel.org/r/20200430080625.26070-5-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Thomas Petazzoni commit 2dd9072e8fb0af4af47c912244f6c16fc57d4fbc Author: Pali Rohár Date: Thu Apr 30 10:06:16 2020 +0200 PCI: of: Zero max-link-speed value is invalid Interpret zero value of max-link-speed property as invalid, as the device tree bindings documentation specifies. Link: https://lore.kernel.org/r/20200430080625.26070-4-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring Acked-by: Thomas Petazzoni commit 90c6cb4a355e7befcb557d217d1d8b8bd5875a05 Author: Pali Rohár Date: Thu Apr 30 10:06:15 2020 +0200 PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register Trying to change Link Status register does not have any effect as this is a read-only register. Trying to overwrite bits for Negotiated Link Width does not make sense. In future proper change of link width can be done via Lane Count Select bits in PCIe Control 0 register. Trying to unconditionally enable ASPM L0s via ASPM Control bits in Link Control register is wrong. There should be at least some detection if endpoint supports L0s as isn't mandatory. Moreover ASPM Control bits in Link Control register are controlled by pcie/aspm.c code which sets it according to system ASPM settings, immediately after aardvark driver probes. So setting these bits by aardvark driver has no long running effect. Remove code which touches ASPM L0s bits from this driver and let kernel's ASPM implementation to set ASPM state properly. Some users are reporting issues that this code is problematic for some Intel wifi cards and removing it fixes them, see e.g.: https://bugzilla.kernel.org/show_bug.cgi?id=196339 If problems with Intel wifi cards occur even after this commit, then pcie/aspm.c code could be modified / hooked to not enable ASPM L0s state for affected problematic cards. Link: https://lore.kernel.org/r/20200430080625.26070-3-pali@kernel.org Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring Acked-by: Thomas Petazzoni commit 6964494582f56a3882c2c53b0edbfe99eb32b2e1 Author: Pali Rohár Date: Thu Apr 30 10:06:14 2020 +0200 PCI: aardvark: Train link immediately after enabling training Adding even 100ms (PCI_PM_D3COLD_WAIT) delay between enabling link training and starting link training causes detection issues with some buggy cards (such as Compex WLE900VX). Move the code which enables link training immediately before the one which starts link traning. This fixes detection issues of Compex WLE900VX card on Turris MOX after cold boot. Link: https://lore.kernel.org/r/20200430080625.26070-2-pali@kernel.org Fixes: f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready...") Tested-by: Tomasz Maciej Nowak Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring Acked-by: Thomas Petazzoni commit 5df362a53f7d36e032668e7e6725d80622b98525 Author: Tero Kristo via iommu Date: Fri Apr 24 17:58:28 2020 +0300 iommu/omap: Add registration for DT fwnode pointer The fwnode pointer must be passed to the iommu core, so that the core can map the IOMMU towards device requests properly. Without this, some IOMMU clients like OMAP remoteproc will fail the iommu configuration multiple times with -EPROBE_DEFER, which will eventually be ignored with a kernel warning banner. Signed-off-by: Tero Kristo Link: https://lore.kernel.org/r/20200424145828.3159-1-t-kristo@ti.com Signed-off-by: Joerg Roedel commit e70b081c6f376471d7a9fee69e12e8f05ac2925d Author: Tom Murphy Date: Sat May 16 14:21:01 2020 +0800 iommu/vt-d: Remove IOVA handling code from the non-dma_ops path There's no need for the non-dma_ops path to keep track of IOVAs. The whole point of the non-dma_ops path is that it allows the IOVAs to be handled separately. The IOVA handling code removed in this patch is pointless. Signed-off-by: Tom Murphy Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-19-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 7482fd59259a7f23e191c14b8a126a0f6981b3e4 Author: Lu Baolu Date: Sat May 16 14:21:00 2020 +0800 iommu/vt-d: Remove duplicated check in intel_svm_bind_mm() The info and info->pasid_support have already been checked in previous intel_iommu_enable_pasid() call. No need to check again. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-18-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 81ebd91a436b87158b2ab6c71a51395316b147dc Author: Lu Baolu Date: Sat May 16 14:20:59 2020 +0800 iommu/vt-d: Remove redundant IOTLB flush IOTLB flush already included in the PASID tear down and the page request drain process. There is no need to flush again. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20200516062101.29541-17-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 66ac4db36f4c12a3b02db864ccb0801cd938b6de Author: Lu Baolu Date: Sat May 16 14:20:58 2020 +0800 iommu/vt-d: Add page request draining support When a PASID is stopped or terminated, there can be pending PRQs (requests that haven't received responses) in remapping hardware. This adds the interface to drain page requests and call it when a PASID is terminated. Signed-off-by: Jacob Pan Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-16-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 37e91bd4b39922b31ca4e6c4eabb0d7140b14e74 Author: Lu Baolu Date: Sat May 16 14:20:57 2020 +0800 iommu/vt-d: Disable non-recoverable fault processing before unbind When a PASID is used for SVA by the device, it's possible that the PASID entry is cleared before the device flushes all ongoing DMA requests. The IOMMU should tolerate and ignore the non-recoverable faults caused by the untranslated requests from this device. For example, when an exception happens, the process terminates before the device driver stops DMA and call IOMMU driver to unbind PASID. The flow of process exist is as follows: do_exit() { exit_mm() { mm_put(); exit_mmap() { intel_invalidate_range() //mmu notifier tlb_finish_mmu() mmu_notifier_release(mm) { intel_iommu_release() { [2] intel_iommu_teardown_pasid(); intel_iommu_flush_tlbs(); } } unmap_vmas(); free_pgtables(); }; } exit_files(tsk) { close_files() { dsa_close(); [1] dsa_stop_dma(); intel_svm_unbind_pasid(); } } } Care must be taken on VT-d to avoid unrecoverable faults between the time window of [1] and [2]. [Process exist flow was contributed by Jacob Pan.] Intel VT-d provides such function through the FPD bit of the PASID entry. This sets FPD bit when PASID entry is changing from present to nonpresent in the mm notifier and will clear it when the pasid is unbound. Signed-off-by: Lu Baolu Reviewed-by: Jacob Pan Link: https://lore.kernel.org/r/20200516062101.29541-15-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 4c0fa5bfca7eba479002f0a1ecd1bf7631b2f5da Author: Lu Baolu Date: Sat May 16 14:20:56 2020 +0800 iommu/vt-d: debugfs: Add support to show inv queue internals Export invalidation queue internals of each iommu device through the debugfs. Example of such dump on a Skylake machine: $ sudo cat /sys/kernel/debug/iommu/intel/invalidation_queue Invalidation queue on IOMMU: dmar1 Base: 0x1672c9000 Head: 80 Tail: 80 Index qw0 qw1 status 0 0000000000000004 0000000000000000 0000000000000000 1 0000000200000025 00000001672be804 0000000000000000 2 0000000000000011 0000000000000000 0000000000000000 3 0000000200000025 00000001672be80c 0000000000000000 4 00000000000000d2 0000000000000000 0000000000000000 5 0000000200000025 00000001672be814 0000000000000000 6 0000000000000014 0000000000000000 0000000000000000 7 0000000200000025 00000001672be81c 0000000000000000 8 0000000000000014 0000000000000000 0000000000000000 9 0000000200000025 00000001672be824 0000000000000000 Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20200516062101.29541-14-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 8a1d824625402b3ef3c3e5965663354ff0394d86 Author: Lu Baolu Date: Sat May 16 14:20:55 2020 +0800 iommu/vt-d: Multiple descriptors per qi_submit_sync() Current qi_submit_sync() only supports single invalidation descriptor per submission and appends wait descriptor after each submission to poll the hardware completion. This extends the qi_submit_sync() helper to support multiple descriptors, and add an option so that the caller could specify the Page-request Drain (PD) bit in the wait descriptor. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20200516062101.29541-13-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 064a57d7ddfc46ada02b477b91c478001b03bfa3 Author: Jacob Pan Date: Sat May 16 14:20:54 2020 +0800 iommu/vt-d: Replace intel SVM APIs with generic SVA APIs This patch is an initial step to replace Intel SVM code with the following IOMMU SVA ops: intel_svm_bind_mm() => iommu_sva_bind_device() intel_svm_unbind_mm() => iommu_sva_unbind_device() intel_svm_is_pasid_valid() => iommu_sva_get_pasid() The features below will continue to work but are not included in this patch in that they are handled mostly within the IOMMU subsystem. - IO page fault - mmu notifier Consolidation of the above will come after merging generic IOMMU sva code[1]. There should not be any changes needed for SVA users such as accelerator device drivers during this time. [1] http://jpbrucker.net/sva/ Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-12-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 76fdd6c59532630559a2c63e8645a7033f9623c4 Author: Jacob Pan Date: Sat May 16 14:20:53 2020 +0800 iommu/vt-d: Report SVA feature with generic flag Query Shared Virtual Address/Memory capability is a generic feature. SVA feature check is the required first step before calling iommu_sva_bind_device(). VT-d checks SVA feature enabling at per IOMMU level during this step, SVA bind device will check and enable PCI ATS, PRS, and PASID capabilities at device level. This patch reports Intel SVM as SVA feature such that generic code (e.g. Uacce [1]) can use it. [1] https://lkml.org/lkml/2020/1/15/604 Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-11-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit e85bb99b79ca5ad2681612a7bb22f94cc2c71866 Author: Lu Baolu Date: Sat May 16 14:20:52 2020 +0800 iommu/vt-d: Add get_domain_info() helper Add a get_domain_info() helper to retrieve the valid per-device iommu private data. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-10-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 3375303e82877552f3b2b42309e8233fe715fd9f Author: Jacob Pan Date: Sat May 16 14:20:51 2020 +0800 iommu/vt-d: Add custom allocator for IOASID When VT-d driver runs in the guest, PASID allocation must be performed via virtual command interface. This patch registers a custom IOASID allocator which takes precedence over the default XArray based allocator. The resulting IOASID allocation will always come from the host. This ensures that PASID namespace is system- wide. Virtual command registers are used in the guest only, to prevent vmexit cost, we cache the capability and store it during initialization. Signed-off-by: Liu, Yi L Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20200516062101.29541-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 24f27d32ab6b71dedcbbeeab8f9bdc143b539ac0 Author: Lu Baolu Date: Sat May 16 14:20:50 2020 +0800 iommu/vt-d: Enlightened PASID allocation Enabling IOMMU in a guest requires communication with the host driver for certain aspects. Use of PASID ID to enable Shared Virtual Addressing (SVA) requires managing PASID's in the host. VT-d 3.0 spec provides a Virtual Command Register (VCMD) to facilitate this. Writes to this register in the guest are trapped by vIOMMU which proxies the call to the host driver. This virtual command interface consists of a capability register, a virtual command register, and a virtual response register. Refer to section 10.4.42, 10.4.43, 10.4.44 for more information. This patch adds the enlightened PASID allocation/free interfaces via the virtual command interface. Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Signed-off-by: Jacob Pan Reviewed-by: Eric Auger Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20200516062101.29541-8-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 6ee1b77ba3ac0a79fc6f3273f3b27b13240a355e Author: Jacob Pan Date: Sat May 16 14:20:49 2020 +0800 iommu/vt-d: Add svm/sva invalidate function When Shared Virtual Address (SVA) is enabled for a guest OS via vIOMMU, we need to provide invalidation support at IOMMU API and driver level. This patch adds Intel VT-d specific function to implement iommu passdown invalidate API for shared virtual address. The use case is for supporting caching structure invalidation of assigned SVM capable devices. Emulated IOMMU exposes queue invalidation capability and passes down all descriptors from the guest to the physical IOMMU. The assumption is that guest to host device ID mapping should be resolved prior to calling IOMMU driver. Based on the device handle, host IOMMU driver can replace certain fields before submit to the invalidation queue. Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20200516062101.29541-7-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 61a06a16e36d830f7811fbf931668d87197d95b7 Author: Jacob Pan Date: Sat May 16 14:20:48 2020 +0800 iommu/vt-d: Support flushing more translation cache types When Shared Virtual Memory is exposed to a guest via vIOMMU, scalable IOTLB invalidation may be passed down from outside IOMMU subsystems. This patch adds invalidation functions that can be used for additional translation cache types. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20200516062101.29541-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 56722a4398a306585ca3ed39ff54fc907af98618 Author: Jacob Pan Date: Sat May 16 14:20:47 2020 +0800 iommu/vt-d: Add bind guest PASID support When supporting guest SVA with emulated IOMMU, the guest PASID table is shadowed in VMM. Updates to guest vIOMMU PASID table will result in PASID cache flush which will be passed down to the host as bind guest PASID calls. For the SL page tables, it will be harvested from device's default domain (request w/o PASID), or aux domain in case of mediated device. .-------------. .---------------------------. | vIOMMU | | Guest process CR3, FL only| | | '---------------------------' .----------------/ | PASID Entry |--- PASID cache flush - '-------------' | | | V | | CR3 in GPA '-------------' Guest ------| Shadow |--------------------------|-------- v v v Host .-------------. .----------------------. | pIOMMU | | Bind FL for GVA-GPA | | | '----------------------' .----------------/ | | PASID Entry | V (Nested xlate) '----------------\.------------------------------. | | |SL for GPA-HPA, default domain| | | '------------------------------' '-------------' Where: - FL = First level/stage one page tables - SL = Second level/stage two page tables Signed-off-by: Jacob Pan Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20200516062101.29541-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit b0d1f8741b812352fe0e5f3b2381427085f23e19 Author: Jacob Pan Date: Sat May 16 14:20:46 2020 +0800 iommu/vt-d: Add nested translation helper function Nested translation mode is supported in VT-d 3.0 Spec.CH 3.8. With PASID granular translation type set to 0x11b, translation result from the first level(FL) also subject to a second level(SL) page table translation. This mode is used for SVA virtualization, where FL performs guest virtual to guest physical translation and SL performs guest physical to host physical translation. This patch adds a helper function for setting up nested translation where second level comes from a domain and first level comes from a guest PGD. Signed-off-by: Jacob Pan Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20200516062101.29541-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 3aef9ca6a42aca8c797f867e554ad297b446439f Author: Jacob Pan Date: Sat May 16 14:20:45 2020 +0800 iommu/vt-d: Use a helper function to skip agaw for SL An Intel iommu domain uses 5-level page table by default. If the iommu that the domain tries to attach supports less page levels, the top level page tables should be skipped. Add a helper to do this so that it could be used in other places. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20200516062101.29541-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 3db9983e4327f773c490de2a8c66d6000561d88a Author: Jacob Pan Date: Sat May 16 14:20:44 2020 +0800 iommu/vt-d: Move domain helper to header Move domain helper to header to be used by SVA code. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20200516062101.29541-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit ad3a44cbd1b2e1559c6b93e80dc0c9c29632969a Author: Jacopo Mondi Date: Sat May 9 11:04:55 2020 +0200 media: i2c: imx219: Parse and register properties Parse device properties and register controls for them using the newly introduced helpers. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 74c3ddd9887f60824891d2574a1689e8c13bf191 Author: Jacopo Mondi Date: Sat May 9 11:04:54 2020 +0200 media: i2c: ov13858: Parse and register properties Parse device properties and register controls for them using the newly introduced helpers. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eba08021e15076afc21b506e71e2f4e523f27f8c Author: Jacopo Mondi Date: Sat May 9 11:04:53 2020 +0200 media: i2c: ov5670: Parse and register properties Parse device properties and register controls for them using the newly introduced helpers. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0a360630debdf12355d9ec9f1417172c3fa6756 Author: Jacopo Mondi Date: Sat May 9 11:04:52 2020 +0200 media: v4l2-ctrls: Add helper to register properties Add an helper function to v4l2-ctrls to register controls associated with a device property. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0837a6c08e127d8a7b765decc16abbed26589e1 Author: Jacopo Mondi Date: Sat May 9 11:04:51 2020 +0200 media: v4l2-ctrls: Sort includes alphabetically Before adding a new include directive, sort the existing ones in alphabetical order. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 46b14fc61bfa409efe95a7752a5dba361d753c66 Author: Tero Kristo via iommu Date: Mon May 18 14:10:57 2020 +0300 iommu/omap: Add check for iommu group when no IOMMU in use Most of the devices in OMAP family of SoCs are not using IOMMU. The patch for converting the OMAP IOMMU to use generic IOMMU bus probe functionality failed to add a check for this, so add it here. Fixes: c822b37cac48 ("iommu/omap: Remove orphan_dev tracking") Reported-by: Tomi Valkeinen Signed-off-by: Tero Kristo Link: https://lore.kernel.org/r/20200518111057.23140-1-t-kristo@ti.com Signed-off-by: Joerg Roedel commit ae6ff16cf745a56b7ef88a7177e5e8257849feb7 Author: Jacopo Mondi Date: Sat May 9 11:04:50 2020 +0200 media: include: v4l2-ctrl: Sort forward declarations Before adding a new forward declaration to the v4l2-ctrls.h header file, sort the existing ones alphabetically. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 344897ef1d9b33e246b64e255d807ca6c053f349 Author: Jacopo Mondi Date: Sat May 9 11:04:49 2020 +0200 media: v4l2-fwnode: Add helper to parse device properties Add an helper function to parse common device properties in the same way as v4l2_fwnode_endpoint_parse() parses common endpoint properties. Parse the 'rotation' and 'orientation' properties from the firmware interface. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f7a8ae295ca8e96e287f497506b49b1f4b47deb4 Author: Sebastian Reichel Date: Mon May 11 15:25:43 2020 +0200 ASoC: da7213: move set_pll to codec level Move set_pll function to component level, so that it can be used at both component and DAI level. Signed-off-by: Sebastian Reichel Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20200511132544.82364-5-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 9c5c258438b23cacc4971b94d808ba8af9c5931c Author: Sebastian Reichel Date: Mon May 11 15:25:42 2020 +0200 ASoC: da7213: move set_sysclk to codec level Move set_sysclk function to component level, so that it can be used at both component and DAI level. Signed-off-by: Sebastian Reichel Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20200511132544.82364-4-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit b2a378816d0f6780a5500f4322e5b2542d41532d Author: Sebastian Reichel Date: Mon May 11 15:25:41 2020 +0200 ASoC: da7213: Add regulator support This adds support for most regulators of da7212 for improved power management. The only thing skipped was the speaker supply, which has some undocumented dependencies. It's supposed to be either always-enabled or always-disabled. Signed-off-by: Sebastian Reichel Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20200511132544.82364-3-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 95579eaf98f17b97dc174bb31d71902b5895bd85 Author: Sebastian Reichel Date: Mon May 11 15:25:40 2020 +0200 ASoC: da7213: Add da7212 DT compatible This adds a compatible for da7212. It's handled exactly the same way as DA7213 and follows the ACPI bindings. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20200511132544.82364-2-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 926645d43fd43622a2b056471a2cf41cc19cbf4c Author: Jacopo Mondi Date: Sat May 9 11:04:48 2020 +0200 media: v4l2-ctrls: Add camera orientation and rotation Add support for the newly defined V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION read-only controls used to report the camera device mounting position and orientation respectively. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9926c2248740a632b0629fd8c07d0fc361dc15cc Author: Jacopo Mondi Date: Sat May 9 11:04:47 2020 +0200 media: v4l2-ctrl: Document V4L2_CID_CAMERA_SENSOR_ROTATION Add documentation for the V4L2_CID_CAMERA_SENSOR_ROTATION camera control. The newly added read-only control reports the rotation correction to be applied to images before displaying them to the user. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9397a83f40183eeafd5c787af2240ed0d6b26daa Author: Jacopo Mondi Date: Sat May 9 11:04:46 2020 +0200 media: v4l2-ctrl: Document V4L2_CID_CAMERA_ORIENTATION Add documentation for the V4L2_CID_CAMERA_ORIENTATION camera control. The newly added read-only control reports the camera device orientation relative to the usage orientation of the system the camera is installed on. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 915bd31ce9ed328535e5ecf3ca730c5764ec1a38 Author: Jacopo Mondi Date: Sat May 9 11:04:45 2020 +0200 media: dt-bindings: video-interface: Replace 'rotation' description Replace the 'rotation' property description by providing a definition relative to the camera sensor pixel array coordinate system and the captured scene. Acked-by: Rob Herring Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cabc918e5b877ed547e5b6463f5ea6e3ac4edbb3 Author: Jacopo Mondi Date: Sat May 9 11:04:44 2020 +0200 media: dt-bindings: video-interfaces: Document 'orientation' property Add the 'orientation' device property, used to specify the device mounting position. The property is particularly meaningful for mobile devices with a well defined usage orientation. Reviewed-by: Rob Herring Acked-by: Tomasz Figa Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c4e053660371a7a3a46cb1a1196c5785e4095890 Author: Steve Longerbeam Date: Fri May 1 19:15:56 2020 +0200 media: imx: TODO: Remove media link creation todos Remove the TODO items regarding media link creation, these issues are resolved by moving media link creation to individual entity bound callbacks and the implementation of the get_fwnode_pad operation. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 50da3f36e60e84f671e5bcb67f436512b43e5eac Author: Steve Longerbeam Date: Fri May 1 19:15:55 2020 +0200 media: imx: silence a couple debug messages Convert to dev_dbg the "subdev bound" and IPU-internal media-link creation messages. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 47f98c55a50c26359b25533810da3724f08113af Author: Pierre-Louis Bossart Date: Fri May 15 16:07:31 2020 -0500 ASoC: Intel: cht_bsw_nau8824: remap BTN_0 as KEY_PLAYPAUSE Use same mapping as in all other machine drivers: BTN_0 : KEY_PLAYPAUSE BTN_1 : KEY_VOICECOMMAND BTN_2 : KEY_VOLUMEUP BTN_3 : KEY_VOLUMEDOWN Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20200515210731.10942-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e6d5cb3ba13e6e54d3ac8cdf891d38042b7c36c5 Author: Pierre-Louis Bossart Date: Fri May 15 16:07:30 2020 -0500 ASoC: Intel: sof_sdw_rt700: remap buttons Use same mapping as in all other machine drivers: BTN_0 : KEY_PLAYPAUSE BTN_1 : KEY_VOICECOMMAND BTN_2 : KEY_VOLUMEUP BTN_3 : KEY_VOLUMEDOWN Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20200515210731.10942-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1f64a08bd5a9a218deb37c03c1e98e9567379698 Author: Pierre-Louis Bossart Date: Fri May 15 16:07:29 2020 -0500 ASoC: Intel: sof_sdw_rt711: remap buttons Use same mapping as in all other machine drivers: BTN_0 : KEY_PLAYPAUSE BTN_1 : KEY_VOICECOMMAND BTN_2 : KEY_VOLUMEUP BTN_3 : KEY_VOLUMEDOWN Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20200515210731.10942-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9d05a1e50c012368a133152515ee67fd08bea9ed Author: Pierre-Louis Bossart Date: Fri May 15 16:07:28 2020 -0500 ASoC: Intel: sof_sdw: fix typo in components string The component string attributes are separated by spaces, not commas. Fixes: b1ca2f63e20b4 ("ASoC: Intel: sof_sdw: add amp number in components string for ucm") Reported-by: Jaroslav Kysela Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200515210731.10942-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 75ac6dce7f03b0714ee5809ff18c4d2bb2db85e0 Author: Pierre-Louis Bossart Date: Fri May 15 16:07:27 2020 -0500 ASoC: Intel: soc-acpi: change machine driver name for WM8804 platforms Remove obsolete reference to Broxton since the machine driver will be reused on other platforms, e.g. Up Extreme. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200515210731.10942-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f0c1210f8a12c5c03f3b9717869af5052d42c4c3 Author: Steve Longerbeam Date: Fri May 1 19:15:54 2020 +0200 media: imx: Create missing links from CSI-2 receiver The entities external to the i.MX6 IPU and i.MX7 now create the links to their fwnode-endpoint connected entities in their notifier bound callbacks. Which means imx_media_create_of_links() and imx_media_create_csi_of_links() are no longer needed and are removed. However there is still one case in which imx-media needs to create fwnode-endpoint based links at probe completion. The v4l2-async framework does not allow multiple subdevice notifiers to contain a duplicate subdevice in their asd_list. Only the first subdev notifier that discovers and adds that one subdevice to its asd_list will receive a bound callback for it. Other subdevices that also have firmware endpoint connections to this duplicate subdevice will not have it in their asd_list, and thus will never receive a bound callback for it. In the case of imx-media, the one duplicate subdevice in question is the i.MX6 MIPI CSI-2 receiver. Until there is a solution to that problem, rewrite imx_media_create_links() to add the missing links from the CSI-2 receiver to the CSIs and CSI muxes. The function is renamed imx_media_create_csi2_links(). Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f02eac790df271976a2e22a11c46d1d95f8b93eb Author: Steve Longerbeam Date: Fri May 1 19:15:53 2020 +0200 media: imx: csi: Lookup upstream endpoint with imx_media_get_pad_fwnode Fix the 1:1 port-id:pad-index assumption for the upstream subdevice, by searching the upstream subdevice's endpoints for one that maps to the pad's index. This is carried out by a new reverse mapping function imx_media_get_pad_fwnode(). Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 86e02d07871c2ea389cc94becb2009c59420cd57 Author: Steve Longerbeam Date: Fri May 1 19:15:52 2020 +0200 media: imx5/6/7: csi: Mark a bound video mux as a CSI mux For i.MX5/6, if the bound subdev is a video mux, it must be one of the CSI muxes, and for i.MX7, the bound subdev must always be a CSI mux. So if the bound subdev is a video mux, mark it as a CSI mux with a new group id IMX_MEDIA_GRP_ID_CSI_MUX. In the process use the new group id in csi_get_upstream_endpoint(), and do some cleanup in that function for better readability. Suggested-by: Laurent Pinchart Signed-off-by: Steve Longerbeam Acked-by: Rui Miguel Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 99cb681e7b8eec917ddb34b76e303aa20b2d1c1a Author: Pierre-Louis Bossart Date: Fri May 15 16:59:58 2020 +0300 ASoC: SOF: imx: make imx8m_dsp_ops static This was in the SOF tree but lost in upstream contributions. Fixes: afb93d716533dd ("ASoC: SOF: imx: Add i.MX8M HW support") Signed-off-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200515135958.17511-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 35e7c09d1edd6c60bfa98070b657986500819fd6 Author: Pierre-Louis Bossart Date: Fri May 15 16:59:57 2020 +0300 ASoC: SOF: imx: make dsp_ops static This was in the SOF tree but lost in upstream contributions Fixes: 202acc565a1f05 ("ASoC: SOF: imx: Add i.MX8 HW support") Signed-off-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200515135958.17511-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 5c2c3cb1ca7875a2685c8cc65f08a1238e00cedb Author: Daniel Baluta Date: Fri May 15 16:59:56 2020 +0300 ASoC: SOF: define INFO_ flags in dsp_ops In the past, the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP were defined in the SOF PCM core, but that was changed since commit 27e322fabd508b ("ASoC: SOF: define INFO_ flags in dsp_ops") Now these flags must be set in DSP ops. Signed-off-by: Daniel Baluta Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200515135958.17511-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 7d1952bceb8a1a2372a1cb86ab109c6ec8772c5c Author: randerwang Date: Fri May 15 16:59:55 2020 +0300 ASoC: SOF: Intel: sdw: relax sdw machine select constraints On some platforms such as Up Extreme all links are enabled but only one link can be used by external codec. Instead of exact match of two masks, first check whether link_mask of mach is subset of link_mask supported by hw and then go on searching link_adr. Signed-off-by: randerwang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200515135958.17511-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 82e8c00fa18a3ef0ad3087dcad1d82637a738e30 Author: Keyon Jie Date: Fri May 15 16:59:54 2020 +0300 ASoC: SOF: topology: add support to smart amplifier Add smart amplifier component support, which is designed as another new type of process component and used for speaker protection algorithm integration. Signed-off-by: Keyon Jie Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200515135958.17511-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 9f369f7e4660d05b5318aa413db199a70dfb2c4f Author: Marcin Rajwa Date: Fri May 15 16:59:53 2020 +0300 ASoC: SOF: inform DSP that driver is going to be removed This patch invokes the DSP power down notifier to inform DSP that driver is going to be removed. The module removal entails DSP power down, disabling of IRQs and more. Therefore it is highly recommended to inform the DSP about this upcoming event. Due to hardware limitations on some Intel platforms it is necessary to power gate all LPSRAM banks that were enabled prior to controller reset. Otherwise, an attempt to write LPSRAM control registers may have no effect. Signed-off-by: Marcin Rajwa Signed-off-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200515135958.17511-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 3541aef1b83fa3a13e9c4ecc0919156ff2ec9c22 Author: Marcin Rajwa Date: Fri May 15 16:59:52 2020 +0300 ASoC: SOF: add a power_down_notify method This patch adds a snd_sof_dsp_power_down_notify() method which aims to prepare the DSP for the upcoming power down. This new function make use of SOF_IPC_PM_CTX_SAVE message. Signed-off-by: Marcin Rajwa Signed-off-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200515135958.17511-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit c26fde3b15ed41f5f452f1da727795f787833287 Author: Daniel Baluta Date: Fri May 15 16:59:51 2020 +0300 ASoC: SOF: Do nothing when DSP PM callbacks are not set This provides a better separation between runtime and PM sleep callbacks. Only do nothing if given runtime flag is set and calback is not set. With the current implementation, if PM sleep callback is set but runtime callback is not set then at runtime resume we reload the firmware even if we do not support runtime resume callback. Signed-off-by: Daniel Baluta Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200515135958.17511-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit fe7aee5d353346968eba111a0414250d8cc09527 Author: Steve Longerbeam Date: Fri May 1 19:15:51 2020 +0200 media: imx7: csi: Remove imx7_csi_get_upstream_endpoint() The function imx7_csi_get_upstream_endpoint() is not necessary for imx7. First, the imx7 CSI only receives from the CSI mux, so much of the code in there is pointless. Second, it is only used to determine whether the CSI mux has selected the CSI-2 input or the parallel input. This can be accomplished much more simply by getting the function type of selected input entity to the CSI mux. Signed-off-by: Steve Longerbeam Acked-by: Rui Miguel Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2c586f18919895f0acb9906dcd8a1790b19464bc Author: Steve Longerbeam Date: Fri May 1 19:15:50 2020 +0200 media: imx: csi: Create media links in bound notifier Implement a notifier bound op to register media links from the remote sub-device's source pad(s) to the CSI sink pad. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 94b99296f3d97360b9ba6ad181584f3b5504a540 Author: Steve Longerbeam Date: Fri May 1 19:15:49 2020 +0200 media: imx7: csi: Create media links in bound notifier Implement a notifier bound op to register media links from the remote sub-device's source pad(s) to the CSI sink pad. Signed-off-by: Steve Longerbeam Reviewed-by: Rui Miguel Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6e996653e757407d616d1f1fef760f74db6ef92c Author: Steve Longerbeam Date: Fri May 1 19:15:48 2020 +0200 media: imx7: mipi csis: Create media links in bound notifier Implement a notifier bound op to register media links from the remote sub-device's source pad(s) to the mipi csi-2 receiver sink pad. Signed-off-by: Steve Longerbeam Acked-by: Rui Miguel Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8b4713c9939b6aa638b95a97d6b30eadaae799b0 Author: Steve Longerbeam Date: Fri May 1 19:15:47 2020 +0200 media: imx: mipi csi-2: Create media links in bound notifier Implement a notifier bound op to register media links from the remote sub-device's source pad(s) to the mipi csi-2 receiver sink pad. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 612b385efb1e40ea65b6ae081b746bf2ec688a81 Author: Steve Longerbeam Date: Fri May 1 19:15:46 2020 +0200 media: video-mux: Create media links in bound notifier Implement a notifier bound op to register media links from the remote sub-device's source pad(s) to the video-mux sink pad(s). Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 400a9034c466358c7ae25a47f948648db8735b57 Author: Steve Longerbeam Date: Fri May 1 19:15:45 2020 +0200 media: imx: imx7-media-csi: Implement get_fwnode_pad op Use v4l2_subdev_get_fwnode_pad_1_to_1() as the get_fwnode_pad operation. The i.MX7 CSI maps port numbers and pad indexes 1:1. Acked-by: Rui Miguel Silva Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit eff218f2418094a8dd45a4ec8cf239d669123a4d Author: Steve Longerbeam Date: Fri May 1 19:15:44 2020 +0200 media: imx: imx7-mipi-csis: Implement get_fwnode_pad op Use v4l2_subdev_get_fwnode_pad_1_to_1() as the get_fwnode_pad operation. The imx7-mipi-csis maps port numbers and pad indexes 1:1. Signed-off-by: Steve Longerbeam Acked-by: Rui Miguel Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit fd5b69df4ffc62e81b149b54c0676125b8afe25c Author: Steve Longerbeam Date: Fri May 1 19:15:43 2020 +0200 media: imx: mipi csi-2: Implement get_fwnode_pad op Use v4l2_subdev_get_fwnode_pad_1_to_1() as the get_fwnode_pad operation. The MIPI CSI-2 receiver maps port numbers and pad indexes 1:1. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 318cd36542801caecfc3eaa1fd733f59574ac0a9 Author: Steve Longerbeam Date: Fri May 1 19:15:42 2020 +0200 media: video-mux: Implement get_fwnode_pad op Use v4l2_subdev_get_fwnode_pad_1_to_1() as the get_fwnode_pad operation. The video mux maps fwnode port numbers and pad indexes 1:1. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit fdb1b5e08929f21d29aedd447233b32f497b8999 Author: Jonathan Corbet Date: Mon May 18 06:19:25 2020 -0600 Revert "docs: sysctl/kernel: document ngroups_max" This reverts commit 2f4c33063ad713e3a5b63002cf8362846e78bd71. The changes here were fine, but there's a non-documentation change to sysctl.c that makes messes elsewhere; those changes should have been done independently. Signed-off-by: Jonathan Corbet commit b0a4bb7693be9cca2811ac468f7f7edaf975dbcf Author: Colin Ian King Date: Fri May 15 11:22:26 2020 +0100 rtlwifi: rtl8192ee: remove redundant for-loop The for-loop seems to be redundant, the assignments for indexes 0..2 are being over-written by the last index 3 in the loop. Remove the loop and use index 3 instead. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515102226.29819-1-colin.king@canonical.com commit 3aa42bae9c4d1641aeb36f1a8585cd1d506cf471 Author: Pali Rohár Date: Fri May 15 09:59:24 2020 +0200 mwifiex: Fix memory corruption in dump_station The mwifiex_cfg80211_dump_station() uses static variable for iterating over a linked list of all associated stations (when the driver is in UAP role). This has a race condition if .dump_station is called in parallel for multiple interfaces. This corruption can be triggered by registering multiple SSIDs and calling, in parallel for multiple interfaces iw dev station dump [16750.719775] Unable to handle kernel paging request at virtual address dead000000000110 ... [16750.899173] Call trace: [16750.901696] mwifiex_cfg80211_dump_station+0x94/0x100 [mwifiex] [16750.907824] nl80211_dump_station+0xbc/0x278 [cfg80211] [16750.913160] netlink_dump+0xe8/0x320 [16750.916827] netlink_recvmsg+0x1b4/0x338 [16750.920861] ____sys_recvmsg+0x7c/0x2b0 [16750.924801] ___sys_recvmsg+0x70/0x98 [16750.928564] __sys_recvmsg+0x58/0xa0 [16750.932238] __arm64_sys_recvmsg+0x28/0x30 [16750.936453] el0_svc_common.constprop.3+0x90/0x158 [16750.941378] do_el0_svc+0x74/0x90 [16750.944784] el0_sync_handler+0x12c/0x1a8 [16750.948903] el0_sync+0x114/0x140 [16750.952312] Code: f9400003 f907f423 eb02007f 54fffd60 (b9401060) [16750.958583] ---[ end trace c8ad181c2f4b8576 ]--- This patch drops the use of the static iterator, and instead every time the function is called iterates to the idx-th position of the linked-list. It would be better to convert the code not to use linked list for associated stations storage (since the chip has a limited number of associated stations anyway - it could just be an array). Such a change may be proposed in the future. In the meantime this patch can backported into stable kernels in this simple form. Fixes: 8baca1a34d4c ("mwifiex: dump station support in uap mode") Signed-off-by: Pali Rohár Acked-by: Ganapathi Bhat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515075924.13841-1-pali@kernel.org commit 596e5c5801cd97d3528b30447e23578656eba10b Author: Steve Longerbeam Date: Fri May 1 19:15:41 2020 +0200 media: imx: csi: Implement get_fwnode_pad op The CSI does not have a 1:1 relationship between fwnode port numbers and pad indexes. In fact the CSI fwnode device is itself a port which is the sink, containing only a single fwnode endpoint. Implement media_entity operation get_fwnode_pad to first verify the given endpoint is the CSI's sink endpoint, and if so return the CSI sink pad index. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 07d0f5534935e2daf63a4e1012af13d68e089fed Author: Kevin Lo Date: Fri May 15 14:11:53 2020 +0800 rtw88: no need to set registers for SDIO There's no need to set SDIO related registers when powering up/down the chip. Signed-off-by: Kevin Lo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515061153.GA15714@ns.kevlo.org commit c5457559b626a10028ebf05419ac4d430cf2945a Author: Colin Ian King Date: Thu May 14 19:13:29 2020 +0100 rtw88: 8723d: fix incorrect setting of ldo_pwr Currently ldo_pwr has the LDO25 voltage bits set to zero and then it is overwritten with the new voltage setting. The assignment looks incorrect, it should be bit-wise or'ing in the new voltage setting rather than a direct assignment. Addresses-Coverity: ("Unused value") Fixes: 1afb5eb7a00d ("rtw88: 8723d: Add cfg_ldo25 to control LDO25") Signed-off-by: Colin Ian King Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200514181329.16292-1-colin.king@canonical.com commit 6b684282afcc0cdb6828a8d92566089f6529d49c Author: Yan-Hsuan Chuang Date: Fri May 15 13:23:27 2020 +0800 rtw88: rename rtw88.ko/rtwpci.ko to rtw88_core.ko/rtw88_pci.ko Rename the name of the kernel module for rtw88's core and pci. Add proper prefix 'rtw88_' to easily recognize them, also can avoid confusion with other drivers. (ex. r8822be in staging) Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-8-yhchuang@realtek.com commit 51aab89a1808660d03559c9c33267973f6796a95 Author: Zong-Zhe Yang Date: Fri May 15 13:23:26 2020 +0800 rtw88: extract: remove the unused after extracting remove the unused about pci after extracting chip modules Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-7-yhchuang@realtek.com commit f56f08636ddac358b4e57494b569e5c2174c5fd3 Author: Zong-Zhe Yang Date: Fri May 15 13:23:25 2020 +0800 rtw88: extract: make 8723d an individual kernel module Make objects about 8723d functions and 8723d tables, i.e. rtw8723d.o and rtw8723d_table.o, an individual kernel module called rtw88_8723d.ko. For 8723d pcie chip, i.e. 8723DE chip, add a chip entry point module called rtw88_8723de.ko which will depend on rtw88_8723d.ko and rtwpci.ko. Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-6-yhchuang@realtek.com commit 416e87fcc780cae8d72cb9370fa0f46007faa69a Author: Zong-Zhe Yang Date: Fri May 15 13:23:24 2020 +0800 rtw88: extract: make 8822b an individual kernel module Make objects about 8822b functions and 8822b tables, i.e. rtw8822b.o and rtw8822b_table.o, an individual kernel module called rtw88_8822b.ko. For 8822b pcie chip, i.e. 8822BE chip, add a chip entry point module called rtw88_8822be.ko which will depend on rtw88_8822b.ko and rtwpci.ko. Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-5-yhchuang@realtek.com commit ba0fbe236fb8a7b992e82d6eafb03a600f5eba43 Author: Zong-Zhe Yang Date: Fri May 15 13:23:23 2020 +0800 rtw88: extract: make 8822c an individual kernel module Make objects about 8822c functions and 8822c tables, i.e. rtw8822c.o and rtw8822c_table.o, an individual kernel module called rtw88_8822c.ko. For 8822c pcie chip, i.e. 8822CE chip, add a chip entry point module called rtw88_8822ce.ko which will depend on rtw88_8822c.ko and rtwpci.ko. Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-4-yhchuang@realtek.com commit 72f256c2b948622cc45ff8bc0456dd6039d8fe36 Author: Zong-Zhe Yang Date: Fri May 15 13:23:22 2020 +0800 rtw88: extract: export symbols about pci interface In the current design, chip entry points are built into the pci module. That makes the pci module depend on chips. According to dependence, once the pci module is loaded, kernel will load chip functionalities, including those that may not be currently used. We plan to split chip entry points from the pci module. Thence we export pci symbols that will be used in chip entry point modules. Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-3-yhchuang@realtek.com commit 449be86670f50284069cb0ddc4fe98f064ac6d87 Author: Zong-Zhe Yang Date: Fri May 15 13:23:21 2020 +0800 rtw88: extract: export symbols used in chip functionalities In the current design, various chip functions and tables are built into rtw88 core. That causes kernel to load its functionalities even if a chip isn't currently used. We plan to make each chip's functionalities a separate kernel module to reduce rtw88 core. And kernel will be able to load the necessary. Before extracting chip functionalities, we export symbols inside rtw88 core which will be used in chip modules. Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200515052327.31874-2-yhchuang@realtek.com commit beb12813bc75d4a23de43b85ad1c7cb28d27631e Author: Dan Carpenter Date: Wed May 13 12:39:51 2020 +0300 rtlwifi: Fix a double free in _rtl_usb_tx_urb_setup() Seven years ago we tried to fix a leak but actually introduced a double free instead. It was an understandable mistake because the code was a bit confusing and the free was done in the wrong place. The "skb" pointer is freed in both _rtl_usb_tx_urb_setup() and _rtl_usb_transmit(). The free belongs _rtl_usb_transmit() instead of _rtl_usb_tx_urb_setup() and I've cleaned the code up a bit to hopefully make it more clear. Fixes: 36ef0b473fbf ("rtlwifi: usb: add missing freeing of skbuff") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200513093951.GD347693@mwanda commit b127c16d0603e1f995e3d08b71d2c3100727e2c1 Merge: 27e68f086393 f87d1c955916 Author: Eric W. Biederman Date: Mon May 18 07:11:17 2020 -0500 Merge f87d1c955916 ("exec: Move would_dump into flush_old_exec") The change to exec is relevant to the cleanup work I have been doing. Merge it here so that I can build on top of it, and so hopefully that other merge logic can pick up on this and see how to deal with the conflict between that change and my exec cleanup work. Signed-off-by: "Eric W. Biederman" commit eda31200e68d38fbb974e7ad02bcc2de2cfe6863 Merge: c73fb4d33e1d 12a87174accd Author: Kalle Valo Date: Mon May 18 15:03:37 2020 +0300 Merge tag 'mt76-for-kvalo-2020-05-14' of https://github.com/nbd168/wireless mt76 patches for 5.8 * new devices for mt76x0/mt76x2 * mt7615 fixes * mt7663 fixes * support for non-offload firmware on mt7663 * hw/sched scan support for mt7663 * mt7615/mt7663 MSI support * TDLS support * mt7603/mt7615 rate control fixes * new driver for mt7915 * wowlan support for mt7663 * suspend/resume support for mt7663 # gpg: Signature made Thu 14 May 2020 01:10:07 PM EEST using DSA key ID 02A76EF5 # gpg: Good signature from "Felix Fietkau " # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 75D1 1A7D 91A7 710F 4900 42EF D77D 141D 02A7 6EF5 commit dff681e95a23f28b3c688a8bd5535f78bd726bc8 Author: Nicholas Piggin Date: Fri May 8 14:33:59 2020 +1000 powerpc/pseries/ras: fwnmi avoid modifying r3 in error case If there is some error with the fwnmi save area, r3 has already been modified which doesn't help with debugging. Only update r3 when to restore the saved value. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-8-npiggin@gmail.com commit deb70f7a35a22dffa55b2c3aac71bc6fb0f486ce Author: Nicholas Piggin Date: Fri May 8 14:33:58 2020 +1000 powerpc/pseries/ras: Fix FWNMI_VALID off by one This was discovered developing qemu fwnmi sreset support. This off-by-one bug means the last 16 bytes of the rtas area can not be used for a 16 byte save area. It's not a serious bug, and QEMU implementation has to retain a workaround for old kernels, but it's good to tighten it. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Acked-by: Mahesh Salgaonkar Link: https://lore.kernel.org/r/20200508043408.886394-7-npiggin@gmail.com commit 7368b38b21bfa39df637701a480262c15ab1a49e Author: Nicholas Piggin Date: Fri May 8 14:33:57 2020 +1000 powerpc/pseries/ras: Avoid calling rtas_token() in NMI paths In the interest of reducing code and possible failures in the machine check and system reset paths, grab the "ibm,nmi-interlock" token at init time. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Reviewed-by: Mahesh Salgaonkar Link: https://lore.kernel.org/r/20200508043408.886394-6-npiggin@gmail.com commit f0fd9dd3c213c947dfb5bc2cad3ef5e30d3258ec Author: Nicholas Piggin Date: Fri May 8 14:33:56 2020 +1000 powerpc/64s/exceptions: Machine check reconcile irq state pseries fwnmi machine check code pops the soft-irq checks in rtas_call (after the next patch to remove rtas_token from this call path). Rather than play whack a mole with these and forever having fragile code, it seems better to have the early machine check handler perform the same kind of reconcile as the other NMI interrupts. WARNING: CPU: 0 PID: 493 at arch/powerpc/kernel/irq.c:343 CPU: 0 PID: 493 Comm: a Tainted: G W NIP: c00000000001ed2c LR: c000000000042c40 CTR: 0000000000000000 REGS: c0000001fffd38b0 TRAP: 0700 Tainted: G W MSR: 8000000000021003 CR: 28000488 XER: 00000000 CFAR: c00000000001ec90 IRQMASK: 0 GPR00: c000000000043820 c0000001fffd3b40 c0000000012ba300 0000000000000000 GPR04: 0000000048000488 0000000000000000 0000000000000000 00000000deadbeef GPR08: 0000000000000080 0000000000000000 0000000000000000 0000000000001001 GPR12: 0000000000000000 c0000000014a0000 0000000000000000 0000000000000000 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR28: 0000000000000000 0000000000000001 c000000001360810 0000000000000000 NIP [c00000000001ed2c] arch_local_irq_restore.part.0+0xac/0x100 LR [c000000000042c40] unlock_rtas+0x30/0x90 Call Trace: [c0000001fffd3b40] [c000000001360810] 0xc000000001360810 (unreliable) [c0000001fffd3b60] [c000000000043820] rtas_call+0x1c0/0x280 [c0000001fffd3bb0] [c0000000000dc328] fwnmi_release_errinfo+0x38/0x70 [c0000001fffd3c10] [c0000000000dcd8c] pseries_machine_check_realmode+0x1dc/0x540 [c0000001fffd3cd0] [c00000000003fe04] machine_check_early+0x54/0x70 [c0000001fffd3d00] [c000000000008384] machine_check_early_common+0x134/0x1f0 --- interrupt: 200 at 0x13f1307c8 LR = 0x7fff888b8528 Instruction dump: 60000000 7d2000a6 71298000 41820068 39200002 7d210164 4bffff9c 60000000 60000000 7d2000a6 71298000 4c820020 <0fe00000> 4e800020 60000000 60000000 Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-5-npiggin@gmail.com commit 16754d25bd7d4e53a52b311d99cc7a8fba875d81 Author: Nicholas Piggin Date: Fri May 8 14:33:55 2020 +1000 powerpc/64s/exceptions: Change irq reconcile for NMIs from reusing _DAR to RESULT A spare interrupt stack slot is needed to save irq state when reconciling NMIs (sreset and decrementer soft-nmi). _DAR is used for this, but we want to reconcile machine checks as well, which do use _DAR. Switch to using RESULT instead, as it's used by system calls. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-4-npiggin@gmail.com commit ac2a2a1417391180ef12f908a2864692d6d76d40 Author: Nicholas Piggin Date: Fri May 8 14:33:54 2020 +1000 powerpc/64s/exceptions: Fix in_mce accounting in unrecoverable path Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Acked-by: Mahesh Salgaonkar Link: https://lore.kernel.org/r/20200508043408.886394-3-npiggin@gmail.com commit 8a5054d8cbbe03c68dcb0957c291c942132e4101 Author: Nicholas Piggin Date: Fri May 8 14:33:53 2020 +1000 powerpc/64s/exception: Fix machine check no-loss idle wakeup The architecture allows for machine check exceptions to cause idle wakeups which resume at the 0x200 address which has to return via the idle wakeup code, but the early machine check handler is run first. The case of a no state-loss sleep is broken because the early handler uses non-volatile register r1 , which is needed for the wakeup protocol, but it is not restored. Fix this by loading r1 from the MCE exception frame before returning to the idle wakeup code. Also update the comment which has become stale since the idle rewrite in C. This crash was found and fix confirmed with a machine check injection test in qemu powernv model (which is not upstream in qemu yet). Fixes: 10d91611f426d ("powerpc/64s: Reimplement book3s idle code in C") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200508043408.886394-2-npiggin@gmail.com commit 466381ecdc741b1767d980e10b1ec49f6bde56f3 Author: Sam Bobroff Date: Tue Apr 28 13:45:06 2020 +1000 powerpc/eeh: Release EEH device state synchronously EEH device state is currently removed (by eeh_remove_device()) during the device release handler, which is invoked as the device's reference count drops to zero. This may take some time, or forever, as other threads may hold references. However, the PCI device state is released synchronously by pci_stop_and_remove_bus_device(). This mismatch causes problems, for example the device may be re-discovered as a new device before the release handler has been called, leaving the PCI and EEH state mismatched. So instead, call eeh_remove_device() from the bus device removal handlers, which are called synchronously in the removal path. Signed-off-by: Sam Bobroff Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0a1f5105d3a33b1c090bba31de63eb0cdd25de7b.1588045502.git.sbobroff@linux.ibm.com commit 6fa13640aea7bb0760846981aa2da4245307bd26 Author: Sam Bobroff Date: Tue Apr 28 13:45:05 2020 +1000 powerpc/eeh: Fix pseries_eeh_configure_bridge() If a device is hot unplgged during EEH recovery, it's possible for the RTAS call to ibm,configure-pe in pseries_eeh_configure() to return parameter error (-3), however negative return values are not checked for and this leads to an infinite loop. Fix this by correctly bailing out on negative values. Signed-off-by: Sam Bobroff Signed-off-by: Michael Ellerman Reviewed-by: Nathan Lynch Link: https://lore.kernel.org/r/1b0a6010a647dc915816e44845b64d72066676a7.1588045502.git.sbobroff@linux.ibm.com commit d93e5e2d03d4f41dfedb92200a2c0413ab8ee4e7 Author: Michael Ellerman Date: Thu Apr 2 23:49:29 2020 +1100 powerpc/64: Update Speculation_Store_Bypass in /proc//status Currently we don't report anything useful in /proc//status: $ grep Speculation_Store_Bypass /proc/self/status Speculation_Store_Bypass: unknown Our mitigation is currently always a barrier instruction, which doesn't map that well onto the existing possibilities for the PR_SPEC values. However even if we added a "barrier" type PR_SPEC value, userspace would still need to consult some other source to work out which type of barrier to use. So reporting "vulnerable" seems sufficient, as userspace can see that and then consult its source to determine what barrier to use. Signed-off-by: Gustavo Walbon Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200402124929.3574166-1-mpe@ellerman.id.au commit acee6033c5c5b7758b521ea63bb9f989578aa9fd Author: Steve Longerbeam Date: Fri May 1 19:15:40 2020 +0200 media: Revert "media: v4l2-fwnode: Add a convenience function for registering subdevs with notifiers" The users of v4l2_async_register_fwnode_subdev() have switched to parsing their endpoints and setting up async sub-device lists in their notifiers locally, without using the endpoint parsing callbacks. There are no more users of v4l2_async_register_fwnode_subdev() so this convenience function can be removed. This reverts commit 1634f0eded87d1f150e823fa56cd782ea0775eb2. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ee5866222ab58531c988492ea54931c1346d4fd4 Author: Pierre-Louis Bossart Date: Fri May 15 16:15:31 2020 -0500 ASoC: codecs: rt1308-sdw: remove duplicate allocation The .read_prop callback is supposed to be called by the SoundWire core only. Calling it again from this driver results in an additional memory allocation for no good reason. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Rander Wang Cc: Oder Chiou Cc: Shuming Fan Cc: Jack Yu Link: https://lore.kernel.org/r/20200515211531.11416-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 07b542fe831cbefce163ad1b3aa7292c8a6332b8 Author: Pierre-Louis Bossart Date: Fri May 15 16:15:30 2020 -0500 ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream() Now that the sdw_stream is allocated in machine driver, set_sdw_stream() is also called with a NULL argument during the dailink shutdown. In this case, the drivers should not allocate any memory, and just return. Detected with KASAN/kmemleak. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Rander Wang Cc: Oder Chiou Cc: Shuming Fan Cc: Jack Yu Link: https://lore.kernel.org/r/20200515211531.11416-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b5dff6ec13260585164d4cd13d7a3ec79bd26acb Author: Pierre-Louis Bossart Date: Fri May 15 16:15:29 2020 -0500 ASoC: codecs: rt*-sdw: don't assign slave_ops The SoundWire bus core already assigns the slave ops, no need to set them a second time manually in each driver. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Rander Wang Cc: Oder Chiou Cc: Shuming Fan Cc: Jack Yu Link: https://lore.kernel.org/r/20200515211531.11416-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e641abd3c7261741f295d41d80b213c20f127de2 Author: Corey Minyard Date: Mon May 11 16:13:59 2020 -0500 Try to load acpi_ipmi when an SSIF ACPI IPMI interface is added This is similar to the recent patch for the SI interface, but for SSIF. Signed-off-by: Corey Minyard commit 429b00f606659cbaee41da60be6a6f8965a4f6f8 Author: Stuart Hayes Date: Wed Mar 11 15:24:09 2020 -0400 ipmi_si: Load acpi_ipmi when ACPI IPMI interface added Try to load acpi_ipmi when an ACPI IPMI interface is added, so that the ACPI IPMI OpRegion is accessible. Signed-off-by: Stuart Hayes Message-Id: <20200311192409.59923-1-stuart.w.hayes@gmail.com> Signed-off-by: Corey Minyard commit 49826937e7c7917140515aaf10c17bedcc4acaad Author: Tang Bin Date: Tue May 5 18:29:06 2020 +0800 ipmi:bt-bmc: Fix error handling and status check If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in bt_bmc_config_irq(). And in the function bt_bmc_probe(), when get irq failed, it will print error message. So use platform_get_irq_optional() to simplify code. Finally in the function bt_bmc_remove() should make the right status check if get irq failed. Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Message-Id: <20200505102906.17196-1-tangbin@cmss.chinamobile.com> [Also set bt_bmc->irq to a negative value if devm_request_irq() fails.] Signed-off-by: Corey Minyard commit 878caa96596963ba2d73393572b02624cd23e4ff Author: Andy Shevchenko Date: Wed Apr 22 16:03:48 2020 +0300 ipmi: Replace guid_copy() with import_guid() where it makes sense There is a specific API to treat raw data as GUID, i.e. import_guid(). Use it instead of guid_copy() with explicit casting. Signed-off-by: Andy Shevchenko Message-Id: <20200422130348.38749-1-andriy.shevchenko@linux.intel.com> Signed-off-by: Corey Minyard commit 7c47a219b95d0e06b5ef5fcc7bad807895015eac Author: Feng Tang Date: Fri Apr 17 12:48:28 2020 +0800 ipmi: use vzalloc instead of kmalloc for user creation We met mulitple times of failure of staring bmc-watchdog, due to the runtime memory allocation failure of order 4. bmc-watchdog: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0-1 CPU: 1 PID: 2571 Comm: bmc-watchdog Not tainted 5.5.0-00045-g7d6bb61d6188c #1 Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.00.01.0015.110720180833 11/07/2018 Call Trace: dump_stack+0x66/0x8b warn_alloc+0xfe/0x160 __alloc_pages_slowpath+0xd3e/0xd80 __alloc_pages_nodemask+0x2f0/0x340 kmalloc_order+0x18/0x70 kmalloc_order_trace+0x1d/0xb0 ipmi_create_user+0x55/0x2c0 [ipmi_msghandler] ipmi_open+0x72/0x110 [ipmi_devintf] chrdev_open+0xcb/0x1e0 do_dentry_open+0x1ce/0x380 path_openat+0x305/0x14f0 do_filp_open+0x9b/0x110 do_sys_open+0x1bd/0x250 do_syscall_64+0x5b/0x1f0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Using vzalloc/vfree for creating ipmi_user heals the problem Thanks to Stephen Rothwell for finding the vmalloc.h inclusion issue. Signed-off-by: Feng Tang Signed-off-by: Corey Minyard commit 8ed678dbac8c8c5685893f3af1c47f167b61c5ec Author: Tang Bin Date: Tue Apr 14 22:18:14 2020 +0800 ipmi:bt-bmc: Fix some format issue of the code Fix some format issue of the code in bt-bmc.c Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang Message-Id: <20200414141814.19048-1-tangbin@cmss.chinamobile.com> Signed-off-by: Corey Minyard commit 0b671eed0cf069839c4e73b66d88ec483ee6c3f5 Author: Tang Bin Date: Wed Apr 8 19:59:58 2020 +0800 ipmi:bt-bmc: Avoid unnecessary check bt_bmc_probe() is only called with an openfirmware platform device. Therefore there is no need to check that the passed in device is NULL or that it has an openfirmware node. Signed-off-by: Tang Bin Message-Id: <20200408115958.2848-1-tangbin@cmss.chinamobile.com> [Fixed the title up a bit.] Signed-off-by: Corey Minyard commit 552abb884e97d26589964e5a8c7e736f852f95f0 Author: Rafael J. Wysocki Date: Mon May 18 12:49:45 2020 +0200 cpufreq: Fix up cpufreq_boost_set_sw() After commit 18c49926c4bf ("cpufreq: Add QoS requests for userspace constraints") the return value of freq_qos_update_request(), that can be 1, passed by cpufreq_boost_set_sw() to its caller sometimes confuses the latter, which only expects to see 0 or negative error codes, so notice that cpufreq_boost_set_sw() can return an error code (which should not be -EINVAL for that matter) as soon as the first policy without a frequency table is found (because either all policies have a frequency table or none of them have it) and rework it to meet its caller's expectations. Fixes: 18c49926c4bf ("cpufreq: Add QoS requests for userspace constraints") Reported-by: Serge Semin Reported-by: Xiongfeng Wang Acked-by: Viresh Kumar Cc: 5.3+ # 5.3+ Signed-off-by: Rafael J. Wysocki commit cc0594c4b0ef280dd7bdceab1a7c940d356f494d Author: Mauro Carvalho Chehab Date: Tue May 12 07:51:56 2020 +0200 ACPI / PMIC: Add i2c address for thermal control On Asus T101HA, we keep receiving those error messages: i915 0000:00:02.0: [drm] *ERROR* mipi_exec_pmic failed, error: -95 intel_soc_pmic_exec_mipi_pmic_seq_element: Not implemented intel_soc_pmic_exec_mipi_pmic_seq_element: i2c-addr: 0x5e reg-addr 0x4b value 0x59 mask 0xff Because the opregion is missing the I2C address. Suggested-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Hans de Goede Reviewed-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 7c0577f4e609f7278ebd6d21e2de82b42f110944 Merge: 6b5dd716da8f b9bbe6ed63b2 Author: Ingo Molnar Date: Mon May 18 13:00:36 2020 +0300 Merge tag 'v5.7-rc6' into objtool/core, to pick up fixes and resolve semantic conflict Resolve structural conflict between: 59566b0b622e: ("x86/ftrace: Have ftrace trampolines turn read-only at the end of system boot up") which introduced a new reference to 'ftrace_epilogue', and: 0298739b7983: ("x86,ftrace: Fix ftrace_regs_caller() unwind") Which renamed it to 'ftrace_caller_end'. Rename the new usage site in the merge commit. Signed-off-by: Ingo Molnar commit 2f13ff1d1d5c0257c97ea76b86a2d9c99c44a4b9 Author: Marc Zyngier Date: Fri May 15 17:57:51 2020 +0100 irqchip/gic-v3-its: Track LPI distribution on a per CPU basis In order to improve the distribution of LPIs among CPUs, let start by tracking the number of LPIs assigned to CPUs, both for managed and non-managed interrupts (as separate counters). Signed-off-by: Marc Zyngier Tested-by: John Garry Link: https://lore.kernel.org/r/20200515165752.121296-2-maz@kernel.org commit 337cbeb2c13eb4cab84f576fd402d7ae4ed31ae1 Author: Bartosz Golaszewski Date: Thu May 14 10:39:01 2020 +0200 genirq/irq_sim: Simplify the API The interrupt simulator API exposes a lot of custom data structures and functions and doesn't reuse the interfaces already exposed by the irq subsystem. This patch tries to address it. We hide all the simulator-related data structures from users and instead rely on the well-known irq domain. When creating the interrupt simulator the user receives a pointer to a newly created irq_domain and can use it to create mappings for simulated interrupts. It is also possible to pass a handle to fwnode when creating the simulator domain and retrieve it using irq_find_matching_fwnode(). The irq_sim_fire() function is dropped as well. Instead we implement the irq_get/set_irqchip_state interface. We modify the two modules that use the simulator at the same time as adding these changes in order to reduce the intermediate bloat that would result when trying to migrate the drivers in separate patches. Signed-off-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Reviewed-by: Linus Walleij Acked-by: Jonathan Cameron #for IIO Link: https://lore.kernel.org/r/20200514083901.23445-3-brgl@bgdev.pl commit 5c8f77a278737a6af44a892f0700d9aadb2b0de0 Author: Bartosz Golaszewski Date: Thu May 14 10:39:00 2020 +0200 irqdomain: Make irq_domain_reset_irq_data() available to non-hierarchical users irq_domain_reset_irq_data() doesn't modify the parent data, so it can be made available even if irq domain hierarchy is not being built. We'll subsequently use it in irq_sim code. Signed-off-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20200514083901.23445-2-brgl@bgdev.pl commit 82f2202ddc97490994fad0dbfec04a014fa5163d Author: Wesley W. Terpstra Date: Tue May 12 10:26:36 2020 -0700 irqchip/sifive-plic: Remove incorrect requirement about number of irq contexts A PLIC may not be connected to all the cores. In that case, nr_contexts may be less than num_possible_cpus. This requirement is only valid a single PLIC is the only interrupt controller for the whole system. Signed-off-by: Atish Patra Signed-off-by: "Wesley W. Terpstra" Signed-off-by: Marc Zyngier Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20200512172636.96299-1-atish.patra@wdc.com [Atish: Modified the commit text] commit 8a94c1ab34d53476617f83610521cfb6674db8d4 Author: Ingo Rohloff Date: Wed Apr 22 13:28:57 2020 +0200 irqchip/gic-v3: Fix missing "__init" for gic_smp_init() With an SMP configuration, gic_smp_init() calls set_smp_cross_call(). set_smp_cross_call() is marked with "__init". So gic_smp_init() should also be marked with "__init". gic_smp_init() is only called from gic_init_bases(). gic_init_bases() is also marked with "__init"; So marking gic_smp_init() with "__init" is fine. Signed-off-by: Ingo Rohloff Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200422112857.4300-1-ingo.rohloff@lauterbach.com commit ae0bb9fda405c881848f7f6e94d912b35f6e31d2 Author: Shaokun Zhang Date: Mon May 18 11:00:59 2020 +0800 platform-msi: Fix typos in comment Fix up one typos @nev -> @nr_irqs. Signed-off-by: Shaokun Zhang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1589770859-19340-1-git-send-email-zhangshaokun@hisilicon.com commit 46d0797906633d82bd50ef26780ee39fac5d27d6 Author: Dominik Brodowski Date: Mon May 18 10:58:50 2020 +0200 pcmcia: make pccard_loop_tuple() static pccard_loop_tuple() is only used within drivers/pcmcia/pcmcia_cis.c, so make that function static. Signed-off-by: Dominik Brodowski commit 0e63a5e4bb4ea3c87ff5978a5856f0c6365c7619 Author: Steve Longerbeam Date: Fri May 1 19:15:39 2020 +0200 media: imx: Parse information from firmware without using callbacks Instead of using the convenience functions v4l2_async_notifier_parse_fwnode_endpoints*() or v4l2_async_register_fwnode_subdev(), parse the input endpoints and set up the async sub-devices without using callbacks. The drivers know which ports it must parse and how to handle unconnected remotes, so it makes the code simpler to transfer control of endpoint parsing to the driver. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f4d7a681b82665cf50c993623956fa07e34d73aa Author: Steve Longerbeam Date: Fri May 1 19:15:38 2020 +0200 media: video-mux: Parse information from firmware without using callbacks Instead of using the convenience function v4l2_async_register_fwnode_subdev(), parse the video-mux input endpoints and set up the async sub-devices without using callbacks. The video-mux knows which ports it must parse (the input ports) and how to handle unconnected remotes, so it makes the code simpler to transfer control of endpoint parsing to the driver. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0d3c81e82da90f0752a09c38ffae7e7ffec01b33 Author: Steve Longerbeam Date: Fri May 1 19:15:37 2020 +0200 media: v4l2-mc: add v4l2_create_fwnode_links helpers Add functions to create media links between source and sink subdevices, based on the fwnode endpoint connections between them: v4l2_create_fwnode_links_to_pad() - create links from a source subdev to a single sink pad based on fwnode endpoint connections. v4l2_create_fwnode_links() - create all links from a source to sink subdev based on fwnode endpoint connections. These functions can be used in a sink's v4l2-async notifier subdev bound callback to make the links from the bound subdev. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8fe784b9abb296124d0182eac35b96dbc29d049a Author: Steve Longerbeam Date: Fri May 1 19:15:36 2020 +0200 media: v4l2-subdev: add v4l2_subdev_get_fwnode_pad_1_to_1 Add a convenience function that can be used as the .get_fwnode_pad operation for subdevices that map port numbers and pad indexes 1:1. The function verifies the endpoint is owned by the subdevice, and if so returns the endpoint port number. Signed-off-by: Steve Longerbeam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 70d4a9efee9cdd580207473379e3ee64b331ae75 Author: Steve Longerbeam Date: Fri May 1 19:15:35 2020 +0200 media: entity: Pass entity to get_fwnode_pad operation Add a missing pointer to the entity in the media_entity operation get_fwnode_pad. There are no implementers of this op yet, but a future entity that does so will almost certainly need a reference to itself to carry out the work. operation") Fixes: ae45cd5efc120 ("[media] media: entity: Add get_fwnode_pad entity Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b2bbf1aac61186ef904fd28079e847d3feadb89e Author: Dafna Hirschfeld Date: Tue Mar 31 20:06:30 2020 +0200 media: i2c: imx219: Fix a bug in imx219_enum_frame_size When enumerating the frame sizes, the value sent to imx219_get_format_code should be fse->code (the code from the ioctl) and not imx219->fmt.code which is the code set currently in the driver. Fixes: 22da1d56e982 ("media: i2c: imx219: Add support for RAW8 bit bayer format") Signed-off-by: Dafna Hirschfeld Reviewed-by: Helen Koike Reviewed-by: Dave Stevenson Reviewed-by: Lad Prabhakar Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e6d4ef7d58aa7e64aa735e1b3c7b670e4fb34d6f Author: Jacopo Mondi Date: Wed Apr 29 11:50:38 2020 +0200 media: i2c: imx219: Implement get_selection Implement the get_selection pad operation for the IMX219 sensor driver. The supported targets report the sensor's native size, the crop default rectangle and the crop rectangle. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 59e7166fe0e2cb210252c3454a9241e586a2ba42 Author: Geert Uytterhoeven Date: Thu May 7 09:50:26 2020 +0200 dt-bindings: clock: renesas: div6: Convert to json-schema Convert the Renesas CPG DIV6 Clock Device Tree binding documentation to json-schema. Drop R-Car Gen2 compatible values, which were obsoleted by the unified "Renesas Clock Pulse Generator / Module Standby and Software Reset" DT bindings. Update the example to match reality. Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Reviewed-by: Rob Herring Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20200507075026.31941-1-geert+renesas@glider.be commit ace342097768e35fd41934285604fa97da1e235a Author: Geert Uytterhoeven Date: Thu May 7 09:47:13 2020 +0200 clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling On SoCs with Standby Control Registers (STBCRs) instead of Module Stop Control Registers (MSTPCRs), the suspend handler saves the wrong registers, and the resume handler prints the wrong register in an error message. Fortunately this cannot happen yet, as the suspend/resume code is used on PSCI systems only, and systems with STBCRs (RZ/A1 and RZ/A2) do not use PSCI. Still, it is better to fix this, to avoid this becoming a problem in the future. Distinguish between STBCRs and MSTPCRs where needed. Replace the useless printing of the virtual register address in the resume error message by printing the register index. Fixes: fde35c9c7db5732c ("clk: renesas: cpg-mssr: Add R7S9210 support") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200507074713.30113-1-geert+renesas@glider.be commit 06ed6aa56ffac9241e03a24649e8d048f8f1b10c Author: Gustavo A. R. Silva Date: Thu May 7 14:05:49 2020 -0500 pcmcia: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Dominik Brodowski commit a0d50aa9350a02d8fe6adb95c6daa738318d6140 Merge: d850c6f42cd8 d9646a4866b0 Author: Linus Walleij Date: Mon May 18 10:13:36 2020 +0200 Merge branch 'ib-gpio-aggregator' into devel commit d9646a4866b008538dca327095c1b5e5f0204d4f Author: Geert Uytterhoeven Date: Mon May 11 16:52:57 2020 +0200 MAINTAINERS: Add GPIO Aggregator section Add a maintainership section for the GPIO Aggregator, covering documentation and driver source code. Signed-off-by: Geert Uytterhoeven Tested-by: Eugeniu Rosca Reviewed-by: Eugeniu Rosca Link: https://lore.kernel.org/r/20200511145257.22970-7-geert+renesas@glider.be Signed-off-by: Linus Walleij commit ce7a2f77f9766378b51422f8f45fd06cdc44ef0b Author: Geert Uytterhoeven Date: Mon May 11 16:52:56 2020 +0200 docs: gpio: Add GPIO Aggregator documentation Document the GPIO Aggregator, and the two typical use-cases. Signed-off-by: Geert Uytterhoeven Tested-by: Eugeniu Rosca Reviewed-by: Ulrich Hecht Reviewed-by: Eugeniu Rosca Link: https://lore.kernel.org/r/20200511145257.22970-6-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 828546e24280f721350a7a0dcc92416e917b4382 Author: Geert Uytterhoeven Date: Mon May 11 16:52:55 2020 +0200 gpio: Add GPIO Aggregator GPIO controllers are exported to userspace using /dev/gpiochip* character devices. Access control to these devices is provided by standard UNIX file system permissions, on an all-or-nothing basis: either a GPIO controller is accessible for a user, or it is not. Currently no mechanism exists to control access to individual GPIOs. Hence add a GPIO driver to aggregate existing GPIOs, and expose them as a new gpiochip. This supports the following use cases: - Aggregating GPIOs using Sysfs This is useful for implementing access control, and assigning a set of GPIOs to a specific user or virtual machine. - Generic GPIO Driver This is useful for industrial control, where it can provide userspace access to a simple GPIO-operated device described in DT, cfr. e.g. spidev for SPI-operated devices. Signed-off-by: Geert Uytterhoeven Tested-by: Eugeniu Rosca Reviewed-by: Eugeniu Rosca Link: https://lore.kernel.org/r/20200511145257.22970-5-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 4c033b549912bc301c5e2adfb7b6ca007c11bf31 Author: Geert Uytterhoeven Date: Mon May 11 16:52:54 2020 +0200 gpiolib: Add support for GPIO lookup by line name Currently a GPIO lookup table can only refer to a specific GPIO by a tuple, consisting of a GPIO controller label and a GPIO offset inside the controller. However, a GPIO may also carry a line name, defined by DT or ACPI. If present, the line name is the most use-centric way to refer to a GPIO. Hence add support for looking up GPIOs by line name. Note that there is no guarantee that GPIO line names are globally unique, so this will use the first match found. Implement this by reusing the existing gpiod_lookup infrastructure. Rename gpiod_lookup.chip_label to gpiod_lookup.key, to make it clear that this field can have two meanings, and update the kerneldoc and GPIO_LOOKUP*() macros. Signed-off-by: Geert Uytterhoeven Tested-by: Eugeniu Rosca Reviewed-by: Ulrich Hecht Reviewed-by: Eugeniu Rosca Link: https://lore.kernel.org/r/20200511145257.22970-4-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 7b67b836625d9b8350aaec7ecd8347b0336f3f92 Author: Geert Uytterhoeven Date: Mon May 11 16:52:53 2020 +0200 mfd: sm501: Use GPIO_LOOKUP_IDX() helper macro i801_add_mux() fills in the GPIO lookup table by manually populating an array of gpiod_lookup structures. Use the existing GPIO_LOOKUP_IDX() helper macro instead, to relax a dependency on the gpiod_lookup structure's member names. Signed-off-by: Geert Uytterhoeven Acked-by: Lee Jones Link: https://lore.kernel.org/r/20200511145257.22970-3-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 22b3bc63da37dc3c24f877951ff7bf60737848cf Author: Geert Uytterhoeven Date: Mon May 11 16:52:52 2020 +0200 i2c: i801: Use GPIO_LOOKUP() helper macro i801_add_mux() fills in the GPIO lookup table by manually populating an array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper macro instead, to relax a dependency on the gpiod_lookup structure's member names. Signed-off-by: Geert Uytterhoeven Reviewed-by: Jean Delvare Link: https://lore.kernel.org/r/20200511145257.22970-2-geert+renesas@glider.be Signed-off-by: Linus Walleij commit a228f7a410290d836f3a9f9b1ed5aef1aab25cc7 Author: Abhishek Pandit-Subedi Date: Thu May 14 13:14:04 2020 -0700 Bluetooth: hci_qca: Enable WBS support for wcn3991 WCN3991 supports transparent WBS (host encoded mSBC). Add a flag to the device match data to show WBS is supported. This requires the matching firmware for WCN3991 in linux-firmware: 1a8b0dc00f77 (qca: Enable transparent WBS for WCN3991) Signed-off-by: Abhishek Pandit-Subedi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit 56b5453a86203a44726f523b4133c1feca49ce7c Author: Hsin-Yu Chao Date: Fri May 15 17:27:04 2020 +0800 Bluetooth: Add SCO fallback for invalid LMP parameters error Bluetooth PTS test case HFP/AG/ACC/BI-12-I accepts SCO connection with invalid parameter at the first SCO request expecting AG to attempt another SCO request with the use of "safe settings" for given codec, base on section 5.7.1.2 of HFP 1.7 specification. This patch addresses it by adding "Invalid LMP Parameters" (0x1e) to the SCO fallback case. Verified with below log: < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17 Handle: 256 Transmit bandwidth: 8000 Receive bandwidth: 8000 Max latency: 13 Setting: 0x0003 Input Coding: Linear Input Data Format: 1's complement Input Sample Size: 8-bit # of bits padding at MSB: 0 Air Coding Format: Transparent Data Retransmission effort: Optimize for link quality (0x02) Packet type: 0x0380 3-EV3 may not be used 2-EV5 may not be used 3-EV5 may not be used > HCI Event: Command Status (0x0f) plen 4 Setup Synchronous Connection (0x01|0x0028) ncmd 1 Status: Success (0x00) > HCI Event: Number of Completed Packets (0x13) plen 5 Num handles: 1 Handle: 256 Count: 1 > HCI Event: Max Slots Change (0x1b) plen 3 Handle: 256 Max slots: 1 > HCI Event: Synchronous Connect Complete (0x2c) plen 17 Status: Invalid LMP Parameters / Invalid LL Parameters (0x1e) Handle: 0 Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC) Link type: eSCO (0x02) Transmission interval: 0x00 Retransmission window: 0x02 RX packet length: 0 TX packet length: 0 Air mode: Transparent (0x03) < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17 Handle: 256 Transmit bandwidth: 8000 Receive bandwidth: 8000 Max latency: 8 Setting: 0x0003 Input Coding: Linear Input Data Format: 1's complement Input Sample Size: 8-bit # of bits padding at MSB: 0 Air Coding Format: Transparent Data Retransmission effort: Optimize for link quality (0x02) Packet type: 0x03c8 EV3 may be used 2-EV3 may not be used 3-EV3 may not be used 2-EV5 may not be used 3-EV5 may not be used > HCI Event: Command Status (0x0f) plen 4 Setup Synchronous Connection (0x01|0x0028) ncmd 1 Status: Success (0x00) > HCI Event: Max Slots Change (0x1b) plen 3 Handle: 256 Max slots: 5 > HCI Event: Max Slots Change (0x1b) plen 3 Handle: 256 Max slots: 1 > HCI Event: Synchronous Connect Complete (0x2c) plen 17 Status: Success (0x00) Handle: 257 Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC) Link type: eSCO (0x02) Transmission interval: 0x06 Retransmission window: 0x04 RX packet length: 30 TX packet length: 30 Air mode: Transparent (0x03) Signed-off-by: Hsin-Yu Chao Signed-off-by: Marcel Holtmann commit 49c06c9eb14ba61725c1c82e5107f4e4bd6c1886 Author: Łukasz Rymanowski Date: Wed May 13 10:18:53 2020 +0200 Bluetooth: Fix for GAP/SEC/SEM/BI-10-C Security Mode 1 level 4, force us to use have key size 16 octects long. This patch adds check for that. This is required for the qualification test GAP/SEC/SEM/BI-10-C Logs from test when ATT is configured with sec level BT_SECURITY_FIPS < ACL Data TX: Handle 3585 flags 0x00 dlen 11 #28 [hci0] 3.785965 SMP: Pairing Request (0x01) len 6 IO capability: DisplayYesNo (0x01) OOB data: Authentication data not present (0x00) Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d) Max encryption key size: 16 Initiator key distribution: EncKey Sign (0x05) Responder key distribution: EncKey IdKey Sign (0x07) > ACL Data RX: Handle 3585 flags 0x02 dlen 11 #35 [hci0] 3.883020 SMP: Pairing Response (0x02) len 6 IO capability: DisplayYesNo (0x01) OOB data: Authentication data not present (0x00) Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d) Max encryption key size: 7 Initiator key distribution: EncKey Sign (0x05) Responder key distribution: EncKey IdKey Sign (0x07) < ACL Data TX: Handle 3585 flags 0x00 dlen 6 #36 [hci0] 3.883136 SMP: Pairing Failed (0x05) len 1 Reason: Encryption key size (0x06) Signed-off-by: Łukasz Rymanowski Signed-off-by: Marcel Holtmann commit 631512f868a4a49a48bda753752d085621c68112 Author: Gustavo A. R. Silva Date: Wed May 13 12:15:56 2020 -0500 Bluetooth: L2CAP: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Marcel Holtmann commit 8be26bab0ea2097ab1d7bca85fb3b2e295faf5ec Author: Joshua Kinard Date: Sun May 17 19:24:38 2020 -0400 MIPS: SGI-IP30: Remove R5432_CP0_INTERRUPT_WAR from war.h Remove an old macro that no longer exists anywhere else in the tree that snuck in when IP30 support was added Signed-off-by: Joshua Kinard Signed-off-by: Thomas Bogendoerfer commit 143463fd33fe0abc13fbb93236b060ee9b73d5cb Author: Tiezhu Yang Date: Mon May 18 10:11:01 2020 +0800 MIPS: Loongson: Enable devicetree based probing for 8250 ports in defconfig After commit 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts"), there already exists the node and property of Loongson CPU UART0 in loongson3-package.dtsi: cpu_uart0: serial@1fe001e0 { compatible = "ns16550a"; reg = <0 0x1fe001e0 0x8>; clock-frequency = <33000000>; interrupt-parent = <&liointc>; interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; no-loopback-test; }; In order to support for serial console on the Loongson platform, add CONFIG_SERIAL_OF_PLATFORM=y to loongson3_defconfig. With this patch, we can see the following boot messages: [ 1.877745] printk: console [ttyS0] disabled [ 1.881979] 1fe001e0.serial: ttyS0 at MMIO 0x1fe001e0 (irq = 16, base_baud = 2062500) is a 16550A [ 1.890838] printk: console [ttyS0] enabled And also, we can login normally from the serial console. Signed-off-by: Tiezhu Yang Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit e695dea067fca398b7eb0f0977f4692986b483f7 Author: Lars Povlsen Date: Wed May 13 14:55:25 2020 +0200 dt-bindings: pinctrl: ocelot: Add Sparx5 SoC support This adds documentation for the "compatible" value designated for Sparx5 Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen Link: https://lore.kernel.org/r/20200513125532.24585-8-lars.povlsen@microchip.com Signed-off-by: Linus Walleij commit 0b47afc65453a70bc521e251138418056f65793f Author: Lars Povlsen Date: Wed May 13 14:55:21 2020 +0200 pinctrl: ocelot: Fix GPIO interrupt decoding on Jaguar2 This fixes a problem with using the GPIO as an interrupt on Jaguar2 (and similar), as the register layout of the platforms with 64 GPIO's are pairwise, such that the original offset must be multiplied with the platform stride. Fixes: da801ab56ad8 pinctrl: ocelot: add MSCC Jaguar2 support. Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen Link: https://lore.kernel.org/r/20200513125532.24585-4-lars.povlsen@microchip.com Signed-off-by: Linus Walleij commit edc7254664abdcd087e49849f0ba6489c1f19b49 Author: Lars Povlsen Date: Wed May 13 14:55:20 2020 +0200 pinctrl: ocelot: Remove instance number from pin functions This patch removes the instance number from the "miim", "reco_clk" and "sfp" pin function. The change needed is to prepare the driver for adding new platforms with more of these instances. The instance number is also redundant, as this is implicit for each pin. Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen Link: https://lore.kernel.org/r/20200513125532.24585-3-lars.povlsen@microchip.com Signed-off-by: Linus Walleij commit 550713e33f4338c8596776828a936fd1e3bf35de Author: Lars Povlsen Date: Wed May 13 14:55:19 2020 +0200 pinctrl: ocelot: Always register GPIO driver This fixes the situation where the GPIO controller is not used as an interrupt controller as well. Previously, the driver would silently fail to register even the GPIO's. With this change, the driver will only register as an interrupt controller if a parent interrupt is provided. Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen Link: https://lore.kernel.org/r/20200513125532.24585-2-lars.povlsen@microchip.com Signed-off-by: Linus Walleij commit 5d590738521e25b183172c32aab6ee71b9366dca Author: Johan Jonker Date: Tue May 12 22:35:23 2020 +0200 dt-bindings: pinctrl: rockchip: update example The Rockchip dtsi and dts files have been bulk-converted for the remaining raw gpio numbers into their descriptive counterparts and also got rid of the unhelpful RK_FUNC_x -> x and RK_GPIOx -> x mappings, so update the example as well. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200512203524.7317-2-jbx6244@gmail.com Signed-off-by: Linus Walleij commit d850c6f42cd8edcb019cfae5f00b1432d0d1a3c5 Author: Andy Shevchenko Date: Tue May 12 21:27:21 2020 +0300 gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts() There is no need to have an additional check to call acpi_gpiochip_request_interrupts(). Even without any interrupts available the registered ACPI Event handlers can be useful for debugging purposes. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512182721.55127-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit b24bc583dea7e0cf2d5d68e3325e1689fa7c2275 Author: Andy Shevchenko Date: Tue May 12 21:27:20 2020 +0300 gpio: xgene-sb: Allow driver to be built with COMPILE_TEST Allow driver to be built with COMPILE_TEST for better test coverage. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512182721.55127-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 4d3a050039a98bf12a8b9aa106395ce0c2dd9219 Author: Andy Shevchenko Date: Tue May 12 21:27:19 2020 +0300 gpio: xgene-sb: Drop redundant OF_GPIO dependency There is nothing in the driver requires OF_GPIO. Moreover, driver supports ACPI and OF_GPIO may be a quite overhead on such configurations. Drop dependency for good and replace of_gpio.h to of.h since we have one function to be defined from there. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512182721.55127-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit db67aa33d58d1497c1e025c7dc34de95e83de529 Author: Andy Shevchenko Date: Tue May 12 21:26:23 2020 +0300 gpio: mb86s7x: Remove superfluous test for ACPI companion acpi_gpiochip_request_interrupts() will check for ACPI handle of the GPIO chip parent device and bail out if there is none defined. Thus, has_acpi_companion() is effectively repeating above and is not needed in the individual driver. Assigning ->to_irq() unconditionally doesn't change anything, except an error code, but this we fix as well by propagating it from platform_get_irq(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512182623.54990-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 672de5274446fd41167953528da3426805652c1a Author: Andy Shevchenko Date: Tue May 12 21:26:22 2020 +0300 gpio: mb86s7x: Use devm_clk_get_optional() to get the input clock Simplify the code which fetches the input clock by using devm_clk_get_optional(). If no input clock is present devm_clk_get_optional() will return NULL instead of an error which matches the behavior of the old code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512182623.54990-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 1f7a3eb785e4a4e196729cd3d5ec97bd5f9f2940 Author: Bjorn Andersson Date: Sun May 17 23:10:41 2020 -0700 Revert "soc: qcom: rpmh: Allow RPMH driver to be loaded as a module" Attempting to compile rpmh-rsc.c as a module with TRACING enabled causes a build error as no _rcuidle function is generated for tracepoints when CONFIG_MODULE is set. Attempts has been made, but no resolution has been agreed upon, so lets revert this commit for now. This reverts commit 1d3c6f86fd3f8b88c707f56d8c3f94e014b40e83. Reported-by: Stephen Rothwell Signed-off-by: Bjorn Andersson commit 48a789079a146ecd916e29cc5e47410d9cb05fbe Merge: 2478be82de44 b9bbe6ed63b2 Author: Greg Kroah-Hartman Date: Mon May 18 07:55:55 2020 +0200 Merge 5.7-rc6 into usb-next We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 6cc3d0e9a097981c8a0317c65b8a2278593bd2b0 Author: Mian Yousaf Kaukab Date: Wed Oct 23 11:27:03 2019 +0200 cpufreq: tegra186: add CPUFREQ_NEED_INITIAL_FREQ_CHECK flag The driver doesn't provide ->get() method to read current frequency and the frequency is set to 0 at initialization which makes the driver fail at initialization time. Set the CPUFREQ_NEED_INITIAL_FREQ_CHECK flag for the driver, so the cpufreq core checks for the unlisted frequency and sets the CPU to a valid frequency from the frequency table. Signed-off-by: Mian Yousaf Kaukab [ Viresh: Massaged change log ] Signed-off-by: Viresh Kumar commit f84e1ba336a4f47ae251e4d2d8a694902571b0df Author: Emil Velikov Date: Sun May 17 20:36:55 2020 +0100 drm/exynos-vidi: convert platform driver to use dev_groups Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a sysfs file. Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: dri-devel@lists.freedesktop.org Signed-off-by: Emil Velikov Signed-off-by: Inki Dae commit 547a7348633b1f9923551f94ac3157a613d2c9f2 Author: Christophe JAILLET Date: Sat May 16 12:57:36 2020 +0200 drm/exynos: dsi: Remove bridge node reference in error handling path in probe function 'exynos_dsi_parse_dt()' takes a reference to 'dsi->in_bridge_node'. This must be released in the error handling path. In order to do that, add an error handling path and move the 'exynos_dsi_parse_dt()' call from the beginning to the end of the probe function to ease the error handling path. This function only sets some variables which are used only in the 'transfer' function. The call chain is: .transfer --> exynos_dsi_host_transfer --> exynos_dsi_init --> exynos_dsi_enable_clock (use burst_clk_rate and esc_clk_rate) --> exynos_dsi_set_pll (use pll_clk_rate) While at it, also handle cases where 'component_add()' fails. This patch is similar to commit 70505c2ef94b ("drm/exynos: dsi: Remove bridge node reference in removal") which fixed the issue in the remove function. Signed-off-by: Christophe JAILLET Signed-off-by: Inki Dae commit 918e2844d940da7c624262a7aa327615d3eb5abd Author: Michał Mirosław Date: Sun May 17 20:41:05 2020 -0700 Input: elants - refactor elants_i2c_execute_command() Apply some DRY-ing to elants_i2c_execute_command() callers. This pulls polling and error printk()s into a single function. Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/6c576f688b385235c65b461410a917080d27e825.1587923061.git.mirq-linux@rere.qmqm.pl Signed-off-by: Dmitry Torokhov commit 68334dbab13bc5d637fdf1aa2ccfe7e1932b2af1 Author: Michał Mirosław Date: Sun May 17 20:39:40 2020 -0700 Input: elants - override touchscreen info with DT properties Allow overriding of information from hardware and support additional common DT properties like axis inversion. This is required for eg. Nexus 7 and TF300T where the programmed values in firmware differ from reality. Signed-off-by: Dmitry Osipenko [moved "prop" before DMA buffer] Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/49ea996878264f7c8bde25204e4ddf4b1e85ae71.1587923061.git.mirq-linux@rere.qmqm.pl Signed-off-by: Dmitry Torokhov commit 6def17b12ba3d30196d4f35a5cf1edf38f791d1d Author: Michał Mirosław Date: Sun May 17 20:38:43 2020 -0700 Input: elants - remove unused axes Driver only ever reports MT events and input_mt_init_slots() sets up emulated axes already. Clear the capabilities not generated directly and move MT axes setup, so they are visible by input_mt_init_slots(). Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Link: https://lore.kernel.org/r/d5eee8cd305adb144a11264d70da94f7b6570366.1587923061.git.mirq-linux@rere.qmqm.pl Signed-off-by: Dmitry Torokhov commit 2969869bfac3cb8c549f6cadea6b97bb1d9ec86f Merge: 04e49867fad1 d34fced41e17 Author: Dmitry Torokhov Date: Sun May 17 21:10:28 2020 -0700 Merge branch 'for-linus' into next Merge for-linus branch to sync Elan touchscreen driver code. commit fda022143f6f00fc4c3c296175b5e315c7c12710 Author: Marek Szyprowski Date: Thu May 14 12:08:12 2020 +0200 drm/exynos: mixer: Fix enabling of the runtime power management Runtime power management is essential for the Exynos Mixer driver operation. It should be enabled before adding its DRM component, because in some cases (when deferred probe takes place due to the IOMMU availability) the DRM driver might be initialized directly from the Mixer's component_add() call, what results in starting the driver operation without enabling the runtime power management. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit a046e7bf4e27d77a34595778945adbd4450d803a Author: Bernard Zhao Date: Sun Apr 26 02:01:42 2020 -0700 drm/exynos: make pointer to const data const type Maybe keep pointer which points to global const string data in const type is better, make sure not change const data. Signed-off-by: Bernard Zhao Signed-off-by: Inki Dae commit 9940d9d93406f41ad4dc69fa2cda1e059a7ca108 Author: Marek Szyprowski Date: Thu Apr 23 14:43:49 2020 +0900 drm/exynos: gem: Get rid of the internal 'pages' array Internal pages array and scatter-list for them is not really needed for anything. FBDev emulation can simply rely on the DMA-mapping framework to create a proper kernel mapping for the buffer, while all other buffer use cases don't really need that array at all. Suggested-by: Christian König Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit 24f6fe796a964f1cba75030dbea297d7fb2f30cb Author: Marek Szyprowski Date: Wed Apr 22 13:40:59 2020 +0200 drm/exynos: gem: rework scatter-list contiguity check on prime import Explicitly check if the imported buffer has been mapped as contiguous in the DMA address space, what is required by all Exynos DRM CRTC drivers. While touching this, set buffer flags depending on the availability of the IOMMU. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit 3a2fe5662c5634b7b975fefd0b9c45bd35f72de8 Author: Marek Szyprowski Date: Tue Apr 7 15:42:54 2020 +0200 drm/exynos: gem: Remove dead-code The ExynosDRM page fault handler is never used, drm_gem_mmap() always calls exynos_drm_gem_mmap() function, which perform complete mapping for the given virtual address-space area. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit fdd79b0db1899f915f489e744a06846284fa3f1e Author: Markus Elfring Date: Sun Apr 5 14:10:09 2020 +0200 drm/exynos: Delete an error message in three functions The function “platform_get_irq” can log an error already. Thus omit redundant messages for the exception handling in the calling functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Inki Dae commit 04e49867fad1f4a0739862bb15133f96ace1d190 Author: Jeff LaBundy Date: Sun May 17 17:42:22 2020 -0700 Input: add support for Azoteq IQS269A This patch adds support for the Azoteq IQS269A capacitive touch controller. Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/1588352982-5117-2-git-send-email-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 430ee40d007d5eace32a2e70aab8c54a70f0b3ec Author: Jeff LaBundy Date: Sun May 17 17:42:00 2020 -0700 dt-bindings: input: Add bindings for Azoteq IQS269A This patch adds device tree bindings for the Azoteq IQS269A capacitive touch controller. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1588352982-5117-1-git-send-email-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 310672552f4aea2ad50704711aa3cdd45f5441e9 Author: Jens Axboe Date: Sun May 17 17:43:31 2020 -0600 io_uring: async task poll trigger cleanup If the request is still hashed in io_async_task_func(), then it cannot have been canceled and it's pointless to check. So save that check. Signed-off-by: Jens Axboe commit 23bbd5818e2b0d265aa1835e66f5055f63a8fa4c Author: Kamal Heib Date: Thu May 14 14:47:20 2020 +0300 RDMA/srpt: Fix disabling device management Avoid disabling device management for devices that don't support Management datagrams (MADs) by checking if the "mad_agent" pointer is initialized before calling ib_modify_port, also fix the error flow in srpt_refresh_port() to disable device management if ib_register_mad_agent() fail. Fixes: 09f8a1486dca ("RDMA/srpt: Fix handling of SR-IOV and iWARP ports") Link: https://lore.kernel.org/r/20200514114720.141139-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit daeee976904c0b7326eb4c033df7b28d4b726177 Author: Shay Drory Date: Wed May 13 12:53:04 2020 +0300 RDMA/mlx5: Update mlx5_ib driver name Current description doesn't include new devices, change it by updating to have more generic description and remove DRIVER_NAME and DRIVER_VERSION defines. Link: https://lore.kernel.org/r/20200513095304.210240-1-leon@kernel.org Signed-off-by: Shay Drory Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a8f5c1f1a5c80e5a4bde5eaa1de645d72c562da6 Author: Xiongfeng Wang Date: Mon May 11 15:37:09 2020 +0800 RDMA/srpt: Add a newline when printing parameter 'srpt_service_guid' by sysfs When I cat module parameter 'srpt_service_guid', it displays as follows. It is better to add a newline for easy reading. [root@hulk-202 ~]# cat /sys/module/ib_srpt/parameters/srpt_service_guid 0x0205cdfffe8346b9[root@hulk-202 ~]# Link: https://lore.kernel.org/r/1589182629-27743-1-git-send-email-wangxiongfeng2@huawei.com Signed-off-by: Xiongfeng Wang Signed-off-by: Jason Gunthorpe commit b0810b037de0b62a3c6e3abfc123fe2734335f53 Author: Jason Gunthorpe Date: Wed May 6 11:24:39 2020 +0300 RDMA/core: Consolidate ib_create_srq flows The uverbs layer largely duplicate the code in ib_create_srq(), with the slight difference that it passes in a udata. Move all the code together into ib_create_srq_user() and provide an inline for kernel users, similar to other create calls. Link: https://lore.kernel.org/r/20200506082444.14502-6-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit dbd67252869ba58d086edfa14113e10f8059b97e Author: Yishai Hadas Date: Wed May 6 11:24:42 2020 +0300 RDMA/uverbs: Fix create WQ to use the given user handle Fix create WQ to use the given user handle, in addition dropped some duplicated code from this flow. Fixes: fd3c7904db6e ("IB/core: Change idr objects to use the new schema") Fixes: f213c0527210 ("IB/uverbs: Add WQ support") Link: https://lore.kernel.org/r/20200506082444.14502-9-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b19a530b002fabdd93da62504b9cb0778447e8e2 Author: Yishai Hadas Date: Wed May 6 11:24:38 2020 +0300 RDMA/uverbs: Cleanup wq/srq context usage from uverbs layer Both wq_context and srq_context are some leftover from the past in uverbs layer, they are not really in use, drop them. Link: https://lore.kernel.org/r/20200506082444.14502-5-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f11e0ec55f0c80ff47693af2150bad5db0e20387 Author: Jack Wang Date: Mon May 11 15:51:31 2020 +0200 MAINTAINERS: Add maintainers for RNBD/RTRS modules Danil and I will maintain RNBD/RTRS modules. Link: https://lore.kernel.org/r/20200511135131.27580-26-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit aa4d16e44f607caccaa697fcb29f2c94672f08d5 Author: Jack Wang Date: Mon May 11 15:51:30 2020 +0200 block/rnbd: a bit of documentation README with description of major sysfs entries, sysfs documentation are moved to ABI dir as Bart suggested. Link: https://lore.kernel.org/r/20200511135131.27580-25-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit bc01885342e193e7943d86ccbd7bc3e8fee50a68 Author: Jack Wang Date: Mon May 11 15:51:29 2020 +0200 block/rnbd: include client and server modules into kernel compilation Add rnbd Makefile, Kconfig and also corresponding lines into upper block layer files. Link: https://lore.kernel.org/r/20200511135131.27580-24-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 Author: Jack Wang Date: Mon May 11 15:51:28 2020 +0200 block/rnbd: server: sysfs interface functions This is the sysfs interface to rnbd mapped devices on server side: /sys/class/rnbd-server/ctl/devices// |- block_dev | *** link pointing to the corresponding block device sysfs entry | |- sessions// | *** sessions directory | |- read_only | *** is devices mapped as read only | |- mapping_path *** relative device path provided by the client during mapping Link: https://lore.kernel.org/r/20200511135131.27580-23-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit f0aad9baadb5b2933e6f4fbb2fd3ffbdcc35b2cf Author: Jack Wang Date: Mon May 11 15:51:27 2020 +0200 block/rnbd: server: functionality for IO submitting to block dev This provides helper functions for IO submitting to block dev. Link: https://lore.kernel.org/r/20200511135131.27580-22-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 Author: Jack Wang Date: Mon May 11 15:51:26 2020 +0200 block/rnbd: server: main functionality This is main functionality of rnbd-server module, which handles RTRS events and rnbd protocol requests, like map (open) or unmap (close) device. Also server side is responsible for processing incoming IBTRS IO requests and forward them to local mapped devices. Link: https://lore.kernel.org/r/20200511135131.27580-21-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit d4c6957dd001dc097e8057611093c0731c517d26 Author: Jack Wang Date: Mon May 11 15:51:25 2020 +0200 block/rnbd: server: private header with server structs and functions This header describes main structs and functions used by rnbd-server module, namely structs for managing sessions from different clients and mapped (opened) devices. Link: https://lore.kernel.org/r/20200511135131.27580-20-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit 1eb54f8f5dd8ae09829caa37a50952d931bb79cf Author: Jack Wang Date: Mon May 11 15:51:24 2020 +0200 block/rnbd: client: sysfs interface functions This is the sysfs interface to rnbd block devices on client side: /sys/class/rnbd-client/ctl/ |- map_device | *** maps remote device | |- devices/ *** all mapped devices /sys/block/rnbd/rnbd/ |- unmap_device | *** unmaps device | |- state | *** device state | |- session | *** session name | |- mapping_path *** path of the dev that was mapped on server Link: https://lore.kernel.org/r/20200511135131.27580-19-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit f7a7a5c228d45efc45d6e26a199a3ea13d2f8754 Author: Jack Wang Date: Mon May 11 15:51:23 2020 +0200 block/rnbd: client: main functionality This is main functionality of rnbd-client module, which provides interface to map remote device as local block device /dev/rnbd and feeds RTRS with IO requests. Link: https://lore.kernel.org/r/20200511135131.27580-18-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit 90426e89f54dbb8f77d94604a06d0643dd0c3eb9 Author: Jack Wang Date: Mon May 11 15:51:22 2020 +0200 block/rnbd: client: private header with client structs and functions This header describes main structs and functions used by rnbd-client module, mainly for managing RNBD sessions and mapped block devices, creating and destroying sysfs entries. Link: https://lore.kernel.org/r/20200511135131.27580-17-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit 219ace60770117fbe440904f9156ab2ab8f30e7d Author: Jack Wang Date: Mon May 11 15:51:21 2020 +0200 block/rnbd: private headers with rnbd protocol structs and helpers These are common private headers with rnbd protocol structures, logging, sysfs and other helper functions, which are used on both client and server sides. Link: https://lore.kernel.org/r/20200511135131.27580-16-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Acked-by: Jens Axboe Signed-off-by: Jason Gunthorpe commit 745b6a3d4a673c0b8de6e7c15b0620117614b75b Author: Jack Wang Date: Mon May 11 15:51:20 2020 +0200 RDMA/rtrs: a bit of documentation README with description of major sysfs entries, sysfs documentation has been moved to ABI dir as suggested by Bart. Link: https://lore.kernel.org/r/20200511135131.27580-15-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Cc: linux-kernel@vger.kernel.org Signed-off-by: Jason Gunthorpe commit c013fbc1fd341d28269cf0a6b465925186b9a1e1 Author: Jack Wang Date: Mon May 11 15:51:19 2020 +0200 RDMA/rtrs: include client and server modules into kernel compilation Add rtrs Makefile, Kconfig and also corresponding lines into upper layer infiniband/ulp files. Link: https://lore.kernel.org/r/20200511135131.27580-14-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 91b11610af8d61acd618ab1532cf34a4901fee1e Author: Jack Wang Date: Mon May 11 15:51:18 2020 +0200 RDMA/rtrs: server: sysfs interface functions This is the sysfs interface to rtrs sessions on server side: /sys/class/rtrs-server// *** rtrs session accepted from a client peer | |- paths// *** established paths from a client in a session | |- disconnect | *** disconnect path | |- hca_name | *** HCA name | |- hca_port | *** HCA port | |- stats/ *** current path statistics | |- rdma Link: https://lore.kernel.org/r/20200511135131.27580-13-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit c4f07c60bb021dd76382457e23d72ca078bb6f13 Author: Jack Wang Date: Mon May 11 15:51:17 2020 +0200 RDMA/rtrs: server: statistics functions This introduces set of functions used on server side to account statistics of RDMA data sent/received. Link: https://lore.kernel.org/r/20200511135131.27580-12-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 9cb837480424e78ed585376f944088246685aec3 Author: Jack Wang Date: Mon May 11 15:51:16 2020 +0200 RDMA/rtrs: server: main functionality This is main functionality of rtrs-server module, which accepts set of RDMA connections (so called rtrs session), creates/destroys sysfs entries associated with rtrs session and notifies upper layer (user of RTRS API) about RDMA requests or link events. Link: https://lore.kernel.org/r/20200511135131.27580-11-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 787f78a6b075ac7678123d5d0cac2c57d98c63e1 Author: Jack Wang Date: Mon May 11 15:51:15 2020 +0200 RDMA/rtrs: server: private header with server structs and functions This header describes main structs and functions used by rtrs-server module, mainly for accepting rtrs sessions, creating/destroying sysfs entries, accounting statistics on server side. Link: https://lore.kernel.org/r/20200511135131.27580-10-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 215378b838df0019097a5266ebec1269ebd27f89 Author: Jack Wang Date: Mon May 11 15:51:14 2020 +0200 RDMA/rtrs: client: sysfs interface functions This is the sysfs interface to rtrs sessions on client side: /sys/class/rtrs-client// *** rtrs session created by rtrs_clt_open() API call | |- max_reconnect_attempts | *** number of reconnect attempts for session | |- add_path | *** adds another connection path into rtrs session | |- paths// *** established paths to server in a session | |- disconnect | *** disconnect path | |- reconnect | *** reconnect path | |- remove_path | *** remove current path | |- state | *** retrieve current path state | |- hca_port | *** HCA port number | |- hca_name | *** HCA name | |- stats/ *** current path statistics | |- cpu_migration |- rdma |- reconnects |- reset_all Link: https://lore.kernel.org/r/20200511135131.27580-9-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 89dd4c3bdc46688b1af53298890161d22f7314cb Author: Jack Wang Date: Mon May 11 15:51:13 2020 +0200 RDMA/rtrs: client: statistics functions This introduces set of functions used on client side to account statistics of RDMA data sent/received, amount of IOs inflight, latency, cpu migrations, etc. Almost all statistics are collected using percpu variables. Link: https://lore.kernel.org/r/20200511135131.27580-8-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 6a98d71daea186247005099758af549e6afdd244 Author: Jack Wang Date: Mon May 11 15:51:12 2020 +0200 RDMA/rtrs: client: main functionality This is main functionality of rtrs-client module, which manages set of RDMA connections for each rtrs session, does multipathing, load balancing and failover of RDMA requests. Link: https://lore.kernel.org/r/20200511135131.27580-7-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit cb80329c9434c64493789e7ea5b1f2957021ce61 Author: Jack Wang Date: Mon May 11 15:51:11 2020 +0200 RDMA/rtrs: client: private header with client structs and functions This header describes main structs and functions used by rtrs-client module, mainly for managing rtrs sessions, creating/destroying sysfs entries, accounting statistics on client side. Link: https://lore.kernel.org/r/20200511135131.27580-6-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit c0894b3ea69d35995bd220020b20570c45a1e6b4 Author: Jack Wang Date: Mon May 11 15:51:10 2020 +0200 RDMA/rtrs: core: lib functions shared between client and server modules This is a set of library functions existing as a rtrs-core module, used by client and server modules. Mainly these functions wrap IB and RDMA calls and provide a bit higher abstraction for implementing of RTRS protocol on client or server sides. Link: https://lore.kernel.org/r/20200511135131.27580-5-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 91fddedd439c2463762275693f784abc9d9613e2 Author: Jack Wang Date: Mon May 11 15:51:09 2020 +0200 RDMA/rtrs: private headers with rtrs protocol structs and helpers These are common private headers with rtrs protocol structures, logging, sysfs and other helper functions, which are used on both client and server sides. Link: https://lore.kernel.org/r/20200511135131.27580-4-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit b5c27cdb094ed9cce562e98c931f53669b6409f7 Author: Jack Wang Date: Mon May 11 15:51:08 2020 +0200 RDMA/rtrs: public interface header to establish RDMA connections Introduce public header which provides set of API functions to establish RDMA connections from client to server machine using RTRS protocol, which manages RDMA connections for each session, does multipathing and load balancing. Main functions for client (active) side: rtrs_clt_open() - Creates set of RDMA connections incapsulated in IBTRS session and returns pointer on RTRS session object. rtrs_clt_close() - Closes RDMA connections associated with RTRS session. rtrs_clt_request() - Requests zero-copy RDMA transfer to/from server. Main functions for server (passive) side: rtrs_srv_open() - Starts listening for RTRS clients on specified port and invokes RTRS callbacks for incoming RDMA requests or link events. rtrs_srv_close() - Closes RTRS server context. Link: https://lore.kernel.org/r/20200511135131.27580-3-danil.kipnis@cloud.ionos.com Signed-off-by: Danil Kipnis Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 9ddacff18b159fd9852734f611a6db6100432635 Author: Jack Wang Date: Mon May 11 15:51:07 2020 +0200 sysfs: export sysfs_remove_file_self() Function is going to be used in transport over RDMA module in subsequent patches, so export it to GPL modules. Link: https://lore.kernel.org/r/20200511135131.27580-2-danil.kipnis@cloud.ionos.com Signed-off-by: Roman Pen Acked-by: Tejun Heo Cc: linux-kernel@vger.kernel.org [jwang: extend the commit message] Signed-off-by: Jack Wang Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit eda8ffcc5edf17a5b895aa1c77633dc55955c040 Author: Dan Murphy Date: Tue May 12 14:19:00 2020 -0500 dt-bindings: power: Convert bq27xxx dt to yaml Convert the bq27xxx.txt to yaml format CC: Pali Rohár CC: Andrew F. Davis Signed-off-by: Dan Murphy Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 142cd25293f6a7ecbdff4fb0af17de6438d46433 Author: Al Viro Date: Sun May 17 15:37:50 2020 -0400 sparc64: fix misuses of access_process_vm() in genregs32_[sg]et() We do need access_process_vm() to access the target's reg_window. However, access to caller's memory (storing the result in genregs32_get(), fetching the new values in case of genregs32_set()) should be done by normal uaccess primitives. Fixes: ad4f95764040 ([SPARC64]: Fix user accesses in regset code.) Cc: stable@kernel.org Signed-off-by: Al Viro commit 4908471e1ed767504ccfe3561e3a72c7458b1138 Author: Linus Walleij Date: Sat May 16 23:29:13 2020 +0200 ARM: dts: ux500: Add touchscreen to the Skomer This adds touchscreen support to the Ux500 Samsung GT-S7710 "Skomer" mobile phone. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200516212913.485365-1-linus.walleij@linaro.org commit f2a8d5c7a218b9c24befb756c4eb30aa550ce822 Author: Pavel Begunkov Date: Sun May 17 14:18:06 2020 +0300 io_uring: add tee(2) support Add IORING_OP_TEE implementing tee(2) support. Almost identical to splice bits, but without offsets. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 9dafdfc2f0a3ae551711098de3d7b621a469f11a Author: Pavel Begunkov Date: Sun May 17 14:18:05 2020 +0300 splice: export do_tee() export do_tee() for use in io_uring Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit c11368a57be460de889696f6ff8815fbcacf4db2 Author: Pavel Begunkov Date: Sun May 17 14:13:42 2020 +0300 io_uring: don't repeat valid flag list req->flags stores all sqe->flags. After checking that sqe->flags are valid set if IOSQE* flags, no need to double check it, just forward them all. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 9f13c35b33fddb186beab9ef21c555a01e45f4d7 Author: Pavel Begunkov Date: Sun May 17 14:13:41 2020 +0300 io_uring: rename io_file_put() io_file_put() deals with flushing state's file refs, adding "state" to its name makes it a bit clearer. Also, avoid double check of state->file in __io_file_get() in some cases. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 0cdaf760f42eb8e8a714c1cc017423e5da6d4936 Author: Pavel Begunkov Date: Sun May 17 14:13:40 2020 +0300 io_uring: remove req->needs_fixed_files A submission is "async" IIF it's done by SQPOLL thread. Instead of passing @async flag into io_submit_sqes(), deduce it from ctx->flags. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 3bfa5bcb26f0b52d7ae8416aa0618fff21aceaaf Author: Jens Axboe Date: Sun May 17 13:54:12 2020 -0600 io_uring: cleanup io_poll_remove_one() logic We only need apoll in the one section, do the juggling with the work restoration there. This removes a special case further down as well. No functional changes in this patch. Signed-off-by: Jens Axboe commit 0a2576dae0328f6cb50cef9eee9ba760ddcc4691 Author: John Hubbard Date: Sat May 16 19:08:29 2020 -0700 oradax: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages_fast(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages_fast() + put_page() calls to pin_user_pages_fast() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Cc: David S. Miller Cc: sparclinux@vger.kernel.org Signed-off-by: John Hubbard Signed-off-by: David S. Miller commit dbfe7d74376e187f3c6eaff822e85176bc2cd06e Author: John Hubbard Date: Sat May 16 18:23:36 2020 -0700 rds: convert get_user_pages() --> pin_user_pages() This code was using get_user_pages_fast(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages_fast() + put_page() calls to pin_user_pages_fast() + unpin_user_pages() calls. There is some helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Cc: David S. Miller Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: linux-rdma@vger.kernel.org Cc: rds-devel@oss.oracle.com Signed-off-by: John Hubbard Signed-off-by: David S. Miller commit 9740a7ae6d5208897bf3ef49e8595dc4cfd323ee Merge: eb682677f59e 4930f4831b15 Author: David S. Miller Date: Sun May 17 12:35:35 2020 -0700 Merge branch 'mptcp-do-not-block-on-subflow-socket' Florian Westphal says: ==================== mptcp: do not block on subflow socket This series reworks mptcp_sendmsg logic to avoid blocking on the subflow socket. It does so by removing the wait loop from mptcp_sendmsg_frag helper. In order to do that, it moves prerequisites that are currently handled in mptcp_sendmsg_frag (and cause it to wait until they are met, e.g. frag cache refill) into the callers. The worker can just reschedule in case no subflow socket is ready, since it can't wait -- doing so would block other work items and doesn't make sense anyway because we should not (re)send data in case resources are already low. The sendmsg path can use the existing wait logic until memory becomes available. Because large send requests can result in multiple mptcp_sendmsg_frag calls from mptcp_sendmsg, we may need to restart the socket lookup in case subflow can't accept more data or memory is low. Doing so blocks on the mptcp socket, and existing wait handling releases the msk lock while blocking. Lastly, no need to use GFP_ATOMIC for extension allocation: extend __skb_ext_alloc with gfp_t arg instead of hard-coded ATOMIC and then relax the allocation constraints for mptcp case: those requests occur in process context. ==================== Signed-off-by: David S. Miller commit 4930f4831b1547b52c5968e9307fe3d840d7fba0 Author: Florian Westphal Date: Sat May 16 10:46:23 2020 +0200 net: allow __skb_ext_alloc to sleep mptcp calls this from the transmit side, from process context. Allow a sleeping allocation instead of unconditional GFP_ATOMIC. Acked-by: Paolo Abeni Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 5c8264435d4f6a056ac926989a827aba1961e3c8 Author: Florian Westphal Date: Sat May 16 10:46:22 2020 +0200 mptcp: remove inner wait loop from mptcp_sendmsg_frag previous patches made sure we only call into this function when these prerequisites are met, so no need to wait on the subflow socket anymore. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/7 Acked-by: Paolo Abeni Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 17091708d1e503383f20934631305ccb375b0eb1 Author: Florian Westphal Date: Sat May 16 10:46:21 2020 +0200 mptcp: fill skb page frag cache outside of mptcp_sendmsg_frag The mptcp_sendmsg_frag helper contains a loop that will wait on the subflow sk. It seems preferrable to only wait in mptcp_sendmsg() when blocking io is requested. mptcp_sendmsg already has such a wait loop that is used when no subflow socket is available for transmission. This is another preparation patch that makes sure we call mptcp_sendmsg_frag only if the page frag cache has been refilled. Followup patch will remove the wait loop from mptcp_sendmsg_frag(). The retransmit worker doesn't need to do this refill as it won't transmit new mptcp-level data. Acked-by: Paolo Abeni Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 149f7c71e2c710a8ced836421a631953c9f84aa3 Author: Florian Westphal Date: Sat May 16 10:46:20 2020 +0200 mptcp: fill skb extension cache outside of mptcp_sendmsg_frag The mptcp_sendmsg_frag helper contains a loop that will wait on the subflow sk. It seems preferrable to only wait in mptcp_sendmsg() when blocking io is requested. mptcp_sendmsg already has such a wait loop that is used when no subflow socket is available for transmission. This is a preparation patch that makes sure we call mptcp_sendmsg_frag only if a skb extension has been allocated. Moreover, such allocation currently uses GFP_ATOMIC while it could use sleeping allocation instead. Followup patches will remove the wait loop from mptcp_sendmsg_frag() and will allow to do a sleeping allocation for the extension. Acked-by: Paolo Abeni Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 72511aab95c94d7c0f03d0b7db5df47fdca059f6 Author: Florian Westphal Date: Sat May 16 10:46:19 2020 +0200 mptcp: avoid blocking in tcp_sendpages The transmit loop continues to xmit new data until an error is returned or all data was transmitted. For the blocking i/o case, this means that tcp_sendpages() may block on the subflow until more space becomes available, i.e. we end up sleeping with the mptcp socket lock held. Instead we should check if a different subflow is ready to be used. This restarts the subflow sk lookup when the tx operation succeeded and the tcp subflow can't accept more data or if tcp_sendpages indicates -EAGAIN on a blocking mptcp socket. In that case we also need to set the NOSPACE bit to make sure we get notified once memory becomes available. In case all subflows are busy, the existing logic will wait until a subflow is ready, releasing the mptcp socket lock while doing so. The mptcp worker already sets DONTWAIT, so no need to make changes there. v2: * set NOSPACE bit * add a comment to clarify that mptcp-sk sndbuf limits need to be checked as well. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit fb529e62d3f3e85001108213dc323c35f2765575 Author: Florian Westphal Date: Sat May 16 10:46:18 2020 +0200 mptcp: break and restart in case mptcp sndbuf is full Its not enough to check for available tcp send space. We also hold on to transmitted data for mptcp-level retransmits. Right now we will send more and more data if the peer can ack data at the tcp level fast enough, since that frees up tcp send buffer space. But we also need to check that data was acked and reclaimed at the mptcp level. Therefore add needed check in mptcp_sendmsg, flush tcp data and wait until more mptcp snd space becomes available if we are over the limit. Before we wait for more data, also make sure we start the retransmit timer if we ran out of sndbuf space. Otherwise there is a very small chance that we wait forever: * receiver is waiting for data * sender is blocked because mptcp socket buffer is full * at tcp level, all data was acked * mptcp-level snd_una was not updated, because last ack that acknowledged the last data packet carried an older MPTCP-ack. Restarting the retransmit timer avoids this problem: if TCP subflow is idle, data is retransmitted from the RTX queue. New data will make the peer send a new, updated MPTCP-Ack. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit a0e17064d43e445181bc004d949a4855ea8ccf9c Author: Florian Westphal Date: Sat May 16 10:46:17 2020 +0200 mptcp: move common nospace-pattern to a helper Paolo noticed that ssk_check_wmem() has same pattern, so add/use common helper for both places. Suggested-by: Paolo Abeni Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit eb682677f59e809d8e06c218b565aeb9723a4ad3 Author: David Ahern Date: Sun May 17 12:00:33 2020 -0600 selftests: Drop 'pref medium' in route checks The 'pref medium' attribute was moved in iproute2 to be near the prefix which is where it applies versus after the last nexthop. The nexthop tests were updated to drop the string from route checking, but it crept in again with the compat tests. Fixes: 4dddb5be136a ("selftests: net: add new testcases for nexthop API compat mode sysctl") Signed-off-by: David Ahern Cc: Roopa Prabhu Signed-off-by: David S. Miller commit fac959c93f971f9b6bbc7bad12369cec8c760bd9 Author: Andre Przywara Date: Wed May 13 11:30:07 2020 +0100 arm64: dts: fvp: Fix ITS node names and #msi-cells The GIC ITS nodes in the fastmodel DTS files were not fully binding compliant. Use one of the allowed node names, also add the required #msi-cells property for the older model. Link: https://lore.kernel.org/r/20200513103016.130417-12-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 78631aecc52c4b2adcf611769df2ff9c67ac16d0 Author: Andre Przywara Date: Wed May 13 11:30:06 2020 +0100 arm64: dts: fvp: Fix GIC child nodes The GIC DT nodes for the fastmodels were not fully compliant with the DT binding, which has certain expectations about child nodes and their size and address cells values. Use smaller #address-cells and #size-cells values, as the binding requests, and adjust the reg properties accordingly. This requires adjusting the interrupt nexus nodes as well, as one field of the interrupt-map property depends on the GIC's address-size. Since the .dts files share interrupt nexus nodes across different interrupt controllers (GICv2 vs. GICv3), we need to use the only commonly allowed #address-size value of <1> for both. Link: https://lore.kernel.org/r/20200513103016.130417-11-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit a78aee9e434932a500db36cc6d88daeff3745e9f Author: Andre Przywara Date: Wed May 13 11:30:05 2020 +0100 arm64: dts: juno: Fix GIC child nodes The GIC DT nodes for the Juno boards were not fully compliant with the DT binding, which has certain expectations about child nodes and their size and address cells values. Use smaller #address-cells and #size-cells values, as the binding requests, and adjust the reg properties accordingly. This requires adjusting the interrupt nexus nodes as well, as one field of the interrupt-map property depends on the GIC's address-size. Link: https://lore.kernel.org/r/20200513103016.130417-10-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 336edacfb98cf21964f5bbd7f902477cddc4e44c Author: Andre Przywara Date: Wed May 13 11:30:04 2020 +0100 arm64: dts: fvp: Fix GIC compatible names The GIC DT binding only allows certain combinations of DT compatible strings. The somewhat awkward "arm,cortex-a15-gic", "arm,cortex-a9-gic" is not among those. Drop that combination of different "cortex" based strings used for the models, and replace it with the more useful combination including "arm,gic-400". Link: https://lore.kernel.org/r/20200513103016.130417-9-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 0e529dae514b3ed881ae235b8e20c6adc9e3da9c Author: Andre Przywara Date: Wed May 13 11:30:03 2020 +0100 arm64: dts: juno: Fix mem-timer The Juno's mem-timer DT node was not fully compliant with the DT binding, which has certain expectation about child nodes and their size and address cells values. Use a cell size of 1, as the binding requests, and spell out the ranges property to be binding compliant. Link: https://lore.kernel.org/r/20200513103016.130417-8-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 948204a1bf686ccb6f97d5baf742bab18183c08f Author: Andre Przywara Date: Wed May 13 11:30:02 2020 +0100 arm64: dts: juno: Move fixed devices out of bus node The devicetree compiler complains when DT nodes without a reg property live inside a (simple) bus node: Warning (simple_bus_reg): Node /bus@8000000/v2m_refclk32khz missing or empty reg/ranges property Move the fixed clocks, the fixed regulator, and the gpio keys to the root node, since they do not depend on any busses. Link: https://lore.kernel.org/r/20200513103016.130417-7-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit feebdc3f7950d7e44e914e821f6c04e58e292c74 Author: Andre Przywara Date: Wed May 13 11:30:01 2020 +0100 arm64: dts: fvp: Move fixed clocks out of bus node The devicetree compiler complains when DT nodes without a reg property live inside a (simple) bus node: Warning (simple_bus_reg): Node /bus@8000000/v2m_refclk32khz missing or empty reg/ranges property Move the fixed clocks to the root node, since they do not depend on any busses. Link: https://lore.kernel.org/r/20200513103016.130417-6-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit d9258898ad49cbb46caffe23af0d4f0b766e67a2 Author: Andre Przywara Date: Wed May 13 11:30:00 2020 +0100 arm64: dts: vexpress: Move fixed devices out of bus node The devicetree compiler complains when DT nodes without a reg property live inside a (simple) bus node: Warning (simple_bus_reg): Node /bus@8000000/motherboard-bus/refclk32khz missing or empty reg/ranges property Move the fixed clocks, the fixed regulator, the leds and the config bus subtree to the root node, since they do not depend on any busses. Link: https://lore.kernel.org/r/20200513103016.130417-5-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit b5321c304eb5150f1d37423943205cbd857d69df Author: Lukas Bulwahn Date: Sat Mar 28 14:43:04 2020 +0100 MAINTAINERS: clarify maintenance of ARM Dove drivers Commit 44e259ac909f ("ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets") introduced new drivers for the ARM Dove SOC, but did not add those drivers to the existing entry ARM/Marvell Dove/MV78xx0/Orion SOC support in MAINTAINERS. Hence, these drivers were considered to be part of "THE REST". Clarify now that these drivers are maintained by the ARM/Marvell Dove/MV78xx0/Orion SOC support maintainers. This was identified with a small script that finds all files only belonging to "THE REST" according to the current MAINTAINERS file, and I acted upon its output. Signed-off-by: Lukas Bulwahn Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit c2671acbbbd822ef077cc168991e0a7dbe2172c9 Author: Marek Behún Date: Wed May 6 21:29:16 2020 +0200 arm64: dts: armada-3720-turris-mox: fix SFP binding The sfp compatible should be 'sff,sfp', not 'sff,sfp+'. We used patched kernel where the latter was working. Fixes: 7109d817db2e ("arm64: dts: marvell: add DTS for Turris Mox") Signed-off-by: Marek Behún Cc: Gregory CLEMENT Signed-off-by: Gregory CLEMENT commit 849bfc3dfc13cde6ec04fbcf32af553ded9f7ec3 Author: Andre Przywara Date: Wed May 13 11:29:59 2020 +0100 arm64: dts: fvp: Move fixed devices out of bus node The devicetree compiler complains when DT nodes without a reg property live inside a (simple) bus node: Warning (simple_bus_reg): Node /bus@8000000/motherboard-bus/v2m_refclk32khz missing or empty reg/ranges property Move the fixed clocks, the fixed regulator, and the config bus subtree to the root node, since they do not depend on any busses. Link: https://lore.kernel.org/r/20200513103016.130417-4-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 7a2c36b039d2343cc29fec6102da839477b8dc60 Author: Marek Behún Date: Fri May 1 01:11:44 2020 +0200 arm64: dts: armada-3720-turris-mox: forbid SDR104 on SDIO for FCC purposes Use sdhci-caps-mask to forbid SDR104 mode on the SDIO capable SDHCI controller. Without this the device cannot pass electromagnetic interference certifications. Fixes: 7109d817db2e ("arm64: dts: marvell: add DTS for Turris Mox") Signed-off-by: Marek Behún Cc: Gregory CLEMENT Signed-off-by: Gregory CLEMENT commit bb5cce12ac717c7462217cd493ed701d12d6dbce Author: Andre Przywara Date: Wed May 13 11:29:58 2020 +0100 arm64: dts: fvp/juno: Fix node address fields The Arm Ltd. boards were using an outdated address convention in the DT node names, by separating the high from the low 32-bits of an address by a comma. Remove the comma from the node name suffix to be DT spec compliant. Link: https://lore.kernel.org/r/20200513103016.130417-3-andre.przywara@arm.com Signed-off-by: Andre Przywara Signed-off-by: Sudeep Holla commit 1383d42cffa68c03d886ae846b3e3f6e3bbd784c Author: Brian J. Tarricone Date: Sat Apr 25 12:28:20 2020 -0700 ARM: dts: kirkwood: ReadyNAS NV+v2: Add LCD panel The NV+ v2 has a WH1602 LCD panel (which is just a rebranded HD44780), similar to the Netgear RN104, just with different GPIO assignments. Signed-off-by: Brian J. Tarricone Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 2bf399defde86792b272a617500d891ef234eb4f Author: Pawel Dembicki Date: Wed Apr 22 17:00:06 2020 +0200 ARM: dts: kirkwood: Add Check Point L-50 board This patch adds dts for the Check Point L-50 from 600/1100 series routers. Specification: -CPU: Marvell Kirkwood 88F6821 1200MHz -RAM: 512MB -Flash: NAND 512MB -WiFi: mPCIe card based on Atheros AR9287 b/g/n -WAN: 1 Gigabit Port (Marvell 88E1116R PHY) -LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4)) -USB: 2x USB2.0 -Express card slot -SD card slot -Serial console: RJ-45 115200 8n1 -Unsupported DSL Reviewed-by: Andrew Lunn Signed-off-by: Pawel Dembicki Signed-off-by: Gregory CLEMENT commit c589d6da965e395ce4e6ba47fb382b1c47c50fe3 Author: Baruch Siach Date: Wed Apr 29 07:30:35 2020 +0300 ARM: dts: marvell: drop i2c timeout-ms property The timeout-ms property for i2c master nodes is undocumented, and as never been supported. Drop it. Signed-off-by: Baruch Siach Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 11b2af36cc874027ce701c5784cb957c99c7de3d Author: Russell King Date: Wed May 6 10:40:37 2020 +0100 arm64: dts: add uDPU i2c bus recovery Signed-off-by: Russell King Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 1e6e612853540f157d9cc724befceac0975e3c5e Author: Baruch Siach Date: Wed Apr 29 07:30:36 2020 +0300 arm64: dts: marvell: drop i2c timeout-ms property The timeout-ms property for i2c master nodes is undocumented, and as never been supported. Drop it. Signed-off-by: Baruch Siach Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 1b5a2dd9e266d78d5fddd7e6b116e47ba9577b5e Author: Pali Rohár Date: Thu Apr 30 10:06:25 2020 +0200 arm64: dts: marvell: armada-37xx: Move PCIe max-link-speed property Move the max-link-speed property of the PCIe node from board specific device tree files to the generic armada-37xx.dtsi. Armada 37xx supports only PCIe gen2 speed so max-link-speed property should be in the generic armada-37xx.dtsi file. Signed-off-by: Pali Rohár Tested-by: Tomasz Maciej Nowak Acked-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT commit df749cdb015011e9ed8b60ebb84b4e76a9f35735 Author: Marek Behún Date: Thu Apr 30 10:06:24 2020 +0200 arm64: dts: marvell: armada-37xx: Move PCIe comphy handle property Move the comphy handle property of the PCIe node from board specific device tree files (EspressoBin and Turris Mox) to the generic armada-37xx.dtsi. This is correct since this is the only possible PCIe PHY configuration on Armada 37xx, so when PCIe is enabled on any board, this handle is correct. Signed-off-by: Marek Behún Tested-by: Tomasz Maciej Nowak Acked-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT commit 715878016984b2617f6c1f177c50039e12e7bd5b Author: Marek Behún Date: Thu Apr 30 10:06:23 2020 +0200 arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function We found out that we are unable to control the PERST# signal via the default pin dedicated to be PERST# pin (GPIO2[3] pin) on A3700 SOC when this pin is in EP_PCIE1_Resetn mode. There is a register in the PCIe register space called PERSTN_GPIO_EN (D0088004[3]), but changing the value of this register does not change the pin output when measuring with voltmeter. We do not know if this is a bug in the SOC, or if it works only when PCIe controller is in a certain state. Commit f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready before training link") says that when this pin changes pinctrl mode from EP_PCIE1_Resetn to GPIO, the PERST# signal is asserted for a brief moment. So currently the situation is that on A3700 boards the PERST# signal is asserted in U-Boot (because the code in U-Boot issues reset via this pin via GPIO mode), and then in Linux by the obscure and undocumented mechanism described by the above mentioned commit. We want to issue PERST# signal in a known way, therefore this patch changes the pcie_reset_pin function from "pcie" to "gpio" and adds the reset-gpios property to the PCIe node in device tree files of EspressoBin and Armada 3720 Dev Board (Turris Mox device tree already has this property and uDPU does not have a PCIe port). Signed-off-by: Marek Behún Cc: Remi Pommarel Tested-by: Tomasz Maciej Nowak Acked-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT commit 847c3323d5d1d2c7c61a1257dbec6f0d975e2b61 Author: Russell King Date: Fri Mar 27 12:40:42 2020 +0000 arm64: dts: update SolidRun Armada 8040 phy interface types Update the SolidRun Armada 8040 platforms phy interface types from the old 10gbase-kr to the newer and more correct 10gbase-r. Signed-off-by: Russell King Signed-off-by: Gregory CLEMENT commit f9654d26e11c7e366949427234807372e1e6d0b6 Author: Fugang Duan Date: Wed Apr 29 18:04:14 2020 +0800 arm64: dts: imx8mp: add "fsl,imx6sx-fec" compatible string Add "fsl,imx6sx-fec" compatible string for fec node, then i.MX8MP EVK ethernet function can work now. Signed-off-by: Fugang Duan Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 88a8e278ff0b6b461bf39d4ace17384e976a3f3f Author: Masahiro Yamada Date: Wed Apr 29 12:45:27 2020 +0900 samples: watchdog: use 'userprogs' syntax Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel. Add the entry to samples/Makefile to put this into the build bot coverage. I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit b98ccc7150c7bfce60671ad1928d5f1220446b39 Author: Masahiro Yamada Date: Wed Apr 29 12:45:26 2020 +0900 samples: timers: use 'userprogs' syntax Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel. Add the entry to samples/Makefile to put this into the build bot coverage. I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 87ffbba9a9a1a74da44917a207c7e57dac98f2f8 Author: Masahiro Yamada Date: Wed Apr 29 12:45:25 2020 +0900 samples: auxdisplay: use 'userprogs' syntax Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel. Add the entry to samples/Makefile to put this into the build bot coverage. I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Miguel Ojeda Acked-by: Sam Ravnborg commit c4c10996b1940e197b45f827b99f40a4b82daebb Author: Masahiro Yamada Date: Wed Apr 29 12:45:24 2020 +0900 samples: mei: build sample program for target architecture This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 60fb0b1239719df2ec92606fa037f7c116810762 Author: Masahiro Yamada Date: Wed Apr 29 12:45:23 2020 +0900 samples: pidfd: build sample program for target architecture This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 28949b84b2cb2473507ec2fed06728f995dd7942 Author: Masahiro Yamada Date: Wed Apr 29 12:45:22 2020 +0900 samples: vfs: build sample programs for target architecture These userspace programs include UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample programs should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 37249f5945b77d009519efca9544151ea2a78596 Author: Masahiro Yamada Date: Wed Apr 29 12:45:21 2020 +0900 samples: connector: build sample program for target architecture This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. $(CC) can always compile cn_text.o since it is the kenrel-space code, but building ucon requires libc. I guarded it by: always-$(CONFIG_CC_CAN_LINK) := $(userprogs) Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 82d00a9392ecccc3828656e574bd62354a7259c9 Author: Masahiro Yamada Date: Wed Apr 29 12:45:20 2020 +0900 samples: hidraw: build sample program for target architecture This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 87ecdf4fc9fd98f2a4156716d75c342b5bd35c74 Author: Masahiro Yamada Date: Wed Apr 29 12:45:19 2020 +0900 samples: uhid: build sample program for target architecture This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that. Add the entry to samples/Makefile to put this into the build bot coverage. I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 8a45fe7053a2c33b786706bdcd77d7ccf1531ef7 Author: Sam Ravnborg Date: Wed Apr 29 12:45:18 2020 +0900 samples: uhid: fix warnings in uhid-example Fix warnings seen when building for 32-bit architecture. Use "%xd" for arguments of type size_t to fix the warnings. Signed-off-by: Sam Ravnborg Signed-off-by: Masahiro Yamada commit e079a08c60744af54eed7b7f957d6c87b163f25e Author: Masahiro Yamada Date: Wed Apr 29 12:45:17 2020 +0900 kbuild: doc: document the new syntax 'userprogs' Kbuild now supports the syntax 'userprogs' to compile userspace programs for the same architecture as the kernel. Insert the section '5 Userspace Program support' to explain it. I copy-pasted '4 Host Program support' and fixed it up. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit f59e76687742fc2d6226e0d6449ae09c5942e9fc Author: Masahiro Yamada Date: Wed Apr 29 12:45:16 2020 +0900 samples: seccomp: build sample programs for target architecture These userspace programs include UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample programs should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. The 'ifndef CROSS_COMPILE' is no longer needed. BTW, the -m31 for s390 is left-over code. Commit 5a79859ae0f3 ("s390: remove 31 bit support") killed it. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 8a2cc0505cc4313e6ce2bc8fc1ce3607b410e114 Author: Masahiro Yamada Date: Wed Apr 29 12:45:15 2020 +0900 bpfilter: use 'userprogs' syntax to build bpfilter_umh The user mode helper should be compiled for the same architecture as the kernel. This Makefile reused the 'hostprogs' syntax by overriding HOSTCC with CC. Use the new syntax 'userprogs' to fix the Makefile mess. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 7f3a59db274c3e3d884c785e363a054110f1c266 Author: Masahiro Yamada Date: Wed Apr 29 12:45:14 2020 +0900 kbuild: add infrastructure to build userspace programs Kbuild supports the infrastructure to build host programs, but there was no support to build userspace programs for the target architecture (i.e. the same architecture as the kernel). Sam Ravnborg worked on this in 2014 (https://lkml.org/lkml/2014/7/13/154), but it was not merged. One problem at that time was, there was no good way to know whether $(CC) can link standalone programs. In fact, pre-built kernel.org toolchains [1] are often used for building the kernel, but they do not provide libc. Now, we can handle this cleanly because the compiler capability is evaluated at the Kconfig time. If $(CC) cannot link standalone programs, the relevant options are hidden by 'depends on CC_CAN_LINK'. The implementation just mimics scripts/Makefile.host The userspace programs are compiled with the same flags as the host programs. In addition, it uses -m32 or -m64 if it is found in $(KBUILD_CFLAGS). This new syntax has two usecases. - Sample programs Several userspace programs under samples/ include UAPI headers installed in usr/include. Most of them were previously built for the host architecture just to use the 'hostprogs' syntax. However, 'make headers' always works for the target architecture. This caused the arch mismatch in cross-compiling. To fix this distortion, sample code should be built for the target architecture. - Bpfilter net/bpfilter/Makefile compiles bpfilter_umh as the user mode helper, and embeds it into the kernel. Currently, it overrides HOSTCC with CC to use the 'hostprogs' syntax. This hack should go away. [1]: https://mirrors.edge.kernel.org/pub/tools/crosstool/ Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit b1183b6dca3e0d59ce8fa81767def6ea6188e8ec Author: Masahiro Yamada Date: Sat May 9 16:39:15 2020 +0900 bpfilter: check if $(CC) can link static libc in Kconfig On Fedora, linking static glibc requires the glibc-static RPM package, which is not part of the glibc-devel package. CONFIG_CC_CAN_LINK does not check the capability of static linking, so you can enable CONFIG_BPFILTER_UMH, then fail to build: HOSTLD net/bpfilter/bpfilter_umh /usr/bin/ld: cannot find -lc collect2: error: ld returned 1 exit status Add CONFIG_CC_CAN_LINK_STATIC, and make CONFIG_BPFILTER_UMH depend on it. Reported-by: Valdis Kletnieks Signed-off-by: Masahiro Yamada Acked-by: Alexei Starovoitov commit 9371f86ecb60f6f1f120e3d93fe892bbb70d04c0 Author: Masahiro Yamada Date: Wed Apr 29 12:45:13 2020 +0900 bpfilter: match bit size of bpfilter_umh to that of the kernel bpfilter_umh is built for the default machine bit of the compiler, which may not match to the bit size of the kernel. This happens in the scenario below: You can use biarch GCC that defaults to 64-bit for building the 32-bit kernel. In this case, Kbuild passes -m32 to teach the compiler to produce 32-bit kernel space objects. However, it is missing when building bpfilter_umh. It is built as a 64-bit ELF, and then embedded into the 32-bit kernel. The 32-bit kernel and 64-bit umh is a bad combination. In theory, we can have 32-bit umh running on 64-bit kernel, but we do not have a good reason to support such a usecase. The best is to match the bit size between them. Pass -m32 or -m64 to the umh build command if it is found in $(KBUILD_CFLAGS). Evaluate CC_CAN_LINK against the kernel bit-size. Signed-off-by: Masahiro Yamada commit 59721d4eb7f66f27440ad74f875b97e64133ee3b Author: Masahiro Yamada Date: Tue Apr 28 01:03:57 2020 +0900 kbuild: warn if always, hostprogs-y, or hostprogs-m is used always, hostprogs-y, and hostprogs-m are deprecated. There is no user in upstream code, but I will keep them for external modules. I want to remove them entirely someday. Prompt downstream users for the migration. Signed-off-by: Masahiro Yamada commit 926ba4cce10ee08512bf298d92c236955fc0994e Author: Oded Gabbay Date: Tue Mar 31 11:57:11 2020 +0300 habanalabs: handle barriers in DMA QMAN streams When we have DMA QMAN with multiple streams, we need to know whether the command buffer contains at least one DMA packet in order to configure the barriers correctly when adding the 2xMSG_PROT at the end of the JOB. If there is no DMA packet, then there is no need to put engine barrier. This is relevant only for GAUDI as GOYA doesn't have streams so the engine can't be busy by another stream. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit cb056b9fd5138748dca7b679ea5f16b6bd24fb6c Author: Oded Gabbay Date: Sun Mar 29 13:18:30 2020 +0300 habanalabs: retrieve DMA mask indication from firmware Retrieve from the firmware the DMA mask value we need to set according to the device's PCI controller configuration. This is needed when working on POWER9 machines, as the device's PCI controller is configured in a different way in those machines. Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit c8aee597bbe2eb7458376cc1116ea4e5a3537764 Author: Oded Gabbay Date: Sat Mar 28 12:00:07 2020 +0300 habanalabs: update firmware definitions Add comments for the various errors and states of the firmware during boot. Add a mapping of a new register that will tell the driver whether the firmware executed the request from the driver or if it has encountered an error. Add a new enum for the possible values of this register. Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay commit 7a65ee046b2238e053f6ebb610e1a082cfc49490 Author: Oded Gabbay Date: Fri Mar 27 16:38:37 2020 +0300 habanalabs: increase timeout during reset When doing training, the DL framework (e.g. tensorflow) performs hundreds of thousands of memory allocations and mappings. In case the driver needs to perform hard-reset during training, the driver kills the application and unmaps all those memory allocations. Unfortunately, because of that large amount of mappings, the driver isn't able to do that in the current timeout (5 seconds). Therefore, increase the timeout significantly to 30 seconds to avoid situation where the driver resets the device with active mappings, which sometime can cause a kernel bug. BTW, it doesn't mean we will spend all the 30 seconds because the reset thread checks every one second if the unmap operation is done. Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay commit 49aba0bbab20a581dc3e32a6ee636c07a542eb9e Author: Oded Gabbay Date: Fri Mar 27 16:32:33 2020 +0300 habanalabs: print warning when reset is requested When the system administrator asks the driver to soft or hard reset the device through sysfs, the driver should display a warning in the kernel log to explain why it suddenly resets the device. Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay commit 7e1c07dd35250971cd29c60c786ac676179eb7f9 Author: Oded Gabbay Date: Thu Mar 26 12:32:56 2020 +0200 habanalabs: unify and improve device cpu init Move the code of device CPU initialization from being ASIC-Dependent to common code. In addition, add support for the new error reporting feature of the firmware boot code. Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay commit 1fa185c6560cd15c1bf8840e7d157a29429279eb Author: Omer Shpigelman Date: Sun Mar 1 19:59:39 2020 +0200 habanalabs: re-factor H/W queues initialization We want to remove the following restrictions/assumptions in our driver: 1. The H/W queue index is also the completion queue index. 2. The H/W queue index is also the IRQ number of the completion queue. 3. All queues of the same type have consecutive indexes. Therefore we add the support for H/W queues of the same type with nonconsecutive indexes and completion queue index and IRQ number different than the H/W queue index. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 76cedc739d7aac461ae303ca0e8b3a81e6ae00aa Author: Omer Shpigelman Date: Sun Mar 22 21:12:51 2020 +0200 habanalabs: remove stop-on-error flag from DMA Stop-on-error mode in DMA is useful as it stops the transaction immediately upon error e.g. page fault. But it may cause the next command submission to fail as is leaves the DMA in unstable state. Therefore we remove the stop-on-error configuration from the DMA. Stop-on-err is still available for debug. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3ec499c967ae507c184c2e0955360d139fc9f23d Author: Oded Gabbay Date: Tue Mar 24 10:45:58 2020 +0200 habanalabs: don't wait for ASIC CPU after reset Upon reset of the ASIC, the driver would have waited for the CPU to come out of reset before finishing the reset process. This was done for the purpose of making the CPU available to answer FLR requests. However, when a VM shuts down, the driver isn't removed so a reset never happens. Therefore, remove this waiting period as we don't need it. Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay commit 2971317ab04a38e34be5f4d62a65000b63857686 Author: Guoyun Sun Date: Wed Apr 29 16:44:32 2020 +0800 mips/mm: Add page soft dirty tracking User space checkpoint and restart tool (CRIU) needs the page's change to be soft tracked. This allows to do a pre checkpoint and then dump only touched pages. Signed-off-by: Guoyun Sun Signed-off-by: Thomas Bogendoerfer commit ac44d672787f7f61880114953654e22936c9b008 Author: WANG Xuerui Date: Sun May 3 18:33:04 2020 +0800 MIPS: define more Loongson CP0.Config6 and CP0.Diag feature bits These are exposed to userland alternatively via the new CPUCFG instruction on Loongson-3A R4 and above. Add definitions for readback on older cores. Signed-off-by: WANG Xuerui Cc: Huacai Chen Cc: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit fdec207e466d57e658ca18755ff990a18e85d5ae Author: WANG Xuerui Date: Sun May 3 18:33:03 2020 +0800 MIPS: Loongson64: define offsets and known revisions for some CPUCFG features Add the constants for easier and maintainable composition of CPUCFG values. Signed-off-by: WANG Xuerui Cc: Huacai Chen Cc: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit de541d60157a1716c0e2f04971fd2dd97ade7b7e Author: WANG Xuerui Date: Sun May 3 18:33:02 2020 +0800 MIPS: Loongson64: fix typos in loongson_regs.h Fix some symbol names to align with Loongson's User Manual wording. Also correct the comment in csr_readq() suggesting the wrong instruction in use. Fixes: 6a6f9b7dafd50efc ("MIPS: Loongson: Add CFUCFG&CSR support") Signed-off-by: WANG Xuerui Cc: Huacai Chen Cc: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit d9a51fd594d8034be49060dd8438f6315754cc8e Author: Tiezhu Yang Date: Sat May 16 10:15:49 2020 +0800 MIPS: Remove not used 8250-platform.c When CONFIG_HAVE_STD_PC_SERIAL_PORT is set, there exists build errors of 8250-platform.c due to linux/module.h is not included. CONFIG_HAVE_STD_PC_SERIAL_PORT is not used in arch/mips for many years, 8250-platform.c is also not built and used, so it is not necessary to fix the build errors, just remove the not used file 8250-platform.c and the related code in Kconfig and Makefile. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit a44de7497f91834df0b8b6d459e259788ba66794 Author: Tiezhu Yang Date: Sat May 16 10:15:48 2020 +0800 MIPS: Loongson: Build ATI Radeon GPU driver as module When ATI Radeon GPU driver has been compiled directly into the kernel instead of as a module, we should make sure the firmware for the model (check available ones in /lib/firmware/radeon) is built-in to the kernel as well, otherwise there exists the following fatal error during GPU init, change CONFIG_DRM_RADEON=y to CONFIG_DRM_RADEON=m to fix it. [ 1.900997] [drm] Loading RS780 Microcode [ 1.905077] radeon 0000:01:05.0: Direct firmware load for radeon/RS780_pfp.bin failed with error -2 [ 1.914140] r600_cp: Failed to load firmware "radeon/RS780_pfp.bin" [ 1.920405] [drm:r600_init] *ERROR* Failed to load firmware! [ 1.926069] radeon 0000:01:05.0: Fatal error during GPU init [ 1.931729] [drm] radeon: finishing device. Fixes: 024e6a8b5bb1 ("MIPS: Loongson: Add a Loongson-3 default config file") Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 2f6ca9570d317d2934dc53b4847c4b5ca119ed11 Merge: d53b1162d72a 195ef57f8700 Author: David S. Miller Date: Sat May 16 16:47:19 2020 -0700 Merge branch 'net-ipa-sc7180-suspend-resume' Alex Elder says: ==================== net: ipa: sc7180 suspend/resume This series permits suspend/resume to work for the IPA driver on the Qualcomm SC7180 SoC. The IPA version on this SoC requires interrupts to be enabled when the suspend and resume callbacks are made, and the first patch moves away from using the noirq variants. The second patch fixes a problem with resume that occurs because pending interrupts were being cleared before starting a channel. ==================== Signed-off-by: David S. Miller commit 195ef57f870070cb02f2f3b99a63d69e8e8f798e Author: Alex Elder Date: Fri May 15 15:07:31 2020 -0500 net: ipa: do not clear interrupt in gsi_channel_start() In gsi_channel_start() there is harmless-looking comment "Clear the channel's event ring interrupt in case it's pending". The intent was to avoid getting spurious interrupts when first bringing up a channel. However we now use channel stop/start to implement suspend and resume, and an interrupt pending at the time we resume is actually something we don't want to ignore. The very first time we bring up the channel we do not expect an interrupt to be pending, and even if it were, the effect would simply be to schedule NAPI on that channel, which would find nothing to do, which is not a problem. Stop clearing any pending IEOB interrupt in gsi_channel_start(). That leaves one caller of the trivial function gsi_isr_ieob_clear(). Get rid of that function and just open-code it in gsi_isr_ieob() instead. This fixes a problem where suspend/resume IPA v4.2 would get stuck when resuming after a suspend. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a4f48458ca1c02eeedf914ef6a892e047d6b65cc Author: Alex Elder Date: Fri May 15 15:07:30 2020 -0500 net: ipa: don't use noirq suspend/resume callbacks Use the suspend and resume callbacks rather than suspend_noirq and resume_noirq. With IPA v4.2, we use the CHANNEL_STOP command to implement a suspend, and without interrupts enabled, that command won't complete. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit d53b1162d72a24c8bd2b03116d83070b4e770eaa Merge: 13f15b59ad70 04cc99d9bdb1 Author: David S. Miller Date: Sat May 16 16:42:32 2020 -0700 Merge branch 'mlxsw-Reorganize-trap-data' Ido Schimmel says: ==================== mlxsw: Reorganize trap data This patch set does not include any functional changes. It merely reworks the internal storage of traps, trap groups and trap policers in mlxsw to each use a single array. These changes allow us to get rid of the multiple arrays we currently have for traps, which make the trap data easier to validate and extend with more per-trap information in the future. It will also allow us to more easily add per-ASIC traps in future submissions. Last two patches include minor changes to devlink-trap selftests. Tested with existing devlink-trap selftests. ==================== Signed-off-by: David S. Miller commit 04cc99d9bdb1119172e21c121950a0253f5c659f Author: Ido Schimmel Date: Sun May 17 01:43:10 2020 +0300 selftests: mlxsw: Do not hard code trap group name It can be derived dynamically from the trap's name, so drop it. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 84e0d83567df4597b1b624b495d689104227a551 Author: Ido Schimmel Date: Sun May 17 01:43:09 2020 +0300 selftests: devlink_lib: Remove double blank line One blank line is enough. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 200b7cca0ba170d8a7e1bd228f0fb1f885de02c0 Author: Ido Schimmel Date: Sun May 17 01:43:08 2020 +0300 mlxsw: spectrum_trap: Store all trap data in one array Each trap registered with devlink is mapped to one or more Rx listeners. These listeners allow the switch driver (e.g., mlxsw_spectrum) to register a function that is called when a packet is received (trapped) for a specific reason. Currently, three arrays are used to describe the mapping between the logical devlink traps and the Rx listeners. Instead, get rid of these arrays and store all the information in one array that is easier to validate and extend with more per-trap information. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit b14a40dbdea5d0c4decc463dfd2b5dd8e4b11e46 Author: Ido Schimmel Date: Sun May 17 01:43:07 2020 +0300 mlxsw: spectrum_trap: Store all trap group data in one array Use one array to store all the information about all the trap groups instead of hard coding it in code. This will be used in future patches to disable certain functionality (e.g., policer binding) on a trap group basis. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit cc678f4dbc576f75e0465b21a18f8460858b07b7 Author: Ido Schimmel Date: Sun May 17 01:43:06 2020 +0300 mlxsw: spectrum_trap: Store all trap policer data in one array Instead of maintaining an array of policers and a linked list, only maintain an array. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 85d4ec592510520a2beb11c7f35748fd09ffe089 Author: Ido Schimmel Date: Sun May 17 01:43:05 2020 +0300 mlxsw: spectrum_trap: Move struct definition out of header file 'struct mlxsw_sp_trap_policer_item' is only used in one file, so move it there. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 13f15b59ad70549545272cc8f0bf4d68a8ef9c14 Author: Heiner Kallweit Date: Sun May 17 00:05:08 2020 +0200 r8169: remove remaining call to mdiobus_unregister After having switched to devm_mdiobus_register() also this remaining call to mdiobus_unregister() can be removed. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 1ab9b5eabbab5427d4b36ab70816358c790bb192 Merge: a0c1d0eafd1e 75c36dbb1c37 Author: David S. Miller Date: Sat May 16 13:56:30 2020 -0700 Merge branch 'ethtool-set_channels-add-a-few-more-checks' Jakub Kicinski says: ==================== ethtool: set_channels: add a few more checks There seems to be a few more things we can check in the core before we call drivers' ethtool_ops->set_channels. Adding the checks to the core simplifies the drivers. This set only includes changes to the NFP driver as an example. There is a small risk in the first patch that someone actually purposefully accepts a strange configuration without RX or TX channels, but I couldn't find such a driver in the tree. ==================== Signed-off-by: David S. Miller commit 75c36dbb1c3790eab909344b758decce6bb432da Author: Jakub Kicinski Date: Fri May 15 12:49:02 2020 -0700 ethtool: don't call set_channels in drivers if config didn't change Don't call drivers if nothing changed. Netlink code already contains this logic. Signed-off-by: Jakub Kicinski Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit 4df6ff2a99920254ce8c2a3c418ddabc69ff16fe Author: Jakub Kicinski Date: Fri May 15 12:49:01 2020 -0700 nfp: don't check lack of RX/TX channels Core will now perform this check. Signed-off-by: Jakub Kicinski Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit 7be92514b99c15b89def6d72bbc84c354f89a025 Author: Jakub Kicinski Date: Fri May 15 12:49:00 2020 -0700 ethtool: check if there is at least one channel for TX/RX in the core Having a channel config with no ability to RX or TX traffic is clearly wrong. Check for this in the core so the drivers don't have to. Signed-off-by: Jakub Kicinski Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit a0c1d0eafd1ef1ada3b588ea205e5bc37ae0d8d9 Author: Christoph Paasch Date: Thu May 14 08:53:03 2020 -0700 mptcp: Use 32-bit DATA_ACK when possible RFC8684 allows to send 32-bit DATA_ACKs as long as the peer is not sending 64-bit data-sequence numbers. The 64-bit DSN is only there for extreme scenarios when a very high throughput subflow is combined with a long-RTT subflow such that the high-throughput subflow wraps around the 32-bit sequence number space within an RTT of the high-RTT subflow. It is thus a rare scenario and we should try to use the 32-bit DATA_ACK instead as long as possible. It allows to reduce the TCP-option overhead by 4 bytes, thus makes space for an additional SACK-block. It also makes tcpdumps much easier to read when the DSN and DATA_ACK are both either 32 or 64-bit. Signed-off-by: Christoph Paasch Reviewed-by: Matthieu Baerts Signed-off-by: David S. Miller commit 9efd6a3cecdde984d67e63d17fe6af53c7c50968 Author: Nicolas Dichtel Date: Wed May 13 15:58:43 2020 +0200 netns: enable to inherit devconf from current netns The goal is to be able to inherit the initial devconf parameters from the current netns, ie the netns where this new netns has been created. This is useful in a containers environment where /proc/sys is read only. For example, if a pod is created with specifics devconf parameters and has the capability to create netns, the user expects to get the same parameters than his 'init_net', which is not the real init_net in this case. Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller commit 74a1c059168ba1388aa475847c05a02f5f971a46 Author: Ioana Ciornei Date: Wed May 13 16:55:46 2020 +0300 dpaa2-eth: add bulking to XDP_TX Add driver level bulking to the XDP_TX action. An array of frame descriptors is held for each Tx frame queue and populated accordingly when the action returned by the XDP program is XDP_TX. The frames will be actually enqueued only when the array is filled. At the end of the NAPI cycle a flush on the queued frames is performed in order to enqueue the remaining FDs. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 6f42a29305659ca6491b45939d663a0de7f197b7 Author: Kevin Lo Date: Sat May 16 10:09:26 2020 +0800 net: phy: broadcom: fix checkpatch complains about tabs This patch makes checkpatch happy for tabs Signed-off-by: Kevin Lo Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 870c153cf0e6df1b8b5226af41b19945e8e0d143 Author: Jan Kara Date: Wed May 13 18:02:23 2020 +0200 blktrace: Report pid with note messages Currently informational messages within block trace do not have PID information of the process reporting the message included. With BFQ it is sometimes useful to have the information and there's no good reason to omit the information from the trace. So just fill in pid information when generating note message. Signed-off-by: Jan Kara Reviewed-by: Chaitanya Kulkarni Acked-by: Paolo Valente Signed-off-by: Jens Axboe commit c65165651d595fd77c38a9a25c14ade14444bc13 Author: Xu Wang Date: Thu May 7 15:12:11 2020 +0800 block/swim3: use set_current_state macro Use set_current_state macro instead of current->state = TASK_RUNNING. Signed-off-by: Xu Wang Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 2771cefeac499d68ca2fca3861ba9e46d15bd4ae Author: Christoph Hellwig Date: Mon May 4 18:10:05 2020 +0200 block: remove the REQ_NOWAIT_INLINE flag Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 189881af810d452b592ee958db43eb4c57df9803 Author: Min Guo Date: Wed Dec 11 09:54:42 2019 +0800 arm: dts: mt2701: Add usb2 device nodes Add musb nodes and usb2 phy nodes for MT2701 Signed-off-by: Min Guo Link: https://lore.kernel.org/r/20191211015446.11477-3-min.guo@mediatek.com Signed-off-by: Matthias Brugger commit 795240b52ec9bfe4f6dbac480bcc812fde43f4d7 Author: Sean Wang Date: Wed Jul 24 17:01:00 2019 +0800 dt-bindings: gpu: mali-utgard: add mediatek, mt7623-mali compatible The MediaTek MT7623 SoC contains a Mali-450, so add a compatible for it and define its own vendor-specific properties. Signed-off-by: Sean Wang Signed-off-by: Ryder Lee Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/efeadefe3895bcadf1d2e9847b82206dd8c7ec35.1563867856.git.ryder.lee@mediatek.com [mb: move to yaml file] Signed-off-by: Matthias Brugger commit 1f6ed224594653556adbd8392e03ef0e168c1d48 Author: Ryder Lee Date: Wed Jul 24 17:00:59 2019 +0800 arm: dts: mt7623: add Mali-450 device node Add a node for Mali-450. Signed-off-by: Sean Wang Signed-off-by: Ryder Lee Link: https://lore.kernel.org/r/af7b5a2e00eb3a4b6262807c378e43afd5f74779.1563867856.git.ryder.lee@mediatek.com Signed-off-by: Matthias Brugger commit 96144d43fd01cddfcbb9851e911c9c3124c53dc6 Author: Alexandru Ardelean Date: Mon May 11 15:53:22 2020 +0300 iio: buffer: remove attrcount_orig var from sysfs creation The variable no longer does anything. It should have been removed with commit 2e036804d773e ("iio: buffer: remove 'scan_el_attrs' attribute group from buffer struct"). That was about the last time this was needed. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 8712b3098b3d0397fc712382b5462fad3ca8dd0b Author: Matt Ranostay Date: Mon May 11 05:32:14 2020 +0300 iio: chemical: add atlas-ezo-sensor initial support Add driver for Atlas EZO line of sensors with initial support for CO2 the sensor. This is effectively ASCII strings proxied over I2C due to these series of sensors being by default UART. Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron commit 92ca6bca609e44afbc2f381701ac4846c5531fa9 Author: Matt Ranostay Date: Mon May 11 05:32:13 2020 +0300 dt-bindings: iio: chemical: add CO2 EZO module documentation Cc: devicetree@vger.kernel.org Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron commit 786b44a3b57565085bf02e204e593d2afe88bdb4 Author: Krzysztof Kozlowski Date: Mon May 11 10:33:48 2020 +0200 iio: adc: exynos: Simplify Exynos7-specific init The Exynos7-specific code bits in ADC driver do not play with PHY: the field exynos_adc_data.needs_adc_phy is not set in exynos7_adc_data instance. Therefore the initialization code does not have to check if it is true. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar Signed-off-by: Jonathan Cameron commit f0e5405b9ebf084c34c41f5d38a0013bee166f4d Author: Ulrich Hecht Date: Fri Jul 19 11:50:16 2019 +0200 arm64: dts: mt8173: Add capacity-dmips-mhz attributes Dhrystone benchmark on Acer Chromebook R13 CB5-312T: A72: 15698587 dps @ 1807 MHz A53: 7598784 dps @ 1703 MHz Signed-off-by: Ulrich Hecht Link: https://lore.kernel.org/r/1563529816-3992-1-git-send-email-uli@fpond.eu Signed-off-by: Matthias Brugger commit 754718a5b43c851546c3bb70e8d41bf81cb42b30 Author: Jonathan Bakker Date: Fri May 8 14:14:00 2020 -0700 iio: adc: Add scaling support to exynos adc driver Currently the driver only exposes the raw counts. As we have the regulator voltage and the maximum value (stored in the data mask), we can trivially produce a scaling fraction of voltage / max value. This assumes that the regulator voltage is in fact the max voltage, which appears to be the case for all mainline dts and cross referenced with the public Exynos4412 and S5PV210 datasheets. Signed-off-by: Jonathan Bakker Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jonathan Cameron commit 5cb1a5481cc3a1101457abd6abffc9b168bc7bb4 Author: Lars-Peter Clausen Date: Thu Apr 30 11:24:55 2020 +0300 iio: __iio_update_buffers: Update mode before preenable/after postdisable It is clear that we transition to INDIO_DIRECT_MODE when disabling the buffer(s) and it is also clear that we transition from INDIO_DIRECT_MODE when enabling the buffer(s). So leaving the currentmode field INDIO_DIRECT_MODE until after the preenable() callback and updating it to INDIO_DIRECT_MODE before the postdisable() callback doesn't add additional value. On the other hand some drivers will need to perform different actions depending on which mode the device is going to operate in/was operating in. Moving the update of currentmode before preenable() and after postdisable() enables us to have drivers which perform mode dependent actions in those callbacks. Note, was originally not intended as such, but fixes an issue introduced in the at91-sama5d2 adc driver. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Fixes: 065056cb0d0a ("iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helper") Tested-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit 3adb82ebd9bb1c6c7985eb6fdaeede35c619b269 Author: Sergiu Cuciurean Date: Thu May 14 11:58:15 2020 +0300 iio: dac: vf610_dac: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit f0210518aa7cd4dae8a4908609af45911f4e4abc Author: Chunfeng Yun Date: Tue Feb 11 11:21:16 2020 +0800 arm64: dts: mt2712: use non-empty ranges for usb-phy Use non-empty ranges for usb-phy to make the layout of its registers clearer; Replace deprecated compatible by generic Signed-off-by: Chunfeng Yun Signed-off-by: Matthias Brugger commit 0b2884ef7fcad881556b79828a96f359c7f1fab6 Author: Sergiu Cuciurean Date: Thu May 14 12:19:38 2020 +0300 iio: dac: ad5686: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit 9bc17892d60be3c3942f9da04b3e70b6900655cb Author: Sergiu Cuciurean Date: Thu May 14 12:17:53 2020 +0300 iio: dac: ad5421: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit fa444a186f63f52055a6ad7daafb8490a3d925f0 Author: Sergiu Cuciurean Date: Thu May 14 12:13:11 2020 +0300 iio: dac: ad5380: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit fdd41663e660bd9055448376636e7babdcf19081 Author: Sergiu Cuciurean Date: Thu May 14 12:12:12 2020 +0300 iio: dac: ad5764: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit 19710bffe4bc00bb1640e32c0f6d0408cbf566f7 Author: Sergiu Cuciurean Date: Thu May 14 12:10:28 2020 +0300 iio: dac: ad5761: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit a49e961c7c0aecd2cffaf686e2d91b510c0d8405 Author: Sergiu Cuciurean Date: Thu May 14 12:06:05 2020 +0300 iio: dac: ad5755: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This also changes some internal functions to pass the pointer to the state-struct vs a ref to indio_dev just to access the state-struct again. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit b0ffd3b6d239320124e1d9c584fa25bcefcbbbce Author: Sergiu Cuciurean Date: Thu May 14 12:01:49 2020 +0300 iio: dac: ad5449: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit 0b4b5925bf16c83c40c4a71e78921d60db840dc2 Author: Sergiu Cuciurean Date: Thu May 14 12:00:42 2020 +0300 iio: dac: ad5446: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit 2bbf7c6b705ca30c08453d198adaf43a105ce37c Author: Sergiu Cuciurean Date: Thu May 14 11:39:19 2020 +0300 iio: dac: ad5360: Replace indio_dev->mlock with own device lock As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This also changes some internal functions to pass the pointer to the state-struct vs a ref to indio_dev just to access the state-struct again. Signed-off-by: Sergiu Cuciurean Signed-off-by: Jonathan Cameron commit fff12573170e20863171f5a7c25df4e8804e97ab Author: Hsin-Yi Wang Date: Tue Apr 14 11:08:14 2020 +0800 arm64: dts: mt8173: fix mdp aliases property name Fix warning: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-' Signed-off-by: Hsin-Yi Wang Reviewed-by: Chun-Kuang Hu Link: https://lore.kernel.org/r/20200414030815.192104-1-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 6198bdb48922c03348724d1a4d528d34c548abaa Author: Jonathan Bakker Date: Thu May 14 13:49:01 2020 -0700 iio: accel: Add bma150/smb380 support to bma180 The bma150/smb380 are very similar to the bma023 but have a temperature channel as well. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 35328fb52b4d45cd294da4fde05a0ffe94103da6 Author: Jonathan Bakker Date: Thu May 14 13:49:00 2020 -0700 iio: accel: bma180: Rename center_temp to temp_offset The bma180 driver is being extended to support the bma150. Its temperature channel is unsigned so the center_temp naming no longer makes. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 891a00ec30b578c43c18ec11755c4ab5399d4ebc Author: Jonathan Bakker Date: Thu May 14 13:48:59 2020 -0700 iio: accel: bma180: Add support for bma023 The bma023 chip is similar enough to the bma180 and bma25x that the same driver can support all of them. The biggest differences are the lack of a temperature channel and no low power but still working mode. The bma150 is a close relative of the bma023, but it does have a temperature channel so support is not added for it. Reviewed-by: Linus Walleij Signed-off-by: Jonathan Bakker Signed-off-by: Jonathan Cameron commit 1b118385dec253c93a506c15e32b06fa035a52b2 Author: Manivannan Sadhasivam Date: Sat Feb 22 21:54:44 2020 +0530 arm64: dts: mediatek: Switch to SPDX license identifier for MT6797 SoC Switch to SPDX license identifier for MT6797 SoC. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200222162444.11590-5-manivannan.sadhasivam@linaro.org Signed-off-by: Matthias Brugger commit 1f3f87305ed6ae5fcf5f638fa1c3846e07c32829 Author: Manivannan Sadhasivam Date: Sat Feb 22 21:54:43 2020 +0530 arm64: dts: mediatek: Enable I2C support for 96Boards X20 Development board There are 7 I2C ports used on this board. Hence, enable all of them. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200222162444.11590-4-manivannan.sadhasivam@linaro.org Signed-off-by: Matthias Brugger commit d3c84299f2088e3927bcbe36a458744a3b804d6d Author: Manivannan Sadhasivam Date: Sat Feb 22 21:54:42 2020 +0530 arm64: dts: mediatek: Add I2C support for MT6797 SoC Add I2C support for Mediatek MT6797 SoC. There are a total of 8 I2C controllers in this SoC (2 being shared) and they are same as the controllers present in MT6577 SoC. Hence, the driver support is added with DT fallback method. As per the datasheet, there are controllers with _imm prefix like i2c2_imm and i2c3_imm. These appears to be in different memory regions but sharing the same pins with i2c2 and i2c3 respectively. Since there is no clear evidence of what they really are, I've adapted the numbering/naming scheme from the downstream code by Mediatek. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200222162444.11590-3-manivannan.sadhasivam@linaro.org Signed-off-by: Matthias Brugger commit b25376126484c0cc6de302559cc7e3760b7838c0 Author: Manivannan Sadhasivam Date: Sat Feb 22 21:54:41 2020 +0530 dt-bindings: i2c: Document I2C controller binding for MT6797 SoC I2C controller driver for MT6577 SoC is reused for MT6797 SoC. Hence, document that in DT binding. Signed-off-by: Manivannan Sadhasivam Acked-by: Rob Herring Acked-by: Wolfram Sang Link: https://lore.kernel.org/r/20200222162444.11590-2-manivannan.sadhasivam@linaro.org Signed-off-by: Matthias Brugger commit 8e2c7c6555f5fb09b3ed151c2be91ad4feadb046 Author: Jonathan Bakker Date: Thu May 14 13:48:58 2020 -0700 dt-bindings: iio: accel: Add required regulators to bma180 The bma180 and related chips should have two regulators attached to them. The IIO driver currently uses them, document them here as well. Acked-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Jonathan Bakker Signed-off-by: Jonathan Cameron commit ae23317afa767c21018cab93fd48dcfb29a66230 Author: Jonathan Bakker Date: Thu May 14 13:48:57 2020 -0700 dt-bindings: iio: accel: Add bma150 family compatibles to bma180 The bma023, bma150, and smb380 are in the same family as the bma180 and support is being added to the bma180 IIO driver for them. Reviewed-by: Linus Walleij Signed-off-by: Jonathan Bakker Signed-off-by: Jonathan Cameron commit a5e633eb79c4c9c03d5326149451829eeaaa06b4 Author: Jonathan Bakker Date: Thu May 14 13:48:56 2020 -0700 iio: accel: Make bma180 conflict with input's bma150 The bma180 IIO driver is being extended for support for the chips support by input's bma150 driver (bma023, bma150, smb380). Don't allow both drivers to be enabled simultaneously as they're for the same hardware. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron commit f9992af62fbf3a50d89d1f3914b2ff5cda187466 Author: Jonathan Bakker Date: Thu May 14 13:48:55 2020 -0700 iio: accel: bma180: Prepare for different reset values Some variants of the bma180 (eg bma023) have different reset values. In preparation for adding support for them, factor out the reset value into the chip specific data. Reviewed-by: Linus Walleij Signed-off-by: Jonathan Bakker Signed-off-by: Jonathan Cameron commit 5107000faa6e8c2b0ff7a91a6d1f010f84596cd2 Author: Marc Zyngier Date: Mon Apr 27 15:15:07 2020 +0100 KVM: arm64: Make KVM_CAP_MAX_VCPUS compatible with the selected GIC version KVM_CAP_MAX_VCPUS always return the maximum possible number of VCPUs, irrespective of the selected interrupt controller. This is pretty misleading for userspace that selects a GICv2 on a GICv3 system that supports v2 compat: It always gets a maximum of 512 VCPUs, even if the effective limit is 8. The 9th VCPU will fail to be created, which is unexpected as far as userspace is concerned. Fortunately, we already have the right information stashed in the kvm structure, and we can return it as requested. Reported-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Tested-by: Alexandru Elisei Reviewed-by: Alexandru Elisei Link: https://lore.kernel.org/r/20200427141507.284985-1-maz@kernel.org commit c862626e19efdc26b26481515470b160e8fe52f3 Author: Keqian Zhu Date: Mon Apr 13 20:20:23 2020 +0800 KVM: arm64: Support enabling dirty log gradually in small chunks There is already support of enabling dirty log gradually in small chunks for x86 in commit 3c9bd4006bfc ("KVM: x86: enable dirty log gradually in small chunks"). This adds support for arm64. x86 still writes protect all huge pages when DIRTY_LOG_INITIALLY_ALL_SET is enabled. However, for arm64, both huge pages and normal pages can be write protected gradually by userspace. Under the Huawei Kunpeng 920 2.6GHz platform, I did some tests on 128G Linux VMs with different page size. The memory pressure is 127G in each case. The time taken of memory_global_dirty_log_start in QEMU is listed below: Page Size Before After Optimization 4K 650ms 1.8ms 2M 4ms 1.8ms 1G 2ms 1.8ms Besides the time reduction, the biggest improvement is that we will minimize the performance side effect (because of dissolving huge pages and marking memslots dirty) on guest after enabling dirty log. Signed-off-by: Keqian Zhu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200413122023.52583-1-zhukeqian1@huawei.com commit 0529c9021252a58b6d3808da86986a614b900b1b Author: Suzuki K Poulose Date: Thu May 7 20:35:46 2020 +0800 KVM: arm64: Unify handling THP backed host memory We support mapping host memory backed by PMD transparent hugepages at stage2 as huge pages. However the checks are now spread across two different places. Let us unify the handling of the THPs to keep the code cleaner (and future proof for PUD THP support). This patch moves transparent_hugepage_adjust() closer to the caller to avoid a forward declaration for fault_supports_stage2_huge_mappings(). Also, since we already handle the case where the host VA and the guest PA may not be aligned, the explicit VM_BUG_ON() is not required. Signed-off-by: Suzuki K Poulose Signed-off-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200507123546.1875-3-yuzenghui@huawei.com commit 9f2836146b11cdf98d5c8f8f71b0fce28fbd83c8 Author: Suzuki K Poulose Date: Thu May 7 20:35:45 2020 +0800 KVM: arm64: Clean up the checking for huge mapping If we are checking whether the stage2 can map PAGE_SIZE, we don't have to do the boundary checks as both the host VMA and the guest memslots are page aligned. Bail the case easily. While we're at it, fixup a typo in the comment below. Signed-off-by: Suzuki K Poulose Signed-off-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200507123546.1875-2-yuzenghui@huawei.com commit 48c963e31bc664afafd31058483ea8390da63980 Author: Jiang Yi Date: Wed Apr 15 10:42:29 2020 +0200 KVM: arm/arm64: Release kvm->mmu_lock in loop to prevent starvation Do cond_resched_lock() in stage2_flush_memslot() like what is done in unmap_stage2_range() and other places holding mmu_lock while processing a possibly large range of memory. Signed-off-by: Jiang Yi Signed-off-by: Marc Zyngier Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200415084229.29992-1-giangyi@amazon.com commit 892713e97ca146591515b3c115f99cdf632030fb Author: Zenghui Yu Date: Wed Apr 15 15:28:35 2020 +0800 KVM: arm64: Sidestep stage2_unmap_vm() on vcpu reset when S2FWB is supported stage2_unmap_vm() was introduced to unmap user RAM region in the stage2 page table to make the caches coherent. E.g., a guest reboot with stage1 MMU disabled will access memory using non-cacheable attributes. If the RAM and caches are not coherent at this stage, some evicted dirty cache line may go and corrupt guest data in RAM. Since ARMv8.4, S2FWB feature is mandatory and KVM will take advantage of it to configure the stage2 page table and the attributes of memory access. So we ensure that guests always access memory using cacheable attributes and thus, the caches always be coherent. So on CPUs that support S2FWB, we can safely reset the vcpu without a heavy stage2 unmapping. Signed-off-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200415072835.1164-1-yuzenghui@huawei.com commit 656012c731fcfd0f770007366e2b952a613745f2 Author: Fuad Tabba Date: Wed Apr 1 15:03:10 2020 +0100 KVM: Fix spelling in code comments Fix spelling and typos (e.g., repeated words) in comments. Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200401140310.29701-1-tabba@google.com commit ce6f8f02f9f6786355fa6c79d88b839639dd75d8 Author: Marc Zyngier Date: Wed May 13 11:38:28 2020 +0100 KVM: arm64: Use cpus_have_final_cap for has_vhe() By the time we start using the has_vhe() helper, we have long discovered whether we are running VHE or not. It thus makes sense to use cpus_have_final_cap() instead of cpus_have_const_cap(), which leads to a small text size reduction. Signed-off-by: Marc Zyngier Acked-by: David Brazdil Link: https://lore.kernel.org/r/20200513103828.74580-1-maz@kernel.org commit c6fe89ff8b250ad4dc4bed7bd5877bfbc35f4aba Author: Marc Zyngier Date: Wed May 13 11:58:29 2020 +0100 KVM: arm64: Simplify __kvm_timer_set_cntvoff implementation Now that this function isn't constrained by the 32bit PCS, let's simplify it by taking a single 64bit offset instead of two 32bit parameters. Signed-off-by: Marc Zyngier commit 25357de01b95140ecacd4d9347d74df2dda789f2 Author: Fuad Tabba Date: Tue May 5 16:45:20 2020 +0100 KVM: arm64: Clean up kvm makefiles Consolidate references to the CONFIG_KVM configuration item to encompass entire folders rather than per line. Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Acked-by: Will Deacon Link: https://lore.kernel.org/r/20200505154520.194120-5-tabba@google.com commit f26133624d602b0d984815168a2d3a1f630b02e2 Author: Will Deacon Date: Tue May 5 16:45:19 2020 +0100 KVM: arm64: Change CONFIG_KVM to a menuconfig entry Changing CONFIG_KVM to be a 'menuconfig' entry in Kconfig mean that we can straightforwardly enumerate optional features, such as the virtual PMU device as dependent options. Signed-off-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200505154520.194120-4-tabba@google.com commit bf7bc1df30f6c6afa34d4d1d53e1c8ad93510d3e Author: Will Deacon Date: Tue May 5 16:45:18 2020 +0100 KVM: arm64: Update help text arm64 KVM supports 16k pages since 02e0b7600f83 ("arm64: kvm: Add support for 16K pages"), so update the Kconfig help text accordingly. Signed-off-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200505154520.194120-3-tabba@google.com commit d82755b2e781c8989614c82df7582f5649e265b8 Author: Will Deacon Date: Tue May 5 16:45:17 2020 +0100 KVM: arm64: Kill off CONFIG_KVM_ARM_HOST CONFIG_KVM_ARM_HOST is just a proxy for CONFIG_KVM, so remove it in favour of the latter. Signed-off-by: Will Deacon Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200505154520.194120-2-tabba@google.com commit 9ed24f4b712b855dcf7be3025b75b051cb73a2b7 Author: Marc Zyngier Date: Wed May 13 11:40:34 2020 +0100 KVM: arm64: Move virt/kvm/arm to arch/arm64 Now that the 32bit KVM/arm host is a distant memory, let's move the whole of the KVM/arm64 code into the arm64 tree. As they said in the song: Welcome Home (Sanitarium). Signed-off-by: Marc Zyngier Acked-by: Will Deacon Link: https://lore.kernel.org/r/20200513104034.74741-1-maz@kernel.org commit 55e00fb66fd5048f4a3ee357018fd26fc527abca Author: Yu-cheng Yu Date: Tue May 12 07:54:44 2020 -0700 x86/fpu/xstate: Restore supervisor states for signal return The signal return fast path directly restores user states from the user buffer. Once that succeeds, restore supervisor states (but only when they are not yet restored). For the slow path, save supervisor states to preserve them across context switches, and restore after the user states are restored. The previous version has the overhead of an XSAVES in both the fast and the slow paths. It is addressed as the following: - In the fast path, only do an XRSTORS. - In the slow path, do a supervisor-state-only XSAVES, and relocate the buffer contents. Some thoughts in the implementation: - In the slow path, can any supervisor state become stale between save/restore? Answer: set_thread_flag(TIF_NEED_FPU_LOAD) protects the xstate buffer. - In the slow path, can any code reference a stale supervisor state register between save/restore? Answer: In the current lazy-restore scheme, any reference to xstate registers needs fpregs_lock()/fpregs_unlock() and __fpregs_load_activate(). - Are there other options? One other option is eagerly restoring all supervisor states. Currently, CET user-mode states and ENQCMD's PASID do not need to be eagerly restored. The upcoming CET kernel-mode states (24 bytes) need to be eagerly restored. To me, eagerly restoring all supervisor states adds more overhead then benefit at this point. Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20200512145444.15483-11-yu-cheng.yu@intel.com commit 98265c17efa9f2279c59262cd27679aca12e0bb8 Author: Yu-cheng Yu Date: Tue May 12 07:54:43 2020 -0700 x86/fpu/xstate: Preserve supervisor states for the slow path in __fpu__restore_sig() The signal return code is responsible for taking an XSAVE buffer present in user memory and loading it into the hardware registers. This operation only affects user XSAVE state and never affects supervisor state. The fast path through this code simply points XRSTOR directly at the user buffer. However, since user memory is not guaranteed to be always mapped, this XRSTOR can fail. If it fails, the signal return code falls back to a slow path which can tolerate page faults. That slow path copies the xfeatures one by one out of the user buffer into the task's fpu state area. However, by being in a context where it can handle page faults, the code can also schedule. The lazy-fpu-load code would think it has an up-to-date fpstate and would fail to save the supervisor state when scheduling the task out. When scheduling back in, it would likely restore stale supervisor state. To fix that, preserve supervisor state before the slow path. Modify copy_user_to_fpregs_zeroing() so that if it fails, fpregs are not zeroed, and there is no need for fpregs_deactivate() and supervisor states are preserved. Move set_thread_flag(TIF_NEED_FPU_LOAD) to the slow path. Without doing this, the fast path also needs supervisor states to be saved first. Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200512145444.15483-10-yu-cheng.yu@intel.com commit 582838ea5bea41258d136c82a6c493a95cda652c Author: Geert Uytterhoeven Date: Mon May 11 12:18:28 2020 +0200 gpiolib: Document that GPIO line names are not globally unique gpiochip_set_desc_names() no longer rejects GPIO line name collisions. Hence GPIO line names are not guaranteed to be globally unique. In case of multiple GPIO lines with the same name, gpio_name_to_desc() will return the first match found. Update the comments for gpio_name_to_desc() and gpiochip_set_desc_names() to match reality. Fixes: f881bab038c9667d ("gpio: keep the GPIO line names internal") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200511101828.30046-1-geert+renesas@glider.be Signed-off-by: Linus Walleij commit eeedf1533687b8e81865fdbde79eddf7c4b76c9a Author: Yu-cheng Yu Date: Tue May 12 07:54:42 2020 -0700 x86/fpu: Introduce copy_supervisor_to_kernel() The XSAVES instruction takes a mask and saves only the features specified in that mask. The kernel normally specifies that all features be saved. XSAVES also unconditionally uses the "compacted format" which means that all specified features are saved next to each other in memory. If a feature is removed from the mask, all the features after it will "move up" into earlier locations in the buffer. Introduce copy_supervisor_to_kernel(), which saves only supervisor states and then moves those states into the standard location where they are normally found. Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200512145444.15483-9-yu-cheng.yu@intel.com commit 47fa5c971bbce2d97efb82da709deff60aaf7b3d Author: Geert Uytterhoeven Date: Thu May 7 13:37:51 2020 +0200 pinctrl: amd: Add ACPI dependency Currently the AMD pin controller driver supports ACPI platform only. Make the PINCTRL_AMD config symbol depend on ACPI, to avoid asking the user about it when configuring a kernel without ACPI support. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200507113751.24213-1-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 80691a8ac7a43434ed2ecff15d560a9e5d90f613 Author: Geert Uytterhoeven Date: Thu May 7 13:36:25 2020 +0200 pinctrl: equilibrium: Add architecture dependency The Equilibrium pin controller is only present on Intel Lightning Mountain SoCs. Add an architecture dependency to the PINCTRL_EQUILIBRIUM config symbol, to avoid asking the user about it when configuring a kernel for a non-x86 architecture. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200507113626.24026-2-geert+renesas@glider.be Signed-off-by: Linus Walleij commit b9f2d35f05308813c4c887d5c530004f01e1829c Author: Takashi Iwai Date: Sat May 16 08:28:54 2020 +0200 ALSA: hda: Unexport some local helper functions snd_hdac_bus_queue_event() and snd_hdac_bus_exec_verb() are used only internally in HD-audio core. Let's drop the exports and move the declarations into local.h. Link: https://lore.kernel.org/r/20200516062854.22141-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6325c7fade7db4d6ebefd44604176476ffad6a4b Author: Takashi Iwai Date: Sat May 16 08:28:53 2020 +0200 ALSA: hda: Drop unused snd_hda_queue_unsol_event() The inline function is nowhere used. Drop it. Link: https://lore.kernel.org/r/20200516062854.22141-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit c637fa151259c0f74665fde7cba5b7eac1417ae5 Author: Takashi Iwai Date: Sat May 16 08:25:56 2020 +0200 ALSA: hda: Fix potential race in unsol event handler The unsol event handling code has a loop retrieving the read/write indices and the arrays without locking while the append to the array may happen concurrently. This may lead to some inconsistency. Although there hasn't been any proof of this bad results, it's still safer to protect the racy accesses. This patch adds the spinlock protection around the unsol handling loop for addressing it. Here we take bus->reg_lock as the writer side snd_hdac_bus_queue_event() is also protected by that lock. Link: https://lore.kernel.org/r/20200516062556.30951-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6255c161a08564e4f3995db31f3d64a5fd24738b Author: Borislav Petkov Date: Fri May 15 20:21:21 2020 +0200 x86/nmi: Remove edac.h include leftover ... which db47d5f85646 ("x86/nmi, EDAC: Get rid of DRAM error reporting thru PCI SERR NMI") forgot to remove. No functional changes. Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200515182246.3553-1-bp@alien8.de commit 96586dd9268d26b278a1dd9110080001a6acbb0f Author: John Fastabend Date: Wed May 13 12:16:02 2020 -0700 bpf: Selftests, add ktls tests to test_sockmap Until now we have only had minimal ktls+sockmap testing when being used with helpers and different sendmsg/sendpage patterns. Add a pass with ktls here. To run just ktls tests, $ ./test_sockmap --whitelist="ktls" Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939736278.15176.5435314315563203761.stgit@john-Precision-5820-Tower commit a7238f7c79dda1c484f92478c42408e1a3d418c6 Author: John Fastabend Date: Wed May 13 12:15:43 2020 -0700 bpf: Selftests, add blacklist to test_sockmap This adds a blacklist to test_sockmap. For example, now we can run all apply and cork tests except those with timeouts by doing, $ ./test_sockmap --whitelist "apply,cork" --blacklist "hang" Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939734350.15176.6643981099665208826.stgit@john-Precision-5820-Tower commit 065a74cbd0d0bd7115846d630e141a95a95e1ce1 Author: John Fastabend Date: Wed May 13 12:15:24 2020 -0700 bpf: Selftests, add whitelist option to test_sockmap Allow running specific tests with a comma deliminated whitelist. For example to run all apply and cork tests. $ ./test_sockmap --whitelist="cork,apply" Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939732464.15176.1959113294944564542.stgit@john-Precision-5820-Tower commit b98ca90c56ee498c751ff5c20b9db8cb64c13fc5 Author: John Fastabend Date: Wed May 13 12:15:04 2020 -0700 bpf: Selftests, provide verbose option for selftests execution Pass options from command line args into individual tests which allows us to use verbose option from command line with selftests. Now when verbose option is set individual subtest details will be printed. Also we can consolidate cgroup bring up and tear down. Additionally just setting verbose is very noisy so introduce verbose=1 and verbose=2. Really verbose=2 is only useful when developing tests or debugging some specific issue. For example now we get output like this with --verbose, #20/17 sockhash:txmsg test pull-data:OK [TEST 160]: (512, 1, 3, sendpage, pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 1 cnt 512 err 0 [TEST 161]: (100, 1, 5, sendpage, pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 3 cnt 100 err 0 [TEST 162]: (2, 1024, 256, sendpage, pop (4096,8192),): msg_loop_rx: iov_count 1 iov_buf 255 cnt 2 err 0 [TEST 163]: (512, 1, 3, sendpage, redir,pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 1 cnt 512 err 0 [TEST 164]: (100, 1, 5, sendpage, redir,pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 3 cnt 100 err 0 [TEST 165]: (512, 1, 3, sendpage, cork 512,pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 1 cnt 512 err 0 [TEST 166]: (100, 1, 5, sendpage, cork 512,pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 3 cnt 100 err 0 [TEST 167]: (512, 1, 3, sendpage, redir,cork 4,pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 1 cnt 512 err 0 [TEST 168]: (100, 1, 5, sendpage, redir,cork 4,pop (1,3),): msg_loop_rx: iov_count 1 iov_buf 3 cnt 100 err 0 Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939730412.15176.1975675235035143367.stgit@john-Precision-5820-Tower commit 328aa08a081bb94f9aba506363186de6ec3382ec Author: John Fastabend Date: Wed May 13 12:14:44 2020 -0700 bpf: Selftests, break down test_sockmap into subtests At the moment test_sockmap runs all 800+ tests ungrouped which is not ideal because it makes it hard to see what is failing but also more importantly its hard to confirm all cases are tested. Additionally, after inspecting we noticed the runtime is bloated because we run many duplicate tests. Worse some of these tests are known error cases that wait for the recvmsg handler to timeout which creats long delays. Also we noted some tests were not clearing their options and as a result the following tests would run with extra and incorrect options. Fix this by reorganizing test code so its clear what tests are running and when. Then it becomes easy to remove duplication and run tests with only the set of send/recv patterns that are relavent. To accomplish this break test_sockmap into subtests and remove unnecessary duplication. The output is more readable now and the runtime reduced. Now default output prints subtests like this, $ ./test_sockmap # 1/ 6 sockmap:txmsg test passthrough:OK ... #22/ 1 sockhash:txmsg test push/pop data:OK Pass: 22 Fail: 0 Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939728384.15176.13601520183665880762.stgit@john-Precision-5820-Tower commit 18d4e900a4500c54af56b9ad39f4d3b378eb0661 Author: John Fastabend Date: Wed May 13 12:14:25 2020 -0700 bpf: Selftests, improve test_sockmap total bytes counter The recv thread in test_sockmap waits to receive all bytes from sender but in the case we use pop data it may wait for more bytes then actually being sent. This stalls the test harness for multiple seconds. Because this happens in multiple tests it slows time to run the selftest. Fix by doing a better job of accounting for total bytes when pop helpers are used. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939726542.15176.5964532245173539540.stgit@john-Precision-5820-Tower commit 248aba1d526e052ee9aba6dd9c5a198e30839cbd Author: John Fastabend Date: Wed May 13 12:14:05 2020 -0700 bpf: Selftests, print error in test_sockmap error cases Its helpful to know the error value if an error occurs. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939724566.15176.12079885932643225626.stgit@john-Precision-5820-Tower commit 13a5f3ffd202f73f1d0c2ed36dd66a0cd891e61a Author: John Fastabend Date: Wed May 13 12:13:46 2020 -0700 bpf: Selftests, sockmap test prog run without setting cgroup Running test_sockmap with arguments to specify a test pattern requires including a cgroup argument. Instead of requiring this if the option is not provided create one This is not used by selftest runs but I use it when I want to test a specific test. Most useful when developing new code and/or tests. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939722675.15176.6294210959489131688.stgit@john-Precision-5820-Tower commit d79a32129b21296f1dce1bd9d703826853bb63a6 Author: John Fastabend Date: Wed May 13 12:13:27 2020 -0700 bpf: Selftests, remove prints from sockmap tests The prints in the test_sockmap programs were only useful when we didn't have enough control over test infrastructure to know from user program what was being pushed into kernel side. Now that we have or will shortly have better test controls lets remove the printers. This means we can remove half the programs and cleanup bpf side. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939720756.15176.9806965887313279429.stgit@john-Precision-5820-Tower commit 991e35eebe1e90ffc1c75105286a50e627b56dd1 Author: John Fastabend Date: Wed May 13 12:13:09 2020 -0700 bpf: Selftests, move sockmap bpf prog header into progs Moves test_sockmap_kern.h into progs directory but does not change code at all. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/158939718921.15176.5766299102332077086.stgit@john-Precision-5820-Tower commit ea6119aa67c706684f91258527abaa6284b855da Merge: 2ea46dc68642 3f3ab178c71b Author: David S. Miller Date: Fri May 15 16:36:46 2020 -0700 Merge tag 'mlx5-updates-2020-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2020-05-15 mlx5 core and mlx5e (netdev) updates: 1) Two fixes for release all FW pages support. 2) Improvement in calculating the send queue stop room on tx 3) Flow steering auto-groups creation improvements 4) TC offload fix for Connection tracking with NAT action 5) IPoIB support for self looback to allow communication between ipoib pkey child interfaces on the same host. 6) DCBNL cleanup to avoid #ifdef DCBNL all over the main mlx5e code 7) Small and trivial code cleanup ==================== Signed-off-by: David S. Miller commit 2ea46dc6864261e94441e4d141058fc538d0de6b Author: Nathan Chancellor Date: Fri May 15 15:33:18 2020 -0700 ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions When building with Clang: In file included from drivers/net/ethernet/ti/am65-cpsw-ethtool.c:15: drivers/net/ethernet/ti/am65-cpts.h:58:12: warning: unused function 'am65_cpts_ns_gettime' [-Wunused-function] static s64 am65_cpts_ns_gettime(struct am65_cpts *cpts) ^ drivers/net/ethernet/ti/am65-cpts.h:63:12: warning: unused function 'am65_cpts_estf_enable' [-Wunused-function] static int am65_cpts_estf_enable(struct am65_cpts *cpts, ^ drivers/net/ethernet/ti/am65-cpts.h:69:13: warning: unused function 'am65_cpts_estf_disable' [-Wunused-function] static void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx) ^ 3 warnings generated. These functions need to be marked as inline, which adds __maybe_unused, to avoid these warnings, which is the pattern for stub functions. Fixes: ec008fa2a9e5 ("ethernet: ti: am65-cpts: add routines to support taprio offload") Link: https://github.com/ClangBuiltLinux/linux/issues/1026 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit 3b09d27cc93d584f49bc18f1e1696ba19d43233a Author: Stanislav Fomichev Date: Fri May 15 12:49:04 2020 -0700 selftests/bpf: Move test_align under test_progs There is a much higher chance we can see the regressions if the test is part of test_progs. Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200515194904.229296-2-sdf@google.com commit 5366d2269139ba8eb6a906d73a0819947e3e4e0a Author: Stanislav Fomichev Date: Fri May 15 12:49:03 2020 -0700 selftests/bpf: Fix test_align verifier log patterns Commit 294f2fc6da27 ("bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds()") changed the way verifier logs some of its state, adjust the test_align accordingly. Where possible, I tried to not copy-paste the entire log line and resorted to dropping the last closing brace instead. Fixes: 294f2fc6da27 ("bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds()") Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200515194904.229296-1-sdf@google.com commit 8d35d74f52ae07689e575ea21f7dc2e07dd1392f Author: Ian Rogers Date: Fri May 15 09:50:03 2020 -0700 libbpf, hashmap: Fix signedness warnings Fixes the following warnings: hashmap.c: In function ‘hashmap__clear’: hashmap.h:150:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] 150 | for (bkt = 0; bkt < map->cap; bkt++) \ hashmap.c: In function ‘hashmap_grow’: hashmap.h:150:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] 150 | for (bkt = 0; bkt < map->cap; bkt++) \ Signed-off-by: Ian Rogers Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200515165007.217120-4-irogers@google.com commit f516acd5397fdbb77ef0aad0798d9ef7c3001d72 Author: Ian Rogers Date: Fri May 15 09:50:02 2020 -0700 libbpf, hashmap: Remove unused #include Remove #include of libbpf_internal.h that is unused. Discussed in this thread: https://lore.kernel.org/lkml/CAEf4BzZRmiEds_8R8g4vaAeWvJzPb4xYLnpF0X2VNY8oTzkphQ@mail.gmail.com/ Signed-off-by: Ian Rogers Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200515165007.217120-3-irogers@google.com commit 2ec0616e870f0f2aa8353e0de057f0c2dc8d52d5 Author: Daniel Borkmann Date: Sat May 16 00:39:18 2020 +0200 bpf: Fix check_return_code to only allow [0,1] in trace_iter progs As per 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program") we only allow a range of [0,1] for return codes. Therefore BPF_TRACE_ITER relies on the default tnum_range(0, 1) which is set in range var. On recent merge of net into net-next commit e92888c72fbd ("bpf: Enforce returning 0 for fentry/fexit progs") got pulled in and caused a merge conflict with the changes from 15d83c4d7cef. The resolution had a snall hiccup in that it removed the [0,1] range restriction again so that BPF_TRACE_ITER would have no enforcement. Fix it by adding it back. Fixes: da07f52d3caf ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov commit 3f3ab178c71b12295b5950792b72d2198f0e77c7 Author: Tariq Toukan Date: Wed Oct 23 15:00:52 2019 +0300 net/mlx5e: Take DCBNL-related definitions into dedicated files Take DCBNL-related definitions out of the common en.h header, Use a dedicated header file for exposing them. Some need not to be exposed, use them locally in the .c file. Use stubs to eliminate use of CONFIG_MLX5_CORE_EN_DCB in the generic control flows. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 5ffb4d858b7051720f20bcbb92dce0b433e60d88 Author: Maxim Mikityanskiy Date: Mon Mar 30 16:28:34 2020 +0300 net/mlx5e: Calculate SQ stop room in a robust way Currently, different formulas are used to estimate the space that may be taken by WQEs in the SQ during a single packet transmit. This space is called stop room, and it's checked in the end of packet transmit to find out if the next packet could overflow the SQ. If it could, the driver tells the kernel to stop sending next packets. Many factors affect the stop room: 1. Padding with NOPs to avoid WQEs spanning over page boundaries. 2. Enabled and disabled offloads (TLS, upcoming MPWQE). 3. The maximum size of a WQE. The padding is performed before every WQE if it doesn't fit the current page. The current formula assumes that only one padding will be required per packet, and it doesn't take into account that the WQEs posted during the transmission of a single packet might exceed the page size in very rare circumstances. For example, to hit this condition with 4096-byte pages, TLS offload will have to interrupt an almost-full MPWQE session, be in the resync flow and try to transmit a near to maximum amount of data. To avoid SQ overflows in such rare cases after MPWQE is added, this patch introduces a more robust formula to estimate the stop room. The new formula uses the fact that a WQE of size X will not require more than X-1 WQEBBs of padding. More exact estimations are possible, but they result in much more complex and error-prone code for little gain. Before this patch, the TLS stop room included space for both INNOVA and ConnectX TLS offloads that couldn't run at the same time anyway, so this patch accounts only for the active one. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 8b46d424a743ddfef8056d5167f13ee7ebd1dcad Author: Erez Shitrit Date: Mon May 4 11:46:25 2020 +0300 net/mlx5e: IPoIB, Drop multicast packets that this interface sent After enabled loopback packets for IPoIB, we need to drop these packets that this HCA has replicated and came back to the same interface that sent them. Fixes: 4c6c615e3f30 ("net/mlx5e: IPoIB, Add PKEY child interface nic profile") Signed-off-by: Erez Shitrit Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 80639b199c9ca87444da218ba0e7511946452dd4 Author: Erez Shitrit Date: Sun May 3 13:01:37 2020 +0300 net/mlx5e: IPoIB, Enable loopback packets for IPoIB interfaces Enable loopback of unicast and multicast traffic for IPoIB enhanced mode. This will allow interfaces with the same pkey to communicate between them e.g cloned interfaces that located in different namespaces. Signed-off-by: Erez Shitrit Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 9102d836d296fbc94517736d2dd1131ad6b01740 Author: Roi Dayan Date: Sun Apr 12 15:39:15 2020 +0300 net/mlx5e: CT: Fix offload with CT action after CT NAT action It could be a chain of rules will do action CT again after CT NAT Before this fix matching will break as we get into the CT table after NAT changes and not CT NAT. Fix this by adding pre ct and pre ct nat tables to skip ct/ct_nat tables and go straight to post_ct table if ct/nat was already done. Signed-off-by: Roi Dayan Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit 90bf1c8dbdc52d08a18c9c1fb2b847999159e3a2 Author: Eran Ben Elisha Date: Thu May 7 14:13:33 2020 +0300 net/mlx5: Move internal timer read function to clock library Move mlx5_read_internal_timer() into lib/clock.c file as it is being used there. As such, make this function a static one. In addition, rearrange headers include to support function move. Signed-off-by: Eran Ben Elisha Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 49c0355d301b4e0e01e0f19ddbb023bd7d0ee48c Author: Paul Blakey Date: Thu May 7 12:01:39 2020 +0300 net/mlx5: Wait for inactive autogroups Currently, if one thread tries to add an entry to an autogrouped table with no free matching group, while another thread is in the process of creating a new matching autogroup, it doesn't wait for the new group creation, and creates an unnecessary new autogroup. Instead of skipping inactive, wait on the write lock of those groups. Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 41798df9bfca5aae080a66252ae1709867e28757 Author: Parav Pandit Date: Fri May 1 09:42:45 2020 -0500 net/mlx5: Drain wq first during PCI device removal mlx5_unload_one() is done with cleanup = true only once. So instead of doing health wq drain inside the if(), directly do during PCI device removal. Signed-off-by: Parav Pandit Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 4162f58b476b248d0718f3d6aad2e57da2b08a63 Author: Parav Pandit Date: Fri May 1 10:20:01 2020 -0500 net/mlx5: Have single error unwinding path Having multiple error unwinding path are error prone. Lets have just one error unwinding path. Signed-off-by: Parav Pandit Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit e7f860e2106a4c288d98308c59545ddd350e4739 Author: Eran Ben Elisha Date: Sun May 3 11:01:39 2020 +0300 net/mlx5: Fix a bug of releasing wrong chunks on > 4K page size systems On systems with page size larger than 4K, a fwp object has few 4K chunks. Fix a bug in fwp free flow where the chunk address was dropped and fwp->addr was used instead (first chunk address). This caused a wrong update of fwp->bitmask which later can cause errors in re-alloc fwp chunk flow. In order to fix this it, re-factor the release flow: - Free 4k: Releases a specific 4k chunk inside the fwp, defined by starting address. - Free fwp: Unconditionally release the whole fwp and its resources. Free addr will call free fwp if all chunks were released, in order to do code sharing. In addition, fix npages to count for all released chunks correctly. Fixes: c6168161f693 ("net/mlx5: Add support for release all pages event") Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 2726cd4a29280c20ea983be285a6aefe75b205a4 Author: Eran Ben Elisha Date: Sun May 3 10:15:58 2020 +0300 net/mlx5: Dedicate fw page to the requesting function The cited patch assumes that all chuncks in a fw page belong to the same function, thus the driver must dedicate fw page to the requesting function, which is actually what was intedned in the original fw pages allocator design, hence the fwp->func_id ! Up until the cited patch everything worked ok, but now "relase all pages" is broken on systems with page_size > 4k. Fix this by dedicating fw page to the requesting function id via adding a func_id parameter to alloc_4k() function. Fixes: c6168161f693 ("net/mlx5: Add support for release all pages event") Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 9d281a4f6fd61341da2fd08bf0b9449ed72b40e3 Author: Geert Uytterhoeven Date: Tue May 5 17:07:22 2020 +0200 ARM: socfpga: Drop unneeded select of PCI_DOMAINS_GENERIC Support for Altera SOCFPGA systems depends on ARCH_MULTI_V7, and thus on ARCH_MULTIPLATFORM. As the latter selects PCI_DOMAINS_GENERIC, there is no need for ARCH_SOCFPGA to select PCI_DOMAINS_GENERIC. Link: https://lore.kernel.org/r/20200505150722.1575-16-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Dinh Nguyen Acked-by: Arnd Bergmann Acked-by: Dinh Nguyen Signed-off-by: Arnd Bergmann commit 9fe2b45889db54fdfa9080f826e08e3bdcf0e18d Author: Geert Uytterhoeven Date: Tue May 5 17:07:20 2020 +0200 ARM: prima2: Drop unneeded select of HAVE_SMP Support for CSR SiRF SoCs depends on ARCH_MULTI_V7. As the latter selects HAVE_SMP, there is no need for ARCH_ATLAS7 to select HAVE_SMP. Link: https://lore.kernel.org/r/20200505150722.1575-14-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Barry Song Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit c5b18873f5b956bd46d42effbffb1b929788190a Author: Geert Uytterhoeven Date: Tue May 5 17:07:18 2020 +0200 ARM: mvebu: Drop unneeded select of HAVE_SMP Support for Marvell Armada 375, 380, 385, and 39x SoCs depends on ARCH_MULTI_V7. As the latter selects HAVE_SMP, there is no need for MACH_ARMADA_375, MACH_ARMADA_38X, and MACH_ARMADA_39X to select HAVE_SMP. Link: https://lore.kernel.org/r/20200505150722.1575-12-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Acked-by: Arnd Bergmann Reviewed-by: Andrew Lunn Signed-off-by: Arnd Bergmann commit 1942cf1cb5e233a9223c1ad1ea05aa26bce7a51c Author: Geert Uytterhoeven Date: Tue May 5 17:07:17 2020 +0200 ARM: mmp: Drop unneeded select of COMMON_CLK Support for Marvell MMP ARMv5 platforms depends on ARCH_MULTI_V5, and thus on ARCH_MULTIPLATFORM. As the latter selects COMMON_CLK, there is no need for MACH_MMP_DT to select COMMON_CLK. Link: https://lore.kernel.org/r/20200505150722.1575-11-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Lubomir Rintel Acked-by: Arnd Bergmann Acked-by: Lubomir Rintel Signed-off-by: Arnd Bergmann commit 671ae272850484844b0897bf1c2f01a52a284dc7 Author: Geert Uytterhoeven Date: Tue May 5 17:07:15 2020 +0200 ARM: davinci: Drop unneeded select of TIMER_OF Support for TI DaVinci SoCs depends on ARCH_MULTI_V5, and thus on ARCH_MULTIPLATFORM. As the latter selects TIMER_OF, there is no need for MACH_DA8XX_DT to select TIMER_OF. Link: https://lore.kernel.org/r/20200505150722.1575-9-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Sekhar Nori Cc: Bartosz Golaszewski Acked-by: Arnd Bergmann Acked-by: Sekhar Nori Signed-off-by: Arnd Bergmann commit 022dacdd278da6d3746c8f62ce293c67aaa7b6fc Author: Geert Uytterhoeven Date: Tue May 5 17:07:14 2020 +0200 ARM: clps711x: Drop unneeded select of multi-platform selected options Support for Cirrus Logic EP721x/EP731x-based SoCs depends on ARCH_MULTI_V7, and thus on ARCH_MULTIPLATFORM. As the latter selects AUTO_ZRELADDR, TIMER_OF, COMMON_CLK, GENERIC_CLOCKEVENTS, and USE_OF, there is no need for ARCH_CLPS711X to select any of them. Link: https://lore.kernel.org/r/20200505150722.1575-8-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Alexander Shiyan Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit b8c5a80689bae8c13029bde2cc605b7011a09dfe Author: Geert Uytterhoeven Date: Tue May 5 17:07:13 2020 +0200 ARM: berlin: Drop unneeded select of HAVE_SMP Support for Marvell Berlin SoCs depends on ARCH_MULTI_V7. As the latter selects HAVE_SMP, there is no need for MACH_BERLIN_BG2 to select HAVE_SMP. Link: https://lore.kernel.org/r/20200505150722.1575-7-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Jisheng Zhang Cc: Sebastian Hesselbarth Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit 9fdba09a039e9a045e6c7cd0342ff646ad8f81ff Author: Geert Uytterhoeven Date: Tue May 5 17:07:12 2020 +0200 ARM: aspeed: Drop unneeded select of HAVE_SMP Support for the 6th generation Aspeed SoCs depends on ARCH_MULTI_V7. As the latter selects HAVE_SMP, there is no need for MACH_ASPEED_G6 to select HAVE_SMP. Link: https://lore.kernel.org/r/20200505150722.1575-6-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Joel Stanley Cc: Andrew Jeffery Acked-by: Arnd Bergmann Reviewed-by: Andrew Jeffery Signed-off-by: Arnd Bergmann commit 80454a9908d70f76c44b28f3ec2af61aea16e0c1 Author: Geert Uytterhoeven Date: Tue May 5 17:07:11 2020 +0200 ARM: asm9260: Drop unneeded select of GENERIC_CLOCKEVENTS Support for the Alphascale ASM9260 platform depends on ARCH_MULTI_V5, and thus on ARCH_MULTIPLATFORM. As the latter selects GENERIC_CLOCKEVENTS, there is no need for MACH_ASM9260 to select GENERIC_CLOCKEVENTS. Link: https://lore.kernel.org/r/20200505150722.1575-5-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Oleksij Rempel Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit 84ce0141031a80864083448ba919046393ca0eb4 Author: Geert Uytterhoeven Date: Tue May 5 17:07:10 2020 +0200 ARM: alpine: Drop unneeded select of HAVE_SMP Support for Annapurna Labs Alpine platforms depends on ARCH_MULTI_V7. As the latter selects HAVE_SMP, there is no need for ARCH_ALPINE to select HAVE_SMP. Link: https://lore.kernel.org/r/20200505150722.1575-4-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Tsahee Zidenberg Cc: Antoine Tenart Acked-by: Arnd Bergmann Signed-off-by: Arnd Bergmann commit 4039a44c9ee9ce09fe0ca480788b89071ee6c585 Author: Geert Uytterhoeven Date: Tue May 5 17:07:09 2020 +0200 ARM: actions: Drop unneeded select of COMMON_CLK Support for Actions Semi SoCs depends on ARCH_MULTI_V7, and thus on ARCH_MULTIPLATFORM. As the latter selects COMMON_CLK, there is no need for ARCH_ACTIONS to select COMMON_CLK. Link: https://lore.kernel.org/r/20200505150722.1575-3-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Cc: Andreas Färber Cc: Manivannan Sadhasivam Acked-by: Arnd Bergmann Reviewed-by: Andreas Färber Signed-off-by: Arnd Bergmann commit 4c8a2bd23115e9871a82c92b465c6625bdd25808 Author: Geert Uytterhoeven Date: Tue May 5 17:07:08 2020 +0200 ARM: arch timer: Drop unneeded select GENERIC_CLOCKEVENTS The ARM Architected timer is available on ARMv7 SoCs only. As both ARCH_MULTIPLATFORM and ARM_SINGLE_ARMV7M select GENERIC_CLOCKEVENTS, there is no need for HAVE_ARM_ARCH_TIMER to select GENERIC_CLOCKEVENTS. Link: https://lore.kernel.org/r/20200505150722.1575-2-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann commit e37986097ba63c94b1af9d5ad5486d120a809f72 Author: Zou Wei Date: Tue Apr 28 19:52:21 2020 +0800 apparmor: Use true and false for bool variable Fixes coccicheck warnings: security/apparmor/file.c:162:9-10: WARNING: return of 0/1 in function 'is_deleted' with return type bool security/apparmor/file.c:362:9-10: WARNING: return of 0/1 in function 'xindex_is_subset' with return type bool security/apparmor/policy_unpack.c:246:9-10: WARNING: return of 0/1 in function 'unpack_X' with return type bool security/apparmor/policy_unpack.c:292:9-10: WARNING: return of 0/1 in function 'unpack_nameX' with return type bool security/apparmor/policy_unpack.c:646:8-9: WARNING: return of 0/1 in function 'unpack_rlimits' with return type bool security/apparmor/policy_unpack.c:604:8-9: WARNING: return of 0/1 in function 'unpack_secmark' with return type bool security/apparmor/policy_unpack.c:538:8-9: WARNING: return of 0/1 in function 'unpack_trans_table' with return type bool security/apparmor/policy_unpack.c:327:9-10: WARNING: return of 0/1 in function 'unpack_u32' with return type bool security/apparmor/policy_unpack.c:345:9-10: WARNING: return of 0/1 in function 'unpack_u64' with return type bool security/apparmor/policy_unpack.c:309:9-10: WARNING: return of 0/1 in function 'unpack_u8' with return type bool security/apparmor/policy_unpack.c:568:8-9: WARNING: return of 0/1 in function 'unpack_xattrs' with return type bool security/apparmor/policy_unpack.c:1007:10-11: WARNING: return of 0/1 in function 'verify_dfa_xindex' with return type bool security/apparmor/policy_unpack.c:997:9-10: WARNING: return of 0/1 in function 'verify_xindex' with return type bool Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: John Johansen commit c84b80cd41e05395655459ecc652fa5ee05c257e Author: Mateusz Nosek Date: Tue Mar 3 19:30:23 2020 +0100 security/apparmor/label.c: Clean code by removing redundant instructions Previously 'label->proxy->label' value checking and conditional reassigning were done twice in the same function. The second one is redundant and can be removed. Signed-off-by: Mateusz Nosek Signed-off-by: John Johansen commit a7f6e07724ad43837b38d9350de2d1084f865472 Merge: efb59c94c8a6 b9bf73aed99e Author: Arnd Bergmann Date: Fri May 15 23:12:28 2020 +0200 Merge tag 'tegra-for-5.8-arm-core' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/soc ARM: tegra: Core changes for v5.8-rc1 This contains core changes needed for the CPU frequency scaling and CPU idle drivers on Tegra20 and Tegra30. * tag 'tegra-for-5.8-arm-core' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Create tegra20-cpufreq platform device on Tegra30 ARM: tegra: Don't enable PLLX while resuming from LP1 on Tegra30 ARM: tegra: Switch CPU to PLLP on resume from LP1 on Tegra30/114/124 ARM: tegra: Correct PL310 Auxiliary Control Register initialization ARM: tegra: Do not fully reinitialize L2 on resume ARM: tegra: Initialize r0 register for firmware wake-up firmware: tf: Different way of L2 cache enabling after LP2 suspend firmware: tegra: Make BPMP a regular driver Link: https://lore.kernel.org/r/20200515145311.1580134-10-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit efb59c94c8a62e043ab93599cb696db3b990f68a Merge: a875e0e5a2a3 96866b1a1d32 Author: Arnd Bergmann Date: Fri May 15 23:11:16 2020 +0200 Merge tag 'renesas-arm-soc-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/soc Renesas ARM SoC updates for v5.8 (take two) - Add debug-ll support for RZ/G1H. * tag 'renesas-arm-soc-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: debug-ll: Add support for r8a7742 Link: https://lore.kernel.org/r/20200515100547.14671-4-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit a875e0e5a2a307b4c35127f225d0b0b4be2bc75e Merge: 5df04698bd39 848685c25da9 Author: Arnd Bergmann Date: Fri May 15 23:04:40 2020 +0200 Merge tag 'vexpress-modules-for-soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux into arm/soc VExpress modularization This series enables building various Versatile Express platform drivers as modules. The primary target is the Fast Model FVP which is supported in Android. As Android is moving towards their GKI, or generic kernel, the hardware support has to be in modules. Currently ARCH_VEXPRESS enables several built-in only drivers. Some of these are needed, but some are only needed for older 32-bit VExpress platforms and can just be disabled. * tag 'vexpress-modules-for-soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: ARM: vexpress: Don't select VEXPRESS_CONFIG bus: vexpress-config: Support building as module vexpress: Move setting master site to vexpress-config bus bus: vexpress-config: simplify config bus probing bus: vexpress-config: Merge vexpress-syscfg into vexpress-config mfd: vexpress-sysreg: Support building as a module mfd: vexpress-sysreg: Use devres API variants mfd: vexpress-sysreg: Drop unused syscon child devices mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO clk: vexpress-osc: Support building as a module clk: vexpress-osc: Use the devres clock API variants clk: versatile: Only enable SP810 on 32-bit by default clk: versatile: Rework kconfig structure amba: Retry adding deferred devices at late_initcall arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS ARM: vexpress: Move vexpress_flags_set() into arch code Signed-off-by: Arnd Bergmann commit 5df04698bd39c71243220be353aa9def4e1bacd1 Merge: a7426a0e7f1e d33e3d542b6c Author: Arnd Bergmann Date: Fri May 15 23:03:04 2020 +0200 Merge tag 'omap-for-v5.8/soc-signed-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc SoC changes for omaps for v5.8 merge window SoC related changes for omaps: - Use ard instead of adrl for sleep34xx.S for clang - Stop selecting MIGHT_HAVE_CACHE_L2X0, it's already selected by ARCH_MULTI_V6_V7 - Make omap5_erratum_workaround_801819() and am43xx_get_rtc_base_addr() static * tag 'omap-for-v5.8/soc-signed-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: pm33xx-core: Make am43xx_get_rtc_base_addr static ARM: omap2: make omap5_erratum_workaround_801819 static ARM: omap2plus: Drop unneeded select of MIGHT_HAVE_CACHE_L2X0 ARM: OMAP2+: drop unnecessary adrl Link: https://lore.kernel.org/r/pull-1589387719-605999@atomide.com Signed-off-by: Arnd Bergmann commit a7426a0e7f1e8a889b176a9d1883112ff3cd6bd7 Merge: 3418b4c26a11 06b29212c3a2 Author: Arnd Bergmann Date: Fri May 15 22:58:20 2020 +0200 Merge tag 'samsung-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/soc Samsung mach/soc changes for v5.8 Cleanups and code simplifying. * tag 'samsung-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: samsung: Use devm_platform_ioremap_resource() to simplify code ARM: samsung: Omit superfluous error message in s3c_adc_probe() ARM: s3c64xx: convert to use i2c_new_client_device() Link: https://lore.kernel.org/r/20200512122922.5700-3-krzk@kernel.org Signed-off-by: Arnd Bergmann commit 3418b4c26a116907d21d355672250e1e27abd6d8 Merge: 93a50c102c29 446937a5056f Author: Arnd Bergmann Date: Fri May 15 22:57:36 2020 +0200 Merge tag 'arm-soc/for-5.8/soc' of https://github.com/Broadcom/stblinux into arm/soc This pull request contains Broadcom ARM-based machine/SoC changes for v5.8, please pull the following: - Florian removes a print of a kernel virtual address in the Brahma-B15 read-ahead cache driver * tag 'arm-soc/for-5.8/soc' of https://github.com/Broadcom/stblinux: ARM: mm: Remove virtual address print from B15 RAC driver Link: https://lore.kernel.org/r/20200511210522.28243-4-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 93a50c102c29ebacd8e9777182e17d054499e262 Merge: 125e07629f85 9442c09e784d Author: Arnd Bergmann Date: Fri May 15 22:57:17 2020 +0200 Merge tag 'arm-soc/for-5.8/maintainers' of https://github.com/Broadcom/stblinux into arm/soc This pull request contains Broadcom SoCs MAINTAINERS file update for v5.8, please pull the following: - Nicolas updates the git tree where all BCM2835 kernel development is happening now * tag 'arm-soc/for-5.8/maintainers' of https://github.com/Broadcom/stblinux: MAINTAINERS: Update Raspberry Pi development repository Link: https://lore.kernel.org/r/20200511210522.28243-3-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 125e07629f85378efbcecaf403217dc22e87884c Merge: b5bb63177d38 ed25e516a100 Author: Arnd Bergmann Date: Fri May 15 22:56:17 2020 +0200 Merge tag 'realtek-soc-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek into arm/soc Realtek Arm based SoC for v5.8 Introduce ARCH_REALTEK also for 32-bit arm, and update MAINTAINERS. * tag 'realtek-soc-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek: MAINTAINERS: Add Realtek arm DT files ARM: Prepare Realtek RTD1195 Link: https://lore.kernel.org/r/20200510232158.18477-1-afaerber@suse.de Signed-off-by: Arnd Bergmann commit b5bb63177d38cfa295a9c74962519fcddca94876 Author: Geert Uytterhoeven Date: Tue May 5 17:45:36 2020 +0200 ARM: mmp: Replace by The Marvell MMP platform code is not a clock provider, and just needs to call of_clk_init(). Hence it can include instead of . Link: https://lore.kernel.org/r/20200505154536.4099-4-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Acked-by: Lubomir Rintel Signed-off-by: Arnd Bergmann commit 1c2f05e72adef5ace094b686aa9069b5b206be74 Author: Geert Uytterhoeven Date: Tue May 5 17:45:35 2020 +0200 ARM: mediatek: Replace by The Mediatek platform code is not a clock provider, and just needs to call of_clk_init(). Hence it can include instead of . Link: https://lore.kernel.org/r/20200505154536.4099-3-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Signed-off-by: Arnd Bergmann commit 9bffcf42c6700114d4a602370a66816c1ebd2798 Author: Geert Uytterhoeven Date: Tue May 5 17:45:34 2020 +0200 ARM/time: Replace by The ARM time code is not a clock provider, and just needs to call of_clk_init(). Hence it can include instead of . Link: https://lore.kernel.org/r/20200505154536.4099-2-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Signed-off-by: Arnd Bergmann commit e5006671acc714d9dbfc6f8a618124c36f5cc6f8 Author: Rob Herring Date: Tue Apr 28 15:49:45 2020 -0500 clk: versatile: Drop the legacy IM-PD1 clock code Now that the non-DT IM-PD1 support code has been removed, drop the clock related code from clk-impd1.c. Link: https://lore.kernel.org/r/20200428204945.21067-1-robh@kernel.org Cc: Linus Walleij Cc: Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org Cc: linux-clk@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Reviewed-by: Stephen Boyd Signed-off-by: Arnd Bergmann commit 37d03aa5358a4a690c5c404313a359ad720c53f3 Merge: 7adb2781f731 135e7a156ae2 Author: Arnd Bergmann Date: Fri May 15 22:53:27 2020 +0200 Merge tag 'renesas-arm-soc-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/soc Renesas ARM SoC updates for v5.8 - Add Basic support for the new RZ/G1H SoC. * tag 'renesas-arm-soc-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: r8a7742: Basic SoC support Link: https://lore.kernel.org/r/20200430084849.1457-4-geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 7adb2781f731c832a0ab9654bd67a6971ce3f945 Merge: 0e698dfa2822 899895fb6dba Author: Arnd Bergmann Date: Fri May 15 22:52:20 2020 +0200 Merge tag 'versatile-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into arm/soc Versatile family updates for the v5.8 kernel series: - Drop unneeded SPARSE_IRQ selection. - Drop a bunch of other unneed selections already selected by multiplatform overall Kconfig. - Remove the dead sched_clock() code in plat-versatile. - Drop the mapping of the IB2 registers. Now handled by the PL11x DRM driver. - Add a bus driver for the Integrator/AP logic modules, along with its device tree bindings. - Retire the LM and IM-PD1 boardfile code: we now handle this with the bus driver and device tree. - Select some Integrator features needed for boot in its KConfig. - Fix a minor MAINTAINERS entry. * tag 'versatile-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator: MAINTAINERS: adjust to renaming physmap_of_versatile.c ARM: integrator: Add some Kconfig selections ARM: integrator: Retire LM and IM-PD1 boardfile code bus: Add driver for Integrator/AP logic modules bus: Add DT bindings for Integrator/AP logic modules ARM: versatile: Drop mapping IB2 module registers ARM: versatile: Remove dead sched_clock code ARM: realview: Drop unneeded select of multi-platform features ARM: integrator: Drop unneeded select of SPARSE_IRQ Link: https://lore.kernel.org/r/CACRpkdZR5LnnvrCnXodaTsam9-BuW+LkYSc+6jq-EisrRsq2eQ@mail.gmail.com Signed-off-by: Arnd Bergmann commit ec411e02b7a2e785a4ed9ed283207cd14f48699d Author: Mika Westerberg Date: Thu May 14 16:30:43 2020 +0300 PCI/PM: Assume ports without DLL Link Active train links in 100 ms Kai-Heng Feng reported that it takes a long time (> 1 s) to resume Thunderbolt-connected devices from both runtime suspend and system sleep (s2idle). This was because some Downstream Ports that support > 5 GT/s do not also support Data Link Layer Link Active reporting. Per PCIe r5.0 sec 6.6.1: With a Downstream Port that supports Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms after Link training completes before sending a Configuration Request to the device immediately below that Port. Software can determine when Link training completes by polling the Data Link Layer Link Active bit or by setting up an associated interrupt (see Section 6.7.3.3). Sec 7.5.3.6 requires such Ports to support DLL Link Active reporting, but at least the Intel JHL6240 Thunderbolt 3 Bridge [8086:15c0] and the Intel JHL7540 Thunderbolt 3 Bridge [8086:15ea] do not. Previously we tried to wait for Link training to complete, but since there was no DLL Link Active reporting, all we could do was wait the worst-case 1000 ms, then another 100 ms. Instead of using the supported speeds to determine whether to wait for Link training, check whether the port supports DLL Link Active reporting. The Ports in question do not, so we'll wait only the 100 ms required for Ports that support Link speeds <= 5 GT/s. This of course assumes these Ports always train the Link within 100 ms even if they are operating at > 5 GT/s, which is not required by the spec. [bhelgaas: commit log, comment] Link: https://bugzilla.kernel.org/show_bug.cgi?id=206837 Link: https://lore.kernel.org/r/20200514133043.27429-1-mika.westerberg@linux.intel.com Reported-by: Kai-Heng Feng Tested-by: Kai-Heng Feng Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas commit cdeb21da1783afe26a827eb62d61084f93720be9 Author: Eric Biggers Date: Tue May 12 16:32:49 2020 -0700 fscrypt: add fscrypt_add_test_dummy_key() Currently, the test_dummy_encryption mount option (which is used for encryption I/O testing with xfstests) uses v1 encryption policies, and it relies on userspace inserting a test key into the session keyring. We need test_dummy_encryption to support v2 encryption policies too. Requiring userspace to add the test key doesn't work well with v2 policies, since v2 policies only support the filesystem keyring (not the session keyring), and keys in the filesystem keyring are lost when the filesystem is unmounted. Hooking all test code that unmounts and re-mounts the filesystem would be difficult. Instead, let's make the filesystem automatically add the test key to its keyring when test_dummy_encryption is enabled. That puts the responsibility for choosing the test key on the kernel. We could just hard-code a key. But out of paranoia, let's first try using a per-boot random key, to prevent this code from being misused. A per-boot key will work as long as no one expects dummy-encrypted files to remain accessible after a reboot. (gce-xfstests doesn't.) Therefore, this patch adds a function fscrypt_add_test_dummy_key() which implements the above. The next patch will use it. Link: https://lore.kernel.org/r/20200512233251.118314-3-ebiggers@kernel.org Reviewed-by: Theodore Ts'o Reviewed-by: Jaegeuk Kim Signed-off-by: Eric Biggers commit 8b85996095049a2216c0a6b582330ec75913243c Author: Eric Biggers Date: Tue May 12 16:32:48 2020 -0700 linux/parser.h: add include guards is missing include guards. Add them. This is needed to allow declaring a function in that takes a substring_t parameter. Link: https://lore.kernel.org/r/20200512233251.118314-2-ebiggers@kernel.org Reviewed-by: Theodore Ts'o Reviewed-by: Jaegeuk Kim Signed-off-by: Eric Biggers commit da07f52d3caf6c24c6dbffb5500f379d819e04bd Merge: 93d43e58683e f85c1598ddfe Author: David S. Miller Date: Fri May 15 13:48:59 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Move the bpf verifier trace check into the new switch statement in HEAD. Resolve the overlapping changes in hinic, where bug fixes overlap the addition of VF support. Signed-off-by: David S. Miller commit 6a4d07cde5778174a35ffc445c1d1388479563ee Author: Jens Axboe Date: Fri May 15 14:30:38 2020 -0600 io_uring: file registration list and lock optimization There's no point in using list_del_init() on entries that are going away, and the associated lock is always used in process context so let's not use the IRQ disabling+saving variant of the spinlock. Signed-off-by: Jens Axboe commit fe9fd23e3b587c7ca9520717b213f88050c1d324 Author: Gustavo A. R. Silva Date: Thu May 7 13:43:56 2020 -0500 apparmor: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: John Johansen commit fb68ada81e65d593b51544fa43c284322107a742 Author: Cristian Klein Date: Fri May 8 17:26:04 2020 +0200 HID: Add quirks for Trust Panora Graphic Tablet The Trust Panora Graphic Tablet has two interfaces. Interface zero reports pen movement, pen pressure and pen buttons. Interface one reports tablet buttons and tablet scroll. Both use the mouse protocol. Without these quirks, libinput gets confused about what device it talks to. For completeness, here is the usbhid-dump: ``` $ sudo usbhid-dump -d 145f:0212 003:013:001:DESCRIPTOR 1588949402.559961 05 0D 09 01 A1 01 85 07 A1 02 09 00 75 08 95 07 81 02 C0 C0 09 0E A1 01 85 05 09 23 A1 02 09 52 09 53 25 0A 75 08 95 02 B1 02 C0 C0 05 0C 09 36 A1 00 85 06 05 09 19 01 29 20 15 00 25 01 95 20 75 01 81 02 C0 003:013:000:DESCRIPTOR 1588949402.563942 05 01 09 02 A1 01 85 08 09 01 A1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 05 81 01 05 01 09 30 09 31 09 38 09 00 15 81 25 7F 75 08 95 04 81 06 C0 C0 05 01 09 02 A1 01 85 09 09 01 A1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 05 81 01 05 01 09 30 09 31 26 FF 7F 95 02 75 10 81 02 05 0D 09 30 26 FF 03 95 01 75 10 81 02 C0 C0 05 01 09 00 A1 01 85 04 A1 00 26 FF 00 09 00 75 08 95 07 B1 02 C0 C0 ``` Signed-off-by: Cristian Klein Signed-off-by: Jiri Kosina commit f044baaff1eb7ae5aa7a36f1b7ad5bd8eeb672c4 Author: Bjorn Helgaas Date: Fri May 15 14:31:16 2020 -0500 PCI/PM: Adjust pcie_wait_for_link_delay() for caller delay The caller of pcie_wait_for_link_delay() specifies the time to wait after the link becomes active. When the downstream port doesn't support link active reporting, obviously we can't tell when the link becomes active, so we waited the worst-case time (1000 ms) plus 100 ms, ignoring the delay from the caller. Instead, wait for 1000 ms + the delay from the caller. Fixes: 4827d63891b6 ("PCI/PM: Add pcie_wait_for_link_delay()") Signed-off-by: Bjorn Helgaas commit 93d43e58683efd958a0421b932a273df74e0e008 Merge: ca1c933bcee9 729cd6436f35 Author: David S. Miller Date: Fri May 15 12:30:13 2020 -0700 Merge branch 'mptcp-fix-MP_JOIN-failure-handling' Paolo Abeni says: ==================== mptcp: fix MP_JOIN failure handling Currently if we hit an MP_JOIN failure on the third ack, the child socket is closed with reset, but the request socket is not deleted, causing weird behaviors. The main problem is that MPTCP's MP_JOIN code needs to plug it's own 'valid 3rd ack' checks and the current TCP callbacks do not allow that. This series tries to address the above shortcoming introducing a new MPTCP specific bit in a 'struct tcp_request_sock' hole, and leveraging that to allow tcp_check_req releasing the request socket when needed. The above allows cleaning-up a bit current MPTCP hooking in tcp_check_req(). An alternative solution, possibly cleaner but more invasive, would be changing the 'bool *own_req' syn_recv_sock() argument into 'int *req_status' and let MPTCP set it to 'REQ_DROP'. v1 -> v2: - be more conservative about drop_req initialization RFC -> v1: - move the drop_req bit inside tcp_request_sock (Eric) ==================== Signed-off-by: David S. Miller commit 729cd6436f359b6e618c2f14836d419f40444503 Author: Paolo Abeni Date: Fri May 15 19:22:17 2020 +0200 mptcp: cope better with MP_JOIN failure Currently, on MP_JOIN failure we reset the child socket, but leave the request socket untouched. tcp_check_req will deal with it according to the 'tcp_abort_on_overflow' sysctl value - by default the req socket will stay alive. The above leads to inconsistent behavior on MP JOIN failure, and bad listener overflow accounting. This patch addresses the issue leveraging the infrastructure just introduced to ask the TCP stack to drop the req on failure. The child socket is not freed anymore by subflow_syn_recv_sock(), instead it's moved to a dead state and will be disposed by the next sock_put done by the TCP stack, so that listener overflow accounting is not affected by MP JOIN failure. Signed-off-by: Paolo Abeni Reviewed-by: Christoph Paasch Reviewed-by: Mat Martineau Signed-off-by: David S. Miller commit 2f8a397d0a54b59c05e481523ab2a88a63d82d18 Author: Paolo Abeni Date: Fri May 15 19:22:16 2020 +0200 inet_connection_sock: factor out destroy helper. Move the steps to prepare an inet_connection_sock for forced disposal inside a separate helper. No functional changes inteded, this will just simplify the next patch. Signed-off-by: Paolo Abeni Reviewed-by: Christoph Paasch Reviewed-by: Mat Martineau Signed-off-by: David S. Miller commit 90bf45134d55d626ae2713cac50cda10c6c8b0c2 Author: Paolo Abeni Date: Fri May 15 19:22:15 2020 +0200 mptcp: add new sock flag to deal with join subflows MP_JOIN subflows must not land into the accept queue. Currently tcp_check_req() calls an mptcp specific helper to detect such scenario. Such helper leverages the subflow context to check for MP_JOIN subflows. We need to deal also with MP JOIN failures, even when the subflow context is not available due allocation failure. A possible solution would be changing the syn_recv_sock() signature to allow returning a more descriptive action/ error code and deal with that in tcp_check_req(). Since the above need is MPTCP specific, this patch instead uses a TCP request socket hole to add a MPTCP specific flag. Such flag is used by the MPTCP syn_recv_sock() to tell tcp_check_req() how to deal with the request socket. This change is a no-op for !MPTCP build, and makes the MPTCP code simpler. It allows also the next patch to deal correctly with MP JOIN failure. v1 -> v2: - be more conservative on drop_req initialization (Mat) RFC -> v1: - move the drop_req bit inside tcp_request_sock (Eric) Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Reviewed-by: Christoph Paasch Signed-off-by: David S. Miller commit 1574051e52cb4b5b7f7509cfd729b76ca1117808 Author: Xiaochun Lee Date: Thu May 14 23:31:07 2020 -0400 x86/PCI: Mark Intel C620 MROMs as having non-compliant BARs The Intel C620 Platform Controller Hub has MROM functions that have non-PCI registers (undocumented in the public spec) where BAR 0 is supposed to be, which results in messages like this: pci 0000:00:11.0: [Firmware Bug]: reg 0x30: invalid BAR (can't size) Mark these MROM functions as having non-compliant BARs so we don't try to probe any of them. There are no other BARs on these devices. See the Intel C620 Series Chipset Platform Controller Hub Datasheet, May 2019, Document Number 336067-007US, sec 2.1, 35.5, 35.6. [bhelgaas: commit log, add 0xa26d] Link: https://lore.kernel.org/r/1589513467-17070-1-git-send-email-lixiaochun.2888@163.com Signed-off-by: Xiaochun Lee Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit fa4aa8a530b246eeaa1619ec3e3ee4e2a396a1bd Author: Dinh Nguyen Date: Fri Apr 3 18:22:20 2020 -0500 arm64: defconfig: Add LEDS_TRIGGER_TIMER Add support for LEDS_TRIGGER_TIMER. Signed-off-by: Dinh Nguyen commit 39f3d3bb05a43414905aba33f6250e8ddaea38b6 Author: Sharat Masetty Date: Fri May 1 16:00:35 2020 +0530 arm64: dts: qcom: sc7180: Add A618 gpu dt blob This patch adds the required dt nodes and properties to enabled A618 GPU. Tested-by: Douglas Anderson Reviewed-by: Douglas Anderson Signed-off-by: Sharat Masetty Link: https://lore.kernel.org/r/1588329036-18732-1-git-send-email-smasetty@codeaurora.org Signed-off-by: Bjorn Andersson commit 13c7a1683e6372500695ca1ac4fd9cfab2d81be6 Author: Sharat Masetty Date: Fri May 1 16:00:36 2020 +0530 dt-bindings: arm-smmu: Add sc7180 compatible string This patch simply adds a new compatible string for SC7180 platform. Reviewed-by: Douglas Anderson Signed-off-by: Sharat Masetty Link: https://lore.kernel.org/r/1588329036-18732-2-git-send-email-smasetty@codeaurora.org Signed-off-by: Bjorn Andersson commit d2a8cfc6f320263b90ca523590a339661d0f4fae Author: Douglas Anderson Date: Mon May 4 10:50:19 2020 -0700 soc: qcom: rpmh-rsc: Remove the pm_lock It has been postulated that the pm_lock is bad for performance because a CPU currently running rpmh_flush() could block other CPUs from coming out of idle. Similarly CPUs coming out of / going into idle all need to contend with each other for the spinlock just to update the variable tracking who's in PM. Let's optimize this a bit. Specifically: - Use a count rather than a bitmask. This is faster to access and also means we can use the atomic_inc_return() function to really detect who the last one to enter PM was. - Accept that it's OK if we race and are doing the flush (because we think we're last) while another CPU is coming out of idle. As long as we block that CPU if/when it tries to do an active-only transfer we're OK. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200504104917.v6.5.I295cb72bc5334a2af80313cbe97cb5c9dcb1442c@changeid Signed-off-by: Bjorn Andersson commit 555701a45f146673c8961f084b6880c637d41129 Author: Douglas Anderson Date: Mon May 4 10:50:18 2020 -0700 soc: qcom: rpmh-rsc: Simplify locking by eliminating the per-TCS lock The rpmh-rsc code had both a driver-level lock (sometimes referred to in comments as drv->lock) and a lock per-TCS. The idea was supposed to be that there would be times where you could get by with just locking a TCS lock and therefor other RPMH users wouldn't be blocked. The above didn't work out so well. Looking at tcs_write() the bigger drv->lock was held for most of the function anyway. Only the __tcs_buffer_write() and __tcs_set_trigger() calls were called without holding the drv->lock. It actually turns out that in tcs_write() we don't need to hold the drv->lock for those function calls anyway even if the per-TCS lock isn't there anymore. From the newly added comments in the code, this is because: - We marked "tcs_in_use" under lock. - Once "tcs_in_use" has been marked nobody else could be writing to these registers until the interrupt goes off. - The interrupt can't go off until we trigger w/ the last line of __tcs_set_trigger(). Thus, from a tcs_write() point of view, the per-TCS lock was useless. Looking at rpmh_rsc_write_ctrl_data(), only the per-TCS lock was held. It turns out, though, that this function already needs to be called with the equivalent of the drv->lock held anyway (we either need to hold drv->lock as we will in a future patch or we need to know no other CPUs could be running as happens today). Specifically rpmh_rsc_write_ctrl_data() might be writing to a TCS that has been borrowed for writing an active transation but it never checks this. Let's eliminate this extra overhead and avoid possible AB BA locking headaches. Suggested-by: Maulik Shah Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200504104917.v6.4.Ib8dccfdb10bf6b1fb1d600ca1c21d9c0db1ef746@changeid Signed-off-by: Bjorn Andersson commit b5945214b76a1f22929481724ffd448000ede914 Author: Douglas Anderson Date: Mon May 4 10:50:17 2020 -0700 kernel/cpu_pm: Fix uninitted local in cpu_pm cpu_pm_notify() is basically a wrapper of notifier_call_chain(). notifier_call_chain() doesn't initialize *nr_calls to 0 before it starts incrementing it--presumably it's up to the callers to do this. Unfortunately the callers of cpu_pm_notify() don't init *nr_calls. This potentially means you could get too many or two few calls to CPU_PM_ENTER_FAILED or CPU_CLUSTER_PM_ENTER_FAILED depending on the luck of the stack. Let's fix this. Fixes: ab10023e0088 ("cpu_pm: Add cpu power management notifiers") Cc: stable@vger.kernel.org Cc: Rafael J. Wysocki Reviewed-by: Stephen Boyd Reviewed-by: Greg Kroah-Hartman Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200504104917.v6.3.I2d44fc0053d019f239527a4e5829416714b7e299@changeid Signed-off-by: Bjorn Andersson commit c45def5d804abaa48c205f8ba5cd52bfbeeae70c Author: Douglas Anderson Date: Mon May 4 10:50:16 2020 -0700 soc: qcom: rpmh-rsc: We aren't notified of our own failure w/ NOTIFY_BAD When a PM Notifier returns NOTIFY_BAD it doesn't get called with CPU_PM_ENTER_FAILED. It only get called for CPU_PM_ENTER_FAILED if someone else (further down the notifier chain) returns NOTIFY_BAD. Handle this case by taking our CPU out of the list of ones that have entered PM. Without this it's possible we could detect that the last CPU went down (and we would flush) even if some CPU was alive. That's not good since our flushing routines currently assume they're running on the last CPU for mutual exclusion. Fixes: 985427f997b6 ("soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches") Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200504104917.v6.2.I1927d1bca2569a27b2d04986baf285027f0818a2@changeid Signed-off-by: Bjorn Andersson commit 1143c36656b8dccf0ece93053502a147d3c60961 Author: Douglas Anderson Date: Mon May 4 10:50:15 2020 -0700 soc: qcom: rpmh-rsc: Correctly ignore CPU_CLUSTER_PM notifications Our switch statement doesn't have entries for CPU_CLUSTER_PM_ENTER, CPU_CLUSTER_PM_ENTER_FAILED, and CPU_CLUSTER_PM_EXIT and doesn't have a default. This means that we'll try to do a flush in those cases but we won't necessarily be the last CPU down. That's not so ideal since our (lack of) locking assumes we're on the last CPU. Luckily this isn't as big a problem as you'd think since (at least on the SoC I tested) we don't get these notifications except on full system suspend. ...and on full system suspend we get them on the last CPU down. That means that the worst problem we hit is flushing twice. Still, it's good to make it correct. Reviewed-by: Stephen Boyd Fixes: 985427f997b6 ("soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches") Reported-by: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200504104917.v6.1.Ic7096b3b9b7828cdd41cd5469a6dee5eb6abf549@changeid Signed-off-by: Bjorn Andersson commit 7e55a19cf6e70ce08964b46dbbfbdb07fbc995fc Author: Stefano Garzarella Date: Fri May 15 18:38:05 2020 +0200 io_uring: add IORING_CQ_EVENTFD_DISABLED to the CQ ring flags This new flag should be set/clear from the application to disable/enable eventfd notifications when a request is completed and queued to the CQ ring. Before this patch, notifications were always sent if an eventfd is registered, so IORING_CQ_EVENTFD_DISABLED is not set during the initialization. It will be up to the application to set the flag after initialization if no notifications are required at the beginning. Signed-off-by: Stefano Garzarella Signed-off-by: Jens Axboe commit 0d9b5b3af134cddfdc1dd31d41946a0ad389bbf2 Author: Stefano Garzarella Date: Fri May 15 18:38:04 2020 +0200 io_uring: add 'cq_flags' field for the CQ ring This patch adds the new 'cq_flags' field that should be written by the application and read by the kernel. This new field is available to the userspace application through 'cq_off.flags'. We are using 4-bytes previously reserved and set to zero. This means that if the application finds this field to zero, then the new functionality is not supported. In the next patch we will introduce the first flag available. Signed-off-by: Stefano Garzarella Signed-off-by: Jens Axboe commit 95ca6d73a8a97ba343082746dbf935863b76375a Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:54 2020 +0200 docs: move locking-specific documents to locking/ Several files under Documentation/*.txt describe some type of locking API. Move them to locking/ subdir and add to the locking/index.rst index file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/dd833a10bbd0b2c1461d78913f5ec28a7e27f00b.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 9184027f0aaf6c95856bb57d04d0fa0b16fd9981 Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:53 2020 +0200 docs: move digsig docs to the security book Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6af5365404c7bd9d008e7e3a77ba83587fd33012.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit ca1c933bcee9393d8a83c6be1093471e0c3b655d Author: Oleksij Rempel Date: Thu May 14 21:42:18 2020 +0200 net: phy: tja11xx: execute cable test on link up A typical 100Base-T1 link should be always connected. If the link is in a shot or open state, it is a failure. In most cases, we won't be able to automatically handle this issue, but we need to log it or notify user (if possible). With this patch, the cable will be tested on "ip l s dev .. up" attempt and send ethnl notification to the user space. This patch was tested with TJA1102 PHY and "ethtool --monitor" command. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 1ac00669c35e02c3ce3a5f7c02e65ac6edca6595 Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:52 2020 +0200 docs: move the kref doc into the core-api book This document covers core kernel objects. So, add it into the core-api book. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/f385af13b4a6d3ff8c89beedd4506900e79ca72e.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e00b0ab86c79c4e82eb821ac6d6a3daef2e3e600 Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:51 2020 +0200 docs: add IRQ documentation at the core-api book There are 4 IRQ documentation files under Documentation/*.txt. Move them into a new directory (core-api/irq) and add a new index file for it. While here, use a title markup for the Debugging section of the irq-domain.rst file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2da7485c3718e1442e6b4c2dd66857b776e8899b.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a74e2a226452ea75d26b1f83860bff91a11da1ac Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:50 2020 +0200 docs: debugging-via-ohci1394.txt: add it to the core-api book There is an special chapter inside the core-api book about some debug infrastructure like tracepoints and debug objects. It sounded to me that this is the best place to add a chapter explaining how to use a FireWire controller to do remote kernel debugging, as explained on this document. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9b489d36d08ad89d3ad5aefef1f52a0715b29716.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 18bceab101adde8f38de76016bc77f3f25cf22f4 Author: Jens Axboe Date: Fri May 15 11:56:54 2020 -0600 io_uring: allow POLL_ADD with double poll_wait() users Some file descriptors use separate waitqueues for their f_ops->poll() handler, most commonly one for read and one for write. The io_uring poll implementation doesn't work with that, as the 2nd poll_wait() call will cause the io_uring poll request to -EINVAL. This affects (at least) tty devices and /dev/random as well. This is a big problem for event loops where some file descriptors work, and others don't. With this fix, io_uring handles multiple waitqueues. Signed-off-by: Jens Axboe commit b0ed0bbfb3046ed127f6004b5893ccb6cdd9ba90 Author: Kevin Lo Date: Sat May 16 01:24:47 2020 +0800 net: phy: broadcom: add support for BCM54811 PHY The BCM54811 PHY shares many similarities with the already supported BCM54810 PHY but additionally requires some semi-unique configuration. Signed-off-by: Kevin Lo Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 4a38aed2a0a729ccecd84dca5b76d827b9e1294d Author: Jens Axboe Date: Thu May 14 17:21:15 2020 -0600 io_uring: batch reap of dead file registrations We currently embed and queue a work item per fixed_file_ref_node that we update, but if the workload does a lot of these, then the associated kworker-events overhead can become quite noticeable. Since we rarely need to wait on these, batch them at 1 second intervals instead. If we do need to wait for them, we just flush the pending delayed work. Signed-off-by: Jens Axboe commit 283b69bf7948c2470b5b7085bf291f834f3b9d95 Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:49 2020 +0200 docs: fix references for ipmi.rst file As this file got moved, fix references for it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/b6c1ded590f27198de15b16237509128e55fa810.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit b25fc491cb6aa5ec9d15a4dc32c09c9119363a52 Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:48 2020 +0200 docs: move IPMI.txt to the driver API book The IPMI is under drivers/char. This doc describes the kAPI part of the IPMI (mainly). So, move it to the driver-api directory and add it to the corresponding index.rst file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ae4edbc6753dc522cb93de36800978e3b58e0cfb.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 7db097dcddef6718aee850d9d9ba4a29c8a9c7d9 Author: Serge Semin Date: Fri May 15 13:47:40 2020 +0300 spi: dw: Add Tx/Rx DMA properties Since commit 22d48ad7bfac ("spi: dw: Add Elkhart Lake PSE DMA support") the spi-dw-mid.c module supports a platform DMA engine handling the DW APB SSI controller requests. Lets alter the DW SPI bindings file to accept the Rx and Tx DMA line specifiers. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Allison Randal Cc: Andy Shevchenko Cc: Gareth Williams Cc: linux-mips@vger.kernel.org Link: https://lore.kernel.org/r/20200515104758.6934-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit d42d118cfc22759231e779ebb89a99b15ca22bdf Merge: 3430223d393d 5148e5950c67 Author: David S. Miller Date: Fri May 15 10:54:08 2020 -0700 Merge branch 'cxgb4-improve-and-tune-TC-MQPRIO-offload' Rahul Lakkireddy says: ==================== cxgb4: improve and tune TC-MQPRIO offload Patch 1 improves the Tx path's credit request and recovery mechanism when running under heavy load. Patch 2 adds ability to tune the burst buffer sizes of all traffic classes to improve performance for <= 1500 MTU, under heavy load. Patch 3 adds support to track EOTIDs and dump software queue contexts used by TC-MQPRIO offload. ==================== Signed-off-by: David S. Miller commit 5148e5950c675a26ab1f5eb4b291e9bd986116c9 Author: Rahul Lakkireddy Date: Fri May 15 22:41:05 2020 +0530 cxgb4: add EOTID tracking and software context dump Rework and add support for dumping EOTID software context used by TC-MQPRIO. Also track number of EOTIDs in use. Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 4bccfc036abbdf510de808925c646c8c49e0309e Author: Rahul Lakkireddy Date: Fri May 15 22:41:04 2020 +0530 cxgb4: tune burst buffer size for TC-MQPRIO offload For each traffic class, firmware handles up to 4 * MTU amount of data per burst cycle. Under heavy load, this small buffer size is a bottleneck when buffering large TSO packets in <= 1500 MTU case. Increase the burst buffer size to 8 * MTU when supported. Also, keep the driver's traffic class configuration API similar to the firmware API counterpart. Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 4f1d97262d58e0f493d03de4938bce736ac3cf3d Author: Rahul Lakkireddy Date: Fri May 15 22:41:03 2020 +0530 cxgb4: improve credits recovery in TC-MQPRIO Tx path Request credit update for every half credits consumed, including the current request. Also, avoid re-trying to post packets when there are no credits left. The credit update reply via interrupt will eventually restore the credits and will invoke the Tx path again. Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller commit 728c1471b54499e618fb8586852ac5e15a2c95ee Author: Mauro Carvalho Chehab Date: Fri May 1 17:37:45 2020 +0200 docs: move DMA kAPI to Documentation/core-api Move those files to the core-api, where they belong, renaming them to ReST and adding to the core API index file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a1517185418cb9d987f566ef85a5dd5c7c99f34e.1588345503.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit b271cf339b03267a7abde4454ea881de9b3af614 Merge: eb1262e3cc8b 0327f0b881dc Author: Mark Brown Date: Fri May 15 18:50:07 2020 +0100 Merge series "spi: dw: Add generic DW DMA controller support" from Serge Semin : Baikal-T1 SoC provides a DW DMA controller to perform low-speed peripherals Mem-to-Dev and Dev-to-Mem transaction. This is also applicable to the DW APB SSI devices embedded into the SoC. Currently the DMA-based transfers are supported by the DW APB SPI driver only as a middle layer code for Intel MID/Elkhart PCI devices. Seeing the same code can be used for normal platform DMAC device we introduced a set of patches to fix it within this series. First of all we need to add the Tx and Rx DMA channels support into the DW APB SSI binding. Then there are several fixes and cleanups provided as a initial preparation for the Generic DMA support integration: add Tx/Rx finish wait methods, clear DMAC register when done or stopped, Fix native CS being unset, enable interrupts in accordance with DMA xfer mode, discard static DW DMA slave structures, discard unused void priv pointer and dma_width member of the dw_spi structure, provide the DMA Tx/Rx burst length parametrisation and make sure it's optionally set in accordance with the DMA max-burst capability. In order to have the DW APB SSI MMIO driver working with DMA we need to initialize the paddr field with the physical base address of the DW APB SSI registers space. Then we unpin the Intel MID specific code from the generic DMA one and placed it into the spi-dw-pci.c driver, which is a better place for it anyway. After that the naming cleanups are performed since the code is going to be used for a generic DMAC device. Finally the Generic DMA initialization can be added to the generic version of the DW APB SSI IP. Last but not least we traditionally convert the legacy plain text-based dt-binding file with yaml-based one and as a cherry on a cake replace the manually written DebugFS registers read method with a ready-to-use for the same purpose regset32 DebugFS interface usage. This patchset is rebased and tested on the spi/for-next (5.7-rc5): base-commit: fe9fce6b2cf3 ("Merge remote-tracking branch 'spi/for-5.8' into spi-next") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Allison Randal Cc: Andy Shevchenko Cc: Gareth Williams Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-spi@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Changelog v2: - Rebase on top of the spi repository for-next branch. - Move bindings conversion patch to the tail of the series. - Move fixes to the head of the series. - Apply as many changes as possible to be applied the Generic DMA functionality support is added and the spi-dw-mid is moved to the spi-dw-dma driver. - Discard patch "spi: dw: Fix dma_slave_config used partly uninitialized" since the problem has already been fixed. - Add new patch "spi: dw: Discard unused void priv pointer". - Add new patch "spi: dw: Discard dma_width member of the dw_spi structure". n_bytes member of the DW SPI data can be used instead. - Build the DMA functionality into the DW APB SSI core if required instead of creating a separate kernel module. - Use conditional statement instead of the ternary operator in the ref clock getter. Serge Semin (19): dt-bindings: spi: dw: Add Tx/Rx DMA properties spi: dw: Add Tx/Rx finish wait methods to the MID DMA spi: dw: Clear DMAC register when done or stopped spi: dw: Fix native CS being unset spi: dw: Enable interrupts in accordance with DMA xfer mode spi: dw: Discard static DW DMA slave structures spi: dw: Discard unused void priv pointer spi: dw: Discard dma_width member of the dw_spi structure spi: dw: Parameterize the DMA Rx/Tx burst length spi: dw: Use DMA max burst to set the request thresholds spi: dw: Initialize paddr in DW SPI MMIO private data spi: dw: Fix Rx-only DMA transfers spi: dw: Move Non-DMA code to the DW PCIe-SPI driver spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core spi: dw: Cleanup generic DW DMA code namings spi: dw: Add DMA support to the DW SPI MMIO driver spi: dw: Use regset32 DebugFS method to create regdump file dt-bindings: spi: Convert DW SPI binding to DT schema .../bindings/spi/snps,dw-apb-ssi.txt | 42 --- .../bindings/spi/snps,dw-apb-ssi.yaml | 127 +++++++++ .../devicetree/bindings/spi/spi-dw.txt | 24 -- drivers/spi/Kconfig | 15 +- drivers/spi/Makefile | 7 +- drivers/spi/{spi-dw-mid.c => spi-dw-dma.c} | 257 ++++++++++-------- drivers/spi/spi-dw-mmio.c | 9 +- drivers/spi/spi-dw-pci.c | 50 +++- drivers/spi/spi-dw.c | 98 +++---- drivers/spi/spi-dw.h | 33 ++- 10 files changed, 405 insertions(+), 257 deletions(-) delete mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt create mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml delete mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt rename drivers/spi/{spi-dw-mid.c => spi-dw-dma.c} (53%) -- 2.25.1 commit eb1262e3cc8b529218e085254888c90f096a5da5 Author: Chris Ruehl Date: Mon May 11 16:30:22 2020 +0800 spi: spi-rockchip: use num-cs property and ctlr->enable_gpiods The original implementation set num_chipselect to ROCKCHIP_SPI_MAX_CS_NUM (2) which seems wrong here. spi0 has 2 native cs, all others just one. With enable and use of cs_gpiods / GPIO CS, its correct to set the num_chipselect from the num-cs property and set max_native_cs with the define. If num-cs is missing the default set to num_chipselect = 1. Signed-off-by: Chris Ruehl Link: https://lore.kernel.org/r/20200511083022.23678-4-chris.ruehl@gtsys.com.hk Signed-off-by: Mark Brown commit d065f41a3f0d0974593122e4864e158bb945696e Author: Chris Ruehl Date: Mon May 11 16:30:21 2020 +0800 spi: spi-rockchip: add support for spi slave mode Add support for spi slave mode in spi-rockchip. The register map has an entry for it. If spi-slave is set in dts, set this corresponding bit and add to mode_bits the SPI_NO_CS, allow slave mode without explicit CS use. Slave abort function had been added. Signed-off-by: Chris Ruehl Link: https://lore.kernel.org/r/20200511083022.23678-3-chris.ruehl@gtsys.com.hk Signed-off-by: Mark Brown commit d66571a20f68f153c045c9822bf4c288e7511168 Author: Chris Ruehl Date: Mon May 11 16:30:20 2020 +0800 spi: spi-rockchip: cleanup use struct spi_controller Cleanup, move from the compatibily layer struct spi_master over to struct spi_controller, and rename the related function calls. Signed-off-by: Chris Ruehl Link: https://lore.kernel.org/r/20200511083022.23678-2-chris.ruehl@gtsys.com.hk Signed-off-by: Mark Brown commit 3430223d393dd23734cc87177d704449cfc294a8 Merge: 0141792f8b73 ed24a7a852b5 Author: David S. Miller Date: Fri May 15 10:43:52 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2020-05-15 The following pull-request contains BPF updates for your *net-next* tree. We've added 37 non-merge commits during the last 1 day(s) which contain a total of 67 files changed, 741 insertions(+), 252 deletions(-). The main changes are: 1) bpf_xdp_adjust_tail() now allows to grow the tail as well, from Jesper. 2) bpftool can probe CONFIG_HZ, from Daniel. 3) CAP_BPF is introduced to isolate user processes that use BPF infra and to secure BPF networking services by dropping CAP_SYS_ADMIN requirement in certain cases, from Alexei. ==================== Signed-off-by: David S. Miller commit 0141792f8b7300006b874dda1c35acd0abd90d9d Author: DENG Qingfang Date: Fri May 15 23:25:55 2020 +0800 net: dsa: mt7530: fix VLAN setup Allow DSA to add VLAN entries even if VLAN filtering is disabled, so enabling it will not block the traffic of existent ports in the bridge Signed-off-by: DENG Qingfang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit cd2809cca24356c4d7c47030532d880b462fc8f9 Merge: 2e186a2cf8c7 e7534fd42a99 Author: David S. Miller Date: Fri May 15 10:23:11 2020 -0700 Merge branch 'Implement-classifier-action-terse-dump-mode' Vlad Buslov says: ==================== Implement classifier-action terse dump mode Output rate of current upstream kernel TC filter dump implementation if relatively low (~100k rules/sec depending on configuration). This constraint impacts performance of software switch implementation that rely on TC for their datapath implementation and periodically call TC filter dump to update rules stats. Moreover, TC filter dump output a lot of static data that don't change during the filter lifecycle (filter key, specific action details, etc.) which constitutes significant portion of payload on resulting netlink packets and increases amount of syscalls necessary to dump all filters on particular Qdisc. In order to significantly improve filter dump rate this patch sets implement new mode of TC filter dump operation named "terse dump" mode. In this mode only parameters necessary to identify the filter (handle, action cookie, etc.) and data that can change during filter lifecycle (filter flags, action stats, etc.) are preserved in dump output while everything else is omitted. Userspace API is implemented using new TCA_DUMP_FLAGS tlv with only available flag value TCA_DUMP_FLAGS_TERSE. Internally, new API requires individual classifier support (new tcf_proto_ops->terse_dump() callback). Support for action terse dump is implemented in act API and don't require changing individual action implementations. The following table provides performance comparison between regular filter dump and new terse dump mode for two classifier-action profiles: one minimal config with L2 flower classifier and single gact action and another heavier config with L2+5tuple flower classifier with tunnel_key+mirred actions. Classifier-action type | dump | terse dump | X improvement | (rules/sec) | (rules/sec) | -----------------------------+-------------+-------------+--------------- L2 with gact | 141.8 | 293.2 | 2.07 L2+5tuple tunnel_key+mirred | 76.4 | 198.8 | 2.60 Benchmark details: to measure the rate tc filter dump and terse dump commands are invoked on ingress Qdisc that have one million filters configured using following commands. > time sudo tc -s filter show dev ens1f0 ingress >/dev/null > time sudo tc -s filter show terse dev ens1f0 ingress >/dev/null Value in results table is calculated by dividing 1000000 total rules by "real" time reported by time command. Setup details: 2x Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz, 32GB memory ==================== Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit b17b24fc3c10048502196fff56dcaf13938d1e75 Author: Waiman Long Date: Wed May 6 12:22:17 2020 -0400 doc: Fix some errors in ras.rst Make some miscellaneous fixes to the first paragraph of "ECC memory": - Change the incorrect "74 bits" to "72 bits". - Change "mentioned on" to "mentioned in". - Remove the extra "extra". - Rephrase some sentences as suggested by Matthew Wilcox. Signed-off-by: Waiman Long Reviewed-by: Matthew Wilcox (Oracle) Link: https://lore.kernel.org/r/20200506162217.16633-1-longman@redhat.com Signed-off-by: Jonathan Corbet commit 77691ee92d4abdc926c60b6fa1a5cbbe935e1244 Author: Vlastimil Babka Date: Thu May 7 14:02:17 2020 +0200 Documentation: update numastat explanation During recent patch discussion [1] it became apparent that the "other_node" definition in the numastat documentation has always been different from actual implementation. It was also noted that the stats can be innacurate on systems with memoryless nodes. This patch corrects the other_node definition (with minor tweaks to two more definitions), adds a note about memoryless nodes and also two introductory paragraphs to the numastat documentation. [1] https://lore.kernel.org/linux-mm/20200504070304.127361-1-sandipan@linux.ibm.com/T/#u Signed-off-by: Vlastimil Babka Acked-by: Sandipan Das Acked-by: Michal Hocko Link: https://lore.kernel.org/r/20200507120217.12313-1-vbabka@suse.cz Signed-off-by: Jonathan Corbet commit ea8fdf1a40e9941e7eca76c057abd8bc03acb40e Author: Kevin Hao Date: Fri May 8 22:09:24 2020 +0800 docs: vm: page_frags.rst: Fix the reference of stale function The __netdev_alloc_frag() has been dropped by commit 7ba7aeabbaba ("net: Don't disable interrupts in napi_alloc_frag()"). So replace it with netdev_alloc_frag(). Signed-off-by: Kevin Hao Link: https://lore.kernel.org/r/20200508140924.18220-1-haokexin@gmail.com Signed-off-by: Jonathan Corbet commit fd79cfd71221248ecd6a6d1aa97e557e2cd3434f Author: Rikard Falkeborn Date: Fri May 8 23:29:49 2020 +0200 docs: debugfs: Update struct debugfs_reg32 definition Update the docs to match the implementation, both the definition of struct debugfs_regset32 and the definition of debugfs_print_regs32(). Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200508212949.2867-1-rikard.falkeborn@gmail.com Signed-off-by: Jonathan Corbet commit 036168e3df3688ff4bf0836f72f68da490fe8c47 Author: Chucheng Luo Date: Sat May 9 01:05:35 2020 -0700 doc: zh_CN: add translatation for debugfs.txt Translate Documentation/filesystems/debugfs.txt into Chinese. Signed-off-by: Chucheng Luo Reviewed-by: Alex Shi Signed-off-by: Wang Wenhu [rebase for upstream conflict and minor change of subject] Link: https://lore.kernel.org/linux-doc/20200408021528.14062-1-luochucheng@vivo.com/ Link: https://lore.kernel.org/r/20200509080535.7625-1-wenhu.wang@vivo.com Signed-off-by: Jonathan Corbet commit 0327f0b881dc5645c7ba670331e822cdaa8c5e09 Author: Serge Semin Date: Fri May 15 13:47:42 2020 +0300 spi: dw: Clear DMAC register when done or stopped If DMAC register is left uncleared any further DMAless transfers may cause the DMAC hardware handshaking interface getting activated. So the next DMA-based Rx/Tx transaction will be started right after the dma_async_issue_pending() method is invoked even if no DMATDLR/DMARDLR conditions are met. This at the same time may cause the Tx/Rx FIFO buffers underrun/overrun. In order to fix this we must clear DMAC register after a current DMA-based transaction is finished. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200515104758.6934-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 77810d484f4f28107391787dfa1c6c53d994c4fc Author: Serge Semin Date: Fri May 15 13:47:50 2020 +0300 spi: dw: Initialize paddr in DW SPI MMIO private data This field is used only for the DW SPI DMA code initialization, that's why there were no problems with it being uninitialized in Dw SPI MMIO driver. Since in a further patch we are going to introduce the DW SPI DMA support in the MMIO version of the driver, lets set the field with the physical address of the DW SPI controller registers region. Co-developed-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Georgy Vlasov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200515104758.6934-12-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 9aea644ca17b94f82ad7fa767cbc4509642f4420 Author: Serge Semin Date: Fri May 15 13:47:43 2020 +0300 spi: dw: Fix native CS being unset Commit 6e0a32d6f376 ("spi: dw: Fix default polarity of native chipselect") attempted to fix the problem when GPIO active-high chip-select is utilized to communicate with some SPI slave. It fixed the problem, but broke the normal native CS support. At the same time the reversion commit ada9e3fcc175 ("spi: dw: Correct handling of native chipselect") didn't solve the problem either, since it just inverted the set_cs() polarity perception without taking into account that CS-high might be applicable. Here is what is done to finally fix the problem. DW SPI controller demands any native CS being set in order to proceed with data transfer. So in order to activate the SPI communications we must set any bit in the Slave Select DW SPI controller register no matter whether the platform requests the GPIO- or native CS. Preferably it should be the bit corresponding to the SPI slave CS number. But currently the dw_spi_set_cs() method activates the chip-select only if the second argument is false. Since the second argument of the set_cs callback is expected to be a boolean with "is-high" semantics (actual chip-select pin state value), the bit in the DW SPI Slave Select register will be set only if SPI core requests the driver to set the CS in the low state. So this will work for active-low GPIO-based CS case, and won't work for active-high CS setting the bit when SPI core actually needs to deactivate the CS. This commit fixes the problem for all described cases. So no matter whether an SPI slave needs GPIO- or native-based CS with active-high or low signal the corresponding bit will be set in SER. Signed-off-by: Serge Semin Fixes: ada9e3fcc175 ("spi: dw: Correct handling of native chipselect") Fixes: 6e0a32d6f376 ("spi: dw: Fix default polarity of native chipselect") Reviewed-by: Charles Keepax Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20200515104758.6934-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 2f4c33063ad713e3a5b63002cf8362846e78bd71 Author: Stephen Kitt Date: Fri May 15 18:02:22 2020 +0200 docs: sysctl/kernel: document ngroups_max This is a read-only export of NGROUPS_MAX, so this patch also changes the declarations in kernel/sysctl.c to const. Signed-off-by: Stephen Kitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20200515160222.7994-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit e7534fd42a99f2dcca022d2c9a37adf82ad07998 Author: Vlad Buslov Date: Fri May 15 14:40:14 2020 +0300 selftests: implement flower classifier terse dump tests Implement two basic tests to verify terse dump functionality of flower classifier: - Test that verifies that terse dump works. - Test that verifies that terse dump doesn't print filter key. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 0348451db9fffebd01d7b496e108dd729c2fcb24 Author: Vlad Buslov Date: Fri May 15 14:40:13 2020 +0300 net: sched: cls_flower: implement terse dump support Implement tcf_proto_ops->terse_dump() callback for flower classifier. Only dump handle, flags and action data in terse mode. Signed-off-by: Vlad Buslov Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit ca44b738e59420ae73d9e04a1be630a405e3a0f1 Author: Vlad Buslov Date: Fri May 15 14:40:12 2020 +0300 net: sched: implement terse dump support in act Extend tcf_action_dump() with boolean argument 'terse' that is used to request terse-mode action dump. In terse mode only essential data needed to identify particular action (action kind, cookie, etc.) and its stats is put to resulting skb and everything else is omitted. Implement tcf_exts_terse_dump() helper in cls API that is intended to be used to request terse dump of all exts (actions) attached to the filter. Signed-off-by: Vlad Buslov Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit f8ab1807a9c9aa14478920e64d1c9d3685aae26f Author: Vlad Buslov Date: Fri May 15 14:40:11 2020 +0300 net: sched: introduce terse dump flag Add new TCA_DUMP_FLAGS attribute and use it in cls API to request terse filter output from classifiers with TCA_DUMP_FLAGS_TERSE flag. This option is intended to be used to improve performance of TC filter dump when userland only needs to obtain stats and not the whole classifier/action data. Extend struct tcf_proto_ops with new terse_dump() callback that must be defined by supporting classifier implementations. Support of the options in specific classifiers and actions is implemented in following patches in the series. Signed-off-by: Vlad Buslov Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 2e186a2cf8c785f38ef3237e83f8921f82f6e2b7 Author: Tobias Waldekranz Date: Fri May 15 11:52:52 2020 +0200 net: core: recursively find netdev by device node The assumption that a device node is associated either with the netdev's device, or the parent of that device, does not hold for all drivers. E.g. Freescale's DPAA has two layers of platform devices above the netdev. Instead, recursively walk up the tree from the netdev, allowing any parent to match against the sought after node. Signed-off-by: Tobias Waldekranz Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 10ce77e4817fef99e1166be7e6685a80c63bf77f Author: Erwin Burema Date: Sun May 10 20:29:11 2020 +0200 ALSA: usb-audio: Add duplex sound support for USB devices using implicit feedback For USB sound devices using implicit feedback the endpoint used for this feedback should be able to be opened twice, once for required feedback and second time for audio data. This way these devices can be put in duplex audio mode. Since this only works if the settings of the endpoint don't change a check is included for this. This fixes bug 207023 ("MOTU M2 regression on duplex audio") and should also fix bug 103751 ("M-Audio Fast Track Ultra usb audio device will not operate full-duplex") Fixes: c249177944b6 ("ALSA: usb-audio: add implicit fb quirk for MOTU M Series") Signed-off-by: Erwin Burema BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207023 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=103751 Link: https://lore.kernel.org/r/2410739.SCZni40SNb@alpha-wolf Signed-off-by: Takashi Iwai commit 8b7ce5e49049ca78c238f03d70569a73da049f32 Author: Ulf Hansson Date: Mon May 11 15:33:46 2020 +0200 cpuidle: psci: Fixup execution order when entering a domain idle state Moving forward, platforms are going to need to execute specific "last-man" operations before a domain idle state can be entered. In one way or the other, these operations needs to be triggered while walking the hierarchical topology via runtime PM and genpd, as it's at that point the last-man becomes known. Moreover, executing last-man operations needs to be done after the CPU PM notifications are sent through cpu_pm_enter(), as otherwise it's likely that some notifications would fail. Therefore, let's re-order the sequence in psci_enter_domain_idle_state(), so cpu_pm_enter() gets called prior pm_runtime_put_sync(). Fixes: ce85aef570df ("cpuidle: psci: Manage runtime PM in the idle path") Reported-by: Lina Iyer Signed-off-by: Ulf Hansson Acked-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 33c980036deb5ee9961db82401c0fbfb96f126b3 Author: Jacob Pan Date: Fri May 15 15:30:41 2020 +0800 powercap/intel_rapl: add support for ElkhartLake Add intel_rapl support for ElkhartLake platform. Signed-off-by: Jacob Pan Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit ea6f3af4c5e63f6981c0b0ab8ebec438e2d5ef40 Author: Ard Biesheuvel Date: Fri May 15 11:36:13 2020 +0200 ACPI: GED: add support for _Exx / _Lxx handler methods Per the ACPI spec, interrupts in the range [0, 255] may be handled in AML using individual methods whose naming is based on the format _Exx or _Lxx, where xx is the hex representation of the interrupt index. Add support for this missing feature to our ACPI GED driver. Cc: v4.9+ # v4.9+ Signed-off-by: Ard Biesheuvel Signed-off-by: Rafael J. Wysocki commit cb953129bfe5c0f2da835a0469930873fb7e71df Author: David Matlack Date: Fri May 8 11:22:40 2020 -0700 kvm: add halt-polling cpu usage stats Two new stats for exposing halt-polling cpu usage: halt_poll_success_ns halt_poll_fail_ns Thus sum of these 2 stats is the total cpu time spent polling. "success" means the VCPU polled until a virtual interrupt was delivered. "fail" means the VCPU had to schedule out (either because the maximum poll time was reached or it needed to yield the CPU). To avoid touching every arch's kvm_vcpu_stat struct, only update and export halt-polling cpu usage stats if we're on x86. Exporting cpu usage as a u64 and in nanoseconds means we will overflow at ~500 years, which seems reasonably large. Signed-off-by: David Matlack Signed-off-by: Jon Cargille Reviewed-by: Jim Mattson Message-Id: <20200508182240.68440-1-jcargill@google.com> Signed-off-by: Paolo Bonzini commit 93dff2fed2fb4a513196b7df05742c6fcdfd5178 Author: Jim Mattson Date: Fri May 8 13:36:43 2020 -0700 KVM: nVMX: Migrate the VMX-preemption timer The hrtimer used to emulate the VMX-preemption timer must be pinned to the same logical processor as the vCPU thread to be interrupted if we want to have any hope of adhering to the architectural specification of the VMX-preemption timer. Even with this change, the emulated VMX-preemption timer VM-exit occasionally arrives too late. Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Reviewed-by: Oliver Upton Message-Id: <20200508203643.85477-4-jmattson@google.com> Signed-off-by: Paolo Bonzini commit ada0098df6569b7f9e9495beb0f1e35718895aa0 Author: Jim Mattson Date: Fri May 8 13:36:42 2020 -0700 KVM: nVMX: Change emulated VMX-preemption timer hrtimer to absolute Prepare for migration of this hrtimer, by changing it from relative to absolute. (I couldn't get migration to work with a relative timer.) Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Reviewed-by: Oliver Upton Message-Id: <20200508203643.85477-3-jmattson@google.com> Signed-off-by: Paolo Bonzini commit 1739f3d56d24a121535b45267d85b7fe6f6cc4ab Author: Jim Mattson Date: Fri May 8 13:36:41 2020 -0700 KVM: nVMX: Really make emulated nested preemption timer pinned The PINNED bit is ignored by hrtimer_init. It is only considered when starting the timer. When the hrtimer isn't pinned to the same logical processor as the vCPU thread to be interrupted, the emulated VMX-preemption timer often fails to adhere to the architectural specification. Fixes: f15a75eedc18e ("KVM: nVMX: make emulated nested preemption timer pinned") Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Reviewed-by: Oliver Upton Message-Id: <20200508203643.85477-2-jmattson@google.com> Signed-off-by: Paolo Bonzini commit 6c1c6e58356b87017839f71120d1c250b4e0f7ff Author: Sean Christopherson Date: Wed May 6 13:46:53 2020 -0700 KVM: nVMX: Remove unused 'ops' param from nested_vmx_hardware_setup() Remove a 'struct kvm_x86_ops' param that got left behind when the nested ops were moved to their own struct. Fixes: 33b22172452f0 ("KVM: x86: move nested-related kvm_x86_ops to a separate struct") Signed-off-by: Sean Christopherson Message-Id: <20200506204653.14683-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit de182481629c2dc248adbb4ec5df83cd9d633dd4 Author: Suravee Suthikulpanit Date: Wed May 6 08:17:56 2020 -0500 KVM: SVM: Remove unnecessary V_IRQ unsetting This has already been handled in the prior call to svm_clear_vintr(). Signed-off-by: Suravee Suthikulpanit Message-Id: <1588771076-73790-5-git-send-email-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini commit e14b7786cb1cf39a12e79bb04e2f43afc2eabc0f Author: Suravee Suthikulpanit Date: Wed May 6 08:17:55 2020 -0500 KVM: SVM: Merge svm_enable_vintr into svm_set_vintr Code clean up and remove unnecessary intercept check for INTERCEPT_VINTR. Signed-off-by: Suravee Suthikulpanit Message-Id: <1588771076-73790-4-git-send-email-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini commit 26efe2fd92e50822674acce1dbc4f2ac6fc1788f Author: Wanpeng Li Date: Wed May 6 11:44:01 2020 -0400 KVM: VMX: Handle preemption timer fastpath This patch implements a fastpath for the preemption timer vmexit. The vmexit can be handled quickly so it can be performed with interrupts off and going back directly to the guest. Testing on SKX Server. cyclictest in guest(w/o mwait exposed, adaptive advance lapic timer is default -1): 5540.5ns -> 4602ns 17% kvm-unit-test/vmexit.flat: w/o avanced timer: tscdeadline_immed: 3028.5 -> 2494.75 17.6% tscdeadline: 5765.7 -> 5285 8.3% w/ adaptive advance timer default -1: tscdeadline_immed: 3123.75 -> 2583 17.3% tscdeadline: 4663.75 -> 4537 2.7% Tested-by: Haiwei Li Cc: Haiwei Li Signed-off-by: Wanpeng Li Message-Id: <1588055009-12677-8-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit ae95f566b3d22ade75c67827f1171594dacc9a03 Author: Wanpeng Li Date: Tue Apr 28 14:23:28 2020 +0800 KVM: X86: TSCDEADLINE MSR emulation fastpath This patch implements a fast path for emulation of writes to the TSCDEADLINE MSR. Besides shortcutting various housekeeping tasks in the vCPU loop, the fast path can also deliver the timer interrupt directly without going through KVM_REQ_PENDING_TIMER because it runs in vCPU context. Tested-by: Haiwei Li Cc: Haiwei Li Signed-off-by: Wanpeng Li Message-Id: <1588055009-12677-7-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 199a8b84c455cfeb81bc060c6824dea473e54dc3 Author: Paolo Bonzini Date: Tue May 5 06:45:35 2020 -0400 KVM: x86: introduce kvm_can_use_hv_timer Replace the ad hoc test in vmx_set_hv_timer with a test in the caller, start_hv_timer. This test is not Intel-specific and would be duplicated when introducing the fast path for the TSC deadline MSR. Signed-off-by: Paolo Bonzini commit 379a3c8ee44440d5afa505230ed8cb5b0d0e314b Author: Wanpeng Li Date: Tue Apr 28 14:23:27 2020 +0800 KVM: VMX: Optimize posted-interrupt delivery for timer fastpath While optimizing posted-interrupt delivery especially for the timer fastpath scenario, I measured kvm_x86_ops.deliver_posted_interrupt() to introduce substantial latency because the processor has to perform all vmentry tasks, ack the posted interrupt notification vector, read the posted-interrupt descriptor etc. This is not only slow, it is also unnecessary when delivering an interrupt to the current CPU (as is the case for the LAPIC timer) because PIR->IRR and IRR->RVI synchronization is already performed on vmentry Therefore skip kvm_vcpu_trigger_posted_interrupt in this case, and instead do vmx_sync_pir_to_irr() on the EXIT_FASTPATH_REENTER_GUEST fastpath as well. Tested-by: Haiwei Li Cc: Haiwei Li Suggested-by: Paolo Bonzini Signed-off-by: Wanpeng Li Message-Id: <1588055009-12677-6-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 404d5d7bff0d419fe11c7eaebca9ec8f25258f95 Author: Wanpeng Li Date: Tue Apr 28 14:23:25 2020 +0800 KVM: X86: Introduce more exit_fastpath_completion enum values Adds a fastpath_t typedef since enum lines are a bit long, and replace EXIT_FASTPATH_SKIP_EMUL_INS with two new exit_fastpath_completion enum values. - EXIT_FASTPATH_EXIT_HANDLED kvm will still go through it's full run loop, but it would skip invoking the exit handler. - EXIT_FASTPATH_REENTER_GUEST complete fastpath, guest can be re-entered without invoking the exit handler or going back to vcpu_run Tested-by: Haiwei Li Cc: Haiwei Li Signed-off-by: Wanpeng Li Message-Id: <1588055009-12677-4-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 5a9f54435a488f8a1153efd36cccee3e7e0fc28b Author: Wanpeng Li Date: Tue Apr 28 14:23:26 2020 +0800 KVM: X86: Introduce kvm_vcpu_exit_request() helper Introduce kvm_vcpu_exit_request() helper, we need to check some conditions before enter guest again immediately, we skip invoking the exit handler and go through full run loop if complete fastpath but there is stuff preventing we enter guest again immediately. Tested-by: Haiwei Li Cc: Haiwei Li Signed-off-by: Wanpeng Li Message-Id: <1588055009-12677-5-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 2c4c41325540cf3abb12aef142c0e550f6afeffc Author: Sean Christopherson Date: Fri May 8 16:53:48 2020 -0700 KVM: x86: Print symbolic names of VMX VM-Exit flags in traces Use __print_flags() to display the names of VMX flags in VM-Exit traces and strip the flags when printing the basic exit reason, e.g. so that a failed VM-Entry due to invalid guest state gets recorded as "INVALID_STATE FAILED_VMENTRY" instead of "0x80000021". Opportunstically fix misaligned variables in the kvm_exit and kvm_nested_vmexit_inject tracepoints. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200508235348.19427-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit dcf068da7eb29362adf13f20e5c44a18d98ed9a3 Author: Wanpeng Li Date: Tue Apr 28 14:23:23 2020 +0800 KVM: VMX: Introduce generic fastpath handler Introduce generic fastpath handler to handle MSR fastpath, VMX-preemption timer fastpath etc; move it after vmx_complete_interrupts() in order to catch events delivered to the guest, and abort the fast path in later patches. While at it, move the kvm_exit tracepoint so that it is printed for fastpath vmexits as well. There is no observed performance effect for the IPI fastpath after this patch. Tested-by: Haiwei Li Cc: Haiwei Li Signed-off-by: Wanpeng Li Suggested-by: Sean Christopherson Message-Id: <1588055009-12677-2-git-send-email-wanpengli@tencent.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 9e826feb8f114964cbdce026340b6cb9bde68a18 Author: Sean Christopherson Date: Tue Apr 28 16:10:25 2020 -0700 KVM: nVMX: Drop superfluous VMREAD of vmcs02.GUEST_SYSENTER_* Don't propagate GUEST_SYSENTER_* from vmcs02 to vmcs12 on nested VM-Exit as the vmcs12 fields are updated in vmx_set_msr(), and writes to the corresponding MSRs are always intercepted by KVM when running L2. Dropping the propagation was intended to be done in the same commit that added vmcs12 writes in vmx_set_msr()[1], but for reasons unknown was only shuffled around[2][3]. [1] https://patchwork.kernel.org/patch/10933215 [2] https://patchwork.kernel.org/patch/10933215/#22682289 [3] https://lore.kernel.org/patchwork/patch/1088643 Signed-off-by: Sean Christopherson Message-Id: <20200428231025.12766-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 2408500dfc8f275f9057586b81466989f0fafc59 Author: Sean Christopherson Date: Tue Apr 28 16:10:24 2020 -0700 KVM: nVMX: Truncate writes to vmcs.SYSENTER_EIP/ESP for 32-bit vCPU Explicitly truncate the data written to vmcs.SYSENTER_EIP/ESP on WRMSR if the virtual CPU doesn't support 64-bit mode. The SYSENTER address fields in the VMCS are natural width, i.e. bits 63:32 are dropped if the CPU doesn't support Intel 64 architectures. This behavior is visible to the guest after a VM-Exit/VM-Exit roundtrip, e.g. if the guest sets bits 63:32 in the actual MSR. Signed-off-by: Sean Christopherson Message-Id: <20200428231025.12766-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 551896e0e060ca32947621e353b4918e90b88822 Author: Uros Bizjak Date: Mon May 4 17:57:06 2020 +0200 KVM: VMX: Improve handle_external_interrupt_irqoff inline assembly Improve handle_external_interrupt_irqoff inline assembly in several ways: - remove unneeded %c operand modifiers and "$" prefixes - use %rsp instead of _ASM_SP, since we are in CONFIG_X86_64 part - use $-16 immediate to align %rsp - remove unneeded use of __ASM_SIZE macro - define "ss" named operand only for X86_64 The patch introduces no functional changes. Cc: Paolo Bonzini Cc: Sean Christopherson Signed-off-by: Uros Bizjak Message-Id: <20200504155706.2516956-1-ubizjak@gmail.com> Signed-off-by: Paolo Bonzini commit 62315b639302098c177ad6e3e125fa1809398bee Author: Peter Xu Date: Thu Apr 16 11:59:13 2020 -0400 KVM: Documentation: Fix up cpuid page 0x4b564d00 and 0x4b564d01 belong to KVM_FEATURE_CLOCKSOURCE2. Signed-off-by: Peter Xu Message-Id: <20200416155913.267562-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 0fd460446912dd96fd1e08995f57b14806c10478 Author: Peter Xu Date: Thu Apr 16 11:59:10 2020 -0400 KVM: X86: Sanity check on gfn before removal The index returned by kvm_async_pf_gfn_slot() will be removed when an async pf gfn is going to be removed. However kvm_async_pf_gfn_slot() is not reliable in that it can return the last key it loops over even if the gfn is not found in the async gfn array. It should never happen, but it's still better to sanity check against that to make sure no unexpected gfn will be removed. Signed-off-by: Peter Xu Message-Id: <20200416155910.267514-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit 5b494aea13fe9ec67365510c0d75835428cbb303 Author: Peter Xu Date: Thu Apr 16 11:59:06 2020 -0400 KVM: No need to retry for hva_to_pfn_remapped() hva_to_pfn_remapped() calls fixup_user_fault(), which has already handled the retry gracefully. Even if "unlocked" is set to true, it means that we've got a VM_FAULT_RETRY inside fixup_user_fault(), however the page fault has already retried and we should have the pfn set correctly. No need to do that again. Signed-off-by: Peter Xu Message-Id: <20200416155906.267462-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit dd03bcaad0b1a62c8ea6297e6f2a5993c1c5cd30 Author: Peter Xu Date: Thu Apr 16 11:58:59 2020 -0400 KVM: X86: Force ASYNC_PF_PER_VCPU to be power of two Forcing the ASYNC_PF_PER_VCPU to be power of two is much easier to be used rather than calling roundup_pow_of_two() from time to time. Do this by adding a BUILD_BUG_ON() inside the hash function. Another point is that generally async pf does not allow concurrency over ASYNC_PF_PER_VCPU after all (see kvm_setup_async_pf()), so it does not make much sense either to have it not a power of two or some of the entries will definitely be wasted. Signed-off-by: Peter Xu Message-Id: <20200416155859.267366-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini commit c16312f4fa75e786f5748a7b721a05e6b0d761fe Author: Uros Bizjak Date: Mon Apr 27 22:50:35 2020 +0200 KVM: VMX: Remove unneeded __ASM_SIZE usage with POP instruction POP [mem] defaults to the word size, and the only legal non-default size is 16 bits, e.g. a 32-bit POP will #UD in 64-bit mode and vice versa, no need to use __ASM_SIZE macro to force operating mode. Changes since v1: - Fix commit message. Cc: Paolo Bonzini Cc: Sean Christopherson Reviewed-by: Sean Christopherson Signed-off-by: Uros Bizjak Message-Id: <20200427205035.1594232-1-ubizjak@gmail.com> Signed-off-by: Paolo Bonzini commit 8123f265248c85603d55f4e97c68576f45eb1e4d Author: Sean Christopherson Date: Mon Apr 27 19:37:14 2020 -0700 KVM: x86/mmu: Add a helper to consolidate root sp allocation Add a helper, mmu_alloc_root(), to consolidate the allocation of a root shadow page, which has the same basic mechanics for all flavors of TDP and shadow paging. Note, __pa(sp->spt) doesn't need to be protected by mmu_lock, sp->spt points at a kernel page. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200428023714.31923-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 3bae0459bcd559506a2ca5807040ff722de5b136 Author: Sean Christopherson Date: Mon Apr 27 17:54:22 2020 -0700 KVM: x86/mmu: Drop KVM's hugepage enums in favor of the kernel's enums Replace KVM's PT_PAGE_TABLE_LEVEL, PT_DIRECTORY_LEVEL and PT_PDPE_LEVEL with the kernel's PG_LEVEL_4K, PG_LEVEL_2M and PG_LEVEL_1G. KVM's enums are borderline impossible to remember and result in code that is visually difficult to audit, e.g. if (!enable_ept) ept_lpage_level = 0; else if (cpu_has_vmx_ept_1g_page()) ept_lpage_level = PT_PDPE_LEVEL; else if (cpu_has_vmx_ept_2m_page()) ept_lpage_level = PT_DIRECTORY_LEVEL; else ept_lpage_level = PT_PAGE_TABLE_LEVEL; versus if (!enable_ept) ept_lpage_level = 0; else if (cpu_has_vmx_ept_1g_page()) ept_lpage_level = PG_LEVEL_1G; else if (cpu_has_vmx_ept_2m_page()) ept_lpage_level = PG_LEVEL_2M; else ept_lpage_level = PG_LEVEL_4K; No functional change intended. Suggested-by: Barret Rhoden Signed-off-by: Sean Christopherson Message-Id: <20200428005422.4235-4-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit e662ec3e0705cfee5b36aecd62adbc36df85eab3 Author: Sean Christopherson Date: Mon Apr 27 17:54:21 2020 -0700 KVM: x86/mmu: Move max hugepage level to a separate #define Rename PT_MAX_HUGEPAGE_LEVEL to KVM_MAX_HUGEPAGE_LEVEL and make it a separate define in anticipation of dropping KVM's PT_*_LEVEL enums in favor of the kernel's PG_LEVEL_* enums. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200428005422.4235-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit b2f432f872d9b4eb07d35f7bd5aa68c48a756f1a Author: Sean Christopherson Date: Mon Apr 27 17:54:20 2020 -0700 KVM: x86/mmu: Tweak PSE hugepage handling to avoid 2M vs 4M conundrum Change the PSE hugepage handling in walk_addr_generic() to fire on any page level greater than PT_PAGE_TABLE_LEVEL, a.k.a. PG_LEVEL_4K. PSE paging only has two levels, so "== 2" and "> 1" are functionally the same, i.e. this is a nop. A future patch will drop KVM's PT_*_LEVEL enums in favor of the kernel's PG_LEVEL_* enums, at which point "walker->level == PG_LEVEL_2M" is semantically incorrect (though still functionally ok). No functional change intended. Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200428005422.4235-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit a71936ab46f1da1539d97a98dfb2f94ee383d687 Author: Xiaoyao Li Date: Wed Apr 29 23:43:12 2020 +0800 kvm: x86: Cleanup vcpu->arch.guest_xstate_size vcpu->arch.guest_xstate_size lost its only user since commit df1daba7d1cb ("KVM: x86: support XSAVES usage in the host"), so clean it up. Signed-off-by: Xiaoyao Li Message-Id: <20200429154312.1411-1-xiaoyao.li@intel.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 9361797c7696874a1136442b5ee69c62b0e54738 Author: Gustavo A. R. Silva Date: Thu May 7 14:06:38 2020 -0500 PNPBIOS: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Rafael J. Wysocki commit 68cda40d9f3c4cb880108eb22f974d9e3d5dc6c5 Author: Sean Christopherson Date: Mon May 11 15:05:29 2020 -0700 KVM: nVMX: Tweak handling of failure code for nested VM-Enter failure Use an enum for passing around the failure code for a failed VM-Enter that results in VM-Exit to provide a level of indirection from the final resting place of the failure code, vmcs.EXIT_QUALIFICATION. The exit qualification field is an unsigned long, e.g. passing around 'u32 exit_qual' throws up red flags as it suggests KVM may be dropping bits when reporting errors to L1. This is a red herring because the only defined failure codes are 0, 2, 3, and 4, i.e. don't come remotely close to overflowing a u32. Setting vmcs.EXIT_QUALIFICATION on entry failure is further complicated by the MSR load list, which returns the (1-based) entry that failed, and the number of MSRs to load is a 32-bit VMCS field. At first blush, it would appear that overflowing a u32 is possible, but the number of MSRs that can be loaded is hardcapped at 4096 (limited by MSR_IA32_VMX_MISC). In other words, there are two completely disparate types of data that eventually get stuffed into vmcs.EXIT_QUALIFICATION, neither of which is an 'unsigned long' in nature. This was presumably the reasoning for switching to 'u32' when the related code was refactored in commit ca0bde28f2ed6 ("kvm: nVMX: Split VMCS checks from nested_vmx_run()"). Using an enum for the failure code addresses the technically-possible- but-will-never-happen scenario where Intel defines a failure code that doesn't fit in a 32-bit integer. The enum variables and values will either be automatically sized (gcc 5.4 behavior) or be subjected to some combination of truncation. The former case will simply work, while the latter will trigger a compile-time warning unless the compiler is being particularly unhelpful. Separating the failure code from the failed MSR entry allows for disassociating both from vmcs.EXIT_QUALIFICATION, which avoids the conundrum where KVM has to choose between 'u32 exit_qual' and tracking values as 'unsigned long' that have no business being tracked as such. To cement the split, set vmcs12->exit_qualification directly from the entry error code or failed MSR index instead of bouncing through a local variable. Opportunistically rename the variables in load_vmcs12_host_state() and vmx_set_nested_state() to call out that they're ignored, set exit_reason on demand on nested VM-Enter failure, and add a comment in nested_vmx_load_msr() to call out that returning 'i + 1' can't wrap. No functional change intended. Reported-by: Vitaly Kuznetsov Cc: Jim Mattson Signed-off-by: Sean Christopherson Message-Id: <20200511220529.11402-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit c5a28380257327bb7b89974919a3695047277ba5 Author: Codrin Ciubotariu Date: Fri May 15 17:00:01 2020 +0300 ARM: dts: at91: Configure I2C SCL gpio as open drain The SCL gpio pin used by I2C bus for recovery needs to be configured as open drain. Fixes: 455fec938bbb ("ARM: dts: at91: sama5d2: add i2c gpio pinctrl") Fixes: a4bd8da893a3 ("ARM: dts: at91: sama5d3: add i2c gpio pinctrl") Fixes: 8fb82f050cf6 ("ARM: dts: at91: sama5d4: add i2c gpio pinctrl") Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20200515140001.287932-1-codrin.ciubotariu@microchip.com Signed-off-by: Alexandre Belloni commit cc49c71d2abe99c1c2c9bedf0693ad2d3ee4a067 Author: Sami Tolvanen Date: Mon Apr 27 09:00:18 2020 -0700 efi/libstub: Disable Shadow Call Stack Shadow stacks are not available in the EFI stub, filter out SCS flags. Suggested-by: James Morse Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Signed-off-by: Will Deacon commit 439dc2a11727314cdc3ad0ad13c122d910dae411 Author: Sami Tolvanen Date: Mon Apr 27 09:00:17 2020 -0700 arm64: scs: Add shadow stacks for SDEI This change adds per-CPU shadow call stacks for the SDEI handler. Similarly to how the kernel stacks are handled, we add separate shadow stacks for normal and critical events. Signed-off-by: Sami Tolvanen Reviewed-by: James Morse Tested-by: James Morse Signed-off-by: Will Deacon commit 5287569a790d2546a06db07e391bf84b8bd6cf51 Author: Sami Tolvanen Date: Mon Apr 27 09:00:16 2020 -0700 arm64: Implement Shadow Call Stack This change implements shadow stack switching, initial SCS set-up, and interrupt shadow stacks for arm64. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Signed-off-by: Will Deacon commit 9654736891c3ac6a60b52ce70d33cf57cf95bff7 Author: Sami Tolvanen Date: Mon Apr 27 09:00:15 2020 -0700 arm64: Disable SCS for hypervisor code Disable SCS for code that runs at a different exception level by adding __noscs to __hyp_text. Suggested-by: James Morse Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Acked-by: Marc Zyngier Signed-off-by: Will Deacon commit cde5dec89e5dee5a6de12cd99fdb24651ee03146 Author: Sami Tolvanen Date: Mon Apr 27 09:00:14 2020 -0700 arm64: vdso: Disable Shadow Call Stack Shadow stacks are only available in the kernel, so disable SCS instrumentation for the vDSO. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Mark Rutland Acked-by: Will Deacon Signed-off-by: Will Deacon commit e73f02c6eb15729164b9dd5e19214b54446823ab Author: Sami Tolvanen Date: Mon Apr 27 09:00:13 2020 -0700 arm64: efi: Restore register x18 if it was corrupted If we detect a corrupted x18, restore the register before jumping back to potentially SCS instrumented code. This is safe, because the wrapper is called with preemption disabled and a separate shadow stack is used for interrupt handling. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Acked-by: Will Deacon Signed-off-by: Will Deacon commit 6d37d81f449a103a8b43c5c972b5055b8936ef0e Author: Sami Tolvanen Date: Mon Apr 27 09:00:12 2020 -0700 arm64: Preserve register x18 when CPU is suspended Don't lose the current task's shadow stack when the CPU is suspended. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Reviewed-by: Mark Rutland Acked-by: Will Deacon Signed-off-by: Will Deacon commit da64e9d1f8c3dad6898dac6edb39a68d3aa9ce93 Author: Sami Tolvanen Date: Mon Apr 27 09:00:11 2020 -0700 arm64: Reserve register x18 from general allocation with SCS Reserve the x18 register from general allocation when SCS is enabled, because the compiler uses the register to store the current task's shadow stack pointer. Note that all external kernel modules must also be compiled with -ffixed-x18 if the kernel has SCS enabled. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Acked-by: Will Deacon Signed-off-by: Will Deacon commit ddc9863e9e9025e2fc0c8dba31cc060cd626606f Author: Sami Tolvanen Date: Mon Apr 27 09:00:10 2020 -0700 scs: Disable when function graph tracing is enabled The graph tracer hooks returns by modifying frame records on the (regular) stack, but with SCS the return address is taken from the shadow stack, and the value in the frame record has no effect. As we don't currently have a mechanism to determine the corresponding slot on the shadow stack (and to pass this through the ftrace infrastructure), for now let's disable SCS when the graph tracer is enabled. With SCS the return address is taken from the shadow stack and the value in the frame record has no effect. The mcount based graph tracer hooks returns by modifying frame records on the (regular) stack, and thus is not compatible. The patchable-function-entry graph tracer used for DYNAMIC_FTRACE_WITH_REGS modifies the LR before it is saved to the shadow stack, and is compatible. Modifying the mcount based graph tracer to work with SCS would require a mechanism to determine the corresponding slot on the shadow stack (and to pass this through the ftrace infrastructure), and we expect that everyone will eventually move to the patchable-function-entry based graph tracer anyway, so for now let's disable SCS when the mcount-based graph tracer is enabled. SCS and patchable-function-entry are both supported from LLVM 10.x. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Reviewed-by: Mark Rutland Signed-off-by: Will Deacon commit 5bbaf9d1fcb9be696ee9a61636ab6803556c70f2 Author: Sami Tolvanen Date: Mon Apr 27 09:00:09 2020 -0700 scs: Add support for stack usage debugging Implements CONFIG_DEBUG_STACK_USAGE for shadow stacks. When enabled, also prints out the highest shadow stack usage per process. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Acked-by: Will Deacon [will: rewrote most of scs_check_usage()] Signed-off-by: Will Deacon commit 628d06a48f57c36abdc2a024930212e654a501b7 Author: Sami Tolvanen Date: Mon Apr 27 09:00:08 2020 -0700 scs: Add page accounting for shadow call stack allocations This change adds accounting for the memory allocated for shadow stacks. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Acked-by: Will Deacon Signed-off-by: Will Deacon commit d08b9f0ca6605e13dcb48f04e55a30545b3c71eb Author: Sami Tolvanen Date: Mon Apr 27 09:00:07 2020 -0700 scs: Add support for Clang's Shadow Call Stack (SCS) This change adds generic support for Clang's Shadow Call Stack, which uses a shadow stack to protect return addresses from being overwritten by an attacker. Details are available here: https://clang.llvm.org/docs/ShadowCallStack.html Note that security guarantees in the kernel differ from the ones documented for user space. The kernel must store addresses of shadow stacks in memory, which means an attacker capable reading and writing arbitrary memory may be able to locate them and hijack control flow by modifying the stacks. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Reviewed-by: Miguel Ojeda [will: Numerous cosmetic changes] Signed-off-by: Will Deacon commit 26af2884e49c71b20b7961d9a17d3886a541b987 Author: Michael Kao Date: Fri Apr 24 16:23:40 2020 +0800 arm64: dts: mt8173: fix cooling device range When thermal reaches target temperature,it would be pinned to state 0 (max frequency and power). Fix the throttling range to no limit. Signed-off-by: Hsin-Yi Wang Signed-off-by: Michael Kao Link: https://lore.kernel.org/r/20200424082340.4127-1-michael.kao@mediatek.com Signed-off-by: Matthias Brugger commit ed24a7a852b542911479383d5c80b9a2b4bb8caa Merge: 0ee52c0f6c67 816260011876 Author: Daniel Borkmann Date: Fri May 15 17:29:42 2020 +0200 Merge branch 'bpf-cap' Alexei Starovoitov says: ==================== v6->v7: - permit SK_REUSEPORT program type under CAP_BPF as suggested by Marek Majkowski. It's equivalent to SOCKET_FILTER which is unpriv. v5->v6: - split allow_ptr_leaks into four flags. - retain bpf_jit_limit under cap_sys_admin. - fixed few other issues spotted by Daniel. v4->v5: Split BPF operations that are allowed under CAP_SYS_ADMIN into combination of CAP_BPF, CAP_PERFMON, CAP_NET_ADMIN and keep some of them under CAP_SYS_ADMIN. The user process has to have - CAP_BPF to create maps, do other sys_bpf() commands and load SK_REUSEPORT progs. Note: dev_map, sock_hash, sock_map map types still require CAP_NET_ADMIN. That could be relaxed in the future. - CAP_BPF and CAP_PERFMON to load tracing programs. - CAP_BPF and CAP_NET_ADMIN to load networking programs. (or CAP_SYS_ADMIN for backward compatibility). CAP_BPF solves three main goals: 1. provides isolation to user space processes that drop CAP_SYS_ADMIN and switch to CAP_BPF. More on this below. This is the major difference vs v4 set back from Sep 2019. 2. makes networking BPF progs more secure, since CAP_BPF + CAP_NET_ADMIN prevents pointer leaks and arbitrary kernel memory access. 3. enables fuzzers to exercise all of the verifier logic. Eventually finding bugs and making BPF infra more secure. Currently fuzzers run in unpriv. They will be able to run with CAP_BPF. The patchset is long overdue follow-up from the last plumbers conference. Comparing to what was discussed at LPC the CAP* checks at attach time are gone. For tracing progs the CAP_SYS_ADMIN check was done at load time only. There was no check at attach time. For networking and cgroup progs CAP_SYS_ADMIN was required at load time and CAP_NET_ADMIN at attach time, but there are several ways to bypass CAP_NET_ADMIN: - if networking prog is using tail_call writing FD into prog_array will effectively attach it, but bpf_map_update_elem is an unprivileged operation. - freplace prog with CAP_SYS_ADMIN can replace networking prog Consolidating all CAP checks at load time makes security model similar to open() syscall. Once the user got an FD it can do everything with it. read/write/poll don't check permissions. The same way when bpf_prog_load command returns an FD the user can do everything (including attaching, detaching, and bpf_test_run). The important design decision is to allow ID->FD transition for CAP_SYS_ADMIN only. What it means that user processes can run with CAP_BPF and CAP_NET_ADMIN and they will not be able to affect each other unless they pass FDs via scm_rights or via pinning in bpffs. ID->FD is a mechanism for human override and introspection. An admin can do 'sudo bpftool prog ...'. It's possible to enforce via LSM that only bpftool binary does bpf syscall with CAP_SYS_ADMIN and the rest of user space processes do bpf syscall with CAP_BPF isolating bpf objects (progs, maps, links) that are owned by such processes from each other. Another significant change from LPC is that the verifier checks are split into four flags. The allow_ptr_leaks flag allows pointer manipulations. The bpf_capable flag enables all modern verifier features like bpf-to-bpf calls, BTF, bounded loops, dead code elimination, etc. All the goodness. The bypass_spec_v1 flag enables indirect stack access from bpf programs and disables speculative analysis and bpf array mitigations. The bypass_spec_v4 flag disables store sanitation. That allows networking progs with CAP_BPF + CAP_NET_ADMIN enjoy modern verifier features while being more secure. Some networking progs may need CAP_BPF + CAP_NET_ADMIN + CAP_PERFMON, since subtracting pointers (like skb->data_end - skb->data) is a pointer leak, but the verifier may get smarter in the future. ==================== Signed-off-by: Daniel Borkmann commit 81626001187609b9c49696a5b48d5abcf0e5f9be Author: Alexei Starovoitov Date: Wed May 13 16:03:55 2020 -0700 selftests/bpf: Use CAP_BPF and CAP_PERFMON in tests Make all test_verifier test exercise CAP_BPF and CAP_PERFMON Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200513230355.7858-4-alexei.starovoitov@gmail.com commit 2c78ee898d8f10ae6fb2fa23a3fbaec96b1b7366 Author: Alexei Starovoitov Date: Wed May 13 16:03:54 2020 -0700 bpf: Implement CAP_BPF Implement permissions as stated in uapi/linux/capability.h In order to do that the verifier allow_ptr_leaks flag is split into four flags and they are set as: env->allow_ptr_leaks = bpf_allow_ptr_leaks(); env->bypass_spec_v1 = bpf_bypass_spec_v1(); env->bypass_spec_v4 = bpf_bypass_spec_v4(); env->bpf_capable = bpf_capable(); The first three currently equivalent to perfmon_capable(), since leaking kernel pointers and reading kernel memory via side channel attacks is roughly equivalent to reading kernel memory with cap_perfmon. 'bpf_capable' enables bounded loops, precision tracking, bpf to bpf calls and other verifier features. 'allow_ptr_leaks' enable ptr leaks, ptr conversions, subtraction of pointers. 'bypass_spec_v1' disables speculative analysis in the verifier, run time mitigations in bpf array, and enables indirect variable access in bpf programs. 'bypass_spec_v4' disables emission of sanitation code by the verifier. That means that the networking BPF program loaded with CAP_BPF + CAP_NET_ADMIN will have speculative checks done by the verifier and other spectre mitigation applied. Such networking BPF program will not be able to leak kernel pointers and will not be able to access arbitrary kernel memory. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200513230355.7858-3-alexei.starovoitov@gmail.com commit a17b53c4a4b55ec322c132b6670743612229ee9c Author: Alexei Starovoitov Date: Wed May 13 16:03:53 2020 -0700 bpf, capability: Introduce CAP_BPF Split BPF operations that are allowed under CAP_SYS_ADMIN into combination of CAP_BPF, CAP_PERFMON, CAP_NET_ADMIN. For backward compatibility include them in CAP_SYS_ADMIN as well. The end result provides simple safety model for applications that use BPF: - to load tracing program types BPF_PROG_TYPE_{KPROBE, TRACEPOINT, PERF_EVENT, RAW_TRACEPOINT, etc} use CAP_BPF and CAP_PERFMON - to load networking program types BPF_PROG_TYPE_{SCHED_CLS, XDP, SK_SKB, etc} use CAP_BPF and CAP_NET_ADMIN There are few exceptions from this rule: - bpf_trace_printk() is allowed in networking programs, but it's using tracing mechanism, hence this helper needs additional CAP_PERFMON if networking program is using this helper. - BPF_F_ZERO_SEED flag for hash/lru map is allowed under CAP_SYS_ADMIN only to discourage production use. - BPF HW offload is allowed under CAP_SYS_ADMIN. - bpf_probe_write_user() is allowed under CAP_SYS_ADMIN only. CAPs are not checked at attach/detach time with two exceptions: - loading BPF_PROG_TYPE_CGROUP_SKB is allowed for unprivileged users, hence CAP_NET_ADMIN is required at attach time. - flow_dissector detach doesn't check prog FD at detach, hence CAP_NET_ADMIN is required at detach time. CAP_SYS_ADMIN is required to iterate BPF objects (progs, maps, links) via get_next_id command and convert them to file descriptor via GET_FD_BY_ID command. This restriction guarantees that mutliple tasks with CAP_BPF are not able to affect each other. That leads to clean isolation of tasks. For example: task A with CAP_BPF and CAP_NET_ADMIN loads and attaches a firewall via bpf_link. task B with the same capabilities cannot detach that firewall unless task A explicitly passed link FD to task B via scm_rights or bpffs. CAP_SYS_ADMIN can still detach/unload everything. Two networking user apps with CAP_SYS_ADMIN and CAP_NET_ADMIN can accidentely mess with each other programs and maps. Two networking user apps with CAP_NET_ADMIN and CAP_BPF cannot affect each other. CAP_NET_ADMIN + CAP_BPF allows networking programs access only packet data. Such networking progs cannot access arbitrary kernel memory or leak pointers. bpftool, bpftrace, bcc tools binaries should NOT be installed with CAP_BPF and CAP_PERFMON, since unpriv users will be able to read kernel secrets. But users with these two permissions will be able to use these tracing tools. CAP_PERFMON is least secure, since it allows kprobes and kernel memory access. CAP_NET_ADMIN can stop network traffic via iproute2. CAP_BPF is the safest from security point of view and harmless on its own. Having CAP_BPF and/or CAP_NET_ADMIN is not enough to write into arbitrary map and if that map is used by firewall-like bpf prog. CAP_BPF allows many bpf prog_load commands in parallel. The verifier may consume large amount of memory and significantly slow down the system. Existing unprivileged BPF operations are not affected. In particular unprivileged users are allowed to load socket_filter and cg_skb program types and to create array, hash, prog_array, map-in-map map types. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200513230355.7858-2-alexei.starovoitov@gmail.com commit 154910f886762a2817ddddad7fc6fed8c23b4ad1 Author: Geert Uytterhoeven Date: Tue May 5 17:45:35 2020 +0200 ARM: mediatek: Replace by The Mediatek platform code is not a clock provider, and just needs to call of_clk_init(). Hence it can include instead of . Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200505154536.4099-3-geert+renesas@glider.be Signed-off-by: Matthias Brugger commit 0ee52c0f6c67e187ff1906f6048af7c96df320c7 Author: Daniel Borkmann Date: Wed May 13 09:58:49 2020 +0200 bpf, bpftool: Allow probing for CONFIG_HZ from kernel config In Cilium we've recently switched to make use of bpf_jiffies64() for parts of our tc and XDP datapath since bpf_ktime_get_ns() is more expensive and high-precision is not needed for our timeouts we have anyway. Our agent has a probe manager which picks up the json of bpftool's feature probe and we also use the macro output in our C programs e.g. to have workarounds when helpers are not available on older kernels. Extend the kernel config info dump to also include the kernel's CONFIG_HZ, and rework the probe_kernel_image_config() for allowing a macro dump such that CONFIG_HZ can be propagated to BPF C code as a simple define if available via config. Latter allows to have _compile- time_ resolution of jiffies <-> sec conversion in our code since all are propagated as known constants. Given we cannot generally assume availability of kconfig everywhere, we also have a kernel hz probe [0] as a fallback. Potentially, bpftool could have an integrated probe fallback as well, although to derive it, we might need to place it under 'bpftool feature probe full' or similar given it would slow down the probing process overall. Yet 'full' doesn't fit either for us since we don't want to pollute the kernel log with warning messages from bpf_probe_write_user() and bpf_trace_printk() on agent startup; I've left it out for the time being. [0] https://github.com/cilium/cilium/blob/master/bpf/cilium-probe-kernel-hz.c Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Cc: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200513075849.20868-1-daniel@iogearbox.net commit 47b4f5f5b65680fbef7a7a9a4796b35f38a6e43e Author: Thomas Ebeling Date: Fri May 15 13:46:05 2020 +0200 ALSA: usb-audio: fixing upper volume limit for RME Babyface Pro routing crosspoints In my initial patch, these were set too low. Fixes: 3e8f3bd04716 ("ALSA: usb-audio: RME Babyface Pro mixer patch") Signed-off-by: Thomas Ebeling Link: https://lore.kernel.org/r/20200515114556.vtspnonzvp4xp44m@bollie.ca9.eu Signed-off-by: Takashi Iwai commit ff34e17cf9bce8b6d01c6a1e387720dc3393f45b Author: Wei Yongjun Date: Wed May 6 14:13:17 2020 +0000 soc: mediatek: Missing platform_device_unregister() on error in mtk_mmsys_probe() Add the missing platform_device_unregister() before return from mtk_mmsys_probe() in the error handling case. Fixes: 667c769246b0 ("soc / drm: mediatek: Fix mediatek-drm device probing") Signed-off-by: Wei Yongjun Reviewed-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200506141317.119537-1-weiyongjun1@huawei.com Signed-off-by: Matthias Brugger commit bd1f49e7792b1ca6e8c538942294309881150632 Author: Tudor Ambarus Date: Thu May 14 05:03:17 2020 +0000 ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function Users can choose which flexcom function to use. Describe the I2C Flexcom0 function. Add alias for the i2c2 node in order to not rely on probe order for the i2c device numbering. The sama5d2 SoC has two dedicated i2c buses and five flexcoms that can function as i2c. The i2c0 and i2c1 aliases are kept for the dedicated i2c buses, the i2c flexcom functions can be numbered in order starting from i2c2. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-16-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit dbe5bbdb28b4fca61584806301a021d57b4f1433 Author: Tudor Ambarus Date: Thu May 14 05:03:17 2020 +0000 ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases Indicate which i2c alias is for which connector on the board. Specify that serial0 is for DBGU. This eases tester's life. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-17-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit c85273fd1452a6de5cfaac93821a243990364108 Author: Tudor Ambarus Date: Thu May 14 05:03:16 2020 +0000 ARM: dts: at91: sama5d2_xplained: Add alias for DBGU The aliases should be defined in the board dts rather than in the SoC dtsi. Don't rely on the aliases defined in the SoC dtsi and define the alias for the Serial DBGU in the board dts file. sama5d2 boards use the "serial0" alias for the Serial DBGU, do the same for sama5d2_xplained. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-15-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 6b9a3584c7ed635641e0379df03a17943505d423 Author: Tudor Ambarus Date: Thu May 14 05:03:15 2020 +0000 ARM: dts: at91: sama5d2: Add missing flexcom definitions Describe all the flexcom functions for all the flexcom nodes. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-13-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 6e57359dd660ac1be632c8ae583e502faea6aa7e Author: Tudor Ambarus Date: Thu May 14 05:03:15 2020 +0000 ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi Device aliases are board-specific, if needed one should define them in board dts rather than in the SoC dtsi. If an alias from the SoC dtsi is addressed by a driver that does not use any of the of_alias*() methods, we can drop it. This is the case for the i2s aliases, drop them. tcb aliases point to nodes that are not enabled in any of the sama5d2 based platforms. atmel_tclib.c is scheduled to go away, any board using that alias is already broken, so get rid of the tcb aliases too. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-14-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 466fb89be5916af18ba5ea636fc1f7489a71e276 Author: Tudor Ambarus Date: Thu May 14 05:03:14 2020 +0000 ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions Spare boards of duplicating the DMA bindings. Describe the flx0 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-12-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 1a6508a2ed9a9a7925c999683eb872cd0ed2a7bd Author: Tudor Ambarus Date: Thu May 14 05:03:13 2020 +0000 ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function Spare boards of duplicating the DMA bindings. Describe the flx1 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-11-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit b793f1661777dddbd8f99554c24df247906c29bc Author: Tudor Ambarus Date: Thu May 14 05:03:12 2020 +0000 ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function Spare boards of duplicating the DMA bindings. Describe the flx3 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-10-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit ddcdaeb88242ca9b2a3ded2c6cb1d664e0ce24a3 Author: Tudor Ambarus Date: Thu May 14 05:03:12 2020 +0000 ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions Spare boards of duplicating the DMA bindings. Describe the flx4 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-9-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 4b098033279ef20f3a05de1cfc64ad6b9699688f Author: Tudor Ambarus Date: Thu May 14 05:03:11 2020 +0000 ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART The UART submodule in Flexcom has 32-byte Transmit and Receive FIFOs. Tested uart7 on sama5d2-icp, which has both DMA and FIFO enabled. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-8-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 56cd4b9e8c67fa60244aea013cc3846f9d8c498b Author: Tudor Ambarus Date: Thu May 14 05:03:10 2020 +0000 ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions. There is a single functional change in this patch. With the move of the flx0 uart5 definition in the SoC dtsi, the uart5 from at91-sama5d27_wlsom1_ek.dts inherits the following optional property: atmel,fifo-size = <32>; This particular change was tested by Codrin. Signed-off-by: Tudor Ambarus Tested-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20200514050301.147442-7-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 96f63ffdbc38e1b61e768a47b9c52f42f4c7b846 Author: Tudor Ambarus Date: Thu May 14 05:03:09 2020 +0000 ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-6-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 0afa4365266ab36c5751ff3136d95b5cae070467 Author: Tudor Ambarus Date: Thu May 14 05:03:08 2020 +0000 ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi The Flexcom IP is part of the sama5d2 SoC. Move the flx2 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-5-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 445a9d6e562a656f6f9bd4acfd5d55bd415f206e Author: Tudor Ambarus Date: Thu May 14 05:03:08 2020 +0000 ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi The Flexcom IP is part of the sama5d2 SoC. Move the flx3 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-4-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 91fa03c9e33e3ae8eb6959dc3d0f0b853a004f2c Author: Tudor Ambarus Date: Thu May 14 05:03:07 2020 +0000 ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-3-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit f1f2212eaddf4857728167ce9e582e530183cf4b Author: Tudor Ambarus Date: Thu May 14 05:03:07 2020 +0000 ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions The sama5d2 SoC has the following IPs: [uart0, uart4], {spi0, spi1}, {i2c0, i2c1}. Label the flexcom functions in order: flx0: uart5, spi2, i2c2 flx1: uart6, spi3, i2c3 flx2: uart7, spi4, i2c4 flx3: uart8, spi5, i2c5 flx4: uart9, spi6, i2c6 Some boards respected this scheme, others not. Fix the ones that didn't. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200514050301.147442-2-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 93d2e4322aa74c1ad1e8c2160608eb9a960d69ff Author: Saravana Kannan Date: Thu May 14 22:35:00 2020 -0700 of: platform: Batch fwnode parsing when adding all top level devices The fw_devlink_pause() and fw_devlink_resume() APIs allow batching the parsing of the device tree nodes when a lot of devices are added. This will significantly cut down parsing time (as much a 1 second on some systems). So, use them when adding devices for all the top level device tree nodes in a system. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200515053500.215929-5-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 716a7a25969003d82ab738179c3f1068a120ed11 Author: Saravana Kannan Date: Thu May 14 22:34:59 2020 -0700 driver core: fw_devlink: Add support for batching fwnode parsing The amount of time spent parsing fwnodes of devices can become really high if the devices are added in an non-ideal order. Worst case can be O(N^2) when N devices are added. But this can be optimized to O(N) by adding all the devices and then parsing all their fwnodes in one batch. This commit adds fw_devlink_pause() and fw_devlink_resume() to allow doing this. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200515053500.215929-4-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 5f5377eaddfc24e5d7562e588d0ff84f9264d7c1 Author: Saravana Kannan Date: Thu May 14 22:34:58 2020 -0700 driver core: Look for waiting consumers only for a fwnode's primary device Commit 4dbe191c046e ("driver core: Add device links from fwnode only for the primary device") skipped linking a fwnode's secondary device to the suppliers listed in its fwnode. However, a fwnode's secondary device can't be found using get_dev_from_fwnode(). So, there's no point in trying to see if devices waiting for suppliers might want to link to a fwnode's secondary device. This commit removes that unnecessary step for devices that aren't a fwnode's primary device and also moves the code to a more appropriate part of the file. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200515053500.215929-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 42926ac3cd50937346c23c0005817264af4357a7 Author: Saravana Kannan Date: Thu May 14 22:34:57 2020 -0700 driver core: Move code to the right part of the file This commit just moves around code to match the general organization of the file. Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200515053500.215929-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit d0e21ce40c7a41df43b70b863cc64395c7787abd Author: Hannes Reinecke Date: Mon May 11 10:24:23 2020 +0200 dm zoned: Introduce dmz_dev_is_dying() and dmz_check_dev() Introduce accessors dmz_dev_is_dying() and dmz_check_dev() to avoid having to reference the devices directly. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 2234e7321dc61f116de1dc913f3ffa7efff02068 Author: Hannes Reinecke Date: Mon May 11 10:24:22 2020 +0200 dm zoned: introduce dmz_metadata_label() to format device name Introduce dmz_metadata_label() to format the device-mapper device name and use it instead of the device name of the underlying device. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit 368205601375bbfb41b07ec8295eab208b6fced5 Author: Hannes Reinecke Date: Mon May 11 10:24:21 2020 +0200 dm zoned: move fields from struct dmz_dev to dmz_metadata Move fields from the device structure into the metadata structure and provide accessor functions. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit bf28a3ba098676831bde49e8bc47849727d532a5 Author: Hannes Reinecke Date: Mon May 11 10:24:20 2020 +0200 dm zoned: store device in struct dmz_sb Store the device together with the superblock so that we don't have to recur to the metadata to find it. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit 735bd7e4cd16270b7b67cb82ff4ba2811bfd8d7b Author: Hannes Reinecke Date: Mon May 11 10:24:19 2020 +0200 dm zoned: use array for superblock zones Instead of storing just the first superblock zone and calculate the secondary relative to that we should be using an array for holding the superblock zones. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal Reviewed-by: Bob Liu Signed-off-by: Mike Snitzer commit b71228739851a9b384a59ba0467259eba508b408 Author: Hannes Reinecke Date: Mon May 11 10:24:18 2020 +0200 dm zoned: store zone id within the zone structure and kill dmz_id() Instead of calculating the zone index by the offset within the zone array store the index within the structure itself. With that the helper dmz_id() is pointless and can be replaced with accessing the ->id value directly. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 90b39d58f39e1f3f3147caee6fb2a71528db74a2 Author: Hannes Reinecke Date: Mon May 11 10:24:17 2020 +0200 dm zoned: add 'message' callback Add callback for 'dmsetup message' to allow the reclaim process to be triggered manually. Eg. dmsetup message /dev/dm-X 0 message will start the reclaim process even if the default threshold of 50 percent of free random zones is not reached. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit bc3d5717d242a37d2e9ea85d7e7b2e3569324d24 Author: Hannes Reinecke Date: Mon May 11 10:24:16 2020 +0200 dm zoned: add 'status' callback Add callback to supply information for 'dmsetup status' and 'dmsetup table'. The output for 'dmsetup status' is 0 zoned zones / random / sequential where is the number of unmapped (ie free) random zones, the total number of random zones, the number of unmapped sequential zones, and the total number of sequential zones. Signed-off-by: Hannes Reinecke Reviewed-by: Bob Liu Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 2613eab11996c8d1439c2a44fbca52807be7faa6 Author: Khazhismel Kumykov Date: Thu Apr 30 16:48:30 2020 -0400 dm mpath: add Historical Service Time Path Selector This new selector keeps an exponential moving average of the service time for each path (losely defined as delta between start_io and end_io), and uses this along with the number of inflight requests to estimate future service time for a path. Since we don't have a prober to account for temporally slow paths, re-try "slow" paths every once in a while (num_paths * historical_service_time). To account for fast paths transitioning to slow, if a path has not completed any request within (num_paths * historical_service_time), limit the number of outstanding requests. To account for low volume situations where number of inflight IOs would be zero, the last finish time of each path is factored in. Signed-off-by: Khazhismel Kumykov Co-developed-by: Gabriel Krisman Bertazi Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Mike Snitzer commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b Author: Gabriel Krisman Bertazi Date: Thu Apr 30 16:48:29 2020 -0400 dm mpath: pass IO start time to path selector The HST path selector needs this information to perform path prediction. For request-based mpath, struct request's io_start_time_ns is used, while for bio-based, use the start_time stored in dm_io. Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Mike Snitzer commit 48338daaa00e6137a43fa5d0e54b763aa34f450b Author: Mikulas Patocka Date: Wed Apr 29 12:30:03 2020 -0400 dm writecache: improve performance on DDR persistent memory (Optane) When testing the dm-writecache target on a real DDR persistent memory (Intel Optane), it turned out that explicit cache flushing using the clflushopt instruction performs better than non-temporal stores for block sizes 1k, 2k and 4k. The dm-writecache target is singlethreaded (all the copying is done while holding the writecache lock), so it benefits from clwb, see: http://lore.kernel.org/r/alpine.LRH.2.02.2004160411460.7833@file01.intranet.prod.int.rdu2.redhat.com Add a new function memcpy_flushcache_optimized() that tests if clflushopt is present - and if it is, we use it instead of memcpy_flushcache. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 499c18045eab16656ef4159c35b05865038f9f25 Author: Mikulas Patocka Date: Sun Apr 19 04:34:00 2020 -0400 dm writecache: remove superfluous test in persistent_memory_claim Remove superfluous test if dax_dev is NULL - dax_direct_access already does this test. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 9431cf6efc3659eaa1cdd591e02a09045bc9983f Author: Zhiqiang Liu Date: Wed Apr 15 19:57:31 2020 +0800 dm persistent data: switch exit_ro_spine to return void In commit 4c7da06f5a78 ("dm persistent data: eliminate unnecessary return values"), r value in exit_ro_spine will not change, so exit_ro_spine doesn't need a return value. Signed-off-by: Zhiqiang Liu Signed-off-by: Mike Snitzer commit a86fe8be514534363c8fb12a3a38bdba6354316b Author: YueHaibing Date: Wed Apr 8 07:29:48 2020 +0000 dm integrity: remove set but not used variables Fixes gcc '-Wunused-but-set-variable' warning: drivers/md/dm-integrity.c: In function 'integrity_metadata': drivers/md/dm-integrity.c:1557:12: warning: variable 'save_metadata_offset' set but not used [-Wunused-but-set-variable] drivers/md/dm-integrity.c:1556:12: warning: variable 'save_metadata_block' set but not used [-Wunused-but-set-variable] They are never used, so remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Mike Snitzer commit a5089a95d84c1e861e2d1f549ae368c8e89e3674 Author: Heinz Mauelshagen Date: Wed Apr 29 16:47:03 2020 +0200 dm ebs: pass discards down to underlying device Make use of dm_bufio_issue_discard() to pass discards down to the underlying device. Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit 6fbeb0048e6b93f7b7f195864f3ddc876ac4d42e Author: Mikulas Patocka Date: Fri Feb 7 15:59:25 2020 -0500 dm bufio: implement discard Add functions dm_bufio_issue_discard and dm_bufio_discard_buffers. dm_bufio_issue_discard sends discard request to the underlying device. dm_bufio_discard_buffers frees buffers in the range and then calls dm_bufio_issue_discard. Also, factor out block_to_sector for reuse in dm_bufio_issue_discard. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit d3c7b35c20d60650bac8b55c17b194adda03a979 Author: Heinz Mauelshagen Date: Mon Mar 9 23:26:38 2020 +0100 dm: add emulated block size target This new target is similar to the linear target except that it emulates a smaller logical block size on a device with a larger logical block size. Its main purpose is to emulate 512 byte sectors on 4K native disks (i.e. 512e). See Documentation/admin-guide/device-mapper/dm-ebs.rst for details. Reviewed-by: Damien Le Moal Signed-off-by: Heinz Mauelshagen Signed-off-by: Randy Dunlap [Kconfig fixes] Signed-off-by: Zheng Bin [static fixes] Signed-off-by: Mike Snitzer commit 2361ae595352dec015d14292f1b539242d8446d6 Author: Martin Wilck Date: Mon Apr 20 22:29:09 2020 +0200 dm mpath: switch paths in dm_blk_ioctl() code path SCSI LUN passthrough code such as qemu's "scsi-block" device model pass every IO to the host via SG_IO ioctls. Currently, dm-multipath calls choose_pgpath() only in the block IO code path, not in the ioctl code path (unless current_pgpath is NULL). This has the effect that no path switching and thus no load balancing is done for SCSI-passthrough IO, unless the active path fails. Fix this by using the same logic in multipath_prepare_ioctl() as in multipath_clone_and_map(). Note: The allegedly best path selection algorithm, service-time, still wouldn't work perfectly, because the io size of the current request is always set to 0. Changing that for the IO passthrough case would require the ioctl cmd and arg to be passed to dm's prepare_ioctl() method. Signed-off-by: Martin Wilck Reviewed-by: Hannes Reinecke Signed-off-by: Mike Snitzer commit 27f5411a718c431c20007e3a2fbba6589942d04f Author: Dmitry Baryshkov Date: Mon Apr 20 16:46:59 2020 +0300 dm crypt: support using encrypted keys Allow one to use "encrypted" in addition to "user" and "logon" key types for device encryption. Signed-off-by: Dmitry Baryshkov Signed-off-by: Mike Snitzer commit 57c76221d5af648c8355a55c09b050c5d8d38189 Author: Akira Shimahara Date: Mon May 11 22:38:20 2020 +0200 w1_therm: adding bulk read support to trigger multiple conversion on bus Adding bulk read support: Sending a 'trigger' command in the dedicated sysfs entry of bus master device send a conversion command for all the slaves on the bus. The sysfs entry is added as soon as at least one device supporting this feature is detected on the bus. The behavior of the sysfs reading temperature on the device is as follow: * If no bulk read pending, trigger a conversion on the device, wait for the conversion to be done, read the temperature in device RAM * If a bulk read has been trigger, access directly the device RAM This behavior is the same on the 2 sysfs entries ('temperature' and 'w1_slave'). Reading the therm_bulk_read sysfs give the status of bulk operations: * '-1': conversion in progress on at least 1 sensor * '1': conversion complete but at least one sensor has not been read yet * '0': no bulk operation. Reading temperature on ecah device will trigger a conversion As not all devices support bulk read feature, it has been added in device family structure. The attribute is set at master level as soon as a supporting device is discover. It is removed when the last supported device leave the bus. The count of supported device is kept with the static counter bulk_read_device_counter. A strong pull up is apply on the line if at least one device required it. The duration of the pull up is the max time required by a device on the line, which depends on the resolution settings of each device. The strong pull up could be adjust with the a module parameter. Updating documentation in Documentation/ABI/testing/sysfs-driver-w1_therm and Documentation/w1/slaves/w1_therm.rst accordingly. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203820.411483-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit e2c94d6f572079511945e64537eb1218643f2e68 Author: Akira Shimahara Date: Mon May 11 22:38:01 2020 +0200 w1_therm: adding alarm sysfs entry Adding device alarms settings by a dedicated sysfs entry alarms (RW): read or write TH and TL in the device RAM. Checking devices in alarm state could be performed using the master search command. As alarms temperature level are store in a 8 bit register on the device and are signed values, a safe cast shall be performed using the min and max temperature that device are able to measure. This is done by int_to_short inline function. A 'write_data' field is added in the device structure, to bind the correct writing function, as some devices may have 2 or 3 bytes RAM. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203801.411253-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit 67b392f7b8edfa6f427fecd98722acab34c1c99f Author: Akira Shimahara Date: Mon May 11 22:37:42 2020 +0200 w1_therm: optimizing temperature read timings Optimizing temperature reading by reducing waiting conversion time according to device resolution settings, as per device specification. This is device dependent as not all the devices supports resolution setting, so it has been added in device family structures. The process to read the temperature on the device has been adapted in a new function 'convert_t()', which replace the former 'read_therm()', is introduce to deal with this timing. Strong pull up is also applied during the required time, according to device power status needs and 'strong_pullup' module parameter. 'temperature_from_RAM()' function is introduced to get the correct temperature computation (device dependent) from device RAM data. An new sysfs entry has been added to ouptut only temperature. The old entry w1_slave has been kept for compatibility, without changing its output format. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203742.411039-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit 45d457a4cf24455eefd076a01a3d86414fc2ff1e Author: Akira Shimahara Date: Mon May 11 22:37:25 2020 +0200 w1_therm: adding eeprom sysfs entry The driver implement 2 hardware functions to access device RAM: * copy_scratchpad * recall_scratchpad They act according to device specifications. As EEPROM operations are not device dependent (all w1_therm can perform EEPROM read/write operation following the same protocol), it is removed from device families structures. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203725.410844-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit 308bdb94de0c1abe7eac5193f58638b8aeaddf4b Author: Akira Shimahara Date: Mon May 11 22:37:08 2020 +0200 w1_therm: adding resolution sysfs entry Adding resolution sysfs entry (RW) to get or set the device resolution Write values are managed as follow: * '9..12': resolution to set in bit * Anything else: do nothing Read values are : * '9..12': device resolution in bit * '-xx': xx is kernel error when reading the resolution Only supported devices will show the sysfs entry. A new family has been created for DS18S20 devices as they do not implement resolution feature. The resolution of each device is check when the device is discover by the bus master, in 'w1_therm_add_slave(struct w1_slave *)'. The status is stored in the device structure w1_therm_family_data so that the driver always knows the resolution of each device, which could be used later to determine the required conversion duration (resolution dependent). The resolution is re evaluate each time a user read or write the sysfs entry. To avoid looping through the w1_therm_families at run time, the pointer 'specific_functions' is set up to the correct 'w1_therm_family_converter' when the slave is added (which mean when it is discovered by the master). This initialization is done by a helper function 'device_family(struct w1_slave *sl)', and a dedicated macro 'SLAVE_SPECIFIC_FUNC(sl)' allow the access to the specific function of the slave device. 'read_scratchpad' and 'write_scratchpad' are the hardware functions to access the device RAM, as per protocol specification. It cancel the former 'precision' functions, which was only set and never read (so not stored in the device struct). Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203708.410649-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit b7bb6ca17a90f47c2fe2848531b5bbaf27a65ba7 Author: Akira Shimahara Date: Mon May 11 22:36:50 2020 +0200 w1_therm: adding ext_power sysfs entry Adding ext_power sysfs entry (RO). Return the power status of the device: - 0: device parasite powered - 1: device externally powered - xx: xx is kernel error The power status of each device is check when the device is discover by the bus master, in 'w1_therm_add_slave(struct w1_slave *)'. The status is stored in the device structure w1_therm_family_data so that the driver always knows the power state of each device, which could be used later to determine the required strong pull up to apply on the line. The power status is re evaluate each time the sysfs ext_power read by a user. The hardware function 'read_powermode(struct w1_slave *sl)' act just as per device specifications, sending W1_READ_PSUPPLY command on the bus, and issue a read time slot, reading only one bit. A helper function 'bool bus_mutex_lock(struct mutex *lock)' is introduced. It try to aquire the bus mutex several times (W1_THERM_MAX_TRY), waiting W1_THERM_RETRY_DELAY between two attempt. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203650.410439-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit daa3cfeb1971fd07b9c00ce452b3e3ff3298fa13 Author: Akira Shimahara Date: Mon May 11 22:36:31 2020 +0200 w1_therm: adding sysfs-driver-w1_therm doc Adding a sysfs-driver-w1_therm documentation file in Documentation/ABI/testing. It describe the onlys sysfs entry of w1_therm module, based on Documentation/w1/slaves/w1_therm.rst Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203631.410227-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit c8ad65f6fbfdcb9b620674ef456020eef2bfeb36 Author: Akira Shimahara Date: Mon May 11 22:36:10 2020 +0200 w1_therm: fix reset_select_slave during discovery Fix reset_select_slave issue during devices discovery by the master on bus. The w1_reset_select_slave() from w1_io.c, which was previously used, assume that if the slave count is 1 there is only one slave attached on the bus. This is not always true. For example when discovering devices, when the first device is discover by the bus master, its slave count is 1, but some other slaves may be on the bus. In that case instead of adressing command to the attached slave the master throw a SKIP ROM command so that all slaves attached on the bus will answer simultenaously causing data collision. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203610.409975-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit 92b8d2724464bc1d2e735a84c0da5741dce33485 Author: Akira Shimahara Date: Mon May 11 22:35:35 2020 +0200 w1_therm: adding code comments and code reordering Adding code comments to split code in dedicated parts. After the global declarations (defines, macros and function declarations), code is organized as follow : - Device and family dependent structures and functions - Interfaces functions - Helpers functions - Hardware functions - Sysfs interface functions Signed-off-by: Akira Shimahara Link: https://lore.kernel.org/r/20200511203535.409599-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman commit 691e0f2c74cce6866affcdd8277a7d4c521814dc Author: Souptick Joarder Date: Wed May 6 01:48:32 2020 +0530 VMCI: Avoid extra check for access_ok() get_user_pages_fast() is already having a check for the same. This double check can be removed. Signed-off-by: Souptick Joarder Link: https://lore.kernel.org/r/1588709912-8065-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0548745fa335a4665b039b9fd8e121339932c24b Author: Tang Bin Date: Thu May 7 19:12:24 2020 +0800 dca: Use PTR_ERR_OR_ZERO() to simplify code The function PTR_ERR_OR_ZERO() contains the check of IS_ERR() and the return of PTR_ERR() or zero. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200507111224.4176-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit cafa1a5b220a22ae0066e2a1da81065bdbb87e45 Author: Angelo Dureghello Date: Thu May 7 21:50:50 2020 +0200 w1: ds2430: fix eeprom size in driver description Non functional fix, set Kb to b, to avoid any misundertanding. Signed-off-by: Angelo Dureghello Link: https://lore.kernel.org/r/20200507195050.472483-1-angelo.dureghello@timesys.com Signed-off-by: Greg Kroah-Hartman commit 74003385cf716f1b88cc7753ca282f5493f204a2 Author: Srinivas Kandagatla Date: Tue May 12 12:09:30 2020 +0100 misc: fastrpc: fix potential fastrpc_invoke_ctx leak fastrpc_invoke_ctx can have refcount of 2 in error path where rpmsg_send() fails to send invoke message. decrement the refcount properly in the error path to fix this leak. This also fixes below static checker warning: drivers/misc/fastrpc.c:990 fastrpc_internal_invoke() warn: 'ctx->refcount.refcount.ref.counter' not decremented on lines: 990. Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context") Reported-by: Dan Carpenter Signed-off-by: Srinivas Kandagatla Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200512110930.2550-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0978de9fc7335c73934ab8fac189fb4cb3f23191 Author: Srinivas Kandagatla Date: Mon May 11 17:27:22 2020 +0100 misc: fastrpc: Fix an incomplete memory release in fastrpc_rpmsg_probe() fastrpc_channel_ctx is not freed if misc_register() fails, this would lead to a memory leak. Fix this leak by adding kfree in misc_register() error path. Fixes: 278d56f970ae ("misc: fastrpc: Reference count channel context") Signed-off-by: Srinivas Kandagatla Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200511162722.2552-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 01360857486c0e4435dea3aa2f78b47213b7cf6a Author: Saravana Kannan Date: Mon May 11 16:13:34 2020 +0100 slimbus: core: Fix mismatch in of_node_get/put Adding missing corresponding of_node_put Fixes: 7588a511bdb4 ("slimbus: core: add support to device tree helper") Signed-off-by: Saravana Kannan [Srini: added fixes tag, removed NULL check and updated log] Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200511151334.362-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit dbf4d13382be7b272417025f5f6687641eb7dd21 Author: Saravana Kannan Date: Mon May 11 16:13:33 2020 +0100 slimbus: core: Set fwnode for a device when setting of_node When setting the of_node for a newly created device, also set the fwnode. This allows fw_devlink feature to work for slimbus devices. Also, remove some unnecessary NULL checks. The functions in question already do NULL checks. Signed-off-by: Saravana Kannan [Srini: removed unnecessary NULL check from other patch] Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200511151334.362-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit e270df39f728fd47771613f1147b26a600d183e8 Author: Samuel Zou Date: Mon May 11 15:50:42 2020 +0100 nvmem: jz4780-efuse: Use PTR_ERR_OR_ZERO() to simplify code Fixes coccicheck warning: drivers/nvmem/jz4780-efuse.c:214:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200511145042.31223-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit b96fc5416b099a0c2509ca07a80b140d34db2b9b Author: Michael Auchter Date: Mon May 11 15:50:41 2020 +0100 nvmem: ensure sysfs writes handle write-protect pin Commit 2a127da461a9 ("nvmem: add support for the write-protect pin") added support for handling write-protect pins to the nvmem core, and Commit 1c89074bf850 ("eeprom: at24: remove the write-protect pin support") retrofitted the at24 driver to use this support. These changes broke write() on the nvmem sysfs attribute for eeproms which utilize a write-protect pin, as the write callback invokes the nvmem device's reg_write callback directly which no longer handles changing the state of the write-protect pin. Change the read and write callbacks for the sysfs attribute to invoke nvmme_reg_read/nvmem_reg_write helpers which handle this, rather than calling reg_read/reg_write directly. Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin") Signed-off-by: Michael Auchter Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200511145042.31223-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0e2abffdf928c57af9dfb334e9aa54e430e3b424 Author: Anson Huang Date: Mon May 11 15:50:40 2020 +0100 nvmem: imx-ocotp: Improve logic to save many code lines Several logic improvements to save many code lines: - no need to use goto; - no need to assign return value; - combine different conditions of return value into one line. Signed-off-by: Anson Huang Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200511145042.31223-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 65f0539b1d063a186723c5c9a7eb17d1962c84a0 Author: Christophe JAILLET Date: Sun May 10 15:03:57 2020 +0200 firmware: xilinx: Fix an error handling path in 'zynqmp_firmware_probe()' If 'mfd_add_devices()' fails, we must undo 'zynqmp_pm_api_debugfs_init()' otherwise some debugfs directory and files will be left. Just move the call to 'zynqmp_pm_api_debugfs_init()' a few lines below to fix the issue. Fixes: e23d9c6d0d49 ("drivers: soc: xilinx: Add ZynqMP power domain driver") Signed-off-by: Christophe JAILLET Reviewed-by: Jolly Shah Link: https://lore.kernel.org/r/20200510130357.233364-1-christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 286adb4cce00d2ed37eb20a19ce366d1d58adf42 Author: Harshal Chaudhari Date: Sun May 10 22:13:08 2020 +0530 misc: xilinx-sdfec: convert to module_platform_driver() The driver init and exit function don't do anything besides registering and unregistering the platform driver, so the module_platform_driver() macro could just be used instead of having separate functions. Signed-off-by: Harshal Chaudhari Acked-by: Dragan Cvetic Link: https://lore.kernel.org/r/20200510164308.31358-1-harshalchau04@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7066c2f61ce49b131026fec68ed1c9b0d0d9a05a Author: Chuhong Yuan Date: Thu May 7 23:13:43 2020 +0800 uio_hv_generic: add missed sysfs_remove_bin_file This driver calls sysfs_create_bin_file() in probe, but forgets to call sysfs_remove_bin_file() in remove. Add the missed call to fix it. Signed-off-by: Chuhong Yuan Link: https://lore.kernel.org/r/20200507151343.792816-1-hslester96@gmail.com Signed-off-by: Greg Kroah-Hartman commit f877a18c08fa6674364e469f318a3069c68204d2 Merge: 84c1e51d7df8 a2b9d4eadb77 Author: Greg Kroah-Hartman Date: Fri May 15 16:09:24 2020 +0200 Merge tag 'fpga-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next Moritz writes: FPGA Manager changes for 5.8 Here's the first set of changes for the 5.8-rc1 merge window. Dominic's change adds support for accessing AFU regions with gdb. Gustavo's change is a cleanup patch regarding variable lenght arrays. Richard's changes update dt-bindings and add support for stratix and agilex. Sergiu's changes update spi transfers with the new delay field. Xu's change addresses an issue with a wrong return value. Shubhrajyoti's change makes the Zynq FPGA driver return -EPROBE_DEFER on check of devm_clk_get failure. Xu's change for DFL enables multiple opens. All of these patches have been reviewed, have appropriate Acked-by's and have been in the last few linux-next releases without issues. Signed-off-by: Moritz Fischer * tag 'fpga-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: dfl: afu: support debug access to memory-mapped afu regions fpga: dfl.h: Replace zero-length array with flexible-array member arm64: dts: agilex: correct service layer driver's compatible value dt-bindings, firmware: add compatible value Intel Stratix10 service layer binding fpga: stratix10-soc: add compatible property value for intel agilex arm64: dts: agilex: correct FPGA manager driver's compatible value dt-bindings: fpga: add compatible value to Stratix10 SoC FPGA manager binding fpga: machxo2-spi: Use new structure for SPI transfer delays fpga: ice40-spi: Use new structure for SPI transfer delays fpga: dfl: support multiple opens on feature device node. commit cef077e6aa4c7dbe2f23e1201cf705f9540ec467 Merge: c336c022503d 6b46ddb51eab Author: Greg Kroah-Hartman Date: Fri May 15 16:03:28 2020 +0200 Merge tag 'iio-for-5.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of new device support, cleanups and features for IIO in the 5.8 cycle Usual mixed back but with a few subsystem wide or device type wide cleanups. New device support * adis16475 - New driver supporting adis16470, adis16475, adis16477, adis16465, adis16467, adis16500, adis16505 and adis16507. Includes some rework of the adis library to simplify using it for this new driver. * ak8974 - Add support for Alps hscdt008a. ID only. Related patches add support for scale. * atlas-sensor - Add support for RTD-SM OEM temperature sensor. * cm32181 - Add support for CM3218 including support for SMBUS alert via ACPI resources. * ltc2632 - Add support for ltc2634-12/10/8 DACS including handling per device type numbers of channels. Major Features * cm32181 - ACPI bindings including parsing CPM0 and CPM1 custom ACPI tables. Includes minor tidy ups and fixes. * vcnl4000 - Add event support - Add buffered data capture support - Add control of sampling frequency Cleanups and minor fixes. * core - Trivial rework of iio_device_alloc to use an early return and improve readability. - Precursors to addition of multiple buffer support. So far minor refactoring. * subsystem wide - Use get_unaligned_be24 slightly improve readability over open coding it. * adis drivers - Use iio_get_debugfs_dentry access function. * bh1780, cm32181, cm3232, gp2ap02a00f, opt3001, st_uvis25, vl6180, dmard06, kxsd9 - Drop use of of_match_ptr to allow ACPI based probing via PRP0001. Part of clear out of this to avoid cut and paste into new drivers. * ad5592r, ad5593r - Fix typos * ad5933 - Use managed interfaces to automate error handling and remove. * ak8974 - Fix wrong number of 'real bits' for buffered data. - Refactor to pull measurement code out as separate function. bmp280 - Fix lack of clamp on range during data capture. * at91-sama5d2_adc - Handle unfinished conversions correctly. - Allow use of triggers other than it's own. - Reorganize buffer setup and tear down as part of long running subsystem wide rework. * ccs811 - Add DT binding docs and match table. - Support external reset and wakeup pins. * hid-sensors - Reorganize buffer setup and tear down as part of long running subsystem wide rework. * ltr501 - Constify some structs. * vcnl4000 - Fix an endian issue by using explicit byte swapped i2c accessors. * tag 'iio-for-5.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (74 commits) iio: light: ltr501: Constify structs staging: iio: ad5933: attach life-cycle of kfifo buffer to parent device and use managed calls throughout iio: bmp280: fix compensation of humidity iio: light: cm32181: Fix integartion time typo iio: light: cm32181: Add support for parsing CPM0 and CPM1 ACPI tables iio: light: cm32181: Make lux_per_bit and lux_per_bit_base_it runtime settings iio: light: cm32181: Use units of 1/100000th for calibscale and lux_per_bit iio: light: cm32181: Change reg_init to use a bitmap of which registers to init iio: light: cm32181: Handle CM3218 ACPI devices with 2 I2C resources iio: light: cm32181: Clean up the probe function a bit iio: light: cm32181: Add support for the CM3218 iio: light: cm32181: Add some extra register defines iio: light: cm32181: Add support for ACPI enumeration iio: light: cm32181: Switch to new style i2c-driver probe function iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger iio: vcnl4000: Add buffer support for VCNL4010/20. iio: vcnl4000: Add sampling frequency support for VCNL4010/20. iio: vcnl4000: Add event support for VCNL4010/20. iio: vcnl4000: Factorize data reading and writing. iio: vcnl4000: Fix i2c swapped word reading. ... commit c336c022503d1be719ca06f2526c211709e3d2d3 Author: Jérôme Pouiller Date: Fri May 15 10:33:25 2020 +0200 staging: wfx: remove false positive warning When a station is removed, the driver check that all the Tx frames were correctly sent. However, the station can be removed before all the Tx frames were acknowledged and a false positive warning can be emitted. The previous commit has added a trace when driver received an acknowledge for a non-existent station. It appear that these events are perfectly correlated and there is no leak. Now, the subject is perfectly understood. Remove the warning. Just keep a debug trace in case we have any doubt in the future. In the past, the subject has already been discussed here: https://lore.kernel.org/driverdev-devel/6287924.ghGFUMk3OD@pc-42/ Fixes: 4bbc6a3e7ad0 ("staging: wfx: make warning about pending frame less scary") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 07d51346b0686ac12d9cb7a526de3b547cd62c60 Author: Jérôme Pouiller Date: Fri May 15 10:33:24 2020 +0200 staging: wfx: trace acknowledges not linked to any stations Some resources are associated to the outgoing of the stations. To avoid any resource leaks. It is important to understand why an acknowledge is not associated to any station. Add a trace for that purpose. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7c5fc1d88c1e91b3319145fe30f291a2cb9b393a Author: Jérôme Pouiller Date: Fri May 15 10:33:23 2020 +0200 staging: wfx: remove false-positive WARN() The function wfx_tx_flush() wait for there is no more queued frames in hardware queue. Then, for the sanity, it checks that there is no more pending frame on any AC queue. However, there is a race here. It may happens that hardware queues are empty, but the counters of the AC queues are not yet updated. So, it may produce false-positive warning. The easiest way to solve the problem is just to remove the sanity check. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a1ae4d07fd94da1b3f7597f1594af2e35f1065cc Author: Jérôme Pouiller Date: Fri May 15 10:33:22 2020 +0200 staging: wfx: fix error reporting in wfx_start_ap() If AP did not start, the error was not reported to mac80211. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ac0e50a5a3cb6b6c41c4e568144f780a89bd0d54 Author: Jérôme Pouiller Date: Fri May 15 10:33:21 2020 +0200 staging: wfx: drop unnecessary filter configuration when disabling filter Currently, when mac80211 want to disable beacon filtering, the driver reset the filter table and disable the beacon filtering. Only the latter action is required. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f75818c251cb31c47e751ce15f97758a92132df7 Author: Jérôme Pouiller Date: Fri May 15 10:33:20 2020 +0200 staging: wfx: fix PS parameters when multiple vif are in use When multiple vif are in use (= one access point and one station), and when the channels are different, it is necessary to enable power save on station. The firmware check that steps are done in the correct order: - AP can't start if PS is not enable on the station - PS can't set on the station before the association has finished (= before the call set_bss_params) Obviously, in add, when one of the interface disappears, it is necessary to restore the power save status. wfx_update_pm() is able to set the correct PS configuration. But it has to be called at the right time: 1. before hif_start(), but after the channel configuration is known 2. after hif_set_bss_params() 3. after hif_reset() Therefore, the call to wfx_update_pm() from wfx_add_interface() is too early to address 1. The call after hif_set_bss_params() already exists. For the symmetry, the call from wfx_remove_interface() (that handle 3.) is also relocated. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f214b7b6e7c959b4306df8e5c687887c547e38b6 Author: Jérôme Pouiller Date: Fri May 15 10:33:19 2020 +0200 staging: wfx: fix potential dead lock between join and scan The device disallows to start a scan request between hif_join() and hif_set_bss_params(). The driver is not protected against that. The worst case happens when association is aborted and hif_set_bss_params() never happens. mac80211 would never ask for scan during the association process. So, this patch just aborts the association in progress when scan is requested. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b3a71adf4d580b6382944e2c2ead392ba65e5243 Author: Jérôme Pouiller Date: Fri May 15 10:33:18 2020 +0200 staging: wfx: merge wfx_stop_ap() with wfx_reset() wfx_stop_ap() and wfx_reset() do the same thing. Merge them. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 5a48a4a3efb45fb18970c05e3a6b6bf5d72dbb7a Author: Jérôme Pouiller Date: Fri May 15 10:33:17 2020 +0200 staging: wfx: rename wfx_do_unjoin() into wfx_reset() In fact, wfx_do_unjoin() resets the interface. This mechanism can be used in more cases than just disassociating from a BSS. So, rename it to reflect that fact. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 13839ef377124956dac8a58887abfd7d8d9414ca Author: Jérôme Pouiller Date: Fri May 15 10:33:16 2020 +0200 staging: wfx: fix potential use-after-free wfx_tx_policy_put() use data from the skb. However, the call to skb_pull() has just discarded them (even if the memory is in fact not really discarded). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ad83396891cd80f807ce271830fb5fd029b9dd92 Author: Jérôme Pouiller Date: Fri May 15 10:33:15 2020 +0200 staging: wfx: call wfx_tx_update_sta() before to destroy tx_priv The function wfx_notify_buffered_tx() need to know if the frame was associated to a station. This information is available in the Control Buffer (CB) of the skb. However, when wfx_notify_buffered_tx() is called, the CB is no more available. Thus, the caller has to take care of this information. wfx_notify_buffered_tx() is a specific case. All the other function are called before the destruction of the CB. So, this patch align the API of wfx_notify_buffered_tx() with the other functions. Call it before the CB was destroyed and drop the extra argument 'has_sta'. It is also the right time to rename it into wfx_tx_update_sta() (which is closer to the behavior of the function). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 4e5e3cb02104a611157c24a3672ffe5ce5262711 Author: Jérôme Pouiller Date: Fri May 15 10:33:14 2020 +0200 staging: wfx: split out wfx_tx_fill_rates() from wfx_tx_confirm_cb() wfx_tx_confirm_cb() is a big function. A big part of its body aims to fill the rates list. So, create a new function wfx_tx_fill_rates() and make wfx_tx_confirm_cb() smaller. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 298913e3364354e7782ae75b65a2b204888e2a41 Author: Jérôme Pouiller Date: Fri May 15 10:33:13 2020 +0200 staging: wfx: fix status of dropped frames When wfx_flush() is called, the status of pending frames are reported to mac80211 with random status. mac80211 probably won't interpret this status in this case, but it is cleaner to return a correctly initialized status. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit d64d7376688ba249248cc91ccafe5d71812d812e Author: Jérôme Pouiller Date: Fri May 15 10:33:12 2020 +0200 staging: wfx: fix indentation Fix indention of wfx_skb_dtor(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6598b12d6635e8e3060863b84c04e472546ee126 Author: Jérôme Pouiller Date: Fri May 15 10:33:10 2020 +0200 staging: wfx: fix value of scan timeout Before to start the scan request, the firmware signals (with a null frame) to the AP it won't be able to receive data. This frame can be long to send: up to 512TU. The current calculus of the scan timeout does not take into account this delay. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 201451cfe404ccd93b8bef627f5756cae095b668 Author: Jérôme Pouiller Date: Fri May 15 10:33:09 2020 +0200 staging: wfx: check pointers returned by allocations Until now, the driver did not always check if the allocations success. The issue was discussed here: https://lore.kernel.org/netdev/2026476.QLiXXEGFCf@pc-42/ Reported-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a72319bf282710a03a71380413eca88ea7ffe9bd Author: Jérôme Pouiller Date: Fri May 15 10:33:08 2020 +0200 staging: wfx: apply 80-columns rule to strings Strings are allowed to exceed 80 columns but, in this case, the format arguments should be placed on a new line. Apply this rule to the whole code of the driver. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9773cf1c1a803ea6c5f2726489d9bd518c17f869 Author: Jérôme Pouiller Date: Fri May 15 10:33:07 2020 +0200 staging: wfx: fix warning when unregister a frozen device The device does not answer to the command hif_shutdown. Therefore, hif_shutdown() is a bit special. It bypasses some of work normally made by wfx_cmd_send(). In particularly, it unlock hif_cmd.lock and hif_cmd.key_renew_lock. However, if the driver notice that the device is frozen, wfx_cmd_send() stops to send data and doesn't lock the mutexes. Then, it produced a warning when hif_shutdown() tried to unlock these mutexes. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200515083325.378539-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 3abbab51321f51bdb1c64f2296644110c7a61f62 Author: Matej Dujava Date: Wed May 13 21:15:50 2020 +0200 staging: vt6656: vt6655: removing unused macros definition Makefiles This patch is removing definition of CFLAGS in Makefile of vt6656 and vt6655, as those are defining macros that are not used. This will remove undef of one macro from vt6655/device_main.c, as it is only undef and it is not used anywhere else, so it is safe to remove it. Macros are removed from vt665x/Makefile and vt6655/device_main.c. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1589397351-24655-2-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit f03c9b7884720973d1673fbb64f808897ca88a12 Author: Oliver Graute Date: Wed May 13 16:30:46 2020 +0200 staging: fbtft: fb_st7789v: Initialize the Display Set Gamma Values and Register Values for the HSD20_IPS Panel Signed-off-by: Oliver Graute Link: https://lore.kernel.org/r/1589380299-21871-1-git-send-email-oliver.graute@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec269f1250c677ae9c1d493d900075ae0c191526 Author: Xiangyang Zhang Date: Wed May 13 21:00:42 2020 +0800 staging: qlge: Remove unnecessary spaces in qlge_main.c Fix checkpatch.pl check: CHECK: No space is necessary after a cast Signed-off-by: Xiangyang Zhang Link: https://lore.kernel.org/r/20200513130042.13185-1-xyz.sun.ok@gmail.com Signed-off-by: Greg Kroah-Hartman commit 619f70f0f44a69ed6a2df8bae05e2c354a874562 Author: John Oldman Date: Wed May 13 13:54:05 2020 +0100 staging: vc04_services: Block comment alignment Coding style issue reported by checkpatch.pl This patch clears the checkpatch.pl "Block comments should align the * on each line" warning. Also cleared /****** and blank line. Signed-off-by: John Oldman Link: https://lore.kernel.org/r/20200513125405.28242-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman commit 6064aeefa88c7c1bbb44737db55c5ff83f47718f Author: Johan Hovold Date: Thu May 14 09:05:48 2020 +0200 staging: greybus: uart: replace driver line-coding struct Drop the driver version of the line-coding request and use the protocol definition directly as was originally intended instead. This specifically avoids having the two versions of what is supposed to be the same struct ever getting out of sync. Note that this has in fact already happened once when the protocol definition had its implicit padding removed while the driver struct wasn't updated. The fact that we used the size of the then larger driver struct when memcpying its content to the stack didn't exactly make things better. A later addition of a flow-control field incidentally made the structures match again. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20200514070548.4423-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit b14109f302d01899a8d7aad0d9a2097faa5fb486 Author: Anson Huang Date: Fri May 15 20:58:01 2020 +0800 tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Use __maybe_unused for power management related functions to simplify the code. Signed-off-by: Anson Huang Link: https://lore.kernel.org/r/1589547481-25932-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Greg Kroah-Hartman commit 2478be82de44bee4346eb1f48d4cfa28cd99d2d0 Author: Vinod Koul Date: Thu May 14 17:50:39 2020 +0530 usb: renesas-xhci: Add ROM loader for uPD720201 uPD720201 supports ROM and allows software to program the ROM and boot from it. Add support for detecting if ROM is present, if so load the ROM if not programmed earlier. Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200514122039.300417-5-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit a66d21d7dba84deeaf3b296c43eafc11094b6f09 Author: Vinod Koul Date: Thu May 14 17:50:38 2020 +0530 usb: xhci: Add support for Renesas controller with memory Some rensas controller like uPD720201 and uPD720202 need firmware to be loaded. Add these devices in table and invoke renesas firmware loader functions to check and load the firmware into device memory when required. Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200514122039.300417-4-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8bd5741e3145e40c1e4f422fa5f1b9d7fe0644b3 Author: Christian Lamparter Date: Thu May 14 17:50:37 2020 +0530 usb: renesas-xhci: Add the renesas xhci driver This add a new driver for renesas xhci which is basically a firmware loader for uPD720201 and uPD720202 w/o ROM. The xhci-pci driver will invoke this driver for loading/unloading on relevant devices. This patch adds a firmware loader for the uPD720201K8-711-BAC-A and uPD720202K8-711-BAA-A variant. Both of these chips are listed in Renesas' R19UH0078EJ0500 Rev.5.00 "User's Manual: Hardware" as devices which need the firmware loader on page 2 in order to work as they "do not support the External ROM". The "Firmware Download Sequence" is describe in chapter "7.1 FW Download Interface" R19UH0078EJ0500 Rev.5.00 page 131. The firmware "K2013080.mem" is available from a USB3.0 Host to PCIe Adapter (PP2U-E card) "Firmware download" archive. An alternative version can be sourced from Netgear's WNDR4700 GPL archives. The release notes of the PP2U-E's "Firmware Download" ver 2.0.1.3 (2012-06-15) state that the firmware is for the following devices: - uPD720201 ES 2.0 sample whose revision ID is 2. - uPD720201 ES 2.1 sample & CS sample & Mass product, ID is 3. - uPD720202 ES 2.0 sample & CS sample & Mass product, ID is 2. [vkoul: fixed comments: used macros for timeout count and delay removed renesas_fw_alive_check cleaned renesas_fw_callback removed recursion for renesas_fw_download add register defines and field names move to a separate file make fw loader as sync probe so that we execute in probe and prevent race make xhci-pci-renesas a seprate module] Signed-off-by: Christian Lamparter Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200514122039.300417-3-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit ff4c65ca48f08f4781accfb1d224acd7c897070e Author: Vinod Koul Date: Thu May 14 17:50:36 2020 +0530 usb: hci: add hc_driver as argument for usb_hcd_pci_probe usb_hcd_pci_probe expects users to call this with driver_data set as hc_driver, that limits the possibility of using the driver_data for driver data. Add hc_driver as argument to usb_hcd_pci_probe and modify the callers ehci/ohci/xhci/uhci to pass hc_driver as argument and freeup the driver_data used Tested xhci driver on Dragon-board RB3, compile tested ehci, ohci and uhci. [For all but the xHCI parts] [For the xhci part] Suggested-by: Mathias Nyman Acked-by: Alan Stern Acked-by: Mathias Nyman Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200514122039.300417-2-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit b50220c136c0a080230438562057a10880a0a123 Author: Christian Gromm Date: Fri May 15 11:21:05 2020 +0200 Documentation: ABI: correct sysfs attribute description of MOST driver This patch fixes the ABI description file sysfs-bus-most. Signed-off-by: Christian Gromm Link: https://lore.kernel.org/r/1589534465-7423-8-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit dfeb9380eba403ed0fb296bf077a9f30e4dc55d6 Author: Christian Gromm Date: Fri May 15 11:21:04 2020 +0200 staging: most: usb: use macro ATTRIBUTE_GROUPS This patch makes use of the macro ATTRIBUTE_GROUPS to create the groups instead of defining them manually. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1589534465-7423-7-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 629e123df34a9c8aadf683c43928739e32f7a1d8 Author: Christian Gromm Date: Fri May 15 11:21:03 2020 +0200 staging: most: fix typo in Kconfig This patch corrects the typo in the Kconfig file where it says tranceiver instead of transceiver. Signed-off-by: Christian Gromm Reported-by: Randy Dunlap Link: https://lore.kernel.org/r/1589534465-7423-6-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 3dcf93fe546648b63ab92e98ba6fb706d0ac3b8c Author: Christian Gromm Date: Fri May 15 11:21:02 2020 +0200 staging: most: usb: use dev_dbg function This patch replaces the functions dev_notice with dev_dbg to silence the driver during normal operation. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1589534465-7423-5-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit c1a57be08e734baf1b89e4a5027cf78c68f29771 Author: Christian Gromm Date: Fri May 15 11:21:01 2020 +0200 staging: most: usb: check number of reported endpoints This patch checks the number of endpoints reported by the USB interface descriptor and throws an error if the number exceeds MAX_NUM_ENDPOINTS. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1589534465-7423-4-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit bffea154b24bd71851f883acb08399e43d598d01 Author: Christian Gromm Date: Fri May 15 11:21:00 2020 +0200 staging: most: usb: remove reference to USB error codes This patch removes the reference to the driver API file for USB error codes. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1589534465-7423-3-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 62573221240fdf338728c837b925cf0cf705378c Author: Christian Gromm Date: Fri May 15 11:20:59 2020 +0200 staging: most: usb: use dev_*() functions to print messages This patch removes the pr_*() functions and uses dev_*() instead. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1589534465-7423-2-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 98a09fb4cbb0b1a750259c285b3abe7e67717121 Merge: d7faa8ffb6be 6d649fca3491 Author: Linus Walleij Date: Fri May 15 15:06:00 2020 +0200 Merge tag 'intel-pinctrl-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v5.8-1 * Introduce GPIO driver for Jasper Lake * Fix long standing bug in Sunrisepoint-H PAD locking code * Enable pin configuration setting for GPIO chip for Baytrail * Work around race condition in Cherriview hardware when handle IRQ * Clean up Cherryview code to be closer to other drivers The following is an automated git shortlog grouped by driver: baytrail: - Use platform_get_irq_optional() explicitly - Enable pin configuration setting for GPIO chip cannonlake: - Use generic flag for special GPIO base treatment cherryview: - Add missing spinlock usage in chv_gpio_irq_handler - Use GENMASK() consistently - Re-use data structures from pinctrl-intel.h (part 2) icelake: - Use generic flag for special GPIO base treatment intel: - Move npins closer to pin_base in struct intel_community - Update description in struct intel_community - Add Intel Jasper Lake pin controller support - Introduce new flag to force GPIO base to be 0 - Introduce common flags for GPIO mapping scheme lynxpoint: - Use platform_get_irq_optional() explicitly sunrisepoint: - Fix PAD lock register offset for SPT-H tigerlake: - Use generic flag for special GPIO base treatment commit 0ca650c430404708a6e8bea75e5f92ce8448f098 Author: Emil Velikov Date: Wed May 13 22:43:51 2020 +0100 rcu: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: rcu@vger.kernel.org Reviewed-by: Paul E. McKenney Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-11-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6400b5a0f604298a03748b96693a77d12b479998 Author: Emil Velikov Date: Wed May 13 22:43:50 2020 +0100 kernel/power: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-pm@vger.kernel.org Acked-by: Rafael J. Wysocki Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-10-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit c69b470eb85798514723ffa2686da6d21198c0d0 Author: Emil Velikov Date: Wed May 13 22:43:49 2020 +0100 kdb: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: Jason Wessel Cc: Daniel Thompson Cc: kgdb-bugreport@lists.sourceforge.net Acked-by: Daniel Thompson Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-9-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit c1a01f290103d61c72c14de135c259d952e81847 Author: Emil Velikov Date: Wed May 13 22:43:48 2020 +0100 drm: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org Reviewed-by: Daniel Vetter Acked-by: Daniel Vetter Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-8-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 116214d4e8fb3799ad704ff552df20a5815b34ea Author: Emil Velikov Date: Wed May 13 22:43:47 2020 +0100 sparc64: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Acked-by: David S. Miller Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-7-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit fff134c2e8dd948de595ab21575fd66d5ddabb3d Author: Emil Velikov Date: Wed May 13 22:43:46 2020 +0100 powerpc/xmon: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-6-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 675cacf11462f112ab13d57e1163082161ef8708 Author: Emil Velikov Date: Wed May 13 22:43:45 2020 +0100 MIPS: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Acked-by: Thomas Bogendoerfer Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-5-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit f95850ec6581aa706065bf09877b453bec6c00a2 Author: Emil Velikov Date: Wed May 13 22:43:44 2020 +0100 alpha: constify sysrq_key_op With earlier commits, the API no longer discards the const-ness of the sysrq_key_op. As such we can add the notation. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-alpha@vger.kernel.org Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-4-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7fffe31d3eaa2f08bdfde2403adcaa8029f9bea4 Author: Emil Velikov Date: Wed May 13 22:43:43 2020 +0100 tty/sysrq: constify the the sysrq_key_op(s) All the users threat them as immutable - annotate them as such. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-3-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 23cbedf812ff7c7751582928e32d953d84c1c821 Author: Emil Velikov Date: Wed May 13 22:43:42 2020 +0100 tty/sysrq: constify the sysrq API The user is not supposed to thinker with the underlying sysrq_key_op. Make that explicit by adding a handful of const notations. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-2-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0f1c9688a194d22bb81953bd85bd18b0115fd17f Author: Emil Velikov Date: Wed May 13 22:43:41 2020 +0100 tty/sysrq: alpha: export and use __sysrq_get_key_op() Export a pointer to the sysrq_get_key_op(). This way we can cleanly unregister it, instead of the current solutions of modifuing it inplace. Since __sysrq_get_key_op() is no longer used externally, let's make it a static function. This patch will allow us to limit access to each and every sysrq op and constify the sysrq handling. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-kernel@vger.kernel.org Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-alpha@vger.kernel.org Signed-off-by: Emil Velikov Link: https://lore.kernel.org/r/20200513214351.2138580-1-emil.l.velikov@gmail.com Signed-off-by: Greg Kroah-Hartman commit f441d66a6ee98e97bd9b26267ba567f8056f461c Author: Hans de Goede Date: Wed May 13 15:05:44 2020 +0200 platform/x86: dell-wmi: Ignore keyboard attached / detached events Ignore events with a type of 0x0011 and a code of 0xfff2 / 0xfff3, this silences the following messages being logged when the keyboard is detached / attached on a Dell Venue 11 Pro 7130: [ 63.621953] dell_wmi: Unknown key with type 0x0011 and code 0xfff2 pressed [ 70.240558] dell_wmi: Unknown key with type 0x0011 and code 0xfff3 pressed Note SW_TABLET_MODE is already reported through the intel_vbtn driver on this and other Dell devices, so dell_wmi should not report this too, to avoid duplicate events. Signed-off-by: Hans de Goede Reviewed-by: Mario Limonciello Signed-off-by: Andy Shevchenko commit 257e03a334ccb96e657bf5f6ab3b5693a22c2aa4 Author: Koba Ko Date: Mon May 11 09:44:56 2020 +0800 platform/x86: dell-laptop: don't register micmute LED if there is no token On Dell G3-3590, error message is issued during boot up, "platform::micmute: Setting an LED's brightness failed (-19)", but there's no micmute led on the machine. Get the related tokens of SMBIOS, GLOBAL_MIC_MUTE_DISABLE/ENABLE. If one of two tokens doesn't exist, don't call led_classdev_register() for platform::micmute. After that, you wouldn't see the platform::micmute in /sys/class/leds/, and the error message wouldn't see in dmesg. Fixes: d00fa46e0a2c6 ("platform/x86: dell-laptop: Add micmute LED trigger support") Signed-off-by: Koba Ko Reviewed-by: Mario Limonciello Reviewed-by: Pali Rohár Signed-off-by: Andy Shevchenko commit beca62c4212ade1516a526784adf7f7d99c7f3d9 Author: Jason Yan Date: Wed May 6 14:17:35 2020 +0800 tty: mxser: make mxser_change_speed() return void No other functions use the return value of mxser_change_speed() and the return value is always 0 now. Make it return void. This fixes the following coccicheck warning: drivers/tty/mxser.c:645:5-8: Unneeded variable: "ret". Return "0" on line 650 Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200506061735.19369-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 7b668c064ec33f3d687c3a413d05e355172e6c92 Author: Serge Semin Date: Thu May 7 02:31:32 2020 +0300 serial: 8250: Fix max baud limit in generic 8250 port Standard 8250 UART ports are designed in a way so they can communicate with baud rates up to 1/16 of a reference frequency. It's expected from most of the currently supported UART controllers. That's why the former version of serial8250_get_baud_rate() method called uart_get_baud_rate() with min and max baud rates passed as (port->uartclk / 16 / UART_DIV_MAX) and ((port->uartclk + tolerance) / 16) respectively. Doing otherwise, like it was suggested in commit ("serial: 8250_mtk: support big baud rate."), caused acceptance of bauds, which was higher than the normal UART controllers actually supported. As a result if some user-space program requested to set a baud greater than (uartclk / 16) it would have been permitted without truncation, but then serial8250_get_divisor(baud) (which calls uart_get_divisor() to get the reference clock divisor) would have returned a zero divisor. Setting zero divisor will cause an unpredictable effect varying from chip to chip. In case of DW APB UART the communications just stop. Lets fix this problem by getting back the limitation of (uartclk + tolerance) / 16 maximum baud supported by the generic 8250 port. Mediatek 8250 UART ports driver developer shouldn't have touched it in the first place notably seeing he already provided a custom version of set_termios() callback in that glue-driver which took into account the extended baud rate values and accordingly updated the standard and vendor-specific divisor latch registers anyway. Fixes: 81bb549fdf14 ("serial: 8250_mtk: support big baud rate.") Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Long Cheng Cc: Andy Shevchenko Cc: Maxime Ripard Cc: Catalin Marinas Cc: Will Deacon Cc: Russell King Cc: linux-mips@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Link: https://lore.kernel.org/r/20200506233136.11842-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Greg Kroah-Hartman commit c150c0f362c1e51c0e3216c9912b85b71d00e70d Author: Lukas Wunner Date: Tue May 12 14:40:02 2020 +0200 serial: Allow uart_get_rs485_mode() to return errno We're about to amend uart_get_rs485_mode() to support a GPIO pin for rs485 bus termination. Retrieving the GPIO descriptor may fail, so allow uart_get_rs485_mode() to return an errno and change all callers to check for failure. The GPIO descriptor is going to be stored in struct uart_port. Pass that struct to uart_get_rs485_mode() in lieu of a struct device and struct serial_rs485, both of which are directly accessible from struct uart_port. A few drivers call uart_get_rs485_mode() before setting the struct device pointer in struct uart_port. Shuffle those calls around where necessary. [Heiko Stuebner did the ar933x_uart.c portion, hence his Signed-off-by.] Signed-off-by: Heiko Stuebner Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/271e814af4b0db3bffbbb74abf2b46b75add4516.1589285873.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit e0a851fe6b9b619527bd928aa93caaddd003f70c Author: Lukas Wunner Date: Tue May 12 14:40:01 2020 +0200 serial: 8250: Avoid error message on reprobe If the call to uart_add_one_port() in serial8250_register_8250_port() fails, a half-initialized entry in the serial_8250ports[] array is left behind. A subsequent reprobe of the same serial port causes that entry to be reused. Because uart->port.dev is set, uart_remove_one_port() is called for the half-initialized entry and bails out with an error message: bcm2835-aux-uart 3f215040.serial: Removing wrong port: (null) != (ptrval) The same happens on failure of mctrl_gpio_init() since commit 4a96895f74c9 ("tty/serial/8250: use mctrl_gpio helpers"). Fix by zeroing the uart->port.dev pointer in the probe error path. The bug was introduced in v2.6.10 by historical commit befff6f5bf5f ("[SERIAL] Add new port registration/unregistration functions."): https://git.kernel.org/tglx/history/c/befff6f5bf5f The commit added an unconditional call to uart_remove_one_port() in serial8250_register_port(). In v3.7, commit 835d844d1a28 ("8250_pnp: do pnp probe before legacy probe") made that call conditional on uart->port.dev which allows me to fix the issue by zeroing that pointer in the error path. Thus, the present commit will fix the problem as far back as v3.7 whereas still older versions need to also cherry-pick 835d844d1a28. Fixes: 835d844d1a28 ("8250_pnp: do pnp probe before legacy probe") Signed-off-by: Lukas Wunner Cc: stable@vger.kernel.org # v2.6.10 Cc: stable@vger.kernel.org # v2.6.10: 835d844d1a28: 8250_pnp: do pnp probe before legacy Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/b4a072013ee1a1d13ee06b4325afb19bda57ca1b.1589285873.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 466f469733263d80ac53d321130d13eea3d875a4 Author: Andy Shevchenko Date: Mon May 11 15:54:14 2020 +0300 platform/x86: thinkpad_acpi: Replace custom approach by kstrtoint() Call kstrtoint(), where appropriate, instead of using custom approach. Signed-off-by: Andy Shevchenko commit 35d13c7a05126a5a54a1ef40aff4c6984474e604 Author: Andy Shevchenko Date: Mon May 11 15:54:14 2020 +0300 platform/x86: thinkpad_acpi: Use strndup_user() in dispatch_proc_write() Simplify the user copy code by using strndup_user(). Signed-off-by: Andy Shevchenko commit be51bd4585728baefc5669d4af2be0eb68b90e3e Author: Andy Shevchenko Date: Mon May 11 15:56:24 2020 +0300 platform/x86: thinkpad_acpi: Replace next_cmd(&buf) with strsep(&buf, ",") It seems next_cmd() predates the strsep() implementation in the kernel. For a long time we have the latter one, thus, replace next_cmd(&buf) with strsep(&buf, ","). Signed-off-by: Andy Shevchenko commit 3a36aa237e4ed04553c0998cf5f47eda3e206e4f Author: Joonas Lahtinen Date: Fri May 15 14:49:24 2020 +0300 drm/i915: Update DRIVER_DATE to 20200515 Signed-off-by: Joonas Lahtinen commit 01dbb362f0a114fbce19c8abe4cd6f4710e934d5 Author: Gregory CLEMENT Date: Tue May 12 13:53:23 2020 +0200 tty: n_gsm: Fix waking up upper tty layer when room available Warn the upper layer when n_gms is ready to receive data again. Without this the associated virtual tty remains blocked indefinitely. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20200512115323.1447922-4-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 84d6f81c1fb58b56eba81ff0a36cf31946064b40 Author: Gregory CLEMENT Date: Tue May 12 13:53:22 2020 +0200 tty: n_gsm: Fix SOF skipping For at least some modems like the TELIT LE910, skipping SOF makes transfers blocking indefinitely after a short amount of data transferred. Given the small improvement provided by skipping the SOF (just one byte on about 100 bytes), it seems better to completely remove this "feature" than make it optional. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20200512115323.1447922-3-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman commit fe92c2a801267c3d90240752a9df542174794567 Author: Gregory CLEMENT Date: Tue May 12 13:53:21 2020 +0200 tty: n_gsm: Improve debug output Use appropriate print helpers for debug messages. Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20200512115323.1447922-2-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman commit d731c1a0f935dbebf4a851e072f8c7309eb2b8c5 Merge: 93fa0af4790a d59628b310a7 Author: Mark Brown Date: Fri May 15 11:56:53 2020 +0100 Merge series "ASoC: fsl_esai: Add support for imx8qm" from Shengjiu Wang : Add support for imx8qm. Shengjiu Wang (2): ASoC: fsl_esai: introduce SoC specific data ASoC: fsl_esai: Add new compatible string for imx8qm Changes in v2 - drop the 0002 patch in v1, the dma relate limitation should be done in dma driver, or define a new DMA API for it. .../devicetree/bindings/sound/fsl,esai.txt | 1 + sound/soc/fsl/fsl_esai.c | 46 +++++++++++++++---- 2 files changed, 38 insertions(+), 9 deletions(-) -- 2.21.0 commit 93fa0af4790abdabf80ca0c4fff3f1629c84a56f Author: Ard Biesheuvel Date: Fri May 15 12:03:09 2020 +0200 ASoC: cros_ec_codec: switch to library API for SHA-256 The CrOS EC codec driver uses SHA-256 explicitly, and not in a performance critical manner, so there is really no point in using the SHASH crypto API here. Let's switch to the library API instead. Signed-off-by: Ard Biesheuvel Reviewed-by: Tzung-Bi Shih Cc: Cheng-Yi Chiang Cc: Enric Balletbo i Serra Cc: Guenter Roeck Cc: Benson Leung Cc: Liam Girdwood Cc: Mark Brown Cc: Arnd Bergmann Cc: Eric Biggers Cc: Herbert Xu Cc: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200515100309.20795-1-ardb@kernel.org Signed-off-by: Mark Brown commit d59628b310a77e616ce2e5857e6ede5bf96c6784 Author: Shengjiu Wang Date: Fri May 15 18:10:51 2020 +0800 ASoC: fsl_esai: Add new compatible string for imx8qm Add new compatible string "fsl,imx8qm-esai" in the binding document. Signed-off-by: Shengjiu Wang Acked-by: Rob Herring Link: https://lore.kernel.org/r/fade597f6fb7e0ef9eb1185b491eaa46a9d287e3.1589537601.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 6878e75204e1d0420fd8130bad33f88053ba44de Author: Shengjiu Wang Date: Fri May 15 18:10:50 2020 +0800 ASoC: fsl_esai: introduce SoC specific data Introduce a SoC specific data structure which contains the differences between the different SoCs. This makes it easier to support more differences without having to introduce a new if/else each time. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/c188279975bd216995904f9bf8a84c7887b759a0.1589537601.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit aa49d8e8b2dfc112f7de9c58698ae06b2101c73c Author: Anson Huang Date: Mon May 11 15:09:56 2020 +0800 tty: serial: imx: Add return value check for platform_get_irq() RX irq is required, so add return value check for platform_get_irq(). Signed-off-by: Anson Huang Link: https://lore.kernel.org/r/1589180996-618-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Greg Kroah-Hartman commit 24637007394e85737ff1798fcd0f62f1fd7dc6af Author: Andy Shevchenko Date: Tue May 12 17:02:52 2020 +0300 serial: 8250_exar: Make use of PCI_DEVICE_DATA() macro Since PCI core provides a generic PCI_DEVICE_DATA() macro, replace contents of EXAR_DEVICE() with former one. No functional change intended. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512140252.67631-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 6cf61b9bd7cc95ebaeb256155f2c83966555151a Author: Manivannan Sadhasivam Date: Mon Apr 20 22:32:04 2020 +0530 tty: serial: Add modem control gpio support for STM32 UART STM32 UART controllers have the built in modem control support using dedicated gpios which can be enabled using 'st,hw-flow-ctrl' flag in DT. But there might be cases where the board design need to use different gpios for modem control. For supporting such cases, this commit adds modem control gpio support to STM32 UART controller using mctrl_gpio driver. Reviewed-by: Andy Shevchenko Signed-off-by: Manivannan Sadhasivam Acked-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20200420170204.24541-3-mani@kernel.org Signed-off-by: Greg Kroah-Hartman commit 888ae871048c6bc5dad695e25106ffdd009da611 Author: Manivannan Sadhasivam Date: Mon Apr 20 22:32:03 2020 +0530 dt-bindings: serial: Document CTS/RTS gpios in STM32 UART Document the use of CTS/RTS gpios for flow control in STM32 UART controller. These properties can be used instead of 'st,hw-flow-ctrl' for making use of any gpio pins for flow control instead of dedicated pins. It should be noted that both CTS/RTS and 'st,hw-flow-ctrl' properties cannot co-exist in a design. Reviewed-by: Andy Shevchenko Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200420170204.24541-2-mani@kernel.org Signed-off-by: Greg Kroah-Hartman commit 7d31676a8d91dd18e08853efd1cb26961a38c6a6 Author: Jonathan Bakker Date: Fri May 8 18:34:33 2020 -0700 tty: serial: samsung: Correct clock selection logic Some variants of the samsung tty driver can pick which clock to use for their baud rate generation. In the DT conversion, a default clock was selected to be used if a specific one wasn't assigned and then a comparison of which clock rate worked better was done. Unfortunately, the comparison was implemented in such a way that only the default clock was ever actually compared. Fix this by iterating through all possible clocks, except when a specific clock has already been picked via clk_sel (which is only possible via board files). Signed-off-by: Jonathan Bakker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/BN6PR04MB06604E63833EA41837EBF77BA3A30@BN6PR04MB0660.namprd04.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit ad406341bdd7d22ba9497931c2df5dde6bb9440e Author: Rahul Tanwar Date: Mon May 11 13:57:27 2020 +0800 serial: lantiq: Make driver modular Add changes so Lantiq serial driver can be compiled as a module. Signed-off-by: Rahul Tanwar Link: https://lore.kernel.org/r/ad9422de006c317401bfa5fe61bdd4293dd29b5e.1589176044.git.rahul.tanwar@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit ea7d3fd8a6d0654f8bbb1cb7d4ecc57a346f7daf Author: Rahul Tanwar Date: Mon May 11 13:57:26 2020 +0800 serial: lantiq: Make UART's use as console selectable Lantiq UART driver can be used for system console. Add changes to make this driver's use as console selectable/configurable. Signed-off-by: Rahul Tanwar Link: https://lore.kernel.org/r/35f2d002ba1cb26192fe4d9b8cdab275300705bc.1589176044.git.rahul.tanwar@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 346338ef00d35bf8338ded171f9abeb9b10b43df Author: free5lot Date: Fri May 15 13:14:00 2020 +0700 HID: apple: Swap the Fn and Left Control keys on Apple keyboards This patch allows users to swap the Fn and left Control keys on all Apple keyboards: internal (e.g. Macbooks) and external (both wired and wireless). The patch adds a new hid-apple module param: swap_fn_leftctrl (off by default). Signed-off-by: Zakhar Semenov Signed-off-by: Jiri Kosina commit 69cf449166987d9a041020be6422ee7bf94a7228 Author: Sai Praneeth Prakhya Date: Wed May 13 15:47:21 2020 -0700 iommu: Remove functions that support private domain After moving iommu_group setup to iommu core code [1][2] and removing private domain support in vt-d [3], there are no users for functions such as iommu_request_dm_for_dev(), iommu_request_dma_domain_for_dev() and request_default_domain_for_dev(). So, remove these functions. [1] commit dce8d6964ebd ("iommu/amd: Convert to probe/release_device() call-backs") [2] commit e5d1841f18b2 ("iommu/vt-d: Convert to probe/release_device() call-backs") [3] commit 327d5b2fee91 ("iommu/vt-d: Allow 32bit devices to uses DMA domain") Signed-off-by: Sai Praneeth Prakhya Cc: Joerg Roedel Cc: Lu Baolu Link: https://lore.kernel.org/r/20200513224721.20504-1-sai.praneeth.prakhya@intel.com Signed-off-by: Joerg Roedel commit f55d9895884b1e816f95b5109b4b3827ae18c4ab Author: Kamalesh Babulal Date: Fri May 15 14:14:10 2020 +0530 MAINTAINERS: add lib/livepatch to LIVE PATCHING Add lib/livepatch to list of livepatching F: patterns in MAINTAINERS. Suggested-by: Jiri Kosina Acked-by: Miroslav Benes Signed-off-by: Kamalesh Babulal Signed-off-by: Jiri Kosina commit 0b5832238d369a71f90a221d17b92761595c8067 Author: Lad Prabhakar Date: Sun May 3 22:46:52 2020 +0100 dt-bindings: arm: renesas: Document iW-RainboW-G21D-Qseven-RZG1H board Document the iW-RainboW-G21D-Qseven-RZG1H device tree bindings, listing it as a supported board. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Acked-by: Rob Herring Link: https://lore.kernel.org/r/1588542414-14826-9-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 844beed47182903212d8230ac6d729be1287733e Author: Lad Prabhakar Date: Sun May 3 22:46:51 2020 +0100 dt-bindings: arm: renesas: Document iW-RainboW-G21M-Qseven-RZG1H SoM Document the iW-RainboW-G21M-Qseven-RZG1H device tree bindings, listing it as a supported system on module. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Acked-by: Rob Herring Link: https://lore.kernel.org/r/1588542414-14826-8-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7227797a4e66a1b70a3745ad56d36937732c625c Author: Geert Uytterhoeven Date: Thu May 7 09:45:16 2020 +0200 pinctrl: rza1: Fix flag name in comment rza1_swio_pin relates to the swio flag instead of the bidir flag. Signed-off-by: Geert Uytterhoeven Acked-by: Jacopo Mondi Link: https://lore.kernel.org/r/20200507074516.29903-1-geert+renesas@glider.be commit 4ecc7ff82ecfdf44997ed2a1016945fc8f6fca3e Author: Lad Prabhakar Date: Sun May 3 22:46:46 2020 +0100 pinctrl: sh-pfc: r8a7790: Add r8a7742 PFC support Renesas RZ/G1H (R8A7742) is pin compatible with R-Car H2 (R8A7790), however it doesn't have several automotive specific peripherals. Add automotive-specific pin groups/functions along with common pin groups/functions for supporting both r8a7790 and r8a7742 SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588542414-14826-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit baf674bf717f8224f33e453e1df92a96c4d6ce48 Author: Lad Prabhakar Date: Sun May 3 22:46:45 2020 +0100 dt-bindings: pinctrl: sh-pfc: Document r8a7742 PFC support Document PFC support for the RZ/G1H (R8A7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Acked-by: Rob Herring Link: https://lore.kernel.org/r/1588542414-14826-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6b5dd716da8fc3aba65e6b7d992dea0cee2f9528 Author: Sami Tolvanen Date: Tue Apr 21 15:08:43 2020 -0700 objtool: optimize add_dead_ends for split sections Instead of iterating through all instructions to find the last instruction each time .rela.discard.(un)reachable points beyond the section, use find_insn to locate the last instruction by looking at the last bytes of the section instead. Suggested-by: Josh Poimboeuf Signed-off-by: Sami Tolvanen Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421220843.188260-3-samitolvanen@google.com commit 28fe1d7bf89f8ed5be70b98a33932dbaf99345dd Author: Sami Tolvanen Date: Tue Apr 21 15:08:42 2020 -0700 objtool: use gelf_getsymshndx to handle >64k sections Currently, objtool fails to load the correct section for symbols when the index is greater than SHN_LORESERVE. Use gelf_getsymshndx instead of gelf_getsym to handle >64k sections. Signed-off-by: Sami Tolvanen Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20200421220843.188260-2-samitolvanen@google.com commit ab3852ab5cb8fd2e2c5bfa176e5f953353836907 Author: Peter Zijlstra Date: Fri May 8 12:34:33 2020 +0200 objtool: Allow no-op CFI ops in alternatives Randy reported a false-positive: arch/x86/hyperv/hv_apic.o: warning: objtool: hv_apic_write()+0x25: alternative modifies stack What happens is that: alternative_io("movl %0, %P1", "xchgl %0, %P1", X86_BUG_11AP, 13d: 89 9d 00 d0 7f ff mov %ebx,-0x803000(%rbp) decodes to an instruction with CFI-ops because it modifies RBP. However, due to this being a !frame-pointer build, that should not in fact change the CFI state. So instead of dis-allowing any CFI-op, verify the op would've actually changed the CFI state. Fixes: 7117f16bf460 ("objtool: Fix ORC vs alternatives") Reported-by: Randy Dunlap Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Acked-by: Randy Dunlap Tested-by: Randy Dunlap commit 90562c8182702058f9c8e562e067ec43cd3953dd Merge: 6c591eec67cb 8fd3574b54a5 Author: Viresh Kumar Date: Fri May 15 13:30:30 2020 +0530 Merge remote-tracking branch 'georgi/icc-get-by-index' into opp/linux-next commit 11c82afac8d19eb0364521ebfc3b76cb6863dcb8 Author: Peter Chen Date: Wed May 13 20:56:05 2020 +0800 phy: phy-cadence-salvo: add phy .init API The .init is used for one-time PHY's initialization, and .power_on is called many times during the device lifecycle. Signed-off-by: Peter Chen Link: https://lore.kernel.org/r/20200513125605.5545-1-peter.chen@nxp.com Signed-off-by: Vinod Koul commit f004be596c28f90fbcc50e1b0f4b29ebab56bfca Author: Martin Blumenstingl Date: Wed May 13 00:24:24 2020 +0200 phy: amlogic: meson8b-usb2: Add a compatible string for Meson8m2 The 3.10 vendor kernel sets the ACA_ENABLE bit on Meson8b, Meson8m2 and GXBB, but not on Meson8. Add a compatible string for Meson8m2 which also sets that bit. While here, also update the Kconfig text and MODULE_DESCRIPTION. Signed-off-by: Martin Blumenstingl Tested-by: Thomas Graichen Link: https://lore.kernel.org/r/20200512222424.549351-7-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit 7cafc01744067cfaac2d5c0342e6f5deb377100a Author: Martin Blumenstingl Date: Wed May 13 00:24:23 2020 +0200 phy: amlogic: meson8b-usb2: unset the IDDQ bit during PHY power-on The vendor driver unsets the set_iddig bit during power-on as well and sets it when suspending the PHY. I did not notice this in the vendor driver first, because it's part of the dwc_otg driver there (instead of their PHY code). While here, also add all other REG_DBG_UART register bit definitions. Signed-off-by: Martin Blumenstingl Tested-by: Thomas Graichen Link: https://lore.kernel.org/r/20200512222424.549351-6-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit 6b99262fd2f210284b4d17928fd03bee2f5a4fe1 Author: Martin Blumenstingl Date: Wed May 13 00:24:22 2020 +0200 phy: amlogic: meson8b-usb2: Don't set REG_ADP_BC_ACA_ENABLE on Meson8 Skip setting REG_ADP_BC_ACA_ENABLE on Meson8 SoCs and polling for the REG_ADP_BC_ACA_PIN_FLOAT bit. The vendor also skips this part on Meson8 SoCs. This fixes initialization of the host-only USB PHY on Meson8 which would otherwise fail with "USB ID detect failed!". Fixes: 4a3449d1a0a10c ("phy: meson8b-usb2: add support for the USB PHY on Meson8 SoCs") Reported-by: Thomas Graichen Signed-off-by: Martin Blumenstingl Tested-by: Thomas Graichen Link: https://lore.kernel.org/r/20200512222424.549351-5-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit de143a40fa7d0acae4295c3b312ec96cc8dd9cd0 Author: Martin Blumenstingl Date: Wed May 13 00:24:21 2020 +0200 phy: amlogic: meson8b-usb2: Use a MMIO regmap Using a MMIO regmap and switch to regmap_update_bits() to simplify the code in the driver. Also switch to devm_platform_ioremap_resource() instead of open-coding it. No functional changes intended. Signed-off-by: Martin Blumenstingl Tested-by: Thomas Graichen Link: https://lore.kernel.org/r/20200512222424.549351-4-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit 2c0dd8440312b77b42f8e27fd751015dc8f519ff Author: Martin Blumenstingl Date: Wed May 13 00:24:20 2020 +0200 dt-bindings: phy: meson8b-usb2: Add compatible string for Meson8m2 The USB2 PHY on Meson8m2 is identical to the one on Meson8b but different to the one on Meson8. The only known difference is that Meson8 does not set the ACA_ENABLE bit while Meson8b and Meson8m2 do. Add an explicit compatible string for Meson8m2 so those differences can be taken care of. Signed-off-by: Martin Blumenstingl Tested-by: Thomas Graichen Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200512222424.549351-3-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit 41e291904a10233a8f42364ec3f18116de026ab6 Author: Martin Blumenstingl Date: Wed May 13 00:24:19 2020 +0200 dt-bindings: phy: meson8b-usb2: Convert to json-schema Now that we have the DT validation in place, let's convert the device tree bindings for the Amlogic Meson8, Meson8b, Meson8m2 and GXBB USB2 PHY over to a YAML schema. While here, also add the fallback compatible string "amlogic,meson-gxbb-usb2-phy" which is already used in arch/arm/boot/dts/meson{,8,8b}.dtsi. Signed-off-by: Martin Blumenstingl Tested-by: Thomas Graichen Link: https://lore.kernel.org/r/20200512222424.549351-2-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit b35da2e86f256a3a4be7c3b31507016100b00847 Merge: 7d374b209083 8fd3574b54a5 Author: Georgi Djakov Date: Fri May 15 10:46:18 2020 +0300 Merge branch 'icc-get-by-index' into icc-next This is an immutable branch shared with the OPP tree. It contains also the patches to convert the interconnect framework from tristate to bool after Greg agreed with that. This will make the integration between the OPP layer and interconnect much easier. * icc-get-by-index: interconnect: Add of_icc_get_by_index() helper function interconnect: Disallow interconnect core to be built as a module interconnect: Remove unused module exit code from core Signed-off-by: Georgi Djakov commit 8fd3574b54a54e4a33d5a6684df89d64ca812f0b Author: Jordan Crouse Date: Thu Oct 31 12:28:52 2019 -0600 interconnect: Remove unused module exit code from core The interconnect core is currently always built in: menuconfig INTERCONNECT bool "On-Chip Interconnect management support" So remove the module_exit function and symbolically rename module_init to device_initcall to drive home the point. Signed-off-by: Jordan Crouse Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1572546532-19248-3-git-send-email-jcrouse@codeaurora.org Signed-off-by: Georgi Djakov commit b3a0a2f910c7ae29074415e07f8d830935df19e2 Author: Maxime Ripard Date: Sun Jan 12 08:51:46 2020 +0100 arm64: dts: allwinner: h6: Add IOMMU Now that we have a driver for the IOMMU, let's start using it. Signed-off-by: Maxime Ripard commit fcb57bfcb87f3bdb1b29fea1a1cd72940fa559fd Author: Viresh Kumar Date: Thu Aug 29 13:37:29 2019 +0530 interconnect: Disallow interconnect core to be built as a module Building individual drivers as modules is fine but allowing a core framework to be built as a module makes it really complex and should be avoided. Whatever uses the interconnect core APIs must also be built as a module if interconnect core is built as module, else we will see compilation failures. If another core framework (like cpufreq, clk, etc), that can't be built as module, needs to use interconnect APIs then we will start seeing compilation failures with allmodconfig configurations as the symbols (like of_icc_get()) used in other frameworks will not be available in the built-in image. Disallow the interconnect core to be built as a module to avoid all these issues. Signed-off-by: Viresh Kumar Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/b789cce388dd1f2906492f307dea6780c398bc6a.1567065991.git.viresh.kumar@linaro.org Signed-off-by: Georgi Djakov commit e795688eeedfab9755727bf42e8b64c31a833ea0 Author: Oleksij Rempel Date: Sun May 10 08:03:24 2020 +0200 MIPS: ath79: ar9331: rename uart to serial node schema violation was detected by the dtbs_check Signed-off-by: Oleksij Rempel Signed-off-by: Thomas Bogendoerfer commit 24ce659dcc02c21f8d6c0a7589c3320a4dfa8152 Author: Oleksij Rempel Date: Sun May 10 08:03:23 2020 +0200 MIPS: ath79: ar9331_dpt_module: update led nodes Fit led nodes to the latest naming schema. Signed-off-by: Oleksij Rempel Signed-off-by: Thomas Bogendoerfer commit 83dd9a0b664397209a11849c47f9a59901af4da9 Author: Joshua Kinard Date: Thu May 14 23:24:22 2020 -0400 MIPS: SGI-IP27: Use the _AC() macro in spaces.h The attached patch wraps several of the macros in IP27's spaces.h header file with the _AC() macro. This matches most of the other spaces.h files in the MIPS tree. Signed-off-by: Joshua Kinard Signed-off-by: Thomas Bogendoerfer commit 1fded93fb154a75d99823b0492dfb1688958d64a Author: Thomas Bogendoerfer Date: Thu May 14 16:31:22 2020 +0200 MIPS: ralink: Don't include objects twice With the change of platform file inclusion object were included via platform-y and core-y. Remove the core-y part to fix it. Fixes: 26bff9eb49201aeb ("MIPS: Only include the platformfile needed") Signed-off-by: Thomas Bogendoerfer commit 8a4e2779570fe29da33e99a1c9addc4205110819 Author: Thomas Bogendoerfer Date: Thu May 14 13:07:23 2020 +0200 MIPS: Fix builds for VR41xx platforms Changing inclusion of Platform files, broke VR41xx platforms. Add Makefile to vr41xx directory and traverse subdirs from it. Fixes: 26bff9eb49201aeb ("MIPS: Only include the platformfile needed") Signed-off-by: Thomas Bogendoerfer commit be4cf718cd9929e867ed1ff06d23fb4d08cc2d36 Author: Sascha Hauer Date: Wed May 13 08:04:05 2020 +0200 dmaengine: imx-sdma: initialize all script addresses The script addresses array increases with each new version. The driver initializes the array to -EINVAL initially, but only up to the size of the v1 array. Initialize the additional addresses for the newer versions as well. Without this uninitialized values of the newer arrays are treated as valid. Signed-off-by: Sascha Hauer Reviewed-by: Robin Gong Link: https://lore.kernel.org/r/20200513060405.18685-1-s.hauer@pengutronix.de Signed-off-by: Vinod Koul commit 2c959a33f8630a008c7047e90312ba10ea2c78b7 Author: Zhou Wang Date: Sat May 9 17:44:05 2020 +0800 crypto: hisilicon/zip - Use temporary sqe when doing work Currently zip sqe is stored in hisi_zip_qp_ctx, which will bring corruption with multiple parallel users of the crypto tfm. This patch removes the zip_sqe in hisi_zip_qp_ctx and uses a temporary sqe instead. Signed-off-by: Zhou Wang Signed-off-by: Jonathan Cameron Signed-off-by: Shukun Tan Signed-off-by: Herbert Xu commit dbdc1ec31fc05c118eedb4211f502e6352c915b9 Author: Shukun Tan Date: Sat May 9 17:44:04 2020 +0800 crypto: hisilicon - add device error report through abnormal irq By configuring the device error in firmware to report through abnormal interruption, process all NFE errors in irq handler. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 3176637ac10eddffdc3bd75281fa354a0d5a0c1e Author: Shukun Tan Date: Sat May 9 17:44:03 2020 +0800 crypto: hisilicon - remove codes of directly report device errors through MSI The hardware device can be configured to report directly through MSI, but this method will not go through RAS, configure all hardware errors that should be processed by driver to NFE. Signed-off-by: Shukun Tan Signed-off-by: Herbert Xu commit 5308f6600a393ee848ed9d9f77b167aa6b202e9c Author: Weili Qian Date: Sat May 9 17:44:02 2020 +0800 crypto: hisilicon - QM memory management optimization Put all the code for the memory allocation into the QM initialization process. Before, The qp memory was allocated when the qp was created, and released when the qp was released, It is now changed to allocate all the qp memory once. Signed-off-by: Weili Qian Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit d9701f8d9b12903bf212f542235659477024a43f Author: Weili Qian Date: Sat May 9 17:44:01 2020 +0800 crypto: hisilicon - unify initial value assignment into QM Some initial value assignment of struct hisi_qm could put into QM. Signed-off-by: Weili Qian Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit b977e03005127b1cbfef05517fbedaa7c5a177a1 Author: Shukun Tan Date: Sat May 9 17:44:00 2020 +0800 crypto: hisilicon - remove use_dma_api related codes The codes related use_dma_api is useless which should be removed. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 7ce396fa12a96a0e709a7b55cd5ab24161259634 Author: Shukun Tan Date: Sat May 9 17:43:59 2020 +0800 crypto: hisilicon - add FLR support Add callback reset_prepare and reset_done in QM, The callback reset_prepare will uninit device error configuration and stop the QM, the callback reset_done will init the device error configuration and restart the QM. Uninit the error configuration will disable device block master OOO when Multi-bit ECC error occurs to avoid the request of FLR will not return. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit b67202e8ed30bfa07b07a6f8fc762417a9a4e6de Author: Zhou Wang Date: Sat May 9 17:43:58 2020 +0800 crypto: hisilicon/qm - add state machine for QM Add specific states for qm and qp, every state change under critical region to prevent from race condition. Meanwhile, qp state change will also depend on qm state. Due to the introduction of these states, it is necessary to pay attention to the calls of public logic, such as concurrent scenarios resetting and releasing queue will call hisi_qm_stop, which needs to add additional status to distinguish and process. Signed-off-by: Zhou Wang Signed-off-by: Shukun Tan Signed-off-by: Herbert Xu commit 20b291f51802b35d84e20efbf110e8c9a853a22c Author: Shukun Tan Date: Sat May 9 17:43:57 2020 +0800 crypto: hisilicon - refactor module parameter pf_q_num related code put q_num_set similar code into qm to reduce the redundancy. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit cfd66a660f73adfd388666f122e998691763aa55 Author: Longfang Liu Date: Sat May 9 17:43:56 2020 +0800 crypto: hisilicon/zip - modify the ZIP probe process Misc fixes on coding style: 1.Merge QM initialization code into a function 2.Merge QM's PF and VF initialization into a function Signed-off-by: Longfang Liu Signed-off-by: Zaibo Xu Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 5f3a2a5d37ff9058e3fa253cb8445f7780513635 Author: Longfang Liu Date: Sat May 9 17:43:55 2020 +0800 crypto: hisilicon/hpre - modify the HPRE probe process Misc fixes on coding style: 1.Merge pre-initialization and initialization of QM 2.Package the initialization of QM's PF and VF into a function Signed-off-by: Longfang Liu Signed-off-by: Zaibo Xu Signed-off-by: Shukun Tan Signed-off-by: Herbert Xu commit 18614230f430a1108aad5ba2be2dd158b664081b Author: Longfang Liu Date: Sat May 9 17:43:54 2020 +0800 crypto: hisilicon/sec2 - modify the SEC probe process Adjust the position of SMMU status check and SEC queue initialization in SEC probe Signed-off-by: Longfang Liu Signed-off-by: Zaibo Xu Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit c549e8127213bbebba76b88a148875a80561e51d Author: Rikard Falkeborn Date: Sat May 9 00:35:02 2020 +0200 crypto: hisilicon/sec2 - constify sec_dfx_regs sec_dfx_regs is never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 17982 7312 480 25774 64ae drivers/crypto/hisilicon/sec2/sec_main.o After: text data bss dec hex filename 18366 6928 480 25774 64ae drivers/crypto/hisilicon/sec2/sec_main.o Signed-off-by: Rikard Falkeborn Signed-off-by: Herbert Xu commit 8f68659bac1da933bf5526d4eeec46504d68457b Author: Rikard Falkeborn Date: Sat May 9 00:35:01 2020 +0200 crypto: hisilicon/zip - constify struct debugfs_reg32 hzip_dfx_regs is never changed and can be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 15236 6160 480 21876 5574 drivers/crypto/hisilicon/zip/zip_main.o After: text data bss dec hex filename 15620 5776 480 21876 5574 drivers/crypto/hisilicon/zip/zip_main.o Signed-off-by: Rikard Falkeborn Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 2c2207aee52b6c6627f91aa2c7f5316c4087363a Author: Rikard Falkeborn Date: Sat May 9 00:35:00 2020 +0200 crypto: hisilicon/hpre - constify struct debugfs_reg32 hpre_cluster_dfx_regs and hpre_com_dfx_regs are never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 16455 6288 480 23223 5ab7 drivers/crypto/hisilicon/hpre/hpre_main.o After: text data bss dec hex filename 16839 5904 480 23223 5ab7 drivers/crypto/hisilicon/hpre/hpre_main.o Signed-off-by: Rikard Falkeborn Signed-off-by: Herbert Xu commit 1036bb50c80561bab85a0dc57e87e6c7645c97b7 Author: Rikard Falkeborn Date: Sat May 9 00:34:59 2020 +0200 crypto: ccree - constify struct debugfs_reg32 pid_cd_regs and debug_regs are never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 2871 2320 64 5255 1487 drivers/crypto/ccree/cc_debugfs.o After: text data bss dec hex filename 3255 1936 64 5255 1487 drivers/crypto/ccree/cc_debugfs.o Signed-off-by: Rikard Falkeborn Signed-off-by: Herbert Xu commit 0c0408e86dbe8f44d4b27bf42130e8ac905361d6 Author: Arnd Bergmann Date: Tue May 5 15:53:45 2020 +0200 crypto: blake2b - Fix clang optimization for ARMv7-M When building for ARMv7-M, clang-9 or higher tries to unroll some loops, which ends up confusing the register allocator to the point of generating rather bad code and using more than the warning limit for stack frames: warning: stack frame size of 1200 bytes in function 'blake2b_compress' [-Wframe-larger-than=] Forcing it to not unroll the final loop avoids this problem. Fixes: 91d689337fe8 ("crypto: blake2b - add blake2b generic implementation") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Herbert Xu commit 7ae6d7bd7397e46bd72cb85ab573a669c4dac925 Author: Peter Ujfalusi Date: Tue May 12 16:45:19 2020 +0300 dmaengine: ti: k3-udma: Use proper return code in alloc_chan_resources In udma_alloc_chan_resources() if the channel is not willing to stop then the function should return with error code. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200512134519.5642-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 6fea8735fd96f39c1a0ba52961069ae66e549595 Author: Peter Ujfalusi Date: Tue May 12 16:46:11 2020 +0300 dmaengine: ti: k3-udma: Remove udma_chan.in_ring_cnt The in_ring_cnt is not used for anything, it can be removed. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200512134611.6015-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 5bbeea34bc7ab579516486fc387da8bde94b09a4 Author: Peter Ujfalusi Date: Tue May 12 16:45:44 2020 +0300 dmaengine: ti: k3-udma: Add missing dma_sync call for rx flush descriptor The TR mode rx flush descriptor did not had a dma_sync_single_for_device() call to make sure that the DMA see the correct information. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200512134544.5839-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 5cc5924d8315a53e03e7dbfa7a3067cde7a81ded Merge: d00f26b62333 7ae2e00e8fc2 Author: Alexei Starovoitov Date: Thu May 14 21:21:57 2020 -0700 Merge branch 'xdp-grow-tail' Jesper Dangaard Brouer says: ==================== V4: - Fixup checkpatch.pl issues - Collected more ACKs V3: - Fix issue on virtio_net patch spotted by Jason Wang - Adjust name for variable in mlx5 patch - Collected more ACKs V2: - Fix bug in mlx5 for XDP_PASS case - Collected nitpicks and ACKs from mailing list V1: - Fix bug in dpaa2 XDP have evolved to support several frame sizes, but xdp_buff was not updated with this information. This have caused the side-effect that XDP frame data hard end is unknown. This have limited the BPF-helper bpf_xdp_adjust_tail to only shrink the packet. This patchset address this and add packet tail extend/grow. The purpose of the patchset is ALSO to reserve a memory area that can be used for storing extra information, specifically for extending XDP with multi-buffer support. One proposal is to use same layout as skb_shared_info, which is why this area is currently 320 bytes. When converting xdp_frame to SKB (veth and cpumap), the full tailroom area can now be used and SKB truesize is now correct. For most drivers this result in a much larger tailroom in SKB "head" data area. The network stack can now take advantage of this when doing SKB coalescing. Thus, a good driver test is to use xdp_redirect_cpu from samples/bpf/ and do some TCP stream testing. Use-cases for tail grow/extend: (1) IPsec / XFRM needs a tail extend[1][2]. (2) DNS-cache responses in XDP. (3) HAProxy ALOHA would need it to convert to XDP. (4) Add tail info e.g. timestamp and collect via tcpdump [1] http://vger.kernel.org/netconf2019_files/xfrm_xdp.pdf [2] http://vger.kernel.org/netconf2019.html Examples on howto access the tail area of an XDP packet is shown in the XDP-tutorial example[3]. [3] https://github.com/xdp-project/xdp-tutorial/blob/master/experiment01-tailgrow/ ==================== Signed-off-by: Alexei Starovoitov commit 7ae2e00e8fc23f10169079fadd388317d81012be Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:45 2020 +0200 selftests/bpf: Xdp_adjust_tail add grow tail tests Extend BPF selftest xdp_adjust_tail with grow tail tests, which is added as subtest's. The first grow test stays in same form as original shrink test. The second grow test use the newer bpf_prog_test_run_xattr() calls, and does extra checking of data contents. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/158945350567.97035.9632611946765811876.stgit@firesoul commit 68545fb6f2ff621de26d96a3f15868abfb6897b0 Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:40 2020 +0200 selftests/bpf: Adjust BPF selftest for xdp_adjust_tail Current selftest for BPF-helper xdp_adjust_tail only shrink tail. Make it more clear that this is a shrink test case. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/158945350058.97035.17280775016196207372.stgit@firesoul commit bc56c919fce782f616823b76fb70a788f4762cf5 Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:35 2020 +0200 bpf: Add xdp.frame_sz in bpf_prog_test_run_xdp(). Update the memory requirements, when adding xdp.frame_sz in BPF test_run function bpf_prog_test_run_xdp() which e.g. is used by XDP selftests. Specifically add the expected reserved tailroom, but also allocated a larger memory area to reflect that XDP frames usually comes in this format. Limit the provided packet data size to 4096 minus headroom + tailroom, as this also reflect a common 3520 bytes MTU limit with XDP. Note that bpf_test_init already use a memory allocation method that clears memory. Thus, this already guards against leaking uninit kernel memory. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/158945349549.97035.15316291762482444006.stgit@firesoul commit ddb47d518ca10948d1f64a983cb9274720f691cd Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:30 2020 +0200 xdp: Clear grow memory in bpf_xdp_adjust_tail() Clearing memory of tail when grow happens, because it is too easy to write a XDP_PASS program that extend the tail, which expose this memory to users that can run tcpdump. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/158945349039.97035.5262100484553494.stgit@firesoul commit c8741e2bfe872425ea6f10bb6f7dc1d67bc60c3a Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:25 2020 +0200 xdp: Allow bpf_xdp_adjust_tail() to grow packet size Finally, after all drivers have a frame size, allow BPF-helper bpf_xdp_adjust_tail() to grow or extend packet size at frame tail. Remember that helper/macro xdp_data_hard_end have reserved some tailroom. Thus, this helper makes sure that the BPF-prog don't have access to this tailroom area. V2: Remove one chicken check and use WARN_ONCE for other Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/158945348530.97035.12577148209134239291.stgit@firesoul commit d628ee4fef1dbd6f2fa11e3548322c7839319537 Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:20 2020 +0200 mlx5: Rx queue setup time determine frame_sz for XDP The mlx5 driver have multiple memory models, which are also changed according to whether a XDP bpf_prog is attached. The 'rx_striding_rq' setting is adjusted via ethtool priv-flags e.g.: # ethtool --set-priv-flags mlx5p2 rx_striding_rq off On the general case with 4K page_size and regular MTU packet, then the frame_sz is 2048 and 4096 when XDP is enabled, in both modes. The info on the given frame size is stored differently depending on the RQ-mode and encoded in a union in struct mlx5e_rq union wqe/mpwqe. In rx striding mode rq->mpwqe.log_stride_sz is either 11 or 12, which corresponds to 2048 or 4096 (MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ). In non-striding mode (MLX5_WQ_TYPE_CYCLIC) the frag_stride is stored in rq->wqe.info.arr[0].frag_stride, for the first fragment, which is what the XDP case cares about. To reduce effect on fast-path, this patch determine the frame_sz at setup time, to avoid determining the memory model runtime. Variable is named frame0_sz to make it clear that this is only the frame size of the first fragment. This mlx5 driver does a DMA-sync on XDP_TX action, but grow is safe as it have done a DMA-map on the entire PAGE_SIZE. The driver also already does a XDP length check against sq->hw_mtu on the possible XDP xmit paths mlx5e_xmit_xdp_frame() + mlx5e_xmit_xdp_frame_mpwqe(). V3+4: Change variable name first_frame_sz to frame0_sz V2: Fix that frag_size need to be recalc before creating SKB. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Tariq Toukan Cc: Saeed Mahameed Link: https://lore.kernel.org/bpf/158945348021.97035.12295039384250022883.stgit@firesoul commit 2a637c5b1aaf3b21418fadffad7e56ff27cee6f7 Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:15 2020 +0200 xdp: For Intel AF_XDP drivers add XDP frame_sz Intel drivers implement native AF_XDP zerocopy in separate C-files, that have its own invocation of bpf_prog_run_xdp(). The setup of xdp_buff is also handled in separately from normal code path. This patch update XDP frame_sz for AF_XDP zerocopy drivers i40e, ice and ixgbe, as the code changes needed are very similar. Introduce a helper function xsk_umem_xdp_frame_sz() for calculating frame size. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Björn Töpel Cc: intel-wired-lan@lists.osuosl.org Cc: Magnus Karlsson Link: https://lore.kernel.org/bpf/158945347511.97035.8536753731329475655.stgit@firesoul commit d4ecdbf7aa2fa4feac09befb04cdaf44e6dc938b Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:10 2020 +0200 ice: Add XDP frame size to driver This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than 4K, driver instead advance its rx_buffer->page_offset with the frame size "truesize". For XDP frame size calculations, this mean that in PAGE_SIZE larger than 4K mode the frame_sz change on a per packet basis. For the page split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be updated once outside the main NAPI loop. The default setting in the driver uses build_skb(), which provides the necessary headroom and tailroom for XDP-redirect in RX-frame (in both modes). There is one complication, which is legacy-rx mode (configurable via ethtool priv-flags). There are zero headroom in this mode, which is a requirement for XDP-redirect to work. The conversion to xdp_frame (convert_to_xdp_frame) will detect this insufficient space, and xdp_do_redirect() call will fail. This is deemed acceptable, as it allows other XDP actions to still work in legacy-mode. In legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Cc: Jeff Kirsher Cc: Alexander Duyck Link: https://lore.kernel.org/bpf/158945347002.97035.328088795813704587.stgit@firesoul commit 24104024ce0553ae7738bb1ea5e6e3ed6619160d Author: Jesper Dangaard Brouer Date: Thu May 14 12:51:04 2020 +0200 i40e: Add XDP frame size to driver This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than 4K, driver instead advance its rx_buffer->page_offset with the frame size "truesize". For XDP frame size calculations, this mean that in PAGE_SIZE larger than 4K mode the frame_sz change on a per packet basis. For the page split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be updated once outside the main NAPI loop. The default setting in the driver uses build_skb(), which provides the necessary headroom and tailroom for XDP-redirect in RX-frame (in both modes). There is one complication, which is legacy-rx mode (configurable via ethtool priv-flags). There are zero headroom in this mode, which is a requirement for XDP-redirect to work. The conversion to xdp_frame (convert_to_xdp_frame) will detect this insufficient space, and xdp_do_redirect() call will fail. This is deemed acceptable, as it allows other XDP actions to still work in legacy-mode. In legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Cc: Jeff Kirsher Cc: Alexander Duyck Link: https://lore.kernel.org/bpf/158945346494.97035.12809400414566061815.stgit@firesoul commit 81f3c6283cff03efae139a85851602a4c1c6bd72 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:59 2020 +0200 ixgbevf: Add XDP frame size to VF driver This patch mirrors the changes to ixgbe in previous patch. This VF driver doesn't support XDP_REDIRECT, but correct tailroom is still necessary for BPF-helper xdp_adjust_tail. In legacy-mode + larger PAGE_SIZE, due to lacking tailroom, we accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Cc: Jeff Kirsher Cc: Alexander Duyck Link: https://lore.kernel.org/bpf/158945345984.97035.13518286183248025173.stgit@firesoul commit cf02512899805d6f3d48c0cf1825148f5d24fe71 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:54 2020 +0200 ixgbe: Add XDP frame size to driver This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than 4K, driver instead advance its rx_buffer->page_offset with the frame size "truesize". For XDP frame size calculations, this mean that in PAGE_SIZE larger than 4K mode the frame_sz change on a per packet basis. For the page split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be updated once outside the main NAPI loop. The default setting in the driver uses build_skb(), which provides the necessary headroom and tailroom for XDP-redirect in RX-frame (in both modes). There is one complication, which is legacy-rx mode (configurable via ethtool priv-flags). There are zero headroom in this mode, which is a requirement for XDP-redirect to work. The conversion to xdp_frame (convert_to_xdp_frame) will detect this insufficient space, and xdp_do_redirect() call will fail. This is deemed acceptable, as it allows other XDP actions to still work in legacy-mode. In legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: intel-wired-lan@lists.osuosl.org Cc: Jeff Kirsher Cc: Alexander Duyck Link: https://lore.kernel.org/bpf/158945345455.97035.14334355929030628741.stgit@firesoul commit 88eb0ee17b2ece64fcf6689a4557a5c2e7a89c4b Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:49 2020 +0200 ixgbe: Fix XDP redirect on archs with PAGE_SIZE above 4K The ixgbe driver have another memory model when compiled on archs with PAGE_SIZE above 4096 bytes. In this mode it doesn't split the page in two halves, but instead increment rx_buffer->page_offset by truesize of packet (which include headroom and tailroom for skb_shared_info). This is done correctly in ixgbe_build_skb(), but in ixgbe_rx_buffer_flip which is currently only called on XDP_TX and XDP_REDIRECT, it forgets to add the tailroom for skb_shared_info. This breaks XDP_REDIRECT, for veth and cpumap. Fix by adding size of skb_shared_info tailroom. Maintainers notice: This fix have been queued to Jeff. Fixes: 6453073987ba ("ixgbe: add initial support for xdp redirect") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: Jeff Kirsher Link: https://lore.kernel.org/bpf/158945344946.97035.17031588499266605743.stgit@firesoul commit 9ce6146ec7b50718fa5ef5287f1d6561b25a5da8 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:44 2020 +0200 virtio_net: Add XDP frame size in two code paths The virtio_net driver is running inside the guest-OS. There are two XDP receive code-paths in virtio_net, namely receive_small() and receive_mergeable(). The receive_big() function does not support XDP. In receive_small() the frame size is available in buflen. The buffer backing these frames are allocated in add_recvbuf_small() with same size, except for the headroom, but tailroom have reserved room for skb_shared_info. The headroom is encoded in ctx pointer as a value. In receive_mergeable() the frame size is more dynamic. There are two basic cases: (1) buffer size is based on a exponentially weighted moving average (see DECLARE_EWMA) of packet length. Or (2) in case virtnet_get_headroom() have any headroom then buffer size is PAGE_SIZE. The ctx pointer is this time used for encoding two values; the buffer len "truesize" and headroom. In case (1) if the rx buffer size is underestimated, the packet will have been split over more buffers (num_buf info in virtio_net_hdr_mrg_rxbuf placed in top of buffer area). If that happens the XDP path does a xdp_linearize_page operation. V3: Adjust frame_sz in receive_mergeable() case, spotted by Jason Wang. The code is really hard to follow, so some hints to reviewers. The receive_mergeable() case gets frames that were allocated in add_recvbuf_mergeable() which uses headroom=virtnet_get_headroom(), and 'buf' ptr is advanced this headroom. The headroom can only be 0 or VIRTIO_XDP_HEADROOM, as virtnet_get_headroom is really simple: static unsigned int virtnet_get_headroom(struct virtnet_info *vi) { return vi->xdp_queue_pairs ? VIRTIO_XDP_HEADROOM : 0; } As frame_sz is an offset size from xdp.data_hard_start, reviewers should notice how this is calculated in receive_mergeable(): int offset = buf - page_address(page); [...] data = page_address(xdp_page) + offset; xdp.data_hard_start = data - VIRTIO_XDP_HEADROOM + vi->hdr_len; The calculated offset will always be VIRTIO_XDP_HEADROOM when reaching this code. Thus, xdp.data_hard_start will be page-start address plus vi->hdr_len. Given this xdp.frame_sz need to be reduced with vi->hdr_len size. IMHO a followup patch should cleanup this code to make it easier to maintain and understand, but it is outside the scope of this patchset. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Link: https://lore.kernel.org/bpf/158945344436.97035.9445115070189151680.stgit@firesoul commit 05afee298afc2f2497b7400b53e9d60fcc24d525 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:39 2020 +0200 vhost_net: Also populate XDP frame size In vhost_net_build_xdp() the 'buf' that gets queued via an xdp_buff have embedded a struct tun_xdp_hdr (located at xdp->data_hard_start) which contains the buffer length 'buflen' (with tailroom for skb_shared_info). Also storing this buflen in xdp->frame_sz, does not obsolete struct tun_xdp_hdr, as it also contains a struct virtio_net_hdr with other information. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Link: https://lore.kernel.org/bpf/158945343928.97035.4620233649151726289.stgit@firesoul commit fb3e6e9307973d2f70a173f1b33d1054fa2b691f Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:34 2020 +0200 tun: Add XDP frame size The tun driver have two code paths for running XDP (bpf_prog_run_xdp). In both cases 'buflen' contains enough tailroom for skb_shared_info. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Link: https://lore.kernel.org/bpf/158945343419.97035.9594485183958037621.stgit@firesoul commit fa6540b8efd8944f8627c2f304114663ef4aadc4 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:29 2020 +0200 nfp: Add XDP frame size to netronome driver The netronome nfp driver use PAGE_SIZE when xdp_prog is set, but xdp.data_hard_start begins at offset NFP_NET_RX_BUF_HEADROOM. Thus, adjust for this when setting xdp.frame_sz, as it counts from data_hard_start. When doing XDP_TX this driver is smart and instead of a full DMA-map does a DMA-sync on with packet length. As xdp_adjust_tail can now grow packet length, add checks to make sure that grow size is within the DMA-mapped size. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/bpf/158945342911.97035.11214251236208648808.stgit@firesoul commit c8145b263dd85f9e589c7c7ba531423d82ca96ae Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:24 2020 +0200 net: thunderx: Add XDP frame size To help reviewers these are the defines related to RCV_FRAG_LEN #define DMA_BUFFER_LEN 1536 /* In multiples of 128bytes */ #define RCV_FRAG_LEN (SKB_DATA_ALIGN(DMA_BUFFER_LEN + NET_SKB_PAD) + \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: Sunil Goutham Cc: Robert Richter Link: https://lore.kernel.org/bpf/158945342402.97035.12649844447148990032.stgit@firesoul commit d201ea9ebc519fb34ad9ef1f49ab2ab31f5111ea Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:18 2020 +0200 mlx4: Add XDP frame size and adjust max XDP MTU The mlx4 drivers size of memory backing the RX packet is stored in frag_stride. For XDP mode this will be PAGE_SIZE (normally 4096). For normal mode frag_stride is 2048. Also adjust MLX4_EN_MAX_XDP_MTU to take tailroom into account. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Reviewed-by: Tariq Toukan Cc: Saeed Mahameed Link: https://lore.kernel.org/bpf/158945341893.97035.2688142527052329942.stgit@firesoul commit 08fc1cfd2d250be853d33d6505ae11ff52b83b74 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:13 2020 +0200 ena: Add XDP frame size to amazon NIC driver Frame size ENA_PAGE_SIZE is limited to 16K on systems with larger PAGE_SIZE than 16K. Change ENA_XDP_MAX_MTU to also take into account the reserved tailroom. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Sameeh Jubran Cc: Arthur Kiyanovski Link: https://lore.kernel.org/bpf/158945341384.97035.907403694833419456.stgit@firesoul commit c88c35181d6ab83e439855681032653ef8728045 Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:08 2020 +0200 net: ethernet: ti: Add XDP frame size to driver cpsw The driver code cpsw.c and cpsw_new.c both use page_pool with default order-0 pages or their RX-pages. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Reviewed-by: Grygorii Strashko Cc: Ilias Apalodimas Link: https://lore.kernel.org/bpf/158945340875.97035.752144756428532878.stgit@firesoul commit bc1c5745d77963a4f4684c78cc2b3323900af68b Author: Jesper Dangaard Brouer Date: Thu May 14 12:50:03 2020 +0200 qlogic/qede: Add XDP frame size to driver The driver qede uses a full page, when XDP is enabled. The drivers value in rx_buf_seg_size (struct qede_rx_queue) will be PAGE_SIZE when an XDP bpf_prog is attached. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: Ariel Elior Cc: GR-everest-linux-l2@marvell.com Link: https://lore.kernel.org/bpf/158945340366.97035.7764939691580349618.stgit@firesoul commit 7358877ac11041a22ce1cb35c352809051eac48f Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:58 2020 +0200 hv_netvsc: Add XDP frame size to driver The hyperv NIC driver does memory allocation and copy even without XDP. In XDP mode it will allocate a new page for each packet and copy over the payload, before invoking the XDP BPF-prog. The positive thing it that its easy to determine the xdp.frame_sz. The XDP implementation for hv_netvsc transparently passes xdp_prog to the associated VF NIC. Many of the Azure VMs are using SRIOV, so majority of the data are actually processed directly on the VF driver's XDP path. So the overhead of the synthetic data path (hv_netvsc) is minimal. Then XDP is enabled on this driver, XDP_PASS and XDP_TX will create the SKB via build_skb (based on the newly allocated page). Now using XDP frame_sz this will provide more skb_tailroom, which netstack can use for SKB coalescing (e.g tcp_try_coalesce -> skb_try_coalesce). V3: Adjust patch desc to be more positive. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: Wei Liu Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Link: https://lore.kernel.org/bpf/158945339857.97035.10212138582505736163.stgit@firesoul commit 4a9b052a590d6217237502efde7d598156966080 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:53 2020 +0200 dpaa2-eth: Add XDP frame size The dpaa2-eth driver reserve some headroom used for hardware and software annotation area in RX/TX buffers. Thus, xdp.data_hard_start doesn't start at page boundary. When XDP is configured the area reserved via dpaa2_fd_get_offset(fd) is 448 bytes of which XDP have reserved 256 bytes. As frame_sz is calculated as an offset from xdp_buff.data_hard_start, an adjust from the full PAGE_SIZE == DPAA2_ETH_RX_BUF_RAW_SIZE. When doing XDP_REDIRECT, the driver doesn't need this reserved headroom any-longer and allows xdp_do_redirect() to use it. This is an advantage for the drivers own ndo-xdp_xmit, as it uses part of this headroom for itself. Patch also adjust frame_sz in this case. The driver cannot support XDP data_meta, because it uses the headroom just before xdp.data for struct dpaa2_eth_swa (DPAA2_ETH_SWA_SIZE=64), when transmitting the packet. When transmitting a xdp_frame in dpaa2_eth_xdp_xmit_frame (call via ndo_xdp_xmit) is uses this area to store a pointer to xdp_frame and dma_size, which is used in TX completion (free_tx_fd) to return frame via xdp_return_frame(). Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: Ioana Radulescu Link: https://lore.kernel.org/bpf/158945339348.97035.8562488847066908856.stgit@firesoul commit 45a9e6d8a687e6a0ea6c2f78f15955ae96be4720 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:48 2020 +0200 veth: Xdp using frame_sz in veth driver The veth driver can run XDP in "native" mode in it's own NAPI handler, and since commit 9fc8d518d9d5 ("veth: Handle xdp_frames in xdp napi ring") packets can come in two forms either xdp_frame or skb, calling respectively veth_xdp_rcv_one() or veth_xdp_rcv_skb(). For packets to arrive in xdp_frame format, they will have been redirected from an XDP native driver. In case of XDP_PASS or no XDP-prog attached, the veth driver will allocate and create an SKB. The current code in veth_xdp_rcv_one() xdp_frame case, had to guess the frame truesize of the incoming xdp_frame, when using veth_build_skb(). With xdp_frame->frame_sz this is not longer necessary. Calculating the frame_sz in veth_xdp_rcv_skb() skb case, is done similar to the XDP-generic handling code in net/core/dev.c. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Reviewed-by: Lorenzo Bianconi Acked-by: Toke Høiland-Jørgensen Acked-by: Toshiaki Makita Link: https://lore.kernel.org/bpf/158945338840.97035.935897116345700902.stgit@firesoul commit 5c8572251fabc5bb49fd623c064e95a9daf6a3e3 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:43 2020 +0200 veth: Adjust hard_start offset on redirect XDP frames When native XDP redirect into a veth device, the frame arrives in the xdp_frame structure. It is then processed in veth_xdp_rcv_one(), which can run a new XDP bpf_prog on the packet. Doing so requires converting xdp_frame to xdp_buff, but the tricky part is that xdp_frame memory area is located in the top (data_hard_start) memory area that xdp_buff will point into. The current code tried to protect the xdp_frame area, by assigning xdp_buff.data_hard_start past this memory. This results in 32 bytes less headroom to expand into via BPF-helper bpf_xdp_adjust_head(). This protect step is actually not needed, because BPF-helper bpf_xdp_adjust_head() already reserve this area, and don't allow BPF-prog to expand into it. Thus, it is safe to point data_hard_start directly at xdp_frame memory area. Fixes: 9fc8d518d9d5 ("veth: Handle xdp_frames in xdp napi ring") Reported-by: Mao Wenan Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Toshiaki Makita Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/158945338331.97035.5923525383710752178.stgit@firesoul commit db612f749e2454c506f20155bba2871f0307d133 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:38 2020 +0200 xdp: Cpumap redirect use frame_sz and increase skb_tailroom Knowing the memory size backing the packet/xdp_frame data area, and knowing it already have reserved room for skb_shared_info, simplifies using build_skb significantly. With this change we no-longer lie about the SKB truesize, but more importantly a significant larger skb_tailroom is now provided, e.g. when drivers uses a full PAGE_SIZE. This extra tailroom (in linear area) can be used by the network stack when coalescing SKBs (e.g. in skb_try_coalesce, see TCP cases where tcp_queue_rcv() can 'eat' skb). Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/158945337822.97035.13557959180460986059.stgit@firesoul commit 34cc0b338a61de3eee3a2bfcaf4f9d6e9fae091a Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:33 2020 +0200 xdp: Xdp_frame add member frame_sz and handle in convert_to_xdp_frame Use hole in struct xdp_frame, when adding member frame_sz, which keeps same sizeof struct (32 bytes) Drivers ixgbe and sfc had bug cases where the necessary/expected tailroom was not reserved. This can lead to some hard to catch memory corruption issues. Having the drivers frame_sz this can be detected when packet length/end via xdp->data_end exceed the xdp_data_hard_end pointer, which accounts for the reserved the tailroom. When detecting this driver issue, simply fail the conversion with NULL, which results in feedback to driver (failing xdp_do_redirect()) causing driver to drop packet. Given the lack of consistent XDP stats, this can be hard to troubleshoot. And given this is a driver bug, we want to generate some more noise in form of a WARN stack dump (to ID the driver code that inlined convert_to_xdp_frame). Inlining the WARN macro is problematic, because it adds an asm instruction (on Intel CPUs ud2) what influence instruction cache prefetching. Thus, introduce xdp_warn and macro XDP_WARN, to avoid this and at the same time make identifying the function and line of this inlined function easier. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/158945337313.97035.10015729316710496600.stgit@firesoul commit a075767bbdc659066b89be282c8377fa880e9dc4 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:28 2020 +0200 net: XDP-generic determining XDP frame size The SKB "head" pointer points to the data area that contains skb_shared_info, that can be found via skb_end_pointer(). Given xdp->data_hard_start have been established (basically pointing to skb->head), frame size is between skb_end_pointer() and data_hard_start, plus the size reserved to skb_shared_info. Change the bpf_xdp_adjust_tail offset adjust of skb->len, to be a positive offset number on grow, and negative number on shrink. As this seems more natural when reading the code. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/158945336804.97035.7164852191163722056.stgit@firesoul commit 495de55f70199bd7ea09079c484283e58bf75c82 Author: Ilias Apalodimas Date: Thu May 14 12:49:23 2020 +0200 net: netsec: Add support for XDP frame size This driver takes advantage of page_pool PP_FLAG_DMA_SYNC_DEV that can help reduce the number of cache-lines that need to be flushed when doing DMA sync for_device. Due to xdp_adjust_tail can grow the area accessible to the by the CPU (can possibly write into), then max sync length *after* bpf_prog_run_xdp() needs to be taken into account. For XDP_TX action the driver is smart and does DMA-sync. When growing tail this is still safe, because page_pool have DMA-mapped the entire page size. Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/bpf/158945336295.97035.15034759661036971024.stgit@firesoul commit 494f44d54e25dd79af0ed6734c2d6be0aa0b6d94 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:17 2020 +0200 mvneta: Add XDP frame size to driver This marvell driver mvneta uses PAGE_SIZE frames, which makes it really easy to convert. Driver updates rxq and now frame_sz once per NAPI call. This driver takes advantage of page_pool PP_FLAG_DMA_SYNC_DEV that can help reduce the number of cache-lines that need to be flushed when doing DMA sync for_device. Due to xdp_adjust_tail can grow the area accessible to the by the CPU (can possibly write into), then max sync length *after* bpf_prog_run_xdp() needs to be taken into account. For XDP_TX action the driver is smart and does DMA-sync. When growing tail this is still safe, because page_pool have DMA-mapped the entire page size. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Lorenzo Bianconi Cc: thomas.petazzoni@bootlin.com Link: https://lore.kernel.org/bpf/158945335786.97035.12714388304493736747.stgit@firesoul commit 983e43451830742fa93f83656ccbdcb865ea4259 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:12 2020 +0200 sfc: Add XDP frame size This driver uses RX page-split when possible. It was recently fixed in commit 86e85bf6981c ("sfc: fix XDP-redirect in this driver") to add needed tailroom for XDP-redirect. After the fix efx->rx_page_buf_step is the frame size, with enough head and tail-room for XDP-redirect. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/158945335278.97035.14611425333184621652.stgit@firesoul commit 63fe91ab3d1c5c0b4497b993b8eeaa54f6688d53 Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:07 2020 +0200 bnxt: Add XDP frame size to driver This driver uses full PAGE_SIZE pages when XDP is enabled. In case of XDP uses driver uses __bnxt_alloc_rx_page which does full page DMA-map. Thus, xdp_adjust_tail grow is DMA compliant for XDP_TX action that does DMA-sync. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Reviewed-by: Andy Gospodarek Cc: Michael Chan Cc: Andy Gospodarek Link: https://lore.kernel.org/bpf/158945334769.97035.13437970179897613984.stgit@firesoul commit f95f0f95cfb7f180ed7571d4915432d5098df7ec Author: Jesper Dangaard Brouer Date: Thu May 14 12:49:02 2020 +0200 xdp: Add frame size to xdp_buff XDP have evolved to support several frame sizes, but xdp_buff was not updated with this information. The frame size (frame_sz) member of xdp_buff is introduced to know the real size of the memory the frame is delivered in. When introducing this also make it clear that some tailroom is reserved/required when creating SKBs using build_skb(). It would also have been an option to introduce a pointer to data_hard_end (with reserved offset). The advantage with frame_sz is that (like rxq) drivers only need to setup/assign this value once per NAPI cycle. Due to XDP-generic (and some drivers) it's not possible to store frame_sz inside xdp_rxq_info, because it's varies per packet as it can be based/depend on packet length. V2: nitpick: deduct -> deduce Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/158945334261.97035.555255657490688547.stgit@firesoul commit 9a611a1dce07138c9cb2ac5d3f118e7de44fa774 Author: Herbert Xu Date: Fri May 15 14:13:46 2020 +1000 Revert "ASoC: cros_ec_codec: use crypto_shash_tfm_digest()" This reverts commit 85fc78b80f15d723db3aa8f368b414ee70a1937c as a different fix has already been applied in the sound-asoc tree and this patch is no longer required. Reported-by: Stephen Rothwell Reported-by: Mark Brown Signed-off-by: Herbert Xu commit d00f26b623333f2419f4c3b95ff11c8b1bb96f56 Merge: 9b65d2ffe853 b92d44b5c2ef Author: David S. Miller Date: Thu May 14 20:31:21 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2020-05-14 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Merged tag 'perf-for-bpf-2020-05-06' from tip tree that includes CAP_PERFMON. 2) support for narrow loads in bpf_sock_addr progs and additional helpers in cg-skb progs, from Andrey. 3) bpf benchmark runner, from Andrii. 4) arm and riscv JIT optimizations, from Luke. 5) bpf iterator infrastructure, from Yonghong. ==================== Signed-off-by: David S. Miller commit 59ffe4ed0725de96f4710013c34de387fbeac90c Author: Andre Przywara Date: Wed May 13 11:30:16 2020 +0100 dt-bindings: ehci/ohci: Allow iommus property A OHCI/EHCI controller could be behind an IOMMU, in which case an iommus property assigns the stream ID for this device. Allow that property in the DT bindings to fix a complaint about the Arm Juno board's DTS file. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 17b53ce330781b0457b9f7d329ad6342ca8f0b9e Author: Andre Przywara Date: Wed May 13 11:30:15 2020 +0100 dt-bindings: mali-midgard: Allow dma-coherent Add the boolean dma-coherent property to the list of allowed properties, since some boards (Arm Juno) integrate the GPU this way. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 61efb56e30f1c54ef3b6ca4b1598d01562979ef1 Author: Andre Przywara Date: Wed May 13 11:29:57 2020 +0100 dt-bindings: arm: gic: Allow combining arm,gic-400 compatible strings The arm,gic-400 compatible is probably the best matching string for the GIC in most modern SoCs, but was only introduced later into the kernel. For historic reasons and to keep compatibility, some SoC DTs were thus using a combination of this name and one of the older strings, which currently the binding denies. Add a stanza to the DT binding to allow "arm,gic-400", followed by either "arm,cortex-a15-gic" or "arm,cortex-a7-gic". This fixes binding compliance for quite some SoC .dtsi files in the kernel tree. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 0be4ae74881c96ae8ff718bcfb517415ab61a41e Author: Yoshihiro Kaneko Date: Thu May 7 09:55:03 2020 +0200 dt-bindings: irqchip: renesas-intc-irqpin: Convert to json-schema Convert the Renesas Interrupt Controller (INTC) for external pins Device Tree binding documentation to json-schema. Signed-off-by: Yoshihiro Kaneko Co-developed-by: Geert Uytterhoeven Signed-off-by: Geert Uytterhoeven [robh: drop allOf] Signed-off-by: Rob Herring commit 1493bddcca4d601ca6f3dd27f2226f37a0f39732 Merge: 80c9b58e9503 1c530d431c69 Author: Dave Airlie Date: Fri May 15 11:58:55 2020 +1000 Merge tag 'drm-misc-next-2020-05-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.8: UAPI Changes: Cross-subsystem Changes: * dma-buf: use atomic64_fetch_add() for context id * Documentation: document bindings for ASUS ZOOT TM5P5, BOE NV133FHM-N62, hpd-gpios Core Changes: Driver Changes: * drm/ast: fix supend; cleanups * drm/i2c: cleanups * drm/panel: add MODULE_LICENSE to panel-visinox-rm69299; add support for ASUS TM5P5i, BOE NV133FHM-N62i; fix size and bpp of BOE NV133FHM-N61 add hpd-gpio to panel-simple * drm/mcde: fix return value check in mcde_dsi_bind() * drm/mgag200: use managed drmm_mode_config_init(); cleanups * fbdev/pxa168fb: cleanups Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200514070819.GA6930@linux-uq9g commit 93900337b9ac2f4eca427eff6d187be2dc3b5551 Author: Michael Ellerman Date: Thu Apr 23 16:00:38 2020 +1000 drivers/macintosh: Fix memleak in windfarm_pm112 driver create_cpu_loop() calls smu_sat_get_sdb_partition() which does kmalloc() and returns the allocated buffer. In fact it's called twice, and neither buffer is freed. This results in a memory leak as reported by Erhard: unreferenced object 0xc00000047081f840 (size 32): comm "kwindfarm", pid 203, jiffies 4294880630 (age 5552.877s) hex dump (first 32 bytes): c8 06 02 7f ff 02 ff 01 fb bf 00 41 00 20 00 00 ...........A. .. 00 07 89 37 00 a0 00 00 00 00 00 00 00 00 00 00 ...7............ backtrace: [<0000000083f0a65c>] .smu_sat_get_sdb_partition+0xc4/0x2d0 [windfarm_smu_sat] [<000000003010fcb7>] .pm112_wf_notify+0x104c/0x13bc [windfarm_pm112] [<00000000b958b2dd>] .notifier_call_chain+0xa8/0x180 [<0000000070490868>] .blocking_notifier_call_chain+0x64/0x90 [<00000000131d8149>] .wf_thread_func+0x114/0x1a0 [<000000000d54838d>] .kthread+0x13c/0x190 [<00000000669b72bc>] .ret_from_kernel_thread+0x58/0x64 unreferenced object 0xc0000004737089f0 (size 16): comm "kwindfarm", pid 203, jiffies 4294880879 (age 5552.050s) hex dump (first 16 bytes): c4 04 01 7f 22 11 e0 e6 ff 55 7b 12 ec 11 00 00 ...."....U{..... backtrace: [<0000000083f0a65c>] .smu_sat_get_sdb_partition+0xc4/0x2d0 [windfarm_smu_sat] [<00000000b94ef7e1>] .pm112_wf_notify+0x1294/0x13bc [windfarm_pm112] [<00000000b958b2dd>] .notifier_call_chain+0xa8/0x180 [<0000000070490868>] .blocking_notifier_call_chain+0x64/0x90 [<00000000131d8149>] .wf_thread_func+0x114/0x1a0 [<000000000d54838d>] .kthread+0x13c/0x190 [<00000000669b72bc>] .ret_from_kernel_thread+0x58/0x64 Fix it by rearranging the logic so we deal with each buffer separately, which then makes it easy to free the buffer once we're done with it. Fixes: ac171c46667c ("[PATCH] powerpc: Thermal control for dual core G5s") Cc: stable@vger.kernel.org # v2.6.16+ Reported-by: Erhard F. Signed-off-by: Michael Ellerman Tested-by: Erhard F. Link: https://lore.kernel.org/r/20200423060038.3308530-1-mpe@ellerman.id.au commit 7481cad4747303442209bc5dba2f56c3afcea07d Author: Michael Ellerman Date: Sun Apr 26 21:44:10 2020 +1000 selftests/powerpc: Add a test of counting larx/stcx This is based on the count_instructions test. However this one also counts the number of failed stcx's, and in conjunction with knowing the size of the stcx loop, can calculate the total number of instructions executed even in the face of non-deterministic stcx failures. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200426114410.3917383-1-mpe@ellerman.id.au commit 24ac99e97fa7b8f0db9b48413a76def9cf73295c Author: Michael Ellerman Date: Tue Apr 28 22:31:52 2020 +1000 powerpc: Drop unneeded cast in task_pt_regs() There's no need to cast in task_pt_regs() as tsk->thread.regs should already be a struct pt_regs. If someone's using task_pt_regs() on something that's not a task but happens to have a thread.regs then we'll deal with them later. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200428123152.73566-1-mpe@ellerman.id.au commit 7ffa8b7dc11752827329e4e84a574ea6aaf24716 Author: Michael Ellerman Date: Tue Apr 28 22:31:30 2020 +1000 powerpc/64: Don't initialise init_task->thread.regs Aneesh increased the size of struct pt_regs by 16 bytes and started seeing this WARN_ON: smp: Bringing up secondary CPUs ... ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at arch/powerpc/kernel/process.c:455 giveup_all+0xb4/0x110 Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.7.0-rc2-gcc-8.2.0-1.g8f6a41f-default+ #318 NIP: c00000000001a2b4 LR: c00000000001a29c CTR: c0000000031d0000 REGS: c0000000026d3980 TRAP: 0700 Not tainted (5.7.0-rc2-gcc-8.2.0-1.g8f6a41f-default+) MSR: 800000000282b033 CR: 48048224 XER: 00000000 CFAR: c000000000019cc8 IRQMASK: 1 GPR00: c00000000001a264 c0000000026d3c20 c0000000026d7200 800000000280b033 GPR04: 0000000000000001 0000000000000000 0000000000000077 30206d7372203164 GPR08: 0000000000002000 0000000002002000 800000000280b033 3230303030303030 GPR12: 0000000000008800 c0000000031d0000 0000000000800050 0000000002000066 GPR16: 000000000309a1a0 000000000309a4b0 000000000309a2d8 000000000309a890 GPR20: 00000000030d0098 c00000000264da40 00000000fd620000 c0000000ff798080 GPR24: c00000000264edf0 c0000001007469f0 00000000fd620000 c0000000020e5e90 GPR28: c00000000264edf0 c00000000264d200 000000001db60000 c00000000264d200 NIP [c00000000001a2b4] giveup_all+0xb4/0x110 LR [c00000000001a29c] giveup_all+0x9c/0x110 Call Trace: [c0000000026d3c20] [c00000000001a264] giveup_all+0x64/0x110 (unreliable) [c0000000026d3c90] [c00000000001ae34] __switch_to+0x104/0x480 [c0000000026d3cf0] [c000000000e0b8a0] __schedule+0x320/0x970 [c0000000026d3dd0] [c000000000e0c518] schedule_idle+0x38/0x70 [c0000000026d3df0] [c00000000019c7c8] do_idle+0x248/0x3f0 [c0000000026d3e70] [c00000000019cbb8] cpu_startup_entry+0x38/0x40 [c0000000026d3ea0] [c000000000011bb0] rest_init+0xe0/0xf8 [c0000000026d3ed0] [c000000002004820] start_kernel+0x990/0x9e0 [c0000000026d3f90] [c00000000000c49c] start_here_common+0x1c/0x400 Which was unexpected. The warning is checking the thread.regs->msr value of the task we are switching from: usermsr = tsk->thread.regs->msr; ... WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC))); ie. if MSR_VSX is set then both of MSR_FP and MSR_VEC are also set. Dumping tsk->thread.regs->msr we see that it's: 0x1db60000 Which is not a normal looking MSR, in fact the only valid bit is MSR_VSX, all the other bits are reserved in the current definition of the MSR. We can see from the oops that it was swapper/0 that we were switching from when we hit the warning, ie. init_task. So its thread.regs points to the base (high addresses) in init_stack. Dumping the content of init_task->thread.regs, with the members of pt_regs annotated (the 16 bytes larger version), we see: 0000000000000000 c000000002780080 gpr[0] gpr[1] 0000000000000000 c000000002666008 gpr[2] gpr[3] c0000000026d3ed0 0000000000000078 gpr[4] gpr[5] c000000000011b68 c000000002780080 gpr[6] gpr[7] 0000000000000000 0000000000000000 gpr[8] gpr[9] c0000000026d3f90 0000800000002200 gpr[10] gpr[11] c000000002004820 c0000000026d7200 gpr[12] gpr[13] 000000001db60000 c0000000010aabe8 gpr[14] gpr[15] c0000000010aabe8 c0000000010aabe8 gpr[16] gpr[17] c00000000294d598 0000000000000000 gpr[18] gpr[19] 0000000000000000 0000000000001ff8 gpr[20] gpr[21] 0000000000000000 c00000000206d608 gpr[22] gpr[23] c00000000278e0cc 0000000000000000 gpr[24] gpr[25] 000000002fff0000 c000000000000000 gpr[26] gpr[27] 0000000002000000 0000000000000028 gpr[28] gpr[29] 000000001db60000 0000000004750000 gpr[30] gpr[31] 0000000002000000 000000001db60000 nip msr 0000000000000000 0000000000000000 orig_r3 ctr c00000000000c49c 0000000000000000 link xer 0000000000000000 0000000000000000 ccr softe 0000000000000000 0000000000000000 trap dar 0000000000000000 0000000000000000 dsisr result 0000000000000000 0000000000000000 ppr kuap 0000000000000000 0000000000000000 pad[2] pad[3] This looks suspiciously like stack frames, not a pt_regs. If we look closely we can see return addresses from the stack trace above, c000000002004820 (start_kernel) and c00000000000c49c (start_here_common). init_task->thread.regs is setup at build time in processor.h: #define INIT_THREAD { \ .ksp = INIT_SP, \ .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ The early boot code where we setup the initial stack is: LOAD_REG_ADDR(r3,init_thread_union) /* set up a stack pointer */ LOAD_REG_IMMEDIATE(r1,THREAD_SIZE) add r1,r3,r1 li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) Which creates a stack frame of size 112 bytes (STACK_FRAME_OVERHEAD). Which is far too small to contain a pt_regs. So the result is init_task->thread.regs is pointing at some stack frames on the init stack, not at a pt_regs. We have gotten away with this for so long because with pt_regs at its current size the MSR happens to point into the first frame, at a location that is not written to by the early asm. With the 16 byte expansion the MSR falls into the second frame, which is used by the compiler, and collides with a saved register that tends to be non-zero. As far as I can see this has been wrong since the original merge of 64-bit ppc support, back in 2002. Conceptually swapper should have no regs, it never entered from userspace, and in fact that's what we do on 32-bit. It's also presumably what the "bogus" comment is referring to. So I think the right fix is to just not-initialise regs at all. I'm slightly worried this will break some code that isn't prepared for a NULL regs, but we'll have to see. Remove the comment in head_64.S which refers to us setting up the regs (even though we never did), and is otherwise not really accurate any more. Reported-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200428123130.73078-1-mpe@ellerman.id.au commit 02bddf21c34d0a918acc8647195ba4507e3db8fc Author: Gustavo A. R. Silva Date: Thu May 7 13:57:55 2020 -0500 powerpc/mm: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200507185755.GA15014@embeddedor commit 0f6be41c60699fd8cdfa93e5e85a306cec1ac1d0 Author: Gustavo A. R. Silva Date: Thu May 7 13:57:49 2020 -0500 powerpc: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200507185749.GA14994@embeddedor commit 4e0e45b07d790253643ee05300784ab2156e2d5e Author: Nicholas Piggin Date: Thu May 7 22:13:32 2020 +1000 powerpc: Use trap metadata to prevent double restart rather than zeroing trap It's not very nice to zero trap for this, because then system calls no longer have trap_is_syscall(regs) invariant, and we can't distinguish between sc and scv system calls (in a later patch). Take one last unused bit from the low bits of the pt_regs.trap word for this instead. There is not a really good reason why it should be in trap as opposed to another field, but trap has some concept of flags and it exists. Ideally I think we would move trap to 2-byte field and have 2 more bytes available independently. Add a selftests case for this, which can be seen to fail if trap_norestart() is changed to return false. Signed-off-by: Nicholas Piggin [mpe: Make them static inlines] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200507121332.2233629-4-mpe@ellerman.id.au commit 912237ea166428edcbf3c137adf12cb987c477f2 Author: Nicholas Piggin Date: Thu May 7 22:13:31 2020 +1000 powerpc: trap_is_syscall() helper to hide syscall trap number A new system call interrupt will be added with a new trap number. Hide the explicit 0xc00 test behind an accessor to reduce churn in callers. Signed-off-by: Nicholas Piggin [mpe: Make it a static inline] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200507121332.2233629-3-mpe@ellerman.id.au commit db30144b5c9cfb09c6b8b2fa7a9c351c94aa3433 Author: Nicholas Piggin Date: Thu May 7 22:13:30 2020 +1000 powerpc: Use set_trap() and avoid open-coding trap masking The pt_regs.trap field keeps 4 low bits for some metadata about the trap or how it was handled, which is masked off in order to test the architectural trap number. Add a set_trap() accessor to set this, equivalent to TRAP() for returning it. This is actually not quite the equivalent of TRAP() because it always clears the low bits, which may be harmless if it can only be updated via ptrace syscall, but it seems dangerous. In fact settting TRAP from ptrace doesn't seem like a great idea so maybe it's better deleted. Signed-off-by: Nicholas Piggin [mpe: Make it a static inline rather than a shouty macro] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200507121332.2233629-2-mpe@ellerman.id.au commit feb9df3462e688d073848d85c8bb132fe8fd9ae5 Author: Nicholas Piggin Date: Thu May 7 22:13:29 2020 +1000 powerpc/64s: Always has full regs, so remove remnant checks Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200507121332.2233629-1-mpe@ellerman.id.au commit b92d44b5c2efe70dbe7fc44fdd2ad46f8612418a Merge: 5b0004d92b45 68e916bc8d32 Author: Alexei Starovoitov Date: Thu May 14 18:41:08 2020 -0700 Merge branch 'expand-cg_skb-helpers' Andrey Ignatov says: ==================== v2->v3: - better documentation for bpf_sk_cgroup_id in uapi (Yonghong Song) - save/restore errno in network helpers (Yonghong Song) - cleanup leftover after switching selftest to skeleton (Yonghong Song) - switch from map to skel->bss in selftest (Yonghong Song) v1->v2: - switch selftests to skeleton. This patch set allows a bunch of existing sk lookup and skb cgroup id helpers, and adds two new bpf_sk_{,ancestor_}cgroup_id helpers to be used in cgroup skb programs. It fills the gap to cover a use-case to apply intra-host cgroup-bpf network policy based on a source cgroup a packet comes from. For example, there can be multiple containers A, B, C running on a host. Every such container runs in its own cgroup that can have multiple sub-cgroups. But all these containers can share some IP addresses. At the same time container A wants to have a policy for a server S running in it so that only clients from this same container can connect to S, but not from other containers (such as B, C). Source IP address can't be used to decide whether to allow or deny a packet, but it looks reasonable to filter by cgroup id. The patch set allows to implement the following policy: * when an ingress packet comes to container's cgroup, lookup peer (client) socket this packet comes from; * having peer socket, get its cgroup id; * compare peer cgroup id with self cgroup id and allow packet only if they match, i.e. it comes from same cgroup; * the "sub-cgroup" part of the story can be addressed by getting not direct cgroup id of the peer socket, but ancestor cgroup id on specified level, similar to existing "ancestor" flavors of cgroup id helpers. A newly introduced selftest implements such a policy in its basic form to provide a better idea on the use-case. Patch 1 allows existing sk lookup helpers in cgroup skb. Patch 2 allows skb_ancestor_cgroup_id in cgrou skb. Patch 3 introduces two new helpers to get cgroup id of socket. Patch 4 extends network helpers to use them in the next patch. Patch 5 adds selftest / example of use-case. ==================== Signed-off-by: Alexei Starovoitov commit 68e916bc8d3211ffe0b4c418184ab1b57398200c Author: Andrey Ignatov Date: Thu May 14 13:03:49 2020 -0700 selftests/bpf: Test for sk helpers in cgroup skb Test bpf_sk_lookup_tcp, bpf_sk_release, bpf_sk_cgroup_id and bpf_sk_ancestor_cgroup_id helpers from cgroup skb program. The test creates a testing cgroup, starts a TCPv6 server inside the cgroup and creates two client sockets: one inside testing cgroup and one outside. Then it attaches cgroup skb program to the cgroup that checks all TCP segments coming to the server and allows only those coming from the cgroup of the server. If a segment comes from a peer outside of the cgroup, it'll be dropped. Finally the test checks that client from inside testing cgroup can successfully connect to the server, but client outside the cgroup fails to connect by timeout. The main goal of the test is to check newly introduced bpf_sk_{,ancestor_}cgroup_id helpers. It also checks a couple of socket lookup helpers (tcp & release), but lookup helpers were introduced much earlier and covered by other tests. Here it's mostly checked that they can be called from cgroup skb. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/171f4c5d75e8ff4fe1c4e8c1c12288b5240a4549.1589486450.git.rdna@fb.com commit 383724e17ab02d8e440def7792c4e151b13ef4d4 Author: Andrey Ignatov Date: Thu May 14 13:03:48 2020 -0700 selftests/bpf: Add connect_fd_to_fd, connect_wait net helpers Add two new network helpers. connect_fd_to_fd connects an already created client socket fd to address of server fd. Sometimes it's useful to separate client socket creation and connecting this socket to a server, e.g. if client socket has to be created in a cgroup different from that of server cgroup. Additionally connect_to_fd is now implemented using connect_fd_to_fd, both helpers don't treat EINPROGRESS as an error and let caller decide how to proceed with it. connect_wait is a helper to work with non-blocking client sockets so that if connect_to_fd or connect_fd_to_fd returned -1 with errno == EINPROGRESS, caller can wait for connect to finish or for connection timeout. The helper returns -1 on error, 0 on timeout (1sec, hard-coded), and positive number on success. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/1403fab72300f379ca97ead4820ae43eac4414ef.1589486450.git.rdna@fb.com commit f307fa2cb4c935f7f1ff0aeb880c7b44fb9a642b Author: Andrey Ignatov Date: Thu May 14 13:03:47 2020 -0700 bpf: Introduce bpf_sk_{, ancestor_}cgroup_id helpers With having ability to lookup sockets in cgroup skb programs it becomes useful to access cgroup id of retrieved sockets so that policies can be implemented based on origin cgroup of such socket. For example, a container running in a cgroup can have cgroup skb ingress program that can lookup peer socket that is sending packets to a process inside the container and decide whether those packets should be allowed or denied based on cgroup id of the peer. More specifically such ingress program can implement intra-host policy "allow incoming packets only from this same container and not from any other container on same host" w/o relying on source IP addresses since quite often it can be the case that containers share same IP address on the host. Introduce two new helpers for this use-case: bpf_sk_cgroup_id() and bpf_sk_ancestor_cgroup_id(). These helpers are similar to existing bpf_skb_{,ancestor_}cgroup_id helpers with the only difference that sk is used to get cgroup id instead of skb, and share code with them. See documentation in UAPI for more details. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/f5884981249ce911f63e9b57ecd5d7d19154ff39.1589486450.git.rdna@fb.com commit 06d3e4c9f11afc849dc201ecf9ef7a43eeb1dddd Author: Andrey Ignatov Date: Thu May 14 13:03:46 2020 -0700 bpf: Allow skb_ancestor_cgroup_id helper in cgroup skb cgroup skb programs already can use bpf_skb_cgroup_id. Allow bpf_skb_ancestor_cgroup_id as well so that container policies can be implemented for a container that can have sub-cgroups dynamically created, but policies should still be implemented based on cgroup id of container itself not on an id of a sub-cgroup. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/8874194d6041eba190356453ea9f6071edf5f658.1589486450.git.rdna@fb.com commit d56c2f95adb3d401bf982b6cf8fc4bb6d2f7acdd Author: Andrey Ignatov Date: Thu May 14 13:03:45 2020 -0700 bpf: Allow sk lookup helpers in cgroup skb Currently sk lookup helpers are allowed in tc, xdp, sk skb, and cgroup sock_addr programs. But they would be useful in cgroup skb as well so that for example cgroup skb ingress program can lookup a peer socket a packet comes from on same host and make a decision whether to allow or deny this packet based on the properties of that socket, e.g. cgroup that peer socket belongs to. Allow the following sk lookup helpers in cgroup skb: * bpf_sk_lookup_tcp; * bpf_sk_lookup_udp; * bpf_sk_release; * bpf_skc_lookup_tcp. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/f8c7ee280f1582b586629436d777b6db00597d63.1589486450.git.rdna@fb.com commit 5b0004d92b4511c39db0df23aa84395722f1d706 Author: Colin Ian King Date: Thu May 14 13:15:29 2020 +0100 selftest/bpf: Fix spelling mistake "SIGALARM" -> "SIGALRM" There is a spelling mistake in an error message, fix it. Signed-off-by: Colin Ian King Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200514121529.259668-1-colin.king@canonical.com commit c70f34a8ac66c2cb05593ef5760142e5f862a9b4 Author: Andrii Nakryiko Date: Wed May 13 22:51:37 2020 -0700 bpf: Fix bpf_iter's task iterator logic task_seq_get_next might stop prematurely if get_pid_task() fails to get task_struct. Failure to do so doesn't mean that there are no more tasks with higher pids. Procfs's iteration algorithm (see next_tgid in fs/proc/base.c) does a retry in such case. After this fix, instead of stopping prematurely after about 300 tasks on my server, bpf_iter program now returns >4000, which sounds much closer to reality. Fixes: eaaacd23910f ("bpf: Add task and task/file iterator targets") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200514055137.1564581-1-andriin@fb.com commit 0645f7eb6f6af78aba2bdd37ae776bd8754bc8f0 Author: Andrey Ignatov Date: Wed May 13 18:50:28 2020 -0700 selftests/bpf: Test narrow loads for bpf_sock_addr.user_port Test 1,2,4-byte loads from bpf_sock_addr.user_port in sock_addr programs. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/e5c734a58cca4041ab30cb5471e644246f8cdb5a.1589420814.git.rdna@fb.com commit 7aebfa1b3885b5aa29fcb4a596d0485ac463bbe8 Author: Andrey Ignatov Date: Wed May 13 18:50:27 2020 -0700 bpf: Support narrow loads from bpf_sock_addr.user_port bpf_sock_addr.user_port supports only 4-byte load and it leads to ugly code in BPF programs, like: volatile __u32 user_port = ctx->user_port; __u16 port = bpf_ntohs(user_port); Since otherwise clang may optimize the load to be 2-byte and it's rejected by verifier. Add support for 1- and 2-byte loads same way as it's supported for other fields in bpf_sock_addr like user_ip4, msg_src_ip4, etc. Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/c1e983f4c17573032601d0b2b1f9d1274f24bc16.1589420814.git.rdna@fb.com commit 528443e32a3d53000d30bb8be04a382b04e57470 Author: Zhou Wang Date: Sat May 9 10:05:18 2020 +0800 arm64: defconfig: Enable UACCE/PCI PASID/SEC2/HPRE configs Enable configs for UACCE, PCI PASID, HiSilicon SEC2 and HPRE drivers. Signed-off-by: Zhou Wang Signed-off-by: Wei Xu commit 6a09815428547657f3ffd2f5c31ac2a191e7fdf3 Author: Lorenzo Bianconi Date: Tue May 12 18:30:40 2020 +0200 samples/bpf: xdp_redirect_cpu: Set MAX_CPUS according to NR_CPUS xdp_redirect_cpu is currently failing in bpf_prog_load_xattr() allocating cpu_map map if CONFIG_NR_CPUS is less than 64 since cpu_map_alloc() requires max_entries to be less than NR_CPUS. Set cpu_map max_entries according to NR_CPUS in xdp_redirect_cpu_kern.c and get currently running cpus in xdp_redirect_cpu_user.c Signed-off-by: Lorenzo Bianconi Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/374472755001c260158c4e4b22f193bdd3c56fb7.1589300442.git.lorenzo@kernel.org commit 9b65d2ffe853e4cf81585eaf60ce00237b277dc0 Author: Heiner Kallweit Date: Thu May 14 23:44:07 2020 +0200 r8169: don't include linux/moduleparam.h 93882c6f210a ("r8169: switch from netif_xxx message functions to netdev_xxx") removed the last module parameter from the driver, therefore there's no need any longer to include linux/moduleparam.h. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit aa443b3f8f3affdc2ea6508ecb20706eee3f67bf Author: Heiner Kallweit Date: Thu May 14 23:39:34 2020 +0200 r8169: remove not needed checks in rtl8169_set_eee After 9de5d235b60a ("net: phy: fix aneg restart in phy_ethtool_set_eee") we don't need the check for aneg being enabled any longer, and as discussed with Russell configuring the EEE advertisement should be supported even if we're in a half-duplex mode currently. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f48b285ae658b50f4ba2d3a267522f572720de6d Author: Stanley Chu Date: Sat May 9 17:37:16 2020 +0800 scsi: ufs-mediatek: Customize WriteBooster flush policy Change the WriteBooster policy to keep VCC on during runtime suspend if available WriteBooster buffer is less than 80%. Link: https://lore.kernel.org/r/20200509093716.21010-5-stanley.chu@mediatek.com Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit d14734ae3ae79d3b0286a2431782054e5066da8f Author: Stanley Chu Date: Sat May 9 17:37:15 2020 +0800 scsi: ufs: Customize flush threshold for WriteBooster Allow flush threshold for WriteBooster to be customizable by vendors. To achieve this, make the value a variable in struct ufs_hba_variant_params. Also introduce UFS_WB_BUF_REMAIN_PERCENT() macro to provide a more flexible way to specify WriteBooster available buffer values. Link: https://lore.kernel.org/r/20200509093716.21010-4-stanley.chu@mediatek.com Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 90b8491c0033915ec1b290bc1c0de27935cb132d Author: Stanley Chu Date: Sat May 9 17:37:13 2020 +0800 scsi: ufs: Introduce ufs_hba_variant_params to group customizable parameters The UFS driver is growing more and more customizable parameters. Collect them in one place. Link: https://lore.kernel.org/r/20200509093716.21010-2-stanley.chu@mediatek.com Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit b014d0430bcfae581d07d2e90a939b0af783d3a9 Author: Colin Ian King Date: Thu May 14 19:33:02 2020 +0100 net: dsa: felix: fix incorrect clamp calculation for burst Currently burst is clamping on rate and not burst, the assignment of burst from the clamping discards the previous assignment of burst. This looks like a cut-n-paste error from the previous clamping calculation on ramp. Fix this by replacing ramp with burst. Addresses-Coverity: ("Unused value") Fixes: 0fbabf875d18 ("net: dsa: felix: add support Credit Based Shaper(CBS) for hardware offload") Signed-off-by: Colin Ian King Acked-by: Vladimir Oltean Signed-off-by: David S. Miller commit 140ad6c8c6c7a89546cdcbc46da6cd56011cfee1 Author: Bartosz Golaszewski Date: Thu May 14 18:59:38 2020 +0200 net: phy: mdio-moxart: remove unneeded include mdio-moxart doesn't use regulators in the driver code. We can remove the regulator include. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 74ac28f16486aca295ae27aafc8d7e088464b772 Author: Dan Murphy Date: Thu May 14 10:59:05 2020 -0500 dt-bindings: dp83867: Convert DP83867 to yaml Convert the dp83867 binding to yaml. Signed-off-by: Dan Murphy Signed-off-by: David S. Miller commit e90b651e7b7f07a7c2b1ec74bfa18dc41ff126bc Author: Dan Murphy Date: Thu May 14 09:50:12 2020 -0500 dt-bindings: net: dp83869: Update licensing info Add BSD 2 Clause to the licensing. CC: Rob Herring Signed-off-by: Dan Murphy Signed-off-by: David S. Miller commit 0bd735df7681e41647a69b1fad0eb5594c60a727 Author: Damien Le Moal Date: Thu May 14 17:19:53 2020 +0900 scsi: sd: Signal drive managed SMR disks Print a message indicating that a disk is a drive-managed SMR model when such drive is found using the ZONED field of the Block Device Characteristics VPD page (IDENTIFY data on ATA side). [mkp: typo] Link: https://lore.kernel.org/r/20200514081953.1252087-1-damien.lemoal@wdc.com Reviewed-by: Johannes Thumshirn Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 21d2b76831fdee3754eeee995e15080098603ec5 Author: ChenTao Date: Thu May 14 09:26:55 2020 +0800 scsi: ufs-mediatek: Make ufs_mtk_fixup_dev_quirks static Fix the following warning: drivers/scsi/ufs/ufs-mediatek.c:585:6: warning: symbol 'ufs_mtk_fixup_dev_quirks' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200514012655.127202-1-chentao107@huawei.com Reported-by: Hulk Robot Reviewed-by: Stanley Chu Signed-off-by: ChenTao Signed-off-by: Martin K. Petersen commit 3f044d26f80b0c2ee53f8409cdbb2aca28fa90b1 Author: Luo bin Date: Wed May 13 22:50:49 2020 +0000 hinic: update huawei ethernet driver maintainer update huawei ethernet driver maintainer from aviad to Bin luo Signed-off-by: Luo bin Signed-off-by: David S. Miller commit bcab67822d77142c31f69656dd24226f23acc82e Author: Luo bin Date: Wed May 13 22:37:33 2020 +0000 hinic: add set_ringparam ethtool_ops support support to change TX/RX queue depth with ethtool -G Signed-off-by: Luo bin Signed-off-by: David S. Miller commit 5a46b062e28f57bffde767437fad3ab1d0cee2c7 Author: Jakub Kicinski Date: Wed May 13 10:28:22 2020 -0700 devlink: refactor end checks in devlink_nl_cmd_region_read_dumpit Clean up after recent fixes, move address calculations around and change the variable init, so that we can have just one start_offset == end_offset check. Make the check a little stricter to preserve the -EINVAL error if requested start offset is larger than the region itself. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c7ad365761857ddc91c891ef7557d90f2510353e Merge: 86b6ba171d4b 8127224c2708 Author: David S. Miller Date: Thu May 14 17:33:30 2020 -0700 Merge branch 'am65-cpsw-add-taprio-EST-offload-support' Murali Karicheri says: ==================== am65-cpsw: add taprio/EST offload support AM65 CPSW h/w supports Enhanced Scheduled Traffic (EST – defined in P802.1Qbv/D2.2 that later got included in IEEE 802.1Q-2018) configuration. EST allows express queue traffic to be scheduled (placed) on the wire at specific repeatable time intervals. In Linux kernel, EST configuration is done through tc command and the taprio scheduler in the net core implements a software only scheduler (SCH_TAPRIO). If the NIC is capable of EST configuration, user indicate "flag 2" in the command which is then parsed by taprio scheduler in net core and indicate that the command is to be offloaded to h/w. taprio then offloads the command to the driver by calling ndo_setup_tc() ndo ops. This patch implements ndo_setup_tc() as well as other changes required to offload EST configuration to CPSW h/w For more details please refer patch 2/2. This series is based on original work done by Ivan Khoronzhuk to add taprio offload support to AM65 CPSW 2G. 1. Example configuration 3 Gates ifconfig eth0 down ethtool -L eth0 tx 3 ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off ifconfig eth0 192.168.2.20 tc qdisc replace dev eth0 parent root handle 100 taprio \ num_tc 3 \ map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 1@1 1@2 \ base-time 0000 \ sched-entry S 4 125000 \ sched-entry S 2 125000 \ sched-entry S 1 250000 \ flags 2 2. Example configuration 8 Gates ifconfig eth0 down ethtool -L eth0 tx 8 ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off ifconfig eth0 192.168.2.20 tc qdisc replace dev eth0 parent root handle 100 taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ base-time 0000 \ sched-entry S 80 125000 \ sched-entry S 40 125000 \ sched-entry S 20 125000 \ sched-entry S 10 125000 \ sched-entry S 08 125000 \ sched-entry S 04 125000 \ sched-entry S 02 125000 \ sched-entry S 01 125000 \ flags 2 Classify frames to particular priority using skbedit so that they land at a specific queue in cpsw h/w which is Gated by the EST gate which opens based on the sched-entry. tc qdisc add dev eth0 clsact In the below for example an iperf3 session with destination port 5007 will go through Q7. tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5007 0xffff action skbedit priority 7 tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5006 0xffff action skbedit priority 6 tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5005 0xffff action skbedit priority 5 tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5004 0xffff action skbedit priority 4 tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5003 0xffff action skbedit priority 3 tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5002 0xffff action skbedit priority 2 tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5001 0xffff action skbedit priority 1 iperf3 -c 192.168.2.10 -u -l1470 -b32M -t1 -p 5007 Testing was done by capturing frames at the PC using wireshark and checking for the bust interval or cycle time of UDP frames with a specific port number. Verified that the distance between first frame of a burst (cycle-time) is 1 milli second and burst duration is within 125 usec based on the received packet timestamp shown in wireshark packet display. ==================== Signed-off-by: David S. Miller commit 8127224c2708aa1558e2be7bbd1b7e9b07860de6 Author: Ivan Khoronzhuk Date: Wed May 13 09:26:15 2020 -0400 ethernet: ti: am65-cpsw-qos: add TAPRIO offload support AM65 CPSW h/w supports Enhanced Scheduled Traffic (EST – defined in P802.1Qbv/D2.2 that later got included in IEEE 802.1Q-2018) configuration. EST allows express queue traffic to be scheduled (placed) on the wire at specific repeatable time intervals. In Linux kernel, EST configuration is done through tc command and the taprio scheduler in the net core implements a software only scheduler (SCH_TAPRIO). If the NIC is capable of EST configuration, user indicate "flag 2" in the command which is then parsed by taprio scheduler in net core and indicate that the command is to be offloaded to h/w. taprio then offloads the command to the driver by calling ndo_setup_tc() ndo ops. This patch implements ndo_setup_tc() to offload EST configuration to CPSW h/w. Currently driver supports only SetGateStates operation. EST operates on a repeating time interval generated by the CPTS EST function generator. Each Ethernet port has a global EST fetch RAM that can be configured as 2 buffers, each of 64 locations or one large buffer of 128 locations. In 2 buffer configuration, a ping pong mechanism is used to hold the active schedule (oper) in one buffer and new (admin) command in the other. Each 22-bit fetch command consists of a 14-bit fetch count (14 MSB’s) and an 8-bit priority fetch allow (8 LSB’s) that will be applied for the fetch count time in wireside clocks. Driver process each of the sched-entry in the offload command and update the fetch RAM. Driver configures duration in sched-entry into the fetch count and Gate mask into the priority fetch bits of the RAM. Then configures the CPTS EST function generator to activate the schedule. Currently driver supports only 2 buffer configuration which means driver supports a max cycle time of ~8 msec. CPSW supports a configurable number of priority queues (up to 8) and needs to be switched to this mode from the default round robin mode before EST can be offloaded. User configures these through ethtool commands (-L for changing number of queues and --set-priv-flags to disable round robin mode). Driver doesn't enable EST if pf_p0_rx_ptype_rrobin privat flag is set. The flag is common for all ports, and so can't be just overridden by taprio configuration w/o user involvement. Command fails if pf_p0_rx_ptype_rrobin is already set in the driver. Scheds (commands) configuration depends on interface speed so driver translates the duration to the fetch count based on link speed. Each schedule can be constructed with several command entries in fetch RAM depending on interval. For example if each sched has timer interval < ~130us on 1000 Mb link then each sched consumes one command and have 1:1 mapping. When Ethernet link goes down, driver purge the configuration if link is down for more than 1 second. The patch allows to update the timer and scheds memory only if it's really needed, and skip cases required the user to stop timer by configuring only shceds memory. Signed-off-by: Ivan Khoronzhuk Signed-off-by: Murali Karicheri Signed-off-by: David S. Miller commit ec008fa2a9e5686081053750893de5f407a8d076 Author: Ivan Khoronzhuk Date: Wed May 13 09:26:14 2020 -0400 ethernet: ti: am65-cpts: add routines to support taprio offload TAPRIO/EST offload support in CPSW2G requires EST scheduler function enabled in CPTS. So this patch add a function to set cycle time for EST scheduler. It also add a function for getting time in ns of PHC clock for taprio qdisc configuration. Mostly to verify if timer update is needed or to get actual state of oper/admin schedule. Signed-off-by: Ivan Khoronzhuk Signed-off-by: Murali Karicheri Signed-off-by: David S. Miller commit 25c21d20bcfdb97ba869007b284a5dbf5328ffe2 Author: Dan Carpenter Date: Wed May 13 12:37:03 2020 +0300 scsi: aacraid: Fix an oops in error handling If the memdup_user() function fails then it results in an Oops in the error handling code when we try to kfree() and error pointer. Link: https://lore.kernel.org/r/20200513093703.GB347693@mwanda Fixes: 8d925b1f00e6 ("scsi: aacraid: Use memdup_user() as a cleanup") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 3f65d51e9e225614658c5f9a4e3f10747e128190 Author: Bjorn Andersson Date: Fri Apr 17 00:00:44 2020 -0700 arm64: dts: qcom: msm8996: Make GPU node control GPU_GX GDSC Presumably the GPU node needs to control both the GPU and GPU GX power domains, but given that GPU GX now depends on the GPU GDSC both can effectively be controlled by controlling GPU GX. So use this instead. Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200417070044.1376212-5-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 2317b87a2a6fb9e1fff3144b72330ba551856721 Author: Rajendra Nayak Date: Fri Apr 17 00:00:43 2020 -0700 arm64: dts: qcom: db820c: Add vdd_gfx and tie it into mmcc Add the SPMI regulator node in the PMI8994, use it to give us VDD_GX at a fixed max nominal voltage for the db820c and specify this as supply for the MMSS GPU_GX GDSC. With the introduction of CPR support the range for VDD_GX should be expanded. Reviewed-by: Vinod Koul Signed-off-by: Rajendra Nayak Link: https://lore.kernel.org/r/20200417070044.1376212-4-bjorn.andersson@linaro.org [bjorn: Split between pmi8994 and db820c, changed voltage, rewrote commit message] Signed-off-by: Bjorn Andersson commit aa0ce96d72dd2e1b0dfd0fb868f82876e7790878 Author: Ashok Raj Date: Fri Mar 27 14:16:15 2020 -0700 PCI: Program MPS for RCiEP devices Root Complex Integrated Endpoints (RCiEPs) do not have an upstream bridge, so pci_configure_mps() previously ignored them, which may result in reduced performance. Instead, program the Max_Payload_Size of RCiEPs to the maximum supported value (unless it is limited for the PCIE_BUS_PEER2PEER case). This also affects the subsequent programming of Max_Read_Request_Size because Linux programs MRRS based on the MPS value. Fixes: 9dae3a97297f ("PCI: Move MPS configuration check to pci_configure_device()") Link: https://lore.kernel.org/r/1585343775-4019-1-git-send-email-ashok.raj@intel.com Tested-by: Dave Jiang Signed-off-by: Ashok Raj Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 0f158b4cf20e7983d5b33878a6aad118cfac4f05 Author: Jens Axboe Date: Thu May 14 17:18:39 2020 -0600 io_uring: name sq thread and ref completions We used to have three completions, now we just have two. With the two, let's not allocate them dynamically, just embed then in the ctx and name them appropriately. Signed-off-by: Jens Axboe commit b7f0656a25467fc26eb7fc375caf38ee99f5d004 Author: John Clements Date: Thu May 14 11:21:01 2020 +0800 drm/amdgpu: Updated XGMI power down control support check Updated SMC FW version check to determine if XGMI power down control is supported Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 5c23e9e05e42b5ea56a87a17f1da9ccf9b100465 Author: John Clements Date: Wed May 13 20:23:51 2020 +0800 drm/amdgpu: Update RAS XGMI error inject sequence Disable XGMI link power down prior to issuing a XGMI RAS error Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 5e7067b24fcf1549c72988dd92de6d17ff3d2077 Author: John Clements Date: Wed May 13 17:45:57 2020 +0800 drm/amdgpu: Add DPM function for XGMI link power down control Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit e3cad841d3d659785146c090813337bb4d4e528b Author: Jiri Kosina Date: Thu May 14 23:42:23 2020 +0200 livepatch: add arch-specific headers to MAINTAINERS Add arch-specific livepatch.h for s390 and powerpc to MAINTAINERS F: patterns. Reported-by: Kamalesh Babulal Signed-off-by: Jiri Kosina commit ab9c21124d6e03460c9c59006a61cc076fefa82e Author: John Clements Date: Wed May 13 17:45:06 2020 +0800 drm/amdgpu: Add cmd to control XGMI link sleep Added host to SMU FW cmd to enable/disable XGMI link power down Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 9885440b16b8fc1dd7275800fd28f56a92f60896 Author: Rob Herring Date: Wed May 13 17:38:59 2020 -0500 PCI: Fix pci_host_bridge struct device release/free handling The PCI code has several paths where the struct pci_host_bridge is freed directly. This is wrong because it contains a struct device which is refcounted and should be freed using put_device(). This can result in use-after-free errors. I think this problem has existed since 2012 with commit 7b5436635800 ("PCI: add generic device into pci_host_bridge struct"). It generally hasn't mattered as most host bridge drivers are still built-in and can't unbind. The problem is a struct device should never be freed directly once device_initialize() is called and a ref is held, but that doesn't happen until pci_register_host_bridge(). There's then a window between allocating the host bridge and pci_register_host_bridge() where kfree should be used. This is fragile and requires callers to do the right thing. To fix this, we need to split device_register() into device_initialize() and device_add() calls, so that the host bridge struct is always freed by using a put_device(). devm_pci_alloc_host_bridge() is using devm_kzalloc() to allocate struct pci_host_bridge which will be freed directly. Instead, we can use a custom devres action to call put_device(). Link: https://lore.kernel.org/r/20200513223859.11295-2-robh@kernel.org Reported-by: Anders Roxell Tested-by: Anders Roxell Signed-off-by: Rob Herring Signed-off-by: Bjorn Helgaas Reviewed-by: Lorenzo Pieralisi Acked-by: Arnd Bergmann commit 1b54ae8327a4d630111c8d88ba7906483ec6010b Author: Rob Herring Date: Wed May 13 17:38:58 2020 -0500 PCI: Fix pci_register_host_bridge() device_register() error handling If device_register() has an error, we should bail out of pci_register_host_bridge() rather than continuing on. Fixes: 37d6a0a6f470 ("PCI: Add pci_register_host_bridge() interface") Link: https://lore.kernel.org/r/20200513223859.11295-1-robh@kernel.org Signed-off-by: Rob Herring Signed-off-by: Bjorn Helgaas Reviewed-by: Lorenzo Pieralisi Reviewed-by: Arnd Bergmann commit 6ae72bfa656ea04806f98ef85cb44b0789064362 Author: Yicong Yang Date: Sat May 9 18:19:28 2020 +0800 PCI: Unify pcie_find_root_port() and pci_find_pcie_root_port() Previously we used pcie_find_root_port() to find a Root Port from a PCIe device and pci_find_pcie_root_port() to find a Root Port from a Conventional PCI device. Unify the two functions and use pcie_find_root_port() to find a Root Port from either a Conventional PCI device or a PCIe device. Then there is no need to distinguish the type of the device. Link: https://lore.kernel.org/r/1589019568-5216-1-git-send-email-yangyicong@hisilicon.com Signed-off-by: Yicong Yang Signed-off-by: Bjorn Helgaas Acked-by: Kalle Valo # wireless Acked-by: Mika Westerberg # thunderbolt commit 4c71d6abc4fc0e1171ac078687a98cca1537bbaa Author: Bryan O'Donoghue Date: Tue May 12 12:50:22 2020 +0100 clk: qcom: Add DT bindings for MSM8939 GCC Add compatible strings and the include files for the MSM8939 GCC. Cc: Andy Gross Cc: Bjorn Andersson Cc: Michael Turquette Cc: Stephen Boyd Cc: Rob Herring Cc: linux-arm-msm@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Vincent Knecht Signed-off-by: Bryan O'Donoghue Link: https://lkml.kernel.org/r/20200512115023.2856617-2-bryan.odonoghue@linaro.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 37c72e4cae37f0dace1abb3711ede7fbc6d0862a Author: Vinod Koul Date: Wed May 13 12:24:20 2020 +0530 clk: qcom: gcc: Add missing UFS clocks for SM8150 Add the missing ufs card and ufs phy clocks for SM8150. They were missed in earlier addition of clock driver. Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150") Signed-off-by: Vinod Koul Link: https://lkml.kernel.org/r/20200513065420.32735-2-vkoul@kernel.org Signed-off-by: Stephen Boyd commit f73a4230d5bbc8fc7e1a2479ac997f786111c7bb Author: Vinod Koul Date: Wed May 13 12:24:19 2020 +0530 clk: qcom: gcc: Add GPU and NPU clocks for SM8150 Add the GPU and NPU clocks for SM8150. They were missed in earlier addition of clock driver. Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150") Signed-off-by: Vinod Koul Link: https://lkml.kernel.org/r/20200513065420.32735-1-vkoul@kernel.org Signed-off-by: Stephen Boyd commit 90a3691e0bd907daae23bb22850d4f4f4bfefa50 Author: Bjorn Andersson Date: Fri Apr 17 00:00:42 2020 -0700 clk: qcom: mmcc-msm8996: Properly describe GPU_GX gdsc The GPU_GX GDSC depends on both GPU GDSC being enabled and that the VDD_GX rail is powered, so update the description of the node to cover these requirements. Signed-off-by: Bjorn Andersson Link: https://lkml.kernel.org/r/20200417070044.1376212-3-bjorn.andersson@linaro.org Acked-by: Rob Herring Reviewed-by: Vinod Koul Signed-off-by: Stephen Boyd commit 37416e554961b34451f3a160acd1e27656103e9f Author: Bjorn Andersson Date: Fri Apr 17 00:00:41 2020 -0700 clk: qcom: gdsc: Handle GDSC regulator supplies Certain GDSCs, such as the GPU_GX on MSM8996, requires that the upstream regulator supply is powered in order to be turned on. It's not guaranteed that the bootloader will leave these supplies on and the driver core will attempt to enable any GDSCs before allowing the individual drivers to probe defer on the PMIC regulator driver not yet being present. So the gdsc driver needs to be made aware of supplying regulators and probe defer on their absence, and it needs to enable and disable the regulator accordingly. Voltage adjustments of the supplying regulator are deferred to the client drivers themselves. Signed-off-by: Bjorn Andersson Link: https://lkml.kernel.org/r/20200417070044.1376212-2-bjorn.andersson@linaro.org Reviewed-by: Vinod Koul Signed-off-by: Stephen Boyd commit 29c1ec244ca1c2acfe6a8918967d678e104705c2 Author: Colin Ian King Date: Tue May 12 13:48:06 2020 +0100 drm/amdgpu: remove redundant assignment to variable ret The variable ret is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 72d99b395f6c1b924f91e7964de231fb78e47c93 Author: Yintian Tao Date: Tue May 12 18:10:42 2020 +0800 drm/amdgpu: turn back rlcg write for gfx_v10 There is no need to use amdgpu_mm_wreg_mmio_rlc() during initialization time because this interface is only designed for debugfs case to access the registers which are only permitted by RLCG during run-time. Therefore, turn back rlcg write for gfx_v10. If we not turn back it, it will raise amdgpu load failure. [ 54.904333] amdgpu: SMU driver if version not matched [ 54.904393] amdgpu: SMU is initialized successfully! [ 54.905971] [drm] kiq ring mec 2 pipe 1 q 0 [ 55.115416] amdgpu 0000:00:06.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring gfx_0.0.0 test failed (-110) [ 55.118877] [drm:amdgpu_device_init [amdgpu]] *ERROR* hw_init of IP block failed -110 [ 55.126587] amdgpu 0000:00:06.0: amdgpu_device_ip_init failed [ 55.133466] amdgpu 0000:00:06.0: Fatal error during GPU init Signed-off-by: Yintian Tao Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit cd598d6cfd217f18e53f6c26b2397692666eb3a4 Author: Evan Quan Date: Fri May 8 17:55:42 2020 +0800 drm/amd/powerplay: report correct AC/DC event based on ctxid V2 'ctxid' is used to distinguish different events raised from SMC. 0x3 and 0x4 are for AC and DC power mode. V2: update the way to retrieve the ctxid and change the log level to debug Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e528ccf9320c3634395e39d467bb6daed3bec4e8 Author: Evan Quan Date: Sat May 9 13:49:26 2020 +0800 drm/amd/powerplay: shutdown on HW CTF To prevent further damage. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9495220577416632675959caf122e968469ffd16 Author: Evan Quan Date: Sat May 9 13:26:00 2020 +0800 drm/amd/powerplay: try to do a graceful shutdown on SW CTF Normally this(SW CTF) should not happen. And by doing graceful shutdown we can prevent further damage. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 73339a71547c07f7c28d0b48ad06591f8c4433d8 Author: Andrey Grodzovsky Date: Tue Mar 24 16:39:37 2020 -0400 drm/amdgpu: Add AQUIRE_MEM PACKET3 fields defintion Add this for gfx10 and gfx9. v2: Fix identation Signed-off-by: Andrey Grodzovsky Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 07fbf0e58deb77a3463103c60853afff87d23d9b Merge: 8f3d9f354286 a29ae8600d50 Author: Stephen Boyd Date: Thu May 14 13:37:51 2020 -0700 Merge tag 'clk-meson-v5.8-1' of https://github.com/BayLibre/clk-meson into clk-amlogic Pull Amlogic clk driver updates from Jerome Brunet: - Meson8b: Updates and fixup HDMI and video clocks - Meson8b: Fixup reset polarity - Meson gx and g12: fix GPU glitch free mux switch * tag 'clk-meson-v5.8-1' of https://github.com/BayLibre/clk-meson: clk: meson: meson8b: Don't rely on u-boot to init all GP_PLL registers clk: meson: meson8b: Make the CCF use the glitch-free VPU mux clk: meson: meson8b: Fix the vclk_div{1, 2, 4, 6, 12}_en gate bits clk: meson: meson8b: Fix the polarity of the RESET_N lines clk: meson: meson8b: Fix the first parent of vid_pll_in_sel clk: meson: g12a: Prepare the GPU clock tree to change at runtime clk: meson: gxbb: Prepare the GPU clock tree to change at runtime clk: meson: meson8b: make the hdmi_sys clock tree mutable clk: meson8b: export the HDMI system clock commit 86b6ba171d4bcce72ffbdc33b42b0b4c0e6d99d0 Merge: c8a867a38fc8 8f76812e1cc4 Author: David S. Miller Date: Thu May 14 13:25:47 2020 -0700 Merge branch 'net-qed-qede-critical-hw-error-handling' Igor Russkikh says: ==================== net: qed/qede: critical hw error handling FastLinQ devices as a complex systems may observe various hardware level error conditions, both severe and recoverable. Driver is able to detect and report this, but so far it only did trace/dmesg based reporting. Here we implement an extended hw error detection, service task handler captures a dump for the later analysis. I also resubmit a patch from Denis Bolotin on tx timeout handler, addressing David's comment regarding recovery procedure as an extra reaction on this event. v2: Removing the patch with ethtool dump and udev magic. Its quite isolated, I'm working on devlink based logic for this separately. v1: https://patchwork.ozlabs.org/project/netdev/cover/cover.1588758463.git.irusskikh@marvell.com/ ==================== Signed-off-by: David S. Miller commit 8f76812e1cc4d561c3efc3b2586c686b5428d31f Author: Igor Russkikh Date: Thu May 14 12:57:27 2020 +0300 net: qed: fix bad formatting On some adjacent code, fix bad code formatting Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit ebf64bf4df6331fc612927aae904c310947a02f8 Author: Igor Russkikh Date: Thu May 14 12:57:26 2020 +0300 net: qed: introduce critical hardware error handler MCP may signal driver about generic critical failure. Driver has to collect mdump information (get_retain), it pushes that to logs and triggers generic notification on "hardware attention" event. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 3e99c2111026244326deee5fcaf8ea744627214b Author: Igor Russkikh Date: Thu May 14 12:57:25 2020 +0300 net: qed: introduce critical fan failure handler Fan failure is sent by firmware, driver reacts on this error with newly introduced notification path. It will collect dump and shut down the device to prevent physical breakage Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 5144e9f439d53460c38eb5c34dd67837ac512db1 Author: Denis Bolotin Date: Thu May 14 12:57:24 2020 +0300 net: qede: Implement ndo_tx_timeout Upon tx timeout detection we do disable carrier and print TX queue info on TX timeout. We then raise hw error condition and trigger service task to handle this. This handler will capture extra debug info and then optionally trigger recovery procedure to try restore function. Signed-off-by: Denis Bolotin Signed-off-by: Ariel Elior Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 7d9acd87bd55f401ada67b9c6a9c83a7e68c4ddf Author: Igor Russkikh Date: Thu May 14 12:57:23 2020 +0300 net: qede: optional hw recovery procedure Driver has an ability to initiate a recovery process as a reaction to detected errors. But the codepath (recovery_process) was disabled and never active. Here we add ethtool private flag to allow user have the recovery procedure activated. We still do not enable this by default though, since in some configurations this is not desirable. E.g. this may impact other PFs/VFs. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 936c7ba4dd5e94a3fc784f2296de5d577a9b5e43 Author: Igor Russkikh Date: Thu May 14 12:57:22 2020 +0300 net: qed: attention clearing properties On different hardware events we have to respond differently, on some of hardware indications hw attention (error condition) should be cleared by the driver to continue normal functioning. Here we introduce attention clear flags, and put them on some important events (in aeu_descs). Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit ca352f00756e7bd7d31a353a8586a29429810a95 Author: Igor Russkikh Date: Thu May 14 12:57:21 2020 +0300 net: qed: cleanup debug related declarations Thats probably a legacy code had double declaration of some fields. Cleanup this, removing copy and fixing references. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit d8d6c5a7be97304f4baa67a31d6bfa86ff457980 Author: Igor Russkikh Date: Thu May 14 12:57:20 2020 +0300 net: qed: critical err reporting to management firmware On various critical errors, notification handler should also report the err information into the management firmware. MFW can interact with server/motherboard backend agents - these are used by server manufacturers to monitor server HW health. Thus, it is important for driver to report on any faulty conditions Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 2ec276d5b224d0d409ad3ad790b68f6d13822250 Author: Igor Russkikh Date: Thu May 14 12:57:19 2020 +0300 net: qed: invoke err notify on critical areas In a number of critical places not only debug trace should be printed, but the appropriate hw error condition should be raised and error handling/recovery should start. Introduce our new qed_hw_err_notify invocation in these places to record and indicate critical error conditions in hardware. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit a8736ea83b80526529e21db29595e5337bfa95c2 Author: Igor Russkikh Date: Thu May 14 12:57:18 2020 +0300 net: qede: add hw err scheduled handler qede (ethernet level driver) registers a callback handler. This handler maintains eth dev state flags/bits to track error processing. It implements in place processing part for nonsleeping context (WARN_ON trigger), and a deferred (delayed work) part which triggers recovery process for recoverable errors. In later patches this atomic handler will come with more meat. We introduce err_flags on ethdevice structure, its being used to record error handling properties. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit d639836ab3363f935a9a4336cb4ea3828d0437dd Author: Igor Russkikh Date: Thu May 14 12:57:17 2020 +0300 net: qed: adding hw_err states and handling Here we introduce qed device error tracking flags and error types. qed_hw_err_notify is an entrace point to report errors. It'll notify higher level drivers (qede/qedr/etc) to handle and recover the error. List of posible errors comes from hardware interfaces, but could be extended in future. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit c8a867a38fc8d88a096ebf8813d02bbf50f7335e Merge: acb6d3771a03 5c6cfd309faa Author: David S. Miller Date: Thu May 14 13:18:10 2020 -0700 Merge branch 'net-hns3-add-some-cleanups-for-next' Huazhong Tan says: ==================== net: hns3: add some cleanups for -next This patchset adds some cleanups for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 5c6cfd309faa7a1958c14b937ba9b95abb1427de Author: Huazhong Tan Date: Thu May 14 20:41:26 2020 +0800 net: hns3: remove unnecessary frag list checking in hns3_nic_net_xmit() The skb_has_frag_list() in hns3_nic_net_xmit() is redundant, since skb_walk_frags() includes this checking implicitly. Reported-by: Yunsheng Lin Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit bd13f7e12936b83a363ffada725bdf0fe229f337 Author: Huazhong Tan Date: Thu May 14 20:41:25 2020 +0800 net: hns3: remove some unused macros There are some macros defined in hns3_enet.h, but not used in anywhere. Reported-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit cb25a6072b517b34d88f05ae29971c595d77df6e Author: Huazhong Tan Date: Thu May 14 20:41:24 2020 +0800 net: hns3: modify an incorrect error log in hclge_mbx_handler() When handling HCLGE_MBX_GET_LINK_STATUS, PF will return the link status to the VF, so the error log of hclge_get_link_info() is incorrect. Reported-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 727f514bd677420d4253ad84509710040e808899 Author: Huazhong Tan Date: Thu May 14 20:41:23 2020 +0800 net: hns3: remove a duplicated printing in hclge_configure() Since hclge_get_cfg() already has error print, so hclge_configure() should not print error when calling hclge_get_cfg() fail. Reported-by: Guangbin Huang Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 96b8e87838a1acfcb1a168537a44f727dda7f53f Author: Huazhong Tan Date: Thu May 14 20:41:22 2020 +0800 net: hns3: modify some incorrect spelling This patch modifies some incorrect spelling. Reported-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit acb6d3771a0390fdfae18082f232fda40d5ab514 Author: Thierry Reding Date: Thu May 14 14:38:48 2020 +0200 r8152: Use MAC address from device tree if available If a MAC address was passed via the device tree node for the r8152 device, use it and fall back to reading from EEPROM otherwise. This is useful for devices where the r8152 EEPROM was not programmed with a valid MAC address, or if users want to explicitly set a MAC address in the bootloader and pass that to the kernel. Signed-off-by: Thierry Reding Signed-off-by: David S. Miller commit 4f74251df0ceb3b9fbddf8b5c6aef31c0092b617 Author: Tero Kristo Date: Thu Apr 30 11:36:40 2020 +0300 clk: ti: dra7xx: fix RNG clock parent RNG is sourced from L4 clock. Add info for this for proper parenting of the clock. Signed-off-by: Tero Kristo Link: https://lkml.kernel.org/r/20200430083640.8621-4-t-kristo@ti.com Signed-off-by: Stephen Boyd commit c752424b55c944cfd9aaa580045227df57764c28 Author: Tero Kristo Date: Thu Apr 30 11:36:39 2020 +0300 clk: ti: dra7xx: mark MCAN clock as DRA76x only This clock entry does not exist on any other devices except DRA76, so mark it as specific to that SoC only. Signed-off-by: Tero Kristo Link: https://lkml.kernel.org/r/20200430083640.8621-3-t-kristo@ti.com Signed-off-by: Stephen Boyd commit f45c8a501d1abbb74e9fac23c3fdd6c9ab3673d9 Author: Tero Kristo Date: Thu Apr 30 11:36:38 2020 +0300 clk: ti: dra7xx: fix gpu clkctrl parent gpu_cm:* parent clock name is wrong, replace this with correct gpu-clkctrl:* clock. Otherwise the clock ends up in the orphaned list. Signed-off-by: Tero Kristo Link: https://lkml.kernel.org/r/20200430083640.8621-2-t-kristo@ti.com Signed-off-by: Stephen Boyd commit f968045fb92e5408c25f1b4eae21bab4882e88e8 Author: Tero Kristo Date: Wed Apr 29 16:13:41 2020 +0300 clk: ti: omap5: Add proper parent clocks for l4-secure clocks L4 secure clocks do not have their parents set currently, which ends them up to the orphan clock list. Fix this by adding either l3 or l4 clock as their parent. Signed-off-by: Tero Kristo Link: https://lkml.kernel.org/r/20200429131341.4697-4-t-kristo@ti.com Acked-by: Tony Lindgren Signed-off-by: Stephen Boyd commit 74c0ac108d42bf24d37aaea68b6d39ba52d5f0e2 Author: Tero Kristo Date: Wed Apr 29 16:13:40 2020 +0300 clk: ti: omap4: Add proper parent clocks for l4-secure clocks L4 secure clocks do not have their parents set currently, which ends them up to the orphan clock list. Fix this by adding either l3 or l4 clock as their parent. Signed-off-by: Tero Kristo Link: https://lkml.kernel.org/r/20200429131341.4697-3-t-kristo@ti.com Acked-by: Tony Lindgren Signed-off-by: Stephen Boyd commit c7c1cbbc9217ebb5601b88d138d4a5358548de9d Author: Tero Kristo Date: Wed Apr 29 16:13:39 2020 +0300 clk: ti: composite: fix memory leak The parent_names is never released for a component clock definition, causing some memory leak. Fix by releasing it once it is no longer needed. Reported-by: Tomi Valkeinen Signed-off-by: Tero Kristo Link: https://lkml.kernel.org/r/20200429131341.4697-2-t-kristo@ti.com Acked-by: Tony Lindgren Signed-off-by: Stephen Boyd commit 0531b0357ba37464e5c0033e1b7c69bbf5ecd8fb Author: Vlad Buslov Date: Thu May 14 09:35:52 2020 +0300 selftests: fix flower parent qdisc Flower tests used to create ingress filter with specified parent qdisc "parent ffff:" but dump them on "ingress". With recent commit that fixed tcm_parent handling in dump those are not considered same parent anymore, which causes iproute2 tc to emit additional "parent ffff:" in first line of filter dump output. The change in output causes filter match in tests to fail. Prevent parent qdisc output when dumping filters in flower tests by always correctly specifying "ingress" parent both when creating and dumping filters. Fixes: a7df4870d79b ("net_sched: fix tcm_parent in tc filter dump") Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 25f9f5a2107fdc6510463be4e55012d17d83ab2b Author: Bjorn Andersson Date: Thu May 14 11:58:56 2020 -0700 remoteproc: wcss: Fix arguments passed to qcom_add_glink_subdev() Recently qcom_add_glink_subdev() was extended to also take the glink_ssr identifier as an argument and I missed this while applying '8a226e2c71bb ("remoteproc: wcss: add support for rpmsg communication")'. Fixes: 8a226e2c71bb ("remoteproc: wcss: add support for rpmsg communication") Reported-by: kbuild test robot Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200514185856.1598945-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit fba5618451d2b3af5e55f8af5ce9c5d3677ad9c4 Author: Rob Herring Date: Tue May 12 15:45:43 2020 -0500 dt-bindings: Fix incorrect 'reg' property sizes The examples template is a 'simple-bus' with a size of 1 cell for had between 2 and 4 cells which really only errors on I2C or SPI type devices with a single cell. The easiest fix in most cases is to change the 'reg' property to for 1 cell address and size. In some cases with child devices having 2 cells, that doesn't make sense so a bus node is needed. Acked-by: Stephen Boyd # clk Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 1195b303a661f1dcfc5f97b6504d7d22a46289bc Author: Rob Herring Date: Tue May 12 15:45:42 2020 -0500 dt-bindings: ufs: ti: Add missing 'additionalProperties: false' The ti,j721e-ufs schema is missing an 'additionalProperties: false'. Add that and and the missing assigned-clock properties. Acked-by: Vignesh Raghavendra Signed-off-by: Rob Herring commit 346dda3167ff4f15321547114e4c9d4b132fa368 Author: Rob Herring Date: Tue May 12 15:45:41 2020 -0500 dt-bindings: ufs: ti: Fix address properties handling The ti,j721e-ufs schema and example have a couple of problems related to address properties. First, the default #size-cells and #address-cells are 1 for examples, so they need to be overriden with a bus node. Second, address translation for the child ufs node is broken because 'ranges', '#address-cells', and '#size-cells' are missing from the schema. Acked-by: Vignesh Raghavendra Signed-off-by: Rob Herring commit 3c9ab53f0348a04ec349275eb67e968ec8b030e8 Author: Rob Herring Date: Tue May 12 15:45:40 2020 -0500 dt-bindings: usb: ehci: Add missing 2nd register region The 'ibm,usb-ehci-440epx' compatible has a 2nd 'reg' region, but the schema says there is only 1 region. Fix this. Cc: linux-usb@vger.kernel.org Acked-by: Greg Kroah-Hartman Signed-off-by: Rob Herring commit e2f233ec155360d1cfff19cde77ffd4785d571da Author: Rob Herring Date: Tue May 12 15:45:39 2020 -0500 spi: dt-bindings: sifive: Add missing 2nd register region The 'reg' description and example have a 2nd register region for memory mapped flash, but the schema says there is only 1 region. Fix this. Cc: Palmer Dabbelt Cc: linux-spi@vger.kernel.org Cc: linux-riscv@lists.infradead.org Acked-by: Mark Brown Acked-by: Paul Walmsley Signed-off-by: Rob Herring commit 65994c09bc66d7241be2f7d6eb3b43f894ba2db0 Author: Lad Prabhakar Date: Wed May 6 20:51:32 2020 +0100 dt-bindings: serial: renesas,hscif: Document r8a7742 bindings RZ/G1H (R8A7742) SoC also has the R-Car gen2 compatible HSCIF ports, so document the SoC specific bindings. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 3cf1601ab00ce55820e6130611f536b326563a7e Author: Lad Prabhakar Date: Wed May 6 20:51:31 2020 +0100 dt-bindings: serial: renesas,scifb: Document r8a7742 bindings RZ/G1H (R8A7742) SoC also has the R-Car gen2 compatible SCIFB ports, so document the SoC specific bindings. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 8908a822663f6958f56174120de383ff955874be Author: Lad Prabhakar Date: Wed May 6 20:51:30 2020 +0100 dt-bindings: serial: renesas,scif: Document r8a7742 bindings RZ/G1H (R8A7742) SoC also has the R-Car gen2 compatible SCIF ports, so document the SoC specific bindings. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit a658d9bcd262421e7e63f4f3693e7e60b18422f3 Author: Lad Prabhakar Date: Wed May 6 20:51:28 2020 +0100 dt-bindings: irqchip: renesas-irqc: Document r8a7742 bindings Document SoC specific bindings for RZ/G1H (r8a7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 48156b6bb401148c201f3bd4b381d40cd4721b3f Author: Serge Semin Date: Wed May 6 20:42:21 2020 +0300 dt-bindings: Add vendor prefix for Baikal Electronics, JSC Add "BAIKAL ELECTRONICS, JSC" to the list of devicetree vendor prefixes as "baikal". Website: http://www.baikalelectronics.com Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: linux-mips@vger.kernel.org Cc: linux-pm@vger.kernel.org Acked-by: Sam Ravnborg Signed-off-by: Rob Herring commit f0a087a533b3691c4311358f75b5bfe6c3e73faa Author: Vesa Jääskeläinen Date: Sun May 3 12:33:55 2020 +0300 dt-bindings: vendor-prefixes: Add Vaisala Vaisala Oyj is a company based in Finland and also has subsidiaries in other countries. Vaisala develops, manufactures and markets innovative products and services for environmental and industrial measurement. https://www.vaisala.com/ Signed-off-by: Vesa Jääskeläinen Signed-off-by: Rob Herring commit 5ae5eb48ca046adffbdff56a2f297d0896b83186 Merge: 79fc48e41e39 0e36f32f6b6c Author: Mark Brown Date: Thu May 14 18:37:31 2020 +0100 Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8 commit 756d534b3e1007fdd773f1cbffda38a2fb25679c Author: Stephan Gerhold Date: Thu May 14 13:27:54 2020 +0200 arm64: dts: qcom: apq8016-sbc: merge -pins.dtsi into main .dtsi apq8016-sbc.dtsi is the only remaining device which takes up 4 files since it has its pinctrl split into separate files. Actually this does not really make the device tree easier to read (just harder to find nodes). For db820c the files were merged in commit 88264f1f6bf5 ("arm64: dts: qcom: db820c: Remove pin specific files"). Do the same for apq8016-sbc (db410c) and move the pinctrl definitions into apq8016-sbc.dtsi. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200514112754.148919-3-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 38a4d932f70a2f0be667515787153811f1fe528a Author: Stephan Gerhold Date: Thu May 14 13:27:53 2020 +0200 arm64: dts: qcom: msm8916: move gpu opp table to gpu node In msm8916.dtsi the GPU OPP table is defined under the root node, whereas in msm8996.dtsi/sdm845.dtsi it is a subnode of the gpu device (which makes it easier to find). Move it to the gpu device node to make this consistent. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200514112754.148919-2-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit e6717dbaef634af18c72b4f58b548d586eb0f5a5 Author: Stephan Gerhold Date: Thu May 14 13:27:52 2020 +0200 arm64: dts: qcom: msm8916: avoid using _ in node names Many nodes in the MSM8916 device trees use '_' in node names (especially pinctrl), even though (seemingly) '-' is preferred now. Make this more consistent by replacing '_' with '-' where possible. Similar naming is used for pinctrl in newer device trees (e.g. sdm845.dtsi). Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200514112754.148919-1-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit ece74ab227147844e094e455bf2f4fce26f9f4cf Author: Bjorn Andersson Date: Wed Jan 15 20:54:57 2020 -0800 arm64: defconfig: Enable Qualcomm SC7180 pinctrl and gcc Enable the Qualcomm SC7180 pinctrl and gcc driver, in order to allow the kernel to boot to console. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200116045457.2489704-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 2536bedec63ead8ee3664ab579bc6d5bae05996c Author: Bjorn Andersson Date: Sun Apr 5 23:00:49 2020 -0700 arm64: dts: qcom: c630: Specify UFS device reset On some device the reset line for the UFS memory needs to be tickled in order for UFS to initialize properly, add this to the ufs_mem_hc node. Reviewed-by: Robert Foss Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200406060049.227029-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 3fb298d0b2f2a1d47d53806d4ddf8f4ae83353cc Author: Bjorn Andersson Date: Thu Oct 17 22:58:41 2019 -0700 arm64: dts: qcom: c630: Add WiFi node Specify regulators and enable the &wifi node. The firmware uses the 8 bit version of the host capability message, so specify this quirk. Reviewed-by: Robert Foss Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20191018055841.3729591-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 9bcbabafa19b9f27a283777eff32e7d66fcef09c Author: Matti Vaittinen Date: Wed May 13 17:39:21 2020 +0300 regulator: bd718x7: remove voltage change restriction from BD71847 LDOs The BD71837 had a HW "feature" where changing the regulator output voltages of other regulators but bucks 1-4 might cause spikes if regulators were enabled. Thus SW prohibit voltage changes for other regulators except for bucks 1-4 when regulator is enabled. The HW colleagues did inadvertly fix this issue for BD71847 and BD71850. The power-good detection for LDOs can still cause false alarms if LDO voltage is changed upwards when LDO is enabled. Allow LDO voltage changes and disabe the power-good monioring for the duration of the LDO voltage change and enable it after LDO voltage has stabilized. ROHM HW colleagues measured the safety limit of 1000uS for guaranteeing the voltage has stabilized. Let's use that for starters and add confiurable stabilization wait-time later if needed. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/20200513143921.GA22143@localhost.localdomain Signed-off-by: Mark Brown commit ca69a3c68e2150ffb73ff1ff7d2b5390d76b3eb9 Author: Joonas Lahtinen Date: Fri Aug 30 13:50:53 2019 +0300 drm/i915: Document locking guidelines To ensure cross-driver locking compatibility, document the expected guidelines for implementing the GEM locking in i915. Note that this is a description of how things should end up after being reworked, and does not reflect the current state of things. v2: Use rst note:: tag (Rodrigo) Signed-off-by: Joonas Lahtinen Signed-off-by: Daniel Vetter Signed-off-by: Chris Wilson Cc: Dave Airlie Cc: Matthew Auld Cc: Abdiel Janulgue Cc: CQ Tang Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20190830105053.17491-1-joonas.lahtinen@linux.intel.com commit 60cf7c5ed5f7087c4de87a7676b8c82d96fd166c Author: Jeremy Cline Date: Thu May 14 10:05:46 2020 -0400 lockdown: Allow unprivileged users to see lockdown status A number of userspace tools, such as systemtap, need a way to see the current lockdown state so they can gracefully deal with the kernel being locked down. The state is already exposed in /sys/kernel/security/lockdown, but is only readable by root. Adjust the permissions so unprivileged users can read the state. Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM") Cc: Frank Ch. Eigler Signed-off-by: Jeremy Cline Signed-off-by: James Morris commit 4b20d4705a213f8c272456dc1e85554d013c33b9 Author: Michael Srba Date: Thu May 14 19:01:29 2020 +0200 arm64: dts: qcom: msm8916-samsung-a3u: add nodes for display panel This patch wires up display support on Samsung Galaxy A3 2015. Signed-off-by: Michael Srba Link: https://lore.kernel.org/r/20200514170129.10902-1-michael.srba@seznam.cz Signed-off-by: Bjorn Andersson commit 79fc48e41e39d7a98c5f8ae37f613d7ff9953c86 Author: Dan Murphy Date: Thu May 14 07:33:38 2020 -0500 ASoC: tlv320adcx140: Configure PDM sampling edge Configure the PDM sampling edges based on the values from the firmware. Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200514123338.20392-3-dmurphy@ti.com Signed-off-by: Mark Brown commit 75b0adbb0806a141b0b5f074cd6bd58bb9870c0d Author: Dan Murphy Date: Thu May 14 07:33:37 2020 -0500 ASoC: tlv320adcx140: Add device tree property for PDM edges Add a device tree property to configure the PDM sampling edge for each digital microphone. Signed-off-by: Dan Murphy CC: Rob Herring Link: https://lore.kernel.org/r/20200514123338.20392-2-dmurphy@ti.com Signed-off-by: Mark Brown commit 7cfa610205d95357f9eface292dc70fce7571f65 Author: Dan Murphy Date: Thu May 14 07:33:36 2020 -0500 ASoC: tlv320adcx140: Add controls for PDM clk Add ALSA controls to configure the PDM clocks. The clocks need to be configurable to accommodate various microphones that use clocks for low power/low resolution modes to high power/high resolution modes. Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200514123338.20392-1-dmurphy@ti.com Signed-off-by: Mark Brown commit 802a5820fc0c0f12b40280db3dbaaf8359b07243 Author: Ville Syrjälä Date: Mon Mar 2 16:39:42 2020 +0200 drm/i915: Extract i915_cs_timestamp_{ns_to_ticks,tick_to_ns}() Pull the code to do the CS timestamp ns<->ticks conversion into helpers and use them all over. The check in i915_perf_noa_delay_set() seems a bit dubious, so we switch it to do what I assume it wanted to do all along (ie. make sure the resulting delay in CS timestamp ticks doesn't exceed 32bits)? Cc: Lionel Landwerlin Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200302143943.32676-5-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit 56f1b31f1dd60db4b02024a13eea45b5bbccc44e Author: Ville Syrjälä Date: Mon Mar 2 16:39:39 2020 +0200 drm/i915: Store CS timestamp frequency in Hz kHz isn't accurate enough for storing the CS timestamp frequency on some of the platforms. Store the value in Hz instead. Cc: Lionel Landwerlin Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200302143943.32676-2-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson Reviewed-by: Lionel Landwerlin commit 2e2701582a8039b2f8a2fa811237ac8ec98355fa Author: Ville Syrjälä Date: Mon Mar 2 16:39:38 2020 +0200 drm/i915: Nuke pointless div by 64bit Bunch of places use a 64bit divisor needlessly. Switch to 32bit divisor. Cc: Lionel Landwerlin Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200302143943.32676-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit 8ca6d0237d1696060cd4f5a3ee93ee001c1a9d5b Author: Stanislav Lisovskiy Date: Thu May 14 10:48:53 2020 +0300 drm/i915: Enable SAGV support for Gen12 Flip the switch and enable SAGV support for Gen12 also. Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200514074853.9508-4-stanislav.lisovskiy@intel.com commit 20f505f2253106f695ba6fa0a415159145a8fb2a Author: Stanislav Lisovskiy Date: Thu May 14 10:48:52 2020 +0300 drm/i915: Restrict qgv points which don't have enough bandwidth. According to BSpec 53998, we should try to restrict qgv points, which can't provide enough bandwidth for desired display configuration. Currently we are just comparing against all of those and take minimum(worst case). v2: Fixed wrong PCode reply mask, removed hardcoded values. v3: Forbid simultaneous legacy SAGV PCode requests and restricting qgv points. Put the actual restriction to commit function, added serialization(thanks to Ville) to prevent commit being applied out of order in case of nonblocking and/or nomodeset commits. v4: - Minor code refactoring, fixed few typos(thanks to James Ausmus) - Change the naming of qgv point masking/unmasking functions(James Ausmus). - Simplify the masking/unmasking operation itself, as we don't need to mask only single point per request(James Ausmus) - Reject and stick to highest bandwidth point if SAGV can't be enabled(BSpec) v5: - Add new mailbox reply codes, which seems to happen during boot time for TGL and indicate that QGV setting is not yet available. v6: - Increase number of supported QGV points to be in sync with BSpec. v7: - Rebased and resolved conflict to fix build failure. - Fix NUM_QGV_POINTS to 8 and moved that to header file(James Ausmus) v8: - Don't report an error if we can't restrict qgv points, as SAGV can be disabled by BIOS, which is completely legal. So don't make CI panic. Instead if we detect that there is only 1 QGV point accessible just analyze if we can fit the required bandwidth requirements, but no need in restricting. v9: - Fix wrong QGV transition if we have 0 planes and no SAGV simultaneously. v10: - Fix CDCLK corruption, because of global state getting serialized without modeset, which caused copying of non-calculated cdclk to be copied to dev_priv(thanks to Ville for the hint). v11: - Remove unneeded headers and spaces(Matthew Roper) - Remove unneeded intel_qgv_info qi struct from bw check and zero out the needed one(Matthew Roper) - Changed QGV error message to have more clear meaning(Matthew Roper) - Use state->modeset_set instead of any_ms(Matthew Roper) - Moved NUM_SAGV_POINTS from i915_reg.h to i915_drv.h where it's used - Keep using crtc_state->hw.active instead of .enable(Matthew Roper) - Moved unrelated changes to other patch(using latency as parameter for plane wm calculation, moved to SAGV refactoring patch) v12: - Fix rebase conflict with own temporary SAGV/QGV fix. - Remove unnecessary mask being zero check when unmasking qgv points as this is completely legal(Matt Roper) - Check if we are setting the same mask as already being set in hardware to prevent error from PCode. - Fix error message when restricting/unrestricting qgv points to "mask/unmask" which sounds more accurate(Matt Roper) - Move sagv status setting to icl_get_bw_info from atomic check as this should be calculated only once.(Matt Roper) - Edited comments for the case when we can't enable SAGV and use only 1 QGV point with highest bandwidth to be more understandable.(Matt Roper) v13: - Moved max_data_rate in bw check to closer scope(Ville Syrjälä) - Changed comment for zero new_mask in qgv points masking function to better reflect reality(Ville Syrjälä) - Simplified bit mask operation in qgv points masking function (Ville Syrjälä) - Moved intel_qgv_points_mask closer to gen11 SAGV disabling, however this still can't be under modeset condition(Ville Syrjälä) - Packed qgv_points_mask as u8 and moved closer to pipe_sagv_mask (Ville Syrjälä) - Extracted PCode changes to separate patch.(Ville Syrjälä) - Now treat num_planes 0 same as 1 to avoid confusion and returning max_bw as 0, which would prevent choosing QGV point having max bandwidth in case if SAGV is not allowed, as per BSpec(Ville Syrjälä) - Do the actual qgv_points_mask swap in the same place as all other global state parts like cdclk are swapped. In the next patch, this all will be moved to bw state as global state, once new global state patch series from Ville lands v14: - Now using global state to serialize access to qgv points - Added global state locking back, otherwise we seem to read bw state in a wrong way. v15: - Added TODO comment for near atomic global state locking in bw code. v16: - Fixed intel_atomic_bw_* functions to be intel_bw_* as discussed with Jani Nikula. - Take bw_state_changed flag into use. v17: - Moved qgv point related manipulations next to SAGV code, as those are semantically related(Ville Syrjälä) - Renamed those into intel_sagv_(pre)|(post)_plane_update (Ville Syrjälä) v18: - Move sagv related calls from commit tail into intel_sagv_(pre)|(post)_plane_update(Ville Syrjälä) v19: - Use intel_atomic_get_bw_(old)|(new)_state which is intended for commit tail stage. v20: - Return max bandwidth for 0 planes(Ville) - Constify old_bw_state in bw_atomic_check(Ville) - Removed some debugs(Ville) - Added data rate to debug print when no QGV points(Ville) - Removed some comments(Ville) v21, v22, v23: - Fixed rebase conflict v24: - Changed PCode mask to use ICL_ prefix v25: - Resolved rebase conflict v26: - Removed redundant NULL checks(Ville) - Removed redundant error prints(Ville) v27: - Use device specific drm_err(Ville) - Fixed parenthesis ident reported by checkpatch Line over 100 warns to be fixed together with existing code style. Signed-off-by: Stanislav Lisovskiy Cc: Ville Syrjälä Cc: James Ausmus [vsyrjala: Drop duplicate intel_sagv_{pre,post}_plane_update() prototypes and drop unused NUM_SAGV_POINTS define] Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200514074853.9508-3-stanislav.lisovskiy@intel.com commit 7241c57d3140ad3b613777a8515ffe1f653d4800 Author: Stanislav Lisovskiy Date: Thu May 14 10:48:51 2020 +0300 drm/i915: Add TGL+ SAGV support Starting from TGL we need to have a separate wm0 values for SAGV and non-SAGV which affects how calculations are done. v2: Remove long lines v3: Removed COLOR_PLANE enum references v4, v5, v6: Fixed rebase conflict v7: - Removed skl_plane_wm_level accessor from skl_allocate_pipe_ddb(Ville) - Removed sagv_uv_wm0(Ville) - can_sagv->use_sagv_wm(Ville) v8: - Moved tgl_crtc_can_enable_sagv function up(Ville) - Changed comment regarding pipe_wm usage(Ville) - Call intel_can_enable_sagv and tgl_compute_sagv_wm only for Gen12(Ville) - Some sagv debugs removed(Ville) - skl_print_wm_changes improvements(Ville) - Do assignment instead of memcpy in skl_pipe_wm_get_hw_state(Ville) v9: - Removed can_sagv variable(Ville) - Removed spurious line(Ville) - Changed u32 to unsigned int as agreed(Ville) - Assign sagv only for gen12 in skl_pipe_wm_get_hw_state(Ville) Signed-off-by: Stanislav Lisovskiy [vsyrjala: Remove the dead 'return false' from intel_crtc_can_enable_sagv()] Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200514074853.9508-2-stanislav.lisovskiy@intel.com commit 38b91f810b6873bcdfd6ef441e9a3794a9c69101 Author: Joerg Roedel Date: Thu May 14 14:46:21 2020 +0200 iommu/sun50i: Use __GFP_ZERO instead of memset() Allocate zeroed memory so there is no need to memset it to 0 in the driver. Signed-off-by: Joerg Roedel Cc: Maxime Ripard Link: https://lore.kernel.org/r/20200514124621.25999-2-joro@8bytes.org commit ab785cfa5907b3fa141438baed898849b6b43b4e Author: Joerg Roedel Date: Thu May 14 14:46:20 2020 +0200 iommu/sun50i: Fix compile warnings A few compile warnings show up when building this driver: CC drivers/iommu/sun50i-iommu.o drivers/iommu/sun50i-iommu.c: In function ‘sun50i_dte_get_page_table’: drivers/iommu/sun50i-iommu.c:486:16: warning: unused variable ‘flags’ [-Wunused-variable] 486 | unsigned long flags; | ^~~~~ drivers/iommu/sun50i-iommu.c: In function ‘sun50i_iommu_unmap’: drivers/iommu/sun50i-iommu.c:559:23: warning: unused variable ‘iommu’ [-Wunused-variable] 559 | struct sun50i_iommu *iommu = sun50i_domain->iommu; | ^~~~~ drivers/iommu/sun50i-iommu.c: In function ‘sun50i_iommu_probe_device’: drivers/iommu/sun50i-iommu.c:749:22: warning: unused variable ‘group’ [-Wunused-variable] 749 | struct iommu_group *group; | ^~~~~ Remove the unused variables. Signed-off-by: Joerg Roedel Cc: Maxime Ripard Link: https://lore.kernel.org/r/20200514124621.25999-1-joro@8bytes.org commit 4100b8c229b328358cc4a82f5042dbf22f1c1ccb Author: Maxime Ripard Date: Wed May 13 16:07:22 2020 +0200 iommu: Add Allwinner H6 IOMMU driver The Allwinner H6 has introduced an IOMMU for a few DMA controllers, mostly video related: the display engine, the video decoders / encoders, the camera capture controller, etc. The design is pretty simple compared to other IOMMUs found in SoCs: there's a single instance, controlling all the masters, with a single address space. It also features a performance monitoring unit that allows to retrieve various informations (per-master and global TLB accesses, hits and misses, access latency, etc) that isn't supported at the moment. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/d122a8670361e36fc26b4ce2674a2223d30dc4cc.1589378833.git-series.maxime@cerno.tech Signed-off-by: Joerg Roedel commit 488f6682c832e9549d28b30075f00c76328eb1be Author: Satya Tangirala Date: Thu May 14 00:37:20 2020 +0000 block: blk-crypto-fallback for Inline Encryption Blk-crypto delegates crypto operations to inline encryption hardware when available. The separately configurable blk-crypto-fallback contains a software fallback to the kernel crypto API - when enabled, blk-crypto will use this fallback for en/decryption when inline encryption hardware is not available. This lets upper layers not have to worry about whether or not the underlying device has support for inline encryption before deciding to specify an encryption context for a bio. It also allows for testing without actual inline encryption hardware - in particular, it makes it possible to test the inline encryption code in ext4 and f2fs simply by running xfstests with the inlinecrypt mount option, which in turn allows for things like the regular upstream regression testing of ext4 to cover the inline encryption code paths. For more details, refer to Documentation/block/inline-encryption.rst. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Signed-off-by: Jens Axboe commit d145dc23030bbf2de3a8ca5e0c29c2e568f69737 Author: Satya Tangirala Date: Thu May 14 00:37:19 2020 +0000 block: Make blk-integrity preclude hardware inline encryption Whenever a device supports blk-integrity, make the kernel pretend that the device doesn't support inline encryption (essentially by setting the keyslot manager in the request queue to NULL). There's no hardware currently that supports both integrity and inline encryption. However, it seems possible that there will be such hardware in the near future (like the NVMe key per I/O support that might support both inline encryption and PI). But properly integrating both features is not trivial, and without real hardware that implements both, it is difficult to tell if it will be done correctly by the majority of hardware that support both. So it seems best not to support both features together right now, and to decide what to do at probe time. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit a892c8d52c02284076fbbacae6692aa5c5807d11 Author: Satya Tangirala Date: Thu May 14 00:37:18 2020 +0000 block: Inline encryption support for blk-mq We must have some way of letting a storage device driver know what encryption context it should use for en/decrypting a request. However, it's the upper layers (like the filesystem/fscrypt) that know about and manages encryption contexts. As such, when the upper layer submits a bio to the block layer, and this bio eventually reaches a device driver with support for inline encryption, the device driver will need to have been told the encryption context for that bio. We want to communicate the encryption context from the upper layer to the storage device along with the bio, when the bio is submitted to the block layer. To do this, we add a struct bio_crypt_ctx to struct bio, which can represent an encryption context (note that we can't use the bi_private field in struct bio to do this because that field does not function to pass information across layers in the storage stack). We also introduce various functions to manipulate the bio_crypt_ctx and make the bio/request merging logic aware of the bio_crypt_ctx. We also make changes to blk-mq to make it handle bios with encryption contexts. blk-mq can merge many bios into the same request. These bios need to have contiguous data unit numbers (the necessary changes to blk-merge are also made to ensure this) - as such, it suffices to keep the data unit number of just the first bio, since that's all a storage driver needs to infer the data unit number to use for each data block in each bio in a request. blk-mq keeps track of the encryption context to be used for all the bios in a request with the request's rq_crypt_ctx. When the first bio is added to an empty request, blk-mq will program the encryption context of that bio into the request_queue's keyslot manager, and store the returned keyslot in the request's rq_crypt_ctx. All the functions to operate on encryption contexts are in blk-crypto.c. Upper layers only need to call bio_crypt_set_ctx with the encryption key, algorithm and data_unit_num; they don't have to worry about getting a keyslot for each encryption context, as blk-mq/blk-crypto handles that. Blk-crypto also makes it possible for request-based layered devices like dm-rq to make use of inline encryption hardware by cloning the rq_crypt_ctx and programming a keyslot in the new request_queue when necessary. Note that any user of the block layer can submit bios with an encryption context, such as filesystems, device-mapper targets, etc. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 1b2628397058ebce7277480960b29c788138de90 Author: Satya Tangirala Date: Thu May 14 00:37:17 2020 +0000 block: Keyslot Manager for Inline Encryption Inline Encryption hardware allows software to specify an encryption context (an encryption key, crypto algorithm, data unit num, data unit size) along with a data transfer request to a storage device, and the inline encryption hardware will use that context to en/decrypt the data. The inline encryption hardware is part of the storage device, and it conceptually sits on the data path between system memory and the storage device. Inline Encryption hardware implementations often function around the concept of "keyslots". These implementations often have a limited number of "keyslots", each of which can hold a key (we say that a key can be "programmed" into a keyslot). Requests made to the storage device may have a keyslot and a data unit number associated with them, and the inline encryption hardware will en/decrypt the data in the requests using the key programmed into that associated keyslot and the data unit number specified with the request. As keyslots are limited, and programming keys may be expensive in many implementations, and multiple requests may use exactly the same encryption contexts, we introduce a Keyslot Manager to efficiently manage keyslots. We also introduce a blk_crypto_key, which will represent the key that's programmed into keyslots managed by keyslot managers. The keyslot manager also functions as the interface that upper layers will use to program keys into inline encryption hardware. For more information on the Keyslot Manager, refer to documentation found in block/keyslot-manager.c and linux/keyslot-manager.h. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 54b259f68de59920714588cb52c4a262cb712f98 Author: Satya Tangirala Date: Thu May 14 00:37:16 2020 +0000 Documentation: Document the blk-crypto framework The blk-crypto framework adds support for inline encryption. There are numerous changes throughout the storage stack. This patch documents the main design choices in the block layer, the API presented to users of the block layer (like fscrypt or layered devices) and the API presented to drivers for adding support for inline encryption. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Signed-off-by: Jens Axboe commit 81ca627a933063fa63a6d4c66425de822a2ab7f5 Author: Tejun Heo Date: Mon Oct 14 17:18:11 2019 -0700 iocost: don't let vrate run wild while there's no saturation signal When the QoS targets are met and nothing is being throttled, there's no way to tell how saturated the underlying device is - it could be almost entirely idle, at the cusp of saturation or anywhere inbetween. Given that there's no information, it's best to keep vrate as-is in this state. Before 7cd806a9a953 ("iocost: improve nr_lagging handling"), this was the case - if the device isn't missing QoS targets and nothing is being throttled, busy_level was reset to zero. While fixing nr_lagging handling, 7cd806a9a953 ("iocost: improve nr_lagging handling") broke this. Now, while the device is hitting QoS targets and nothing is being throttled, vrate keeps getting adjusted according to the existing busy_level. This led to vrate keeping climing till it hits max when there's an IO issuer with limited request concurrency if the vrate started low. vrate starts getting adjusted upwards until the issuer can issue IOs w/o being throttled. From then on, QoS targets keeps getting met and nothing on the system needs throttling and vrate keeps getting increased due to the existing busy_level. This patch makes the following changes to the busy_level logic. * Reset busy_level if nr_shortages is zero to avoid the above scenario. * Make non-zero nr_lagging block lowering nr_level but still clear positive busy_level if there's clear non-saturation signal - QoS targets are met and nr_shortages is non-zero. nr_lagging's role is preventing adjusting vrate upwards while there are long-running commands and it shouldn't keep busy_level positive while there's clear non-saturation signal. * Restructure code for clarity and add comments. Signed-off-by: Tejun Heo Reported-by: Andy Newell Fixes: 7cd806a9a953 ("iocost: improve nr_lagging handling") Signed-off-by: Jens Axboe commit 1be8f347d70b5027b7b223c665756d85feaf36b6 Merge: 7a00e68b4317 47e51832ae93 Author: Joonas Lahtinen Date: Thu May 14 18:02:22 2020 +0300 Merge tag 'gvt-next-2020-05-12' of https://github.com/intel/gvt-linux into drm-intel-next-queued gvt-next-2020-05-12 - Support PPGTT update via LRI cmd (Zhenyu) - Remove extra kmap for shadow ctx update (Zhenyu) - Move workload cleanup out of execlist handling code (Zhenyu) Signed-off-by: Joonas Lahtinen From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20200512094017.GX18545@zhen-hp.sh.intel.com commit c95473e175dd1234b7440daa6eb2670ebf529653 Author: Yu-cheng Yu Date: Tue May 12 07:54:41 2020 -0700 x86/fpu/xstate: Update copy_kernel_to_xregs_err() for supervisor states The function copy_kernel_to_xregs_err() uses XRSTOR which can work with standard or compacted format without supervisor xstates. However, when supervisor xstates are present, XRSTORS must be used. Fix it by using XRSTORS when supervisor state handling is enabled. I also considered if there were additional cases where XRSTOR might be mistakenly called instead of XRSTORS. There are only three XRSTOR sites in the kernel: 1. copy_kernel_to_xregs_booting(), already switches between XRSTOR and XRSTORS based on X86_FEATURE_XSAVES. 2. copy_user_to_xregs(), which *needs* XRSTOR because it is copying from userspace and must never copy supervisor state with XRSTORS. 3. copy_kernel_to_xregs_err() mistakenly used XRSTOR only. Fix it. [ bp: Massage commit message. ] Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20200512145444.15483-8-yu-cheng.yu@intel.com commit c8ffd8bcdd28296a198f237cc595148a8d4adfbe Author: Miklos Szeredi Date: Thu May 14 16:44:25 2020 +0200 vfs: add faccessat2 syscall POSIX defines faccessat() as having a fourth "flags" argument, while the linux syscall doesn't have it. Glibc tries to emulate AT_EACCESS and AT_SYMLINK_NOFOLLOW, but AT_EACCESS emulation is broken. Add a new faccessat(2) syscall with the added flags argument and implement both flags. The value of AT_EACCESS is defined in glibc headers to be the same as AT_REMOVEDIR. Use this value for the kernel interface as well, together with the explanatory comment. Also add AT_EMPTY_PATH support, which is not documented by POSIX, but can be useful and is trivial to implement. Signed-off-by: Miklos Szeredi commit 55923e4d7d195a34d3b1faaba57a5a6551e88b36 Author: Miklos Szeredi Date: Thu May 14 16:44:25 2020 +0200 vfs: don't parse "silent" option Parsing "silent" and clearing SB_SILENT makes zero sense. Parsing "silent" and setting SB_SILENT would make a bit more sense, but apparently nobody cares. Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit caaef1ba8c9ee7a54b53dd8bf4bb7e8658185583 Author: Miklos Szeredi Date: Thu May 14 16:44:25 2020 +0200 vfs: don't parse "posixacl" option Unlike the others, this is _not_ a standard option accepted by mount(8). In fact SB_POSIXACL is an internal flag, and accepting MS_POSIXACL on the mount(2) interface is possibly a bug. The only filesystem that apparently wants to handle the "posixacl" option is 9p, but it has special handling of that option besides setting SB_POSIXACL. Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 9193ae87a8af031ce2fb4116d417fff55c8a0bcc Author: Miklos Szeredi Date: Thu May 14 16:44:25 2020 +0200 vfs: don't parse forbidden flags Makes little sense to keep this blacklist synced with what mount(8) parses and what it doesn't. E.g. it has various forms of "*atime" options, but not "atime"... Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 80340fe3605c0e78cfe496c3b3878be828cfdbfe Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 statx: add mount_root Determining whether a path or file descriptor refers to a mountpoint (or more precisely a mount root) is not trivial using current tools. Add a flag to statx that indicates whether the path or fd refers to the root of a mount or not. Cc: linux-api@vger.kernel.org Cc: linux-man@vger.kernel.org Reported-by: Lennart Poettering Reported-by: J. Bruce Fields Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60 Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 statx: add mount ID Systemd is hacking around to get it and it's trivial to add to statx, so... Cc: linux-api@vger.kernel.org Cc: linux-man@vger.kernel.org Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 761e28fa270a3cc0f2ae9a0f4f778239b91a9df2 Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 statx: don't clear STATX_ATIME on SB_RDONLY IS_NOATIME(inode) is defined as __IS_FLG(inode, SB_RDONLY|SB_NOATIME), so generic_fillattr() will clear STATX_ATIME from the result_mask if the super block is marked read only. This was probably not the intention, so fix to only clear STATX_ATIME if the fs doesn't support atime at all. Signed-off-by: Miklos Szeredi Acked-by: David Howells Reviewed-by: Christoph Hellwig commit 581701b7efd60ba13d8a7eed60cbdd7fefaf6696 Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 uapi: deprecate STATX_ALL Constants of the *_ALL type can be actively harmful due to the fact that developers will usually fail to consider the possible effects of future changes to the definition. Deprecate STATX_ALL in the uapi, while no damage has been done yet. We could keep something like this around in the kernel, but there's actually no point, since all filesystems should be explicitly checking flags that they support and not rely on the VFS masking unknown ones out: a flag could be known to the VFS, yet not known to the filesystem. Cc: David Howells Cc: linux-api@vger.kernel.org Cc: linux-man@vger.kernel.org Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 44a3b87444058b2cb055092cdebc63858707bf66 Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 utimensat: AT_EMPTY_PATH support This makes it possible to use utimensat on an O_PATH file (including symlinks). It supersedes the nonstandard utimensat(fd, NULL, ...) form. Cc: linux-api@vger.kernel.org Cc: linux-man@vger.kernel.org Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 9470451505efbcc9eef2d7e74251e6402f5ea385 Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 vfs: split out access_override_creds() Split out a helper that overrides the credentials in preparation for actually doing the access check. This prepares for the next patch that optionally disables the creds override. Suggested-by: Christoph Hellwig Signed-off-by: Miklos Szeredi commit 9f6c61f96f2d97cbb5f7fa85607bc398f843ff0f Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 proc/mounts: add cursor If mounts are deleted after a read(2) call on /proc/self/mounts (or its kin), the subsequent read(2) could miss a mount that comes after the deleted one in the list. This is because the file position is interpreted as the number mount entries from the start of the list. E.g. first read gets entries #0 to #9; the seq file index will be 10. Then entry #5 is deleted, resulting in #10 becoming #9 and #11 becoming #10, etc... The next read will continue from entry #10, and #9 is missed. Solve this by adding a cursor entry for each open instance. Taking the global namespace_sem for write seems excessive, since we are only dealing with a per-namespace list. Instead add a per-namespace spinlock and use that together with namespace_sem taken for read to protect against concurrent modification of the mount list. This may reduce parallelism of is_local_mountpoint(), but it's hardly a big contention point. We could also use RCU freeing of cursors to make traversal not need additional locks, if that turns out to be neceesary. Only move the cursor once for each read (cursor is not added on open) to minimize cacheline invalidation. When EOF is reached, the cursor is taken off the list, in order to prevent an excessive number of cursors due to inactive open file descriptors. Reported-by: Karel Zak Signed-off-by: Miklos Szeredi commit 530f32fc370fd1431ea9802dbc53ab5601dfccdb Author: Miklos Szeredi Date: Thu May 14 16:44:24 2020 +0200 aio: fix async fsync creds Avi Kivity reports that on fuse filesystems running in a user namespace asyncronous fsync fails with EOVERFLOW. The reason is that f_ops->fsync() is called with the creds of the kthread performing aio work instead of the creds of the process originally submitting IOCB_CMD_FSYNC. Fuse sends the creds of the caller in the request header and it needs to translate the uid and gid into the server's user namespace. Since the kthread is running in init_user_ns, the translation will fail and the operation returns an error. It can be argued that fsync doesn't actually need any creds, but just zeroing out those fields in the header (as with requests that currently don't take creds) is a backward compatibility risk. Instead of working around this issue in fuse, solve the core of the problem by calling the filesystem with the proper creds. Reported-by: Avi Kivity Tested-by: Giuseppe Scrivano Fixes: c9582eb0ff7d ("fuse: Fail all requests with invalid uids or gids") Cc: stable@vger.kernel.org # 4.18+ Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit a3c751a50fe6bbe50eb7622a14b18b361804ee0c Author: Miklos Szeredi Date: Thu May 14 16:44:23 2020 +0200 vfs: allow unprivileged whiteout creation Whiteouts, unlike real device node should not require privileges to create. The general concern with device nodes is that opening them can have side effects. The kernel already avoids zero major (see Documentation/admin-guide/devices.txt). To be on the safe side the patch explicitly forbids registering a char device with 0/0 number (see cdev_add()). This guarantees that a non-O_PATH open on a whiteout will fail with ENODEV; i.e. it won't have any side effect. Signed-off-by: Miklos Szeredi commit ef5fd681d5159d64c464715d657660f0151c7419 Author: Kaixu Xia Date: Wed Apr 15 15:25:42 2020 +0800 ext4: remove redundant variable has_bigalloc in ext4_fill_super We can use the ext4_has_feature_bigalloc() function directly to check bigalloc feature and the variable has_bigalloc is reduncant, so remove it. Signed-off-by: Kaixu Xia Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/1586935542-29588-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Theodore Ts'o commit 7e76f82acd9e12fe7765d5d8c200b37787c994e4 Author: Marek Vasut Date: Wed May 13 20:10:20 2020 +0200 ARM: dts: stm32: Split Avenger96 into DHCOR SoM and Avenger96 board The Avenger96 is in fact an assembly of DH Electronics DHCOR SoM on top of an Avenger96 reference board. The DHCOR SoM can be populated with any STM32MP15xx. Split the DTs to reflect this such that the common SoM and Avenger96 parts are now in stm32mp15xx-dhcor-*dtsi and a specific example implementation of STM32MP157A SoM and Avenger96 board is separated into stm32mp157a-dhcor-*dts* . The stm32mp157a-avenger96.dts is retained for the sake of backward naming compatibility. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Reviewed-by: Manivannan Sadhasivam Signed-off-by: Alexandre Torgue commit 604536dc58379d918e455bdbe6194e68b5aa4f1f Author: Marek Vasut Date: Wed May 13 20:10:19 2020 +0200 ARM: dts: stm32: Split SoC-independent parts of DHCOM SOM and PDK2 The DH Electronics PDK2 can be populated with SoM with any STM32MP15xx variant. Split the SoC-independent parts of the SoM and PDK2 into the stm32mp15xx-dhcom-*.dtsi and reduce stm32mp157c-dhcom-*dts* to example of adding STM32MP157C variant of the SoM into a PDK2 carrier board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 81d5fc7197984c793ae90c5516657fe8902b3f18 Author: Marek Vasut Date: Wed May 13 20:10:18 2020 +0200 ARM: dts: stm32: Add GPIO LEDs for STM32MP1 DHCOM PDK2 Add bindings for the four GPIO LEDs on DH PDK2 board. Note that LED5 GPIO-E may conflict with touchscreen interrupt, hence LED5 must be disabled when using the DH 560-200 display unit with touchscreen. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 87cabf9405cbfba439d59fa5d956e4c5e76a061c Author: Marek Vasut Date: Wed May 13 20:10:17 2020 +0200 ARM: dts: stm32: Add GPIO keys for STM32MP1 DHCOM PDK2 Add bindings for the four GPIO keys on DH PDK2 board. Note that TA1 key is polled because it's IRQ line conflicts with ethernet IRQ, the rest of the GPIO keys, TA2, TA3, TA4, are interrupt-driven and wake up sources. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 71ac860af824ce9ebbbe8de20044e777c0fc33b9 Author: Ming Lei Date: Thu May 14 16:45:09 2020 +0800 block: move blk_io_schedule() out of header file blk_io_schedule() isn't called from performance sensitive code path, and it is easier to maintain by exporting it as symbol. Also blk_io_schedule() is only called by CONFIG_BLOCK code, so it is safe to do this way. Meantime fixes build failure when CONFIG_BLOCK is off. Cc: Christoph Hellwig Fixes: e6249cdd46e4 ("block: add blk_io_schedule() for avoiding task hung in sync dio") Reported-by: Satya Tangirala Tested-by: Satya Tangirala Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 1cacdf5d3bb9644ac7b9339c611ac5b9dd90d09d Author: Bjorn Andersson Date: Fri Apr 17 00:07:12 2020 -0700 arm64: dts: qcom: db820c: Fix invalid pm8994 supplies It's uncertain where the "vreg_s8a_l3a_input" comes from, but the supply for VDD_L3_L11 on PM8994 should be VREG_S3A_1P3, so correct this - and drop the vreg_s8a_l3a_input. Reviewed-by: Vinod Koul Fixes: 83d9ed4342a3 ("arm64: dts: qcom: db820c: Use regulator names from schematics") Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200417070712.1376355-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 14a9f4c6abdf6b58e0237076cc4786934aa28be0 Author: Bjorn Andersson Date: Fri Apr 17 00:03:03 2020 -0700 arm64: dts: qcom: db820c: Add pmi8994 RPM regulators The PMI8994 provides 3 SPMS regulators and one boost/bypass regulator. Define s1 and the boot/bypass and update pm8994 to appropriately describe the supply from PMI8994. Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200417070303.1376290-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 35dd70b4c4935012ee02b4296618e56bd6ae3040 Author: Geert Uytterhoeven Date: Thu May 7 14:27:57 2020 +0200 media: media: sh_veu: Remove driver Since its inclusion in v3.9, no users of the SuperH VEU mem2mem video processing driver have appeared upstream. All VEU devices in SuperH board code still bind to the "uio_pdrv_genirq" driver instead. The original author marked the driver orphaned in v3.15. Remove the driver; it can always be resurrected from git history when needed. Signed-off-by: Geert Uytterhoeven Acked-by: Rob Landley Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit f0c2df217c809e367be2004e8e34bbcf3533cb1f Author: Manivannan Sadhasivam Date: Sun May 3 21:12:15 2020 +0530 ARM: dts: stm32: Add IoT Box board support IoT Box is an IoT gateway device based on Stinger96 board powered by STM32MP1 SoC, designed and manufactured by Shiratech Solutions. This device makes use of Stinger96 board by having it as a base board with one additional mezzanine on top. Following are the features exposed by this device in addition to the Stinger96 board: * WiFi/BT * CCS811 VOC sensor * 2x Digital microphones IM69D130 * 12x WS2812B LEDs Following peripherals are tested and known to work: * WiFi/BT * CCS811 More information about this device can be found in Shiratech website: https://www.shiratech-solutions.com/products/iot-box/ Signed-off-by: Manivannan Sadhasivam Signed-off-by: Alexandre Torgue commit 061e0a6e108f7c61fd16ac2ebb529f68f94d856d Author: Manivannan Sadhasivam Date: Sun May 3 21:12:14 2020 +0530 dt-bindings: arm: stm32: Document IoT Box compatible Document devicetree compatible of Shiratech IoT Box. Signed-off-by: Manivannan Sadhasivam Acked-by: Rob Herring Signed-off-by: Alexandre Torgue commit aaac4bd35a8339cf217a0928c8762fc2250fdb81 Author: Manivannan Sadhasivam Date: Sun May 3 21:12:13 2020 +0530 ARM: dts: stm32: Add Stinger96 board support Stinger96 is a 96Boards IoT Extended edition board designed and manufactured by Shiratech solutions based on STM32MP1 SoC. Following are the features of this board: * 256MB DDR * 125MB NAND Flash * Onboard BG96 modem * 1x uSD * 2x USB (1 available as external connector and another connected to BG96) * 1x SPI * 1x PCM * 2x UART (apart from serial console) * 2x I2C (apart from one connected to PMIC) Following peripherals are tested and known to work: * BG96 modem * 1x I2C (LS-I2C0) * 1x SPI * 1x UART (LS-UART0) * USB (Only Gadget mode) * uSD More information about this board can be found in Shiratech website: https://www.shiratech-solutions.com/products/stinger96/ Signed-off-by: Manivannan Sadhasivam Signed-off-by: Alexandre Torgue commit b856e9d148aeede8b56003a417606415cb943311 Author: Manivannan Sadhasivam Date: Sun May 3 21:12:12 2020 +0530 dt-bindings: arm: stm32: Document Stinger96 compatible Document devicetree compatible of Shiratech Stinger96 board. Signed-off-by: Manivannan Sadhasivam Acked-by: Rob Herring Signed-off-by: Alexandre Torgue commit 498a7014989dfdd9a47864b55704dc829ed0dc90 Author: Manivannan Sadhasivam Date: Sun May 3 21:12:11 2020 +0530 ARM: dts: stm32: Add missing pinctrl entries for STM32MP15 These pinctrl definitions will be used by Stinger96/IoTBox boards from Shiratech. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Alexandre Torgue commit da80ddaf5176fdbe6742d77ff9039f690a3df595 Author: Manivannan Sadhasivam Date: Sun May 3 21:12:10 2020 +0530 dt-bindings: Add vendor prefix for Shiratech Solutions This commit adds devicetree vendor prefix for Shiratech solutions, a SOM/embedded board manufacturing company. https://www.shiratech-solutions.com/ Signed-off-by: Manivannan Sadhasivam Acked-by: Rob Herring Signed-off-by: Alexandre Torgue commit db7d3cbd6a99c5148eafd4685b33d48d118a317f Author: Maxime Ripard Date: Wed May 13 16:07:20 2020 +0200 dt-bindings: iommu: Add Allwinner H6 IOMMU bindings The Allwinner H6 has introduced an IOMMU. Let's add a device tree binding for it. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/f3e1633677a9cf9cf36fe3582f0168fae94c1b3e.1589378833.git-series.maxime@cerno.tech Signed-off-by: Joerg Roedel commit a10660f7788bcb1229534cd1aa57a8f4b36cfe74 Author: Pascal Terjan Date: Sun May 10 20:30:16 2020 +0100 ACPI: Delete unused proc filename macros Those were used to create files in /proc/acpi long ago and were missed when that code was deleted. Signed-off-by: Pascal Terjan Signed-off-by: Rafael J. Wysocki commit 2909438d4d62681f392c57df4cd6b7183d19dde0 Author: Wang Wenhu Date: Wed May 13 07:18:54 2020 -0700 cpufreq: fix minor typo in struct cpufreq_driver doc comment Delete the duplicate "to", possibly double-typed. Signed-off-by: Wang Wenhu Signed-off-by: Rafael J. Wysocki commit 7a00e68b431716d9258cbf4dc72c307ac39e8733 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:32 2020 +0300 drm/i915/psr: Use new DP VSC SDP compute routine on PSR In order to use a common VSC SDP Colorimetry calculating code on PSR, it uses a new psr vsc sdp compute routine. Because PSR routine has its own scenario and timings of writing a VSC SDP, the current PSR routine needs to have its own drm_dp_vsc_sdp structure member variable on struct i915_psr. In order to calculate colorimetry information, intel_psr_update() function and intel_psr_enable() function extend a drm_connector_state argument. There are no changes to PSR mechanism. v3: Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp v4: Rebased v8: Rebased v10: When a PSR is enabled, it needs to add DP_SDP_VSC to infoframes.enable. It is needed for comparing between HW and pipe_state of VSC_SDP. v11: If PSR is disabled by flag, it don't enable psr on pipe compute. v12: Fix an inconsistent indenting Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Reported-by: kbuild test robot Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-15-gwan-gyeong.mun@intel.com commit cafac5a983619944afa639c53f0d5d885616a3d2 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:31 2020 +0300 drm/i915/dp: Add compute routine for DP PSR VSC SDP In order to use a common VSC SDP Colorimetry calculating code on PSR, it adds a compute routine for PSR VSC SDP. As PSR routine can not use infoframes.vsc of crtc state, it also adds new writing of DP SDPs (Secondary Data Packet) for PSR. PSR routine has its own scenario and timings of writing a VSC SDP. v3: Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp v4: Use struct drm_device logging macros v10: 1) Fix packing of VSC SDP where Pixel Encoding/Colorimetry Format is not supported. 2) Change a checking of PSR state. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-14-gwan-gyeong.mun@intel.com commit fa37a213275c6f80b8bc15189e28faeac948ba4c Author: Gwan-gyeong Mun Date: Thu May 14 09:07:30 2020 +0300 drm/i915: Stop sending DP SDPs on ddi disable Call intel_dp_set_infoframes(false) function on intel_ddi_post_disable_dp() to make sure not to send VSC SDP and HDR Metadata Infoframe SDP. v5: Polish commit message [Uma] Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-13-gwan-gyeong.mun@intel.com commit 76d45d0665d234d4bc7249160094cae5550d919f Author: Gwan-gyeong Mun Date: Thu May 14 09:07:29 2020 +0300 drm/i915: Program DP SDPs on pipe updates Call intel_dp_set_infoframes() function on pipe updates to make sure that we send VSC SDP and HDR Metadata Infoframe SDP (when applicable) on fastsets. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-12-gwan-gyeong.mun@intel.com commit ce58867ee17afecda7917e74a0d10afd7138c6d4 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:28 2020 +0300 drm/i915: Fix enabled infoframe states of lspcon Compared to implementation of DP and HDMI's encoder->infoframes_enabled, the lspcon's implementation returns its active state. (we expect enabled infoframe states of HW.) It leads to pipe state mismatch error when ddi_get_config is called. Because the current implementation of lspcon is not ready to support readout infoframes, we need to return 0 here. In order to support readout to lspcon, we need to implement read_infoframe and infoframes_enabled. And set_infoframes also have to set an appropriate bit on crtc_state->infoframes.enable Cc: Ville Syrjälä Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-11-gwan-gyeong.mun@intel.com commit 2c3928e4d87e37c5d2f778345e955b86c5cec9df Author: Gwan-gyeong Mun Date: Thu May 14 09:07:27 2020 +0300 drm/i915: Add state readout for DP VSC SDP Added state readout for DP VSC SDP and enabled state validation for DP VSC SDP. v2: Minor style fix v3: Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp v4: Use struct drm_device logging macros v10: Skip checking of VSC SDP when a crtc config has psr. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-10-gwan-gyeong.mun@intel.com commit dee66f3e071b394de16da18e2807f371b789b1be Author: Gwan-gyeong Mun Date: Thu May 14 09:07:26 2020 +0300 drm/i915: Add state readout for DP HDR Metadata Infoframe SDP Added state readout for DP HDR Metadata Infoframe SDP. v9: Rebased v10: Rebased Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-9-gwan-gyeong.mun@intel.com commit 1bf3657c03ddede977d3664792e78b4ed99452be Author: Gwan-gyeong Mun Date: Thu May 14 09:07:25 2020 +0300 drm/i915: Program DP SDPs with computed configs In order to use computed config for DP SDPs (DP VSC SDP and DP HDR Metadata Infoframe SDP), it replaces intel_dp_vsc_enable() function and intel_dp_hdr_metadata_enable() function to intel_dp_set_infoframes() function. And it removes unused functions. Before: intel_dp_vsc_enable() and intel_dp_hdr_metadata_enable() compute sdp configs and program sdp registers on enable callback of encoder. After: It separates computing of sdp configs and programming of sdp register. The compute config callback of encoder calls computing sdp configs. The enable callback of encoder calls programming sdp register. v3: Rebased v5: Polish commit message [Uma] v10: Rebased Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-8-gwan-gyeong.mun@intel.com commit 42890250d0ec79ff60b5084c93ff63fcdeffc5d0 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:24 2020 +0300 drm/i915: Include DP VSC SDP in the crtc state dump Dump out the DP VSC SDP in the normal crtc state dump v3: Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp Use drm core's DP VSC SDP logging function Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-7-gwan-gyeong.mun@intel.com commit e274fb32ffc8508408c3a4d65931d9fdd08f2c89 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:23 2020 +0300 drm/i915: Include DP HDR Metadata Infoframe SDP in the crtc state dump Dump out the DP HDR Metadata Infoframe SDP in the normal crtc state dump. HDMI Dynamic Range and Mastering (DRM) infoframe and DP HDR Metadata Infoframe SDP use the same member variable in infoframes of crtc state. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-6-gwan-gyeong.mun@intel.com commit bfbeba29b9bc65c2fbe3b130d5ce0d096f487eb4 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:22 2020 +0300 drm/i915: Include HDMI DRM infoframe in the crtc state dump Dump out the HDMI Dynamic Range and Mastering (DRM) infoframe in the normal crtc state dump. Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-5-gwan-gyeong.mun@intel.com commit 2ba6221cca7e25bd05a416b0e64afb6a5b28dc9b Author: Gwan-gyeong Mun Date: Thu May 14 09:07:21 2020 +0300 drm: Add logging function for DP VSC SDP When receiving video it is very useful to be able to log DP VSC SDP. This greatly simplifies debugging. v2: Minor style fix v3: Move logging functions to drm core [Jani N] v5: Rebased v10: Rebased Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Acked-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-4-gwan-gyeong.mun@intel.com commit 1b404b7dbb100cd5d94b95bf86d8d92c31108b49 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:20 2020 +0300 drm/i915/dp: Read out DP SDPs It adds code to read the DP SDPs from the video DIP and unpack them into the crtc state. It adds routines that read out DP VSC SDP and DP HDR Metadata Infoframe SDP In order to unpack DP VSC SDP, it adds intel_dp_vsc_sdp_unpack() function. It follows DP 1.4a spec. [Table 2-116: VSC SDP Header Bytes] and [Table 2-117: VSC SDP Payload for DB16 through DB18] In order to unpack DP HDR Metadata Infoframe SDP, it adds intel_dp_hdr_metadata_infoframe_sdp_unpack(). And it follows DP 1.4a spec. ([Table 2-125: INFOFRAME SDP v1.2 Header Bytes] and [Table 2-126: INFOFRAME SDP v1.2 Payload Data Bytes - DB0 through DB31]) and CTA-861-G spec. [Table-42 Dynamic Range and Mastering InfoFrame]. A naming rule and style of intel_read_dp_sdp() function references intel_read_infoframe() function of intel_hdmi.c v2: Minor style fix v3: Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp v4: Use struct drm_device logging macros v5: Addressed review comments from Uma - Polish commit message and comments - Combine the if checks of sdp.HB2 and sdp.HB3 - Add 6bpc to unpacking of VSC SDP Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-3-gwan-gyeong.mun@intel.com commit f45ce9336ff0640e491c642a84ea02f21daac3a4 Author: Gwan-gyeong Mun Date: Thu May 14 09:07:19 2020 +0300 video/hdmi: Add Unpack only function for DRM infoframe It adds an unpack only function for DRM infoframe for dynamic range and mastering infoframe readout. It unpacks the information data block contained in the binary buffer into a structured frame of the HDMI Dynamic Range and Mastering (DRM) information frame. In contrast to hdmi_drm_infoframe_unpack() function, it does not verify a checksum. It can be used for unpacking a DP HDR Metadata Infoframe SDP case. DP HDR Metadata Infoframe SDP uses the same Dynamic Range and Mastering (DRM) information (CTA-861-G spec.) such as HDMI DRM infoframe. But DP SDP header and payload structure are different from HDMI DRM Infoframe. Therefore unpacking DRM infoframe for DP requires skipping of a verifying checksum. v9: Add clear comments to hdmi_drm_infoframe_unpack_only() and hdmi_drm_infoframe_unpack() (Laurent Pinchart) Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Cc: Laurent Pinchart Cc: Ville Syrjala Acked-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200514060732.3378396-2-gwan-gyeong.mun@intel.com commit 1a6e55ca8f3684d7e1fe646396303233bf1c1ed7 Author: Geert Uytterhoeven Date: Wed May 6 14:02:04 2020 +0200 soc: mediatek: mmsys: Drop After the split, the mt8173 MMSYS driver is no longer a clock provider, and thus does not need to include . Fixes: 13032709e2328553 ("clk / soc: mediatek: Move mt8173 MMSYS to platform driver") Signed-off-by: Geert Uytterhoeven Reviewed-by: Enric Balletbo i Serra Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200506120204.31422-1-geert+renesas@glider.be Signed-off-by: Matthias Brugger commit 0f4013fb28ec00986f3934bc6c7d0c2a0eec695c Author: Chris Wilson Date: Wed May 13 08:47:46 2020 +0100 drm/i915/gt: Transfer old virtual breadcrumbs to irq_worker The second try at staging the transfer of the breadcrumb. In part one, we realised we could not simply move to the second engine as we were only holding the breadcrumb lock on the first. So in commit 6c81e21a4742 ("drm/i915/gt: Stage the transfer of the virtual breadcrumb"), we removed it from the first engine and marked up this request to reattach the signaling on the new engine. However, this failed to take into account that we only attach the breadcrumb if the new request is added at the start of the queue, which if we are transferring, it is because we know there to be a request to be signaled (and hence we would not be attached). In this attempt, we try to transfer the completed requests to the irq_worker on its rq->engine->breadcrumbs. This preserves the coupling between the rq and its breadcrumbs, so that i915_request_cancel_breadcrumb() does not attempt to manipulate the list under the wrong lock. v2: Code sharing is fun. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1862 Fixes: 6c81e21a4742 ("drm/i915/gt: Stage the transfer of the virtual breadcrumb") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200513074809.18194-1-chris@chris-wilson.co.uk commit 12a87174accd29ff943d4c5fb735e1541b92630b Author: Lorenzo Bianconi Date: Wed May 13 15:53:04 2020 +0200 mt76: mt7615: fix typo defining ps work Fix typo defining ps_work in mt7615_register_ext_phy(). This is not a real issue since 802.11 power save is not yet support by the external phy Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit ed610f43606efd390ecd334d725beb5f2cf53104 Author: Chris Wilson Date: Wed May 13 08:48:01 2020 +0100 drm/i915/selftests: Always call the provided engine->emit_init_breadcrumb While this does not appear to fix any issues, the backend itself knows when it wants to emit a breadcrumb, so let it make the final call. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200513074809.18194-16-chris@chris-wilson.co.uk commit 7a0ba6b43bc0b0078df5504393fd3966a5c7e808 Author: Chris Wilson Date: Thu May 14 07:29:05 2020 +0100 drm/i915: Show per-engine default property values in sysfs By providing the default values configured into the kernel via sysfs, it is much more convenient for userspace to restore those sane defaults, or at least know what are considered good baseline. This is useful, for example, to cleanup after any failed userspace prior to commencing new jobs. /sys/class/drm/card0/engine/rcs0/ ├── capabilities ├── class ├── .defaults │   ├── heartbeat_interval_ms │   ├── max_busywait_duration_ns │   ├── preempt_timeout_ms │   ├── stop_timeout_ms │   └── timeslice_duration_ms ├── heartbeat_interval_ms ├── instance ├── known_capabilities ├── max_busywait_duration_ns ├── mmio_base ├── name ├── preempt_timeout_ms ├── stop_timeout_ms └── timeslice_duration_ms Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Reviewed-by: Maciej Patelczyk Link: https://patchwork.freedesktop.org/patch/msgid/20200514062905.28668-1-chris@chris-wilson.co.uk commit 18e4af04d2183e99e6808f55dcef30f66ac0b155 Author: Chris Wilson Date: Wed May 13 18:35:04 2020 +0100 drm/i915: Drop no-semaphore boosting Now that we have fast timeslicing on semaphores, we no longer need to prioritise none-semaphore work as we will yield any work blocked on a semaphore to the next in the queue. Previously with no timeslicing, blocking on the semaphore caused extremely bad scheduling with multiple clients utilising multiple rings. Now, there is no impact and we can remove the complication. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200513173504.28322-1-chris@chris-wilson.co.uk commit 80c9b58e9503f33a707a23172b2dd8d015b8c036 Merge: 49eea1c6573a 7982471d01aa Author: Dave Airlie Date: Thu May 14 13:41:42 2020 +1000 Merge tag 'du-next-20200514' of git://linuxtv.org/pinchartl/media into drm-next R-Car Display Unit & related changes: - DT bindings conversion to YAML - Planes zpos sanity check and fix - MAINTAINERS entry for LVDS panel driver Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20200514012844.GA7196@pendragon.ideasonboard.com commit 49eea1c6573a6e31d79783c716b9001c968e5662 Merge: a1fb54896239 37e4f052cc97 Author: Dave Airlie Date: Thu May 14 13:21:30 2020 +1000 Merge tag 'amd-drm-next-5.8-2020-05-12' of git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-next-5.8-2020-05-12: amdgpu: - Misc cleanups - RAS fixes - Expose FP16 for modesetting - DP 1.4 compliance test fixes - Clockgating fixes - MAINTAINERS update - Soft recovery for gfx10 - Runtime PM cleanups - PSP code cleanups amdkfd: - Track GPU memory utilization per process - Report PCI domain in topology Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200512213703.4039-1-alexander.deucher@amd.com commit a1fb548962397bb8609bb46e566809a9a1b30044 Merge: 3fd911b69b31 230982d8d8df Author: Dave Airlie Date: Thu May 14 11:33:09 2020 +1000 Merge tag 'drm-intel-next-2020-04-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Driver Changes: - Fix GitLab #1698: Performance regression with Linux 5.7-rc1 on Iris Plus 655 and 4K screen (Chris) - Add Wa_14011059788 for Tigerlake (Matt A) - Add per ctx batchbuffer wa for timestamp for Gen12 (Mika) - Use indirect ctx bb to load cmd buffer control value from context image to avoid corruption (Mika) - Enable DP Display Audio WA (Uma, Jani) - Update forcewake firmware ranges for Icelake (Radhakrishna) - Add missing deinitialization cases of load failure for display (Jose) - Implement TC cold sequences for Icelake and Tigerlake (Jose) - Unbreak enable_dpcd_backlight modparam (Lyude) - Move the late flush_submission in retire to the end (Chris) - Demote "Reducing compressed framebufer size" message to info (Peter) - Push MST link retraining to the hotplug work (Ville) - Hold obj->vma.lock over for_each_ggtt_vma() (Chris) - Fix timeout handling during TypeC AUX power well enabling for ICL (Imre) - Fix skl+ non-scaled pfit modes (Ville) - Prefer soft-rc6 over RPS DOWN_TIMEOUT (Chris) - Sanitize GT first before poisoning HWSP (Chris) - Fix up clock RPS frequency readout (Chris) - Avoid reusing the same logical CCID (Chris) - Avoid dereferencing a dead context (Chris) - Always enable busy-stats for execlists (Chris) - Apply the aggressive downclocking to parking (Chris) - Restore aggressive post-boost downclocking (Chris) - Scrub execlists state on resume (Chris) - Add debugfs attributes for LPSP (Ansuman) - Improvements to kernel selftests (Chris, Mika) - Add tiled blits selftest (Zbigniew) - Fix error handling in __live_lrc_indirect_ctx_bb() (Dan) - Add pre/post plane updates for SAGV (Stanislav) - Add ICL PG3 PW ID for EHL (Anshuman) - Fix Sphinx build duplicate label warning (Jani) - Error log non-zero audio power refcount after unbind (Jani) - Remove object_is_locked assertion from unpin_from_display_plane (Chris) - Use single set of AUX powerwell ops for gen11+ (Matt R) - Prefer drm_WARN_ON over WARN_ON (Pankaj) - Poison residual state [HWSP] across resume (Chris, Tvrtko) - Convert request-before-CS assertion to debug (Chris) - Carefully order virtual_submission_tasklet (Chris) - Check carefully for an idle engine in wait-for-idle (Chris) - Only close vma we open (Chris) - Trace RPS events (Chris) - Use the RPM config register to determine clk frequencies (Chris) - Drop rq->ring->vma peeking from error capture (Chris) - Check preempt-timeout target before submit_ports (Chris) - Check HWSP cacheline is valid before acquiring (Chris) - Use proper fault mask in interrupt postinstall too (Matt R) - Keep a no-frills swappable copy of the default context state (Chris) - Add atomic helpers for bandwidth (Stanislav) - Refactor setting dma info to a common helper from device info (Michael) - Refactor DDI transcoder code for clairty (Ville) - Extend PG3 power well ID to ICL (Anshuman) - Refactor PFIT code for readability and future extensibility (Ville) - Clarify code split between intel_ddi.c and intel_dp.c (Ville) - Move out code to return the digital_port of the aux ch (Jose) - Move rps.enabled/active and use of RPS interrupts to flags (Chris) - Remove superfluous inlines and dead code (Jani) - Re-disable -Wframe-address from top-level Makefile (Nick) - Static checker and spelling fixes (Colin, Nathan) - Split long lines (Ville) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200430124904.GA100924@jlahtine-desk.ger.corp.intel.com commit 7982471d01aac33994276bf567c8f1f3a137648a Author: Tomohito Esaki Date: Wed Apr 1 15:11:00 2020 +0900 drm: rcar-du: Set primary plane zpos immutably at initializing According to drm_plane_create_zpos_property() function documentation, all planes zpos range should be set if zpos property is supported. However, the rcar-du driver didn't set primary plane zpos range. Since the primary plane's zpos is fixed, set it immutably. Reported-by: Yoshihito Ogawa Reported-by: Koji Matsuoka Signed-off-by: Tomohito Esaki Reviewed-by: Laurent Pinchart Reviewed-by: Daniel Stone [Turn continue into if ... else ...] Signed-off-by: Laurent Pinchart commit 4dc55525b09514737bb17eb437b2f4d3c6740d8a Author: Laurent Pinchart Date: Sat Apr 4 20:43:01 2020 +0300 drm: plane: Verify that no or all planes have a zpos property The zpos property is used by userspace to sort the order of planes. While the property is not mandatory for drivers to implement, mixing planes with and without zpos confuses userspace, and shall not be allowed. Clarify this in the documentation and warn at runtime if the drivers mixes planes with and without zpos properties. Signed-off-by: Laurent Pinchart Acked-by: Sam Ravnborg Reviewed-by: Daniel Vetter commit 07de3d31f15fdc51c3b9c30e347573499cf08aeb Author: Laurent Pinchart Date: Wed Apr 5 09:43:17 2017 +0300 drm: panels: Add MAINTAINERS entry for LVDS panel driver As the DRM LVDS panel driver uses a different approach to DT bindings compared to what Thierry Reding advocates, add a specific MAINTAINERS entry to avoid bothering Thierry with requests related to that driver. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Vetter commit 1accbeca3e1f123370c50fbc6de60234ee81829c Author: Geert Uytterhoeven Date: Fri Feb 14 09:26:23 2020 +0100 dt-bindings: display: renesas: du: Document optional reset properties Document the optional properties for describing module resets, to support resetting display channels on R-Car Gen2 and Gen3. Signed-off-by: Geert Uytterhoeven Acked-by: Laurent Pinchart Acked-by: Rob Herring Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart commit c51d58da9daf865197f5a0ab5d758b2738133137 Author: Laurent Pinchart Date: Sat Apr 4 21:50:39 2020 +0300 dt-bindings: display: bridge: thc63lvd1024: Convert binding to YAML Convert the Thine THC63LVD1024 text binding to YAML. Signed-off-by: Laurent Pinchart Acked-by: Maxime Ripard Reviewed-by: Jacopo Mondi Reviewed-by: Rob Herring commit 18a02062e37246a9309bcdbc6cb1932be0b5c167 Author: Laurent Pinchart Date: Sat Apr 4 21:50:39 2020 +0300 dt-bindings: display: bridge: Convert simple-bridge bindings to YAML The simple-bridge driver supports multiple simple or dumb bridges, covered by different compatible strings but otherwise identical DT bindings. Some of those bridges have undocumented bindings, while others are documented in text form in separate files. Group them all in a single binding and convert it to YAML. The psave-gpios property of the adi,adv7123 is dropped, as it isn't supported by the driver and isn't specified in any DT file upstream. Support for power saving is available through the enable-gpios property that should cover all the needs of the ADV7123 (as the device only has a /PSAVE pin and no enable pin). Signed-off-by: Laurent Pinchart Acked-by: Maxime Ripard Reviewed-by: Rob Herring commit 82e0e5fe8e41f99ea61c63724d1ee4f585c7dab5 Author: Laurent Pinchart Date: Sat Apr 4 21:50:39 2020 +0300 dt-bindings: display: bridge: Reject additional properties in ports node Document the #address-cells and #size-cells properties of the ports node in the schemas of the bridge DT bindings, and set additionalProperties to false to reject additional properties. Signed-off-by: Laurent Pinchart Acked-by: Maxime Ripard Acked-by: Rob Herring commit fcdf818d239ee38c258a2ad56f9e49834d23f402 Merge: 9ef391bdc29f 117e2cb3eeee Author: David S. Miller Date: Wed May 13 15:35:58 2020 -0700 Merge branch 'sparc-scnprintf' Chen Zhou says: ==================== sparc: use scnprintf() in show() methods snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show() methods should return the number of bytes printed into the buffer. This is the return value of scnprintf(). ==================== Signed-off-by: David S. Miller commit 117e2cb3eeee2940ba581d104951f6207cb46ce5 Author: Chen Zhou Date: Sat May 9 17:18:49 2020 +0800 sparc: use scnprintf() in show_pciobppath_attr() in vio.c snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show_pciobppath_attr() should return the number of bytes printed into the buffer. This is the return value of scnprintf(). Signed-off-by: Chen Zhou Signed-off-by: David S. Miller commit 03a1b56f501ef4f8c54cb89a5f5ed7cc9ccac38f Author: Chen Zhou Date: Sat May 9 17:18:48 2020 +0800 sparc: use scnprintf() in show_pciobppath_attr() in pci.c snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show_pciobppath_attr() should return the number of bytes printed into the buffer. This is the return value of scnprintf(). Signed-off-by: Chen Zhou Signed-off-by: David S. Miller commit 9ef391bdc29f0570c2be578210e220d15ea7a453 Author: Wei Yongjun Date: Mon Apr 27 13:22:20 2020 +0000 tty: vcc: Fix error return code in vcc_probe() Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 508578f2f5601816ea29bec5cda00ea7d95a856d Author: Nishad Kamdar Date: Tue May 12 16:54:17 2020 -0700 xfs: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to XFS File System support. For C header files Documentation/process/license-rules.rst mandates C-like comments. (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ee4064e56cd81cd3126805159122f53cf4f12ae6 Author: Gustavo A. R. Silva Date: Tue May 12 16:36:47 2020 -0700 xfs: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 237aac4624aac5d46b903539e91c8d4567a2bab5 Author: Zheng Bin Date: Tue May 12 11:48:35 2020 -0700 xfs: ensure f_bfree returned by statfs() is non-negative Construct an img like this: dd if=/dev/zero of=xfs.img bs=1M count=20 mkfs.xfs -d agcount=1 xfs.img xfs_db -x xfs.img sb 0 write fdblocks 0 agf 0 write freeblks 0 write longest 0 quit mount it, df -h /mnt(xfs mount point), will show this: Filesystem Size Used Avail Use% Mounted on /dev/loop0 17M -64Z -32K 100% /mnt Reported-by: Hulk Robot Signed-off-by: Zheng Bin Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a012c1e866a65699c806ae4a35d267de29fe85e7 Merge: 24085f70a6e1 8c8f3156dd40 Author: David S. Miller Date: Wed May 13 15:32:00 2020 -0700 Merge branch 'Rework-sparc32-page-table-layout' Will Deacon says: ==================== Rework sparc32 page-table layout This is a reposting of the patch series I sent previously to rework the sparc32 page-table layout so that 'pmd_t' can be used safely with READ_ONCE(): https://lore.kernel.org/lkml/20200324104005.11279-1-will@kernel.org This is blocking the READ_ONCE() rework, which in turn allows us to bump the minimum GCC version for building the kernel up to 4.8. ==================== Signed-off-by: David S. Miller commit 8c8f3156dd40f8bdc58f2ac461374bc804c28e3b Author: Will Deacon Date: Tue Apr 14 22:40:11 2020 +0100 sparc32: mm: Reduce allocation size for PMD and PTE tables Now that the page table allocator can free page table allocations smaller than PAGE_SIZE, reduce the size of the PMD and PTE allocations to avoid needlessly wasting memory. Cc: "David S. Miller" Cc: Peter Zijlstra Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit 3f407976ac2953116cb8880a7a18b63bcc81829d Author: Will Deacon Date: Tue Apr 14 22:40:10 2020 +0100 sparc32: mm: Change pgtable_t type to pte_t * instead of struct page * Change the 'pgtable_t' type for sparc32 so that it represents the uncached virtual address of the PTE table, rather than the underlying 'struct page'. This allows us to free page table allocations smaller than a page. Cc: "David S. Miller" Cc: Peter Zijlstra Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit 8e958839e4b9fb6ea4385ff2c52d1333a3a618de Author: Will Deacon Date: Tue Apr 14 22:40:09 2020 +0100 sparc32: mm: Restructure sparc32 MMU page-table layout The "SRMMU" supports 4k pages using a fixed three-level walk with a 256-entry PGD and 64-entry PMD/PTE levels. In order to fill a page with a 'pgtable_t', the SRMMU code allocates four native PTE tables into a single PTE allocation and similarly for the PMD level, leading to an array of 16 physical pointers in a 'pmd_t' This breaks the generic code which assumes READ_ONCE(*pmd) will be word sized. In a manner similar to ef22d8abd876 ("m68k: mm: Restructure Motorola MMU page-table layout"), this patch implements the native page-table setup directly. This significantly increases the page-table memory overhead, but will be addresses in a subsequent patch. Cc: "David S. Miller" Cc: Peter Zijlstra Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit ed894bf5a76357eb92045c79d6ae2f29814c6183 Author: Will Deacon Date: Tue Apr 14 22:40:08 2020 +0100 sparc32: mm: Fix argument checking in __srmmu_get_nocache() The 'size' argument to __srmmu_get_nocache() is a number of bytes not a shift value, so fix up the sanity checking to treat it properly. Cc: "David S. Miller" Cc: Peter Zijlstra Signed-off-by: Will Deacon Signed-off-by: David S. Miller commit b6b6c318006b680a467451846aea65397074c59d Author: Zou Wei Date: Thu Apr 30 11:19:36 2020 +0800 KVM: MIPS/Emulate: Remove unneeded semicolon Fixes coccicheck warnings: arch/mips/kvm/emulate.c:1793:3-4: Unneeded semicolon arch/mips/kvm/emulate.c:1968:3-4: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 8d34509742f9ef09c6deff8dd68f4af262215153 Author: Zou Wei Date: Thu Apr 30 11:14:50 2020 +0800 KVM: MIPS/VZ: Remove unneeded semicolon Fixes coccicheck warnings: arch/mips/kvm/vz.c:1186:4-5: Unneeded semicolon arch/mips/kvm/vz.c:1195:3-4: Unneeded semicolon arch/mips/kvm/vz.c:1949:3-4: Unneeded semicolon arch/mips/kvm/vz.c:1121:2-3: Unneeded semicolon arch/mips/kvm/vz.c:2188:3-4: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 7ff1f6264f9ca1532fe1ac8e324efbc439052f54 Author: Jason Yan Date: Tue Apr 28 14:32:45 2020 +0800 KVM: MIPS/TLB: Remove Unneeded semicolon in tlb.c Fix the following coccicheck warning: arch/mips/kvm/tlb.c:472:2-3: Unneeded semicolon arch/mips/kvm/tlb.c:489:2-3: Unneeded semicolon Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit 04146f22cb47b84faff62f9a1ce6165b4a1be5cb Author: Jason Yan Date: Wed Apr 29 22:09:35 2020 +0800 KVM: MIPS: use true,false for bool variable Fix the following coccicheck warning: arch/mips/kvm/mips.c:82:1-28: WARNING: Assignment of 0/1 to bool variable arch/mips/kvm/mips.c:88:1-28: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit d203c2d3eed5a6f1d617591335ccef7b1926461b Author: Lars Povlsen Date: Wed May 13 15:23:47 2020 +0200 MIPS: dts: mscc: Updated changed name for miim pinctrl function This is an add-on patch to the main SoC Sparx5 series (Message-ID: <20200513125532.24585-1-lars.povlsen@microchip.com>). This changes the miim pinctrl function name from "miim1" to "miim" due to refactoring in the driver, obsoleting the instance number. The change in the driver was to better fit new platforms, as the instance number is redundant information. Specifically, support for the Microchip Sparx5 SoC is being submitted, where this change became necessary. Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen Acked-by: Alexandre Belloni Signed-off-by: Thomas Bogendoerfer commit 38152ea37d8bdaffa22603e0a5b5b86cfa8714c9 Author: DENG Qingfang Date: Wed May 13 23:37:17 2020 +0800 net: dsa: mt7530: set CPU port to fallback mode Currently, setting a bridge's self PVID to other value and deleting the default VID 1 renders untagged ports of that VLAN unable to talk to the CPU port: bridge vlan add dev br0 vid 2 pvid untagged self bridge vlan del dev br0 vid 1 self bridge vlan add dev sw0p0 vid 2 pvid untagged bridge vlan del dev sw0p0 vid 1 # br0 cannot send untagged frames out of sw0p0 anymore That is because the CPU port is set to security mode and its PVID is still 1, and untagged frames are dropped due to VLAN member violation. Set the CPU port to fallback mode so untagged frames can pass through. Fixes: 83163f7dca56 ("net: dsa: mediatek: add VLAN support for MT7530") Signed-off-by: DENG Qingfang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5e3768a436bb70c9c3e27aaba6b73f8ef8f5dcf3 Author: Daniel González Cabanelas Date: Tue May 12 19:59:48 2020 +0200 net: mvneta: speed down the PHY, if WoL used, to save energy Some PHYs connected to this ethernet hardware support the WoL feature. But when WoL is enabled and the machine is powered off, the PHY remains waiting for a magic packet at max speed (i.e. 1Gbps), which is a waste of energy. Slow down the PHY speed before stopping the ethernet if WoL is enabled, and save some energy while the machine is powered off or sleeping. Tested using an Armada 370 based board (LS421DE) equipped with a Marvell 88E1518 PHY. Signed-off-by: Daniel González Cabanelas Signed-off-by: David S. Miller commit 6545be82807cc01712411321730656ad8ad30474 Author: Colin Ian King Date: Tue May 12 18:13:55 2020 +0100 sfc: fix dereference of table before it is null checked Currently pointer table is being dereferenced on a null check of table->must_restore_filters before it is being null checked, leading to a potential null pointer dereference issue. Fix this by null checking table before dereferencing it when checking for a null table->must_restore_filters. Addresses-Coverity: ("Dereference before null check") Fixes: e4fe938cff04 ("sfc: move 'must restore' flags out of ef10-specific nic_data") Signed-off-by: Colin Ian King Acked-by: Edward Cree Signed-off-by: David S. Miller commit 6ec26b8b2d70b41d7c2affd8660d94ce78b3823c Author: Christoph Hellwig Date: Fri May 8 18:15:17 2020 +0200 nvdimm/pmem: stop using ->queuedata In preparation for removing queuedata as an argument to make_request_fn() drop the dependency ->queuedata. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20200508161517.252308-16-hch@lst.de Signed-off-by: Dan Williams commit 5713bcc3fd2b0780418b20a7877195758d498b81 Author: Christoph Hellwig Date: Fri May 8 18:15:16 2020 +0200 nvdimm/btt: stop using ->queuedata In preparation for removing queuedata as an argument to make_request_fn() drop the dependency ->queuedata. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20200508161517.252308-15-hch@lst.de Signed-off-by: Dan Williams commit daa28975dd4971b4352f5e7df75728096048da52 Author: Christoph Hellwig Date: Fri May 8 18:15:15 2020 +0200 nvdimm/blk: stop using ->queuedata In preparation for removing queuedata as an argument to make_request_fn() drop the dependency ->queuedata. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20200508161517.252308-14-hch@lst.de Signed-off-by: Dan Williams commit b3d6fd8f25a52af8ff6bafdc3d29523b39a99d5e Author: Michael Srba Date: Wed May 13 20:47:35 2020 +0200 arm64: dts: qcom: msm8916: Disable coresight by default On some msm8916 devices, attempts at initializing coresight cause the boot to fail. This was fixed by disabling the coresight-related nodes in the board dts files. However, a cleaner approach was chosen for fixing the same issue on msm8998: disabling coresight by default, and enabling it in board dts files where desired. This patch implements the same solution for msm8916, removes now redundant overwrites in board specific dts files and and enables coresight in db410c's board dts in order to keep the current behavior. Fixes: b1fcc5702a41 ("arm64: dts: qcom: msm8916: Add CTI options") Signed-off-by: Michael Srba Reviewed-by: Jeffrey Hugo Link: https://lore.kernel.org/r/20200513184735.30104-1-michael.srba@seznam.cz Signed-off-by: Bjorn Andersson commit 8fd2b980a298bc083e6067aefeb083f96c236a22 Merge: 91bf5ec3421d 358369f03ac9 Author: Jens Axboe Date: Wed May 13 15:17:01 2020 -0600 Merge branch 'md-next' of git://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.8/drivers Pull MD changes from Song. * 'md-next' of git://git.kernel.org/pub/scm/linux/kernel/git/song/md: md/raid1: Replace zero-length array with flexible-array md: add a newline when printing parameter 'start_ro' by sysfs md: stop using ->queuedata md/raid1: release pending accounting for an I/O only after write-behind is also finished md: remove redundant memalloc scope API usage raid5: update code comment of scribble_alloc() raid5: remove gfp flags from scribble_alloc() md: use memalloc scope APIs in mddev_suspend()/mddev_resume() md: remove the extra line for ->hot_add_disk md: flush md_rdev_misc_wq for HOT_ADD_DISK case md: don't flush workqueue unconditionally in md_open md: add new workqueue for delete rdev md: add checkings before flush md_misc_wq commit 6cb7576710aea4dfd11449b4f514a03cd9f03505 Author: Michael Walle Date: Wed May 13 22:38:07 2020 +0200 net: phy: at803x: add cable diagnostics support The AR8031/AR8033 and the AR8035 support cable diagnostics. Adding driver support is straightforward, so lets add it. The PHY just do one pair at a time, so we have to start the test four times. The cable_test_get_status() can block and therefore we can just busy poll the test completion and continue with the next pair until we are done. The time delta counter seems to run at 125MHz which just gives us a resolution of about 82.4cm per tick. 100m cable, A/B/C/D open: Cable test started for device eth0. Cable test completed for device eth0. Pair: Pair A, result: Open Circuit Pair: Pair A, fault length: 107.94m Pair: Pair B, result: Open Circuit Pair: Pair B, fault length: 104.64m Pair: Pair C, result: Open Circuit Pair: Pair C, fault length: 105.47m Pair: Pair D, result: Open Circuit Pair: Pair D, fault length: 107.94m 1m cable, A/B connected, C shorted, D open: Cable test started for device eth0. Cable test completed for device eth0. Pair: Pair A, result: OK Pair: Pair B, result: OK Pair: Pair C, result: Short within Pair Pair: Pair C, fault length: 0.82m Pair: Pair D, result: Open Circuit Pair: Pair D, fault length: 0.82m Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 701f026521980dd0151130f818558e17c608ed2e Author: Chris Wilson Date: Wed May 13 08:47:59 2020 +0100 drm/i915: Drop I915_RESET_TIMEOUT and friends These were used to set various timeouts for the reset procedure (deciding when the engine was dead, and even if the reset itself was not making forward progress). No longer used. Signed-off-by: Chris Wilson Reviewed-by: Maciej Patelczyk Link: https://patchwork.freedesktop.org/patch/msgid/20200513074809.18194-14-chris@chris-wilson.co.uk commit 1b2f08df0a886e0565c71821d5230cba395f5c18 Author: Christoph Hellwig Date: Wed May 13 21:36:41 2020 +0200 ipv6: set msg_control_is_user in do_ipv6_getsockopt While do_ipv6_getsockopt does not call the high-level recvmsg helper, the msghdr eventually ends up being passed to put_cmsg anyway, and thus needs msg_control_is_user set to the proper value. Fixes: 1f466e1f15cf ("net: cleanly handle kernel vs user buffers for ->msg_control") Reported-by: Eric Dumazet Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 795d4d7fa34154fc621c1048f8b92e4f6bd3926f Author: Chris Wilson Date: Wed May 13 17:59:32 2020 +0100 drm/i915: Mark the addition of the initial-breadcrumb in the request The initial-breadcrumb is used to mark the end of the awaiting and the beginning of the user payload. We verify that we do not start the user payload before all signaler are completed, checking our semaphore setup by looking for the initial breadcrumb being written too early. We also want to ensure that we do not add semaphore waits after we have already closed the semaphore section, an issue for later deferred waits. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200513165937.9508-2-chris@chris-wilson.co.uk commit 87f785e96218247ed47107792c20f3d86778da4b Merge: ea13d71887bd f956af3fd474 Author: David S. Miller Date: Wed May 13 12:52:39 2020 -0700 Merge branch 'net-phy-broadcom-cable-tester-support' Michael Walle says: ==================== net: phy: broadcom: cable tester support Add cable tester support for the Broadcom PHYs. Support for it was developed on a BCM54140 Quad PHY which RDB register access. If there is a link partner the results are not as good as with an open cable. I guess we could retry if the measurement until all pairs had at least one valid result. changes since v1: - added Reviewed-by: tags - removed "div by 2" for cross shorts, just mention it in the commit message. The results are inconclusive if the tests are repeated. So just report the length as is for now. - fixed typo in commit message ==================== Signed-off-by: David S. Miller commit f956af3fd474c1f47332920abd656cd713febe3f Author: Michael Walle Date: Wed May 13 18:35:24 2020 +0200 net: phy: bcm54140: add cable diagnostics support Use the generic cable tester functions from bcm-phy-lib to add cable tester support. 100m cable, A/B/C/D open: Cable test started for device eth0. Cable test completed for device eth0. Pair: Pair A, result: Open Circuit Pair: Pair B, result: Open Circuit Pair: Pair C, result: Open Circuit Pair: Pair D, result: Open Circuit Pair: Pair A, fault length: 106.60m Pair: Pair B, fault length: 103.32m Pair: Pair C, fault length: 104.96m Pair: Pair D, fault length: 106.60m 1m cable, A/B connected, pair C shorted, D open: Cable test started for device eth0. Cable test completed for device eth0. Pair: Pair A, result: OK Pair: Pair B, result: OK Pair: Pair C, result: Short within Pair Pair: Pair D, result: Open Circuit Pair: Pair C, fault length: 0.82m Pair: Pair D, fault length: 1.64m 1m cable, A/B connected, pair C shorted with D: Cable test started for device eth0. Cable test completed for device eth0. Pair: Pair A, result: OK Pair: Pair B, result: OK Pair: Pair C, result: Short to another pair Pair: Pair D, result: Short to another pair Pair: Pair C, fault length: 1.64m Pair: Pair D, fault length: 1.64m The granularity of the length measurement seems to be 82cm. Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 11ecf8c55b91806e4dc6a1b9fe7cbf68cdc9b006 Author: Michael Walle Date: Wed May 13 18:35:23 2020 +0200 net: phy: broadcom: add cable test support Most modern broadcom PHYs support ECD (enhanced cable diagnostics). Add support for it in the bcm-phy-lib so they can easily be used in the PHY driver. There are two access methods for ECD: legacy by expansion registers and via the new RDB registers which are exclusive. Provide functions in two variants where the PHY driver can choose from. To keep things simple for now, we just switch the register access to expansion registers in the RDB variant for now. On the flipside, we have to keep a bus lock to prevent any other non-legacy access on the PHY. The results of the intra-pair tests are inconclusive (at least for the BCM54140). Most of the times half the length is reported but sometimes the length is correct. Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit e184a9072f8995e78ad6cef48bfeab2b987945ec Author: Michael Walle Date: Wed May 13 18:35:22 2020 +0200 net: phy: broadcom: add bcm_phy_modify_exp() Add the convenience function to do a read-modify-write. This has the additional benefit of saving one write to the selection register. Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 7d7e7bce768b9e21eb1b741a901c19c2bef1cccc Author: Michael Walle Date: Wed May 13 18:35:21 2020 +0200 net: phy: broadcom: add exp register access methods without buslock Add helper to read and write expansion registers without taking the mdio lock. Please note, that this changes the semantics of the read and write. Before there was no lock between selecting the expansion register and the actual read/write. This may lead to access failures if there are parallel accesses. Instead take the bus lock during the whole access cycle. Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit ea13d71887bd589d2f08ca74a3e1961dd68b678d Author: Oleksij Rempel Date: Wed May 13 14:34:40 2020 +0200 net: phy: tja11xx: add cable-test support Add initial cable testing support. This PHY needs only 100usec for this test and it is recommended to run it before the link is up. For now, provide at least ethtool support, so it can be tested by more developers. This patch was tested with TJA1102 PHY with following results: - No cable, is detected as open - 1m cable, with no connected other end and detected as open - a 40m cable (out of spec, max lenght should be 15m) is detected as OK. Current patch do not provide polarity test support. This test would indicate not proper wire connection, where "+" wire of main phy is connected to the "-" wire of the link partner. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 8f4605ac3e64cbb929df1fa09d5c6cdf3f195e7b Merge: 0aa0372f9229 03421a92f562 Author: Alexei Starovoitov Date: Wed May 13 12:30:50 2020 -0700 Merge branch 'bpf_iter-fixes' Yonghong Song says: ==================== Commit ae24345da54e ("bpf: Implement an interface to register bpf_iter targets") and its subsequent commits in the same patch set introduced bpf iterator, a way to run bpf program when iterating kernel data structures. This patch set addressed some followup issues. One big change is to allow target to pass ctx arg register types to verifier for verification purpose. Please see individual patch for details. Changelogs: v1 -> v2: . add "const" qualifier to struct bpf_iter_reg for bpf_iter_[un]reg_target, and this results in additional "const" qualifiers in some other places . drop the patch which will issue WARN_ONCE if seq_ops->show() returns a positive value. If this does happen, code review should spot this or author does know what he is doing. In the future, we do want to implement a mechanism to find out all registered targets so we will be aware of new additions. ==================== Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov commit 6e8a4f9dda3823274fa8a4c1aa5e6a93f9775749 Author: Christoph Hellwig Date: Wed May 13 13:07:59 2020 +0200 net: ignore sock_from_file errors in __scm_install_fd The code had historically been ignoring these errors, and my recent refactoring changed that, which broke ssh in some setups. Fixes: 2618d530dd8b ("net/scm: cleanup scm_detach_fds") Reported-by: Ido Schimmel Signed-off-by: Christoph Hellwig Tested-by: Ido Schimmel Tested-by: Ioana Ciornei Signed-off-by: David S. Miller commit 03421a92f5627430d23ed95df55958e04848f184 Author: Yonghong Song Date: Wed May 13 11:02:23 2020 -0700 samples/bpf: Remove compiler warnings Commit 5fbc220862fc ("tools/libpf: Add offsetof/container_of macro in bpf_helpers.h") added macros offsetof/container_of to bpf_helpers.h. Unfortunately, it caused compilation warnings below for a few samples/bpf programs: In file included from /data/users/yhs/work/net-next/samples/bpf/sockex2_kern.c:4: In file included from /data/users/yhs/work/net-next/include/uapi/linux/in.h:24: In file included from /data/users/yhs/work/net-next/include/linux/socket.h:8: In file included from /data/users/yhs/work/net-next/include/linux/uio.h:8: /data/users/yhs/work/net-next/include/linux/kernel.h:992:9: warning: 'container_of' macro redefined [-Wmacro-redefined] ^ /data/users/yhs/work/net-next/tools/lib/bpf/bpf_helpers.h:46:9: note: previous definition is here ^ 1 warning generated. CLANG-bpf samples/bpf/sockex3_kern.o In all these cases, bpf_helpers.h is included first, followed by other standard headers. The macro container_of is defined unconditionally in kernel.h, causing the compiler warning. The fix is to move bpf_helpers.h after standard headers. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200513180223.2949987-1-yhs@fb.com commit 3c32cc1bceba8a1755dc35cd97516f6c67856844 Author: Yonghong Song Date: Wed May 13 11:02:21 2020 -0700 bpf: Enable bpf_iter targets registering ctx argument types Commit b121b341e598 ("bpf: Add PTR_TO_BTF_ID_OR_NULL support") adds a field btf_id_or_null_non0_off to bpf_prog->aux structure to indicate that the first ctx argument is PTR_TO_BTF_ID reg_type and all others are PTR_TO_BTF_ID_OR_NULL. This approach does not really scale if we have other different reg types in the future, e.g., a pointer to a buffer. This patch enables bpf_iter targets registering ctx argument reg types which may be different from the default one. For example, for pointers to structures, the default reg_type is PTR_TO_BTF_ID for tracing program. The target can register a particular pointer type as PTR_TO_BTF_ID_OR_NULL which can be used by the verifier to enforce accesses. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200513180221.2949882-1-yhs@fb.com commit ab2ee4fcb9d61fd57db70db694adbcf54662bd80 Author: Yonghong Song Date: Wed May 13 11:02:20 2020 -0700 bpf: Change func bpf_iter_unreg_target() signature Change func bpf_iter_unreg_target() parameter from target name to target reg_info, similar to bpf_iter_reg_target(). Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200513180220.2949737-1-yhs@fb.com commit 15172a46fa2796c1a1358a36babd31274716ed41 Author: Yonghong Song Date: Wed May 13 11:02:19 2020 -0700 bpf: net: Refactor bpf_iter target registration Currently bpf_iter_reg_target takes parameters from target and allocates memory to save them. This is really not necessary, esp. in the future we may grow information passed from targets to bpf_iter manager. The patch refactors the code so target reg_info becomes static and bpf_iter manager can just take a reference to it. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200513180219.2949605-1-yhs@fb.com commit 2e3ed68bfcd9c5ca2cf8b88ba23a34992ccd0b1f Author: Yonghong Song Date: Wed May 13 11:02:18 2020 -0700 bpf: Add comments to interpret bpf_prog return values Add a short comment in bpf_iter_run_prog() function to explain how bpf_prog return value is converted to seq_ops->show() return value: bpf_prog return seq_ops()->show() return 0 0 1 -EAGAIN When show() return value is -EAGAIN, the current bpf_seq_read() will end. If the current seq_file buffer is empty, -EAGAIN will return to user space. Otherwise, the buffer will be copied to user space. In both cases, the next bpf_seq_read() call will try to show the same object which returned -EAGAIN previously. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200513180218.2949517-1-yhs@fb.com commit 21aef70eade22a656297c28d5da93301915d2ac2 Author: Yonghong Song Date: Wed May 13 11:02:16 2020 -0700 bpf: Change btf_iter func proto prefix to "bpf_iter_" This is to be consistent with tracing and lsm programs which have prefix "bpf_trace_" and "bpf_lsm_" respectively. Suggested-by: Alexei Starovoitov Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200513180216.2949387-1-yhs@fb.com commit 99aaf53e2f7c4a1b152b7f300c6b07ffbc2fe192 Author: Yonghong Song Date: Wed May 13 11:02:15 2020 -0700 tools/bpf: selftests : Explain bpf_iter test failures with llvm 10.0.0 Commit 6879c042e105 ("tools/bpf: selftests: Add bpf_iter selftests") added self tests for bpf_iter feature. But two subtests ipv6_route and netlink needs llvm latest 10.x release branch or trunk due to a bug in llvm BPF backend. This patch added the file README.rst to document these two failures so people using llvm 10.0.0 can be aware of them. Suggested-by: Alexei Starovoitov Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200513180215.2949237-1-yhs@fb.com commit 4fda86015c55bf5c0a82da57117cd22bfa8d5c65 Merge: 6cd35888a0db 9308c47640d5 Author: David S. Miller Date: Wed May 13 12:23:14 2020 -0700 Merge branch 'dwmac-meson8b-Ethernet-RX-delay-configuration' Martin Blumenstingl says: ==================== dwmac-meson8b Ethernet RX delay configuration The Ethernet TX performance has been historically bad on Meson8b and Meson8m2 SoCs because high packet loss was seen. I found out that this was related (yet again) to the RGMII TX delay configuration. In the process of discussing the big picture (and not just a single patch) [0] with Andrew I discovered that the IP block behind the dwmac-meson8b driver actually seems to support the configuration of the RGMII RX delay (at least on the Meson8b SoC generation). Since I sent the first RFC I got additional documentation from Jianxin (many thanks!). Also I have discovered some more interesting details: - Meson8b Odroid-C1 requires an RX delay (by either the PHY or the MAC) Based on the vendor u-boot code (not upstream) I assume that it will be the same for all Meson8b and Meson8m2 boards - Khadas VIM2 seems to have the RX delay built into the PCB trace length. When I enable the RX delay on the PHY or MAC I can't get any data through. I expect that we will have the same situation on all GXBB, GXM, AXG, G12A, G12B and SM1 boards. Further clarification is needed here though (since I can't visually see these lengthened traces on the PCB). This will be done before sending patches for these boards. Dependencies for this series: There is a soft dependency for patch #2 on commit f22531438ff42c "dt-bindings: net: dwmac: increase 'maxItems' for 'clocks', 'clock-names' properties" which is currently in Rob's -next tree. That commit is needed to make the dt-bindings schema validation pass for patch #2. That patch has been for ~4 weeks in Robs tree, so I assume that is not going to be dropped. Changes since RFC v2 at [2]: - dropped $ref: /schemas/types.yaml#definitions/uint32 from the "amlogic,rx-delay-ns" in patch #1 ("Don't need to define the type when in standard units." says Rob - thanks, I learned something new). Also use "default: 0" for for this property instead of explaining it in the description text. - added a note to the cover-letter about a hidden dependency for dt-binding schema validation in patch #2 - Added Andrew's Reviewed-by to patches 1-7. Thank you again for the quick and detailed reviews, I appreciate this! - error out if the (optional) timing-adjustment clock is missing but we're asked to enable the RGMII RX delay. The MAC won't work in this specific case and either the RX delay has to be provided by the PHY or the timing-adjustment clock has to be added. - dropped the dts patches (#9-11) which were only added to give an overview how this is going to be used. those will be sent separately - dropped the RFC prefix Changes since RFC v1 at [1]: - add support for the timing adjustment clock input (dt-bindings and in the driver) thanks to the input from the unnamed Ethernet engineer at Amlogic. This is the missing link between the fclk_div2 clock and the Ethernet controller on Meson8b (no traffic would flow if that clock was disabled) - add support fot the amlogic,rx-delay-ns property. The only supported values so far are 0ns and 2ns. The registers seem to allow more precise timing adjustments, but I could not make that work so far. - add more register documentation (for the new RX delay bits) and unified the placement of existing register documentation. Again, thanks to Jianxin and the unnamed Ethernet engineer at Amlogic - DO NOT MERGE: .dts patches to show the conversion of the Meson8b and Meson8m2 boards to "rgmii-id". I didn't have time for all arm64 patches yet, but these will switch to phy-mode = "rgmii-txid" with amlogic,rx-delay-ns = <0> (because the delay seems to be provided by the PCB trace length). [0] https://patchwork.kernel.org/patch/11309891/ [1] https://patchwork.kernel.org/cover/11310719/ [2] https://patchwork.kernel.org/cover/11518257/ ==================== Signed-off-by: David S. Miller commit 9308c47640d515d16e06a7fdf333c51a39c1b0b1 Author: Martin Blumenstingl Date: Tue May 12 23:11:03 2020 +0200 net: stmmac: dwmac-meson8b: add support for the RX delay configuration Configure the PRG_ETH0_ADJ_* bits to enable or disable the RX delay based on the various RGMII PHY modes. For now the only supported RX delay settings are: - disabled, use for example for phy-mode "rgmii-id" - 0ns - this is treated identical to "disabled", used for example on boards where the PHY provides 2ns TX delay and the PCB trace length already adds 2ns RX delay - 2ns - for whenever the PHY cannot add the RX delay and the traces on the PCB don't add any RX delay Disabling the RX delay (in case u-boot enables it, which is the case for example on Meson8b Odroid-C1) simply means that PRG_ETH0_ADJ_ENABLE, PRG_ETH0_ADJ_SETUP, PRG_ETH0_ADJ_DELAY and PRG_ETH0_ADJ_SKEW should be disabled (just disabling PRG_ETH0_ADJ_ENABLE may be enough, since that disables the whole re-timing logic - but I find it makes more sense to clear the other bits as well since they depend on that setting). u-boot on Odroid-C1 uses the following steps to enable a 2ns RX delay: - enabling enabling the timing adjustment clock - enabling the timing adjustment logic by setting PRG_ETH0_ADJ_ENABLE - setting the PRG_ETH0_ADJ_SETUP bit The documentation for the PRG_ETH0_ADJ_DELAY and PRG_ETH0_ADJ_SKEW registers indicates that we can even set different RX delays. However, I could not find out how this works exactly, so for now we only support a 2ns RX delay using the exact same way that Odroid-C1's u-boot does. Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit a54dc4a4904568fe2c6b2ba249dcc97612affebb Author: Martin Blumenstingl Date: Tue May 12 23:11:02 2020 +0200 net: stmmac: dwmac-meson8b: Make the clock enabling code re-usable The timing adjustment clock will need similar logic as the RGMII clock: It has to be enabled in the driver conditionally and when the driver is unloaded it should be disabled again. Extract the existing code for the RGMII clock into a new function so it can be re-used. Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit e4227bff804fc77e2f78c77470d3fbd2d4a6a8d0 Author: Martin Blumenstingl Date: Tue May 12 23:11:01 2020 +0200 net: stmmac: dwmac-meson8b: Fetch the "timing-adjustment" clock The PRG_ETHERNET registers have a built-in timing adjustment circuit which can provide the RX delay in RGMII mode. This is driven by an external (to this IP, but internal to the SoC) clock input. Fetch this clock as optional (even though it's there on all supported SoCs) since we just learned about it and existing .dtbs don't specify it. Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit c92d1d2311a0513d8f7f8311f5c2b1d7e78005a0 Author: Martin Blumenstingl Date: Tue May 12 23:11:00 2020 +0200 net: stmmac: dwmac-meson8b: Add the PRG_ETH0_ADJ_* bits The PRG_ETH0_ADJ_* are used for applying the RGMII RX delay. The public datasheets only have very limited description for these registers, but Jianxin Pan provided more detailed documentation from an (unnamed) Amlogic engineer. Add the PRG_ETH0_ADJ_* bits along with the improved description. Suggested-by: Jianxin Pan Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit 889df20305ffeae0a6bbd435761810ba658e223d Author: Martin Blumenstingl Date: Tue May 12 23:10:59 2020 +0200 net: stmmac: dwmac-meson8b: Move the documentation for the TX delay Move the documentation for the TX delay above the PRG_ETH0_TXDLY_MASK definition. Future commits will add more registers also with documentation above their register bit definitions. Move the existing comment so it will be consistent with the upcoming changes. Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit 3649abe43251de4357bdd6ef0163de25f96554e9 Author: Martin Blumenstingl Date: Tue May 12 23:10:58 2020 +0200 net: stmmac: dwmac-meson8b: use FIELD_PREP instead of open-coding it Use FIELD_PREP() to shift a value to the correct offset based on a bitmask instead of open-coding the logic. No functional changes. Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit ee0b8e6d02186321be0ea4ec0fb2cbd35bec7e29 Author: Martin Blumenstingl Date: Tue May 12 23:10:57 2020 +0200 dt-bindings: net: dwmac-meson: Document the "timing-adjustment" clock The PRG_ETHERNET registers can add an RX delay in RGMII mode. This requires an internal re-timing circuit whose input clock is called "timing adjustment clock". Document this clock input so the clock can be enabled as needed. Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit 7af4c8451d80d0a8622483c27ab141a7c1a94573 Author: Martin Blumenstingl Date: Tue May 12 23:10:56 2020 +0200 dt-bindings: net: meson-dwmac: Add the amlogic,rx-delay-ns property The PRG_ETHERNET registers on Meson8b and newer SoCs can add an RX delay. Add a property with the known supported values so it can be configured according to the board layout. Reviewed-by: Andrew Lunn Signed-off-by: Martin Blumenstingl Signed-off-by: David S. Miller commit 6cd35888a0db4b18a5796fe5d5863f004f8eef0f Merge: b41dc4ae3264 5b440676c15b Author: David S. Miller Date: Wed May 13 12:20:12 2020 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2020-05-13 Here's a second attempt at a bluetooth-next pull request which supercedes the one dated 2020-05-09. This should have the issues discovered by Jakub fixed. - Add support for Intel Typhoon Peak device (8087:0032) - Add device tree bindings for Realtek RTL8723BS device - Add device tree bindings for Qualcomm QCA9377 device - Add support for experimental features configuration through mgmt - Add driver hook to prevent wake from suspend - Add support for waiting for L2CAP disconnection response - Multiple fixes & cleanups to the btbcm driver - Add support for LE scatternet topology for selected devices - A few other smaller fixes & cleanups Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit 0aa0372f9229bf66113343cc87a73611979ebe97 Merge: fd9eef1a132d c5d420c32cb4 Author: Alexei Starovoitov Date: Wed May 13 12:19:38 2020 -0700 Merge branch 'benchmark-runner' Andrii Nakryiko says: ==================== Add generic benchmark runner framework which simplifies writing various performance benchmarks in a consistent fashion. This framework will be used in follow up patches to test performance of perf buffer and ring buffer as well. Patch #1 extracts parse_num_list to be re-used between test_progs and bench. Patch #2 adds generic runner implementation and atomic counter benchmarks to validate benchmark runner's behavior. Patch #3 implements test_overhead benchmark as part of bench runner. It also add fmod_ret BPF program type to a set of benchmarks. Patch #4 tests faster alternatives to set_task_comm() approach, tested in test_overhead, in search for minimal-overhead way to trigger BPF program execution from user-space on demand. v2->v3: - added --prod-affinity and --cons-affinity (Yonghong); - removed ringbuf-related options leftovers (Yonghong); - added more benchmarking results for test_overhead performance discrepancies; v1->v2: - moved benchmarks into benchs/ subdir (John); - added benchmark "suite" scripts (John); - few small clean ups, change defaults, etc. ==================== Signed-off-by: Alexei Starovoitov commit c5d420c32cb44fdd10d76f0f01bcd0b09383d0b5 Author: Andrii Nakryiko Date: Tue May 12 12:24:45 2020 -0700 selftest/bpf: Add BPF triggering benchmark It is sometimes desirable to be able to trigger BPF program from user-space with minimal overhead. sys_enter would seem to be a good candidate, yet in a lot of cases there will be a lot of noise from syscalls triggered by other processes on the system. So while searching for low-overhead alternative, I've stumbled upon getpgid() syscall, which seems to be specific enough to not suffer from accidental syscall by other apps. This set of benchmarks compares tp, raw_tp w/ filtering by syscall ID, kprobe, fentry and fmod_ret with returning error (so that syscall would not be executed), to determine the lowest-overhead way. Here are results on my machine (using benchs/run_bench_trigger.sh script): base : 9.200 ± 0.319M/s tp : 6.690 ± 0.125M/s rawtp : 8.571 ± 0.214M/s kprobe : 6.431 ± 0.048M/s fentry : 8.955 ± 0.241M/s fmodret : 8.903 ± 0.135M/s So it seems like fmodret doesn't give much benefit for such lightweight syscall. Raw tracepoint is pretty decent despite additional filtering logic, but it will be called for any other syscall in the system, which rules it out. Fentry, though, seems to be adding the least amoung of overhead and achieves 97.3% of performance of baseline no-BPF-attached syscall. Using getpgid() seems to be preferable to set_task_comm() approach from test_overhead, as it's about 2.35x faster in a baseline performance. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200512192445.2351848-5-andriin@fb.com commit 4eaf0b5c5e04c21a866431bd763ab4b1f24c4d16 Author: Andrii Nakryiko Date: Tue May 12 12:24:44 2020 -0700 selftest/bpf: Fmod_ret prog and implement test_overhead as part of bench Add fmod_ret BPF program to existing test_overhead selftest. Also re-implement user-space benchmarking part into benchmark runner to compare results. Results with ./bench are consistently somewhat lower than test_overhead's, but relative performance of various types of BPF programs stay consisten (e.g., kretprobe is noticeably slower). This slowdown seems to be coming from the fact that test_overhead is single-threaded, while benchmark always spins off at least one thread for producer. This has been confirmed by hacking multi-threaded test_overhead variant and also single-threaded bench variant. Resutls are below. run_bench_rename.sh script from benchs/ subdirectory was used to produce results for ./bench. Single-threaded implementations =============================== /* bench: single-threaded, atomics */ base : 4.622 ± 0.049M/s kprobe : 3.673 ± 0.052M/s kretprobe : 2.625 ± 0.052M/s rawtp : 4.369 ± 0.089M/s fentry : 4.201 ± 0.558M/s fexit : 4.309 ± 0.148M/s fmodret : 4.314 ± 0.203M/s /* selftest: single-threaded, no atomics */ task_rename base 4555K events per sec task_rename kprobe 3643K events per sec task_rename kretprobe 2506K events per sec task_rename raw_tp 4303K events per sec task_rename fentry 4307K events per sec task_rename fexit 4010K events per sec task_rename fmod_ret 3984K events per sec Multi-threaded implementations ============================== /* bench: multi-threaded w/ atomics */ base : 3.910 ± 0.023M/s kprobe : 3.048 ± 0.037M/s kretprobe : 2.300 ± 0.015M/s rawtp : 3.687 ± 0.034M/s fentry : 3.740 ± 0.087M/s fexit : 3.510 ± 0.009M/s fmodret : 3.485 ± 0.050M/s /* selftest: multi-threaded w/ atomics */ task_rename base 3872K events per sec task_rename kprobe 3068K events per sec task_rename kretprobe 2350K events per sec task_rename raw_tp 3731K events per sec task_rename fentry 3639K events per sec task_rename fexit 3558K events per sec task_rename fmod_ret 3511K events per sec /* selftest: multi-threaded, no atomics */ task_rename base 3945K events per sec task_rename kprobe 3298K events per sec task_rename kretprobe 2451K events per sec task_rename raw_tp 3718K events per sec task_rename fentry 3782K events per sec task_rename fexit 3543K events per sec task_rename fmod_ret 3526K events per sec Note that the fact that ./bench benchmark always uses atomic increments for counting, while test_overhead doesn't, doesn't influence test results all that much. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200512192445.2351848-4-andriin@fb.com commit 8e7c2a023ac04e04c72cd7b640329511dda92672 Author: Andrii Nakryiko Date: Tue May 12 12:24:43 2020 -0700 selftests/bpf: Add benchmark runner infrastructure While working on BPF ringbuf implementation, testing, and benchmarking, I've developed a pretty generic and modular benchmark runner, which seems to be generically useful, as I've already used it for one more purpose (testing fastest way to trigger BPF program, to minimize overhead of in-kernel code). This patch adds generic part of benchmark runner and sets up Makefile for extending it with more sets of benchmarks. Benchmarker itself operates by spinning up specified number of producer and consumer threads, setting up interval timer sending SIGALARM signal to application once a second. Every second, current snapshot with hits/drops counters are collected and stored in an array. Drops are useful for producer/consumer benchmarks in which producer might overwhelm consumers. Once test finishes after given amount of warm-up and testing seconds, mean and stddev are calculated (ignoring warm-up results) and is printed out to stdout. This setup seems to give consistent and accurate results. To validate behavior, I added two atomic counting tests: global and local. For global one, all the producer threads are atomically incrementing same counter as fast as possible. This, of course, leads to huge drop of performance once there is more than one producer thread due to CPUs fighting for the same memory location. Local counting, on the other hand, maintains one counter per each producer thread, incremented independently. Once per second, all counters are read and added together to form final "counting throughput" measurement. As expected, such setup demonstrates linear scalability with number of producers (as long as there are enough physical CPU cores, of course). See example output below. Also, this setup can nicely demonstrate disastrous effects of false sharing, if care is not taken to take those per-producer counters apart into independent cache lines. Demo output shows global counter first with 1 producer, then with 4. Both total and per-producer performance significantly drop. The last run is local counter with 4 producers, demonstrating near-perfect scalability. $ ./bench -a -w1 -d2 -p1 count-global Setting up benchmark 'count-global'... Benchmark 'count-global' started. Iter 0 ( 24.822us): hits 148.179M/s (148.179M/prod), drops 0.000M/s Iter 1 ( 37.939us): hits 149.308M/s (149.308M/prod), drops 0.000M/s Iter 2 (-10.774us): hits 150.717M/s (150.717M/prod), drops 0.000M/s Iter 3 ( 3.807us): hits 151.435M/s (151.435M/prod), drops 0.000M/s Summary: hits 150.488 ± 1.079M/s (150.488M/prod), drops 0.000 ± 0.000M/s $ ./bench -a -w1 -d2 -p4 count-global Setting up benchmark 'count-global'... Benchmark 'count-global' started. Iter 0 ( 60.659us): hits 53.910M/s ( 13.477M/prod), drops 0.000M/s Iter 1 (-17.658us): hits 53.722M/s ( 13.431M/prod), drops 0.000M/s Iter 2 ( 5.865us): hits 53.495M/s ( 13.374M/prod), drops 0.000M/s Iter 3 ( 0.104us): hits 53.606M/s ( 13.402M/prod), drops 0.000M/s Summary: hits 53.608 ± 0.113M/s ( 13.402M/prod), drops 0.000 ± 0.000M/s $ ./bench -a -w1 -d2 -p4 count-local Setting up benchmark 'count-local'... Benchmark 'count-local' started. Iter 0 ( 23.388us): hits 640.450M/s (160.113M/prod), drops 0.000M/s Iter 1 ( 2.291us): hits 605.661M/s (151.415M/prod), drops 0.000M/s Iter 2 ( -6.415us): hits 607.092M/s (151.773M/prod), drops 0.000M/s Iter 3 ( -1.361us): hits 601.796M/s (150.449M/prod), drops 0.000M/s Summary: hits 604.849 ± 2.739M/s (151.212M/prod), drops 0.000 ± 0.000M/s Benchmark runner supports setting thread affinity for producer and consumer threads. You can use -a flag for default CPU selection scheme, where first consumer gets CPU #0, next one gets CPU #1, and so on. Then producer threads pick up next CPU and increment one-by-one as well. But user can also specify a set of CPUs independently for producers and consumers with --prod-affinity 1,2-10,15 and --cons-affinity . The latter allows to force producers and consumers to share same set of CPUs, if necessary. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200512192445.2351848-3-andriin@fb.com commit cd49291ce18aeef3f2ec950bc99bd72d5a05fa86 Author: Andrii Nakryiko Date: Tue May 12 12:24:42 2020 -0700 selftests/bpf: Extract parse_num_list into generic testing_helpers.c Add testing_helpers.c, which will contain generic helpers for test runners and tests needing some common generic functionality, like parsing a set of numbers. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200512192445.2351848-2-andriin@fb.com commit 889333c772c50a3e50787aa1073a9f82dafb64f8 Author: Chris Wilson Date: Wed May 13 19:09:37 2020 +0100 drm/i915/gem: Remove redundant exec_fence Since there can only be one of in_fence/exec_fence, just use the single in_fence local. v2: Consolidate lookup Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200513180937.28992-1-chris@chris-wilson.co.uk commit 358369f03ac94637c9fd9d8f94a2dfde86b9f25f Author: Gustavo A. R. Silva Date: Thu May 7 14:22:10 2020 -0500 md/raid1: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Song Liu commit 59dde4d19cf8de232c17c79c08e0db67636b022b Author: Leon Romanovsky Date: Wed May 13 13:08:09 2020 +0300 RDMA/mlx5: Fix query_srq_cmd() function The output buffer used in mlx5_cmd_exec_inout() was wrongly changed from pre-allocated srq_out pointer to an input "out" point. That leads to unpredictable results in the get_srqc() call later. Fixes: 31578defe4eb ("RDMA/mlx5: Update mlx5_ib to use new cmd interface") Link: https://lore.kernel.org/r/20200513100809.246315-1-leon@kernel.org Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b2379ba2b9c207f6a76b4b8c3d7252a82cfd8f7d Author: Nathan Chancellor Date: Wed May 13 11:23:40 2020 -0700 drm/i915: Remove duplicate inline specifier on write_pte When building with clang: drivers/gpu/drm/i915/gt/gen8_ppgtt.c:392:24: warning: duplicate 'inline' declaration specifier [-Wduplicate-decl-specifier] declaration specifier [-Wduplicate-decl-specifier] static __always_inline inline void ^ include/linux/compiler_types.h:138:16: note: expanded from macro 'inline' #define inline inline __gnu_inline __inline_maybe_unused notrace ^ 1 warning generated. __always_inline is defined as 'inline __attribute__((__always_inline))' so we do not need to specify it twice. Fixes: 84eac0c65940 ("drm/i915/gt: Force pte cacheline to main memory") Link: https://github.com/ClangBuiltLinux/linux/issues/1024 Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200513182340.3968668-1-natechancellor@gmail.com commit f29de9eee78253d9ae57cd58a6b21eed021742c8 Author: Daria Velikovsky Date: Mon May 4 08:42:27 2020 +0300 RDMA/mlx5: Add support for drop action in DV steering When drop action is used the matching packet will stop processing in steering and will be dropped. This functionality will allow users to drop matching packets. Link: https://lore.kernel.org/r/20200504054227.271486-1-leon@kernel.org Signed-off-by: Daria Velikovsky Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8c112a5f29a343f89072bed4b9fa176fea226798 Author: Maor Gottlieb Date: Mon May 4 08:30:12 2020 +0300 RDMA/mlx5: Add support in steering default miss User can configure default miss rule in order to skip matching in the user domain and forward the packet to the kernel steering domain. When user requests a default miss rule, we add steering rule to forward the traffic to the next namespace. Link: https://lore.kernel.org/r/20200504053012.270689-5-leon@kernel.org Signed-off-by: Maor Gottlieb Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b9019507aa6e3e6a039573eb6743b38bf846771b Author: Maor Gottlieb Date: Mon May 4 08:30:11 2020 +0300 RDMA/mlx5: Refactor DV create flow Move part of the code that get the destinations into function so the code will be more readable. In addition change the variables definition to be in reversed christmas tree. Link: https://lore.kernel.org/r/20200504053012.270689-4-leon@kernel.org Signed-off-by: Maor Gottlieb Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b41dc4ae3264960cfd85f7bd2e946bfad79abfe9 Merge: fb9f2e92864f 0fbabf875d18 Author: David S. Miller Date: Wed May 13 11:54:47 2020 -0700 Merge branch 'net-dsa-felix-tc-taprio-and-CBS-offload-support' Xiaoliang Yang says: ==================== net: dsa: felix: tc taprio and CBS offload support This patch series support tc taprio and CBS hardware offload according to IEEE 802.1Qbv and IEEE-802.1Qav on VSC9959. v1->v2 changes: - Move port_qos_map_init() function to be common felix codes. - Keep const for dsa_switch_ops structs, add felix_port_setup_tc function to call port_setup_tc of felix.info. - fix code style for cbs_set, rename variables. ==================== Signed-off-by: David S. Miller commit 0fbabf875d184eee21b94d8b8a9c83d5df5cb3d4 Author: Xiaoliang Yang Date: Wed May 13 10:25:10 2020 +0800 net: dsa: felix: add support Credit Based Shaper(CBS) for hardware offload VSC9959 hardware support the Credit Based Shaper(CBS) which part of the IEEE-802.1Qav. This patch support sch_cbs set for VSC9959. Signed-off-by: Xiaoliang Yang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit de143c0e274b95ba0513acf8e60b3b87d24335fa Author: Xiaoliang Yang Date: Wed May 13 10:25:09 2020 +0800 net: dsa: felix: Configure Time-Aware Scheduler via taprio offload Ocelot VSC9959 switch supports time-based egress shaping in hardware according to IEEE 802.1Qbv. This patch add support for TAS configuration on egress port of VSC9959 switch. Felix driver is an instance of Ocelot family, with a DSA front-end. The patch uses tc taprio hardware offload to setup TAS set function on felix driver. Signed-off-by: Xiaoliang Yang Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit bd2b3161dba88ea11c99ce957cc52940905500b9 Author: Xiaoliang Yang Date: Wed May 13 10:25:08 2020 +0800 net: dsa: felix: qos classified based on pcp Set the default QoS Classification based on PCP and DEI of vlan tag, after that, frames can be Classified to different Qos based on PCP tag. If there is no vlan tag or vlan ignored, use port default Qos. Signed-off-by: Xiaoliang Yang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 10c261551359e37670a200c55c492f4aba7d23ed Merge: 0cb9e4f9e98a 9254f8ed15b6 Author: Jason Gunthorpe Date: Wed May 13 15:54:19 2020 -0300 Merge branch 'mellanox/mlx5-next' into rdma.git for/next From the mlx5-next branch at git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Required for dependencies in following patches * branch 'mellanox/mlx5-next': net/mlx5: Add support in forward to namespace {IB/net}/mlx5: Simplify don't trap code net/mlx5: Replace zero-length array with flexible-array Signed-off-by: Jason Gunthorpe commit 3f99980c8f70bc56584450c0a69973eef7b65913 Author: Xiongfeng Wang Date: Mon May 11 16:23:25 2020 +0800 md: add a newline when printing parameter 'start_ro' by sysfs Add a missing newline when printing module parameter 'start_ro' by sysfs. Signed-off-by: Xiongfeng Wang Signed-off-by: Song Liu commit e4fc5a74293fbe8a1b8598b8a3c53592a5d70398 Author: Christoph Hellwig Date: Fri May 8 18:15:14 2020 +0200 md: stop using ->queuedata Pointer to mddev is already available in private_data. Signed-off-by: Christoph Hellwig Signed-off-by: Song Liu commit c91114c2b89d5bea132d34b40568053f8bfa963d Author: David Jeffery Date: Mon Jan 27 10:26:19 2020 -0500 md/raid1: release pending accounting for an I/O only after write-behind is also finished When using RAID1 and write-behind, md can deadlock when errors occur. With write-behind, r1bio structs can be accounted by raid1 as queued but not counted as pending. The pending count is dropped when the original bio is returned complete but write-behind for the r1bio may still be active. This breaks the accounting used in some conditions to know when the raid1 md device has reached an idle state. It can result in calls to freeze_array deadlocking. freeze_array will never complete from a negative "unqueued" value being calculated due to a queued count larger than the pending count. To properly account for write-behind, move the call to allow_barrier from call_bio_endio to raid_end_bio_io. When using write-behind, md can call call_bio_endio before all write-behind I/O is complete. Using raid_end_bio_io for the point to call allow_barrier will release the pending count at a point where all I/O for an r1bio, even write-behind, is done. Signed-off-by: David Jeffery Signed-off-by: Song Liu commit 3024ba2d6c5573b4797e62006d98f17f47f7d103 Author: Coly Li Date: Thu Apr 9 22:17:23 2020 +0800 md: remove redundant memalloc scope API usage In mddev_create_serial_pool(), memalloc scope APIs memalloc_noio_save() and memalloc_noio_restore() are used when allocating memory by calling mempool_create_kmalloc_pool(). After adding the memalloc scope APIs in raid array suspend context, it is unncessary to explicitly call them around mempool_create_kmalloc_pool() any longer. This patch removes the redundant memalloc scope APIs in mddev_create_serial_pool(). Signed-off-by: Coly Li Cc: Guoqing Jiang Signed-off-by: Song Liu commit 7f8a30e5d253793d660f30b7475d7bb41efd40b8 Author: Coly Li Date: Thu Apr 9 22:17:22 2020 +0800 raid5: update code comment of scribble_alloc() Code comments of scribble_alloc() is outdated for a while. This patch update the comments in function header for the new parameter list. Suggested-by: Song Liu Signed-off-by: Coly Li Signed-off-by: Song Liu commit ba54d4d4d2844c234f1b4692bd8c9e0f833c8a54 Author: Coly Li Date: Thu Apr 9 22:17:21 2020 +0800 raid5: remove gfp flags from scribble_alloc() Using GFP_NOIO flag to call scribble_alloc() from resize_chunk() does not have the expected behavior. kvmalloc_array() inside scribble_alloc() which receives the GFP_NOIO flag will eventually call kmalloc_node() to allocate physically continuous pages. Now we have memalloc scope APIs in mddev_suspend()/mddev_resume() to prevent memory reclaim I/Os during raid array suspend context, calling to kvmalloc_array() with GFP_KERNEL flag may avoid deadlock of recursive I/O as expected. This patch removes the useless gfp flags from parameters list of scribble_alloc(), and call kvmalloc_array() with GFP_KERNEL flag. The incorrect GFP_NOIO flag does not exist anymore. Fixes: b330e6a49dc3 ("md: convert to kvmalloc") Suggested-by: Michal Hocko Signed-off-by: Coly Li Signed-off-by: Song Liu commit 78f57ef9d50a75326da73d352d7c27828495229a Author: Coly Li Date: Thu Apr 9 22:17:20 2020 +0800 md: use memalloc scope APIs in mddev_suspend()/mddev_resume() In raid5.c:resize_chunk(), scribble_alloc() is called with GFP_NOIO flag, then it is sent into kvmalloc_array() inside scribble_alloc(). The problem is kvmalloc_array() eventually calls kvmalloc_node() which does not accept non GFP_KERNEL compatible flag like GFP_NOIO, then kmalloc_node() is called indeed to allocate physically continuous pages. When system memory is under heavy pressure, and the requesting size is large, there is high probability that allocating continueous pages will fail. But simply using GFP_KERNEL flag to call kvmalloc_array() is also progblematic. In the code path where scribble_alloc() is called, the raid array is suspended, if kvmalloc_node() triggers memory reclaim I/Os and such I/Os go back to the suspend raid array, deadlock will happen. What is desired here is to allocate non-physically (a.k.a virtually) continuous pages and avoid memory reclaim I/Os. Michal Hocko suggests to use the mmealloc sceope APIs to restrict memory reclaim I/O in allocating context, specifically to call memalloc_noio_save() when suspend the raid array and to call memalloc_noio_restore() when resume the raid array. This patch adds the memalloc scope APIs in mddev_suspend() and mddev_resume(), to restrict memory reclaim I/Os during the raid array is suspended. The benifit of adding the memalloc scope API in the unified entry point mddev_suspend()/mddev_resume() is, no matter which md raid array type (personality), we are sure the deadlock by recursive memory reclaim I/O won't happen on the suspending context. Please notice that the memalloc scope APIs only take effect on the raid array suspending context, if the memory allocation is from another new created kthread after raid array suspended, the recursive memory reclaim I/Os won't be restricted. The mddev_suspend()/mddev_resume() entries are used for the critical section where the raid metadata is modifying, creating a kthread to allocate memory inside the critical section is queer and very probably being buggy. Fixes: b330e6a49dc3 ("md: convert to kvmalloc") Suggested-by: Michal Hocko Signed-off-by: Coly Li Signed-off-by: Song Liu commit 3f79cc22348fe7d285bd140209394c9e381e082c Author: Guoqing Jiang Date: Sat Apr 4 23:57:11 2020 +0200 md: remove the extra line for ->hot_add_disk It is not not necessary to add a newline for them since they don't exceed 80 characters, and it is not intutive to distinguish ->hot_add_disk() from hot_add_disk() too. Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 78b990cf2822d1150a419c13be48e74aefa83f27 Author: Guoqing Jiang Date: Sat Apr 4 23:57:10 2020 +0200 md: flush md_rdev_misc_wq for HOT_ADD_DISK case Since rdev->kobj is removed asynchronously, it is possible that the rdev->kobj still exists when try to add the rdev again after rdev is removed. But this path md_ioctl (HOT_ADD_DISK) -> hot_add_disk -> bind_rdev_to_array missed it. Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit f6766ff6afff70e2aaf39e1511e16d471de7c3ae Author: Guoqing Jiang Date: Sat Apr 4 23:57:09 2020 +0200 md: don't flush workqueue unconditionally in md_open We need to check mddev->del_work before flush workqueu since the purpose of flush is to ensure the previous md is disappeared. Otherwise the similar deadlock appeared if LOCKDEP is enabled, it is due to md_open holds the bdev->bd_mutex before flush workqueue. kernel: [ 154.522645] ====================================================== kernel: [ 154.522647] WARNING: possible circular locking dependency detected kernel: [ 154.522650] 5.6.0-rc7-lp151.27-default #25 Tainted: G O kernel: [ 154.522651] ------------------------------------------------------ kernel: [ 154.522653] mdadm/2482 is trying to acquire lock: kernel: [ 154.522655] ffff888078529128 ((wq_completion)md_misc){+.+.}, at: flush_workqueue+0x84/0x4b0 kernel: [ 154.522673] kernel: [ 154.522673] but task is already holding lock: kernel: [ 154.522675] ffff88804efa9338 (&bdev->bd_mutex){+.+.}, at: __blkdev_get+0x79/0x590 kernel: [ 154.522691] kernel: [ 154.522691] which lock already depends on the new lock. kernel: [ 154.522691] kernel: [ 154.522694] kernel: [ 154.522694] the existing dependency chain (in reverse order) is: kernel: [ 154.522696] kernel: [ 154.522696] -> #4 (&bdev->bd_mutex){+.+.}: kernel: [ 154.522704] __mutex_lock+0x87/0x950 kernel: [ 154.522706] __blkdev_get+0x79/0x590 kernel: [ 154.522708] blkdev_get+0x65/0x140 kernel: [ 154.522709] blkdev_get_by_dev+0x2f/0x40 kernel: [ 154.522716] lock_rdev+0x3d/0x90 [md_mod] kernel: [ 154.522719] md_import_device+0xd6/0x1b0 [md_mod] kernel: [ 154.522723] new_dev_store+0x15e/0x210 [md_mod] kernel: [ 154.522728] md_attr_store+0x7a/0xc0 [md_mod] kernel: [ 154.522732] kernfs_fop_write+0x117/0x1b0 kernel: [ 154.522735] vfs_write+0xad/0x1a0 kernel: [ 154.522737] ksys_write+0xa4/0xe0 kernel: [ 154.522745] do_syscall_64+0x64/0x2b0 kernel: [ 154.522748] entry_SYSCALL_64_after_hwframe+0x49/0xbe kernel: [ 154.522749] kernel: [ 154.522749] -> #3 (&mddev->reconfig_mutex){+.+.}: kernel: [ 154.522752] __mutex_lock+0x87/0x950 kernel: [ 154.522756] new_dev_store+0xc9/0x210 [md_mod] kernel: [ 154.522759] md_attr_store+0x7a/0xc0 [md_mod] kernel: [ 154.522761] kernfs_fop_write+0x117/0x1b0 kernel: [ 154.522763] vfs_write+0xad/0x1a0 kernel: [ 154.522765] ksys_write+0xa4/0xe0 kernel: [ 154.522767] do_syscall_64+0x64/0x2b0 kernel: [ 154.522769] entry_SYSCALL_64_after_hwframe+0x49/0xbe kernel: [ 154.522770] kernel: [ 154.522770] -> #2 (kn->count#253){++++}: kernel: [ 154.522775] __kernfs_remove+0x253/0x2c0 kernel: [ 154.522778] kernfs_remove+0x1f/0x30 kernel: [ 154.522780] kobject_del+0x28/0x60 kernel: [ 154.522783] mddev_delayed_delete+0x24/0x30 [md_mod] kernel: [ 154.522786] process_one_work+0x2a7/0x5f0 kernel: [ 154.522788] worker_thread+0x2d/0x3d0 kernel: [ 154.522793] kthread+0x117/0x130 kernel: [ 154.522795] ret_from_fork+0x3a/0x50 kernel: [ 154.522796] kernel: [ 154.522796] -> #1 ((work_completion)(&mddev->del_work)){+.+.}: kernel: [ 154.522800] process_one_work+0x27e/0x5f0 kernel: [ 154.522802] worker_thread+0x2d/0x3d0 kernel: [ 154.522804] kthread+0x117/0x130 kernel: [ 154.522806] ret_from_fork+0x3a/0x50 kernel: [ 154.522807] kernel: [ 154.522807] -> #0 ((wq_completion)md_misc){+.+.}: kernel: [ 154.522813] __lock_acquire+0x1392/0x1690 kernel: [ 154.522816] lock_acquire+0xb4/0x1a0 kernel: [ 154.522818] flush_workqueue+0xab/0x4b0 kernel: [ 154.522821] md_open+0xb6/0xc0 [md_mod] kernel: [ 154.522823] __blkdev_get+0xea/0x590 kernel: [ 154.522825] blkdev_get+0x65/0x140 kernel: [ 154.522828] do_dentry_open+0x1d1/0x380 kernel: [ 154.522831] path_openat+0x567/0xcc0 kernel: [ 154.522834] do_filp_open+0x9b/0x110 kernel: [ 154.522836] do_sys_openat2+0x201/0x2a0 kernel: [ 154.522838] do_sys_open+0x57/0x80 kernel: [ 154.522840] do_syscall_64+0x64/0x2b0 kernel: [ 154.522842] entry_SYSCALL_64_after_hwframe+0x49/0xbe kernel: [ 154.522844] kernel: [ 154.522844] other info that might help us debug this: kernel: [ 154.522844] kernel: [ 154.522846] Chain exists of: kernel: [ 154.522846] (wq_completion)md_misc --> &mddev->reconfig_mutex --> &bdev->bd_mutex kernel: [ 154.522846] kernel: [ 154.522850] Possible unsafe locking scenario: kernel: [ 154.522850] kernel: [ 154.522852] CPU0 CPU1 kernel: [ 154.522853] ---- ---- kernel: [ 154.522854] lock(&bdev->bd_mutex); kernel: [ 154.522856] lock(&mddev->reconfig_mutex); kernel: [ 154.522858] lock(&bdev->bd_mutex); kernel: [ 154.522860] lock((wq_completion)md_misc); kernel: [ 154.522861] kernel: [ 154.522861] *** DEADLOCK *** kernel: [ 154.522861] kernel: [ 154.522864] 1 lock held by mdadm/2482: kernel: [ 154.522865] #0: ffff88804efa9338 (&bdev->bd_mutex){+.+.}, at: __blkdev_get+0x79/0x590 kernel: [ 154.522868] kernel: [ 154.522868] stack backtrace: kernel: [ 154.522873] CPU: 1 PID: 2482 Comm: mdadm Tainted: G O 5.6.0-rc7-lp151.27-default #25 kernel: [ 154.522875] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 kernel: [ 154.522878] Call Trace: kernel: [ 154.522881] dump_stack+0x8f/0xcb kernel: [ 154.522884] check_noncircular+0x194/0x1b0 kernel: [ 154.522888] ? __lock_acquire+0x1392/0x1690 kernel: [ 154.522890] __lock_acquire+0x1392/0x1690 kernel: [ 154.522893] lock_acquire+0xb4/0x1a0 kernel: [ 154.522895] ? flush_workqueue+0x84/0x4b0 kernel: [ 154.522898] flush_workqueue+0xab/0x4b0 kernel: [ 154.522900] ? flush_workqueue+0x84/0x4b0 kernel: [ 154.522905] ? md_open+0xb6/0xc0 [md_mod] kernel: [ 154.522908] md_open+0xb6/0xc0 [md_mod] kernel: [ 154.522910] __blkdev_get+0xea/0x590 kernel: [ 154.522912] ? bd_acquire+0xc0/0xc0 kernel: [ 154.522914] blkdev_get+0x65/0x140 kernel: [ 154.522916] ? bd_acquire+0xc0/0xc0 kernel: [ 154.522918] do_dentry_open+0x1d1/0x380 kernel: [ 154.522921] path_openat+0x567/0xcc0 kernel: [ 154.522923] ? __lock_acquire+0x380/0x1690 kernel: [ 154.522926] do_filp_open+0x9b/0x110 kernel: [ 154.522929] ? __alloc_fd+0xe5/0x1f0 kernel: [ 154.522935] ? kmem_cache_alloc+0x28c/0x630 kernel: [ 154.522939] ? do_sys_openat2+0x201/0x2a0 kernel: [ 154.522941] do_sys_openat2+0x201/0x2a0 kernel: [ 154.522944] do_sys_open+0x57/0x80 kernel: [ 154.522946] do_syscall_64+0x64/0x2b0 kernel: [ 154.522948] entry_SYSCALL_64_after_hwframe+0x49/0xbe kernel: [ 154.522951] RIP: 0033:0x7f98d279d9ae And md_alloc also flushed the same workqueue, but the thing is different here. Because all the paths call md_alloc don't hold bdev->bd_mutex, and the flush is necessary to avoid race condition, so leave it as it is. Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit cc1ffe61c026e2318024bfa8722e8f689fd2a7f4 Author: Guoqing Jiang Date: Sat Apr 4 23:57:08 2020 +0200 md: add new workqueue for delete rdev Since the purpose of call flush_workqueue in new_dev_store is to ensure md_delayed_delete() has completed, so we should check rdev->del_work is pending or not. To suppress lockdep warning, we have to check mddev->del_work while md_delayed_delete is attached to rdev->del_work, so it is not aligned to the purpose of flush workquee. So a new workqueue is needed to avoid the awkward situation, and introduce a new func flush_rdev_wq to flush the new workqueue after check if there was pending work. Also like new_dev_store, ADD_NEW_DISK ioctl has the same purpose to flush workqueue while it holds bdev->bd_mutex, so make the same change applies to the ioctl to avoid similar lock issue. And md_delayed_delete actually wants to delete rdev, so rename the function to rdev_delayed_delete. Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 21e0958ec9684e76e32f822c5e611a7d7ea0a5ba Author: Guoqing Jiang Date: Sat Apr 4 23:57:07 2020 +0200 md: add checkings before flush md_misc_wq Coly reported possible circular locking dependencyi with LOCKDEP enabled, quote the below info from the detailed report [1]. [ 1607.673903] Chain exists of: [ 1607.673903] kn->count#256 --> (wq_completion)md_misc --> (work_completion)(&rdev->del_work) [ 1607.673903] [ 1607.827946] Possible unsafe locking scenario: [ 1607.827946] [ 1607.898780] CPU0 CPU1 [ 1607.952980] ---- ---- [ 1608.007173] lock((work_completion)(&rdev->del_work)); [ 1608.069690] lock((wq_completion)md_misc); [ 1608.149887] lock((work_completion)(&rdev->del_work)); [ 1608.242563] lock(kn->count#256); [ 1608.283238] [ 1608.283238] *** DEADLOCK *** [ 1608.283238] [ 1608.354078] 2 locks held by kworker/5:0/843: [ 1608.405152] #0: ffff8889eecc9948 ((wq_completion)md_misc){+.+.}, at: process_one_work+0x42b/0xb30 [ 1608.512399] #1: ffff888a1d3b7e10 ((work_completion)(&rdev->del_work)){+.+.}, at: process_one_work+0x42b/0xb30 [ 1608.632130] Since works (rdev->del_work and mddev->del_work) are queued in md_misc_wq, then lockdep_map lock is held if either of them are running, then both of them try to hold kernfs lock by call kobject_del. Then if new_dev_store or array_state_store are triggered by write to the related sysfs node, so the write operation gets kernfs lock, but need the lockdep_map because all of them would trigger flush_workqueue(md_misc_wq) finally, then the same lockdep_map lock is needed. To suppress the lockdep warnning, we should flush the workqueue in case the related work is pending. And several works are attached to md_misc_wq, so we need to check which work should be checked: 1. for __md_stop_writes, the purpose of call flush workqueue is ensure sync thread is started if it was starting, so check mddev->del_work is pending or not since md_start_sync is attached to mddev->del_work. 2. __md_stop flushes md_misc_wq to ensure event_work is done, check the event_work is enough. Assume raid_{ctr,dtr} -> md_stop -> __md_stop doesn't need the kernfs lock. 3. both new_dev_store (holds kernfs lock) and ADD_NEW_DISK ioctl (holds the bdev->bd_mutex) call flush_workqueue to ensure md_delayed_delete has completed, this case will be handled in next patch. 4. md_open flushes workqueue to ensure the previous md is disappeared, but it holds bdev->bd_mutex then try to flush workqueue, so it is better to check mddev->del_work as well to avoid potential lock issue, this will be done in another patch. [1]: https://marc.info/?l=linux-raid&m=158518958031584&w=2 Cc: Coly Li Reported-by: Coly Li Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 5d6b6a6f9b5ce7ac42273efd75d61ec63b463c18 Author: Yu-cheng Yu Date: Tue May 12 07:54:40 2020 -0700 x86/fpu/xstate: Update sanitize_restored_xstate() for supervisor xstates The function sanitize_restored_xstate() sanitizes user xstates of an XSAVE buffer by clearing bits not in the input 'xfeatures' from the buffer's header->xfeatures, effectively resetting those features back to the init state. When supervisor xstates are introduced, it is necessary to make sure only user xstates are sanitized. Ensure supervisor bits in header->xfeatures stay set and supervisor states are not modified. To make names clear, also: - Rename the function to sanitize_restored_user_xstate(). - Rename input parameter 'xfeatures' to 'user_xfeatures'. - In __fpu__restore_sig(), rename 'xfeatures' to 'user_xfeatures'. Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20200512145444.15483-7-yu-cheng.yu@intel.com commit 7a20388ed848a9e82e878d6847e0e0021be64985 Author: Sean Wang Date: Tue May 12 22:02:50 2020 +0200 mt76: mt7615: configure bss info adding the interface Introduce essential bss information for multiple vifs hw_scan in mt7615_mcu_uni_add_dev adding the interface Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 50eb0a884a4cbb158369cf3128b98a97c8f431a0 Author: Lorenzo Bianconi Date: Tue May 12 22:02:49 2020 +0200 mt76: enable p2p support Introduce p2p-go/p2p-client suppor to mt76 driver Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 8f3dab33da2ca4f7f72ac49281b9f2ac390d0824 Author: Lorenzo Bianconi Date: Tue May 12 22:02:48 2020 +0200 mt76: mt7615: reduce hw scan timeout Differentiate hw scan channel time between passive and active scan Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 7cba8c30aa7baf79650dec6b7713b985be84c5f7 Author: Lorenzo Bianconi Date: Tue May 12 22:02:47 2020 +0200 mt76: mt7615: do not report scan_complete twice to mac80211 Fix the following kernel warning that occurs if scan work is scheduled and the hw scan has been cancelled by mac80211 WARNING: CPU: 1 PID: 502 at net/mac80211/scan.c:391 __ieee80211_scan_completed+0x299/0x690 Modules linked in: CPU: 1 PID: 502 Comm: kworker/u4:4 Not tainted 5.7.0-rc1+ #2882 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Workqueue: phy0 ieee80211_scan_work RIP: 0010:__ieee80211_scan_completed+0x299/0x690 RSP: 0018:ffffc9000036fda8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 8c6318c6318c6320 RDX: 0000000000000000 RSI: 00000000ffffffff RDI: ffff88803bb129b8 RBP: ffff88803bb10d80 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: ffff88803bb12ae8 FS: 0000000000000000(0000) GS:ffff88803ec00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f13ee5c1470 CR3: 000000003c790000 CR4: 00000000000006a0 Call Trace: ieee80211_scan_work+0x170/0x850 ? sched_clock_cpu+0x11/0xb0 process_one_work+0x24f/0x580 ? worker_thread+0xcc/0x3e0 worker_thread+0x4f/0x3e0 ? process_one_work+0x580/0x580 kthread+0x11b/0x140 ? __kthread_bind_mask+0x60/0x60 ret_from_fork+0x3a/0x50 irq event stamp: 9255532 hardirqs last enabled at (9255531): [] _raw_spin_unlock_irq+0x24/0x30 hardirqs last disabled at (9255532): [] trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (9255526): [] process_one_work+0x24f/0x580 softirqs last disabled at (9255524): [] mt7615_scan_work+0x91/0xc0 Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit f8d6379932dd08263d3131ab64427b134ea9e035 Author: Sean Wang Date: Tue May 12 21:39:13 2020 +0200 mt76: mt7663: fix the usage WoW with net detect support mt7615_mcu_sched_scan_enable should be taken along with mt7615_mcu_sched_scan_req to have proper scan plans initialization. Fixes: bd39bd2f00c3 ("mt76: mt7663: introduce WoW with net detect support") Co-developed-by: Wan-Feng Jiang Signed-off-by: Wan-Feng Jiang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 848685c25da99d871bbd87369f3c3d6eead661ac Author: Rob Herring Date: Wed Apr 29 15:58:25 2020 -0500 ARM: vexpress: Don't select VEXPRESS_CONFIG CONFIG_VEXPRESS_CONFIG has 'default y if ARCH_VEXPRESS', so selecting is unnecessary. Selecting it also prevents setting CONFIG_VEXPRESS_CONFIG to a module. Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit 70e4758aaae04a5b0cb53db47fd94eb1714fd0ac Author: Rob Herring Date: Wed Apr 29 15:58:24 2020 -0500 bus: vexpress-config: Support building as module Enable building vexpress-config driver as a module. Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: Greg Kroah-Hartman Reviewed-by: Sudeep Holla Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit 310f80d61717425fbf799ef0ff0926e64cd57d9c Author: Rob Herring Date: Wed Apr 29 15:58:23 2020 -0500 vexpress: Move setting master site to vexpress-config bus There's only a single caller of vexpress_config_set_master() from vexpress-sysreg.c. Let's just make the registers needed available to vexpress-config and move all the code there. The registers needed aren't used anywhere else either. With this, we can get rid of the private API between these 2 drivers. Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: Greg Kroah-Hartman Acked-by: Liviu Dudau Acked-by: Sudeep Holla Acked-by: Lee Jones Signed-off-by: Rob Herring commit a5a38765ac79b27d53e45a283418e75c0b57c1bb Author: Rob Herring Date: Wed Apr 29 15:58:22 2020 -0500 bus: vexpress-config: simplify config bus probing The vexpress-config initialization is dependent on the vexpress-syscfg driver probing. As vexpress-config was not a driver, deferred probe could not be used and instead initcall ordering was relied upon. This is fragile and doesn't work for modules. Let's move the config bus init into the vexpress-syscfg probe. This eliminates the initcall ordering requirement and the need to create a struct device and the "vexpress-config" class. Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Reviewed-by: Sudeep Holla Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit d06cfe3f123c50449a0c3ece21bc16668289c50f Author: Rob Herring Date: Wed Apr 29 15:58:21 2020 -0500 bus: vexpress-config: Merge vexpress-syscfg into vexpress-config The only thing that vexpress-syscfg does is provide a regmap to vexpress-config bus child devices. There's little reason to have 2 components for this. The current structure with initcall ordering requirements makes turning these components into modules more difficult. So let's start to simplify things and merge vexpress-syscfg into vexpress-config. There's no functional change in this commit and it's still separate components until subsequent commits. Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: Arnd Bergmann Reviewed-by: Sudeep Holla Acked-by: Greg Kroah-Hartman Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit 7b9d428e05197b589d5b770a791231cf972bd2ed Author: Rob Herring Date: Wed Apr 29 15:58:20 2020 -0500 mfd: vexpress-sysreg: Support building as a module Enable building the vexpress-sysreg driver as a module. As deferred probe between the vexpress components works now, we don't need to create struct devices early with of_platform_device_create(). Cc: Liviu Dudau Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Lee Jones Signed-off-by: Rob Herring commit 0ea355ef78434ae3e8faffe605c98b62e07d1273 Author: Rob Herring Date: Wed Apr 29 15:58:19 2020 -0500 mfd: vexpress-sysreg: Use devres API variants Use the managed devm_gpiochip_add_data() and devm_mfd_add_devices() instead of their unmanaged counterparts. With this, no .remove() hook is needed for driver unbind. Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Acked-by: Lee Jones Signed-off-by: Rob Herring commit 13fc767335caf08eed4de5a07e509cfddf6d2cbd Author: Rob Herring Date: Wed Apr 29 15:58:18 2020 -0500 mfd: vexpress-sysreg: Drop unused syscon child devices The "sys_id", "sys_misc" and "sys_procid" devices don't have a user anywhere in the tree and do nothing more than create a syscon regmap for a single register or 2. That's an overkill for creating child devices. Let's just remove them. Cc: Liviu Dudau Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Lee Jones Signed-off-by: Rob Herring commit a229635f3bc981ea9e19810ae09b171952fa676b Author: Rob Herring Date: Wed Apr 29 15:58:17 2020 -0500 mfd: vexpress-sysreg: Drop selecting CONFIG_CLKSRC_MMIO Nothing in the VExpress sysregs nor the MFD child drivers use CONFIG_CLKSRC_MMIO. There's the 24MHz counter, but that's handled by drivers/clocksource/timer-versatile.c which doesn't use CONFIG_CLKSRC_MMIO either. So let's just drop CONFIG_CLKSRC_MMIO. As the !ARCH_USES_GETTIMEOFFSET dependency was added for CONFIG_CLKSRC_MMIO, that can be dropped, too. Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Acked-by: Lee Jones Signed-off-by: Rob Herring commit 75b272bd093bd0df5d3052b39a8f0dae45e86af5 Author: Rob Herring Date: Wed Apr 29 15:58:16 2020 -0500 clk: vexpress-osc: Support building as a module Enable building the vexpress-osc clock driver as a module. Cc: Linus Walleij Cc: Liviu Dudau Cc: Lorenzo Pieralisi Cc: Michael Turquette Cc: linux-clk@vger.kernel.org Reviewed-by: Sudeep Holla Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring commit 768062fd1284529212daffd360314e9aa93abb62 Author: Anson Huang Date: Wed May 13 10:15:49 2020 -0700 Input: imx_sc_key - use devm_add_action_or_reset() to handle all cleanups Use devm_add_action_or_reset() to handle all cleanups of failure in .probe and .remove, then .remove callback can be dropped. Signed-off-by: Anson Huang Link: https://lore.kernel.org/r/1584082751-17047-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Dmitry Torokhov commit 2ecf9487a7c86e033bab007d63d61f2ec2ca093f Author: Brian Masney Date: Tue May 12 20:03:31 2020 -0700 Input: remove msm-vibrator driver The address referenced by this driver is within the Qualcomm Clock namespace so let's drop the msm-vibrator bindings so that a more generic solution can be used instead. No one is currently using driver so this won't affect any users. Signed-off-by: Brian Masney Link: https://lore.kernel.org/r/20200513013140.69935-3-masneyb@onstation.org Signed-off-by: Dmitry Torokhov commit d364436337007f58356bbe272a0a2adc0fc80d4e Author: Brian Masney Date: Tue May 12 20:03:10 2020 -0700 dt-bindings: Input: remove msm-vibrator The address referenced in this binding is within the Qualcomm Clock namespace so let's drop the msm-vibrator bindings so that a more generic solution can be used instead. No one is currently using these bindings so this won't affect any users. Signed-off-by: Brian Masney Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200513013140.69935-2-masneyb@onstation.org Signed-off-by: Dmitry Torokhov commit eb4a6de4962ecacb5717a45057efc60bb2eca892 Author: David Manouchehri Date: Mon May 11 16:36:23 2020 -0400 thunderbolt: Update Kconfig to allow building on other architectures. Thunderbolt 3 and USB4 shouldn't be x86 only. Tested on a SolidRun HoneyComb (ARM Cortex-A72) with a Gigabyte Titan Ridge Thunderbolt 3 PCIe card (JHL7540). Signed-off-by: David Manouchehri Signed-off-by: Mika Westerberg commit e93fd3b3e89e9664039281fe7e56e6f764f2a909 Author: Sean Christopherson Date: Fri May 1 21:32:34 2020 -0700 KVM: x86/mmu: Capture TDP level when updating CPUID Snapshot the TDP level now that it's invariant (SVM) or dependent only on host capabilities and guest CPUID (VMX). This avoids having to call kvm_x86_ops.get_tdp_level() when initializing a TDP MMU and/or calculating the page role, and thus avoids the associated retpoline. Drop the WARN in vmx_get_tdp_level() as updating CPUID while L2 is active is legal, if dodgy. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200502043234.12481-11-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 0047fcade4cb1204cafdf62150081a39356f4dbd Author: Sean Christopherson Date: Fri May 1 21:32:33 2020 -0700 KVM: VMX: Move nested EPT out of kvm_x86_ops.get_tdp_level() hook Separate the "core" TDP level handling from the nested EPT path to make it clear that kvm_x86_ops.get_tdp_level() is used if and only if nested EPT is not in use (kvm_init_shadow_ept_mmu() calculates the level from the passed in vmcs12->eptp). Add a WARN_ON() to enforce that the kvm_x86_ops hook is not called for nested EPT. This sets the stage for snapshotting the non-"nested EPT" TDP page level during kvm_cpuid_update() to avoid the retpoline associated with kvm_x86_ops.get_tdp_level() when resetting the MMU, a relatively frequent operation when running a nested guest. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200502043234.12481-10-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit bd31fe495d0d1a67fe6f44f06dfef637f202241d Author: Sean Christopherson Date: Fri May 1 21:32:31 2020 -0700 KVM: VMX: Add proper cache tracking for CR0 Move CR0 caching into the standard register caching mechanism in order to take advantage of the availability checks provided by regs_avail. This avoids multiple VMREADs in the (uncommon) case where kvm_read_cr0() is called multiple times in a single VM-Exit, and more importantly eliminates a kvm_x86_ops hook, saves a retpoline on SVM when reading CR0, and squashes the confusing naming discrepancy of "cache_reg" vs. "decache_cr0_guest_bits". No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200502043234.12481-8-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit f98c1e77127de7d9ff558570c25d02ef077df50f Author: Sean Christopherson Date: Fri May 1 21:32:30 2020 -0700 KVM: VMX: Add proper cache tracking for CR4 Move CR4 caching into the standard register caching mechanism in order to take advantage of the availability checks provided by regs_avail. This avoids multiple VMREADs and retpolines (when configured) during nested VMX transitions as kvm_read_cr4_bits() is invoked multiple times on each transition, e.g. when stuffing CR0 and CR3. As an added bonus, this eliminates a kvm_x86_ops hook, saves a retpoline on SVM when reading CR4, and squashes the confusing naming discrepancy of "cache_reg" vs. "decache_cr4_guest_bits". No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200502043234.12481-7-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 0cc69204e77275105d5b0fc4cf3c970e3579457f Author: Sean Christopherson Date: Fri May 1 21:32:26 2020 -0700 KVM: nVMX: Unconditionally validate CR3 during nested transitions Unconditionally check the validity of the incoming CR3 during nested VM-Enter/VM-Exit to avoid invoking kvm_read_cr3() in the common case where the guest isn't using PAE paging. If vmcs.GUEST_CR3 hasn't yet been cached (common case), kvm_read_cr3() will trigger a VMREAD. The VMREAD (~30 cycles) alone is likely slower than nested_cr3_valid() (~5 cycles if vcpu->arch.maxphyaddr gets a cache hit), and the poor exchange only gets worse when retpolines are enabled as the call to kvm_x86_ops.cache_reg() will incur a retpoline (60+ cycles). Signed-off-by: Sean Christopherson Message-Id: <20200502043234.12481-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 56ba77a459a72a7d95be74355a40a91e1f6dd7f7 Author: Sean Christopherson Date: Fri May 1 21:32:25 2020 -0700 KVM: x86: Save L1 TSC offset in 'struct kvm_vcpu_arch' Save L1's TSC offset in 'struct kvm_vcpu_arch' and drop the kvm_x86_ops hook read_l1_tsc_offset(). This avoids a retpoline (when configured) when reading L1's effective TSC, which is done at least once on every VM-Exit. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200502043234.12481-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 1af1bb05625bcdd09522f416b62bcc72cc2fdd3b Author: Sean Christopherson Date: Wed May 6 16:58:50 2020 -0700 KVM: nVMX: Skip IBPB when temporarily switching between vmcs01 and vmcs02 Skip the Indirect Branch Prediction Barrier that is triggered on a VMCS switch when temporarily loading vmcs02 to synchronize it to vmcs12, i.e. give copy_vmcs02_to_vmcs12_rare() the same treatment as vmx_switch_vmcs(). Make vmx_vcpu_load() static now that it's only referenced within vmx.c. Signed-off-by: Sean Christopherson Message-Id: <20200506235850.22600-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 5c911beff20aa8639e7a1f28988736c13e03ed54 Author: Sean Christopherson Date: Fri May 1 09:31:17 2020 -0700 KVM: nVMX: Skip IBPB when switching between vmcs01 and vmcs02 Skip the Indirect Branch Prediction Barrier that is triggered on a VMCS switch when running with spectre_v2_user=on/auto if the switch is between two VMCSes in the same guest, i.e. between vmcs01 and vmcs02. The IBPB is intended to prevent one guest from attacking another, which is unnecessary in the nested case as it's the same guest from KVM's perspective. This all but eliminates the overhead observed for nested VMX transitions when running with CONFIG_RETPOLINE=y and spectre_v2_user=on/auto, which can be significant, e.g. roughly 3x on current systems. Reported-by: Alexander Graf Cc: KarimAllah Raslan Cc: stable@vger.kernel.org Fixes: 15d45071523d ("KVM/x86: Add IBPB support") Signed-off-by: Sean Christopherson Message-Id: <20200501163117.4655-1-sean.j.christopherson@intel.com> [Invert direction of bool argument. - Paolo] Signed-off-by: Paolo Bonzini commit f27ad73a6ef791731fa75ca183d5c64a930b9cc1 Author: Sean Christopherson Date: Mon Apr 27 10:18:37 2020 -0700 KVM: VMX: Use accessor to read vmcs.INTR_INFO when handling exception Use vmx_get_intr_info() when grabbing the cached vmcs.INTR_INFO in handle_exception_nmi() to ensure the cache isn't stale. Bypassing the caching accessor doesn't cause any known issues as the cache is always refreshed by handle_exception_nmi_irqoff(), but the whole point of adding the proper caching mechanism was to avoid such dependencies. Fixes: 8791585837f6 ("KVM: VMX: Cache vmcs.EXIT_INTR_INFO using arch avail_reg flags") Signed-off-by: Sean Christopherson Message-Id: <20200427171837.22613-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit fede8076aab4c2280c673492f8f7a2e87712e8b4 Author: Paolo Bonzini Date: Mon Apr 27 11:55:59 2020 -0400 KVM: x86: handle wrap around 32-bit address space KVM is not handling the case where EIP wraps around the 32-bit address space (that is, outside long mode). This is needed both in vmx.c and in emulate.c. SVM with NRIPS is okay, but it can still print an error to dmesg due to integer overflow. Reported-by: Nick Peterson Signed-off-by: Paolo Bonzini commit c4e115f08c08cb9f3b70247b42323e40b9afd1fd Author: Jason Yan Date: Mon Apr 20 20:38:05 2020 +0800 kvm/eventfd: remove unneeded conversion to bool The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: virt/kvm/eventfd.c:724:38-43: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Message-Id: <20200420123805.4494-1-yanaijie@huawei.com> Reviewed-by: Peter Xu Signed-off-by: Paolo Bonzini commit da4ad88cab5867ee240dfd0585e9d115a8cc47db Author: Davidlohr Bueso Date: Thu Apr 23 22:48:37 2020 -0700 kvm: Replace vcpu->swait with rcuwait The use of any sort of waitqueue (simple or regular) for wait/waking vcpus has always been an overkill and semantically wrong. Because this is per-vcpu (which is blocked) there is only ever a single waiting vcpu, thus no need for any sort of queue. As such, make use of the rcuwait primitive, with the following considerations: - rcuwait already provides the proper barriers that serialize concurrent waiter and waker. - Task wakeup is done in rcu read critical region, with a stable task pointer. - Because there is no concurrency among waiters, we need not worry about rcuwait_wait_event() calls corrupting the wait->task. As a consequence, this saves the locking done in swait when modifying the queue. This also applies to per-vcore wait for powerpc kvm-hv. The x86 tscdeadline_latency test mentioned in 8577370fb0cb ("KVM: Use simple waitqueue for vcpu->wq") shows that, on avg, latency is reduced by around 15-20% with this change. Cc: Paul Mackerras Cc: kvmarm@lists.cs.columbia.edu Cc: linux-mips@vger.kernel.org Reviewed-by: Marc Zyngier Signed-off-by: Davidlohr Bueso Message-Id: <20200424054837.5138-6-dave@stgolabs.net> [Avoid extra logic changes. - Paolo] Signed-off-by: Paolo Bonzini commit 191a43be61d6791fd4a9098a35c1a09e73f55228 Author: Davidlohr Bueso Date: Thu Apr 23 22:48:36 2020 -0700 rcuwait: Introduce rcuwait_active() This call is lockless and thus should not be trusted blindly. For example, the return value of rcuwait_wakeup() should be used to track whether a process was woken up. Signed-off-by: Davidlohr Bueso Message-Id: <20200424054837.5138-5-dave@stgolabs.net> Acked-by: Peter Zijlstra (Intel) Signed-off-by: Paolo Bonzini commit 5c21f7b322cb9fcb97f2e22f5976a0ae8dd71354 Author: Davidlohr Bueso Date: Thu Apr 23 22:48:35 2020 -0700 rcuwait: Introduce prepare_to and finish_rcuwait This allows further flexibility for some callers to implement ad-hoc versions of the generic rcuwait_wait_event(). For example, kvm will need this to maintain tracing semantics. The naming is of course similar to what waitqueue apis offer. Also go ahead and make use of rcu_assign_pointer() for both task writes as it will make the __rcu sparse people happy - this will be the special nil case, thus no added serialization. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Davidlohr Bueso Message-Id: <20200424054837.5138-4-dave@stgolabs.net> Signed-off-by: Paolo Bonzini commit 9d9a6ebfea329cadeda87544dceae01e9c27aaef Author: Davidlohr Bueso Date: Thu Apr 23 22:48:34 2020 -0700 rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken Propagating the return value of wake_up_process() back to the caller can come in handy for future users, such as for statistics or accounting purposes. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Davidlohr Bueso Message-Id: <20200424054837.5138-3-dave@stgolabs.net> Signed-off-by: Paolo Bonzini commit c9d64a1b2d0b9c81aef5e907bbeff549fd844d13 Author: Davidlohr Bueso Date: Thu Apr 23 22:48:33 2020 -0700 rcuwait: Fix stale wake call name in comment The 'trywake' name was renamed to simply 'wake', update the comment. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Davidlohr Bueso Message-Id: <20200424054837.5138-2-dave@stgolabs.net> Signed-off-by: Paolo Bonzini commit c300ab9f08df9e4b9f39d53a0691e234330df124 Author: Paolo Bonzini Date: Thu Apr 23 14:08:58 2020 -0400 KVM: x86: Replace late check_nested_events() hack with more precise fix Add an argument to interrupt_allowed and nmi_allowed, to checking if interrupt injection is blocked. Use the hook to handle the case where an interrupt arrives between check_nested_events() and the injection logic. Drop the retry of check_nested_events() that hack-a-fixed the same condition. Blocking injection is also a bit of a hack, e.g. KVM should do exiting and non-exiting interrupt processing in a single pass, but it's a more precise hack. The old comment is also misleading, e.g. KVM_REQ_EVENT is purely an optimization, setting it on every run loop (which KVM doesn't do) should not affect functionality, only performance. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-13-sean.j.christopherson@intel.com> [Extend to SVM, add SMI and NMI. Even though NMI and SMI cannot come asynchronously right now, making the fix generic is easy and removes a special case. - Paolo] Signed-off-by: Paolo Bonzini commit 7ab0abdb553e62704be5b7879a0971acf9f36a06 Author: Sean Christopherson Date: Wed Apr 22 19:25:50 2020 -0700 KVM: VMX: Use vmx_get_rflags() to query RFLAGS in vmx_interrupt_blocked() Use vmx_get_rflags() instead of manually reading vmcs.GUEST_RFLAGS when querying RFLAGS.IF so that multiple checks against interrupt blocking in a single run loop only require a single VMREAD. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-14-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit db438592807e059e3b730f556c22ae201f4d4ebc Author: Sean Christopherson Date: Wed Apr 22 19:25:48 2020 -0700 KVM: VMX: Use vmx_interrupt_blocked() directly from vmx_handle_exit() Use vmx_interrupt_blocked() instead of bouncing through vmx_interrupt_allowed() when handling edge cases in vmx_handle_exit(). The nested_run_pending check in vmx_interrupt_allowed() should never evaluate true in the VM-Exit path. Hoist the WARN in handle_invalid_guest_state() up to vmx_handle_exit() to enforce the above assumption for the !enable_vnmi case, and to detect any other potential bugs with nested VM-Enter. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-12-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 3b82b8d7fdf7c1c284cfa6ebe273435483bcbd9d Author: Sean Christopherson Date: Wed Apr 22 19:25:47 2020 -0700 KVM: x86: WARN on injected+pending exception even in nested case WARN if a pending exception is coincident with an injected exception before calling check_nested_events() so that the WARN will fire even if inject_pending_event() bails early because check_nested_events() detects the conflict. Bailing early isn't problematic (quite the opposite), but suppressing the WARN is undesirable as it could mask a bug elsewhere in KVM. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-11-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 221e761090b4ffadf41acaca1e1f6dd97d84ef4f Author: Paolo Bonzini Date: Thu Apr 23 08:13:10 2020 -0400 KVM: nSVM: Preserve IRQ/NMI/SMI priority irrespective of exiting behavior Short circuit vmx_check_nested_events() if an unblocked IRQ/NMI/SMI is pending and needs to be injected into L2, priority between coincident events is not dependent on exiting behavior. Fixes: b518ba9fa691 ("KVM: nSVM: implement check_nested_events for interrupts") Signed-off-by: Paolo Bonzini commit fc6f7c03ad80693c953d5cdacfad41f174289531 Author: Paolo Bonzini Date: Thu Apr 23 18:02:45 2020 -0400 KVM: nSVM: Report interrupts as allowed when in L2 and exit-on-interrupt is set Report interrupts as allowed when the vCPU is in L2 and L2 is being run with exit-on-interrupts enabled and EFLAGS.IF=1 (either on the host or on the guest according to VINTR). Interrupts are always unblocked from L1's perspective in this case. While moving nested_exit_on_intr to svm.h, use INTERCEPT_INTR properly instead of assuming it's zero (which it is of course). Signed-off-by: Paolo Bonzini commit 1cd2f0b0dd9218fd11ced9ac97237f0c9517f49e Author: Sean Christopherson Date: Wed Apr 22 19:25:46 2020 -0700 KVM: nVMX: Prioritize SMI over nested IRQ/NMI Check for an unblocked SMI in vmx_check_nested_events() so that pending SMIs are correctly prioritized over IRQs and NMIs when the latter events will trigger VM-Exit. This also fixes an issue where an SMI that was marked pending while processing a nested VM-Enter wouldn't trigger an immediate exit, i.e. would be incorrectly delayed until L2 happened to take a VM-Exit. Fixes: 64d6067057d96 ("KVM: x86: stubs for SMM support") Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-10-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 15ff0b450b6541120803de40af5ca96dde1b56b2 Author: Sean Christopherson Date: Wed Apr 22 19:25:45 2020 -0700 KVM: nVMX: Preserve IRQ/NMI priority irrespective of exiting behavior Short circuit vmx_check_nested_events() if an unblocked IRQ/NMI is pending and needs to be injected into L2, priority between coincident events is not dependent on exiting behavior. Fixes: b6b8a1451fc4 ("KVM: nVMX: Rework interception of IRQs and NMIs") Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-9-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit cae96af18452336aff85c95c6892aab1ed955eed Author: Paolo Bonzini Date: Thu Apr 23 14:19:26 2020 -0400 KVM: SVM: Split out architectural interrupt/NMI/SMI blocking checks Move the architectural (non-KVM specific) interrupt/NMI/SMI blocking checks to a separate helper so that they can be used in a future patch by svm_check_nested_events(). No functional change intended. Signed-off-by: Paolo Bonzini commit 1b660b6baaafd8b9056740b83decd7fc74023627 Author: Sean Christopherson Date: Wed Apr 22 19:25:44 2020 -0700 KVM: VMX: Split out architectural interrupt/NMI blocking checks Move the architectural (non-KVM specific) interrupt/NMI blocking checks to a separate helper so that they can be used in a future patch by vmx_check_nested_events(). No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-8-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 55714cddbf1028bbfa19fd7d69182de3f135ce99 Author: Paolo Bonzini Date: Thu Apr 23 08:17:28 2020 -0400 KVM: nSVM: Move SMI vmexit handling to svm_check_nested_events() Unlike VMX, SVM allows a hypervisor to take a SMI vmexit without having any special SMM-monitor enablement sequence. Therefore, it has to be handled like interrupts and NMIs. Check for an unblocked SMI in svm_check_nested_events() so that pending SMIs are correctly prioritized over IRQs and NMIs when the latter events will trigger VM-Exit. Note that there is no need to test explicitly for SMI vmexits, because guests always runs outside SMM and therefore can never get an SMI while they are blocked. Signed-off-by: Paolo Bonzini commit bbdad0b5a708ddb37a9f051504c2133fa92df97a Author: Paolo Bonzini Date: Thu Apr 23 08:06:43 2020 -0400 KVM: nSVM: Report NMIs as allowed when in L2 and Exit-on-NMI is set Report NMIs as allowed when the vCPU is in L2 and L2 is being run with Exit-on-NMI enabled, as NMIs are always unblocked from L1's perspective in this case. Signed-off-by: Paolo Bonzini commit 429ab576f387c8fcaeb2a172901aaba3c6794310 Author: Sean Christopherson Date: Wed Apr 22 19:25:42 2020 -0700 KVM: nVMX: Report NMIs as allowed when in L2 and Exit-on-NMI is set Report NMIs as allowed when the vCPU is in L2 and L2 is being run with Exit-on-NMI enabled, as NMIs are always unblocked from L1's perspective in this case. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-7-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit a9fa7cb6aa997ba58294f1a07d402ce5855bafe1 Author: Paolo Bonzini Date: Thu Apr 23 11:02:36 2020 -0400 KVM: x86: replace is_smm checks with kvm_x86_ops.smi_allowed Do not hardcode is_smm so that all the architectural conditions for blocking SMIs are listed in a single place. Well, in two places because this introduces some code duplication between Intel and AMD. This ensures that nested SVM obeys GIF in kvm_vcpu_has_events. Signed-off-by: Paolo Bonzini commit 88c604b66eb6a74841cd40f5bdf639112ad69115 Author: Sean Christopherson Date: Wed Apr 22 19:25:41 2020 -0700 KVM: x86: Make return for {interrupt_nmi,smi}_allowed() a bool instead of int Return an actual bool for kvm_x86_ops' {interrupt_nmi}_allowed() hook to better reflect the return semantics, and to avoid creating an even bigger mess when the related VMX code is refactored in upcoming patches. Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-5-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8081ad06b68a728e676d3b08e9ab70ce4039747b Author: Sean Christopherson Date: Wed Apr 22 19:25:40 2020 -0700 KVM: x86: Set KVM_REQ_EVENT if run is canceled with req_immediate_exit set Re-request KVM_REQ_EVENT if vcpu_enter_guest() bails after processing pending requests and an immediate exit was requested. This fixes a bug where a pending event, e.g. VMX preemption timer, is delayed and/or lost if the exit was deferred due to something other than a higher priority _injected_ event, e.g. due to a pending nested VM-Enter. This bug only affects the !injected case as kvm_x86_ops.cancel_injection() sets KVM_REQ_EVENT to redo the injection, but that's purely serendipitous behavior with respect to the deferred event. Note, emulated preemption timer isn't the only event that can be affected, it simply happens to be the only event where not re-requesting KVM_REQ_EVENT is blatantly visible to the guest. Fixes: f4124500c2c13 ("KVM: nVMX: Fully emulate preemption timer") Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-4-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit d2060bd42e4482b15c35f961a294ee57f369027d Author: Sean Christopherson Date: Wed Apr 22 19:25:39 2020 -0700 KVM: nVMX: Open a window for pending nested VMX preemption timer Add a kvm_x86_ops hook to detect a nested pending "hypervisor timer" and use it to effectively open a window for servicing the expired timer. Like pending SMIs on VMX, opening a window simply means requesting an immediate exit. This fixes a bug where an expired VMX preemption timer (for L2) will be delayed and/or lost if a pending exception is injected into L2. The pending exception is rightly prioritized by vmx_check_nested_events() and injected into L2, with the preemption timer left pending. Because no window opened, L2 is free to run uninterrupted. Fixes: f4124500c2c13 ("KVM: nVMX: Fully emulate preemption timer") Reported-by: Jim Mattson Cc: Oliver Upton Cc: Peter Shier Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-3-sean.j.christopherson@intel.com> [Check it in kvm_vcpu_has_events too, to ensure that the preemption timer is serviced promptly even if the vCPU is halted and L1 is not intercepting HLT. - Paolo] Signed-off-by: Paolo Bonzini commit 6ce347af1499deff5890a52aedacd451330af706 Author: Sean Christopherson Date: Wed Apr 22 19:25:38 2020 -0700 KVM: nVMX: Preserve exception priority irrespective of exiting behavior Short circuit vmx_check_nested_events() if an exception is pending and needs to be injected into L2, priority between coincident events is not dependent on exiting behavior. This fixes a bug where a single-step #DB that is not intercepted by L1 is incorrectly dropped due to servicing a VMX Preemption Timer VM-Exit. Injected exceptions also need to be blocked if nested VM-Enter is pending or an exception was already injected, otherwise injecting the exception could overwrite an existing event injection from L1. Technically, this scenario should be impossible, i.e. KVM shouldn't inject its own exception during nested VM-Enter. This will be addressed in a future patch. Note, event priority between SMI, NMI and INTR is incorrect for L2, e.g. SMI should take priority over VM-Exit on NMI/INTR, and NMI that is injected into L2 should take priority over VM-Exit INTR. This will also be addressed in a future patch. Fixes: b6b8a1451fc4 ("KVM: nVMX: Rework interception of IRQs and NMIs") Reported-by: Jim Mattson Cc: Oliver Upton Cc: Peter Shier Signed-off-by: Sean Christopherson Message-Id: <20200423022550.15113-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 9c3d370a8efaac49b0520617c9ab4e552aefbf1e Author: Cathy Avery Date: Tue Apr 14 16:11:06 2020 -0400 KVM: SVM: Implement check_nested_events for NMI Migrate nested guest NMI intercept processing to new check_nested_events. Signed-off-by: Cathy Avery Message-Id: <20200414201107.22952-2-cavery@redhat.com> [Reorder clauses as NMIs have higher priority than IRQs; inject immediate vmexit as is now done for IRQ vmexits. - Paolo] Signed-off-by: Paolo Bonzini commit 6e085cbfb0f0c7de4ca0f370adb572b0e07a818c Author: Paolo Bonzini Date: Thu Apr 23 13:15:33 2020 -0400 KVM: SVM: immediately inject INTR vmexit We can immediately leave SVM guest mode in svm_check_nested_events now that we have the nested_run_pending mechanism. This makes things easier because we can run the rest of inject_pending_event with GIF=0, and KVM will naturally end up requesting the next interrupt window. Signed-off-by: Paolo Bonzini commit 38c0b192bd6df089cdffd9828d19e764385f96e6 Author: Paolo Bonzini Date: Thu Apr 23 13:13:09 2020 -0400 KVM: SVM: leave halted state on vmexit Similar to VMX, we need to leave the halted state when performing a vmexit. Failure to do so will cause a hang after vmexit. Signed-off-by: Paolo Bonzini commit f74f94140fa50f768e61d626de4c146502b9102d Author: Paolo Bonzini Date: Thu Apr 23 13:22:27 2020 -0400 KVM: SVM: introduce nested_run_pending We want to inject vmexits immediately from svm_check_nested_events, so that the interrupt/NMI window requests happen in inject_pending_event right after it returns. This however has the same issue as in vmx_check_nested_events, so introduce a nested_run_pending flag with the exact same purpose of delaying vmexit injection after the vmentry. Signed-off-by: Paolo Bonzini commit 4aef2ec9022b217f74d0f4c9b84081f07cc223d9 Merge: 7c67f54661fc 37486135d3a7 Author: Paolo Bonzini Date: Wed May 13 12:14:05 2020 -0400 Merge branch 'kvm-amd-fixes' into HEAD commit 0e36f32f6b6c4c86a6bf3d6f0940831691b0a3b0 Author: Dan Murphy Date: Wed May 13 09:28:07 2020 -0500 ASoC: tlv320adcx140: Fix bias config values The device tree binding declares the ti,mic-bias-source and the ti,vref-source properties as u32. The code reads them as u8 which is incorrect. Since the device tree binding indicates them as u32 the conde needs to be updated to read u32. In addition the bias source needs to be shifted 4 bits to correctly write the register. driver family") Fixes: 37bde5acf040 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200513142807.11802-1-dmurphy@ti.com Signed-off-by: Mark Brown commit 4a0ca47a8e2fdfb7c9f5b23bba79fa632a5cd8fc Author: Chris Wilson Date: Wed May 13 13:28:26 2020 +0100 drm/i915/gt: Suspend tasklets before resume sanitization It is possible for a residual tasklet to be pending execution as we resume (whether that's some prior test kicking off the tasklet, or if we are in a suspend/resume stress test). As such, we do not want that tasklet to execute in the middle of our sanitization, such that it sees the poisoned state. For example, <4>[ 449.386553] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI <4>[ 449.386555] CPU: 1 PID: 5115 Comm: i915_selftest Tainted: G U W 5.7.0-rc4-CI-CI_DRM_8472+ #1 <4>[ 449.386556] Hardware name: Intel Corporation Ice Lake Client Platform/IceLake U DDR4 SODIMM PD RVP TLC, BIOS ICLSFWR1.R00.3183.A00.1905020411 05/02/2019 <4>[ 449.386585] RIP: 0010:process_csb+0x6bf/0x830 [i915] <4>[ 449.386588] Code: 00 48 c7 c2 10 bc 4c a0 48 c7 c7 d4 75 34 a0 e8 87 0e e6 e0 bf 01 00 00 00 e8 9d e0 e5 e0 31 f6 bf 09 00 00 00 e8 e1 ba d6 e0 <0f> 0b 8b 87 10 05 00 00 85 c0 0f 85 5f f9 ff ff 48 c7 c1 70 a5 4f <4>[ 449.386591] RSP: 0018:ffffc90000170ea0 EFLAGS: 00010297 <4>[ 449.386594] RAX: 0000000080000101 RBX: 0000000000000000 RCX: 0000000000000000 <4>[ 449.386596] RDX: ffff88849d5bc040 RSI: 0000000000000000 RDI: 0000000000000009 <4>[ 449.386598] RBP: ffffc90000170f00 R08: 0000000000000000 R09: 0000000000000000 <4>[ 449.386600] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88843ccea018 <4>[ 449.386602] R13: ffff88843ccea658 R14: ffff88843ccea640 R15: ffff88843ccea000 <4>[ 449.386605] FS: 00007f826a813300(0000) GS:ffff88849fe80000(0000) knlGS:0000000000000000 <4>[ 449.386607] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4>[ 449.386609] CR2: 0000560366b94280 CR3: 000000048ba02002 CR4: 0000000000760ee0 <4>[ 449.386611] PKRU: 55555554 <4>[ 449.386613] Call Trace: <4>[ 449.386616] <4>[ 449.386646] ? execlists_submission_tasklet+0xcf/0x140 [i915] <4>[ 449.386674] execlists_submission_tasklet+0x2f/0x140 [i915] <4>[ 449.386679] tasklet_action_common.isra.16+0x6c/0x1c0 <4>[ 449.386684] __do_softirq+0xdf/0x49e <4>[ 449.386687] irq_exit+0xba/0xc0 <4>[ 449.386690] smp_apic_timer_interrupt+0xb7/0x280 <4>[ 449.386693] apic_timer_interrupt+0xf/0x20 <4>[ 449.386695] <4>[ 449.386698] RIP: 0010:_raw_spin_unlock_irqrestore+0x49/0x60 <4>[ 449.386701] Code: c7 02 75 1f 53 9d e8 26 ab 75 ff bf 01 00 00 00 e8 7c a3 69 ff 65 8b 05 7d 9b 5c 7e 85 c0 74 0c 5b 5d c3 e8 09 aa 75 ff 53 9d df e8 ca 39 5b ff 5b 5d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 <4>[ 449.386703] RSP: 0018:ffffc90000a6b950 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 <4>[ 449.386706] RAX: 0000000080000001 RBX: 0000000000000202 RCX: 0000000000000000 <4>[ 449.386708] RDX: ffff88849d5bc040 RSI: ffff88849d5bc900 RDI: ffffffff82386f12 <4>[ 449.386710] RBP: ffff88847d400f00 R08: ffff88849d5bc900 R09: 0000000000000000 <4>[ 449.386712] R10: 0000000000000000 R11: 0000000000000000 R12: 00000000ffff0b0b <4>[ 449.386714] R13: 000000000000000c R14: ffff88847d40bf70 R15: ffff88847d40cef8 <4>[ 449.386742] reset_csb_pointers+0x59/0x140 [i915] <4>[ 449.386769] execlists_sanitize+0x3e/0x60 [i915] <4>[ 449.386797] gt_sanitize+0xd6/0x260 [i915] As part of the reset preparation, engine->reset.prepare() prevents the tasklet from running, so pull the sanitization inside the critical section for reset. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1812 Fixes: 23122a4d992b ("drm/i915/gt: Scrub execlists state on resume") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200513122826.27484-1-chris@chris-wilson.co.uk commit c73fb4d33e1df3fc62a6521601227efd1e2ff9f1 Merge: b6ba5761faad d3d2674cc6ff Author: Kalle Valo Date: Wed May 13 19:10:08 2020 +0300 Merge tag 'iwlwifi-next-for-kalle-2020-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next Second set of iwlwifi patches intended for v5.8 * Support new FW APIs; * Remove some old and unused features; * HW configuration rework continues; * Some queues rework by Johannes; * Enable A-AMSDU in low latency; * Some debugging fixes; * Some other small fixes and clean-ups; # gpg: Signature made Fri 08 May 2020 10:08:58 AM EEST using RSA key ID 1A3CC5FA # gpg: Good signature from "Luciano Roth Coelho (Luca) " # gpg: aka "Luciano Roth Coelho (Intel) " commit ec431188b4197aaccfbc6e6ece4fb88f79723635 Author: Gustavo A. R. Silva Date: Thu May 7 10:17:58 2020 -0500 wcn36xx: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507151758.GA4962@embeddedor commit 012f81456818dfb49d2939373b163945da3a4032 Author: Pradeep Kumar Chitrapu Date: Tue May 12 10:42:02 2020 +0300 ath11k: fix htt stats module not handle multiple skbs HTT EXT stats comes in stream of TLVs spanning over multiple messages. Currently completion is being sent for each message which is creating a race where stats_req is being accessed for filling in second message after the memory is already freed in release operation. Fix this by issuing completion once all the messages are received and processed. Driver knows this info from DONE bit set in htt msg. Also fix locking required for htt stats. Co-developed-by: Miles Hu Signed-off-by: Miles Hu Signed-off-by: Pradeep Kumar Chitrapu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1589221074-28778-1-git-send-email-pradeepc@codeaurora.org commit 9254f8ed15b6dcc9b04b9ad32863a7518cc5a5b1 Author: Maor Gottlieb Date: Mon May 4 08:30:10 2020 +0300 net/mlx5: Add support in forward to namespace Currently, fs_core supports rule of forward the traffic to continue matching in the next priority, now we add support to forward the traffic matching in the next namespace. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky commit 14c129e30152f7d74c8b25ec06ae742f4291e166 Author: Maor Gottlieb Date: Mon May 4 08:30:09 2020 +0300 {IB/net}/mlx5: Simplify don't trap code The fs_core already supports creation of rules with multiple actions/destinations. Refactor fs_core to handle the case when don't trap rule is created with destination. Adapt the calling code in the driver. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Zhang Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky commit b6ba5761faad24fa5d6b931682a74071f3511fdc Author: ChenTao Date: Wed May 13 09:17:54 2020 +0800 rtl8187: Remove unused variable rtl8225z2_tx_power_ofdm Fix the following warning: drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c:609:17: warning: ‘rtl8225z2_tx_power_ofdm’ defined but not used static const u8 rtl8225z2_tx_power_ofdm[] = { Acked-by: Hin-Tak Leung Acked-by: Larry Finger Reported-by: Hulk Robot Signed-off-by: ChenTao Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200513011754.28432-1-chentao107@huawei.com commit 0c4402385ac46afe5dc8c5854f9ce9028afcf69e Author: Yan-Hsuan Chuang Date: Tue May 12 18:35:34 2020 +0800 rtw88: 8723d: fix sparse warnings for power tracking sparse warnings: (new ones prefixed by >>) >> drivers/net/wireless/realtek/rtw88/rtw8723d.c:1899:6: sparse: sparse: symbol 'rtw8723d_pwr_track' was not declared. Should it be static? Reported-by: kbuild test robot Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512103534.5889-1-yhchuang@realtek.com commit f5df1a8b4376551f7fb2416135c58896b70a1467 Author: Ping-Ke Shih Date: Tue May 12 18:26:21 2020 +0800 rtw88: 8723d: Add 8723DE to Kconfig and Makefile Since 8723D code is ready, we can build it. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-10-yhchuang@realtek.com commit 504e2b288258e8e28d46f3e314be7cb460bdd655 Author: Ping-Ke Shih Date: Tue May 12 18:26:20 2020 +0800 rtw88: fill zeros to words 0x06 and 0x07 of security cam entry 8723D adds some experimental features to word 0x06 of cam entry, so fill zeros to initialize them to off state. For existing chips, these two words are reserved and always zeros, so this change is harmless for them. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-9-yhchuang@realtek.com commit d1391c490085156222e0baa8124b93fc494d96d8 Author: Ping-Ke Shih Date: Tue May 12 18:26:19 2020 +0800 rtw88: 8723d: Add coex support 8723D is a Wifi+BT combo card. To make them work properly, we need coex mechanism to avoid interference, such as TX simultaneously. Basically, coex.c provide main algorithm to deal with many use cases, and this commit adds some parameters and ops differ from other chips, because coex hardware and WiFi generation are changed. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-8-yhchuang@realtek.com commit 7e14936881caf0a36b49833bd8aca13f2c5a8efe Author: Ping-Ke Shih Date: Tue May 12 18:26:18 2020 +0800 rtw88: 8723d: set ltecoex register address in chip_info Since 8723D use different address of ltecoex register, this commit add a new field in chip_info and fill proper address. Then, ltecoex_read_reg() and ltecoex_reg_write() can use them to access ltecoex according to chip. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-7-yhchuang@realtek.com commit 7d754f974ac79640c8efda86d35d766704ebaa8e Author: Ping-Ke Shih Date: Tue May 12 18:26:17 2020 +0800 rtw88: 8723d: implement flush queue Flush queue is used to check if queue is empty, before doing something else. Since 8723D uses different registers and page number of availabl/reserved occupy 8 bits instead of 16 bits, so use a 'wsize' field to discriminate which rtw_read{8,16} is adopted. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-6-yhchuang@realtek.com commit 05202746ed70ea9601ab78657025adcdf945293c Author: Ping-Ke Shih Date: Tue May 12 18:26:16 2020 +0800 rtw88: 8723d: Add shutdown callback to disable BT USB suspend Without this patch, wifi card can't initialize properly due to BT in USB suspend state. So, we disable BT USB suspend (wakeup) in shutdown callback that is the moment before rebooting. To save BT USB power, we can't do this in 'remove' callback. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-5-yhchuang@realtek.com commit 608d2a08f842d8f1ca877ced7bf092f084717553 Author: Ping-Ke Shih Date: Tue May 12 18:26:15 2020 +0800 rtw88: 8723d: Add power tracking When chip's temperature is changed, RF characters are changed. To keep the characters to be consistent, 8723d uses thermal meter to assist in calibrating LCK, IQK, crystal and TX power. A base thermal value is programmed in efuse, all calibration data in MP process is based on this thermal value. So we calucate the delta of thermal value between the base value, and use this delta to reference XTAL and TX power offset tables to know how much we need to adjust. For IQK and LCK, driver checks if delta of thermal value is over 8, then they are triggered. For crystal adjustment, when delta of thermal value is changed, we check XTAL tables to get offset of XTAL value. If thermal value is larger than base value, positive table (_p as suffix) is used. Otherwise, we use negative table (_n as suffix). Then, we add offset to XTAL default value programmed in efuse, and write sum value to register. To compensate TX power, there are two hierarchical tables. First level use delta of thermal value to access eight tables to yield delta of TX power index. Then, plus base TX power index to get index of BB swing table (second level tables) where register value is induced. BB swing table can't deal with all cases, if index of BB swing table is over the size of the table. In this case, TX AGC is used to compensate the remnant part. Assume 'upper' is the upper bound of BB swing table, and 'target' is the desired index. Then, we can illustrate them as compensation method BB swing TX AGC ------------------- -------- -------------- target > upper upper target - upper target < 0 0 target otherwise target 0 For debug purpose, add a column 'rem' to tx_pwr_tbl entry, and it looks like path rate pwr base (byr lmt ) rem A CCK_1M 32(0x20) 34 -2 ( 0 -2) 0 Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-4-yhchuang@realtek.com commit 1d229e88e53c20717a51ef8d8f9a69573167543a Author: Ping-Ke Shih Date: Tue May 12 18:26:14 2020 +0800 rtw88: 8723d: add IQ calibration IQ calibration is used to calibrate RF characteristic to yield expected performance. Basically, we do calibration twice and compare the similarity to determine calibration is good or not, if not we do the third calibration, and then compare with the results of first and second calibration. If it still not similar, IQK is failed. Before doing calibration, we need to backup registers that will be modified in calibration procedure, and restore these registers after calibration is done. A calibration procedure can divided into four sub-procedures that are S1-TX, S1-RX, S0-TX and S0-RX. Where, S1 and S0 represent to path A and B respectively. Each sub-procedure configure proper registers, and then rigger one-shot calibration and poll until completion. For RX calibration, it needs to do twice one-shot calibration, first one is to yield parameter used by second one. The result of TX part is stored for TX power tracking that adjusts TX AGC to output expected power. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-3-yhchuang@realtek.com commit f71eb7f603170bf8742c53c9fb72a64df04cb6e4 Author: Ping-Ke Shih Date: Tue May 12 18:26:13 2020 +0800 rtw88: 8723d: Add LC calibration LC calibration is done by hardware circuit. Driver sets the LCK bit to kick start, and then poll the bit to check if it's done. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200512102621.5148-2-yhchuang@realtek.com commit b2fe11f0777311a764e47e2f9437809b4673b7b1 Author: Chung-Hsien Hsu Date: Tue May 12 05:03:08 2020 -0500 brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures An incorrect value of use_fwsup is set for 4-way handshake offload for WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication offload"). It results in missing bit BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the failure. This patch correct the value for the case. Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in brcmf_is_linkup() to fix SAE offload failure. Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication offload") Signed-off-by: Chung-Hsien Hsu Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1589277788-119966-1-git-send-email-chi-hsien.lin@cypress.com commit 2c567af418e3f9380c2051aada58b4e5a4b5c2ad Author: Ira Weiny Date: Thu Apr 30 07:41:37 2020 -0700 fs: Introduce DCACHE_DONTCACHE DCACHE_DONTCACHE indicates a dentry should not be cached on final dput(). Also add a helper function to mark DCACHE_DONTCACHE on all dentries pointing to a specific inode when that inode is being set I_DONTCACHE. This facilitates dropping dentry references to inodes sooner which require eviction to swap S_DAX mode. Cc: Al Viro Signed-off-by: Ira Weiny Reviewed-by: Jan Kara Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit dae2f8ed7992e88c8d62c54e8295ffc8475b4a80 Author: Ira Weiny Date: Thu Apr 30 07:41:37 2020 -0700 fs: Lift XFS_IDONTCACHE to the VFS layer DAX effective mode (S_DAX) changes requires inode eviction. XFS has an advisory flag (XFS_IDONTCACHE) to prevent caching of the inode if no other additional references are taken. We lift this flag to the VFS layer and change the behavior slightly by allowing the flag to remain even if multiple references are taken. This will expedite the eviction of inodes to change S_DAX. Cc: Al Viro Reviewed-by: Dave Chinner Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9b5816b56af6a424619ab51d24de34dfc65102d8 Author: Gustavo A. R. Silva Date: Thu May 7 13:53:13 2020 -0500 gnss: replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Johan Hovold commit 5e23663b49e1e8ee6b805356259e3062edac5e2b Author: Fabian Frederick Date: Tue May 12 20:19:21 2020 +0200 fanotify: don't write with size under sizeof(response) fanotify_write() only aligned copy_from_user size to sizeof(response) for higher values. This patch avoids all values below as suggested by Amir Goldstein and set to response size unconditionally. Link: https://lore.kernel.org/r/20200512181921.405973-1-fabf@skynet.be Signed-off-by: Fabian Frederick Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit 5a449099b9d5b0a1ac23c1cdbda4bfbaf4b27076 Author: Fabian Frederick Date: Tue May 12 20:19:06 2020 +0200 fsnotify: Remove proc_fs.h include proc_fs.h was already included in fdinfo.h Link: https://lore.kernel.org/r/20200512181906.405927-1-fabf@skynet.be Signed-off-by: Fabian Frederick Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit c5e443cb7b6ce6c6a5f49640359f6e834d6a6ed4 Author: Fabian Frederick Date: Tue May 12 20:18:36 2020 +0200 fanotify: remove reference to fill_event_metadata() fill_event_metadata() was removed in commit bb2f7b4542c7 ("fanotify: open code fill_event_metadata()") Link: https://lore.kernel.org/r/20200512181836.405879-1-fabf@skynet.be Signed-off-by: Fabian Frederick Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit 191e1656d18c47d8815f6618431a387d99944884 Author: Fabian Frederick Date: Tue May 12 20:18:03 2020 +0200 fsnotify: add mutex destroy Call mutex_destroy() before freeing notification group. This only adds some additional debug checks when mutex debugging is enabled but still it may be useful. Link: https://lore.kernel.org/r/20200512181803.405832-1-fabf@skynet.be Signed-off-by: Fabian Frederick Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit ab3c4da0ad12fb8b4c80ab2d98ce214a58e00c04 Author: Fabian Frederick Date: Tue May 12 20:17:15 2020 +0200 fanotify: prefix should_merge() Prefix function with fanotify_ like others. Link: https://lore.kernel.org/r/20200512181715.405728-1-fabf@skynet.be Signed-off-by: Fabian Frederick Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara commit 0cb9e4f9e98af4b969b9140e964c646ad6ed7d40 Author: Gustavo A. R. Silva Date: Thu May 7 13:53:42 2020 -0500 IB/rdmavt: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/20200507185342.GA14476@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jason Gunthorpe commit d9fd428a304f2e33caf609011cdc9f17a8d3fb9e Author: Gustavo A. R. Silva Date: Thu May 7 14:00:46 2020 -0500 dmaengine: at_xdmac: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200507190046.GA15298@embeddedor Signed-off-by: Vinod Koul commit e05a0b78f39f39488c3ea8866aee2b953e206a02 Author: Gustavo A. R. Silva Date: Thu May 7 14:00:38 2020 -0500 dmaengine: at_hdmac: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200507190038.GA15272@embeddedor Signed-off-by: Vinod Koul commit c18b5bdebd67112314fe73762d269d381ce3073c Author: Gustavo A. R. Silva Date: Fri May 8 16:07:07 2020 -0500 dmaengine: qcom: bam_dma: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Reviewed-by: Jeffrey Hugo Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200508210707.GA24136@embeddedor Signed-off-by: Vinod Koul commit 214a0006b2c83ffa41794a424a9dd6758ca9eb4d Author: Samuel Zou Date: Wed May 6 17:25:46 2020 +0800 dmaengine: ti: k3-udma: Use PTR_ERR_OR_ZERO() to simplify code Fixes coccicheck warnings: drivers/dma/ti/k3-udma.c:1294:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/dma/ti/k3-udma.c:1311:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/dma/ti/k3-udma.c:1376:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou Link: https://lore.kernel.org/r/1588757146-38858-1-git-send-email-zou_wei@huawei.com Signed-off-by: Vinod Koul commit 43d7ce70ae43dd8523754b17f567417e0e75dbce Author: Wei Yongjun Date: Thu May 7 09:42:52 2020 +0000 gnss: sirf: fix error return code in sirf_probe() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. This avoids a use-after-free in case the driver is later unbound. Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun [ johan: amend commit message; mention potential use-after-free ] Cc: stable # 4.19 Signed-off-by: Johan Hovold commit 5961bdf2dfe5d7fa9e9e6cc3cc67d02f122a46bd Author: Clément Péron Date: Fri May 8 21:10:35 2020 +0200 arm64: dts: allwinner: h6: Enable CPU opp tables for Tanix TX6 Enable CPU opp tables for Tanix TX6. Also add the fixed regulator that provided vdd-cpu-gpu required for CPU opp tables. This voltage has been found using a voltmeter and could be wrong. Tested-by: Jernej Škrabec Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit c83e24e7bf1cfa7486165f066f2bc1335703e1fd Author: Clément Péron Date: Fri May 8 21:10:34 2020 +0200 arm64: dts: allwinner: h6: add voltage range to OPP table Some boards have a fixed regulator and can't reach the voltage set by the OPP table. Add a range where the minimal voltage is the target and the maximal voltage is 1.2V. Suggested-by: Ondřej Jirman Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit 48530d9fab0d3bf08827f9167be54acf66d4d457 Author: Marek Szyprowski Date: Wed May 13 15:32:10 2020 +0200 iommu: add generic helper for mapping sgtable objects struct sg_table is a common structure used for describing a memory buffer. It consists of a scatterlist with memory pages and DMA addresses (sgl entry), as well as the number of scatterlist entries: CPU pages (orig_nents entry) and DMA mapped pages (nents entry). It turned out that it was a common mistake to misuse nents and orig_nents entries, calling mapping functions with a wrong number of entries. To avoid such issues, lets introduce a common wrapper operating directly on the struct sg_table objects, which take care of the proper use of the nents and orig_nents entries. Signed-off-by: Marek Szyprowski Acked-by: Joerg Roedel Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig commit 709d6d73c756107fb8a292a9f957d630097425fa Author: Marek Szyprowski Date: Wed May 13 15:32:09 2020 +0200 scatterlist: add generic wrappers for iterating over sgtable objects struct sg_table is a common structure used for describing a memory buffer. It consists of a scatterlist with memory pages and DMA addresses (sgl entry), as well as the number of scatterlist entries: CPU pages (orig_nents entry) and DMA mapped pages (nents entry). It turned out that it was a common mistake to misuse nents and orig_nents entries, calling the scatterlist iterating functions with a wrong number of the entries. To avoid such issues, lets introduce a common wrappers operating directly on the struct sg_table objects, which take care of the proper use of the nents and orig_nents entries. While touching this, lets clarify some ambiguities in the comments for the existing for_each helpers. Signed-off-by: Marek Szyprowski Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig commit d9d200bcebc1f6e56f0178cbb8db9953e8cc9a11 Author: Marek Szyprowski Date: Wed May 13 15:32:08 2020 +0200 dma-mapping: add generic helpers for mapping sgtable objects struct sg_table is a common structure used for describing a memory buffer. It consists of a scatterlist with memory pages and DMA addresses (sgl entry), as well as the number of scatterlist entries: CPU pages (orig_nents entry) and DMA mapped pages (nents entry). It turned out that it was a common mistake to misuse nents and orig_nents entries, calling DMA-mapping functions with a wrong number of entries or ignoring the number of mapped entries returned by the dma_map_sg function. To avoid such issues, let's introduce a common wrappers operating directly on the struct sg_table objects, which take care of the proper use of the nents and orig_nents entries. Signed-off-by: Marek Szyprowski Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig commit d8d5afe35e3f88f73436f79f974d96a67e879637 Author: Stanislav Lisovskiy Date: Wed May 13 12:38:13 2020 +0300 drm/i915: Make active_pipes check skl specific Seems that only skl needs to have SAGV turned off for multipipe scenarios, so lets do it this way. If anything blows up - we can always revert this patch. v2: Changed if condition to look better (Ville). Signed-off-by: Stanislav Lisovskiy [vsyrjala: wrapped long line to appease checkpatch] Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200513093816.11466-4-stanislav.lisovskiy@intel.com commit 1d0a6c8486aa53f7545e80f5f0293ed99e48ffc0 Author: Stanislav Lisovskiy Date: Wed May 13 12:38:12 2020 +0300 drm/i915: Extract skl SAGV checking Introduce platform dependent SAGV checking in combination with bandwidth state pipe SAGV mask. This is preparation to adding TGL support, which requires different way of SAGV checking. v2, v3, v4, v5, v6: Fix rebase conflict v7: - Nuke icl specific function, use skl for icl as well, gen specific active_pipes check to be added in the next patch(Ville) v8: - Use more generic intel_crtc_can_enable_sagv for checking(Ville) Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200513093816.11466-3-stanislav.lisovskiy@intel.com commit d9162348db12487754e61f73497bdcfcea753590 Author: Stanislav Lisovskiy Date: Wed May 13 12:38:11 2020 +0300 drm/i915: Introduce skl_plane_wm_level accessor. For future Gen12 SAGV implementation we need to seemlessly alter wm levels calculated, depending on whether we are allowed to enable SAGV or not. So this accessor will give additional flexibility to do that. Currently this accessor is still simply working as "pass-through" function. This will be changed in next coming patches from this series. v2: - plane_id -> plane->id(Ville Syrjälä) - Moved wm_level var to have more local scope (Ville Syrjälä) - Renamed yuv to color_plane(Ville Syrjälä) in skl_plane_wm_level v3: - plane->id -> plane_id(this time for real, Ville Syrjälä) - Changed colorplane id type from boolean to int as index (Ville Syrjälä) - Moved crtc_state param so that it is first now (Ville Syrjälä) - Moved wm_level declaration to tigher scope in skl_write_plane_wm(Ville Syrjälä) v4: - Started to use enum values for color plane - Do sizeof for a type what we are memset'ing - Zero out wm_uv as well(Ville Syrjälä) v5: - Fixed rebase conflict caused by COLOR_PLANE_* enum removal v6: - Do not use skl_plane_wm_level accessor in skl_allocate_pipe_ddb v7: - Get rid of wm_uv, which is not used in skl_plane_write_wm(Ville) Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200513093816.11466-2-stanislav.lisovskiy@intel.com commit 1c530d431c698f156538b8954b07df95337beb34 Author: Chris Wilson Date: Wed May 13 08:47:47 2020 +0100 dma-buf: Use atomic_fetch_add() for the context id Now that atomic64_fetch_add() exists we can use it to return the base context id, rather than the atomic64_add_return(N) - N concoction. Suggested-by: Mika Kuoppala Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Maciej Patelczyk Link: https://patchwork.freedesktop.org/patch/msgid/20200513074809.18194-2-chris@chris-wilson.co.uk commit c33f4f24b888236b725a9972e0fe5ac6575c68ec Author: Al Cooper Date: Tue May 12 11:00:19 2020 -0400 usb: host: Add ability to build new Broadcom STB USB drivers Add the build system changes needed to get the Broadcom STB XHCI, EHCI and OHCI functionality working. The OHCI support does not require anything unique to Broadcom so the standard ohci-platform driver is being used. Also update MAINTAINERS. Signed-off-by: Al Cooper Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20200512150019.25903-6-alcooperx@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9df231511bd64387cd43a85d2955fd8d8ff04e0e Author: Al Cooper Date: Tue May 12 11:00:18 2020 -0400 usb: ehci: Add new EHCI driver for Broadcom STB SoC's Add a new EHCI driver for Broadcom STB SoC's. A new EHCI driver was created instead of adding support to the existing ehci platform driver because of the code required to work around bugs in the EHCI controller. The primary workaround is for a bug where the Core violates the SOF interval between the first two SOFs transmitted after resume. This only happens if the resume occurs near the end of a microframe. The fix is to intercept the ehci-hcd request to complete RESUME and align it to the start of the next microframe. Signed-off-by: Al Cooper Reviewed-by: Andy Shevchenko Reviewed-by: Florian Fainelli Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200512150019.25903-5-alcooperx@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1036e760d852f224265c677806089278c77ff5b2 Author: Al Cooper Date: Tue May 12 11:00:17 2020 -0400 usb: xhci: xhci-plat: Add support for Broadcom STB SoC's Add support for Broadcom STB SoC's to the xhci platform driver Signed-off-by: Al Cooper Acked-by: Mathias Nyman Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20200512150019.25903-4-alcooperx@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4e6cc9d07f28307bc67ce6e1a983c09509d22c9c Author: Al Cooper Date: Tue May 12 11:00:16 2020 -0400 dt-bindings: Add Broadcom STB USB support Add DT bindings for Broadcom STB USB EHCI and XHCI drivers. NOTE: The OHCI driver is not included because it uses the generic platform driver. Signed-off-by: Al Cooper Reviewed-by: Rob Herring Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20200512150019.25903-3-alcooperx@gmail.com Signed-off-by: Greg Kroah-Hartman commit 18a6c866bb191f360a16db6a79e005247dd3fd70 Author: Bryan O'Donoghue Date: Tue May 12 00:19:30 2020 +0100 usb: typec: tps6598x: Add USB role switching logic This patch adds USB role switch support to the tps6598x. The setup to initiate or accept a data-role switch is both assumed and currently required to be baked-into the firmware as described in TI's document here. Link: https://www.ti.com/lit/an/slva843a/slva843a.pdf With this change its possible to use the USB role-switch API to detect and notify role-switches to downstream consumers. Tested with a ChipIdea controller on a Qualcomm MSM8939. Cc: Heikki Krogerus Cc: Greg Kroah-Hartman Cc: Nikolaus Voss Cc: Andy Shevchenko Cc: Gustavo A. R. Silva Cc: Kees Cook Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200511231930.2825183-2-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0ef1f6e3808b15f3bcede4976235a7d81cc7f254 Author: Bryan O'Donoghue Date: Thu May 7 22:47:33 2020 +0100 usb: typec: tps6598x: Add OF probe binding Adds a MODULE_DEVICE_TABLE() to allow probing of this driver from a DTS setting. Cc: Heikki Krogerus Cc: Greg Kroah-Hartman Cc: Nikolaus Voss Cc: Andy Shevchenko Cc: Gustavo A. R. Silva Cc: Kees Cook Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bryan O'Donoghue Tested-by: Martin Kepplinger Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200507214733.1982696-3-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5f3173370ecfa984942c12378d8f5af2bda77b7c Author: Bryan O'Donoghue Date: Thu May 7 22:47:32 2020 +0100 dt-bindings: usb: Add TI tps6598x device tree binding documentation Add device tree binding documentation for the Texas Instruments tps6598x Type-C chip driver. Cc: Rob Herring Cc: Heikki Krogerus Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200507214733.1982696-2-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2cab683fda558d8ae0e4dde6166fa585a50f0a60 Author: Heikki Krogerus Date: Thu May 7 18:09:00 2020 +0300 MAINTAINERS: Add entry for Intel PMC mux driver I will be maintaining the Intel PMC mux control driver. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200507150900.12102-5-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 1f478dc2a13a42831513cfcf992ee31c4fba9c27 Author: Heikki Krogerus Date: Thu May 7 18:08:59 2020 +0300 usb: typec: Add firmware documentation for the Intel PMC mux control Adding documentation that describes how the PMC mux-agent function is described in the ACPI tables. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200507150900.12102-4-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit ff4a30d5e24307b416d3eac092c81b1f12a7a599 Author: Heikki Krogerus Date: Thu May 7 18:08:58 2020 +0300 usb: typec: mux: intel_pmc_mux: Support for static SBU/HSL orientation The SBU and HSL orientation may be fixed/static from the mux PoW. Apparently the retimer may take care of the orientation of these lines. Handling the static SBU (AUX) and HSL orientation with device properties. If the SBU orientation is static, a device property "sbu-orintation" can be used. When the property exists, the driver always sets the SBU orientation according to the property value, and when it's not set, the driver uses the cable plug orientation with SBU. And with static HSL orientation, "hsl-orientation" device property can be used in the same way. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200507150900.12102-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8c49c9ee4a91c158d28c583862718b348881cb16 Author: Heikki Krogerus Date: Thu May 7 18:08:57 2020 +0300 usb: typec: Add typec_find_orientation() Function that converts orientation string into orientation value. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200507150900.12102-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3e63cff384e625f09758ce8f4d01ae3033402b63 Author: Bryan O'Donoghue Date: Fri May 8 17:29:37 2020 +0100 usb: roles: Switch on role-switch uevent reporting Right now we don't report to user-space a role switch when doing a usb_role_switch_set_role() despite having registered the uevent callbacks. This patch switches on the notifications allowing user-space to see role-switch change notifications and subsequently determine the current controller data-role. example: PFX=/devices/platform/soc/78d9000.usb/ci_hdrc.0 root@somebox# udevadm monitor -p KERNEL[49.894994] change $PFX/usb_role/ci_hdrc.0-role-switch (usb_role) ACTION=change DEVPATH=$PFX/usb_role/ci_hdrc.0-role-switch SUBSYSTEM=usb_role DEVTYPE=usb_role_switch USB_ROLE_SWITCH=ci_hdrc.0-role-switch SEQNUM=2432 Cc: Heikki Krogerus Cc: Greg Kroah-Hartman Cc: Chunfeng Yun Cc: Suzuki K Poulose Cc: Alexandre Belloni Cc: Wen Yang Cc: chenqiwu Cc: linux-kernel@vger.kernel.org Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200508162937.2566818-1-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit b919e077cccfbb77beb98809568b2fb0b4d113ec Author: Wei Yongjun Date: Wed May 6 13:56:25 2020 +0000 USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 7d9e6f5aebe8 ("usb: host: ohci-sm501: init genalloc for local memory") Signed-off-by: Wei Yongjun Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200506135625.106910-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman commit c856b4b0fdb5044bca4c0acf9a66f3b5cc01a37a Author: Tang Bin Date: Fri May 8 19:43:05 2020 +0800 USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe() If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in mv_ehci_probe(). And when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200508114305.15740-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 09806eba8279376de481c74bc1a2090283db757d Author: Tang Bin Date: Fri May 8 22:21:36 2020 +0800 USB: EHCI: ehci-mv: Fix unused assignment in mv_ehci_probe() Delete unused initialized value, because 'retval' will be assigined by the function mv_ehci_enable(). And delete the extra blank lines. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200508142136.4232-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 15518726d60a39c7a517fff1a374dab403637a2a Author: Tang Bin Date: Fri May 8 22:40:24 2020 +0800 USB: host: ehci-mxc: Use the defined variable to simplify code Use the defined variable "dev" to make the code cleaner. And delete an extra blank line. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200508144024.7836-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 296a193b06120aa6ae7cf5c0d7b5e5b55968026e Author: Oliver Neukum Date: Thu May 7 10:58:06 2020 +0200 usblp: poison URBs upon disconnect syzkaller reported an URB that should have been killed to be active. We do not understand it, but this should fix the issue if it is real. Signed-off-by: Oliver Neukum Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20200507085806.5793-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman commit c22eb9374cb0f3936d1942d07e78855fd4e88846 Author: Hannes Reinecke Date: Tue May 5 16:30:19 2020 +0200 sierra-ms: do not call scsi_get_host_dev() scsi_get_host_dev() will create a virtual device such that either the target id is ignored from scanning (if 'this_id' is set to something which can be reached during scanning) or if the driver needs a scsi device for the HBA to send commands to. Neither is true for sierra-ms; 'this_id' remains at the default value '-1' and the created device is never ever used within the driver. So kill it. Signed-off-by: Hannes Reinecke Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200505143019.57418-1-hare@suse.de Signed-off-by: Greg Kroah-Hartman commit c794f7edbcd7069d888d3d49866e6adacccf7766 Author: YueHaibing Date: Tue May 5 10:13:53 2020 +0000 dmaengine: moxart-dma: Drop pointless static qualifier in moxart_probe() There is no need to have the 'void __iomem *dma_base_addr' variable static since new value always be assigned before use it. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200505101353.195446-1-yuehaibing@huawei.com Signed-off-by: Vinod Koul commit 84c1e51d7df85332705ffebc40ef135205492036 Author: Gustavo A. R. Silva Date: Thu May 7 13:53:18 2020 -0500 greybus: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507185318.GA14393@embeddedor Signed-off-by: Greg Kroah-Hartman commit 8a01032e02c8a0fb3e9f33791023b62dee73cc03 Author: Oscar Carter Date: Sun May 10 11:09:50 2020 +0200 staging: vt6656: Remove logically dead code In the start of the "vnt_rf_set_txpower" function the "power" variable is set at most to VNT_RF_MAX_POWER (hex = 0x3f, dec = 63). Then, in the switch statement there are four comparisons with the "power" variable against AL7230_PWR_IDX_LEN (dec = 64), VT3226_PWR_IDX_LEN (dec = 64), VT3342_PWR_IDX_LEN (dec = 64). Due to all the commented comparisons are to check if the "power" variable is "greater than or equal" to 64, this never happens. So, remove the logically dead code. Also, remove all the defines that are no longer required. Addresses-Coverity-ID: 1230228 ("Logically dead code") Fixes: f53d9f12c51a ("staging: vt6656: rf.c additional power.") Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200510090950.7633-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 5353711bec8c30eaccca17fb131ff62c6cc924c8 Author: Houssem KADI Date: Sat May 9 20:08:49 2020 +0200 staging: bcm2835-camera: insert emty line after declaration Missing empty line after variable declaration Signed-off-by: Houssem KADI Link: https://lore.kernel.org/r/20200509180849.GA30426@houssem-MS-7808 Signed-off-by: Greg Kroah-Hartman commit 9a6f87704ac2efa8375b7a512c820f2a5ffcc7a7 Author: Malcolm Priestley Date: Tue May 5 22:23:39 2020 +0100 staging: vt6656: remove difs / sifs adjustments. Now mac89211 is doing frame timing in rxtx these vendor adjustments need to be removed. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/034e445c-b245-52c4-c855-431b9783bcff@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61bb798767e4a55165ab0cdaf72dd7459ebab0cc Author: Malcolm Priestley Date: Tue May 5 22:19:45 2020 +0100 staging: vt6656: vnt_get_rtscts_rsvtime_le replace with rts/cts duration. rsvtime is the time needed in firmware to process the received frame time in firmware so they can be the same as vnt_get_rts_duration or vnt_get_cts_duration where appropriate. The rts_rrv_time are now all the same timing in vnt_rxtx_rts. So vnt_get_rtscts_rsvtime_le and and vnt_get_frame_time are no longer required. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/4c0fe356-7e08-bf66-58b7-5ab683ba9536@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e7128f63d21d65a98a0029814ad6e0463d248b9 Author: Malcolm Priestley Date: Tue May 5 22:17:26 2020 +0100 staging: vt6656: Split RTS and CTS Duration functions split vnt_get_rtscts_duration_le into vnt_get_rts_duration and vnt_get_cts_duration. The duration's are all the same in vnt_rxtx_rts_g_head. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/d2983161-7935-48ce-c0ca-a26ebafa3997@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7a83f736455eb22be31ea86a84c54842a29b8a3f Author: Malcolm Priestley Date: Tue May 5 22:15:12 2020 +0100 staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_ctstoself_duration use the mac80211 ieee80211_ctstoself_duration for CTS to self frames. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/f12b3d71-eb61-340b-e473-83509d9bc38a@gmail.com Signed-off-by: Greg Kroah-Hartman commit 57b4b0e68d668ad048bf5f1b8166396fe45ba5b0 Author: Malcolm Priestley Date: Tue May 5 22:12:04 2020 +0100 staging: vt6656: vnt_rxtx_rsvtime_le16 to use ieee80211_generic_frame_duration. ieee80211_generic_frame_duration is the mac80211 equivalent to vnt_get_rsvtime use this to get our frame time. There is a change where there is rrv_time_a and rrv_time_b the frame duration is always the same so both are equal. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/acff7fcc-0add-652b-7d07-22001b641257@gmail.com Signed-off-by: Greg Kroah-Hartman commit c5de40e58f2f6cba9a11efcc5f4ef0ccf5be9729 Author: Malcolm Priestley Date: Tue May 5 22:13:54 2020 +0100 staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_rts_duration use the mac80211 ieee80211_rts_duration for RTS frames. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/377a4cc3-cfe3-91aa-cf71-1063f311426a@gmail.com Signed-off-by: Greg Kroah-Hartman commit d92e6991616daf4cb6e677a742282ceffb7ecfd4 Author: Colin Ian King Date: Thu May 7 16:06:52 2020 +0100 staging: most: usb: sanity check channel before using it as an index into arrays Currently channel is being sanity checked after it has been used as an index into some arrays. Fix this by moving the sanity check of channel before the arrays are indexed with it. Addresses-Coverity: ("Negative array index read") Fixes: 59ed0480b950 ("Staging: most: replace pr_*() functions by dev_*()") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200507150652.52238-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 08e1b4274c7b446137b5b222c5cc0b46688cb372 Author: Christian Gromm Date: Tue May 5 14:14:52 2020 +0200 staging: most: usb: add PM functions This patch adds the implementation of the PM functions resume and suspend. Signed-off-by: Christian Gromm Link: https://lore.kernel.org/r/1588680892-9413-1-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 4fdc18d3ce77bc30cc9c819ae55070c8f5ec4e18 Author: Jérôme Pouiller Date: Tue May 12 17:04:14 2020 +0200 staging: wfx: update TODO Update the TODO list associated to the wfx driver with the last progresses. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit d99ce4a1e5a2d49185bffa2ea7f37df1ad51c649 Author: Jérôme Pouiller Date: Tue May 12 17:04:13 2020 +0200 staging: wfx: fix endianness of the field 'channel_number' The field 'channel_number' from the structs hif_ind_rx and hif_req_start is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:95:55: warning: incorrect type in argument 1 (different base types) drivers/staging/wfx/data_rx.c:95:55: expected int chan drivers/staging/wfx/data_rx.c:95:55: got restricted __le16 const [usertype] channel_number However, the value of channel_number cannot be greater than 14 (this device only support 2.4Ghz band). So, we only have to access to the least significant byte. It is finally easier to declare it as an array of bytes and only access to the first one. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 8008b480e25b0c88e1d6768bd8a440babb787307 Author: Jérôme Pouiller Date: Tue May 12 17:04:12 2020 +0200 staging: wfx: fix endianness of the field 'num_tx_confs' The field 'num_tx_confs' from the struct hif_cnf_multi_transmit is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/hif_rx.c:82:9: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:87:29: warning: restricted __le32 degrades to integer However, the value of num_tx_confs cannot be greater than 15. So, we only have to access to the least significant byte. It is finally easier to declare it as an array of bytes and only access to the first one. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ecda229e7ce3224fe9937d23c41e5ef74d4e6db3 Author: Jérôme Pouiller Date: Tue May 12 17:04:11 2020 +0200 staging: wfx: fix endianness of the field 'status' The field 'status' appears in most of structs returned by the hardware. This field is encoded as little endian. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:53:16: warning: restricted __le32 degrades to integer drivers/staging/wfx/data_rx.c:84:16: warning: restricted __le32 degrades to integer drivers/staging/wfx/data_tx.c:526:24: warning: restricted __le32 degrades to integer drivers/staging/wfx/data_tx.c:569:23: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:128:33: warning: restricted __le32 degrades to integer drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer In most of cases, this field is only compared with HIF_STATUS values. Finally, it is more convenient to solve the problem by defining the HIF_STATUS values directly in little endian. It is also the right time to make some clean up in the HIF_STATUS names. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 808fcf2e976d0afd3279a2b85fa9dcb4a0c26d85 Author: Jérôme Pouiller Date: Tue May 12 17:04:10 2020 +0200 staging: wfx: fix access to le32 attribute 'len' Sparse complains about the accesses to the field 'len' from struct hif_msg: drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:93:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:93:32: warning: cast to restricted __le16 drivers/staging/wfx/bh.c:93:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:121:25: warning: incorrect type in argument 2 (different base types) drivers/staging/wfx/bh.c:121:25: expected unsigned int len drivers/staging/wfx/bh.c:121:25: got restricted __le16 [usertype] len drivers/staging/wfx/hif_rx.c:27:22: warning: restricted __le16 degrades to integer drivers/staging/wfx/hif_rx.c:347:39: warning: incorrect type in argument 7 (different base types) drivers/staging/wfx/hif_rx.c:347:39: expected unsigned int [usertype] len drivers/staging/wfx/hif_rx.c:347:39: got restricted __le16 const [usertype] len drivers/staging/wfx/hif_rx.c:365:39: warning: incorrect type in argument 7 (different base types) drivers/staging/wfx/hif_rx.c:365:39: expected unsigned int [usertype] len drivers/staging/wfx/hif_rx.c:365:39: got restricted __le16 const [usertype] len drivers/staging/wfx/./traces.h:195:1: warning: incorrect type in assignment (different base types) drivers/staging/wfx/./traces.h:195:1: expected int msg_len drivers/staging/wfx/./traces.h:195:1: got restricted __le16 const [usertype] len drivers/staging/wfx/./traces.h:195:1: warning: incorrect type in assignment (different base types) drivers/staging/wfx/./traces.h:195:1: expected int msg_len drivers/staging/wfx/./traces.h:195:1: got restricted __le16 const [usertype] len drivers/staging/wfx/debug.c:319:20: warning: restricted __le16 degrades to integer drivers/staging/wfx/secure_link.c:85:27: warning: restricted __le16 degrades to integer drivers/staging/wfx/secure_link.c:85:27: warning: restricted __le16 degrades to integer Indeed, the attribute len is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 4246fdbf8c1452c15a38b45803f2516f1244c3fa Author: Jérôme Pouiller Date: Tue May 12 17:04:09 2020 +0200 staging: wfx: fix endianness of the struct hif_ind_startup The struct hif_ind_startup is received from the hardware. So it is declared as little endian. However, it is also stored in the main driver structure and used on different places in the driver. Sparse complains about that: drivers/staging/wfx/data_tx.c:388:43: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:199:9: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:221:62: warning: restricted __le16 degrades to integer In order to make Sparse happy and to keep access from the driver easy, this patch declare hif_ind_startup with native endianness. On reception of this struct, this patch takes care to do byte-swap and keep Sparse happy. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9fee675c2c670ea86205ff9d8211980e016c4dde Author: Jérôme Pouiller Date: Tue May 12 17:04:08 2020 +0200 staging: wfx: declare the field 'packet_id' with native byte order The field packet_id is not interpreted by the device. It is only used as identifier for the device answer. So it is not necessary to declare it little endian. It fixes some warnings raised by Sparse without complexifying the code. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b8743c786bbd6b9ac63c98401b60b9a3400049de Author: Jérôme Pouiller Date: Tue May 12 17:04:07 2020 +0200 staging: wfx: fix access to le32 attribute 'indication_type' The attribute indication_type is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 1bca434cc273a0c04e23746914b1717812c7d1d1 Author: Jérôme Pouiller Date: Tue May 12 17:04:06 2020 +0200 staging: wfx: fix access to le32 attribute 'event_id' The attribute event_id is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 99414d8d260c6e8f3728a4fff0bc268ce14bb19e Author: Jérôme Pouiller Date: Tue May 12 17:04:05 2020 +0200 staging: wfx: fix access to le32 attribute 'ps_mode_error' The attribute ps_mode_error is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 270f54b83f89ca45cdc4dc1908de30cdbc4845d4 Author: Jérôme Pouiller Date: Tue May 12 17:04:04 2020 +0200 staging: wfx: fix endianness of hif_req_read_mib fields The structs hif_{req,cnf}_read_mib contain only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong accesses to fields mib_id and length. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ea097de7ec4408fc952041da5560cf8a9ae65235 Author: Jérôme Pouiller Date: Tue May 12 17:04:03 2020 +0200 staging: wfx: fix endianness of fields media_delay and tx_queue_delay The struct hif_cnf_tx contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong access to fields media_delay and tx_queue_delay. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a823d6ecd4904e1a6ffb12964de88fb0bb4802f6 Author: Jérôme Pouiller Date: Tue May 12 17:04:02 2020 +0200 staging: wfx: fix output of rx_stats on big endian hosts The struct hif_rx_stats contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9b3bc20d98f10a9c4fe3542c6c75caae17f5ac49 Author: Jérôme Pouiller Date: Tue May 12 17:04:01 2020 +0200 staging: wfx: fix wrong bytes order The field wakeup_period_max from struct hif_mib_beacon_wake_up_period is a u8. So, assigning it a __le16 produces a nasty bug on big-endian architectures. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 095e86c86a1b94e419cfb0d9ed1d70ae0aa1dbe1 Author: Jérôme Pouiller Date: Tue May 12 17:04:00 2020 +0200 staging: wfx: fix cast operator Sparse detects that le16_to_cpup() expects a __le16 * as argument. Change the cast operator to be compliant with sparse. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 1d572139f9d2e11d97e27a558b67f45f69f05a55 Author: Jérôme Pouiller Date: Tue May 12 17:03:59 2020 +0200 staging: wfx: take advantage of le32_to_cpup() le32_to_cpu(*x) can be advantageously converted in le32_to_cpup(x). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9d9bb819d56d89bc7bc3223145699b92eadbb204 Author: Jérôme Pouiller Date: Tue May 12 17:03:58 2020 +0200 staging: wfx: fix use of cpu_to_le32 instead of le32_to_cpu Sparse detected that le32_to_cpu should be used instead of cpu_to_le32. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200512150414.267198-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b860eb8dce5906b14e3a7f3c771e0b3d6ef61b94 Author: Fenghua Yu Date: Tue May 12 07:54:39 2020 -0700 x86/fpu/xstate: Define new functions for clearing fpregs and xstates Currently, fpu__clear() clears all fpregs and xstates. Once XSAVES supervisor states are introduced, supervisor settings (e.g. CET xstates) must remain active for signals; It is necessary to have separate functions: - Create fpu__clear_user_states(): clear only user settings for signals; - Create fpu__clear_all(): clear both user and supervisor settings in flush_thread(). Also modify copy_init_fpstate_to_fpregs() to take a mask from above two functions. Remove obvious side-comment in fpu__clear(), while at it. [ bp: Make the second argument of fpu__clear() bool after requesting it a bunch of times during review. - Add a comment about copy_init_fpstate_to_fpregs() locking needs. ] Co-developed-by: Yu-cheng Yu Signed-off-by: Fenghua Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/20200512145444.15483-6-yu-cheng.yu@intel.com commit f2b5d503c04a28828af8e41fcd4a5d9fd978a78e Author: Christophe JAILLET Date: Fri May 1 12:08:24 2020 +0200 dmaengine: sf-pdma: Simplify the error handling path in 'sf_pdma_probe()' There is no need to explicitly free memory that have been 'devm_kzalloc'ed. Simplify the probe function accordingly. Signed-off-by: Christophe JAILLET Tested-by: Green Wan Reviewed-by: Green Wan Link: https://lore.kernel.org/r/20200501100824.126534-1-christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit d24224dea57108f96d13579f20206c339bb8e52f Author: Jason Yan Date: Mon May 4 19:34:06 2020 +0800 dmaengine: qcom_hidma: use true,false for bool variable Fix the following coccicheck warning: drivers/dma/qcom/hidma.c:553:1-17: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Acked By: Sinan Kaya Link: https://lore.kernel.org/r/20200504113406.41530-1-yanaijie@huawei.com Signed-off-by: Vinod Koul commit 1ff4388a06eb001efbc272754ef750c0b97817cb Author: Jérôme Pouiller Date: Tue May 5 14:37:57 2020 +0200 staging: wfx: use kernel types instead of c99 ones The kernel coding style promotes the use of kernel types (u8, u16, u32, etc...) instead of the C99 ones. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit cae9b69522b22e6e7a884451ba729b229ff0a03a Author: Jérôme Pouiller Date: Tue May 5 14:37:56 2020 +0200 staging: wfx: remove spaces after cast operator The kernel coding style expects no space after cast operator. This patch make the wfx driver compliant with this rule. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b356aed9ec0c218a86902c02cb4031a6c8f89e1e Author: Jérôme Pouiller Date: Tue May 5 14:37:55 2020 +0200 staging: wfx: fix alignements of function prototypes Some function prototypes were not correctly aligned and/or exceed 80 columns. In some other cases, the prototypes were written on more lines than necessary. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 525f469f7f9ce657b35dae2a9f555be1e71e16a6 Author: Jérôme Pouiller Date: Tue May 5 14:37:54 2020 +0200 staging: wfx: remove useless header inclusions In order to keep the compilation times reasonable, we try to only include the necessary headers (especially header included from other headers). This patch clean up unnecessary headers inclusions. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 8371d215f4452435a4bd1499a0f8027f5d28cfe7 Author: Jérôme Pouiller Date: Tue May 5 14:37:53 2020 +0200 staging: wfx: prefer ARRAY_SIZE instead of a magic number When possible, we prefer to use the macro ARRAY_SIZE rather than hard coding the number of elements. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit bcd8795ad2b6909fb2736fe6efea6052b154bac2 Author: Jérôme Pouiller Date: Tue May 5 14:37:52 2020 +0200 staging: wfx: fix missing 'static' keyword Sparse tool noticed that wfx_enable_beacon() is never used outside of sta.c. Therefore, it can be declared static. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 0549cd11d88d1624630ed01c97e4ab53cb8a08fb Author: Jérôme Pouiller Date: Tue May 5 14:37:51 2020 +0200 staging: wfx: fix missing 'static' statement The function get_firmware() is only used from fwio.c. It can be declared static. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f00dc1d789e1caab0e154d0b2bf581fa1be87b2b Author: Jérôme Pouiller Date: Tue May 5 14:37:50 2020 +0200 staging: wfx: poll IRQ during init When the chip starts in SDIO mode, the external IRQ (aka Out-Of-Band IRQ) cannot be used before to configure it. Therefore, the first exchanges with the chip have to be done without the OOB IRQ. This patch allow to poll the data until the OOB IRQ is correctly setup. In order to keep the code simpler, this patch also poll data even if OOB IRQ is not used. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 57aa557f110d9fb6980cb58498cfd3a51feb5473 Author: Jérôme Pouiller Date: Tue May 5 14:37:49 2020 +0200 staging: wfx: introduce a way to poll IRQ It is possible to check if an IRQ is ending by polling the control register. This function must used with care: if an IRQ fires while the host reads control register, the IRQ can be lost. However, it could be useful in some cases. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a7efb62509d8144380964720d40767f0a54f3479 Author: Jérôme Pouiller Date: Tue May 5 14:37:48 2020 +0200 staging: wfx: use threaded IRQ with SPI Currently, the SPI implementation use a workqueue to acknowledge IRQ while the SDIO-OOB implementation use a threaded IRQ. The threaded also offers the advantage to allow level triggered IRQs. Uniformize the code and use threaded IRQ in both case. Therefore, prefer level triggered IRQs if the user does not specify it in the DT. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 5561770f80b11786602726bf1fa172c8009e542b Author: Jérôme Pouiller Date: Tue May 5 14:37:47 2020 +0200 staging: wfx: repair external IRQ for SDIO When used over SDIO bus, device is able to use an external line to signal IRQs (also called Out-Of-Band IRQ). The current code have several problems: 1. The ISR cannot directly acknowledge IRQ since access to the bus is not atomic. This patch use a threaded IRQ to solve that issue. 2. On certain platforms, it is necessary to keep SDIO interruption enabled (with register SDIO_CCCR_IENx) (this part has inspired from the brcmfmac driver). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ba52eddcbbde566803d51d5c8b004e70b4dc92ed Author: Jérôme Pouiller Date: Tue May 5 14:37:46 2020 +0200 staging: wfx: drop useless check Currently, the ISR check if bus->core is not NULL. But, it is a useless check. bus->core is initialiased before to request IRQ and it is not assigned to NULL when it is released. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 832cc98141b4b93acbb9231ca9e36f7fbe347f47 Author: Jérôme Pouiller Date: Tue May 5 14:37:45 2020 +0200 staging: wfx: fix double free In case of error in wfx_probe(), wdev->hw is freed. Since an error occurred, wfx_free_common() is called, then wdev->hw is freed again. Signed-off-by: Jérôme Pouiller Reviewed-by: Michał Mirosław Fixes: 4033714d6cbe ("staging: wfx: fix init/remove vs IRQ race") Link: https://lore.kernel.org/r/20200505123757.39506-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 01088cd143a9509aba2fd81d208bb4e3ba479035 Author: Jérôme Pouiller Date: Tue May 5 14:37:44 2020 +0200 staging: wfx: reduce timeout for chip initial start up The device take a few hundreds of milliseconds to start. However, the current code wait up to 10 second for the chip. We can safely reduce this value to 1 second. Thanks to that change, it is no more necessary to use an interruptible timeout. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit c7d061a811a65d7bdc941474126cf03402d06ae8 Author: Jérôme Pouiller Date: Tue May 5 14:37:43 2020 +0200 staging: wfx: add support for hardware revision 2 and further Currently, the driver explicitly exclude support for chip with version number it does not know. However, it unlikely that any futur hardware change would break the driver. Therefore, we prefer to invert the test and only exclude the versions we know the driver does not support. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200505123757.39506-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 125be5868eaa5ceb9d0b5a21e281aca6c9c16a9b Author: Huacai Chen Date: Wed May 13 16:38:41 2020 +0800 MIPS: Fix "make clean" error due to recent changes Commit 26bff9eb49201aeb ("MIPS: Only include the platformfile needed") moves platform-(CONFIG_XYZ) from arch/mips/xyz/Platform to arch/mips/ Kbuild.platforms. This change causes an error when "make clean": ./scripts/Makefile.clean:15: arch/mips/vr41xx/Makefile: No such file or directory make[3]: *** No rule to make target `arch/mips/vr41xx/Makefile'. Stop. make[2]: *** [arch/mips/vr41xx] Error 2 make[1]: *** [_clean_arch/mips] Error 2 make: *** [sub-make] Error 2 Clean-files are defined in arch/mips/Kbuild: obj- := $(platform-) Due to the movement of platform-(CONFIG_XYZ), "make clean" will enter arch/mips/vr41xx/ whether CONFIG_MACH_VR41XX is defined or not. Because there is no Makefile in arch/mips/vr41xx/, "make clean" fails. I don't know what is the best way to fix it, but it seems like we can avoid this error by changing the obj- definition: obj- := $(platform-y) Fixes: 26bff9eb49201aeb ("MIPS: Only include the platformfile needed") Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit a7cf53b7abdfbf65540a569d5627a62ce118ffe9 Author: Huacai Chen Date: Wed May 13 16:38:40 2020 +0800 MIPS: Fix typos in arch/mips/Kbuild.platforms Commit 26bff9eb49201aeb ("MIPS: Only include the platform file needed") misspelled "txx9" to "tx99", so fix it. Fixes: 26bff9eb49201aeb ("MIPS: Only include the platform file needed") Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 1597d453289b385237628cd96d57d147632ab105 Author: Georgi Djakov Date: Tue May 12 15:53:20 2020 +0300 interconnect: Add of_icc_get_by_index() helper function This is the same as the traditional of_icc_get() function, but the difference is that it takes index as an argument, instead of name. Reviewed-by: Matthias Kaehlcke Reviewed-by: Sibi Sankar Link: https://lore.kernel.org/r/20200512125327.1868-4-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov commit 65e412a01bc0161175a962abd5a7fef6a62d5c8e Author: Shengjiu Wang Date: Wed May 13 13:30:35 2020 +0800 ASoC: wm8962: Use force clear for WM8962_SYSCLK_ENA after reset When CLOCKING2 is non-volatile register, we need force clear the WM8962_SYSCLK_ENA bit after reset, for the value in cache maybe 0 but in hardware it is 1. Otherwise there will issue as below statement in driver. /* SYSCLK defaults to on; make sure it is off so we can safely * write to registers if the device is declocked. Fixes: c38b608504aa ("ASoC: wm8962: set CLOCKING2 as non-volatile register") Signed-off-by: Shengjiu Wang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/1589347835-20554-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit bc8788b2f3a0c1adf1bdcde12bb5b5642e3e043e Author: Nagarjuna Kristam Date: Thu Apr 16 13:04:18 2020 +0530 arm64: tegra: Add XUDC node on Tegra194 Tegra194 has one XUSB device mode controller which can be operated in HS and SS modes. Add a DT node for this XUSB device mode controller. Signed-off-by: Nagarjuna Kristam Signed-off-by: Thierry Reding commit d3cd7d02e7133e2c0809c25d5321af21af695da4 Author: Rob Herring Date: Fri Jan 17 17:08:55 2020 -0600 arm64: tegra: Kill off "simple-panel" compatibles "simple-panel" is a Linux driver and has never been an accepted upstream compatible string, so remove it. Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Thierry Reding commit 9fb276934a5d8fca4adadad18d2679e596f0ca0a Merge: 8f3d9f354286 796705bcb10c Author: Thierry Reding Date: Wed May 13 12:59:28 2020 +0200 Merge branch 'for-5.8/dt-bindings' into for-5.8/arm64/dt commit b428d57006663d18e3f6f98644ff9e8702a33ca4 Author: Chris Wilson Date: Wed May 13 11:01:20 2020 +0100 drm/i915/gt: Reset execlists registers before HWSP Upon gt resume, we first poison then sanitize the engine. However, our testing shows that gen9 will very rarely retain the poisoned value from the HWSP mappings of the execlists status registers. This suggests that it is reading back from the HWSP, so rejig the register reset. v2: Maybe RING_CONTEXT_STATUS_PTR is write masked. It is. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1812 Signed-off-by: Chris Wilson Acked-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200513100120.11617-1-chris@chris-wilson.co.uk commit 4b159cf13a8a504c1809890121755d04d15b1c22 Author: Marek Szyprowski Date: Wed May 6 15:26:59 2020 +0200 clk: samsung: Fix CLK_SMMU_FIMCL3 clock name on Exynos542x The proper name for CLK_SMMU_FIMCL3 is "smmu_fimcl3". Remove obvious typo. Signed-off-by: Marek Szyprowski Acked-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki commit e47bd937e602bb4379546095d1bd0b9871fa60c2 Author: Marek Szyprowski Date: Wed May 6 15:26:58 2020 +0200 clk: samsung: Mark top ISP and CAM clocks on Exynos542x as critical The TOP 'aclk*_isp', 'aclk550_cam', 'gscl_wa' and 'gscl_wb' clocks must be kept enabled all the time to allow proper access to power management control for the ISP and CAM power domains. The last two clocks, although related to GScaler device and GSCL power domain, provides also the I_WRAP_CLK signal to MIPI CSIS0/1 devices, which are a part of CAM power domain and are needed for proper power on/off sequence. Currently there are no drivers for the devices, which are part of CAM and ISP power domains yet. This patch only fixes the race between disabling the unused power domains and disabling unused clocks, which randomly resulted in the following error during boot: Power domain CAM disable failed Power domain ISP disable failed Fixes: 318fa46cc60d ("clk/samsung: exynos542x: mark some clocks as critical") Signed-off-by: Marek Szyprowski Acked-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki commit 7943f1d178833518aa5d25249f8e88068517bac8 Author: Andy Shevchenko Date: Sat Apr 25 16:44:48 2020 +0300 i2c: designware: Allow slave mode for PCI enumerated devices Allow slave mode for PCI enumerated devices by calling a common i2c_dw_probe() instead of i2c_dw_probe_master(). While dropping dependency to platform driver in slave module, move its configuration section above, closer to core. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit bed20c84021eb6dfc9df1590d8e231895b0392aa Author: Andy Shevchenko Date: Sat Apr 25 16:44:47 2020 +0300 i2c: designware: Rename i2c_dw_probe() to i2c_dw_probe_master() As a preparatory patch to support slave mode for PCI enumerated devices rename i2c_dw_probe() to i2c_dw_probe_master() and split common i2c_dw_probe() as inline helper. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 42ab0012340d35ca1bce466285a873613c8109e0 Author: Andy Shevchenko Date: Sat Apr 25 16:44:46 2020 +0300 i2c: designware: Switch PCI driver to use i2c_dw_configure_master() Since we have available helper to configure master mode, let's use it in the PCI driver instead of spread open-coded variant. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 3ebe40ed1c39016eeae947acc9fd57d6b10d43b2 Author: Andy Shevchenko Date: Sat Apr 25 16:44:45 2020 +0300 i2c: designware: Move configuration routines to respective modules Move configuration routines to respective modules, i.e. master and slave. Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 188fe480cd65c53dca02a464d62be02ca3158290 Author: Andy Shevchenko Date: Sat Apr 25 16:44:44 2020 +0300 i2c: designware: Use devm_platform_ioremap_resource() to simplify code Use devm_platform_ioremap_resource() instead of platform_get_resource() + devm_ioremap_resource(). Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 71581eefd7a0a81b1af7d7c93641925a01d70a9a Author: Yu-cheng Yu Date: Tue May 12 07:54:38 2020 -0700 x86/fpu/xstate: Introduce XSAVES supervisor states Enable XSAVES supervisor states by setting MSR_IA32_XSS bits according to CPUID enumeration results. Also revise comments at various places. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/20200512145444.15483-5-yu-cheng.yu@intel.com commit 555fb5ae0f39962417d35e02d77ee9b2c14a5428 Author: Andy Shevchenko Date: Thu May 7 19:18:04 2020 +0300 iommu/amd: Unify format of the printed messages Unify format of the printed messages, i.e. replace printk(LEVEL ... ) with pr_level(...). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200507161804.13275-3-andriy.shevchenko@linux.intel.com Signed-off-by: Joerg Roedel commit 8627892af6cb80f80acab066e26851d7b5fb3ca6 Author: Andy Shevchenko Date: Thu May 7 19:18:02 2020 +0300 iommu/vt-d: Unify format of the printed messages Unify format of the printed messages, i.e. replace printk(LEVEL ... ) with pr_level(...). Signed-off-by: Andy Shevchenko Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/20200507161804.13275-1-andriy.shevchenko@linux.intel.com Signed-off-by: Joerg Roedel commit 6fc7020cf298aaec343df423746b44d99c6efaa5 Author: Lu Baolu Date: Wed May 6 09:59:47 2020 +0800 iommu/vt-d: Apply per-device dma_ops Current Intel IOMMU driver sets the system level dma_ops. This causes each dma API to go through the IOMMU driver even the devices are using identity mapped domains. This sets per-device dma_ops only if a device is using a DMA domain. Otherwise, use the default system level dma_ops for direct dma. Signed-off-by: Lu Baolu Tested-by: Daniel Drake Reviewed-by: Jon Derrick Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20200506015947.28662-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 14b3526d5909f01e1d1baa05f50952788bb7418e Author: Lu Baolu Date: Wed May 6 09:59:46 2020 +0800 iommu/vt-d: Allow PCI sub-hierarchy to use DMA domain Before commit fa954e6831789 ("iommu/vt-d: Delegate the dma domain to upper layer"), Intel IOMMU started off with all devices in the identity domain, and took them out later if it found they couldn't access all of memory. This required devices behind a PCI bridge to use a DMA domain at the beginning because all PCI devices behind the bridge use the same source-id in their transactions and the domain couldn't be changed at run-time. Intel IOMMU driver is now aligned with the default domain framework, there's no need to keep this requirement anymore. Signed-off-by: Lu Baolu Tested-by: Daniel Drake Reviewed-by: Jon Derrick Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20200506015947.28662-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 327d5b2fee91c404a3956c324193892cf2cc9528 Author: Lu Baolu Date: Wed May 6 09:59:45 2020 +0800 iommu/vt-d: Allow 32bit devices to uses DMA domain Currently, if a 32bit device initially uses an identity domain, Intel IOMMU driver will convert it forcibly to a DMA one if its address capability is not enough for the whole system memory. The motivation was to overcome the overhead caused by possible bounced buffer. Unfortunately, this improvement has led to many problems. For example, some 32bit devices are required to use an identity domain, forcing them to use DMA domain will cause the device not to work anymore. On the other hand, the VMD sub-devices share a domain but each sub-device might have different address capability. Forcing a VMD sub-device to use DMA domain blindly will impact the operation of other sub-devices without any notification. Further more, PCI aliased devices (PCI bridge and all devices beneath it, VMD devices and various devices quirked with pci_add_dma_alias()) must use the same domain. Forcing one device to switch to DMA domain during runtime will cause in-fligh DMAs for other devices to abort or target to other memory which might cause undefind system behavior. With the last private domain usage in iommu_need_mapping() removed, all private domain helpers are also cleaned in this patch. Otherwise, the compiler will complain that some functions are defined but not used. Signed-off-by: Lu Baolu Tested-by: Daniel Drake Reviewed-by: Jon Derrick Reviewed-by: Jerry Snitselaar Cc: Daniel Drake Cc: Derrick Jonathan Cc: Jerry Snitselaar Link: https://lore.kernel.org/r/20200506015947.28662-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit ec9b40cffdb68c4ea1ebdcd1648ed6ce15c4449e Merge: 3a0ce12e3b8e 0e698dfa2822 Author: Joerg Roedel Date: Wed May 13 12:01:33 2020 +0200 Merge tag 'v5.7-rc4' into core Linux 5.7-rc4 commit c4e0f3b240041bf504e3a25e300eadb88f6a68eb Author: Samuel Zou Date: Tue May 12 10:17:19 2020 +0800 iommu/msm: Make msm_iommu_lock static Fix the following sparse warning: drivers/iommu/msm_iommu.c:37:1: warning: symbol 'msm_iommu_lock' was not declared. The msm_iommu_lock has only call site within msm_iommu.c It should be static Fixes: 0720d1f052dc ("msm: Add MSM IOMMU support") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1589249839-105820-1-git-send-email-zou_wei@huawei.com Signed-off-by: Joerg Roedel commit c65822fef4adc0ba40c37a47337376ce75f7a7bc Author: Nicolas Saenz Julienne Date: Tue May 5 18:13:17 2020 +0200 USB: pci-quirks: Add Raspberry Pi 4 quirk On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's VideoCore. Inform VideoCore that VL805 was just reset. Also, as this creates a dependency between USB_PCI and VideoCore's firmware interface, and since USB_PCI can't be set as a module neither this can. Reflect that on the firmware interface Kconfg. Link: https://lore.kernel.org/r/20200505161318.26200-5-nsaenzjulienne@suse.de Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Mathias Nyman commit 44331189f9082c7e659697bbac1747db3def73e7 Author: Nicolas Saenz Julienne Date: Tue May 5 18:13:16 2020 +0200 PCI: brcmstb: Wait for Raspberry Pi's firmware when present xHCI's PCI fixup, run at the end of pcie-brcmstb's probe, depends on RPi4's VideoCore firmware interface to be up and running. It's possible for both initializations to race, so make sure it's available prior to starting. Link: https://lore.kernel.org/r/20200505161318.26200-4-nsaenzjulienne@suse.de Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Lorenzo Pieralisi Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring commit fbbc5ff3f7f9f4cad562e530ae2cf5d8964fe6d3 Author: Nicolas Saenz Julienne Date: Tue May 5 18:13:15 2020 +0200 firmware: raspberrypi: Introduce vl805 init routine The Raspberry Pi 4 gets its USB functionality from VL805, a PCIe chip that implements xHCI. After a PCI reset, VL805's firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's co-processor, VideoCore. RPi4's VideoCore OS contains both the non public firmware load logic and the VL805 firmware blob. The function this patch introduces triggers the aforementioned process. Link: https://lore.kernel.org/r/20200505161318.26200-3-nsaenzjulienne@suse.de Tested-by: Stefan Wahren Tested-by: Stefan Wahren Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit ca91ddef2e438c1eaedf92722f66e8c235d373a7 Author: Nicolas Saenz Julienne Date: Tue May 5 18:13:14 2020 +0200 soc: bcm2835: Add notify xHCI reset property The property is needed in order to trigger VL805's firmware load. Note that gap between the property introduced and the previous one is due to the properties not being defined. Link: https://lore.kernel.org/r/20200505161318.26200-2-nsaenzjulienne@suse.de Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Lorenzo Pieralisi Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring commit 2b40c5db73e239531ea54991087f4edc07fbb08e Author: Christian Brauner Date: Tue May 5 16:04:32 2020 +0200 selftests/pidfd: add pidfd setns tests This is basically a test-suite for setns() and as of now contains: - test that we can't pass garbage flags - test that we can't attach to the namespaces of task that has already exited - test that we can incrementally setns into all namespaces of a target task using a pidfd - test that we can setns atomically into all namespaces of a target task - test that we can't cross setns into a user namespace outside of our user namespace hierarchy - test that we can't setns into namespaces owned by user namespaces over which we are not privileged Signed-off-by: Christian Brauner Link: https://lore.kernel.org/r/20200505140432.181565-4-christian.brauner@ubuntu.com commit 303cc571d107b3641d6487061b748e70ffe15ce4 Author: Christian Brauner Date: Tue May 5 16:04:31 2020 +0200 nsproxy: attach to namespaces via pidfds For quite a while we have been thinking about using pidfds to attach to namespaces. This patchset has existed for about a year already but we've wanted to wait to see how the general api would be received and adopted. Now that more and more programs in userspace have started using pidfds for process management it's time to send this one out. This patch makes it possible to use pidfds to attach to the namespaces of another process, i.e. they can be passed as the first argument to the setns() syscall. When only a single namespace type is specified the semantics are equivalent to passing an nsfd. That means setns(nsfd, CLONE_NEWNET) equals setns(pidfd, CLONE_NEWNET). However, when a pidfd is passed, multiple namespace flags can be specified in the second setns() argument and setns() will attach the caller to all the specified namespaces all at once or to none of them. Specifying 0 is not valid together with a pidfd. Here are just two obvious examples: setns(pidfd, CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWNET); setns(pidfd, CLONE_NEWUSER); Allowing to also attach subsets of namespaces supports various use-cases where callers setns to a subset of namespaces to retain privilege, perform an action and then re-attach another subset of namespaces. If the need arises, as Eric suggested, we can extend this patchset to assume even more context than just attaching all namespaces. His suggestion specifically was about assuming the process' root directory when setns(pidfd, 0) or setns(pidfd, SETNS_PIDFD) is specified. For now, just keep it flexible in terms of supporting subsets of namespaces but let's wait until we have users asking for even more context to be assumed. At that point we can add an extension. The obvious example where this is useful is a standard container manager interacting with a running container: pushing and pulling files or directories, injecting mounts, attaching/execing any kind of process, managing network devices all these operations require attaching to all or at least multiple namespaces at the same time. Given that nowadays most containers are spawned with all namespaces enabled we're currently looking at at least 14 syscalls, 7 to open the /proc//ns/ nsfds, another 7 to actually perform the namespace switch. With time namespaces we're looking at about 16 syscalls. (We could amortize the first 7 or 8 syscalls for opening the nsfds by stashing them in each container's monitor process but that would mean we need to send around those file descriptors through unix sockets everytime we want to interact with the container or keep on-disk state. Even in scenarios where a caller wants to join a particular namespace in a particular order callers still profit from batching other namespaces. That mostly applies to the user namespace but all container runtimes I found join the user namespace first no matter if it privileges or deprivileges the container similar to how unshare behaves.) With pidfds this becomes a single syscall no matter how many namespaces are supposed to be attached to. A decently designed, large-scale container manager usually isn't the parent of any of the containers it spawns so the containers don't die when it crashes or needs to update or reinitialize. This means that for the manager to interact with containers through pids is inherently racy especially on systems where the maximum pid number is not significicantly bumped. This is even more problematic since we often spawn and manage thousands or ten-thousands of containers. Interacting with a container through a pid thus can become risky quite quickly. Especially since we allow for an administrator to enable advanced features such as syscall interception where we're performing syscalls in lieu of the container. In all of those cases we use pidfds if they are available and we pass them around as stable references. Using them to setns() to the target process' namespaces is as reliable as using nsfds. Either the target process is already dead and we get ESRCH or we manage to attach to its namespaces but we can't accidently attach to another process' namespaces. So pidfds lend themselves to be used with this api. The other main advantage is that with this change the pidfd becomes the only relevant token for most container interactions and it's the only token we need to create and send around. Apart from significiantly reducing the number of syscalls from double digit to single digit which is a decent reason post-spectre/meltdown this also allows to switch to a set of namespaces atomically, i.e. either attaching to all the specified namespaces succeeds or we fail. If we fail we haven't changed a single namespace. There are currently three namespaces that can fail (other than for ENOMEM which really is not very interesting since we then have other problems anyway) for non-trivial reasons, user, mount, and pid namespaces. We can fail to attach to a pid namespace if it is not our current active pid namespace or a descendant of it. We can fail to attach to a user namespace because we are multi-threaded or because our current mount namespace shares filesystem state with other tasks, or because we're trying to setns() to the same user namespace, i.e. the target task has the same user namespace as we do. We can fail to attach to a mount namespace because it shares filesystem state with other tasks or because we fail to lookup the new root for the new mount namespace. In most non-pathological scenarios these issues can be somewhat mitigated. But there are cases where we're half-attached to some namespace and failing to attach to another one. I've talked about some of these problem during the hallway track (something only the pre-COVID-19 generation will remember) of Plumbers in Los Angeles in 2018(?). Even if all these issues could be avoided with super careful userspace coding it would be nicer to have this done in-kernel. Pidfds seem to lend themselves nicely for this. The other neat thing about this is that setns() becomes an actual counterpart to the namespace bits of unshare(). Signed-off-by: Christian Brauner Reviewed-by: Serge Hallyn Cc: Eric W. Biederman Cc: Serge Hallyn Cc: Jann Horn Cc: Michael Kerrisk Cc: Aleksa Sarai Link: https://lore.kernel.org/r/20200505140432.181565-3-christian.brauner@ubuntu.com commit 144da23beab87b27992e5e1b41bd954de0bf2581 Author: Lubos Dolezel Date: Mon May 4 21:35:09 2020 +0200 ovl: return required buffer size for file handles Overlayfs doesn't work well with the fanotify mechanism. Fanotify first probes for the required buffer size for the file handle, but overlayfs currently bails out without passing the size back. That results in errors in the kernel log, such as: [527944.485384] overlayfs: failed to encode file handle (/, err=-75, buflen=0, len=29, type=1) [527944.485386] fanotify: failed to encode fid (fsid=ae521e68.a434d95f, type=255, bytes=0, err=-2) Signed-off-by: Lubos Dolezel Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 399c109d357a7e217cf7ef551e7e234439c68c15 Author: Chengguang Xu Date: Wed Apr 22 12:28:43 2020 +0800 ovl: sync dirty data when remounting to ro mode sync_filesystem() does not sync dirty data for readonly filesystem during umount, so before changing to readonly filesystem we should sync dirty data for data integrity. Signed-off-by: Chengguang Xu Signed-off-by: Miklos Szeredi commit c21c839b8448dd4b1e37ffc1bde928f57d34c0db Author: Chengguang Xu Date: Fri Apr 24 10:55:17 2020 +0800 ovl: whiteout inode sharing Share inode with different whiteout files for saving inode and speeding up delete operation. If EMLINK is encountered when linking a shared whiteout, create a new one. In case of any other error, disable sharing for this super block. Note: ofs->whiteout is protected by inode lock on workdir. Signed-off-by: Chengguang Xu Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 654255fa205cb2b010e9abb34b0c8afcca9c78c7 Author: Jeffle Xu Date: Thu Apr 23 19:06:55 2020 +0800 ovl: inherit SB_NOSEC flag from upperdir Since the stacking of regular file operations [1], the overlayfs edition of write_iter() is called when writing regular files. Since then, xattr lookup is needed on every write since file_remove_privs() is called from ovl_write_iter(), which would become the performance bottleneck when writing small chunks of data. In my test case, file_remove_privs() would consume ~15% CPU when running fstime of unixbench (the workload is repeadly writing 1 KB to the same file) [2]. Inherit the SB_NOSEC flag from upperdir. Since then xattr lookup would be done only once on the first write. Unixbench fstime gets a ~20% performance gain with this patch. [1] https://lore.kernel.org/lkml/20180606150905.GC9426@magnolia/T/ [2] https://www.spinics.net/lists/linux-unionfs/msg07153.html Signed-off-by: Jeffle Xu Signed-off-by: Miklos Szeredi commit 32b1924b210a70dcacdf65abd687c5ef86a67541 Author: Konstantin Khlebnikov Date: Thu Apr 9 11:29:47 2020 +0300 ovl: skip overlayfs superblocks at global sync Stacked filesystems like overlayfs has no own writeback, but they have to forward syncfs() requests to backend for keeping data integrity. During global sync() each overlayfs instance calls method ->sync_fs() for backend although it itself is in global list of superblocks too. As a result one syscall sync() could write one superblock several times and send multiple disk barriers. This patch adds flag SB_I_SKIP_SYNC into sb->sb_iflags to avoid that. Reported-by: Dmitry Monakhov Signed-off-by: Konstantin Khlebnikov Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 62a8a85be8355b01330667c2b4676fb60c184380 Author: Amir Goldstein Date: Fri Apr 3 10:03:38 2020 +0300 ovl: index dir act as work dir With index=on, let index dir act as the work dir for copy up and cleanups. This will help implementing whiteout inode sharing. We still create the "work" dir on mount regardless of index=on and it is used to test the features supported by upper fs. One reason is that before the feature tests, we do not know if index could be enabled or not. The reason we do not use "index" directory also as workdir with index=off is because the existence of the "index" directory acts as a simple persistent signal that index was enabled on this filesystem and tools may want to use that signal. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 773cb4c56b1bedeb5644f5bd06b76e348bb21634 Author: Amir Goldstein Date: Fri Apr 3 08:43:12 2020 +0300 ovl: prepare to copy up without workdir With index=on, we copy up lower hardlinks to work dir and move them into index dir. Fix locking to allow work dir and index dir to be the same directory. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 3011645b5b061e99cf0f024b3260ec506f91b27c Author: Amir Goldstein Date: Fri Apr 3 07:58:49 2020 +0300 ovl: cleanup non-empty directories in ovl_indexdir_cleanup() Teach ovl_indexdir_cleanup() to remove temp directories containing whiteouts to prepare for using index dir instead of work dir for removing merge directories. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit b0def88d807f6db6076aab2aeb11f542036e81a6 Author: Amir Goldstein Date: Thu Apr 9 18:58:34 2020 +0300 ovl: resolve more conflicting mount options Similar to the way that a conflict between metacopy=on,redirect_dir=off is resolved, also resolve conflicts between nfs_export=on,index=off and nfs_export=on,metacopy=on. An explicit mount option wins over a default config value. Both explicit mount options result in an error. Without this change the xfstests group overlay/exportfs are skipped if metacopy is enabled by default. Reported-by: Chengguang Xu Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit e98ad55989df047a8f12401433850a137eb7aa6f Author: Fabio Estevam Date: Fri May 1 17:34:36 2020 -0300 arm64: dts: imx8qxp-mek: Do not use underscore in node name Underscores are not recommended to be used in node names, so change the pinctrl IO expander node name. This change also makes the pinctrl node names to follow the convention used by other pinctrl group names. Signed-off-by: Fabio Estevam Reviewed-by: Abel Vesa Signed-off-by: Shawn Guo commit 3a0ce12e3b8e3cb7d54569a42aec743cc93f4f0d Author: Andy Shevchenko Date: Thu May 7 19:18:03 2020 +0300 iommu/iova: Unify format of the printed messages Unify format of the printed messages, i.e. replace printk(LEVEL ... ) with pr_level(...). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200507161804.13275-2-andriy.shevchenko@linux.intel.com Signed-off-by: Joerg Roedel commit 2ba20b5a5b8f948d498f4b38ba910ff339e609ef Author: Arnd Bergmann Date: Sat May 9 00:02:16 2020 +0200 iommu/renesas: Fix unused-function warning gcc warns because the only reference to ipmmu_find_group is inside of an #ifdef: drivers/iommu/ipmmu-vmsa.c:878:28: error: 'ipmmu_find_group' defined but not used [-Werror=unused-function] Change the #ifdef to an equivalent IS_ENABLED(). Fixes: 6580c8a78424 ("iommu/renesas: Convert to probe/release_device() call-backs") Signed-off-by: Arnd Bergmann Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20200508220224.688985-1-arnd@arndb.de Signed-off-by: Joerg Roedel commit f38338cf0691b5fae5f9a46d188eef92ab9e6296 Author: Thierry Reding Date: Mon May 11 18:10:00 2020 +0200 iommu: Do not probe devices on IOMMU-less busses The host1x bus implemented on Tegra SoCs is primarily an abstraction to create logical device from multiple platform devices. Since the devices in such a setup are typically hierarchical, DMA setup still needs to be done so that DMA masks can be properly inherited, but we don't actually want to attach the host1x logical devices to any IOMMU. The platform devices that make up the logical device are responsible for memory bus transactions, so it is them that will need to be attached to the IOMMU. Add a check to __iommu_probe_device() that aborts IOMMU setup early for busses that don't have the IOMMU operations pointer set since they will cause a crash otherwise. Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20200511161000.3853342-1-thierry.reding@gmail.com Signed-off-by: Joerg Roedel commit cfcccbe8879f79bc9f8a162bcb482c74b8768094 Author: Qian Cai Date: Fri May 8 21:56:45 2020 -0400 iommu/amd: Fix variable "iommu" set but not used The commit dce8d6964ebd ("iommu/amd: Convert to probe/release_device() call-backs") introduced an unused variable, drivers/iommu/amd_iommu.c: In function 'amd_iommu_uninit_device': drivers/iommu/amd_iommu.c:422:20: warning: variable 'iommu' set but not used [-Wunused-but-set-variable] struct amd_iommu *iommu; ^~~~~ Signed-off-by: Qian Cai Link: https://lore.kernel.org/r/20200509015645.3236-1-cai@lca.pw Fixes: dce8d6964ebd ("iommu/amd: Convert to probe/release_device() call-backs") Signed-off-by: Joerg Roedel commit 524bb73bc15c56f5587e33c817e103a259b019d2 Author: Yu-cheng Yu Date: Tue May 12 07:54:37 2020 -0700 x86/fpu/xstate: Separate user and supervisor xfeatures mask Before the introduction of XSAVES supervisor states, 'xfeatures_mask' is used at various places to determine XSAVE buffer components and XCR0 bits. It contains only user xstates. To support supervisor xstates, it is necessary to separate user and supervisor xstates: - First, change 'xfeatures_mask' to 'xfeatures_mask_all', which represents the full set of bits that should ever be set in a kernel XSAVE buffer. - Introduce xfeatures_mask_supervisor() and xfeatures_mask_user() to extract relevant xfeatures from xfeatures_mask_all. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/20200512145444.15483-4-yu-cheng.yu@intel.com commit fd9eef1a132d1974405c3ebf9d5688ec5c51da94 Author: Eelco Chaudron Date: Tue May 12 11:04:40 2020 +0200 libbpf: Fix probe code to return EPERM if encountered When the probe code was failing for any reason ENOTSUP was returned, even if this was due to not having enough lock space. This patch fixes this by returning EPERM to the user application, so it can respond and increase the RLIMIT_MEMLOCK size. Signed-off-by: Eelco Chaudron Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/158927424896.2342.10402475603585742943.stgit@ebuild commit 309b81f0fdc4209d998bc63f0da52c2e96340d4e Author: Yauheni Kaliuta Date: Wed May 13 05:17:22 2020 +0300 selftests/bpf: Install generated test progs Before commit 74b5a5968fe8 ("selftests/bpf: Replace test_progs and test_maps w/ general rule") selftests/bpf used generic install target from selftests/lib.mk to install generated bpf test progs by mentioning them in TEST_GEN_FILES variable. Take that functionality back. Fixes: 74b5a5968fe8 ("selftests/bpf: Replace test_progs and test_maps w/ general rule") Signed-off-by: Yauheni Kaliuta Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200513021722.7787-1-yauheni.kaliuta@redhat.com commit 88d93afd774edc2b84b255acf1456ef501feeea5 Author: Dong Aisheng Date: Sun Apr 26 16:11:44 2020 +0800 dt-bindings: firmware: imx: Add more system controls and PM clock types Add more system controls and PM clock types for usage. Signed-off-by: Dong Aisheng Signed-off-by: Fugang Duan Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 755a7397947e21123d8162eaf7477b614732ff22 Author: Dong Aisheng Date: Sun Apr 26 16:11:43 2020 +0800 dt-bindings: firmware: imx: Move system control into dt-binding headfile i.MX8 SoCs DTS file needs system control macro definitions, so move them into dt-binding headfile, then include/linux/firmware/imx/types.h can be removed and those drivers using it should be changed accordingly. Signed-off-by: Dong Aisheng Signed-off-by: Jacky Bai Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 957743b79b1ebb710f5498b61a212cebc302e685 Author: Tim Harvey Date: Wed Apr 29 08:22:35 2020 -0700 ARM: dts: imx6qdl-gw552x: add USB OTG support The GW552x-B board revision adds USB OTG support. Enable the device-tree node and configure the OTG_ID pin. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 5b440676c15bbe1a40f2546ec92db83ed66d9e22 Author: Archie Pusaka Date: Tue Apr 14 16:08:40 2020 +0800 Bluetooth: L2CAP: add support for waiting disconnection resp Whenever we disconnect a L2CAP connection, we would immediately report a disconnection event (EPOLLHUP) to the upper layer, without waiting for the response of the other device. This patch offers an option to wait until we receive a disconnection response before reporting disconnection event, by using the "how" parameter in l2cap_sock_shutdown(). Therefore, upper layer can opt to wait for disconnection response by shutdown(sock, SHUT_WR). This can be used to enforce proper disconnection order in HID, where the disconnection of the interrupt channel must be complete before attempting to disconnect the control channel. Signed-off-by: Archie Pusaka Signed-off-by: Marcel Holtmann commit adf1d6926444029396861413aba8a0f2a805742a Author: Sonny Sasaka Date: Wed May 6 12:55:03 2020 -0700 Bluetooth: Handle Inquiry Cancel error after Inquiry Complete After sending Inquiry Cancel command to the controller, it is possible that Inquiry Complete event comes before Inquiry Cancel command complete event. In this case the Inquiry Cancel command will have status of Command Disallowed since there is no Inquiry session to be cancelled. This case should not be treated as error, otherwise we can reach an inconsistent state. Example of a btmon trace when this happened: < HCI Command: Inquiry Cancel (0x01|0x0002) plen 0 > HCI Event: Inquiry Complete (0x01) plen 1 Status: Success (0x00) > HCI Event: Command Complete (0x0e) plen 4 Inquiry Cancel (0x01|0x0002) ncmd 1 Status: Command Disallowed (0x0c) Signed-off-by: Sonny Sasaka Signed-off-by: Marcel Holtmann commit 608c39f4308cefde9d1f24b661261de2b3f3fef4 Author: Rikard Falkeborn Date: Sat May 9 15:17:19 2020 +0200 Bluetooth: serdev: Constify serdev_device_ops serdev_device_ops is not modified and can be const. Also, remove the unneeded declaration of it. Output from the file command before and after: Before: text data bss dec hex filename 7192 2408 192 9792 2640 drivers/bluetooth/hci_serdev.o After: text data bss dec hex filename 7256 2344 192 9792 2640 drivers/bluetooth/hci_serdev.o Signed-off-by: Rikard Falkeborn Signed-off-by: Marcel Holtmann commit 875e16759005e3bdaa84eb2741281f37ba35b886 Author: Raghuram Hegde Date: Mon May 11 16:40:40 2020 +0530 Bluetooth: btusb: Add support for Intel Bluetooth Device Typhoon Peak (8087:0032) Device from /sys/kernel/debug/usb/devices: T: Bus=01 Lev=01 Prnt=01 Port=13 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=8087 ProdID=0032 Rev= 0.00 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms Signed-off-by: Raghuram Hegde Signed-off-by: Chethan T N Signed-off-by: Amit K Bag Signed-off-by: Marcel Holtmann commit b7d0bf11a7ad0e97721a5c4a209ba749649f8b9e Author: Abhishek Pandit-Subedi Date: Tue May 12 19:19:27 2020 -0700 Bluetooth: btusb: Implement hdev->prevent_wake Implement the prevent_wake hook by checking device_may_wakeup on the usb interface. This prevents the Bluetooth core from enabling scanning when the device isn't expected to wake from suspend. Signed-off-by: Abhishek Pandit-Subedi Reviewed-by: Alain Michaud Signed-off-by: Marcel Holtmann commit 81dafad53c67abe4f09b0b04131fe490e76e5602 Author: Abhishek Pandit-Subedi Date: Tue May 12 19:19:26 2020 -0700 Bluetooth: Add hook for driver to prevent wake from suspend Let drivers have a hook to disable configuring scanning during suspend. Drivers should use the device_may_wakeup function call to determine whether hci should be configured for wakeup. For example, an implementation for btusb may look like the following: bool btusb_prevent_wake(struct hci_dev *hdev) { struct btusb_data *data = hci_get_drvdata(hdev); return !device_may_wakeup(&data->udev->dev); } Signed-off-by: Abhishek Pandit-Subedi Reviewed-by: Alain Michaud Signed-off-by: Marcel Holtmann commit 0d2c9825e46d45f8a520135c9c791b5c73a165ab Author: Abhishek Pandit-Subedi Date: Tue May 12 19:19:25 2020 -0700 Bluetooth: Rename BT_SUSPEND_COMPLETE Renamed BT_SUSPEND_COMPLETE to BT_SUSPEND_CONFIGURE_WAKE since it sets up the event filter and whitelist for wake-up. Signed-off-by: Abhishek Pandit-Subedi Reviewed-by: Alain Michaud Signed-off-by: Marcel Holtmann commit 91779665c129d361c032d2a590b37a077b6cb9d7 Author: Abhishek Pandit-Subedi Date: Tue May 12 19:09:33 2020 -0700 Bluetooth: Modify LE window and interval for suspend When a device is suspended, it doesn't need to be as responsive to connection events. Increase the interval to 640ms (creating a duty cycle of roughly 1.75%) so that passive scanning uses much less power (vs previous duty cycle of 18.75%). The new window + interval combination has been tested to work with HID devices (which are currently the only devices capable of wake up). Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann commit aaebf8e6088270e45d30314031b5d9a88a589cb9 Author: Abhishek Pandit-Subedi Date: Tue May 12 19:09:32 2020 -0700 Bluetooth: Fix incorrect type for window and interval The types for window and interval should be uint16, not uint8. Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann commit 6c591eec67cbb4db988ab35b944f5cf9013c0714 Author: Saravana Kannan Date: Tue May 12 15:53:19 2020 +0300 OPP: Add helpers for reading the binding properties The opp-hz DT property is not mandatory and we may use another property as a key in the OPP table. Add helper functions to simplify the reading and comparing the keys. Signed-off-by: Saravana Kannan Signed-off-by: Georgi Djakov Reviewed-by: Matthias Kaehlcke Reviewed-by: Sibi Sankar [ Viresh: Removed an unnecessary comment ] Signed-off-by: Viresh Kumar commit 45a41875fa20836f2839d4dda1f37d119a275542 Author: Saravana Kannan Date: Tue May 12 15:53:18 2020 +0300 dt-bindings: opp: Introduce opp-peak-kBps and opp-avg-kBps bindings Interconnects often quantify their performance points in terms of bandwidth. So, add opp-peak-kBps (required) and opp-avg-kBps (optional) to allow specifying Bandwidth OPP tables in DT. opp-peak-kBps is a required property that replaces opp-hz for Bandwidth OPP tables. opp-avg-kBps is an optional property that can be used in Bandwidth OPP tables. Signed-off-by: Saravana Kannan Signed-off-by: Georgi Djakov Reviewed-by: Sibi Sankar Reviewed-by: Rob Herring Signed-off-by: Viresh Kumar commit bc8c945e0ad2ff6d725af9b10085c6ee5d35a563 Author: Stephen Boyd Date: Wed Apr 8 23:44:16 2020 -0700 clk: Move HAVE_CLK config out of architecture layer The implementation of 'struct clk' is not really an architectual detail anymore now that most architectures have migrated to the common clk framework. To sway new architecture ports away from trying to implement their own 'struct clk', move the config next to the common clk framework config. Cc: Russell King Cc: Arnd Bergmann Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200409064416.83340-11-sboyd@kernel.org Reviewed-by: Arnd Bergmann commit c7725c9b74b4058a5ec16c88c29ad88947307f5c Author: Stephen Boyd Date: Wed Apr 8 23:44:15 2020 -0700 MIPS: Loongson64: Drop asm/clock.h include This include isn't used by this file, so just remove it. Acked-by: Jiaxun Yang Cc: Paul Burton Cc: Cc: Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200409064416.83340-10-sboyd@kernel.org Reviewed-by: Arnd Bergmann commit 3819ad44025fbc03b32d41070b941acea86e6686 Author: Stephen Boyd Date: Wed Apr 8 23:44:14 2020 -0700 ARM: mmp: Remove legacy clk code Remove all the legacy clk code that supports a non-common clk framework implementation of 'struct clk' in mach-mmp. This code doesn't look to be compiled anymore given that the MMP is fully supported in the multi-platform config via ARCH_MULTIPLATFORM as of commit 377524dc4d77 ("ARM: mmp: move into ARCH_MULTIPLATFORM"). The ARCH_MULTIPLATFORM config selects COMMON_CLK and therefore the Makefile rule can never actually compile the code in these files. Cc: Lubomir Rintel Cc: Russell King Cc: Cc: Arnd Bergmann Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200409064416.83340-9-sboyd@kernel.org Reviewed-by: Arnd Bergmann [sboyd@kernel.org: Squash in a clock.h include removal found by Stephen Rothwell ] commit 4127cbcd989fd9d499942956b5bf7ec7af9c06e0 Author: Geert Uytterhoeven Date: Thu May 7 13:36:26 2020 +0200 phy: intel-lgm-emmc: Add architecture dependency The Intel eMMC PHY is only present on Intel Lightning Mountain SoCs. Add an architecture dependency to the PHY_INTEL_EMMC config symbol, to avoid asking the user about it when configuring a kernel for a non-x86 architecture. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200507113626.24026-3-geert+renesas@glider.be Signed-off-by: Kishon Vijay Abraham I commit e2ae8bca494481a9f38fcd1d52943ac04e654745 Author: Wei Yongjun Date: Thu May 7 05:41:09 2020 +0000 phy: ti: j721e-wiz: Fix some error return code in wiz_probe() Fix to return negative error code from some error handling cases instead of 0, as done elsewhere in this function. Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Acked-by: Roger Quadros Link: https://lore.kernel.org/r/20200507054109.110849-1-weiyongjun1@huawei.com Signed-off-by: Kishon Vijay Abraham I commit 6d9c1de86443b9b59ea8a3f9bfaf54bf7d0853c9 Author: Christophe JAILLET Date: Thu May 7 22:31:27 2020 +0200 phy: cpcap-usb: Remove some useless code Axe a clk that is unused in the driver. Signed-off-by: Christophe JAILLET Acked-by: Tony Lindgren Link: https://lore.kernel.org/r/20200507203127.202197-1-christophe.jaillet@wanadoo.fr Signed-off-by: Kishon Vijay Abraham I commit 05942b8c36c7eb5d3fc5e375d4b0d0c49562e85d Author: Jonathan Bakker Date: Sat Apr 25 10:36:33 2020 -0700 phy: samsung: s5pv210-usb2: Add delay after reset The USB phy takes some time to reset, so make sure we give it to it. The delay length was taken from the 4x12 phy driver. This manifested in issues with the DWC2 driver since commit fe369e1826b3 ("usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.") where the endianness check would read the DWC ID as 0 due to the phy still resetting, resulting in the wrong endian mode being chosen. Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/BN6PR04MB06605D52502816E500683553A3D10@BN6PR04MB0660.namprd04.prod.outlook.com Signed-off-by: Kishon Vijay Abraham I commit 02ef12a663c7ac24b06146d0ed3137848edb0676 Author: Johannes Thumshirn Date: Tue May 12 17:55:54 2020 +0900 zonefs: use REQ_OP_ZONE_APPEND for sync DIO Synchronous direct I/O to a sequential write only zone can be issued using the new REQ_OP_ZONE_APPEND request operation. As dispatching multiple BIOs can potentially result in reordering, we cannot support asynchronous IO via this interface. We also can only dispatch up to queue_max_zone_append_sectors() via the new zone-append method and have to return a short write back to user-space in case an IO larger than queue_max_zone_append_sectors() has been issued. Signed-off-by: Johannes Thumshirn Acked-by: Damien Le Moal Signed-off-by: Jens Axboe commit 29b2a3aa296711cfdadafbf627c2d9a388fc84ee Author: Johannes Thumshirn Date: Tue May 12 17:55:53 2020 +0900 block: export bio_release_pages and bio_iov_iter_get_pages Export bio_release_pages and bio_iov_iter_get_pages, so they can be used from modular code. Signed-off-by: Johannes Thumshirn Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit e0489ed5daeb48cf182c4c98da4a873f947f2afa Author: Damien Le Moal Date: Tue May 12 17:55:52 2020 +0900 null_blk: Support REQ_OP_ZONE_APPEND Support REQ_OP_ZONE_APPEND requests for null_blk devices with zoned mode enabled. Use the internally tracked zone write pointer position as the actual write position and return it using the command request __sector field in the case of an mq device and using the command BIO sector in the case of a BIO device. Signed-off-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5795eb443060148796beeba106e4366d7f1458a6 Author: Johannes Thumshirn Date: Tue May 12 17:55:51 2020 +0900 scsi: sd_zbc: emulate ZONE_APPEND commands Emulate ZONE_APPEND for SCSI disks using a regular WRITE(16) command with a start LBA set to the target zone write pointer position. In order to always know the write pointer position of a sequential write zone, the write pointer of all zones is tracked using an array of 32bits zone write pointer offset attached to the scsi disk structure. Each entry of the array indicate a zone write pointer position relative to the zone start sector. The write pointer offsets are maintained in sync with the device as follows: 1) the write pointer offset of a zone is reset to 0 when a REQ_OP_ZONE_RESET command completes. 2) the write pointer offset of a zone is set to the zone size when a REQ_OP_ZONE_FINISH command completes. 3) the write pointer offset of a zone is incremented by the number of 512B sectors written when a write, write same or a zone append command completes. 4) the write pointer offset of all zones is reset to 0 when a REQ_OP_ZONE_RESET_ALL command completes. Since the block layer does not write lock zones for zone append commands, to ensure a sequential ordering of the regular write commands used for the emulation, the target zone of a zone append command is locked when the function sd_zbc_prepare_zone_append() is called from sd_setup_read_write_cmnd(). If the zone write lock cannot be obtained (e.g. a zone append is in-flight or a regular write has already locked the zone), the zone append command dispatching is delayed by returning BLK_STS_ZONE_RESOURCE. To avoid the need for write locking all zones for REQ_OP_ZONE_RESET_ALL requests, use a spinlock to protect accesses and modifications of the zone write pointer offsets. This spinlock is initialized from sd_probe() using the new function sd_zbc_init(). Co-developed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 02494d35ba5547562aae4d9c4df2d6ec33d29012 Author: Johannes Thumshirn Date: Tue May 12 17:55:50 2020 +0900 scsi: sd_zbc: factor out sanity checks for zoned commands Factor sanity checks for zoned commands from sd_zbc_setup_zone_mgmt_cmnd(). This will help with the introduction of an emulated ZONE_APPEND command. Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe commit e732671aa5f67232cf760666a15242dead003362 Author: Damien Le Moal Date: Tue May 12 17:55:49 2020 +0900 block: Modify revalidate zones Modify the interface of blk_revalidate_disk_zones() to add an optional driver callback function that a driver can use to extend processing done during zone revalidation. The callback, if defined, is executed with the device request queue frozen, after all zones have been inspected. Signed-off-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe commit 1392d37018d4f68c5bb2c98dae9a018b73926865 Author: Johannes Thumshirn Date: Tue May 12 17:55:48 2020 +0900 block: introduce blk_req_zone_write_trylock Introduce blk_req_zone_write_trylock(), which either grabs the write-lock for a sequential zone or returns false, if the zone is already locked. Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe commit 0512a75b98f847c2e9a4b664013424e603e202f7 Author: Keith Busch Date: Tue May 12 17:55:47 2020 +0900 block: Introduce REQ_OP_ZONE_APPEND Define REQ_OP_ZONE_APPEND to append-write sectors to a zone of a zoned block device. This is a no-merge write operation. A zone append write BIO must: * Target a zoned block device * Have a sector position indicating the start sector of the target zone * The target zone must be a sequential write zone * The BIO must not cross a zone boundary * The BIO size must not be split to ensure that a single range of LBAs is written with a single command. Implement these checks in generic_make_request_checks() using the helper function blk_check_zone_append(). To avoid write append BIO splitting, introduce the new max_zone_append_sectors queue limit attribute and ensure that a BIO size is always lower than this limit. Export this new limit through sysfs and check these limits in bio_full(). Also when a LLDD can't dispatch a request to a specific zone, it will return BLK_STS_ZONE_RESOURCE indicating this request needs to be delayed, e.g. because the zone it will be dispatched to is still write-locked. If this happens set the request aside in a local list to continue trying dispatching requests such as READ requests or a WRITE/ZONE_APPEND requests targetting other zones. This way we can still keep a high queue depth without starving other requests even if one request can't be served due to zone write-locking. Finally, make sure that the bio sector position indicates the actual write position as indicated by the device on completion. Signed-off-by: Keith Busch [ jth: added zone-append specific add_page and merge_page helpers ] Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe commit e4581105771b3523ced88f781eb2672195d217aa Author: Christoph Hellwig Date: Tue May 12 17:55:46 2020 +0900 block: rename __bio_add_pc_page to bio_add_hw_page Rename __bio_add_pc_page() to bio_add_hw_page() and explicitly pass in a max_sectors argument. This max_sectors argument can be used to specify constraints from the hardware. Signed-off-by: Christoph Hellwig [ jth: rebased and made public for blk-map.c ] Signed-off-by: Johannes Thumshirn Reviewed-by: Daniel Wagner Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 02992df822e7e36685593aad10721a5a9f8d3402 Author: Johannes Thumshirn Date: Tue May 12 17:55:45 2020 +0900 block: provide fallbacks for blk_queue_zone_is_seq and blk_queue_zone_no blk_queue_zone_is_seq() and blk_queue_zone_no() have not been called with CONFIG_BLK_DEV_ZONED disabled until now. The introduction of REQ_OP_ZONE_APPEND will change this, so we need to provide noop fallbacks for the !CONFIG_BLK_DEV_ZONED case. Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe commit e6249cdd46e43a7d3bdb8cce5fe24565d6c11e94 Author: Ming Lei Date: Sun May 3 09:54:22 2020 +0800 block: add blk_io_schedule() for avoiding task hung in sync dio Sync dio could be big, or may take long time in discard or in case of IO failure. We have prevented task hung in submit_bio_wait() and blk_execute_rq(), so apply the same trick for prevent task hung from happening in sync dio. Add helper of blk_io_schedule() and use io_schedule_timeout() to prevent task hung warning. Signed-off-by: Ming Lei Reviewed-by: Bart Van Assche Cc: Salman Qazi Cc: Jesse Barnes Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Hannes Reinecke Signed-off-by: Jens Axboe commit 27eb3af9a37a85ca35f82830a8fc29753700058a Author: Ming Lei Date: Fri May 8 16:17:58 2020 +0800 block: don't hold part0's refcount in IO path gendisk can't be gone when there is IO activity, so not hold part0's refcount in IO path. Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Yufen Yu Cc: Christoph Hellwig Cc: Hou Tao Signed-off-by: Jens Axboe commit 520138c3b9425c615d1417687947d86821003319 Author: Ming Lei Date: Fri May 8 16:17:57 2020 +0800 block: re-organize fields of 'struct hd_part' Put all fields accessed in IO path together at the beginning of the struct, so that all can be fetched in single cacheline. Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Yufen Yu Cc: Christoph Hellwig Cc: Hou Tao Signed-off-by: Jens Axboe commit 07c4e1e834f8e7c991aa6dcb5ee0b7f2842e495d Author: Ming Lei Date: Fri May 8 16:17:56 2020 +0800 block: only define 'nr_sects_seq' in hd_part for 32bit SMP The seqcount of 'nr_sects_seq' is only needed in case of 32bit SMP, so define it just for 32bit SMP. Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Yufen Yu Cc: Christoph Hellwig Cc: Hou Tao Signed-off-by: Jens Axboe commit b7d6c30333239f77f8e51423064a623acc7fd127 Author: Ming Lei Date: Fri May 8 16:17:55 2020 +0800 block: fix use-after-free on cached last_lookup partition delete_partition() clears the cached last_lookup partition. However the .last_lookup cache may be overwritten by one IO path after it is cleared from delete_partition(). Then another IO path may use the cached deleting partition after hd_struct_free() is called, then use-after-free is triggered on the cached partition. Fixes the issue by the following approach: 1) always get the partition's refcount via hd_struct_try_get() before setting .last_lookup 2) move clearing .last_lookup from delete_partition() to hd_struct_free() which is the release handle of the partition's percpu-refcount, so that no IO path can cache deleteing partition via .last_lookup. It is one candidate approach of Yufen's patch[1] which adds overhead in fast path by indirect lookup which may introduce one extra cacheline in IO path. Also this patch relies on percpu-refcount's protection, and it is easier to understand and verify. [1] https://lore.kernel.org/linux-block/20200109013551.GB9655@ming.t460p/T/#t Reported-by: Yufen Yu Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Christoph Hellwig Cc: Hou Tao Signed-off-by: Jens Axboe commit aa880ad690ab6d4c53934af85fb5a43e69ecb0f5 Author: Weiping Zhang Date: Wed May 13 08:44:05 2020 +0800 block: reset mapping if failed to update hardware queue count When we increase hardware queue count, blk_mq_update_queue_map will reset the mapping between cpu and hardware queue base on the hardware queue count(set->nr_hw_queues). The mapping cannot be reset if it encounters error in blk_mq_realloc_hw_ctxs, but the fallback flow will continue using it, then blk_mq_map_swqueue will touch a invalid memory, because the mapping points to a wrong hctx. blktest block/030: null_blk: module loaded Increasing nr_hw_queues to 8 fails, fallback to 1 ================================================================== BUG: KASAN: null-ptr-deref in blk_mq_map_swqueue+0x2f2/0x830 Read of size 8 at addr 0000000000000128 by task nproc/8541 CPU: 5 PID: 8541 Comm: nproc Not tainted 5.7.0-rc4-dbg+ #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack+0xa5/0xe6 __kasan_report.cold+0x65/0xbb kasan_report+0x45/0x60 check_memory_region+0x15e/0x1c0 __kasan_check_read+0x15/0x20 blk_mq_map_swqueue+0x2f2/0x830 __blk_mq_update_nr_hw_queues+0x3df/0x690 blk_mq_update_nr_hw_queues+0x32/0x50 nullb_device_submit_queues_store+0xde/0x160 [null_blk] configfs_write_file+0x1c4/0x250 [configfs] __vfs_write+0x4c/0x90 vfs_write+0x14b/0x2d0 ksys_write+0xdd/0x180 __x64_sys_write+0x47/0x50 do_syscall_64+0x6f/0x310 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Signed-off-by: Weiping Zhang Tested-by: Bart van Assche Signed-off-by: Jens Axboe commit c027b02d89fd42ecee911c39e9098b9609a5ca0b Author: Changbin Du Date: Tue May 12 23:36:07 2020 +0800 streamline_config.pl: add LMC_KEEP to preserve some kconfigs Sometimes it is useful to preserve batches of configs when making localmodconfig. For example, I usually don't want any usb and fs modules to be disabled. Now we can do it by: $ make LMC_KEEP="drivers/usb:fs" localmodconfig Signed-off-by: Changbin Du Acked-by: Steven Rostedt (VMware) Signed-off-by: Masahiro Yamada commit fb9f2e92864f51d25e790947cca2ac4426a12f9c Author: Vladimir Oltean Date: Wed May 13 03:23:27 2020 +0300 net: dsa: tag_sja1105: appease sparse checks for ethertype accessors A comparison between a value from the packet and an integer constant value needs to be done by converting the value from the packet from net->host, or the constant from host->net. Not the other way around. Even though it makes no practical difference, correct that. Fixes: 38b5beeae7a4 ("net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a0e46db4e764f56c61f85c235c50bf4578c51a47 Author: Jason Gunthorpe Date: Wed May 6 10:47:01 2020 +0300 RDMA/cm: Increment the refcount inside cm_find_listen() All callers need the 'get', so do it in a central place before returning the pointer. Link: https://lore.kernel.org/r/20200506074701.9775-11-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 51e8463cfc48ca030e532c9127ee1219a95795c3 Author: Jason Gunthorpe Date: Wed May 6 10:47:00 2020 +0300 RDMA/cm: Remove needless cm_id variable Just put the expression in the only reader Link: https://lore.kernel.org/r/20200506074701.9775-10-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1cc44279f2973b413bae69d9a0bf01f051f382b0 Author: Jason Gunthorpe Date: Wed May 6 10:46:59 2020 +0300 RDMA/cm: Remove the cm_free_id() wrapper function Just call xa_erase directly during cm_destroy_id() Link: https://lore.kernel.org/r/20200506074701.9775-9-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cfa68b0d04401b3ae733787b1c72ab1266e852ab Author: Jason Gunthorpe Date: Wed May 6 10:46:58 2020 +0300 RDMA/cm: Make find_remote_id() return a cm_id_private The only caller doesn't care about the timewait, so acquire and return the cm_id_private from the function. Link: https://lore.kernel.org/r/20200506074701.9775-8-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 09fb406a569b2f4b596048e1cfa2c92a35b8fc9b Author: Jason Gunthorpe Date: Wed May 6 10:46:57 2020 +0300 RDMA/cm: Add a note explaining how the timewait is eventually freed The way the cm_timewait_info is converted into a work and then freed is very subtle and surprising, add a note clarifying the lifetime here. Link: https://lore.kernel.org/r/20200506074701.9775-7-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9767a27e1aeb462812e9f054c313180eeff0b5c3 Author: Jason Gunthorpe Date: Wed May 6 10:46:56 2020 +0300 RDMA/cm: Pass the cm_id_private into cm_cleanup_timewait Also rename it to cm_remove_remote(). This function now removes the tracking of the remote ID/QPN in the redblack trees from a cm_id_private. Replace a open-coded version with a call. The open coded version was deleting only the remote_id, however at this call site the qpn can not have been in the RB tree either, so the cm_remove_remote() will do the same. Link: https://lore.kernel.org/r/20200506074701.9775-6-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e83f195aa45c1ffd73b3a950a887e41c260cf194 Author: Jason Gunthorpe Date: Wed May 6 10:46:55 2020 +0300 RDMA/cm: Pull duplicated code into cm_queue_work_unlock() While unlocking a spinlock held by the caller is a disturbing pattern, this extensively duplicated code is even worse. Pull all the duplicates into a function and explain the purpose of the algorithm. The on creation side call in cm_req_handler() which is different has been micro-optimized on the basis that the work_count == -1 during creation, remove that and just use the normal function. Link: https://lore.kernel.org/r/20200506074701.9775-5-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 42113eed8f10533ba419df535b6c0ff9141a948c Author: Danit Goldberg Date: Wed May 6 10:46:54 2020 +0300 RDMA/cm: Remove unused store to ret in cm_rej_handler The 'goto out' label doesn't read ret, so don't set it. Link: https://lore.kernel.org/r/20200506074701.9775-4-leon@kernel.org Signed-off-by: Danit Goldberg Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d3552fb65d239be4775dc9b24740efd1bd70b459 Author: Jason Gunthorpe Date: Wed May 6 10:46:53 2020 +0300 RDMA/cm: Remove return code from add_cm_id_to_port_list This cannot happen, all callers pass in one of the two pointers. Use a WARN_ON guard instead. Link: https://lore.kernel.org/r/20200506074701.9775-3-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f8f2a576cb0c574044c049210ea4096e5cb1d7fc Author: Jason Gunthorpe Date: Wed May 6 10:46:52 2020 +0300 RDMA/addr: Mark addr_resolve as might_sleep() Under one path through ib_nl_fetch_ha() this calls nlmsg_new(GFP_KERNEL) which is a sleeping call. This is a very rare path, so mark fetch_ha() and the module external entry point that conditionally calls through to fetch_ha() as might_sleep(). Link: https://lore.kernel.org/r/20200506074701.9775-2-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 55ce24b3bfd75f76696a00f2666caaf806eebea2 Author: Jason Yan Date: Tue May 12 19:32:58 2020 +0800 scsi: hisi_sas: Display proc_name in sysfs The 'proc_name' entry in sysfs for hisi_sas is 'null' now because it is not initialized in scsi_host_template. It looks like: [root@localhost ~]# cat /sys/class/scsi_host/host2/proc_name (null) While the other driver's entry looks like: linux-vnMQMU:~ # cat /sys/class/scsi_host/host0/proc_name megaraid_sas Link: https://lore.kernel.org/r/20200512113258.30781-1-yanaijie@huawei.com Cc: John Garry Cc: Xiang Chen Acked-by: John Garry Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit fe5a90b8c14914397a3bb0c214d142103c1ba3bf Author: YueHaibing Date: Sat May 9 19:18:52 2020 +0800 selinux: netlabel: Remove unused inline function There's no callers in-tree. Signed-off-by: YueHaibing Signed-off-by: Paul Moore commit 9cd6b593cfc9eaa476c9a3fa768b08bca73213d0 Author: Eric Biggers Date: Mon May 11 12:21:18 2020 -0700 fs-verity: remove unnecessary extern keywords Remove the unnecessary 'extern' keywords from function declarations. This makes it so that we don't have a mix of both styles, so it won't be ambiguous what to use in new fs-verity patches. This also makes the code shorter and matches the 'checkpatch --strict' expectation. Link: https://lore.kernel.org/r/20200511192118.71427-3-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 6377a38bd345b7f3b664c43ebb647ae55c1166e4 Author: Eric Biggers Date: Mon May 11 12:21:17 2020 -0700 fs-verity: fix all kerneldoc warnings Fix all kerneldoc warnings in fs/verity/ and include/linux/fsverity.h. Most of these were due to missing documentation for function parameters. Detected with: scripts/kernel-doc -v -none fs/verity/*.{c,h} include/linux/fsverity.h This cleanup makes it possible to check new patches for kerneldoc warnings without having to filter out all the existing ones. Link: https://lore.kernel.org/r/20200511192118.71427-2-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 607009020a5e7fd9353fb2dd4cdcc73e26f3350f Author: Eric Biggers Date: Mon May 11 12:13:58 2020 -0700 fscrypt: remove unnecessary extern keywords Remove the unnecessary 'extern' keywords from function declarations. This makes it so that we don't have a mix of both styles, so it won't be ambiguous what to use in new fscrypt patches. This also makes the code shorter and matches the 'checkpatch --strict' expectation. Link: https://lore.kernel.org/r/20200511191358.53096-4-ebiggers@kernel.org Signed-off-by: Eric Biggers commit fe015a78e5d0139cb126e8dbfc46a80be2bd27ad Author: Eric Biggers Date: Mon May 11 12:13:57 2020 -0700 fscrypt: name all function parameters Name all the function parameters. This makes it so that we don't have a mix of both styles, so it won't be ambiguous what to use in new fscrypt patches. This also matches the checkpatch expectation. Link: https://lore.kernel.org/r/20200511191358.53096-3-ebiggers@kernel.org Signed-off-by: Eric Biggers commit d2fe97545a1e2d01c0ca0105bdc59002a0d0b130 Author: Eric Biggers Date: Mon May 11 12:13:56 2020 -0700 fscrypt: fix all kerneldoc warnings Fix all kerneldoc warnings in fs/crypto/ and include/linux/fscrypt.h. Most of these were due to missing documentation for function parameters. Detected with: scripts/kernel-doc -v -none fs/crypto/*.{c,h} include/linux/fscrypt.h This cleanup makes it possible to check new patches for kerneldoc warnings without having to filter out all the existing ones. For consistency, also adjust some function "brief descriptions" to include the parentheses and to wrap at 80 characters. (The latter matches the checkpatch expectation.) Link: https://lore.kernel.org/r/20200511191358.53096-2-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 90ae0b57e4a515342fe74ffa21f6972f5145d645 Author: Lang Cheng Date: Tue May 5 18:30:07 2020 +0800 RDMA/hns: Combine enable flags of qp It's easier to understand and maintain enable flags of qp using a single field in type of unsigned long than defining a field for every flags in the structure hns_roce_qp, and we can add new flags for features more conveniently in the future. Link: https://lore.kernel.org/r/1588674607-25337-4-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 30661322b8c32e020c6638dc4317034ec95a1b3f Author: Weihang Li Date: Tue May 5 18:30:06 2020 +0800 RDMA/hns: Extend capability flags for HIP08_C 12 bits is not enough for HIP08_C, so extend a new field in length of 16 bits for it. Link: https://lore.kernel.org/r/1588674607-25337-3-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit c774ad010873bb89dcc0cdcb1e96aef6664d8caf Author: Suman Anna Date: Mon Apr 20 11:06:00 2020 -0500 remoteproc: Fix and restore the parenting hierarchy for vdev The commit 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") has introduced a new vdev subdevice for each vdev declared in the firmware resource table and made it as the parent for the created virtio rpmsg devices instead of the previous remoteproc device. This changed the overall parenting hierarchy for the rpmsg devices, which were children of virtio devices, and does not allow the corresponding rpmsg drivers to retrieve the parent rproc device through the rproc_get_by_child() API. Fix this by restoring the remoteproc device as the parent. The new vdev subdevice can continue to inherit the DMA attributes from the remoteproc's parent device (actual platform device). Cc: stable@vger.kernel.org Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Suman Anna Reviewed-by: Mathieu Poirier Acked-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20200420160600.10467-3-s-anna@ti.com Signed-off-by: Bjorn Andersson commit db9178a4f8c4e523f824892cb8bab00961b07385 Author: Tero Kristo Date: Mon Apr 20 11:05:59 2020 -0500 remoteproc: Fall back to using parent memory pool if no dedicated available In some cases, like with OMAP remoteproc, we are not creating dedicated memory pool for the virtio device. Instead, we use the same memory pool for all shared memories. The current virtio memory pool handling forces a split between these two, as a separate device is created for it, causing memory to be allocated from bad location if the dedicated pool is not available. Fix this by falling back to using the parent device memory pool if dedicated is not available. Cc: stable@vger.kernel.org Reviewed-by: Mathieu Poirier Acked-by: Arnaud Pouliquen Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Tero Kristo Signed-off-by: Suman Anna Link: https://lore.kernel.org/r/20200420160600.10467-2-s-anna@ti.com Signed-off-by: Bjorn Andersson commit 17793833f81ceb319be599ec09498ec0136d9acf Author: Leon Romanovsky Date: Mon May 4 16:25:41 2020 +0300 RDMA/ucma: Return stable IB device index as identifier The librdmacm uses node_guid as identifier to correlate between IB devices and CMA devices. However FW resets cause to such "connection" to be lost and require from the user to restart its application. Extend UCMA to return IB device index, which is stable identifier. Link: https://lore.kernel.org/r/20200504132541.355710-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cf520c64301204afa8272a94cc2e1495a425446a Author: Johnny Chuang Date: Tue May 12 14:44:39 2020 -0700 Input: elants_i2c - provide an attribute to show calibration count There is an non-touch case by non-calibration after update firmware. Elan could know calibrate or not by calibration count. The value of '0xffff' means we didn't calibrate after update firmware. If calibrate success, it will plus one and change to '0x0000'. Signed-off-by: Johnny Chuang Link: https://lore.kernel.org/r/1588754932-5902-1-git-send-email-johnny.chuang.emc@gmail.com Signed-off-by: Dmitry Torokhov commit 26bff9eb49201aeb4e1b32d698c191831a39f5d4 Author: Thomas Bogendoerfer Date: Wed May 6 18:24:02 2020 +0200 MIPS: Only include the platform file needed Instead of including all Platform files, we simply include the needed one and avoid clashes with makefile variables. Signed-off-by: Thomas Bogendoerfer commit c20977721631602eafb263fd89fbafaa11de1ebe Author: Gustavo A. R. Silva Date: Fri May 8 16:08:05 2020 -0500 firmware: qcom_scm-legacy: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Reviewed-by: Jeffrey Hugo Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200508210805.GA24170@embeddedor Signed-off-by: Bjorn Andersson commit 4f05fc33bebdc7d69259c412dd21d09751827dbd Author: Gustavo A. R. Silva Date: Thu May 7 14:19:48 2020 -0500 rpmsg: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507191948.GA16053@embeddedor Signed-off-by: Bjorn Andersson commit 529798bae7c155d38eec211436df736349dca2ee Author: Gustavo A. R. Silva Date: Thu May 7 14:19:43 2020 -0500 remoteproc: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507191943.GA16033@embeddedor Signed-off-by: Bjorn Andersson commit ba8f6682bcb3312645c6cb77499ceaa66cc950a6 Author: Thierry Reding Date: Tue May 12 23:01:38 2020 +0200 media: tegra-video: Do not enable COMPILE_TEST The symbols exported when TEGRA_HOST1X is selected don't have dummies that could serve as stubs for COMPILE_TEST, so a hard dependency on the TEGRA_HOST1X symbol is needed. Suggested-by: Stephen Rothwell Signed-off-by: Thierry Reding commit 29238865dca7d86a44d8e0bf9f7d6c05ff5106f4 Author: Lukas Bulwahn Date: Mon May 11 21:28:44 2020 +0200 MAINTAINERS: correct path in TEGRA VIDEO DRIVER Commit 423d10a99b30 ("media: tegra: Add Tegra210 Video input driver") added the driver to drivers/staging/media/tegra-video/, but commit 2c6b617f2cca ("MAINTAINERS: Add Tegra Video driver section") added a file entry referring to drivers/staging/media/tegra/. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: drivers/staging/media/tegra/ Adjust the file entry in TEGRA VIDEO DRIVER to the correct path. Signed-off-by: Lukas Bulwahn Acked-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 8e3d01808ca2ff7293382eaa2e89a02d8d2ed685 Author: Samuel Zou Date: Mon May 11 19:20:15 2020 +0800 media: tegra-video: Make tegra210_video_formats static Fix the following sparse warning: drivers/staging/media/tegra-video/tegra210.c:589:33: warning: symbol 'tegra210_video_formats' was not declared. The tegra210_video_formats has only call site within tegra210.c It should be static Fixes: 423d10a99b30 ("media: tegra: Add Tegra210 Video input driver") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Acked-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 6a5c2972e7411c4f68e49a278fe3e0cd4eb5e8c5 Author: Sowjanya Komatineni Date: Mon May 4 19:31:58 2020 -0700 MAINTAINERS: Add Tegra Video driver section Add maintainers and mailing list entries to Tegra Video driver section. Acked-by: Thierry Reding Signed-off-by: Sowjanya Komatineni Acked-by: Hans Verkuil Signed-off-by: Thierry Reding commit 3d8a97eabef088393170a9ca46c12ff6021a3be4 Author: Sowjanya Komatineni Date: Mon May 4 19:31:57 2020 -0700 media: tegra-video: Add Tegra210 Video input driver Tegra210 contains a powerful Video Input (VI) hardware controller which can support up to 6 MIPI CSI camera sensors. Each Tegra CSI port can be one-to-one mapped to VI channel and can capture from an external camera sensor connected to CSI or from built-in test pattern generator. Tegra210 supports built-in test pattern generator from CSI to VI. This patch adds a V4L2 capture driver with a media interface for Tegra210 built-in CSI to VI test pattern generator. This patch includes TPG support only and all the video pipeline configuration happens through the video device node. Acked-by: Thierry Reding Signed-off-by: Sowjanya Komatineni Reviewed-by: Dmitry Osipenko Acked-by: Hans Verkuil Signed-off-by: Thierry Reding commit 61b088c5374a9f886efa1edbb49ce552bd1f9cba Author: Swathi Dhanavanthri Date: Tue May 12 11:00:50 2020 -0700 drm/i915/ehl: Restrict w/a 1607087056 for EHL/JSL This w/a is fixed in B0 stepping and needs to be restricted for A0 stepping only. Bspec: 33451 Signed-off-by: Swathi Dhanavanthri Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200512180050.6785-1-swathi.dhanavanthri@intel.com commit 612c341c4e358f6bfc00e222bd418b04fe3c96b7 Merge: 8f3d9f354286 4e79691d050e Author: Thierry Reding Date: Tue May 12 22:58:29 2020 +0200 Merge branch 'for-5.8/dt-bindings' into for-5.8/media commit dec396322d25ca5ce2f307b6da897060fdf9a782 Author: Sowjanya Komatineni Date: Mon May 4 19:31:55 2020 -0700 clk: tegra: Add Tegra210 CSI TPG clock gate Tegra210 CSI hardware internally uses PLLD for internal test pattern generator logic. PLLD_BASE register in CAR has a bit CSI_CLK_SOURCE to enable PLLD out to CSI during TPG mode. This patch adds this CSI TPG clock gate to Tegra210 clock driver to allow Tegra video driver to ungate CSI TPG clock during TPG mode and gate during non TPG mode. Acked-by: Stephen Boyd Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 42329854410e672b7ffeb391d284ad719efcc465 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:22 2020 +0300 clk: tegra30: Use custom CCLK implementation We're going to use the generic cpufreq-dt driver on Tegra30 and thus CCLK intermediate re-parenting will be performed by the clock driver. There is now special CCLK implementation that supports all CCLK quirks, this patch makes Tegra30 SoCs to use that implementation. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 2db2fcd7a2e3036bc4c9937c686abadb9d32524c Author: Dmitry Osipenko Date: Thu Mar 19 22:02:21 2020 +0300 clk: tegra20: Use custom CCLK implementation We're going to use the generic cpufreq-dt driver on Tegra20 and thus CCLK intermediate re-parenting will be performed by the clock driver. There is now special CCLK implementation that supports all CCLK quirks, this patch makes Tegra20 SoCs to use that implementation. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit dec15c9901382f9a2ec548ff0a7ed639d4be0a38 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:20 2020 +0300 clk: tegra: cclk: Add helpers for handling PLLX rate changes CCLK should be re-parented away from PLLX if PLLX's rate is changing. The PLLP parent is a common safe CPU parent for all Tegra SoCs, thus CCLK will be re-parented to PLLP before PLLX rate-change begins and then switched back to PLLX after the rate-change completion. This patch adds helper functions which perform CCLK re-parenting, these helpers will be utilized by further patches. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 9157abe74b05b9c2ede8f07ad4c7f89b717ff303 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:19 2020 +0300 clk: tegra: pll: Add pre/post rate-change hooks There is a need to temporarily re-parent CCLK away from PLLX if PLLX's rate is about to change. The newly introduced PLL pre/post rate-change hooks allow to handle such case. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1641567920fc363be971f9059f3e7afc58a0dda6 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:18 2020 +0300 clk: tegra: Add custom CCLK implementation CCLK stands for "CPU Clock", CPU core is running off CCLK. CCLK supports multiple parents, it has internal clock divider and a clock skipper. PLLX is the main CCLK parent that provides clock rates above 1GHz and it has special property such that the CCLK's internal divider is set into bypass mode when PLLX is selected as a parent for CCLK. This patch forks generic Super Clock into CCLK implementation which takes into account all CCLK specifics. The proper CCLK implementation is needed by the upcoming Tegra20 CPUFreq driver update that will allow to utilize the generic cpufreq-dt driver by moving intermediate clock selection into the clock driver. Note that technically this patch could be squashed into clk-super.c, but it is cleaner to have a separate source file. Also note that currently all CCLKLP bits are left in the clk-super.c and only CCLKG is supported by clk-tegra-super-cclk. It shouldn't be difficult to move the CCLKLP bits, but CCLKLP is not used by anything in kernel and thus better not to touch it for now. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1d3e3c4e129eeab578c61a9d9a3afea23aec14e6 Author: Joseph Lo Date: Wed May 29 16:21:38 2019 +0800 clk: tegra: Remove the old emc_mux clock for Tegra210 Remove the old emc_mux clock and don't use the common EMC clock definition. This will be replaced by a new clock defined in the EMC driver. Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding commit 0ac65fc946d3a15ff30cea28b38a00b9ba98217b Author: Joseph Lo Date: Wed May 29 16:21:35 2019 +0800 clk: tegra: Implement Tegra210 EMC clock The EMC clock needs to carefully coordinate with the EMC controller programming to make sure external memory can be properly clocked. Do so by hooking up the EMC clock with an EMC provider that will specify which rates are supported by the EMC and provide a callback to use for setting the clock rate at the EMC. Based on work by Peter De Schrijver . Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding commit a3cba697a2a09e6769996d5265991a3228004d92 Author: Joseph Lo Date: Wed May 29 16:21:34 2019 +0800 clk: tegra: Export functions for EMC clock scaling Export functions to allow accessing the CAR register required by EMC clock scaling. These functions will be used to access the CAR register as part of the scaling sequence. Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding commit cd4d6f357545bc03112265b19e5ed50592812986 Author: Joseph Lo Date: Wed May 29 16:21:33 2019 +0800 clk: tegra: Add PLLP_UD and PLLMB_UD for Tegra210 Introduce the low jitter path of PLLP and PLLMB which can be used as EMC clock source. Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding commit 3dcbd36fa34ce9124ec51accd835130251f74213 Author: Thierry Reding Date: Fri Feb 28 12:43:51 2020 +0100 clk: tegra: Rename Tegra124 EMC clock source file This code is only used on Tegra124, so rename it accordingly to make it more consistent with other file names. While at it, also get rid of the TEGRA_CLK_EMC Kconfig symbol that's really just an alias for TEGRA124_EMC. Signed-off-by: Thierry Reding commit 7967175ad73b80d814217baec638b36c946fb283 Merge: 8f3d9f354286 796705bcb10c Author: Thierry Reding Date: Tue May 12 22:48:23 2020 +0200 Merge branch 'for-5.8/dt-bindings' into for-5.8/clk commit c73178b93754edd8449dccd3faf05baafd4d3f0e Author: Thierry Reding Date: Fri Jun 7 15:56:23 2019 +0200 i2c: tegra: Add support for the VI I2C on Tegra210 Tegra210 has an extra instance of the I2C controller that is in the domain of host1x and usually used for camera use-cases. The programming model for the VI variant of the controller is roughly the same as for the other variants, except that the I2C registers start at an offset and are spaced further apart. VI I2C also doesn't support slave mode. Signed-off-by: Thierry Reding commit 82dd45f5cb0bbc2a837a91dfdd1de1c585bd13b0 Author: Thierry Reding Date: Thu Apr 2 00:21:28 2020 +0200 i2c: tegra: Use FIELD_PREP/FIELD_GET macros Using these macros helps increase readability of the code. Signed-off-by: Thierry Reding commit 4e79691d050e6d06ee7fa09002c52dd1ce9ac6e6 Author: Thierry Reding Date: Fri Jun 7 15:58:34 2019 +0200 dt-bindings: i2c: tegra: Document Tegra210 VI I2C The Tegra210 features an instance of the Tegra I2C controller that is part of the host1x domain and typically used for camera use-cases. It uses pretty much the same programming model but the registers are laid out differently. Signed-off-by: Thierry Reding commit 0aade33dde361074551ed8f2db02a172c01216e0 Author: Sowjanya Komatineni Date: Mon May 4 19:31:56 2020 -0700 dt-bindings: tegra: Add VI and CSI bindings Tegra contains VI controller which can support up to 6 MIPI CSI camera sensors. Each Tegra CSI port from CSI unit can be one-to-one mapper to VI channel and can capture from an external camera sensor or from built-in test pattern generator. This patch adds dt-bindings for Tegra VI and CSI. Acked-by: Thierry Reding Reviewed-by: Rob Herring Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 796705bcb10c4c2af9c5b86bf7feeb5c6791d1d7 Author: Sowjanya Komatineni Date: Mon May 4 19:31:54 2020 -0700 dt-bindings: clock: tegra: Add clock ID for CSI TPG clock Tegra210 uses PLLD out internally for CSI TPG. This patch adds a clock ID for this CSI TPG clock from PLLD. Acked-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 13857b3829a8acb8d2e1880c3e14e3ae22c229e6 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:25 2020 +0300 dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30 Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoCs. Acked-by: Viresh Kumar Reviewed-by: Rob Herring Acked-by: Peter De Schrijver Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 7a8327f57a1b1c96bd33720702cf5182e7143622 Author: Joseph Lo Date: Wed May 29 16:21:32 2019 +0800 dt-bindings: memory: tegra: Add external memory controller binding for Tegra210 Add the binding document for the external memory controller (EMC) which communicates with external LPDDR4 devices. It includes the bindings of the EMC node and a sub-node of EMC table which under the reserved memory node. The EMC table contains the data of the rates that EMC supported. Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding commit c95854052558fdf0d6eef592effb5b1051c6eec1 Author: Sowjanya Komatineni Date: Mon Jan 13 23:24:26 2020 -0800 dt-bindings: clock: tegra: Remove PMC clock IDs clk_out_1, clk_out_2, clk_out_3, blink are part of Tegra PMC block so these clocks should be provided by the Tegra PMC. IDs for these clocks have been defined in dt-bindings/soc/tegra-pmc.h. This patch removes the IDs for these clocks from the Tegra clock device tree bindings. Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Acked-by: Rob Herring Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 4a470f00e10e3336350ab60ec6c3206177093019 Author: Geert Uytterhoeven Date: Wed May 6 14:32:35 2020 +0200 of: Make self-contained is not self-contained, as it uses _OF_DECLARE() to define RESERVEDMEM_OF_DECLARE(), but does not include . Fix this by adding the missing include. Signed-off-by: Geert Uytterhoeven Reviewed-by: Thierry Reding Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 5fc70e350edd30fb22d2f9b4e6d680c5471890ff Author: Jiada Wang Date: Mon May 11 13:12:13 2020 -0700 Input: introduce input_mt_report_slot_inactive() input_mt_report_slot_state() ignores "tool" argument when the slot is closed, which has caused a bit of confusion. Let's introduce input_mt_report_slot_inactive() to report inactive slot state. Suggested-by: Dmitry Torokhov Signed-off-by: Jiada Wang Link: https://lore.kernel.org/r/20200508055656.96389-2-jiada_wang@mentor.com Signed-off-by: Dmitry Torokhov commit c9c457022b7df2ab515f0424e65445353f91ecad Author: David Heidelberg Date: Mon May 11 14:50:30 2020 -0700 dt-bindings: input: touchscreen: elants_i2c: convert to YAML Convert elants_i2c.txt DT binding to YAML and put into correct directory. Reviewed-by: Dmitry Osipenko Signed-off-by: David Heidelberg Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200423173253.711725-2-david@ixit.cz Signed-off-by: Dmitry Torokhov commit 51fa960d3b5163b1af22efdebcabfccc5d615ad6 Author: William Tu Date: Tue May 12 10:36:23 2020 -0700 erspan: Check IFLA_GRE_ERSPAN_VER is set. Add a check to make sure the IFLA_GRE_ERSPAN_VER is provided by users. Fixes: f989d546a2d5 ("erspan: Add type I version 0 support.") Cc: Eric Dumazet Signed-off-by: William Tu Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 113cb8ffd858fd91ec50c27bf0da1d8ca4c01bb1 Merge: 26831d781496 a20bc43bfb2e Author: David S. Miller Date: Tue May 12 13:08:08 2020 -0700 Merge branch 'Traffic-support-for-dsa_8021q-in-vlan_filtering-1-mode' Vladimir Oltean says: ==================== Traffic support for dsa_8021q in vlan_filtering=1 mode This series is an attempt to support as much as possible in terms of traffic I/O from the network stack with the only dsa_8021q user thus far, sja1105. The hardware doesn't support pushing a second VLAN tag to packets that are already tagged, so our only option is to combine the dsa_8021q with the user tag into a single tag and decode that on the CPU. The assumption is that there is a type of use cases for which 7 VLANs per port are more than sufficient, and that there's another type of use cases where the full 4096 entries are barely enough. Those use cases are very different from one another, so I prefer trying to give both the best experience by creating this best_effort_vlan_filtering knob to select the mode in which they want to operate in. v2 was submitted here: https://patchwork.ozlabs.org/project/netdev/cover/20200511135338.20263-1-olteanv@gmail.com/ v1 was submitted here: https://patchwork.ozlabs.org/project/netdev/cover/20200510164255.19322-1-olteanv@gmail.com/ Changes in v3: Patch 01/15: - Rename again to configure_vlan_while_not_filtering, and add a helper function for skipping VLAN configuration. Patch 03/15: - Remove sja1105_can_use_vlan_as_tags from driver code. Patch 06/15: - Adapt sja1105 driver to the second variable name change. Patch 08/15: - Provide an implementation of sja1105_can_use_vlan_as_tags as part of the tagger and not as part of the switch driver. So we have to look at the skb only, and not at the VLAN awareness state. Changes in v2: Patch 01/15: - Rename variable from vlan_bridge_vtu to configure_vlans_while_disabled. Patch 03/15: - Be much more thorough, and make sure that things like virtual links and FDB operations still work properly. Patch 05/15: - Free the vlan lists on teardown. - Simplify sja1105_classify_vlan: only look at priv->expect_dsa_8021q. - Keep vid 1 in the list of dsa_8021q VLANs, to make sure that untagged packets transmitted from the stack, like PTP, continue to work in VLAN-unaware mode. Patch 06/15: - Adapt to vlan_bridge_vtu variable name change. Patch 11/15: - In sja1105_best_effort_vlan_filtering_set, get the vlan_filtering value of each port instead of just one time for port 0. Normally this shouldn't matter, but it avoids issues when port 0 is disabled in device tree. Patch 14/14: - Only do anything in sja1105_build_subvlans and in sja1105_build_crosschip_subvlans when operating in SJA1105_VLAN_BEST_EFFORT state. This avoids installing VLAN retagging rules in unaware mode, which would cost us a penalty in terms of usable frame memory. ==================== Signed-off-by: David S. Miller commit a20bc43bfb2e8c2fcdaaa4d5c11f2bbf0b690328 Author: Vladimir Oltean Date: Tue May 12 20:20:39 2020 +0300 docs: net: dsa: sja1105: document the best_effort_vlan_filtering option Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 3f01c91aab9276ca48acccd20f6c379cf48a51f9 Author: Vladimir Oltean Date: Tue May 12 20:20:38 2020 +0300 net: dsa: sja1105: implement VLAN retagging for dsa_8021q sub-VLANs Expand the delta commit procedure for VLANs with additional logic for treating bridge_vlans in the newly introduced operating mode, SJA1105_VLAN_BEST_EFFORT. For every bridge VLAN on every user port, a sub-VLAN index is calculated and retagging rules are installed towards a dsa_8021q rx_vid that encodes that sub-VLAN index. This way, the tagger can identify the original VLANs. Extra care is taken for VLANs to still work as intended in cross-chip scenarios. Retagging may have unintended consequences for these because a sub-VLAN encoding that works for the CPU does not make any sense for a front-panel port. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit aaa270c638caa337ce34bb590b0a14ee09f1876d Author: Vladimir Oltean Date: Tue May 12 20:20:37 2020 +0300 net: dsa: sja1105: implement a common frame memory partitioning function There are 2 different features that require some reserved frame memory space: VLAN retagging and virtual links. Create a central function that modifies the static config and ensures frame memory is never overcommitted. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 88cac0fa534d22ee333c415099ba000d3882fbba Author: Vladimir Oltean Date: Tue May 12 20:20:36 2020 +0300 net: dsa: sja1105: add packing ops for the Retagging Table The Retagging Table is an optional feature that allows the switch to match frames against a {ingress port, egress port, vid} rule and change their VLAN ID. The retagged frames are by default clones of the original ones (since the hardware-foreseen use case was to mirror traffic for debugging purposes and to tag it with a special VLAN for this purpose), but we can force the original frames to be dropped by removing the pre-retagging VLAN from the port membership list of the egress port. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce Author: Vladimir Oltean Date: Tue May 12 20:20:35 2020 +0300 net: dsa: sja1105: add a new best_effort_vlan_filtering devlink parameter This devlink parameter enables the handling of DSA tags when enslaved to a bridge with vlan_filtering=1. There are very good reasons to want this, but there are also very good reasons for not enabling it by default. So a devlink param named best_effort_vlan_filtering, currently driver-specific and exported only by sja1105, is used to configure this. In practice, this is perhaps the way that most users are going to use the switch in. It assumes that no more than 7 VLANs are needed per port. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 84eeb5d460e399795e9a92a0cd44999254886150 Author: Vladimir Oltean Date: Tue May 12 20:20:34 2020 +0300 net: dsa: tag_sja1105: implement sub-VLAN decoding Create a subvlan_map as part of each port's tagger private structure. This keeps reverse mappings of bridge-to-dsa_8021q VLAN retagging rules. Note that as of this patch, this piece of code is never engaged, due to the fact that the driver hasn't installed any retagging rule, so we'll always see packets with a subvlan code of 0 (untagged). Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 3eaae1d05f2b5be1be834bfad64f8fc2ad39a56d Author: Vladimir Oltean Date: Tue May 12 20:20:33 2020 +0300 net: dsa: tag_8021q: support up to 8 VLANs per port using sub-VLANs For switches that support VLAN retagging, such as sja1105, we extend dsa_8021q by encoding a "sub-VLAN" into the remaining 3 free bits in the dsa_8021q tag. A sub-VLAN is nothing more than a number in the range 0-7, which serves as an index into a per-port driver lookup table. The sub-VLAN value of zero means that traffic is untagged (this is also backwards-compatible with dsa_8021q without retagging). The switch should be configured to retag VLAN-tagged traffic that gets transmitted towards the CPU port (and towards the CPU only). Example: bridge vlan add dev sw1p0 vid 100 The switch retags frames received on port 0, going to the CPU, and having VID 100, to the VID of 1104 (0x0450). In dsa_8021q language: | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +-----------+-----+-----------------+-----------+-----------------------+ | DIR | SVL | SWITCH_ID | SUBVLAN | PORT | +-----------+-----+-----------------+-----------+-----------------------+ 0x0450 means: - DIR = 0b01: this is an RX VLAN - SUBVLAN = 0b001: this is subvlan #1 - SWITCH_ID = 0b001: this is switch 1 (see the name "sw1p0") - PORT = 0b0000: this is port 0 (see the name "sw1p0") The driver also remembers the "1 -> 100" mapping. In the hotpath, if the sub-VLAN from the tag encodes a non-untagged frame, this mapping is used to create a VLAN hwaccel tag, with the value of 100. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 38b5beeae7a4cde87edabb0196fac1f55ae668ee Author: Vladimir Oltean Date: Tue May 12 20:20:32 2020 +0300 net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously In VLAN-unaware mode, sja1105 uses VLAN tags with a custom TPID of 0xdadb. While in the yet-to-be introduced best_effort_vlan_filtering mode, it needs to work with normal VLAN TPID values. A complication arises when we must transmit a VLAN-tagged packet to the switch when it's in VLAN-aware mode. We need to construct a packet with 2 VLAN tags, and the switch will use the outer header for routing and pop it on egress. But sadly, here the 2 hardware generations don't behave the same: - E/T switches won't pop an ETH_P_8021AD tag on egress, it seems (packets will remain double-tagged). - P/Q/R/S switches will drop a packet with 2 ETH_P_8021Q tags (it looks like it tries to prevent VLAN hopping). But looks like the reverse is also true: - E/T switches have no problem popping the outer tag from packets with 2 ETH_P_8021Q tags. - P/Q/R/S will have no problem popping a single tag even if that is ETH_P_8021AD. So it is clear that if we want the hardware to work with dsa_8021q tagging in VLAN-aware mode, we need to send different TPIDs depending on revision. Keep that information in priv->info->qinq_tpid. The per-port tagger structure will hold an xmit_tpid value that depends not only upon the qinq_tpid, but also upon the VLAN awareness state itself (in case we must transmit using 0xdadb). Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit cfa36b1fff422660fe7fc3a10c17a618d0371796 Author: Vladimir Oltean Date: Tue May 12 20:20:31 2020 +0300 net: dsa: sja1105: exit sja1105_vlan_filtering when called multiple times VLAN filtering is a global property for sja1105, and that means that we rely on the DSA core to not call us more than once. But we need to introduce some per-port state for the tagger, namely the xmit_tpid, and the best place to do that is where the xmit_tpid changes, namely in sja1105_vlan_filtering. So at the moment, exit early from the function to avoid unnecessarily resetting the switch for each port call. Then we'll change the xmit_tpid prior to the early exit in the next patch. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit fa83e5d9183fd9bc5f94f937b069c5e15162e974 Author: Vladimir Oltean Date: Tue May 12 20:20:30 2020 +0300 net: dsa: sja1105: allow VLAN configuration from the bridge in all states Let the DSA core call our .port_vlan_add methods every time the bridge layer requests so. We will deal internally with saving/restoring VLANs depending on our VLAN awareness state. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ec5ae61076d07be986df19773662506220757c9f Author: Vladimir Oltean Date: Tue May 12 20:20:29 2020 +0300 net: dsa: sja1105: save/restore VLANs using a delta commit method Managing the VLAN table that is present in hardware will become very difficult once we add a third operating state (best_effort_vlan_filtering). That is because correct cleanup (not too little, not too much) becomes virtually impossible, when VLANs can be added from the bridge layer, from dsa_8021q for basic tagging, for cross-chip bridging, as well as retagging rules for sub-VLANs and cross-chip sub-VLANs. So we need to rethink VLAN interaction with the switch in a more scalable way. In preparation for that, use the priv->expect_dsa_8021q boolean to classify any VLAN request received through .port_vlan_add or .port_vlan_del towards either one of 2 internal lists: bridge VLANs and dsa_8021q VLANs. Then, implement a central sja1105_build_vlan_table method that creates a VLAN configuration from scratch based on the 2 lists of VLANs kept by the driver, and based on the VLAN awareness state. Currently, if we are VLAN-unaware, install the dsa_8021q VLANs, otherwise the bridge VLANs. Then, implement a delta commit procedure that identifies which VLANs from this new configuration are actually different from the config previously committed to hardware. We apply the delta through the dynamic configuration interface (we don't reset the switch). The result is that the hardware should see the exact sequence of operations as before this patch. This also helps remove the "br" argument passed to dsa_8021q_crosschip_bridge_join, which it was only using to figure out whether it should commit the configuration back to us or not, based on the VLAN awareness state of the bridge. We can simplify that, by always allowing those VLANs inside of our dsa_8021q_vlans list, and committing those to hardware when necessary. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 60b33aeb7e0e664865ace822c0a7aeeb5ebe521c Author: Vladimir Oltean Date: Tue May 12 20:20:28 2020 +0300 net: dsa: sja1105: deny alterations of dsa_8021q VLANs from the bridge At the moment, this can never happen. The 2 modes that we operate in do not permit that: - SJA1105_VLAN_UNAWARE: we are guarded from bridge VLANs added by the user by the DSA core. We will later lift this restriction by setting ds->vlan_bridge_vtu = true, and that is where we'll need it. - SJA1105_VLAN_FILTERING_FULL: in this mode, dsa_8021q configuration is disabled. So the user is free to add these VLANs in the 1024-3071 range. The reason for the patch is that we'll introduce a third VLAN awareness state, where both dsa_8021q as well as the bridge are going to call our .port_vlan_add and .port_vlan_del methods. For that, we need a good way to discriminate between the 2. The easiest (and less intrusive way for upper layers) is to recognize the fact that dsa_8021q configurations are always driven by our driver - we _know_ when a .port_vlan_add method will be called from dsa_8021q because _we_ initiated it. So introduce an expect_dsa_8021q boolean which is only used, at the moment, for blacklisting VLANs in range 1024-3071 in the modes when dsa_8021q is active. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 7f14937facdca1e0da1bacfacd089bcf4271e75a Author: Vladimir Oltean Date: Tue May 12 20:20:27 2020 +0300 net: dsa: sja1105: keep the VLAN awareness state in a driver variable Soon we'll add a third operating mode to the driver. Introduce a vlan_state to make things more easy to manage, and use it where applicable. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 1f66b0f0aec671f8fbc86d75b2efdf7c7e0f7880 Author: Vladimir Oltean Date: Tue May 12 20:20:26 2020 +0300 net: dsa: tag_8021q: introduce a vid_is_dsa_8021q helper This function returns a boolean denoting whether the VLAN passed as argument is part of the 1024-3071 range that the dsa_8021q tagging scheme uses. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 54a0ed0df49609f4e3f098f8943e38e389dc2e15 Author: Russell King Date: Tue May 12 20:20:25 2020 +0300 net: dsa: provide an option for drivers to always receive bridge VLANs DSA assumes that a bridge which has vlan filtering disabled is not vlan aware, and ignores all vlan configuration. However, the kernel software bridge code allows configuration in this state. This causes the kernel's idea of the bridge vlan state and the hardware state to disagree, so "bridge vlan show" indicates a correct configuration but the hardware lacks all configuration. Even worse, enabling vlan filtering on a DSA bridge immediately blocks all traffic which, given the output of "bridge vlan show", is very confusing. Provide an option that drivers can set to indicate they want to receive vlan configuration even when vlan filtering is disabled. At the very least, this is safe for Marvell DSA bridges, which do not look up ingress traffic in the VTU if the port is in 8021Q disabled state. It is also safe for the Ocelot switch family. Whether this change is suitable for all DSA bridges is not known. Signed-off-by: Russell King Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 26831d781496bcc2b749d07738595f1979662ffd Merge: 966a5c08af1b 1b0cde409187 Author: David S. Miller Date: Tue May 12 12:47:40 2020 -0700 Merge branch 'sfc-siena_check_caps-fixups' Edward Cree says: ==================== sfc: siena_check_caps fixups Fix a bug and a build warning introduced in a recent refactor. ==================== Signed-off-by: David S. Miller commit 1b0cde4091877cd7fe4b29f67645cc391b86c9ca Author: Edward Cree Date: Tue May 12 14:24:58 2020 +0100 sfc: siena_check_caps() can be static Reported-by: Jakub Kicinski Reported-by: kbuild test robot Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 527c1e615b4c6616abb5c7b14c2ff5b04a029175 Author: Edward Cree Date: Tue May 12 14:24:34 2020 +0100 sfc: actually wire up siena_check_caps() Assign it to siena_a0_nic_type.check_caps function pointer. Fixes: be904b855200 ("sfc: make capability checking a nic_type function") Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 966a5c08af1b1399fe1014f24877578e8493ffe1 Author: Kunihiko Hayashi Date: Tue May 12 16:26:50 2020 +0900 dt-bindings: net: Convert UniPhier AVE4 controller to json-schema Convert the UniPhier AVE4 controller binding to DT schema format. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit 9fc18435d21411efbc7c028bec1ef21080f8bea6 Author: Douglas Anderson Date: Fri Apr 24 08:51:29 2020 -0700 arm64: dts: qcom: sc7180: Add "no-map" to cmd_db reserved area The example in the bindings and all the current users (except sc7180) have "no-map". I'm pretty sure we need it on sc7180 too. Add it. Reviewed-by: Stephen Boyd Fixes: e0abc5eb526e ("arm64: dts: qcom: sc7180: Add cmd_db reserved area") Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200424085121.1.I9d1e84d30f488cdb5a957f582abaecd2c0b24d70@changeid Signed-off-by: Bjorn Andersson commit 8a226e2c71bb3763e27a063d36eac5fa4ea53c3f Author: Sivaprakash Murugesan Date: Fri May 1 21:58:12 2020 +0530 remoteproc: wcss: add support for rpmsg communication add glink and ssr subdevices for wcss rproc to enable rpmsg communication. Signed-off-by: Sivaprakash Murugesan Link: https://lore.kernel.org/r/1588350492-4663-1-git-send-email-sivaprak@codeaurora.org Signed-off-by: Bjorn Andersson commit 92a84c7806010acd730000fe6d9eb0705ac5c22c Merge: 6b9ea5ff5abd 7c7b58ecd604 Author: David S. Miller Date: Tue May 12 12:19:30 2020 -0700 Merge branch 'ionic-updates' Shannon Nelson says: ==================== ionic updates This set of patches is a bunch of code cleanup, a little documentation, longer tx sg lists, more ethtool stats, and a couple more transceiver types. ==================== Signed-off-by: David S. Miller commit 7c7b58ecd604ce599311f6f6abbf43804f263384 Author: Shannon Nelson Date: Mon May 11 17:59:36 2020 -0700 ionic: update doc files Update the basic doc file with some configuration hints and a little bit of stats information. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit f64e0c5698b7b1abb08b3d5bc07f95db45e87d76 Author: Shannon Nelson Date: Mon May 11 17:59:35 2020 -0700 ionic: add more ethtool stats Add hardware port stats and a few more driver collected statistics to the ethtool stats output. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit c06107cabea356db62f45bf8049a260c238fadf2 Author: Shannon Nelson Date: Mon May 11 17:59:34 2020 -0700 ionic: more ionic name tweaks Fix up a few more local names that need an "ionic" prefix. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 36ac2c50924892a28e17ff463e354fec7650ee19 Author: Shannon Nelson Date: Mon May 11 17:59:33 2020 -0700 ionic: ionic_intr_free parameter change Change the ionic_intr_free parameter from struct ionic_lif to struct ionic since that's what it actually cares about. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 5c7843112543c7726e7fe31ecc76476f296b7960 Author: Shannon Nelson Date: Mon May 11 17:59:32 2020 -0700 ionic: reset device at probe Once we're talking to the device, tell it to reset to be sure we've got a fresh, clean environment. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 62ba8766f775e5e26c21731c695f68541d504ea6 Author: Shannon Nelson Date: Mon May 11 17:59:31 2020 -0700 ionic: shorter dev cmd wait time Shorten our msleep time while polling for the dev command request to finish. Yes, checkpatch.pl complains that the msleep might actually go longer - that won't hurt, but we'll take the shorter time if we can get it. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit cba155d591aa28689332bc568632d2f868690be1 Author: Shannon Nelson Date: Mon May 11 17:59:30 2020 -0700 ionic: add support for more xcvr types Add a couple more SFP and QSFP transceiver types to our ethtool get link ksettings. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit a836c352291d4ad4031743a97a61f7916fe519b7 Author: Shannon Nelson Date: Mon May 11 17:59:29 2020 -0700 ionic: protect vf calls from fw reset When going into a firmware upgrade cycle, we set the device as not present to keep some user commands from trying to change the driver while we're only half there. Unfortunately, the ndo_vf_* calls don't check netif_device_present() so we need to add a check in the callbacks. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit c4e7a75a096c02035a102686e2569e7b0341a122 Author: Shannon Nelson Date: Mon May 11 17:59:28 2020 -0700 ionic: updates to ionic FW api description Lots of comment cleanup for better documentation, a few new fields added, and a few minor mistakes fixed up. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 5b3f3f2a71ed1cecf6fcf9e8c858a89589415449 Author: Shannon Nelson Date: Mon May 11 17:59:27 2020 -0700 ionic: support longer tx sg lists The version 1 Tx queues can use longer SG lists than the original version 0 queues, but we need to check to see if the firmware supports the v1 Tx queues. This implements the queue type query for all queue types, and uses the information to set up for using the longer Tx SG lists. Because the Tx SG list can be longer, we need to limit the max ring length to be sure we stay inside the boundaries of a DMA allocation max size, so we lower the max Tx ring size. The driver sets its highest known version in the Q_IDENTITY command, and the FW returns the highest version that it knows, bounded by the driver's version. The negotiated version number is later used in the Q_INIT commands. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 0fdc50dfab47d525b71a9f0d8310746cdc0c09c5 Merge: 3eb66d9f97f3 7111951b8d49 Author: Dmitry Torokhov Date: Tue May 12 12:18:21 2020 -0700 Merge tag 'v5.6' into next Sync up with mainline to get device tree and other changes. commit a781e5aa59110d002a56bd41a397c0c8892f0609 Author: Rishabh Bhatnagar Date: Wed Apr 29 11:04:42 2020 -0700 remoteproc: core: Prevent system suspend during remoteproc recovery The system might go into suspend during recovery of any remoteproc. This will interrupt the recovery process in between increasing the recovery time. Make the platform device as wakeup capable and use pm_stay_wake/pm_relax APIs to avoid system from going into suspend during recovery. Signed-off-by: Siddharth Gupta Signed-off-by: Rishabh Bhatnagar Acked-by: Mathieu Poirier Link: https://lore.kernel.org/r/1588183482-21146-1-git-send-email-rishabhb@codeaurora.org Signed-off-by: Bjorn Andersson commit 9666174a4e1a7b1e32c214312678f8452275da6a Author: Sibi Sankar Date: Wed Apr 15 12:46:19 2020 +0530 remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Remove unsed q6v5_da_to_va function as the mss driver uses a per segment dump function. Tested-by: Evan Green Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200415071619.6052-2-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit be050a3429f46ecf13eb2b80f299479f8bb823fb Author: Sibi Sankar Date: Wed Apr 15 12:46:18 2020 +0530 remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use The application processor accessing the mpss region when the Q6 modem is running will lead to an XPU violation. Fix this by un-mapping the mpss segments post copy during mpss authentication and coredumps. Tested-by: Evan Green Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200415071619.6052-1-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit fe204591cc9480347af7d2d6029b24a62e449486 Author: Arnd Bergmann Date: Thu May 7 23:34:28 2020 +0200 dlm: remove BUG() before panic() Building a kernel with clang sometimes fails with an objtool error in dlm: fs/dlm/lock.o: warning: objtool: revert_lock_pc()+0xbd: can't find jump dest instruction at .text+0xd7fc The problem is that BUG() never returns and the compiler knows that anything after it is unreachable, however the panic still emits some code that does not get fully eliminated. Having both BUG() and panic() is really pointless as the BUG() kills the current process and the subsequent panic() never hits. In most cases, we probably don't really want either and should replace the DLM_ASSERT() statements with WARN_ON(), as has been done for some of them. Remove the BUG() here so the user at least sees the panic message and we can reliably build randconfig kernels. Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM") Cc: Josh Poimboeuf Cc: clang-built-linux@googlegroups.com Signed-off-by: Arnd Bergmann Signed-off-by: David Teigland commit f084a4f4a14b97d2ad6e4bd6406933b2d39e6eca Author: Ross Lagerwall Date: Wed Apr 29 13:15:41 2020 +0100 dlm: Switch to using wait_event() We saw an issue in a production server on a customer deployment where DLM 4.0.7 gets "stuck" and unable to join new lockspaces. There is no useful response for the dlm in do_event() if wait_event_interruptible() is interrupted, so switch to wait_event(). Signed-off-by: Ross Lagerwall Signed-off-by: David Teigland commit 90db4f8be38629bd09183b78079d582221523e25 Author: Wu Bo Date: Wed Apr 22 14:59:27 2020 +0800 fs:dlm:remove unneeded semicolon in rcom.c Fix the following coccicheck warning: fs/dlm/rcom.c:566:2-3: Unneeded semicolon Signed-off-by: Wu Bo Signed-off-by: David Teigland commit 3c80d3794dac5b0f50132846113a120d881462ec Author: Gustavo A. R. Silva Date: Mon Mar 9 10:57:22 2020 -0500 dlm: user: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David Teigland commit a4e439a6f628a52f7074c9d73ec7eb4f6c1a4dfc Author: Gustavo A. R. Silva Date: Mon Mar 9 10:56:08 2020 -0500 dlm: dlm_internal: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David Teigland commit a9fdc79d488623d36341f0f3d08f5aa1bedb9d53 Author: Sibi Sankar Date: Wed Apr 15 20:21:10 2020 +0530 remoteproc: qcom_q6v5_mss: Drop accesses to MPSS PERPH register space 7C retail devices using MSA based boot will result in a fuse combination which will prevent accesses to MSS PERPH register space where the mpss clocks and halt-nav reside. So drop all accesses to the MPSS PERPH register space. Issuing HALT NAV request and turning on the mss clocks as part of SSR will no longer be required since the modem firmware will have the necessary fixes to ensure that there are no pending NAV DMA transactions. Tested-by: Evan Green Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200415145110.20624-3-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit e62e3acd61d36b07878cd33a868a5797fe1e25b5 Author: Sibi Sankar Date: Wed Apr 15 20:21:09 2020 +0530 dt-bindings: remoteproc: qcom: Replace halt-nav with spare-regs 7C retail devices using MSA based boot will result in a fuse combination which will prevent accesses to MSS PERPH register space where the mpss clocks and halt-nav reside. However accesses to conn_box_spare0 in TCSR register space is still permitted so rename the binding appropriately to qcom,spare-regs and drop all accesses to the MPSS PERPH register space. Tested-by: Evan Green Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200415145110.20624-2-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 8ab22804efefea9ecf3c68aa00f1fa69c70fcfad Author: Fenghua Yu Date: Tue May 12 07:54:36 2020 -0700 x86/fpu/xstate: Define new macros for supervisor and user xstates XCNTXT_MASK is 'all supported xfeatures' before introducing supervisor xstates. Rename it to XFEATURE_MASK_USER_SUPPORTED to make clear that these are user xstates. Replace XFEATURE_MASK_SUPERVISOR with the following: - XFEATURE_MASK_SUPERVISOR_SUPPORTED: Currently nothing. ENQCMD and Control-flow Enforcement Technology (CET) will be introduced in separate series. - XFEATURE_MASK_SUPERVISOR_UNSUPPORTED: Currently only Processor Trace. - XFEATURE_MASK_SUPERVISOR_ALL: the combination of above. Co-developed-by: Yu-cheng Yu Signed-off-by: Fenghua Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/20200512145444.15483-3-yu-cheng.yu@intel.com commit a4c2951274e4bd2237a3af8143db16d826134a0a Author: Stephan Gerhold Date: Sun Apr 26 16:06:42 2020 +0200 arm64: dts: qcom: msm8916-samsung-a5u: Add touchscreen A5U uses a Melfas MMS345L touchscreen that is connected to blsp_i2c5. Add it to the device tree. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200426140642.204395-5-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 16fb3e4226d629541ac2ff6ddc9bf5e6ad7ef843 Author: Stephan Gerhold Date: Sun Apr 26 16:06:41 2020 +0200 arm64: dts: qcom: msm8916-samsung-a2015: Add touchscreen regulator A3U and A5U both use an extra touchscreen LDO regulator that provides 3.3V for the touch screen controller. Add it as fixed regulator to the common include. Cc: Michael Srba Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200426140642.204395-4-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 246d19d2c22e06b9ed31e44cf2dcd82000b207e8 Author: Stephan Gerhold Date: Sun Apr 26 16:06:40 2020 +0200 arm64: dts: qcom: msm8916: Add blsp_i2c5 MSM8916 has another I2C QUP controller that can be enabled on GPIO 18 and 19. Add blsp_i2c5 to msm8916.dtsi and disable it by default. Reviewed-by: Bjorn Andersson Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200426140642.204395-3-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 428384b535d65a8b3c5164c7600d7db5223c4707 Author: Stephan Gerhold Date: Sun Apr 26 16:06:39 2020 +0200 arm64: dts: qcom: msm8916: Add blsp_i2c1 MSM8916 has another I2C QUP controller that can be enabled on GPIO 2 and 3. Add blsp_i2c1 to msm8916.dtsi and disable it by default. Reviewed-by: Bjorn Andersson Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200426140642.204395-2-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit 5274e6c172c47241534e970df26a522497086624 Author: Fenghua Yu Date: Tue May 12 07:54:35 2020 -0700 x86/fpu/xstate: Rename validate_xstate_header() to validate_user_xstate_header() The function validate_xstate_header() validates an xstate header coming from userspace (PTRACE or sigreturn). To make it clear, rename it to validate_user_xstate_header(). Suggested-by: Dave Hansen Signed-off-by: Fenghua Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Reviewed-by: Tony Luck Reviewed-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200512145444.15483-2-yu-cheng.yu@intel.com commit 0f1decaa83b7fc7a2a1effb6d53eac39a037f06b Author: Sai Prakash Ranjan Date: Fri Apr 24 16:46:44 2020 +0530 arm64: dts: qcom: sc7180: Support ETMv4 power management Now that deep idle states are properly supported on SC7180, we need to add "coresight-loses-context-with-cpu" property to avoid failure of trace session because of losing context on entering deep idle states. Reviewed-by: Stephen Boyd Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20200424111644.27970-1-saiprakash.ranjan@codeaurora.org Signed-off-by: Bjorn Andersson commit 57b9df6fa5f56b98baa73f62ed92db81db3de391 Author: Ryder Lee Date: Tue May 12 00:06:38 2020 +0800 mt76: mt7915: fix possible deadlock in mt7915_stop make mac_work per phy instead of per device and fix a possible deadlock in mt7915_stop since mt7915_mac_work runs holding mt76 mutex Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 3e68af622254bad75f5989c39663fd12a8efeddd Author: Ryder Lee Date: Tue May 12 00:06:37 2020 +0800 mt76: mt7915: allocate proper size for tlv tags Allocating proper memory size according to tlv usage. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit babdad50f781c21c2e5511bf406dbb9728da05cb Author: Ryder Lee Date: Tue May 12 00:06:36 2020 +0800 mt76: mt7915: add debugfs to track TxBF status Add debug counters to track status of beamformer and beamformee. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 00b2e16e006390069480e90478aa8b6e924996d7 Author: Ryder Lee Date: Tue May 12 00:06:35 2020 +0800 mt76: mt7915: add TxBF capabilities This allows to set HE TxBF runtime stream capabilities Signed-off-by: Ryder Lee Tested-by: Evelyn Tsai commit 2af34fa3b5a76ca3ed553550f93dbc793a2965cb Author: Ryder Lee Date: Tue May 12 00:06:34 2020 +0800 mt76: mt7915: add Tx beamformee support Enable beamformee support. Signed-off-by: Ryder Lee Tested-by: Evelyn Tsai Signed-off-by: Felix Fietkau commit 89029a85482cbcf68026a89fc974e8f6898d6b37 Author: Ryder Lee Date: Tue May 12 00:06:33 2020 +0800 mt76: mt7915: add Tx beamformer support Enable TxBF modules and trigger sounding process to support Tx beamformer. Signed-off-by: Ryder Lee Tested-by: Evelyn Tsai commit b0efe6dd21e6a7c7fc591d95cceb203a365ffc30 Author: Ryder Lee Date: Tue May 12 00:06:32 2020 +0800 mt76: mt7915: introduce mt7915_get_he_phy_cap Add a helper to reduce duplicate codes. This is a preliminary patch to add Tx beamforming support. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit da9e36ca163166fc6e53a69866b85a4ed2a273f9 Author: Lorenzo Bianconi Date: Sat May 9 23:40:05 2020 +0200 mt76: mt7615: usb: cancel ps work stopping the vif Cancel possible power_save work before stopping the mt7663u interface Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 6e7b2ebac329d5cafc5868386e01627efcd95b32 Author: Lorenzo Bianconi Date: Sat May 9 23:38:35 2020 +0200 mt76: mt7663u: add missing register definitions Add missing PLE/PSE base register definitions for mt7663u Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 3fb31939b782cda8a9cd187bde60b867a5e13bf4 Author: Lorenzo Bianconi Date: Fri May 8 18:26:29 2020 +0200 mt76: mt7663u: copy key pointer in mt7663u_mac_write_txwi Copy key pointer value before running mt76_tx_status_skb_add() in mt7663u_mac_write_txwi since it will be overwritten setting mt76_tx_cb for probing frames Co-developed-by: Johannes Berg Signed-off-by: Johannes Berg Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit bb3e3fec509e2b6103b8782b652f447a42212ae8 Author: Ryder Lee Date: Sat Apr 25 03:32:39 2020 +0800 mt76: set runtime stream caps by mt76_phy This patch can support concurrent dual-band operation. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 5517f78b0063d0463d042c68ac0c651db47ecf90 Author: Ryder Lee Date: Sat Apr 25 03:32:38 2020 +0800 mt76: mt7915: enable firmware module debug support This allows host driver to get useful information of some important modules. Signed-off-by: Ryder Lee Signed-off-by: Chih-Min Chen Signed-off-by: Felix Fietkau commit 32add88f641bc0b3b63661771aea8dcee1d84396 Author: Ryder Lee Date: Sat Apr 25 03:32:37 2020 +0800 mt76: mt7915: add tsf related callbacks It is useful for IBSS Mesh to adjust t_clockdrift. Signed-off-by: Ryder Lee Reported-by: Shayne Chen Tested-by: Evelyn Tsai Signed-off-by: Felix Fietkau commit 9fac3c81eebd81bbce8b050e15b03d3490841717 Author: Ryder Lee Date: Sat Apr 25 03:32:36 2020 +0800 mt76: mt7915: set peer Tx fixed rate through debugfs Driver can manually set fixed rate for each peer through debugfs. May use .set_bitrate_mask callback and iterate stations under the current vif to achieve the aim once it supports HE rate. Signed-off-by: Ryder Lee Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit b02eafae42099943928bf7c253640d3bb0a3a949 Author: Ryder Lee Date: Sat Apr 25 03:32:35 2020 +0800 mt76: mt7915: add .sta_statistics support Add useful debug counters since this generation uses struct rate_info to report HE tx rate. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit ec9742a8f38ef69876e9f04be68d985c6bbb8f5f Author: Ryder Lee Date: Sat Apr 25 03:32:34 2020 +0800 mt76: mt7915: add .sta_add_debugfs support This generation supports much more per-peer statistics than legacy ones, so add .sta_add_debugfs accordingly. This is convenient to set/get more settings/counters in the long run. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit a82dd24d128d6399bfcb7f692732caf33827e1df Author: Ryder Lee Date: Sat Apr 25 03:32:33 2020 +0800 mt76: mt7915: add Rx radiotap header support mac80211 expects the definition of what HE rate info is available inside astruct prepended to the skb. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit c336318f57a92d3971719598ef4416b531811d72 Author: Ryder Lee Date: Sat Apr 25 03:32:32 2020 +0800 mt76: mt7915: add HE capabilities support for peers Set peer's bsic HE capabilities through starec. Signed-off-by: Ryder Lee Suggested-by: Shihwei Lin Tested-by: Shayne Chen Tested-by: Chih-Min Chen Tested-by: Evelyn Tsai Acked-by: Yiwei Chung Acked-by: YF Luo Signed-off-by: Felix Fietkau commit 6094f86fb3713e1b7d0c7f264c3a76263745efae Author: Ryder Lee Date: Sat Apr 25 03:32:31 2020 +0800 mt76: mt7915: add HE bss_conf support for interfaces Add basic HE BSS's info for interfaces. As for the advanced features will be added gradually in the future patches. (i.e. BSS color, TWT, spatial reuse and OFDMA) Signed-off-by: Ryder Lee Tested-by: Shayne Chen Tested-by: Chih-Min Chen Tested-by: Evelyn Tsai Acked-by: Yiwei Chung Acked-by: YF Luo Signed-off-by: Felix Fietkau commit 37f4ca907c462d7c8a1ac9e7e3473681b5f893dd Author: Ryder Lee Date: Sat Apr 25 03:32:30 2020 +0800 mt76: mt7915: register per-phy HE capabilities for each interface The capabilities for the HE interfaces are generated from the capabilities reported by the firmware. This should move to common file once we got other HE devices support. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit f1d962369d5687b08d3270dad421e9346caee0ca Author: Ryder Lee Date: Sat Apr 25 03:32:29 2020 +0800 mt76: mt7915: implement HE per-rate tx power support Use firmware support for applying per-rate limit and power offsets. This can support all HE RU types. Signed-off-by: Shayne Chen Signed-off-by: Ryder Lee Tested-by: Chih-Min Chen Tested-by: Evelyn Tsai Acked-by: Yiwei Chung Acked-by: YF Luo Signed-off-by: Felix Fietkau commit 5205071a519c5dd7b479343e17a109fb3cb19629 Author: Ryder Lee Date: Sat Apr 25 03:32:28 2020 +0800 mt76: mt7915: enable Rx HE rate reporting Enable HE rate reporting in Rx path Signed-off-by: Ryder Lee Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit e57b7901469fc0b021930b83a8094baaf3d81b09 Author: Ryder Lee Date: Sat Apr 25 03:32:27 2020 +0800 mt76: add mac80211 driver for MT7915 PCIe-based chipsets Add support for the MediaTek latest generation IEEE 802.11ax 4x4 device MT7915E, which supports concurrent dual-band operation at both 5GHz and 2.4GHz. Note that this patch just add basic part and will add more HE capabilities support in the further patches. The driver supports AP, Station, Mesh and monitor mode. Signed-off-by: Ryder Lee Signed-off-by: Shayne Chen Signed-off-by: Chih-Min Chen Suggested-by: Shihwei Lin Tested-by: Evelyn Tsai Acked-by: Yiwei Chung Acked-by: YF Luo Signed-off-by: Felix Fietkau commit d3377b78cec6eb32241a2ac3dc0c43a0bf71129a Author: Ryder Lee Date: Sat Apr 25 03:32:26 2020 +0800 mt76: add HE phy modes and hardware queue This is a preliminary patch to support 11ax deivces. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 49e649c3e0a6ec8a12976e331a2c1f29dc7dd3a9 Author: Ryder Lee Date: Sat Apr 25 03:32:25 2020 +0800 mt76: adjust wcid size to support new 802.11ax generation The newer 802.11ax devices (i.e. MT7915E) can connect to much more peers than previous generations. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 77ae1d5e13eb51651899fbfb6d7a34bc5ee7d4af Author: Ryder Lee Date: Sat Apr 25 03:32:24 2020 +0800 mt76: add Rx stats support for radiotap HE deivces need to add Rx radiotap header. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit af4a2f2fdd6fe4f6ffc61eec84da999dbff37d3c Author: Ryder Lee Date: Sat Apr 25 03:32:23 2020 +0800 mt76: add support for HE RX rate reporting Add support for encoding and reporting HE RX rates. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 7c4f744d6703757be959f521a7a441bf34745d99 Author: Ryder Lee Date: Sat Apr 25 03:32:22 2020 +0800 mt76: avoid rx reorder buffer overflow Enlarge slot to support 11ax 256 BA (256 MPDUs in an AMPDU) Signed-off-by: Chih-Min Chen Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 1245fe6a83a1c550d86d15501d86f9b2de5f97ff Author: Lorenzo Bianconi Date: Wed May 6 11:58:32 2020 +0200 mt76: mt7615: scan all channels if not specified Configure the mcu to scan all available channels if mac80211 does not provide any frequency list Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5fdba8a77be6e7814698d5ac068cc31775b9930d Author: Sean Wang Date: Wed May 6 11:55:42 2020 +0200 mt76: mt7663: add support to sched scan with randomise addr Add support to sched scan with randomise addr Co-developed-by: Wan-Feng Jiang Signed-off-by: Wan-Feng Jiang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit a72ad451e7049c18211f91bf12c7784a32ecbe1b Author: Sean Wang Date: Wed May 6 11:53:35 2020 +0200 mt76: mt7663: introduce WoW with net detect support Introduce WoW with net detect support Co-developed-by: Wan-Feng Jiang Signed-off-by: Wan-Feng Jiang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit c88bf52b15872d960d5a0c30f0bac6351fb295df Author: Lorenzo Bianconi Date: Sun May 3 17:30:53 2020 +0200 mt76: mt7615: fix delta tx power for mt7663 Fix mt7663 eeprom definitions for delta tx power parsing Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit e0ec633d76dcef31d8a15a3296815e7e8ad6aa73 Author: Lorenzo Bianconi Date: Sun May 3 17:23:54 2020 +0200 mt76: mt7663: fix target power parsing Fix target parsing from eeprom/efuse partition for 7663 chipsets Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 9582d5bdef0cbebbfa451b4894518f0d790f05c8 Author: Lorenzo Bianconi Date: Sat May 2 18:00:41 2020 +0200 mt76: mt7615: fix ibss mode for mt7663 Fix the following kernel warning adding an adhoc interface to a mt7663e device [ 233.363394] WARNING: CPU: 0 PID: 2345 at drivers/net/wireless/mt76/mt7615/mcu.c:1449 mt7615_mcu_uni_add_bss+0x15f/0x24e [mt7615_common] [ 233.363432] CPU: 0 PID: 2345 Comm: iw Tainted: G W 4.14.171 #12 [ 233.363434] Hardware name: HP Meep/Meep, BIOS Google_Meep.11297.75.0 06/17/2019 [ 233.363436] task: ffff9a1a4020e3c0 task.stack: ffffb9124113c000 [ 233.363441] RIP: 0010:mt7615_mcu_uni_add_bss+0x15f/0x24e [mt7615_common] [ 233.363443] RSP: 0018:ffffb9124113f730 EFLAGS: 00010246 [ 233.363446] RAX: 0000000000000024 RBX: ffff9a1a788c74e8 RCX: 41826d413aea9200 [ 233.363448] RDX: 0000000000000007 RSI: 0000000000000006 RDI: ffff9a1a7fc15418 [ 233.363450] RBP: ffffb9124113f7c0 R08: 0000000000000356 R09: 00000000ffff0a10 [ 233.363452] R10: 0000001000000000 R11: ffffffff93f2a4be R12: 0000000000000000 [ 233.363454] R13: ffff9a1a7383bd48 R14: ffffb9124113f77a R15: 0000000000000000 [ 233.363456] FS: 00007f203314ab80(0000) GS:ffff9a1a7fc00000(0000) knlGS:0000000000000000 [ 233.363458] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 233.363460] CR2: 00005a13d647c950 CR3: 0000000171238000 CR4: 00000000003406f0 [ 233.363462] Call Trace: [ 233.363470] mt7615_bss_info_changed+0x98/0xf4 [mt7615_common] [ 233.363484] ieee80211_bss_info_change_notify+0x139/0x1d4 [mt76_mac80211] [ 233.363496] ieee80211_ibss_disconnect+0x183/0x1bb [mt76_mac80211] [ 233.363507] ieee80211_ibss_leave+0x14/0xa0 [mt76_mac80211] [ 233.363519] __cfg80211_leave_ibss+0xa6/0x13a [cfg80211] [ 233.363528] cfg80211_netdev_notifier_call+0x8b/0x631 [cfg80211] [ 233.363535] ? packet_notifier+0x196/0x1a3 [ 233.363540] raw_notifier_call_chain+0x39/0x58 [ 233.363544] __dev_close_many+0x6b/0xf0 [ 233.363548] dev_close_many+0x62/0xe8 [ 233.363552] ? _raw_spin_unlock_irq+0xe/0x21 [ 233.363555] rollback_registered_many+0xf6/0x35c [ 233.363560] ? __rcu_read_unlock+0x4a/0x4a [ 233.363563] unregister_netdevice_queue+0x7f/0x105 [ 233.363573] ieee80211_del_iface+0x12/0x16 [mt76_mac80211] [ 233.363582] nl80211_del_interface+0xa8/0x124 [cfg80211] [ 233.363588] genl_rcv_msg+0x40b/0x481 [ 233.363592] ? genl_unbind+0xb8/0xb8 [ 233.363595] netlink_rcv_skb+0x85/0xf8 [ 233.363598] genl_rcv+0x28/0x36 [ 233.363601] netlink_unicast+0x165/0x1f8 [ 233.363604] netlink_sendmsg+0x35f/0x3a6 [ 233.363608] sock_sendmsg+0x38/0x48 [ 233.363611] ___sys_sendmsg+0x1bf/0x267 [ 233.363615] ? __inode_wait_for_writeback+0x72/0xd7 [ 233.363619] ? dentry_kill+0x69/0x76 [ 233.363622] ? dput+0xd1/0x170 [ 233.363624] __sys_sendmsg+0x52/0x8f [ 233.363628] do_syscall_64+0x6b/0xf7 [ 233.363632] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [ 233.363635] RIP: 0033:0x7f2032ca1264 [ 233.363637] RSP: 002b:00007ffec3668e38 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 233.363639] RAX: ffffffffffffffda RBX: 000058f7175e7880 RCX: 00007f2032ca1264 [ 233.363641] RDX: 0000000000000000 RSI: 00007ffec3668e98 RDI: 0000000000000003 [ 233.363643] RBP: 00007ffec3668e70 R08: 0000000000000001 R09: 00007f2032ce1fd0 [ 233.363645] R10: 000058f7175e2010 R11: 0000000000000246 R12: 000058f7175e7740 [ 233.363646] R13: 00007ffec3668ff0 R14: 000058f7175e2350 R15: 00007ffec3668e98 Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit cc5f58aee180f1f8dbdbc136ecb3cdd190b29068 Author: Lorenzo Bianconi Date: Sat May 2 01:16:10 2020 +0200 mt76: mt7615: check return value of mt7615_eeprom_get_power_index mt7615_eeprom_get_power_index can return negative error value. Check mt7615_eeprom_get_power_index return value before using it Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit eb7bd8d7fb727dcdbf4b1c145bba1169bc3c2d4a Author: Lorenzo Bianconi Date: Sat May 2 01:13:11 2020 +0200 mt76: mt7663: read tx streams from eeprom Read tx stream configuration from eeprom/efuse Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 86c60179e5537c28145cbfa5ed2c16f776a497a6 Author: Lorenzo Bianconi Date: Fri May 1 12:36:17 2020 +0200 mt76: mt7615: introduce beacon_loss mcu event If device has enabled beacon hw filter rx beacons are not reported to the host. Introduce beacon_loss mcu event to trigger mac80211 mlme connection state machine in this configuration. IEEE80211_VIF_BEACON_FILTER has not set in vif flags since hw beacon filter is not enabled yet Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit b47e21e75c80966be1afc7fe28c75c6798b3e48e Author: Lorenzo Bianconi Date: Fri May 1 12:36:16 2020 +0200 mt76: mt7615: add gtk rekey offload support Add KCK and KEK offload support to mt7615 driver in order to support GTK rekeying during PM suspend Co-developed-by: Sean Wang Signed-off-by: Sean Wang Co-developed-by: Wan-Feng Jiang Signed-off-by: Wan-Feng Jiang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 6dd4072c1e8bc46ee81bdd5f779590bc43ab9ae4 Author: Lorenzo Bianconi Date: Fri May 1 12:36:15 2020 +0200 mt76: mt7615: introduce PM support Introduce suspend/resume to mt7615e driver Co-developed-by: Wan-Feng Jiang Signed-off-by: Wan-Feng Jiang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit d0846f0867f3361c551e2f431f94f64c58646d56 Author: Sean Wang Date: Fri May 1 12:36:14 2020 +0200 mt76: mt7663u: introduce suspend/resume to mt7663u Tested on Chromebok by "echo mem to /sys/power/state" to suspend and then waked up by keyboard keystrokes to resume system. Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit c6bf20109a3fae92402cb76ad709ec5256bcd169 Author: Lorenzo Bianconi Date: Fri May 1 12:36:13 2020 +0200 mt76: mt7615: add WoW support Introduce WoW support to mt7615 driver. Current supported trigger are: - magic-packet - disconnect - user-pattern Co-developed-by: Wan-Feng Jiang Signed-off-by: Wan-Feng Jiang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 6f117852009c8c0d7542f6de0750dfda18c6578c Author: Sean Wang Date: Fri May 1 12:36:12 2020 +0200 mt76: mt7615: introduce mt7615_mcu_set_hif_suspend mcu command Introduce the mt7615_mcu_set_hif_suspend mcu command, which is usually used to configure the interface including PCIe, USB or SDIO to the right state during operation suspend / resume. Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit c8646872d6e632f793a06a42708e282950ec982a Author: Lorenzo Bianconi Date: Fri May 1 12:36:11 2020 +0200 mt76: mt7615: introduce support for hardware beacon filter Introduce support for hw beacon filter if available in the firmware Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit a69b0b30e661eadfe1931c4c5751c2de7905f016 Author: Lorenzo Bianconi Date: Thu Apr 30 22:31:03 2020 +0200 mt76: mt7615: free pci_vector if mt7615_pci_probe fails Always free pci irq vector if mt7615_pci_probe routine fails Moreover free irq in mt7615_pci_remove routine Co-developed-by: Soul Huang Signed-off-by: Soul Huang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 4432119d17828ce7a66d74f898c52ca4a147ba92 Author: Lorenzo Bianconi Date: Thu Apr 30 11:11:34 2020 +0200 mt76: mt7615: add passive mode for hw scan Introduce support for passive frequency scanning to mt7615_mcu_hw_scan Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 6c5974c10c2c6cc8166d4708b957ff3245b4eecb Author: Lorenzo Bianconi Date: Thu Apr 30 09:59:31 2020 +0200 mt76: mt7615: do not mark sched_scan disabled in mt7615_scan_work For the moment offload firmware supports just one entry in the scheduled scan plan and so it runs till it is disabled by the userspace. Do not mark the hw scheduled scan as disabled in mt7615_scan_work after receiving a scan result Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 53b42ae291a0adf227c9f32e4024819a276ded02 Author: Lorenzo Bianconi Date: Wed Apr 29 19:52:15 2020 +0200 mt76: mt7615: introduce mt7615_check_offload_capability routine Introduce mt7615_check_offload_capability routine to set hw/wiphy offload capabilities according to the running firmware Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 0fe96975d1dfd0e7aabe9400d0b82947e0a0d30e Author: Lorenzo Bianconi Date: Wed Apr 29 19:48:53 2020 +0200 mt76: mt7615: fix ssid configuration in mt7615_mcu_hw_scan Fix SSID configuration performing hw frequency scanning Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit fb602b303b0eece7b8822e03f71a9ba3f35a4023 Author: Dejin Zheng Date: Tue Apr 28 22:31:52 2020 +0800 mt76: mt7603: remove duplicate error message it will print an error message by itself when devm_platform_ioremap_resource() goes wrong. so remove the duplicate error message. Signed-off-by: Dejin Zheng Signed-off-by: Felix Fietkau commit 89f8bc6a344b2b786210a4045256346b3f8f6c4c Author: Felix Fietkau Date: Wed Apr 29 14:34:23 2020 +0200 mt76: mt7615: fix getting maximum tx power from eeprom On top of the EEPROM target power, each rate can also has a power offset. On many devices, this power offset is used to boost the tx power of lower rates. Take this into account when parsing rate power. The assumption here is, that the first rate (OFDM 6M or CCK 1M) has the highest tx power Signed-off-by: Felix Fietkau commit 801f809aeeb127736a1f871dc21c800382afc4d2 Author: Felix Fietkau Date: Mon Apr 27 19:45:02 2020 +0200 mt76: mt7615: set spatial extension index The vendor driver sets this in firmware rate control (which we don't use) Signed-off-by: Felix Fietkau commit 404d1cd401cacf6922a800a63ff158f15615530d Author: Lorenzo Bianconi Date: Sun Apr 26 16:42:52 2020 +0200 mt76: mt7663: remove check in mt7663_load_n9 Get rid of useless check in mt7663_load_n9 since it is used only for mt7663 devices Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit f2dc8ea11fbeec8e8d35c30a9fbd1f97d9c079d4 Author: Lorenzo Bianconi Date: Tue Apr 28 15:34:09 2020 +0200 mt76: mt7663: add the possibility to load firmware v2 mt7663 firmware v2 is used for embedded devices since it has more completed features in AP mode. Add the capability to specify which firmware load first (v3 or v2) using prefer_offload_fw kernel parameter and fallback to the other one if the selected firmware fails to load Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 65ba7fa4b829588b011c8c285968c1a8d779b981 Author: Lorenzo Bianconi Date: Sat Apr 25 14:11:09 2020 +0200 mt76: mt76x0: enable MCS 8 and MCS9 Enable MCS8 and MCS9 for mt76x0{u,e} devices Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit ffc54ee2f03d0299146323c09cebb1c1de4d73d3 Author: Lorenzo Bianconi Date: Fri Apr 24 14:51:29 2020 +0200 mt76: mt7615: fix event report in mt7615_mcu_bss_event Currently mt7663 devices do not support DBDC so fw events have no info about it. Fix mt7615_mcu_bss_event that wrongly use bss_idx as DBDC band_idx while it is vif index. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit f559685035f818693a2930052283d837738dbc2f Author: Lorenzo Bianconi Date: Thu Apr 23 15:47:55 2020 +0200 mt76: mt7615: add sta pointer to mt7615_mcu_add_bss_info signature Introduce sta pointer to mt7615_mcu_add_bss_info signature in order to avoid sta lookup in mt7615_mcu_bss_basic_tlv routine Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5ac2e2a3485a13ac922249cd03b9dcecff59af5f Author: Sean Wang Date: Thu Apr 23 15:47:54 2020 +0200 mt76: mt7663: fix up BMC entry indicated to unicmd firmware BMC entry for MT7663 unicmd firmware should be a broadcast/multicast entry, not a unicast entry, that is GTK rekey offload would rely on. Fixes: 138860679b2a ("mt76: mt7615: add more uni mcu commands") Cc: Soul Huang Suggested-by: YF Luo Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit dd89a0133c0ce80bb8c2f873a85b28f2d33640bd Author: Lorenzo Bianconi Date: Wed Apr 22 18:29:32 2020 +0200 mt76: enable TDLS support Enable mac80211 TDLS support by default. Disable TDLS hw filtering for mt7615 devices Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit dcc4c74f9260fdc746d6ab4af17518cfe9d4e071 Author: Lorenzo Bianconi Date: Wed Apr 22 13:07:44 2020 +0200 mt76: mt7615: move mcu bss upload before creating the sta Run mt7615_mcu_add_bss_info routine before mt7615_mcu_sta_add since the firmware requires the bss is created before the relative sta Tested-by: Sean Wang Suggested-by: YF Luo Suggested-by: Lucy Hsu Co-developed-by: Soul Huang Signed-off-by: Soul Huang Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 40a61c9b2c725da82bd60a39bc54b8884b0a57b5 Author: Felix Fietkau Date: Wed Apr 22 13:15:06 2020 +0200 mt76: mt7603: fix tx status rate index calculation A switch from one rate index to the next only happens when tx count from the current slot is greater than MT7615_RATE_RETRY, which is 1 has to be subtracted from count, instead of added to it. Signed-off-by: Felix Fietkau commit 97507b38a4de63e55801bc91a107c2794159ccd6 Author: Felix Fietkau Date: Wed Apr 22 13:10:00 2020 +0200 mt76: mt7615: fix tx status rate index calculation A switch from one rate index to the next only happens when tx count from the current slot is greater than MT7615_RATE_RETRY, which is 1 has to be subtracted from count, instead of added to it. Signed-off-by: Felix Fietkau commit ad333c2ad23ec179b0c907e8553779873f4cc1c8 Author: Felix Fietkau Date: Wed Apr 22 12:32:10 2020 +0200 mt76: mt7615: do not adjust MAC timings if the device is not running Avoids register writes and MAC start/stop when the hardware isn't ready for it Signed-off-by: Felix Fietkau commit ed2bde56ab1fcda71faa24d720df06353d91e237 Author: Felix Fietkau Date: Wed Apr 22 12:28:19 2020 +0200 mt76: mt7615: adjust timing in mt7615_mac_set_timing to match fw/hw values Slightly improves performance Signed-off-by: Felix Fietkau commit e0b4fe832c3b400b34c0dfcce95f134dac2a5ef2 Author: Felix Fietkau Date: Wed Apr 22 17:46:58 2020 +0200 mt76: mt7603: never use an 802.11b CF-End rate on 5GHz Sometimes mt7615_mac_set_timing gets called while the slot time is still configured to 20. Ensure that in this case it always uses the OFDM CFend rate. Signed-off-by: Felix Fietkau commit ab9a1ed229ba668c4b0481cd174096f7876933a0 Author: Felix Fietkau Date: Wed Apr 22 12:25:54 2020 +0200 mt76: mt7615: never use an 802.11b CF-End rate on 5GHz Sometimes mt7615_mac_set_timing gets called while the slot time is still configured to 20. Ensure that in this case it always uses the OFDM CFend rate. Signed-off-by: Felix Fietkau commit 61cb60758a05de1eaf5017e37a099fe52c5cce25 Author: Felix Fietkau Date: Mon Apr 20 16:53:28 2020 +0200 mt76: mt7615: use larger rx buffers if VHT is supported In VHT mode we can receive larger MPDUs. Increasing the buffer size reduces fragmentation here, which should improve performance. Signed-off-by: Felix Fietkau commit 55961d8be35d0268d66f4ffe2cbbccff4936aae5 Author: Felix Fietkau Date: Mon Apr 20 16:34:16 2020 +0200 mt76: fix A-MPDU density handling The hardware requirements for A-MPDU density are entirely on the tx side, not the rx side. Because of that, the IE value should stay at 0 and the minimum value should instead be enforced in WTBL/TXWI MT7615 has no restrictions here Signed-off-by: Felix Fietkau commit d0116058c7f637842097741cee357496326f2b9d Author: Felix Fietkau Date: Mon Apr 20 15:49:35 2020 +0200 mt76: mt7615: fix sta ampdu factor for VHT If VHT has a larger A-MPDU size limit, pass it to the MCU via the wtbl_ht TLV element. Signed-off-by: Felix Fietkau commit 5416651c9e00f4cbc6f8528bb42fc33e6c600309 Author: Lorenzo Bianconi Date: Wed Apr 22 10:47:24 2020 +0200 mt76: mt7663u: enable AirTimeFairness Initialize tx_status_data pointer in order to enable Air Time Fairness for mt7663u chipset Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit a621372a04ac6435edbf270ff85edae8a3e04c91 Author: Lorenzo Bianconi Date: Wed Apr 22 10:47:23 2020 +0200 mt76: mt7615: rework mt7615_mac_sta_poll for usb code Since usb code can't access device registers in interrupt context, move rcu_read_lock/rcu_read_unlock in mt7615_poll_tx routine. Moreover loop over a local msta list in mt7615_mac_sta_poll since mt7663u driver will not be able to complete the inner while loop before sta_poll_list list is refilled by mt7615_mac_add_txs/mt7615_mac_fill_rx Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit fdf433121f82766ff508a6f06665d2aca3e258d5 Author: Lorenzo Bianconi Date: Tue Apr 21 16:31:40 2020 +0200 mt76: mt7615: fix aid configuration in mt7615_mcu_wtbl_generic_tlv If the vif is running in station mode the aid will be passed by mac80211 using bss_conf.aid. Fix aid configuration in mt7615_mcu_wtbl_generic_tlv Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 338061619185133f56ac17365deb1e75eaecc604 Author: Lorenzo Bianconi Date: Mon Apr 20 22:40:55 2020 +0200 mt76: mt7615: fix mt7615_driver_own routine Introduce MT_PCIE_DOORBELL_PUSH register to fix mt7615_driver_own routine for mt7663e Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 8f997dddc0784f6a9f0abece590a97da817830f8 Author: Lorenzo Bianconi Date: Mon Apr 20 14:39:02 2020 +0200 mt76: mt7615: fix max wtbl size for 7663 Current mt7663 offload firmware can support up to 32 wtbl entries Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit becdf0d5d7a46f5ed1f12405ffae4b04764fe27c Author: Lorenzo Bianconi Date: Mon Apr 20 14:07:45 2020 +0200 mt76: mt7615: fix mt7615_firmware_own for mt7663e Check the firmware-own configuration has been applied polling MT_CONN_HIF_ON_LPCTL register Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit df5ab0d58b2e3952acef5be1c8c183a6cf31daab Author: Lorenzo Bianconi Date: Mon Apr 20 13:58:44 2020 +0200 mt76: mt7615: parse mcu return code for unified commands Add return code parsing for the following unified commands: - MCU_UNI_CMD_DEV_INFO_UPDATE - MCU_UNI_CMD_BSS_INFO_UPDATE - MCU_UNI_CMD_STA_REC_UPDATE Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 6ea62c50792c6ad8b283c02d19f4304c7f3a3ccf Author: Lorenzo Bianconi Date: Sun Apr 19 22:11:41 2020 +0200 mt76: add rx queues info to mt76 debugfs Introduce rx-queues debugfs node in order to dump rx queues status. This would be useful for mcu fw debugging Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 18ab1d7a37576c10bdeb6409147ae715ddc2f925 Author: Sean Wang Date: Fri Apr 17 13:13:28 2020 +0200 mt76: mt7615: make Kconfig entry obvious for MT7663E Make Kconfig entry obvious for MT7663E Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 7f8ebafebce3b0eae48e328ff75475d7181f83ac Author: Lorenzo Bianconi Date: Fri Apr 17 13:10:06 2020 +0200 mt76: mt7663: introduce 802.11 PS support in sta mode Enable 802.11 power-save support available in mt7663 firmware Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit a7df11520997e8c67e28675e3170ae7e92e4a165 Author: Lorenzo Bianconi Date: Fri Apr 17 13:10:05 2020 +0200 mt76: remove PS_NULLFUNC_STACK capability remove IEEE80211_HW_PS_NULLFUNC_STACK capability from mt76_phy_init routine since 802.11 ps is not currently supported by any devices and it will conflict with mt7663 ps fw support Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 60cb9843f33480d52eaa41ac2fc72940f3bfa17b Author: Lorenzo Bianconi Date: Fri Apr 17 13:10:04 2020 +0200 mt76: mt7615: provide aid info to the mcu For sta mode mac80211 provides aid in vif->bss_conf.aid. In order to properly support 802.11 power-save, configure correct aid to mcu during sta association Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 450affca7b3d1964a6181e9acc033897bd8bab55 Author: Lorenzo Bianconi Date: Fri Apr 17 12:10:54 2020 +0200 mt76: mt7615: disable aspm by default The vendor SDK also disables ASPM by default Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit ad6b0be6f4e922ef0f2aea9d0e09f2c4cf3adc5e Author: Lorenzo Bianconi Date: Thu Apr 16 16:36:19 2020 +0200 mt76: mt7615: enable scs for mt7663 driver Add missing register definitions in order to enable sensitivity tuning for mt7663 driver Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit eb99cc95c3b6513b495c4839ac4917206705f657 Author: Lorenzo Bianconi Date: Thu Apr 16 16:32:51 2020 +0200 mt76: mt7615: introduce mt7663u support Introduce support for mt7663u 802.11ac 2x2:2 chipset to mt7615 driver. Main difference respect to pcie code base is the usb code needs to configure wtbl from non-atomic context Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit e90354e0452d33f3dc77d7f5c0ff7033f97e1fbf Author: Lorenzo Bianconi Date: Thu Apr 16 16:32:50 2020 +0200 mt76: mt7615: move core shared code in mt7615-common module Create mt7615-common module in order to collect shared code between usb and mmio code. Move the following source files in mt7615-common module: - main.c - init.c - mcu.c - mac.c - debugfs.c - eeprom.c - trace.c Create the following source files for mmio only source code and move them in mt7615e module: - pci_init.c - dma.c - pci_mac.c Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 4fcf6e770b4487db3dbcf48993a36f16f8836680 Author: Lorenzo Bianconi Date: Mon Apr 13 16:28:48 2020 +0200 mt76: mt7615: fix possible deadlock in mt7615_stop make mac_work per phy instead of per device and fix a possible deadlock in mt7615_stop since mt7615_mac_work runs holding mt76 mutex Fixes: fdd2e570764c2 ("mt76: mt7615: add dual-phy support for mac80211 ops") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5da612090d9a7b1481b7587b3b1deede30a11baf Author: Jules Irenge Date: Sat Apr 11 01:19:26 2020 +0100 mt76: remove unnecessary annotations Sparse report warnings at mt76_tx_status_unlock() and mt76_tx_status_lock() warning: context imbalance in mt76_tx_status_lock() - wrong count at exit warning: context imbalance in mt76_tx_status_unlock() - unexpected unlock The root cause is the additional __acquire(&dev->status_list.lock) and __release(&dev->status_list.unlock) called from inside mt76_tx_status_lock() and mt76_tx_status_unlock(). Remove __acquire(&dev->status_list.lock) annotation Remove __releases(&dev->status_list.unlock) Correct &dev->status_list.unlock to &dev->status_list.lock -unlock not defined in the sk_buff_head struct Signed-off-by: Jules Irenge Signed-off-by: Felix Fietkau commit 9fbb4b8621d7cac34b5b4b20462341b00d9d596c Author: Lorenzo Bianconi Date: Thu Apr 9 18:37:04 2020 +0200 mt76: mt7615: enable MSI by default Enable MSI/MSI-X PCI interrupts by default. This patch has been tested using Banana Pi r64 board Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 9b90ab32f871eae0de982a6567fe32039a756af5 Author: Felix Fietkau Date: Thu Apr 9 14:37:50 2020 +0200 mt76: mt7615: rework IRQ handling to prepare for MSI support With MSI interrupts, IRQs must not be enabled from within the IRQ handler, because that can lead to lost events. Defer IRQ processing to a tasklet, which is also responsible for enabling IRQs (to avoid race conditions against the handler) Co-developed-by: Soul Huang Acked-by: Lorenzo Bianconi Signed-off-by: Soul Huang Signed-off-by: Felix Fietkau commit 89829c9e65ab680f7e5a1658cb74bc6316ab036e Author: Lorenzo Bianconi Date: Thu Apr 9 13:14:57 2020 +0200 mt76: mt7663: fix DMA unmap length Fix DMA unmap length for mt7663e devices in mt7615_txp_skb_unmap_hw Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Co-developed-by: Soul Huang Signed-off-by: Soul Huang Signed-off-by: Lorenzo Bianconi commit c0f8055b3986f9c9f990268b578173259769ba1c Author: Lorenzo Bianconi Date: Thu Apr 9 13:14:56 2020 +0200 mt76: mt7622: fix DMA unmap length Fix DMA unmap length estimation in mt7615_txp_skb_unmap_hw for mt7622 chipset Fixes: 6aa4ed7927f1 ("mt76: mt7615: implement DMA support for MT7622") Signed-off-by: Lorenzo Bianconi commit 639e25a125857be1cba52892959d47384177dd72 Author: Felix Fietkau Date: Wed Apr 8 18:10:35 2020 +0200 mt76: mt7615: set hw scan limits only for firmware with offload support They do not apply to software scan Signed-off-by: Felix Fietkau commit 635cb0105e01f4c90e69b3cf8e2c1569479e4bf7 Author: Felix Fietkau Date: Thu Apr 9 11:51:17 2020 +0200 mt76: mt7615: disable hw/sched scan ops for non-offload firmware Avoid having to attempt hw scan and fall back to software for every scan on devices/firmware without hw scan support Signed-off-by: Felix Fietkau commit 6bcfdabbadffa19fabafb5b6c7bcf41322b62695 Author: Lorenzo Bianconi Date: Wed Apr 8 14:20:39 2020 +0200 mt76: mt7663: fix aggr range entry in debugfs Fix register definitions for aggr range counter registers for mt7663 chipset Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 1855ad5360a18131e5c4b4afa1a1c5dea6e456c6 Author: Lorenzo Bianconi Date: Mon Apr 6 23:56:30 2020 +0200 mt76: mt7615: fix possible division by 0 in mt7615_mac_update_mib_stats Check that val is not zero before aggr_per estimation in order to avoid a possible division by 0 Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 9a865741d84ec08dfd04fc28a5fca210f919f54d Author: Felix Fietkau Date: Mon Apr 6 14:03:06 2020 +0200 mt76: mt76x2: disable merge of OTP ROM data by default The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau commit 6d3390a664bbac544d1656503a3ccf947f154770 Author: Felix Fietkau Date: Mon Apr 6 14:01:56 2020 +0200 mt76: mt7603: disable merge of OTP ROM data by default The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau commit 371a59d151df588795f43c22dc3f882b9719559b Author: Felix Fietkau Date: Mon Apr 6 11:14:56 2020 +0200 mt76: mt7615: add support for applying tx DPD calibration from EEPROM When the EEPROM data is read from flash, it can contain tx DPD calibration data. Add support for sending the data to the firmware. Signed-off-by: Felix Fietkau commit ad380ad1ebbe6a9a243150fef1123670164ae278 Author: Felix Fietkau Date: Mon Mar 30 15:02:45 2020 +0200 mt76: mt7615: add support for applying DC offset calibration from EEPROM When the EEPROM data is read from flash, it can contain DC offset calibration data. Add support for sending the data to the firmware. Signed-off-by: Felix Fietkau commit b90728f82b085f97a4993ef7ed71f38e3ae031ea Author: Felix Fietkau Date: Mon Apr 6 10:19:48 2020 +0200 mt76: mt7615: disable merge of OTP ROM data by default The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau commit c3129ea44065f8d2a605e4489e809f47f5ff9524 Author: Felix Fietkau Date: Mon Apr 6 12:16:22 2020 +0200 dt-bindings: net: wireless: mt76: document mediatek,eeprom-merge-otp property It is used to enable merging of Flash EEPROM data with OTP ROM calibration. Signed-off-by: Felix Fietkau commit 373ab334226853a71903c3f62c0d89ddfaa0aeb2 Author: Markus Elfring Date: Sun Apr 5 16:45:48 2020 +0200 mt76: mt7615: Delete an error message in mt7622_wmac_probe() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Felix Fietkau commit fdb786cce0ef3615dcbb30d8baf06a1d4cb7a344 Author: Lorenzo Bianconi Date: Fri Apr 3 21:01:56 2020 +0200 mt76: mt7615: do not always reset the dfs state setting the channel mac80211/hostapd runs mt7615_set_channel with the same channel parameters sending multiple rdd commands overwriting the previous ones. This behaviour is causing tpt issues on dfs channels. Fix the issue checking new channel freq/width with the running one. Fixes: 5dabdf71e94e ("mt76: mt7615: add multiple wiphy support to the dfs support code") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 044883e37ddad04690e57f037e9eae48287e2613 Author: Sean Wang Date: Fri Apr 3 17:09:16 2020 +0800 mt76: mt7663: correct the name of the rom patch Rom patch is shared between Bluetooth and Wifi devices, so correct the naming to allow two drivers to share the same file. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 6e5d2099a483c4ab3557d23e0c5c89ff7bd7b0a8 Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:56 2020 +0200 mt76: mt7615: add address parameter to mt7615_eeprom_init Introduce address parameter to mt7615_eeprom_init routine in order to be reused adding usb support to mt7615 driver Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 7d9f1d108c3a05905ecefaff058c5688458f2f48 Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:55 2020 +0200 mt76: mt7615: introduce mt7615_wtbl_desc data structure Generalize mt7615_rate_desc introducing mt7615_wtbl_desc and mt7615_key_desc data structures in order to configure the hw wtbl in a non-atomic context for usb devices Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 294f17aea22aeb236cefdc9d7bd8af536291a7f8 Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:54 2020 +0200 mt76: mt7615: rework wtbl key configuration Remove key dependency from mt7615_mac_wtbl_update_key and export mt7615_mac_wtbl_update_key, mt7615_mac_wtbl_update_pk and mt7615_mac_wtbl_update_cipher in order to reuse them in usb code. Move mt7615_mac_get_cipher in mac.h Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 3a1880565aaf71818310a42fb2e2e11801d5111d Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:53 2020 +0200 mt76: mt76u: rely on mt7622 queue scheme for mt7663u Rely on the mt7622 endpoint definitions for mt7663u Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit d506017ed4854963e967d4017be33a4cc5e1285b Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:52 2020 +0200 mt76: mt7615: move mt7615_mac_wtbl_addr in mac.h Move mt7615_mac_wtbl_addr in mac.h and add inline qualifier in order to be reused adding usb support to mt7615 driver Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 8915c3ceb92948a158bbce6060794b3500a006c8 Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:51 2020 +0200 mt76: mt7615: introduce __mt7663_load_firmware routine Introduce __mt7663_load_firmware routine to load firmware for usb devices. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 8f93af9cac300e063e7a66447e29810e9f44eabf Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:50 2020 +0200 mt76: mt7615: introduce mt7615_mac_update_rate_desc routine Move register configuration out of mt7615_mac_set_rates since usb driver can't access device register in interrupt context. Introduce mt7615_mac_update_rate_desc routine to report rate info to mt7615_mac_set_rates Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit d4bf77bd749300123481a22df82b8ab618844153 Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:49 2020 +0200 mt76: mt7615: introduce mt7663u support to mt7615_write_txwi Extend mt7615_write_txwi routine to support usb txwi configuration Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit bb31a80eb2b36cccf5d72b616381aff650ac3961 Author: Lorenzo Bianconi Date: Thu Apr 2 20:18:48 2020 +0200 mt76: add headroom and tailroom to mt76_mcu_ops data structure Introduce headroom and tailroom to mt76_mcu_ops data structure in order to unify the routine used for mcu message allocation. This is a preliminary patch to add mt7663u support Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 34cdf1a618eb071a62362eb79428835167630531 Author: Sean Wang Date: Thu Apr 2 15:06:42 2020 +0200 mt76: mt7615: remove unnecessary register operations Remove mt76_wr(dev, MT_CSR(0x010), 0x8208) that would cause MT_PCIE_IRQ_ENABLE to be disabled; MT_PCIE_IRQ_ENABLE should always keep on enabled when the driver is running. 0x44064 is a not existing address Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5d3a4a4b57aa557d9d48bf2133fbd99f3bf1f354 Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:41 2020 +0200 mt76: mt7615: introduce rlm tlv in bss_info mcu command Introduce rlm tlv header in bss_info mcu command in order to inform the mcu about operating channel. Rlm header is necessary only if the mcu is running low power functionalities (e.g offloaded scan) Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit bb366c5b88be7b96ba4ec09c9de3ca649c89c9d8 Author: Sean Wang Date: Thu Apr 2 15:06:40 2020 +0200 mt76: mt7615: introduce BSS absence event Introduce BSS absence event that is reported when the fw is leaving or entering current operational channel. Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 20305f98177432b48892d8add9cf6b05577b5d5d Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:39 2020 +0200 mt76: mt7615: introduce scheduled scan support Introduce scheduled scan support for mt7663e devices Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit fcdfc29e58ee3b4db894f356fb6b12a6546f57bd Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:38 2020 +0200 mt76: mt7615: introduce hw scan support Introduce hw scan support to mt7663e driver Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit daf250f89f4c5261997b76abc13323be0dc0205e Author: Sean Wang Date: Thu Apr 2 15:06:37 2020 +0200 mt76: mt7663: keep Rx filters as the default Keep Rx filters default value if the firmware supports offload and low power features. Signed-off-by: Sean Wang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit bf18fcdc9a4ba0861743cb7c8c8a6349ad0114f5 Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:36 2020 +0200 mt76: mt7615: introduce mt7615_mcu_set_channel_domain mcu command Introduce mt7615_mcu_set_channel_domain routines in order to instruct the mcu about supported band/channels. This is a preliminary patch to add hw scan support to mt7663e driver Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 938d76bb3a29591e18da9aa8d8c8fc6a4454e2b7 Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:35 2020 +0200 mt76: mt7615: add ethool support to mt7663 driver Report n9 firmware version using ethtool Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 02c655919c431fc72171b3016dead174a4bf4f8e Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:34 2020 +0200 mt76: mt7663: disable RDD commands Disable dfs RDD mcu commands for mt7663 driver since they are not currently supported by the 7663 firmware Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 594034b788673a42a0fad785b8a72c523568721f Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:33 2020 +0200 mt76: mt7615: make scs configurable per phy Make scs configurable per phy since most of the chipsets do not support dbdc Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit b61e45eb891fd8fb0704fc05aaae3be53e7687ae Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:32 2020 +0200 mt76: mt7663: enable nf estimation Enable Noise floor estimation for mt7663 driver Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 886a862d3677ac0d3b57d19ffcf5b2d48b9c5267 Author: Lorenzo Bianconi Date: Thu Apr 2 15:06:31 2020 +0200 mt76: mt7663: fix mt7615_mac_cca_stats_reset routine Fix PHYMUX_5 register definition for mt7663 in mt7615_mac_cca_stats_reset routine Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit aef16345ba8db6455c816fdbe584e140dde84d32 Author: Ryder Lee Date: Tue Mar 31 14:51:38 2020 +0800 mt76: mt7615: add more useful Tx mib counters Add ba_miss_cnt and ampdu_per in mib_stats. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit b7825ca0a29e1e679af1b0c6187c0d09a76c8554 Author: Ryder Lee Date: Tue Mar 31 14:51:37 2020 +0800 mt76: mt7615: cleanup mib related defines and structs Simplify mib macros and use proper type for related counters. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit b473fdbb745612e6ed50a176825ded1c5ba42c3f Author: Ryder Lee Date: Tue Mar 31 14:51:36 2020 +0800 mt76: mt7615: enable aggr_stats for both phy Use bottom half of aggr_stats for second phy. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit f8de2bf26ce9e6611cbded70e6e9c78a5b4fd107 Author: Ryder Lee Date: Tue Mar 31 14:51:35 2020 +0800 mt76: mt7615: modify mt7615_ampdu_stat_read for each phy This is a preliminary patch to add more Tx counters. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 663e69b141cd1e31039a9bebdaeb3aab0fe9c661 Author: Pawel Dembicki Date: Wed Mar 25 06:55:23 2020 +0100 mt76: mt76x0: pci: add mt7610 PCI ID Add mt7610 PCI id found on D-Link DWR-960 to pci_device_id table. Run-tested on D-Link DWR-960 with no-name half-size mPCIE card with mt7610e. Signed-off-by: Pawel Dembicki Signed-off-by: Felix Fietkau commit 3efdfbe0b5b5e08d7b699f5d3138c1801ffb3714 Author: Lorenzo Bianconi Date: Sat Mar 21 16:14:42 2020 +0100 mt76: mt76x2u: introduce Mercury UD13 support Introduce Mercury UD13 dual-band dongle support to mt76x2u driver Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit b2934279c3e9719145ff4090d4ab951e340df17e Author: Matthew Garrett Date: Wed Mar 18 16:07:48 2020 -0700 mt76: mt76x02u: Add support for newer versions of the XBox One wifi adapter The current version has a new USB ID and reports as an 0x7632 device. Adding the IDs results in it working out of the box. Signed-off-by: Matthew Garrett Signed-off-by: Felix Fietkau commit fd6c2dfa49b762ffe773a835ba62fa692df4c1b0 Author: Felix Fietkau Date: Sun Feb 16 16:08:58 2020 +0100 mt76: mt76x02: fix handling MCU timeouts during hw restart If a MCU timeout occurs before a hw restart completes, another hw restart is scheduled, and the station state gets corrupted. To speed up dealing with that, do not issue any MCU commands after the first timeout, and defer handling timeouts until the reset has completed. Also ignore errors in MCU commands during start/config to avoid making user space fail on this condition. If it happens, another restart is scheduled quickly, and that usually recovers the hardware properly. Signed-off-by: Felix Fietkau commit d7faa8ffb6be57bf8233a4b5a636d76b83c51ce7 Author: Dafna Hirschfeld Date: Wed May 6 12:09:03 2020 +0200 pinctrl: rockchip: fix memleak in rockchip_dt_node_to_map In function rockchip_dt_node_to_map, a new_map variable is allocated by: new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map), GFP_KERNEL); This uses devres and attaches new_map to the pinctrl driver. This cause a leak since new_map is not released when the probed driver is removed. Fix it by using kcalloc to allocate new_map and free it in `rockchip_dt_free_map` Signed-off-by: Dafna Hirschfeld Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20200506100903.15420-1-dafna.hirschfeld@collabora.com Signed-off-by: Linus Walleij commit e4e9f6dfeedc86afef2c3fa4102d274862fe2cf9 Author: Mark Brown Date: Tue May 12 12:39:50 2020 +0100 arm64: bti: Fix support for userspace only BTI When setting PTE_MAYBE_GP we check system_supports_bti() but this is true for systems where only CONFIG_BTI is set causing us to enable BTI on some kernel text. Add an extra check for the kernel mode option, using an ifdef due to line length. Fixes: c8027285e366 ("arm64: Set GP bit in kernel page tables to enable BTI for the kernel") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200512113950.29996-1-broonie@kernel.org Signed-off-by: Will Deacon commit 357dd8a2aff25270971e11a37ddec807f37488e9 Author: Geert Uytterhoeven Date: Tue May 12 16:52:55 2020 +0200 arm64: cpufeature: Add "or" to mitigations for multiple errata Several actions are not mitigations for a single erratum, but for multiple errata. However, printing a line like CPU features: detected: ARM errata 1165522, 1530923 may give the false impression that all three listed errata have been detected. This can confuse the user, who may think his Cortex-A55 is suddenly affected by a Cortex-A76 erratum. Add "or" to all descriptions for mitigations for multiple errata, to make it clear that only one or more of the errata printed are applicable, and not necessarily all of them. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200512145255.5520-1-geert+renesas@glider.be Signed-off-by: Will Deacon commit 91160150aba03d0c173b3f5c859a795cc701bb8d Author: Douglas Anderson Date: Wed Apr 15 10:00:28 2020 -0700 soc: qcom: rpmh-rsc: Timeout after 1 second in write_tcs_reg_sync() If our data still isn't there after 1 second, shout and give up. Reported-by: Joe Perches Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200415095953.v3.2.I8550512081c89ec7a545018a7d2d9418a27c1a7a@changeid Signed-off-by: Bjorn Andersson commit faa0c1f106efd6b7f61e9df95e27cc748a7123ec Author: Douglas Anderson Date: Wed Apr 15 10:00:27 2020 -0700 soc: qcom: rpmh-rsc: Factor "tcs_reg_addr" and "tcs_cmd_addr" calculation We can make some of the register access functions more readable by factoring out the calculations a little bit. Suggested-by: Joe Perches Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200415095953.v3.1.Ic70288f256ff0be65cac6a600367212dfe39f6c9@changeid Signed-off-by: Bjorn Andersson commit 91bf5ec3421df5ec620e9abc9afa0ddacbbdefef Merge: 92decf118f1d 0836275df4db Author: Jens Axboe Date: Tue May 12 11:35:49 2020 -0600 Merge tag 'floppy-for-5.8' of https://github.com/evdenis/linux-floppy into for-5.8/drivers Floppy patches for 5.8 Cleanups: - symbolic register names for x86,sparc64,sparc32,powerpc,parisc,m68k - split of local/global variables for drive,fdc - UBSAN warning suppress in setup_rw_floppy() Changes were compile tested on arm, sparc64, powerpc, m68k. Many patches introduce no binary changes by using defines instead of magic numbers. The patches were also tested with syzkaller and simple write/read/format tests on real hardware. Signed-off-by: Denis Efremov Signed-off-by: Jens Axboe * tag 'floppy-for-5.8' of https://github.com/evdenis/linux-floppy: (31 commits) floppy: suppress UBSAN warning in setup_rw_floppy() floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmd floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params floppy: use print_hex_dump() in setup_DMA() floppy: cleanup: make set_fdc() always set current_drive and current_fd floppy: cleanup: get rid of current_reqD in favor of current_drive floppy: make sure to reset all FDCs upon resume() floppy: cleanup: do not iterate on current_fdc in do_floppy_init() floppy: cleanup: add a few comments about expectations in certain functions floppy: cleanup: do not iterate on current_fdc in DMA grab/release functions floppy: cleanup: make get_fdc_version() not rely on current_fdc anymore floppy: cleanup: make next_valid_format() not rely on current_drive anymore floppy: cleanup: make check_wp() not rely on current_{fdc,drive} anymore floppy: cleanup: make fdc_specify() not rely on current_{fdc,drive} anymore floppy: cleanup: make fdc_configure() not rely on current_fdc anymore floppy: cleanup: make perpendicular_mode() not rely on current_fdc anymore floppy: cleanup: make need_more_output() not rely on current_fdc anymore floppy: cleanup: make result() not rely on current_fdc anymore floppy: cleanup: make output_byte() not rely on current_fdc anymore floppy: cleanup: make wait_til_ready() not rely on current_fdc anymore ... commit f6da4831c55ae0c86c496e330f3b61ccbee1fcce Author: Bjorn Andersson Date: Thu Apr 30 11:00:51 2020 -0700 remoteproc: qcom: pas: Add SM8250 PAS remoteprocs Add audio, compute and sensor DSP compatibles to the Qualcomm PAS binding and driver. Reviewed-by: Sibi Sankar Link: https://lore.kernel.org/r/20200430180051.3795305-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 4a995747049eea8ba61a3e356a1b7407e60efbd1 Author: Bjorn Andersson Date: Thu Apr 30 11:00:50 2020 -0700 dt-bindings: remoteproc: qcom: pas: Add SM8250 remoteprocs Add the SM8250 audio, compute and sensor remoteprocs to the PAS DT binding. Acked-by: Rob Herring Reviewed-by: Sibi Sankar Link: https://lore.kernel.org/r/20200430180051.3795305-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 454b9c1ffd422bfd5cfb7212a66a00a0d8a2c1b4 Author: Wolfram Sang Date: Thu Mar 26 22:09:54 2020 +0100 power: supply: bq24190_charger: convert to use i2c_new_client_device() Move away from the deprecated API in this comment. Signed-off-by: Wolfram Sang Signed-off-by: Sebastian Reichel commit afb7f565249aca3d46954889f07b48e8caf860ce Author: Andy Shevchenko Date: Tue May 12 14:03:15 2020 +0300 spi: dw: Drop duplicate error message when remap resource devm_platform_ioremap_resource() will issue a message in the error case. Thus, no need to duplicate in the driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200512110315.58845-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 0836275df4db20daf040fff5d9a1da89c4c08a85 Author: Denis Efremov Date: Fri May 1 16:44:16 2020 +0300 floppy: suppress UBSAN warning in setup_rw_floppy() UBSAN: array-index-out-of-bounds in drivers/block/floppy.c:1521:45 index 16 is out of range for type 'unsigned char [16]' Call Trace: ... setup_rw_floppy+0x5c3/0x7f0 floppy_ready+0x2be/0x13b0 process_one_work+0x2c1/0x5d0 worker_thread+0x56/0x5e0 kthread+0x122/0x170 ret_from_fork+0x35/0x40 From include/uapi/linux/fd.h: struct floppy_raw_cmd { ... unsigned char cmd_count; unsigned char cmd[16]; unsigned char reply_count; unsigned char reply[16]; ... } This out-of-bounds access is intentional. The command in struct floppy_raw_cmd may take up the space initially intended for the reply and the reply count. It is needed for long 82078 commands such as RESTORE, which takes 17 command bytes. Initial cmd size is not enough and since struct setup_rw_floppy is a part of uapi we check that cmd_count is in [0:16+1+16] in raw_cmd_copyin(). The patch adds union with original cmd,reply_count,reply fields and fullcmd field of equivalent size. The cmd accesses are turned to fullcmd where appropriate to suppress UBSAN warning. Link: https://lore.kernel.org/r/20200501134416.72248-5-efremov@linux.com Reviewed-by: Christoph Hellwig Signed-off-by: Denis Efremov commit bd10a5f3e21b1cb8e2133c1f08b3e8207cee12dd Author: Denis Efremov Date: Fri May 1 16:44:15 2020 +0300 floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmd Use FD_RAW_CMD_SIZE, FD_RAW_REPLY_SIZE defines instead of magic numbers for cmd & reply buffers of struct floppy_raw_cmd. Remove local to floppy.c MAX_REPLIES define, as it is now FD_RAW_REPLY_SIZE. FD_RAW_CMD_FULLSIZE added as we allow command to also fill reply_count and reply fields. Link: https://lore.kernel.org/r/20200501134416.72248-4-efremov@linux.com Reviewed-by: Christoph Hellwig Signed-off-by: Denis Efremov commit 9c4c5a24c85585fb8904bd2872501cd8181b3854 Author: Denis Efremov Date: Fri May 1 16:44:14 2020 +0300 floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params Use FD_AUTODETECT_SIZE for autodetect buffer size in struct floppy_drive_params instead of a magic number. Link: https://lore.kernel.org/r/20200501134416.72248-3-efremov@linux.com Reviewed-by: Christoph Hellwig Signed-off-by: Denis Efremov commit 29ac67633c893dec0024fb7597860fde52fdc819 Author: Denis Efremov Date: Fri May 1 16:44:13 2020 +0300 floppy: use print_hex_dump() in setup_DMA() Remove pr_cont() and use print_hex_dump() in setup_DMA() to print the contents of the cmd buffer. Link: https://lore.kernel.org/r/20200501134416.72248-2-efremov@linux.com Suggested-by: Joe Perches Reviewed-by: Christoph Hellwig Signed-off-by: Denis Efremov commit ca1b409a3b8a190c13bb30ed3ad91585d434d8e2 Author: Willy Tarreau Date: Fri Apr 10 12:19:04 2020 +0200 floppy: cleanup: make set_fdc() always set current_drive and current_fd When called with a negative drive value, set_fdc() would stick to the current fdc (which was assumed to reflect the current_drive's FDC). We do not need this anymore as the last call place with a negative value was just addressed. Let's make this function always set both current_fdc and current_drive so that there's no more ambiguity. A few comments stating this were added to a few non-obvious places. Link: https://lore.kernel.org/r/20200410101904.14652-3-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 99ba6ccc7f8f362ae52ddddda2252e753329c7ec Author: Willy Tarreau Date: Fri Apr 10 12:19:03 2020 +0200 floppy: cleanup: get rid of current_reqD in favor of current_drive This macro equals -1 and is used as an alternative for current_drive when calling reschedule_timeout(), which in turn needs to remap it. This only adds obfuscation, let's simply use current_drive. Link: https://lore.kernel.org/r/20200410101904.14652-2-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 6111a4f9bb189e76cda6a306074c9746ddeef04b Author: Willy Tarreau Date: Fri Apr 10 12:19:02 2020 +0200 floppy: make sure to reset all FDCs upon resume() In floppy_resume() we don't properly reinitialize all FDCs, instead we reinitialize the current FDC once per available FDC because value -1 is passed to user_reset_fdc(). Let's simply save the current drive and properly reinitialize each FDC. Link: https://lore.kernel.org/r/20200410101904.14652-1-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 05f5e319a1eb017442cd0eec87ad52a62d8c3224 Author: Willy Tarreau Date: Fri Apr 10 11:30:23 2020 +0200 floppy: cleanup: do not iterate on current_fdc in do_floppy_init() There's no need to iterate on current_fdc in do_floppy_init() anymore, in the first case it's only used as an array index to access fdc_state[], so let's get rid of this confusing assignment. The second case is a bit trickier because user_reset_fdc() needs to already know current_fdc when called with drive==-1 due to this call chain: user_reset_fdc() lock_fdc() set_fdc() drive<0 ==> new_fdc = current_fdc Note that current_drive is not used in this code part and may even not match a unit belonging to current_fdc. Instead of passing -1 we can simply pass the first drive of the FDC being initialized, which is even cleaner as it will allow the function chain above to consistently assign both variables. Link: https://lore.kernel.org/r/20200410093023.14499-1-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 12aebfac27ab69b5ed333c94fda45ef31ba2fc2a Author: Willy Tarreau Date: Tue Mar 31 11:40:54 2020 +0200 floppy: cleanup: add a few comments about expectations in certain functions The locking in the driver is far from being obvious, with unlocking automatically happening at end of operations scheduled by interrupt, especially for the error paths where one does not necessarily expect that such an interrupt may be triggered. Let's add a few comments about what to expect at certain places to avoid misdetecting bugs which are not. Link: https://lore.kernel.org/r/20200331094054.24441-24-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 82a630105847d7b7657901643810542212082af6 Author: Willy Tarreau Date: Tue Mar 31 11:40:53 2020 +0200 floppy: cleanup: do not iterate on current_fdc in DMA grab/release functions Both floppy_grab_irq_and_dma() and floppy_release_irq_and_dma() used to iterate on the global variable while setting up or freeing resources. Now that they exclusively rely on functions which take the fdc as an argument, so let's not touch the global one anymore. Link: https://lore.kernel.org/r/20200331094054.24441-23-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit e5a9c95f9bdb8ca52ce1ee47bd04f07de0e119ae Author: Willy Tarreau Date: Tue Mar 31 11:40:52 2020 +0200 floppy: cleanup: make get_fdc_version() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-22-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 43d81bb6470c431e17f093b3f7adf70fd33ef15a Author: Willy Tarreau Date: Tue Mar 31 11:40:51 2020 +0200 floppy: cleanup: make next_valid_format() not rely on current_drive anymore Now the drive is passed in argument so that the function does not use current_drive anymore. Link: https://lore.kernel.org/r/20200331094054.24441-21-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit c7af70b0fb2535ee3f7165627fc0e73b1934dbfc Author: Willy Tarreau Date: Tue Mar 31 11:40:50 2020 +0200 floppy: cleanup: make check_wp() not rely on current_{fdc,drive} anymore Now the fdc and drive are passed in argument so that the function does not use current_fdc nor current_drive anymore. Link: https://lore.kernel.org/r/20200331094054.24441-20-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 3631a674a2ed7233905c0a7f37f09eeb83aa4d67 Author: Willy Tarreau Date: Tue Mar 31 11:40:49 2020 +0200 floppy: cleanup: make fdc_specify() not rely on current_{fdc,drive} anymore Now the fdc and drive are passed in argument so that the function does not use current_fdc nor current_drive anymore. Link: https://lore.kernel.org/r/20200331094054.24441-19-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit d5da6fa2b892fff23ffd1cb8a04bf618b6072807 Author: Willy Tarreau Date: Tue Mar 31 11:40:48 2020 +0200 floppy: cleanup: make fdc_configure() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-18-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 197c7ffdb8165854e9e2f11a699d2fcca5adbd5a Author: Willy Tarreau Date: Tue Mar 31 11:40:47 2020 +0200 floppy: cleanup: make perpendicular_mode() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. It's worth noting that there's still a single raw_cmd pointer specific to the current fdc. It may make sense to have one per fdc in the future. In addition, cont->done() still relies on the current drive and current raw_cmd. Link: https://lore.kernel.org/r/20200331094054.24441-17-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 3ab12a18209991fa430ea702d5d7d619bbb9ce67 Author: Willy Tarreau Date: Tue Mar 31 11:40:46 2020 +0200 floppy: cleanup: make need_more_output() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-16-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 96dad77a6506ceb31eb520f97fbb5c82054f0a73 Author: Willy Tarreau Date: Tue Mar 31 11:40:45 2020 +0200 floppy: cleanup: make result() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. It's worth noting that there's still a single reply_buffer[] which will store the result for the current fdc. It may or may not make sense to implement one buffer per fdc in the future. Link: https://lore.kernel.org/r/20200331094054.24441-15-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit f8a8e0f7a8941bfe105af7a1150c9f6a73ca253d Author: Willy Tarreau Date: Tue Mar 31 11:40:44 2020 +0200 floppy: cleanup: make output_byte() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-14-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 5ea00bfc52f428cab828623e2d7084118c25d54b Author: Willy Tarreau Date: Tue Mar 31 11:40:43 2020 +0200 floppy: cleanup: make wait_til_ready() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-13-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 6d494ed03766ead1b180463380511fed9ac779d9 Author: Willy Tarreau Date: Tue Mar 31 11:40:42 2020 +0200 floppy: cleanup: make show_floppy() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-12-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit f3e0dc1d8b71fa0bdd3a8e24bb129978567fefbb Author: Willy Tarreau Date: Tue Mar 31 11:40:41 2020 +0200 floppy: cleanup: make reset_fdc_info() not rely on current_fdc anymore Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-11-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit c1f710b5fe8c18d0c2be4514bf509e1a4203ce08 Author: Willy Tarreau Date: Tue Mar 31 11:40:40 2020 +0200 floppy: cleanup: make twaddle() not rely on current_{fdc,drive} anymore Now the fdc and drive are passed in argument so that the function does not use current_fdc nor current_drive anymore. Link: https://lore.kernel.org/r/20200331094054.24441-10-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 38ede90831c7f3e931b58c2b2790d02d5d061592 Author: Willy Tarreau Date: Tue Mar 31 11:40:39 2020 +0200 floppy: use symbolic register names in the x86 port Now we can use FD_STATUS and FD_DATA instead of 4 or 5, let's do this, and also use STATUS_DMA and STATUS_READY for the status bits. Link: https://lore.kernel.org/r/20200331094054.24441-9-w@1wt.eu Cc: x86@kernel.org Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 6cb7e69671843c6f10fd25fc93eecadd4d52ac37 Author: Willy Tarreau Date: Tue Mar 31 11:40:38 2020 +0200 floppy: use symbolic register names in the sparc64 port Now by splitting the base address from the register index we can use the symbolic register names instead of the hard-coded numeric values. Link: https://lore.kernel.org/r/20200331094054.24441-8-w@1wt.eu Cc: "David S. Miller" [willy: fix printk warnings s/%lx/%x/g in sun_82077_fd_{inb,outb}()] Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 6d362018c66a0ad13117357422e39a8821a812ad Author: Willy Tarreau Date: Tue Mar 31 11:40:37 2020 +0200 floppy: use symbolic register names in the sparc32 port The sparc port used to be forced to rely on numeric register indexes with their equivalent in comments. Now that they don't depend on the IO port we can use their symbolic names. Link: https://lore.kernel.org/r/20200331094054.24441-7-w@1wt.eu Cc: "David S. Miller" Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 7fd346318847aa967593b25153ccbeb6cfe1daf1 Author: Willy Tarreau Date: Tue Mar 31 11:40:36 2020 +0200 floppy: use symbolic register names in the powerpc port Now we can use FD_STATUS and FD_DATA instead of 4 or 5, let's do this, and also use STATUS_DMA and STATUS_READY for the status bits. Link: https://lore.kernel.org/r/20200331094054.24441-6-w@1wt.eu Cc: Benjamin Herrenschmidt Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 40b7d1b69093b3592ba8b877369d371d65ab7059 Author: Willy Tarreau Date: Tue Mar 31 11:40:35 2020 +0200 floppy: use symbolic register names in the parisc port Now we can use FD_STATUS and FD_DATA instead of 4 or 5, let's do this, and also use STATUS_DMA and STATUS_READY for the status bits. Link: https://lore.kernel.org/r/20200331094054.24441-5-w@1wt.eu Cc: Helge Deller Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 76373fc666a1c62d422f5e6fc9e4927877934045 Author: Willy Tarreau Date: Tue Mar 31 11:40:34 2020 +0200 floppy: use symbolic register names in the m68k port Now we can use FD_STATUS and FD_DATA instead of 4 or 5, let's do this, and also use STATUS_DMA and STATUS_READY for the status bits. Link: https://lore.kernel.org/r/20200331094054.24441-4-w@1wt.eu Cc: Geert Uytterhoeven Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 7d33850abdb9048c6aa421440a64905eb4ad07a2 Author: Willy Tarreau Date: Tue Mar 31 11:40:33 2020 +0200 floppy: add references to 82077's extra registers This controller provides extra status registers SRA and SRB as well as a tape drive register (TDR) and a data rate select register (DSR), which are referenced in the sparc port, so let's have their symbolic definitions centralized. Link: https://lore.kernel.org/r/20200331094054.24441-3-w@1wt.eu Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit e72e8bf1c9847a12de74f2fd3ea1f5511866526b Author: Willy Tarreau Date: Tue Mar 31 11:40:32 2020 +0200 floppy: split the base port from the register in I/O accesses Currently we have architecture-specific fd_inb() and fd_outb() functions or macros, taking just a port which is in fact made of a base address and a register. The base address is FDC-specific and derived from the local or global "fdc" variable through the FD_IOPORT macro used in the base address calculation. This change splits this by explicitly passing the FDC's base address and the register separately to fd_outb() and fd_inb(). It affects the following archs: - x86, alpha, mips, powerpc, parisc, arm, m68k: simple remap of port -> base+reg - sparc32: use of reg only, since the base address was already masked out and the FDC controller is known from a static struct. - sparc64: like x86 for PCI, like sparc32 for 82077 Some archs use inline functions and others macros. This was not unified in order to minimize the number of changes to review. For the same reason checkpatch still spews a few warnings about things that were already there before. The parisc still uses hard-coded register values and could be cleaned up by taking the register definitions. The sparc per-controller inb/outb functions could further be refined to explicitly take an FDC register instead of a port in argument but it was not needed yet and may be cleaned later. Link: https://lore.kernel.org/r/20200331094054.24441-2-w@1wt.eu Cc: Ivan Kokshaysky Cc: Richard Henderson Cc: Matt Turner Cc: Ian Molton Cc: Russell King Cc: Geert Uytterhoeven Cc: Thomas Bogendoerfer Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: "David S. Miller" Cc: x86@kernel.org Signed-off-by: Willy Tarreau Signed-off-by: Denis Efremov commit 7a0ad546847a23f92f5e227fa8e4578eaa3a8d0a Author: Kees Cook Date: Mon May 4 19:41:30 2020 -0700 pstore: Refactor pstorefs record list removal The "unlink" handling should perform list removal (which can also make sure records don't get double-erased), and the "evict" handling should be responsible only for memory freeing. Link: https://lore.kernel.org/lkml/20200506152114.50375-8-keescook@chromium.org/ Signed-off-by: Kees Cook commit 6248a0666c8a408dcc5bd952536274d5bd0f02cb Author: Kees Cook Date: Mon May 4 19:33:54 2020 -0700 pstore: Add proper unregister lock checking The pstore backend lock wasn't being used during pstore_unregister(). Add sanity check and locking. Link: https://lore.kernel.org/lkml/20200506152114.50375-7-keescook@chromium.org/ Signed-off-by: Kees Cook commit 39ec7e9b699910792468cf41a179d9930052e8ff Author: Lubomir Rintel Date: Mon May 11 23:01:32 2020 +0200 ASoC: mmp-sspa: Set appropriate bus format for given bit width The values set by set_dai_fmt() and hw_params() seem to be tailored only for 32-bit formats. Negotiate the correct ones in hw_params() callback instead. This was essentially copied from the OLPC kernel driver and tested to fix wrong audio output for non-32bit formats. The documentation is not available. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-10-lkundrak@v3.sk Signed-off-by: Mark Brown commit 7d98cc648253c362ebfc582b11095a0e3f001896 Author: Lubomir Rintel Date: Mon May 11 23:01:31 2020 +0200 ASoC: mmp-sspa: Add support for the runtime power management Only turn on the Audio island when it's in use. This requires keeping track of control register contents instead of reloading them back from hardware, because they're lost when the power is off. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-9-lkundrak@v3.sk Signed-off-by: Mark Brown commit 8ecdcac8792b6787ecb2341d25cb82165cf0129d Author: Lubomir Rintel Date: Mon May 11 23:01:30 2020 +0200 ASoC: mmp-sspa: Prepare/unprepare the clocks The driver enables the clocks without preparing them and disables without unpreparing afterwards. Fix that. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-8-lkundrak@v3.sk Signed-off-by: Mark Brown commit 3c4e89df3b45348dc0ee01a2ef1be710f7424ff7 Author: Lubomir Rintel Date: Mon May 11 23:01:29 2020 +0200 ASoC: mmp-sspa: Remove the embedded struct ssp_device The "serial port" it represents is actually a SPI controller -- it's not clear why would the audio serial interface embed it. We're only using the mmio_base and clk fields. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-7-lkundrak@v3.sk Signed-off-by: Mark Brown commit 724da05378ba7af6e273451a2c3f565a3315a9db Author: Lubomir Rintel Date: Mon May 11 23:01:28 2020 +0200 ASoC: mmp-sspa: Add support for soc-generic-dmaengine-pcm This makes the driver usable with the mmp_tdma drier via soc-generic-dmaengine-pcm. This is conditionalized on DT node (support for DT is added by a later patch). A custom mmap callback that creates a NC mapping is used instead of the default WC one, because with write-combining some bytes don't seem to make it through for reasons unknown to me. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-6-lkundrak@v3.sk Signed-off-by: Mark Brown commit c9aeda1c94973f835b3d1b6c785a414caaf935c3 Author: Lubomir Rintel Date: Mon May 11 23:01:27 2020 +0200 ASoC: mmp-sspa: Get rid of dma_params and phys_base This makes things simpler. There's no reason not to just embed the struct snd_dmaengine_dai_dma_data in struct sspa_priv and do away with an unnecessary kmalloc(). While at that, we can initialize the snd_dmaengine_dai_dma_data structures earlier. Let's also stop offsetting the source/destination of the DMA transfer by phys_base. Firstly, it's never set and is always zero. Secondly, the hardware actually ignores it, at least on a MMP2 and MMP3. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-5-lkundrak@v3.sk Signed-off-by: Mark Brown commit e0b9024d2c8851b18b953823204278602bf73086 Author: Lubomir Rintel Date: Mon May 11 23:01:26 2020 +0200 ASoC: mmp-sspa: A trivial typo fix "Transmit", not "Tansmit". Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-4-lkundrak@v3.sk Signed-off-by: Mark Brown commit 03990fd58d2b7c8f7d53e514ba9b8749fac260f9 Author: Christophe JAILLET Date: Tue May 12 15:43:25 2020 +0200 ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()' If an error occurs after the call to 'omap_mcbsp_init()', the reference to 'mcbsp->fclk' must be decremented, as already done in the remove function. This can be achieved easily by using the devm_ variant of 'clk_get()' when the reference is taken in 'omap_mcbsp_init()' This fixes the leak in the probe and has the side effect to simplify both the error handling path of 'omap_mcbsp_init()' and the remove function. Signed-off-by: Christophe JAILLET Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200512134325.252073-1-christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit cc2d025a81a9f9ed4d05f4f65f43a183d6f18c0c Author: Cezary Rojewski Date: Wed May 6 23:21:14 2020 +0200 ASoC: Intel: Skylake: Update description for HDaudio kconfig With 'ASoC: Intel: Skylake: Fix HDaudio and Dmic' series applied, warning is no longer true. Remove it and update the description. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20200506212114.8502-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit ab436c974e08d9254999d7a84d86b1d4c1749230 Author: Johan Jonker Date: Thu May 7 13:32:38 2020 +0200 ASoC: rockchip-i2s: add description for rk3308 The description below is already in use for rk3308.dtsi, but was somehow never added to a document, so add "rockchip,rk3308-i2s", "rockchip,rk3066-i2s" for i2s nodes on a rk3308 platform to rockchip-i2s.yaml. One of the rk3308 i2s nodes also has a different dma layout, so change that as well. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200507113238.7904-1-jbx6244@gmail.com Signed-off-by: Mark Brown commit 4e8748fcaeec073e3ba794871ce86c545e4f961f Author: Christophe JAILLET Date: Tue May 12 12:07:05 2020 +0200 ASoC: ux500: mop500: Fix some refcounted resources issues There are 2 issues here: - if one of the 'of_parse_phandle' fails, calling 'mop500_of_node_put()' is a no-op because the 'mop500_dai_links' structure has not been initialized yet, so the referenced are not decremented - The reference stored in 'mop500_dai_links[i].codecs' is refcounted only once in the probe and must be decremented only once. Fixes: 39013bd60e79 ("ASoC: Ux500: Dispose of device nodes correctly") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200512100705.246349-1-christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 936b9df7a5c00db92088b3c51316d5f551ee5b2c Author: Gustavo A. R. Silva Date: Mon May 11 12:46:47 2020 -0500 ASoC: Intel: Skylake: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20200511174647.GA17318@embeddedor Signed-off-by: Mark Brown commit db23491c77207ef6bec2b232238710de4755db6a Author: Kees Cook Date: Mon May 4 19:07:04 2020 -0700 pstore: Convert "records_list" locking to mutex The pstorefs internal list lock doesn't need to be a spinlock and will create problems when trying to access the list in the subsequent patch that will walk the pstorefs records during pstore_unregister(). Change this to a mutex to avoid may_sleep() warnings when unregistering devices. Link: https://lore.kernel.org/lkml/20200506152114.50375-6-keescook@chromium.org/ Signed-off-by: Kees Cook commit 47af61ffb19baa8df2b109582f87f7622fbe85cc Author: Kees Cook Date: Tue May 5 23:32:40 2020 -0700 pstore: Rename "allpstore" to "records_list" The name "allpstore" doesn't carry much meaning, so rename it to what it actually is: the list of all records present in the filesystem. The lock is also renamed accordingly. Link: https://lore.kernel.org/lkml/20200506152114.50375-5-keescook@chromium.org/ Signed-off-by: Kees Cook commit cab12fd049380b1d0c3ac9f534407a8cc0ac4bba Author: Kees Cook Date: Mon May 4 19:31:36 2020 -0700 pstore: Convert "psinfo" locking to mutex Currently pstore can only have a single backend attached at a time, and it tracks the active backend via "psinfo", under a lock. The locking for this does not need to be a spinlock, and in order to avoid may_sleep() issues during future changes to pstore_unregister(), switch to a mutex instead. Link: https://lore.kernel.org/lkml/20200506152114.50375-4-keescook@chromium.org/ Signed-off-by: Kees Cook commit c30b20cd96a7a08e77c12cb3326c6fd801f7fe87 Author: Kees Cook Date: Tue May 5 23:29:10 2020 -0700 pstore: Rename "pstore_lock" to "psinfo_lock" The name "pstore_lock" sounds very global, but it is only supposed to be used for managing changes to "psinfo", so rename it accordingly. Link: https://lore.kernel.org/lkml/20200506152114.50375-3-keescook@chromium.org/ Signed-off-by: Kees Cook commit e7c1c00cf3fafde7496e31cacd718a51d0e7d70c Author: Kees Cook Date: Mon May 4 19:21:54 2020 -0700 pstore: Drop useless try_module_get() for backend There is no reason to be doing a module get/put in pstore_register(), since the module calling pstore_register() cannot be unloaded since it hasn't finished its initialization. Remove it so there is no confusion about how registration ordering works. Link: https://lore.kernel.org/lkml/20200506152114.50375-2-keescook@chromium.org/ Signed-off-by: Kees Cook commit d33e3d542b6c09a5cb4fa51d82109b2ca92e89c2 Author: Samuel Zou Date: Tue May 12 10:41:11 2020 +0800 ARM: OMAP2+: pm33xx-core: Make am43xx_get_rtc_base_addr static Fix the following sparse warning: arch/arm/mach-omap2/pm33xx-core.c:270:14: warning: symbol 'am43xx_get_rtc_base_addr' was not declared. The am43xx_get_rtc_base_addr has only call site within pm33xx-core.c It should be static Fixes: 8c5a916f4c88 ("ARM: OMAP2+: sleep33/43xx: Add RTC-Mode support") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: Tony Lindgren commit 90d0ce39f8b088a3f227acd79d79b5ccf5a091b3 Author: Ma Feng Date: Mon May 11 20:21:44 2020 +0800 ARM: omap2: make omap5_erratum_workaround_801819 static Fix sparse warning: arch/arm/mach-omap2/omap-smp.c:75:6: warning: symbol 'omap5_erratum_workaround_801819' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Ma Feng Signed-off-by: Tony Lindgren commit 43c4dc3f59e75f3a8b726c4c90cb894c3780e91c Author: Colin Ian King Date: Fri May 8 00:00:40 2020 +0200 media: dvb-frontends: remove redundant initialization of variable status The variable status is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 77d30eab04485a5996feb48d4e07cb72fbaccadb Author: Colin Ian King Date: Thu May 7 23:43:31 2020 +0200 media: mantis_dvb: remove redundant initialization to variable result The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit f933d160b1e71dd8ab3d4e2586b9ff0f584d985c Author: Jia-Ju Bai Date: Thu May 7 12:25:21 2020 +0200 media: usb: ttusb-dec: reduce the number of memory reads in ttusb_dec_handle_irq() In ttusb_dec_handle_irq(), buffer[4] is continuously read from memory three times, without being modified. To reduce the number of memory reads, buffer[4] is first assigned to a local variable index, and then index is used to replace buffer[4]. Signed-off-by: Jia-Ju Bai Reviewed-by: Greg Kroah-Hartman Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 4e054aab8a1f1b43f4c34846b713ad6d8b43c729 Author: Colin Ian King Date: Sat Apr 25 13:22:05 2020 +0200 media: stv0900_core: remove redundant assignment to variable val The variable val is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 1bcecace15d2ebdf8ad039afe8cbd5439894f92f Author: Colin Ian King Date: Fri Apr 24 13:16:00 2020 +0200 media: dvb: remove redundant assignment to variable bw The variable bw is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 1195a28dcf1b297be1653da5472ac5c36dcb34e3 Author: Sean Young Date: Wed May 6 11:54:39 2020 +0200 media: gpio-ir-tx: allow transmission without carrier Some IR protocols do not use a carrier. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit ea8912b788f8144e7d32ee61e5ccba45424bef83 Author: Sean Young Date: Sat May 2 14:50:52 2020 +0200 media: gpio-ir-tx: improve precision of transmitted signal due to scheduling usleep_range() may take longer than the max argument due to scheduling, especially under load. This is causing random errors in the transmitted IR. Remove the usleep_range() in favour of busy-looping with udelay(). Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 7f0f855e6cf32caff83c37adfc1be4ed8d93713c Author: Michal Simek Date: Thu Apr 30 11:31:27 2020 +0200 dt-bindings: vendor-prefixes: Add U-Boot bootloader prefix List U-Boot project in vendor prefixes. For more information take a look at: https://en.wikipedia.org/wiki/Das_U-Boot Source code is available here: https://gitlab.denx.de/u-boot/u-boot Signed-off-by: Michal Simek Reviewed-by: Linus Walleij Signed-off-by: Rob Herring commit d85eaa9411472a99de4b5732cb59c8bae629d5f1 Author: Masami Hiramatsu Date: Thu Mar 26 23:50:11 2020 +0900 samples/kprobes: Add __kprobes and NOKPROBE_SYMBOL() for handlers. Add __kprobes and NOKPROBE_SYMBOL() for sample kprobe handlers. Signed-off-by: Masami Hiramatsu Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.878578033@linutronix.de commit 16db6264c93d2d7df9eb8be5d9eb717ab30105fe Author: Masami Hiramatsu Date: Thu Mar 26 23:50:00 2020 +0900 kprobes: Support NOKPROBE_SYMBOL() in modules Support NOKPROBE_SYMBOL() in modules. NOKPROBE_SYMBOL() records only symbol address in "_kprobe_blacklist" section in the module. Signed-off-by: Masami Hiramatsu Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.771170126@linutronix.de commit 1e6769b0aece51ea7a3dc3117c37d4a5669e4a21 Author: Masami Hiramatsu Date: Thu Mar 26 23:49:48 2020 +0900 kprobes: Support __kprobes blacklist in modules Support __kprobes attribute for blacklist functions in modules. The __kprobes attribute functions are stored in .kprobes.text section. Signed-off-by: Masami Hiramatsu Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.678201813@linutronix.de commit 4fdd88877e5259dcc5e504dca449acc0324d71b9 Author: Masami Hiramatsu Date: Thu Mar 26 23:49:36 2020 +0900 kprobes: Lock kprobe_mutex while showing kprobe_blacklist Lock kprobe_mutex while showing kprobe_blacklist to prevent updating the kprobe_blacklist. Signed-off-by: Masami Hiramatsu Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134059.571125195@linutronix.de commit 132a0eb0324025bb4691ee590996dbe302159298 Merge: 66c705d07d78 74fcfde748b2 Author: Mark Brown Date: Tue May 12 16:12:47 2020 +0100 Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8 commit 2a0a24ebb499c9d499eea948d3fc108f936e36d4 Author: Thomas Gleixner Date: Fri Mar 27 12:42:00 2020 +0100 sched: Make scheduler_ipi inline Now that the scheduler IPI is trivial and simple again there is no point to have the little function out of line. This simplifies the effort of constraining the instrumentation nicely. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134058.453581595@linutronix.de commit 90b5363acd4739769c3f38c1aff16171bd133e8c Author: Peter Zijlstra (Intel) Date: Fri Mar 27 11:44:56 2020 +0100 sched: Clean up scheduler_ipi() The scheduler IPI has grown weird and wonderful over the years, time for spring cleaning. Move all the non-trivial stuff out of it and into a regular smp function call IPI. This then reduces the schedule_ipi() to most of it's former NOP glory and ensures to keep the interrupt vector lean and mean. Aside of that avoiding the full irq_enter() in the x86 IPI implementation is incorrect as scheduler_ipi() can be instrumented. To work around that scheduler_ipi() had an irq_enter/exit() hack when heavy work was pending. This is gone now. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/20200505134058.361859938@linutronix.de commit 0e06a071dce75434d4b95036d0958ae8c11b9a29 Author: Hans Verkuil Date: Thu May 7 17:12:53 2020 +0200 media: v4l: document VIDIOC_SUBDEV_QUERYCAP Add documentation for the new VIDIOC_SUBDEV_QUERYCAP ioctl. Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 6446ec6cbf46483737e832cd6050885fa8eb87fa Author: Hans Verkuil Date: Thu May 7 17:12:52 2020 +0200 media: v4l2-subdev: add VIDIOC_SUBDEV_QUERYCAP ioctl While normal video/radio/vbi/swradio nodes have a proper QUERYCAP ioctl that apps can call to determine that it is indeed a V4L2 device, there is currently no equivalent for v4l-subdev nodes. Adding this ioctl will solve that, and it will allow utilities like v4l2-compliance to be used with these devices as well. SUBDEV_QUERYCAP currently returns the version and capabilities of the subdevice. Define a capability flag to report if the subdevice is registered in read-only mode. Signed-off-by: Hans Verkuil Signed-off-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit fb15db8c0060e73317a7872986b909343504eb84 Author: Jacopo Mondi Date: Thu May 7 17:12:51 2020 +0200 media: v4l2-subdev: Guard whole fops and ioctl hdlr A sub-device device node can be registered in user space only if the CONFIG_VIDEO_V4L2_SUBDEV_API Kconfig option is selected. Currently the open/close file operations and the ioctl handler have some parts of their implementations guarded by #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API), while they are actually not accessible without a video device node registered to user space. Guard the whole open, close and ioctl handler and provide stubs if the VIDEO_V4L2_SUBDEV_API Kconfig option is not selected. This slightly reduces the kernel size when the option is not selected and simplifies the file ops and ioctl implementations. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f75c431e54e2e43c91fe267097b974ff2e5dc668 Author: Jacopo Mondi Date: Thu May 7 17:12:50 2020 +0200 media: v4l2-dev: Add v4l2_device_register_ro_subdev_node() Add to the V4L2 core a function to register device nodes for video subdevices in read-only mode. Registering a device node in read-only mode is useful to expose to userspace the current sub-device configuration, without allowing application to change it by using the V4L2 subdevice ioctls. Acked-by: Sakari Ailus Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3fb0ee8b3b79ee9c8fb7769bdf802bffeae7e085 Author: Jacopo Mondi Date: Thu May 7 17:12:49 2020 +0200 media: Documentation: media: Document read-only subdevice Document a new kAPI function to register subdev device nodes in read only mode and for each affected ioctl report how access is restricted. Acked-by: Sakari Ailus Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 18200e9e243d9095be953cf09cba29f9b3b5f262 Author: Jacopo Mondi Date: Thu May 7 17:12:48 2020 +0200 media: Documentation: media: Update sub-device API intro Update the V4L2 sub-device userspace API introduction to provide more details on why complex devices might want to register devnodes for the connected subdevices. Acked-by: Sakari Ailus Suggested-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b1eac5f32c0fd7ef356f9f42b5990915ee59900b Author: Kunihiko Hayashi Date: Thu Apr 30 12:05:34 2020 +0900 dt-bindings: thermal: Convert UniPhier thermal monitor to json-schema Convert the UniPhier thermal monitor binding to DT schema format. Signed-off-by: Kunihiko Hayashi Signed-off-by: Rob Herring commit dd950f16b10df55c16c98106726978b236c8be54 Author: Hans de Goede Date: Sun May 10 14:20:47 2020 +0200 platform/x86: intel-vbtn: Detect switch position before registering the input-device Setting the initial state of input-device switches must be done before registering the input-device. Otherwise the initial state will get send out as an event as soon as input_sync() gets called. E.g. when undocking a tablet using intel-vbtn to report SW_TABLET_MODE and SW_DOCK before this commit we would get (evemu-record output): E: 0.000001 0005 0005 0001 # EV_SW / SW_DOCK 1 E: 0.000001 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +0ms E: 0.000109 0005 0005 0000 # EV_SW / SW_DOCK 0 E: 0.000109 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +0ms E: 0.000133 0005 0001 0001 # EV_SW / SW_TABLET_MODE 1 E: 0.000133 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +0ms The first SW_DOCK=1 report is spurious, setting the initial switch state before registering the input-device fixes this. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit f913c3086c5078f67c1a6833f6fd1593d8a174fe Author: Hans de Goede Date: Sun May 10 14:20:46 2020 +0200 platform/x86: intel-vbtn: Move detect_tablet_mode() to higher in the file This is a preparation patch for calling detect_tablet_mode() from intel_vbtn_input_setup() without needing a forward declaration. Note this commit makes no functional changes, the moved block of code is completely unchanged. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 10d7ff74b6f2d5e5b38d752a683225c944dd3da9 Author: Hans de Goede Date: Sun May 10 14:24:32 2020 +0200 platform/x86: asus-wmi: Ignore WMI events with code 0x79 On some Asus devices, e.g. the T100TA, when the charger is connected we not only get a WMI event with code 0x58, but immediately after that event we also get an even with code 0x79. This is likely related to these devices having an Asus WMI device with a device-id of 0x00120066, which seems to provide some sort of charger-type info. The T100TA charger over a micro-USB connector, the embedded- controller register read when calling asus_wmi_get_devstate(0x00120066) returns different values when connected to a USB port (max 500mA charging) vs when connected to a 2A capable wall-charger. But the AML code reading this mangles the return value so that we can no longer tell the difference. So for now the meaning of the value return when getting the status of device-id 0x00120066 is unclear. This commit adds a key-mapping of code 0x79 to KE_IGNORE, silencing the kernel logging the following message every time the charger is plugged-in: [ 79.639548] asus_wmi: Unknown key 79 pressed Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit b0dbd97de1f1fd6b3c9a7bb8f7c795bba7e169d8 Author: Hans de Goede Date: Sun May 10 14:24:31 2020 +0200 platform/x86: asus-wmi: Add support for SW_TABLET_MODE On Asus 2-in-1s with a detachable keyboard the Asus WMI interface reports if the tablet is attached to the keyboard or not. Report if the 2-in-1 is in tablet or clamshell mode to userspace by reporting SW_TABLET_MODE events to userspace. This has been tested on a T100TA, T100CHI, T100HA and T200TA. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit fed5003d805c5ea06e146ed8df2b319496765454 Author: Hans de Goede Date: Sun May 10 14:24:30 2020 +0200 platform/x86: asus-wmi: Move asus_wmi_input_init and _exit lower in the file Move the asus_wmi_input_init() and asus_wmi_input_exit() functions to below the WMI helpers, so that further patches in this patch-set can use the WMI helpers inside asus_wmi_input_init() without needing a forward declaration. Note this commit makes no functional changes, the moved block of code is completely unchanged. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 6568d0c07efcc2e786d59c9258ec61f36f4ac483 Author: Colin Ian King Date: Thu May 7 23:04:55 2020 +0100 platform/x86: asus_wmi: remove redundant initialization of variable status The variable status is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Andy Shevchenko commit aab9e7896ec98b2a6b4eeeed71cc666776bb8def Author: Hans de Goede Date: Sat May 9 14:54:49 2020 +0200 platform/x86: asus-nb-wmi: Revert "Do not load on Asus T100TA and T200TA" The WMI INIT method on for some reason turns on the camera LED on these 2-in-1s, without the WMI interface allowing further control over the LED. To fix this commit b5f7311d3a2e ("platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA") added a blacklist with these 2 models on it since the WMI driver did not add any extra functionality to these models. Recently I've been working on making more 2-in-1 models report their tablet-mode (SW_TABLET_MODE) to userspace; and I've found that these 2 Asus models report this through WMI. This commit reverts the adding of the blacklist, so that the Asus WMI driver can be used on these models to report their tablet-mode. Note, not calling INIT is also not an option, because then we will not receive events when the tablet-mode changes. So the LED issue will need to be fixed somewhere else entirely. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 476d60b1b4c8a2b14a53ef9b772058f35e604661 Author: Mattia Dongili Date: Fri May 8 09:14:05 2020 +0900 platform/x86: sony-laptop: Make resuming thermal profile safer The thermal handle object may fail initialization when the module is loaded in the first place. Avoid attempting to use it on resume then. Fixes: 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator") Reported-by: Dominik Mierzejewski Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491 Signed-off-by: Mattia Dongili Signed-off-by: Andy Shevchenko commit 47828d22539f76c8c9dcf2a55f18ea3a8039d8ef Author: Mattia Dongili Date: Fri May 8 09:14:04 2020 +0900 platform/x86: sony-laptop: SNC calls should handle BUFFER types After commit 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator") ACPICA creates buffers even when new fields are small enough to fit into an integer. Many SNC calls counted on the old behaviour. Since sony-laptop already handles the INTEGER/BUFFER case in sony_nc_buffer_call, switch sony_nc_int_call to use its more generic function instead. Fixes: 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator") Reported-by: Dominik Mierzejewski Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491 Reported-by: William Bader Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1830150 Signed-off-by: Mattia Dongili Signed-off-by: Andy Shevchenko commit 3f8ffb14ea172f49d0f089579d9f20fad1bc0744 Merge: 9795a0ddf8ad 1f1755af4f06 Author: Rafael J. Wysocki Date: Tue May 12 16:21:03 2020 +0200 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq updates for v5.8 from Viresh Kumar: "- Build OMAP cpufreq driver by default for ARCH_OMAP2PLUS platform (Anders Roxell). - Fix compatible bindings for qcom cpufreq driver (Ansuel Smith). - Update qoriq cpufreq driver to automatically loaded when built as module and related changes (Mian Yousaf Kaukab and Geert Uytterhoeven). - Add support for r8a7742 to cpufreq-dt platform driver (Lad Prabhakar). - Add support for i.MX7ULP to imx cpufreq driver (Peng Fan)." * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: qoriq: Add platform dependencies clk: qoriq: add cpufreq platform device cpufreq: qoriq: convert to a platform driver cpufreq: qcom: fix wrong compatible binding cpufreq: imx-cpufreq-dt: support i.MX7ULP cpufreq: dt: Add support for r8a7742 cpufreq: Add i.MX7ULP to cpufreq-dt-platdev blacklist cpufreq: omap: Build driver by default for ARCH_OMAP2PLUS commit 7e32a9dac9926241d56851e1517c9391d39fb48e Author: Uros Bizjak Date: Fri May 8 11:22:47 2020 +0200 x86/cpu: Use INVPCID mnemonic in invpcid.h The current minimum required version of binutils is 2.23, which supports the INVPCID instruction mnemonic. Replace the byte-wise specification of INVPCID with the proper mnemonic. [ bp: Add symbolic operand names for increased readability and flip their order like the insn expects them for the AT&T syntax. ] Signed-off-by: Uros Bizjak Signed-off-by: Borislav Petkov Reviewed-by: H. Peter Anvin (Intel) Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200508092247.132147-1-ubizjak@gmail.com Signed-off-by: Borislav Petkov commit 74fcfde748b26c68a8ab2791d9d73f698f7752d1 Author: Lubomir Rintel Date: Mon May 11 23:01:25 2020 +0200 ASoC: mmp-sspa: Drop S20_3LE case It does nothing, because the corresponding bit s not flipped on in .formats and the audio SRAM DMA engine is not able to handle 20-bit transfers anyway. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-3-lkundrak@v3.sk Signed-off-by: Mark Brown commit 00a1aca23e71d83454485d55b5af32c5b367c99f Author: Lubomir Rintel Date: Mon May 11 23:01:24 2020 +0200 ASoC: mmp-sspa: Flip SNDRV_PCM_FMTBIT_S24_3LE on The hw_params() callback handles the 3-byte format, not SNDRV_PCM_FMTBIT_S24_LE. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200511210134.1224532-2-lkundrak@v3.sk Signed-off-by: Mark Brown commit 6c47660e3c3acad9401f8fe1d288d4234f05549c Author: Amadeusz Sławiński Date: Thu May 7 09:34:05 2020 -0400 ASoC: Intel: Use readq to read 64 bit registers In order to fix issue described in: "ASoC: Intel: sst: ipc command timeout" https://patchwork.kernel.org/patch/11482829/ use readq function, which is meant to read 64 bit values from registers. On 32 bit platforms it falls back to two readl calls. Reported-by: Brent Lu Signed-off-by: Amadeusz Sławiński Tested-by: Brent Lu Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20200507133405.32251-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 6a5d6fd332624e4eee9a450bb3d18f761548822f Author: Amadeusz Sławiński Date: Thu May 7 09:34:04 2020 -0400 ASoC: Intel: baytrail: Fix register access Baytrail has 64 bit registers, so we should use *read64* to read from it and then use proper mask values to check status. Signed-off-by: Amadeusz Sławiński Tested-by: Brent Lu Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20200507133405.32251-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit c4f333b758ab4d8d4bc643e8bddac96082e0c379 Author: Dafna Hirschfeld Date: Wed May 6 12:14:24 2020 +0200 pinctrl: rockchip: return ENOMEM instead of EINVAL if allocation fails The function rockchip_pinctrl_parse_dt returns -EINVAL if allocation fails. Change the return error to -ENOMEM Signed-off-by: Dafna Hirschfeld Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20200506101424.15691-1-dafna.hirschfeld@collabora.com Signed-off-by: Linus Walleij commit 914a1951d88968371c7d43400c9d936382cd7d69 Author: Gustavo A. R. Silva Date: Thu May 7 14:05:44 2020 -0500 PCI: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these as a flexible array member [1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that dynamic memory allocations won't be affected by this change: Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero. [1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type [1]. There are some instances of code in which the sizeof() operator is being incorrectly/erroneously applied to zero-length arrays, and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/20200507190544.GA15633@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Bjorn Helgaas commit 0584bff09629666eea97c7ac428e55b00df211f5 Author: Aman Sharma Date: Thu Mar 12 00:49:02 2020 +0530 PCI: Check for platform_get_irq() failure consistently The platform_get_irq*() interfaces return either a negative error number or a valid IRQ. 0 is not a valid return value, so check for "< 0" to detect failure as recommended by the function documentation. On failure, return the error number from platform_get_irq*() instead of making up a new one. Link: https://lore.kernel.org/r/cover.1583952275.git.amanharitsh123@gmail.com [bhelgaas: commit log, squash into one patch] Signed-off-by: Aman Sharma Signed-off-by: Bjorn Helgaas Acked-by: Linus Walleij Cc: Richard Zhu Cc: Lucas Stach Cc: Thierry Reding Cc: Karthikeyan Mitran Cc: Hou Zhiqiang Cc: Thomas Petazzoni Cc: Ryder Lee Cc: Marc Gonzalez commit a85a6c86c25be2d2a5f9c31491f612ce0edc7869 Author: Bjorn Helgaas Date: Mon Mar 16 16:43:38 2020 -0500 driver core: platform: Clarify that IRQ 0 is invalid These interfaces return a negative error number or an IRQ: platform_get_irq() platform_get_irq_optional() platform_get_irq_byname() platform_get_irq_byname_optional() The function comments suggest checking for error like this: irq = platform_get_irq(...); if (irq < 0) return irq; which is what most callers (~900 of 1400) do, so it's implicit that IRQ 0 is invalid. But some callers check for "irq <= 0", and it's not obvious from the source that we never return an IRQ 0. Make this more explicit by updating the comments to say that an IRQ number is always non-zero and adding a WARN() if we ever do return zero. If we do return IRQ 0, it likely indicates a bug in the arch-specific parts of platform_get_irq(). Relevant prior discussion at [1, 2]. [1] https://lore.kernel.org/r/Pine.LNX.4.64.0701250940220.25027@woody.linux-foundation.org/ [2] https://lore.kernel.org/r/Pine.LNX.4.64.0701252029570.25027@woody.linux-foundation.org/ Signed-off-by: Bjorn Helgaas Acked-by: Greg Kroah-Hartman Acked-by: Linus Walleij commit 108c31e77594561eb239534fe019d971c1f8fe38 Author: Bernard Zhao Date: Tue May 12 05:31:49 2020 -0700 memory: samsung: exynos5422-dmc: Reduce protected code area in IRQ handler Speed-up a bit this IRQ processing as there is no need to protect return value or printing. Signed-off-by: Bernard Zhao Acked-by: Lukasz Luba Signed-off-by: Krzysztof Kozlowski commit c7acd6fe8a2881771f2cb374b36d17b5109abbde Author: Arnd Bergmann Date: Tue May 5 16:08:40 2020 +0200 pinctrl: mediatek: add pinctrl-mtk-common-v2 module license Kbuild warns when this file is built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.o see include/linux/module.h for more information Add the missing license/author/description tags. Fixes: 8174a8512e3e ("pinctrl: mediatek: make MediaTek pinctrl v2 driver ready for buidling loadable module") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200505140848.554957-1-arnd@arndb.de Signed-off-by: Linus Walleij commit 9a0f1341df7d555eb50a826d1f6f4191a78eabea Author: Paul Cercueil Date: Sun May 3 18:45:49 2020 +0200 pinctrl: ingenic: Add irq_{request,release}_resources callbacks These are called when a GPIO is to be used as IRQ. Without these custom callbacks, when an interrupt is requested directly and not through gpiod_to_irq(), the request fails because the GPIO is not necesarily in input mode. These callbacks simply enforce that the requested GPIO is in input mode. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200503164549.163884-1-paul@crapouillou.net Signed-off-by: Linus Walleij commit 3a88d7c5c9448d24785ce862334bde2d5dc39aca Author: Will Deacon Date: Tue May 12 12:45:40 2020 +0100 arm64: kconfig: Update and comment GCC version check for kernel BTI Some versions of GCC are known to suffer from a BTI code generation bug, meaning that CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI cannot be solely used to determine whether or not we can compile with kernel with BTI enabled. Update the BTI Kconfig entry to refer to the relevant GCC bugzilla entry (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697) and update the check now that the fix has been merged into GCC release 10.1. Acked-by: Mark Brown Signed-off-by: Will Deacon commit 73e28cc40bf00b5d168cb8f5cff1ae63e9097446 Author: Chris Wilson Date: Sat May 9 12:52:17 2020 +0100 drm/i915: Handle idling during i915_gem_evict_something busy loops i915_gem_evict_something() is charged with finding a slot within the GTT that we may reuse. Since our goal is not to stall, we first look for a slot that only overlaps idle vma. To this end, on the first pass we move any active vma to the end of the search list. However, we only stopped moving active vma after we see the first active vma twice. If during the search, that first active vma completed, we would not notice and keep on extending the search list. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1746 Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex") Fixes: b1e3177bd1d8 ("drm/i915: Coordinate i915_active with its own mutex") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.5+ Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200509115217.26853-1-chris@chris-wilson.co.uk commit 761e9f4f80a21a4b845097027030bef863001636 Author: Wei Yongjun Date: Thu Apr 30 07:31:45 2020 +0000 drm/mcde: dsi: Fix return value check in mcde_dsi_bind() The of_drm_find_bridge() function returns NULL on error, it doesn't return error pointers so this check doesn't work. Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE") Signed-off-by: Wei Yongjun Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200430073145.52321-1-weiyongjun1@huawei.com commit 8068071c09e546e6c13e728da0531b56917802e7 Author: Rikard Falkeborn Date: Sat Apr 25 22:38:13 2020 +0200 pinctrl: rk805: Constify rk805_gpio_cfgs Mark pin_cfg as const, allowing the compiler to put the struct in .rodata instead of .data. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200425203813.6442-1-rikard.falkeborn@gmail.com Signed-off-by: Linus Walleij commit 2fd6cbf41aa9c76c8ce6e63bbbdebc0ce0c5d49f Author: Russell King Date: Wed May 6 10:36:43 2020 +0100 i2c: pxa: use master-abort for device probes Use master-abort to send the stop condition after an address cycle rather than resetting the controller. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit e81c979f4e071d516aa27cf5a0c3939da00dc1ca Author: Russell King Date: Wed May 6 10:36:38 2020 +0100 i2c: pxa: clear all master action bits in i2c_pxa_stop_message() If we timeout during a message transfer, the control register may contain bits that cause an action to be set. Read-modify-writing the register leaving these bits set may trigger the hardware to attempt one of these actions unintentionally. Always clear these bits when cleaning up after a message or after a timeout. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 18d30c0946f912cdb86ab0417661eccda6342375 Author: Russell King Date: Mon May 11 22:10:42 2020 +0100 i2c: pxa: remove some unnecessary debug Remove unnecessary show_state() in the loop inside i2c_pxa_pio_set_master(), which can be unnecessarily verbose. Remove the i2c_pxa_scream_blue_murder() in i2c_pxa_pio_xfer(), which will trigger if we are probing the I2C bus and a slave does not respond; this is a normal event, and not something to report. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit ae1c3b73945cadb59af1cbf31bc8105d2014ef90 Author: Russell King Date: Mon May 11 22:10:37 2020 +0100 i2c: pxa: ensure timeout messages are unique Ensure that the various timeout messages can identify where in the code they were produced from to aid debugging. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit c25e509aef8bc511e245ca441017d00996f09e36 Author: Russell King Date: Mon May 11 22:10:32 2020 +0100 i2c: pxa: avoid complaints with non-responsive slaves Running i2cdetect on a PXA I2C adapter is very noisy; it complains whenever a slave fails to respond to the address cycle. Since it is normal to probe for slaves in this way, we should not fill the kernel log. This is especially true with SFP modules that take a while to respond on the I2C bus, and probing via the I2C bus is the only way to detect that they are ready. Fix this by changing the internal transfer return code from I2C_RETRY to a new NO_SLAVE code (mapped to -ENXIO, as per the I2C documentation for this condition, but we still return -EREMOTEIO to the I2C stack to maintain long established driver behaviour.) Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 0f03c08892ac3c42d93662c8dec86bf74e5d4c9b Author: Russell King Date: Mon May 11 22:10:27 2020 +0100 i2c: pxa: consolidate i2c_pxa_*xfer() implementations Most of i2c_pxa_pio_xfer() and i2c_pxa_xfer() are identical; the only differences are that i2c_pxa_pio_xfer() may reset the bus, and they use different underlying transfer functions. The retry loop is the same. Consolidate these two functions. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 5483ef03e075c1625c66ba728b55ef67f7cb3ed1 Author: Kunihiko Hayashi Date: Fri Apr 24 18:29:22 2020 +0900 spi: Convert UniPhier SPI controller to json-schema Convert UniPhier SPI controller binding to DT schema format. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1587720562-15293-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 66c705d07d784fb6b4622c6e47b6acae357472db Author: Yongbo Zhang Date: Tue May 12 17:30:03 2020 +0800 SoC: rsnd: add interrupt support for SSI BUSIF buffer SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data. This patch adds overflow and underflow interrupt support for SSI BUSIF buffer. Reported-by: Chen Li Signed-off-by: Yongbo Zhang Tested-by: Chen Li Acked-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20200512093003.28332-1-giraffesnn123@gmail.com Signed-off-by: Mark Brown commit ed43f2b4e78069ee02687e5a562e1ecd15cbef4f Merge: 29f9f8e1fc93 7e73aa90a38c Author: Linus Walleij Date: Tue May 12 10:58:36 2020 +0200 Merge tag 'intel-gpio-v5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel intel-gpio for v5.8-1 * MSI support for Intel Merrifield * Refactor gpio-pch to be up-to-date with recent kernel APIs * Miscellaneous cleanups here and there The following is an automated git shortlog grouped by driver: ich: - fix a typo merrifield: - Better show how GPIO and IRQ bases are derived from hardware - Switch over to MSI interrupts pch: - Use in pch_irq_type() macros provided by IRQ core - Refactor pch_irq_type() to avoid unnecessary locking - Get rid of unneeded variable in IRQ handler - Use BIT() and GENMASK() where it's appropriate commit 5bb4e125815aa769a7d2ab7dc203593925bba0ba Author: Pali Rohár Date: Fri May 8 21:51:39 2020 +0200 ipw2x00: Fix comment for CLOCK_BOOTTIME constant Correct name of constant is CLOCK_BOOTTIME and not CLOCK_BOOTIME. Signed-off-by: Pali Rohár Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200508195139.20078-1-pali@kernel.org commit bd7db3021aa7a31f7d5122af1a863e66c75f88f5 Author: Gustavo A. R. Silva Date: Thu May 7 14:26:47 2020 -0500 rndis_wlan: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507192647.GA16710@embeddedor commit 55bb8a2b01a3f1531a5154457ec1c7041f5c6f9e Author: Gustavo A. R. Silva Date: Thu May 7 14:19:26 2020 -0500 qtnfmac: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Sergey Matyukevich Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507191926.GA15970@embeddedor commit 8d7d7a93d5265468a0019f11d0bcd2e005ce9ebd Author: Gustavo A. R. Silva Date: Thu May 7 14:02:10 2020 -0500 prism54: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507190210.GA15375@embeddedor commit 174812346c30321158046d879912c85d638cd1b7 Author: Gustavo A. R. Silva Date: Thu May 7 13:59:14 2020 -0500 mwl8k: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507185914.GA15124@embeddedor commit 8863b1212aab2c738be9526f90389bc0fc18f90f Author: Gustavo A. R. Silva Date: Thu May 7 13:55:29 2020 -0500 iwlegacy: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507185529.GA14639@embeddedor commit e0e05f20c200c41b34294078bbc29d67bfd607ea Author: Gustavo A. R. Silva Date: Thu May 7 13:54:51 2020 -0500 ipw2x00: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507185451.GA14603@embeddedor commit f2cd32a443da694ac4e28fbf4ac6f9d5cc63a539 Author: Gustavo A. R. Silva Date: Tue May 5 18:52:05 2020 -0500 rndis_wlan: Remove logically dead code caps_buf is always of size sizeof(*caps) because sizeof(caps->auth_encr_pair) * 16 is always zero. Notice that when using zero-length arrays, sizeof evaluates to zero[1]. So, the code introduced by commit 0308383f9591 ("rndis_wlan: get max_num_pmkids from device") is logically dead, hence is never executed and can be removed. As a consequence, the rest of the related code can be refactored a bit. Notice that this code has been out there since March 2010. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200505235205.GA18539@embeddedor Link: https://lore.kernel.org/r/20200507110741.37757-1-yanaijie@huawei.com commit 78a6fb42f67c567f80338a9eaec0090678dbd58e Author: Jason Yan Date: Fri May 8 15:43:51 2020 +0800 brcmfmac: remove Comparison to bool in brcmf_p2p_send_action_frame() Fix the following coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1785:5-8: WARNING: Comparison to bool Signed-off-by: Jason Yan Reviewed-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200508074351.19193-1-yanaijie@huawei.com commit 7294ee6f564281bc805496648ec56fce203d8ee4 Author: Chen Zhou Date: Fri May 8 09:32:49 2020 +0800 brcmfmac: make non-global functions static Fix sparse warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:2206:5: warning: symbol 'brcmf_p2p_get_conn_idx' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Chen Zhou Reviewed-by: Wright Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200508013249.95196-1-chenzhou10@huawei.com commit 78db077db638b6b7679ebbadda7b19eef65a6720 Author: Soontak Lee Date: Wed May 6 08:03:21 2020 -0500 brcmfmac: Use seq/seq_len and set iv_initialize when plumbing of rxiv in (GTK) keys When plumbing rxiv for (GTK) keys, current code does not use seq/seq_len when present nor set iv_initialized for iovar wsec_key. This could result in missing broadcast traffic after GTK rekey. The fix is setting iv_initialized and using seq/seq_len for iovar wsec_key. Signed-off-by: Soontak Lee Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588770201-54361-4-git-send-email-wright.feng@cypress.com commit 30fb1b2729099a3506222bbeff09a7ed6bca6fb0 Author: Ryohei Kondo Date: Wed May 6 08:03:20 2020 -0500 brcmfmac: use actframe_abort to cancel ongoing action frame The driver sends an action frame down and waits for dwell time to be completed or aborted before sending out the next action frame. Driver issues "scan abort" to cancel the current time slot, but this doesn't have any effect because, we are not using scan engine for sending action frame. Fix is to use "actframe_abort" to cancels the current action frame. Signed-off-by: Ryohei Kondo Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588770201-54361-3-git-send-email-wright.feng@cypress.com commit b46f1546a708588700eb5adad0e69e944a7a000d Author: Jia-Shyr Chuang Date: Wed May 6 08:03:19 2020 -0500 brcmfmac: set security after reiniting interface Host driver parses and sets security params into FW passed by supplicant. This has to be done after reiniting interface in the firmware. Signed-off-by: Jia-Shyr Chuang Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588770201-54361-2-git-send-email-wright.feng@cypress.com commit f5da2a370f2f3885dff6d2d6815be75e60580784 Author: Pramod Prakash Date: Tue May 5 01:51:27 2020 -0500 brcmfmac: fix 802.1d priority to ac mapping for pcie dongles 802.1d defines 0,3 for BE and 1,2 for BK. In pcie dongles, 0 & 3 are mapped to 0 and 1,2 are mapped to 1. This change corrects this mapping, so that BE & BK are given access precedence accordingly by pcie dongles. Signed-off-by: Pramod Prakash Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588661487-21884-3-git-send-email-chi-hsien.lin@cypress.com commit 92072e5fb099136fc3ea8d7a44352c1d4230b8df Author: Saravanan Shanmugham Date: Tue May 5 01:51:26 2020 -0500 brcmfmac: map 802.1d priority to precedence level based on AP WMM params In WLAN, priority among various access categories of traffic is always set by the AP using WMM parameters and this may not always follow the standard 802.1d priority. In this change, priority is adjusted based on the AP WMM params received as part of the Assoc Response and the same is later used to map the priority of all incoming traffic. In a specific scenario where EDCA parameters are configured to be same for all ACs, use the default FW priority definition to avoid queuing packets of all ACs to the same priority queue. This change fixes the following 802.11 certification tests: * 11n - 5.2.31 ACM Bit Conformance test * 11n - 5.2.32 AC Parameter Modification test * 11ac - 5.2.33 TXOP Limit test Signed-off-by: Saravanan Shanmugham Signed-off-by: Justin Li Signed-off-by: Madhan Mohan R Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588661487-21884-2-git-send-email-chi-hsien.lin@cypress.com commit cf9c94456ebafc6d75a834e58dfdc8ae71a3acbc Author: Greg Kroah-Hartman Date: Tue May 12 10:22:44 2020 +0200 Revert "tty: hvc: Fix data abort due to race in hvc_open" This reverts commit e2bd1dcbe1aa34ff5570b3427c530e4332ecf0fe. In discussion on the mailing list, it has been determined that this is not the correct type of fix for this issue. Revert it so that we can do this correctly. Reported-by: Jiri Slaby Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20200428032601.22127-1-rananta@codeaurora.org Cc: Raghavendra Rao Ananta Signed-off-by: Greg Kroah-Hartman commit 0e36587c0832af5df894f5e5fcc45fb5a05cea5b Author: Lad Prabhakar Date: Mon Apr 20 16:49:54 2020 +0100 arm64: dts: renesas: r8a774c0-cat874: Add support for AISTARVISION MIPI Adapter V2.1 This patch adds support for AISTARVISION MIPI Adapter V2.1 board connected to G2E board. Common file aistarvision-mipi-adapter-2.1.dtsi is created which have the camera endpoint nodes for imx219 and ov5645 so that this can be re-used with other G2x platforms. r8a774c0-ek874-mipi-2.1.dts file enables the required VIN/CSI nodes and by default ties ov5645 camera endpoint to CSI2. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/1587397794-11237-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 22235ef34a9745c4964c5aa11d57d5ce0b0117de Author: Nathan Chancellor Date: Tue Apr 28 15:14:19 2020 -0700 MIPS: VDSO: Allow ld.lld to link the VDSO Currently, when linking with ld.lld, this warning pops up: arch/mips/vdso/Makefile:70: MIPS VDSO requires binutils >= 2.25 CONFIG_LD_VERSION is set with scripts/ld-version.sh, which is specific to GNU ld. It returns 0 for ld.lld so CONFIG_MIPS_LD_CAN_LINK_VDSO does not set. ld.lld has a completely different versioning scheme (as it follows LLVM's versioning) and it does not have the issue mentioned in the comment block so it should be allowed to link the VDSO. With this patch, the VDSO successfully links and shows P_MIPS_PC32 in vgettimeofday.o. $ llvm-objdump -Dr arch/mips/vdso/vgettimeofday.o | grep R_MIPS_PC32 00000024: R_MIPS_PC32 _start 000000b0: R_MIPS_PC32 _start 000002bc: R_MIPS_PC32 _start 0000036c: R_MIPS_PC32 _start 00000468: R_MIPS_PC32 _start Reported-by: Dmitry Golovin Signed-off-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/785 Link: https://github.com/llvm/llvm-project/commit/e364e2e9ce50c12eb2bf093560e1a1a8544d455a Signed-off-by: Thomas Bogendoerfer commit 2ff906994b6c2b949c5bf65330a8abb5dde9c8e5 Author: Nathan Chancellor Date: Tue Apr 28 15:14:18 2020 -0700 MIPS: VDSO: Use $(LD) instead of $(CC) to link VDSO Currently, the VDSO is being linked through $(CC). This does not match how the rest of the kernel links objects, which is through the $(LD) variable. When clang is built in a default configuration, it first attempts to use the target triple's default linker then the system's default linker, unless told otherwise through -fuse-ld=... We do not use -fuse-ld= because it can be brittle and we have support for invoking $(LD) directly. See commit fe00e50b2db8c ("ARM: 8858/1: vdso: use $(LD) instead of $(CC) to link VDSO") and commit 691efbedc60d2 ("arm64: vdso: use $(LD) instead of $(CC) to link VDSO") for examples of doing this in the VDSO. Do the same thing here. Replace the custom linking logic with $(cmd_ld) and ldflags-y so that $(LD) is respected. We need to explicitly add two flags to the linker that were implicitly passed by the compiler: -G 0 (which comes from ccflags-vdso) and --eh-frame-hdr. Before this patch (generated by adding '-v' to VDSO_LDFLAGS): /libexec/gcc/mips64-linux/9.3.0/collect2 \ -plugin /libexec/gcc/mips64-linux/9.3.0/liblto_plugin.so \ -plugin-opt=/libexec/gcc/mips64-linux/9.3.0/lto-wrapper \ -plugin-opt=-fresolution=/tmp/ccGEi5Ka.res \ --eh-frame-hdr \ -G 0 \ -EB \ -mips64r2 \ -shared \ -melf64btsmip \ -o arch/mips/vdso/vdso.so.dbg.raw \ -L/lib/gcc/mips64-linux/9.3.0/64 \ -L/lib/gcc/mips64-linux/9.3.0 \ -L/lib/gcc/mips64-linux/9.3.0/../../../../mips64-linux/lib \ -Bsymbolic \ --no-undefined \ -soname=linux-vdso.so.1 \ -EB \ --hash-style=sysv \ --build-id \ -T arch/mips/vdso/vdso.lds \ arch/mips/vdso/elf.o \ arch/mips/vdso/vgettimeofday.o \ arch/mips/vdso/sigreturn.o After this patch: /bin/mips64-linux-ld \ -m elf64btsmip \ -Bsymbolic \ --no-undefined \ -soname=linux-vdso.so.1 \ -EB \ -nostdlib \ -shared \ -G 0 \ --eh-frame-hdr \ --hash-style=sysv \ --build-id \ -T arch/mips/vdso/vdso.lds \ arch/mips/vdso/elf.o \ arch/mips/vdso/vgettimeofday.o arch/mips/vdso/sigreturn.o \ -o arch/mips/vdso/vdso.so.dbg.raw Note that we leave behind -mips64r2. Turns out that ld ignores it (see get_emulation in ld/ldmain.c). This is true of current trunk and 2.23, which is the minimum supported version for the kernel: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/ldmain.c;hb=aa4209e7b679afd74a3860ce25659e71cc4847d5#l593 https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/ldmain.c;hb=a55e30b51bc6227d8d41f707654d0a5620978dcf#l641 Before this patch, LD=ld.lld did nothing: $ llvm-readelf -p.comment arch/mips/vdso/vdso.so.dbg | sed 's/(.*//' String dump of section '.comment': [ 0] ClangBuiltLinux clang version 11.0.0 After this patch, it does: $ llvm-readelf -p.comment arch/mips/vdso/vdso.so.dbg | sed 's/(.*//' String dump of section '.comment': [ 0] Linker: LLD 11.0.0 [ 62] ClangBuiltLinux clang version 11.0.0 Link: https://github.com/ClangBuiltLinux/linux/issues/785 Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit fd9d0ca2cc4f3c26877eb336a7d26d705ff42b8a Author: Nathan Chancellor Date: Tue Apr 28 15:14:17 2020 -0700 MIPS: Unconditionally specify '-EB' or '-EL' This was all done to work around a GCC bug that has been fixed after 4.2. The kernel requires GCC 4.6 or newer so remove all of these hacks and just use the traditional flags. $ mips64-linux-gcc --version | head -n1 mips64-linux-gcc (GCC) 4.6.3 $ mips64-linux-gcc -EB -dM -E -C -x c /dev/null | grep MIPSE #define MIPSEB 1 #define __MIPSEB__ 1 #define _MIPSEB 1 #define __MIPSEB 1 $ mips64-linux-gcc -EL -dM -E -C -x c /dev/null | grep MIPSE #define __MIPSEL__ 1 #define MIPSEL 1 #define _MIPSEL 1 #define __MIPSEL 1 This is necessary when converting the MIPS VDSO to use $(LD) instead of $(CC) to link because the OUTPUT_FORMAT is defaulted to little endian and only flips to big endian when '-EB' is set on the command line. There is no issue currently because the compiler explicitly passes '-EB' or '-EL' to the linker regardless of whether or not it was provided by the user. Passing '-v' to VDSO_LDFLAGS shows: /libexec/gcc/mips64-linux/9.3.0/collect2 ... -EB ... even though '-EB' is nowhere to be found in KBUILD_CFLAGS. The VDSO Makefile already supports getting '-EB' or '-EL' from KBUILD_CFLAGS through a filter directive but '-EB' or '-EL' is not always present. If we do not do this, we will see the following error when compiling for big endian: $ make -j$(nproc) ARCH=mips CROSS_COMPILE=mips64-linux- \ 64r2el_defconfig arch/mips/vdso/ ... mips64-linux-ld: arch/mips/vdso/elf.o: compiled for a big endian system and target is little endian mips64-linux-ld: arch/mips/vdso/elf.o: endianness incompatible with that of the selected emulation mips64-linux-ld: failed to merge target specific data of file arch/mips/vdso/elf.o ... Remove this legacy hack and just use '-EB' and '-EL' unconditionally. Reported-by: Thomas Bogendoerfer Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit e91946d6d93ef6167bd3b1456f163d1585095ea1 Author: Nathan Chancellor Date: Tue Apr 28 15:14:16 2020 -0700 MIPS: VDSO: Move disabling the VDSO logic to Kconfig After commit 9553d16fa671 ("init/kconfig: Add LD_VERSION Kconfig"), we have access to GNU ld's version at configuration time. As a result, we can make it clearer under what configuration circumstances the MIPS VDSO needs to be disabled. This is a prerequisite for getting rid of the MIPS VDSO binutils warning and linking the VDSO when LD is ld.lld. Wrapping the call to ld-ifversion with CONFIG_LD_IS_LLD does not work because the config values are wiped away during 'make clean'. Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit b744b43f79cc758127042e71f9ad7b1afda30f84 Author: Sami Tolvanen Date: Tue Apr 28 15:14:15 2020 -0700 kbuild: add CONFIG_LD_IS_LLD Similarly to the CC_IS_CLANG config, add LD_IS_LLD to avoid GNU ld specific logic such as ld-version or ld-ifversion and gain the ability to select potential features that depend on the linker at configuration time such as LTO. Signed-off-by: Sami Tolvanen Acked-by: Masahiro Yamada [nc: Reword commit message] Signed-off-by: Nathan Chancellor Tested-by: Sedat Dilek Reviewed-by: Sedat Dilek Signed-off-by: Thomas Bogendoerfer commit 104f3d95d8d633ceebcef811c5c7c3ba56bedc7f Author: Gustavo A. R. Silva Date: Thu May 7 10:11:20 2020 -0500 wil6210: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507151120.GA4469@embeddedor commit c8ffcd122760612c1fac45c44d008a3fe8b2cbb4 Author: Wei Yongjun Date: Fri May 8 07:53:23 2020 +0000 ath11k: convert to devm_platform_get_and_ioremap_resource Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Wei Yongjun Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200508075323.81128-1-weiyongjun1@huawei.com commit 52b776fa592178c3dc341a93fec7bc760b38cc15 Author: Colin Ian King Date: Thu May 7 17:43:18 2020 +0100 ath11k: remove redundant initialization of pointer info Pointer info is being assigned twice, once at the start of the function and secondly when it is just about to be accessed. Remove the redundant initialization and keep the original assignment to info that is close to the memcpy that uses it. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507164318.56570-1-colin.king@canonical.com commit 32221df6765b3773ff1af37c77f8531ebc48f246 Author: Arnd Bergmann Date: Sat May 9 14:06:33 2020 +0200 ath10k: fix ath10k_pci struct layout gcc-10 correctly points out a bug with a zero-length array in struct ath10k_pci: drivers/net/wireless/ath/ath10k/ahb.c: In function 'ath10k_ahb_remove': drivers/net/wireless/ath/ath10k/ahb.c:30:9: error: array subscript 0 is outside the bounds of an interior zero-length array 'struct ath10k_ahb[0]' [-Werror=zero-length-bounds] 30 | return &((struct ath10k_pci *)ar->drv_priv)->ahb[0]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/net/wireless/ath/ath10k/ahb.c:13: drivers/net/wireless/ath/ath10k/pci.h:185:20: note: while referencing 'ahb' 185 | struct ath10k_ahb ahb[0]; | ^~~ The last addition to the struct ignored the comments and added new members behind the array that must remain last. Change it to a flexible-array member and move it last again to make it work correctly, prevent the same thing from happening again (all compilers warn about flexible-array members in the middle of a struct) and get it to build without warnings. Fixes: 521fc37be3d8 ("ath10k: Avoid override CE5 configuration for QCA99X0 chipsets") Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200509120707.188595-2-arnd@arndb.de commit 9f12bebd512c560e9e667a6ac3cf0e04d9d7f43e Author: Arnd Bergmann Date: Mon May 11 15:53:35 2020 +0300 ath10k: fix gcc-10 zero-length-bounds warnings gcc-10 started warning about out-of-bounds access for zero-length arrays: In file included from drivers/net/wireless/ath/ath10k/core.h:18, from drivers/net/wireless/ath/ath10k/htt_rx.c:8: drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_htt_rx_tx_fetch_ind': drivers/net/wireless/ath/ath10k/htt.h:1683:17: warning: array subscript 65535 is outside the bounds of an interior zero-length array 'struct htt_tx_fetch_record[0]' [-Wzero-length-bounds] 1683 | return (void *)&ind->records[le16_to_cpu(ind->num_records)]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/ath/ath10k/htt.h:1676:29: note: while referencing 'records' 1676 | struct htt_tx_fetch_record records[0]; | ^~~~~~~ Make records[] a flexible array member to allow this, moving it behind the other zero-length member that is not accessed in a way that gcc warns about. Fixes: 22e6b3bc5d96 ("ath10k: add new htt definitions") Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200509120707.188595-1-arnd@arndb.de commit 103dc3dab295159cb2c5374a0dc499cd3962d49f Author: Gustavo A. R. Silva Date: Thu May 7 10:19:21 2020 -0500 carl9170: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507151921.GA5083@embeddedor commit 78046fabe6e7807a271aad09cde0522d80bd2985 Author: Masahiro Yamada Date: Mon Apr 27 22:49:30 2020 +0900 kbuild: determine the output format of DTC by the target suffix cmd_dtc takes the additional parameter $(2) to select the target format, dtb or yaml. This makes things complicated when it is used with cmd_and_fixdep and if_changed_rule. I actually stumbled on this. See commit 3d4b2238684a ("kbuild: fix DT binding schema rule again to avoid needless rebuilds"). Extract the suffix part of the target instead of passing the parameter. Fortunately, this works for both $(obj)/%.dtb and $(obj)/%.dt.yaml . Signed-off-by: Masahiro Yamada commit 1ca0c2f612116a7159ab11c36b555910f90db338 Author: Masahiro Yamada Date: Mon Apr 27 09:30:19 2020 +0900 kbuild: remove unused AS assignment $(AS) is not used anywhere in the kernel build, hence commit aa824e0c962b ("kbuild: remove AS variable") killed it. Remove the left-over code in arch/{arm,arm64}/Makefile. Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Acked-by: Will Deacon commit ea21e9041404c4cafd63de4762287fb1b7ba357f Author: Masahiro Yamada Date: Sat Apr 25 22:18:10 2020 +0900 kbuild: remove '/' target This notice has been here for a while. Remove it entirely now. Signed-off-by: Masahiro Yamada commit 85e4a889d3e08a39a8ebde594bab06e6fa732903 Author: Masahiro Yamada Date: Thu Apr 23 16:39:15 2020 +0900 Revert "objtool: Skip samples subdirectory" This reverts commit 8728497895794d1f207a836e02dae762ad175d56. samples/ contains only sub-directories. Because OBJECT_FILES_NON_STANDARD does not work recursively, this line has no effect. Signed-off-by: Masahiro Yamada Acked-by: Josh Poimboeuf Acked-by: Sam Ravnborg commit 9a950154668729a472d17b8e307d92e7c60f45f7 Author: Masahiro Yamada Date: Thu Apr 23 23:23:54 2020 +0900 kbuild: use CONFIG_CC_VERSION_TEXT to construct LINUX_COMPILER macro scripts/mkcompile_h runs $(CC) just for getting the version string. Reuse CONFIG_CC_VERSION_TEXT for optimization. For GCC, this slightly changes the version string. I do not think it is a big deal as we do not have the defined format for LINUX_COMPILER. In fact, the recent commit 4dcc9a88448a ("kbuild: mkcompile_h: Include $LD version in /proc/version") added the linker version. Signed-off-by: Masahiro Yamada commit 30a7729771731971839cc969d2a321e6ea7a144b Author: Masahiro Yamada Date: Thu Apr 23 23:23:53 2020 +0900 kbuild: use -MMD instead of -MD to exclude system headers from dependency This omits system headers from the generated header dependency. System headers are not updated unless you upgrade the compiler. Nor do they contain CONFIG options, so fixdep does not need to parse them. Having said that, the effect of this optimization will be quite small because the kernel code generally does not include system headers except . Host programs include a lot of system headers, but there are not so many in the kernel tree. At first, keeping system headers in .*.cmd files might be useful to detect the compiler update, but there is no guarantee that is included from every file. So, I implemented a more reliable way in the previous commit. Signed-off-by: Masahiro Yamada commit 8b59cd81dc5e724eaea283fa6006985891c7bff4 Author: Masahiro Yamada Date: Thu Apr 23 23:23:52 2020 +0900 kbuild: ensure full rebuild when the compiler is updated Commit 21c54b774744 ("kconfig: show compiler version text in the top comment") added the environment variable, CC_VERSION_TEXT in the comment of the top Kconfig file. It can detect the compiler update, and invoke the syncconfig because all environment variables referenced in Kconfig files are recorded in include/config/auto.conf.cmd This commit makes it a CONFIG option in order to ensure the full rebuild when the compiler is updated. This works like follows: include/config/kconfig.h contains "CONFIG_CC_VERSION_TEXT" in the comment block. The top Makefile specifies "-include $(srctree)/include/linux/kconfig.h" to guarantee it is included from all kernel source files. fixdep parses every source file and all headers included from it, searching for words prefixed with "CONFIG_". Then, fixdep finds CONFIG_CC_VERSION_TEXT in include/config/kconfig.h and adds include/config/cc/version/text.h into every .*.cmd file. When the compiler is updated, syncconfig is invoked because init/Kconfig contains the reference to the environment variable CC_VERTION_TEXT. CONFIG_CC_VERSION_TEXT is updated to the new version string, and include/config/cc/version/text.h is touched. In the next rebuild, Make will rebuild every files since the timestamp of include/config/cc/version/text.h is newer than that of target. Signed-off-by: Masahiro Yamada commit e33ae3ed331a5cfa24b2abe483f7f4b27bb99c06 Author: Masahiro Yamada Date: Thu Apr 23 23:23:51 2020 +0900 kbuild: use $(CC_VERSION_TEXT) to evaluate CC_IS_GCC and CC_IS_CLANG The result of '$(CC) --version | head -n 1' has already been computed by the top Makefile, and stored in the environment variable, CC_VERSION_TEXT. 'echo' is cheaper than the two commands $(CC) and 'head' although this optimization is not noticeable level. Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor commit 081b4b54ff6c58be2ffcf09d42e5df8f031eacd0 Author: Masahiro Yamada Date: Sat Apr 25 15:06:40 2020 +0900 unicore32: do not evaluate compiler's library path when cleaning Since commit a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than="), 'make ARCH=unicore32 clean' emits error messages as follows: $ make ARCH=unicore32 clean gcc: error: missing argument to '-Wframe-larger-than=' gcc: error: missing argument to '-Wframe-larger-than=' We do not care compiler flags when cleaning. Use the '=' operator for lazy expansion because we do not use GNU_LIBC_A or GNU_LIBGCC_A when cleaning. Fixes: a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than=") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit dc960bfeedb01cf832c5632ed1f3daed4416b142 Author: Masahiro Yamada Date: Sat Apr 25 14:18:16 2020 +0900 h8300: suppress error messages for 'make clean' 'make ARCH=h8300 clean' emits error messages as follows: $ make ARCH=h8300 clean gcc: error: missing argument to '-Wframe-larger-than=' gcc: error: unrecognized command line option '-mint32' You can suppress the second one by setting the correct CROSS_COMPILE=, but we should not require any compiler for cleaning. Signed-off-by: Masahiro Yamada commit 6632fa8fcabacd75329bd2ea78cba5c43754639a Author: Masahiro Yamada Date: Sat Apr 25 01:15:02 2020 +0900 hexagon: suppress error message for 'make clean' 'make ARCH=hexagon clean' emits an error message as follows: $ make ARCH=hexagon clean gcc: error: unrecognized command line option '-G0' You can suppress it by setting the correct CROSS_COMPILE=, but we should not require any compiler for cleaning. Signed-off-by: Masahiro Yamada Acked-by: Brian Cain commit 7e49afc03212010d0ee27532a75cfeb0125bd868 Author: Masahiro Yamada Date: Sat Apr 18 03:04:55 2020 +0900 um: do not evaluate compiler's library path when cleaning Since commit a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than="), 'make ARCH=um clean' emits an error message as follows: $ make ARCH=um clean gcc: error: missing argument to '-Wframe-larger-than=' We do not care compiler flags when cleaning. Use the '=' operator for lazy expansion because we do not use LDFLAGS_pcap.o or LDFLAGS_vde.o when cleaning. While I was here, I removed the redundant -r option because it already exists in the recipe. Fixes: a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than=") Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor [build] commit 09d5873e4d1f70202314b5fe40160f9b14b9d2d0 Author: Masahiro Yamada Date: Fri Apr 24 14:49:29 2020 +0900 kconfig: allow only 'config', 'comment', and 'if' inside 'choice' The code block surrounded by 'if' ... 'endif' is reduced into if_stmt, which is accepted in the 'choice' context. Therefore, you can write any statements within a choice block by wrapping 'if y' ... 'end'. For example, you can create a menu inside a choice, like follows: ---------------->8---------------- choice prompt "choice" config A bool "A" config B bool "B" if y menu "strange menu" config C bool "C" endmenu endif endchoice ---------------->8---------------- I want to change such a weird structure into a syntax error. In fact, the USB gadget Kconfig had used nested 'choice' for no good reason until commit df8df5e4bc37 ("usb: get rid of 'choice' for legacy gadget drivers") killed it. I think the 'source' inside 'choice' is on the fence. It is at least gramatically sensible as long as the included file contains only bool/tristate configs. However, it makes the code unreadable, and people tend to forget the fact that the file is included from the choice block. Commit 10e5e6c24963 ("usb: gadget: move choice ... endchoice to legacy/Kconfig") got rid of the only usecase. Going forward, you can only use 'config', 'comment', and 'if' inside 'choice'. This also recursively applies to 'if' blocks inside 'choice'. Signed-off-by: Masahiro Yamada commit b7546111a43a0fc75d9de4f7bce2104d6eb9d2b9 Author: Masahiro Yamada Date: Fri Apr 24 14:49:28 2020 +0900 kconfig: tests: remove randconfig test for choice in choice Nesting choice statements does not make any sense. Commit df8df5e4bc37 ("usb: get rid of 'choice' for legacy gadget drivers") got rid of the only usecase. I will turn it into a syntax error. Remove the test in advance. Signed-off-by: Masahiro Yamada commit 644a4b6cecc2ae3a8a840bb3606edd99af94e972 Author: Masahiro Yamada Date: Tue Apr 14 00:35:42 2020 +0900 kconfig: do not assign a variable in the return statement I am not a big fan of doing assignment in a return statement. Split it into two lines. Signed-off-by: Masahiro Yamada commit cfc6eea9f6af84e838e28be57b03be5502c4a02e Author: Masahiro Yamada Date: Tue Apr 14 00:33:20 2020 +0900 kconfig: do not use OR-assignment for zero-cleared structure The simple assignment is enough because memset() three lines above has zero-cleared the structure. Signed-off-by: Masahiro Yamada commit 1454c978efbb57b052670d50023f48c759d704ce Author: Chao Yu Date: Fri May 8 09:16:03 2020 +0800 f2fs: compress: fix zstd data corruption During zstd compression, ZSTD_endStream() may return non-zero value because distination buffer is full, but there is still compressed data remained in intermediate buffer, it means that zstd algorithm can not save at last one block space, let's just writeback raw data instead of compressed one, this can fix data corruption when decompressing incomplete stored compression data. Fixes: 50cfa66f0de0 ("f2fs: compress: support zstd compress algorithm") Signed-off-by: Daeho Jeong Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 9c1223845a37ce09fd498b8c8ed061decff20eda Author: Chao Yu Date: Thu Apr 23 18:03:06 2020 +0800 f2fs: add compressed/gc data read IO stat in order to account data read IOs more accurately. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f3494345ce9999624b36109252a4bf5f00e51a46 Author: Chao Yu Date: Thu Apr 23 17:57:33 2020 +0800 f2fs: fix potential use-after-free issue In error path of f2fs_read_multi_pages(), it should let last referrer release decompress io context memory, otherwise, other referrer will cause use-after-free issue. Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 03382f1aa99f438f8e9dc7562c7368f55ba8f56c Author: Chao Yu Date: Tue Apr 21 19:36:21 2020 +0800 f2fs: compress: don't handle non-compressed data in workqueue If bio has no compressed data, we don't need to handle end_io work in workqueue, instead, it should just let interrupter handle it directly to speed up IO response. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit deaf160f8aa767f1b2cd53f1834c1a4126815631 Author: Colin Ian King Date: Mon Apr 20 23:00:57 2020 +0100 f2fs: remove redundant assignment to variable err The variable err is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b4b10061ef98c583bcf82a4200703fbaa98c18dc Author: Jaegeuk Kim Date: Tue Mar 31 11:43:07 2020 -0700 f2fs: refactor resize_fs to avoid meta updates in progress Sahitya raised an issue: - prevent meta updates while checkpoint is in progress allocate_segment_for_resize() can cause metapage updates if it requires to change the current node/data segments for resizing. Stop these meta updates when there is a checkpoint already in progress to prevent inconsistent CP data. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4fec3fc026717f81e34fca59937b0acbfb05642d Author: Chao Yu Date: Wed Apr 8 19:55:17 2020 +0800 f2fs: use round_up to enhance calculation .i_cluster_size should be power of 2, so we can use round_up() instead of roundup() to enhance the calculation. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c75488fb4d82b697f381f855bf5b16779df440aa Author: Chao Yu Date: Fri Mar 6 14:35:33 2020 +0800 f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS This patch introduces a new ioctl to rollback all compress inode status: - add reserved blocks in dnode blocks - increase i_compr_blocks, i_blocks, total_valid_block_count - remove immutable flag Then compress inode can be restored to support overwrite functionality again. Signee-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 34c061ad85a2f5d5e9e3b045d72f3b211db6e282 Author: Sayali Lokhande Date: Thu Apr 30 16:28:29 2020 +0530 f2fs: Avoid double lock for cp_rwsem during checkpoint There could be a scenario where f2fs_sync_node_pages gets called during checkpoint, which in turn tries to flush inline data and calls iput(). This results in deadlock as iput() tries to hold cp_rwsem, which is already held at the beginning by checkpoint->block_operations(). Call stack : Thread A Thread B f2fs_write_checkpoint() - block_operations(sbi) - f2fs_lock_all(sbi); - down_write(&sbi->cp_rwsem); - open() - igrab() - write() write inline data - unlink() - f2fs_sync_node_pages() - if (is_inline_node(page)) - flush_inline_data() - ilookup() page = f2fs_pagecache_get_page() if (!page) goto iput_out; iput_out: -close() -iput() iput(inode); - f2fs_evict_inode() - f2fs_truncate_blocks() - f2fs_lock_op() - down_read(&sbi->cp_rwsem); Fixes: 2049d4fcb057 ("f2fs: avoid multiple node page writes due to inline_data") Signed-off-by: Sayali Lokhande Signed-off-by: Jaegeuk Kim commit baaa7ebf25c78c5cb712fac16b7f549100beddd3 Author: Konstantin Khlebnikov Date: Mon May 11 09:15:18 2020 +0300 f2fs: report delalloc reserve as non-free in statfs for project quota This reserved space isn't committed yet but cannot be used for allocations. For userspace it has no difference from used space. See the same fix in ext4 commit f06925c73942 ("ext4: report delalloc reserve as non-free in statfs for project quota"). Fixes: ddc34e328d06 ("f2fs: introduce f2fs_statfs_project") Signed-off-by: Konstantin Khlebnikov Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 48abe91ac1ad27cd5a5709f983dcf58f2b9a6b70 Author: YueHaibing Date: Sat May 9 19:21:35 2020 +0800 f2fs: Fix wrong stub helper update_sit_info update_sit_info should be f2fs_update_sit_info, otherwise build fails while no CONFIG_F2FS_STAT_FS. Fixes: fc7100ea2a52 ("f2fs: Add f2fs stats to sysfs") Signed-off-by: YueHaibing Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f6644143c63f2eac88973f7fea087582579b0189 Author: Chao Yu Date: Sat May 9 15:01:04 2020 +0800 f2fs: compress: let lz4 compressor handle output buffer budget properly Commonly, in order to handle lz4 worst compress case, caller should allocate buffer with size of LZ4_compressBound(inputsize) for target compressed data storing, however in this case, if caller didn't allocate enough space, lz4 compressor still can handle output buffer budget properly, and end up compressing when left space in output buffer is not enough. So we don't have to allocate buffer with size for worst case, then we can avoid 2 * 4KB size intermediate buffer allocation when log_cluster_size is 2, and avoid unnecessary compressing work of compressor if we can not save at least 4KB space. Suggested-by: Daeho Jeong Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1f5f11a3c41e2b23288b2769435a00f74e02496b Author: Jaegeuk Kim Date: Fri May 8 12:25:45 2020 -0700 f2fs: remove blk_plugging in block_operations blk_plugging doesn't seem to give any benefit. Signed-off-by: Jaegeuk Kim commit ef8d563f184e1112651f2cbde383d43e599334e8 Author: Chao Yu Date: Fri Mar 6 15:36:09 2020 +0800 f2fs: introduce F2FS_IOC_RELEASE_COMPRESS_BLOCKS There are still reserved blocks on compressed inode, this patch introduce a new ioctl to help release reserved blocks back to filesystem, so that userspace can reuse those freed space. ---- Daeho fixed a bug like below. Now, if writing pages and releasing compress blocks occur simultaneously, and releasing cblocks is executed more than one time to a file, then total block count of filesystem and block count of the file could be incorrect and damaged. We have to execute releasing compress blocks only one time for a file without being interfered by writepages path. --- Signed-off-by: Chao Yu Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit 042be373adf719ab64c4a44ae809d110826becbf Author: Chao Yu Date: Fri May 8 17:50:20 2020 +0800 f2fs: shrink spinlock coverage In f2fs_try_to_free_nids(), .nid_list_lock spinlock critical region will increase as expected shrink number increase, to avoid spining other CPUs for long time, we change to release nid caches with small batch each time under .nid_list_lock coverage. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 84c9c2de0626567c0d964ee5fa1ae3310911ddf8 Author: Eric Biggers Date: Tue May 5 11:41:11 2020 -0700 f2fs: correctly fix the parent inode number during fsync() fsync() may be called on a deleted file that's still open. So when fsync() tries to set the parent inode number when the inode has LOST_PINO and i_nlink == 1 (to avoid later checkpoints), it needs to make sure to get the parent directory via a non-deleted alias. Also remove the unnecessary igrab() and iput(), as the caller already holds a reference to the inode. Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim commit 43c780ba26244e4caf3f9986beb6c4ae5eb54f50 Author: Eric Biggers Date: Thu May 7 00:59:04 2020 -0700 f2fs: rework filename handling Rework f2fs's handling of filenames to use a new 'struct f2fs_filename'. Similar to 'struct ext4_filename', this stores the usr_fname, disk_name, dirhash, crypto_buf, and casefolded name. Some of these names can be NULL in some cases. 'struct f2fs_filename' differs from 'struct fscrypt_name' mainly in that the casefolded name is included. For user-initiated directory operations like lookup() and create(), initialize the f2fs_filename by translating the corresponding fscrypt_name, then computing the dirhash and casefolded name if needed. This makes the dirhash and casefolded name be cached for each syscall, so we don't have to recompute them repeatedly. (Previously, f2fs computed the dirhash once per directory level, and the casefolded name once per directory block.) This improves performance. This rework also makes it much easier to correctly handle all combinations of normal, encrypted, casefolded, and encrypted+casefolded directories. (The fourth isn't supported yet but is being worked on.) The only other cases where an f2fs_filename gets initialized are for two filesystem-internal operations: (1) when converting an inline directory to a regular one, we grab the needed disk_name and hash from an existing f2fs_dir_entry; and (2) when roll-forward recovering a new dentry, we grab the needed disk_name from f2fs_inode::i_name and compute the hash. Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim commit f874fa1c7c7905c1744a2037a11516558ed00a81 Author: Eric Biggers Date: Thu May 7 00:59:03 2020 -0700 f2fs: split f2fs_d_compare() from f2fs_match_name() Sharing f2fs_ci_compare() between comparing cached dentries (f2fs_d_compare()) and comparing on-disk dentries (f2fs_match_name()) doesn't work as well as intended, as these actions fundamentally differ in several ways (e.g. whether the task may sleep, whether the directory is stable, whether the casefolded name was precomputed, whether the dentry will need to be decrypted once we allow casefold+encrypt, etc.) Just make f2fs_d_compare() implement what it needs directly, and rework f2fs_ci_compare() to be specialized for f2fs_match_name(). Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ff5f85c8d62a487bde415ef4c9e2d0be718021df Author: Eric Biggers Date: Thu May 7 00:59:02 2020 -0700 f2fs: don't leak filename in f2fs_try_convert_inline_dir() We need to call fscrypt_free_filename() to free the memory allocated by fscrypt_setup_filename(). Fixes: b06af2aff28b ("f2fs: convert inline_dir early before starting rename") Cc: # v5.6+ Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6d92b201035dfe77426f8814fd5259db385a18b3 Author: Chao Yu Date: Wed Apr 8 19:56:32 2020 +0800 f2fs: compress: support lzo-rle compress algorithm LZO-RLE extension (run length encoding) was introduced to improve performance of LZO algorithm in scenario of data contains many zeros, zram has changed to use this extended algorithm by default, this patch adds to support this algorithm extension, to enable this extension, it needs to enable F2FS_FS_LZO and F2FS_FS_LZORLE config, and specifies "compress_algorithm=lzo-rle" mountoption. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5e6bbde95982300d66d78fb282d4ee39df78fc33 Author: Chao Yu Date: Wed Apr 8 19:56:05 2020 +0800 f2fs: introduce mempool for {,de}compress intermediate page allocation If compression feature is on, in scenario of no enough free memory, page refault ratio is higher than before, the root cause is: - {,de}compression flow needs to allocate intermediate pages to store compressed data in cluster, so during their allocation, vm may reclaim mmaped pages. - if above reclaimed pages belong to compressed cluster, during its refault, it may cause more intermediate pages allocation, result in reclaiming more mmaped pages. So this patch introduces a mempool for intermediate page allocation, in order to avoid high refault ratio, by default, number of preallocated page in pool is 512, user can change the number by assigning 'num_compress_pages' parameter during module initialization. Ma Feng found warnings in the original patch and fixed like below. Fix the following sparse warning: fs/f2fs/compress.c:501:5: warning: symbol 'num_compress_pages' was not declared. Should it be static? fs/f2fs/compress.c:530:6: warning: symbol 'f2fs_compress_free_page' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Chao Yu Signed-off-by: Ma Feng Signed-off-by: Jaegeuk Kim commit 47742bde281b2920aae8bb82ed2d61d890aa4f56 Author: Dan Carpenter Date: Sat May 9 13:04:08 2020 +0300 scsi: scsi_debug: Fix an error handling bug in sdeb_zbc_model_str() This test is checking the wrong variable. It should be testing "res". The "sdeb_zbc_model" variable is an enum (unsigned in this situation) and we never assign negative values to it. [mkp: fixed commit desc issue reported by Doug] Link: https://lore.kernel.org/r/20200509100408.GA5555@mwanda Fixes: 9267e0eb41fe ("scsi: scsi_debug: Add ZBC module parameter") Acked-by: Douglas Gilbert Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit d0dff2ac98dd41d7d451127d9eae2f6478fc40b0 Author: Benjamin Block Date: Fri May 8 19:23:35 2020 +0200 scsi: zfcp: Move allocation of the shost object to after xconf- and xport-data At the moment we allocate and register the Scsi_Host object corresponding to a zfcp adapter (FCP device) very early in the life cycle of the adapter - even before we fully discover and initialize the underlying firmware/hardware. This had the advantage that we could already use the Scsi_Host object, and fill in all its information during said discover and initialize. Due to commit 737eb78e82d5 ("block: Delay default elevator initialization") (first released in v5.4), we noticed a regression that would prevent us from using any storage volume if zfcp is configured with support for DIF or DIX (zfcp.dif=1 || zfcp.dix=1). Doing so would result in an illegal memory access as soon as the first request is sent with such an configuration. As example for a crash resulting from this: scsi host0: scsi_eh_0: sleeping scsi host0: zfcp qdio: 0.0.1900 ZFCP on SC 4bd using AI:1 QEBSM:0 PRI:1 TDD:1 SIGA: W AP scsi 0:0:0:0: scsi scan: INQUIRY pass 1 length 36 Unable to handle kernel pointer dereference in virtual kernel address space Failing address: 0000000000000000 TEID: 0000000000000483 Fault in home space mode while using kernel ASCE. AS:0000000035c7c007 R3:00000001effcc007 S:00000001effd1000 P:000000000000003d Oops: 0004 ilc:3 [#1] PREEMPT SMP DEBUG_PAGEALLOC Modules linked in: ... CPU: 1 PID: 783 Comm: kworker/u760:5 Kdump: loaded Not tainted 5.6.0-rc2-bb-next+ #1 Hardware name: ... Workqueue: scsi_wq_0 fc_scsi_scan_rport [scsi_transport_fc] Krnl PSW : 0704e00180000000 000003ff801fcdae (scsi_queue_rq+0x436/0x740 [scsi_mod]) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3 Krnl GPRS: 0fffffffffffffff 0000000000000000 0000000187150120 0000000000000000 000003ff80223d20 000000000000018e 000000018adc6400 0000000187711000 000003e0062337e8 00000001ae719000 0000000187711000 0000000187150000 00000001ab808100 0000000187150120 000003ff801fcd74 000003e0062336a0 Krnl Code: 000003ff801fcd9e: e310a35c0012 lt %r1,860(%r10) 000003ff801fcda4: a7840010 brc 8,000003ff801fcdc4 #000003ff801fcda8: e310b2900004 lg %r1,656(%r11) >000003ff801fcdae: d71710001000 xc 0(24,%r1),0(%r1) 000003ff801fcdb4: e310b2900004 lg %r1,656(%r11) 000003ff801fcdba: 41201018 la %r2,24(%r1) 000003ff801fcdbe: e32010000024 stg %r2,0(%r1) 000003ff801fcdc4: b904002b lgr %r2,%r11 Call Trace: [<000003ff801fcdae>] scsi_queue_rq+0x436/0x740 [scsi_mod] ([<000003ff801fcd74>] scsi_queue_rq+0x3fc/0x740 [scsi_mod]) [<00000000349c9970>] blk_mq_dispatch_rq_list+0x390/0x680 [<00000000349d1596>] blk_mq_sched_dispatch_requests+0x196/0x1a8 [<00000000349c7a04>] __blk_mq_run_hw_queue+0x144/0x160 [<00000000349c7ab6>] __blk_mq_delay_run_hw_queue+0x96/0x228 [<00000000349c7d5a>] blk_mq_run_hw_queue+0xd2/0xe0 [<00000000349d194a>] blk_mq_sched_insert_request+0x192/0x1d8 [<00000000349c17b8>] blk_execute_rq_nowait+0x80/0x90 [<00000000349c1856>] blk_execute_rq+0x6e/0xb0 [<000003ff801f8ac2>] __scsi_execute+0xe2/0x1f0 [scsi_mod] [<000003ff801fef98>] scsi_probe_and_add_lun+0x358/0x840 [scsi_mod] [<000003ff8020001c>] __scsi_scan_target+0xc4/0x228 [scsi_mod] [<000003ff80200254>] scsi_scan_target+0xd4/0x100 [scsi_mod] [<000003ff802d8b96>] fc_scsi_scan_rport+0x96/0xc0 [scsi_transport_fc] [<0000000034245ce8>] process_one_work+0x458/0x7d0 [<00000000342462a2>] worker_thread+0x242/0x448 [<0000000034250994>] kthread+0x15c/0x170 [<0000000034e1979c>] ret_from_fork+0x30/0x38 INFO: lockdep is turned off. Last Breaking-Event-Address: [<000003ff801fbc36>] scsi_add_cmd_to_list+0x9e/0xa8 [scsi_mod] Kernel panic - not syncing: Fatal exception: panic_on_oops While this issue is exposed by the commit named above, this is only by accident. The real issue exists for longer already - basically since it's possible to use blk-mq via scsi-mq, and blk-mq pre-allocates all requests for a tag-set during initialization of the same. For a given Scsi_Host object this is done when adding the object to the midlayer (`scsi_add_host()` and such). In `scsi_mq_setup_tags()` the midlayer calculates how much memory is required for a single scsi_cmnd, and its additional data, which also might include space for additional protection data - depending on whether the Scsi_Host has any form of protection capabilities (`scsi_host_get_prot()`). The problem is now thus, because zfcp does this step before we actually know whether the firmware/hardware has these capabilities, we don't set any protection capabilities in the Scsi_Host object. And so, no space is allocated for additional protection data for requests in the Scsi_Host tag-set. Once we go through discover and initialize the FCP device firmware/hardware fully (this is done via the firmware commands "Exchange Config Data" and "Exchange Port Data") we find out whether it actually supports DIF and DIX, and we set the corresponding capabilities in the Scsi_Host object (in `zfcp_scsi_set_prot()`). Now the Scsi_Host potentially has protection capabilities, but the already allocated requests in the tag-set don't have any space allocated for that. When we then trigger target scanning or add scsi_devices manually, the midlayer will use requests from that tag-set, and before sending most requests, it will also call `scsi_mq_prep_fn()`. To prepare the scsi_cmnd this function will check again whether the used Scsi_Host has any protection capabilities - and now it potentially has - and if so, it will try to initialize the assumed to be preallocated structures and thus it causes the crash, like shown above. Before delaying the default elevator initialization with the commit named above, we always would also allocate an elevator for any scsi_device before ever sending any requests - in contrast to now, where we do it after device-probing. That elevator in turn would have its own tag-set, and that is initialized after we went through discovery and initialization of the underlying firmware/hardware. So requests from that tag-set can be allocated properly, and if used - unless the user changes/disabled the default elevator - this would hide the underlying issue. To fix this for any configuration - with or without an elevator - we move the allocation and registration of the Scsi_Host object for a given FCP device to after the first complete discovery and initialization of the underlying firmware/hardware. By doing that we can make all basic properties of the Scsi_Host known to the midlayer by the time we call `scsi_add_host()`, including whether we have any protection capabilities. To do that we have to delay all the accesses that we would have done in the past during discovery and initialization, and do them instead once we are finished with it. The previous patches ramp up to this by fencing and factoring out all these accesses, and make it possible to re-do them later on. In addition we make also use of the diagnostic buffers we recently added with commit 92953c6e0aa7 ("scsi: zfcp: signal incomplete or error for sync exchange config/port data") commit 7e418833e689 ("scsi: zfcp: diagnostics buffer caching and use for exchange port data") commit 088210233e6f ("scsi: zfcp: add diagnostics buffer for exchange config data") (first released in v5.5), because these already cache all the information we need for that "re-do operation" - the information cached are always updated during xconf or xport data, so it won't be stale. In addition to the move and re-do, this patch also updates the function-documentation of `zfcp_scsi_adapter_register()` and changes how it reports if a Scsi_Host object already exists. In that case future recovery-operations can skip this step completely and behave much like they would do in the past - zfcp does not release a once allocated Scsi_Host object unless the corresponding FCP device is deconstructed completely. Link: https://lore.kernel.org/r/030dd6da318bbb529f0b5268ec65cebcd20fc0a3.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit 71159b6ecb067565fb41faba616116e8c0fc10ea Author: Benjamin Block Date: Fri May 8 19:23:34 2020 +0200 scsi: zfcp: Fence early sysfs interfaces for accesses of shost objects When setting an adapter online for the first time, we also create a couple of entries for it in the sysfs device tree. This is also true even if the adapter has not yet ever gone successfully through exchange config and exchange port data. When moving the scsi host object allocation and registration to after the first exchange config and exchange port data, this make the `port_rescan` attribute susceptible to invalid pointer-dereferences of the shost field before the adapter is fully initialized. When written to, it schedules a `scan_work` item that will in turn make use of the associated fibre channel host object to check the topology used for this FCP device. Because scanning for remote ports can't be done successfully without completing exchange config and exchange port data first, we can simply fence `port_rescan`, and so prevent the illegal access. As with cases where we can't get a reference to the adapter, we also return -ENODEV here. Applications need to handle that errno today already. After a successful allocation of the scsi host object nothing changes in the work flow. Link: https://lore.kernel.org/r/ef65366d309993ca91b6917727590ca7ca166c8f.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit 971f2abb4ca4095bb4bd7c2ba119d1cca078b433 Author: Benjamin Block Date: Fri May 8 19:23:33 2020 +0200 scsi: zfcp: Fence adapter status propagation for common statuses Common status flags that all main objects - adapter, port, and unit - support are propagated to sub-objects when set or cleared. For instance, when setting the status ZFCP_STATUS_COMMON_ERP_INUSE for an adapter object, we will propagate this to all its child ports and units - same for when clearing a common status flag. Units of an adapter object are enumerated via __shost_for_each_device() over the scsi host object of the corresponding adapter. Once we move the scsi host object allocation and registration to after the first exchange config and exchange port data, this won't be possible for cases where we set or clear common statuses during the very first adapter recovery. But since we won't have any port or unit objects yet at that point of time, we can just fence the status propagation for cases where the scsi host object is not yet set in the adapter object. It won't change any effective status propagations, but will prevent us from dereferencing invalid pointers. For any later point in the work flow the scsi host object will be set and thus nothing is changed then. Link: https://lore.kernel.org/r/f51fe5f236a1e3d1ce53379c308777561bfe35e1.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit ac007adc4d2d9258fdf27abd25cc77a4e0e8d19f Author: Benjamin Block Date: Fri May 8 19:23:32 2020 +0200 scsi: zfcp: Move p-t-p port allocation to after xport data When doing the very first adapter recovery - initialization - for a FCP device in a point-to-point topology we also allocate the port object corresponding to the attached remote port, and trigger a port recovery for it that will run after the adapter recovery finished. Right now this happens right after we finished with the exchange config data command, and uses the fibre channel host object corresponding to the FCP device to determine whether a point-to-point topology is used. When moving the scsi host object allocation and registration - and thus also the fibre channel host object allocation - to after the first exchange config and exchange port data, this use of the fc_host object is not possible anymore at that point in the work flow. But the allocation and recovery trigger doesn't have notable side-effects on the following exchange port data processing, so we can move those to after xport data, and thus also to after the scsi host object allocation, once we move it. Then the fc_host object can be used again, like it is now. For any further adapter recoveries this doesn't change anything, because at that point the port object already exists and recovery is triggered elsewhere for existing port objects. Link: https://lore.kernel.org/r/73e5d4ac21e2b37bf0c3ca8e530bc5a5c6e74f8f.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit 990486f3a8508494dab2a7ff0fcc3eb977557d89 Author: Benjamin Block Date: Fri May 8 19:23:31 2020 +0200 scsi: zfcp: Fence fc_host updates during link-down handling When receiving a notification that a FCP device lost its local link we usually update the fibre channel host object which represents that FCP device to reflect that. This notification/information can also surface when the FCP device is running through adapter recovery (exchange config and exchange port data return incomplete). When moving the scsi host object allocation and registration - and thus also the fibre channel host object allocation - to after the first exchange config and exchange port data, and this happens during the very first adapter recovery, these updates can not be done until after the scsi host object is allocated. Reorder the fc_host updates in zfcp_fsf_fc_host_link_down() so that they only happen after a check of whether the scsi host object is already allocated or not. During the first adapter recovery this will cause the skip of these updates if a link-down condition is detected, but we can repeat them after we allocated the scsi host object, if necessary. For any further link-down handling the only changes in the work flow are the slightly reordered assignments in zfcp_fsf_fc_host_link_down(). Link: https://lore.kernel.org/r/f841f2cda61dcd7b8549910c44e1831927459edf.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit 52e61fde5ec95cb4011784fb0bc6b436e16fcaa8 Author: Benjamin Block Date: Fri May 8 19:23:30 2020 +0200 scsi: zfcp: Move fc_host updates during xport data handling into fenced function When executing exchange port data for a FCP device for the first time, or after an adapter recovery, we update several properties of the fibre channel host object which represents that FCP device. When moving the scsi host object allocation and registration - and thus also the fibre channel host object allocation - to after the first exchange config and exchange port data, this is not possible for the former case. Move all these update into separate, and fenced function that first checks whether the scsi host object already exists or not, before making the updates. During the first ever exchange port data in the adapter life cycle this will make the exchange port data handler skip over this update step, but we can repeat it later, after we allocated the scsi host object. For any further recovery of that adapter the work flow is only changed slightly because then the scsi host object already exists and we don't free it until we release the adapter completely at the end of its life cycle. Link: https://lore.kernel.org/r/ae454c2dc6da0b02907c489af91d0b211d331825.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit bd1684817d7d8d1a3b95a4347166246ad1f7670b Author: Benjamin Block Date: Fri May 8 19:23:29 2020 +0200 scsi: zfcp: Move shost updates during xconfig data handling into fenced function When executing exchange config data for a FCP device for the first time, or after an adapter recovery, we update several properties of the scsi host or fibre channel host object that represent that FCP device. When moving the scsi host object allocation and registration - and thus also the fibre channel host object allocation - to after the first exchange config and exchange port data, this is not possible for the former case. Move all these update into separate, and fenced function that first checks whether the scsi host object already exists or not, before making the updates. During the first ever exchange config data in the adapter life cycle this will make the exchange config data handler skip over this update step, but we can repeat it later, after we allocated the scsi host object. For any further recovery of that adapter the work flow is only changed slightly because then the scsi host object already exists and we don't free it until we release the adapter completely at the end of its life cycle. Link: https://lore.kernel.org/r/5fc3f4d38d4334f7aa595497c6f7865fb1102e0f.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit 978857c7e367d6841f71c4ded5a8c244520f5e22 Author: Benjamin Block Date: Fri May 8 19:23:28 2020 +0200 scsi: zfcp: Move shost modification after QDIO (re-)open into fenced function When establishing and activating the QDIO queue pair for a FCP device for the first time, or after an adapter recovery, we publish some of its characteristics to the scsi host object representing that FCP device. When moving the scsi host object allocation and registration to after the first exchange config and exchange port data, this is not possible for the former case - QDIO open for the first time - because that happens before exchange config and exchange port data. Move the scsi host object update into a fenced function that checks whether the object already exists or not. This way we can repeat that step later, once we are past the allocation. Once the first recovery succeeds we don't release the scsi host object anymore, so further recoveries do work as before. Link: https://lore.kernel.org/r/a214ebf508f71e3690113e3e90edab1cea0e24e3.1588956679.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Benjamin Block Signed-off-by: Martin K. Petersen commit b59293b469b9e1bbdaf314123498b83a5a9e9ce9 Author: Samuel Zou Date: Fri May 8 19:49:33 2020 +0800 scsi: mpt3sas: Remove unused including Fix the following versioncheck warning: drivers/scsi/mpt3sas/mpt3sas_debugfs.c:16:1: unused including Link: https://lore.kernel.org/r/1588938573-57847-1-git-send-email-zou_wei@huawei.com Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: Martin K. Petersen commit cbbfdb2a2416c9f0cde913cf09670097ac281282 Author: Suganath Prabu S Date: Fri May 8 07:07:38 2020 -0400 scsi: mpt3sas: Fix double free warnings Fix following warning from Smatch static analyser: drivers/scsi/mpt3sas/mpt3sas_base.c:5256 _base_allocate_memory_pools() warn: 'ioc->hpr_lookup' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:5256 _base_allocate_memory_pools() warn: 'ioc->internal_lookup' double freed Link: https://lore.kernel.org/r/20200508110738.30732-1-suganath-prabu.subramani@broadcom.com Reported-by: Dan Carpenter Signed-off-by: Suganath Prabu S Signed-off-by: Martin K. Petersen commit c1bb43e23c4508654badfdac9ca79e4cca4c8b13 Author: Chandrakanth Patil Date: Fri May 8 14:23:14 2020 +0530 scsi: megaraid_sas: Update driver version to 07.714.04.00-rc1 Link: https://lore.kernel.org/r/20200508085314.23461-1-chandrakanth.patil@broadcom.com Signed-off-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen commit 6fd8525a70221c26823b1c7e912fb21f218fb0c5 Author: Sumit Saxena Date: Fri May 8 14:22:42 2020 +0530 scsi: megaraid_sas: TM command refire leads to controller firmware crash When TM command times out, driver invokes the controller reset. Post reset, driver re-fires pended TM commands which leads to firmware crash. Post controller reset, return pended TM commands back to OS. Link: https://lore.kernel.org/r/20200508085242.23406-1-chandrakanth.patil@broadcom.com Cc: stable@vger.kernel.org Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen commit b9d5e3e7f370a817c742fb089ac1a86dfe8947dc Author: Shivasharan S Date: Fri May 8 14:21:30 2020 +0530 scsi: megaraid_sas: Replace undefined MFI_BIG_ENDIAN macro with __BIG_ENDIAN_BITFIELD macro MFI_BIG_ENDIAN macro used in drivers structure bitfield to check the CPU big endianness is undefined which would break the code on big endian machine. __BIG_ENDIAN_BITFIELD kernel macro should be used in places of MFI_BIG_ENDIAN macro. Link: https://lore.kernel.org/r/20200508085130.23339-1-chandrakanth.patil@broadcom.com Fixes: a7faf81d7858 ("scsi: megaraid_sas: Set no_write_same only for Virtual Disk") Cc: # v5.6+ Signed-off-by: Shivasharan S Signed-off-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen commit 84badfab0d914e2c9e96bdc3f418d7f494bfb0bb Author: Sumit Saxena Date: Fri May 8 14:08:35 2020 +0530 scsi: megaraid_sas: Remove IO buffer hole detection logic As blk_queue_virt_boundary() API in slave_configure ensures that no IOs will come with holes/gaps. Hence, code logic to detect the holes/gaps in IO buffer is not required. Link: https://lore.kernel.org/r/20200508083838.22778-3-chandrakanth.patil@broadcom.com Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen commit 6c205a66d65d031e8bf54cf0f4586258ca09396a Author: Kashyap Desai Date: Fri May 8 14:08:34 2020 +0530 scsi: megaraid_sas: Limit device queue depth to controller queue depth The driver currently assigns a pre-defined queue depth when the firmware-provided device queue depth is greater than the controller queue depth. Use the controller queue depth if the reported target queue depth is too large. Link: https://lore.kernel.org/r/20200508083838.22778-2-chandrakanth.patil@broadcom.com Signed-off-by: Kashyap Desai Signed-off-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen commit 79e3520f82cb91e46e7db1af14ad916d6036dde8 Author: Stanley Chu Date: Fri May 8 16:01:15 2020 +0800 scsi: ufs: Cleanup WriteBooster feature Small cleanup as below items, 1. Use ufshcd_is_wb_allowed() directly instead of ufshcd_wb_sup() since ufshcd_wb_sup() just returns the result of ufshcd_is_wb_allowed(). 2. In ufshcd_suspend(), "else if (!ufshcd_is_runtime_pm(pm_op)) can be simplified to "else" since both have the same meaning. This patch does not change any functionality. Link: https://lore.kernel.org/r/20200508080115.24233-9-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 29060a629135a00414d6ea3fbb246a114898f4be Author: Stanley Chu Date: Fri May 8 16:01:14 2020 +0800 scsi: ufs-mediatek: Enable WriteBooster capability Enable WriteBooster capability on MediaTek UFS platforms. Link: https://lore.kernel.org/r/20200508080115.24233-8-stanley.chu@mediatek.com Reviewed-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 6f8d5a6a78cff85a7cbd1f9327e9aee25b0a48b2 Author: Stanley Chu Date: Fri May 8 16:01:13 2020 +0800 scsi: ufs: Add LU Dedicated buffer mode support for WriteBooster According to UFS specification, there are two WriteBooster mode of operations: "LU dedicated buffer" mode and "shared buffer" mode. In the "LU dedicated buffer" mode, the WriteBooster Buffer is dedicated to a logical unit. If the device supports the "LU dedicated buffer" mode, this mode is configured by setting bWriteBoosterBufferType to 00h. The logical unit WriteBooster Buffer size is configured by setting the dLUNumWriteBoosterBufferAllocUnits field of the related Unit Descriptor. Only a value greater than zero enables the WriteBooster feature in the logical unit. Modify ufshcd_wb_probe() as above description to support LU Dedicated buffer mode. Note that according to UFS 3.1 specification, the valid value of bDeviceMaxWriteBoosterLUs parameter in Geometry Descriptor is 1, which means at most one LUN can have WriteBooster buffer in "LU dedicated buffer mode". Therefore this patch supports only one LUN with WriteBooster enabled. All WriteBooster related sysfs nodes are specifically mapped to the LUN with WriteBooster enabled in LU Dedicated buffer mode. Link: https://lore.kernel.org/r/20200508080115.24233-7-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 1f34eedf9bc15d238aece3308aba0a21a1ef5fe2 Author: Stanley Chu Date: Fri May 8 16:01:12 2020 +0800 scsi: ufs: Add "index" in parameter list of ufshcd_query_flag() For preparation of LU Dedicated buffer mode support on WriteBooster feature, "index" parameter shall be added and allowed to be specified by callers. Link: https://lore.kernel.org/r/20200508080115.24233-6-stanley.chu@mediatek.com Reviewed-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Can Guo Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 62c2f503b54cd17bc4ad7b929354923012375f73 Author: Stanley Chu Date: Fri May 8 16:01:11 2020 +0800 scsi: ufs-mediatek: Add fixup_dev_quirks vops Add fixup_dev_quirk vops in MediaTek UFS platforms and provide an initial vendor-specific device quirk table. Link: https://lore.kernel.org/r/20200508080115.24233-5-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 8db269a5102eabfb05f4207f90e0a022caf7b804 Author: Stanley Chu Date: Fri May 8 16:01:10 2020 +0800 scsi: ufs: Export ufs_fixup_device_setup() function Export ufs_fixup_device_setup() to allow vendors to re-use it for fixing device quriks on specified UFS hosts. Link: https://lore.kernel.org/r/20200508080115.24233-4-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit c28c00ba4f060949c2f461f08a4aa10024a40672 Author: Stanley Chu Date: Fri May 8 16:01:09 2020 +0800 scsi: ufs: Introduce fixup_dev_quirks vops Some UFS deivces may have required device quirks or have non-standard features which are enabled only on specified UFS hosts or for special customers. To not "pollute" common device quirk list, i.e. ufs_fixups table, for those devices mentioned above, introduce "fixup_dev_quirks" vops to allow vendors to fix or modify device quirks accordingly. Link: https://lore.kernel.org/r/20200508080115.24233-3-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 817d7e140283f4afc766569c670997df79a7c9ee Author: Stanley Chu Date: Fri May 8 16:01:08 2020 +0800 scsi: ufs: Enable WriteBooster on some pre-3.1 UFS devices The WriteBooster feature can be supported by some pre-3.1 UFS devices by upgrading firmware. To enable WriteBooster feature in such devices, introduce a device quirk to relax the entrance condition of ufshcd_wb_probe() to allow host driver to check those devices' WriteBooster capability. WriteBooster feature can be available if below all conditions are satisfied, 1. Host enables WriteBooster capability 2. UFS 3.1 device or UFS pre-3.1 device with quirk UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES enabled 3. The device descriptor shall have DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP field 4. WriteBooster support is specified in above field Link: https://lore.kernel.org/r/20200508080115.24233-2-stanley.chu@mediatek.com Reviewed-by: Avri Altman Reviewed-by: Asutosh Das Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 6e27a86aed9760780666b062abbcf5e1408e8376 Author: Colin Ian King Date: Thu May 7 21:31:11 2020 +0100 scsi: lpfc: Remove redundant initialization to variable rc The variable rc is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Link: https://lore.kernel.org/r/20200507203111.64709-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") commit ec38c0adc0a149496b6b0e0bfcff9bc7d80db2c4 Author: Gustavo A. R. Silva Date: Thu May 7 14:25:50 2020 -0500 scsi: ufs: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/20200507192550.GA16683@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit 00b42b70ae521e6ccc86ed403e2d101616689bdc Author: Gustavo A. R. Silva Date: Thu May 7 14:21:47 2020 -0500 scsi: libsas: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/20200507192147.GA16206@embeddedor Reviewed-by: John Garry Reviewed-by: Jason Yan Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit f9491ed56e3a73aaa27accf4600671611dcf18bd Author: Xie XiuQi Date: Tue May 5 20:19:04 2020 +0800 scsi: qedi: Remove unused variable udev & uctrl uctrl and udev are unused after commit 9632a6b4b747 ("scsi: qedi: Move LL2 producer index processing in BH.") Remove them. Link: https://lore.kernel.org/r/20200505121904.25702-1-xiexiuqi@huawei.com Reviewed-by: Lee Duncan Signed-off-by: Xie XiuQi Signed-off-by: Martin K. Petersen commit 102026483d2babb1e6f081288c65409186c05330 Author: Jason Yan Date: Tue May 5 15:38:07 2020 +0800 scsi: bfa: Make bfad_iocmd_ioc_get_stats() static Fix the following sparse warning: drivers/scsi/bfa/bfad_bsg.c:140:1: warning: symbol 'bfad_iocmd_ioc_get_stats' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200505073807.40332-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit c68a56736c129f5dd1632856956f9c3e04bae200 Author: Bodo Stroesser Date: Tue Apr 28 20:26:17 2020 +0200 scsi: target: loopback: Fix READ with data and sensebytes We use tcm_loop with tape emulations running on tcmu. In case application reads a short tape block with a longer READ, or a long tape block with a short READ, according to SCC spec data has to be tranferred _and_ sensebytes with ILI set and information field containing the residual count. Similar problem also exists when using fixed block size in READ. Up to now tcm_loop is not prepared to handle sensebytes if input data is provided, as in tcm_loop_queue_data_in() it only sets SAM_STAT_GOOD and, if necessary, the residual count. To fix the bug, the same handling for sensebytes as present in tcm_loop_queue_status() must be done in tcm_loop_queue_data_in() also. After adding this handling, the two function now are nearly identical, so I created a single function with two wrappers. Link: https://lore.kernel.org/r/20200428182617.32726-1-bstroesser@ts.fujitsu.com Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit 8d925b1f00e6894e4c601cb1d395dab3bd66c374 Author: Zou Wei Date: Sun Apr 26 10:42:44 2020 +0800 scsi: aacraid: Use memdup_user() as a cleanup Fix coccicheck warning which recommends to use memdup_user(). This patch fixes the following coccicheck warning: drivers/scsi/aacraid/commctrl.c:516:15-22: WARNING opportunity for memdup_user Link: https://lore.kernel.org/r/1587868964-75969-1-git-send-email-zou_wei@huawei.com Fixes: 4645df1035b3 ("[PATCH] aacraid: swapped kmalloc args.") Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Martin K. Petersen commit 134ab2845acbe48fd3951df7fac77d9829e0b24f Author: Kunihiko Hayashi Date: Tue Apr 28 15:34:50 2020 +0900 dt-bindings: phy: Convert UniPhier USB3-PHY conroller to json-schema Convert the UniPhier USB3-PHY controller for SS/HS to DT schema format. Signed-off-by: Kunihiko Hayashi Signed-off-by: Rob Herring commit 60f4fc43bac9aeb3315084aca7f95a3573537f35 Author: Kunihiko Hayashi Date: Tue Apr 28 15:34:49 2020 +0900 dt-bindings: phy: Convert UniPhier USB2-PHY controller to json-schema Convert the UniPhier USB2-PHY conroller to DT schema format. Signed-off-by: Kunihiko Hayashi Signed-off-by: Rob Herring commit b36a2472539293bcab0521bcbc284d6be0448d4b Author: Kunihiko Hayashi Date: Tue Apr 28 15:34:48 2020 +0900 dt-bindings: phy: Convert UniPhier PCIe-PHY controller to json-schema Convert the UniPhier PCIe-PHY controller to DT schema format. Signed-off-by: Kunihiko Hayashi Signed-off-by: Rob Herring commit 8f18632153e7f55d0150baa66af7a990fa812348 Author: Geert Uytterhoeven Date: Mon Apr 27 21:32:24 2020 +0200 dt-bindings: timer: renesas: ostm: Convert to json-schema Convert the Renesas OS Timer (OSTM) Device Tree binding documentation to json-schema. Document missing properties. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Rob Herring commit d0941cfb9fa8ac69a67f264f81e2ba8ecb1caa0d Author: Geert Uytterhoeven Date: Mon Apr 27 21:25:22 2020 +0200 dt-bindings: watchdog: renesas-wdt: Convert to json-schema Convert the Renesas Watchdog Timer (WDT) Controller Device Tree binding documentation to json-schema. Add missing "renesas,r8a77980-wdt" compatible value. Document missing properties. Update the example to match reality. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Rob Herring commit 7f7d408e5a00d51519279e74176f7dc3a5eaa4a9 Author: Geert Uytterhoeven Date: Mon Apr 27 21:22:59 2020 +0200 dt-bindings: gpio: rcar: Convert to json-schema Convert the Renesas General-Purpose Input/Output Ports (GPIO) Device Tree binding documentation to json-schema. Drop the deprecated "renesas,gpio-rcar" compatible value. Document missing properties. Drop the first example, as it doesn't add much value. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Rob Herring commit 0d1ce0d14bd70d4c4ee93be41a455ef66236cad6 Author: Douglas Anderson Date: Thu May 7 14:35:00 2020 -0700 arm64: dts: sdm845: Add "no-hpd" to sn65dsi86 on cheza We don't have the HPD line hooked up to the bridge chip. Add it as suggested in the patch ("dt-bindings: drm/bridge: ti-sn65dsi86: Document no-hpd"). NOTE: this patch isn't expected to have any effect but just keeps us cleaner for the future. Currently the driver in Linux just assumes that nobody has HPD hooked up. This change allows us to later implement HPD support in the driver without messing up sdm845-cheza. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200507143354.v5.6.I89df9b6094549b8149aa8b8347f7401c678055b0@changeid Signed-off-by: Bjorn Andersson commit 8f09210d89e7a6feb07699b4e73a7c34f39554e4 Author: Vincent Knecht Date: Mon May 11 23:27:33 2020 +0200 soc: qcom: socinfo: add msm8936/39 and apq8036/39 soc ids This patch adds missing SoC IDs for MSM8936/39 and their APQ variants. Signed-off-by: Vincent Knecht Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20200511212733.214464-1-konradybcio@gmail.com Signed-off-by: Bjorn Andersson commit 746c6237ece641da79df09abcf87bc29f6f9665b Author: Xiongfeng Wang Date: Fri May 8 09:32:59 2020 +0800 sunrpc: add missing newline when printing parameter 'pool_mode' by sysfs When I cat parameter '/sys/module/sunrpc/parameters/pool_mode', it displays as follows. It is better to add a newline for easy reading. [root@hulk-202 ~]# cat /sys/module/sunrpc/parameters/pool_mode global[root@hulk-202 ~]# Signed-off-by: Xiongfeng Wang Signed-off-by: J. Bruce Fields commit ce187859cea2004d9520de76948d6fc3e2f4b4bb Author: Bjorn Andersson Date: Sun Apr 26 22:42:02 2020 -0700 soc: qcom: aoss: Add SM8250 compatible Add SM8250 compatible to the qcom_aoss binding and driver. Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200427054202.2822144-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 6b9ea5ff5abdcda9d1291d9b8bbad44c93c7ccef Author: Jakub Kicinski Date: Mon May 11 10:08:07 2020 -0700 checkpatch: warn about uses of ENOTSUPP ENOTSUPP often feels like the right error code to use, but it's in fact not a standard Unix error. E.g.: $ python >>> import errno >>> errno.errorcode[errno.ENOTSUPP] Traceback (most recent call last): File "", line 1, in AttributeError: module 'errno' has no attribute 'ENOTSUPP' There were numerous commits converting the uses back to EOPNOTSUPP but in some cases we are stuck with the high error code for backward compatibility reasons. Let's try prevent more ENOTSUPPs from getting into the kernel. Recent example: https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/ v3 (Joe): - fix the "not file" condition. v2 (Joe): - add a link to recent discussion, - don't match when scanning files, not patches to avoid sudden influx of conversion patches. https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/ v1: https://lore.kernel.org/netdev/20200510185148.2230767-1-kuba@kernel.org/ Suggested-by: Andrew Lunn Signed-off-by: Jakub Kicinski Acked-by: Joe Perches Signed-off-by: David S. Miller commit 97cf0ef9305bba857f04b914fd59e83813f1eae2 Merge: 3242956bd610 1f466e1f15cf Author: David S. Miller Date: Mon May 11 16:59:16 2020 -0700 Merge branch 'improve-msg_control-kernel-vs-user-pointer-handling' Christoph Hellwig says: ==================== improve msg_control kernel vs user pointer handling this series replace the msg_control in the kernel msghdr structure with an anonymous union and separate fields for kernel vs user pointers. In addition to helping a bit with type safety and reducing sparse warnings, this also allows to remove the set_fs() in kernel_recvmsg, helping with an eventual entire removal of set_fs(). ==================== Signed-off-by: David S. Miller commit 1f466e1f15cf1dac7c86798d694649fc42cd868a Author: Christoph Hellwig Date: Mon May 11 13:59:13 2020 +0200 net: cleanly handle kernel vs user buffers for ->msg_control The msg_control field in struct msghdr can either contain a user pointer when used with the recvmsg system call, or a kernel pointer when used with sendmsg. To complicate things further kernel_recvmsg can stuff a kernel pointer in and then use set_fs to make the uaccess helpers accept it. Replace it with a union of a kernel pointer msg_control field, and a user pointer msg_control_user one, and allow kernel_recvmsg operate on a proper kernel pointer using a bitfield to override the normal choice of a user pointer for recvmsg. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 2618d530dd8b7ac0fdcb83f4c95b88f7b0d37ce6 Author: Christoph Hellwig Date: Mon May 11 13:59:12 2020 +0200 net/scm: cleanup scm_detach_fds Factor out two helpes to keep the code tidy. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 0462b6bdb6445b887b8896f28be92e0d94c92e7b Author: Christoph Hellwig Date: Mon May 11 13:59:11 2020 +0200 net: add a CMSG_USER_DATA macro Add a variant of CMSG_DATA that operates on user pointer to avoid sparse warnings about casting to/from user pointers. Also fix up CMSG_DATA to rely on the gcc extension that allows void pointer arithmetics to cut down on the amount of casts. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 26bea4e42a36aba81da52bc44ef7682b8fd7082d Author: Loic Poulain Date: Tue Apr 21 14:00:25 2020 +0200 arch: arm64: dts: msm8996: Add CCI node Add CCI controller node, which can be used to communicate with camera sensors (I2C subset). MSM8996 CCI offers two masters, i2c-bus@0 and i2c-bus@1. Signed-off-by: Loic Poulain Link: https://lore.kernel.org/r/1587470425-13726-2-git-send-email-loic.poulain@linaro.org Signed-off-by: Bjorn Andersson commit 4a4a26317ec8aba575f6b85789a42639937bc1a4 Author: Loic Poulain Date: Tue Apr 21 14:00:24 2020 +0200 arm64: dts: msm8996: Fix CSI IRQ types Each IRQ_TYPE_NONE interrupt causes a warning at boot. Fix that by defining an appropriate type. Fixes: e0531312e78f ("arm64: dts: qcom: msm8996: Add CAMSS support") Signed-off-by: Loic Poulain Link: https://lore.kernel.org/r/1587470425-13726-1-git-send-email-loic.poulain@linaro.org Signed-off-by: Bjorn Andersson commit 3242956bd610af40e884b530b6c6f76f5bf85f3b Merge: 9b1b31d5d4ac 097f024454fc Author: David S. Miller Date: Mon May 11 16:50:45 2020 -0700 Merge branch 'net-dsa-Constify-two-tagger-ops' Florian Fainelli says: ==================== net: dsa: Constify two tagger ops This patch series constifies the dsa_device_ops for ocelot and sja1105 ==================== Signed-off-by: David S. Miller commit 097f024454fca0e13bbba0ab54dfe63ac5610953 Author: Florian Fainelli Date: Mon May 11 16:47:15 2020 -0700 net: dsa: tag_sja1105: Constify dsa_device_ops sja1105_netdev_ops should be const since that is what the DSA layer expects. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 2fa3888bb7a9fb3966c77555c8cd6f4bd6a1439a Author: Florian Fainelli Date: Mon May 11 16:47:14 2020 -0700 net: dsa: ocelot: Constify dsa_device_ops ocelot_netdev_ops should be const since that is what the DSA layer expects. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 27acbf41be3928999b3a291fceee2a4b50218f00 Author: Zou Wei Date: Tue Apr 14 16:19:48 2020 +0800 tomoyo: use true for bool variable Fixes coccicheck warning: security/tomoyo/common.c:1028:2-13: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Tetsuo Handa commit 28c9c3d36b7c45bf3e0dd00df224ca2f2bb385eb Author: Paul Cercueil Date: Sun Apr 26 20:58:55 2020 +0200 dt-bindings: serial: Convert ingenic,uart.txt to YAML Convert the ingenic,uart.txt to a new ingenic,uart.yaml file. A few things were changed in the process: - the dmas and dma-names properties are now required. - the ingenic,jz4770-uart and ingenic,jz4775-uart compatible strings now require the ingenic,jz4760-uart string to be used as fallback, since the hardware is compatible. - the ingenic,jz4725b-uart compatible string was added, with a fallback to ingenic,jz4740-uart. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 118a209df6137de7d28dc840778cc2172f8635e3 Author: Paul Cercueil Date: Sun Apr 26 20:58:54 2020 +0200 dt-bindings: i2c: Convert i2c-jz4780.txt to YAML Convert the i2c-jz4780.txt file to ingenic,i2c.yaml. Two things were changed in the process: - the clock-frequency property can now only be set to the two values that can be set by the hardware; - the dmas and dma-names properties are now required. Signed-off-by: Paul Cercueil [robh: add ref to i2c-controller.yaml] Signed-off-by: Rob Herring commit 6e172df71fe5e9e13feefceceba92690389a6c1c Author: Paul Cercueil Date: Sun Apr 26 20:58:50 2020 +0200 dt-bindings: intc: Convert ingenic,intc.txt to YAML Convert the ingenic,intc.txt doc file to ingenic,intc.yaml. Some compatible strings now require a fallback, as the controller generally works the same across the SoCs families. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 45ba7a893ad89114e773b3dc32f6431354c465d6 Author: David Gow Date: Thu Apr 30 21:27:01 2020 -0700 kunit: kunit_tool: Separate out config/build/exec/parse Add new subcommands to kunit.py to allow stages of the existing 'run' subcommand to be run independently: - 'config': Verifies that .config is a subset of .kunitconfig - 'build': Compiles a UML kernel for KUnit - 'exec': Runs the kernel, and outputs the test results. - 'parse': Parses test results from a file or stdin The 'run' command continues to behave as before. Signed-off-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 4b7cf35c5584447e2a99aae57b52441ba4e9989c Author: Paul Cercueil Date: Sun Apr 26 20:58:49 2020 +0200 dt-bindings: clock: Convert ingenic,cgu.txt to YAML Convert the ingenic,cgu.txt doc file to ingenic,cgu.yaml. The binding documentation has been updated as well. The node can have a child node that corresponds to the USB PHY, which happens to be present in the middle of the CGU registers. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit c54030b191142ac40250091cb890bcd78497a35b Author: Samuel Holland Date: Sun Apr 26 11:20:32 2020 -0500 dt-bindings: timer: Document allwinner,erratum-unknown1 property This arch_timer property was added in commit c950ca8c35ee ("clocksource/drivers/arch_timer: Workaround for Allwinner A64 timer instability") but I omitted the device tree binding documentation. Now `make dtbs_check` prints the following warning for all A64 boards: timer: 'allwinner,erratum-unknown1' does not match any of the regexes: 'pinctrl-[0-9]+' Resolve this by documenting the erratum property. Signed-off-by: Samuel Holland Signed-off-by: Rob Herring commit 0b7140098667b3b50b8c5431c92ea94c0f9a00bd Author: Johan Jonker Date: Sat Apr 25 19:08:33 2020 +0200 dt-bindings: usb: dwc2: add power-domains property A test with the command below gives this error: arch/arm64/boot/dts/rockchip/px30-evb.dt.yaml: usb@ff300000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' With the conversion to yaml it also filters things in a node that are used by other drivers like 'power-domains' for Rockchip px30 usb nodes, so add them to 'dwc2.yaml'. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc2.yaml Signed-off-by: Johan Jonker Signed-off-by: Rob Herring commit 2c905f6c3334691a3d96d7dcdffdff0e0a9dadb5 Author: Johan Jonker Date: Sat Apr 25 17:40:37 2020 +0200 dt-bindings: gpu: add power-domains #cooling-cells to arm,mali-bifrost.yaml A test with the command below gives this error: arch/arm64/boot/dts/rockchip/px30-evb.dt.yaml: gpu@ff400000: '#cooling-cells', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+' With the conversion to yaml it also filters things in a node that are used by other drivers like '#cooling-cells' and 'power-domains' for Rockchip px30 gpu nodes, so add them to 'arm,mali-bifrost.yaml'. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/gpu/ arm,mali-bifrost.yaml Signed-off-by: Johan Jonker Signed-off-by: Rob Herring commit 37e4f052cc9749db608ad63e53acc49354c98200 Author: Jason Yan Date: Sat May 9 14:29:59 2020 +0800 drm/amd/amdgpu: remove defined but not used 'crtc_offsets' Fix the following gcc warning: drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:65:18: warning: ‘crtc_offsets’ defined but not used [-Wunused-const-variable=] static const u32 crtc_offsets[6] = ^~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit 3528cae940d75f3d6f9ce905acb3c3332e2d5067 Author: Leo (Hanghong) Ma Date: Fri May 8 14:18:07 2020 -0400 drm/amd/amdgpu: Update update_config() logic [Why] For MST case: when update_config is called to disable a stream, this clears the settings for all the streams on that link. We should only clear the settings for the stream that was disabled. [How] Clear the settings after the call to remove display is called. Reviewed-by: Harry Wentland Reviewed-by: Bhawanpreet Lakha Signed-off-by: Leo (Hanghong) Ma Signed-off-by: Alex Deucher commit 2c60129469beb8624600af10a4e2972a36932262 Author: Tom St Denis Date: Sun May 10 07:04:41 2020 -0400 drm/amd/amdgpu: Add missing GRBM bits for GFX 10.1 Requested bits for UMR support Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b0be3c3a2500b46682b3eb7ac5024b8982ed0364 Author: Tom St Denis Date: Thu May 7 08:35:40 2020 -0400 drm/amd/amdgpu: add raven1 part to the gfxoff quirk list On my raven1 system (rev c6) with VBIOS 113-RAVEN-114 GFXOFF is not stable (resulting in large block tiling noise in some applications). Disabling GFXOFF via the quirk list fixes the problems for me. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit feb000fdfff48394766a92a43f133a4f314cdc9f Author: Jane Jian Date: Sat May 9 13:16:26 2020 +0800 drm/amd/powerplay: skip judging if baco support for Arcturus sriov since for sriov, baco happens on host side, no need and meaning to judge is baco. also, since kiq reads strap0 in here, if kiq is not ready or gpu reset(kiq resume) happens after this read, would fail to read and wrongly set baco as true(1). Acked-by: Evan Quan Signed-off-by: Jane Jian Signed-off-by: Alex Deucher commit f678d2181d0d2ff14d4865435b75cba56a675e59 Author: Lad Prabhakar Date: Fri Apr 24 11:38:15 2020 +0100 dt-bindings: sh_eth: Sort compatible string in increasing number of the SoC Sort the items in the compatible string list in increasing number of SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 9442c09e784d805048611d23fa4d253caef0a62b Author: Nicolas Saenz Julienne Date: Mon May 11 13:02:50 2020 +0200 MAINTAINERS: Update Raspberry Pi development repository Eric Anholt's repo isn't used anymore. List current one. Signed-off-by: Nicolas Saenz Julienne Acked-by: Eric Anholt Signed-off-by: Florian Fainelli commit 68f0f2690e183306b52671a9ad09fb31808b0500 Merge: baf5fe761846 f736e0f1a55a Author: Thomas Gleixner Date: Mon May 11 22:54:30 2020 +0200 Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu Pull RCU updates from Paul McKenney: 1. Miscellaneous fixes. 2. kfree_rcu() updates. 3. Remove scheduler locking restriction 4. RCU-tasks update, including addition of RCU Tasks Trace for BPF use and RCU Tasks Rude. (This branch is on top of #3 due to overlap of changed code.) 5. RCU CPU stall warning updates. 6. Torture-test updates. commit 9b1b31d5d4ac7d931c3d7e0e8114ff9d4fbd0c28 Merge: a90f704ad949 9b46132cff75 Author: David S. Miller Date: Mon May 11 13:31:49 2020 -0700 Merge branch 'sfc-remove-nic_data-usage-in-common-code' Edward Cree says: ==================== sfc: remove nic_data usage in common code efx->nic_data should only be used from NIC-specific code (i.e. nic_type functions and things they call), in files like ef10[_sriov].c and siena.c. This series refactors several nic_data usages from common code (mainly in mcdi_filters.c) into nic_type functions, in preparation for the upcoming ef100 driver which will use those functions but have its own struct layout for efx->nic_data distinct from ef10's. After this series, one nic_data usage (in ptp.c) remains; it wasn't clear to me how to fix it, and ef100 devices don't yet have PTP support (so the initial ef100 driver will not call that code). ==================== Signed-off-by: David S. Miller commit 9b46132cff75653f02241640b44b31c29499afc1 Author: Edward Cree Date: Mon May 11 13:30:00 2020 +0100 sfc: make firmware-variant printing a nic_type function Instead of having efx_mcdi_print_fwver() look at efx_nic_rev and conditionally poke around inside ef10-specific nic_data, add a new efx->type->print_additional_fwver() method to do this work. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit ed02112cff9212232cc42f871cbe84c2c4c81850 Author: Edward Cree Date: Mon May 11 13:29:45 2020 +0100 sfc: make filter table probe caller responsible for adding VLANs By making the caller of efx_mcdi_filter_table_probe() loop over the vlan_list calling efx_mcdi_filter_add_vlan(), instead of doing it in efx_mcdi_filter_table_probe(), the latter avoids looking in ef10- specific nic_data. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit dbf2c669062c1247345c0a3c0c3112e386ffe3f0 Author: Edward Cree Date: Mon May 11 13:29:34 2020 +0100 sfc: move rx_rss_context_exclusive into struct efx_mcdi_filter_table It's both set and used solely by mcdi_filters.c, so there's no reason for it to be in ef10-specific nic_data. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit fd14e5fd136b1868d10f032a389a36603fb3a119 Author: Edward Cree Date: Mon May 11 13:29:23 2020 +0100 sfc: rework handling of (firmware) multicast chaining state Store the mc_chaining bit in struct efx_mcdi_filter_table, so that common code in mcdi_filters.c doesn't need to get it from ef10-specific nic_data. Also, probe the firmware workaround just before the call to efx_mcdi_filter_table_probe(), rather than in a random other part of the driver bringup, to ensure that (a) it gets probed in time and (b) it gets reprobed as necessary on resets, no matter how the surrounding code gets reorganised and reordered. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit e4fe938cff0464643b1fbca872e5e10b1ec4c478 Author: Edward Cree Date: Mon May 11 13:29:09 2020 +0100 sfc: move 'must restore' flags out of ef10-specific nic_data Common code in mcdi_filters.c uses these flags, so by moving them to either struct efx_nic (in the case of must_realloc_vis) or struct efx_mcdi_filter_table (for must_restore_rss_contexts and must_restore_filters), decouple this code from ef10's nic_data. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 484a75b1dbc492cca4893718e70daccc05c2ce0b Author: Edward Cree Date: Mon May 11 13:28:56 2020 +0100 sfc: use efx_has_cap for capability checks outside of NIC-specific code Removes some efx_ef10_nic_data references from common code. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit be904b855200ef4672c765918b31338b59c4847c Author: Tom Zhao Date: Mon May 11 13:28:40 2020 +0100 sfc: make capability checking a nic_type function Various MCDI functions (especially in filter handling) need to check the datapath caps, but those live in nic_data (since they don't exist on Siena). Decouple from ef10-specific data structures by adding check_caps to the nic_type, to allow using these functions from non-ef10 drivers. Also add a convenience macro efx_has_cap() to reduce the amount of boilerplate involved in calling it. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit dfcabb078847479cc2874c11af3f6cb3b79ddd03 Author: Edward Cree Date: Mon May 11 13:28:20 2020 +0100 sfc: move vport_id to struct efx_nic Remove some usage of ef10-specific nic_data structs from common MCDI functions, in preparation for using them from a non-EF10 driver. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit a90f704ad9499b0737b741ccea13c0a6fb6fa8d4 Merge: 01f2b3dac8c4 37d4f8a6b41f Author: David S. Miller Date: Mon May 11 13:25:00 2020 -0700 Merge branch 'net-Optimize-the-qed-allocations-inside-kdump-kernel' Bhupesh Sharma says: ==================== net: Optimize the qed* allocations inside kdump kernel Changes since v1: ---------------- - v1 can be seen here: http://lists.infradead.org/pipermail/kexec/2020-May/024935.html - Addressed review comments received on v1: * Removed unnecessary paranthesis. * Used a different macro for minimum RX/TX ring count value in kdump kernel. Since kdump kernel(s) run under severe memory constraint with the basic idea being to save the crashdump vmcore reliably when the primary kernel panics/hangs, large memory allocations done by a network driver can cause the crashkernel to panic with OOM. The qed* drivers take up approximately 214MB memory when run in the kdump kernel with the default configuration settings presently used in the driver. With an usual crashkernel size of 512M, this allocation is equal to almost half of the total crashkernel size allocated. See some logs obtained via memstrack tool (see [1]) below: dracut-pre-pivot[676]: ======== Report format module_summary: ======== dracut-pre-pivot[676]: Module qed using 149.6MB (2394 pages), peak allocation 149.6MB (2394 pages) dracut-pre-pivot[676]: Module qede using 65.3MB (1045 pages), peak allocation 65.3MB (1045 pages) This patchset tries to reduce the overall memory allocation profile of the qed* driver when they run in the kdump kernel. With these optimization we can see a saving of approx 85M in the kdump kernel: dracut-pre-pivot[671]: ======== Report format module_summary: ======== dracut-pre-pivot[671]: Module qed using 124.6MB (1993 pages), peak allocation 124.7MB (1995 pages) <..snip..> dracut-pre-pivot[671]: Module qede using 4.6MB (73 pages), peak allocation 4.6MB (74 pages) And the kdump kernel can save vmcore successfully via both ssh and nfs interfaces. This patchset contains two patches: [PATCH 1/2] - Reduces the default TX and RX ring count in kdump kernel. [PATCH 2/2] - Disables qed SRIOV feature in kdump kernel (as it is normally not a supported kdump target for saving vmcore). [1]. Memstrack tool: https://github.com/ryncsn/memstrack ==================== Signed-off-by: David S. Miller commit 37d4f8a6b41f622608671ab8434194c819a5e444 Author: Bhupesh Sharma Date: Mon May 11 15:41:42 2020 +0530 net: qed: Disable SRIOV functionality inside kdump kernel Since we have kdump kernel(s) running under severe memory constraint it makes sense to disable the qed SRIOV functionality when running the kdump kernel as kdump configurations on several distributions don't support SRIOV targets for saving the vmcore (see [1] for example). Currently the qed SRIOV functionality ends up consuming memory in the kdump kernel, when we don't really use the same. An example log seen in the kdump kernel with the SRIOV functionality enabled can be seen below (obtained via memstrack tool, see [2]): dracut-pre-pivot[676]: ======== Report format module_summary: ======== dracut-pre-pivot[676]: Module qed using 149.6MB (2394 pages), peak allocation 149.6MB (2394 pages) This patch disables the SRIOV functionality inside kdump kernel and with the same applied the memory consumption goes down: dracut-pre-pivot[671]: ======== Report format module_summary: ======== dracut-pre-pivot[671]: Module qed using 124.6MB (1993 pages), peak allocation 124.7MB (1995 pages) [1]. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/installing-and-configuring-kdump_managing-monitoring-and-updating-the-kernel#supported-kdump-targets_supported-kdump-configurations-and-targets [2]. Memstrack tool: https://github.com/ryncsn/memstrack Cc: kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Ariel Elior Cc: GR-everest-linux-l2@marvell.com Cc: Manish Chopra Cc: David S. Miller Signed-off-by: Bhupesh Sharma Signed-off-by: David S. Miller commit 73e030977f7884dbe1be0018bab517e8d02760f8 Author: Bhupesh Sharma Date: Mon May 11 15:41:41 2020 +0530 net: qed*: Reduce RX and TX default ring count when running inside kdump kernel Normally kdump kernel(s) run under severe memory constraint with the basic idea being to save the crashdump vmcore reliably when the primary kernel panics/hangs. Currently the qed* ethernet driver ends up consuming a lot of memory in the kdump kernel, leading to kdump kernel panic when one tries to save the vmcore via ssh/nfs (thus utilizing the services of the underlying qed* network interfaces). An example OOM message log seen in the kdump kernel can be seen here [1], with crashkernel size reservation of 512M. Using tools like memstrack (see [2]), we can track the modules taking up the bulk of memory in the kdump kernel and organize the memory usage output as per 'highest allocator first'. An example log for the OOM case indicates that the qed* modules end up allocating approximately 216M memory, which is a large part of the total crashkernel size: dracut-pre-pivot[676]: ======== Report format module_summary: ======== dracut-pre-pivot[676]: Module qed using 149.6MB (2394 pages), peak allocation 149.6MB (2394 pages) dracut-pre-pivot[676]: Module qede using 65.3MB (1045 pages), peak allocation 65.3MB (1045 pages) This patch reduces the default RX and TX ring count from 1024 to 64 when running inside kdump kernel, which leads to a significant memory saving. An example log with the patch applied shows the reduced memory allocation in the kdump kernel: dracut-pre-pivot[674]: ======== Report format module_summary: ======== dracut-pre-pivot[674]: Module qed using 141.8MB (2268 pages), peak allocation 141.8MB (2268 pages) <..snip..> [dracut-pre-pivot[674]: Module qede using 4.8MB (76 pages), peak allocation 4.9MB (78 pages) Tested crashdump vmcore save via ssh/nfs protocol using underlying qed* network interface after applying this patch. [1] OOM log: ------------ kworker/0:6: page allocation failure: order:6, mode:0x60c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null) kworker/0:6 cpuset=/ mems_allowed=0 CPU: 0 PID: 145 Comm: kworker/0:6 Not tainted 4.18.0-109.el8.aarch64 #1 Hardware name: To be filled by O.E.M. Saber/Saber, BIOS 0ACKL025 01/18/2019 Workqueue: events work_for_cpu_fn Call trace: dump_backtrace+0x0/0x188 show_stack+0x24/0x30 dump_stack+0x90/0xb4 warn_alloc+0xf4/0x178 __alloc_pages_nodemask+0xcac/0xd58 alloc_pages_current+0x8c/0xf8 kmalloc_order_trace+0x38/0x108 qed_iov_alloc+0x40/0x248 [qed] qed_resc_alloc+0x224/0x518 [qed] qed_slowpath_start+0x254/0x928 [qed] __qede_probe+0xf8/0x5e0 [qede] qede_probe+0x68/0xd8 [qede] local_pci_probe+0x44/0xa8 work_for_cpu_fn+0x20/0x30 process_one_work+0x1ac/0x3e8 worker_thread+0x44/0x448 kthread+0x130/0x138 ret_from_fork+0x10/0x18 Cannot start slowpath qede: probe of 0000:05:00.1 failed with error -12 [2]. Memstrack tool: https://github.com/ryncsn/memstrack Cc: kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Ariel Elior Cc: GR-everest-linux-l2@marvell.com Cc: Manish Chopra Cc: David S. Miller Signed-off-by: Bhupesh Sharma Signed-off-by: David S. Miller commit 01f2b3dac8c4bebeb0ec15c4b7b59993766493cc Author: Luo bin Date: Mon May 11 05:58:57 2020 +0000 hinic: add link_ksettings ethtool_ops support add set_link_ksettings implementation and improve the implementation of get_link_ksettings Signed-off-by: Luo bin Signed-off-by: David S. Miller commit 9c8255c888bac9221739c822132b405d4196bdd8 Author: Gustavo A. R. Silva Date: Thu May 7 14:25:07 2020 -0500 team: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit c2dfc7d2a9be9a14897eab6dd27eeea1bd4ea79b Author: Gustavo A. R. Silva Date: Thu May 7 14:01:33 2020 -0500 net: atarilance: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 0fa39d6dd0478b080a420aa764280e1a3bdb0cee Author: Gustavo A. R. Silva Date: Thu May 7 14:02:16 2020 -0500 ipv6: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 0185d50c5220e772aa90a21c515b0c87660ec4d7 Author: Christophe Kerello Date: Wed May 6 11:11:12 2020 +0200 mtd: rawnand: stm32_fmc2: use FMC2_TIMEOUT_MS for timeouts This patch removes the constant FMC2_TIMEOUT_US. FMC2_TIMEOUT_MS will be used each time that we need to wait (except when the timeout value is set by the framework). It was seen, during stress tests with the sequencer in an overloaded system, that we could be close to 1 second, even if we never met this value. To be safe, FMC2_TIMEOUT_MS is set to 5 seconds. Signed-off-by: Christophe Kerello Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1588756279-17289-4-git-send-email-christophe.kerello@st.com commit 2d3d54bf1294f6290e55841e52bfbe6b9e65704b Author: Christophe Kerello Date: Wed May 6 11:11:11 2020 +0200 mtd: rawnand: stm32_fmc2: remove useless inline comments Remove inline comments that are useless since function label are self explanatory. Signed-off-by: Christophe Kerello Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1588756279-17289-3-git-send-email-christophe.kerello@st.com commit 71d1f1d5958fe15c1f12f0ecc5aa18ebe2073e31 Author: Christophe Kerello Date: Wed May 6 11:11:10 2020 +0200 mtd: rawnand: stm32_fmc2: manage all errors cases at probe time This patch defers its probe when the expected reset control is not yet ready. This patch also handles properly all errors cases at probe time. Signed-off-by: Christophe Kerello Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1588756279-17289-2-git-send-email-christophe.kerello@st.com commit bec71ba243e95c54051c69b7d418ef407fe2297c Author: Sibi Sankar Date: Tue Apr 21 20:02:28 2020 +0530 arm64: dts: qcom: sc7180: Update Q6V5 MSS node Add TCSR node and update MSS node to support MSA based Modem boot on SC7180 SoCs. Reviewed-by: Bjorn Andersson Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-8-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit e14a15eba89af9b493c0c93e327f70291b82b9c5 Author: Sibi Sankar Date: Tue Apr 21 20:02:27 2020 +0530 arm64: dts: qcom: sc7180: Add Q6V5 MSS node This patch adds Q6V5 MSS PAS remoteproc node for SC7180 SoCs. Reviewed-by: Bjorn Andersson Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-7-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 33c172b96a7de7a2ba69cc6afa24deda19ae6882 Author: Sibi Sankar Date: Tue Apr 21 20:02:26 2020 +0530 arm64: dts: qcom: sc7180: Update reserved memory map Add missing regions and remove unused regions from the reserved memory map, as described in version 5. Tested-by: Evan Green Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-6-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 40e31f0e18475165b7c8582363cbe6a58fdaaca3 Author: Andy Shevchenko Date: Sat Apr 25 14:51:52 2020 +0300 i2c: mux: pca954x: Convert license to SPDX identifier Use a shorter SPDX identifier instead of pasting the whole license. While here, replace duplicating PCA954x with PCA984x. Signed-off-by: Andy Shevchenko Reviewed-by: Peter Rosin Signed-off-by: Wolfram Sang commit 3093c64101729e9b2b7be409abf3ebc4735f2b1e Author: Andy Shevchenko Date: Sat Apr 25 14:51:51 2020 +0300 i2c: mux: pca954x: Move device_remove_file() out of pca954x_cleanup() device_create_file() is called the last in ->probe() but pca954x_cleanup(), which is called earlier in error path, tries to remove never created file. Move device_remove_file() call outside of pca954x_cleanup() to make it slightly closer to what pca954x_init() is doing. Signed-off-by: Andy Shevchenko Reviewed-by: Peter Rosin Signed-off-by: Wolfram Sang commit 753aa3694382c5d967dcb427ae0c3ee199bd21aa Author: Andy Shevchenko Date: Sat Apr 25 14:51:50 2020 +0300 i2c: mux: pca954x: Make use of device properties Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: Andy Shevchenko Reviewed-by: Peter Rosin Signed-off-by: Wolfram Sang commit 19bb22273c42bac264febe38f53a8b9d004a8df5 Author: Andy Shevchenko Date: Sat Apr 25 14:51:49 2020 +0300 i2c: mux: pca954x: Refactor pca954x_irq_handler() Refactor pca954x_irq_handler() to: - use for_each_set_bit() macro - use IRQ_RETVAL() macro Above change makes code easy to read and understand. Signed-off-by: Andy Shevchenko Reviewed-by: Peter Rosin Signed-off-by: Wolfram Sang commit ff20460e94af5d11ebffd9d97c1eaa00e520ecbe Author: Quentin Monnet Date: Mon May 11 17:15:36 2020 +0100 tools, bpf: Synchronise BPF UAPI header with tools Synchronise the bpf.h header under tools, to report the fixes recently brought to the documentation for the BPF helpers. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200511161536.29853-5-quentin@isovalent.com commit ab8d78093dfa2e7820ca0c28dda9142aa771c510 Author: Quentin Monnet Date: Mon May 11 17:15:35 2020 +0100 bpf: Minor fixes to BPF helpers documentation Minor improvements to the documentation for BPF helpers: * Fix formatting for the description of "bpf_socket" for bpf_getsockopt() and bpf_setsockopt(), thus suppressing two warnings from rst2man about "Unexpected indentation". * Fix formatting for return values for bpf_sk_assign() and seq_file helpers. * Fix and harmonise formatting, in particular for function/struct names. * Remove blank lines before "Return:" sections. * Replace tabs found in the middle of text lines. * Fix typos. * Add a note to the footer (in Python script) about "bpftool feature probe", including for listing features available to unprivileged users, and add a reference to bpftool man page. Thanks to Florian for reporting two typos (duplicated words). Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200511161536.29853-4-quentin@isovalent.com commit c8caa0bb4b383a86a77f4c8727a4f7c7f9825260 Author: Quentin Monnet Date: Mon May 11 17:15:34 2020 +0100 tools, bpftool: Minor fixes for documentation Bring minor improvements to bpftool documentation. Fix or harmonise formatting, update map types (including in interactive help), improve description for "map create", fix a build warning due to a missing line after the double-colon for the "bpftool prog profile" example, complete/harmonise/sort the list of related bpftool man pages in footers. v2: - Remove (instead of changing) mark-up on "value" in bpftool-map.rst, when it does not refer to something passed on the command line. - Fix an additional typo ("hexadeximal") in the same file. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200511161536.29853-3-quentin@isovalent.com commit 6e7e034e88e8e22cb14765c86da92416017e45b8 Author: Quentin Monnet Date: Mon May 11 17:15:33 2020 +0100 tools, bpftool: Poison and replace kernel integer typedefs Replace the use of kernel-only integer typedefs (u8, u32, etc.) by their user space counterpart (__u8, __u32, etc.). Similarly to what libbpf does, poison the typedefs to avoid introducing them again in the future. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200511161536.29853-2-quentin@isovalent.com commit 6663ce6facf93727a3a08c5a6408405cd6094c48 Author: Sibi Sankar Date: Tue Apr 21 20:02:25 2020 +0530 remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region In the absence of mba and mpss sub-child extract the mba/mpss regions from the memory-region property. Tested-by: Evan Green Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-5-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit d964b0b1a863cceaa694a2db485b1347e49a8082 Author: Sibi Sankar Date: Tue Apr 21 20:02:24 2020 +0530 dt-bindings: remoteproc: qcom: Use memory-region to reference memory Use memory-region property to reference mba and mpss memory regions. Reviewed-by: Rob Herring Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-4-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 620d70b04d43b8659b099b125626325333bc887f Author: Sibi Sankar Date: Tue Apr 21 20:02:23 2020 +0530 remoteproc: qcom: pas: Add SC7180 Modem support Add support for booting the Modem DSP found on Qualcomm's SC7180 SoCs. Tested-by: Evan Green Reviewed-by: Bjorn Andersson Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-3-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 6b46ddb51eab245c64b6b9c55c189e45967d213f Author: Rikard Falkeborn Date: Sat May 2 11:52:37 2020 +0200 iio: light: ltr501: Constify structs Constify some data structs that are never changed. In order to do so, also update a couple of functions that now need to accept pointers to const struct instead of struct. While at it, update a few more functions to accept pointers to const struct instead of pointers. This allows the compiler to put more data in the code segment instead of the data segment, as seen by the output of the file command: Before: text data bss dec hex filename 27080 8144 192 35416 8a58 drivers/iio/light/ltr501.o After: text data bss dec hex filename 27688 7536 192 35416 8a58 drivers/iio/light/ltr501.o Signed-off-by: Rikard Falkeborn Signed-off-by: Jonathan Cameron commit da7de29bb1716c96cab1566d845e434848604be4 Author: Alexandru Ardelean Date: Fri May 8 17:39:35 2020 +0300 staging: iio: ad5933: attach life-cycle of kfifo buffer to parent device and use managed calls throughout This change makes the use of devm_iio_kfifo_allocate() to attach the life-cycle of the kfifo buffer to the parent (client->dev) object. This removes the need to explicitly free 'indio_dev->buffer' via iio_kfifo_free(), which is the main intent. Having done this, it is straight forward to move to devm_ calls throughout and drop the remove function. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit dee2dabc0e4115b80945fe2c91603e634f4b4686 Author: Andreas Klinger Date: Mon May 4 20:10:34 2020 +0200 iio: bmp280: fix compensation of humidity Limit the output of humidity compensation to the range between 0 and 100 percent. Depending on the calibration parameters of the individual sensor it happens, that a humidity above 100 percent or below 0 percent is calculated, which don't make sense in terms of relative humidity. Add a clamp to the compensation formula as described in the datasheet of the sensor in chapter 4.2.3. Although this clamp is documented, it was never in the driver of the kernel. It depends on the circumstances (calibration parameters, temperature, humidity) if one can see a value above 100 percent without the clamp. The writer of this patch was working with this type of sensor without noting this error. So it seems to be a rare event when this bug occures. Signed-off-by: Andreas Klinger Signed-off-by: Jonathan Cameron commit c12d80aeb9786098d7450911d071e13e6e752e57 Author: Hans de Goede Date: Tue Apr 28 19:29:23 2020 +0200 iio: light: cm32181: Fix integartion time typo Fix integartion time typo and while at it improve the comment with the typo a bit in general. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit d34ca613b93940808ceaae2c405c68313f947f81 Author: Hans de Goede Date: Tue Apr 28 19:29:22 2020 +0200 iio: light: cm32181: Add support for parsing CPM0 and CPM1 ACPI tables On ACPI based systems the CPLM3218 ACPI device node describing the CM3218[1] sensor typically will have some extra tables with register init values for initializing the sensor and calibration info. This is based on a newer version of cm32181.c, with a copyright of: * Copyright (C) 2014 Capella Microsystems Inc. * Author: Kevin Tsai * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2, as published * by the Free Software Foundation. Which is floating around on the net in various places, but the changes from this newer version never made it upstream. This was tested on the following models: Acer Switch 10 SW5-012 (CM32181) Asus T100TA (CM3218), Asus T100CHI (CM3218) and HP X2 10-n000nd (CM32181). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 69acee2e4ee3d719e9424fbcb4528e88a5e695e8 Author: Sibi Sankar Date: Tue Apr 21 20:02:22 2020 +0530 dt-bindings: remoteproc: qcom: Add SC7180 MPSS support Add MPSS PAS support for SC7180 SoCs. Acked-by: Rob Herring Reviewed-by: Bjorn Andersson Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200421143228.8981-2-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 410dcdc2dfd008c6b7559d300488eea2789dad9f Author: Masahiro Yamada Date: Wed Apr 22 23:18:36 2020 +0900 dt-bindings: at24: add microchip, 24lc[0-9]+ to the compatible pattern arch/arm/boot/dts/uniphier-ref-daughter.dtsi has compatible = "microchip,24lc128", "atmel,24c128"; and 'make ARCH=arm dtbs_check' warns this: eeprom@50: compatible: ['microchip,24lc128', 'atmel,24c128'] is not valid under any of the given schemas (Possible causes of the failure) Microchip 24LC128 is the device used on this board, and I see it in https://www.microchip.com/wwwproducts/en/24LC128 Signed-off-by: Masahiro Yamada Signed-off-by: Rob Herring commit 8d99f03c9fd0cf1b07821bb3caf6e3e82fe99646 Author: Anson Huang Date: Tue Apr 21 22:21:26 2020 +0800 dt-bindings: watchdog: Convert i.MX7ULP to json-schema Convert the i.MX7ULP watchdog binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 81e41fec803da7f22401fb4b2e7b61291dff8cf9 Author: Anson Huang Date: Tue Apr 21 22:21:25 2020 +0800 dt-bindings: watchdog: Convert i.MX to json-schema Convert the i.MX watchdog binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 2c504460f502214a26b21c892bd3e5467a3bd754 Author: Anson Huang Date: Tue Apr 21 22:09:41 2020 +0800 dt-bindings: nvmem: Convert MXS OCOTP to json-schema Convert the MXS OCOTP binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit aa3afee63e2cff84fcf292ca7bbbf5a97a6ee8a2 Author: Anson Huang Date: Tue Apr 21 22:09:40 2020 +0800 dt-bindings: nvmem: Convert i.MX IIM to json-schema Convert the i.MX IIM binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 8b2251f75f780c6307c9519cb43200c979e6785c Author: Anson Huang Date: Tue Apr 21 22:09:39 2020 +0800 dt-bindings: nvmem: Convert i.MX OCOTP to json-schema Convert the i.MX OCOTP binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit 493d8f463e2ef32b230347fac5ee6cc4fc71f0b3 Author: Anson Huang Date: Tue Apr 21 22:03:43 2020 +0800 dt-bindings: gpio: Convert i.MX to json-schema Convert the i.MX GPIO binding to DT schema format using json-schema. Signed-off-by: Anson Huang Signed-off-by: Rob Herring commit a0a3e0887d71e7a975373b906fcbdd58962342d6 Author: Anson Huang Date: Tue Apr 21 21:59:04 2020 +0800 dt-bindings: thermal: Convert i.MX8MM to json-schema Convert the i.MX8MM thermal binding to DT schema format using json-schema Signed-off-by: Anson Huang Reviewed-by: Amit Kucheria Signed-off-by: Rob Herring commit b14cd9d5981a26bdfddf2bd7efe6ed5137de0289 Author: Srinivas Pandruvada Date: Fri May 8 11:44:58 2020 -0700 tools/power/x86/intel-speed-select: Update version Update version to include 5.8 series enhancements. Signed-off-by: Srinivas Pandruvada commit 7983ed6f86d67c6bd5e1940b059ce76241f474c5 Author: Srinivas Pandruvada Date: Fri May 1 00:51:59 2020 +0300 tools/power/x86/intel-speed-select: Enable clos for turbo-freq enable turbo-freq enable, requires clos enable. So this is a two step process, when "-a" option is used. This is causing confusion to users. So enable clos by default for turbo-freq enable. Signed-off-by: Srinivas Pandruvada commit 4c35527a92a0f9b63d7c1fae095ddfa5c8ac900f Author: Prarit Bhargava Date: Mon Apr 20 10:10:54 2020 -0400 intel-speed-select: Fix speed-select-base-freq-properties output on CLX-N On CLX-N, the perf-profile-level's output is terminated before the speed-select-base-freq-properties are output which results in a corrupt json file. Adjust the output of speed-select-base-freq-properties by one on CLX-N. Signed-off-by: Prarit Bhargava Cc: Srinivas Pandruvada Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Srinivas Pandruvada commit 28c59ae6965ca0626e3150e2f2863e0f0c810ed7 Author: Prarit Bhargava Date: Thu Apr 2 14:07:32 2020 -0400 tools/power/x86/intel-speed-select: Fix CLX-N package information output On CLX-N the perf-profile output is missing the package, die, and cpu output. On CLX-N the pkg_dev struct will never be evaluated by the core code so pkg_dev.processed is always 0 and the package, die, and cpu information is never output. Set the pkg_dev.processed flag to 1 for CLX-N processors. Signed-off-by: Prarit Bhargava Signed-off-by: Srinivas Pandruvada Cc: andriy.shevchenko@linux.intel.com Cc: Srinivas Pandruvada Cc: platform-driver-x86@vger.kernel.org commit 3d904f066f0f8778780bf8ae67ad756a2f99858c Author: Srinivas Pandruvada Date: Fri Mar 20 10:50:17 2020 -0700 tools/power/x86/intel-speed-select: Check support status before enable When turbo-freq or base-freq feature is not supported, the enable will fail. So first check support status and print error. Signed-off-by: Srinivas Pandruvada commit e78fded4ca016a35e580595d08b3e149e174e120 Author: Srinivas Pandruvada Date: Fri Mar 20 17:17:15 2020 -0700 tools/power/x86/intel-speed-select: Change debug to error When turbo-freq is enabled, we can't disable core-power. Currently it prints debug message to warn. Change this to error message. While here remove "\n" from calls to isst_display_error_info_message(), as it will be added again during actual print. Signed-off-by: Srinivas Pandruvada commit 8096f80a5c09b716be207eb042c4e40d6cdefbd2 Author: Wei Yongjun Date: Sat May 9 08:42:37 2020 +0000 remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init() sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Reviewed-by: Mathieu Poirier Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200509084237.36293-1-weiyongjun1@huawei.com Signed-off-by: Bjorn Andersson commit ef26650a201fbbb4ba90b63a82bf7950f2699a82 Author: YueHaibing Date: Sat May 9 19:20:19 2020 +0800 Smack: Remove unused inline function smk_ad_setfield_u_fs_path_mnt commit a269434d2fb4 ("LSM: separate LSM_AUDIT_DATA_DENTRY from LSM_AUDIT_DATA_PATH") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: Casey Schaufler commit 4dd227a55a9f88618b227eda407d58826bbf4df1 Author: Jay Fang Date: Sat May 9 10:29:51 2020 +0800 spi: dw-mmio: Do not add acpi modalias when CONFIG_ACPI is not enabled Reduce unnecessary static memory allocation when CONFIG_ACPI is not enabled. Signed-off-by: Jay Fang Link: https://lore.kernel.org/r/1588991392-24219-1-git-send-email-f.fangjian@huawei.com Signed-off-by: Mark Brown commit 74750e0621cdcee53a7be72142a080bf40ed90c8 Author: Alistair Francis Date: Sun May 10 21:53:30 2020 -0700 spi: sun6i: Add support for GPIO chip select lines Set use_gpio_descriptors as true to support using generic GPIO lines for the chip select. Signed-off-by: Alistair Francis Link: https://lore.kernel.org/r/20200511045330.690507-1-alistair@alistair23.me Signed-off-by: Mark Brown commit 5bc486156d840c15fb65c96da24f20687a07b2a4 Author: Kunihiko Hayashi Date: Mon May 11 17:25:30 2020 +0900 spi: uniphier: Use devm_platform_get_and_ioremap_resource() to simplify code Use devm_platform_get_and_ioremap_resource() to simplify code instead of platform_get_resource() and devm_ioremap_resource(). This also gets the resource that the following code uses. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1589185530-28170-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 6a091404bf95f1e17d4ad149f1c010a9360e88ba Author: Kunihiko Hayashi Date: Mon May 11 17:25:29 2020 +0900 spi: uniphier: Depend on HAS_IOMEM The driver uses devm_ioremap_resource() which is only available when CONFIG_HAS_IOMEM is set, so the driver depends on this option. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1589185530-28170-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 27e68f086393b34ada9d5e2bb255f74abe7dc19a Merge: b213c2dcbcbc 6834e0bb41bb Author: Eric W. Biederman Date: Mon May 11 12:10:25 2020 -0500 exec: Trivial cleanups for exec This is a continuation of my work to clean up exec so it's more difficult problems are approachable. The changes correct some comments, and moves the point_of_no_return variable up to when the point_of_no_return actually occurs. Eric W. Biederman (5): exec: Move the comment from above de_thread to above unshare_sighand exec: Fix spelling of search_binary_handler in a comment exec: Run sync_mm_rss before taking exec_update_mutex exec: Move handling of the point of no return to the top level exec: Set the point of no return sooner fs/exec.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) Link: https://lkml.kernel.org/r/87sgga6ze4.fsf@x220.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 6834e0bb41bbe144d42b8cd843f3ee30bfe2c825 Author: Eric W. Biederman Date: Sat Apr 4 12:01:37 2020 -0500 exec: Set the point of no return sooner Make the code more robust by marking the point of no return sooner. This ensures that future code changes don't need to worry about how they return errors if they are past this point. This results in no actual change in behavior as __do_execve_file does not force SIGSEGV when there is a pending fatal signal pending past the point of no return. Further the only error returns from de_thread and exec_mmap that can occur result in fatal signals being pending. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/87sgga5klu.fsf_-_@x220.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 8890b29341f30f4a364b2eb6046bb1ac1478f955 Author: Eric W. Biederman Date: Sat Apr 4 09:42:56 2020 -0500 exec: Move handling of the point of no return to the top level Move the handing of the point of no return from search_binary_handler into __do_execve_file so that it is easier to find, and to keep things robust in the face of change. Make it clear that an existing fatal signal will take precedence over a forced SIGSEGV by not forcing SIGSEGV if a fatal signal is already pending. This does not change the behavior but it saves a reader of the code the tedium of reading and understanding force_sig and the signal delivery code. Update the comment in begin_new_exec about where SIGSEGV is forced. Keep point_of_no_return from being a mystery by documenting what the code is doing where it forces SIGSEGV if the code is past the point of no return. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/87y2q25knl.fsf_-_@x220.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit a28bf136e651e17d7e2c753aa140ce3cc1df36a0 Author: Eric W. Biederman Date: Mon Mar 30 16:33:39 2020 -0500 exec: Run sync_mm_rss before taking exec_update_mutex Like exec_mm_release sync_mm_rss is about flushing out the state of the old_mm, which does not need to happen under exec_update_mutex. Make this explicit by moving sync_mm_rss outside of exec_update_mutex. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/875zd66za3.fsf_-_@x220.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 1c8ee8b92fb6ac9d5975147cc902e8c142eca338 Author: Chris Wilson Date: Sun May 10 11:24:31 2020 +0100 drm/i915/gt: Restore Cherryview back to full-ppgtt This reverts commit 0b718ba1e884f64dce27c19311dd2859b87e56b9. There are still some residual issues with asynchronous binding and execution, but since commit 92581f9fb99c ("drm/i915: Immediately execute the fenced work") we prefer not to use asynchronous binds, and the remaining issues do not seem restricted to Cherryview [at least the ones seen over a few dozen CI runs, less frequent issues are sure to be discovered!] These issues seem to be mitigated, if not eliminated entirely, by the previous commit 84eac0c65940 ("drm/i915/gt: Force pte cacheline to main memory"). Signed-off-by: Chris Wilson Acked-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200510102431.21959-3-chris@chris-wilson.co.uk commit 84eac0c65940d9633247b0c8c826d4bcb7307351 Author: Mika Kuoppala Date: Mon May 11 19:08:03 2020 +0300 drm/i915/gt: Force pte cacheline to main memory We have problems of tgl not seeing a valid pte entry when iommu is enabled. Add heavy handed flushing of entry modification by flushing the cpu, cacheline and then wcb. This forces the pte out to main memory past this point regarless of promises of coherency. This is an evolution of an experimental patch from Chris Wilson of adding wmb for coherent partners, by adding a clflush to force the cache->memory step. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1840 Testcase: igt/gem_exec_fence/parallel Signed-off-by: Mika Kuoppala Cc: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200511160803.15407-1-mika.kuoppala@linux.intel.com commit 7fdde0f9a571b1e9a31a839d3e10a3ee46a1145c Author: Bryce Willey Date: Sun May 3 17:49:26 2020 -0400 Documentation: PCI: Give unique labels to sections Make subsection labels more specific to avoid sphinx warnings. Exact warning: Documentation/PCI/endpoint/pci-endpoint.rst:208: WARNING: duplicate label pci/endpoint/pci-endpoint:other apis, other instance in Documentation/PCI/endpoint/pci-endpoint.rst Link: https://lore.kernel.org/r/20200503214926.23748-1-bryce.steven.willey@gmail.com Signed-off-by: Bryce Willey [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas Acked-by: Rob Herring commit 1bec48982c7abb5d1f065ed72181c134a0b67d9b Author: Christoph Hellwig Date: Sun May 10 09:54:42 2020 +0200 MIPS: unexport __flush_icache_user_range __flush_icache_user_range is not used in modular code, so unexport it. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit a1b2eeacbc55573afc56341e08b506aee6451c3d Author: Pascal Terjan Date: Sun May 10 22:25:21 2020 +0100 drm/i915: Remove unused HAS_FWTABLE macro It has been unused since commit ccb2aceaaa5f ("drm/i915: use vfuncs for reg_read/write_fw_domains"). Signed-off-by: Pascal Terjan Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200510212521.128869-1-pterjan@google.com commit 9bad40a27dac1f88012a1e2db0bfc5ae58fa0370 Author: Chris Wilson Date: Mon May 11 15:13:03 2020 +0100 drm/i915/selftests: Always flush before unpining after writing Be consistent, and even when we know we had used a WC, flush the mapped object after writing into it. The flush understands the mapping type and will only clflush if !I915_MAP_WC, but will always insert a wmb [sfence] so that we can be sure that all writes are visible. v2: Add the unconditional wmb so we are know that we always flush the writes to memory/HW at that point. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200511141304.599-1-chris@chris-wilson.co.uk commit b0a997ae5248b293b6f6d1996ea49c57f7b94227 Author: Chris Wilson Date: Sun May 10 11:24:29 2020 +0100 drm/i915: Emit await(batch) before MI_BB_START Be consistent and ensure that we always emit the asynchronous waits prior to issuing instructions that use the address. This ensures that if we do emit GPU commands to do the await, they are before our use! Reviewed-by: Mika Kuoppala Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200510102431.21959-1-chris@chris-wilson.co.uk commit ae979182ebb322ddd159f998ddeed6efa4547073 Author: Stephen Rothwell Date: Mon May 11 14:19:30 2020 +1000 bdi: fix up for "remove the name field in struct backing_dev_info" Fixes: 1cd925d58385 ("bdi: remove the name field in struct backing_dev_info") Signed-off-by: Stephen Rothwell Signed-off-by: Jens Axboe commit 8469508951d4a324b2df3b5bad75e99922c3b798 Author: Xiaoming Ni Date: Mon May 11 19:25:43 2020 +0800 io_uring: remove duplicate semicolon at the end of line Remove duplicate semicolon at the end of line in io_file_from_index() Signed-off-by: Xiaoming Ni Signed-off-by: Jens Axboe commit 44cdc7b16e0a6a69a170cf98006aba1c1359ee3b Author: Hanjun Guo Date: Fri May 8 11:56:38 2020 +0800 ACPI: IORT: Add extra message "applying workaround" for off-by-1 issue As we already applied a workaround for the off-by-1 issue, it's good to add extra message "applying workaround" to make people less uneasy to see FW_BUG message in the boot log. Signed-off-by: Hanjun Guo Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/1588910198-8348-1-git-send-email-guohanjun@huawei.com Signed-off-by: Will Deacon commit 385bbf7b119a4feb6d6bcf3586f1bb1dd9c5b0a0 Author: Gustavo A. R. Silva Date: Thu May 7 13:50:57 2020 -0500 bpf, libbpf: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20200507185057.GA13981@embeddedor commit 81a15b9a65565dc819c909512c9d83620b33e7ec Author: Thomas Zimmermann Date: Thu May 7 11:03:15 2020 +0200 drm/mgag200: Embed connector instance in struct mga_device Storing the connector instance in struct mga_device avoids some dynamic memory allocation. On errors, the connector's initializer function now destroys the i2c structure. Done in preparation of converting mgag200 to simple-KMS helpers. v2: * improved commit message (Michael) * fixed error message for mgag200_vga_connector_init() (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Michael J. Ruhl Acked-by: Sam Ravnborg Tested-by: John Donnelly Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-7-tzimmermann@suse.de commit 30b0c940f94137d1b61f59498ea97c66cf956cd2 Author: Thomas Zimmermann Date: Thu May 7 11:03:14 2020 +0200 drm/mgag200: Remove unused fields from struct mga_device The fields mode_info, num_crtcs and mode in struct mga_device serve no purpose. Remove them. Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Tested-by: John Donnelly Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-6-tzimmermann@suse.de commit 5635b7cf8670367bbf32f8ef7e7d55e79bf227fc Author: Thomas Zimmermann Date: Thu May 7 11:03:13 2020 +0200 drm/mgag200: Use managed mode-config initialization Mode configuration is now cleanued up automatically. While at it, move all mode-config code into mgag200_mode.c. Done in preparation of switching mgag200 to simple-KMS helpers. v2: * improve commit message (Sam) * rebased during cherry pick * also move bpp_shift initialization Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Tested-by: John Donnelly Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-5-tzimmermann@suse.de commit 0858083781b507acb99837d27e4071dc9b0bf976 Author: Thomas Zimmermann Date: Thu May 7 11:03:12 2020 +0200 drm/mgag200: Integrate init function into load function Done to simplify initialization code before embedding the DRM device instance in struct mga_device. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-4-tzimmermann@suse.de commit ed5877b62ec4760f108e5b2b7bc40516638f4f5a Author: Thomas Zimmermann Date: Thu May 7 11:03:11 2020 +0200 drm/mgag200: Remove several references to struct mga_device.dev Done in preparation of embedding the DRM device in struct mga_device. This patch makes the patch for embedding more readable. v2: * improved commit message (Daniel) Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-3-tzimmermann@suse.de commit 8d8ff2a9574e1a822cadf1c346a130f922ae546a Author: Thomas Zimmermann Date: Thu May 7 11:03:10 2020 +0200 drm/mgag200: Convert struct drm_device to struct mga_device with helper Mgag200 uses dev_private to look up struct mga_device for instances of struct drm_device. Use of dev_private is deprecated, so hide it in the helper function to_mga_device(). v2: * make to_mga_device() a function (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-2-tzimmermann@suse.de commit 378252b6e24f764a5e41eb4552f1c3989ca12e81 Author: Paul Cercueil Date: Wed May 6 00:13:36 2020 +0200 rtc: ingenic: Reset regulator register in probe The regulator register specifies how many input clock cycles (minus one) are contained in one tick of the 1 Hz clock. Since this register can contain bogus values after the system boots, it needs to be reset in the probe register, otherwise the RTC may count way to slow or way too fast. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-7-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit 15eeadd801c0ea65c44c01f243f45097ac5970a8 Author: Paul Cercueil Date: Wed May 6 00:13:35 2020 +0200 rtc: ingenic: Fix masking of error code The code was returning -ENOENT on any error of platform_get_irq(), even if it returned a different error. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-6-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit 77d8f3c1226b2ae60b989568a102dd79a8b379f0 Author: Paul Cercueil Date: Wed May 6 00:13:34 2020 +0200 rtc: ingenic: Remove unused fields from private structure The 'clk' and 'irq' fields were only ever used in the probe function. Therefore they can be moved to be simple local variables of the probe function. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-5-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit fe0557f4dbd8cab3fd3a410212157d1a4b67de8b Author: Paul Cercueil Date: Wed May 6 00:13:33 2020 +0200 rtc: ingenic: Set wakeup params in probe We can write the wakeup timing parameters as soon as the driver probes, there's no need to wait the very last moment. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-4-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit 796be8b59dec3efe840a251e2ecc0734408c5ff3 Author: Paul Cercueil Date: Wed May 6 00:13:32 2020 +0200 rtc: ingenic: Enable clock in probe It makes no sense to request a clock and not enable it even though the hardware is being used. So the driver now enables the clock in the probe. Besides, now we can properly handle errors. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-3-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit c61293f147738b4438639ef81124d5ea6246e610 Author: Paul Cercueil Date: Wed May 6 00:13:31 2020 +0200 rtc: ingenic: Use local 'dev' variable in probe Clean a bit the probe function by adding a local struct device *dev variable. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-2-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit 24e1f2c9383e324bac74ee2a78d8450d4d0a1b6f Author: Paul Cercueil Date: Wed May 6 00:13:30 2020 +0200 rtc: ingenic: Only support probing from devicetree With the recent work on supporting Device Tree on Ingenic SoCs, no driver ever probes from platform code anymore, so we can clean a bit this driver by removing the non-devicetree paths. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200505221336.222313-1-paul@crapouillou.net Signed-off-by: Alexandre Belloni commit b92b36eadf4d7fa4a34f048c2a3bb61a735a885e Author: Dan Carpenter Date: Fri May 8 18:07:40 2020 +0300 workqueue: Fix an use after free in init_rescuer() We need to preserve error code before freeing "rescuer". Fixes: f187b6974f6df ("workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO.") Signed-off-by: Dan Carpenter Reviewed-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 8816cd726a4fee197af2d851cbe25991ae19ea14 Author: Qiushi Wu Date: Sun May 3 13:22:35 2020 -0500 rtc: mc13xxx: fix a double-unlock issue In function mc13xxx_rtc_probe, the mc13xxx_unlock() is called before rtc_register_device(). But in the error path of rtc_register_device(), the mc13xxx_unlock() is called again, which causes a double-unlock problem. Thus add a call of the function “mc13xxx_lock” in an if branch for the completion of the exception handling. Fixes: e4ae7023e182a ("rtc: mc13xxx: set range") Signed-off-by: Qiushi Wu Link: https://lore.kernel.org/r/20200503182235.1652-1-wu000273@umn.edu Signed-off-by: Alexandre Belloni commit 32271efded6ca4e92d8f0647dce7fbd94f684a16 Author: Wolfram Sang Date: Sat May 2 16:27:04 2020 +0200 rtc: stmp3xxx: update contact email The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20200502142704.19308-1-wsa@kernel.org Signed-off-by: Alexandre Belloni commit 63a52f63886ab7fa1a28cc7fde08b23682f8fba1 Author: Thierry Reding Date: Fri Apr 17 19:08:25 2020 +0200 rtc: max77686: Use single-byte writes on MAX77620 The MAX77620 doesn't support bulk writes, so make sure the regmap code breaks bulk writes into multiple single-byte writes. Signed-off-by: Thierry Reding Acked-by: Jon Hunter Tested-by: Jon Hunter Link: https://lore.kernel.org/r/20200417170825.2551367-3-thierry.reding@gmail.com Signed-off-by: Alexandre Belloni commit 2aff0d5d61e75660dab30e56ab23f298291d505b Author: Lukas Bulwahn Date: Wed May 6 07:21:30 2020 +0200 MAINTAINERS: correct typo in new NXP LAYERSCAPE GEN4 Commit 3edeb49525bb ("dt-bindings: PCI: Add NXP Layerscape SoCs PCIe Gen4 controller") includes a new entry in MAINTAINERS, but slipped in a typo in one of the file entries. Hence, since then, ./scripts/get_maintainer.pl --self-test complains: warning: no file matches F: \ drivers/pci/controller/mobibeil/pcie-layerscape-gen4.c Correct the typo in PCI DRIVER FOR NXP LAYERSCAPE GEN4 CONTROLLER. Link: https://lore.kernel.org/r/20200506052130.5780-1-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 7d65cf8c1f0ae59ef87e88067379188b46509538 Author: Alexandre Belloni Date: Mon May 11 16:03:35 2020 +0200 rtc: pcf2127: report battery switch over Add support for the RTC_VL_BACKUP_SWITCH flag to report battery switch over events. Link: https://lore.kernel.org/r/20200511140335.799133-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 040e6dc0911c86add1ec3140432672e626b9d4ae Author: Alexandre Belloni Date: Tue May 5 22:13:09 2020 +0200 rtc: pcf2127: set regmap max_register Set regmap max_register to ease debugging and enforce the register range. Link: https://lore.kernel.org/r/20200505201310.255145-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 664eaf033f9f85d67cb9b9e4b1584bd12e4ed20e Author: Alexandre Belloni Date: Tue May 5 22:13:08 2020 +0200 rtc: pcf2127: remove unnecessary #ifdef There is not point in setting .ioctl to NULL when CONFIG_RTC_INTF_DEV is not defined because it would not be called anyway. Link: https://lore.kernel.org/r/20200505201310.255145-3-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit b139bb5c262bb0d152d541a1715792364ad121ce Author: Alexandre Belloni Date: Tue May 5 22:13:07 2020 +0200 rtc: pcf2127: let the core handle rtc range Let the core handle offsetting and windowing the RTC range. Link: https://lore.kernel.org/r/20200505201310.255145-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 734e5e4e268f792d514ec2313792f30ec5f6c94f Author: Alexandre Belloni Date: Tue May 5 22:13:06 2020 +0200 rtc: add new VL flag for backup switchover A new flag RTC_VL_BACKUP_SWITCH means that a backup switchover happened since last flag clear. Link: https://lore.kernel.org/r/20200505201310.255145-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 2733ea144dcce789de20988c1056e228a07b1bff Author: Jason Gunthorpe Date: Fri May 1 15:20:48 2020 -0300 mm/hmm: remove the customizable pfn format from hmm_range_fault Presumably the intent here was that hmm_range_fault() could put the data into some HW specific format and thus avoid some work. However, nothing actually does that, and it isn't clear how anything actually could do that as hmm_range_fault() provides CPU addresses which must be DMA mapped. Perhaps there is some special HW that does not need DMA mapping, but we don't have any examples of this, and the theoretical performance win of avoiding an extra scan over the pfns array doesn't seem worth the complexity. Plus pfns needs to be scanned anyhow to sort out any DEVICE_PRIVATE pages. This version replaces the uint64_t with an usigned long containing a pfn and fixed flags. On input flags is filled with the HMM_PFN_REQ_* values, on successful output it is filled with HMM_PFN_* values, describing the state of the pages. amdgpu is simple to convert, it doesn't use snapshot and doesn't use per-page flags. nouveau uses only 16 hmm_pte entries at most (ie fits in a few cache lines), and it sweeps over its pfns array a couple of times anyhow. It also has a nasty call chain before it reaches the dma map and hardware suggesting performance isn't important: nouveau_svm_fault(): args.i.m.method = NVIF_VMM_V0_PFNMAP nouveau_range_fault() nvif_object_ioctl() client->driver->ioctl() struct nvif_driver nvif_driver_nvkm: .ioctl = nvkm_client_ioctl nvkm_ioctl() nvkm_ioctl_path() nvkm_ioctl_v0[type].func(..) nvkm_ioctl_mthd() nvkm_object_mthd() struct nvkm_object_func nvkm_uvmm: .mthd = nvkm_uvmm_mthd nvkm_uvmm_mthd() nvkm_uvmm_mthd_pfnmap() nvkm_vmm_pfn_map() nvkm_vmm_ptes_get_map() func == gp100_vmm_pgt_pfn struct nvkm_vmm_desc_func gp100_vmm_desc_spt: .pfn = gp100_vmm_pgt_pfn nvkm_vmm_iter() REF_PTES == func == gp100_vmm_pgt_pfn() dma_map_page() Link: https://lore.kernel.org/r/5-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com Acked-by: Felix Kuehling Tested-by: Ralph Campbell Signed-off-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe commit 5c8f3c4cf18ad007242bc370da54d45d4d4293dc Author: Jason Gunthorpe Date: Fri May 1 15:20:47 2020 -0300 mm/hmm: remove HMM_PFN_SPECIAL This is just an alias for HMM_PFN_ERROR, nothing cares that the error was because of a special page vs any other error case. Link: https://lore.kernel.org/r/4-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com Acked-by: Felix Kuehling Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Signed-off-by: Jason Gunthorpe commit 4e2490843d55ffcb128ade3665c238042e36a435 Author: Jason Gunthorpe Date: Fri May 1 15:20:46 2020 -0300 drm/amdgpu: remove dead code after hmm_range_fault() Since amdgpu does not use the snapshot mode of hmm_range_fault() a successful return already proves that all entries in the pfns are HMM_PFN_VALID, there is no need to check the return result of hmm_device_entry_to_page(). Link: https://lore.kernel.org/r/3-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com Acked-by: Felix Kuehling Signed-off-by: Jason Gunthorpe commit be957c886d92aa9caf0f63aee2c77d1497217d93 Author: Jason Gunthorpe Date: Fri May 1 15:20:45 2020 -0300 mm/hmm: make hmm_range_fault return 0 or -1 hmm_vma_walk->last is supposed to be updated after every write to the pfns, so that it can be returned by hmm_range_fault(). However, this is not done consistently. Fortunately nothing checks the return code of hmm_range_fault() for anything other than error. More importantly last must be set before returning -EBUSY as it is used to prevent reading an output pfn as an input flags when the loop restarts. For clarity and simplicity make hmm_range_fault() return 0 or -ERRNO. Only set last when returning -EBUSY. Link: https://lore.kernel.org/r/2-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com Acked-by: Felix Kuehling Tested-by: Ralph Campbell Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe commit c7e8a3d674fbaa5b12ddc681bdf46c34a27e55d5 Author: Ville Syrjälä Date: Wed Mar 11 17:54:22 2020 +0200 drm/i915: Use stashed away hpd isr bits in intel_digital_port_connected() Get rid of several platform specific variants of intel_digital_port_connected() and just use the ISR bits we've stashed away. v2: Duplicate stuff to avoid exposing platform specific functions across files (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200311155422.3043-4-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit c0fc00ec6304a8e2e438ca1688b243815084dc50 Author: Amit Daniel Kachhap Date: Mon May 11 18:31:56 2020 +0530 Documentation/vmcoreinfo: Add documentation for 'KERNELPACMASK' Add documentation for KERNELPACMASK variable being added to the vmcoreinfo. It indicates the PAC bits mask information of signed kernel pointers if Armv8.3-A Pointer Authentication feature is present. Signed-off-by: Amit Daniel Kachhap Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Dave Young Cc: Baoquan He Link: https://lore.kernel.org/r/1589202116-18265-2-git-send-email-amit.kachhap@arm.com Signed-off-by: Will Deacon commit 0398993b82f40ad02d88da7c894e3faae2da3b0a Author: Ville Syrjälä Date: Thu May 7 14:48:08 2020 +0300 drm/i915: Stash hpd status bits under dev_priv Instead of constnantly having to figure out which hpd status bit array to use let's store them under dev_priv. Should perhaps take this further and stash even more stuff to make the hpd handling more abstract yet. v2: Remeber cnp (Imre) Add MISSING_CASE() for unknown PCHs (Imre) Cc: Imre Deak Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200507114808.6150-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 203b1152d18c04823f73b843eb3b0ad646e4dbb2 Author: Amit Daniel Kachhap Date: Mon May 11 18:31:55 2020 +0530 arm64/crash_core: Export KERNELPACMASK in vmcoreinfo Recently arm64 linux kernel added support for Armv8.3-A Pointer Authentication feature. If this feature is enabled in the kernel and the hardware supports address authentication then the return addresses are signed and stored in the stack to prevent ROP kind of attack. Kdump tool will now dump the kernel with signed lr values in the stack. Any user analysis tool for this kernel dump may need the kernel pac mask information in vmcoreinfo to generate the correct return address for stacktrace purpose as well as to resolve the symbol name. This patch is similar to commit ec6e822d1a22d0eef ("arm64: expose user PAC bit positions via ptrace") which exposes pac mask information via ptrace interfaces. The config gaurd ARM64_PTR_AUTH is removed form asm/compiler.h so macros like ptrauth_kernel_pac_mask can be used ungaurded. This config protection is confusing as the pointer authentication feature may be missing at runtime even though this config is present. Signed-off-by: Amit Daniel Kachhap Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Link: https://lore.kernel.org/r/1589202116-18265-1-git-send-email-amit.kachhap@arm.com Signed-off-by: Will Deacon commit edc0e09c6ba81fc7a06cc68deec430519b7d18d8 Author: Ville Syrjälä Date: Wed Mar 11 17:54:20 2020 +0200 drm/i915: Turn intel_digital_port_connected() in a vfunc Let's get rid of the platform if ladders in intel_digital_port_connected() and make it a vfunc. Now the if ladders are at the encoder initialization which makes them a bit less convoluted. v2: Add forward decl for intel_encoder in intel_tc.h v3: Duplicate stuff to avoid exposing platform specific functions across files (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200311155422.3043-2-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 260a6c1bdf1e072ae4d96f0d1ec2917237f1b627 Author: Ville Syrjälä Date: Thu Apr 30 15:58:21 2020 +0300 drm/i915: Fix glk watermark calculations GLK wants the +1 adjustement for the "blocks per line" value for x-tile/y-tile, just like cnl+. Also the x-tile and linear cases are almost identical. The only difference is this +1 which is always done for glk+, and only done for linear on skl/bxt. Let's unify it to a single branch with a special case for the +1, just like we do for y-tile. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200430125822.21985-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 44fb26c6b4c5ad63f733df7936deffeae2950855 Author: Ma Feng Date: Mon May 11 20:07:08 2020 +0800 nfsd: Fix old-style function definition Fix warning: fs/nfsd/nfssvc.c:604:6: warning: old-style function definition [-Wold-style-definition] bool i_am_nfsd() ^~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Ma Feng Signed-off-by: J. Bruce Fields commit edbadaf0671072298e506074128b64e003c5812c Author: Christophe Leroy Date: Wed Apr 8 15:58:49 2020 +0000 powerpc/kasan: Fix stack overflow by increasing THREAD_SHIFT When CONFIG_KASAN is selected, the stack usage is increased. In the same way as x86 and arm64 architectures, increase THREAD_SHIFT when CONFIG_KASAN is selected. Fixes: 2edb16efc899 ("powerpc/32: Add KASAN support") Reported-by: Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://bugzilla.kernel.org/show_bug.cgi?id=207129 Link: https://lore.kernel.org/r/2c50f3b1c9bbaa4217c9a98f3044bd2a36c46a4f.1586361277.git.christophe.leroy@c-s.fr commit 4cdb2da654033d76e1b1cb4ac427d9193dce816b Author: Christophe Leroy Date: Mon Apr 20 18:36:38 2020 +0000 powerpc: Remove _ALIGN_UP(), _ALIGN_DOWN() and _ALIGN() These three powerpc macros have been replaced by equivalent generic macros and are not used anymore. Remove them. Signed-off-by: Christophe Leroy Reviewed-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bb0a6081f7b95ee64ca20f92483e5b9661cbacb2.1587407777.git.christophe.leroy@c-s.fr commit d3f3d3bf76cfb04e73436a15e3987d3573e7523a Author: Christophe Leroy Date: Mon Apr 20 18:36:37 2020 +0000 powerpc: Replace _ALIGN() by ALIGN() _ALIGN() is specific to powerpc ALIGN() is generic and does the same Replace _ALIGN() by ALIGN() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/4006d9c8e69f8eaccee954899f6b5fb76240d00b.1587407777.git.christophe.leroy@c-s.fr commit b711531641038f3ff3723914f3d5ba79848d347e Author: Christophe Leroy Date: Mon Apr 20 18:36:36 2020 +0000 powerpc: Replace _ALIGN_UP() by ALIGN() _ALIGN_UP() is specific to powerpc ALIGN() is generic and does the same Replace _ALIGN_UP() by ALIGN() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/8a6d7e45f7904c73a0af539642d3962e2a3c7268.1587407777.git.christophe.leroy@c-s.fr commit e96d904ede6756641563d27daa746875b478a6c8 Author: Christophe Leroy Date: Mon Apr 20 18:36:35 2020 +0000 powerpc: Replace _ALIGN_DOWN() by ALIGN_DOWN() _ALIGN_DOWN() is specific to powerpc ALIGN_DOWN() is generic and does the same Replace _ALIGN_DOWN() by ALIGN_DOWN() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/3911a86d6b5bfa7ad88cd7c82416fbe6bb47e793.1587407777.git.christophe.leroy@c-s.fr commit 7bfc3c84cbf5167d943cff9b3d2619dab0b7894c Author: Christophe Leroy Date: Mon Apr 20 18:36:34 2020 +0000 drivers/powerpc: Replace _ALIGN_UP() by ALIGN() _ALIGN_UP() is specific to powerpc ALIGN() is generic and does the same Replace _ALIGN_UP() by ALIGN() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/a5945463f86c984151962a475a3ee56a2893e85d.1587407777.git.christophe.leroy@c-s.fr commit 679d74abc4e14cb369e46f080d90f4dc8c143e65 Author: Christophe Leroy Date: Wed May 6 06:51:59 2020 +0000 powerpc/8xx: Update email address in MAINTAINERS Since 01 May 2020, our email adresses have changed to @csgroup.eu Update MAINTAINERS accordingly. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9fd0f9a827ebbeae64ad7a6f6c595d242f4dd5fc.1588747860.git.christophe.leroy@csgroup.eu commit ad0f522df1b2f4fe5d4ae6418e1ea216154a0662 Author: Wolfram Sang Date: Sat May 2 16:26:42 2020 +0200 powerpc/5200: update contact email My 'pengutronix' address is defunct for years. Merge the entries and use the proper contact address. Signed-off-by: Wolfram Sang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200502142642.18979-1-wsa@kernel.org commit bac7ca7b985b72873bd4ac2553b13b5af5b1f08a Author: Andrey Abramov Date: Tue Apr 2 23:47:22 2019 +0300 powerpc: module_[32|64].c: replace swap function with built-in one Replace relaswap with built-in one, because relaswap does a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed-by: George Spelvin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/994931554238042@iva8-b333b7f98ab0.qloud-c.yandex.net commit 2f62870ca5bc9d305f3c212192320c29e9dbdc54 Author: Christophe JAILLET Date: Sat May 2 13:59:49 2020 +0200 powerpc/powernv: Fix a warning message Fix a cut'n'paste error in a warning message. This should be 'cpu-idle-state-residency-ns' to match the property searched in the previous 'of_property_read_u32_array()' Fixes: 9c7b185ab2fe ("powernv/cpuidle: Parse dt idle properties into global structure") Signed-off-by: Christophe JAILLET Reviewed-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200502115949.139000-1-christophe.jaillet@wanadoo.fr commit 7d4343d501f9b5ddbc92f278adba339d16d010e1 Author: Florian Westphal Date: Mon May 11 10:33:42 2020 +0200 xfrm: fix unused variable warning if CONFIG_NETFILTER=n After recent change 'x' is only used when CONFIG_NETFILTER is set: net/ipv4/xfrm4_output.c: In function '__xfrm4_output': net/ipv4/xfrm4_output.c:19:21: warning: unused variable 'x' [-Wunused-variable] 19 | struct xfrm_state *x = skb_dst(skb)->xfrm; Expand the CONFIG_NETFILTER scope to avoid this. Fixes: 2ab6096db2f1 ("xfrm: remove output_finish indirection from xfrm_state_afinfo") Reported-by: Stephen Rothwell Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 90c49a09c8495f1eac05b42a3f79fdc6bcb1eef0 Author: Ville Syrjälä Date: Thu May 7 17:41:25 2020 +0300 drm/i915/mst: Wait for ACT sent before enabling the pipe The correct sequence according to bspec is to wait for the ACT sent status before we turn on the pipe. Make it so. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200507144125.2458-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 4d0f3604c4d181b98104024c837f0e81912f55ef Author: Govind Singh Date: Fri May 8 05:56:10 2020 +0300 ath10k: remove experimental tag from SDIO and SNOC busses in Kconfig ath10k(sdio/snoc) is no longer experimental. Remove experimental tag for SDIO/SNOC from ath10k Kconfig. Signed-off-by: Govind Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507055324.15564-1-govinds@codeaurora.org commit a86308fc534edeceaf64670c691e17485436a4f4 Author: Christophe JAILLET Date: Fri May 8 05:56:03 2020 +0300 wcn36xx: Fix error handling path in 'wcn36xx_probe()' In case of error, 'qcom_wcnss_open_channel()' must be undone by a call to 'rpmsg_destroy_ept()', as already done in the remove function. Fixes: 5052de8deff5 ("soc: qcom: smd: Transition client drivers from smd to rpmsg") Signed-off-by: Christophe JAILLET Reviewed-by: Bjorn Andersson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507043619.200051-1-christophe.jaillet@wanadoo.fr commit d3ed0cf047cf054fd54589e5d4247f0001c5d85c Author: Gustavo A. R. Silva Date: Fri May 8 05:55:52 2020 +0300 ath10k: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507041127.GA31587@embeddedor commit 27143fa93c3b000c968992ca2620e784249862d3 Author: Govind Singh Date: Fri May 8 05:55:48 2020 +0300 ath11k: Remove bus layer includes from upper layer Bus level header files needs to be abstracted by upper layer. Remove bus layer includes by adding appropriate header files. Signed-off-by: Govind Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200506094400.4740-4-govinds@codeaurora.org commit 630ad41c195c7064d16cbe7c53a65f276efcb02c Author: Govind Singh Date: Fri May 8 05:55:48 2020 +0300 ath11k: Add drv private for bus opaque struct Add drv private opaque structure to have bus level structure for multibus support. Signed-off-by: Govind Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200506094400.4740-3-govinds@codeaurora.org commit 31858805f91ac79f0f0d9d982e90c68d6d3ae164 Author: Govind Singh Date: Fri May 8 05:55:44 2020 +0300 ath11k: Add support for multibus support Current design supports only AHB interface for 11ax chipset. Refactor the code by adding hif layer for bus level abstraction to support PCI based device. Signed-off-by: Govind Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200506094400.4740-2-govinds@codeaurora.org commit e47210f72a681b5bd5189831f286053f7a04acb5 Author: Wen Gong Date: Fri May 8 05:55:38 2020 +0300 ath10k: fix __le32 warning in ath10k_wmi_tlv_op_gen_request_peer_stats_info() Sparse warned: drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: expected restricted __le32 [usertype] reset_after_request drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: got unsigned int [usertype] reset Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Fixes: 0f7cb26830a6 ("ath10k: add rx bitrate report for SDIO") Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588747649-18051-1-git-send-email-kvalo@codeaurora.org commit 04a4d3416372ae19471c98ea964a4740d289beac Author: Arnd Bergmann Date: Fri May 8 05:55:30 2020 +0300 wil6210: avoid gcc-10 zero-length-bounds warning gcc-10 warns about accesses inside of a zero-length array: drivers/net/wireless/ath/wil6210/cfg80211.c: In function 'wil_cfg80211_scan': drivers/net/wireless/ath/wil6210/cfg80211.c:970:23: error: array subscript 255 is outside the bounds of an interior zero-length array 'struct [0]' [-Werror=zero-length-bounds] 970 | cmd.cmd.channel_list[cmd.cmd.num_channels++].channel = ch - 1; | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/net/wireless/ath/wil6210/wil6210.h:17, from drivers/net/wireless/ath/wil6210/cfg80211.c:11: drivers/net/wireless/ath/wil6210/wmi.h:477:4: note: while referencing 'channel_list' 477 | } channel_list[0]; | ^~~~~~~~~~~~ Turn this into a flexible array to avoid the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200505143332.1398524-1-arnd@arndb.de commit c730c477176ad4af86d9aae4d360a7ad840b073a Author: Rakesh Pillai Date: Fri May 8 05:55:18 2020 +0300 ath10k: Remove msdu from idr when management pkt send fails Currently when the sending of any management pkt via wmi command fails, the packet is being unmapped freed in the error handling. But the idr entry added, which is used to track these packet is not getting removed. Hence, during unload, in wmi cleanup, all the entries in IDR are removed and the corresponding buffer is attempted to be freed. This can cause a situation where one packet is attempted to be freed twice. Fix this error by rmeoving the msdu from the idr list when the sending of a management packet over wmi fails. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588667015-25490-1-git-send-email-pillair@codeaurora.org commit 7c6d67b136ceb0aebc7a3153b300e925ed915daf Author: Rakesh Pillai Date: Fri May 8 05:55:07 2020 +0300 ath10k: Skip handling del_server during driver exit The qmi infrastructure sends the client a del_server event when the client releases its qmi handle. This is not the msg indicating the actual qmi server exiting. In such cases the del_server msg should not be processed, since the wifi firmware does not reset its qmi state. Hence skip the processing of del_server event when the driver is unloading. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client") Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588663061-12138-1-git-send-email-pillair@codeaurora.org commit 32a2be499c01ee523b28018d451b39ded4297b11 Author: Miles Hu Date: Fri May 8 05:54:57 2020 +0300 ath11k: remove stale monitor status descriptor The driver is not handling monitor status descriptor whenever the done bit of status descriptor is not set by hardware. This leave a stale entry in monitor status ring and flooding warning message. Fix that by removing the descriptor and move forward to next one in monitor status ring. Co-developed-by: Rajkumar Manoharan Signed-off-by: Rajkumar Manoharan Signed-off-by: Miles Hu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588642063-6950-1-git-send-email-rmanohar@codeaurora.org commit 4f43adcdc6a96aba65d29ad15f6296a4940026fc Merge: c50ad6dbf6cc 35e65600808e Author: Mark Brown Date: Mon May 11 13:16:42 2020 +0100 Merge branch 'topic/linear-range' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.8 commit c5b4312bea5d5e5e3d4f0af640e2ef8a1c1bb167 Author: Vesa Jääskeläinen Date: Thu Apr 30 15:37:10 2020 +0300 tee: optee: Add support for session login client UUID generation Adds support for client UUID generation for OP-TEE. For group based session logins membership is verified. Signed-off-by: Vesa Jääskeläinen Signed-off-by: Jens Wiklander commit e33bcbab16d1c0dd85d72bec275308369ad901f5 Author: Vesa Jääskeläinen Date: Thu Apr 30 15:37:09 2020 +0300 tee: add support for session's client UUID generation TEE Client API defines that from user space only information needed for specified login operations is group identifier for group based logins. REE kernel is expected to formulate trustworthy client UUID and pass that to TEE environment. REE kernel is required to verify that provided group identifier for group based logins matches calling processes group memberships. TEE specification only defines that the information passed from REE environment to TEE environment is encoded into on UUID. In order to guarantee trustworthiness of client UUID user space is not allowed to freely pass client UUID. UUIDv5 form is used encode variable amount of information needed for different login types. Signed-off-by: Vesa Jääskeläinen [jw: remove unused variable application_id] Signed-off-by: Jens Wiklander commit a80d73673bc7676d0bab7f7ab51d00c5e461992d Author: Chris Wilson Date: Mon May 11 08:57:07 2020 +0100 drm/i915: Tidy awaiting on dma-fences Just tidy up the return handling for completed dma-fences. While it may return errors for invalid fence, we already know that we have a good fence and the only error will be an already signaled fence. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200511075722.13483-5-chris@chris-wilson.co.uk commit e31fe02eff2610f40ac8d7efe57ec0b881b75508 Author: Mika Kuoppala Date: Mon May 11 13:22:01 2020 +0300 drm/i915: Make intel_timeline_init static Commit fb5970da1b42 ("drm/i915/gt: Use the kernel_context to measure the breadcrumb size") removed the last external user for intel_timeline_init. Mark it static. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200511102201.9275-1-mika.kuoppala@linux.intel.com commit 7d8785bc7adbb4dc5ba8ee06994107637848ded8 Author: Wei Yongjun Date: Sat May 9 09:33:37 2020 +0000 ASoC: SOF: core: fix error return code in sof_probe_continue() Fix to return negative error code -ENOMEM from the IPC init error handling case instead of 0, as done elsewhere in this function. Fixes: c16211d6226d ("ASoC: SOF: Add Sound Open Firmware driver core") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200509093337.78897-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit d9a2d100c96d3ae6253926e3f11c55242907a30c Author: Tzung-Bi Shih Date: Mon May 11 12:40:00 2020 +0800 ASoC: mediatek: mt8183-da7219: set headset button maps Sets headset button maps. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200511044000.86161-1-tzungbi@google.com Signed-off-by: Mark Brown commit fd868f14818901821699988fdac680ebd80cd360 Author: Luke Nelson Date: Fri May 8 11:15:46 2020 -0700 bpf, arm64: Optimize ADD,SUB,JMP BPF_K using arm64 add/sub immediates The current code for BPF_{ADD,SUB} BPF_K loads the BPF immediate to a temporary register before performing the addition/subtraction. Similarly, BPF_JMP BPF_K cases load the immediate to a temporary register before comparison. This patch introduces optimizations that use arm64 immediate add, sub, cmn, or cmp instructions when the BPF immediate fits. If the immediate does not fit, it falls back to using a temporary register. Example of generated code for BPF_ALU64_IMM(BPF_ADD, R0, 2): without optimization: 24: mov x10, #0x2 28: add x7, x7, x10 with optimization: 24: add x7, x7, #0x2 The code could use A64_{ADD,SUB}_I directly and check if it returns AARCH64_BREAK_FAULT, similar to how logical immediates are handled. However, aarch64_insn_gen_add_sub_imm from insn.c prints error messages when the immediate does not fit, and it's simpler to check if the immediate fits ahead of time. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Acked-by: Daniel Borkmann Link: https://lore.kernel.org/r/20200508181547.24783-4-luke.r.nels@gmail.com Signed-off-by: Will Deacon commit fd49591cb49b72abd1b665222a635ccb17df7923 Author: Luke Nelson Date: Fri May 8 11:15:45 2020 -0700 bpf, arm64: Optimize AND,OR,XOR,JSET BPF_K using arm64 logical immediates The current code for BPF_{AND,OR,XOR,JSET} BPF_K loads the immediate to a temporary register before use. This patch changes the code to avoid using a temporary register when the BPF immediate is encodable using an arm64 logical immediate instruction. If the encoding fails (due to the immediate not being encodable), it falls back to using a temporary register. Example of generated code for BPF_ALU32_IMM(BPF_AND, R0, 0x80000001): without optimization: 24: mov w10, #0x8000ffff 28: movk w10, #0x1 2c: and w7, w7, w10 with optimization: 24: and w7, w7, #0x80000001 Since the encoding process is quite complex, the JIT reuses existing functionality in arch/arm64/kernel/insn.c for encoding logical immediates rather than duplicate it in the JIT. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Acked-by: Daniel Borkmann Link: https://lore.kernel.org/r/20200508181547.24783-3-luke.r.nels@gmail.com Signed-off-by: Will Deacon commit 579d1b3faa3735e781ff74aac0afd598515dbc63 Author: Luke Nelson Date: Fri May 8 11:15:44 2020 -0700 arm64: insn: Fix two bugs in encoding 32-bit logical immediates This patch fixes two issues present in the current function for encoding arm64 logical immediates when using the 32-bit variants of instructions. First, the code does not correctly reject an all-ones 32-bit immediate, and returns an undefined instruction encoding. Second, the code incorrectly rejects some 32-bit immediates that are actually encodable as logical immediates. The root cause is that the code uses a default mask of 64-bit all-ones, even for 32-bit immediates. This causes an issue later on when the default mask is used to fill the top bits of the immediate with ones, shown here: /* * Pattern: 0..01..10..01..1 * * Fill the unused top bits with ones, and check if * the result is a valid immediate (all ones with a * contiguous ranges of zeroes). */ imm |= ~mask; if (!range_of_ones(~imm)) return AARCH64_BREAK_FAULT; To see the problem, consider an immediate of the form 0..01..10..01..1, where the upper 32 bits are zero, such as 0x80000001. The code checks if ~(imm | ~mask) contains a range of ones: the incorrect mask yields 1..10..01..10..0, which fails the check; the correct mask yields 0..01..10..0, which succeeds. The fix for both issues is to generate a correct mask based on the instruction immediate size, and use the mask to check for all-ones, all-zeroes, and values wider than the mask. Currently, arch/arm64/kvm/va_layout.c is the only user of this function, which uses 64-bit immediates and therefore won't trigger these bugs. We tested the new code against llvm-mc with all 1,302 encodable 32-bit logical immediates and all 5,334 encodable 64-bit logical immediates. Fixes: ef3935eeebff ("arm64: insn: Add encoder for bitwise operations using literals") Suggested-by: Will Deacon Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20200508181547.24783-2-luke.r.nels@gmail.com Signed-off-by: Will Deacon commit c81992e7f4aa19a055dbff5bd6c6d5ff9408f2fb Author: Wei Hu Date: Thu May 7 13:03:00 2020 +0800 PCI: hv: Retry PCI bus D0 entry on invalid device state When kdump is triggered, some PCI devices may have not been shut down cleanly before the kdump kernel starts. This causes the initial attempt to enter D0 state in the kdump kernel to fail with invalid device state returned from Hyper-V host. When this happens, explicitly call hv_pci_bus_exit() and retry to enter the D0 state. Link: https://lore.kernel.org/r/20200507050300.10974-1-weh@microsoft.com Signed-off-by: Wei Hu [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley commit 83cc3508ffaa6e2cd364d29418d35fab6f069b51 Author: Wei Hu Date: Thu May 7 13:02:11 2020 +0800 PCI: hv: Fix the PCI HyperV probe failure path to release resource properly In some error cases in hv_pci_probe(), allocated resources are not freed. Fix this by adding a field to keep track of the high water mark for slots that have resources allocated to them. In case of an error, this high water mark is used to know which slots have resources that must be released. Since slots are numbered starting with zero, a value of -1 indicates no slots have been allocated resources. There may be unused slots in the range between slot 0 and the high water mark slot, but these slots are already ignored by the existing code in the allocate and release loops with the call to get_pcichild_wslot(). Link: https://lore.kernel.org/r/20200507050211.10923-1-weh@microsoft.com Signed-off-by: Wei Hu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley commit 35e65600808e257547f53f5c69c1a4eb6fc01c49 Author: Matti Vaittinen Date: Sat May 9 18:15:19 2020 +0300 lib: linear_ranges: Add missing MODULE_LICENSE() When linear_ranges is compiled as module we get warning about missing MODULE_LICENSE(). Fix it by adding MODULE_LICENSE("GPL") as is suggested by SPDX and EXPORTs. Signed-off-by: Matti Vaittinen Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20200509151519.GA7100@localhost.localdomain Signed-off-by: Mark Brown commit caab002d5069f8610a6ec1d2addeef21f4f96909 Author: Jim Quinlan Date: Thu May 7 16:15:43 2020 -0400 PCI: brcmstb: Disable L0s component of ASPM if requested Some informal internal experiments has shown that the BrcmSTB ASPM L0s savings may introduce an undesirable noise signal on some customers' boards. In addition, L0s was found lacking in realized power savings, especially relative to the L1 ASPM component. This is BrcmSTB's experience and may not hold for others. At any rate, if the 'aspm-no-l0s' property is present L0s will be disabled. Link: https://lore.kernel.org/r/20200507201544.43432-5-james.quinlan@broadcom.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Acked-by: Florian Fainelli Acked-by: Nicolas Saenz Julienne commit 420c517b1e30faa4a102f884045496a1280eab1c Author: Jim Quinlan Date: Thu May 7 16:15:42 2020 -0400 dt-bindings: PCI: brcmstb: New prop 'aspm-no-l0s' For various reasons, one may want to disable the ASPM L0s capability. Link: https://lore.kernel.org/r/20200507201544.43432-4-james.quinlan@broadcom.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 077a4fa92a615a4d0f86eae68d777b9dd5e5a95b Author: Jim Quinlan Date: Thu May 7 16:15:41 2020 -0400 PCI: brcmstb: Fix window register offset from 4 to 8 The outbound memory window registers were being referenced with an incorrect stride offset. This probably wasn't noticed previously as there was likely only one such window employed. Link: https://lore.kernel.org/r/20200507201544.43432-3-james.quinlan@broadcom.com Fixes: c0452137034b ("PCI: brcmstb: Add Broadcom STB PCIe host controller driver") Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Acked-by: Florian Fainelli Acked-by: Nicolas Saenz Julienne commit b382e4a0a18f4abfd4d53f32a03dd6bb60df758a Author: Jim Quinlan Date: Thu May 7 16:15:40 2020 -0400 PCI: brcmstb: Don't clk_put() a managed clock clk_put() was being invoked on a clock obtained by devm_clk_get_optional(). Link: https://lore.kernel.org/r/20200507201544.43432-2-james.quinlan@broadcom.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Acked-by: Florian Fainelli Acked-by: Nicolas Saenz Julienne commit 22e21e51ce755399fd42055a3f668ee4af370881 Author: Nicolas Saenz Julienne Date: Thu May 7 19:20:20 2020 +0200 PCI: brcmstb: Assert fundamental reset on initialization While preparing the driver for upstream this detail was missed. If not asserted during the initialization process, devices connected on the bus will not be made aware of the internal reset happening. This, potentially resulting in unexpected behavior. Link: https://lore.kernel.org/r/20200507172020.18000-1-nsaenzjulienne@suse.de Fixes: c0452137034b ("PCI: brcmstb: Add Broadcom STB PCIe host controller driver") Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Lorenzo Pieralisi Acked-by: Florian Fainelli commit 975cf23e3aa89588cbfc9ad6f2b23bd32af4edc7 Author: Lad Prabhakar Date: Thu May 7 13:33:15 2020 +0100 PCI: endpoint: Pass page size as argument to pci_epc_mem_init() pci_epc_mem_init() internally used page size equal to *PAGE_SIZE* to manage the address space so instead just pass the page size as a argument to pci_epc_mem_init(). Also make pci_epc_mem_init() as a C function instead of a macro function in preparation for adding support for pci-epc-mem core to handle multiple windows. Link: https://lore.kernel.org/r/1588854799-13710-5-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda Acked-by: Kishon Vijay Abraham I commit 328263687148bebf0d5daf5d06bcc2a46f3d7b0a Author: Lad Prabhakar Date: Thu May 7 13:33:14 2020 +0100 PCI: rcar: Fix calculating mask for PCIEPAMR register The mask value was calculated incorrectly for PCIEPAMR register if the size was less than 128 bytes. Fix this issue by adding a check on size. Link: https://lore.kernel.org/r/1588854799-13710-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda commit 78a0d7f2f5a31357bce68012d886507b4cf33598 Author: Lad Prabhakar Date: Thu May 7 13:33:13 2020 +0100 PCI: rcar: Move shareable code to a common file Move shareable code to common file pcie-rcar.c and the #defines to pcie-rcar.h so that the common code can be reused with endpoint driver. There are no functional changes with this patch for the host controller driver. Link: https://lore.kernel.org/r/1588854799-13710-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda commit a18f4b6ea50b81e28bd05381883a531ab345f753 Author: Lad Prabhakar Date: Thu May 7 13:33:12 2020 +0100 PCI: rcar: Rename pcie-rcar.c to pcie-rcar-host.c This commit renames pcie-rcar.c to pcie-rcar-host.c in preparation for adding support for endpoint mode. CONFIG_PCIE_RCAR is kept so that arm64 defconfig change can be a separate patch. With this patch both config options PCIE_RCAR and PCIE_RCAR_HOST will be available but PCIE_RCAR internally selects PCIE_RCAR_HOST so that bisect builds wont be affected. Link: https://lore.kernel.org/r/1588854799-13710-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda commit 913b99f70feb1cd9fb4bbcb302a029b4b9bee454 Author: Gustavo A. R. Silva Date: Thu May 7 14:25:24 2020 -0500 thunderbolt: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mika Westerberg commit e625e50ceee18bc1e3fb1a6375e089405a797a4d Author: Marcel Holtmann Date: Wed May 6 09:57:52 2020 +0200 Bluetooth: Introduce debug feature when dynamic debug is disabled In case dynamic debug is disabled, this feature allows a vendor platform to provide debug statement printing. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit a10c907ce0e5e138c3da091fcb7c3d109a15aec5 Author: Marcel Holtmann Date: Wed May 6 09:57:51 2020 +0200 Bluetooth: Add support for experimental features configuration To enable platform specific experimental features, introduce this new set of management commands and events. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 568602457c1ab6d26db828de168e4ef35b88f1bc Author: Marcel Holtmann Date: Wed May 6 09:57:50 2020 +0200 Bluetooth: Replace BT_DBG with bt_dev_dbg for security manager support The security manager operates on a specific controller and thus use bt_dev_dbg to indetify the controller for each debug message. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit d5cc6626b33780699c7a4986f3521361306862fe Author: Marcel Holtmann Date: Wed May 6 09:57:49 2020 +0200 Bluetooth: Introduce HCI_MGMT_HDEV_OPTIONAL option When setting HCI_MGMT_HDEV_OPTIONAL it is possible to target a specific conntroller or a global interface. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 14a81bf021fb428d1df484dba37bea155e8eec0f Author: Marcel Holtmann Date: Wed May 6 09:57:48 2020 +0200 Bluetooth: replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 181d695352305cc52a49c151a1c3370376e54887 Author: Marcel Holtmann Date: Wed May 6 09:57:47 2020 +0200 Bluetooth: Replace BT_DBG with bt_dev_dbg for management support The majority of management interaction are based on a controller index and have a hci_dev associated with it. So use bt_dev_dbg to have a clean way of indentifying the controller the debug message belongs to. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 5f4b91728bba007be563fa5a3bd5d96b6a03b3b9 Author: Marcel Holtmann Date: Wed May 6 09:57:46 2020 +0200 Bluetooth: Add MGMT_EV_PHY_CONFIGURATION_CHANGED to supported list The event MGMT_EV_PHY_CONFIGURATION_CHANGED wasn't listed in the list of supported events. So add it. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 69d67b461a180144ad1d31174fadf3e3eda78e56 Author: Konstantin Forostyan Date: Mon May 4 16:01:49 2020 +0000 Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17) Fix 2 typos in L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17) handling function, that cause BlueZ answer with L2CAP_CR_LE_INVALID_PARAMS or L2CAP_CR_LE_INVALID_SCID error on a correct ECRED connection request. Enchanced Credit Based Mode support was recently introduced with the commit 15f02b91056253e8cdc592888f431da0731337b8 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode"). Signed-off-by: Konstantin Forostyan Signed-off-by: Marcel Holtmann commit eaa7b7228ff7f8688623120bb0cd75d1490d5d04 Author: Tedd Ho-Jeong An Date: Fri May 1 10:00:50 2020 -0700 Bluetooth: Fix advertising handle is set to 0 This patch fix the advertising handle is set to 0 regardless of actual instance value. The affected commands are LE Set Advertising Set Random Address, LE Set Extended Advertising Data, and LE Set Extended Scan Response Data commands. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 4765db373ea34c7262e3467f8aaf4167dd1cdafa Author: Vasily Khoruzhick Date: Sat Apr 25 08:55:30 2020 -0700 Bluetooth: hci_h5: Add support for binding RTL8723BS with device tree RTL8723BS is often used in ARM boards, so add ability to bind it using device tree. Signed-off-by: Vasily Khoruzhick Signed-off-by: Alistair Francis Signed-off-by: Marcel Holtmann commit 1cc2d0e021f8675065b8c5dc74305789d9e54113 Author: Vasily Khoruzhick Date: Sat Apr 25 08:55:29 2020 -0700 dt-bindings: net: bluetooth: Add rtl8723bs-bluetooth Add binding document for bluetooth part of RTL8723BS/RTL8723CS Signed-off-by: Vasily Khoruzhick Signed-off-by: Alistair Francis Signed-off-by: Marcel Holtmann commit f4d49692ad76804eb3d19e605bc5fc24d463efaa Author: Chris Wilson Date: Mon May 11 08:57:03 2020 +0100 drm/i915/gt: Mark up the racy read of execlists->context_tag Since we are using bitops on context_tag to allow us to reserve and release inflight tags concurrently, the scan for the next bit is intentionally racy. [ 516.446854] BUG: KCSAN: data-race in execlists_schedule_in.isra.0 [i915] / execlists_schedule_out [i915] [ 516.446874] [ 516.446886] write (marked) to 0xffff8881f7644048 of 8 bytes by interrupt on cpu 2: [ 516.447076] execlists_schedule_out+0x538/0x6a0 [i915] [ 516.447263] process_csb+0x10b/0x3d0 [i915] [ 516.447449] execlists_submission_tasklet+0x30/0x170 [i915] [ 516.447468] tasklet_action_common.isra.0+0x42/0x90 [ 516.447484] __do_softirq+0xc8/0x206 [ 516.447498] irq_exit+0xcd/0xe0 [ 516.447516] do_IRQ+0x44/0xc0 [ 516.447535] ret_from_intr+0x0/0x1c [ 516.447550] cpuidle_enter_state+0x199/0x400 [ 516.447572] cpuidle_enter+0x50/0x90 [ 516.447587] do_idle+0x197/0x1e0 [ 516.447600] cpu_startup_entry+0x14/0x20 [ 516.447619] start_secondary+0xf9/0x130 [ 516.447643] secondary_startup_64+0xa4/0xb0 [ 516.447655] [ 516.447671] read to 0xffff8881f7644048 of 8 bytes by task 460 on cpu 1: [ 516.447863] execlists_schedule_in.isra.0+0x3cf/0x5a0 [i915] [ 516.448064] execlists_dequeue+0xf8f/0x1690 [i915] [ 516.448252] __execlists_submission_tasklet+0x48/0x60 [i915] [ 516.448440] execlists_submit_request+0x2e2/0x310 [i915] [ 516.448634] submit_notify+0x8f/0xc8 [i915] [ 516.448820] __i915_sw_fence_complete+0x61/0x420 [i915] [ 516.449005] i915_sw_fence_complete+0x58/0x80 [i915] [ 516.449208] i915_sw_fence_commit+0x16/0x20 [i915] [ 516.449399] __i915_request_queue+0x60/0x70 [i915] [ 516.449590] i915_gem_do_execbuffer+0x33f1/0x4a00 [i915] [ 516.449782] i915_gem_execbuffer2_ioctl+0x2a2/0x550 [i915] [ 516.449800] drm_ioctl_kernel+0xe9/0x130 [ 516.449814] drm_ioctl+0x27d/0x45e [ 516.449827] ksys_ioctl+0x89/0xb0 [ 516.449842] __x64_sys_ioctl+0x42/0x60 [ 516.449864] do_syscall_64+0x6e/0x2c0 [ 516.449878] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200511075722.13483-1-chris@chris-wilson.co.uk commit 63605f1cfcc56bcb25c48bbee75a679d85ba7675 Author: Pali Rohár Date: Tue Apr 14 12:25:12 2020 +0200 PCI: tegra: Fix reporting GPIO error value Error code is stored in rp->reset_gpio and not in err variable. Link: https://lore.kernel.org/r/20200414102512.27506-1-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Thierry Reding Acked-by: Rob Herring commit b5c08eb306abe5f00bee7220e8d3b62040edf28e Author: Geert Uytterhoeven Date: Mon Apr 13 12:41:53 2020 +0200 m68k: defconfig: Update defconfigs for v5.7-rc1 - Enable modular build of Bare UDP Encapsulation, exFAT filesystem support, and lockup and min heap test modules, - Remove CONFIG_NF_TABLES_SET=m (removed in commit e32a4dc6512ce3c1 ("netfilter: nf_tables: make sets built-in")), - Disable CONFIG_VHOST_MENU (should default to n). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200413104153.30517-1-geert@linux-m68k.org commit 7fc3b53a7bd6ebfffd22a75f57175b80fa3df834 Author: Lad Prabhakar Date: Wed May 6 20:51:35 2020 +0100 ARM: dts: r8a7742: Add GPIO nodes Describe GPIO blocks in the R8A7742 device tree. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588794695-27852-10-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit b2cb7d8d5f0c63615e38bfae2d632faf33aa8601 Author: Lad Prabhakar Date: Wed May 6 20:51:33 2020 +0100 ARM: dts: r8a7742: Add [H]SCIF{A|B} support Describe [H]SCIF{A|B} ports in the R8A7742 device tree. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588794695-27852-8-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a31a8c9cbc0762b096e0b176ba481a60e54db5bf Author: Lad Prabhakar Date: Wed May 6 20:51:29 2020 +0100 ARM: dts: r8a7742: Add IRQC support Describe the IRQC interrupt controller in the r8a7742 device tree. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/1588794695-27852-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d8ef2b73a459e448fc22b237a54e61855ef7ba3b Author: Boris Brezillon Date: Fri May 1 16:39:17 2020 +0200 mtd: rawnand: diskonchip: Get rid of the legacy interface implementation Now that exec_op() has been implemented we can get rid of the legacy interface implementation. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-6-boris.brezillon@collabora.com commit f46eb7affbda926a7379c0e13b7fa815ebfbb50d Author: Boris Brezillon Date: Fri May 1 16:39:16 2020 +0200 mtd: rawnand: diskonchip: Implement exec_op() Implement exec_op() so we can later get rid of the legacy implementation. It's worth noting that the new implementation assert/deassert the CE pin on each operation, which might not be necessary. We also dropped the extra reset done at chip selection time on DOC2001plus. If it's needed we really should do something smarter, because having a reset everytime we access the chip is not that great perf-wise. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-5-boris.brezillon@collabora.com commit f37b1d3c8f3682eb654ad914ca69503f5b98941d Author: Boris Brezillon Date: Fri May 1 16:39:15 2020 +0200 mtd: rawnand: diskonchip: Inherit from nand_controller Stop relying on the dummy controller object embedded in nand_chip.legacy and explicitly inherit from nand_controller. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-4-boris.brezillon@collabora.com commit fddf5cec1cc6321712fc6f0749dd57847b554662 Author: Boris Brezillon Date: Fri May 1 16:39:14 2020 +0200 mtd: rawnand: diskonchip: Get rid of doc2000_readbuf_dword() The logic can easily be merged in doc2000_readbuf(). Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-3-boris.brezillon@collabora.com commit a50b0c20bedcf10599708bed1608209274899053 Author: Boris Brezillon Date: Fri May 1 16:39:13 2020 +0200 mtd: rawnand: diskonchip: Make sure doc2001plus_readbuf() works for single byte reads Single byte accesses normally go through read_byte() but we are about to use this function in the exec_op() implementation and thus needs to prepare for single byte reads. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-2-boris.brezillon@collabora.com commit dace12ccfd08793a393d6933d2b95af5db7e46ec Author: Boris Brezillon Date: Mon May 11 08:49:17 2020 +0200 mtd: rawnand: diskonchip: Set the NAND_NO_BBM_QUIRK flag We have a dummy block_bad() implementation returning 0. Let's set the NAND_NO_BBM_QUIRK flag and let the core take care of that. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200511064917.6255-3-boris.brezillon@collabora.com commit 8420c68a16ce38794efa494c14ee73ecdc64b12f Author: Boris Brezillon Date: Mon May 11 08:49:16 2020 +0200 mtd: rawnand: cafe: Set the NAND_NO_BBM_QUIRK flag We have a dummy block_bad() implementation returning 0. Let's set the NAND_NO_BBM_QUIRK flag and let the core take care of that. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200511064917.6255-2-boris.brezillon@collabora.com commit ec7cfc3d763c761ff1ad5a4e66c4f94098d7e161 Author: Boris Brezillon Date: Mon May 11 08:49:15 2020 +0200 mtd: rawnand: Add a NAND_NO_BBM_QUIRK flag Some controllers with embedded ECC engines override the BBM marker with data or ECC bytes, thus making bad block detection through bad block marker impossible. Let's flag those chips so the core knows it shouldn't check the BBM and consider all blocks good. This should allow us to get rid of two implementers of the legacy.block_bad() hook. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200511064917.6255-1-boris.brezillon@collabora.com commit 22dc5f9d490655a4ae1fbc55f93daa8e85b1c38f Author: Miquel Raynal Date: Thu May 7 12:52:41 2020 +0200 mtd: rawnand: micron: Allow controllers to overload raw accessors Some controller drivers do not support executing regular nand_read/write_page_raw() helpers. For that, we created nand_monolithic_read/write_page_raw() alternatives. Let's now allow the driver to overload the ECC ->read/write_page_raw() hooks when these hooks are supported. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-14-miquel.raynal@bootlin.com commit 0e7f4b64ea46da6da5d84709d0316df9a7145f76 Author: Miquel Raynal Date: Thu May 7 12:52:40 2020 +0200 mtd: rawnand: Allow controllers to overload soft ECC hooks Some controller drivers do not support executing regular nand_read/write_page_raw() helpers. For that, we created nand_monolithic_read/write_page_raw() alternatives. Let's now allow the driver to overload the ECC ->read/write_page_raw() hooks. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-13-miquel.raynal@bootlin.com commit 658beb6639606268bd48eb7de7cf308d6b10600f Author: Miquel Raynal Date: Thu May 7 12:52:39 2020 +0200 mtd: rawnand: Expose monolithic read/write_page_raw() helpers The current nand_read/write_page_raw() helpers are already widely used but do not fit the purpose of "constrained" controllers which cannot, for instance, separate command/address cycles with data cycles. Workaround this issue by proposing alternative helpers that can be used by these controller drivers instead. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-12-miquel.raynal@bootlin.com commit daca31765e8bea70373fc9e604f562942168300b Author: Miquel Raynal Date: Thu May 7 12:52:38 2020 +0200 mtd: rawnand: jedec: Adapt the parameter page read to constraint controllers We already know that there are controllers not able to read the three copies of the parameter page in one go. The workaround was to first request the controller to assert command and address cycles on the NAND bus to trigger a parameter page read, and then do a read operation for each page. But there are also controllers which are not able to split the parameter page read between the command/address cycles and the actual data operation. Let's use a regular PARAMETER PAGE READ operation for the first iteration and use eithe a CHANGE READ COLUMN or a simple DATA READ operation for the following copies, depending on what the controller supports. The default for non-exec-op compliant drivers remains unchanged: use a SIMPLE READ. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-11-miquel.raynal@bootlin.com commit c27842e7e11f97f0ba5f668953327acdb141c452 Author: Miquel Raynal Date: Thu May 7 12:52:37 2020 +0200 mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers We already know that there are controllers not able to read the three copies of the parameter page in one go. The workaround was to first request the controller to assert command and address cycles on the NAND bus to trigger a parameter page read, and then do a simple read operation for each page. But there are also controllers which are not able to split the parameter page read between the command/address cycles and the actual data operation. Let's use a regular PARAMETER PAGE READ operation for the first iteration and use either a CHANGE READ COLUMN or a simple DATA READ operation for the following copies, depending on what the controller supports. The default behavior for non-exec-op compliant drivers remains the same: DATA READ. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-10-miquel.raynal@bootlin.com commit b451f5beece3f5556920992e7498d23f6da6ef6e Author: Miquel Raynal Date: Thu May 7 12:52:36 2020 +0200 mtd: rawnand: Give the possibility to verify a read operation is supported This can be used to discriminate between two path in the parameter page detection: use data_in cycles (like before) if supported, use the CHANGE READ COLUMN command otherwise. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-9-miquel.raynal@bootlin.com commit 930370253ec51fccebb743409428ac2f364b3559 Author: Miquel Raynal Date: Thu May 7 12:52:35 2020 +0200 mtd: rawnand: Add a helper to check supported operations Let's use a helper to clearly check if an operation is supported or not. Return -ENOTSUPP when ->exec_op() is not implemented as we cannot know. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-8-miquel.raynal@bootlin.com commit 21b5cf3f6467cf608756151066941792f340c986 Author: Miquel Raynal Date: Thu May 7 12:52:34 2020 +0200 mtd: rawnand: Avoid indirect access to ->data_buf() The logic in nand_do_read_ops() is to use a bufpoi variable, either set to the original buffer, or set to a bounce buffer which in the end happens to be chip->data_buf depending on the value of the use_bounce_buf boolean. This is not a reason to call chip->data_buf directly when we know that we are using the bounce buffer. Let's use bufpoi instead to be consistent. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-7-miquel.raynal@bootlin.com commit 6446907307da6e3e490b1d9169d6ebab6622dee0 Author: Miquel Raynal Date: Thu May 7 12:52:33 2020 +0200 mtd: rawnand: Rename the use_bufpoi variables Both in nand_do_read_ops() and nand_do_write_ops() there is a boolean called use_bufpoi which is set to true in case of unaligned request or when there is a need for a DMA-able buffer. It basically means "use a bounce buffer". Depending on the value of use_bufpoi, the bufpoi variable is always used and will either point to the original buffer or to the nand_chip structure "internal data buffer" (this buffer is allocated with kmalloc() on purpose so that it will be DMA-compliant). In all cases bufpoi is used so the boolean name is misleading. Rename use_bufpoi to be use_bouce_buf to be more accurate. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-6-miquel.raynal@bootlin.com commit 2f959949f2149eb0f76aeea8020e8c7865bb0c53 Author: Miquel Raynal Date: Thu May 7 12:52:32 2020 +0200 mtd: rawnand: Fix comments about the use of bufpoi Clarify these comments which are not very accurate (even wrong in the read case). Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-5-miquel.raynal@bootlin.com commit ce8148d7b8f204a18188e3cd7386c8dddbb461a1 Author: Miquel Raynal Date: Thu May 7 12:52:31 2020 +0200 mtd: rawnand: Rename a NAND chip option NAND controller drivers can set the NAND_USE_BOUNCE_BUFFER flag to a chip 'option' field. With this flag, the core is responsible of providing DMA-able buffers. The current behavior is to not force the use of a bounce buffer when the core thinks this is not needed. So in the end the name is a bit misleading, because in theory we will always have a DMA buffer but in practice it will not always be a bounce buffer. Rename this flag NAND_USES_DMA to be more accurate. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-4-miquel.raynal@bootlin.com commit 96d627bdf112d116a79c86435550cd18b9a9d82b Author: Miquel Raynal Date: Thu May 7 12:52:30 2020 +0200 mtd: rawnand: Reorder the nand_chip->options flags These flags are in a strange order, reorder the list, add spaces when it is relevant, pack definitions that are related. There is no functional change. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-3-miquel.raynal@bootlin.com commit dd6ed5c9890b759ba1b56697b9f3f50e71909e43 Author: Miquel Raynal Date: Thu May 7 12:52:29 2020 +0200 mtd: rawnand: Translate obscure bitfields into readable macros Use the BIT() macro instead of defining a 8-digit value. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-2-miquel.raynal@bootlin.com commit 66aaba3a07cb8e53878bbeabe54660a646b55a34 Author: Boris Brezillon Date: Sun May 3 17:53:41 2020 +0200 ubi: Relax the 'no MLC' rule and allow MLCs operating in SLC mode The MTD layer provides an SLC mode (purely software emulation of SLC behavior) addressing the paired-pages corruption issue, which was the main reason for refusing attaching MLC NANDs to UBI. Relax this rule and allow partitions that have the MTD_EMULATE_SLC_ON_MLC flag set to be attached. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Richard Weinberger Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-9-miquel.raynal@bootlin.com commit 568d841b6837fc2bb5c45d6f3e56b65ffb5ecac2 Author: Boris Brezillon Date: Sun May 3 17:53:40 2020 +0200 mtd: cmdlinepart: Add an slc option to use SLC mode on a part Add a new option to set the MTD_SLC_ON_MLC_EMULATION flag. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-8-miquel.raynal@bootlin.com commit 1998053c8e80a22cf84f40dfea689bb5a94cddfa Author: Boris Brezillon Date: Sun May 3 17:53:39 2020 +0200 mtd: partitions: ofpart: Parse the slc-mode property Parse the slc-mode property and set the MTD_MLC_IN_SLC_MODE flag when present. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-7-miquel.raynal@bootlin.com commit 422928a040fe17d17ded69c57903c7908423c7ef Author: Boris Brezillon Date: Sun May 3 17:53:38 2020 +0200 dt-bindings: mtd: partition: Document the slc-mode property Add a boolean property to force a specific partition attached to an MLC NAND to be accessed in an emulated SLC mode this making this partition immune to paired-pages corruptions. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-6-miquel.raynal@bootlin.com commit 9e3307a169537a6adc30b13bf9063e94990a5493 Author: Boris Brezillon Date: Sun May 3 17:53:37 2020 +0200 mtd: Add support for emulated SLC mode on MLC NANDs MLC NANDs can be made a bit more reliable if we only program the lower page of each pair. At least, this solves the paired-pages corruption issue. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-5-miquel.raynal@bootlin.com commit d652f3a5bdaf51010191b69744d6719d1e977d17 Author: Boris Brezillon Date: Sun May 3 17:53:36 2020 +0200 mtd: rawnand: toshiba: Set the pairing scheme for TC58TEG5DCLTA00 TC58TEG5DCLTA00 uses a stride of 3 between its lower and upper page. Set the appropriate pairing scheme at init time. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-4-miquel.raynal@bootlin.com commit 18729b17769c73fdf854dad99cd22dd0290e7f00 Author: Boris Brezillon Date: Sun May 3 17:53:35 2020 +0200 mtd: rawnand: Define the "distance 3" MLC pairing scheme Define a new page pairing scheme for MLC NANDs with a distance of 3 pages between the lower and upper page. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-3-miquel.raynal@bootlin.com commit 5338ef99c951483fb38dc537e3f7d74aebdab087 Author: Boris Brezillon Date: Sun May 3 17:53:34 2020 +0200 mtd: rawnand: toshiba: Add a specific init for TC58TEG5DCLTA00 TC58TEG5DCLTA00 is an MLC NAND which requires scrambling and supports SDR timings mode 5. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-2-miquel.raynal@bootlin.com commit 51b71ac092eaf3597210b64255040071db1c10e2 Author: Boris Brezillon Date: Fri May 1 11:06:50 2020 +0200 mtd: rawnand: cs553x: Get rid of the legacy interface implementation Now that exec_op() is implemented we no longer need to implement the legacy hooks. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-5-boris.brezillon@collabora.com commit b4ed6328b93d23afc10c3ba222a74e9c9672c7ce Author: Boris Brezillon Date: Fri May 1 11:06:49 2020 +0200 mtd: rawnand: cs553x: Implement exec_op() So we can later get rid of the legacy hooks. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-4-boris.brezillon@collabora.com commit ba03e4833946b91aa16950db37d759dd805a24ef Author: Boris Brezillon Date: Fri May 1 11:06:48 2020 +0200 mtd: rawnand: cs553x: Stop using chip->legacy.IO_ADDR_{R, W} Now that we have our own controller struct we can keep the MMIO pointer in there and use instead of using the chip->legacy.IO_ADDR_{R,W} fields. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-3-boris.brezillon@collabora.com commit c9e1817ff9456d51fc1bc39fa0af6e07e883383e Author: Boris Brezillon Date: Fri May 1 11:06:47 2020 +0200 mtd: rawnand: cs553x: Declare controllers instead of NAND chips The CS553x companion chip embeds 4 NAND controllers. Declare them as NAND controllers instead of NAND chips. That's done in preparation of the transition to exec_op(). Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-2-boris.brezillon@collabora.com commit 432ab89d3035fe5fd4e8adc3b904105a6c4cccae Author: Miquel Raynal Date: Tue Apr 28 11:43:02 2020 +0200 mtd: rawnand: jedec: Use intermediate variables to improve readability Before reworking a little bit the JEDEC detection code, let's clean the coding style of an if statement to improve readability. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-10-miquel.raynal@bootlin.com commit 2e8f56f2a9417692b758fee9ee5a01d857dd980f Author: Miquel Raynal Date: Tue Apr 28 11:43:01 2020 +0200 mtd: rawnand: jedec: Define the number of parameter pages Use a macro to define the number of parameter page instead of hardcoding it everywhere. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-9-miquel.raynal@bootlin.com commit 6e9c65d87c6d92ed988ecdab3ae6ed4d7d94f67c Author: Miquel Raynal Date: Tue Apr 28 11:43:00 2020 +0200 mtd: rawnand: onfi: Drop a useless parameter page read During detection the logic on the NAND bus is: /* Regular ONFI detection */ 1/ read the three NAND parameter pages /* Extended parameter page detection */ 2/ send "read the NAND parameter page" commands without reading actual data 3/ move the column pointer to the extended page and read it If fact, as long as there is nothing happening on the NAND bus between 1/ and 3/, the operation 2/ is redundant so remove it. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-8-miquel.raynal@bootlin.com commit 7e928263fc539bb20e73344a3ef5492ffa8bba7e Author: Miquel Raynal Date: Tue Apr 28 11:42:59 2020 +0200 mtd: rawnand: onfi: Avoid doing a copy of the parameter page There is no need for copying the parameter page, playing with pointers does the trick. There is not functional change. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-7-miquel.raynal@bootlin.com commit dacd1a1297254ad22a3d625d5b6e508392971a86 Author: Miquel Raynal Date: Tue Apr 28 11:42:58 2020 +0200 mtd: rawnand: onfi: Define the number of parameter pages Use a macro to define the number of parameter page instead of hardcoding it everywhere. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-6-miquel.raynal@bootlin.com commit 543e34f29dc48a921bc9cffbc1240f443871b512 Author: Miquel Raynal Date: Tue Apr 28 11:42:57 2020 +0200 mtd: rawnand: onfi: Use intermediate variables to improve readability Before reworking a little bit the ONFI detection code, let's clean the coding style of the if statements to improve readability. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-5-miquel.raynal@bootlin.com commit 1d5d08ee9b28cff907326b4ad5a2463fd2808be1 Author: Miquel Raynal Date: Tue Apr 28 11:42:56 2020 +0200 mtd: rawnand: onfi: Fix redundancy detection check During ONFI detection, the CRC derived from the parameter page and the CRC supposed to be at the end of the parameter page are compared. If they do not match, the second then the third copies of the page are tried. The current implementation compares the newly derived CRC with the CRC contained in the first page only. So if this particular CRC area has been corrupted, then the detection will fail for a wrong reason. Fix this issue by checking the derived CRC against the right one. Fixes: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-4-miquel.raynal@bootlin.com commit 4d8ec041d9c454029f6cd90622f6d81eb61e781c Author: Miquel Raynal Date: Tue Apr 28 11:42:55 2020 +0200 mtd: rawnand: timings: Fix default tR_max and tCCS_min timings tR and tCCS are currently wrongly expressed in femtoseconds, while we expect these values to be expressed in picoseconds. Set right hardcoded values. Fixes: 6a943386ee36 mtd: rawnand: add default values for dynamic timings Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-3-miquel.raynal@bootlin.com commit 83c411c29b90b7de505a2fe1d655293c95f8ba90 Author: Miquel Raynal Date: Tue Apr 28 11:42:54 2020 +0200 mtd: rawnand: timings: Add mode information to the timings structure Convert the timings union into a structure containing the mode and the actual values. The values are still a union in prevision of the addition of the NVDDR modes. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-2-miquel.raynal@bootlin.com commit 1617942a813cd4dc152e2d955b2feabc4e192891 Author: Miquel Raynal Date: Fri Apr 24 18:45:01 2020 +0200 mtd: rawnand: marvell: Rename the ->correct() function There is no correction involved at this point, it is just a matter of reading registers and checking whether bitflips have occurred or not. Rename the function to clarify it. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-7-miquel.raynal@bootlin.com commit 82c6c04e96a3efe3e8be8e309028de16e3f0605f Author: Miquel Raynal Date: Fri Apr 24 18:45:00 2020 +0200 mtd: rawnand: marvell: Rename a function to clarify Cosmetic change to clarify the purpose of the function. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-6-miquel.raynal@bootlin.com commit c525b7af96714f72e316c70781570a4a3e1c2856 Author: Miquel Raynal Date: Fri Apr 24 18:44:59 2020 +0200 mtd: rawnand: marvell: Fix probe error path Ensure all chips are deregistered and cleaned in case of error during the probe. Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-5-miquel.raynal@bootlin.com commit 7a0c18fb5c71c6ac7d4662a145e4227dcd4a36a3 Author: Miquel Raynal Date: Fri Apr 24 18:44:58 2020 +0200 mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered Do not call nand_release() while the MTD device has not been registered, use nand_cleanup() instead. Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-4-miquel.raynal@bootlin.com commit 5dcc99763c985d2fa9f3f176b913a336feafa7f9 Author: Miquel Raynal Date: Fri Apr 24 18:44:57 2020 +0200 mtd: rawnand: marvell: Use devm_platform_ioremap_res() Switch from the old platform_get_resource()/devm_ioremap_resource() couple to the newer devm_platform_ioremap_resource() helper. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-3-miquel.raynal@bootlin.com commit c27075772d1f1c8aaf276db9943b35adda8a8b65 Author: Miquel Raynal Date: Fri Apr 24 18:44:56 2020 +0200 mtd: rawnand: marvell: Fix the condition on a return code In a previous fix, I changed the condition on which the timeout of an IRQ is reached from: if (!ret) into: if (ret && !pending) While having a non-zero return code is usual in the Linux kernel, here ret comes from a wait_for_completion_timeout() which returns 0 when the waiting period is too long. Hence, the revised condition should be: if (!ret && !pending) The faulty patch did not produce any error because of the !pending condition so this change is finally purely cosmetic and does not change the actual driver behavior. Fixes: cafb56dd741e ("mtd: rawnand: marvell: prevent timeouts on a loaded machine") Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-2-miquel.raynal@bootlin.com commit d10b41ba02fee57569ad2aacb723f7c91b6b2729 Author: Miquel Raynal Date: Tue Apr 21 18:39:06 2020 +0200 mtd: rawnand: Give more information about the ECC weakness When the ECC strength is too weak compared to the NAND chip requirements, display the values so that it is clear for people how much they are far from the requirements (and might get in troubles in the future). Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200421163906.7515-1-miquel.raynal@bootlin.com commit 806adfbe8840476ed380a6f7206b961d61b23117 Author: Boris Brezillon Date: Sun Apr 19 21:30:37 2020 +0200 mtd: rawnand: au1550nd: Patch the read/write buf helper prototypes To match the types passed by au1550nd_exec_instr() function. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-5-boris.brezillon@collabora.com commit b1593f8a431ce99e4476c54372672e3e293ed29a Author: Boris Brezillon Date: Sun Apr 19 21:30:36 2020 +0200 mtd: rawnand: au1550nd: Get rid of the legacy interface implementation Now that exec_op() is implemented we can get rid of all other hooks. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-4-boris.brezillon@collabora.com commit dd92b0133a78457e909da1d5916a05c342a897d6 Merge: 378c1ee2227f 2ef96a5bb12b Author: Greg Kroah-Hartman Date: Mon May 11 09:17:15 2020 +0200 Merge 5.7-rc5 into char-misc-next We want the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 07f77dd47a2ccde697fcfa3d156164cf36fe4a4d Author: Takashi Sakamoto Date: Mon May 11 11:25:40 2020 +0900 ALSA: firewire-motu: fulfill missing entries in Kconfig This is trivial commit but fulfill missing entries in Kconfig for devices supported by ALSA firewire-motu driver. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200511022540.161363-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit c8be6af9ef16cf44d690fc227a0d2dd7a526ef05 Merge: c78c31b374a6 2ef96a5bb12b Author: Greg Kroah-Hartman Date: Mon May 11 09:00:09 2020 +0200 Merge v5.7-rc5 into driver-core-next We want the driver core fixes in here and this resolves a merge issue with drivers/base/dd.c Signed-off-by: Greg Kroah-Hartman commit ae73e7784871ebe2c43da619b4a1e2c9ff81508d Merge: 2e11cc1ab790 2ef96a5bb12b Author: Greg Kroah-Hartman Date: Mon May 11 08:57:22 2020 +0200 Merge 5.7-rc5 into staging-next We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 1cc18584e5acfd845464616b66fb2fd81eff467e Merge: 57253ccd5831 2ef96a5bb12b Author: Greg Kroah-Hartman Date: Mon May 11 08:55:10 2020 +0200 Merge 5.7-rc5 into tty-next We need the tty fixes in here too. Signed-off-by: Greg Kroah-Hartman commit 2ca23ae59e997f1b6df7662d8ef10d9c471b46d0 Merge: b9cf2cb52433 2ef96a5bb12b Author: Greg Kroah-Hartman Date: Mon May 11 08:54:03 2020 +0200 Merge 5.7-rc5 into usb-next We want the USB fixes in here too. Signed-off-by: Greg Kroah-Hartman commit 479da1f538a2f3547e15f9d5922c611b69ec2fbc Author: Noralf Trønnes Date: Sat May 9 16:16:10 2020 +0200 backlight: Add backlight_device_get_by_name() Add a way to lookup a backlight device based on its name. Will be used by a USB display gadget getting the name from configfs. Signed-off-by: Noralf Trønnes Reviewed-by: Sam Ravnborg Reviewed-by: Daniel Thompson Acked-by: Jingoo Han Signed-off-by: Lee Jones commit 6f7219fecf35dd9d429b0ea93d78b4ee087960b7 Author: Guennadi Liakhovetski Date: Fri May 8 02:30:46 2020 +0200 soundwire: intel: (cosmetic) remove multiple superfluous "else" statements No need for an "else" after a "return" statement. Remove multiple such occurrences in Intel-specific code. Signed-off-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200508003046.23162-3-guennadi.liakhovetski@linux.intel.com Signed-off-by: Vinod Koul commit f779ad09109eebd3176464fdf6729e3504b49bc5 Author: Guennadi Liakhovetski Date: Fri May 8 02:30:45 2020 +0200 soundwire: (cosmetic) remove multiple superfluous "else" statements No need for an "else" after a "return" statement. Remove multiple such occurrences in bus.c. Signed-off-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200508003046.23162-2-guennadi.liakhovetski@linux.intel.com Signed-off-by: Vinod Koul commit 4f1738f4c24b4485b899ccd9dbdd4f2fcbe6af2d Author: Samuel Zou Date: Wed May 6 11:25:53 2020 +0800 soundwire: qcom: Use IRQF_ONESHOT Fixes coccicheck error: drivers/soundwire/qcom.c:815:7-32: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT Reported-by: Hulk Robot Signed-off-by: Samuel Zou Link: https://lore.kernel.org/r/1588735553-34219-1-git-send-email-zou_wei@huawei.com Signed-off-by: Vinod Koul commit a6f0b26d6a5dcf27980e65f965779a929039f11d Merge: 90d9834ecd6b ac02a451a614 Author: Jakub Kicinski Date: Sun May 10 19:52:43 2020 -0700 Merge branch 'cross-chip-bridging-for-disjoint-dsa-trees' Vladimir Oltean says: ==================== This series adds support for boards where DSA switches of multiple types are cascaded together. Actually this type of setup was brought up before on netdev, and it looks like utilizing disjoint trees is the way to go: https://lkml.org/lkml/2019/7/7/225 The trouble with disjoint trees (prior to this patch series) is that only bridging of ports within the same hardware switch can be offloaded. After scratching my head for a while, it looks like the easiest way to support hardware bridging between different DSA trees is to bridge their DSA masters and extend the crosschip bridging operations. I have given some thought to bridging the DSA masters with the slaves themselves, but given the hardware topology described in the commit message of patch 4/4, virtually any number (and combination) of bridges (forwarding domains) can be created on top of those 3x4-port front-panel switches. So it becomes a lot less obvious, when the front-panel ports are enslaved to more than 1 bridge, which bridge should the DSA masters be enslaved to. So the least awkward approach was to just create a completely separate bridge for the DSA masters, whose entire purpose is to permit hardware forwarding between the discrete switches beneath it. This is a direct resend of v3, which was deferred due to lack of review. In the meantime Florian has reviewed and tested some of them. v1 was submitted here: https://patchwork.ozlabs.org/project/netdev/cover/20200429161952.17769-1-olteanv@gmail.com/ v2 was submitted here: https://patchwork.ozlabs.org/project/netdev/cover/20200430202542.11797-1-olteanv@gmail.com/ v3 was submitted here: https://patchwork.ozlabs.org/project/netdev/cover/20200503221228.10928-1-olteanv@gmail.com/ ==================== Signed-off-by: Jakub Kicinski commit ac02a451a6148bb9c395b39783ce7299eddf4f31 Author: Vladimir Oltean Date: Sun May 10 19:37:43 2020 +0300 net: dsa: sja1105: implement cross-chip bridging operations sja1105 uses dsa_8021q for DSA tagging, a format which is VLAN at heart and which is compatible with cascading. A complete description of this tagging format is in net/dsa/tag_8021q.c, but a quick summary is that each external-facing port tags incoming frames with a unique pvid, and this special VLAN is transmitted as tagged towards the inside of the system, and as untagged towards the exterior. The tag encodes the switch id and the source port index. This means that cross-chip bridging for dsa_8021q only entails adding the dsa_8021q pvids of one switch to the RX filter of the other switches. Everything else falls naturally into place, as long as the bottom-end of ports (the leaves in the tree) is comprised exclusively of dsa_8021q-compatible (i.e. sja1105 switches). Otherwise, there would be a chance that a front-panel switch transmits a packet tagged with a dsa_8021q header, header which it wouldn't be able to remove, and which would hence "leak" out. The only use case I tested (due to lack of board availability) was when the sja1105 switches are part of disjoint trees (however, this doesn't change the fact that multiple sja1105 switches still need unique switch identifiers in such a system). But in principle, even "true" single-tree setups (with DSA links) should work just as fine, except for a small change which I can't test: dsa_towards_port should be used instead of dsa_upstream_port (I made the assumption that the routing port that any sja1105 should use towards its neighbours is the CPU port. That might not hold true in other setups). Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 3b7bc1f09101ccace330d105c13c2946bf3be6d5 Author: Vladimir Oltean Date: Sun May 10 19:37:42 2020 +0300 net: dsa: introduce a dsa_switch_find function Somewhat similar to dsa_tree_find, dsa_switch_find returns a dsa_switch structure pointer by searching for its tree index and switch index (the parameters from dsa,member). To be used, for example, by drivers who implement .crosschip_bridge_join and need a reference to the other switch indicated to by the tree_index and sw_index arguments. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit f66a6a69f97a24546664541237a82b288c2713f6 Author: Vladimir Oltean Date: Sun May 10 19:37:41 2020 +0300 net: dsa: permit cross-chip bridging between all trees in the system One way of utilizing DSA is by cascading switches which do not all have compatible taggers. Consider the following real-life topology: +---------------------------------------------------------------+ | LS1028A | | +------------------------------+ | | | DSA master for Felix | | | |(internal ENETC port 2: eno2))| | | +------------+------------------------------+-------------+ | | | Felix embedded L2 switch | | | | | | | | +--------------+ +--------------+ +--------------+ | | | | |DSA master for| |DSA master for| |DSA master for| | | | | | SJA1105 1 | | SJA1105 2 | | SJA1105 3 | | | | | |(Felix port 1)| |(Felix port 2)| |(Felix port 3)| | | +--+-+--------------+---+--------------+---+--------------+--+--+ +-----------------------+ +-----------------------+ +-----------------------+ | SJA1105 switch 1 | | SJA1105 switch 2 | | SJA1105 switch 3 | +-----+-----+-----+-----+ +-----+-----+-----+-----+ +-----+-----+-----+-----+ |sw1p0|sw1p1|sw1p2|sw1p3| |sw2p0|sw2p1|sw2p2|sw2p3| |sw3p0|sw3p1|sw3p2|sw3p3| +-----+-----+-----+-----+ +-----+-----+-----+-----+ +-----+-----+-----+-----+ The above can be described in the device tree as follows (obviously not complete): mscc_felix { dsa,member = <0 0>; ports { port@4 { ethernet = <&enetc_port2>; }; }; }; sja1105_switch1 { dsa,member = <1 1>; ports { port@4 { ethernet = <&mscc_felix_port1>; }; }; }; sja1105_switch2 { dsa,member = <2 2>; ports { port@4 { ethernet = <&mscc_felix_port2>; }; }; }; sja1105_switch3 { dsa,member = <3 3>; ports { port@4 { ethernet = <&mscc_felix_port3>; }; }; }; Basically we instantiate one DSA switch tree for every hardware switch in the system, but we still give them globally unique switch IDs (will come back to that later). Having 3 disjoint switch trees makes the tagger drivers "just work", because net devices are registered for the 3 Felix DSA master ports, and they are also DSA slave ports to the ENETC port. So packets received on the ENETC port are stripped of their stacked DSA tags one by one. Currently, hardware bridging between ports on the same sja1105 chip is possible, but switching between sja1105 ports on different chips is handled by the software bridge. This is fine, but we can do better. In fact, the dsa_8021q tag used by sja1105 is compatible with cascading. In other words, a sja1105 switch can correctly parse and route a packet containing a dsa_8021q tag. So if we could enable hardware bridging on the Felix DSA master ports, cross-chip bridging could be completely offloaded. Such as system would be used as follows: ip link add dev br0 type bridge && ip link set dev br0 up for port in sw0p0 sw0p1 sw0p2 sw0p3 \ sw1p0 sw1p1 sw1p2 sw1p3 \ sw2p0 sw2p1 sw2p2 sw2p3; do ip link set dev $port master br0 done The above makes switching between ports on the same row be performed in hardware, and between ports on different rows in software. Now assume the Felix switch ports are called swp0, swp1, swp2. By running the following extra commands: ip link add dev br1 type bridge && ip link set dev br1 up for port in swp0 swp1 swp2; do ip link set dev $port master br1 done the CPU no longer sees packets which traverse sja1105 switch boundaries and can be forwarded directly by Felix. The br1 bridge would not be used for any sort of traffic termination. For this to work, we need to give drivers an opportunity to listen for bridging events on DSA trees other than their own, and pass that other tree index as argument. I have made the assumption, for the moment, that the other existing DSA notifiers don't need to be broadcast to other trees. That assumption might turn out to be incorrect. But in the meantime, introduce a dsa_broadcast function, similar in purpose to dsa_port_notify, which is used only by the bridging notifiers. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 9eb8eff0cf2f1e1afc0756bb30cb9746ba90dd07 Author: Vladimir Oltean Date: Sun May 10 19:37:40 2020 +0300 net: bridge: allow enslaving some DSA master network devices Commit 8db0a2ee2c63 ("net: bridge: reject DSA-enabled master netdevices as bridge members") added a special check in br_if.c in order to check for a DSA master network device with a tagging protocol configured. This was done because back then, such devices, once enslaved in a bridge would become inoperative and would not pass DSA tagged traffic anymore due to br_handle_frame returning RX_HANDLER_CONSUMED. But right now we have valid use cases which do require bridging of DSA masters. One such example is when the DSA master ports are DSA switch ports themselves (in a disjoint tree setup). This should be completely equivalent, functionally speaking, from having multiple DSA switches hanging off of the ports of a switchdev driver. So we should allow the enslaving of DSA tagged master network devices. Instead of the regular br_handle_frame(), install a new function br_handle_frame_dummy() on these DSA masters, which returns RX_HANDLER_PASS in order to call into the DSA specific tagging protocol handlers, and lift the restriction from br_add_if. Suggested-by: Nikolay Aleksandrov Suggested-by: Florian Fainelli Signed-off-by: Vladimir Oltean Acked-by: Nikolay Aleksandrov Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 90d9834ecd6b92880765cbcafba373ce33a7cb05 Merge: bed37f0ba6bc 81c287e3dda2 Author: Jakub Kicinski Date: Sun May 10 19:43:47 2020 -0700 Merge branch 'net-hns3-misc-updates-for-next' Huazhong Tan says: ==================== net: hns3: misc updates for -next This patchset includes some misc updates for the HNS3 ethernet driver. #1 & #2 add two cleanups. #3 provides an interface for the client to query the CMDQ's status. #4 adds a little optimization about debugfs. #5 prevents 1000M auto-negotiation off setting. ==================== Signed-off-by: Jakub Kicinski commit 81c287e3dda20441c1469426fc9f44c9b2374fa9 Author: Yufeng Mo Date: Sat May 9 17:27:41 2020 +0800 net: hns3: disable auto-negotiation off with 1000M setting in ethtool The 802.3 specification does not specify the behavior of auto-negotiation off with 1000M in PHY. Therefore, some PHY compatibility issues occur. This patch forbids the setting of this unreasonable mode by ethtool in driver. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit b4401a044a1e6397d21806c210dd0d9b4da93e27 Author: Yufeng Mo Date: Sat May 9 17:27:40 2020 +0800 net: hns3: optimized the judgment of the input parameters of dump ncl config This patch optimizes the judgment of the input parameters of dump ncl config by checking the number and value of the input parameters apart. It's clearer and more reasonable. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit a4de02287abb9947336dfdccc83f6c0cc182e7d9 Author: Huazhong Tan Date: Sat May 9 17:27:39 2020 +0800 net: hns3: provide .get_cmdq_stat interface for the client This patch provides a new interface for the client to query whether CMDQ is ready to work. Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit 4279b4d5ec9c58f63fde23b2d86de4a1e494dc06 Author: Huazhong Tan Date: Sat May 9 17:27:38 2020 +0800 net: hns3: modify two uncorrect macro names According to the UM, command 0x0B03 and 0x0B13 are used to query the statistics about TX and RX, not the status, so modifies the unsuitable macro name of these two command. Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit 5705b45155c404a1eb2ccc92e95851cfa21d4f37 Author: Huazhong Tan Date: Sat May 9 17:27:37 2020 +0800 net: hns3: remove a redundant register macro definition HCLGE_MISC_VECTOR_INT_STS and HCLGE_VECTOR_PF_OTHER_INT_STS_REG both represent the misc interrupt status register(0x20800), so removes HCLGE_VECTOR_PF_OTHER_INT_STS_REG and replaces it with HCLGE_MISC_VECTOR_INT_STS. Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski commit b6ca09cb156d349e6fdde8a8466ec15b902d1419 Author: Gustavo A. R. Silva Date: Thu May 7 13:59:35 2020 -0500 net/mlx5: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Saeed Mahameed commit a4ae16f65c335f8be58b67b78628c788c4b325a5 Author: Samuel Zou Date: Sat May 9 09:16:41 2020 +0800 livepatch: Make klp_apply_object_relocs static Fix the following sparse warning: kernel/livepatch/core.c:748:5: warning: symbol 'klp_apply_object_relocs' was not declared. The klp_apply_object_relocs() has only one call site within core.c; it should be static Fixes: 7c8e2bdd5f0d ("livepatch: Apply vmlinux-specific KLP relocations early") Reported-by: Hulk Robot Signed-off-by: Samuel Zou Acked-by: Josh Poimboeuf Signed-off-by: Jiri Kosina commit 2a4248749624a38ebddcd1fd82bbab8132d655ad Author: Lukas Bulwahn Date: Sat May 9 09:32:58 2020 +0200 MAINTAINERS: adjust to livepatch .klp.arch removal Commit 1d05334d2899 ("livepatch: Remove .klp.arch") removed arch/x86/kernel/livepatch.c, but missed to adjust the LIVE PATCHING entry in MAINTAINERS. Since then, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: arch/x86/kernel/livepatch.c So, drop that obsolete file entry in MAINTAINERS. Fixes: 1d05334d2899 ("livepatch: Remove .klp.arch") Signed-off-by: Lukas Bulwahn Signed-off-by: Jiri Kosina commit 478efc79ee32a3f1227cda49295ef24cda8b114c Author: Michał Mirosław Date: Mon May 4 21:47:47 2020 +0200 power: bq25890: implement INPUT_CURRENT_LIMIT property Report REG00.IINLIM value as INPUT_CURRENT_LIMIT property. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit c942656ddb3a0c248e0c53a2ebd4a36adaa46cbc Author: Michał Mirosław Date: Mon May 4 21:47:46 2020 +0200 power: bq25890: implement PRECHARGE_CURRENT property Report configured precharge current. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit b302a0ae7205a3ccda238cb057224b5115a6115c Author: Michał Mirosław Date: Mon May 4 21:47:46 2020 +0200 power: bq25890: implement CHARGE_TYPE property Report charging type based on recently read state. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 3b4df57bef695a41a23feb1017263be5f5f8d51c Author: Michał Mirosław Date: Mon May 4 21:47:45 2020 +0200 power: bq25890: update state on property read Edge interrupts from the charger may be lost or stuck in fault mode since probe(). Check if something changed everytime userspace wants some data. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 21d90eda433f5d39930ca7133340225b8fb7940f Author: Michał Mirosław Date: Mon May 4 21:47:45 2020 +0200 power: bq25890: fix ADC mode configuration Datasheet describes two modes for reading ADC measurements: 1. continuous, 1 Hz - enabled and started by CONV_RATE bit 2. one-shot - triggered by CONV_START bit In continuous mode, CONV_START is read-only and signifies an ongoing conversion. Change the code to follow the datasheet and really disable continuous mode for power saving. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 1e4724d0b7d1db3b7307fc95fb902a97f4a7b85a Author: Michał Mirosław Date: Mon May 4 21:47:30 2020 +0200 power: bq25890: use proper CURRENT_NOW property for I_BAT Charge Current is more apropriately reflected by CURRENT_NOW property (measured current) than CONSTANT_CURRENT_VOLTAGE (configured CC-phase current limit). Fix the reference and make the sign reflect direction of the current. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit b6522fa409cfafbc3968679b09e4028f0609f2b9 Author: Xiaoming Ni Date: Sat Apr 11 21:06:19 2020 +0800 parisc: add sysctl file interface panic_on_stackoverflow The variable sysctl_panic_on_stackoverflow is used in arch/parisc/kernel/irq.c and arch/x86/kernel/irq_32.c, but the sysctl file interface panic_on_stackoverflow only exists on x86. Add sysctl file interface panic_on_stackoverflow for parisc Signed-off-by: Xiaoming Ni Reviewed-by: Luis Chamberlain Signed-off-by: Helge Deller commit 3fd84a4fc063f36855ddf2408c66e6e5d219b223 Author: Arnd Bergmann Date: Fri May 8 11:35:43 2020 +0200 parisc: use -fno-strict-aliasing for decompressor An experimental patch series of mine reworks how warnings are processed in Kbuild. A side effect is a new warning about a harmless aliasing rule violation in an inline function: In file included from include/linux/rhashtable-types.h:15:0, from include/linux/ipc.h:7, from include/uapi/linux/sem.h:5, from include/linux/sem.h:5, from include/linux/sched.h:15, from include/linux/uaccess.h:6, from arch/parisc/boot/compressed/misc.c:7: include/linux/workqueue.h: In function 'work_static': include/linux/workqueue.h:212:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] return *work_data_bits(work) & WORK_STRUCT_STATIC; Make the decompressor use -fno-strict-aliasing like the rest of the kernel for consistency, and to ensure this warning never makes it into a release. Reported-by: kbuild test robot Signed-off-by: Arnd Bergmann Signed-off-by: Helge Deller commit 0d341e0ddb1a3444716420ad9151949c02adbe4e Author: Helge Deller Date: Sun May 10 22:43:33 2020 +0200 parisc: suppress error messages for 'make clean' Avoid error messages when running 'make ARCH=parisc clean'. Noticed-by: Masahiro Yamada Signed-off-by: Helge Deller commit 0383024f811aa469df258039807810fc3793a105 Author: Jonathan Bakker Date: Mon May 4 15:12:58 2020 -0700 power: supply: max17040: Correct voltage reading According to the datasheet available at (1), the bottom four bits are always zero and the actual voltage is 1.25x this value in mV. Since the kernel API specifies that voltages should be in uV, it should report 1250x the shifted value. 1) https://datasheets.maximintegrated.com/en/ds/MAX17040-MAX17041.pdf Signed-off-by: Jonathan Bakker Signed-off-by: Sebastian Reichel commit bed37f0ba6bc1ff702d87be727d9e740509809aa Merge: b9f96423bba6 9896a4574ecb Author: Jakub Kicinski Date: Sun May 10 12:29:15 2020 -0700 Merge branch 'Ethernet-Cable-test-support' Andrew Lunn says: ==================== Ethernet Cable test support any copper Ethernet PHY have support for performing diagnostics of the cable. Are the cable shorted, broken, not plugged into anything at the other end? And they can report roughly how far along the cable any fault is. Add infrastructure in ethtool and phylib support for triggering a cable test and reporting the results. The Marvell 1G PHY driver is then extended to make use of this infrastructure. For testing, a modified ethtool(1) can be found here: https://github.com/lunn/ethtool.git feature/cable-test-v4. This also contains extra code for TDR dump, which will be added to the kernel in a later patch series. Thanks to Chris Healy for extensive testing. v2: See individual patches but: Remove _REPLY messages Change length into a u32 Grammar fixes Rename functions for consistency Extack for cable test already running Remove ethnl_cable_test_act_ops Add status attributes Rename pairs from numbers to letters v3: See individual patches but: Remove ETHTOOL_MSG_CABLE_TEST_ACT_REPLY from documentation Remove unused cable_test_get_policy Fixed example in document Add ETHTOOL_A_CABLE_NEST_* enum Add ETHTOOL_MSG_CABLE_TEST_NTF to documentation Poison phydev->skb Return -EMSGSIZE when ethnl_bcastmsg_put() fails Return valid error code when nla_nest_start() fails Use u8 for results Actually put u32 length into message s/mavell/marvell/g Remove include of EMSGSIZE when ethnl_bcastmsg_put() fails Print an error message on failure, since this is a void function. v4: See individual patches but: Remove unwanted blank line ENOTSUPP->EOPNOTSUPP Move EINVAL->EMSGSIZE fix to correct patch ==================== Signed-off-by: Jakub Kicinski commit 9896a4574ecb137d4e5b9283004aa34c688bc761 Author: Andrew Lunn Date: Sun May 10 21:12:40 2020 +0200 net: phy: Send notifier when starting the cable test Given that it takes time to run a cable test, send a notify message at the start, as well as when it is completed. v3: EMSGSIZE when ethnl_bcastmsg_put() fails Print an error message on failure, since this is a void function. Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 4a459bdc7472b0e6bea6d0dd8df66253ac4f3fe2 Author: Andrew Lunn Date: Sun May 10 21:12:39 2020 +0200 net: phy: Put interface into oper testing during cable test Since running a cable test is disruptive, put the interface into operative state testing while the test is running. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Michal Kubecek Signed-off-by: Jakub Kicinski commit fc879f723c2a938bcb69d5ae49ec0dba10c1ef97 Author: Andrew Lunn Date: Sun May 10 21:12:38 2020 +0200 net: phy: marvell: Add cable test support The Marvell PHYs have a couple of different register sets for performing cable tests. Page 7 provides the simplest to use. v3: s/mavell/marvell/g Remove include of Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 1e2dc14509fd072739e4bab98ac42317267dbad6 Author: Andrew Lunn Date: Sun May 10 21:12:37 2020 +0200 net: ethtool: Add helpers for reporting test results The PHY drivers can use these helpers for reporting the results. The results get translated into netlink attributes which are added to the pre-allocated skbuf. v3: Poison phydev->skb Return -EMSGSIZE when ethnl_bcastmsg_put() fails Return valid error code when nla_nest_start() fails Use u8 for results Actually put u32 length into message v4: s/ENOTSUPP/EOPNOTSUPP/g Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Michal Kubecek Signed-off-by: Jakub Kicinski commit 1dd3f212af30b42c90ba252c165f2f6d2ddf5230 Author: Andrew Lunn Date: Sun May 10 21:12:36 2020 +0200 net: ethtool: Add infrastructure for reporting cable test results Provide infrastructure for PHY drivers to report the cable test results. A netlink skb is associated to the phydev. Helpers will be added which can add results to this skb. Once the test has finished the results are sent to user space. When netlink ethtool is not part of the kernel configuration stubs are provided. It is also impossible to trigger a cable test, so the error code returned by the alloc function is of no consequence. v2: Include the status complete in the netlink notification message v4: Replace -EINVAL with -EMSGSIZE Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek Signed-off-by: Jakub Kicinski commit 0df960f14e17e55e68dfd1342f063d17dbcc6107 Author: Andrew Lunn Date: Sun May 10 21:12:35 2020 +0200 net: ethtool: Make helpers public Make some helpers for building ethtool netlink messages available outside the compilation unit, so they can be used for building messages which are not simple get/set. Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek Signed-off-by: Jakub Kicinski commit b28efb930ba5a7c263826fe02e13e1b6eadb5559 Author: Andrew Lunn Date: Sun May 10 21:12:34 2020 +0200 net: ethtool: Add attributes for cable test reports Add the attributes needed to report cable test results to userspace. The reports are expected to be per twisted pair. A nested property per pair can report the result of the cable test. A nested property can also report the length of the cable to any fault. v2: Grammar fixes Change length from u16 to u32 s/DEV/HEADER/g Add status attributes Rename pairs from numbers to letters. v3: Fixed example in document Add ETHTOOL_A_CABLE_NEST_* enum Add ETHTOOL_MSG_CABLE_TEST_NTF to documentation Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Michal Kubecek Signed-off-by: Jakub Kicinski commit 11ca3c4261cdb4e2f33e32daf6447f8185843317 Author: Andrew Lunn Date: Sun May 10 21:12:33 2020 +0200 net: ethtool: netlink: Add support for triggering a cable test Add new ethtool netlink calls to trigger the starting of a PHY cable test. Add Kconfig'ury to ETHTOOL_NETLINK so that PHYLIB is not a module when ETHTOOL_NETLINK is builtin, which would result in kernel linking errors. v2: Remove unwanted white space change Remove ethnl_cable_test_act_ops and use doit handler Rename cable_test_set_policy cable_test_act_policy Remove ETHTOOL_MSG_CABLE_TEST_ACT_REPLY v3: Remove ETHTOOL_MSG_CABLE_TEST_ACT_REPLY from documentation Remove unused cable_test_get_policy Add Reviewed-by tags v4: Remove unwanted blank line Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 97c22438963a7484c05c59ab6654e30f0a3e9288 Author: Andrew Lunn Date: Sun May 10 21:12:32 2020 +0200 net: phy: Add support for polling cable test Some PHYs are not capable of generating interrupts when a cable test finished. They do however support interrupts for normal operations, like link up/down. As such, the PHY state machine would normally not poll the PHY. Add support for indicating the PHY state machine must poll the PHY when performing a cable test. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit a68a813836e12b15715d9101309899123c250302 Author: Andrew Lunn Date: Sun May 10 21:12:30 2020 +0200 net: phy: Add cable test support to state machine Running a cable test is desruptive to normal operation of the PHY and can take a 5 to 10 seconds to complete. The RTNL lock cannot be held for this amount of time, and add a new state to the state machine for running a cable test. The driver is expected to implement two functions. The first is used to start a cable test. Once the test has started, it should return. The second function is called once per second, or on interrupt to check if the cable test is complete, and to allow the PHY to report the status. v2: Rename phy_cable_test_abort to phy_abort_cable_test Return different extack when already running test Use phy_init_hw() to reset the PHY Reviewed-by: Florian Fainelli Signed-off-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit a67537ef37d8d268adee17d7bab30ea5b8d76f52 Author: Boris Brezillon Date: Sun Apr 19 21:30:35 2020 +0200 mtd: rawnand: au1550nd: Implement exec_op() So we can later get rid of the legacy interface implementation. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-3-boris.brezillon@collabora.com commit 15770370df4d51bd5ca408f0b8c46c90098d3300 Author: Boris Brezillon Date: Sun Apr 19 21:30:34 2020 +0200 mtd: rawnand: au1550nd: Stop using IO_ADDR_{R, W} in au_{read, write}_buf[16]() We are about to re-use those for the exec_op() implementation which will not rely on au1550_hwcontrol(). Let's patch those helpers to simply use the iomem address stored in the context. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-2-boris.brezillon@collabora.com commit 5756f2e8dad46eba6e2d3e530243b8eff4dd5a42 Author: Masahiro Yamada Date: Tue Mar 17 16:18:21 2020 +0900 mtd: rawnand: denali: add more delays before latching incoming data The Denali IP have several registers to specify how many clock cycles should be waited between falling/rising signals. You can improve the NAND access performance by programming these registers with optimized values. Because struct nand_sdr_timings represents the device requirement in pico seconds, denali_setup_data_interface() computes the register values by dividing the device timings with the clock period. Marek Vasut reported this driver in the latest kernel does not work on his SOCFPGA board. (The on-board NAND chip is mode 5) The suspicious parameter is acc_clks, so this commit relaxes it. The Denali NAND Flash Memory Controller User's Guide describes this register as follows: acc_clks signifies the number of bus interface clk_x clock cycles, controller should wait from read enable going low to sending out a strobe of clk_x for capturing of incoming data. Currently, acc_clks is calculated only based on tREA, the delay on the chip side. This does not include additional delays that come from the data path on the PCB and in the SoC, load capacity of the pins, etc. This relatively becomes a big factor on faster timing modes like mode 5. Before supporting the ->setup_data_interface() hook (e.g. Linux 4.12), the Denali driver hacks acc_clks in a couple of ways [1] [2] to support the timing mode 5. We would not go back to the hard-coded acc_clks, but we need to include this factor into the delay somehow. Let's say the amount of the additional delay is 10000 pico sec. In the new calculation, acc_clks is determined by timings->tREA_max + data_setup_on_host. Also, prolong the RE# low period to make sure the data hold is met. Finally, re-center the data latch timing for extra safety. [1] https://github.com/torvalds/linux/blob/v4.12/drivers/mtd/nand/denali.c#L276 [2] https://github.com/torvalds/linux/blob/v4.12/drivers/mtd/nand/denali.c#L282 Reported-by: Marek Vasut Signed-off-by: Masahiro Yamada Tested-by: Marek Vasut Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200317071821.9916-1-yamada.masahiro@socionext.com commit ce446b4b2d803cf62de2e74b1fbda8758e4835bd Author: Boris Brezillon Date: Sat Apr 18 21:42:17 2020 +0200 mtd: rawnand: Take check_only into account ->exec_op() is passed a check_only argument that encodes when the controller should just check whether the operation is supported or not without executing it. Some controllers simply ignore this arguments, others don't but keep modifying some of the registers before returning. Let's fix all those drivers. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200418194217.1016060-1-boris.brezillon@collabora.com commit 4ba246d7a365b8049892d852ab00d8bd707dc0e6 Author: YueHaibing Date: Fri Apr 17 18:11:29 2020 +0800 mtd: rawnand: brcmnand: Remove unused including Remove including that don't need it. Signed-off-by: YueHaibing Acked-by: Florian Fainelli Signed-off-by: Kamal Dasu Reviewed-by: Kamal Dasu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200417101129.35556-1-yuehaibing@huawei.com commit fb0f6f331e27bc9d0e53f4e5f0cfe61c50e40cf5 Author: YueHaibing Date: Fri Apr 10 19:52:28 2020 +0800 mtd: rawnand: cadence: Make cadence_nand_attach_chip static Fix sparse warning: drivers/mtd/nand/raw/cadence-nand-controller.c:2595:5: warning: symbol 'cadence_nand_attach_chip' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200410115228.30440-1-yuehaibing@huawei.com commit 73ab61552e2ffb1b794b70545d04c1d2b60e89e7 Author: YueHaibing Date: Fri Apr 10 19:51:21 2020 +0800 mtd: rawnand: ingenic: Make qi_lb60_ooblayout_ops static Fix sparse warning: drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c:105:32: warning: symbol 'qi_lb60_ooblayout_ops' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Acked-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200410115121.11852-1-yuehaibing@huawei.com commit 7c26e6ef96c95105d6b1dc828902067df9b0f076 Author: Fenghua Yu Date: Fri Dec 20 16:05:55 2019 -0800 mtd: rawnand: fsmc: Change to non-atomic bit operations No need to use expensive atomic change_bit() on dat[] and err_idx[]: 1. fsmc_bch8_correct_data() is called while mutex chip->lock is held 2. err_idx[] is a local variable. To avoid big endian concern due to type cast to unsigned long, directly change the bit in the specified byte instead of using non-atomic __change_bit(). Suggested-by: Peter Zijlstra Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1576886755-9788-1-git-send-email-fenghua.yu@intel.com commit b9f96423bba6155cdf54f96f0b1e43fa6d0b0b74 Author: Colin Ian King Date: Sat May 9 22:57:56 2020 +0100 net: usb: qmi_wwan: remove redundant assignment to variable status The variable status is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Bjørn Mork Signed-off-by: Jakub Kicinski commit 1ea08c6bce050a38aa303485af940645cc7b6375 Author: Colin Ian King Date: Sat May 9 22:48:03 2020 +0100 net: huawei_cdc_ncm: remove redundant assignment to variable ret The variable ret is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Jakub Kicinski commit d728e6402c0023a46b8595e1736695517fd94a7a Author: Colin Ian King Date: Sat May 9 22:41:11 2020 +0100 net: usb: ax88179_178a: remove redundant assignment to variable ret The variable ret is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Jakub Kicinski commit 4f6cd04f2ded199931c44b3c95c4938618cd8b82 Author: kbuild test robot Date: Sun May 10 20:26:56 2020 +0800 dsa: sja1105: fix semicolon.cocci warnings drivers/net/dsa/sja1105/sja1105_ethtool.c:481:11-12: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: ae1804de93f6 ("dsa: sja1105: dynamically allocate stats structure") CC: Arnd Bergmann Signed-off-by: kbuild test robot Signed-off-by: Jakub Kicinski commit 29e9eff40f5edc2e5de63b28e700e82ed2b6b95c Author: Lubomir Rintel Date: Sat Dec 21 08:17:51 2019 +0100 power: supply: olpc_battery: fix the power supply name The framework is unhappy about them, because it uses the names in sysfs attributes: power_supply olpc-ac: hwmon: 'olpc-ac' is not a valid name attribute, please fix power_supply olpc-battery: hwmon: 'olpc-battery' is not a valid name attribute, please fix See also commit 648cd48c9e56 ("hwmon: Do not accept invalid name attributes") and commit 74d3b6419772 ("hwmon: Relax name attribute validation for new APIs"). Signed-off-by: Lubomir Rintel Signed-off-by: Sebastian Reichel commit fa7cc725a343e305bef78e8d65be48f37d3f7720 Author: David Heidelberg Date: Sun Mar 29 18:15:45 2020 +0200 power: supply: smb347-charger: Add delay before getting IRQSTAT This delay-fix is picked up from downstream driver, we measured that 25 - 35 ms delay ensure that we get required data. Tested on SMB347 on Nexus 7 2012. Otherwise IRQSTAT_E fails to provide correct information. Signed-off-by: Dmitry Osipenko Signed-off-by: David Heidelberg Signed-off-by: Sebastian Reichel commit c32ea07a30630ace950e07ffe7a18bdcc25898e1 Author: Dmitry Osipenko Date: Sun Mar 29 18:15:44 2020 +0200 power: supply: smb347-charger: IRQSTAT_D is volatile Fix failure when USB cable is connected: smb347 2-006a: reading IRQSTAT_D failed Fixes: 1502cfe19bac ("smb347-charger: Fix battery status reporting logic for charger faults") Tested-by: David Heidelberg Signed-off-by: Dmitry Osipenko Signed-off-by: David Heidelberg Signed-off-by: Sebastian Reichel commit 7d374b20908338c9fbb03ea8022a11f3b3e0e55f Author: Georgi Djakov Date: Sun May 10 18:30:37 2020 +0300 interconnect: Add helpers for enabling/disabling a path There is a repeated pattern in multiple drivers where they want to switch the bandwidth between zero and some other value. This is happening often in the suspend/resume callbacks. Let's add helper functions to enable and disable the path, so that callers don't have to take care of remembering the bandwidth values and handle this in the framework instead. With this patch the users can call icc_disable() and icc_enable() to lower their bandwidth request to zero and then restore it back to it's previous value. Suggested-by: Evan Green Suggested-by: Bjorn Andersson Signed-off-by: Georgi Djakov Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20200507120846.8354-1-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov commit 360a10285e7e2722f6869f5dc8e81214a72b57f6 Author: Wei Yongjun Date: Sun May 10 18:30:37 2020 +0300 interconnect: imx: Fix return value check in imx_icc_node_init_qos() In case of error, the function of_parse_phandle() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: f0d8048525d7 ("interconnect: Add imx core driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20200509030214.14435-1-weiyongjun1@huawei.com Signed-off-by: Georgi Djakov commit 1f65e6683267dde67a71c6bfcf71de35916be11a Author: Takashi Sakamoto Date: Sun May 10 16:43:01 2020 +0900 ALSA: fireface: add support for RME Fireface UFX (untested) Fireface UFX was shipped by RME GmbH in 2010, and now discontinued. Although this model has some enhanced feature which Fireface 802 doesn't have (e.g. on-board USB mass storage device class, configuration interface with color display), the functionality relevant to packet communication on IEEE 1394 bus seems to be the same as Fireface 802 (e.g. available number of channels for PCM frame in each sampling transfer frequency). With the assumption, this commit adds support for Fireface UFX. In ALSA fireface driver, these two models are handled as the same one. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200510074301.116224-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 062bb452b078ba481d856e1aca176e16b8b1466d Author: Takashi Sakamoto Date: Sun May 10 16:43:00 2020 +0900 ALSA: fireface: add support for RME FireFace 802 Fireface 802 was shipped by RME GmbH in 2014. This model supports later protocol for management of isochronous communication and synchronization of sampling transmission frequency. This model consists of below ICs: * TI TSB41AB2 * Xilinx Spartan-6 FPGA XC6SLX16 * TI TMS320 C6747 * SMSC USB3250 Especially, this model just supports IEEE 1394a, against its name which evokes Fireface 800. This commit adds support for Fireface 802 (tested). Userspace applications can transfer PCM frames and MIDI messages via ALSA PCM/Rawmidi interface. I note that 4 channels for ADAt1 and ADAT2 are disabled at higher sampling transfer frequency since isochronous resources reservation fails due to bandwidth limitation of IEEE 1394a. The value read from LATTER_SYNC_STATUS register is slightly different from the one of Fireface UCX. The higher 4 bits and lower 4 bits are swapped within the same byte. Without any assist of userspace application, transmitted MIDI messages from the device are not going to be processed. For detail, please refer to my comment in code of latter protocol. $ python crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 0404ffff bus_info_length 4, crc_length 4, crc 65535 (should be 26805) 404 31333934 bus_name "1394" 408 20008000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512) 40c 000a3504 company_id 000a35 | 410 38077423 device_id 0438077423 | EUI-64 000a350438077423 root directory ----------------------------------------------------------------- 414 0005ffff directory_length 5, crc 65535 (should be 9514) 418 0c0083c0 node capabilities per IEEE 1394 41c 03000a35 vendor 420 8100000b --> descriptor leaf at 44c 424 8d000007 --> eui-64 leaf at 440 428 d1000001 --> unit directory at 42c unit directory at 42c ----------------------------------------------------------------- 42c 0004ffff directory_length 4, crc 65535 (should be 45134) 430 12000a35 specifier id 434 13000005 version 438 17101800 model 43c 81000008 --> descriptor leaf at 45c eui-64 leaf at 440 ----------------------------------------------------------------- 440 0002ffff leaf_length 2, crc 65535 (should be 60131) 444 000a3504 company_id 000a35 | 448 38077423 device_id 0438077423 | EUI-64 000a350438077423 descriptor leaf at 44c ----------------------------------------------------------------- 44c 0003ffff leaf_length 3, crc 65535 (should be 469) 450 00000000 textual descriptor 454 00000000 minimal ASCII 458 524d4521 "RME!" descriptor leaf at 45c ----------------------------------------------------------------- 45c 0005ffff leaf_length 5, crc 65535 (should be 10561) 460 00000000 textual descriptor 464 00000000 minimal ASCII 468 46697265 "Fire" 46c 66616365 "face" 470 20383032 " 802" Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200510074301.116224-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 782222bab83a31f70c427b59587ada963d6c59c3 Author: Takashi Sakamoto Date: Sun May 10 16:42:59 2020 +0900 ALSA: fireface: code refactoring to decide name of sound card This commit uses enumeration constants as index of table for the list of name of sound card. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200510074301.116224-5-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit c52f232e11077555cdd515f25376afa54ac36296 Author: Takashi Sakamoto Date: Sun May 10 16:42:58 2020 +0900 ALSA: fireface: code refactoring to add enumeration constants for model identification In RME fireface series, version field of unit directory in configuration ROM is used to distinguish each model. The value of field is known and it's better to use enumeration constants for code representation. This commit adds enumeration constants for model identification. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200510074301.116224-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit f4588cc425beb62e355bc2a5de5d5c83e26a74ca Author: Takashi Sakamoto Date: Sun May 10 16:42:57 2020 +0900 ALSA: fireface: start IR context immediately In the latter models of RME Fireface series, device start to transfer packets several dozens of milliseconds. On the other hand, ALSA fireface driver starts IR context 2 milliseconds after the start. This results in loss to handle incoming packets on the context. This commit changes to start IR context immediately instead of postponement. For Fireface 800, this affects nothing because the device transfer packets 100 milliseconds or so after the start and this is within wait timeout. Cc: Fixes: acfedcbe1ce4 ("ALSA: firewire-lib: postpone to start IR context") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200510074301.116224-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit bbd6aac3ae15bef762af03bf62e35ace5c4292bd Author: Takashi Sakamoto Date: Sun May 10 16:42:56 2020 +0900 ALSA: fireface: fix configuration error for nominal sampling transfer frequency 128000 and 192000 are congruence modulo 32000, thus it's wrong to distinguish them as multiple of 32000 and 48000 by modulo 32000 at first. Additionally, used condition statement to detect quadruple speed can cause missing bit flag. Furthermore, counter to ensure the configuration is wrong and it causes false positive. This commit fixes the above three bugs. Cc: Fixes: 60aec494b389 ("ALSA: fireface: support allocate_resources operation in latter protocol") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200510074301.116224-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 63b1be78774f8c3bdb9efd862ba7dfe8e2c056ff Author: Hans de Goede Date: Tue Apr 28 19:29:21 2020 +0200 iio: light: cm32181: Make lux_per_bit and lux_per_bit_base_it runtime settings Make lux_per_bit and lux_per_bit_base_it settings stored in struct cm32181_chip instead of a hardcoded (defined) values. This is a preparation patch for reading some ACPI tables which specify a device specific lux_per_bit value. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit f50f98310e51b3712a4e544c75615e89c8233125 Author: Hans de Goede Date: Tue Apr 28 19:29:20 2020 +0200 iio: light: cm32181: Use units of 1/100000th for calibscale and lux_per_bit Use units of 1/100000th for calibscale and lux_per_bit. The similar cm3232 driver already uses 1/100000th as unit for calibscale. This allows for higher-accuracy and makes it easier to add support for getting device-specific calibscale and lux_per_bit values from a device's ACPI tables, as the values in the ACPI tables also use 1/100000th units. This units change means that our intermediate values in cm32181_get_lux() may get quite big, change the type of the lux variable to a u64 to deal with this. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 7574cb1df43c6219f0088d028906f4e15fee702f Author: Hans de Goede Date: Tue Apr 28 19:29:19 2020 +0200 iio: light: cm32181: Change reg_init to use a bitmap of which registers to init This is a preparation patch for reading some ACPI tables which give init values for multiple registers. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit c1e62062ff5477f3cd40e956fb1c18808cc894a4 Author: Hans de Goede Date: Tue Apr 28 19:29:18 2020 +0200 iio: light: cm32181: Handle CM3218 ACPI devices with 2 I2C resources Some ACPI systems list 2 I2C resources for the CM3218 sensor. On these systems the first I2cSerialBus ACPI-resource points to the SMBus Alert Response Address (ARA, 0x0c) and the second I2cSerialBus ACPI-resource points to the actual CM3218 sensor address: Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Name (SBUF, ResourceTemplate () { I2cSerialBusV2 (0x000C, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C3", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0048, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C3", 0x00, ResourceConsumer, , Exclusive, ) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) { 0x00000033, } }) Return (SBUF) /* \_SB_.I2C3.ALSD._CRS.SBUF */ } Detect this and take the following step to deal with it: 1. When a SMBus Alert capable sensor has an Alert asserted, it will not respond on its actual I2C address. Read a byte from the ARA to clear any pending Alerts. 2. Create a "dummy" client for the actual I2C address and use that client to communicate with the sensor. Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit b885d0fa6790b8b2c8502dc93fed27ce85e68922 Author: Hans de Goede Date: Tue Apr 28 19:29:17 2020 +0200 iio: light: cm32181: Clean up the probe function a bit 3 small cleanups to cm32181_probe(): 1. Do not log an error when we fail to allocate memory (as a general rule drivers do not log errors for this as the kernel will already have complained loudly that it could not alloc the mem). 2. Remove the i2c_set_clientdata() call, we never use i2c_get_clientdata() or dev_get_drvdata() anywhere. 3. Add a dev helper variable and use it in various places instead of &client->dev. Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 02cdab2a8d55c85967a4be4a084efa9641c56066 Author: Hans de Goede Date: Tue Apr 28 19:29:16 2020 +0200 iio: light: cm32181: Add support for the CM3218 Add support for the CM3218 which is an older version of the CM32181. This is based on a newer version of cm32181.c, with a copyright of: * Copyright (C) 2014 Capella Microsystems Inc. * Author: Kevin Tsai * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2, as published * by the Free Software Foundation. Which is floating around on the net in various places, but the changes from this newer version never made it upstream. This was tested on an Asus T100TA and an Asus T100CHI, which both come with the CM3218 variant of the light sensor. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 3bf4a59c48e84a2947c4bca2f69ad258f0f5b77f Author: Hans de Goede Date: Tue Apr 28 19:29:15 2020 +0200 iio: light: cm32181: Add some extra register defines These come from a newer version of cm32181.c, which is floating around the net, with a copyright of: * Copyright (C) 2014 Capella Microsystems Inc. * Author: Kevin Tsai * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2, as published * by the Free Software Foundation. Note that this removes the bogus CM32181_CMD_ALS_ENABLE define, there is no enable bit, only a disable bit and enabled is the absence of being disabled. This is a preparation patch for adding support for the older CM3218 model of the light sensor. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 44b9409c982c8e56b8cc141e7a582ce4ef3ae1ef Author: Hans de Goede Date: Tue Apr 28 19:29:14 2020 +0200 iio: light: cm32181: Add support for ACPI enumeration Add support for ACPI enumeration, this has been tested on a HP HP Pavilion x2 Detachable 10 (Bay Trail model). Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 067704540dcac6dab267cec0eb3b625f81b508ab Author: Hans de Goede Date: Tue Apr 28 19:29:13 2020 +0200 iio: light: cm32181: Switch to new style i2c-driver probe function Switch to the new style i2c-driver probe_new probe function and drop the unnecessary i2c_device_id table (we do not have any old style board files using this). This is a preparation patch for adding ACPI binding support. Signed-off-by: Hans de Goede Signed-off-by: Jonathan Cameron commit 067fda1c065ff5655fcd2600f4b9f72a6ab5b7d9 Author: Alexandru Ardelean Date: Fri Apr 24 07:34:18 2020 +0300 iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger The main intent here is to get rid of the iio_buffer_set_attrs() helper, or at least rework it's usage a bit. The problem with that helper is that it needs a pointer to the buffer, which makes supporting multiple buffers per IIO device a bit more cumbersome. The hid_sensor_setup_trigger() is pretty much used in the same way: - iio_triggered_buffer_setup() gets called before - then hid_sensor_setup_trigger() and hid_sensor_setup_batch_mode() gets called which may attach some fifo attributes This change merges the 2 together under the hid_sensor_setup_trigger() function. Only the &iio_pollfunc_store_time is passed to all devices, so it's not even required to pass it explicitly outside of the common hid_sensor_setup_trigger() function. Moving the devm_iio_triggered_buffer_setup/cleanup() calls into the common place code can help the rework of the buffer code, since it is in one place. One detail of the change is that there are 2 drivers that use devm_iio_triggered_buffer_setup(). That function gets implicitly replaced with iio_triggered_buffer_setup()/cleanup(), but since all drivers call both hid_sensor_setup_trigger9) & hid_sensor_remove_trigger() trigger, the iio_triggered_buffer_cleanup() piggy backs on the hid_sensor_remove_trigger() call, which should cover the cleanup. Signed-off-by: Alexandru Ardelean Acked-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron commit 3eb66d9f97f386262adbba9ce752ec80b85246ed Author: Linus Walleij Date: Sat May 9 22:18:18 2020 -0700 Input: add driver for the Cypress CY8CTMA140 touchscreen This adds a new driver for the Cypress CY8CTMA140 touchscreen. This driver is inspired by out-of-tree code for the Samsung GT-S7710 mobile phone. I have tried to compare the structure and behaviour of this touchscreen to the existing CYTTSP and CYTTSP4 generics and it seems pretty different. It is also different in character from the cy8ctmg110_ts.c. It appears to rather be vaguely related to the Melfas MMS114 driver, yet distinctly different. Dmitry Torokhov rewrote the key scanning code during the submission process so the driver is a joint work. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200506123435.187432-2-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 7fdff6cc84de2efbea5a48c8d9cadb2bf5a7ba2d Author: Linus Walleij Date: Sat May 9 22:17:40 2020 -0700 dt-bindings: touchscreen: Add CY8CTMA140 bindings This adds device tree bindings for the Cypress CY8CTMA140 touchscreen. Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200506123435.187432-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 7a36e4918e30fbd3c820f723ef53d8505283c9e0 Author: Kevin Hao Date: Sat May 9 18:43:10 2020 +0800 octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers In the current codes, the octeontx2 uses its own method to allocate the pool buffers, but there are some issues in this implementation. 1. We have to run the otx2_get_page() for each allocation cycle and this is pretty error prone. As I can see there is no invocation of the otx2_get_page() in otx2_pool_refill_task(), this will leave the allocated pages have the wrong refcount and may be freed wrongly. 2. It wastes memory. For example, if we only receive one packet in a NAPI RX cycle, and then allocate a 2K buffer with otx2_alloc_rbuf() to refill the pool buffers and leave the remain area of the allocated page wasted. On a kernel with 64K page, 62K area is wasted. IMHO it is really unnecessary to implement our own method for the buffers allocate, we can reuse the napi_alloc_frag() to simplify our code. Signed-off-by: Kevin Hao Signed-off-by: Jakub Kicinski commit e7bb7ecefa817543e11fa3c1c3e55deb90b02e6c Author: Gustavo A. R. Silva Date: Thu May 7 13:59:21 2020 -0500 IB/mlx4: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jakub Kicinski commit b4563facdcae55c83039d5efcc3b45a63da14d2f Author: Song Liu Date: Mon May 4 10:36:26 2020 -0700 bpf, runqslower: include proper uapi/bpf.h runqslower doesn't specify include path for uapi/bpf.h. This causes the following warning: In file included from runqslower.c:10: .../tools/testing/selftests/bpf/tools/include/bpf/bpf.h:234:38: warning: 'enum bpf_stats_type' declared inside parameter list will not be visible outside of this definition or declaration 234 | LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type); Fix this by adding -I tools/includ/uapi to the Makefile. Reported-by: Alexei Starovoitov Signed-off-by: Song Liu Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov commit 75ffb420aa715a3275bde04b64b101e91fe1f2b5 Author: Matti Vaittinen Date: Fri May 8 18:52:45 2020 +0300 power: supply: KConfig cleanup default n The "default n" is not needed as it is, well, default. Clean the KConfig by removing "default n". Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Signed-off-by: Sebastian Reichel commit 72073aa1e262607126cb4025bd8f08044f677ab6 Author: Matti Vaittinen Date: Fri May 8 18:51:42 2020 +0300 power: supply: Fix Kconfig help text indentiation Indent the help text as explained in Documentation/process/coding-style.rst Signed-off-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit 0902f8366491b7cf66ac01d8508ed3a12a36faa5 Author: Matti Vaittinen Date: Fri May 8 18:49:26 2020 +0300 power: supply: Support ROHM bd99954 charger The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion secondary battery intended to be used in space-constraint equipment such as Low profile Notebook PC, Tablets and other applications. BD99954 provides a Dual-source Battery Charger, two port BC1.2 detection and a Battery Monitor. Support ROHM BD99954 Charger IC. Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Signed-off-by: Sebastian Reichel commit 2a75c8a4e4fe1dd3f773259932a7a993e507f786 Author: Matti Vaittinen Date: Fri May 8 18:48:24 2020 +0300 dt_bindings: ROHM BD99954 Charger The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion secondary battery. Intended to be used in space-constraint equipment such as Low profile Notebook PC, Tablets and other applications. BD99954 provides a Dual-source Battery Charger, two port BC1.2 detection and a Battery Monitor. Document the DT bindings for BD99954 Signed-off-by: Matti Vaittinen Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 5a63b7ba50fd6b7a897bf9353dbf31d579cfe116 Author: Matti Vaittinen Date: Fri May 8 18:47:20 2020 +0300 power: supply: add battery parameters Add parsing of new device-tree battery bindings. - trickle-charge-current-microamp - precharge-upper-limit-microvolt - re-charge-voltage-microvolt - over-voltage-threshold-microvolt Signed-off-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit e3420b49949c79d6182dd8128fa7a3958da01b07 Author: Matti Vaittinen Date: Fri May 8 18:46:17 2020 +0300 dt-bindings: battery: add new battery parameters Add: - trickle-charge-current-microamp: Some chargers have 3 charging stages. First one when battery is almost empty is often called as trickle-charge. Last state when battery has been "woken up" is usually called as fast-charge. In addition to this some chargers have a 'middle state' which ROHM BD99954 data-sheet describes as pre-charge. Some batteries can benefit from this 3-phase charging [citation needed]. Introduce trickle-charge-current-microamp so that batteries can give charging current limit for all three states. - precharge-upper-limit-microvolt: When battery voltage has reached certain limit we change from trickle-charge to next charging state (pre-charge for BD99954). Allow battery to specify this limit. - re-charge-voltage-microvolt: Allow giving a battery specific voltage limit for chargers which can automatically re-start charging when battery has discharghed down to this limit. - over-voltage-threshold-microvolt Allow specifying voltage threshold after which the battery is assumed to be faulty. Signed-off-by: Matti Vaittinen Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 92f7d909720e188bf5ce411dc2ebdb8049c855b1 Author: Matti Vaittinen Date: Fri May 8 18:44:45 2020 +0300 power: supply: bd70528: use linear ranges Change the bd70528 to use common linear_range code instead of implementing a copy of it in this driver. Signed-off-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit 180139dca8b38c858027b8360ee10064fdb2fbf7 Merge: 8086fbaf4934 6879c042e105 Author: Alexei Starovoitov Date: Sat May 9 17:05:27 2020 -0700 Merge branch 'bpf_iter' Yonghong Song says: ==================== Motivation: The current way to dump kernel data structures mostly: 1. /proc system 2. various specific tools like "ss" which requires kernel support. 3. drgn The dropback for the first two is that whenever you want to dump more, you need change the kernel. For example, Martin wants to dump socket local storage with "ss". Kernel change is needed for it to work ([1]). This is also the direct motivation for this work. drgn ([2]) solves this proble nicely and no kernel change is not needed. But since drgn is not able to verify the validity of a particular pointer value, it might present the wrong results in rare cases. In this patch set, we introduce bpf iterator. Initial kernel changes are still needed for interested kernel data, but a later data structure change will not require kernel changes any more. bpf program itself can adapt to new data structure changes. This will give certain flexibility with guaranteed correctness. In this patch set, kernel seq_ops is used to facilitate iterating through kernel data, similar to current /proc and many other lossless kernel dumping facilities. In the future, different iterators can be implemented to trade off losslessness for other criteria e.g. no repeated object visits, etc. User Interface: 1. Similar to prog/map/link, the iterator can be pinned into a path within a bpffs mount point. 2. The bpftool command can pin an iterator to a file bpftool iter pin 3. Use `cat ` to dump the contents. Use `rm -f ` to remove the pinned iterator. 4. The anonymous iterator can be created as well. Please see patch #19 andd #20 for bpf programs and bpf iterator output examples. Note that certain iterators are namespace aware. For example, task and task_file targets only iterate through current pid namespace. ipv6_route and netlink will iterate through current net namespace. Please see individual patches for implementation details. Performance: The bpf iterator provides in-kernel aggregation abilities for kernel data. This can greatly improve performance compared to e.g., iterating all process directories under /proc. For example, I did an experiment on my VM with an application forking different number of tasks and each forked process opening various number of files. The following is the result with the latency with unit of microseconds: # of forked tasks # of open files # of bpf_prog calls # latency (us) 100 100 11503 7586 1000 1000 1013203 709513 10000 100 1130203 764519 The number of bpf_prog calls may be more than forked tasks multipled by open files since there are other tasks running on the system. The bpf program is a do-nothing program. One millions of bpf calls takes less than one second. Although the initial motivation is from Martin's sk_local_storage, this patch didn't implement tcp6 sockets and sk_local_storage. The /proc/net/tcp6 involves three types of sockets, timewait, request and tcp6 sockets. Some kind of type casting or other mechanism is needed to handle all these socket types in one bpf program. This will be addressed in future work. Currently, we do not support kernel data generated under module. This requires some BTF work. More work for more iterators, e.g., tcp, udp, bpf_map elements, etc. Changelog: v3 -> v4: - in bpf_seq_read(), if start() failed with an error, return that error to user space (Andrii) - in bpf_seq_printf(), if reading kernel memory failed for %s and %p{i,I}{4,6}, set buffer to empty string or address 0. Documented this behavior in uapi header (Andrii) - fix a few error handling issues for bpftool (Andrii) - A few other minor fixes and cosmetic changes. v2 -> v3: - add bpf_iter_unreg_target() to unregister a target, used in the error path of the __init functions. - handle err != 0 before handling overflow (Andrii) - reference count "task" for task_file target (Andrii) - remove some redundancy for bpf_map/task/task_file targets - add bpf_iter_unreg_target() in ip6_route_cleanup() - Handling "%%" format in bpf_seq_printf() (Andrii) - implement auto-attach for bpf_iter in libbpf (Andrii) - add macros offsetof and container_of in bpf_helpers.h (Andrii) - add tests for auto-attach and program-return-1 cases - some other minor fixes v1 -> v2: - removed target_feature, using callback functions instead - checking target to ensure program specified btf_id supported (Martin) - link_create change with new changes from Andrii - better handling of btf_iter vs. seq_file private data (Martin, Andrii) - implemented bpf_seq_read() (Andrii, Alexei) - percpu buffer for bpf_seq_printf() (Andrii) - better syntax for BPF_SEQ_PRINTF macro (Andrii) - bpftool fixes (Quentin) - a lot of other fixes RFC v2 -> v1: - rename bpfdump to bpf_iter - use bpffs instead of a new file system - use bpf_link to streamline and simplify iterator creation. References: [1]: https://lore.kernel.org/bpf/20200225230427.1976129-1-kafai@fb.com [2]: https://github.com/osandov/drgn ==================== Signed-off-by: Alexei Starovoitov commit 6879c042e10584ea9d5e2204939cafadcd500465 Author: Yonghong Song Date: Sat May 9 10:59:23 2020 -0700 tools/bpf: selftests: Add bpf_iter selftests The added test includes the following subtests: - test verifier change for btf_id_or_null - test load/create_iter/read for ipv6_route/netlink/bpf_map/task/task_file - test anon bpf iterator - test anon bpf iterator reading one char at a time - test file bpf iterator - test overflow (single bpf program output not overflow) - test overflow (single bpf program output overflows) - test bpf prog returning 1 The ipv6_route tests the following verifier change - access fields in the variable length array of the structure. The netlink load tests the following verifier change - put a btf_id ptr value in a stack and accessible to tracing/iter programs. The anon bpf iterator also tests link auto attach through skeleton. $ test_progs -n 2 #2/1 btf_id_or_null:OK #2/2 ipv6_route:OK #2/3 netlink:OK #2/4 bpf_map:OK #2/5 task:OK #2/6 task_file:OK #2/7 anon:OK #2/8 anon-read-one-char:OK #2/9 file:OK #2/10 overflow:OK #2/11 overflow-e2big:OK #2/12 prog-ret-1:OK #2 bpf_iter:OK Summary: 1/12 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175923.2477637-1-yhs@fb.com commit acf61631746c01850a9df0cd5617c5c29214776c Author: Yonghong Song Date: Sat May 9 10:59:22 2020 -0700 tools/bpf: selftests: Add iter progs for bpf_map/task/task_file The implementation is arbitrary, just to show how the bpf programs can be written for bpf_map/task/task_file. They can be costomized for specific needs. For example, for bpf_map, the iterator prints out: $ cat /sys/fs/bpf/my_bpf_map id refcnt usercnt locked_vm 3 2 0 20 6 2 0 20 9 2 0 20 12 2 0 20 13 2 0 20 16 2 0 20 19 2 0 20 %%% END %%% For task, the iterator prints out: $ cat /sys/fs/bpf/my_task tgid gid 1 1 2 2 .... 1944 1944 1948 1948 1949 1949 1953 1953 === END === For task/file, the iterator prints out: $ cat /sys/fs/bpf/my_task_file tgid gid fd file 1 1 0 ffffffff95c97600 1 1 1 ffffffff95c97600 1 1 2 ffffffff95c97600 .... 1895 1895 255 ffffffff95c8fe00 1932 1932 0 ffffffff95c8fe00 1932 1932 1 ffffffff95c8fe00 1932 1932 2 ffffffff95c8fe00 1932 1932 3 ffffffff95c185c0 This is able to print out all open files (fd and file->f_op), so user can compare f_op against a particular kernel file operations to find what it is. For example, from /proc/kallsyms, we can find ffffffff95c185c0 r eventfd_fops so we will know tgid 1932 fd 3 is an eventfd file descriptor. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175922.2477576-1-yhs@fb.com commit 7c128a6bbd4f5b6780a90f3ce9aff192b7dd9d6a Author: Yonghong Song Date: Sat May 9 10:59:21 2020 -0700 tools/bpf: selftests: Add iterator programs for ipv6_route and netlink Two bpf programs are added in this patch for netlink and ipv6_route target. On my VM, I am able to achieve identical results compared to /proc/net/netlink and /proc/net/ipv6_route. $ cat /proc/net/netlink sk Eth Pid Groups Rmem Wmem Dump Locks Drops Inode 000000002c42d58b 0 0 00000000 0 0 0 2 0 7 00000000a4e8b5e1 0 1 00000551 0 0 0 2 0 18719 00000000e1b1c195 4 0 00000000 0 0 0 2 0 16422 000000007e6b29f9 6 0 00000000 0 0 0 2 0 16424 .... 00000000159a170d 15 1862 00000002 0 0 0 2 0 1886 000000009aca4bc9 15 3918224839 00000002 0 0 0 2 0 19076 00000000d0ab31d2 15 1 00000002 0 0 0 2 0 18683 000000008398fb08 16 0 00000000 0 0 0 2 0 27 $ cat /sys/fs/bpf/my_netlink sk Eth Pid Groups Rmem Wmem Dump Locks Drops Inode 000000002c42d58b 0 0 00000000 0 0 0 2 0 7 00000000a4e8b5e1 0 1 00000551 0 0 0 2 0 18719 00000000e1b1c195 4 0 00000000 0 0 0 2 0 16422 000000007e6b29f9 6 0 00000000 0 0 0 2 0 16424 .... 00000000159a170d 15 1862 00000002 0 0 0 2 0 1886 000000009aca4bc9 15 3918224839 00000002 0 0 0 2 0 19076 00000000d0ab31d2 15 1 00000002 0 0 0 2 0 18683 000000008398fb08 16 0 00000000 0 0 0 2 0 27 $ cat /proc/net/ipv6_route fe800000000000000000000000000000 40 00000000000000000000000000000000 00 00000000000000000000000000000000 00000100 00000001 00000000 00000001 eth0 00000000000000000000000000000000 00 00000000000000000000000000000000 00 00000000000000000000000000000000 ffffffff 00000001 00000000 00200200 lo 00000000000000000000000000000001 80 00000000000000000000000000000000 00 00000000000000000000000000000000 00000000 00000003 00000000 80200001 lo fe80000000000000c04b03fffe7827ce 80 00000000000000000000000000000000 00 00000000000000000000000000000000 00000000 00000002 00000000 80200001 eth0 ff000000000000000000000000000000 08 00000000000000000000000000000000 00 00000000000000000000000000000000 00000100 00000003 00000000 00000001 eth0 00000000000000000000000000000000 00 00000000000000000000000000000000 00 00000000000000000000000000000000 ffffffff 00000001 00000000 00200200 lo $ cat /sys/fs/bpf/my_ipv6_route fe800000000000000000000000000000 40 00000000000000000000000000000000 00 00000000000000000000000000000000 00000100 00000001 00000000 00000001 eth0 00000000000000000000000000000000 00 00000000000000000000000000000000 00 00000000000000000000000000000000 ffffffff 00000001 00000000 00200200 lo 00000000000000000000000000000001 80 00000000000000000000000000000000 00 00000000000000000000000000000000 00000000 00000003 00000000 80200001 lo fe80000000000000c04b03fffe7827ce 80 00000000000000000000000000000000 00 00000000000000000000000000000000 00000000 00000002 00000000 80200001 eth0 ff000000000000000000000000000000 08 00000000000000000000000000000000 00 00000000000000000000000000000000 00000100 00000003 00000000 00000001 eth0 00000000000000000000000000000000 00 00000000000000000000000000000000 00 00000000000000000000000000000000 ffffffff 00000001 00000000 00200200 lo Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175921.2477493-1-yhs@fb.com commit 9406b485dea5e25bed7c81cd822747d494cc8bde Author: Yonghong Song Date: Sat May 9 10:59:20 2020 -0700 tools/bpftool: Add bpf_iter support for bptool Currently, only one command is supported bpftool iter pin It will pin the trace/iter bpf program in the object file to the where should be on a bpffs mount. For example, $ bpftool iter pin ./bpf_iter_ipv6_route.o \ /sys/fs/bpf/my_route User can then do a `cat` to print out the results: $ cat /sys/fs/bpf/my_route fe800000000000000000000000000000 40 00000000000000000000000000000000 ... 00000000000000000000000000000000 00 00000000000000000000000000000000 ... 00000000000000000000000000000001 80 00000000000000000000000000000000 ... fe800000000000008c0162fffebdfd57 80 00000000000000000000000000000000 ... ff000000000000000000000000000000 08 00000000000000000000000000000000 ... 00000000000000000000000000000000 00 00000000000000000000000000000000 ... The implementation for ipv6_route iterator is in one of subsequent patches. This patch also added BPF_LINK_TYPE_ITER to link query. In the future, we may add additional parameters to pin command by parameterizing the bpf iterator. For example, a map_id or pid may be added to let bpf program only traverses a single map or task, similar to kernel seq_file single_open(). We may also add introspection command for targets/iterators by leveraging the bpf_iter itself. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200509175920.2477247-1-yhs@fb.com commit 5fbc220862fc7a53a0455ccd2d96c82141e222d4 Author: Yonghong Song Date: Sat May 9 10:59:19 2020 -0700 tools/libpf: Add offsetof/container_of macro in bpf_helpers.h These two helpers will be used later in bpf_iter bpf program bpf_iter_netlink.c. Put them in bpf_helpers.h since they could be useful in other cases. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175919.2477104-1-yhs@fb.com commit c09add2fbc5aece00a5b54a48ce39fd4e3284d87 Author: Yonghong Song Date: Sat May 9 10:59:17 2020 -0700 tools/libbpf: Add bpf_iter support Two new libbpf APIs are added to support bpf_iter: - bpf_program__attach_iter Given a bpf program and additional parameters, which is none now, returns a bpf_link. - bpf_iter_create syscall level API to create a bpf iterator. The macro BPF_SEQ_PRINTF are also introduced. The format looks like: BPF_SEQ_PRINTF(seq, "task id %d\n", pid); This macro can help bpf program writers with nicer bpf_seq_printf syntax similar to the kernel one. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175917.2476936-1-yhs@fb.com commit 9c5f8a1008a121e4c6b24af211034e24b0b63081 Author: Yonghong Song Date: Sat May 9 10:59:16 2020 -0700 bpf: Support variable length array in tracing programs In /proc/net/ipv6_route, we have struct fib6_info { struct fib6_table *fib6_table; ... struct fib6_nh fib6_nh[0]; } struct fib6_nh { struct fib_nh_common nh_common; struct rt6_info **rt6i_pcpu; struct rt6_exception_bucket *rt6i_exception_bucket; }; struct fib_nh_common { ... u8 nhc_gw_family; ... } The access: struct fib6_nh *fib6_nh = &rt->fib6_nh; ... fib6_nh->nh_common.nhc_gw_family ... This patch ensures such an access is handled properly. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175916.2476853-1-yhs@fb.com commit 1d68f22b3d53d368d5cc8d09de890250cae5c945 Author: Yonghong Song Date: Sat May 9 10:59:15 2020 -0700 bpf: Handle spilled PTR_TO_BTF_ID properly when checking stack_boundary This specifically to handle the case like below: // ptr below is a socket ptr identified by PTR_TO_BTF_ID u64 param[2] = { ptr, val }; bpf_seq_printf(seq, fmt, sizeof(fmt), param, sizeof(param)); In this case, the 16 bytes stack for "param" contains: 8 bytes for ptr with spilled PTR_TO_BTF_ID 8 bytes for val as STACK_MISC The current verifier will complain the ptr should not be visible to the helper. ... 16: (7b) *(u64 *)(r10 -64) = r2 18: (7b) *(u64 *)(r10 -56) = r1 19: (bf) r4 = r10 ; 20: (07) r4 += -64 ; BPF_SEQ_PRINTF(seq, fmt1, (long)s, s->sk_protocol); 21: (bf) r1 = r6 22: (18) r2 = 0xffffa8d00018605a 24: (b4) w3 = 10 25: (b4) w5 = 16 26: (85) call bpf_seq_printf#125 R0=inv(id=0) R1_w=ptr_seq_file(id=0,off=0,imm=0) R2_w=map_value(id=0,off=90,ks=4,vs=144,imm=0) R3_w=inv10 R4_w=fp-64 R5_w=inv16 R6=ptr_seq_file(id=0,off=0,imm=0) R7=ptr_netlink_sock(id=0,off=0,imm=0) R10=fp0 fp-56_w=mmmmmmmm fp-64_w=ptr_ last_idx 26 first_idx 13 regs=8 stack=0 before 25: (b4) w5 = 16 regs=8 stack=0 before 24: (b4) w3 = 10 invalid indirect read from stack off -64+0 size 16 Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175915.2476783-1-yhs@fb.com commit 492e639f0c222784e2e0f121966375f641c61b15 Author: Yonghong Song Date: Sat May 9 10:59:14 2020 -0700 bpf: Add bpf_seq_printf and bpf_seq_write helpers Two helpers bpf_seq_printf and bpf_seq_write, are added for writing data to the seq_file buffer. bpf_seq_printf supports common format string flag/width/type fields so at least I can get identical results for netlink and ipv6_route targets. For bpf_seq_printf and bpf_seq_write, return value -EOVERFLOW specifically indicates a write failure due to overflow, which means the object will be repeated in the next bpf invocation if object collection stays the same. Note that if the object collection is changed, depending how collection traversal is done, even if the object still in the collection, it may not be visited. For bpf_seq_printf, format %s, %p{i,I}{4,6} needs to read kernel memory. Reading kernel memory may fail in the following two cases: - invalid kernel address, or - valid kernel address but requiring a major fault If reading kernel memory failed, the %s string will be an empty string and %p{i,I}{4,6} will be all 0. Not returning error to bpf program is consistent with what bpf_trace_printk() does for now. bpf_seq_printf may return -EBUSY meaning that internal percpu buffer for memory copy of strings or other pointees is not available. Bpf program can return 1 to indicate it wants the same object to be repeated. Right now, this should not happen on no-RT kernels since migrate_disable(), which guards bpf prog call, calls preempt_disable(). Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175914.2476661-1-yhs@fb.com commit b121b341e5983bdccf7a5d6cf9236a45c965a31f Author: Yonghong Song Date: Sat May 9 10:59:12 2020 -0700 bpf: Add PTR_TO_BTF_ID_OR_NULL support Add bpf_reg_type PTR_TO_BTF_ID_OR_NULL support. For tracing/iter program, the bpf program context definition, e.g., for previous bpf_map target, looks like struct bpf_iter__bpf_map { struct bpf_iter_meta *meta; struct bpf_map *map; }; The kernel guarantees that meta is not NULL, but map pointer maybe NULL. The NULL map indicates that all objects have been traversed, so bpf program can take proper action, e.g., do final aggregation and/or send final report to user space. Add btf_id_or_null_non0_off to prog->aux structure, to indicate that if the context access offset is not 0, set to PTR_TO_BTF_ID_OR_NULL instead of PTR_TO_BTF_ID. This bit is set for tracing/iter program. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175912.2476576-1-yhs@fb.com commit eaaacd23910f2d7c4b22d43f591002cc217d294b Author: Yonghong Song Date: Sat May 9 10:59:11 2020 -0700 bpf: Add task and task/file iterator targets Only the tasks belonging to "current" pid namespace are enumerated. For task/file target, the bpf program will have access to struct task_struct *task u32 fd struct file *file where fd/file is an open file for the task. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175911.2476407-1-yhs@fb.com commit 138d0be35b141e09f6b267c6ae4094318d4e4491 Author: Yonghong Song Date: Sat May 9 10:59:10 2020 -0700 net: bpf: Add netlink and ipv6_route bpf_iter targets This patch added netlink and ipv6_route targets, using the same seq_ops (except show() and minor changes for stop()) for /proc/net/{netlink,ipv6_route}. The net namespace for these targets are the current net namespace at file open stage, similar to /proc/net/{netlink,ipv6_route} reference counting the net namespace at seq_file open stage. Since module is not supported for now, ipv6_route is supported only if the IPV6 is built-in, i.e., not compiled as a module. The restriction can be lifted once module is properly supported for bpf_iter. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175910.2476329-1-yhs@fb.com commit 6086d29def80edd78f9832ea6eafa74e3818f6a7 Author: Yonghong Song Date: Sat May 9 10:59:09 2020 -0700 bpf: Add bpf_map iterator Implement seq_file operations to traverse all bpf_maps. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175909.2476096-1-yhs@fb.com commit e5158d987b72c3f318b4b52a01ac6f3997bd0c00 Author: Yonghong Song Date: Sat May 9 10:59:07 2020 -0700 bpf: Implement common macros/helpers for target iterators Macro DEFINE_BPF_ITER_FUNC is implemented so target can define an init function to capture the BTF type which represents the target. The bpf_iter_meta is a structure holding meta data, common to all targets in the bpf program. Additional marker functions are called before or after bpf_seq_read() show()/next()/stop() callback functions to help calculate precise seq_num and whether call bpf_prog inside stop(). Two functions, bpf_iter_get_info() and bpf_iter_run_prog(), are implemented so target can get needed information from bpf_iter infrastructure and can run the program. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175907.2475956-1-yhs@fb.com commit 367ec3e4834cbd611401c2c40a23c22c825474f1 Author: Yonghong Song Date: Sat May 9 10:59:06 2020 -0700 bpf: Create file bpf iterator To produce a file bpf iterator, the fd must be corresponding to a link_fd assocciated with a trace/iter program. When the pinned file is opened, a seq_file will be generated. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175906.2475893-1-yhs@fb.com commit ac51d99bf81caac8d8881fe52098948110d0de68 Author: Yonghong Song Date: Sat May 9 10:59:05 2020 -0700 bpf: Create anonymous bpf iterator A new bpf command BPF_ITER_CREATE is added. The anonymous bpf iterator is seq_file based. The seq_file private data are referenced by targets. The bpf_iter infrastructure allocated additional space at seq_file->private before the space used by targets to store some meta data, e.g., prog: prog to run session_id: an unique id for each opened seq_file seq_num: how many times bpf programs are queried in this session done_stop: an internal state to decide whether bpf program should be called in seq_ops->stop() or not The seq_num will start from 0 for valid objects. The bpf program may see the same seq_num more than once if - seq_file buffer overflow happens and the same object is retried by bpf_seq_read(), or - the bpf program explicitly requests a retry of the same object Since module is not supported for bpf_iter, all target registeration happens at __init time, so there is no need to change bpf_iter_unreg_target() as it is used mostly in error path of the init function at which time no bpf iterators have been created yet. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175905.2475770-1-yhs@fb.com commit fd4f12bc38c3ad9107169e7c9e6e7f81d93dda97 Author: Yonghong Song Date: Sat May 9 10:59:04 2020 -0700 bpf: Implement bpf_seq_read() for bpf iterator bpf iterator uses seq_file to provide a lossless way to transfer data to user space. But we want to call bpf program after all objects have been traversed, and bpf program may write additional data to the seq_file buffer. The current seq_read() does not work for this use case. Besides allowing stop() function to write to the buffer, the bpf_seq_read() also fixed the buffer size to one page. If any single call of show() or stop() will emit data more than one page to cause overflow, -E2BIG error code will be returned to user space. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175904.2475468-1-yhs@fb.com commit 2057c92bc927f09b22f5609425eb37d7e782f484 Author: Yonghong Song Date: Sat May 9 10:59:02 2020 -0700 bpf: Support bpf tracing/iter programs for BPF_LINK_UPDATE Added BPF_LINK_UPDATE support for tracing/iter programs. This way, a file based bpf iterator, which holds a reference to the link, can have its bpf program updated without creating new files. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175902.2475262-1-yhs@fb.com commit de4e05cac46d206f9090051ef09930514bff73e4 Author: Yonghong Song Date: Sat May 9 10:59:01 2020 -0700 bpf: Support bpf tracing/iter programs for BPF_LINK_CREATE Given a bpf program, the step to create an anonymous bpf iterator is: - create a bpf_iter_link, which combines bpf program and the target. In the future, there could be more information recorded in the link. A link_fd will be returned to the user space. - create an anonymous bpf iterator with the given link_fd. The bpf_iter_link can be pinned to bpffs mount file system to create a file based bpf iterator as well. The benefit to use of bpf_iter_link: - using bpf link simplifies design and implementation as bpf link is used for other tracing bpf programs. - for file based bpf iterator, bpf_iter_link provides a standard way to replace underlying bpf programs. - for both anonymous and free based iterators, bpf link query capability can be leveraged. The patch added support of tracing/iter programs for BPF_LINK_CREATE. A new link type BPF_LINK_TYPE_ITER is added to facilitate link querying. Currently, only prog_id is needed, so there is no additional in-kernel show_fdinfo() and fill_link_info() hook is needed for BPF_LINK_TYPE_ITER link. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175901.2475084-1-yhs@fb.com commit 15d83c4d7cef5c067a8b075ce59e97df4f60706e Author: Yonghong Song Date: Sat May 9 10:59:00 2020 -0700 bpf: Allow loading of a bpf_iter program A bpf_iter program is a tracing program with attach type BPF_TRACE_ITER. The load attribute attach_btf_id is used by the verifier against a particular kernel function, which represents a target, e.g., __bpf_iter__bpf_map for target bpf_map which is implemented later. The program return value must be 0 or 1 for now. 0 : successful, except potential seq_file buffer overflow which is handled by seq_file reader. 1 : request to restart the same object In the future, other return values may be used for filtering or teminating the iterator. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175900.2474947-1-yhs@fb.com commit ae24345da54e452880808b011fa2d8a0bbd191ba Author: Yonghong Song Date: Sat May 9 10:58:59 2020 -0700 bpf: Implement an interface to register bpf_iter targets The target can call bpf_iter_reg_target() to register itself. The needed information: target: target name seq_ops: the seq_file operations for the target init_seq_private target callback to initialize seq_priv during file open fini_seq_private target callback to clean up seq_priv during file release seq_priv_size: the private_data size needed by the seq_file operations The target name represents a target which provides a seq_ops for iterating objects. The target can provide two callback functions, init_seq_private and fini_seq_private, called during file open/release time. For example, /proc/net/{tcp6, ipv6_route, netlink, ...}, net name space needs to be setup properly during file open and released properly during file release. Function bpf_iter_unreg_target() is also implemented to unregister a particular target. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200509175859.2474669-1-yhs@fb.com commit bf584e4dbd5bac7b1aaddbd33a7116364f919819 Merge: 1072ceada458 60ab7f4153b6 Author: Sebastian Reichel Date: Sun May 10 01:56:03 2020 +0200 Merge tag 'tags/linear-ranges-lib' into psy-next lib: Add linear ranges helper library and start using it Series extracts a "linear ranges" helper out of the regulator framework. Linear ranges helper is intended to help converting real-world values to register values when conversion is linear. I suspect this is useful also for power subsystem and possibly for clk. Signed-off-by: Sebastian Reichel commit 1072ceada4586f7c1d316a0dd9fa751a7055969c Author: Hongbo Yao Date: Sat May 9 18:36:11 2020 +0800 power: reset: ltc2952: remove unused variable Fix gcc '-Wunused-but-set-variable' warning: drivers/power/reset/ltc2952-poweroff.c:97:16: warning: variable ‘overruns’ set but not used [-Wunused-but-set-variable] unsigned long overruns; Reported-by: Hulk Robot Signed-off-by: Hongbo Yao Signed-off-by: Sebastian Reichel commit 934ed3847a4ebc75b655659c4d2349ba4337941c Author: Christophe JAILLET Date: Sat May 9 10:23:23 2020 +0200 power: supply: lp8788: Fix an error handling path in 'lp8788_charger_probe()' In the probe function, in case of error, resources allocated in 'lp8788_setup_adc_channel()' must be released. This can be achieved easily by using the devm_ variant of 'iio_channel_get()'. This has the extra benefit to simplify the remove function and to axe the 'lp8788_release_adc_channel()' function which is now useless. Fixes: 98a276649358 ("power_supply: Add new lp8788 charger driver") Signed-off-by: Christophe JAILLET Signed-off-by: Sebastian Reichel commit 02a5043b22ed2f6ea03b8533b47fdaa5853832c9 Merge: 72ef908bb3ff aa7431123fc6 Author: Jakub Kicinski Date: Sat May 9 16:03:26 2020 -0700 Merge branch 'mlxsw-spectrum-Enforce-some-HW-limitations-for-matchall-TC-offload' Ido Schimmel says: ==================== mlxsw: spectrum: Enforce some HW limitations for matchall TC offload Jiri says: There are some limitations for TC matchall classifier offload that are given by the mlxsw HW dataplane. It is not possible to do sampling on egress and also the mirror/sample vs. ACL (flower) ordering is fixed. So check this and forbid to offload incorrect setup. ==================== Signed-off-by: Jakub Kicinski commit aa7431123fc6f36574d9cc23be24dc802bb4cfa5 Author: Jiri Pirko Date: Sat May 9 23:06:10 2020 +0300 selftests: mlxsw: tc_restrictions: add couple of test for the correct matchall-flower ordering Make sure that the drive restricts incorrect order of inserted matchall vs. flower rules. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 240fe73457fbfc13cb30d1d16064f19590ff10f6 Author: Jiri Pirko Date: Sat May 9 23:06:09 2020 +0300 selftests: mlxsw: tc_restrictions: add test to check sample action restrictions Check that matchall rules with sample actions are not possible to be inserted to egress. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit b886dea37b78debeea7019c649c05c7e2ba027fc Author: Jiri Pirko Date: Sat May 9 23:06:08 2020 +0300 selftests: mlxsw: rename tc_flower_restrictions.sh to tc_restrictions.sh The file is about to contain matchall restrictions too, so change the name to make it more generic. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 67ed68fc0c9aa4a456d03df216e571e0c6177097 Author: Jiri Pirko Date: Sat May 9 23:06:07 2020 +0300 mlxsw: spectrum_flower: Forbid to insert flower rules in collision with matchall rules On ingress, the matchall rules doing mirroring and sampling are offloaded into hardware blocks that are processed before any flower rules. On egress, the matchall mirroring rules are offloaded into hardware block that is processed after all flower rules. Therefore check the priorities of inserted flower rules against existing matchall rules and ensure the correct ordering. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 18346b70ab776fa2cbb9a5f0f0f9c4700c470c5e Author: Jiri Pirko Date: Sat May 9 23:06:06 2020 +0300 mlxsw: spectrum_matchall: Forbid to insert matchall rules in collision with flower rules On ingress, the matchall rules doing mirroring and sampling are offloaded into hardware blocks that are processed before any flower rules. On egress, the matchall mirroring rules are offloaded into hardware block that is processed after all flower rules. Therefore check the priorities of inserted matchall rules against existing flower rules and ensure the correct ordering. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit aed65285fb9e16328f9bbf14394fef5ddbe82815 Author: Jiri Pirko Date: Sat May 9 23:06:05 2020 +0300 mlxsw: spectrum_matchall: Expose a function to get min and max rule priority Introduce an infrastructure that allows to get minimum and maximum rule priority for specified chain. This is going to be used by a subsequent patch to enforce ordering between flower and matchall filters. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 5a2939b9d7ddbdc399ce42cae8150c424e0bd764 Author: Jiri Pirko Date: Sat May 9 23:06:04 2020 +0300 mlxsw: spectrum_matchall: Put matchall list into substruct of flow struct As there are going to be other matchall specific fields in flow structure, put the existing list field into matchall substruct. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 593bb843798636131bd6d9eb1633b1ee55a8a53b Author: Jiri Pirko Date: Sat May 9 23:06:03 2020 +0300 mlxsw: spectrum_flower: Expose a function to get min and max rule priority Introduce an infrastructure that allows to get minimum and maximum rule priority for specified chain. This is going to be used by a subsequent patch to enforce ordering between flower and matchall filters. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 18aa23b31f6c8e3f4b01b70a8a4eab873e2eb710 Author: Jiri Pirko Date: Sat May 9 23:06:02 2020 +0300 mlxsw: spectrum_matchall: Restrict sample action to be allowed only on ingress HW supports packet sampling on ingress only. Check and fail if user is adding sample on egress. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 72ef908bb3ff9261dc38d079ef332c91418f8693 Author: Luo bin Date: Fri May 8 20:18:50 2020 +0000 hinic: add three net_device_ops of vf adds ndo_set_vf_rate/ndo_set_vf_spoofchk/ndo_set_vf_link_state to configure netdev of virtual function Signed-off-by: Luo bin Signed-off-by: Jakub Kicinski commit 92decf118f1da4c866515f80387f9cf4d48611d6 Author: Keith Busch Date: Fri Apr 3 10:53:46 2020 -0700 nvme: define constants for identification values Improve code readability by defining the specification's constants that the driver is using when decoding identification payloads. Signed-off-by: Keith Busch Reviewed-by: Bart van Assche Reviewed-by: Chaitanya Kulkarni Acked-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit d02abd198633a4c40411b9a5994111452720470d Author: Chaitanya Kulkarni Date: Mon May 4 01:56:48 2020 -0700 nvmet: align addrfam list to spec With reference to the NVMeOF Specification (page 44, Figure 38) discovery log page entry provides address family field. We do set the transport type field but the adrfam field is not set when using loop transport and also it doesn't have support in the nvme-cli. So when reading discovery log page with a loop transport it leads to confusing output. As per the spec for adrfam value 254 is reserved for Intra Host Transport i.e. loopback), we add a required macro in the protocol header file, set default port disc addr entry's adrfam to NVMF_ADDR_FAMILY_MAX, and update nvmet_addr_family configfs array for show/store attribute. Without this patch, setting adrfam to (ipv4/ipv6/ib/fc/loop/" ") we get following output for nvme discover command from nvme-cli which is confusing. trtype: loop adrfam: ipv4 trtype: loop adrfam: ipv6 trtype: loop adrfam: infiniband trtype: loop adrfam: fibre-channel trtype: loop # ${CFGFS_HOME}/nvmet/ports/1/addr_adrfam = loop adrfam: pci # <----- pci for loop trtype: loop # ${CFGFS_HOME}/nvmet/ports/1/addr_adrfam = " " adrfam: pci # <----- pci for unrecognized This patch fixes above output :- trtype: loop adrfam: ipv4 trtype: loop adrfam: ipv6 trtype: loop adrfam: infiniband trtype: loop adrfam: fibre-channel trtype: loop # ${CFGFS_HOME}/nvmet/ports/1/addr_adrfam = loop adrfam: loop # <----- loop for loop trtype: loop # ${CFGFS_HOME}/config/nvmet/ports/adrfam = " " adrfam: unrecognized # <----- unrecognized when invalid value Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3ecb5faa07c7fd33a3ce1a8340841aa368df7d43 Author: Chaitanya Kulkarni Date: Mon May 4 01:56:47 2020 -0700 nvmet: centralize port enable access for configfs The configfs attributes which are supposed to set when port is disable such as addr[addrfam|portid|traddr|treq|trsvcid|inline_data_size|trtype] has repetitive check and generic error message printing. This patch creates centralize helper to check and print an error message that also accepts caller as a parameter. This makes error message easy to parse for the user, removes the duplicate code and makes it available for futures such scenarios. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 87628e2851008d5b0e53859f6062988c6d66d7f5 Author: Chaitanya Kulkarni Date: Mon May 4 01:56:46 2020 -0700 nvmet: use type-name map for address treq Currently nvmet_addr_treq_[store|show]() uses switch and if else ladder for address transport requirements to string and reverse mapping. With addtion of the generic nvmet_type_name_map structure we can get rid of the switch and if else ladder with string duplication. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 84b8d0d7aa159652dc191d58c4d353b6c9173c54 Author: Chaitanya Kulkarni Date: Mon May 4 01:56:45 2020 -0700 nvmet: use type-name map for ana states Now that we have a generic type to name map for configfs, get rid of the nvmet_ana_state_names structure and replace it with newly added nvmet_type_name_map. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7e764179c86784594d54764556c4d3973645e6a5 Author: Chaitanya Kulkarni Date: Mon May 4 01:56:44 2020 -0700 nvmet: use type-name map for address family Right now nvmet_addr_adrfam_[store|show]() uses switch and if else ladder for address family to string and reverse mapping which also repeats the strings in show and store function. With addition of generic nvmet_type_name_map structure we can now get rid of the switch and if else ladder and string duplication. Also, we add a newline in before found label in nvmet_addr_trtype_store() which keeps goto label code consistent with nvmet_allowed_hosts_drop_link(), nvmet_port_subsys_drop_link() and nvmet_ana_group_ana_state_store(). Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 45e2f3c2d2f5f39b47745cba41e9e2b0c58d7d94 Author: Chaitanya Kulkarni Date: Mon May 4 01:56:43 2020 -0700 nvmet: add generic type-name mapping This patch adds a new type to name mapping generic structure. It replaces nvmet_transport_name with new generic mapping structure nvmet_transport. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7890b9701b792a4d75b4adef4abe325383ccfca4 Author: Christoph Hellwig Date: Sun Mar 29 19:41:38 2020 +0200 nvme-multipath: stop using ->queuedata nvme-multipath already uses the gendisk private data, not need to also set up the request_queue queuedata and use it in one place only. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit db5ad6b7f8cdd6d78efef62a1557461d0cbaee54 Author: Sagi Grimberg Date: Fri May 1 14:25:45 2020 -0700 nvme-tcp: try to send request in queue_rq context Today, nvme-tcp automatically schedules a send request to a workqueue context, which is 1 more than we'd need in case the socket buffer is wide open. However, because we have async send activity (as a result of r2t, or write_space callbacks), we need to synchronize sends from possibly multiple contexts (ideally all running on the same cpu though). Thus, we only try to send directly from queue_rq in cases: 1. the send_list is empty 2. we can send it synchronously (i.e. not from the RX path) 3. we run on the same cpu as the queue->io_cpu to avoid contention on the send operation. Proposed-by: Mark Wunderlich Signed-off-by: Mark Wunderlich Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 72e5d757c62029664c0287d14519ec4451901b5e Author: Sagi Grimberg Date: Fri May 1 14:25:44 2020 -0700 nvme-tcp: avoid scheduling io_work if we are already polling When the user runs polled I/O, we shouldn't have to trigger the workqueue to generate the receive work upon the .data_ready upcall. This prevents a redundant context switch when the application is already polling for completions. Proposed-by: Mark Wunderlich Signed-off-by: Mark Wunderlich Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 386e5e6e1aa90b479fcf0467935922df8524393d Author: Sagi Grimberg Date: Thu Apr 30 13:59:32 2020 -0700 nvme-tcp: use bh_lock in data_ready data_ready may be invoked from send context or from softirq, so need bh locking for that. Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 2a5bcfdd41d68559567cec3c124a75e093506cc1 Author: Weiping Zhang Date: Sat May 2 15:29:41 2020 +0800 nvme-pci: align io queue count with allocted nvme_queue in nvme_probe Since commit 147b27e4bd08 ("nvme-pci: allocate device queues storage space at probe"), nvme_alloc_queue does not alloc the nvme queues itself anymore. If the write/poll_queues module parameters are changed at runtime to values larger than the number of allocated queues in nvme_probe, nvme_alloc_queue will access unallocated memory. Add a new nr_allocated_queues member to struct nvme_dev to record how many queues were alloctated in nvme_probe to avoid using more than the allocated queues after a reset following a change to the write/poll_queues module parameters. Also add nr_write_queues and nr_poll_queues members to allow refreshing the number of write and poll queues based on a change to the module parameters when resetting the controller. Fixes: 147b27e4bd08 ("nvme-pci: allocate device queues storage space at probe") Signed-off-by: Weiping Zhang Reviewed-by: Keith Busch Reviewed-by: Max Gurtovoy [hch: add nvme_max_io_queues, update the commit message] Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 54b2fcee1db041a83b52b51752dade6090cf952f Author: Keith Busch Date: Mon Apr 27 11:54:46 2020 -0700 nvme-pci: remove last_sq_tail The nvme driver does not have enough tags to wrap the queue, and blk-mq will no longer call commit_rqs() when there are no new submissions to notify. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 74943d45eef4db64b1e5c9f7ad1d018576e113c5 Author: Keith Busch Date: Tue Apr 28 07:21:56 2020 -0700 nvme-pci: remove volatile cqes The completion queue entry is not volatile once the phase is confirmed. Remove the volatile keywords and check the phase using the appropriate READ_ONCE() accessor, allowing the compiler to optimize the remaining completion path. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b04df85d9a05d7ee4b3f93c1a22312b41a949ec1 Author: Keith Busch Date: Thu Apr 30 05:31:23 2020 +0900 nvme: flush scan work on passthrough commands If a passthrough command causes the namespace inventory or capabilities to change, flush the scan work that handles these changes so the driver synchronizes with the user command's effects before returning the result to user space. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6623c5b3dfa5513190d729a8516db7a5163ec7de Author: Christoph Hellwig Date: Wed Apr 22 09:59:08 2020 +0200 nvme: clean up error handling in nvme_init_ns_head Use a common label for putting the nshead if needed and only convert nvme status codes for the one case where it actually is needed. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit 3add1d93d9919b6de94aa47900d4904adffbc976 Author: Arnd Bergmann Date: Thu Apr 30 23:30:57 2020 +0200 nvme-fc: avoid gcc-10 zero-length-bounds warning When CONFIG_ARCH_NO_SG_CHAIN is set, op->sgl[0] cannot be dereferenced, as gcc-10 now points out: drivers/nvme/host/fc.c: In function 'nvme_fc_init_request': drivers/nvme/host/fc.c:1774:29: warning: array subscript 0 is outside the bounds of an interior zero-length array 'struct scatterlist[0]' [-Wzero-length-bounds] 1774 | op->op.fcp_req.first_sgl = &op->sgl[0]; | ^~~~~~~~~~~ drivers/nvme/host/fc.c:98:21: note: while referencing 'sgl' 98 | struct scatterlist sgl[NVME_INLINE_SG_CNT]; | ^~~ I don't know if this is a legitimate warning or a false-positive. If this is just a false alarm, the warning is easily suppressed by interpreting the array as a pointer. Fixes: b1ae1a238900 ("nvme-fc: Avoid preallocating big SGL for data") Signed-off-by: Arnd Bergmann Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit e8cd1ff11d58a21242ea2b85450298f3681768a1 Author: Anthony Iliopoulos Date: Sun Apr 19 16:48:50 2020 -0700 nvmet: add ns revalidation support Add support for detecting capacity changes on nvmet blockdev and file backed namespaces. This allows for emulating and testing online resizing of nvme devices and filesystems on top. Signed-off-by: Anthony Iliopoulos [chaitanya: Fix comments posted on V1] Signed-off-by: Chaitanya Kulkarni [hch: reuse code a bit more] Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 31fdad7be18992606078caed6ff71741fa76310a Author: Keith Busch Date: Thu Apr 9 09:09:08 2020 -0700 nvme: consolodate io settings The stream parameters indicating optimal io settings were just getting overwritten later. Rearrange the settings so the streams parameters can be preserved if provided. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit bc1af009a8ed99aac86ee44a711c4a406ed74263 Author: Keith Busch Date: Thu Apr 9 09:09:07 2020 -0700 nvme: revalidate namespace stream parameters The stream parameters are based on the currently formatted logical block size. Recheck these parameters on namespace revalidation so the registered constraints will be accurate. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 38adf94e166e3cb4eb89683458ca578051e8218d Author: Keith Busch Date: Thu Apr 9 09:09:06 2020 -0700 nvme: consolidate chunk_sectors settings Move the quirked chunk_sectors setting to the same location as noiob so one place registers this setting. And since the noiob value is only used locally, remove the member from struct nvme_ns. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b2b2de7c5a0127882848f9c5e9379e84d2e02041 Author: Keith Busch Date: Thu Apr 9 09:09:05 2020 -0700 nvme: revalidate after verifying identifiers If the namespace identifiers have changed, skip updating the disk information, as that will register parameters from a mismatched namespace. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b2ce4d90690bd29ce5b554e203cd03682dd59697 Author: Keith Busch Date: Thu Apr 9 09:09:04 2020 -0700 nvme-multipath: set bdi capabilities once The queues' backing device info capabilities don't change with each namespace revalidation. Set it only when each path's request_queue is initially added to a multipath queue. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0c284db7f23571f6428c44ca714f13a1fc5f70df Author: Keith Busch Date: Thu Apr 9 09:09:02 2020 -0700 nvme: check namespace head shared property Reject a new shared namespace if a duplicate unshared namespace exists. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 9ad1927a3bc2735996ccc74e31b68a41ae9a3d33 Author: Keith Busch Date: Thu Apr 9 09:09:01 2020 -0700 nvme: always search for namespace head Even if a namespace reports it is not capable of sharing, search the subsystem for a matching namespace head. If found, the driver should reject that namespace since it's coming from an invalid configuration. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit ac262508daa88fb12c5dc53cf30bde163f9f26c9 Author: Keith Busch Date: Thu Apr 9 09:09:00 2020 -0700 nvme: release namespace head reference on error If a namespace identification does not match the subsystem's head for that NSID, release the reference that was taken when the matching head was initially found. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit d567572906d986dedb78b37f111c44eba033f3ef Author: Keith Busch Date: Thu Apr 9 09:08:59 2020 -0700 nvme: unlink head after removing last namespace The driver had been unlinking the namespace head from the subsystem's list only after the last reference was released, and outside of the list's subsys->lock protection. There is no reason to track an empty head, so unlink the entry from the subsystem's list when the last namespace using that head is removed and with the mutex lock protecting the list update. The next namespace to attach reusing the previous NSID will allocate a new head rather than find the old head with mismatched identifiers. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit aec459b484b8356d6abe862428787d98ffb1cbde Author: Christoph Hellwig Date: Sat Apr 4 10:34:21 2020 +0200 nvme: remove the magic 1024 constant in nvme_scan_ns_list Replace it with a value derived from the identify data and nsid sizes. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit 4005f28d25cbd3d4f85529a31e46a0b78e293082 Author: Christoph Hellwig Date: Sat Apr 4 10:31:35 2020 +0200 nvme: avoid an Identify Controller command for each namespace scan The namespace lists are 0-terminated, so we don't really need the NN value execept for the legacy sequential scan. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Jens Axboe commit 4450ba3bbb47d5fe852b730ab6773d2c18cfbfd6 Author: Christoph Hellwig Date: Sat Apr 4 10:30:32 2020 +0200 nvme: factor out a nvme_ns_remove_by_nsid helper Factor out a piece of deeply indented and logicaly separate code from nvme_scan_ns_list into a new helper. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit 25dcaa9292afc0689749099a5ba56fdb264eda7a Author: Christoph Hellwig Date: Sat Apr 4 10:16:03 2020 +0200 nvme: clean up nvme_scan_work Move the check for the supported CNS value into nvme_scan_ns_list, and limit the life time of the identify controller allocation. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit b9a5c3d4c34d8bd9fd75f7f28d18a57cb68da237 Author: Christoph Hellwig Date: Sat Apr 4 10:11:28 2020 +0200 nvme: refine the Qemu Identify CNS quirk Add a helper to check if we can use Identify CNS values > 1, and refine the Qemu quirk to not apply to reported versions larger than 1.1, as the Qemu implementation had been fixed by then. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit e4fcc72c1a420bdbe425530dd19724214ceb44ec Author: James Smart Date: Mon Apr 6 16:55:34 2020 -0700 nvmet-fc: slight cleanup for kbuild test warnings The kbuild tst robot flagged the following 3 issues: Case 1) >> drivers/nvme/target/fc.c:1201:37: warning: Either the condition >> '!assoc' is redundant or there is possible null pointer dereference: >> assoc. [nullPointerRedundantCheck] >> struct nvmet_fc_tgtport *tgtport = assoc->tgtport; ^ >> drivers/nvme/target/fc.c:1853:7: note: Assuming that condition '!assoc' >> is not redundant >> if (!assoc) ^ >> drivers/nvme/target/fc.c:1850:37: note: Assignment >> 'assoc=nvmet_fc_find_target_assoc(tgtport,be64_to_cpu( >> rqst->associd.association_id))', assigned value is 0 >> assoc = nvmet_fc_find_target_assoc(tgtport, ^ >> drivers/nvme/target/fc.c:1896:31: note: Calling function >> 'nvmet_fc_delete_target_assoc', 1st argument 'assoc' value is 0 >> nvmet_fc_delete_target_assoc(assoc); ^ The tool isn't smart enough to see that line 1854 sets a ret value which thereafter causes the routine to exit. This occurs before any of the assoc references, so it is not an issue. There are 2 more reportings of this same failure. To quiet the tool - rework the if test that does the exit to also reference assoc. No change in logic otherwise. Case 2) drivers/nvme/target/fc.c:1202:29: warning: The scope of the variable 'queue' can be reduced. [variableScope] struct nvmet_fc_tgt_queue *queue; ^ The tool is requesting the variable be declared within the code block that utilizes it. Ignoring this report as existing code style is fine. Case 3) drivers/nvme/target/fc.c:1137:16: warning: Variable 'needrandom' is assigned a value that is never used. [unreadVariable] needrandom = true; ^ Another parsing issue with the tool. Given that parens were not used with the list_for_each_entry() check, it inadvertantly thinks the break exited the outer while loop not the inner for loop. This is not an error. But, added parens to the inner list_for_each_entry() to quiet the tool and as it is better coding style. -- james Signed-off-by: James Smart Reported-by: kbuild test robot CC: kbuild test robot CC: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b0012dd397155438c61b0c1b52ceec1f1366b3cc Author: Max Gurtovoy Date: Wed Apr 19 11:56:57 2017 +0300 nvmet-rdma: use SRQ per completion vector In order to save resource allocation and utilize the completion locality in a better way (compared to SRQ per device that exist today), allocate Shared Receive Queues (SRQs) per completion vector. Associate each created QP/CQ with an appropriate SRQ according to the queue index. This association will reduce the lock contention in the fast path (compared to SRQ per device solution) and increase the locality in memory buffers. Add new module parameter for SRQ size to adjust it according to the expected load. User should make sure the size is >= 256 to avoid lack of resources. Also reduce the debug level of "last WQE reached" event that is raised when a QP is using SRQ during destruction process to relief the log. Signed-off-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 03f8cebc127fa285874074ec314b76b1333f6c43 Author: Keith Busch Date: Fri Apr 3 09:24:09 2020 -0700 nvme: remove unused parameter nvme_alloc_ns_head() doesn't use the 'struct nvme_id_ns' parameter. Remove it, and update caller accordingly. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 71fb90eb71d76089115aedf942533bcb3fd5c7f9 Author: Keith Busch Date: Fri Apr 3 09:24:01 2020 -0700 nvme: provide num dword helper Various nvme commands use a zeroes based number of dwords field. Create a helper function to convert byte lengths to this format. Signed-off-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 54840bed372c7779f23ece8514853fa83887b02e Author: James Smart Date: Tue Mar 31 09:50:11 2020 -0700 lpfc: nvmet: Add Send LS Request and Abort LS Request support Now that common helpers exist, add the ability to Send an NVME LS Request and to Abort an outstanding LS Request to the nvmet side of the driver. Signed-off-by: Paul Ely Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 4c2805aab519a39e8adf281afcef40174d48fd3f Author: James Smart Date: Tue Mar 31 09:50:10 2020 -0700 lpfc: nvmet: Add support for NVME LS request hosthandle As the nvmet layer does not have the concept of a remoteport object, which can be used to identify the entity on the other end of the fabric that is to receive an LS, the hosthandle was introduced. The driver passes the hosthandle, a value representative of the remote port, with a ls request receive. The LS request will create the association. The transport will remember the hosthandle for the association, and if there is a need to initiate a LS request to the remote port for the association, the hosthandle will be used. When the driver loses connectivity with the remote port, it needs to notify the transport that the hosthandle is no longer valid, allowing the transport to terminate associations related to the hosthandle. This patch adds support to the driver for the hosthandle. The driver will use the ndlp pointer of the remote port for the hosthandle in calls to nvmet_fc_rcv_ls_req(). The discovery engine is updated to invalidate the hosthandle whenever connectivity with the remote port is lost. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 9aa09e98b288649544c74d1a7b88223f36e4bffd Author: James Smart Date: Tue Mar 31 09:50:09 2020 -0700 lpfc: nvme: Add Receive LS Request and Send LS Response support to nvme Now that common helpers exist, add the ability to receive NVME LS requests to the driver. New requests will be delivered to the transport by nvme_fc_rcv_ls_req(). In order to complete the LS, add support for Send LS Response and send LS response completion handling to the driver. Signed-off-by: Paul Ely Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit fe1bedec5b9ce741fd6d4ebd6ede56e2c429467b Author: James Smart Date: Tue Mar 31 09:50:08 2020 -0700 lpfc: Refactor Send LS Response support Currently, the ability to send an NVME LS response is limited to the nvmet (controller/target) side of the driver. In preparation of both the nvme and nvmet sides supporting Send LS Response, rework the existing send ls_rsp and ls_rsp completion routines such that there is common code that can be used by both sides. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit e96a22b0b7c252295180c12128af380282e3b8c5 Author: James Smart Date: Tue Mar 31 09:50:07 2020 -0700 lpfc: Refactor Send LS Abort support Send LS Abort support is needed when Send LS Request is supported. Currently, the ability to abort an NVME LS request is limited to the nvme (host) side of the driver. In preparation of both the nvme and nvmet sides supporting Send LS Abort, rework the existing ls_req abort routines such that there is common code that can be used by both sides. While refactoring it was seen the logic in the abort routine was incorrect. It attempted to abort all NVME LS's on the indicated port. As such, the routine was reworked to abort only the NVME LS request that was specified. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6514b25d3fba0610cd6c42aa36e34937bed0e4d8 Author: James Smart Date: Tue Mar 31 09:50:06 2020 -0700 lpfc: Refactor Send LS Request support Currently, the ability to send an NVME LS request is limited to the nvme (host) side of the driver. In preparation of both the nvme and nvmet sides support Send LS Request, rework the existing send ls_req and ls_req completion routines such that there is common code that can be used by both sides. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3a8070c567aaaa6038b52113ce01527992604c40 Author: James Smart Date: Tue Mar 31 09:50:05 2020 -0700 lpfc: Refactor NVME LS receive handling In preparation for supporting both intiator mode and target mode receiving NVME LS's, commonize the existing NVME LS request receive handling found in the base driver and in the nvmet side. Using the original lpfc_nvmet_unsol_ls_event() and lpfc_nvme_unsol_ls_buffer() routines as a templates, commonize the reception of an NVME LS request. The common routine will validate the LS request, that it was received from a logged-in node, and allocate a lpfc_async_xchg_ctx that is used to manage the LS request. The role of the port is then inspected to determine which handler is to receive the LS - nvme or nvmet. As such, the nvmet handler is tied back in. A handler is created in nvme and is stubbed out. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7b7f551b0403e0f740c6af2553b46ba2d3531c80 Author: James Smart Date: Tue Mar 31 09:50:04 2020 -0700 lpfc: Commonize lpfc_async_xchg_ctx state and flag definitions The last step of commonization is to remove the 'T' suffix from state and flag field definitions. This is minor, but removes the mental association that it solely applies to nvmet use. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7cacae2ad04762803ad93bdf08dc482106817ec7 Author: James Smart Date: Tue Mar 31 09:50:03 2020 -0700 lpfc: Refactor nvmet_rcv_ctx to create lpfc_async_xchg_ctx To support FC-NVME-2 support (actually FC-NVME (rev 1) with Ammendment 1), both the nvme (host) and nvmet (controller/target) sides will need to be able to receive LS requests. Currently, this support is in the nvmet side only. To prepare for both sides supporting LS receive, rename lpfc_nvmet_rcv_ctx to lpfc_async_xchg_ctx and commonize the definition. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 2a1160a03ac477b95d596bc4a0955ee3d7d0f3c9 Author: James Smart Date: Tue Mar 31 09:50:02 2020 -0700 lpfc: Refactor lpfc nvme headers A lot of files in lpfc include nvme headers, building up relationships that require a file to change for its headers when there is no other change necessary. It would be better to localize the nvme headers. There is also no need for separate nvme (initiator) and nvmet (tgt) header files. Refactor the inclusion of nvme headers so that all nvme items are included by lpfc_nvme.h Merge lpfc_nvmet.h into lpfc_nvme.h so that there is a single header used by both the nvme and nvmet sides. This prepares for structure sharing between the two roles. Prep to add shared function prototypes for upcoming shared routines. Signed-off-by: Paul Ely Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 437c0b824dbd05dbdab772ed1e0f69ffec76119d Author: James Smart Date: Tue Mar 31 09:50:01 2020 -0700 nvme-fcloop: add target to host LS request support Add support for performing LS requests from target to host. Include sending request from targetport, reception into host, host sending ls rsp. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit ea39765843faf5f4426ffda000b0ca02217a1eeb Author: James Smart Date: Tue Mar 31 09:50:00 2020 -0700 nvme-fcloop: refactor to enable target to host LS Currently nvmefc-loop only sends LS's from host to target. Slightly rework data structures and routine names to reflect this path. Allows a straight-forward conversion to be used by ls's from target to host. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 47bf3241064498878ffed10a69131be9154201eb Author: James Smart Date: Tue Mar 31 09:49:59 2020 -0700 nvmet-fc: Add Disconnect Association Xmt support As part of FC-NVME-2 (and ammendment on FC-NVME), the target is to send a Disconnect LS after an association is terminated and any exchanges for the association have been ABTS'd. The target is also not to send the receipt to any Disconnect Association LS, received to initiate the association termination or received while the association is terminating, until the Disconnect LS has been transmit. Add support for sending Disconnect Association LS after all I/O's complete (which is after ABTS'd certainly). Utilizes the new LLDD api to send ls requests. There is no need to track the Disconnect LS response or to retry after timeout. All spec requirements will have been met by waiting for i/o completion to initiate the transmission. Add support for tracking the reception of Disconnect Association and defering the response transmission until after the Disconnect Association LS has been transmit. Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 349c694ee71ce0dfe4b9ccfac76ef5c1efb476cf Author: James Smart Date: Tue Mar 31 09:49:58 2020 -0700 nvmet-fc: rename ls_list to ls_rcv_list In preparation to add ls request support, rename the current ls_list, which is RCV LS request only, to ls_rcv_list. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 58ab8ff9dca2142ba16ea02f7db9ba06eebbc37c Author: James Smart Date: Tue Mar 31 09:49:57 2020 -0700 nvmet-fc: track hostport handle for associations In preparation for sending LS requests for an association that terminates, save and track the hosthandle that is part of the LS's that are received to create associations. Support consists of: - Create a hostport structure that will be 1:1 mapped to a host port handle. The hostport structure is specific to a targetport. - Whenever an association is created, create a host port for the hosthandle the Create Association LS was received from. There will be only 1 hostport structure created, with all associations that have the same hosthandle sharing the hostport structure. - When the association is terminated, the hostport reference will be removed. After the last association for the host port is removed, the hostport will be deleted. - Add support for the new nvmet_fc_invalidate_host() interface. In the past, the LLDD didn't notify loss of connectivity to host ports - the LLD would simply reject new requests and wait for the kato timeout to kill the association. Now, when host port connectivity is lost, the LLDD can notify the transport. The transport will initiate the termination of all associations for that host port. When the last association has been terminated and the hosthandle will no longer be referenced, the new host_release callback will be made to the lldd. - For compatibility with prior behavior which didn't report the hosthandle: the LLDD must set hosthandle to NULL. In these cases, not LS request will be made, and no host_release callbacks will be made either. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0dfb992e0ec2e7b9e5ccf92d2261aaa6b5cc57a8 Author: James Smart Date: Tue Mar 31 09:49:56 2020 -0700 nvmet-fc: perform small cleanups on unneeded checks While code reviewing saw a couple of items that can be cleaned up: - In nvmet_fc_delete_target_queue(), the routine unlocks, then checks and relocks. Reorganize to avoid the unlock/relock. - In nvmet_fc_delete_target_queue(), there's a check on the disconnect state that is unnecessary as the routine validates the state before starting any action. Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit a5c2b4f633cf06df62d24b0ef11f824e8da646a5 Author: James Smart Date: Tue Mar 31 09:49:55 2020 -0700 nvmet-fc: add LS failure messages Add LS reception failure messages Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 14fd1e98afafc0027a6a86ea1962e31dceafb400 Author: James Smart Date: Tue Mar 31 09:49:54 2020 -0700 nvme-fc: Add Disconnect Association Rcv support The nvme-fc host transport did not support the reception of a FC-NVME LS. Reception is necessary to implement full compliance with FC-NVME-2. Populate the LS receive handler, and specifically the handling of a Disconnect Association LS. The response to the LS, if it matched a controller, must be sent after the aborts for any I/O on any connection have been sent. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit ec3b0e3cc393dee1ad3f4bd1026f2c1f8b1c1ffb Author: James Smart Date: Tue Mar 31 09:49:53 2020 -0700 nvmet-fc: Update target for common definitions for LS handling Given that both host and target now generate and receive LS's create a single table definition for LS names. Each tranport half will have a local version of the table. Convert the target side transport to use the new common Create Association LS validation routine. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit fd5a5f2213048b012bc7e19e832e9ae0ec1a2c4a Author: James Smart Date: Tue Mar 31 09:49:52 2020 -0700 nvme-fc: Update header and host for common definitions for LS handling Given that both host and target now generate and receive LS's create a single table definition for LS names. Each tranport half will have a local version of the table. As Create Association LS is issued by both sides, and received by both sides, create common routines to format the LS and to validate the LS. Convert the host side transport to use the new common Create Association LS formatting routine. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit eb4ee8f125157926cf36a3c275b04825f1bf8cfa Author: James Smart Date: Tue Mar 31 09:49:51 2020 -0700 nvme-fc: convert assoc_active flag to bit op Convert the assoc_active boolean flag to a bitop on the flags field. The bit ops will provide atomicity. To make this change, the flags field was converted to a long type, which also affects the FCCTRL_TERMIO flag. Both FCCTRL_TERMIO and now ASSOC_ACTIVE flags are set/cleared by bit operations. Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit f56bf76f79f3dc15f17433dda1b567d34f18e699 Author: James Smart Date: Tue Mar 31 09:49:50 2020 -0700 nvme-fc: Ensure private pointers are NULL if no data Ensure that when allocations are done, and the lldd options indicate no private data is needed, that private pointers will be set to NULL (catches driver error that forgot to set private data size). Slightly reorg the allocations so that private data follows allocations for LS request/response buffers. Ensures better alignments for the buffers as well as the private pointer. Signed-off-by: James Smart Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3b8281b02bdc6fc7bed6f20af6fd7933a86b94e2 Author: James Smart Date: Tue Mar 31 09:49:49 2020 -0700 nvmet-fc: Better size LS buffers Current code uses NVME_FC_MAX_LS_BUFFER_SIZE (2KB) when allocating buffers for LS requests and responses. This is considerable overkill for what is actually defined. Rework code to have unions for all possible requests and responses and size based on the unions. Remove NVME_FC_MAX_LS_BUFFER_SIZE. Signed-off-by: James Smart Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit ca19bcd086331ec2fa182ad8cd589014beb931be Author: James Smart Date: Tue Mar 31 09:49:48 2020 -0700 nvme-fc nvmet-fc: refactor for common LS definitions Routines in the target will want to be used in the host as well. Error definitions should now shared as both sides will process requests and responses to requests. Moved common declarations to new fc.h header kept in the host subdirectory. Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 72e6329f86c714785ac195d293cb19dd24507880 Author: James Smart Date: Tue Mar 31 09:49:47 2020 -0700 nvme-fc and nvmet-fc: revise LLDD api for LS reception and LS request The current LLDD api has: nvme-fc: contains api for transport to do LS requests (and aborts of them). However, there is no interface for reception of LS's and sending responses for them. nvmet-fc: contains api for transport to do reception of LS's and sending of responses for them. However, there is no interface for doing LS requests. Revise the api's so that both nvme-fc and nvmet-fc can send LS's, as well as receiving LS's and sending their responses. Change name of the rcv_ls_req struct to better reflect generic use as a context to used to send an ls rsp. Specifically: nvmefc_tgt_ls_req -> nvmefc_ls_rsp nvmefc_tgt_ls_req.nvmet_fc_private -> nvmefc_ls_rsp.nvme_fc_private Change nvmet_fc_rcv_ls_req() calling sequence to provide handle that can be used by transport in later LS request sequences for an association. nvme-fc nvmet_fc nvme_fcloop: Revise to adapt to changed names in api header. Change calling sequence to nvmet_fc_rcv_ls_req() for hosthandle. Add stubs for new interfaces: host/fc.c: nvme_fc_rcv_ls_req() target/fc.c: nvmet_fc_invalidate_host() lpfc: Revise to adapt code to changed names in api header. Change calling sequence to nvmet_fc_rcv_ls_req() for hosthandle. Signed-off-by: James Smart Reviewed-by: Sagi Grimberg Reviewed-by: Himanshu Madhani Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 615399896ca3787728c56c499c99be79e40ac125 Author: James Smart Date: Tue Mar 31 09:49:46 2020 -0700 nvme-fc: Sync header to FC-NVME-2 rev 1.08 A couple of minor changes occurred between 1.06 and 1.08: - Addition of NVME_SR_RSP opcode - change of SR_RSP status code 1 to Reserved Signed-off-by: James Smart Reviewed-by: Sagi Grimberg Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit af00423a3dbc60b71698ed0cf4b55e1ea38fc6c7 Author: Christoph Hellwig Date: Fri May 8 10:18:28 2020 +0200 hfs: stop using ioctl_by_bdev Instead just call the CDROM layer functionality directly. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 1cd925d583857ee3ead6cfbf1e4b1cd067d28591 Author: Christoph Hellwig Date: Mon May 4 14:48:01 2020 +0200 bdi: remove the name field in struct backing_dev_info The name is only printed for a not registered bdi in writeback. Use the device name there as is more useful anyway for the unlike case that the warning triggers. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit aef33c2ff8aa5e24f3f7d93806aa84ca1c2b6832 Author: Christoph Hellwig Date: Mon May 4 14:48:00 2020 +0200 bdi: simplify bdi_alloc Merge the _node vs normal version and drop the superflous gfp_t argument. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit 3c5d202b55d3fa9106607f99cdd5044b02b5929b Author: Christoph Hellwig Date: Mon May 4 14:47:59 2020 +0200 bdi: remove bdi_register_owner Split out a new bdi_set_owner helper to set the owner, and move the policy for creating the bdi name back into genhd.c, where it belongs. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit a5a6c66df6bf951007f434fad04d777289f00aa6 Author: Christoph Hellwig Date: Mon May 4 14:47:58 2020 +0200 bdi: unexport bdi_register_va bdi_register_va is only used by super.c, which can't be modular. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit 4c74746625dedb62ce00ac86ac4faedb640536d0 Author: Christoph Hellwig Date: Mon May 4 14:47:57 2020 +0200 driver core: remove device_create_vargs All external users of device_create_vargs are gone, so remove it and open code it in the only caller. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Signed-off-by: Jens Axboe commit 79fab5287922900725df1394034de2e04b058907 Author: Weiping Zhang Date: Thu May 7 21:04:42 2020 +0800 block: rename blk_mq_alloc_rq_maps rename blk_mq_alloc_rq_maps to blk_mq_alloc_map_and_requests, this function allocs both map and request, make function name align with funtion. Signed-off-by: Weiping Zhang Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 03b63b029dcb394c00736c4ce1a8d07e13e458da Author: Weiping Zhang Date: Thu May 7 21:04:22 2020 +0800 block: rename __blk_mq_alloc_rq_map rename __blk_mq_alloc_rq_map to __blk_mq_alloc_map_and_request, actually it alloc both map and request, make function name align with function. Signed-off-by: Weiping Zhang Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit fd689871bbfbb41cd77379d3e9e5f4def0f7d6c6 Author: Ming Lei Date: Thu May 7 21:04:08 2020 +0800 block: alloc map and request for new hardware queue Alloc new map and request for new hardware queue when increse hardware queue count. Before this patch, it will show a warning for each new hardware queue, but it's not enough, these hctx have no maps and reqeust, when a bio was mapped to these hardware queue, it will trigger kernel panic when get request from these hctx. Test environment: * A NVMe disk supports 128 io queues * 96 cpus in system A corner case can always trigger this panic, there are 96 io queues allocated for HCTX_TYPE_DEFAULT type, the corresponding kernel log: nvme nvme0: 96/0/0 default/read/poll queues. Now we set nvme write queues to 96, then nvme will alloc others(32) queues for read, but blk_mq_update_nr_hw_queues does not alloc map and request for these new added io queues. So when process read nvme disk, it will trigger kernel panic when get request from these hardware context. Reproduce script: nr=$(expr `cat /sys/block/nvme0n1/device/queue_count` - 1) echo $nr > /sys/module/nvme/parameters/write_queues echo 1 > /sys/block/nvme0n1/device/reset_controller dd if=/dev/nvme0n1 of=/dev/null bs=4K count=1 [ 8040.805626] ------------[ cut here ]------------ [ 8040.805627] WARNING: CPU: 82 PID: 12921 at block/blk-mq.c:2578 blk_mq_map_swqueue+0x2b6/0x2c0 [ 8040.805627] Modules linked in: nvme nvme_core nf_conntrack_netlink xt_addrtype br_netfilter overlay xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nft_counter nf_nat_tftp nf_conntrack_tftp nft_masq nf_tables_set nft_fib_inet nft_f ib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack tun bridge nf_defrag_ipv6 nf_defrag_ipv4 stp llc ip6_tables ip_tables nft_compat rfkill ip_set nf_tables nfne tlink sunrpc intel_rapl_msr intel_rapl_common skx_edac nfit libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass ipmi_ssif crct10dif_pclmul crc32_pclmul iTCO_wdt iTCO_vendor_support ghash_clmulni_intel intel_ cstate intel_uncore raid0 joydev intel_rapl_perf ipmi_si pcspkr mei_me ioatdma sg ipmi_devintf mei i2c_i801 dca lpc_ich ipmi_msghandler acpi_power_meter acpi_pad xfs libcrc32c sd_mod ast i2c_algo_bit drm_vram_helper drm_ttm_helper ttm d rm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops [ 8040.805637] ahci drm i40e libahci crc32c_intel libata t10_pi wmi dm_mirror dm_region_hash dm_log dm_mod [last unloaded: nvme_core] [ 8040.805640] CPU: 82 PID: 12921 Comm: kworker/u194:2 Kdump: loaded Tainted: G W 5.6.0-rc5.78317c+ #2 [ 8040.805640] Hardware name: Inspur SA5212M5/YZMB-00882-104, BIOS 4.0.9 08/27/2019 [ 8040.805641] Workqueue: nvme-reset-wq nvme_reset_work [nvme] [ 8040.805642] RIP: 0010:blk_mq_map_swqueue+0x2b6/0x2c0 [ 8040.805643] Code: 00 00 00 00 00 41 83 c5 01 44 39 6d 50 77 b8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 48 8b bb 98 00 00 00 89 d6 e8 8c 81 03 00 eb 83 <0f> 0b e9 52 ff ff ff 0f 1f 00 0f 1f 44 00 00 41 57 48 89 f1 41 56 [ 8040.805643] RSP: 0018:ffffba590d2e7d48 EFLAGS: 00010246 [ 8040.805643] RAX: 0000000000000000 RBX: ffff9f013e1ba800 RCX: 000000000000003d [ 8040.805644] RDX: ffff9f00ffff6000 RSI: 0000000000000003 RDI: ffff9ed200246d90 [ 8040.805644] RBP: ffff9f00f6a79860 R08: 0000000000000000 R09: 000000000000003d [ 8040.805645] R10: 0000000000000001 R11: ffff9f0138c3d000 R12: ffff9f00fb3a9008 [ 8040.805645] R13: 000000000000007f R14: ffffffff96822660 R15: 000000000000005f [ 8040.805645] FS: 0000000000000000(0000) GS:ffff9f013fa80000(0000) knlGS:0000000000000000 [ 8040.805646] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8040.805646] CR2: 00007f7f397fa6f8 CR3: 0000003d8240a002 CR4: 00000000007606e0 [ 8040.805647] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8040.805647] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 8040.805647] PKRU: 55555554 [ 8040.805647] Call Trace: [ 8040.805649] blk_mq_update_nr_hw_queues+0x31b/0x390 [ 8040.805650] nvme_reset_work+0xb4b/0xeab [nvme] [ 8040.805651] process_one_work+0x1a7/0x370 [ 8040.805652] worker_thread+0x1c9/0x380 [ 8040.805653] ? max_active_store+0x80/0x80 [ 8040.805655] kthread+0x112/0x130 [ 8040.805656] ? __kthread_parkme+0x70/0x70 [ 8040.805657] ret_from_fork+0x35/0x40 [ 8040.805658] ---[ end trace b5f13b1e73ccb5d3 ]--- [ 8229.365135] BUG: kernel NULL pointer dereference, address: 0000000000000004 [ 8229.365165] #PF: supervisor read access in kernel mode [ 8229.365178] #PF: error_code(0x0000) - not-present page [ 8229.365191] PGD 0 P4D 0 [ 8229.365201] Oops: 0000 [#1] SMP PTI [ 8229.365212] CPU: 77 PID: 13024 Comm: dd Kdump: loaded Tainted: G W 5.6.0-rc5.78317c+ #2 [ 8229.365232] Hardware name: Inspur SA5212M5/YZMB-00882-104, BIOS 4.0.9 08/27/2019 [ 8229.365253] RIP: 0010:blk_mq_get_tag+0x227/0x250 [ 8229.365265] Code: 44 24 04 44 01 e0 48 8b 74 24 38 65 48 33 34 25 28 00 00 00 75 33 48 83 c4 40 5b 5d 41 5c 41 5d 41 5e c3 48 8d 68 10 4c 89 ef <44> 8b 60 04 48 89 ee e8 dd f9 ff ff 83 f8 ff 75 c8 e9 67 fe ff ff [ 8229.365304] RSP: 0018:ffffba590e977970 EFLAGS: 00010246 [ 8229.365317] RAX: 0000000000000000 RBX: ffff9f00f6a79860 RCX: ffffba590e977998 [ 8229.365333] RDX: 0000000000000000 RSI: ffff9f012039b140 RDI: ffffba590e977a38 [ 8229.365349] RBP: 0000000000000010 R08: ffffda58ff94e190 R09: ffffda58ff94e198 [ 8229.365365] R10: 0000000000000011 R11: ffff9f00f6a79860 R12: 0000000000000000 [ 8229.365381] R13: ffffba590e977a38 R14: ffff9f012039b140 R15: 0000000000000001 [ 8229.365397] FS: 00007f481c230580(0000) GS:ffff9f013f940000(0000) knlGS:0000000000000000 [ 8229.365415] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8229.365428] CR2: 0000000000000004 CR3: 0000005f35e26004 CR4: 00000000007606e0 [ 8229.365444] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8229.365460] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 8229.365476] PKRU: 55555554 [ 8229.365484] Call Trace: [ 8229.365498] ? finish_wait+0x80/0x80 [ 8229.365512] blk_mq_get_request+0xcb/0x3f0 [ 8229.365525] blk_mq_make_request+0x143/0x5d0 [ 8229.365538] generic_make_request+0xcf/0x310 [ 8229.365553] ? scan_shadow_nodes+0x30/0x30 [ 8229.365564] submit_bio+0x3c/0x150 [ 8229.365576] mpage_readpages+0x163/0x1a0 [ 8229.365588] ? blkdev_direct_IO+0x490/0x490 [ 8229.365601] read_pages+0x6b/0x190 [ 8229.365612] __do_page_cache_readahead+0x1c1/0x1e0 [ 8229.365626] ondemand_readahead+0x182/0x2f0 [ 8229.365639] generic_file_buffered_read+0x590/0xab0 [ 8229.365655] new_sync_read+0x12a/0x1c0 [ 8229.365666] vfs_read+0x8a/0x140 [ 8229.365676] ksys_read+0x59/0xd0 [ 8229.365688] do_syscall_64+0x55/0x1d0 [ 8229.365700] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Ming Lei Signed-off-by: Weiping Zhang Tested-by: Weiping Zhang Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit a2584e43f5672e2715c0c5ca28ccff3b9f381581 Author: Weiping Zhang Date: Thu May 7 21:03:56 2020 +0800 block: save previous hardware queue count before udpate blk_mq_realloc_tag_set_tags will update set->nr_hw_queues, so save old set->nr_hw_queues before call this function. Signed-off-by: Weiping Zhang Reviewed-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 2e194422f1eb4cdf5d6697bcfe0bbaf3059bbb5e Author: Weiping Zhang Date: Thu May 7 21:03:39 2020 +0800 block: free both rq_map and request Allocation: __blk_mq_alloc_rq_map blk_mq_alloc_rq_map blk_mq_alloc_rq_map tags = blk_mq_init_tags : kzalloc_node: tags->rqs = kcalloc_node tags->static_rqs = kcalloc_node blk_mq_alloc_rqs p = alloc_pages_node tags->static_rqs[i] = p + offset; Free: blk_mq_free_rq_map kfree(tags->rqs); kfree(tags->static_rqs); blk_mq_free_tags kfree(tags); The page allocated in blk_mq_alloc_rqs cannot be released, so we should use blk_mq_free_map_and_requests here. blk_mq_free_map_and_requests blk_mq_free_rqs __free_pages : cleanup for blk_mq_alloc_rqs blk_mq_free_rq_map : cleanup for blk_mq_alloc_rq_map Signed-off-by: Weiping Zhang Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 873f1c8df7e0dac2156a722f3c7848a30693a242 Merge: 8b075e5ba459 59c7c3caaaf8 Author: Jens Axboe Date: Sat May 9 16:13:58 2020 -0600 Merge branch 'block-5.7' into for-5.8/block Pull in block-5.7 fixes for 5.8. Mostly to resolve a conflict with the blk-iocost changes, but we also need the base of the bdi use-after-free as well as we build on top of it. * block-5.7: nvme: fix possible hang when ns scanning fails during error recovery nvme-pci: fix "slimmer CQ head update" bdi: add a ->dev_name field to struct backing_dev_info bdi: use bdi_dev_name() to get device name bdi: move bdi_dev_name out of line vboxsf: don't use the source name in the bdi name iocost: protect iocg->abs_vdebt with iocg->waitq.lock block: remove the bd_openers checks in blk_drop_partitions nvme: prevent double free in nvme_alloc_ns() error handling null_blk: Cleanup zoned device initialization null_blk: Fix zoned command handling block: remove unused header blk-iocost: Fix error on iocost_ioc_vrate_adj bdev: Reduce time holding bd_mutex in sync in blkdev_close() buffer: remove useless comment and WB_REASON_FREE_MORE_MEM, reason. Signed-off-by: Jens Axboe commit 0f58daaacca9fdc078eadfcfaa19e467b264cb28 Author: Ahmad Fatoum Date: Sat May 9 14:27:23 2020 -0700 Input: edt-ft5x06 - prefer asynchronous probe Probing the device takes a while, because we sleep for 300 ms after a reset; allow asynchronous probing so this can happen in the background while other devices are being probed. Signed-off-by: Ahmad Fatoum Signed-off-by: Marco Felsch Link: https://lore.kernel.org/r/20200227112819.16754-5-m.felsch@pengutronix.de Signed-off-by: Dmitry Torokhov commit 21d1611a83f8aa3907ca653b5851dd01951d4da6 Author: Marco Felsch Date: Sat May 9 12:10:40 2020 -0700 Input: edt-ft5x06 - improve power management operations It is possible to bring the device into a deep sleep state. To exit this state the reset or wakeup pin must be toggeled as documented in [1]. Because of the poor documentation I used the several downstream kernels [2] and other applications notes [3] to indentify the related registers. Furthermore I added the support to disable the device completely which is obviously the most effective power-saving mechanism. This mechanism needs the reset pin to ensure the power-up/down sequence. We can't apply any of these power-saving mechanism if both pins are missing (not connected) or if it is a wakeup device. [1] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.pdf https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x06.pdf [2] https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/input/touchscreen/ft5x_ts.c https://github.com/Pablito2020/focaltech-touch-driver/blob/master/ft5336_driver.c [3] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x16_registers.pdf Signed-off-by: Marco Felsch Link: https://lore.kernel.org/r/20200227112819.16754-4-m.felsch@pengutronix.de Signed-off-by: Dmitry Torokhov commit f4ee52f3ad8c9210030a9fe48bbb74dbc7c9f90e Author: Marco Felsch Date: Sat May 9 12:05:36 2020 -0700 Input: edt-ft5x06 - move parameter restore into helper We need to restore the parameters if we switch between the factory/work mode and during the resume process if we switched off the power-supply. Therefore refactor edt_ft5x06_work_mode() and move the "restore the parameters" into a helper routine so we can reuse it later. Signed-off-by: Marco Felsch Link: https://lore.kernel.org/r/20200227112819.16754-3-m.felsch@pengutronix.de Signed-off-by: Dmitry Torokhov commit 255cdaf73412de13608fb776101402dca68bed2b Author: Marco Felsch Date: Sat May 9 14:34:35 2020 -0700 Input: edt-ft5x06 - fix get_default register write access Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726") offset-x and offset-y is supported. Devices using those offset parameters don't support the offset parameter so we need to add the NO_REGISTER check for edt_ft5x06_ts_get_defaults(). Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726") Signed-off-by: Marco Felsch Link: https://lore.kernel.org/r/20200227112819.16754-2-m.felsch@pengutronix.de Signed-off-by: Dmitry Torokhov commit 6e85bd73d50d674912618e3ed226b2f2a47a178a Author: Jason Yan Date: Wed May 6 14:17:45 2020 +0800 video: fbdev: pxa168fb: make pxa168fb_init_mode() return void No other functions use the return value of pxa168fb_init_mode() and the return value is always 0 now. Make it return void. This fixes the following coccicheck warning: drivers/video/fbdev/pxa168fb.c:565:5-8: Unneeded variable: "ret". Return "0" on line 597 Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg [fixed indent] Link: https://patchwork.freedesktop.org/patch/msgid/20200506061745.19451-1-yanaijie@huawei.com commit 7429e92386b2176bc5474626456a70e4e4b676ea Author: Samuel Zou Date: Thu May 7 10:49:28 2020 +0800 drm/i2c/tda998x: Make tda998x_audio_digital_mute static Fix the following sparse warning: drivers/gpu/drm/i2c/tda998x_drv.c:1136:5: warning: symbol 'tda998x_audio_digital_mute' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Samuel Zou Cc: Russell King Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1588819768-11818-1-git-send-email-zou_wei@huawei.com commit 0d5c56a220a0fdc1f56ed3898c5166ae5a7c7d50 Merge: 2c674bec76d3 28bff09518e9 Author: Jakub Kicinski Date: Sat May 9 13:39:26 2020 -0700 Merge tag 'mlx5-updates-2020-05-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2020-05-09 This series includes updates to mlx5 netdev driver and bonding updates to support getting the next active tx slave. 1) merge commit with mlx5-next that includes bonding updates from Maor Bonding: Add support to get xmit slave 2) Maxim makes some general code improvements to TX data path 3) Tariq makes some general code improvements to kTLS and mlx5 accel layer in preparation for mlx5 TLS RX. ==================== Signed-off-by: Jakub Kicinski commit 48834e6084f185776b0c567d6f9b8e0b099f4b19 Author: Douglas Anderson Date: Thu May 7 14:34:57 2020 -0700 drm/panel-simple: Support hpd-gpios for delaying prepare() People use panel-simple when they have panels that are builtin to their device. In these cases the HPD (Hot Plug Detect) signal isn't really used for hotplugging devices but instead is used for power sequencing. Panel timing diagrams (especially for eDP panels) usually have the HPD signal in them and it acts as an indicator that the panel is ready for us to talk to it. Sometimes the HPD signal is hooked up to a normal GPIO on a system. In this case we need to poll it in the correct place to know that the panel is ready for us. In some system designs the right place for this is panel-simple. When adding this support, we'll account for the case that there might be a circular dependency between panel-simple and the provider of the GPIO. The case this was designed for was for the "ti-sn65dsi86" bridge chip. If HPD is hooked up to one of the GPIOs provided by the bridge chip then in our probe function we'll always get back -EPROBE_DEFER. Let's handle this by allowing this GPIO to show up late if we saw -EPROBE_DEFER during probe. NOTE: since the gpio_get_optional() is used, if the "hpd-gpios" isn't there our variable will just be NULL and we won't do anything in prepare(). Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Reviewed-by: Linus Walleij Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200507143354.v5.3.I53fed5b501a31e7a7fa13268ebcdd6b77bd0cadd@changeid commit d2528306528d6cca4e1608642a8efec95d7b13dd Author: Douglas Anderson Date: Thu May 7 14:34:56 2020 -0700 dt-bindings: display: Add hpd-gpios to panel-common bindings In the cases where there is no connector in a system there's no great place to put "hpd-gpios". As per discussion [1] the best place to put it is in the panel. Add this to the device tree bindings. [1] https://lore.kernel.org/r/20200417180819.GE5861@pendragon.ideasonboard.com Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Reviewed-by: Linus Walleij Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200507143354.v5.2.I1976736b400a3b30e46efa47782248b86b3bc627@changeid commit 502fd722fe1ed0133d1108bff1d5911f46de6641 Author: Al Viro Date: Wed Feb 19 09:35:32 2020 -0500 btrfs_ioctl_send(): don't bother with access_ok() we do copy_from_user() on that range anyway Signed-off-by: Al Viro commit cfe40d02238e7dae6f476974b022bdd36ebb96e5 Author: Douglas Anderson Date: Fri May 8 15:59:02 2020 -0700 panel: simple: Add BOE NV133FHM-N62 All info I could find about this panel show that it behaves the same as the BOE NV133FHM-N61. However, it definitely appears to be a unique panel because reading the EDID shows "NV133FHM-N62". We'll add a string match for the new panel but until we find something unique about it we'll just point at the N61's structures. Signed-off-by: Douglas Anderson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200508155859.3.I525ebd471f5340a6a369af7bde06ef04174d2f41@changeid commit 574a38ca06e60d854247d78af0f475a431051dde Author: Douglas Anderson Date: Fri May 8 15:59:01 2020 -0700 dt-bindings: display: simple: Add BOE NV133FHM-N62 This panel appears to be the same or nearly the same as the BOE NV133FHM-N61, but since (in the very least) it identifies itself as a different model in the EDID we should add a new compatible string for it. Signed-off-by: Douglas Anderson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200508155859.2.I37c879ef4ec6d4028a3d45728bc3a58060bba175@changeid commit f06d3a7e6ebe4faf94cf0be1b25ae6df33620d88 Author: Al Viro Date: Tue Feb 18 23:05:39 2020 -0500 fat_dir_ioctl(): hadn't needed that access_ok() for more than a decade... address is passed only to put_user() and copy_to_user() Signed-off-by: Al Viro commit 9694d9c3b5a5bbebd8132b08503211f5752dc205 Author: Douglas Anderson Date: Fri May 8 15:59:00 2020 -0700 panel: simple: Fix size and bpp of BOE NV133FHM-N61 The BOE NV133FHM-N61 is documented in the original commit to be a 13.3" panel, but the size listed in our struct doesn't match. Specifically: math.sqrt(30.0 * 30.0 + 18.7 * 18.7) / 2.54 ==> 13.92 Searching around on the Internet shows that the size that was in the structure was the "Outline Size", not the "Display Area". Let's fix it. Also the Internet says that this panel supports 262K colors. That's 6bpp, not 8bpp. Fixes: b0c664cc80e8 ("panel: simple: Add BOE NV133FHM-N61") Signed-off-by: Douglas Anderson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200508155859.1.I4d29651c0837b4095fb4951253f44036a371732f@changeid commit 37d59a5148a2746555c02e10b9fb70038afd3ca7 Author: Al Viro Date: Thu Apr 23 13:52:23 2020 -0400 dlmfs_file_write(): get rid of pointless access_ok() address passed only to copy_from_user() Signed-off-by: Al Viro commit 2c674bec76d35b75c7c730f863424387c9e9633a Merge: 5eb2bcf247de b4de6c49e569 Author: Jakub Kicinski Date: Sat May 9 11:48:02 2020 -0700 Merge branch 'net-atlantic-driver-updates' Mark Starovoytov says: ==================== net: atlantic: driver updates This patch series contains several minor cleanups for the previously submitted series. We also add Marvell copyrights on newly touched files. v2: * accommodated review comments related to the last patch in series (MAC generation) v1: https://patchwork.ozlabs.org/cover/1285011/ ==================== Signed-off-by: Jakub Kicinski commit b4de6c49e569c7ca91bf0d4c25cdb6eeca9c9529 Author: Mark Starovoytov Date: Sat May 9 09:47:00 2020 +0300 net: atlantic: unify MAC generation This patch unifies invalid MAC address handling with other drivers. Basically we've switched to using standard APIs (is_valid_ether_addr / eth_hw_addr_random) where possible. It's worth noting that some of engineering Aquantia NICs might be provisioned with a partially zeroed out MAC, which is still invalid, but not caught by is_valid_ether_addr(), so we've added a special handling for this case. Also adding a warning in case of fallback to random MAC, because this shouldn't be needed on production NICs, they should all be provisioned with unique MAC. NB! Default systemd/udevd configuration is 'MACAddressPolicy=persistent'. This causes MAC address to be persisted across driver reloads and reboots. We had to change it to 'none' for verification purposes. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit 097d638cf4e19be208d26c6bbbca7f8da348294a Author: Mark Starovoytov Date: Sat May 9 09:46:59 2020 +0300 net: atlantic: remove check for boot code survivability before reset request This patch removes unnecessary check for boot code survivability before reset request. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit ad46bd5ec357ebb18c42398d8760bad4d611b53e Author: Mark Starovoytov Date: Sat May 9 09:46:58 2020 +0300 net: atlantic: remove hw_atl_b0_hw_rss_set call from A2 code No need to call hw_atl_b0_hw_rss_set from hw_atl2_hw_rss_set Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit c64d7b23f51161ceb6e92f8e5b8077e8e04ddbef Author: Mark Starovoytov Date: Sat May 9 09:46:57 2020 +0300 net: atlantic: remove TPO2 check from A0 code TPO2 was introduced in B0 only, no reason to check for it in A0 code. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit 843e1396f62ed7ff57feaea9ceb3374ad42f445f Author: Mark Starovoytov Date: Sat May 9 09:46:56 2020 +0300 net: atlantic: rename AQ_NIC_RATE_2GS to AQ_NIC_RATE_2G5 This patch changes the constant name to a more logical "2G5" (for 2.5G speeds). Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit 7bb377107c72a40ab7505341f8626c8eb79a0cb7 Author: Mark Starovoytov Date: Sat May 9 09:46:55 2020 +0300 net: atlantic: minor MACSec code cleanup This patch fixes a couple of minor merge issues found in macsec_api.c after corresponding patch series has been applied. These are not real bugs, so pushing to net-next. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit 38e86bfcf7f565639d89ce99ecf41a598f652cdc Author: Mark Starovoytov Date: Sat May 9 09:46:54 2020 +0300 net: atlantic: use __packed instead of the full expansion. This patches fixes the review comment made by Jakub Kicinski in the "net: atlantic: A2 support" patch series. Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh Signed-off-by: Jakub Kicinski commit 1ce4530cce233edd99d66a9fcdea20c86e8536c0 Author: Thomas Bogendoerfer Date: Mon Apr 20 14:37:24 2020 +0200 MIPS: Remove NEC MARKEINS/EMMA No (active) developer owns this hardware, so let's remove Linux support. Signed-off-by: Thomas Bogendoerfer commit 1b00767fd8e1b49685ee7237c3875b8aa998ae3b Author: Thomas Bogendoerfer Date: Mon Apr 20 14:30:35 2020 +0200 MIPS: Remove PMC MSP71xx platform No (active) developer owns this hardware, so let's remove Linux support. Signed-off-by: Thomas Bogendoerfer commit 10760dde9be317a1abb426b2db9d6a698086cac9 Author: Thomas Bogendoerfer Date: Mon Apr 20 14:22:29 2020 +0200 MIPS: Remove support for LASAT All LASAT has probably gone bad, so let's remove Linux support. Signed-off-by: Thomas Bogendoerfer commit 13c432b51449dcdcfa0350fb87250b1dbd1fbd12 Author: Eric W. Biederman Date: Thu Mar 19 17:16:12 2020 -0500 exec: Fix spelling of search_binary_handler in a comment Link: https://lkml.kernel.org/r/87h7wq6zc1.fsf_-_@x220.int.ebiederm.org Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit 7a60ef4803d5442804d75095627e81602ff23331 Author: Eric W. Biederman Date: Sun Mar 8 12:04:44 2020 -0500 exec: Move the comment from above de_thread to above unshare_sighand The comment describes work that now happens in unshare_sighand so move the comment where it makes sense. Link: https://lkml.kernel.org/r/87mu6i6zcs.fsf_-_@x220.int.ebiederm.org Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit b213c2dcbcbc138d111f150e13317ea50002cab5 Merge: 6a8b55ed4056 2388777a0a59 Author: Eric W. Biederman Date: Sat May 9 08:50:36 2020 -0500 exec: Promised cleanups after introducing exec_update_mutex In the patchset that introduced exec_update_mutex there were a few last minute discoveries and fixes that left the code in a state that can be very easily be improved. During the merge window we discussed the first three of these patches and I promised I would resend them. What the first patch does is it makes the the calls in the binfmts: flush_old_exec(); /* set the personality */ setup_new_exec(); install_exec_creds(); With no sleeps or anything in between. At the conclusion of this set of changes the the calls in the binfmts are: begin_new_exec(); /* set the personality */ setup_new_exec(); The intent is to make the code easier to follow and easier to change. Eric W. Biederman (7): binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf exec: Make unlocking exec_update_mutex explict exec: Rename the flag called_exec_mmap point_of_no_return exec: Merge install_exec_creds into setup_new_exec exec: In setup_new_exec cache current in the local variable me exec: Move most of setup_new_exec into flush_old_exec exec: Rename flush_old_exec begin_new_exec Documentation/trace/ftrace.rst | 2 +- arch/x86/ia32/ia32_aout.c | 4 +- fs/binfmt_aout.c | 3 +- fs/binfmt_elf.c | 3 +- fs/binfmt_elf_fdpic.c | 3 +- fs/binfmt_flat.c | 4 +- fs/exec.c | 162 ++++++++++++++++++++--------------------- include/linux/binfmts.h | 10 +-- kernel/events/core.c | 2 +- 9 files changed, 92 insertions(+), 101 deletions(-) Link: https://lkml.kernel.org/r/87h7wujhmz.fsf@x220.int.ebiederm.org Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit f1e79c7e183c8e35def44b07ff7ac221fa87bf04 Author: Gustavo A. R. Silva Date: Thu May 7 13:54:08 2020 -0500 drm/i915: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200507185408.GA14561@embeddedor commit 16dc224f1c0ff8d242ef41c40d4da0264d351daa Author: Chris Wilson Date: Sat May 9 11:50:21 2020 +0100 drm/i915: Replace the hardcoded I915_FENCE_TIMEOUT Expose the hardcoded timeout for unsignaled foreign fences as a Kconfig option, primarily to allow brave systems to disable the timeout and solely rely on correct signaling. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Acked-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20200509105021.12542-1-chris@chris-wilson.co.uk commit f2a8d52e0a4db968c346c4332630a71cba377567 Author: Christian Brauner Date: Tue May 5 16:04:30 2020 +0200 nsproxy: add struct nsset Add a simple struct nsset. It holds all necessary pieces to switch to a new set of namespaces without leaving a task in a half-switched state which we will make use of in the next patch. This patch switches the existing setns logic over without causing a change in setns() behavior. This brings setns() closer to how unshare() works(). The prepare_ns() function is responsible to prepare all necessary information. This has two reasons. First it minimizes dependencies between individual namespaces, i.e. all install handler can expect that all fields are properly initialized independent in what order they are called in. Second, this makes the code easier to maintain and easier to follow if it needs to be changed. The prepare_ns() helper will only be switched over to use a flags argument in the next patch. Here it will still use nstype as a simple integer argument which was argued would be clearer. I'm not particularly opinionated about this if it really helps or not. The struct nsset itself already contains the flags field since its name already indicates that it can contain information required by different namespaces. None of this should have functional consequences. Signed-off-by: Christian Brauner Reviewed-by: Serge Hallyn Cc: Eric W. Biederman Cc: Serge Hallyn Cc: Jann Horn Cc: Michael Kerrisk Cc: Aleksa Sarai Link: https://lore.kernel.org/r/20200505140432.181565-2-christian.brauner@ubuntu.com commit 6dd10c47e912390668658c852f173a27f3221092 Author: Hans de Goede Date: Thu May 7 12:49:17 2020 +0200 ACPI: hotplug: PCI: Use the new acpi_evaluate_reg() helper Use the new acpi_evaluate_reg() helper in the acpiphp_glue.c code. Acked-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 132565d8ec096a5a043f96092cfa4821d970d268 Author: Hans de Goede Date: Thu May 7 12:49:16 2020 +0200 ACPI: utils: Add acpi_evaluate_reg() helper With a recent fix to the pinctrl-cherryview driver we now have 2 drivers open-coding the parameter building / passing for calling _REG on an ACPI handle. Add a helper for this, so that these 2 drivers can be converted to this helper. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 8e22c2e4a62e877ad97fe5f078a3f2698b6c18d5 Author: Zheng Zengkai Date: Thu May 7 15:07:36 2020 +0800 ACPI: debug: Make two functions static Fix sparse warnings: drivers/acpi/acpi_dbg.c:748:12: warning: symbol 'acpi_aml_init' was not declared. Should it be static? drivers/acpi/acpi_dbg.c:774:13: warning: symbol 'acpi_aml_exit' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zheng Zengkai Signed-off-by: Rafael J. Wysocki commit 95722237cb2ae4f7b73471058cdb19e8f4057c93 Author: Hanjun Guo Date: Thu May 7 17:09:21 2020 +0800 ACPI: sleep: Put the FACS table after using it Put the FACS table after using it to release the table mapping. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit ead7ba136267b4c36af855ab6e237c998d83df05 Author: Hanjun Guo Date: Thu May 7 17:09:20 2020 +0800 ACPI: scan: Put SPCR and STAO table after using it The SPCR and STAO table needs to be released after using it. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit f900bf4951a2f52ce76b35455827221906090dfb Author: Hanjun Guo Date: Thu May 7 17:09:19 2020 +0800 ACPI: EC: Put the ACPI table after using it The embedded controller boot resources table needs to be released after using it. Signed-off-by: Hanjun Guo [ rjw: avoid adding a label in acpi_ec_ecdt_start() ] Signed-off-by: Rafael J. Wysocki commit 11c7bdffc7433090d3692bb99efcc580405ccac8 Author: Hanjun Guo Date: Thu May 7 17:09:18 2020 +0800 ACPI: APEI: Put the HEST table for error path hest_tab will be used after hest_init(), but we need to release it for error path. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit 43f595dcab30a654dc9fc643e017615e358c2c1b Author: Hanjun Guo Date: Thu May 7 17:09:17 2020 +0800 ACPI: APEI: Put the error record serialization table for error path The mapped error record serialization table needs to be released for error path of erst_init(). Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit 541156a38fd01d9c01b24065bd6f361b9911be12 Author: Hanjun Guo Date: Thu May 7 17:09:16 2020 +0800 ACPI: APEI: Put the error injection table for error path and module exit The mapped error injection table will be used after einj_init() for debugfs, but it should be released for module exit and error path of einj_init(). Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit 3d995f88adb106fc67efe3fd6f6dfc6b884824a9 Author: Hanjun Guo Date: Thu May 7 17:09:15 2020 +0800 ACPI: APEI: Put the boot error record table after parsing The mapped boot error record table is not used after bert_init(), release it. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit fe4e1a576ef472f32feffca208cc3409aafff244 Author: Hanjun Guo Date: Thu May 7 17:09:14 2020 +0800 ACPI: watchdog: Put the watchdog action table after parsing The mapped watchdog action table should be released after the successfully parsing, and the failure path in the driver initialization. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit f8690227dd892600183c2bd8fc6b6fecfef28940 Author: Hanjun Guo Date: Thu May 7 17:09:13 2020 +0800 ACPI: LPIT: Put the low power idle table after using it The mapped LPIT table is not used for runtime after init, put the ACPI table to release the table mapping. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit 2d2feb6813171c6a0071148239845ee251a7d164 Author: Bob Moore Date: Mon May 4 17:46:54 2020 -0700 ACPICA: Update version to 20200430 ACPICA commit c00a5cd99fa3fe6cd053a2a1a557e54b4fea26f7 Version 20200430. Link: https://github.com/acpica/acpica/commit/c00a5cd9 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki commit e3f7ae9ebb447ddac902bead7a7eef03af143174 Author: Erik Kaneda Date: Mon May 4 17:46:53 2020 -0700 ACPICA: Fix required parameters for _NIG and _NIH ACPICA commit 4b0e043386c7e698bea9e862f60a388647f56622 Previously, there was a mixup where _NIG required one parameter and _NIH required zero parameters. This changes swaps these parameter requirements. Now this change requires _NIH to be called with one parameter and _NIG requires zero. Link: https://github.com/acpica/acpica/commit/4b0e0433 Reported-by: Paul A Lohr Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 6bfe5344b2956d0bee116f1c640aef05e5cddd76 Author: Erik Kaneda Date: Mon May 4 17:46:52 2020 -0700 ACPICA: Dispatcher: add status checks ACPICA commit 3244c1eeba9f9fb9ccedb875f7923a3d85e0c6aa The status chekcs are used to to avoid NULL pointer dereference on field objects Link: https://github.com/acpica/acpica/commit/3244c1ee Reported-by: Kurt Kennett Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 034fdaa508038507d5a1781490bda61914861cb0 Author: Erik Kaneda Date: Mon May 4 17:46:51 2020 -0700 ACPICA: Disassembler: ignore AE_ALREADY_EXISTS status when parsing create operators ACPICA commit cd66d0a50fdc9cc4dcd998e08e7aa3c4154bea2d Disassembler is intended to emit existing ASL code as-is. Therefore, error messages emitted during disassembly should be ignored or handled in a way such that the disassembler can continue to parse the AML. This change ignores AE_ALREADY_EXISTS errors during the deferred Op parsing for create operators in order to complete parsing ASL termlists. Link: https://github.com/acpica/acpica/commit/cd66d0a5 Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 2c1779f5ad32fbd5f88aa6cb59d670ba6789d3b8 Author: Erik Kaneda Date: Mon May 4 17:46:50 2020 -0700 ACPICA: Move acpi_gbl_next_cmd_num definition to acglobal.h ACPICA commit 8296a24f33984c26a61103c590b049de3c9b61ff This commit cleans up the code by moving the global definition out of dbhistry.c to acglobal.h. Link: https://github.com/acpica/acpica/commit/8296a24f Reported-by: Hulk Robot Suggested-by: Jason Yan Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit f5308a82e8d51b2f9e44533e6d3bef5893af8bdd Author: Yue Haibing Date: Mon May 4 17:46:49 2020 -0700 ACPICA: Make acpi_protocol_lengths static ACPICA commit 0ebacf12b8ca66ce6d3fce4d349b3f2448da18cb A linux-based static analyzer (sparse) caught this as a warning. Making this variable static will result in better optimizations and ensure that this variable does not get used outside of this file. Signed-off-by: Yue Haibing [ek: commit message] Link: https://github.com/acpica/acpica/commit/0ebacf12 Signed-off-by: Erik Kaneda Signed-off-by: Yue Haibing Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 28bff09518e9ef942173e41e7521b93ea7be0cf0 Author: Tariq Toukan Date: Mon Dec 16 14:05:07 2019 +0200 net/mlx5e: Enhance ICOSQ WQE info fields The same WQE opcode might be used in different ICOSQ flows and WQE types. To have a better distinguishability, replace it with an enum that better indicates the WQE type and flow it is used for. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 6b74f60ef5a97ec3988a41e4bb745660029209a2 Author: Tariq Toukan Date: Mon Mar 30 15:42:02 2020 +0300 net/mlx5: Accel, Remove unnecessary header include The include of Ethernet driver header in core is not needed and actually wrong. Remove it. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 41a8e4ebb4727912c54504125e134723df8cf3cf Author: Tariq Toukan Date: Thu Mar 19 16:50:14 2020 +0200 net/mlx5e: Use struct assignment for WQE info updates Struct assignment looks more clean, and implies resetting the not assigned fields to zero, instead of holding values from older ring cycles. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 05dfd570826f1ae408e1a3faeddb753ff06fed14 Author: Tariq Toukan Date: Thu Apr 9 13:43:43 2020 +0300 net/mlx5e: Take TX WQE info structures out of general EN header Into the txrx header file. The mlx5e_sq_wqe_info structure describes WQE info for the ICOSQ, rename it to better reflect this. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit f713ce1de8970f52ebaec7aa516b125b5c75dad9 Author: Tariq Toukan Date: Thu Apr 9 12:53:31 2020 +0300 net/mlx5e: kTLS, Do not fill edge for the DUMP WQEs in TX flow Every single DUMP WQE resides in a single WQEBB. As the pi is calculated per each one separately, there is no real need for a contiguous room for them, allow them to populate different WQ fragments. This reduces WQ waste and improves its utilization. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit ab1e0ce99d3dabc57e5a383b3ffc60fb97aafe9e Author: Tariq Toukan Date: Thu Apr 9 14:02:04 2020 +0300 net/mlx5e: kTLS, Fill work queue edge separately in TX flow For the static and progress context params WQEs, do the edge filling separately. This improves the WQ utilization, code readability, and reduces the chance of future bugs. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 714c88a38bce3477392944d6c0d0bc724abaff09 Author: Maxim Mikityanskiy Date: Wed Jan 29 14:35:09 2020 +0200 net/mlx5e: Split TX acceleration offloads into two phases After previous modifications, the offloads are no longer called one by one, the pi is calculated and the wqe is cleared on between of TLS and IPSEC offloads, which doesn't quite fit mlx5e_accel_handle_tx's purpose. This patch splits mlx5e_accel_handle_tx into two functions that correspond to two logical phases of running offloads: 1. Before fetching a WQE. Here runs the code that can post WQEs on its own, before the main WQE is fetched. It's the main part of TLS offload. 2. After fetching a WQE. Here runs the code that updates the WQE's fields, but can't post other WQEs any more. It's a minor part of TLS offload that sets the tisn field in the cseg, and eseg-based offloads (currently IPSEC, and later patches will move GENEVE and checksum offloads there, too). It allows to make mlx5e_xmit take care of all actions needed to transmit a packet in the right order, improve the structure of the code and reduce unnecessary operations. The structure will be further improved in the following patches (all eseg-based offloads will be moved to a single place, and reserving space for the main WQE will happen between phase 1 and phase 2 of offloads to eliminate unneeded data movements). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 5546100038eeff96fd0361f9b820405c016f8578 Author: Maxim Mikityanskiy Date: Mon Dec 9 12:30:42 2019 +0200 net/mlx5e: Update UDP fields of the SKB for GSO first mlx5e_udp_gso_handle_tx_skb updates the length field in the UDP header in case of GSO. It doesn't interfere with other offloads, so do it first to simplify further restructuring of the code. This way we'll make all independent modifications to the SKB before starting to work with WQEs. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit 2eeb6e384102e1124d0a5633803dda0cdbcac471 Author: Maxim Mikityanskiy Date: Fri Dec 6 16:42:09 2019 +0200 net/mlx5e: Make TLS offload independent of wqe and pi TLS offload may write a 32-bit field (tisn) to the cseg of the WQE. To do that, it receives pi and wqe pointers. As TLS offload may also send additional WQEs, it has to update pi and wqe, and in many cases it even doesn't use pi calculated before and wqe zeroed before and does it itself. Also, mlx5e_sq_xmit has to copy the whole cseg if it goes to the mlx5e_fill_sq_frag_edge flow. This all is not efficient. It's more efficient to do the following: 1. Just return tisn from TLS offload and make the caller fill it in a more appropriate place. 2. Calculate pi and clear wqe after calling TLS offload. 3. If TLS offload has to send WQEs, calculate pi and clear wqe just before that. It's already done in all places anyway, so this commit allows to remove some redundant memsets and calls. Copying of cseg will be eliminated in one of the following commits, and all other stuff is done here. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 0bdb078c74854c48bffa323899f2e0c5ca924e72 Author: Maxim Mikityanskiy Date: Fri Dec 6 16:14:57 2019 +0200 net/mlx5e: Pass only eseg to IPSEC offload IPSEC offload needs to modify the eseg of the WQE that is being filled, but it receives a pointer to the whole WQE. To make the contract stricter, pass only the pointer to the eseg of that WQE. This commit is preparation for the following refactoring of offloads in the TX path and for the MPWQE support. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 3df711db05b545f3c9b610bee62d33f4e67f64b7 Author: Maxim Mikityanskiy Date: Thu Dec 5 18:11:16 2019 +0200 net/mlx5e: Return void from mlx5e_sq_xmit and mlx5i_sq_xmit mlx5e_sq_xmit and mlx5i_sq_xmit always return NETDEV_TX_OK. Drop the return value to simplify the code. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 7f8546f3f041d6b1cce270581517217867764077 Author: Maxim Mikityanskiy Date: Fri Jan 3 16:17:30 2020 +0200 net/mlx5e: Unify checks of TLS offloads Both INNOVA and ConnectX TLS offloads perform the same checks in the beginning. Unify them to reduce repeating code. Do WARN_ON_ONCE on netdev mismatch and finish with an error in both offloads, not only in the ConnectX one. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit f02bac9ad6415e40bf32bf84ce5832698ebe5d15 Author: Maxim Mikityanskiy Date: Thu Dec 5 18:07:25 2019 +0200 net/mlx5e: Return bool from TLS and IPSEC offloads TLS and IPSEC offloads currently return struct sk_buff *, but the value is either NULL or the same skb that was passed as a parameter. Return bool instead to provide stronger guarantees to the calling code (it won't need to support handling a different SKB that could be potentially returned before this change) and to simplify restructuring this code in the following commits. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 76cd622fe2c2b10c1f0a7311ca797feccacc329d Merge: 5eb2bcf247de c6bc6041b10f Author: Saeed Mahameed Date: Sat May 9 00:06:35 2020 -0700 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux This merge includes updates to bonding driver needed for the rdma stack, to avoid conflicts with the RDMA branch. Maor Gottlieb Says: ==================== Bonding: Add support to get xmit slave The following series adds support to get the LAG master xmit slave by introducing new .ndo - ndo_get_xmit_slave. Every LAG module can implement it and it first implemented in the bond driver. This is follow-up to the RFC discussion [1]. The main motivation for doing this is for drivers that offload part of the LAG functionality. For example, Mellanox Connect-X hardware implements RoCE LAG which selects the TX affinity when the resources are created and port is remapped when it goes down. The first part of this patchset introduces the new .ndo and add the support to the bonding module. The second part adds support to get the RoCE LAG xmit slave by building skb of the RoCE packet based on the AH attributes and call to the new .ndo. The third part change the mlx5 driver driver to set the QP's affinity port according to the slave which found by the .ndo. ==================== Signed-off-by: Saeed Mahameed commit 5eb2bcf247de02b92749fe6a6b342f6393ca3f86 Author: Colin Ian King Date: Fri May 8 23:58:10 2020 +0100 net: lio_core: remove redundant assignment to variable tx_done The variable tx_done is being assigned with a value that is never read as the function returns a few statements later. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Jakub Kicinski commit 6a9c9548ee204882d196fdbc95f689e1d0fd00aa Author: Colin Ian King Date: Fri May 8 23:33:21 2020 +0100 net/atheros: remove redundant assignment to variable size The variable size is being assigned with a value that is never read, the assignment is redundant and cab be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Jakub Kicinski commit d8f05e9891fd4e80863f09a17c6d594ac6870a33 Author: Colin Ian King Date: Fri May 8 23:40:26 2020 +0100 cnic: remove redundant assignment to variable ret The variable ret is being assigned with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Michael Chan Signed-off-by: Jakub Kicinski commit 4d2c99940825637d007da150ad03a6f4442de0f0 Author: Colin Ian King Date: Sat May 9 00:14:47 2020 +0100 net: tg3: tidy up loop, remove need to compute off with a multiply Currently the value for 'off' is computed using a multiplication and a couple of statements later off is being incremented by len and this value is never read. Clean up the code by removing the multiplication and just increment off by len on each iteration. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Jakub Kicinski commit 9dfff80280b63a37ca8db3d733d59a4e014d5051 Merge: b5c3babb188f ce740c5f6f7a Author: Jakub Kicinski Date: Fri May 8 22:42:31 2020 -0700 Merge branch 'r8169-sync-few-functionalities-with-vendor-driver' Heiner Kallweit says: ==================== r8169: sync few functionalities with vendor driver Add few helpers (with names copied from vendor drivers) to make clearer what the respective code is doing. In addition improve reset preparation for chips from RTL8168g. ==================== Signed-off-by: Jakub Kicinski commit ce740c5f6f7a2142ca7acee7799996c0beac2980 Author: Heiner Kallweit Date: Fri May 8 23:32:49 2020 +0200 r8169: improve reset handling for chips from RTL8168g Sync the reset preparation for chips from RTL8168g with the r8168 and r8125 vendor drivers. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit 6f9395c69e62e0ffefaaddf97f32d7690e00f791 Author: Heiner Kallweit Date: Fri May 8 23:31:46 2020 +0200 r8169: add helper rtl_wait_txrx_fifo_empty Add a helper for waiting for FIFO's to be empty, again the name is borrowed from the vendor driver. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit 9617886fa65d3264c5aac5f1305e8e5a6ca865f4 Author: Heiner Kallweit Date: Fri May 8 23:30:43 2020 +0200 r8169: add helper rtl_enable_rxdvgate Add a helper for setting RXDV_GATED_EN, the 2ms delay is copied from the vendor driver. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit e031ce80d9f9867ab7c27b9acaadd75c62d6007a Author: Heiner Kallweit Date: Fri May 8 23:30:02 2020 +0200 r8169: add helper r8168g_wait_ll_share_fifo_ready Create a helper for this waiting function, name of the helper is borrowed from the vendor driver. In addition don't return in the two hw_init functions if the first wait runs into a timeout, there's no benefit in doing so. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit b5c3babb188fd0ccd4d3dceaa83b225474b6aa70 Author: Nathan Chancellor Date: Fri May 8 12:41:33 2020 -0700 net: ipa: Remove ipa_endpoint_stop{,_rx_dma} again When building arm64 allyesconfig: drivers/net/ipa/ipa_endpoint.c: In function 'ipa_endpoint_stop_rx_dma': drivers/net/ipa/ipa_endpoint.c:1274:13: error: 'IPA_ENDPOINT_STOP_RX_SIZE' undeclared (first use in this function) drivers/net/ipa/ipa_endpoint.c:1274:13: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ipa/ipa_endpoint.c:1289:2: error: implicit declaration of function 'ipa_cmd_dma_task_32b_addr_add' [-Werror=implicit-function-declaration] drivers/net/ipa/ipa_endpoint.c:1291:45: error: 'ENDPOINT_STOP_DMA_TIMEOUT' undeclared (first use in this function) drivers/net/ipa/ipa_endpoint.c: In function 'ipa_endpoint_stop': drivers/net/ipa/ipa_endpoint.c:1309:16: error: 'IPA_ENDPOINT_STOP_RX_RETRIES' undeclared (first use in this function) These functions were removed in a series, merged in as commit 33395f4a5c1b ("Merge branch 'net-ipa-kill-endpoint-stop-workaround'"). Remove them again so that the build works properly. Fixes: 3793faad7b5b ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Signed-off-by: Nathan Chancellor Reviewed-by: Arnd Bergmann Signed-off-by: Jakub Kicinski commit d8882935fcae28bceb5f6f56f09cded8d36d85e6 Author: Eric Dumazet Date: Fri May 8 07:34:14 2020 -0700 ipv6: use DST_NOCOUNT in ip6_rt_pcpu_alloc() We currently have to adjust ipv6 route gc_thresh/max_size depending on number of cpus on a server, this makes very little sense. If the kernels sets /proc/sys/net/ipv6/route/gc_thresh to 1024 and /proc/sys/net/ipv6/route/max_size to 4096, then we better not track the percpu dst that our implementation uses. Only routes not added (directly or indirectly) by the admin should be tracked and limited. Signed-off-by: Eric Dumazet Cc: Martin KaFai Lau Cc: David Ahern Cc: Maciej Żenczykowski Acked-by: Wei Wang Signed-off-by: Jakub Kicinski commit b41d272eda6da5a0d6cad76c3ba18952b32f5ce9 Author: Samuel Zou Date: Fri May 8 20:00:55 2020 +0800 net: dsa: sja1105: remove set but not used variable 'prev_time' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/dsa/sja1105/sja1105_vl.c:468:6: warning: variable ‘prev_time’ set but not used [-Wunused-but-set-variable] u32 prev_time = 0; ^~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Samuel Zou Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit da384effb1609b1333d475e9d4b318913b3d194b Author: Wei Yongjun Date: Fri May 8 10:11:14 2020 +0000 net: dsa: vsc73xx: convert to devm_platform_ioremap_resource Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Wei Yongjun Signed-off-by: Jakub Kicinski commit 3712c1c2ef2a0cbca633d150e568deb8f63a6f29 Author: Yang Yingliang Date: Fri May 8 11:52:08 2020 +0800 ieee802154: 6lowpan: remove unnecessary comparison The type of dispatch is u8 which is always '<=' 0xff, so the dispatch <= 0xff is always true, we can remove this comparison. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Stefan Schmidt Signed-off-by: Jakub Kicinski commit cf86a086a18095e33e0637cb78cda1fcf5280852 Author: Eric Dumazet Date: Thu May 7 18:58:10 2020 -0700 net/dst: use a smaller percpu_counter batch for dst entries accounting percpu_counter_add() uses a default batch size which is quite big on platforms with 256 cpus. (2*256 -> 512) This means dst_entries_get_fast() can be off by +/- 2*(nr_cpus^2) (131072 on servers with 256 cpus) Reduce the batch size to something more reasonable, and add logic to ip6_dst_gc() to call dst_entries_get_slow() before calling the _very_ expensive fib6_run_gc() function. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 7d01bd745a8f52ff2883f661235139ab6e7d23e6 Author: Xiaoguang Wang Date: Fri May 8 21:19:30 2020 +0800 io_uring: remove obsolete 'state' parameter The "struct io_submit_state *state" parameter is not used, remove it. Signed-off-by: Xiaoguang Wang Signed-off-by: Jens Axboe commit 904fbcb115c85090484dfdffaf7f461d96fe8e53 Author: Jens Axboe Date: Fri May 8 21:27:24 2020 -0600 io_uring: remove 'fd is io_uring' from close path The attempt protecting us from closing the ring itself wasn't really complete, and we actually don't need it. The referencing of requests themselve, and the references they hold on the ring, ensures that the life time of the ring is sane. With the check removed, we can also remove the need to have the close operation fget() the file. Reported-by: Al Viro Signed-off-by: Jens Axboe commit 28df3d1539de5090f7916f6fff03891b67f366f4 Author: J. Bruce Fields Date: Fri Jul 28 16:35:15 2017 -0400 nfsd: clients don't need to break their own delegations We currently revoke read delegations on any write open or any operation that modifies file data or metadata (including rename, link, and unlink). But if the delegation in question is the only read delegation and is held by the client performing the operation, that's not really necessary. It's not always possible to prevent this in the NFSv4.0 case, because there's not always a way to determine which client an NFSv4.0 delegation came from. (In theory we could try to guess this from the transport layer, e.g., by assuming all traffic on a given TCP connection comes from the same client. But that's not really correct.) In the NFSv4.1 case the session layer always tells us the client. This patch should remove such self-conflicts in all cases where we can reliably determine the client from the compound. To do that we need to track "who" is performing a given (possibly lease-breaking) file operation. We're doing that by storing the information in the svc_rqst and using kthread_data() to map the current task back to a svc_rqst. Signed-off-by: J. Bruce Fields commit 52782c92ac85c4e393eb4a903a62e6c24afa633f Author: J. Bruce Fields Date: Wed May 6 12:09:34 2020 -0400 kthread: save thread function It's handy to keep the kthread_fn just as a unique cookie to identify classes of kthreads. E.g. if you can verify that a given task is running your thread_fn, then you may know what sort of type kthread_data points to. We'll use this in nfsd to pass some information into the vfs. Note it will need kthread_data() exported too. Original-patch-by: Tejun Heo Signed-off-by: J. Bruce Fields commit a776f560abcba90ee8959c4b7a7f6c9911ca2988 Author: Serge Semin Date: Fri May 8 02:38:44 2020 +0300 dt-bindings: power: reset: Convert syscon-reboot-mode to DT schema Modern device tree bindings are supposed to be created as YAML-files in accordance with dt-schema. This commit replaces SYSCON reboot-mode legacy bare text bindings with YAML file. As before the bindings file states that the corresponding dts node is supposed to be compatible "syscon-reboot-mode" device and necessarily have an offset property to determine which register from the regmap is supposed to keep the mode on reboot. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 1a45732926f33245b5cabd37f03cdbf4a1818a16 Author: ChenTao Date: Wed May 6 19:45:18 2020 +0800 power: supply: cw2015: Make some symbols static Fix the following warning: drivers/power/supply/cw2015_battery.c:96:5: warning: 'cw_update_profile' was not declared. Should it be static? drivers/power/supply/cw2015_battery.c:712:1: warning: 'cw_bat_pm_ops' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: ChenTao Acked-by: Tobias Schramm Tested-by: Tobias Schramm Signed-off-by: Sebastian Reichel commit cf5701bf749683cc85827fd68c0890838a2b7fd4 Author: Dan Carpenter Date: Wed May 6 13:11:16 2020 +0300 power: bq25890: unlock on error paths in bq25890_resume() We introduced some new locking here, but need to update the error paths so they unlock before returning. Fixes: 72d9cd9cdc18 ("power: bq25890: protect view of the chip's state") Signed-off-by: Dan Carpenter Reviewed-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 8086fbaf49345f988deec539ec8e182b02914401 Author: Stanislav Fomichev Date: Fri May 8 10:46:11 2020 -0700 bpf: Allow any port in bpf_bind helper We want to have a tighter control on what ports we bind to in the BPF_CGROUP_INET{4,6}_CONNECT hooks even if it means connect() becomes slightly more expensive. The expensive part comes from the fact that we now need to call inet_csk_get_port() that verifies that the port is not used and allocates an entry in the hash table for it. Since we can't rely on "snum || !bind_address_no_port" to prevent us from calling POST_BIND hook anymore, let's add another bind flag to indicate that the call site is BPF program. v5: * fix wrong AF_INET (should be AF_INET6) in the bpf program for v6 v3: * More bpf_bind documentation refinements (Martin KaFai Lau) * Add UDP tests as well (Martin KaFai Lau) * Don't start the thread, just do socket+bind+listen (Martin KaFai Lau) v2: * Update documentation (Andrey Ignatov) * Pass BIND_FORCE_ADDRESS_NO_PORT conditionally (Andrey Ignatov) Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Andrey Ignatov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200508174611.228805-5-sdf@google.com commit cb0721c7e200750907bb8ef59b12646a5cb2dadf Author: Stanislav Fomichev Date: Fri May 8 10:46:10 2020 -0700 net: Refactor arguments of inet{,6}_bind The intent is to add an additional bind parameter in the next commit. Instead of adding another argument, let's convert all existing flag arguments into an extendable bit field. No functional changes. Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Andrey Ignatov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200508174611.228805-4-sdf@google.com commit 488a23b89d175cc78f352417114f4f5a10470722 Author: Stanislav Fomichev Date: Fri May 8 10:46:09 2020 -0700 selftests/bpf: Move existing common networking parts into network_helpers 1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users. 2. Copy-paste spin_lock_thread into two tests that use it. Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Acked-by: Andrey Ignatov Link: https://lore.kernel.org/bpf/20200508174611.228805-3-sdf@google.com commit 33181bb8e8fe947e1f8020a4b103601a4cac94d9 Author: Stanislav Fomichev Date: Fri May 8 10:46:08 2020 -0700 selftests/bpf: Generalize helpers to control background listener Move the following routines that let us start a background listener thread and connect to a server by fd to the test_prog: * start_server - socket+bind+listen * connect_to_fd - connect to the server identified by fd These will be used in the next commit. Also, extend these helpers to support AF_INET6 and accept the family as an argument. v5: * drop pthread.h (Martin KaFai Lau) * add SO_SNDTIMEO (Martin KaFai Lau) v4: * export extra helper to start server without a thread (Martin KaFai Lau) * tcp_rtt is no longer starting background thread (Martin KaFai Lau) v2: * put helpers into network_helpers.c (Andrii Nakryiko) Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Andrey Ignatov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200508174611.228805-2-sdf@google.com commit 7740dda5b465b67df7cbe3c4c2b96c10e874b09f Merge: 32c8a94660e8 41fe32ecc7af Author: Linus Walleij Date: Sat May 9 00:37:04 2020 +0200 Merge tag 'sh-pfc-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: sh-pfc: Updates for v5.8 - Fix SWIO pins on RZ/A1L, - Add missing bindings to MAINTAINERS. commit 29f9f8e1fc93d7fd78d16c9b09fbc2b5c41d6959 Merge: 8d0910121b07 3831c051dfbf Author: Linus Walleij Date: Sat May 9 00:33:32 2020 +0200 Merge tag 'gpio-updates-for-v5.8-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel gpio updates for v5.8-rc1 - part1 - correct the IRQ type used in to_irq() in gpio-xgene-sb - add new item to the TODO list - support building gpio-pl061 as module - improve pull-up/down support on GPIO expanders in device-tree - several improvements in gpio-pca953x - emit a warning for too long GPIO line names - add MODULE_DEVICE_TABLE to gpio-tegra186 - add support for new variant to gpio-f7188x - lsgpio can now display bias flags commit 68f5fc4ea9ddf9f77720d568144219c4e6452cde Author: Kai-Heng Feng Date: Fri May 8 14:53:41 2020 +0800 PCI: Avoid Pericom USB controller OHCI/EHCI PME# defect Both Pericom OHCI and EHCI devices advertise PME# support from all power states: 06:00.0 USB controller [0c03]: Pericom Semiconductor PI7C9X442SL USB OHCI Controller [12d8:400e] (rev 01) (prog-if 10 [OHCI]) Subsystem: Pericom Semiconductor PI7C9X442SL USB OHCI Controller [12d8:400e] Capabilities: [80] Power Management version 3 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+) 06:00.2 USB controller [0c03]: Pericom Semiconductor PI7C9X442SL USB EHCI Controller [12d8:400f] (rev 01) (prog-if 20 [EHCI]) Subsystem: Pericom Semiconductor PI7C9X442SL USB EHCI Controller [12d8:400f] Capabilities: [80] Power Management version 3 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+) But testing shows that it's unreliable: there is a 20% chance PME# won't be asserted when a USB device is plugged. Remove PME support for both devices to make USB plugging work reliably. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205981 Link: https://lore.kernel.org/r/20200508065343.32751-2-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 62a7f3009a460001eb46984395280dd900bc4ef4 Author: Kai-Heng Feng Date: Fri May 8 14:53:40 2020 +0800 serial: 8250_pci: Move Pericom IDs to pci_ids.h Move the IDs to pci_ids.h so it can be used by next patch. Link: https://lore.kernel.org/r/20200508065343.32751-1-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng Signed-off-by: Bjorn Helgaas Acked-by: Greg Kroah-Hartman Cc: stable@vger.kernel.org commit fcae496153a3ce719082746a01c81dd581e7a239 Author: Chris Wilson Date: Fri May 8 10:29:27 2020 +0100 drm/i915: Prevent using semaphores to chain up to external fences The downside of using semaphores is that we lose metadata passing along the signaling chain. This is particularly nasty when we need to pass along a fatal error such as EFAULT or EDEADLK. For fatal errors we want to scrub the request before it is executed, which means that we cannot preload the request onto HW and have it wait upon a semaphore. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200508092933.738-3-chris@chris-wilson.co.uk commit 3136deb7ba223f7ce3117cdfcd918a6f48e2d221 Author: Lionel Landwerlin Date: Fri May 8 19:54:48 2020 +0100 drm/i915: Peel dma-fence-chains for await To allow faster engine to engine synchronization, peel the layer of dma-fence-chain to expose potential i915 fences so that the i915_request code can emit HW semaphore wait/signal operations in the ring which is faster than waking up the host to submit unblocked workloads after interrupt notification. This is similar to the peeling we do for e.g. dma_fence_array. Signed-off-by: Lionel Landwerlin Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200508185448.29709-1-chris@chris-wilson.co.uk commit b58615446632dc7f930e672f57356029530fb9e6 Author: Alex Deucher Date: Thu May 7 12:06:03 2020 -0400 drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO We only need to set DPM_FLAG_NEVER_SKIP for the legacy ATPX BOCO case. D3cold and BACO work as expected. Acked-by: Evan Quan Signed-off-by: Alex Deucher commit af27c649b64778f61522c60f75a06a6e9878d3e2 Author: Alex Deucher Date: Thu May 7 11:54:49 2020 -0400 drm/amdgpu: drop extra runtime pm handling in resume pmop The core handles this for us. Acked-by: Evan Quan Signed-off-by: Alex Deucher commit deff2b024aee308cd60f376b1d77750efee93184 Author: Alex Deucher Date: Thu May 7 10:04:04 2020 -0400 drm/amdgpu: fix runpm logic in amdgpu_pmops_resume We should be checking whether the driver enabled runtime pm rather than whether the asic supports BOCO or BACO. That said in general they are equivalent unless the user has disabled runpm or it has been disabled for a specific asic. Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit f0d69678083ff0478b752c15b017d00135f03cbc Author: Alex Deucher Date: Thu May 7 09:57:09 2020 -0400 drm/amdgpu: drop pm_runtime_set_active The pci core handles this for us in pci_pm_init. Acked-by: Evan Quan Signed-off-by: Alex Deucher commit 0da4a419a27a7b290b4923a7051fc6cfd92f2a0c Author: Alex Deucher Date: Fri May 8 14:33:09 2020 -0400 drm/amdgpu: implement soft_recovery for gfx10 Same as gfx9. This allows us to kill the waves for hung shaders. Acked-by: Evan Quan Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 77f3a5cd7023d946a7bbcbb4c88aa5d601d5eb9b Author: Nirmoy Das Date: Thu May 7 21:34:41 2020 +0200 drm/amdgpu: cleanup sysfs file handling Create sysfs file using attributes. Signed-off-by: Nirmoy Das Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 85625e64295079525e5f841b576f9ab71d2c6237 Author: Evan Quan Date: Thu May 7 18:17:55 2020 +0800 drm/amdgpu: enable hibernate support on Navi1X BACO is needed to support hibernate on Navi1X. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 890900fe77b1321078c6d2e038e4150f06c16698 Author: Hawking Zhang Date: Mon May 4 22:30:05 2020 +0800 drm/amdgpu: use node_id and node_size to calcualte dram_base_address physical_node_id * node_segment_size should be the dram_base_address for current gpu node in xgmi config Signed-off-by: Hawking Zhang Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 999a69e2758ff51911fbec039c633cacc909dee0 Author: Hawking Zhang Date: Mon May 4 21:03:44 2020 +0800 drm/amdgpu: switch to common rlc_autoload helper drop IP specific psp function for rlc autoload since the autoload_supported was introduced to mark ASICs that support rlc_autoload Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit c797c583e88018c41d0fa49ead76a342b92ff9c2 Author: Hawking Zhang Date: Mon May 4 20:53:34 2020 +0800 drm/amdgpu: drop unused ras ta helper function cure posion command was replaced by ras recovery solution and was not a formal command supported by ras ta anymore Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 001a0a95ed7a1f4bfd28ad9f7763c3e9cd3ae942 Author: Hawking Zhang Date: Mon May 4 20:50:32 2020 +0800 drm/amdgpu: switch to common ras ta helper TRIGGER_ERROR is common ras ta command for all the ASICs that support RAS feature. switch to common helper to avoid duplicate implementation per IP generation Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 35ccba4e9fc7619941ac1ad26d9f154bfa93db9d Author: Hawking Zhang Date: Mon May 4 19:39:24 2020 +0800 drm/amdgpu: switch to common xgmi ta helpers get_hive_id/get_node_id/get_topology_info/set_topology_info are common xgmi command supported by TA for all the ASICs that support xgmi link. They should be implemented as common helper functions to avoid duplicated code per IP generation Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit a1304cba816e017d5acde322ee1c751e368dbe5a Author: Arnd Bergmann Date: Thu May 7 23:33:51 2020 +0200 ASoC: cros_ec_codec: allocate shash_desc dynamically The wov_hotword_model_put() function has multiple large variables on its stack, the largest of which is the result of SHASH_DESC_ON_STACK(). In total, this exceeds the warning limit for 32-bit architectures: sound/soc/codecs/cros_ec_codec.c:776:12: error: stack frame size of 1152 bytes in function 'wov_hotword_model_put' [-Werror,-Wframe-larger-than=] The function already has a dynamic crypto_alloc_shash() allocation, so using kmalloc() for the descriptor is correct as well and does not introduce any additional failure scenarios. With this, the stack usage of wov_hotword_model_put() gets reduced to 480 bytes in my test configuration. Fixes: b6bc07d4360d ("ASoC: cros_ec_codec: support WoV") Signed-off-by: Arnd Bergmann Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200507213405.1869430-1-arnd@arndb.de Signed-off-by: Mark Brown commit c50ad6dbf6cc1d1671a3cd5618b3a52c495b78ca Merge: aab5fd7a1b7b 60ab7f4153b6 Author: Mark Brown Date: Fri May 8 18:20:51 2020 +0100 Merge tag 'linear-ranges-lib' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.8 lib: Add linear ranges helper library and start using it Series extracts a "linear ranges" helper out of the regulator framework. Linear ranges helper is intended to help converting real-world values to register values when conversion is linear. I suspect this is useful also for power subsystem and possibly for clk. commit 60ab7f4153b6af461c90d572c31104086b44639f Author: Matti Vaittinen Date: Fri May 8 18:43:36 2020 +0300 regulator: use linear_ranges helper Change the regulator helpers to use common linear_ranges code. Signed-off-by: Matti Vaittinen Reviewed-by: Mark Brown Acked-by: Charles Keepax Acked-by: Adam Thomson Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit de824cc9659e2a28acc3e36d99ab86df7564d582 Author: Matti Vaittinen Date: Fri May 8 18:41:49 2020 +0300 power: supply: bd70528: rename linear_range to avoid collision Follow-up patches in this series will add a generic struct linear_range. Rename bd70528 internal struct to avoid collision. Signed-off-by: Matti Vaittinen Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/286b1ae0adc1c08e7b644cbdc1a43eb2e0644647.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 33d599f0529990448e7bfb0d080269e029769fed Author: Matti Vaittinen Date: Fri May 8 18:40:43 2020 +0300 lib/test_linear_ranges: add a test for the 'linear_ranges' Add a KUnit test for the linear_ranges helper. Signed-off-by: Matti Vaittinen Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/311fea741bafdcd33804d3187c1642e24275e3e5.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit d2218d4e4a65f25bd2d38489567012c7db50233c Author: Matti Vaittinen Date: Fri May 8 18:39:35 2020 +0300 lib: add linear ranges helpers Many devices have control registers which control some measurable property. Often a register contains control field so that change in this field causes linear change in the controlled property. It is not a rare case that user wants to give 'meaningful' control values and driver needs to convert them to register field values. Even more often user wants to 'see' the currently set value - again in meaningful units - and driver needs to convert the values it reads from register to these meaningful units. Examples of this include: - regulators, voltage/current configurations - power, voltage/current configurations - clk(?) NCOs and maybe others I can't think of right now. Provide a linear_range helper which can do conversion from user value to register value 'selector'. The idea here is stolen from regulator framework and patches refactoring the regulator helpers to use this are following. Current implementation does not support inversely proportional ranges but it might be useful if we could support also inversely proportional ranges? Signed-off-by: Matti Vaittinen Reviewed-by: Mark Brown Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/59259bc475e0c800eb4bb163f02528c7c01f7b3a.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 7b0bf99b9ee497cc0f079472566aff716d033d43 Author: Zou Wei Date: Tue Apr 28 17:43:15 2020 +0800 cpupower: Remove unneeded semicolon Fixes coccicheck warnings: tools/power/cpupower/utils/cpupower-info.c:65:2-3: Unneeded semicolon tools/power/cpupower/utils/cpupower-set.c:75:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c:120:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:175:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:56:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:75:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c:82:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/nhm_idle.c:94:2-3: Unneeded semicolon tools/power/cpupower/utils/idle_monitor/snb_idle.c:80:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Shuah Khan commit 3d60548b216b5486a541a06c167df3dfb6df9c2e Author: Chen Zhou Date: Fri May 8 08:51:34 2020 -0700 xfs: remove duplicate headers Remove duplicate headers which are included twice. Signed-off-by: Chen Zhou Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 43dc0aa84ef74e3acd908b6d5eaa8ae15d7ecc8a Author: Brian Foster Date: Fri May 8 08:50:52 2020 -0700 xfs: fix unused variable warning in buffer completion on !DEBUG The random buffer write failure errortag patch introduced a local mount pointer variable for the test macro, but the macro is compiled out on !DEBUG kernels. This results in an unused variable warning. Access the mount structure through the buffer pointer and remove the local mount pointer to address the warning. Fixes: 7376d745473 ("xfs: random buffer write failure errortag") Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6ea670ade207232d7863933bc6a834defe8b0269 Author: Darrick J. Wong Date: Fri May 1 16:00:56 2020 -0700 xfs: remove unnecessary includes from xfs_log_recover.c Remove unnecessary includes from the log recovery code. Suggested-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit 17d29bf271ea48b253c93969a590a11a51c19c1f Author: Darrick J. Wong Date: Fri May 1 16:00:56 2020 -0700 xfs: move log recovery buffer cancellation code to xfs_buf_item_recover.c Move the helpers that handle incore buffer cancellation records to xfs_buf_item_recover.c since they're not directly related to the main log recovery machinery. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit cc560a5a9540be2d907c0c170e29ebde98d13d63 Author: Darrick J. Wong Date: Fri May 1 16:00:55 2020 -0700 xfs: hoist setting of XFS_LI_RECOVERED to caller The only purpose of XFS_LI_RECOVERED is to prevent log recovery from trying to replay recovered intents more than once. Therefore, we can move the bit setting up to the ->iop_recover caller. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 96b60f826713767f222254418c995fb6fd7596b3 Author: Darrick J. Wong Date: Fri May 1 16:00:55 2020 -0700 xfs: refactor intent item iop_recover calls Now that we've made the recovered item tests all the same, we can hoist the test and the ail locking code to the ->iop_recover caller and call the recovery function directly. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 889eb55dd68f97729adccb8c06834b35e8bd9590 Author: Darrick J. Wong Date: Fri May 1 16:00:55 2020 -0700 xfs: refactor intent item RECOVERED flag into the log item Rename XFS_{EFI,BUI,RUI,CUI}_RECOVERED to XFS_LI_RECOVERED so that we track recovery status in the log item, then get rid of the now unused flags fields in each of those log item types. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 86a37174138621a44c38621b69595e2cd67e5956 Author: Darrick J. Wong Date: Fri May 1 16:00:54 2020 -0700 xfs: refactor adding recovered intent items to the log During recovery, every intent that we recover from the log has to be added to the AIL. Replace the open-coded addition with a helper. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R commit 154c733a33d9cdaabec42ae76ca1189044d0447e Author: Darrick J. Wong Date: Fri May 1 16:00:54 2020 -0700 xfs: refactor releasing finished intents during log recovery Replace the open-coded AIL item walking with a proper helper when we're trying to release an intent item that has been finished. We add a new ->iop_match method to decide if an intent item matches a supplied ID. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit bba7b1644a25809c299684a325e766263ad15c62 Author: Darrick J. Wong Date: Wed May 6 12:07:25 2020 -0700 xfs: refactor xlog_item_is_intent now that we're done converting Now that we've finished converting all types of log intent items to provide an ->iop_recover function, we can convert the "is this an intent item?" predicate to look for a non-null iop_recover pointer. Move the predicate closer to the functions that use it. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 9329ba89cbb1f261decfedfd83e67d89d9d6c591 Author: Darrick J. Wong Date: Fri May 1 16:00:52 2020 -0700 xfs: refactor recovered BUI log item playback Move the code that processes the log items created from the recovered log items into the per-item source code files and use dispatch functions to call them. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit c57ed2f5a2ffa2e2009ffa638efd06c6e86e7ebd Author: Darrick J. Wong Date: Fri May 1 16:00:51 2020 -0700 xfs: refactor recovered CUI log item playback Move the code that processes the log items created from the recovered log items into the per-item source code files and use dispatch functions to call them. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit cba0ccac28a766968243cda597566983843f5be2 Author: Darrick J. Wong Date: Fri May 1 16:00:51 2020 -0700 xfs: refactor recovered RUI log item playback Move the code that processes the log items created from the recovered log items into the per-item source code files and use dispatch functions to call them. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 10d0c6e06fc87fe9e99d7c8df493f973b354fd9c Author: Darrick J. Wong Date: Fri May 1 16:00:50 2020 -0700 xfs: refactor recovered EFI log item playback Move the code that processes the log items created from the recovered log items into the per-item source code files and use dispatch functions to call them. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 2565a11b224b68a222838d09623c6a398c4d5f6c Author: Darrick J. Wong Date: Fri May 1 16:00:50 2020 -0700 xfs: remove log recovery quotaoff item dispatch for pass2 commit functions Quotaoff doesn't actually do anything, so take advantage of the commit_pass2 pointer being optional and get rid of the switch statement clause. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 3c6ba3cf90c7233359a190c5230a553d19fbc8ef Author: Darrick J. Wong Date: Fri May 1 16:00:50 2020 -0700 xfs: refactor log recovery BUI item dispatch for pass2 commit functions Move the bmap update intent and intent-done pass2 commit code into the per-item source code files and use dispatch functions to call them. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 9b4467e9834058df5be27a7a903be84921977170 Author: Darrick J. Wong Date: Fri May 1 16:00:49 2020 -0700 xfs: refactor log recovery CUI item dispatch for pass2 commit functions Move the refcount update intent and intent-done pass2 commit code into the per-item source code files and use dispatch functions to call them. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 07590a9d38b8587076c175550743daca9e067f09 Author: Darrick J. Wong Date: Fri May 1 16:00:49 2020 -0700 xfs: refactor log recovery RUI item dispatch for pass2 commit functions Move the rmap update intent and intent-done pass2 commit code into the per-item source code files and use dispatch functions to call them. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 9817aa80dcdc0358226f41322e1ff35339d0d24b Author: Darrick J. Wong Date: Fri May 1 16:00:48 2020 -0700 xfs: refactor log recovery EFI item dispatch for pass2 commit functions Move the extent free intent and intent-done pass2 commit code into the per-item source code files and use dispatch functions to call them. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 3ec6efa703cf65887e681d1f97d38a63261d907e Author: Darrick J. Wong Date: Fri May 1 16:00:48 2020 -0700 xfs: refactor log recovery icreate item dispatch for pass2 commit functions Move the log icreate item pass2 commit code into the per-item source code files and use the dispatch function to call it. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit fcbdf91e0c9ff099ca5b6ea4c69cb5223874cec7 Author: Darrick J. Wong Date: Fri May 1 16:00:47 2020 -0700 xfs: refactor log recovery dquot item dispatch for pass2 commit functions Move the log dquot item pass2 commit code into the per-item source code files and use the dispatch function to call it. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 658fa68b6f34f73c7e4023489accd34c1db91cb1 Author: Darrick J. Wong Date: Fri May 1 16:00:47 2020 -0700 xfs: refactor log recovery inode item dispatch for pass2 commit functions Move the log inode item pass2 commit code into the per-item source code files and use the dispatch function to call it. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 1094d3f12363474b2a3d1a6c06124bec25dd1555 Author: Darrick J. Wong Date: Fri May 1 16:00:47 2020 -0700 xfs: refactor log recovery buffer item dispatch for pass2 commit functions Move the log buffer item pass2 commit code into the per-item source code files and use the dispatch function to call it. We do these one at a time because there's a lot of code to move. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 3304a4fabd099820df99de1acac345dd6fe16d1d Author: Darrick J. Wong Date: Fri May 1 16:00:46 2020 -0700 xfs: refactor log recovery item dispatch for pass1 commit functions Move the pass1 commit code into the per-item source code files and use the dispatch function to call them. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 8ea5682d07115b422e923bb4f55fe081964f484a Author: Darrick J. Wong Date: Fri May 1 16:00:46 2020 -0700 xfs: refactor log recovery item dispatch for pass2 readhead functions Move the pass2 readhead code into the per-item source code files and use the dispatch function to call them. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 86ffa471d9ce6ac3fda66f704c3143c3d55181f5 Author: Darrick J. Wong Date: Fri May 1 16:00:45 2020 -0700 xfs: refactor log recovery item sorting into a generic dispatch structure Create a generic dispatch structure to delegate recovery of different log item types into various code modules. This will enable us to move code specific to a particular log item type out of xfs_log_recover.c and into the log item source. The first operation we virtualize is the log item sorting. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 35f4521fd3a001fb290a1780f8beeffb06d99a04 Author: Darrick J. Wong Date: Thu Apr 30 10:45:41 2020 -0700 xfs: convert xfs_log_recover_item_t to struct xfs_log_recover_item Remove the old typedefs. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig commit 4bff7214d263b5235263136cb53147a759b3f3ab Author: Bernard Zhao Date: Thu May 7 04:45:14 2020 -0700 memory: samsung: exynos5422-dmc: Fix tFAW timings alignment Aligning of tFAW timing with standard was using wrong argument as minimum acceptable value. This could lead to wrong timing if provided timings and clock period do not match the standard. Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") Cc: Signed-off-by: Bernard Zhao Reviewed-by: Lukasz Luba Signed-off-by: Krzysztof Kozlowski commit e41627db6f364f9e3157b15a7646f8dd35f75508 Author: Chris Wilson Date: Fri May 8 11:42:20 2020 +0100 drm/i915/gt: Improve precision on defer_request assert The kernel_context does not use initial-breadcrumbs, so when we ask if its requests have started we do so by comparing against the completion seqno of the previous request. This is very imprecise, not precise enough for the defer_request assertion. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1847 Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200508104220.9872-1-chris@chris-wilson.co.uk commit c1c633878662341eb0c502b3cab6e8c5cc83f44c Author: Chao Yu Date: Mon Mar 30 17:13:29 2020 +0800 f2fs: introduce f2fs_bmap_compress() to support bmap() on compressed inode: if queried block locates in non-compressed cluster, return its physical block address. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit bf38fbad12b365223f9c5d4057f741bb03372737 Author: Chao Yu Date: Sat Mar 28 17:40:40 2020 +0800 f2fs: support fiemap on compressed inode Map normal/compressed cluster of compressed inode correctly, and give the right fiemap flag FIEMAP_EXTENT_ENCODED on mapped compressed extent. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef Author: Chao Yu Date: Wed Mar 18 16:22:59 2020 +0800 f2fs: support partial truncation on compressed inode Supports to truncate compressed/normal cluster partially on compressed inode. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b5f4684b5f5fe6ea3c0d57acf5acdf8e8fbfe503 Author: Chao Yu Date: Sat Feb 29 18:49:06 2020 +0800 f2fs: remove redundant compress inode check due to f2fs_post_read_required() has did that. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3c57f75182452cc954f5e12374601b72574f4709 Author: Eric Biggers Date: Fri May 1 16:35:23 2020 -0700 f2fs: use strcmp() in parse_options() Remove the pointless string length checks. Just use strcmp(). Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d29fbcdb051fbe8e6aee87dd5a7df723f299494d Author: Nishad Kamdar Date: Sat Apr 25 18:49:08 2020 +0530 f2fs: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to F2FS File System support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 059c6d68cfc5f85ba3ab71d71a6de380016f7936 Merge: 4bd30106ddb2 19ce2321739d Author: Thomas Gleixner Date: Fri May 8 15:00:12 2020 +0200 Merge tag 'perf-core-for-mingo-5.8-20200506' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf updates from Arnaldo: perf/core improvements and fixes: perf record: - Introduce --switch-output-event to use arbitrary events to be setup and read from a side band thread and, when they take place a signal be sent to the main 'perf record' thread, reusing the --switch-output code to take perf.data snapshots from the --overwrite ring buffer, e.g.: # perf record --overwrite -e sched:* \ --switch-output-event syscalls:*connect* \ workload will take perf.data.YYYYMMDDHHMMSS snapshots up to around the connect syscalls. Stephane Eranian: - Add --num-synthesize-threads option to control degree of parallelism of the synthesize_mmap() code which is scanning /proc/PID/task/PID/maps and can be time consuming. This mimics pre-existing behaviour in 'perf top'. Intel PT: Adrian Hunter: - Add support for synthesizing branch stacks for regular events (cycles, instructions, etc) from Intel PT data. perf bench: Ian Rogers: - Add a multi-threaded synthesize benchmark. - Add kallsyms parsing benchmark. Tommi Rantala: - Fix div-by-zero if runtime is zero. perf synthetic events: - Remove use of sscanf from /proc reading when parsing pre-existing threads to generate synthetic PERF_RECORD_{FORK,MMAP,COMM,etc} events. tools api: - Add a lightweight buffered reading API. libsymbols: - Parse kallsyms using new lightweight buffered reading io API. perf parse-events: - Fix memory leaks found on parse_events. perf mem2node: - Avoid double free related to realloc(). perf stat: Jin Yao: - Zero all the 'ena' and 'run' array slot stats for interval mode. - Improve runtime stat for interval mode Kajol Jain: - Enable Hz/hz printing for --metric-only option - Enhance JSON/metric infrastructure to handle "?". perf tests: Kajol Jain: - Added test for runtime param in metric expression. Tommi Rantala: - Fix data path in the session topology test. perf vendor events power9: Kajol Jain: - Add hv_24x7 socket/chip level metric events Coresight: Leo Yan: - Move definition of 'traceid_list' global variable from header file. Mike Leach: - Update to build with latest opencsd version. perf pmu: Shaokun Zhang: - Fix function name in comment, its get_cpuid_str(), not get_cpustr() Stephane Eranian: - Add perf_pmu__find_by_type() helper perf script: Stephane Eranian: - Remove extraneous newline in perf_sample__fprintf_regs(). Ian Rogers: - Avoid NULL dereference on symbol. tools feature: Stephane Eranian: - Add support for detecting libpfm4. perf symbol: Thomas Richter: - Fix kernel symbol address display in TUI verbose mode. perf cgroup: Tommi Rantala: - Avoid needless closing of unopened fd libperf: He Zhe: - Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus. Ian Rogers: - Fix a refcount leak in evlist method. Arnaldo Carvalho de Melo: - Rename the code in tools/perf/util, i.e. perf tooling specific, that operates on 'struct evsel' to evsel__, leaving the perf_evsel__ namespace for the routines in tools/lib/perf/ that operate on 'struct perf_evsel__'. tools/perf specific libraries: Konstantin Khlebnikov: - Fix reading new topology attribute "core_cpus" - Simplify checking if SMT is active. perf flamegraph: Arnaldo Carvalho de Melo: - Use /bin/bash for report and record scripts, just like all other such scripts, fixing a package dependency bug in a Linaro OpenEmbedded build checker. perf evlist: Jagadeesh Pagadala: - Remove duplicate headers. Miscelaneous: Zou Wei: - Remove unneeded semicolon in libtraceevent, 'perf c2c' and others. - Fix warning assignment of 0/1 to bool variable in 'perf report' Signed-off-by: Arnaldo Carvalho de Melo commit 97a9474aeb789183a1d0712e66a4283860279ac9 Merge: 3b02a051d25d 50a19ad4b1ec Author: Thomas Gleixner Date: Fri May 8 14:58:28 2020 +0200 Merge branch 'kcsan-for-tip' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/kcsan Pull KCSAN updates from Paul McKenney. commit ac938052e571a84b40a17ed21d71b3d827cf0236 Author: Chris Wilson Date: Fri May 8 10:29:26 2020 +0100 drm/i915: Pull waiting on an external dma-fence into its routine As a means for a small code consolidation, but primarily to start thinking more carefully about internal-vs-external linkage, pull the pair of i915_sw_fence_await_dma_fence() calls into a common routine. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200508092933.738-2-chris@chris-wilson.co.uk commit 2045d666ae634f1676660acfb864bcba0e9f86ca Author: Chris Wilson Date: Fri May 8 10:29:25 2020 +0100 drm/i915: Ignore submit-fences on the same timeline While we ordinarily do not skip submit-fences due to the accompanying hook that we want to callback on execution, a submit-fence on the same timeline is meaningless. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200508092933.738-1-chris@chris-wilson.co.uk commit a70ff65601f1016cb164d2847e9f370e2ed22b39 Author: Dmitry Osipenko Date: Tue Mar 24 22:12:17 2020 +0300 i2c: tegra: Synchronize DMA before termination DMA transfer could be completed, but CPU (which handles DMA interrupt) may get too busy and can't handle the interrupt in a timely manner, despite of DMA IRQ being raised. In this case the DMA state needs to synchronized before terminating DMA transfer in order not to miss the DMA transfer completion. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 566c05f7cd9a5c6a257d19d4fb91ce35b3b27fb6 Author: Dmitry Osipenko Date: Tue Mar 24 22:12:16 2020 +0300 i2c: tegra: Better handle case where CPU0 is busy for a long time Boot CPU0 always handle I2C interrupt and under some rare circumstances (like running KASAN + NFS root) it may stuck in uninterruptible state for a significant time. In this case we will get timeout if I2C transfer is running on a sibling CPU, despite of IRQ being raised. In order to handle this rare condition, the IRQ status needs to be checked after completion timeout. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 26ca88aaea26cce966e4c9c4eaf2e0bb9a9f28ea Author: Thierry Reding Date: Wed May 6 20:47:25 2020 +0200 i2c: tegra: Keep IRQs enabled during suspend/resume One of the I2C controllers on Tegra SoCs is typically connected to a system PMIC, which provides controls for critical power supplies for most platforms. Some drivers, such as PCI, need to disable these regulators during a very late stage during suspend and resume them at a very early stage during resume. To support these use-cases, keep interrupts disabled during suspend/ resume. Suggested-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 44c99904cf61f945d02ac9976ab10dd5ccaea393 Author: Thierry Reding Date: Fri Dec 13 14:44:17 2019 +0100 i2c: tegra: Restore pinmux on system resume Depending on the board design, the I2C controllers found on Tegra SoCs may require pinmuxing in order to function. This is done as part of the driver's runtime suspend/resume operations. However, the PM core does not allow devices to go into runtime suspend during system sleep to avoid potential races with the suspend/resume of their parents. As a result of this, when Tegra SoCs resume from system suspend, their I2C controllers may have lost the pinmux state in hardware, whereas the pinctrl subsystem is not aware of this. To fix this, make sure that if the I2C controller is not runtime suspended, the runtime suspend code is still executed in order to disable the module clock (which we don't need to be enabled during sleep) and set the pinmux to the idle state. Conversely, make sure that the I2C controller is properly resumed when waking up from sleep so that pinmux settings are properly restored. This fixes a bug seen with DDC transactions to an HDMI monitor timing out when resuming from system suspend. Signed-off-by: Thierry Reding commit 2d6201ee1123325c089008570bd5ddea3c5b131a Author: Gustavo A. R. Silva Date: Thu May 7 14:22:28 2020 -0500 ASoC: soc-core: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507192228.GA16355@embeddedor Signed-off-by: Mark Brown commit 28d4adc4257cd2e119df17aa7e9d18cdf607f23d Author: YueHaibing Date: Thu May 7 15:27:35 2020 +0800 ASoC: SOF: Intel: Fix unused variable warning When CONFIG_SND_SOC_SOF_BAYTRAIL is not set, gcc warns: sound/soc/sof/intel/byt.c:85:41: warning: ‘cht_debugfs’ defined but not used [-Wunused-const-variable=] static const struct snd_sof_debugfs_map cht_debugfs[] = { ^~~~~~~~~~~ Move the variable inside #ifdef Reported-by: Hulk Robot Suggested-by: Joe Perches Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200507072735.16588-1-yuehaibing@huawei.com Signed-off-by: Mark Brown commit 50b6f619a099af6dfe06e958bfa08d46440ea788 Author: Mika Kahola Date: Wed May 6 15:08:27 2020 +0300 uapi/drm/drm_fourcc.h: Note on platform specificity for format modifiers Make an additional note on DRM format modifiers for x and y tiling. These format modifiers are defined for BDW+ platforms and therefore definition is not valid for older gens. This is due to address swizzling for tiled surfaces is no longer used. For newer platforms main memory controller has a more effective address swizzling algorithm. v2: Rephrase comment (Daniel) Signed-off-by: Mika Kahola Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200506120827.12250-1-mika.kahola@intel.com commit c4ad6ea9574bfa29ca00ddf6b6b1508ec344ff45 Author: Gustavo A. R. Silva Date: Thu May 7 14:00:52 2020 -0500 MIPS: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Thomas Bogendoerfer commit 68fbb9721ea76b2a3088b749e004456f2de05b9f Author: Tiezhu Yang Date: Fri May 8 16:36:05 2020 +0800 MIPS: Loongson: Add DMA support for LS7A In the current market, the most used bridge chip on the Loongson platform are RS780E and LS7A, the RS780E bridge chip is already supported by the mainline kernel. If use the default implementation of __phys_to_dma() and __dma_to_phys() in dma-direct.h when CONFIG_ARCH_HAS_PHYS_TO_DMA is not set, it works well used with LS7A on the Loongson single-way and multi-way platform, and also works well used with RS780E on the Loongson single-way platform, but the DMA address will be wrong on the non-node0 used with RS780E on the Loongson multi-way platform. Just as the description in the code comment, the devices get node id from 40 bit of HyperTransport bus, so we extract 2 bit node id (bit 44~45) from 48 bit address space of Loongson CPU and embed it into HyperTransport bus (bit 37-38), this operation can be done only at the software level used with RS780E on the Loongson multi-way platform, because it has no hardware function to translate address of node id, this is a hardware compatibility problem. Device | | DMA address | Host Bridge | | HT bus address (40 bit) | CPU | | physical address (48 bit) | RAM The LS7A has dma_node_id_offset field in the DMA route config register, the hardware can use the dma_node_id_offset to translate address of node id automatically, so we can get correct address when just use the dma_pfn_offset field in struct device. For the above reasons, in order to maintain downward compatibility to support the RS780E bridge chip, it is better to use the platform dependent implementation of __phys_to_dma() and __dma_to_phys(). Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit e701656ec4db60f560f7b790235fe94819837db3 Author: Huacai Chen Date: Fri May 8 17:30:12 2020 +0800 MIPS: inst.h: Stop including asm.h to avoid various build failures Commit d339cd02b888eb8 ("MIPS: Move unaligned load/store helpers to inst.h") causes a lot of build failures because macros in asm.h conflict with various subsystems. Some of these conflictions has been fixed (such as LONG, PANIC and PRINT) by adjusting asm.h, but some of them is nearly impossible to fix (such as PTR and END). The only reason of including asm.h in inst.h is that we need the PTR macro which is used by unaligned load/store helpers. So in this patch we define a new PTR_STR macro and use it to replace STR(PTR), then we can stop including asm.h to avoid various build failures. Fixes: d339cd02b888eb8 ("MIPS: Move unaligned load/store helpers to inst.h") Reported-by: kbuild test robot Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 374ad001f762e4e4c736c5e2455e9949555459ab Author: Gustavo A. R. Silva Date: Thu May 7 13:52:30 2020 -0500 fanotify: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/20200507185230.GA14229@embeddedor Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jan Kara commit 69efd5c4bd4c0e5e0d5388aa21d71d1313714a0e Author: Takashi Sakamoto Date: Fri May 8 13:36:35 2020 +0900 ALSA: firewire-lib: use sequence of syt offset and data block on pool in AMDTP domain In previous commit, the sequence of syt offset and the number of data blocks per packet is calculated for pool in AMDTP domain structure in advance of processing outgoing packets. This commit uses the sequence for outgoing packet processing to obsolete per-stream processing of the sequence. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-11-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 1a4be183b3fc9eca6ef0cca68b6698f4484f6b5f Author: Takashi Sakamoto Date: Fri May 8 13:36:34 2020 +0900 ALSA: firewire-lib: pool ideal sequence of syt offset and data block In current implementation, sequence of syt offset and the number of data blocks is generated when packets for outgoing stream are going to be queued. This commit generates and pools the sequence independently of the processing of outgoing packets for future extension. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-10-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 25babf297c570ecec28451a580987fa08b49fa92 Author: Takashi Sakamoto Date: Fri May 8 13:36:33 2020 +0900 ALSA: firewire-lib: add cache for packet sequence to AMDTP domain structure For future extension, storage is required to store packet sequence in incoming AMDTP stream to recover media clock for outgoing AMDTP stream. This commit adds the storage to AMDTP domain for this purpose. The packet sequence is represented by 'struct seq_desc' which has two members; syt_offset and the number of data blocks. The size of storage is decided according to the size of packet queue. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-9-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 274fc3558133d33311b22a962d0f362ddd281b51 Author: Takashi Sakamoto Date: Fri May 8 13:36:32 2020 +0900 ALSA: firewire-lib: code refactoring for data block calculation When calculating the number of data blocks per packet, some states are stored in AMDTP stream structure. This is inconvenient when reuse the calculation from non-stream structure. This commit applies refactoring to helper function for the calculation so that the function doesn't touch AMDTP stream structure. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-8-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 816d84826e89399858a1f086d78f5a4dd615a9ae Author: Takashi Sakamoto Date: Fri May 8 13:36:31 2020 +0900 ALSA: firewire-lib: code refactoring for syt offset calculation When calculating syt offset, some states are stored in AMDTP stream structure. This is inconvenient when reuse the calculation from non-stream structure. This commit applies refactoring to helper function for the calculation so that the function doesn't touch AMDTP stream structure. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 83cfb5c50f8e35d795d4260756fb62a2b77ae8df Author: Takashi Sakamoto Date: Fri May 8 13:36:30 2020 +0900 ALSA: firewire-lib: code refactoring for syt computation In current implementation for outgoing AMDTP packet, the value of syt field in CIP header is computed when calculating syt offset. For future extension, it's convenient to split the computation and calculation. This commit splits them. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit af86b0b1f4b04501fdd12571ffcaae5853ab8a10 Author: Takashi Sakamoto Date: Fri May 8 13:36:29 2020 +0900 ALSA: firewire-lib: code refactoring for parameters of packet queue and IRQ timing Although the parameter for packet queue and IRQ timing is calculated when AMDTP stream starts, the calculated parameters are the same between streams in AMDTP domain. This commit moves the calculation and decide the parameters when AMDTP domain starts. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-5-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 2472cfb3232caf8f68e4d93ae830c569b0bbc25b Author: Takashi Sakamoto Date: Fri May 8 13:36:28 2020 +0900 ALSA: firewire-lib: add reference to domain structure from stream structure In current implementation, AMDTP domain structure and AMDTP stream structure has one way of reference from the former to the latter. For future extension, bidirectional reference is needed. This commit adds a member into stream structure to refer to domain structure to which the stream belongs. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 10aa8e4acf51b12a2db4ee2baaed67f70fbee9c2 Author: Takashi Sakamoto Date: Fri May 8 13:36:27 2020 +0900 ALSA: firewire-lib: use macro for maximum value of second in 1394 OHCI isoc descriptor In descriptor of isochronous context in 1394 OHCI, the field of second has 3 bit, thus the maximum value is 8. The value is used for correct cycle calculation. This commit replaces hard-coded value with macro to obsolete magic number. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 8304cf77c92038cd1c50c27b69d30be695cc8003 Author: Takashi Sakamoto Date: Fri May 8 13:36:26 2020 +0900 ALSA: firewire-lib: fix invalid assignment to union data for directional parameter Although the value of FDF is used just for outgoing stream, the assignment to union member is done for both directions of stream. At present this causes no issue because the value of same position is reassigned later for opposite stream. However, it's better to add if statement. Fixes: d3d10a4a1b19 ("ALSA: firewire-lib: use union for directional parameters") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200508043635.349339-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 89ebe49aaa2f60a19db53b4c03fd25253ae7f4ec Author: Gustavo A. R. Silva Date: Thu May 7 13:52:45 2020 -0500 ALSA: fireworks: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Acked-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20200507185245.GA14270@embeddedor Signed-off-by: Takashi Iwai commit d6ddbd5c97d1b9156646ac5c42b8851edd664ee2 Author: Thomas Zimmermann Date: Thu May 7 11:06:40 2020 +0200 drm/ast: Don't check new mode if CRTC is being disabled Suspending failed because there's no mode if the CRTC is being disabled. Early-out in this case. This fixes runtime PM for ast. v3: * fixed commit message v2: * added Tested-by/Reported-by tags * added Fixes tags and CC (Sam) * improved comment Signed-off-by: Thomas Zimmermann Reported-by: Cary Garrett Tested-by: Cary Garrett Reviewed-by: Daniel Vetter Fixes: b48e1b6ffd28 ("drm/ast: Add CRTC helpers for atomic modesetting") Cc: Thomas Zimmermann Cc: Gerd Hoffmann Cc: Dave Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Cc: # v5.6+ Link: https://patchwork.freedesktop.org/patch/msgid/20200507090640.21561-1-tzimmermann@suse.de commit d3d2674cc6ff10e89bfbace7b943c09fb9052cca Author: Liad Kaufman Date: Sat Apr 25 13:04:59 2020 +0300 iwlwifi: dbg_ini: differentiate ax210 hw with same hw type There are several "flavors" of HW that have the same HW type, but can be told apart after reading a certain perph register. This is easy to do in runtime, but more complicated to do when looking at the logs offline. To make it easier to tell apart these "flavors" when looking at the dumped dbg info, add these bits to the HW type, allowing simple differentiation. Signed-off-by: Liad Kaufman Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.330ea11d17ae.Ie59b25430a308090b15112ac6deedf4fbf487ff1@changeid commit b1c860f6ec73d993f0427e8d0d70c8f3d6625e6d Author: Johannes Berg Date: Sat Apr 25 13:04:58 2020 +0300 iwlwifi: pcie: skip fragmented receive buffers We don't really expect fragmented RBs, and don't seem to be seeing them in practice since that would've caused a crash. Nevertheless, we should be expecting the hardware to send them. Parse the flag indicating a fragmented buffer, but then discard it and any fragments thereof, at least for now. We need to do more work in the higher layers to properly deal with this, since we may not get "normal" firmware notifications that are fragmented, only RX, and then we need to put it back together and add the necessary API to report a chain of things to the higher layers, this doesn't fit into the struct iwl_rx_cmd_buffer today. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.e78a59f70b1d.Ica656a98a4e4220d73edc97600edd680cbc97241@changeid commit e9a7f025e72c919d7d05318acf887541266933b9 Author: Johannes Berg Date: Sat Apr 25 13:04:57 2020 +0300 iwlwifi: remove outdated copyright print/module statement Remove the outdated copyright, don't print it, and update the module author to actually be Intel, not Intel's copyright. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.dc86a4e9451a.Ice2e21b6427a4b57f953dba9ceb5b8b96b251a8c@changeid commit 3d1d87ab1a3a40c5fea3dde11d4532c4efd11093 Author: Johannes Berg Date: Sat Apr 25 13:04:56 2020 +0300 iwlwifi: mvm: don't transmit on unallocated queue We can currently end up transmitting on an unallocated queue, if the allocation fails. Stop doing that, by simply not transmitting. We don't have any better strategy here, unfortunately, but the previous commits make that much less likely. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.dcf1801f25ef.I6d71e13ea042765800f2ee41401b8eb282527c34@changeid commit e88e2cd0b80f2dfa18f72cfb7a3b8ab3d8d59894 Author: Mordechay Goodstein Date: Sat Apr 25 13:04:55 2020 +0300 iwlwifi: tx: enable A-MSDU in low latency mode Tests have shown that we can meet low latency KPIs with A-MSDU enabled so enable it to achieve max TPT. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.e469ce6501e4.Ibdecebca830bdfbf5220693dd1f5367f7736242d@changeid commit 3da1a4e3287094887397c083d1549b2d067fa1ed Author: Johannes Berg Date: Sat Apr 25 13:04:54 2020 +0300 iwlwifi: use longer queues for 256-BA When we have 256 block-ack support, we may need to be very fast to provide a lot of frames to the hardware to transmit, but that cannot be guaranteed. Use a longer queue size to have more time, and the next possible queue size is 1024 since it must be a power of two. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.851866c7e4c4.I13fa678929431f1694fd202c1da40aa476ab70fe@changeid commit c239feec5038585d8ba622ecc97322e0e2f3398c Author: Johannes Berg Date: Sat Apr 25 13:04:53 2020 +0300 iwlwifi: pcie: gen2: use DMA pool for byte-count tables Since the recent patch in this area, we no longer allocate 64k for a single queue, but only 1k, which still means a full page. Use a DMA pool to reduce this further, since we will have a lot of queues in a typical system that can share pages. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.6e84c79aea30.Ie9a417132812d110ec1cc87852f101477c01cfcb@changeid commit a8e82c36081e574c0c7bdc1b407a697465777069 Author: Johannes Berg Date: Sat Apr 25 13:04:52 2020 +0300 iwlwifi: pcie: remove some dead code We can never get into this code with a gen2/3 device, and therefore don't need to allocate the byte count tables in a single contiguous DMA region. Just WARN and bail out if something is misconfigured. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.a748d33252ef.If2f5810016efb40b041f93fe8c6b4c251542e2f1@changeid commit 281277b206f03f8e66e6d5c151d75ac9c15e066d Author: Johannes Berg Date: Sat Apr 25 13:04:51 2020 +0300 iwlwifi: dbg: mark a variable __maybe_unused If CONFIG_IWLWIFI_DEBUGFS is not set, the variable is assigned but not checked, resulting in a compiler warning. Suppress it, we need the variable for the debugfs-enabled case. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.485f886f5a6c.I8a91c560c26cced33b15d8419caebb53a9abcc2d@changeid commit 92f78d4b15a40f6b055be73bbecc2e79b10638f0 Author: Johannes Berg Date: Sat Apr 25 13:04:50 2020 +0300 iwlwifi: mvm: attempt to allocate smaller queues We currently attempt to allocate queues that are 512 entries long, but that requires 32 KiB memory, which may not be available, at least not contiguously. If we fail to allocate, attempt to use a smaller queue all the way down to 16 entries (which fit into a single page). Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.c8548d7cc08a.I5059c410e628726cbce98d6311b690c632d00f97@changeid commit 752d95a2bf6fe207d612fc1febd621df714f5dde Author: Johannes Berg Date: Sat Apr 25 13:04:49 2020 +0300 iwlwifi: pcie: allocate much smaller byte-count table The hardware needs a byte-count table with the size of each frame on the queue to build A-MPDUs, but: * newer generation no longer have the duplicated space at the end, they can deal with the wrap properly - and we don't even fill the dup anyway * we have a maximum queue size of 512 right now and don't use the theoretical hardware maximum of 65536. Together, this reduces the byte count table DMA allocation from 64KiB (65536*2 + 64*2 rounded up) to 1 KiB (though that might be rounded up to a full 4 KiB page by the allocator, not sure it can share the allocations.) Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200425130140.c263b787b5ab.I059507a9760b1ce1d45d84dcaa91629a5cfb58e0@changeid commit 36dfe9ac6e8b8fc2e25733d003a867a40db791da Author: Mordechay Goodstein Date: Fri Apr 24 19:47:07 2020 +0300 iwlwifi: dump api version in yaml format Used for debugging what FW API we are using to understand misalignment with API changes. The output looks like this as a yaml format fw_api_ver: 0x0001: name: MVM_ALIVE cmd_ver: 99 notif_ver: 4 0x0108: name: PHY_CONTEXT_CMD cmd_ver: 2 notif_ver: 0 ... Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.18bf540ab8e0.I6217488f1740f0e6accd0cecd09dfd46bad88426@changeid commit 3f910a25839b13436bf0a22186f1698b23eafb91 Author: Luca Coelho Date: Fri Apr 24 19:47:06 2020 +0300 iwlwifi: pcie: convert all AX101 devices to the device tables Convert all Qu/Hr1 devices to the new device tables, by modifying the corresponding structures, adding a new name and generalizing the device recognition. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.ec0e04102d2c.Ia36f2c7bbf06cb6436424d40d6adb2376f2962ee@changeid commit e34aa5abfcf56502b79a4fdbe5fd9e94f70aa279 Author: Luca Coelho Date: Fri Apr 24 19:47:05 2020 +0300 iwlwifi: pcie: remove occurrences of 22000 in the FW name defines We don't use the number 22000 for our devices anymore, so remove all occurrences of it in the FW name macros. While at it, add IWL_QU_B_HR_B to the list of firmwares used by the driver, which was missing. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.93cc41bdbb4d.Ib7599901888a2d050f851bd878a875f593f2e8e5@changeid commit d5727b60a18edb2e762a95fbf445b1ce3ff41e25 Author: Luca Coelho Date: Fri Apr 24 19:47:04 2020 +0300 iwlwifi: pcie: convert QnJ with Hr to the device table Convert all the occurrences of QnJ with Hr into a single entry in the PCI device table. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.21283ca79d82.I57a493c679a56fff11417afdaec76617711ff6a9@changeid commit ebe7b061e9293968181bbe60a3e261681358c50f Author: Luca Coelho Date: Fri Apr 24 19:47:03 2020 +0300 iwlwifi: pcie: remove mangling for iwl_ax101_cfg_qu_hr All devices that use iwl_ax101_cfg_qu_hr are recognized via the device info table, so the cfg will never be iwl_ax101_cfg_qu_hr. Remove the code that converts this into QuZ and Qu-C, since it's not needed anymore. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.30b6b4aae1c1.If5e583835c9f7f2771a50ba1b2f33bb85f25b383@changeid commit 53abad420b7e106232fdc93208e438570f4aa908 Author: Luca Coelho Date: Fri Apr 24 19:47:02 2020 +0300 iwlwifi: pcie: remove outdated comment about PCI RTPM reference This comment was only related to the PCI RTPM implementation, which has been removed a while ago, and is not meaningless. Remove it. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.f362e4560a3b.I8d858c6c9a6c98b45d2195dfe28dabe0286c8a83@changeid commit 37dee1f18eefd727a2f186ea16c6d76c802d8541 Author: Luca Coelho Date: Fri Apr 24 19:47:01 2020 +0300 iwlwifi: mvm: add IML/ROM information to the assertion dumps Dump the IML/ROM error code and data, which are read from some registers, when printing an assertion dump. This makes it easier to debug IML/ROM errors. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.a522161a7372.I2a65ee35a5e0242f8a0e106f126356dff81ef59d@changeid commit a8eb340f2ea48280eb2b7dc5a0e6cfff4928f5a5 Author: Emmanuel Grumbach Date: Fri Apr 24 19:47:00 2020 +0300 iwlwifi: move iwl_set_soc_latency to iwl-drv to be used by other op_modes All the op_mode need to send this command as well. Instead of duplicating the code from mvm, put the code in a common place. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.7f30f977f9bf.I060b51d0d66d09b9d1ee512e7de8f2d695a52152@changeid commit 0960237d2fa39eae376580690c2d6bc6bd0a1d07 Author: Mordechay Goodstein Date: Fri Apr 24 19:46:59 2020 +0300 iwlwifi: yoyo: remove magic number The for loop is iterating over active regions so iterate only over the len of the active regions buffer size. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.e10482b9eed7.I15da7bb25d9b9e3eef1c1b117dc585e703ce756a@changeid commit 71e9378bcfd2e9dd96c2bfbef23f3562946d30b3 Author: Luca Coelho Date: Fri Apr 24 19:46:58 2020 +0300 iwlwifi: mvm: initialize iwl_dev_tx_power_cmd to zero If the REDUCE_TX_POWER_CMD version is v4 or v5, we are not initializing some values before sending to the FW, which causes SAR not to work properly. Solve this by initializing the struct in the declaration. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.0dc957a264ff.I43cfd72d539c1287ccaaa454e95c673dac38214f@changeid commit 2abe24f9e15b2ccce471dd1996debdae6c84e64b Author: Shahar S Matityahu Date: Fri Apr 24 19:46:57 2020 +0300 iwlwifi: dbg: set debug descriptor to NULL outside of iwl_fw_free_dump_desc To avoid static analysis warning and to make the flow more readable, set the debug descriptor to NULL outside iwl_fw_free_dump_desc and only in the required places. Signed-off-by: Shahar S Matityahu Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424194456.5d5c50750a52.I17e33fc268c2097b7c42877f86cef2aa163b913a@changeid commit 45baf306b0a14bba59c1529add2ba7f8df48082e Author: Luca Coelho Date: Fri Apr 24 18:48:18 2020 +0300 iwlwifi: bump FW API to 55 for AX devices Start supporting API version 55 for AX devices. We skipped 54 because it won't be published. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.5b4628e18203.I626d3b19d84214a83cd92dc4ddf291903b0983aa@changeid commit 89cb1ddee1a9f26ee2c1a60e768dfd0e8e705b0a Author: Mordechay Goodstein Date: Fri Apr 24 18:48:17 2020 +0300 iwlwifi: yoyo: add D3 resume timepoint This timepoint is used for getting a clean log (if needed) after resume without any commands/interrupts from the driver to the FW. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.7cd450812977.Ibc9ddd6eae6af5ce499ac1e4f6c01853577d1e83@changeid commit 73f23d91cfa32c087b7289f2516efa186b2e982c Author: Shaul Triebitz Date: Fri Apr 24 18:48:16 2020 +0300 iwlwifi: mvm: set properly station flags in STA_HE_CTXT_CMD For ACK_ENABLED and 32BIT_BA_BITMAP flags check the station capabilities rather than bss_conf.ack_enabled and bss_conf.multi_sta_back_32bit. These fields are stations capabilities and should not be in bss_conf. Also note that the bss_conf flags are set in station mode only. In the next patch I will remove ack_enabled and multi_sta_back_32bit from the bss_conf structure. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.bc7230b74f93.I144f73cd6a797a7060429981fee62572861bc76b@changeid commit a65a5824298b06049dbaceb8a9bd19709dc9507c Author: Mordechay Goodstein Date: Fri Apr 24 18:48:15 2020 +0300 iwlwifi: avoid debug max amsdu config overwriting itself If we set amsdu_len one after another the second one overwrites the orig_amsdu_len so allow only moving from debug to non debug state. Also the TLC update check was wrong: it was checking that also the orig is smaller then the new updated size, which is not the case in debug amsdu mode. Signed-off-by: Mordechay Goodstein Fixes: af2984e9e625 ("iwlwifi: mvm: add a debugfs entry to set a fixed size AMSDU for all TX packets") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.e565446a4fce.I9729d8c520d8b8bb4de9a5cdc62e01eb85168aac@changeid commit 9617040ecab4810363ccab81aac1de3725675c9b Author: Emmanuel Grumbach Date: Fri Apr 24 18:48:14 2020 +0300 iwlwifi: mvm: remove iwlmvm's tfd_q_hang_detect module parameter This should be controlled by the firmware debugging mechanism and not by a module parameter. This has always been true. Remove it and assume it is set. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.b6e4982e62ae.I7f7352f79c40ada2f221bd4b41449a40821e833f@changeid commit f4bfdc5e571ef5107112a7f1daa6a9c572e4a798 Author: Emmanuel Grumbach Date: Fri Apr 24 18:48:13 2020 +0300 iwlwifi: mvm: stop supporting swcrypto and bt_coex_active module parameters Leave them active for iwldvm. We do not test this configuration and there is no reason nowadays to allow this. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.674a325b008b.Ifc925ca84500fb76c7b6f926a24a34ca777b4192@changeid commit f092e4e35b34fba55f2ad5b8d34d342755afa49a Author: Avraham Stern Date: Fri Apr 24 18:48:12 2020 +0300 iwlwifi: mvm: add support for range request command version 9 This version adds support for per responder calibrations. Currently the driver will use a single value for all responders and bandwidths. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.5ce74a87009c.I9079332b21eef490bbdbf8d7d66e35d7d0c7882b@changeid commit 0c9e025e797e02c35449b3ad08d3317e5fc7d7b8 Author: Mordechay Goodstein Date: Fri Apr 24 18:48:11 2020 +0300 iwlwifi: yoyo: don't access TLV before verifying len If we access the TLV memory with shorter len than the struct we access garbage data that was not given by the user. On the way rewrite the checker in a cleaner way. Signed-off-by: Mordechay Goodstein Fixes: a9248de42464 ("iwlwifi: dbg_ini: add TLV allocation new API support") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.54418c829390.I15d6b462a0e69a280b6c6cfbcb6bcb05bb5f79ee@changeid commit f25c418dcad93755cf48537d60a46070112be72c Author: Emmanuel Grumbach Date: Fri Apr 24 18:48:10 2020 +0300 iwlwifi: remove antenna_coupling module parameter This module parameter should not be mangled by users. This relates to a very old driver and I doubt people can really check the antenna coupling in a way that would make the BT Coexistence work better with a real value. Drop it. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.6e566897ce0a.I8395a50c1c39522e542366064bff33a33009ce7b@changeid commit cc9b6012d34b8cb130d4269a79032b75a84bf46e Author: Mordechay Goodstein Date: Fri Apr 24 18:48:09 2020 +0300 iwlwifi: yoyo: use hweight_long instead of bit manipulating Also we can only have one fid1 or fid2 set so no need to check if the fid2 is set in case fid1 wasn't set. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182644.34e74106bad3.Ic3a9f0a35fed47b02ebcd27c2dc2b50cb1e56bdf@changeid commit ebfa7f8ae155c9a0bb2e4038d6b5d8b14881c424 Author: Mordechay Goodstein Date: Fri Apr 24 18:48:08 2020 +0300 iwlwifi: yoyo: add support for parsing SHARED_MEM_ALLOC version 4 The new version adds the information for RX2C FIFO addresses. Use the new addresses to parse the FIFO info when dumping. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182643.97cc25d96b53.I65fd0400d80f505bd6d7eed442f12db24b25bbe3@changeid commit 382d8296c5b5664a4f16653f71d3fbf64263afb3 Author: Johannes Berg Date: Fri Apr 24 18:48:07 2020 +0300 iwlwifi: fw api: fix PHY data 2/3 position In AX210 devices, the PHY data wasn't actually reported, but now that it's going to be reported it turns out that the position is supposed to be the other way around, fix that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200424182643.06de959301f5.I544c353a8a811f107bd66d168e37920237ecf071@changeid commit 3a53230e1c4b8bb9058d12b4f7df742abc1105e8 Author: Samuel Zou Date: Thu May 7 10:40:06 2020 +0800 drm/ast: Make ast_primary_plane_helper_atomic_update static Fix the following sparse warning: drivers/gpu/drm/ast/ast_mode.c:564:6: warning: symbol 'ast_primary_plane_helper_atomic_update' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/1588819206-11406-1-git-send-email-zou_wei@huawei.com commit 228c4f265c6eb60eaa4ed0edb3bf7c113173576c Author: Eric Biggers Date: Sat May 2 11:24:27 2020 -0700 crypto: lib/sha1 - fold linux/cryptohash.h into crypto/sha.h sounds very generic and important, like it's the header to include if you're doing cryptographic hashing in the kernel. But actually it only includes the library implementation of the SHA-1 compression function (not even the full SHA-1). This should basically never be used anymore; SHA-1 is no longer considered secure, and there are much better ways to do cryptographic hashing in the kernel. Remove this header and fold it into which already contains constants and functions for SHA-1 (along with SHA-2). Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2aaba014b55be46affcae78edff356c5e3389081 Author: Eric Biggers Date: Sat May 2 11:24:26 2020 -0700 crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.h sounds very generic and important, like it's the header to include if you're doing cryptographic hashing in the kernel. But actually it only includes the library implementation of the SHA-1 compression function (not even the full SHA-1). This should basically never be used anymore; SHA-1 is no longer considered secure, and there are much better ways to do cryptographic hashing in the kernel. Most files that include this header don't actually need it. So in preparation for removing it, remove all these unneeded includes of it. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 6b0b0fa2bce61db790efc8070ae6e5696435b0a8 Author: Eric Biggers Date: Sat May 2 11:24:25 2020 -0700 crypto: lib/sha1 - rename "sha" to "sha1" The library implementation of the SHA-1 compression function is confusingly called just "sha_transform()". Alongside it are some "SHA_" constants and "sha_init()". Presumably these are left over from a time when SHA just meant SHA-1. But now there are also SHA-2 and SHA-3, and moreover SHA-1 is now considered insecure and thus shouldn't be used. Therefore, rename these functions and constants to make it very clear that they are for SHA-1. Also add a comment to make it clear that these shouldn't be used. For the extra-misleadingly named "SHA_MESSAGE_BYTES", rename it to SHA1_BLOCK_SIZE and define it to just '64' rather than '(512/8)' so that it matches the same definition in . This prepares for merging into . Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 4d21e594508c9dca0a51e41a684e16cb5c420c36 Author: Eric Biggers Date: Sat May 2 11:24:24 2020 -0700 crypto: s390/sha1 - prefix the "sha1_" functions Prefix the s390 SHA-1 functions with "s390_sha1_" rather than "sha1_". This allows us to rename the library function sha_init() to sha1_init() without causing a naming collision. Cc: linux-s390@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 23dc2a0dfc981f2bc6455a7cefccbb6d39e07314 Author: Eric Biggers Date: Sat May 2 11:24:23 2020 -0700 crypto: powerpc/sha1 - prefix the "sha1_" functions Prefix the PowerPC SHA-1 functions with "powerpc_sha1_" rather than "sha1_". This allows us to rename the library function sha_init() to sha1_init() without causing a naming collision. Cc: linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 1c4b3c409998a7d63ed9b590e3601cf7c4d102b5 Author: Eric Biggers Date: Sat May 2 11:24:22 2020 -0700 crypto: powerpc/sha1 - remove unused temporary workspace The PowerPC implementation of SHA-1 doesn't actually use the 16-word temporary array that's passed to the assembly code. This was probably meant to correspond to the 'W' array that lib/sha1.c uses. However, in sha1-powerpc-asm.S these values are actually stored in GPRs 16-31. Referencing SHA_WORKSPACE_WORDS from this code also isn't appropriate, since it's an implementation detail of lib/sha1.c. Therefore, just remove this unneeded array. Tested with: export ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- make mpc85xx_defconfig cat >> .config << EOF # CONFIG_MODULES is not set # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set CONFIG_DEBUG_KERNEL=y CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y CONFIG_CRYPTO_SHA1_PPC=y EOF make olddefconfig make -j32 qemu-system-ppc -M mpc8544ds -cpu e500 -nographic \ -kernel arch/powerpc/boot/zImage \ -append "cryptomgr.fuzz_iterations=1000 cryptomgr.panic_on_fail=1" Cc: linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Eric Biggers Acked-by: Michael Ellerman (powerpc) Signed-off-by: Herbert Xu commit ac0ad93df7136e27d2a9c5ec554547695f581d0e Author: Eric Biggers Date: Sat May 2 11:24:21 2020 -0700 mptcp: use SHA256_BLOCK_SIZE, not SHA_MESSAGE_BYTES In preparation for naming the SHA-1 stuff in properly and moving it to a more appropriate header, fix the HMAC-SHA256 code in mptcp_crypto_hmac_sha() to use SHA256_BLOCK_SIZE instead of "SHA_MESSAGE_BYTES" which is actually the SHA-1 block size. (Fortunately these are both 64 bytes, so this wasn't a "real" bug...) Cc: Paolo Abeni Cc: mptcp@lists.01.org Signed-off-by: Eric Biggers Reviewed-by: Matthieu Baerts Signed-off-by: Herbert Xu commit 85fc78b80f15d723db3aa8f368b414ee70a1937c Author: Eric Biggers Date: Fri May 1 22:31:22 2020 -0700 ASoC: cros_ec_codec: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Cheng-Yi Chiang Cc: Enric Balletbo i Serra Cc: Guenter Roeck Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit bce395eea0f2da2b9ca2e78f101ade353686ee5c Author: Eric Biggers Date: Fri May 1 22:31:21 2020 -0700 KEYS: encrypted: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: keyrings@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 75b93c635482dead3071fe60180b12191d3b3b0f Author: Eric Biggers Date: Fri May 1 22:31:20 2020 -0700 sctp: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: linux-sctp@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ec0bf6edc4ad80b722ebec12a3c7eb392e28d2cb Author: Eric Biggers Date: Fri May 1 22:31:19 2020 -0700 Bluetooth: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit f80df3851246ce5b9b7dd9625f3438e0f39383f1 Author: Eric Biggers Date: Fri May 1 22:31:18 2020 -0700 ubifs: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: linux-mtd@lists.infradead.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ea794db2646a3660647dd2f2c8f6f2770acc3596 Author: Eric Biggers Date: Fri May 1 22:31:17 2020 -0700 nfsd: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: linux-nfs@vger.kernel.org Signed-off-by: Eric Biggers Acked-by: J. Bruce Fields Signed-off-by: Herbert Xu commit 1979811388050dc3c1533b5e3e43a6d50b7ad39b Author: Eric Biggers Date: Fri May 1 22:31:16 2020 -0700 ecryptfs: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: ecryptfs@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 3e185a56eb6968927049f2b3b8c95b3636d77ffd Author: Eric Biggers Date: Fri May 1 22:31:15 2020 -0700 fscrypt: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 96a5aa721df8e740f8d33fe7eae18acc157a000d Author: Eric Biggers Date: Fri May 1 22:31:14 2020 -0700 nfc: s3fwrn5: use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Robert Baldyga Cc: Krzysztof Opasiak Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ecca1ad60cdfc061c1242490637e9e806ff1d884 Author: Eric Biggers Date: Fri May 1 22:31:13 2020 -0700 crypto: s5p-sss - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Krzysztof Kozlowski Cc: Vladimir Zapolskiy Cc: Kamil Konieczny Signed-off-by: Eric Biggers Acked-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit e29ba412bdfe15233abff3b49a46763d4a6dd7d9 Author: Eric Biggers Date: Fri May 1 22:31:12 2020 -0700 crypto: omap-sham - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ce8e04888dd873179bc3979b0574cc7827071df5 Author: Eric Biggers Date: Fri May 1 22:31:11 2020 -0700 crypto: n2 - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit e0077ea8ee1774cb99cf9adf10dd4e6dcbf363b0 Author: Eric Biggers Date: Fri May 1 22:31:10 2020 -0700 crypto: mediatek - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 61c38e3a94f26035104aec643ee17e80e29ff329 Author: Eric Biggers Date: Fri May 1 22:31:09 2020 -0700 crypto: hisilicon/sec2 - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Zaibo Xu Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8cbb809794b14703c960b5e2941c9e7fd97b765a Author: Eric Biggers Date: Fri May 1 22:31:08 2020 -0700 crypto: ccree - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Gilad Ben-Yossef Signed-off-by: Eric Biggers Acked-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit f32b6775c795b125361ea9181ca4fcfa261a91dd Author: Eric Biggers Date: Fri May 1 22:31:07 2020 -0700 crypto: ccp - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Tom Lendacky Signed-off-by: Eric Biggers Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 7e3e48d86b7c96f12896dd7111e4e5ae51c1b7da Author: Eric Biggers Date: Fri May 1 22:31:06 2020 -0700 crypto: artpec6 - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Jesper Nilsson Cc: Lars Persson Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 1306664fdeeffc92c31ef034e9f2f5516b0d5c97 Author: Eric Biggers Date: Fri May 1 22:31:05 2020 -0700 crypto: essiv - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit a221b33b657b911e2cfefc47484b0ab7531b71be Author: Eric Biggers Date: Fri May 1 22:31:04 2020 -0700 crypto: arm64/aes-glue - use crypto_shash_tfm_digest() Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 822a98b862d5b511826765d64ddf18192fc5b694 Author: Eric Biggers Date: Fri May 1 22:31:03 2020 -0700 crypto: hash - introduce crypto_shash_tfm_digest() Currently the simplest use of the shash API is to use crypto_shash_digest() to digest a whole buffer. However, this still requires allocating a hash descriptor (struct shash_desc). Many users don't really want to preallocate one and instead just use a one-off descriptor on the stack like the following: { SHASH_DESC_ON_STACK(desc, tfm); int err; desc->tfm = tfm; err = crypto_shash_digest(desc, data, len, out); shash_desc_zero(desc); } Wrap this in a new helper function crypto_shash_tfm_digest() that can be used instead of the above. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 13855fd8ce641e567c1b972048b5fd1451984e88 Author: Eric Biggers Date: Fri May 1 09:42:29 2020 -0700 crypto: lib/sha256 - return void The SHA-256 / SHA-224 library functions can't fail, so remove the useless return value. Also long as the declarations are being changed anyway, also fix some parameter names in the declarations to match the definitions. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit d099ea6e6fde5f311bea5bcdadaa85fc3af79259 Author: Arnd Bergmann Date: Thu Apr 30 23:30:43 2020 +0200 crypto - Avoid free() namespace collision gcc-10 complains about using the name of a standard library function in the kernel, as we are not building with -ffreestanding: crypto/xts.c:325:13: error: conflicting types for built-in function 'free'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch] 325 | static void free(struct skcipher_instance *inst) | ^~~~ crypto/lrw.c:290:13: error: conflicting types for built-in function 'free'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch] 290 | static void free(struct skcipher_instance *inst) | ^~~~ crypto/lrw.c:27:1: note: 'free' is declared in header '' The xts and lrw cipher implementations run into this because they do not use the conventional namespaced function names. It might be better to rename all local functions in those files to help with things like 'ctags' and 'grep', but just renaming these two avoids the build issue. I picked the more verbose crypto_xts_free() and crypto_lrw_free() names for consistency with several other drivers that do use namespaced function names. Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher") Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher") Signed-off-by: Arnd Bergmann Signed-off-by: Herbert Xu commit e0664ebcea6ac5e16da703409fb4bd61f8cd37d9 Author: Wei Yongjun Date: Thu Apr 30 08:13:53 2020 +0000 crypto: drbg - fix error return code in drbg_alloc_state() Fix to return negative error code -ENOMEM from the kzalloc error handling case instead of 0, as done elsewhere in this function. Reported-by: Xiumei Mu Fixes: db07cd26ac6a ("crypto: drbg - add FIPS 140-2 CTRNG for noise source") Cc: Signed-off-by: Wei Yongjun Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit c549226926ce9352dc6415931f4e96445759215d Author: Barry Song Date: Thu Apr 30 17:10:18 2020 +1200 crypto: acomp - search acomp with scomp backend in crypto_has_acomp users may call crypto_has_acomp to confirm the existence of acomp before using crypto_acomp APIs. Right now, many acomp have scomp backend, for example, lz4, lzo, deflate etc. crypto_has_acomp will return false for them even though they support acomp APIs. Signed-off-by: Barry Song Signed-off-by: Herbert Xu commit 8d90822643ad8405eeb2ceafb20afd6952c24606 Author: Iuliana Prodan Date: Tue Apr 28 18:49:05 2020 +0300 crypto: engine - support for batch requests Added support for batch requests, per crypto engine. A new callback is added, do_batch_requests, which executes a batch of requests. This has the crypto_engine structure as argument (for cases when more than one crypto-engine is used). The crypto_engine_alloc_init_and_set function, initializes crypto-engine, but also, sets the do_batch_requests callback. On crypto_pump_requests, if do_batch_requests callback is implemented in a driver, this will be executed. The link between the requests will be done in driver, if possible. do_batch_requests is available only if the hardware has support for multiple request. Signed-off-by: Iuliana Prodan Signed-off-by: Herbert Xu commit 6a89f492f8e5097c09d4b0f4d713d354057a66ba Author: Iuliana Prodan Date: Tue Apr 28 18:49:04 2020 +0300 crypto: engine - support for parallel requests based on retry mechanism Added support for executing multiple requests, in parallel, for crypto engine based on a retry mechanism. If hardware was unable to execute a backlog request, enqueue it back in front of crypto-engine queue, to keep the order of requests. A new variable is added, retry_support (this is to keep the backward compatibility of crypto-engine) , which keeps track whether the hardware has support for retry mechanism and, also, if can run multiple requests. If do_one_request() returns: >= 0: hardware executed the request successfully; < 0: this is the old error path. If hardware has support for retry mechanism, the request is put back in front of crypto-engine queue. For backwards compatibility, if the retry support is not available, the crypto-engine will work as before. If hardware queue is full (-ENOSPC), requeue request regardless of MAY_BACKLOG flag. If hardware throws any other error code (like -EIO, -EINVAL, -ENOMEM, etc.) only MAY_BACKLOG requests are enqueued back into crypto-engine's queue, since the others can be dropped. The new crypto_engine_alloc_init_and_set function, initializes crypto-engine, sets the maximum size for crypto-engine software queue (not hardcoded anymore) and the retry_support variable is set, by default, to false. On crypto_pump_requests(), if do_one_request() returns >= 0, a new request is send to hardware, until there is no space in hardware and do_one_request() returns < 0. By default, retry_support is false and crypto-engine will work as before - will send requests to hardware, one-by-one, on crypto_pump_requests(), and complete it, on crypto_finalize_request(), and so on. To support multiple requests, in each driver, retry_support must be set on true, and if do_one_request() returns an error the request must not be freed, since it will be enqueued back into crypto-engine's queue. When all drivers, that use crypto-engine now, will be updated for retry mechanism, the retry_support variable can be removed. Signed-off-by: Iuliana Prodan Signed-off-by: Herbert Xu commit ec6e2bf33b54cc3351bd702452e5d016b8f9d2f4 Author: Iuliana Prodan Date: Tue Apr 28 18:49:03 2020 +0300 crypto: algapi - create function to add request in front of queue Add crypto_enqueue_request_head function that enqueues a request in front of queue. This will be used in crypto-engine, on error path. In case a request was not executed by hardware, enqueue it back in front of queue (to keep the order of requests). Signed-off-by: Iuliana Prodan Signed-off-by: Herbert Xu commit 3e37f04f2bf3dd86432785e15182793a8a8ef00e Author: Hadar Gat Date: Mon Apr 27 14:36:04 2020 +0300 hwrng: cctrng - update help description Improved the HW_RANDOM_CCTRNG help description. Signed-off-by: Hadar Gat Signed-off-by: Herbert Xu commit 55e8405680737492da83875ad0850010018854cd Author: Hadar Gat Date: Mon Apr 27 14:36:03 2020 +0300 hwrng: cctrng - change default to n For many users, the Arm CryptoCell HW is not available, so the default for HW_RANDOM_CCTRNG should to n. Remove the line to follow the convention - 'n' is the default anyway so no need to state it explicitly. Signed-off-by: Hadar Gat Acked-by: Geert Uytterhoeven Signed-off-by: Herbert Xu commit 34d47aab066544050089093a4179a95718be7002 Author: Hadar Gat Date: Mon Apr 27 14:36:02 2020 +0300 hwrng: cctrng - Add dependency on OF The cctrng is unusable on non-DT systems so we should depend on it. Signed-off-by: Hadar Gat Signed-off-by: Herbert Xu commit 3f7819bd42153b6df04af40dfa3439ce71ce4ad1 Author: Tang Bin Date: Mon Apr 27 16:22:18 2020 +0800 crypto: bcm - Use the defined variable to clean code Use the defined variable "dev" to make the code cleaner. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: Herbert Xu commit 79cd691f609c3f5b9603063099502b70ab32ae87 Author: Lionel Debieve Date: Mon Apr 27 08:42:26 2020 +0200 crypto: stm32/hash - don't print error on probe deferral Change driver to not print an error message when the device probe is deferred for a clock resource. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu commit 45dafed6c5ecd01400766ce99a49b2d8ad351ce6 Author: Etienne Carriere Date: Mon Apr 27 08:42:25 2020 +0200 crypto: stm32/hash - defer probe for dma device Change stm32 HASH driver to defer its probe operation when DMA channel device is registered but has not been probed yet. Signed-off-by: Etienne Carriere Reviewed-by: Lionel DEBIEVE Signed-off-by: Herbert Xu commit 43b05ce76733164e1c1b33ab16eda14130646c96 Author: Etienne Carriere Date: Mon Apr 27 08:42:24 2020 +0200 crypto: stm32/hash - defer probe for reset controller Change stm32 HASH driver to defer its probe operation when reset controller device is registered but has not been probed yet. Signed-off-by: Etienne Carriere Reviewed-by: Lionel DEBIEVE Signed-off-by: Herbert Xu commit 1f1755af4f062cb1cbd55ca4a250fe272b82fe2f Author: Geert Uytterhoeven Date: Thu May 7 13:29:53 2020 +0200 cpufreq: qoriq: Add platform dependencies The Freescale QorIQ clock controller is only present on Freescale E500MC and Layerscape SoCs. Add platform dependencies to the QORIQ_CPUFREQ config symbol, to avoid asking the user about it when configuring a kernel without E500MC or Layerscape support. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Li Yang Signed-off-by: Viresh Kumar commit 3fd911b69b3117e03181262fc19ae6c3ef6962ce Merge: 370fb6b0aaf0 0ea2ea42b31a Author: Dave Airlie Date: Fri May 8 15:16:36 2020 +1000 Merge tag 'drm-misc-next-2020-05-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.8: UAPI Changes: Cross-subsystem Changes: * MAINTAINERS: restore alphabetical order; update cirrus driver * Dcomuentation: document visionix, chronteli, ite vendor prefices; update documentation for Chrontel CH7033, IT6505, IVO, BOE, Panasonic, Chunghwa, AUO bindings; convert dw_mipi_dsi.txt to YAML; remove todo item for drm_display_mode.hsync removal; Core Changes: * drm: add devm_drm_dev_alloc() for managed allocations of drm_device; use DRM_MODESET_LOCK_ALL_*() in mode-object code; remove drm_display_mode.hsync; small cleanups of unused variables, compiler warnings and static functions * drm/client: dual-lincensing: GPL-2.0 or MIT * drm/mm: optimize tree searches in rb_hole_addr() Driver Changes: * drm/{many}: use devm_drm_dev_alloc(); don't use drm_device.dev_private * drm/ast: don't double-assign to drm_crtc_funcs.set_config; drop drm_connector_register() * drm/bochs: drop drm_connector_register() * drm/bridge: add support for Chrontel ch7033; fix stack usage with old gccs; return error pointer in drm_panel_bridge_add() * drm/cirrus: Move to tiny * drm/dp_mst: don't use 2nd sideband tx slot; revert "Remove single tx msg restriction" * drm/lima: support runtime PM; * drm/meson: limit modes wrt chipset * drm/panel: add support for Visionox rm69299; fix clock on boe-tv101wum-n16; fix panel type for AUO G101EVN10; add support for Ivo M133NFW4 R0; add support for BOE NV133FHM-N61; add support for AUO G121EAN01.4, G156XTN01.0, G190EAN01 * drm/pl111: improve vexpress init; fix module auto-loading * drm/stm: read number of endpoints from device tree * drm/vboxvideo: use managed PCI functions; drop DRM_MTRR_WC * drm/vkms: fix use-after-free in vkms_gem_create(); enable cursor support by default * fbdev: use boolean values in several drivers * fbdev/controlfb: fix COMPILE_TEST * fbdev/w100fb: fix double-free bug Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200507072503.GA10979@linux-uq9g commit 47e51832ae93534d872511ba557115722582d94c Author: Zhenyu Wang Date: Wed May 6 17:59:48 2020 +0800 drm/i915/gvt: use context lrc_reg_state for shadow ppgtt override We can replace kmap by using context's lrc_reg_state directly for shadow ppgtt table override. Reviewed-by: Yan Zhao Cc: Yan Zhao Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200506095948.124979-1-zhenyuw@linux.intel.com commit bec3df930fbd40fcc7bcead43a39cfd3c5b0419f Author: Zhenyu Wang Date: Fri May 8 11:14:09 2020 +0800 drm/i915/gvt: Support PPGTT table load command The PPGTT in context image can be overridden by LRI cmd with another PPGTT's pdps. In such case, the load mm is used instead of the one in the context image. So we need to load its shadow mm in GVT and replace ppgtt pointers in command. This feature is used by guest IGD driver to share gfx VM between different contexts. Verified by IGT "gem_ctx_clone" test. v4: - consolidate shadow mm handlers (Yan) - fix cmd shadow mm pin error path v3: (Zhenyu Wang) - Cleanup PDP register offset check - Add debug check for guest context ppgtt update - Skip 3-level ppgtt guest handling code. The reason is that all guests now use 4-level ppgtt table and the only left case for 3-level table is ancient aliasing ppgtt case. But those guest kernel has no use of PPGTT LRI command. So 3-level ppgtt guest for this feature becomes simply un-testable. v2: (Zhenyu Wang) - Change to list for handling possible multiple ppgtt table loads in one submission. Make sure shadow mm is to replace for each one. Reviewed-by: Yan Zhao Cc: Yan Zhao Signed-off-by: Tina Zhang Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200508031409.2562-1-zhenyuw@linux.intel.com commit 40dcee1b7c086715d8ce7f6c9c9bdae45f4855b0 Author: Zhenyu Wang Date: Wed May 6 17:43:17 2020 +0800 drm/i915/gvt: move workload destroy out of execlist complete To let execlist.c only handle execlist handling and keep other workload cleanup function in scheduler.c to align with other workload specific handling there. This doesn't change current code behavior. Reviewed-by: Yan Zhao Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200506094318.105604-1-zhenyuw@linux.intel.com commit 0c4395fb2aa77341269ea619c5419ea48171883f Author: Roberto Sassu Date: Tue Apr 14 10:01:31 2020 +0200 evm: Fix possible memory leak in evm_calc_hmac_or_hash() Don't immediately return if the signature is portable and security.ima is not present. Just set error so that memory allocated is freed before returning from evm_calc_hmac_or_hash(). Fixes: 50b977481fce9 ("EVM: Add support for portable signature format") Signed-off-by: Roberto Sassu Cc: stable@vger.kernel.org Signed-off-by: Mimi Zohar commit 370fb6b0aaf07c66a3317d5b35fba4345b31035c Merge: 937eea297e26 b8020b0304c8 Author: Dave Airlie Date: Fri May 8 13:31:06 2020 +1000 Merge tag 'amd-drm-next-5.8-2020-04-30' of git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-next-5.8-2020-04-30: amdgpu: - SR-IOV fixes - SDMA fix for Navi - VCN 2.5 DPG fixes - Display fixes - Display stuttering fixes for pageflip and cursor - Add support for handling encrypted GPU memory - Add UAPI for encrypted GPU memory - Rework IB pool handling amdkfd: - Expose asic revision in topology - Add UAPI for GWS (Global Wave Sync) resource management UAPI: - Add amdgpu UAPI for encrypted GPU memory Used by: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4401 - Add amdkfd UAPI for GWS (Global Wave Sync) resource management Thunk usage of KFD ioctl: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/blob/roc-2.8.0/src/queues.c#L840 ROCr usage of Thunk API: https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/roc-3.1.0/src/core/runtime/amd_gpu_agent.cpp#L597 HCC code using ROCr API: https://github.com/RadeonOpenCompute/hcc/blob/98ee9f34945d3b5f572d7a4c15cbffa506487734/lib/hsa/mcwamp_hsa.cpp#L2161 HIP code using HCC API: https://github.com/ROCm-Developer-Tools/HIP/blob/cf8589b8c8a40ddcc55fa3a51e23390a49824130/src/hip_module.cpp#L567 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200430212951.3902-1-alexander.deucher@amd.com commit e2a8b49e79553bd8ec48f73cead84e6146c09408 Author: Michael Ellerman Date: Thu May 7 22:33:24 2020 +1000 powerpc/uaccess: Don't use "m<>" constraint The "m<>" constraint breaks compilation with GCC 4.6.x era compilers. The use of the constraint allows the compiler to use update-form instructions, however in practice current compilers never generate those forms for any of the current uses of __put_user_asm_goto(). We anticipate that GCC 4.6 will be declared unsupported for building the kernel in the not too distant future. So for now just switch to the "m" constraint. Fixes: 334710b1496a ("powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'") Signed-off-by: Michael Ellerman Acked-by: Segher Boessenkool Link: https://lore.kernel.org/r/20200507123324.2250024-1-mpe@ellerman.id.au commit b59fda449cf07f2db3be3a67142e6c000f5e8d79 Author: Krzysztof Struczynski Date: Mon Apr 27 12:28:59 2020 +0200 ima: Set again build_ima_appraise variable After adding the new add_rule() function in commit c52657d93b05 ("ima: refactor ima_init_policy()"), all appraisal flags are added to the temp_ima_appraise variable. Revert to the previous behavior instead of removing build_ima_appraise, to benefit from the protection offered by __ro_after_init. The mentioned commit introduced a bug, as it makes all the flags modifiable, while build_ima_appraise flags can be protected with __ro_after_init. Cc: stable@vger.kernel.org # 5.0.x Fixes: c52657d93b05 ("ima: refactor ima_init_policy()") Co-developed-by: Roberto Sassu Signed-off-by: Roberto Sassu Signed-off-by: Krzysztof Struczynski Signed-off-by: Mimi Zohar commit 6ee28442a465ab4c4be45e3b15015af24b1ba906 Author: Krzysztof Struczynski Date: Mon Apr 27 12:28:58 2020 +0200 ima: Remove redundant policy rule set in add_rules() Function ima_appraise_flag() returns the flag to be set in temp_ima_appraise depending on the hook identifier passed as an argument. It is not necessary to set the flag again for the POLICY_CHECK hook. Signed-off-by: Krzysztof Struczynski Signed-off-by: Mimi Zohar commit 1129d31b55d509f15e72dc68e4b5c3a4d7b4da8d Author: Krzysztof Struczynski Date: Tue Apr 28 09:30:10 2020 +0200 ima: Fix ima digest hash table key calculation Function hash_long() accepts unsigned long, while currently only one byte is passed from ima_hash_key(), which calculates a key for ima_htable. Given that hashing the digest does not give clear benefits compared to using the digest itself, remove hash_long() and return the modulus calculated on the first two bytes of the digest with the number of slots. Also reduce the depth of the hash table by doubling the number of slots. Cc: stable@vger.kernel.org Fixes: 3323eec921ef ("integrity: IMA as an integrity service provider") Co-developed-by: Roberto Sassu Signed-off-by: Roberto Sassu Signed-off-by: Krzysztof Struczynski Acked-by: David.Laight@aculab.com (big endian system concerns) Signed-off-by: Mimi Zohar commit 0090c1edebf464f34629e14ae03d764cca7e0a3b Author: Gustavo A. R. Silva Date: Thu May 7 13:50:41 2020 -0500 audit: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 29022b61307f1aab5564ef65dc268ab7f55b699c Author: Dick Kennedy Date: Fri May 1 14:43:10 2020 -0700 scsi: lpfc: Update lpfc version to 12.8.0.1 Update lpfc version to 12.8.0.1 Link: https://lore.kernel.org/r/20200501214310.91713-10-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 8cdc5a223ed06b47e7e4045f765f2813cae3f5e9 Author: Dick Kennedy Date: Fri May 1 14:43:09 2020 -0700 scsi: lpfc: Fix MDS Diagnostic Enablement definition The MDS diagnostic enablement bit for the adapter interface is incorrect in the driver header. Correct the bit position for the SET_FEATURE MDS bit. Link: https://lore.kernel.org/r/20200501214310.91713-9-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit a7fc071ab56e59e10a6ca868fad91d9677083dba Author: Dick Kennedy Date: Fri May 1 14:43:08 2020 -0700 scsi: lpfc: Fix noderef and address space warnings Running make C=1 M=drivers/scsi/lpfc triggers sparse warnings Correct the code generating the following errors: - Incompatible address space assignment without proper conversion. - Deference of usespace and per-cpu pointers. Link: https://lore.kernel.org/r/20200501214310.91713-8-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 88acb4d9ff981d3ff6ea307e62a08b8739f8ebcd Author: Dick Kennedy Date: Fri May 1 14:43:07 2020 -0700 scsi: lpfc: Remove unnecessary lockdep_assert_held calls In an audit of lockdep calls in the driver, there are multiple lockdep checks in successive calling layers. E.g. a routine checks, and then calls a lower routine that also checks, and so on. Calling sequences result in many redundant checks. Refine the code to remove lower-level lockdep checks. Update comments on the lock, correcting a few places where lock object in comment was incorrect. Link: https://lore.kernel.org/r/20200501214310.91713-7-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 3048e3e805e36a61cf02f185b02b4144f46d8ff3 Author: Dick Kennedy Date: Fri May 1 14:43:06 2020 -0700 scsi: lpfc: Change default queue allocation for reduced memory consumption By default, the driver attempts to allocate a hdwq per logical cpu in order to provide good cpu affinity. Some systems have extremely high cpu counts and this can significantly raise memory consumption. In testing on x86 platforms (non-AMD) it is found that sharing of a hdwq by a physical cpu and its HT cpu can occur with little performance degredation. By sharing, the hdwq count can be halved, significantly reducing the memory overhead. Change the default behavior of the driver on non-AMD x86 platforms to share a hdwq by the cpu and its HT cpu. Link: https://lore.kernel.org/r/20200501214310.91713-6-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit f809da6db68a8be49e317f0ccfbced1af9258839 Author: Dick Kennedy Date: Fri May 1 14:43:05 2020 -0700 scsi: lpfc: Fix negation of else clause in lpfc_prep_node_fc4type Implementation of a previous patch added a condition to an if check that always end up with the if test being true. Execution of the else clause was inadvertently negated. The additional condition check was incorrect and unnecessary after the other modifications had been done in that patch. Remove the check from the if series. Link: https://lore.kernel.org/r/20200501214310.91713-5-jsmart2021@gmail.com Fixes: b95b21193c85 ("scsi: lpfc: Fix loss of remote port after devloss due to lack of RPIs") Cc: # v5.4+ Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b98214f6070ef5052b763b61ac2089a9ac6c8677 Author: Dick Kennedy Date: Fri May 1 14:43:04 2020 -0700 scsi: lpfc: Remove re-binding of nvme rport during registration The lldd rebinds the ndlp with rport during a nvme rport registration (via nvme_fc_register_remoteport). If rport & ndlp pointers are same as the previous one, the lldd will re-use the ndlp and rport association without re-initialization. This assumption is incorrect. The lldd should be ignorant of whether the returned rport pointer is new or not, and should always assume it is new. Remove the re-binding code, always assumes that rport pointer received from transport is a new pointer. Link: https://lore.kernel.org/r/20200501214310.91713-4-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 164ba8d2df66735dd4f00d3b85d898a907fa6982 Author: Dick Kennedy Date: Fri May 1 14:43:03 2020 -0700 scsi: lpfc: Maintain atomic consistency of queue_claimed flag A previous change introduced the atomic use of queue_claimed flag for eq's and cq's. The code works fine, but the clearing of the queue_claimed flag is not atomic. Change queue_claimed = 0 into xchg(&queue_claimed, 0) to be consistent for change under atomicity. Link: https://lore.kernel.org/r/20200501214310.91713-3-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 356ba2a8bc8d9f9bd2ee969df0e07b285aebb559 Author: Bodo Stroesser Date: Mon Apr 27 17:08:23 2020 +0200 scsi: target: tcmu: Make pgr_support and alua_support attributes writable Currently in tcmu reservation commands are handled by core's pr implementation (default) or completely rejected (emulate_pr set to 0). We additionally want to be able to do full reservation handling in userspace. Therefore we need a way to set TRANSPORT_FLAG_PASSTHROUGH_PGR. The inverted flag is displayed by attribute pgr_support. Since we moved the flag from transport/backend to se_device in the previous commit, we now can make it changeable per device by allowing to write the attribute. The new field transport_flags_changeable in transport/backend is used to reject writing if not allowed for a backend. Regarding ALUA we also want to be able to passthrough commands to userspace in tcmu. Therefore we need TRANSPORT_FLAG_PASSTHROUGH_ALUA to be changeable, because by setting it we can switch off all ALUA checks in core. So we also set TRANSPORT_FLAG_PASSTHROUGH_ALUA in tcmu's transport_flags_changeable. Of course, ALUA and reservation handling in userspace will work only, if session/nexus information is sent to userspace along with every command. This will be object of a patch series announced by Mike Christie. Link: https://lore.kernel.org/r/20200427150823.15350-5-bstroesser@ts.fujitsu.com Reviewed-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit 69088a049488171bc05394799b048c8536e7dbab Author: Bodo Stroesser Date: Mon Apr 27 17:08:22 2020 +0200 scsi: target: Make transport_flags per device pgr_support and alua_support device attributes show the inverted value of the transport_flags: * TRANSPORT_FLAG_PASSTHROUGH_PGR * TRANSPORT_FLAG_PASSTHROUGH_ALUA These attributes are per device, while the flags are per backend. Rename the transport_flags in backend/transport to transport_flags_default and use this value to initialize the new transport_flags field in the se_device structure. Now data and attribute both are per se_device. Link: https://lore.kernel.org/r/20200427150823.15350-4-bstroesser@ts.fujitsu.com Reviewed-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit 4703b6252b338eb312ba61c5129d872cfe58759f Author: Bodo Stroesser Date: Mon Apr 27 17:08:21 2020 +0200 scsi: target: tcmu: Add attributes enforce_pr_isids and force_pr_aptpl tcmu has not set TRANSPORT_FLAG_PASSTHROUGH_PGR. Therefore the in-core pr emulation is active by default, but there are some attributes for configuration missing. Add them. Link: https://lore.kernel.org/r/20200427150823.15350-3-bstroesser@ts.fujitsu.com Reviewed-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit 9299941716a3082e5335fe751ce433cdb62b26d0 Author: Bodo Stroesser Date: Mon Apr 27 17:08:20 2020 +0200 scsi: target: Add missing emulate_pr attribute to passthrough backends In commit b49d6f788530 ("scsi: target: add emulate_pr backstore attr to toggle PR support") the new attribute emulate_pr was added. passthrough_parse_cdb() uses the attribute's value to distinguish whether reservation commands should be rejected or not. But the new attribute was not added to passthrough_attrib_attrs, so in pscsi and tcmu - the users of passthrough_parse_cdb() - the attribute is not available to change parser's behavior. Link: https://lore.kernel.org/r/20200427150823.15350-2-bstroesser@ts.fujitsu.com Reviewed-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit e869f8ea6a643103faad8949ae7153cab6bfa702 Author: Sreekanth Reddy Date: Tue Apr 28 05:25:02 2020 -0400 scsi: mpt3sas: Disable DIF when prot_mask set to zero By default DIF Type 1, DIF Type 2 & DIF Type 3 will be enabled. Also, users can enable either DIF Type 1 or DIF Type 2 or DIF Type 3 or in any combination using the prot_mask module parameter. However, when the user provides a prot_mask module parameter value of zero, then the driver is not disabling the DIF. Instead it enables all three types. Modify the driver to disable the DIF support if the user provides a prot_mask module parameter value of zero. Link: https://lore.kernel.org/r/1588065902-2726-1-git-send-email-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 4778069ccf54dc7f0d1f7f7facf30c4edc9a707f Author: Suganath Prabu Date: Tue Apr 28 02:47:08 2020 -0400 scsi: mpt3sas: Update maintainers Updated maintainers list for MPT DRIVERS Link: https://lore.kernel.org/r/1588056428-29369-1-git-send-email-suganath-prabu.subramani@broadcom.com Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 2b01b293f359ddd67e08bbe8def42a7082310b82 Author: Suganath Prabu Date: Tue Apr 28 02:45:22 2020 -0400 scsi: mpt3sas: Capture IOC data for debugging purposes Information needed to debug driver problems and firmware faults is stored in the IOC’s MPT3SAS_ADAPTER data structure. Parameters such as IOCFacts, IOC flags (related to sge, MSI-X, error recovery etc.), performance mode type, TMs, internal commands reply status, etc. are present. For debugging purposes, it is therefore helpful to be able to capture this information so that the fault can be analyzed. Export the MPT3SAS_ADAPTER data structure in debugfs. The data is available in: /sys/kernel/debug/mpt3sas/scsi_hostX/ioc_dump Link: https://lore.kernel.org/r/1588056322-29227-1-git-send-email-suganath-prabu.subramani@broadcom.com Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 55d4ce458c77f21fd20711f23ab8540e904d10c3 Author: Jason Yan Date: Thu Apr 30 20:17:38 2020 +0800 scsi: mpt3sas: Use true, false for ioc->use_32bit_dma Fix the following coccicheck warning: drivers/scsi/mpt3sas/mpt3sas_base.c:7202:1-19: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200430121738.15151-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 013f69a931e72aa0a38030d23f3c9b7cdafae9cc Author: Jason Yan Date: Thu Apr 30 20:17:29 2020 +0800 scsi: vmw_pvscsi: Use true, false for adapter->use_msg Fix the following coccicheck warning: drivers/scsi/vmw_pvscsi.c:911:2-18: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200430121729.15064-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit b91857a5ca13cc7e6e7fe904d7f4ad64d44aee04 Author: Jason Yan Date: Thu Apr 30 20:17:18 2020 +0800 scsi: fnic: Use true, false for fnic->internal_reset_inprogress Fix the following coccicheck warning: drivers/scsi/fnic/fnic_scsi.c:2627:5-36: WARNING: Comparison of 0/1 to bool variable Link: https://lore.kernel.org/r/20200430121718.14970-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 9187745ceec6ee94c28bba8e78ff9328719e18d3 Author: Jason Yan Date: Thu Apr 30 20:17:06 2020 +0800 scsi: qedi: Remove comparison of 0/1 to bool variable Fix the following coccicheck warning: drivers/scsi/qedi/qedi_main.c:1309:5-25: WARNING: Comparison of 0/1 to bool variable drivers/scsi/qedi/qedi_main.c:1315:5-25: WARNING: Comparison of 0/1 to bool variable Link: https://lore.kernel.org/r/20200430121706.14879-1-yanaijie@huawei.com Acked-by: Manish Rangankar Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 297083f6e53ba3ed4f3f3b0000def2e7b86f7b21 Author: Zou Wei Date: Thu Apr 30 18:02:12 2020 +0800 scsi: aacraid: Make some symbols static Fix the following sparse warnings: drivers/scsi/aacraid/linit.c:867:6: warning: symbol 'aac_tmf_callback' was not declared. Should it be static? drivers/scsi/aacraid/linit.c:1081:5: warning: symbol 'aac_eh_host_reset' was not declared. Should it be static? drivers/scsi/aacraid/commsup.c:2354:5: warning: symbol 'aac_send_safw_hostttime' was not declared. Should it be static? drivers/scsi/aacraid/commsup.c:2383:5: warning: symbol 'aac_send_hosttime' was not declared. Should it be static? Link: https://lore.kernel.org/r/1588240932-69020-1-git-send-email-zou_wei@huawei.com Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Martin K. Petersen commit 88bfdf565cbe33524308d912777f4267981d4be0 Author: Jason Yan Date: Wed May 6 14:17:57 2020 +0800 scsi: qla2xxx: Make qlafx00_process_aen() return void No other functions use the return value of qlafx00_process_aen() and the return value is always 0 now. Make it return void. This fixes the following coccicheck warning: drivers/scsi/qla2xxx/qla_mr.c:1716:5-9: Unneeded variable: "rval". Return "0" on line 1768 Link: https://lore.kernel.org/r/20200506061757.19536-1-yanaijie@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit dbe6f49259dacc073c1ae602f383c177f57b1b8a Author: Jason Yan Date: Thu Apr 30 20:18:00 2020 +0800 scsi: qla2xxx: Use true, false for ha->fw_dumped Fix the following coccicheck warning: drivers/scsi/qla2xxx/qla_tmpl.c:1120:2-20: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200430121800.15323-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit bda552a7741a23708823c6e87a39d9a956087ac0 Author: Jason Yan Date: Thu Apr 30 20:17:51 2020 +0800 scsi: qla2xxx: Use true, false for need_mpi_reset Fix the following coccicheck warning: drivers/scsi/qla2xxx/qla_tmpl.c:1031:6-20: WARNING: Assignment of 0/1 to bool variable drivers/scsi/qla2xxx/qla_tmpl.c:1062:3-17: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200430121751.15232-1-yanaijie@huawei.com Reviewed-by: Himanshu Madhani Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 1b007f96f9e063f9f0b93597a4089114a89c1854 Author: Jason Yan Date: Wed Apr 29 22:09:52 2020 +0800 scsi: qla2xxx: Make qla_set_ini_mode() return void The return value is not used by the caller and the local variable 'rc' is not needed. Make qla_set_ini_mode() return void and remove 'rc'. This also fixes the following coccicheck warning: drivers/scsi/qla2xxx/qla_attr.c:1906:5-7: Unneeded variable: "rc". Return "0" on line 2180 Link: https://lore.kernel.org/r/20200429140952.8240-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 60da7d0bc7482a30817c73fdc8152123d19919f8 Author: Gustavo A. R. Silva Date: Thu May 7 14:23:02 2020 -0500 sparc64: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 803e45550b11c8e43d89812356fe6f105adebdf9 Author: Viacheslav Dubeyko Date: Wed Apr 22 13:55:52 2020 +0300 scsi: qla2xxx: Fix issue with adapter's stopping state The goal of the following command sequence is to restart the adapter. However, the tgt_stop flag remains set, indicating that the adapter is still in stopping state even after re-enabling it. echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging modprobe target_core_mod modprobe tcm_qla2xxx mkdir /sys/kernel/config/target/qla2xxx mkdir /sys/kernel/config/target/qla2xxx/ mkdir /sys/kernel/config/target/qla2xxx//tpgt_1 echo 1 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable echo 0 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable echo 1 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable kernel: PID 1396:qla_target.c:1555 qlt_stop_phase1(): tgt_stop 0x0, tgt_stopped 0x0 kernel: qla2xxx [0001:00:02.0]-e803:1: PID 1396:qla_target.c:1567: Stopping target for host 1(c0000000033557e8) kernel: PID 1396:qla_target.c:1579 qlt_stop_phase1(): tgt_stop 0x1, tgt_stopped 0x0 kernel: PID 1396:qla_target.c:1266 qlt_schedule_sess_for_deletion(): tgt_stop 0x1, tgt_stopped 0x0 kernel: qla2xxx [0001:00:02.0]-e801:1: PID 1396:qla_target.c:1316: Scheduling sess c00000002d5cd800 for deletion 21:00:00:24:ff:7f:35:c7 kernel: qla2xxx [0001:00:02.0]-290a:1: PID 340:qla_target.c:1187: qlt_unreg_sess sess c00000002d5cd800 for deletion 21:00:00:24:ff:7f:35:c7 kernel: qla2xxx [0001:00:02.0]-f801:1: PID 340:qla_target.c:1145: Unregistration of sess c00000002d5cd800 21:00:00:24:ff:7f:35:c7 finished fcp_cnt 0 kernel: PID 340:qla_target.c:1155 qlt_free_session_done(): tgt_stop 0x1, tgt_stopped 0x0 kernel: qla2xxx [0001:00:02.0]-4807:1: PID 346:qla_os.c:6329: ISP abort scheduled. kernel: qla2xxx [0001:00:02.0]-28f1:1: PID 346:qla_os.c:3956: Mark all dev lost kernel: PID 346:qla_target.c:1266 qlt_schedule_sess_for_deletion(): tgt_stop 0x1, tgt_stopped 0x0 kernel: qla2xxx [0001:00:02.0]-4808:1: PID 346:qla_os.c:6338: ISP abort end. kernel: PID 1396:qla_target.c:6812 qlt_enable_vha(): tgt_stop 0x1, tgt_stopped 0x0 kernel: qla2xxx [0001:00:02.0]-4807:1: PID 346:qla_os.c:6329: ISP abort scheduled. kernel: qla2xxx [0001:00:02.0]-4808:1: PID 346:qla_os.c:6338: ISP abort end. qlt_handle_cmd_for_atio() rejects the request to send commands because the adapter is in the stopping state: kernel: PID 0:qla_target.c:4442 qlt_handle_cmd_for_atio(): tgt_stop 0x1, tgt_stopped 0x0 kernel: qla2xxx [0001:00:02.0]-3861:1: PID 0:qla_target.c:4447: New command while device c000000005314600 is shutting down kernel: qla2xxx [0001:00:02.0]-e85f:1: PID 0:qla_target.c:5728: qla_target: Unable to send command to target This patch calls qla_stop_phase2() in addition to qlt_stop_phase1() in tcm_qla2xxx_tpg_enable_store() and tcm_qla2xxx_npiv_tpg_enable_store(). The qlt_stop_phase1() marks adapter as stopping (tgt_stop == 0x1, tgt_stopped == 0x0) but qlt_stop_phase2() marks adapter as stopped (tgt_stop == 0x0, tgt_stopped == 0x1). Link: https://lore.kernel.org/r/52be1e8a3537f6c5407eae3edd4c8e08a9545ea5.camel@yadro.com Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Signed-off-by: Viacheslav Dubeyko Signed-off-by: Martin K. Petersen commit 6b3d16f9875e181412401b8ab445dce83bd6fedc Author: Viacheslav Dubeyko Date: Wed Apr 22 13:51:51 2020 +0300 scsi: qla2xxx: Fix failure message in qlt_disable_vha() The following sequence of commands result in an incorrect failure message being printed: echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging modprobe target_core_mod modprobe tcm_qla2xxx mkdir /sys/kernel/config/target/qla2xxx mkdir /sys/kernel/config/target/qla2xxx/ mkdir /sys/kernel/config/target/qla2xxx//tpgt_1 echo 1 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable echo 0 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable qla2xxx [0001:00:02.0]-e881:1: qla2x00_wait_for_hba_online() failed The reason of this message is the QLA_FUNCTION_FAILED code that qla2x00_wait_for_hba_online() returns. However, qlt_disable_vha() expects that adapter is offlined and QLA_FUNCTION_FAILED informs about the offline state of the adapter. The qla2x00_abort_isp() function finishes the execution at the point of checking the adapter's mode (for example, qla_tgt_mode_enabled()) because of the qlt_disable_vha() calls qlt_clear_mode() method. It means that qla2x00_abort_isp() keeps vha->flags.online is equal to zero. Finally, qla2x00_wait_for_hba_online() checks the state of this flag and returns QLA_FUNCTION_FAILED error code. This patch changes the failure message which informs about adapter's offline state. Link: https://lore.kernel.org/r/3cd0bbf3599c53b0c2a7184582d705d8b8052c8b.camel@yadro.com Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Signed-off-by: Viacheslav Dubeyko Signed-off-by: Martin K. Petersen commit f839544ccff60cbe534282aac68858fc3fb278ca Author: Viacheslav Dubeyko Date: Fri Apr 10 11:07:08 2020 +0300 scsi: qla2xxx: Fix warning after FC target reset Currently, FC target reset finishes with the warning message: [84010.596893] ------------[ cut here ]------------ [84010.596917] WARNING: CPU: 238 PID: 279973 at ../drivers/scsi/qla2xxx/qla_target.c:6644 qlt_enable_vha+0x1d0/0x260 [qla2xxx] [84010.596918] Modules linked in: vrf af_packet 8021q garp mrp stp llc netlink_diag target_tatlin_tblock(OEX) dm_ec(OEX) ttln_rdma(OEX) dm_frontend(OEX) nvme_rdma nvmet tcm_qla2xxx iscsi_target_mod target_core_mod at24 nvmem_core pnv_php ipmi_watchdog ipmi_ssif vmx_crypto gf128mul crct10dif_vpmsum qla2xxx rpcrdma nvme_fc powernv_flash(X) nvme_fabrics uio_pdrv_genirq mtd rtc_opal(X) ibmpowernv(X) opal_prd(X) uio scsi_transport_fc i2c_opal(X) ses enclosure ipmi_poweroff ast i2c_algo_bit ttm bmc_mcu(OEX) drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm drm_panel_orientation_quirks agpgart nfsd auth_rpcgss nfs_acl ipmi_powernv(X) lockd ipmi_devintf ipmi_msghandler grace dummy ext4 crc16 jbd2 mbcache sd_mod rdma_ucm ib_iser rdma_cm ib_umad iw_cm ib_ipoib libiscsi scsi_transport_iscsi ib_cm [84010.596975] configfs mlx5_ib ib_uverbs ib_core mlx5_core crc32c_vpmsum xhci_pci xhci_hcd mpt3sas(OEX) tg3 usbcore mlxfw tls raid_class libphy scsi_transport_sas devlink ptp pps_core nvme nvme_core sunrpc dm_mirror dm_region_hash dm_log sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua scsi_mod autofs4 [84010.597001] Supported: Yes, External [84010.597004] CPU: 238 PID: 279973 Comm: bash Tainted: G OE 4.12.14-197.29-default #1 SLE15-SP1 [84010.597006] task: c000000a104c0000 task.stack: c000000b52188000 [84010.597007] NIP: d00000001ffd7f78 LR: d00000001ffd7f6c CTR: c0000000001676c0 [84010.597008] REGS: c000000b5218b910 TRAP: 0700 Tainted: G OE (4.12.14-197.29-default) [84010.597008] MSR: 900000010282b033 [84010.597015] CR: 48242424 XER: 00000000 [84010.597016] CFAR: d00000001ff45d08 SOFTE: 1 GPR00: d00000001ffd7f6c c000000b5218bb90 d00000002001b228 0000000000000102 GPR04: 0000000000000001 0000000000000001 00013d91ed0a5e2d 0000000000000000 GPR08: c000000007793300 0000000000000000 0000000000000000 c000000a086e7818 GPR12: 0000000000002200 c000000007793300 0000000000000000 000000012bc937c0 GPR16: 000000012bbf7ed0 0000000000000000 000000012bc3dd10 0000000000000000 GPR20: 000000012bc4db28 0000010036442810 000000012bc97828 000000012bc96c70 GPR24: 00000100365b1550 0000000000000000 00000100363f3d80 c000000be20d3080 GPR28: c000000bda7eae00 c000000be20db7e8 c000000be20d3778 c000000be20db7e8 [84010.597042] NIP [d00000001ffd7f78] qlt_enable_vha+0x1d0/0x260 [qla2xxx] [84010.597051] LR [d00000001ffd7f6c] qlt_enable_vha+0x1c4/0x260 [qla2xxx] [84010.597051] Call Trace: [84010.597061] [c000000b5218bb90] [d00000001ffd7f6c] qlt_enable_vha+0x1c4/0x260 [qla2xxx] (unreliable) [84010.597064] [c000000b5218bc20] [d000000009820b6c] tcm_qla2xxx_tpg_enable_store+0xc4/0x130 [tcm_qla2xxx] [84010.597067] [c000000b5218bcb0] [d0000000185d0e68] configfs_write_file+0xd0/0x190 [configfs] [84010.597072] [c000000b5218bd00] [c0000000003d0edc] __vfs_write+0x3c/0x1e0 [84010.597074] [c000000b5218bd90] [c0000000003d2ea8] vfs_write+0xd8/0x220 [84010.597076] [c000000b5218bde0] [c0000000003d4ddc] SyS_write+0x6c/0x110 [84010.597079] [c000000b5218be30] [c00000000000b188] system_call+0x3c/0x130 [84010.597080] Instruction dump: [84010.597082] 7d0050a8 7d084b78 7d0051ad 40c2fff4 7fa3eb78 4bf73965 60000000 7fa3eb78 [84010.597086] 4bf6dcd9 60000000 2fa30000 419eff40 <0fe00000> 4bffff38 e95f0058 a12a0180 [84010.597090] ---[ end trace e32abaf6e6fee826 ]--- To reproduce: echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging modprobe target_core_mod modprobe tcm_qla2xxx mkdir /sys/kernel/config/target/qla2xxx mkdir /sys/kernel/config/target/qla2xxx/ mkdir /sys/kernel/config/target/qla2xxx//tpgt_1 echo 1 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable echo 0 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable echo 1 > /sys/kernel/config/target/qla2xxx//tpgt_1/enable SYSTEM START kernel: pid 327:drivers/scsi/qla2xxx/qla_init.c:2174 qla2x00_initialize_adapter(): vha->flags.online 0x0 <...> kernel: pid 327:drivers/scsi/qla2xxx/qla_os.c:3444 qla2x00_probe_one(): vha->flags.online 0x1 echo 1 > /sys/kernel/config/target/qla2xxx/21:00:00:24:ff:86:a6:2a/tpgt_1/enable kernel: pid 348:drivers/scsi/qla2xxx/qla_init.c:6641 qla2x00_abort_isp_cleanup(): vha->flags.online 0x0, ISP_ABORT_NEEDED 0x0 <...> kernel: pid 348:drivers/scsi/qla2xxx/qla_init.c:6998 qla2x00_restart_isp(): vha->flags.online 0x0 echo 0 > /sys/kernel/config/target/qla2xxx/21:00:00:24:ff:86:a6:2a/tpgt_1/enable kernel: pid 348:drivers/scsi/qla2xxx/qla_init.c:6641 qla2x00_abort_isp_cleanup(): vha->flags.online 0x0, ISP_ABORT_NEEDED 0x0 <...> kernel: pid 1404:drivers/scsi/qla2xxx/qla_os.c:1107 qla2x00_wait_for_hba_online(): base_vha->flags.online 0x0 echo 1 > /sys/kernel/config/target/qla2xxx/21:00:00:24:ff:86:a6:2a/tpgt_1/enable kernel: pid 1404:drivers/scsi/qla2xxx/qla_os.c:1107 qla2x00_wait_for_hba_online(): base_vha->flags.online 0x0 kernel: -----------[ cut here ]----------- kernel: WARNING: CPU: 1 PID: 1404 at drivers/scsi/qla2xxx/qla_target.c:6654 qlt_enable_vha+0x1e0/0x280 [qla2xxx] The issue happens because no real ISP reset is executed. The qla2x00_abort_isp(scsi_qla_host_t *vha) function expects that vha->flags.online will be not zero for ISP reset procedure. This patch sets vha->flags.online to 1 before calling ->abort_isp() for starting the ISP reset. Link: https://lore.kernel.org/r/1d7b21bf9f7676643239eb3d60eaca7cfa505cf0.camel@yadro.com Reviewed-by: Roman Bolshakov Signed-off-by: Viacheslav Dubeyko Signed-off-by: Martin K. Petersen commit 790709f249728640faa4eff38286a9feb34fed81 Author: Eric Dumazet Date: Thu May 7 10:05:39 2020 -0700 net: relax SO_TXTIME CAP_NET_ADMIN check Now sch_fq has horizon feature, we want to allow QUIC/UDP applications to use EDT model so that pacing can be offloaded to the kernel (sch_fq) or the NIC. Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Acked-by: Willem de Bruijn Acked-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 738fea32af86f5d58f30dfca6645494070c976ef Merge: 3a13f98b4c16 ae46f184bc1f Author: David S. Miller Date: Thu May 7 18:11:07 2020 -0700 Merge branch 'bonding-report-transmit-status-to-callers' Eric Dumazet says: ==================== bonding: report transmit status to callers First patches cleanup netpoll, and make sure it provides tx status to its users. Last patch changes bonding to not pretend packets were sent without error. By providing more accurate status, TCP stack can avoid adding more packets if the slave qdisc is already full. This came while testing latest horizon feature in sch_fq, with very low pacing rate flows, but should benefit hosts under stress. ==================== Signed-off-by: David S. Miller commit ae46f184bc1fb15bf2de47114c29236e61ca4bbc Author: Eric Dumazet Date: Thu May 7 09:32:22 2020 -0700 bonding: propagate transmit status Currently, bonding always returns NETDEV_TX_OK to its caller. It is worth trying to be more accurate : TCP for instance can have different recovery strategies if it can have more precise status, if packet was dropped by slave qdisc. This is especially important when host is under stress. Signed-off-by: Eric Dumazet Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Signed-off-by: David S. Miller commit f78ed2204db9fc35b545d693865bddbe0149aa1f Author: Eric Dumazet Date: Thu May 7 09:32:21 2020 -0700 netpoll: accept NULL np argument in netpoll_send_skb() netpoll_send_skb() callers seem to leak skb if the np pointer is NULL. While this should not happen, we can make the code more robust. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 1ddabdfaf70c202b88925edd74c66f4707dbd92e Author: Eric Dumazet Date: Thu May 7 09:32:20 2020 -0700 netpoll: netpoll_send_skb() returns transmit status Some callers want to know if the packet has been sent or dropped, to inform upper stacks. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit fb1eee476b0d3be3e58dac1a3a96f726c6278bed Author: Eric Dumazet Date: Thu May 7 09:32:19 2020 -0700 netpoll: move netpoll_send_skb() out of line There is no need to inline this helper, as we intend to add more code in this function. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 307f660d056b5eb8f5bb2328fac3915ab75b5007 Author: Eric Dumazet Date: Thu May 7 09:32:18 2020 -0700 netpoll: remove dev argument from netpoll_send_skb_on_dev() netpoll_send_skb_on_dev() can get the device pointer directly from np->dev Rename it to __netpoll_send_skb() Following patch will move netpoll_send_skb() out-of-line. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 3a13f98b4c16fb3489bdfd7550fcaa333ee69850 Author: Colin Ian King Date: Thu May 7 15:34:30 2020 +0100 net: phy: fix less than zero comparison with unsigned variable val The unsigned variable val is being checked for an error by checking if it is less than zero. This can never occur because val is unsigned. Fix this by making val a plain int. Addresses-Coverity: ("Unsigned compared against zero") Fixes: bdbdac7649fa ("ethtool: provide UAPI for PHY master/slave configuration.") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 646d4b507626f4c19d2d256ef5fc14a8d52521c6 Author: Hannes Reinecke Date: Thu May 7 08:26:42 2020 +0200 scsi: core: Remove 'list' entry from struct scsi_cmnd Leftover from cmd_list removal. Link: https://lore.kernel.org/r/20200507062642.100612-1-hare@suse.de Fixes: c5a9707672fe ("scsi: core: Remove cmd_list functionality") Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit ca7e3edc221d5cf750ae04cac29cf9fe9db38e84 Author: YueHaibing Date: Thu May 7 16:24:06 2020 +0200 net/smc: remove set but not used variables 'del_llc, del_llc_resp' Fixes gcc '-Wunused-but-set-variable' warning: net/smc/smc_llc.c: In function 'smc_llc_cli_conf_link': net/smc/smc_llc.c:753:31: warning: variable 'del_llc' set but not used [-Wunused-but-set-variable] struct smc_llc_msg_del_link *del_llc; ^ net/smc/smc_llc.c: In function 'smc_llc_process_srv_delete_link': net/smc/smc_llc.c:1311:33: warning: variable 'del_llc_resp' set but not used [-Wunused-but-set-variable] struct smc_llc_msg_del_link *del_llc_resp; ^ Signed-off-by: YueHaibing Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 636ef28d6e4d174e424102466caf572b0406fb0e Author: zhang kai Date: Thu May 7 11:08:30 2020 +0800 tcp: tcp_mark_head_lost is only valid for sack-tcp so tcp_is_sack/reno checks are removed from tcp_mark_head_lost. Signed-off-by: zhang kai Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit c75a33c84b83ffbb8b8b58a6bf4dea69dba21326 Author: Jacob Keller Date: Wed May 6 17:58:27 2020 -0700 net: remove newlines in NL_SET_ERR_MSG_MOD The NL_SET_ERR_MSG_MOD macro is used to report a string describing an error message to userspace via the netlink extended ACK structure. It should not have a trailing newline. Add a cocci script which catches cases where the newline marker is present. Using this script, fix the handful of cases which accidentally included a trailing new line. I couldn't figure out a way to get a patch mode working, so this script only implements context, report, and org. Signed-off-by: Jacob Keller Cc: Jakub Kicinski Cc: Andy Whitcroft Cc: Joe Perches Signed-off-by: David S. Miller commit 57ea85069cc5da0e8b8418f901cae706f92774fb Merge: a8c9baf28c48 ef2d1363c55a Author: David S. Miller Date: Thu May 7 17:51:03 2020 -0700 Merge branch 'ti-am65x-cpts-follow-up-dt-bindings-update' Grygorii Strashko says: ==================== net: ethernet: ti: am65x-cpts: follow up dt bindings update This series is follow update for TI A65x/J721E Common platform time sync (CPTS) driver [1] to implement DT bindings review comments from Rob Herring [2]. - "reg" and "compatible" properties are made required for CPTS DT nodes which also required to change K3 CPSW driver to use of_platform_device_create() instead of of_platform_populate() for proper CPTS and MDIO initialization - minor DT bindings format changes - K3 CPTS example added to K3 MCU CPSW bindings [1] https://lwn.net/Articles/819313/ [2] https://lwn.net/ml/linux-kernel/20200505040419.GA8509@bogus/ ==================== Signed-off-by: David S. Miller commit ef2d1363c55a2bae14a20d5c0ce6939c7badf8c6 Author: Grygorii Strashko Date: Wed May 6 21:14:01 2020 +0300 arm64: dts: ti: k3-am65/j721e-mcu: update cpts node Update CPTS node following DT binding update: - add reg and compatible properties - fix node name Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 4786f4a08d72b7af68cfa258cb7e0abdbf13f002 Author: Grygorii Strashko Date: Wed May 6 21:14:00 2020 +0300 dt-binding: net: ti: am65x-cpts: make reg and compatible required This patch follows K3 CPTS review comments from Rob Herring . - "reg" and "compatible" properties are required now - minor format changes - K3 CPTS example added to K3 MCU CPSW bindings Cc: Rob Herring Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit a45cfcc69a2519463db0e18db5b7f9c7739f559d Author: Grygorii Strashko Date: Wed May 6 21:13:59 2020 +0300 net: ethernet: ti: am65-cpsw-nuss: use of_platform_device_create() for mdio The MCU CPSW expected to populate only MDIO device, but follow up patches will add "compatible" property to the MCU CPSW CPTS node which will cause creation of CPTS device and MCU CPSW init failure. Hence, switch to use of_platform_device_create() instead of of_platform_populate() for MDIO device population. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 108e36f0d8bf91839613d8053a6d1354965801b0 Author: Damien Le Moal Date: Thu May 7 11:35:26 2020 +0900 scsi: scsi_debug: Disallow zone sizes that are not powers of 2 Allowing a non-power-of-2 zone size forces the use of direct division operations of 64-bit sector values to obtain a zone number or number of zones. Doing so without using do_div() leads to compilation errors on 32-bit architectures. Devices with a zone size that is not a power of 2 do not exist today so allowing their emulation is of limited interest as the sd driver will not support them anyway. To fix this compilation error, instead of using do_div() for sector values divisions, simply disallow zone size values that are not a power of 2. [mkp: commit desc] Link: https://lore.kernel.org/r/20200507023526.221574-1-damien.lemoal@wdc.com Fixes: 98e0a689868c ("scsi: scsi_debug: Add zone_size_mb module parameter") Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands") Reviewed-by: Johannes Thumshirn Acked-by: Geert Uytterhoeven Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit a8c9baf28c484a56a0cb1f92e9f740112d1cc567 Merge: 7596ac9d19a9 38c440b24052 Author: David S. Miller Date: Thu May 7 17:40:02 2020 -0700 Merge branch 'hsr-hsr-code-refactoring' Taehee Yoo says: ==================== hsr: hsr code refactoring There are some unnecessary routine in the hsr module. This patch removes these routines. The first patch removes incorrect comment. The second patch removes unnecessary WARN_ONCE() macro. ==================== Signed-off-by: David S. Miller commit 38c440b24052cad3fa6dcbc32bf8e132da3fe55d Author: Ioana Ciornei Date: Wed May 6 20:47:17 2020 +0300 dpaa2-eth: create a function to flush the XDP fds Create an independent function that takes a particular frame queue and an array of frame descriptors and tries to enqueue them until it hits the maximum number fo retries. The same function will be used in the next patch also on the XDP_TX path. Also, create the dpaa2_eth_xdp_fds structure to incorporate the array of FDs as well as the number of FDs already populated. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit f96e87178bb819a2ee25623a6935fa850c2defdd Author: Taehee Yoo Date: Wed May 6 15:47:45 2020 +0000 hsr: remove WARN_ONCE() in hsr_fill_frame_info() When VLAN frame is being sent, hsr calls WARN_ONCE() because hsr doesn't support VLAN. But using WARN_ONCE() is overdoing. Using netdev_warn_once() is enough. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 7596ac9d19a9df25707ecaac0675881f62dd8c18 Author: Ioana Ciornei Date: Tue May 5 23:14:29 2020 +0300 soc: fsl: dpio: properly compute the consumer index Mask the consumer index before using it. Without this, we would be writing frame descriptors beyond the ring size supported by the QBMAN block. Fixes: 3b2abda7d28c ("soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue") Signed-off-by: Ioana Ciornei Acked-by: Li Yang Signed-off-by: David S. Miller commit eb55d7b65f1735dfb39fb14e47007d3c8fb74c43 Merge: bb206a0869b7 47cfa3af4e23 Author: David S. Miller Date: Thu May 7 17:31:57 2020 -0700 Merge branch 'tc-gate-offload-for-SJA1105-DSA-switch' Vladimir Oltean says: ==================== tc-gate offload for SJA1105 DSA switch Expose the TTEthernet hardware features of the switch using standard tc-flower actions: trap, drop, redirect and gate. v1 was submitted at: https://patchwork.ozlabs.org/project/netdev/cover/20200503211035.19363-1-olteanv@gmail.com/ v2 was submitted at: https://patchwork.ozlabs.org/project/netdev/cover/20200503211035.19363-1-olteanv@gmail.com/ Changes in v3: Made sure there are no compilation warnings when CONFIG_NET_DSA_SJA1105_TAS or CONFIG_NET_DSA_SJA1105_VL are disabled. Changes in v2: Using a newly introduced dsa_port_from_netdev public helper. ==================== Signed-off-by: David S. Miller commit 47cfa3af4e23f5ea29ed9202557c428b43742c57 Author: Vladimir Oltean Date: Tue May 5 22:20:57 2020 +0300 docs: net: dsa: sja1105: document intended usage of virtual links Add some verbiage describing how the hardware features of the switch are exposed to users through tc-flower. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 834f8933d5ddd732274cb6050252bd1c7cc7349d Author: Vladimir Oltean Date: Tue May 5 22:20:56 2020 +0300 net: dsa: sja1105: implement tc-gate using time-triggered virtual links Restrict the TTEthernet hardware support on this switch to operate as closely as possible to IEEE 802.1Qci as possible. This means that it can perform PTP-time-based ingress admission control on streams identified by {DMAC, VID, PCP}, which is useful when trying to ensure the determinism of traffic scheduled via IEEE 802.1Qbv. The oddity comes from the fact that in hardware (and in TTEthernet at large), virtual links always need a full-blown action, including not only the type of policing, but also the list of destination ports. So in practice, a single tc-gate action will result in all packets getting dropped. Additional actions (either "trap" or "redirect") need to be specified in the same filter rule such that the conforming packets are actually forwarded somewhere. Apart from the VL Lookup, Policing and Forwarding tables which need to be programmed for each flow (virtual link), the Schedule engine also needs to be told to open/close the admission gates for each individual virtual link. A fairly accurate (and detailed) description of how that works is already present in sja1105_tas.c, since it is already used to trigger the egress gates for the tc-taprio offload (IEEE 802.1Qbv). Key point here, we remember that the schedule engine supports 8 "subschedules" (execution threads that iterate through the global schedule in parallel, and that no 2 hardware threads must execute a schedule entry at the same time). For tc-taprio, each egress port used one of these 8 subschedules, leaving a total of 4 subschedules unused. In principle we could have allocated 1 subschedule for the tc-gate offload of each ingress port, but actually the schedules of all virtual links installed on each ingress port would have needed to be merged together, before they could have been programmed to hardware. So simplify our life and just merge the entire tc-gate configuration, for all virtual links on all ingress ports, into a single subschedule. Be sure to check that against the usual hardware scheduling conflicts, and program it to hardware alongside any tc-taprio subschedule that may be present. The following scenarios were tested: 1. Quantitative testing: tc qdisc add dev swp2 clsact tc filter add dev swp2 ingress flower skip_sw \ dst_mac 42:be:24:9b:76:20 \ action gate index 1 base-time 0 \ sched-entry OPEN 1200 -1 -1 \ sched-entry CLOSE 1200 -1 -1 \ action trap ping 192.168.1.2 -f PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data. ............................. --- 192.168.1.2 ping statistics --- 948 packets transmitted, 467 received, 50.7384% packet loss, time 9671ms 2. Qualitative testing (with a phase-aligned schedule - the clocks are synchronized by ptp4l, not shown here): Receiver (sja1105): tc qdisc add dev swp2 clsact now=$(phc_ctl /dev/ptp1 get | awk '/clock time is/ {print $5}') && \ sec=$(echo $now | awk -F. '{print $1}') && \ base_time="$(((sec + 2) * 1000000000))" && \ echo "base time ${base_time}" tc filter add dev swp2 ingress flower skip_sw \ dst_mac 42:be:24:9b:76:20 \ action gate base-time ${base_time} \ sched-entry OPEN 60000 -1 -1 \ sched-entry CLOSE 40000 -1 -1 \ action trap Sender (enetc): now=$(phc_ctl /dev/ptp0 get | awk '/clock time is/ {print $5}') && \ sec=$(echo $now | awk -F. '{print $1}') && \ base_time="$(((sec + 2) * 1000000000))" && \ echo "base time ${base_time}" tc qdisc add dev eno0 parent root taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ base-time ${base_time} \ sched-entry S 01 50000 \ sched-entry S 00 50000 \ flags 2 ping -A 192.168.1.1 PING 192.168.1.1 (192.168.1.1): 56 data bytes ... ^C --- 192.168.1.1 ping statistics --- 1425 packets transmitted, 1424 packets received, 0% packet loss round-trip min/avg/max = 0.322/0.361/0.990 ms And just for comparison, with the tc-taprio schedule deleted: ping -A 192.168.1.1 PING 192.168.1.1 (192.168.1.1): 56 data bytes ... ^C --- 192.168.1.1 ping statistics --- 33 packets transmitted, 19 packets received, 42% packet loss round-trip min/avg/max = 0.336/0.464/0.597 ms Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit dfacc5a23e227cabdff41b6202f510398e90d36b Author: Vladimir Oltean Date: Tue May 5 22:20:55 2020 +0300 net: dsa: sja1105: support flow-based redirection via virtual links Implement tc-flower offloads for redirect, trap and drop using non-critical virtual links. Commands which were tested to work are: # Send frames received on swp2 with a DA of 42:be:24:9b:76:20 to the # CPU and to swp3. This type of key (DA only) when the port's VLAN # awareness state is off. tc qdisc add dev swp2 clsact tc filter add dev swp2 ingress flower skip_sw dst_mac 42:be:24:9b:76:20 \ action mirred egress redirect dev swp3 \ action trap # Drop frames received on swp2 with a DA of 42:be:24:9b:76:20, a VID # of 100 and a PCP of 0. tc filter add dev swp2 ingress protocol 802.1Q flower skip_sw \ dst_mac 42:be:24:9b:76:20 vlan_id 100 vlan_prio 0 action drop Under the hood, all rules match on DMAC, VID and PCP, but when VLAN filtering is disabled, those are set internally by the driver to the port-based defaults. Because we would be put in an awkward situation if the user were to change the VLAN filtering state while there are active rules (packets would no longer match on the specified keys), we simply deny changing vlan_filtering unless the list of flows offloaded via virtual links is empty. Then the user can re-add new rules. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b70bb8d4ab2c0a4992e4692f07e9b91056b30c88 Author: Vladimir Oltean Date: Tue May 5 22:20:54 2020 +0300 net: dsa: sja1105: make room for virtual link parsing in flower offload Virtual links are a sja1105 hardware concept of executing various flow actions based on a key extracted from the frame's DMAC, VID and PCP. Currently the tc-flower offload code supports only parsing the DMAC if that is the broadcast MAC address, and the VLAN PCP. Extract the key parsing logic from the L2 policers functionality and move it into its own function, after adding extra logic for matching on any DMAC and VID. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 94f94d4acfb2a5e978f98d924be33c981e2f86c6 Author: Vladimir Oltean Date: Tue May 5 22:20:53 2020 +0300 net: dsa: sja1105: add static tables for virtual links This patch adds the register definitions for the: - VL Lookup Table - VL Policing Table - VL Forwarding Table - VL Forwarding Parameters Table These are needed in order to perform TTEthernet operations: QoS classification, flow-based policing and/or frame redirecting with the switch. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit e1eea8112017cbdc596d90caf6ede191502a9691 Author: Vladimir Oltean Date: Tue May 5 22:20:52 2020 +0300 net: dsa: introduce a dsa_port_from_netdev public helper As its implementation shows, this is synonimous with calling dsa_slave_dev_check followed by dsa_slave_to_port, so it is quite simple already and provides functionality which is already there. However there is now a need for these functions outside dsa_priv.h, for example in drivers that perform mirroring and redirection through tc-flower offloads (they are given raw access to the flow_cls_offload structure), where they need to call this function on act->dev. But simply exporting dsa_slave_to_port would make it non-inline and would result in an extra function call in the hotpath, as can be seen for example in sja1105: Before: 000006dc : { 6dc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 6e0: e1a04000 mov r4, r0 6e4: e591958c ldr r9, [r1, #1420] ; 0x58c <- Inline dsa_slave_to_port 6e8: e1a05001 mov r5, r1 6ec: e24dd004 sub sp, sp, #4 u16 tx_vid = dsa_8021q_tx_vid(dp->ds, dp->index); 6f0: e1c901d8 ldrd r0, [r9, #24] 6f4: ebfffffe bl 0 6f4: R_ARM_CALL dsa_8021q_tx_vid u8 pcp = netdev_txq_to_tc(netdev, queue_mapping); 6f8: e1d416b0 ldrh r1, [r4, #96] ; 0x60 u16 tx_vid = dsa_8021q_tx_vid(dp->ds, dp->index); 6fc: e1a08000 mov r8, r0 After: 000006e4 : { 6e4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 6e8: e1a04000 mov r4, r0 6ec: e24dd004 sub sp, sp, #4 struct dsa_port *dp = dsa_slave_to_port(netdev); 6f0: e1a00001 mov r0, r1 { 6f4: e1a05001 mov r5, r1 struct dsa_port *dp = dsa_slave_to_port(netdev); 6f8: ebfffffe bl 0 6f8: R_ARM_CALL dsa_slave_to_port 6fc: e1a09000 mov r9, r0 u16 tx_vid = dsa_8021q_tx_vid(dp->ds, dp->index); 700: e1c001d8 ldrd r0, [r0, #24] 704: ebfffffe bl 0 704: R_ARM_CALL dsa_8021q_tx_vid Because we want to avoid possible performance regressions, introduce this new function which is designed to be public. Suggested-by: Vivien Didelot Signed-off-by: Vladimir Oltean Reviewed-by: Vivien Didelot Signed-off-by: David S. Miller commit 52c81f47f0d2680f0b2e7b61c1fa4d8ad35f3020 Author: Colin Ian King Date: Thu May 7 16:16:10 2020 +0100 RDMA/mlx5: Remove duplicated assignment to variable rcqe_sz The variable rcqe_sz is being unnecessarily assigned twice, fix this by removing one of the duplicates. Fixes: 8bde2c509e40 ("RDMA/mlx5: Update all DRIVER QP places to use QP subtype") Link: https://lore.kernel.org/r/20200507151610.52636-1-colin.king@canonical.com Addresses-Coverity: ("Evaluation order violation") Signed-off-by: Colin Ian King Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e6eff4376e2897c2e14b70d87bf7284cdb093830 Author: Josh Poimboeuf Date: Wed Apr 29 10:24:53 2020 -0500 module: Make module_enable_ro() static again Now that module_enable_ro() has no more external users, make it static again. Suggested-by: Jessica Yu Signed-off-by: Josh Poimboeuf Acked-by: Jessica Yu Signed-off-by: Jiri Kosina commit 5b384f933590a086ca9a0abdc2e55e41107ac440 Author: Josh Poimboeuf Date: Wed Apr 29 10:24:52 2020 -0500 x86/module: Use text_mutex in apply_relocate_add() Now that the livepatch code no longer needs the text_mutex for changing module permissions, move its usage down to apply_relocate_add(). Note the s390 version of apply_relocate_add() doesn't need to use the text_mutex because it already uses s390_kernel_write_lock, which accomplishes the same task. Signed-off-by: Josh Poimboeuf Acked-by: Joe Lawrence Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina commit 0d9fbf78fefb421a3af97394ce80bba0db4f046a Author: Josh Poimboeuf Date: Wed Apr 29 10:24:51 2020 -0500 module: Remove module_disable_ro() module_disable_ro() has no more users. Remove it. Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Acked-by: Jessica Yu Signed-off-by: Jiri Kosina commit d556e1be33320366272ec02f93f98d7f308479f1 Author: Josh Poimboeuf Date: Wed Apr 29 10:24:50 2020 -0500 livepatch: Remove module_disable_ro() usage With arch_klp_init_object_loaded() gone, and apply_relocate_add() now using text_poke(), livepatch no longer needs to use module_disable_ro(). Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina commit 88fc078a7a8f67e47020d73d8d14ed11f03754ab Author: Peter Zijlstra Date: Wed Apr 29 10:24:49 2020 -0500 x86/module: Use text_poke() for late relocations Because of late module patching, a livepatch module needs to be able to apply some of its relocations well after it has been loaded. Instead of playing games with module_{dis,en}able_ro(), use existing text poking mechanisms to apply relocations after module loading. So far only x86, s390 and Power have HAVE_LIVEPATCH but only the first two also have STRICT_MODULE_RWX. This will allow removal of the last module_disable_ro() usage in livepatch. The ultimate goal is to completely disallow making executable mappings writable. [ jpoimboe: Split up patches. Use mod state to determine whether memcpy() can be used. Implement text_poke() for UML. ] Cc: x86@kernel.org Suggested-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina commit be2422612a580e33b927d0cde7a5a3c7935b2849 Author: Peter Zijlstra Date: Wed Apr 29 10:24:48 2020 -0500 s390/module: Use s390_kernel_write() for late relocations Because of late module patching, a livepatch module needs to be able to apply some of its relocations well after it has been loaded. Instead of playing games with module_{dis,en}able_ro(), use existing text poking mechanisms to apply relocations after module loading. So far only x86, s390 and Power have HAVE_LIVEPATCH but only the first two also have STRICT_MODULE_RWX. This will allow removal of the last module_disable_ro() usage in livepatch. The ultimate goal is to completely disallow making executable mappings writable. [ jpoimboe: Split up patches. Use mod state to determine whether memcpy() can be used. Test and add fixes. ] Cc: linux-s390@vger.kernel.org Cc: Heiko Carstens Cc: Gerald Schaefer Cc: Christian Borntraeger Suggested-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Acked-by: Gerald Schaefer # s390 Signed-off-by: Jiri Kosina commit cb2cceaefb4c4dc28fc27ff1f1b2d258bfc10353 Author: Josh Poimboeuf Date: Wed Apr 29 10:24:47 2020 -0500 s390: Change s390_kernel_write() return type to match memcpy() s390_kernel_write()'s function type is almost identical to memcpy(). Change its return type to "void *" so they can be used interchangeably. Cc: linux-s390@vger.kernel.org Cc: heiko.carstens@de.ibm.com Signed-off-by: Josh Poimboeuf Acked-by: Joe Lawrence Acked-by: Miroslav Benes Acked-by: Gerald Schaefer # s390 Signed-off-by: Jiri Kosina commit ca376a9374867d09ece6f61803764fb187201294 Author: Josh Poimboeuf Date: Wed Apr 29 10:24:46 2020 -0500 livepatch: Prevent module-specific KLP rela sections from referencing vmlinux symbols Prevent module-specific KLP rela sections from referencing vmlinux symbols. This helps prevent ordering issues with module special section initializations. Presumably such symbols are exported and normal relas can be used instead. Suggested-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina commit 1d05334d2899bd3ecdf01beb53f0a70884a7f471 Author: Peter Zijlstra Date: Wed Apr 29 10:24:45 2020 -0500 livepatch: Remove .klp.arch After the previous patch, vmlinux-specific KLP relocations are now applied early during KLP module load. This means that .klp.arch sections are no longer needed for *vmlinux-specific* KLP relocations. One might think they're still needed for *module-specific* KLP relocations. If a to-be-patched module is loaded *after* its corresponding KLP module is loaded, any corresponding KLP relocations will be delayed until the to-be-patched module is loaded. If any special sections (.parainstructions, for example) rely on those relocations, their initializations (apply_paravirt) need to be done afterwards. Thus the apparent need for arch_klp_init_object_loaded() and its corresponding .klp.arch sections -- it allows some of the special section initializations to be done at a later time. But... if you look closer, that dependency between the special sections and the module-specific KLP relocations doesn't actually exist in reality. Looking at the contents of the .altinstructions and .parainstructions sections, there's not a realistic scenario in which a KLP module's .altinstructions or .parainstructions section needs to access a symbol in a to-be-patched module. It might need to access a local symbol or even a vmlinux symbol; but not another module's symbol. When a special section needs to reference a local or vmlinux symbol, a normal rela can be used instead of a KLP rela. Since the special section initializations don't actually have any real dependency on module-specific KLP relocations, .klp.arch and arch_klp_init_object_loaded() no longer have a reason to exist. So remove them. As Peter said much more succinctly: So the reason for .klp.arch was that .klp.rela.* stuff would overwrite paravirt instructions. If that happens you're doing it wrong. Those RELAs are core kernel, not module, and thus should've happened in .rela.* sections at patch-module loading time. Reverting this removes the two apply_{paravirt,alternatives}() calls from the late patching path, and means we don't have to worry about them when removing module_disable_ro(). [ jpoimboe: Rewrote patch description. Tweaked klp_init_object_loaded() error path. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina commit 7c8e2bdd5f0d990e2398ee3deafc626dd469fc2d Author: Josh Poimboeuf Date: Wed Apr 29 10:24:44 2020 -0500 livepatch: Apply vmlinux-specific KLP relocations early KLP relocations are livepatch-specific relocations which are applied to a KLP module's text or data. They exist for two reasons: 1) Unexported symbols: replacement functions often need to access unexported symbols (e.g. static functions), which "normal" relocations don't allow. 2) Late module patching: this is the ability for a KLP module to bypass normal module dependencies, such that the KLP module can be loaded *before* a to-be-patched module. This means that relocations which need to access symbols in the to-be-patched module might need to be applied to the KLP module well after it has been loaded. Non-late-patched KLP relocations are applied from the KLP module's init function. That usually works fine, unless the patched code wants to use alternatives, paravirt patching, jump tables, or some other special section which needs relocations. Then we run into ordering issues and crashes. In order for those special sections to work properly, the KLP relocations should be applied *before* the special section init code runs, such as apply_paravirt(), apply_alternatives(), or jump_label_apply_nops(). You might think the obvious solution would be to move the KLP relocation initialization earlier, but it's not necessarily that simple. The problem is the above-mentioned late module patching, for which KLP relocations can get applied well after the KLP module is loaded. To "fix" this issue in the past, we created .klp.arch sections: .klp.arch.{module}..altinstructions .klp.arch.{module}..parainstructions Those sections allow KLP late module patching code to call apply_paravirt() and apply_alternatives() after the module-specific KLP relocations (.klp.rela.{module}.{section}) have been applied. But that has a lot of drawbacks, including code complexity, the need for arch-specific code, and the (per-arch) danger that we missed some special section -- for example the __jump_table section which is used for jump labels. It turns out there's a simpler and more functional approach. There are two kinds of KLP relocation sections: 1) vmlinux-specific KLP relocation sections .klp.rela.vmlinux.{sec} These are relocations (applied to the KLP module) which reference unexported vmlinux symbols. 2) module-specific KLP relocation sections .klp.rela.{module}.{sec}: These are relocations (applied to the KLP module) which reference unexported or exported module symbols. Up until now, these have been treated the same. However, they're inherently different. Because of late module patching, module-specific KLP relocations can be applied very late, thus they can create the ordering headaches described above. But vmlinux-specific KLP relocations don't have that problem. There's nothing to prevent them from being applied earlier. So apply them at the same time as normal relocations, when the KLP module is being loaded. This means that for vmlinux-specific KLP relocations, we no longer have any ordering issues. vmlinux-referencing jump labels, alternatives, and paravirt patching will work automatically, without the need for the .klp.arch hacks. All that said, for module-specific KLP relocations, the ordering problems still exist and we *do* still need .klp.arch. Or do we? Stay tuned. Suggested-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Acked-by: Joe Lawrence Acked-by: Miroslav Benes Acked-by: Jessica Yu Signed-off-by: Jiri Kosina commit dcf550e52f567cb7a421169d2522869f9188aca5 Author: Josh Poimboeuf Date: Wed Apr 29 10:24:43 2020 -0500 livepatch: Disallow vmlinux.ko This is purely a theoretical issue, but if there were a module named vmlinux.ko, the livepatch relocation code wouldn't be able to distinguish between vmlinux-specific and vmlinux.o-specific KLP relocations. If CONFIG_LIVEPATCH is enabled, don't allow a module named vmlinux.ko. Suggested-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Acked-by: Miroslav Benes Acked-by: Joe Lawrence Signed-off-by: Jiri Kosina commit 2388777a0a5957a10b3d78677216530a9b3bd09f Author: Eric W. Biederman Date: Sun May 3 07:54:10 2020 -0500 exec: Rename flush_old_exec begin_new_exec There is and has been for a very long time been a lot more going on in flush_old_exec than just flushing the old state. After the movement of code from setup_new_exec there is a whole lot more going on than just flushing the old executables state. Rename flush_old_exec to begin_new_exec to more accurately reflect what this function does. Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit df9e4d2c4a53503a97fc08eeebdc04e3c11b4618 Author: Eric W. Biederman Date: Sun May 3 07:15:28 2020 -0500 exec: Move most of setup_new_exec into flush_old_exec The current idiom for the callers is: flush_old_exec(bprm); set_personality(...); setup_new_exec(bprm); In 2010 Linus split flush_old_exec into flush_old_exec and setup_new_exec. With the intention that setup_new_exec be what is called after the processes new personality is set. Move the code that doesn't depend upon the personality from setup_new_exec into flush_old_exec. This is to facilitate future changes by having as much code together in one function as possible. To see why it is safe to move this code please note that effectively this change moves the personality setting in the binfmt and the following three lines of code after everything except unlocking the mutexes: arch_pick_mmap_layout arch_setup_new_exec mm->task_size = TASK_SIZE The function arch_pick_mmap_layout at most sets: mm->get_unmapped_area mm->mmap_base mm->mmap_legacy_base mm->mmap_compat_base mm->mmap_compat_legacy_base which nothing in flush_old_exec or setup_new_exec depends on. The function arch_setup_new_exec only sets architecture specific state and the rest of the functions only deal in state that applies to all architectures. The last line just sets mm->task_size and again nothing in flush_old_exec or setup_new_exec depend on task_size. Ref: 221af7f87b97 ("Split 'flush_old_exec' into two functions") Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit 7d503feba0c88586b4c9f1212e9cc582c9370fa7 Author: Eric W. Biederman Date: Thu Apr 2 18:35:14 2020 -0500 exec: In setup_new_exec cache current in the local variable me At least gcc 8.3 when generating code for x86_64 has a hard time consolidating multiple calls to current aka get_current(), and winds up unnecessarily rereading %gs:current_task several times in setup_new_exec. Caching the value of current in the local variable of me generates slightly better and shorter assembly. Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit 96ecee29b0b560662ec082ee9b6f2049f2a79090 Author: Eric W. Biederman Date: Sun May 3 06:48:17 2020 -0500 exec: Merge install_exec_creds into setup_new_exec The two functions are now always called one right after the other so merge them together to make future maintenance easier. Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit 1507b7a30ad284a2a136ee79c214c0e86c62da64 Author: Eric W. Biederman Date: Thu Apr 2 18:17:50 2020 -0500 exec: Rename the flag called_exec_mmap point_of_no_return Update the comments and make the code easier to understand by renaming this flag. Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit 89826cce37542f7950e8f4b9258284805e98430c Author: Eric W. Biederman Date: Thu Apr 2 18:04:54 2020 -0500 exec: Make unlocking exec_update_mutex explict With install_exec_creds updated to follow immediately after setup_new_exec, the failure of unshare_sighand is the only code path where exec_update_mutex is held but not explicitly unlocked. Update that code path to explicitly unlock exec_update_mutex. Remove the unlocking of exec_update_mutex from free_bprm. Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit e7f7785449a1f459a4a3ca92f82f56fb054dd2b9 Author: Eric W. Biederman Date: Thu Mar 12 10:17:17 2020 -0500 binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf In 2016 Linus moved install_exec_creds immediately after setup_new_exec, in binfmt_elf as a cleanup and as part of closing a potential information leak. Perform the same cleanup for the other binary formats. Different binary formats doing the same things the same way makes exec easier to reason about and easier to maintain. Greg Ungerer reports: > I tested the the whole series on non-MMU m68k and non-MMU arm > (exercising binfmt_flat) and it all tested out with no problems, > so for the binfmt_flat changes: Tested-by: Greg Ungerer Ref: 9f834ec18def ("binfmt_elf: switch to new creds when switching to new mm") Reviewed-by: Kees Cook Reviewed-by: Greg Ungerer Signed-off-by: "Eric W. Biederman" commit 66ff14e59e8a30690755b08bc3042359703fb07a Author: Kai-Heng Feng Date: Wed May 6 01:34:21 2020 +0800 PCI/ASPM: Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges 7d715a6c1ae5 ("PCI: add PCI Express ASPM support") added the ability for Linux to enable ASPM, but for some undocumented reason, it didn't enable ASPM on links where the downstream component is a PCIe-to-PCI/PCI-X Bridge. Remove this exclusion so we can enable ASPM on these links. The Dell OptiPlex 7080 mentioned in the bugzilla has a TI XIO2001 PCIe-to-PCI Bridge. Enabling ASPM on the link leading to it allows the Intel SoC to enter deeper Package C-states, which is a significant power savings. [bhelgaas: commit log] Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207571 Link: https://lore.kernel.org/r/20200505173423.26968-1-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 9ad06ebb9ad6ec4bb707f2a4a352ad6c382b5cd5 Author: Gustavo A. R. Silva Date: Thu May 7 14:22:23 2020 -0500 ALSA: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200507192223.GA16335@embeddedor Signed-off-by: Takashi Iwai commit bb206a0869b7f1e7c853d7b94e91510c321402c7 Author: Chen Zhou Date: Thu May 7 21:26:39 2020 +0800 cxgb4: remove duplicate headers Remove duplicate headers which are included twice. Signed-off-by: Chen Zhou Signed-off-by: David S. Miller commit 14040aff5f03a09fa001b5f473ec89cb6d932862 Author: Chunming Zhou Date: Thu May 7 10:02:21 2020 +0800 MAINTAINERS: Remove me from amdgpu maintainers Glad to spend time on kernel driver in past years. I've moved to new focus in umd and couldn't commit enough time to discussions. Reviewed-by: Christian König Signed-off-by: Chunming Zhou Signed-off-by: Alex Deucher commit 3852ee795324ba7d9bc06acbc9b50eb1da2a9c7d Author: Chen Zhou Date: Thu May 7 21:50:23 2020 +0800 drm/amd/display: remove duplicate headers Remove duplicate headers which are included twice. Signed-off-by: Chen Zhou Signed-off-by: Alex Deucher commit b1c3b7f13e40bec6c5b311ce10728eb37133e19d Author: Jason Yan Date: Thu May 7 19:07:03 2020 +0800 drm/amd/display: remove variable "result" in dcn20_patch_unknown_plane_state() Fix the following coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c:3216:16-22: Unneeded variable: "result". Return "DC_OK" on line 3229 Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit ecc8c2e193088ca66c71c192b94e655c08e10e84 Author: Bernard Zhao Date: Thu May 7 02:13:05 2020 -0700 drm/amd/amdgpu: cleanup coding style a bit There is DEVICE_ATTR mechanism in separate attribute define. So this change is to use attr array, also use sysfs_create_files in init function & sysfs_remove_files in fini function. This maybe make the code a bit readable. Signed-off-by: Bernard Zhao Changes since V1: *Use DEVICE_ATTR mechanism Link for V1: *https://lore.kernel.org/patchwork/patch/1228076/ V2: make array const to fix build errors Reviewed-by: Christian König Signed-off-by: Alex Deucher commit e133020f92b9397eaad83ff1dada6d9786edcbd0 Author: Simon Ser Date: Mon Mar 30 09:23:21 2020 +0000 drm/amd/display: add basic atomic check for cursor plane This patch adds a basic cursor check when an atomic test-only commit is performed. The position and size of the cursor plane is checked. This should fix user-space relying on atomic checks to assign buffers to planes. Signed-off-by: Simon Ser Reported-by: Roman Gilg References: https://github.com/emersion/libliftoff/issues/46 Cc: Alex Deucher Cc: Harry Wentland Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit b931e199f16e1e29cb1728e8aa9d27b9f8978cb1 Author: Nicholas Kazlauskas Date: Wed May 6 15:47:54 2020 -0400 drm/amd/display: Fix vblank and pageflip event handling for FreeSync [Why] We're sending the drm vblank event a frame too early in the case where the pageflip happens close to VUPDATE and ends up blocking the signal. The implementation in DM was previously correct *before* we started sending vblank events from VSTARTUP unconditionally to handle cases where HUBP was off, OTG was ON and userspace was still requesting some DRM planes enabled. As part of that patch series we dropped VUPDATE since it was deemed close enough to VSTARTUP, but there's a key difference betweeen VSTARTUP and VUPDATE - the VUPDATE signal can be blocked if we're holding the pipe lock. There was a fix recently to revert the unconditional behavior for the DCN VSTARTUP vblank event since it was sending the pageflip event on the wrong frame - once again, due to blocking VUPDATE and having the address start scanning out two frames later. The problem with this fix is it didn't update the logic that calls drm_crtc_handle_vblank(), so the timestamps are totally bogus now. [How] Essentially reverts most of the original VSTARTUP series but retains the behavior to send back events when active planes == 0. Some refactoring/cleanup was done to not have duplicated code in both the handlers. Fixes: 16f17eda8bad ("drm/amd/display: Send vblank and user events at vsartup for DCN") Fixes: 3a2ce8d66a4b ("drm/amd/display: Disable VUpdate interrupt for DCN hardware") Fixes: 2b5aed9ac3f7 ("drm/amd/display: Fix pageflip event race condition for DCN.") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Leo Li Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 624e8c8703b5236e000f447d69d183f2c7c28355 Author: John Clements Date: Thu May 7 18:25:13 2020 +0800 drm/amdgpu: Fix bug in RAS invoke Invoke sequence should abort when ras interrupt is detected before reading TA host shared memory Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 5d9e4722c74e8868d5fe2f8749de80928eb4a1d1 Merge: 3031a86ebd3f 7f65f6118a53 Author: David S. Miller Date: Thu May 7 13:22:35 2020 -0700 Merge tag 'wireless-drivers-next-2020-05-07' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.8 First set of patches for v5.8. Changes all over, ath10k apparently seeing most new features this time. rtw88 also had lots of changes due to preparation for new hardware support. In this pull request there's also a new macro to include/linux/iopoll: read_poll_timeout_atomic(). This is needed by rtw88 for atomic polling. Major changes: ath11k * add debugfs file for testing ADDBA and DELBA * add 802.11 encapsulation offload on hardware support * add htt_peer_stats_reset debugfs file ath10k * enable VHT160 and VHT80+80 modes * enable radar detection in secondary segment * sdio: disable TX complete indication to improve throughput * sdio: decrease power consumption * sdio: add HTT TX bundle support to increase throughput * sdio: add rx bitrate reporting ath9k * improvements to AR9002 calibration logic carl9170 * remove buggy P2P_GO support p54usb * add support for AirVasT USB stick rtw88 * add support for antenna configuration ti wlcore * add support for AES_CMAC cipher iwlwifi * support for a few new FW API versions * new hw configs ==================== Signed-off-by: David S. Miller commit 3031a86ebd3f9c818486dd7433f121c27ef23188 Merge: 0932969e0b1b e42671084361 Author: David S. Miller Date: Thu May 7 13:21:12 2020 -0700 Merge branch 'Add-QRTR-MHI-client-driver' Manivannan Sadhasivam says: ==================== Add QRTR MHI client driver Here is the series adding MHI client driver support to Qualcomm IPC router protocol. MHI is a newly added bus to kernel which is used to communicate to external modems over a physical interface like PCI-E. This driver is used to transfer the QMI messages between the host processor and external modems over the "IPCR" channel. For QRTR, this driver is just another driver acting as a transport layer like SMD. Currently this driver is needed to control the QCA6390 WLAN device from ath11k. The ath11k MHI controller driver will take care of booting up QCA6390 and bringing it to operating state. Later, this driver will be used to transfer QMI messages over the MHI-IPCR channel. The second patch of this series removes the ARCH_QCOM dependency for QRTR. This is needed because the QRTR driver will be used with x86 machines as well to talk to devices like QCA6390. ==================== Signed-off-by: David S. Miller commit e42671084361302141a09284fde9bbc14fdd16bf Author: Manivannan Sadhasivam Date: Thu May 7 18:23:06 2020 +0530 net: qrtr: Do not depend on ARCH_QCOM IPC Router protocol is also used by external modems for exchanging the QMI messages. Hence, it doesn't always depend on Qualcomm platforms. One such instance is the QCA6390 WLAN device connected to x86 machine. Reviewed-by: Bjorn Andersson Signed-off-by: Manivannan Sadhasivam Signed-off-by: David S. Miller commit 6e728f321393b1fce9e1c2c3e55f9f7c15991321 Author: Manivannan Sadhasivam Date: Thu May 7 18:23:05 2020 +0530 net: qrtr: Add MHI transport layer MHI is the transport layer used for communicating to the external modems. Hence, this commit adds MHI transport layer support to QRTR for transferring the QMI messages over IPC Router. Reviewed-by: Bjorn Andersson Signed-off-by: Manivannan Sadhasivam Signed-off-by: David S. Miller commit 0932969e0b1b6ba54028b35b80148302e8fe7db8 Author: Geert Uytterhoeven Date: Thu May 7 13:42:05 2020 +0200 via-rhine: Add platform dependencies The VIA Rhine Ethernet interface is only present on PCI devices or VIA/WonderMedia VT8500/WM85xx SoCs. Add platform dependencies to the VIA_RHINE config symbol, to avoid asking the user about it when configuring a kernel without PCI or VT8500/WM85xx support. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit 571cf29644542b9e410ed102cb35ecb27b4fdfa3 Author: Po Liu Date: Thu May 7 18:57:38 2020 +0800 net:enetc: bug fix for qos sfi operate space after freed 'Dan Carpenter' reported: This code frees "sfi" and then dereferences it on the next line: > kfree(sfi); > clear_bit(sfi->index, epsfp.psfp_sfi_bitmap); This "sfi->index" should be "index". Reported-by: Dan Carpenter Signed-off-by: Po Liu Signed-off-by: David S. Miller commit 7f960633a458136d168f2049508d39cba8be55bd Author: Jason Yan Date: Thu May 7 19:09:05 2020 +0800 net: encx24j600: make encx24j600_hw_init() return void This function always return 0 now, we can make it return void to simplify the code. This fixes the following coccicheck warning: drivers/net/ethernet/microchip/encx24j600.c:609:5-8: Unneeded variable: "ret". Return "0" on line 653 Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 5a7c45097c3f63ac10def7206292b88023205a3e Author: Jason Yan Date: Thu May 7 19:08:57 2020 +0800 net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule() Fix the following coccicheck warning: drivers/net/ethernet/mellanox/mlx4/en_ethtool.c:1396:5-8: Unneeded variable: "err". Return "0" on line 1411 Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 27ad2cd2000298e5822a12012edda47d72fdb27e Author: Jason Yan Date: Thu May 7 19:08:47 2020 +0800 net: tulip: de4x5: make PCI_signature() return void This function always return 0 now, we can make it return void to simplify the code. This fixes the following coccicheck warning: drivers/net/ethernet/dec/tulip/de4x5.c:3908:11-17: Unneeded variable: "status". Return "0" on line 3912 Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit f9a98f901e19eb0fbd61c29cf38b75d210d276bc Author: Jason Yan Date: Thu May 7 19:08:36 2020 +0800 net: atheros: remove dead code in atl1c_resume() This code has been marked dead for nearly 10 years. Remove it. Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 49d4c392cc0186df5ce6f1037afe5131c56d1316 Author: Jason Yan Date: Thu May 7 19:07:41 2020 +0800 b43: remove dead function b43_rssinoise_postprocess() This function is dead for more than 10 years. Remove it. Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit e4cc4f54be01b91b3e1b55430709d2a113f4e08f Author: Arnd Bergmann Date: Wed Apr 8 21:01:15 2020 +0200 soc: tegra: Fix tegra_pmc_get_suspend_mode definition When CONFIG_PM_SLEEP is disabled, the function is not defined, causing a link failure: arm-linux-gnueabi-ld: drivers/cpuidle/cpuidle-tegra.o: in function `tegra_cpuidle_probe': cpuidle-tegra.c:(.text+0x24): undefined reference to `tegra_pmc_get_suspend_mode' Change the #ifdef check according to the definition. Fixes: 382ac8e22b90 ("cpuidle: tegra: Disable CC6 state if LP2 unavailable") Signed-off-by: Arnd Bergmann Reviewed-by: Dmitry Osipenko Acked-by: Thierry Reding Signed-off-by: Thierry Reding commit 31e2d067fd966188e47461f1b5d253405b3559fb Author: Zheng Zengkai Date: Thu May 7 16:03:26 2020 +0800 net: phy: Make iproc_mdio_resume static Fix sparse warnings: drivers/net/phy/mdio-bcm-iproc.c:182:5: warning: symbol 'iproc_mdio_resume' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zheng Zengkai Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 02ed76b6da0710a9d24f36a4a9800a68d7edb9a7 Author: Konrad Dybcio Date: Wed May 6 23:09:55 2020 +0200 drivers: drm: panel: Add ASUS TM5P5 NT35596 panel driver This adds support for TMP5P5 NT35596 1080x1920 video mode panel that can be found on some Asus Zenfone 2 Laser (Z00T) devices. This panel seems to only be found in this device and we have no straightforward way of actually getting the correct model number, as no schematics are released publicly. Signed-off-by: Konrad Dybcio Signed-off-by: Sam Ravnborg [fixed checkpatch warnings] Link: https://patchwork.freedesktop.org/patch/msgid/20200506210957.344590-2-konradybcio@gmail.com commit d3943821a0e1952aa3319cc6a4ccf937eaabebac Author: Konrad Dybcio Date: Wed May 6 23:09:56 2020 +0200 dt-bindings: display: Document ASUS Z00T TM5P5 NT35596 panel compatible Signed-off-by: Konrad Dybcio Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200506210957.344590-3-konradybcio@gmail.com commit e41b49b7e4d4ad9755af4813a57b5f6a09e357d7 Author: Randy Dunlap Date: Thu May 7 09:23:11 2020 -0700 drm: panel: add MODULE_LICENSE to panel-visionox-rm69299.c Add MODULE_LICENSE() to the panel-visionox-rm69299 driver to fix a build warning. WARNING: modpost: missing MODULE_LICENSE() in drivers/gpu/drm/panel/panel-visionox-rm69299.o Signed-off-by: Randy Dunlap Fixes: c7f66d32dd43 ("drm/panel: add support for rm69299 visionox panel") Cc: Harigovindan P Cc: Matthias Kaehlcke Cc: Thierry Reding Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sam Ravnborg [added fixes: tag] Link: https://patchwork.freedesktop.org/patch/msgid/bbb7b3b3-9968-9a1f-8ef6-2e8e3be998f6@infradead.org commit 09701895aa93df32cc708eab032ae8704feda333 Author: Jon Hunter Date: Thu May 7 11:13:48 2020 +0100 soc/tegra: pmc: Enable PMIC wake event on Tegra194 The PMIC wake event can be used to bring the system out of suspend based on certain events happening on the PMIC (such as an RTC alarm). Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 5098e2b95e8e6f56266c2d5c180c75917090082a Author: Corentin Labbe Date: Wed Mar 18 15:25:08 2020 +0000 soc/tegra: pmc: Select GENERIC_PINCONF I have hit the following build error: armv7a-hardfloat-linux-gnueabi-ld: drivers/soc/tegra/pmc.o: in function `pinconf_generic_dt_node_to_map_pin': pmc.c:(.text+0x500): undefined reference to `pinconf_generic_dt_node_to_map' armv7a-hardfloat-linux-gnueabi-ld: drivers/soc/tegra/pmc.o:(.rodata+0x1f88): undefined reference to `pinconf_generic_dt_free_map' So SOC_TEGRA_PMC should select GENERIC_PINCONF. Fixes: 4a37f11c8f57 ("soc/tegra: pmc: Implement pad configuration via pinctrl") Cc: stable Signed-off-by: Corentin Labbe Signed-off-by: Thierry Reding commit 972282c4cf2454af7dca3fec16b8f2cc72d4238c Author: Mika Kuoppala Date: Thu May 7 17:20:45 2020 +0300 drm/i915/gen12: Add aux table invalidate for all engines All engines, exception being blitter as it does not care about the form, can access compressed surfaces. So we need to add forced aux table invalidates for those engines. v2: virtual instance masking (Chris) v3: bug on if not found (Chris) References: d248b371f747 ("drm/i915/gen12: Invalidate aux table entries forcibly") References bspec#43904, hsdes#1809175790 Cc: Chris Wilson Cc: Chuansheng Liu Cc: Rafael Antognolli Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200507142045.8668-1-mika.kuoppala@linux.intel.com commit eec39e441c29dd636bbdf5390af765cd9db6b380 Author: Chris Wilson Date: Thu May 7 16:23:38 2020 +0100 drm/i915: Remove wait priority boosting Upon waiting a request (when asked), we gave that request a small priority boost, not enough for it to cause preemption, but enough for it to be scheduled next before all equals. We also used that bit to give new clients a small priority boost, similar to FQ_CODEL, such that we favoured short interactive tasks ahead of long running streams. However, this is causing lots of complications with timeslicing where we both want to honour the boost and yet ignore it. Those complications cause unexpected user behaviour (tasks not being timesliced and run concurrently as epxected), and the easiest way to resolve that is to remove the boost. Hopefully, we can find a compromise again if we need to, but in theory timeslicing itself and future more advanced schedulers should give us the interactivity boost we seek. Testcase: igt/gem_exec_schedule/lateslice Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200507152338.7452-3-chris@chris-wilson.co.uk commit 6b6cd2ebd8d071e55998e32b648bb8081f7f02bb Author: Chris Wilson Date: Thu May 7 16:51:09 2020 +0100 drm/i915: Mark concurrent submissions with a weak-dependency We recorded the dependencies for WAIT_FOR_SUBMIT in order that we could correctly perform priority inheritance from the parallel branches to the common trunk. However, for the purpose of timeslicing and reset handling, the dependency is weak -- as we the pair of requests are allowed to run in parallel and not in strict succession. The real significance though is that this allows us to rearrange groups of WAIT_FOR_SUBMIT linked requests along the single engine, and so can resolve user level inter-batch scheduling dependencies from user semaphores. Fixes: c81471f5e95c ("drm/i915: Copy across scheduler behaviour flags across submit fences") Testcase: igt/gem_exec_fence/submit Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.6+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200507155109.8892-1-chris@chris-wilson.co.uk commit 9cbcb81dc8d218bd9064505df70a28ee93b54c62 Author: Bjorn Andersson Date: Wed Apr 22 17:37:36 2020 -0700 arm64: defconfig: Remove QCOM_GLINK_SSR Remove the QCOM_GLINK_SSR option from the arm64 defconfig, as the module is assimilated by QCOM_GLINK - which is selected by other means. Acked-by: Chris Lew Acked-by: Rishabh Bhatnagar Link: https://lore.kernel.org/r/20200423003736.2027371-5-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 93bc3feee8bd5fbe29ad27779c5e7b369fd7c80b Author: Bjorn Andersson Date: Wed Apr 22 17:37:35 2020 -0700 rpmsg: glink: Integrate glink_ssr in qcom_glink In all but the very special case of a system with _only_ glink_rpm, GLINK is dependent on glink_ssr, so move it to rpmsg and combine it with qcom_glink_native in the new qcom_glink kernel module. Acked-by: Chris Lew Acked-by: Rishabh Bhatnagar Link: https://lore.kernel.org/r/20200423003736.2027371-4-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 5d1f2e3c8090c0769ee4a1b920e82277613327fc Author: Bjorn Andersson Date: Wed Apr 22 17:37:34 2020 -0700 soc: qcom: glink_ssr: Internalize ssr_notifiers Rather than carrying a special purpose blocking notifier for glink_ssr in remoteproc's qcom_common.c, move it into glink_ssr so allow wider reuse of the common one. The rpmsg glink header file is used in preparation for the next patch. Acked-by: Chris Lew Acked-by: Rishabh Bhatnagar Link: https://lore.kernel.org/r/20200423003736.2027371-3-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit cd9fc8f1b35bd75e0d33470a01baff2848a9443a Author: Bjorn Andersson Date: Wed Apr 22 17:37:33 2020 -0700 remoteproc: qcom: Pass ssr_name to glink subdevice Pass ssr_name to glink subdevice in preparation for tying glink_ssr to the glink subdevice, rather than having its own "ssr subdevice". Acked-by: Chris Lew Acked-by: Mathieu Poirier Acked-by: Rishabh Bhatnagar Link: https://lore.kernel.org/r/20200423003736.2027371-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 4f0f02cc4b5406a3dc0079722aaa01b31c5783f7 Author: Geert Uytterhoeven Date: Tue May 5 17:07:19 2020 +0200 ARM: omap2plus: Drop unneeded select of MIGHT_HAVE_CACHE_L2X0 Support for TI AM43x SoCs depends on ARCH_MULTI_V7, which selects ARCH_MULTI_V6_V7. As the latter selects MIGHT_HAVE_CACHE_L2X0, there is no need for SOC_AM43XX to select MIGHT_HAVE_CACHE_L2X0. Signed-off-by: Geert Uytterhoeven Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org Acked-by: Arnd Bergmann Acked-by: Tony Lindgren Signed-off-by: Tony Lindgren commit d307f17293226a5bf22cbe67d8b949efe143950e Author: Hans de Goede Date: Sat May 2 20:29:51 2020 +0200 platform/x86: intel-vbtn: Fix probe failure on devices with only switches On some devices the INT33D6 vbtn device is only used to report tablet-mode / docked status (switches) and there are no vbtn managed buttons. On these devices there is no VBDL object. Move the VBDL check to a intel_vbtn_has_buttons() helper and only exit from intel_vbtn_probe() with -ENODEV when there are both no buttons and no switches. Also only report the buttons being present to userspace if the has_buttons check has succeeded. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 1fac39fd0316b19c3e57a182524332332d1643ce Author: Hans de Goede Date: Sat May 2 20:29:50 2020 +0200 platform/x86: intel-vbtn: Also handle tablet-mode switch on "Detachable" and "Portable" chassis-types Commit de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") added a DMI chassis-type check to avoid accidentally reporting SW_TABLET_MODE = 1 to userspace on laptops. Some devices with a detachable keyboard and using the intel-vbnt (INT33D6) interface to report if they are in tablet mode (keyboard detached) or not, report 32 / "Detachable" as chassis-type, e.g. the HP Pavilion X2 series. Other devices with a detachable keyboard and using the intel-vbnt (INT33D6) interface to report SW_TABLET_MODE, report 8 / "Portable" as chassis-type. The Dell Venue 11 Pro 7130 is an example of this. Extend the DMI chassis-type check to also accept Portables and Detachables so that the intel-vbtn driver will report SW_TABLET_MODE on these devices. Note the chassis-type check was originally added to avoid a false-positive tablet-mode report on the Dell XPS 9360 laptop. To the best of my knowledge that laptop is using a chassis-type of 9 / "Laptop", so after this commit we still ignore the tablet-switch for that chassis-type. Fixes: de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") Signed-off-by: Hans de Goede Reviewed-by: Mario Limonciello Signed-off-by: Andy Shevchenko commit 990fbb48067bf8cfa34b7d1e6e1674eaaef2f450 Author: Hans de Goede Date: Sat May 2 20:29:49 2020 +0200 platform/x86: intel-vbtn: Do not advertise switches to userspace if they are not there Commit de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") added a DMI chassis-type check to avoid accidentally reporting SW_TABLET_MODE = 1 to userspace on laptops (specifically on the Dell XPS 9360), to avoid e.g. userspace ignoring touchpad events because userspace thought the device was in tablet-mode. But if we are not getting the initial status of the switch because the device does not have a tablet mode, then we really should not advertise the presence of a tablet-mode switch to userspace at all, as userspace may use the mere presence of this switch for certain heuristics. Fixes: de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit f6ba524970c4b73b234bf41ecd6628f5803b1559 Author: Hans de Goede Date: Sat May 2 20:29:48 2020 +0200 platform/x86: intel-vbtn: Split keymap into buttons and switches parts Split the sparse keymap into 2 separate keymaps, a buttons and a switches keymap and combine the 2 to a single map again in intel_vbtn_input_setup(). This is a preparation patch for not telling userspace that we have switches when we do not have them (and for doing the same for the buttons). Fixes: de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 18937875a231d831c309716d6d8fc358f8381881 Author: Hans de Goede Date: Sat May 2 20:29:47 2020 +0200 platform/x86: intel-vbtn: Use acpi_evaluate_integer() Use acpi_evaluate_integer() instead of open-coding it. This is a preparation patch for adding a intel_vbtn_has_switches() helper function. Fixes: de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's") Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit f736e0f1a55a88cb258b73da77463573739e9ac9 Merge: e2f3ccfa6200 6be7436d2245 e5a971d76d70 33b2b93bd831 3c80b4024579 Author: Paul E. McKenney Date: Thu May 7 10:18:32 2020 -0700 Merge branches 'fixes.2020.04.27a', 'kfree_rcu.2020.04.27a', 'rcu-tasks.2020.04.27a', 'stall.2020.04.27a' and 'torture.2020.05.07a' into HEAD fixes.2020.04.27a: Miscellaneous fixes. kfree_rcu.2020.04.27a: Changes related to kfree_rcu(). rcu-tasks.2020.04.27a: Addition of new RCU-tasks flavors. stall.2020.04.27a: RCU CPU stall-warning updates. torture.2020.05.07a: Torture-test updates. commit 409f3aed82d37b6e69645f3ba1ccb9abe91a5d57 Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: toshiba_acpi: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the similar check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit 3c80b4024579150ddb8ddd6fd7b110ba192aca3b Author: Paul E. McKenney Date: Fri Apr 10 15:37:12 2020 -0700 rcutorture: Convert ULONG_CMP_LT() to time_before() This commit converts three ULONG_CMP_LT() invocations in rcutorture to time_before() to reflect the fact that they are comparing timestamps to the jiffies counter. Signed-off-by: Paul E. McKenney commit 04dbcdb42f3aecbd14dad90f265b7a77c7bd1894 Author: Paul E. McKenney Date: Thu Apr 9 17:14:18 2020 -0700 torture: Add a --kasan argument Make it a bit easier to apply KASAN to rcutorture runs with a new --kasan argument, again leveraging the config_override_param() bash function. Signed-off-by: Paul E. McKenney commit 409670aa26b6a8c9c0fb34eb7a887b9fedc6952b Author: Paul E. McKenney Date: Thu Apr 9 16:58:00 2020 -0700 torture: Save a few lines by using config_override_param initially This commit saves a few lines of code by also using the bash config_override_param() to set the initial list of Kconfig options from the CFcommon file. While in the area, it makes this function capable of update-in-place on the file containing the cumulative Kconfig options, thus avoiding annoying changes when adding another source of options. Signed-off-by: Paul E. McKenney commit 5b6b4b69ad6494733dafa090c09dd80eda741d1f Author: Paul E. McKenney Date: Thu Apr 9 16:38:20 2020 -0700 torture: Allow scenario-specific Kconfig options to override CFcommon This commit applies config_override_param() to allow scenario-specific Kconfig options to override those in CFcommon. This in turn will allow additional Kconfig options to be placed in CFcommon, for example, an option common to all but a few scenario can be placed in CFcommon and then overridden in those few scenarios. Plus this change saves one whole line of code. Signed-off-by: Paul E. McKenney commit 3d17ded9021e3ad949021619e5fc6da81bc6d6d0 Author: Paul E. McKenney Date: Thu Apr 9 16:10:36 2020 -0700 torture: Allow --kconfig options to override --kcsan defaults Currently, attempting to override a --kcsan default with a --kconfig option might or might not work. However, it would be good to allow the user to adjust the --kcsan defaults, for example, to specify a different time for CONFIG_KCSAN_REPORT_ONCE_IN_MS. This commit therefore uses the new config_override_param() bash function to apply the --kcsan defaults and then apply the --kconfig options, which allows this overriding to occur. Signed-off-by: Paul E. McKenney commit 6be63d7d9c149143a9af19085516ddba6ab6a2af Author: Paul E. McKenney Date: Thu Apr 9 16:02:23 2020 -0700 torture: Abstract application of additional Kconfig options This commit introduces a config_override_param() bash function that folds in an additional set of Kconfig options. This is initially applied to fold in the --kconfig kvm.sh parameter, but later commits will also apply it to the Kconfig options added by the --kcsan kvm.sh parameter. Signed-off-by: Paul E. McKenney commit b5744d3c6c38a44e14894bc3ee17b98885e4852f Author: Paul E. McKenney Date: Thu Apr 9 15:32:56 2020 -0700 torture: Eliminate duplicate #CHECK# from ConfigFragment The #CHECK# directives that can be present in CFcommon and in the rcutorture scenario Kconfig files are both copied to ConfigFragment and grepped out of the two directive files and added to ConfigFragment. This commit therefore removes the redundant "grep" commands and takes advantage of the consequent opportunity to simplify redirection. Signed-off-by: Paul E. McKenney commit afbc1574f1da13d2fd2b30a96090b37c5933f957 Author: Jason Yan Date: Thu Apr 9 19:42:38 2020 +0800 rcutorture: Make rcu_fwds and rcu_fwd_emergency_stop static This commit fixes the following sparse warning: kernel/rcu/rcutorture.c:1695:16: warning: symbol 'rcu_fwds' was not declared. Should it be static? kernel/rcu/rcutorture.c:1696:6: warning: symbol 'rcu_fwd_emergency_stop' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Paul E. McKenney commit 10cec0de11ab585e9a4f08357be4b5bf56bfc3a9 Author: Paul E. McKenney Date: Thu Apr 9 10:29:32 2020 -0700 torture: Make --kcsan argument also create a summary The KCSAN tool emits a great many warnings for current kernels, for example, a one-hour run of the full set of rcutorture scenarios results in no fewer than 3252 such warnings, many of which are duplicates or are otherwise closely related. This commit therefore introduces a kcsan-collapse.sh script that maps these warnings down to a set of function pairs (22 of them given the 3252 individual warnings), placing the resulting list in decreasing order of frequency of occurrence into a kcsan.sum file. If any KCSAN warnings were produced, the pathname of this file is emitted at the end of the summary of the rcutorture runs. Signed-off-by: Paul E. McKenney commit 7226c5cbaa9ffb47259e34468bd0122238545d62 Author: Paul E. McKenney Date: Tue Apr 7 17:31:35 2020 -0700 torture: Add --kcsan argument to top-level kvm.sh script Although the existing --kconfig argument can be used to run KCSAN for an rcutorture test, it is not as straightforward as one might like: --kconfig "CONFIG_DEBUG_INFO=y CONFIG_KCSAN=y \ CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC=n \ CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=n \ CONFIG_KCSAN_REPORT_ONCE_IN_MS=100000 \ CONFIG_KCSAN_VERBOSE=y CONFIG_KCSAN_INTERRUPT_WATCHER=y" This commit therefore adds a "--kcsan" argument that emulates the above --kconfig command. Note that if you specify a Kconfig option using -kconfig that conflicts with one that --kcsan adds, you get whatever the script and the build system decide to give you. Cc: Marco Elver Signed-off-by: Paul E. McKenney commit 55b2dcf58700041d6f0b037a98619222c825f004 Author: Paul E. McKenney Date: Wed Apr 1 19:57:52 2020 -0700 rcu: Allow rcutorture to starve grace-period kthread This commit provides an rcutorture.stall_gp_kthread module parameter to allow rcutorture to starve the grace-period kthread. This allows testing the code that detects such starvation. Signed-off-by: Paul E. McKenney commit df5916845dd6ee34ce40aaad5e7b61058720419c Author: Paul E. McKenney Date: Mon Mar 30 10:42:30 2020 -0700 rcutorture: Right-size TREE10 CPU consumption The number of CPUs is tuned to allow "4*CFLIST TREE10" on a large system, up from "3*CFLIST TREE10" previously. Signed-off-by: Paul E. McKenney commit 19a8ff956c5abaaedfae23b8a951dd2d725a2171 Author: Paul E. McKenney Date: Wed Mar 11 17:39:12 2020 -0700 rcutorture: Add flag to produce non-busy-wait task stalls This commit aids testing of RCU task stall warning messages by adding an rcutorture.stall_cpu_block module parameter that results in the induced stall sleeping within the RCU read-side critical section. Spinning with interrupts disabled is still available via the rcutorture.stall_cpu_irqsoff module parameter, and specifying neither of these two module parameters will spin with preemption disabled. Note that sleeping (as opposed to preemption) results in additional complaints from RCU at context-switch time, so yet more testing. Signed-off-by: Paul E. McKenney commit 41f800466f0e284cb1dce91e27f9506165f67d65 Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: thinkpad_acpi: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the similar check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit a87406c554d11e8ec4830cc5d646c7d4df71eb0b Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: samsung-laptop: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the very same check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit 410a772419bf7d5641ecb7c75a91d9768be2dbdb Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: lg-laptop: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the similar check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit bf740a905ffedda60d2dacbfa0c3aca81490fda1 Author: Mark Brown Date: Wed May 6 20:51:38 2020 +0100 arm64: vdso: Map the vDSO text with guarded pages when built for BTI The kernel is responsible for mapping the vDSO into userspace processes, including mapping the text section as executable. Handle the mapping of the vDSO for BTI similarly, mapping the text section as guarded pages so the BTI annotations in the vDSO become effective when they are present. This will mean that we can have BTI active for the vDSO in processes that do not otherwise support BTI. This should not be an issue for any expected use of the vDSO. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-12-broonie@kernel.org Signed-off-by: Will Deacon commit 5e02a1887fce5108eb8ffe7957f66f3c4e0fded9 Author: Mark Brown Date: Wed May 6 20:51:37 2020 +0100 arm64: vdso: Force the vDSO to be linked as BTI when built for BTI When the kernel and hence vDSO are built with BTI enabled force the linker to link the vDSO as BTI. This will cause the linker to warn if any of the input files do not have the BTI annotation, ensuring that we don't silently fail to provide a vDSO that is built and annotated for BTI when the kernel is being built with BTI. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-11-broonie@kernel.org Signed-off-by: Will Deacon commit a6aadc28278a05f394c9353460ec74610ddf7ac6 Author: Mark Brown Date: Wed May 6 20:51:36 2020 +0100 arm64: vdso: Annotate for BTI Generate BTI annotations for all assembly files included in the 64 bit vDSO. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-10-broonie@kernel.org Signed-off-by: Will Deacon commit 3a9b136c998fc990cbde1a3cbc343050de704d6b Author: Mark Brown Date: Wed May 6 20:51:35 2020 +0100 arm64: asm: Provide a mechanism for generating ELF note for BTI ELF files built for BTI should have a program property note section which identifies them as such. The linker expects to find this note in all object files it is linking into a BTI annotated output, the compiler will ensure that this happens for C files but for assembler files we need to do this in the source so provide a macro which can be used for this purpose. To support likely future requirements for additional notes we split the defininition of the flags to set for BTI code from the macro that creates the note itself. This is mainly for use in the vDSO which should be a normal ELF shared library and should therefore include BTI annotations when built for BTI. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200506195138.22086-9-broonie@kernel.org Signed-off-by: Will Deacon commit 97fed779f2a68937d9590fbbe8ed31d6ebbce5a5 Author: Mark Brown Date: Wed May 6 20:51:34 2020 +0100 arm64: bti: Provide Kconfig for kernel mode BTI Now that all the code is in place provide a Kconfig option allowing users to enable BTI for the kernel if their toolchain supports it, defaulting it on since this has security benefits. This is a separate configuration option since we currently don't support secondary CPUs that lack BTI if the boot CPU supports it. Code generation issues mean that current GCC 9 versions are not able to produce usable BTI binaries so we disable support for building with GCC versions prior to 10, once a fix is backported to GCC 9 the dependencies will be updated. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-8-broonie@kernel.org Signed-off-by: Will Deacon commit 67d4a1cd09765db92581dbce8438305ea0e06004 Author: Mark Brown Date: Wed May 6 20:51:33 2020 +0100 arm64: mm: Mark executable text as guarded pages When the kernel is built for BTI and running on a system which supports make all executable text guarded pages to ensure that loadable module and JITed BPF code is protected by BTI. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-7-broonie@kernel.org Signed-off-by: Will Deacon commit fa76cfe65c1d748ef418e930a4b631a03b28f04c Author: Mark Brown Date: Wed May 6 20:51:32 2020 +0100 arm64: bpf: Annotate JITed code for BTI In order to extend the protection offered by BTI to all code executing in kernel mode we need to annotate JITed BPF code appropriately for BTI. To do this we need to add a landing pad to the start of each BPF function and also immediately after the function prologue if we are emitting a function which can be tail called. Jumps within BPF functions are all to immediate offsets and therefore do not require landing pads. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-6-broonie@kernel.org Signed-off-by: Will Deacon commit c8027285e3660e3b76eb2fb75a32f1596064b5e4 Author: Mark Brown Date: Wed May 6 20:51:31 2020 +0100 arm64: Set GP bit in kernel page tables to enable BTI for the kernel Now that the kernel is built with BTI annotations enable the feature by setting the GP bit in the stage 1 translation tables. This is done based on the features supported by the boot CPU so that we do not need to rewrite the translation tables. In order to avoid potential issues on big.LITTLE systems when there are a mix of BTI and non-BTI capable CPUs in the system when we have enabled kernel mode BTI we change BTI to be a _STRICT_BOOT_CPU_FEATURE when we have kernel BTI. This will prevent any CPUs that don't support BTI being started if the boot CPU supports BTI rather than simply not using BTI as we do when supporting BTI only in userspace. The main concern is the possibility of BTYPE being preserved by a CPU that does not implement BTI when a thread is migrated to it resulting in an incorrect state which could generate an exception when the thread migrates back to a CPU that does support BTI. If we encounter practical systems which mix BTI and non-BTI CPUs we will need to revisit this implementation. Since we currently do not generate landing pads in the BPF JIT we only map the base kernel text in this way. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-5-broonie@kernel.org Signed-off-by: Will Deacon commit 714a8d02ca4da1479bf0b778fc1951dc88515c3d Author: Mark Brown Date: Wed May 6 20:51:30 2020 +0100 arm64: asm: Override SYM_FUNC_START when building the kernel with BTI When the kernel is built for BTI override SYM_FUNC_START and related macros to add a BTI landing pad to the start of all global functions, ensuring that they are BTI safe. The ; at the end of the BTI_x macros is for the benefit of the macro-generated functions in xen-hypercall.S. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-4-broonie@kernel.org Signed-off-by: Will Deacon commit 92e2294d870bc9e77592c2454f565c3bd6bb79ad Author: Mark Brown Date: Wed May 6 20:51:29 2020 +0100 arm64: bti: Support building kernel C code using BTI When running with BTI enabled we need to ask the compiler to enable generation of BTI landing pads beyond those generated as a result of pointer authentication instructions being landing pads. Since the two features are practically speaking unlikely to be used separately we will make kernel mode BTI depend on pointer authentication in order to simplify the Makefile. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20200506195138.22086-3-broonie@kernel.org Signed-off-by: Will Deacon commit 717b938e22f8dbf0c02d51cb8e74634fac9b57ef Author: Mark Brown Date: Wed May 6 20:51:28 2020 +0100 arm64: Document why we enable PAC support for leaf functions Document the fact that we enable pointer authentication protection for leaf functions since there is some narrow potential for ROP protection benefits and little overhead has been observed. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200506195138.22086-2-broonie@kernel.org Signed-off-by: Will Deacon commit e257dd340f2723be1a28d41e1a66d589ec3d914c Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: eeepc-laptop: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the very same check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit 2225dba20529fb71f0a7716b47b6123d521f103b Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: asus-wmi: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the very same check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit 55523abaa85f61ba1414278c81aa9c8674a03e6d Author: Andy Shevchenko Date: Thu May 7 19:37:23 2020 +0300 platform/x86: asus-laptop: Drop duplicate check for led_classdev_unregister() led_classdev_unregister() already has the very same check, so, drop a duplicate in the driver. Signed-off-by: Andy Shevchenko commit e2abfc0448a46d8a137505aa180caf14070ec535 Author: Kim Phillips Date: Fri Apr 17 09:33:56 2020 -0500 x86/cpu/amd: Make erratum #1054 a legacy erratum Commit 21b5ee59ef18 ("x86/cpu/amd: Enable the fixed Instructions Retired counter IRPERF") mistakenly added erratum #1054 as an OS Visible Workaround (OSVW) ID 0. Erratum #1054 is not OSVW ID 0 [1], so make it a legacy erratum. There would never have been a false positive on older hardware that has OSVW bit 0 set, since the IRPERF feature was not available. However, save a couple of RDMSR executions per thread, on modern system configurations that correctly set non-zero values in their OSVW_ID_Length MSRs. [1] Revision Guide for AMD Family 17h Models 00h-0Fh Processors. The revision guide is available from the bugzilla link below. Fixes: 21b5ee59ef18 ("x86/cpu/amd: Enable the fixed Instructions Retired counter IRPERF") Reported-by: Andrew Cooper Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200417143356.26054-1-kim.phillips@amd.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 commit 5a897e3ab42942e0fff51738357b1e0f91690dcf Author: Sudeep Holla Date: Thu May 7 15:49:05 2020 +0100 firmware: arm_scmi: fix psci dependency When CONFIG_ARM_PSCI_FW is disabled but CONFIG_HAVE_ARM_SMCCC is enabled, arm-scmi runs into a link failure: arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/smc.o: in function `smc_send_message': smc.c:(.text+0x200): undefined reference to `arm_smccc_1_1_get_conduit' Change from HAVE_ARM_SMCCC to ARM_PSCI_FW config dependency for now. We rely on PSCI bindings anyways for the conduit and this should be fine. Link: https://lore.kernel.org/r/20200507144905.11397-1-sudeep.holla@arm.com Fixes: 1dc6558062da ("firmware: arm_scmi: Add smc/hvc transport") Signed-off-by: Sudeep Holla commit c199507993ede3f63d0deae7e2cbc2f5462c6452 Author: Brian Foster Date: Wed May 6 13:29:20 2020 -0700 xfs: remove unused iget_flags param from xfs_imap_to_bp() iget_flags is unused in xfs_imap_to_bp(). Remove the parameter and fix up the callers. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit 28d84620797e04e983bcd515ac0a6146396b0e31 Author: Brian Foster Date: Wed May 6 13:29:19 2020 -0700 xfs: remove unused shutdown types Both types control shutdown messaging and neither is used in the current codebase. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit 7376d74547344598008d00419eae0caa5f50f4f0 Author: Brian Foster Date: Wed May 6 13:29:19 2020 -0700 xfs: random buffer write failure errortag Introduce an error tag to randomly fail async buffer writes. This is primarily to facilitate testing of the XFS error configuration mechanism. Signed-off-by: Brian Foster Reviewed-by: Allison Collins Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 88fc187984c968c02b3b41b27049e52a70b2d941 Author: Brian Foster Date: Wed May 6 13:27:40 2020 -0700 xfs: remove unused iflush stale parameter The stale parameter was used to control the now unused shutdown parameter of xfs_trans_ail_remove(). Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Reviewed-by: Allison Collins Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2b3cf09356d54711b6afdc7694b382c379ea42c4 Author: Brian Foster Date: Wed May 6 13:27:04 2020 -0700 xfs: combine xfs_trans_ail_[remove|delete]() Now that the functions and callers of xfs_trans_ail_[remove|delete]() have been fixed up appropriately, the only difference between the two is the shutdown behavior. There are only a few callers of the _remove() variant, so make the shutdown conditional on the parameter and combine the two functions. Suggested-by: Dave Chinner Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit 6af0479d8b6b162b7f006581553705521af9984b Author: Brian Foster Date: Wed May 6 13:25:50 2020 -0700 xfs: drop unused shutdown parameter from xfs_trans_ail_remove() The shutdown parameter of xfs_trans_ail_remove() is no longer used. The remaining callers use it for items that legitimately might not be in the AIL or from contexts where AIL state has already been checked. Remove the unnecessary parameter and fix up the callers. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit 655879290c28bc5678a30a7b41c9b61f4f7f90c2 Author: Brian Foster Date: Wed May 6 13:25:23 2020 -0700 xfs: use delete helper for items expected to be in AIL Various intent log items call xfs_trans_ail_remove() with a log I/O error shutdown type, but this helper historically checks whether an item is in the AIL before calling xfs_trans_ail_delete(). This means the shutdown check is essentially a no-op for users of xfs_trans_ail_remove(). It is possible that some items might not be AIL resident when the AIL remove attempt occurs, but this should be isolated to cases where the filesystem has already shutdown. For example, this includes abort of the transaction committing the intent and I/O error of the iclog buffer committing the intent to the log. Therefore, update these callsites to use xfs_trans_ail_delete() to provide AIL state validation for the common path of items being released and removed when associated done items commit to the physical log. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit 849274c103aeb149f23a81ba4a6bab42a5d77a78 Author: Brian Foster Date: Wed May 6 13:25:23 2020 -0700 xfs: acquire ->ail_lock from xfs_trans_ail_delete() Several callers acquire the lock just prior to the call. Callers that require ->ail_lock for other purposes already check IN_AIL state and thus don't require the additional shutdown check in the helper. Push the lock down into xfs_trans_ail_delete(), open code the instances that still acquire it, and remove the unnecessary ailp parameter. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit b707fffda6a3e1d0a46fceaa4c3f6c06b90f448a Author: Brian Foster Date: Wed May 6 13:25:22 2020 -0700 xfs: abort consistently on dquot flush failure The dquot flush handler effectively aborts the dquot flush if the filesystem is already shut down, but doesn't actually shut down if the flush fails. Update xfs_qm_dqflush() to consistently abort the dquot flush and shutdown the fs if the flush fails with an unexpected error. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Reviewed-by: Allison Collins Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 629dcb38dc351947ed6a26a997d4b587f3bd5c7e Author: Brian Foster Date: Wed May 6 13:25:22 2020 -0700 xfs: fix duplicate verification from xfs_qm_dqflush() The pre-flush dquot verification in xfs_qm_dqflush() duplicates the read verifier by checking the dquot in the on-disk buffer. Instead, verify the in-core variant before it is flushed to the buffer. Fixes: 7224fa482a6d ("xfs: add full xfs_dqblk verifier") Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 61948b6fb276ad95ad63f82863e607719a31a628 Author: Brian Foster Date: Wed May 6 13:25:21 2020 -0700 xfs: ratelimit unmount time per-buffer I/O error alert At unmount time, XFS emits an alert for every in-core buffer that might have undergone a write error. In practice this behavior is probably reasonable given that the filesystem is likely short lived once I/O errors begin to occur consistently. Under certain test or otherwise expected error conditions, this can spam the logs and slow down the unmount. Now that we have a ratelimit mechanism specifically for buffer alerts, reuse it for the per-buffer alerts in xfs_wait_buftarg(). Also lift the final repair message out of the loop so it always prints and assert that the metadata error handling code has shut down the fs. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit f9bccfcc3b59b9aba64791ab3a2bfefe681ab75b Author: Brian Foster Date: Wed May 6 13:25:21 2020 -0700 xfs: refactor ratelimited buffer error messages into helper XFS has some inconsistent log message rate limiting with respect to buffer alerts. The metadata I/O error notification uses the generic ratelimited alert, the buffer push code uses a custom rate limit and the similar quiesce time failure checks are not rate limited at all (when they should be). The custom rate limit defined in the buf item code is specifically crafted for buffer alerts. It is more aggressive than generic rate limiting code because it must accommodate a high frequency of I/O error events in a relative short timeframe. Factor out the custom rate limit state from the buf item code into a per-buftarg rate limit so various alerts are limited based on the target. Define a buffer alert helper function and use it for the buffer alerts that are already ratelimited. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit b6983e80b03bd4fd42de71993b3ac7403edac758 Author: Brian Foster Date: Wed May 6 13:25:20 2020 -0700 xfs: reset buffer write failure state on successful completion The buffer write failure flag is intended to control the internal write retry that XFS has historically implemented to help mitigate the severity of transient I/O errors. The flag is set when a buffer is resubmitted from the I/O completion path due to a previous failure. It is checked on subsequent I/O completions to skip the internal retry and fall through to the higher level configurable error handling mechanism. The flag is cleared in the synchronous and delwri submission paths and also checked in various places to log write failure messages. There are a couple minor problems with the current usage of this flag. One is that we issue an internal retry after every submission from xfsaild due to how delwri submission clears the flag. This results in double the expected or configured number of write attempts when under sustained failures. Another more subtle issue is that the flag is never cleared on successful I/O completion. This can cause xfs_wait_buftarg() to suggest that dirty buffers are being thrown away due to the existence of the flag, when the reality is that the flag might still be set because the write succeeded on the retry. Clear the write failure flag on successful I/O completion to address both of these problems. This means that the internal retry attempt occurs once since the last time a buffer write failed and that various other contexts only see the flag set when the immediately previous write attempt has failed. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Signed-off-by: Darrick J. Wong commit 15fab3b9be2255be70ba1c598a11622fa03c9d5e Author: Brian Foster Date: Wed May 6 13:25:20 2020 -0700 xfs: remove unnecessary shutdown check from xfs_iflush() The shutdown check in xfs_iflush() duplicates checks down in the buffer code. If the fs is shut down, xfs_trans_read_buf_map() always returns an error and falls into the same error path. Remove the unnecessary check along with the warning in xfs_imap_to_bp() that generates excessive noise in the log if the fs is shut down. Signed-off-by: Brian Foster Reviewed-by: Allison Collins Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f20192991d791293ccb7f6a073bb28de572f799a Author: Brian Foster Date: Wed May 6 13:25:20 2020 -0700 xfs: simplify inode flush error handling The inode flush code has several layers of error handling between the inode and cluster flushing code. If the inode flush fails before acquiring the backing buffer, the inode flush is aborted. If the cluster flush fails, the current inode flush is aborted and the cluster buffer is failed to handle the initial inode and any others that might have been attached before the error. Since xfs_iflush() is the only caller of xfs_iflush_cluster(), the error handling between the two can be condensed in the top-level function. If we update xfs_iflush_int() to always fall through to the log item update and attach the item completion handler to the buffer, any errors that occur after the first call to xfs_iflush_int() can be handled with a buffer I/O failure. Lift the error handling from xfs_iflush_cluster() into xfs_iflush() and consolidate with the existing error handling. This also replaces the need to release the buffer because failing the buffer with XBF_ASYNC drops the current reference. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Allison Collins Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 54b3b1f619efbc838870735db2ddde9450f93a8f Author: Brian Foster Date: Wed May 6 13:25:19 2020 -0700 xfs: factor out buffer I/O failure code We use the same buffer I/O failure code in a few different places. It's not much code, but it's not necessarily self-explanatory. Factor it into a helper and document it in one place. Signed-off-by: Brian Foster Reviewed-by: Allison Collins Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit cb6ad0993eb8973533235de8a35aa4b9c872d733 Author: Brian Foster Date: Wed May 6 13:25:19 2020 -0700 xfs: refactor failed buffer resubmission into xfsaild Flush locked log items whose underlying buffers fail metadata writeback are tagged with a special flag to indicate that the flush lock is already held. This is currently implemented in the type specific ->iop_push() callback, but the processing required for such items is not type specific because we're only doing basic state management on the underlying buffer. Factor the failed log item handling out of the inode and dquot ->iop_push() callbacks and open code the buffer resubmit helper into a single helper called from xfsaild_push_item(). This provides a generic mechanism for handling failed metadata buffer writeback with a bit less code. Signed-off-by: Brian Foster Reviewed-by: Allison Collins Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 781c036b678c9ae978efb5f89311d0b5e6748b10 Author: Kaixu Xia Date: Mon Apr 13 12:24:22 2020 +0800 ext4: remove unnecessary test_opt for DIOREAD_NOLOCK The DIOREAD_NOLOCK flag has been cleared when doing the test_opt that is meaningless, so remove the unnecessary test_opt for DIOREAD_NOLOCK. Signed-off-by: Kaixu Xia Link: https://lore.kernel.org/r/1586751862-19437-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Theodore Ts'o commit 2b6c6f0716322fc51332e8fa1c40e2d68f289bec Author: Jason Yan Date: Wed May 6 22:03:52 2020 +0800 bpf, i386: Remove unneeded conversion to bool The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: arch/x86/net/bpf_jit_comp32.c:1478:50-55: WARNING: conversion to bool not needed here arch/x86/net/bpf_jit_comp32.c:1479:50-55: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200506140352.37154-1-yanaijie@huawei.com commit 1137a96f9b5a8615296bd319151896c859ead292 Author: Jason Yan Date: Thu May 7 19:06:49 2020 +0800 kgdb: Return true in kgdb_nmi_poll_knock() Fix the following coccicheck warning: include/linux/kgdb.h:301:54-55: WARNING: return of 0/1 in function 'kgdb_nmi_poll_knock' with return type bool Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200507110649.37426-1-yanaijie@huawei.com Signed-off-by: Daniel Thompson commit a13502073638a0b28d84099fa985971fe3287aee Author: Andy Shevchenko Date: Wed May 6 18:17:27 2020 +0300 kgdb: Drop malformed kernel doc comment Kernel doc does not understand POD variables to be referred to. .../debug_core.c:73: warning: cannot understand function prototype: 'int kgdb_connected; ' Convert kernel doc to pure comment. Fixes: dc7d55270521 ("kgdb: core") Cc: Jason Wessel Signed-off-by: Andy Shevchenko Reviewed-by: Douglas Anderson Signed-off-by: Daniel Thompson commit 3fec4aecb311995189217e64d725cfe84a568de3 Author: Daniel Thompson Date: Wed May 6 17:42:23 2020 +0100 kgdb: Fix spurious true from in_dbg_master() Currently there is a small window where a badly timed migration could cause in_dbg_master() to spuriously return true. Specifically if we migrate to a new core after reading the processor id and the previous core takes a breakpoint then we will evaluate true if we read kgdb_active before we get the IPI to bring us to halt. Fix this by checking irqs_disabled() first. Interrupts are always disabled when we are executing the kgdb trap so this is an acceptable prerequisite. This also allows us to replace raw_smp_processor_id() with smp_processor_id() since the short circuit logic will prevent warnings from PREEMPT_DEBUG. Fixes: dcc7871128e9 ("kgdb: core changes to support kdb") Suggested-by: Will Deacon Link: https://lore.kernel.org/r/20200506164223.2875760-1-daniel.thompson@linaro.org Reviewed-by: Douglas Anderson Signed-off-by: Daniel Thompson commit cec5f268cd02d25d2d74807843d8ae0292fe0fb7 Author: Kyung Min Park Date: Fri Apr 24 12:37:56 2020 -0700 x86/delay: Introduce TPAUSE delay TPAUSE instructs the processor to enter an implementation-dependent optimized state. The instruction execution wakes up when the time-stamp counter reaches or exceeds the implicit EDX:EAX 64-bit input value. The instruction execution also wakes up due to the expiration of the operating system time-limit or by an external interrupt or exceptions such as a debug exception or a machine check exception. TPAUSE offers a choice of two lower power states: 1. Light-weight power/performance optimized state C0.1 2. Improved power/performance optimized state C0.2 This way, it can save power with low wake-up latency in comparison to spinloop based delay. The selection between the two is governed by the input register. TPAUSE is available on processors with X86_FEATURE_WAITPKG. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Kyung Min Park Signed-off-by: Thomas Gleixner Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/1587757076-30337-4-git-send-email-kyung.min.park@intel.com commit 46f90c7aad62be1af76588108c730d826308a801 Author: Kyung Min Park Date: Fri Apr 24 12:37:55 2020 -0700 x86/delay: Refactor delay_mwaitx() for TPAUSE support Refactor code to make it easier to add a new model specific function to delay for a number of cycles. No functional change. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Kyung Min Park Signed-off-by: Thomas Gleixner Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/1587757076-30337-3-git-send-email-kyung.min.park@intel.com commit e8824890249355656968d8846908a313fe231f11 Author: Thomas Gleixner Date: Fri Apr 24 12:37:54 2020 -0700 x86/delay: Preparatory code cleanup The naming conventions in the delay code are confusing at best. All delay variants use a loops argument and or variable which originates from the original delay_loop() implementation. But all variants except delay_loop() are based on TSC cycles. Rename the argument to cycles and make it type u64 to avoid these weird expansions to u64 in the functions. Rename MWAITX_MAX_LOOPS to MWAITX_MAX_WAIT_CYCLES for the same reason and fixup the comment of delay_mwaitx() as well. Mark the delay_fn function pointer __ro_after_init and fixup the comment for it. No functional change and preparation for the upcoming TPAUSE based delay variant. [ Kyung Min Park: Added __init to use_tsc_delay() ] Signed-off-by: Thomas Gleixner Signed-off-by: Kyung Min Park Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/1587757076-30337-2-git-send-email-kyung.min.park@intel.com commit 7e9f5e6629f62865e67b8a02a5b522dd9af890bd Author: Vincenzo Frascino Date: Thu May 7 11:40:49 2020 +0100 arm64: vdso: Add --eh-frame-hdr to ldflags LLVM's unwinder depends on the .eh_frame_hdr being present for unwinding. However, when compiling Linux with GCC, the section is not present in the vdso library object and when compiling with Clang, it is present, but it has zero length. With GCC the problem was not spotted because libgcc unwinder does not require the .eh_frame_hdr section to be present. Add --eh-frame-hdr to ldflags to correctly generate and populate the section for both GCC and LLVM. Fixes: 28b1a824a4f44 ("arm64: vdso: Substitute gettimeofday() with C implementation") Reported-by: Tamas Zsoldos Signed-off-by: Vincenzo Frascino Tested-by: Tamas Zsoldos Cc: Will Deacon Cc: Catalin Marinas Link: https://lore.kernel.org/r/20200507104049.47834-1-vincenzo.frascino@arm.com Signed-off-by: Will Deacon commit 2981cf836127c2d2d68399d456d2c22688d520b2 Author: Christoph Hellwig Date: Mon May 4 19:15:27 2020 +0200 x86/platform/uv: Remove the unused _uv_cpu_blade_processor_id() macro No users anywhere in the kernel tree. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-12-hch@lst.de commit 479d6d904557b774c1bd5b0338d8111dd2b322ee Author: Christoph Hellwig Date: Mon May 4 19:15:26 2020 +0200 x86/platform/uv: Unexport uv_apicid_hibits This variable is not used by modular code. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200504171527.2845224-11-hch@lst.de commit fbe1d37866d249b6936cf526592957725a941f95 Author: Christoph Hellwig Date: Mon May 4 19:15:25 2020 +0200 x86/platform/uv: Remove _uv_hub_info_check() Neither this functions nor the helpers used to implement it are used anywhere in the kernel tree. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-10-hch@lst.de commit 8e77554580250f1185cffd8d3ac6a9b01de05d60 Author: Christoph Hellwig Date: Mon May 4 19:15:24 2020 +0200 x86/platform/uv: Simplify uv_send_IPI_one() Merge two helpers only used by uv_send_IPI_one() into the main function. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-9-hch@lst.de commit 8263b059379c4a95fe0181db1e5a2e9c2229d929 Author: Christoph Hellwig Date: Mon May 4 19:15:23 2020 +0200 x86/platform/uv: Mark uv_min_hub_revision_id static This variable is only used inside x2apic_uv_x and not even declared in a header. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-8-hch@lst.de commit e4dd8b8351264fb5bef30c0a77e4d171e0603d63 Author: Christoph Hellwig Date: Mon May 4 19:15:22 2020 +0200 x86/platform/uv: Mark is_uv_hubless() static is_uv_hubless() is only used in x2apic_uv_x.c. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-7-hch@lst.de commit cc1991058705a9cc4fe51ab6c2116df17922ef82 Author: Christoph Hellwig Date: Mon May 4 19:15:21 2020 +0200 x86/platform/uv: Remove the UV*_HUB_IS_SUPPORTED macros All of the macros are always defined to one. Remove them and the dead code keyed off them. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-6-hch@lst.de commit 2bd04b6fe4fc46f3a358b62deac4912e778f36a4 Author: Christoph Hellwig Date: Mon May 4 19:15:20 2020 +0200 x86/platform/uv: Unexport symbols only used by x2apic_uv_x.c uv_bios_set_legacy_vga_target, uv_bios_freq_base, uv_bios_get_sn_info, uv_type, system_serial_number and sn_region_size are only used in x2apic_uv_x.c, which can't be modular. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-5-hch@lst.de commit 23e1a65f3c7eb7f3c3f6f6c26b89cdf3bcb128f6 Author: Christoph Hellwig Date: Mon May 4 19:15:19 2020 +0200 x86/platform/uv: Unexport sn_coherency_id sn_coherency_id is only used by x2apic_uv_x.c, and uv_sysfs.c, both of which can't be modular. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-4-hch@lst.de commit 32988cfd579f7912aeb9a66bf44ca4ce0fa860f1 Author: Christoph Hellwig Date: Mon May 4 19:15:18 2020 +0200 x86/platform/uv: Remove the uv_partition_coherence_id() macro uv_partition_coherence_id() is only used once. Just open code it in the only user. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-3-hch@lst.de commit 30ad8db3a2c2e0121202342c6c2a48fc28937056 Author: Christoph Hellwig Date: Mon May 4 19:15:17 2020 +0200 x86/platform/uv: Mark uv_bios_call() and uv_bios_call_irqsave() static Both functions are only used inside of bios_uv.c. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-2-hch@lst.de commit bd0d696023cb381608e9c3d59dddb25b3816eee7 Author: Andre Przywara Date: Thu May 7 12:24:14 2020 +0100 dt-bindings: arm-smmu: Allow mmu-400, smmu-v1 compatible The Arm SMMUv1 DT binding only allows combining arm,mmu-401 with arm,smmu-v1, even though the MMU-400 is compatible as well. Allow this combination as well to let the Arm Juno board pass the test. Signed-off-by: Andre Przywara Acked-by: Robin Murphy Link: https://lore.kernel.org/r/20200507112430.183940-2-andre.przywara@arm.com Signed-off-by: Will Deacon commit 68aee4af5f62030869021d81c5d59ebd99528d4b Author: Sibi Sankar Date: Tue Apr 21 00:03:54 2020 +0530 arm64: dts: qcom: sdm845-cheza: Add iommus property Add iommus property to remoteproc modem node. Following SMMU global faults are seen without it. arm-smmu 15000000.iommu: Unexpected global fault, this could be serious arm-smmu 15000000.iommu: GFSR 0x80000002, GFSYNR0 0x00000000, GFSYNR1 0x00000781, GFSYNR2 0x00000000 arm-smmu 15000000.iommu: Unexpected global fault, this could be serious arm-smmu 15000000.iommu: GFSR 0x80000002, GFSYNR0 0x00000000, GFSYNR1 0x00000461, GFSYNR2 0x00000000 Signed-off-by: Sibi Sankar Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/38c607841e81664a2db69a27260cd7dfbd653458.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 23cf515c604277f6a44ef2ba415d7f6327abcf05 Author: Sibi Sankar Date: Tue Apr 21 00:03:53 2020 +0530 dt-bindings: remoteproc: qcom: Add iommus property Add iommus property to allow Q6 modem to boot on platforms which do not have trustZone. Signed-off-by: Sibi Sankar Signed-off-by: Sai Prakash Ranjan Acked-by: Rob Herring Link: https://lore.kernel.org/r/561e9b42b8665fc9712fdb40a525ab8871fcbdac.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 0e764a01015dfebff8a8ffd297d74663772e248a Author: Jordan Crouse Date: Tue Apr 21 00:03:51 2020 +0530 iommu/arm-smmu: Allow client devices to select direct mapping Some client devices want to directly map the IOMMU themselves instead of using the DMA domain. Allow those devices to opt in to direct mapping by way of a list of compatible strings. Co-developed-by: Sai Prakash Ranjan Signed-off-by: Jordan Crouse Signed-off-by: Sai Prakash Ranjan Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/7cf1f64167b5545b7f42275395be1f1e2ea3a6ac.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 232c5ae8a3614f112712d43e1dbbd8dd6f8453c1 Author: Sai Prakash Ranjan Date: Tue Apr 21 00:03:50 2020 +0530 iommu/arm-smmu: Implement iommu_ops->def_domain_type call-back Implement the new def_domain_type call-back for the ARM SMMU driver. We need this to support requesting the domain type by the client devices. Signed-off-by: Sai Prakash Ranjan Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/28c5d101cc4ac29aff3553ecec7cf256d0907ed7.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 64510ede36845500584485f3ad30dbcbf83091a6 Author: Sai Prakash Ranjan Date: Tue Apr 21 00:03:49 2020 +0530 iommu: arm-smmu-impl: Convert to a generic reset implementation Currently the QCOM specific smmu reset implementation is very specific to SDM845 SoC and has a wait-for-safe logic which may not be required for other SoCs. So move the SDM845 specific logic to its specific reset function. Also add SC7180 SMMU compatible for calling into QCOM specific implementation. Signed-off-by: Sai Prakash Ranjan Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/d24a0278021bc0b2732636c5728efe55e7318a8b.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon commit 02782f3d60f197f02efd153b43ef64214dc00c01 Author: Sai Prakash Ranjan Date: Thu Apr 23 15:25:31 2020 +0530 iommu/arm-smmu: Make remove callback message more informative Currently on reboot/shutdown, the following messages are displayed on the console as error messages before the system reboots/shutdown as part of remove callback. On SC7180: arm-smmu 15000000.iommu: removing device with active domains! arm-smmu 5040000.iommu: removing device with active domains! Make this error message more informative and less scary. Reported-by: Douglas Anderson Suggested-by: Robin Murphy Signed-off-by: Sai Prakash Ranjan Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20200423095531.9868-1-saiprakash.ranjan@codeaurora.org [will: use dev_notice() as per Robin] Signed-off-by: Will Deacon commit fb7fb84a0c4e8021ddecb157802d58241a3f1a40 Author: Qais Yousef Date: Thu Apr 30 12:40:04 2020 +0100 cpu/hotplug: Remove __freeze_secondary_cpus() The refactored function is no longer required as the codepaths that call freeze_secondary_cpus() are all suspend/resume related now. Signed-off-by: Qais Yousef Signed-off-by: Thomas Gleixner Cc: "Rafael J. Wysocki" Link: https://lkml.kernel.org/r/20200430114004.17477-2-qais.yousef@arm.com commit 565558558985b1d7cd43b21f18c1ad6b232788d0 Author: Qais Yousef Date: Thu Apr 30 12:40:03 2020 +0100 cpu/hotplug: Remove disable_nonboot_cpus() The single user could have called freeze_secondary_cpus() directly. Since this function was a source of confusion, remove it as it's just a pointless wrapper. While at it, rename enable_nonboot_cpus() to thaw_secondary_cpus() to preserve the naming symmetry. Done automatically via: git grep -l enable_nonboot_cpus | xargs sed -i 's/enable_nonboot_cpus/thaw_secondary_cpus/g' Signed-off-by: Qais Yousef Signed-off-by: Thomas Gleixner Cc: "Rafael J. Wysocki" Link: https://lkml.kernel.org/r/20200430114004.17477-1-qais.yousef@arm.com commit b1f9be9392f090f08e4ad9e2c68963aeff03bd67 Author: Cédric Le Goater Date: Thu Feb 20 09:15:06 2020 +0100 powerpc/xive: Enforce load-after-store ordering when StoreEOI is active When an interrupt has been handled, the OS notifies the interrupt controller with a EOI sequence. On a POWER9 system using the XIVE interrupt controller, this can be done with a load or a store operation on the ESB interrupt management page of the interrupt. The StoreEOI operation has less latency and improves interrupt handling performance but it was deactivated during the POWER9 DD2.0 timeframe because of ordering issues. We use the LoadEOI today but we plan to reactivate StoreEOI in future architectures. There is usually no need to enforce ordering between ESB load and store operations as they should lead to the same result. E.g. a store trigger and a load EOI can be executed in any order. Assuming the interrupt state is PQ=10, a store trigger followed by a load EOI will return a Q bit. In the reverse order, it will create a new interrupt trigger from HW. In both cases, the handler processing interrupts is notified. In some cases, the XIVE_ESB_SET_PQ_10 load operation is used to disable temporarily the interrupt source (mask/unmask). When the source is reenabled, the OS can detect if interrupts were received while the source was disabled and reinject them. This process needs special care when StoreEOI is activated. The ESB load and store operations should be correctly ordered because a XIVE_ESB_STORE_EOI operation could leave the source enabled if it has not completed before the loads. For those cases, we enforce Load-after-Store ordering with a special load operation offset. To avoid performance impact, this ordering is only enforced when really needed, that is when interrupt sources are temporarily disabled with the XIVE_ESB_SET_PQ_10 load. It should not be needed for other loads. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200220081506.31209-1-clg@kaod.org commit f572f485898a3a570acf33be6db7e8f02c303751 Author: Marek Vasut Date: Wed Apr 29 18:37:41 2020 +0200 ARM: dts: stm32: Add bindings for SPI2 on AV96 Add SPI2 bindings to AV96 DT, the SPI2 IOs are present on low-speed expansion connector X6. This is disabled by default and can be enabled if something is connected there. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 5afb13616bafce080a2455831325c3e11bec9ba3 Author: Marek Vasut Date: Wed Apr 29 18:37:40 2020 +0200 ARM: dts: stm32: Add alternate pinmux for SPI2 pins Add another mux option for SPI2 pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 8f92c7565325ed74f8f1440328c78d1b0085d573 Author: Marek Vasut Date: Wed Apr 29 18:37:39 2020 +0200 ARM: dts: stm32: Add bindings for ADC on AV96 Add ADC bindings to AV96 DT, the ADC inputs are present on low-speed expansion connector X6. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit d56eb118c37b0a422485d0437977509264729845 Author: Marek Vasut Date: Wed Apr 29 18:37:38 2020 +0200 ARM: dts: stm32: Add alternate pinmux for ADC pins Add another mux option for ADC pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit c80b9dacdc6c3ed82d5e1a3f246c03f21853b556 Author: Marek Vasut Date: Wed Apr 29 18:37:37 2020 +0200 ARM: dts: stm32: Add bindings for FDCAN2 on AV96 Add FDCAN2 bindings to AV96 DT, the FDCAN2 is present on low-speed expansion connector X6. This is disabled by default to match the 96boards specification though. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 099318445981321b690ca4b79920d3ef97e9fe40 Author: Marek Vasut Date: Wed Apr 29 18:37:36 2020 +0200 ARM: dts: stm32: Add alternate pinmux for FDCAN2 pins Add another mux option for FDCAN2 pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit b0b3a8b7be1eae4e779e595fe17588d68bb23f76 Author: Marek Vasut Date: Wed Apr 29 18:37:35 2020 +0200 ARM: dts: stm32: Add bindings for FDCAN1 on AV96 Add FDCAN1 bindings to AV96 DT, the FDCAN1 is present on low-speed expansion connector X6. This is disabled by default to match the 96boards specification though. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 39be968cb5a14c68568c0eae77abea0f1b9041ca Author: Marek Vasut Date: Wed Apr 29 18:37:34 2020 +0200 ARM: dts: stm32: Add alternate pinmux for FDCAN1 pins Add another mux option for FDCAN1 pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit b1c1fe1d43e372212f577c3dfa56937ed0372085 Author: Marek Vasut Date: Wed Apr 29 18:37:33 2020 +0200 ARM: dts: stm32: Repair I2C2 operation on AV96 The I2C2 uses different pinmux on AV96, use correct pinmux and also add comments about the I2C being present on the "low-speed" expansion connector X6. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 11b08c46333c7e254b18c636769bb9b8a3a3c3c1 Author: Marek Vasut Date: Wed Apr 29 18:37:32 2020 +0200 ARM: dts: stm32: Add alternate pinmux for I2C2 pins Add another mux option for I2C2 pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit a041e672cb57201d152bfc314e52d41e7643375d Author: Andy Shevchenko Date: Thu May 7 14:54:49 2020 +0300 spi: dw: Get rid of dma_inited flag This flag is superfluous in all cases where it's being used, i.e. * ->can_dma() won't be called without dma_inited == 1 * DMA ->exit() callback can rely on txchan and rxchan variables So, get rid of dma_inited flag. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200507115449.8093-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 140e45e1e62dd56ed4c264db1443a5d4f5f40352 Author: Andy Shevchenko Date: Thu May 7 14:54:48 2020 +0300 spi: dw: Avoid useless assignments in generic DMA setup Generic DMA setup doesn't rely on certain type of DMA controller and thus shouldn't use Intel Medfield settings, although it's harmless in this case. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200507115449.8093-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit c16e923dd635d383026a306acea540b8e0706c88 Author: ChenTao Date: Thu May 7 10:29:59 2020 +0800 soc: fsl_asrc: Make some functions static Fix the following warning: sound/soc/fsl/fsl_asrc.c:157:5: warning: symbol 'fsl_asrc_request_pair' was not declared. Should it be static? sound/soc/fsl/fsl_asrc.c:200:6: warning: symbol 'fsl_asrc_release_pair' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: ChenTao Link: https://lore.kernel.org/r/20200507022959.183739-1-chentao107@huawei.com Signed-off-by: Mark Brown commit 7ae07308e40cb008ef3cc930a02450183a024b9f Author: Oder Chiou Date: Thu May 7 10:15:39 2020 +0800 ASoC: rt1016: Add the devicetree file for the rt1016 The patch adds the devicetree file for the rt1016. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200507021539.7133-2-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 79a4b670b4b4dddfdb2e946139a88306e3b2ca09 Author: Oder Chiou Date: Thu May 7 10:15:38 2020 +0800 ASoC: rt1016: Add the rt1016 support The patch adds the rt1016 support. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200507021539.7133-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 9558ad215509b75c72c84f4f7691f1bd80fda42a Author: Wei Yongjun Date: Thu May 7 09:43:35 2020 +0000 ASoC: rt5677: Use devm_snd_soc_register_component() Using devm_snd_soc_register_component() can make the code shorter and cleaner. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200507094335.14302-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit fe944625194515e99fcbfb0d190d50986e2b6480 Author: Tzung-Bi Shih Date: Thu May 7 09:54:42 2020 +0800 ASoC: mediatek: mt8183: fix error handling of platform_get_irq() platform_get_irq() returns negative value on error instead of 0. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200507015442.191336-1-tzungbi@google.com Signed-off-by: Mark Brown commit 66abf2388331b800f290e854cca3ae71de7977fe Author: Borislav Petkov Date: Tue May 5 19:27:16 2020 +0200 x86/apic: Convert the TSC deadline timer matching to steppings macro ... and get rid of the function pointers which would spit out the microcode revision based on the CPU stepping. Signed-off-by: Borislav Petkov Reviewed-by: Mark Gross Cc: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200506071516.25445-4-bp@alien8.de commit d8422f6bb052b44db923a28afd8ceaef63d38d26 Author: Borislav Petkov Date: Tue May 5 19:25:08 2020 +0200 x86/cpu: Add a X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS() macro ... to match Intel family 6 CPUs with steppings. Signed-off-by: Borislav Petkov Reviewed-by: Mark Gross Link: https://lkml.kernel.org/r/20200506071516.25445-3-bp@alien8.de commit c4f0126d487f3c68ab19ccb7c561e8fbf3ea2247 Author: Hans de Goede Date: Thu May 7 11:53:34 2020 +0200 HID: asus: Add depends on USB_HID to HID_ASUS Kconfig option Since commit 4bc43a421218 ("HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check") the hid-asus.c depends on the usb_hid_driver symbol. Add a depends on USB_HID to Kconfig to fix missing symbols errors in hid-asus when USB_HID is not enabled. Fixes: 4bc43a421218 ("HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check") Reported-by: kbuild test robot Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit da706e5034c34602e0fb199e5be712ab7bf2c028 Author: Huacai Chen Date: Thu May 7 17:49:18 2020 +0800 MIPS: asm: Rename some macros to avoid build errors Use ASM_ prefix to rename some macros (PANIC and PRINT), in order to avoid build errors (all users are updated as well): 1, PANIC conflicts with drivers/scsi/smartpqi/smartpqi_init.c 2, PRINT conflicts with net/netfilter/nf_conntrack_h323_asn1.c and net/ mac80211/debugfs_sta.c Fixes: d339cd02b888eb8 ("MIPS: Move unaligned load/store helpers to inst.h") Reported-by: kbuild test robot Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 109111b33202e19c956c32cb65960b3b31730650 Author: Serge Semin Date: Wed May 6 20:42:23 2020 +0300 mips: cm: Add L2 ECC/parity errors reporting According to the MIPS32 InterAptiv software manual error codes 24 - 26 of CM2 indicate L2 ECC/parity error with switching to a corresponding errors info fields. This patch provides these errors parsing code, which handles the read/write uncorrectable and correctable ECC/parity errors, and prints instruction causing the fault, RAM array type, cache way/dword and syndrome associated with the faulty data. Co-developed-by: Alexey Malahov Signed-off-by: Alexey Malahov Signed-off-by: Serge Semin Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-pm@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 8a0efb8b101665a843205eab3d67ab09cb2d9a8d Author: Serge Semin Date: Wed May 6 20:42:22 2020 +0300 mips: cm: Fix an invalid error code of INTVN_*_ERR Commit 3885c2b463f6 ("MIPS: CM: Add support for reporting CM cache errors") adds cm2_causes[] array with map of error type ID and pointers to the short description string. There is a mistake in the table, since according to MIPS32 manual CM2_ERROR_TYPE = {17,18} correspond to INTVN_WR_ERR and INTVN_RD_ERR, while the table claims they have {0x17,0x18} codes. This is obviously hex-dec copy-paste bug. Moreover codes {0x18 - 0x1a} indicate L2 ECC errors. Fixes: 3885c2b463f6 ("MIPS: CM: Add support for reporting CM cache errors") Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-pm@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 51485635ebc25267ebab548a1bce43f823d9c0c5 Merge: e9d7144597b1 fb9cbbc895eb Author: Borislav Petkov Date: Thu May 7 12:27:43 2020 +0200 Merge 'x86/urgent' into x86/cpu ... to resolve conflicting changes to arch/x86/kernel/apic/apic.c Signed-off-by: Borislav Petkov commit ce61b490965e6d4068641cf33b8ecf6864c3e105 Author: Geert Uytterhoeven Date: Wed May 6 11:04:52 2020 +0200 MIPS: ingenic: Replace by The JZ4740 setup code is not a clock provider, and just needs to call of_clk_init(). Hence it can include instead of . Fixes: f932449c11dabb4b ("MIPS: ingenic: Drop obsolete code, merge the rest in setup.c") Signed-off-by: Geert Uytterhoeven Reviewed-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit c9b0299034665d594e56ee343f28033d1b24de6d Author: Liangliang Huang Date: Mon May 4 16:51:29 2020 +0800 MIPS: Use fallthrough for arch/mips Convert the various /* fallthrough */ comments to the pseudo-keyword fallthrough; Done via script: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/ Signed-off-by: Liangliang Huang Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 78ad73421831247e46c31899a7bead02740e4bef Author: Thierry Reding Date: Thu Apr 30 13:31:58 2020 +0200 Revert "i2c: tegra: Fix suspending in active runtime PM state" This reverts commit 9f42de8d4ec2304f10bbc51dc0484f3503d61196. It's not safe to use pm_runtime_force_{suspend,resume}(), especially during the noirq phase of suspend. See also the guidance provided in commit 1e2ef05bb8cf ("PM: Limit race conditions between runtime PM and system sleep (v2)"). Signed-off-by: Thierry Reding commit b24a0c16f738a68cd8c2997edf8ebe3d8951df93 Author: Yoshihiro Shimoda Date: Fri Apr 10 18:30:20 2020 +0900 dt-bindings: pci: rcar: add r8a77961 support Add support for r8a77961 (R-Car M3-W+). To avoid confusion between R-Car M3-W (R8A77960) and R-Car M3-W+ (R8A77961), this patch also updates the comment of "renesas,pcie-r8a7796". Link: https://lore.kernel.org/r/1586511020-31833-1-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Lorenzo Pieralisi Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring commit ce351636c67f75a9f282ab69283be231d2c8e845 Author: Kazufumi Ikeda Date: Sat Mar 14 20:12:32 2020 +0100 PCI: rcar: Add suspend/resume Add suspend/resume support for rcar. The resume handler reprograms the hardware based on the software state kept in specific device structures, so there is no need to save registers on suspend. Link: https://lore.kernel.org/r/20200314191232.3122290-1-marek.vasut@gmail.com Link: https://lore.kernel.org/r/20200426123148.56051-1-marek.vasut@gmail.com Signed-off-by: Kazufumi Ikeda Signed-off-by: Gaku Inami Signed-off-by: Marek Vasut Signed-off-by: Lorenzo Pieralisi Cc: Geert Uytterhoeven Cc: Phil Edworthy Cc: Simon Horman Cc: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org commit 2b9f217433e31d125fb697ca7974d3de3ecc3e92 Author: Andrew Murray Date: Fri Oct 4 14:29:41 2019 +0100 PCI: rcar: Fix incorrect programming of OB windows The outbound windows (PCIEPAUR(x), PCIEPALR(x)) describe a mapping between a CPU address (which is determined by the window number 'x') and a programmed PCI address - Thus allowing the controller to translate CPU accesses into PCI accesses. However the existing code incorrectly writes the CPU address - lets fix this by writing the PCI address instead. For memory transactions, existing DT users describe a 1:1 identity mapping and thus this change should have no effect. However the same isn't true for I/O. Link: https://lore.kernel.org/r/20191004132941.6660-1-andrew.murray@arm.com Fixes: c25da4778803 ("PCI: rcar: Add Renesas R-Car PCIe driver") Tested-by: Marek Vasut Signed-off-by: Andrew Murray Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marek Vasut commit ff487d41036035376e47972c7c522490b839ab37 Author: Jiaxun Yang Date: Wed May 6 13:52:45 2020 +0800 MIPS: Truncate link address into 32bit for 32bit kernel LLD failed to link vmlinux with 64bit load address for 32bit ELF while bfd will strip 64bit address into 32bit silently. To fix LLD build, we should truncate load address provided by platform into 32bit for 32bit kernel. Signed-off-by: Jiaxun Yang Link: https://github.com/ClangBuiltLinux/linux/issues/786 Link: https://sourceware.org/bugzilla/show_bug.cgi?id=25784 Reviewed-by: Fangrui Song Reviewed-by: Kees Cook Tested-by: Nathan Chancellor Cc: Maciej W. Rozycki Tested-by: Nick Desaulniers Signed-off-by: Thomas Bogendoerfer commit 53635eb2e24b96b7f2d308b7ac74641c8e2e112c Author: Jason Yan Date: Wed May 6 21:42:50 2020 +0800 MIPS: Remove dead code in pci.h This code has been marked dead for more than 10 years. Seems no need to keep it now. Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit b2f75a41eaa6bfc4aa6f6a1faefbf21c2c8d1588 Author: Rob Herring Date: Thu Apr 9 17:49:23 2020 -0600 PCI: host-generic: Eliminate pci_host_common_probe wrappers Most ECAM host drivers are just different pci_ecam_ops which can be DT match table data. That's already the case in some cases, but let's do that for all the ECAM drivers. Then we can use of_device_get_match_data() in pci_host_common_probe() and eliminate the probe wrapper functions and use pci_host_common_probe() directly for probe. Link: https://lore.kernel.org/r/20200409234923.21598-4-robh@kernel.org Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas Cc: Zhou Wang Cc: Lorenzo Pieralisi Cc: Andrew Murray Cc: Bjorn Helgaas Cc: Will Deacon Cc: Robert Richter Cc: Marc Gonzalez Cc: Mans Rullgard Cc: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org commit fc9ab75e894b376b8f2960e59d32e8740d2c64e2 Author: Jason Yan Date: Wed May 6 21:43:07 2020 +0800 MIPS: CFE: Remove dead code in cfe_getfwinfo() This code has been marked dead since the beginning of the git history. Seems no need to keep it now. Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit 80ab8eb6c5b6d00135d958844c6c03ad03a2eb1a Author: Jason Yan Date: Wed May 6 21:43:15 2020 +0800 MIPS: Octeon: Remove dead code in __cvmx_helper_npi_probe() This code has been marked dead for more than 10 years. Seems no need to keep it now. Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit 7d4d46ba051bd706fed1aea1f3996d18a2ad1a62 Author: Etienne Carriere Date: Wed May 6 19:48:40 2020 +0200 ARM: dts: stm32: bump PSCI to version 1.0 on stm32mp15x Declare PSCI v1.0 support instead of v0.1 as the former is supported by the PSCI firmware stacks stm32mp15x relies on. Signed-off-by: Etienne Carriere Signed-off-by: Alexandre Torgue commit df1fceacb24853d79f41a1dd717b32ab08fa5f3f Author: Cezary Rojewski Date: Wed May 6 22:39:51 2020 +0200 ALSA: hda: Allow SST driver on SKL and KBL platforms with DMIC Update intel-dspcfg with FLAG_SST_ONLY_IF_DMIC option and use it for Skylake and Kabylake platforms when DMIC is present. Signed-off-by: Cezary Rojewski Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200506203951.6369-1-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 28a04aa3ba6046028036d68eab6b9f3f91b47e4e Author: Samuel Zou Date: Thu May 7 14:48:55 2020 +0800 ALSA: portman2x4: Use bitwise instead of arithmetic operator for flags Fix the following coccinelle warning: sound/drivers/portman2x4.c:460:34-35: WARNING: sum of probable bitmasks, consider | Reported-by: Hulk Robot Signed-off-by: Samuel Zou Link: https://lore.kernel.org/r/1588834135-14842-1-git-send-email-zou_wei@huawei.com Signed-off-by: Takashi Iwai commit 59f00717bc09cc30cc61c05b1790db430357ced2 Author: Samuel Zou Date: Thu May 7 11:54:07 2020 +0800 ALSA: sound/ppc: Use bitwise instead of arithmetic operator for flags Fix the following coccinelle warnings: sound/ppc/pmac.c:729:57-58: WARNING: sum of probable bitmasks, consider | sound/ppc/pmac.c:229:37-38: WARNING: sum of probable bitmasks, consider | Reported-by: Hulk Robot Signed-off-by: Samuel Zou Link: https://lore.kernel.org/r/1588823647-12480-1-git-send-email-zou_wei@huawei.com Signed-off-by: Takashi Iwai commit 4acaa93ef64377417677d777a596e22da68c5e0d Author: John Garry Date: Sat Mar 28 00:06:14 2020 +0800 logic_pio: Use _inX() and _outX() Use _inX() and _outX(), which include memory barriers which may be overridden per arch. Reviewed-by: Arnd Bergmann Signed-off-by: John Garry Signed-off-by: Wei Xu commit 26c4c6ce808cdc161f6330405326a0affcffcbd9 Author: John Garry Date: Sat Mar 28 00:06:13 2020 +0800 logic_pio: Improve macro argument name Macro argument "bw" is used for building byte, word, and long-based functions. Use "bwl" instead, to include long. Reviewed-by: Arnd Bergmann Signed-off-by: John Garry Signed-off-by: Wei Xu commit f009c89df79abea5f5244b8135a205f7d4352f86 Author: John Garry Date: Sat Mar 28 00:06:12 2020 +0800 io: Provide _inX() and _outX() Since commit a7851aa54c0c ("io: change outX() to have their own IO barrier overrides") and commit 87fe2d543f81 ("io: change inX() to have their own IO barrier overrides"), the outX and inX functions have memory barriers which can be overridden. However, the generic logic_pio lib has continued to use readl/writel et al for IO port accesses, which has weaker barriers on arm64. Provide generic _inX() and _outX(), which can be used by logic pio. For consistency, we check for !defined({in,out}X) && !defined(_{in,out}X), for defining _{in,out}X, while a check for just !defined({in,out}X) should suffice. Reviewed-by: Arnd Bergmann Signed-off-by: John Garry Signed-off-by: Wei Xu commit fd955a7eac362d87f9dcb5c2f2c3e4355726c6fc Author: Mike Leach Date: Wed Apr 15 21:12:59 2020 +0100 arm64: dts: hi6220: Add CTI options Adds in CTI device tree information for the Hikey620 board. Signed-off-by: Mike Leach Reviewed-by: Mathieu Poirier Tested-by: Leo Yan Signed-off-by: Wei Xu commit d248b371f7479a99caccf91da2ec6adee85e5e70 Author: Mika Kuoppala Date: Wed May 6 19:53:10 2020 +0300 drm/i915/gen12: Invalidate aux table entries forcibly Aux table invalidation can fail on update. So next access may cause memory access to be into stale entry. Proposed workaround is to invalidate entries between all batchbuffers. v2: correct register address (Yang) v3: respect the order (Chris) References bspec#43904, hsdes#1809175790 Cc: Chris Wilson Cc: Chuansheng Liu Cc: Rafael Antognolli Cc: Yang A Shi Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200506165310.1239-1-mika.kuoppala@linux.intel.com commit 0c7c0c8e6f09e0301e02266a0c83611d721adebb Author: Mika Kuoppala Date: Wed May 6 17:47:33 2020 +0300 drm/i915/gen12: Flush L3 Flush TDL,L3 and EUs Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200506144734.29297-3-mika.kuoppala@linux.intel.com commit 32d7171ee2ae6e19c63b826904cf62d3d5a7f6fa Author: Mika Kuoppala Date: Wed May 6 17:47:32 2020 +0300 drm/i915/gen12: Fix HDC pipeline flush HDC pipeline flush is bit on the first dword of the PIPE_CONTROL, not the second. Make it so. v2: function naming (Chris) Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200506144734.29297-2-mika.kuoppala@linux.intel.com commit f02ac414ba9497d1887b1de7fe69954284f157ac Author: Mika Kuoppala Date: Wed May 6 17:47:31 2020 +0300 Revert "drm/i915/tgl: Include ro parts of l3 to invalidate" This reverts commit 62037ffff229b7d94f1db5ef8d2e2ec819832ef3. L3 ro cache invalidation is part of the dword0 of pipe control. Also it is not relevant to this gen. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200506144734.29297-1-mika.kuoppala@linux.intel.com commit cf1e0449ac478e419daf3c3f03721878fe7fa2be Author: Mian Yousaf Kaukab Date: Tue Apr 21 10:30:00 2020 +0200 clk: qoriq: add cpufreq platform device Add a platform device for qoirq-cpufreq driver for the compatible clockgen blocks. Reviewed-by: Yuantian Tang Acked-by: Viresh Kumar Signed-off-by: Mian Yousaf Kaukab Acked-by: Stephen Boyd Signed-off-by: Viresh Kumar commit 157f527639da13c45b87adfc59ca6f6d354b8530 Author: Mian Yousaf Kaukab Date: Tue Apr 21 10:29:59 2020 +0200 cpufreq: qoriq: convert to a platform driver The driver has to be manually loaded if it is built as a module. It is neither exporting MODULE_DEVICE_TABLE nor MODULE_ALIAS. Moreover, no platform-device is created (and thus no uevent is sent) for the clockgen nodes it depends on. Convert the module to a platform driver with its own alias. Moreover, drop whitelisted SOCs. Platform device will be created only for the compatible platforms. Reviewed-by: Yuantian Tang Acked-by: Viresh Kumar Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Viresh Kumar commit 3793faad7b5b730941b2efbc252d14374b60843a Merge: ae1804de93f6 a811c1fa0a02 Author: David S. Miller Date: Wed May 6 22:10:13 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Conflicts were all overlapping changes. Signed-off-by: David S. Miller commit 50d35aa8c15f7210fe76de64b1940100b588bcae Author: Peter Chen Date: Wed Apr 1 09:38:50 2020 +0800 phy: cadence: salvo: add salvo phy driver Cadence SALVO PHY is a 28nm product, and is only used for USB3 & USB2. According to the Cadence, this PHY is a legacy Module, and Sierra and Torrent are later evolutions from it, and their sequence overlap is minimal, meaning we cannot reuse either (Sierra & Torrent) of the PHY drivers. Signed-off-by: Peter Chen Signed-off-by: Kishon Vijay Abraham I commit 6bbee9da9077c2551bf6057d22bf57cf6eb791d9 Author: Peter Chen Date: Wed Apr 1 09:38:51 2020 +0800 doc: dt-binding: cdns-salvo-phy: add binding doc Add Cadence SALVO PHY binding doc, this PHY is a legacy module, and is only used for USB3 and USB2. Signed-off-by: Peter Chen Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit a8dad3e1e333051ecc24d2349cfcd9b95225af87 Author: Loic Poulain Date: Tue Mar 24 11:07:52 2020 +0100 arm64: dts: hikey960: pinctrl: Fix spi2/spi3 pinconf Only the pinmux was selected, not the pinconf, leading to spi issues. Increase drive strength so that max speed (25Mhz) can be achieved. Signed-off-by: Loic Poulain Signed-off-by: Wei Xu commit 12aceb89b0bce19eb89735f9de7a9983e4f0adae Author: Jens Axboe Date: Fri May 1 13:11:09 2020 -0600 eventfd: convert to f_op->read_iter() eventfd is using ->read() as it's file_operations read handler, but this prevents passing in information about whether a given IO operation is blocking or not. We can only use the file flags for that. To support async (-EAGAIN/poll based) retries for io_uring, we need ->read_iter() support. Convert eventfd to using ->read_iter(). With ->read_iter(), we can support IOCB_NOWAIT. Ensure the fd setup is done such that we set file->f_mode with FMODE_NOWAIT. [missing include added] Signed-off-by: Jens Axboe Signed-off-by: Al Viro commit 0ea2ea42b31abc1141f2fd3911f952a97d401fcb Author: Ezequiel Garcia Date: Mon Apr 27 18:44:05 2020 -0300 drm/vkms: Hold gem object while still in-use We need to keep the reference to the drm_gem_object until the last access by vkms_dumb_create. Therefore, the put the object after it is used. This fixes a use-after-free issue reported by syzbot. While here, change vkms_gem_create() symbol to static. Reported-and-tested-by: syzbot+e3372a2afe1e7ef04bc7@syzkaller.appspotmail.com Signed-off-by: Ezequiel Garcia Reviewed-by: Rodrigo Siqueira Signed-off-by: Rodrigo Siqueira Link: https://patchwork.freedesktop.org/patch/msgid/20200427214405.13069-1-ezequiel@collabora.com commit c27f0cc4d43a7f910e3cf779f44c470275604236 Author: Melissa Wen Date: Sat Mar 21 17:37:40 2020 -0300 drm/vkms: enable cursor by default This patch proposes a change in the behavior of the cursor to enable it as soon as the vkms module is added. Enabling the cursor by default appears to be an expected and more friendly behavior, especially when running IGT tests. Signed-off-by: Melissa Wen Reviewed-by: Rodrigo Siqueira Signed-off-by: Rodrigo Siqueira Link: https://patchwork.freedesktop.org/patch/msgid/20200321203740.pg3r7f4vybruowox@smtp.gmail.com commit ae1804de93f6f1626906567ae7deec8e0111259d Author: Arnd Bergmann Date: Tue May 5 17:38:19 2020 +0200 dsa: sja1105: dynamically allocate stats structure The addition of sja1105_port_status_ether structure into the statistics causes the frame size to go over the warning limit: drivers/net/dsa/sja1105/sja1105_ethtool.c:421:6: error: stack frame size of 1104 bytes in function 'sja1105_get_ethtool_stats' [-Werror,-Wframe-larger-than=] Use dynamic allocation to avoid this. Fixes: 336aa67bd027 ("net: dsa: sja1105: show more ethtool statistics counters for P/Q/R/S") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 9e330bf469e02e64d46cb150a2ec65310b9412ea Merge: 3d59a5837c82 b883e47bde4b Author: David S. Miller Date: Wed May 6 17:45:45 2020 -0700 Merge branch 'ethtool-master-slave' Oleksij Rempel says: ==================== provide support for PHY master/slave configuration changes v6: - use NL_SET_ERR_MSG_ATTR in ethnl_update_linkmodes - add sanity checks in the ioctl interface - use bool for ethnl_validate_master_slave_cfg() changes v5: - set MASTER_SLAVE_CFG_UNSUPPORTED as default value - send a netlink error message on validation error - more code fixes changes v4: - rename port_mode to master_slave - move validation code to net/ethtool/linkmodes.c - add UNSUPPORTED state and avoid sending unsupported fields - more formatting and naming fixes - tja11xx: support only force mode - tja11xx: mark state as unsupported changes v3: - provide separate field for config and state. - make state rejected on set - add validation changes v2: - change names. Use MASTER_PREFERRED instead of MULTIPORT - configure master/slave only on request. Default configuration can be provided by PHY or eeprom - status and configuration to the user space. ==================== Signed-off-by: David S. Miller commit b883e47bde4b3eaf18e8d0d73709b33942b4a589 Author: Oleksij Rempel Date: Tue May 5 08:35:06 2020 +0200 net: phy: tja11xx: add support for master-slave configuration The TJA11xx PHYs have a vendor specific Master/Slave configuration bit, which is not compatible with IEEE 803.2-2018 spec for 100Base-T1 devices. So, provide a custom config_ange call back to solve this problem. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit bdbdac7649fac05f88c9f7ab18121a17fb591687 Author: Oleksij Rempel Date: Tue May 5 08:35:05 2020 +0200 ethtool: provide UAPI for PHY master/slave configuration. This UAPI is needed for BroadR-Reach 100BASE-T1 devices. Due to lack of auto-negotiation support, we needed to be able to configure the MASTER-SLAVE role of the port manually or from an application in user space. The same UAPI can be used for 1000BASE-T or MultiGBASE-T devices to force MASTER or SLAVE role. See IEEE 802.3-2018: 22.2.4.3.7 MASTER-SLAVE control register (Register 9) 22.2.4.3.8 MASTER-SLAVE status register (Register 10) 40.5.2 MASTER-SLAVE configuration resolution 45.2.1.185.1 MASTER-SLAVE config value (1.2100.14) 45.2.7.10 MultiGBASE-T AN control 1 register (Register 7.32) The MASTER-SLAVE role affects the clock configuration: ------------------------------------------------------------------------------- When the PHY is configured as MASTER, the PMA Transmit function shall source TX_TCLK from a local clock source. When configured as SLAVE, the PMA Transmit function shall source TX_TCLK from the clock recovered from data stream provided by MASTER. iMX6Q KSZ9031 XXX ------\ /-----------\ /------------\ | | | | | MAC |<----RGMII----->| PHY Slave |<------>| PHY Master | |<--- 125 MHz ---+-<------/ | | \ | ------/ \-----------/ \------------/ ^ \-TX_TCLK ------------------------------------------------------------------------------- Since some clock or link related issues are only reproducible in a specific MASTER-SLAVE-role, MAC and PHY configuration, it is beneficial to provide generic (not 100BASE-T1 specific) interface to the user space for configuration flexibility and trouble shooting. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3d59a5837c826f5df994ef49acc22902baae6057 Merge: 33395f4a5c1b 02f58e5bf2e9 Author: David S. Miller Date: Wed May 6 17:44:11 2020 -0700 Merge branch 'chcr-next' Devulapally Shiva Krishna says: ==================== Crypto/chcr: Fix issues regarding algorithm implementation in driver The following series of patches fixes the issues which came during self-tests with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled. Patch 1: Fixes gcm(aes) hang issue and rfc4106-gcm encryption issue. Patch 2: Fixes ctr, cbc, xts and rfc3686-ctr extra test failures. Patch 3: Fixes ccm(aes) extra test failures. Patch 4: Added support for 48 byte-key_len in aes_xts. Patch 5: fix for hmac(sha) extra test failure. ==================== Signed-off-by: David S. Miller commit 02f58e5bf2e98bf7543019d7bba21f83ff8abb13 Author: Devulapally Shiva Krishna Date: Tue May 5 08:42:57 2020 +0530 Crypto/chcr: fix for hmac(sha) test fails The hmac(sha) test fails for a zero length source text data. For hmac(sha) minimum length of the data must be of block-size. So fix this by including the data_len for the last block. Signed-off-by: Ayush Sawal Signed-off-by: Devulapally Shiva Krishna Signed-off-by: David S. Miller commit ee91ac1b11e44b38268a2f129c86a8a4ee4c218a Author: Devulapally Shiva Krishna Date: Tue May 5 08:42:56 2020 +0530 Crypto/chcr: support for 48 byte key_len in aes-xts Added support for 48 byte key length for aes-xts. Signed-off-by: Ayush Sawal Signed-off-by: Devulapally Shiva Krishna Signed-off-by: David S. Miller commit 10b0c75d7bc19606fa9a62c8ab9180e95c0e0385 Author: Devulapally Shiva Krishna Date: Tue May 5 08:42:55 2020 +0530 Crypto/chcr: fix for ccm(aes) failed test The ccm(aes) test fails when req->assoclen > ~240bytes. The problem is the value assigned to auth_offset is wrong. As auth_offset is unsigned char, it can take max value as 255. So fix it by making it unsigned int. Signed-off-by: Ayush Sawal Signed-off-by: Devulapally Shiva Krishna Signed-off-by: David S. Miller commit 6b363a286cd01961423f5dcd648b265088ec56d0 Author: Devulapally Shiva Krishna Date: Tue May 5 08:42:54 2020 +0530 Crypto/chcr: fix ctr, cbc, xts and rfc3686-ctr failed tests This solves the following issues observed during self test when CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is enabled. 1. Added fallback for cbc, ctr and rfc3686 if req->nbytes is zero and for xts added a fallback case if req->nbytes is not multiple of 16. 2. In case of cbc-aes, solved wrong iv update. When chcr_cipher_fallback() is called, used req->info pointer instead of reqctx->iv. 3. In cbc-aes decryption there was a wrong result. This occurs when chcr_cipher_fallback() is called from chcr_handle_cipher_resp(). In the fallback function iv(req->info) used is wrongly updated. So use the initial iv for this case. 4)In case of ctr-aes encryption observed wrong result. In adjust_ctr_overflow() there is condition which checks if ((bytes / AES_BLOCK_SIZE) > c), where c is the number of blocks which can be processed without iv overflow, but for the above bytes (req->nbytes < 32 , not a multiple of 16) this condition fails and the 2nd block is corrupted as it requires the rollover iv. So added a '=' condition in this to take care of this. 5)In rfc3686-ctr there was wrong result observed. This occurs when chcr_cipher_fallback() is called from chcr_handle_cipher_resp(). Here also copying initial_iv in init_iv pointer for handling the fallback case correctly. Signed-off-by: Ayush Sawal Signed-off-by: Devulapally Shiva Krishna Signed-off-by: David S. Miller commit d91a3159e8d9a1bf58c2aaad1ef10a09bc91350c Author: Devulapally Shiva Krishna Date: Tue May 5 08:42:53 2020 +0530 Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests This patch fixes two issues observed during self tests with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled. 1. gcm(aes) hang issue , that happens during decryption. 2. rfc4106-gcm-aes-chcr encryption unexpectedly succeeded. For gcm-aes decryption , authtag is not mapped due to sg_nents_for_len(upto size: assoclen+ cryptlen - authsize). So fix it by dma_mapping authtag. Also replaced sg_nents() to sg_nents_for_len() in case of aead_dma_unmap(). For rfc4106-gcm-aes-chcr, used crypto_ipsec_check_assoclen() for checking the validity of assoclen. Signed-off-by: Ayush Sawal Signed-off-by: Devulapally Shiva Krishna Signed-off-by: David S. Miller commit 33395f4a5c1b68a4eaa49af62ff3bbed71d98598 Merge: 6a5dc76ac4f5 da1a782a7140 Author: David S. Miller Date: Wed May 6 17:41:42 2020 -0700 Merge branch 'net-ipa-kill-endpoint-stop-workaround' Alex Elder says: ==================== net: ipa: kill endpoint stop workaround It turns out that a workaround that performs a small DMA operation between retried attempts to stop a GSI channel is not needed for any supported hardware. The hardware quirk that required the extra DMA operation was fixed after IPA v3.1. So this series gets rid of that workaround code, along with some other code that was only present to support it. NOTE: This series depends on (and includes/duplicates) another patch that has already been committed in the net tree: 713b6ebb4c37 net: ipa: fix a bug in ipa_endpoint_stop() ==================== Signed-off-by: David S. Miller commit da1a782a7140fab22f2dfe8453d7b73c786d73de Author: Alex Elder Date: Mon May 4 18:53:45 2020 -0500 net: ipa: kill ipa_cmd_dma_task_32b_addr_add() A recent commit removed the only use of ipa_cmd_dma_task_32b_addr_add(). This function (and the IPA immediate command it implements) is no longer needed, so get rid of it, along with all of the definitions associated with it. Isolate its removal in a commit so it can be easily added back again if needed. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f30dcb7dcb1aa925dfc83923c580a53c975b754b Author: Alex Elder Date: Mon May 4 18:53:44 2020 -0500 net: ipa: kill ipa_endpoint_stop() The previous commit made ipa_endpoint_stop() be a trivial wrapper around gsi_channel_stop(). Since it no longer does anything special, just open-code it in the three places it's used. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 9928fcc76f7bb5c93d512767b039e8257ab3093e Author: Alex Elder Date: Mon May 4 18:53:43 2020 -0500 net: ipa: don't retry in ipa_endpoint_stop() The only reason ipa_endpoint_stop() had a retry loop was that the just-removed workaround required an IPA DMA command to occur between attempts. The gsi_channel_stop() call that implements the stop does its own retry loop, to cover a channel's transition from started to stop-in-progress to stopped state. Get rid of the unnecessary retry loop in ipa_endpoint_stop(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c72ddf0dbf2d9d80afd37e28f0a52e728e6db159 Author: Alex Elder Date: Mon May 4 18:53:42 2020 -0500 net: ipa: get rid of workaround in ipa_endpoint_stop() In ipa_endpoint_stop(), a workaround is used for IPA version 3.5.1 where a 1-byte DMA request is issued between GSI channel stop retries. It turns out that this workaround is only required for IPA versions 3.1 and 3.2, and we don't support those. So remove the call to ipa_endpoint_stop_rx_dma() in that function. That leaves that function unused, so get rid of it. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 97e4692dda26d047899a3f1f3f57c3d861b6b9c9 Author: Alex Elder Date: Mon May 4 18:53:41 2020 -0500 net: ipa: fix a bug in ipa_endpoint_stop() In ipa_endpoint_stop(), for TX endpoints we set the number of retries to 0. When we break out of the loop, retries being 0 means we return EIO rather than the value of ret (which should be 0). Fix this by using a non-zero retry count for both RX and TX channels, and just break out of the loop after calling gsi_channel_stop() for TX channels. This way only RX channels will retry, and the retry count will be non-zero at the end for TX channels (so the proper value gets returned). Signed-off-by: Alex Elder Signed-off-by: David S. Miller (cherry picked from commit 713b6ebb4c376b3fb65fdceb3b59e401c93248f9) Signed-off-by: David S. Miller commit 6a5dc76ac4f5d5050dd50298882b933193ece79d Merge: 9c729e748462 a4dcad344687 Author: David S. Miller Date: Wed May 6 17:38:06 2020 -0700 Merge branch 'net-ipa-kill-endpoint-delay-mode-workaround' Alex Elder says: ==================== net: ipa: kill endpoint delay mode workaround A "delay mode" feature was put in place to work around a problem where packets could passed to the modem before it was ready to handle them. That problem no longer exists, and we don't need the workaround any more so get rid of it. ==================== Signed-off-by: David S. Miller commit a4dcad344687abce72e2dea56e91d8c715407b6f Author: Alex Elder Date: Mon May 4 18:37:13 2020 -0500 net: ipa: remove endpoint delay mode feature A "delay mode" feature was put in place to work around a problem that was observed during development of the upstream IPA driver. It used TX endpoint "delay mode" in order to prevent transmitting packets toward the modem before it was ready. A race condition that would explain the problem has long since been fixed, and we have concluded that the "delay mode" feature is no longer required. So get rid of it. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 4fa95248798ed540701e8ce987fb2a6742818f61 Author: Alex Elder Date: Mon May 4 18:37:12 2020 -0500 net: ipa: introduce ipa_endpoint_program_suspend() Create a new helper function that encapsulates enabling or disabling suspend on an RX endpoint. It returns the previous state of the endpoint (true means suspend mode was enabled). Create another function that handles enabling or disabling delay mode on a TX endpoint. Delay mode does not work correctly on IPA version 4.2, so we don't currently use it (and shouldn't). We only set delay mode in one case, and although we don't expect an endpoint to already be in delay mode, it doesn't really matter if it was. So the delay function doesn't return a value. Stop issuing warnings if the previous suspend or delay mode state differs from what is expected. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 4900bf341d963e9742365cd86bfab78d3d851f39 Author: Alex Elder Date: Mon May 4 18:37:11 2020 -0500 net: ipa: have ipa_endpoint_init_ctrl() return previous state Change ipa_endpoint_init_ctrl() so it returns the previous state (whether suspend or delay mode was enabled) rather than indicating whether the request caused a change in state. This makes it easier to understand what's happening where called. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 9c729e7484622b9fb2defa3c640ce141244c0a46 Merge: ee733cd89639 a3f2405b0462 Author: David S. Miller Date: Wed May 6 17:36:04 2020 -0700 Merge branch 'net-ipa-limit-special-reset-handling' Alex Elder says: ==================== net: ipa: limit special reset handling Some special handling done during channel reset should only be done for IPA hardare version 3.5.1. This series generalizes the meaning of a flag passed to indicate special behavior, then has the special handling be used only when appropriate. ==================== Signed-off-by: David S. Miller commit a3f2405b0462c31d0fb32ba6da72ede4e63c8a14 Author: Alex Elder Date: Mon May 4 18:30:03 2020 -0500 net: ipa: only reset channel twice for IPA v3.5.1 In gsi_channel_reset(), RX channels are subjected to two consecutive CHANNEL_RESET commands. This workaround should only be used for IPA version 3.5.1, and for newer hardware "can lead to unwanted behavior." Only issue the second CHANNEL_RESET command for legacy hardware. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f86a1909ea2f9f418d168a7eadb5a773d075e25d Author: Alex Elder Date: Mon May 4 18:30:02 2020 -0500 net: ipa: rename db_enable flag In several places, a Boolean flag is used in the GSI code to indicate whether the "doorbell engine" should be enabled or not when a channel is configured. This is basically done to abstract this property from the IPA version; the GSI code doesn't otherwise "know" what the IPA hardware version is. The doorbell engine is enabled only for IPA v3.5.1, not for IPA v4.0 and later. The next patch makes another change that affects behavior during channel reset (which also involves programming the channel). It also distinguishes IPA v3.5.1 hardware from newer hardware. Rather than creating another flag whose value matches the "db_enable" value, just rename "db_enable" to be "legacy" so it can be used to signal more than just the special doorbell handling. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit ee733cd8963903c494cbe1b43894eaa152932324 Merge: b94c280d0b45 916e6d1a5ef1 Author: David S. Miller Date: Wed May 6 17:29:38 2020 -0700 Merge branch 'tcp-minor-adjustments-for-low-pacing-rates' Eric Dumazet says: ==================== tcp: minor adjustments for low pacing rates After pacing horizon addition, we have to adjust how we arm rto timer, otherwise we might freeze very low pacing rate flows. ==================== Signed-off-by: David S. Miller commit 916e6d1a5ef17a6b3bffad0f086f173cde4240d8 Author: Eric Dumazet Date: Mon May 4 11:27:50 2020 -0700 tcp: defer xmit timer reset in tcp_xmit_retransmit_queue() As hinted in prior change ("tcp: refine tcp_pacing_delay() for very low pacing rates"), it is probably best arming the xmit timer only when all the packets have been scheduled, rather than when the head of rtx queue has been re-sent. This does matter for flows having extremely low pacing rates, since their tp->tcp_wstamp_ns could be far in the future. Note that the regular xmit path has a stronger limit in tcp_small_queue_check(), meaning it is less likely to go beyond the pacing horizon. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 8dc242ad661c2694a582541c2264ffc0e7c4d27d Author: Eric Dumazet Date: Mon May 4 11:27:49 2020 -0700 tcp: refine tcp_pacing_delay() for very low pacing rates With the addition of horizon feature to sch_fq, we noticed some suboptimal behavior of extremely low pacing rate TCP flows, especially when TCP is not aware of a drop happening in lower stacks. Back in commit 3f80e08f40cd ("tcp: add tcp_reset_xmit_timer() helper"), tcp_pacing_delay() was added to estimate an extra delay to add to standard rto timers. This patch removes the skb argument from this helper and tcp_reset_xmit_timer() because it makes more sense to simply consider the time at which next packet is allowed to be sent, instead of the time of whatever packet has been sent. This avoids arming RTO timer too soon and removes spurious horizon drops. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b94c280d0b45d1304e920f6edb07141161237a5f Author: Alex Elder Date: Mon May 4 13:13:50 2020 -0500 arm64: dts: sdm845: add IPA iommus property Add an "iommus" property to the IPA node in "sdm845.dtsi". It is required because there are two regions of memory the IPA accesses through an SMMU. The next few patches define and map those regions. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f87b87a1c969f767b9938d435f0211d293e323db Merge: a085a1eeea5e 980737282232 Author: Alexei Starovoitov Date: Wed May 6 17:12:44 2020 -0700 Merge tag 'perf-for-bpf-2020-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into bpf-next CAP_PERFMON for BPF commit a88845d862f2f8cc8e02fabc9491b96c238ac89b Merge: 969c54646af0 d6836ef02c17 Author: David S. Miller Date: Wed May 6 17:03:34 2020 -0700 Merge branch 'timer-add-fsleep-for-flexible-sleeping' Heiner Kallweit says: ==================== timer: add fsleep for flexible sleeping Sleeping for a certain amount of time requires use of different functions, depending on the time period. Documentation/timers/timers-howto.rst explains when to use which function, and also checkpatch checks for some potentially problematic cases. So let's create a helper that automatically chooses the appropriate sleep function -> fsleep(), for flexible sleeping Not sure why such a helper doesn't exist yet, or where the pitfall is, because it's a quite obvious idea. If the delay is a constant, then the compiler should be able to ensure that the new helper doesn't create overhead. If the delay is not constant, then the new helper can save some code. First user is the r8169 network driver. If nothing speaks against it, then this series could go through the netdev tree. ==================== Signed-off-by: David S. Miller commit d6836ef02c1726c4c5f1cb712a9abdcd5f8fcd14 Author: Heiner Kallweit Date: Fri May 1 23:29:12 2020 +0200 r8169: use fsleep in polling functions Use new flexible sleep function fsleep() to merge the udelay and msleep polling functions. We can safely do this because no polling function is used in atomic context in this driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit c6af13d334759c33c14b6fad4c676c6d1dbf9564 Author: Heiner Kallweit Date: Fri May 1 23:27:21 2020 +0200 timer: add fsleep for flexible sleeping Sleeping for a certain amount of time requires use of different functions, depending on the time period. Documentation/timers/timers-howto.rst explains when to use which function, and also checkpatch checks for some potentially problematic cases. So let's create a helper that automatically chooses the appropriate sleep function -> fsleep(), for flexible sleeping If the delay is a constant, then the compiler should be able to ensure that the new helper doesn't create overhead. If the delay is not constant, then the new helper can save some code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 969c54646af0d7d94a5f0f37adbbfe024e85466e Author: Fernando Gont Date: Fri May 1 00:51:47 2020 -0300 ipv6: Implement draft-ietf-6man-rfc4941bis Implement the upcoming rev of RFC4941 (IPv6 temporary addresses): https://tools.ietf.org/html/draft-ietf-6man-rfc4941bis-09 * Reduces the default Valid Lifetime to 2 days The number of extra addresses employed when Valid Lifetime was 7 days exacerbated the stress caused on network elements/devices. Additionally, the motivation for temporary addresses is indeed privacy and reduced exposure. With a default Valid Lifetime of 7 days, an address that becomes revealed by active communication is reachable and exposed for one whole week. The only use case for a Valid Lifetime of 7 days could be some application that is expecting to have long lived connections. But if you want to have a long lived connections, you shouldn't be using a temporary address in the first place. Additionally, in the era of mobile devices, general applications should nevertheless be prepared and robust to address changes (e.g. nodes swap wifi <-> 4G, etc.) * Employs different IIDs for different prefixes To avoid network activity correlation among addresses configured for different prefixes * Uses a simpler algorithm for IID generation No need to store "history" anywhere Signed-off-by: Fernando Gont Signed-off-by: David S. Miller commit 2ad3d74e3c69fb371412f37d8226f2da3a3b6cc2 Author: Mathew King Date: Mon May 4 14:29:30 2020 -0600 power: supply: core: Add type property to uevent env Add POWER_SUPPLY_TYPE to the uevent env for power supply. Type is a property of all power supplies and there is a sysfs entry for it but it is not included in the properties array of the power supply so explicitly add it to the udev env. Signed-off-by: Mathew King Signed-off-by: Sebastian Reichel commit 5b505366ac6c77a623e18fe18cedb2d4d3c9a7f3 Author: Mathew King Date: Mon May 4 14:29:29 2020 -0600 power: supply: core: Add a macro that maps enum properties to text values Reduce the number of touch points to add a new enum property to the power_supply class by mapping the array of text values to the device attribute descriptor. A new enum property can now added by creating an array with the text values named POWER_SUPPLY_${PROPNAME}_TEXT and adding POWER_SUPPLY_ENUM_ATTR(${PROPNAME}) to the power_supply_attrs array. Signed-off-by: Mathew King Signed-off-by: Sebastian Reichel commit d960d91f86880d28a6dc8edb4e7b605bcf6354eb Author: Mathew King Date: Mon May 4 14:29:28 2020 -0600 power: supply: core: Use designated initializer for property text arrays Use designated initializers for the sysfs power supply text values. This will help ensure that the text values are kept in sync with the enum values from power_supply.h. Signed-off-by: Mathew King Signed-off-by: Sebastian Reichel commit 2cabeaf151294eceaa0f0e0fab2fe9fe66868869 Author: Mathew King Date: Mon May 4 14:29:27 2020 -0600 power: supply: core: Cleanup power supply sysfs attribute list Make the device attribute list used to create sysfs attributes more robust by decoupling the list order from order of the enum defined in power_supply.h. This is done by using a designated initializer in the POWER_SUPPLY_ATTR macro. Signed-off-by: Mathew King Signed-off-by: Sebastian Reichel commit a7defa758dfce680d3a33d64598715589c00cb5f Merge: 857b412511c8 deb04e9c0ff2 Author: David S. Miller Date: Wed May 6 14:53:30 2020 -0700 Merge branch 'add-phy-shared-storage' Michael Walle says: ==================== add phy shared storage Introduce the concept of a shared PHY storage which can be used by some QSGMII PHYs to ease initialization and access to global per-package registers. Changes since v2: - restore page to standard after reading the base address in the mscc driver, thanks Antoine. Changes since v1: - fix typos and add a comment, thanks Florian. - check for "addr < 0" in phy_package_join() - remove multiple blank lines and make "checkpatch.pl --strict" happy Changes since RFC: - check return code of kzalloc() - fix local variable ordering (reverse christmas tree) - add priv_size argument to phy_package_join() - add Tested-by tag, thanks Vladimir. ==================== Signed-off-by: David S. Miller commit deb04e9c0ff2b42cadf198c3204b13025c9bd72e Author: Michael Walle Date: Wed May 6 16:53:15 2020 +0200 net: phy: mscc: use phy_package_shared Use the new phy_package_shared common storage to ease the package initialization and to access the global registers. Signed-off-by: Michael Walle Tested-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit dc9989f173289f376d06cb289ae0bd46c6ac8017 Author: Michael Walle Date: Wed May 6 16:53:14 2020 +0200 net: phy: bcm54140: use phy_package_shared Use the new phy_package_shared common storage to ease the package initialization and to access the global registers. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6349084746ff4f5f7ebc748e4b2a890f8c57b129 Author: Michael Walle Date: Wed May 6 16:53:13 2020 +0200 net: phy: add concept of shared storage for PHYs There are packages which contain multiple PHY devices, eg. a quad PHY transceiver. Provide functions to allocate and free shared storage. Usually, a quad PHY contains global registers, which don't belong to any PHY. Provide convenience functions to access these registers. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 857b412511c87ed7137e63b90b2de020c24660e9 Author: Ayush Sawal Date: Wed May 6 20:17:19 2020 +0530 Revert "crypto: chelsio - Inline single pdu only" This reverts commit 27c6feb0fb33a665a746346e76714826a5be5d10. For ipsec offload the chelsio's ethernet driver expects a single mtu sized packet. But when ipsec traffic is running using iperf, most of the packets in that traffic are gso packets(large sized skbs) because GSO is enabled by default in TCP, due to this commit 0a6b2a1dc2a2 ("tcp: switch to GSO being always on"), so chcr_ipsec_offload_ok() receives a gso skb(with gso_size non zero). Due to the check in chcr_ipsec_offload_ok(), this function returns false for most of the packet, then ipsec offload is skipped and the skb goes out taking the coprocessor path which reduces the bandwidth for inline ipsec. If this check is removed then for most of the packets(large sized skbs) the chcr_ipsec_offload_ok() returns true and then as GSO is on, the segmentation of the packet happens in the kernel and then finally the driver_xmit is called, which receives a segmented mtu sized packet which is what the driver expects for ipsec offload. So this case becomes unnecessary here, therefore removing it. Signed-off-by: Ayush Sawal Signed-off-by: David S. Miller commit 4ca75287064be97ac6b67e332e0c082291a515dc Author: Casey Schaufler Date: Tue Apr 28 15:00:26 2020 -0700 Smack:- Remove redundant inode_smack cache The inode_smack cache is no longer used. Remove it. Signed-off-by: Vishal Goel Signed-off-by: Casey Schaufler commit 921bb1cbb31bb0424b47de52174da20367449c8e Author: Casey Schaufler Date: Fri Apr 24 15:23:04 2020 -0700 Smack:- Remove mutex lock "smk_lock" from inode_smack "smk_lock" mutex is used during inode instantiation in smack_d_instantiate()function. It has been used to avoid simultaneous access on same inode security structure. Since smack related initialization is done only once i.e during inode creation. If the inode has already been instantiated then smack_d_instantiate() function just returns without doing anything. So it means mutex lock is required only during inode creation. But since 2 processes can't create same inodes or files simultaneously. Also linking or some other file operation can't be done simultaneously when the file is getting created since file lookup will fail before dentry inode linkup which is done after smack initialization. So no mutex lock is required in inode_smack structure. It will save memory as well as improve some performance. If 40000 inodes are created in system, it will save 1.5 MB on 32-bit systems & 2.8 MB on 64-bit systems. Signed-off-by: Vishal Goel Signed-off-by: Amit Sahrawat Signed-off-by: Casey Schaufler commit 84e99e58e8d1e26f04c097f4266e431a33987f36 Author: Casey Schaufler Date: Thu Apr 9 16:35:28 2020 -0700 Smack: slab-out-of-bounds in vsscanf Add barrier to soob. Return -EOVERFLOW if the buffer is exceeded. Suggested-by: Hillf Danton Reported-by: syzbot+bfdd4a2f07be52351350@syzkaller.appspotmail.com Signed-off-by: Casey Schaufler commit 092c94aed3e1bb0946fc7ba176cc3b4376d9910f Author: Maninder Singh Date: Thu Apr 9 18:09:58 2020 +0530 smack: remove redundant structure variable from header. commit afb1cbe37440 ("LSM: Infrastructure management of the inode security") removed usage of smk_rcu, thus removing it from structure. Signed-off-by: Maninder Singh Signed-off-by: Vaneet Narang Signed-off-by: Casey Schaufler commit 00720f0e7f288d29681d265c23b22bb0f0f4e5b4 Author: Arnd Bergmann Date: Wed Apr 8 21:04:31 2020 +0200 smack: avoid unused 'sip' variable warning The mix of IS_ENABLED() and #ifdef checks has left a combination that causes a warning about an unused variable: security/smack/smack_lsm.c: In function 'smack_socket_connect': security/smack/smack_lsm.c:2838:24: error: unused variable 'sip' [-Werror=unused-variable] 2838 | struct sockaddr_in6 *sip = (struct sockaddr_in6 *)sap; Change the code to use C-style checks consistently so the compiler can handle it correctly. Fixes: 87fbfffcc89b ("broken ping to ipv6 linklocal addresses on debian buster") Signed-off-by: Arnd Bergmann Signed-off-by: Casey Schaufler commit 9532131f6995002e88390b8b6572a44531c1fae0 Author: Yunjian Wang Date: Wed May 6 20:55:52 2020 +0800 net: 7990: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 787e4a79cd5ffc46fe5fa1ce9464e79143423ac0 Author: Yunjian Wang Date: Wed May 6 20:21:45 2020 +0800 net: cpmac: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 10786531cf996d0d1a0f901d9d559eb947013ac3 Author: Yunjian Wang Date: Wed May 6 20:10:28 2020 +0800 net: moxa: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 1cfecc2353c24b37eea69d9b9a606ca9f473f9bc Author: Yunjian Wang Date: Wed May 6 19:38:46 2020 +0800 net: lantiq: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit df1577cbaa87d8a29bf18f41d2ba82668d59d106 Author: ChenTao Date: Wed May 6 19:22:17 2020 +0800 net: enetc: Make some symbols static Fix the following warning: drivers/net/ethernet/freescale/enetc/enetc_qos.c:427:20: warning: symbol 'enetc_act_fwd' was not declared. Should it be static? drivers/net/ethernet/freescale/enetc/enetc_qos.c:966:20: warning: symbol 'enetc_check_flow_actions' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: ChenTao Signed-off-by: David S. Miller commit e910a3993818ab69fcb9d791cbbe07bb153c0660 Author: Yunjian Wang Date: Wed May 6 19:13:08 2020 +0800 net: mediatek: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit d54fc481bd828afee199e4853020c5ecd9d79778 Author: Yunjian Wang Date: Wed May 6 19:04:59 2020 +0800 net: socionext: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 1f3e915e316c4393ce940ab184c176b7202f3ff7 Author: Yunjian Wang Date: Wed May 6 17:25:14 2020 +0800 net: renesas: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 77afd98719d5cbe496196dcf69af7b84206708fd Merge: 2f8649900b7d dc9c404f98a9 Author: David S. Miller Date: Wed May 6 14:11:26 2020 -0700 Merge branch 's390-qeth-next' Julian Wiedmann says: ==================== s390/qeth: updates 2020-05-06 please apply the following patch series for qeth to netdev's net-next tree. Same patches as yesterday, except that the ethtool reset has been dropped for now. This primarily adds infrastructure to deal with HW offloads when the packets get forwarded over the adapter's internal switch. Aside from that, just some minor tweaking for the TX code. ==================== Signed-off-by: David S. Miller commit dc9c404f98a98b470d7cad88a7cbed16dd273d39 Author: Julian Wiedmann Date: Wed May 6 10:09:49 2020 +0200 s390/qeth: clean up Kconfig help text Remove a stale doc link. While at it also reword the help text to get rid of an outdated marketing term. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 7005b7547680963ad127c5069c6be082272105bc Author: Julian Wiedmann Date: Wed May 6 10:09:48 2020 +0200 s390/qeth: return error when starting a reset fails When starting the reset worker via sysfs is unsuccessful, return an error to the user. Modernize the sysfs input parsing while at it. Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: David S. Miller commit 6ee091efa7b59829448d0f9287ea62c1f448a318 Author: Julian Wiedmann Date: Wed May 6 10:09:47 2020 +0200 s390/qeth: set TX IRQ marker on last buffer in a group When qeth_flush_buffers() gets called for a group of TX buffers (currently up to 2 for OSA-style devices), the code iterates over each buffer for some final processing. During this processing, it sets the TX IRQ marker on the leading buffer rather than the last one. This can result in delayed TX completion of the trailing buffers. So pull the IRQ marker code out of the loop, and apply it to the final buffer. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit a875fd1620ffb65f4e0d488f7fe1fba62cf9fedd Author: Julian Wiedmann Date: Wed May 6 10:09:46 2020 +0200 s390/qeth: indicate contiguous TX buffer elements The TX path usually maps the full content of a page into a buffer element. But there's specific skb layouts (ie. linearized TSO skbs) where the HW header (1) requires a separate buffer element, and (2) is page-contiguous with the packet data that's mapped into the next buffer element. Flag such buffer elements accordingly, so that HW can optimize its data access for them. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit fff1aceb880f509fa02341acf0adca905513f139 Author: Julian Wiedmann Date: Wed May 6 10:09:45 2020 +0200 s390/qeth: merge TX skb mapping code Merge the __qeth_fill_buffer() helper into its only caller. This way all mapping-related context is in one place, and we can make some more use of it in a subsequent patch. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit c619e9a6f52f87b405053edc5abb55d3e36a8e7b Author: Julian Wiedmann Date: Wed May 6 10:09:44 2020 +0200 s390/qeth: don't use restricted offloads for local traffic Current OSA models don't support TSO for traffic to local next-hops, and some old models didn't offer TX CSO for such packets either. So as part of .ndo_features_check, check if a packet's next-hop resides on the same OSA Adapter. Opt out from affected HW offloads accordingly. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 1d38c2e4941e1add2a89ef7abb22c918bbb3c103 Author: Julian Wiedmann Date: Wed May 6 10:09:43 2020 +0200 s390/qeth: extract helpers for next-hop lookup These will be used in a subsequent patch. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit fb8d258049f70e6bfd4674b11deb566fb13a0839 Author: Julian Wiedmann Date: Wed May 6 10:09:42 2020 +0200 s390/qeth: add debugfs file for local IP addresses For debugging purposes, provide read access to the local_addr caches via debug/qeth//local_addrs. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 0d49c06bcfc29042306814a2199b7996dbf1ecb0 Author: Julian Wiedmann Date: Wed May 6 10:09:41 2020 +0200 s390/qeth: process local address events In configurations where specific HW offloads are in use, OSA adapters will raise notifications to their virtual devices about the IP addresses that currently reside on the same adapter. Cache these addresses in two RCU-enabled hash tables, and flush the tables once the relevant HW offload(s) get disabled. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 3be83016275d1e113ce8c4aa477174a8a6d7a55d Author: Julian Wiedmann Date: Wed May 6 10:09:40 2020 +0200 s390/qeth: keep track of LP2LP capability for csum offload When enabling TX CSO, make a note of whether the device has support for LP2LP offloading. This will become relevant in subsequent patches. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 2f8649900b7d0dced6aff0765ea15e874a91b73c Author: Samuel Zou Date: Wed May 6 14:27:30 2020 +0800 net: ethernet: mediatek: Make mtk_m32 static Fix the following sparse warning: drivers/net/ethernet/mediatek/mtk_eth_soc.c:68:5: warning: symbol 'mtk_m32' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: David S. Miller commit 57829ea46875770c919ae491dcabf4e2aa5cb385 Author: Jason Yan Date: Wed May 6 14:16:59 2020 +0800 sparc: mm: return true,false in kern_addr_valid() This function's return type is bool and returns both true/false and 0/1. This fixes the following coccicheck warning: arch/sparc/mm/init_64.c:1652:9-10: WARNING: return of 0/1 in function 'kern_addr_valid' with return type bool Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit f9cbf19c7f5d92e3e91727b6dff6e43b1d6a62a3 Author: Jason Yan Date: Wed May 6 14:16:30 2020 +0800 net: mlx4: remove unneeded variable "err" in mlx4_en_get_rxfh() Fix the following coccicheck warning: drivers/net/ethernet/mellanox/mlx4/en_ethtool.c:1238:5-8: Unneeded variable: "err". Return "0" on line 1252 Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 8741e18419bf4b9e3b02c0ed01ea13f1aa497fa7 Author: Jason Yan Date: Wed May 6 14:16:16 2020 +0800 net: bridge: return false in br_mrp_enabled() Fix the following coccicheck warning: net/bridge/br_private.h:1334:8-9: WARNING: return of 0/1 in function 'br_mrp_enabled' with return type bool Fixes: 6536993371fab ("bridge: mrp: Integrate MRP into the bridge") Signed-off-by: Jason Yan Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit cadb5c4e394da0fc13e4d46ad7c1445d60dc175f Author: Yunjian Wang Date: Wed May 6 14:10:41 2020 +0800 net: cortina: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 42caf9cb59370cc6f296c7a9fe39fa66963236ff Author: Mark Bloch Date: Wed May 6 10:16:02 2020 +0300 RDMA/mlx5: Allow only raw Ethernet QPs when RoCE isn't enabled When operating in switchdev mode or using devlink to disable RoCE only raw Ethernet QPs are allowed to be created. When in switchdev mode this can lead to passing an invalid port number as part of the modify qp firmware cmd and will lead to a syndrome reported back to the user, such as: * mlx5_cmd_check:803:(pid 50148): RST2INIT_QP(0x502) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x177405). Internal UD QP might be used to test for write combining support (even if externally we report RoCE as disabled) check for that specific flag and allow is specifically. Fixes: b5ca15ad7e61 ("IB/mlx5: Add proper representors support") Link: https://lore.kernel.org/r/20200506071602.7177-3-leon@kernel.org Signed-off-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8d93efb8c5e07706651a992fc07f37a2fb69baca Author: Mark Bloch Date: Wed May 6 10:16:01 2020 +0300 RDMA/mlx5: Assign profile before calling stages Assign the profile to the IB device before executing stages. This will allow to check which profile is being used from within a stage. Link: https://lore.kernel.org/r/20200506071602.7177-2-leon@kernel.org Signed-off-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7f6778b11490dbde786bb88a4bb1d648975c621e Author: ChenTao Date: Wed May 6 13:11:13 2020 +0800 drm/amdgpu/navi10: fix unsigned comparison with 0 Fixes warning because size is uint32_t and can never be negtative drivers/gpu/drm/amd/amdgpu/../powerplay/navi10_ppt.c:1296:12: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (size < 0) Reported-by: Hulk Robot Signed-off-by: ChenTao Signed-off-by: Alex Deucher commit fd9a9f8801def3908960312e46bb92126add6b66 Author: Felix Kuehling Date: Tue May 5 14:02:43 2020 -0400 drm/amdgpu: Use GEM obj reference for KFD BOs Releasing the AMDGPU BO ref directly leads to problems when BOs were exported as DMA bufs. Releasing the GEM reference makes sure that the AMDGPU/TTM BO is not freed too early. Also take a GEM reference when importing BOs from DMABufs to keep references to imported BOs balances properly. Signed-off-by: Felix Kuehling Tested-by: Alex Sierra Acked-by: Christian König Reviewed-by: Alex Sierra Signed-off-by: Alex Deucher commit 1cba0987610a1508358d1a3704fdb9c98b3be0ba Author: Alex Deucher Date: Tue May 5 09:42:26 2020 -0400 drm/amdgpu: force fbdev into vram We set the fb smem pointer to the offset into the BAR, so keep the fbdev bo in vram. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207581 Fixes: 6c8d74caa2fa33 ("drm/amdgpu: Enable scatter gather display support") Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 74577c3a48a85f235a0506d07f31d91f170d8b19 Author: Evan Quan Date: Thu Apr 30 14:38:39 2020 +0800 drm/amd/powerplay: perform PG ungate prior to CG ungate Since gfxoff should be disabled first before trying to access those GC registers. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 47891bf1da31ccba95974b58a853a346924ed341 Author: Evan Quan Date: Thu Apr 30 11:24:02 2020 +0800 drm/amdgpu: drop unnecessary cancel_delayed_work_sync on PG ungate As this is already properly handled in amdgpu_gfx_off_ctrl(). In fact, this unnecessary cancel_delayed_work_sync may leave a small time window for race condition and is dangerous. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2536c4b0dd88d1f9031285bbfe9e6986790ce056 Author: Evan Quan Date: Thu Apr 30 11:15:19 2020 +0800 drm/amdgpu: disable MGCG/MGLS also on gfx CG ungate Otherwise, MGCG/MGLS will be left enabled. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9d11eb0d0c4659c6414b22d86b7f8813e254dcba Author: Christian König Date: Fri Jan 31 14:58:05 2020 +0100 drm/amdgpu: use the BAR if possible in amdgpu_device_vram_access v2 This should speed up debugging VRAM access a lot. v2: add HDP flush/invalidate Unrevert: RAS issue at root of the issue has been addressed Signed-off-by: Christian König Reviewed-by: Felix Kuehling Acked-by: Jonathan Kim Signed-off-by: Alex Deucher Signed-off-by: Kent Russell Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 85d4d684feccc200ee2c93fe06a563bb70a6fb20 Author: Jerry (Fangzhi) Zuo Date: Wed Apr 29 13:42:16 2020 -0400 drm/amd/display: Add dm support for DP 1.4 Compliance edid corruption test It works together with drm framework "drm: Add support for DP 1.4 Compliance edid corruption test" Add the edid validity check scenario when edid base block is read back with error. Send back real edid checksum and enable fail-safe mode in DC. Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 50a19ad4b1ec531eb550183cb5d4ab9f25a56bf8 Author: Marco Elver Date: Fri Apr 24 17:47:30 2020 +0200 objtool, kcsan: Add kcsan_disable_current() and kcsan_enable_current_nowarn() Both are safe to be called from uaccess contexts. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit bbae62e32ee9ef3995cb72e565dd8790a6858de2 Author: Samuel Zou Date: Wed May 6 10:54:58 2020 +0800 net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code Fixes coccicheck warning: drivers/net/ethernet/ti/am65-cpts.c:1017:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou Signed-off-by: David S. Miller commit 029e88fd1e6142ded73f07e2baef3e8a2a87e0ed Author: Leon Romanovsky Date: Wed May 6 09:55:13 2020 +0300 RDMA/mlx5: Move all WR logic from qp.c to separate file Split qp.c by removing all WR logic to separate file. Link: https://lore.kernel.org/r/20200506065513.4668-4-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6671cde83ddb9a65fd0a69e0896d089ace0e195c Author: Max Gurtovoy Date: Wed May 6 09:55:12 2020 +0300 RDMA/mlx5: Refactor mlx5_post_send() to improve readability Add small helpers in order to avoid code duplication and improve code readability. Decrease the amount of code in the gigantic post_send function and divide it to readable methods that will help in code maintenance in the future. Link: https://lore.kernel.org/r/20200506065513.4668-3-leon@kernel.org Signed-off-by: Max Gurtovoy Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 31578defe4eb816439d5e3351923e90f6321b3c8 Author: Leon Romanovsky Date: Wed May 6 09:55:11 2020 +0300 RDMA/mlx5: Update mlx5_ib to use new cmd interface Reuse newly introduced mlx5_cmd_exec_in() and mlx5_cmd_exec_inout() to reduce code duplication in mlx5_ib module. Link: https://lore.kernel.org/r/20200506065513.4668-2-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e4faa478c6b8af5fc4afe20de693417354a57e4d Author: Wenpeng Liang Date: Thu Apr 30 18:31:31 2020 +0800 RDMA/hns: Remove redundant assignment of caps These caps are assigned in query_pf_caps() or set_default_caps(), and should not be assigned out of these two functions. Link: https://lore.kernel.org/r/1588242691-12913-4-git-send-email-liweihang@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit b713128de7a17c7173f869323f8a5f0593e52538 Author: Weihang Li Date: Thu Apr 30 18:31:30 2020 +0800 RDMA/hns: Adjust lp_pktn_ini dynamically lp_pktn_ini means the number of loopback slice packets for long messages, it should depend on MTU(fixed to 4096B currently) and max size of SQ inline. Link: https://lore.kernel.org/r/1588242691-12913-3-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 23190b8f47de2d2983d6052f6eb7781779db8eb3 Author: Weihang Li Date: Thu Apr 30 18:31:29 2020 +0800 RDMA/hns: Fix comments with non-English symbols There is a comments with some chinese semicolons that cause encoding issues each time hns_roc_hw_v2.h was modified from a IDE. So fix this by using correct symbols. Link: https://lore.kernel.org/r/1588242691-12913-2-git-send-email-liweihang@huawei.com Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 67954a6e379b4678536ef14a1d49ea78fcdc4a1f Author: Xi Wang Date: Tue Apr 28 19:03:43 2020 +0800 RDMA/hns: Optimize SRQ buffer size calculating process Optimize the SRQ's WQE buffer parameters calculating process to make the codes more readable by using new functions about multi-hop addressing to calculating capabilities of SRQ. Link: https://lore.kernel.org/r/1588071823-40200-6-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit ffb1308b88b6023205249f11332ebff83610899a Author: Yixian Liu Date: Tue Apr 28 19:03:42 2020 +0800 RDMA/hns: Move SRQ code to the reasonable place Just move the SRQ related code to more reasonable place, and unify format of some prints. Link: https://lore.kernel.org/r/1588071823-40200-5-git-send-email-liweihang@huawei.com Signed-off-by: Yixian Liu Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 54d6638765b0ede9f3889af47d9d5412bef8f47d Author: Xi Wang Date: Tue Apr 28 19:03:41 2020 +0800 RDMA/hns: Optimize WQE buffer size calculating process Optimize the QP's WQE buffer parameters calculating process to make the codes more readable mainly by merging calculation of extended sge space of kernel and userspace. In addition, add some inline functions to simply codes about multi-hop addressing. Link: https://lore.kernel.org/r/1588071823-40200-4-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 2929c40f08a9654c4c8e35ad0a36d611deb61394 Author: Xi Wang Date: Tue Apr 28 19:03:40 2020 +0800 RDMA/hns: Remove unused MTT functions The MTT (Memory Translate Table) interface is no longer used to configure the buffer address to BT (Base Address Table) that requires driver mapping. Because the MTT is not compatible with multi-hop addressing of the hip08, it is replaced by MTR (Memory Translate Region) interface, and all the MTT functions should be removed. Link: https://lore.kernel.org/r/1588071823-40200-3-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 9b2cf76c9f052987ae5c4ad450ebebdc7c5d7b87 Author: Xi Wang Date: Tue Apr 28 19:03:39 2020 +0800 RDMA/hns: Optimize PBL buffer allocation process PBL table has its own implementation for multi-hop addressing currently, but for the hardware, all table's addressing use the same logic, there is no need to implement repeatedly. So optimize the PBL buffer allocation process by using the mtr's interfaces. Link: https://lore.kernel.org/r/1588071823-40200-2-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Reported-by: kbuild test robot Signed-off-by: Jason Gunthorpe commit 8bc3b5e4b70d28f8edcafc3c9e4de515998eea9e Author: Darrick J. Wong Date: Mon May 4 14:06:27 2020 -0700 xfs: clean up the error handling in xfs_swap_extents Make sure we release resources properly if we cannot clean out the COW extents in preparation for an extent swap. Fixes: 96987eea537d6c ("xfs: cancel COW blocks before swapext") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 31fb4bf545e230f2c7db7e64cf012c67a8d374df Author: YueHaibing Date: Tue May 5 16:45:37 2020 +0800 sunrpc: Remove unused function ip_map_update commit 49b28684fdba ("nfsd: Remove deprecated nfsctl system call and related code.") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: J. Bruce Fields commit c2d715a1af75443631b05a49edbd152aef7e8b93 Author: J. Bruce Fields Date: Mon Apr 27 17:59:01 2020 -0400 nfsd: handle repeated BIND_CONN_TO_SESSION If the client attempts BIND_CONN_TO_SESSION on an already bound connection, it should be either a no-op or an error. Signed-off-by: J. Bruce Fields commit 580da465a0328d597df0087800717814a62da638 Author: Achilles Gaikwad Date: Mon Apr 20 18:20:31 2020 +0530 nfsd4: add filename to states output Add filename to states output for ease of debugging. Signed-off-by: Achilles Gaikwad Signed-off-by: Kenneth Dsouza Signed-off-by: J. Bruce Fields commit ee590d259784806c32ad0523aa6a9c321dbf96a4 Author: J. Bruce Fields Date: Mon Apr 13 22:03:06 2020 -0400 nfsd4: stid display should preserve on-the-wire byte order When we decode the stateid we byte-swap si_generation. But for simplicity's sake and ease of comparison with network traces, it's better to display the whole thing in network order. Reported-by: Scott Mayhew Signed-off-by: J. Bruce Fields commit ace7ade4f56cab0ea19d3665d7c14d713788c13d Author: J. Bruce Fields Date: Mon Apr 13 21:37:19 2020 -0400 nfsd4: common stateid-printing code There's a problem with how I'm formatting stateids. Before I fix it, I'd like to move the stateid formatting into a common helper. Signed-off-by: J. Bruce Fields commit 5ac55dfc6d92c12d5ef423cd16165eb0350f8f51 Author: Mark Zhang Date: Mon May 4 08:19:35 2020 +0300 RDMA/mlx5: Set UDP source port based on the grh.flow_label Calculate UDP source port based on the grh.flow_label. If grh.flow_label is not valid, we will use minimal supported UDP source port. Link: https://lore.kernel.org/r/20200504051935.269708-6-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f66534051936044728e2be9937eb408494ca4007 Author: Mark Zhang Date: Mon May 4 08:19:34 2020 +0300 RDMA/cma: Initialize the flow label of CM's route path record If flow label is not set by the user or it's not IPv4, initialize it with the cma src/dst based on the "Kernighan and Ritchie's hash function". Link: https://lore.kernel.org/r/20200504051935.269708-5-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2b880b2e5e03e790a9b9fd7e3e8fcf7a36230a16 Author: Mark Zhang Date: Mon May 4 08:19:33 2020 +0300 RDMA/mlx5: Define RoCEv2 udp source port when set path Calculate and set UDP source port based on the flow label. If flow label is not defined in GRH then calculate it based on lqpn/rqpn. Link: https://lore.kernel.org/r/20200504051935.269708-4-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9611d53aa1600ba94a36cd7bfd6a95dbae76c8e6 Author: Maor Gottlieb Date: Mon May 4 08:19:32 2020 +0300 RDMA/core: Consider flow label when building skb Use rdma_flow_label_to_udp_sport to calculate the UDP source port of the RoCEV2 packet. Link: https://lore.kernel.org/r/20200504051935.269708-3-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d5665a21250efeeb73579a2f8d71ee1820f37952 Author: Mark Zhang Date: Mon May 4 08:19:31 2020 +0300 RDMA/core: Add hash functions to calculate RoCEv2 flowlabel and UDP source port Add two hash functions to distribute RoCE v2 UDP source and Flowlabel symmetrically. These are user visible API and any change in the implementation needs to be tested for inter-operability between old and new variant. Link: https://lore.kernel.org/r/20200504051935.269708-2-leon@kernel.org Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b173bfe2d744e74610c87d4f6ebade7b6ebd9845 Author: Zou Wei Date: Thu Apr 30 20:13:17 2020 +0800 drm/udl: Make udl_handle_damage static Fix the following sparse warning: drivers/gpu/drm/udl/udl_modeset.c:269:5: warning: symbol 'udl_handle_damage' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1588248797-70568-1-git-send-email-zou_wei@huawei.com commit bec1277a7ebdc2139a24177db825eed21fd63ee9 Author: Jason Yan Date: Wed Apr 29 22:09:42 2020 +0800 video: fbdev: valkyriefb.c: fix warning comparing pointer to 0 Fix the following coccicheck warning: drivers/video/fbdev/valkyriefb.c:348:10-11: WARNING comparing pointer to 0, suggest !E drivers/video/fbdev/valkyriefb.c:334:12-13: WARNING comparing pointer to 0 drivers/video/fbdev/valkyriefb.c:348:10-11: WARNING comparing pointer to 0 Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200429140942.8137-1-yanaijie@huawei.com commit c7f66d32dd431cc30139324a7e0956f641dc6ff0 Author: Harigovindan P Date: Wed Apr 29 11:15:14 2020 +0530 drm/panel: add support for rm69299 visionox panel Add support for Visionox rm69299 panel. Signed-off-by: Harigovindan P Reviewed-by: Matthias Kaehlcke Signed-off-by: Sam Ravnborg [fix checkpatch warnings, added sentinel ] Link: https://patchwork.freedesktop.org/patch/msgid/20200421045508.21137-2-harigovi@codeaurora.org commit 10a14c3224a45b951f529925b757392aa2d2dcc9 Author: Harigovindan P Date: Wed Apr 29 11:15:15 2020 +0530 dt-bindings: documenting compatible string vendor "visionox" Documenting compatible string vendor "visionox" in vendor-prefix yaml file. Signed-off-by: Harigovindan P Acked-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200429054515.4976-2-harigovi@codeaurora.org commit 18722d48a6bb9c2e8d046214c0a5fd19d0a7c9f6 Author: Christophe JAILLET Date: Wed May 6 20:19:02 2020 +0200 video: fbdev: w100fb: Fix a potential double free. Some memory is vmalloc'ed in the 'w100fb_save_vidmem' function and freed in the 'w100fb_restore_vidmem' function. (these functions are called respectively from the 'suspend' and the 'resume' functions) However, it is also freed in the 'remove' function. In order to avoid a potential double free, set the corresponding pointer to NULL once freed in the 'w100fb_restore_vidmem' function. Fixes: aac51f09d96a ("[PATCH] w100fb: Rewrite for platform independence") Cc: Richard Purdie Cc: Antonino Daplas Cc: Bartlomiej Zolnierkiewicz Cc: # v2.6.14+ Signed-off-by: Christophe JAILLET Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200506181902.193290-1-christophe.jaillet@wanadoo.fr commit 54e9d5f70834afbadbf83163c5e747993b0b195d Author: Sibi Sankar Date: Tue May 5 01:52:32 2020 +0530 arm64: dts: qcom: sdm845: Add SoC compatible to MTP Add missing SoC compatible to SDM845 MTP board file. Reviewed-by: Matthias Kaehlcke Reviewed-by: Amit Kucheria Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200504202243.5476-2-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 446937a5056fed6c8bea4306eb0249bd5c50ce5e Author: Florian Fainelli Date: Mon Apr 1 20:23:12 2019 -0700 ARM: mm: Remove virtual address print from B15 RAC driver We would be trying to print the kernel virtual address of the base register address which is not very useful and is not displayed by default because of pointer restriction. Print the Device Tree node name instead which is what was originally intended. Signed-off-by: Florian Fainelli commit 19acd03d95dad1f50d06f28179a1866fca431fed Author: Marco Elver Date: Fri Apr 24 17:47:29 2020 +0200 kcsan: Add __kcsan_{enable,disable}_current() variants The __kcsan_{enable,disable}_current() variants only call into KCSAN if KCSAN is enabled for the current compilation unit. Note: This is typically not what we want, as we usually want to ensure that even calls into other functions still have KCSAN disabled. These variants may safely be used in header files that are shared between regular kernel code and code that does not link the KCSAN runtime. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 5099a722e9727fe9a93fac51e961735f40e5b6c8 Author: Marco Elver Date: Wed Apr 1 12:17:14 2020 +0200 checkpatch: Warn about data_race() without comment Warn about applications of data_race() without a comment, to encourage documenting the reasoning behind why it was deemed safe. Suggested-by: Will Deacon Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit d163a95cf00130d8d980cbf16675337caeb9cdad Author: Jason Yan Date: Wed Apr 22 15:18:54 2020 +0800 fbdev: aty: use true, false for bool variables in atyfb_base.c Fix the following coccicheck warning: drivers/video/fbdev/aty/atyfb_base.c:3822:3-10: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/aty/atyfb_base.c:3824:3-9: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200422071854.513-1-yanaijie@huawei.com commit dbc7ece12a38889ceb3d7f99dad269822f6bd34e Author: Jason Yan Date: Wed Apr 22 15:18:45 2020 +0800 video: uvesafb: use true,false for bool variables Fix the following coccicheck warning: drivers/video/fbdev/uvesafb.c:48:12-17: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/uvesafb.c:1827:3-13: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/uvesafb.c:1829:3-13: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/uvesafb.c:1835:3-9: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/uvesafb.c:1837:3-9: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/uvesafb.c:1839:3-8: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200422071845.403-1-yanaijie@huawei.com commit 7022537b58d82d3db30bc99664d8de5f45ec29aa Author: Jason Yan Date: Wed Apr 22 15:18:36 2020 +0800 video: udlfb: use true,false for bool variables Fix the following coccicheck warning: drivers/video/fbdev/udlfb.c:67:12-19: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/udlfb.c:68:12-20: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/udlfb.c:69:12-18: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200422071836.49123-1-yanaijie@huawei.com commit 13e9bd05b3d549ecd5d6103ebc74671889aff314 Author: Jason Yan Date: Wed Apr 22 15:18:26 2020 +0800 video: fbdev: i810: use true,false for bool variables Fix the following coccicheck warning: drivers/video/fbdev/i810/i810_main.c:1969:3-7: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/i810/i810_main.c:1971:3-8: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/i810/i810_main.c:1973:3-9: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/i810/i810_main.c:1975:3-7: WARNING: Assignment of 0/1 to bool variable drivers/video/fbdev/i810/i810_main.c:2001:3-9: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200422071826.49038-1-yanaijie@huawei.com commit 24fe5f2ab2478053d50a3bc629ada895903a5cbc Author: Chris Wilson Date: Wed May 6 17:21:36 2020 +0100 drm/i915: Propagate error from completed fences We need to preserve fatal errors from fences that are being terminated as we hook them up. Fixes: ef4688497512 ("drm/i915: Propagate fence errors") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200506162136.3325-1-chris@chris-wilson.co.uk commit 22d48ad7bfacda05900c3f7b43510fc4d40d5d53 Author: Jarkko Nikula Date: Wed May 6 18:30:25 2020 +0300 spi: dw: Add Elkhart Lake PSE DMA support Elkhart Lake PSE SPI is capable to utilize PSE DMA engine which is described in ACPI. With help of acpi-dma module the support becomes a generic one. Thus, add Elkhart Lake PSE DMA support and generic DMA hooks in SPI DesignWare driver. Signed-off-by: Jarkko Nikula Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-8-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 6370ababce81911576d7c96663ae64fb84820c7b Author: Andy Shevchenko Date: Wed May 6 18:30:24 2020 +0300 spi: dw: Propagate struct device pointer to ->dma_init() callback In some cases, one of which is coming soon, we would like to have a struct device pointer to request DMA channel. For this purpose propagate it to ->dma_init() callback in DMA ops. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-7-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 37aa8aa68492deb56f9e4c8b2d00aa5d9dae7da2 Author: Andy Shevchenko Date: Wed May 6 18:30:23 2020 +0300 spi: dw: Add 'mfld' suffix to Intel Medfield related routines In order to prepare driver for the extension to support newer hardware, add 'mfld' suffix to some related functions. While here, move DMA parameters assignment under existing #ifdef CONFIG_SPI_DW_MID_DMA. There is no functional change intended. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-6-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit e7940952644558e680033ae0450978445e53b423 Author: Andy Shevchenko Date: Wed May 6 18:30:22 2020 +0300 spi: dw: Move few headers under #ifdef CONFIG_SPI_DW_MID_DMA There is no user of few headers without CONFIG_SPI_DW_MID_DMA being set. Move them under condition. While at it, remove unused slab.h there. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-5-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit e62a15d97b0adede829ba5b4f1c8e28f230bd8e8 Author: Andy Shevchenko Date: Wed May 6 18:30:21 2020 +0300 spi: dw: Downgrade interrupt.h to irqreturn.h where appropriate spi-dw-mid.c along with spi-dw.h are direct users of irqreturn.h and nothing else is being used from interrupt.h. So, switch them to use the former instead of latter one. While here, move the header under #ifdef CONFIG_SPI_DW_MID_DMA in spi-dw-mid.c. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 0c2ce3fe4dd0b8f8dda07ea029f51ddf4c5190c2 Author: Andy Shevchenko Date: Wed May 6 18:30:20 2020 +0300 spi: dw: Move interrupt.h to spi-dw.h who is user of it The actual user of interrupt.h is spi-dw.h and not bus drivers. Move header there. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit d4dd6c0a404a2ed3843b4b685d6990c4438a64c0 Author: Andy Shevchenko Date: Wed May 6 18:30:19 2020 +0300 spi: dw: Remove unused variable in CR0 configuring hooks After enabling new IP support in the driver couple of variables were left unused compiler is not happy about: .../spi-dw.c: In function ‘dw_spi_update_cr0’: .../spi-dw.c:264:17: warning: unused variable ‘dws’ [-Wunused-variable] 264 | struct dw_spi *dws = spi_controller_get_devdata(master); | ^~~ .../spi-dw.c: In function ‘dw_spi_update_cr0_v1_01a’: .../spi-dw.c:285:17: warning: unused variable ‘dws’ [-Wunused-variable] 285 | struct dw_spi *dws = spi_controller_get_devdata(master); | ^~~ Drop them for good. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200506153025.21441-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 3cb97e223d277f84171cc4ccecab31e08b2ee7b5 Author: Andy Shevchenko Date: Wed May 6 18:30:18 2020 +0300 spi: dw: Zero DMA Tx and Rx configurations on stack Some DMA controller drivers do not tolerate non-zero values in the DMA configuration structures. Zero them to avoid issues with such DMA controller drivers. Even despite above this is a good practice per se. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Signed-off-by: Andy Shevchenko Acked-by: Feng Tang Cc: Feng Tang Link: https://lore.kernel.org/r/20200506153025.21441-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 94ea9681a9f5c7a72ae63c015e44a02530927b61 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:29 2020 +0300 ARM: dts: tegra30: beaver: Add CPU Operating Performance Points Utilize common Tegra30 CPU OPP table. CPU DVFS is available now on beaver. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit ae05ddc9b38076c2e4d4ce7363070a7b611eaa39 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:28 2020 +0300 ARM: dts: tegra30: beaver: Set up voltage regulators for DVFS Set min/max voltage and couple CPU/CORE regulators. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit b9bf73aed99ed3170b37fbbf98557c70a6f19e50 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:27 2020 +0300 ARM: tegra: Create tegra20-cpufreq platform device on Tegra30 The tegra20-cpufreq now instantiates cpufreq-dt and Tegra30 is fully supported by that driver. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 9ce274630495c731257fb1b569dd7b84a2fdba14 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:26 2020 +0300 cpufreq: tegra20: Use generic cpufreq-dt driver (Tegra30 supported now) Re-parenting to intermediate clock is supported now by the clock driver and thus there is no need in a customized CPUFreq driver, all that code is common for both Tegra20 and Tegra30. The available CPU freqs are now specified in device-tree in a form of OPPs, all users should update their device-trees. Acked-by: Viresh Kumar Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 04985d00e2c949f81dfdf4d76de97881690c6613 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:24 2020 +0300 ARM: tegra: Don't enable PLLX while resuming from LP1 on Tegra30 PLLX may be kept disabled if cpufreq driver selects some other clock for CPU. In that case PLLX will be disabled later in the resume path by the CLK driver, which also can enable PLLX if necessary by itself. Thus there is no need to enable PLLX early during resume. Tegra114/124 CLK drivers do not manage PLLX on resume and thus they are left untouched by this patch. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d3c32c04adfdb6c646722dc5fde1a3d88f293fd4 Author: Dmitry Osipenko Date: Thu Mar 19 22:02:23 2020 +0300 ARM: tegra: Switch CPU to PLLP on resume from LP1 on Tegra30/114/124 The early-resume code shall not switch CPU to PLLX because PLLX configuration could be unstable or PLLX should be simply disabled if CPU enters into suspend running off some other PLL (the case if CPUFREQ driver is active). The actual burst policy is restored by the clock drivers. Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Marcel Ziswiler Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 35509737c8f958944e059d501255a0bf18361ba0 Author: Dmitry Osipenko Date: Fri Mar 13 12:01:04 2020 +0300 ARM: tegra: Correct PL310 Auxiliary Control Register initialization The PL310 Auxiliary Control Register shouldn't have the "Full line of zero" optimization bit being set before L2 cache is enabled. The L2X0 driver takes care of enabling the optimization by itself. This patch fixes a noisy error message on Tegra20 and Tegra30 telling that cache optimization is erroneously enabled without enabling it for the CPU: L2C-310: enabling full line of zeros but not enabled in Cortex-A9 Cc: Signed-off-by: Dmitry Osipenko Tested-by: Nicolas Chauvet Signed-off-by: Thierry Reding commit fafd62e7688096dcfe4107d7a2f6c7c6eb6045de Author: Dmitry Osipenko Date: Wed Mar 25 01:43:35 2020 +0300 cpuidle: tegra: Support CPU cluster power-down state on Tegra30 The new Tegra CPU Idle driver now has a unified code path for the coupled CC6 (LP2) state, this allows to enable the deepest idling state on Tegra30 SoC where the whole CPU cluster is power-gated. Tested-by: Michał Mirosław Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Peter Geis Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1555547ddaae597c5c8f7d22b59e1c67c0bb82ab Merge: 8f3d9f354286 38743e414e7c Author: Thierry Reding Date: Wed May 6 18:42:28 2020 +0200 Merge branch 'for-5.8/arm/core' into for-5.8/cpuidle commit 38743e414e7cc6d23f41276f298ad4781890a89f Author: Dmitry Osipenko Date: Wed Mar 25 01:43:34 2020 +0300 ARM: tegra: Do not fully reinitialize L2 on resume ASUS TF300T device may not work properly if firmware is asked to fully re-initialize L2 cache after resume from LP2 suspend. The downstream kernel of TF300T uses different opcode to enable cache after resuming from LP2, this opcode also works fine on Nexus 7 and Ouya devices. Supposedly, this may be needed by an older firmware versions. Reported-by: Michał Mirosław Tested-by: Michał Mirosław Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Peter Geis Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 36dc3b1a7e9dd332d224cc187acdaa9f2023a1f1 Author: Dmitry Osipenko Date: Wed Mar 25 01:43:33 2020 +0300 ARM: tegra: Initialize r0 register for firmware wake-up Downstream kernel of ASUS TF300T sets r0 to #3. There is no explanation in downstream code whether this is really needed and some of T30 downstream kernels have and explicit comment telling that all arguments are ignored by firmware. Let's take a safe side by replicating behavior of the TF300T downstream kernel. This change works fine on Ouya and Nexus 7 devices. Tested-by: Michał Mirosław Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Peter Geis Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 836ca00819832fae9d5aacda23637a7e58a6bdbd Merge: 8f3d9f354286 b720aaa347f2 Author: Thierry Reding Date: Wed May 6 18:28:52 2020 +0200 Merge branch 'for-5.8/firmware' into for-5.8/arm/core commit b720aaa347f227c416e8aed2f12ca62ea4f1cd4e Author: Dmitry Osipenko Date: Wed Mar 25 01:43:34 2020 +0300 firmware: tf: Different way of L2 cache enabling after LP2 suspend ASUS TF300T device may not work properly if firmware is asked to fully re-initialize L2 cache after resume from LP2 suspend. The downstream kernel of TF300T uses different opcode to enable cache after resuming from LP2, this opcode also works fine on Nexus 7 and Ouya devices. Supposedly, this may be needed by an older firmware versions. Reported-by: Michał Mirosław Tested-by: Michał Mirosław Tested-by: Jasper Korten Tested-by: David Heidelberg Tested-by: Peter Geis Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit adb69968074a22376074aaa7f7971d93636b4332 Author: Tang Bin Date: Wed May 6 22:30:09 2020 +0800 ASoC: mediatek: Fix error handling If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in mt6797_afe_pcm_dev_probe(). And when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200506143009.13368-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit 0c4d5ba1b998e713815b7790d3db6ced0ae49489 Author: Reinette Chatre Date: Tue May 5 15:36:18 2020 -0700 x86/resctrl: Support wider MBM counters The original Memory Bandwidth Monitoring (MBM) architectural definition defines counters of up to 62 bits in the IA32_QM_CTR MSR while the first-generation MBM implementation uses statically defined 24 bit counters. The MBM CPUID enumeration properties have been expanded to include the MBM counter width, encoded as an offset from 24 bits. While eight bits are available for the counter width offset IA32_QM_CTR MSR only supports 62 bit counters. Add a sanity check, with warning printed when encountered, to ensure counters cannot exceed the 62 bit limit. Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/69d52abd5b14794d3a0f05ba7c755ed1f4c0d5ed.1588715690.git.reinette.chatre@intel.com commit f3d44f18b0662327c42128b9d3604489bdb6e36f Author: Reinette Chatre Date: Tue May 5 15:36:17 2020 -0700 x86/resctrl: Support CPUID enumeration of MBM counter width The original Memory Bandwidth Monitoring (MBM) architectural definition defines counters of up to 62 bits in the IA32_QM_CTR MSR while the first-generation MBM implementation uses statically defined 24 bit counters. Expand the MBM CPUID enumeration properties to include the MBM counter width. The previously undefined EAX output register contains, in bits [7:0], the MBM counter width encoded as an offset from 24 bits. Enumerating this property is only specified for Intel CPUs. Suggested-by: Borislav Petkov Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/afa3af2f753f6bc301fb743bc8944e749cb24afa.1588715690.git.reinette.chatre@intel.com commit 46637d4570e108d1f6721cfa2cca1d078882761a Author: Reinette Chatre Date: Tue May 5 15:36:16 2020 -0700 x86/resctrl: Maintain MBM counter width per resource The original Memory Bandwidth Monitoring (MBM) architectural definition defines counters of up to 62 bits in the IA32_QM_CTR MSR, and the first-generation MBM implementation uses 24 bit counters. Software is required to poll at 1 second or faster to ensure that data is retrieved before a counter rollover occurs more than once under worst conditions. As system bandwidths scale the software requirement is maintained with the introduction of a per-resource enumerable MBM counter width. In preparation for supporting hardware with an enumerable MBM counter width the current globally static MBM counter width is moved to a per-resource MBM counter width. Currently initialized to 24 always to result in no functional change. In essence there is one function, mbm_overflow_count() that needs to know the counter width to handle rollovers. The static value used within mbm_overflow_count() will be replaced with a value discovered from the hardware. Support for learning the MBM counter width from hardware is added in the change that follows. Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/e36743b9800f16ce600f86b89127391f61261f23.1588715690.git.reinette.chatre@intel.com commit 923f3a2b48bdccb6a1d1f0dd48de03de7ad936d9 Author: Reinette Chatre Date: Tue May 5 15:36:15 2020 -0700 x86/resctrl: Query LLC monitoring properties once during boot Cache and memory bandwidth monitoring are features that are part of x86 CPU resource control that is supported by the resctrl subsystem. The monitoring properties are obtained via CPUID from every CPU and only used within the resctrl subsystem where the properties are only read from boot_cpu_data. Obtain the monitoring properties once, placed in boot_cpu_data, via the ->c_bsp_init() helpers of the vendors that support X86_FEATURE_CQM_LLC. Suggested-by: Borislav Petkov Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/6d74a6ac3e69f4b7a8b4115835f9455faf0f468d.1588715690.git.reinette.chatre@intel.com commit f0d339db56478e3bcd98d5e985d3d69cacf27549 Author: Reinette Chatre Date: Tue May 5 15:36:14 2020 -0700 x86/resctrl: Remove unnecessary RMID checks The cache and memory bandwidth monitoring properties are read using CPUID on every CPU. After the information is read from the system a sanity check is run to (1) ensure that the RMID data is initialized for the boot CPU in case the information was not available on the boot CPU and (2) the boot CPU's RMID is set to the minimum of RMID obtained from all CPUs. Every known platform that supports resctrl has the same maximum RMID on all CPUs. Both sanity checks found in x86_init_cache_qos() can thus safely be removed. Suggested-by: Borislav Petkov Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/c9a3b60d34091840c8b0bd1c6fab15e5ba92cb17.1588715690.git.reinette.chatre@intel.com commit 0118ad82c2a64ebcf15d7565ed35361407efadfa Author: Reinette Chatre Date: Tue May 5 15:36:13 2020 -0700 x86/cpu: Move resctrl CPUID code to resctrl/ The function determining a platform's support and properties of cache occupancy and memory bandwidth monitoring (properties of X86_FEATURE_CQM_LLC) can be found among the common CPU code. After the feature's properties is populated in the per-CPU data the resctrl subsystem is the only consumer (via boot_cpu_data). Move the function that obtains the CPU information used by resctrl to the resctrl subsystem and rename it from init_cqm() to resctrl_cpu_detect(). The function continues to be called from the common CPU code. This move is done in preparation of the addition of some vendor specific code. No functional change. Suggested-by: Borislav Petkov Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/38433b99f9d16c8f4ee796f8cc42b871531fa203.1588715690.git.reinette.chatre@intel.com commit 8dd97c65185c5a63c668e5bd8a861c04f47a35ed Author: Reinette Chatre Date: Tue May 5 15:36:12 2020 -0700 x86/resctrl: Rename asm/resctrl_sched.h to asm/resctrl.h asm/resctrl_sched.h is dedicated to the code used for configuration of the CPU resource control state when a task is scheduled. Rename resctrl_sched.h to resctrl.h in preparation of additions that will no longer make this file dedicated to work done during scheduling. No functional change. Suggested-by: Borislav Petkov Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/6914e0ef880b539a82a6d889f9423496d471ad1d.1588715690.git.reinette.chatre@intel.com commit 11a0ae4c4bff9b2a471b54dbe910fc0f60e58e62 Author: Jason Gunthorpe Date: Tue Apr 21 20:24:40 2020 +0300 RDMA: Allow ib_client's to fail when add() is called When a client is added it isn't allowed to fail, but all the client's have various failure paths within their add routines. This creates the very fringe condition where the client was added, failed during add and didn't set the client_data. The core code will then still call other client_data centric ops like remove(), rename(), get_nl_info(), and get_net_dev_by_params() with NULL client_data - which is confusing and unexpected. If the add() callback fails, then do not call any more client ops for the device, even remove. Remove all the now redundant checks for NULL client_data in ops callbacks. Update all the add() callbacks to return error codes appropriately. EOPNOTSUPP is used for cases where the ULP does not support the ib_device - eg because it only works with IB. Link: https://lore.kernel.org/r/20200421172440.387069-1-leon@kernel.org Signed-off-by: Leon Romanovsky Acked-by: Ursula Braun Signed-off-by: Jason Gunthorpe commit dd4441ab1fa1e2787a5f218f92d8ead1aa5ce6b5 Author: Wei Yongjun Date: Wed May 6 12:56:07 2020 +0000 spi: bcm2835: Fix error return code in bcm2835_dma_init() Fix to return negative error code -ENOMEM from the dma mapping error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200506125607.90952-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit 5b684514af9052fdbaa60895620f75928a134196 Author: Jason Yan Date: Wed May 6 14:19:11 2020 +0800 spi: a3700: make a3700_spi_init() return void Fix the following coccicheck warning: drivers/spi/spi-armada-3700.c:283:8-11: Unneeded variable: "ret". Return "0" on line 315 Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200506061911.19923-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 04c349a96506961b1b31e8d03e784fe3c5413e0b Author: Maor Gottlieb Date: Mon Apr 13 16:24:08 2020 +0300 RDMA/mad: Remove snoop interface Snoop interface is not used. Remove it. Link: https://lore.kernel.org/r/20200413132408.931084-1-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit aab5fd7a1b7b931487694b527322f48f423701c7 Author: Jason Yan Date: Wed May 6 14:17:26 2020 +0800 regulator: db8500-prcmu: Use true,false for bool variable Fix the following coccicheck warning: drivers/regulator/db8500-prcmu.c:184:1-17: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200506061726.19289-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 5a8117840a8c654c3cdf2f465e9406112d7e492d Author: Akshu Agrawal Date: Wed May 6 15:56:00 2020 +0530 ASoC: amd :High hw_level while simultaneous capture Simultaneous capture on dmic and headset mic is having issue with high hw_level being reported. Issue Can be reproduced by: arecord -D hw:2,0 -f dat -d 60 /tmp/test0 & arecord -D hw:2,2 -f dat -d 60 /tmp/test1 & cat /proc/asound/card2/pcm?c/sub0/status Actual issue is : When we open one capture stream on one instance lets say I2S_SP and then once again if we open other capture on other instance lets say I2S_BT while first capture is in progress and when we try to read the status of both running instances by below command cat /proc/asound/card2/pcm?c/sub0/status we observe that avail_max is being doubled on first opened capture(I2S_SP in the example). This is because our previous implementation was like when any instance is opened it gets initialized in dma_open irrespective of on what instance it called open. For example: First I2S_SP called opened it initializes both SP/BT capture streams irrespective of on which instance the stream opened.next time I2S_BT called opened and it initializes both SP/BT this corrupts the behaviour . So with this patch the stream gets initialized only on specific instance when ever it gets opened calls hw_params. This rectifies the issue. Signed-off-by: Ravulapati Vishnu vardhan rao Signed-off-by: Akshu Agrawal Link: https://lore.kernel.org/r/20200506102602.140790-1-akshu.agrawal@amd.com Signed-off-by: Mark Brown commit 23a457b8d57dc8d0cc1dbd1882993dd2fcc4b0c0 Author: Jason J. Herne Date: Tue Mar 3 14:11:19 2020 -0500 s390: nvme reipl Populate sysfs and structs with reipl entries for nvme ipl type. This allows specifying a target nvme device when rebooting/reipling. Signed-off-by: Jason J. Herne Signed-off-by: Vasily Gorbik commit 3737e8ee4f2fc7e77994d1a8bd618a9dda5a5514 Author: Jason J. Herne Date: Mon Mar 2 14:03:37 2020 -0500 s390: nvme ipl Recognize IPL Block's Ipl Type of "nvme". Populate related structs and sysfs entries. Signed-off-by: Jason J. Herne Signed-off-by: Vasily Gorbik commit 9056754f65052bed370df04523dc3e8628948f9c Author: Pierre Morel Date: Thu Apr 30 04:02:17 2020 -0400 s390/pci: Documentation update for s390 PCI Clarify the documentation. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit d1379279f2d6b407bd08324a170cb21928e69854 Author: Pierre Morel Date: Tue Apr 28 11:25:56 2020 -0400 s390/pci: removes wrong PCI multifunction assignment The assignment of the PCI device multifunction attribute is set during the PCI device probe. There is no need to set it here. Let's do it right and remove this assignment. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 0ba577802b0b183a38a5606e2c67504aba8b6f9d Author: Masahiro Yamada Date: Mon Apr 13 10:31:13 2020 +0900 s390: ptrace: hard-code "s390x" instead of UTS_MACHINE s390 uses the UTS_MACHINE defined arch/s390/Makefile as follows: UTS_MACHINE := s390x We do not need to pass the fixed string from the command line. Hard-code user_regset_view::name, like many other architectures do. Link: https://lkml.kernel.org/r/20200413013113.8529-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada Signed-off-by: Vasily Gorbik commit 5b9f8e4ac9473962fa0e824fd1f04138600d459d Author: Mauro Carvalho Chehab Date: Wed May 6 13:20:51 2020 +0200 media: ipu3.rst: fix a build warning Sphinx 2.4.4 produces this warning: Documentation/admin-guide/media/ipu3.rst:235: WARNING: Title underline too short. Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6ba189d3f78c331153c4a6eb27163e27fc274123 Author: Hans Verkuil Date: Wed May 6 14:16:00 2020 +0200 media: vidioc-enum-fmt.rst: make the ENUM_FMT text clearer Rework the documentation to make it easier for the reader to understand the differences in behavior of this ioctl between MC and non-MC drivers. Note the addition of the 'video-node-centric' and 'MC-centric' terms to help understand what the IO_MC capability really means. Also mention in the beginning that mbus_code is one of the fields that application should initialize, and add META_OUTPUT as one of the types that this ioctl supports (that was never added here when the META_OUTPUT buffer type was added). Finally document that EINVAL will be returned if mbus_code is unsupported. Fixes: e5b6b07a1b45 ("media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices") Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 438d8cafe4828bfaf9ffd8e939e50ea6941501e5 Author: Arnd Bergmann Date: Tue Apr 28 23:29:11 2020 +0200 watchdog: iTCO: fix link error When the MFD driver is a loadable module, the watchdog driver fails to get linked into the kernel: drivers/watchdog/iTCO_wdt.o: In function `update_no_reboot_bit_pmc': iTCO_wdt.c:(.text+0x54f): undefined reference to `intel_pmc_gcr_update' The code is written to support operation without the MFD driver, so add a Kconfig dependency that allows this, while disallowing the watchdog to be built-in when the MFD driver is a module. Fixes: 25f1ca31e230 ("platform/x86: intel_pmc_ipc: Convert to MFD") Signed-off-by: Arnd Bergmann Acked-by: Guenter Roeck Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 57253ccd5831e7e5720c433437775c3e6b7d0c72 Author: Hyunki Koo Date: Wed May 6 17:02:40 2020 +0900 serial: samsung: 32-bit access for TX/RX hold registers Support 32-bit access for the TX/RX hold registers UTXH and URXH. This is required for some newer SoCs. Signed-off-by: Hyunki Koo Reviewed-by: Krzysztof Kozlowski Tested on Odroid HC1 (Exynos5422): Tested-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200506080242.18623-3-hyunki00.koo@samsung.com Signed-off-by: Greg Kroah-Hartman commit 7ad3bee4b3e39aad761461f64cf18247f7bdf59c Author: Hyunki Koo Date: Wed May 6 17:02:39 2020 +0900 serial: samsung: dt-bindings: Add reg-io-width compatible Add a description for reg-io-width options for the samsung serial UART peripheral. Signed-off-by: Hyunki Koo Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200506080242.18623-2-hyunki00.koo@samsung.com Signed-off-by: Greg Kroah-Hartman commit 8fba6c0c4c4a5291a62dd231e996eff09725489f Author: Hyunki Koo Date: Wed May 6 17:02:38 2020 +0900 serial: samsung: Replace rd_regb/wr_regb with rd_reg/wr_reg This patch change the name of macro for general usage. Signed-off-by: Hyunki Koo Reviewed-by: Krzysztof Kozlowski Tested on Odroid HC1 (Exynos5422): Tested-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200506080242.18623-1-hyunki00.koo@samsung.com Signed-off-by: Greg Kroah-Hartman commit 0a64f38037cc230e2ad888a74263db6f6588cd90 Author: Greg Kroah-Hartman Date: Wed May 6 14:29:02 2020 +0200 Revert "tty: serial: qcom_geni_serial: Use OPP API to set clk/perf state" This reverts commit 3d9231e69831551da3a78a618b31702ea4dedd5e Rajendra writes: Greg, there are other patches in the series which have a dependency on this patch [1] would it be possible for you to drop this patch and instead ack it so it can be taken via the msm tree? So dropping it from here. Reported-by: Rajendra Nayak Cc: Matthias Kaehlcke Cc: Akash Asthana Signed-off-by: Greg Kroah-Hartman commit c7ff09f6e262c1ed3e0bf3d465d5204042957036 Author: Niklas Söderlund Date: Tue Apr 21 15:57:43 2020 +0200 media: vimc: Make use of V4L2_CAP_IO_MC Set the V4L2_CAP_IO_MC capability flag to report this vimc inputs/outputs are controlled by the media graph. Signed-off-by: Niklas Söderlund Signed-off-by: Laurent Pinchart Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 148dd20602d5d9bab5de46fd8a6047ab285ce9c3 Author: Niklas Söderlund Date: Tue Apr 21 15:57:42 2020 +0200 media: staging/intel-ipu3: Make use of V4L2_CAP_IO_MC Set the V4L2_CAP_IO_MC capability flag and remove the driver specific vidioc_enum_{input,output}, vidioc_g_{input,output} and vidioc_s_{input,output} callbacks. Signed-off-by: Niklas Söderlund Acked-by: Sakari Ailus Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d5f74a1eff9aef3ba23673c8ef74719ba8a105f7 Author: Niklas Söderlund Date: Tue Apr 21 15:57:41 2020 +0200 media: rcar-vin: Make use of V4L2_CAP_IO_MC Set the V4L2_CAP_IO_MC capability flag and remove the driver specific vidioc_enum_input, vidioc_g_input and vidioc_s_input callbacks for the media controller enabled part of the driver. Also add support mbus_code filtering for format enumeration. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e5b6b07a1b45dd9d19bec1fa1d60750b0fcf2fb0 Author: Laurent Pinchart Date: Fri Apr 24 15:43:31 2020 +0200 media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices The VIDIOC_ENUM_FMT ioctl enumerates all formats supported by a video node. For MC-centric devices, its behaviour has always been ill-defined, with drivers implementing one of the following behaviours: - No support for VIDIOC_ENUM_FMT at all - Enumerating all formats supported by the video node, regardless of the configuration of the pipeline - Enumerating formats supported by the video node for the active configuration of the connected subdevice The first behaviour is obviously useless for applications. The second behaviour provides the most information, but doesn't offer a way to find what formats are compatible with a given pipeline configuration. The third behaviour fixes that, but with the drawback that applications can't enumerate all supported formats anymore, and have to modify the active configuration of the pipeline to enumerate formats. The situation is messy as none of the implemented behaviours are ideal, and userspace can't predict what will happen as the behaviour is driver-specific. To fix this, let's extend the VIDIOC_ENUM_FMT with a missing capability: enumerating pixel formats for a given media bus code. The media bus code is passed through the v4l2_fmtdesc structure in a new mbus_code field (repurposed from the reserved fields). With this capability in place, applications can enumerate pixel formats for a given media bus code without modifying the active configuration of the device. The current behaviour of the ioctl is preserved when the new mbus_code field is set to 0, ensuring compatibility with existing userspace. The API extension is documented as mandatory for MC-centric devices (as advertised through the V4L2_CAP_IO_MC capability), allowing applications and compliance tools to easily determine the availability of the VIDIOC_ENUM_FMT extension. Signed-off-by: Laurent Pinchart Acked-by: Sakari Ailus Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b72f14ee7eb3e9e2f8a9c4cb807a1ec749a4c022 Author: Laurent Pinchart Date: Tue Apr 21 15:57:39 2020 +0200 media: pci: Fill v4l2_fmtdesc with designated initializers Replace initialization of static const v4l2_fmtdesc instances that specify every struct member with designated initializers. This allows not zeroing the reserved fields explicitly, and will avoid a need to patch these drivers every time a reserved field is repurposed. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f645e6256bd1b12523b759fcc610861fb21c24c7 Author: Niklas Söderlund Date: Tue Apr 21 15:57:38 2020 +0200 media: v4l2-dev/ioctl: Add V4L2_CAP_IO_MC Add a video device capability flag to indicate that its inputs and/or outputs are controlled by the Media Controller instead of the V4L2 API. When this flag is set, ioctl for enum inputs and outputs are automatically enabled and programmed to call a helper function. Suggested-by: Hans Verkuil Signed-off-by: Helen Koike Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 697fa27dc5fb4c669471e728e97f176687982f95 Author: Peter Griffin Date: Fri Mar 6 17:21:13 2020 +0000 reset: hi6220: Add support for AO reset controller This is required to bring Mali450 gpu out of reset. Cc: Peter Griffin Cc: Enrico Weigelt Signed-off-by: Peter Griffin [jstultz: Added comment, Fix void return build issue Reported-by: kbuild test robot ] Signed-off-by: John Stultz Signed-off-by: Philipp Zabel commit 3a5fc2520bc68a59833e0182dad614aa075bacd6 Author: Jerome Brunet Date: Wed Jan 22 10:25:26 2020 +0100 dt-bindings: reset: meson: add gxl internal dac reset Add the reset line of the internal DAC found on the amlogic gxl SoC family Signed-off-by: Jerome Brunet Reviewed-by: Neil Armstrong Signed-off-by: Philipp Zabel commit e08672c039817e978a644bfadcdb0693e4235c9e Author: Anson Huang Date: Wed Feb 26 17:13:51 2020 +0800 reset: imx7: Add support for i.MX8MP SoC i.MX8MP is a new SoC of i.MX8M family, it has same src IP inside but with different module layout, add support for it. Signed-off-by: Anson Huang Signed-off-by: Philipp Zabel commit c4e181d6fec49033f8f2c1b2d8b1de538ad4cd11 Author: Anson Huang Date: Wed Feb 26 17:13:49 2020 +0800 dt-bindings: reset: imx7: Document usage on i.MX8MP SoC The driver now supports i.MX8MP, so update bindings accordingly. Signed-off-by: Anson Huang Reviewed-by: Rob Herring Signed-off-by: Philipp Zabel commit ecd910f4420aa805f6f17050f0d9f31910189bee Author: Anson Huang Date: Wed Feb 26 17:13:48 2020 +0800 dt-bindings: reset: imx7: Add support for i.MX8MN i.MX8MN can reuse i.MX8MQ's reset driver, update the compatible property and related info to support i.MX8MN. Signed-off-by: Anson Huang Acked-by: Rob Herring Signed-off-by: Philipp Zabel commit 62a1d3f623ac0338912fdfbdda9bdac4cadcbc75 Author: Subbaraman Narayanamurthy Date: Thu Apr 23 21:03:37 2020 +0530 backlight: qcom-wled: Add support for WLED5 peripheral that is present on PM8150L PMICs PM8150L WLED supports the following: - Two modulators and each sink can use any of the modulator - Multiple CABC selection options from which one can be selected/enabled - Multiple brightness width selection (12 bits to 15 bits) Signed-off-by: Subbaraman Narayanamurthy Signed-off-by: Kiran Gunda Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones commit 350bd245fc180032b442633d40ab37ff8e60e8eb Author: Hans de Goede Date: Tue Apr 28 16:22:54 2020 +0200 HID: asus: Fix mute and touchpad-toggle keys on Medion Akoya E1239T The mute key, is broken. All the consumer keys on the keyboard USB interface work normally, except for mute which only sends press events and never sends release events. The touchpad key sends the otherwise unused input report with a report-id of 5 on the touchpad interface. It too only sends press events. This also requires extra special handling since the multi-touch touchpad events and the KEY_F21 events for the touchpad toggle must not be send from the same input_dev (userspace cannot handle this). This commit adds special handlig for both, fixing these keys not working. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit e271f6c2df78d60dd4873c790a51dba40e6dfb72 Author: Hans de Goede Date: Tue Apr 28 16:22:53 2020 +0200 HID: asus: Add support for multi-touch touchpad on Medion Akoya E1239T The multi-touch touchpad found on the Medion Akoya E1239T's keyboard-dock, uses the same custom multi-touch protocol as the Asus keyboard-docks (same chipset vendor, Integrated Technology Express / ITE). Add support for this using the existing multi-touch touchpad support in the hid-asus driver. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit a61f9e428bf092349fdfebeee37ddefedd3f0fd1 Author: Hans de Goede Date: Tue Apr 28 16:22:52 2020 +0200 HID: asus: Add report_size to struct asus_touchpad_info Add the report_size to struct asus_touchpad_info instead of calculating it. This is a preparation patch for adding support for the multi-touch touchpad found on the Medion Akoya E1239T's keyboard-dock, which uses the same custom multi-touch protocol as the Asus keyboard-docks (same chipset vendor, Integrated Technology Express / ITE). The only difference in that the Akoya E1239T keyboard-dock's input-reports have a 5 byte footer instead of a 1 byte footer, which requires the report_size to be configurable per touchpad-model. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 4bc43a421218b6cebc7c926fea001b166ea3677c Author: Hans de Goede Date: Tue Apr 28 16:22:51 2020 +0200 HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check Add a hid_is_using_ll_driver(usb_hid_driver) check to ensure that the parent device is an usb_interface, before casting the parent device pointer to an usb_interface pointer with to_usb_interface(). Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit a80b2f309883cb021ac05f992f785f15d7d748cf Author: Hans de Goede Date: Tue Apr 28 16:22:50 2020 +0200 HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dock Before this commit the code was trying to keep the mapping for the left mouse-button, do avoid the hidinput_has_been_populated() check in hid-input.c from triggering and causing the touchpad input_dev ro get cleaned up. But the hidinput_has_been_populated() check happens after the input_configured callback which sets up all the input bit for the touchpad, so there is no need to preserve the left button mapping. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 4e4c60f826772dfeaacdf718f64afa38f46b6875 Author: Hans de Goede Date: Tue Apr 28 16:22:49 2020 +0200 HID: asus: Only set EV_REP if we are adding a mapping Make asus_input_mapping() only set EV_REP if we are adding a mapping. The T100CHI bluetooth keyboard dock has a few input reports for which we do not create any mappings (these input-reports are present in the descriptors but never send). The hid-asus code relies on the HID core not creating input devices for input-reports without any mappings. But the present of the EV_REP but counts as a mapping causing 6 /dev/input/event# nodes to be created for the T100CHI bluetooth keyboard dock. This change brings the amount of created /dev/input/event# nodes / input-devices down to 4. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 4026229934f6ca0cb44af7b9df00e647b2f1f787 Author: Joe Perches Date: Thu Apr 30 12:12:42 2020 -0700 efi/libstub: Correct comment typos Fix a couple typos in comments. Signed-off-by: Joe Perches Link: https://lore.kernel.org/r/ec53e67b3ac928922807db3cb1585e911971dadc.1588273612.git.joe@perches.com Signed-off-by: Ard Biesheuvel commit b85083d162cf7b67aae06c641cb1128164e73d11 Author: Kiran Gunda Date: Thu Apr 23 21:03:36 2020 +0530 dt-bindings: backlight: qcom-wled: Add WLED5 bindings Add WLED5 specific bindings. Signed-off-by: Kiran Gunda Signed-off-by: Subbaraman Narayanamurthy Acked-by: Daniel Thompson Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit f16899a6a7d4b1a73c7e830c31d83582d678e57c Author: Kiran Gunda Date: Thu Apr 23 21:03:35 2020 +0530 backlight: qcom-wled: Add callback functions Add wled_cabc_config, wled_sync_toggle, wled_ovp_fault_status and wled_ovp_delay and wled_auto_detection_required callback functions to prepare the driver for adding WLED5 support. Signed-off-by: Kiran Gunda Signed-off-by: Subbaraman Narayanamurthy Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones commit e0ace1fc40cd5775299ea621cb180d821dc3d4b9 Author: Kiran Gunda Date: Thu Apr 23 21:03:34 2020 +0530 dt-bindings: backlight: qcom-wled: Convert the wled bindings to .yaml format Convert the qcom-wled bindings from .txt to .yaml format. Also replace PM8941 to WLED3 and PMI8998 to WLED4. Signed-off-by: Kiran Gunda Signed-off-by: Subbaraman Narayanamurthy Acked-by: Daniel Thompson Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit 7f65f6118a53eeb3cd9baa0ceb5519b478758cd9 Merge: cbb1404f6541 14dd3a71ccb7 Author: Kalle Valo Date: Wed May 6 12:12:27 2020 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.8. Major changes: ath11k * add 802.11 encapsulation offload on hardware support * add htt_peer_stats_reset debugfs file ath10k * sdio: decrease power consumption * sdio: add HTT TX bundle support to increase throughput * sdio: add rx bitrate reporting ath9k * improvements to AR9002 calibration logic carl9170 * remove buggy P2P_GO support commit b9d3e8a38084b546a2398a1c6de50997e65ba69e Author: Wesley Cheng Date: Wed May 6 01:26:29 2020 -0700 dt-bindings: phy: usb-snps-femto-v2: Add regulator entries to example Fix errors reported by dt_binding_check, due to missing required regulators in the example node. Fixes: f06b9fc9a814 ("dt-bindings: phy: Add binding for qcom,usb-snps-femto-v2") Signed-off-by: Wesley Cheng Reported-by: Rob Herring Link: https://lore.kernel.org/r/1588753589-22673-1-git-send-email-wcheng@codeaurora.org Signed-off-by: Vinod Koul commit cbb1404f65414130fb89e52a97b9d853d303dc5c Author: Jason Yan Date: Mon May 4 19:33:21 2020 +0800 rtlwifi: rtl8188ee: remove Comparison to bool in rf.c Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rf.c:476:6-14: WARNING: Comparison to bool drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rf.c:54:5-22: WARNING: Comparison to bool Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504113321.41118-1-yanaijie@huawei.com commit f8f24ece219204333ac825e9c8aaf3403e201d92 Author: Jason Yan Date: Mon May 4 19:33:11 2020 +0800 b43: remove Comparison of 0/1 to bool variable in pio.c Fix the following coccicheck warning: drivers/net/wireless/broadcom/b43/pio.c:768:10-25: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504113311.41026-1-yanaijie@huawei.com commit e2b9ac59081028d48ec7aa9a3510981eda94c327 Author: Jason Yan Date: Mon May 4 19:33:00 2020 +0800 b43: remove Comparison of 0/1 to bool variable in phy_n.c Fix the following coccicheck warning: drivers/net/wireless/broadcom/b43/phy_n.c:5510:19-32: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504113300.40895-1-yanaijie@huawei.com commit 049ceac308b0d57c4f06b9fb957cdf95d315cf0b Author: Colin Ian King Date: Fri May 1 18:39:00 2020 +0100 libertas_tf: avoid a null dereference in pointer priv Currently there is a check if priv is null when calling lbtf_remove_card but not in a previous call to if_usb_reset_dev that can also dereference priv. Fix this by also only calling lbtf_remove_card if priv is null. It is noteable that there don't seem to be any bugs reported that the null pointer dereference has ever occurred, so I'm not sure if the null check is required, but since we're doing a null check anyway it should be done for both function calls. Addresses-Coverity: ("Dereference before null check") Fixes: baa0280f08c7 ("libertas_tf: don't defer firmware loading until start()") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200501173900.296658-1-colin.king@canonical.com commit 08afb432c996e34e7047110a4d8c6979b8bd2b19 Author: Arnd Bergmann Date: Thu Apr 30 23:30:45 2020 +0200 mwifiex: avoid -Wstringop-overflow warning gcc-10 reports a warning for mwifiex_cmd_802_11_key_material_v1: drivers/net/wireless/marvell/mwifiex/sta_cmd.c: In function 'mwifiex_cmd_802_11_key_material_v1': cc1: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=] In file included from drivers/net/wireless/marvell/mwifiex/sta_cmd.c:23: drivers/net/wireless/marvell/mwifiex/fw.h:993:9: note: at offset 0 to object 'action' with size 2 declared here 993 | __le16 action; | ^~~~~~ As the warning makes no sense, I reported it as a bug for gcc. In the meantime using a temporary pointer for the key data makes the code easier to read and stops the warning. Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94881 Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200430213101.135134-4-arnd@arndb.de commit 1b56bed20212390432541c7a54e5a70561809293 Author: Jason Yan Date: Wed Apr 29 22:09:24 2020 +0800 rtlwifi: remove comparison of 0/1 to bool variable The variable 'rtlpriv->rfkill.rfkill_state' is bool and can directly assigned to bool values. Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/core.c:1725:14-42: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200429140924.7750-1-yanaijie@huawei.com commit 4f5cf93395d747593c7e2cebdc32155931e03594 Author: Jason Yan Date: Mon May 4 19:33:57 2020 +0800 brcmsmac: remove Comparison to bool in brcms_b_txstatus() Fix the following coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c:1060:6-12: WARNING: Comparison to bool Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504113357.41422-1-yanaijie@huawei.com commit 7f26cedfc9fda65d6e8c2aacbf5b43a33a29065c Author: Justin Li Date: Mon May 4 01:07:33 2020 -0500 brcmfmac: Add P2P Action Frame retry delay to fix GAS Comeback Response failure issue It was observed that P2P Cert. 5.1.19: DEVUT responds to Service Discovery request failed due to DUT did not send GAS Comeback Response after receiving request from test bed P2P peer. To fix this issue, we need to add P2P Action Frame retry delay to enhance P2P connection under VSDB and noisy environment, since the peer can be in other channels under VSDB. Signed-off-by: Justin Li Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588572453-194663-4-git-send-email-wright.feng@cypress.com commit 9c29da3f4e7ef9810bdfaf3d8aa5e6d2e33136f8 Author: Joseph Chuang Date: Mon May 4 01:07:32 2020 -0500 brcmfmac: Fix P2P Group Formation failure via Go-neg method P2P group formation fails since either peer is not able to send go-neg confirm or dut is not able to send go-neg response. To fix this, retry limit should be increased and dwell time check should be added. Signed-off-by: Joseph Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588572453-194663-3-git-send-email-wright.feng@cypress.com commit babfd3caf3569e729f38a23dde75f11f5af057f5 Author: Wright Feng Date: Mon May 4 01:07:31 2020 -0500 brcmfmac: support the second p2p connection With RSDB feature, firmware is able to support two P2P-AGO or two P2P-GC at the same time. So we add the second p2p connection type to map to the second P2P connection bsscfg. Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588572453-194663-2-git-send-email-wright.feng@cypress.com commit 191f6b08bfef24e1a9641eaac96ed030a7be4599 Author: Dejin Zheng Date: Mon May 4 16:34:42 2020 +0800 rtw88: fix an issue about leak system resources the related system resources were not released when pci_iomap() return error in the rtw_pci_io_mapping() function. add pci_release_regions() to fix it. Fixes: e3037485c68ec1a ("rtw88: new Realtek 802.11ac driver") Cc: Andy Shevchenko Signed-off-by: Dejin Zheng Acked-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504083442.3033-1-zhengdejin5@gmail.com commit 1757940430efa1b6a4d64074ef50336c6f8a46e6 Author: Ping-Ke Shih Date: Mon May 4 18:50:10 2020 +0800 rtw88: 8723d: add interface configurations table Interface configuration table is used to configure PCI PHY that are normally decided by design or bootstrap pin, and driver can do additional settings by this table. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-9-yhchuang@realtek.com commit fc637a860a825e934886498874f9f8372798a462 Author: Ping-Ke Shih Date: Mon May 4 18:50:09 2020 +0800 rtw88: 8723d: Set IG register for CCK rate DIG sets only one IG register for most chips, but 8723D need to set additional register for CCK rate. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-8-yhchuang@realtek.com commit 439d4a978d4883695d41c38d856676f3a0a806ba Author: Ping-Ke Shih Date: Mon May 4 18:50:08 2020 +0800 rtw88: 8723d: Add chip_ops::false_alarm_statistics This ops is used to do statistics of false alarm periodically, and then fine tune RX initial gain to adaptive different circumstance. There are three steps, hold/get/reset counter, to retrieve false alarm counters that consist of CCK and OFDM. In addition to false alarm counters, it also collects CRC ok/error counters of CCK, OFDM and HT. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-7-yhchuang@realtek.com commit 3ac14439152d88435acd93a74b2dd9715abae42c Author: Ping-Ke Shih Date: Mon May 4 18:50:07 2020 +0800 rtw88: 8723d: some chips don't support LDPC Some chips are not able to receive LDPC packets. Add an attribute to rtw_chip_info to determine if the LDPC capability in [ht/vht]_cap should be advertised or not. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-6-yhchuang@realtek.com commit 614b1f874454b6d01f1e376f72172cba5404e738 Author: Ping-Ke Shih Date: Mon May 4 18:50:06 2020 +0800 rtw88: handle C2H_CCX_TX_RPT to know if packet TX'ed successfully TX status report of 8723D differs from 8822B/8822C, it uses C2H_CCX_TX_RPT (0x03) with different format. With sequence number and TX status, driver can know if certain packet was transmitted successfully. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-5-yhchuang@realtek.com commit 5f028a9cf4b9e503151b25284384269beb0b742e Author: Ping-Ke Shih Date: Mon May 4 18:50:05 2020 +0800 rtw88: 8723d: Add set_channel Set MAC/BB/RF register according to specified channel. The function rtw_set_channel_mac() is used to set MAC registers, but 8723D only need some of them. For channel 14, we need to set different CCK DFIR values, so restore the values when channel 1 to 13 is selected. Spur calibration is needed in channel 13 and 14, and we do notch if spur is over threshold. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-4-yhchuang@realtek.com commit 158441a2bed49ea294cc79709bf88e17a7b71912 Author: Ping-Ke Shih Date: Mon May 4 18:50:04 2020 +0800 rtw88: 8723d: Add query_rx_desc This ops is used to parse RX descriptor to know the length of received packet and containing PHY status. If PHY status is existing, the order is RX descriptor, PHY status and then packet. There are two types of PHY status, named CCK and OFDM. Their size are the same, but formats are different. struct ieee80211_rx_status is also filled depends on above information. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-3-yhchuang@realtek.com commit db39a9ddacada1e4c065d894faa3fa0e1100b10d Author: Ping-Ke Shih Date: Mon May 4 18:50:03 2020 +0800 rtw88: 8723d: Add DIG parameter To improve user experience in field, we need DIG to adjust RX initial gain depends on field situation. Since each chip has its own register address, this commit defines 8723d specific address. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504105010.10780-2-yhchuang@realtek.com commit 1f15d7c8f3fcdf8c89e3c13731b2271e3647bbc4 Author: Jason Yan Date: Sun Apr 26 18:37:09 2020 +0800 ray_cs: use true,false for bool variable Fix the following coccicheck warning: drivers/net/wireless/ray_cs.c:2797:5-14: WARNING: Comparison of 0/1 to bool variable drivers/net/wireless/ray_cs.c:2798:2-11: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200426103709.6730-1-yanaijie@huawei.com commit fb1a9fc550cf748ba1225d734539ae97b5699b02 Author: Jason Yan Date: Sun Apr 26 17:41:15 2020 +0800 rtlwifi: use true,false for bool variable in rtl_init_rfkill() The 'blocked' is a bool variable, and '==' expression itself is bool too. So no need to convert it to 0/1. This fixes the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/base.c:508:13-41: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200426094115.23294-1-yanaijie@huawei.com commit c03e3fe91c1916e5adc97befee1ca5efe5c39bda Author: Christophe JAILLET Date: Fri Apr 24 17:45:27 2020 +0200 ipw2x00: Remove a memory allocation failure log message Axe a memory allocation failure log message. This message is useless and incorrect (vmalloc is not used here for the memory allocation) This has been like that since the very beginning of this driver in commit 43f66a6ce8da ("Add ipw2200 wireless driver.") Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424154527.27309-1-christophe.jaillet@wanadoo.fr commit fd5d781964b05ab586e690923dba6eca3cc16723 Author: Kai-Heng Feng Date: Thu Apr 23 15:30:07 2020 +0800 rtw88: Use udelay instead of usleep in atomic context It's incorrect to use usleep in atomic context. Switch to a macro which uses udelay instead of usleep to prevent the issue. Fixes: 6343a6d4b213 ("rtw88: Add delay on polling h2c command status bit") Signed-off-by: Kai-Heng Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200423073007.3566-1-kai.heng.feng@canonical.com commit 57a29df341466b5cca43ba3d2d7064426727d7c3 Author: Kai-Heng Feng Date: Sat Apr 25 02:49:14 2020 +0800 iopoll: Introduce read_poll_timeout_atomic macro Like read_poll_timeout, an atomic variant for multiple parameter read function can be useful. Will be used by a later patch. Signed-off-by: Kai-Heng Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424184918.30360-1-kai.heng.feng@canonical.com commit a085a1eeea5ed4ae7aa0c19031449ade145110fc Merge: 5447e8e01e10 073ca6a0369e Author: Daniel Borkmann Date: Wed May 6 09:48:16 2020 +0200 Merge branch 'bpf-rv64-jit' Luke Nelson says: ==================== This patch series introduces a set of optimizations to the BPF JIT on RV64. The optimizations are related to the verifier zero-extension optimization and BPF_JMP BPF_K. We tested the optimizations on a QEMU riscv64 virt machine, using lib/test_bpf and test_verifier, and formally verified their correctness using Serval. ==================== Signed-off-by: Daniel Borkmann commit 073ca6a0369e09c586a103e665f2dd67f1c71444 Author: Luke Nelson Date: Tue May 5 17:03:20 2020 -0700 bpf, riscv: Optimize BPF_JSET BPF_K using andi on RV64 This patch optimizes BPF_JSET BPF_K by using a RISC-V andi instruction when the BPF immediate fits in 12 bits, instead of first loading the immediate to a temporary register. Examples of generated code with and without this optimization: BPF_JMP_IMM(BPF_JSET, R1, 2, 1) without optimization: 20: li t1,2 24: and t1,a0,t1 28: bnez t1,0x30 BPF_JMP_IMM(BPF_JSET, R1, 2, 1) with optimization: 20: andi t1,a0,2 24: bnez t1,0x2c BPF_JMP32_IMM(BPF_JSET, R1, 2, 1) without optimization: 20: li t1,2 24: mv t2,a0 28: slli t2,t2,0x20 2c: srli t2,t2,0x20 30: slli t1,t1,0x20 34: srli t1,t1,0x20 38: and t1,t2,t1 3c: bnez t1,0x44 BPF_JMP32_IMM(BPF_JSET, R1, 2, 1) with optimization: 20: andi t1,a0,2 24: bnez t1,0x2c In these examples, because the upper 32 bits of the sign-extended immediate are 0, BPF_JMP BPF_JSET and BPF_JMP32 BPF_JSET are equivalent and therefore the JIT produces identical code for them. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Reviewed-by: Björn Töpel Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20200506000320.28965-5-luke.r.nels@gmail.com commit ca349a6a104e58479defdc08ce56472a48f7cb81 Author: Luke Nelson Date: Tue May 5 17:03:19 2020 -0700 bpf, riscv: Optimize BPF_JMP BPF_K when imm == 0 on RV64 This patch adds an optimization to BPF_JMP (32- and 64-bit) BPF_K for when the BPF immediate is zero. When the immediate is zero, the code can directly use the RISC-V zero register instead of loading a zero immediate to a temporary register first. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Reviewed-by: Björn Töpel Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20200506000320.28965-4-luke.r.nels@gmail.com commit 21a099abb765c3754689e1f7ca4536fa560112d0 Author: Luke Nelson Date: Tue May 5 17:03:18 2020 -0700 bpf, riscv: Optimize FROM_LE using verifier_zext on RV64 This patch adds two optimizations for BPF_ALU BPF_END BPF_FROM_LE in the RV64 BPF JIT. First, it enables the verifier zero-extension optimization to avoid zero extension when imm == 32. Second, it avoids generating code for imm == 64, since it is equivalent to a no-op. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Reviewed-by: Björn Töpel Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20200506000320.28965-3-luke.r.nels@gmail.com commit 0224b2acea0f9e3908d33e27b2dcb4e04686e997 Author: Luke Nelson Date: Tue May 5 17:03:17 2020 -0700 bpf, riscv: Enable missing verifier_zext optimizations on RV64 Commit 66d0d5a854a6 ("riscv: bpf: eliminate zero extension code-gen") added support for the verifier zero-extension optimization on RV64 and commit 46dd3d7d287b ("bpf, riscv: Enable zext optimization for more RV64G ALU ops") enabled it for more instruction cases. However, BPF_LSH BPF_X and BPF_{LSH,RSH,ARSH} BPF_K are still missing the optimization. This patch enables the zero-extension optimization for these remaining cases. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Reviewed-by: Björn Töpel Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20200506000320.28965-2-luke.r.nels@gmail.com commit 2ab6096db2f16b3a6adbad252f1be171e649028d Author: Florian Westphal Date: Mon May 4 10:06:09 2020 +0200 xfrm: remove output_finish indirection from xfrm_state_afinfo There are only two implementaions, one for ipv4 and one for ipv6. Both are almost identical, they clear skb->cb[], set the TRANSFORMED flag in IP(6)CB and then call the common xfrm_output() function. By placing the IPCB handling into the common function, we avoid the need for the output_finish indirection as the output functions can simply use xfrm_output(). Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit f3075f48ddb2c4d076aeda36fa0939163e4b2816 Author: Florian Westphal Date: Mon May 4 10:06:08 2020 +0200 xfrm: remove extract_output indirection from xfrm_state_afinfo Move this to xfrm_output.c. This avoids the state->extract_output indirection. This patch also removes the duplicated __xfrm6_extract_header helper added in an earlier patch, we can now use the one from xfrm_inout.h . Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit ede64dd2bfe2710549f1922a214959d966baaac3 Author: Florian Westphal Date: Mon May 4 10:06:07 2020 +0200 xfrm: place xfrm6_local_dontfrag in xfrm.h so next patch can re-use it from net/xfrm/xfrm_output.c without causing a linker error when IPV6 is a module. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 3e50ddd8b8d5067796fc87cbbb25c71451ccb385 Author: Florian Westphal Date: Mon May 4 10:06:06 2020 +0200 xfrm: expose local_rxpmtu via ipv6_stubs We cannot call this function from the core kernel unless we would force CONFIG_IPV6=y. Therefore expose this via ipv6_stubs so we can call it from net/xfrm in the followup patch. Since the call is expected to be unlikely, no extra code for the IPV6=y case is added and we will always eat the indirection cost. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 171916cbd53dec5c7b05efb56a201671d92effc1 Author: Florian Westphal Date: Mon May 4 10:06:05 2020 +0200 xfrm: move xfrm4_extract_header to common helper The function only initializes the XFRM CB in the skb. After previous patch xfrm4_extract_header is only called from net/xfrm/xfrm_{input,output}.c. Because of IPV6=m linker errors the ipv6 equivalent (xfrm6_extract_header) was already placed in xfrm_inout.h because we can't call functions residing in a module from the core. So do the same for the ipv4 helper and place it next to the ipv6 one. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit a269fbfc4e9ffe48c1f8142e60a49b6f2e588c58 Author: Florian Westphal Date: Mon May 4 10:06:04 2020 +0200 xfrm: state: remove extract_input indirection from xfrm_state_afinfo In order to keep CONFIG_IPV6=m working, xfrm6_extract_header needs to be duplicated. It will be removed again in a followup change when the remaining caller is moved to net/xfrm as well. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 6d64be3da282908bb17b0803b9edad8852ffea56 Author: Florian Westphal Date: Mon May 4 10:06:03 2020 +0200 xfrm: avoid extract_output indirection for ipv4 We can use a direct call for ipv4, so move the needed functions to net/xfrm/xfrm_output.c and call them directly. For ipv6 the indirection can be avoided as well but it will need a bit more work -- to ease review it will be done in another patch. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 79263c3bceb738567ba96bef4940ac58c07a415c Author: Jason Yan Date: Wed May 6 14:17:16 2020 +0800 ALSA: hda: Return true,false for return type bool Fix the following coccicheck warning: include/sound/hdaudio.h:210:73-74: WARNING: return of 0/1 in function 'snd_hdac_is_in_pm' with return type bool include/sound/hdaudio.h:211:76-77: WARNING: return of 0/1 in function 'snd_hdac_is_power_on' with return type bool Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200506061716.19209-1-yanaijie@huawei.com Signed-off-by: Takashi Iwai commit 14dd3a71ccb7081d5d4959370794bbabc3258b34 Author: Gustavo A. R. Silva Date: Mon May 4 15:12:24 2020 -0500 ath11k: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504201224.GA32282@embeddedor commit 450edd2805982d14ed79733a82927d2857b27cac Author: Masashi Honma Date: Tue May 5 06:44:43 2020 +0900 ath9k_htc: Silence undersized packet warnings Some devices like TP-Link TL-WN722N produces this kind of messages frequently. kernel: ath: phy0: Short RX data len, dropping (dlen: 4) This warning is useful for developers to recognize that the device (Wi-Fi dongle or USB hub etc) is noisy but not for general users. So this patch make this warning to debug message. Reported-By: Denis Ref: https://bugzilla.kernel.org/show_bug.cgi?id=207539 Fixes: cd486e627e67 ("ath9k_htc: Discard undersized packets") Signed-off-by: Masashi Honma Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504214443.4485-1-masashi.honma@gmail.com commit ee4dd7061891d7295328302104037520d831ce43 Author: Gustavo A. R. Silva Date: Mon May 4 15:08:38 2020 -0500 ath6kl: Replace zero-length array with flexible-array The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504200838.GA31974@embeddedor commit d7d43782d541edb8596d2f4fc7f41b0734948ec5 Author: Tamizh Chelvam Date: Mon May 4 22:29:28 2020 +0530 ath11k: fix kernel panic by freeing the msdu received with invalid length In certain scenario host receives the packets with invalid length which causes below kernel panic. Free up those msdus to avoid this kernel panic. 2270.028121: <6> task: ffffffc0008306d0 ti: ffffffc0008306d0 task.ti: ffffffc0008306d0 2270.035247: <2> PC is at skb_panic+0x40/0x44 2270.042784: <2> LR is at skb_panic+0x40/0x44 2270.521775: <2> [] skb_panic+0x40/0x44 2270.524039: <2> [] skb_put+0x54/0x5c 2270.529264: <2> [] ath11k_dp_process_rx_err+0x320/0x5b0 [ath11k] 2270.533860: <2> [] ath11k_dp_service_srng+0x80/0x268 [ath11k] 2270.541063: <2> [] ath11k_hal_rx_reo_ent_buf_paddr_get+0x200/0xb64 [ath11k] 2270.547917: <2> [] net_rx_action+0xf8/0x274 2270.556247: <2> [] __do_softirq+0x128/0x228 2270.561625: <2> [] irq_exit+0x84/0xcc 2270.567008: <2> [] __handle_domain_irq+0x8c/0xb0 2270.571695: <2> [] gic_handle_irq+0x6c/0xbc Signed-off-by: Tamizh Chelvam Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588611568-20791-1-git-send-email-tamizhr@codeaurora.org commit 559ef68f5f699647b53ab193d24425308e3e9526 Author: Ashok Raj Nagarajan Date: Mon May 4 22:05:47 2020 +0530 ath11k: Add support to reset htt peer stats This patch add supports to reset the per peer htt stats. Usage: echo 1 > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations//htt_peer_stats_reset While doing so, sync the wmi services between FW and host. Signed-off-by: Ashok Raj Nagarajan Signed-off-by: Tamizh Chelvam Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588610147-20231-1-git-send-email-tamizhr@codeaurora.org commit b14fba7ebd04082f7767a11daea7f12f3593de22 Author: Christian Lamparter Date: Tue May 5 10:42:09 2020 +0300 carl9170: remove P2P_GO support This patch follows up on a bug-report by Frank Schäfer that discovered P2P GO wasn't working with wpa_supplicant. This patch removes part of the broken P2P GO support but keeps the vif switchover code in place. Cc: Link: Reported-by: Frank Schäfer Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200425092811.9494-1-chunkeey@gmail.com commit e7f33e0c52c0df42f817a8468bf55be6648f9b5f Author: John Crispin Date: Tue May 5 10:42:03 2020 +0300 ath11k: add tx hw 802.11 encapsulation offloading support This patch adds support for ethernet rxtx mode to the driver. The feature is enabled via a new module parameter. If enabled to driver will enable the feature on a per vif basis if all other requirements were met. Signed-off-by: Shashidhar Lakkavalli Signed-off-by: John Crispin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200430152814.18481-1-john@phrozen.org commit 1f12096aca212af8fad3ef58d5673cde691a1452 Merge: 140777a3d8df 75358ea359e7 Author: Michael Ellerman Date: Tue May 5 21:36:42 2020 +1000 Merge the lockless page table walk rework into next This merges the lockless page table walk rework series from Aneesh. Because it touches powerpc KVM code we are sharing it with the kvm-ppc tree in our topic/ppc-kvm branch. This is the cover letter from Aneesh: Avoid IPI while updating page table entries. Problem Summary: Slow termination of KVM guest with large guest RAM config due to a large number of IPIs that were caused by clearing level 1 PTE entries (THP) entries. This is shown in the stack trace below. - qemu-system-ppc [kernel.vmlinux] [k] smp_call_function_many - smp_call_function_many - 36.09% smp_call_function_many serialize_against_pte_lookup radix__pmdp_huge_get_and_clear zap_huge_pmd unmap_page_range unmap_vmas unmap_region __do_munmap __vm_munmap sys_munmap system_call __munmap qemu_ram_munmap qemu_anon_ram_free reclaim_ramblock call_rcu_thread qemu_thread_start start_thread __clone Why we need to do IPI when clearing PMD entries: This was added as part of commit: 13bd817bb884 ("powerpc/thp: Serialize pmd clear against a linux page table walk") serialize_against_pte_lookup makes sure that all parallel lockless page table walk completes before we convert a PMD pte entry to regular pmd entry. We end up doing that conversion in the below scenarios 1) __split_huge_zero_page_pmd 2) do_huge_pmd_wp_page_fallback 3) MADV_DONTNEED running parallel to page faults. local_irq_disable and lockless page table walk: The lockless page table walk work with the assumption that we can dereference the page table contents without holding a lock. For this to work, we need to make sure we read the page table contents atomically and page table pages are not going to be freed/released while we are walking the table pages. We can achieve by using a rcu based freeing for page table pages or if the architecture implements broadcast tlbie, we can block the IPI as we walk the page table pages. To support both the above framework, lockless page table walk is done with irq disabled instead of rcu_read_lock() We do have two interface for lockless page table walk, gup fast and __find_linux_pte. This patch series makes __find_linux_pte table walk safe against the conversion of PMD PTE to regular PMD. gup fast: gup fast is already safe against THP split because kernel now differentiate between a pmd split and a compound page split. gup fast can run parallel to a pmd split and we prevent a parallel gup fast to a hugepage split, by freezing the page refcount and failing the speculative page ref increment. Similar to how gup is safe against parallel pmd split, this patch series updates the __find_linux_pte callers to be safe against a parallel pmd split. We do that by enforcing the following rules. 1) Don't reload the pte value, because that can be updated in parallel. 2) Code should be able to work with a stale PTE value and not the recent one. ie, the pte value that we are looking at may not be the latest value in the page table. 3) Before looking at pte value check for _PAGE_PTE bit. We now do this as part of pte_present() check. Performance: This speeds up Qemu guest RAM del/unplug time as below 128 core, 496GB guest: Without patch: munmap start: timer = 13162 ms, PID=7684 munmap finish: timer = 95312 ms, PID=7684 - delta = 82150 ms With patch (upto removing IPI) munmap start: timer = 196449 ms, PID=6681 munmap finish: timer = 196488 ms, PID=6681 - delta = 39ms With patch (with adding the tlb invalidate in pmdp_huge_get_and_clear_full) munmap start: timer = 196345 ms, PID=6879 munmap finish: timer = 196714 ms, PID=6879 - delta = 369ms Link: https://lore.kernel.org/r/20200505071729.54912-1-aneesh.kumar@linux.ibm.com commit 6dbbbccdba6118b30837c42f3d356ecf0aaf4a1f Author: Bryan O'Donoghue Date: Mon May 4 23:43:46 2020 +0100 usb: chipidea: Enable user-space triggered role-switching The flag provided by the USB role-switch logic allow_userspace_control allows user-space to trigger a role-switch. Several other USB controller drivers already enable this feature. Let's switch it on for the chipidea core now also. Cc: Peter Chen Cc: Jun Li Cc: Greg Kroah-Hartman Cc: Liam Girdwood Cc: Mark Brown Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Stephen Boyd Signed-off-by: Bryan O'Donoghue Signed-off-by: Peter Chen commit e48aa1eb443f80fc6953734c805add4fb694b835 Author: Peter Chen Date: Fri Feb 21 21:40:57 2020 +0800 usb: chipidea: udc: add software sg list support The chipidea controller doesn't support short transfer for sg list, so we still keep setting IOC per TD, otherwise, there will be no interrupt for short transfer. Each TD has five entries for data buffer, each data buffer could be non-countinuous 4KB buffer, so it could handle up to 5 sg buffers one time. The benefit of this patch is avoiding OOM for low memory system(eg, 256MB) during large USB transfers, see below for detail. The non-sg handling has not changed. ufb: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0 CPU: 2 PID: 370 Comm: ufb Not tainted 5.4.3-1.1.0+g54b3750d61fd #1 Hardware name: NXP i.MX8MNano DDR4 EVK board (DT) Call trace: dump_backtrace+0x0/0x140 show_stack+0x14/0x20 dump_stack+0xb4/0xf8 warn_alloc+0xec/0x158 __alloc_pages_slowpath+0x9cc/0x9f8 __alloc_pages_nodemask+0x21c/0x280 alloc_pages_current+0x7c/0xe8 kmalloc_order+0x1c/0x88 __kmalloc+0x25c/0x298 ffs_epfile_io.isra.0+0x20c/0x7d0 ffs_epfile_read_iter+0xa8/0x188 new_sync_read+0xe4/0x170 __vfs_read+0x2c/0x40 vfs_read+0xc8/0x1a0 ksys_read+0x68/0xf0 __arm64_sys_read+0x18/0x20 el0_svc_common.constprop.0+0x68/0x160 el0_svc_handler+0x20/0x80 el0_svc+0x8/0xc Mem-Info: active_anon:2856 inactive_anon:5269 isolated_anon:12 active_file:5238 inactive_file:18803 isolated_file:0 unevictable:0 dirty:22 writeback:416 unstable:0 slab_reclaimable:4073 slab_unreclaimable:3408 mapped:727 shmem:7393 pagetables:37 bounce:0 free:4104 free_pcp:118 free_cma:0 Node 0 active_anon:11436kB inactive_anon:21076kB active_file:20988kB inactive_file:75216kB unevictable:0kB isolated(ano Node 0 DMA32 free:16820kB min:1808kB low:2260kB high:2712kB active_anon:11436kB inactive_anon:21076kB active_file:2098B lowmem_reserve[]: 0 0 0 Node 0 DMA32: 508*4kB (UME) 242*8kB (UME) 730*16kB (UM) 21*32kB (UME) 5*64kB (UME) 2*128kB (M) 0*256kB 0*512kB 0*1024kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=32768kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB 31455 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 65536 pages RAM 0 pages HighMem/MovableOnly 10766 pages reserved 0 pages cma reserved 0 pages hwpoisoned Reviewed-by: Jun Li Signed-off-by: Peter Chen commit 380a7843688d1fb61dca1382e715f5f40015f132 Author: Peter Chen Date: Thu Jan 23 14:43:47 2020 +0800 usb: chipidea: usbmisc_imx: using different ops for imx7d and imx7ulp imx7ulp uses different USB PHY with imx7d (MXS PHY vs PICO PHY), so the features are supported by non-core register are a little different. For example, autoresume feature is supported by all controllers for imx7ulp, but for imx7d, it is only supported by non-HSIC controller. Besides, these two platforms use different HSIC controller, imx7ulp needs software operation, but imx7d doesn't. Signed-off-by: Peter Chen commit 5523f06a19502d08449c1e6ca7e33bfc860f6059 Author: Peter Chen Date: Mon Feb 10 18:46:27 2020 +0800 usb: chipidea: pull down dp for possible charger detection operation The bootloader may use device mode, and keep dp up. We need dp to be pulled down before possbile charger detection operation. Signed-off-by: Peter Chen commit 746f316b753a83e366bfc5f936cbf0d72d1c2d1d Author: Jun Li Date: Thu Jan 23 14:35:58 2020 +0800 usb: chipidea: introduce imx7d USB charger detection imx7d (and imx8mm, imx8mn) uses Samsung PHY and USB generic PHY driver. The USB generic PHY driver is impossible to have a charger detection for every user, so we implement USB charger detection routine at glue layer. After the detection has finished, it will notify USB PHY charger framework, and the uevents will be triggered. Signed-off-by: Jun Li Signed-off-by: Peter Chen commit d755cdb1b9d7e1b645e176b97eb137194bbe8cf9 Author: Peter Chen Date: Thu Jan 23 14:00:26 2020 +0800 usb: chipidea: introduce CI_HDRC_CONTROLLER_VBUS_EVENT glue layer use Some vendors glue layer need to handle some events for vbus, eg, some i.mx platforms (imx7d, imx8mm, imx8mn, etc) needs vbus event to handle charger detection, its charger detection is finished at glue layer code, but not at USB PHY driver. Signed-off-by: Peter Chen commit 9b2383a7ac082cf71d4fc462c3ec6d5939cf6a04 Author: Matt Roper Date: Fri May 1 14:37:01 2020 -0700 drm/i915/icp: Add Wa_14010685332 We need to toggle a SDE chicken bit on and then off as the final step when disabling interrupts in preparation for runtime suspend. Bspec: 33450 Bspec: 8402 Cc: Bob Paauwe Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200501213701.371443-1-matthew.d.roper@intel.com Reviewed-by: Bob Paauwe commit 38cdabb7d83522394aaf2de82c3af017ad94e5d8 Author: Christoph Hellwig Date: Tue May 5 12:12:56 2020 +0200 binfmt_elf_fdpic: remove the set_fs(KERNEL_DS) in elf_fdpic_core_dump There is no logic in elf_fdpic_core_dump itself or in the various arch helpers called from it which use uaccess routines on kernel pointers except for the file writes thate are nicely encapsulated by using __kernel_write in dump_emit. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit d2530b436f114dfbd1adc70c59d8d31038318726 Author: Christoph Hellwig Date: Tue May 5 12:12:55 2020 +0200 binfmt_elf: remove the set_fs(KERNEL_DS) in elf_core_dump There is no logic in elf_core_dump itself or in the various arch helpers called from it which use uaccess routines on kernel pointers except for the file writes thate are nicely encapsulated by using __kernel_write in dump_emit. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit fa4751f454e6b51ef93babfd8b6c8b43a65c9db2 Author: Eric W. Biederman Date: Tue May 5 12:12:54 2020 +0200 binfmt_elf: remove the set_fs in fill_siginfo_note The code in binfmt_elf.c is differnt from the rest of the code that processes siginfo, as it sends siginfo from a kernel buffer to a file rather than from kernel memory to userspace buffers. To remove it's use of set_fs the code needs some different siginfo helpers. Add the helper copy_siginfo_to_external to copy from the kernel's internal siginfo layout to a buffer in the siginfo layout that userspace expects. Modify fill_siginfo_note to use copy_siginfo_to_external instead of set_fs and copy_siginfo_to_user. Update compat_binfmt_elf.c to use the previously added copy_siginfo_to_external32 to handle the compat case. Signed-off-by: "Eric W. Biederman" Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit c3b3f52476412a3899f2c65b220075aceb18dd2c Author: Christoph Hellwig Date: Tue May 5 12:12:53 2020 +0200 signal: refactor copy_siginfo_to_user32 Factor out a copy_siginfo_to_external32 helper from copy_siginfo_to_user32 that fills out the compat_siginfo, but does so on a kernel space data structure. With that we can let architectures override copy_siginfo_to_user32 with their own implementations using copy_siginfo_to_external32. That allows moving the x32 SIGCHLD purely to x86 architecture code. As a nice side effect copy_siginfo_to_external32 also comes in handy for avoiding a set_fs() call in the coredump code later on. Contains improvements from Eric W. Biederman and Arnd Bergmann . Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 5456ffdee666c66e27ccc1006f9afe83ad55559f Author: Christoph Hellwig Date: Tue May 5 12:12:52 2020 +0200 powerpc/spufs: simplify spufs core dumping Replace the coredump ->read method with a ->dump method that must call dump_emit itself. That way we avoid a buffer allocation an messing with set_fs() to call into code that is intended to deal with user buffers. For the ->get case we can now use a small on-stack buffer and avoid memory allocations as well. Signed-off-by: Christoph Hellwig Reviewed-by: Arnd Bergmann Reviewed-by: Jeremy Kerr Signed-off-by: Al Viro commit 6904d3d0cb7e151eba5b205ee788c5f39a90308b Author: Christoph Hellwig Date: Tue May 5 12:12:51 2020 +0200 powerpc/spufs: stop using access_ok Just use the proper non __-prefixed get/put_user variants where that is not done yet. Signed-off-by: Christoph Hellwig Signed-off-by: Jeremy Kerr Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 88413a6bfbbe2f648df399b62f85c934460b7a4d Author: Jeremy Kerr Date: Tue May 5 12:12:50 2020 +0200 powerpc/spufs: fix copy_to_user while atomic Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save area data, which we then pass to simple_read_from_buffer. Includes changes from Christoph Hellwig . Fixes: bf1ab978be23 ("[POWERPC] coredump: Add SPU elf notes to coredump.") Signed-off-by: Jeremy Kerr Reviewed-by: Arnd Bergmann [hch: renamed to function to avoid ___-prefixes] Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 01241aa000ab0a685062a448b0d7d97f470f446f Author: Grygorii Strashko Date: Tue May 5 19:21:23 2020 +0300 net: ethernet: ti: am65-cpts: fix build It's possible to have build configuration which will force PTP_1588_CLOCK=m and so TI_K3_AM65_CPTS=m while still have TI_K3_AM65_CPSW_NUSS=y. This will cause build failures: aarch64-linux-gnu-ld: ../drivers/net/ethernet/ti/am65-cpsw-nuss.o: in function `am65_cpsw_init_cpts': ../drivers/net/ethernet/ti/am65-cpsw-nuss.c:1685: undefined reference to `am65_cpts_create' aarch64-linux-gnu-ld: ../drivers/net/ethernet/ti/am65-cpsw-nuss.c:1685:(.text+0x2e20): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `am65_cpts_create' Fix it by adding dependencies from CPTS in TI_K3_AM65_CPSW_NUSS as below: config TI_K3_AM65_CPSW_NUSS ... depends on TI_K3_AM65_CPTS || !TI_K3_AM65_CPTS Note. This will create below dependencies and for NFS boot + CPTS all of them have to be built-in. PTP_1588_CLOCK -> TI_K3_AM65_CPTS -> TI_K3_AM65_CPSW_NUSS While here, clean up TI_K3_AM65_CPTS definition. Fixes: b1f66a5bee07 ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support") Signed-off-by: Grygorii Strashko Reported-by: Anders Roxell Tested-by: Anders Roxell Signed-off-by: David S. Miller commit f989d546a2d5a9f001f6f8be49d98c10ab9b1897 Author: William Tu Date: Tue May 5 09:05:06 2020 -0700 erspan: Add type I version 0 support. The Type I ERSPAN frame format is based on the barebones IP + GRE(4-byte) encapsulation on top of the raw mirrored frame. Both type I and II use 0x88BE as protocol type. Unlike type II and III, no sequence number or key is required. To creat a type I erspan tunnel device: $ ip link add dev erspan11 type erspan \ local 172.16.1.100 remote 172.16.1.200 \ erspan_ver 0 Signed-off-by: William Tu Signed-off-by: David S. Miller commit 730f135104f3afe320d0df4c53c28d6ad9d17d6b Author: Geert Uytterhoeven Date: Tue May 5 15:34:00 2020 +0200 cxgb4/cxgb4vf: Remove superfluous void * cast in debugfs_create_file() call There is no need to cast a typed pointer to a void pointer when calling a function that accepts the latter. Remove it, as the cast prevents further compiler checks. Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 977253df6433f85d5e2cb3ab0f8eb4127f8173dd Author: Chris Wilson Date: Mon May 4 19:07:45 2020 +0100 drm/i915/gt: Stop holding onto the pinned_default_state As we only restore the default context state upon banning a context, we only need enough of the state to run the ring and nothing more. That is we only need our bare protocontext. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Cc: Andi Shyti Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200504180745.15645-1-chris@chris-wilson.co.uk commit 9ea833022b5c887a242c0e3567f540c91f8611e6 Merge: b38eb47f48d0 fea805237dd9 Author: David S. Miller Date: Tue May 5 12:56:52 2020 -0700 Merge branch 'smc-log-state-changes-and-cleanup' Karsten Graul says: ==================== smc: log state changes and cleanup Patch 1 adds the logging of important state changes to enable SMC-R users to detect SMC-R link groups that are not redundant and require user actions. Patch 2 is a contribution to clean up an unused inline function. ==================== Signed-off-by: David S. Miller commit fea805237dd984a71a2c5e5cf074a15505d5ba31 Author: YueHaibing Date: Tue May 5 15:01:21 2020 +0200 net/smc: remove unused inline function smc_curs_read commit bac6de7b6370 ("net/smc: eliminate cursor read and write calls") left behind this. Signed-off-by: YueHaibing Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 0a99be434d145079d0509473b19e840629d851c2 Author: Karsten Graul Date: Tue May 5 15:01:20 2020 +0200 net/smc: log important pnetid and state change events Print to system log when SMC links are available or go down, link group state changes or pnetids are applied to and removed from devices. The log entries are triggered by either user configuration actions or adapter activation/deactivation events and are not expected to happen often. The entries help SMC users to keep track of the SMC link group status and to detect when actions are needed (like to add replacements for failed adapters). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit b38eb47f48d0133298f3d12be3960be2632e8f70 Author: Grygorii Strashko Date: Tue May 5 13:19:35 2020 +0300 dt-binding: net: ti: am65x-cpts: fix dt_binding_check fail Fix dt_binding_check fail: Fix Documentation/devicetree/bindings/net/ti,k3-am654-cpts.yaml: $id: relative path/filename doesn't match actual path or filename expected: http://devicetree.org/schemas/net/ti,k3-am654-cpts.yaml# Unknown file referenced: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/dist-packages/dtschema/schemas/net/ti,am654-cpts.yaml' Documentation/devicetree/bindings/net/ti,k3-am654-cpts.yaml: $id: relative path/filename doesn't match actual path or filename expected: http://devicetree.org/schemas/net/ti,k3-am654-cpts.yaml# Unknown file referenced: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/dist-packages/dtschema/schemas/net/ti,am654-cpts.yaml' Cc: Rob Herring Fixes: 6e87ac748e94 ("dt-binding: ti: am65x: document common platform time sync cpts module") Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit cc31d53f82d7cf8caa3bd7251985fa75fd9efc1c Author: YueHaibing Date: Tue May 5 10:03:07 2020 +0000 net: ipa: remove duplicated include from ipa_mem.c Remove duplicated include. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 19ce2321739da5fc27f6a5ed1e1cb15e384ad030 Author: Arnaldo Carvalho de Melo Date: Tue May 5 13:33:12 2020 -0300 perf flamegraph: Use /bin/bash for report and record scripts As all the other tools/perf/scripts/python/bin/*-{report,record} scripts, fixing the this problem reported by Daniel Diaz: Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf script: Add flamegraph.py script"): ERROR: perf-1.0-r9 do_package_qa: QA Issue: /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained in package perf-python requires /usr/bin/sh, but no providers found in RDEPENDS_perf-python? [file-rdeps] This means that there is a new binary pulled in in the shebang line which was unaccounted for: `/usr/bin/sh`. I don't see any other usage of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu dev machine) but plenty of /bin/sh. This patch is needed: -----8<----------8<----------8<----- diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..a2f3fa25ef81 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/sh perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..b0177355619b 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/sh # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ----->8---------->8---------->8----- Fixes: 5287f9269206 ("perf script: Add flamegraph.py script") Reported-by: Daniel Díaz Acked-by: Andreas Gerstmayr Cc: Adrian Hunter Cc: Jiri Olsa Cc: lkft-triage@lists.linaro.org Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/CAEUSe7_wmKS361mKLTB1eYbzYXcKkXdU26BX5BojdKRz8MfPCw@mail.gmail.com Link: http://lore.kernel.org/lkml/20200505170320.GZ30487@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 168200b6d6ea0cb5765943ec5da5b8149701f36a Author: Leo Yan Date: Tue May 5 21:36:42 2020 +0800 perf cs-etm: Move definition of 'traceid_list' global variable from header file The variable 'traceid_list' is defined in the header file cs-etm.h, if multiple C files include cs-etm.h the compiler might complaint for multiple definition of 'traceid_list'. To fix multiple definition error, move the definition of 'traceid_list' into cs-etm.c. Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") Reported-by: Thomas Backlund Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Reviewed-by: Mike Leach Tested-by: Mike Leach Tested-by: Thomas Backlund Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Tor Jeremiassen Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 32add10f9597f2e4e46fa8342a83ae7bdfefd1ae Author: Ian Rogers Date: Fri May 1 15:13:15 2020 -0700 libsymbols kallsyms: Move hex2u64 out of header hex2u64 is a helper that's out of place in kallsyms.h as not being kallsyms related. Move from kallsyms.h to the only user. Committer notes: Move it out of tools/lib/symbol/kallsyms.c as well, as we had to leave it there in the previous patch lest we break the build. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200501221315.54715-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 53df2b93441289848f5c2e76d19d1569816b2b9d Author: Ian Rogers Date: Fri May 1 15:13:14 2020 -0700 libsymbols kallsyms: Parse using io api 'perf record' will call kallsyms__parse 4 times during startup and process megabytes of data. This changes kallsyms__parse to use the io library rather than fgets to improve performance of the user code by over 8%. Before: Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 103.988 ms (+- 0.203 ms) After: Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 95.571 ms (+- 0.006 ms) For a workload like: $ perf record /bin/true Run under 'perf record -e cycles:u -g' the time goes from: Before 30.10% 1.67% perf perf [.] kallsyms__parse After 25.55% 20.04% perf perf [.] kallsyms__parse So a little under 5% of the start-up time is removed. A lot of what remains is on the kernel side, but caching kallsyms within perf would at least impact memory footprint. Committer notes: The internal/kallsyms-parse bench is run using: [root@five ~]# perf bench internals kallsyms-parse # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 80.381 ms (+- 0.115 ms) [root@five ~]# And this pre-existing test uses these routines to parse kallsyms and then compare with the info obtained from the matching ELF symtab: [root@five ~]# perf test vmlinux 1: vmlinux symtab matches kallsyms : Ok [root@five ~]# Also we can't remove hex2u64() in this patch as this breaks the build: /usr/bin/ld: /tmp/build/perf/perf-in.o: in function `modules__parse': /home/acme/git/perf/tools/perf/util/symbol.c:607: undefined reference to `hex2u64' /usr/bin/ld: /home/acme/git/perf/tools/perf/util/symbol.c:607: undefined reference to `hex2u64' /usr/bin/ld: /tmp/build/perf/perf-in.o: in function `dso__load_perf_map': /home/acme/git/perf/tools/perf/util/symbol.c:1477: undefined reference to `hex2u64' /usr/bin/ld: /home/acme/git/perf/tools/perf/util/symbol.c:1483: undefined reference to `hex2u64' collect2: error: ld returned 1 exit status Leave it there, move it in the next patch. Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200501221315.54715-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 51876bd45263f62083bbb823220bfb48909f313a Author: Ian Rogers Date: Fri May 1 15:13:13 2020 -0700 perf bench: Add kallsyms parsing Add a benchmark for kallsyms parsing. Example output: Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 103.971 ms (+- 0.121 ms) Committer testing: Test Machine: AMD Ryzen 5 3600X 6-Core Processor [root@five ~]# perf bench internals kallsyms-parse # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 79.692 ms (+- 0.101 ms) [root@five ~]# perf stat -r5 perf bench internals kallsyms-parse # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 80.563 ms (+- 0.079 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 81.046 ms (+- 0.155 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 80.874 ms (+- 0.104 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 81.173 ms (+- 0.133 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 81.169 ms (+- 0.074 ms) Performance counter stats for 'perf bench internals kallsyms-parse' (5 runs): 8,093.54 msec task-clock # 0.999 CPUs utilized ( +- 0.14% ) 3,165 context-switches # 0.391 K/sec ( +- 0.18% ) 10 cpu-migrations # 0.001 K/sec ( +- 23.13% ) 744 page-faults # 0.092 K/sec ( +- 0.21% ) 34,551,564,954 cycles # 4.269 GHz ( +- 0.05% ) (83.33%) 1,160,584,308 stalled-cycles-frontend # 3.36% frontend cycles idle ( +- 1.60% ) (83.33%) 14,974,323,985 stalled-cycles-backend # 43.34% backend cycles idle ( +- 0.24% ) (83.33%) 58,712,905,705 instructions # 1.70 insn per cycle # 0.26 stalled cycles per insn ( +- 0.01% ) (83.34%) 14,136,433,778 branches # 1746.632 M/sec ( +- 0.01% ) (83.33%) 141,943,217 branch-misses # 1.00% of all branches ( +- 0.04% ) (83.33%) 8.1040 +- 0.0115 seconds time elapsed ( +- 0.14% ) [root@five ~]# Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200501221315.54715-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 29e2eb2a9e1fac8b320bf2b4c628c336afbdd84f Author: Mike Leach Date: Fri May 1 15:36:15 2020 +0100 perf: cs-etm: Update to build with latest opencsd version. OpenCSD version v0.14.0 adds in a new output element. This is represented by a new value in the generic element type enum, which must be added to the handling code in perf cs-etm-decoder to prevent build errors due to build options on the perf project. This element is not currently used by the perf decoder. Perf build feature test updated to require a minimum of 0.14.0 Tested on Linux 5.7-rc3. Signed-off-by: Mike Leach Reviewed-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200501143615.1180-1-mike.leach@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 51d9635582c55479bf7904fa47e39aef2b323a50 Author: Thomas Richter Date: Wed Apr 15 09:07:44 2020 +0200 perf symbol: Fix kernel symbol address display Running commands ./perf record -e rb0000 -- find . ./perf report -v reveals symbol names and its addresses. There is a mismatch between kernel symbol and address. Here is an example for kernel symbol check_chain_key: 3.55% find /lib/modules/.../build/vmlinux 0xf11ec v [k] check_chain_key This address is off by 0xff000 as can be seen with: [root@t35lp46 ~]# fgrep check_chain_key /proc/kallsyms 00000000001f00d0 t check_chain_key [root@t35lp46 ~]# objdump -t ~/linux/vmlinux| fgrep check_chain_key 00000000001f00d0 l F .text 00000000000001e8 check_chain_key [root@t35lp46 ~]# This function is located in main memory 0x1f00d0 - 0x1f02b4. It has several entries in the perf data file with the correct address: [root@t35lp46 perf]# ./perf report -D -i perf.data.find-bad | \ fgrep SAMPLE| fgrep 0x1f01ec PERF_RECORD_SAMPLE(IP, 0x1): 22228/22228: 0x1f01ec period: 1300000 addr: 0 PERF_RECORD_SAMPLE(IP, 0x1): 22228/22228: 0x1f01ec period: 1300000 addr: 0 The root cause happens when reading symbol tables during perf report. A long gdb call chain leads to machine__deliver_events perf_evlist__deliver_event perf_evlist__deliver_sample build_id__mark_dso_hits thread__find_map(1) Read correct address from sample entry map__load dso__load Some more functions to end up in .... dso__load_sym. Function dso__load_syms checks for kernel relocation and symbol adjustment for the kernel and results in kernel map adjustment of kernel .text segment address (0x100000 on s390) kernel .text segment offset in file (0x1000 on s390). This results in all kernel symbol addresses to be changed by subtracting 0xff000 (on s390). For the symbol check_chain_key we end up with 0x1f00d0 - 0x100000 + 0x1000 = 0xf11d0 and this address is saved in the perf symbol table. This calculation is also applied by the mapping functions map__mapip() and map__unmapip() to map IP addresses to dso mappings. During perf report processing functions process_sample_event (builtin-report.c) machine__resolve thread__find_map hist_entry_iter_add are called. Function thread__find_map(1) takes the correct sample address and applies the mapping function map__mapip() from the kernel dso and saves the modified address in struct addr_location for further reference. From now on this address is used. Funktion process_sample_event() then calls hist_entry_iter_add() to save the address in member ip of struct hist_entry. When samples are displayed using perf_evlist__tty_browse_hists hists__fprintf hist_entry__fprintf hist_entry__snprintf __hist_entry__snprintf _hist_entry__sym_snprintf() This simply displays the address of the symbol and ignores the dso <-> map mappings done in function thread__find_map. This leads to the address mismatch. Output before: ot@t35lp46 perf]# ./perf report -v | fgrep check_chain_key 3.55% find /lib/modules/5.6.0d-perf+/build/vmlinux 0xf11ec v [k] check_chain_key [root@t35lp46 perf]# Output after: [root@t35lp46 perf]# ./perf report -v | fgrep check_chain_key 3.55% find /lib/modules/5.6.0d-perf+/build/vmlinux 0x1f01ec v [k] check_chain_key [root@t35lp46 perf]# Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Cc: Heiko Carstens Cc: Vasily Gorbik Link: http://lore.kernel.org/lkml/20200415070744.59919-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit b14b36d0206549abd843523ae8891591eaceeb6f Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:57:44 2020 -0300 perf inject: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 74aa90e86502f49aee5b2ba3d7bc03ea119a6659 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:57:31 2020 -0300 perf annotate: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 794bca26e537413e3d67e935d7ac4f42d39aeda1 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:57:20 2020 -0300 perf trace: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit ec98b6df37964e5c1ffab4c7e0246f4e612a4196 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:57:01 2020 -0300 perf script: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 3b7313f2d7bbff44ea951c6602bee58c0148cf21 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:56:31 2020 -0300 perf sched: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 3d655813017f62ca3dda1c921f2440cb3052d20d Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:56:18 2020 -0300 perf lock: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 8cf5d0e09df3176f9afd334b77b216cbc6daf239 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:56:02 2020 -0300 perf kmem: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit ddc6999eaf4edfde287ef012591c51f726690778 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:46:34 2020 -0300 perf stat: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 343977534c6997be0bc7d96d99b895548fb5a231 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:45:19 2020 -0300 perf evsel: Rename perf_evsel__store_ids() to evsel__store_id() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 6e6d1d654ecdfd07890f9c0fc30f3222885c7571 Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:44:03 2020 -0300 perf evsel: Rename perf_evsel__env() to evsel__env() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 2bb72dbb826c40e2503949ea5d104c3af976d02c Author: Arnaldo Carvalho de Melo Date: Mon May 4 13:43:03 2020 -0300 perf evsel: Rename perf_evsel__group_idx() to evsel__group_idx() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit ae4308927e488435073a6aaf601a842ff7e5738f Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 11:46:15 2020 -0300 perf evsel: Rename perf_evsel__fallback() to evsel__fallback() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 4f138a9e08a9635ab2b243c1970308766fd14918 Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 11:19:45 2020 -0300 perf evsel: Rename perf_evsel__has*() to evsel__has*() As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit e470daeaa36ad8058cb32616afb8c8d7cfba8456 Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 11:06:45 2020 -0300 perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 6b6017a20650d908d7b5830cc991947991146a5f Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 11:03:49 2020 -0300 perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() As these are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit ea089692733a53ddbe8f4e46d06113c6ca723727 Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 11:00:53 2020 -0300 perf evsel: Rename *perf_evsel__read*() to *evsel__read() As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 53fcfa6b8efe0efdb32236ed75c8c2fdc3aa65d2 Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 10:55:04 2020 -0300 perf evsel: Ditch perf_evsel__cmp(), not used for quite a while In 4c358d5cf361 ("perf stat: Replace transaction event possition check with id check") all its uses were removed, so ditch it. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit c754c382c9a7a546087d3f52f5fcf1e1a8c3ee01 Author: Arnaldo Carvalho de Melo Date: Thu Apr 30 10:51:16 2020 -0300 perf evsel: Rename perf_evsel__is_*() to evsel__is*() As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 3a50dc76058d7cd8315f9c712b793d81a7ff4541 Author: Stephane Eranian Date: Wed Apr 29 16:14:42 2020 -0700 perf pmu: Add perf_pmu__find_by_type helper This is used by libpfm4 during event parsing to locate the pmu for an event. Signed-off-by: Stephane Eranian Reviewed-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Budankov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Florian Fainelli Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jin Yao Cc: Jiwei Sun Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian Link: http://lore.kernel.org/lkml/20200429231443.207201-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ef86146de941f273d669a8e018036f549bf058c Author: Stephane Eranian Date: Wed Apr 29 16:14:41 2020 -0700 tools feature: Add support for detecting libpfm4 libpfm4 provides an alternate command line encoding of perf events. Signed-off-by: Stephane Eranian Reviewed-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Budankov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Florian Fainelli Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jin Yao Cc: Jiwei Sun Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian Link: http://lore.kernel.org/lkml/20200429231443.207201-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4b1984491e65c9592f9f2bfbe8fb5bf4d4e51587 Author: Ian Rogers Date: Wed Apr 29 16:14:40 2020 -0700 perf doc: Pass ASCIIDOC_EXTRA as an argument commit e9cfa47e687d ("perf doc: allow ASCIIDOC_EXTRA to be an argument") allowed ASCIIDOC_EXTRA to be passed as an option to the Documentation Makefile. This change passes ASCIIDOC_EXTRA, set by detected features or command line options, prior to doing a Documentation build. This is necessary to allow conditional compilation, based on configuration variables, in asciidoc code. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Budankov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Florian Fainelli Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jin Yao Cc: Jiwei Sun Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian Link: http://lore.kernel.org/lkml/20200429231443.207201-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 266150c94c69429cf6d18e130237224a047f5061 Author: Ian Rogers Date: Fri Mar 20 11:23:47 2020 -0700 perf mem2node: Avoid double free related to realloc Realloc of size zero is a free not an error, avoid this causing a double free. Caught by clang's address sanitizer: ==2634==ERROR: AddressSanitizer: attempting double-free on 0x6020000015f0 in thread T0: #0 0x5649659297fd in free llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:123:3 #1 0x5649659e9251 in __zfree tools/lib/zalloc.c:13:2 #2 0x564965c0f92c in mem2node__exit tools/perf/util/mem2node.c:114:2 #3 0x564965a08b4c in perf_c2c__report tools/perf/builtin-c2c.c:2867:2 #4 0x564965a0616a in cmd_c2c tools/perf/builtin-c2c.c:2989:10 #5 0x564965944348 in run_builtin tools/perf/perf.c:312:11 #6 0x564965943235 in handle_internal_command tools/perf/perf.c:364:8 #7 0x5649659440c4 in run_argv tools/perf/perf.c:408:2 #8 0x564965942e41 in main tools/perf/perf.c:538:3 0x6020000015f0 is located 0 bytes inside of 1-byte region [0x6020000015f0,0x6020000015f1) freed by thread T0 here: #0 0x564965929da3 in realloc third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3 #1 0x564965c0f55e in mem2node__init tools/perf/util/mem2node.c:97:16 #2 0x564965a08956 in perf_c2c__report tools/perf/builtin-c2c.c:2803:8 #3 0x564965a0616a in cmd_c2c tools/perf/builtin-c2c.c:2989:10 #4 0x564965944348 in run_builtin tools/perf/perf.c:312:11 #5 0x564965943235 in handle_internal_command tools/perf/perf.c:364:8 #6 0x5649659440c4 in run_argv tools/perf/perf.c:408:2 #7 0x564965942e41 in main tools/perf/perf.c:538:3 previously allocated by thread T0 here: #0 0x564965929c42 in calloc third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x5649659e9220 in zalloc tools/lib/zalloc.c:8:9 #2 0x564965c0f32d in mem2node__init tools/perf/util/mem2node.c:61:12 #3 0x564965a08956 in perf_c2c__report tools/perf/builtin-c2c.c:2803:8 #4 0x564965a0616a in cmd_c2c tools/perf/builtin-c2c.c:2989:10 #5 0x564965944348 in run_builtin tools/perf/perf.c:312:11 #6 0x564965943235 in handle_internal_command tools/perf/perf.c:364:8 #7 0x5649659440c4 in run_argv tools/perf/perf.c:408:2 #8 0x564965942e41 in main tools/perf/perf.c:538:3 v2: add a WARN_ON_ONCE when the free condition arises. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200320182347.87675-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit efc0cdc9ed5e6cfb060ff7b77834cad9d3c97d1d Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:26:57 2020 -0300 perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*() As those are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit aa8c406b0adb3043b935293826b3e4675204ed83 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:21:03 2020 -0300 perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*() As those are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit ad681adf1dfed687b350aac41771de323cd03b70 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:19:05 2020 -0300 perf evsel: Rename perf_evsel__*filter*() to evsel__*filter*() As those are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 862b2f8fbc5b3a13d096b06560b6408f93388cf9 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:12:15 2020 -0300 perf evsel: Rename *perf_evsel__*set_sample_*() to *evsel__*set_sample_*() As they are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 347c751a64af1ae10927d3e4e59171a72a062b3c Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:09:12 2020 -0300 perf evsel: Rename perf_evsel__group_desc() to evsel__group_desc() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 8ab2e96d8ff188006f1e3346a56443cd07fe1858 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:07:09 2020 -0300 perf evsel: Rename *perf_evsel__*name() to *evsel__*name() As they are 'struct evsel' methods or related routines, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 2aaefde4d98baf73ef5a6c7c09941fe5e16f5b51 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 16:00:27 2020 -0300 perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() As it is a 'struct evsel' related method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 4b5e87b741f63a9e988236bc1a1050402f2c27a3 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:58:40 2020 -0300 perf evsel: Rename perf_evsel__calc_id_pos() to evsel__calc_id_pos() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 6ec17b4e2592a328b08e888d107e31cfd69d6abb Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:57:01 2020 -0300 perf evsel: Rename perf_evsel__config*() to evsel__config*() As they are all 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 30f7c59124bb0ad42f74956613fc244bc4064840 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:53:17 2020 -0300 perf evsel: Rename perf_evsel__exit() to evsel__exit() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 39453ed55973cb386ff58bf8a5eca3a65403da74 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:51:38 2020 -0300 perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit e76026bdd51bcd4a0b9793c655891cde45367f5f Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:50:10 2020 -0300 perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 12f5261dac90aea0fd5287b01d50397334cf303e Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:47:38 2020 -0300 perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 5eb88f0476aba76fd6aa48e34b328ff864e84651 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:45:09 2020 -0300 perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus() As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 65ddce3fd87a822d25c8632afb347b8ece607746 Author: Arnaldo Carvalho de Melo Date: Wed Apr 29 15:42:16 2020 -0300 perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t' As the "perf_" prefix should be restricted to functions and types in tools/lib/perf/, aka libperf, this way we reduce a bit the confusion for types only in libperf or the ones in the more contained tools/perf/ project. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Song Liu Signed-off-by: Arnaldo Carvalho de Melo commit 6dd912cbadb9f9746a525c74f09c0e36cee13ee2 Author: Adrian Hunter Date: Wed Apr 29 18:07:51 2020 +0300 perf intel-pt: Update documentation about using /proc/kcore Update documentation to reflect the advent of the --kcore option for 'perf record'. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 43358d9dfb250842383cddad816a7538548a5070 Author: Adrian Hunter Date: Wed Apr 29 18:07:50 2020 +0300 perf intel-pt: Update documentation about itrace G and L options Provide a little more information about the new G and L options, particularly the issue with large PEBs. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f0a0251cee800bf90cff92ecfaf4a4d4c9c493b2 Author: Adrian Hunter Date: Wed Apr 29 18:07:49 2020 +0300 perf intel-pt: Add support for synthesizing branch stacks for regular events Use the new thread_stack__br_sample_late() function to create a thread stack for regular events. Example: # perf record --kcore --aux-sample -e '{intel_pt//,cycles:ppp}' -c 10000 uname Linux [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.743 MB perf.data ] # perf report --itrace=Le --stdio | head -30 | tail -18 # Samples: 11K of event 'cycles:ppp' # Event count (approx.): 11648 # # Overhead Command Source Shared Object Source Symbol Target Symbol Basic Block Cycles # ........ ....... .................... ............................ ............................ .................. # 5.49% uname libc-2.30.so [.] _dl_addr [.] _dl_addr - 2.41% uname ld-2.30.so [.] _dl_relocate_object [.] _dl_relocate_object - 2.31% uname ld-2.30.so [.] do_lookup_x [.] do_lookup_x - 2.17% uname [kernel.kallsyms] [k] unmap_page_range [k] unmap_page_range - 2.05% uname ld-2.30.so [k] _dl_start [k] _dl_start - 1.97% uname ld-2.30.so [.] _dl_lookup_symbol_x [.] _dl_lookup_symbol_x - 1.94% uname [kernel.kallsyms] [k] filemap_map_pages [k] filemap_map_pages - 1.60% uname [kernel.kallsyms] [k] __handle_mm_fault [k] __handle_mm_fault - 1.44% uname [kernel.kallsyms] [k] page_add_file_rmap [k] page_add_file_rmap - 1.12% uname [kernel.kallsyms] [k] vma_interval_tree_insert [k] vma_interval_tree_insert - 0.94% uname [kernel.kallsyms] [k] perf_iterate_ctx [k] perf_iterate_ctx - Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3749e0bbdef24efbf1698bf0dbd9575fddb9ed22 Author: Adrian Hunter Date: Wed Apr 29 18:07:48 2020 +0300 perf thread-stack: Add thread_stack__br_sample_late() Add a thread stack function to create a branch stack for hardware events where the sample records get created some time after the event occurred. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6cd2cbfc6865589c64ac37ec48937e93725622f1 Author: Adrian Hunter Date: Wed Apr 29 18:07:47 2020 +0300 perf evsel: Add support for synthesized branch stack sample type Allow for a synthesized branch stack to be added to samples. As with synthesized call chains, the sample type cannot be changed because it is needed to continue to parse events. So add and use helper function evsel__has_br_stack() to indicate a branch stack, whether original or synthesized. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ec90e42ce5142c4ed2a0061fe23bd4495428c52b Author: Adrian Hunter Date: Wed Apr 29 18:07:46 2020 +0300 perf auxtrace: Add option to synthesize branch stack for regular events There is an existing option to synthesize branch stacks for synthesized events. Add a new option to synthesize branch stacks for regular events. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit cf888e08a030b7430889d0c5c804508c09dad843 Author: Adrian Hunter Date: Wed Apr 29 18:07:45 2020 +0300 perf intel-pt: Change branch stack support to use thread-stacks Change Intel PT's branch stack support to use thread stacks. The advantages of using branch stack support from the thread-stack are: 1. the branches are accumulated separately for each thread 2. the branch stack is cleared only in between continuous traces This helps pave the way for adding branch stacks to regular events, not just synthesized events as at present. While the 2 approaches are not identical, in simple cases the results can be identical e.g. Before: # perf record --kcore -e intel_pt// uname # perf script --itrace=i10usl -F+brstacksym,+addr,+flags > cmp1.txt After: # perf script --itrace=i10usl -F+brstacksym,+addr,+flags > cmp2.txt # diff -s cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt are identical Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1ef998ff1823c8b5b3f7d103ec3971d7baaf677b Author: Adrian Hunter Date: Wed Apr 29 18:07:44 2020 +0300 perf intel-pt: Consolidate thread-stack use condition The components of the condition do not change, so consolidate them in one variable. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 86d67180b920d178ae1c2923f50a0759d6ce1a10 Author: Adrian Hunter Date: Wed Apr 29 18:07:43 2020 +0300 perf thread-stack: Add branch stack support Intel PT already has support for creating branch stacks for each context (per-cpu or per-thread). In the more common per-cpu case, the branch stack is not separated for different threads, instead being cleared in between each sample. That approach will not work very well for adding branch stacks to regular events. The branch stacks really need to be accumulated separately for each thread. As a start to accomplishing that, this patch adds support for putting branch stack support into the thread-stack. The advantages are: 1. the branches are accumulated separately for each thread 2. the branch stack is cleared only in between continuous traces This helps pave the way for adding branch stacks to regular events, not just synthesized events as at present. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit bb629484d924118e3b1d8652177040115adcba01 Author: Konstantin Khlebnikov Date: Wed Apr 29 19:23:41 2020 +0300 perf tools: Simplify checking if SMT is active. SMT now could be disabled via "/sys/devices/system/cpu/smt/control". Status is shown in "/sys/devices/system/cpu/smt/active" simply as "0" / "1". If this knob isn't here then fallback to checking topology as before. Signed-off-by: Konstantin Khlebnikov Cc: Andi Kleen Cc: Dmitry Monakhov Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/158817741394.748034.9273604089138009552.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo commit 846de4371fdfddfa49481e3d04884539870dc127 Author: Konstantin Khlebnikov Date: Wed Apr 29 19:19:47 2020 +0300 perf tools: Fix reading new topology attribute "core_cpus" Check if access("devices/system/cpu/cpu%d/topology/core_cpus", F_OK) fails, which will happen unless the current directory is "/sys". Simply try to read this file first. Fixes: 0ccdb8407a46 ("perf tools: Apply new CPU topology sysfs attributes") Signed-off-by: Konstantin Khlebnikov Cc: Andi Kleen Cc: Dmitry Monakhov Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/158817718710.747528.11009278875028211991.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo commit 4599d292128d89e4cf866a0ea9a9b047a2de8418 Author: Ian Rogers Date: Wed Mar 18 19:31:01 2020 -0700 libperf evlist: Fix a refcount leak Memory leaks found by applying LLVM's libfuzzer on the tools/perf parse_events function. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-2-irogers@google.com [ Did a minor adjustment due to some other previous patch having already set evlist->all_cpus to NULL at perf_evlist__exit() ] Signed-off-by: Arnaldo Carvalho de Melo commit ba08829aace99b23da31b9b71d8ed5d40a44ed49 Author: Ian Rogers Date: Wed Mar 18 19:31:00 2020 -0700 perf parse-events: Fix another memory leaks found on parse_events() Fix another memory leak found by applying LLVM's libfuzzer on parse_events(). Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 672f707ef55f0a56b9bb67c3cfbdcab85c233796 Author: Ian Rogers Date: Wed Mar 18 19:31:00 2020 -0700 perf parse-events: Fix memory leaks found on parse_events free_list_evsel() deals with tools/perf/ evsels, not with libperf perf_evsels, use the right destructor and avoid a leak, as evsel__delete() will delete something perf_evsel__delete() doesn't. Signed-off-by: Ian Rogers Cc: Adrian Hunter Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit e8dfb81838b14f82521968343884665b996646ef Author: Ian Rogers Date: Wed Mar 18 19:31:00 2020 -0700 perf parse-events: Fix memory leaks found on parse_events Fix a memory leak found by applying LLVM's libfuzzer on parse_events(). Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com [ split from a larger patch, use zfree() ] Signed-off-by: Arnaldo Carvalho de Melo commit 44d041b7b2c11b6739501fd3763cc6fed62cf0ed Author: He Zhe Date: Sun Mar 8 18:59:17 2020 +0800 libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus. A NULL pointer may be passed to perf_cpu_map__cpu and then cause a crash, such as the one commit cb71f7d43ece ("libperf: Setup initial evlist::all_cpus value") fix. Signed-off-by: He Zhe Acked-by: Jiri Olsa Cc: Andi Kleen Cc: Kyle Meyer Link: http://lore.kernel.org/lkml/1583665157-349023-1-git-send-email-zhe.he@windriver.com Signed-off-by: Arnaldo Carvalho de Melo commit 23cbb41c939a09a4b51eabacdb1f68af210c084d Author: Arnaldo Carvalho de Melo Date: Tue Apr 28 14:58:29 2020 -0300 perf record: Move side band evlist setup to separate routine It is quite big by now, move that code to a separate record__setup_sb_evlist() routine. Suggested-by: Jiri Olsa Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-9-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 899e5ffbf246a30986ced9dd48092c408978afc7 Author: Arnaldo Carvalho de Melo Date: Mon Apr 27 17:56:37 2020 -0300 perf record: Introduce --switch-output-event Now we can use it with --overwrite to have a flight recorder mode that gets snapshot requests from arbitrary events that are processed in the side band thread together with the PERF_RECORD_BPF_EVENT processing. Example: To collect scheduler events until a recvmmsg syscall happens, system wide: [root@five a]# rm -f perf.data.2020042717* [root@five a]# perf record --overwrite -e sched:*switch,syscalls:*recvmmsg --switch-output-event syscalls:sys_enter_recvmmsg [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042717585458 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042717590235 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042717590398 ] ^C[ perf record: Woken up 1 times to write data ] [ perf record: Dump perf.data.2020042717590511 ] [ perf record: Captured and wrote 7.244 MB perf.data. ] So in the above case we had 3 snapshots, the fourth was forced by control+C: [root@five a]# ls -la total 20440 drwxr-xr-x. 2 root root 4096 Apr 27 17:59 . dr-xr-x---. 12 root root 4096 Apr 27 17:46 .. -rw-------. 1 root root 3936125 Apr 27 17:58 perf.data.2020042717585458 -rw-------. 1 root root 5074869 Apr 27 17:59 perf.data.2020042717590235 -rw-------. 1 root root 4291037 Apr 27 17:59 perf.data.2020042717590398 -rw-------. 1 root root 7617037 Apr 27 17:59 perf.data.2020042717590511 [root@five a]# One can make this more precise by adding the switch output event to the main -e events list, as since this is done asynchronously, a few events after the signal event will appear in the snapshots, as can be seen with: [root@five a]# rm -f perf.data.20200427175* [root@five a]# perf record --overwrite -e sched:*switch,syscalls:*recvmmsg --switch-output-event syscalls:sys_enter_recvmmsg [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042718024203 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042718024301 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042718024484 ] ^C[ perf record: Woken up 1 times to write data ] [ perf record: Dump perf.data.2020042718024562 ] [ perf record: Captured and wrote 7.337 MB perf.data. ] [root@five a]# perf script -i perf.data.2020042718024203 | tail -15 PacerThread 148586 [005] 122.830729: sched:sched_switch: prev_comm=PacerThread prev_pid=148586... swapper 0 [000] 122.833588: sched:sched_switch: prev_comm=swapper/0 prev_pid=... NetworkManager 1251 [000] 122.833619: syscalls:sys_enter_recvmmsg: fd: 0x0000001c, mmsg: 0x7ffe83054a1... swapper 0 [002] 122.833624: sched:sched_switch: prev_comm=swapper/2 prev_pid=... swapper 0 [003] 122.833624: sched:sched_switch: prev_comm=swapper/3 prev_pid=... NetworkManager 1251 [000] 122.833626: syscalls:sys_exit_recvmmsg: 0x1 kworker/3:3-eve 158946 [003] 122.833628: sched:sched_switch: prev_comm=kworker/3:3 prev_pid=15894... swapper 0 [004] 122.833641: sched:sched_switch: prev_comm=swapper/4 prev_pid=... NetworkManager 1251 [000] 122.833642: sched:sched_switch: prev_comm=NetworkManage... perf 228273 [002] 122.833645: sched:sched_switch: prev_comm=perf prev_pid=22827... swapper 0 [011] 122.833646: sched:sched_switch: prev_comm=swapper/1... swapper 0 [002] 122.833648: sched:sched_switch: prev_comm=swapper/... kworker/0:2-eve 207387 [000] 122.833648: sched:sched_switch: prev_comm=kworker/0:2 prev_pid=20738... kworker/2:3-eve 232038 [002] 122.833652: sched:sched_switch: prev_comm=kworker/2:3 prev_pid=23203... perf 235825 [003] 122.833653: sched:sched_switch: prev_comm=perf prev_pid=23582... [root@five a]# Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Cc: Wang Nan Link: http://lore.kernel.org/lkml/20200429131106.27974-8-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 636eb4d001b18922b149f59a9f924a5907d20d39 Author: Arnaldo Carvalho de Melo Date: Tue Apr 28 09:16:25 2020 -0300 libsubcmd: Introduce OPT_CALLBACK_SET() To register that an option was set, like with the upcoming 'perf record --switch-output-option' one. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-7-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 976be84504b8285d43dc890b02ceff432cd0dd4b Author: Arnaldo Carvalho de Melo Date: Mon Apr 27 17:54:27 2020 -0300 perf evlist: Allow reusing the side band thread for more purposes I.e. so far we had just one event in that side band thread, a dummy one with attr.bpf_event set, so that 'perf record' can go ahead and ask the kernel for further information about BPF programs being loaded. Allow for more than one event to be there, so that we can use it as well for the upcoming --switch-output-event feature. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-6-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9a39994467d493eba38d8f69e42fd9c31cb1da9a Author: Arnaldo Carvalho de Melo Date: Tue May 5 12:18:21 2020 -0300 perf evlist: Move the sideband thread routines to separate object To avoid dragging more stuff into the perf python binding in the following csets. Reported-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit d0abbc3ce695437fe83446aef44b2f5ef65a80b9 Author: Arnaldo Carvalho de Melo Date: Mon Apr 27 13:58:11 2020 -0300 perf parse-events: Add parse_events_option() variant that creates evlist For the upcoming --switch-output-event option we want to create the side band event, populate it with the specified events and then, if it is present multiple times, go on adding to it, then, if the BPF tracking is required, use the first event to set its attr.bpf_event to get those PERF_RECORD_BPF_EVENT metadata events too. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-5-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b38d85ef49cf6af9d1deaaf01daf0986d47e6c7a Author: Arnaldo Carvalho de Melo Date: Fri Apr 24 12:24:51 2020 -0300 perf bpf: Decouple creating the evlist from adding the SB event Renaming bpf_event__add_sb_event() to evlist__add_sb_event() and requiring that the evlist be allocated beforehand. This will allow using the same side band thread and evlist to be used for multiple purposes in addition to react to PERF_RECORD_BPF_EVENT soon after they are generated. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-4-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ca6c9c8b107f9788662117587cd24bbb19cea94d Author: Arnaldo Carvalho de Melo Date: Fri Apr 24 10:40:54 2020 -0300 perf top: Move sb_evlist to 'struct perf_top' Where state related to a 'perf top' session is grouped. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-3-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bc477d7983e345262757568ec27be0395dc2fe73 Author: Arnaldo Carvalho de Melo Date: Fri Apr 24 10:24:04 2020 -0300 perf record: Move sb_evlist to 'struct record' Where state related to a 'perf record' session is grouped. Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200429131106.27974-2-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 40c7d2460e03b0916c5fcc5edbedae05b4b571fc Author: Arnaldo Carvalho de Melo Date: Tue May 5 11:49:08 2020 -0300 perf tools: Move routines that probe for perf API features to separate file Trying to disentangle this a bit further, unfortunately it uses parse_events(), its interesting to have it separated anyway, so do it. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit bbd7ffdbef6888459f301c5889f3b14ada38b913 Author: Stephen Boyd Date: Wed Apr 8 23:44:13 2020 -0700 clk: Allow the common clk framework to be selectable Enable build testing and configuration control of the common clk framework so that more code coverage and testing can be done on the common clk framework across various architectures. This also nicely removes the requirement that architectures must select the framework when they don't use it in architecture code. There's one snag with doing this, and that's making sure that randconfig builds don't select this option when some architecture or platform implements 'struct clk' outside of the common clk framework. Introduce a new config option 'HAVE_LEGACY_CLK' to indicate those platforms that haven't migrated to the common clk framework and therefore shouldn't be allowed to select this new config option. Also add a note that we hope one day to remove this config entirely. Based on a patch by Mark Brown . Cc: Mark Brown Cc: Geert Uytterhoeven Cc: Mark Salter Cc: Aurelien Jacquiot Cc: Jiaxun Yang Cc: Guan Xuetao Cc: Russell King Cc: Arnd Bergmann Cc: Yoshinori Sato Cc: Rich Felker Cc: Thomas Bogendoerfer Cc: Cc: Cc: Cc: Cc: Link: https://lore.kernel.org/r/1470915049-15249-1-git-send-email-broonie@kernel.org Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200409064416.83340-8-sboyd@kernel.org Reviewed-by: Mark Brown Reviewed-by: Arnd Bergmann commit 3fd2fdb311fab622ed95568e2a90cb02fe06227c Author: Stephen Boyd Date: Wed Apr 8 23:44:12 2020 -0700 mmc: meson-mx-sdio: Depend on OF_ADDRESS and not just OF Making COMMON_CLK a visible option causes the sparc allyesconfig to fail to build like so: sparc64-linux-ld: drivers/mmc/host/meson-mx-sdio.o: in function `meson_mx_mmc_remove': meson-mx-sdio.c:(.text+0x70): undefined reference to `of_platform_device_destroy' sparc64-linux-ld: drivers/mmc/host/meson-mx-sdio.o: in function `meson_mx_mmc_probe': meson-mx-sdio.c:(.text+0x9e4): undefined reference to `of_platform_device_create' sparc64-linux-ld: meson-mx-sdio.c:(.text+0xdd4): undefined reference to `of_platform_device_destroy' This is because the implementation of of_platform_device_destroy() is inside an #ifdef CONFIG_OF_ADDRESS section of drivers/of/platform.c. This driver already depends on OF being enabled, so let's tighten that constrain a little more so that it depends on OF_ADDRESS instead. This way we won't try to build this driver on platforms that don't have this function. Reported-by: kbuild test robot Cc: Neil Armstrong Cc: Ulf Hansson Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200409064416.83340-7-sboyd@kernel.org Acked-by: Ulf Hansson Reviewed-by: Arnd Bergmann commit b62bc0474b9084f7de1d69adbb9bde248bbdf117 Author: Stephen Boyd Date: Wed Apr 8 23:44:11 2020 -0700 MIPS: Remove redundant CLKDEV_LOOKUP selects The ATH79 config selects COMMON_CLK already, and the COMMON_CLK config option already selects CLKDEV_LOOKUP, and CLKDEV_LOOKUP already selects HAVE_CLK so it's redundant to have these selected again. Cc: Thomas Bogendoerfer Cc: Signed-off-by: Stephen Boyd Reviewed-by: Arnd Bergmann Link: https://lkml.kernel.org/r/20200409064416.83340-6-sboyd@kernel.org commit ba76c40dbe2e1f6c2db1d8077917d18279523b81 Author: Stephen Boyd Date: Wed Apr 8 23:44:10 2020 -0700 h8300: Remove redundant CLKDEV_LOOKUP selects The h8300 architecture selects COMMON_CLK already, and the COMMON_CLK config option already selects CLKDEV_LOOKUP so it's redundant to have this selected again. Cc: Yoshinori Sato Cc: uclinux-h8-devel@lists.sourceforge.jp Cc: Arnd Bergmann Signed-off-by: Stephen Boyd Reviewed-by: Arnd Bergmann Link: https://lkml.kernel.org/r/20200409064416.83340-5-sboyd@kernel.org commit d823836ad182c1488d3a7beb1018c5558d765bf0 Author: Stephen Boyd Date: Wed Apr 8 23:44:09 2020 -0700 arm64: tegra: Remove redundant CLKDEV_LOOKUP selects The arm64 architecture selects COMMON_CLK at the toplevel ARM64 config. The COMMON_CLK config option already selects CLKDEV_LOOKUP so it's redundant to have this selected again for the Tegra specific config. Cc: Paul Walmsley Acked-by: Thierry Reding Cc: Catalin Marinas Cc: Will Deacon Cc: Cc: Arnd Bergmann Signed-off-by: Stephen Boyd Reviewed-by: Arnd Bergmann Link: https://lkml.kernel.org/r/20200409064416.83340-4-sboyd@kernel.org commit e8bd633bc05278ffb4f4ad39050bd9a33acca947 Author: Stephen Boyd Date: Wed Apr 8 23:44:08 2020 -0700 ARM: Remove redundant CLKDEV_LOOKUP selects These platforms select COMMON_CLK indirectly through use of the ARCH_MULTIPLATFORM config option that they depend on implicitly via some V7/V6/V5 multi platform config option. The COMMON_CLK config option already selects CLKDEV_LOOKUP so it's redundant to have this selected again. Cc: Tony Prisk Cc: Russell King Cc: Cc: Arnd Bergmann Signed-off-by: Stephen Boyd Reviewed-by: Arnd Bergmann Link: https://lkml.kernel.org/r/20200409064416.83340-3-sboyd@kernel.org commit 38d6d848845ebbbe8f3354a972e815a073bb61f7 Author: Stephen Boyd Date: Wed Apr 8 23:44:07 2020 -0700 ARM: Remove redundant COMMON_CLK selects The mulitplatform config already selects COMMON_CLK, so selecting it again is not useful. Remove these selects from ARM platforms that are part of the multiplatform build. Reviewed-by: "Andreas Färber" # actions Acked-by: Manivannan Sadhasivam # actions Cc: Russell King Cc: Alexander Shiyan Cc: Lubomir Rintel Cc: Cc: Arnd Bergmann Signed-off-by: Stephen Boyd Reviewed-by: Arnd Bergmann Link: https://lkml.kernel.org/r/20200409064416.83340-2-sboyd@kernel.org commit e8b81b1ea35628aa46547f485aef14172513718a Merge: 8f3d9f354286 e2f022c10ed3 Author: Stephen Boyd Date: Tue May 5 12:28:46 2020 -0700 Merge tag 'clk-renesas-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates from Geert Uytterhoeven: - Add support for the USB 2.0 clock selector on R-Car M3-W+ - Add support for the new RZ/G1H (R8A7742) SoC - Minor fixes and cleanups * tag 'clk-renesas-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: rcar-gen2: Remove superfluous CLK_RENESAS_DIV6 selects clk: renesas: cpg-mssr: Add R8A7742 support dt-bindings: clock: renesas: cpg-mssr: Document r8a7742 binding clk: renesas: Add r8a7742 CPG Core Clock Definitions dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros MAINTAINERS: Add DT Bindings for Renesas Clock Generators clk: renesas: r9a06g032: Fix some typo in comments dt-bindings: clock: renesas: rcar-usb2-clock-sel: Add r8a77961 support commit 4fe02fefe7a6ca8914d73dfafaad5053aa5d1ef9 Author: Christophe JAILLET Date: Sun May 3 21:03:27 2020 +0200 clk: clk-xgene: Fix a typo in Kconfig s/Sypport/Support Signed-off-by: Christophe JAILLET Link: https://lkml.kernel.org/r/20200503190327.153249-1-christophe.jaillet@wanadoo.fr Signed-off-by: Stephen Boyd commit 782fe98b9350fd64b4d1a651a1da1d303e03b32c Author: YueHaibing Date: Tue May 5 16:30:01 2020 +0800 clk: Remove unused inline function clk_debug_reparent There's no callers in-tree anymore. Signed-off-by: YueHaibing Link: https://lkml.kernel.org/r/20200505083001.52564-1-yuehaibing@huawei.com Signed-off-by: Stephen Boyd commit dba496f36117a8d3d40c7e93e9a27d71168e302a Author: Yoshihiro Shimoda Date: Tue Apr 21 14:15:52 2020 +0900 dt-bindings: iommu: renesas,ipmmu-vmsa: convert to json-schema Convert Renesas VMSA-Compatible IOMMU bindings documentation to json-schema. Note that original documentation doesn't mention renesas,ipmmu-vmsa for R-Mobile APE6. But, R-Mobile APE6 is similar to the R-Car Gen2. So, renesas,ipmmu-r8a73a4 belongs the renesas,ipmmu-vmsa section. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit fe121e078da1fd8a061ab22f26c5911f8ebf46cb Author: David S. Miller Date: Tue May 5 12:08:02 2020 -0700 sch_choke: Remove classid from choke_skb_cb. Suggested by Cong Wang. Signed-off-by: David S. Miller commit 5b545cbc0a57fc93617785ed5c165f5059e36498 Author: YueHaibing Date: Tue May 5 16:51:24 2020 +0800 net: sierra_net: Remove unused inline function There's no callers in-tree Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit e36cac0c056404c7c595c91773a93dd01aacc367 Author: YueHaibing Date: Tue May 5 16:50:09 2020 +0800 bnx2x: Remove unused inline function bnx2x_vf_vlan_credit commit 05cc5a39ddb7 ("bnx2x: add vlan filtering offload") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 592138a88d967ae9279275ef275b729e866a552a Author: YueHaibing Date: Tue May 5 16:47:36 2020 +0800 net: sched: choke: Remove unused inline function choke_set_classid There's no callers in-tree anymore since commit 5952fde10c35 ("net: sched: choke: remove dead filter classify code") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit b16751f7adae1d1b6beae0a44cd45d65715ddbf2 Author: YueHaibing Date: Tue May 5 16:44:21 2020 +0800 net: microchip: Remove unused inline function is_bits_set There's no callers in-tree. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 9f410c2cb7371c2645f6a8cd39cea0e62e391570 Author: YueHaibing Date: Tue May 5 16:43:39 2020 +0800 myri10ge: Remove unused inline function myri10ge_vlan_ip_csum commit 4ca3221fe4b6 ("myri10ge: Convert from LRO to GRO") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit d66e67bd4cc76626253bd51ee034bbbaede4e9ba Author: YueHaibing Date: Tue May 5 16:42:56 2020 +0800 net: stmmac: Remove unused inline function stmmac_rx_threshold_count There's no caller in-tree since commit 2af6106ae949 ("net: stmmac: Introducing support for Page Pool") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 12dcceb39aabcc199461f2fdc3ff81be0cd7003e Author: YueHaibing Date: Tue May 5 16:40:37 2020 +0800 net: mv643xx_eth: Remove unused inline function sum16_as_be commit 84411f73b884 ("net: mv643xx_eth: Avoid setting the initial TCP checksum") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 7a4d40ddf1fa2d78e0a144a6bde9bf783682fba7 Author: YueHaibing Date: Tue May 5 16:33:12 2020 +0800 net: sun: cassini: Remove unused inline functions There's no callers in-tree anymore. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit e94caac1bc0b628b14dd6d81a94315cd880d6150 Author: YueHaibing Date: Tue May 5 16:31:56 2020 +0800 net: tehuti: remove unused inline function bdx_tx_db_size There's no callers in-tree anymore. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 5447e8e01e101ba19fe5b7551f02d37367156f6b Author: Arnd Bergmann Date: Tue May 5 16:07:12 2020 +0200 sysctl: Fix unused function warning The newly added bpf_stats_handler function has the wrong #ifdef check around it, leading to an unused-function warning when CONFIG_SYSCTL is disabled: kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(struct ctl_table *table, int write, Fix the check to match the reference. Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS") Signed-off-by: Arnd Bergmann Signed-off-by: Alexei Starovoitov Reviewed-by: Luis Chamberlain Acked-by: Martin KaFai Lau Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200505140734.503701-1-arnd@arndb.de commit 015cba7e369e91656ed31afbadce044a10fa0fab Author: Yunjian Wang Date: Tue May 5 15:59:26 2020 +0800 net: ni: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit d192ae55382dceb5f782b5a2d70ebc887a410305 Author: Jason Yan Date: Tue May 5 15:46:23 2020 +0800 net: ethernet: ti: use true, false for bool variables in cpsw_new.c Fix the following coccicheck warning: drivers/net/ethernet/ti/cpsw_new.c:1924:2-17: WARNING: Assignment of 0/1 to bool variable drivers/net/ethernet/ti/cpsw_new.c:1231:1-16: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit ba42580019560ed9c54f87c3c4e852ce26869c5d Author: Jason Yan Date: Tue May 5 15:46:08 2020 +0800 net: bnxt: Remove Comparison to bool in bnxt_ethtool.c Fix the following coccicheck warning: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:1991:5-46: WARNING: Comparison to bool drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:1993:10-54: WARNING: Comparison to bool drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2380:5-38: WARNING: Comparison to bool Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit ec161116ad554fec2e87215da93db48b5767f323 Author: Jason Yan Date: Tue May 5 15:45:56 2020 +0800 net: agere: use true,false for bool variable Fix the following coccicheck warning: drivers/net/ethernet/agere/et131x.c:717:3-22: WARNING: Assignment of 0/1 to bool variable drivers/net/ethernet/agere/et131x.c:721:1-20: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Acked-by: Mark Einon Signed-off-by: David S. Miller commit e8cc063d83106bc6855c07db0001e8d01cbd8b3e Author: Jason Yan Date: Tue May 5 15:45:46 2020 +0800 net: atheros: remove conversion to bool in atl1c_start_mac() No need to convert '==' expression to bool. This fixes the following coccicheck warning: drivers/net/ethernet/atheros/atl1c/atl1c_main.c:1189:63-68: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 93e6044bd1cb635c3a07dc1b8471bc965feb9b04 Author: Jason Yan Date: Tue May 5 15:45:39 2020 +0800 net: qede: Use true for bool variable in qede_init_fp() Fix the following coccicheck warning: drivers/net/ethernet/qlogic/qede/qede_main.c:1717:5-19: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 66b63a60d7ea9f589a9cdc404057d8072930962d Author: Jason Yan Date: Tue May 5 15:44:00 2020 +0800 bnx2x: Remove Comparison to bool in bnx2x_dcb.c Fix the following coccicheck warning: drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c:1548:17-31: WARNING: Comparison to bool drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c:1148:16-24: WARNING: Comparison to bool drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c:1158:30-38: WARNING: Comparison to bool Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit d9a1c584a93a90ecd24fca775a68d113fda05576 Author: Jason Yan Date: Tue May 5 15:43:49 2020 +0800 qlcnic: use true,false for bool variable in qlcnic_sriov_common.c Fix the following coccicheck warning: drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c:1585:3-25: WARNING: Assignment of 0/1 to bool variable drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c:1588:3-25: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit 3e1853e4e1137ba0a4d314521d153852dbf4aff5 Author: Yunjian Wang Date: Tue May 5 13:57:49 2020 +0800 net: emac: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 58618ef85546726cf27c38ddc1b022c703b7a6ad Author: Yunjian Wang Date: Tue May 5 11:22:20 2020 +0800 net: nxp: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit e88ba436e5615f5bb94deecbbb924227b15bbebb Author: Tero Kristo Date: Wed Apr 29 17:30:02 2020 +0300 ARM: OMAP5: Make L4SEC clock domain SWSUP only Commit c2ce5fb3f3f5 ('ARM: OMAP: DRA7xx: Make L4SEC clock domain SWSUP only') made DRA7 SoC L4SEC clock domain SWSUP only because of power state transition issues detected with HWSUP mode. Based on experimentation similar issue exists on OMAP5, so do the same change for OMAP5 also. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit f18e314a6bf1b7bdbc6f5af1d6dbda11bc2dd35b Author: Tero Kristo Date: Wed Apr 29 17:30:01 2020 +0300 ARM: OMAP4: Make L4SEC clock domain SWSUP only Commit c2ce5fb3f3f5 ('ARM: OMAP: DRA7xx: Make L4SEC clock domain SWSUP only') made DRA7 SoC L4SEC clock domain SWSUP only because of power state transition issues detected with HWSUP mode. Based on experimentation similar issue exists on OMAP4, so do the same change for OMAP4 also. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 189a8739cc7235f1a6da141439aa8ece72c9f4d2 Author: Tero Kristo Date: Wed Apr 29 17:30:00 2020 +0300 ARM: dts: omap5: add DES crypto accelerator node OMAP5 contains a single DES crypto accelerator instance. Add node for this in DT to enable it. We keep the node disabled for now, as it appears OMAP5 platform is running out of available DMA channels, and DES is the least interesting crypto accelerator available on the device. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit bf755817f82ac51dbabd3e2733a2f28a240bd280 Author: Tero Kristo Date: Wed Apr 29 17:29:59 2020 +0300 ARM: dts: omap5: add SHA crypto accelerator node Add the single available SHA crypto accelerator device for OMAP5 SoC. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 4b9882ae4d2850e9aec91b73b8bf2cbf21f0bea2 Author: Tero Kristo Date: Wed Apr 29 17:29:58 2020 +0300 ARM: dts: omap5: add aes2 entry OMAP5 has AES hardware cryptographic accelerator, add AES2 instance for it. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit f9cd51bf6d1c23e1aae8c74a44b4e26d66fa164f Author: Tero Kristo Date: Wed Apr 29 17:29:57 2020 +0300 ARM: dts: omap5: add aes1 entry OMAP5 has AES hardware cryptographic accelerator, add AES1 instance for it. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit ab99b7d2ae6e33077045e92b5ca173635c7eceef Author: Yunjian Wang Date: Tue May 5 11:06:45 2020 +0800 net: altera: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 09f6c44aaae0f1bdb8b983d7762676d5018c53bc Author: Yunjian Wang Date: Tue May 5 10:49:20 2020 +0800 net: allwinner: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. And emac_start_xmit() can leak one skb if 'channel' == 3. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 1f15980525c6425125678fc97ea8b4b1ee4cb86e Author: Suman Anna Date: Fri Apr 24 18:12:44 2020 +0300 ARM: dts: dra7-ipu-dsp-common: Add watchdog timers to IPU and DSP nodes The watchdog timer information has been added to all the IPU and DSP remote processor device nodes in the DRA7xx/AM57xx SoC families. The data has been added to the two common dra7-ipu-dsp-common and dra74-ipu-dsp-common dtsi files that can be included by all the desired board files. The following timers are chosen as the watchdog timers, as per the usage on the current firmware images: IPU2: GPTimers 4 & 9 (one for each Cortex-M4 core) IPU1: GPTimers 7 & 8 (one for each Cortex-M4 core) DSP1: GPTimer 10 DSP2: GPTimer 13 Each of the IPUs has two Cortex-M4 processors and so uses a timer each for providing watchdog support on that processor irrespective of whether the IPU is running in SMP-mode or non-SMP node. The chosen timers also need to be unique from the ones used by other processors (regular timers or watchdog timers) so that they can be supported simultaneously. The MPU-side drivers will use this data to initialize the watchdog timer(s), and listen for any watchdog triggers. The BIOS-side code on these processors needs to configure/refresh the corresponding timer properly to not throw a watchdog error. The watchdog timers are optional in general, but are mandatory to be added to support watchdog error recovery on a particular processor. These timers can be changed or removed as per the system integration needs, alongside appropriate equivalent changes on the firmware side. Signed-off-by: Angela Stegmaier Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit c2a5678e3017437c7c48fda0cbce1ec4136e2573 Author: Suman Anna Date: Fri Apr 24 18:12:43 2020 +0300 ARM: dts: am571x-idk: Add CMA pools and enable IPUs & DSP1 rprocs The CMA reserved memory nodes have been added for both the IPUs and the DSP1 remoteproc devices on the AM571x IDK board. These nodes are assigned to the respective rproc device nodes, and both the IPUs and the DSP1 remote processors are enabled for this board. The current CMA pools and sizes are defined statically for each device. The addresses chosen are the same as the respective processors on the DRA72 EVM board to maintain firmware compatibility between the two boards. The CMA pools and sizes are defined using 64-bit values to support LPAE. The starting addresses are fixed to meet current dependencies on the remote processor firmwares, and this will go away when the remote-side code has been improved to gather this information runtime during its initialization. An associated pair of the rproc node and its CMA node can be disabled later on if there is no use-case defined to use that remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit ac21a4a8f263d155c31f56b23bd056e71e75e7a6 Author: Suman Anna Date: Fri Apr 24 18:12:42 2020 +0300 ARM: dts: am572x-idk-common: Add CMA pools and enable IPU & DSP rprocs The CMA reserved memory nodes have been added for all the IPU and DSP remoteproc devices in the am572x-idk-common.dtsi file that is common to both the AM572x and AM574x IDK boards. These nodes are assigned to the respective rproc device nodes, and all the IPU and DSP remote processors are enabled. The current CMA pools and sizes are defined statically for each device. The addresses chosen are the same as the respective processors on the AM57xx EVM board to maintain firmware compatibility between the two boards. The CMA pools and sizes are defined using 64-bit values to support LPAE. The starting addresses are fixed to meet current dependencies on the remote processor firmwares, and this will go away when the remote-side code has been improved to gather this information runtime during its initialization. An associated pair of the rproc node and its CMA node can be disabled later on if there is no use-case defined to use that remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 35529cc009967c7fe3cb96da8f2b31bd966f6e14 Author: Suman Anna Date: Fri Apr 24 18:12:41 2020 +0300 ARM: dts: beagle-x15-common: Add CMA pools and enable IPU & DSP rprocs The CMA reserved memory nodes have been added for all the IPU and DSP remoteproc devices on all the AM57xx BeagleBoard-X15 boards. These nodes are assigned to the respective rproc device nodes, and all the IPU and DSP remote processors are enabled for all these boards. The current CMA pools and sizes are defined statically for each device. The addresses chosen are the same as the respective processors on the DRA7 EVM board to maintain firmware compatibility between the two boards. The CMA pools and sizes are defined using 64-bit values to support LPAE. The starting addresses are fixed to meet current dependencies on the remote processor firmwares, and this will go away when the remote-side code has been improved to gather this information runtime during its initialization. An associated pair of the rproc node and its CMA node can be disabled later on if there is no use-case defined to use that remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 101a29dd31b15aca958b1b6fa4c8452d56e58f5b Author: Suman Anna Date: Fri Apr 24 18:12:40 2020 +0300 ARM: dts: dra76-evm: Add CMA pools and enable IPU & DSP rprocs The CMA reserved memory nodes have been added for all the IPU and the DSP remoteproc devices on the DRA76 EVM board, and assigned to the respective rproc device nodes. These match the configuration used on the DRA7 EVM board. Both the CMA nodes and the corresponding rproc nodes are also enabled to enable these processors on the DRA76 EVM board. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit f09862d537367eaab1cf52953786992de3aa0c28 Author: Suman Anna Date: Fri Apr 24 18:12:39 2020 +0300 ARM: dts: dra71-evm: Add CMA pools and enable IPUs & DSP1 rprocs The CMA reserved memory nodes have been added for both the IPUs and the DSP1 remoteproc devices on DRA71 EVM board. These nodes are assigned to the respective rproc device nodes, and both the IPUs and the DSP1 remote processors are enabled for this board. The current CMA pools and sizes are defined statically for each device. The addresses chosen are the same as the respective processors on the DRA72 EVM board to maintain firmware compatibility between the two boards. The CMA pools and sizes are defined using 64-bit values to support LPAE. The starting addresses are fixed to meet current dependencies on the remote processor firmwares, and this will go away when the remote-side code has been improved to gather this information runtime during its initialization. An associated pair of the rproc node and its CMA node can be disabled later on if there is no use-case defined to use that remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 81fe00fa4e5bcf778d5ea0439a4931de1c259d78 Author: Suman Anna Date: Fri Apr 24 18:12:38 2020 +0300 ARM: dts: dra72-evm-revc: Add CMA pools and enable IPUs & DSP1 rprocs The CMA reserved memory nodes have been added for both the IPUs and the DSP1 remoteproc devices on the DRA72 EVM rev C board, and assigned to the respective rproc device nodes. These match the configuration used on the DRA72 EVM board. Both the CMA nodes and the corresponding rproc nodes are also enabled to enable these processors on the DRA72 EVM rev C board. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 791cc4e40f2806f22c5f7ce26adec85ac4f52dc2 Author: Suman Anna Date: Fri Apr 24 18:12:37 2020 +0300 ARM: dts: dra72-evm: Add CMA pools and enable IPUs & DSP1 rprocs The CMA reserved memory nodes have been added for both the IPUs and the DSP1 remoteproc devices on DRA72 EVM board. These nodes are assigned to the respective rproc device nodes, and both the IPUs and the DSP1 remote processors are enabled for this board. The current CMA pools and sizes are defined statically for each device. The addresses chosen are the same as the respective processors on the DRA7 EVM board to maintain firmware compatibility between the two boards. The CMA pools and sizes are defined using 64-bit values to support LPAE. The starting addresses are fixed to meet current dependencies on the remote processor firmwares, and this will go away when the remote-side code has been improved to gather this information runtime during its initialization. An associated pair of the rproc node and its CMA node can be disabled later on if there is no use-case defined to use that remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 371cddbd5f0f30075eb4de6ace719f81f3586a73 Author: Suman Anna Date: Fri Apr 24 18:12:36 2020 +0300 ARM: dts: dra7-evm: Add CMA pools and enable IPU & DSP rprocs The CMA reserved memory nodes have been added for all the IPU and DSP remoteproc devices on DRA7 EVM board. These nodes are assigned to the respective rproc device nodes, and all the IPU and DSP remote processors are enabled for this board. The current CMA pools and sizes are defined statically for each device. The CMA pools and sizes are defined using 64-bit values to support LPAE. The starting addresses are fixed to meet current dependencies on the remote processor firmwares, and this will go away when the remote-side code has been improved to gather this information runtime during its initialization. An associated pair of the rproc node and its CMA node can be disabled later on if there is no use-case defined to use that remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit d329f9f14d6f125d5740049d6806b6e9c005e0ea Author: Suman Anna Date: Fri Apr 24 18:12:35 2020 +0300 ARM: dts: dra7-ipu-dsp-common: Add timers to IPU and DSP nodes The BIOS System Tick timers have been added for all the IPU and DSP remoteproc devices in the DRA7 SoC family. The data is added to the two common dra7-ipu-dsp-common and dra74-ipu-dsp-common dtsi files that are included by all the desired board files. The following timers are chosen, as per the timers used on the current firmware images: IPU2: GPTimer 3 IPU1: GPTimer 11 DSP1: GPTimer 5 DSP2: GPTimer 6 The timers are optional, but are mandatory to support advanced device management features such as power management and watchdog support. The above are added to successfully boot and execute firmware images configured with the respective timers, images that use internal processor subsystem timers are not affected. The timers can be changed or removed as per the system integration needs, if needed. Each of the IPUs has two Cortex-M4 processors, and is currently expected to be running in SMP-mode, so only a single timer suffices to provide the BIOS tick timer. An additional timer should be added for the second processor in IPU if it were to be run in non-SMP mode. The timer value also needs to be unique from the ones used by other processors so that they can be run simultaneously. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 5e89b39049a6f14f49edbf95ff86290c3109a27a Author: Suman Anna Date: Fri Apr 24 18:12:34 2020 +0300 ARM: dts: dra7-ipu-dsp-common: Add mailboxes to IPU and DSP nodes Add the required 'mboxes' property to all the IPU and DSP remote processors (IPU1, IPU2, DSP1 and DSP2) in the two available common dtsi files - dra7-ipu-dsp-common and dra74-ipu-dsp-common dtsi files. The latter file is for platforms having DRA74x/DRA76x/AM572x/AM574x SoCs which do have a DSP2 processor in addition to the other common remote processors. The common data is added to the former file, and the DSP2 only data is added to the latter file. The mailboxes are required for running the Remote Processor Messaging (RPMsg) stack between the host processor and each of the remote processors. Each of the remote processors uses a single sub-mailbox node, the IPUs are assumed to be running in SMP-mode. The chosen sub-mailboxes match the values used in the current firmware images. This can be changed, if needed, as per the system integration needs after making appropriate changes on the firmware side as well. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit a11a2f73b32d01ac204f861709dc32f6d29ec806 Author: Suman Anna Date: Fri Apr 24 18:12:33 2020 +0300 ARM: dts: dra7-ipu-dsp-common: Move mailboxes into common files The System Mailboxes 5 and 6 and their corresponding child sub-mailbox (IPC 3.x) nodes are enabled in each of the DRA7xx and AM57xx board dts files individually at present. These mailboxes enable the Remote Processor Messaging (RPMsg) communication stack between the MPU host processor and each of the IPU1, IPU2, DSP1 and DSP2 remote processors. Move these nodes into two common dtsi files - dra7-ipu-dsp-common and dra74-ipu-dsp-common files, which are then included in various board dts files. These files can be used to add all the common configuration properties (except memory data) required by remote processor nodes. The memory pools and the remote processor nodes themselves are to be enabled in the actual board dts files. The first file is to used by platforms using DRA72x/DRA71x/AM571x/AM570x SoCs, and the second file is to be used by platforms using DRA74x/DRA76x/AM572x/AM574x SoCs. The second file includes the first file and contains additional data only applicable for DSP2 remote processor. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 0ed073c218ee1b4dbf13f89707003cb3a2ee3d94 Author: Suman Anna Date: Fri Apr 24 18:12:32 2020 +0300 ARM: dts: DRA72x: Add aliases for rproc nodes Add aliases for all the 3 remote processor nodes common to all DRA72x/DRA71x/AM571x/AM570x boards. The aliases uses the stem "rproc", and are defined in the order of the most common processors on the DRA72x family. The ids are same as DRA74x except for the missing DSP2. The aliases can be overridden, if needed, in the respective derivative board dts files. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit c6df6557268ad6fee6df4f2ce5e1443f7fcfbd75 Author: Suman Anna Date: Fri Apr 24 18:12:31 2020 +0300 ARM: dts: DRA74x: Add aliases for rproc nodes Add aliases for all the IPU and DSP remoteproc processor nodes common to all DRA74x/DRA76x/AM572x/AM574x boards. The aliases uses the stem "rproc". The aliases are defined in the order of the most common processors on the DRA74x family. The aliases can be overridden, if needed, in the respective derivative board dts files. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 78aae49a23ebe8b5e7a3e2876e4d114d43ac8bbb Author: Suman Anna Date: Fri Apr 24 18:12:30 2020 +0300 ARM: dts: DRA74x: Add DSP2 processor device node The DRA7xx family of SoCs can contain upto two identical DSP processor subsystems. The second DSP processor subsystem is present only on the DRA74x/DRA76x variants. The processor device DT node has therefore been added in disabled state for this processor subsystem in the DRA74x specific DTS file. NOTE: 1. The node does not have any mailboxes, timers or CMA region assigned, they should be added in the respective board dts files. 2. The node should also be enabled as per the individual product configuration in the corresponding board dts files. Signed-off-by: Suman Anna [t-kristo@ti.com: converted to support ti-sysc from legacy hwmod] Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 46ab8238e3e81669c41c698460583636e811018e Author: Suman Anna Date: Fri Apr 24 18:12:29 2020 +0300 ARM: dts: DRA7: Add common IPU and DSP nodes The DRA7xx family of SOCs have two IPUs and upto two DSP processor subsystems in general. The IPU processor subsystem contains dual-core ARM Cortex-M4 processors, while the DSP processor subsystem is based on the TI's standard TMS320C66x DSP CorePac core. The IPUs are very similar to those on OMAP5. Two IPUs and one DSP processor subsystems is the most common configuration. The processor device DT nodes have been added for these processor subsystems, with the internal memories added through 'reg' and 'reg-names' properties. The IPUs only have an L2 RAM, whereas the DSPs have L1P, L1D and L2 RAM memories. NOTE: 1. The nodes do not have any mailboxes, timers or CMA regions assigned, they should be added in the respective board dts files. 2. The nodes haven been disabled by default and the enabling of these nodes is also left to the respective board dts files. Signed-off-by: Suman Anna [t-kristo@ti.com: convert to ti-sysc support from legacy hwmod] Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 5390130f3b288db7d67de5e6c29d0de70d327ff0 Author: Tero Kristo Date: Fri Apr 24 18:12:28 2020 +0300 ARM: dts: dra7: add timer_sys_ck entries for IPU/DSP timers With this, the clocksource driver can setup the timers properly. Signed-off-by: Tero Kristo Signed-off-by: Tony Lindgren commit 7cf0bb804d7f9ca6cea10a80045224a68435a11c Merge: 441ba630ac92 ac819eda7cc9 Author: Tony Lindgren Date: Tue May 5 11:09:38 2020 -0700 Merge branch 'omap-for-v5.8/dt-timer' into omap-for-v5.8/dt commit ac819eda7cc96656df50897848ffe5dfe9a3cb7c Author: Lokesh Vutla Date: Mon Apr 27 22:56:04 2020 +0530 ARM: dts: Add 32KHz clock as default clock source Clocksource to timer configured in pwm mode can be selected using the DT property ti,clock-source. There are few pwm timers which are not selecting the clock source and relying on default value in hardware or selected by driver. Instead of relying on default value, always select the clock source from DT. Signed-off-by: Lokesh Vutla Reviewed-by: Suman Anna Signed-off-by: Tony Lindgren commit 65fce35f73d2066b6e31e0ccdb07f9cc5a1a1374 Author: Andy Shevchenko Date: Tue May 5 15:44:45 2020 +0300 platform/x86: touchscreen_dmi: Drop comma in terminator line There is no need to have comma in terminator line. This will help to find a potentially broken entries, due to placing after it, during compilation time. Signed-off-by: Andy Shevchenko commit 06b2ee07abce1e17fe471e93d271be68d58c5644 Author: Andrew Dunai Date: Tue May 5 15:15:18 2020 +0300 platform/x86: touchscreen_dmi: add Vinga J116 touchscreen Add support for Vinga Twizzle J116 Silead touchscreen which uses GSL1680 chip. Signed-off-by: Andrew Dunai Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 2d30fcdd439f766fa984df3854fd57c3c5daba7e Author: Jithu Joseph Date: Mon Apr 27 16:15:14 2020 -0700 platform/x86: Add Slim Bootloader firmware update signaling driver Slim Bootloader(SBL) is a small open-source boot firmware, designed for running on certain Intel platforms. SBL can be thought-of as fulfilling the role of a minimal BIOS implementation, i.e initializing the hardware and booting Operating System. Since SBL is not UEFI compliant, firmware update cannot be triggered using standard UEFI runtime services. Further considering performance impact, SBL doesn't look for a firmware update image on every reset and does so only when firmware update signal is asserted. SBL exposes an ACPI-WMI device which comes up in sysfs as /sys/bus/wmi/44FADEB1xxx and this driver adds a "firmware_update_request" device attribute. This attribute normally has a value of 0 and userspace can signal SBL to update firmware, on next reboot, by writing a value of 1 like: echo 1 > /sys/bus/wmi/devices/44FADEB1xxx/firmware_update_request This driver only implements a signaling mechanism, the actual firmware update process and various details like firmware update image format, firmware image location etc are defined by SBL and are not in the scope of this driver. DocLink: https://slimbootloader.github.io/security/firmware-update.html Signed-off-by: Jithu Joseph Signed-off-by: Andy Shevchenko commit 3ce2db608ec362bb01b821fb74a8e75989d54376 Author: Arnd Bergmann Date: Tue Apr 28 23:36:38 2020 +0200 platform/x86: intel_pmc_core: avoid unused-function warnings When both CONFIG_DEBUG_FS and CONFIG_PM_SLEEP are disabled, the functions that got moved out of the #ifdef section now cause a warning: drivers/platform/x86/intel_pmc_core.c:654:13: error: 'pmc_core_lpm_display' defined but not used [-Werror=unused-function] 654 | static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev, | ^~~~~~~~~~~~~~~~~~~~ drivers/platform/x86/intel_pmc_core.c:617:13: error: 'pmc_core_slps0_display' defined but not used [-Werror=unused-function] 617 | static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, | ^~~~~~~~~~~~~~~~~~~~~~ Rather than add even more #ifdefs here, remove them entirely and let the compiler work it out, it can actually get rid of all the debugfs calls without problems as long as the struct member is there. The two PM functions just need a __maybe_unused annotations to avoid another warning instead of the #ifdef. Fixes: aae43c2bcdc1 ("platform/x86: intel_pmc_core: Relocate pmc_core_*_display() to outside of CONFIG_DEBUG_FS") Signed-off-by: Arnd Bergmann Signed-off-by: Andy Shevchenko commit b4603cb4b1edc85cbc3f8721c289087aa02a98ea Author: Mika Westerberg Date: Tue Apr 28 11:51:13 2020 +0300 MAINTAINERS: Add me as maintainer of Intel SCU drivers I will be helping the x86 platform driver maintainers to look after Intel SCU drivers. Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 7a61f05e94c36a6970bd475306864ee0f698f3e9 Author: Mika Westerberg Date: Tue Apr 28 11:51:12 2020 +0300 platform/x86: Add Elkhart Lake SCU/PMC support Intel Elkhart Lake exposes SCU/PMC as an ACPI device that only supports IPC functionality so add a platform driver supporting it. Interrupt is optional so we let intel_scu_ipc_probe() to decide based on the passed platform data whether it uses interrupt or polling. Co-developed-by: Divya Sasidharan Signed-off-by: Divya Sasidharan Co-developed-by: Rajmohan Mani Signed-off-by: Rajmohan Mani Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit b991178fe3cb8ab326167da0f74e7f20bbe269cf Author: Xiongfeng Wang Date: Wed Apr 29 16:59:40 2020 +0800 platform/x86: thinkpad_acpi: Remove always false 'value < 0' statement Since 'value' is declared as unsigned long, the following statement is always false. value < 0 So let's remove it. Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang Signed-off-by: Andy Shevchenko commit 7fcffecf79ba2963f1f7cf967f451818a7913482 Author: Arnd Bergmann Date: Tue May 5 16:01:52 2020 +0200 drm/amdgpu: allocate large structures dynamically After the structure was padded to 1024 bytes, it is no longer suitable for being a local variable, as the function surpasses the warning limit for 32-bit architectures: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:587:5: error: stack frame size of 1072 bytes in function 'amdgpu_ras_feature_enable' [-Werror,-Wframe-larger-than=] int amdgpu_ras_feature_enable(struct amdgpu_device *adev, ^ Use kzalloc() instead to get it from the heap. Fixes: a0d254820f43 ("drm/amdgpu: update RAS TA to Host interface") Acked-by: Christian König Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit bcb7b0ef828c21a0b629d6081c0827e71574d652 Author: Andriy Gapon Date: Tue May 5 16:27:29 2020 +0300 amdgpu_acpi: add backlight control for the DC case This uses backlight_device_set_brightness() to set the brightness level requested via ATIF. Signed-off-by: Andriy Gapon Signed-off-by: Alex Deucher commit a2eb03a569f7482da3bed651424606da7b960bf8 Author: ChenTao Date: Tue May 5 12:57:37 2020 +0800 drm/radeon: fix unsigned comparison with 0 Fixes warning because pipe is unsigned long and can never be negtative vers/gpu/drm/radeon/radeon_kms.c:831:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (pipe < 0 || pipe >= rdev->num_crtc) { drivers/gpu/drm/radeon/radeon_kms.c:857:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (pipe < 0 || pipe >= rdev->num_crtc) { Reported-by: Hulk Robot Signed-off-by: ChenTao Signed-off-by: Alex Deucher commit 54b7feb93fc33c48619472d8b7fce41cc5acafc9 Author: Nathan Chancellor Date: Fri May 1 20:11:41 2020 -0700 drm/amdgpu: Avoid integer overflow in amdgpu_device_suspend_display_audio When building with Clang: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4160:53: warning: overflow in expression; result is -294967296 with type 'long' [-Winteger-overflow] expires = ktime_get_mono_fast_ns() + NSEC_PER_SEC * 4L; ^ 1 warning generated. Multiplication happens first due to order of operations and both NSEC_PER_SEC and 4 are long literals so the expression overflows. To avoid this, make 4 an unsigned long long literal, which matches the type of expires (u64). Fixes: 3f12acc8d6d4 ("drm/amdgpu: put the audio codec into suspend state before gpu reset V3") Link: https://github.com/ClangBuiltLinux/linux/issues/1017 Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit cf9d811935df2f8775ead12d01a4fa96aae5011d Author: Aric Cyr Date: Mon Apr 27 11:38:12 2020 -0400 drm/amd/display: 3.2.84 Signed-off-by: Aric Cyr Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit e3f36d18eba382e6fe8d607eef54db361f6a3fc8 Author: Anthony Koo Date: Sat Apr 25 20:15:49 2020 -0400 drm/amd/display: Add struct field for future use Add dmub related struct field for future use. Signed-off-by: Anthony Koo Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit cdca3f218d9bbe086b0df9bc95b4f0c0d1011415 Author: Anthony Koo Date: Tue Apr 21 22:01:58 2020 -0400 drm/amd/display: move location of dmub_srv.h file [Why] Make a separation of what belongs in the differen dmub headers dmub_srv.h is for exposing dmub srv interface to rest of driver. other headers inside dmub/inc exposes cmds and definitions that are owned by the firmware [How] keep firmware owned definitions in dmub/inc move stuff that is purely driver interface headers to dmub/ since those are interface calls that are defined for rest of driver to use Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Harry Wentland Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit b5decb5c66d28ebdef2eb2a1898bfd2b257f85f3 Author: Aurabindo Pillai Date: Thu Apr 30 11:55:36 2020 -0400 drm/amd/display: remove unused module/stats Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 17bdb4a82fe5014c8aa5b2103c80c5729744a096 Author: Jerry (Fangzhi) Zuo Date: Fri Apr 24 14:09:23 2020 -0400 drm/amd/display: Check DMCU Exists Before Loading Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Hersen Wu Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 7b353e41b4171c5dcc171306e4790bc328536f49 Author: Aurabindo Pillai Date: Wed Apr 22 14:37:33 2020 -0400 drm/amd/display: Prevent dpcd reads with passive dongles [why] During hotplug, a DP port may be connected to the sink through passive adapter which does not support DPCD reads. Issuing reads without checking for this condition will result in errors [how] Ensure the link is in aux_mode before initiating operation that result in a DPCD read. Signed-off-by: Aurabindo Pillai Reviewed-by: Harry Wentland Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 65d68369826918a33d5fb4524efab4109b8e497b Author: Isabel Zhang Date: Mon Apr 20 15:21:10 2020 -0400 drm/amd/display: Add 4 to 1 MPC split support [Why] Want to make use of detile buffer of all 4 pipes to maximize amount of data stored to hide certain memory latency cases. [How] In case of 1 plane and 1 stream, program 4 pipes to each retrieve 1/4 of plane later mixed together by the MPCs. Added support for transition from 4 to 1 MPC to 2 to 1 MPC or no pipe split case and vice versa. Currently, only enabled if debug flag is set. Signed-off-by: Isabel Zhang Reviewed-by: Dmytro Laktyushkin Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit e0a3794d226a5ab30ca6d68069bf32ed48c632bf Author: yanyan kang Date: Mon Apr 20 14:40:43 2020 +0800 drm/amd/display: The external monitor will show gray screen during SUT reboot [Why] same with CL#1711022(correcting yuv420 black color in function dcn10_blank_pixel_data,program_scaler), yuv420 black color also needs to be correct when enabling HDMI stream at the resume procedure. [How] correcting the yuv420 black color according to the way how 420 is packed :2 channels carry Y component, 1 channel alternate between Cb and Cr. Signed-off-by: yanyan kang Reviewed-by: Eric Yang Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1cfbbddead0abd8551ad2da5630cefea0a4289a6 Author: Anthony Koo Date: Tue Apr 21 22:01:30 2020 -0400 drm/amd/display: add addition dc type to translate to dmub fw type [Why] For a type like PSR version, it makes sense for most of the code to include a dc type, instead of having this a fw type define since this is a capability and type exposed by dc. Especially if it doesn't even need to communicate with the fw. The code that is packing the firmware command message should be the one who needs to translate the psr version into a command that the firmware understands. [How] Add a dc_psr_version enum. Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 492548dcb045e1bd3a7424fb75a8fbe7dbd09ec4 Author: Stylon Wang Date: Tue Apr 21 20:47:41 2020 +0800 drm/amd/display: Support FP16 pixel format [Why] FP16 pixel format is not declared to DRM in Linux DM. [How] Add FP16 format to the support list presented to DRM from Linux DM. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit b130cc4eec04d2cedf1af9e630530859c8a60d7c Author: Lewis Huang Date: Wed Apr 22 10:01:23 2020 +0800 drm/amd/display: temporary clamp the vratio used to 1.0 [Why] in Is_Support function, driver report different caps between same timing but different scaling cause OS inconsistent. [How] min_row_time is a local that’s only used for verifying immediate flip support. Clamp the vratio used for its calculation to 1.0. Signed-off-by: Lewis Huang Reviewed-by: Tony Cheng Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit f00889dc7157fa32d2319483b713752ed37ea0e5 Author: Alvin Lee Date: Tue Apr 21 12:29:12 2020 -0400 drm/amd/display: Allow PState switch in VBLANK one display VACTIVE [Why] For certain display configurations we want to allow PSTATE switch when one display can switch in VACTIVE and the other display can switch in VBLANK [How] Add extra condition to dcn2 pstate support check Signed-off-by: Alvin Lee Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 5f6dbd54c05f38d30da9c1d310219808a69afd35 Author: Roman Li Date: Wed Feb 26 17:30:29 2020 -0500 drm/amd/display: fix counter in wait_for_no_pipes_pending [Why] Wait counter is not being reset for each pipe. [How] Move counter reset into pipe loop scope. Signed-off-by: Roman Li Reviewed-by: Zhan Liu Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 8c076bc8d731ece31c7c932730c5581af50f47da Author: Aric Cyr Date: Tue Apr 21 21:41:25 2020 -0400 drm/amd/display: Mode change with same timing causing long display blank [Why] What a mode change is requested for the same timing a full stream reset can occur in some cases which causes monitor to blank for a few seconds. [How] Do not consider infoframe updates as needing a full stream reset as they will be handled on the first flip after a modeset when surface information is available. Signed-off-by: Aric Cyr Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit e9a135a969352e5cc945a8db636163a7bb8e4ada Author: Sung Lee Date: Mon Apr 20 11:38:30 2020 -0400 drm/amd/display: Update DCN2.1 DV Code Revision [WHY & HOW] There is a problem in hscale_pixel_rate, the bug causes DCN to be more optimistic (more likely to underflow) in upscale cases during prefetch. This commit ports the fix from DV code to address these issues. Signed-off-by: Sung Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 3ba01817365c5a2c07a8be09117f3e22e16f5c80 Author: Yongqiang Sun Date: Sat Apr 18 19:22:55 2020 -0400 drm/amd/display: Move panel_cntl specific register from abm to panel_cntl. [Why] panel_cntl specific register should be access in panel_cntl object. [How] Move these register access from abm to panel_cntl. Signed-off-by: Yongqiang Sun Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1c2075d401f06a2642644ae5ccd3aa793a1b577b Author: Jason Yan Date: Mon May 4 19:32:13 2020 +0800 drm/amd/display: remove unused variable 'ret' in dm_suspend() Fix the following coccicheck warning: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1574:5-8: Unneeded variable: "ret". Return "0" on line 1586 Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit 03cc105f2edfe2b95ffce56422c38862a23dbbd1 Author: Rob Herring Date: Wed Apr 29 15:58:15 2020 -0500 clk: vexpress-osc: Use the devres clock API variants In preparation to enable the vexpress-osc clock driver as a module, convert the driver to use the managed devres clock API variants. With this, a driver .remove() hook is not needed. Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: linux-clk@vger.kernel.org Reviewed-by: Stephen Boyd Reviewed-by: Sudeep Holla Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit 562bbb233513560e2a4b253382321b175420b024 Author: Rob Herring Date: Wed Apr 29 15:58:14 2020 -0500 clk: versatile: Only enable SP810 on 32-bit by default While 64-bit Arm reference platforms have SP810 for clocks for SP804 timers, they are not needed since the arch timers are used instead. Cc: Catalin Marinas Cc: Will Deacon Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: linux-clk@vger.kernel.org Reviewed-by: Sudeep Holla Reviewed-by: Stephen Boyd Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit 81134fb541d46d0441ce7fce557eba6c418fcc36 Author: Rob Herring Date: Wed Apr 29 15:58:13 2020 -0500 clk: versatile: Rework kconfig structure CONFIG_COMMON_CLK_VERSATILE doesn't really do anything other than hiding Arm Ltd reference platform clock drivers. It is both selected by the platforms that need it and has a 'depends on' for those platforms. Let's drop the selects and convert CONFIG_COMMON_CLK_VERSATILE into a menuconfig entry. With this make CONFIG_ICST visible. Move the 'select REGMAP_MMIO' to the drivers that require it (SP810 did not). This also has the side effect of enabling CONFIG_ICST for COMPILE_TEST as it was not visible before. Cc: Catalin Marinas Cc: Will Deacon Cc: Liviu Dudau Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring commit 039599c92d3b2e73689e8b6e519d653fd4770abb Author: Rob Herring Date: Wed Apr 29 15:58:12 2020 -0500 amba: Retry adding deferred devices at late_initcall If amba bus devices defer when adding, the amba bus code simply retries adding the devices every 5 seconds. This doesn't work well as it completely unsynchronized with starting the init process which can happen in less than 5 secs. Add a retry during late_initcall. If the amba devices are added, then deferred probe takes over. If the dependencies have not probed at this point, then there's no improvement over previous behavior. To completely solve this, we'd need to retry after every successful probe as deferred probe does. The list_empty() check now happens outside the mutex, but the mutex wasn't necessary in the first place. This needed to use deferred probe instead of fragile initcall ordering on 32-bit VExpress systems where the apb_pclk has a number of probe dependencies (vexpress-sysregs, vexpress-config). Cc: John Stultz Cc: Saravana Kannan Cc: Nicolas Saenz Julienne Cc: Geert Uytterhoeven Cc: Russell King Tested-by: Sudeep Holla Reviewed-by: Sudeep Holla Reviewed-by: Linus Walleij Signed-off-by: Rob Herring commit 6aec54a649576e59d20c7ed0b3f000b8b5dff56b Author: Rob Herring Date: Wed Apr 29 15:58:11 2020 -0500 arm64: vexpress: Don't select CONFIG_POWER_RESET_VEXPRESS The VExpress power-off/reset driver is not needed on 64-bit platforms as PSCI power-off and reset can be used instead. Stop selecting it so it can be disabled and not always built-in. CONFIG_VEXPRESS_CONFIG can also be dropped as it was a dependency for CONFIG_POWER_RESET_VEXPRESS. Cc: Catalin Marinas Cc: Will Deacon Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Signed-off-by: Rob Herring commit 9b06fc39084e161da84a399b6b5dc524e673f51e Author: Rob Herring Date: Wed Apr 29 15:58:10 2020 -0500 ARM: vexpress: Move vexpress_flags_set() into arch code vexpress_flags_set() is only used by the platform SMP related code and has nothing to do with the vexpress-sysreg MFD driver other than both access the same h/w block. It's also only needed for 32-bit systems and must be built-in for them. Let's move vexpress_flags_set() closer to where it is being used. This will allow for vexpress-sysreg to be built as a module. Cc: Lorenzo Pieralisi Cc: Linus Walleij Reviewed-by: Sudeep Holla Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Acked-by: Lee Jones Signed-off-by: Rob Herring commit 3831c051dfbf58595085e432acc00ad4efcf54cc Author: Kent Gibson Date: Thu Apr 30 08:09:16 2020 +0800 tools: gpio: add bias flags to lsgpio Add display of the bias flags. Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski commit 17f96ee2b9be9b65517fe167cfb13b86b33f3a1d Author: Petteri Jokinen Date: Sat May 2 20:22:39 2020 +0300 gpio-f7188x: Add GPIO support for F81865 Add GPIO support for Fintek F81865 chip. Datasheet: http://www.hardwaresecrets.com/datasheets/F81865_V028P.pdf Signed-off-by: Petteri Jokinen Signed-off-by: Bartosz Golaszewski commit fef2d3bb2db61d904e4016a181dd107d608fd055 Author: Mian Yousaf Kaukab Date: Tue May 5 10:45:01 2020 +0200 gpio: tegra186: export MODULE_DEVICE_TABLE Export MODULE_DEVICE_TABLE since the driver can be built as a module. Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Bartosz Golaszewski commit 56b62540782bfde459acc8eb15b949eaf151c881 Author: Wang Wenhu Date: Wed Apr 29 06:11:09 2020 -0700 doc: thermal: add cpu-idle-cooling to index tree Add cpu-idle-cooling.rst to the index list for user reference through self-compiled htmldocs or online documentation tree of kernel. Like: https://www.kernel.org/doc/html/latest/driver-api/thermal/index.html Signed-off-by: Wang Wenhu Cc: Daniel Lezcano Link: https://lore.kernel.org/r/20200429131109.80891-1-wenhu.wang@vivo.com Signed-off-by: Jonathan Corbet commit f187b6974f6dfbeba4aafda972cc37f27d091b73 Author: Sean Fu Date: Wed Apr 29 12:04:13 2020 +0800 workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO. Replace inline function PTR_ERR_OR_ZERO with IS_ERR and PTR_ERR to remove redundant parameter definitions and checks. Reduce code size. Before: text data bss dec hex filename 47510 5979 840 54329 d439 kernel/workqueue.o After: text data bss dec hex filename 47474 5979 840 54293 d415 kernel/workqueue.o Signed-off-by: Sean Fu Signed-off-by: Tejun Heo commit 649f9cf5f5964a9b26d8407289c356624652162a Author: Federico Vaga Date: Sun Apr 26 23:14:29 2020 +0200 doc:locking: remove info about old behavior of locktorture It is not useful to know what was the default at some point in the past: remove the information. Signed-off-by: Federico Vaga Link: https://lore.kernel.org/r/20200426211429.29133-1-federico.vaga@vaga.pv.it Signed-off-by: Jonathan Corbet commit d75829c182609f9cc6ebdbab486500f638a871df Author: Stephen Kitt Date: Wed Apr 29 22:57:57 2020 +0200 docs: sysctl/kernel: document firmware_config Based on the firmware fallback mechanisms documentation and the implementation in drivers/base/firmware_loader/fallback.c. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200429205757.8677-2-steve@sk2.org Signed-off-by: Jonathan Corbet commit 50cdae76b8d021f31ea07af3bb30983486b79df8 Author: Stephen Kitt Date: Wed Apr 29 22:57:56 2020 +0200 docs: sysctl/kernel: document ftrace entries Based on the ftrace documentation, the tp_printk boot parameter documentation, and the implementation in kernel/trace/trace.c. Signed-off-by: Stephen Kitt Acked-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/r/20200429205757.8677-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit c624adc9cb6e6e8f1c0230a7775add700bc2409b Author: Arnd Bergmann Date: Tue Apr 28 23:25:33 2020 +0200 samples: fix binderfs sample A routine check for misspelled Kconfig symbols showed on instance from last year, the correct symbol name is CONFIG_ANDROID_BINDERFS, not CONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix must be removed in the Kconfig file to allow enabling the sample. As the actual sample fails to build as a kernel module, change the Makefile enough to get to build as a hostprog instead. Fixes: 9762dc1432e1 ("samples: add binderfs sample program") Signed-off-by: Arnd Bergmann Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20200428212555.2806258-1-arnd@arndb.de Signed-off-by: Jonathan Corbet commit 190e1597e5e07c7eb7edc0b040b007a59b1e4a84 Author: Vitor Massaru Iha Date: Thu Apr 30 19:12:38 2020 -0300 docs: s390: Fix wrong label Guest2 instead of Guest3 This fixes: Documentation/s390/vfio-ap.rst:488: WARNING: duplicate label s390/vfio-ap:guest2, other instance in /home/iha/sdb/opensource/lkmp/linux_doc/Documentation/s390/vfio-ap.rst Signed-off-by: Vitor Massaru Iha Link: https://lore.kernel.org/r/20200430221238.101838-1-vitor@massaru.org Signed-off-by: Jonathan Corbet commit effa2cd84cb569cd20c9a0b7f04242569057358f Author: Vitor Massaru Iha Date: Thu Apr 30 17:36:12 2020 -0300 docs: coresight: fix `make htmldocs` warning Fix `make htmldocs` warning: Documentation/trace/coresight/coresight-ect.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent. Signed-off-by: Vitor Massaru Iha Link: https://lore.kernel.org/r/20200430203612.90404-1-vitor@massaru.org Signed-off-by: Jonathan Corbet commit b67aa4ef68ed4f2933d06eb65a5721c97cce9934 Author: Federico Vaga Date: Fri May 1 00:20:37 2020 +0200 doc:it_IT: align Italian translation Translation for the following patches: commit c4f4af4094d6 ("docs: Add documentation for Symbol Namespaces") commit 36bc683dde0a ("kernel-doc: rename the kernel-doc directive 'functions' to 'identifiers'") commit a035d552a93b ("Makefile: Globally enable fall-through warning") commit b9918bdcac1f ("Documentation/process: Add fallthrough pseudo-keyword") commit 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst") commit fb0e0ffe7fc8 ("Documentation: bring process docs up to date") commit 7af51678b6d3 ("docs: deprecated.rst: Add BUG()-family") commit 7929b9836ed0 ("docs: Remove :c:func: from process/deprecated.rst") commit 76136e028d3b ("docs: deprecated.rst: Clean up fall-through details") commit d8401f504b49 ("docs: deprecated.rst: Add %p to the list") commit b1735296cef9 ("docs: locking: Drop :c:func: throughout") commit 6adb7755996f ("docs: locking: Add 'need' to hardirq section") Signed-off-by: Federico Vaga Link: https://lore.kernel.org/r/20200430222037.4480-1-federico.vaga@vaga.pv.it Signed-off-by: Jonathan Corbet commit 16a398d17649d781773fa8e342a4ce28cd65af97 Author: Vitor Massaru Iha Date: Thu Apr 30 19:58:28 2020 -0300 doc: misc-device: add uacce to toctree(index) This fixes: Documentation/misc-devices/uacce.rst: WARNING: document isn't included in any toctree Signed-off-by: Vitor Massaru Iha Link: https://lore.kernel.org/r/20200430225828.114033-1-vitor@massaru.org Signed-off-by: Jonathan Corbet commit 35c59990058351a1c9efab9e49dd19c2e5579cfb Author: Joshua Abraham Date: Fri May 1 18:36:24 2020 -0400 docs: kvm: Fix KVM_KVMCLOCK_CTRL API doc The KVM_KVMCLOCK_CTRL ioctl signals to supported KVM guests that the hypervisor has paused it. Update the documentation to reflect that the guest is notified by this API. Signed-off-by: Joshua Abraham Link: https://lore.kernel.org/r/20200501223624.GA25826@josh-ZenBook Signed-off-by: Jonathan Corbet commit 094d6dc56245d0c796af9ed3e680effbe66ba0b5 Author: Wolfram Sang Date: Sat May 2 16:30:58 2020 +0200 watchdog: update email address in conversion doc The old one is defunct. However, I think it makes sense that I am still the primary contact person for updates here. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20200502143103.19473-1-wsa@kernel.org Signed-off-by: Jonathan Corbet commit 3eaa3bfa380bf07f778bc2ff57441976803ccaed Author: Qi Zheng Date: Tue May 5 14:18:28 2020 +0800 kobject: documentation: Fix erroneous function example in kobject doc. Update the definitions of some functions listed in the kobject document, since they have been changed. Signed-off-by: Qi Zheng Link: https://lore.kernel.org/r/20200505061828.42952-1-arch0.zheng@gmail.com Signed-off-by: Jonathan Corbet commit 92f0fa8b5df43a88e0a0a7d9f4cbebc079bdcf79 Author: Mauro Carvalho Chehab Date: Wed Apr 22 10:44:21 2020 +0200 media: admin-guide: split cardlist.rst file After adding all cardlists, this file became too big. Split it on smaller files, in order to make easier to maintain. Signed-off-by: Mauro Carvalho Chehab commit 716448642d71aa73dcdd494bc7bd309aaaf8896c Author: Mauro Carvalho Chehab Date: Wed Apr 22 09:25:00 2020 +0200 media: admin-guide: make clear about PCI subsystem IDs On several parts of the document, it mentions "PCI ID", when it is actually referring to the subsystem's part of the PCI ID. Change the language to let it be clear. Signed-off-by: Mauro Carvalho Chehab commit 919e2bb8b63c6084593d7e77d71351e02b941aab Merge: ec43a27fffd0 982649915d62 Author: Jonathan Corbet Date: Tue May 5 09:28:56 2020 -0600 Merge branch 'mauro' into docs-next Mauro says: This is the second part of a series I wrote sometime ago where I manually convert lots of files to be properly parsed by Sphinx as ReST files. As it touches on lot of stuff, this series is based on today's linux-next, at tag next-20190617. The first version of this series had 57 patches. The first part with 28 patches were already merged. Right now, there are still ~76 patches pending applying (including this series), and that's because I opted to do ~1 patch per converted directory. That sounds too much to be send on a single round. So, I'm opting to split it on 3 parts for the conversion, plus a final patch adding orphaned books to existing ones. Those patches should probably be good to be merged either by subsystem maintainers or via the docs tree. I opted to mark new files not included yet to the main index.rst (directly or indirectly) with the :orphan: tag, in order to avoid adding warnings to the build system. This should be removed after we find a "home" for all the converted files within the new document tree arrangement, after I submit the third part. commit 3b5af3171e2d5a73ae6f04965ed653d039904eb6 Author: Dan Carpenter Date: Tue May 5 10:25:56 2020 +0200 media: cec: silence shift wrapping warning in __cec_s_log_addrs() The log_addrs->log_addr_type[i] value is a u8 which is controlled by the user and comes from the ioctl. If it's over 31 then that results in undefined behavior (shift wrapping) and that leads to a Smatch static checker warning. We already cap the value later so we can silence the warning just by re-ordering the existing checks. I think the UBSan checker will also catch this bug at runtime and generate a warning. But otherwise the bug is harmless. Fixes: 9881fe0ca187 ("[media] cec: add HDMI CEC framework (adapter)") Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 62eedb356188376acd0368384a9b294d5180c00b Author: Christophe JAILLET Date: Tue May 5 09:50:34 2020 +0200 media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()' It is spurious to call 'clk_disable_unprepare()' when 'clk_prepare_enable()' has not been called yet. Re-order the error handling path to avoid it. Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver") Signed-off-by: Christophe JAILLET Acked-by: Chen-Yu Tsai Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: err_exlusive_rate -> err_exclusive_rate] Signed-off-by: Mauro Carvalho Chehab commit f4d12d8009d9e9917859c6a4291d49c6e70e92c1 Author: Nícolas F. R. A. Prado Date: Fri May 1 15:11:23 2020 +0200 media: vimc: deb: Add support for {RGB,BGR,GBR}888 bus formats on source pad Add support for RGB888_*, BGR888_* and GBR888_* media bus formats on the source pad of debayer subdevices. Acked-by: Helen Koike Co-developed-by: Vitor Massaru Iha Signed-off-by: Vitor Massaru Iha Signed-off-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 772563b27c9f5cb0e19bf6c5fb4383a86e3347e3 Author: Nícolas F. R. A. Prado Date: Fri May 1 15:11:12 2020 +0200 media: vimc: Add missing {RGB,BGR,GBR}888 media bus codes Add missing RGB888_*, BGR888_* and GBR888_* media bus codes in the vimc_pix_map_list. Since there is no GBR24 pixelformat, use the RGB24 pixelformat for MEDIA_BUS_FMT_GBR888_1X24. Acked-by: Helen Koike Co-developed-by: Vitor Massaru Iha Signed-off-by: Vitor Massaru Iha Signed-off-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b77da87c84f8d3f0290ef96f72edac9a9d2b1d23 Author: Nícolas F. R. A. Prado Date: Fri May 1 15:11:02 2020 +0200 media: vimc: Support multiple media bus codes for each pixelformat Change vimc_pix_map_list to allow multiple media bus codes to map to the same pixelformat, making it possible to add media bus codes for which there are no pixelformat. Acked-by: Helen Koike Signed-off-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: fix sparse warning: const u32 -> u32] Signed-off-by: Mauro Carvalho Chehab commit 6c8d0cdd6ccb21badd52a10d627f80cf1a6ab63f Author: Arnd Bergmann Date: Tue Apr 28 23:34:19 2020 +0200 media: ti-vpe: avoid gcc-9 warning gcc warns about empty array declarations, which we get in this driver when compile-testing without CONFIG_OF: drivers/media/platform/ti-vpe/cal.c:2194:34: warning: array 'cal_of_match' assumed to have one element 2194 | static const struct of_device_id cal_of_match[]; Since all users of this driver do need CONFIG_OF anyway, there is no point in making the array definition conditional to save space, so just remove the #ifdef and move the array up a little. Fixes: 343e89a792a5 ("[media] media: ti-vpe: Add CAL v4l2 camera capture driver") Signed-off-by: Arnd Bergmann Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7c192ebf394c2c67a572050ee872548c0d2f639b Author: John Oldman Date: Tue Apr 28 19:26:55 2020 +0200 media: staging: media: usbvision: usbvision-core Correct spelling Correct spelling in comment Signed-off-by: John Oldman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 982649915d626bba8753c04e994e5a6650523c64 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:21 2020 +0200 docs: filesystems: convert configfs.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Use copyright symbol; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Also, as this file is alone on its own dir, and it doesn't seem too likely that other documents will follow it, let's move it to the filesystems/ root documentation dir. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c2424ec2ad4d735751434ff7f52144c44aa02d5a.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a97f52b0f1a687141fee82246306ce7ff93b49dd Author: Greg Kroah-Hartman Date: Tue Apr 28 19:04:05 2020 +0200 media: staging: media: imx: no need to check return value of debugfs_create functions When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Steve Longerbeam Cc: Philipp Zabel Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: devel@driverdev.osuosl.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fc2f6fe745a0fa287f68cb8fba04040aaf73fa28 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:20 2020 +0200 docs: filesystems: convert xfs-self-describing-metadata.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/7c26b200e12cfc07b9bd379612452d845a8d1474.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit c3d2f6cb4c707736e19eee4340357f2d8286b5c8 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:19 2020 +0200 docs: filesystems: convert xfs-delayed-logging-design.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2233c248f12e7b465cd27ee30a86f96eb632946a.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit ec4551f45036d23a34d4f13ab3ce2ea345a13de7 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:18 2020 +0200 docs: filesystems: convert sysfs-tagging.txt to ReST - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/45a01fa5edd5c6ee8fc0754fc74f7ef65a3e5581.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 28bcadf0ae994fd3584f43c39b6915ee70b59749 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:17 2020 +0200 docs: filesystems: convert sysfs-pci.txt to ReST - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add table markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2a9d307753c97d1a843341a2ef1993d43a407ded.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e2975d7ca8df8775409c948310bc0f39678d1612 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:16 2020 +0200 docs: filesystems: convert spufs/spu_run.txt to ReST This file is at groff output format. Manually convert it to ReST format, trying to preserve a similar output after parsed. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/7d8ee1edf5ef0137009bc65ff0441826ce555895.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 299cd2747c61009f32943217c79f3c89728eb2ac Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:15 2020 +0200 docs: filesystems: convert spufs/spufs.txt to ReST This file is at groff output format. Manually convert it to ReST format, trying to preserve a similar output after parsed. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9ca05fad12390931bc7da0fa2502d1a450a4b87f.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit dc3f043ff0e44862a237d87f37ca04694d884049 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:14 2020 +0200 docs: filesystems: convert spufs/spu_create.txt to ReST This file is at groff output format. Manually convert it to ReST format, trying to preserve a similar output after parsed. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/4d42e97d5560a79bd5dd443c592be04f9ae9a757.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a5a1c349ac48252e871abaecabc158f761e0aa92 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:13 2020 +0200 docs: filesystems: split spufs.txt into 3 separate files This file has manpages for 3 different things. As we'll be converting it to ReST, let's fist split it into their individual components. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3753aa73524f4e1cbf0c19e34f7b322420e0b1c6.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit cf06612c65e5dc86f42cdad0b9fc24a90fe18a07 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:12 2020 +0200 docs: filesystems: convert sharedsubtree.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add table markups; - Add it to filesystems/index.rst Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6692b8abc177130e9e53aace94117a2ad076cab5.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 53a41d3eec863f12fead722f774fc36bd697f550 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:11 2020 +0200 docs: filesystems: convert seq_file.txt to ReST - Add a SPDX header; - Add a document title; - Adjust section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/f950a0a56178ee05872ae2a2711a04d7af8ebb24.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 9b6f151e768682206673de065eaca401e2baaf11 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:10 2020 +0200 docs: filesystems: convert quota.txt to ReST - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: Jan Kara Link: https://lore.kernel.org/r/10a707377475bb252f454af2b8f58a038527933f.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 791a17ee19736fc6d4e35c4bf9f8efd1001be77c Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:09 2020 +0200 docs: filesystems: convert mount_api.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add table markups; - Add lists markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/32332c1659a28c22561cb5e64162c959856066b4.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a02dcdf65bcfca1068e9c6d2cbafdab724cfbce9 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:08 2020 +0200 docs: filesystems: convert mandatory-locking.txt to ReST - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Use notes markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/aecd6259fe9f99b2c2b3440eab6a2b989125e00d.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 63526525dd7a9c85786ff9f9592b6f4281ad6171 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:07 2020 +0200 docs: filesystems: convert locks.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/467b3f20e63d2640d22599b99229699b5fb79251.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit ba302d2a8ef0917a6d1c3775d1b4b9f2b26c8ef5 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:06 2020 +0200 docs: filesystems: convert fuse-io.txt to ReST - Add a SPDX header; - Add a document title; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/88ec8025c1c5fc3ac5b65f1151c41ebcc696dc0e.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e6d42cb19c0367ae6b0edfc09daceaefded4cbdd Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:05 2020 +0200 docs: filesystems: convert files.txt to ReST - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e31b0f6a7ee466a233dc7f9c73f53f07ebb07f0b.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e6f7df74ec1ab956430db2dcdcaf217ae5cf4ae0 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:04 2020 +0200 docs: filesystems: convert fiemap.txt to ReST - Add a SPDX header; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9182d49ffca7a0580e32ab24ecf5f8cc8d8924af.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit b31763cff488344aaabbee99739774aea1636e27 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:03 2020 +0200 docs: filesystems: convert dnotify.txt to ReST - Add a SPDX header; - Add a document title; - Some whitespace fixes and new line breaks; - Add table markups; - Add it to filesystems/index.rst Signed-off-by: Mauro Carvalho Chehab Acked-by: Jan Kara Link: https://lore.kernel.org/r/b39d6430d1c28438e833f01cb4597eff78703c75.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 01478b833176761e188a465fc7a22bd4e07d040e Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:02 2020 +0200 docs: filesystems: convert devpts.txt to ReST - Add a SPDX header; - Add a document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/4ac8f3a7edd4d817acf0d173ead7ef74fe010c6c.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit f476c6ed17d49553d40467514b4cb2dd2648e30f Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:01 2020 +0200 docs: filesystems: convert coda.txt to ReST This document has its own style. It seems to be print output for the old matrixial printers where backspace were used to do double prints. For the conversion, I used several regex expressions to get rid of some weird stuff. The patch also does almost all possible conversions in order to get a nice output document, while keeping it readable/editable as is: - Add a SPDX header; - Add a document title; - Adjust document title; - Adjust section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Adjust list markups; - Mark some unumbered titles with bold font; - Use footnoote markups; - Add table markups; - Use notes markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/25c06c40c3d7b947a131c3be124ce0e93cc00ae3.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 41defb4d0d587ef3fb9b90f3c320b6c41ef68f16 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:17:00 2020 +0200 docs: filesystems: convert automount-support.txt to ReST - Add a SPDX header; - Add a document title; - Adjust section titles; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ba7e2f2bf9aa2c7096772f5e7e8e609cb5fce07c.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 175cc46f4d667a9073270a32f40212d871c18955 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:59 2020 +0200 docs: filesystems: convert cifs/cifsroot.txt to ReST - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/28de01ee52283287e4195cf736d7154f122d30d4.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 0e822145b564204cd5e9dd67a7fd37d4a7b8253b Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:58 2020 +0200 docs: filesystems: caching/backend-api.txt: convert it to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add table markups; - Add it to filesystems/caching/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5d0a61abaa87bfe913b9e2f321e74ef7af0f3dfc.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit d74802ade7de6b6771ac87f7104f8b587bba37fa Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:57 2020 +0200 docs: filesystems: caching/cachefiles.txt: convert to ReST - Add a SPDX header; - Adjust document title; - Mark literal blocks as such; - Add table markups; - Comment out text ToC for html/pdf output; - Add lists markups; - Add it to filesystems/caching/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/eec0cfc268e8dca348f760224685100c9c2caba6.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 09eac7c53570038d1069d711001b478f285c30cf Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:56 2020 +0200 docs: filesystems: caching/operations.txt: convert it to ReST - Add a SPDX header; - Adjust document and section titles; - Comment out text ToC for html/pdf output; - Mark literal blocks as such; - Add it to filesystems/caching/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/97e71cc598a4f61df484ebda3ec06b63530ceb62.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit efc930fa1d844869eb65586f8cdd6a7837db3607 Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:55 2020 +0200 docs: filesystems: caching/netfs-api.txt: convert it to ReST - Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/caching/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/cfe4cb1bf8e1f0093d44c30801ec42e74721e543.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit fd299b2a7339ad0b8e2050189e20619cd817ba7e Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:54 2020 +0200 docs: filesystems: convert caching/fscache.txt to ReST format - Add a SPDX header; - Adjust document and section titles; - Comment out text ToC for html/pdf output; - Some whitespace fixes and new line breaks; - Add table markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e33ec382a53cf10ffcbd802f6de3f384159cddba.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 67145c23e70b066443a3c0736e74aa2342a013fd Author: Mauro Carvalho Chehab Date: Mon Apr 27 23:16:53 2020 +0200 docs: filesystems: convert caching/object.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Comment out text ToC for html/pdf output; - Some whitespace fixes and new line breaks; - Adjust the events list to make them look better for html output; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/49026a8ea7e714c2e0f003aa26b975b1025476b7.1588021877.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit d251c653aa3f07a3947cd716052a92d705d4ded5 Author: Neil Armstrong Date: Tue Apr 28 14:50:36 2020 +0200 media: MAINTAINERS: update the Amlogic VDEC driver maintainer entry Add myself as co-maintainer of the Amlogic VDEC driver, and add the missing vdec DT yaml bindings. Signed-off-by: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6507ef10660efdfee93f0f3b9fac24b5e4d83e56 Author: Julian Sax Date: Tue May 5 17:10:42 2020 +0200 HID: i2c-hid: add Schneider SCL142ALM to descriptor override This device uses the SIPODEV SP1064 touchpad, which does not supply descriptors, so it has to be added to the override list. Cc: stable@vger.kernel.org Signed-off-by: Julian Sax Signed-off-by: Jiri Kosina commit f84fdf99e9e2d1af699f7518b87c87d8e9f435c6 Author: Maxime Jourdan Date: Tue Apr 28 14:50:34 2020 +0200 media: meson: vdec: enable mcrcc for VP9 The motion compensation reference cache controller allows caching parts of reference frames for faster decoding. Fixes: 00c43088aa68 ("media: meson: vdec: add VP9 decoder support") Signed-off-by: Maxime Jourdan Signed-off-by: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ab8ad279ceac4fc78ae4dcf1a26326e05695e537 Author: Daniel Thompson Date: Mon May 4 18:05:18 2020 +0100 arm64: cacheflush: Fix KGDB trap detection flush_icache_range() contains a bodge to avoid issuing IPIs when the kgdb trap handler is running because issuing IPIs is unsafe (and not needed) in this execution context. However the current test, based on kgdb_connected is flawed: it both over-matches and under-matches. The over match occurs because kgdb_connected is set when gdb attaches to the stub and remains set during normal running. This is relatively harmelss because in almost all cases irq_disabled() will be false. The under match is more serious. When kdb is used instead of kgdb to access the debugger then kgdb_connected is not set in all the places that the debug core updates sw breakpoints (and hence flushes the icache). This can lead to deadlock. Fix by replacing the ad-hoc check with the proper kgdb macro. This also allows us to drop the #ifdef wrapper. Fixes: 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings") Signed-off-by: Daniel Thompson Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20200504170518.2959478-1-daniel.thompson@linaro.org Signed-off-by: Will Deacon commit 149d65e549f32710cfe22b5640f3010e8e68a837 Author: Zou Wei Date: Tue Apr 28 14:08:09 2020 +0200 media: cx231xx: Remove unneeded semicolon Fixes coccicheck warnings: drivers/media/usb/cx231xx/cx231xx-avcore.c:610:3-4: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0d7f7d2d31919a9c557acb2b4511770e6956c9ee Author: Koji Matsuoka Date: Fri Apr 24 12:39:45 2020 +0200 media: rcar-csi2: Fix comment of VCDT/VCDT2 register According to latest H/W manual v1.50, the description of channel number in the VCDT/VCDT2 register is decremented by one. Therefore, this patch fixes it about comment. Signed-off-by: Koji Matsuoka Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 54ac3fc348719d57d87b3bcd0977d75668c0c5d1 Author: Steve Longerbeam Date: Tue Apr 21 18:29:40 2020 +0200 media: imx: utils: Default colorspace to SRGB The function imx_media_init_mbus_fmt() initializes the imx subdevice mbus colorimetry to some sane defaults when the subdevice is registered. Currently it guesses at a colorspace based on the passed mbus pixel format. If the format is RGB, it chooses colorspace V4L2_COLORSPACE_SRGB, and if the format is YUV, it chooses V4L2_COLORSPACE_SMPTE170M. While that might be a good guess, it's not necessarily true that a RGB pixel format encoding uses a SRGB colorspace, or that a YUV encoding uses a SMPTE170M colorspace. Instead of making this dubious guess, just default the colorspace to SRGB. Reported-by: Hans Verkuil Signed-off-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e01bc6cbb1fc262e7fccceb5f8fd5ee8e6418f66 Author: Johan Jonker Date: Tue Apr 21 17:51:31 2020 +0200 media: dt-bindings: media: rockchip-vpu: fix interrupt-names A test with the command below gives for example this error: arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000: interrupts: [[0, 9, 4]] is too short arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000: interrupt-names: ['vdpu'] is too short arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000: interrupt-names:0: 'vepu' was expected With the conversion of rockchip-vpu.txt to yaml the correct 'interrupt-names' for rk3328 was not included, so add them now. Also add 'minItems' to 'interrupts'for the completeness. make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-vpu.yaml Signed-off-by: Johan Jonker Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bcf10abe8c40a23666a46ef413f0c49464769bad Author: Dafna Hirschfeld Date: Sun Apr 12 14:05:04 2020 +0200 media: staging: rkisp1: cap: enable RGB capture format with YUV media bus In selfpath, RGB capture formats are received in the sink pad as YUV and are converted to RGB only when writing to memory. So the validation function should accept YUV bus formats with RGB capture encoding. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0b64a837817ec562ed7079964236890e29cbc666 Author: Dafna Hirschfeld Date: Sun Apr 12 14:05:03 2020 +0200 media: staging: rkisp1: rsz: change (hv)div only if capture format is YUV RGB formats in selfpath should receive input format as YUV422. The resizer input format is always YUV422 and therefore if the capture format is RGB, the resizer should not change the YUV rations. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 21e4cdcb62ae60b9dc23917e9d65b7283fbc8bc7 Author: Dafna Hirschfeld Date: Sun Apr 12 14:05:02 2020 +0200 media: staging: rkisp1: rsz: remove redundant if statement and add inline doc The statement "if (rsz->fmt_type == V4L2_PIXEL_ENC_YUV)" can be removed since the value of rsz->fmt_type is either V4L2_PIXEL_ENC_YUV or V4L2_PIXEL_ENC_BAYER and the function returns if it is bayer. In addition some doc with clarification is added. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e9ebce2d4c8b59c30ddc453770899aff9d3c58d0 Author: Dafna Hirschfeld Date: Sun Apr 12 14:05:01 2020 +0200 media: staging: rkisp1: rsz: get the capture format info from the capture struct Currently the format info of the capture is retrieved by calling the function v4l2_format_info. This is not needed since it is already saved in the capture object. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c78c31b374a68be79cb4a03ef5b6c187f034e903 Author: Saravana Kannan Date: Tue Apr 28 12:20:05 2020 -0700 Revert "Revert "driver core: Set fw_devlink to "permissive" behavior by default"" This reverts commit 18555cb6db2373b9a5ec1f7572773fd58c77f9ba. The reason[1] for the original revert has now been fixed by commit 00b247557858 ("driver core: Fix handling of fw_devlink=permissive"). So, this patch reverts the revert. Marek has also tested this patch with the fix mentioned above and confirmed that the issue has been fixed. [1] - https://lore.kernel.org/lkml/CAGETcx8nbz-J1gLvoEKE_HgCcVGyV2o8rZeq_USFKM6=s7WmNg@mail.gmail.com/T/#m12dfb5dfd23805b84c49f4bb2238a8cce436c2f7 [2] - https://lore.kernel.org/lkml/CAGETcx8nbz-J1gLvoEKE_HgCcVGyV2o8rZeq_USFKM6=s7WmNg@mail.gmail.com/T/#m2408a6ce098b2ebf583ca8534329695923ae57fe Tested-by: Marek Szyprowski Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20200428192006.109006-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 388bcc6ecc609fca1b4920de7dc3806c98ec535e Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 8 14:40:03 2020 -0700 drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish If platform bus driver registration is failed then, accessing platform bus spin lock (&drv->driver.bus->p->klist_drivers.k_lock) in __platform_driver_probe() without verifying the return value __platform_driver_register() can lead to NULL pointer exception. So check the return value before attempting the spin lock. One such example is below: For a custom usecase, I have intentionally failed the platform bus registration and I expected all the platform device/driver registrations to fail gracefully. But I came across this panic issue. [ 1.331067] BUG: kernel NULL pointer dereference, address: 00000000000000c8 [ 1.331118] #PF: supervisor write access in kernel mode [ 1.331163] #PF: error_code(0x0002) - not-present page [ 1.331208] PGD 0 P4D 0 [ 1.331233] Oops: 0002 [#1] PREEMPT SMP [ 1.331268] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G W 5.6.0-00049-g670d35fb0144 #165 [ 1.331341] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 [ 1.331406] RIP: 0010:_raw_spin_lock+0x15/0x30 [ 1.331588] RSP: 0000:ffffc9000001be70 EFLAGS: 00010246 [ 1.331632] RAX: 0000000000000000 RBX: 00000000000000c8 RCX: 0000000000000001 [ 1.331696] RDX: 0000000000000001 RSI: 0000000000000092 RDI: 0000000000000000 [ 1.331754] RBP: 00000000ffffffed R08: 0000000000000501 R09: 0000000000000001 [ 1.331817] R10: ffff88817abcc520 R11: 0000000000000670 R12: 00000000ffffffed [ 1.331881] R13: ffffffff82dbc268 R14: ffffffff832f070a R15: 0000000000000000 [ 1.331945] FS: 0000000000000000(0000) GS:ffff88817bd80000(0000) knlGS:0000000000000000 [ 1.332008] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.332062] CR2: 00000000000000c8 CR3: 000000000681e001 CR4: 00000000003606e0 [ 1.332126] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1.332189] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1.332252] Call Trace: [ 1.332281] __platform_driver_probe+0x92/0xee [ 1.332323] ? rtc_dev_init+0x2b/0x2b [ 1.332358] cmos_init+0x37/0x67 [ 1.332396] do_one_initcall+0x7d/0x168 [ 1.332428] kernel_init_freeable+0x16c/0x1c9 [ 1.332473] ? rest_init+0xc0/0xc0 [ 1.332508] kernel_init+0x5/0x100 [ 1.332543] ret_from_fork+0x1f/0x30 [ 1.332579] CR2: 00000000000000c8 [ 1.332616] ---[ end trace 3bd87f12e9010b87 ]--- [ 1.333549] note: swapper/0[1] exited with preempt_count 1 [ 1.333592] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.333736] Kernel Offset: disabled Note, this can only be triggered if a driver errors out from this call, which should never happen. If it does, the driver needs to be fixed. Signed-off-by: Kuppuswamy Sathyanarayanan Link: https://lore.kernel.org/r/20200408214003.3356-1-sathyanarayanan.kuppuswamy@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 73371d5f313aa056a451f84b652623da6054f89b Author: Codrin Ciubotariu Date: Tue Feb 25 17:50:09 2020 +0200 i2c: at91: Send bus clear command if SDA is down After a transfer timeout, some faulty I2C slave devices might hold down the SDA pin. We can generate a bus clear command, hoping that the slave might release the pins. If the CLEAR command is not supported, we will use gpio recovery, if available, to reset the bus. Signed-off-by: Codrin Ciubotariu Acked-by: Ludovic Desroches Signed-off-by: Wolfram Sang commit 8508f4cba308f785b2fd4b8c38849c117b407297 Author: John Stultz Date: Tue Apr 28 18:40:50 2020 +0000 serial: amba-pl011: Make sure we initialize the port.lock spinlock Valentine reported seeing: [ 3.626638] INFO: trying to register non-static key. [ 3.626639] the code is fine but needs lockdep annotation. [ 3.626640] turning off the locking correctness validator. [ 3.626644] CPU: 7 PID: 51 Comm: kworker/7:1 Not tainted 5.7.0-rc2-00115-g8c2e9790f196 #116 [ 3.626646] Hardware name: HiKey960 (DT) [ 3.626656] Workqueue: events deferred_probe_work_func [ 3.632476] sd 0:0:0:0: [sda] Optimal transfer size 8192 bytes not a multiple of physical block size (16384 bytes) [ 3.640220] Call trace: [ 3.640225] dump_backtrace+0x0/0x1b8 [ 3.640227] show_stack+0x20/0x30 [ 3.640230] dump_stack+0xec/0x158 [ 3.640234] register_lock_class+0x598/0x5c0 [ 3.640235] __lock_acquire+0x80/0x16c0 [ 3.640236] lock_acquire+0xf4/0x4a0 [ 3.640241] _raw_spin_lock_irqsave+0x70/0xa8 [ 3.640245] uart_add_one_port+0x388/0x4b8 [ 3.640248] pl011_register_port+0x70/0xf0 [ 3.640250] pl011_probe+0x184/0x1b8 [ 3.640254] amba_probe+0xdc/0x180 [ 3.640256] really_probe+0xe0/0x338 [ 3.640257] driver_probe_device+0x60/0xf8 [ 3.640259] __device_attach_driver+0x8c/0xd0 [ 3.640260] bus_for_each_drv+0x84/0xd8 [ 3.640261] __device_attach+0xe4/0x140 [ 3.640263] device_initial_probe+0x1c/0x28 [ 3.640265] bus_probe_device+0xa4/0xb0 [ 3.640266] deferred_probe_work_func+0x7c/0xb8 [ 3.640269] process_one_work+0x2c0/0x768 [ 3.640271] worker_thread+0x4c/0x498 [ 3.640272] kthread+0x14c/0x158 [ 3.640275] ret_from_fork+0x10/0x1c Which seems to be due to the fact that after allocating the uap structure, nothing initializes the spinlock. Its a little confusing, as uart_port_spin_lock_init() is one place where the lock is supposed to be initialized, but it has an exception for the case where the port is a console. This makes it seem like a deeper fix is needed to properly register the console, but I'm not sure what that entails, and Andy suggested that this approach is less invasive. Thus, this patch resolves the issue by initializing the spinlock in the driver, and resolves the resulting warning. Cc: Andy Shevchenko Cc: Russell King Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Reported-by: Valentin Schneider Reviewed-by: Andy Shevchenko Signed-off-by: John Stultz Reviewed-and-tested-by: Valentin Schneider Link: https://lore.kernel.org/r/20200428184050.6501-1-john.stultz@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3d9231e69831551da3a78a618b31702ea4dedd5e Author: Rajendra Nayak Date: Sun May 3 17:34:24 2020 +0530 tty: serial: qcom_geni_serial: Use OPP API to set clk/perf state geni serial needs to express a perforamnce state requirement on CX powerdomain depending on the frequency of the clock rates. Use OPP table from DT to register with OPP framework and use dev_pm_opp_set_rate() to set the clk/perf state. Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Cc: Greg Kroah-Hartman Cc: Akash Asthana Cc: linux-serial@vger.kernel.org Link: https://lore.kernel.org/r/1588507469-31889-2-git-send-email-rnayak@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit c2880ec6c0862e11673742ab512c262b5e97a34c Author: Rahul Tanwar Date: Mon May 4 16:03:52 2020 +0800 serial: lantiq: Add x86 in Kconfig dependencies for Lantiq serial driver Lantiq serial driver/IP is reused for a x86 based SoC as well. Update the Kconfig accordingly. Signed-off-by: Rahul Tanwar Link: https://lore.kernel.org/r/96fd193c0a8939d27641ff93573545c02313048f.1588577002.git.rahul.tanwar@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e5159827e057487359fc76f496a16ddbb8536cc9 Merge: 80e4e5613215 50479d58eaa3 47d67e4d1918 Author: Will Deacon Date: Tue May 5 15:19:09 2020 +0100 Merge branches 'for-next/asm' and 'for-next/insn' into for-next/bti Merge in dependencies for in-kernel Branch Target Identification support. * for-next/asm: arm64: Disable old style assembly annotations arm64: kernel: Convert to modern annotations for assembly functions arm64: entry: Refactor and modernise annotation for ret_to_user x86/asm: Provide a Kconfig symbol for disabling old assembly annotations x86/32: Remove CONFIG_DOUBLEFAULT * for-next/insn: arm64: insn: Report PAC and BTI instructions as skippable arm64: insn: Don't assume unrecognized HINTs are skippable arm64: insn: Provide a better name for aarch64_insn_is_nop() arm64: insn: Add constants for new HINT instruction decode commit 80e4e561321595d2e5f4a173e8cf8d8432078995 Merge: 6a8b55ed4056 5d1b631c773f Author: Will Deacon Date: Tue May 5 15:15:58 2020 +0100 Merge branch 'for-next/bti-user' into for-next/bti Merge in user support for Branch Target Identification, which narrowly missed the cut for 5.7 after a late ABI concern. * for-next/bti-user: arm64: bti: Document behaviour for dynamically linked binaries arm64: elf: Fix allnoconfig kernel build with !ARCH_USE_GNU_PROPERTY arm64: BTI: Add Kconfig entry for userspace BTI mm: smaps: Report arm64 guarded pages in smaps arm64: mm: Display guarded pages in ptdump KVM: arm64: BTI: Reset BTYPE when skipping emulated instructions arm64: BTI: Reset BTYPE when skipping emulated instructions arm64: traps: Shuffle code to eliminate forward declarations arm64: unify native/compat instruction skipping arm64: BTI: Decode BYTPE bits when printing PSTATE arm64: elf: Enable BTI at exec based on ELF program properties elf: Allow arch to tweak initial mmap prot flags arm64: Basic Branch Target Identification support ELF: Add ELF program property parsing support ELF: UAPI and Kconfig additions for ELF program properties commit c48e0c533e72ca264ac914addccab8a328806ed3 Author: Wan Ahmad Zainie Date: Tue May 5 21:06:17 2020 +0800 spi: dw-apb-ssi: Add Intel Keem Bay support Document Intel Keem Bay SPI controller DT bindings. Signed-off-by: Wan Ahmad Zainie Link: https://lore.kernel.org/r/20200505130618.554-7-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Mark Brown commit 3812a081d2fcc297d039c4ffafa7778d75abcbe2 Author: Wan Ahmad Zainie Date: Tue May 5 21:06:15 2020 +0800 spi: dw-apb-ssi: Add compatible string for DesignWare DWC_ssi This patch adds compatible string "snps,dwc-ssi-1.01a" to the above DT binding document, to provide support for DesignWare DWC_ssi IP [1]. Current driver supports DW_apb_ssi IP [2]. References: [1] https://www.synopsys.com/dw/ipdir.php?c=dwc_ssi [2] https://www.synopsys.com/dw/ipdir.php?c=DW_apb_ssi Signed-off-by: Wan Ahmad Zainie Link: https://lore.kernel.org/r/20200505130618.554-5-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Mark Brown commit f42377916ed534649341777669628f22ef1edf59 Author: Wan Ahmad Zainie Date: Tue May 5 21:06:16 2020 +0800 spi: dw: Add support for Intel Keem Bay SPI Add support for Intel Keem Bay SPI controller, which uses DesignWare DWC_ssi core. Bit 31 of CTRLR0 register is added for Keem Bay, to configure the device as a master or as a slave serial peripheral. Signed-off-by: Wan Ahmad Zainie Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200505130618.554-6-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Mark Brown commit e539f435cb9c78c6984b75f16b65a2ece7867981 Author: Wan Ahmad Zainie Date: Tue May 5 21:06:14 2020 +0800 spi: dw: Add support for DesignWare DWC_ssi This patch adds initial support for DesignWare DWC_ssi soft IP. DWC_ssi is the enhanced version of DW_apb_ssi, which is currently supported by this driver. Their registers are same, but the bit fields of register CTRLR0 are different. DWC_ssi has additional features compared to DW_apb_ssi. Major enhancements in DWC_ssi are hyper bus protocol, boot mode support and advanced XIP support. DWC_ssi is an AHB slave device, whilst DW_apb_ssi is an APB slave device. Register offset DW_ssi DW_apb_ssi CTRLR0 0x00 0x00 CTRLR1 0x04 0x04 SSIENR 0x08 0x08 MWCR 0x0c 0x0c SER 0x10 0x10 BAUDR 0x14 0x14 TXFTLR 0x18 0x18 RXFTLR 0x1c 0x1c TXFLR 0x20 0x20 RXFLR 0x24 0x24 SR 0x28 0x28 IMR 0x2c 0x2c ISR 0x30 0x30 RISR 0x34 0x34 TXOICR 0x38 0x38 RXOICR 0x3c 0x3c RXUICR 0x40 0x40 MSTICR 0x44 0x44 ICR 0x48 0x48 DMACR 0x4c 0x4c DMATDLR 0x50 0x50 DMARDLR 0x54 0x54 IDR 0x58 0x58 SSI_VERSION_ID 0x5c 0x5c DRx (0 to 35) 0x60+i*0x4 0x60+i*0x4 RX_SAMPLE_DLY 0xf0 0xf0 SPI_CTRLR0 0xf4 0xf4 TXD_DRIVE_EDGE 0xf8 0xf8 XIP_MODE_BITS 0xfc RSVD Register configuration - CTRLR0 DW_ssi DW_apb_ssi SPI_HYPERBUS_EN bit[24] NONE SPI_FRF bit[23:22] bit[22:21] DFS_32 NONE bit[20:16] CFS bit[19:16] bit[15:12] SSTE bit[14] bit[24] SRL bit[13] bit[11] SLV_OE bit[12] bit[10] TMOD bit[11:10] bit[9:8] SCPOL | SPHA bit[9:8] bit[7:6] FRF bit[7:6] bit[5:4] DFS bit[4:0] bit[3:0] The documents used are [1] DW_apb_ssi_databook.pdf version 4.01a (2016.10a). [2] DWC_ssi_databook.pdf version 1.01a. Signed-off-by: Wan Ahmad Zainie Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200505130618.554-4-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Mark Brown commit c4eadee21fa9afd3dc9dd867c71b642177bf671f Author: Wan Ahmad Zainie Date: Tue May 5 21:06:13 2020 +0800 spi: dw: Add update_cr0() callback to update CTRLR0 This patch adds update_cr0() callback, in struct dw_spi. Existing code that configure register CTRLR0 is moved into a new function, dw_spi_update_cr0(), and this will be the default. Suggested-by: Andy Shevchenko Signed-off-by: Wan Ahmad Zainie Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200505130618.554-3-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Mark Brown commit 299cb65c9dd4791242a102f216583773d962c1ac Author: Wan Ahmad Zainie Date: Tue May 5 21:06:12 2020 +0800 spi: dw: Fix typo in few registers name This patch will fix typo in the register name used in the source code, to be consistent with the register name used in the databook. Databook: DW_apb_ssi_databook.pdf version 4.01a Signed-off-by: Wan Ahmad Zainie Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200505130618.554-2-wan.ahmad.zainie.wan.mohamad@intel.com Signed-off-by: Mark Brown commit eeb2d87ece1219cff33e5107c2a6d57803354d15 Author: Will Deacon Date: Tue May 5 13:08:02 2020 +0100 arm64: cpufeature: Group indexed system register definitions by name Some system registers contain an index in the name (e.g. ID_MMFR_EL1) and, while this index often follows the register encoding, newer additions to the architecture are necessarily tacked on the end. Sorting these registers by encoding therefore becomes a bit of a mess. Group the indexed system register definitions by name so that it's easier to read and will hopefully reduce the chance of us accidentally introducing duplicate definitions in the future. Acked-by: Mark Rutland Signed-off-by: Will Deacon commit e896be5ad1017aa710f8b979036a43d3e5b2f38d Author: Russell King Date: Mon Apr 27 19:49:32 2020 +0100 i2c: pxa: fix i2c_pxa_wait_bus_not_busy() boundary condition Fix i2c_pxa_wait_bus_not_busy()'s boundary conditions, so that a coincidental success and timeout results in the function returning success. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit bb82ba690757fb483b5848d3e2f577a102e8a9c8 Author: Russell King Date: Mon Apr 27 19:49:27 2020 +0100 i2c: pxa: clean up decode_bits() Clean up decode_bits() to use pr_cont(), and move the newline into the function rather than at its two callsites. Avoid printing an unnecessary space before the newline. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 88b73ee7ca4c90baf136ed5a8377fc5a9b73ac08 Author: Russell King Date: Mon Apr 27 19:49:22 2020 +0100 i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output The IRQ log output is supposed to appear on a single line. However, commit 3a2dc1677b60 ("i2c: pxa: Update debug function to dump more info on error") resulted in it being printed one-entry-per-line, which is excessively long. Fixing this is not a trivial matter; using pr_cont() doesn't work as the previous dev_dbg() may not have been compiled in, or may be dynamic. Since the rest of this function output is at error level, and is also debug output, promote this to error level as well to avoid this problem. Reduce the number of always zero prefix digits to save screen real- estate. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 70aee287cf4535d19ea3983b2af3414119963253 Author: Russell King Date: Mon Apr 27 19:49:17 2020 +0100 i2c: pxa: move DT IDs along side platform IDs Move the ID tables into one place, near the device dependent data. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 79622f372b8679916bf4e38aabc6df2659d1e109 Author: Russell King Date: Mon Apr 27 19:49:12 2020 +0100 i2c: pxa: move private definitions to i2c-pxa.c Move driver-private definitions out of the i2c-pxa.h platform data header file into the driver itself. Nothing outside of the driver makes use of these constants. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit ee478936ddb779c1081b6683734da42cebbd5df1 Author: Russell King Date: Mon Apr 27 19:49:07 2020 +0100 i2c: pxa: always set fm and hs members for each type Always set the fm and hs members of struct pxa_reg_layout. These members are already taking space, we don't need code as well. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit f8e5d3cb31cbebce6955dda462710b4c6f6d1c5a Author: Russell King Date: Mon Apr 27 19:49:01 2020 +0100 i2c: pxa: add and use definitions for IBMR register Add definitions for the bits in the IBMR register, and use them in the code. This improves readability. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit e37687c98ab9ee5872e672b81c44932cf5356d58 Author: Jacko Dirks Date: Sun May 3 22:00:33 2020 +0200 spi: bcm2835: Fixes bare use of unsigned Signed-off-by: Jacko Dirks Link: https://lore.kernel.org/r/20200503200033.GA3256@vasteMachine Signed-off-by: Mark Brown commit 940695aa36f18f8cd5fc703db601b4cd2662a055 Author: Russell King Date: Mon Apr 27 19:48:56 2020 +0100 i2c: pxa: re-arrange register field definitions Arrange the register field definitions to be grouped together, rather than the Armada-3700 definitions being separated from the rest of the definitions. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 1ae49a15eea0b7c7ca26aa112abc7ec878d69d70 Author: Russell King Date: Mon Apr 27 19:48:51 2020 +0100 i2c: pxa: re-arrange functions to flow better Re-arrange the PXA I2C code to avoid forward declarations, and keep similar functionality (e.g. the non-IRQ mode support) together. This improves code readability. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 8de32da283e39d07ea4cea09a9b89447cacc3b4c Author: Russell King Date: Mon Apr 27 19:48:46 2020 +0100 i2c: pxa: re-arrange includes to be in alphabetical order Arrange the includes to be in alphabetical order to help avoid duplicated includes. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit fa8d74a9c548aca75f3497df99fe9c09f4f16870 Author: Russell King Date: Mon Apr 27 19:48:41 2020 +0100 i2c: pxa: remove unneeded includes i2c-pxa does not need linux/sched.h nor linux/time.h includes, so remove these. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 868d4d37a2c64e2b44b05c89500b2b39421d3adb Author: Russell King Date: Mon Apr 27 19:48:36 2020 +0100 i2c: pxa: use official address byte helper i2c-pxa was created before i2c_8bit_addr_from_msg() was implemented, and used its own i2c_pxa_addr_byte() which is functionally the same. Sadly, it was never updated to use this new helper. Switch it over. Signed-off-by: Russell King Signed-off-by: Wolfram Sang commit 1b032ec1ecbce6047af7d11c9db432e237cb17d8 Author: Joerg Roedel Date: Wed Apr 29 15:37:12 2020 +0200 iommu: Unexport iommu_group_get_for_dev() The function is now only used in IOMMU core code and shouldn't be used outside of it anyway, so remove the export for it. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-35-joro@8bytes.org Signed-off-by: Joerg Roedel commit 4e8906f0d84d1a7d3cf82a30a701b0fb5d48977c Author: Joerg Roedel Date: Wed Apr 29 15:37:11 2020 +0200 iommu: Move more initialization to __iommu_probe_device() Move the calls to dev_iommu_get() and try_module_get() into __iommu_probe_device(), so that the callers don't have to do it on their own. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-34-joro@8bytes.org Signed-off-by: Joerg Roedel commit 3eeeb45c6d0444b368cdeba9bdafa8bbcf5370d1 Author: Joerg Roedel Date: Wed Apr 29 15:37:10 2020 +0200 iommu: Remove add_device()/remove_device() code-paths All drivers are converted to use the probe/release_device() call-backs, so the add_device/remove_device() pointers are unused and the code using them can be removed. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-33-joro@8bytes.org Signed-off-by: Joerg Roedel commit 3c51c05479c577ea4235d46366d6181a2d6aff2d Author: Joerg Roedel Date: Wed Apr 29 15:37:09 2020 +0200 iommu/exynos: Convert to probe/release_device() call-backs Convert the Exynos IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-32-joro@8bytes.org Signed-off-by: Joerg Roedel commit 66ae88e71ecb93bafaacaeef233971eacd10e749 Author: Joerg Roedel Date: Wed Apr 29 15:37:08 2020 +0200 iommu/exynos: Use first SYSMMU in controllers list for IOMMU core On Exynos platforms there can be more than one SYSMMU (IOMMU) for one DMA master device. Since the IOMMU core code expects only one hardware IOMMU, use the first SYSMMU in the list. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-31-joro@8bytes.org Signed-off-by: Joerg Roedel commit 6785eb9105e3363aa51408c700a55e8b5f88fcf6 Author: Joerg Roedel Date: Wed Apr 29 15:37:07 2020 +0200 iommu/omap: Convert to probe/release_device() call-backs Convert the OMAP IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-30-joro@8bytes.org Signed-off-by: Joerg Roedel commit c822b37cac48ea0e4c8202a42fdc480ace099b12 Author: Joerg Roedel Date: Wed Apr 29 15:37:06 2020 +0200 iommu/omap: Remove orphan_dev tracking Remove the tracking of device which could not be probed because their IOMMU is not probed yet. Replace it with a call to bus_iommu_probe() when a new IOMMU is probed. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-29-joro@8bytes.org Signed-off-by: Joerg Roedel commit 6580c8a78424fb1a0d2bd9134355563c0398fe8e Author: Joerg Roedel Date: Wed Apr 29 15:37:05 2020 +0200 iommu/renesas: Convert to probe/release_device() call-backs Convert the Renesas IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-28-joro@8bytes.org Signed-off-by: Joerg Roedel commit b287ba73789906fc4f4ee821e1014b13e2814849 Author: Joerg Roedel Date: Wed Apr 29 15:37:04 2020 +0200 iommu/tegra: Convert to probe/release_device() call-backs Convert the Tegra IOMMU drivers to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-27-joro@8bytes.org Signed-off-by: Joerg Roedel commit d8260443245dc8e504c3ecde5e86972f5be2b43e Author: Joerg Roedel Date: Wed Apr 29 15:37:03 2020 +0200 iommu/rockchip: Convert to probe/release_device() call-backs Convert the Rockchip IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-26-joro@8bytes.org Signed-off-by: Joerg Roedel commit bfe3bd493b3d3f9a08d1751338ccc711840e4590 Author: Joerg Roedel Date: Wed Apr 29 15:37:02 2020 +0200 iommu/qcom: Convert to probe/release_device() call-backs Convert the QCOM IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-25-joro@8bytes.org Signed-off-by: Joerg Roedel commit 57dbf81f50c82a0ad895a57828ad1ab539785a25 Author: Joerg Roedel Date: Wed Apr 29 15:37:01 2020 +0200 iommu/mediatek-v1 Convert to probe/release_device() call-backs Convert the Mediatek-v1 IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-24-joro@8bytes.org Signed-off-by: Joerg Roedel commit 80e4592a77e4baa33035eaeac646f63f1f5d3d57 Author: Joerg Roedel Date: Wed Apr 29 15:37:00 2020 +0200 iommu/mediatek: Convert to probe/release_device() call-backs Convert the Mediatek IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-23-joro@8bytes.org Signed-off-by: Joerg Roedel commit dea74f1c37fb6d9a8f7e0cb85beaa89f5eaea908 Author: Joerg Roedel Date: Wed Apr 29 15:36:59 2020 +0200 iommu/msm: Convert to probe/release_device() call-backs Convert the MSM IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-22-joro@8bytes.org Signed-off-by: Joerg Roedel commit 21acf6599cfb4407e9745b36f69c93cf99a3d189 Author: Joerg Roedel Date: Wed Apr 29 15:36:58 2020 +0200 iommu/virtio: Convert to probe/release_device() call-backs Convert the VirtIO IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-21-joro@8bytes.org Signed-off-by: Joerg Roedel commit 522af649e57b3e3a347a8261f609f73ab4143f20 Author: Joerg Roedel Date: Wed Apr 29 15:36:57 2020 +0200 iommu/s390: Convert to probe/release_device() call-backs Convert the S390 IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-20-joro@8bytes.org Signed-off-by: Joerg Roedel commit 52dd3ca4176f7f87452ee4b9d9a6d2e57ac4ccb7 Author: Joerg Roedel Date: Wed Apr 29 15:36:56 2020 +0200 iommu/pamu: Convert to probe/release_device() call-backs Convert the PAMU IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-19-joro@8bytes.org Signed-off-by: Joerg Roedel commit cefa0d55da3753e969764fb4b161052a1cb4ddfb Author: Joerg Roedel Date: Wed Apr 29 15:36:55 2020 +0200 iommu/arm-smmu: Convert to probe/release_device() call-backs Convert the arm-smmu and arm-smmu-v3 drivers to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-18-joro@8bytes.org Signed-off-by: Joerg Roedel commit e5d1841f18b2401c8b449c024817cd243e363934 Author: Joerg Roedel Date: Wed Apr 29 15:36:54 2020 +0200 iommu/vt-d: Convert to probe/release_device() call-backs Convert the Intel IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/20200429133712.31431-17-joro@8bytes.org Signed-off-by: Joerg Roedel commit dce8d6964ebdb333383bacf5e7ab8c27df151218 Author: Joerg Roedel Date: Wed Apr 29 15:36:53 2020 +0200 iommu/amd: Convert to probe/release_device() call-backs Convert the AMD IOMMU Driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-16-joro@8bytes.org Signed-off-by: Joerg Roedel commit 57f9842e48840684f596db1de936d7c6d44cd087 Author: Joerg Roedel Date: Wed Apr 29 15:36:52 2020 +0200 iommu/amd: Remove dev_data->passthrough Make use of generic IOMMU infrastructure to gather the same information carried in dev_data->passthrough and remove the struct member. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-15-joro@8bytes.org Signed-off-by: Joerg Roedel commit 5012c3968537e2ffecbdb2eba3479bf9fb9e5597 Author: Joerg Roedel Date: Wed Apr 29 15:36:51 2020 +0200 iommu: Export bus_iommu_probe() and make is safe for re-probing Add a check to the bus_iommu_probe() call-path to make sure it ignores devices which have already been successfully probed. Then export the bus_iommu_probe() function so it can be used by IOMMU drivers. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-14-joro@8bytes.org Signed-off-by: Joerg Roedel commit ce574c27ae275bc51b6437883fc9cd1c46b498e5 Author: Joerg Roedel Date: Wed Apr 29 15:36:50 2020 +0200 iommu: Move iommu_group_create_direct_mappings() out of iommu_group_add_device() After the previous changes the iommu group may not have a default domain when iommu_group_add_device() is called. With no default domain iommu_group_create_direct_mappings() will do nothing and no direct mappings will be created. Rename iommu_group_create_direct_mappings() to iommu_create_device_direct_mappings() to better reflect that the function creates direct mappings only for one device and not for all devices in the group. Then move the call to the places where a default domain actually exists. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-13-joro@8bytes.org Signed-off-by: Joerg Roedel commit deac0b3bed26bb5d04486696b1071d8ec3851100 Author: Joerg Roedel Date: Wed Apr 29 15:36:49 2020 +0200 iommu: Split off default domain allocation from group assignment When a bus is initialized with iommu-ops, all devices on the bus are scanned and iommu-groups are allocated for them, and each groups will also get a default domain allocated. Until now this happened as soon as the group was created and the first device added to it. When other devices with different default domain requirements were added to the group later on, the default domain was re-allocated, if possible. This resulted in some back and forth and unnecessary allocations, so change the flow to defer default domain allocation until all devices have been added to their respective IOMMU groups. The default domains are allocated for newly allocated groups after each device on the bus is handled and was probed by the IOMMU driver. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-12-joro@8bytes.org Signed-off-by: Joerg Roedel commit cf193888bfbd3d57e03a511e49d26f7d9c6f76df Author: Joerg Roedel Date: Wed Apr 29 15:36:48 2020 +0200 iommu: Move new probe_device path to separate function This makes it easier to remove to old code-path when all drivers are converted. As a side effect that it also fixes the error cleanup path. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-11-joro@8bytes.org Signed-off-by: Joerg Roedel commit 41df6dcc0a3ff4fb654c3d969ab96ba9c4f0e796 Author: Joerg Roedel Date: Wed Apr 29 15:36:47 2020 +0200 iommu: Keep a list of allocated groups in __iommu_probe_device() This is needed to defer default_domain allocation for new IOMMU groups until all devices have been added to the group. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-10-joro@8bytes.org Signed-off-by: Joerg Roedel commit 6e1aa2049154d7462968c968b20f985859308267 Author: Joerg Roedel Date: Wed Apr 29 15:36:46 2020 +0200 iommu: Move default domain allocation to iommu_probe_device() Well, not really. The call to iommu_alloc_default_domain() in iommu_group_get_for_dev() has to stay around as long as there are IOMMU drivers using the add/remove_device() call-backs instead of probe/release_device(). Those drivers expect that iommu_group_get_for_dev() returns the device attached to a group and the group set up with a default domain (and the device attached to the groups current domain). But when all drivers are converted this compatability mess can be removed. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-9-joro@8bytes.org Signed-off-by: Joerg Roedel commit a6a4c7e2c5b8b981d1c546a393ff21f2112468c3 Author: Joerg Roedel Date: Wed Apr 29 15:36:45 2020 +0200 iommu: Add probe_device() and release_device() call-backs Add call-backs to 'struct iommu_ops' as an alternative to the add_device() and remove_device() call-backs, which will be removed when all drivers are converted. The new call-backs will not setup IOMMU groups and domains anymore, so also add a probe_finalize() call-back where the IOMMU driver can do per-device setup work which require the device to be set up with a group and a domain. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-8-joro@8bytes.org Signed-off-by: Joerg Roedel commit 57bd2c24ba1673bd47828f6ac5eaaa6292a03582 Author: Joerg Roedel Date: Wed Apr 29 15:36:44 2020 +0200 iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU When check_device() fails on the device, it is not handled by the IOMMU and amd_iommu_add_device() needs to return -ENODEV. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-7-joro@8bytes.org Signed-off-by: Joerg Roedel commit c0da9b9f5afdb56ae2aaccf79f36a358ac8454c8 Author: Joerg Roedel Date: Wed Apr 29 15:36:43 2020 +0200 iommu/amd: Remove dma_mask check from check_device() The check was only needed for the DMA-API implementation in the AMD IOMMU driver, which no longer exists. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-6-joro@8bytes.org Signed-off-by: Joerg Roedel commit 7039d11b3e4af77cf5ac1f689ae395b2a183bd25 Author: Joerg Roedel Date: Wed Apr 29 15:36:42 2020 +0200 iommu/vt-d: Wire up iommu_ops->def_domain_type The Intel VT-d driver already has a matching function to determine the default domain type for a device. Wire it up in intel_iommu_ops. Signed-off-by: Joerg Roedel Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/20200429133712.31431-5-joro@8bytes.org Signed-off-by: Joerg Roedel commit bdf4a7c4c77dcb91bd64b53b70d9faf3184e88d8 Author: Joerg Roedel Date: Wed Apr 29 15:36:41 2020 +0200 iommu/amd: Implement iommu_ops->def_domain_type call-back Implement the new def_domain_type call-back for the AMD IOMMU driver. Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20200429133712.31431-4-joro@8bytes.org Signed-off-by: Joerg Roedel commit 4cbf38511a007867def958872203ae8adb8e2351 Author: Sai Praneeth Prakhya Date: Wed Apr 29 15:36:40 2020 +0200 iommu: Add def_domain_type() callback in iommu_ops Some devices are reqired to use a specific type (identity or dma) of default domain when they are used with a vendor iommu. When the system level default domain type is different from it, the vendor iommu driver has to request a new default domain with iommu_request_dma_domain_for_dev() and iommu_request_dm_for_dev() in the add_dev() callback. Unfortunately, these two helpers only work when the group hasn't been assigned to any other devices, hence, some vendor iommu driver has to use a private domain if it fails to request a new default one. This adds def_domain_type() callback in the iommu_ops, so that any special requirement of default domain for a device could be aware by the iommu generic layer. Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Lu Baolu [ jroedel@suse.de: Added iommu_get_def_domain_type() function and use it to allocate the default domain ] Co-developed-by: Joerg Roedel Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-3-joro@8bytes.org Signed-off-by: Joerg Roedel commit ff2a08b39bcede1b08d84d8b5c8ee1336a39c5df Author: Joerg Roedel Date: Wed Apr 29 15:36:39 2020 +0200 iommu: Move default domain allocation to separate function Move the code out of iommu_group_get_for_dev() into a separate function. Signed-off-by: Joerg Roedel Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200429133712.31431-2-joro@8bytes.org Signed-off-by: Joerg Roedel commit cbd7214402ecf7ecc59e21862ea3c901be48e831 Author: Boris Brezillon Date: Fri Apr 3 19:13:45 2020 -0300 arm64: dts: rockchip: Define the rockchip Video Decoder node on rk3399 RK3399 has a Video decoder, define the node in the dtsi. We also add the missing power-domain in mmu node and enable the block. Signed-off-by: Boris Brezillon Signed-off-by: Ezequiel Garcia Link: https://lore.kernel.org/r/20200403221345.16702-6-ezequiel@collabora.com Signed-off-by: Heiko Stuebner commit 4ff028f6c1087bcaf1ee970d4ef43730ed0aaa8c Author: Stephan Gerhold Date: Sat Apr 25 20:46:57 2020 +0200 ASoC: qcom: lpass-cpu: Make I2S SD lines configurable The LPASS hardware allows configuring the MI2S SD lines to use when playing/recording audio. However, at the moment the lpass-cpu driver has SD0 hard-coded for mono/stereo (or additional fixed SD lines for more channels). For weird reasons there seems to be hardware that uses one of the other SD lines for mono/stereo. For example, some Samsung devices use an external Speaker amplifier connected to Quaternary MI2S. For some reason, the SD line for audio playback was connected to SD1 rather than SD0. (I have no idea why...) At the moment, the lpass-cpu driver cannot be configured to work for the Speaker on these devices. The q6afe driver already allows configuring the MI2S SD lines through the "qcom,sd-lines" device tree property, but this works only when routing audio through the ADSP. This commit adds a very similar configuration for the lpass-cpu driver. It is now possible to add additional subnodes to the lpass device in the device tree, to configure the SD lines for playback and/or capture. E.g. for the Samsung devices mentioned above: &lpass { dai@3 { reg = ; qcom,playback-sd-lines = <1>; }; }; qcom,playback/capture-sd-lines takes a list of SD lines (0-3) in the same format as the q6afe driver. (The difference here is that q6afe has separate DAIs for playback/capture, while lpass-cpu has one for both...) For backwards compatibility with older device trees, the lpass-cpu driver defaults to LPAIF_I2SCTL_MODE_8CH if the subnode for a DAI is missing. This is equivalent to the previous behavior: Up to 8 channels can be configured, and SD0/QUAT01 will be chosen when setting up a stream with fewer channels. This allows the speaker to work on Samsung MSM8916 devices that use an external speaker amplifier. Signed-off-by: Stephan Gerhold Cc: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200425184657.121991-2-stephan@gerhold.net Signed-off-by: Mark Brown commit d5797ede0818b24252f79497e1c7e1245c328f6b Author: Stephan Gerhold Date: Sat Apr 25 20:46:56 2020 +0200 dt-bindings: sound: lpass-cpu: Document DAI subnodes The lpass-cpu driver now allows configuring the MI2S SD lines by defining subnodes for one of the DAIs. Document this in the device tree bindings. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200425184657.121991-1-stephan@gerhold.net Signed-off-by: Mark Brown commit b5a087139db2aa1f10d79d4b5486386e7493743c Author: Pascal Paillet Date: Thu Apr 30 15:02:35 2020 +0200 ARM: dts: stm32: Enable thermal sensor support on stm32mp15xx-dkx Enable STM32 Digital Thermal Sensor driver for stm32mp15xx-dkx boards. Signed-off-by: Pascal Paillet Signed-off-by: Alexandre Torgue commit 2f9306969a76e9e3d531705c53c5a7874928e811 Author: Yann Gautier Date: Thu Apr 30 12:16:49 2020 +0200 ARM: dts: stm32: add sd-uhs properties in SD-card node for stm32mp157c-ed1 The sdmmc1 peripheral is connected on SD-card on STM32MP1-ED1 board. Add the UHS features the controller is able to manage. Those features require a level shifter on the board, and the support of the voltage switch in driver, which is done in Linux v5.7. Signed-off-by: Ludovic Barre Signed-off-by: Yann Gautier Signed-off-by: Alexandre Torgue commit c96efe26569204555705076368f8ef7565d06fa6 Author: Colin Ian King Date: Fri Mar 27 13:45:56 2020 +0000 PCI: altera: Clean up indentation issue on a return statement A return statment is indented incorrectly, remove extraneous space. Link: https://lore.kernel.org/r/20200327134556.265411-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Lorenzo Pieralisi commit 0cdea4455acd350a7f62406478e3d6d1f764cef9 Author: Nirmoy Das Date: Mon May 4 17:40:35 2020 +0200 drm/mm: optimize rb_hole_addr rbtree search Userspace can severely fragment rb_hole_addr rbtree by manipulating alignment while allocating buffers. Fragmented rb_hole_addr rbtree would result in large delays while allocating buffer object for a userspace application. It takes long time to find suitable hole because if we fail to find a suitable hole in the first attempt then we look for neighbouring nodes using rb_prev()/rb_next(). Traversing rbtree using rb_prev()/rb_next() can take really long time if the tree is fragmented. This patch improves searches in fragmented rb_hole_addr rbtree by modifying it to an augmented rbtree which will store an extra field in drm_mm_node, subtree_max_hole. Each drm_mm_node now stores maximum hole size for its subtree in drm_mm_node->subtree_max_hole. Using drm_mm_node->subtree_max_hole, it is possible to eliminate a complete subtree if that subtree is unable to serve a request hence reducing number of rb_prev()/rb_next() used. With this patch applied, 1 million bo allocs on amdgpu took ~8 sec, compared to 50k bo allocs which took 28 sec without it. partial test code: int test_fragmentation(void) { int i = 0; uint32_t minor_version; uint32_t major_version; struct amdgpu_bo_alloc_request request = {}; amdgpu_bo_handle vram_handle[MAX_ALLOC] = {}; amdgpu_device_handle device_handle; request.alloc_size = 4096; request.phys_alignment = 8192; request.preferred_heap = AMDGPU_GEM_DOMAIN_VRAM; int fd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC); amdgpu_device_initialize(fd, &major_version, &minor_version, &device_handle); for (i = 0; i < MAX_ALLOC; i++) { amdgpu_bo_alloc(device_handle, &request, &vram_handle[i]); } for (i = 0; i < MAX_ALLOC; i++) amdgpu_bo_free(vram_handle[i]); return 0; } v2: Use RB_DECLARE_CALLBACKS_MAX to maintain subtree_max_hole v3: insert_hole_addr() should be static a function fix return value of next_hole_high_addr()/next_hole_low_addr() Reported-by: kbuild test robot v4: Fix commit message. Signed-off-by: Nirmoy Das Reviewed-by: Chris Wilson Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/364341/ Signed-off-by: Christian König commit b7301fd812a3b103df422826c830dc9a979b2908 Author: Maya Rashish Date: Wed Apr 8 22:14:42 2020 +0000 drm/ttm: Remove reference to the mem_glob member It was removed in: Author: Christian König Date: Wed Sep 25 11:38:50 2019 +0200 drm/ttm: remove pointers to globals Signed-off-by: Maya Rashish Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/360750/ Signed-off-by: Christian König commit 4f18b82b020a398ee841fe9d925021e02a029be3 Merge: f13242d2c5f7 36c72a58d472 Author: Mark Brown Date: Tue May 5 12:25:15 2020 +0100 Merge series "Grab bag with AMD SPI fixes" from Lukas Wunner : Here's an assortment of drive-by fixes for the new AMD SPI driver. All of them are compile-tested only. Lukas Wunner (5): spi: amd: Fix duplicate iounmap in error path spi: amd: Pass probe errors back to driver core spi: amd: Drop duplicate driver data assignments spi: amd: Fix refcount underflow on remove spi: amd: Drop superfluous member from struct amd_spi drivers/spi/spi-amd.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) -- 2.26.2 commit 0e86d981f9b7252e9716c5137cd8e4d9ad8ef32f Author: Kunihiko Hayashi Date: Wed Apr 22 16:24:47 2020 +0900 PCI: endpoint: functions/pci-epf-test: Fix DMA channel release When unbinding pci_epf_test, pci_epf_test_clean_dma_chan() is called in pci_epf_test_unbind() even though epf_test->dma_supported is false. As a result, dma_release_channel() will trigger a NULL pointer dereference because dma_chan is not set. Avoid calling dma_release_channel() if epf_test->dma_supported is false. Link: https://lore.kernel.org/r/1587540287-10458-1-git-send-email-hayashi.kunihiko@socionext.com Fixes: 5ebf3fc59bd2 ("PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer data") Signed-off-by: Kunihiko Hayashi [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit 75358ea359e7c0dfceb3c7b3d854570b4260cb7f Author: Aneesh Kumar K.V Date: Tue May 5 12:47:29 2020 +0530 powerpc/mm/book3s64: Fix MADV_DONTNEED and parallel page fault race MADV_DONTNEED holds mmap_sem in read mode and that implies a parallel page fault is possible and the kernel can end up with a level 1 PTE entry (THP entry) converted to a level 0 PTE entry without flushing the THP TLB entry. Most architectures including POWER have issues with kernel instantiating a level 0 PTE entry while holding level 1 TLB entries. The code sequence I am looking at is down_read(mmap_sem) down_read(mmap_sem) zap_pmd_range() zap_huge_pmd() pmd lock held pmd_cleared table details added to mmu_gather pmd_unlock() insert a level 0 PTE entry() tlb_finish_mmu(). Fix this by forcing a tlb flush before releasing pmd lock if this is not a fullmm invalidate. We can safely skip this invalidate for task exit case (fullmm invalidate) because in that case we are sure there can be no parallel fault handlers. This do change the Qemu guest RAM del/unplug time as below 128 core, 496GB guest: Without patch: munmap start: timer = 196449 ms, PID=6681 munmap finish: timer = 196488 ms, PID=6681 - delta = 39ms With patch: munmap start: timer = 196345 ms, PID=6879 munmap finish: timer = 196714 ms, PID=6879 - delta = 369ms Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-23-aneesh.kumar@linux.ibm.com commit e21dfbf01346ee4447d1533b1c57a003c773c6e3 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:27 2020 +0530 powerpc/mm/book3s64: Avoid sending IPI on clearing PMD Now that all the lockless page table walk is careful w.r.t the PTE address returned, we can now revert commit: 13bd817bb884 ("powerpc/thp: Serialize pmd clear against a linux page table walk.") We also drop the equivalent IPI from other pte updates routines. We still keep IPI in hash pmdp collapse and that is to take care of parallel hash page table insert. The radix pmdp collapse flush can possibly be removed once I am sure generic code doesn't have the any expectations around parallel gup walk. This speeds up Qemu guest RAM del/unplug time as below 128 core, 496GB guest: Without patch: munmap start: timer = 13162 ms, PID=7684 munmap finish: timer = 95312 ms, PID=7684 - delta = 82150 ms With patch: munmap start: timer = 196449 ms, PID=6681 munmap finish: timer = 196488 ms, PID=6681 - delta = 39ms Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-21-aneesh.kumar@linux.ibm.com commit 0e11df9649ac4251c1bc5f27b7d89636d9270a91 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:26 2020 +0530 powerpc/kvm/book3s: Use pte_present instead of opencoding _PAGE_PRESENT check This adds _PAGE_PTE check and makes sure we validate the pte value returned via find_kvm_host_pte. NOTE: this also considers _PAGE_INVALID to the software valid bit. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-20-aneesh.kumar@linux.ibm.com commit 9fd4236faa243f6660812b809bf2fb91d19c61b6 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:25 2020 +0530 powerpc/kvm/book3s: Use find_kvm_host_pte in kvmppc_get_hpa Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-19-aneesh.kumar@linux.ibm.com commit bda3deaa6fc800218b6b59213e8da644e52787dc Author: Aneesh Kumar K.V Date: Tue May 5 12:47:24 2020 +0530 powerpc/kvm/book3s: use find_kvm_host_pte in kvmppc_book3s_instantiate_page Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-18-aneesh.kumar@linux.ibm.com commit 3ff8df1430e9eaa18644345971342b09ba5348a3 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:23 2020 +0530 powerpc/kvm/book3s: Avoid using rmap to protect parallel page table update. We now depend on kvm->mmu_lock Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-17-aneesh.kumar@linux.ibm.com commit 7769a3394bdf10fe2289ea1f5059aa750a6218c2 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:22 2020 +0530 powerpc/kvm/book3s: use find_kvm_host_pte in pute_tce functions Current code just hold rmap lock to ensure parallel page table update is prevented. That is not sufficient. The kernel should also check whether a mmu_notifer callback was running in parallel. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-16-aneesh.kumar@linux.ibm.com commit e3d8ed5518c7f50e24d2530b36d14b6c4284769f Author: Aneesh Kumar K.V Date: Tue May 5 12:47:21 2020 +0530 powerpc/kvm/book3s: Use find_kvm_host_pte in h_enter Since kvmppc_do_h_enter can get called in realmode use low level arch_spin_lock which is safe to be called in realmode. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-15-aneesh.kumar@linux.ibm.com commit 9781e759b3258bc607296bc1bf7cc314b7bfd0fc Author: Aneesh Kumar K.V Date: Tue May 5 12:47:20 2020 +0530 powerpc/kvm/book3s: Use find_kvm_host_pte in page fault handler Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-14-aneesh.kumar@linux.ibm.com commit 35528876a92917b60c20077121e5c6805936cd7d Author: Aneesh Kumar K.V Date: Tue May 5 12:47:19 2020 +0530 powerpc/kvm/book3s: Add helper for host page table walk Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-13-aneesh.kumar@linux.ibm.com commit 6cdf30375f82fbc1d30252096440265426c0993c Author: Aneesh Kumar K.V Date: Tue May 5 12:47:18 2020 +0530 powerpc/kvm/book3s: Use kvm helpers to walk shadow or secondary table update kvmppc_hv_handle_set_rc to use find_kvm_nested_guest_pte and find_kvm_secondary_pte Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-12-aneesh.kumar@linux.ibm.com commit dc891849e030199d203334b2ddd2bd4fc5a87733 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:17 2020 +0530 powerpc/kvm/nested: Add helper to walk nested shadow linux page table. The locking rules for walking nested shadow linux page table is different from process scoped table. Hence add a helper for nested page table walk and also add check whether we are holding the right locks. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-11-aneesh.kumar@linux.ibm.com commit 4b99412ed6972cc77c1f16009e1d00323fcef9ab Author: Aneesh Kumar K.V Date: Tue May 5 12:47:16 2020 +0530 powerpc/kvm/book3s: Add helper to walk partition scoped linux page table. The locking rules for walking partition scoped table is different from process scoped table. Hence add a helper for secondary linux page table walk and also add check whether we are holding the right locks. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-10-aneesh.kumar@linux.ibm.com commit 87013f9c602cfbbc0734fb2f703df9fc884d05d9 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:15 2020 +0530 powerpc/kvm/book3s: switch from raw_spin_*lock to arch_spin_lock. These functions can get called in realmode. Hence use low level arch_spin_lock which is safe to be called in realmode. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-9-aneesh.kumar@linux.ibm.com commit 15759cb054efdd45e6db8433a829a5734e6d50f6 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:14 2020 +0530 powerpc/perf/callchain: Use __get_user_pages_fast in read_user_stack_slow read_user_stack_slow is called with interrupts soft disabled and it copies contents from the page which we find mapped to a specific address. To convert userspace address to pfn, the kernel now uses lockless page table walk. The kernel needs to make sure the pfn value read remains stable and is not released and reused for another process while the contents are read from the page. This can only be achieved by holding a page reference. One of the first approaches I tried was to check the pte value after the kernel copies the contents from the page. But as shown below we can still get it wrong CPU0 CPU1 pte = READ_ONCE(*ptep); pte_clear(pte); put_page(page); page = alloc_page(); memcpy(page_address(page), "secret password", nr); memcpy(buf, kaddr + offset, nb); put_page(page); handle_mm_fault() page = alloc_page(); set_pte(pte, page); if (pte_val(pte) != pte_val(*ptep)) Hence switch to __get_user_pages_fast. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-8-aneesh.kumar@linux.ibm.com commit 0da81b658b5bf5c16abe51eb32f1905a32322f53 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:13 2020 +0530 powerpc/mce: Don't reload pte val in addr_to_pfn A lockless page table walk should be safe against parallel THP collapse, THP split and madvise(MADV_DONTNEED)/parallel fault. This patch makes sure kernel won't reload the pteval when checking for different conditions. The patch also added a check for pte_present to make sure the kernel is indeed operating on a PTE and not a pointer to level 0 table page. The pfn value we find here can be different from the actual pfn on which machine check happened. This can happen if we raced with a parallel update of the page table. In such a scenario we end up isolating a wrong pfn. But that doesn't have any other side effect. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-7-aneesh.kumar@linux.ibm.com commit 2f92447f9f96583112420aa3cfb400ded55f667e Author: Aneesh Kumar K.V Date: Tue May 5 12:47:12 2020 +0530 powerpc/book3s64/hash: Use the pte_t address from the caller Don't fetch the pte value using lockless page table walk. Instead use the value from the caller. hash_preload is called with ptl lock held. So it is safe to use the pte_t address directly. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-6-aneesh.kumar@linux.ibm.com commit 7900757ce1b4affda1591aa3fd073e27d202f406 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:11 2020 +0530 powerpc/hash64: Restrict page table lookup using init_mm with __flush_hash_table_range This is only used with init_mm currently. Walking init_mm is much simpler because we don't need to handle concurrent page table like other mm_context Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-5-aneesh.kumar@linux.ibm.com commit ec4abf1e70cf6a3fe6e571d640260005c997c6e1 Author: Aneesh Kumar K.V Date: Tue May 5 12:47:10 2020 +0530 powerpc/mm/hash64: use _PAGE_PTE when checking for pte_present This makes the pte_present check stricter by checking for additional _PAGE_PTE bit. A level 1 pte pointer (THP pte) can be switched to a pointer to level 0 pte page table page by following two operations. 1) THP split. 2) madvise(MADV_DONTNEED) in parallel to page fault. A lockless page table walk need to make sure we can handle such changes gracefully. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-4-aneesh.kumar@linux.ibm.com commit c46241a370a61f0f264791abb9fc869016e749ce Author: Aneesh Kumar K.V Date: Tue May 5 12:47:09 2020 +0530 powerpc/pkeys: Check vma before returning key fault error to the user If multiple threads in userspace keep changing the protection keys mapping a range, there can be a scenario where kernel takes a key fault but the pkey value found in the siginfo struct is a permissive one. This can confuse the userspace as shown in the below test case. /* use this to control the number of test iterations */ static void pkeyreg_set(int pkey, unsigned long rights) { unsigned long reg, shift; shift = (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY; asm volatile("mfspr %0, 0xd" : "=r"(reg)); reg &= ~(((unsigned long) PKEY_BITS_MASK) << shift); reg |= (rights & PKEY_BITS_MASK) << shift; asm volatile("mtspr 0xd, %0" : : "r"(reg)); } static unsigned long pkeyreg_get(void) { unsigned long reg; asm volatile("mfspr %0, 0xd" : "=r"(reg)); return reg; } static int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey) { return syscall(SYS_pkey_mprotect, addr, len, prot, pkey); } static int sys_pkey_alloc(unsigned long flags, unsigned long access_rights) { return syscall(SYS_pkey_alloc, flags, access_rights); } static int sys_pkey_free(int pkey) { return syscall(SYS_pkey_free, pkey); } static int faulting_pkey; static int permissive_pkey; static pthread_barrier_t pkey_set_barrier; static pthread_barrier_t mprotect_barrier; static void pkey_handle_fault(int signum, siginfo_t *sinfo, void *ctx) { unsigned long pkeyreg; /* FIXME: printf is not signal-safe but for the current purpose, it gets the job done. */ printf("pkey: exp = %d, got = %d\n", faulting_pkey, sinfo->si_pkey); fflush(stdout); assert(sinfo->si_code == SEGV_PKUERR); assert(sinfo->si_pkey == faulting_pkey); /* clear pkey permissions to let the faulting instruction continue */ pkeyreg_set(faulting_pkey, 0x0); } static void *do_mprotect_fault(void *p) { unsigned long rights, pkeyreg, pgsize; unsigned int i; void *region; int pkey; srand(time(NULL)); pgsize = sysconf(_SC_PAGESIZE); rights = PKEY_DISABLE_WRITE; region = p; /* allocate key, no permissions */ assert((pkey = sys_pkey_alloc(0, PKEY_DISABLE_ACCESS)) > 0); pkeyreg_set(4, 0x0); /* cache the pkey here as the faulting pkey for future reference in the signal handler */ faulting_pkey = pkey; printf("%s: faulting pkey = %d\n", __func__, faulting_pkey); /* try to allocate, mprotect and free pkeys repeatedly */ for (i = 0; i < NUM_ITERATIONS; i++) { /* sync up with the other thread here */ pthread_barrier_wait(&pkey_set_barrier); /* make sure that the pkey used by the non-faulting thread is made permissive for this thread's context too so that no faults are triggered because it still might have been set to a restrictive value */ // pkeyreg_set(permissive_pkey, 0x0); /* sync up with the other thread here */ pthread_barrier_wait(&mprotect_barrier); /* perform mprotect */ assert(!sys_pkey_mprotect(region, pgsize, PROT_READ | PROT_WRITE, pkey)); /* choose a random byte from the protected region and attempt to write to it, this will generate a fault */ *((char *) region + (rand() % pgsize)) = rand(); /* restore pkey permissions as the signal handler may have cleared the bit out for the sake of continuing */ pkeyreg_set(pkey, PKEY_DISABLE_WRITE); } /* free pkey */ sys_pkey_free(pkey); return NULL; } static void *do_mprotect_nofault(void *p) { unsigned long pgsize; unsigned int i, j; void *region; int pkey; pgsize = sysconf(_SC_PAGESIZE); region = p; /* try to allocate, mprotect and free pkeys repeatedly */ for (i = 0; i < NUM_ITERATIONS; i++) { /* allocate pkey, all permissions */ assert((pkey = sys_pkey_alloc(0, 0)) > 0); permissive_pkey = pkey; /* sync up with the other thread here */ pthread_barrier_wait(&pkey_set_barrier); pthread_barrier_wait(&mprotect_barrier); /* perform mprotect on the common page, no faults will be triggered as this is most permissive */ assert(!sys_pkey_mprotect(region, pgsize, PROT_READ | PROT_WRITE, pkey)); /* free pkey */ assert(!sys_pkey_free(pkey)); } return NULL; } int main(int argc, char **argv) { pthread_t fault_thread, nofault_thread; unsigned long pgsize; struct sigaction act; pthread_attr_t attr; cpu_set_t fault_cpuset, nofault_cpuset; unsigned int i; void *region; /* allocate memory region to protect */ pgsize = sysconf(_SC_PAGESIZE); assert(region = memalign(pgsize, pgsize)); CPU_ZERO(&fault_cpuset); CPU_SET(0, &fault_cpuset); CPU_ZERO(&nofault_cpuset); CPU_SET(8, &nofault_cpuset); assert(!pthread_attr_init(&attr)); /* setup sigsegv signal handler */ act.sa_handler = 0; act.sa_sigaction = pkey_handle_fault; assert(!sigprocmask(SIG_SETMASK, 0, &act.sa_mask)); act.sa_flags = SA_SIGINFO; act.sa_restorer = 0; assert(!sigaction(SIGSEGV, &act, NULL)); /* setup barrier for the two threads */ pthread_barrier_init(&pkey_set_barrier, NULL, 2); pthread_barrier_init(&mprotect_barrier, NULL, 2); /* setup and start threads */ assert(!pthread_create(&fault_thread, &attr, &do_mprotect_fault, region)); assert(!pthread_setaffinity_np(fault_thread, sizeof(cpu_set_t), &fault_cpuset)); assert(!pthread_create(&nofault_thread, &attr, &do_mprotect_nofault, region)); assert(!pthread_setaffinity_np(nofault_thread, sizeof(cpu_set_t), &nofault_cpuset)); /* cleanup */ assert(!pthread_attr_destroy(&attr)); assert(!pthread_join(fault_thread, NULL)); assert(!pthread_join(nofault_thread, NULL)); assert(!pthread_barrier_destroy(&pkey_set_barrier)); assert(!pthread_barrier_destroy(&mprotect_barrier)); free(region); puts("PASS"); return EXIT_SUCCESS; } The above test can result the below failure without this patch. pkey: exp = 3, got = 3 pkey: exp = 3, got = 4 a.out: pkey-siginfo-race.c:100: pkey_handle_fault: Assertion `sinfo->si_pkey == faulting_pkey' failed. Aborted Check for vma access before considering this a key fault. If vma pkey allow access retry the acess again. Test case is written by Sandipan Das hence added SOB from him. Signed-off-by: Sandipan Das Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-3-aneesh.kumar@linux.ibm.com commit fe4a6856cb4f4353a6cb8d3629bcfe9204e3d57d Author: Aneesh Kumar K.V Date: Tue May 5 12:47:08 2020 +0530 powerpc/pkeys: Avoid using lockless page table walk Fetch pkey from vma instead of linux page table. Also document the fact that in some cases the pkey returned in siginfo won't be the same as the one we took keyfault on. Even with linux page table walk, we can end up in a similar scenario. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-2-aneesh.kumar@linux.ibm.com commit 93a98695f2f9f9c48a29ab6249334fdc6e9722cb Author: Aneesh Kumar K.V Date: Tue May 5 12:47:28 2020 +0530 mm: change pmdp_huge_get_and_clear_full take vm_area_struct as arg We will use this in later patch to do tlb flush when clearing pmd entries. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200505071729.54912-22-aneesh.kumar@linux.ibm.com commit f2b8d76dc6db379160ad8875f97336db2069e7bd Merge: ae83d0b416db ae49dedaa92b Author: Michael Ellerman Date: Tue May 5 21:16:47 2020 +1000 Merge tag 'kvm-ppc-fixes-5.7-1' into topic/ppc-kvm This brings in a fix from the kvm-ppc tree that was merged to mainline after rc2, and so isn't in the base of our topic branch. We'd like it in the topic branch because it interacts with patches we plan to carry in this branch. commit 839efdb65ffd8f2b1055e60d26d703f832a38c54 Author: Sakari Ailus Date: Thu Apr 16 09:45:07 2020 +0200 media: staging: ipu3-imgu: Add a sanity check for the parameter struct size There have been cases where seemingly innocuous patches have broken the uAPI by changing the memory layout of the parameter struct. Generally such changes also introduce a change in the size of the entire struct. This patch adds a sanity check to avoid such cases happening in the future. Signed-off-by: Sakari Ailus Tested-by: Tested-by: Bingbu Cao Signed-off-by: Mauro Carvalho Chehab commit 8c038effd893920facedf18c2c0976cec4a33408 Author: Sakari Ailus Date: Wed Apr 15 17:40:09 2020 +0200 media: staging: ipu3-imgu: Move alignment attribute to field Move the alignment attribute of struct ipu3_uapi_awb_fr_config_s to the field in struct ipu3_uapi_4a_config, the other location where the struct is used. Fixes: commit c9d52c114a9f ("media: staging: imgu: Address a compiler warning on alignment") Reported-by: Tomasz Figa Tested-by: Bingbu Cao Cc: stable@vger.kernel.org # for v5.3 and up Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 81d1adeb52c97fbe097e8c94e36c3eb702cdb110 Author: Sakari Ailus Date: Wed Apr 15 17:34:05 2020 +0200 media: Revert "staging: imgu: Address a compiler warning on alignment" This reverts commit c9d52c114a9fcc61c30512c7f810247a9f2812af. The patch being reverted changed the memory layout of struct ipu3_uapi_acc_param. Revert it, and address the compiler warning issues in further patches. Fixes: commit c9d52c114a9f ("media: staging: imgu: Address a compiler warning on alignment") Reported-by: Tomasz Figa Tested-by: Bingbu Cao Cc: stable@vger.kernel.org # for v5.3 and up Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f9d813cc93e26aad82f4a9090491d0a7dbe45b20 Author: Sakari Ailus Date: Wed Apr 22 20:13:26 2020 +0200 media: MAINTAINERS: ipu3-imgu: Add Tian Shu and Bingbu as reviewers Add Bingbu Cao and Tian Shu Qiu as reviewers for the IPU3 ImgU driver. Signed-off-by: Sakari Ailus Cc: Bingbu Cao Cc: Tian Shu Qiu Signed-off-by: Mauro Carvalho Chehab commit 11de96b94f7c61956d07f58751b224ad2acc43b4 Author: Bingbu Cao Date: Fri Apr 17 11:34:33 2020 +0200 media: ipu3.rst: add explanation for running mode Add some explanation of the ImgU running mode and add more information about firmware selection and running mode usage. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 735a02f1bbc2c5e6e9cdbf0222948ff03ff7ab2d Author: Tomasz Figa Date: Sat Apr 11 19:37:10 2020 +0200 media: staging: ipu3: Fix stale list entries on parameter queue failure When queuing parameters fails, current code bails out without deleting the corresponding vb2 buffer from the driver buffer list, but the buffer is returned to vb2. This leads to stale list entries and a crash when the driver stops streaming: [ 224.935561] ipu3-imgu 0000:00:05.0: set parameters failed. [ 224.998932] ipu3-imgu 0000:00:05.0: set parameters failed. [ 225.064430] ipu3-imgu 0000:00:05.0: set parameters failed. [ 225.128534] ipu3-imgu 0000:00:05.0: set parameters failed. [ 225.194945] ipu3-imgu 0000:00:05.0: set parameters failed. [ 225.360363] ------------[ cut here ]------------ [ 225.360372] WARNING: CPU: 0 PID: 6704 at drivers/media/common/videobuf2/videobuf2-core.c:927 vb2_buffer_done+0x20f/0x21a [videobuf2_common] [ 225.360374] Modules linked in: snd_seq_dummy snd_seq snd_seq_device veth bridge stp llc tun nf_nat_tftp nf_conntrack_tftp nf_nat_ftp nf_conntrack_ftp esp6 ah6 ip6t_REJECT ip6t_ipv6header cmac rfcomm uinput ipu3_imgu(C) ipu3_cio2 iova videobuf2_v4l2 videobuf2_common videobuf2_dma_sg videobuf2_memops ov13858 ov5670 v4l2_fwnode dw9714 acpi_als xt_MASQUERADE fuse iio_trig_sysfs cros_ec_sensors_ring cros_ec_light_prox cros_ec_sensors cros_ec_sensors_core industrialio_triggered_buffer kfifo_buf industrialio cros_ec_sensorsupport cdc_ether btusb btrtl btintel btbcm usbnet bluetooth ecdh_generic ecc hid_google_hammer iwlmvm iwl7000_mac80211 r8152 mii lzo_rle lzo_compress iwlwifi zram cfg80211 joydev [ 225.360400] CPU: 0 PID: 6704 Comm: CameraDeviceOps Tainted: G C 5.4.30 #5 [ 225.360402] Hardware name: HP Soraka/Soraka, BIOS Google_Soraka.10431.106.0 12/03/2019 [ 225.360405] RIP: 0010:vb2_buffer_done+0x20f/0x21a [videobuf2_common] [ 225.360408] Code: 5e 41 5f 5d e9 e0 16 5a d4 41 8b 55 08 48 c7 c7 8f 8b 5c c0 48 c7 c6 36 9a 5c c0 44 89 f9 31 c0 e8 a5 1c 5b d4 e9 53 fe ff ff <0f> 0b eb a3 e8 12 d7 43 d4 eb 97 0f 1f 44 00 00 55 48 89 e5 41 56 [ 225.360410] RSP: 0018:ffff9468ab32fba8 EFLAGS: 00010297 [ 225.360412] RAX: ffff8aa7a51577a8 RBX: dead000000000122 RCX: ffff8aa7a51577a8 [ 225.360414] RDX: 0000000000000000 RSI: 0000000000000006 RDI: ffff8aa7a5157400 [ 225.360416] RBP: ffff9468ab32fbd8 R08: ffff8aa64e47e600 R09: 0000000000000000 [ 225.360418] R10: 0000000000000000 R11: ffffffffc06036e6 R12: dead000000000100 [ 225.360420] R13: ffff8aa7820f1940 R14: ffff8aa7a51577a8 R15: 0000000000000006 [ 225.360422] FS: 00007c1146ffd700(0000) GS:ffff8aa7baa00000(0000) knlGS:0000000000000000 [ 225.360424] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 225.360426] CR2: 00007aea3473a000 CR3: 00000000537d6004 CR4: 00000000003606f0 [ 225.360427] Call Trace: [ 225.360434] imgu_return_all_buffers+0x6f/0x8e [ipu3_imgu] [ 225.360438] imgu_vb2_stop_streaming+0xd6/0xf0 [ipu3_imgu] [ 225.360441] __vb2_queue_cancel+0x33/0x22d [videobuf2_common] [ 225.360443] vb2_core_streamoff+0x16/0x78 [videobuf2_common] [ 225.360448] __video_do_ioctl+0x33d/0x42a [ 225.360452] video_usercopy+0x34a/0x615 [ 225.360455] ? video_ioctl2+0x16/0x16 [ 225.360458] v4l2_ioctl+0x46/0x53 [ 225.360462] do_vfs_ioctl+0x50a/0x787 [ 225.360465] ksys_ioctl+0x58/0x83 [ 225.360468] __x64_sys_ioctl+0x1a/0x1e [ 225.360470] do_syscall_64+0x54/0x68 [ 225.360474] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 225.360476] RIP: 0033:0x7c118030f497 [ 225.360479] Code: 8a 66 90 48 8b 05 d1 d9 2b 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 d9 2b 00 f7 d8 64 89 01 48 [ 225.360480] RSP: 002b:00007c1146ffa5a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 225.360483] RAX: ffffffffffffffda RBX: 00007c1140010018 RCX: 00007c118030f497 [ 225.360484] RDX: 00007c114001019c RSI: 0000000040045613 RDI: 000000000000004c [ 225.360486] RBP: 00007c1146ffa700 R08: 00007c1140010048 R09: 0000000000000000 [ 225.360488] R10: 0000000000000000 R11: 0000000000000246 R12: 00007c11400101b0 [ 225.360489] R13: 00007c1140010200 R14: 00007c1140010048 R15: 0000000000000001 [ 225.360492] ---[ end trace 73625ecfbd1c930e ]--- [ 225.360498] general protection fault: 0000 [#1] PREEMPT SMP PTI [ 225.360501] CPU: 0 PID: 6704 Comm: CameraDeviceOps Tainted: G WC 5.4.30 #5 [ 225.360502] Hardware name: HP Soraka/Soraka, BIOS Google_Soraka.10431.106.0 12/03/2019 [ 225.360505] RIP: 0010:imgu_return_all_buffers+0x52/0x8e [ipu3_imgu] [ 225.360507] Code: d4 49 8b 85 70 0a 00 00 49 81 c5 70 0a 00 00 49 39 c5 74 3b 49 bc 00 01 00 00 00 00 ad de 49 8d 5c 24 22 4c 8b 30 48 8b 48 08 <49> 89 4e 08 4c 89 31 4c 89 20 48 89 58 08 48 8d b8 58 fc ff ff 44 [ 225.360509] RSP: 0018:ffff9468ab32fbe8 EFLAGS: 00010293 [ 225.360511] RAX: ffff8aa7a51577a8 RBX: dead000000000122 RCX: dead000000000122 [ 225.360512] RDX: 0000000000000000 RSI: 0000000000000006 RDI: ffff8aa7a5157400 [ 225.360514] RBP: ffff9468ab32fc18 R08: ffff8aa64e47e600 R09: 0000000000000000 [ 225.360515] R10: 0000000000000000 R11: ffffffffc06036e6 R12: dead000000000100 [ 225.360517] R13: ffff8aa7820f1940 R14: dead000000000100 R15: 0000000000000006 [ 225.360519] FS: 00007c1146ffd700(0000) GS:ffff8aa7baa00000(0000) knlGS:0000000000000000 [ 225.360521] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 225.360523] CR2: 00007aea3473a000 CR3: 00000000537d6004 CR4: 00000000003606f0 [ 225.360525] Call Trace: [ 225.360528] imgu_vb2_stop_streaming+0xd6/0xf0 [ipu3_imgu] [ 225.360531] __vb2_queue_cancel+0x33/0x22d [videobuf2_common] [ 225.360534] vb2_core_streamoff+0x16/0x78 [videobuf2_common] [ 225.360537] __video_do_ioctl+0x33d/0x42a [ 225.360540] video_usercopy+0x34a/0x615 [ 225.360542] ? video_ioctl2+0x16/0x16 [ 225.360546] v4l2_ioctl+0x46/0x53 [ 225.360548] do_vfs_ioctl+0x50a/0x787 [ 225.360551] ksys_ioctl+0x58/0x83 [ 225.360554] __x64_sys_ioctl+0x1a/0x1e [ 225.360556] do_syscall_64+0x54/0x68 [ 225.360559] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 225.360561] RIP: 0033:0x7c118030f497 [ 225.360563] Code: 8a 66 90 48 8b 05 d1 d9 2b 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 d9 2b 00 f7 d8 64 89 01 48 [ 225.360565] RSP: 002b:00007c1146ffa5a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 225.360567] RAX: ffffffffffffffda RBX: 00007c1140010018 RCX: 00007c118030f497 [ 225.360569] RDX: 00007c114001019c RSI: 0000000040045613 RDI: 000000000000004c [ 225.360570] RBP: 00007c1146ffa700 R08: 00007c1140010048 R09: 0000000000000000 [ 225.360572] R10: 0000000000000000 R11: 0000000000000246 R12: 00007c11400101b0 [ 225.360574] R13: 00007c1140010200 R14: 00007c1140010048 R15: 0000000000000001 [ 225.360576] Modules linked in: snd_seq_dummy snd_seq snd_seq_device veth bridge stp llc tun nf_nat_tftp nf_conntrack_tftp nf_nat_ftp nf_conntrack_ftp esp6 ah6 ip6t_REJECT ip6t_ipv6header cmac rfcomm uinput ipu3_imgu(C) ipu3_cio2 iova videobuf2_v4l2 videobuf2_common videobuf2_dma_sg videobuf2_memops ov13858 ov567 Fix this by moving the list_del() call just below the list_first_entry() call when the buffer no longer needs to be in the list. Fixes: 8ecc7c9da013 ("media: staging/intel-ipu3: parameter buffer refactoring") Signed-off-by: Tomasz Figa Reviewed-by: Laurent Pinchart Reviewed-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4470ff693833ad2cf06d4d07067b2e6a2458c6c1 Author: Stanimir Varbanov Date: Sat Apr 18 11:06:22 2020 +0200 media: venus: venc,vdec: Return EBUSY on S_FMT while streaming According to the v4l spec s_fmt must return EBUSY while the particular queue is streaming. Add such check in encoder and decoder s_fmt methods. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 85872f861d4cc535b0dbfd0a9062bdbdcbed20c3 Author: Stanimir Varbanov Date: Fri Apr 3 17:56:29 2020 +0200 media: venus: Mark last capture buffer According to stateful Codec API the decoder will process all remaining buffers from before the source change event in dynamic-resolution-change state and mark the last buffer with V4L2_BUF_FLAG_LAST. In Venus case the firmware doesn't mark that last buffer and some mechanism have to be created in v4l decoder driver. Fortunately the firmware interface (HFI) claims that the decoder output buffers will be returned to v4l decoder driver before it send the insufficient event. In order to do that we save last queued in the driver capture buffer in the event_notify and issue flush on output firmware buffers queue. Once the saved buffer is returned (as a result of flush command) we mark it as LAST. For all that possible we extend HFI flush command with one more argument and one more flush_done HFI driver callback. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit bc3d870e414b42d72cd386aa20a4fc3612e4feb7 Author: Stanimir Varbanov Date: Fri Apr 3 15:10:13 2020 +0200 media: venus: vdec: Init registered list unconditionally Presently the list initialization is done only in dynamic-resolution-change state, which leads to list corruptions and use-after-free. Init list_head unconditionally in vdec_stop_capture called by vb2 stop_streaming without takeing into account current codec state. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit b68be5c623cdd62b9a8b99eb1443ba9cba812d6d Author: Chris Wilson Date: Tue May 5 09:46:29 2020 +0100 drm/i915/execlists: Record the active CCID from before reset If we cannot trust the reset will flush out the CS event queue such that process_csb() reports an accurate view of HW, we will need to search the active and pending contexts to determine which was actually running at the time we issued the reset. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200505084629.31365-1-chris@chris-wilson.co.uk commit 51df3c81ba10b00f4da81225310a3503b0583062 Author: Stanimir Varbanov Date: Tue Mar 31 18:19:51 2020 +0200 media: venus: vdec: Mark flushed buffers with error state Once the hfi_session_flush is issued by the vdec all queued buffers to firmware should be returned to the v4l driver. Some of those buffers are not processed at the time of flush command, those buffers has filled len zero (no data). Catch that in buffer_done callback and mark not filled capture buffers with error state so that client can discard them. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 0febf9236970b5282588147961b068b889a77563 Author: Stanimir Varbanov Date: Tue Mar 31 17:47:38 2020 +0200 media: venus: helpers: Done buffers per queue type Currently calling venus_helper_buffers_done() will return buffers to user for both capture and output queues in the same call. This is wrong because both queues are really separate and calling stop_streaming on one queue shouldn't return buffers for the other. Solve this by add a new queue type argument and fix the clients of the helper function. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 18cf8ba1d3e6faf8db8c6e49f4014b657ac96888 Author: Stanimir Varbanov Date: Tue Mar 31 17:42:52 2020 +0200 media: venus: core: Constify codec frequency data array The array is not changed in the code, so make it const. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 82223aa54bb7075e9bf24b64720c18361ed190a1 Author: Stanimir Varbanov Date: Tue Mar 31 17:37:02 2020 +0200 media: venus: core: Fix mutex destroy in remove The hfi_destroy function is called too early in remove method. It destroys a mutex which is used later in the .remove from pmruntime. Solve the issue by moving hfi_destroy after last usage of the mutex. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit cb1c05c89b1f0b5ee24b65fbad3811127f3205d0 Author: Stanimir Varbanov Date: Tue Mar 31 16:54:28 2020 +0200 media: venus: core: Add missing mutex destroy This adds missing mutex_destroy in remove method of venus core driver. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit bca718988b9008d0d5f504e2d318178fc84958c1 Author: Christophe JAILLET Date: Sat Apr 18 10:16:37 2020 +0200 PCI: v3-semi: Fix a memory leak in v3_pci_probe() error handling paths If we fails somewhere in 'v3_pci_probe()', we need to free 'host'. Use the managed version of 'pci_alloc_host_bridge()' to do that easily. The use of managed resources is already widely used in this driver. Link: https://lore.kernel.org/r/20200418081637.1585-1-christophe.jaillet@wanadoo.fr Fixes: 68a15eb7bd0c ("PCI: v3-semi: Add V3 Semiconductor PCI host driver") Signed-off-by: Christophe JAILLET [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Linus Walleij commit f136c58a0de98e1b56483b7fc8c209dba0a496d9 Author: Stanislav Lisovskiy Date: Tue May 5 13:22:45 2020 +0300 drm/i915: Added required new PCode commands We need a new PCode request commands and reply codes to be added as a prepartion patch for QGV points restricting for new SAGV support. v2: - Extracted those changes into separate patch (Ville Syrjälä) v3: - Moved new PCode masks to another place from PCode commands(Ville) v4: - Moved new PCode masks to correspondent PCode command, with identation(Ville) - Changed naming to ICL_ instead of GEN11_ to fit more nicely into existing definition style. Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200505102247.32452-5-stanislav.lisovskiy@intel.com commit f13242d2c5f773428da95f9aa1231f3b2cc64ea4 Merge: b68527dfa952 0392727c261b Author: Mark Brown Date: Tue May 5 11:48:25 2020 +0100 Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.8 commit 433022b58e628418020155e1f6a3d59c06a474c0 Author: Will Deacon Date: Tue May 5 11:45:21 2020 +0100 arm64: cpufeature: Extend comment to describe absence of field info When a feature register field is omitted from the description of the register, the corresponding bits are treated as STRICT RES0, including for KVM guests. This is subtly different to declaring the field as HIDDEN/STRICT/EXACT/0, so update the comment to call this out. Signed-off-by: Will Deacon commit 378c1ee2227f67d4dbb748ff5193c959d5299095 Author: YueHaibing Date: Tue May 5 10:12:00 2020 +0000 crypto: xilinx - Remove set but not used variable 'drv_ctx' Fixes gcc '-Wunused-but-set-variable' warning: drivers/crypto/xilinx/zynqmp-aes-gcm.c: In function 'zynqmp_aes_aead_cipher': drivers/crypto/xilinx/zynqmp-aes-gcm.c:83:30: warning: variable 'drv_ctx' set but not used [-Wunused-but-set-variable] commit bc86f9c54616 ("firmware: xilinx: Remove eemi ops for aes engine") left behind this, remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200505101200.195184-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman commit 1d9000262b3b80ef6675f35808856073e51be807 Author: Rajan Vaja Date: Fri May 1 03:52:34 2020 -0700 crypto: xilinx: Handle AES PM API return status Return value of AES PM API is not handled which may result in unexpected value of "status" in zynqmp_pm_aes_engine(). Consider "status" value as valid only if AES PM API is successful. Fixes: bc86f9c54616 ("firmware: xilinx: Remove eemi ops for aes engine") Reported-by: Stephen Rothwell Signed-off-by: Rajan Vaja Link: https://lore.kernel.org/r/1588330354-27942-1-git-send-email-rajan.vaja@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 2e11cc1ab790ccbc7c7f6ed74c0f40b85c561dc7 Author: Oscar Carter Date: Mon May 4 19:14:14 2020 +0200 staging: vt6656: Use const for read only data Use const for the arrays that are used as "read only". Also, modify the prototype of vnt_control_out_blocks() function to use a pointer to a const type. The vnt_vt3184_al2230 array can't be converted to const as it's modified later. Then in the vnt_vt3184_init() function use two types of pointers (to const type and to no const type) to avoid the compiler warning: assignment discards 'const' qualifiers from pointer target type This way decrease the .data section and increase the .rodata section limiting the surface attack. Before this change: ------------------- drivers/staging/vt6656/baseband.o : section size addr .text 1278 0 .data 576 0 .bss 0 0 .rodata 319 0 .comment 45 0 .note.GNU-stack 0 0 .note.gnu.property 32 0 Total 2250 After this change: ------------------ drivers/staging/vt6656/baseband.o : section size addr .text 1278 0 .data 256 0 .bss 0 0 .rodata 640 0 .comment 45 0 .note.GNU-stack 0 0 .note.gnu.property 32 0 Total 2251 Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200504171414.11307-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 0729bb9b2a97a279c4b7c7be8565d494aab3d6e9 Author: Matej Dujava Date: Sun May 3 17:42:50 2020 +0200 staging: vt6655: fix LONG_LINE warning This patch will fix LONG_LINE error from checkpatch, by using ternary operator. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588520570-14388-3-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit 3fc29573cf3e38624962f1a74ee18cbec2a2556e Author: Matej Dujava Date: Sun May 3 17:42:49 2020 +0200 staging: vt6655: return early if not bNeedAck This patch will check for bNeedAck before making bb_get_frame_time call, so in case we dont need uAckTime, we can return early. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588520570-14388-2-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit e3b8577aa167ca5612b7723b6949dc888921ac8d Author: Matej Dujava Date: Sun May 3 15:29:12 2020 +0200 staging: vt6655: extract index manupulation out of function call This patch will remove if/else by selecting proper argument before function call, also index is updated before function call. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588512552-12297-6-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit ae25983134c78c51279ebe160f67fcf5e5ef58b8 Author: Matej Dujava Date: Sun May 3 15:29:11 2020 +0200 staging: vt6655: return at the ond of case body This patch will unify exit point for s_uGetDataDuration function. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588512552-12297-5-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit 3be1acffe684b11b9447cc7140ea0e59efa19a20 Author: Matej Dujava Date: Sun May 3 15:29:10 2020 +0200 staging: vt6655: remove else after return and invert condition This patch will prepare us to make return at the end of case body Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588512552-12297-4-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit 0ae73acc4479e12dce87f137d19e521f585816c7 Author: Matej Dujava Date: Sun May 3 15:29:09 2020 +0200 staging: vt6655: do calculation of uAckTime first This patch is extracting calculation of uAckTime in one place, at the start of case body. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588512552-12297-3-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit e4a34ef772576a782f2f76b9fd1d7a4ccd488981 Author: Matej Dujava Date: Sun May 3 15:29:08 2020 +0200 staging: vt6655: merge two switch cases in s_uGetDataDuration This patch will reuse code for two cases. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588512552-12297-2-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit 9adbb49e90e451f38e159fb262731b7567d9db66 Author: Ivan Safonov Date: Sat May 2 18:19:05 2020 +0300 staging:rtl8723bs: eliminate usage of skb_clone after skb allocation fail The skb allocated when out of memory is likely to be discarded during subsequent processing. Signed-off-by: Ivan Safonov Link: https://lore.kernel.org/r/20200502151905.43663-1-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 70458c20049f16a5512bf89ac5137f79d3049f91 Author: Wei Yongjun Date: Tue Apr 28 15:06:50 2020 +0000 staging: pi433: fix error return code in pi433_probe() Fix to return negative error code -ENOMEM from cdev alloc failed error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200428150650.102340-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman commit 16529e3b8655b9b8bff776ecc4036f07711658a4 Author: Jason Yan Date: Mon May 4 19:32:51 2020 +0800 staging: rtl8723bs: remove conversion to bool in halbtcoutsrc_Get() Fix the following coccicheck warning: drivers/staging/rtl8723bs/hal/hal_btcoex.c:410:59-64: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200504113251.40791-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit b95f955674bfdc42a9a12f1ad5d4eb1e9221e3bd Author: Yu Jian Wu Date: Sat May 2 08:47:50 2020 +0800 staging: rtl8723bs: os_dep: Cleanup pointer casting code style Cleanup by adding a space between type and pointer, in accordance with checkpatch.pl message "(foo*)" should be "(foo *)". Signed-off-by: Yu Jian Wu Link: https://lore.kernel.org/r/20200502004747.GA16480@amber Signed-off-by: Greg Kroah-Hartman commit 8a6e4f430b9586b2e0c22b23c149ae502525e13d Author: Jason Yan Date: Tue Apr 28 21:31:15 2020 +0800 staging: rtl8723bs: os_dep: remove rtw_spt_band_free() Now that rtw_spt_band_free() is only a direct wrapper of kfree, we can remove it and just use kfree(). Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200428133115.28072-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit d95c8695e0d91d60867d971009862299c53b5fb6 Author: Malcolm Priestley Date: Sat May 2 12:20:13 2020 +0100 staging: vt6656: refactor power save operation At present the power save wake uses the listening interval and the slow path to wake up. The following using a beacon interval of 100 and listen interval of 5. The TBTT set at 100 wake-up sequence; 100 TBTT wake-up set to listen interval. 200 TBTT 300 TBTT 400 TBTT --> call vnt_next_tbtt_wakeup on slow path Beacon heard and passed through at the approx 500 interval. 500 TBTT 600 TBTT wake-up set to listen interval The TBTT set at 500 wake-up sequence and always listen flagged on; 100 No TBTT 200 No TBTT 300 No TBTT 400 No TBTT 500 TBTT - beacon heard and passed through 600 No TBTT A further enhancement because the TBTT is more precise the dtim_period can be used instead. When Power save is off the TBTT continues to run at the listen interval but all the other beacons are passed. The code in vnt_int_process_data is no longer required. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/5a188bd8-7049-8063-f24d-96768ce9a6ed@gmail.com Signed-off-by: Greg Kroah-Hartman commit 986da7debb04225221d8876b405c4088614ae5f4 Author: Malcolm Priestley Date: Fri May 1 11:43:25 2020 +0100 staging: vt6656: Return on isr0 when zero. When isr0 is zero there is nothing more todo so return and pull following code in. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/8dccc74d-d0bb-e8e7-df81-dfd81e3fd7d8@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3ce6b741bc327a5fc9ebccccec7d8d8926f56fc8 Author: Malcolm Priestley Date: Wed Apr 29 21:42:27 2020 +0100 staging: vt6656: use struct wiphy retry short and long settings. Remove driver options for short and long retry and use the ones set by user in wiphy. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/fbb8da09-ee46-2249-ff29-daaaff1a64e6@gmail.com Signed-off-by: Greg Kroah-Hartman commit f4269d4862c600b556041bb66ea10a3c53612f2e Author: Malcolm Priestley Date: Wed Apr 29 19:48:14 2020 +0100 staging: vt6656: return all key calls to mac80211 stack. vnt_mac_set_keyentry can return USB calls so return them to mac80211. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/f1be8ba0-9513-55cb-de9d-dcd4341e5b78@gmail.com Signed-off-by: Greg Kroah-Hartman commit ddaa877f2dbc88d8109ceaf4b94b5372173a4bf4 Author: Malcolm Priestley Date: Wed Apr 29 19:44:29 2020 +0100 staging: vt6656 remove vnt_mac_disable_keyentry calls It is not necessary to disable all the keys mac80211 will have removed any existing keys that were used. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/844df68d-08e2-7672-524f-42b918e300c1@gmail.com Signed-off-by: Greg Kroah-Hartman commit 41f1efcb4a25f64c36e3d5d23f78b84ae68243cf Author: Malcolm Priestley Date: Wed Apr 29 19:39:03 2020 +0100 staging: vt6656: vnt_set_keymode simplify key modes. Unused macros and onfly_latch are removed and others contain to actual key_type value is or-ed with key_mode. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/0eb6f5bb-f756-ab1d-5b63-db9b0dc422da@gmail.com Signed-off-by: Greg Kroah-Hartman commit ae220204873e2508fd8d7e5240a4d8aa45fe26e1 Author: Oscar Carter Date: Wed Apr 29 17:38:38 2020 +0200 staging: vt6656: Refactor the vnt_rf_table_download function Create a constant array of struct vnt_table_info type elements with the necessary info (address and length) about all the rf tables for every rf type. In every case of the "switch" statement replace the hardcoded info about these tables with and index to the new constant array. Moreover, use this array index to extract the necessary info in every call to the vnt_control_out_* functions. Check if this index has been set and return without error otherwise. So, avoid the execution of code that previously did nothing due to lengths with values of zero for some rf types. Also remove all the variables that are now unused. This way reduce the stack footprint, and make the code more clear. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200429153838.7216-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 91387f5eb9fc22fe81bb09d6a97396da9d1e3967 Author: Oscar Carter Date: Wed Apr 29 17:23:07 2020 +0200 staging: vt6656: Refactor the vnt_set_bss_mode function Remove all the duplicate code in the "if, else if, else" statements as all the branches in every "if" are almost the same. The only difference between branches is some value. So, use variables instead of repeat code. Also, remove the unnecessary casting to u8 type because the "priv->bb_type" variable is already an u8 tpe. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200429152307.5871-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 35452e10610617abd0e84389fa9271421bf6425d Author: Oscar Carter Date: Wed Apr 29 17:23:06 2020 +0200 staging: vt6656: Check the return values in vnt_set_bss_mode function Check the return value of all the functions that return zero if successful or a negative error code on failure inside the function vnt_set_bss_mode. Also, remove the unnecessary variable initialization as this variable is set a few lines later. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200429152307.5871-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 2eeefd3787fdc6319124945d453774be95b97897 Author: Arnd Bergmann Date: Wed Apr 29 16:21:09 2020 +0200 staging: wfx: avoid compiler warning on empty array When CONFIG_OF is disabled, gcc-9 produces a warning about the wfx_sdio_of_match[] array having a declaration without a dimension: drivers/staging/wfx/bus_sdio.c:159:34: error: array 'wfx_sdio_of_match' assumed to have one element [-Werror] 159 | static const struct of_device_id wfx_sdio_of_match[]; | ^~~~~~~~~~~~~~~~~ Move the proper declaration up and out of the #ifdef instead. Fixes: a7a91ca5a23d ("staging: wfx: add infrastructure for new driver") Signed-off-by: Arnd Bergmann Cc: Jerome Pouiller Link: https://lore.kernel.org/r/20200429142119.1735196-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman commit 70f4c9f0e62731bf16aacfe98fbc55e4017c2c5e Author: Eric Yu Date: Sat May 2 20:12:47 2020 -0600 Staging: comedi: drivers: ni_pcimio: Fix variable name Fixed a variable name that was Camel case Signed-off-by: Eric Yu Link: https://lore.kernel.org/r/20200503021247.250785-1-ejyu99@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3aff3c974b16b3db312e076a083b51a576db9ade Author: Matej Dujava Date: Thu Apr 30 22:09:26 2020 +0200 staging: sm750fb: print error message with actual value This patch will update error message, so it is same as error message in another function. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588277366-19354-4-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit b610e1193a917f4677eef7d52334865f5143c02a Author: Matej Dujava Date: Thu Apr 30 22:09:25 2020 +0200 staging: sm750fb: add common function to set color offsets and visual mode This patch will unify code for updating color offsets and frame buffer visual mode. Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588277366-19354-3-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit fa90133377f4a7f15a937df6ad55133bb57c5665 Author: Matej Dujava Date: Thu Apr 30 22:09:24 2020 +0200 staging: sm750fb: add missing case while setting FB_VISUAL Switch statement does not contain all cases: 8, 16, 24, 32. This patch will add missing one (24) Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging") Signed-off-by: Matej Dujava Link: https://lore.kernel.org/r/1588277366-19354-2-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman commit a4338ed2e1cf724563956ec5f91deeaabfedbe23 Author: Oscar Carter Date: Mon May 4 17:09:11 2020 +0200 staging: wilc1000: Increase the size of wid_list array Increase by one the size of wid_list array as index variable can reach a value of 5. If this happens, an out-of-bounds access is performed. Also, use a #define instead of a hard-coded literal for the new array size. Addresses-Coverity-ID: 1451981 ("Out-of-bounds access") Fixes: f5a3cb90b802d ("staging: wilc1000: add passive scan support") Acked-by: Ajay Singh Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200504150911.4470-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 8d8a1424a03e0fe6dff5542a2d412a3836eb87a7 Author: Rylan Dmello Date: Wed Apr 29 21:35:15 2020 -0400 staging: qlge: Fix function argument alignment warning in ql_init_device Fix checkpatch.pl check: CHECK: Alignment should match open parenthesis Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/12c7c34330b410e4ee8b9b5634f1a50ceb9c3590.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 2ceed067e85e77852f29a999c2df5dfc4cba2e2f Author: Rylan Dmello Date: Wed Apr 29 21:34:44 2020 -0400 staging: qlge: Fix suspect code indent warning in ql_init_device Fix checkpatch.pl warnings: WARNING: suspect code indent for conditional statements (16, 23) WARNING: line over 80 characters Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/7c07400dbce98d0c4c84aa941da8f34e32616159.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 4ba1bb9b7a73d1dc88443960c494aaa4c82d5462 Author: Rylan Dmello Date: Wed Apr 29 21:34:25 2020 -0400 staging: qlge: Remove multi-line dereference from ql_request_irq Fix checkpatch.pl warning: WARNING: Avoid multiple line dereference - prefer 'qdev->flags' Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/517d71f0cbc55e6880c19a9ff16c2c8ab8913251.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit faeea64fb9748002ed2aecff6e5caa01cc829735 Author: Rylan Dmello Date: Wed Apr 29 21:33:56 2020 -0400 staging: qlge: Remove goto statements from ql_get_mac_addr_reg Similar to ql_set_mac_addr_reg, ql_get_mac_addr_reg also has several goto statements that can be trivially replaced with a break statement. Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/9339ea49c4f943411adae3b9b5b278ae8bf062e1.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 58c2a44dbab0e3deea137a15203235ee915f12e1 Author: Rylan Dmello Date: Wed Apr 29 21:33:29 2020 -0400 staging: qlge: Fix indentation in ql_get_mac_addr_reg This has similar indentation style issues as ql_set_mac_addr_reg, so I thought I'd re-indent this too. Fix several checkpatch.pl warnings: WARNING: line over 80 characters Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/b51f21b20514dc5197266a5a52d31c7b85f16741.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 7c40ba652cf706789a19bfe38c551d9782ab6ed4 Author: Rylan Dmello Date: Wed Apr 29 21:33:04 2020 -0400 staging: qlge: Remove gotos from ql_set_mac_addr_reg As suggested by Joe Perches, this patch removes the 'exit' label from the ql_set_mac_addr_reg function and replaces the goto statements with break statements. Signed-off-by: Rylan Dmello Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/a6f485e43eb55e8fdc64a7a346cb0419b55c3cb6.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 7d9a39e01d8c8c719590815aaeeda5dbf6e7fae5 Author: Rylan Dmello Date: Wed Apr 29 21:32:15 2020 -0400 staging: qlge: Fix indentation in ql_set_mac_addr_reg Based on Joe Perches' feedback, fix the indentation throughout ql_set_mac_addr_reg. This helps fix several "line over 80 characters" warnings along with the original "multiple line dereference" warning. Fix checkpatch.pl warnings: WARNING: Avoid multiple line dereference - prefer 'qdev->func' WARNING: line over 80 characters Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/299f2cb3b7d4efa30b44d4d1defbcd5f54bd7eaf.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit e3881eb5343159109bed355a386f908edf7f958c Author: Christian Gromm Date: Tue May 5 12:00:29 2020 +0200 staging: most: usb: consolidate code This patch applies the same look and feel when assigning local variables. Signed-off-by: Christian Gromm Link: https://lore.kernel.org/r/1588672829-28883-5-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 188d5b41f81f58f15b69d8958df19779f23be55c Author: Christian Gromm Date: Tue May 5 12:00:28 2020 +0200 staging: most: usb: drop unlikely macros This patch removes the unlikely macros in the error patch of argument checking, as it has no measurable performance adavantage. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1588672829-28883-4-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 441be56f894d5f31e0747c35bbfb4784aa3b958a Author: Christian Gromm Date: Tue May 5 12:00:27 2020 +0200 staging: most: usb: use EINVAL error code This patch replaces the error code EIO with EINVAL, when there is no IO happening. Signed-off-by: Christian Gromm Link: https://lore.kernel.org/r/1588672829-28883-3-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 3e8621aba71ad7b381699cf5119a779bc61e341d Author: Christian Gromm Date: Tue May 5 12:00:26 2020 +0200 staging: most: usb: remove overcautious parameter checking The interface pointer passed to a core API function cannot be NULL. This patch removes unnessecary the sanity check of the pointer. Signed-off-by: Christian Gromm Reported-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/1588672829-28883-2-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman commit 819482a96790d25fca97ec5c752400edbef05753 Author: Zou Wei Date: Thu Apr 23 11:18:03 2020 +0800 PCI: dwc: Make hisi_pcie_platform_ops static Fix the following sparse warning: drivers/pci/controller/dwc/pcie-hisi.c:365:21: warning: symbol 'hisi_pcie_platform_ops' was not declared. Should it be static? Link: https://lore.kernel.org/r/1587611883-26960-1-git-send-email-zou_wei@huawei.com Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Lorenzo Pieralisi Reviewed-by: Zhou Wang commit bf7116204657cabf6f74b5ade32424d04f480338 Author: Jiri Slaby Date: Mon Apr 20 08:52:27 2020 +0200 PCI: dwc: Clean up computing of msix_tbl Commit 6f5e193bfb55 ("PCI: dwc: Fix dw_pcie_ep_raise_msix_irq() to get correct MSI-X table address") overcomplicated the computation of the msix_tbl address. Simplify it as it's simply the addr + offset. Provided addr is (void *) already. objdump -d shows no difference after this patch. Link: https://lore.kernel.org/r/20200420065227.4920-1-jslaby@suse.cz Signed-off-by: Jiri Slaby Signed-off-by: Lorenzo Pieralisi Cc: Kishon Vijay Abraham I Cc: Lorenzo Pieralisi commit 054318c7e35f1d7d06b216143fff5f32405047ee Author: Imre Deak Date: Mon May 4 10:58:28 2020 +0300 drm/i915/tgl+: Fix interrupt handling for DP AUX transactions Unmask/enable AUX interrupts on all ports on TGL+. So far the interrupts worked only on port A, which meant each transaction on other ports took 10ms. Cc: # v5.4+ Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200504075828.20348-1-imre.deak@intel.com commit ca96088aa0de3400048093adb2fa13eb10569023 Author: Emmanuel Vadot Date: Thu Apr 30 17:33:46 2020 +0200 drm/client: Dual licence the header in GPL-2 and MIT Source file was dual licenced but the header was omitted, fix that. Contributors for this file are: Daniel Vetter Matt Roper Maxime Ripard Noralf Trønnes Thomas Zimmermann Acked-by: Noralf Trønnes Acked-by: Matt Roper Acked-by: Daniel Vetter Acked-by: Maxime Ripard Acked-by: Thomas Zimmermann Signed-off-by: Emmanuel Vadot Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200430153347.85323-1-manu@FreeBSD.org commit 9bcaa3fe58ab7559e71df798bcff6e0795158695 Author: Michal Orzel Date: Tue Apr 28 19:10:04 2020 +0200 drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers As suggested by the TODO list for the kernel DRM subsystem, replace the deprecated functions that take/drop modeset locks with new helpers. Signed-off-by: Michal Orzel Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1588093804-30446-1-git-send-email-michalorzel.eng@gmail.com commit ebcea694e69270f563e69d82bd9930905c954ef1 Author: Geert Uytterhoeven Date: Thu Apr 16 13:56:57 2020 +0200 arm64: Sort vendor-specific errata Sort configuration options for vendor-specific errata by vendor, to increase uniformity. Move ARM64_WORKAROUND_REPEAT_TLBI up, as it is also selected by ARM64_ERRATUM_1286807. Acked-by: Mark Rutland Acked-by: Arnd Bergmann Signed-off-by: Will Deacon commit 0b8d9fc9953fde4ea3eb3191d986ca2d01eb783c Author: Ard Biesheuvel Date: Tue May 5 10:27:18 2020 +0200 efi/libstub: Make efi_printk() input argument const char* To help the compiler figure out that efi_printk() will not modify the string it is given, make the input argument type const char*. While at it, simplify the implementation as well. Suggested-by: Joe Perches Signed-off-by: Ard Biesheuvel commit 8976eeee8de05f11eb424882a57084880b677525 Author: Neil Armstrong Date: Tue Apr 28 11:21:47 2020 +0200 drm/meson: add mode selection limits against specific SoC revisions The Amlogic S805X/Y uses the same die as the S905X, but with more limited graphics capabilities. This adds a soc version detection adding specific limitations on the HDMI mode selections. Here, we limit to HDMI 1.2a max HDMI PHY clock frequency. Changes sinces v1: - Moved frequency check in the vclk code, and also checks DMT modes Signed-off-by: Neil Armstrong Acked-by: Martin Blumenstingl [narmstrong: fixed commit message with HDMI 1.2a instead of HDMI 1.3a] Link: https://patchwork.freedesktop.org/patch/msgid/20200428092147.13698-1-narmstrong@baylibre.com commit 25fd6de315f43ecc89331c21682b1852a3bc4025 Author: Chris Wilson Date: Mon May 4 19:05:07 2020 +0100 drm/i915/gt: Small tidy of gen8+ breadcrumb emission Use a local to shrink a line under 80 columns, and refactor the common emit_xcs_breadcrumb() wrapper of ggtt-write. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200504180507.6017-1-chris@chris-wilson.co.uk commit 3c278a4749a8a0d1bf8e5235ca289748fdc48b11 Author: Linus Walleij Date: Thu Apr 30 17:02:45 2020 +0200 ARM: dts: ux500: samsung-skomer: Add magnetometer Add the ALPS magnetometer to the Skomer phone. Cc: Stephan Gerhold Cc: Nick Reitemeyer Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200430150245.7935-2-linus.walleij@linaro.org commit 521d6678b9a482058c78a9e6b2384ddc0c3c6392 Author: Nick Reitemeyer Date: Thu Apr 30 17:02:44 2020 +0200 ARM: dts: ux500: samsung-golden: Add magnetometer Add the ALPS magnetometer to the Golden phone. Cc: Stephan Gerhold Signed-off-by: Nick Reitemeyer Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200430150245.7935-1-linus.walleij@linaro.org commit f7ac582effc6ee416eb51e0c3e55836aaf7231ac Author: Thinh Nguyen Date: Sun Mar 29 16:13:16 2020 -0700 usb: dwc3: gadget: WARN on no-resource status If the driver issued START_TRANSFER and received a no-resource status, then generally there are a few reasons for this: 1) The driver did not allocate resource for the endpoint during power-on-reset initialization. 2) The transfer resource was reset. At this moment, we don't do this in the driver, but it occurs when the driver issues START_CONFIG cmd to ep0 with resource index=2. 3) The driver issues the START_TRANSFER command to an already started endpoint. Usually, this is because the END_TRANSFER command hasn't completed yet. Print out a warning to help debug this issue in the driver. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 36f05d36b03523da906cf2ae70ec31af6f57e94c Author: Thinh Nguyen Date: Sun Mar 29 16:13:10 2020 -0700 usb: dwc3: gadget: Issue END_TRANSFER to retry isoc transfer After a number of unsuccessful start isoc attempts due to bus-expiry status, issue END_TRANSFER command and retry on the next XferNotReady event. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 9bc3395c24962e8c8e4f590ca2740c56e4a7a4fe Author: Thinh Nguyen Date: Sun Mar 29 16:13:04 2020 -0700 usb: dwc3: gadget: Store resource index of start cmd As long as the START_TRANSFER command completes, it provides the resource index of the endpoint. Use this when we need to issue END_TRANSFER command to an isoc endpoint to retry with a new XferNotReady event. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 8d99087c2db863c5fa3a4a1f3cb82b3a493705ca Author: Thinh Nguyen Date: Sun Mar 29 16:12:57 2020 -0700 usb: dwc3: gadget: Properly handle failed kick_transfer If dwc3 fails to issue START_TRANSFER/UPDATE_TRANSFER command, then we should properly end an active transfer and give back all the started requests. However if it's for an isoc endpoint, the failure maybe due to bus-expiry status. In this case, don't give back the requests and wait for the next retry. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 8bb14308a86970a2321ac7d0e28ea0f1f1e744b0 Author: Thinh Nguyen Date: Sun Mar 29 17:10:05 2020 -0700 usb: dwc3: core: Use role-switch default dr_mode If the driver is configured to use DRD role-switch, let the drd code path decide the default dr_mode. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 8cc6d55bc20016cc6d81628713114bd807a1e661 Author: Thinh Nguyen Date: Sun Mar 29 17:09:59 2020 -0700 usb: dwc3: drd: Don't free non-existing irq If the driver is configured to use DRD role-switch, it's not OTG. There won't be OTG irq to free. Check for dwc->otg_irq before freeing it. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 31306821d87723d63f1be6908c7187719f282eff Author: Neil Armstrong Date: Thu Mar 26 14:44:58 2020 +0100 usb: dwc3: meson-g12a: refactor usb2 phy init Refactor the USB2 PHY init code patch to handle the Amlogic GXL/GXM not having the PHY mode control registers in the Glue but in the PHY registers. The Amlogic GXL/GXM will call phy_set_mode() instead of programming the PHY mode control registers, thus add two new callbacks to the SoC match data. Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 8f5bc1ec770c2bdc8c604ba4119a77d81d8f3529 Author: Neil Armstrong Date: Thu Mar 26 14:44:57 2020 +0100 usb: dwc3: meson-g12a: check return of dwc3_meson_g12a_usb_init The dwc3_meson_g12a_usb_init function can return an error, check it. Fixes: c99993376f72ca ("usb: dwc3: Add Amlogic G12A DWC3 glue") Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 6d9fa35a347a8789aefa8f4dc7aab9d006e8ed4e Author: Neil Armstrong Date: Thu Mar 26 14:44:56 2020 +0100 usb: dwc3: meson-g12a: get the reset as shared In order to support the Amlogic GXL/GXM SoCs, the reset line must be handled as shared since also used by the PHYs. Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 013af227f58a97ffc61b99301f8f4448dc7e7f55 Author: Neil Armstrong Date: Thu Mar 26 14:44:55 2020 +0100 usb: dwc3: meson-g12a: handle the phy and glue registers separately On the Amlogic GXL/GXM SoCs, only the USB control registers are available, the PHY mode being handled in the PHY registers. Thus, handle the PHY mode registers in separate regmaps and prepare support for Amlogic GXL/GXM SoCs by moving the regmap setup in a callback set in the SoC match data. Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 5174564cb9156a7c7b4d94a64c1cafdfd9a20403 Author: Neil Armstrong Date: Thu Mar 26 14:44:54 2020 +0100 usb: dwc3: meson-g12a: specify phy names in soc data To handle the variable USB2 PHY counts on GXL and GXM SoCs, add the possible PHY names for each SoC in the compatible match data. Reviewed-by: Martin Blumenstingl Acked-by: Hanjie Lin Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit 8f385b67555415cb01079a8ad3b1e16010c5005b Author: Neil Armstrong Date: Thu Mar 26 14:44:53 2020 +0100 dt-bindings: usb: amlogic,meson-g12a-usb-ctrl: add the Amlogic GXL and GXM Families USB Glue Bindings The Amlogic GXL and GXM is slightly different from the Amlogic G12A Glue. The GXL SoCs only embeds 2 USB2 PHYs and no USB3 PHYs, and the GXM SoCs embeds 3 USB2 PHYs. Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Felipe Balbi commit b88035625ec9594d4554a307e820aef4b759e35f Author: Sandeep Maheswaram Date: Thu Mar 26 12:36:08 2020 +0530 dt-bindings: usb: qcom,dwc3: Add compatible for SC7180 Add compatible for SC7180 in usb dwc3 bindings. Signed-off-by: Sandeep Maheswaram Reviewed-by: Douglas Anderson Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Felipe Balbi commit cd4b54e2ae1f47c72c004628788e84ffe7c71561 Author: Sandeep Maheswaram Date: Thu Mar 26 12:36:07 2020 +0530 dt-bindings: usb: qcom,dwc3: Convert USB DWC3 bindings Convert USB DWC3 bindings to DT schema format using json-schema. Signed-off-by: Sandeep Maheswaram Signed-off-by: Felipe Balbi commit fcd2def6639293c2bde2dc4f5dab63641a60b5b3 Author: Thinh Nguyen Date: Thu Mar 5 13:24:20 2020 -0800 usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue The flow from function dwc3_gadget_ep_dequeue() is not easy to follow. Refactor it for easier read. No functional change in this commit. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 8411993e79df8e54da67613025d620a8a23a24fe Author: Thinh Nguyen Date: Thu Mar 5 13:24:14 2020 -0800 usb: dwc3: gadget: Remove unnecessary checks Remove 2 unnecessary checks: 1) A request in the started_list must have its trb field set. So checking for req->trb is unnecessary. 2) An endpoint must have started (and have not ended) for the request to still be in the started_list. There's no point to check if the endpoint is started. We had this check because previously the driver didn't handle the endpoint's started/ended flags for END_TRANSFER command properly. See commit 9f45581f5eec ("usb: dwc3: gadget: early giveback if End Transfer already completed"). Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit a7027ca69d82ae10d9e5899b74e809e32d04d48b Author: Thinh Nguyen Date: Thu Mar 5 13:24:08 2020 -0800 usb: dwc3: gadget: Give back staled requests If a request is dequeued, the transfer is cancelled. Give back all the started requests. In most scenarios, the function driver dequeues all requests of a transfer when there's a failure. If the function driver follows this, then it's fine. If not, then we'd be skipping TRBs at different points within the dequeue and enqueue pointers, making dequeue/enqueue pointers useless. To enforce and make sure that we're properly skipping TRBs, cancel all the started requests and give back all the cancelled requests to the function drivers. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit cb11ea56f37a36288cdd0a4799a983ee3aa437dd Author: Thinh Nguyen Date: Thu Mar 5 13:23:55 2020 -0800 usb: dwc3: gadget: Properly handle ClearFeature(halt) DWC3 must not issue CLEAR_STALL command to control endpoints. The controller automatically clears the STALL when it receives the SETUP token. Also, when the driver receives ClearFeature(halt_ep), DWC3 must stop any active transfer from the endpoint and give back all the requests to the function drivers. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 3428b96f2f0d7a2c18d95478657d4aba5a0a331a Author: Tao Ren Date: Sun Mar 15 12:16:32 2020 -0700 dt-bindings: usb: document aspeed vhub device ID/string properties Update device tree binding document for aspeed vhub's device IDs and string properties. Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit 91786aa08750f80eb0db6986951b38094ea258ac Author: Tao Ren Date: Sun Mar 15 12:16:31 2020 -0700 usb: gadget: aspeed: fixup usb1 device descriptor at init time This patch moves patch-usb1-dev-desc logic from get-descriptor handler to "ast_vhub_fixup_usb1_dev_desc" function so the code is executed only once (at vhub initial time). Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit 2e596d8843d7f3151fecf3267d1754a88d7454d7 Author: Tao Ren Date: Sun Mar 15 12:16:30 2020 -0700 usb: gadget: aspeed: allow to set device IDs in device tree The patch overrides idVendor, idProduct and bcdDevice fields in vhub Device Descriptor if according device tree properties are defined. Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit 30d2617fd7ed052c30d1c21ddd4af4703d922be8 Author: Tao Ren Date: Sun Mar 15 12:16:29 2020 -0700 usb: gadget: aspeed: allow to set usb strings in device tree If "vhub,string-descriptor" device tree property is defined, the driver will load string descriptors from device tree; otherwise, the default string descriptors will be used. Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit 17309a6a43561bd7f4d4b51d7987225eb2b13d05 Author: Tao Ren Date: Sun Mar 15 12:16:28 2020 -0700 usb: gadget: add "usb_validate_langid" function The USB LANGID validation code in "check_user_usb_string" function is moved to "usb_validate_langid" function which can be used by other usb gadget drivers. Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit 5cc0710f23689455d40d590ebbcbcd21b0d84c77 Author: Tao Ren Date: Sun Mar 15 12:16:27 2020 -0700 usb: gadget: aspeed: support multiple language strings This patch introduces a link list to store string descriptors with different languages, and "ast_vhub_rep_string" function is also improved to support multiple language usb strings. Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit a23be4ed8f481000080df5221d9119b8bbc7e7c8 Author: Tao Ren Date: Sun Mar 15 12:14:30 2020 -0700 usb: gadget: aspeed: improve vhub port irq handling This patch evaluates vhub ports' irq mask before going through per-port irq handling one by one, which helps to speed up irq handling in case there is no port interrupt. Signed-off-by: Tao Ren Signed-off-by: Felipe Balbi commit c2cd3452d5f8b66d49a73138fba5baadd5b489bd Author: Martin Kepplinger Date: Thu Mar 19 11:02:07 2020 +0100 usb: dwc3: support continuous runtime PM with dual role The DRD module calls dwc3_set_mode() on role switches, i.e. when a device is being plugged in. In order to support continuous runtime power management when plugging in / unplugging a cable, we need to call pm_runtime_get_sync() in this path. Signed-off-by: Martin Kepplinger Signed-off-by: Felipe Balbi commit e2e77a94078bd4d459ac8267e7b24eece1e621db Author: kbuild test robot Date: Fri Mar 27 09:12:01 2020 +0800 usb: cdns3: mark local functions static Mark all local functions static to fix sparse warnings. Signed-off-by: kbuild test robot Signed-off-by: Felipe Balbi commit bdefa3ba92cad2efead4e6331fec4ddf5811f6ce Author: Nishad Kamdar Date: Sat Mar 28 15:18:32 2020 +0530 USB: dwc2: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to DesignWare USB2 DRD Core Support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Felipe Balbi commit b33f69f56352f61bba77f91b07318c5482562be8 Author: Nishad Kamdar Date: Sat Mar 28 15:34:46 2020 +0530 USB: dwc3: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to DesignWare USB3 DRD Core Support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Felipe Balbi commit 2e75973832abe0c5230fd40ca886d03dc975d1d3 Author: Nishad Kamdar Date: Sat Mar 28 16:41:15 2020 +0530 USB: gadget: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB peripheral controller drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Felipe Balbi commit 0b66fb3e6b7a53688f8e20945ac78cd3d832c65f Author: Arnd Bergmann Date: Tue Apr 28 23:53:29 2020 +0200 HID: intel-ish-hid: avoid bogus uninitialized-variable warning Older compilers like gcc-4.8 don't see that the variable is initialized when it is used: In file included from include/linux/compiler_types.h:68:0, from :0: drivers/hid/intel-ish-hid/ishtp-fw-loader.c: In function 'load_fw_from_host': include/linux/compiler-gcc.h:75:45: warning: 'fw_info.ldr_capability.max_dma_buf_size' may be used uninitialized in this function [-Wmaybe-uninitialized] #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^ drivers/hid/intel-ish-hid/ishtp-fw-loader.c:770:22: note: 'fw_info.ldr_capability.max_dma_buf_size' was declared here struct shim_fw_info fw_info; ^ Make sure to initialize it before returning an error from ish_query_loader_prop(). Fixes: 91b228107da3 ("HID: intel-ish-hid: ISH firmware loader client driver") Signed-off-by: Arnd Bergmann Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit e7f12054a1b9cbf6b4923427dec5eeb32f7ac388 Author: Lubomir Rintel Date: Fri Apr 24 23:35:39 2020 +0200 drm/bridge: chrontel-ch7033: Add a new driver This is a driver for video encoder with VGA and DVI/HDMI outputs. There is no documentation for the chip -- the operation was guessed from what was sniffed on a Dell Wyse 3020 ThinOS terminal, the register names come from the ch7035 driver in Mediatek's GPL code dump. Only bare minimum is implemented -- no fancy stuff, such as scaling. That would only worsen our misery. We don't load the firmware and we don't need to even bother enabling the MCU. There are probably no distributable firmware images anyway. Tested with a handful of monitors ranging from 1024x768@75 to 1400x1050@60, with VGA as well as DVI. Signed-off-by: Lubomir Rintel Acked-by: Sam Ravnborg Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20200424213539.93157-4-lkundrak@v3.sk commit a7e73070afe62bc6c88560f10a189d43a215aed2 Author: Lubomir Rintel Date: Fri Apr 24 23:35:38 2020 +0200 dt-bindings: display: Add Chrontel CH7033 Video Encoder binding Add binding document for the Chrontel CH7033 VGA/DVI/HDMI Encoder. Signed-off-by: Lubomir Rintel Reviewed-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20200424213539.93157-3-lkundrak@v3.sk commit 647f0d0ac1a6c5a8635464f1120e2cb5368a37cb Author: Lubomir Rintel Date: Fri Apr 24 23:35:37 2020 +0200 dt-bindings: Add vendor prefix for Chrontel, Inc. Chrontel makes encoders for video displays and perhaps other stuff. Their web site is http://www.chrontel.com/. Signed-off-by: Lubomir Rintel Acked-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20200424213539.93157-2-lkundrak@v3.sk commit 48ad3c4a334ad1e583f5159f43c3623ecaffc9f9 Author: Lad Prabhakar Date: Sun May 3 22:46:54 2020 +0100 ARM: dts: r8a7742-iwg21d-q7: Add iWave G21D-Q7 board based on RZ/G1H Add support for iWave RainboW-G21D-Qseven board based on RZ/G1H. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588542414-14826-11-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 269785eaba09172c5189e30d2202084586aeabdd Author: Lad Prabhakar Date: Sun May 3 22:46:53 2020 +0100 ARM: dts: r8a7742-iwg21m: Add iWave RZ/G1H Qseven SOM Add support for iWave RZ/G1H Qseven System On Module. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588542414-14826-10-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit eb4cdda7a30b3f9894fd5a58e0201fa57861183f Author: Lad Prabhakar Date: Sun May 3 22:46:50 2020 +0100 ARM: dts: r8a7742: Initial SoC device tree The initial R8A7742 SoC device tree including CPU[0-8], PMU, PFC, CPG, RST, SYSC, ICRAM[0-2], SCIFA2, MMC1, DMAC[0-1], GIC, PRR, timer and the required clock descriptions. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588542414-14826-7-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ca0762ee449737278ed44f0f766b50e025931abf Merge: cf8ae446bbcb 41b2df22fafb Author: Geert Uytterhoeven Date: Tue May 5 09:44:13 2020 +0200 Merge tag 'renesas-r8a7742-dt-binding-defs-tag' into renesas-arm-dt-for-v5.8 Renesas RZ/G1H DT Binding Definitions Clock and Power Domain definitions for the Renesas RZ/G1H (R8A7742) SoC, shared by driver and DT source files. commit 52f274b519939f5e306b26f2a3cf7c63ef45c203 Author: Sowmiya Sree Elavalagan Date: Mon May 4 17:15:55 2020 +0530 ath11k: fix resource unavailability for htt stats after peer stats display htt stats are not working after htt peer stats display and also after htt peer stats reset. Trying to dump htt stats shows "Resource temporarily unavailable". This is because of "ar->debug.htt_stats.stats_req" member is being consecutively used for all htt stats without being reset during the previous usage. Hence assigning NULL to this member after freeing the allocated memory fixes the issue. console logs below: # echo 9 >/sys/kernel/debug/ath11k/ipq8074/mac1/htt_stats_type # cat /sys/kernel/debug/ath11k/ipq8074/mac1/htt_stats_type 9 # cat /sys/kernel/debug/ath11k/ipq8074/mac1/htt_stats cat: can't open '/sys/kernel/debug/ath11k/ipq8074/mac1/htt_stats' : Resource temporarily unavailable Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588592755-10427-1-git-send-email-ssreeela@codeaurora.org commit b7b527b9c7c8d50737f45167d2d3399c7278d9e9 Author: Jason Yan Date: Mon May 4 19:33:36 2020 +0800 ath11k: use true,false for bool variables Fix the following coccicheck warning: drivers/net/wireless/ath/ath11k/dp_rx.c:2964:1-39: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/ath/ath11k/dp_rx.c:2965:1-38: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200504113336.41249-1-yanaijie@huawei.com commit 1423f43273319d53474c70f8f775c8c05e8b690e Author: Rakesh Pillai Date: Mon May 4 12:03:52 2020 +0300 ath10k: Add support for targets without trustzone Add the support to attach and map iommu domain for targets which do not have the support of TrustZone. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586971906-20985-4-git-send-email-pillair@codeaurora.org commit 727fec790ead3d75e2735f66209949c2163523ea Author: Rakesh Pillai Date: Mon May 4 12:03:45 2020 +0300 ath10k: Setup the msa resources before qmi init Move the msa resources setup out of qmi init and setup the msa resources as a part of probe before the qmi init is done. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586971906-20985-3-git-send-email-pillair@codeaurora.org commit 85325c24d5d2c8fcde35a634742d14d45bf7326e Author: Rakesh Pillai Date: Mon May 4 12:03:33 2020 +0300 dt-bindings: ath10k: Add wifi-firmware subnode for wifi node Add a wifi-firmware subnode for the wifi node. This wifi-firmware subnode is needed for the targets which do not support TrustZone. Signed-off-by: Rakesh Pillai Acked-by: Rob Herring Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586971906-20985-2-git-send-email-pillair@codeaurora.org commit d431f8939c1419854dfe89dd345387f5397c6edd Author: Wen Gong Date: Mon May 4 12:03:14 2020 +0300 ath10k: remove the max_sched_scan_reqs value The struct cfg80211_wowlan of NET_DETECT WoWLAN feature share the same struct cfg80211_sched_scan_request together with scheduled scan request feature, and max_sched_scan_reqs of wiphy is only used for sched scan, and ath10k does not support scheduled scan request feature, so ath10k does not set flag NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR, but ath10k set max_sched_scan_reqs of wiphy to a non zero value 1, then function nl80211_add_commands_unsplit of cfg80211 will set it support command NL80211_CMD_START_SCHED_SCAN because max_sched_scan_reqs is a non zero value, but actually ath10k not support it, then it leads a mismatch result for sched scan of cfg80211, then application shill found the mismatch and stop running case of MAC random address scan and then the case fail. After remove max_sched_scan_reqs value, it keeps match for sched scan and case of MAC random address scan pass. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029. Tested with QCA6174 PCIe with firmware WLAN.RM.4.4.1-00110-QCARMSWP-1. Fixes: ce834e280f2f875 ("ath10k: support NET_DETECT WoWLAN feature") Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20191114050001.4658-1-wgong@codeaurora.org commit 521fc37be3d879561ca5ab42d64719cf94116af0 Author: Maharaja Kennadyrajan Date: Mon May 4 12:03:13 2020 +0300 ath10k: Avoid override CE5 configuration for QCA99X0 chipsets As the exisiting CE configurations are defined in global, there are the chances of QCA99X0 family chipsets CE configurations are getting changed by the ath10k_pci_override_ce_config() function. The override will be hit and CE5 configurations will be changed, when the user bring up the QCA99X0 chipsets along with QCA6174 or QCA9377 chipset. (Bring up QCA99X0 family chipsets after QCA6174 or QCA9377). Hence, fixing this issue by moving the global CE configuration to radio specific CE configuration. Tested hardware: QCA9888 & QCA6174 Tested firmware: 10.4-3.10-00047 & WLAN.RM.4.4.1.c3-00058 Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587649759-14381-1-git-send-email-mkenna@codeaurora.org commit f77767ed5f4d398b29119563155e4ece2dfeee13 Author: Ard Biesheuvel Date: Mon May 4 10:06:29 2020 +0200 efi/libstub/x86: Work around LLVM ELF quirk build regression When building the x86 EFI stub with Clang, the libstub Makefile rules that manipulate the ELF object files may throw an error like: STUBCPY drivers/firmware/efi/libstub/efi-stub-helper.stub.o strip: drivers/firmware/efi/libstub/efi-stub-helper.stub.o: Failed to find link section for section 10 objcopy: drivers/firmware/efi/libstub/efi-stub-helper.stub.o: Failed to find link section for section 10 This is the result of a LLVM feature [0] where symbol references are stored in a LLVM specific .llvm_addrsig section in a non-transparent way, causing generic ELF tools such as strip or objcopy to choke on them. So force the compiler not to emit these sections, by passing the appropriate command line option. [0] https://sourceware.org/bugzilla/show_bug.cgi?id=23817 Cc: Nick Desaulniers Cc: Peter Collingbourne Cc: Sami Tolvanen Reported-by: Arnd Bergmann Suggested-by: Fangrui Song Signed-off-by: Ard Biesheuvel commit de8c55208c3865d0532466097b0244fbea1d9089 Author: Arvind Sankar Date: Mon May 4 11:02:48 2020 -0400 efi/libstub: Fix mixed mode boot issue after macro refactor Commit 22090f84bc3f ("efi/libstub: unify EFI call wrappers for non-x86") refactored the macros that are used to provide wrappers for mixed-mode calls on x86, allowing us to boot a 64-bit kernel on 32-bit firmware. Unfortunately, this broke mixed mode boot due to the fact that efi_is_native() is not a macro on x86. All of these macros should go together, so rather than testing each one to see if it is defined, condition the generic macro definitions on a new ARCH_HAS_EFISTUB_WRAPPERS, and remove the wrapper definitions on x86 as well if CONFIG_EFI_MIXED is not enabled. Fixes: 22090f84bc3f ("efi/libstub: unify EFI call wrappers for non-x86") Reported-by: Guenter Roeck Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200504150248.62482-1-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit fa4c8ec6feaa3237f5d44cb8c6d0aa0dff6e1bcc Author: Andrew Jeffery Date: Sat Apr 11 11:44:58 2020 +0930 ARM: dts: aspeed: Change KCS nodes to v2 binding Fixes the following warnings for both g5 and g6 SoCs: arch/arm/boot/dts/aspeed-g5.dtsi:376.19-381.8: Warning (unit_address_vs_reg): /ahb/apb/lpc@1e789000/lpc-bmc@0/kcs1@0: node has a unit name, but no reg property Signed-off-by: Andrew Jeffery Signed-off-by: Joel Stanley commit f90fe8d3b242aafe3cf1dd512bff83c704f70558 Author: Eddie James Date: Mon Apr 20 15:26:09 2020 -0500 ARM: dts: Aspeed: AST2600: Add XDMA PCI-E root control reset The AST2600 XDMA engine requires the PCI-E root control reset be cleared as well, so add a phandle to that syscon reset. Signed-off-by: Eddie James Signed-off-by: Joel Stanley commit e7d1ed849fd1660a9b113524461885a0ea1b199c Author: Eddie James Date: Wed Jan 15 15:29:48 2020 -0600 ARM: dts: aspeed: ast2600: Add XDMA Engine Add a node for the XDMA engine with all the necessary information. Signed-off-by: Eddie James Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 910f65c5561198147bac1d1606892d5790f94a9f Author: Eddie James Date: Wed Jan 15 15:29:47 2020 -0600 ARM: dts: aspeed: ast2500: Add XDMA Engine Add a node for the XDMA engine with all the necessary information. Signed-off-by: Eddie James Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 266056d3c61d64744d17bd31484c4c50913fece7 Author: Manikandan Elumalai Date: Thu Apr 2 19:41:35 2020 +0530 ARM: dts: aspeed: Adding Facebook Yosemite V2 BMC The Yosemite V2 is a facebook multi-node server platform that host four OCP server. The BMC in the Yosemite V2 platform based on AST2500 SoC. This patch adds linux device tree entry related to Yosemite V2 specific devices connected to BMC SoC. Signed-off-by: Manikandan Elumalai Acked-by: Andrew Jeffery Reviewed-by: Vijay Khemka Signed-off-by: Joel Stanley commit 697538bd65ad22a92598b5efded3666d3c59d1cc Author: Alexander Filippov Date: Wed Apr 29 14:37:11 2020 +0300 ARM: dts: aspeed: Add YADRO Nicole BMC Nicole is an OpenPower machine with an Aspeed 2500 BMC SoC manufactured by YADRO. Signed-off-by: Alexander Filippov Acked-by: Andrew Jeffery Reviewed-by: Patrick Williams Signed-off-by: Joel Stanley commit 6456bc88c90d50568ce3fd5b7d7f6971aa33f2bf Author: Ben Pai Date: Thu Apr 23 17:52:30 2020 +0800 ARM: dts: aspeed: mihawk: add aliases for i2c Set the bus id for each mux channel to avoid switching channels multiple times Signed-off-by: Ben Pai Signed-off-by: Joel Stanley commit 39d8a73c53a21c1e2c643889079652747cd744cd Author: Eddie James Date: Wed Feb 12 14:30:49 2020 -0600 ARM: dts: aspeed: tacoma: Add TPM Add the Nuvoton NPCT75X to the appropriate i2c bus. Signed-off-by: Eddie James Signed-off-by: Joel Stanley commit d2718f5e30d01d5dbc23c189bb670460093ba477 Author: Andrew Jeffery Date: Thu Apr 2 23:09:31 2020 +1030 ARM: dts: aspeed: tacoma: Enable the second VUART Used by some POWER hypervisors. Signed-off-by: Andrew Jeffery Signed-off-by: Joel Stanley commit bf6c99f3aeda127efe54b3d2ede2a98a815a90f6 Author: Eddie James Date: Mon Mar 30 16:14:30 2020 -0500 ARM: dts: aspeed: tacoma: Add iio-hwmon nodes for IIO devices Connect the BMP280 and DPS310 to the hwmon subsystem with iio-hwmon nodes. Signed-off-by: Eddie James Signed-off-by: Joel Stanley commit 3208f3a513393aa94c3eaef21c00bbfd003086e1 Author: Joel Stanley Date: Mon Mar 30 15:17:07 2020 +1030 ARM: dts: aspeed: rainier: Add VGA reserved memory region The BMC uses reserves the top 16MB of memory for the host to use for VGA or PCIe communication. Reviewed-by: Eddie James Signed-off-by: Joel Stanley commit e9b24b55ca4f140970b78d5e88ff2b1b9751692d Author: Andrew Geissler Date: Fri Apr 10 14:17:04 2020 -0500 ARM: dts: aspeed: rainier: Add gpio line names Name the GPIOs to help userspace work with them. The names describe the functionality the lines provide, not the net or ball name. This makes it easier to share userspace code across different systems and makes the use of the lines more obvious. Signed-off-by: Andrew Geissler Signed-off-by: Joel Stanley commit 2f68e4e7df6760956a1ae9e5a79fdb32106de52d Author: Joel Stanley Date: Tue Mar 24 21:47:11 2020 +1030 ARM: dts: aspeed: tacoma: Add gpio line names Add names for some of the GPIOs that are used in Tacoma. Signed-off-by: Joel Stanley commit fa09a28ca3e966582d6d92ef1536de360c8b194b Author: Andrew Geissler Date: Fri Mar 6 11:02:18 2020 -0600 ARM: dts: aspeed: zaius: Add gpio line names Name the GPIOs to help userspace work with them. The names describe the functionality the lines provide, not the net or ball name. This makes it easier to share userspace code across different systems and makes the use of the lines more obvious. Signed-off-by: Andrew Geissler Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 1f2c9d31e4806177aa97819d4ddc83dacd437ba2 Author: Andrew Geissler Date: Fri Mar 6 11:02:17 2020 -0600 ARM: dts: aspeed: romulus: Add gpio line names Name the GPIOs to help userspace work with them. The names describe the functionality the lines provide, not the net or ball name. This makes it easier to share userspace code across different systems and makes the use of the lines more obvious. Signed-off-by: Andrew Geissler Signed-off-by: Joel Stanley commit d5ece55c1874a6f29bf610f593e2bdf14a477ff2 Author: Andrew Geissler Date: Thu Feb 6 11:02:34 2020 -0600 ARM: dts: aspeed: witherspoon: Add gpio line names Name the GPIOs to help userspace work with them. The names describe the functionality the lines provide, not the net or ball name. This makes it easier to share userspace code across different systems and makes the use of the lines more obvious. Signed-off-by: Andrew Geissler Reviewed-by: Joel Stanley Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit c998f40f2ae6a48e93206e2c1ea0691479989611 Author: Eddie James Date: Thu Mar 26 09:17:21 2020 -0500 ARM: dts: aspeed: ast2600: Set arch timer always-on According to ASPEED, FTTMR010 is not intended to be used in the AST2600. The arch timer should be used, but Linux doesn't enable high-res timers without being assured that the arch timer is always on, so set that property in the devicetree. The FTTMR010 device is described by set to disabled. This fixes highres timer support for AST2600. Fixes: 2ca5646b5c2f ("ARM: dts: aspeed: Add AST2600 and EVB") Signed-off-by: Eddie James Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley commit 977f7e0028f1689f93d7f8d793831c4594d50c96 Author: Joel Stanley Date: Tue Mar 24 16:31:06 2020 +1030 ARM: dts: aspeed: tacoma: Add GPIOs for FSI GPIO Q7 is no longer used for air/water. It is repurposed on Tacoma to indicate internal FSI (low) vs cabled (high). GPIO B0 controls the muxing of FSI to the cable (low) or internal pins (high). Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit c87f739459cc5f1f7fb11f2b4fac567c72b56001 Author: Ben Pai Date: Thu Feb 20 13:52:55 2020 +0800 ARM: dts: aspeed: mihawk: Change the name of leds Change the name of power, fault and rear-id. Remove the two leds. Signed-off-by: Ben Pai Signed-off-by: Joel Stanley commit fbb6f3e068ecf9247773a5d4604034a2abefa816 Author: Matthew Barth Date: Thu Jan 16 09:46:38 2020 -0600 ARM: dts: aspeed: rainier: Remove regulators Regulators will be dynamically configured and monitored from userspace. Signed-off-by: Matthew Barth Reviewed-by: Eddie James Reviewed-by: Jim Wright Signed-off-by: Joel Stanley commit 156fbb12f11e3e9a6416d746281a50e72bab0533 Author: Joel Stanley Date: Tue Dec 24 00:35:54 2019 +1100 ARM: dts: aspeed: rainier: Add host FSI description This adds the description of the Power CPUs that are attached to the BMC. Without this userspace will see the '/dev/scom66' style layout. Reviewed-by: Eddie James Signed-off-by: Joel Stanley commit b2fa526ca27849adb6f6aab5caf505e4dbb93b97 Author: Joel Stanley Date: Thu Aug 22 20:35:24 2019 +0930 ARM: dts: aspeed: ast2600evb: Enable FSI master Use the first FSI master. Signed-off-by: Joel Stanley commit d0ba4f581ed52b5d88726c9f1d7fae19eec22479 Author: Eddie James Date: Thu Oct 3 17:24:14 2019 -0500 ARM: dts: aspeed: tacoma: Add gpio-key definitions Add gpio-keys for various signals on Tacoma. Signed-off-by: Eddie James Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 3ad7e45820d0d142161a3d811d659b8c2eb27736 Author: Matthew Barth Date: Tue Feb 25 14:14:15 2020 -0600 ARM: dts: aspeed: rainier: Set PCA9552 pin types All 16 pins of the PCA9552 at 7-bit address 0x61 should be set as type GPIO. Signed-off-by: Matthew Barth Signed-off-by: Joel Stanley commit b19dad68c97ea7de12f8c6367f7cdfcb2cddacb2 Author: Andrew Jeffery Date: Tue Feb 18 22:00:52 2020 +1030 ARM: dts: aspeed: rainier: Enable VUART2 The second VUART is used to expose multiplexed, non-hypervisor consoles. Signed-off-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 4aca6812d25c685934abbf9c02828bedeab903a8 Author: Alexander Filippov Date: Thu May 30 12:35:44 2019 +0300 ARM: dts: aspeed: ast2400: Add video engine support Add a node to describe the video engine on AST2400. These changes were copied from aspeed-g5.dtsi Signed-off-by: Alexander Filippov Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 7f9dad6bdc34782c48935f2108def0ad4eb396a9 Author: Guenter Roeck Date: Sun Feb 2 08:39:39 2020 -0800 ARM: dts: aspeed: tacoma: Enable eMMC controller Enabling emmc without enabling its controller doesn't do any good. Enable its controller as well to make it work. Cc: Andrew Jeffery Cc: Joel Stanley Signed-off-by: Guenter Roeck Signed-off-by: Joel Stanley commit d85fa6c6f337e768f25ba362e5d2ebb7769ac8c1 Author: Vijay Khemka Date: Mon Jan 27 17:18:17 2020 -0800 ARM: dts: aspeed: tiogapass: Add gpio line names Added GPIO line names for all gpio used in tiogapass platform, these line names will be used by libgpiod to control GPIOs Signed-off-by: Vijay Khemka Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley commit 3dcfff96f17a8e8a9a346f0beff10d75e7ca8edb Author: Vijay Khemka Date: Mon Jan 27 17:17:28 2020 -0800 ARM: dts: aspeed: tiogapass: Add IPMB device Adding IPMB devices for facebook tiogapass platform. Signed-off-by: Vijay Khemka Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley commit bcee38919fa0ae47c4a80ffc7ee751039fe159bf Author: Jae Hyun Yoo Date: Mon Jan 6 17:15:01 2020 -0800 ARM: dts: aspeed: ast2600: Add Video Engine node The AST2600 has Video Engine so add it. Signed-off-by: Jae Hyun Yoo Acked-by: Joel Stanley Signed-off-by: Joel Stanley commit a8d9d7da1546349f18eb2d6b6b3a04bdeb38719d Author: Tomi Valkeinen Date: Wed Apr 29 15:10:22 2020 +0300 drm/tidss: remove AM65x PG1 YUV erratum code AM65x PG1 has a HW issue with YUV pixel formats, resulting in wrong colors on the screen. This issue is fixed in PG2 hardware. The driver currently has code to hide YUV pixel formats from the userspace. To support PG2, we would need to add code to detect the SoC version and hide the YUV formats based on that. However, as PG1 will be phased out and PG2 will be the main platform, a much simpler solution is just to drop the code in question. The downside is that the users will be able to use YUV formats on PG1, getting wrong colors on the screen. On the other hand, that may also be a plus, as the same applications will now work on PG1 and PG2, even if the colors are wrong on PG1. Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200429121022.3871-1-tomi.valkeinen@ti.com Reviewed-by: Jyri Sarha commit 8c11827bba724046fec50a1f16a205bbea3eeb08 Author: Kai-Heng Feng Date: Tue May 5 11:03:53 2020 +0800 ALSA: hda: Use hdac_to_hda_codec macro Use hdac_to_hda_codec() instead of container_of(). No functional change intended. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200505030357.28004-2-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit 9cd39de4db54062ad60f8004362c293c0c950456 Author: Tomi Valkeinen Date: Fri Apr 17 14:41:51 2020 +0300 drm/omap: change default signal polarities and drives If the given videomode does not specify DISPLAY_FLAG_* for the specific signal property, the driver used a default value. These defaults were never thought through, as the expectation was that all the DISPLAY_FLAGS are always set explicitly. With DRM bridge and panel drivers this is not the case, and while that issue should be resolved in the future, it's still good to have sane signal defaults. This patch changes the defaults to what the hardware has as reset defaults. Also, based on my experience, I think they make sense and are more likely correct than the defaults without this patch. Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200417114151.25843-1-tomi.valkeinen@ti.com Reviewed-by: Laurent Pinchart commit 50f0bf550f835f0a4251fa99894db09234c12075 Author: Kai-Heng Feng Date: Tue May 5 11:03:52 2020 +0800 ALSA: hda: Use dev_to_hdac_dev macro Use dev_to_hdac_dev() instead of container_of(). No functional change intended. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200505030357.28004-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit f9950ad272051374f15c559ce71934bdfa072ebd Author: Eddie James Date: Wed Jan 15 15:29:42 2020 -0600 ARM: dts: aspeed: ast2600: Add SCU interrupt controllers Add nodes for the interrupt controllers provided by the SCU. Signed-off-by: Eddie James Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit d1f3f68f55ca6f63e21aee097e075c9163d6e5a3 Author: Eddie James Date: Wed Jan 15 15:29:41 2020 -0600 ARM: dts: aspeed: ast2500: Add SCU interrupt controller Add a node for the interrupt controller provided by the SCU. Signed-off-by: Eddie James Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 78c2aac2a086d5853204136a17c170667a867610 Author: Wesley Cheng Date: Mon May 4 16:54:27 2020 -0700 phy: qcom-qmp: Rename UFS PCS QMP v4 registers The UFS QMP v4 PHY has a largely different register set versus USB and PCIe. Rename the register offsets to denote that the value is specific for the UFS PCS register. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1588636467-23409-6-git-send-email-wcheng@codeaurora.org Signed-off-by: Vinod Koul commit e4d8b05ad5f9db85ef7285dbf51a1ad357f4e4c8 Author: Wesley Cheng Date: Mon May 4 16:54:26 2020 -0700 phy: qcom-qmp: Use proper PWRDOWN offset for sm8150 USB The register map for SM8150 QMP USB SSPHY has moved QPHY_POWER_DOWN_CONTROL to a different offset. Allow for an offset in the register table to override default value if it is a DP capable PHY. Signed-off-by: Wesley Cheng Reviewed-by: Manu Gautam Link: https://lore.kernel.org/r/1588636467-23409-5-git-send-email-wcheng@codeaurora.org Signed-off-by: Vinod Koul commit 9a24b929d38ad3a3ce8615769b0323c4832f4c07 Author: Jack Pham Date: Mon May 4 16:54:25 2020 -0700 phy: qcom-qmp: Add SM8150 QMP USB3 PHY support Add support for SM8150 QMP USB3 PHY with the necessary initialization sequences as well as additional QMP V4 register definitions. Signed-off-by: Jack Pham Signed-off-by: Wesley Cheng Reviewed-by: Manu Gautam Link: https://lore.kernel.org/r/1588636467-23409-4-git-send-email-wcheng@codeaurora.org Signed-off-by: Vinod Koul commit 51e8114f80d07663e38668a53b12eebbc91abd7f Author: Wesley Cheng Date: Mon May 4 16:54:24 2020 -0700 phy: qcom-snps: Add SNPS USB PHY driver for QCOM based SOCs This adds the SNPS FemtoPHY V2 driver used in QCOM SOCs. There are potentially multiple instances of this UTMI PHY on the SOC, all which can utilize this driver. The V2 driver will have a different register map compared to V1. Signed-off-by: Wesley Cheng Reviewed-by: Philipp Zabel Reviewed-by: Manu Gautam Reviewed-by: Vinod Koul Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1588636467-23409-3-git-send-email-wcheng@codeaurora.org Signed-off-by: Vinod Koul commit f06b9fc9a8140483592c072061dc279cdaf96095 Author: Wesley Cheng Date: Mon May 4 16:54:23 2020 -0700 dt-bindings: phy: Add binding for qcom,usb-snps-femto-v2 This binding shows the descriptions and properties for the Synopsis Femto USB PHY V2 used on QCOM platforms. Signed-off-by: Wesley Cheng Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1588636467-23409-2-git-send-email-wcheng@codeaurora.org Signed-off-by: Vinod Koul commit 64e14ece07004f0bf434fe7aad4a6d6411b1d9b6 Author: Damien Le Moal Date: Wed Apr 22 19:42:21 2020 +0900 scsi: scsi_debug: Implement ZBC host-aware emulation Implement ZBC host-aware device model emulation. The main changes from the host-managed emulation are the device type (TYPE_DISK is used), relaxation of access checks for read and write operations and different handling of a sequential write preferred zone write pointer as mandated by the ZBC r05 specifications. To facilitate the implementation and avoid a lot of "if" statement, the zmodel field is added to the device information and the z_type field to the zone state data structure. Link: https://lore.kernel.org/r/20200422104221.378203-8-damien.lemoal@wdc.com Tested-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 98e0a689868c26eb82650ee759073f2295e74c97 Author: Damien Le Moal Date: Wed Apr 22 19:42:20 2020 +0900 scsi: scsi_debug: Add zone_size_mb module parameter Add the zone_size_mb module parameters to control the zone size of a ZBC device. If the zone size specified is not a divisor of the device capacity, the last zone of the device will be created as a smaller "runt" zone. This parameter is ignored for device types other than 0x14 (zbc=2 case). Note: for testing purposes, zone sizes that are not a power of 2 are accepted but will result in the drive being rejected by the sd driver. Link: https://lore.kernel.org/r/20200422104221.378203-7-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit aa8fecf96b704adfd2ee2b6c76248c1f1cb237ef Author: Damien Le Moal Date: Wed Apr 22 19:42:19 2020 +0900 scsi: scsi_debug: Add zone_nr_conv module parameter Allow controlling the number of conventional zones of a ZBC device with the new zone_nr_conv module parameter. The default value is 1 and the specified value must be less than the total number of zones of the device. This parameter is ignored for device types other than 0x14 (zbc=2 case). Link: https://lore.kernel.org/r/20200422104221.378203-6-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 380603a5bb83d3c55eee20511ba3091e206b7d99 Author: Damien Le Moal Date: Wed Apr 22 19:42:18 2020 +0900 scsi: scsi_debug: Add zone_max_open module parameter Add the zone_max_open module parameters to control the maximum number of open zones of a ZBC device. This parameter is ignored for device types other than 0x14 (zbc=2 case). Link: https://lore.kernel.org/r/20200422104221.378203-5-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 9267e0eb41fedc2d4b930a90aca17051fa1ef21a Author: Douglas Gilbert Date: Wed Apr 22 19:42:17 2020 +0900 scsi: scsi_debug: Add ZBC module parameter Add the zbc module parameter to take either: 0: none (probably a conventional disk) 1: host-aware 2: host-managed These values are chosen to match 'enum blk_zoned_model' found in include/linux/blkdev.h . Instead of "none", "no" or "0" can be given. Instead of "host-aware", "aware or "1" can be given. Instead of "host-managed", "managed" or "2" can be given. Note: the zbc parameter can only be given at driver/module load time; it cannot be changed via sysfs thereafter. At this time there is no ZBC "host-aware" implementation so that string (or the value '1') results in a modprobe error. Link: https://lore.kernel.org/r/20200422104221.378203-4-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit f0d1cf9378bd4030725efa4c154cd39383dd0c12 Author: Douglas Gilbert Date: Wed Apr 22 19:42:16 2020 +0900 scsi: scsi_debug: Add ZBC zone commands Add support for the 5 ZBC commands and enough functionality to emulate a host-managed device with one conventional zone and a set of sequential write-required zones up to the disk capacity. Link: https://lore.kernel.org/r/20200422104221.378203-3-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit d36da3058ced5fc1513df60dc4c4716280c59267 Author: Douglas Gilbert Date: Wed Apr 22 19:42:15 2020 +0900 scsi: scsi_debug: Add ZBC mode and VPD pages The ZBC standard "piggy-backs" on many, but not all, of the facilities in SBC. Add those ZBC mode pages (plus mode parameter block descriptors (e.g. "WP")) and VPD pages in common with SBC. Add ZBC specific VPD page for the host-managed ZBC device type (ptype=0x14). Link: https://lore.kernel.org/r/20200422104221.378203-2-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit f48f4fd9fefb1e3a2f6bc249aef88f951be58e17 Author: Pierre-Louis Bossart Date: Mon Apr 20 02:51:17 2020 +0800 soundwire: bus: reduce verbosity on enumeration No need to repeat the same info log on all enumerations (essentially each power-up), keep it as debug information. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200419185117.4233-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 88ac86f252511d6d6e8a71c79957222db0389114 Author: Pierre-Louis Bossart Date: Mon Apr 20 02:51:16 2020 +0800 soundwire: debugfs: clarify SDPX license with GPL-2.0-only Follow recommendation to use GPL-2.0-only Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200419185117.4233-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 8893ab5e8ee5d7c12e0fc1dca4a309475064473d Author: Pierre-Louis Bossart Date: Mon Apr 20 02:51:15 2020 +0800 soundwire: slave: don't init debugfs on device registration error The error handling flow seems incorrect, there is no reason to try and add debugfs support if the device registration did not succeed. Return on error. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200419185117.4233-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 01de995075b20f58a77f408cdf49034682487429 Author: Pierre-Louis Bossart Date: Mon Apr 20 02:51:14 2020 +0800 Documentation: SoundWire: clarify TDM mode support The current description of stream topologies does not explicitly mention 'mirror' topologies used for audio amplifiers, where all amplifiers see the same data and generate a different output based on configuration or dynamic information. Add examples and notes to explain how channels can be transmitted and mapped. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20200419185117.4233-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 91b5cfc0209b63b6750bed496c4fe24eb2f48f58 Author: Pierre-Louis Bossart Date: Thu Apr 30 02:50:57 2020 +0800 soundwire: qcom: fix error handling in probe Make sure all error cases are properly handled and all resources freed. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200429185057.12810-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 48e3bf1631ea3227ba2e16684df18e6843af84c1 Author: Douglas Gilbert Date: Tue Apr 21 11:14:24 2020 -0400 scsi: scsi_debug: Bump to version 1.89 The scsi_debug driver version is visible in: /sys/modules/scsi_debug/version and can thus be used by user space programs to alter the features they try to use. Since the per_host_store and zbc/zone options are significant additions, bump the version number to 1.89 . Link: https://lore.kernel.org/r/20200421151424.32668-9-dgilbert@interlog.com Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 5d80707673581f95506cb2457354705ea4b51c46 Author: Douglas Gilbert Date: Tue Apr 21 11:14:23 2020 -0400 scsi: scsi_debug: Re-arrange parameters alphabetically This module has a lot of parameters and when searching for one, the author prefers them in alphabetical order. This can lead to somewhat illogical ordering (e.g. inq_product before inq_vendor). However it is not clear what another sensible total logical ordering would be. Link: https://lore.kernel.org/r/20200421151424.32668-8-dgilbert@interlog.com Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit ed9f3e2513f91553cc7197e8739a38a9bdea5303 Author: Douglas Gilbert Date: Tue Apr 21 11:14:22 2020 -0400 scsi: scsi_debug: Implement PRE-FETCH commands Many disks implement the SCSI PRE-FETCH commands. One use case might be a disk-to-disk compare, say between disks A and B. Then this sequence of commands might be used: PRE-FETCH(from B, IMMED), READ(from A), VERIFY (BYTCHK=1 on B with data returned from READ). The PRE-FETCH (which returns quickly due to the IMMED) fetches the data from the media into B's cache which should speed the trailing VERIFY command. The next chunk of the compare might be done in parallel, with A and B reversed. The implementation tries to bring the specified range in main memory into the cache(s) associated with this machine's CPU(s) using the prefetch_range() function. Link: https://lore.kernel.org/r/20200421151424.32668-7-dgilbert@interlog.com Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit a2aede970a8e12cadb8be779066cd64e6dd37e82 Author: Douglas Gilbert Date: Tue Apr 21 11:14:21 2020 -0400 scsi: scsi_debug: Improve command duration calculation Previously the code did the work implied by the given SCSI command and after that it waited for a timer based on the user specified command duration to be exhausted before informing the mid-level that the command was complete. For short command durations, the time to complete the work implied by the SCSI command could be significant compared to the user specified command duration. For example a WRITE of 128 blocks (say 512 bytes each) on a machine that can copy from main memory to main memory at a rate of 10 GB/sec will take around 6.4 microseconds to do that copy. If the user specified a command duration of 5 microseconds (ndelay=5000), should the driver do a further delay of 5 microseconds after the copy or return immediately because 6.4 > 5 ? The action prior to this patch was to always do the timer based delay. After this patch, for ndelay values less than 1 millisecond, this driver will complete the command immediately. And in the case where the user specified delay was 7 microseconds, a timer delay of 600 nanoseconds will be set ((7 - 6.4) * 1000). Link: https://lore.kernel.org/r/20200421151424.32668-6-dgilbert@interlog.com Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 67da413f26afc7522250bf5c9231f6711a9e7dfd Author: Douglas Gilbert Date: Tue Apr 21 11:14:20 2020 -0400 scsi: scsi_debug: Weaken rwlock around ramdisk access The design of this driver is to do any ramdisk access on the same thread that invoked the queuecommand() call. That is assumed to be user space context. The command duration is implemented by setting the delay with a high resolution timer. The hr timer's callback may well be in interrupt context, but it doesn't touch the ramdisk. So try removing the _irqsave()/_irqrestore() portion on the read-write lock that protects ramdisk access. Link: https://lore.kernel.org/r/20200421151424.32668-5-dgilbert@interlog.com Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit c3e2fe9222d428f115baeba2f6b3637b3aa444cd Author: Douglas Gilbert Date: Tue Apr 21 11:14:19 2020 -0400 scsi: scsi_debug: Implement VERIFY(10), add VERIFY(16) With the addition of the per_host_store option, the ability to check whether two different ramdisk images are the same or not becomes practical. Prior to this patch VERIFY(10) always returned true (i.e. the SCSI GOOD status) without checking. This option adds support for BYTCHK equal to 0, 1 and 3. If the comparison fails, then a sense key of MISCOMPARE is returned as per the T10 standards. Also add support for the VERIFY(16) command. Link: https://lore.kernel.org/r/20200421151424.32668-4-dgilbert@interlog.com Reviewed-by: Hannes Reinecke Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 87c715dcde633f4cc4690a24a240e838181e6a9d Author: Douglas Gilbert Date: Tue Apr 21 11:14:18 2020 -0400 scsi: scsi_debug: Add per_host_store option The scsi_debug driver has always been restricted to using one ramdisk image (or none) for its storage. This means that thousands of scsi_debug devices can be created without exhausting the host machine's RAM. The downside is that all scsi_debug devices share the same ramdisk image. This option changes the way a following write to the add_host parameter (or an add_host in the module/driver invocation) operates. For each new host that is created while per_host_store is true, a new store (of dev-size_mb MiB) is created and associated with all the LUs that belong to that new host. The user (who will need root permissions) needs to take care not to exhaust all the machine's available RAM. One reason for doing this is to check that (partial) disk to disk copies based on scsi_debug devices have actually copied accurately. To test this the add_host= parameter where is 2 or greater can be used when the scsi_debug module is loaded. Let us assume that /dev/sdb and /dev/sg1 are the same scsi_debug device, while /dev/sdc and /dev/sg2 are the same scsi_debug device. With per_host_store=1 add_host=2 they will have different ramdisk images. Then the following pseudocode could be executed to check if the sgh_dd copy worked: dd if=/dev/urandom of=/dev/sdb sgh_dd if=/dev/sg1 of=/dev/sg2 [plus option(s) to test] cmp /dev/sdb /dev/sdc If the cmp fails then the copy has failed (or some other mechanism wrote to /dev/sdb or /dev/sdc in the interim). [mkp: use kstrtobool()] Link: https://lore.kernel.org/r/20200421151424.32668-3-dgilbert@interlog.com Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 0c4bc91d664953780990b0d1d8d1a65f9256474d Author: Douglas Gilbert Date: Tue Apr 21 11:14:17 2020 -0400 scsi: scsi_debug: Randomize command completion time Add a new command line option (e.g. random=1) and sysfs attribute that causes subsequent command completion times to be between the current command delay setting and 0. A uniformly distributed 32 bit, kernel provided integer is used for this purpose. Since the existing 'delay' whose units are jiffies (typically milliseconds) and 'ndelay' (units: nanoseconds) options (and sysfs attributes) span a range greater than 32 bits, some scaling is required. The purpose of this patch is to widen the range of testing cases that are visited in long running tests. Put simply: rarely struct race conditions are more likely to be found when this facility is used. The default is the previous case in which all command completions were roughly equal to (if not, slightly longer) than the value given by the 'delay' or 'ndelay' settings (or their defaults). This option's default is equivalent to setting 'random=0' . [mkp: use kstrtobool()] Link: https://lore.kernel.org/r/20200421151424.32668-2-dgilbert@interlog.com Reviewed-by: Hannes Reinecke Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit e7728fcf7dd7955dae7e6e9a14ab5faa392b8605 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:26 2020 +0200 docs: dt: convert writing-bindings.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Mark literal blocks as such; - Add it to bindings/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit 858e6845654d922c50a9c994d2c4e0412318545c Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:25 2020 +0200 docs: dt: convert submitting-patches.txt to ReST format - Add a SPDX header; - Adjust document and section titles; - Mark literal blocks as such; - Add it to bindings/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit 56516a9fe1058c15af2de98418758c6c30f3cdf1 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:24 2020 +0200 docs: dt: convert ABI.txt to ReST format This file only requires a properly-formatted title to be recognized as a ReST file. As there will be more files under bindings/ that will be included at the documentation body, add a new index.rst file there. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit 642e6e5ce03e5b02d658e87d6c21d881b1ce8f62 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:22 2020 +0200 docs: dt: convert overlay-notes.txt to ReST format - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to devicetree/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit 218e1b3d10f1face9f1684f713346072fea3d3ec Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:21 2020 +0200 docs: dt: convert of_unittest.txt to ReST - Add a SPDX header; - Adjust document and section titles; - Adjust numerated list markups; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to devicetree/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit 26853a242057b8c09f51726b54a79aff3fec874a Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:20 2020 +0200 docs: dt: convert dynamic-resolution-notes.txt to ReST - Add a SPDX header; - Adjust document title; - Add it to devicetree/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit afb6120519ae26272946cb4566de5b25fc4f74e0 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:19 2020 +0200 docs: dt: convert changesets to ReST - Add a SPDX header; - Add a document title; - Some whitespace fixes and new line breaks; - Add it to devicetree/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit b91a770a696ca96a0b8bce9dd39e4f17f2f1d759 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:17 2020 +0200 docs: dt: usage_model.rst: fix link for DT usage The devicetree.org doesn't host the Device_Tree_Usage page anymore. So, fix the link to point to a new address. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit d8e81bc3e87c9e7994f5bf24e215a607899ca470 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:16 2020 +0200 docs: dt: convert usage-model.txt to ReST - Add a SPDX header; - Adjust document title; - Use footnoote markups; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to devicetree/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: Lee Jones Signed-off-by: Rob Herring commit 4ef7f57ebe6e9c59d14262921f2b9016c4264b23 Author: Mauro Carvalho Chehab Date: Wed Apr 15 16:45:15 2020 +0200 docs: dt: add an index.rst file for devicetree There are some device tree documentation under Documentation/devicetree. Add a top index file for it and add the already-existing ReST file on it. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring commit bbb7ad49b8350b79261ce087c8e101d92f15533d Author: Enric Balletbo i Serra Date: Tue Apr 14 22:12:39 2020 +0200 platform/chrome: cros_usbpd_logger: Add __printf annotation to append_str() This allows the compiler to verify the format strings vs the types of the arguments. Also, silence the warning (triggered by W=1): cros_usbpd_logger.c:55:2: warning: function ‘append_str’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] Signed-off-by: Enric Balletbo i Serra Signed-off-by: Benson Leung commit c032699ef9d59bf9f953e3bff2eed45839dbbf71 Author: Enric Balletbo i Serra Date: Tue Apr 14 22:13:13 2020 +0200 platform/chrome: cros_ec_i2c: Appease the kernel-doc deity Replace a comment starting with /** by simply /* to avoid having it interpreted as a kernel-doc comment. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Benson Leung commit 9ae8578b517a50905adf1d6a00bc02c676710e74 Author: Frank Rowand Date: Mon Jan 27 18:37:18 2020 -0600 of: Documentation: change overlay example to use current syntax The overlay implementation details in the compiled (DTB) file are now properly implemented by the dtc compiler and should no longer be hard coded in the source file. Signed-off-by: Frank Rowand Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit 07bf2d97d1f37e7ac8d7be2d84ff108d43556a1d Author: Magnus Karlsson Date: Mon May 4 15:33:52 2020 +0200 xsk: Remove unnecessary member in xdp_umem Remove the unnecessary member of address in struct xdp_umem as it is only used during the umem registration. No need to carry this around as it is not used during run-time nor when unregistering the umem. Signed-off-by: Magnus Karlsson Signed-off-by: Daniel Borkmann Acked-by: Jonathan Lemon Link: https://lore.kernel.org/bpf/1588599232-24897-3-git-send-email-magnus.karlsson@intel.com commit e4e5aefc113510c03d34e182ab30bc0cc196675c Author: Magnus Karlsson Date: Mon May 4 15:33:51 2020 +0200 xsk: Change two variable names for increased clarity Change two variables names so that it is clearer what they represent. The first one is xsk_list that in fact only contains the list of AF_XDP sockets with a Tx component. Change this to xsk_tx_list for improved clarity. The second variable is size in the ring structure. One might think that this is the size of the ring, but it is in fact the size of the umem, copied into the ring structure to improve performance. Rename this variable umem_size to avoid any confusion. Signed-off-by: Magnus Karlsson Signed-off-by: Daniel Borkmann Acked-by: Jonathan Lemon Link: https://lore.kernel.org/bpf/1588599232-24897-2-git-send-email-magnus.karlsson@intel.com commit d26c0cc53950464a24adfa76867f1d71f0cbbea6 Author: Arnd Bergmann Date: Thu Apr 30 23:30:47 2020 +0200 bpf: Avoid gcc-10 stringop-overflow warning in struct bpf_prog gcc-10 warns about accesses to zero-length arrays: kernel/bpf/core.c: In function 'bpf_patch_insn_single': cc1: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=] In file included from kernel/bpf/core.c:21: include/linux/filter.h:550:20: note: at offset 0 to object 'insnsi' with size 0 declared here 550 | struct bpf_insn insnsi[0]; | ^~~~~~ In this case, we really want to have two flexible-array members, but that is not possible. Removing the union to make insnsi a flexible-array member while leaving insns as a zero-length array fixes the warning, as nothing writes to the other one in that way. This trick only works on linux-3.18 or higher, as older versions had additional members in the union. Fixes: 60a3b2253c41 ("net: bpf: make eBPF interpreter images read-only") Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200430213101.135134-6-arnd@arndb.de commit 42470eec8552e51e98fe89742bd95cc732aac28f Author: David Lu Date: Tue Apr 28 14:45:21 2020 +0800 drm/panel: boe-tv101wum-n16: fine tune clock fix boe_tv105wum_nw0 display shift. Signed-off-by: David Lu Fixes: 963518c12431 ("drm/panel: support for boe,tv105wum-nw0 dsi video mode panel") Cc: David Lu Cc: Nicolas Boichat Cc: Sam Ravnborg Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sam Ravnborg [added fixes tag] Link: https://patchwork.freedesktop.org/patch/msgid/20200428064521.21511-1-david.lu@bitland.com.cn commit 29aed3ef6d4985bf8d3ef6505c3e63efc838414e Author: Steffen Trumtrar Date: Thu Mar 26 10:53:57 2020 +0100 ARM: dts: socfpga: Add fpga2hps and fpga2sdram bridges Add the remaining two bridges on the Cyclone-V SoCFPGA SoCs. Signed-off-by: Steffen Trumtrar Signed-off-by: Dinh Nguyen commit b64ac044ad949711470213550b53bd06684c5a03 Author: Steffen Trumtrar Date: Thu Mar 26 10:53:56 2020 +0100 ARM: dts: socfgpa: set bridges status to disabled The hps-to-fpga bridges can't be used, when the FPGA is not programmed. Set the default state to disabled and leave enabling them to the board-specific dts files. Although this changes behavior, there are no in-tree users of the bridges, so this won't break anything. Signed-off-by: Steffen Trumtrar Signed-off-by: Dinh Nguyen commit 1f52bab3c9bffeb945c3453f26155fb75f851935 Author: Adrian Ratiu Date: Thu Apr 23 13:00:58 2020 +0300 dt-bindings: display: dw_mipi_dsi.txt: convert to yaml This converts the Synopsis MIPI DSI binding documentation to yaml and should be quite straightforward. I've added a missing ref clk and also added Philippe as maintainer b/c he's the original txt author following the algorithm provided in Message-ID 20200420175909.GA5810@ravnborg.org. Cc: Philippe CORNU Cc: devicetree@vger.kernel.org Suggested-by: Laurent Pinchart Reviewed-by: Rob Herring Signed-off-by: Adrian Ratiu Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200423100058.1734009-1-adrian.ratiu@collabora.com commit 27a46fb732c6af68ef7458e75768ea5608e8ef9c Author: Tomi Valkeinen Date: Fri Apr 17 14:40:43 2020 +0300 drm/panel: panel-simple: fix AUO G101EVN010 connector/panel type The AUO G101EVN010 is a 18-bit LVDS panel, not a parallel panel, as indicated by the current bus_format. Fix the bus_format to MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, and also set the connector_type to LVDS. Signed-off-by: Tomi Valkeinen Signed-off-by: Sam Ravnborg [updated patch subject] Link: https://patchwork.freedesktop.org/patch/msgid/20200417114043.25381-1-tomi.valkeinen@ti.com commit 1a33e10e4a95cb109ff1145098175df3113313ef Author: Cong Wang Date: Sat May 2 22:22:19 2020 -0700 net: partially revert dynamic lockdep key changes This patch reverts the folowing commits: commit 064ff66e2bef84f1153087612032b5b9eab005bd "bonding: add missing netdev_update_lockdep_key()" commit 53d374979ef147ab51f5d632dfe20b14aebeccd0 "net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()" commit 1f26c0d3d24125992ab0026b0dab16c08df947c7 "net: fix kernel-doc warning in " commit ab92d68fc22f9afab480153bd82a20f6e2533769 "net: core: add generic lockdep keys" but keeps the addr_list_lock_key because we still lock addr_list_lock nestedly on stack devices, unlikely xmit_lock this is safe because we don't take addr_list_lock on any fast path. Reported-and-tested-by: syzbot+aaa6fa4949cc5d9b7b25@syzkaller.appspotmail.com Cc: Dmitry Vyukov Cc: Taehee Yoo Signed-off-by: Cong Wang Acked-by: Taehee Yoo Signed-off-by: David S. Miller commit 354d86141796a45e9c57c13d66bf2294d4c0d8e7 Merge: ea84c8429008 e7511f560f54 Author: David S. Miller Date: Mon May 4 12:05:56 2020 -0700 Merge branch 'net-reduce-dynamic-lockdep-keys' Cong Wang says: ==================== net: reduce dynamic lockdep keys syzbot has been complaining about low MAX_LOCKDEP_KEYS for a long time, it is mostly because we register 4 dynamic keys per network device. This patchset reduces the number of dynamic lockdep keys from 4 to 1 per netdev, by reverting to the previous static keys, except for addr_list_lock which still has to be dynamic. The second patch removes a bonding-specific key by the way. ==================== Signed-off-by: David S. Miller commit e7511f560f5499c664c1ba9181c76044e2af578d Author: Cong Wang Date: Sat May 2 22:22:20 2020 -0700 bonding: remove useless stats_lock_key After commit b3e80d44f5b1 ("bonding: fix lockdep warning in bond_get_stats()") the dynamic key is no longer necessary, as we compute nest level at run-time. So, we can just remove it to save some lockdep key entries. Test commands: ip link add bond0 type bond ip link add bond1 type bond ip link set bond0 master bond1 ip link set bond0 nomaster ip link set bond1 master bond0 Reported-and-tested-by: syzbot+aaa6fa4949cc5d9b7b25@syzkaller.appspotmail.com Cc: Dmitry Vyukov Acked-by: Taehee Yoo Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit ea84c842900872f5b8d6d4754cf0fa37d6672011 Merge: 1248dc00fb62 461d6d058cff Author: David S. Miller Date: Mon May 4 12:02:03 2020 -0700 Merge branch 'net-ethernet-ti-k3-introduce-common-platform-time-sync-driver-cpts' Grygorii Strashko says: ==================== net: ethernet: ti: k3: introduce common platform time sync driver - cpts This series introduced support for significantly upgraded TI A65x/J721E Common platform time sync (CPTS) modules which are part of AM65xx Time Synchronization Architecture [1]. The TI A65x/J721E now contain more than one CPTS instance: - MCU CPSW CPTS (IEEE 1588 compliant) - Main NAVSS CPTS (central) - PCIe CPTS(s) (PTM compliant) - J721E: Main CPSW9g CPTS (IEEE 1588 compliant) which can work as separately as interact to each other through Time Sync Router (TSR) and Compare Event Router (CER). In addition there are also ICSS-G IEP blocks which can perform similar timsync functions, but require FW support. More info also available in TRM [2][3]. Not all above modules are available to the Linux by as of now as some of them are reserved for RTOS/FW purposes. The scope of this submission is TI A65x/J721E CPSW CPTS and Main NAVSS CPTS, and TSR was used for testing purposes. +---------------------------+ | MCU CPSW | +-------------------+ +------------------------+ | TS | | Main Navss CPTS | | Time Sync Router (TSR) | | +-------------+ | | | | | | | | | | HW1_TS +<----------+ | | +--------v-----+ +--+--+ | | | | | | CPTS | |Port | | ... | | | X+-->HW1_TS | | | | HW8_TS <------------<---------+ | X|-->HW2_TS | +--^--+ | | | | +--------------->HW3_TS | | | | | | | +--------------->HW4_TS | | | | | | | | | | | | | | | | | | | | | | | | Genf0 +-----------> (A)---------+ +<--------------+Genf0 | | | | | | | | | | | | | | ... | | +-----------> <---------------+Genf1 ESTf+-------+ | | | | | | | | | | | | | | +--------------+ | | Genf8 +---------->+ | | | | | | SYNC0 ... SYNC3 | | | +-------------------+ +------+------------+----+ +---------------------------+ + + X X (A) shows possible routing path for MCU CPSW CPTS Genf0 signal as an example. Main features of the new TI A65x/J721E CPTS modules are: - 64-bit timestamp/counter mode support in ns by using add_val - implemented in HW PPM and nudge adjustment. - control of time sync events via interrupt or polling - selection of multiple external reference clock sources - hardware timestamp of ext. inputs events (HWx_TS_PUSH) - periodic generator function outputs (TS_GENFx) - (CPSW only) Ethernet Enhanced Scheduled Traffic Operations (CPTS_ESTFn), which drives TSN schedule - timestamping of all RX packets bypassing CPTS FIFO Patch 1 - DT bindings Patch 2 - the AM65x/J721E driver Patch 3 - enables packet timestamping support in TI AM65x/J721E MCU CPSW driver. Patches 4-7 - DT updates. === PTP Testing: phc2sys -s CLOCK_REALTIME -c eth0 -m -O 0 -u30 phc2sys[627.331]: eth0 rms 409912446712787392 max 1587584079521858304 freq -6665 +/- 35040 delay 832 +/- 27 phc2sys[657.335]: eth0 rms 33 max 66 freq -0 +/- 28 delay 820 +/- 30 phc2sys[687.339]: eth0 rms 37 max 70 freq -1 +/- 32 delay 830 +/- 29 phc2sys[717.343]: eth0 rms 33 max 71 freq -0 +/- 29 delay 828 +/- 23 phc2sys[747.346]: eth0 rms 35 max 75 freq -0 +/- 31 delay 829 +/- 26 phc2sys[777.350]: eth0 rms 37 max 68 freq -1 +/- 32 delay 825 +/- 25 phc2sys[807.354]: eth0 rms 28 max 57 freq -1 +/- 25 delay 824 +/- 21 phc2sys[837.358]: eth0 rms 43 max 81 freq -1 +/- 37 delay 836 +/- 23 phc2sys[867.361]: eth0 rms 33 max 74 freq +0 +/- 29 delay 828 +/- 24 phc2sys[897.365]: eth0 rms 35 max 77 freq -2 +/- 30 delay 824 +/- 25 phc2sys[927.369]: eth0 rms 28 max 50 freq +0 +/- 25 delay 825 +/- 25 ptp4l -P -2 -H -i eth0 -l 6 -m -q -p /dev/ptp1 -f ptp.cfg -s ptp4l[22095.754]: port 1: MASTER to UNCALIBRATED on RS_SLAVE ptp4l[22097.754]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED ptp4l[22159.757]: rms 317 max 1418 freq +79 +/- 186 delay 410 +/- 1 ptp4l[22223.760]: rms 9 max 24 freq +42 +/- 12 delay 409 +/- 1 ptp4l[22287.763]: rms 10 max 28 freq +41 +/- 11 delay 410 +/- 1 ptp4l[22351.767]: rms 10 max 26 freq +34 +/- 12 delay 410 +/- 1 ptp4l[22415.770]: rms 10 max 26 freq +49 +/- 14 delay 410 +/- 1 === Ext. HW_TS and Genf testing: For testing purposes Time Sync Router (TSR) can be modeled in DT as pin controller + timesync_router: timesync_router@A40000 { + compatible = "pinctrl-single"; + reg = <0x0 0xA40000 0x0 0x800>; + #address-cells = <1>; + #size-cells = <0>; + #pinctrl-cells = <1>; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x800007ff>; + }; then signals routing can be done in board file, for example: +#define TS_OFFSET(pa, val) (0x4+(pa)*4) (0x80000000 | val) + +×ync_router { + pinctrl-names = "default"; + pinctrl-0 = <&mcu_cpts>; + + /* Example of the timesync routing */ + mcu_cpts: mcu_cpts { + pinctrl-single,pins = < + /* [cpts genf1] in13 -> out25 [cpts hw4_push] */ + TS_OFFSET(25, 13) + /* [cpts genf1] in13 -> out0 [main cpts hw1_push] */ + TS_OFFSET(0, 13) + /* [main cpts genf0] in4 -> out1 [main cpts hw2_push] */ + TS_OFFSET(1, 4) + /* [main cpts genf0] in4 -> out24 [cpts hw3_push] */ + TS_OFFSET(24, 4) + >; + }; +}; will create link: cpsw cpts Genf1 -> main cpts hw1_push -> cpsw cpts hw4_push main cpts Genf0 -> main cpts hw2_push -> cpsw cpts hw3_push testptp -d /dev/ptp0 -i 0 -p 1000000000 periodic output request okay testptp -d /dev/ptp0 -i 1 -e 5 external time stamp request okay event index 1 at 22583.000000025 event index 1 at 22584.000000025 event index 1 at 22585.000000025 event index 1 at 22586.000000025 event index 1 at 22587.000000025 testptp -d /dev/ptp1 -i 2 -e 5 external time stamp request okay event index 2 at 1587606764.249304554 event index 2 at 1587606765.249304467 event index 2 at 1587606766.249304380 event index 2 at 1587606767.249304293 event index 2 at 1587606768.249304206 [1] https://www.ti.com/lit/pdf/spracp7 [2] https://www.ti.com/lit/pdf/sprz452 [3] https://www.ti.com/lit/pdf/spruil1 ==================== Signed-off-by: David S. Miller commit 461d6d058cff60a0fa82c47bf963646418a34d62 Author: Grygorii Strashko Date: Fri May 1 23:50:11 2020 +0300 arm64: dts: ti: j721e-main: add main navss cpts node Add DT node for Main NAVSS CPTS module. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 29390928fe9a7cac7f8b1479f0f285034f16eb6f Author: Grygorii Strashko Date: Fri May 1 23:50:10 2020 +0300 arm64: dts: ti: k3-j721e-mcu: add mcu cpsw cpts node Add DT node for The TI J721E MCU CPSW CPTS which is part of MCU CPSW NUSS. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit b3f7e95f03189dbc7351b6fcaf223a021fc349c9 Author: Grygorii Strashko Date: Fri May 1 23:50:09 2020 +0300 arm64: dts: ti: k3-am65-main: add main navss cpts node Add DT node for Main NAVSS CPTS module. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 885a26bae0223cac7f939a4a549f2df6c7f89bbd Author: Grygorii Strashko Date: Fri May 1 23:50:08 2020 +0300 arm64: dts: ti: k3-am65-mcu: add cpsw cpts node Add DT node for the TI AM65x SoC Common Platform Time Sync (CPTS). Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit b1f66a5bee07adaab218fb98800928185e5f0f18 Author: Grygorii Strashko Date: Fri May 1 23:50:07 2020 +0300 net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support The MCU CPSW Common Platform Time Sync (CPTS) provides possibility to timestamp TX PTP packets and all RX packets. This enables corresponding support in TI AM65x/J721E MCU CPSW driver. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit f6bd59526ca527e203e3c6c2e62cda5a0fd5c1a2 Author: Grygorii Strashko Date: Fri May 1 23:50:06 2020 +0300 net: ethernet: ti: introduce am654 common platform time sync driver The CPTS module is used to facilitate host control of time sync operations. Main features of CPTS module are: - selection of multiple external clock sources - control of time sync events via interrupt or polling - 64-bit timestamp mode in ns with HW PPM and nudge adjustment. - hardware timestamp ext. inputs (HWx_TS_PUSH) - timestamp Generator function outputs (TS_GENFx) Depending on integration it enables compliance with the IEEE 1588-2008 standard for a precision clock synchronization protocol, Ethernet Enhanced Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time Measurement (PTM). Introduced driver provides Linux PTP hardware clock for each CPTS device and network packets timestamping where applicable. CPTS PTP hardware clock supports following operations: - Set time - Get time - Shift the clock by a given offset atomically - Adjust clock frequency - Time stamp external events - Periodic output signals Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 6e87ac748e94f4d7c9eaed4550789882ec8792d6 Author: Grygorii Strashko Date: Fri May 1 23:50:05 2020 +0300 dt-binding: ti: am65x: document common platform time sync cpts module Document device tree bindings for TI AM654/J721E SoC The Common Platform Time Sync (CPTS) module. The CPTS module is used to facilitate host control of time sync operations. Main features of CPTS module are: - selection of multiple external clock sources - 64-bit timestamp mode in ns with ppm and nudge adjustment. - control of time sync events via interrupt or polling - hardware timestamp of ext. events (HWx_TS_PUSH) - periodic generator function outputs (TS_GENFx) - PPS in combination with timesync router - Depending on integration it enables compliance with the IEEE 1588-2008 standard for a precision clock synchronization protocol, Ethernet Enhanced Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time Measurement (PTM). Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 1248dc00fb62bd4dc42b091aa8b245b1b54547ca Merge: 39d010504e6b aebbd7dfab25 Author: David S. Miller Date: Mon May 4 11:58:31 2020 -0700 Merge branch 'devlink-kernel-region-snapshot-id-allocation' Jakub Kicinski says: ==================== devlink: kernel region snapshot id allocation currently users have to find a free snapshot id to pass to the kernel when they are requesting a snapshot to be taken. This set extends the kernel so it can allocate the id on its own and send it back to user space in a response. ==================== Signed-off-by: David S. Miller commit aebbd7dfab2584acfb1c5d9abf911024109bc5ee Author: Jakub Kicinski Date: Fri May 1 09:40:42 2020 -0700 docs: devlink: clarify the scope of snapshot id In past discussions Jiri explained snapshot ids are cross-region. Explain this in the docs. v3: new patch Signed-off-by: Jakub Kicinski Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 043b3e22768d5d909cb1474fc21ae2fbaf026c0c Author: Jakub Kicinski Date: Fri May 1 09:40:41 2020 -0700 devlink: let kernel allocate region snapshot id Currently users have to choose a free snapshot id before calling DEVLINK_CMD_REGION_NEW. This is potentially racy and inconvenient. Make the DEVLINK_ATTR_REGION_SNAPSHOT_ID optional and try to allocate id automatically. Send a message back to the caller with the snapshot info. Example use: $ devlink region new netdevsim/netdevsim1/dummy netdevsim/netdevsim1/dummy: snapshot 1 $ id=$(devlink -j region new netdevsim/netdevsim1/dummy | \ jq '.[][][][]') $ devlink region dump netdevsim/netdevsim1/dummy snapshot $id [...] $ devlink region del netdevsim/netdevsim1/dummy snapshot $id v4: - inline the notification code v3: - send the notification only once snapshot creation completed. v2: - don't wrap the line containing extack; - add a few sentences to the docs. Signed-off-by: Jakub Kicinski Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit dd86fec7e06ab792fe470c66a67ff42bf5d72b91 Author: Jakub Kicinski Date: Fri May 1 09:40:40 2020 -0700 devlink: factor out building a snapshot notification We'll need to send snapshot info back on the socket which requested a snapshot to be created. Factor out constructing a snapshot description from the broadcast notification code. v3: new patch Signed-off-by: Jakub Kicinski Reviewed-by: Jiri Pirko Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit 39d010504e6b4485d7ceee167743620dd33f4417 Author: Eric Dumazet Date: Fri May 1 07:07:41 2020 -0700 net_sched: sch_fq: add horizon attribute QUIC servers would like to use SO_TXTIME, without having CAP_NET_ADMIN, to efficiently pace UDP packets. As far as sch_fq is concerned, we need to add safety checks, so that a buggy application does not fill the qdisc with packets having delivery time far in the future. This patch adds a configurable horizon (default: 10 seconds), and a configurable policy when a packet is beyond the horizon at enqueue() time: - either drop the packet (default policy) - or cap its delivery time to the horizon. $ tc -s -d qd sh dev eth0 qdisc fq 8022: root refcnt 257 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 quantum 10Kb initial_quantum 51160b low_rate_threshold 550Kbit refill_delay 40.0ms timer_slack 10.000us horizon 10.000s Sent 1234215879 bytes 837099 pkt (dropped 21, overlimits 0 requeues 6) backlog 0b 0p requeues 6 flows 1191 (inactive 1177 throttled 0) gc 0 highprio 0 throttled 692 latency 11.480us pkts_too_long 0 alloc_errors 0 horizon_drops 21 horizon_caps 0 v2: fixed an overflow on 32bit kernels in fq_init(), reported by kbuild test robot Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Signed-off-by: David S. Miller commit bf6dba76d278d296b385b436d3ac7de56c190d44 Author: Jesper Dangaard Brouer Date: Thu Apr 30 13:42:22 2020 +0200 net: sched: fallback to qdisc noqueue if default qdisc setup fail Currently if the default qdisc setup/init fails, the device ends up with qdisc "noop", which causes all TX packets to get dropped. With the introduction of sysctl net/core/default_qdisc it is possible to change the default qdisc to be more advanced, which opens for the possibility that Qdisc_ops->init() can fail. This patch detect these kind of failures, and choose to fallback to qdisc "noqueue", which is so simple that its init call will not fail. This allows the interface to continue functioning. V2: As this also captures memory failures, which are transient, the device is not kept in IFF_NO_QUEUE state. This allows the net_device to retry to default qdisc assignment. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit e9e89c45bfeb0d6196cd318d5e9231a211684d33 Author: Alex Elder Date: Mon May 4 13:13:50 2020 -0500 arm64: dts: sdm845: add IPA iommus property Add an "iommus" property to the IPA node in "sdm845.dtsi". It is required because there are two regions of memory the IPA accesses through an SMMU. The next few patches define and map those regions. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20200504181350.22822-1-elder@linaro.org Signed-off-by: Bjorn Andersson commit 09be4c47abe384fe8bd6a6f25012013acacc7729 Merge: cad5eaf74f17 a0036bb413d5 Author: David S. Miller Date: Mon May 4 11:26:55 2020 -0700 Merge branch 'net-ipa-I-O-map-SMEM-and-IMEM' Alex Elder says: ==================== net: ipa: I/O map SMEM and IMEM This series adds the definition of two memory regions that must be mapped for IPA to access through an SMMU. It requires the SMMU to be defined in the IPA node in the SoC's Device Tree file. There is no change since version 1 to the content of the code in these patches, *however* this time the first patch is an update to the binding definition rather than an update to a DTS file. ==================== Signed-off-by: David S. Miller commit a0036bb413d5b28b5b7b3d217f52909511b7c8ae Author: Alex Elder Date: Mon May 4 12:58:59 2020 -0500 net: ipa: define SMEM memory region for IPA Arrange to use an item from SMEM memory for IPA. SMEM item number 497 is designated to be used by the IPA. Specify the item ID and size of the region in platform configuration data. Allocate and get a pointer to this region from ipa_mem_init(). The memory must be mapped for access through an SMMU. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 3e313c3f5a36c7e8e6593ed2f6818795210347eb Author: Alex Elder Date: Mon May 4 12:58:58 2020 -0500 net: ipa: define IMEM memory region for IPA Define a region of IMEM memory available for use by IPA in the platform configuration data. Initialize it from ipa_mem_init(). The memory must be mapped for access through an SMMU. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 3128aae8c439af18048167e3cd5e31680cd190b9 Author: Alex Elder Date: Mon May 4 12:58:57 2020 -0500 net: ipa: redefine struct ipa_mem_data The ipa_mem_data structure type was never actually used. Instead, the IPA memory regions were defined using the ipa_mem structure. Redefine struct ipa_mem_data so it encapsulates the array of IPA-local memory region descriptors along with the count of entries in that array. Pass just an ipa_mem structure pointer to ipa_mem_init(). Rename the ipa_mem_data[] array ipa_mem_local_data[] to emphasize that the memory regions it defines are IPA-local memory. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8456c54408a21cddc5c5a3b35d2e77ddd58d20bc Author: Alex Elder Date: Mon May 4 12:58:56 2020 -0500 dt-bindings: net: add IPA iommus property The IPA accesses "IMEM" and main system memory through an SMMU, so its DT node requires an iommus property to define range of stream IDs it uses. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit dbab677f324dcf26dc8c443e3ff39a4eaa6dcacc Author: Shengjiu Wang Date: Fri Nov 22 18:30:13 2019 +0800 ASoC: wm8524: Add support S32_LE Allow 32bit sample with this codec. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/cff745cc041c5208910821f0740f988926af8a66.1574418380.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit cad5eaf74f17049db21a90be9514cb920de5ba39 Merge: e90c9fcedc08 bc54ac3609aa Author: David S. Miller Date: Mon May 4 11:19:58 2020 -0700 Merge branch 'net-add-helper-eth_hw_addr_crc' Heiner Kallweit says: ==================== net: add helper eth_hw_addr_crc Several drivers use the same code as basis for filter hashes. Therefore let's factor it out to a helper. This way drivers don't have to access struct netdev_hw_addr internals. First user is r8169. ==================== Signed-off-by: David S. Miller commit bc54ac3609aa0361dfeb15758b7bacf3637f6d4a Author: Heiner Kallweit Date: Mon May 4 19:28:21 2020 +0200 r8169: use new helper eth_hw_addr_crc Use new helper eth_hw_addr_crc to simplify the code. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit b86cd700edd3bfe27f631649727b7796067bb3fd Author: Heiner Kallweit Date: Mon May 4 19:27:00 2020 +0200 net: add helper eth_hw_addr_crc Several drivers use the same code as basis for filter hashes. Therefore let's factor it out to a helper. This way drivers don't have to access struct netdev_hw_addr internals. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit e90c9fcedc087c8ba1d34da88381838ed68bfb1c Author: Michael Walle Date: Mon May 4 18:52:28 2020 +0200 net: dsa: felix: allow the device to be disabled If there is no specific configuration of the felix switch in the device tree, but only the default configuration (ie. given by the SoCs dtsi file), the probe fails because no CPU port has been set. On the other hand you cannot set a default CPU port because that depends on the actual board using the switch. [ 2.701300] DSA: tree 0 has no CPU port [ 2.705167] mscc_felix 0000:00:00.5: Failed to register DSA switch: -22 [ 2.711844] mscc_felix: probe of 0000:00:00.5 failed with error -22 Thus let the device tree disable this device entirely, like it is also done with the enetc driver of the same SoC. Signed-off-by: Michael Walle Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 627642f07b3093f501495d226c7a0b9d56a0c870 Merge: fc99584e9446 649758fff327 Author: David S. Miller Date: Mon May 4 10:54:40 2020 -0700 Merge branch 'net-smc-add-failover-processing' Karsten Graul says: ==================== net/smc: add failover processing This patch series adds the actual SMC-R link failover processing and improved link group termination. There will be one more (very small) series after this which will complete the SMC-R link failover support. ==================== Signed-off-by: David S. Miller commit 649758fff327eeb184713db8b0b0ebfa28693077 Author: Karsten Graul Date: Mon May 4 14:18:48 2020 +0200 net/smc: save SMC-R peer link_uid During SMC-R link establishment the peers exchange the link_uid that is used for debugging purposes. Save the peer link_uid in smc_link so it can be retrieved by the smc_diag netlink interface. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 45fa8da0bf5cb447fcf835d184e2d3b745376e69 Author: Karsten Graul Date: Mon May 4 14:18:47 2020 +0200 net/smc: create improved SMC-R link_uid The link_uid of an SMC-R link is exchanged between SMC peers and its value can be used for debugging purposes. Create a unique link_uid during link initialization and use it in communication with SMC-R peers. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit a52bcc919b14c9d78f03b2b4ff604e5ca69c7e6d Author: Karsten Graul Date: Mon May 4 14:18:46 2020 +0200 net/smc: improve termination processing Add helper smcr_lgr_link_deactivate_all() and eliminate duplicate code. In smc_lgr_free(), clear the smc-r links before smc_lgr_free_bufs() is called so buffers are already prepared for free. The usage of the soft parameter in __smc_lgr_terminate() is no longer needed, smc_lgr_free() can be called directly. smc_lgr_terminate_sched() and smc_smcd_terminate() set lgr->freeing to indicate that the link group will be freed soon to avoid unnecessary schedules of the free worker. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 3e0c40afce4ea5b08bb7e3f65c55157817116640 Author: Karsten Graul Date: Mon May 4 14:18:45 2020 +0200 net/smc: add termination reason and handle LLC protocol violation Allow to set the reason code for the link group termination, and set meaningful values before termination processing is triggered. This reason code is sent to the peer in the final delete link message. When the LLC request or response layer receives a message type that was not handled, drop a warning and terminate the link group. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit ad6c111b8ae760114df6765d5a5ed1b09020d45d Author: Karsten Graul Date: Mon May 4 14:18:44 2020 +0200 net/smc: asymmetric link tagging New connections must not be assigned to asymmetric links. Add asymmetric link tagging using new link variable link_is_asym. The new helpers smcr_lgr_set_type() and smcr_lgr_set_type_asym() are called to set the state of the link group, and tag all links accordingly. smcr_lgr_conn_assign_link() respects the link tagging and will not assign new connections to links tagged as asymmetric link. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 56bc3b2094b428d808dd1704fdb3086c66bcb310 Author: Karsten Graul Date: Mon May 4 14:18:43 2020 +0200 net/smc: assign link to a new connection For new connections, assign a link from the link group, using some simple load balancing. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit f3811fd7bc97587b142fed9edf8c726694220cb2 Author: Karsten Graul Date: Mon May 4 14:18:42 2020 +0200 net/smc: send DELETE_LINK, ALL message and wait for send to complete Add smc_llc_send_message_wait() which uses smc_wr_tx_send_wait() to send an LLC message and waits for the message send to complete. smc_llc_send_link_delete_all() calls the new function to send an DELETE_LINK,ALL LLC message. The RFC states that the sender of this type of message needs to wait for the completion event of the message transmission and can terminate the link afterwards. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 09c61d24f96dfef7791debfcaf96efe067ab2ba8 Author: Karsten Graul Date: Mon May 4 14:18:41 2020 +0200 net/smc: wait for departure of an IB message Introduce smc_wr_tx_send_wait() to send an IB message and wait for the tx completion event of the message. This makes sure that the message is no longer in-flight when the function returns. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit b286a0651e4404ab96cdfdcdad8a839a26b3751e Author: Karsten Graul Date: Mon May 4 14:18:40 2020 +0200 net/smc: handle incoming CDC validation message Call smc_cdc_msg_validate() when a CDC message with the failover validation bit enabled was received. Validate that the sequence number sent with the message is one we already have received. If not, messages were lost and the connection is terminated using a new abort_work. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 29bd73dba4f72970895a2459f7190d388f5204f7 Author: Karsten Graul Date: Mon May 4 14:18:39 2020 +0200 net/smc: send failover validation message When a connection is switched to a new link then a link validation message must be sent to the peer over the new link, containing the sequence number of the last CDC message that was sent over the old link. The peer will validate if this sequence number is the same or lower then the number he received, and abort the connection if messages were lost. Add smcr_cdc_msg_send_validation() to send the message validation message and call it when a connection was switched in smc_switch_cursor(). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit c6f02ebeea3a0ff4bddddf0fd82303190ebb3dd1 Author: Karsten Graul Date: Mon May 4 14:18:38 2020 +0200 net/smc: switch connections to alternate link Add smc_switch_conns() to switch all connections from a link that is going down. Find an other link to switch the connections to, and switch each connection to the new link. smc_switch_cursor() updates the cursors of a connection to the state of the last successfully sent CDC message. When there is no link to switch to, terminate the link group. Call smc_switch_conns() when a link is going down. And with the possibility that links of connections can switch adapt CDC and TX functions to detect and handle link switches. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit f0ec4f1d32ad49a23b93156949208dd9348e3590 Author: Karsten Graul Date: Mon May 4 14:18:37 2020 +0200 net/smc: save state of last sent CDC message When a link goes down and all connections of this link need to be switched to an other link then the producer cursor and the sequence of the last successfully sent CDC message must be known. Add the two fields to the SMC connection and update it in the tx completion handler. And to allow matching of sequences in error cases reset the seqno to the old value in smc_cdc_msg_send() when the actual send failed. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 34bb49229f19399a5b45c323afb5749f31f7876c Author: Joerg Roedel Date: Tue Apr 28 17:16:22 2020 +0200 x86/boot/compressed/64: Switch to __KERNEL_CS after GDT is loaded When the pre-decompression code loads its first GDT in startup_64(), it is still running on the CS value of the previous GDT. In the case of SEV-ES, this is the EFI GDT but it can be anything depending on what has loaded the kernel (boot loader, container runtime, etc.) To make exception handling work (especially IRET) the CPU needs to switch to a CS value in the current GDT, so jump to __KERNEL_CS after the first GDT is loaded. This is prudent also as a general sanitization of CS to a known good value. [ bp: Massage commit message. ] Signed-off-by: Joerg Roedel Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200428151725.31091-13-joro@8bytes.org commit fc99584e9446976c1e438c2cb368010b844d0b4f Merge: 60bcbc41ffb3 125592fbf467 Author: David S. Miller Date: Mon May 4 10:44:11 2020 -0700 Merge branch 'bnxt_en-Updates-for-net-next' Michael Chan says: ==================== bnxt_en: Updates for net-next. This patchset includes these main changes: 1. Firmware spec. update. 2. Context memory sizing improvements for the hardware TQM block. 3. ethtool chip reset improvements and fixes for correctness. 4. Improve L2 doorbell mapping by mapping only up to the size specified by firmware. This allows the RoCE driver to map the remaining doorbell space for its purpose, such as write-combining. 5. Improve ethtool -S channel statistics by showing only relevant ring counters for non-combined channels. ==================== Signed-off-by: David S. Miller commit 125592fbf467d1a70312006bbaf29724d0ba5897 Author: Rajesh Ravi Date: Mon May 4 04:50:41 2020 -0400 bnxt_en: show only relevant ethtool stats for a TX or RX ring Currently, ethtool -S shows all TX/RX ring counters whether the channel is combined, RX, or TX. The unused counters will always be zero. Improve it by showing only the relevant counters if the channel is RX or TX. If the channel is combined, the counters will be shown exactly the same as before. [ MChan: Lots of cleanups and simplifications on Rajesh's original code] Signed-off-by: Rajesh Ravi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 3316d50905f0e551d4786767d827589960a8cb83 Author: Michael Chan Date: Mon May 4 04:50:40 2020 -0400 bnxt_en: Split HW ring statistics strings into RX and TX parts. This will allow the RX and TX ring statistics to be separated if needed. In the next patch, we'll be able to only display RX or TX statistcis if the channel is RX only or TX only. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 9d8b5f05529c619b63d68b0dd26a1dfe35a4fab2 Author: Michael Chan Date: Mon May 4 04:50:39 2020 -0400 bnxt_en: Refactor the software ring counters. We currently have 3 software ring counters, rx_l4_csum_errors, rx_buf_errors, and missed_irqs. The 1st two are RX counters and the last one is a common counter. Organize them into 2 structures bnxt_rx_sw_stats and bnxt_cmn_sw_stats. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 098286ff930ca752e4c9295ea65840dd55f5f290 Author: Michael Chan Date: Mon May 4 04:50:38 2020 -0400 bnxt_en: Add doorbell information to bnxt_en_dev struct. The purpose of this is to inform the RDMA driver the size of the doorbell BAR that the L2 driver has mapped and the portion that is mapped uncacheable. The unchaeable portion is shared with the RoCE driver. Any remaining unmapped doorbell BAR can be used by the RDMA driver for its own purpose. Currently, the entire L2 portion is mapped uncacheable. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 8ae2473842bdbb95bfb451b130dad6a650b3ad1b Author: Michael Chan Date: Mon May 4 04:50:37 2020 -0400 bnxt_en: Add support for L2 doorbell size. Read the L2 doorbell size from the firmware and only map the portion of the doorbell BAR for L2 use. This will leave the remaining doorbell BAR available for the RoCE driver to use. The RoCE driver can map the remaining portion as write-combining to support the push feature. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit e93b30d56fc0670e508456afc59f16d70fe1f83f Author: Michael Chan Date: Mon May 4 04:50:36 2020 -0400 bnxt_en: Set the db_offset on 57500 chips for the RDMA MSIX entries. The driver provides completion ring or NQ doorbell offset for each MSIX entry requested by the RDMA driver. The NQ offset on 57500 chips is different than legacy chips. Set it correctly based on chip type for correctness. The RDMA driver is ignoring this field for the 57500 chips so it is not causing any problem. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ebdf73dc595b6711dbfaf3007d513909bd814940 Author: Michael Chan Date: Mon May 4 04:50:35 2020 -0400 bnxt_en: Define the doorbell offsets on 57500 chips. Define the 57500 chip doorbell offsets instead of using the magic values in the C file. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 8cec0940803c255f501d4b9f4764cd47fc206ad4 Author: Edwin Peer Date: Mon May 4 04:50:34 2020 -0400 bnxt_en: Improve kernel log messages related to ethtool reset. Kernel log messages for failed AP reset commands should be suppressed. These are expected to fail on devices that do not have an AP. Add missing driver reload message after AP reset and log it in a common way without duplication. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 7a13240e371891d90cd51e3ea55ea04f4b2065dc Author: Edwin Peer Date: Mon May 4 04:50:33 2020 -0400 bnxt_en: fix ethtool_reset_flags ABI violations The ethtool ABI specifies that the reset operation should only clear the flags that were actually reset. Setting the flags to zero after a chip reset violates this because it does not include resetting the application processor complex. Similarly, components that are not yet defined are also not necessarily being reset. The fact that chip reset does not cover the AP also means that it is inappropriate to treat these two components exclusively of one another. The ABI provides a mechanism to report a failure to reset independent components via the returned bitmask, so it is also wrong to fail hard if one of a set of independent resets is not possible. It is incorrect to rely on the passed by reference flags in bnxt_reset(), which are being updated as components are reset. The initially requested value should be used instead so that hard errors do not propagate if any earlier components could have been reset successfully. Note, AP and chip resets are global in nature. Dedicated resets are thus not currently supported. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 94f17e89c956553606d5c7cf4f40ce6012529d48 Author: Edwin Peer Date: Mon May 4 04:50:32 2020 -0400 bnxt_en: refactor ethtool firmware reset types The case statement in bnxt_firmware_reset() dangerously mixes types. This patch separates the application processor and whole chip resets from the rest such that the selection is performed on a pure type. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 95fec034fd440b4882701df3e84d2b76af4e627d Author: Edwin Peer Date: Mon May 4 04:50:31 2020 -0400 bnxt_en: prepare to refactor ethtool reset types Extract bnxt_hwrm_firmware_reset() for performing firmware reset operations. This new helper function will be used in a subsequent patch to separate unrelated reset types out of bnxt_firmware_reset(). Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit d0b82c5461c9b9bfcb572fe0b50d8e2662e281f1 Author: Vasundhara Volam Date: Mon May 4 04:50:30 2020 -0400 bnxt_en: Do not include ETH_FCS_LEN in the max packet length sent to fw. The firmware does not expect the CRC to be included in the length passed from the driver. The firmware always configures the chip to strip out the CRC. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit c7dd7ab4b204ac0142e0d05e71e05e71ae6cb270 Author: Michael Chan Date: Mon May 4 04:50:29 2020 -0400 bnxt_en: Improve TQM ring context memory sizing formulas. The current formulas to calculate the TQM slow path and fast path ring context memory sizes are not quite correct. TQM slow path entry is array index 0 of ctx->tqm_mem[]. The other array entries are for fast path. Fix these sizes according to latest firmware spec. for 57500 and newer chips. Fixes: 3be8136ce14e ("bnxt_en: Initialize context memory to the value specified by firmware.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ac3158cb01084aa654222f1ad970b6c1af3cef98 Author: Michael Chan Date: Mon May 4 04:50:28 2020 -0400 bnxt_en: Allocate TQM ring context memory according to fw specification. Newer firmware spec. will specify the number of TQM rings to allocate context memory for. Use the firmware specified value and fall back to the old value derived from bp->max_q if it is not available. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 460c2577aaf349f4e49eaf2b9ec3d8c52a619ef5 Author: Michael Chan Date: Mon May 4 04:50:27 2020 -0400 bnxt_en: Update firmware spec. to 1.10.1.33. Changes include additional statistics, ECN support, context memory interface change for better TQM context memory sizing, firmware health status definitions, etc. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit caf2cd610dbbfb533c8b84255fbe77dca36229d0 Author: Sudeep Holla Date: Wed Apr 22 13:28:23 2020 +0100 firmware: arm_sdei: Drop check for /firmware/ node and always register driver As with most of the drivers, let us register this driver unconditionally by dropping the checks for presence of firmware nodes(DT) or entries(ACPI). Further, as mentioned in the commit acafce48b07b ("firmware: arm_sdei: Fix DT platform device creation"), the core takes care of creation of platform device when the appropriate device node is found and probe is called accordingly. Let us check only for the presence of ACPI firmware entry before creating the platform device and flag warning if we fail. Signed-off-by: Sudeep Holla Reviewed-by: James Morse Cc: James Morse Link: https://lore.kernel.org/r/20200422122823.1390-1-sudeep.holla@arm.com Signed-off-by: Will Deacon commit 8757797ff9c97e846348db634e849e11769e5d3d Author: Chris Wilson Date: Mon May 4 05:48:47 2020 +0100 drm/i915/selftests: Repeat the rps clock frequency measurement Repeat the measurement of the clock frequency a few times and use the median to try and reduce the systematic measurement error. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200504044903.7626-6-chris@chris-wilson.co.uk commit da7bad98eebb7bedcb37cf8c34fbb0de470c2b99 Author: Anshuman Khandual Date: Mon May 4 17:59:37 2020 +0530 arm64/cpuinfo: Move device_initcall() near cpuinfo_regs_init() This moves device_initcall() near cpuinfo_regs_init() making the calling sequence clear. Besides it is a standard practice to have device_initcall() (any __initcall for that matter) just after the function it actually calls. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Cc: Mark Rutland Cc: Suzuki Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Acked-by: Mark Rutland Link: https://lore.kernel.org/r/1588595377-4503-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit cff1110178873d9dfac0e0e848c282954c4b3c63 Author: Ondrej Jirman Date: Mon Apr 20 12:31:13 2020 +0200 arm64: dts: allwinner: sun50i-a64: Add missing address/size-cells The binding specifies #address-cells and #size-cells should be present. Without them present, dtc issues a warning because default for #address-cells seems to be <2>: arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi:1108.4-52: Warning (dma_ranges_format): /soc/dram-controller@1c62000:dma-ranges: "dma-ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1) mbus #address-cells should be 1. Signed-off-by: Ondrej Jirman Signed-off-by: Maxime Ripard commit fe79ea577be81e1e71642826ab00e676dc59c194 Author: Clément Péron Date: Mon Apr 20 15:00:21 2020 +0200 arm64: dts: allwinner: h6: Enable CPU opp tables for Pine H64 Enable CPU and GPU opp tables for Pine H64. This needs to change the CPU regulator max voltage to fit the OPP table. Also add the ramp-delay information to avoid any out of spec running as the regulator is slower at reaching the voltage requested compare to the PLL reaching the frequency. There is no such information for AXP805 but similar PMIC (AXP813) has a DVM (Dynamic Voltage scaling Management) ramp rate equal to 2500uV/us. Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit d8e2b7e11b50c332e03fae05a68d40a48d4646ed Author: Clément Péron Date: Mon Apr 20 15:00:20 2020 +0200 arm64: dts: allwinner: Sort Pine H64 device-tree nodes Pine H64 device-tree have some nodes not properly sorted. Fix this. Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit 36c72a58d472b4032e09f165ea064a0251c9df07 Author: Lukas Wunner Date: Mon May 4 13:12:05 2020 +0200 spi: amd: Drop superfluous member from struct amd_spi The AMD SPI driver stores a pointer to the spi_master in struct amd_spi so that it can get from the latter to the former in amd_spi_fifo_xfer(). It's simpler to just pass the pointer from the sole caller amd_spi_master_transfer() and drop the pointer from struct amd_spi. Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/a088b684ad292faf3bd036e51529e608e5c94638.1588590210.git.lukas@wunner.de Signed-off-by: Mark Brown commit 7b9c94bd13cc9dc9c0c4932ebacf756ae612d52a Author: Lukas Wunner Date: Mon May 4 13:12:04 2020 +0200 spi: amd: Fix refcount underflow on remove The AMD SPI driver calls spi_master_put() in its ->remove() hook even though the preceding call to spi_unregister_master() already drops a ref, thus leading to a refcount underflow. Drop the superfluous call to spi_master_put(). This only leaves the call to spi_unregister_master() in the ->remove() hook, so it's safe to change the ->probe() hook to use the devm version of spi_register_master() and drop the ->remove() hook altogether. Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/5e53ccdf1eecd4e015dba99d0d77389107f8a2e3.1588590210.git.lukas@wunner.de Signed-off-by: Mark Brown commit 4332ea8f40c80d51a534f194291bf3b7738a7beb Author: Lukas Wunner Date: Mon May 4 13:12:03 2020 +0200 spi: amd: Drop duplicate driver data assignments The AMD SPI driver calls platform_set_drvdata() on probe even though it's already been set by __spi_alloc_controller(). Likewise, it calls platform_set_drvdata() on remove even though it's going to be set by __device_release_driver(). Drop the duplicate assignments. Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/499f8ad4759c2ff0f586e0459fb9a293faecff6d.1588590210.git.lukas@wunner.de Signed-off-by: Mark Brown commit cc17fbec2e785926dafce65d014f8301847dff40 Author: Lukas Wunner Date: Mon May 4 13:12:02 2020 +0200 spi: amd: Pass probe errors back to driver core If probing fails, the AMD SPI driver pretends success to the driver core by returning 0. Return the errno instead. Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/689f29a359718dab4f5de9ee66c02ea97b3bd9e8.1588590210.git.lukas@wunner.de Signed-off-by: Mark Brown commit 2b60c49f3ca0648c5b02b60dc0f5b9e2c274bfb5 Author: Lukas Wunner Date: Mon May 4 13:12:01 2020 +0200 spi: amd: Fix duplicate iounmap in error path The AMD SPI driver uses devm_ioremap_resource() to map its registers, so they're automatically unmapped via device_release() when the last ref on the SPI controller is dropped. The additional iounmap() in the ->probe() error path is thus unnecessary. Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/497cc38ae2beb7900ae05a1463eb83ff96e2770e.1588590210.git.lukas@wunner.de Signed-off-by: Mark Brown commit 8b075e5ba459c7afdd7b2fde14cbc01c51e25eac Author: Christoph Hellwig Date: Sat Apr 25 09:57:06 2020 +0200 udf: stop using ioctl_by_bdev Instead just call the CDROM layer functionality directly. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 11aa40a0eb2452367b2edcdac4d272376596ea37 Author: Christoph Hellwig Date: Sat Apr 25 09:57:05 2020 +0200 isofs: stop using ioctl_by_bdev Instead just call the CDROM layer functionality directly, and turn the hot mess in isofs_get_last_session into remotely readable code. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit f252fa33dcd27f0eeeeabc93606fa6486c311b92 Author: Christoph Hellwig Date: Sat Apr 25 09:57:04 2020 +0200 hfsplus: stop using ioctl_by_bdev Instead just call the CDROM layer functionality directly. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit eaf8e3e4b54a8b778257fc3921ad8f793c941882 Author: Christoph Hellwig Date: Sat Apr 25 09:57:03 2020 +0200 cdrom: factor out a cdrom_multisession helper Factor out a version of the CDROMMULTISESSION ioctl handler that can be called directly from kernel space. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 4c3cfcce45152309c2031b3b87bcf10e4f3899e1 Author: Christoph Hellwig Date: Sat Apr 25 09:57:02 2020 +0200 cdrom: factor out a cdrom_read_tocentry helper Factor out a version of the CDROMREADTOCENTRY ioctl handler that can be called directly from kernel space. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit 068f8d9b4ecc90cfe30c643ba255f7d69b9eae78 Author: Christoph Hellwig Date: Sat Apr 25 09:57:01 2020 +0200 ide-cd: rename cdrom_read_tocentry Give the cdrom_read_tocentry function and ide_ prefix to not conflict with the soon to be added generic function. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe commit a711d91cd97e6c9a554ccd1652527a7f36661857 Author: Christoph Hellwig Date: Sat Apr 25 09:57:00 2020 +0200 block: add a cdrom_device_info pointer to struct gendisk Add a pointer to the CDROM information structure to struct gendisk. This will allow various removable media file systems to call directly into the CDROM layer instead of abusing ioctls with kernel pointers. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: Jens Axboe commit 0065e5f5cc56136da0be900c4a3121b38a82f37d Author: Chris Wilson Date: Sun May 3 19:00:34 2020 +0100 drm/i915/display: Warn if the FBC is still writing to stolen on removal If the FBC is still writing into stolen, it will overwrite any future users of that stolen region. Check before release, just to ease any concerns -- we can remove it again later if it is barking up the wrong tree. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1635 Signed-off-by: Chris Wilson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200503180034.20010-1-chris@chris-wilson.co.uk commit 840d493dff1abb0cb0d73417148a3eeecd5f30d9 Author: Ira Weiny Date: Mon May 4 09:02:43 2020 -0700 fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags() The functionality in xfs_diflags_to_linux() and xfs_diflags_to_iflags() are nearly identical. The only difference is that *_to_linux() is called after inode setup and disallows changing the DAX flag. Combining them can be done with a flag which indicates if this is the initial setup to allow the DAX flag to be properly set only at init time. So remove xfs_diflags_to_linux() and call the modified xfs_diflags_to_iflags() directly. While we are here simplify xfs_diflags_to_iflags() to take struct xfs_inode and use xfs_ip2xflags() to ensure future diflags are included correctly. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit 32dbc5655f1ccb3bffa5785523146f60fa4bf905 Author: Ira Weiny Date: Mon May 4 09:02:42 2020 -0700 fs/xfs: Create function xfs_inode_should_enable_dax() xfs_inode_supports_dax() should reflect if the inode can support DAX not that it is enabled for DAX. Change the use of xfs_inode_supports_dax() to reflect only if the inode and underlying storage support dax. Add a new function xfs_inode_should_enable_dax() which reflects if the inode should be enabled for DAX. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit 8d6c3446ec23ecd97bc089ed224342baf9426c30 Author: Ira Weiny Date: Mon May 4 09:02:42 2020 -0700 fs/xfs: Make DAX mount option a tri-state As agreed upon[1]. We make the dax mount option a tri-state. '-o dax' continues to operate the same. We add 'always', 'never', and 'inode' (default). [1] https://lore.kernel.org/lkml/20200405061945.GA94792@iweiny-DESK2.sc.intel.com/ Signed-off-by: Ira Weiny Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 606723d982939ab138a05a8070b1ec48ed532234 Author: Ira Weiny Date: Mon May 4 09:02:41 2020 -0700 fs/xfs: Change XFS_MOUNT_DAX to XFS_MOUNT_DAX_ALWAYS In prep for the new tri-state mount option which then introduces XFS_MOUNT_DAX_NEVER. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit d45344d6c49cf9863e1d526fc1d8cb27ab147148 Author: Ira Weiny Date: Wed Apr 22 21:50:57 2020 -0700 fs/xfs: Remove unnecessary initialization of i_rwsem An earlier call of xfs_reinit_inode() from xfs_iget_cache_hit() already handles initialization of i_rwsem. Doing so again is unneeded. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit 2f88f1efd02ddf76cb5973abc42474c4dac2b03a Author: Christoph Hellwig Date: Thu Apr 30 12:52:23 2020 -0700 xfs: spell out the parameter name for ->cancel_item Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3ec1b26c04d4910f37cdaad26d14b403c0240e30 Author: Christoph Hellwig Date: Thu Apr 30 12:52:22 2020 -0700 xfs: use a xfs_btree_cur for the ->finish_cleanup state Given how XFS is all based around btrees it doesn't make much sense to offer a totally generic state when we can just use the btree cursor. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f09d167c20332ad1298ff82a6f538b4c7ea3fe1b Author: Christoph Hellwig Date: Thu Apr 30 12:52:22 2020 -0700 xfs: turn dfp_done into a xfs_log_item All defer op instance place their own extension of the log item into the dfp_done field. Replace that with a xfs_log_item to improve type safety and make the code easier to follow. Also use the opportunity to improve the ->finish_item calling conventions to place the done log item as the higher level structure before the list_entry used for the individual items. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit bb47d79750f1a68a75d4c7defc2da934ba31de14 Author: Christoph Hellwig Date: Thu Apr 30 12:52:21 2020 -0700 xfs: refactor xfs_defer_finish_noroll Split out a helper that operates on a single xfs_defer_pending structure to untangle the code. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 13a8333339072b8654c1d2c75550ee9f41ee15de Author: Christoph Hellwig Date: Thu Apr 30 12:52:21 2020 -0700 xfs: turn dfp_intent into a xfs_log_item All defer op instance place their own extension of the log item into the dfp_intent field. Replace that with a xfs_log_item to improve type safety and make the code easier to follow. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d367a868e46b025a8ced8e00ef2b3a3c2f3bf732 Author: Christoph Hellwig Date: Thu Apr 30 12:52:20 2020 -0700 xfs: merge the ->diff_items defer op into ->create_intent This avoids a per-item indirect call, and also simplifies the interface a bit. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c1f09188e8de0ae65433cb9c8ace4feb66359bcc Author: Christoph Hellwig Date: Thu Apr 30 12:52:20 2020 -0700 xfs: merge the ->log_item defer op into ->create_intent These are aways called together, and my merging them we reduce the amount of indirect calls, improve type safety and in general clean up the code a bit. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e046e949486ec92d83b2ccdf0e7e9144f74ef028 Author: Christoph Hellwig Date: Thu Apr 30 12:52:20 2020 -0700 xfs: factor out a xfs_defer_create_intent helper Create a helper that encapsulates the whole logic to create a defer intent. This reorders some of the work that was done, but none of that has an affect on the operation as only fields that don't directly interact are affected. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fd9cbe51215198ccffa64169c98eae35b0916088 Author: Christoph Hellwig Date: Thu Apr 30 12:52:19 2020 -0700 xfs: remove the xfs_inode_log_item_t typedef Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c84e819090f39e96e4d432c9047a50d2424f99e0 Author: Christoph Hellwig Date: Thu Apr 30 12:52:19 2020 -0700 xfs: remove the xfs_efd_log_item_t typedef Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 82ff450b2d936d778361a1de43eb078cc043c7fe Author: Christoph Hellwig Date: Thu Apr 30 12:52:18 2020 -0700 xfs: remove the xfs_efi_log_item_t typedef Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 98b69b1285be048b9c811f093ba1fa86e4d8fe87 Author: Christoph Hellwig Date: Tue Apr 28 14:39:13 2020 -0700 xfs: refactor xlog_recover_buffer_pass1 Split out a xlog_add_buffer_cancelled helper which does the low-level manipulation of the buffer cancelation table, and in that helper call xlog_find_buffer_cancelled instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f15ab3f60ef3f25c6139262939388dc5617e2e6f Author: Christoph Hellwig Date: Mon Apr 27 18:23:17 2020 -0700 xfs: simplify xlog_recover_inode_ra_pass2 Don't bother to allocate memory and convert the log item when we only need the block number and the length. Just extract them directly and call xlog_buf_readahead separately in each branch. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7d4894b4ce070398952de25e893873edc67d3105 Author: Christoph Hellwig Date: Mon Apr 27 18:23:17 2020 -0700 xfs: factor out a xlog_buf_readahead helper Add a little helper to readahead a buffer if it hasn't been cancelled. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 5ce70b770d163b0c7697dd23420cbaee070b1cd0 Author: Christoph Hellwig Date: Mon Apr 27 11:14:59 2020 -0700 xfs: rename inode_list xlog_recover_reorder_trans This list contains pretty much everything that is not a buffer. The comment calls it item_list, which is a much better name than inode list, so switch the actual variable name to that as well. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e968350aadf34c86eedd9cb43f6324263845586b Author: Christoph Hellwig Date: Mon Apr 27 11:14:59 2020 -0700 xfs: refactor the buffer cancellation table helpers Replace the somewhat convoluted use of xlog_peek_buffer_cancelled and xlog_check_buffer_cancelled with two obvious helpers: xlog_is_buffer_cancelled, which returns true if there is a buffer in the cancellation table, and xlog_put_buffer_cancelled, which also decrements the reference count of the buffer cancellation table. Both share a little helper to look up the entry. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ec43f6da31f100696b56e4781b62fb5367a40d71 Author: Eric Sandeen Date: Mon Apr 27 11:00:42 2020 -0700 xfs: define printk_once variants for xfs messages There are a couple places where we directly call printk_once() and one of them doesn't follow the standard xfs subsystem printk format as a result. #define printk_once variants to go with our existing printk_ratelimited #defines so we can do one-shot printks in a consistent manner. Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 166405f6b53b7d7eecb7939aa4a79bc7c1e0ed68 Author: Arnd Bergmann Date: Wed Apr 22 21:54:30 2020 -0700 xfs: stop CONFIG_XFS_DEBUG from changing compiler flags I ran into a linker warning in XFS that originates from a mismatch between libelf, binutils and objtool when certain files in the kernel are built with "gcc -g": x86_64-linux-ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info After some discussion, nobody could identify why xfs sets this flag here. CONFIG_XFS_DEBUG used to enable lots of unrelated settings, but now its main purpose is to enable extra consistency checks and assertions that are unrelated to the debug info. Remove the Makefile logic to set the flag here. If anyone relies on the debug info, this can simply be enabled again with the global CONFIG_DEBUG_INFO option. Dave Chinner writes: I'm pretty sure it was needed for the original kgdb integration back in the early 2000s. That was when SGI used to patch their XFS dev tree with kgdb and debug symbols were needed by the custom kgdb modules that were ported across from the Irix kernel debugger. ISTR that the early kcrash kernel dump analysis tools (again, originated from the Irix "icrash" kernel dump tools) had custom XFS debug scripts that needed also the debug info to work correctly... Which is a long way of saying "we don't need it anymore" instead of "nobody knows why it was set"... :) Suggested-by: Christoph Hellwig Link: https://lore.kernel.org/lkml/20200409074130.GD21033@infradead.org/ Signed-off-by: Arnd Bergmann Reviewed-by: Brian Foster Reviewed-by: Allison Collins Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 57fd2d8f61a2bc4d7b465588ca1a2217cd94076c Author: Kaixu Xia Date: Wed Apr 22 21:54:31 2020 -0700 xfs: remove unnecessary check of the variable resblks in xfs_symlink Since the "no-allocation" reservations has been removed, the resblks value should be larger than zero, so remove the unnecessary check. Signed-off-by: Kaixu Xia Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit cd59455980f94ea4e9a5f84a7c326d42a4d84a78 Author: Kaixu Xia Date: Wed Apr 22 21:54:30 2020 -0700 xfs: simplify the flags setting in xfs_qm_scall_quotaon Simplify the setting of the flags value, and only consider quota enforcement stuff here. Signed-off-by: Kaixu Xia Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7994aae8516aa35ca26dba64cf8d6938e93c2265 Author: Kaixu Xia Date: Wed Apr 22 21:54:29 2020 -0700 xfs: remove unnecessary assertion from xfs_qm_vop_create_dqattach The check XFS_IS_QUOTA_RUNNING() has been done when enter the xfs_qm_vop_create_dqattach() function, it will return directly if the result is false, so the followed XFS_IS_QUOTA_RUNNING() assertion is unnecessary. If we truly care about this, the check also can be added to the condition of next if statements. Signed-off-by: Kaixu Xia Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ea1c90403d5d38bd26c4c5a72627a8f0f87295ff Author: Kaixu Xia Date: Wed Apr 22 21:54:29 2020 -0700 xfs: remove unnecessary variable udqp from xfs_ioctl_setattr The initial value of variable udqp is NULL, and we only set the flag XFS_QMOPT_PQUOTA in xfs_qm_vop_dqalloc() function, so only the pdqp value is initialized and the udqp value is still NULL. Since the udqp value is NULL in the rest part of xfs_ioctl_setattr() function, it is meaningless and do nothing. So remove it from xfs_ioctl_setattr(). Signed-off-by: Kaixu Xia Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fb353ff19d34e9b0ee8ba2b25d78aeab0436f479 Author: Kaixu Xia Date: Wed Apr 22 21:54:28 2020 -0700 xfs: reserve quota inode transaction space only when needed We share an inode between gquota and pquota with the older superblock that doesn't have separate pquotino, and for the need_alloc == false case we don't need to call xfs_dir_ialloc() function, so add the check if reserved free disk blocks is needed. Signed-off-by: Kaixu Xia Reviewed-by: Brian Foster Reviewed-by: Dave Chinner Reviewed-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d51bafe0d227e9fef1b0ab4cc1a424d8e2b59218 Author: Kaixu Xia Date: Wed Apr 22 21:54:28 2020 -0700 xfs: combine two if statements with same condition The two if statements have same condition, and the mask value does not change in xfs_setattr_nonsize(), so combine them. Signed-off-by: Kaixu Xia Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c140735bbb65daa89275a6b87f120c5feca99d6a Author: Kaixu Xia Date: Wed Apr 22 21:54:27 2020 -0700 xfs: trace quota allocations for all quota types The trace event xfs_dquot_dqalloc does not depend on the value uq, so remove the condition, and trace quota allocations for all quota types. Signed-off-by: Kaixu Xia Reviewed-by: Chaitanya Kulkarni Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0d2d35a33ea77f34d534106e0b18a5797d3bbcf7 Author: Darrick J. Wong Date: Tue Apr 21 14:16:52 2020 -0700 xfs: report unrecognized log item type codes during recovery When we're sorting recovered log items ahead of recovering them and encounter a log item of unknown type, actually print the type code when we're rejecting the whole transaction to aid in debugging. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 690d22dafa88b82453516387b475664047a6bd14 Author: Sultan Alsawaf Date: Thu Apr 30 14:46:54 2020 -0700 drm/i915: Don't enable WaIncreaseLatencyIPCEnabled when IPC is disabled In commit 5a7d202b1574, a logical AND was erroneously changed to an OR, causing WaIncreaseLatencyIPCEnabled to be enabled unconditionally for kabylake and coffeelake, even when IPC is disabled. Fix the logic so that WaIncreaseLatencyIPCEnabled is only used when IPC is enabled. Fixes: 5a7d202b1574 ("drm/i915: Drop WaIncreaseLatencyIPCEnabled/1140 for cnl") Cc: stable@vger.kernel.org # 5.3.x+ Signed-off-by: Sultan Alsawaf Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200430214654.51314-1-sultan@kerneltoast.com commit 83d9088659e8f113741bb197324bd9554d159657 Author: Ira Weiny Date: Thu Apr 30 07:41:34 2020 -0700 Documentation/dax: Update Usage section Update the Usage section to reflect the new individual dax selection functionality. Signed-off-by: Ira Weiny Acked-by: Randy Dunlap Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 712b2698e4c024b561694cbcc1abba13eb0fd9ce Author: Ira Weiny Date: Thu Apr 30 07:41:34 2020 -0700 fs/stat: Define DAX statx attribute In order for users to determine if a file is currently operating in DAX state (effective DAX). Define a statx attribute value and set that attribute if the effective DAX flag is set. To go along with this we propose the following addition to the statx man page: STATX_ATTR_DAX The file is in the DAX (cpu direct access) state. DAX state attempts to minimize software cache effects for both I/O and memory mappings of this file. It requires a file system which has been configured to support DAX. DAX generally assumes all accesses are via cpu load / store instructions which can minimize overhead for small accesses, but may adversely affect cpu utilization for large transfers. File I/O is done directly to/from user-space buffers and memory mapped I/O may be performed with direct memory mappings that bypass kernel page cache. While the DAX property tends to result in data being transferred synchronously, it does not give the same guarantees of O_SYNC where data and the necessary metadata are transferred together. A DAX file may support being mapped with the MAP_SYNC flag, which enables a program to use CPU cache flush instructions to persist CPU store operations without an explicit fsync(2). See mmap(2) for more information. Reviewed-by: Dave Chinner Reviewed-by: Jan Kara Reviewed-by: Darrick J. Wong Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit efbe3c2493d2f7a1e1a753780fe727b34709ebd2 Author: Ira Weiny Date: Thu Apr 30 07:41:33 2020 -0700 fs: Remove unneeded IS_DAX() check in io_is_direct() Remove the check because DAX now has it's own read/write methods and file systems which support DAX check IS_DAX() prior to IOCB_DIRECT on their own. Therefore, it does not matter if the file state is DAX when the iocb flags are created. Also remove io_is_direct() as it is just a simple flag check. Reviewed-by: Dave Chinner Reviewed-by: Jan Kara Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Ira Weiny Signed-off-by: Darrick J. Wong commit 2dd43144e824afffd5ee31ce0df02c47afe83d76 Author: Ville Syrjälä Date: Wed Apr 29 21:54:57 2020 +0300 drm/i915: Streamline the artihmetic All these ROUNDING_FACTORs and whatnot are making this thing hard to read. Get rid of them. And let's massage some of the fractions to give us less questionable intermediate results and perhaps less divisions. Also looks like a good helping of 64bit math stuff is needed to avoid some of overflows present in the current code. There might still be a few overflows, namely when calculating link_clks_available/samples_room (would require a huge hblank though), and potentially when calculating hblank_rise (not sure how large link_clks_active can get). It looks like we're still not calculating exactly what the spec says since we truncate tu_data and tu_line early. But I'm too lazy to figure out if we could avoid that. v2: Fix typo in commit msg (Uma) Remove ROUNDING_FACTOR define (Uma) s/5*link_clk+5*cdclk/5*(link_clk+cdclk)/ (Chris) Cc: Anshuman Gupta Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200429185457.26235-3-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson Reviewed-by: Uma Shankar commit 41ee86d6ee820604adf7fdc873062d19804ba1cd Author: Ville Syrjälä Date: Wed Apr 29 21:54:56 2020 +0300 drm/i915: Rename variables to be consistent with bspec Since the code seems insistent on using the variable names from the bspec formulat, let's be consistent and use those names for all the things. For some reason 'link_clk' and 'lanes' were left out in the code until now. Cc: Anshuman Gupta Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200429185457.26235-2-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit d19b29be653691a179e54aafc84fc40667a63ee7 Author: Ville Syrjälä Date: Wed Apr 29 21:54:55 2020 +0300 drm/i915: Nuke mode.vrefresh usage mode.vrefresh is rounded to the nearest integer. You don't want to use it anywhere that requires precision. Also I want to nuke it. vtotal*vrefresh == 1000*clock/htotal, so let's use the latter. Cc: Anshuman Gupta Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200429185457.26235-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson Reviewed-by: Uma Shankar commit dab3aff7b1a503819c68e38f51b3dcc0508b35cd Author: Ville Syrjälä Date: Thu Apr 30 15:58:22 2020 +0300 drm/i915: Remove cnl pre-prod workarounds Remove all the stepping dependent cnl workarounds. Bspec lists more steppings than this so presumably these are classed as pre-production. And this is cnl after all so no one should really care anyway. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200430125822.21985-2-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit 25444ca6cbb9fe375aa9bba58784a735efe2a649 Author: Ville Syrjälä Date: Wed Apr 29 13:10:23 2020 +0300 drm/i915/fbc: Require linear fb stride to be multiple of 512 bytes on gen9/glk Display WA #1105 says that FBC requires PLANE_STRIDE to be a multiple of 512 bytes on gen9 and glk. This is definitely true for glk as certain tests (such as igt/kms_big_fb/linear-16bpp-rotate-0) are now failing when the display resolution results in a plane stride which is not a multiple of 512 bytes. Curiously I was not able to reproduce this on a KBL. First I suspected that our use of the FBC override stride explain this, but after trying to use the override stride on glk the test still failed. I did try both the old CHICKEN_MISC_4 way and the new FBC_STRIDE way, neither had any effect on the result. Anyways, we need this at least on glk. But let's trust the spec and apply the w/a for all gen9 as well, despite being unable to reproduce the problem. v2: s/FBC_CHICKEN/FBC_STRIDE/ in commit msg Cc: José Roberto de Souza Fixes: 691f7ba58d52 ("drm/i915/display/fbc: Make fences a nice-to-have for GEN9+") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200429101034.8208-2-ville.syrjala@linux.intel.com Reviewed-by: Matt Roper commit 9ff79708c54d34a3d4d451b15f8d6e5e042f1d36 Author: Stanislav Lisovskiy Date: Thu Apr 23 10:59:00 2020 +0300 drm/i915: Rename bw_state to new_bw_state That is a preparation patch before next one where we introduce old_bw_state and a bunch of other changes as well. In a review comment it was suggested to split out at least that renaming into a separate patch, what is done here. v2: Removed spurious space Reviewed-by: Ville Syrjälä Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200423075902.21892-8-stanislav.lisovskiy@intel.com commit ecab0f3d055d333640bbe2aa5a5141574a65c534 Author: Stanislav Lisovskiy Date: Thu Apr 30 22:56:34 2020 +0300 drm/i915: Track active_pipes in bw_state We need to calculate SAGV mask also in a non-modeset commit, however currently active_pipes are only calculated for modesets in global atomic state, thus now we will be tracking those also in bw_state in order to be able to properly access global data. v2: - Removed pre/post plane SAGV updates from modeset(Ville) - Now tracking active pipes in intel_can_enable_sagv(Ville) v3: - lock global state if active_pipes change as well(Ville) Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200430195634.7666-1-stanislav.lisovskiy@intel.com commit 9728889f42b9ba078f86cd11535a89df29e93b33 Author: Stanislav Lisovskiy Date: Thu Apr 30 22:17:57 2020 +0300 drm/i915: Use bw state for per crtc SAGV evaluation Future platforms require per-crtc SAGV evaluation and serializing global state when those are changed from different commits. v2: - Add has_sagv check to intel_crtc_can_enable_sagv so that it sets bit in reject mask. - Use bw_state in intel_pre/post_plane_enable_sagv instead of atomic state v3: - Fixed rebase conflict, now using intel_atomic_crtc_state_for_each_plane_state in order to call it from atomic check v4: - Use fb modifier from plane state v5: - Make intel_has_sagv static again(Ville) - Removed unnecessary NULL assignments(Ville) - Removed unnecessary SAGV debug(Ville) - Call intel_compute_sagv_mask only for modesets(Ville) - Serialize global state only if sagv results change, but not mask itself(Ville) v6: - use lock global state instead of serialize(Ville) v7: - use both global state lock and serialize depending on if we need to change only global state or access hw (Ville) Signed-off-by: Stanislav Lisovskiy Cc: Ville Syrjälä Cc: James Ausmus Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200430191757.18206-1-stanislav.lisovskiy@intel.com commit 952c0e260f8dd44ddb6ff0e260130f1906f7bcf3 Author: Tang Bin Date: Mon May 4 14:59:47 2020 +0800 ASoC: qcom: Use the defined variable to simplify code Use the defined variable "dev" to make the code cleaner. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200504065947.12172-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit d696a61413b405a13bbe04f31e6f4531a426fee7 Author: Jack Yu Date: Mon May 4 19:20:13 2020 +0800 ASoC: rt1015: Add condition to prevent SoC providing bclk in ratio of 50 times of sample rate. Add condition to prevent SoC providing bclk in ratio of 50 times of sample rate. Signed-off-by: Jack Yu Link: https://lore.kernel.org/r/20200504112013.2499-1-jack.yu@realtek.com Signed-off-by: Mark Brown commit c25504ad64fe391acb23dcfab039831c3825c17e Author: Oder Chiou Date: Mon May 4 15:40:07 2020 +0800 ASoC: rl6231: Add the K bypass for the PLL parameters The patch adds the K bypass for the PLL parameters. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200504074007.13002-2-oder_chiou@realtek.com Signed-off-by: Mark Brown commit c9ed436fd69b296001fccaa8469f329be3a12a96 Author: Jonathan Bakker Date: Fri May 1 16:50:18 2020 -0700 ARM: dts: s5pv210: Set MAX8998 GPIO pulls on Aries boards Make sure that the GPIOs are configured correctly for the interrupt (otherwise it won't fire) and disable the pulls on the DVS GPIOs which are outputs. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 18c41a634ebea85d5f34b0483bbecb758ebc8d27 Author: Jonathan Bakker Date: Fri May 1 16:50:17 2020 -0700 ARM: dts: s5pv210: Correct FIMC definitions The extended mainscaler is only available on FIMC1 and there are minimum pixel alignments that differ from the default. Additionally, the cam-if interface is available on all three while FIMC2 has no rotators. The lcd-wb interface is supported on FIMC1. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 44a390fb43d37aedf928afc3e2b3ec0902f9c7fc Author: Jonathan Bakker Date: Fri May 1 16:50:16 2020 -0700 ARM: dts: s5pv210: Assign clocks to MMC devices on Aries boards The SHDCI controller on Aries devices is a little bit peculiar about the clocks and with a slightly off clock can run into errors such as: mmc2: ADMA error: 0x02000000 mmc2: sdhci: ============ SDHCI REGISTER DUMP =========== mmc2: sdhci: Sys addr: 0x347e4cc4 | Version: 0x00002401 mmc2: sdhci: Blk size: 0x00007004 | Blk cnt: 0x0000fffc mmc2: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 mmc2: sdhci: Present: 0x01fa0000 | Host ctl: 0x00000012 mmc2: sdhci: Power: 0x00000000 | Blk gap: 0x00000000 mmc2: sdhci: Wake-up: 0x00000000 | Clock: 0x0000010f mmc2: sdhci: Timeout: 0x0000000a | Int stat: 0x00000003 mmc2: sdhci: Int enab: 0x03ff004b | Sig enab: 0x03ff004b mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000001 mmc2: sdhci: Caps: 0x05e80080 | Caps_1: 0x00000000 mmc2: sdhci: Cmd: 0x0000163a | Max curr: 0x00000000 mmc2: sdhci: Resp[0]: 0x00000920 | Resp[1]: 0x00000000 mmc2: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 mmc2: sdhci: Host ctl2: 0x00000000 mmc2: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x349a3208 mmc2: sdhci: ============================================ mmc2: sdhci: 349a3200: DMA 0x347e4cc0, LEN 0x0004, Attr=0x23 Specifically assign the MMC sclks to be parented from MPLL with specific rates that match the vendor kernel. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 07297ea732ddb2b731127448f09f066ed6d5637f Author: Jonathan Bakker Date: Fri May 1 16:50:15 2020 -0700 ARM: dts: s5pv210: Enable ADC on Aries boards On Aries boards, the ADC is used for things such as jack detection and battery temperature monitoring. It is supplied by LDO4 of max8998, so only enable that regulator when we are actually using the ADC. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit e39d3a4b23f79097d78fed56613a59281921c606 Author: Jonathan Bakker Date: Fri May 1 16:50:14 2020 -0700 ARM: dts: s5pv210: Add an ADC node The exynos-adc driver now supports the S5PV210, so add the DT node so that devices can use it. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 04568cb58a431e51efccd98853ba3a31f758b77f Author: Jonathan Bakker Date: Fri May 1 16:50:13 2020 -0700 ARM: dts: s5pv210: Disable pull for vibrator enable GPIO on Aries boards The enable GPIO for the fixed vibrator regulator shouldn't be pulled in one direction or the other. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 94f3c8132c30faff0391ec60e2eb72f51474c8c1 Author: Paweł Chmiel Date: Fri May 1 16:50:12 2020 -0700 ARM: dts: s5pv210: Add si470x FM radio to Galaxy S Add support for the Silicon Labs si4709 FM radio, which can be found on Galaxy S GT-i9000 (but not on most of other Aries variants). Signed-off-by: Paweł Chmiel Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit e619c4ef3839adff77b3c9b7bf30eb23c516c041 Author: Jonathan Bakker Date: Fri May 1 16:50:11 2020 -0700 ARM: dts: s5pv210: Add remaining i2c-gpio adapters to Aries boards The remaining i2c-gpio adapters that are common to all Aries boards have devices without mainline bindings attachted to them. Add them here for documentation. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit ecd7a47382e5a9b290943e72195a4a3669bd3479 Author: Jonathan Bakker Date: Fri May 1 16:50:10 2020 -0700 ARM: dts: s5pv210: Add panel support to Aries boards Aries boards have an s6e63m0 AMOLED panel connected over i2c-spi. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 849994778e485d2185c2e9363e89e3eb5410e10e Author: Jonathan Bakker Date: Fri May 1 16:50:09 2020 -0700 ARM: dts: s5pv210: Add touchkey support to Aries boards Aries boards have soft touchkeys, manufactured by Cypress, attached over i2c-gpio. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 3a4e7635d120dd1856ef8758724e7c6ec9a4d9d1 Author: Jonathan Bakker Date: Fri May 1 16:50:08 2020 -0700 ARM: dts: s5pv210: Add FSA9480 support to Aries boards The Fairchild FSA9480 is a USB mux connected over i2c-gpio. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit aa2146416dbe2b9529267d6d17e1926fbde5a5b9 Author: Jonathan Bakker Date: Fri May 1 16:50:07 2020 -0700 ARM: dts: s5pv210: Add WM8994 support to Aries boards Aries boards have a Wolfson WM8994 sound card attached over gpio-i2c. There is currently no ASoC Machine Driver. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 09b39f60ee09aca4bebd2f53258814d755628529 Author: Jonathan Bakker Date: Fri May 1 16:50:06 2020 -0700 ARM: dts: s5pv210: Disable pulls on GPIO I2C adapters for Aries The bitbanged GPIO I2C adapters have external pull-ups attached so the internal pulls should be disabled for lower power usage. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 869d42e6eba821905e1a0950623aadafe1a6e6d3 Author: Jonathan Bakker Date: Fri May 1 16:50:05 2020 -0700 ARM: dts: s5pv210: Set keep-power-in-suspend for SDHCI1 on Aries SDHCI1 is connected to a BCM4329 WiFi/BT chip which requires power to be kept over suspend. As the surrounding hardware supports this, mark it as such. This fixes WiFi after a suspend/resume cycle. Fixes: 170642468a51 ("ARM: dts: s5pv210: Add initial DTS for Samsung Aries based phones") Cc: Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 386c7b372dd8ba9c6706084ade089a1f90551017 Author: Jonathan Bakker Date: Fri May 1 16:50:19 2020 -0700 ARM: dts: s5pv210: Correct gpi pinctrl node name The node name was gpgi, but the pinctrl driver was registering the pins as just gpi and the "samsung,pins" i2s0 pinctrl entries refer to gpi. The public S5PC110 datasheet also refers to these pins as just gpi, so let's make sure everything is in sync and rename the node to gpi. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 47d67e4d19184ec9f8091c98ad4df0411baa8719 Author: Mark Brown Date: Mon May 4 14:13:26 2020 +0100 arm64: insn: Report PAC and BTI instructions as skippable The PAC and BTI instructions can be safely skipped so report them as such, allowing them to be probed. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200504131326.18290-5-broonie@kernel.org Signed-off-by: Will Deacon commit c71052cc9e14db90d9a95fe0991ecc72556f1818 Author: Mark Brown Date: Mon May 4 14:13:25 2020 +0100 arm64: insn: Don't assume unrecognized HINTs are skippable Currently the kernel assumes that any HINT which it does not explicitly recognise is skippable. This is not robust as new instructions may be added which need special handling, and in any case software should only be using explicit NOP instructions for deliberate NOPs. This has the effect of rendering PAC and BTI instructions unprobeable which means that probes can't be inserted on the first instruction of functions built with those features. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200504131326.18290-4-broonie@kernel.org Signed-off-by: Will Deacon commit 07dcd9677c5d0f4735041885d3c3c348cc11b75c Author: Mark Brown Date: Mon May 4 14:13:24 2020 +0100 arm64: insn: Provide a better name for aarch64_insn_is_nop() The current aarch64_insn_is_nop() has exactly one caller which uses it solely to identify if the instruction is a HINT that can safely be stepped, requiring us to list things that aren't NOPs and make things more confusing than they need to be. Rename the function to reflect the actual usage and make things more clear. Suggested-by: Mark Rutland Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200504131326.18290-3-broonie@kernel.org Signed-off-by: Will Deacon commit bd507ca2773b20f554a3e14f7aa9080e45ee399a Author: Mark Brown Date: Mon May 4 14:13:23 2020 +0100 arm64: insn: Add constants for new HINT instruction decode Add constants for decoding newer instructions defined in the HINT space. Since we are now decoding both the op2 and CRm fields rename the enum as well; this is compatible with what the existing users are doing. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200504131326.18290-2-broonie@kernel.org Signed-off-by: Will Deacon commit 02ab1f5018c3ad0b8677e797b5d3333d2e3b7f20 Author: Andrew Scull Date: Mon May 4 10:48:58 2020 +0100 arm64: Unify WORKAROUND_SPECULATIVE_AT_{NVHE,VHE} Errata 1165522, 1319367 and 1530923 each allow TLB entries to be allocated as a result of a speculative AT instruction. In order to avoid mandating VHE on certain affected CPUs, apply the workaround to both the nVHE and the VHE case for all affected CPUs. Signed-off-by: Andrew Scull Acked-by: Will Deacon CC: Marc Zyngier CC: James Morse CC: Suzuki K Poulose CC: Will Deacon CC: Steven Price Link: https://lore.kernel.org/r/20200504094858.108917-1-ascull@google.com Signed-off-by: Will Deacon commit c648c9c7429e979ca081359f39b6902aed92d490 Author: Luke Nelson Date: Thu Apr 30 19:02:10 2020 -0700 bpf, arm: Optimize ALU ARSH K using asr immediate instruction This patch adds an optimization that uses the asr immediate instruction for BPF_ALU BPF_ARSH BPF_K, rather than loading the immediate to a temporary register. This is similar to existing code for handling BPF_ALU BPF_{LSH,RSH} BPF_K. This optimization saves two instructions and is more consistent with LSH and RSH. Example of the code generated for BPF_ALU32_IMM(BPF_ARSH, BPF_REG_0, 5) before the optimization: 2c: mov r8, #5 30: mov r9, #0 34: asr r0, r0, r8 and after optimization: 2c: asr r0, r0, #5 Tested on QEMU using lib/test_bpf and test_verifier. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200501020210.32294-3-luke.r.nels@gmail.com commit cf48db69bdfad2930b95fd51d64444e5a7b469ae Author: Luke Nelson Date: Thu Apr 30 19:02:09 2020 -0700 bpf, arm: Optimize ALU64 ARSH X using orrpl conditional instruction This patch optimizes the code generated by emit_a32_arsh_r64, which handles the BPF_ALU64 BPF_ARSH BPF_X instruction. The original code uses a conditional B followed by an unconditional ORR. The optimization saves one instruction by removing the B instruction and using a conditional ORR (with an inverted condition). Example of the code generated for BPF_ALU64_REG(BPF_ARSH, BPF_REG_0, BPF_REG_1), before optimization: 34: rsb ip, r2, #32 38: subs r9, r2, #32 3c: lsr lr, r0, r2 40: orr lr, lr, r1, lsl ip 44: bmi 0x4c 48: orr lr, lr, r1, asr r9 4c: asr ip, r1, r2 50: mov r0, lr 54: mov r1, ip and after optimization: 34: rsb ip, r2, #32 38: subs r9, r2, #32 3c: lsr lr, r0, r2 40: orr lr, lr, r1, lsl ip 44: orrpl lr, lr, r1, asr r9 48: asr ip, r1, r2 4c: mov r0, lr 50: mov r1, ip Tested on QEMU using lib/test_bpf and test_verifier. Co-developed-by: Xi Wang Signed-off-by: Xi Wang Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200501020210.32294-2-luke.r.nels@gmail.com commit e4e5f695085fe6d1b42565d1ebbeefdd64027e4d Author: Jonathan Bakker Date: Fri May 1 16:50:04 2020 -0700 ARM: dts: s5pv210: Add sleep GPIO configuration for Galaxy S In order to minimize leakage current during sleep, set a config for sleep GPIOs. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit d7d155a7693fcb5e53f2db723cc6586830575a10 Author: Jonathan Bakker Date: Fri May 1 16:50:03 2020 -0700 ARM: dts: s5pv210: Add sleep GPIO configuration for Fascinate4G In order to minimize leakage current during sleep, set a config for sleep GPIOs. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 6a52e305f2ac66eed32701e8717c1066d2a3c8ff Author: Jonathan Bakker Date: Fri May 1 16:50:02 2020 -0700 ARM: dts: s5pv210: Add helper define for sleep gpio config To simplify writing of sleep gpio configs, add a common helper similar to what is present for other Samsung CPUs. Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit f2b1e1cbd352129cfdbc1af52059482d74b4e81a Author: Chris Garren Date: Mon May 4 09:43:20 2020 -0400 ASoC: adau7118: Mark the ADAU7118 reset register as volatile Without this the previously written value was written to this reg, which caused the different configuration registers to be reset. Signed-off-by: Chris Garren Link: https://lore.kernel.org/r/1588599820-57994-1-git-send-email-cdgarren@indesign-llc.com Signed-off-by: Mark Brown commit e3d291301f99ef98d71bf858478bd4a3c5525bfe Author: Chris Wilson Date: Mon May 4 15:06:29 2020 +0100 drm/i915/gem: Implement legacy MI_STORE_DATA_IMM The older arches did not convert MI_STORE_DATA_IMM to using the GTT, but left them writing to a physical address. The notes suggest that the primary reason would be so that the writes were cache coherent, as the CPU cache uses physical tagging. As such we did not implement the legacy variant of MI_STORE_DATA_IMM and so left all the relocations synchronous -- but with a small function to convert from the vma address into the physical address, we can implement asynchronous relocs on these older arches, fixing up a few tests that require them. In order to be able to test the legacy paths, refactor the gpu relocations so that we can hook them up to a selftest. v2: Use an array of offsets not enum labels for the selftest v3: Refactor the common igt_hexdump() Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/757 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200504140629.28240-1-chris@chris-wilson.co.uk commit f5b62bdbb6262de1c46205cd4167b4e90cb0d4cf Author: Chris Wilson Date: Mon May 4 13:51:49 2020 +0100 drm/i915/gem: Specify address type for chained reloc batches It is required that a chained batch be in the same address domain as its parent, and also that must be specified in the command for earlier gen as it is not inferred from the chaining until gen6. Fixes: 964a9b0f611e ("drm/i915/gem: Use chained reloc batches") Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200504125149.4396-1-chris@chris-wilson.co.uk commit 40ba9309c76f29d012a5cc0cf938f8ff7dc6fef2 Author: Vamshi K Sthambamkadi Date: Thu Apr 23 18:09:48 2020 +0530 x86/boot: Fix -Wint-to-pointer-cast build warning Fix this warning when building 32-bit with CONFIG_RANDOMIZE_BASE=y CONFIG_MEMORY_HOTREMOVE=y arch/x86/boot/compressed/acpi.c:316:9: warning: \ cast to pointer from integer of different size [-Wint-to-pointer-cast] Have get_cmdline_acpi_rsdp() return unsigned long which is the proper type to convert to a pointer of the respective width. [ bp: Rewrite commit message, touch ups. ] Signed-off-by: Vamshi K Sthambamkadi Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/1587645588-7130-3-git-send-email-vamshi.k.sthambamkadi@gmail.com commit 5fafbebc86a0043ca5bbd8d3ce4f63dc5a02ad8e Author: Vamshi K Sthambamkadi Date: Thu Apr 23 18:09:47 2020 +0530 x86/boot: Add kstrtoul() from lib/ Add kstrtoul() to ../boot/ to be used by facilities there too. [ bp: Massage, make _kstrtoul() static. Prepend function names with "boot_". This is a temporary workaround for build errors like: ld: arch/x86/boot/compressed/acpi.o: in function `count_immovable_mem_regions': acpi.c:(.text+0x463): undefined reference to `_kstrtoul' make[2]: *** [arch/x86/boot/compressed/Makefile:117: arch/x86/boot/compressed/vmlinux] Error 1 due to the namespace clash between x86/boot/ and kernel proper. Future reorg will get rid of the linux/linux/ namespace as much as possible so that x86/boot/ can be independent from kernel proper. ] Signed-off-by: Vamshi K Sthambamkadi Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/1587645588-7130-2-git-send-email-vamshi.k.sthambamkadi@gmail.com commit 140777a3d8dfdb3d3f20ea7707c0f1c0ce1b0aa5 Author: Hari Bathini Date: Mon Apr 20 14:26:22 2020 +0530 powerpc/fadump: consider reserved ranges while reserving memory Commit 0962e8004e97 ("powerpc/prom: Scan reserved-ranges node for memory reservations") enabled support to parse reserved-ranges DT node and reserve kernel memory falling in these ranges for F/W purposes. Memory reserved for FADump should not overlap with these ranges as it could corrupt memory meant for F/W or crash'ed kernel memory to be exported as vmcore. But since commit 579ca1a27675 ("powerpc/fadump: make use of memblock's bottom up allocation mode"), memblock_find_in_range() is being used to find the appropriate area to reserve memory for FADump, which can't account for reserved-ranges as these ranges are reserved only after FADump memory reservation. With reserved-ranges now being populated during early boot, look out for these memory ranges while reserving memory for FADump. Without this change, MPIPL on PowerNV systems aborts with hostboot failure, when memory reserved for FADump is less than 4096MB. Fixes: 579ca1a27675 ("powerpc/fadump: make use of memblock's bottom up allocation mode") Cc: stable@vger.kernel.org Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/158737297693.26700.16193820746269425424.stgit@hbathini.in.ibm.com commit 02c04e374e176ae3a3f64a682f80702f8d2fb65d Author: Hari Bathini Date: Mon Apr 20 14:26:09 2020 +0530 powerpc/fadump: use static allocation for reserved memory ranges At times, memory ranges have to be looked up during early boot, when kernel couldn't be initialized for dynamic memory allocation. In fact, reserved-ranges look up is needed during FADump memory reservation. Without accounting for reserved-ranges in reserving memory for FADump, MPIPL boot fails with memory corruption issues. So, extend memory ranges handling to support static allocation and populate reserved memory ranges during early boot. Fixes: dda9dbfeeb7a ("powerpc/fadump: consider reserved ranges while releasing memory") Cc: stable@vger.kernel.org Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/158737294432.26700.4830263187856221314.stgit@hbathini.in.ibm.com commit 44b6141ebe936808fc59b386e3e259bef6c9bba6 Author: Lad Prabhakar Date: Wed Apr 29 22:56:40 2020 +0100 ARM: multi_v7_defconfig: Enable r8a7742 SoC Enable recently added r8a7742 (RZ/G1H) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588197415-13747-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1a90c5ba48c43aeaeccebcd3e092888b670a4bab Author: Lad Prabhakar Date: Wed Apr 29 22:56:39 2020 +0100 ARM: shmobile: defconfig: Enable r8a7742 SoC Enable recently added r8a7742 (RZ/G1H) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588197415-13747-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 43c8a496fa37187b54f7df71fb8262acc6bf6200 Author: Xiongfeng Wang Date: Wed Apr 29 18:00:48 2020 +0800 powerpc/ps3: Move static keyword to the front of declaration Move the static keyword to the front of declaration of 'vuart_bus_priv', and resolve the following compiler warning that can be seen when building with warnings enabled (W=1): drivers/ps3/ps3-vuart.c:867:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] } static vuart_bus_priv; ^ Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1588154448-56759-1-git-send-email-wangxiongfeng2@huawei.com commit 96866b1a1d32318b6bbc321a762bf79db1f4686e Author: Lad Prabhakar Date: Wed Apr 29 22:56:41 2020 +0100 ARM: debug-ll: Add support for r8a7742 Enable low-level debugging support for RZ/G1H (R8A7742). RZ/G1H uses SCIFA2 for the debug console. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588197415-13747-5-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit cdc8abe763c99a6c2b854d7096eaf1ea21017a42 Author: Lad Prabhakar Date: Wed Apr 29 22:56:38 2020 +0100 soc: renesas: Add Renesas R8A7742 config option Add configuration option for the RZ/G1H (R8A77420) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1588197415-13747-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 454b3766de45f8508b343e509fdde959b4ff289c Author: Wolfram Sang Date: Sat May 2 16:26:46 2020 +0200 ASoC: codecs: max9768: update contact email The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20200502142646.19033-1-wsa@kernel.org Signed-off-by: Mark Brown commit 1a446873d7dd3a450f685928ce7f1907bde4583d Author: Yong Zhi Date: Fri May 1 18:44:21 2020 -0500 ASoC: max98373: reorder max98373_reset() in resume During S3 test, the following error was observed: [ 726.174237] i2c_designware i2c_designware.0: platform_pm_resume+0x0/0x3d returned 0 after 0 usecs [ 726.184187] max98373 i2c-MX98373:00: calling max98373_resume+0x0/0x30 [snd_soc_max98373] @ 12698, parent: i2c-11 [ 726.195589] max98373 i2c-MX98373:00: Reset command failed. (ret:-16) When calling regmap_update_bits(), since map->reg_update_bits is NULL, _regmap_read() is entered with the following logic: if (!map->cache_bypass) { ret = regcache_read(map, reg, val); if (ret == 0) return 0; } if (map->cache_only) return -EBUSY; regcache_read() hits -EINVAL because MAX98373_R2000_SW_RESET is volatile, as map->cache_only is set by codec suspend, thus -EBUSY is returned. Fix by moving max98373_reset() after cache_only set to false in max98373_resume(). Signed-off-by: Yong Zhi Link: https://lore.kernel.org/r/1588376661-29799-1-git-send-email-yong.zhi@intel.com Signed-off-by: Mark Brown commit afcbaa20d662ce8c78b70e953fa8a045c7a243fb Author: Oder Chiou Date: Mon May 4 15:40:06 2020 +0800 ASoC: rt1308: Revise the devicetree file mode The patch changes the devicetree file mode correctly. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20200504074007.13002-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 50479d58eaa321f916fd916615710c634b8aafaf Author: Mark Brown Date: Fri May 1 12:54:30 2020 +0100 arm64: Disable old style assembly annotations Now that we have converted arm64 over to the new style SYM_ assembler annotations select ARCH_USE_SYM_ANNOTATIONS so the old macros aren't available and we don't regress. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200501115430.37315-4-broonie@kernel.org Signed-off-by: Will Deacon commit 0343a7e46362c3836ff27ceb749ee2b6f78aa982 Author: Mark Brown Date: Fri May 1 12:54:29 2020 +0100 arm64: kernel: Convert to modern annotations for assembly functions In an effort to clarify and simplify the annotation of assembly functions in the kernel new macros have been introduced. These replace ENTRY and ENDPROC and also add a new annotation for static functions which previously had no ENTRY equivalent. Update the annotations in the core kernel code to the new macros. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200501115430.37315-3-broonie@kernel.org Signed-off-by: Will Deacon commit 06607c7e93f2a4799346baa262d4304681e4b528 Author: Mark Brown Date: Fri May 1 12:54:28 2020 +0100 arm64: entry: Refactor and modernise annotation for ret_to_user As part of an effort to clarify and clean up the assembler annotations new macros have been introduced which annotate the start and end of blocks of code in assembler files. Currently ret_to_user has an out of line slow path work_pending placed above the main function which makes annotating the start and end of these blocks of code awkward. Since work_pending is only referenced from within ret_to_user try to make things a bit clearer by moving it after the current ret_to_user and then marking both ret_to_user and work_pending as part of a single ret_to_user code block. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200501115430.37315-2-broonie@kernel.org Signed-off-by: Will Deacon commit 539979b6ec62f7bba40b0452b0574a0f4ec4fe4e Author: Ard Biesheuvel Date: Fri May 1 18:10:14 2020 +0200 ACPI/IORT: work around num_ids ambiguity The ID mapping table structure of the IORT table describes the size of a range using a num_ids field carrying the number of IDs in the region minus one. This has been misinterpreted in the past in the parsing code, and firmware is known to have shipped where this results in an ambiguity, where regions that should be adjacent have an overlap of one value. So let's work around this by detecting this case specifically: when resolving an ID translation, allow one that matches right at the end of a multi-ID region to be superseded by a subsequent one. To prevent potential regressions on broken firmware that happened to work before, only take the subsequent match into account if it occurs at the start of a mapping region. Signed-off-by: Ard Biesheuvel Reviewed-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20200501161014.5935-3-ardb@kernel.org Signed-off-by: Will Deacon commit 6d3b29d07c3c55532e09d004a1466358c71affa7 Author: Ard Biesheuvel Date: Fri May 1 18:10:13 2020 +0200 Revert "ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map()" This reverts commit 3c23b83a88d00383e1d498cfa515249aa2fe0238. Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200501161014.5935-2-ardb@kernel.org Signed-off-by: Will Deacon commit 378974f7f9754acfd5630327917c6b813495f1a9 Author: Chris Wilson Date: Mon May 4 05:48:42 2020 +0100 drm/i915: Allow some leniency in PCU reads Extend the timeout for pcode reads to 20ms as they should not be performed along critical paths, and succeeding after a short delay is better than failing entirely. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1800 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200504044903.7626-1-chris@chris-wilson.co.uk commit 6983dafa310afdb416af091578019e58a773984e Author: Chris Wilson Date: Sun May 3 18:15:13 2020 +0100 drm/i915/gem: Lazily acquire the device wakeref for freeing objects We only need the device wakeref on freeing the objects if we have to unbind the object from the global GTT, or otherwise update device information. If the objects are clean, we never need the wakeref, so avoid taking until required. Signed-off-by: Chris Wilson Cc: Janusz Krzysztofik Reviewed-by: Janusz Krzysztofik Link: https://patchwork.freedesktop.org/patch/msgid/20200503171513.18704-1-chris@chris-wilson.co.uk commit 60019d8c650d20a7363285f88f4177dd48d029a7 Author: Sameer Pujar Date: Mon May 4 13:46:16 2020 +0530 ALSA: hda/tegra: workaround playback failure on Tegra194 Tegra194 has 4 SDO lines and with this configuration playback fails for 44.1K/48K, 2-channel and 16-bps. It results in below print, "aplay: pcm_write:2011: write error: Input/output error" Below relation is used to derive stripe control and is referenced from HD Audio Specification: Revision 1.0a. { ((num_channels * bits_per_sample) / number of SDOs) >= 8 } Due to a legacy HW design problem, playback issue is hit while using a stripe value resulting from above formula when ratio is '8'. Thus it is recommended that the ratio must be greater than '8'. Since the number of SDO lines is in powers of 2, next available ratio '16' is used as a limiting factor on Tegra194 to workaround the problem. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1588580176-2801-4-git-send-email-spujar@nvidia.com Signed-off-by: Takashi Iwai commit 67ae482a59e951c346b5a55a756504bc58ce7cfa Author: Sameer Pujar Date: Mon May 4 13:46:15 2020 +0530 ALSA: hda: add member to store ratio for stripe control Stripe control programming is governed by following formula, which is referenced from the HD Audio specification(Revision 1.0a). { ((num_channels * bits_per_sample) / number of SDOs) >= 8 } Currently above is implemented in snd_hdac_get_stream_stripe_ctl(). This patch introduces a structure member to store the default factor of '8'. If any HW wants to use a different value, this member can be easily updated. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1588580176-2801-3-git-send-email-spujar@nvidia.com Signed-off-by: Takashi Iwai commit bb9b02a4589cee66cdb92eb9b7191d6557afdd6f Author: Sameer Pujar Date: Mon May 4 13:46:14 2020 +0530 ALSA: hda/tegra: correct number of SDO lines for Tegra194 Tegra194 supports 4 SDO lines but GCAP register indicates 2 lines. Thus it does not reflect the true capability of the HW. This patch presents a workaround by updating NSDO value accordingly in T_AZA_DBG_CFG_2 register. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1588580176-2801-2-git-send-email-spujar@nvidia.com Signed-off-by: Takashi Iwai commit ea1b3bc6d5ad95fef32811bec7df37f51809f4e1 Author: Greg Kroah-Hartman Date: Wed Apr 29 12:15:26 2020 +0200 brcmfmac: no need to check return value of debugfs_create functions When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. In doing this, make brcmf_debugfs_add_entry() return void as no one was even paying attention to the return value. Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Chi-Hsien Lin Cc: Wright Feng Cc: Kalle Valo Cc: "David S. Miller" Cc: Pieter-Paul Giesberts Cc: Greg Kroah-Hartman Cc: "Rafał Miłecki" Cc: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list.pdl@broadcom.com Cc: brcm80211-dev-list@cypress.com Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200429101526.GA2094124@kroah.com commit ff2af09f4515422d6b464faf36b771aeb2819e46 Author: Jason Yan Date: Sun Apr 26 17:40:53 2020 +0800 brcmfmac: remove comparison to bool in brcmf_fws_attach() Fix the following coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c:2359:6-40: WARNING: Comparison to bool Signed-off-by: Jason Yan Reviewed-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200426094053.23132-1-yanaijie@huawei.com commit 2719afcae759e476bf1a7b19aefaec6433bb52ac Author: Ryohei Kondo Date: Mon Apr 27 02:00:03 2020 -0500 brcmfmac: add vendor ie for association responses Miracast Certification clause 6.1.2 may fail if there is no WFD IE in p2p assoc response. This change allows WFD IE to be added to p2p assoc response. Related WFA certification: 6.1.2 P-SnUT operating as a Group Owner accepts a WFD Session with a Reference Source Reviewed-by: Arend van Spriel Signed-off-by: Ryohei Kondo Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587970803-77700-6-git-send-email-chi-hsien.lin@cypress.com commit 053ac9e1438a1415a3b6b11d6e504c7a74ebd2ba Author: Chi-Hsien Lin Date: Mon Apr 27 02:00:02 2020 -0500 brcmfmac: only generate random p2p address when needed P2p spec mentioned that the p2p device address should be the globally administered address with locally administered bit set. Therefore, follow this guideline by default. When the primary interface is set to a locally administered address, the locally administered bit cannot be set again. Generate a random locally administered address for this case. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587970803-77700-5-git-send-email-chi-hsien.lin@cypress.com commit d524d5ce36555bec8b40d4b65f15acd922ac965d Author: Madhan Mohan R Date: Mon Apr 27 02:00:01 2020 -0500 brcmfmac: p2p cert 6.1.9-support GOUT handling p2p presence request Send p2p presence response from the p2p interface address instead of the p2p device address. This is needed for p2p cert 6.1.9 to pass. Signed-off-by: Madhan Mohan R Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587970803-77700-4-git-send-email-chi-hsien.lin@cypress.com commit 19f557a9b8d1e4bf3cb96fe4495f09833be53e92 Author: Wright Feng Date: Mon Apr 27 02:00:00 2020 -0500 brcmfmac: remove arp_hostip_clear from brcmf_netdev_stop The firmware does not respond ARP request and causes ping failure with following steps: 1. Bring up interface ifconfig wlan0 up or start wpa_supplicant 2. Set the IP address ifconfig wlan0 192.168.100.10 3. Bring down interface or ifconfig wlan0 down or kill wpa_supplicant 4. Bring up interface again and set the same IP address 5. Connect to AP(192.168.100.1) and ping to AP will be failed. FMAC clears arp_hostip when bringing down the interface, but not set it back if setting the same IP address. We are able to see the IP address in interface info(inconfig wlan0) but the ping still cannot work because the firmware ARP offload does not respond the ARP request. Because of that, we remove "arp_hostip_clear" from function "brcmf_netdev_stop" Signed-off-by: Wright Feng Signed-off-by: Chi-Hsien Lin Reviewed-by: Franky Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587970803-77700-3-git-send-email-chi-hsien.lin@cypress.com commit 774965f22dc740ff470d8f26b9a44c5c92a7715b Author: Wright Feng Date: Mon Apr 27 01:59:59 2020 -0500 brcmfmac: keep apsta enabled when AP starts with MCHAN feature When starting station mode on wlan0 and AP mode on wlan1, the apsta will be disabled and cause data stall on wlan0(station). The apsta feature with MCHAN(Multi-Channel Concurrent) or RSDB(Real Simultaneous Dual-Band) can make STA+AP work on two bands concurrently. Because of that, we keep apsta enabled if firmware supports MCHAN or RSDB features Signed-off-by: Wright Feng Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587970803-77700-2-git-send-email-chi-hsien.lin@cypress.com commit a6336094c3ab70efa8b16546a2e1e11d9afc8000 Author: Colin Ian King Date: Fri Apr 24 09:47:33 2020 +0100 rtw88: fix spelling mistake "fimrware" -> "firmware" There are spelling mistakes in two rtw_err error messages. Fix them. Signed-off-by: Colin Ian King Acked-by: Sebastian Andrzej Siewior Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424084733.7716-1-colin.king@canonical.com commit 421ae61c10567c6f347619b50b25cbe9d6e1f407 Author: Yan-Hsuan Chuang Date: Fri Apr 24 15:38:12 2020 +0800 rtw88: 8822c: update phy parameter tables to v50 Update RTL8822C devices' phy tables to v50. The new parameters introduces new RFE type 5 for some new modules. Also added a new regulatory CN for power limit. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424073812.26896-1-yhchuang@realtek.com commit bd96f1b2f43a39310cc576bb4faf2ea24317a4c9 Author: Alan Mikhak Date: Tue Apr 28 18:10:33 2020 -0700 dmaengine: dw-edma: support local dma device transfer semantics Modify dw_edma_device_transfer() to also support the semantics of dma device transfer for additional use cases involving pcitest utility as a local initiator. For its original use case, dw-edma supported the semantics of dma device transfer from the perspective of a remote initiator who is located across the PCIe bus from dma channel hardware. To a remote initiator, DMA_DEV_TO_MEM means using a remote dma WRITE channel to transfer from remote memory to local memory. A WRITE channel would be employed on the remote device in order to move the contents of remote memory to the bus destined for local memory. To a remote initiator, DMA_MEM_TO_DEV means using a remote dma READ channel to transfer from local memory to remote memory. A READ channel would be employed on the remote device in order to move the contents of local memory to the bus destined for remote memory. >From the perspective of a local dma initiator who is co-located on the same side of the PCIe bus as the dma channel hardware, the semantics of dma device transfer are flipped. To a local initiator, DMA_DEV_TO_MEM means using a local dma READ channel to transfer from remote memory to local memory. A READ channel would be employed on the local device in order to move the contents of remote memory to the bus destined for local memory. To a local initiator, DMA_MEM_TO_DEV means using a local dma WRITE channel to transfer from local memory to remote memory. A WRITE channel would be employed on the local device in order to move the contents of local memory to the bus destined for remote memory. To support local dma initiators, dw_edma_device_transfer() is modified to now examine the direction field of struct dma_slave_config for the channel which initiators can configure by calling dmaengine_slave_config(). If direction is configured as either DMA_DEV_TO_MEM or DMA_MEM_TO_DEV, local initiator semantics are used. If direction is a value other than DMA_DEV_TO_MEM nor DMA_MEM_TO_DEV, then remote initiator semantics are used. This should maintain backward compatibility with the original use case of dw-edma. The dw-edma-test utility is an example of a remote initiator. From reading its patch, dw-edma-test does not specifically set the direction field of struct dma_slave_config. Since dw_edma_device_transfer() also does not check the direction field of struct dma_slave_config, it seems safe to use this convention in dw-edma to support both local and remote initiator semantics. Signed-off-by: Alan Mikhak Link: https://lore.kernel.org/r/1588122633-1552-1-git-send-email-alan.mikhak@sifive.com Signed-off-by: Vinod Koul commit 657680cc86ca4b5d49b5bb313b1320fb8439528c Author: Sathishkumar Muruganandam Date: Tue Apr 28 10:15:26 2020 +0530 ath11k: add DBG_MAC prints to track vdev events Added DBG_MAC prints to track vdev create, delete, start and stop events. Signed-off-by: Sathishkumar Muruganandam Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588049126-1490-3-git-send-email-murugana@codeaurora.org commit 66307ca040575e6200a5d40656e2dee71d9da91c Author: Sathishkumar Muruganandam Date: Tue Apr 28 10:15:25 2020 +0530 ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev In Multi-AP VAP scenario with frequent interface up-down, there is a chance that ath11k_mgmt_over_wmi_tx_work() will dequeue a skb corresponding to currently deleted/stopped vdev. FW will assert on receiving mgmt_tx_wmi cmd for already deleted vdev. Hence adding validation checks for arvif present on the corresponding ar before sending mgmt_tx_wmi cmd. Signed-off-by: Sathishkumar Muruganandam Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588049126-1490-2-git-send-email-murugana@codeaurora.org commit f76f750aeea47fd98b6502eb6d37f84ca33662bf Author: Wei Yongjun Date: Mon Apr 27 10:46:21 2020 +0000 ath11k: fix error return code in ath11k_dp_alloc() Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: d0998eb84ed3 ("ath11k: optimise ath11k_dp_tx_completion_handler") Signed-off-by: Wei Yongjun Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427104621.23752-1-weiyongjun1@huawei.com commit 2326aa011967f0afbcba7fe1a005d01f8b12900b Author: Wei Yongjun Date: Mon Apr 27 10:43:48 2020 +0000 ath10k: fix possible memory leak in ath10k_bmi_lz_data_large() 'cmd' is malloced in ath10k_bmi_lz_data_large() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: d58f466a5dee ("ath10k: add large size for BMI download data for SDIO") Signed-off-by: Wei Yongjun Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427104348.13570-1-weiyongjun1@huawei.com commit c1070c1c6ceb8414976440485239b200af91eef5 Merge: 86501437d885 cbc636557d2d Author: Kalle Valo Date: Mon May 4 11:45:47 2020 +0300 Merge tag 'iwlwifi-next-for-kalle-2020-04-24-2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next First set of iwlwifi patches intended for v5.8 * TX queue debugfs improvements; * Support for a few new FW API versions; * Remove deprecated scan FW API version; * New hw configs and other related changes; * Support for NPK buffers in debugging; * More debugging fetures; * Some other small fixes and clean-ups; # gpg: Signature made Fri 24 Apr 2020 04:39:43 PM EEST using RSA key ID 1A3CC5FA # gpg: Good signature from "Luciano Roth Coelho (Luca) " # gpg: aka "Luciano Roth Coelho (Intel) " commit 3a06c204fbc83de2a7eb6fc2f4548f813faed454 Author: Tiezhu Yang Date: Sun May 3 08:05:02 2020 +0800 MIPS: tools: Move "returns" after "loongson3-llsc-check" Just move "returns" after "loongson3-llsc-check", no function changes. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 3b4ff4eb904fef04c36b39052ca8eb31fa41fad0 Author: He Zhe Date: Wed Mar 4 14:39:07 2020 +0800 x86/mcelog: Add compat_ioctl for 32-bit mcelog support A 32-bit version of mcelog issuing ioctls on /dev/mcelog causes errors like the following: MCE_GET_RECORD_LEN: Inappropriate ioctl for device This is due to a missing compat_ioctl callback. Assign to it compat_ptr_ioctl() as a generic implementation of the .compat_ioctl file operation to ioctl functions that either ignore the argument or pass a pointer to a compatible data type. [ bp: Massage commit message. ] Signed-off-by: He Zhe Signed-off-by: Borislav Petkov Acked-by: Tony Luck Link: https://lkml.kernel.org/r/1583303947-49858-1-git-send-email-zhe.he@windriver.com commit 4f8dad0aaca4f42070eeda21d38f79be5d92cc04 Author: Robert Marko Date: Sun May 3 22:18:23 2020 +0200 dt-bindings: phy-qcom-ipq4019-usb: add binding document This patch adds the binding documentation for the HS/SS USB PHY found inside Qualcom Dakota SoCs. Signed-off-by: John Crispin Signed-off-by: Robert Marko Reviewed-by: Rob Herring Cc: Luka Perkov Link: https://lore.kernel.org/r/20200503201823.531757-2-robert.marko@sartura.hr Signed-off-by: Vinod Koul commit 3c9d8f6c03a2cda1849ec3c84f82ec030d1f49ef Author: Robert Marko Date: Sun May 3 22:18:22 2020 +0200 phy: add driver for Qualcomm IPQ40xx USB PHY Add a driver to setup the USB PHY-s on Qualcom m IPQ40xx series SoCs. The driver sets up HS and SS phys. Signed-off-by: John Crispin Signed-off-by: Robert Marko Cc: Luka Perkov Link: https://lore.kernel.org/r/20200503201823.531757-1-robert.marko@sartura.hr Signed-off-by: Vinod Koul commit 56a9a8068637b624f6724f58c6137f4410616558 Author: Nathan Chancellor Date: Fri May 1 19:59:58 2020 -0700 firmware: xilinx: Export zynqmp_pm_fpga_{get_status,load} When building arm64 allmodconfig: ERROR: modpost: "zynqmp_pm_fpga_load" [drivers/fpga/zynqmp-fpga.ko] undefined! ERROR: modpost: "zynqmp_pm_fpga_get_status" [drivers/fpga/zynqmp-fpga.ko] undefined! These functions were added to drivers/fpga/zynqmp-fpga.c but not exported so the module build breaks. Export them so that they can be used in modules properly. Fixes: 4db8180ffe7c ("firmware: xilinx: Remove eemi ops for fpga related APIs") Signed-off-by: Nathan Chancellor Reported-by: "kernelci.org bot" Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20200502025958.2714249-1-natechancellor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9872e23d6879ee04c7fe8372328195d12e977071 Author: Andy Shevchenko Date: Wed Apr 29 15:21:51 2020 +0300 dmaengine: Fix doc strings to satisfy validation script The validation kernel doc script complains about undescribed function parameters .../dmaengine.c:155: warning: Function parameter or member 'dev' not descr ibed in 'dev_to_dma_chan' .../dmaengine.c:251: warning: cannot understand function prototype: 'dma_cap_mask_t dma_cap_mask_all; ' .../dmaengine.c:257: warning: cannot understand function prototype: 'struct dma_chan_tbl_ent ' .../dmaengine.c:264: warning: cannot understand function prototype: 'struct dma_chan_tbl_ent __percpu *channel_table[DMA_TX_TYPE_END]; ' .../dmaengine.c:304: warning: Function parameter or member 'chan' not described in 'dma_chan_is_local' .../dmaengine.c:304: warning: Function parameter or member 'cpu' not described in 'dma_chan_is_local' .../dmaengine.c:414: warning: Function parameter or member 'chan' not described in 'balance_ref_count' .../dmaengine.c:447: warning: Function parameter or member 'chan' not described in 'dma_chan_get' .../dmaengine.c:494: warning: Function parameter or member 'chan' not described in 'dma_chan_put' Add descriptions to the function parameters and in some cases update existing text as well. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200429122151.50989-2-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 833d88f3fd50a54544a7e71edef0877bb7b769c1 Author: Andy Shevchenko Date: Wed Apr 29 15:21:50 2020 +0300 dmaengine: Include dmaengine.h into dmaengine.c Compiler is not happy about non-static functions due to missed inclusion .../dmaengine.c:682:18: warning: no previous prototype for ‘dma_get_slave_channel’ [-Wmissing-prototypes] 682 | struct dma_chan *dma_get_slave_channel(struct dma_chan *chan) | ^~~~~~~~~~~~~~~~~~~~~ .../dmaengine.c:713:18: warning: no previous prototype for ‘dma_get_any_slave_channel’ [-Wmissing-prototypes] 713 | struct dma_chan *dma_get_any_slave_channel(struct dma_device *device) | ^~~~~~~~~~~~~~~~~~~~~~~~~ Include missed header to satisfy compiler. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200429122151.50989-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 2dea651680cea1f3a29925de51002f33d1f55711 Author: Ansuel Smith Date: Fri May 1 00:22:25 2020 +0200 cpufreq: qcom: fix wrong compatible binding Binding in Documentation is still "operating-points-v2-kryo-cpu". Restore the old binding to fix the compatibility problem. Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs") Signed-off-by: Ansuel Smith Signed-off-by: Viresh Kumar commit 7d5620d31ecc8d19f6e4ad73196955ec0bb4a507 Author: Masami Hiramatsu Date: Thu Apr 30 22:25:13 2020 +0900 arm64: dts: uniphier: Add support for Akebi96 Add the device tree for Akebi96. Akebi96 is a 96boards certified development board based on UniPhir LD20. ( https://www.96boards.org/product/akebi96/ ) This board has; - MAX3421 USB-SPI chip on SPI port3 (for USB gadget port) - Simple frame buffer with 1080p fixed resolution. - I2S port which is connected to aout1b instead of aout1. - 3 serial ports, only serial3 has CTS/RTS. - No NAND, only eMMC on the board. - OP-TEE installed firmware. Signed-off-by: Masami Hiramatsu Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada commit 82ab9b6705bdfc81b4d24e544b669a50184b6005 Author: Masami Hiramatsu Date: Thu Apr 30 22:25:09 2020 +0900 dt-bindings: arm: Add Akebi96 board support Add uniphier-ld20-akebi96 compatible string for Akebi96 board support. Signed-off-by: Masami Hiramatsu commit 1a13827b7750e0dc96231bfb1c06e68cfaa4939d Author: Masahiro Yamada Date: Wed Apr 22 23:36:33 2020 +0900 arm64: dts: uniphier: add #address-cells and #size-cells to SPI nodes Documentation/devicetree/bindings/spi/spi-uniphier.txt requires #address-cells and #size-cells, but they are missing in actual DT files. Also, 'make ARCH=arm64 dtbs_check' is really noisy. Signed-off-by: Masahiro Yamada commit 137a1cecb89a024f8c92d71e07e73b14fc4d4161 Author: Masahiro Yamada Date: Wed Apr 22 23:36:32 2020 +0900 ARM: dts: uniphier: add #address-cells and #size-cells to SPI nodes Documentation/devicetree/bindings/spi/spi-uniphier.txt requires #address-cells and #size-cells, but they are missing in actual DT files. Also, 'make ARCH=arm dtbs_check' is really noisy. Signed-off-by: Masahiro Yamada commit 8f664ce7eda58dbc7d75dc9ff41d04786d284256 Author: Kunihiko Hayashi Date: Fri Apr 3 10:43:07 2020 +0900 arm64: dts: uniphier: Stabilize Ethernet RGMII mode of PXs3 ref board The RGMII PHY implemented in PXs3 ref board needs to change drive-strength properties of the Ethernet Tx pins to stabilize the PHY. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada commit 44f0746d60bcb575f2268a707e56c37208841e31 Author: Kunihiko Hayashi Date: Fri Apr 3 10:43:06 2020 +0900 arm64: dts: uniphier: Add ethernet aliases Add 'aliases' properties for ethernet device. U-Boot performs a fix-up of the MAC address and will overwrite the values from the Linux devicetree for aliased ethernet device. The MAC address can be inherited from U-Boot by adding aliases of ethernet devices. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada commit 94a8c115cc5ed8e7afff3bcda243210276a33927 Author: Kunihiko Hayashi Date: Fri Apr 3 10:43:05 2020 +0900 ARM: dts: uniphier: Add ethernet aliases Add an 'aliases' property for ethernet device. U-Boot performs a fix-up of the MAC address and will overwrite the values from the Linux devicetree for aliased ethernet device. The MAC address can be inherited from U-Boot by adding aliases of ethernet devices. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada commit f03b998de02d66bd5bbbd616668e1a32194f238e Author: Kunihiko Hayashi Date: Fri Apr 3 10:43:04 2020 +0900 arm64: dts: uniphier: Add XDMAC node Add external DMA controller support implemented in UniPhier SoCs. This supports for LD11, LD20 and PXs3. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada commit 07569acbef1d00c48dc4db4f140aab2dbb58df0b Author: Kunihiko Hayashi Date: Fri Apr 3 10:43:03 2020 +0900 ARM: dts: uniphier: Add XDMAC node Add external DMA controller support implemented in UniPhier SoCs. This supports for Pro4, Pro5 and PXs2. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada commit 60bcbc41ffb35572288681f41d1d8ab8bdb98841 Merge: d1a22509547b 4dadd151b265 Author: David S. Miller Date: Sun May 3 16:08:29 2020 -0700 Merge branch 'net-smc-add-and-delete-link-processing' Karsten Graul says: ==================== net/smc: add and delete link processing These patches add the 'add link' and 'delete link' processing as SMC server and client. This processing allows to establish and remove links of a link group dynamically. v2: Fix mess up with unused static functions. Merge patch 8 into patch 4. Postpone patch 13 to next series. ==================== Signed-off-by: David S. Miller commit 4dadd151b26589fd0520feb97c93ee981b393a99 Author: Karsten Graul Date: Sun May 3 14:38:50 2020 +0200 net/smc: enqueue local LLC messages As SMC server, when a second link was deleted, trigger the setup of an asymmetric link. Do this by enqueueing a local ADD_LINK message which is processed by the LLC layer as if it were received from peer. Do the same when a new IB port became active and a new link could be created. smc_llc_srv_add_link_local() enqueues a local ADD_LINK message. And smc_llc_srv_delete_link_local() is used the same way to enqueue a local DELETE_LINK message. This is used when an IB port is no longer active. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 08ae27ddfb6514a8316b17256cd4262bb6931c1f Author: Karsten Graul Date: Sun May 3 14:38:49 2020 +0200 net/smc: delete link processing as SMC server Add smc_llc_process_srv_delete_link() to process a DELETE_LINK request as SMC server. When the request is to delete ALL links then terminate the whole link group. If not, find the link to delete by its link_id, send the DELETE_LINK request LLC message and wait for the response. No matter if a response was received, clear the deleted link and update the link group state. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 9c4168789cc635e1f0d265157b7617259d56bfee Author: Karsten Graul Date: Sun May 3 14:38:48 2020 +0200 net/smc: delete link processing as SMC client Add smc_llc_process_cli_delete_link() to process a DELETE_LINK request as SMC client. When the request is to delete ALL links then terminate the whole link group. If not, find the link to delete by its link_id, send the DELETE_LINK response LLC message and then clear the deleted link. Finally determine and update the link group state. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 9ec6bf19ec8bb19f4211f6a2bf62c079d46b54ea Author: Karsten Graul Date: Sun May 3 14:38:47 2020 +0200 net/smc: llc_del_link_work and use the LLC flow for delete link Introduce a work that is scheduled when a new DELETE_LINK LLC request is received. The work will call either the SMC client or SMC server DELETE_LINK processing. And use the LLC flow framework to process incoming DELETE_LINK LLC messages, scheduling the llc_del_link_work for those events. With these changes smc_lgr_forget() is only called by one function and can be migrated into smc_lgr_cleanup_early(). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit c9a5d243035161f06175a7c6d487c9860e0f179a Author: Karsten Graul Date: Sun May 3 14:38:46 2020 +0200 net/smc: delete an asymmetric link as SMC server When a link group moved from asymmetric to symmetric state then the dangling asymmetric link can be deleted. Add smc_llc_find_asym_link() to find the respective link and add smc_llc_delete_asym_link() to delete it. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 1551c95b61242b1a20565bae8d711f35a601c4f3 Author: Karsten Graul Date: Sun May 3 14:38:45 2020 +0200 net/smc: final part of add link processing as SMC server This patch finalizes the ADD_LINK processing of new links. Send the CONFIRM_LINK request to the peer, receive the response and set link state to ACTIVE. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 57b499242cb888a32815f8663b60338bcb0b5747 Author: Karsten Graul Date: Sun May 3 14:38:44 2020 +0200 net/smc: rkey processing for a new link as SMC server Part of SMC server new link establishment is the exchange of rkeys for used buffers. Loop over all used RMB buffers and send ADD_LINK_CONTINUE LLC messages to the peer. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 2d2209f2018943d4152a21eff5b76f1952e0b435 Author: Karsten Graul Date: Sun May 3 14:38:43 2020 +0200 net/smc: first part of add link processing as SMC server First set of functions to process an ADD_LINK LLC request as an SMC server. Find an alternate IB device, determine the new link group type and get the index for the new link. Then initialize the link and send the ADD_LINK LLC message to the peer. Save the contents of the response, ready the link, map all used buffers and register the buffers with the IB device. If any error occurs, stop the processing and clear the link. And call smc_llc_srv_add_link() in af_smc.c to start second link establishment after the initial link of a link group was created. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit b1570a87f57e94e9f74b8942840f9bd16bd1aba5 Author: Karsten Graul Date: Sun May 3 14:38:42 2020 +0200 net/smc: final part of add link processing as SMC client This patch finalizes the ADD_LINK processing of new links. Receive the CONFIRM_LINK request from peer, complete the link initialization, register all used buffers with the IB device and finally send the CONFIRM_LINK response, which completes the ADD_LINK processing. And activate smc_llc_cli_add_link() in af_smc.c. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 87f88cda2128a72d79d4cc700729488af1081a06 Author: Karsten Graul Date: Sun May 3 14:38:41 2020 +0200 net/smc: rkey processing for a new link as SMC client Part of the SMC client new link establishment process is the exchange of rkeys for all used buffers. Add new LLC message type ADD_LINK_CONTINUE which is used to exchange rkeys of all current RMB buffers. Add functions to iterate over all used RMB buffers of the link group, and implement the ADD_LINK_CONTINUE processing. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 336ba09f2ef71b82f07c1200be0ddf4eb923d69f Author: Karsten Graul Date: Sun May 3 14:38:40 2020 +0200 net/smc: first part of add link processing as SMC client First set of functions to process an ADD_LINK LLC request as an SMC client. Find an alternate IB device, determine the new link group type and get the index for the new link. Then ready the link, map the buffers and send an ADD_LINK LLC response. If any error occurs, send a reject LLC message and terminate the processing. Add smc_llc_alloc_alt_link() to find a free link index for a new link, depending on the new link group type. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit d1a22509547b424866863e191ef9b2ac0762ad17 Merge: 5889a62b93bd 77a651f5647d Author: David S. Miller Date: Sun May 3 15:59:30 2020 -0700 Merge branch 'Enhance-current-features-in-ena-driver' Sameeh Jubran says: ==================== Enhance current features in ena driver Difference from v2: * dropped patch "net: ena: move llq configuration from ena_probe to ena_device_init()" * reworked patch ""net: ena: implement ena_com_get_admin_polling_mode() to drop the prototype Difference from v1: * reodered paches #01 and #02. * dropped adding Rx/Tx drops to ethtool in patch #08 V1: This patchset introduces the following: * minor changes to RSS feature * add total rx and tx drop counter * add unmask_interrupt counter for ethtool statistics * add missing implementation for ena_com_get_admin_polling_mode() * some minor code clean-up and cosmetics * use SHUTDOWN as reset reason when closing interface ==================== Signed-off-by: David S. Miller commit 77a651f5647da15b215e3523acce852dad453b6c Author: Arthur Kiyanovski Date: Sun May 3 09:52:21 2020 +0000 net: ena: cosmetic: extract code to ena_indirection_table_set() Extract code to ena_indirection_table_set() to make the code cleaner. Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit dcc2789a11f9bbe27dc79f85f426c22def3e921c Author: Sameeh Jubran Date: Sun May 3 09:52:20 2020 +0000 net: ena: cosmetic: remove unnecessary spaces and tabs in ena_com.h macros The macros in ena_com.h have inconsistent spaces between the macro name and it's value. This commit sets all the macros to have a single space between the name and value. Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit c1c0e40b367efc92ad05bb802180817534a32343 Author: Sameeh Jubran Date: Sun May 3 09:52:19 2020 +0000 net: ena: use SHUTDOWN as reset reason when closing interface The 'ENA_REGS_RESET_SHUTDOWN' enum indicates a normal driver shutdown / removal procedure. Also, a comment is added to one of the reset reason assignments for code clarity. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit f5db045e76fa74bdc95f9736429a565260a5d890 Author: Arthur Kiyanovski Date: Sun May 3 09:52:18 2020 +0000 net: ena: drop superfluous prototype Before this commit there was a function prototype named ena_com_get_ena_admin_polling_mode() that was never implemented. This patch simply deletes it. Signed-off-by: Igor Chauskin Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 5c665f8c596ded2d8b876bac024409856117f40e Author: Sameeh Jubran Date: Sun May 3 09:52:17 2020 +0000 net: ena: add support for reporting of packet drops 1. Add support for getting tx drops from the device and saving them in the driver. 2. Report tx via netdev stats. Signed-off-by: Igor Chauskin Signed-off-by: Guy Tzalik Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit d4a8b3bb0bb7e63d391b8e442681b72ab1429471 Author: Sameeh Jubran Date: Sun May 3 09:52:16 2020 +0000 net: ena: add unmask interrupts statistics to ethtool Add unmask interrupts statistics to ethtool. Signed-off-by: Netanel Belgazal Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit cac7172f2d33ae75601d1bc928532d3ef7513db9 Author: Sameeh Jubran Date: Sun May 3 09:52:15 2020 +0000 net: ena: remove code that does nothing Both key and func parameters are pointers on the stack. Setting them to NULL does nothing. The original intent was to leave the key and func unset in this case, but for this to happen nothing needs to be done as the calling function ethtool_get_rxfh() already clears key and func. This commit removes the above described useless code. Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit 0af3c4e2eab8aa5a904287534e442add36023273 Author: Sameeh Jubran Date: Sun May 3 09:52:14 2020 +0000 net: ena: changes to RSS hash key allocation This commit contains 2 cosmetic changes: 1. Use ena_com_check_supported_feature_id() in ena_com_hash_key_fill_default_key() instead of rewriting its implementation. This also saves us a superfluous admin command by using the cached value. 2. Change if conditions in ena_com_rss_init() to be clearer. Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit c1bd17e51c71dc8214fbccc2b5abea4d31ac65e6 Author: Arthur Kiyanovski Date: Sun May 3 09:52:13 2020 +0000 net: ena: change default RSS hash function to Toeplitz Currently in the driver we are setting the hash function to be CRC32. Starting with this commit we want to change the default behaviour so that we set the hash function to be Toeplitz instead. Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit f66c2ea3b18a8cc8e45ff32c636aaefb2ac06315 Author: Sameeh Jubran Date: Sun May 3 09:52:12 2020 +0000 net: ena: allow setting the hash function without changing the key Current code does not allow setting the hash function without changing the key. This commit enables it. To achieve this we separate ena_com_get_hash_function() to 2 functions: ena_com_get_hash_function() - which gets only the hash function, and ena_com_get_hash_key() - which gets only the hash key. Also return 0 instead of rc at the end of ena_get_rxfh() since all previous operations succeeded. Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller commit e9a1de378dd46375f9abfd8de1e6f59ee114a793 Author: Arthur Kiyanovski Date: Sun May 3 09:52:11 2020 +0000 net: ena: fix error returning in ena_com_get_hash_function() In case the "func" parameter is NULL we now return "-EINVAL". This shouldn't happen in general, but when it does happen, this is the proper way to handle it. We also check func for NULL in the beginning of the function, as there is no reason to do all the work and realize in the end of the function it was useless. Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 80f8443fcdaa27871a233d08e9142612e6ade77c Author: Arthur Kiyanovski Date: Sun May 3 09:52:10 2020 +0000 net: ena: avoid unnecessary admin command when RSS function set fails Currently when ena_set_hash_function() fails the hash function is restored to the previous value by calling an admin command to get the hash function from the device. In this commit we avoid the admin command, by saving the previous hash function before calling ena_set_hash_function() and using this previous value to restore the hash function in case of failure of ena_set_hash_function(). Signed-off-by: Sameeh Jubran Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 5889a62b93bd577ace12adace5743e6929bd1dce Merge: ee1bd483cc06 348e289b0f23 Author: David S. Miller Date: Sun May 3 15:50:53 2020 -0700 Merge branch 'sch_fq-optimizations' Eric Dumazet says: ==================== net_sched: sch_fq: round of optimizations This series is focused on better layout of struct fq_flow to reduce number of cache line misses in fq_enqueue() and dequeue operations. ==================== Signed-off-by: David S. Miller commit 348e289b0f23451d1c47b940e759f0f3a0c5756e Author: Eric Dumazet Date: Sat May 2 19:54:22 2020 -0700 net_sched: sch_fq: perform a prefetch() earlier The prefetch() done in fq_dequeue() can be done a bit earlier after the refactoring of the code done in the prior patch. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c288b0ca86a0a49ad450cf2d76a9a70c2ca9e43f Author: Eric Dumazet Date: Sat May 2 19:54:21 2020 -0700 net_sched: sch_fq: do not call fq_peek() twice per packet This refactors the code to not call fq_peek() from fq_dequeue_head() since the caller can provide the skb. Also rename fq_dequeue_head() to fq_dequeue_skb() because 'head' is a bit vague, given the skb could come from t_root rb-tree. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 82a0aa53b520edf50e08bad347d87d898de414eb Author: Eric Dumazet Date: Sat May 2 19:54:20 2020 -0700 net_sched: sch_fq: use bulk freeing in fq_gc() fq_gc() already builds a small array of pointers, so using kmem_cache_free_bulk() needs very little change. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7ba0537c2b534149be288f851900b4cf5aacde48 Author: Eric Dumazet Date: Sat May 2 19:54:19 2020 -0700 net_sched: sch_fq: change fq_flow size/layout sizeof(struct fq_flow) is 112 bytes on 64bit arches. This means that half of them use two cache lines, but 50% use three cache lines. This patch adds cache line alignment, and makes sure that only the first cache line is touched by fq_enqueue(), which is more expensive that fq_dequeue() in general. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit dde0a648fc00e2156a3358600c5fbfb3f53256ac Author: Eric Dumazet Date: Sat May 2 19:54:18 2020 -0700 net_sched: sch_fq: avoid touching f->next from fq_gc() A significant amount of cpu cycles is spent in fq_gc() When fq_gc() does its lookup in the rb-tree, it needs the following fields from struct fq_flow : f->sk (lookup key in the rb-tree) f->fq_node (anchor in the rb-tree) f->next (used to determine if the flow is detached) f->age (used to determine if the flow is candidate for gc) This unfortunately spans two cache lines (assuming 64 bytes cache lines) We can avoid using f->next, if we use the low order bit of f->{age|tail} This low order bit is 0, if f->tail points to an sk_buff. We set the low order bit to 1, if the union contains a jiffies value. Combined with the following patch, this makes sure we only need to bring into cpu caches one cache line per flow. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 72d9cd9cdc18b53c1df935dc9d40ea7bf057387f Author: Michał Mirosław Date: Sun May 3 17:21:11 2020 +0200 power: bq25890: protect view of the chip's state Extend bq->lock over whole updating of the chip's state. Might get useful later for switching ADC modes correctly. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit a9c2419406b8e50351b691d966dc4b7254678dbd Author: Michał Mirosław Date: Sun May 3 17:21:10 2020 +0200 power: bq25890: remove redundant I2C bus check regmap initialization will check I2C adapter functionality. Remove redundant check in the driver. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit a6a48fac96ae74f76422f908e09fdc9a6722050f Author: Michał Mirosław Date: Sun May 3 17:21:10 2020 +0200 power: bq25890: make property table const Property list should not change, so mark it const. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 5956fca78f5c2a6390ab59919a277c3ef169f909 Author: Michał Mirosław Date: Sun May 3 17:21:10 2020 +0200 power: bq25890: simplify chip name property getter Driver rejects unknown chips early in the probe(), so when bq25890_power_supply_get_property() is made reachable, bq->chip_version will already be set to correct value - there is no need to check it again. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit bd1de2a7aace4d1d312fb1be264b8fafdb706208 Author: Borislav Petkov Date: Sun May 3 12:27:29 2020 +0200 x86/tlb/uv: Add a forward declaration for struct flush_tlb_info ... to fix these build warnings: In file included from ./arch/x86/include/asm/uv/uv_hub.h:22, from drivers/misc/sgi-gru/grukdump.c:16: ./arch/x86/include/asm/uv/uv.h:39:21: warning: ‘struct flush_tlb_info’ declared \ inside parameter list will not be visible outside of this definition or declaration 39 | const struct flush_tlb_info *info); | ^~~~~~~~~~~~~~ In file included from ./arch/x86/include/asm/uv/uv_hub.h:22, from drivers/misc/sgi-gru/grutlbpurge.c:28: ./arch/x86/include/asm/uv/uv.h:39:21: warning: ‘struct flush_tlb_info’ declared \ inside parameter list will not be visible outside of this definition or declaration 39 | const struct flush_tlb_info *info); | ^~~~~~~~~~~~~~ ... after bfe3d8f6313d ("x86/tlb: Restrict access to tlbstate") restricted access to tlbstate. Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200503103107.3419-1-bp@alien8.de commit 2407fcb81b566b68512df8ebdc85cd2e7f64bef9 Author: Andre Przywara Date: Thu Apr 30 22:10:54 2020 +0100 dt-bindings: arm: Add Calxeda system registers json-schema binding The Calxeda system registers are a collection of MMIO register controlling several more general aspects of the SoC. Beside for some power management tasks this node is also somewhat abused as the container for the clock nodes. Add a binding in DT schema format using json-schema. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit fdab2dc5bc44abe81853064e717cfbfd4c1959f8 Author: Andre Przywara Date: Thu Apr 30 22:10:53 2020 +0100 dt-bindings: ipmi: Convert IPMI-SMIC bindings to json-schema Convert the generic IPMI controller bindings to DT schema format using json-schema. The device_type property is deprecated for most node per the DT spec, but at least the Linux driver matches on it, so I keep it in. The Linux driver parses for some additional and optional properties, but there are no in-tree users. Let's allow extra properties to cover any other users. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit a6325e3e69082c7fefd691a7e7212bb5ebc25a7c Author: Andre Przywara Date: Thu Apr 30 22:10:52 2020 +0100 dt-bindings: memory-controllers: Convert Calxeda DDR to json-schema Convert the Calxeda DDR memory controller binding to DT schema format using json-schema. Although this technically covers the whole DRAM controller, the intention to use it only for error reporting and mapping fault addresses to DRAM chips. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 04cbb87795f2c5ea35e2474039ca2b62d907b230 Author: Andre Przywara Date: Thu Apr 30 22:10:51 2020 +0100 dt-bindings: arm: Convert Calxeda L2 cache controller to json-schema Convert the L2-ECC controller binding to DT schema format using json-schema. This is indented to be just used for error reporting. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 16be1e40259dfe2cb06257c8ad7c80e768b9ddc4 Author: Andre Przywara Date: Thu Apr 30 22:10:50 2020 +0100 dt-bindings: phy: Convert Calxeda ComboPHY binding to json-schema Convert the Calxeda ComboPHY binding to DT schema format using json-schema. There is no driver in the Linux kernel matching the compatible string, but the nodes are parsed by the SATA driver, which links to them using its port-phys property. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 9e7c2bbfadf77a460091cd8c086252fc2ebb9c92 Author: Andre Przywara Date: Thu Apr 30 22:10:49 2020 +0100 dt-bindings: net: Convert Calxeda Ethernet binding to json-schema Convert the Calxeda XGMAC Ethernet device binding to DT schema format using json-schema. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring commit 5918410d991c2c9d38bf9d813d08a434fb36521b Author: Andre Przywara Date: Thu Apr 30 22:10:48 2020 +0100 dt-bindings: sata: Convert Calxeda SATA controller to json-schema Convert the Calxeda Highbank SATA controller binding to DT schema format using json-schema. Signed-off-by: Andre Przywara Cc: Jens Axboe Signed-off-by: Rob Herring commit 958ba5c2393732b1629afd00764020d17ea0ef26 Author: Andre Przywara Date: Thu Apr 30 22:10:47 2020 +0100 dt-bindings: clock: Convert Calxeda clock bindings to json-schema Convert the Calxeda clock bindings to DT schema format using json-schema. This just covers the actual PLL and divider clock nodes. In the actual DTs they are somewhat unconnected (no ranges or bus compatible) children of the sregs node, but for the actual clock bindings this is not relevant. One oddity is that the addresses are relative to the parent node, without that being pronounced using a ranges property. But this is too late to fix now. Signed-off-by: Andre Przywara Acked-by: Stephen Boyd Signed-off-by: Rob Herring commit 3d21a46093352f7802b9c66c7cce35cd02a50e53 Author: Rob Herring Date: Wed Apr 15 19:55:49 2020 -0500 dt-bindings: Remove cases of 'allOf' containing a '$ref' json-schema versions draft7 and earlier have a weird behavior in that any keywords combined with a '$ref' are ignored (silently). The correct form was to put a '$ref' under an 'allOf'. This behavior is now changed in the 2019-09 json-schema spec and '$ref' can be mixed with other keywords. The json-schema library doesn't yet support this, but the tooling now does a fixup for this and either way works. This has been a constant source of review comments, so let's change this treewide so everyone copies the simpler syntax. Scripted with ruamel.yaml with some manual fixups. Some minor whitespace changes from the script. Signed-off-by: Rob Herring Acked-by: Maxime Ripard Acked-by: Lee Jones Acked-By: Vinod Koul Acked-by: Mark Brown Acked-by: Alexandre Belloni Acked-by: Wolfram Sang # for I2C Reviewed-by: Linus Walleij Acked-by: Jonathan Cameron #for-iio Reviewed-by: Stephen Boyd # clock Signed-off-by: Rob Herring commit b4c7715c10c106a041b0b3fabd26151c214ea394 Author: Tobias Schramm Date: Tue Apr 14 14:52:08 2020 +0200 power: supply: add CellWise cw2015 fuel gauge driver This patch adds a driver for the CellWise cw2015 fuel gauge. The CellWise cw2015 is a shuntless, single-cell Li-Ion fuel gauge used in the pine64 Pinebook Pro laptop and some Raspberry Pi UPS HATs. Signed-off-by: Tobias Schramm Reviewed-by: Andy Shevchenko Signed-off-by: Sebastian Reichel commit 6e776188635ace8d1f5c032d8c8e8f0d4fa33b64 Author: Tobias Schramm Date: Tue Apr 14 14:52:07 2020 +0200 dt-bindings: power: supply: add cw2015_battery bindings This patch adds the dts binding schema for the cw2015 fuel gauge. Signed-off-by: Tobias Schramm Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit 9521244c3f1d30f0e796b08752cf987408023a12 Author: Tobias Schramm Date: Tue Apr 14 14:52:06 2020 +0200 dt-bindings: Document cellwise vendor-prefix Signed-off-by: Tobias Schramm Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit 8fe78d5261e750205e5dab0681c4d62e4b3dbc28 Author: Mathieu Othacehe Date: Sun May 3 11:29:59 2020 +0200 iio: vcnl4000: Add buffer support for VCNL4010/20. The VCNL4010 and VCNL4020 chips are able to raise interrupts on data ready. Use it to provide triggered buffer support for proximity data. Those two chips also provide ambient light data. However, they are sampled at different rate than proximity data. As this is not handled by the IIO framework for now, and the sample frequencies of ambient light data are very low, do add buffer support for them. Signed-off-by: Mathieu Othacehe Signed-off-by: Jonathan Cameron commit f6889c1b009e22238725b57e0df65df025e25475 Author: Mathieu Othacehe Date: Sun May 3 11:29:58 2020 +0200 iio: vcnl4000: Add sampling frequency support for VCNL4010/20. Add sampling frequency support for proximity data on VCNL4010 and VCNL4020 chips. Signed-off-by: Mathieu Othacehe Signed-off-by: Jonathan Cameron commit d35567fcaf68f54129e860acde813400f84ca9b2 Author: Mathieu Othacehe Date: Sun May 3 11:29:57 2020 +0200 iio: vcnl4000: Add event support for VCNL4010/20. The VCNL4010 and VCNL4020 chips are able to raise interrupts on proximity threshold events. Add support for threshold rising and falling events for those two chips. Signed-off-by: Mathieu Othacehe Signed-off-by: Jonathan Cameron commit 816956c32d76b7c4fb932f9a5ebaa38ccf4fa62e Author: Mathieu Othacehe Date: Sun May 3 11:29:56 2020 +0200 iio: vcnl4000: Factorize data reading and writing. Factorize data reading in vcnl4000_measure into a vcnl4000_read_data function. Also add a vcnl4000_write_data function. Signed-off-by: Mathieu Othacehe Signed-off-by: Jonathan Cameron commit 18dfb5326370991c81a6d1ed6d1aeee055cb8c05 Author: Mathieu Othacehe Date: Sun May 3 11:29:55 2020 +0200 iio: vcnl4000: Fix i2c swapped word reading. The bytes returned by the i2c reading need to be swapped unconditionally. Otherwise, on be16 platforms, an incorrect value will be returned. Taking the slow path via next merge window as its been around a while and we have a patch set dependent on this which would be held up. Fixes: 62a1efb9f868 ("iio: add vcnl4000 combined ALS and proximity sensor") Signed-off-by: Mathieu Othacehe Cc: Signed-off-by: Jonathan Cameron commit b7190859abc0056d9514a9e2ff506850304a1288 Author: Alexandru Ardelean Date: Thu Apr 30 14:04:22 2020 +0300 iio: imu: adis16xxx: use helper to access iio core debugfs dir The IIO core provides a iio_get_debugfs_dentry() helper. It seems that the ADIS IMU drivers access that field directly. This change converts them to use iio_get_debugfs_dentry() instead. Signed-off-by: Alexandru Ardelean Acked-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 6f1c9e0da9aae51177457731357ae8a2c8af27cd Author: Chris Ruehl Date: Mon Apr 20 12:26:07 2020 +0800 iio: DAC extension for ltc2634-12/10/8 This patch add support for Analog Devices (Linear Technology) LTC2634 Quad 12-/10-/8-Bit Rail-to-Rail DAC. The SPI functionality based on them from LTC2632 therefor add the definitions only and update the Kconfig. Signed-off-by: Chris Ruehl Acked-by: Uwe Kleine-König Signed-off-by: Jonathan Cameron commit aefa5bc87c808dd08db2fc79ebdbf19ed4af7be2 Author: Chris Ruehl Date: Mon Apr 20 12:26:06 2020 +0800 iio: documentation ltc2632_chip_info add num_channels The documentation for ltc_2632_chip_info missed the desciption for the num_channels. This trivial patch adds it. Signed-off-by: Chris Ruehl Fixes: 9f15a4a0adc9 ("iio: dac: ltc2632: add support for LTC2636 family") Acked-by: Uwe Kleine-König Signed-off-by: Jonathan Cameron commit 166365273fa069bedb3f90bc6ccaf758448c51d9 Author: Linus Walleij Date: Mon Apr 20 22:40:22 2020 +0200 iio: magnetometer: ak8974: Provide scaling The manual for the HSCDTD008A gives us a scaling for the three axis as +/- 2.4mT (24 Gauss) per axis. The manual for the AMI305 and AMI306 gives us a scaling for the three axis as +/- 12 Gauss per axis. Tests with the HSCDTD008A sensor, cat the raw values: $ cat in_magn_*_raw raw 45 189 -19 The scaling factor in in_magn_*_scale is 0.001464843, which gives: 0.065 Gauss 0.277 Gauss -0.027 Gauss The earths magnetic field is in the range of 0.25 to 0.65 Gauss on the surface according to Wikipedia, so these seem like reasonable values. Again we are guessing that the AK8974 has a 12 bit ADC, based on the similarity with AMI305 and AMI306. Cc: Nick Reitemeyer Cc: Stephan Gerhold Cc: Michał Mirosław Signed-off-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 55ecaf1717c619edce304ba27d68c18876af6637 Author: Linus Walleij Date: Mon Apr 20 22:40:21 2020 +0200 iio: magnetometer: ak8974: Break out measurement This breaks out the measurement code to its own function so we can handle this without swirling it up with the big switch() statement inside ak8974_read_raw(). Keep a local s16 helper variable for the signed value coming out of the measurement before assigning it to the integer *val. The local variable makes the code easier to read and the compiler will optimize it if possible. Cc: Nick Reitemeyer Cc: Stephan Gerhold Reviewed-by: Michał Mirosław Signed-off-by: Linus Walleij Signed-off-by: Jonathan Cameron commit b67959eba404a6a1a815bf725c0f76e5bc082f06 Author: Linus Walleij Date: Mon Apr 20 22:40:20 2020 +0200 iio: magnetometer: ak8974: Correct realbits The HSCDTD008A has 15 bits of actual ADC valie, and the AMI305 and AMI306 has 12 bits. Correct this by providing an extra parameter to the channel macro and define a separate set of channels for each variant of the chip. The resolution is the actual resolution of the internal ADC of the chip. The values are stored in a S16 in 2's complement so all 16 bits are used for storing (no shifting needed). The AMI305, AMI306 and HSCDTD008A valid bits are picked from respective datasheet. My best educated guess is that AK8974 is also 12 bits. The AK8973 is an 8 bit and earlier version, and the sibling drivers AMI305 and AMI306 are 12 bits, so it makes sense to assume that the AK8974 is also 12 bits. Cc: Nick Reitemeyer Cc: Stephan Gerhold Cc: Michał Mirosław Signed-off-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 525530af77594afff21cad063c9ac790d831ceb8 Author: Nick Reitemeyer Date: Mon Apr 6 16:13:53 2020 +0200 iio: magnetometer: ak8974: add Alps hscdtd008a The hscdtd008a is similar to the AK8974: Only the whoami value and some registers are different. Signed-off-by: Nick Reitemeyer Reviewed-by: Stephan Gerhold Tested-by: Stephan Gerhold Reviewed-by: Linus Walleij Tested-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 26441f92af147046d1e774b8b2883cda358aa5e3 Author: Nick Reitemeyer Date: Mon Apr 6 16:13:51 2020 +0200 dt-bindings: magnetometer: ak8974: Add Alps hscdtd008a Add binding documentation for the Alps HSCDTD008A, which is similar to the ak8974. Signed-off-by: Nick Reitemeyer Reviewed-by: Linus Walleij Acked-by: Rob Herring Signed-off-by: Jonathan Cameron commit 8f9a5249e3d96f7698ea9661da4ba14700b3c01b Author: Lorenzo Bianconi Date: Fri Apr 24 12:44:38 2020 +0200 iio: imu: st_lsm6dsx: enable 833Hz sample frequency for tagged sensors Enable 833Hz ODR for sensors that supports tagged hw FIFO: - LSM6DSO/LSM6DSOX - LSM6DSR/LSM6DSRX - ASM330LHH Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron commit a66904b209b6d828f9ad4486f30e24fb3463c71c Author: Colin Ian King Date: Fri Apr 24 14:04:19 2020 +0100 iio: adc: ad7476: remove redundant null check on an array The null check on st->chip_info->convst_channel is redundant because convst_channel is a 2 element array of struct iio_chan_spec objects and this can never be null. Fix this by removing the null check. Addresses-Coverity: ("Array compared against 0") Signed-off-by: Colin Ian King Reviewed-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit ff3f7e049aef9202deeb2c67cfe7da819846dba1 Author: Alexandru Ardelean Date: Fri Apr 24 18:22:43 2020 +0300 iio: buffer: extend short-hand use for 'indio_dev->buffer' This change is both cosmetic and a prequel to adding support for attaching multiple buffers per IIO device. The IIO buffer sysfs attrs are mostly designed to support only one attached buffer, and in order to support more, we need to centralize [in each attr function] the buffer which is being accessed. This also makes it a bit more uniform, as in some functions there is a short-hand 'buffer' variable and at the same time the 'indio_dev->buffer' is still access directly. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 256d4b83c0760de01d6192c372b068e7ecb376db Author: Christophe JAILLET Date: Sat Apr 25 09:00:56 2020 +0200 iio: dac: ad5592r: Fix a typo in the name of a function This module is related to AD5592R, not AD5593R, so be consistent in naming. Signed-off-by: Christophe JAILLET Signed-off-by: Jonathan Cameron commit 94cbf61de7ed1668d050b137b7188f4d4f40ddba Author: Christophe JAILLET Date: Sat Apr 25 08:56:53 2020 +0200 iio: dac: ad5593r: Fix a typo in MODULE_DESCRIPTION This module is related to AD5593R, not AD5592R. Signed-off-by: Christophe JAILLET Signed-off-by: Jonathan Cameron commit 3009fb9cabba471655f8d5de5090901f9775dc30 Author: Andy Shevchenko Date: Tue Apr 21 03:31:35 2020 +0300 iio: st_sensors: Use get_unaligned_be24() and sign_extend32() Use these functions instead of open-coding them. Cc: Denis Ciocca Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 92b7d5b70fed6ad083d7a232a274520a4c03a60e Author: Andy Shevchenko Date: Tue Apr 21 03:31:34 2020 +0300 iio: temperature: max31856: Use get_unaligned_beXX() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit e8ee40e77531a61fd85195011a75521eb3d22c8c Author: Andy Shevchenko Date: Tue Apr 21 03:31:33 2020 +0300 iio: pressure: zpa2326: Use get_unaligned_le24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 00d5e7b2fb98b079a57b51365b7a014444d09c26 Author: Andy Shevchenko Date: Tue Apr 21 03:31:32 2020 +0300 iio: pressure: ms5611: Use get_unaligned_be24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Acked-by: Tomasz Duszynski Signed-off-by: Jonathan Cameron commit b3ab0adb1da98b2b6b76354b7f195ffd05abdc57 Author: Andy Shevchenko Date: Tue Apr 21 03:31:31 2020 +0300 iio: pressure: hp206c: Use get_unaligned_be24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit dfe3da0b2844d86d2e61d9b1fcc8a108f3fd7eb7 Author: Andy Shevchenko Date: Tue Apr 21 03:31:30 2020 +0300 iio: magnetometer: rm3100: Use get_unaligned_be24() This makes the driver code slightly easier to read. Cc: Song Qiang Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit d2fa63d2d155c366dfa9615b55ba7deb4bdb9489 Author: Andy Shevchenko Date: Tue Apr 21 03:31:29 2020 +0300 iio: light: zopt2201: Use get_unaligned_le24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 76170adb65e88bbb5a4c0795b4a4d150c58a4cb6 Author: Andy Shevchenko Date: Tue Apr 21 03:31:28 2020 +0300 iio: light: si1133: Use get_unaligned_be24() This makes the driver code slightly easier to read. Cc: Maxime Roussin-Bélanger Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit d324ac2e93cdb69ef81dc272342898cd02d2777a Author: Andy Shevchenko Date: Tue Apr 21 03:31:27 2020 +0300 iio: health: afe4403: Use get_unaligned_be24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit e33ff8ac6dc9b4f1b8ee75ee3690561040ec0c1a Author: Andy Shevchenko Date: Tue Apr 21 03:31:26 2020 +0300 iio: gyro: adis16130: Use get_unaligned_be24() This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen Cc: Michael Hennerich Signed-off-by: Andy Shevchenko Acked-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 6ef9d68b58a0fc8460217a479568b10b82c69c09 Author: Andy Shevchenko Date: Tue Apr 21 03:31:25 2020 +0300 iio: dac: ad5446: Use put_unaligned_be24() This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen Cc: Michael Hennerich Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit e065325997e0138e5feead36b6cad0c684a35a79 Author: Andy Shevchenko Date: Tue Apr 21 03:31:24 2020 +0300 iio: dac: ad5624r_spi: Use put_unaligned_be24() This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen Cc: Michael Hennerich Signed-off-by: Andy Shevchenko Acked-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 8b26ab33470f52aa63190eee71c7079ed8e58af1 Author: Andy Shevchenko Date: Tue Apr 21 03:31:23 2020 +0300 iio: dac: ltc2632: Use put_unaligned_be24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 3321f29e4fb4775e7d88187cb499767dd9fee158 Author: Andy Shevchenko Date: Tue Apr 21 03:31:22 2020 +0300 iio: adc: ti-ads124s08: Use get_unaligned_be24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 1608327636cc33663f9f8e97eb9d944f7a96e044 Author: Andy Shevchenko Date: Tue Apr 21 03:31:21 2020 +0300 iio: adc: mpc3422: Use get_unaligned_beXX() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit c1909ab07f0a7e3bc2335ff442fd447323e0dd86 Author: Andy Shevchenko Date: Tue Apr 21 03:31:20 2020 +0300 iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24() This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen Cc: Michael Hennerich Signed-off-by: Andy Shevchenko Acked-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 0d4b2184cfee8293203fc22029b081dbbec9b879 Author: Jonathan Cameron Date: Sun Apr 19 16:13:37 2020 +0100 iio: Use an early return in iio_device_alloc to simplify code. Noticed whilst reviewing Alexandru's patch to the same function. If we simply flip the logic and return NULL immediately after memory allocation failure we reduce the indent of the following block and end up with more 'idiomatic' kernel code. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 151e91733a79403119d2ac8f4fe9870e7b4d75ac Author: Manivannan Sadhasivam Date: Wed Apr 15 00:19:30 2020 +0530 iio: chemical: Add OF match table for CCS811 VOC sensor Add devicetree OF match table support for CCS811 VOC sensor. Reviewed-by: Andy Shevchenko Signed-off-by: Manivannan Sadhasivam Signed-off-by: Jonathan Cameron commit c6644f7201f3398220f8c84ecc5a9432d51ee89b Author: Manivannan Sadhasivam Date: Wed Apr 15 00:19:29 2020 +0530 iio: chemical: Add support for external Reset and Wakeup in CCS811 CCS811 VOC sensor exposes nRESET and nWAKE pins which can be connected to GPIO pins of the host controller. These pins can be used to externally release the device from reset and also to wake it up before any I2C transaction. The initial driver support assumed that the nRESET pin is not connected and the nWAKE pin is tied to ground. This commit improves it by adding support for controlling those two pins externally using a host controller. For the case of reset, if the hardware reset is not available, the mechanism to do software reset is also added. As a side effect of doing this, the IIO device allocation needs to be slightly moved to top of probe to make use of priv data early. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 1060741fc51a8fb24d5dc7c61e2ecaffa0e5785e Author: Manivannan Sadhasivam Date: Wed Apr 15 00:19:28 2020 +0530 dt-bindings: iio: chemical: Add binding for CCS811 VOC sensor This commit adds devicetree binding for AMS CCS811 VOC sensor. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit a031e3d4b09f15bedbaa65784640ec378ce631e6 Author: Nuno Sá Date: Mon Apr 13 10:24:45 2020 +0200 dt-bindings: iio: Add adis16475 documentation Document the ADIS16475 device devicetree bindings Signed-off-by: Nuno Sá Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit fff7352bf7a3ceb2bda2479a4b212101b065209d Author: Nuno Sá Date: Mon Apr 13 10:24:44 2020 +0200 iio: imu: Add support for adis16475 Support ADIS16475 and similar IMU devices. These devices are a precision, miniature MEMS inertial measurement unit (IMU) that includes a triaxial gyroscope and a triaxial accelerometer. Each inertial sensor combines with signal conditioning that optimizes dynamic performance. The driver adds support for the following devices: * adis16470, adis16475, adis16477, adis16465, adis16467, adis16500, adis16505, adis16507. Signed-off-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 389b7f00c7396a3347743fcde5bbf0c00dd0cf71 Author: Chris Wilson Date: Sat May 2 18:35:12 2020 +0100 drm/i915/gt: Sanitize RPS interrupts upon resume Currently we clear and disable the RPS pm interrupts on module load, and presume that they remain disabled forevermore. However, the mask is cleared on suspend and so after resume they may start showing up again unexepectedly. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1811 Fixes: 8e99299a04bc ("drm/i915/gt: Track use of RPS interrupts in flags") Signed-off-by: Chris Wilson Cc: Andi Shyti Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200502173512.32353-1-chris@chris-wilson.co.uk commit 1d7a7128a2e9e1f137c99b0a44e94d70a77343e3 Author: Qiushi Wu Date: Sat May 2 18:33:38 2020 -0500 power: supply: core: fix memory leak in HWMON error path In function power_supply_add_hwmon_sysfs(), psyhw->props is allocated by bitmap_zalloc(). But this pointer is not deallocated when devm_add_action fail, which lead to a memory leak bug. To fix this, we replace devm_add_action with devm_add_action_or_reset. Cc: stable@kernel.org Fixes: e67d4dfc9ff19 ("power: supply: Add HWMON compatibility layer") Signed-off-by: Qiushi Wu Signed-off-by: Sebastian Reichel commit ee1bd483cc062d5050f9537064651dd2e06baee7 Author: Dmitry Yakunin Date: Sat May 2 18:34:42 2020 +0300 inet_diag: bc: read cgroup id only for full sockets Fix bug introduced by commit b1f3e43dbfac ("inet_diag: add support for cgroup filter"). Signed-off-by: Dmitry Yakunin Reported-by: syzbot+ee80f840d9bf6893223b@syzkaller.appspotmail.com Reported-by: syzbot+13bef047dbfffa5cd1af@syzkaller.appspotmail.com Fixes: b1f3e43dbfac ("inet_diag: add support for cgroup filter") Signed-off-by: David S. Miller commit f166f890c8f026a931e1bb80f51561a1d2f41b27 Author: Andrew Lunn Date: Sat May 2 17:25:04 2020 +0200 net: ethernet: fec: Replace interrupt driven MDIO with polled IO Measurements of the MDIO bus have shown that driving the MDIO bus using interrupts is slow. Back to back MDIO transactions take about 90us, with 25us spent performing the transaction, and the remainder of the time the bus is idle. Replacing the completion interrupt with polled IO results in back to back transactions of 40us. The polling loop waiting for the hardware to complete the transaction takes around 28us. Which suggests interrupt handling has an overhead of 50us, and polled IO nearly halves this overhead, and doubles the MDIO performance. Care has to be taken when setting the MII_SPEED register, or it can trigger an MII event> That then upsets the polling, due to an unexpected pending event. Suggested-by: Chris Heally Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 40b94224c339e44f689e713875c6c27c9c1270a7 Author: David S. Miller Date: Sat May 2 16:41:06 2020 -0700 smc: Remove unused function. net/smc/smc_llc.c:544:12: warning: ‘smc_llc_alloc_alt_link’ defined but not used [-Wunused-function] static int smc_llc_alloc_alt_link(struct smc_link_group *lgr, ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: David S. Miller commit f86e34374a05635332229d1928796d04017ddf16 Author: Gal Pressman Date: Mon Apr 20 09:22:13 2020 +0300 RDMA/efa: Count admin commands errors Add a new stat that counts admin commands failures, which might help when debugging different issues. Link: https://lore.kernel.org/r/20200420062213.44577-4-galpress@amazon.com Reviewed-by: Daniel Kranzdorf Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit eca5757f804f046dfaab4e9d3ea39af1f2523990 Author: Gal Pressman Date: Mon Apr 20 09:22:12 2020 +0300 RDMA/efa: Count mmap failures Add a new stat that counts mmap failures, which might help when debugging different issues. Link: https://lore.kernel.org/r/20200420062213.44577-3-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit b2ea69b3b4430642c98eea2c2d08419f2f02124d Author: Gal Pressman Date: Mon Apr 20 09:22:11 2020 +0300 RDMA/efa: Report create CQ error counter Create CQ errors are already being counted, report them along all other counters. Link: https://lore.kernel.org/r/20200420062213.44577-2-galpress@amazon.com Reviewed-by: Firas JahJah Reviewed-by: Yossi Leybovich Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit 6c5af965c09b55056adb88982d1de439bd021579 Merge: 115506fea499 425d2b1c5638 Author: David S. Miller Date: Sat May 2 16:31:45 2020 -0700 Merge branch 'ptp-Add-adjust-phase-to-support-phase-offset' Vincent Cheng says: ==================== ptp: Add adjust phase to support phase offset. This series adds adjust phase to the PTP Hardware Clock device interface. Some PTP hardware clocks have a write phase mode that has a built-in hardware filtering capability. The write phase mode utilizes a phase offset control word instead of a frequency offset control word. Add adjust phase function to take advantage of this capability. Changes since v1: - As suggested by Richard Cochran: 1. ops->adjphase is new so need to check for non-null function pointer. 2. Kernel coding style uses lower_case_underscores. 3. Use existing PTP clock API for delayed worker. ==================== Signed-off-by: David S. Miller commit 425d2b1c563826cf73e204172919fb40b7c45f1d Author: Vincent Cheng Date: Fri May 1 23:35:38 2020 -0400 ptp: ptp_clockmatrix: Add adjphase() to support PHC write phase mode. Add idtcm_adjphase() to support PHC write phase mode. Signed-off-by: Vincent Cheng Acked-by: Richard Cochran Signed-off-by: David S. Miller commit d3f1cbd29fa63f1bb608603a6cd54ca7af56a68b Author: Vincent Cheng Date: Fri May 1 23:35:37 2020 -0400 ptp: Add adjust_phase to ptp_clock_caps capability. Add adjust_phase to ptp_clock_caps capability to allow user to query if a PHC driver supports adjust phase with ioctl PTP_CLOCK_GETCAPS command. Signed-off-by: Vincent Cheng Reviewed-by: Richard Cochran Signed-off-by: David S. Miller commit 184ecc9eb260d5a3bcdddc5bebd18f285ac004e9 Author: Vincent Cheng Date: Fri May 1 23:35:36 2020 -0400 ptp: Add adjphase function to support phase offset control. Adds adjust phase function to take advantage of a PHC clock's hardware filtering capability that uses phase offset control word instead of frequency offset control word. Signed-off-by: Vincent Cheng Reviewed-by: Richard Cochran Signed-off-by: David S. Miller commit cfc1a89e449c02207952c72a4c0394691fdedf43 Author: Maor Gottlieb Date: Thu Apr 30 22:21:46 2020 +0300 RDMA/mlx5: Set lag tx affinity according to slave The patch sets the lag tx affinity of the data QPs and the GSI QPs according to the LAG xmit slave. For GSI QPs, in case the link layer is Ethenet (RoCE) we create two GSI QPs, one for each physical port. When the driver selects the GSI QP, it will consider the port affinity result. For connected QPs, the driver sets the affinity of the xmit slave. The above, ensures that RC QP and it's corresponding GSI QP will transmit from the same physical port. Link: https://lore.kernel.org/r/20200430192146.12863-17-maorg@mellanox.com Signed-off-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5163b2743ae00bf428a8a7e06839943b2f3965ed Author: Maor Gottlieb Date: Thu Apr 30 22:21:45 2020 +0300 RDMA/mlx5: Refactor affinity related code Move affinity related code in modify qp to function. It's a preparation for next patch the extend the affinity calculation to consider the xmit slave. Link: https://lore.kernel.org/r/20200430192146.12863-16-maorg@mellanox.com Signed-off-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 51aab12631dd7700385d275846ca49dc0b8c2124 Author: Maor Gottlieb Date: Thu Apr 30 22:21:44 2020 +0300 RDMA/core: Get xmit slave for LAG Add a call to rdma_lag_get_ah_roce_slave() when the address handle is created. Lower driver can use it to select the QP's affinity port. Link: https://lore.kernel.org/r/20200430192146.12863-15-maorg@mellanox.com Signed-off-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bd3920eac133103f0d4aa5fc62290e6df9a6c6da Author: Maor Gottlieb Date: Thu Apr 30 22:21:43 2020 +0300 RDMA/core: Add LAG functionality Add support to get the RoCE LAG xmit slave by building skb of the RoCE packet and call to master_get_xmit_slave. If driver wants to get the slave assume all slaves are available, then need to set RDMA_LAG_FLAGS_HASH_ALL_SLAVES in flags. Link: https://lore.kernel.org/r/20200430192146.12863-14-maorg@mellanox.com Signed-off-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fa5d010c5630b143b802e0477e87bba0656829cf Author: Maor Gottlieb Date: Thu Apr 30 22:21:42 2020 +0300 RDMA: Group create AH arguments in struct Following patch adds additional argument to the create AH function, so it make sense to group ah_attr and flags arguments in struct. Link: https://lore.kernel.org/r/20200430192146.12863-13-maorg@mellanox.com Signed-off-by: Maor Gottlieb Acked-by: Devesh Sharma Acked-by: Gal Pressman Acked-by: Weihang Li Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit 451c9fc77ae6fda6fcfdea7c15cdb86c647a0346 Merge: 0eacc574aae7 c6bc6041b10f Author: Jason Gunthorpe Date: Sat May 2 20:18:45 2020 -0300 Merge branch 'mellanox/mlx5-next' into rdma.git for-next From the mlx5-next branch at git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Required for dependencies in following patches * mellanox/mlx5-next: net/mlx5: Add support to get lag physical port net/mlx5: Change lag mutex lock to spin lock bonding: Implement ndo_get_xmit_slave bonding: Add array of all slaves bonding: Add function to get the xmit slave in active-backup mode bonding: Add helper function to get the xmit slave in rr mode bonding: Add helper function to get the xmit slave based on hash bonding/alb: Add helper functions to get the xmit slave bonding: Rename slave_arr to usable_slaves bonding: Export skip slave logic to function net/core: Introduce netdev_get_xmit_slave commit c55f5692748cdf7b6eee651dd91f4f3a84307e98 Author: Vasily Khoruzhick Date: Sat May 2 12:31:20 2020 -0700 ALSA: line6: Add poll callback for hwdep At least POD HD500 uses message-based communication, both sides can send messages. Add poll callback so application can wait for device messages without using busy loop. Signed-off-by: Vasily Khoruzhick Link: https://lore.kernel.org/r/20200502193120.79115-3-anarsoul@gmail.com Signed-off-by: Takashi Iwai commit 5c2d0de544c39407bf286d33bdcc1fb06a892d8b Author: Vasily Khoruzhick Date: Sat May 2 12:31:19 2020 -0700 ALSA: line6: hwdep: add support for O_NONBLOCK opening mode Currently line6 hwdep interface ignores O_NONBLOCK flag when opening device and it renders it somewhat useless when using poll. Check for O_NONBLOCK flag when opening device and don't block read() if it is set. Signed-off-by: Vasily Khoruzhick Link: https://lore.kernel.org/r/20200502193120.79115-2-anarsoul@gmail.com Signed-off-by: Takashi Iwai commit 9795a0ddf8adadb671d2da8b05b884ee450cb3fe Merge: 8c539776ac83 33aa46f252c7 Author: Rafael J. Wysocki Date: Sat May 2 22:00:56 2020 +0200 Merge back cpufreq material for v5.8. commit 3a4ccdb92e1e0f51844c8b60f2c0f48a4a620000 Merge: 2351f8d295ed 598cc9300563 Author: Rafael J. Wysocki Date: Sat May 2 21:59:03 2020 +0200 Merge back system-wide PM material for v5.8. commit 21d4cdf8b3c4352c38a36acee4c5bdc44cf5a1bc Author: Dan Murphy Date: Fri May 1 12:29:13 2020 -0500 dt-bindings: power: Convert power_supply text to yaml Convert the power_supply.txt to power-supply.yaml. This conversion entailed fixing up the binding to being yaml and dt checker compliant. Added a note in the power_supply.txt to reference the power-supply.yaml Signed-off-by: Dan Murphy Signed-off-by: Sebastian Reichel commit 7cc8f2d5aca162f4e2ea07e53d3123f30a7b2582 Author: Huacai Chen Date: Sat May 2 18:46:24 2020 +0800 MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords The last branch of switch-case doesn't need a "fallthrough" pseudo keyword, and it will cause errors when building a kernel with -Werror: arch/mips/kernel/perf_event_mipsxx.c: In function 'reset_counters': include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror] 200 | # define fallthrough __attribute__((__fallthrough__)) | ^~~~~~~~~~~~~ >> arch/mips/kernel/perf_event_mipsxx.c:932:3: note: in expansion of macro 'fallthrough' 932 | fallthrough; | ^~~~~~~~~~~ arch/mips/kernel/perf_event_mipsxx.c: In function 'loongson3_reset_counters': include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror] 200 | # define fallthrough __attribute__((__fallthrough__)) | ^~~~~~~~~~~~~ arch/mips/kernel/perf_event_mipsxx.c:903:3: note: in expansion of macro 'fallthrough' 903 | fallthrough; | ^~~~~~~~~~~ cc1: all warnings being treated as errors Fix it by removing unnecessary "fallthrough" pseudo keywords. Fixes: e9dfbaaeef1c9fe ("MIPS: perf: Add hardware perf events support for new Loongson-3") Reported-by: kbuild test robot Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 9d139131e973dac0ef6207a161b228a7fcad8180 Author: Bin Meng Date: Fri May 1 21:25:49 2020 -0700 mips: Drop CONFIG_MTD_M25P80 in various defconfig files Drop CONFIG_MTD_M25P80 that was removed in commit b35b9a10362d ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Signed-off-by: Bin Meng Signed-off-by: Thomas Bogendoerfer commit 3aed240e577ea9f5b070358766d46a0e285f0b9e Author: Jiaxun Yang Date: Fri May 1 00:48:02 2020 +0800 MIPS: Loongson64: Correct TLB type for Loongson-3 Classic Huacai just informed me that some early Loongson-3A2000 had wrong TLB type in Config0 register. That means we have to correct it via PRID. It looks like I shoudn't drop MIPS_CPU_FTLB flag in PRID case for Loongson-3 Classic. Fixes: da1bd29742b1 ("MIPS: Loongson64: Probe CPU features via CPUCFG") Signed-off-by: Jiaxun Yang Reported-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 5e6ed29d72d28ff7cd92ebf5711aac6a613ef01e Author: allen Date: Mon Apr 27 17:16:53 2020 +0800 dt-bindings: Add binding for IT6505. Add a DT binding documentation for IT6505. Acked-by: Sam Ravnborg Signed-off-by: Allen Chen Signed-off-by: Pi-Hsun Shih Signed-off-by: Sam Ravnborg [fixed example to use i2c] Link: https://patchwork.freedesktop.org/patch/msgid/1587979103-5630-3-git-send-email-allen.chen@ite.com.tw commit 5213a8db23f1768c974b41c15df9d1570f5f5147 Author: allen Date: Mon Apr 27 17:16:52 2020 +0800 dt-bindings: fix vendor prefix for ITE Tech. Inc. ITE Tech. Inc. (abbreviated as ITE ) is a professional fabless IC design house. ITE's core technology includes PC and NB Controller chips, Super I/O, High Speed Serial Interface, Video Codec, Touch Sensing, Surveillance, OFDM, Sensor Fusion, and so on. Our official name is "ITE Tech. Inc.", so change "ITE," to "ITE.". more information on: http://www.ite.com.tw/ Signed-off-by: Allen Chen Acked-by: Rob Herring Fixes: 17ff9478ffa3 ("dt-bindings: Add ITE Tech prefix") Cc: Marek Vasut Cc: devicetree@vger.kernel.org Cc: Allen Chen Signed-off-by: Sam Ravnborg [added fixes tag and updated subject] Link: https://patchwork.freedesktop.org/patch/msgid/1587979103-5630-2-git-send-email-allen.chen@ite.com.tw commit 7b3f0c4c56b08a86f890cad3599242c78c683aa9 Author: Al Viro Date: Sat Apr 25 13:13:48 2020 -0400 i915:get_engines(): get rid of pointless access_ok() Signed-off-by: Al Viro commit 598caf1a4032bd52040a57739342a0a97eace757 Author: Al Viro Date: Thu Apr 23 14:32:45 2020 -0400 i915: alloc_oa_regs(): get rid of pointless access_ok() Signed-off-by: Al Viro commit fd7cd8da232d892f2b7dc4766f8a05a81043ee5e Author: Al Viro Date: Wed Feb 19 11:20:34 2020 -0500 i915 compat ioctl(): just use drm_ioctl_kernel() compat_alloc_user_space() is a bad kludge; the sooner it goes, the better... Signed-off-by: Al Viro commit 502f78c8d784eabc0f75c6372f61ca796c8af707 Author: Al Viro Date: Thu Apr 23 14:29:05 2020 -0400 i915: switch copy_perf_config_registers_or_number() to unsafe_put_user() ... and the rest of query_perf_config_data() to normal uaccess primitives Signed-off-by: Al Viro commit 516431ae669bf4e8d6e6ce5e5347e9f9739b0947 Author: Al Viro Date: Thu Apr 23 14:19:14 2020 -0400 i915: switch query_{topology,engine}_info() to copy_to_user() Signed-off-by: Al Viro commit 5fb1514164de20ddb21886ffceda4cb54d6538f6 Author: Al Viro Date: Tue Feb 18 22:34:07 2020 -0500 readdir.c: get rid of the last __put_user(), drop now-useless access_ok() Signed-off-by: Al Viro commit 82af599b7036587d4921e9576ba6975910f1397d Author: Al Viro Date: Tue Feb 18 22:33:09 2020 -0500 readdir.c: get compat_filldir() more or less in sync with filldir() Signed-off-by: Al Viro commit 391b7461d4a14e8dbe1b815ec15e3ee0daf00342 Author: Al Viro Date: Tue Feb 18 14:39:56 2020 -0500 switch readdir(2) to unsafe_copy_dirent_name() ... and the same for its compat counterpart Signed-off-by: Al Viro commit 115506fea499f1cd9a80290b31eca4352e0559e9 Merge: 5b95dea31636 57dc6f3b4133 Author: David S. Miller Date: Fri May 1 17:02:27 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2020-05-01 (v2) The following pull-request contains BPF updates for your *net-next* tree. We've added 61 non-merge commits during the last 6 day(s) which contain a total of 153 files changed, 6739 insertions(+), 3367 deletions(-). The main changes are: 1) pulled work.sysctl from vfs tree with sysctl bpf changes. 2) bpf_link observability, from Andrii. 3) BTF-defined map in map, from Andrii. 4) asan fixes for selftests, from Andrii. 5) Allow bpf_map_lookup_elem for SOCKMAP and SOCKHASH, from Jakub. 6) production cloudflare classifier as a selftes, from Lorenz. 7) bpf_ktime_get_*_ns() helper improvements, from Maciej. 8) unprivileged bpftool feature probe, from Quentin. 9) BPF_ENABLE_STATS command, from Song. 10) enable bpf_[gs]etsockopt() helpers for sock_ops progs, from Stanislav. 11) enable a bunch of common helpers for cg-device, sysctl, sockopt progs, from Stanislav. ==================== Signed-off-by: David S. Miller commit 5b95dea31636ce93660930d16172fe75589b2e70 Merge: 47c0b5806f21 b45e7f98ab7c Author: David S. Miller Date: Fri May 1 16:20:05 2020 -0700 Merge branch 'net-smc-extent-buffer-mapping-and-port-handling' Karsten Graul says: ==================== net/smc: extent buffer mapping and port handling Add functionality to map/unmap and register/unregister memory buffers for specific SMC-R links and for the whole link group. Prepare LLC layer messages for the support of multiple links and extent the processing of adapter events. And add further small preparations needed for the SMC-R failover support. ==================== Signed-off-by: David S. Miller commit a29ae8600d50ece1856b062a39ed296b8b952259 Author: Martin Blumenstingl Date: Fri May 1 23:57:17 2020 +0200 clk: meson: meson8b: Don't rely on u-boot to init all GP_PLL registers Not all u-boot versions initialize the HHI_GP_PLL_CNTL[2-5] registers. In that case all HHI_GPLL_PLL_CNTL[1-5] registers are 0x0 and when booting Linux the PLL fails to lock. The initialization sequence from u-boot is: - put the PLL into reset - write 0x59C88000 to HHI_GP_PLL_CNTL2 - write 0xCA463823 to HHI_GP_PLL_CNTL3 - write 0x0286A027 to HHI_GP_PLL_CNTL4 - write 0x00003000 to HHI_GP_PLL_CNTL5 - set M, N, OD and the enable bit - take the PLL out of reset - check if it has locked - disable the PLL In Linux we already initialize M, N, OD, the enable and the reset bits. Also the HHI_GP_PLL_CNTL[2-5] registers with these magic values (the exact meaning is unknown) so the PLL can lock when the vendor u-boot did not initialize these registers yet. Fixes: b882964b376f21 ("clk: meson: meson8b: add support for the GP_PLL clock on Meson8m2") Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200501215717.735393-1-martin.blumenstingl@googlemail.com commit 57dc6f3b4133f45e73d87895180ca1f3eaf01722 Author: Stanislav Fomichev Date: Fri May 1 15:43:20 2020 -0700 selftests/bpf: Use reno instead of dctcp Andrey pointed out that we can use reno instead of dctcp for CC tests and drop CONFIG_TCP_CONG_DCTCP=y requirement. Fixes: beecf11bc218 ("bpf: Bpf_{g,s}etsockopt for struct bpf_sock_addr") Suggested-by: Andrey Ignatov Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200501224320.28441-1-sdf@google.com commit b45e7f98ab7c2d7035d92100ee011584693eccce Author: Karsten Graul Date: Fri May 1 12:48:13 2020 +0200 net/smc: llc_add_link_work to handle ADD_LINK LLC requests Introduce a work that is scheduled when a new ADD_LINK LLC request is received. The work will call either the SMC client or SMC server ADD_LINK processing. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 8574cf4055ab44724ee9a4c30921d3ed853d787c Author: Karsten Graul Date: Fri May 1 12:48:12 2020 +0200 net/smc: allocate index for a new link Add smc_llc_alloc_alt_link() to find a free link index for a new link, depending on the new link group type. And update constants for the maximum number of links to 3 (2 symmetric and 1 dangling asymmetric link). These maximum numbers are the same as used by other implementations of the SMC-R protocol. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 6c868a3edc70ec9819d6a94268625d25e6bc9587 Author: Karsten Graul Date: Fri May 1 12:48:11 2020 +0200 net/smc: introduce smc_pnet_find_alt_roce() Introduce a new function in smc_pnet.c that searches for an alternate IB device, using an existing link group and a primary IB device. The alternate IB device needs to be active and must have the same PNETID as the link group. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 33d203302d1cc744a13349d2576c985feb469220 Author: Karsten Graul Date: Fri May 1 12:48:10 2020 +0200 net/smc: remove DELETE LINK processing from smc_core.c Support for multiple links makes the former DELETE LINK processing obsolete which sent one DELETE_LINK LLC message for each single link. Remove this processing from smc_core.c. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 87523930a16eb57ebb20318e92b5df4b64fe8b20 Author: Karsten Graul Date: Fri May 1 12:48:09 2020 +0200 net/smc: take link down instead of terminating the link group Use the introduced link down processing in all places where the link group is terminated and take down the affected link only. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 541afa10c126b6c22c2a805a559c70cc41fd156e Author: Karsten Graul Date: Fri May 1 12:48:08 2020 +0200 net/smc: add smcr_port_err() and smcr_link_down() processing Call smcr_port_err() when an IB event reports an inactive IB device. smcr_port_err() calls smcr_link_down() for all affected links. smcr_link_down() either triggers the local DELETE_LINK processing, or sends an DELETE_LINK LLC message to the SMC server to initiate the processing. The old handler function smc_port_terminate() is removed. Add helper smcr_link_down_cond() to take a link down conditionally, and smcr_link_down_cond_sched() to schedule the link_down processing to a work. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 1f90a05d9ff907c70456e7c9d7058372679a88c6 Author: Karsten Graul Date: Fri May 1 12:48:07 2020 +0200 net/smc: add smcr_port_add() and smcr_link_up() processing Call smcr_port_add() when an IB event reports a new active IB device. smcr_port_add() will start a work which either triggers the local ADD_LINK processing, or send an ADD_LINK LLC message to the SMC server to initiate the processing. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 35dcf7ec02dcff16504bc52a368822254f889f00 Author: Karsten Graul Date: Fri May 1 12:48:06 2020 +0200 net/smc: remember PNETID of IB device for later device matching The PNETID is needed to find an alternate link for a link group. Save the PNETID of the link that is used to create the link group for later device matching. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit d550066776aae3bb31e0240cab24f62e33c47fd3 Author: Karsten Graul Date: Fri May 1 12:48:05 2020 +0200 net/smc: mutex to protect the lgr against parallel reconfigurations Introduce llc_conf_mutex in the link group which is used to protect the buffers and lgr states against parallel link reconfiguration. This ensures that new connections do not start to register buffers with the links of a link group when link creation or termination is running. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit fbed3b37c89633eb602f4ec8e30186e601b793e5 Author: Karsten Graul Date: Fri May 1 12:48:04 2020 +0200 net/smc: extend smc_llc_send_add_link() and smc_llc_send_delete_link() All LLC sends are done from worker context only, so remove the prep functions which were used to build the message before it was sent, and add the function content into the respective send function smc_llc_send_add_link() and smc_llc_send_delete_link(). Extend smc_llc_send_add_link() to include the qp_mtu value in the LLC message, which is needed to establish a link after the initial link was created. Extend smc_llc_send_delete_link() to contain a link_id and a reason code for the link deletion in the LLC message, which is needed when a specific link should be deleted. And add the list of existing DELETE_LINK reason codes. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit fb33d27727254618aaf6bc2fedcb0fda1d5c0239 Author: Karsten Graul Date: Fri May 1 12:48:03 2020 +0200 net/smc: map and register buffers for a new link Introduce support to map and register all current buffers for a new link. smcr_buf_map_lgr() will map used buffers for a new link and smcr_buf_reg_lgr() can be called to register used buffers on the IB device of the new link. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 4a3641c160873fe6b6bcff00a6ea15e7430d8d42 Author: Karsten Graul Date: Fri May 1 12:48:02 2020 +0200 net/smc: unmapping of buffers to support multiple links With the support of multiple links that are created and cleared there is a need to unmap one link from all current buffers. Add unmapping by link and by rmb. And make smcr_link_clear() available to be called from the LLC layer. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 7562a13d5a8ce9bc5020705da5f50221021f5a2c Author: Karsten Graul Date: Fri May 1 12:48:01 2020 +0200 net/smc: multiple link support for rmb buffer registration The CONFIRM_RKEY LLC processing handles all links in one LLC message. Move the call to this processing out of smcr_link_reg_rmb() which does processing per link, into smcr_lgr_reg_rmbs() which is responsible for link group level processing. Move smcr_link_reg_rmb() into module smc_core.c. >From af_smc.c now call smcr_lgr_reg_rmbs() to register new rmbs on all available links. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 47c0b5806f21b4806e5d9d57e08069320e34e835 Merge: eb236c2994b0 888ae5a3952b Author: David S. Miller Date: Fri May 1 16:08:20 2020 -0700 Merge branch 'Introduce-a-flow-gate-control-action-and-apply-IEEE' Po Liu says: ==================== Introduce a flow gate control action and apply IEEE Changes from V4: ---------------- 0001: Fix and modify according to Vlid Buslov suggestions: - Change spin_lock_bh() to spin_lock() since tcf_gate_act() already in software irq. - Remove spin lock protect in the ops->cleanup function. - Enable the CONFIG_DEBUG_ATOMIC_SLEEP and CONFIG_PROVE_LOCKING checking, then fix as kzalloc flag type and lock deadlock. - Change kzalloc() flag type from GFP_KERNEL to GFP_ATOMIC since function in the spin_lock protect. - Change hrtimer type from HRTIMER_MODE_ABS to HRTIMER_MODE_ABS_SOFT to avoid deadlock. 0002: Fix and modify according to Vlid Buslov suggestions: - Remove all rcu_read_lock protection since no rcu parameters. - Enable the CONFIG_DEBUG_ATOMIC_SLEEP and CONFIG_PROVE_LOCKING checking, then check kzalloc sleeping flag. - Change kzalloc to kcalloc for array memory alloc and change GFP_KERNEL flag to GFP_ATOMIC since function holding spin_lock protect. 0003: - No changes. 0004: - Commit comments rephrase act by Claudiu Manoil. Changes from V3: ---------------- 0001: Fix and modify according to Vlid Buslov: - Remove the struct gate_action and move the parameters to the struct tcf_gate align with tc_action parameters. This would not need to alloc rcu type memory with pointer. - Remove the spin_lock type entry_lock which do not needed anymore, will use the tcf_lock system provided. - Provide lockep protect for the status parameters in the tcf_gate_act(). - Remove the cycletime 0 input warning, return error directly. And: - Remove Qci related description in the Kconfig for gate action. 0002: - Fix rcu_read_lock protect range suggested by Vlid Buslov. 0003: - No changes. 0004: - Fix bug of gate maxoct wildcard condition not included. - Fix the pass time basetime calculation report by Vladimir Otlean. Changes from V2: 0001: No changes. 0002: No changes. 0003: No changes. 0004: Fix the vlan id filter parameter and add reject src mac FF-FF-FF-FF-FF-FF filter in driver. Changes from V1: ---------------- 0000: Update description make it more clear 0001: Removed 'add update dropped stats' patch, will provide pull request as standalone patches. 0001: Update commit description make it more clear ack by Jiri Pirko. 0002: No changes 0003: Fix some code style ack by Jiri Pirko. 0004: Fix enetc_psfp_enable/disable parameter type ack by test robot iprout2 command patches: Not attach with these serial patches, will provide separate pull request after kernel accept these patches. Changes from RFC: ----------------- 0000: Reduce to 5 patches and remove the 4 max frame size offload and flow metering in the policing offload action, Only keep gate action offloading implementation. 0001: No changes. 0002: - fix kfree lead ack by Jakub Kicinski and Cong Wang - License fix from Jakub Kicinski and Stephen Hemminger - Update example in commit acked by Vinicius Costa Gomes - Fix the rcu protect in tcf_gate_act() acked by Vinicius 0003: No changes 0004: No changes 0005: Acked by Vinicius Costa Gomes - Use refcount kernel lib - Update stream gate check code position - Update reduce ref names more clear iprout2 command patches: 0000: Update license expression and add gate id 0001: Add tc action gate man page -------------------------------------------------------------------- These patches add stream gate action policing in IEEE802.1Qci (Per-Stream Filtering and Policing) software support and hardware offload support in tc flower, and implement the stream identify, stream filtering and stream gate filtering action in the NXP ENETC ethernet driver. Per-Stream Filtering and Policing (PSFP) specifies flow policing and filtering for ingress flows, and has three main parts: 1. The stream filter instance table consists of an ordered list of stream filters that determine the filtering and policing actions that are to be applied to frames received on a specific stream. The main elements are stream gate id, flow metering id and maximum SDU size. 2. The stream gate function setup a gate list to control ingress traffic class open/close state. When the gate is running at open state, the flow could pass but dropped when gate state is running to close. User setup a bastime to tell gate when start running the entry list, then the hardware would periodiclly. There is no compare qdisc action support. 3. Flow metering is two rates two buckets and three-color marker to policing the frames. Flow metering instance are as specified in the algorithm in MEF10.3. The most likely qdisc action is policing action. The first patch introduces an ingress frame flow control gate action, for the point 2. The tc gate action maintains the open/close state gate list, allowing flows to pass when the gate is open. Each gate action may policing one or more qdisc filters. When the start time arrived, The driver would repeat the gate list periodiclly. User can assign a passed time, the driver would calculate a new future time by the cycletime of the gate list. The 0002 patch introduces the gate flow hardware offloading. The 0003 patch adds support control the on/off for the tc flower offloading by ethtool. The 0004 patch implement the stream identify and stream filtering and stream gate filtering action in the NXP ENETC ethernet driver. Tc filter command provide filtering keys with MAC address and VLAN id. These keys would be set to stream identify instance entry. Stream gate instance entry would refer the gate action parameters. Stream filter instance entry would refer the stream gate index and assign a stream handle value matches to the stream identify instance. ==================== Signed-off-by: David S. Miller commit 888ae5a3952badf11fdcd210f5da9994462ec2fc Author: Po Liu Date: Fri May 1 08:53:18 2020 +0800 net: enetc: add tc flower psfp offload driver This patch is to add tc flower offload for the enetc IEEE 802.1Qci(PSFP) function. There are four main feature parts to implement the flow policing and filtering for ingress flow with IEEE 802.1Qci features. They are stream identify(this is defined in the P802.1cb exactly but needed for 802.1Qci), stream filtering, stream gate and flow metering. Each function block includes many entries by index to assign parameters. So for one frame would be filtered by stream identify first, then flow into stream filter block by the same handle between stream identify and stream filtering. Then flow into stream gate control which assigned by the stream filtering entry. And then policing by the gate and limited by the max sdu in the filter block(optional). At last, policing by the flow metering block, index choosing at the fitering block. So you can see that each entry of block may link to many upper entries since they can be assigned same index means more streams want to share the same feature in the stream filtering or stream gate or flow metering. To implement such features, each stream filtered by source/destination mac address, some stream maybe also plus the vlan id value would be treated as one flow chain. This would be identified by the chain_index which already in the tc filter concept. Driver would maintain this chain and also with gate modules. The stream filter entry create by the gate index and flow meter(optional) entry id and also one priority value. Offloading only transfer the gate action and flow filtering parameters. Driver would create (or search same gate id and flow meter id and priority) one stream filter entry to set to the hardware. So stream filtering do not need transfer by the action offloading. This architecture is same with tc filter and actions relationship. tc filter maintain the list for each flow feature by keys. And actions maintain by the action list. Below showing a example commands by tc: > tc qdisc add dev eth0 ingress > ip link set eth0 address 10:00:80:00:00:00 > tc filter add dev eth0 parent ffff: protocol ip chain 11 \ flower skip_sw dst_mac 10:00:80:00:00:00 \ action gate index 10 \ sched-entry open 200000000 1 8000000 \ sched-entry close 100000000 -1 -1 Command means to set the dst_mac 10:00:80:00:00:00 to index 11 of stream identify module. Then setting the gate index 10 of stream gate module. Keep the gate open for 200ms and limit the traffic volume to 8MB in this sched-entry. Then direct the frames to the ingress queue 1. Signed-off-by: Po Liu Signed-off-by: David S. Miller commit 79e499829f3ff5b8f70c87baf1b03ebb3401a3e4 Author: Po Liu Date: Fri May 1 08:53:17 2020 +0800 net: enetc: add hw tc hw offload features for PSPF capability This patch is to let ethtool enable/disable the tc flower offload features. Hardware ENETC has the feature of PSFP which is for per-stream policing. When enable the tc hw offloading feature, driver would enable the IEEE 802.1Qci feature. It is only set the register enable bit for this feature not enable for any entry of per stream filtering and stream gate or stream identify but get how much capabilities for each feature. Signed-off-by: Po Liu Signed-off-by: David S. Miller commit d29bdd69ecdd70e8e3c2268fc8e188d6ab55e54a Author: Po Liu Date: Fri May 1 08:53:16 2020 +0800 net: schedule: add action gate offloading Add the gate action to the flow action entry. Add the gate parameters to the tc_setup_flow_action() queueing to the entries of flow_action_entry array provide to the driver. Signed-off-by: Po Liu Signed-off-by: David S. Miller commit a51c328df3106663879645680609eb49b3ff6444 Author: Po Liu Date: Fri May 1 08:53:15 2020 +0800 net: qos: introduce a gate control flow action Introduce a ingress frame gate control flow action. Tc gate action does the work like this: Assume there is a gate allow specified ingress frames can be passed at specific time slot, and be dropped at specific time slot. Tc filter chooses the ingress frames, and tc gate action would specify what slot does these frames can be passed to device and what time slot would be dropped. Tc gate action would provide an entry list to tell how much time gate keep open and how much time gate keep state close. Gate action also assign a start time to tell when the entry list start. Then driver would repeat the gate entry list cyclically. For the software simulation, gate action requires the user assign a time clock type. Below is the setting example in user space. Tc filter a stream source ip address is 192.168.0.20 and gate action own two time slots. One is last 200ms gate open let frame pass another is last 100ms gate close let frames dropped. When the ingress frames have reach total frames over 8000000 bytes, the excessive frames will be dropped in that 200000000ns time slot. > tc qdisc add dev eth0 ingress > tc filter add dev eth0 parent ffff: protocol ip \ flower src_ip 192.168.0.20 \ action gate index 2 clockid CLOCK_TAI \ sched-entry open 200000000 -1 8000000 \ sched-entry close 100000000 -1 -1 > tc chain del dev eth0 ingress chain 0 "sched-entry" follow the name taprio style. Gate state is "open"/"close". Follow with period nanosecond. Then next item is internal priority value means which ingress queue should put. "-1" means wildcard. The last value optional specifies the maximum number of MSDU octets that are permitted to pass the gate during the specified time interval. Base-time is not set will be 0 as default, as result start time would be ((N + 1) * cycletime) which is the minimal of future time. Below example shows filtering a stream with destination mac address is 10:00:80:00:00:00 and ip type is ICMP, follow the action gate. The gate action would run with one close time slot which means always keep close. The time cycle is total 200000000ns. The base-time would calculate by: 1357000000000 + (N + 1) * cycletime When the total value is the future time, it will be the start time. The cycletime here would be 200000000ns for this case. > tc filter add dev eth0 parent ffff: protocol ip \ flower skip_hw ip_proto icmp dst_mac 10:00:80:00:00:00 \ action gate index 12 base-time 1357000000000 \ sched-entry close 200000000 -1 -1 \ clockid CLOCK_TAI Signed-off-by: Po Liu Signed-off-by: David S. Miller commit eb236c2994b031f805be691fa9ea39cba4690166 Author: Doug Berger Date: Thu Apr 30 16:26:51 2020 -0700 net: bcmgenet: Move wake-up event out of side band ISR The side band interrupt service routine is not available on chips like 7211, or rather, it does not permit the signaling of wake-up events due to the complex interrupt hierarchy. Move the wake-up event accounting into a .resume_noirq function, account for possible wake-up events and clear the MPD/HFB interrupts from there, while leaving the hardware untouched until the resume function proceeds with doing its usual business. Because bcmgenet_wol_power_down_cfg() now enables the MPD and HFB interrupts, it is invoked by a .suspend_noirq function to prevent the servicing of interrupts after the clocks have been disabled. Signed-off-by: Doug Berger Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit df8f348e76d556cc88445fd78e83235a910cb41e Merge: b7052ba7cf52 a2003b303875 Author: David S. Miller Date: Fri May 1 15:53:33 2020 -0700 Merge branch 'net-ipa-dont-cache-channel-state' Alex Elder says: ==================== net: ipa: don't cache channel state This series removes a field that holds a copy of a channel's state at the time it was last fetched. In principle the state can change at any time, so it's better to just fetch it whenever needed. The first patch is just preparatory, simplifying the arguments to gsi_channel_state(). ==================== Signed-off-by: David S. Miller commit a2003b303875b41542bad1c2e81800fdd4c27c29 Author: Alex Elder Date: Thu Apr 30 17:13:23 2020 -0500 net: ipa: do not cache channel state It is possible for a GSI channel's state to be changed as a result of an action by a different execution environment. Specifically, the modem is able to issue a GSI generic command that causes a state change on a GSI channel associated with the AP. A channel's state only needs to be known when a channel is allocated or deallocaed, started or stopped, or reset. So there is little value in caching the state anyway. Stop recording a copy of the channel's last known state, and instead fetch the true state from hardware whenever it's needed. In such cases, *do* record the state in a local variable, in case an error message reports it (so the value reported is the value seen). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit aba7924fa5a490d6c586b9cd7d0f78f872a40d1d Author: Alex Elder Date: Thu Apr 30 17:13:22 2020 -0500 net: ipa: pass channel pointer to gsi_channel_state() Pass a channel pointer rather than a GSI pointer and channel ID to gsi_channel_state(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit b7052ba7cf5261e013bcc4cd52e3c89c0d5669b0 Merge: bf2320a60e68 7019bba43307 Author: David S. Miller Date: Fri May 1 15:40:15 2020 -0700 Merge branch 'net-dsa-mv88e6xxx-augment-phylink-support-for-10G' Russell King says: ==================== net: dsa: mv88e6xxx: augment phylink support for 10G This series adds phylink 10G support for the 88E6390 series switches, as suggested by Andrew Lunn. The first patch cleans up the code to use generic definitions for the registers in a similar way to what was done with the initial conversion of 1G serdes support. The second patch adds the necessary bits 10GBASE mode to the pcs_get_state() method. ==================== Signed-off-by: David S. Miller commit 7019bba4330750a29d87b6ce70ac6fabc007b3dc Author: Russell King Date: Thu Apr 30 09:21:39 2020 +0100 net: dsa: mv88e6xxx: 88e6390 10G serdes support Add support for reading and reporting the 10G link status on the 88e6390 in addition to the 1000BASE-X/2500BASE-X/SGMII status. Signed-off-by: Russell King Signed-off-by: David S. Miller commit bf604bc90b30a7c9d024e3be9b3ad3b0dc3f51c4 Author: Russell King Date: Thu Apr 30 09:21:34 2020 +0100 net: dsa: mv88e6xxx: use generic clause 45 definitions The private MV88E6390_PCS_CONTROL_1 definitions in serdes.h reflects the IEEE 802.3 standard PCS control register 1 definitions, only offset by 0x1000 in the PHYXS register space. Rather than inventing our own, use those that already exist, and name the register MV88E6390_10G_CTRL1. Signed-off-by: Russell King Signed-off-by: David S. Miller commit bf2320a60e687760400cf964ec3e60ceccb90f93 Merge: e00edb4efbbc 43c670c8e48a Author: David S. Miller Date: Fri May 1 15:37:59 2020 -0700 Merge branch 'net-atlantic-A2-support' Igor Russkikh says: ==================== net: atlantic: A2 support This patchset adds support for the new generation of Atlantic NICs. Chip generations are mostly compatible register-wise, but there are still some differences. Therefore we've made some of first generation (A1) code non-static to re-use it where possible. Some pieces are A2 specific, in which case we redefine/extend such APIs. v2: * removed #pragma pack (2 structures require the packed attribute); * use defines instead of magic numbers where possible; v1: https://patchwork.ozlabs.org/cover/1276220/ ==================== Signed-off-by: David S. Miller commit 43c670c8e48a1817ae4b64683d7d65cad5bb0502 Author: Igor Russkikh Date: Thu Apr 30 11:04:45 2020 +0300 net: atlantic: A2 ingress / egress hw configuration Chip generations are mostly compatible register-wise, but there are still some differences. Therefore we've made some of first generation (A1) code non-static to re-use it where possible. Some pieces are A2 specific, in which case we redefine/extend such APIs. Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit e54dcf4bba3e2c36b3eb89cd9063753c2a3ef459 Author: Igor Russkikh Date: Thu Apr 30 11:04:44 2020 +0300 net: atlantic: basic A2 init/deinit hw_ops This patch adds basic A2 HW initialization / deinitialization. Signed-off-by: Igor Russkikh Co-developed-by: Dmitry Bogdanov Signed-off-by: Dmitry Bogdanov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit c1be0bf092bd292ee617622c116f5981a34cce96 Author: Dmitry Bogdanov Date: Thu Apr 30 11:04:43 2020 +0300 net: atlantic: common functions needed for basic A2 init/deinit hw_ops This patch adds common functions (mostly FW-related), which are needed for basic A2 HW initialization / deinitialization. Signed-off-by: Dmitry Bogdanov Co-developed-by: Igor Russkikh Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit ec7629e0c2217963eedb886026a71040c9d32aa9 Author: Dmitry Bogdanov Date: Thu Apr 30 11:04:42 2020 +0300 net: atlantic: HW bindings for basic A2 init/deinit hw_ops This patch adds A2 register definitions for basic A2 HW initialization / deinitialization. Signed-off-by: Dmitry Bogdanov Co-developed-by: Egor Pomozov Signed-off-by: Egor Pomozov Co-developed-by: Igor Russkikh Signed-off-by: Igor Russkikh Co-developed-by: Nikita Danilov Signed-off-by: Nikita Danilov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 3417368494db497c0426d1dcc46c4c459ff43ca7 Author: Igor Russkikh Date: Thu Apr 30 11:04:41 2020 +0300 net: atlantic: add A2 RPF hw_ops This patch adds RPF-related hw_ops, which are needed for basic functionality. Signed-off-by: Igor Russkikh Co-developed-by: Dmitry Bogdanov Signed-off-by: Dmitry Bogdanov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 57fe8fd2255cd97d2c2a9b69cb5172c0f15343b8 Author: Igor Russkikh Date: Thu Apr 30 11:04:40 2020 +0300 net: atlantic: HW bindings for A2 RFP RPF is one of the modules which has been significantly changed/extended on A2. This patch adds the necessary A2 register definitions for RPF, which are used in follow-up patches. Signed-off-by: Igor Russkikh Co-developed-by: Dmitry Bogdanov Signed-off-by: Dmitry Bogdanov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit b3f0c79cba2060c1af37b32d60eff8598391519e Author: Igor Russkikh Date: Thu Apr 30 11:04:39 2020 +0300 net: atlantic: A2 hw_ops skeleton This patch adds basic hw_ops layout for A2. Actual implementation will be added in the follow-up patches. Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 5cfd54d7dc186a368af92aba0dcb8b4d4bbe8658 Author: Dmitry Bogdanov Date: Thu Apr 30 11:04:38 2020 +0300 net: atlantic: minimal A2 fw_ops This patch adds the minimum set of FW ops for A2. Signed-off-by: Dmitry Bogdanov Co-developed-by: Igor Russkikh Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 258ff0cf61d607e17f2e273aae3e50c1dd251dec Author: Dmitry Bogdanov Date: Thu Apr 30 11:04:37 2020 +0300 net: atlantic: minimal A2 HW bindings required for fw_ops This patch adds the bare minimum of A2 HW bindings required to get fw_ops working. Signed-off-by: Dmitry Bogdanov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit f67619611b4ce0e3b2bbc2cd75b9c2ce2035ef1e Author: Dmitry Bogdanov Date: Thu Apr 30 11:04:36 2020 +0300 net: atlantic: A2 driver-firmware interface This patch adds the driver<->firmware interface for A2 Signed-off-by: Dmitry Bogdanov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit d1ad88fe9fa9f5c3e4ecf509efb579852b44cc79 Author: Mark Starovoytov Date: Thu Apr 30 11:04:35 2020 +0300 net: atlantic: move IS_CHIP_FEATURE to aq_hw.h IS_CHIP feature will be used to differentiate between A1 and A2, where necessary. Thus, move it to aq_hw.h, rename it and make it accept the 'hw' pointer. Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit d0f23741c202c685447050713907f3be39a985ee Author: Mark Starovoytov Date: Thu Apr 30 11:04:34 2020 +0300 net: atlantic: make hw_get_regs optional This patch fixes potential crash in case if hw_get_regs is NULL. Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 36e90a5297ea02c67c0f17d8b39eb9ceb93dd6f0 Author: Nikita Danilov Date: Thu Apr 30 11:04:33 2020 +0300 net: atlantic: simplify hw_get_fw_version() usage hw_get_fw_version() never fails, so this patch simplifies its usage by utilizing return value instead of output argument. Signed-off-by: Nikita Danilov Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 099d074e3f0cd3f48e57e3349b9f8a25b0e3feb8 Author: Mark Starovoytov Date: Thu Apr 30 11:04:32 2020 +0300 net: atlantic: add hw_soft_reset, hw_prepare to hw_ops A2 will have a different implementation of these 2 APIs, so this patch moves them to hw_ops in preparation for A2. Signed-off-by: Mark Starovoytov Co-developed-by: Dmitry Bezrukov Signed-off-by: Dmitry Bezrukov Signed-off-by: David S. Miller commit 3d464aadef75415c55a5a4feb611a9bbf034d7d3 Author: Igor Russkikh Date: Thu Apr 30 11:04:31 2020 +0300 net: atlantic: add defines for 10M and EEE 100M link mode This patch adds defines for 10M and EEE 100M link modes, which are supported by A2. 10M support is added in this patch series. EEE is out of scope, but will be added in a follow-up series. Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit 98c4353c5add3cb2bbb3c2da1cbd7fd2d09f396b Author: Igor Russkikh Date: Thu Apr 30 11:04:30 2020 +0300 net: atlantic: add A2 device IDs Adding device ids for the new generation of atlantic nic. Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit fe677b057e33a0345570064c0d82ef6956b005d6 Author: Igor Russkikh Date: Thu Apr 30 11:04:29 2020 +0300 net: atlantic: update company name in the driver description Aquantia is now part of Marvell. Thus, update the driver description. Signed-off-by: Igor Russkikh Signed-off-by: Mark Starovoytov Signed-off-by: David S. Miller commit e00edb4efbbc07425441a3be2aa87abaf5800d96 Author: Wei Yongjun Date: Wed Apr 29 02:52:20 2020 +0000 drivers: net: davinci_mdio: fix potential NULL dereference in davinci_mdio_probe() platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference since devm_ioremap() does not check input parameters for null. This is detected by Coccinelle semantic patch. @@ expression pdev, res, n, t, e, e1, e2; @@ res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Fixes: 03f66f067560 ("net: ethernet: ti: davinci_mdio: use devm_ioremap()") Signed-off-by: Wei Yongjun Reviewed-by: Grygorii Strashko Signed-off-by: David S. Miller commit ea5b8b5eb00489a090d99aaf694bc82368326834 Author: Rob Herring Date: Thu Mar 5 16:37:48 2020 -0600 dt-bindings: Add a minimum version check for dtschema The dtschema package must be somewhat up to date as the tools and meta-schema checks are still evolving. Implement a version check, so this can be enforced. This will help ensure new schema submissions get checked against the latest meta-schemas. Reviewed-by: Masahiro Yamada Signed-off-by: Rob Herring commit 41a46913bee76d8493681442907ccd989ced2633 Author: Jesper Dangaard Brouer Date: Mon Apr 27 18:37:43 2020 +0200 net: fix skb_panic to output real address In skb_panic() the real pointer values are really needed to diagnose issues, e.g. data and head are related (to calculate headroom). The hashed versions of the addresses doesn't make much sense here. The patch use the printk specifier %px to print the actual address. The printk documentation on %px: https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#unmodified-addresses Fixes: ad67b74d2469 ("printk: hash addresses printed with %p") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit e69f5dc623f96f047a9ff99eea8bbd71497e5e68 Author: Lubomir Rintel Date: Sun Apr 19 22:17:16 2020 +0200 dt-bindings: serial: Convert 8250 to json-schema Some fixes were done during the conversion: Slightly better examples. The original example was for an OMAP serial port, which is not even described by this binding, but by omap_serial.txt instead. Added compatible strings, that were used, byt not documented: andestech,uart16550, cavium,octeon-3860-uart, fsl,16550-FIFO64, nvidia,tegra186-uart, nvidia,tegra194-uart, nxp,lpc1850-uart, opencores,uart16550-rtlsvn105, ralink,mt7620a-uart, ralink,rt3052-uart, ralink,rt3883-uart and xlnx,xps-uart16550-2.00.b. Removed "serial" compatible string. It's redundant with the node name (which, in OFW, serves the same purpose as the compatible string). Signed-off-by: Lubomir Rintel [robh: allow additional properties. clocks/clock-frequency can be optional on original 8250 series with standard clocks] Signed-off-by: Rob Herring commit 1bb694e208395816fee278ca46d2796727d3f4a9 Author: Christophe Roullier Date: Mon Apr 27 12:00:38 2020 +0200 net: ethernet: stmmac: simplify phy modes management for stm32 No new feature, just to simplify stm32 part to be easier to use. Add by default all Ethernet clocks in DT, and activate or not in function of phy mode, clock frequency, if property "st,ext-phyclk" is set or not. Keep backward compatibility -------------------------------------------------------------------------- |PHY_MODE | Normal | PHY wo crystal| PHY wo crystal | No 125Mhz | | | | 25MHz | 50MHz | from PHY | -------------------------------------------------------------------------- | MII | - | eth-ck | n/a | n/a | | | | st,ext-phyclk | | | -------------------------------------------------------------------------- | GMII | - | eth-ck | n/a | n/a | | | | st,ext-phyclk | | | -------------------------------------------------------------------------- | RGMII | - | eth-ck | n/a | eth-ck | | | | st,ext-phyclk | |st,eth-clk-sel| | | | | | or | | | | | | st,ext-phyclk| ----------------==-------------------------------------------------------- | RMII | - | eth-ck | eth-ck | n/a | | | | st,ext-phyclk | st,eth-ref-clk-sel | | | | | | or st,ext-phyclk | | -------------------------------------------------------------------------- Signed-off-by: Christophe Roullier Acked-by: Alexandre TORGUE Signed-off-by: David S. Miller commit 138c67677ff5ac0bce7131033c39d52a81e87a60 Author: Andrii Nakryiko Date: Fri May 1 11:56:22 2020 -0700 bpf: Fix use-after-free of bpf_link when priming half-fails If bpf_link_prime() succeeds to allocate new anon file, but then fails to allocate ID for it, link priming is considered to be failed and user is supposed ot be able to directly kfree() bpf_link, because it was never exposed to user-space. But at that point file already keeps a pointer to bpf_link and will eventually call bpf_link_release(), so if bpf_link was kfree()'d by caller, that would lead to use-after-free. Fix this by first allocating ID and only then allocating file. Adding ID to link_idr is ok, because link at that point still doesn't have its ID set, so no user-space process can create a new FD for it. Fixes: a3b80e107894 ("bpf: Allocate ID for bpf_link") Reported-by: syzbot+39b64425f91b5aab714d@syzkaller.appspotmail.com Suggested-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20200501185622.3088964-1-andriin@fb.com commit f0628c524fd188c3f9418e12478dfdfadacba815 Author: Cambda Zhu Date: Fri Apr 24 16:06:16 2020 +0800 net: Replace the limit of TCP_LINGER2 with TCP_FIN_TIMEOUT_MAX This patch changes the behavior of TCP_LINGER2 about its limit. The sysctl_tcp_fin_timeout used to be the limit of TCP_LINGER2 but now it's only the default value. A new macro named TCP_FIN_TIMEOUT_MAX is added as the limit of TCP_LINGER2, which is 2 minutes. Since TCP_LINGER2 used sysctl_tcp_fin_timeout as the default value and the limit in the past, the system administrator cannot set the default value for most of sockets and let some sockets have a greater timeout. It might be a mistake that let the sysctl to be the limit of the TCP_LINGER2. Maybe we can add a new sysctl to set the max of TCP_LINGER2, but FIN-WAIT-2 timeout is usually no need to be too long and 2 minutes are legal considering TCP specs. Changes in v3: - Remove the new socket option and change the TCP_LINGER2 behavior so that the timeout can be set to value between sysctl_tcp_fin_timeout and 2 minutes. Changes in v2: - Add int overflow check for the new socket option. Changes in v1: - Add a new socket option to set timeout greater than sysctl_tcp_fin_timeout. Signed-off-by: Cambda Zhu Signed-off-by: David S. Miller commit 6f576d6277ce5e3aaf2f35b2410220019c3d3cd9 Author: Chris Wilson Date: Fri May 1 20:29:45 2020 +0100 drm/i915/gem: Try an alternate engine for relocations If at first we don't succeed, try try again. Not all engines may support the MI ops we need to perform asynchronous relocation patching, and so we end up falling back to a synchronous operation that has a liability of blocking. However, Tvrtko pointed out we don't need to use the same engine to perform the relocations as we are planning to execute the execbuf on, and so if we switch over to a working engine, we can perform the relocation asynchronously. The user execbuf will be queued after the relocations by virtue of fencing. This patch creates a new context per execbuf requiring asynchronous relocations on an unusable engines. This is perhaps a bit excessive and can be ameliorated by a small context cache, but for the moment we only need it for working around a little used engine on Sandybridge, and only if relocations are actually required to an active batch buffer. Now we just need to teach the relocation code to handle physical addressing for gen2/3, and we should then have universal support! Suggested-by: Tvrtko Ursulin Testcase: igt/gem_exec_reloc/basic-spin # snb Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200501192945.22215-3-chris@chris-wilson.co.uk commit 0e97fbb080553102af98296382c45e89e2ad8dbc Author: Chris Wilson Date: Fri May 1 20:29:44 2020 +0100 drm/i915/gem: Use a single chained reloc batches for a single execbuf As we can now keep chaining together a relocation batch to process any number of relocations, we can keep building that relocation batch for all of the target vma. This avoiding emitting a new request into the ring for each target, consuming precious ring space and a potential stall. v2: Propagate the failure from submitting the relocation batch. Testcase: igt/gem_exec_reloc/basic-wide-active Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200501192945.22215-2-chris@chris-wilson.co.uk commit 964a9b0f611ee7fedc90641bfcc2efe6ce6206aa Author: Chris Wilson Date: Fri May 1 20:29:43 2020 +0100 drm/i915/gem: Use chained reloc batches The ring is a precious resource: we anticipate to only use a few hundred bytes for a request, and only try to reserve that before we start. If we go beyond our guess in building the request, then instead of waiting at the start of execbuf before we hold any locks or other resources, we may trigger a wait inside a critical region. One example is in using gpu relocations, where currently we emit a new MI_BB_START from the ring every time we overflow a page of relocation entries. However, instead of insert the command into the precious ring, we can chain the next page of relocation entries as MI_BB_START from the end of the previous. v2: Delay the emit_bb_start until after all the chained vma synchronisation is complete. Since the buffer pool batches are idle, this _should_ be a no-op, but one day we may some fancy async GPU bindings for new vma! v3: Use pool/batch consitently, once we start thinking in terms of the batch vma, use batch->obj. v4: Explain the magic number 4. Tvrtko spotted that we lose propagation of the error for failing to submit the relocation request; that's easier to fix up in the next patch. Testcase: igt/gem_exec_reloc/basic-many-active Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200501192945.22215-1-chris@chris-wilson.co.uk commit 03414a49ad5f3c56988c36d2070e402ffa17feaf Author: Ondrej Mosnacek Date: Tue Apr 28 14:55:12 2020 +0200 selinux: do not allocate hashtabs dynamically It is simpler to allocate them statically in the corresponding structure, avoiding unnecessary kmalloc() calls and pointer dereferencing. Signed-off-by: Ondrej Mosnacek [PM: manual merging required in policydb.c] Signed-off-by: Paul Moore commit 46619b44e431d85d64a8dfcb7166d0ae098544c8 Author: Ondrej Mosnacek Date: Fri May 1 21:51:11 2020 +0200 selinux: fix return value on error in policydb_read() The value of rc is still zero from the last assignment when the error path is taken. Fix it by setting it to -ENOMEM before the hashtab_create() call. Reported-by: Dan Carpenter Fixes: e67b2ec9f617 ("selinux: store role transitions in a hash table") Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 3348bd33e8cf8a17138e8ce716ae474ec5d7001e Author: Ondrej Mosnacek Date: Tue Apr 28 14:55:11 2020 +0200 selinux: simplify range_write() No need to traverse the hashtab to count its elements, hashtab already tracks it for us. Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit a465fb1e2f272dbc4b8a7b25d73e7bf34d4f8066 Merge: 4b4976a6fec5 93882c6f210a Author: David S. Miller Date: Fri May 1 12:53:06 2020 -0700 Merge branch 'r8169-improve-user-message-handling' Heiner Kallweit says: ==================== r8169: improve user message handling Series improves few aspects of handling messages to users. ==================== Signed-off-by: David S. Miller commit 93882c6f210af5e318cdbe40b320053cff0fa033 Author: Heiner Kallweit Date: Fri May 1 19:26:22 2020 +0200 r8169: switch from netif_xxx message functions to netdev_xxx Considering the few messages we have in the driver, there's not really a benefit in being able to control them on a message type level. Therefore simplify the code and switch to the netdev_xxx message functions. In addition add net_ratelimit() to messages that can be printed from a hot path. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3bf6ff3cec5d2b1d8185e76c7fae48ff7021ebd0 Author: Heiner Kallweit Date: Fri May 1 19:24:47 2020 +0200 r8169: remove "out of memory" error message from rtl_request_firmware When preparing an unrelated change, checkpatch complained about this redundant out-of-memory message. Therefore remove it. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit d56f58cec90d46a60d1acb15954b96d89aa154ee Author: Heiner Kallweit Date: Fri May 1 19:23:36 2020 +0200 r8169: simplify counter handling The counter handling functions can only fail if rtl8169_do_counters() times out. In the poll function we emit an error message in case of timeout, therefore we don't have to propagate the timeout all the way up just to print another message basically saying the same. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f773d5118b6ce63d645d404bf29075252b890c66 Author: Heiner Kallweit Date: Fri May 1 19:22:29 2020 +0200 r8169: remove redundant driver message when entering promiscuous mode Net core - __dev_set_promiscuity - prints a message already when promiscuous mode in entered/left, therefore we don't have to do this in the driver too. Also the driver message would be misleading (would be because "link" message level is disabled per default) because it would print "promisc mode enabled" even if it's being left. Reason is that __dev_change_flags() calls dev_set_rx_mode() before touching the promisc flag. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit beecf11bc2188067824591612151c4dc6ec383c7 Author: Stanislav Fomichev Date: Thu Apr 30 16:31:52 2020 -0700 bpf: Bpf_{g,s}etsockopt for struct bpf_sock_addr Currently, bpf_getsockopt and bpf_setsockopt helpers operate on the 'struct bpf_sock_ops' context in BPF_PROG_TYPE_SOCK_OPS program. Let's generalize them and make them available for 'struct bpf_sock_addr'. That way, in the future, we can allow those helpers in more places. As an example, let's expose those 'struct bpf_sock_addr' based helpers to BPF_CGROUP_INET{4,6}_CONNECT hooks. That way we can override CC before the connection is made. v3: * Expose custom helpers for bpf_sock_addr context instead of doing generic bpf_sock argument (as suggested by Daniel). Even with try_socket_lock that doesn't sleep we have a problem where context sk is already locked and socket lock is non-nestable. v2: * s/BPF_PROG_TYPE_CGROUP_SOCKOPT/BPF_PROG_TYPE_SOCK_OPS/ Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200430233152.199403-1-sdf@google.com commit 4b4976a6fec531c425af11104963c4fe24cf39e4 Merge: ef891284b130 30cbf2ddfc59 Author: David S. Miller Date: Fri May 1 12:24:43 2020 -0700 Merge branch 'net-ReST-part-three' Mauro Carvalho Chehab says: ==================== net: manually convert files to ReST format - part 3 (final) That's the third part (and the final one) of my work to convert the networking text files into ReST. it is based on linux-next next-20200430 branch. The full series (including those ones) are at: https://git.linuxtv.org/mchehab/experimental.git/log/?h=net-docs The built output documents, on html format is at: https://www.infradead.org/~mchehab/kernel_docs/networking/ ==================== Signed-off-by: David S. Miller commit 30cbf2ddfc5927fcd85b930c9bd8732fc4fc31cd Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:59 2020 +0200 docs: networking: arcnet-hardware.rst: don't duplicate chapter names Since changeset 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst"), auto-references for chapters are generated. This is a nice feature, but has a drawback: no chapters can have the same sumber. So, we need to change two chapter titles, to avoid warnings when building the docs. Fixes: 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 2c8e961d20e38c366315f11bec6c0ae4458785c4 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:58 2020 +0200 net: docs: add page_pool.rst to index.rst This file is already in ReST format. Add it to the net index.rst, in order to make it part of the documentation body. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 7ac0cbb49142edc22f0b3b4033907da6b3f698d9 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:57 2020 +0200 docs: networking: device drivers: convert toshiba/spider_net.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit e9a5475e735c9603b870c6ee5189de7cd32bb080 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:56 2020 +0200 docs: networking: device drivers: convert ti/tlan.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark tables as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 6f22789da76d1183ed6fbb168ac4f99a5ee540a3 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:55 2020 +0200 docs: networking: device drivers: convert ti/cpsw.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 8470f18ea651950094b4d3eba513be194e9141f8 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:54 2020 +0200 docs: networking: device drivers: convert ti/cpsw_switchdev.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - use :field: markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit d6a998732b6d00b365c157a5f5ec321f3ac20cf0 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:53 2020 +0200 docs: networking: device drivers: convert smsc/smc9.txt to ReST - add SPDX header; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 21620b6586f7866aa76fc1a29c572b70fc12b1dc Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:52 2020 +0200 docs: networking: device drivers: convert sb1000.txt to ReST - add SPDX header; - add a document title; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit acfcf23597d62700f1c8e1975bca34070e0251ef Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:51 2020 +0200 docs: networking: device drivers: convert qualcomm/rmnet.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit f10727d3b68c8e03111436de94c922ffe304e21e Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:50 2020 +0200 docs: networking: device drivers: convert neterion/vxge.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 7762f5c514dce027ad2a2031390c0c19c24547af Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:49 2020 +0200 docs: networking: device drivers: convert neterion/s2io.txt to ReST - add SPDX header; - add a document title; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 011531f7e525983f0bf2060fb4f048f580606d74 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:48 2020 +0200 docs: networking: device drivers: convert microsoft/netvsc.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c81f195703270a330f04ae41b9890b13c101a63f Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:47 2020 +0200 docs: networking: device drivers: convert intel/ipw2200.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - use copyright symbol; - use :field: markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit cf7eba49b2b160f98106b33ca12039b05d812140 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:46 2020 +0200 docs: networking: device drivers: convert intel/ipw2100.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - use copyright symbol; - use :field: markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit dc67e91e7f7b2245a3a341e62217cb5e7163d60b Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:45 2020 +0200 docs: networking: device drivers: convert freescale/gianfar.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - use :field: markup; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 0d0d976f59a57e5536ff01825f0bc8a0dbb0fe6b Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:44 2020 +0200 docs: networking: device drivers: convert freescale/dpaa.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - use :field: markup; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit ca705e4793f024afb8e86030e08b1e0f16dcc07c Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:43 2020 +0200 docs: networking: device drivers: convert dlink/dl2k.txt to ReST - add SPDX header; - mark code blocks and literals as such; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c981977d3a5ce55c96b1b77f42d0a9df0a79244e Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:42 2020 +0200 docs: networking: device drivers: convert dec/dmfe.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit b6671d71ca811aed02f136a6cd812a542f88c483 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:41 2020 +0200 docs: networking: device drivers: convert dec/de4x5.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit e1ddedb5cbd6f8ec2f41874bc06e03023fbd9d99 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:40 2020 +0200 docs: networking: device drivers: convert davicom/dm9000.txt to ReST - add SPDX header; - add a document title; - mark lists as such; - mark tables as such; - mark code blocks and literals as such; - use the right horizontal tag markup; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 714a4da450c03bdc53a0d5fa6a4b3192b30c5cda Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:39 2020 +0200 docs: networking: device drivers: convert cirrus/cs89x0.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c839ce557b35de084d06f91c4e37948bdcef9709 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:38 2020 +0200 docs: networking: device drivers: convert chelsio/cxgb.txt to ReST - add SPDX header; - use copyright symbol; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - add notes markups; - mark tables as such; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c958119a487ec4578f50b352f45e965a30daa020 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:37 2020 +0200 docs: networking: device drivers: convert aquantia/atlantic.txt to ReST - add SPDX header; - use copyright symbol; - adjust title and its markup; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 8d299c7e912bd8ebb88b9ac2b8e336c9878783aa Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:36 2020 +0200 docs: networking: device drivers: convert amazon/ena.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 9ea2af8d16f5612168ed52cb0ec6752bac0877a9 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:35 2020 +0200 docs: networking: device drivers: convert 3com/vortex.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c79773e83e66fb2c22627eda3cd768f9e2bc10b5 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:34 2020 +0200 docs: networking: device drivers: convert 3com/3c509.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - add notes markups; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 0046db09d539523ef1470bcad2f2614cc3ef7ddf Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:33 2020 +0200 docs: networking: convert z8530drv.txt to ReST - add SPDX header; - use copyright symbol; - adjust titles and chapters, adding proper markups; - mark tables as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit a6c34b476ca27d0e5c14e58aefdbbdc4c509dd5f Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:32 2020 +0200 docs: networking: convert xfrm_sysctl.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - add a chapter's markup; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit a5cfea33e5e54854fa541deb08b85b782f21bab5 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:31 2020 +0200 docs: networking: convert xfrm_sync.txt to ReST - add SPDX header; - add a document title; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit da62baada5cc94037ef91ed0c414a930a3a06520 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:30 2020 +0200 docs: networking: convert xfrm_proc.txt to ReST - add SPDX header; - adjust title markup; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c4a0eb9350183d1d188793c534e4141bcf2ccea8 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:29 2020 +0200 docs: networking: convert xfrm_device.txt to ReST - add SPDX header; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c4ea03fdfd122b4ff293bff643c2369852e9cc1c Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:28 2020 +0200 docs: networking: convert x25.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 883780af72090daf9ab53779a3085a6ddfc468ca Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:27 2020 +0200 docs: networking: convert x25-iface.txt to ReST Not much to be done here: - add SPDX header; - adjust title markup; - remove a tail whitespace; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit d2a85c184ac6e738daa5e42f89b1f353910d6a89 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:26 2020 +0200 docs: networking: convert vxlan.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 58ccb2b2e87d52ec0b4cbd40b94e0b63e90af873 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:25 2020 +0200 docs: networking: convert vrf.txt to ReST - add SPDX header; - adjust title markup; - Add a subtitle for the first section; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: David Ahern Signed-off-by: David S. Miller commit 961fb1ff412a2cefaf50f4f56bb60a10ed071df5 Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:24 2020 +0200 docs: networking: convert udplite.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark lists as such; - mark tables as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 973d55e590beeca13fece60596ee3b511d36d9da Author: Mauro Carvalho Chehab Date: Fri May 1 16:44:23 2020 +0200 docs: networking: convert tuntap.txt to ReST - add SPDX header; - use copyright symbol; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 43a10b15d44221371126a07347f2b5d11b8314df Author: shaoyunl Date: Mon Apr 27 13:38:28 2020 -0400 amd/amdgpu: Limit rlcg write registers only for nv12 Create gfx_v10_0_rlc_funcs_sriov for nv12 with rlcg_write function pointers be initialized so driver can use RLCG to write aceess CSIB and CP_ME_CNTL registers when nv12 in sriov mode Signed-off-by: shaoyunl Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d09f85d52ad6d1da9d6b8aecca6b81e0b4750afb Author: Yong Zhao Date: Wed Mar 4 16:52:41 2020 -0500 drm/amdkfd: Use a systematic method to calculate queue mask bit The queue mask used for set_resources always assumes the queue number per pipe is 8, so KFD needs to align with that by using function amdgpu_queue_mask_bit_to_set_resource_bit(). Signed-off-by: Yong Zhao Signed-off-by: Alex Deucher commit 5c180eb910df3c635e22f5327fd074aafafc7523 Author: Yong Zhao Date: Wed Mar 4 16:46:13 2020 -0500 drm/amdgpu: Rename amdgpu_gfx_kcq_queue_mask_transform() Rename it to amdgpu_queue_mask_bit_to_set_resource_bit() to be more specific about its functionality. KFD will use it later. Signed-off-by: Yong Zhao Signed-off-by: Alex Deucher commit 942a0dd2d6d5b1586784e1ff2c056382ee05a9fa Author: Hawking Zhang Date: Fri Jan 17 01:10:52 2020 +0800 drm/amdgpu: skip reservation of discovery tmr region in pre-Navi IP discovery is only supported in Navi series and onwards. There is no need to reserve a portion of vram as discovery tmr region for pre-Navi adapters. Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit e0c116c1906618823e6fa823a8a727bcea04ac18 Author: Hawking Zhang Date: Tue Mar 31 15:20:49 2020 -0400 drm/amdgpu: re-structue members for ip discovery This is to prepare for initializing discovery tmr size per ASIC type Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 3ab6fe4b28a6614126a07c8210b013abf8da35f4 Author: Likun Gao Date: Thu Oct 24 11:56:07 2019 +0800 drm/amdgpu: update the method to set kcq queue mask Use a common method to set queue mask before set kiq resource. The value of queue mask must suitablt for the designated form. Signed-off-by: Likun Gao Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 98bf250edd64344124fe5f619d6320d02e17af5e Author: Likun Gao Date: Thu Aug 15 15:46:10 2019 +0800 drm/amdgpu: check SMU NULL ptr on gfx hw init Check SMU NULL ptr before load smu fw. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 68a9fb4d2980d242b600ff9c0728490b44003dd3 Author: Boyuan Zhang Date: Tue Apr 28 17:00:25 2020 -0400 drm/amdgpu: change HWIP from UVD to VCN for VCN2.5 Rename hardware IP name from UVD to VCN to reduce confusion. Hardware IP name UVD and VCN are equivalent for VCN2.5 asics. Use name VCN for future VCN based asics. V2: update description V3: rebase Signed-off-by: Boyuan Zhang Reviewed-by: James Zhu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c6bc6041b10f70b617f2d13894311fe62027d292 Author: Maor Gottlieb Date: Thu Apr 30 22:21:41 2020 +0300 net/mlx5: Add support to get lag physical port Add function to get the device physical port of the lag slave. Signed-off-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 64363e61c7bbcfa4c7d6697d96ef2e18fc311cf3 Author: Maor Gottlieb Date: Thu Apr 30 22:21:40 2020 +0300 net/mlx5: Change lag mutex lock to spin lock The lag lock could be a spin lock, the critical section is short and there is no need that the thread will sleep. Change the lock that protects the LAG structure from mutex to spin lock. It is required for next patch that need to access this structure from context that we can't sleep. In addition there is no need to hold this lock when query the congestion counters. Signed-off-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 33720aaf8c2af5c0ff341a16b5048b9c7ecae569 Author: Maor Gottlieb Date: Thu Apr 30 22:21:39 2020 +0300 bonding: Implement ndo_get_xmit_slave Add implementation of ndo_get_xmit_slave. Find the slave by using the helper function according to the bond mode. If the caller set all_slaves to true, then it assumes that all slaves are available to transmit. Signed-off-by: Maor Gottlieb Reviewed-by: Jay Vosburgh Reviewed-by: Jiri Pirko Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 6b447e76ed44cc354cd0a346b86efe393e603e0d Author: Maor Gottlieb Date: Thu Apr 30 22:21:38 2020 +0300 bonding: Add array of all slaves Keep all slaves in array so it could be used to get the xmit slave assume all the slaves are active. The logic to add slave to the array is like the usable slaves, except that we also add slaves that currently can't transmit - not up or active. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 5a19f1c1a2a0f7d5fb80b130ab4a15fa99e792d7 Author: Maor Gottlieb Date: Thu Apr 30 22:21:37 2020 +0300 bonding: Add function to get the xmit slave in active-backup mode Add helper function to get the xmit slave in active-backup mode. It's only one line function that return the curr_active_slave, but it will used both in the xmit flow and by the new .ndo to get the xmit slave. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 29d5bbccb3a171eb146c94efeb3d752fad3ddf7d Author: Maor Gottlieb Date: Thu Apr 30 22:21:36 2020 +0300 bonding: Add helper function to get the xmit slave in rr mode Add helper function to get the xmit slave when bond is in round robin mode. Change bond_xmit_slave_id to bond_get_slave_by_id, then the logic for find the next slave for transmit could be used both by the xmit flow and the .ndo to get the xmit slave. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit c071d91d2a89b0dac1354673810b36453aed62c4 Author: Maor Gottlieb Date: Thu Apr 30 22:21:35 2020 +0300 bonding: Add helper function to get the xmit slave based on hash Both xor and 802.3ad modes use bond_xmit_hash to get the xmit slave. Export the logic to helper function so it could be used in the following patches by the .ndo to get the xmit slave. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 34b37e204dfc8b20a09bb7b7f4c5e970c87420dd Author: Maor Gottlieb Date: Thu Apr 30 22:21:34 2020 +0300 bonding/alb: Add helper functions to get the xmit slave Add two helper functions to get the xmit slave of bond in alb or tlb mode. Extract the logic of find the xmit slave from the xmit flow to function. Xmit flow will xmit through this slave and in the following patches the new .ndo will call to the helper function to return the xmit slave. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit ed7d4f023b1a9b0578f20d66557c66452ab845ec Author: Maor Gottlieb Date: Thu Apr 30 22:21:33 2020 +0300 bonding: Rename slave_arr to usable_slaves Rename slave_arr to usable_slaves, since we will have two arrays, one for the usable slaves and the other to all slaves. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit 119d48fd4298594beccf4f2ecd00627826ce2646 Author: Maor Gottlieb Date: Thu Apr 30 22:21:32 2020 +0300 bonding: Export skip slave logic to function As a preparation for following change that add array of all slaves, extract code that skip slave to function. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: Jay Vosburgh Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit cff9f12b18915d957a2130885a00f8ab15cff7e4 Author: Maor Gottlieb Date: Thu Apr 30 22:21:31 2020 +0300 net/core: Introduce netdev_get_xmit_slave Add new ndo to get the xmit slave of master device. The reference counters are not incremented so the caller must be careful with locks. User can ask to get the xmit slave assume all the slaves can transmit by set all_slaves arg to true. Signed-off-by: Maor Gottlieb Reviewed-by: Jiri Pirko Reviewed-by: David Ahern Acked-by: David S. Miller Signed-off-by: Saeed Mahameed commit ef891284b130c365a7b60afaf7fe3c92c4260bfb Author: Heiner Kallweit Date: Fri May 1 10:11:28 2020 +0200 r8169: remove not needed parameter in rtl8169_set_magic_reg Remove a not needed parameter in rtl8169_set_magic_reg. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 4c09f8b6913a779ca0c70ea8058bf21537eebb3b Author: Wei Yongjun Date: Wed Apr 29 07:30:53 2020 +0000 selinux: fix error return code in policydb_read() Fix to return negative error code -ENOMEM from the kvcalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: acdf52d97f82 ("selinux: convert to kvmalloc") Signed-off-by: Wei Yongjun Signed-off-by: Paul Moore commit 3dbb5b5040c396274a253b607289748f39a680a0 Merge: c32102224470 31a9f7fe9337 Author: Alexei Starovoitov Date: Fri May 1 10:36:32 2020 -0700 Merge branch 'bpf_enable_stats' Song Liu says: ==================== run_time_ns is a useful stats for BPF programs. However, it is gated by sysctl kernel.bpf_stats_enabled. When multiple user space tools are toggling kernl.bpf_stats_enabled at the same time, they may confuse each other. Solve this problem with a new BPF command BPF_ENABLE_STATS. Changes v8 => v9: 1. Clean up in selftest (Andrii). 2. Not using static variable in test program (Andrii). Changes v7 => v8: 1. Change name BPF_STATS_RUNTIME_CNT => BPF_STATS_RUN_TIME (Alexei). 2. Add CHECK_ATTR to bpf_enable_stats() (Alexei). 3. Rebase (Andrii). 4. Simplfy the selftest (Alexei). Changes v6 => v7: 1. Add test to verify run_cnt matches count measured by the program. Changes v5 => v6: 1. Simplify test program (Yonghong). 2. Rebase (with some conflicts). Changes v4 => v5: 1. Use memset to zero bpf_attr in bpf_enable_stats() (Andrii). Changes v3 => v4: 1. Add libbpf support and selftest; 2. Avoid cleaning trailing space. Changes v2 => v3: 1. Rename the command to BPF_ENABLE_STATS, and make it extendible. 2. fix commit log; 3. remove unnecessary headers. ==================== Signed-off-by: Alexei Starovoitov commit 31a9f7fe93378ab587d758d5b2e96a237caa7b8c Author: Song Liu Date: Thu Apr 30 00:15:06 2020 -0700 bpf: Add selftest for BPF_ENABLE_STATS Add test for BPF_ENABLE_STATS, which should enable run_time_ns stats. ~/selftests/bpf# ./test_progs -t enable_stats -v test_enable_stats:PASS:skel_open_and_load 0 nsec test_enable_stats:PASS:get_stats_fd 0 nsec test_enable_stats:PASS:attach_raw_tp 0 nsec test_enable_stats:PASS:get_prog_info 0 nsec test_enable_stats:PASS:check_stats_enabled 0 nsec test_enable_stats:PASS:check_run_cnt_valid 0 nsec Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200430071506.1408910-4-songliubraving@fb.com commit 0bee106716cfb2c6da81916b968395db22bd7755 Author: Song Liu Date: Thu Apr 30 00:15:05 2020 -0700 libbpf: Add support for command BPF_ENABLE_STATS bpf_enable_stats() is added to enable given stats. Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200430071506.1408910-3-songliubraving@fb.com commit d46edd671a147032e22cfeb271a5734703093649 Author: Song Liu Date: Thu Apr 30 00:15:04 2020 -0700 bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS Currently, sysctl kernel.bpf_stats_enabled controls BPF runtime stats. Typical userspace tools use kernel.bpf_stats_enabled as follows: 1. Enable kernel.bpf_stats_enabled; 2. Check program run_time_ns; 3. Sleep for the monitoring period; 4. Check program run_time_ns again, calculate the difference; 5. Disable kernel.bpf_stats_enabled. The problem with this approach is that only one userspace tool can toggle this sysctl. If multiple tools toggle the sysctl at the same time, the measurement may be inaccurate. To fix this problem while keep backward compatibility, introduce a new bpf command BPF_ENABLE_STATS. On success, this command enables stats and returns a valid fd. BPF_ENABLE_STATS takes argument "type". Currently, only one type, BPF_STATS_RUN_TIME, is supported. We can extend the command to support other types of stats in the future. With BPF_ENABLE_STATS, user space tool would have the following flow: 1. Get a fd with BPF_ENABLE_STATS, and make sure it is valid; 2. Check program run_time_ns; 3. Sleep for the monitoring period; 4. Check program run_time_ns again, calculate the difference; 5. Close the fd. Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200430071506.1408910-2-songliubraving@fb.com commit d09ddd8190fbdc07696bf34b548ae15aa1816714 Author: Ard Biesheuvel Date: Tue Apr 21 18:22:56 2020 +0200 PCI: Allow pci_resize_resource() for devices on root bus When resizing a BAR, pci_reassign_bridge_resources() is invoked to bring the bridge windows of parent bridges in line with the new BAR assignment. This assumes the device whose BAR is being resized lives on a subordinate bus, but this is not necessarily the case. A device may live on the root bus, in which case dev->bus->self is NULL, and passing a NULL pci_dev pointer to pci_reassign_bridge_resources() will cause it to crash. So let's make the call to pci_reassign_bridge_resources() conditional on whether dev->bus->self is non-NULL in the first place. Fixes: 8bb705e3e79d84e7 ("PCI: Add pci_resize_resource() for resizing BARs") Link: https://lore.kernel.org/r/20200421162256.26887-1-ardb@kernel.org Signed-off-by: Ard Biesheuvel Signed-off-by: Bjorn Helgaas Reviewed-by: Christian König commit e83a2e443468664af5421ef5a3499980a4493248 Author: Michał Mirosław Date: Fri May 1 17:11:18 2020 +0200 power: supply: core: tabularize HWMON temperature labels Rework power_supply_hwmon_read_string() to check it's parameters. This allows to extend it later with labels for other types of measurements. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit e149ca29f3994ca79e9e77aa2f5b2e871e9f7c99 Author: Pierre-Louis Bossart Date: Fri May 1 09:58:50 2020 -0500 ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only Remove the ambiguity with GPL-2.0 and use an explicit GPL-2.0-only tag. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200501145850.15178-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8c149b7d75e53be47648742f40fc90d9fc6fa63a Author: Krzysztof Kozlowski Date: Fri May 1 15:35:34 2020 +0200 dt-bindings: sound: wm8994: Correct required supplies based on actual implementaion The required supplies in bindings were actually not matching implementation making the bindings incorrect and misleading. The Linux kernel driver requires all supplies to be present. Also for wlf,wm8994 uses just DBVDD-supply instead of DBVDDn-supply (n: <1,3>). Reported-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200501133534.6706-1-krzk@kernel.org Signed-off-by: Mark Brown commit f139546fb7d436145cbbffa346de7d5353c84fdf Author: Pierre-Louis Bossart Date: Fri May 1 10:16:25 2020 -0500 ASoC: Intel: boards: sof-wm8804: support for Hifiberry Digiplus boards Add a new machine driver to interface with WM8804. The code is based on settings found in sound/soc/bcm/hifiberry-digi.c in the Raspberry PI tree. Tested on Up2 with Digi+ IO (capture+playback) and Digi+ PRO (playback with two local oscillators supported). The codec is clock master in both cases. Capture support has known clocking restrictions: the transmitter needs to be active for the clock recovery, the "Tx Source" mixer set to "S/PDIF RX". Playback will only work while capture is active. When Capture is not desired, or when there is no RX connector, the "Tx Source" mixer should be set to "AIF" Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200501151625.17820-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9f909e215fea0652023b9ed09d3d7bfe10386423 Author: Chris Wilson Date: Fri May 1 15:51:20 2020 +0100 drm/i915: Implement vm_ops->access for gdb access into mmaps gdb uses ptrace() to peek and poke bytes of the target's address space. The driver must implement an vm_ops->access() handler or else gdb will be unable to inspect the pointer and report it as out-of-bounds. Worse than useless as it causes immediate suspicion of the valid GTT pointer, distracting the poor programmer trying to find his bug. v2: Write-protect readonly objects (Matthew). Testcase: igt/gem_mmap_gtt/ptrace Testcase: igt/gem_mmap_offset/ptrace Suggested-by: Kristian H. Kristensen Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Joonas Lahtinen Cc: Maciej Patelczyk Cc: Kristian H. Kristensen Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200501145120.18830-1-chris@chris-wilson.co.uk commit db9ff6ecf6efa6ffc45bfd5dc8d5708cfe5e89cb Author: Zheng Bin Date: Wed Apr 29 17:26:48 2020 +0800 audit: make symbol 'audit_nfcfgs' static Fix sparse warnings: kernel/auditsc.c:138:32: warning: symbol 'audit_nfcfgs' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Paul Moore commit 0c59c06a7c90390c3985c9acd58a73320781c15e Author: Rob Herring Date: Thu Apr 9 17:49:22 2020 -0600 PCI: host-generic: Support building as modules Enable building host-generic and its host-common dependency as a module. Link: https://lore.kernel.org/r/20200409234923.21598-3-robh@kernel.org Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Acked-by: Will Deacon Acked-by: Bjorn Helgaas Cc: Lorenzo Pieralisi Cc: Andrew Murray Cc: Bjorn Helgaas Cc: Will Deacon Cc: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org commit 0b104773b4f72ccd8af98a2f1efe69b174c344d3 Author: Rob Herring Date: Thu Apr 9 17:49:21 2020 -0600 PCI: Constify struct pci_ecam_ops struct pci_ecam_ops is typically DT match table data which is defined to be const. It's also best practice for ops structs to be const. Ideally, we'd make struct pci_ops const as well, but that becomes pretty invasive, so for now we just cast it where needed. Link: https://lore.kernel.org/r/20200409234923.21598-2-robh@kernel.org Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas Acked-by: Catalin Marinas Cc: Catalin Marinas Cc: Will Deacon Cc: Lorenzo Pieralisi Cc: Andrew Murray Cc: Bjorn Helgaas Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Jonathan Chocron Cc: Zhou Wang Cc: Robert Richter Cc: Toan Le Cc: Marc Gonzalez Cc: Mans Rullgard Cc: linux-acpi@vger.kernel.org commit 97ed79f4931964069fc3be7ae5122c3026273f9e Author: Michał Mirosław Date: Fri May 1 16:30:43 2020 +0200 power: charger-manager: clarify num_properties starting value Initialize num_properties with length of the copied array instead of relying on previously memcpy'd value. This makes it clear how the array and the counter are related. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit a211da9c771bf97395a3ced83a3aa383372b13a7 Author: Chris Wilson Date: Fri May 1 13:22:49 2020 +0100 drm/i915/gt: Make timeslicing an explicit engine property In order to allow userspace to rely on timeslicing to reorder their batches, we must support preemption of those user batches. Declare timeslicing as an explicit property that is a combination of having the kernel support and HW support. Suggested-by: Tvrtko Ursulin Fixes: 8ee36e048c98 ("drm/i915/execlists: Minimalistic timeslicing") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200501122249.12417-1-chris@chris-wilson.co.uk commit 6e696ae36ec7e089b94431208dabcb9d8528ebdf Author: Felix Kuehling Date: Wed Apr 29 19:38:19 2020 -0400 drm/amdgpu: Add missing parameter description in comments Kerneldoc comments should describe all function parameters. Signed-off-by: Felix Kuehling Reviewed-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 0aeaaf64e6d06e353de15dcf9973312ae0672ca1 Author: Felix Kuehling Date: Wed Apr 29 19:36:06 2020 -0400 drm/amdkfd: Fix comment formatting Corrected two function names. Added a missing space. Signed-off-by: Felix Kuehling Reviewed-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 25f43a322725f933d9fcc1204a6f4e7f45c44126 Author: Oak Zeng Date: Fri Jun 1 17:25:06 2018 -0400 drm/amdgpu: Changed CU reservation golden settings With previous golden settings, compute task can't use reserved LDS (32K) on CU0 and CU1. On 64K LDS system, if compute work group allocate more than 32K LDS, then it can't be dispatched to CU0 and CU1 because of the reservation. This enables compute task to use reserved LDS on CU0 and CU1. Signed-off-by: Oak Zeng Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Signed-off-by: Felix Kuehling commit 3e58e95acef5a49038e61570100764bb483c4034 Author: Ori Messinger Date: Wed Aug 21 10:48:43 2019 -0400 drm/amdkfd: Report domain with topology PCI domain has moved to 32-bits to accommodate virtualization, so a 32-bit integer is exposed for domain to reflect this change. Domain can be found in here: /sys/class/kfd/kfd/topology/nodes/X/properties Where X is the card number Signed-off-by: Ori Messinger Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b0e4aa97ea4b58881b85697a6f5628d1839d8e59 Author: Michał Mirosław Date: Fri Apr 3 22:20:34 2020 +0200 power: supply: core: hide unused HWMON labels Currently HWMON emulation shows all labels (temp and ambient temp) regardless if power supply supports reading the values. Check that at least one property is enabled for each label. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 6b20464ad9fb5fd76ef6f219ce62156aa9639dcc Author: Michał Mirosław Date: Fri Apr 3 22:20:33 2020 +0200 power: supply: core: fix HWMON temperature labels tempX_label files are swapped compared to what power_supply_hwmon_temp_to_property() uses. Make them match. Cc: stable@vger.kernel.org Fixes: e67d4dfc9ff1 ("power: supply: Add HWMON compatibility layer") Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 9ba2353b2cc58ba13f7a7369208107f133f6a27b Author: Michał Mirosław Date: Fri Apr 3 22:20:32 2020 +0200 power: supply: core: allow to constify property lists Since tables pointed to by power_supply_desc->properties and ->usb_types are not expected to change after registration, mark the pointers accordingly Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 191e6bcf50dd54786c3560420b815bce5b523a61 Author: Sebastian Reichel Date: Mon Apr 13 20:38:52 2020 +0200 power: supply: generic-adc-battery: Prepare for const properties This prepares the driver to work with the properties entry in power_supply_desc marked as const. Reviewed-by: Enric Balletbo i Serra Signed-off-by: Sebastian Reichel commit 4cb3825859dcc37eaf6994a32c3487d0a1fdda0b Author: Sebastian Reichel Date: Mon Apr 13 20:38:51 2020 +0200 power: supply: charger-manager: Prepare for const properties This prepares the driver to work with the properties entry in power_supply_desc marked as const. Reviewed-by: Enric Balletbo i Serra Signed-off-by: Sebastian Reichel commit 49c22696348d6e7c8a2ecfd7e60fddfe188ded82 Author: Kai-Heng Feng Date: Thu Apr 30 17:11:39 2020 +0800 ASoC: SOF: Update correct LED status at the first time usage of update_mute_led() At the first time update_mute_led() gets called, if channels are already muted, the temp value equals to led_value as 0, skipping the following LED setting. So set led_value to -1 as an uninitialized state, to update the correct LED status at first time usage. Fixes: 5d43001ae436 ("ASoC: SOF: acpi led support for switch controls") Signed-off-by: Kai-Heng Feng Reviewed-by: Ranjani Sridharan Acked-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200430091139.7003-1-kai.heng.feng@canonical.com Signed-off-by: Mark Brown commit de46e0289310b5e56994eafec2f0d2a5da095ea9 Author: Michał Mirosław Date: Fri Apr 3 22:20:32 2020 +0200 power: supply: core: reduce power_supply_show_usb_type() parameters Reduce power_supply_show_usb_type() parameter count by folding power_supply_desc dereference into the function. This makes following patch making usb_types const easier. Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 7f0d5053c5a9d23fe5c2d337495a9d79038d267b Author: Dan Carpenter Date: Fri May 1 12:40:11 2020 +0300 ALSA: isa/wavefront: prevent out of bounds write in ioctl The "header->number" comes from the ioctl and it needs to be clamped to prevent out of bounds writes. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200501094011.GA960082@mwanda Signed-off-by: Takashi Iwai commit 3b55cdeb8f1b71444da866fd2568b1a18ba7f9c3 Author: Chris Wilson Date: Thu Apr 30 19:33:24 2020 +0100 drm/i915/pmu: Keep a reference to module while active While a perf event is open, keep a reference to the module so we don't remove the driver internals mid-sampling. Testcase: igt/perf_pmu/module-unload Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: stable@vger.kernel.org Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200430183324.23984-1-chris@chris-wilson.co.uk commit 0127f59794b39debf2daf3c7ff755236630198ed Author: Takashi Iwai Date: Fri May 1 09:28:56 2020 +0200 ALSA: hda/realtek - Fix unused variable warning w/o CONFIG_LEDS_TRIGGER_AUDIO Cover with a proper ifdef around the variable declaration for fixing the following compilation warning without CONFIG_LEDS_TRIGGER_AUDIO: sound/pci/hda/patch_realtek.c: In function 'alc_fixup_hp_gpio_led': sound/pci/hda/patch_realtek.c:4134:6: warning: unused variable 'err' [-Wunused-variable] Reported-by: Stephen Rothwell Fixes: 87dc36482cab ("ALSA: hda/realtek - Add LED class support for micmute LED") Link: https://lore.kernel.org/r/20200501072857.13720-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 055042bedd4e0af8186266b189b81e73e708b82b Author: Arvind Sankar Date: Thu Apr 30 14:28:43 2020 -0400 efi/libstub: Check return value of efi_parse_options efi_parse_options can fail if it is unable to allocate space for a copy of the command line. Check the return value to make sure it succeeded. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-12-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 7dde67f2a23ac11962b17128d9a71698430ced95 Author: Arvind Sankar Date: Thu Apr 30 14:28:42 2020 -0400 efi/x86: Support builtin command line Add support for the x86 CMDLINE_BOOL and CMDLINE_OVERRIDE configuration options. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-11-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit f61900fd0ebf6c6b91719d63272a54f4d11051df Author: Arvind Sankar Date: Thu Apr 30 14:28:41 2020 -0400 efi/libstub: Unify initrd loading across architectures Factor out the initrd loading into a common function that can be called both from the generic efi-stub.c and the x86-specific x86-stub.c. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-10-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 987053a30016a7d9ab3e4ad973e7c51aeb1f1ef6 Author: Arvind Sankar Date: Thu Apr 30 14:28:40 2020 -0400 efi/x86: Move command-line initrd loading to efi_main Consolidate the initrd loading in efi_main. The command line options now need to be parsed only once. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-9-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 3839ab85d0fabd8b51c7548c4c1bc35bdba8adca Author: Arvind Sankar Date: Thu Apr 30 14:28:39 2020 -0400 efi/libstub: Upgrade ignored dtb= argument message to error Use efi_err if we ignore a command-line dtb= argument, so that it shows up even on a quiet boot. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-8-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit dad5b324212ef261e9b399b7456a4c3df0a8c300 Author: Arvind Sankar Date: Thu Apr 30 14:28:38 2020 -0400 efi/tpm: Use efi_err for error messages Use efi_err instead of bare efi_printk for error messages. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-7-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 61eac6d92d351fc446c7a0ba3b55a9b8d9977e30 Author: Arvind Sankar Date: Thu Apr 30 14:28:37 2020 -0400 efi/gop: Use efi_err for error messages Use efi_err instead of bare efi_printk for error messages. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-6-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 36bdd0a78d56831f5d8df740012b6cdc71c0c73d Author: Arvind Sankar Date: Thu Apr 30 14:28:36 2020 -0400 efi/x86: Use efi_err for error messages Use efi_err instead of bare efi_printk for error messages. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-5-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 793473c28a4b17ade3c2bb69782fb0b55acb6e0b Author: Arvind Sankar Date: Thu Apr 30 14:28:35 2020 -0400 efi/libstub: Move pr_efi/pr_efi_err into efi namespace Rename pr_efi to efi_info and pr_efi_err to efi_err to make it more obvious that they are part of the EFI stub and not generic printk infra. Suggested-by: Joe Perches Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-4-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit eed4e0193ee7b00213791f7732bce0fc0c54f3b3 Author: Arvind Sankar Date: Thu Apr 30 14:28:34 2020 -0400 efi/libstub: Add a helper function to split 64-bit values In several places 64-bit values need to be split up into two 32-bit fields, in order to be backward-compatible with the old 32-bit ABIs. Instead of open-coding this, add a helper function to set a 64-bit value as two 32-bit fields. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-3-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 019512f1fd373632577ecd3e8d721e48b71fb36a Author: Arvind Sankar Date: Thu Apr 30 14:28:33 2020 -0400 efi/x86: Use correct size for boot_params struct boot_params is only 4096 bytes, not 16384. Fix this by using sizeof(struct boot_params) instead of hardcoding the incorrect value. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-2-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 37ecb5b8b8cd3156e739fd1c56a8e3842b72ebad Author: Zou Wei Date: Wed Apr 29 11:35:28 2020 +0800 hinic: Use kmemdup instead of kzalloc and memcpy Fixes coccicheck warnings: drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:452:17-24: WARNING opportunity for kmemdup drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:458:23-30: WARNING opportunity for kmemdup Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: David S. Miller commit 2597912514925f6f06e85807cc9fc0fdfa630d11 Author: Zheng Bin Date: Wed Apr 29 09:58:24 2020 +0800 hinic: make symbol 'dump_mox_reg' static Fix sparse warnings: drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:601:6: warning: symbol 'dump_mox_reg' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: David S. Miller commit e4e51da66dc812176cca16b0f8a5b87b173deb5d Author: Michael Walle Date: Wed Apr 29 01:06:59 2020 +0200 net: phy: bcm54140: add second PHY ID This PHY has two PHY IDs depending on its mode. Adjust the mask so that it includes both IDs. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e9a66851de722dfa97a41e982266603cdb97ea3b Author: Michael Walle Date: Wed Apr 29 01:06:58 2020 +0200 net: phy: bcm54140: apply the workaround on b0 chips The lower three bits of the phy_id specifies the chip stepping. The workaround is specifically for the B0 stepping. Apply it only on these chips. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit afcecca56f0cd287c7895511dc380b95c633b1a2 Author: Michael Walle Date: Wed Apr 29 01:06:57 2020 +0200 net: phy: bcm54140: fix phy_id_mask Broadcom defines the bits for this PHY as follows: { oui[24:3], model[6:0], revision[2:0] } Thus we have to mask the lower three bits only. Fixes: 6937602ed3f9 ("net: phy: add Broadcom BCM54140 support") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 86570d8a2f768485a515f646d702a37b34b27260 Author: Michael Walle Date: Wed Apr 29 01:06:56 2020 +0200 net: phy: bcm54140: use genphy_soft_reset() Set the .soft_reset() op to be sure there will be a reset even if there is no hardware reset line registered. Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit cde0f4f81d1c11ccc214146e1c550bfe48629fac Author: Michael Walle Date: Tue Apr 28 23:15:02 2020 +0200 net: phy: at803x: add downshift support The AR8031 and AR8035 support the link speed downshift. Add driver support for it. One peculiarity of these PHYs is that it needs a software reset after changing the setting, thus add the .soft_reset() op and do a phy_init_hw() if necessary. This was tested on a custom board with the AR8031. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 838974e1e08a9724525fa13ef15d6e021c23c99d Author: Heiner Kallweit Date: Tue Apr 28 22:55:59 2020 +0200 r8169: configure PME_SIGNAL for RTL8125 too RTL8125 supports the same PME_SIGNAL handling as all later RTL8168 chip variants. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit b410439ca371334cd9e5772e411b5e2b6b2d0c9a Author: Heiner Kallweit Date: Tue Apr 28 22:54:12 2020 +0200 r8169: improve max jumbo packet size definition Sync definition of max jumbo packet size with vendor driver and reserve 22 bytes for VLAN ethernet header plus checksum. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 78734404ef9c133eac70339415c8028dbe19109a Author: Bjorn Andersson Date: Tue Apr 28 00:01:39 2020 -0700 net: usb: ax88179_178a: Implement ethtool_ops set_eeprom The vendor driver does upon failing to read a valid MAC address from EEPROM write the netdev's address back to EEPROM and invoking a EEPROM reload operation. Based on this we can implement the ethtool_ops set_eeprom and provide the means to populate the EEPROM from within Linux. It's worth noting that ax88179_get_eeprom() will return some default data unless the content of the EEPROM is deemed "complete", so until the EEPROM is fully populated (e.g. by running ethtool -e | ethtool -E) data written with ax88179_set_eeprom() will appear not to stick. The implementation is based on asix_set_eeprom(), from asix_common.c Signed-off-by: Bjorn Andersson Signed-off-by: David S. Miller commit 97fff7c8de1e54e5326dfeb66085796864bceb64 Author: Wei Yongjun Date: Mon Apr 27 10:43:22 2020 +0000 dpaa2-eth: fix error return code in setup_dpni() Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit c4db9934a33e5f276965a14b3eea7a6d64c85065 Author: Wei Yongjun Date: Mon Apr 27 09:40:52 2020 +0000 net: ll_temac: Fix return value check in temac_probe() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Acked-by: Esben Haabendal Signed-off-by: David S. Miller commit 0a699302be5986307b3dcf84ac7a0dd30f9e9305 Author: Fugang Duan Date: Mon Apr 27 22:08:04 2020 +0800 net: ethernet: fec: Revert "net: ethernet: fec: Replace interrupt driven MDIO with polled IO" This reverts commit 29ae6bd1b0d8a57d7c00ab12cbb949fc41986eef. The commit breaks ethernet function on i.MX6SX, i.MX7D, i.MX8MM, i.MX8MQ, and i.MX8QXP platforms. Boot yocto system by NFS mounting rootfs will be failed with the commit. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit 88ec7cb22ddde725ed4ce15991f0bd9dd817fd85 Author: Wei Yongjun Date: Mon Apr 27 12:15:07 2020 +0000 net: lpc-enet: fix error return code in lpc_mii_init() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: b7370112f519 ("lpc32xx: Added ethernet driver") Signed-off-by: Wei Yongjun Acked-by: Vladimir Zapolskiy Signed-off-by: David S. Miller commit f8d530ac29fe9248f5e58ca5bcf4c368f8393ccf Author: Wei Yongjun Date: Mon Apr 27 12:12:28 2020 +0000 ice: Fix error return code in ice_add_prof() Fix to return a error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 31ad4e4ee1e4 ("ice: Allocate flow profile") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 654cad8b6a17dcb00077070b27bc65873951a568 Author: Wei Yongjun Date: Mon Apr 27 12:11:10 2020 +0000 octeontx2-pf: Fix error return code in otx2_probe() Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: 5a6d7c9daef3 ("octeontx2-pf: Mailbox communication with AF") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 7ae9a4f483eccfd46f40ede8d2bd28fd2f7a9c5f Author: Aishwarya Ramakrishnan Date: Mon Apr 27 16:02:30 2020 +0530 dpaa_eth: Fix comparing pointer to 0 Fixes coccicheck warning: ./drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2110:30-31: WARNING comparing pointer to 0 Avoid pointer type value compared to 0. Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: David S. Miller commit f256356f65e6449a9fcf6089ea25882c91768665 Author: Yangbo Lu Date: Mon Apr 27 11:39:03 2020 +0800 ptp_qoriq: output PPS signal on FIPER2 in default Output PPS signal on FIPER2 (Fixed Period Interval Pulse) in default which is more desired by user. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 4fe5cda9f89d0aea8e915b7c96ae34bda4e12e51 Author: Christophe Leroy Date: Fri Apr 3 07:20:53 2020 +0000 powerpc/uaccess: Implement user_read_access_begin and user_write_access_begin Add support for selective read or write user access with user_read_access_begin/end and user_write_access_begin/end. Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6c83af0f0809ef2a955c39ac622767f6cbede035.1585898438.git.christophe.leroy@c-s.fr commit 1f59cc3482c645c956a06e1b587e49df8d42ebab Merge: 17bc43367fc2 b44f68738687 Author: Michael Ellerman Date: Fri May 1 12:36:22 2020 +1000 Merge branch 'topic/uaccess' into topic/uaccess-ppc Merge the generic changes to add user_[read|write]_access_begin(). commit b44f687386875b714dae2afa768e73401e45c21c Author: Christophe Leroy Date: Fri Apr 3 07:20:52 2020 +0000 drm/i915/gem: Replace user_access_begin by user_write_access_begin When i915_gem_execbuffer2_ioctl() is using user_access_begin(), that's only to perform unsafe_put_user() so use user_write_access_begin() in order to only open write access. Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ebf1250b6d4f351469fb339e5399d8b92aa8a1c1.1585898438.git.christophe.leroy@c-s.fr commit 41cd780524674082b037e7c8461f90c5e42103f0 Author: Christophe Leroy Date: Fri Apr 3 07:20:51 2020 +0000 uaccess: Selectively open read or write user access When opening user access to only perform reads, only open read access. When opening user access to only perform writes, only open write access. Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2e73bc57125c2c6ab12a587586a4eed3a47105fc.1585898438.git.christophe.leroy@c-s.fr commit 999a22890cb183b918e4372395d24426a755cef2 Author: Christophe Leroy Date: Fri Apr 3 07:20:50 2020 +0000 uaccess: Add user_read_access_begin/end and user_write_access_begin/end Some architectures like powerpc64 have the capability to separate read access and write access protection. For get_user() and copy_from_user(), powerpc64 only open read access. For put_user() and copy_to_user(), powerpc64 only open write access. But when using unsafe_get_user() or unsafe_put_user(), user_access_begin open both read and write. Other architectures like powerpc book3s 32 bits only allow write access protection. And on this architecture protection is an heavy operation as it requires locking/unlocking per segment of 256Mbytes. On those architecture it is therefore desirable to do the unlocking only for write access. (Note that book3s/32 ranges from very old powermac from the 90's with powerpc 601 processor, till modern ADSL boxes with PowerQuicc II processors for instance so it is still worth considering.) In order to avoid any risk based of hacking some variable parameters passed to user_access_begin/end that would allow hacking and leaving user access open or opening too much, it is preferable to use dedicated static functions that can't be overridden. Add a user_read_access_begin and user_read_access_end to only open read access. Add a user_write_access_begin and user_write_access_end to only open write access. By default, when undefined, those new access helpers default on the existing user_access_begin and user_access_end. Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/36e43241c7f043a24b5069e78c6a7edd11043be5.1585898438.git.christophe.leroy@c-s.fr commit 550cbea0b0f0c1d619a9d43d68d646db17964c36 Merge: 4d73ce19243e d07dcf9aadd6 Author: David S. Miller Date: Thu Apr 30 17:51:42 2020 -0700 Merge branch 'netlink-validation-improvements-refactoring' Johannes Berg says: ==================== netlink validation improvements/refactoring Alright, this is the resend now, really just changing - the WARN_ON_ONCE() as spotted by Jakub; - mark the export patch no longer RFC. I wasn't actually sure if you meant this one too, and I really should dig out and polish the code that showed it in userspace. ==================== Signed-off-by: David S. Miller commit d07dcf9aadd6b2842b439e8668ff7ea2873f28d7 Author: Johannes Berg Date: Thu Apr 30 22:13:12 2020 +0200 netlink: add infrastructure to expose policies to userspace Add, and use in generic netlink, helpers to dump out a netlink policy to userspace, including all the range validation data, nested policies etc. This lets userspace discover what the kernel understands. For families/commands other than generic netlink, the helpers need to be used directly in an appropriate command, or we can add some infrastructure (a new netlink family) that those can register their policies with for introspection. I'm not that familiar with non-generic netlink, so that's left out for now. The data exposed to userspace also includes min and max length for binary/string data, I've done that instead of letting the userspace tools figure out whether min/max is intended based on the type so that we can extend this later in the kernel, we might want to just use the range data for example. Because of this, I opted to not directly expose the NLA_* values, even if some of them are already exposed via BPF, as with min/max length we don't need to have different types here for NLA_BINARY/NLA_MIN_LEN/NLA_EXACT_LEN, we just make them all NL_ATTR_TYPE_BINARY with min/max length optionally set. Similarly, we don't really need NLA_MSECS, and perhaps can remove it in the future - but not if we encode it into the userspace API now. It gets mapped to NL_ATTR_TYPE_U64 here. Note that the exposing here corresponds to the strict policy interpretation, and NLA_UNSPEC items are omitted entirely. To get those, change them to NLA_MIN_LEN which behaves in exactly the same way, but is exposed. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit 2c28ae48f24d84fcda31fb8acaf2edca6ec46c49 Author: Johannes Berg Date: Thu Apr 30 22:13:11 2020 +0200 netlink: factor out policy range helpers Add helpers to get the policy's signed/unsigned range validation data. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit c7721c05a6217491810f406ec28df80a9bcf3546 Author: Johannes Berg Date: Thu Apr 30 22:13:10 2020 +0200 netlink: remove NLA_EXACT_LEN_WARN Use a validation type instead, so we can later expose the NLA_* values to userspace for policy descriptions. Some transformations were done with this spatch: @@ identifier p; expression X, L, A; @@ struct nla_policy p[X] = { [A] = -{ .type = NLA_EXACT_LEN_WARN, .len = L }, +NLA_POLICY_EXACT_LEN_WARN(L), ... }; Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit da4063bdfcfa70ec57a6c25f772ac6378b1584ad Author: Johannes Berg Date: Thu Apr 30 22:13:09 2020 +0200 netlink: allow NLA_MSECS to have range validation Since NLA_MSECS is really equivalent to NLA_U64, allow it to have range validation as well. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit d06a09b94c618c96ced584dd4611a888c8856b8d Author: Johannes Berg Date: Thu Apr 30 22:13:08 2020 +0200 netlink: extend policy range validation Using a pointer to a struct indicating the min/max values, extend the ability to do range validation for arbitrary values. Small values in the s16 range can be kept in the policy directly. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit d15da2a2e813679aeac8bff3be38d3adc849c1a6 Author: Johannes Berg Date: Thu Apr 30 22:13:07 2020 +0200 nl80211: link recursive netlink nested policy Now that we have limited recursive policy validation to avoid stack overflows, change nl80211 to actually link the nested policy (linking back to itself eventually), which allows some code cleanups. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit 7690aa1cdf7c4565ad6b013b324c28b685505e24 Author: Johannes Berg Date: Thu Apr 30 22:13:06 2020 +0200 netlink: limit recursion depth in policy validation Now that we have nested policies, we can theoretically recurse forever parsing attributes if a (sub-)policy refers back to a higher level one. This is a situation that has happened in nl80211, and we've avoided it there by not linking it. Add some code to netlink parsing to limit recursion depth. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit 47a1494b8208461094923400c396ce4b8163c064 Author: Johannes Berg Date: Thu Apr 30 22:13:05 2020 +0200 netlink: remove type-unsafe validation_data pointer In the netlink policy, we currently have a void *validation_data that's pointing to different things: * a u32 value for bitfield32, * the netlink policy for nested/nested array * the string for NLA_REJECT Remove the pointer and place appropriate type-safe items in the union instead. While at it, completely dissolve the pointer for the bitfield32 case and just put the value there directly. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit 4d73ce19243eaea6277310e971131a74eb3b1ef0 Merge: 64cf2ea13b1e ef2a0bd99b15 Author: David S. Miller Date: Thu Apr 30 17:43:29 2020 -0700 Merge branch 'net-dsa-b53-ARL-improvements' Florian Fainelli says: ==================== net: dsa: b53: ARL improvements This patch series improves the b53 driver ARL search code by renaming the ARL entries to be reflective of what they are: bins, and then introduce the number of buckets so we can properly bound check ARL searches. The final patch removes an unused argument. ==================== Signed-off-by: David S. Miller commit ef2a0bd99b1549a3a4253355be247d5dff25d720 Author: Florian Fainelli Date: Thu Apr 30 11:49:11 2020 -0700 net: dsa: b53: Remove is_static argument to b53_read_op() This argument is not used. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit cd169d799beeb738fa2d3e891960924cdcaf8414 Author: Florian Fainelli Date: Thu Apr 30 11:49:10 2020 -0700 net: dsa: b53: Bound check ARL searches ARL searches are done by reading two ARL entries at a time, do not cap the search at 1024 which would only limit us to half of the possible ARL capacity, but use b53_max_arl_entries() instead which does the right multiplication between bins and indexes. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit e3da4038f4ca1094596a7604c6edac4a6a4f6ee9 Author: Florian Fainelli Date: Thu Apr 30 11:49:09 2020 -0700 net: dsa: b53: Provide number of ARL buckets In preparation for doing proper upper bound checking of FDB/MDB entries being added to the ARL, provide the number of ARL buckets for each switch chip we support. All chips have 1024 buckets, except 7278 which has only 256. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 673e69a67dd63fc3b40f109d1677a5dc72185fbb Author: Florian Fainelli Date: Thu Apr 30 11:49:08 2020 -0700 net: dsa: b53: Rename num_arl_entries to num_arl_bins The variable currently holds the number of ARL bins per ARL buckets, which is different from the number of ARL entries which would be bins times buckets. We will be adding a num_arl_buckets in a subsequent patch so get variables straight now. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 64cf2ea13b1e3babaa5baab596aa97e85ac9d8d9 Merge: 34a9c361dd48 81496b72e9ba Author: David S. Miller Date: Thu Apr 30 17:39:15 2020 -0700 Merge branch 'r8169-refactor-and-improve-interrupt-coalescing' Heiner Kallweit says: ==================== r8169: refactor and improve interrupt coalescing Refactor and improve interrupt coalescing. ==================== Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 81496b72e9ba1999d4ed7bb7fa407a1edef020a4 Author: Heiner Kallweit Date: Thu Apr 30 21:59:48 2020 +0200 r8169: add check for invalid parameter combination in rtl_set_coalesce Realtek provided information about a HW constraint that time limit must not be set to 0 if the frame limit is >0. Add a check for this and reject invalid parameter combinations. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 2b3e48b66516602d7d63142cda84b554f908eb54 Author: Heiner Kallweit Date: Thu Apr 30 21:58:47 2020 +0200 r8169: improve rtl_set_coalesce Use FIELD_PREP() to make the code better readable, and avoid the loop. No functional change intended. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit bdd2be3adb7d139a598f2277af7fa625fc399af1 Author: Heiner Kallweit Date: Thu Apr 30 21:58:06 2020 +0200 r8169: improve interrupt coalescing parameter handling The chip supports only frame limits 0, 4, 8, .. 60 internally. Returning EINVAL for all val % 4 != 0 seems to be a little bit too unfriendly to the user. Therefore round up the frame limit to the next supported value. In addition round up the time limit, else a very low limit could be rounded down to 0, and interpreted as "ignore value" by the chip. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit cb9d97de05646de69b997da0137b94e00cba7f99 Author: Heiner Kallweit Date: Thu Apr 30 21:57:32 2020 +0200 r8169: improve rtl_coalesce_choose_scale The time limit provided by userspace is multiplied with 1000, what could result in an overflow. Therefore change the time limit parameter unit from ns to us, and avoid the problematic operation. If there's no matching scale because provided time limit is too big, return ERANGE instead of EINVAL to provide a hint to the user what's wrong. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 6cf96dd4272537baf4ceab452f6276da1b8d82af Author: Heiner Kallweit Date: Thu Apr 30 21:56:58 2020 +0200 r8169: improve rtl_get_coalesce Use FIELD_GET() macro to make the code better readable. In addition change the logic to round the time limit up, not down. Reason is that a time limit <1us would be rounded to 0 currently, what would be interpreted as "no time limit set". Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 2815b30535a0613ee07d477d0c628100f40b6059 Author: Heiner Kallweit Date: Thu Apr 30 21:56:20 2020 +0200 r8169: merge scale for tx and rx irq coalescing Rx and tx scale are the same always. Simplify the code by using one scale for rx and tx only. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ef2c0a78aee10113d1299eb81e642470308e32ca Author: Heiner Kallweit Date: Thu Apr 30 21:55:36 2020 +0200 r8169: don't pass net_device to irq coalescing sub-functions The net_device argument is just used to get a struct rtl8169_private pointer via netdev_priv(). Therefore pass the struct rtl8169_private pointer directly. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit c100beb9ccfb98e2474586a4006483cbf770c823 Author: Alexandru Gagniuc Date: Mon Apr 27 18:25:13 2020 -0500 PCI/AER: Use only _OSC to determine AER ownership Per the PCI Firmware spec, r3.2, sec 4.5.1, the OS can request control of AER via bit 3 of the _OSC Control Field. In the returned value of the Control Field: The firmware sets [bit 3] to 1 to grant control over PCI Express Advanced Error Reporting. ... after control is transferred to the operating system, firmware must not modify the Advanced Error Reporting Capability. If control of this feature was requested and denied or was not requested, firmware returns this bit set to 0. Previously the pci_root driver looked at the HEST FIRMWARE_FIRST bit to determine whether to request ownership of the AER Capability. This was based on ACPI spec v6.3, sec 18.3.2.4, and similar sections, which say things like: Bit [0] - FIRMWARE_FIRST: If set, indicates that system firmware will handle errors from this source first. Bit [1] - GLOBAL: If set, indicates that the settings contained in this structure apply globally to all PCI Express Devices. These ACPI references don't say anything about ownership of the AER Capability. Remove use of the FIRMWARE_FIRST bit and rely only on the _OSC bit to determine whether we have control of the AER Capability. Link: https://lore.kernel.org/r/20181115231605.24352-1-mr.nuke.me@gmail.com/ v1 Link: https://lore.kernel.org/r/20190326172343.28946-1-mr.nuke.me@gmail.com/ v2 Link: https://lore.kernel.org/r/67af2931705bed9a588b5a39d369cb70b9942190.1587925636.git.sathyanarayanan.kuppuswamy@linux.intel.com [bhelgaas: commit log, note: Alex posted this identical patch 18 months ago, and I failed to apply it then, so I made him the author, added links to his postings, and added his Signed-off-by] Signed-off-by: Alexandru Gagniuc Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Bjorn Helgaas Reviewed-by: Jon Derrick commit 21f3cfeab304fc07b90d93d98d4d2f62110fe6b2 Author: Tejun Heo Date: Mon Apr 13 12:27:58 2020 -0400 iocost_monitor: drop string wrap around numbers when outputting json Wrapping numbers in strings is used by some to work around bit-width issues in some enviroments. The problem isn't innate to json and the workaround seems to cause more integration problems than help. Let's drop the string wrapping. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe commit f4fe3ea636385a51f1dfbb27c387a04b12b919e9 Author: Tejun Heo Date: Mon Apr 13 12:27:57 2020 -0400 iocost_monitor: exit successfully if interval is zero This is to help external tools to decide whether iocost_monitor has all its requirements met or not based on the exit status of an -i0 run. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe commit cd006509b0a93cb7ee9d9fd50ae274098997a460 Author: Tejun Heo Date: Mon Apr 13 12:27:56 2020 -0400 blk-iocost: account for IO size when testing latencies On each IO completion, iocost decides whether the IO met or missed its latency target. Currently, the targets are fixed numbers per IO type. While this can be good enough for loose latency targets way higher than typical completion latencies, the effect of IO size makes it difficult to tighten the latency target - a target adequate for 4k IOs might be too tight for 512k IOs and vice-versa. iocost already has all the necessary information to account for different IO sizes when testing whether the latency target is met as iocost can calculate the size vtime cost of a given IO. This patch updates the completion path to calculate the size vtime cost of the IO, deduct the nsec equivalent from the observed latency and use the adjusted value to decide whether the target is met. This makes latency targets independent from IO size and enables determining adequate latency targets with fixed size fio runs. Signed-off-by: Tejun Heo Cc: Andy Newell Signed-off-by: Jens Axboe commit 54c52e10dc9b939084a7e6e3d32ce8fd8dee7898 Author: Tejun Heo Date: Mon Apr 13 12:27:55 2020 -0400 blk-iocost: switch to fixed non-auto-decaying use_delay The use_delay mechanism was introduced by blk-iolatency to hold memory allocators accountable for the reclaim and other shared IOs they cause. The duration of the delay is dynamically balanced between iolatency increasing the value on each target miss and it auto-decaying as time passes and threads get delayed on it. While this works well for iolatency, iocost's control model isn't compatible with it. There is no repeated "violation" events which can be balanced against auto-decaying. iocost instead knows how much a given cgroup is over budget and wants to prevent that cgroup from issuing IOs while over budget. Until now, iocost has been adding the cost of force-issued IOs. However, this doesn't reflect the amount which is already over budget and is simply not enough to counter the auto-decaying allowing anon-memory leaking low priority cgroup to go over its alloted share of IOs. As auto-decaying doesn't make much sense for iocost, this patch introduces a different mode of operation for use_delay - when blkcg_set_delay() are used insted of blkcg_add/use_delay(), the delay duration is not auto-decayed until it is explicitly cleared with blkcg_clear_delay(). iocost is updated to keep the delay duration synchronized to the budget overage amount. With this change, iocost can effectively police cgroups which generate significant amount of force-issued IOs. Signed-off-by: Tejun Heo Cc: Josef Bacik Signed-off-by: Jens Axboe commit 0eacc574aae7300bf46c10c7116c3ba5825505b7 Author: Aharon Landau Date: Mon Apr 27 18:46:36 2020 +0300 RDMA/mlx5: Verify that QP is created with RQ or SQ RAW packet QP and underlay QP must be created with either RQ or SQ, check that. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Link: https://lore.kernel.org/r/20200427154636.381474-37-leon@kernel.org Signed-off-by: Aharon Landau Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 968f0b6f9c01bdf772a4c04ee1fe08971d65af14 Author: Leon Romanovsky Date: Mon Apr 27 18:46:35 2020 +0300 RDMA/mlx5: Consolidate into special function all create QP calls Finish separation to blocks of mlx5_ib_create_qp() functions, so all internal create QP implementation are located in one place. Link: https://lore.kernel.org/r/20200427154636.381474-36-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6367da46d3cb03ff717457875bd01dda7b02a1ff Author: Leon Romanovsky Date: Mon Apr 27 18:46:34 2020 +0300 RDMA/mlx5: Remove redundant destroy QP call After major refactoring in create QP flow, it is no needed to call to destroy QP in XRC_TGT flow. Link: https://lore.kernel.org/r/20200427154636.381474-35-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 08d53976609aec17f28872423d3a3e86ad1a3ec4 Author: Leon Romanovsky Date: Mon Apr 27 18:46:33 2020 +0300 RDMA/mlx5: Copy response to the user in one place Update all the places in create QP flows to copy response to the user in one place. Link: https://lore.kernel.org/r/20200427154636.381474-34-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6f2cf76e6ec7885de116cfc9c08057f2f7873629 Author: Leon Romanovsky Date: Mon Apr 27 18:46:32 2020 +0300 RDMA/mlx5: Handle udate outlen checks in one place Place in one function all udata size checks. This will allow us move ib_copy_to_udata() in general place and ensure that it will be performed after call to the FW. Link: https://lore.kernel.org/r/20200427154636.381474-33-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5d6fffed1cfd0c368a9089acb9fcc902c649c31c Author: Leon Romanovsky Date: Mon Apr 27 18:46:31 2020 +0300 RDMA/mlx5: Promote RSS RAW QP flags check to higher level Move check that user didn't supplied RSS RAW QP unsupported command flags to the function that checks all such flags. Link: https://lore.kernel.org/r/20200427154636.381474-32-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f78d358cec9088ed77b5129c44f858cdfdb1e8c9 Author: Leon Romanovsky Date: Mon Apr 27 18:46:30 2020 +0300 RDMA/mlx5: Group all create QP parameters to simplify in-kernel interfaces The amount of parameters passed in and out between internal mlx5 create QP functions is too large to easily follow the flow. Change it by grouping all create QP parameter into one structure. Link: https://lore.kernel.org/r/20200427154636.381474-31-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 747c519cdbe4a3f6a616d50c19bcb97413abe384 Author: Leon Romanovsky Date: Mon Apr 27 18:46:29 2020 +0300 RDMA/mlx5: Reduce amount of duplication in QP destroy Delete both PD argument and checks if udata was provided, in favour of unified destroy QP functions. Link: https://lore.kernel.org/r/20200427154636.381474-30-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 98fc1126c4161450f215254409e5539314b54a04 Author: Leon Romanovsky Date: Mon Apr 27 18:46:28 2020 +0300 RDMA/mlx5: Separate to user/kernel create QP flows The kernel and user create QP flows have very little common code, separate them to simplify the future work of creating per-type create_*_qp() functions. Link: https://lore.kernel.org/r/20200427154636.381474-29-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 04bcc1c2d0d7bfa0bffa5853d9a127fb4f4cd943 Author: Leon Romanovsky Date: Mon Apr 27 18:46:27 2020 +0300 RDMA/mlx5: Separate XRC_TGT QP creation from common flow XRC_TGT QP doesn't fail into kernel or user flow separation. It is initiated by the user, but is created through in-kernel verbs flow and doesn't have PD and udata in similar way to kernel QPs. So let's separate creation of that QP type from the common flow. Link: https://lore.kernel.org/r/20200427154636.381474-28-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 21aad80b17e6d17adf99bf17482a5314bcb0aebb Author: Leon Romanovsky Date: Mon Apr 27 18:46:26 2020 +0300 RDMA/mlx5: Globally parse DEVX UID Remove duplication in parsing of DEVX UID. Link: https://lore.kernel.org/r/20200427154636.381474-27-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0ce300b15aad7d3940d0625badcfad353041f5a7 Author: Leon Romanovsky Date: Mon Apr 27 18:46:25 2020 +0300 RDMA/mlx5: Delete impossible inlen check The inlen is set to be above zero in all flows before and can't be negative at this stage. Link: https://lore.kernel.org/r/20200427154636.381474-26-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 03c4077b284056fdb144f84aaa0ac0c80023f597 Author: Leon Romanovsky Date: Mon Apr 27 18:46:24 2020 +0300 RDMA/mlx5: Rely on existence of udata to separate kernel/user flows Instead of keeping special field to separate kernel/user create/destroy flows, rely on existence of udata pointer. All allocation flows are using kzalloc() and leave uninitialized pointers as NULL which makes MLX5_QP_EMPTY and MLX5_QP_KERNEL flows to be the same. Link: https://lore.kernel.org/r/20200427154636.381474-25-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 76883a6cc1459b2aa1e96e1eaa19aa37221c2406 Author: Leon Romanovsky Date: Mon Apr 27 18:46:23 2020 +0300 RDMA/mlx5: Remove second user copy in create_user_qp Combine copy_from_user() from create_user_qp() and general code. Link: https://lore.kernel.org/r/20200427154636.381474-24-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5ce0592b0ee56e41f1a4a164ac2f54dbfbbf5e49 Author: Leon Romanovsky Date: Mon Apr 27 18:46:22 2020 +0300 RDMA/mlx5: Combine copy of create QP command in RSS RAW QP Change the create QP flow to handle all copy_from_user() operations in one place. Link: https://lore.kernel.org/r/20200427154636.381474-23-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 266424eba6c90ab8b12cf73aae00f1b08c0619cf Author: Leon Romanovsky Date: Mon Apr 27 18:46:21 2020 +0300 RDMA/mlx5: Promote RSS RAW QP attribute check in higher level Perform check of attributes of RAW PACKET QP in separate function. Link: https://lore.kernel.org/r/20200427154636.381474-22-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7aede1a25f4b84318e8a266d7b830a5ed554e370 Author: Leon Romanovsky Date: Mon Apr 27 18:46:20 2020 +0300 RDMA/mlx5: Store QP type in the vendor QP structure QP type is stored in the IB/core QP struct, but it doesn't have all the needed information, like internal QP type used in the driver itself. Update mlx5_ib to have cached QP type which includes both IBTA and Mellanox specific one. Such change allows us to make even further cleanup of QP creation flow. Link: https://lore.kernel.org/r/20200427154636.381474-21-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 3ae7e66a019e18896c46fcbb7ae28bfc343331c4 Author: Leon Romanovsky Date: Mon Apr 27 18:46:19 2020 +0300 RDMA/mlx5: Delete unsupported QP types There is no need to explicitly check unsupported QP types, rely on "default" keyword in switch-case to catch them. Link: https://lore.kernel.org/r/20200427154636.381474-20-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0edb259c98fcffef6916503282eb6e3133878b9a Author: Daniel Golle Date: Mon Mar 30 23:09:59 2020 +0100 power: reset: introduce oxnas-restart Add reboot handler for Oxford OX820 chips as reboot currenly hangs on those boards. Code is based on ox820_assert_system_reset() found in https://github.com/kref/linux-oxnas.git in arch/arm/mach-oxnas/mach-ox820.c line 181. Signed-off-by: Daniel Golle Acked-by: Neil Armstrong Signed-off-by: Sebastian Reichel commit 88562f06ebf56587788783e5420f25fde3ca36c8 Author: Shaokun Zhang Date: Thu Apr 23 20:05:30 2020 +0800 drivers/perf: hisi: Fix typo in events attribute array Fix up one typo: wr_dr_64b -> wr_ddr_64b. Fixes: 2bab3cf9104c ("perf: hisi: Add support for HiSilicon SoC HHA PMU driver") Signed-off-by: Shaokun Zhang Cc: Will Deacon Cc: Mark Rutland Link: https://lore.kernel.org/r/1587643530-34357-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Will Deacon commit 1f0d97bb7082ead69acc899cd5dae9deb8b91577 Author: Tang Bin Date: Thu Apr 2 20:03:30 2020 +0800 drivers/perf: arm_spe_pmu: Avoid duplicate printouts platform_get_irq() already screams on failure, so the redundant call to dev_err() can be removed. Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200402120330.19468-1-tangbin@cmss.chinamobile.com Signed-off-by: Will Deacon commit 6de1601e84e40888296973c61b1516dc4d5977e3 Author: Zou Wei Date: Thu Apr 30 11:56:02 2020 +0800 drm/amd/display: Fix unsigned comparison to zero Fixes coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c:1398:60-61: WARNING: Unsigned expression compared with zero: j >= 0 Fixes: 238387774232 ("drm/amd/display: fix rn soc bb update") Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Alex Deucher commit 3fac052825183fb5ecc7a3d2024564eddab05ac1 Author: Zheng Bin Date: Thu Apr 30 11:40:34 2020 +0800 drm/amd/display: remove set but not used variable 'speakers' in dcn10_stream_encoder.c Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c:1277:11: warning: variable ‘speakers’ set but not used [-Wunused-but-set-variable] It is introduced by commit 0c41891c81c0 ("drm/amd/display: Refactor stream encoder for HW review"), but never used, so remove it. Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit 83700e20b8707cb90bb64f87e24c3359aa5641da Author: Zheng Bin Date: Thu Apr 30 11:40:33 2020 +0800 drm/amd/display: remove set but not used variable 'speakers' in dce_stream_encoder.c Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c:1339:11: warning: variable ‘speakers’ set but not used [-Wunused-but-set-variable] It is introduced by commit 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)"), but never used, so remove it. Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit 509c58189c8d695ef9cd12093a22ddbd6cdb8d71 Author: Zheng Bin Date: Thu Apr 30 11:40:32 2020 +0800 drm/amd/display: remove set but not used variable 'pixel_width' Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c:137:11: warning: variable ‘pixel_width’ set but not used [-Wunused-but-set-variable] It is introduced by commit 70ccab604049 ("drm/amdgpu/display: Add core dc support for DCN"), but never used, so remove it. Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit 99eba49b00ca8416b2a6170a8a440744edad2703 Author: Zheng Bin Date: Thu Apr 30 11:40:31 2020 +0800 drm/amd/display: remove set but not used variable 'dc' Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:8665:13: warning: variable ‘dc’ set but not used [-Wunused-but-set-variable] It is not used since commit d1ebfdd8d0fc ("drm/amd/display: Unify psr feature flags") Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit a09a67d911cad034939c9f2376b88e16567ba6c4 Author: Zheng Bin Date: Thu Apr 30 10:26:53 2020 +0800 drm/amdgpu: remove set but not used variable 'direct_poll' in vcn_v2_5.c Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:1170:39: warning: variable ‘direct_poll’ set but not used [-Wunused-but-set-variable] It is introduced by commit 7daaebfea5e5 ("drm/amdgpu: add VCN2.5 sriov start for Arctrus"), but never used, so remove it. Reviewed-by: Christian König Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit b35833479e53859cbe6b441cf1dcf9b1c49ee323 Author: Zheng Bin Date: Thu Apr 30 10:26:52 2020 +0800 drm/amdgpu: remove set but not used variable 'direct_poll' in vcn_v2_0.c Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1848:39: warning: variable ‘direct_poll’ set but not used [-Wunused-but-set-variable] It is introduced by commit dd26858a9cd8 ("drm/amdgpu: implement initialization part on VCN2.0 for SRIOV"), but never used, so remove it. Reviewed-by: Christian König Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit 2cba3944ec3710aab90fc84aec5a27a7ad47fc0a Author: Zheng Bin Date: Thu Apr 30 10:26:51 2020 +0800 drm/amdgpu: remove set but not used variable 'priority' Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1211:26: warning: variable ‘priority’ set but not used It is not used since commit 33abcb1f5a17 ("drm/amdgpu: set compute queue priority at mqd_init") Reviewed-by: Christian König Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher commit 8b91fd8bb1920a73b2c3a990a12d886fc62e1eef Author: Daniel Kolesa Date: Wed Apr 29 17:02:36 2020 +0200 drm/amd/display: work around fp code being emitted outside of DC_FP_START/END The dcn20_validate_bandwidth function would have code touching the incorrect registers emitted outside of the boundaries of the DC_FP_START/END macros, at least on ppc64le. Work around the problem by wrapping the whole function instead. Signed-off-by: Daniel Kolesa Signed-off-by: Alex Deucher commit ff6772b0fbdd160250c28c52962ed8fd51573fa9 Author: Michel Dänzer Date: Wed Apr 29 18:28:01 2020 +0200 drm/amdgpu/dc: Use WARN_ON_ONCE for ASSERT Once should generally be enough for diagnosing what lead up to it, repeating it over and over can be pretty annoying. Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 981d4f7d2c0dc5bc7d42e7f4afee1e6ded5a9cb3 Author: Bernard Zhao Date: Sun Apr 26 06:12:44 2020 -0700 drm/radeon: cleanup coding style a bit Maybe no need to check ws before kmalloc, kmalloc will check itself, kmalloc`s logic is if ptr is NULL, kmalloc will just return Reviewed-by: Christian König Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 439657970c1d2ee313a9deee296230e7d6cbd3b0 Author: John Clements Date: Thu Apr 30 17:12:26 2020 +0800 drm/amdgpu: update RAS sequence to parse TA flags RAS TA shall notify driver with flags of error specifics Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit a0d254820f4305acd01f10eca7efab8c36e33852 Author: John Clements Date: Thu Apr 30 17:11:59 2020 +0800 drm/amdgpu: update RAS TA to Host interface Update interface to match latest TA Organized input/output structures to better maintain backward compatiblity in the future Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit a200034b664820da243ff4cd9595b8b5116332af Author: John Clements Date: Thu Apr 30 17:11:46 2020 +0800 drm/amdgpu: update RAS error handling Parse return status from TA to determine error severity Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 5810f00ade49f4710a9e834db5a3ad786a76e880 Author: Tang Bin Date: Thu Apr 2 19:59:40 2020 +0800 drivers/perf: arm_dsu_pmu: Avoid duplicate printouts platform_get_irq() already screams on failure, so the redundant call to dev_err() can be removed. Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200402115940.4928-1-tangbin@cmss.chinamobile.com Signed-off-by: Will Deacon commit 3f12acc8d6d4b2e62fab8f652d7075a859d80b42 Author: Evan Quan Date: Tue Apr 21 10:47:35 2020 +0800 drm/amdgpu: put the audio codec into suspend state before gpu reset V3 At default, the autosuspend delay of audio controller is 3S. If the gpu reset is triggered within 3S(after audio controller idle), the audio controller may be unable into suspended state. Then the sudden gpu reset will cause some audio errors. The change here is targeted to resolve this. However if the audio controller is in use when the gpu reset triggered, this change may be still not enough to put the audio controller into suspend state. Under this case, the gpu reset will still proceed but there will be a warning message printed("failed to suspend display audio"). V2: limit this for BACO and mode1 reset only V3: try 1st to use pm_runtime_autosuspend_expiration() to query how much time is left. Use default setting on failure Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 50654d7bca87d4694a25307bd4796d41c3438a76 Author: Jason Yan Date: Tue Apr 28 14:30:03 2020 +0800 drm/amdgpu/smu10: remove duplicate assignment of smu10_hwmgr_funcs members The struct member 'asic_setup' was assigned twice, let's remove one: static const struct pp_hwmgr_func smu10_hwmgr_funcs = { ...... .asic_setup = NULL, ...... .asic_setup = smu10_setup_asic_task, ...... }; This fixes the following coccicheck warning: drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c:1357:52-53: asic_setup: first occurrence line 1360, second occurrence line 1388 Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit ddea4ed01058e8b59743b98b281801666d450228 Author: Jason Yan Date: Tue Apr 28 14:31:01 2020 +0800 drm/amd/display: remove duplicate assignment of dcn21_funcs members Fix the following coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c:31:51-52: exit_optimized_pwr_state: first occurrence line 86, second occurrence line 92 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c:31:51-52: optimize_pwr_state: first occurrence line 85, second occurrence line 91 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c:31:51-52: set_cursor_attribute: first occurrence line 71, second occurrence line 89 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c:31:51-52: set_cursor_position: first occurrence line 70, second occurrence line 88 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c:31:51-52: set_cursor_sdr_white_level: first occurrence line 72, second occurrence line 90 Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit d4566dee849e4bb3c10577919c00041edd109fc4 Author: Mukul Joshi Date: Tue Apr 28 20:59:55 2020 -0400 drm/amdkfd: Track GPU memory utilization per process Track GPU VRAM usage on a per process basis and report it through sysfs. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 51075e0cb759a736e60ab4f3a5fed8670dba5852 Author: Łukasz Stelmach Date: Thu Apr 30 18:31:41 2020 +0200 arm64: kexec_file: print appropriate variable The value of kbuf->memsz may be different than kbuf->bufsz after calling kexec_add_buffer(). Hence both values should be logged. Fixes: 52b2a8af74360 ("arm64: kexec_file: load initrd and device-tree") Fixes: 3751e728cef29 ("arm64: kexec_file: add crash dump support") Signed-off-by: Łukasz Stelmach Cc: AKASHI Takahiro Cc: James Morse Cc: Bhupesh Sharma Link: https://lore.kernel.org/r/20200430163142.27282-2-l.stelmach@samsung.com Signed-off-by: Will Deacon commit 34a9c361dd480041d790fff3d6ea58513c8769e8 Author: Taehee Yoo Date: Thu Apr 30 17:37:02 2020 +0000 hsr: remove hsr interface if all slaves are removed When all hsr slave interfaces are removed, hsr interface doesn't work. At that moment, it's fine to remove an unused hsr interface automatically for saving resources. That's a common behavior of virtual interfaces. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 1b2e788490deef5e570ebe604b5cc50f82877c11 Merge: 3857c776240f a70437cc09a1 Author: David S. Miller Date: Thu Apr 30 13:24:01 2020 -0700 Merge branch 'tcp-sack-compression-changes' Eric Dumazet says: ==================== tcp: sack compression changes Patch series refines SACK compression. We had issues with missing SACK when TCP option space is tight. Uses hrtimer slack to improve performance. ==================== Signed-off-by: David S. Miller commit a70437cc09a11771870e9f6bfc0ba1237161daa8 Author: Eric Dumazet Date: Thu Apr 30 10:35:43 2020 -0700 tcp: add hrtimer slack to sack compression Add a sysctl to control hrtimer slack, default of 100 usec. This gives the opportunity to reduce system overhead, and help very short RTT flows. Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit ccd0628fca440268711560a1dbacc727b4f9e214 Author: Eric Dumazet Date: Thu Apr 30 10:35:42 2020 -0700 tcp: tcp_sack_new_ofo_skb() should be more conservative Currently, tcp_sack_new_ofo_skb() sends an ack if prior acks were 'compressed', if room has to be made in tp->selective_acks[] But there is no guarantee all four sack ranges can be included in SACK option. As a matter of fact, when TCP timestamps option is used, only three SACK ranges can be included. Lets assume only two ranges can be included, and force the ack: - When we touch more than 2 ranges in the reordering done if tcp_sack_extend() could be done. - If we have at least 2 ranges when adding a new one. This enforces that before a range is in third or fourth position, at least one ACK packet included it in first/second position. Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 2b195850128f5bafde177b12489d9fa27962cc1e Author: Eric Dumazet Date: Thu Apr 30 10:35:41 2020 -0700 tcp: add tp->dup_ack_counter In commit 86de5921a3d5 ("tcp: defer SACK compression after DupThresh") I added a TCP_FASTRETRANS_THRESH bias to tp->compressed_ack in order to enable sack compression only after 3 dupacks. Since we plan to relax this rule for flows that involve stacks not requiring this old rule, this patch adds a distinct tp->dup_ack_counter. This means the TCP_FASTRETRANS_THRESH value is now used in a single location that a future patch can adjust: if (tp->dup_ack_counter < TCP_FASTRETRANS_THRESH) { tp->dup_ack_counter++; goto send_now; } This patch also introduces tcp_sack_compress_send_ack() helper to ease following patch comprehension. This patch refines LINUX_MIB_TCPACKCOMPRESSED to not count the acks that we had to send if the timer expires or tcp_sack_compress_send_ack() is sending an ack. Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 3857c776240f0edef8639d7833626ab2ee7c7723 Merge: b8afaeddea79 ec9cdca0663a Author: David S. Miller Date: Thu Apr 30 13:15:16 2020 -0700 Merge tag 'mlx5-updates-2020-04-30' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2020-04-30 1) Add release all pages support, From Eran. to release all FW pages at once on driver unload, when supported by FW. 2) From Maxim and Tariq, Trivial Data path cleanup and code improvements in preparation for their next features, TLS offload and TX performance improvements 3) Multiple cleanups. ==================== Signed-off-by: David S. Miller commit 037d9303a7e7bac622e299817c5dd288346db07c Author: Guixiong Wei Date: Fri May 1 06:18:58 2020 +1400 arm: mm: use __pfn_to_section() to get mem_section Replace the open-coded '__nr_to_section(pfn_to_section_nr(pfn))' in pfn_valid() with a more concise call to '__pfn_to_section(pfn)'. No functional change. Signed-off-by: Guixiong Wei Link: https://lore.kernel.org/r/20200430161858.11379-1-guixiongwei@gmail.com Signed-off-by: Will Deacon commit b8afaeddea797975417d3a22bf9e6ff59beb776d Merge: 07f81727c1a0 ca0892235ae6 Author: David S. Miller Date: Thu Apr 30 13:02:32 2020 -0700 Merge branch 'mlxsw-Prepare-SPAN-API-for-upcoming-changes' Ido Schimmel says: ==================== mlxsw: Prepare SPAN API for upcoming changes Switched port analyzer (SPAN) is used for packet mirroring. Over mlxsw this is achieved by attaching tc-mirred action to either matchall or flower classifier. The current API used to configure SPAN consists of two functions: mlxsw_sp_span_mirror_add() and mlxsw_sp_span_mirror_del(). These two functions pack a lot of different operations: * SPAN agent configuration: Determining the egress port and optional headers that need to encapsulate the mirrored packet (when mirroring to a gretap, for example) * Egress mirror buffer configuration: Allocating / freeing a buffer when port is analyzed (inspected) at egress * SPAN agent binding: Binding the SPAN agent to a trigger, if any. The current triggers are incoming / outgoing packet and they are only used for matchall-based mirroring This non-modular design makes it difficult to extend the API for future changes, such as new mirror targets (CPU) and new global triggers (early dropped packets, for example). Therefore, this patch set gradually adds APIs for above mentioned operations and then converts the two existing users to use it instead of the old API. No functional changes intended. Tested with existing mirroring selftests. Patch set overview: Patches #1-#5 gradually add the new API Patches #6-#8 convert existing users to use the new API Patch #9 removes the old API ==================== Signed-off-by: David S. Miller commit ca0892235ae68b097f42cd39e03b17cfead7c7c7 Author: Ido Schimmel Date: Thu Apr 30 20:01:16 2020 +0300 mlxsw: spectrum_span: Remove old SPAN API Remove the old SPAN API now that matchall-based and flower-based mirroring were converted to use the new API. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 835d6b8c1a35eafba3faaf4b809f6d84517467f1 Author: Ido Schimmel Date: Thu Apr 30 20:01:15 2020 +0300 mlxsw: spectrum_span: Use new analyzed ports list during speed / MTU change As previously explained, each port whose outgoing traffic is analyzed needs to have an egress mirror buffer. The size of the egress mirror buffer is calculated based on various parameters, two of which are the speed and the MTU of the port. Therefore, when the MTU or the speed of a port change, the SPAN code is called to see if the egress mirror buffer of the port needs to be adjusted. Currently, this is done by traversing all the SPAN agents and for each SPAN agent the list of bound ports is traversed. Instead of the above, traverse the recently added list of analyzed ports. This will later allow us to remove the old SPAN API. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 7240db69c332f6625da044b048d06839ab0c2649 Author: Ido Schimmel Date: Thu Apr 30 20:01:14 2020 +0300 mlxsw: spectrum_acl: Convert flower-based mirroring to new SPAN API In flower-based mirroring, mirroring is done with ACLs and the SPAN agent is not bound to a port. Instead its identifier is specified in an ACL action. Convert this type of mirroring to use the new API. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit c1d7845dfbd3dfeed2cd7bf92ec10ea97ef5d7fd Author: Ido Schimmel Date: Thu Apr 30 20:01:13 2020 +0300 mlxsw: spectrum: Convert matchall-based mirroring to new SPAN API In matchall-based mirroring, mirroring is not done with ACLs, but a SPAN agent is bound to the ingress / egress of a port and all incoming / outgoing traffic is mirrored. Convert this type of mirroring to use the new API. First the SPAN agent is resolved, then the port is marked as analyzed and its egress mirror buffer is potentially allocated. Lastly, the binding is performed. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit c056618c53a771bacf4e077e8be01de4405439ae Author: Ido Schimmel Date: Thu Apr 30 20:01:12 2020 +0300 mlxsw: spectrum_span: Add APIs to bind / unbind a SPAN agent Currently, a SPAN agent can only be bound to a per-port trigger where the trigger is either an incoming packet (INGRESS) or an outgoing packet (EGRESS) to / from the port. A follow-up patch set will introduce the concept of global triggers and per-{port, TC} enablement. With global triggers, the trigger entry is only keyed by a trigger and not by a port and a trigger. The trigger can be, for example, a packet that was early dropped. While the binding between the SPAN agent and the trigger is performed only once, the trigger entry needs to be reference counted, as the trigger can be enabled on multiple ports. Add APIs to bind / unbind a SPAN agent to a trigger and reference count the trigger entry in preparation for global triggers. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 14366da6b59203ef5fc3cf21660113b60c2f1421 Author: Ido Schimmel Date: Thu Apr 30 20:01:11 2020 +0300 mlxsw: spectrum_span: Wrap buffer change in a function The code that adjusts the egress buffer size is not symmetric at the moment. The update is done via a call to mlxsw_sp_span_port_buffer_update(), but the disablement is done inline by invoking the write to SBIB register directly. Wrap the disablement code in mlxsw_sp_span_port_buffer_disable(). Signed-off-by: Ido Schimmel Suggested-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit eb773c3a2d98e1e1cb9076419f14ebb0a2f40951 Author: Ido Schimmel Date: Thu Apr 30 20:01:10 2020 +0300 mlxsw: spectrum_span: Rename function Next patch will introduce mlxsw_sp_span_port_buffer_disable() function that disables the egress buffer on an analyzed port. Rename the opposite function that updates the buffer on an analyzed port accordingly. Signed-off-by: Ido Schimmel Suggested-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit ed04458d4a900005d96b991fc0eb938875091047 Author: Ido Schimmel Date: Thu Apr 30 20:01:09 2020 +0300 mlxsw: spectrum_span: Add APIs to get / put an analyzed port An analyzed port is a port whose incoming / outgoing traffic is mirrored to a SPAN agent and analyzed on a remote server. A port can be analyzed by multiple tc filters and therefore the corresponding analyzed port entry needs to be reference counted. This is significant because ports whose outgoing traffic is analyzed need to have an egress mirror buffer. Add APIs to get / put an analyzed port. Allocate an egress mirror buffer on a port when it is first inspected at egress and free the buffer when it is no longer inspected at egress. Protect the list of analyzed ports with a mutex, as a later patch will traverse it from a context in which RTNL lock is not held. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 466010342e89240c45746f65767c7290b96a4b36 Author: Ido Schimmel Date: Thu Apr 30 20:01:08 2020 +0300 mlxsw: spectrum_span: Add APIs to get / put a SPAN agent Given a netdev that packets should be mirrored to, create a SPAN agent and return its identifier to the caller. The SPAN agent is reference counted, as multiple tc-mirred actions can point to the same destination netdev. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 07f81727c1a0b8f2acdabc060727eff60bffc048 Merge: 9f04960660bf 4ac0b122ee63 Author: David S. Miller Date: Thu Apr 30 12:56:39 2020 -0700 Merge branch 'net-ReST-part-two' Mauro Carvalho Chehab says: ==================== net: manually convert files to ReST format - part 2 That's the second part of my work to convert the networking text files into ReST. it is based on today's linux-next (next-20200430). The full series (including those ones) are at: https://git.linuxtv.org/mchehab/experimental.git/log/?h=net-docs I should be sending the remaining patches (another /38 series) after getting those merged at -next. The documents, converted to HTML via the building system are at: https://www.infradead.org/~mchehab/kernel_docs/networking/ ==================== Signed-off-by: David S. Miller commit 4ac0b122ee63d89b5aaf2e3e376092d8ac02a567 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:32 2020 +0200 docs: networking: convert tproxy.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 06bfa47e72c83550fefc93c62a1ace5fff72e212 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:31 2020 +0200 docs: networking: convert timestamping.txt to ReST - add SPDX header; - add a document title; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit aa8a6ee3e3fc4001e952de37660fe71826da8189 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:30 2020 +0200 docs: networking: convert team.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit ff159f4f1152b7012d378c69ffd253ed53227865 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:29 2020 +0200 docs: networking: convert tcp-thin.txt to ReST Not much to be done here: - add SPDX header; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit d2461edde7d15121a2cd39d48cd39edbd3fa019a Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:28 2020 +0200 docs: networking: convert tc-actions-env-rules.txt to ReST - add SPDX header; - add a document title; - use the right numbered list markup; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 32c0f0bed5bb08625083ed7f5b661c842d63ebd1 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:27 2020 +0200 docs: networking: convert switchdev.txt to ReST - add SPDX header; - use copyright symbol; - adjust title markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 060d9d3e1282e3ccf4bbb3cc4ea94bed3ce69310 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:26 2020 +0200 docs: networking: convert strparser.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit fe3dfe418cbbd1ee168d9294725d482029097694 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:25 2020 +0200 docs: networking: convert skfp.txt to ReST - add SPDX header; - use copyright symbol; - add a document title; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit d6c48bc6f8da38590946d23a27138d5258aca261 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:24 2020 +0200 docs: networking: convert seg6-sysctl.txt to ReST - add SPDX header; - mark code blocks and literals as such; - add a document title; - adjust chapters, adding proper markups; - mark lists as such; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit de1fd4a7b0f2351b775b673f092430dff64b221e Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:23 2020 +0200 docs: networking: convert secid.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 671d114d8cde3ba4390714b850c86d8b39d31009 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:22 2020 +0200 docs: networking: convert sctp.txt to ReST - add SPDX header; - add a document title; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 9f72374cb5959556870be8078b128158edde5d3e Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:21 2020 +0200 docs: networking: convert rxrpc.txt to ReST - add SPDX header; - adjust title markup; - use autonumbered list markups; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 98661e0c579dbda0e0910185f752fddd95e2d29c Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:20 2020 +0200 docs: networking: convert regulatory.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit bad5b6e223e8409c860c0574d5239ee4348f06b3 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:19 2020 +0200 docs: networking: convert rds.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 8c6e172002987202c17756e06e84c7e4d8916c44 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:18 2020 +0200 docs: networking: convert ray_cs.txt to ReST - add SPDX header; - use copyright symbol; - add a document title; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 66d495d0a5aecd1692f6b5e3190de14f9a31e14b Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:17 2020 +0200 docs: networking: convert radiotap-headers.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 832619012c972dc1ca0723ad66ffff6e6e4cf5e0 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:16 2020 +0200 docs: networking: convert proc_net_tcp.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 71120802ebeda1e645baf673b958978c4000a695 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:15 2020 +0200 docs: networking: convert ppp_generic.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 32c01266c0aab060550f592b3fe59405be8ab022 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:14 2020 +0200 docs: networking: convert PLIP.txt to ReST - add SPDX header; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c1e4535f24bcfeef55a7ed409a5f50548e284426 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:13 2020 +0200 docs: networking: convert pktgen.txt to ReST - add SPDX header; - adjust title markup; - use bold markups on a few places; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 6e94eaaa400d66f13e25e071926047ef2e3d21e3 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:12 2020 +0200 docs: networking: convert phonet.txt to ReST - add SPDX header; - adjust title markup; - use copyright symbol; - add notes markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: Rémi Denis-Courmont Signed-off-by: David S. Miller commit 4ba7bc9f2de6b230da2e38e6317de4b5ed91f46b Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:11 2020 +0200 docs: networking: convert packet_mmap.txt to ReST This patch has a big diff, but most are due to whitespaces. Yet, the conversion is similar to other files under networking: - add SPDX header; - add a document title; - adjust titles and chapters, adding proper markups; - mark lists as such; - mark tables as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit f5c39ef3299f4efaab4d1bb410406de5909c1687 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:10 2020 +0200 docs: networking: convert operstates.txt to ReST - add SPDX header; - add a document title; - adjust chapters, adding proper markups; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 63893472d753e97204331e568a5e70290054cb38 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:09 2020 +0200 docs: networking: convert openvswitch.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit aa3764276a4bc1a927ab8feaad5a255234763d9d Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:08 2020 +0200 docs: networking: convert nf_flowtable.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - add notes markups; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 13df433f8c1333cd0f60e5e1878380a37576118a Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:07 2020 +0200 docs: networking: convert nf_conntrack-sysctl.txt to ReST - add SPDX header; - add a document title; - mark lists as such; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit c4d5dff60f0a142937b52626653314f3d0a18420 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:06 2020 +0200 docs: networking: convert netif-msg.txt to ReST - add SPDX header; - adjust title and chapter markups; - mark lists as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 0191533087a3cfbe02a0bde9939fa978cb9761fd Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:05 2020 +0200 docs: networking: convert netfilter-sysctl.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - add a chapter markup; - mark tables as such; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 482a4360c56a1ecb5ea54c00db647b0012d787cf Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:04 2020 +0200 docs: networking: convert netdevices.txt to ReST - add SPDX header; - adjust title markup; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit ea5bacaa2cec6967ed337f4d0ad6034123ca737b Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:03 2020 +0200 docs: networking: convert netdev-features.txt to ReST Not much to be done here: - add SPDX header; - adjust titles and chapters, adding proper markups; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit d9d6ef25ecab3e10966981bc58d014576da74272 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:02 2020 +0200 docs: networking: convert netconsole.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - add notes markups; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit e98aa68223e48164c559803d25484533dfd495ba Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:01 2020 +0200 docs: networking: convert multiqueue.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - use :field: markup; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit e14fd64dcda5668c5dd5e59421fc5c61ce6d5951 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:04:00 2020 +0200 docs: networking: convert mpls-sysctl.txt to ReST - add SPDX header; - add a document title; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 429ff87bcac75b929d9ffec8d4d24be2616f8052 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:03:59 2020 +0200 docs: networking: convert mac80211-injection.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit a6b93e6555a6ecd0d08b0383ea4d93d09a168187 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:03:58 2020 +0200 docs: networking: convert ltpc.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 40e79150c1686263e6a031d7702aec63aff31332 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:03:57 2020 +0200 docs: networking: convert lapb-module.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 10ebb22137acd97083cb52d8664cdff269e8a629 Author: Mauro Carvalho Chehab Date: Thu Apr 30 18:03:56 2020 +0200 docs: networking: convert l2tp.txt to ReST - add SPDX header; - add a document title; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 9f04960660bf5468caaf9da2752f6f35020e4679 Merge: 8a769c65bb7a b1f3e43dbfac Author: David S. Miller Date: Thu Apr 30 12:54:02 2020 -0700 Merge branch 'inet_diag-add-cgroup-attribute-and-filter' Dmitry Yakunin says: ==================== inet_diag: add cgroup attribute and filter This patch series extends inet diag with cgroup v2 ID attribute and filter. Which allows investigate sockets on per cgroup basis. Patch for ss is already sent to iproute2-next mailing list. ==================== Signed-off-by: David S. Miller commit b1f3e43dbfacfcd95296b0f80f84b186add9ef54 Author: Dmitry Yakunin Date: Thu Apr 30 18:51:15 2020 +0300 inet_diag: add support for cgroup filter This patch adds ability to filter sockets based on cgroup v2 ID. Such filter is helpful in ss utility for filtering sockets by cgroup pathname. Signed-off-by: Dmitry Yakunin Reviewed-by: Konstantin Khlebnikov Signed-off-by: David S. Miller commit 6e3a401fc8af01828bcdc92d713195d318b36e7e Author: Dmitry Yakunin Date: Thu Apr 30 18:51:14 2020 +0300 inet_diag: add cgroup id attribute This patch adds cgroup v2 ID to common inet diag message attributes. Cgroup v2 ID is kernfs ID (ino or ino+gen). This attribute allows filter inet diag output by cgroup ID obtained by name_to_handle_at() syscall. When net_cls or net_prio cgroup is activated this ID is equal to 1 (root cgroup ID) for newly created sockets. Some notes about this ID: 1) gets initialized in socket() syscall 2) incoming socket gets ID from listening socket (not during accept() syscall) 3) not changed when process get moved to another cgroup 4) can point to deleted cgroup (refcounting) v2: - use CONFIG_SOCK_CGROUP_DATA instead if CONFIG_CGROUPS v3: - fix attr size by using nla_total_size_64bit() (Eric Dumazet) - more detailed commit message (Konstantin Khlebnikov) Signed-off-by: Dmitry Yakunin Reviewed-by: Konstantin Khlebnikov Acked-By: Tejun Heo Signed-off-by: David S. Miller commit 8a769c65bb7a3cba0db01b0f46850862c9f5d7bf Merge: fe4f961eb5b4 29e0c2f39f98 Author: David S. Miller Date: Thu Apr 30 12:50:16 2020 -0700 Merge branch 'stmmac-intel-Fixes-and-cleanups-after-dwmac-intel-split' Andy Shevchenko says: ==================== stmmac: intel: Fixes and cleanups after dwmac-intel split Seems the split of dwmac-intel didn't go well and on top of that new functionality in the driver has not been properly tested. Patch 1 fixes a nasty kernel crash due to missed error handling. Patches 2 and 3 fix the incorrect split (clock and PCI bar handling). Patch 4 converts driver to use new PCI IRQ allocation API. The rest is a set of clean ups that may have been done in the initial submission. Series has been tested on couple of Elkhart Lake platforms with different behaviour of ethernet hardware. Changelog v3: - added the cover letter (David) - appended separate fix as a first patch - marked patches 2 and 3 with Fixes tag ==================== Signed-off-by: David S. Miller commit 29e0c2f39f983f3b83f6004f9fd05f8f4ce225c6 Author: Andy Shevchenko Date: Thu Apr 30 18:02:54 2020 +0300 stmmac: intel: Place object in the Makefile according to the order Follow the order for the platform drivers, i.e. generic object are going first. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit ccacb703b0f8141757fba2931a2a7202b54194d0 Author: Andy Shevchenko Date: Thu Apr 30 18:02:53 2020 +0300 stmmac: intel: Fix indentation to put on one line affected code There is no competition to get more LOCs into the kernel, and driver can look better and have improved readability without those additional line breaks. While at it, shorten info structures that they are all PCI, at the end it's a PCI driver for Intel hardware. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit d5383b0376643245d82230d8a974edd193ec900c Author: Andy Shevchenko Date: Thu Apr 30 18:02:52 2020 +0300 stmmac: intel: Eliminate useless conditions and variables There are useless conditions like func() { ... int ret; ... ret = foo(); if (ret) return ret; return 0; } which may be replaced with direct return statement, what we have done here. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 52c1f794845411c39ee6deedb443894ca141b4a7 Author: Andy Shevchenko Date: Thu Apr 30 18:02:51 2020 +0300 stmmac: intel: Convert to use pci_alloc_irq_vectors() API pci_enable_msi() is deprecated API, thus, switch to modern pci_alloc_irq_vectors(). Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit e578f043ffcf8b4f0999ab9e9194f156e90c7fd3 Author: Andy Shevchenko Date: Thu Apr 30 18:02:50 2020 +0300 stmmac: intel: Remove unnecessary loop for PCI BARs Copy'n'paste without thinking is not a good idea and in this case it brought unnecessary loop over PCI BAR resources which was needed to workaround one of STMicro RVP boards. Remove unnecessary loops from Intel driver. Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform") Cc: Voon Weifeng Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 09f012e64e4b8126ed6f02d0a85a57c3a0465cf9 Author: Andy Shevchenko Date: Thu Apr 30 18:02:49 2020 +0300 stmmac: intel: Fix clock handling on error and remove paths clk_prepare_enable() might fail, we have to check its returned value. Besides that we have to call clk_disable_unprepare() on the error and remove paths. Do above in the dwmac-intel driver. While at it, remove leftover in stmmac_pci and remove unneeded condition for NULL-aware clk_unregister_fixed_rate() call. Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform") Cc: Voon Weifeng Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit 801eb0501824da196c7b1c18c453528457308c5a Author: Andy Shevchenko Date: Thu Apr 30 18:02:48 2020 +0300 stmmac: intel: Fix kernel crash due to wrong error path Unfortunately sometimes ->probe() may fail. The commit b9663b7ca6ff ("net: stmmac: Enable SERDES power up/down sequence") messed up with error handling and thus: [ 12.811311] ------------[ cut here ]------------ [ 12.811993] kernel BUG at net/core/dev.c:9937! Fix this by properly crafted error path. Fixes: b9663b7ca6ff ("net: stmmac: Enable SERDES power up/down sequence") Cc: Voon Weifeng Cc: Ong Boon Leong Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit fe4f961eb5b4d743397d17feab3a3e0af8b563bc Merge: 1569a3c44303 41a211d86224 Author: David S. Miller Date: Thu Apr 30 12:44:34 2020 -0700 Merge branch 'net-smc-add-event-based-framework-for-LLC-msgs' Karsten Graul says: ==================== net/smc: add event-based framework for LLC msgs These patches are the next step towards SMC-R link failover support. They add a new framework to handle Link Layer Control (LLC) messages and adapt the existing code to use the new framework. ==================== Signed-off-by: David S. Miller commit 41a211d862242439c9cdb2481946bb0928760541 Author: Karsten Graul Date: Thu Apr 30 15:55:51 2020 +0200 net/smc: remove obsolete link state DELETING The connection layer in af_smc.c is now using the new LLC flow framework, which made the link state DELETING obsolete. Remove the state and the respective helpers. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 42d18acce9e29b61f5dbfc5118d7c72093e703a1 Author: Karsten Graul Date: Thu Apr 30 15:55:50 2020 +0200 net/smc: remove handling of CONFIRM_RKEY_CONTINUE The new SMC-R multiple link support will support a maximum of 3 links, and one CONFIRM_RKEY LLC message can transport 3 rkeys of an rmb buffer. There is no need for the LLC message type CONFIRM_RKEY_CONTINUE which is needed when more than 3 rkeys per rmb buffer needs to be exchanged. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 218b24fe381238941a06496eaf221a22c5935267 Author: Karsten Graul Date: Thu Apr 30 15:55:49 2020 +0200 net/smc: adapt SMC remote DELETE_RKEY processing to use the LLC flow Use the LLC flow framework for the processing of DELETE_RKEY messages that were received from the peer. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 3bc67e098c3e215f6e09ba3c0e1f569e7ae020d0 Author: Karsten Graul Date: Thu Apr 30 15:55:48 2020 +0200 net/smc: adapt SMC remote CONFIRM_RKEY processing to use the LLC flow Use the LLC flow framework for the processing of CONFIRM_RKEY messages that were received from the peer. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit ba21abd22f9ffa023921923a6c01d28b59731ff8 Author: Karsten Graul Date: Thu Apr 30 15:55:47 2020 +0200 net/smc: new smc_rtoken_set functions for multiple link support Introduce smc_rtoken_set() to set the rtoken for a new link to an existing rmb whose rtoken is given, and smc_rtoken_set2() to set an rtoken for a new link whose link_id is given. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 56e8091c7a098ef2257f85f16665d79cf3049da9 Author: Karsten Graul Date: Thu Apr 30 15:55:46 2020 +0200 net/smc: move the TEST_LINK response processing into event handler Get rid of the extra function and move the two-liner for the TEST_LINK response processing into the event handler function. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 6d74c3a8a3e7a488a7d9d8c4a59091ccae72fc4c Author: Karsten Graul Date: Thu Apr 30 15:55:45 2020 +0200 net/smc: multiple link support and LLC flow for smc_llc_do_delete_rkey Adapt smc_llc_do_delete_rkey() to use the LLC flow and support multiple links when deleting the rkeys for rmb buffers at the peer. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 3d88a21b0cb6a2661a567e57a431e5aa12ecb203 Author: Karsten Graul Date: Thu Apr 30 15:55:44 2020 +0200 net/smc: multiple link support and LLC flow for smc_llc_do_confirm_rkey Adapt smc_llc_do_confirm_rkey() to use the LLC flow and support the rkeys of multiple links when the CONFIRM_RKEY LLC message is build. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 0fb0b02bd6fd26cba38002be4a6bbcae2228fd44 Author: Karsten Graul Date: Thu Apr 30 15:55:43 2020 +0200 net/smc: adapt SMC client code to use the LLC flow Change the code that processes the SMC client part of connection establishment to use the LLC flow framework (CONFIRM_LINK request messages). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 4667bb4aaabf87d6b97be1b4671b9db340a58cdc Author: Karsten Graul Date: Thu Apr 30 15:55:42 2020 +0200 net/smc: adapt SMC server code to use the LLC flow Change the code that processes the SMC server part of connection establishment to use the LLC flow framework (CONFIRM_LINK response messages). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 92334cfcb3a2a102dc1b23513bbe2fca4347e2d6 Author: Karsten Graul Date: Thu Apr 30 15:55:41 2020 +0200 net/smc: add logic to evaluate CONFIRM_LINK messages to LLC layer Introduce smc_llc_eval_conf_link() to evaluate the CONFIRM_LINK message contents. This implements this logic at the LLC layer. The function will be used by af_smc.c to process the received LLC layer messages. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 81e6e5e70df46bb5b205e53f2b7885e49a9d4974 Author: Karsten Graul Date: Thu Apr 30 15:55:40 2020 +0200 net/smc: introduce link group type Add a type field to the link group which reflects the current link group redundancy state. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit a6688d919b220bd714948e03bb3caa8a66895005 Author: Karsten Graul Date: Thu Apr 30 15:55:39 2020 +0200 net/smc: enqueue all received LLC messages Introduce smc_llc_enqueue() to enqueue LLC messages, and adapt smc_llc_rx_handler() to enqueue all received LLC messages. smc_llc_enqueue() also makes it possible to enqueue LLC messages from local code. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 555da9af827d95134656fa459c8f3ece04dd867a Author: Karsten Graul Date: Thu Apr 30 15:55:38 2020 +0200 net/smc: add event-based llc_flow framework The new framework allows to start specific types of LLC control flows, protects active flows and makes it possible to wait for flows to finish before starting a new flow. This mechanism is used for the LLC control layer to model flows like 'add link' or 'delete link' which need to send/receive several LLC messages and are not allowed to get interrupted by the wrong type of messages. 'Add link' or 'Delete link' messages arriving in the middle of a flow are delayed and processed when the current flow finished. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 1569a3c44303834680e93df2ecf60f356be9b322 Author: Tang Bin Date: Thu Apr 30 20:15:31 2020 +0800 net/faraday: Fix unnecessary check in ftmac100_probe() The function ftmac100_probe() is only called with an openfirmware platform device. Therefore there is no need to check that the passed in device is NULL. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: David S. Miller commit 51070a3627a943b13c7e0a32bbfa96cb8dca4493 Author: Yunjian Wang Date: Thu Apr 30 19:26:40 2020 +0800 rionet: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 99b2292ba21b47bbd97d33ab20892347ad2ac351 Author: Yunjian Wang Date: Thu Apr 30 18:16:16 2020 +0800 net: caif: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 4b88de9f016138fec7cc3f9396fae1f94360608e Merge: 40cf7fbe8a43 9c8c0f70ec6f Author: David S. Miller Date: Thu Apr 30 12:11:14 2020 -0700 Merge branch 'net-phy-mdio-add-IPQ40xx-MDIO-support' Robert Marko says: ==================== net: phy: mdio: add IPQ40xx MDIO support This patch series provides support for the IPQ40xx built-in MDIO interface. Included are driver, devicetree bindings for it and devicetree node. ==================== Signed-off-by: David S. Miller commit 9c8c0f70ec6fdac2398632c723c48277be09b7c0 Author: Robert Marko Date: Thu Apr 30 11:07:07 2020 +0200 ARM: dts: qcom: ipq4019: add MDIO node This patch adds the necessary MDIO interface node to the Qualcomm IPQ4019 DTSI. Built-in QCA8337N switch is managed using it, and since we have a driver for it lets add it. Signed-off-by: Christian Lamparter Signed-off-by: Robert Marko Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Cc: Luka Perkov Signed-off-by: David S. Miller commit 4972ecee06612e167523f528317920fbeba5f12d Author: Robert Marko Date: Thu Apr 30 11:07:06 2020 +0200 dt-bindings: add Qualcomm IPQ4019 MDIO bindings This patch adds the binding document for the IPQ40xx MDIO driver. Signed-off-by: Robert Marko Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Cc: Luka Perkov Signed-off-by: David S. Miller commit 466ed24fb22342f3ae1c10758a6a0c6a8c081b2d Author: Robert Marko Date: Thu Apr 30 11:07:05 2020 +0200 net: phy: mdio: add IPQ4019 MDIO driver This patch adds the driver for the MDIO interface inside of Qualcomm IPQ40xx series SoC-s. Signed-off-by: Christian Lamparter Signed-off-by: Robert Marko Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Cc: Luka Perkov Signed-off-by: David S. Miller commit 7837300c250cdda06bf82177fa4f1a512d290ee0 Author: Rodrigo Siqueira Date: Wed Apr 29 14:41:42 2020 -0400 drm: Correct DP DSC macro typo In the file drm_dp_helper.h we have a macro named DP_DSC_THROUGHPUT_MODE_{0,1}_UPSUPPORTED, the correct name should be DP_DSC_THROUGHPUT_MODE_{0,1}_UNSUPPORTED. This commits adjusts this typo in the header file and in other places that attempt to access this macro. Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200429184142.1867987-1-Rodrigo.Siqueira@amd.com commit 40cf7fbe8a43b1d8c3c0139423abbeb9625a909a Author: Zou Wei Date: Thu Apr 30 09:51:31 2020 +0800 hinic: Use ARRAY_SIZE for nic_vf_cmd_msg_handler fix coccinelle warning, use ARRAY_SIZE drivers/net/ethernet/huawei/hinic/hinic_sriov.c:713:43-44: WARNING: Use ARRAY_SIZE v1-->v2: remove cmd_number v2-->v3: preserve the reverse christmas tree ordering of local variables Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: David S. Miller commit ddc2118ef064ca130f06716829e11e02b3915fd0 Author: YueHaibing Date: Thu Apr 30 09:32:45 2020 +0800 hinic: make a bunch of functions static These fucntions is used only in hinic_sriov.c, so make them static to fix sparse warnings. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit b1d1779e5ef7a60b192b61fd97201f322e1e9303 Author: Wei Yang Date: Thu Apr 23 21:44:43 2020 +0000 sched/core: Simplify sched_init() Currently root_task_group.shares and cfs_bandwidth are initialized for each online cpu, which not necessary. Let's take it out to do it only once. Signed-off-by: Wei Yang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200423214443.29994-1-richard.weiyang@gmail.com commit 12ac6782a40ad7636b6ef45680741825b64ab221 Author: Davidlohr Bueso Date: Tue Apr 21 21:07:39 2020 -0700 sched/swait: Reword some of the main description With both the increased use of swait and kvm no longer using it, we can reword some of the comments. While removing Linus' valid rant, I've also cared to explicitly mention that swait is very different than regular wait. In addition it is mentioned against using swait in favor of the regular flavor. Signed-off-by: Davidlohr Bueso Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200422040739.18601-6-dave@stgolabs.net commit 17c891ab349138e8d8a59ca2700f42ce8af96f4e Author: Muchun Song Date: Tue Apr 21 22:41:23 2020 +0800 sched/fair: Use __this_cpu_read() in wake_wide() The code is executed with preemption(and interrupts) disabled, so it's safe to use __this_cpu_write(). Signed-off-by: Muchun Song Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421144123.33580-1-songmuchun@bytedance.com commit bf2c59fce4074e55d622089b34be3a6bc95484fb Author: Peter Zijlstra Date: Wed Apr 1 17:40:33 2020 -0400 sched/core: Fix illegal RCU from offline CPUs In the CPU-offline process, it calls mmdrop() after idle entry and the subsequent call to cpuhp_report_idle_dead(). Once execution passes the call to rcu_report_dead(), RCU is ignoring the CPU, which results in lockdep complaining when mmdrop() uses RCU from either memcg or debugobjects below. Fix it by cleaning up the active_mm state from BP instead. Every arch which has CONFIG_HOTPLUG_CPU should have already called idle_task_exit() from AP. The only exception is parisc because it switches them to &init_mm unconditionally (see smp_boot_one_cpu() and smp_cpu_init()), but the patch will still work there because it calls mmgrab(&init_mm) in smp_cpu_init() and then should call mmdrop(&init_mm) in finish_cpu(). WARNING: suspicious RCU usage ----------------------------- kernel/workqueue.c:710 RCU or wq_pool_mutex should be held! other info that might help us debug this: RCU used illegally from offline CPU! Call Trace: dump_stack+0xf4/0x164 (unreliable) lockdep_rcu_suspicious+0x140/0x164 get_work_pool+0x110/0x150 __queue_work+0x1bc/0xca0 queue_work_on+0x114/0x120 css_release+0x9c/0xc0 percpu_ref_put_many+0x204/0x230 free_pcp_prepare+0x264/0x570 free_unref_page+0x38/0xf0 __mmdrop+0x21c/0x2c0 idle_task_exit+0x170/0x1b0 pnv_smp_cpu_kill_self+0x38/0x2e0 cpu_die+0x48/0x64 arch_cpu_idle_dead+0x30/0x50 do_idle+0x2f4/0x470 cpu_startup_entry+0x38/0x40 start_secondary+0x7a8/0xa80 start_secondary_resume+0x10/0x14 Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Qian Cai Signed-off-by: Peter Zijlstra (Intel) Acked-by: Michael Ellerman (powerpc) Link: https://lkml.kernel.org/r/20200401214033.8448-1-cai@lca.pw commit f38f12d1e0811c0ee59260b2bdadedf99e16c4af Author: Muchun Song Date: Mon Apr 6 15:47:50 2020 +0800 sched/fair: Mark sched_init_granularity __init Function sched_init_granularity() is only called from __init functions, so mark it __init as well. Signed-off-by: Muchun Song Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Steven Rostedt (VMware) Link: https://lkml.kernel.org/r/20200406074750.56533-1-songmuchun@bytedance.com commit 5a6d6a6ccb5f48ca8cf7c6d64ff83fd9c7999390 Author: Huaixin Chang Date: Mon Apr 20 10:44:21 2020 +0800 sched/fair: Refill bandwidth before scaling In order to prevent possible hardlockup of sched_cfs_period_timer() loop, loop count is introduced to denote whether to scale quota and period or not. However, scale is done between forwarding period timer and refilling cfs bandwidth runtime, which means that period timer is forwarded with old "period" while runtime is refilled with scaled "quota". Move do_sched_cfs_period_timer() before scaling to solve this. Fixes: 2e8e19226398 ("sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup") Signed-off-by: Huaixin Chang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Reviewed-by: Phil Auld Link: https://lkml.kernel.org/r/20200420024421.22442-3-changhuaixin@linux.alibaba.com commit 457d1f465778ccb5f14f7d7a62245e41d12a3804 Author: Chen Yu Date: Tue Apr 21 18:50:43 2020 +0800 sched: Extract the task putting code from pick_next_task() Introduce a new function put_prev_task_balance() to do the balance when necessary, and then put previous task back to the run queue. This function is extracted from pick_next_task() to prepare for future usage by other type of task picking logic. No functional change. Suggested-by: Peter Zijlstra Signed-off-by: Chen Yu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Vincent Guittot Reviewed-by: Steven Rostedt (VMware) Link: https://lkml.kernel.org/r/5a99860cf66293db58a397d6248bcb2eee326776.1587464698.git.yu.c.chen@intel.com commit d91cecc156620ec75d94c55369509c807c3d07e6 Author: Chen Yu Date: Tue Apr 21 18:50:34 2020 +0800 sched: Make newidle_balance() static again After Commit 6e2df0581f56 ("sched: Fix pick_next_task() vs 'change' pattern race"), there is no need to expose newidle_balance() as it is only used within fair.c file. Change this function back to static again. No functional change. Reported-by: kbuild test robot Suggested-by: Peter Zijlstra Signed-off-by: Chen Yu Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/83cd3030b031ca5d646cd5e225be10e7a0fdd8f5.1587464698.git.yu.c.chen@intel.com commit 36c5bdc4387056af3840adb4478c752faeb9d15e Author: Valentin Schneider Date: Wed Apr 15 22:05:07 2020 +0100 sched/topology: Kill SD_LOAD_BALANCE That flag is set unconditionally in sd_init(), and no one checks for it anymore. Remove it. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200415210512.805-5-valentin.schneider@arm.com commit e669ac8ab952df2f07dee1e1efbf40647d6de332 Author: Valentin Schneider Date: Wed Apr 15 22:05:06 2020 +0100 sched: Remove checks against SD_LOAD_BALANCE The SD_LOAD_BALANCE flag is set unconditionally for all domains in sd_init(). By making the sched_domain->flags syctl interface read-only, we have removed the last piece of code that could clear that flag - as such, it will now be always present. Rather than to keep carrying it along, we can work towards getting rid of it entirely. cpusets don't need it because they can make CPUs be attached to the NULL domain (e.g. cpuset with sched_load_balance=0), or to a partitioned root_domain, i.e. a sched_domain hierarchy that doesn't span the entire system (e.g. root cpuset with sched_load_balance=0 and sibling cpusets with sched_load_balance=1). isolcpus apply the same "trick": isolated CPUs are explicitly taken out of the sched_domain rebuild (using housekeeping_cpumask()), so they get the NULL domain treatment as well. Remove the checks against SD_LOAD_BALANCE. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200415210512.805-4-valentin.schneider@arm.com commit 9818427c6270a9ce8c52c8621026fe9cebae0f92 Author: Valentin Schneider Date: Wed Apr 15 22:05:05 2020 +0100 sched/debug: Make sd->flags sysctl read-only Writing to the sysctl of a sched_domain->flags directly updates the value of the field, and goes nowhere near update_top_cache_domain(). This means that the cached domain pointers can end up containing stale data (e.g. the domain pointed to doesn't have the relevant flag set anymore). Explicit domain walks that check for flags will be affected by the write, but this won't be in sync with the cached pointers which will still point to the domains that were cached at the last sched_domain build. In other words, writing to this interface is playing a dangerous game. It could be made to trigger an update of the cached sched_domain pointers when written to, but this does not seem to be worth the trouble. Make it read-only. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200415210512.805-3-valentin.schneider@arm.com commit 45da27732b0b9b7a04696653065d5e6037bc5ac0 Author: Valentin Schneider Date: Wed Apr 15 22:05:04 2020 +0100 sched/fair: find_idlest_group(): Remove unused sd_flag parameter The last use of that parameter was removed by commit 57abff067a08 ("sched/fair: Rework find_idlest_group()") Get rid of the parameter. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20200415210512.805-2-valentin.schneider@arm.com commit 586b58cac8b4683eb58a1446fbc399de18974e40 Author: Jann Horn Date: Thu Mar 5 23:06:57 2020 +0100 exit: Move preemption fixup up, move blocking operations down With CONFIG_DEBUG_ATOMIC_SLEEP=y and CONFIG_CGROUPS=y, kernel oopses in non-preemptible context look untidy; after the main oops, the kernel prints a "sleeping function called from invalid context" report because exit_signals() -> cgroup_threadgroup_change_begin() -> percpu_down_read() can sleep, and that happens before the preempt_count_set(PREEMPT_ENABLED) fixup. It looks like the same thing applies to profile_task_exit() and kcov_task_exit(). Fix it by moving the preemption fixup up and the calls to profile_task_exit() and kcov_task_exit() down. Fixes: 1dc0fffc48af ("sched/core: Robustify preemption leak checks") Signed-off-by: Jann Horn Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200305220657.46800-1-jannh@google.com commit 64297f2b03cc7a6d0184a435f1b296beca1bedd1 Author: Peng Wang Date: Sat Apr 11 17:20:20 2020 +0800 sched/fair: Simplify the code of should_we_balance() We only consider group_balance_cpu() after there is no idle cpu. So, just do comparison before return at these two cases. Signed-off-by: Peng Wang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/245c792f0e580b3ca342ad61257f4c066ee0f84f.1586594833.git.rocking@linux.alibaba.com commit ab93a4bc955b3980c699430bc0b633f0d8b607be Author: Josh Don Date: Fri Apr 10 15:52:08 2020 -0700 sched/fair: Remove distribute_running from CFS bandwidth This is mostly a revert of commit: baa9be4ffb55 ("sched/fair: Fix throttle_list starvation with low CFS quota") The primary use of distribute_running was to determine whether to add throttled entities to the head or the tail of the throttled list. Now that we always add to the tail, we can remove this field. The other use of distribute_running is in the slack_timer, so that we don't start a distribution while one is already running. However, even in the event that this race occurs, it is fine to have two distributions running (especially now that distribute grabs the cfs_b->lock to determine remaining quota before assigning). Signed-off-by: Josh Don Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Phil Auld Tested-by: Phil Auld Link: https://lkml.kernel.org/r/20200410225208.109717-3-joshdon@google.com commit e98fa02c4f2ea4991dae422ac7e34d102d2f0599 Author: Paul Turner Date: Fri Apr 10 15:52:07 2020 -0700 sched/fair: Eliminate bandwidth race between throttling and distribution There is a race window in which an entity begins throttling before quota is added to the pool, but does not finish throttling until after we have finished with distribute_cfs_runtime(). This entity is not observed by distribute_cfs_runtime() because it was not on the throttled list at the time that distribution was running. This race manifests as rare period-length statlls for such entities. Rather than heavy-weight the synchronization with the progress of distribution, we can fix this by aborting throttling if bandwidth has become available. Otherwise, we immediately add the entity to the throttled list so that it can be observed by a subsequent distribution. Additionally, we can remove the case of adding the throttled entity to the head of the throttled list, and simply always add to the tail. Thanks to 26a8b12747c97, distribute_cfs_runtime() no longer holds onto its own pool of runtime. This means that if we do hit the !assign and distribute_running case, we know that distribution is about to end. Signed-off-by: Paul Turner Signed-off-by: Ben Segall Signed-off-by: Josh Don Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Phil Auld Link: https://lkml.kernel.org/r/20200410225208.109717-2-joshdon@google.com commit f080d93e1d419099a99d7473ed532289ca8dc717 Author: Xie XiuQi Date: Tue Apr 14 20:57:21 2020 +0800 sched/debug: Fix trival print_task() format Ensure leave one space between state and task name. w/o patch: runnable tasks: S task PID tree-key switches prio wait Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200414125721.195801-1-xiexiuqi@huawei.com commit 4bd30106ddb26d2304adc5bb7bd269825300440d Author: Paul Gortmaker Date: Wed Apr 8 19:52:16 2020 -0400 perf/x86/intel/pt: Drop pointless NULL assignment. Only a few lines below this removed line is this: attrs = kzalloc(size, GFP_KERNEL); and since there is no code path where this could be avoided, the NULL assignment is a pointless relic of history and can be removed. Signed-off-by: Paul Gortmaker Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200408235216.108980-1-paul.gortmaker@windriver.com commit 2ed6edd33a214bca02bd2b45e3fc3038a059436b Author: Barret Rhoden Date: Tue Apr 14 18:29:20 2020 -0400 perf: Add cond_resched() to task_function_call() Under rare circumstances, task_function_call() can repeatedly fail and cause a soft lockup. There is a slight race where the process is no longer running on the cpu we targeted by the time remote_function() runs. The code will simply try again. If we are very unlucky, this will continue to fail, until a watchdog fires. This can happen in a heavily loaded, multi-core virtual machine. Reported-by: syzbot+bb4935a5c09b5ff79940@syzkaller.appspotmail.com Signed-off-by: Barret Rhoden Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200414222920.121401-1-brho@google.com commit 3a4ac121c2cacbf97d493fa3bc42ead88657abe4 Author: CodyYao-oc Date: Mon Apr 13 11:14:29 2020 +0800 x86/perf: Add hardware performance events support for Zhaoxin CPU. Zhaoxin CPU has provided facilities for monitoring performance via PMU (Performance Monitor Unit), but the functionality is unused so far. Therefore, add support for zhaoxin pmu to make performance related hardware events available. The PMU is mostly an Intel Architectural PerfMon-v2 with a novel errata for the ZXC line. It supports the following events: ----------------------------------------------------------------------------------------------------------------------------------- Event | Event | Umask | Description | Select | | ----------------------------------------------------------------------------------------------------------------------------------- cpu-cycles | 82h | 00h | unhalt core clock instructions | 00h | 00h | number of instructions at retirement. cache-references | 15h | 05h | number of fillq pushs at the current cycle. cache-misses | 1ah | 05h | number of l2 miss pushed by fillq. branch-instructions | 28h | 00h | counts the number of branch instructions retired. branch-misses | 29h | 00h | mispredicted branch instructions at retirement. bus-cycles | 83h | 00h | unhalt bus clock stalled-cycles-frontend | 01h | 01h | Increments each cycle the # of Uops issued by the RAT to RS. stalled-cycles-backend | 0fh | 04h | RS0/1/2/3/45 empty L1-dcache-loads | 68h | 05h | number of retire/commit load. L1-dcache-load-misses | 4bh | 05h | retired load uops whose data source followed an L1 miss. L1-dcache-stores | 69h | 06h | number of retire/commit Store,no LEA L1-dcache-store-misses | 62h | 05h | cache lines in M state evicted out of L1D due to Snoop HitM or dirty line replacement. L1-icache-loads | 00h | 03h | number of l1i cache access for valid normal fetch,including un-cacheable access. L1-icache-load-misses | 01h | 03h | number of l1i cache miss for valid normal fetch,including un-cacheable miss. L1-icache-prefetches | 0ah | 03h | number of prefetch. L1-icache-prefetch-misses | 0bh | 03h | number of prefetch miss. dTLB-loads | 68h | 05h | number of retire/commit load dTLB-load-misses | 2ch | 05h | number of load operations miss all level tlbs and cause a tablewalk. dTLB-stores | 69h | 06h | number of retire/commit Store,no LEA dTLB-store-misses | 30h | 05h | number of store operations miss all level tlbs and cause a tablewalk. dTLB-prefetches | 64h | 05h | number of hardware pte prefetch requests dispatched out of the prefetch FIFO. dTLB-prefetch-misses | 65h | 05h | number of hardware pte prefetch requests miss the l1d data cache. iTLB-load | 00h | 00h | actually counter instructions. iTLB-load-misses | 34h | 05h | number of code operations miss all level tlbs and cause a tablewalk. ----------------------------------------------------------------------------------------------------------------------------------- Reported-by: kbuild test robot Signed-off-by: CodyYao-oc Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1586747669-4827-1-git-send-email-CodyYao-oc@zhaoxin.com commit cc1ac9c792810b93783a7de344f428922af8d98c Author: Peter Zijlstra Date: Thu Apr 16 14:34:26 2020 +0200 x86/retpoline: Fix retpoline unwind Currently objtool cannot understand retpolines, and thus cannot generate ORC unwind information for them. This means that we cannot unwind from the middle of a retpoline. The recent ANNOTATE_INTRA_FUNCTION_CALL and UNWIND_HINT_RET_OFFSET support in objtool enables it to understand the basic retpoline construct. A further problem is that the ORC unwind information is alternative invariant; IOW. every alternative should have the same ORC, retpolines obviously violate this. This means we need to out-of-line them. Since all GCC generated code already uses out-of-line retpolines, this should not affect performance much, if anything. This will enable objtool to generate valid ORC data for the out-of-line copies, which means we can correctly and reliably unwind through a retpoline. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191700.210835357@infradead.org commit 34fdce6981b96920ced4e0ee56e9db3fb03a33f0 Author: Peter Zijlstra Date: Wed Apr 22 17:16:40 2020 +0200 x86: Change {JMP,CALL}_NOSPEC argument In order to change the {JMP,CALL}_NOSPEC macros to call out-of-line versions of the retpoline magic, we need to remove the '%' from the argument, such that we can paste it onto symbol names. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191700.151623523@infradead.org commit ca3f0d80dd57c8828bfb5bc0bc79750ea7a1ba26 Author: Peter Zijlstra Date: Wed Apr 22 17:03:22 2020 +0200 x86: Simplify retpoline declaration Because of how KSYM works, we need one declaration per line. Seeing how we're going to be doubling the amount of retpoline symbols, simplify the machinery in order to avoid having to copy/paste even more. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191700.091696925@infradead.org commit 089dd8e53126ebaf506e2dc0bf89d652c36bfc12 Author: Peter Zijlstra Date: Tue Apr 14 12:36:16 2020 +0200 x86/speculation: Change FILL_RETURN_BUFFER to work with objtool Change FILL_RETURN_BUFFER so that objtool groks it and can generate correct ORC unwind information. - Since ORC is alternative invariant; that is, all alternatives should have the same ORC entries, the __FILL_RETURN_BUFFER body can not be part of an alternative. Therefore, move it out of the alternative and keep the alternative as a sort of jump_label around it. - Use the ANNOTATE_INTRA_FUNCTION_CALL annotation to white-list these 'funny' call instructions to nowhere. - Use UNWIND_HINT_EMPTY to 'fill' the speculation traps, otherwise objtool will consider them unreachable. - Move the RSP adjustment into the loop, such that the loop has a deterministic stack layout. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191700.032079304@infradead.org commit 8aa8eb2a8f5b3305a95f39957dd2b715fa668e21 Author: Alexandre Chartre Date: Tue Apr 14 12:36:12 2020 +0200 objtool: Add support for intra-function calls Change objtool to support intra-function calls. On x86, an intra-function call is represented in objtool as a push onto the stack (of the return address), and a jump to the destination address. That way the stack information is correctly updated and the call flow is still accurate. Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200414103618.12657-4-alexandre.chartre@oracle.com commit b490f45362002fef57996388e395efc974b013f4 Author: Miroslav Benes Date: Fri Apr 24 16:30:42 2020 +0200 objtool: Move the IRET hack into the arch decoder Quoting Julien: "And the other suggestion is my other email was that you don't even need to add INSN_EXCEPTION_RETURN. You can keep IRET as INSN_CONTEXT_SWITCH by default and x86 decoder lookups the symbol conaining an iret. If it's a function symbol, it can just set the type to INSN_OTHER so that it caries on to the next instruction after having handled the stack_op." Suggested-by: Julien Thierry Signed-off-by: Miroslav Benes Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191659.913283807@infradead.org commit b09fb65e863733e192d4825a285b4b4998969ce0 Author: Peter Zijlstra Date: Fri Apr 24 16:18:58 2020 +0200 objtool: Remove INSN_STACK With the unconditional use of handle_insn_ops(), INSN_STACK has lost its purpose. Remove it. Suggested-by: Julien Thierry Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191659.854203028@infradead.org commit 60041bcd8f5ab560dabf44dc384f58bbeb5a6a30 Author: Peter Zijlstra Date: Fri Apr 24 16:16:41 2020 +0200 objtool: Make handle_insn_ops() unconditional Now that every instruction has a list of stack_ops; we can trivially distinquish those instructions that do not have stack_ops, their list is empty. This means we can now call handle_insn_ops() unconditionally. Suggested-by: Julien Thierry Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191659.795115188@infradead.org commit 7d989fcadd6e225a61d6490dd15bdbdfc8a53d5c Author: Peter Zijlstra Date: Thu Apr 23 13:22:10 2020 +0200 objtool: Rework allocating stack_ops on decode Wrap each stack_op in a macro that allocates and adds it to the list. This simplifies trying to figure out what to do with the pre-allocated stack_op at the end. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Alexandre Chartre Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191659.736151601@infradead.org commit c721b3f80faebc7891211fa82de303eebadfed15 Author: Alexandre Chartre Date: Tue Apr 7 09:31:35 2020 +0200 objtool: UNWIND_HINT_RET_OFFSET should not check registers UNWIND_HINT_RET_OFFSET will adjust a modified stack. However if a callee-saved register was pushed on the stack then the stack frame will still appear modified. So stop checking registers when UNWIND_HINT_RET_OFFSET is used. Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200407073142.20659-3-alexandre.chartre@oracle.com commit 87cf61fe848ca8ddf091548671e168f52e8a718e Author: Alexandre Chartre Date: Tue Apr 14 12:36:10 2020 +0200 objtool: is_fentry_call() crashes if call has no destination Fix is_fentry_call() so that it works if a call has no destination set (call_dest). This needs to be done in order to support intra- function calls. Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200414103618.12657-2-alexandre.chartre@oracle.com commit 1ff865e343c2b59469d7e41d370a980a3f972c71 Author: Peter Zijlstra Date: Tue Apr 28 19:57:59 2020 +0200 x86,smap: Fix smap_{save,restore}() alternatives As reported by objtool: lib/ubsan.o: warning: objtool: .altinstr_replacement+0x0: alternative modifies stack lib/ubsan.o: warning: objtool: .altinstr_replacement+0x7: alternative modifies stack the smap_{save,restore}() alternatives violate (the newly enforced) rule on stack invariance. That is, due to there only being a single ORC table it must be valid to any alternative. These alternatives violate this with the direct result that unwinds will not be correct when it hits between the PUSH and POP instructions. Rewrite the functions to only have a conditional jump. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200429101802.GI13592@hirez.programming.kicks-ass.net commit 7117f16bf460ef8cd132e6e80c989677397b4868 Author: Peter Zijlstra Date: Tue Apr 28 19:37:01 2020 +0200 objtool: Fix ORC vs alternatives Jann reported that (for instance) entry_64.o:general_protection has very odd ORC data: 0000000000000f40 : #######sp:sp+8 bp:(und) type:iret end:0 f40: 90 nop #######sp:(und) bp:(und) type:call end:0 f41: 90 nop f42: 90 nop #######sp:sp+8 bp:(und) type:iret end:0 f43: e8 a8 01 00 00 callq 10f0 #######sp:sp+0 bp:(und) type:regs end:0 f48: f6 84 24 88 00 00 00 testb $0x3,0x88(%rsp) f4f: 03 f50: 74 00 je f52 f52: 48 89 e7 mov %rsp,%rdi f55: 48 8b 74 24 78 mov 0x78(%rsp),%rsi f5a: 48 c7 44 24 78 ff ff movq $0xffffffffffffffff,0x78(%rsp) f61: ff ff f63: e8 00 00 00 00 callq f68 f68: e9 73 02 00 00 jmpq 11e0 #######sp:(und) bp:(und) type:call end:0 f6d: 0f 1f 00 nopl (%rax) Note the entry at 0xf41. Josh found this was the result of commit: 764eef4b109a ("objtool: Rewrite alt->skip_orig") Due to the early return in validate_branch() we no longer set insn->cfi of the original instruction stream (the NOPs at 0xf41 and 0xf42) and we'll end up with the above weirdness. In other discussions we realized alternatives should be ORC invariant; that is, due to there being only a single ORC table, it must be valid for all alternatives. The easiest way to ensure this is to not allow any stack modifications in alternatives. When we enforce this latter observation, we get the property that the whole alternative must have the same CFI, which we can employ to fix the former report. Fixes: 764eef4b109a ("objtool: Rewrite alt->skip_orig") Reported-by: Jann Horn Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191659.499074346@infradead.org commit 13fab06d9a3ad3afdfd51c7f8f87f2ae28444648 Author: Alexandre Chartre Date: Tue Apr 14 12:36:11 2020 +0200 objtool: Uniquely identify alternative instruction groups Assign a unique identifier to every alternative instruction group in order to be able to tell which instructions belong to what alternative. [peterz: extracted from a larger patch] Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes commit 9e98d62aa7ea1375052895650f3e6d362336c5c9 Author: Julien Thierry Date: Fri Mar 27 15:28:42 2020 +0000 objtool: Remove check preventing branches within alternative While jumping from outside an alternative region to the middle of an alternative region is very likely wrong, jumping from an alternative region into the same region is valid. It is a common pattern on arm64. The first pattern is unlikely to happen in practice and checking only for this adds a lot of complexity. Just remove the current check. Suggested-by: Josh Poimboeuf Signed-off-by: Julien Thierry Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/20200327152847.15294-6-jthierry@redhat.com commit b359ed5184aebf9d987e54abc5dae7ac03ed29ae Author: Jean-Philippe Brucker Date: Fri Apr 17 16:23:26 2020 +0200 mtd: cfi_cmdset_0001: Support the absence of protection registers The flash controller implemented by the Arm Base platform behaves like the Intel StrataFlash J3 device, but omits several features. In particular it doesn't implement a protection register, so "Number of Protection register fields" in the Primary Vendor-Specific Extended Query, is 0. The Intel StrataFlash J3 datasheet only lists 1 as a valid value for NumProtectionFields. It describes the field as: "Number of Protection register fields in JEDEC ID space. “00h,” indicates that 256 protection bytes are available" While a value of 0 may arguably not be architecturally valid, the driver's current behavior is certainly wrong: if NumProtectionFields is 0, read_pri_intelext() adds a negative value to the unsigned extra_size, and ends up in an infinite loop. Fix it by ignoring a NumProtectionFields of 0. Signed-off-by: Jean-Philippe Brucker Tested-by: Sudeep Holla Tested-by: Catalin Marinas Signed-off-by: Vignesh Raghavendra commit 16e87459673a5cbef35cc0f2e15c664b10a4cdb6 Author: Chris Wilson Date: Thu Apr 30 12:18:12 2020 +0100 drm/i915/gt: Move the batch buffer pool from the engine to the gt Since the introduction of 'soft-rc6', we aim to park the device quickly and that results in frequent idling of the whole device. Currently upon idling we free the batch buffer pool, and so this renders the cache ineffective for many workloads. If we want to have an effective cache of recently allocated buffers available for reuse, we need to decouple that cache from the engine powermanagement and make it timer based. As there is no reason then to keep it within the engine (where it once made retirement order easier to track), we can move it up the hierarchy to the owner of the memory allocations. v2: Hook up to debugfs/drop_caches to clear the cache on demand. Signed-off-by: Chris Wilson Cc: Maarten Lankhorst Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200430111819.10262-2-chris@chris-wilson.co.uk commit e5651e83980c6e9909a02130e714f685930d054e Author: Lubomir Rintel Date: Sun Apr 19 22:17:15 2020 +0200 dt-bindings: serial: Move Marvell compatible string to 8250 binding doc These ports are compatible with NS8250 and handled by the same driver. Get rid of the extra document that fails to document the properties that are actually supported. Signed-off-by: Lubomir Rintel Signed-off-by: Rob Herring commit 040636668bff1cb7022c86da18964d2abcfcaa2b Merge: 7456427af9de 4bc77b2d211e Author: Rob Herring Date: Thu Apr 30 13:01:46 2020 -0500 Merge branch 'dt/linus' into 'dt/next' commit 87dc36482cab3a4ea34f203fc3f4da35712eb783 Author: Kai-Heng Feng Date: Thu Apr 30 21:52:07 2020 +0800 ALSA: hda/realtek - Add LED class support for micmute LED Currently DMIC controls micmute LED via "audio mute LED trigger". However, unlike Dell and Lenovo platforms, HP platforms don't provide a way to control micmute LED via ACPI, it's controlled by HDA codec instead. So let's register an LED class for micmute so other subsystems like DMIC can facilitate the codec-controlled LED. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200430135209.14703-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit 3e0650ab26e2010ee312311612e40e076ed1feca Author: Kai-Heng Feng Date: Thu Apr 30 16:32:52 2020 +0800 ALSA: hda/realtek - Enable micmute LED on and HP system Though the system uses DMIC, headset mic still uses the HDA, let's use GPIO 0x1 to control the micmute LED. The micmute LED GPIO has a different polarity to the mute LED GPIO, we can use the newly added micmute_led_polarity to indicate that. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200430083255.5093-2-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit dbd13179780555ecd3c992dea1222ca31920e892 Author: Kai-Heng Feng Date: Thu Apr 30 16:32:51 2020 +0800 ALSA: hda/realtek - Introduce polarity for micmute LED GPIO Currently mute LED and micmute LED share the same GPIO polarity. So split the polarity for mute and micmute, in case they have different polarities. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200430083255.5093-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit ec9cdca0663a543ede2072ff091beec1787e3374 Author: Maxim Mikityanskiy Date: Thu Apr 16 11:29:49 2020 +0300 net/mlx5e: Unify reserving space for WQEs In our fast-path design, a WQE (Work Queue Element) must not cross the page boundary. To enforce that, for WQEs consisting of more than one BB (Basic Block), the driver checks the available contiguous space in the WQ in advance, and if it's not enough, it pads it with NOPs. This patch modifies the code that calculates the position of next WQE, considering the padding, and prepares the WQE. This code is common for all SQ types. In this patch it's reorganized in a way that makes the usage pattern unified for all SQ types, and makes the implementations self-contained and look almost the same, preparing the repeating code to further attempts to deduplicate it. One place is left as is: mlx5e_sq_xmit and mlx5e_fill_sq_frag_edge call inside, because it is special in a way that it may also copy WQE's cseg and eseg when reserving space. This will be eliminated in one of the following patches, and this place will be converted to the new approach, too. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 7d42c8e9ab50091e4dda29066975fbb7aa0f1585 Author: Maxim Mikityanskiy Date: Thu Apr 16 11:32:42 2020 +0300 net/mlx5e: Rename ICOSQ WQE info struct and field Structs mlx5e_txqsq and mlx5e_xdpsq contain wqe_info arrays to store supplementary information corresponding to WQEs in the queue. Struct mlx5e_icosq also has such an array, but it's called differently - ico_wqe. This patch renames it to unify with the other SQs. In addition, rename the struct to emphasize its specific usage. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit fed0c6cfcd58f29ff60f47559b88a6289b6b680a Author: Maxim Mikityanskiy Date: Fri Nov 15 13:48:38 2019 +0200 net/mlx5e: Fetch WQE: reuse code and enforce typing There are multiple functions mlx5{e,i}_*_fetch_wqe that contain the same code, that is repeated, because they operate on different SQ struct types. mlx5e_sq_fetch_wqe also returns void *, instead of the concrete WQE type. This commit generalizes the fetch WQE operation by putting this code into a single function. To simplify calls of the generic function in concrete use cases, macros are provided that substitute the right WQE size and cast the return type. Before this patch, fetch_wqe used to calculate pi itself, but the value was often known to the caller. This calculation is moved outside to eliminate this unnecessary step and prepare for the fill_frag_edge refactoring in the next patch. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit e2e11dbf36936d9cfea99c5b7386acea67b21634 Author: Tariq Toukan Date: Sun Feb 9 17:13:23 2020 +0200 net/mlx5e: XDP, Print the offending TX descriptor on error completion Upon an error completion on an XDP SQ, print the offending WQE to ease the debug process. Signed-off-by: Tariq Toukan Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit f1b95753eeedc00f1223e8033d96dae9f996ca6d Author: Tariq Toukan Date: Sun Feb 9 17:06:49 2020 +0200 net/mlx5e: TX, Generalise code and usage of error CQE dump Error CQE was dumped only for TXQ SQs. Generalise the function, and add usage for error completions on ICO SQs and XDP SQs. Signed-off-by: Tariq Toukan Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit e658664c77c11c5ba77dfb231138505ecac71c80 Author: Tariq Toukan Date: Thu Aug 8 12:32:17 2019 +0300 net/mlx5e: Use proper name field for the UMR key Even though some of the WQE control segment's field share the same memory bits (a union of fields), prefer having the right field name for every different usage. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit c6168161f693e6d26cdcce891f99399f1432ac80 Author: Eran Ben Elisha Date: Wed Apr 1 10:30:32 2020 +0300 net/mlx5: Add support for release all pages event If FW sets release_all_pages bit in MLX5_EVENT_TYPE_PAGE_REQUEST, driver shall release all pages of a given function id, with no further pages reclaim negotiation with FW nor MANAGE_PAGES commands from driver towards FW. Upon receiving this bit as part of pages reclaim event, driver will initiate release all flow, in which it will iterate and release all function's pages. As part of driver <-> FW capabilities handshake, FW will report release_all_pages max HCA cap bit, and driver will set the release_all_pages bit in HCA cap. NIC: ConnectX-4 Lx CPU: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz Test case: Simulataniously FLR 4 VFs, and measure FW release pages by driver. Before: 3.18 Sec After: 0.31 Sec Signed-off-by: Eran Ben Elisha Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit c7636942d278db7f502c626a47d2ce1111602716 Author: Eran Ben Elisha Date: Sun Apr 19 10:20:40 2020 +0300 net/mlx5: Rate limit page not found error messages Thousands of pages are released with free_addr() function. In case of buggy sync between FW and driver on released address, the log will be flooded with error messages. Use mlx5_core_warn_rl() to limit it. Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit c655c1f46957eb4f30221c52580e38f85058e167 Author: Eran Ben Elisha Date: Mon Mar 30 14:27:08 2020 +0300 net/mlx5: Add helper function to release fw page Factor out the fwp address release page to an helper function, will be used in the downstream patch. Signed-off-by: Eran Ben Elisha Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 51dde00b8fb3cf07e577be6aa4d98ee1f34b84be Author: Tariq Toukan Date: Wed Apr 15 19:34:03 2020 +0300 net/mlx5: Remove unused field in EQ The size field in EQ is not in use. Remove it. Signed-off-by: Tariq Toukan Reviewed-by: Tal Gilboa Signed-off-by: Saeed Mahameed commit d2658b4a1d06e8458f2c88ee600afa1b1acd2627 Author: Paul Blakey Date: Tue Apr 14 11:30:39 2020 +0300 net/mlx5: CT: Remove unused variables Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 70a5698a5683cd504b03c6030ee622b1bec3f702 Author: Roi Dayan Date: Sun Apr 26 09:52:02 2020 +0300 net/mlx5e: CT: Avoid false warning about rule may be used uninitialized Avoid gcc warning by preset rule to invalid ptr. Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking") Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed commit e59b254cbecc10088b691a2abdaeb6ded872b7a1 Author: Zheng Bin Date: Fri Apr 24 16:43:57 2020 +0800 net/mlx5e: Remove unneeded semicolon Fixes coccicheck warning: drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c:690:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Saeed Mahameed commit 9c8e7434e0349b26df82ed25522e812e4feeb873 Author: Parav Pandit Date: Fri Apr 3 05:49:02 2020 -0500 net/mlx5e: Use helper API to get devlink port index for all port flavours Use existing helper API to get unique devlink port index for all devlink port flavours. Reviewed-by: Jiri Pirko Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 72d3fef16158b9c1852855a3846757ec165c16e1 Author: Raed Salem Date: Wed Apr 22 09:19:08 2020 +0300 net/mlx5: IPsec, Fix coverity issue The cited commit introduced the following coverity issue at functions mlx5_fpga_is_ipsec_device() and mlx5_fpga_ipsec_release_sa_ctx(): - bit_and_with_zero: accel_xfrm->attrs.action & MLX5_ACCEL_ESP_ACTION_DECRYPT is always 0. As MLX5_ACCEL_ESP_ACTION_DECRYPT is not a bitwise flag and was wrongly used with bitwise operation, the above expression is always zero value as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero. Fix by using "==" comparison operator instead. Fixes: 7dfee4b1d79e ("net/mlx5: IPsec, Refactor SA handle creation and destruction") Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed commit a6b1b936057e874db52d3e5f0caeb42f11449acf Merge: 323e395f197f 2dc8b5246d2c Author: Saeed Mahameed Date: Thu Apr 30 09:46:19 2020 -0700 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux mlx5 updates for both net-next and rdma-next: 1) HW bits and definitions for TLS and IPsec offlaods 2) Release all pages capability bits 3) New command interface helpers and some code cleanup as a result 4) Move qp.c out of mlx5 core driver into mlx5_ib rdma driver Signed-off-by: Saeed Mahameed commit bf60333977d57b1edaac75ab942a8d0e5f923b33 Merge: 6a8b55ed4056 2ce0d7f9766f Author: Will Deacon Date: Thu Apr 30 17:39:42 2020 +0100 Merge branch 'x86/asm' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into for-next/asm As agreed with Boris, merge in the 'x86/asm' branch from -tip so that we can select the new 'ARCH_USE_SYM_ANNOTATIONS' Kconfig symbol, which is required by the BTI kernel patches. * 'x86/asm' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/asm: Provide a Kconfig symbol for disabling old assembly annotations x86/32: Remove CONFIG_DOUBLEFAULT commit 38f58fc51d12b25f9aab9afa2e6f58227c950d9e Author: Jerome Brunet Date: Tue Apr 21 18:39:30 2020 +0200 arm64: defconfig: enable meson gx audio as module Enable the module config for the Amlogic GX audio card. This module will imply the internal components usually associated with it to make a functional sound card on these platforms. Also enable the simple amplifier module which often used on the output stage of those cards. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Link: https://lore.kernel.org/r/20200421163935.775935-2-jbrunet@baylibre.com commit da1bd29742b185c00a1737ba955aa3e75659be2b Author: Jiaxun Yang Date: Thu Apr 30 11:18:35 2020 +0800 MIPS: Loongson64: Probe CPU features via CPUCFG CPUCFG is a Loongson self-defined instruction used to mark CPU features for Loongson processors started from Loongson-3A4000. Slightly adjust cpu_probe_loongson function as well. Remove features that already probed via decode_configs in processor's PRID case and add a comment about TLBINV. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit b68527dfa952b702142520724d29826b8eb29a31 Author: Jules Irenge Date: Wed Apr 29 23:57:23 2020 +0100 spi: atmel: Add missing annotation for atmel_spi_next_xfer_dma_submit() Sparse reports a warning at atmel_spi_next_xfer_dma_submit() warning: context imbalance in atmel_spi_next_xfer_dma_submit() - unexpected unlock The root cause is the missing annotation at atmel_spi_next_xfer_dma_submit() Add the missing __must_hold(&as->lock) annotation Signed-off-by: Jules Irenge Link: https://lore.kernel.org/r/20200429225723.31258-3-jbi.octave@gmail.com Signed-off-by: Mark Brown commit e9dfbaaeef1c9fee3f3a898defc4562db20c2edf Author: Huacai Chen Date: Thu Apr 30 17:45:16 2020 +0800 MIPS: perf: Add hardware perf events support for new Loongson-3 New Loongson-3 means Loongson-3A R2 (Loongson-3A2000) and newer CPUs. Loongson-3 processors have three types of PMU types (so there are three event maps): Loongson-3A1000/Loonngson-3B1000/Loongson-3B1500 is Type-1, Loongson-3A2000/Loongson-3A3000 is Type-2, Loongson-3A4000+ is Type-3. Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 44220fd84f3fa25208a441ae7a2cf0cf44699655 Author: Tiezhu Yang Date: Thu Apr 30 20:36:24 2020 +0800 MIPS: tools: Show result for loongson3-llsc-check It is better to show the result before loongson3-llsc-check exit, otherwise we can see nothing if the return status is EXIT_SUCCESS, it seems confusing. E.g. without this patch: [loongson@localhost tools]$ ./loongson3-llsc-check ../../../vmlinux [loongson@localhost tools]$ With this patch: [loongson@localhost tools]$ ./loongson3-llsc-check ../../../vmlinux loongson3-llsc-check returns success [loongson@localhost tools]$ Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 6eefaee4f2d366a389da0eb95e524ba82bf358c4 Author: Evan Green Date: Mon Apr 27 16:32:48 2020 -0700 spi: pxa2xx: Apply CS clk quirk to BXT With a couple allies at Intel, and much badgering, I got confirmation from Intel that at least BXT suffers from the same SPI chip-select issue as Cannonlake (and beyond). The issue being that after going through runtime suspend/resume, toggling the chip-select line without also sending data does nothing. Add the quirk to BXT to briefly toggle dynamic clock gating off and on, forcing the fabric to wake up enough to notice the CS register change. Signed-off-by: Evan Green Cc: Shobhit Srivastava Cc: Andy Shevchenko Link: https://lore.kernel.org/r/20200427163238.1.Ib1faaabe236e37ea73be9b8dcc6aa034cb3c8804@changeid Signed-off-by: Mark Brown commit c321022244708aec4675de4f032ef1ba9ff0c640 Author: Jakub Sitnicki Date: Thu Apr 30 12:47:38 2020 +0200 selftests/bpf: Test allowed maps for bpf_sk_select_reuseport Check that verifier allows passing a map of type: BPF_MAP_TYPE_REUSEPORT_SOCKARRARY, or BPF_MAP_TYPE_SOCKMAP, or BPF_MAP_TYPE_SOCKHASH ... to bpf_sk_select_reuseport helper. Suggested-by: John Fastabend Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200430104738.494180-1-jakub@cloudflare.com commit de51696cf5ec9dc834b35b343c45e90091755d06 Author: Jason Yan Date: Sun Apr 26 17:42:28 2020 +0800 i2c: powermac: use true,false for bool variable In i2c_powermac_register_devices(), variable 'found_onyx' is bool and assigned '0' and 'true' in different places. Use 'false' instead of '0'. Signed-off-by: Jason Yan Signed-off-by: Wolfram Sang commit 063e688133914505ddb396cc33231f22f12e0685 Author: Andrii Nakryiko Date: Wed Apr 29 19:14:36 2020 -0700 libbpf: Fix false uninitialized variable warning Some versions of GCC falsely detect that vi might not be initialized. That's not true, but let's silence it with NULL initialization. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200430021436.1522502-1-andriin@fb.com commit 91f658587a962378a410cc7dc90e122a4ccd7cf3 Author: Luke Nelson Date: Wed Apr 29 17:51:27 2020 -0700 bpf, riscv: Fix stack layout of JITed code on RV32 This patch fixes issues with stackframe unwinding and alignment in the current stack layout for BPF programs on RV32. In the current layout, RV32 fp points to the JIT scratch registers, rather than to the callee-saved registers. This breaks stackframe unwinding, which expects fp to point just above the saved ra and fp registers. This patch fixes the issue by moving the callee-saved registers to be stored on the top of the stack, pointed to by fp. This satisfies the assumptions of stackframe unwinding. This patch also fixes an issue with the old layout that the stack was not aligned to 16 bytes. Stacktrace from JITed code using the old stack layout: [ 12.196249 ] [] walk_stackframe+0x0/0x96 Stacktrace using the new stack layout: [ 13.062888 ] [] walk_stackframe+0x0/0x96 [ 13.063028 ] [] show_stack+0x28/0x32 [ 13.063253 ] [] bpf_prog_82b916b2dfa00464+0x80/0x908 [ 13.063417 ] [] bpf_test_run+0x124/0x39a [ 13.063553 ] [] bpf_prog_test_run_skb+0x234/0x448 [ 13.063704 ] [] __do_sys_bpf+0x766/0x13b4 [ 13.063840 ] [] sys_bpf+0xc/0x14 [ 13.063961 ] [] ret_from_syscall+0x0/0x2 The new code is also simpler to understand and includes an ASCII diagram of the stack layout. Tested on riscv32 QEMU virt machine. Signed-off-by: Luke Nelson Signed-off-by: Daniel Borkmann Acked-by: Xi Wang Link: https://lore.kernel.org/bpf/20200430005127.2205-1-luke.r.nels@gmail.com commit 08736e83079929bdbff8ba91c6bdb3d3e57e0abd Author: Dan Carpenter Date: Wed Apr 29 16:23:23 2020 +0300 i2c: stm32f7: prevent array underflow in stm32f7_get_lower_rate() We want to break with "i" set to zero whether we find the rate we want or not. In the current code, if we don't find the rate we want then it exits the loop with "i" set to -1 and results in an array underflow. Fixes: 09cc9a3bce91 ("i2c: stm32f7: allows for any bus frequency") Signed-off-by: Dan Carpenter Reviewed-by: Alain Volmat Signed-off-by: Wolfram Sang commit 354575c00d61c174e0ff070f56cf3cdbe6d23f9e Author: Kajol Jain Date: Thu Apr 2 02:03:40 2020 +0530 perf vendor events power9: Add hv_24x7 socket/chip level metric events The hv_24×7 feature in IBM® POWER9™ processor-based servers provide the facility to continuously collect large numbers of hardware performance metrics efficiently and accurately. This patch adds hv_24x7 metric file for different Socket/chip resources. Result: power9 platform: command:# ./perf stat --metric-only -M Memory_RD_BW_Chip -C 0 -I 1000 1.000096188 0.9 0.3 2.000285720 0.5 0.1 3.000424990 0.4 0.1 command:# ./perf stat --metric-only -M PowerBUS_Frequency -C 0 -I 1000 1.000097981 2.3 2.3 2.000291713 2.3 2.3 3.000421719 2.3 2.3 4.000550912 2.3 2.3 Signed-off-by: Kajol Jain Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-8-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3351c6da896bf521b118bfbb699fbda8f2a816b3 Author: Kajol Jain Date: Thu Apr 2 02:03:39 2020 +0530 perf tools: Enable Hz/hz prinitg for --metric-only option Commit 54b5091606c18 ("perf stat: Implement --metric-only mode") added function 'valid_only_metric()' which drops "Hz" or "hz", if it is part of "ScaleUnit". This patch enable it since hv_24x7 supports couple of frequency events. Signed-off-by: Kajol Jain Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-7-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9022608ec5babbb0fa631234098d52895e7e34d8 Author: Kajol Jain Date: Thu Apr 2 02:03:38 2020 +0530 perf tests expr: Added test for runtime param in metric expression Added test case for parsing "?" in metric expression. Signed-off-by: Kajol Jain Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-6-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 1e1a873dc67fc748cc319a27603f33db91027730 Author: Kajol Jain Date: Thu Apr 2 02:03:37 2020 +0530 perf metricgroups: Enhance JSON/metric infrastructure to handle "?" Patch enhances current metric infrastructure to handle "?" in the metric expression. The "?" can be use for parameters whose value not known while creating metric events and which can be replace later at runtime to the proper value. It also add flexibility to create multiple events out of single metric event added in JSON file. Patch adds function 'arch_get_runtimeparam' which is a arch specific function, returns the count of metric events need to be created. By default it return 1. This infrastructure needed for hv_24x7 socket/chip level events. "hv_24x7" chip level events needs specific chip-id to which the data is requested. Function 'arch_get_runtimeparam' implemented in header.c which extract number of sockets from sysfs file "sockets" under "/sys/devices/hv_24x7/interface/". With this patch basically we are trying to create as many metric events as define by runtime_param. For that one loop is added in function 'metricgroup__add_metric', which create multiple events at run time depend on return value of 'arch_get_runtimeparam' and merge that event in 'group_list'. To achieve that we are actually passing this parameter value as part of `expr__find_other` function and changing "?" present in metric expression with this value. As in our JSON file, there gonna be single metric event, and out of which we are creating multiple events. To understand which data count belongs to which parameter value, we also printing param value in generic_metric function. For example, command:# ./perf stat -M PowerBUS_Frequency -C 0 -I 1000 1.000101867 9,356,933 hv_24x7/pm_pb_cyc,chip=0/ # 2.3 GHz PowerBUS_Frequency_0 1.000101867 9,366,134 hv_24x7/pm_pb_cyc,chip=1/ # 2.3 GHz PowerBUS_Frequency_1 2.000314878 9,365,868 hv_24x7/pm_pb_cyc,chip=0/ # 2.3 GHz PowerBUS_Frequency_0 2.000314878 9,366,092 hv_24x7/pm_pb_cyc,chip=1/ # 2.3 GHz PowerBUS_Frequency_1 So, here _0 and _1 after PowerBUS_Frequency specify parameter value. Signed-off-by: Kajol Jain Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-5-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 454a8be0cff954f18729964317b40ef2c3031364 Author: Shaokun Zhang Date: Wed Apr 29 14:33:12 2020 +0800 perf pmu: Fix function name in comment, its get_cpuid_str(), not get_cpustr() get_cpuid_str() is used in tools/perf/arch/xxx/util/header.c, fix the name in comment. Signed-off-by: Shaokun Zhang Cc: Andi Kleen Link: http://lore.kernel.org/lkml/1588141992-48382-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Arnaldo Carvalho de Melo commit 6fa9c3e779b89612c56f8ee0096b2252d906357a Author: Zou Wei Date: Sun Apr 26 20:38:03 2020 +0800 perf report: Fix warning assignment of 0/1 to bool variable Fixes coccicheck warning: tools/perf/builtin-report.c:1403:2-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1587904683-3510-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 8284bbeab75f1842dc11531356115c4d09abebc0 Author: Zou Wei Date: Tue Apr 28 17:18:43 2020 +0800 perf tools: Remove unneeded semicolons Fixes coccicheck warnings: tools/perf/builtin-diff.c:1565:2-3: Unneeded semicolon tools/perf/builtin-lock.c:778:2-3: Unneeded semicolon tools/perf/builtin-mem.c:126:2-3: Unneeded semicolon tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c:555:2-3: Unneeded semicolon tools/perf/util/ordered-events.c:317:2-3: Unneeded semicolon tools/perf/util/synthetic-events.c:1131:2-3: Unneeded semicolon tools/perf/util/trace-event-read.c:78:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1588065523-71423-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 2cca512ad2fe14d060838eaf8581cda600764141 Author: Zou Wei Date: Tue Apr 28 16:58:56 2020 +0800 perf c2c: Remove unneeded semicolon Fixes coccicheck warnings: tools/perf/builtin-c2c.c:1712:2-3: Unneeded semicolon tools/perf/builtin-c2c.c:1928:2-3: Unneeded semicolon tools/perf/builtin-c2c.c:2962:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1588064336-70456-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit eebe80c982546ce1041b7dcf3c461406f1e7e88f Author: Zou Wei Date: Tue Apr 28 17:12:01 2020 +0800 libtraceevent: Remove unneeded semicolon Fixes coccicheck warning: tools/lib/traceevent/kbuffer-parse.c:441:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Acked-by: Steven Rostedt (VMware) Link: http://lore.kernel.org/lkml/1588065121-71236-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit fad1f1e7dedcd97593e8af36786b6bbdd093990d Author: Stephane Eranian Date: Sat Apr 18 16:19:08 2020 -0700 perf script: Remove extraneous newline in perf_sample__fprintf_regs() When printing iregs, there was a double newline printed because perf_sample__fprintf_regs() was printing its own and then at the end of all fields, perf script was adding one. This was causing blank line in the output: Before: $ perf script -Fip,iregs 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 401b8d ABI:2 DX:0x100 SI:0x4a9340 DI:0x4a8340 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 401b8d ABI:2 DX:0x100 SI:0x4a9340 DI:0x4a8340 After: $ perf script -Fip,iregs 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 401b8d ABI:2 DX:0x100 SI:0x4a9340 DI:0x4a8340 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 Committer testing: First we need to figure out how to request that registers be recorded, so we use: # perf record -h reg Usage: perf record [] [] or: perf record [] -- [] -I, --intr-regs[=] sample selected machine registers on interrupt, use '-I?' to list register names --buildid-all Record build-id of all DSOs regardless of hits --user-regs[=] sample selected machine registers on interrupt, use '--user-regs=?' to list register names # Ok, now lets ask for them all: # perf record -a --intr-regs --user-regs sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 4.105 MB perf.data (2760 samples) ] # Lets look at the first 6 output lines: # perf script -Fip,iregs | head -6 ffffffff8a06f2f4 ABI:2 AX:0xffffd168fee0a980 BX:0xffff8a23b087f000 CX:0xfffeb69aaeb25d73 DX:0xffff8a253e8310f0 SI:0xfffffff9bafe7359 DI:0xffffb1690204fb10 BP:0xffffd168fee0a950 SP:0xffffb1690204fb88 IP:0xffffffff8a06f2f4 FLAGS:0x4e CS:0x10 SS:0x18 R8:0x1495f0a91129a R9:0xffff8a23b087f000 R10:0x1 R11:0xffffffff R12:0x0 R13:0xffff8a253e827e00 R14:0xffffd168fee0aa5c R15:0xffffd168fee0a980 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0xffffd168fee0a950 CX:0x5684cc1118491900 DX:0x0 SI:0xffffd168fee0a9d0 DI:0x202 BP:0xffffb1690204fd70 SP:0xffffb1690204fd20 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x18 R8:0x0 R9:0xffffd168fee0a9d0 R10:0x1 R11:0xffffffff R12:0xffffffff8a23e480 R13:0xffff8a23b087f240 R14:0xffff8a23b087f000 R15:0xffffd168fee0a950 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0x0 CX:0x7f25f334335b DX:0x0 SI:0x2400 DI:0x4 BP:0x7fff5f264570 SP:0x7fff5f264538 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x2b R8:0x0 R9:0x2312d20 R10:0x0 R11:0x246 R12:0x22cc0e0 R13:0x0 R14:0x0 R15:0x22d0780 # Reproduced, apply the patch and: [root@five ~]# perf script -Fip,iregs | head -6 ffffffff8a06f2f4 ABI:2 AX:0xffffd168fee0a980 BX:0xffff8a23b087f000 CX:0xfffeb69aaeb25d73 DX:0xffff8a253e8310f0 SI:0xfffffff9bafe7359 DI:0xffffb1690204fb10 BP:0xffffd168fee0a950 SP:0xffffb1690204fb88 IP:0xffffffff8a06f2f4 FLAGS:0x4e CS:0x10 SS:0x18 R8:0x1495f0a91129a R9:0xffff8a23b087f000 R10:0x1 R11:0xffffffff R12:0x0 R13:0xffff8a253e827e00 R14:0xffffd168fee0aa5c R15:0xffffd168fee0a980 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0xffffd168fee0a950 CX:0x5684cc1118491900 DX:0x0 SI:0xffffd168fee0a9d0 DI:0x202 BP:0xffffb1690204fd70 SP:0xffffb1690204fd20 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x18 R8:0x0 R9:0xffffd168fee0a9d0 R10:0x1 R11:0xffffffff R12:0xffffffff8a23e480 R13:0xffff8a23b087f240 R14:0xffff8a23b087f000 R15:0xffffd168fee0a950 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0x0 CX:0x7f25f334335b DX:0x0 SI:0x2400 DI:0x4 BP:0x7fff5f264570 SP:0x7fff5f264538 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x2b R8:0x0 R9:0x2312d20 R10:0x0 R11:0x246 R12:0x22cc0e0 R13:0x0 R14:0x0 R15:0x22d0780 ffffffff8a24074b ABI:2 AX:0xcb BX:0xcb CX:0x0 DX:0x0 SI:0xffffb1690204ff58 DI:0xcb BP:0xffffb1690204ff58 SP:0xffffb1690204ff40 IP:0xffffffff8a24074b FLAGS:0x24e CS:0x10 SS:0x18 R8:0x0 R9:0x0 R10:0x0 R11:0x0 R12:0x0 R13:0x0 R14:0x0 R15:0x0 ffffffff8a310600 ABI:2 AX:0x0 BX:0xffffffff8b8c39a0 CX:0x0 DX:0xffff8a2503890300 SI:0xffffb1690204ff20 DI:0xffff8a23e4080000 BP:0xffff8a23e4080000 SP:0xffffb1690204fec0 IP:0xffffffff8a310600 FLAGS:0x28e CS:0x10 SS:0x18 R8:0x0 R9:0x0 R10:0x0 R11:0x0 R12:0xffffffffffffffea R13:0xffff8a23e4080020 R14:0x0 R15:0x0 ffffffff8a11b688 ABI:2 AX:0x0 BX:0xffff8a237b7c8800 CX:0xffffb1690204fae0 DX:0x78 SI:0xffff8a237b7c8800 DI:0xffffb1690204fa10 BP:0xffffb1690204fb00 SP:0xffffb1690204fa00 IP:0xffffffff8a11b688 FLAGS:0x8a CS:0x10 SS:0x18 R8:0x1495f0a917eba R9:0xffffd168fde19a48 R10:0xffffb1690204fd98 R11:0xffff8a253e82afb0 R12:0xffff8a237b7c8800 R13:0xffffb1690204fb00 R14:0x0 R15:0xffff8a237b7c8800 [root@five ~]# To see it more clearly, lets get just two of those registers by sample: # perf record -a --intr-regs=ax,bx --user-regs=cx,dx sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 3.502 MB perf.data (1653 samples) ] # Extra info, lets see what gets setup in that 'struct perf_event_attr': # perf evlist -v cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|REGS_USER|REGS_INTR, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 2, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, sample_regs_user: 0xc, sample_regs_intr: 0x3 # Cook, some PERF_SAMPLE_REGS_USER|PERF_SAMPLE_REGS_INTR + attr.sample_regs_user and attr.sample_regs_intr register masks, now lets see if those newlines are gone in a more compact fashion: # perf script -Fip,iregs,uregs ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a29b78d ABI:2 AX:0x2a20ffcd6000 BX:0x2ec7d9000 ABI:2 CX:0x7f204460e49b DX:0xf42920 # And where was that? # perf script -Fip,iregs,uregs,sym,dso ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a29b78d __vma_link_rb (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0x2a20ffcd6000 BX:0x2ec7d9000 ABI:2 CX:0x7f204460e49b DX:0xf42920 # Signed-off-by: Stephane Eranian Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200418231908.152212-1-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2069425eb3f8257e6e73548030fe65d5f0faca0d Author: Ian Rogers Date: Tue Apr 14 22:40:50 2020 -0700 perf synthetic events: Remove use of sscanf from /proc reading The synthesize benchmark, run on a single process and thread, shows perf_event__synthesize_mmap_events as the hottest function with fgets and sscanf taking the majority of execution time. fscanf performs similarly well. Replace the scanf call with manual reading of each field of the /proc/pid/maps line, and remove some unnecessary buffering. This change also addresses potential, but unlikely, buffer overruns for the string values read by scanf. Performance before is: $ sudo perf bench internals synthesize -m 16 -M 16 -s -t \# Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 102.810 usec (+- 0.027 usec) Average num. events: 17.000 (+- 0.000) Average time per event 6.048 usec Average data synthesis took: 106.325 usec (+- 0.018 usec) Average num. events: 89.000 (+- 0.000) Average time per event 1.195 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 16 Average synthesis took: 68103.100 usec (+- 441.234 usec) Average num. events: 30703.000 (+- 0.730) Average time per event 2.218 usec And after is: $ sudo perf bench internals synthesize -m 16 -M 16 -s -t \# Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 50.388 usec (+- 0.031 usec) Average num. events: 17.000 (+- 0.000) Average time per event 2.964 usec Average data synthesis took: 52.693 usec (+- 0.020 usec) Average num. events: 89.000 (+- 0.000) Average time per event 0.592 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 16 Average synthesis took: 45022.400 usec (+- 552.740 usec) Average num. events: 30624.200 (+- 10.037) Average time per event 1.470 usec On a Intel Xeon 6154 compiling with Debian gcc 9.2.1. Committer testing: On a AMD Ryzen 5 3600X 6-Core Processor: Before: # perf bench internals synthesize --min-threads 12 --max-threads 12 --st --mt # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 267.491 usec (+- 0.176 usec) Average num. events: 56.000 (+- 0.000) Average time per event 4.777 usec Average data synthesis took: 277.257 usec (+- 0.169 usec) Average num. events: 287.000 (+- 0.000) Average time per event 0.966 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 12 Average synthesis took: 81599.500 usec (+- 346.315 usec) Average num. events: 36096.100 (+- 2.523) Average time per event 2.261 usec # After: # perf bench internals synthesize --min-threads 12 --max-threads 12 --st --mt # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 110.125 usec (+- 0.080 usec) Average num. events: 56.000 (+- 0.000) Average time per event 1.967 usec Average data synthesis took: 118.518 usec (+- 0.057 usec) Average num. events: 287.000 (+- 0.000) Average time per event 0.413 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 12 Average synthesis took: 43490.700 usec (+- 284.527 usec) Average num. events: 37028.500 (+- 0.563) Average time per event 1.175 usec # Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andrey Zhizhikin Cc: Jiri Olsa Cc: Kan Liang Cc: Kefeng Wang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200415054050.31645-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e95770af4c4a280fab2080529d30452a7628d45d Author: Ian Rogers Date: Tue Apr 14 22:40:49 2020 -0700 tools api: Add a lightweight buffered reading api The synthesize benchmark shows the majority of execution time going to fgets and sscanf, necessary to parse /proc/pid/maps. Add a new buffered reading library that will be used to replace these calls in a follow-up CL. Add tests for the library to perf test. Committer tests: $ perf test api 63: Test api io : Ok $ Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andrey Zhizhikin Cc: Jiri Olsa Cc: Kan Liang Cc: Kefeng Wang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200415054050.31645-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 13edc237200c75425ab0e3fe4b4c75dafb468c2e Author: Ian Rogers Date: Tue Apr 14 22:40:48 2020 -0700 perf bench: Add a multi-threaded synthesize benchmark By default this isn't run as it reads /proc and may not have access. For consistency, modify the single threaded benchmark to compute an average time per event. Committer testing: $ grep -m1 "model name" /proc/cpuinfo model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz $ grep "model name" /proc/cpuinfo | wc -l 8 $ $ perf bench internals synthesize -h # Running 'internals/synthesize' benchmark: Usage: perf bench internals synthesize -I, --multi-iterations Number of iterations used to compute multi-threaded average -i, --single-iterations Number of iterations used to compute single-threaded average -M, --max-threads Maximum number of threads in multithreaded bench -m, --min-threads Minimum number of threads in multithreaded bench -s, --st Run single threaded benchmark -t, --mt Run multi-threaded benchmark $ $ perf bench internals synthesize -t # Running 'internals/synthesize' benchmark: Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 1 Average synthesis took: 65449.000 usec (+- 586.442 usec) Average num. events: 9405.400 (+- 0.306) Average time per event 6.959 usec Number of synthesis threads: 2 Average synthesis took: 37838.300 usec (+- 130.259 usec) Average num. events: 9501.800 (+- 20.469) Average time per event 3.982 usec Number of synthesis threads: 3 Average synthesis took: 48551.400 usec (+- 225.686 usec) Average num. events: 9544.000 (+- 0.000) Average time per event 5.087 usec Number of synthesis threads: 4 Average synthesis took: 29632.500 usec (+- 50.808 usec) Average num. events: 9544.000 (+- 0.000) Average time per event 3.105 usec Number of synthesis threads: 5 Average synthesis took: 33920.400 usec (+- 284.509 usec) Average num. events: 9544.000 (+- 0.000) Average time per event 3.554 usec Number of synthesis threads: 6 Average synthesis took: 27604.100 usec (+- 72.344 usec) Average num. events: 9548.000 (+- 0.000) Average time per event 2.891 usec Number of synthesis threads: 7 Average synthesis took: 25406.300 usec (+- 933.371 usec) Average num. events: 9545.500 (+- 0.167) Average time per event 2.662 usec Number of synthesis threads: 8 Average synthesis took: 24110.400 usec (+- 73.229 usec) Average num. events: 9551.000 (+- 0.000) Average time per event 2.524 usec $ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andrey Zhizhikin Cc: Kan Liang Cc: Kefeng Wang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200415054050.31645-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e8e7ef43c73328276e1d446b02ae16006742ebb1 Merge: c03d58214c6d 4642126b852f Author: Mark Brown Date: Thu Apr 30 14:39:46 2020 +0100 Merge series "ASoC: rt5682: apply some refactors" from Tzung-Bi Shih : The series tries to refactor the coding style to follow most conventions. The 4th patch converts pr_() to dev_(). (https://mailman.alsa-project.org/pipermail/alsa-devel/2020-March/164849.html) The 6th patch changes the behavior a bit to restore its original intent. Tzung-Bi Shih (6): ASoC: rt5682: simplify assertions ASoC: rt5682: fix space issues ASoC: rt5682: remove empty default case ASoC: rt5682: replace message printing from pr_() to dev_() ASoC: rt5682: remove duplicate rt5682_reset() calls ASoC: rt5682: remove unwanted btn_type assignment sound/soc/codecs/rt5682.c | 198 ++++++++++++++++---------------------- 1 file changed, 84 insertions(+), 114 deletions(-) -- 2.26.2.303.gf8c07b1a785-goog commit c03d58214c6dd1ae43267c0d6b554ea4a72291b1 Merge: f9dfa8f25462 fd045558295e Author: Mark Brown Date: Thu Apr 30 14:39:45 2020 +0100 Merge series "SOF topology parsing updates" from Ranjani Sridharan : This series includes updates in the topology parser for DAIs and their config. The first three patches address the problem of sending the DAI config to the DSP when there are multiple DAIs associated with a DAI link. The last patch deals with setting the default trigger order for all links. Exceptions needed for HDA links are moved to the DAI link fixup() callback. Bard Liao (3): ASoC: SOF: topology: send ipc for all found DAIs in sof_set_dai_config ASoC: topology: set component dai_index to ipc dai config dai_index ASoC: SOF: topology: replace sof_link_hda_process by sof_set_dai_config randerwang (1): ASoC: SOF: Intel: change trigger sequence to fix pop noise when stopping playback on sdw platforms sound/soc/sof/pcm.c | 12 ++- sound/soc/sof/topology.c | 167 ++++++++++----------------------------- 2 files changed, 51 insertions(+), 128 deletions(-) -- 2.17.1 commit f9dfa8f25462a2b9bb47dcb563688d616e21ee83 Author: Arnd Bergmann Date: Tue Apr 28 23:27:36 2020 +0200 ASoC: SOF: sort out Kconfig, again The imx8 config keeps causing issues: WARNING: unmet direct dependencies detected for SND_SOC_SOF_IMX8M Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_IMX_TOPLEVEL [=y] && IMX_DSP [=n] Selected by [m]: - SND_SOC_SOF_IMX_OF [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_IMX_TOPLEVEL [=y] && SND_SOC_SOF_IMX8M_SUPPORT [=y] This is complicated by two drivers having dependencies on both platform specific drivers and the SND_SOC_SOF_OF framework code, and using an somewhat obscure method to build them the same way as the SOC_SOF_OF symbol (built-in or modular). My solution now ensures that the two drivers can only be enabled when the dependencies are met: - When the platform specific drivers are built-in, everything is fine, as SOC_SOF_OF is either =y or =m - When both are loadable modules, it also works, both for Kconfig and at runtime - When the hardware drivers are loadable modules or disabled, and SOC_SOF_OF=y, prevent the IMX_SOF_OF drivers from being turned on, as this would be broken. It seems that this is just an elaborate way to describe two tristate symbols that have straight dependencies, but maybe I'm missing some subtle point. It seems to always build for me now. Fixes: fe57a92c8858 ("ASoC: SOF: Add missing dependency on IMX_SCU") Fixes: afb93d716533 ("ASoC: SOF: imx: Add i.MX8M HW support") Fixes: cb0312f61c3e ("ASoC: SOF: imx: fix undefined reference issue") Fixes: afb93d716533dd ("ASoC: SOF: imx: Add i.MX8M HW support") Signed-off-by: Arnd Bergmann Signed-off-by: Pierre-Louis Bossart Acked-by: Daniel Baluta Link: https://lore.kernel.org/r/20200428212752.2901778-1-arnd@arndb.de Signed-off-by: Mark Brown commit f7a8bc1cf0b21c6d10ea17b2afc760bf490a25ba Author: Vinod Koul Date: Fri Apr 24 15:59:43 2020 +0530 arm64: defconfig: Enable SM8250 GCC driver Enable the SM8250 GCC driver so that we can boot to shell with defconfig Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20200424102943.2368764-1-vkoul@kernel.org Signed-off-by: Bjorn Andersson commit 4642126b852f46d5d6a16bc60d50fbe4920c2710 Author: Tzung-Bi Shih Date: Thu Apr 30 16:22:31 2020 +0800 ASoC: rt5682: remove unwanted btn_type assignment The following dev_err() is intended to print unexpected btn_type. Removes the unwanted btn_type assignment. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200430082231.151127-7-tzungbi@google.com Signed-off-by: Mark Brown commit 2317e84979fb80821c0d3ef909f1a2b68ace37f9 Author: Tzung-Bi Shih Date: Thu Apr 30 16:22:30 2020 +0800 ASoC: rt5682: remove duplicate rt5682_reset() calls Removes duplicate rt5682_reset() calls. rt5682_calibrate() calls rt5682_reset() anyway. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200430082231.151127-6-tzungbi@google.com Signed-off-by: Mark Brown commit 9c1cb755b5b325c18551f7d08438ea6896130acd Author: Tzung-Bi Shih Date: Thu Apr 30 16:22:29 2020 +0800 ASoC: rt5682: replace message printing from pr_() to dev_() Replaces message printing from pr_() to dev_(). Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200430082231.151127-5-tzungbi@google.com Signed-off-by: Mark Brown commit 70255cf6917828a2caf93f79f15a09bd71803e61 Author: Tzung-Bi Shih Date: Thu Apr 30 16:22:28 2020 +0800 ASoC: rt5682: remove empty default case Removes empty default case. Also adds a missing break statement. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200430082231.151127-4-tzungbi@google.com Signed-off-by: Mark Brown commit 5b8e09091b6092296a209a940e192ed2cc891efe Author: Tzung-Bi Shih Date: Thu Apr 30 16:22:27 2020 +0800 ASoC: rt5682: fix space issues Fixes blank lines and indent issues. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200430082231.151127-3-tzungbi@google.com Signed-off-by: Mark Brown commit 38c2e325a66b1c4d694d2a15b5efa81e5ae38872 Author: Tzung-Bi Shih Date: Thu Apr 30 16:22:26 2020 +0800 ASoC: rt5682: simplify assertions Simplifies assertions for errors. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200430082231.151127-2-tzungbi@google.com Signed-off-by: Mark Brown commit fd045558295e5dab4ebe3176401bafa7090fa007 Author: randerwang Date: Mon Apr 27 10:29:39 2020 -0700 ASoC: SOF: Intel: change trigger sequence to fix pop noise when stopping playback on sdw platforms Now the trigger sequence is set to SND_SOC_DPCM_TRIGGER_POST for SOF. This means FE will be stopped before BE, so BE will consume invalid data and this generates huge pop noise. This sequence is introduced for HDA DAI which requires SND_SOC_DPCM_TRIGGER_POST for some reasons. Now set default trigger sequence to SND_SOC_DPCM_TRIGGER_PRE for playback with all DAI and fix sequence only for HDA DAI. Fully tested on Comet Lake for a few cycles. Signed-off-by: randerwang Signed-off-by: Ranjani Sridharan Reviewed-by: Clarex Zhou Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200427172939.25848-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit ac764249485189fa0f019e48aeed7175c7b5376b Author: Bard Liao Date: Mon Apr 27 10:29:38 2020 -0700 ASoC: SOF: topology: replace sof_link_hda_process by sof_set_dai_config Now we send ipc in sof_set_dai_config(), too. Therefore, we can use sof_set_dai_config() in sof_link_hda_load() just like other link load functions do. Signed-off-by: Bard Liao Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200427172939.25848-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 744a3bb3b4b6c4073ae9381a02c9824b29dd1a05 Author: Bard Liao Date: Mon Apr 27 10:29:37 2020 -0700 ASoC: topology: set component dai_index to ipc dai config dai_index The ipc dai config dai_index is from topology. However, the same dai config will be applied to all DAIs in the same dai link. We have to ensure that the ipc dai config's dai_index match to the component's dai_index. Signed-off-by: Bard Liao Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200427172939.25848-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 726e6142b5c99b407a8118330598f82ba63617c3 Author: Bard Liao Date: Mon Apr 27 10:29:36 2020 -0700 ASoC: SOF: topology: send ipc for all found DAIs in sof_set_dai_config We may find more than one DAIs in sof_set_dai_config() and we should send message to DSP for each DAI we found. Signed-off-by: Bard Liao Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200427172939.25848-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 2dd8083f6d8acd1371ccabedef1c9f1ad272a90d Merge: 1dd694a1b72f 964987738b3f Author: Eric W. Biederman Date: Thu Apr 30 06:43:44 2020 -0500 posix-cpu-timers: Use pids not tasks in lookup The current posix-cpu-timer code uses pids when holding persistent references in timers. However the lookups from clock_id_t still return tasks that need to be converted into pids for use. This results in usage being pid->task->pid and that can race with release_task and de_thread. This can lead to some not wrong but surprising results. Surprising enough that Oleg and I both thought there were some bugs in the code for a while. This set of changes modifies the code to just lookup, verify, and return pids from the clockid_t lookups to remove those potentialy troublesome races. Eric W. Biederman (3): posix-cpu-timers: Extend rcu_read_lock removing task_struct references posix-cpu-timers: Replace cpu_timer_pid_type with clock_pid_type posix-cpu-timers: Replace __get_task_for_clock with pid_for_clock kernel/time/posix-cpu-timers.c | 102 ++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 57 deletions(-) Suggested-by: Oleg Nesterov Signed-off-by: "Eric W. Biederman" commit 1dd694a1b72f69a3add938f4b5bfb4cf9914b133 Author: Oleg Nesterov Date: Tue Apr 21 12:19:04 2020 +0200 remove the no longer needed pid_alive() check in __task_pid_nr_ns() Starting from 2c4704756cab ("pids: Move the pgrp and session pid pointers from task_struct to signal_struct") __task_pid_nr_ns() doesn't dereference task->group_leader, we can remove the pid_alive() check. pid_nr_ns() has to check pid != NULL anyway, pid_alive() just adds the unnecessary confusion. Signed-off-by: Oleg Nesterov Reviewed-by: "Eric W. Biederman" Acked-by: Christian Brauner Signed-off-by: Eric W. Biederman commit 06576edd0e802cf72a7edaaa2fba7da7b94efaae Merge: 507122805edd bbd40fc4816d Author: Eric W. Biederman Date: Thu Apr 30 06:18:01 2020 -0500 Removing has_group_leader_pid With de_thread now calling exchange_tids has_group_leader_pid no longer makes any sense and is equivalent to calling thread_group_leader. As there are only 2 remaining users of has_group_leader_pid let's update the code and get rid of has_group_leader_pid. There is one extra patch to lookup_task that performs that unifies to code paths that become identical when has_group_leader_pid went away. Eric W. Biederman (4): posix-cpu-timer: Tidy up group_leader logic in lookup_task posix-cpu-timer: Unify the now redundant code in lookup_task exec: Remove BUG_ON(has_group_leader_pid) signal: Remove has_group_leader_pid fs/exec.c | 1 - include/linux/sched/signal.h | 11 ----------- kernel/time/posix-cpu-timers.c | 21 ++++++++------------- 3 files changed, 8 insertions(+), 25 deletions(-) Signed-off-by: "Eric W. Biederman" commit 8382f2949a0def8e9519603b77b3c26f81a66576 Author: Ranjani Sridharan Date: Mon Apr 27 09:29:53 2020 -0700 ASoC: Intel: broadwell: Fix oops during module removal When removing the SOF module, the RT286 jack detect handler will oops if jack detection is not disabled. Disable the jack in the machine driver remove callback to prevent this. This fix is only for SOF support and is not needed for earlier versions. Signed-off-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200427162953.21107-1-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 081df76a040df3e31e78df4ca9106eb114dabc6a Author: Thierry Reding Date: Fri Apr 3 19:46:57 2020 +0200 of: reserved-memory: Support multiple regions per device While the lookup/initialization code already supports multiple memory regions per device, the release code will only ever release the first matching memory region. Enhance the code to release all matching regions. Each attachment of a region to a device is uniquely identifiable using a struct device pointer and a pointer to the memory region's struct reserved_mem. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 0da0e31600e8a42c6f1dfaa7a06211c8bb243ea7 Author: Thierry Reding Date: Fri Apr 3 19:44:52 2020 +0200 of: reserved-memory: Support lookup of regions by name Add support for looking up memory regions by name. This looks up the given name in the newly introduced memory-region-names property and returns the memory region at the corresponding index in the memory- region(s) property. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 17bc43367fc2a720400d21c745db641c654c1e6b Author: Christophe Leroy Date: Fri Apr 17 17:08:52 2020 +0000 powerpc/uaccess: Implement unsafe_copy_to_user() as a simple loop At the time being, unsafe_copy_to_user() is based on raw_copy_to_user() which calls __copy_tofrom_user(). __copy_tofrom_user() is a big optimised function to copy big amount of data. It aligns destinations to cache line in order to use dcbz instruction. Today unsafe_copy_to_user() is called only from filldir(). It is used to mainly copy small amount of data like filenames, so __copy_tofrom_user() is not fit. Also, unsafe_copy_to_user() is used within user_access_begin/end sections. In those section, it is preferable to not call functions. Rewrite unsafe_copy_to_user() as a macro that uses __put_user_goto(). We first perform a loop of long, then we finish with necessary complements. unsafe_copy_to_user() might be used in the near future to copy fixed-size data, like pt_regs structs during signal processing. Having it as a macro allows GCC to optimise it for instead when it knows the size in advance, it can unloop loops, drop complements when the size is a multiple of longs, etc ... Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fe952112c29bf6a0a2778c9e6bbb4f4afd2c4258.1587143308.git.christophe.leroy@c-s.fr commit 334710b1496af8a0960e70121f850e209c20958f Author: Christophe Leroy Date: Fri Apr 17 17:08:51 2020 +0000 powerpc/uaccess: Implement unsafe_put_user() using 'asm goto' unsafe_put_user() is designed to take benefit of 'asm goto'. Instead of using the standard __put_user() approach and branch based on the returned error, use 'asm goto' and make the exception code branch directly to the error label. There is no code anymore in the fixup section. This change significantly simplifies functions using unsafe_put_user() Small exemple of the benefit with the following code: struct test { u32 item1; u16 item2; u8 item3; u64 item4; }; int set_test_to_user(struct test __user *test, u32 item1, u16 item2, u8 item3, u64 item4) { unsafe_put_user(item1, &test->item1, failed); unsafe_put_user(item2, &test->item2, failed); unsafe_put_user(item3, &test->item3, failed); unsafe_put_user(item4, &test->item4, failed); return 0; failed: return -EFAULT; } Before the patch: 00000be8 : be8: 39 20 00 00 li r9,0 bec: 90 83 00 00 stw r4,0(r3) bf0: 2f 89 00 00 cmpwi cr7,r9,0 bf4: 40 9e 00 38 bne cr7,c2c bf8: b0 a3 00 04 sth r5,4(r3) bfc: 2f 89 00 00 cmpwi cr7,r9,0 c00: 40 9e 00 2c bne cr7,c2c c04: 98 c3 00 06 stb r6,6(r3) c08: 2f 89 00 00 cmpwi cr7,r9,0 c0c: 40 9e 00 20 bne cr7,c2c c10: 90 e3 00 08 stw r7,8(r3) c14: 91 03 00 0c stw r8,12(r3) c18: 21 29 00 00 subfic r9,r9,0 c1c: 7d 29 49 10 subfe r9,r9,r9 c20: 38 60 ff f2 li r3,-14 c24: 7d 23 18 38 and r3,r9,r3 c28: 4e 80 00 20 blr c2c: 38 60 ff f2 li r3,-14 c30: 4e 80 00 20 blr 00000000 <.fixup>: ... b8: 39 20 ff f2 li r9,-14 bc: 48 00 00 00 b bc <.fixup+0xbc> bc: R_PPC_REL24 .text+0xbf0 c0: 39 20 ff f2 li r9,-14 c4: 48 00 00 00 b c4 <.fixup+0xc4> c4: R_PPC_REL24 .text+0xbfc c8: 39 20 ff f2 li r9,-14 cc: 48 00 00 00 b cc <.fixup+0xcc> d0: 39 20 ff f2 li r9,-14 d4: 48 00 00 00 b d4 <.fixup+0xd4> d4: R_PPC_REL24 .text+0xc18 00000000 <__ex_table>: ... a0: R_PPC_REL32 .text+0xbec a4: R_PPC_REL32 .fixup+0xb8 a8: R_PPC_REL32 .text+0xbf8 ac: R_PPC_REL32 .fixup+0xc0 b0: R_PPC_REL32 .text+0xc04 b4: R_PPC_REL32 .fixup+0xc8 b8: R_PPC_REL32 .text+0xc10 bc: R_PPC_REL32 .fixup+0xd0 c0: R_PPC_REL32 .text+0xc14 c4: R_PPC_REL32 .fixup+0xd0 After the patch: 00000be8 : be8: 90 83 00 00 stw r4,0(r3) bec: b0 a3 00 04 sth r5,4(r3) bf0: 98 c3 00 06 stb r6,6(r3) bf4: 90 e3 00 08 stw r7,8(r3) bf8: 91 03 00 0c stw r8,12(r3) bfc: 38 60 00 00 li r3,0 c00: 4e 80 00 20 blr c04: 38 60 ff f2 li r3,-14 c08: 4e 80 00 20 blr 00000000 <__ex_table>: ... a0: R_PPC_REL32 .text+0xbe8 a4: R_PPC_REL32 .text+0xc04 a8: R_PPC_REL32 .text+0xbec ac: R_PPC_REL32 .text+0xc04 b0: R_PPC_REL32 .text+0xbf0 b4: R_PPC_REL32 .text+0xc04 b8: R_PPC_REL32 .text+0xbf4 bc: R_PPC_REL32 .text+0xc04 c0: R_PPC_REL32 .text+0xbf8 c4: R_PPC_REL32 .text+0xc04 Signed-off-by: Christophe Leroy Reviewed-by: Segher Boessenkool Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/23e680624680a9a5405f4b88740d2596d4b17c26.1587143308.git.christophe.leroy@c-s.fr commit ef54569966f7b3090a6f1e4bd61db7f2ff2a62f9 Author: Jason Yan Date: Wed Apr 29 22:10:10 2020 +0800 drm/ast: remove duplicate assignment of ast_crtc_funcs member The struct member 'set_config' was assigned twice: static const struct drm_crtc_funcs ast_crtc_funcs = { .reset = ast_crtc_reset, .set_config = drm_crtc_helper_set_config, ...... .set_config = drm_atomic_helper_set_config, ...... }; Since the second one is which we use now in fact, we can remove the first one. This fixes the following coccicheck warning: drivers/gpu/drm/ast/ast_mode.c:932:50-51: set_config: first occurrence line 934, second occurrence line 937 Signed-off-by: Jason Yan Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200429141010.8445-1-yanaijie@huawei.com commit 230982d8d8df7f9d9aa216840ea2db1df6ad5d37 Author: Joonas Lahtinen Date: Thu Apr 30 11:13:21 2020 +0300 drm/i915: Update DRIVER_DATE to 20200430 Signed-off-by: Joonas Lahtinen commit 2f71832755a9422f5a62a13ea3e805df7b173837 Author: Lad Prabhakar Date: Thu Apr 23 22:40:45 2020 +0100 soc: renesas: rcar-rst: Add support for RZ/G1H Add support for RZ/G1H (R8A7742) to the R-Car RST driver. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-6-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5b9fa9cbe654ed0a138fd2dd6b79a19125f3c3e2 Author: Lad Prabhakar Date: Thu Apr 23 22:40:43 2020 +0100 soc: renesas: rcar-sysc: Add R8A7742 support Add support for RZ/G1H (R8A7742) SoC power areas to the R-Car SYSC driver. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 8b46ed57f34df111c224d4319c891b43e0e03806 Merge: 79eb8c7f015a fb55c7355223 Author: Joonas Lahtinen Date: Thu Apr 30 10:53:20 2020 +0300 Merge tag 'gvt-next-2020-04-22' of https://github.com/intel/gvt-linux into drm-intel-next-queued gvt-next-2020-04-22 - remove non-upstream xen support bits (Christoph) - guest context shadow copy optimization (Yan) - guest context tracking for shadow skip optimization (Yan) Signed-off-by: Joonas Lahtinen From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20200422051230.GH11247@zhen-hp.sh.intel.com commit e2f022c10ed3b50ba1d2bb1f037b0e7a84cb1c3e Author: Geert Uytterhoeven Date: Mon Apr 27 21:34:46 2020 +0200 clk: renesas: rcar-gen2: Remove superfluous CLK_RENESAS_DIV6 selects CLK_RENESAS_CPG_MSSR selects CLK_RENESAS_DIV6, and CLK_RCAR_GEN2_CPG selects CLK_RENESAS_CPG_MSSR, so there is no longer a need for the individual R-Car Gen2 clock driver options to select CLK_RENESAS_DIV6. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20200427193446.29738-1-geert+renesas@glider.be commit e8208a71ac0be22afccf5ccc7d5bc6c7a351bc18 Author: Lad Prabhakar Date: Mon Apr 27 15:41:00 2020 +0100 clk: renesas: cpg-mssr: Add R8A7742 support Add RZ/G1H (R8A7742) Clock Pulse Generator / Module Standby and Software Reset support, using the CPG/MSSR driver core and the common R-Car Gen2 (and RZ/G) code. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587998460-7804-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 79eb8c7f015a6c2b307b86ca4176c5f0ed987219 Author: Zbigniew Kempczyński Date: Thu Apr 30 07:49:57 2020 +0100 drm/i915/selftests: Add tiled blits selftest Extend coverage of the blitter client by exercising conversion to and from tiled sources. In the process we perform spot checks to verify that the tiling/detiling is being applied correctly, along with position invariance of the tiling parameters. Signed-off-by: Zbigniew Kempczyński Cc: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200430064957.14942-1-chris@chris-wilson.co.uk commit 12b3cf9093542d9f752a4968815ece836159013f Author: Tang Bin Date: Sat Apr 25 22:24:14 2020 +0800 crypto: bcm - Fix unused assignment Delete unused initialized value in cipher.c file. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: Herbert Xu commit 42a13ddbab00455504d50ef159360f7451d597e4 Author: Tang Bin Date: Sat Apr 25 22:22:58 2020 +0800 crypto: bcm - Remove the unnecessary cast for PTR_ERR(). It's not necessary to specify 'int' casting for PTR_ERR(). Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: Herbert Xu commit d6fc1a4592219b9ccb85854282d0e59d35fddebc Author: Corentin Labbe Date: Fri Apr 24 13:40:47 2020 +0000 crypto: drbg - should select CTR if CRYPTO_DRBG_CTR is builtin and CTR is module, allocating such algo will fail. DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_pr_ctr_aes128 DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_nopr_ctr_aes128 DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_nopr_ctr_aes192 DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_nopr_ctr_aes256 So let's select CTR instead of just depend on it. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit f23efcbcc523b09c2ee359a35eb3897dc1764fd3 Author: Corentin Labbe Date: Fri Apr 24 13:40:46 2020 +0000 crypto: ctr - no longer needs CRYPTO_SEQIV As comment of the v2, Herbert said: "The SEQIV select from CTR is historical and no longer necessary." So let's get rid of it. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 43f3c2b4dde331d380e4f575d3e5798f27867b3e Author: Zou Wei Date: Thu Apr 23 20:21:21 2020 +0800 hwrng: cctrng - Make some symbols static Fix the following sparse warnings: drivers/char/hw_random/cctrng.c:316:6: warning: symbol 'cc_trng_compwork_handler' was not declared. Should it be static? drivers/char/hw_random/cctrng.c:451:6: warning: symbol 'cc_trng_startwork_handler' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Acked-by: Hadar Gat Signed-off-by: Herbert Xu commit d0f6223c0dc5196ef684657f6b77d4fa5fca2020 Author: Zou Wei Date: Thu Apr 23 10:22:36 2020 +0800 crypto: hisilicon/qm - Make qm_controller_reset() static Fix the following sparse warning: drivers/crypto/hisilicon/qm.c:3079:5: warning: symbol 'qm_controller_reset' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu commit 1c8414dadb8c5668ee4d20d7dfbb478db52d1ab0 Author: Andy Shevchenko Date: Wed Apr 22 15:58:08 2020 +0300 hwrng: optee - Use UUID API for exporting the UUID There is export_uuid() function which exports uuid_t to the u8 array. Use it instead of open coding variant. This allows to hide the uuid_t internals. Signed-off-by: Andy Shevchenko Reviewed-by: Sumit Garg Signed-off-by: Herbert Xu commit 18f1ca46858eac22437819937ae44aa9a8f9f2fa Author: Nathan Chancellor Date: Tue Apr 21 14:47:04 2020 -0700 lib/mpi: Fix 64-bit MIPS build with Clang When building 64r6_defconfig with CONFIG_MIPS32_O32 disabled and CONFIG_CRYPTO_RSA enabled: lib/mpi/generic_mpih-mul1.c:37:24: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/mpi/longlong.h:664:22: note: expanded from macro 'umul_ppmm' : "=d" ((UDItype)(w0)) ~~~~~~~~~~^~~ lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/mpi/longlong.h:668:22: note: expanded from macro 'umul_ppmm' : "=d" ((UDItype)(w1)) ~~~~~~~~~~^~~ 2 errors generated. This special case for umul_ppmm for MIPS64r6 was added in commit bbc25bee37d2b ("lib/mpi: Fix umul_ppmm() for MIPS64r6"), due to GCC being inefficient and emitting a __multi3 intrinsic. There is no such issue with clang; with this patch applied, I can build this configuration without any problems and there are no link errors like mentioned in the commit above (which I can still reproduce with GCC 9.3.0 when that commit is reverted). Only use this definition when GCC is being used. This really should have been caught by commit b0c091ae04f67 ("lib/mpi: Eliminate unused umul_ppmm definitions for MIPS") when I was messing around in this area but I was not testing 64-bit MIPS at the time. Link: https://github.com/ClangBuiltLinux/linux/issues/885 Reported-by: Dmitry Golovin Signed-off-by: Nathan Chancellor Signed-off-by: Herbert Xu commit 97f9ac3db6612f14ac0c509e1a63ce14fd4cc0eb Author: Tom Lendacky Date: Tue Apr 21 12:44:49 2020 -0500 crypto: ccp - Add support for SEV-ES to the PSP driver To provide support for SEV-ES, the hypervisor must provide an area of memory to the PSP. Once this Trusted Memory Region (TMR) is provided to the PSP, the contents of this area of memory are no longer available to the x86. Update the PSP driver to allocate a 1MB region for the TMR that is 1MB aligned and then provide it to the PSP through the SEV INIT command. Signed-off-by: Tom Lendacky Reviewed-by: Brijesh Singh Reviewed-by: Joerg Roedel Signed-off-by: Herbert Xu commit 3c2214b6027ff37945799de717c417212e1a8c54 Author: Daniel Jordan Date: Tue Apr 21 12:34:55 2020 -0400 padata: add separate cpuhp node for CPUHP_PADATA_DEAD Removing the pcrypt module triggers this: general protection fault, probably for non-canonical address 0xdead000000000122 CPU: 5 PID: 264 Comm: modprobe Not tainted 5.6.0+ #2 Hardware name: QEMU Standard PC RIP: 0010:__cpuhp_state_remove_instance+0xcc/0x120 Call Trace: padata_sysfs_release+0x74/0xce kobject_put+0x81/0xd0 padata_free+0x12/0x20 pcrypt_exit+0x43/0x8ee [pcrypt] padata instances wrongly use the same hlist node for the online and dead states, so __padata_free()'s second cpuhp remove call chokes on the node that the first poisoned. cpuhp multi-instance callbacks only walk forward in cpuhp_step->list and the same node is linked in both the online and dead lists, so the list corruption that results from padata_alloc() adding the node to a second list without removing it from the first doesn't cause problems as long as no instances are freed. Avoid the issue by giving each state its own node. Fixes: 894c9ef9780c ("padata: validate cpumask without removed CPU during offline") Signed-off-by: Daniel Jordan Cc: Herbert Xu Cc: Steffen Klassert Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Herbert Xu commit b2d7e8bcaab7d1d931369984e2bae952247a1412 Author: Herbert Xu Date: Mon Apr 20 18:28:19 2020 +1000 hwrng: cctrng - Remove unnecessary FIPS ifdef This patch removes the unnecessary FIPS ifdef in cctrng. Signed-off-by: Herbert Xu Acked-by: Hadar Gat Signed-off-by: Herbert Xu commit a2b9d4eadb7727772698d06e4cbeb1a1e2538675 Author: Dominic Chen Date: Mon Mar 9 14:53:23 2020 -0400 fpga: dfl: afu: support debug access to memory-mapped afu regions Allow debug access to memory-mapped regions using e.g. gdb. Signed-off-by: Dominic Chen Acked-by: Wu Hao Signed-off-by: Moritz Fischer commit 5a53881580f90a5e4404954af16a5646ee9d7842 Author: Gustavo A. R. Silva Date: Thu Mar 19 16:21:53 2020 -0500 fpga: dfl.h: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Moritz Fischer commit fd0d094531db812750bba0367a8822d10a43f444 Author: Richard Gong Date: Fri Feb 14 10:00:50 2020 -0600 arm64: dts: agilex: correct service layer driver's compatible value Correct the compatible property value for Intel Service Layer driver on Intel Agilex SoC platform. Signed-off-by: Richard Gong Signed-off-by: Moritz Fischer commit fba965a79b925b35bee69472c7caa5ff8d6a8672 Author: Richard Gong Date: Fri Feb 14 10:00:49 2020 -0600 dt-bindings, firmware: add compatible value Intel Stratix10 service layer binding A a compatible property value to Intel Stratix10 service layer binding Signed-off-by: Richard Gong Acked-by: Rob Herring Signed-off-by: Moritz Fischer commit d299253cf5b4e0f21ff1ce1d2f02e5ea634ebcb9 Author: Richard Gong Date: Fri Feb 14 10:00:48 2020 -0600 fpga: stratix10-soc: add compatible property value for intel agilex Add compatible property value so we can reuse FPGA manager driver on Intel Agilex SoC platform. Signed-off-by: Richard Gong Signed-off-by: Moritz Fischer commit 8d6b6bbe6ddec1a37bbdebf5b7a1ad989b510b7f Author: Richard Gong Date: Fri Feb 14 10:00:47 2020 -0600 arm64: dts: agilex: correct FPGA manager driver's compatible value Correct the compatible property value for FPGA manager driver on Intel Agilex SoC platform. Signed-off-by: Richard Gong Signed-off-by: Moritz Fischer commit 2e00dd1bd6567148c331469c60ded9715ac749c7 Author: Richard Gong Date: Fri Feb 14 10:00:46 2020 -0600 dt-bindings: fpga: add compatible value to Stratix10 SoC FPGA manager binding Add a compatible property value to Stratix10 SoC FPGA manager binding file Signed-off-by: Richard Gong Acked-by: Rob Herring Signed-off-by: Moritz Fischer commit a1d1f5d490a475db9fbf7e9d164009f9c26345b2 Author: Sergiu Cuciurean Date: Thu Feb 27 16:24:14 2020 +0200 fpga: machxo2-spi: Use new structure for SPI transfer delays In a recent change to the SPI subsystem [1], a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). [1] commit bebcfd272df6 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Sergiu Cuciurean Signed-off-by: Moritz Fischer commit 1493674ba3c0f0d48f5f1bdd8a32cbc3bb7be619 Author: Sergiu Cuciurean Date: Thu Feb 27 14:09:32 2020 +0200 fpga: ice40-spi: Use new structure for SPI transfer delays In a recent change to the SPI subsystem [1], a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). [1] commit bebcfd272df6 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Sergiu Cuciurean Signed-off-by: Moritz Fischer commit b6862193ca12e4bce6a18f31bb36eaa6d801b377 Author: Xu Yilun Date: Mon Nov 18 13:20:41 2019 +0800 fpga: dfl: support multiple opens on feature device node. Each DFL functional block, e.g. AFU (Accelerated Function Unit) and FME (FPGA Management Engine), could implement more than one function within its region, but current driver only allows one user application to access it by exclusive open on device node. So this is not convenient and flexible for userspace applications, as they have to combine lots of different functions into one single application. This patch removes the limitation here to allow multiple opens to each feature device node for AFU and FME from userspace applications. If user still needs exclusive access to these device node, O_EXCL flag must be issued together with open. Signed-off-by: Wu Hao Signed-off-by: Xu Yilun Signed-off-by: Moritz Fischer commit 57b3ed941b5542aaebcd9f59369571bbce9d6dcc Author: Naveen N. Rao Date: Wed Apr 22 14:56:12 2020 +0530 powerpc/64: Have MPROFILE_KERNEL depend on FUNCTION_TRACER Currently, it is possible to have CONFIG_FUNCTION_TRACER disabled, but CONFIG_MPROFILE_KERNEL enabled. Though all existing users of MPROFILE_KERNEL are doing the right thing, it is weird to have MPROFILE_KERNEL enabled when the function tracer isn't. Fix this by making MPROFILE_KERNEL depend on FUNCTION_TRACER. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200422092612.514301-1-naveen.n.rao@linux.vnet.ibm.com commit bde752c3d6dbe9f6ca346560198e66bc3d7d7238 Author: Gautham R. Shenoy Date: Tue Apr 7 14:17:43 2020 +0530 Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurr Add documentation for the following sysfs interfaces: /sys/devices/system/cpu/cpuX/purr /sys/devices/system/cpu/cpuX/spurr /sys/devices/system/cpu/cpuX/idle_purr /sys/devices/system/cpu/cpuX/idle_spurr Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1586249263-14048-6-git-send-email-ego@linux.vnet.ibm.com commit 6909f179ca7a73f243dca7c829facca1cc1d4ff5 Author: Gautham R. Shenoy Date: Tue Apr 7 14:17:42 2020 +0530 powerpc/sysfs: Show idle_purr and idle_spurr for every CPU On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. The total PURR and SPURR ticks are already exposed via the per-cpu sysfs files "purr" and "spurr". This patch adds support for exposing the idle PURR and SPURR ticks via new per-cpu sysfs files named "idle_purr" and "idle_spurr". This patch also adds helper functions to accurately read the values of idle_purr and idle_spurr especially from an interrupt context between when the interrupt has occurred between the pseries_idle_prolog() and pseries_idle_epilog(). This will ensure that the idle purr/spurr values corresponding to the latest idle period is accounted for before these values are read. Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1586249263-14048-5-git-send-email-ego@linux.vnet.ibm.com commit dc8afce5f45b099e3ea52a16b2f90e92f90f3af0 Author: Gautham R. Shenoy Date: Tue Apr 7 14:17:41 2020 +0530 powerpc/pseries: Account for SPURR ticks on idle CPUs On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. Via pseries_idle_prolog(), pseries_idle_epilog(), we track the idle PURR ticks in the VPA variable "wait_state_cycles". This patch extends the support to account for the idle SPURR ticks. Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1586249263-14048-4-git-send-email-ego@linux.vnet.ibm.com commit c4019198cfa81224d32846915cd401e981f81b81 Author: Gautham R. Shenoy Date: Tue Apr 7 14:17:40 2020 +0530 powerpc/idle: Store PURR snapshot in a per-cpu global variable Currently when CPU goes idle, we take a snapshot of PURR via pseries_idle_prolog() which is used at the CPU idle exit to compute the idle PURR cycles via the function pseries_idle_epilog(). Thus, the value of idle PURR cycle thus read before pseries_idle_prolog() and after pseries_idle_epilog() is always correct. However, if we were to read the idle PURR cycles from an interrupt context between pseries_idle_prolog() and pseries_idle_epilog() (this will be done in a future patch), then, the value of the idle PURR thus read will not include the cycles spent in the most recent idle period. Thus, in that interrupt context, we will need access to the snapshot of the PURR before going idle, in order to compute the idle PURR cycles for the latest idle duration. In this patch, we save the snapshot of PURR in pseries_idle_prolog() in a per-cpu variable, instead of on the stack, so that it can be accessed from an interrupt context. Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1586249263-14048-3-git-send-email-ego@linux.vnet.ibm.com commit e4a884cc28fa3f5d8b81de46998ffe29b4ad169e Author: Gautham R. Shenoy Date: Tue Apr 7 14:17:39 2020 +0530 powerpc: Move idle_loop_prolog()/epilog() functions to header file Currently prior to entering an idle state on a Linux Guest, the pseries cpuidle driver implement an idle_loop_prolog() and idle_loop_epilog() functions which ensure that idle_purr is correctly computed, and the hypervisor is informed that the CPU cycles have been donated. These prolog and epilog functions are also required in the default idle call, i.e pseries_lpar_idle(). Hence move these accessor functions to a common header file and call them from pseries_lpar_idle(). Since the existing header files such as asm/processor.h have enough clutter, create a new header file asm/idle.h. Finally rename idle_loop_prolog() and idle_loop_epilog() to pseries_idle_prolog() and pseries_idle_epilog() as they are only relavent for on pseries guests. Signed-off-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1586249263-14048-2-git-send-email-ego@linux.vnet.ibm.com commit 6f41f08c88c59ae6e32d32563c9af73ae2d71ece Author: Xiongfeng Wang Date: Wed Apr 29 20:10:18 2020 +0800 scsi: dpt_i2o: Remove always false 'chan < 0' statement The channel index is represented by an unsigned variable 'u32 chan'. We don't need to check whether it is less than zero, the 'chan < 0' statement is always false. Remove it. Link: https://lore.kernel.org/r/1588162218-61757-1-git-send-email-wangxiongfeng2@huawei.com Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang Signed-off-by: Martin K. Petersen commit 4a4c0cfb4be74e216dd4446b254594707455bfc6 Author: Dan Carpenter Date: Tue Apr 28 16:19:39 2020 +0300 scsi: qedi: Check for buffer overflow in qedi_set_path() Smatch complains that the "path_data->handle" variable is user controlled. It comes from iscsi_set_path() so that seems possible. It's harmless to add a limit check. The qedi->ep_tbl[] array has qedi->max_active_conns elements (which is always ISCSI_MAX_SESS_PER_HBA (4096) elements). The array is allocated in the qedi_cm_alloc_mem() function. Link: https://lore.kernel.org/r/20200428131939.GA696531@mwanda Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Acked-by: Manish Rangankar Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 78b874b7cbf09fbfadfa5f18a347ebef7bbb49fe Author: Colin Ian King Date: Tue Apr 28 11:20:13 2020 +0100 scsi: qla2xxx: make 1-bit bit-fields unsigned int The bitfields mpi_fw_dump_reading and mpi_fw_dumped are currently signed which is not recommended as the representation is an implementation defined behaviour. Fix this by making the bit-fields unsigned ints. Link: https://lore.kernel.org/r/20200428102013.1040598-1-colin.king@canonical.com Fixes: cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling") Reviewed-by: Bart Van Assche Reviewed-by: Himanshu Madhani Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 20a66f2bf280277ab5bb22e27445153b4eb0ac88 Author: Johannes Thumshirn Date: Tue Apr 28 19:45:55 2020 +0900 scsi: core: free sgtables in case command setup fails In case scsi_setup_fs_cmnd() fails we're not freeing the sgtables allocated by scsi_init_io(), thus we leak the allocated memory. Free the sgtables allocated by scsi_init_io() in case scsi_setup_fs_cmnd() fails. Technically scsi_setup_scsi_cmnd() does not suffer from this problem as it can only fail if scsi_init_io() fails, so it does not have sgtables allocated. But to maintain symmetry and as a measure of defensive programming, free the sgtables on scsi_setup_scsi_cmnd() failure as well. scsi_mq_free_sgtables() has safeguards against double-freeing of memory so this is safe to do. While we're at it, rename scsi_mq_free_sgtables() to scsi_free_sgtables(). Link: https://bugzilla.kernel.org/show_bug.cgi?id=205595 Link: https://lore.kernel.org/r/20200428104605.8143-2-johannes.thumshirn@wdc.com Reviewed-by: Christoph Hellwig Reviewed-by: Daniel Wagner Reviewed-by: Hannes Reinecke Signed-off-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 937eea297e26effac6809a0bf8c20e6ca9d90b9a Merge: 126a34061eec e748f07d00c1 Author: Dave Airlie Date: Thu Apr 30 11:08:54 2020 +1000 Merge tag 'amd-drm-next-5.8-2020-04-24' of git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-next-5.8-2020-04-24: amdgpu: - Documentation improvements - Enable FRU chip access on boards that support it - RAS updates - SR-IOV updates - Powerplay locking fixes for older SMU versions - VCN DPG (dynamic powergating) cleanup - VCN 2.5 DPG enablement - Rework GPU scheduler handling - Improve scheduler priority handling - Add SPM (streaming performance monitor) golden settings for navi - GFX10 clockgating fixes - DC ABM (automatic backlight modulation) fixes - DC cursor and plane fixes - DC watermark fixes - DC clock handling fixes - DC color management fixes - GPU reset fixes - Clean up MMIO access macros - EEPROM access fixes - Misc code cleanups amdkfd: - Misc code cleanups radeon: - Clean up safe reg list generation - Misc code cleanups From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200424190827.4542-1-alexander.deucher@amd.com commit de3b4d9361c8a527aa91f49f779e2e378019d0f6 Author: Chris Wilson Date: Wed Apr 29 21:54:46 2020 +0100 drm/i915/gt: Restore aggressive post-boost downclocking We reduced the clocks slowly after a boost event based on the observation that the smoothness of animations suffered. However, since reducing the evalution intervals, we should be able to respond to the rapidly fluctuating workload of a simple desktop animation and so restore the more aggressive downclocking. References: 2a8862d2f3da ("drm/i915: Reduce the RPS shock") Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-6-chris@chris-wilson.co.uk commit 3f88dde6ee630983b2d4be9967049306a90a2d40 Author: Chris Wilson Date: Wed Apr 29 21:54:45 2020 +0100 drm/i915/gt: Apply the aggressive downclocking to parking We treat parking as a manual RPS timeout event, and downclock the GPU for the next unpark and batch execution. However, having restored the aggressive downclocking and observed that we have very light workloads whose only interaction is through the manual parking events, carry over the aggressive downclocking to the fake RPS events. References: 21abf0bf168d ("drm/i915/gt: Treat idling as a RPS downclock event") Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-5-chris@chris-wilson.co.uk commit 36d516be867ce3657401ab26b05a39a20f56fa13 Author: Chris Wilson Date: Wed Apr 29 21:54:44 2020 +0100 drm/i915/gt: Switch to manual evaluation of RPS As with the realisation for soft-rc6, we respond to idling the engines within microseconds, far faster than the response times for HW RC6 and RPS. Furthermore, our fast parking upon idle, prevents HW RPS from running for many desktop workloads, as the RPS evaluation intervals are on the order of tens of milliseconds, but the typical workload is just a couple of milliseconds, but yet we still need to determine the best frequency for user latency versus power. Recognising that the HW evaluation intervals are a poor fit, and that they were deprecated [in bspec at least] from gen10, start to wean ourselves off them and replace the EI with a timer and our accurate busy-stats. The principle benefit of manually evaluating RPS intervals is that we can be more responsive for better performance and powersaving for both spiky workloads and steady-state. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1698 Fixes: 98479ada421a ("drm/i915/gt: Treat idling as a RPS downclock event") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Andi Shyti Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-4-chris@chris-wilson.co.uk commit 8e99299a04bc79bfd4fad71e05c0bd80e48afdb5 Author: Chris Wilson Date: Wed Apr 29 21:54:43 2020 +0100 drm/i915/gt: Track use of RPS interrupts in flags Use the new intel_rps.flags field to store whether or not interrupts are being used with RPS. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-3-chris@chris-wilson.co.uk commit 9bad2adbddfee476185f1d77a8bf496f841d2088 Author: Chris Wilson Date: Wed Apr 29 21:54:42 2020 +0100 drm/i915/gt: Move rps.enabled/active to flags Pull the boolean intel_rps.enabled and intel_rps.active into a single flags field, in preparation for more. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-2-chris@chris-wilson.co.uk commit 426d0073fb6d1a9513978cea4c9e8396f3721fba Author: Chris Wilson Date: Wed Apr 29 21:54:41 2020 +0100 drm/i915/gt: Always enable busy-stats for execlists In the near future, we will utilize the busy-stats on each engine to approximate the C0 cycles of each, and use that as an input to a manual RPS mechanism. That entails having busy-stats always enabled and so we can remove the enable/disable routines and simplify the pmu setup. As a consequence of always having the stats enabled, we can also show the current active time via sysfs/engine/xcs/active_time_ns. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-1-chris@chris-wilson.co.uk commit 9e9f6e72a0f6c248c2eda230286eb1a71f2e146e Merge: 323e395f197f f50932cca632 Author: David S. Miller Date: Wed Apr 29 16:55:22 2020 -0700 Merge branch 'net-bcmgenet-add-support-for-Wake-on-Filter' Doug Berger says: ==================== net: bcmgenet: add support for Wake on Filter Changes in v2: Corrected Signed-off-by for commit 3/7. This commit set adds support for waking from 'standby' using a Rx Network Flow Classification filter specified with ethtool. The first two commits are bug fixes that should be applied to the stable branches, but are included in this patch set to reduce merge conflicts that might occur if not applied before the other commits in this set. The next commit consolidates WoL clock managment as a part of the overall WoL configuration. The next commit restores a set of functions that were removed from the driver just prior to the 4.9 kernel release. The following commit relocates the functions in the file to prevent the need for additional forward declarations. Next, support for the Rx Network Flow Classification interface of ethtool is added. Finally, support for the WAKE_FILTER wol method is added. ==================== Signed-off-by: David S. Miller commit f50932cca632fb87ab4de678ecc7c3b41116140b Author: Doug Berger Date: Wed Apr 29 13:02:06 2020 -0700 net: bcmgenet: add WAKE_FILTER support This commit enables support for the WAKE_FILTER method of Wake on LAN for the GENET driver. The method can be enabled by adding 'f' to the interface 'wol' setting specified by ethtool. Rx network flow rules can be specified using ethtool. Rules that define a flow-type with the RX_CLS_FLOW_WAKE action (i.e. -2) can wake the system from the 'standby' power state when the WAKE_FILTER WoL method is enabled. Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 3e370952287c55e5fd240cb8bb41ef8acff8829d Author: Doug Berger Date: Wed Apr 29 13:02:05 2020 -0700 net: bcmgenet: add support for ethtool rxnfc flows This commit enables driver support for ethtool commands of this form: ethtool -N|-U|--config-nfc|--config-ntuple devname flow-type ether|ip4 [src xx:yy:zz:aa:bb:cc [m xx:yy:zz:aa:bb:cc]] [dst xx:yy:zz:aa:bb:cc [m xx:yy:zz:aa:bb:cc]] [proto N [m N]] [src-ip x.x.x.x [m x.x.x.x]] [dst-ip x.x.x.x [m x.x.x.x]] [tos N [m N]] [l4proto N [m N]] [src-port N [m N]] [dst-port N [m N]] [spi N [m N]] [l4data N [m N]] [vlan-etype N [m N]] [vlan N [m N]] [dst-mac xx:yy:zz:aa:bb:cc [m xx:yy:zz:aa:bb:cc]] [action 0] [loc N] | delete N Since there is only one Rx Ring in this implementation action 0 behaves no differently from not specifying a rule. The rules can be seen with ethtool commands of this form: ethtool -n|-u|--show-nfc|--show-ntuple devname [rule N] Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 854295d03ca04461f275d723289a5886e6827498 Author: Doug Berger Date: Wed Apr 29 13:02:04 2020 -0700 net: bcmgenet: code movement The Hardware Filter Block code will be used by ethtool functions when defining flow types so this commit moves the functions in the file to prevent the need for prototype declarations. This is broken out to facilitate review. Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 14da1510fedc2d72ca81344a0f62939e0a1bc648 Author: Doug Berger Date: Wed Apr 29 13:02:03 2020 -0700 Revert "net: bcmgenet: remove unused function in bcmgenet.c" This reverts commit e2072600a24161b7ddcfb26814f69f5fbc8ef85a. This commit restores the previous implementation of Hardware Filter Block functions to the file for use in subsequent commits. Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 1a1d5106c1e37321f3fe394b786d1aece56d0df5 Author: Doug Berger Date: Wed Apr 29 13:02:02 2020 -0700 net: bcmgenet: move clk_wol management to bcmgenet_wol The GENET_POWER_WOL_MAGIC power up and power down code configures the device for WoL when suspending and disables the WoL logic when resuming. It makes sense that this code should also manage the WoL clocking. This commit consolidates the logic and moves it earlier in the resume sequence. Since the clock is now only enabled if WoL is successfully entered the wol_active flag is introduced to track that state to keep the clock enables and disables balanced in case a suspend is aborted. The MPD_EN hardware bit can't be used because it can be cleared when the MAC is reset by a deep sleep. Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 6f7689057a0f10a6c967b9f2759d7a3dc948b930 Author: Doug Berger Date: Wed Apr 29 13:02:01 2020 -0700 net: bcmgenet: Fix WoL with password after deep sleep Broadcom STB chips support a deep sleep mode where all register contents are lost. Because we were stashing the MagicPacket password into some of these registers a suspend into that deep sleep then a resumption would not lead to being able to wake-up from MagicPacket with password again. Fix this by keeping a software copy of the password and program it during suspend. Fixes: c51de7f3976b ("net: bcmgenet: add Wake-on-LAN support code") Suggested-by: Florian Fainelli Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 72f96347628e73dbb61b307f18dd19293cc6792a Author: Doug Berger Date: Wed Apr 29 13:02:00 2020 -0700 net: bcmgenet: set Rx mode before starting netif This commit explicitly calls the bcmgenet_set_rx_mode() function when the network interface is started. This function is normally called by ndo_set_rx_mode when the flags are changed, but apparently not when the driver is suspended and resumed. This change ensures that address filtering or promiscuous mode are properly restored by the driver after the MAC may have been reset. Fixes: b6e978e50444 ("net: bcmgenet: add suspend/resume callbacks") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 449e14bfdb83bf772200840a7ac4dcc1d7cacf54 Author: Arnd Bergmann Date: Wed Apr 29 15:21:58 2020 +0200 bpf: Fix unused variable warning Hiding the only using of bpf_link_type_strs[] in an #ifdef causes an unused-variable warning: kernel/bpf/syscall.c:2280:20: error: 'bpf_link_type_strs' defined but not used [-Werror=unused-variable] 2280 | static const char *bpf_link_type_strs[] = { Move the definition into the same #ifdef. Fixes: f2e10bff16a0 ("bpf: Add support for BPF_OBJ_GET_INFO_BY_FD for bpf_link") Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200429132217.1294289-1-arnd@arndb.de commit 94b8e516839fb2a478b6e5560c30754809791d59 Merge: 89d9c24b3916 b31d1d2b1c3a Author: Enric Balletbo i Serra Date: Wed Apr 29 23:37:37 2020 +0200 Merge remote-tracking branch 'origin/chrome-platform-5.7-fixes' into for-kernelci Merging 5.7 fixes branch as of April 29, containing one fix to branch destined for chrome-platform-5.8. b31d1d2b1c3a platform/chrome: cros_ec_sensorhub: Allocate sensorhub resource before claiming sensors Signed-off-by: Enric Balletbo i Serra commit 0b9ad56b1ea66382a3dcc8e3e7c54967bf8c6d94 Author: Jakub Sitnicki Date: Wed Apr 29 20:11:54 2020 +0200 selftests/bpf: Use SOCKMAP for server sockets in bpf_sk_assign test Update bpf_sk_assign test to fetch the server socket from SOCKMAP, now that map lookup from BPF in SOCKMAP is enabled. This way the test TC BPF program doesn't need to know what address server socket is bound to. Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200429181154.479310-4-jakub@cloudflare.com commit 34a2cc6eee809f974111979f4c2b3c62aaaad457 Author: Jakub Sitnicki Date: Wed Apr 29 20:11:53 2020 +0200 selftests/bpf: Test that lookup on SOCKMAP/SOCKHASH is allowed Now that bpf_map_lookup_elem() is white-listed for SOCKMAP/SOCKHASH, replace the tests which check that verifier prevents lookup on these map types with ones that ensure that lookup operation is permitted, but only with a release of acquired socket reference. Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200429181154.479310-3-jakub@cloudflare.com commit 64d85290d79c0677edb5a8ee2295b36c022fa5df Author: Jakub Sitnicki Date: Wed Apr 29 20:11:52 2020 +0200 bpf: Allow bpf_map_lookup_elem for SOCKMAP and SOCKHASH White-list map lookup for SOCKMAP/SOCKHASH from BPF. Lookup returns a pointer to a full socket and acquires a reference if necessary. To support it we need to extend the verifier to know that: (1) register storing the lookup result holds a pointer to socket, if lookup was done on SOCKMAP/SOCKHASH, and that (2) map lookup on SOCKMAP/SOCKHASH is a reference acquiring operation, which needs a corresponding reference release with bpf_sk_release. On sock_map side, lookup handlers exposed via bpf_map_ops now bump sk_refcnt if socket is reference counted. In turn, bpf_sk_select_reuseport, the only in-kernel user of SOCKMAP/SOCKHASH ops->map_lookup_elem, was updated to release the reference. Sockets fetched from a map can be used in the same way as ones returned by BPF socket lookup helpers, such as bpf_sk_lookup_tcp. In particular, they can be used with bpf_sk_assign to direct packets toward a socket on TC ingress path. Suggested-by: Lorenz Bauer Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200429181154.479310-2-jakub@cloudflare.com commit 0b3b9ca3d154486baa08a41cbc62fde67ba8c6c3 Author: Quentin Monnet Date: Wed Apr 29 15:45:06 2020 +0100 tools: bpftool: Make libcap dependency optional The new libcap dependency is not used for an essential feature of bpftool, and we could imagine building the tool without checks on CAP_SYS_ADMIN by disabling probing features as an unprivileged users. Make it so, in order to avoid a hard dependency on libcap, and to ease packaging/embedding of bpftool. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200429144506.8999-4-quentin@isovalent.com commit cf9bf714523dbbc97953be6de6ca14d57d4f8a21 Author: Quentin Monnet Date: Wed Apr 29 15:45:05 2020 +0100 tools: bpftool: Allow unprivileged users to probe features There is demand for a way to identify what BPF helper functions are available to unprivileged users. To do so, allow unprivileged users to run "bpftool feature probe" to list BPF-related features. This will only show features accessible to those users, and may not reflect the full list of features available (to administrators) on the system. To avoid the case where bpftool is inadvertently run as non-root and would list only a subset of the features supported by the system when it would be expected to list all of them, running as unprivileged is gated behind the "unprivileged" keyword passed to the command line. When used by a privileged user, this keyword allows to drop the CAP_SYS_ADMIN and to list the features available to unprivileged users. Note that this addsd a dependency on libpcap for compiling bpftool. Note that there is no particular reason why the probes were restricted to root, other than the fact I did not need them for unprivileged and did not bother with the additional checks at the time probes were added. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200429144506.8999-3-quentin@isovalent.com commit e3450b79dfe47632ffa65042c6d5a6b48263da4e Author: Quentin Monnet Date: Wed Apr 29 15:45:04 2020 +0100 tools: bpftool: For "feature probe" define "full_mode" bool as global The "full_mode" variable used for switching between full or partial feature probing (i.e. with or without probing helpers that will log warnings in kernel logs) was piped from the main do_probe() function down to probe_helpers_for_progtype(), where it is needed. Define it as a global variable: the calls will be more readable, and if other similar flags were to be used in the future, we could use global variables as well instead of extending again the list of arguments with new flags. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200429144506.8999-2-quentin@isovalent.com commit 323e395f197fd0bc1bf7a7a7e4c67d3d7410f24f Merge: 7263d72bec32 3ff7ddb1353d Author: David S. Miller Date: Wed Apr 29 14:14:44 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for nf-next: 1) Add IPS_HW_OFFLOAD status bit, from Bodong Wang. 2) Remove 128-bit limit on the set element data area, rise it to 64 bytes. 3) Report EOPNOTSUPP for unsupported NAT types and flags. 4) Set up nft_nat flags from the control plane path. 5) Add helper functions to set up the nf_nat_range2 structure. 6) Add netmap support for nft_nat. ==================== Signed-off-by: David S. Miller commit f932449c11dabb4b0588e30f35c084b910483ca5 Author: Paul Cercueil Date: Mon Apr 13 17:26:33 2020 +0200 MIPS: ingenic: Drop obsolete code, merge the rest in setup.c Drop a bootload of 10-years-old dirty code, that is not used anymore, as it has been replaced with clean code over the ages. Merge the very few bits left inside setup.c, so that everything is clean and tidy now. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 8827af9427dea9432d5b9c5366c7312e7f647484 Author: Paul Cercueil Date: Mon Apr 13 17:26:32 2020 +0200 MIPS: ingenic: GCW0: Update defconfig Enable support for the new hardware that was added in the devicetree. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 818c2b36383e3ef421b9b435a1215a50fc163f82 Author: Paul Cercueil Date: Mon Apr 13 17:26:31 2020 +0200 MIPS: ingenic: CI20: enable OST, PWM drivers in defconfig The OST driver provides a clocksource and sched_clock that are much more accurate than the default ones. The PWM driver allows to use the PWM pins on the external header of the board. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit b1bfdb660516ad57087dfc8f8698853dfbf5e5fd Author: Paul Cercueil Date: Mon Apr 13 17:26:30 2020 +0200 MIPS: ingenic: DTS: Update GCW0 support Add support for the face buttons, the ACT8600 PMUC, the LCD panel with backlight, the rumble, internal/external SD readers, and other things. Note that the otg-phy node was dropped in the process as it was neither useful nor used, and was inside a non-compliant board "bus". Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 061e35b2c76e9cd230009c055e6a7e20dca51dd0 Author: Paul Cercueil Date: Mon Apr 13 17:26:29 2020 +0200 MIPS: ingenic: DTS: Update JZ4770 support Add support for the RTC, AIC, CODEC, MMC 0/1/2, ADC, GPU, LCD, USB OTG, USB PHY controllers. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit bf40bf5ecf3f96b95c0ed8d6badf0b34df879adf Author: Paul Cercueil Date: Mon Apr 13 17:26:28 2020 +0200 MIPS: ingenic: DTS: Add nodes for the watchdog/PWM/OST Add the TCU nodes to the JZ4780, JZ4770 and JZ4740 devicetree files. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit cf2e6b8e6f6f28c186700cb93c0b9b98960705c7 Author: Paul Cercueil Date: Mon Apr 13 17:26:27 2020 +0200 MIPS: ingenic: DTS: Respect cell count of common properties If N fields of X cells should be provided, then that's what the devicetree should represent, instead of having one single field of (N*X) cells. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 59bd128a412702931afaf758af6b640e3528d1b5 Author: Paul Cercueil Date: Mon Apr 13 17:26:26 2020 +0200 MIPS: ingenic: DTS: Fix invalid value in #dma-cells The driver requires two cells and not just one. Since these nodes are both disabled as no hardware currently use them, this fix does not really requires a Fixes: tag. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit ada66f1837594f38bc2db4f98c4c6589ecc8a7f6 Author: Catalin Marinas Date: Wed Apr 29 19:37:02 2020 +0100 arm64: Reorder the macro arguments in the copy routines The current argument order is obviously buggy (memcpy.S): macro strb1 ptr, regB, val strb \ptr, [\regB], \val endm However, it cancels out as the calling sites in copy_template.S pass the address as the regB argument. Mechanically reorder the arguments to match the instruction mnemonics. There is no difference in objdump before and after this patch. Signed-off-by: Catalin Marinas Link: https://lore.kernel.org/r/20200429183702.28445-1-catalin.marinas@arm.com Signed-off-by: Will Deacon commit 78b0d99a68ecdc84728c99f4fef71942e9ecf35a Author: Arnd Bergmann Date: Tue Apr 28 23:53:54 2020 +0200 drm/bridge: fix stack usage warning on old gcc Some older versions of gcc badly optimize code that passes an inline function argument into another function by reference, causing huge stack usage: drivers/gpu/drm/bridge/tc358768.c: In function 'tc358768_bridge_pre_enable': drivers/gpu/drm/bridge/tc358768.c:840:1: error: the frame size of 2256 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] Use a temporary variable as a workaround and add a comment pointing to the gcc bug. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Arnd Bergmann Reviewed-by: Tomi Valkeinen Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200428215408.4111675-1-arnd@arndb.de commit 184dbc152e398d7136dabd59ed3f5c5521935712 Author: Rob Herring Date: Wed Apr 29 14:19:21 2020 -0500 arm64: silicon-errata.rst: Sort the Cortex-A55 entries The Arm silicon errata list is mostly sorted by CPU name with the exception of Cortex-A55, so let's sort it before adding more entries. Signed-off-by: Rob Herring Cc: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/r/20200429191921.32484-1-robh@kernel.org Signed-off-by: Will Deacon commit 7263d72bec3221eb33273ffc7602466118a80cab Merge: 21615efa6a69 00a049cfde95 Author: David S. Miller Date: Wed Apr 29 12:26:33 2020 -0700 Merge branch 'net-smc-preparations-for-SMC-R-link-failover' Karsten Graul says: ==================== net/smc: preparations for SMC-R link failover This patch series prepares the SMC code for the implementation of SMC-R link failover capabilities which are still missing to reach full compliance with RFC 7609. The code changes are separated into 65 patches which together form the new functionality. I tried to create meaningful patches which allow to follow the implementation. Question: how to handle the remaining 52 patches? All of them are needed for link failover to work and should make it into the same merge window. Can I send them all together? The SMC-R implementation will transparently make use of the link failover feature when matching RoCE devices are available, no special setup is required. All RoCE devices with the same PNET ID as the TCP device (hardware-defined or user-defined via the smc_pnet tool) are candidates to get used to form a link in a link group. When at least 2 RoCE devices are available on both communication endpoints then a symmetric link group is formed, meaning the link group has 2 independent links. If one RoCE device goes down then all connections on this link are moved to the surviving link. Upon recovery of the failing device or availability of a new one, the symmetric link group will be restored. ==================== Signed-off-by: David S. Miller commit 00a049cfde95931c6832edad19d9a4be441cacf5 Author: Karsten Graul Date: Wed Apr 29 17:10:49 2020 +0200 net/smc: move llc layer related init and clear into smc_llc.c Introduce smc_llc_lgr_init() and smc_llc_lgr_clear() to implement all llc layer specific initialization and cleanup in module smc_llc.c. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit faca536008375bece23783e7382b5d0356c13ba5 Author: Karsten Graul Date: Wed Apr 29 17:10:48 2020 +0200 net/smc: use mutex instead of rwlock_t to protect buffers The locks for sndbufs and rmbs are never used from atomic context. Using a mutex for these locks will allow to nest locks with other mutexes. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit ef79d439cd124d9fb7258bb35d44c71aec11b829 Author: Karsten Graul Date: Wed Apr 29 17:10:47 2020 +0200 net/smc: process llc responses in tasklet context When llc responses are received then possible waiters for this response are to be notified. This can be done in tasklet context, without to use a work in the llc work queue. Move all code that handles llc responses into smc_llc_rx_response(). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 6c8968c421e0e6bea8a78ee4fdd043d850cd5b26 Author: Karsten Graul Date: Wed Apr 29 17:10:46 2020 +0200 net/smc: use worker to process incoming llc messages Incoming llc messages are processed in irq tasklet context, and a worker is used to send outgoing messages. The worker is needed because getting a send buffer could result in a wait for a free buffer. To make sure all incoming llc messages are processed in a serialized way introduce an event queue and create a new queue entry for each message which is queued to this event queue. A new worker processes the event queue entries in order. And remove the use of a separate worker to send outgoing llc messages because the messages are processed in worker context already. With this event queue the serialized llc_wq work queue is obsolete, remove it. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 2140ac26f8f501d3cc8f1575e6419f1a50779496 Author: Karsten Graul Date: Wed Apr 29 17:10:45 2020 +0200 net/smc: simplify link deactivation Cancel the testlink worker during link clear processing and remove the extra function smc_llc_link_inactive(). Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 1020e1ef53ceef715f2bc144eebbfe01e88effcf Author: Karsten Graul Date: Wed Apr 29 17:10:44 2020 +0200 net/smc: move testlink work to system work queue The testlink work waits for a response to the testlink request and blocks the single threaded llc_wq. This type of work does not have to be serialized and can be moved to the system work queue. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit d854fcbfaeda9748c85de296fbe07b7763a1939c Author: Karsten Graul Date: Wed Apr 29 17:10:43 2020 +0200 net/smc: add new link state and related helpers Before a link can be reused it must have been cleared. Lowest current link state is INACTIVE, which does not mean that the link is already cleared. Add a new state UNUSED that is set when the link is cleared and can be reused. Add helper smc_llc_usable_link() to find an active link in a link group, and smc_link_usable() to determine if a link is usable. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit e07d31dc16b0d77ff6b3f71cafe3a825fb80bed4 Author: Karsten Graul Date: Wed Apr 29 17:10:42 2020 +0200 net/smc: multi-link support for smc_rmb_rtoken_handling() Extend smc_rmb_rtoken_handling() and smc_rtoken_delete() to support multiple links. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit b9247544c1bccfe1b74ddf1dade719a69946cbb1 Author: Karsten Graul Date: Wed Apr 29 17:10:41 2020 +0200 net/smc: convert static link ID instances to support multiple links As a preparation for the support of multiple links remove the usage of a static link id (SMC_SINGLE_LINK) and allow dynamic link ids. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 387707fdf48697c667dd5e9715ac4feb41602d15 Author: Karsten Graul Date: Wed Apr 29 17:10:40 2020 +0200 net/smc: convert static link ID to dynamic references As a preparation for the support of multiple links remove the usage of a static link id (SMC_SINGLE_LINK) and allow dynamic link ids. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 026c381fb4778d0d44af57b7ff674f31f04af221 Author: Karsten Graul Date: Wed Apr 29 17:10:39 2020 +0200 net/smc: introduce link_idx for link group array The link_id is the index of the link in the array of the link group. When a link in the array is reused for a new link, a different unique link_id should be used, otherwise the index in the array could collide with the previous link at this array position. Use a new variable link_idx as array index, and make link_id an increasing unique id value. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit f3c1deddb21c19fb0eec3c61e80567ef4a79b58b Author: Karsten Graul Date: Wed Apr 29 17:10:38 2020 +0200 net/smc: separate function for link initialization Move the initialization of a new link into its own function, separate from smc_lgr_create, to allow more than one link per link group. Do an extra check if the IB device initialization was successful, and reset the link state if any error occurs during smcr_link_init(). And rename two existing functions to use the prefix smcr_ to indicate that they belong to the SMC-R code path. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit fdff704dc60418e9a1bac78ae09c857d05c65aa3 Author: Karsten Graul Date: Wed Apr 29 17:10:37 2020 +0200 net/smc: rework pnet table to support SMC-R failover The pnet table stored pnet ids in the smc device structures. When a device is going down its smc device structure is freed, and when the device is brought online again it no longer has a pnet id set. Rework the pnet table implementation to store the device name with their assigned pnet id and apply the pnet id to devices when they are registered. Signed-off-by: Karsten Graul Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit f31505089497ced2a640d3d883f0f690a1f0026c Author: Jerome Brunet Date: Tue Apr 21 16:18:14 2020 +0200 arm64: dts: meson: kvim3: move hdmi to tdm a The tdmout b is physically routed to the 40 pin header and the tdmout c is routed to the m2 connector. It makes these interfaces poor candidates to handle the HDMI 8ch i2s link (2ch i2s * 4 lanes) as it would force the same link format on the related connectors. Instead use the TDM A interface. This one is not routed to the outside world on the vim3, so it can only be used for HDMI. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200421141814.639480-1-jbrunet@baylibre.com commit 21615efa6a69891fa287bade979d56dd68b09878 Author: David S. Miller Date: Wed Apr 29 12:15:42 2020 -0700 Revert "net: ethernet: fec: Prevent MII event after MII_SPEED write" This reverts commit 790ab249b55d75fdb427b92f81964cd7cb525eec. This change needs more work. Signed-off-by: David S. Miller commit 0477e032a9ea34780180d9d5289f9da06714de43 Author: YueHaibing Date: Wed Apr 29 21:25:30 2020 +0800 ila: remove unused inline function ila_addr_is_ila There's no callers in-tree anymore since commit 84287bb32856 ("ila: add checksum neutral map auto"). Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit ad56623119fda623ade9bc570294a1c2b203d374 Author: YueHaibing Date: Wed Apr 29 21:24:30 2020 +0800 net: hsr: remove unused inline functions There's no callers in-tree anymore. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 6d4f3e2bfc4968eba13ea41bd3040ed76733324b Author: Bartlomiej Zolnierkiewicz Date: Wed Apr 29 12:48:24 2020 +0200 video: fbdev: controlfb: fix build for COMPILE_TEST=y && PPC_PMAC=y && PPC32=n powerpc allyesconfig fails like this: drivers/video/fbdev/controlfb.c: In function 'controlfb_mmap': drivers/video/fbdev/controlfb.c:756:23: error: implicit declaration of function 'pgprot_cached_wthru'; did you mean 'pgprot_cached'? [-Werror=implicit-function-declaration] 756 | vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot); | ^~~~~~~~~~~~~~~~~~~ | pgprot_cached drivers/video/fbdev/controlfb.c:756:23: error: incompatible types when assigning to type 'pgprot_t' {aka 'struct '} from type 'int' Fix it by adding missing PPC32 dependency. Fixes: a07a63b0e24d ("video: fbdev: controlfb: add COMPILE_TEST support") Reported-by: Stephen Rothwell Reported-by: kbuild test robot Cc: Sam Ravnborg Cc: Daniel Vetter Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/fe520316-3863-e6c4-9581-5d709f49e906@samsung.com commit 75800d701782e89eecaf712fa141082b6e36f956 Author: Tim Lewis Date: Sun Apr 26 12:21:19 2020 -0400 arm64: dts: meson: S922X: extend cpu opp-points Add extra cpu pop points to allow mild overclock on S922X. The opp points are found in Hardkernel N2 sources [1] and testing shows no obvious issues on other S922X devices. Thermal throttling should keep things in-check if needed. [1] https://github.com/hardkernel/linux/commit/f86cd9487c7483b2a05f448b9ebacf6bd5a2ad2f Signed-off-by: Tim Lewis Signed-off-by: Kevin Hilman Tested-by: Christian Hewitt Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20200426162119.GA23268@imac commit a54776f2c4939bdee084c9ecd00a4a5a25b7c429 Author: Yunjian Wang Date: Wed Apr 29 18:20:58 2020 +0800 netpoll: Fix use correct return type for ndo_start_xmit() The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit 00b5aac59966ec3d608dc150aba552121e7de4f0 Author: Wei Yongjun Date: Wed Apr 29 07:58:20 2020 +0000 ptp: ptp_ines: convert to devm_platform_ioremap_resource Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit cb10228d234c49e2035bfce7bdb42c29e1049c5c Author: Yonglong Liu Date: Wed Apr 29 11:46:24 2020 +0800 net: hns3: adds support for reading module eeprom info This patch adds support for reading the optical module eeprom info via "ethtool -m". Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 08dc0e5dd9aabd52cff9e94febe6b282d29deca4 Author: Neil Armstrong Date: Thu Mar 26 17:59:58 2020 +0100 arm64: dts: meson: fix leds subnodes name Fix the leds subnode names to match (^led-[0-9a-f]$|led) It fixes: meson-g12b-a311d-khadas-vim3.dt.yaml: leds: 'red', 'white' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-g12b-s922x-khadas-vim3.dt.yaml: leds: 'red', 'white' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-g12b-odroid-n2.dt.yaml: leds: 'blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-nanopi-k2.dt.yaml: leds: 'stat' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-nexbox-a95x.dt.yaml: leds: 'blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-odroidc2.dt.yaml: leds: 'blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-vega-s95-pro.dt.yaml: leds: 'blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-vega-s95-meta.dt.yaml: leds: 'blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-vega-s95-telos.dt.yaml: leds: 'blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-wetek-hub.dt.yaml: leds: 'system' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxbb-wetek-play2.dt.yaml: leds: 'ethernet', 'system', 'wifi' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxl-s905x-libretech-cc.dt.yaml: leds: 'blue', 'system' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxl-s905d-libretech-pc.dt.yaml: leds: 'blue', 'green' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxm-rbox-pro.dt.yaml: leds: 'blue', 'red' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-gxm-s912-libretech-pc.dt.yaml: leds: 'blue', 'green' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-sm1-sei610.dt.yaml: leds: 'bluetooth' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' meson-sm1-khadas-vim3l.dt.yaml: leds: 'red', 'white' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+' Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200326165958.19274-6-narmstrong@baylibre.com commit d120b5f98031eefc22164ae8c6ea3711e7a04c19 Author: Neil Armstrong Date: Thu Mar 26 17:59:57 2020 +0100 arm64: dts: meson-gxbb-kii-pro: fix board compatible Remove the uneeded "amlogic,p201", "amlogic,s905" in the board compatible list. It fixes: meson-gxbb-kii-pro.dt.yaml: /: compatible: ['videostrong,kii-pro', 'amlogic,p201', 'amlogic,s905', 'amlogic,meson-gxbb'] is not valid under any of the given schemas Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200326165958.19274-5-narmstrong@baylibre.com commit 5c28dcbb3a1be167c07784b5f710ec602a57bea2 Author: Neil Armstrong Date: Thu Mar 26 17:59:56 2020 +0100 arm64: dts: meson-g12b-ugoos-am6: fix board compatible Add missing amlogic,s922x in the board compatible list. It fixes: meson-g12b-ugoos-am6.dt.yaml: /: compatible: ['ugoos,am6', 'amlogic,g12b'] is not valid under any of the given schemas Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200326165958.19274-4-narmstrong@baylibre.com commit 9ecded10b4b6af238da0c86197b0418912e7513e Author: Neil Armstrong Date: Thu Mar 26 17:59:55 2020 +0100 arm64: dts: meson: fixup SCP sram nodes The GX and AXG SCP sram nodes were using invalid compatible and node names for the sram entries. Fixup the sram entries node names, and use proper compatible for them. It notably fixes: sram@c8000000: 'scp-shmem@0', 'scp-shmem@200' do not match any of the regexes: '^([a-z]*-)?sram(-section)?@[a-f0-9]+$', 'pinctrl-[0-9]+' Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200326165958.19274-3-narmstrong@baylibre.com commit 2f9139c2609fd7166a465c8a60474aa96d6290ac Author: Martin Blumenstingl Date: Thu Mar 26 14:45:02 2020 +0100 arm64: dts: amlogic: use the new USB control driver for GXL and GXM Add the correcly architectured USB Glue node and adapt all the Amlogic GXL and GXM board to the new organization. Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20200326134507.4808-11-narmstrong@baylibre.com commit 2c3cc858a68707dd710aefddd737e9f6aa0a16e1 Author: Liangliang Huang Date: Wed Apr 29 17:04:17 2020 +0800 MIPS: Loongson64: Switch the order of RS780E and LS7A Sort the members of enum in alphabetical order is better to avoid duplicate mistakes (because the list may be grow very large), so fix it by exchanging the order. Signed-off-by: Liangliang Huang Signed-off-by: Thomas Bogendoerfer commit 21b01cc879cc3ecef013b3576db2925adfd881aa Author: Geordan Neukum Date: Mon Mar 30 01:33:55 2020 -0400 power: supply: max17042_battery: Add support for the TTE_NOW prop The max170{42,47,50,55} family of fuel gauges all provide time-to-empty estimation. As such, let's export this as a property. Signed-off-by: Geordan Neukum Signed-off-by: Sebastian Reichel commit be1cb55a07bfc528d826962f1e421a44ed5f8311 Author: Chris Wilson Date: Wed Apr 29 18:24:29 2020 +0100 drm/i915/gt: Keep a no-frills swappable copy of the default context state We need to keep the default context state around to instantiate new contexts (aka golden rendercontext), and we also keep it pinned while the engine is active so that we can quickly reset a hanging context. However, the default contexts are large enough to merit keeping in swappable memory as opposed to kernel memory, so we store them inside shmemfs. Currently, we use the normal GEM objects to create the default context image, but we can throw away all but the shmemfs file. This greatly simplifies the tricky power management code which wants to run underneath the normal GT locking, and we definitely do not want to use any high level objects that may appear to recurse back into the GT. Though perhaps the primary advantage of the complex GEM object is that we aggressively cache the mapping, but here we are recreating the vm_area everytime time we unpark. At the worst, we add a lightweight cache, but first find a microbenchmark that is impacted. Having started to create some utility functions to make working with shmemfs objects easier, we can start putting them to wider use, where GEM objects are overkill, such as storing persistent error state. Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Ramalingam C Cc: Tvrtko Ursulin Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200429172429.6054-1-chris@chris-wilson.co.uk commit be6ef160840f23d9723d9bd008ca08e864ce4745 Author: Patrice Chotard Date: Wed Apr 29 12:26:25 2020 +0200 spi: stm32-qspi: Fix unbalanced pm_runtime_enable issue Issue detected by unbinding/binding the stm32 qspi driver as following: root@stm32mp2:~# echo 40430000.spi > /sys/bus/platform/drivers/stm32-qspi/404300 00.spi/driver/unbind root@stm32mp2:~# echo 40430000.spi > /sys/bus/platform/drivers/stm32-qspi/bind [ 969.864021] stm32-qspi 40430000.spi: Unbalanced pm_runtime_enable! [ 970.225161] spi-nor spi0.0: mx66u51235f (65536 Kbytes) [ 970.935721] spi-nor spi0.1: mx66u51235f (65536 Kbytes) Fixes: 9d282c17b023 ("spi: stm32-qspi: Add pm_runtime support") Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20200429102625.25974-1-patrice.chotard@st.com Signed-off-by: Mark Brown commit 18168291aa7dd48e9d9e3cbb1d4cd06e899357ca Author: Wei Yongjun Date: Wed Apr 29 07:58:55 2020 +0000 spi: uniphier: fix error return code in uniphier_spi_probe() Fix to return negative error code -EPROBE_DEFER from the DMA probe defer error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200429075855.104487-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit f84b604dbaf242d17135f527dbe81093a41226b3 Author: Wei Yongjun Date: Wed Apr 29 02:54:26 2020 +0000 spi: spi-amd: Fix a NULL vs IS_ERR() check in amd_spi_probe() In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: bbb336f39efc ("spi: spi-amd: Add AMD SPI controller driver support") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200429025426.167664-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit 79149fb835d762493db6b8b545527069d592d51b Author: Kuninori Morimoto Date: Wed Apr 1 09:00:04 2020 +0900 ASoC: dt-bindings: simple-card: switch to yaml base Documentation This patch switches from .txt base to .yaml base Document. Signed-off-by: Kuninori Morimoto Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/87sghovzwb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 79ca782533d3633d20f28c69c18cb16d614e46d7 Merge: fd443a20c2f0 94d7281993a7 Author: Mark Brown Date: Wed Apr 29 17:21:35 2020 +0100 Merge series "ASoC: soc-dai: add snd_soc_dai_xxx()" from Kuninori Morimoto Kuninori Morimoto : From: Kuninori Morimoto We have soc-dai.c today. DAI related functions should be implemented in it. These patches are v2 of doing it. Link: https://lore.kernel.org/r/871rofunaq.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (17): ASoC: soc-dai: add soc_dai_err() ASoC: soc-dai: don't overwide dai->driver->ops ASoC: soc-dai: add snd_soc_pcm_dai_new() ASoC: soc-dai: add snd_soc_pcm_dai_prepare() ASoC: soc-dai: add snd_soc_pcm_dai_trigger() ASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger() ASoC: soc-dai: add snd_soc_pcm_dai_probe() ASoC: soc-dai: add snd_soc_pcm_dai_remove() ASoC: soc-dai: add snd_soc_dai_compr_start() ASoC: soc-dai: add snd_soc_dai_compr_shutdown() ASoC: soc-dai: add snd_soc_dai_compr_trigger() ASoC: soc-dai: add snd_soc_dai_compr_set_params() ASoC: soc-dai: add snd_soc_dai_compr_get_params() ASoC: soc-dai: add snd_soc_dai_compr_ack() ASoC: soc-dai: add snd_soc_dai_compr_pointer() ASoC: soc-dai: add snd_soc_dai_compr_set_metadata() ASoC: soc-dai: add snd_soc_dai_compr_get_metadata() include/sound/soc-dai.h | 41 +++- sound/soc/soc-compress.c | 104 ++++----- sound/soc/soc-core.c | 85 +------- sound/soc/soc-dai.c | 453 +++++++++++++++++++++++++++++---------- sound/soc/soc-pcm.c | 50 +---- 5 files changed, 434 insertions(+), 299 deletions(-) -- 2.17.1 commit fd443a20c2f0950f3c31765a08f7dd49b3bc69cb Author: Arnd Bergmann Date: Tue Apr 28 23:46:14 2020 +0200 ASoC: rt5682: fix I2C/Soundwire dependencies If one of the two is a loadable module, the combined driver must not be built-in: aarch64-linux-ld: sound/soc/codecs/rt5682.o: in function `rt5682_sdw_hw_free': rt5682.c:(.text+0xb34): undefined reference to `sdw_stream_remove_slave' aarch64-linux-ld: sound/soc/codecs/rt5682.o: in function `rt5682_sdw_hw_params': rt5682.c:(.text+0xe78): undefined reference to `sdw_stream_add_slave' In particular, the soundwire driver must not be built-in if CONFIG_I2C=m. Fixes: 5549ea647997 ("ASoC: rt5682: fix unmet dependencies") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200428214642.3925004-1-arnd@arndb.de Signed-off-by: Mark Brown commit 087e3900a060cfc8516e02ea83fe6122da490d23 Author: Arnd Bergmann Date: Tue Apr 28 23:28:08 2020 +0200 ASoC: fsl_easrc: mark PM functions __maybe_unused ifdefs are hard, and in this driver the suspend/resume functions are the only callers of some other helpers that trigger a harmless warning when CONFIG_PM is disabled: sound/soc/fsl/fsl_easrc.c:1807:12: warning: 'fsl_easrc_get_firmware' defined but not used [-Wunused-function] 1807 | static int fsl_easrc_get_firmware(struct fsl_asrc *easrc) | ^~~~~~~~~~~~~~~~~~~~~~ sound/soc/fsl/fsl_easrc.c:303:12: warning: 'fsl_easrc_resampler_config' defined but not used [-Wunused-function] 303 | static int fsl_easrc_resampler_config(struct fsl_asrc *easrc) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Remove the #ifdef and just mark the callers as __maybe_unused to suppress the warnings altogether. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Arnd Bergmann Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/20200428212847.2926376-1-arnd@arndb.de Signed-off-by: Mark Brown commit 58911c240783e0d1e7d457832416eb3347b8abbb Author: Ville Syrjälä Date: Tue Apr 28 20:19:25 2020 +0300 drm: Nuke mode->hsync Let's just calculate the hsync rate on demand. No point in wasting space storing it and risking the cached value getting out of sync with reality. v2: Move drm_mode_hsync() next to its only users Drop the TODO Reviewed-by: Sam Ravnborg Reviewed-by: Emil Velikov #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200428171940.19552-2-ville.syrjala@linux.intel.com commit accea322f5439df22b19465bbe67b836f36165e8 Author: Christoph Hellwig Date: Tue Apr 28 13:27:56 2020 +0200 block: add a bio_queue_enter helper Add a little helper that passes the right nowait flag to blk_queue_enter based on the bio flag, and terminates the bio with the right error code if entering the queue fails. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0376e9efe18388bd486a65edbc16d34b84bddc8f Author: Christoph Hellwig Date: Tue Apr 28 13:27:55 2020 +0200 block: replace BIO_QUEUE_ENTERED with BIO_CGROUP_ACCT BIO_QUEUE_ENTERED is only used for cgroup accounting now, so rename the flag and move setting it into the cgroup code. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 760f83ea63a7b2c12b3b1e656b24cbb880b6b814 Author: Christoph Hellwig Date: Tue Apr 28 13:27:54 2020 +0200 block: cleanup the memory stall accounting in submit_bio Instead of a convoluted chain just check for REQ_OP_READ directly, and keep all the memory stall code together in a single unlikely branch. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Weiner Signed-off-by: Jens Axboe commit 3fdd40861d800a4e1eb67c5158e8ab90076e2f93 Author: Christoph Hellwig Date: Tue Apr 28 13:27:53 2020 +0200 block: improve the submit_bio and generic_make_request documentation The current documentation is a little weird, as it doesn't clearly explain which function to use, and also has the guts of the information on generic_make_request, which is the internal interface for stacking drivers. Fix this up by properly documenting submit_bio, and only documenting the differences and the use case for generic_make_request. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Jens Axboe commit 288d3f142bd64abf1f99c6e06109c67811ab94a7 Author: Linus Walleij Date: Tue Apr 14 10:57:18 2020 +0200 ARM: defconfig: u8500: Enable new drivers for ux500 The new device tree for samsung-skomer and the HREF520 devicetree enables some additional drivers that are not yet selected in the u8500_defconfig: - The GPIO-based I2C bus master driver for some peripherals that do not use the I2C hardware master. - The Novatek NT35510 driver for the Skomer panel. - The Sony ACX424AKP driver for the HREF520 panel. - The GPIO-based backlight driver for Skomer. - The BMA180 driver for the BMA254 accelerometer found in the Skomer. - The new GP2AP002 driver for the GP2AP002S00F proximimty sensor found in the Skomer and Golden devices. Cc: Stephan Gerhold Signed-off-by: Linus Walleij commit e1b586f2b83d56f40faa5f23d5ecac866d61320d Author: Zheng Bin Date: Wed Apr 29 09:36:32 2020 +0800 blk-mq: make function '__blk_mq_sched_dispatch_requests' static Fix sparse warnings: block/blk-mq-sched.c:209:5: warning: symbol '__blk_mq_sched_dispatch_requests' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zheng Bin Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7440f518dad9d861d76c64956641eeddd3586f75 Author: Sudip Mukherjee Date: Fri Apr 24 17:19:44 2020 +0100 thermal/drivers/ti-soc-thermal: Avoid dereferencing ERR_PTR On error the function ti_bandgap_get_sensor_data() returns the error code in ERR_PTR() but we only checked if the return value is NULL or not. And, so we can dereference an error code inside ERR_PTR. While at it, convert a check to IS_ERR_OR_NULL. Signed-off-by: Sudip Mukherjee Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200424161944.6044-1-sudipm.mukherjee@gmail.com commit 60689de46c7f6a0028c8b37b6f03db68cbfad8ed Author: Rajkumar Manoharan Date: Fri Apr 24 15:41:39 2020 -0700 mac80211: fix memory overlap due to variable length param As of now HE operation element in bss_conf includes variable length optional field followed by other HE variable. Though the optional field never be used, actually it is referring to next member of the bss_conf structure which is not correct. Fix it by declaring needed HE operation fields within bss_conf itself. Signed-off-by: Rajkumar Manoharan Link: https://lore.kernel.org/r/1587768108-25248-2-git-send-email-rmanohar@codeaurora.org Signed-off-by: Johannes Berg commit 1512bc076e5ba2c4e8a189a4dbc883d59b4c37ef Author: Jouni Malinen Date: Sat Apr 25 18:57:13 2020 +0300 mac80211_hwsim: Claim support for setting Beacon frame TX legacy rate mac80211 takes care of rate control for the Beacon frames, so all mac80211_hwsim needs to do here is advertise support for this. Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20200425155713.25687-5-jouni@codeaurora.org Signed-off-by: Johannes Berg commit 08fad438bed0ada1a3308987862327286fcbb5f5 Author: Jouni Malinen Date: Sat Apr 25 18:57:12 2020 +0300 mac80211: TX legacy rate control for Beacon frames Use the Beacon frame specific legacy rate configuration, if specified for AP or mesh, instead of the generic rate mask when selecting the TX rate for Beacon frames. Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20200425155713.25687-4-jouni@codeaurora.org Signed-off-by: Johannes Berg commit 8c35a195761107f314fce8e558699322027c3017 Author: Dan Carpenter Date: Wed Apr 29 16:24:25 2020 +0300 drm/i915/selftests: fix error handling in __live_lrc_indirect_ctx_bb() If intel_context_create() fails then it leads to an error pointer dereference. I shuffled things around to make error handling easier. Fixes: 1dd47b54baea ("drm/i915: Add live selftests for indirect ctx batchbuffers") Signed-off-by: Dan Carpenter Reviewed-by: Chris Wilson Reviewed-by: Andi Shyti Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200429132425.GE815283@mwanda commit bedd7904e86c02ae80513c212ea25789d8bf4fb4 Author: Jouni Malinen Date: Sat Apr 25 18:57:11 2020 +0300 mac80211_hwsim: Advertise support for multicast RX registration While mac80211_hwsim does not need this to configure RX filters, it is convenient to have this enabled for testing purposes. Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20200425155713.25687-3-jouni@codeaurora.org Signed-off-by: Johannes Berg commit 24aac336ff78eb55aedda043ed982c61dc3ac49a Author: Chris Wilson Date: Tue Apr 28 10:02:55 2020 +0100 drm/i915: Avoid dereferencing a dead context Once the intel_context is closed, the GEM context may be freed and so the link from intel_context.gem_context is invalid. <3>[ 219.782944] BUG: KASAN: use-after-free in intel_engine_coredump_alloc+0x1bc3/0x2250 [i915] <3>[ 219.782996] Read of size 8 at addr ffff8881d7dff0b8 by task kworker/0:1/12 <4>[ 219.783052] CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G U 5.7.0-rc2-g1f3ffd7683d54-kasan_118+ #1 <4>[ 219.783055] Hardware name: System manufacturer System Product Name/Z170 PRO GAMING, BIOS 3402 04/26/2017 <4>[ 219.783105] Workqueue: events heartbeat [i915] <4>[ 219.783109] Call Trace: <4>[ 219.783113] <4>[ 219.783119] dump_stack+0x96/0xdb <4>[ 219.783177] ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915] <4>[ 219.783182] print_address_description.constprop.6+0x16/0x310 <4>[ 219.783239] ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915] <4>[ 219.783295] ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915] <4>[ 219.783300] __kasan_report+0x137/0x190 <4>[ 219.783359] ? intel_engine_coredump_alloc+0x1bc3/0x2250 [i915] <4>[ 219.783366] kasan_report+0x32/0x50 <4>[ 219.783426] intel_engine_coredump_alloc+0x1bc3/0x2250 [i915] <4>[ 219.783481] execlists_reset+0x39c/0x13d0 [i915] <4>[ 219.783494] ? mark_held_locks+0x9e/0xe0 <4>[ 219.783546] ? execlists_hold+0xfc0/0xfc0 [i915] <4>[ 219.783551] ? lockdep_hardirqs_on+0x348/0x5f0 <4>[ 219.783557] ? _raw_spin_unlock_irqrestore+0x34/0x60 <4>[ 219.783606] ? execlists_submission_tasklet+0x118/0x3a0 [i915] <4>[ 219.783615] tasklet_action_common.isra.14+0x13b/0x410 <4>[ 219.783623] ? __do_softirq+0x1e4/0x9a7 <4>[ 219.783630] __do_softirq+0x226/0x9a7 <4>[ 219.783643] do_softirq_own_stack+0x2a/0x40 <4>[ 219.783647] <4>[ 219.783692] ? heartbeat+0x3e2/0x10f0 [i915] <4>[ 219.783696] do_softirq.part.13+0x49/0x50 <4>[ 219.783700] __local_bh_enable_ip+0x1a2/0x1e0 <4>[ 219.783748] heartbeat+0x409/0x10f0 [i915] <4>[ 219.783801] ? __live_idle_pulse+0x9f0/0x9f0 [i915] <4>[ 219.783806] ? lock_acquire+0x1ac/0x8a0 <4>[ 219.783811] ? process_one_work+0x811/0x1870 <4>[ 219.783827] ? rcu_read_lock_sched_held+0x9c/0xd0 <4>[ 219.783832] ? rcu_read_lock_bh_held+0xb0/0xb0 <4>[ 219.783836] ? _raw_spin_unlock_irq+0x1f/0x40 <4>[ 219.783845] process_one_work+0x8ca/0x1870 <4>[ 219.783848] ? lock_acquire+0x1ac/0x8a0 <4>[ 219.783852] ? worker_thread+0x1d0/0xb80 <4>[ 219.783864] ? pwq_dec_nr_in_flight+0x2c0/0x2c0 <4>[ 219.783870] ? do_raw_spin_lock+0x129/0x290 <4>[ 219.783886] worker_thread+0x82/0xb80 <4>[ 219.783895] ? __kthread_parkme+0xaf/0x1b0 <4>[ 219.783902] ? process_one_work+0x1870/0x1870 <4>[ 219.783906] kthread+0x34e/0x420 <4>[ 219.783911] ? kthread_create_on_node+0xc0/0xc0 <4>[ 219.783918] ret_from_fork+0x3a/0x50 <3>[ 219.783950] Allocated by task 1264: <4>[ 219.783975] save_stack+0x19/0x40 <4>[ 219.783978] __kasan_kmalloc.constprop.3+0xa0/0xd0 <4>[ 219.784029] i915_gem_create_context+0xa2/0xab8 [i915] <4>[ 219.784081] i915_gem_context_create_ioctl+0x1fa/0x450 [i915] <4>[ 219.784085] drm_ioctl_kernel+0x1d8/0x270 <4>[ 219.784088] drm_ioctl+0x676/0x930 <4>[ 219.784092] ksys_ioctl+0xb7/0xe0 <4>[ 219.784096] __x64_sys_ioctl+0x6a/0xb0 <4>[ 219.784100] do_syscall_64+0x94/0x530 <4>[ 219.784103] entry_SYSCALL_64_after_hwframe+0x49/0xb3 <3>[ 219.784120] Freed by task 12: <4>[ 219.784141] save_stack+0x19/0x40 <4>[ 219.784145] __kasan_slab_free+0x130/0x180 <4>[ 219.784148] kmem_cache_free_bulk+0x1bd/0x500 <4>[ 219.784152] kfree_rcu_work+0x1d8/0x890 <4>[ 219.784155] process_one_work+0x8ca/0x1870 <4>[ 219.784158] worker_thread+0x82/0xb80 <4>[ 219.784162] kthread+0x34e/0x420 <4>[ 219.784165] ret_from_fork+0x3a/0x50 Fixes: 2e46a2a0b014 ("drm/i915: Use explicit flag to mark unreachable intel_context") Signed-off-by: Chris Wilson Acked-by: Akeem G Abodunrin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200428090255.10035-1-chris@chris-wilson.co.uk commit d530b9864073a714a6b6dcddee77c9b24074071f Author: Johannes Berg Date: Tue Apr 28 10:14:03 2020 +0200 staging: wilc1000: adjust for management frame register API changes Adjust to the API changes in cfg80211 for management frame registration. Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API") Signed-off-by: Johannes Berg Reviewed-by: Sergey Matyukevich Acked-by: Greg Kroah-Hartman Acked-by: Ajay Singh Link: https://lore.kernel.org/r/20200428101400.bac7e94c2bf8.I6a2287b9f68f35aff5f6de409c5ffa388de760e2@changeid Signed-off-by: Johannes Berg commit 2e410da6a098a9ff25d22a56ecb724b3c36fd528 Author: Johannes Berg Date: Tue Apr 28 10:14:02 2020 +0200 staging: rtl8723bs: remove mgmt_frame_register method This was changed in cfg80211, so having it broke things, but there's no need to adjust since it's an empty implementation. Just remove it. Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API") Signed-off-by: Johannes Berg Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20200428101400.ae19d651ec38.Ieb15844bb5ab93b3d7931d6561f42e3316ef8251@changeid Signed-off-by: Johannes Berg commit 25cba461989c3ebf7236ec17a0ac3949dc80ce8c Author: YueHaibing Date: Wed Apr 29 21:28:05 2020 +0800 ALSA: seq: oss: remove unused inline function snd_seq_oss_timer_is_realtime There's no callers in-tree. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200429132805.18712-1-yuehaibing@huawei.com Signed-off-by: Takashi Iwai commit da33574f7f1c110ec58ea43251a9a85801d6e015 Author: Tang Bin Date: Wed Apr 29 17:38:23 2020 +0800 ASoC: mxs-saif: Fix unused assignment Delete unused initialized value, because 'ret' will be assigined by the function of_alias_get_id(). Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200429093823.1372-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit 77be181e2c8e435692424ff2e5ee3d0380cabb90 Author: Seven Lee Date: Wed Apr 29 17:00:02 2020 +0800 ASoc: nau8810: add AUX related dapm widgets and routes This patch implements the following features: - AUX input for recording. - An input AUX output to SPK/MOUT. Signed-off-by: Seven Lee Link: https://lore.kernel.org/r/20200429090002.28556-1-wtli@nuvoton.com Signed-off-by: Mark Brown commit ee2cbe06935bfa58f1fe07dc2a2283945f4b97dc Author: Arnd Bergmann Date: Tue Apr 28 23:26:59 2020 +0200 ASoC: codecs: wm97xx: fix ac97 dependency A recent build fix got the dependency slightly wrong, breaking builds with CONFIG_AC97_BUS_NEW: WARNING: unmet direct dependencies detected for SND_SOC_WM9713 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n] Selected by [m]: - SND_SOC_ZYLONITE [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && MACH_ZYLONITE [=y] && AC97_BUS [=n]=n WARNING: unmet direct dependencies detected for SND_SOC_WM9712 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n] Selected by [m]: - SND_PXA2XX_SOC_EM_X270 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && (MACH_EM_X270 [=n] || MACH_EXEDA [=n] || MACH_CM_X300 [=y]) && AC97_BUS [=n]=n Change the dependency to allow either version of the AC97 library code. Fixes: 5a309875787d ("ASoC: Fix SND_SOC_ALL_CODECS imply ac97 fallout") Signed-off-by: Arnd Bergmann Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20200428212721.2877627-1-arnd@arndb.de Signed-off-by: Mark Brown commit be16a0f0dc8fab8e25d9cdbeb4f8f28afc9186d2 Author: Arnd Bergmann Date: Tue Apr 28 23:47:31 2020 +0200 ASoC: component: suppress uninitialized-variable warning Old versions of gcc (tested on gcc-4.8) produce a warning for correct code: sound/soc/soc-compress.c: In function 'soc_compr_open': sound/soc/soc-compress.c:75:28: error: 'component' is used uninitialized in this function [-Werror=uninitialized] struct snd_soc_component *component, *save = NULL; Change the for_each_rtd_components() macro to ensure 'component' gets initialized to a value the compiler does not complain about. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200428214754.3925368-1-arnd@arndb.de Signed-off-by: Mark Brown commit 964987738b3fe557cb1ee37acb4e7f85e29b7cea Author: Eric W. Biederman Date: Mon Apr 27 07:55:07 2020 -0500 posix-cpu-timers: Replace __get_task_for_clock with pid_for_clock Now that the codes store references to pids instead of referendes to tasks. Looking up a task for a clock instead of looking up a struct pid makes the code more difficult to verify it is correct than necessary. In posix_cpu_timers_create get_task_pid can race with release_task for threads and return a NULL pid. As put_pid and cpu_timer_task_rcu handle NULL pids just fine the code works without problems but it is an extra case to consider and keep in mind while verifying and modifying the code. There are races with de_thread to consider that only don't apply because thread clocks are only allowed for threads in the same thread_group. So instead of leaving a burden for people making modification to the code in the future return a rcu protected struct pid for the clock instead. The logic for __get_task_for_pid and lookup_task has been folded into the new function pid_for_clock with the only change being the logic has been modified from working on a task to working on a pid that will be returned. In posix_cpu_clock_get instead of calling pid_for_clock checking the result and then calling pid_task to get the task. The result of pid_for_clock is fed directly into pid_task. This is safe because pid_task handles NULL pids. As such an extra error check was unnecessary. Instead of hiding the flag that enables the special clock_gettime handling, I have made the 3 callers just pass the flag in themselves. That is less code and seems just as simple to work with as the wrapper functions. Historically the clock_gettime special case of allowing a process clock to be found by the thread id did not even exist [33ab0fec3352] but Thomas Gleixner reports that he has found code that uses that functionality [55e8c8eb2c7b]. Link: https://lkml.kernel.org/r/87zhaxqkwa.fsf@nanos.tec.linutronix.de/ Ref: 33ab0fec3352 ("posix-timers: Consolidate posix_cpu_clock_get()") Ref: 55e8c8eb2c7b ("posix-cpu-timers: Store a reference to a pid not a task") Signed-off-by: "Eric W. Biederman" commit a780e485b5768e78aef087502499714901b68cc4 Author: Jian Cai Date: Wed Apr 29 01:20:11 2020 +0100 ARM: 8971/1: replace the sole use of a symbol with its definition ALT_UP_B macro sets symbol up_b_offset via .equ to an expression involving another symbol. The macro gets expanded twice when arch/arm/kernel/sleep.S is assembled, creating a scenario where up_b_offset is set to another expression involving symbols while its current value is based on symbols. LLVM integrated assembler does not allow such cases, and based on the documentation of binutils, "Values that are based on expressions involving other symbols are allowed, but some targets may restrict this to only being done once per assembly", so it may be better to avoid such cases as it is not clearly stated which targets should support or disallow them. The fix in this case is simple, as up_b_offset has only one use, so we can replace the use with the definition and get rid of up_b_offset. Link:https://github.com/ClangBuiltLinux/linux/issues/920 Reviewed-by: Stefan Agner Reviewed-by: Nick Desaulniers Signed-off-by: Jian Cai Signed-off-by: Russell King commit 7ae4a78daacf240a8247cde73337dc4b26d253da Author: Masahiro Yamada Date: Wed Apr 22 14:08:53 2020 +0100 ARM: 8969/1: decompressor: simplify libfdt builds Copying source files during the build time may not end up with as clean code as expected. lib/fdt*.c simply wrap scripts/dtc/libfdt/fdt*.c, and it works nicely. Let's follow this approach for the arm decompressor, too. Add four wrappers, arch/arm/boot/compressed/fdt*.c and remove the Makefile messes. Another nice thing is we no longer need to maintain the own libfdt_env.h because the decompressor can include . There is a subtle problem when generated files are turned into check-in files. When you are doing a rebuild of an existing object tree with O= option, there exists stale "shipped" copies that the old Makefile implementation created. The build system ends up with compiling the stale generated files because Make searches for prerequisites in the current directory, i.e. $(objtree) first, and then the directory listed in VPATH, i.e. $(srctree). To mend this issue, I added the following code: ifdef building_out_of_srctree $(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c)) endif This will need to stay for a while because "git bisect" crossing this commit, otherwise, would result in a build error. Signed-off-by: Masahiro Yamada Signed-off-by: Russell King commit 94d7281993a7933bf60ea733eeb8a8bad429bf1c Author: Kuninori Morimoto Date: Fri Apr 24 08:15:59 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_get_metadata() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_get_metadata(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87eesdssi8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 88b3a7dfe999b3e28f65be69787a1fd97b742b4f Author: Kuninori Morimoto Date: Fri Apr 24 08:15:54 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_set_metadata() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_set_metadata(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87ftctssid.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ed38cc5909e72e30815f72e73cba34a3dbbb5494 Author: Kuninori Morimoto Date: Fri Apr 24 08:15:49 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_pointer() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_pointer(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87h7x9ssii.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 53294353a05ceaa6a107e8c1c300af63c89c8e50 Author: Kuninori Morimoto Date: Fri Apr 24 08:15:45 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_ack() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_ack(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87imhpssim.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit adbef5432666e20616263792d13cab80d57d9d5f Author: Kuninori Morimoto Date: Fri Apr 24 08:15:40 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_get_params() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_get_params(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87k125ssir.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8dfedafb5c711b5a13c938e06e8143540f773ecf Author: Kuninori Morimoto Date: Fri Apr 24 08:15:36 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_set_params() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_set_params(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87lfmlssiv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit eb08411bdf48cff69f7226c86a97fba1ef5045e6 Author: Kuninori Morimoto Date: Fri Apr 24 08:15:32 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_trigger() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_trigger(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87mu71ssiz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2b25f81d43b764142699a430da0ca57ffcb33cc2 Author: Kuninori Morimoto Date: Fri Apr 24 08:15:28 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_shutdown() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_shutdown(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87o8rhssj3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b5ae4ccea5ab15adcde64f4474b36e4a630434ec Author: Kuninori Morimoto Date: Fri Apr 24 08:15:24 2020 +0900 ASoC: soc-dai: add snd_soc_dai_compr_start() dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_start(). Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87pnbxssj7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7eaa313bdec3f2326c9cdacec88fd484a36c423b Author: Kuninori Morimoto Date: Fri Apr 24 08:15:20 2020 +0900 ASoC: soc-dai: add snd_soc_pcm_dai_remove() We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_remove() to snd_soc_pcm_dai_remove(). This patch do it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87r1wdssjc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 51801aeafdc9c1d55e5e71e58a1bbbd2583328fa Author: Kuninori Morimoto Date: Fri Apr 24 08:15:15 2020 +0900 ASoC: soc-dai: add snd_soc_pcm_dai_probe() We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_probe() to snd_soc_pcm_dai_probe(). This patch do it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87sggtssjg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 30819358ae73326269ba61597be47d5036e05b08 Author: Kuninori Morimoto Date: Fri Apr 24 08:15:09 2020 +0900 ASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger() We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update soc_pcm_bespoke_trigger() to snd_soc_pcm_dai_bespoke_trigger(). This patch do it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87tv19ssjm.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 42f2472d4689c00d742b6690aa6579966f0b2f83 Author: Kuninori Morimoto Date: Fri Apr 24 08:15:04 2020 +0900 ASoC: soc-dai: add snd_soc_pcm_dai_trigger() We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_trigger() to snd_soc_pcm_dai_trigger(). This patch do it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87v9lpssjr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d108c7fd0b776d5b48acd15f6f52b1bb8255a69e Author: Kuninori Morimoto Date: Fri Apr 24 08:14:53 2020 +0900 ASoC: soc-dai: add snd_soc_pcm_dai_prepare() We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_prepare() to snd_soc_pcm_dai_prepare(). This patch do it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87wo65ssk2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0b73ba550cdd95b0fdca5da0040c29ae5d25ae5d Author: Kuninori Morimoto Date: Fri Apr 24 08:14:48 2020 +0900 ASoC: soc-dai: add snd_soc_pcm_dai_new() We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update soc_dai_pcm_new() to snd_soc_pcm_dai_new(). This patch do it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87y2qlssk7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 479914ed779d408273fb3cac4c061dbe695f17cb Author: Kuninori Morimoto Date: Fri Apr 24 08:14:43 2020 +0900 ASoC: soc-dai: don't overwide dai->driver->ops Current ASoC overwrites null_dai_ops to dai->driver->ops if it was NULL. But, we can remove it if framework always checks dai->driver->ops when it uses DAI callbacks. This patch do it, and removes null_dai_ops. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/87zhb1sskc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit aa7b8230d4c3d0e691604dc908887904f52f2ab8 Author: Kuninori Morimoto Date: Fri Apr 24 08:14:38 2020 +0900 ASoC: soc-dai: add soc_dai_err() At soc-dai.c, it is good idea to indicate error function and its component name if there was error. This patch adds soc_dai_err() for it. Signed-off-by: Kuninori Morimoto Reviewed-By: Ranjani Sridharan Link: https://lore.kernel.org/r/871rodu74x.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8d0910121b070b4edf4239d91cf9a4523b33ca0c Author: Douglas Anderson Date: Tue Apr 28 17:23:28 2020 -0700 gpio: Make "offset" and "unsigned int", not just "unsigned" When I copied the function prototypes from the GPIO header file into my own driver, checkpatch yelled at me saying that I shouldn't use use "unsigned" but instead should say "unsigned int". Let's make the header file use "unsigned int" so others who copy like I did won't get yelled at. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200428172322.2.Iacb3c8152c3cf9015a91308678155a578b0cc050@changeid Signed-off-by: Linus Walleij commit 36b5215436ad115551e12478ceb3be4a2279e415 Author: Douglas Anderson Date: Tue Apr 28 17:23:27 2020 -0700 gpio: Document proper return value for gpio drivers The legacy defines GPIOF_DIR_XXX are only for consumers. Document the proper ones. Also: don't use "_XXX" since that's harder to find with "git grep". Just list both of the values. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200428172322.1.I396f351e364f3c09df7c7606e79abefb8682c092@changeid Signed-off-by: Linus Walleij commit fece98260f31292dd468925c7582065bf6193212 Author: Eric W. Biederman Date: Mon Apr 27 09:38:29 2020 -0500 posix-cpu-timers: Replace cpu_timer_pid_type with clock_pid_type Taking a clock and returning a pid_type is a more general and a superset of taking a timer and returning a pid_type. Perform this generalization so that future changes may use this code on clocks as well as timers. Signed-off-by: "Eric W. Biederman" commit 9bf7c32409354b4a2fa3207d369a22c8233f718c Author: Eric W. Biederman Date: Sat Apr 25 18:38:54 2020 -0500 posix-cpu-timers: Extend rcu_read_lock removing task_struct references Now that the code stores of pid references it is no longer necessary or desirable to take a reference on task_struct in __get_task_for_clock. Instead extend the scope of rcu_read_lock and remove the reference counting on struct task_struct entirely. Signed-off-by: "Eric W. Biederman" commit eba933ceebf212127c9aa1c87a162867af9cf781 Author: Hanjun Guo Date: Mon Apr 27 17:34:21 2020 +0800 cpuidle: sysfs: Minor coding style corrections Fix two minor coding style issues. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit 2f516e7cbe88f05023b6cc458d3a22b7dc56af99 Author: Hanjun Guo Date: Mon Apr 27 17:34:20 2020 +0800 cpuidle: sysfs: Remove the unused define_one_r(o/w) macros The define_one_ro and define_one_rw macros are not used, remove it. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki commit 6fdeb6cbe1ef3bccd2c5e2b3427a06e9cda1efc2 Author: Uwe Kleine-König Date: Mon Apr 20 20:27:52 2020 +0300 gpio: pca953x: drop unused parameters of pca953x_recalc_addr() After the previous patch the two last parameters of pca953x_recalc_addr() are unused and so can be dropped. Tested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit bcf41dc480b179bfb669a232080a2e26dc7294b4 Author: Uwe Kleine-König Date: Mon Apr 20 20:27:51 2020 +0300 gpio: pca953x: fix handling of automatic address incrementing Some of the chips supported by the pca953x driver need the most significant bit in the address word set to automatically increment the address pointer on subsequent reads and writes (example: PCA9505). With this bit unset the same register is read multiple times on a multi-byte read sequence. Other chips must not have this bit set and autoincrement always (example: PCA9555). Up to now this AI bit was interpreted to be part of the address, which resulted in inconsistent regmap caching when a register was written with AI set and then read without it. This happened for the PCA9505 in pca953x_gpio_set_multiple() where pca953x_read_regs() bulk read from the cache for registers 0x8-0xc and then wrote to registers 0x88-0x8c. (Side note: reading 5 values from offset 0x8 yiels OP0 5 times because AI must be set to get OP0-OP4, which is another bug that is resolved here as a by-product.) The same problem happens when calls to gpio_set_value() and gpio_set_array_value() were mixed. With this patch the AI bit is always set for chips that support it. This works as there are no code locations that make use of the behaviour with AI unset (for the chips that support it). Note that the call to pca953x_setup_gpio() had to be done a bit earlier to make the NBANK macro work. The history of this bug is a bit complicated. Commit b32cecb46bdc ("gpio: pca953x: Extract the register address mangling to single function") changed which chips and functions are affected. Commit 3b00691cc46a ("gpio: pca953x: hack to fix 24 bit gpio expanders") used some duct tape to make the driver at least appear to work. Commit 49427232764d ("gpio: pca953x: Perform basic regmap conversion") introduced the caching. Commit b4818afeacbd ("gpio: pca953x: Add set_multiple to allow multiple bits to be set in one write.") introduced the .set_multiple() callback which didn't work for chips that need the AI bit which was fixed later for some chips in 8958262af3fb ("gpio: pca953x: Repair multi-byte IO address increment on PCA9575"). So I'm sorry, I don't know which commit I should pick for a Fixes: line. Tested-by: Marcel Gudert Signed-off-by: Uwe Kleine-König Tested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 6f793485fc03fe832e1abcf0682efd7b4419ae2d Author: Andy Shevchenko Date: Mon Apr 20 20:27:50 2020 +0300 gpio: pca953x: Rewrite ->get_multiple() function The commit 96d7c7b3e654 ("gpio: gpio-pca953x, Add get_multiple function") basically did everything wrong from style and code reuse perspective, i.e. - it didn't utilize existing PCA953x internal helpers - it didn't utilize bitmap API - it misses the point that ilog2(), besides that BANK_SFT is useless, can be used in macros - it has indentation issues. Rewrite the function completely. Cc: Paul Thomas Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 7aa428dfc83c8f2c2d1b184b960efb9bc790c0d8 Author: Zenyu Sy Date: Sun Apr 26 06:00:48 2020 +0000 greybus: fix typos in GREYBUS/GREYBUS_ES2 help text Fix typos ("an" -> "a", "chose" -> "choose") in Kconfig Signed-off-by: Zenyu Sy Link: https://lore.kernel.org/r/20200426060048.14019-1-zenyu@tuta.io Signed-off-by: Greg Kroah-Hartman commit e51759f56d314d28c25be7606b03791f048e44c7 Author: Hans Verkuil Date: Thu Apr 23 13:42:32 2020 +0200 media: v4l2-ctrls.h: clarify the p_def argument of v4l2_ctrl_new_std_compound It was not sufficiently clear how to create and use p_def. Improve the documentation. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e5ad7db4b2f35aaed796669b47e24c6d79cab3d0 Author: Hans Verkuil Date: Tue Apr 21 11:23:41 2020 +0200 media: cec-gpio: handle gpiod_get_value errors correctly gpiod_get_value() can return negative values if an error occurs. In several places this error code was ignored. Ensure that errors codes are handled correctly throughout the CEC pin framework and CEC pin drivers. The return code of the cec_pin_ops read() callback had to be changed from 'bool' to 'int', which mean the prototype of that callback in the sun4i drm driver also had to be changed. Signed-off-by: Hans Verkuil Reported-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab commit fcab45adb853a668e9b2f653e792770399bb441a Author: Hans Verkuil Date: Mon Apr 20 14:57:38 2020 +0200 media: vidioc-reqbufs/create-bufs.rst: fix typo any others capabilities -> any other capabilities Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9cc056e6064c8fd4bb43df7e7276249ddce89339 Author: Lukas Bulwahn Date: Sat Apr 18 11:45:46 2020 +0200 media: MAINTAINERS: adjust entries to moving CEC USB drivers Commit a81068181aad ("media: move CEC USB drivers to a separate directory") moved drivers/media/usb/{pulse8,rainshadow}-cec to drivers/media/cec/usb/{rainshadow,pulse8}, but did not adjust the entries in MAINTAINERS. Since then, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: drivers/media/usb/pulse8-cec/* warning: no file matches F: drivers/media/usb/rainshadow-cec/* Update the MAINTAINERS entries to the new file locations. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9a42a5ff3daccc37ae4dbcfb6ce5c5d95419740b Author: Niklas Söderlund Date: Fri Apr 17 17:09:29 2020 +0200 media: vimc: cap: Report a colorspace The colorspace reported by a video nodes should not be V4L2_COLORSPACE_DEFAULT. Instead a default colorspace should be picked by the driver if V4L2_COLORSPACE_DEFAULT is given by userspace to {G,S,TRY}_FMT. The colorspace V4L2_COLORSPACE_SRGB is arbitrary chosen as the vimc default format to report as it's used for most webcams. Signed-off-by: Niklas Söderlund Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b7ba9f34800aee62e1ffcd4386a421116e09f4fe Author: Sean Young Date: Wed Apr 22 21:16:46 2020 +0200 media: si2157: ensure wait_status is initialized smatch reports wait_status is uninitialized, because smatch cannot assume the loop body is ever executed. Clarify the code so that wait_status is retrieved at least once. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 408d0244421c1e76e9910b10d4f82f086b9751b3 Author: Sean Young Date: Tue Apr 21 12:19:27 2020 +0200 media: rc: no need for decoder state if decoder not enabled One struct ir_raw_event_ctrl is allocated per raw IR device; reduce the amount allocated if not all decoders are enabled. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit c4ed27cfed45c16c2dd16c9fa3b883e306177e40 Author: Sean Young Date: Thu Apr 16 16:22:15 2020 +0200 media: m88ds3103: error in set_frontend is swallowed and not reported Bail out if registers can not be updated. Addresses-Coverity-ID: 1461655 ("Code maintainability issues") Reported-by: coverity-bot Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod") Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 1d09094aa6205545cf895bc6965664a5f16af99a Author: Mark Rutland Date: Tue Apr 28 17:49:21 2020 +0100 arm64: vdso: use consistent 'map' nomenclature The current code doesn't use a consistent naming scheme for structures, enums, or variables, making it harder than necessary to determine the relationship between these. Let's make this easier by consistently using 'map' nomenclature for mappings created in userspace, minimizing redundant comments, and using designated array initializers to tie indices to their respective elements. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Vincenzo Frascino Cc: Will Deacon Link: https://lore.kernel.org/r/20200428164921.41641-5-mark.rutland@arm.com Signed-off-by: Will Deacon commit d3418f3839b667842eba8688ca8ebe84eca158db Author: Mark Rutland Date: Tue Apr 28 17:49:20 2020 +0100 arm64: vdso: use consistent 'abi' nomenclature The current code doesn't use a consistent naming scheme for structures, enums, or variables, making it harder than necessary to determine the relationship between these. Let's make this easier by consistently using 'vdso_abi' nomenclature. The 'vdso_lookup' array is renamed to 'vdso_info' to describe what it contains rather than how it is consumed. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Vincenzo Frascino Cc: Will Deacon Link: https://lore.kernel.org/r/20200428164921.41641-4-mark.rutland@arm.com Signed-off-by: Will Deacon commit 3ee16ff3437ca5388d8b60a122fde94f896f50d3 Author: Mark Rutland Date: Tue Apr 28 17:49:19 2020 +0100 arm64: vdso: simplify arch_vdso_type ifdeffery Currently we have some ifdeffery to determine the number of elements in enum arch_vdso_type as VDSO_TYPES, rather that the usual pattern of having the enum define this: | enum foo_type { | FOO_TYPE_A, | FOO_TYPE_B, | #ifdef CONFIG_C | FOO_TYPE_C, | #endif | NR_FOO_TYPES | } ... however, given we only use this number to size the vdso_lookup[] array, this is redundant anyway as the compiler can automatically size the array to fit all defined elements. So let's remove the VDSO_TYPES to simplify the code. At the same time, let's use designated initializers for the array elements so that these are guarnateed to be at the expected indices, regardless of how we modify the structure. For clariy the redundant explicit initialization of the enum elements is dropped. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Vincenzo Frascino Cc: Will Deacon Link: https://lore.kernel.org/r/20200428164921.41641-3-mark.rutland@arm.com Signed-off-by: Will Deacon commit 74fc72e77dc5c8033d1b47d2c8a7229b4b83a746 Author: Mark Rutland Date: Tue Apr 28 17:49:18 2020 +0100 arm64: vdso: remove aarch32_vdso_pages[] The aarch32_vdso_pages[] array is unnecessarily confusing. We only ever use the C_VECTORS and C_SIGPAGE slots, and the other slots are unused despite having corresponding mappings (sharing pages with the AArch64 vDSO). Let's make this clearer by using separate variables for the vectors page and the sigreturn page. A subsequent patch will clean up the C_* naming and conflation of pages with mappings. Note that since both the vectors page and sig page are single pages, and the mapping is a single page long, their pages array do not need to be NULL-terminated (and this was not the case with the existing code for the sig page as it was the last entry in the aarch32_vdso_pages array). There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Vincenzo Frascino Cc: Will Deacon Link: https://lore.kernel.org/r/20200428164921.41641-2-mark.rutland@arm.com Signed-off-by: Will Deacon commit 16afd70af5b21b6d73a03b9c36f78b9cf004a0dd Author: Martin Blumenstingl Date: Fri Apr 17 20:41:27 2020 +0200 clk: meson: meson8b: Make the CCF use the glitch-free VPU mux The "vpu_0" or "vpu_1" clock trees should not be updated while the clock is running. Enforce this by setting CLK_SET_RATE_GATE on the "vpu_0" and "vpu_1" gates. This makes the CCF switch to the "vpu_1" tree when "vpu_0" is currently active and vice versa, which is exactly what the vendor driver does when updating the frequency of the VPU clock. Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200417184127.1319871-5-martin.blumenstingl@googlemail.com commit 8bb629cfb28f4dad9d47f69249366e50ae5edc25 Author: Martin Blumenstingl Date: Fri Apr 17 20:41:26 2020 +0200 clk: meson: meson8b: Fix the vclk_div{1, 2, 4, 6, 12}_en gate bits The DIV{1,2,4,6,12}_EN bits are actually located in HHI_VID_CLK_CNTL register: - HHI_VID_CLK_CNTL[0] = DIV1_EN - HHI_VID_CLK_CNTL[1] = DIV2_EN - HHI_VID_CLK_CNTL[2] = DIV4_EN - HHI_VID_CLK_CNTL[3] = DIV6_EN - HHI_VID_CLK_CNTL[4] = DIV12_EN Update the bits accordingly so we will enable the bits in the correct register once we switch these clocks to be mutable. Fixes: 6cb57c678bb70e ("clk: meson: meson8b: add the read-only video clock trees") Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200417184127.1319871-4-martin.blumenstingl@googlemail.com commit 0d3051c790ed2ef6bd91b92b07220313f06b95b3 Author: Martin Blumenstingl Date: Fri Apr 17 20:41:25 2020 +0200 clk: meson: meson8b: Fix the polarity of the RESET_N lines CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_POST and CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_PRE are active low. This means: - asserting them requires setting the register value to 0 - de-asserting them requires setting the register value to 1 Set the register value accordingly for these two reset lines by setting the inverted the register value compared to all other reset lines. Fixes: 189621726bc2f6 ("clk: meson: meson8b: register the built-in reset controller") Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200417184127.1319871-3-martin.blumenstingl@googlemail.com commit da1978ac3d6cf278dedf5edbf350445a0fff2f08 Author: Martin Blumenstingl Date: Fri Apr 17 20:41:24 2020 +0200 clk: meson: meson8b: Fix the first parent of vid_pll_in_sel Use hdmi_pll_lvds_out as parent of the vid_pll_in_sel clock. It's not easy to see that the vendor kernel does the same, but it actually does. meson_clk_pll_ops in mainline still cannot fully recalculate all rates from the HDMI PLL registers because some register bits (at the time of writing it's unknown which bits are used for this) double the HDMI PLL output rate (compared to simply considering M, N and FRAC) for some (but not all) PLL settings. Update the vid_pll_in_sel parent so our clock calculation works for simple clock settings like the CVBS output (where no rate doubling is going on). The PLL ops need to be fixed later on for more complex clock settings (all HDMI rates). Fixes: 6cb57c678bb70 ("clk: meson: meson8b: add the read-only video clock trees") Suggested-by: Neil Armstrong Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200417184127.1319871-2-martin.blumenstingl@googlemail.com commit 61365ca7b24f1cb106a4c619c94610862bbec778 Author: Linus Walleij Date: Wed Apr 15 14:14:49 2020 +0200 backlight: l4f00242t03: Convert to GPIO descriptors This converts the l4f00242t03 backlight driver to use GPIO descriptors and switches the two Freescale i.MX boards over to passing descriptors instead of global GPIO numbers. We use the typical names "enable" and "reset" as found in the device tree bindings for panel GPIOs. This saves a lot of code in the driver and makes it possible to get rid of the platform data header altogether. Signed-off-by: Linus Walleij Reviewed-by: Daniel Thompson Acked-by: Shawn Guo Signed-off-by: Lee Jones commit 878b0ba5c4d299a6cf5438e6b9b9950f875a9819 Author: Marek Vasut Date: Wed Apr 22 12:46:13 2020 +0200 ARM: dts: stm32: Rename LEDs to match silkscreen on AV96 The LED labels do not match the silkscreen on the board, fix it. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit e74ef3823b4db49ae44966ab710d6c6b298ec0b4 Author: Marek Vasut Date: Wed Apr 22 12:46:12 2020 +0200 ARM: dts: stm32: Add bindings for USB on AV96 Fill in the bindings for USB host and gadget on AV96. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit e027da342772cb31b1e7f67666465c0535c5acb3 Author: Marek Vasut Date: Wed Apr 22 12:46:11 2020 +0200 ARM: dts: stm32: Add bindings for audio on AV96 Fill in the bindings for HDMI audio on AV96, this permits audio playback via attached HDMI device if such device supports it. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit dcf185ca8175b3324f8616f848c94d4bf554b76b Author: Marek Vasut Date: Wed Apr 22 12:46:10 2020 +0200 ARM: dts: stm32: Add alternate pinmux for SAI2 pins on stm32mp15 Add new mux option for SAI2 pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 64e86752d7df5ac8dc83620607da850a20c47a2c Author: Marek Vasut Date: Wed Apr 22 12:46:09 2020 +0200 ARM: dts: stm32: Add bindings for HDMI video on AV96 Fill in the HDMI video pipeline from AV96 into the DT. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 0752cc4c66712914396dd4695f5a609ddd6aecf2 Author: Marek Vasut Date: Wed Apr 22 12:46:08 2020 +0200 ARM: dts: stm32: Add alternate pinmux for LTDC pins on stm32mp15 Add new mux option for LTDC pins, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 224771c947640613a822e7c8fa0d6d7d87fbd266 Author: Marek Vasut Date: Wed Apr 22 12:46:07 2020 +0200 ARM: dts: stm32: Enable Bluetooth on AV96 The WiFi/Bluetooth chip is attached to USART2 on AV96 as well, describe it in DT to make it available. Remove BT LED and turn it into a shutdown GPIO, because the GPIO line controls the BT_REG_ON signal. The LED is just an indicator connected to the same line, but not the primary function. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 077e0638fc8384c07d9647b9f73ec0d49b2f910e Author: Marek Vasut Date: Wed Apr 22 12:46:06 2020 +0200 ARM: dts: stm32: Add alternate pinmux for USART2 pins on stm32mp15 Add mux option for USART2 pins, this is used on AV96 board. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 7dd5cbba42c93897d43f9ad21e5e3e8069c21bfc Author: Marek Vasut Date: Wed Apr 22 12:46:05 2020 +0200 ARM: dts: stm32: Enable WiFi on AV96 The WiFi/Bluetooth SDIO chip is attached to SDMMC3 on AV96, describe it in DT to make it available. Remove WiFi LED and turn it into a regulator, because it is a GPIO controlling the WL_REG_ON input of the WiFi chip. The LED is just an indicator connected to the same line, but not the primary function. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 84faf29b2d529a10cd71e609ddb237a5af8551a4 Author: Marek Vasut Date: Wed Apr 22 12:46:04 2020 +0200 ARM: dts: stm32: Add configuration EEPROM on AV96 The board has an EEPROM on the same I2C bus as PMIC, at address 0x53. The EEPROM contains the board MAC address. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 76045bc4571043212dbcb59b4f531c97a6ba13ac Author: Marek Vasut Date: Wed Apr 22 12:46:03 2020 +0200 ARM: dts: stm32: Add QSPI NOR on AV96 The DH Electronics DHCOR SOM has QSPI NOR on the SoM itself, add it into the DT. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 611325f681023a6f7f04f60bb2293dfbb7f2acad Author: Marek Vasut Date: Wed Apr 22 12:46:02 2020 +0200 ARM: dts: stm32: Add eMMC attached to SDMMC2 on AV96 Add DT node describing the eMMC attached to SDMMC2 controller of the STM32MP1 on DHCOR SoM, which is the SoM soldered on AV96. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit e1ea5c1721ae88f6d886108064f5c679580b6fc5 Author: Marek Vasut Date: Wed Apr 22 12:46:01 2020 +0200 ARM: dts: stm32: Repair SDMMC1 operation on AV96 The SD uses different pinmux for the D123DIRline, use such a pinmux, otherwise there is a pinmux collision on the AV96. Add missing SD voltage regulator switch. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit e88cee378719e5f7941c5c2c19a398773ad86092 Author: Marek Vasut Date: Wed Apr 22 12:46:00 2020 +0200 ARM: dts: stm32: Add alternate pinmux for SDMMC pins on stm32mp15 Add another mux option for SDMMC1_D123DIR direction pins, SDMMC2 pins 4..7, and SDMMC3 pins PD5_SDMMC3_D2 and PD0_SDMMC3_CMD, this is used on AV96 board. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 701f9e65e5d6418a7c051762e87ade39b9dd88dc Author: Marek Vasut Date: Wed Apr 22 12:45:59 2020 +0200 ARM: dts: stm32: Add missing ethernet PHY skews on AV96 The KS9031 PHY supports configurable PHY skews to compensate for the board routing. Fill in the correct values. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 010ca9fe500bfe365860b50220ff80541c18f0e1 Author: Marek Vasut Date: Wed Apr 22 12:45:58 2020 +0200 ARM: dts: stm32: Add missing ethernet PHY reset on AV96 Add PHY reset GPIO on AV96 ethernet PHY. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 3ed6bd31ba31eea5a4cc0ce1fa89c8d9f2134eba Author: Marek Vasut Date: Wed Apr 22 12:45:57 2020 +0200 ARM: dts: stm32: Repair ethernet operation on AV96 The AV96 RGMII uses different pinmux for ETH_RGMII_TXD0, ETH_RGMII_RXD2 and ETH_RGMII_TX_CTL. Use the correct pinmux to make ethernet operational. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 7354ba62fa1e1af11ef16b84c963a23facf92070 Author: Marek Vasut Date: Wed Apr 22 12:45:56 2020 +0200 ARM: dts: stm32: Add alternate pinmux for ethernet RGMII on stm32mp15 Add another mux option for DWMAC RGMII, this is used on AV96 board. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit f3aa3bc3a5841e9da07e0235c3ac386c2deba002 Author: Marek Vasut Date: Wed Apr 22 12:45:55 2020 +0200 ARM: dts: stm32: Repair PMIC interrupt on AV96 The PMIC interrupt line is connected to PA0 on the DHCOR SoM, fix it. This makes the POWER button on the AV96 working, and also all the other PMIC interrupts. Furthermore, scrub the bogus interrupt-parent props. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit dff503ab76b4af30f064d45198e9ff6b35e8655d Author: Marek Vasut Date: Wed Apr 22 12:45:54 2020 +0200 ARM: dts: stm32: Repair PMIC configuration on AV96 The vdd PMIC buck regulator was misconfigured, which caused instability of the board and malfunction of high-speed interfaces, like the RGMII. Configure the PMIC correctly to repair these problems. Also add missing Enpirion regulator for the IO voltage into the DT. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 839b480dd11144f258d0b1babf33cc7c604adeb4 Author: Thomas Zimmermann Date: Thu Apr 23 09:40:03 2020 +0200 MAINTAINERS: Restore alphabetical sorting MAINTAINERS got sorted in commit 4400b7d68f6e ("MAINTAINERS: sort entries by entry name") Merging from drm-next into drm-misc-next duplicated some of the entries by restoring old, unsorted sections. Restore the sorted list by removing the duplicates. Signed-off-by: Thomas Zimmermann Fixes: 08d99b2c23df ("Merge drm/drm-next into drm-misc-next") Acked-by: Sam Ravnborg Cc: Thomas Zimmermann Cc: Mauro Carvalho Chehab Cc: Rob Herring Cc: "David S. Miller" Cc: Greg Kroah-Hartman Cc: Neil Armstrong Cc: Laurent Pinchart Cc: Jernej Skrabec Cc: Jonas Karlman Cc: Douglas Anderson Cc: Jerome Brunet Cc: Dariusz Marcinkiewicz Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200423074003.9637-1-tzimmermann@suse.de commit 2ea4a7ba9bf6e3bc1af899d1af481eb9b4ae8707 Author: Nathan Chancellor Date: Tue Apr 28 20:00:52 2020 -0700 drm/i915/gt: Avoid uninitialized use of rpcurupei in frequency_show When building with clang + -Wuninitialized: drivers/gpu/drm/i915/gt/debugfs_gt_pm.c:407:7: warning: variable 'rpcurupei' is uninitialized when used here [-Wuninitialized] rpcurupei, ^~~~~~~~~ drivers/gpu/drm/i915/gt/debugfs_gt_pm.c:304:16: note: initialize the variable 'rpcurupei' to silence this warning u32 rpcurupei, rpcurup, rpprevup; ^ = 0 1 warning generated. rpupei is assigned twice; based on the second argument to intel_uncore_read, it seems this one should have been assigned to rpcurupei. Fixes: 9c878557b1eb ("drm/i915/gt: Use the RPM config register to determine clk frequencies") Link: https://github.com/ClangBuiltLinux/linux/issues/1016 Signed-off-by: Nathan Chancellor Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200429030051.920203-1-natechancellor@gmail.com commit b8469159632818064084397a010f34e156a393db Author: Tudor Ambarus Date: Tue Apr 21 06:31:32 2020 +0000 mtd: spi-nor: Fix description of the sr_ready() return value The functions return 1 if ready, 0 if not ready, -errno on errors. Signed-off-by: Tudor Ambarus Reviewed-by: Vignesh Raghavendra commit 8aadd77cd27172988414408f43bb9e5bef01b14d Author: Tudor Ambarus Date: Tue Apr 21 06:31:31 2020 +0000 mtd: spi-nor: Uniformize the return value in spi_nor_*_ready() spi_nor_ready() returns 1 if ready, 0 if not ready and -errno on errors. Do the same in all the spi_nor_*_ready() children. Signed-off-by: Tudor Ambarus Reviewed-by: Vignesh Raghavendra commit f80ff13135cb44a9be96f695d19212ae952ee5f4 Author: Jungseung Lee Date: Tue Apr 21 15:33:13 2020 +0900 mtd: spi-nor: micron-st: Enable locking for n25q00 n25q00 uses the 4 bit Block Protection scheme and supports Top/Bottom protection via the BP and TB bits of the Status Register. Enable locking for n25q00. Tested with cirrus controller. Signed-off-by: Jungseung Lee Signed-off-by: Tudor Ambarus commit 6c660819d533e307ec94095f146c48ca6a377d4f Author: Yangbo Lu Date: Mon Apr 27 11:51:31 2020 +0800 arm64: dts: fsl: add fsl,extts-fifo property for fman ptp The 1588 timer supports external trigger timestamp FIFO on FMan on QorIQ ARM platforms. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Signed-off-by: Shawn Guo commit 8c30e7caac7467a89a69b22d1de7b489aa26b8a8 Author: Anson Huang Date: Sat Apr 25 20:29:50 2020 +0800 arm64: dts: imx8mn: Update VDD_ARM 1.2GHz setpoint voltage The latest datasheet Rev. 0.1, 03/2020 removes below constrain: "If VDD_SOC/GPU/DDR = 0.95V, then VDD_ARM must be >= 0.95V." So, for 1.2GHz setpoint VDD_ARM can use its typical voltage directly. The datasheet can be downloaded from below link: https://www.nxp.com/docs/en/data-sheet/IMX8MNCEC.pdf Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit ac082ea87d9d6489ee26579e3cdad8d128495213 Author: Yuantian Tang Date: Fri Apr 17 14:16:18 2020 +0800 arm64: dts: lx2160a: add more thermal zone support There are 7 thermal zones in lx2160a soc. Add the rest thermal zone node to enable them. Also correct one of the values for tmu-calibration property. Signed-off-by: Yuantian Tang Signed-off-by: Shawn Guo commit d394039c1abe834ca060cc4edbb7a6ecb3cf747b Author: Anson Huang Date: Fri Apr 17 13:39:06 2020 +0800 arm64: dts: imx8qxp-mek: Add PMIC thermal zone support i.MX8QXP MEK board has PMIC thermal sensor, add support for it. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit bc3895b29de373432e1ed019cc8c9504affc5736 Author: Anson Huang Date: Fri Apr 17 13:39:05 2020 +0800 arm64: dts: imx8qxp-mek: Sort labels alphabetically Sort the labels alphabetically for consistency. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit fd9c40c575a023c6dc9faecce1af81a464615375 Merge: 3271e8f3f63d e4e8f4d047fd Author: Alexei Starovoitov Date: Tue Apr 28 19:48:06 2020 -0700 Merge branch 'test_progs-asan' Andrii Nakryiko says: ==================== Add necessary infra to build selftests with ASAN (or any other sanitizer). Fix a bunch of found memory leaks and other memory access issues. v1->v2: - don't add ASAN flavor, but allow extra flags for build (Alexei); - fix few more found issues, which somehow were missed first time. ==================== Signed-off-by: Alexei Starovoitov commit e4e8f4d047fdcf7ac7d944e266e85d8041f16cd6 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:11 2020 -0700 selftests/bpf: Add runqslower binary to .gitignore With recent changes, runqslower is being copied into selftests/bpf root directory. So add it into .gitignore. Fixes: b26d1e2b6028 ("selftests/bpf: Copy runqslower to OUTPUT directory") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Cc: Veronika Kabatova Link: https://lore.kernel.org/bpf/20200429012111.277390-12-andriin@fb.com commit 8d30e80a049ad699264e4a12911e349f93c7279a Author: Andrii Nakryiko Date: Tue Apr 28 18:21:10 2020 -0700 selftests/bpf: Fix bpf_link leak in ns_current_pid_tgid selftest If condition is inverted, but it's also just not necessary. Fixes: 1c1052e0140a ("tools/testing/selftests/bpf: Add self-tests for new helper bpf_get_ns_current_pid_tgid.") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Cc: Carlos Neira Link: https://lore.kernel.org/bpf/20200429012111.277390-11-andriin@fb.com commit 36d0b6159f6a6f51f600bf1777702f7036fb9839 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:09 2020 -0700 selftests/bpf: Disable ASAN instrumentation for mmap()'ed memory read AddressSanitizer assumes that all memory dereferences are done against memory allocated by sanitizer's malloc()/free() code and not touched by anyone else. Seems like this doesn't hold for perf buffer memory. Disable instrumentation on perf buffer callback function. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-10-andriin@fb.com commit 3521ffa2ee9a48c3236c93f54ae11c074490ebce Author: Andrii Nakryiko Date: Tue Apr 28 18:21:08 2020 -0700 libbpf: Fix huge memory leak in libbpf_find_vmlinux_btf_id() BTF object wasn't freed. Fixes: a6ed02cac690 ("libbpf: Load btf_vmlinux only once per object.") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Cc: KP Singh Link: https://lore.kernel.org/bpf/20200429012111.277390-9-andriin@fb.com commit 13c908495e5d51718a6da84ae925fa2aac056380 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:07 2020 -0700 selftests/bpf: Fix invalid memory reads in core_relo selftest Another one found by AddressSanitizer. input_len is bigger than actually initialized data size. Fixes: c7566a69695c ("selftests/bpf: Add field existence CO-RE relocs tests") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-8-andriin@fb.com commit 9f56bb531a809ecaa7f0ddca61d2cf3adc1cb81a Author: Andrii Nakryiko Date: Tue Apr 28 18:21:06 2020 -0700 selftests/bpf: Fix memory leak in extract_build_id() getline() allocates string, which has to be freed. Fixes: 81f77fd0deeb ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Cc: Song Liu Link: https://lore.kernel.org/bpf/20200429012111.277390-7-andriin@fb.com commit f25d5416d64c796aa639136eb0b076c8bd579b54 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:05 2020 -0700 selftests/bpf: Fix memory leak in test selector Free test selector substrings, which were strdup()'ed. Fixes: b65053cd94f4 ("selftests/bpf: Add whitelist/blacklist of test names to test_progs") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-6-andriin@fb.com commit 229bf8bf4d910510bc1a2fd0b89bd467cd71050d Author: Andrii Nakryiko Date: Tue Apr 28 18:21:04 2020 -0700 libbpf: Fix memory leak and possible double-free in hashmap__clear Fix memory leak in hashmap_clear() not freeing hashmap_entry structs for each of the remaining entries. Also NULL-out bucket list to prevent possible double-free between hashmap__clear() and hashmap__free(). Running test_progs-asan flavor clearly showed this problem. Reported-by: Alston Tang Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-5-andriin@fb.com commit 42fce2cfb405e613f0355c4f92429d651bf0a5b3 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:03 2020 -0700 selftests/bpf: Convert test_hashmap into test_progs test Fold stand-alone test_hashmap test into test_progs. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-4-andriin@fb.com commit 02995dd4bb02a5359a08e44abb3c18c2f456bd19 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:02 2020 -0700 selftests/bpf: Add SAN_CFLAGS param to selftests build to allow sanitizers Add ability to specify extra compiler flags with SAN_CFLAGS for compilation of all user-space C files. This allows to build all of selftest programs with, e.g., custom sanitizer flags, without requiring support for such sanitizers from anyone compiling selftest/bpf. As an example, to compile everything with AddressSanitizer, one would do: $ make clean && make SAN_CFLAGS="-fsanitize=address" For AddressSanitizer to work, one needs appropriate libasan shared library installed in the system, with version of libasan matching what GCC links against. E.g., GCC8 needs libasan5, while GCC7 uses libasan4. For CentOS 7, to build everything successfully one would need to: $ sudo yum install devtoolset-8-gcc devtoolset-libasan-devel $ scl enable devtoolset-8 bash # set up environment For Arch Linux to run selftests, one would need to install gcc-libs package to get libasan.so.5: $ sudo pacman -S gcc-libs N.B. EXTRA_CFLAGS name wasn't used, because it's also used by libbpf's Makefile and this causes few issues: 1. default "-g -Wall" flags are overriden; 2. compiling shared library with AddressSanitizer generates a bunch of symbols like: "_GLOBAL__sub_D_00099_0_btf_dump.c", "_GLOBAL__sub_D_00099_0_bpf.c", etc, which screws up versioned symbols check. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Cc: Julia Kartseva Link: https://lore.kernel.org/bpf/20200429012111.277390-3-andriin@fb.com commit 76148faa161e7cfb2d7719f35b37d7db4f3f8596 Author: Andrii Nakryiko Date: Tue Apr 28 18:21:01 2020 -0700 selftests/bpf: Ensure test flavors use correct skeletons Ensure that test runner flavors include their own skeletons from / directory. Previously, skeletons generated for no-flavor test_progs were used. Apart from fixing correctness, this also makes it possible to compile only flavors individually: $ make clean && make test_progs-no_alu32 ... now succeeds ... Fixes: 74b5a5968fe8 ("selftests/bpf: Replace test_progs and test_maps w/ general rule") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-2-andriin@fb.com commit ebfa8951e6cd22cf3bc2e1207a62eea498325dd5 Author: Matt Porter Date: Wed Apr 15 14:59:41 2020 -0400 arm64: dts: imx8mm: specify #sound-dai-cells for SAI nodes Add #sound-dai-cells properties to SAI nodes. Signed-off-by: Matt Porter Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 86b08bd5b99480b79a25343f24c1b8c4ddcb5c09 Author: Russell King Date: Wed Apr 15 16:44:17 2020 +0100 ARM: dts: imx6-sr-som: add ethernet PHY configuration Add ethernet PHY configuration ahead of removing the quirk that configures the clocking mode for the PHY. The RGMII delay is already set correctly. Signed-off-by: Russell King Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 849af490b6a674ba0636fbf95ac048b87ad2eb94 Author: Abel Vesa Date: Wed Apr 15 11:02:48 2020 +0300 dt-bindings: clocks: imx8mp: Add ids for audiomix clocks Add all the clock ids for the audiomix clocks. Signed-off-by: Abel Vesa Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Shawn Guo commit 01d5bea4d390eb171af845034a152dee9e997b70 Author: Abel Vesa Date: Wed Apr 15 11:02:47 2020 +0300 clk: imx: Add helpers for passing the device as argument All the imx clocks that need to be registered by the audiomix need to pass on the device so that the runtime PM support could work properly. Signed-off-by: Abel Vesa Reviewed-by: Stephen Boyd Reviewed-by: Peng Fan Signed-off-by: Shawn Guo commit 55a8b3cdff54a0e6faa43a41c8e1eb47e56c6831 Author: Abel Vesa Date: Wed Apr 15 11:02:46 2020 +0300 clk: imx: pll14xx: Add the device as argument when registering In order to allow runtime PM, the device needs to be passed on to the register function. Audiomix clock controller, used on i.MX8MP and future platforms, registers a pll14xx and has runtime PM support. Signed-off-by: Abel Vesa Reviewed-by: Stephen Boyd Signed-off-by: Shawn Guo commit 1e54afe9fcfe99cf913526cbcb0128e4a91d0621 Author: Abel Vesa Date: Wed Apr 15 11:02:45 2020 +0300 clk: imx: gate2: Allow single bit gating clock Audiomix on i.MX8MP registers two gates that share the same enable count but use the same bit to control the gate instead of two bits. By adding the flag IMX_CLK_GATE2_SINGLE_BIT we allow the gate2 to use the generic gate ops for enable, disable and is_enabled. For the disable_unused, nothing happens if this flag is specified. Signed-off-by: Abel Vesa Reviewed-by: Stephen Boyd Signed-off-by: Shawn Guo commit 4ee2fc81a631a3a2a45f3f6939323e8a5fea1e29 Author: Jason Yan Date: Tue Apr 28 14:33:59 2020 +0800 usb: chipidea: usb2: remove unneeded semicolon Fix the following coccicheck warning: drivers/usb/chipidea/ci_hdrc_usb2.c:75:28-29: Unneeded semicolon Fixes: c2de37b31f17 ("usb: chipidea: usb2: make clock optional") Reviewed-by: Michał Mirosław Signed-off-by: Jason Yan Signed-off-by: Peter Chen commit dfb25edd972af23819efcded636d0df5ab37c38f Merge: a97bf49f824e 37518fa49f76 Author: Jason Gunthorpe Date: Tue Apr 28 21:44:51 2020 -0300 Merge branch 'mlx5_ib_qp_refactor_1' into rdma.git for-next Leon Romanovsky says: ==================== This is first part of series which tries to return some sanity to mlx5_ib_create_qp() function. Such refactoring is required to make extension of that function with less worries of breaking driver. Extra goal of such refactoring is to ensure that QP is allocated at the beginning of function and released at the end. It will allow us to move QP allocation to be under IB/core responsibility. ==================== Based on the mlx5-next branch at git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Due to dependencies * branch 'mlx5_ib_qp_refactor_1': (66 commits) RDMA/mlx5: Process all vendor flags in one place RDMA/mlx5: Return all configured create flags through query QP RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags RDMA/mlx5: Use flags_en mechanism to mark QP created with WQE signature RDMA/mlx5: Process create QP flags in one place RDMA/mlx5: Delete create QP flags obfuscation RDMA/mlx5: Initial separation of RAW_PACKET QP from common flow RDMA/mlx5: Remove second copy from user for non RSS RAW QPs RDMA/mlx5: Move DRIVER QP flags check into separate function RDMA/mlx5: Update all DRIVER QP places to use QP subtype RDMA/mlx5: Split scatter CQE configuration for DCT QP RDMA/mlx5: Separate create QP flows to be based on type RDMA/mlx5: Set QP subtype immediately when it is known RDMA/mlx5: Avoid setting redundant NULL for XRC QPs RDMA/mlx5: Prepare QP allocation for future removal RDMA/mlx5: Perform check if QP creation flow is valid RDMA/mlx5: Delete impossible GSI port check RDMA/mlx5: Organize QP types checks in one place Signed-off-by: Jason Gunthorpe commit 3271e8f3f63d4793ce9e4a00d3f8b436b9e8d5b4 Merge: 1f427a807799 646f02ffdd49 Author: Alexei Starovoitov Date: Tue Apr 28 17:35:03 2020 -0700 Merge branch 'BTF-map-in-map' Andrii Nakryiko says: ==================== This patch set teaches libbpf how to declare and initialize ARRAY_OF_MAPS and HASH_OF_MAPS maps. See patch #3 for all the details. Patch #1 refactors parsing BTF definition of map to re-use it cleanly for inner map definition parsing. Patch #2 refactors map creation and destruction logic for reuse. It also fixes existing bug with not closing successfully created maps when bpf_object map creation overall fails. Patch #3 adds support for an extension of BTF-defined map syntax, as well as parsing, recording, and use of relocations to allow declaratively initialize outer maps with references to inner maps. v1->v2: - rename __inner to __array (Alexei). ==================== Signed-off-by: Alexei Starovoitov commit 646f02ffdd49c466cb81642c2b013beb80092d01 Author: Andrii Nakryiko Date: Tue Apr 28 17:27:39 2020 -0700 libbpf: Add BTF-defined map-in-map support As discussed at LPC 2019 ([0]), this patch brings (a quite belated) support for declarative BTF-defined map-in-map support in libbpf. It allows to define ARRAY_OF_MAPS and HASH_OF_MAPS BPF maps without any user-space initialization code involved. Additionally, it allows to initialize outer map's slots with references to respective inner maps at load time, also completely declaratively. Despite a weak type system of C, the way BTF-defined map-in-map definition works, it's actually quite hard to accidentally initialize outer map with incompatible inner maps. This being C, of course, it's still possible, but even that would be caught at load time and error returned with helpful debug log pointing exactly to the slot that failed to be initialized. As an example, here's a rather advanced HASH_OF_MAPS declaration and initialization example, filling slots #0 and #4 with two inner maps: #include struct inner_map { __uint(type, BPF_MAP_TYPE_ARRAY); __uint(max_entries, 1); __type(key, int); __type(value, int); } inner_map1 SEC(".maps"), inner_map2 SEC(".maps"); struct outer_hash { __uint(type, BPF_MAP_TYPE_HASH_OF_MAPS); __uint(max_entries, 5); __uint(key_size, sizeof(int)); __array(values, struct inner_map); } outer_hash SEC(".maps") = { .values = { [0] = &inner_map2, [4] = &inner_map1, }, }; Here's the relevant part of libbpf debug log showing pretty clearly of what's going on with map-in-map initialization: libbpf: .maps relo #0: for 6 value 0 rel.r_offset 96 name 260 ('inner_map1') libbpf: .maps relo #0: map 'outer_arr' slot [0] points to map 'inner_map1' libbpf: .maps relo #1: for 7 value 32 rel.r_offset 112 name 249 ('inner_map2') libbpf: .maps relo #1: map 'outer_arr' slot [2] points to map 'inner_map2' libbpf: .maps relo #2: for 7 value 32 rel.r_offset 144 name 249 ('inner_map2') libbpf: .maps relo #2: map 'outer_hash' slot [0] points to map 'inner_map2' libbpf: .maps relo #3: for 6 value 0 rel.r_offset 176 name 260 ('inner_map1') libbpf: .maps relo #3: map 'outer_hash' slot [4] points to map 'inner_map1' libbpf: map 'inner_map1': created successfully, fd=4 libbpf: map 'inner_map2': created successfully, fd=5 libbpf: map 'outer_hash': created successfully, fd=7 libbpf: map 'outer_hash': slot [0] set to map 'inner_map2' fd=5 libbpf: map 'outer_hash': slot [4] set to map 'inner_map1' fd=4 Notice from the log above that fd=6 (not logged explicitly) is used for inner "prototype" map, necessary for creation of outer map. It is destroyed immediately after outer map is created. See also included selftest with some extra comments explaining extra details of usage. Additionally, similar initialization syntax and libbpf functionality can be used to do initialization of BPF_PROG_ARRAY with references to BPF sub-programs. This can be done in follow up patches, if there will be a demand for this. [0] https://linuxplumbersconf.org/event/4/contributions/448/ Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200429002739.48006-4-andriin@fb.com commit 2d39d7c56f115148b05d1d8c6b8698a5730c8b53 Author: Andrii Nakryiko Date: Tue Apr 28 17:27:38 2020 -0700 libbpf: Refactor map creation logic and fix cleanup leak Factor out map creation and destruction logic to simplify code and especially error handling. Also fix map FD leak in case of partially successful map creation during bpf_object load operation. Fixes: 57a00f41644f ("libbpf: Add auto-pinning of maps when loading BPF objects") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20200429002739.48006-3-andriin@fb.com commit 41017e56af6cf99122c86655f60fe4e1b75ecf48 Author: Andrii Nakryiko Date: Tue Apr 28 17:27:37 2020 -0700 libbpf: Refactor BTF-defined map definition parsing logic Factor out BTF map definition logic into stand-alone routine for easier reuse for map-in-map case. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429002739.48006-2-andriin@fb.com commit 1f427a8077996f8aaefbc99e40ff3068ee627d8d Merge: 9b329d0dbe41 5d085ad2e68c Author: Alexei Starovoitov Date: Tue Apr 28 17:27:08 2020 -0700 Merge branch 'bpf_link-observability' Andrii Nakryiko says: ==================== This patch series adds various observability APIs to bpf_link: - each bpf_link now gets ID, similar to bpf_map and bpf_prog, by which user-space can iterate over all existing bpf_links and create limited FD from ID; - allows to get extra object information with bpf_link general and type-specific information; - implements `bpf link show` command which lists all active bpf_links in the system; - implements `bpf link pin` allowing to pin bpf_link by ID or from other pinned path. v2->v3: - improve spin locking around bpf_link ID (Alexei); - simplify bpf_link_info handling and fix compilation error on sh arch; v1->v2: - simplified `bpftool link show` implementation (Quentin); - fixed formatting of bpftool-link.rst (Quentin); - fixed attach type printing logic (Quentin); rfc->v1: - dropped read-only bpf_links (Alexei); - fixed bug in bpf_link_cleanup() not removing ID; - fixed bpftool link pinning search logic; - added bash-completion and man page. ==================== Signed-off-by: Alexei Starovoitov commit 5d085ad2e68cceec8332b23ea8f630a28b506366 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:14 2020 -0700 bpftool: Add link bash completions Extend bpftool's bash-completion script to handle new link command and its sub-commands. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20200429001614.1544-11-andriin@fb.com commit 7464d013ccd4db8544df5eddb05ddd509b9c46e5 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:13 2020 -0700 bpftool: Add bpftool-link manpage Add bpftool-link manpage with information and examples of link-related commands. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20200429001614.1544-10-andriin@fb.com commit c5481f9a954f27b8730c1dfeebbc9b3b5b2b2481 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:12 2020 -0700 bpftool: Add bpf_link show and pin support Add `bpftool link show` and `bpftool link pin` commands. Example plain output for `link show` (with showing pinned paths): [vmuser@archvm bpf]$ sudo ~/local/linux/tools/bpf/bpftool/bpftool -f link 1: tracing prog 12 prog_type tracing attach_type fentry pinned /sys/fs/bpf/my_test_link pinned /sys/fs/bpf/my_test_link2 2: tracing prog 13 prog_type tracing attach_type fentry 3: tracing prog 14 prog_type tracing attach_type fentry 4: tracing prog 15 prog_type tracing attach_type fentry 5: tracing prog 16 prog_type tracing attach_type fentry 6: tracing prog 17 prog_type tracing attach_type fentry 7: raw_tracepoint prog 21 tp 'sys_enter' 8: cgroup prog 25 cgroup_id 584 attach_type egress 9: cgroup prog 25 cgroup_id 599 attach_type egress 10: cgroup prog 25 cgroup_id 614 attach_type egress 11: cgroup prog 25 cgroup_id 629 attach_type egress Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20200429001614.1544-9-andriin@fb.com commit 50325b1761e31ad17d252e795af72a9af8c5a7d7 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:11 2020 -0700 bpftool: Expose attach_type-to-string array to non-cgroup code Move attach_type_strings into main.h for access in non-cgroup code. bpf_attach_type is used for non-cgroup attach types quite widely now. So also complete missing string translations for non-cgroup attach types. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20200429001614.1544-8-andriin@fb.com commit 2c2837b09e9ab4874353186599609fa2e1ccabce Author: Andrii Nakryiko Date: Tue Apr 28 17:16:10 2020 -0700 selftests/bpf: Test bpf_link's get_next_id, get_fd_by_id, and get_obj_info Extend bpf_obj_id selftest to verify bpf_link's observability APIs. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429001614.1544-7-andriin@fb.com commit 0dbc866832a0fbf9f2b98d412da44c5cfd1b7756 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:09 2020 -0700 libbpf: Add low-level APIs for new bpf_link commands Add low-level API calls for bpf_link_get_next_id() and bpf_link_get_fd_by_id(). Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429001614.1544-6-andriin@fb.com commit f2e10bff16a0fdd41ba278c84da9813700e356af Author: Andrii Nakryiko Date: Tue Apr 28 17:16:08 2020 -0700 bpf: Add support for BPF_OBJ_GET_INFO_BY_FD for bpf_link Add ability to fetch bpf_link details through BPF_OBJ_GET_INFO_BY_FD command. Also enhance show_fdinfo to potentially include bpf_link type-specific information (similarly to obj_info). Also introduce enum bpf_link_type stored in bpf_link itself and expose it in UAPI. bpf_link_tracing also now will store and return bpf_attach_type. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429001614.1544-5-andriin@fb.com commit 2d602c8cf40d65d4a7ac34fe18648d8778e6e594 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:07 2020 -0700 bpf: Support GET_FD_BY_ID and GET_NEXT_ID for bpf_link Add support to look up bpf_link by ID and iterate over all existing bpf_links in the system. GET_FD_BY_ID code handles not-yet-ready bpf_link by checking that its ID hasn't been set to non-zero value yet. Setting bpf_link's ID is done as the very last step in finalizing bpf_link, together with installing FD. This approach allows users of bpf_link in kernel code to not worry about races between user-space and kernel code that hasn't finished attaching and initializing bpf_link. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429001614.1544-4-andriin@fb.com commit a3b80e1078943dc12553166fb08e258463dec013 Author: Andrii Nakryiko Date: Tue Apr 28 17:16:06 2020 -0700 bpf: Allocate ID for bpf_link Generate ID for each bpf_link using IDR, similarly to bpf_map and bpf_prog. bpf_link creation, initialization, attachment, and exposing to user-space through FD and ID is a complicated multi-step process, abstract it away through bpf_link_primer and bpf_link_prime(), bpf_link_settle(), and bpf_link_cleanup() internal API. They guarantee that until bpf_link is properly attached, user-space won't be able to access partially-initialized bpf_link either from FD or ID. All this allows to simplify bpf_link attachment and error handling code. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429001614.1544-3-andriin@fb.com commit f9d041271cf44ca02eed0cc82e1a6d8c814c53ed Author: Andrii Nakryiko Date: Tue Apr 28 17:16:05 2020 -0700 bpf: Refactor bpf_link update handling Make bpf_link update support more generic by making it into another bpf_link_ops methods. This allows generic syscall handling code to be agnostic to various conditionally compiled features (e.g., the case of CONFIG_CGROUP_BPF). This also allows to keep link type-specific code to remain static within respective code base. Refactor existing bpf_cgroup_link code and take advantage of this. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429001614.1544-2-andriin@fb.com commit aa86e90794c8a76c38f2897aff6c1eaa3b96bba6 Author: Tang Bin Date: Wed Apr 15 12:27:27 2020 +0800 power: supply: axp288_charger: Omit superfluous error message In the axp288_charger_probe(), when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 37518fa49f764516ba68fcc6ec933066bb545276 Author: Leon Romanovsky Date: Mon Apr 27 18:46:18 2020 +0300 RDMA/mlx5: Process all vendor flags in one place Check that vendor flags provided through ucmd are valid. Link: https://lore.kernel.org/r/20200427154636.381474-19-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a8f3ea61e1c826a1f882b3fffbb052390ddee310 Author: Leon Romanovsky Date: Mon Apr 27 18:46:17 2020 +0300 RDMA/mlx5: Return all configured create flags through query QP The "flags" field in struct mlx5_ib_qp contains all UAPI flags configured at the create QP stage. Return all the data as is without masking. Link: https://lore.kernel.org/r/20200427154636.381474-18-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 90ecb37a751b6923bee846c4e19f73b943c6ffa1 Author: Leon Romanovsky Date: Mon Apr 27 18:46:16 2020 +0300 RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags In similar way to wqe_sig, the scat_cqe was treated differently from other create QP vendor flags. Change it to be similar to other flags and use flags_en mechanism. Link: https://lore.kernel.org/r/20200427154636.381474-17-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c95e6d53970254fa04a09c0fd79ae2cfa54cd1f5 Author: Leon Romanovsky Date: Mon Apr 27 18:46:15 2020 +0300 RDMA/mlx5: Use flags_en mechanism to mark QP created with WQE signature MLX5_QP_FLAG_SIGNATURE is exposed to the users but in the kernel the create_qp flow treated it differently from other MLX5_QP_FLAG_*s. Fix it by ditching wq_sig boolean variable and use general flag_en mechanism. Link: https://lore.kernel.org/r/20200427154636.381474-16-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2978975ce7f16131ddf70468f0b189231e33086b Author: Leon Romanovsky Date: Mon Apr 27 18:46:14 2020 +0300 RDMA/mlx5: Process create QP flags in one place create_flags is checked in too many places and scattered across all the code, consolidate all the checks inside one function, so we will be easily see the flow. As part of such change, delete unreachable code, because IB/core is responsible sanitize the input. Link: https://lore.kernel.org/r/20200427154636.381474-15-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2be08c308f102eeaee7ffc4a0d08ecee82b77f9d Author: Leon Romanovsky Date: Mon Apr 27 18:46:13 2020 +0300 RDMA/mlx5: Delete create QP flags obfuscation There is no point in redefinition of stable and exposed to users create flags. Their values won't be changed and it is equal to used by the mlx5. Delete the mlx5 definitions and use IB/core fields. Link: https://lore.kernel.org/r/20200427154636.381474-14-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5d0dc3d96c7b3bc6bc175754abcb132a1c94d02b Author: Leon Romanovsky Date: Mon Apr 27 18:46:12 2020 +0300 RDMA/mlx5: Initial separation of RAW_PACKET QP from common flow Create initial function for IB_QPT_RAW_PACKET flow. Link: https://lore.kernel.org/r/20200427154636.381474-13-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2dfac92dbb5d6e7607d5a4d3dc9d750f45440d98 Author: Leon Romanovsky Date: Mon Apr 27 18:46:11 2020 +0300 RDMA/mlx5: Remove second copy from user for non RSS RAW QPs Change the common code to use already copied user command buffer. Link: https://lore.kernel.org/r/20200427154636.381474-12-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2fdddbd5c966c1ff7e35b0e4d1fa4b951d0f5542 Author: Leon Romanovsky Date: Mon Apr 27 18:46:10 2020 +0300 RDMA/mlx5: Move DRIVER QP flags check into separate function Perform validation of DRIVER QP in relevant function. Link: https://lore.kernel.org/r/20200427154636.381474-11-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8bde2c509e4035fb4a200a60f82f85eec914145b Author: Leon Romanovsky Date: Mon Apr 27 18:46:09 2020 +0300 RDMA/mlx5: Update all DRIVER QP places to use QP subtype Instead of overwriting QP init attributes with driver QP subtype, use that subtype directly. This change will allow us to remove logic which cached QP init attributes. Link: https://lore.kernel.org/r/20200427154636.381474-10-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fd9dab7edc590a52ed141265fa7c88cf938e9be0 Author: Leon Romanovsky Date: Mon Apr 27 18:46:08 2020 +0300 RDMA/mlx5: Split scatter CQE configuration for DCT QP DCT QPs have separate creation flow and can be easily extracted from configure_responder_scat_cqe(), this makes both updated functions more clear. Link: https://lore.kernel.org/r/20200427154636.381474-9-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 47c806121a515bfee3180cced40af25cbf2ac10c Author: Leon Romanovsky Date: Mon Apr 27 18:46:07 2020 +0300 RDMA/mlx5: Separate create QP flows to be based on type Move driver QP creation flow to separate functions to simplify the create_qp() and allow future separation of create_qp_common() to subtypes. Link: https://lore.kernel.org/r/20200427154636.381474-8-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 318d2b06fbaa8fbce379a4e00901251b6368b4e3 Author: Leon Romanovsky Date: Mon Apr 27 18:46:06 2020 +0300 RDMA/mlx5: Set QP subtype immediately when it is known There is no need to delay QP subtype assignment to the end of the create_qp() function and it is better to move it to be immediately after it is checked so we would be able to rewrite later checks to be based on it and not on over-written struct ib_qp_init_attr. Link: https://lore.kernel.org/r/20200427154636.381474-7-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c86936e6eb13bf3759e4cc0629ccc0076dd763de Author: Leon Romanovsky Date: Mon Apr 27 18:46:05 2020 +0300 RDMA/mlx5: Avoid setting redundant NULL for XRC QPs There is no need to set NULL in recv_cq and send_cq, they are already set to NULL by the IB/core logic. Link: https://lore.kernel.org/r/20200427154636.381474-6-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9c2ba4ede4c0166d4e3bdc15e3b32c9680309ca1 Author: Leon Romanovsky Date: Mon Apr 27 18:46:04 2020 +0300 RDMA/mlx5: Prepare QP allocation for future removal Unify the QP memory allocation across different paths, so it will be in one place. Link: https://lore.kernel.org/r/20200427154636.381474-5-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2242cc25ce82058986ff7721e3d2464d775032df Author: Leon Romanovsky Date: Mon Apr 27 18:46:03 2020 +0300 RDMA/mlx5: Perform check if QP creation flow is valid Fast check that kernel and user flows provides enough data to create QP. Link: https://lore.kernel.org/r/20200427154636.381474-4-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1265d9f7a522423ef5234457a6d2a2f2a3ccad13 Author: Leon Romanovsky Date: Mon Apr 27 18:46:02 2020 +0300 RDMA/mlx5: Delete impossible GSI port check GSI QP is created in the kernel with very strict parameters, there is no possible way that port number will be wrong in such flow. Link: https://lore.kernel.org/r/20200427154636.381474-3-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6eb7edffb28558aaa3a3e625ac9dcd40fc603bc6 Author: Leon Romanovsky Date: Mon Apr 27 18:46:01 2020 +0300 RDMA/mlx5: Organize QP types checks in one place Perform check if QP type is supported in one place at the beginning of the create_qp function instead of current implementation with checks buried inside of the code. Link: https://lore.kernel.org/r/20200427154636.381474-2-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9b329d0dbe413bf46eb5010edd06b3076960a60a Author: Alexei Starovoitov Date: Tue Apr 28 15:30:48 2020 -0700 selftests/bpf: fix test_sysctl_prog with alu32 Similar to commit b7a0d65d80a0 ("bpf, testing: Workaround a verifier failure for test_progs") fix test_sysctl_prog.c as well. Signed-off-by: Alexei Starovoitov commit a45d88530b2552ad5ea0da18861600b4ecc9d0c7 Author: Richard Guy Briggs Date: Wed Apr 22 17:39:29 2020 -0400 netfilter: add audit table unregister actions Audit the action of unregistering ebtables and x_tables. See: https://github.com/linux-audit/audit-kernel/issues/44 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit bbd40fc4816d5329a89397206ece9f1763787a88 Author: Eric W. Biederman Date: Sun Apr 26 07:59:55 2020 -0500 signal: Remove has_group_leader_pid After the introduction of exchange_tids has_group_leader_pid is equivalent to thread_group_leader. After the last couple of cleanups has_group_leader_pid has no more callers. So remove the now unused and redundant has_group_leader_pid. Signed-off-by: "Eric W. Biederman" commit c4dad0aab3fca0c1f0baa4cc84b6ec91b7ebf426 Author: Richard Guy Briggs Date: Wed Apr 22 17:39:28 2020 -0400 audit: tidy and extend netfilter_cfg x_tables NETFILTER_CFG record generation was inconsistent for x_tables and ebtables configuration changes. The call was needlessly messy and there were supporting records missing at times while they were produced when not requested. Simplify the logging call into a new audit_log_nfcfg call. Honour the audit_enabled setting while more consistently recording information including supporting records by tidying up dummy checks. Add an op= field that indicates the operation being performed (register or replace). Here is the enhanced sample record: type=NETFILTER_CFG msg=audit(1580905834.919:82970): table=filter family=2 entries=83 op=replace Generate audit NETFILTER_CFG records on ebtables table registration. Previously this was being done for x_tables registration and replacement operations and ebtables table replacement only. See: https://github.com/linux-audit/audit-kernel/issues/25 See: https://github.com/linux-audit/audit-kernel/issues/35 See: https://github.com/linux-audit/audit-kernel/issues/43 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 610b818856e1477964b59040c740f6ec55883045 Author: Eric W. Biederman Date: Sun Apr 26 07:51:03 2020 -0500 exec: Remove BUG_ON(has_group_leader_pid) With the introduction of exchange_tids thread_group_leader and has_group_leader_pid have become equivalent. Further at this point in the code a thread group has exactly two threads, the previous thread_group_leader that is waiting to be reaped and tsk. So we know it is impossible for tsk to be the thread_group_leader. This is also the last user of has_group_leader_pid so removing this check will allow has_group_leader_pid to be removed. So remove the "BUG_ON(has_group_leader_pid)" that will never fire. Signed-off-by: "Eric W. Biederman" commit c7f5194054e103d18d267385b866b5b90511a425 Author: Eric W. Biederman Date: Tue Apr 28 13:00:39 2020 -0500 posix-cpu-timer: Unify the now redundant code in lookup_task Now that both !thread paths through lookup_task call thread_group_leader, unify them into the single test at the end of lookup_task. This unification just makes it clear what is happening in the gettime special case of lookup_task. Signed-off-by: "Eric W. Biederman" commit 8feebc6713cd78cbba8c4e2a6d92299669052026 Author: Eric W. Biederman Date: Mon Apr 27 14:32:54 2020 -0500 posix-cpu-timer: Tidy up group_leader logic in lookup_task Replace has_group_leader_pid with thread_group_leader. Years ago Oleg suggested changing thread_group_leader to has_group_leader_pid to handle races. Looking at the code then and now I don't see how it ever helped. Especially as then the code really did need to be the thread_group_leader. Today it doesn't make a difference if thread_group_leader races with de_thread as the task returned from lookup_task in the non-thread case is just used to find values in task->signal. Since the races with de_thread have never been handled revert has_group_header_pid to thread_group_leader for clarity. Update the comment in lookup_task to remove implementation details that are no longer true and to mention task->signal instead of task->sighand, as the relevant cpu timer details are all in task->signal. Ref: 55e8c8eb2c7b ("posix-cpu-timers: Store a reference to a pid not a task") Ref: c0deae8c9587 ("posix-cpu-timers: Rcu_read_lock/unlock protect find_task_by_vpid call") Signed-off-by: "Eric W. Biederman" commit c76c2230160d90b7bd814c0a5f2bfc657f7e0984 Merge: 790ab249b55d b9dd2bea2245 Author: David S. Miller Date: Tue Apr 28 14:40:29 2020 -0700 Merge branch 'net-ReST-convert' Mauro Carvalho Chehab says: ==================== net: manually convert files to ReST format - part 1 There are very few documents upstream that aren't converted upstream. This series convert part of the networking text files into ReST. It is part of a bigger set of patches, which were split on parts, in order to make reviewing task easier. The full series (including those ones) are at: https://git.linuxtv.org/mchehab/experimental.git/log/?h=net-docs And the documents, converted to HTML via the building system are at: https://www.infradead.org/~mchehab/kernel_docs/networking/ ==================== Signed-off-by: David S. Miller commit b9dd2bea2245dd8ba4f68e801af93e4b38bfe6b0 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:53 2020 +0200 docs: networking: convert kcm.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 82a07bf33d7d0c3a194f62178e0fea2d68227b89 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:52 2020 +0200 docs: networking: convert ipvs-sysctl.txt to ReST - add SPDX header; - add a document title; - mark lists as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Acked-by: Simon Horman Signed-off-by: David S. Miller commit 1dc2a785954bf4e562d0c85bea435ee56f705db5 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:51 2020 +0200 docs: networking: convert ipvlan.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 19093313cb0486d568232934bb80dd422d891623 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:50 2020 +0200 docs: networking: convert ipv6.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - mark a literal as such, in order to avoid a warning; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 1cec2cacaaec5d53adc04dd3ecfdb687b26c0e89 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:49 2020 +0200 docs: networking: convert ip-sysctl.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - mark lists as such; - mark tables as such; - use footnote markup; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 355e656e017c3b42deb57d125d86c4cbd277d6db Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:48 2020 +0200 docs: networking: convert ipsec.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit aac86c887ed66ac4f467821ebf75373124a148d7 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:47 2020 +0200 docs: networking: convert iphase.txt to ReST - add SPDX header; - adjust title using the proper markup; - mark code blocks and literals as such; - mark tables as such; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 9de1fcdf36e7e00693a260865a5f2a58af1c7040 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:46 2020 +0200 docs: networking: convert ip_dynaddr.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 7cdb25400f7e8624414260d1b0fa70da280b2303 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:45 2020 +0200 docs: networking: convert ipddp.txt to ReST Not much to be done here: - add SPDX header; - use a document title from existing text; - adjust a chapter markup; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 1d2698fa05f57ba2900e1ff50ac33ec85d2087d3 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:44 2020 +0200 docs: networking: convert ila.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 3c3a2fde4d88bb3d6c0592b4b7754f26dab9f697 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:43 2020 +0200 docs: networking: convert hinic.txt to ReST Not much to be done here: - add SPDX header; - adjust titles and chapters, adding proper markups; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 81baecb6f6dc507f1b565e711b5193cdbb3fa939 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:42 2020 +0200 docs: networking: convert gtp.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - add notes markups; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 8c498935585680284e5f3e5294d3c901b7c89d57 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:41 2020 +0200 docs: networking: convert gen_stats.txt to ReST - add SPDX header; - mark code blocks and literals as such; - mark tables as such; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 110662503de20f21ab22cf409753124d0977a339 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:40 2020 +0200 docs: networking: convert generic_netlink.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 16128ad8f927850a1121b7645c6381341d9c0b63 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:39 2020 +0200 docs: networking: convert generic-hdlc.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 5b0d74b54c7f1cb9c65955df78dffe112e1959c1 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:38 2020 +0200 docs: networking: convert framerelay.txt to ReST - add SPDX header; - add a document title; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 62502dff2c5012c19727bd992b0101a816095f1e Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:37 2020 +0200 docs: networking: convert fore200e.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit cb3f0d56e153398a035eb22769d2cb2837f29747 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:36 2020 +0200 docs: networking: convert filter.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - use footnote markup; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit aee113427c5d205730b2c1a023661799f41aca23 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:35 2020 +0200 docs: networking: convert fib_trie.txt to ReST - add SPDX header; - adjust title markup; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 06df65723b69a3d4691737503654400c35f9ca5a Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:34 2020 +0200 docs: networking: convert eql.txt to ReST - add SPDX header; - add a document title; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 28d23311ff35ac97ff20608f47c84c95d6389c33 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:33 2020 +0200 docs: networking: convert driver.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 9dfe1361261be48c92fd7cb26909cbcd5d496220 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:32 2020 +0200 docs: networking: convert dns_resolver.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 5f32c920c23b75654a839aa87c344b2bcaf350e2 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:31 2020 +0200 docs: networking: convert defza.txt to ReST Not much to be done here: - add SPDX header; - add a document title; - use :field: markup for the version number; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 9a69fb9c21c4bf4107becb877729544759bdd059 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:30 2020 +0200 docs: networking: convert decnet.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark lists as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 8447bb44ef7c452cbc94c04fc38d4946a3ef9165 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:29 2020 +0200 docs: networking: convert dctcp.txt to ReST - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 33155bac6519f545137d9c46d2e59e5f8332dd50 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:28 2020 +0200 docs: networking: convert dccp.txt to ReST - add SPDX header; - adjust title markup; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 9a9891fbdf935c270388fca856c117ad71c02458 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:27 2020 +0200 docs: networking: convert cxacru.txt to ReST - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 99b0e82dc5e36edb625f519121d4398628f05e95 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:26 2020 +0200 docs: networking: convert cops.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 92f06f4226fd9bdd6fbbd2e8b84601fc14b5855e Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:25 2020 +0200 docs: networking: convert cdc_mbim.txt to ReST - add SPDX header; - mark code blocks and literals as such; - use :field: markup; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit a362032eca22d03071c4613f6ca503be982bf375 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:24 2020 +0200 docs: networking: convert bonding.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - mark tables as such; - add notes markups; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit b5fcf32d7d4b647c0f3aa612d91d25996a49bcd9 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:23 2020 +0200 docs: networking: convert baycom.txt to ReST - add SPDX header; - adjust titles and chapters, adding proper markups; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 20b943f075574c233de51fa2f0124a97f0298be1 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:22 2020 +0200 docs: networking: convert ax25.txt to ReST There isn't much to be done here. Just: - add SPDX header; - add a document title. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit ff2269f16a1e1a7f8bbe72920d3d285ba3943572 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:21 2020 +0200 docs: networking: convert atm.txt to ReST There isn't much to be done here. Just: - add SPDX header; - add a document title. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 08bab46f00d0f0fe9709a05b7cdfe909a4258b01 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:20 2020 +0200 docs: networking: convert arcnet.txt to ReST - add SPDX header; - use document title markup; - add notes markups; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit aa92320b3e38f2b64b2d91a20761db1683e6c531 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:19 2020 +0200 docs: networking: convert arcnet-hardware.txt to ReST - add SPDX header; - add document title markup; - add notes markups; - mark tables as such; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 5a7f3132121bbcafd61f616170a08e511d675347 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:18 2020 +0200 docs: networking: convert altera_tse.txt to ReST - add SPDX header; - use copyright symbol; - adjust titles and chapters, adding proper markups; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit a434aaba17f56c0a25edff4104dd5f9d5b3ceba2 Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:17 2020 +0200 docs: networking: convert 6pack.txt to ReST - add SPDX header; - use title markups; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit da50d57abd7ecaba151600e726ccb944e7ddf81a Author: Mauro Carvalho Chehab Date: Tue Apr 28 00:01:16 2020 +0200 docs: networking: convert caif files to ReST There are two text files for caif, plus one already converted file. Convert the two remaining ones to ReST, create a new index.rst file for CAIF, adding it to the main networking documentation index. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: David S. Miller commit 790ab249b55d75fdb427b92f81964cd7cb525eec Author: Andrew Lunn Date: Tue Apr 28 19:58:33 2020 +0200 net: ethernet: fec: Prevent MII event after MII_SPEED write The change to polled IO for MDIO completion assumes that MII events are only generated for MDIO transactions. However on some SoCs writing to the MII_SPEED register can also trigger an MII event. As a result, the next MDIO read has a pending MII event, and immediately reads the data registers before it contains useful data. When the read does complete, another MII event is posted, which results in the next read also going wrong, and the cycle continues. By writing 0 to the MII_DATA register before writing to the speed register, this MII event for the MII_SPEED is suppressed, and polled IO works as expected. Fixes: 29ae6bd1b0d8 ("net: ethernet: fec: Replace interrupt driven MDIO with polled IO") Reported-by: Andy Duan Suggested-by: Andy Duan Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 88fb831f773e6c51ec528eacb524f00f518f7e54 Author: Nathan Chancellor Date: Tue Apr 28 10:42:22 2020 -0700 dpaa2-eth: Use proper division helper in dpaa2_dbg_ch_show When building arm32 allmodconfig: ERROR: modpost: "__aeabi_uldivmod" [drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko] undefined! frames and cdan are both of type __u64 (unsigned long long) so we need to use div64_u64 to avoid this issues. Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs") Link: https://github.com/ClangBuiltLinux/linux/issues/1012 Signed-off-by: Nathan Chancellor Reported-by: kernelci.org bot Reviewed-by: Nick Desaulniers Signed-off-by: David S. Miller commit 507122805edd25fcda8e959b870cd897b27a05c1 Merge: 3147d8aaa03e 6b03d1304a32 Author: Eric W. Biederman Date: Tue Apr 28 16:15:09 2020 -0500 proc: Ensure we see the exit of each process tid exactly In the work to remove proc_mnt I noticed that we were calling proc_flush_task now proc_flush_pid possibly multiple times for the same pid because of how de_thread works. This is a bare minimal patchset to sort out de_thread, by introducing exchange_tids and the helper of exchange_tids hlists_swap_heads_rcu. The actual call of exchange_tids should be slowpath so I have prioritized readability over getting every last drop of performance. I have also read through a bunch of the code to see if I could find anything that would be affected by this change. Users of has_group_leader_pid were a good canidates. But I also looked at other cases that might have a pid->task->pid transition. I ignored other sources of races with de_thread and exec as those are preexisting. I found a close call with send_signals user of task_active_pid_ns, but all pids of a thread group are guaranteeds to be in the same pid namespace so there is not a problem. I found a few pieces of debugging code that do: task = pid_task(pid, PIDTYPE_PID); if (task) { printk("%u\n", task->pid); } But I can't see how we care if it happens at the wrong moment that task->pid might not match pid_nr(pid); Similarly because the code in posix-cpu-timers goes pid->task->pid it feels like there should be a problem. But as the code that works with PIDTYPE_PID is only available within the thread group, and as de_thread kills all of the other threads before it makes any changes of this kind the race can not happen. In short I don't think this change will introduce any regressions. Eric W. Biederman (2): rculist: Add hlists_swap_heads_rcu proc: Ensure we see the exit of each process tid exactly once fs/exec.c | 5 +---- include/linux/pid.h | 1 + include/linux/rculist.h | 21 +++++++++++++++++++++ kernel/pid.c | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) Link: https://lore.kernel.org/lkml/87sggnajpv.fsf_-_@x220.int.ebiederm.org/ Acked-by: Linus Torvalds Acked-by: Oleg Nesterov Signed-off-by: "Eric W. Biederman" commit f6a7c21c991062da9ac93d547f07a5368c8d8d57 Author: Chris Wilson Date: Tue Apr 28 19:47:51 2020 +0100 drm/i915/execlists: Verify we don't submit two identical CCIDs Check that we do not submit two contexts into ELSP with the same CCID [upper portion of the descriptor]. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1793 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200428184751.11257-3-chris@chris-wilson.co.uk commit 5c4a53e3b1cbc38d0906e382f1037290658759bb Author: Chris Wilson Date: Tue Apr 28 19:47:50 2020 +0100 drm/i915/execlists: Track inflight CCID The presumption is that by using a circular counter that is twice as large as the maximum ELSP submission, we would never reuse the same CCID for two inflight contexts. However, if we continually preempt an active context such that it always remains inflight, it can be resubmitted with an arbitrary number of paired contexts. As each of its paired contexts will use a new CCID, eventually it will wrap and submit two ELSP with the same CCID. Rather than use a simple circular counter, switch over to a small bitmap of inflight ids so we can avoid reusing one that is still potentially active. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1796 Fixes: 2935ed5339c4 ("drm/i915: Remove logical HW ID") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: # v5.5+ Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200428184751.11257-2-chris@chris-wilson.co.uk commit 2632f174a2e1a5fd40a70404fa8ccfd0b1f79ebd Author: Chris Wilson Date: Tue Apr 28 19:47:49 2020 +0100 drm/i915/execlists: Avoid reusing the same logical CCID The bspec is confusing on the nature of the upper 32bits of the LRC descriptor. Once upon a time, it said that it uses the upper 32b to decide if it should perform a lite-restore, and so we must ensure that each unique context submitted to HW is given a unique CCID [for the duration of it being on the HW]. Currently, this is achieved by using a small circular tag, and assigning every context submitted to HW a new id. However, this tag is being cleared on repinning an inflight context such that we end up re-using the 0 tag for multiple contexts. To avoid accidentally clearing the CCID in the upper 32bits of the LRC descriptor, split the descriptor into two dwords so we can update the GGTT address separately from the CCID. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1796 Fixes: 2935ed5339c4 ("drm/i915: Remove logical HW ID") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: # v5.5+ Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200428184751.11257-1-chris@chris-wilson.co.uk commit 6b03d1304a32dc8450c7516000a0fe07bef7c446 Author: Eric W. Biederman Date: Sun Apr 19 06:35:02 2020 -0500 proc: Ensure we see the exit of each process tid exactly once When the thread group leader changes during exec and the old leaders thread is reaped proc_flush_pid will flush the dentries for the entire process because the leader still has it's original pid. Fix this by exchanging the pids in an rcu safe manner, and wrapping the code to do that up in a helper exchange_tids. When I removed switch_exec_pids and introduced this behavior in d73d65293e3e ("[PATCH] pidhash: kill switch_exec_pids") there really was nothing that cared as flushing happened with the cached dentry and de_thread flushed both of them on exec. This lack of fully exchanging pids became a problem a few months later when I introduced 48e6484d4902 ("[PATCH] proc: Rewrite the proc dentry flush on exit optimization"). Which overlooked the de_thread case was no longer swapping pids, and I was looking up proc dentries by task->pid. The current behavior isn't properly a bug as everything in proc will continue to work correctly just a little bit less efficiently. Fix this just so there are no little surprise corner cases waiting to bite people. -- Oleg points out this could be an issue in next_tgid in proc where has_group_leader_pid is called, and reording some of the assignments should fix that. -- Oleg points out this will break the 10 year old hack in __exit_signal.c > /* > * This can only happen if the caller is de_thread(). > * FIXME: this is the temporary hack, we should teach > * posix-cpu-timers to handle this case correctly. > */ > if (unlikely(has_group_leader_pid(tsk))) > posix_cpu_timers_exit_group(tsk); The code in next_tgid has been changed to use PIDTYPE_TGID, and the posix cpu timers code has been fixed so it does not need the 10 year old hack, so this should be safe to merge now. Link: https://lore.kernel.org/lkml/87h7x3ajll.fsf_-_@x220.int.ebiederm.org/ Acked-by: Linus Torvalds Acked-by: Oleg Nesterov Fixes: 48e6484d4902 ("[PATCH] proc: Rewrite the proc dentry flush on exit optimization"). Signed-off-by: Eric W. Biederman commit 35fc0e3b0bd5be3b059e53ae90c4536ee4922330 Author: Eric W. Biederman Date: Fri Apr 24 11:19:10 2020 -0500 rculist: Add hlists_swap_heads_rcu Using the struct pid to refer to two tasks in de_thread was a clever idea and ultimately too clever, as it has lead to proc_flush_task being called inconsistently. To support rectifying this add hlists_swap_heads_rcu. An hlist primitive that just swaps the hlist heads of two lists. This is exactly what is needed for exchanging the pids of two tasks. Only consideration of correctness of the code has been given, as the caller is expected to be a slowpath. Link: https://lore.kernel.org/lkml/87mu6vajnq.fsf_-_@x220.int.ebiederm.org/ Acked-by: Linus Torvalds Acked-by: Oleg Nesterov Signed-off-by: "Eric W. Biederman" commit 9d42205036d4be7e45fb4dafe5173cd804fd9d5f Author: ChenTao Date: Tue Apr 28 09:48:04 2020 +0800 net: phy: bcm54140: Make a bunch of functions static Fix the following warning: drivers/net/phy/bcm54140.c:663:5: warning: symbol 'bcm54140_did_interrupt' was not declared. Should it be static? drivers/net/phy/bcm54140.c:672:5: warning: symbol 'bcm54140_ack_intr' was not declared. Should it be static? drivers/net/phy/bcm54140.c:684:5: warning: symbol 'bcm54140_config_intr' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: ChenTao Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit dc5c1439376de8e107396ff5bdbc05af3b04ff0b Author: Dejin Zheng Date: Fri Apr 24 23:41:03 2020 +0800 gpio: mm-lantiq: Fix small typo Fix a spelling typo in gpio-mm-lantiq.c by codespell s/dont/don't/ Cc: Andy Shevchenko Signed-off-by: Dejin Zheng Link: https://lore.kernel.org/r/20200424154103.10311-3-zhengdejin5@gmail.com Signed-off-by: Linus Walleij commit bcd3469b50dfb5e81d2145e6489109f119e0d38f Merge: 3e455b7d1a9b 0feba2219b73 Author: David S. Miller Date: Tue Apr 28 13:30:44 2020 -0700 Merge branch 'kselftest-add-fixture-parameters' Jakub Kicinski says: ==================== kselftest: add fixture parameters This set is an attempt to make running tests for different sets of data easier. The direct motivation is the tls test which we'd like to run for TLS 1.2 and TLS 1.3, but currently there is no easy way to invoke the same tests with different parameters. Tested all users of kselftest_harness.h. Dave, would it be possible to take these via net-next? It seems we're failing to get Shuah's attention. v2: - don't run tests by fixture - don't pass params as an explicit argument v3: - go back to the orginal implementation with an extra parameter, and running by fixture (Kees); - add LIST_APPEND helper (Kees); - add a dot between fixture and param name (Kees); - rename the params to variants (Tim); v4: - whitespace fixes. v5 (Kees): - move a comment; - remove a temporary variable; - reword the commit message on patch 4. v6: - resend for net-next. v1: https://lore.kernel.org/netdev/20200313031752.2332565-1-kuba@kernel.org/ v2: https://lore.kernel.org/netdev/20200314005501.2446494-1-kuba@kernel.org/ v3: https://lore.kernel.org/netdev/20200316225647.3129354-1-kuba@kernel.org/ v4: https://lore.kernel.org/netdev/20200317010419.3268916-1-kuba@kernel.org/ v5: https://lore.kernel.org/netdev/20200318010153.40797-1-kuba@kernel.org/ ==================== Signed-off-by: David S. Miller commit 0feba2219b7348dce7d59312f4701a4805768f2d Author: Jakub Kicinski Date: Mon Apr 27 18:03:51 2020 -0700 selftests: tls: run all tests for TLS 1.2 and TLS 1.3 TLS 1.2 and TLS 1.3 differ in the implementation. Use fixture parameters to run all tests for both versions, and remove the one-off TLS 1.2 test. Signed-off-by: Jakub Kicinski Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 74bc7c97fa88ae334752e7b45702d23813df8873 Author: Jakub Kicinski Date: Mon Apr 27 18:03:50 2020 -0700 kselftest: add fixture variants Allow users to build parameterized variants of fixtures. If fixtures want variants, they call FIXTURE_VARIANT() to declare the structure to fill for each variant. Each fixture will be re-run for each of the variants defined by calling FIXTURE_VARIANT_ADD() with the differing parameters initializing the structure. Since tests are being re-run, additional initialization (steps, no_print) is also added. Signed-off-by: Jakub Kicinski Acked-by: Kees Cook Signed-off-by: David S. Miller commit e7f304607778e31bfd8e6b00ce2a8f990b265e14 Author: Jakub Kicinski Date: Mon Apr 27 18:03:49 2020 -0700 kselftest: run tests by fixture Now that all tests have a fixture object move from a global list of tests to a list of tests per fixture. Order of tests may change as we will now group and run test fixture by fixture, rather than in declaration order. Signed-off-by: Jakub Kicinski Acked-by: Kees Cook Signed-off-by: David S. Miller commit 142aca6b388c8ab83dc41bd71150cb23115bd285 Author: Jakub Kicinski Date: Mon Apr 27 18:03:48 2020 -0700 kselftest: create fixture objects Grouping tests by fixture will allow us to parametrize test runs. Create full objects for fixtures. Add a "global" fixture for tests without a fixture. Signed-off-by: Jakub Kicinski Acked-by: Kees Cook Signed-off-by: David S. Miller commit 1a89595c2272aa9b4cd3fda562545dc1d9cd89ed Author: Jakub Kicinski Date: Mon Apr 27 18:03:47 2020 -0700 kselftest: factor out list manipulation to a helper Kees suggest to factor out the list append code to a macro, since following commits need it, which leads to code duplication. Suggested-by: Kees Cook Signed-off-by: Jakub Kicinski Acked-by: Kees Cook Signed-off-by: David S. Miller commit b8020b0304c8f44e5e29f0b1a04d31e0bf68d26a Author: Joseph Greathouse Date: Wed Sep 18 14:49:57 2019 -0500 drm/amdkfd: Enable over-subscription with >1 GWS queue The current GWS usage model will only allows a single GWS-enabled process to be active on the GPU at once. This ensures that a barrier-using kernel gets a known amount of GPU hardware, to prevent deadlock due to inability to go beyond the GWS barrier. The HWS watches how many GWS entries are assigned to each process, and goes into over-subscription mode when two processes need more than the 64 that are available. The current KFD method for working with this is to allocate all 64 GWS entries to each GWS-capable process. When more than one GWS-enabled process is in the runlist, we must make sure the runlist is in over-subscription mode, so that the HWS gets a chained RUN_LIST packet and continues scheduling kernels. Signed-off-by: Joseph Greathouse Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 29633d0e204df1e051d9036e4f493f228ac19fb4 Author: Joseph Greathouse Date: Wed Jan 15 15:23:44 2020 -0600 drm/amdkfd: Enable GWS based on FW Support Rather than only enabling GWS support based on the hws_gws_support modparm, also check whether the GPU's HWS firmware supports GWS. Leave the old modparm in place in case users want to test GWS on GPUs not yet in the support list. v2: fix broken syntax from the first patch. Signed-off-by: Joseph Greathouse Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5bb4b78be9c67b02a7f138850e9e89825181f555 Author: Oak Zeng Date: Mon May 6 22:11:14 2019 -0500 drm/amdkfd: New IOCTL to allocate queue GWS (v2) Add a new kfd ioctl to allocate queue GWS. Queue GWS is released on queue destroy. v2: re-introduce this API with the following fixes squashed in: - drm/amdkfd: fix null pointer dereference on dev - drm/amdkfd: Return proper error code for gws alloc API - drm/amdkfd: Remove GPU ID in GWS queue creation Signed-off-by: Oak Zeng Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5654b897b5bf117b8c90b573c5455debf36dde01 Author: Alex Sierra Date: Fri Apr 10 11:59:47 2020 -0500 drm/amdgpu: pass unlocked flag to params at amdgpu_vm_bo_update_mapping Pass unlocked flag value to amdgpu_vm_update_params.unlocked struct member at amdgpu_vm_bo_update_mapping. Reviewed-by: Christian König Signed-off-by: Alex Sierra Signed-off-by: Alex Deucher commit 9c466bcbda68d73c9ba26e8307b0dff11dd285d8 Author: Christian König Date: Tue Apr 7 14:54:23 2020 +0200 drm/amdgpu: add new unlocked flag for PTE updates For HMM support we need the ability to invalidate PTEs from a MM callback where we can't lock the root PD. Add a new flag to better support this instead of assuming that all invalidation updates are unlocked. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit eaad0c3aa978e7ed654e574691b56cc24d2d409a Author: Christian König Date: Wed Apr 1 12:50:56 2020 +0200 drm/amdgpu: rename direct to immediate for VM updates To avoid confusion with direct ring submissions rename bottom of pipe VM table changes to immediate updates. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9ecefb19c3a6626c27ea7ee72d431f22462e1d54 Author: Christian König Date: Wed Apr 1 11:18:21 2020 +0200 drm/amdgpu: cleanup IB pool handling a bit Fix the coding style, move and rename the definitions to better match what they are supposed to be doing. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e208586471181230b88851c14cac80036c128f37 Author: Christian König Date: Mon Mar 16 14:33:33 2020 +0100 drm/amdgpu: partial revert VM sync changes We still need to add the VM update fences to the root PD. So make sure to never sync to those implicitely. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b33f9d70b36889abafec3b638925640ac7c7fe12 Author: Alex Deucher Date: Thu Apr 23 16:45:10 2020 -0400 drm/amdgpu: check ring type for secure IBs We don't support secure operation on compute rings at the moment so reject them. Reviewed-by: Andrey Grodzovsky Reviewed-by: Aaron Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b717fa5cb1a1aae9ea744a3b61e9d9aa1d258c9c Author: Christian König Date: Fri Apr 3 15:56:12 2020 +0200 drm/amdgpu: fix size calculation in amdgpu_ttm_copy_mem_to_mem When the node is larger than 4GB we overrun the size calculation. Fix this by correctly limiting the size to the window as well. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9504578314a70e6d96ee812dc93b5b5c9514b988 Author: Christian König Date: Thu Mar 19 13:57:40 2020 +0100 drm/amdgpu: add full TMZ support into amdgpu_ttm_map_buffer v2 This should allow us to also support VRAM->GTT moves. v2: fix missing vram_base_adjustment Signed-off-by: Christian König Reviewed-by: Huang Rui Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit f0ee63cbc5264dbbdb994e87504b0b033149da55 Author: Christian König Date: Wed Mar 18 10:28:20 2020 +0100 drm/amdgpu: cleanup amdgpu_ttm_copy_mem_to_mem and amdgpu_map_buffer v2 Cleanup amdgpu_ttm_copy_mem_to_mem by using fewer variables for the same value. Rename amdgpu_map_buffer to amdgpu_ttm_map_buffer, move it to avoid the forward decleration, cleanup by moving the map decission into the function and add some documentation. No functional change. v2: add some more cleanup suggested by Felix Signed-off-by: Christian König Reviewed-by: Felix Kuehling Reviewed-by: Huang Rui Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit f77c9aff85caa9e9b0c2b6fc5be1fc2c76fe02b2 Author: Huang Rui Date: Mon Mar 9 14:52:06 2020 -0400 drm/amdgpu: Fix per-IB secure flag GFX hang Since commit "Move to a per-IB secure flag (TMZ)", we've been seeing hangs in GFX. We need to send FRAME CONTROL stop/start back-to-back, every time we flip the TMZ flag. That is, when we transition from TMZ to non-TMZ we have to send a stop with TMZ followed by a start with non-TMZ, and similarly for transitioning from non-TMZ into TMZ. This patch implements this, thus fixing the GFX hang. v1 -> v2: As suggested by Luben, and accept part of implemetation from this patch: - Put "secure" closed to the loop and use optimization - Change "secure" to bool again, and move "secure == -1" out of loop. v3: Small fixes/optimizations. Reported-and-Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Luben Tuikov Signed-off-by: Alex Deucher commit b71a564e2509e1000044a9873cbee6d6a6a5ab90 Author: Luben Tuikov Date: Wed Feb 26 15:30:36 2020 -0500 drm/amdgpu: Fine-grained TMZ support Add fine-grained per-ASIC TMZ support. At the moment TMZ support is experimental for all ASICs which support it. Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 218c0b7f183a88b3b2678fbca885a750dda2bff3 Author: Christian König Date: Mon Mar 2 13:00:07 2020 +0100 drm/amdgpu: stop evicting encrypted BOs to swap Swapping out encrypted BOs doesn't work because they can't change their physical location without going through a bounce copy. As a workaround disable evicting encrypted BOs to the system domain for now. Signed-off-by: Christian König Reviewed-by: Alex Deucher Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit effb97cc4ba638eb0a24d612bcea6ff2ef26cfee Author: Christian König Date: Fri Feb 28 14:48:06 2020 +0100 drm/amdgpu: add TMZ handling to amdgpu_move_blit This way we should be at least able to move buffers from VRAM to GTT. Signed-off-by: Christian König Reviewed-by: Alex Deucher Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit bffc8c5caaa97d6791aef965b618d71faac07098 Author: Christian König Date: Fri Mar 6 14:36:43 2020 -0500 drm/amdgpu: also add the TMZ flag to GART This is necessary for TMZ handling during buffer moves and scanout. Signed-off-by: Christian König Reviewed-by: Alex Deucher Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit 11b407a781f42d8513da64499f24fafdfd32426f Author: Huang Rui Date: Tue Feb 18 13:07:42 2020 +0800 drm/amdgpu: fix the wrong logic checking when secure buffer is created (v3) While the current amdgpu doesn't support TMZ, it will return the error if user mode would like to allocate secure buffer. v2: we didn't need this checking anymore. v3: only print message once time. Signed-off-by: Huang Rui Reviewed-by: Christian König Acked-by: Nirmoy Das Signed-off-by: Alex Deucher commit 0bb5d5b03f78aeb5f87d47877eb15532875c64da Author: Luben Tuikov Date: Wed Apr 22 17:56:56 2020 -0400 drm/amdgpu: Move to a per-IB secure flag (TMZ) Move from a per-CS secure flag (TMZ) to a per-IB secure flag. Signed-off-by: Luben Tuikov Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 5888f07a657d1b653f0e59c492b07830f3487406 Author: Harry Wentland Date: Wed Apr 22 17:54:55 2020 -0400 drm/amd/display: Indicate use of TMZ buffers to DC [Why] Hubp needs to know whether a buffer is being scanned out from the trusted memory zone or not. [How] Check for the TMZ flag on the amdgpu_bo and set the tmz_surface flag in dc_plane_address accordingly. Signed-off-by: Harry Wentland Signed-off-by: Bhawanpreet Lakha Acked-by: Bhawanpreet Lakha Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit c6252390fccdd768d1250a45cbd2a7e3610a1283 Author: Luben Tuikov Date: Thu Mar 19 16:47:51 2020 -0400 drm/amdgpu: implement TMZ accessor (v3) Implement an accessor of adev->tmz.enabled. Let not code around access it as "if (adev->tmz.enabled)" as the organization may change. Instead... Recruit "bool amdgpu_is_tmz(adev)" to return exactly this Boolean value. That is, this function is now an accessor of an already initialized and set adev and adev->tmz. Add "void amdgpu_gmc_tmz_set(adev)" to check and set adev->gmc.tmz_enabled at initialization time. After which one uses "bool amdgpu_is_tmz(adev)" to query whether adev supports TMZ. Also, remove circular header file include. v2: Remove amdgpu_tmz.[ch] as requested. v3: Move TMZ into GMC. Signed-off-by: Luben Tuikov Acked-by: Christian König Signed-off-by: Alex Deucher commit 562366c9452c534242a55a47c6431ab1e9b6b07c Author: Huang Rui Date: Tue Jan 14 18:55:22 2020 +0800 drm/amdgpu: remove the alignment placeholder for secure buffer The alignment should match the page size for secure buffer, so we didn't configure it anymore. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4baa8ff0690e464443594353d63c989f0ed9f831 Author: Alex Deucher Date: Wed Nov 27 15:55:35 2019 -0500 drm/amdgpu: move CS secure flag next the structs where it's used So it's not mixed up with the CTX stuff. Reviewed-by: Zhan Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8fb2e01a1ed8616b7a2bc8b00b50356d26efba2e Author: Aaron Liu Date: Fri Nov 15 15:08:36 2019 +0800 drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10 This patch enables TMZ bit in FRAME_CONTROL for gfx10. Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit b231531c50126c7bfc838e75dfc4de01f8ed90d3 Author: Aaron Liu Date: Fri Nov 15 16:18:03 2019 +0800 drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v5 Enable sdma TMZ mode via setting TMZ bit in sdma copy pkt for sdma v5. Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit b7c163fe910fd38000f85b871bf25b120282e702 Author: Aaron Liu Date: Tue Oct 15 16:47:44 2019 +0800 drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v4 Enable sdma TMZ mode via setting TMZ bit in sdma copy pkt for sdma v4 Signed-off-by: Aaron Liu Reviewed-by: Christian König Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit c9dc9cfe185f53ffb0b5d621b00eecd80f942a7c Author: Aaron Liu Date: Tue Oct 15 15:45:23 2019 +0800 drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter This patch expands amdgpu_copy_buffer interface with tmz parameter. Signed-off-by: Aaron Liu Reviewed-by: Christian König Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit be7538ff7488445297d903f5419de8fb99adf85d Author: Aaron Liu Date: Tue Oct 15 15:37:48 2019 +0800 drm/amdgpu: expand sdma copy_buffer interface with tmz parameter This patch expands sdma copy_buffer interface with tmz parameter. Signed-off-by: Aaron Liu Reviewed-by: Christian König Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 04379e9b04890e4c9ccfc8465447fac544b89e28 Author: Stephen Rothwell Date: Wed Oct 16 11:22:07 2019 +1100 drm/amdgpu: fix up for amdgpu_tmz.c and removal of drm/drmP.h Signed-off-by: Stephen Rothwell Signed-off-by: Alex Deucher commit 4cd24494cc87468145ccacd885446b2fec6cb856 Author: Alex Deucher Date: Wed Aug 7 22:32:46 2019 -0500 drm/amdgpu: set TMZ bits in PTEs for secure BO (v4) If a buffer object is secure, i.e. created with AMDGPU_GEM_CREATE_ENCRYPTED, then the TMZ bit of the PTEs that belong the buffer object should be set. v1: design and draft the skeletion of TMZ bits setting on PTEs (Alex) v2: return failure once create secure BO on non-TMZ platform (Ray) v3: amdgpu_bo_encrypted() only checks the BO (Luben) v4: move TMZ flag setting into amdgpu_vm_bo_update (Christian) Signed-off-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Huang Rui Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Reviewed-by: Christian König commit cb5fae143d79d255251921066dbf8eae16383639 Author: Huang Rui Date: Thu Aug 8 20:05:15 2019 +0800 drm/amdgpu: job is secure iff CS is secure (v5) Mark a job as secure, if and only if the command submission flag has the secure flag set. v2: fix the null job pointer while in vmid 0 submission. v3: Context --> Command submission. v4: filling cs parser with cs->in.flags v5: move the job secure flag setting out of amdgpu_cs_submit() Signed-off-by: Huang Rui Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8350361d2d75882573c7d1af228d7827666e6929 Author: Huang Rui Date: Wed Apr 22 17:49:17 2020 -0400 drm/amdgpu: expand the context control interface with trust flag This patch expands the context control function to support trusted flag while we want to set command buffer in trusted mode. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Acked-by: Christian König Signed-off-by: Alex Deucher commit 155748c912e7063dfcf0cd071e289f4aff152672 Author: Huang Rui Date: Mon Mar 9 13:53:37 2020 -0400 drm/amdgpu: expand the emit tmz interface with trusted flag This patch expands the emit_tmz function to support trusted flag while we want to set command buffer in trusted mode. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Acked-by: Christian König Signed-off-by: Alex Deucher commit eda982a67225a8fe46807dc45304469f612e99bb Author: Huang Rui Date: Thu Aug 8 17:00:16 2019 +0800 drm/amdgpu: add tmz bit in frame control packet This patch adds tmz bit in frame control pm4 packet, and it will used in future. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 01a8dcec1a08f7c13b7546742fc84dcd7114bf4e Author: Huang Rui Date: Thu Mar 19 16:46:10 2020 -0400 drm/amdgpu: add function to check tmz capability (v4) Add a function to check tmz capability with kernel parameter and ASIC type. v2: use a per device tmz variable instead of global amdgpu_tmz. v3: refine the comments for the function. (Luben) v4: add amdgpu_tmz.c/h for future use. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ae60305ac04ff7bb804fb17962140839daa628c2 Author: Huang Rui Date: Tue Jan 14 10:10:51 2020 -0500 drm/amdgpu: add amdgpu_tmz data structure This patch to add amdgpu_tmz structure which stores all tmz related fields. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d7ccb38df5f7ee24e667a4c61b2ce3ff77a7fd6e Author: Huang Rui Date: Sun Aug 4 16:33:16 2019 +0800 drm/amdgpu: add tmz feature parameter (v2) This patch adds tmz parameter to enable/disable the feature in the amdgpu kernel module. Nomally, by default, it should be auto (rely on the hardware capability). But right now, it need to set "off" to avoid breaking other developers' work because it's not totally completed. Will set "auto" till the feature is stable and completely verified. v2: add "auto" option for future use. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c5efd80f48e481946ba201412c7f39b19b39a40b Author: Alex Deucher Date: Wed Aug 7 22:31:50 2019 -0500 drm/amdgpu: define the TMZ bit for the PTE Define the TMZ (encryption) bit in the page table entry (PTE) for Raven and newer asics. Signed-off-by: Alex Deucher Reviewed-by: Huang Rui commit e90c2b210bad457aab73d3357465afe4d4475f7e Author: Luben Tuikov Date: Mon Sep 23 19:02:41 2019 -0400 drm/amdgpu: add UAPI to create secure commands (v3) Add a flag to the command submission IOCTL structure which when present indicates that this command submission should be treated as secure. The kernel driver uses this flag to determine whether the engine should be transitioned to secure or unsecure, or the work can be submitted to a secure queue depending on the IP. v3: the flag is now at command submission IOCTL Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 35ce006004821c5e9ae8fe03d048567cec99c41e Author: Alex Deucher Date: Wed Aug 7 21:43:24 2019 -0500 drm/amdgpu: add UAPI for creating encrypted buffers Add a flag to the GEM_CREATE ioctl to create encrypted buffers. Buffers with this flag set will be created with the TMZ bit set in the PTEs or engines accessing them. This is required in order to properly access the data from the engines. Signed-off-by: Alex Deucher Reviewed-by: Huang Rui Reviewed-by: Christian König commit 82a7cf006ee1f91d7818eb298ae1ec052c9a14ee Author: Aric Cyr Date: Wed Apr 22 18:08:05 2020 -0400 drm/amd/display: 3.2.83.1 Update firmware blobs Signed-off-by: Aric Cyr Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit b454e25f3e72fc29967afdee5ffee46c250a0dd1 Author: Aric Cyr Date: Wed Apr 22 18:08:04 2020 -0400 drm/amd/display: 3.2.83 Signed-off-by: Aric Cyr Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1e461c37d1fb6712561ad682b2d67ed4f5cbd3ff Author: Aric Cyr Date: Wed Apr 22 18:08:03 2020 -0400 drm/amd/display: Use cursor locking to prevent flip delays [Why] Current locking scheme for cursor can result in a flip missing its vsync, deferring it for one or more vsyncs. Result is a potential for stuttering when cursor is moved. [How] Use cursor update lock so that flips are not blocked while cursor is being programmed. Signed-off-by: Aric Cyr Reviewed-by: Nicholas Kazlauskas Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit a8bf7164908827178fe31fb21d2646c404c1990d Author: Krunoslav Kovac Date: Wed Apr 22 18:08:02 2020 -0400 drm/amd/display: Internal refactoring to abstract color caps [Why&How] modules/color calculates various colour operations which are translated to abstracted HW. DCE 5-12 had almost no important changes, but starting with DCN1, every new generation comes with fairly major differences in color pipeline. We would hack it with some DCN checks, but a better approach is to abstract color pipe capabilities so modules/DM can decide mapping to HW block based on logical capabilities, Signed-off-by: Krunoslav Kovac Reviewed-by: Aric Cyr Acked-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 4b0e95d1838f0e1d8bd4ca79f1fa17d7af1ddad6 Author: Yongqiang Sun Date: Wed Apr 22 18:08:01 2020 -0400 drm/amd/display: Add set backlight to hw sequencer. [Why & How] Add set backlight to hw sequencer, dmu communication will be handled in hw sequencer for new asics. Signed-off-by: Yongqiang Sun Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 8d829836cf753228b014af3bf21d3e2232a5722b Author: Joshua Aberback Date: Wed Apr 22 18:08:00 2020 -0400 drm/amd/display: Add dummy p-state latency bounding box override [Why] For debugging, it can be useful to be able to modify the dummy p-state latency, this will make it easier to do so. Signed-off-by: Joshua Aberback Reviewed-by: Wesley Chalmers Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 18400f91c1c17777d98013ea15d620e7b4ac1cf4 Author: Yongqiang Sun Date: Wed Apr 22 18:07:59 2020 -0400 drm/amd/display: Add panel cntl id for set backlight level. [Why & How] Add panel cntl instance when calling set backlight. Signed-off-by: Yongqiang Sun Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Acked-by: Tony Cheng Signed-off-by: Alex Deucher commit 0ed3bcc45987f0c127531199c288448c71e3c767 Author: Nicholas Kazlauskas Date: Wed Apr 22 18:07:58 2020 -0400 drm/amd/display: Pass command instead of header into DMUB service [Why] We read memory that we shouldn't be touching if the struct isn't a full union dmub_rb_cmd. [How] Fix up all the callers and functions that take in the dmub_cmd_header to use the dmub_rb_cmd instead. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Tony Cheng Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 77ef333e48ba21181b4b7b812ef623305b0b0c10 Author: Sung Lee Date: Wed Apr 22 18:07:57 2020 -0400 drm/amd/display: Update downspread percent to match spreadsheet for DCN2.1 [WHY] The downspread percentage was copied over from a previous version of the display_mode_lib spreadsheet. This value has been updated, and the previous value is too high to allow for such modes as 4K120hz. The new value is sufficient for such modes. [HOW] Update the value in dcn21_resource to match the spreadsheet. Signed-off-by: Sung Lee Reviewed-by: Yongqiang Sun Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1ab864a006690d7a387498589464f9ec8509ff9e Author: Nicholas Kazlauskas Date: Wed Apr 22 18:07:56 2020 -0400 drm/amd/display: Defer cursor update around VUPDATE for all ASIC [Why] Fixes the following scenario: - Flip has been prepared sometime during the frame, update pending - Cursor update happens right when VUPDATE would happen - OPTC lock acquired, VUPDATE is blocked until next frame - Flip is delayed potentially infinitely With the igt@kms_cursor_legacy cursor-vs-flip-legacy test we can observe nearly *13* frames of delay for some flips on Navi. [How] Apply the Raven workaround generically. When close enough to VUPDATE block cursor updates from occurring from the dc_stream_set_cursor_* helpers. This could perhaps be a little smarter by checking if there were pending updates or flips earlier in the frame on the HUBP side before applying the delay, but this should be fine for now. This fixes the kms_cursor_legacy test. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Aric Cyr Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 3a4837fb3c96aa6a0f017781a062687be4d6250b Author: Sung Lee Date: Wed Apr 22 18:07:55 2020 -0400 drm/amd/display: Change viewport limit to 12 for DCN2 [WHY & HOW] Viewport limit was set to 16 pixels due to an issue with MPO on small viewports. This restriction does not apply and the viewport limit can now be lowered. Signed-off-by: Sung Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit b8a8d34b107fd3e4130a987f4168c68d3026fcb1 Author: Sung Lee Date: Wed Apr 22 18:07:54 2020 -0400 drm/amd/display: Fail validation if building scaling params fails [WHY & HOW] If building scaling parameters fails, validation should also fail. Signed-off-by: Sung Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 238387774232c9d294381d6f674c98682e9dbae8 Author: Dmytro Laktyushkin Date: Wed Apr 22 18:07:53 2020 -0400 drm/amd/display: fix rn soc bb update Currently RN SOC bounding box update assumes we will get at least 2 clock states from SMU. This isn't always true and because of special casing on first clock state we end up with low disp, dpp, dsc and phy clocks. This change removes the special casing allowing the first state to acquire correct clocks. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Yang Acked-by: Aurabindo Pillai Acked-by: Tony Cheng Signed-off-by: Alex Deucher commit 3ebd17f53556fff2809793b5d2c2259a1f2714dd Author: Dmytro Laktyushkin Date: Wed Apr 22 18:07:52 2020 -0400 drm/amd/display: check if REFCLK_CNTL register is present Check before programming the register since it isn't present on all IPs using this code. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 38a509d5d2603fef9d8867151381059bcbb3a6ca Author: Joshua Aberback Date: Wed Apr 22 18:07:51 2020 -0400 drm/amd/display: Add DML variable for future asics Signed-off-by: Joshua Aberback Reviewed-by: Dmytro Laktyushkin Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit d3b18f8c6fe32fcf42e72b6c55726774c2e999de Author: Anthony Koo Date: Wed Apr 22 18:07:50 2020 -0400 drm/amd/display: clean up some header paths [Why] Some include paths don't need to have relative paths And some types missing [How] make some changes to headers and modify include path Signed-off-by: Anthony Koo Reviewed-by: Tony Cheng Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit d561754132e1ea4bc275977d5164719bb1b876f9 Author: Nicholas Kazlauskas Date: Wed Apr 22 18:07:49 2020 -0400 drm/amd/display: Fix DMUB meta offset for new load method [Why] The new metadata offset is located at the end of the firmware binary without any additional padding. Firmware state is currently larger than 1024 bytes so new firmware state will hang when trying to access any data above 1024 bytes. [How] Specify the correct offset based on legacy vs new loading method. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Yongqiang Sun Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1dfedb39d38f813357885e19badd1971c17f79a7 Author: Sung Lee Date: Wed Apr 22 18:07:48 2020 -0400 drm/amd/display: Do not disable pipe split if mode is not supported [WHY] If mode is not supported, pipe split should not be disabled. This may cause more modes to fail. [HOW] Check for mode support before disabling pipe split. This commit was previously reverted as it was thought to have problems, but those issues have been resolved. Signed-off-by: Sung Lee Reviewed-by: Yongqiang Sun Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1349f6fc334b3a3d7a338c70da07a3e0450da5c5 Author: Aric Cyr Date: Wed Apr 22 18:07:47 2020 -0400 drm/amd/display: 3.2.82 Signed-off-by: Aric Cyr Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit d67ef24adf3c3fbaed62c31551d6e36f24fece16 Author: Linus Walleij Date: Thu Feb 13 15:15:24 2020 +0100 ARM: dts: Add devicetree for Integrator/AP with IM-PD1 This adds a device tree for the Integrator/AP with the IM-PD1 logic module mounted, using the new logic module bindings. Signed-off-by: Linus Walleij commit 3e455b7d1a9b415b8b6e85f42ada9f53807ddd1f Merge: 2ac757e4152e 4dddb5be136a Author: David S. Miller Date: Tue Apr 28 12:50:37 2020 -0700 Merge branch 'nexthop-API-sysctl' Roopa Prabhu says: ==================== New sysctl to turn off nexthop API compat mode Currently route nexthop API maintains user space compatibility with old route API by default. Dumps and netlink notifications support both new and old API format. In systems which have moved to the new API, this compatibility mode cancels some of the performance benefits provided by the new nexthop API. This patch adds new sysctl nexthop_compat_mode which is on by default but provides the ability to turn off compatibility mode allowing systems to run entirely with the new routing API if they wish to. Old route API behaviour and support is not modified by this sysctl v4: - Use davids note for Documenting the sysctl - test with latest iproute2 and adjust 'pref' v3: - Document new sysctl - move sysctl to use proc_dointvec_minmax with 0 and 1 values - selftest: remove pref medium in ipv6 test v2: - Incorporate David Aherns pointers on covering dumps and nexthop deletes. Also use one ipv4 sysctl to cover both ipv4 and ipv6 (I see it is done that way for many others) - Added a selftest to cover dump and notfications for nexthop api compat mode ==================== Signed-off-by: David S. Miller commit 4dddb5be136a7b151c11f0fbe350feff75a89867 Author: Roopa Prabhu Date: Mon Apr 27 13:56:47 2020 -0700 selftests: net: add new testcases for nexthop API compat mode sysctl New tests to check route dump and notifications with net.ipv4.nexthop_compat_mode on and off. Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 4f80116d3df3b23ee4b83ea8557629e1799bc230 Author: Roopa Prabhu Date: Mon Apr 27 13:56:46 2020 -0700 net: ipv4: add sysctl for nexthop api compatibility mode Current route nexthop API maintains user space compatibility with old route API by default. Dumps and netlink notifications support both new and old API format. In systems which have moved to the new API, this compatibility mode cancels some of the performance benefits provided by the new nexthop API. This patch adds new sysctl nexthop_compat_mode which is on by default but provides the ability to turn off compatibility mode allowing systems to run entirely with the new routing API. Old route API behaviour and support is not modified by this sysctl. Uses a single sysctl to cover both ipv4 and ipv6 following other sysctls. Covers dumps and delete notifications as suggested by David Ahern. Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 11dd74b338bf83f8bca70b57bad33a903fedfa6e Author: Roopa Prabhu Date: Mon Apr 27 13:56:45 2020 -0700 net: ipv6: new arg skip_notify to ip6_rt_del Used in subsequent work to skip route delete notifications on nexthop deletes. Suggested-by: David Ahern Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 899895fb6dba6e7f45449665e3456899d88201d8 Author: Lukas Bulwahn Date: Sat Apr 18 12:09:33 2020 +0200 MAINTAINERS: adjust to renaming physmap_of_versatile.c Commit 6ca15cfa0788 ("mtd: maps: Rename physmap_of_{versatile, gemini} into physmap-{versatile, gemini}") renamed physmap_of_versatile.c to physmap-versatile.c, but did not adjust the MAINTAINERS entry. Since then, ./scripts/get_maintainer.pl --self-test complains: warning: no file matches F: drivers/mtd/maps/physmap_of_versatile.c Rectify the ARM INTEGRATOR, VERSATILE AND REALVIEW SUPPORT entry and now also cover drivers/mtd/maps/physmap-versatile.h while at it. Co-developed-by: Sebastian Duda Signed-off-by: Sebastian Duda Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20200418100933.8012-1-lukas.bulwahn@gmail.com Reviewed-by: Boris Brezillon Signed-off-by: Linus Walleij commit d2854bbe5f5c4b4bec8061caf4f2e603d8819446 Author: Linus Walleij Date: Thu Feb 13 15:27:54 2020 +0100 ARM: integrator: Add some Kconfig selections The CMA and DMA_CMA Kconfig options need to be selected by the Integrator in order to produce boot console on some Integrator systems. The REGULATOR and REGULATOR_FIXED_VOLTAGE need to be selected in order to boot the system from an external MMC card when using MMCI/PL181 from the device tree probe path. Select these things directly from the Kconfig so we are sure to be able to bring the systems up with console from any device tree. Signed-off-by: Linus Walleij commit e07fec6062865ae4fbc096223fbceac039b18acf Author: Linus Walleij Date: Thu Feb 13 15:26:29 2020 +0100 ARM: integrator: Retire LM and IM-PD1 boardfile code We now support probing and populating logical modules and the IM-PD1 example module in particular directly from the device tree using the LM bus driver. Signed-off-by: Linus Walleij commit ccea5e8a5918110a45c5f1c42ccd56affa0febcb Author: Linus Walleij Date: Thu Feb 13 13:41:23 2020 +0100 bus: Add driver for Integrator/AP logic modules The logic modules on the Integrator/AP (Application Platform) are logic tiles with (typically) one or a few peripheral devices. They are most commonly used for FPGA prototyping. Using the device tree node for logic tiles, we probe them in order and check if the special system controller register confirm their presence before populating the node for a tile. This supercedes the code in arch/arm/mach-integrator/lm.[c|h] and makes it possible to populate the tiles using the device tree instead of boardfile-based descriptions. Tested with all peripherals including graphics and MMC card working fine with the IM-PD1 example tile from Arm. Signed-off-by: Linus Walleij commit 03d679bf004d49d5a58161946711f276831c978e Author: Linus Walleij Date: Fri Mar 20 14:45:24 2020 +0100 bus: Add DT bindings for Integrator/AP logic modules This adds YAML device tree bindings for the Integrator/AP logic modules. These are plug-in tiles used typically for FPGA prototyping. Reviewed-by: Rob Herring Cc: devicetree@vger.kernel.org Cc: Robin Murphy Link: https://lore.kernel.org/r/20200320134524.52140-1-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit a6bbdf2e750f245d219d39f3c3d06ace2c5871e6 Author: Zou Wei Date: Tue Apr 28 17:07:09 2020 +0800 libbpf: Remove unneeded semicolon in btf_dump_emit_type Fixes the following coccicheck warning: tools/lib/bpf/btf_dump.c:661:4-5: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1588064829-70613-1-git-send-email-zou_wei@huawei.com commit 2dc8b5246d2c94f732c02e7a688d8a9c0c65361f Author: Raed Salem Date: Fri Apr 24 12:45:10 2020 -0700 net/mlx5: TX WQE Add trailer insertion field Add new TX WQE field for Connect-X6DX trailer insertion support, when set, the HW adds a trailer to the packet, the WQE trailer association flags are used to set to HW the header which the trailer belongs. Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed commit 0e1533bb9cce2c6b2aecdfddfcc0de3beeaddc7b Author: Eran Ben Elisha Date: Fri Apr 24 12:45:09 2020 -0700 net/mlx5: Add release all pages capability bit Add a bit in HCA capabilities layout to indicate if release all pages is supported. Signed-off-by: Eran Ben Elisha Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit ee5cdf7a5e8945372c7496e98de2b364e095b60b Author: Tariq Toukan Date: Fri Apr 24 12:45:08 2020 -0700 net/mlx5: Introduce TLS RX offload hardware bits Add TLS RX offload related IFC hardware fields and enumerations. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Reviewed-by: Boris Pismenny Signed-off-by: Saeed Mahameed commit 3df0107784ceb388039b1fe510a8c7b8816de8f0 Author: Moshe Shemesh Date: Fri Apr 24 12:45:07 2020 -0700 net/mlx5: Add structure and defines for pci sync for fw update event Add needed structure layouts and defines for pci sync for fw update event. The downstream patches will include event handlers for this event type. Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 06939536263d684073a30543930622eede633af1 Author: Moshe Shemesh Date: Fri Apr 24 12:45:06 2020 -0700 net/mlx5: Add structure layout and defines for MFRL register Add needed structure layouts and defines for MFRL (Management Firmware Reset Level) register. This structure will be used for the firmware upgrade and reset flow in the downstream patches. Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 244faedfd4d8e8c8e9f3c628d29bb74196b49743 Author: Raed Salem Date: Fri Apr 24 12:45:05 2020 -0700 net/mlx5: Refactor imm_inval_pkey field in cqe struct The imm_inval_pkey field can hold four different types of data, depends on the usage, the data could be one of the below: - Immediate field of the received message - Invalidate rkey - Pkey of the packet - Flow table metadata Current implementation doesn't reflect the intended usage of the field at usage time. Reflect the different types by replace this field with a union, modify code where this field is used to reflect its intended usage. Signed-off-by: Raed Salem Reviewed-by: Huy Nguyen Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit dff8e2d15283dd92582ddeec25ca86e4cf2618c7 Author: Erez Shitrit Date: Fri Apr 24 12:45:04 2020 -0700 net/mlx5: Use aligned variable while allocating ICM memory The alignment value is part of the input structure, so use it and spare extra memory allocation when is not needed. Now, using the new ability when allocating icm for Direct-Rule insertion. Signed-off-by: Ariel Levkovich Signed-off-by: Erez Shitrit Signed-off-by: Saeed Mahameed commit 2b58f6d9df50f534fe465113b69de60a2ef0e74a Author: Raed Salem Date: Fri Apr 24 12:45:03 2020 -0700 net/mlx5: Introduce IPsec Connect-X offload hardware bits and structures Add IPsec offload related IFC structs, layouts and enumerations. Signed-off-by: Raed Salem Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d65dbedfd298344747033f17c1efd2afc8082bc7 Author: Huy Nguyen Date: Fri Apr 24 12:45:02 2020 -0700 net/mlx5: Add support for COPY steering action Add COPY type to modify_header action. IPsec feature is the first feature that needs COPY steering action. Signed-off-by: Huy Nguyen Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Acked-by: Leon Romanovsky commit b26d1e2b60284dc9f66ffad9ccd5c5da1100bb4b Author: Veronika Kabatova Date: Tue Apr 28 19:37:42 2020 +0200 selftests/bpf: Copy runqslower to OUTPUT directory $(OUTPUT)/runqslower makefile target doesn't actually create runqslower binary in the $(OUTPUT) directory. As lib.mk expects all TEST_GEN_PROGS_EXTENDED (which runqslower is a part of) to be present in the OUTPUT directory, this results in an error when running e.g. `make install`: rsync: link_stat "tools/testing/selftests/bpf/runqslower" failed: No such file or directory (2) Copy the binary into the OUTPUT directory after building it to fix the error. Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests") Signed-off-by: Veronika Kabatova Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200428173742.2988395-1-vkabatov@redhat.com commit 7c1c5e38fd31e89391211c0b3e5000666c7d6126 Author: Yuanjiang Yu Date: Mon Apr 20 11:42:07 2020 +0800 power: supply: sc27xx: Add boot voltage support Add new property to allow to get the voltage measured during boot time. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang Signed-off-by: Sebastian Reichel commit e5431c340852ad14c54f449451f884b161aae31f Author: Yuanjiang Yu Date: Mon Apr 20 11:42:06 2020 +0800 power: supply: sc27xx: Add CURRENT_NOW/VOLTAGE_NOW properties support Add new properties to get present current and voltage of the fuel gauge. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang Signed-off-by: Sebastian Reichel commit 8720b255f5280fdf89decfa9ff31720aff1c4e49 Author: Yuanjiang Yu Date: Mon Apr 20 11:42:05 2020 +0800 power: supply: sc27xx: Allow to change the battery full capacity The battery full capacity can be affected by the temperature or the servicing time or other factors, so some platforms will track the real battery full capacity in charger manager service. Thus we should allow to change the battery full capacity by setting the 'POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN' property as writeable. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang Signed-off-by: Sebastian Reichel commit f3912a5d56838f78ef2999368e4c7b132262125a Author: Yuanjiang Yu Date: Mon Apr 20 11:42:04 2020 +0800 power: supply: sc27xx: Set 'no_thermal' flag for SC27xx fuel gauge There is no thermal zone should be created for the SC27XX FGU power supply, thus set the 'no_thermal' flag as true. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang Signed-off-by: Sebastian Reichel commit 0b54142e4b09fbf719eb9fc6fe8bcacbd0547ac3 Merge: 8c1b2bf16d59 32927393dc1c Author: Daniel Borkmann Date: Tue Apr 28 21:20:20 2020 +0200 Merge branch 'work.sysctl' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull in Christoph Hellwig's series that changes the sysctl's ->proc_handler methods to take kernel pointers instead. It gets rid of the set_fs address space overrides used by BPF. As per discussion, pull in the feature branch into bpf-next as it relates to BPF sysctl progs. Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200427071508.GV23230@ZenIV.linux.org.uk/T/ commit ddd86c9534e186b4f043b7b828f984b90f9ff40a Author: Jason Yan Date: Sun Apr 26 17:42:50 2020 +0800 power: supply: ab8500_fg: remove comparison to bool Fix the following coccicheck warning: drivers/power/supply/ab8500_fg.c:2402:5-24: WARNING: Comparison to bool Signed-off-by: Jason Yan Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel commit fc5be29f9b2cd9fc7243bf3c26ed042f2868fa8b Author: Kejia Hu Date: Tue Apr 28 08:04:37 2020 +0100 power: reset: qcom-pon: reg write mask depends on pon generation Instead of hardcode the mask, it should be depends on which generation of pon it was. Signed-off-by: Kejia Hu Fixes: fce5430f6a86 ("reset: qcom-pon: Add support for gen2 pon") Signed-off-by: Sebastian Reichel commit 826fc86b59034b0913976a0ff5901de82a4b66e8 Author: Rob Herring Date: Sun Apr 5 11:14:52 2020 -0600 drm: pl111: Move VExpress setup into versatile init Since the VExpress setup in pl111_vexpress.c is now just a single function call, let's move it into pl111_versatile.c and we can further simplify pl111_versatile_init() by moving the other pieces for VExpress into pl111_vexpress_clcd_init(). Cc: Eric Anholt Cc: dri-devel@lists.freedesktop.org Acked-by: Sam Ravnborg Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-4-robh@kernel.org commit cbcab504ceecc0b27ab829cbbcd5cad1c17b3975 Author: Rob Herring Date: Thu Apr 2 11:34:25 2020 -0600 drm: pl111: Simplify vexpress init The init VExpress variants currently instantiates a 'muxfpga' driver for the sole purpose of getting a regmap for it. There's no reason to instantiate a driver and doing so just complicates things. The muxfpga driver also isn't unregistered properly on module unload. Let's just simplify all this this by just calling devm_regmap_init_vexpress_config() directly. Cc: Eric Anholt Cc: dri-devel@lists.freedesktop.org Acked-by: Sam Ravnborg Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-3-robh@kernel.org commit 66ddc1e94114d0271910ed31af6c301a281c9260 Author: Rob Herring Date: Fri Apr 3 17:06:08 2020 -0600 drm: pl111: Fix module autoloading Add a missing MODULE_DEVICE_TABLE entry to fix module autoloading. Cc: Eric Anholt Cc: dri-devel@lists.freedesktop.org Acked-by: Sam Ravnborg Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-2-robh@kernel.org commit 48ebea5026d692c5ab0a7d303f0fe1f8ba046e0f Author: Luis Chamberlain Date: Fri Apr 24 18:49:16 2020 +0000 firmware_loader: move fw_fallback_config to a private kernel symbol namespace Take advantage of the new kernel symbol namespacing functionality, and export the fw_fallback_config symbol only to a new private firmware loader namespace. This would prevent misuses from other drivers and makes it clear the goal is to keep this private to the firmware loader only. It should also make it clearer for folks git grep'ing for users of the symbol that this exported symbol is private, and prevent future accidental removals of the exported symbol. Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20200424184916.22843-2-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman commit eb7fbc9fb1185a7f89adeb2de724c2c96ff608e9 Author: Christophe JAILLET Date: Sat Apr 11 15:31:58 2020 +0200 driver core: Add missing '\n' in log messages Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. While at it, convert some "printk(KERN_" into equivalent but less verbose (pr|dev)_xxx functions. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200411133158.27390-1-christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit baf1d9c182935e88aab08701b0a0b22871117fe0 Author: zhouchuangao Date: Sun Apr 26 13:13:51 2020 +0800 driver/base/soc: Use kobj_to_dev() API Use kobj_to_dev() API instead of container_of(). Signed-off-by: zhouchuangao Link: https://lore.kernel.org/r/1587878031-16591-1-git-send-email-zhouchuangao@xiaomi.com Signed-off-by: Greg Kroah-Hartman commit ec43a27fffd025f718428d9f4f8df22fa765405f Author: Mauro Carvalho Chehab Date: Tue Apr 21 18:27:58 2020 +0200 scripts: sphinx-pre-install: change the output order When the script detects the need for an upgrade, it will print either a warning or a note. Let's change a little bit the order where messages will be displayed, in order to make easier for the user to identify the more important messages. It should now be like this: Detected OS: Fedora release 31 (Thirty One). Sphinx version: 1.7.9 Note: It is recommended at least Sphinx version 2.4.4 if you need PDF support. To upgrade Sphinx, use: /usr/bin/python3 -m venv sphinx_2.4.4 . sphinx_2.4.4/bin/activate pip install -r ./Documentation/sphinx/requirements.txt If you want to exit the virtualenv, you can use: deactivate All optional dependencies are met. Needed package dependencies are met. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/20200421182758.04e0a53e@coco.lan Signed-off-by: Jonathan Corbet commit 412b09ddadd34e9be0d9a26e6de252361fafc237 Author: Mauro Carvalho Chehab Date: Tue Apr 21 16:31:08 2020 +0200 scripts: sphinx-pre-install: fix a bug when using with venv When python3 creates a venv, it adds python into it! This causes any upgrade recommendation to look like this: /devel/v4l/docs/sphinx_1.7.9/bin/python3 -m venv sphinx_2.4.4 . sphinx_2.4.4/bin/activate pip install -r ./Documentation/sphinx/requirements.txt With is wrong (and it may not work). So, when recomending an upgrade, exclude the venv dir from the search path, and get the system's python. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/aa622ff71bebf6960fc0262fb90e7ebc7a999a02.1587478901.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 2834a7412bb1a74722231d7198518f9456279156 Author: Mauro Carvalho Chehab Date: Tue Apr 21 16:31:07 2020 +0200 scripts: sphinx-pre-install: change recommendation text if venv exists If one is running a Sphinx version older than what's recommended, but there's already a newer working virtual env, change the text, as it is just a matter of switching to the new venv, instead of creating a new one from scratch. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/bcf79d0399a1c3444ca938dcdce599c3273980ab.1587478901.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 1ef70ced55976368275c468dfd436881d5580111 Author: Mauro Carvalho Chehab Date: Tue Apr 21 16:31:06 2020 +0200 scripts: sphinx-pre-install: change the warning for version < 2.4.4 As requested by Jon, change the version check, in order to not emit a warning if version is >= 1.7.9, but below 2.4.4. After this patch, if someone used an older version, it will say: ./scripts/sphinx-pre-install Sphinx version 1.7.9 Note: It is recommended at least Sphinx version 2.4.4 if you need PDF support. Detected OS: Fedora release 31 (Thirty One). To upgrade Sphinx, use: /devel/v4l/docs/sphinx_1.7.9/bin/python3 -m venv sphinx_2.4.4 . sphinx_2.4.4/bin/activate pip install -r ./Documentation/sphinx/requirements.txt If you want to exit the virtualenv, you can use: deactivate All optional dependencies are met. Needed package dependencies are met. If Sphinx is not detected at all, it Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/79584d317ba16f5d4f37801c5ee57cf04085f962.1587478901.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a8b380c379efcade6008cb5e2359073b72e73ad8 Author: Mauro Carvalho Chehab Date: Tue Apr 21 16:31:05 2020 +0200 scripts: sphinx-pre-install: only ask to activate valid venvs If a venv doesn't contain Sphinx, or has an older Sphinx version, ignore it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d11a00d88514e8a0357e1b0a05ebd518952a1d39.1587478901.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 274ed9e9eabd23984ac03a8cebf5ce206c0b60bf Author: Daniel Vetter Date: Wed Apr 15 09:40:13 2020 +0200 drm/i915: Use devm_drm_dev_alloc Luckily we're already well set up in the main driver, with drm_dev_put() being the last thing in both the unload error case and the pci remove function. Acked-by: Jani Nikula Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-39-daniel.vetter@ffwll.ch commit 1f5ea8720e8db71d768533bf61773ecdbf9fdcc2 Author: Michal Suchanek Date: Wed Apr 15 23:16:50 2020 +0200 doc: nvdimm: remove reference to non-existent CONFIG_NFIT_TEST The test driver is in tools/testing/nvdimm and cannot be selected by a config option. Signed-off-by: Michal Suchanek Link: https://lore.kernel.org/r/20200415211654.10827-1-msuchanek@suse.de Signed-off-by: Jonathan Corbet commit 6bc47621cbf357a9b7bab3890489804f38916a35 Author: Stephen Kitt Date: Thu Apr 23 20:36:49 2020 +0200 docs: sysctl/kernel: document cad_pid Based on the implementation in kernel/sysctl.c (the proc_do_cad_pid() function), kernel/reboot.c, and include/linux/sched/signal.h. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200423183651.15365-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit 2ad9a844fc83282d7f4e71baa82ffa2c0ae88c63 Author: Stephen Kitt Date: Fri Apr 24 17:26:37 2020 +0200 docs: virt/kvm: close inline string literal This fixes Documentation/virt/kvm/amd-memory-encryption.rst:76: WARNING: Inline literal start-string without end-string. Fixes: 2da1ed62d55c ("KVM: SVM: document KVM_MEM_ENCRYPT_OP, let userspace detect if SEV is available") Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200424152637.120876-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit 920af1ce1b6e713d187f178b3fe37d3e3b12381a Author: Stephen Kitt Date: Fri Apr 24 17:35:15 2020 +0200 docs: orangefs: fix pvfs2tab literal block Following a merge fix-up, the literal block is introduced too early; this patch merges the localhost mention with the introduction, fixing Documentation/filesystems/orangefs.rst:124: WARNING: Literal block expected; none found. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200424153515.134500-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit 6feb76dbd14a3addce915f251580f7b89d68d356 Author: Wolfram Sang Date: Sat Apr 25 12:06:16 2020 +0200 Documentation: zh_CN: convert to use i2c_new_client_device() Move away from the deprecated API and advertise the new one. Signed-off-by: Wolfram Sang Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20200425100616.3363-1-wsa+renesas@sang-engineering.com Signed-off-by: Jonathan Corbet commit b529c06f9dc74a7ad8cb875e840967737d0455f3 Author: Juan Manuel Méndez Rey Date: Sun Apr 26 03:52:50 2020 +0200 Update the documentation referencing Plan 9 from User Space. The page originally referenced to checkout Plan9 application and libraries have been missing for quite some time and the development is carried out in github and documented on this new site. Signed-off-by: Juan Manuel Méndez Rey Link: https://lore.kernel.org/r/20200426015250.GA35090@camelot Signed-off-by: Jonathan Corbet commit 08ce0c1e1116080c2fe13b2dc2a05b884d710ef7 Author: Leonardo Bras Date: Mon Apr 27 23:44:40 2020 -0300 mailmap: Add entry for Leonardo Bras Add an entry to connect my email addresses. Signed-off-by: Leonardo Bras Link: https://lore.kernel.org/r/20200428024439.215806-1-leobras.c@gmail.com Signed-off-by: Jonathan Corbet commit 2d5694796b6b4afe188270388813c6c89e4d3f46 Author: Flavio Suligoi Date: Tue Apr 28 15:32:25 2020 +0200 Documentation: x86: fix space instead of tab in uefi doc Signed-off-by: Flavio Suligoi Link: https://lore.kernel.org/r/1588080745-21999-1-git-send-email-f.suligoi@asem.it Signed-off-by: Jonathan Corbet commit f9d77427c3fd27fd69ac54067f968784dc725eb6 Author: Matt Atwood Date: Wed Apr 15 15:35:35 2020 -0400 drm/i915/tgl: Wa_14011059788 Reflect recent Bspec changes v2: fix whitespace, typo Signed-off-by: Matt Atwood Reviewed-by: Radhakrishna Sripada Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20200415193535.14597-1-matthew.s.atwood@intel.com commit e304f8a0513b830be37b3f5059c3d8fcaacda4b7 Author: Daniel Vetter Date: Wed Apr 15 09:40:02 2020 +0200 drm/qxl: Don't use drm_device->dev_private Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Acked-by: Gerd Hoffmann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-28-daniel.vetter@ffwll.ch commit a9b0b24a6fff2d269eb966d7e4eca498bf9f0bba Author: Daniel Vetter Date: Wed Apr 15 09:40:01 2020 +0200 drm/qxl: Use devm_drm_dev_alloc Also need to remove the drm_dev_put from the remove hook. Acked-by: Gerd Hoffmann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-27-daniel.vetter@ffwll.ch commit 7456427af9def0fec5508dd8b861556038ee96a8 Author: Nicolas Saenz Julienne Date: Mon Apr 20 14:01:02 2020 +0200 of: property: Do not link to disabled devices When creating a consumer/supplier relationship between two devices, make sure the supplier node is actually active. Otherwise this will create a link relationship that will never be fulfilled. This, in the worst case scenario, will hang the system during boot. Note that, in practice, the fact that a device-tree represented consumer/supplier relationship isn't fulfilled will not prevent devices from successfully probing. Fixes: a3e1d1a7f5fc ("of: property: Add functional dependency link from DT bindings") Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Saravana Kannan Signed-off-by: Rob Herring commit ed3655729182a59b9bef1b564c6fc2dcbbbe954e Author: Nicolas Saenz Julienne Date: Mon Apr 20 14:01:01 2020 +0200 of: property: Fix create device links for all child-supplier dependencies Upon adding a new device from a DT node, we scan its properties and its children's properties in order to create a consumer/supplier relationship between the device and the property provider. That said, it's possible for some of the node's children to be disabled, which will create links that'll never be fulfilled. To get around this, use the for_each_available_child_of_node() function instead of for_each_available_node() when iterating over the node's children. Fixes: d4387cd11741 ("of: property: Create device links for all child-supplier depencencies") Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Saravana Kannan Signed-off-by: Rob Herring commit 8f88fad370bb0884f7f7217dea254b202df44716 Author: Saravana Kannan Date: Thu Apr 16 13:58:38 2020 -0700 of: property: Don't retry device_link_add() upon failure When of_link_to_phandle() was implemented initially, there was no way to tell if device_link_add() was failing because the supplier device hasn't been parsed yet, hasn't been added yet, the links were creating a cycle, etc. Some of these were transient errors that'd go away at a later point. However, with the current set of improved checks, if device_link_add() fails, it'll only be for permanent errors like cycles or out-of-memory errors. Also, with the addition of DL_FLAG_SYNC_STATE_ONLY flag [1] to device links, all the valid dependency cycles due to "proxy" device links (needed for correctness of sync_state() device callback) will never fail device_link_add() due to cycles. So, continuing to retry failing device links (by returning -EAGAIN) is no longer useful. At worst, it prevents platforms from setting fw_devlink=on (or better) because it prevents proper boot up. So, let's not do that anymore. [1] - https://lore.kernel.org/lkml/20191028220027.251605-1-saravanak@google.com/ Cc: Nicolas Saenz Julienne Cc: Greg Kroah-Hartman Signed-off-by: Saravana Kannan Tested-by: Nicolas Saenz Julienne Signed-off-by: Rob Herring commit a4a8ced6fbbce1caf0d39ebf8c163162cb69ad01 Author: Rob Herring Date: Tue Apr 21 19:32:39 2020 -0500 dt-bindings: iio: adi,ltc2983: Add missing quotes on dependencies With the bracketed list form, any strings with commas have to be quoted or they are separated. Fixes: 3986a14870cb ("dt-bindings: iio: Add ltc2983 documentation") Cc: "Nuno Sá" Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: linux-iio@vger.kernel.org Acked-by: Nuno Sá Acked-by: Jonathan Cameron Signed-off-by: Rob Herring commit d074684a268dd4ffeb7b1e8ff497a30bdfc0867f Author: Alain Volmat Date: Thu Jan 23 17:12:47 2020 +0100 dt-bindings: i2c: i2c-stm32f7: add st,stm32mp15-i2c compatible Add a new stm32mp15 specific compatible to handle FastMode+ registers which are different on the stm32mp15 compared to the stm32f7 or stm32h7. Signed-off-by: Alain Volmat Signed-off-by: Rob Herring commit 7fb89e1d44cb6aec342e5cca6ed6371d818a428c Author: Ard Biesheuvel Date: Mon Apr 20 11:27:53 2020 +0200 ACPI/IORT: take _DMA methods into account for named components Where IORT nodes for named components can describe simple DMA limits expressed as the number of address bits a device can drive, _DMA methods in AML can express more complex topologies, involving DMA translation in particular. Currently, we only take this _DMA method into account if it appears on a ACPI device node describing a PCIe root complex, but it is perfectly acceptable to use them for named components as well, so let's ensure we take them into account in those cases too. Note that such named components are expected to reside under a pseudo-bus node such as the ACPI0004 container device, which should be providing the _DMA method as well as a _CRS (as mandated by the ACPI spec). This is not enforced by the code however. Reported-by: Andrei Warkentin Signed-off-by: Ard Biesheuvel Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20200420092753.9819-1-ardb@kernel.org Signed-off-by: Will Deacon commit 4b54bf4763e3725dcceaac379df4ef78df3b9fcd Author: Leonard Crestez Date: Tue Apr 28 20:03:02 2020 +0300 interconnect: imx: Add platform driver for imx8mn Add a platform driver for the i.MX8MN SoC describing bus topology, based on internal documentation. Signed-off-by: Leonard Crestez Link: https://lore.kernel.org/r/338a5409ce88811ba6c940ba06441db3faa8c187.1586174566.git.leonard.crestez@nxp.com Signed-off-by: Georgi Djakov commit 63fc8029b37ef22aefa5288211ccc92c3f40def0 Author: Leonard Crestez Date: Tue Apr 28 20:03:02 2020 +0300 interconnect: imx: Add platform driver for imx8mq Add a platform driver for the i.MX8MQ SoC describing bus topology, based on internal documentation. Signed-off-by: Leonard Crestez Tested-by: Martin Kepplinger Link: https://lore.kernel.org/r/864310d1f2599c3bd621e70b77028a6e89f6410e.1586174566.git.leonard.crestez@nxp.com Signed-off-by: Georgi Djakov commit 2c1966af073c3469e886e8f4c4c83403fe2ac857 Author: Leonard Crestez Date: Tue Apr 28 20:03:02 2020 +0300 interconnect: imx: Add platform driver for imx8mm Add a platform driver for the i.MX8MM SoC describing bus topology. Bandwidth adjustments is currently only supported on the DDRC and main NOC. Scaling for the vpu/gpu/display NICs could be added in the future. Signed-off-by: Alexandre Bailon Signed-off-by: Leonard Crestez Link: https://lore.kernel.org/r/b14eef179dbd837a486619724b8033490f49db72.1586174566.git.leonard.crestez@nxp.com Signed-off-by: Georgi Djakov commit f0d8048525d7d8618a79550cd70de9ce0a6a496f Author: Leonard Crestez Date: Tue Apr 28 20:03:02 2020 +0300 interconnect: Add imx core driver This adds support for i.MX SoC family to interconnect framework. Platform drivers can describe the interconnect graph and several adjustment knobs where icc node bandwidth is converted to a DEV_PM_QOS_MIN_FREQUENCY request. The interconnect provider is probed through the main NOC device and other adjustable nodes on the same graph are found from a fsl,scalable-nodes phandle array property. Signed-off-by: Alexandre Bailon Signed-off-by: Leonard Crestez Tested-by: Martin Kepplinger Link: https://lore.kernel.org/r/35920e673df6c04cbbb7d877a7d4ba25fd91a784.1586174566.git.leonard.crestez@nxp.com Signed-off-by: Georgi Djakov commit 146eee039d7ab236f71edd56b975f4ff49635db9 Author: Leonard Crestez Date: Mon Apr 6 15:03:06 2020 +0300 dt-bindings: interconnect: Add bindings for imx8m noc Add initial dt bindings for the interconnects inside i.MX chips. Multiple external IPs are involved but SOC integration means the software controllable interfaces are very similar. Main NOC node acts as interconnect provider if #interconnect-cells is present. Currently there is a single imx interconnect provider for the whole SOC. Other pieces of scalable interconnects can be present, each with their own OPP table. Signed-off-by: Leonard Crestez Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/8b341d91e9aee679ae69feb22a2c842b2aeb2137.1586174566.git.leonard.crestez@nxp.com Signed-off-by: Georgi Djakov commit 68d047cb0a20f612506c6cf3a98e3600a7d4371f Author: Sanjay R Mehta Date: Mon Apr 27 23:56:41 2020 -0500 spi: spi-amd: fix warning remove unused variable "opcode" Signed-off-by: Sanjay R Mehta Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/1588049801-37995-1-git-send-email-sanju.mehta@amd.com Signed-off-by: Mark Brown commit 76085aff29f585139a37a10ea0a7daa63f70872c Author: Ard Biesheuvel Date: Mon Apr 13 17:55:18 2020 +0200 efi/libstub/arm64: align PE/COFF sections to segment alignment The arm64 kernel's segment alignment is fixed at 64 KB for any page size, and relocatable kernels are able to fix up any misalignment of the kernel image with respect to the 2 MB section alignment that is mandated by the arm64 boot protocol. Let's increase the PE/COFF section alignment to the same value, so that kernels loaded by the UEFI PE/COFF loader are guaranteed to end up at an address that doesn't require any reallocation to be done if the kernel is relocatable. Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200413155521.24698-6-ardb@kernel.org Signed-off-by: Will Deacon commit ea6318dc5a1d2c4c146d9db92cbef8d9d6619461 Author: Alain Volmat Date: Thu Jan 23 17:12:50 2020 +0100 ARM: dts: stm32: add Fast Mode Plus info in I2C nodes of stm32mp151 Add the syscfg-fmp property in each i2c node in order to allow Fast Mode Plus speed if clock-frequency >= 1MHz is indicated. Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit 06a933aaef99ae6338e0da51f9d5016c3b8f8ead Author: Alain Volmat Date: Thu Jan 23 17:12:49 2020 +0100 ARM: dts: stm32: use st,stm32mp15-i2c compatible for stm32mp151 Replace previous st,stm32f7-i2c compatible with st,stm32mp15-i2c for the platform stm32mp151. Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit 86b8783701246a22a734824674cc3f87a5ed9f13 Author: Vincenzo Frascino Date: Tue Apr 28 16:08:54 2020 +0100 arm64: vdso: Add '-Bsymbolic' to ldflags Commit 28b1a824a4f44 ("arm64: vdso: Substitute gettimeofday() with C implementation") introduced an unused 'VDSO_LDFLAGS' variable to the vdso Makefile, suggesting that we should be passing '-Bsymbolic' to the linker, as we do when linking the compat vDSO. Although it's not strictly necessary to pass this flag, it would be required if we were to add any internal references to the exported symbols. It's also consistent with how we link the compat vdso so, since there's no real downside from passing it, add '-Bsymbolic' to the ldflags for the native vDSO. Fixes: 28b1a824a4f44 ("arm64: vdso: Substitute gettimeofday() with C implementation") Reported-by: Geoff Levand Signed-off-by: Vincenzo Frascino Cc: Will Deacon Cc: Catalin Marinas Cc: Ard Biesheuvel Link: https://lore.kernel.org/r/20200428150854.33130-1-vincenzo.frascino@arm.com Signed-off-by: Will Deacon commit f0ca7b249c7305c9b9781f7dbcb8d294e0086808 Author: Matti Vaittinen Date: Tue Apr 28 12:29:30 2020 +0300 regulator: bd718x7: remove voltage change restriction from BD71847 The BD71837 had a HW "feature" where changing the regulator output voltages of other regulators but bucks 1-4 might cause spikes if regulators were enabled. Thus SW prohibit voltage changes for other regulators except for bucks 1-4 when regulator is enabled. The HW colleagues did inadvertly fix this issue for BD71847 and BD71850. Remove voltage change restrictions from other PMICs but BD71837. The LDO voltage changing is still restricted. I did not yet receive answer whether there is voltage spikes to be expected for LDOs. I only know that the power-good detection for LDOs can cause false alarms if LDO voltage is changed when LDO is enabled. We might be able to work-around this by disabling the power-good monioring for the duration of the LDO voltage change - but as I said, I don't know yet. Let's fix it later if we can confirm that also LDO voltage changes are safe. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/20200428092930.GA9721@localhost.localdomain Signed-off-by: Mark Brown commit ff532461a42a00a30abde612a7d830506ca404ac Author: Marek Olšák Date: Mon Apr 27 16:25:39 2020 -0400 drm/amdgpu: bump version for invalidate L2 before SDMA IBs This fixes GPU hangs due to cache coherency issues. Bump the driver version. Split out from the original patch. Signed-off-by: Marek Olšák Reviewed-by: Christian König Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit 652a6a858fcfe2ee053856b52c4736f61b3982be Author: Marek Olšák Date: Mon Apr 27 15:59:22 2020 -0400 drm/amdgpu: invalidate L2 before SDMA IBs (v2) This fixes GPU hangs due to cache coherency issues. v2: Split the version bump to a separate patch Signed-off-by: Marek Olšák Reviewed-by: Christian König Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit c57053725d9bd7ab3e14fd0f8001714041df1280 Author: Marek Olšák Date: Fri Apr 17 20:50:30 2020 -0400 drm/amdgpu: add tiling flags from Mesa DCC_INDEPENDENT_128B is needed for displayble DCC on gfx10. SCANOUT is not needed by the kernel, but Mesa uses it. Signed-off-by: Marek Olšák Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 9b5aaec441d3c76d6255049e99c446f14c89a284 Author: Ard Biesheuvel Date: Tue Apr 14 15:47:06 2020 +0200 arm64: drop duplicate definitions of ID_AA64MMFR0_TGRAN constants A bunch of ID_AA64MMFR0_TGRAN_* constant definitions appear twice in arch/arm64/include/asm/sysreg.h, so drop the duplicates. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Acked-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200414134706.8435-1-ardb@kernel.org Signed-off-by: Will Deacon commit cd4df4e6ed177ab0d1253cfeae14a2307e263754 Author: James Zhu Date: Mon Apr 27 14:49:37 2020 -0400 drm/amdgpu/vcn2.5: wait for tiles off after unpause Wait for tiles off after unpause to fix transcode timeout issue. It is a work around. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit c7833d332e05cfa7b190b37dd3094c7257f1ea6d Author: Tiecheng Zhou Date: Sun Apr 26 19:03:17 2020 +0800 drm/amd/powerplay: avoid using pm_en before it is initialized revised hwmgr->pm_en is initialized at hwmgr_hw_init. during amdgpu_device_init, there is amdgpu_asic_reset that calls to soc15_asic_reset (for V320 usecase, Vega10 asic), in which: 1) soc15_asic_reset_method calls to pp_get_asic_baco_capability (pm_en) 2) soc15_asic_baco_reset calls to pp_set_asic_baco_state (pm_en) pm_en is used in the above two cases while it has not yet been initialized So avoid using pm_en in the above two functions for V320 passthrough. Reviewed-by: Evan Quan Signed-off-by: Tiecheng Zhou Signed-off-by: Alex Deucher commit a1cd1289a68c4f9fb7551edd06c6a6b4661a4cbb Author: Tiecheng Zhou Date: Mon Apr 27 09:44:38 2020 +0800 Revert "drm/amd/powerplay: avoid using pm_en before it is initialized" This reverts commit c5207876232649ca5e5ddd6f966d2da75ffded8f. The commit being reverted changed the wrong place, it should have changed in func get_asic_baco_capability. Reviewed-by: Evan Quan Signed-off-by: Tiecheng Zhou Signed-off-by: Alex Deucher commit eda12425b266b85a8c4b8f4f25ca8afc7e36070f Merge: 433f9cba54fa 4262ddc2ad63 Author: Mark Brown Date: Tue Apr 28 16:40:38 2020 +0100 Merge series "Kconfig updates for DMIC and SOF HDMI support" from Ranjani Sridharan : This series provides the following updtes to the Intel machine driver Kconfig: 1. The first patch adds the explicit dependency on GPIOLIB when SND_SOC_DMIC is selected. 2. SND_SOC_SOF_HDA_AUDIO_CODEC is required for using the legacy HDA codec driver for HDMI support in SOF. The last 3 three patches make the required changes to account for this. Libin Yang (3): ASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common hdmi ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition ASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition Pierre-Louis Bossart (1): ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used sound/soc/intel/boards/Kconfig | 51 ++++++++++++++------------- sound/soc/intel/boards/sof_pcm512x.c | 9 ----- sound/soc/intel/boards/sof_sdw.c | 8 ----- sound/soc/intel/boards/sof_sdw_hdmi.c | 7 ---- 4 files changed, 26 insertions(+), 49 deletions(-) -- 2.17.1 commit 433f9cba54fa92d78a1fd590d219aada44829588 Merge: ac3367442d9e ad18763f4683 Author: Mark Brown Date: Tue Apr 28 16:40:37 2020 +0100 Merge series "add channel constraint for BDW machine drivers" from Brent Lu : The machine driver bdw-rt5650 (for Google buddy) supports 2 or 4-channel recording while other two drivers support only 2-channel recording. HW constraints are implemented to reflect the hardware limitation on BDW platform. Changes since v1: - Change the patch title. - Remove the DUAL_CHANNEL and QUAD_CHANNEL macros which are too obvious. - Follow the naming convertion, using 'bdw_rt5650_' and 'bdw_rt5677_' to name startup functions. - Refine the comments in startup functions. - Redesign the bdw_rt5650_fe_startup() function for readability. - Add an assignment to initialize runtime->hw.channels_max variable. Brent Lu (3): ASoC: bdw-rt5677: add channel constraint ASoC: bdw-rt5650: add channel constraint ASoC: broadwell: add channel constraint sound/soc/intel/boards/bdw-rt5650.c | 29 +++++++++++++++++++++++++++++ sound/soc/intel/boards/bdw-rt5677.c | 26 ++++++++++++++++++++++++++ sound/soc/intel/boards/broadwell.c | 26 ++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) -- 2.7.4 commit ac3367442d9e5971e32014c6fea41ca1662c0e2d Author: Wei Yongjun Date: Tue Apr 28 11:07:42 2020 +0000 ASoC: tegra: tegra_wm8903: Use devm_snd_soc_register_card() Using devm_snd_soc_register_card() can make the code shorter and cleaner. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200428110742.110335-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit dda830431640264b6afcf78424dcefaf4cbc55a4 Author: Arnaud Pouliquen Date: Wed Apr 1 17:03:39 2020 +0200 ARM: dts: stm32: add cortex-M4 pdds management in Cortex-M4 node Add declarations related to the syscon pdds for deep sleep management. Signed-off-by: Arnaud Pouliquen Signed-off-by: Alexandre Torgue commit 87189b78959c10c454477cce5cb9836c2ee5c730 Author: Kenny Levinsen Date: Fri Apr 24 16:51:03 2020 +0200 drm: make drm_file use keyed wakeups Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP. As drm_file uses unkeyed wakeups, such a poll receives many spurious wakeups from uninteresting events. Use keyed wakeups to allow the wakeup target to more efficiently discard these uninteresting events. Signed-off-by: Kenny Levinsen Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200424145103.3048-1-kl@kl.wtf commit 2f8eae39056f6735bd21fc06c40ec16e1df64a0c Merge: 2d744ecf2b98 1fecbb71fe0e Author: Mark Brown Date: Tue Apr 28 16:05:35 2020 +0100 Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8 commit c6d1ec4134edc1611da39777cdc5dba78c757d35 Author: Joseph Greathouse Date: Thu Apr 16 14:08:59 2020 -0500 drm/amdkfd: Put ASIC revision into HSA capability In order to surface the ASIC revision to user level, we want to put it into the HSA topology. This can be because different ASIC revisions may require user-level software to do different things (e.g. patch code for things that are changed in later hardware revisions). The ASIC revision from the hardware is maximum of 4 bits at this time, so put it into 4 of the open bits in the HSA capability. Then user-level software can use this capability information to know -- for each ASIC -- what revision-based things must be done. Signed-off-by: Joseph Greathouse Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 32c8a94660e8f00fb81849de8f109951118532aa Author: Linus Walleij Date: Tue Apr 28 11:53:31 2020 +0200 pinctrl: db8500: Fix some old bugs The Hulk robot reports these build warnings: drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c:899:20: warning: ‘sbag_groups’ defined but not used [-Wunused-const-variable=] DB8500_FUNC_GROUPS(sbag, "sbag_oc2_1", "sbag_oc4_1"); ^ drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c:570:23: warning: ‘ipgpio6_c_2_pins’ defined but not used [-Wunused-const-variable=] static const unsigned ipgpio6_c_2_pins[] = { DB8500_PIN_G3 }; ^~~~~~~~~~~~~~~~ drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c:472:23: warning: ‘mc1dir_a_1_pins’ defined but not used [-Wunused-const-variable=] static const unsigned mc1dir_a_1_pins[] = { DB8500_PIN_AH13, DB8500_PIN_AG12, ^~~~~~~~~~~~~~~ drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c:453:23: warning: ‘modem_a_1_pins’ defined but not used [-Wunused-const-variable=] static const unsigned modem_a_1_pins[] = { DB8500_PIN_D22, DB8500_PIN_C23, ^~~~~~~~~~~~~~ drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c:430:23: warning: ‘kpskaskb_a_1_pins’ defined but not used [-Wunused-const-variable=] static const unsigned kpskaskb_a_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16 }; ^~~~~~~~~~~~~~~~~ They are just very old bugs in seldomly used pin groups. Fix the problem by using the pins and referencing the function. Reported-by: Hulk Robot Reported-by: Jason Yan Signed-off-by: Linus Walleij commit 767972b9b4edf3f8386cfe05b798b291ff438613 Author: Linus Walleij Date: Tue Apr 28 11:38:12 2020 +0200 pinctrl: ab8505: Define group for GPIO pin 50 The Hulk robot reports an usused varible: drivers/pinctrl/nomadik/pinctrl-ab8505.c:137:23: warning: ‘gpio50_a_1_pins’ defined but not used [-Wunused-const-variable=] static const unsigned gpio50_a_1_pins[] = { AB8505_PIN_L4 }; ^~~~~~~~~~~~~~~ This variable actually should be used. Probably an oversight by the driver author. Cc: Patrice Chotard Reported-by: Hulk Robot Reported-by: Jason Yan Signed-off-by: Linus Walleij commit 0320d260a7e730f1a85c49764ad8d8c41a8512ec Author: Jason Yan Date: Tue Apr 28 19:55:43 2020 +0800 pinctrl: bm1880: add pwm37 to bm1880_pctrl_groups The 'pwm37' is not added to bm1880_pctrl_groups, which triggers a gcc build warning: drivers/pinctrl/pinctrl-bm1880.c:263:27: warning: ‘pwm37_pins’ defined but not used [-Wunused-const-variable=] static const unsigned int pwm37_pins[] = { 110 }; Signed-off-by: Jason Yan Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200428115543.33379-1-yanaijie@huawei.com Signed-off-by: Linus Walleij commit d83949492427e1c9584c8db91c5d2a26747e7e73 Author: Daniel Vetter Date: Wed Apr 15 09:40:34 2020 +0200 drm/bochs: Remove explicit drm_connector_register This is leftovers from the old drm_driver->load callback upside-down issues. It doesn't do anything for not-hotplugged connectors since drm_dev_register takes care of that. Acked-by: Gerd Hoffmann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-60-daniel.vetter@ffwll.ch commit a7aed875e3fa184c96a2af8c1d86d4e2882e969c Author: Daniel Vetter Date: Wed Apr 15 09:40:33 2020 +0200 drm/ast: Drop explicit connector register/unregister This is only needed for hotpluggable connectors set up after drm_dev_register(). Reviewed-by: Thomas Zimemrmann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Thomas Zimmermann Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-59-daniel.vetter@ffwll.ch commit cd8294540776f7986b7cf658a3579d576853610c Author: Daniel Vetter Date: Wed Apr 15 09:40:30 2020 +0200 drm/aspeed: Use devm_drm_dev_alloc As usual, we can drop the drm_dev_put() and need to embed the drm_device. Since it's so few, also go right ahead and leave drm_device->dev_private set to NULL, so that we always use the container_of() upcast, which is faster anyway. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Joel Stanley Cc: Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-56-daniel.vetter@ffwll.ch commit e95d2f40124992fb60a150e297b6fe96cc4ac741 Author: Daniel Vetter Date: Wed Apr 15 09:40:29 2020 +0200 drm/aspeed: Drop aspeed_gfx->fbdev No longer used since the conversion to generic fbdev. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Joel Stanley Cc: Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-55-daniel.vetter@ffwll.ch commit 66d8ad67aab3bc6f55e7de81565cd0d4875bd851 Author: Wei Yongjun Date: Mon Apr 27 11:08:29 2020 +0000 gpio: mlxbf2: fix return value check in mlxbf2_gpio_get_lock_res() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200427110829.154785-1-weiyongjun1@huawei.com Signed-off-by: Linus Walleij commit b0548a245dd30bf448e2d4fc88edcb66d4fa668f Author: Daniel Vetter Date: Wed Apr 15 09:40:12 2020 +0200 drm/cirrus: Move to drm/tiny Because it is. Huge congrats to everyone who made this kind of refactoring happen! Acked-by: Gerd Hoffmann Reviewed-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-38-daniel.vetter@ffwll.ch commit 0c7890dc1e539c2c5357a6591c5ed1a4ed3c8d02 Author: Daniel Vetter Date: Wed Apr 15 09:40:11 2020 +0200 drm/cirrus: Don't use drm_device->dev_private Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Acked-by: Eric Anholt Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: Eric Anholt Cc: Thomas Zimmermann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-37-daniel.vetter@ffwll.ch commit 9bb2e63705a1a1cacd05b094b7fd9a1b28fa00f2 Author: Daniel Vetter Date: Wed Apr 15 09:40:10 2020 +0200 drm/cirrus: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Noralf Trønnes Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: Sam Ravnborg Cc: "Noralf Trønnes" Cc: Rob Herring Cc: Thomas Zimmermann Cc: virtualization@lists.linux-foundation.org Cc: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-36-daniel.vetter@ffwll.ch commit 843ef624a491fabc3f0829c341a33fc4cc008000 Author: Daniel Vetter Date: Wed Apr 15 09:40:07 2020 +0200 drm/komeda: use devm_drm_dev_alloc Komeda uses the component framework, which does open/close a new devres group around all the bind callbacks. Which means we can use devm_ functions for managing the drm_device cleanup, with leaking stuff in case of deferred probes or other reasons to unbind components, or the component_master. Also note that this fixes a double-free in the probe unroll code, bot drm_dev_put and kfree(kms) result in the kms allocation getting freed. Aside: komeda_bind could be cleaned up a lot, devm_kfree is a bit redundant. Plus I'm not clear on why there's suballocations for mdrv->mdev and mdrv->kms. Plus I'm not sure the lifetimes are correct with all that devm_kzalloc usage ... That structure layout is also the reason why komeda still uses drm_device->dev_private and can't easily be replaced with a proper container_of upcasting. I'm pretty sure that there's endless amounts of hotunplug/hotremove bugs in there with all the unprotected dereferencing of drm_device->dev_private. Reviewed-by: James Qian Wang Signed-off-by: Daniel Vetter Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-33-daniel.vetter@ffwll.ch commit b8d91c0a770e2c6608a3cacc82f3674d9745c90e Author: Daniel Vetter Date: Wed Apr 15 09:40:06 2020 +0200 drm/ingenic: Don't set drm_device->dev_private Entirely not used, just copypasta. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-32-daniel.vetter@ffwll.ch commit 37d8d81f019ac1bdfb2f7668f783604604782868 Author: Daniel Vetter Date: Wed Apr 15 09:40:05 2020 +0200 drm/ingenic: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-31-daniel.vetter@ffwll.ch commit fd7ee85cfe7bad518da9dd17dd6ee44199e20833 Author: Daniel Vetter Date: Wed Apr 15 09:40:04 2020 +0200 drm/mcde: Don't use drm_device->dev_private Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. v2: Move misplaced removal of double-assignment to this patch (Sam) Reviewed-by: Linus Walleij (v1) Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-30-daniel.vetter@ffwll.ch commit 6ff71edfcb0be37c803da51e1b893809ead22203 Author: Daniel Vetter Date: Wed Apr 15 09:40:03 2020 +0200 drm/mcde: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. v2: Move misplaced double-assignement to next patch (Sam) Acked-by: Sam Ravnborg Reviewed-by: Linus Walleij Signed-off-by: Daniel Vetter Cc: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-29-daniel.vetter@ffwll.ch commit ad18763f46835b768714ac6de6dcf42384a261ca Author: Brent Lu Date: Tue Apr 28 01:13:34 2020 +0800 ASoC: broadwell: add channel constraint BDW boards using this machine driver supports only stereo capture and playback. Implement a constraint to enforce it. Signed-off-by: Brent Lu Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/1588007614-25061-4-git-send-email-brent.lu@intel.com Signed-off-by: Mark Brown commit 08d6713a4056cab5b29eb135eecb2e97492fc8d8 Author: Brent Lu Date: Tue Apr 28 01:13:33 2020 +0800 ASoC: bdw-rt5650: add channel constraint BDW boards using this machine driver supports only 2 or 4-channel capture. Implement a constraint to enforce it. Signed-off-by: Brent Lu Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/1588007614-25061-3-git-send-email-brent.lu@intel.com Signed-off-by: Mark Brown commit e241f8e77958de2b7708e72d7159952d2bd1f0fe Author: Brent Lu Date: Tue Apr 28 01:13:32 2020 +0800 ASoC: bdw-rt5677: add channel constraint BDW boards using this machine driver supports only stereo capture and playback. Implement a constraint to enforce it. Signed-off-by: Brent Lu Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/1588007614-25061-2-git-send-email-brent.lu@intel.com Signed-off-by: Mark Brown commit 3927037003f97fc0e57a6804e95bb186e3d22194 Author: Daniel Vetter Date: Wed Apr 15 09:40:00 2020 +0200 drm/tidss: Delete tidss->saved_state Not used anymore since the switch to suspend/resume helpers. Tested-by: Jyri Sarha Acked-by: Sam Ravnborg Reviewed-by: Tomi Valkeinen Signed-off-by: Daniel Vetter Cc: Jyri Sarha Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-26-daniel.vetter@ffwll.ch commit 02bb1317d5e4002e65a3debfb27ae2a1bfd0a3c2 Author: Daniel Vetter Date: Wed Apr 15 09:39:59 2020 +0200 drm/tidss: Don't use drm_device->dev_private Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Tested-by: Jyri Sarha Acked-by: Sam Ravnborg Reviewed-by: Tomi Valkeinen Signed-off-by: Daniel Vetter Cc: Jyri Sarha Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-25-daniel.vetter@ffwll.ch commit b3b134007e2c795f78bb34bc92ee68608cb92b04 Author: Daniel Vetter Date: Wed Apr 15 09:39:58 2020 +0200 drm/tidss: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Tested-by: Jyri Sarha Acked-by: Sam Ravnborg Reviewed-by: Tomi Valkeinen Signed-off-by: Daniel Vetter Cc: Jyri Sarha Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-24-daniel.vetter@ffwll.ch commit 7ced4801d26746df3211d9ebf4b6b70daa7dffec Author: Daniel Vetter Date: Wed Apr 15 09:39:57 2020 +0200 drm/gm12u320: Don't use drm_device->dev_private Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Acked-by: Sam Ravnborg Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-23-daniel.vetter@ffwll.ch commit 161309788e426203e1d436abf9a5a845cc19d20c Author: Jason Yan Date: Tue Apr 28 14:31:55 2020 +0800 uio: remove unneeded variable "ret" in uio_dmem_genirq_open Fix the following coccicheck warning: drivers/uio/uio_dmem_genirq.c:47:5-8: Unneeded variable: "ret". Return "0" on line 71 Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200428063155.42349-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 56731c68f335ff0ce49e7d8f4fb45eb7805629be Author: Colin Ian King Date: Sat Apr 25 13:44:48 2020 +0100 drivers: uio: remove redundant assignment to variable retval The variable retval is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200425124448.139532-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 9213142d6b8c9065323d4c1e221751a22e4935cc Author: Daniel Vetter Date: Wed Apr 15 09:39:56 2020 +0200 drm/gm12u320: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Sam Ravnborg Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-22-daniel.vetter@ffwll.ch commit f4be140fa33f9c9ba36374a52e1c317f0ba17089 Author: Zenghui Yu Date: Wed Apr 15 18:57:46 2020 +0800 KVM: arm64: Drop PTE_S2_MEMATTR_MASK The only user of PTE_S2_MEMATTR_MASK macro had been removed since commit a501e32430d4 ("arm64: Clean up the default pgprot setting"). It has been about six years and no one has used it again. Let's drop it. Signed-off-by: Zenghui Yu Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20200415105746.314-1-yuzenghui@huawei.com Signed-off-by: Will Deacon commit 1c12857c6722579cd4aca67b21d3e80870a290b1 Author: Dejin Zheng Date: Fri Apr 24 23:41:02 2020 +0800 gpio: ftgpio010: Fix small typo Fix a spelling typo in gpio-ftgpio010.c by codespell s/desireable/desirable/ Cc: Andy Shevchenko Signed-off-by: Dejin Zheng Link: https://lore.kernel.org/r/20200424154103.10311-2-zhengdejin5@gmail.com Signed-off-by: Linus Walleij commit 724142f8c42a7b01dbf9738eb00d7addbad6f862 Author: Wu Hao Date: Mon Apr 27 09:06:23 2020 +0800 fpga: dfl: fme: add performance reporting support This patch adds support for performance reporting private feature for FPGA Management Engine (FME). Now it supports several different performance counters, including 'basic', 'cache', 'fabric', 'vtd' and 'vtd_sip'. It allows user to use standard linux tools to access these performance counters. e.g. List all events by "perf list" perf list | grep fme dfl_fme0/cache_read_hit/ [Kernel PMU event] dfl_fme0/cache_read_miss/ [Kernel PMU event] ... dfl_fme0/fab_mmio_read/ [Kernel PMU event] dfl_fme0/fab_mmio_write/ [Kernel PMU event] ... dfl_fme0/fab_port_mmio_read,portid=?/ [Kernel PMU event] dfl_fme0/fab_port_mmio_write,portid=?/ [Kernel PMU event] ... dfl_fme0/vtd_port_devtlb_1g_fill,portid=?/ [Kernel PMU event] dfl_fme0/vtd_port_devtlb_2m_fill,portid=?/ [Kernel PMU event] ... dfl_fme0/vtd_sip_iotlb_1g_hit/ [Kernel PMU event] dfl_fme0/vtd_sip_iotlb_1g_miss/ [Kernel PMU event] ... dfl_fme0/clock [Kernel PMU event] ... e.g. check increased counter value after run one application using "perf stat" command. perf stat -e dfl_fme0/fab_mmio_read/,dfl_fme0/fab_mmio_write/ ./test Performance counter stats for './test': 1 dfl_fme0/fab_mmio_read/ 2 dfl_fme0/fab_mmio_write/ 1.009496520 seconds time elapsed Please note that fabric counters support both fab_* and fab_port_*, but actually they are sharing one set of performance counters in hardware. If user wants to monitor overall data events on fab_* then fab_port_* can't be supported at the same time, see example below: perf stat -e dfl_fme0/fab_mmio_read/,dfl_fme0/fab_port_mmio_write,portid=0/ Performance counter stats for 'system wide': 0 dfl_fme0/fab_mmio_read/ dfl_fme0/fab_port_mmio_write,portid=0/ 2.141064085 seconds time elapsed Signed-off-by: Luwei Kang Signed-off-by: Xu Yilun Signed-off-by: Wu Hao Link: https://lore.kernel.org/r/1587949583-12058-3-git-send-email-hao.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit 1f03ac9460cf0c4886fc8a72fb3d0cd479b59bca Author: Xu Yilun Date: Mon Apr 27 09:06:22 2020 +0800 Documentation: fpga: dfl: add description for performance reporting support This patch adds description for performance reporting support for Device Feature List (DFL) based FPGA. Signed-off-by: Xu Yilun Signed-off-by: Wu Hao Link: https://lore.kernel.org/r/1587949583-12058-2-git-send-email-hao.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit a5e93436e18c8f05a4e777ab125e140335d0ade8 Author: Geert Uytterhoeven Date: Fri Apr 24 16:15:17 2020 +0200 gpiolib: Rename "chip" variables to "gc" in core header file Consistently use "gc" for "struct gpio *" variables. This follows the spirit of commit a0b66a73785ccc8f ("gpio: Rename variable in core APIs"). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200424141517.11582-1-geert+renesas@glider.be Signed-off-by: Linus Walleij commit f3eb15bb796dcd7dd5171736a475ee6248d96918 Author: Daniel Vetter Date: Wed Apr 15 09:39:55 2020 +0200 drm/hx8357d: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Eric Anholt Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-21-daniel.vetter@ffwll.ch commit 4c99859f3bf9e40e7859878b697adb8581cb6ac0 Author: Daniel Vetter Date: Wed Apr 15 09:39:54 2020 +0200 drm/ili9225: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: David Lechner Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-20-daniel.vetter@ffwll.ch commit 262b90116619ecab0734a3d931851e1fa1e89a7d Author: Geert Uytterhoeven Date: Fri Apr 24 16:14:32 2020 +0200 gpiolib: Improve kernel messages Simplify the printing of kernel messages and make the messages more accurate by using the most appropriate {dev,chip,gpiod}_*() helpers. Sample impact: -gpiochip_setup_dev: registered GPIOs 496 to 511 on device: gpiochip0 (e6050000.gpio) +gpio gpiochip0: registered GPIOs 496 to 511 on e6050000.gpio -no flags found for gpios +gpio-953 (?): no flags found for gpios -GPIO line 355 (PCIE/SATA switch) hogged as output/low +gpio-355 (PCIE/SATA switch): hogged as output/low Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200424141432.11400-1-geert+renesas@glider.be Signed-off-by: Linus Walleij commit 5301e305c682a879666371cdcddf37bbce2ef77e Author: Daniel Vetter Date: Wed Apr 15 09:39:53 2020 +0200 drm/ili9341: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: David Lechner Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Eric Anholt Cc: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-19-daniel.vetter@ffwll.ch commit 3d49ea22946b9bee9c9344c2adc9857f2a3dc831 Author: Daniel Vetter Date: Wed Apr 15 09:39:52 2020 +0200 drm/ili9486: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Noralf Trønnes Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Kamlesh Gurudasani Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-18-daniel.vetter@ffwll.ch commit 9d2d75ede59bc1edd8561f2ee9d4702a5ea0ae30 Author: Gavin Shan Date: Tue Apr 28 09:57:00 2020 +1000 arm64/kernel: Fix range on invalidating dcache for boot page tables Prior to commit 8eb7e28d4c642c31 ("arm64/mm: move runtime pgds to rodata"), idmap_pgd_dir, tramp_pg_dir, reserved_ttbr0, swapper_pg_dir, and init_pg_dir were contiguous at the end of the kernel image. The maintenance at the end of __create_page_tables assumed these were contiguous, and affected everything from the start of idmap_pg_dir to the end of init_pg_dir. That commit moved all but init_pg_dir into the .rodata section, with other data placed between idmap_pg_dir and init_pg_dir, but did not update the maintenance. Hence the maintenance is performed on much more data than necessary (but as the bootloader previously made this clean to the PoC there is no functional problem). As we only alter idmap_pg_dir, and init_pg_dir, we only need to perform maintenance for these. As the other dirs are in .rodata, the bootloader will have initialised them as expected and cleaned them to the PoC. The kernel will initialize them as necessary after enabling the MMU. This patch reworks the maintenance to only cover the idmap_pg_dir and init_pg_dir to avoid this unnecessary work. Signed-off-by: Gavin Shan Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20200427235700.112220-1-gshan@redhat.com Signed-off-by: Will Deacon commit 35d8ef4ba24d2f8e4e69e8b6cf482658d128b2fb Author: Daniel Vetter Date: Wed Apr 15 09:39:51 2020 +0200 drm/mi0283qt: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Noralf Trønnes Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-17-daniel.vetter@ffwll.ch commit 98904f3d2d92f4a3c3101dcaaa09eb5377f38ce8 Author: Daniel Vetter Date: Wed Apr 15 09:39:50 2020 +0200 drm/repaper: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Noralf Trønnes Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-16-daniel.vetter@ffwll.ch commit a2cc220a9a9227b2c5c9b39f57340bce64f040fd Author: Rajan Vaja Date: Fri Apr 24 13:58:07 2020 -0700 firmware: xilinx: Add sysfs and API to set boot health status Add sysfs interface to set boot health status from user space. Add API used by this interface to communicate with firmware. If PMUFW is compiled with CHECK_HEALTHY_BOOT, it will check the healthy bit on FPD WDT expiration. If healthy bit is set by a user application running in Linux, PMUFW will do APU only restart. If healthy bit is not set during FPD WDT expiration, PMUFW will do system restart. Signed-off-by: Rajan Vaja Signed-off-by: Michal Simek Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-26-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit b3ae24c44848c6403fb2333d7cbe494565058352 Author: Rajan Vaja Date: Fri Apr 24 13:58:06 2020 -0700 firmware: xilinx: Add sysfs to set shutdown scope The Linux shutdown functionality implemented via PSCI system_off does not include an option to set a scope, i.e. which parts of the system to shut down. This patch creates sysfs that allows to set the shutdown scope for the next shutdown request. When the next shutdown is performed, the platform specific portion of PSCI-system_off can use the chosen shutdown scope. Signed-off-by: Rajan Vaja Signed-off-by: Stefan Krsmanovic Signed-off-by: Michal Simek Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-25-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit fdd2ed88ca971376669bce145f1a1bcf028d775e Author: Rajan Vaja Date: Fri Apr 24 13:58:05 2020 -0700 firmware: xilinx: Add system shutdown API interface Add system shutdown API interface which asks firmware to perform system shutdown/restart. Signed-off-by: Rajan Vaja Signed-off-by: Michal Simek Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-24-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit ae5c961da6483b413dcb36d8bf6a881ffd2fb33f Author: Rajan Vaja Date: Fri Apr 24 13:58:04 2020 -0700 firmware: xilinx: Add sysfs interface Add firmware-ggs sysfs interface which provides read/write interface to global storage registers. Signed-off-by: Rajan Vaja Signed-off-by: Michal Simek Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-23-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 4f680b72ea07a3e161ce1167a97ee09b1369f7de Author: Rajan Vaja Date: Fri Apr 24 13:58:03 2020 -0700 firmware: xilinx: Add APIs to read/write GGS/PGGS registers Add APIs to read/write PGGS and GGS registers. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-22-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 4db8180ffe7c07bc4a602c82d6d9c1c04751583d Author: Rajan Vaja Date: Fri Apr 24 13:58:02 2020 -0700 firmware: xilinx: Remove eemi ops for fpga related APIs Use direct function call instead of using eemi ops for fpga related APIs. Also remove eemi ops structure. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-21-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit bc86f9c546160afce631fae223c3772d9375ee25 Author: Rajan Vaja Date: Fri Apr 24 13:58:01 2020 -0700 firmware: xilinx: Remove eemi ops for aes engine Use direct function call for aes engine instead of using eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-20-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit cbbbda71fe37fe70e610d5ec3977fc6a096280ed Author: Rajan Vaja Date: Fri Apr 24 13:58:00 2020 -0700 firmware: xilinx: Remove eemi ops for set_requirement Use direct function call instead of using eemi ops for set_requirement. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-19-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 07fb1a4619fcb35f79d0adc13c8678f7726337ef Author: Rajan Vaja Date: Fri Apr 24 13:57:59 2020 -0700 firmware: xilinx: Remove eemi ops for release_node Use direct function call instead of using eemi ops for release_node. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-18-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit bf8b27ed2324b5108439593dcfb9ab264a745ee7 Author: Rajan Vaja Date: Fri Apr 24 13:57:58 2020 -0700 firmware: xilinx: Remove eemi ops for request_node Use direct function call instead of using eemi ops for request_node. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-17-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 951d0a97e41caff96c180ca416093276bfd9a4fd Author: Rajan Vaja Date: Fri Apr 24 13:57:57 2020 -0700 firmware: xilinx: Remove eemi ops for set_suspend_mode Use direct function call instead of eemi ops for set_suspend_mode. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-16-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 9474da950d1e39f71cbfeaba87367fa146635a88 Author: Rajan Vaja Date: Fri Apr 24 13:57:56 2020 -0700 firmware: xilinx: Remove eemi ops for init_finalize Use direct function call instead of eemi ops for init_finalize. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-15-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 1b413581fe26404217a2160d444642440bb0e9e7 Author: Rajan Vaja Date: Fri Apr 24 13:57:55 2020 -0700 firmware: xilinx: Remove eemi ops for reset_get_status Use direct function call instead of using eemi ops for reset_get_status. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-14-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit cf23ec3531462376ef48237235daea577e1194e7 Author: Rajan Vaja Date: Fri Apr 24 13:57:54 2020 -0700 firmware: xilinx: Remove eemi ops for reset_assert Use direct function call instead of using eemi ops for reset_assert. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-13-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 426c8d85df7a7b8337e09eab2806e802311778fd Author: Rajan Vaja Date: Fri Apr 24 13:57:53 2020 -0700 firmware: xilinx: Use APIs instead of IOCTLs Remove IOCTL API and use individual APIs for better readability. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-12-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 70c0d36462ca5be8fc05176d11bec832dbb355b2 Author: Rajan Vaja Date: Fri Apr 24 13:57:52 2020 -0700 firmware: xilinx: Remove eemi ops for clock set/get parent Use direct function call instead of eemi ops for clock set/get parent. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-11-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 7a1e10621a215dad4727aaa82396c4c19ce6593f Author: Rajan Vaja Date: Fri Apr 24 13:57:51 2020 -0700 firmware: xilinx: Remove eemi ops for clock set/get rate Use direct function call instead of eemi ops for clock set/get rate. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-10-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 0667a8d144bc830d0a752f079c9789735cd4f1f8 Author: Rajan Vaja Date: Fri Apr 24 13:57:50 2020 -0700 firmware: xilinx: Remove eemi ops for clock_getdivider Use direct function call instead of using eemi ops for clock_getdivider. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-9-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit fc9fb8fb985c092f9cf01c7c50269c132efc4d58 Author: Rajan Vaja Date: Fri Apr 24 13:57:49 2020 -0700 firmware: xilinx: Remove eemi ops for clock_setdivider Use direct function call instead of using eemi ops for clock_setdivider. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-8-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 5e76731dd370ca3217fceaa3e2e84e992e6b7b7f Author: Rajan Vaja Date: Fri Apr 24 13:57:48 2020 -0700 firmware: xilinx: Remove eemi ops for clock_getstate Use direct function call instead of eemi ops for clock_getstate. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-7-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit f5ccd54b67b3f029de9d3818efa70f210d189019 Author: Rajan Vaja Date: Fri Apr 24 13:57:47 2020 -0700 firmware: xilinx: Remove eemi ops for clock_disable Use direct function call for clock_disable instead using of eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-6-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 3637e84cd2e910f84835fac9650316dce53218ef Author: Rajan Vaja Date: Fri Apr 24 13:57:46 2020 -0700 firmware: xilinx: Remove eemi ops for clock_enable Use direct function call for clock_enable instead of eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-5-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 6366c1bac3149c63752c03ea1c731d461d5349a7 Author: Rajan Vaja Date: Fri Apr 24 13:57:45 2020 -0700 firmware: xilinx: Remove eemi ops for query_data Use direct function call for query_data instead of using eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-4-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 21cd93bab92b2818c9391465123cd4be6431c69e Author: Rajan Vaja Date: Fri Apr 24 13:57:44 2020 -0700 firmware: xilinx: Remove eemi ops for get_chipid Use direct function call instead of eemi ops for get_chipid. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-3-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit e20b873802b6a8c8c65cd85ecf79a3615f3a0a5c Author: Daniel Vetter Date: Wed Apr 15 09:39:49 2020 +0200 drm/st7586: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: David Lechner Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-15-daniel.vetter@ffwll.ch commit 14877bc715973d145d977e6054d5d2b6468ff460 Author: Daniel Vetter Date: Wed Apr 15 09:39:48 2020 +0200 drm/st7735r: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Aside: There was an oddity in the old code, we allocated priv but in the error path we've freed priv->dbidev ... Acked-by: David Lechner Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-14-daniel.vetter@ffwll.ch commit cfa7ede20f133cc81cef01dc3a516dda3a9721ee Author: Ard Biesheuvel Date: Wed Apr 15 10:29:22 2020 +0200 arm64: set TEXT_OFFSET to 0x0 in preparation for removing it entirely TEXT_OFFSET on arm64 is a historical artifact from the early days of the arm64 port where the boot protocol was basically 'copy this image to the base of memory + 512k', giving us 512 KB of guaranteed BSS space to put the swapper page tables. When the arm64 Image header was added in v3.10, it already carried the actual value of TEXT_OFFSET, to allow the bootloader to discover it dynamically rather than hardcode it to 512 KB. Today, this memory window is not used for any particular purpose, and it is simply handed to the page allocator at boot. The only reason it still exists is because of the 512k misalignment it causes with respect to the 2 MB aligned virtual base address of the kernel, which affects the virtual addresses of all statically allocated objects in the kernel image. However, with the introduction of KASLR in v4.6, we added the concept of relocatable kernels, which rewrite all absolute symbol references at boot anyway, and so the placement of such kernels in the physical address space is irrelevant, provided that the minimum segment alignment is honoured (64 KB in most cases, 128 KB for 64k pages kernels with vmap'ed stacks enabled). This makes 0x0 and 512 KB equally suitable values for TEXT_OFFSET on the off chance that we are dealing with boot loaders that ignore the value passed via the header entirely. Considering that the distros as well as Android ship KASLR-capable kernels today, and the fact that TEXT_OFFSET was discoverable from the Image header from the very beginning, let's change this value to 0x0, in preparation for removing it entirely at a later date. Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200415082922.32709-1-ardb@kernel.org Signed-off-by: Will Deacon commit b9b3a8be28b31a3dbcb0ced07aa0d869f45cdb69 Author: Rajan Vaja Date: Fri Apr 24 13:57:43 2020 -0700 firmware: xilinx: Remove eemi ops for get_api_version Use direct function calls instead of using eemi ops. So remove eemi ops for get_api_version and use direct function call. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Link: https://lore.kernel.org/r/1587761887-4279-2-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 7536ad8dbfcfd56cd04d005b76cd9ecf2036e220 Author: Richard Gong Date: Tue Apr 14 15:47:54 2020 -0500 firmware: fpga: replace the error codes with the standard ones The Intel service layer driver has defined error codes for the specific services, which started from FPGA configuration then RSU (Remote Status Update). Intel service layer driver should define the standard error codes rather than keep adding more error codes for the new services. The standard error codes will be used by all the clients of Intel service layer driver. Replace FPGA and RSU specific error codes with Intel service layer’s Common error codes. Signed-off-by: Richard Gong Link: https://lore.kernel.org/r/1586897274-307-2-git-send-email-richard.gong@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 30218da5974ceb29c913e53296577526cb742a7e Author: Mark Brown Date: Tue Apr 14 19:28:43 2020 +0100 arm64: lib: Consistently enable crc32 extension Currently most of the assembly files that use architecture extensions enable them using the .arch directive but crc32.S uses .cpu instead. Move that over to .arch for consistency. Signed-off-by: Mark Brown Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200414182843.31664-1-broonie@kernel.org Signed-off-by: Will Deacon commit 96a4faf524fcfbb6c1f2ce91238e81062895ec09 Author: Chris Wilson Date: Tue Apr 28 12:43:07 2020 +0100 drm/i915/selftests: Tweak the tolerance for clock ticks to 12.5% Give a small bump for our tolerance on comparing the expected vs measured clock ticks/time from 10% to 12.5% to accommodate a bad result on Sandybridge that was off by 10.3%. Hopefully, that is the worst we will see. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1802 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200428114307.5153-1-chris@chris-wilson.co.uk commit e24e03aa00f0248a716ec7859c03f0034bb42fb2 Author: Will Deacon Date: Thu Apr 23 10:36:58 2020 +0100 arm64: docs: Mandate that the I-cache doesn't hold stale kernel text Although we require that the loaded kernel Image has been cleaned to the PoC, we neglect to spell out the state of the I-cache. Although this should be reasonably obvious, it doesn't hurt to be explicit. Require that the I-cache doesn't hold any stale entries for the kernel Image at boot. Acked-by: Mark Rutland Acked-by: Catalin Marinas Cc: Mark Rutland Cc: Catalin Marinas Link: https://lore.kernel.org/r/20200423093658.10602-1-will@kernel.org Signed-off-by: Will Deacon commit a2a69963524dc4aebba047732dce5d256a70bb3d Author: Will Deacon Date: Tue Apr 21 15:29:22 2020 +0100 arm64: cpufeature: Add an overview comment for the cpufeature framework Now that Suzuki isn't within throwing distance, I thought I'd better add a rough overview comment to cpufeature.c so that it doesn't take me days to remember how it works next time. Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-9-will@kernel.org Signed-off-by: Will Deacon commit 98448cdfe7060dd5491bfbd3f7214ffe1395d58e Author: Will Deacon Date: Tue Apr 21 15:29:21 2020 +0100 arm64: cpufeature: Relax checks for AArch32 support at EL[0-2] We don't need to be quite as strict about mismatched AArch32 support, which is good because the friendly hardware folks have been busy mismatching this to their hearts' content. * We don't care about EL2 or EL3 (there are silly comments concerning the latter, so remove those) * EL1 support is gated by the ARM64_HAS_32BIT_EL1 capability and handled gracefully when a mismatch occurs * EL0 support is gated by the ARM64_HAS_32BIT_EL0 capability and handled gracefully when a mismatch occurs Relax the AArch32 checks to FTR_NONSTRICT. Tested-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-8-will@kernel.org Signed-off-by: Will Deacon commit eab2f92607461fc7fa9dba599772a4b214fd9d1a Author: Will Deacon Date: Tue Apr 21 15:29:20 2020 +0100 arm64: cpufeature: Relax AArch32 system checks if EL1 is 64-bit only If AArch32 is not supported at EL1, the AArch32 feature register fields no longer advertise support for some system features: * ISAR4.SMC * PFR1.{Virt_frac, Sec_frac, Virtualization, Security, ProgMod} In which case, we don't need to emit "SANITY CHECK" failures for all of them. Add logic to relax the strictness of individual feature register fields at runtime and use this for the fields above if 32-bit EL1 is not supported. Tested-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-7-will@kernel.org Signed-off-by: Will Deacon commit 1efcfe79d97dff9d436748a13a329f64cda6e67e Author: Will Deacon Date: Tue Apr 21 15:29:19 2020 +0100 arm64: cpufeature: Factor out checking of AArch32 features update_cpu_features() is pretty large, so split out the checking of the AArch32 features into a separate function and call it after checking the AArch64 features. Tested-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-6-will@kernel.org Signed-off-by: Will Deacon commit 13dc4d836179444f0ca90188cfccd23f9cd9ff05 Author: Will Deacon Date: Tue Apr 21 15:29:18 2020 +0100 arm64: cpufeature: Remove redundant call to id_aa64pfr0_32bit_el0() There's no need to call id_aa64pfr0_32bit_el0() twice because the sanitised value of ID_AA64PFR0_EL1 has already been updated for the CPU being onlined. Remove the redundant function call. Tested-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-5-will@kernel.org Signed-off-by: Will Deacon commit 540f76d12c662d3da2ebdf0086ee289123fcd120 Author: Will Deacon Date: Tue Apr 21 15:29:17 2020 +0100 arm64: cpufeature: Add CPU capability for AArch32 EL1 support Although we emit a "SANITY CHECK" warning and taint the kernel if we detect a CPU mismatch for AArch32 support at EL1, we still online the CPU with disastrous consequences for any running 32-bit VMs. Introduce a capability for AArch32 support at EL1 so that late onlining of incompatible CPUs is forbidden. Tested-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20200421142922.18950-4-will@kernel.org Signed-off-by: Will Deacon commit 0113340e6e83f8710b216f72b826499fc0151c29 Author: Will Deacon Date: Tue Apr 21 15:29:16 2020 +0100 arm64: cpufeature: Spell out register fields for ID_ISAR4 and ID_PFR1 In preparation for runtime updates to the strictness of some AArch32 features, spell out the register fields for ID_ISAR4 and ID_PFR1 to make things clearer to read. Note that this isn't functionally necessary, as the feature arrays themselves are not modified dynamically and remain 'const'. Tested-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-3-will@kernel.org Signed-off-by: Will Deacon commit 9d3f888135505dda7d5539a5756440d298f08173 Author: Sai Prakash Ranjan Date: Tue Apr 21 15:29:15 2020 +0100 arm64: cpufeature: Relax check for IESB support We don't care if IESB is supported or not as we always set SCTLR_ELx.IESB and, if it works, that's really great. Relax the ID_AA64MMFR2.IESB cpufeature check so that we don't warn and taint if it's mismatched. [will: rewrote commit message] Signed-off-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200421142922.18950-2-will@kernel.org Signed-off-by: Will Deacon commit 6ae355a260d25d2bd465f89d1668300aaa9fec4c Author: Daniel Vetter Date: Wed Apr 15 09:39:47 2020 +0200 drm/udl: don't set drm_device->dev_private We're mostly there already, just a handful of places that didn't use the to_udl container_of cast. To make sure no new appear, don't set ->dev_private. Reviewed-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Sean Paul Cc: Emil Velikov Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Alexios Zavras Cc: Laurent Pinchart Cc: Thomas Gleixner Cc: "José Roberto de Souza" Cc: Sam Ravnborg Cc: Gerd Hoffmann Cc: Allison Randal Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-13-daniel.vetter@ffwll.ch commit 50b9bbecaa5bdb78aaa51a39a01242016ed96314 Author: Daniel Vetter Date: Wed Apr 15 09:39:46 2020 +0200 drm/udl: Use devm_drm_dev_alloc With Thomas' patch to clean up fbdev init this is a rather standard conversion to the new wrapper macro. v2: Rebase on top of Thomas' patches to remove the return value from drm_fbdev_generic_setup() v3: Update commit message to reflect the reality of the rebased patch (Sam) Reviewed-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Noralf Trønnes Cc: Dave Airlie Cc: Sean Paul Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Emil Velikov Cc: Sam Ravnborg Cc: Thomas Gleixner Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-12-daniel.vetter@ffwll.ch commit 0df3ac7657c92756a26c164133380edbce672f7a Author: Daniel Vetter Date: Wed Apr 15 09:39:45 2020 +0200 drm/v3d: Delete v3d_dev->pdev We already have it in v3d_dev->drm.dev with zero additional pointer chasing. Personally I don't like duplicated pointers like this because: - reviewers need to check whether the pointer is for the same or different objects if there's multiple - compilers have an easier time too To avoid having to pull in some big headers I implemented the casting function as a macro instead of a static inline. Typechecking thanks to container_of still assured. But also a bit a bikeshed, so feel free to ignore. v2: More parens for v3d_to_pdev macro (checkpatch) Acked-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-11-daniel.vetter@ffwll.ch commit bc662528e29ae751e0d43c18c9e4cd71a20ef0d4 Author: Daniel Vetter Date: Wed Apr 15 09:39:44 2020 +0200 drm/v3d: Delete v3d_dev->dev We already have it in v3d_dev->drm.dev with zero additional pointer chasing. Personally I don't like duplicated pointers like this because: - reviewers need to check whether the pointer is for the same or different objects if there's multiple - compilers have an easier time too But also a bit a bikeshed, so feel free to ignore. Acked-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-10-daniel.vetter@ffwll.ch commit 235b7e7d7eee3797a354ef5e923d58a477d1cb82 Author: Daniel Vetter Date: Wed Apr 15 09:39:43 2020 +0200 drm/v3d: Use devm_drm_dev_alloc Also allows us to simplify the unroll code since the drm_dev_put disappears. Acked-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-9-daniel.vetter@ffwll.ch commit af25c16bd1c6e7e73d67271c0fe6e0d5078759f1 Author: Daniel Vetter Date: Wed Apr 15 09:39:42 2020 +0200 drm/v3d: Don't set drm_device->dev_private And switch the helper over to container_of, which is a bunch faster than chasing a pointer. Plus allows gcc to see through this maze. Acked-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-8-daniel.vetter@ffwll.ch commit 4262ddc2ad631ef92058df23b1de1457543514df Author: Pierre-Louis Bossart Date: Mon Apr 27 09:52:08 2020 -0700 ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used SND_SOC_DMIC depends on GPIOLIB, so let's add the dependency before selecting SND_SOC_DMIC. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200427165211.23463-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 68ecabd0e680a4ceaf950ae189a55d4730d10c64 Author: Gavin Shan Date: Tue Apr 28 09:46:55 2020 +1000 arm64/mm: Use phys_to_page() to access pgtable memory The macros {pgd, pud, pmd}_page() retrieves the page struct of the corresponding page frame, which is reserved as page table. There is already a macro (phys_to_page), defined in memory.h as below, to convert the physical address to the page struct. Also, the header file (memory.h) has been included by pgtable.h. #define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys))) So it's reasonable to use the macro in pgtable.h. Signed-off-by: Gavin Shan Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20200427234655.111847-1-gshan@redhat.com Signed-off-by: Will Deacon commit 2eaf63ba84dc2fa4cecd717e917ea882be08069b Author: Zou Wei Date: Thu Apr 23 14:33:26 2020 +0800 arm64: smp: Make cpus_stuck_in_kernel static Fix the following sparse warning: arch/arm64/kernel/smp.c:68:5: warning: symbol 'cpus_stuck_in_kernel' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Link: https://lore.kernel.org/r/1587623606-96698-1-git-send-email-zou_wei@huawei.com Signed-off-by: Will Deacon commit 0dd2334fd5b99e610ceccba0e5263e6969207880 Author: Jason Yan Date: Sat Apr 18 16:19:09 2020 +0800 arm64: entry: remove unneeded semicolon in el1_sync_handler() Fix the following coccicheck warning: arch/arm64/kernel/entry-common.c:97:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Jason Yan Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200418081909.41471-1-yanaijie@huawei.com Signed-off-by: Will Deacon commit 4cc9b565454bb2cf5d27d58485816570f18f5a5a Author: Daniel Vetter Date: Wed Apr 15 09:39:41 2020 +0200 drm/vboxvideo: Use devm_gen_pool_create Aside from deleting all the cleanup code we're now also setting a name for the pool Acked-by: Sam Ravnborg Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-7-daniel.vetter@ffwll.ch commit 8558de401b5fbbfb1df96d6986bba3c79cd47401 Author: Daniel Vetter Date: Wed Apr 15 09:39:40 2020 +0200 drm/vboxvideo: use managed pci functions Allows us to drop the cleanup code on the floor. Sam noticed in his review: > With this change we avoid calling pci_disable_device() > twise in case vbox_mm_init() fails. > Once in vbox_hw_fini() and once in the error path. v2: Include Sam's review remarks v3: Fix typo in commit summary (Thomas Zimmermann) Acked-by: Sam Ravnborg Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-6-daniel.vetter@ffwll.ch commit dd9a68935f93e95a9f9f231e4b2853b897162c85 Author: Daniel Vetter Date: Wed Apr 15 09:39:39 2020 +0200 drm/vboxvideo: Stop using drm_device->dev_private We use the baseclass pattern here, so lets to the proper (and more typesafe) upcasting. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-5-daniel.vetter@ffwll.ch commit 35b24eed48ed42b2d3802647f2b54f7befe63396 Author: Daniel Vetter Date: Wed Apr 15 09:39:38 2020 +0200 drm/vboxvideo: Use devm_drm_dev_alloc Straightforward conversion. Reviewed-by: Hans de Goede Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-4-daniel.vetter@ffwll.ch commit 1eae811da6f44a7a614ce5d33537e279ca7984fc Author: Ard Biesheuvel Date: Thu Apr 16 15:27:30 2020 +0200 arm64/kernel: vmlinux.lds: drop redundant discard/keep macros ARM_EXIT_KEEP and ARM_EXIT_DISCARD are always defined in the same way, so we don't really need them in the first place. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200416132730.25290-1-ardb@kernel.org Signed-off-by: Will Deacon commit 2de955d072e4ceb1ac11cd735a485f2bdf523c89 Author: Daniel Vetter Date: Wed Apr 15 09:39:37 2020 +0200 drm/vboxvideo: drop DRM_MTRR_WC #define Doesn't apply to upstream kernels since a rather long time. Reviewed-by: Hans de Goede Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-3-daniel.vetter@ffwll.ch commit 4cf234943dcfa16e33daa3429fabc71d166dfb14 Author: Ard Biesheuvel Date: Wed Apr 15 14:30:49 2020 +0200 arm64: drop GZFLAGS definition and export Drop the definition and export of GZFLAGS, which was never referenced on arm64, and whose last recorded use in the ARM port (on which arm64 was based original) was removed by patch commit 5e89d379edb5ae08b57f39dd8d91697275245cbf [*] Author: Russell King Date: Wed Oct 16 14:32:17 2002 +0100 [ARM] Convert ARM makefiles to new kbuild (Sam Ravnborg, Kai, rmk) [*] git commit ID based on Thomas Gleixner's historical GIT repository at git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200415123049.25504-1-ardb@kernel.org Signed-off-by: Will Deacon commit b0b5849e0cc0195604c0945c9adb7c2570621a51 Author: Daniel Vetter Date: Wed Apr 15 09:39:36 2020 +0200 drm: Add devm_drm_dev_alloc macro Add a new macro helper to combine the usual init sequence in drivers, consisting of a kzalloc + devm_drm_dev_init + drmm_add_final_kfree triplet. This allows us to remove the rather unsightly drmm_add_final_kfree from all currently merged drivers. The kerneldoc is only added for this new function. Existing kerneldoc and examples will be udated at the very end, since once all drivers are converted over to devm_drm_dev_alloc we can unexport a lot of interim functions and make the documentation for driver authors a lot cleaner and less confusing. There will be only one true way to initialize a drm_device at the end of this, which is going to be devm_drm_dev_alloc. v2: - Actually explain what this is for in the commit message (Sam) - Fix checkpatch issues (Sam) Acked-by: Noralf Trønnes Cc: Noralf Trønnes Reviewed-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Paul Kocialkowski Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-2-daniel.vetter@ffwll.ch commit 2a4542e55f1b592aa743fb319d4b2fd85f7e136e Author: Srinivas Kandagatla Date: Fri Apr 17 13:13:06 2020 +0100 nvmem: core: cleanup old eeprom compat entry attributes file permission are derived based on various configs for default nvmem sysfs file, reuse it to create the eeprom compat file too. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200417121306.23121-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3871fdfd19019e7d7bb99f9913f9298b9ceced72 Author: Srinivas Kandagatla Date: Fri Apr 17 10:39:14 2020 +0100 slimbus: ngd: remove redundant assignment remove redundant assignment, as this is already done fewlines lines before. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200417093914.22052-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit b58c663059b484f7ff547d076a34cf6d7a302e56 Author: Srinivas Kandagatla Date: Fri Apr 17 10:36:18 2020 +0100 slimbus: ngd: get drvdata from correct device Get drvdata directly from parent instead of ngd dev, as ngd dev can probe defer and previously set drvdata will become null. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200417093618.7929-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 99ee28d99607d15c6b88c4a9b9fb4a9f0ebf598c Author: George Spelvin Date: Mon Mar 30 17:38:01 2020 +0000 arm64: kexec_file: Avoid temp buffer for RNG seed After using get_random_bytes(), you want to wipe the buffer afterward so the seed remains secret. In this case, we can eliminate the temporary buffer entirely. fdt_setprop_placeholder() returns a pointer to the property value buffer, allowing us to put the random data directly in there without using a temporary buffer at all. Faster and less stack all in one. Signed-off-by: George Spelvin Acked-by: Will Deacon Cc: Hsin-Yi Wang Cc: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20200330173801.GA9199@SDF.ORG Signed-off-by: Will Deacon commit 348a625deef13d7f8537b9704d29d05cafdd8e72 Author: Ard Biesheuvel Date: Thu Mar 26 18:14:23 2020 +0100 arm64: rename stext to primary_entry For historical reasons, the primary entry routine living somewhere in the inittext section is called stext(), which is confusing, given that there is also a section marker called _stext which lives at a fixed offset in the image (either 64 or 4096 bytes, depending on whether CONFIG_EFI is enabled) Let's rename stext to primary_entry(), which is a better description and reflects the secondary_entry() routine that already exists for SMP boot. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200326171423.3080-1-ardb@kernel.org Reviwed-by: Mark Brown Signed-off-by: Will Deacon commit 1475b6293af2e240294c09182872b18e47495f37 Author: Andy Shevchenko Date: Wed Apr 22 14:06:54 2020 +0300 gpio: dwapb: Amend indentation in some cases In some cases indentation makes code harder to read. Amend indentation in those cases despite of lines go a bit over 80 character limit. Signed-off-by: Andy Shevchenko Acked-by: Serge Semin Cc: Serge Semin Link: https://lore.kernel.org/r/20200422110654.23442-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 1afbc80c3d2b7831ec2027938876ebffbfd20abb Author: Andy Shevchenko Date: Wed Apr 22 14:06:53 2020 +0300 gpio: dwapb: Get rid of unnecessary conjunction over 32-bit value When we mask interrupts before sleep, there is no need to have a conjunction with 0xffffffff since the accepted by dwapb_write() value is 32-bit. Signed-off-by: Andy Shevchenko Acked-by: Serge Semin Cc: Serge Semin Link: https://lore.kernel.org/r/20200422110654.23442-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 36126f5309b5054c2a57f7c603a6f8da1f4800d4 Author: Amelie Delaunay Date: Wed Apr 22 09:25:13 2020 +0200 pinctrl: stmfx: stmfx_pinconf_set doesn't require to get direction anymore Pin direction is not used to set pin configuration. Fixes: a502b343ebd0 ("pinctrl: stmfx: update pinconf settings") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20200422072513.8352-1-amelie.delaunay@st.com Signed-off-by: Linus Walleij commit 0c6b20a1d720ad1d43a2aca0ffa1af07c201b55d Author: Manivannan Sadhasivam Date: Mon Apr 27 13:28:27 2020 +0530 bus: mhi: core: Add support for MHI suspend and resume Add support for MHI suspend and resume states. While at it, the mhi_notify() function needs to be exported as well. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20200427075829.9304-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit e2bd1dcbe1aa34ff5570b3427c530e4332ecf0fe Author: Raghavendra Rao Ananta Date: Mon Apr 27 20:26:01 2020 -0700 tty: hvc: Fix data abort due to race in hvc_open Potentially, hvc_open() can be called in parallel when two tasks calls open() on /dev/hvcX. In such a scenario, if the hp->ops->notifier_add() callback in the function fails, where it sets the tty->driver_data to NULL, the parallel hvc_open() can see this NULL and cause a memory abort. Hence, serialize hvc_open and check if tty->private_data is NULL before proceeding ahead. The issue can be easily reproduced by launching two tasks simultaneously that does nothing but open() and close() on /dev/hvcX. For example: $ ./simple_open_close /dev/hvc0 & ./simple_open_close /dev/hvc0 & Signed-off-by: Raghavendra Rao Ananta Link: https://lore.kernel.org/r/20200428032601.22127-1-rananta@codeaurora.org Signed-off-by: Greg Kroah-Hartman commit ff62255a2a5c1228a28f2bb063646f948115a309 Author: Wei Yongjun Date: Mon Apr 27 12:24:15 2020 +0000 sparc64: vcc: Fix error return code in vcc_probe() Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200427122415.47416-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman commit be8499c48f115b912f5747c420f66a5e2c31defe Author: Dan Murphy Date: Mon Apr 27 15:36:08 2020 -0500 ASoC: tlv320adcx140: Fix mic gain registers Fix the mic gain registers for channels 2-4. The incorret register was being set as it was touching the CH1 config registers. Fixes: 37bde5acf040 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family") Signed-off-by: Dan Murphy Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200427203608.7031-1-dmurphy@ti.com Signed-off-by: Mark Brown commit a697ae6ea56e23397341b027098c1b11d9ab13da Author: Xiyu Yang Date: Sat Apr 25 20:48:35 2020 +0800 ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type davinci_mcasp_get_dma_type() invokes dma_request_chan(), which returns a reference of the specified dma_chan object to "chan" with increased refcnt. When davinci_mcasp_get_dma_type() returns, local variable "chan" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of davinci_mcasp_get_dma_type(). When chan device is NULL, the function forgets to decrease the refcnt increased by dma_request_chan(), causing a refcnt leak. Fix this issue by calling dma_release_channel() when chan device is NULL. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/1587818916-38730-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Mark Brown commit d97a9d7aea04574959178557fa4c34efed64655a Author: Samuel Thibault Date: Sat Apr 25 21:32:26 2020 +0200 staging/speakup: Add inflection synth parameter The inflection parameter, i.e. the pitch range, allows to change the expressiveness of the synthesized voice. This is supported by the DEC talk synths, and software synthesizers such as espeak/espeak-ng. Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20200425193226.nv3zfd4k3xavi353@function Signed-off-by: Greg Kroah-Hartman commit de24e9b33ad8a7ea4436da76b0504fbbebde25f4 Author: Jason Yan Date: Mon Apr 27 11:23:42 2020 +0800 staging: rtl8723bs: core: remove set but not used 'pframe' Fix the following gcc warning: drivers/staging/rtl8723bs/core/rtw_mlme.c:2920:6: warning: variable ‘pframe’ set but not used [-Wunused-but-set-variable] u8 *pframe; ^~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-8-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 42577f08004165c76c20f383fa6e716db9e33d5d Author: Jason Yan Date: Mon Apr 27 11:23:41 2020 +0800 staging: rtl8723bs: core: remove set but not used 'pwrpriv' Fix the following gcc warning: drivers/staging/rtl8723bs/core/rtw_mlme.c:1100:24: warning: variable ‘pwrpriv’ set but not used [-Wunused-but-set-variable] struct pwrctrl_priv *pwrpriv; ^~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-7-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 47548aa94c2114bc1492a458c33e0ba6b5a6209a Author: Jason Yan Date: Mon Apr 27 11:23:40 2020 +0800 staging: rtl8723bs: core: remove set but not used 'listen_interval' Fix the following gcc warning: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1173:18: warning: variable ‘listen_interval’ set but not used [-Wunused-but-set-variable] u16 capab_info, listen_interval; ^~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-6-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 3a0514a955ed7bea0569946176987b4f804f8249 Author: Jason Yan Date: Mon Apr 27 11:23:39 2020 +0800 staging: rtl8723bs: core: remove set but not used 'algthm' Fix the following gcc warning: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1087:33: warning: variable ‘algthm’ set but not used [-Wunused-but-set-variable] unsigned int seq, len, status, algthm, offset; ^~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-5-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit baae10fe867feb73a63381d1c880c31572b1b4c4 Author: Jason Yan Date: Mon Apr 27 11:23:38 2020 +0800 Staging: rtl8723bs: core: remove set but not used 'ptxservq' Fix the following gcc warning: drivers/staging/rtl8723bs/core/rtw_sta_mgt.c:556:19: warning: variable ‘ptxservq’ set but not used [-Wunused-but-set-variable] struct tx_servq *ptxservq; ^~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-4-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 589945844266b4450be7008f40ca6b0359b73dee Author: Jason Yan Date: Mon Apr 27 11:23:37 2020 +0800 staging: rtl8723bs: os_dep: remove set but not used 'size' And also remove the NULL check before kfree() because kfree() can handle NULL pointers correctly. Fix the following gcc warning: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:157:6: warning: variable ‘size’ set but not used [-Wunused-but-set-variable] u32 size = 0; ^~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-3-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit fc84701810fa02b6281b0afed201b4fd7b4c792c Author: Jason Yan Date: Mon Apr 27 11:23:36 2020 +0800 staging: rtl8723bs: os_dep: remove set but not used 'uintRet' Fix the following gcc warning: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2564:22: warning: variable ‘uintRet’ set but not used [-Wunused-but-set-variable] unsigned int uintRet = 0; ^~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-2-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 10b674be0a0c8a2a819c69786b07e76ab141e7c0 Author: Oscar Carter Date: Sat Apr 25 17:17:47 2020 +0200 staging: vt6656: Remove duplicate code in vnt_rf_table_download Replace three while loops with three calls to the vnt_control_out_blocks function. This way avoid repeat a functionality that already exists. Also remove the variables that now are not used. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200425151747.8199-4-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit d78b62c3eaf257dfb114f579c797a4777e3f45d4 Author: Oscar Carter Date: Sat Apr 25 17:17:46 2020 +0200 staging: vt6656: Use return instead of goto Replace the "goto" statements with a direct "return ret" as the jump label only returns the ret variable. Also, remove the unnecessary variable initialization because the ret variable is set a few lines later. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200425151747.8199-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 8a5baa66b01f6bfbb4f2456fdd4a8fe3896d7119 Author: Oscar Carter Date: Sat Apr 25 17:17:45 2020 +0200 staging: vt6656: Remove the local variable "array" Remove the local variable "array" and all the memcpy function calls because this copy operation from different arrays to this variable is unnecessary. The vnt_control_out function already does a kmemdup copy of its const char *buffer argument and this was made unnecessary by: commit 12ecd24ef932 ("staging: vt6656: use off stack for out buffer USB transfers.") Author: Malcolm Priestley Date: Sat Apr 22 11:14:57 2017 +0100 staging: vt6656: use off stack for out buffer USB transfers. Since 4.9 mandated USB buffers be heap allocated this causes the driver to fail. Since there is a wide range of buffer sizes use kmemdup to create allocated buffer. So, the same result can be achieved using the arrays directly. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200425151747.8199-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 5fa83c2566660956e6556e1090e24c642eb93822 Author: Rylan Dmello Date: Mon Apr 27 00:15:18 2020 -0400 staging: qlge: Remove print statements for lbq_clean_idx and lbq_free_cnt Remove debug print statements referring to non-existent fields 'lbq_clean_idx' and 'lbq_free_cnt' in the 'rx_ring' struct, which causes a compilation failure when QL_DEV_DUMP is set. These fields were initially removed as a part of commit aec626d2092f ("staging: qlge: Update buffer queue prod index despite oom") in 2019. Their replacement fields ('next_to_use' and 'next_to_clean') are already being printed, so this patch does not add new debug statements for them. Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/aa7e0197f4e34cec0855124e45696e33dd9527e5.1587959245.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 2d2aba6c0f36826d9af5805a3404101a54eb4fbb Author: Rylan Dmello Date: Mon Apr 27 00:14:44 2020 -0400 staging: qlge: Remove print statement for vlgrp field Remove statement that tries to print the non-existent 'vlgrp' field in the 'ql_adapter' struct, which causes a compilation failure when QL_DEV_DUMP is set. vlgrp seems to have been removed from ql_adapter as a part of commit 18c49b91777c ("qlge: do vlan cleanup") in 2011. vlgrp might be replaced by the 'active_vlans' array introduced in the aforementioned commit. But I'm not sure if printing all 64 values of that array would help with debugging this driver, so I'm leaving it out of the debug code in this patch. Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/51bae37a54d414491779e4a3329508cc864ab900.1587959245.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 7b58387cd5f3204418e07e16b5f04f71bfe9b7b6 Author: Rylan Dmello Date: Mon Apr 27 00:14:11 2020 -0400 staging: qlge: Remove unnecessary parentheses around struct field Remove unnecessary parentheses around a struct field accessor that causes a build failure when QL_DEV_DUMP is set. Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/4dea7a7fae6a56c51cc19228b82a3c230029f54b.1587959245.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman commit 9075e3180e9013781b8a466258eae73d978d2800 Author: Malcolm Priestley Date: Thu Apr 23 22:17:58 2020 +0100 staging: vt6656: Remove preamble_type setting from vnt_tx_packet. preamble_type is set in vnt_bss_info_changed no need to set it here. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/04874ae5-0859-7cb5-619a-ac96a207be5d@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7d1a8c98494c7d788d273469a2c40f0e07609f3f Author: Malcolm Priestley Date: Thu Apr 23 22:14:28 2020 +0100 staging: vt6656: Remove set short time in vnt_init_registers. The short time is set in vnt_bss_info_changed no need to set it here. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/a2bfc4f5-3f7f-3718-6056-2907a004477f@gmail.com Signed-off-by: Greg Kroah-Hartman commit 770ae40cd6d23eb331572b8913f51dc715c9d460 Author: Niklas Söderlund Date: Sun Feb 16 14:02:52 2020 +0100 MAINTAINERS: Add entry for Renesas R-Car thermal drivers Add an entry to make myself a maintainer of the Renesas R-Car thermal drivers. Signed-off-by: Niklas Söderlund Acked-by: Yoshihiro Shimoda Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200216130252.125100-1-niklas.soderlund+renesas@ragnatech.se commit ea0c2a621443604c3593cfeb2e365f6b5fbc828f Author: Malcolm Priestley Date: Sat Apr 25 11:50:59 2020 +0100 staging: vt6656: rxtx: remove duration_id and void returns. duration_id is not used by driver anymore so remove the returns and set all functions in patch to void. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/04a9c19f-c374-c175-6e46-d1bfbab2f42e@gmail.com Signed-off-by: Greg Kroah-Hartman commit de7db0dc0e79520f26293751024fd513fa5f47d6 Author: Michael Straube Date: Sat Apr 25 11:28:22 2020 +0200 staging: rtl8188eu: remove some superfluous comments Remove some obviously superflous comments. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200425092822.19925-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 345f2d84dd1a749b4711eca88a98c12a87e39c18 Author: Oscar Carter Date: Sat Apr 25 16:15:14 2020 +0200 staging: vt6656: Add formula to the vnt_rf_addpower function Use a formula to calculate the return value of the vnt_rf_addpower function instead of the "if" statement with literal values for every case. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200425141514.5528-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit f5e5e3024c1ea8b7dd04f5ac3f89afe08d470233 Author: Oscar Carter Date: Sat Apr 25 15:42:57 2020 +0200 staging: vt6656: Remove functions' documentation Remove the functions' documentation as the names of the functions are clear enought. Also, the actual documentation it's not correct in all cases. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200425134257.4502-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 81969fd8abc104d0288837409606c4abf527e224 Author: Oscar Carter Date: Sat Apr 25 15:42:56 2020 +0200 staging: vt6656: Check the return value of vnt_control_out_* calls Check the return value of vnt_control_out_* function calls. When necessary modify the function prototype to be able to return the new checked error code. It's safe to modify all the function prototypes without fix the call because the only change is the return value from void to int. If before the call didn't check the return value, now neither. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200425134257.4502-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 628cbd971a927abe6388d44320e351c337b331e4 Author: Ivan Safonov Date: Thu Apr 23 22:14:04 2020 +0300 staging:r8188eu: avoid skb_clone for amsdu to msdu conversion skb clones use same data buffer, so tail of one skb is corrupted by beginning of next skb. Signed-off-by: Ivan Safonov Link: https://lore.kernel.org/r/20200423191404.12028-1-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman commit f158242af81c7a20ce96c3fd85595fc28711a1ca Author: Jérôme Pouiller Date: Mon Apr 27 15:40:31 2020 +0200 staging: wfx: update list of errors The device raises error indications when it thinks there is a bug in the driver and it can't recover it (while it raises exception when a bug is detected in the device). The current list of of errors was a bit dated. This patch cleans up the list of errors and the associated message. It is also the right time to clean up the way the error indications are handled. Replace the switch..case with a clean loop over an array. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit be13e854bf092e54acacbdbd2d231781b9400f5d Author: Jérôme Pouiller Date: Mon Apr 27 15:40:30 2020 +0200 staging: wfx: fix display of exception indication Until now, the exception received from the chip was only displayed if driver was compiled with DEBUG enabled. It was not very convenient to help users. We prefer to show the exception unconditionally. In add, this patch provides the semantic of the first bytes of the struct. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit fa5a345e0fa724958a4ce56817c1a99821ad3296 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:29 2020 +0200 staging: wfx: fix messages names in tracepoints The names of the hardware interface messages are not displayed correctly in tracepoints. Thus, REQ_JOIN is displayed JOIN_REQ. Fix that in order to get the names as defined in headers of HIF API. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 508d99375f38c860387da9430fd70cff4e73102f Author: Jérôme Pouiller Date: Mon Apr 27 15:40:28 2020 +0200 staging: wfx: update list of known messages in tracepoints Some messages are missing from the list of symbolic messages defined in traces.h. Add them. Also sort the list in order to simplify next changes. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ef27a256285775ebc02a99e53920ed25c7464f5c Author: Jérôme Pouiller Date: Mon Apr 27 15:40:27 2020 +0200 staging: wfx: also show unnamed counters fields The struct hif_mib_extended_count_table contains some debug information accessible from the debugfs. The struct contains not yet used fields at the end. In order to support future firmware versions, this patch also show these not yet named fields. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 2760220700ac830837742bad575630cd9bac8eba Author: Jérôme Pouiller Date: Mon Apr 27 15:40:26 2020 +0200 staging: wfx: show counters of all interfaces The device keep up to date three series of stats. One for each virtual interface and one for the whole device. Until to now, the stats for the whole device were unavailable. Moreover, it is interesting to retrieve counters for all interfaces even if they are not awake. Change the counters available in debugfs in order to retrieve stats from all interfaces. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6ae0878b4800c7042d35c0fb4c6baabb62621ecc Author: Jérôme Pouiller Date: Mon Apr 27 15:40:25 2020 +0200 staging: wfx: fix double init of tx_policy_upload_work The work_struct tx_policy_upload_work was initialized twice. Fixes: 99879121bfbb ("staging: wfx: fix the cache of rate policies on interface reset") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 29d84944ca8b210785c8677465c624672040b0c7 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:24 2020 +0200 staging: wfx: fix the warning "inconsistent notification" In some circumstances, Tx traffic is sent without associated station but the station exists when the Tx status is received. Beside that, the driver keep a counter associated to each station. So, in this case, the counter is not incremented, but is decremented. In this case a warning "inconsistent notification" appears: ------------[ cut here ]------------ WARNING: CPU: 3 PID: 82 at /home/jerome/wfx/data_tx.c:469 wfx_skb_dtor+0x1a4/0x1d4 [wfx] inconsistent notification Modules linked in: [...] CPU: 3 PID: 82 Comm: kworker/3:1H Tainted: G C O 4.19.57-v7l+ #1244 Hardware name: BCM2835 Workqueue: events_highpri bh_work [wfx] [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0xd4/0x118) [] (dump_stack) from [] (__warn+0x104/0x11c) [] (__warn) from [] (warn_slowpath_fmt+0x58/0x74) [] (warn_slowpath_fmt) from [] (wfx_skb_dtor+0x1a4/0x1d4 [wfx]) [] (wfx_skb_dtor [wfx]) from [] (wfx_tx_confirm_cb+0x198/0x2f0 [wfx]) [] (wfx_tx_confirm_cb [wfx]) from [] (hif_tx_confirm+0x50/0x70 [wfx]) [] (hif_tx_confirm [wfx]) from [] (wfx_handle_rx+0x128/0x22c [wfx]) [] (wfx_handle_rx [wfx]) from [] (bh_work+0x3cc/0x964 [wfx]) [] (bh_work [wfx]) from [] (process_one_work+0x170/0x458) [] (process_one_work) from [] (worker_thread+0x5c/0x5a4) [] (worker_thread) from [] (kthread+0x138/0x168) [] (kthread) from [] (ret_from_fork+0x14/0x28) Exception stack(0xee199fb0 to 0xee199ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 64b9e754e12ef7de ]--- This patch fix this race between the station creation and the Tx data. Fixes: 7d2d2bfdeb82 ("staging: wfx: relocate "buffered" information to sta_priv") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 87066173e34b0ca5d041d5519e6bb030b1958184 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:23 2020 +0200 staging: wfx: fix overflow in frame counters It has been reported that trying to send small packets of data could produce a "inconsistent notification" warning. It seems that in some circumstances, the number of frame queued in the driver could greatly increase and exceed UCHAR_MAX. So the field "buffered" from struct sta_priv can overflow. Just increase the size of "bueffered" to fix the problem. Fixes: 7d2d2bfdeb82 ("staging: wfx: relocate "buffered" information to sta_priv") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit bfe2eb23d96ed23cb6c82cdcfcc6d79cee497367 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:22 2020 +0200 staging: wfx: fix highest Rx value declared in ieee80211_supported_band The highest Rx value declared in ieee80211_supported_band had two problems: 1. The value should be little endian 2. ShortGI was not taken into account. So value should be 72 instead of 65. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 5f041538e2761c2d42600394e0e60e1967d1d41c Author: Jérôme Pouiller Date: Mon Apr 27 15:40:21 2020 +0200 staging: wfx: add an explicit warning when chip detect too high temperature Device is able to measure its temperature and raise warning when this one is too high. If the the temperature is even higher, the chipis also able to send an error just before to stop responding. Until now, the error message was "asynchronous error: unknown (6)". Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 1d52d29983e5daa18c441feed94259aaf03c582c Author: Jérôme Pouiller Date: Mon Apr 27 15:40:20 2020 +0200 staging: wfx: add support for 'device too hot' indication Device is able to detect a high temperature. In this case, the traffic is not allowed to be sent until the temperature decrease. This patch detects the warnings raised by the device and stop the traffic accordingly. It also add a delayed task as safeguard in case the chip would never send the indication that the temperature decrease. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 8e47df5fc4abd31522b92eddf59c2863e3c5abde Author: Jérôme Pouiller Date: Mon Apr 27 15:40:19 2020 +0200 staging: wfx: fix CAB sent at the wrong time wfx_suspend_resume_mc() is called when the device is about to sent a DTIM. This is the right moment to enqueue Content After DTIM Beacon (CAB). However, wfx_suspend_resume_mc() is also called when the DTIM period ends. Until now, this event did also trig CAB. Note this issue did not have too much impact since when a CAB is sent outside of DTIM window, an error is reported by the firmware and mac80211 retries to send the data. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit dd5eba1bb5b4f944a8fa4031645cbb2f854fdc92 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:18 2020 +0200 staging: wfx: fix support for AP that do not support PS-Poll When multiple virtual interfaces (on different channels) are in use, the device ask to activate Power Save on station interfaces. The device developers recommends to use legacy PS-Poll in this case since it is the mode that disturb the less the other interface. However, some AP start to not answer anymore to PS-Poll. The device is able to detect this case and return a special warning in this case. So, this commit catch the warning and force usage of FastPS in this case. In order to confuse the less possible the other interface a small FastPS period is used (30ms). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7acf88f8649a782217541ae460a34c42f3330544 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:17 2020 +0200 staging: wfx: mark chip frozen on error indication When the driver receive an error indication, it means the chip won't answer to any command anymore. Therefore, mark the chip frozen when it happens (as when the driver receive an exception indication). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 18f0dddf1fe1d16405bb845da96c03cb4b340ad0 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:16 2020 +0200 staging: wfx: change the field chip_frozen into a boolean The field chip_frozen is declared as an integer, but it is only used as a boolean. So, convert it into a boolean. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7508f5d90d622d02af6a13a0a4c4064c475dd6e9 Author: Jérôme Pouiller Date: Mon Apr 27 15:40:15 2020 +0200 staging: wfx: fix (future) TDLS support The device does not expect that the AP to have a link-id. However, TDLS peers should have a a link-id. The driver does not yet declare itself as supporting TDLS. Notwithstanding, fix the code in anticipation of the support of TDLS. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200427134031.323403-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 2405c856915d295dbfea43a3c7d16d42cbb5625f Author: Suraj Upadhyay Date: Sat Apr 25 17:02:34 2020 +0530 staging: wfx: cleanup long lines in data_tx.c Break lines with length over 80 characters to conform to the linux coding style and refactor wherever necessary. Reviewed-by: Jérôme Pouiller Signed-off-by: Suraj Upadhyay Link: https://lore.kernel.org/r/20200425113234.GA14492@blackclown Signed-off-by: Greg Kroah-Hartman commit 19d4c761c1d2354e6c1deb6e1d31c949028b92d6 Author: Julian Wiedmann Date: Tue Apr 21 17:20:00 2020 +0200 s390/qdio: remove always-true condition buf_in_between() gets passed q->u.in.ack_start as 'bufnr' parameter. The ack_start always ranges between 0 and QDIO_MAX_BUFFERS_PER_Q - 1, so the subsequent check will always return true. Remove it. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 9b7012dfc33db9c44add10ab58033fe167a15f13 Author: Julian Wiedmann Date: Fri Apr 17 14:20:00 2020 +0200 s390/qdio: de-duplicate tiqdio_inbound_processing() Except for some initial thinint-only steps, the processing is identical to the non-thinint case. So re-use the existing helper. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit d188cac39753c8419d2b168436a632711896ea4e Author: Julian Wiedmann Date: Thu Apr 2 23:48:00 2020 +0200 s390/qdio: keep track of allocated queue count Knowing how many queues we initially allocated allows us to 1) sanity-check a subsequent qdio_establish() request, and 2) walk the queue arrays without further checks. Apply this while cleanly splitting qdio_free_queues() into two separate helpers. Signed-off-by: Julian Wiedmann Reviewed-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 2a7cf35c4056facd35c952e8000519034376eef7 Author: Julian Wiedmann Date: Thu Apr 2 23:30:41 2020 +0200 s390/qdio: roll-back after queue allocation error When qdio_allocate_qs() fails, have it deal with its previous allocations. This way qdio_allocate() doesn't need to clean up afterwards. Signed-off-by: Julian Wiedmann Reviewed-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit edbf3b2a87db6357fba54520c1baf605e08557b3 Author: Julian Wiedmann Date: Thu Apr 2 23:22:18 2020 +0200 s390/qdio: do more fine-grained allocation roll-back Instead of having a catch-all qdio_release_memory() helper, free the individual allocations from the respective error path. Signed-off-by: Julian Wiedmann Reviewed-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 3050f022df6a08cb3c968b9be01c163092c568d3 Author: Julian Wiedmann Date: Thu Apr 2 11:37:50 2020 +0200 s390/qdio: consolidate thinint init/exit Wrap the init/exit steps for thinint into a single helper that follows the established naming scheme. Signed-off-by: Julian Wiedmann Reviewed-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 75e82bec6b2622c6f455b7a543fb5476a5d0eed7 Author: Julian Wiedmann Date: Thu Apr 9 09:59:39 2020 +0200 s390/qdio: put thinint indicator after early error qdio_establish() calls qdio_setup_thinint() via qdio_setup_irq(). If the subsequent qdio_establish_thinint() fails, we miss to put the DSCI again. Thus the DSCI isn't available for re-use. Given enough of such errors, we could end up with having only the shared DSCI available. Merge qdio_setup_thinint() into qdio_establish_thinint(), and deal with such an error internally. Fixes: 779e6e1c724d ("[S390] qdio: new qdio driver.") Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 68a381746f20e5435206173e22d0a011ef78790e Author: Julian Wiedmann Date: Thu Apr 9 09:55:05 2020 +0200 s390/qdio: tear down thinint indicator after early error qdio_establish() calls qdio_establish_thinint(), but later has an error exit path that doesn't roll this call back. Fix it. Fixes: 779e6e1c724d ("[S390] qdio: new qdio driver.") Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit 7b942b4be971d49cb185ce4690d7fbf94636e88a Author: Julian Wiedmann Date: Thu Apr 9 10:55:16 2020 +0200 s390/qdio: consistently restore the IRQ handler For rolling back after an error, qdio_establish() calls qdio_shutdown(). If the error occurs early enough, then the qdio_irq's state still is QDIO_IRQ_STATE_INACTIVE and qdio_shutdown() does nothing. But at _any_ point where qdio_establish() bails out in this way, qdio_setup_irq() will have already replaced the IRQ handler. This then won't be restored after an early error, and the device can end up being returned to the device driver with qdio's IRQ handler still installed. Slightly reorder qdio_setup_irq() so we can be 100% sure that the IRQ handler was replaced. Then fix the bug in qdio_establish() by calling a helper that rolls back only the IRQ handler modification. Also use the new helper in qdio_shutdown() to keep things in sync, and slightly clean up the locking while doing so. This makes minor semantical changes, but holding setup_mutex gives us sufficient leeway to eg. pull qdio_shutdown_thinint() outside of the ccwdev lock's scope. Fixes: 779e6e1c724d ("[S390] qdio: new qdio driver.") Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Vasily Gorbik commit de267a7c71ba6be7857da0185871759067513d9c Author: Pierre Morel Date: Wed Apr 1 11:12:24 2020 +0200 s390/pci: Documentation for zPCI There are changes in the usage of PCI for the user: - new kernel parameter - modification of the way functions are enumerated Let's document these. Signed-off-by: Pierre Morel Signed-off-by: Vasily Gorbik commit 53dd462ac4dc3fc61ee90ad03d96202e17589156 Author: Pierre Morel Date: Thu Mar 26 12:07:03 2020 -0400 s390/pci: Do not disable PF when VFs exist The Physical function should not be disabled until no virtual functions depends on it. Let's force the user to first use echo 0 > sriov_numfs before allowing to disable the PF with echo 0 > power. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 44510d6fa0c00aa90b80075caa6b313b25927475 Author: Pierre Morel Date: Wed Apr 22 15:15:23 2020 +0200 s390/pci: Handling multifunctions We allow multiple functions on a single bus. We suppress the ZPCI_DEVFN definition and replace its occurences with zpci->devfn. We verify the number of device during the registration. There can never be more domains in use than existing devices, so we do not need to verify the count of domain after having verified the count of devices. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 65e450a9f9adabf3de1305a4c616f1313df402a3 Author: Pierre Morel Date: Mon Mar 23 12:29:37 2020 +0100 s390/pci: Adding bus resource The current PCI implementation do not provide a bus resource. This leads to a notice being print at boot. Let's do it more nicely and provide the bus resource. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit f606b3ef47c9f874af605323099663a10f691b24 Author: Pierre Morel Date: Wed Mar 25 17:55:55 2020 +0100 s390/pci: adapt events for zbus Simplify the event handling. Set the zpci state explicitly. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 05bc1be6db4b2683bbf5b9394a75d0fb3acfcede Author: Pierre Morel Date: Mon Mar 23 10:45:43 2020 +0100 s390/pci: create zPCI bus The zPCI bus is in charge to handle common zPCI resources for zPCI devices. Creating the zPCI bus, the PCI bus, the zPCI devices and the PCI devices and hotplug slots done in a specific order: - PCI hotplug slot creation needs a PCI bus - PCI bus needs a PCI domain which is reported by the pci_domain_nr() when setting up the host bridge - PCI domain is set from the zPCI with devfn 0 this is necessary to have a reproducible enumeration Therefore we can not create devices or hotplug slots for any PCI device associated with a zPCI device before having discovered the function zero of the bus. The discovery and initialization of devices can be done at several points in the code: - On Events, serialized in a thread context - On initialization, in the kernel init thread context - When powering on the hotplug slot, in a user thread context The removal of devices and their parent bus may also be done on events or for devices when powering down the slot. To guarantee the existence of the bus and devices until they are no more needed we use kref in zPCI bus and introduce a reference count in the zPCI devices. In this patch the zPCI bus still only accept a device with a devfn 0. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit c9a1752b84f1a8f73187c116ff0514b2ab24d878 Author: Pierre Morel Date: Fri Feb 21 10:06:38 2020 +0100 s390/pci: define RID and RID available Firmware provides the bus/devfn part of the PCI addresses of a zPCI function inside the new field RID of the CLP query PCI function with a bit to know if this field is available to use. Let's add these fields to the clp_rsp_query_pci structure, add corresponding fields to zdev and initialize them. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 6cf17f9a67c124aa4739b79709008d942635b975 Author: Pierre Morel Date: Fri Feb 7 13:35:08 2020 +0100 s390/pci: define kernel parameters for PCI multifunction Using PCI multifunctions in S390 is a new feature we may want to ignore to continue provide the same topology as in the past to userland even if the configuration supports exposing the topology of a multi-Function device. A new boolean parameters allows to overwrite the kernel pci configuration: - pci=norid when on, disallow the use a new firmware field, RID, which provides the PCI :. part of the PCI address. To be used in the following patches and satisfy the checkpatch.pl the variable is exposed in pci.h Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit d08d6f5d75242ceb410efbdf650efecc40d68c2d Author: Pierre Morel Date: Fri Feb 21 17:20:46 2020 +0100 s390/pci: adaptation of iommu to multifunction In the future the bus sysdata may not directly point to the zpci_dev. In preparation of upcoming patches let us abstract the access to the zpci_dev from the device inside the pci device. Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit e6ab7490ffaed83d6581f512e66c7c8cc6f58c2d Author: Alexander Schmidt Date: Fri Feb 28 10:31:13 2020 -0500 s390/pci: Expose new port attribute for PCIe functions Add SysFS attribute that provides the port number for PCI functions representing a single port of a multi-port device. Signed-off-by: Alexander Schmidt Signed-off-by: Pierre Morel Reviewed-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit d71ffeb9f250a89fe477d9b3645f49680dc6c685 Author: Dejin Zheng Date: Tue Apr 21 22:24:02 2020 +0800 pinctrl: fix several typos use codespell to fix lots of typos over frontends. Signed-off-by: Dejin Zheng Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven CC: Andy Shevchenko Link: https://lore.kernel.org/r/20200421142402.9524-1-zhengdejin5@gmail.com Signed-off-by: Linus Walleij commit 8c88cc53ffa62b4bb05931c878bcf3dd10db66b5 Author: Tiezhu Yang Date: Fri Apr 3 17:29:49 2020 +0800 MIPS: Loongson: Get host bridge information Read the address of host bridge configuration space to get the vendor ID and device ID of host bridge, and then we can distinguish various types of host bridge such as LS7A or RS780E. Signed-off-by: Tiezhu Yang Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit b9cf2cb524338c1257babb212420176e9e22f14a Author: Jason Yan Date: Sun Apr 26 17:41:47 2020 +0800 usb: core: hub: use true,false for bool variable Fix the following coccicheck warning: drivers/usb/core/hub.c:95:12-28: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200426094147.23467-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 618c35556e5f2156c8bc5cd43664363838e38e45 Author: Jason Yan Date: Tue Apr 28 14:32:54 2020 +0800 MIPS: oprofile: remove unneeded semicolon in common.c Fix the following coccicheck warning: arch/mips/oprofile/common.c:113:2-3: Unneeded semicolon Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit 62a679cb2825488387f458c16dff32be41eb3d32 Author: Mark Rutland Date: Thu Apr 23 11:16:06 2020 +0100 arm64: simplify ptrauth initialization Currently __cpu_setup conditionally initializes the address authentication keys and enables them in SCTLR_EL1, doing so differently for the primary CPU and secondary CPUs, and skipping this work for CPUs returning from an idle state. For the latter case, cpu_do_resume restores the keys and SCTLR_EL1 value after the MMU has been enabled. This flow is rather difficult to follow, so instead let's move the primary and secondary CPU initialization into their respective boot paths. By following the example of cpu_do_resume and doing so once the MMU is enabled, we can always initialize the keys from the values in thread_struct, and avoid the machinery necessary to pass the keys in secondary_data or open-coding initialization for the boot CPU. This means we perform an additional RMW of SCTLR_EL1, but we already do this in the cpu_do_resume path, and for other features in cpufeature.c, so this isn't a major concern in a bringup path. Note that even while the enable bits are clear, the key registers are accessible. As this now renders the argument to __cpu_setup redundant, let's also remove that entirely. Future extensions can follow a similar approach to initialize values that differ for primary/secondary CPUs. Signed-off-by: Mark Rutland Tested-by: Amit Daniel Kachhap Reviewed-by: Amit Daniel Kachhap Cc: Amit Daniel Kachhap Cc: Catalin Marinas Cc: James Morse Cc: Suzuki K Poulose Cc: Will Deacon Link: https://lore.kernel.org/r/20200423101606.37601-3-mark.rutland@arm.com Signed-off-by: Will Deacon commit d0055da5266acd316b8cb22b6086b8f9ac2d72cb Author: Mark Rutland Date: Thu Apr 23 11:16:05 2020 +0100 arm64: remove ptrauth_keys_install_kernel sync arg The 'sync' argument to ptrauth_keys_install_kernel macro is somewhat opaque at callsites, so instead lets have regular and _nosync variants of the macro to make this a little more obvious. Signed-off-by: Mark Rutland Cc: Amit Daniel Kachhap Cc: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/r/20200423101606.37601-2-mark.rutland@arm.com Signed-off-by: Will Deacon commit f8f0aa00898f3348fa323ae27d83463aace72394 Author: Martin Blumenstingl Date: Fri Apr 17 20:33:49 2020 +0200 pinctrl: meson: wire up the gpio_chip's set_config callback Use gpiochip_generic_config for the gpio_chip's set_config callback so GPIO flags like GPIO_PULL_UP or GPIO_PULL_DOWN can be used in the board .dts descriptions. This is required for some Meson8m2 boards where GPIO_BSD_EN provides the "MUTE" signal and requires enabling the internal pull-up resistor. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200417183349.1283092-3-martin.blumenstingl@googlemail.com Signed-off-by: Linus Walleij commit ef1d0bce38cf1b4293afe6088dbe9524bc5d434f Author: Martin Blumenstingl Date: Fri Apr 17 20:33:48 2020 +0200 pinctrl: meson: implement the gpio_chip get_direction callback Implement the get_direction callback so we read the direction from the actual GPIO controller register. This is recommended by the gpio_chip kernel doc. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20200417183349.1283092-2-martin.blumenstingl@googlemail.com Signed-off-by: Linus Walleij commit 44dd0eef4a24bc4020f6c7b7aa855e341eb4bad2 Author: YueHaibing Date: Wed Apr 15 21:21:05 2020 +0800 drm/omap: venc: remove unused variable 'venc_config_pal_bdghi' drivers/gpu/drm/omapdrm/dss/venc.c:211:33: warning: 'venc_config_pal_bdghi' defined but not used [-Wunused-const-variable=] static const struct venc_config venc_config_pal_bdghi = { ^~~~~~~~~~~~~~~~~~~~~ It is never used, remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200415132105.43636-1-yuehaibing@huawei.com commit 37aee136f8c4e4989099e7d4972d617ea7ad3e5c Author: Christian Hewitt Date: Thu Apr 23 01:34:30 2020 +0000 Bluetooth: hci_qca: allow max-speed to be set for QCA9377 devices Move the read of max-speed from device-tree out of the qca_is_wcn399x if block so oper_speed can be set for QCA9377 devices as well. Suggested-by: Abhishek Pandit-Subedi Signed-off-by: Christian Hewitt Signed-off-by: Marcel Holtmann commit 31d4ab856e2d57a8877d90012b42d029f1fe0fe9 Author: Christian Hewitt Date: Thu Apr 23 01:34:29 2020 +0000 Bluetooth: hci_qca: add compatible for QCA9377 Add a compatible so QCA9377 devices can be defined in device-tree. Signed-off-by: Christian Hewitt Signed-off-by: Marcel Holtmann commit 65749009242bbf67d5be129b7b67c4f9bfd93360 Author: Christian Hewitt Date: Thu Apr 23 01:34:28 2020 +0000 dt-bindings: net: bluetooth: Add device tree bindings for QCA9377 QCA9377 is a QCA ROME device frequently found in Android TV boxes. Signed-off-by: Christian Hewitt Signed-off-by: Marcel Holtmann commit aff8c489256ea1e32b35a007906a16dce7c6b4db Author: Alain Michaud Date: Thu Apr 23 14:43:31 2020 +0000 Bluetooth: btusb: Adding support for LE scatternet to Jfp and ThP This change adds support for LE scatternet connections to Intel's JfP and ThP controllers. Signed-off-by: Alain Michaud Signed-off-by: Marcel Holtmann commit 4364f2e91f0d44fa0e233d2a55e3ec35053d9bd9 Author: Alain Michaud Date: Thu Apr 23 14:43:29 2020 +0000 Bluetooth: allow scatternet connections if supported. This change allows scatternet connections to be created if the controller reports support and the HCI_QUIRK_VALID_LE_STATES indicates that the reported LE states can be trusted. Signed-off-by: Alain Michaud Signed-off-by: Marcel Holtmann commit 220915857e29795ae5ba4222806268b4a99c19c1 Author: Alain Michaud Date: Thu Apr 23 14:43:27 2020 +0000 Bluetooth: Adding driver and quirk defs for multi-role LE This change adds the relevant driver and quirk to allow drivers to report the le_states as being trustworthy. This has historically been disabled as controllers did not reliably support this. In particular, this will be used to relax this condition for controllers that have been well tested and reliable. /* Most controller will fail if we try to create new connections * while we have an existing one in slave role. */ if (hdev->conn_hash.le_num_slave > 0) return NULL; Signed-off-by: Alain Michaud Signed-off-by: Marcel Holtmann commit f354157a7d184db430c1a564c506434e33b1bec5 Author: Jonathan Bakker Date: Sat Apr 25 16:10:46 2020 -0700 pinctrl: samsung: Save/restore eint_mask over suspend for EINT_TYPE GPIOs Currently, for EINT_TYPE GPIOs, the CON and FLTCON registers are saved and restored over a suspend/resume cycle. However, the EINT_MASK registers are not. On S5PV210 at the very least, these registers are not retained over suspend, leading to the interrupts remaining masked upon resume and therefore no interrupts being triggered for the device. There should be no effect on any SoCs that do retain these registers as theoretically we would just be re-writing what was already there. Fixes: 7ccbc60cd9c2 ("pinctrl: exynos: Handle suspend/resume of GPIO EINT registers") Cc: Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit 26333c37fc285e7372f1b9461f3ae0ba3dc699c9 Author: Sabrina Dubroca Date: Mon Apr 27 17:59:35 2020 +0200 xfrm: add IPv6 support for espintcp This extends espintcp to support IPv6, building on the existing code and the new UDPv6 encapsulation support. Most of the code is either reused directly (stream parser, ULP) or very similar to the IPv4 variant (net/ipv6/esp6.c changes). The separation of config options for IPv4 and IPv6 espintcp requires a bit of Kconfig gymnastics to enable the core code. Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 0146dca70b877b73c5fd9c67912b8a0ca8a7bac7 Author: Sabrina Dubroca Date: Mon Apr 27 17:59:34 2020 +0200 xfrm: add support for UDPv6 encapsulation of ESP This patch adds support for encapsulation of ESP over UDPv6. The code is very similar to the IPv4 encapsulation implementation, and allows to easily add espintcp on IPv6 as a follow-up. Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 4e3ec9e407ad5058003309072b37111f7b8c900a Author: Venkata Narendra Kumar Gutta Date: Thu Apr 16 23:19:07 2020 -0700 pinctrl: qcom: Add sm8250 pinctrl driver. Add initial Qualcomm SM8250 pinctrl driver to support pin configuration with pinctrl framework for SM8250 SoC. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Venkata Narendra Kumar Gutta Link: https://lore.kernel.org/r/1586477057-7636-2-git-send-email-vnkgutta@codeaurora.org [bjorn: Regrouped functions, upstream tiles implementation, dropped downstream-only features] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200417061907.1226490-3-bjorn.andersson@linaro.org Signed-off-by: Linus Walleij commit 548e33205964d3a471a5aca259aee6685becfed8 Author: Bjorn Andersson Date: Thu Apr 16 23:19:06 2020 -0700 dt-bindings: pinctrl: qcom: Add sm8250 pinctrl bindings Add device tree binding Documentation details for Qualcomm SM8250 pinctrl driver. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200417061907.1226490-2-bjorn.andersson@linaro.org Signed-off-by: Linus Walleij commit 439c2787532ff6ecfa7917ad100df923da58c103 Author: Zheng Bin Date: Fri Apr 24 15:49:49 2020 +0800 drm/meson: Remove unneeded semicolon Fixes coccicheck warning: drivers/gpu/drm/meson/meson_plane.c:226:3-4: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20200424074949.12309-1-zhengbin13@huawei.com commit 69c93f9674c97dc439cdc0527811f8ad104c2e35 Author: Wei Yongjun Date: Mon Apr 27 09:24:17 2020 +0000 ath11k: use GFP_ATOMIC under spin lock A spin lock is taken here so we should use GFP_ATOMIC. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Wei Yongjun Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427092417.56236-1-weiyongjun1@huawei.com commit 4cc02c7c14944b16020c8da44572b3c5d189d386 Author: Wen Gong Date: Mon Apr 27 16:04:16 2020 +0800 ath10k: correct tx bitrate of iw for SDIO For legacy mode, tx bitrate not show correct sometimes, for example: iw wlan0 link Connected to 8c:21:0a:b3:5a:64 (on wlan0) SSID: tplinkgw freq: 2462 RX: 19672 bytes (184 packets) TX: 9851 bytes (87 packets) signal: -51 dBm rx bitrate: 54.0 MBit/s tx bitrate: 2.8 MBit/s This patch use the tx bitrate info from WMI_TLV_PEER_STATS_INFO_EVENTID report from firmware, and tx bitrate show correct. iw wlan0 link Connected to 8c:21:0a:b3:5a:64 (on wlan0) SSID: tplinkgw freq: 2462 RX: 13973 bytes (120 packets) TX: 6737 bytes (57 packets) signal: -52 dBm rx bitrate: 54.0 MBit/s tx bitrate: 54.0 MBit/s This patch only effect SDIO chip, ath10k_mac_sta_get_peer_stats_info has check for bitrate_statistics of hw_params, it is enabled only for "qca6174 hw3.2 sdio". Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427080416.8265-5-wgong@codeaurora.org commit 3344b99d69ab6b479c5a54c7b72c325aaa4bdad0 Author: Wen Gong Date: Mon Apr 27 16:04:15 2020 +0800 ath10k: add bitrate parse for peer stats info The rate code and rate kbps report by WMI_TLV_PEER_STATS_INFO_EVENTID from firmware contains all the bitrate info which include OFDM, CCK, HT/VHT, and mac80211 need the struct rate_info which include below parameters: flags: bitflag of flags from &enum rate_info_flags mcs: mcs index if struct describes an HT/VHT/HE rate legacy: bitrate in 100kbit/s for 802.11abg nss: number of streams (VHT & HE only) bw: bandwidth (from &enum rate_info_bw) For OFDM/CCK, its rate kbps indicate the bitrate, for HT/VHT, mac80211 need the above 5 parameters to cacluate the bitrate and show by iw. After parse the bitrate info, iw show the correct rx bitrate: localhost ~ # iw wlan0 link rx bitrate: 234.0 MBit/s VHT-MCS 3 80MHz VHT-NSS 2 rx bitrate: 40.5 MBit/s MCS 2 40MHz rx bitrate: 72.2 MBit/s MCS 7 short GI rx bitrate: 54.0 MBit/s rx bitrate: 48.0 MBit/s Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427080416.8265-4-wgong@codeaurora.org commit 0f7cb26830a6e740455a7064e46ff1e926197ecb Author: Wen Gong Date: Mon Apr 27 16:04:14 2020 +0800 ath10k: add rx bitrate report for SDIO For SDIO chip, its rx indication is struct htt_rx_indication_hl, which does not include the bitrate info as well as PCIe, for PCIe, it use function ath10k_htt_rx_h_rates to parse the bitrate info in struct rx_ppdu_start and then report it to mac80211 via ieee80211_rx_status. SDIO does not have the same info as PCIe, then iw command can not get the rx bitrate by "iw wlan0 station dump". for example, it always show 6.0 MBit/s localhost ~ # iw wlan0 link Connected to 3c:28:6d:96:fd:69 (on wlan0) SSID: kukui_test freq: 5180 RX: 111800 bytes (595 packets) TX: 35419 bytes (202 packets) signal: -41 dBm rx bitrate: 6.0 MBit/s This patch is to send WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID to firmware for ath10k_sta_statistics and save the rx bitrate for WMI event WMI_TLV_PEER_STATS_INFO_EVENTID. This patch only effect SDIO chip, ath10k_mac_sta_get_peer_stats_info has check for bitrate_statistics of hw_params, this patch only enable it for "qca6174 hw3.2 sdio". Tested with QCA6174 SDIO firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427080416.8265-3-wgong@codeaurora.org commit 2289bef25e32808bb6d748edc667ca297792bf8f Author: Wen Gong Date: Mon Apr 27 16:04:13 2020 +0800 ath10k: enable firmware peer stats info for wmi tlv For wmi tlv type, firmware disable peer stats info by default, after enable it, firmware will report WMI_TLV_PEER_STATS_INFO_EVENTID if ath10k send WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID to firmware. Enable it will only set a flag in firmware, firmware will not report it without receive request WMI command. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200427080416.8265-2-wgong@codeaurora.org commit c26b01d5ec1ab4dbfbdeb93ef4bc9e34951b6688 Author: Jason Yan Date: Sun Apr 26 17:40:37 2020 +0800 ath5k: remove conversion to bool in ath5k_ani_calibration() The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/net/wireless/ath/ath5k/ani.c:504:56-61: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200426094037.23048-1-yanaijie@huawei.com commit d8d20845c7f129359c845c526929056651d4e5df Author: Sergey Ryazanov Date: Fri Apr 24 03:49:23 2020 +0300 ath9k: add calibration timeout for AR9002 ADC & I/Q calibrations could take infinite time to comple, since they depend on received frames. In particular the I/Q mismatch calibration requires receiving of OFDM frames for completion. But in the 2.4GHz band, a station could receive only CCK frames for a very long time. And while we wait for the completion of one of the mentioned calibrations, the NF calibration is blocked. Moreover, in some environments, I/Q calibration is unable to complete until a correct noise calibration will be performed due to AGC behaviour. In order to avoid delaying NF calibration on forever, limit the maximum duration of ADCs & I/Q calibrations. If the calibration is not completed within the maximum time, it will be interrupted and a next calibration will be performed. The code that selects the next calibration has been reworked to the loop so incompleted calibration will be respinned later. А maximum calibration time of 30 seconds was selected to give the calibration enough time to complete and to not interfere with the long (NF) calibration. Run tested with AR9220. Signed-off-by: Sergey Ryazanov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424004923.17129-7-ryazanov.s.a@gmail.com commit ded6ff15a1911af7dd641b4cc1a1a2e161f08e1f Author: Sergey Ryazanov Date: Fri Apr 24 03:49:22 2020 +0300 ath9k: invalidate all calibrations at once Previously after the calibration validity period is over, calibrations are invalidated in a one at time manner. So, for AR9002 family, which has three calibrations, the full recalibration interval becomes 3 x ATH_RESTART_CALINTERVAL. And each next calibration will be separated by the ATH_RESTART_CALINTERVAL time from a previous one. It seems like it is better to do whole recalibration at once. Also, this change makes the driver behaviour a little simpler. So, invalidate all calibrations at once at the end of the calibration validity interval. This change affects only AR9002 chips family, since the AR9003 utilize only a single calibration. Signed-off-by: Sergey Ryazanov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424004923.17129-6-ryazanov.s.a@gmail.com commit 2bb7027b64b68bf8620b849d6ec1c223572c7e92 Author: Sergey Ryazanov Date: Fri Apr 24 03:49:21 2020 +0300 ath9k: interleaved NF calibration on AR9002 NF calibration and other elements of long calibration are usually faster than ADCs & I/Q calibrations due to independence of receiption of the OFDM signal. Moreover sometime I/Q calibration can not be completed at all without preceding NF calibration. This is due to AGC, which has a habit to block a weak signal without regular NF calibration. Thus, we do not need to deferr the long calibration forever. So, if the long calibration is requested, then deferr the ADCs & I/Q calibration(s) and run the longcal (the NF calibration in particular) to obtain fresh noise data. Run tested with AR9220. Signed-off-by: Sergey Ryazanov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424004923.17129-5-ryazanov.s.a@gmail.com commit 41ba50fd6cac084a93e7651c528ef4bc37996ee2 Author: Sergey Ryazanov Date: Fri Apr 24 03:49:20 2020 +0300 ath9k: do not miss longcal on AR9002 Each of AGC & I/Q calibrations can take a long time. Long calibration and NF calibration in particular are forbiden for parallel run with ADC & I/Q calibrations. So, the chip could not be ready to perform the long calibration at the time of request. And a request to perform the long calibration may be lost. In order to fix this, preserve the long calibration request as a calibration state flag and restore the long calibration request each time the calibration function is called again (i.e. on each subsequent ivocation of the short calibration). This feature will be twice useful after the next change, which will make it possible to start the long calibration before all ADCs & I/Q calibrations are completed. Run tested with AR9220. Signed-off-by: Sergey Ryazanov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424004923.17129-4-ryazanov.s.a@gmail.com commit 93f8d4223163c6ba4f2ec8ade4832ef40e2b1d0c Author: Sergey Ryazanov Date: Fri Apr 24 03:49:19 2020 +0300 ath9k: remove needless NFCAL_PENDING flag setting The NFCAL_PENDING flag is set by the ath9k_hw_start_nfcal() routine, so there is no reason to set it manually after calling it during the AR9002 calibrations initialization. Signed-off-by: Sergey Ryazanov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424004923.17129-3-ryazanov.s.a@gmail.com commit d6cae2bc195b558ba79315eae699138ebdf41b57 Author: Sergey Ryazanov Date: Fri Apr 24 03:49:18 2020 +0300 ath9k: fix AR9002 ADC and NF calibrations ADC calibration is only required for a 80 MHz sampling rate (i.e. for 40 MHz channels), when the chip utilizes the pair of ADCs in interleved mode. Calibration on a 20 MHz channel will never be completed. Previous channel check is trying to exclude all channels where the calibration will get stuck. It effectively blocks the calibration run for HT20 channels, but fails to exclude 20 MHz channels without HT (e.g. legacy mode channels). Fix this issue by reworking the channel check to explicitly allow ADCs gain & DC offset calibrations for HT40 channels only. Also update the complicated comment to make it clear that these calibrations are for multi-ADC mode only. Stuck ADCs calibration blocks the NF calibration, what could make it impossible to work in a noisy evironment: too big Rx attentuation, invalid RSSI value, etc. So this change is actually more of a NF calibration fix rather then the ADC calibration fix. Run tested with AR9220. Signed-off-by: Sergey Ryazanov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424004923.17129-2-ryazanov.s.a@gmail.com commit 767dea211cd0c68d8116d8c3b5104e82454fb44b Author: Christoph Hellwig Date: Tue Apr 28 07:17:03 2020 +0200 x86/tboot: Mark tboot static This structure is only really used in tboot.c. The only exception is a single tboot_enabled check, but for that we don't need an inline function. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200428051703.1625952-1-hch@lst.de commit 86501437d88532952a21b427d2ffd1683870d369 Author: John Oldman Date: Sat Apr 25 16:52:33 2020 +0100 ssb: scan: fix block comments coding style issues Fixed coding style issues Signed-off-by: John Oldman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200425155233.19624-1-john.oldman@polehill.co.uk commit 2aad9f81d34c3ecb6b5dbfd7c64a76298d40c361 Author: John Oldman Date: Fri Apr 24 18:50:43 2020 +0100 ssb: sprom: fix block comments coding style issues Fixed coding style issues Signed-off-by: John Oldman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424175043.16261-1-john.oldman@polehill.co.uk commit 7c2553f0db6133ba079597422391661914ce91c7 Author: Peng Fan Date: Tue Apr 28 15:21:00 2020 +0800 cpufreq: imx-cpufreq-dt: support i.MX7ULP i.MX7ULP's ARM core clock design is totally different compared with i.MX7D/8M SoCs which supported by imx-cpufreq-dt. It needs get_intermediate and target_intermedate to configure clk MUX ready, before let OPP configure ARM core clk. |---FIRC |------RUN---...---SCS(MUX2) --------| ARM --(MUX1) |---SPLL_PFD0(CLK_SET_RATE_GATE) |------HSRUN--...--HSRUN_SCS(MUX3)---| |---SRIC FIRC is step clk, SPLL_PFD0 is the normal clk driving ARM core. MUX2 and MUX3 share same inputs. So if MUX2/MUX3 both sources from SPLL_PFD0, both MUXes will lose input when configure SPLL_PFD0. So the target_intermediate will configure MUX2/MUX3 to FIRC, to avoid ARM core lose clk when configure SPLL_PFD0. Signed-off-by: Peng Fan Signed-off-by: Viresh Kumar commit d631461d5cc3d6dd3b22bdfb810f668bc1935179 Author: Colin Ian King Date: Tue Apr 28 09:49:20 2020 +0100 drm/i915/gt: fix spelling mistake "evalution" -> "evaluation" There is a spelling mistaking in a pr_notice message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200428084920.1035125-1-colin.king@canonical.com commit 6895681132ec9d0dda9e95a9ddde3ba59720c1d6 Author: Peng Fan Date: Tue Apr 14 21:24:28 2020 +0800 arm64: dts: imx8qxp: support scu mailbox channel With mailbox driver support i.MX8 SCU MU channel, we could use it to avoid trigger interrupts for each TR/RR registers in one MU, instead, only one RX interrupt for a recv and one TX interrupt for a send. Signed-off-by: Peng Fan Reviewed-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 3d8bf50860c7de09c9713b97ec2f87ad42338c7e Author: Yan-Hsuan Chuang Date: Fri Apr 24 18:12:55 2020 +0800 rtw88: fix sparse warnings for download firmware routine sparse warnings: (new ones prefixed by >>) >> drivers/net/wireless/realtek/rtw88/mac.c:653:5: sparse: sparse: symbol '__rtw_download_firmware' was not declared. Should it be static? >> drivers/net/wireless/realtek/rtw88/mac.c:817:5: sparse: sparse: symbol '__rtw_download_firmware_legacy' was not declared. Should it be static? Fixes: 15d2fcc6b2de ("rtw88: add legacy firmware download for 8723D devices") Reported-by: kbuild test robot Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200424101255.28239-1-yhchuang@realtek.com commit 135e7a156ae2c1a7a1f0c1d44bf2b3daece04bbf Author: Lad Prabhakar Date: Thu Apr 23 22:40:49 2020 +0100 ARM: shmobile: r8a7742: Basic SoC support Add minimal support for the RZ/G1H (R8A7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-10-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 557b7e545e09b8b994aa959ec1a29fc23db0fe0f Merge: 8f3d9f354286 41b2df22fafb Author: Geert Uytterhoeven Date: Tue Apr 28 10:12:22 2020 +0200 Merge tag 'renesas-r8a7742-dt-binding-defs-tag' into renesas-drivers-for-v5.8 Renesas RZ/G1H DT Binding Definitions Clock and Power Domain definitions for the Renesas RZ/G1H (R8A7742) SoC, shared by driver and DT source files. commit 9e01d74ce0a154411c8991d6e34f4c470958eac3 Author: Lad Prabhakar Date: Thu Apr 23 22:40:44 2020 +0100 dt-bindings: reset: rcar-rst: Document r8a7742 reset module Document bindings for the RZ/G1H (R8A7742) reset module. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-5-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 17a97f9db948bd2f6d65465e9e1cb20fdfd9b275 Author: Lad Prabhakar Date: Thu Apr 23 22:40:41 2020 +0100 dt-bindings: power: rcar-sysc: Document r8a7742 SYSC binding Add binding documentation for the RZ/G1H (R8A7742) SYSC block. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 07ba85678145d73362e87552245aff72a88975d7 Merge: 6424962816de 41b2df22fafb Author: Geert Uytterhoeven Date: Tue Apr 28 10:06:29 2020 +0200 Merge tag 'renesas-r8a7742-dt-binding-defs-tag' into clk-renesas-for-v5.8 Renesas RZ/G1H DT Binding Definitions Clock and Power Domain definitions for the Renesas RZ/G1H (R8A7742) SoC, shared by driver and DT source files. commit 6424962816ded55a01299c1458a2d21fadc779cc Author: Lad Prabhakar Date: Thu Apr 23 22:40:46 2020 +0100 dt-bindings: clock: renesas: cpg-mssr: Document r8a7742 binding Add binding documentation for the RZ/G1H (R8A7742) Clock Pulse Generator driver. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-7-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 41b2df22fafbca2c69dcce9f93c7042e6ccd69ef Author: Lad Prabhakar Date: Thu Apr 23 22:40:47 2020 +0100 clk: renesas: Add r8a7742 CPG Core Clock Definitions Add all RZ/G1H Clock Pulse Generator Core Clock Outputs, as listed in Table 7.2a ("List of Clocks [RZ/G1H]") of the RZ/G1 Hardware User's Manual. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-8-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 58f7381c97547db025970423bd2a3b9d9cea1174 Author: Lad Prabhakar Date: Thu Apr 23 22:40:42 2020 +0100 dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros Add power domain indices for RZ/G1H (R8A7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Link: https://lore.kernel.org/r/1587678050-23468-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 9f09e37d154469eb989918940fba64d8b1f8c42c Author: Mason Yang Date: Thu Apr 23 16:38:43 2020 +0800 mtd: spi-nor: macronix: Add support for mx25u51245g mx25u51245g is a mass production for new design and replace mx66u51235f(phase out). Validated by read, erase, read back, write and read back on Xilinx Zynq PicoZed FPGA board which included Macronix SPI Host (driver/spi/spi-mxic.c). Signed-off-by: Mason Yang Signed-off-by: Tudor Ambarus commit d8207c155a7c6015eb7f43739baa7dfb1fa638af Author: Jon Hunter Date: Mon Feb 24 14:07:48 2020 +0000 backlight: lp855x: Ensure regulators are disabled on probe failure If probing the LP885x backlight fails after the regulators have been enabled, then the following warning is seen when releasing the regulators ... WARNING: CPU: 1 PID: 289 at drivers/regulator/core.c:2051 _regulator_put.part.28+0x158/0x160 Modules linked in: tegra_xudc lp855x_bl(+) host1x pwm_tegra ip_tables x_tables ipv6 nf_defrag_ipv6 CPU: 1 PID: 289 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200224 #1 Hardware name: NVIDIA Jetson TX1 Developer Kit (DT) ... Call trace: _regulator_put.part.28+0x158/0x160 regulator_put+0x34/0x50 devm_regulator_release+0x10/0x18 release_nodes+0x12c/0x230 devres_release_all+0x34/0x50 really_probe+0x1c0/0x370 driver_probe_device+0x58/0x100 device_driver_attach+0x6c/0x78 __driver_attach+0xb0/0xf0 bus_for_each_dev+0x68/0xc8 driver_attach+0x20/0x28 bus_add_driver+0x160/0x1f0 driver_register+0x60/0x110 i2c_register_driver+0x40/0x80 lp855x_driver_init+0x20/0x1000 [lp855x_bl] do_one_initcall+0x58/0x1a0 do_init_module+0x54/0x1d0 load_module+0x1d80/0x21c8 __do_sys_finit_module+0xe8/0x100 __arm64_sys_finit_module+0x18/0x20 el0_svc_common.constprop.3+0xb0/0x168 do_el0_svc+0x20/0x98 el0_sync_handler+0xf4/0x1b0 el0_sync+0x140/0x180 Fix this by ensuring that the regulators are disabled, if enabled, on probe failure. Finally, ensure that the vddio regulator is disabled in the driver remove handler. Signed-off-by: Jon Hunter Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones commit 04b8edad262eec0d153005973dfbdd83423c0dcb Author: Mason Yang Date: Thu Apr 23 16:38:42 2020 +0800 mtd: spi-nor: macronix: Add support for mx25l51245g mx25l51245g is a mass production for new design and replace mx66l51235l(phase out). Validated by read, erase, read back, write and read back on Xilinx Zynq PicoZed FPGA board which included Macronix SPI Host (driver/spi/spi-mxic.c). Signed-off-by: Mason Yang Signed-off-by: Tudor Ambarus commit f4363e64c204411c8f446921e0ac06d18806652c Author: Sergei Shtylyov Date: Tue Apr 21 22:40:05 2020 +0300 mtd: spi-nor: core: fix kernel-doc typo for spi_nor_[{info|sfdp}_]init_params() When spi_nor_info_init_params(), spi_nor_sfdp_init_params(), and spi_nor_init_params() were added, the kernel-doc for them contained a typo: 'struct spi-nor' instead of 'struct spi_nor' -- fix them. Fixes: 1c1d8d98e1c7 ("mtd: spi-nor: Split spi_nor_init_params()") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit d207b0b355e7c970889bcd04b93f42fab5c1a553 Author: Sergei Shtylyov Date: Tue Apr 21 22:38:42 2020 +0300 mtd: spi-nor: core: fix kernel-doc typo for spi_nor_manufacturer_init_params() When spi_nor_manufacturer_init_params() was added, the kernel-doc for it contained a typo: 'struct spi-nor' instead of 'struct spi_nor' -- fix it. Fixes: ce0b6f3f3c43 ("mtd: spi-nor: Add default_init() hook to tweak flash parameters") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit 1f241ad2a093b889122bd6bfdce57551d21bba5b Author: Sergei Shtylyov Date: Fri Apr 3 23:50:57 2020 +0300 mtd: spi-nor: fix kernel-doc for spi_nor::spimem When adding the 'spimem' field to 'struct spi_nor', a grammar mistake ("point" instead of "pointer") was made -- fix it and convert the SPI acronym to uppercase and fully spell out "memory", while at it... Fixes: b35b9a10362 ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit 80cb801144265866ce29fabe5ea7ac8588aa673c Author: Sergei Shtylyov Date: Fri Apr 3 23:49:48 2020 +0300 mtd: spi-nor: fix kernel-doc for spi_nor::info When adding the 'info' field to 'struct spi_nor', some acronyms were in lower case and some in upper case and the JEDEC acronym mistyped -- fix these issues. Fixes: 46dde01f6bab ("mtd: spi-nor: add spi_nor_init() function") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit ba053dd3b4d841e17e910d0b91e22d9ea813fa39 Author: Sergei Shtylyov Date: Fri Apr 3 23:45:49 2020 +0300 mtd: spi-nor: fix kernel-doc for spi_nor::reg_proto When adding the '{read|write|reg}_proto' fields to 'struct spi_nor', a colon was missed in the comment for the spi_nor::reg_proto' -- add it. Fixes: cfc5604c488c ("mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocols") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit ba0aa311b0eb9d0a66a1b6b6fdeaa3b7584b798a Author: Sergei Shtylyov Date: Fri Apr 3 23:44:16 2020 +0300 mtd: spi-nor: fix kernel-doc for spi_nor::mtd When embedding 'struct mtd_info' within 'struct spi_nor', the kernel-doc comment was forgotten. Fix it by dropping the "pointer to" part from the comment. Fixes: 1976367173a4 ("mtd: spi-nor: embed struct mtd_info within struct spi_nor") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit 40a571bc408bf10ac8be0eadf838483b9cf90141 Author: Sergei Shtylyov Date: Fri Apr 3 23:41:27 2020 +0300 mtd: spi-nor: fix kernel-doc for 'struct spi_nor' When introducing 'struct spi_nor', a number of issues was added in its kernel-doc comment: - double article in the heading kernel-doc comment; - "point" instead of "pointer" for the 'mtd' and 'dev' fields; - "a" articles instead of "an" for the 'dev' field; - acronyms in the lower case for the 'dev' field; - missing "pointer to" for the 'priv' field. Fix all of those at once... Fixes: 6e602ef73334 ("mtd: spi-nor: add the basic data structures") Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit 2f29298bc2d9679685b2c9bc7293b43d57fe14f4 Author: Bjorn Andersson Date: Tue Apr 14 23:07:45 2020 -0700 phy: qcom: qmp: Add SM8250 UFS PHY The SM8250 UFS PHY can run off the same initialization sequence as SM8150, but add the compatible to allow future changes. Signed-off-by: Bjorn Andersson Tested-by: Vinod Koul Reviewed-by: Vinod Koul Acked-by: Rob Herring Signed-off-by: Vinod Koul commit a6d1bfa05545b0d34f5b5093248b10a745c050e3 Author: Lad Prabhakar Date: Mon Apr 27 13:53:30 2020 +0100 cpufreq: dt: Add support for r8a7742 Add the compatible strings for supporting the generic cpufreq driver on the Renesas RZ/G1H (R8A7742) SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Reviewed-by: Geert Uytterhoeven Signed-off-by: Viresh Kumar commit a08e1b6c2d0b9ab7889ac1f7b5c535affbe5032e Author: Peng Fan Date: Mon Apr 20 15:55:13 2020 +0800 cpufreq: Add i.MX7ULP to cpufreq-dt-platdev blacklist Add i.MX7ULP to cpufreq-dt-platdev blacklist. Signed-off-by: Peng Fan Signed-off-by: Viresh Kumar commit 59b55c1f204608cdc2a767c8c969d9ccfd820ec7 Author: Anders Roxell Date: Wed Apr 15 10:15:59 2020 +0200 cpufreq: omap: Build driver by default for ARCH_OMAP2PLUS When building the mult_v7_defconfig, ARM_TI_CPUFREQ doesn't get enabled evenwhen ARCH_OMAP(3|4) is selected. Build ARM_TI_CPUFREQ by default for ARCH_OMAP2PLUS. Signed-off-by: Anders Roxell Signed-off-by: Viresh Kumar commit 9d17ad2369dcc9beda0785cf5960222dbdd6c9df Author: Rajat Jain Date: Mon Apr 27 17:53:46 2020 -0700 Input: atkbd - receive and use physcode->keycode mapping from FW Allow the firmware to specify the mapping between the scan code and the linux keycode. This takes the form of a "linux,keymap" property which is an array of u32 values, each value specifying mapping for a key. Signed-off-by: Rajat Jain Link: https://lore.kernel.org/r/20200427210259.91330-3-rajatja@google.com Signed-off-by: Dmitry Torokhov commit 8f7b057abe283a4505747ea8275751479442de53 Author: Rajat Jain Date: Mon Apr 27 17:51:15 2020 -0700 Input: atkbd - expose function row physical map to userspace Certain keyboards have their top-row keys intended for actions such as "Browser back", "Browser Refresh", "Fullscreen" etc as their primary mode, thus they will send scan codes for those actions. Further, they don't have a dedicated "Fn" key so don't have the capability to generate function key codes (e.g. F1, F2 etc..). However in this case, if userspace still wants to "synthesize" those function keys using the top row action keys, it needs to know the physical position of the top row keys. (Essentially a mapping between usage codes and a physical location in the top row). This patch enhances the atkbd driver to receive such a mapping from the firmware / device tree, and expose it to userspace in the form of a function-row-physmap attribute. The attribute would be a space separated ordered list of physical codes, for the keys in the function row, in left-to-right order. The attribute will only be present if the kernel knows about such mapping, otherwise the attribute shall not be visible. Signed-off-by: Rajat Jain Link: https://lore.kernel.org/r/20200427210259.91330-2-rajatja@google.com Signed-off-by: Dmitry Torokhov commit 6052abf8ff783a14dcd2416be2c029ebeba9ad98 Author: Rajat Jain Date: Mon Apr 27 17:50:45 2020 -0700 Input: i8042 - attach fwnode to serio i8042 kbd device Attach the firmware node to the serio i8042 kbd device so that device properties can be passed from the firmware. Signed-off-by: Rajat Jain Link: https://lore.kernel.org/r/20200427210259.91330-1-rajatja@google.com Signed-off-by: Dmitry Torokhov commit 3ff7ddb1353da9b535e65702704cbadea1da9a00 Author: Pablo Neira Ayuso Date: Fri Apr 24 21:55:37 2020 +0200 netfilter: nft_nat: add netmap support This patch allows you to NAT the network address prefix onto another network address prefix, a.k.a. netmapping. Userspace must specify the NF_NAT_RANGE_NETMAP flag and the prefix address through the NFTA_NAT_REG_ADDR_MIN and NFTA_NAT_REG_ADDR_MAX netlink attributes. Signed-off-by: Pablo Neira Ayuso commit acd766e31bb96b90c2dc4954f86e573c9ac16c66 Author: Pablo Neira Ayuso Date: Fri Apr 24 21:55:36 2020 +0200 netfilter: nft_nat: add helper function to set up NAT address and protocol This patch add nft_nat_setup_addr() and nft_nat_setup_proto() to set up the NAT mangling. Signed-off-by: Pablo Neira Ayuso commit 4566aa440008103c9bd364f38c03ca5309acc8f4 Author: Pablo Neira Ayuso Date: Fri Apr 24 21:55:35 2020 +0200 netfilter: nft_nat: set flags from initialization path This patch sets the NAT flags from the control plane path. Signed-off-by: Pablo Neira Ayuso commit 0d7c83463fdf7841350f37960a7abadd3e650b41 Author: Pablo Neira Ayuso Date: Fri Apr 24 21:55:34 2020 +0200 netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported Instead of EINVAL which should be used for malformed netlink messages. Fixes: eb31628e37a0 ("netfilter: nf_tables: Add support for IPv6 NAT") Signed-off-by: Pablo Neira Ayuso commit 9d2161bed4e39ef7a5e5f18f69c4a57d001051b9 Author: Richard Guy Briggs Date: Wed Apr 22 17:37:04 2020 -0400 audit: log audit netlink multicast bind and unbind Log information about programs connecting to and disconnecting from the audit netlink multicast socket. This is needed so that during investigations a security officer can tell who or what had access to the audit trail. This helps to meet the FAU_SAR.2 requirement for Common Criteria. Here is the systemd startup event: type=PROCTITLE msg=audit(2020-04-22 10:10:21.787:10) : proctitle=/init type=SYSCALL msg=audit(2020-04-22 10:10:21.787:10) : arch=x86_64 syscall=bind success=yes exit=0 a0=0x19 a1=0x555f4aac7e90 a2=0xc a3=0x7ffcb792ff44 items=0 ppid=0 pid=1 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=systemd exe=/usr/lib/systemd/systemd subj=kernel key=(null) type=UNKNOWN[1335] msg=audit(2020-04-22 10:10:21.787:10) : pid=1 uid=root auid=unset tty=(none) ses=unset subj=kernel comm=systemd exe=/usr/lib/systemd/systemd nl-mcgrp=1 op=connect res=yes And events from the test suite that just uses close(): type=PROCTITLE msg=audit(2020-04-22 11:47:08.501:442) : proctitle=/usr/bin/perl -w amcast_joinpart/test type=SYSCALL msg=audit(2020-04-22 11:47:08.501:442) : arch=x86_64 syscall=bind success=yes exit=0 a0=0x7 a1=0x563004378760 a2=0xc a3=0x0 items=0 ppid=815 pid=818 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=ttyS0 ses=1 comm=perl exe=/usr/bin/perl subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) type=UNKNOWN[1335] msg=audit(2020-04-22 11:47:08.501:442) : pid=818 uid=root auid=root tty=ttyS0 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 comm=perl exe=/usr/bin/perl nl-mcgrp=1 op=connect res=yes type=UNKNOWN[1335] msg=audit(2020-04-22 11:47:08.501:443) : pid=818 uid=root auid=root tty=ttyS0 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 comm=perl exe=/usr/bin/perl nl-mcgrp=1 op=disconnect res=yes And the events from the test suite using setsockopt with NETLINK_DROP_MEMBERSHIP: type=PROCTITLE msg=audit(2020-04-22 11:39:53.291:439) : proctitle=/usr/bin/perl -w amcast_joinpart/test type=SYSCALL msg=audit(2020-04-22 11:39:53.291:439) : arch=x86_64 syscall=bind success=yes exit=0 a0=0x7 a1=0x5560877c2d20 a2=0xc a3=0x0 items=0 ppid=772 pid=775 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=ttyS0 ses=1 comm=perl exe=/usr/bin/perl subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) type=UNKNOWN[1335] msg=audit(2020-04-22 11:39:53.291:439) : pid=775 uid=root auid=root tty=ttyS0 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 comm=perl exe=/usr/bin/perl nl-mcgrp=1 op=connect res=yes type=PROCTITLE msg=audit(2020-04-22 11:39:53.292:440) : proctitle=/usr/bin/perl -w amcast_joinpart/test type=SYSCALL msg=audit(2020-04-22 11:39:53.292:440) : arch=x86_64 syscall=setsockopt success=yes exit=0 a0=0x7 a1=SOL_NETLINK a2=0x2 a3=0x7ffc8366f000 items=0 ppid=772 pid=775 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=ttyS0 ses=1 comm=perl exe=/usr/bin/perl subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) type=UNKNOWN[1335] msg=audit(2020-04-22 11:39:53.292:440) : pid=775 uid=root auid=root tty=ttyS0 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 comm=perl exe=/usr/bin/perl nl-mcgrp=1 op=disconnect res=yes Please see the upstream issue tracker at https://github.com/linux-audit/audit-kernel/issues/28 With the feature description at https://github.com/linux-audit/audit-kernel/wiki/RFE-Audit-Multicast-Socket-Join-Part The testsuite support is at https://github.com/rgbriggs/audit-testsuite/compare/ghak28-mcast-part-join https://github.com/linux-audit/audit-testsuite/pull/93 And the userspace support patch is at https://github.com/linux-audit/audit-userspace/pull/114 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit ea941016abf7e6f81b130f8eb792e9ad0971237a Author: André Almeida Date: Sun Apr 19 02:01:48 2020 -0300 scsi: core: doc: Change function comments to kernel-doc style Despite of functions being documented, they are not in the kernel-doc specification, and could not be included in kernel documentation. Change the style of functions comments to be compliant to the kernel-doc style. When the function comments are outdated, update then. [mkp: a few edits] Link: https://lore.kernel.org/r/20200419050148.33371-1-andrealmeid@collabora.com Signed-off-by: André Almeida Signed-off-by: Martin K. Petersen commit 04ee8a01abf8aa89d1bcdacffefc9a8879336a2c Author: Asutosh Das Date: Wed Apr 22 14:41:44 2020 -0700 scsi: ufs-qcom: Configure write booster type Enable WriteBooster for Qualcomm platform. Link: https://lore.kernel.org/r/cd4cf745ea0b3a59c2075036e17316b97494fe65.1587591527.git.asutoshd@codeaurora.org Reviewed-by: Avri Altman Signed-off-by: Asutosh Das Signed-off-by: Martin K. Petersen commit c14e7adf3a6a8d0ce4d16f839f9737ad3481e239 Author: Asutosh Das Date: Wed Apr 22 14:41:43 2020 -0700 scsi: ufs: sysfs: Add sysfs entries for write booster Adds unit, device, geometry descriptor sysfs entries. Adds flags sysfs entries for write booster. Link: https://lore.kernel.org/r/98987ef17844292bd42c57613990a3a26c6de2b8.1587591527.git.asutoshd@codeaurora.org Reviewed-by: Avri Altman Signed-off-by: Asutosh Das Signed-off-by: Martin K. Petersen commit 3d17b9b5ab11556b2fea07d4f24154095a685ad2 Author: Asutosh Das Date: Wed Apr 22 14:41:42 2020 -0700 scsi: ufs: Add write booster feature support The write performance of TLC NAND is considerably lower than SLC NAND. Using SLC NAND as a WriteBooster Buffer enables the write request to be processed with lower latency and improves the overall write performance. Adds support for shared-buffer mode WriteBooster. WriteBooster enable: SW enables it when clocks are scaled up, thus it's enabled only in high load conditions. WriteBooster disable: SW will disable the feature, when clocks are scaled down. Thus writes would go as normal writes. To keep the endurance of the WriteBooster Buffer at a maximum, this load-based toggling is adopted. Link: https://lore.kernel.org/r/2871444d9083b0e9323ef6d8ff1b544b7784adc9.1587591527.git.asutoshd@codeaurora.org Reviewed-by: Avri Altman Signed-off-by: Asutosh Das Signed-off-by: Subhash Jadavani Signed-off-by: Martin K. Petersen commit 7dfdcc393dcdd63f4ea15d06c97a719451cfbb77 Author: Jason Yan Date: Sun Apr 26 17:43:05 2020 +0800 scsi: ufs: Use true for bool variables in ufshcd_complete_dev_init() Fix the following coccicheck warning: drivers/scsi/ufs/ufshcd.c:4140:6-14: WARNING: Assignment of 0/1 to bool variable. Link: https://lore.kernel.org/r/20200426094305.24083-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 655da8e57a46c009a07373c4fdcf9221b5a9b9a6 Author: Bart Van Assche Date: Sun Apr 26 18:48:44 2020 -0700 scsi: sr: Use {get,put}_unaligned_be*() instead of open-coding these functions This patch makes the sr code slightly easier to read. Link: https://lore.kernel.org/r/20200427014844.12109-1-bvanassche@acm.org Cc: Merlijn Wajer Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit f7854c382240c1686900b2f098b36430c6f5047e Author: Christophe JAILLET Date: Sun Apr 12 11:40:39 2020 +0200 scsi: aacraid: Fix error handling paths in aac_probe_one() If 'scsi_host_alloc()' or 'kcalloc()' fail, 'error' is known to be 0. Set it explicitly to -ENOMEM before branching to the error handling path. While at it, remove 2 useless assignments to 'error'. These values are overwridden a few lines later. Link: https://lore.kernel.org/r/20200412094039.8822-1-christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 182e073f68a080a29920f6dca796ccf4806b0329 Author: Ethon Paul Date: Sat Apr 18 00:40:04 2020 +0800 cpu/hotplug: Fix a typo in comment "broadacasted"->"broadcasted" Signed-off-by: Ethon Paul Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200417164008.6541-1-ethp@qq.com commit 2ac757e4152e3322a04a6dfb3d1fa010d3521abf Author: Wei Yongjun Date: Mon Apr 27 09:33:43 2020 +0000 net: ethernet: ti: fix return value check in k3_cppi_desc_pool_create_name() In case of error, the function gen_pool_create() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 0c2006b29e5f62784c70209e71da7876267e0e2d Author: Heiner Kallweit Date: Mon Apr 27 21:07:00 2020 +0200 r8169: improve error message if no dedicated PHY driver is found There's a number of consumer mainboards where the BIOS leaves the PHY in a state that it's reporting an invalid PHY ID. To detect such cases add the PHY ID to the error message if no dedicated PHY driver is found. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 8c1b2bf16d5944cd5c3a8a72e24ed9e22360c1af Author: Christoph Hellwig Date: Fri Apr 24 08:43:34 2020 +0200 bpf, cgroup: Remove unused exports Except for a few of the networking hooks called from modular ipv4 or ipv6 code, all of hooks are just called from guaranteed to be built-in code. Signed-off-by: Christoph Hellwig Signed-off-by: Daniel Borkmann Acked-by: Andrey Ignatov Link: https://lore.kernel.org/bpf/20200424064338.538313-2-hch@lst.de commit fdb9c405e35bdc6e305b9b4e20ebc141ed14fc81 Author: Pablo Neira Ayuso Date: Fri Apr 24 21:55:33 2020 +0200 netfilter: nf_tables: allow up to 64 bytes in the set element data area So far, the set elements could store up to 128-bits in the data area. Signed-off-by: Pablo Neira Ayuso commit d308a881a5917bdb46472c861a1dabe54b46c423 Author: Lyude Paul Date: Fri Apr 24 14:13:08 2020 -0400 drm/dp_mst: Kill the second sideband tx slot, save the world While we support using both tx slots for sideband transmissions, it appears that DisplayPort devices in the field didn't end up doing a very good job of supporting it. From section 5.2.1 of the DP 2.0 specification: There are MST Sink/Branch devices in the field that do not handle interleaved message transactions. To facilitate message transaction handling by downstream devices, an MST Source device shall generate message transactions in an atomic manner (i.e., the MST Source device shall not concurrently interleave multiple message transactions). Therefore, an MST Source device shall clear the Message_Sequence_No value in the Sideband_MSG_Header to 0. This might come as a bit of a surprise since the vast majority of hubs will support using both tx slots even if they don't support interleaved message transactions, and we've also been using both tx slots since MST was introduced into the kernel. However, there is one device we've had trouble getting working consistently with MST for so long that we actually assumed it was just broken: the infamous Dell P2415Qb. Previously this monitor would appear to work sometimes, but in most situations would end up timing out LINK_ADDRESS messages almost at random until you power cycled the whole display. After reading section 5.2.1 in the DP 2.0 spec, some closer investigation into this infamous display revealed it was only ever timing out on sideband messages in the second TX slot. Sure enough, avoiding the second TX slot has suddenly made this monitor function perfectly for the first time in five years. And since they explicitly mention this in the specification, I doubt this is the only monitor out there with this issue. This might even explain explain the seemingly harmless garbage sideband responses we would occasionally see with MST hubs! So - rewrite our sideband TX handlers to only support one TX slot. In order to simplify our sideband handling now that we don't support transmitting to multiple MSTBs at once, we also move all state tracking for down replies from mstbs to the topology manager. Signed-off-by: Lyude Paul Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)") Cc: Sean Paul Cc: "Lin, Wayne" Cc: # v3.17+ Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200424181308.770749-1-lyude@redhat.com commit a21643cf569b74039cd5e8a1ecbf33c7d17d9486 Merge: 19f1f467bc5e e73f94d1b6f0 Author: David S. Miller Date: Mon Apr 27 13:04:18 2020 -0700 Merge tag 'batadv-next-for-davem-20200427' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - fix spelling error, by Sven Eckelmann - drop unneeded types.h include, by Sven Eckelmann - change random number generation to prandom_u32_max(), by Sven Eckelmann - remove unused function batadv_arp_change_timeout(), by Yue Haibing ==================== Signed-off-by: David S. Miller commit 46501bc35b7186a939edce15d3bc9ca2a38115b6 Author: Jason Yan Date: Mon Apr 27 14:37:26 2020 +0800 drm/amd/display: remove conversion to bool in dc_link_ddc.c The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c:602:28-33: WARNING: conversion to bool not needed here Reviewed-by: Christian König Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit 2367cad7599f40d87cbec0aaf06f3709ea75082e Author: Jason Yan Date: Mon Apr 27 14:37:14 2020 +0800 drm/amd/display: remove conversion to bool in dcn20_mpc.c The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c:455:70-75: WARNING: conversion to bool not needed here Reviewed-by: Christian König Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit b6e79d9a314ebe5fc44f882c607869d8f7ffb4a1 Author: Jason Yan Date: Mon Apr 27 14:36:55 2020 +0800 drm/amdgpu: remove conversion to bool in amdgpu_device.c The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3004:68-73: WARNING: conversion to bool not needed here Reviewed-by: Christian König Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit fd90456c757da8bcb75dd0d9221581008c01e380 Author: Guchun Chen Date: Sun Apr 26 17:04:31 2020 +0800 drm/amdgpu: decouple EccErrCnt query and clear operation Due to hardware bug that when RSMU UMC index is disabled, clear EccErrCnt at the first UMC instance will clean up all other EccErrCnt registes from other instances at the same time. This will break the correctable error count log in EccErrCnt register once querying it. So decouple both to make error count query workable. Signed-off-by: Guchun Chen Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 40e733147fe06bc2d87abd3207468b2ca549f4ac Author: Guchun Chen Date: Sun Apr 26 16:44:16 2020 +0800 drm/amdgpu: switch to SMN interface to operate RSMU index mode This makes consistent with other regsiters' access in this module. Signed-off-by: Guchun Chen Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit fde812b32c1e3f24da305aa5e761840c2460974b Author: Evan Quan Date: Fri Apr 24 15:36:22 2020 +0800 drm/amdgpu: drop redundant cg/pg ungate on runpm enter CG/PG ungate is already performed in ip_suspend_phase1. Otherwise, the CG/PG ungate will be performed twice. That will cause gfxoff disablement is performed twice also on runpm enter while gfxoff enablemnt once on rump exit. That will put gfxoff into disabled state. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 94fa56605866282512a7589e22f47195cdcc5cf8 Author: Evan Quan Date: Fri Apr 24 15:32:41 2020 +0800 drm/amdgpu: move kfd suspend after ip_suspend_phase1 This sequence change should be safe as what did in ip_suspend_phase1 is to suspend DCE only. And this is a prerequisite for coming redundant cg/pg ungate dropping. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit dfe31f255fd62655de63ecc45b0e5d1b0504eabb Author: Jonathan Kim Date: Fri Apr 24 18:16:06 2020 -0400 drm/amdgpu: sw pstate switch should only be for vega20 Driver steered p-state switching is designed for Vega20 only. Also simplify early return for temporary disable due to SMU FW bug. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d18ba57c725e71b612f195e527f202a182649595 Author: Zheng Bin Date: Fri Apr 24 15:56:20 2020 +0800 drm/amdgpu: Remove unneeded semicolon Fixes coccicheck warning: drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:2534:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Alex Deucher Reviewed-by: Christian König commit 19f1f467bc5e9874ade015374d8f11a14abb2b3a Merge: 6488f11f39cf 075c8aa79d54 Author: David S. Miller Date: Mon Apr 27 12:43:30 2020 -0700 Merge branch 'mlxsw-Rework-matchall-offloading-plumbing' Ido Schimmel says: ==================== mlxsw: Rework matchall offloading plumbing Jiri says: Currently the matchall and flower are handled by registering separate callbacks in mlxsw. That leads to faulty indication "in_hw_count 2" in filter show command for every inserted flower filter. That happens because matchall callback just blindly returns 0 for it and it is wrongly accounted for as "the offloader". I inspected different ways to fix this problem. The only clean solution is to rework handling of matchall in mlxsw a bit. The driver newely registers one callback for bound block which is called for both matchall and flower filter insertions. On the way, iron out the matchall code a bit, push it into a separate file etc. ==================== Signed-off-by: David S. Miller commit 075c8aa79d541ea08c67a2e6d955f6457e98c21c Author: Jiri Pirko Date: Mon Apr 27 18:13:10 2020 +0300 selftests: forwarding: tc_actions.sh: add matchall mirror test Add test for matchall classifier with mirred egress mirror action. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 19f06771ca3dd8346972bc7627f9bcb7b6a8ce0b Author: Jiri Pirko Date: Mon Apr 27 18:13:09 2020 +0300 mlxsw: spectrum: Move flow offload binding into spectrum_flow.c Move the code taking case of setup of flow offload into spectrum_flow.c Do small renaming of callbacks on the way. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3c650136afba8233e738849149b578d0ad6d2023 Author: Jiri Pirko Date: Mon Apr 27 18:13:08 2020 +0300 mlxsw: spectrum_matchall: Process matchall events from the same cb as flower Currently there are two callbacks registered: one for matchall, one for flower. This causes the user to see "in_hw_count 2" in TC filter dump. Because of this and also as a preparation for future matchall offload for rules equivalent to flower-all-match, move the processing of shared block into matchall.c. Leave only one cb for mlxsw driver per-block. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 481ff57aadf5ea36bb3c5a9e659a2e1c5ecc6725 Author: Jiri Pirko Date: Mon Apr 27 18:13:07 2020 +0300 mlxsw: spectrum: Avoid copying sample values and use RCU pointer direcly instead Currently, only the psample_group is accessed using RCU on RX path. However, it is possible (unlikely) that other sample values get change during RX processing. Fix this by having the port->sample struct accessed as RCU pointer, containing all sample values including psample_group pointer. That avoids extra alloc per-port, copying the values and the race condition described above. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit dd0fbc89d274e392a077c5dc9a21d581de3252d1 Author: Jiri Pirko Date: Mon Apr 27 18:13:06 2020 +0300 mlxsw: spectrum_matchall: Push per-port rule add/del into separate functions As the replace/destroy is going to be used later on per-block, push the per-port rule addition/deletion into separate functions. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 47fa15eae487f3f454d004894671ebea53e77bde Author: Jiri Pirko Date: Mon Apr 27 18:13:05 2020 +0300 mlxsw: spectrum_matchall: Move ingress indication into mall_entry Instead of having it in mirror_entry structure, move it to mall_entry and set it during rule insertion. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c7ea0e162fc84602fde67d41edf72ae3f4f4a14f Author: Jiri Pirko Date: Mon Apr 27 18:13:04 2020 +0300 mlxsw: spectrum_matchall: Pass mall_entry as arg to mlxsw_sp_mall_port_sample_add() In the preparation for future changes, have the mlxsw_sp_mall_port_sample_add() function to accept mall_entry including all needed info originally obtained from cls and act pointers. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 780ba878a1b024e176dc27c980e1600a23d7b5c5 Author: Jiri Pirko Date: Mon Apr 27 18:13:03 2020 +0300 mlxsw: spectrum_matchall: Pass mall_entry as arg to mlxsw_sp_mall_port_mirror_add() In the preparation for future changes, have the mlxsw_sp_mall_port_mirror_add() function to accept mall_entry including the "to_dev" originally obtained from act pointer. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 6c8cd435b58780ded6e3e06d722249ec181efb36 Author: Jiri Pirko Date: Mon Apr 27 18:13:02 2020 +0300 mlxsw: spectrum_acl: Use block variable in mlxsw_sp_acl_rule_del() On couple of places in mlxsw_sp_acl_rule_del(), block variable is not used directly as it could be. So do it. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d7fcc986224d77c4ab66f436e7eaa11170c509af Author: Jiri Pirko Date: Mon Apr 27 18:13:01 2020 +0300 mlxsw: spectrum: Push matchall bits into a separate file Similar to flower, have matchall related code in a separate file. Do some small renaming on the way (consistent "mall" prefixes, dropped "_tc_", dropped "_port_" where suitable). Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d52238eb7bcf53225841217af12fe1383205fcaa Author: Jiri Pirko Date: Mon Apr 27 18:13:00 2020 +0300 mlxsw: spectrum: Push flow_block related functions into a separate file The code around flow_block is currently mixed in spectrum_acl.c. However, as it really does not directly relate to ACL part only, push the bits into a separate file. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3bc3ffb6e911f9de099d81187ae99b45966cbd05 Author: Jiri Pirko Date: Mon Apr 27 18:12:59 2020 +0300 mlxsw: spectrum: Rename acl_block to flow_block The acl_block structure is going to be used for non-acl case - matchall offload. So rename it accordingly. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 49c958ccd2433114ca8a96c996b5016aa89c7ba5 Author: Jiri Pirko Date: Mon Apr 27 18:12:58 2020 +0300 mlxsw: spectrum_acl: Move block helpers into inline header functions The struct is defined in the header, no need to have the helpers in the c file. Move the helpers to the header. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit de70083cbaabb86c282f421b070b041236ba6f4b Author: Johan Jonker Date: Fri Apr 24 17:56:00 2020 +0200 arm64: dts: rockchip: remove #sound-dai-cells from &spdif node of rk3399-hugsun-x99.dts The '#sound-dai-cells' property is already defined in rk3399.dtsi at the 'spdif' node, so remove it from the '&spdif' node in 'rk3399-hugsun-x99.dts'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200424155600.24254-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit e565dd298c6bc9f53f0b07d96b019e000777c1fe Author: Johan Jonker Date: Fri Apr 24 17:55:59 2020 +0200 arm64: dts: rockchip: remove #sound-dai-cells from &i2s1 node of rk3399-pinebook-pro.dts The '#sound-dai-cells' property is already defined in rk3399.dtsi at the 'i2s1' node, so remove it from the '&i2s1' node in 'rk3399-pinebook-pro.dts'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200424155600.24254-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 611e22b1d9f61a8742c99433de9ff40795574c61 Author: Zheng Bin Date: Fri Apr 24 15:44:10 2020 +0800 drm/rockchip: Remove unneeded semicolon Fixes coccicheck warning: drivers/gpu/drm/rockchip/cdn-dp-reg.c:604:2-3: Unneeded semicolon drivers/gpu/drm/rockchip/cdn-dp-reg.c:622:2-3: Unneeded semicolon drivers/gpu/drm/rockchip/cdn-dp-reg.c:703:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20200424074410.1070-1-zhengbin13@huawei.com commit 7c49abb4c2f8853520abc05b7f7e8b751fbb3086 Author: Enric Balletbo i Serra Date: Sun Apr 26 18:16:53 2020 +0200 drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static This fixes the following warning detected when running make with W=1 drivers/gpu/drm/rockchip//cdn-dp-core.c:1112:5: warning: no previous prototype for ‘cdn_dp_suspend’ [-Wmissing-prototypes] drivers/gpu/drm/rockchip//cdn-dp-core.c:1126:5: warning: no previous prototype for ‘cdn_dp_resume’ [-Wmissing-prototypes] Signed-off-by: Enric Balletbo i Serra Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20200426161653.7710-1-enric.balletbo@collabora.com commit 6488f11f39cfaefae3f924867d78cbea747dc59e Merge: 45c9cbec425c 10478283f210 Author: David S. Miller Date: Mon Apr 27 11:48:47 2020 -0700 Merge branch 'r8169-improve-chip-config-handling' Heiner Kallweit says: ==================== r8169: improve chip config handling Series includes two improvements for chip configuration handling. ==================== Signed-off-by: David S. Miller commit 10478283f210e64ac682083083437dd5f89b7c4a Author: Heiner Kallweit Date: Sun Apr 26 23:36:56 2020 +0200 r8169: improve configuring RxConfig register Two bits in RxConfig are controlled by the following dev->feature's: - NETIF_F_RXALL - NETIF_F_HW_VLAN_CTAG_RX (since RTL8125) We have to take care that RxConfig gets fully configured in rtl_hw_start() after e.g. resume from hibernation. Therefore: - Factor out setting the feature-controlled RxConfig bits to a new function rtl_set_rx_config_features() that is called from rtl8169_set_features() and rtl_hw_start(). - Don't deal with RX_VLAN_8125 in rtl_init_rxcfg(), it will be set by rtl_set_rx_config_features(). - Don't handle NETIF_F_RXALL in rtl_set_rx_mode(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 975e8505e6701c77b43bcdd5acc48d3735063b68 Author: Heiner Kallweit Date: Sun Apr 26 23:35:59 2020 +0200 r8169: improve handling CPCMD_MASK It's sufficient to do the masking once in probe() for clearing unwanted bits that may have been set by the BIOS. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3798cc4d106e91382bfe016caa2edada27c2bb3f Author: Josh Poimboeuf Date: Mon Apr 27 20:46:13 2020 +0200 x86/speculation: Add Ivy Bridge to affected list Make the docs match the code. Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner commit e145d9a184f23639edc864e2fa08fcc1853361a4 Author: Akash Asthana Date: Wed Apr 15 15:53:10 2020 +0530 interconnect: Add devm_of_icc_get() as exported API for users Users can use devm version of of_icc_get() to benefit from automatic resource release. Signed-off-by: Akash Asthana Reviewed by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1586946198-13912-2-git-send-email-akashast@codeaurora.org Signed-off-by: Georgi Djakov commit 45c9cbec425c65f89d610993605933ceaa8add87 Merge: 7d3118016787 419dba8a49d7 Author: David S. Miller Date: Mon Apr 27 11:40:25 2020 -0700 Merge branch 'net-bridge-mrp' Horatiu Vultur says: ==================== net: bridge: mrp: Add support for Media Redundancy Protocol(MRP) Media Redundancy Protocol is a data network protocol standardized by International Electrotechnical Commission as IEC 62439-2. It allows rings of Ethernet switches to overcome any single failure with recovery time faster than STP. It is primarily used in Industrial Ethernet applications. Based on the previous RFC[1][2][3][4][5], and patches[6][7][8], the MRP state machine and all the timers were moved to userspace, except for the timers used to generate MRP Test frames. In this way the userspace doesn't know and should not know if the HW or the kernel will generate the MRP Test frames. The following changes were added to the bridge to support the MRP: - the existing netlink interface was extended with MRP support, - allow to detect when a MRP frame was received on a MRP ring port - allow MRP instance to forward/terminate MRP frames - generate MRP Test frames in case the HW doesn't have support for this To be able to offload MRP support to HW, the switchdev API was extend. With these changes the userspace doesn't do the following because already the kernel/HW will do: - doesn't need to forward/terminate MRP frames - doesn't need to generate MRP Test frames - doesn't need to detect when the ring is open/closed. The userspace application that is using the new netlink can be found here[9]. The current implementation both in kernel and userspace supports only 2 roles: MRM - this one is responsible to send MRP_Test and MRP_Topo frames on both ring ports. It needs to process MRP_Test to know if the ring is open or closed. This operation is desired to be offloaded to the HW because it requires to generate and process up to 4000 frames per second. Whenever it detects that the ring is open it sends MRP_Topo frames to notify all MRC about changes in the topology. MRM needs also to process MRP_LinkChange frames, these frames are generated by the MRC. When the ring is open then the state of both ports is to forward frames and when the ring is closed then the secondary port is blocked. MRC - this one is responsible to forward MRP frames between the ring ports. In case one of the ring ports gets a link down or up, then MRC will generate a MRP_LinkChange frames. This node should also process MRP_Topo frames and to clear its FDB when it receives this frame. Userspace Deamon +----------+ Client + | +--------------|-----------------------------------------+ Kernel | + Netlink | + Interrupt | | +--------------|------------------------------|----------+ HW | Switchdev | + | The user interacts using the client (called 'mrp'), the client talks to the deamon (called 'mrp_server'), which talks with the kernel using netlink. The kernel will try to offload the requests to the HW via switchdev API. If this will be accepted then in the future the netlink interface can be expended with multiple attributes which are required by different roles of the MRP. Like Media Redundancy Automanager(MRA), Media Interconnect Manager(MIM) and Media Interconnect Client(MIC). [1] https://www.spinics.net/lists/netdev/msg623647.html [2] https://www.spinics.net/lists/netdev/msg624378.html [3] https://www.spinics.net/lists/netdev/msg627500.html [4] https://www.spinics.net/lists/netdev/msg641005.html [5] https://www.spinics.net/lists/netdev/msg643991.html [6] https://www.spinics.net/lists/netdev/msg645378.html [7] https://www.spinics.net/lists/kernel/msg3484685.html [8] https://www.spinics.net/lists/netdev/msg646202.html [9] https://github.com/microchip-ung/mrp/tree/patch-v9 -v4: - fix comments in br_mrp.c - use skb_header_pointer to get br_mrp_tlv_hdr - fix line over 80 characters -v3: - fix unused variables -v2: - drop patch 4 - add port flag BR_MRP_LOST_CONT; - another fix for bisectability -v1: - fix bisectability issues - in case of errors use extack -RFC v5: - use nla_parse_nested - rework the usage of the rcu in br_mrp - reorder patches - few other small issues raised by Nikolay -RFC v4: - extend existing netlink interface to add mrp support - use rcu locks -RFC v3: - move MRP state machine in userspace - create generic netlink interface for configuring the HW using switchdev API -RFC v2: - extend switchdev API to offload to HW ==================== Signed-off-by: David S. Miller commit 419dba8a49d7cc355e5b495d20dea8217369ed63 Author: Horatiu Vultur Date: Sun Apr 26 15:22:08 2020 +0200 net: bridge: Add checks for enabling the STP. It is not possible to have the MRP and STP running at the same time on the bridge, therefore add check when enabling the STP to check if MRP is already enabled. In that case return error. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 6536993371fab3de4e8379649b60e94d03e6ff37 Author: Horatiu Vultur Date: Sun Apr 26 15:22:07 2020 +0200 bridge: mrp: Integrate MRP into the bridge To integrate MRP into the bridge, the bridge needs to do the following: - detect if the MRP frame was received on MRP ring port in that case it would be processed otherwise just forward it as usual. - enable parsing of MRP - before whenever the bridge was set up, it would set all the ports in forwarding state. Add an extra check to not set ports in forwarding state if the port is an MRP ring port. The reason of this change is that if the MRP instance initially sets the port in blocked state by setting the bridge up it would overwrite this setting. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 4d02b8f075153508562803e590f76c4dfe5f4b66 Author: Horatiu Vultur Date: Sun Apr 26 15:22:06 2020 +0200 bridge: mrp: Implement netlink interface to configure MRP Implement netlink interface to configure MRP. The implementation will do sanity checks over the attributes and then eventually call the MRP interface. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 9a9f26e8f7ea300e8efffcae036dbef239be433a Author: Horatiu Vultur Date: Sun Apr 26 15:22:05 2020 +0200 bridge: mrp: Connect MRP API with the switchdev API Implement the MRP API. In case the HW can't generate MRP Test frames then the SW will try to generate the frames. In case that also the SW will fail in generating the frames then a error is return to the userspace. The userspace is responsible to generate all the other MRP frames regardless if the test frames are generated by HW or SW. The forwarding/termination of MRP frames is happening in the kernel and is done by the MRP instance. The userspace application doesn't do the forwarding. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit fadd409136f0f21192d80816edd9529f27d88c17 Author: Horatiu Vultur Date: Sun Apr 26 15:22:04 2020 +0200 bridge: switchdev: mrp: Implement MRP API for switchdev Implement the MRP api for switchdev. These functions will just eventually call the switchdev functions: switchdev_port_obj_add/del and switchdev_port_attr_set. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit c284b54590083017193a836362daa4489e782028 Author: Horatiu Vultur Date: Sun Apr 26 15:22:03 2020 +0200 switchdev: mrp: Extend switchdev API to offload MRP Extend switchdev API to add support for MRP. The HW is notified in following cases: SWITCHDEV_OBJ_ID_MRP: This is used when a MRP instance is added/removed from the MRP ring. SWITCHDEV_OBJ_ID_RING_ROLE_MRP: This is used when the role of the node changes. The current supported roles are MRM and MRC. SWITCHDEV_OBJ_ID_RING_TEST_MRP: This is used when to start/stop sending MRP_Test frames on the mrp ring ports. This is called only on nodes that have the role MRM. In case this fails then the SW will generate the frames. SWITCHDEV_OBJ_ID_RING_STATE_STATE: This is used when the ring changes it states to open or closed. This is required to notify HW because the MRP_Test frame contains the field MRP_InState which contains this information. SWITCHDEV_ATTR_ID_MRP_PORT_STATE: This is used when the port's state is changed. It can be in blocking/forwarding mode. SWITCHDEV_ATTR_ID_MRP_PORT_ROLE: This is used when port's role changes. The roles of the port can be primary/secondary. This is required to notify HW because the MRP_Test frame contains the field MRP_PortRole that contains this information. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2f1a11ae11d222b3a3b41d09a85cb2bf8f83db49 Author: Horatiu Vultur Date: Sun Apr 26 15:22:02 2020 +0200 bridge: mrp: Add MRP interface. Define the MRP interface. This interface is used by the netlink to update the MRP instances and by the MRP to make the calls to switchdev to offload it to HW. It defines an MRP instance 'struct br_mrp' which is a list of MRP instances. Which will be part of the 'struct net_bridge'. Each instance has 2 ring ports, a bridge and an ID. In case the HW can't generate MRP Test frames then the SW will generate those. br_mrp_add - adds a new MRP instance. br_mrp_del - deletes an existing MRP instance. Each instance has an ID(ring_id). br_mrp_set_port_state - changes the port state. The port can be in forwarding state, which means that the frames can pass through or in blocked state which means that the frames can't pass through except MRP frames. This will eventually call the switchdev API to notify the HW. This information is used also by the SW bridge to know how to forward frames in case the HW doesn't have this capability. br_mrp_set_port_role - a port role can be primary or secondary. This information is required to be pushed to HW in case the HW can generate MRP_Test frames. Because the MRP_Test frames contains a file with this information. Otherwise the HW will not be able to generate the frames correctly. br_mrp_set_ring_state - a ring can be in state open or closed. State open means that the mrp port stopped receiving MRP_Test frames, while closed means that the mrp port received MRP_Test frames. Similar with br_mrp_port_role, this information is pushed in HW because the MRP_Test frames contain this information. br_mrp_set_ring_role - a ring can have the following roles MRM or MRC. For the role MRM it is expected that the HW can terminate the MRP frames, notify the SW that it stopped receiving MRP_Test frames and trapp all the other MRP frames. While for MRC mode it is expected that the HW can forward the MRP frames only between the MRP ports and copy MRP_Topology frames to CPU. In case the HW doesn't support a role it needs to return an error code different than -EOPNOTSUPP. br_mrp_start_test - this starts/stops the generation of MRP_Test frames. To stop the generation of frames the interval needs to have a value of 0. In this case the userspace needs to know if the HW supports this or not. Not to have duplicate frames(generated by HW and SW). Because if the HW supports this then the SW will not generate anymore frames and will expect that the HW will notify when it stopped receiving MRP frames using the function br_mrp_port_open. br_mrp_port_open - this function is used by drivers to notify the userspace via a netlink callback that one of the ports stopped receiving MRP_Test frames. This function is called only when the node has the role MRM. It is not supposed to be called from userspace. br_mrp_port_switchdev_add - this corresponds to the function br_mrp_add, and will notify the HW that a MRP instance is added. The function gets as parameter the MRP instance. br_mrp_port_switchdev_del - this corresponds to the function br_mrp_del, and will notify the HW that a MRP instance is removed. The function gets as parameter the ID of the MRP instance that is removed. br_mrp_port_switchdev_set_state - this corresponds to the function br_mrp_set_port_state. It would notify the HW if it should block or not non-MRP frames. br_mrp_port_switchdev_set_port - this corresponds to the function br_mrp_set_port_role. It would set the port role, primary or secondary. br_mrp_switchdev_set_role - this corresponds to the function br_mrp_set_ring_role and would set one of the role MRM or MRC. br_mrp_switchdev_set_ring_state - this corresponds to the function br_mrp_set_ring_state and would set the ring to be open or closed. br_mrp_switchdev_send_ring_test - this corresponds to the function br_mrp_start_test. This will notify the HW to start or stop generating MRP_Test frames. Value 0 for the interval parameter means to stop generating the frames. br_mrp_port_open - this function is used to notify the userspace that the port lost the continuity of MRP Test frames. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 3e54442c93845316762b1b3c75e654463fd1b715 Author: Horatiu Vultur Date: Sun Apr 26 15:22:01 2020 +0200 net: bridge: Add port attribute IFLA_BRPORT_MRP_RING_OPEN This patch adds a new port attribute, IFLA_BRPORT_MRP_RING_OPEN, which allows to notify the userspace when the port lost the continuite of MRP frames. This attribute is set by kernel whenever the SW or HW detects that the ring is being open or closed. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 4b8d7d4c599182393421c190bae3604b4db9629a Author: Horatiu Vultur Date: Sun Apr 26 15:22:00 2020 +0200 bridge: mrp: Extend bridge interface To integrate MRP into the bridge, first the bridge needs to be aware of ports that are part of an MRP ring and which rings are on the bridge. Therefore extend bridge interface with the following: - add new flag(BR_MPP_AWARE) to the net bridge ports, this bit will be set when the port is added to an MRP instance. In this way it knows if the frame was received on MRP ring port - add new flag(BR_MRP_LOST_CONT) to the net bridge ports, this bit will be set when the port lost the continuity of MRP Test frames. - add a list of MRP instances Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2cc974f83fb505751b7fbcf8dee27bdcc7054a7e Author: Horatiu Vultur Date: Sun Apr 26 15:21:59 2020 +0200 bridge: mrp: Update Kconfig Add the option BRIDGE_MRP to allow to build in or not MRP support. The default value is N. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 4714d13791f831d253852c8b5d657270becb8b2a Author: Horatiu Vultur Date: Sun Apr 26 15:21:58 2020 +0200 bridge: uapi: mrp: Add mrp attributes. Add new nested netlink attribute to configure the MRP. These attributes are used by the userspace to add/delete/configure MRP instances and by the kernel to notify the userspace when the MRP ring gets open/closed. MRP nested attribute has the following attributes: IFLA_BRIDGE_MRP_INSTANCE - the parameter type is br_mrp_instance which contains the instance id, and the ifindex of the two ports. The ports can't be part of multiple instances. This is used to create/delete MRP instances. IFLA_BRIDGE_MRP_PORT_STATE - the parameter type is u32. Which can be forwarding, blocking or disabled. IFLA_BRIDGE_MRP_PORT_ROLE - the parameter type is br_mrp_port_role which contains the instance id and the role. The role can be primary or secondary. IFLA_BRIDGE_MRP_RING_STATE - the parameter type is br_mrp_ring_state which contains the instance id and the state. The state can be open or closed. IFLA_BRIDGE_MRP_RING_ROLE - the parameter type is br_mrp_ring_role which contains the instance id and the ring role. The role can be MRM or MRC. IFLA_BRIDGE_MRP_START_TEST - the parameter type is br_mrp_start_test which contains the instance id, the interval at which to send the MRP_Test frames, how many test frames can be missed before declaring the ring open and the period which represent for how long to send the test frames. Also add the file include/uapi/linux/mrp_bridge.h which defines all the types used by MRP that are also needed by the userpace. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 869129ee0c624a78c74e50b51635e183196cd2c6 Author: Matt Roper Date: Fri Apr 24 16:14:23 2020 -0700 drm/i915: Use proper fault mask in interrupt postinstall too The IRQ postinstall handling had open-coded pipe fault mask selection that never got updated for gen11. Switch it to use gen8_de_pipe_fault_mask() to ensure we don't miss updates for new platforms. Cc: José Roberto de Souza Fixes: d506a65d56fd ("drm/i915: Catch GTT fault errors for gen11+ planes") Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200424231423.4065231-1-matthew.d.roper@intel.com Reviewed-by: Ville Syrjälä commit 7d3118016787b5c05da94b3bcdb96c9d6ff82c44 Author: Colin Ian King Date: Sat Apr 25 12:28:14 2020 +0100 net: rtnetlink: remove redundant assignment to variable err The variable err is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 52785b6ae8eded7ac99d65c92d989b702e5b4376 Author: Wei Yongjun Date: Fri Apr 17 02:58:37 2020 +0000 kcsan: Use GFP_ATOMIC under spin lock A spin lock is held in insert_report_filterlist(), so the krealloc() should use GFP_ATOMIC. This commit therefore makes this change. Reviewed-by: Marco Elver Signed-off-by: Wei Yongjun Signed-off-by: Paul E. McKenney commit eba9c444d34c9f10cbb463329c2c8e14f2adff25 Author: Ingo Molnar Date: Mon Apr 13 11:03:05 2020 +0200 Improve KCSAN documentation a bit This commit simplifies and clarifies the highest level KCSAN Kconfig help text. Signed-off-by: Ingo Molnar Signed-off-by: Paul E. McKenney commit be44ae62431196ac2a55198c0855028fff3ccfb4 Author: Randy Dunlap Date: Tue Feb 25 21:09:19 2020 -0800 locktorture.c: Fix if-statement empty body warnings When using -Wextra, gcc complains about torture_preempt_schedule() when its definition is empty (i.e., when CONFIG_PREEMPTION is not set/enabled). Fix these warnings by adding an empty do-while block for that macro when CONFIG_PREEMPTION is not set. Fixes these build warnings: ../kernel/locking/locktorture.c:119:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../kernel/locking/locktorture.c:166:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../kernel/locking/locktorture.c:337:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../kernel/locking/locktorture.c:490:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../kernel/locking/locktorture.c:528:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../kernel/locking/locktorture.c:553:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] I have verified that there is no object code change (with gcc 7.5.0). Signed-off-by: Randy Dunlap Cc: Davidlohr Bueso Cc: Josh Triplett Signed-off-by: "Paul E. McKenney" commit c9527bebb017b891d1a2bbb96217bd5225488a0e Author: Paul E. McKenney Date: Tue Feb 18 13:41:02 2020 -0800 rcutorture: Mark data-race potential for rcu_barrier() test statistics The n_barrier_successes, n_barrier_attempts, and n_rcu_torture_barrier_error variables are updated (without access markings) by the main rcu_barrier() test kthread, and accessed (also without access markings) by the rcu_torture_stats() kthread. This of course can result in KCSAN complaints. Because the accesses are in diagnostic prints, this commit uses data_race() to excuse the diagnostic prints from the data race. If this were to ever cause bogus statistics prints (for example, due to store tearing), any misleading information would be disambiguated by the presence or absence of an rcutorture splat. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely and due to the mild consequences of the failure, namely a confusing rcutorture console message. Signed-off-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) commit b3578186b28da4ed5d0852ec69c13a7bce15b5fd Author: Paul E. McKenney Date: Fri Feb 14 14:43:44 2020 -0800 rcutorture: Make kvm-recheck-rcu.sh handle truncated lines System hangs or killed rcutorture guest OSes can result in truncated "Reader Pipe:" lines, which can in turn result in false-positive reader-batch near-miss warnings. This commit therefore adjusts the reader-batch checks to account for possible line truncation. Signed-off-by: Paul E. McKenney commit 3b2a47398552938d2ae0091f35eb3658a52a0769 Author: Paul E. McKenney Date: Mon Apr 13 16:30:35 2020 -0700 rcutorture: Add KCSAN stubs This commit adds stubs for KCSAN's data_race(), ASSERT_EXCLUSIVE_WRITER(), and ASSERT_EXCLUSIVE_ACCESS() macros to allow code using these macros to move ahead. Signed-off-by: Paul E. McKenney commit 33b2b93bd831fc0e994654cef3d046c713e3b55e Author: Paul E. McKenney Date: Fri Apr 3 14:12:07 2020 -0700 rcu: Remove self-stack-trace when all quiescent states seen When all quiescent states have been seen, it is normally the grace-period kthread that is in trouble. Although the existing stack trace from the current CPU might possibly provide useful information, experience indicates that there is too much noise for this to be worthwhile. This commit therefore removes this stack trace from the output. Signed-off-by: Paul E. McKenney commit 88375825171c7de5f1e68ac6fd5d35d3b831da3c Author: Paul E. McKenney Date: Tue Mar 31 19:00:52 2020 -0700 rcu: When GP kthread is starved, tag idle threads as false positives If the grace-period kthread is starved, idle threads' extended quiescent states are not reported. These idle threads thus wrongly appear to be blocking the current grace period. This commit therefore tags such idle threads as probable false positives when the grace-period kthread is being starved. Signed-off-by: Paul E. McKenney commit 654db05cee8186cf9438d94ef32a4f9ffe964e57 Author: Paul E. McKenney Date: Sun Feb 9 02:35:22 2020 -0800 rcu: Use data_race() for RCU expedited CPU stall-warning prints Although the accesses used to determine whether or not an expedited stall should be printed are an integral part of the concurrency algorithm governing use of the corresponding variables, the values that are simply printed are ancillary. As such, it is best to use data_race() for these accesses in order to provide the greatest latitude in the use of KCSAN for the other accesses that are an integral part of the algorithm. This commit therefore changes the relevant uses of READ_ONCE() to data_race(). Signed-off-by: Paul E. McKenney commit e5a971d76d701dbff9e5dbaa84dc9e8c3081a867 Author: Paul E. McKenney Date: Fri Apr 3 12:10:28 2020 -0700 ftrace: Use synchronize_rcu_tasks_rude() instead of ftrace_sync() This commit replaces the schedule_on_each_cpu(ftrace_sync) instances with synchronize_rcu_tasks_rude(). Suggested-by: Steven Rostedt Cc: Ingo Molnar [ paulmck: Make Kconfig adjustments noted by kbuild test robot. ] Signed-off-by: Paul E. McKenney commit 25246fc83155b254534ce579fb713828fb5e621a Author: Paul E. McKenney Date: Sun Apr 5 20:49:13 2020 -0700 rcu-tasks: Allow standalone use of TASKS_{TRACE_,}RCU This commit allows TASKS_TRACE_RCU to be used independently of TASKS_RCU and vice versa. [ paulmck: Fix conditional compilation per kbuild test robot feedback. ] Signed-off-by: Paul E. McKenney commit 7e0669c3e9dec367ecb63062898c70c1c596b749 Author: Paul E. McKenney Date: Wed Mar 25 14:36:05 2020 -0700 rcu-tasks: Add IPI failure count to statistics This commit adds a failure-return count for smp_call_function_single(), and adds this to the console messages for rcutorture writer stalls and at the end of rcutorture testing. Signed-off-by: Paul E. McKenney commit 039f3cc93aa07a90ad5df95d7820b67b0689126d Author: Paul E. McKenney Date: Tue Mar 24 08:00:04 2020 -0700 rcutorture: Add TRACE02 scenario enabling RCU Tasks Trace IPIs This commit adds a TRACE02 scenario which enables preemption and RCU Tasks Trace IPIs, more specifically, disabling heavyweight readers. Signed-off-by: Paul E. McKenney commit edf3775f0ad66879796f594983163f672c4bf1a2 Author: Paul E. McKenney Date: Sun Mar 22 14:09:45 2020 -0700 rcu-tasks: Add count for idle tasks on offline CPUs This commit adds a counter for the number of times the quiescent state was an idle task associated with an offline CPU, and prints this count at the end of rcutorture runs and at stall time. Signed-off-by: Paul E. McKenney commit 40471509be3cb8c9c02aec1c316614cb96e6fe85 Author: Paul E. McKenney Date: Sun Mar 22 13:34:34 2020 -0700 rcu-tasks: Add rcu_dynticks_zero_in_eqs() effectiveness statistics This commit adds counts of the number of calls and number of successful calls to rcu_dynticks_zero_in_eqs(), which are printed at the end of rcutorture runs and at stall time. This allows evaluation of the effectiveness of rcu_dynticks_zero_in_eqs(). Signed-off-by: Paul E. McKenney commit 9796e1ae7386ecf66eb234f7db7753845ebb2139 Author: Paul E. McKenney Date: Sun Mar 22 13:18:54 2020 -0700 rcu-tasks: Make RCU tasks trace also wait for idle tasks This commit scans the CPUs, adding each CPU's idle task to the list of tasks that need quiescent states. Signed-off-by: Paul E. McKenney commit 7e3b70e0703b48e120c3f5e65498790341120fad Author: Paul E. McKenney Date: Sun Mar 22 11:24:58 2020 -0700 rcu-tasks: Handle the running-offline idle-task special case The idle task corresponding to an offline CPU can appear to be running while that CPU is offline. This commit therefore adds checks for this situation, treating it as a quiescent state. Because the tasklist scan and the holdout-list scan now exclude CPU-hotplug operations, readers on the CPU-hotplug paths are still waited for. Signed-off-by: Paul E. McKenney commit 81b4a7bc3b54b0b839dbf3d2b8c9a353ae910688 Author: Paul E. McKenney Date: Sun Mar 22 10:10:07 2020 -0700 rcu-tasks: Disable CPU hotplug across RCU tasks trace scans This commit disables CPU hotplug across RCU tasks trace scans, which is a first step towards correctly recognizing idle tasks "running" on offline CPUs. Signed-off-by: Paul E. McKenney commit b38f57c1fe64276773b124dffb0a139cc32ab3cb Author: Paul E. McKenney Date: Fri Mar 20 14:29:08 2020 -0700 rcu-tasks: Allow rcu_read_unlock_trace() under scheduler locks The rcu_read_unlock_trace() can invoke rcu_read_unlock_trace_special(), which in turn can call wake_up(). Therefore, if any scheduler lock is held across a call to rcu_read_unlock_trace(), self-deadlock can occur. This commit therefore uses the irq_work facility to defer the wake_up() to a clean environment where no scheduler locks will be held. Reported-by: Steven Rostedt [ paulmck: Update #includes for m68k per kbuild test robot. ] Signed-off-by: Paul E. McKenney commit 7d0c9c50c5a109acd7a5cf589fc5563f9ef7149a Author: Paul E. McKenney Date: Thu Mar 19 15:33:12 2020 -0700 rcu-tasks: Avoid IPIing userspace/idle tasks if kernel is so built Systems running CPU-bound real-time task do not want IPIs sent to CPUs executing nohz_full userspace tasks. Battery-powered systems don't want IPIs sent to idle CPUs in low-power mode. Unfortunately, RCU tasks trace can and will send such IPIs in some cases. Both of these situations occur only when the target CPU is in RCU dyntick-idle mode, in other words, when RCU is not watching the target CPU. This suggests that CPUs in dyntick-idle mode should use memory barriers in outermost invocations of rcu_read_lock_trace() and rcu_read_unlock_trace(), which would allow the RCU tasks trace grace period to directly read out the target CPU's read-side state. One challenge is that RCU tasks trace is not targeting a specific CPU, but rather a task. And that task could switch from one CPU to another at any time. This commit therefore uses try_invoke_on_locked_down_task() and checks for task_curr() in trc_inspect_reader_notrunning(). When this condition holds, the target task is running and cannot move. If CONFIG_TASKS_TRACE_RCU_READ_MB=y, the new rcu_dynticks_zero_in_eqs() function can be used to check if the specified integer (in this case, t->trc_reader_nesting) is zero while the target CPU remains in that same dyntick-idle sojourn. If so, the target task is in a quiescent state. If not, trc_read_check_handler() must indicate failure so that the grace-period kthread can take appropriate action or retry after an appropriate delay, as the case may be. With this change, given CONFIG_TASKS_TRACE_RCU_READ_MB=y, if a given CPU remains idle or a given task continues executing in nohz_full mode, the RCU tasks trace grace-period kthread will detect this without the need to send an IPI. Suggested-by: Mathieu Desnoyers Signed-off-by: Paul E. McKenney commit 9ae58d7bd11f1fc4c96389df11751f8593d8bd33 Author: Paul E. McKenney Date: Wed Mar 18 17:16:37 2020 -0700 rcu-tasks: Add Kconfig option to mediate smp_mb() vs. IPI This commit provides a new TASKS_TRACE_RCU_READ_MB Kconfig option that enables use of read-side memory barriers by both rcu_read_lock_trace() and rcu_read_unlock_trace() when the are executed with the current->trc_reader_special.b.need_mb flag set. This flag is currently never set. Doing that is the subject of a later commit. Signed-off-by: Paul E. McKenney commit 238dbce39ea467577ce7e41ee3e98748c436ed0f Author: Paul E. McKenney Date: Wed Mar 18 10:54:05 2020 -0700 rcu-tasks: Add grace-period and IPI counts to statistics This commit adds a grace-period count and a count of IPIs sent since boot, which is printed in response to rcutorture writer stalls and at the end of rcutorture testing. These counts will be used to evaluate various schemes to reduce the number of IPIs sent. Signed-off-by: Paul E. McKenney commit 276c410448dbca357a2bc3539acfe04862e5f172 Author: Paul E. McKenney Date: Tue Mar 17 16:02:06 2020 -0700 rcu-tasks: Split ->trc_reader_need_end This commit splits ->trc_reader_need_end by using the rcu_special union. This change permits readers to check to see if a memory barrier is required without any added overhead in the common case where no such barrier is required. This commit also adds the read-side checking. Later commits will add the machinery to properly set the new ->trc_reader_special.b.need_mb field. This commit also makes rcu_read_unlock_trace_special() tolerate nested read-side critical sections within interrupt and NMI handlers. Signed-off-by: Paul E. McKenney commit b0afa0f056676ffe0a7213818f09d2460adbcc16 Author: Paul E. McKenney Date: Tue Mar 17 11:39:26 2020 -0700 rcu-tasks: Provide boot parameter to delay IPIs until late in grace period This commit provides a rcupdate.rcu_task_ipi_delay kernel boot parameter that specifies how old the RCU tasks trace grace period must be before the grace-period kthread starts sending IPIs. This delay allows more tasks to pass through rcu_tasks_qs() quiescent states, thus reducing (or even eliminating) the number of IPIs that must be sent. On a short rcutorture test setting this kernel boot parameter to HZ/2 resulted in zero IPIs for all 877 RCU-tasks trace grace periods that elapsed during that test. Signed-off-by: Paul E. McKenney commit 88092d0c99d7584d50cc8caadb8fa9ff8a1d4ea0 Author: Paul E. McKenney Date: Tue Mar 17 08:57:02 2020 -0700 rcu-tasks: Add a grace-period start time for throttling and debug This commit adds a place to record the grace-period start in jiffies. This will be used by later commits for debugging purposes and to throttle IPIs early in the grace period. Signed-off-by: Paul E. McKenney commit 43766c3eadcf6033c92eb953f88801aebac0f785 Author: Paul E. McKenney Date: Mon Mar 16 20:38:29 2020 -0700 rcu-tasks: Make RCU Tasks Trace make use of RCU scheduler hooks This commit makes the calls to rcu_tasks_qs() detect and report quiescent states for RCU tasks trace. If the task is in a quiescent state and if ->trc_reader_checked is not yet set, the task sets its own ->trc_reader_checked. This will cause the grace-period kthread to remove it from the holdout list if it still remains there. [ paulmck: Fix conditional compilation per kbuild test robot feedback. ] Signed-off-by: Paul E. McKenney commit af051ca4e4231fcf5f366e28453ac28208bb36c6 Author: Paul E. McKenney Date: Mon Mar 16 12:13:33 2020 -0700 rcu-tasks: Make rcutorture writer stall output include GP state This commit adds grace-period state and time to the rcutorture writer stall output. Signed-off-by: Paul E. McKenney commit e21408ceec2de5be418efa39feb1e2c00f824a72 Author: Paul E. McKenney Date: Mon Mar 16 11:01:55 2020 -0700 rcu-tasks: Add RCU tasks to rcutorture writer stall output This commit adds state for each RCU-tasks flavor to the rcutorture writer stall output. The initial state is minimal, but you have to start somewhere. Signed-off-by: Paul E. McKenney [ paulmck: Fixes based on feedback from kbuild test robot. ] commit 8fd8ca388ccf233b8ae0b6b42ddc7caa5034ae85 Author: Paul E. McKenney Date: Sun Mar 15 14:51:20 2020 -0700 rcu-tasks: Move #ifdef into tasks.h This commit pushes the #ifdef CONFIG_TASKS_RCU_GENERIC from kernel/rcu/update.c to kernel/rcu/tasks.h in order to improve readability as more APIs are added. Signed-off-by: Paul E. McKenney commit 4593e772b5020e714e18f6e212d70b24fbe88b79 Author: Paul E. McKenney Date: Tue Mar 10 12:13:53 2020 -0700 rcu-tasks: Add stall warnings for RCU Tasks Trace This commit adds RCU CPU stall warnings for RCU Tasks Trace. These dump out any tasks blocking the current grace period, as well as any CPUs that have not responded to an IPI request. This happens in two phases, when initially extracting state from the tasks and later when waiting for any holdout tasks to check in. Signed-off-by: Paul E. McKenney commit c1a76c0b6abac4e7eb49b5c24a0829f47b70769d Author: Paul E. McKenney Date: Tue Mar 10 10:32:30 2020 -0700 rcutorture: Add torture tests for RCU Tasks Trace This commit adds the definitions required to torture the tracing flavor of RCU tasks. Signed-off-by: Paul E. McKenney commit d5f177d35c24429c87db2567d20563fc16f7e8f6 Author: Paul E. McKenney Date: Mon Mar 9 19:56:53 2020 -0700 rcu-tasks: Add an RCU Tasks Trace to simplify protection of tracing hooks Because RCU does not watch exception early-entry/late-exit, idle-loop, or CPU-hotplug execution, protection of tracing and BPF operations is needlessly complicated. This commit therefore adds a variant of Tasks RCU that: o Has explicit read-side markers to allow finite grace periods in the face of in-kernel loops for PREEMPT=n builds. These markers are rcu_read_lock_trace() and rcu_read_unlock_trace(). o Protects code in the idle loop, exception entry/exit, and CPU-hotplug code paths. In this respect, RCU-tasks trace is similar to SRCU, but with lighter-weight readers. o Avoids expensive read-side instruction, having overhead similar to that of Preemptible RCU. There are of course downsides: o The grace-period code can send IPIs to CPUs, even when those CPUs are in the idle loop or in nohz_full userspace. This is mitigated by later commits. o It is necessary to scan the full tasklist, much as for Tasks RCU. o There is a single callback queue guarded by a single lock, again, much as for Tasks RCU. However, those early use cases that request multiple grace periods in quick succession are expected to do so from a single task, which makes the single lock almost irrelevant. If needed, multiple callback queues can be provided using any number of schemes. Perhaps most important, this variant of RCU does not affect the vanilla flavors, rcu_preempt and rcu_sched. The fact that RCU Tasks Trace readers can operate from idle, offline, and exception entry/exit in no way enables rcu_preempt and rcu_sched readers to do so. The memory ordering was outlined here: https://lore.kernel.org/lkml/20200319034030.GX3199@paulmck-ThinkPad-P72/ This effort benefited greatly from off-list discussions of BPF requirements with Alexei Starovoitov and Andrii Nakryiko. At least some of the on-list discussions are captured in the Link: tags below. In addition, KCSAN was quite helpful in finding some early bugs. Link: https://lore.kernel.org/lkml/20200219150744.428764577@infradead.org/ Link: https://lore.kernel.org/lkml/87mu8p797b.fsf@nanos.tec.linutronix.de/ Link: https://lore.kernel.org/lkml/20200225221305.605144982@linutronix.de/ Cc: Alexei Starovoitov Cc: Andrii Nakryiko [ paulmck: Apply feedback from Steve Rostedt and Joel Fernandes. ] [ paulmck: Decrement trc_n_readers_need_end upon IPI failure. ] [ paulmck: Fix locking issue reported by rcutorture. ] Signed-off-by: Paul E. McKenney commit d01aa2633b5d5ebc16fa47ad7a5e8e9f00482554 Author: Paul E. McKenney Date: Thu Mar 5 17:07:07 2020 -0800 rcu-tasks: Code movement to allow more Tasks RCU variants This commit does nothing but move rcu_tasks_wait_gp() up to a new section for common code. Signed-off-by: Paul E. McKenney commit e4fe5dd6f26f74233e217d9dd351adc3e5165bb9 Author: Paul E. McKenney Date: Wed Mar 4 17:31:43 2020 -0800 rcu-tasks: Further refactor RCU-tasks to allow adding more variants This commit refactors RCU tasks to allow variants to be added. These variants will share the current Tasks-RCU tasklist scan and the holdout list processing. Signed-off-by: Paul E. McKenney commit c97d12a63c26fc4521d0904f073f9997ae796cba Author: Paul E. McKenney Date: Tue Mar 3 15:50:31 2020 -0800 rcu-tasks: Use unique names for RCU-Tasks kthreads and messages This commit causes the flavors of RCU Tasks to use different names for their kthreads and in their console messages. Signed-off-by: Paul E. McKenney commit 3d6e43c75d6bab212e8bc142585ee36eb8e2e5d9 Author: Paul E. McKenney Date: Tue Mar 3 15:02:50 2020 -0800 rcutorture: Add torture tests for RCU Tasks Rude This commit adds the definitions required to torture the rude flavor of RCU tasks. Signed-off-by: Paul E. McKenney commit c84aad765406c4c7573ce449e8a9977ebb8f4cb9 Author: Paul E. McKenney Date: Mon Mar 2 21:06:43 2020 -0800 rcu-tasks: Add an RCU-tasks rude variant This commit adds a "rude" variant of RCU-tasks that has as quiescent states schedule(), cond_resched_tasks_rcu_qs(), userspace execution, and (in theory, anyway) cond_resched(). In other words, RCU-tasks rude readers are regions of code with preemption disabled, but excluding code early in the CPU-online sequence and late in the CPU-offline sequence. Updates make use of IPIs and force an IPI and a context switch on each online CPU. This variant is useful in some situations in tracing. Suggested-by: Steven Rostedt [ paulmck: Apply EXPORT_SYMBOL_GPL() feedback from Qiujun Huang. ] Signed-off-by: Paul E. McKenney [ paulmck: Apply review feedback from Steve Rostedt. ] commit 5873b8a94e5dae04b8e11fc798df512614e6d1e7 Author: Paul E. McKenney Date: Tue Mar 3 11:49:21 2020 -0800 rcu-tasks: Refactor RCU-tasks to allow variants to be added This commit splits out generic processing from RCU-tasks-specific processing in order to allow additional flavors to be added. It also adds a def_bool TASKS_RCU_GENERIC to enable the common RCU-tasks infrastructure code. This is primarily, but not entirely, a code-movement commit. Signed-off-by: Paul E. McKenney commit 9cf8fc6fabd46d7f4729529f88d627ce85c6e970 Author: Paul E. McKenney Date: Fri Mar 6 14:00:46 2020 -0800 rcutorture: Add a test for synchronize_rcu_mult() This commit adds a crude test for synchronize_rcu_mult(). This is currently a smoke test rather than a high-quality stress test. Signed-off-by: Paul E. McKenney commit b3d73156b075014ce5b2609f4f47723d6c0c23d6 Author: Paul E. McKenney Date: Fri Mar 6 13:58:27 2020 -0800 rcu: Reinstate synchronize_rcu_mult() With the advent and likely usage of synchronize_rcu_rude(), there is again a need to wait on multiple types of RCU grace periods, for example, call_rcu_tasks() and call_rcu_tasks_rude(). This commit therefore reinstates synchronize_rcu_mult() in order to allow these grace periods to be straightforwardly waited on concurrently. Signed-off-by: Paul E. McKenney commit 07e105158d97b4969891e844f318d16f6cef566c Author: Paul E. McKenney Date: Mon Mar 2 15:16:57 2020 -0800 rcu-tasks: Create struct to hold state information This commit creates an rcu_tasks struct to hold state information for RCU Tasks. This is a preparation commit for adding additional flavors of Tasks RCU, each of which would have its own rcu_tasks struct. Signed-off-by: Paul E. McKenney commit eacd6f04a1333187dd3e96e5635c0edce0a2e354 Author: Paul E. McKenney Date: Mon Mar 2 11:59:20 2020 -0800 rcu-tasks: Move Tasks RCU to its own file This code-movement-only commit is in preparation for adding an additional flavor of Tasks RCU, which relies on workqueues to detect grace periods. Signed-off-by: Paul E. McKenney commit 5bef8da66a9c45d3c371d74463894f1fc31dfdda Author: Paul E. McKenney Date: Wed Mar 11 17:35:46 2020 -0700 rcu: Add per-task state to RCU CPU stall warnings Currently, an RCU-preempt CPU stall warning simply lists the PIDs of those tasks holding up the current grace period. This can be helpful, but more can be even more helpful. To this end, this commit adds the nesting level, whether the task thinks it was preempted in its current RCU read-side critical section, whether RCU core has asked this task for a quiescent state, whether the expedited-grace-period hint is set, and whether the task believes that it is on the blocked-tasks list (it must be, or it would not be printed, but if things are broken, best not to take too much for granted). Signed-off-by: Paul E. McKenney commit 2beaf3280e57bb891f8012dca49c87ed0f01e2f3 Author: Paul E. McKenney Date: Wed Mar 11 14:23:21 2020 -0700 sched/core: Add function to sample state of locked-down task A running task's state can be sampled in a consistent manner (for example, for diagnostic purposes) simply by invoking smp_call_function_single() on its CPU, which may be obtained using task_cpu(), then having the IPI handler verify that the desired task is in fact still running. However, if the task is not running, this sampling can in theory be done immediately and directly. In practice, the task might start running at any time, including during the sampling period. Gaining a consistent sample of a not-running task therefore requires that something be done to lock down the target task's state. This commit therefore adds a try_invoke_on_locked_down_task() function that invokes a specified function if the specified task can be locked down, returning true if successful and if the specified function returns true. Otherwise this function simply returns false. Given that the function passed to try_invoke_on_nonrunning_task() might be invoked with a runqueue lock held, that function had better be quite lightweight. The function is passed the target task's task_struct pointer and the argument passed to try_invoke_on_locked_down_task(), allowing easy access to task state and to a location for further variables to be passed in and out. Note that the specified function will be called even if the specified task is currently running. The function can use ->on_rq and task_curr() to quickly and easily determine the task's state, and can return false if this state is not to the function's liking. The caller of the try_invoke_on_locked_down_task() would then see the false return value, and could take appropriate action, for example, trying again later or sending an IPI if matters are more urgent. It is expected that use cases such as the RCU CPU stall warning code will simply return false if the task is currently running. However, there are use cases involving nohz_full CPUs where the specified function might instead fall back to an alternative sampling scheme that relies on heavier synchronization (such as memory barriers) in the target task. Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Ben Segall Cc: Mel Gorman [ paulmck: Apply feedback from Peter Zijlstra and Steven Rostedt. ] [ paulmck: Invoke if running to handle feedback from Mathieu Desnoyers. ] Reviewed-by: Steven Rostedt (VMware) Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit 66777e5821f6e672003fde697b8489402bb5aa98 Author: Paul E. McKenney Date: Mon Mar 16 15:22:44 2020 -0700 rcu-tasks: Use context-switch hook for PREEMPT=y kernels Currently, the PREEMPT=y version of rcu_note_context_switch() does not invoke rcu_tasks_qs(), and we need it to in order to keep RCU Tasks Trace's IPIs down to a dull roar. This commit therefore enables this hook. Signed-off-by: Paul E. McKenney commit ac3caf827488d3bc4d4101ff34931abbfa33839d Author: Paul E. McKenney Date: Thu Mar 12 17:01:57 2020 -0700 rcu: Add comments marking transitions between RCU watching and not It is not as clear as it might be just where in RCU's idle entry/exit code RCU stops and starts watching the current CPU. This commit therefore adds comments calling out the transitions. Reported-by: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 52b1fc3f798d02a3a9d1cf7a84e98a795223410a Author: Paul E. McKenney Date: Sat Mar 28 18:53:25 2020 -0700 rcutorture: Add test of holding scheduler locks across rcu_read_unlock() Now that it should be safe to hold scheduler locks across rcu_read_unlock(), even in cases where the corresponding RCU read-side critical section might have been preempted and boosted, the commit adds a test of this capability to rcutorture. This has been tested on current mainline (which can deadlock in this situation), and lockdep duly reported the expected deadlock. On -rcu, lockdep is silent, thus far, anyway. Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Signed-off-by: Paul E. McKenney commit 5f5fa7ea89dc82d34ed458f4d7a8634e8e9eefce Author: Lai Jiangshan Date: Sat Feb 15 15:23:26 2020 -0800 rcu: Don't use negative nesting depth in __rcu_read_unlock() Now that RCU flavors have been consolidated, an RCU-preempt rcu_read_unlock() in an interrupt or softirq handler cannot possibly end the RCU read-side critical section. Consider the old vulnerability involving rcu_read_unlock() being invoked within such a handler that interrupted an __rcu_read_unlock_special(), in which a wakeup might be invoked with a scheduler lock held. Because rcu_read_unlock_special() no longer does wakeups in such situations, it is no longer necessary for __rcu_read_unlock() to set the nesting level negative. This commit therefore removes this recursion-protection code from __rcu_read_unlock(). [ paulmck: Let rcu_exp_handler() continue to call rcu_report_exp_rdp(). ] [ paulmck: Adjust other checks given no more negative nesting. ] Signed-off-by: Lai Jiangshan Signed-off-by: Paul E. McKenney commit f0bdf6d473cf12a488a78422e15aafdfe77cf853 Author: Lai Jiangshan Date: Sat Feb 15 14:52:32 2020 -0800 rcu: Remove unused ->rcu_read_unlock_special.b.deferred_qs field The ->rcu_read_unlock_special.b.deferred_qs field is set to true in rcu_read_unlock_special() but never set to false. This is not particularly useful, so this commit removes this field. The only possible justification for this field is to ease debugging of RCU deferred quiscent states, but the combination of the other ->rcu_read_unlock_special fields plus ->rcu_blocked_node and of course ->rcu_read_lock_nesting should cover debugging needs. And if this last proves incorrect, this patch can always be reverted, along with the required setting of ->rcu_read_unlock_special.b.deferred_qs to false in rcu_preempt_deferred_qs_irqrestore(). Signed-off-by: Lai Jiangshan Signed-off-by: Paul E. McKenney commit 07b4a930fc44a537efecf73c1fd2b4937f64caaa Author: Lai Jiangshan Date: Sat Feb 15 14:37:26 2020 -0800 rcu: Don't set nesting depth negative in rcu_preempt_deferred_qs() Now that RCU flavors have been consolidated, an RCU-preempt rcu_read_unlock() in an interrupt or softirq handler cannot possibly end the RCU read-side critical section. Consider the old vulnerability involving rcu_preempt_deferred_qs() being invoked within such a handler that interrupted an extended RCU read-side critical section, in which a wakeup might be invoked with a scheduler lock held. Because rcu_read_unlock_special() no longer does wakeups in such situations, it is no longer necessary for rcu_preempt_deferred_qs() to set the nesting level negative. This commit therefore removes this recursion-protection code from rcu_preempt_deferred_qs(). [ paulmck: Fix typo in commit log per Steve Rostedt. ] Signed-off-by: Lai Jiangshan Signed-off-by: Paul E. McKenney commit e4453d8a1c56050df320ef54f339ffa4a9513d0a Author: Paul E. McKenney Date: Sat Feb 15 14:18:09 2020 -0800 rcu: Make rcu_read_unlock_special() safe for rq/pi locks The scheduler is currently required to hold rq/pi locks across the entire RCU read-side critical section or not at all. This is inconvenient and leaves traps for the unwary, including the author of this commit. But now that excessively long grace periods enable scheduling-clock interrupts for holdout nohz_full CPUs, the nohz_full rescue logic in rcu_read_unlock_special() can be dispensed with. In other words, the rcu_read_unlock_special() function can refrain from doing wakeups unless such wakeups are guaranteed safe. This commit therefore avoids unsafe wakeups, freeing the scheduler to hold rq/pi locks across rcu_read_unlock() even if the corresponding RCU read-side critical section might have been preempted. This commit also updates RCU's requirements documentation. This commit is inspired by a patch from Lai Jiangshan: https://lore.kernel.org/lkml/20191102124559.1135-2-laijs@linux.alibaba.com This commit is further intended to be a step towards his goal of permitting the inlining of RCU-preempt's rcu_read_lock() and rcu_read_unlock(). Cc: Lai Jiangshan Signed-off-by: Paul E. McKenney commit c76e7e0bce10876e6b08ac2ce8af5ef7cba684ff Author: Paul E. McKenney Date: Tue Apr 14 10:19:02 2020 -0700 rcu: Add KCSAN stubs to update.c This commit adds stubs for KCSAN's data_race(), ASSERT_EXCLUSIVE_WRITER(), and ASSERT_EXCLUSIVE_ACCESS() macros to allow code using these macros to move ahead. Signed-off-by: Paul E. McKenney commit 6be7436d2245d3dd8b9a8f949367c13841c23308 Author: Paul E. McKenney Date: Fri Apr 10 13:47:41 2020 -0700 rcu: Add rcu_gp_might_be_stalled() This commit adds rcu_gp_might_be_stalled(), which returns true if there is some reason to believe that the RCU grace period is stalled. The use case is where an RCU free-memory path needs to allocate memory in order to free it, a situation that should be avoided where possible. But where it is necessary, there is always the alternative of using synchronize_rcu() to wait for a grace period in order to avoid the allocation. And if the grace period is stalled, allocating memory to asynchronously wait for it is a bad idea of epic proportions: Far better to let others use the memory, because these others might actually be able to free that memory before the grace period ends. Thus, rcu_gp_might_be_stalled() can be used to help decide whether allocating memory on an RCU free path is a semi-reasonable course of action. Cc: Joel Fernandes Cc: Uladzislau Rezki Signed-off-by: Paul E. McKenney commit a6a82ce18ba443186545d3fefbee8b9419a859dc Author: Joel Fernandes (Google) Date: Mon Mar 16 12:32:28 2020 -0400 rcu/tree: Count number of batched kfree_rcu() locklessly We can relax the correctness of counting of number of queued objects in favor of not hurting performance, by locklessly sampling per-cpu counters. This should be Ok since under high memory pressure, it should not matter if we are off by a few objects while counting. The shrinker will still do the reclaim. Signed-off-by: Joel Fernandes (Google) [ paulmck: Remove unused "flags" variable. ] Signed-off-by: Paul E. McKenney commit 9154244c1ab6c9db4f1f25ac8f73bd46dba64287 Author: Joel Fernandes (Google) Date: Mon Mar 16 12:32:27 2020 -0400 rcu/tree: Add a shrinker to prevent OOM due to kfree_rcu() batching To reduce grace periods and improve kfree() performance, we have done batching recently dramatically bringing down the number of grace periods while giving us the ability to use kfree_bulk() for efficient kfree'ing. However, this has increased the likelihood of OOM condition under heavy kfree_rcu() flood on small memory systems. This patch introduces a shrinker which starts grace periods right away if the system is under memory pressure due to existence of objects that have still not started a grace period. With this patch, I do not observe an OOM anymore on a system with 512MB RAM and 8 CPUs, with the following rcuperf options: rcuperf.kfree_loops=20000 rcuperf.kfree_alloc_num=8000 rcuperf.kfree_rcu_test=1 rcuperf.kfree_mult=2 Otherwise it easily OOMs with the above parameters. NOTE: 1. On systems with no memory pressure, the patch has no effect as intended. 2. In the future, we can use this same mechanism to prevent grace periods from happening even more, by relying on shrinkers carefully. Cc: urezki@gmail.com Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit f87dc808009ac86c790031627698ef1a34c31e25 Author: Joel Fernandes (Google) Date: Mon Mar 16 12:32:26 2020 -0400 rcuperf: Add ability to increase object allocation size This allows us to increase memory pressure dynamically using a new rcuperf boot command line parameter called 'rcumult'. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit e2f3ccfa62001994ed3e81c309face75aaa8d372 Author: Paul E. McKenney Date: Fri Apr 10 17:05:22 2020 -0700 rcu: Convert rcu_nohz_full_cpu() ULONG_CMP_LT() to time_before() This commit converts the ULONG_CMP_LT() in rcu_nohz_full_cpu() to time_before() to reflect the fact that it is comparing a timestamp to the jiffies counter. Signed-off-by: Paul E. McKenney commit 7b2413111a630469282c427033818977515ea592 Author: Paul E. McKenney Date: Fri Apr 10 15:52:53 2020 -0700 rcu: Convert rcu_initiate_boost() ULONG_CMP_GE() to time_after() This commit converts the ULONG_CMP_GE() in rcu_initiate_boost() to time_after() to reflect the fact that it is comparing a timestamp to the jiffies counter. Signed-off-by: Paul E. McKenney commit 29ffebc5fcc0bcd8e9bc9f9b3899f2d222b12b04 Author: Paul E. McKenney Date: Fri Apr 10 14:48:20 2020 -0700 rcu: Convert ULONG_CMP_GE() to time_after() for jiffy comparison This commit converts the ULONG_CMP_GE() in rcu_gp_fqs_loop() to time_after() to reflect the fact that it is comparing a timestamp to the jiffies counter. Signed-off-by: Paul E. McKenney commit da44cd6c8e88b6da3d5277d0e7b0e4d38faf4532 Author: Jules Irenge Date: Mon Mar 30 02:24:48 2020 +0100 rcu: Replace 1 by true Coccinelle reports a warning at use_softirq declaration WARNING: Assignment of 0/1 to bool variable The root cause is use_softirq a variable of bool type is initialised with the integer 1 Replacing 1 with value true solve the issue. Signed-off-by: Jules Irenge Signed-off-by: Paul E. McKenney commit a66dbda7893f48b97d7406ae42fa29190aa672a0 Author: Jules Irenge Date: Fri Mar 27 21:23:53 2020 +0000 rcu: Replace assigned pointer ret value by corresponding boolean value Coccinelle reports warnings at rcu_read_lock_held_common() WARNING: Assignment of 0/1 to bool variable To fix this, the assigned pointer ret values are replaced by corresponding boolean value. Given that ret is a pointer of bool type Signed-off-by: Jules Irenge Signed-off-by: Paul E. McKenney commit 62ae19511f1efbe9f57346ca1f45e13b061a56ff Author: Paul E. McKenney Date: Sat Mar 21 19:52:20 2020 -0700 rcu: Mark rcu_state.gp_seq to detect more concurrent writes The rcu_state structure's gp_seq field is only to be modified by the RCU grace-period kthread, which is single-threaded. This commit therefore enlists KCSAN's help in enforcing this restriction. This commit applies KCSAN-specific primitives, so cannot go upstream until KCSAN does. Signed-off-by: Paul E. McKenney commit c28d5c09d09f86374a00b70a57d3cb75e3fc7fa9 Author: Mauro Carvalho Chehab Date: Tue Mar 17 15:54:18 2020 +0100 rcu: Get rid of some doc warnings in update.c This commit escapes *ret, because otherwise the documentation system thinks that this is an incomplete emphasis block: ./kernel/rcu/update.c:65: WARNING: Inline emphasis start-string without end-string. ./kernel/rcu/update.c:65: WARNING: Inline emphasis start-string without end-string. ./kernel/rcu/update.c:70: WARNING: Inline emphasis start-string without end-string. ./kernel/rcu/update.c:82: WARNING: Inline emphasis start-string without end-string. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paul E. McKenney commit ddc465936643108d5ba61f88594a2868d6a156ab Author: Jonathan Neuschäfer Date: Thu Mar 5 23:22:55 2020 +0100 Revert "rculist: Describe variadic macro argument in a Sphinx-compatible way" This reverts commit f452ee096d95482892b101bde4fd037fa025d3cc. The workaround became unnecessary with commit 43756e347f21 ("scripts/kernel-doc: Add support for named variable macro arguments"). Signed-off-by: Jonathan Neuschäfer Signed-off-by: Paul E. McKenney commit fcbcc0e700500fcecf24b9b705825135de30415e Author: Zhaolong Zhang Date: Thu Mar 5 14:56:11 2020 -0800 rcu: Fix the (t=0 jiffies) false positive It is possible that an over-long grace period will end while the RCU CPU stall warning message is printing. In this case, the estimate of the offending grace period's duration can be erroneous due to refetching of rcu_state.gp_start, which will now be the time of the newly started grace period. Computation of this duration clearly needs to use the start time for the old over-long grace period, not the fresh new one. This commit avoids such errors by causing both print_other_cpu_stall() and print_cpu_stall() to reuse the value previously fetched by their caller. Signed-off-by: Zhaolong Zhang Signed-off-by: Paul E. McKenney commit 1fca4d12f46371a34bf90af87f49548dd026c3ca Author: Paul E. McKenney Date: Sat Feb 22 20:07:09 2020 -0800 rcu: Expedite first two FQS scans under callback-overload conditions Even if some CPUs have excessive numbers of callbacks, RCU's grace-period kthread will still wait normally between successive force-quiescent-state scans. The first two are the most important, as they are the ones that enlist aid from the scheduler when overloaded. This commit therefore omits the wait before the first and the second force-quiescent-state scan under callback-overload conditions. This approach was inspired by a discussion with Jeff Roberson. Signed-off-by: Paul E. McKenney commit 53965dbe5396d2945c7cf53c77c7b5532b08791c Author: Paul E. McKenney Date: Wed Feb 19 16:42:47 2020 -0800 drm: Make drm_dp_mst_dsc_aux_for_port() safe for old compilers Older compilers either want two extra pairs of curly braces around the initializer for local variable desc, or they want a single pair of curly braces with nothing inside. Because current Linux-kernel practice favors the latter, this commit makes it so. Suggested-by: Chris Wilson Suggested-by: Joe Perches Suggested-by: Christoph Hellwig Signed-off-by: Paul E. McKenney commit 47fbb074536ecca5e0af3dcce340954c09ed4d1e Author: Paul E. McKenney Date: Sun Feb 9 02:29:36 2020 -0800 rcu: Use data_race() for RCU CPU stall-warning prints Although the accesses used to determine whether or not a stall should be printed are an integral part of the concurrency algorithm governing use of the corresponding variables, the values that are simply printed are ancillary. As such, it is best to use data_race() for these accesses in order to provide the greatest latitude in the use of KCSAN for the other accesses that are an integral part of the algorithm. This commit therefore changes the relevant uses of READ_ONCE() to data_race(). Signed-off-by: Paul E. McKenney commit 5822b8126ff01e0baaf7d5168adc4ac8aeae088c Author: Paul E. McKenney Date: Sat Jan 4 10:44:41 2020 -0800 rcu: Add WRITE_ONCE() to rcu_node ->boost_tasks The rcu_node structure's ->boost_tasks field is read locklessly, so this commit adds the WRITE_ONCE() to an update in order to provide proper documentation and READ_ONCE()/WRITE_ONCE() pairing. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely. Signed-off-by: Paul E. McKenney commit b68c6146512d92f6d570d26e1873497ade2cc4cb Author: Paul E. McKenney Date: Fri Jan 3 16:36:59 2020 -0800 srcu: Add data_race() to ->srcu_lock_count and ->srcu_unlock_count arrays The srcu_data structure's ->srcu_lock_count and ->srcu_unlock_count arrays are read and written locklessly, so this commit adds the data_race() to the diagnostic-print loads from these arrays in order mark them as known and approved data-racy accesses. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely and due to this being used only by rcutorture. Signed-off-by: Paul E. McKenney commit 065a6db12a80fac4eccc37e6bef14b0f4a610f31 Author: Paul E. McKenney Date: Fri Jan 3 15:22:01 2020 -0800 rcu: Add READ_ONCE and data_race() to rcu_node ->boost_tasks The rcu_node structure's ->boost_tasks field is read locklessly, so this commit adds the READ_ONCE() to one load in order to avoid destructive compiler optimizations. The other load is from a diagnostic print, so data_race() suffices. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely. Signed-off-by: Paul E. McKenney commit 314eeb43e5f22856b281c91c966e51e5782a3498 Author: Paul E. McKenney Date: Fri Jan 3 14:18:12 2020 -0800 rcu: Add *_ONCE() and data_race() to rcu_node ->exp_tasks plus locking There are lockless loads from the rcu_node structure's ->exp_tasks field, so this commit causes all stores to use WRITE_ONCE() and all lockless loads to use READ_ONCE() or data_race(), with the latter for debug prints. This code also did a unprotected traversal of the linked list pointed into by ->exp_tasks, so this commit also acquires the rcu_node structure's ->lock to properly protect this traversal. This list was traversed unprotected only when printing an RCU CPU stall warning for an expedited grace period, so the odds of seeing this in production are not all that high. This data race was reported by KCSAN. Signed-off-by: Paul E. McKenney commit 2f08469563550d15cb08a60898d3549720600eee Author: Paul E. McKenney Date: Mon Feb 10 05:29:58 2020 -0800 rcu: Mark rcu_state.ncpus to detect concurrent writes The rcu_state structure's ncpus field is only to be modified by the CPU-hotplug CPU-online code path, which is single-threaded. This commit therefore enlists KCSAN's help in enforcing this restriction. Signed-off-by: Paul E. McKenney commit 4f58820fd710e0563e22420c07c03c5ccec948bf Author: Paul E. McKenney Date: Mon Apr 13 16:33:01 2020 -0700 srcu: Add KCSAN stubs This commit adds stubs for KCSAN's data_race(), ASSERT_EXCLUSIVE_WRITER(), and ASSERT_EXCLUSIVE_ACCESS() macros to allow code using these macros to move ahead. Signed-off-by: Paul E. McKenney commit 353159365e725fab7b3bf2817bec0ecd16706a38 Author: Paul E. McKenney Date: Mon Apr 13 16:36:29 2020 -0700 rcu: Add KCSAN stubs This commit adds stubs for KCSAN's data_race(), ASSERT_EXCLUSIVE_WRITER(), and ASSERT_EXCLUSIVE_ACCESS() macros to allow code using these macros to move ahead. Signed-off-by: Paul E. McKenney commit 3608a199749873edc992c74adf077c3a848121ad Author: Oleksij Rempel Date: Fri Apr 24 07:21:16 2020 +0200 dt-bindings: net: convert qca,ar71xx documentation to yaml Now that we have the DT validation in place, let's convert the device tree bindings for the Atheros AR71XX over to a YAML schemas. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller commit 0767ec04289757c0edc2322957ba51d97446eaa4 Author: Oleksij Rempel Date: Fri Apr 24 06:59:14 2020 +0200 net: ag71xx: extend link validation to support other SoCs Most (all?) QCA SoCs have two MAC with different supported link capabilities. Extend ag71xx_mac_validate() to properly validate this variants. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller commit ce20670828c1228ecd37befbdda87a1f87a803b9 Author: Qiuxu Zhuo Date: Fri Apr 24 20:18:33 2020 +0800 EDAC/i10nm: Update driver to support different bus number config register offsets The i10nm_edac driver failed to load on Ice Lake and Tremont/Jacobsville servers if their CPU stepping >= 4 and failed on Ice Lake-D servers from stepping 0. The root cause was that for Ice Lake and Tremont/Jacobsville servers with CPU stepping >=4, the offset for bus number configuration register was updated from 0xcc to 0xd0. For Ice Lake-D servers, all the steppings use the updated 0xd0 offset. Fix the issue by using the appropriate offset for bus number configuration register according to the CPU model number and stepping. Reported-by: Jerry Chen Reported-and-tested-by: Jin Wen Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/linux-edac/20200427084022.GC11036@zn.tnic commit 6dc0d028f53945ca8de3e61a149f103f100d42df Author: Chris Wilson Date: Mon Apr 27 16:45:54 2020 +0100 drm/i915/gt: Fix up clock frequency The bspec lists both the clock frequency and the effective interval. The interval corresponds to observed behaviour, so adjust the frequency to match. v2: Mika rightfully asked if we could measure the clock frequency from a selftest. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Acked-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200427154554.12736-1-chris@chris-wilson.co.uk commit ee5340abab3babb91c1807cea47de4468b2dfc91 Author: Qiuxu Zhuo Date: Fri Apr 24 20:18:14 2020 +0800 EDAC, {skx,i10nm}: Make some configurations CPU model specific The device ID for configuration agent PCI device and the offset for bus number configuration register can be CPU model specific. So add a new structure res_config to make them configurable and pass res_config to {skx,i10nm}_init() and skx_get_all_bus_mappings() for use. Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/r/20200427083246.GB11036@zn.tnic commit 5332f8b1d9dd17c258c9461f46aa148a8c850149 Author: Andy Shevchenko Date: Fri Apr 24 19:11:47 2020 +0300 dmaengine: dmatest: Describe members of struct dmatest_info Kernel documentation validator complains that not all members of struct dmatest_info are being described. Describe them all. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200424161147.16895-6-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 7f2b722668e5334594a50e7055e785687a184644 Author: Andy Shevchenko Date: Fri Apr 24 19:11:46 2020 +0300 dmaengine: dmatest: Describe members of struct dmatest_params Kernel documentation validator complains that not all members of struct dmatest_params are being described. Describe them all. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200424161147.16895-5-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 35c5fc028511c743db5313f0ef8cac35141706e9 Author: Andy Shevchenko Date: Fri Apr 24 19:11:45 2020 +0300 dmaengine: dmatest: Allow negative timeout value to specify infinite wait The dmatest module parameter 'timeout' is documented as accepting a -1 to mean "infinite timeout". However, an infinite timeout is not advised, nor possible since the module parameter is an unsigned int, which won't accept a negative value. Change the parameter type to be signed integer. Cc: Gary Hook Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200424161147.16895-4-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 85f78cec8494ec595ac73181bd5d8fc6d797f592 Author: Andy Shevchenko Date: Fri Apr 24 19:11:44 2020 +0300 Revert "dmaengine: dmatest: timeout value of -1 should specify infinite wait" This reverts commit ed04b7c57c3383ed4573f1d1d1dbdc1108ba0bed. While it gives a good description what happens, the approach seems too confusing. Let's fix it in the following patch. Cc: Gary Hook Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200424161147.16895-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 955b17665d2c221521c554ae6aa22c2486de1a27 Author: Amelie Delaunay Date: Wed Apr 22 12:29:04 2020 +0200 dmaengine: stm32-dma: direct mode support through device tree Direct mode or FIFO mode is computed by stm32-dma driver. Add a way for the user to force direct mode, by setting bit 2 in the bitfield value specifying DMA features in the device tree. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20200422102904.1448-3-amelie.delaunay@st.com Signed-off-by: Vinod Koul commit 86e673f7c974f7385d2bdfa91360ea4b800a85f8 Author: Amelie Delaunay Date: Wed Apr 22 12:29:03 2020 +0200 dt-bindings: dma: add direct mode support through device tree in stm32-dma Direct mode or FIFO mode is computed by stm32-dma driver. Add a way for the user to force direct mode, by setting bit 2 in the bitfield value specifying DMA features in the device tree. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20200422102904.1448-2-amelie.delaunay@st.com Signed-off-by: Vinod Koul commit 920c5974f0d3aff91b5751e7568b54752fb5d6da Author: Christophe JAILLET Date: Mon Apr 27 13:10:43 2020 +0200 dmaengine: qcom_hidma: Simplify error handling path in hidma_probe There is no need to call 'hidma_debug_uninit()' in the error handling path. 'hidma_debug_init()' has not been called yet. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200427111043.70218-1-christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit c0fca736098cbd5dce27640e625b20c67d5f99f1 Author: Lubomir Rintel Date: Fri Apr 24 23:50:20 2020 +0200 dmaengine: mmp_tdma: Validate the transfer direction We only support DMA_DEV_TO_MEM and DMA_MEM_TO_DEV. Let's not do undefined things with other values and reject them. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200424215020.105281-1-lkundrak@v3.sk Signed-off-by: Vinod Koul commit 7edfe3df2a9f469d8e80e4e1877a92377b5722ae Author: Alan Mikhak Date: Wed Apr 22 18:58:21 2020 -0700 dmaengine: dw-edma: Check MSI descriptor before copying Modify dw_edma_irq_request() to check if a struct msi_desc entry exists before copying the contents of its struct msi_msg pointer. Without this sanity check, __get_cached_msi_msg() crashes when invoked by dw_edma_irq_request() running on a Linux-based PCIe endpoint device. MSI interrupt are not received by PCIe endpoint devices. If irq_get_msi_desc() returns null, then there is no cached struct msi_msg to be copied. Reported-by: kbuild test robot Signed-off-by: Alan Mikhak Acked-by: Gustavo Pimentel Link: https://lore.kernel.org/r/1587607101-31914-1-git-send-email-alan.mikhak@sifive.com Signed-off-by: Vinod Koul commit bbb336f39efcb1b5498f65f59f9af5773ad6dc2b Author: Sanjay R Mehta Date: Sat Apr 25 14:59:48 2020 -0500 spi: spi-amd: Add AMD SPI controller driver support This driver supports SPI Controller for AMD SOCs.This driver supports SPI operations using FIFO mode of transfer. Signed-off-by: Sanjay R Mehta Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/1587844788-33997-1-git-send-email-sanju.mehta@amd.com Signed-off-by: Mark Brown commit 2d744ecf2b98405723a2138a547e5c75009bc4e5 Author: Mateusz Gorski Date: Mon Apr 27 15:27:27 2020 +0200 ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT Automatically choose DMIC pipeline format configuration depending on information included in NHLT. Change the access rights of appropriate kcontrols to read-only in order to prevent user interference. Signed-off-by: Mateusz Gorski Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200427132727.24942-4-mateusz.gorski@linux.intel.com Signed-off-by: Mark Brown commit 1b450791d517d4d6666ab9ab6d9a20c8819e3572 Author: Mateusz Gorski Date: Mon Apr 27 15:27:26 2020 +0200 ASoC: Intel: Multiple I/O PCM format support for pipe For pipes supporting multiple input/output formats, kcontrol is created and selection of pipe input and output configuration is done based on control set. If more than one configuration is supported, then this patch allows user to select configuration of choice using amixer settings. Signed-off-by: Mateusz Gorski Signed-off-by: Pavan K S Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200427132727.24942-3-mateusz.gorski@linux.intel.com Signed-off-by: Mark Brown commit 1b290ef023b3eeb4f4688b582fecb773915ef937 Author: Mateusz Gorski Date: Mon Apr 27 15:27:25 2020 +0200 ASoC: Intel: Skylake: Add alternative topology binary name Add alternative topology binary file name based on used machine driver and fallback to use this name after failed attempt to load topology file with name based on NHLT. This change addresses multiple issues with current mechanism, for example - there are devices without NHLT table, and that currently results in tplg_name being empty. Signed-off-by: Mateusz Gorski Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200427132727.24942-2-mateusz.gorski@linux.intel.com Signed-off-by: Mark Brown commit e5c9a223da3c5bb9563ecf4ebe0c32de39dbc620 Merge: dc234825997e 6a8b55ed4056 Author: Mark Brown Date: Mon Apr 27 15:04:50 2020 +0100 Merge tag 'v5.7-rc3' into spi-5.8 Linux 5.7-rc3 commit 48dd1a7938e37d6d6414a20266394f858b37f10a Author: Iskren Chernev Date: Sat Apr 25 15:53:35 2020 +0300 regulator: max77826: Remove erroneous additionalProperties In this particular location additionalProperties actually declares a property named `additionalProperties` instead of specifying there should be no other properties. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20200425125335.2674534-1-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit b430ff7ef8b016abcd8ebf8991920deb8750e351 Author: Yannick Fertre Date: Fri Feb 28 09:07:38 2020 +0100 drm/stm: ltdc: check number of endpoints Number of endpoints could exceed the fix value MAX_ENDPOINTS(2). Instead of increase simply this value, the number of endpoint could be read from device tree. Load sequence has been a little rework to take care of several panel or bridge which can be connected/disconnected or enable/disable. Signed-off-by: Yannick Fertre Signed-off-by: Benjamin Gaignard Link: https://patchwork.freedesktop.org/patch/msgid/1582877258-1112-1-git-send-email-yannick.fertre@st.com commit 77060f4f71dfb08309f461766d2e7453ce68aa76 Author: Tang Bin Date: Mon Apr 27 17:15:20 2020 +0800 ASoC: hisilicon: Use the defined variable to clean code Use the defined variable "dev" to make the code cleaner. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200427091520.12412-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit f3fc1ea011f09156886e8f4beb240ea814f2197a Author: Shengjiu Wang Date: Sat Apr 25 15:19:29 2020 +0800 ASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free() The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers" from Apr 16, 2020, leads to the following Smatch complaint: sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free() warn: variable dereferenced before check 'ctx' (see line 1527) sound/soc/fsl/fsl_easrc.c 1526 struct fsl_asrc_pair *ctx = runtime->private_data; 1527 struct fsl_easrc_ctx_priv *ctx_priv = ctx->private; ^^^^^ Dereference 1528 1529 if (ctx && (ctx_priv->ctx_streams & BIT(substream->stream))) { ^^^ This check is too late, to prevent a NULL dereference. 1530 ctx_priv->ctx_streams &= ~BIT(substream->stream); 1531 fsl_easrc_release_context(ctx); Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Reported-by: Dan Carpenter Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/d23c939f1c9eeb3fce34b6c34d44e2d6156f663a.1587799355.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 1597bfbfdb3c6e97ad0f63abedc2a26d6c1850c7 Author: Jason Yan Date: Sun Apr 26 17:42:38 2020 +0800 ASoC: ti: remove comparison to bool in omap_mcbsp_dai_set_dai_fmt() Fix the following coccicheck warning: sound/soc/ti/omap-mcbsp.c:1188:5-11: WARNING: Comparison to bool Signed-off-by: Jason Yan Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20200426094238.23914-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit e66f385354b3bd29b713d8ab8556aa889723928f Author: Tang Bin Date: Mon Apr 20 22:25:09 2020 +0800 ASoC: mxs-saif: Avoid unnecessary check The function mxs_saif_probe() is only called with an openfirmware platform device. Therefore there is no need to check that it has an openfirmware node. Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200420142509.9728-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit b1ca2f63e20b471e8f86e35b4b5f9407f8cb3021 Author: randerwang Date: Mon Apr 20 02:35:09 2020 +0800 ASoC: Intel: sof_sdw: add amp number in components string for ucm The number of speaker amplifiers may vary between platforms. UCM needs to check amp number to include different configuration files. This patch keeps track of the number of speaker amplifiers and stores it in components string of the card. Tested on Comet Lake platforms. Signed-off-by: randerwang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200419183509.4134-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit e782ddbb0873d4d96bda890b295130696e0739fc Author: Tang Bin Date: Mon Apr 27 17:11:45 2020 +0800 ASoC: hisilicon: Use IS_ERR() instead of IS_ERR_OR_NULL() In the function hi6210_i2s_probe(), devm_clk_get() doesn't return NULL. Thus use IS_ERR() to validate the return value instead of IS_ERR_OR_NULL(). Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200427091145.4268-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit e411eb257b331bf44cbe8845b5351260c8222c6c Author: Mao Wenan Date: Sun Apr 26 14:36:35 2020 +0800 libbpf: Return err if bpf_object__load failed bpf_object__load() has various return code, when it failed to load object, it must return err instead of -EINVAL. Signed-off-by: Mao Wenan Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200426063635.130680-3-maowenan@huawei.com commit c85c7cdef3c906d316bf04c0e452d45cf9452c67 Author: Colin Ian King Date: Mon Apr 20 23:12:29 2020 +0100 leds: trigger: remove redundant assignment to variable ret The variable ret is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Pavel Machek commit 9af512e81964a1b9a6ac7ae9b24507f99e557c36 Author: Linus Walleij Date: Wed Apr 15 16:51:39 2020 +0200 leds: netxbig: Convert to use GPIO descriptors This converts the NetXbig LED driver to use GPIO descriptors instead of using the legacy interfaces in and to iteratively parse the device tree for global GPIO numbers. Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek Tested-by: Simon Guinot commit 1fecbb71fe0e46b886f84e3b6decca6643c3af6d Author: Shengjiu Wang Date: Mon Apr 27 14:23:21 2020 +0800 ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet Disable exception interrupt before scheduling tasklet, otherwise if the tasklet isn't handled immediately, there will be endless xrun interrupt. Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun") Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/a8f2ad955aac9e52587beedc1133b3efbe746895.1587968824.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 1417cff96ef8ae2108df7084f035b90d2eabbba3 Author: Heikki Krogerus Date: Mon Apr 27 14:12:46 2020 +0300 usb: typec: ucsi: Fix the stub for ucsi_register_port_psy() The stub was ucsi_register_port() when it should have been ucsi_register_port_psy(). Cc: Abhilash K V Fixes: 992a60ed0d5e ("usb: typec: ucsi: register with power_supply class") Reported-by: kbuild test robot Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200427111246.4889-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit cae809434da10402b0fdbd395c6eb924d7aa46f4 Author: Tero Kristo Date: Thu Sep 26 15:20:24 2019 +0300 arm64: dts: ti: k3-j721e-main: Add main domain watchdog entries Add DT entries for main domain watchdog0 and 1 instances. Signed-off-by: Tero Kristo commit 4243cd5388c82ae8942510f349b798c62f89825c Author: Chris Wilson Date: Mon Apr 27 09:40:00 2020 +0100 drm/i915/gt: Sanitize GT first We see that if the HW doesn't actually sleep, the HW may eat the poison we set in its write-only HWSP during sanitize: intel_gt_resume.part.8: 0000:00:02.0 __gt_unpark: 0000:00:02.0 gt_sanitize: 0000:00:02.0 force:yes process_csb: 0000:00:02.0 vcs0: cs-irq head=5, tail=90 process_csb: 0000:00:02.0 vcs0: csb[0]: status=0x5a5a5a5a:0x5a5a5a5a assert_pending_valid: Nothing pending for promotion! The CS TAIL pointer should have been reset by reset_csb_pointers(), so in this case it is likely that we have read back from the CPU cache and so we must clflush our control over that page. In doing so, push the sanitisation to the start of the GT sequence so that our poisoning is assuredly before we start talking to the HW. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1794 Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200427084000.10999-1-chris@chris-wilson.co.uk commit 2759e395358b2b909577928894f856ab75bea41a Author: Chris Wilson Date: Mon Apr 27 10:30:38 2020 +0100 drm/i915/gt: Check cacheline is valid before acquiring The hwsp_cacheline pointer from i915_request is very, very flimsy. The i915_request.timeline (and the hwsp_cacheline) are lost upon retiring (after an RCU grace). Therefore we need to confirm that once we have the right pointer for the cacheline, it is not in the process of being retired and disposed of before we attempt to acquire a reference to the cacheline. <3>[ 547.208237] BUG: KASAN: use-after-free in active_debug_hint+0x6a/0x70 [i915] <3>[ 547.208366] Read of size 8 at addr ffff88822a0d2710 by task gem_exec_parall/2536 <4>[ 547.208547] CPU: 3 PID: 2536 Comm: gem_exec_parall Tainted: G U 5.7.0-rc2-ged7a286b5d02d-kasan_117+ #1 <4>[ 547.208556] Hardware name: Dell Inc. XPS 13 9350/, BIOS 1.4.12 11/30/2016 <4>[ 547.208564] Call Trace: <4>[ 547.208579] dump_stack+0x96/0xdb <4>[ 547.208707] ? active_debug_hint+0x6a/0x70 [i915] <4>[ 547.208719] print_address_description.constprop.6+0x16/0x310 <4>[ 547.208841] ? active_debug_hint+0x6a/0x70 [i915] <4>[ 547.208963] ? active_debug_hint+0x6a/0x70 [i915] <4>[ 547.208975] __kasan_report+0x137/0x190 <4>[ 547.209106] ? active_debug_hint+0x6a/0x70 [i915] <4>[ 547.209127] kasan_report+0x32/0x50 <4>[ 547.209257] ? i915_gemfs_fini+0x40/0x40 [i915] <4>[ 547.209376] active_debug_hint+0x6a/0x70 [i915] <4>[ 547.209389] debug_print_object+0xa7/0x220 <4>[ 547.209405] ? lockdep_hardirqs_on+0x348/0x5f0 <4>[ 547.209426] debug_object_assert_init+0x297/0x430 <4>[ 547.209449] ? debug_object_free+0x360/0x360 <4>[ 547.209472] ? lock_acquire+0x1ac/0x8a0 <4>[ 547.209592] ? intel_timeline_read_hwsp+0x4f/0x840 [i915] <4>[ 547.209737] ? i915_active_acquire_if_busy+0x66/0x120 [i915] <4>[ 547.209861] i915_active_acquire_if_busy+0x66/0x120 [i915] <4>[ 547.209990] ? __live_alloc.isra.15+0xc0/0xc0 [i915] <4>[ 547.210005] ? rcu_read_lock_sched_held+0xd0/0xd0 <4>[ 547.210017] ? print_usage_bug+0x580/0x580 <4>[ 547.210153] intel_timeline_read_hwsp+0xbc/0x840 [i915] <4>[ 547.210284] __emit_semaphore_wait+0xd5/0x480 [i915] <4>[ 547.210415] ? i915_fence_get_timeline_name+0x110/0x110 [i915] <4>[ 547.210428] ? lockdep_hardirqs_on+0x348/0x5f0 <4>[ 547.210442] ? _raw_spin_unlock_irq+0x2a/0x40 <4>[ 547.210567] ? __await_execution.constprop.51+0x2e0/0x570 [i915] <4>[ 547.210706] i915_request_await_dma_fence+0x8f7/0xc70 [i915] Fixes: 85bedbf191e8 ("drm/i915/gt: Eliminate the trylock for reading a timeline's hwsp") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.6+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200427093038.29219-1-chris@chris-wilson.co.uk commit 68ace460c5b2a96a82ee49ab0b589ceed8abd000 Author: Chris Wilson Date: Sun Apr 26 10:42:31 2020 +0100 drm/i915/execlists: Check preempt-timeout target before submit_ports We evaluate *active, which is a pointer into execlists->inflight[] during dequeue to decide how long a preempt-timeout we need to apply. However, as soon as we do the submit_ports, the HW may send its ACK interrupt causing us to promote execlists->pending[] tp execlists->inflight[], overwriting the value of *active. We know *active is only stable until we submit (as we only submit when there is no pending promotion). [ 16.102328] BUG: KCSAN: data-race in execlists_dequeue+0x1449/0x1600 [i915] [ 16.102356] [ 16.102375] race at unknown origin, with read to 0xffff8881e9500488 of 8 bytes by task 429 on cpu 1: [ 16.102780] execlists_dequeue+0x1449/0x1600 [i915] [ 16.103160] __execlists_submission_tasklet+0x48/0x60 [i915] [ 16.103540] execlists_submit_request+0x38e/0x3c0 [i915] [ 16.103940] submit_notify+0x8f/0xc0 [i915] [ 16.104308] __i915_sw_fence_complete+0x61/0x420 [i915] [ 16.104683] i915_sw_fence_complete+0x58/0x80 [i915] [ 16.105054] i915_sw_fence_commit+0x16/0x20 [i915] [ 16.105457] __i915_request_queue+0x60/0x70 [i915] [ 16.105843] i915_gem_do_execbuffer+0x2d6b/0x4230 [i915] [ 16.106227] i915_gem_execbuffer2_ioctl+0x2b0/0x580 [i915] [ 16.106257] drm_ioctl_kernel+0xe9/0x130 [ 16.106279] drm_ioctl+0x27d/0x45e [ 16.106311] ksys_ioctl+0x89/0xb0 [ 16.106336] __x64_sys_ioctl+0x42/0x60 [ 16.106370] do_syscall_64+0x6e/0x2c0 [ 16.106397] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200426094231.21995-1-chris@chris-wilson.co.uk commit 23b5ae2e8e1326c91b5dfdbb6ebcd5a6820074ae Author: Alex Shi Date: Fri Apr 17 22:50:31 2020 +0800 locking/rtmutex: Remove unused rt_mutex_cmpxchg_relaxed() Signed-off-by: Alex Shi Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/1587135032-188866-1-git-send-email-alex.shi@linux.alibaba.com commit 57dfcb5dce9949f967187d96b151156d039522c6 Author: Vignesh Raghavendra Date: Sun Mar 22 16:56:30 2020 +0530 arm64: dts: ti: k3-am65-main: Add ehrpwm nodes Add DT nodes for all ehrpwm instances present on AM654 EVM. Signed-off-by: Vignesh Raghavendra Signed-off-by: Tero Kristo commit e8014d83f60479d3981baeaa3a21c993ff832f3f Merge: 41aef04524d3 6a8b55ed4056 Author: Greg Kroah-Hartman Date: Mon Apr 27 12:20:40 2020 +0200 Merge 5.7-rc3 into staging-next We need the staging fixes in here too, and this resolves a merge issue with the vt6656 driver. Signed-off-by: Greg Kroah-Hartman commit 7b26aa243d3c4d9a564e87c17dc4317a67727335 Author: youngjun Date: Sun Apr 26 07:33:16 2020 -0700 inotify: Fix error return code assignment flow. If error code is initialized -EINVAL, there is no need to assign -EINVAL. Link: https://lore.kernel.org/r/20200426143316.29877-1-her0gyugyu@gmail.com Signed-off-by: youngjun Signed-off-by: Jan Kara commit 64f9147d914d355a9ca3bce5e9c901bd56d67e58 Author: Keerthy Date: Tue Apr 7 11:21:16 2020 +0530 arm64: dts: ti: am654: Add thermal zones The am654 SoC has three thermal zones namely MPU0, MPU1 and MCU zones. Signed-off-by: Keerthy Reviewed-by: Amit Kucheria Signed-off-by: Tero Kristo commit 7fd28c6ab83d7e9fe00b796d9fb779617ee5d86f Author: Keerthy Date: Tue Apr 7 11:21:15 2020 +0530 arm64: dts: ti: am65-wakeup: Add VTM node VTM stands for voltage and thermal management. Signed-off-by: Keerthy Reviewed-by: Amit Kucheria Signed-off-by: Tero Kristo commit cf8ae446bbcbf5c48214eb7ddaa6ac6e12f4633d Author: Yoshihiro Shimoda Date: Tue Apr 21 18:36:15 2020 +0900 arm64: dts: renesas: Fix IOMMU device node names Fix IOMMU device node names as "iommu@". Fixes: 8f507babc617 ("arm64: dts: renesas: r8a774a1: Add IPMMU device nodes") Fixes: 63093a8e58be ("arm64: dts: renesas: r8a774b1: Add IPMMU device nodes") Fixes: 6c7e02178e8f ("arm64: dts: renesas: r8a774c0: Add IPMMU device nodes") Fixes: 3b7e7848f0e8 ("arm64: dts: renesas: r8a7795: Add IPMMU device nodes") Fixes: e4b9a493df45 ("arm64: dts: renesas: r8a7795-es1: Add IPMMU device nodes") Fixes: 389baa409617 ("arm64: dts: renesas: r8a7796: Add IPMMU device nodes") Fixes: 55697cbb44e4 ("arm64: dts: renesas: r8a779{65,80,90}: Add IPMMU devices nodes") Fixes: ce3b52a1595b ("arm64: dts: renesas: r8a77970: Add IPMMU device nodes") Fixes: a3901e7398e1 ("arm64: dts: renesas: r8a77995: Add IPMMU device nodes") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/1587461775-13369-1-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit ae990a1de014396ffc8d0fcc31b6888c9b0ce59a Author: Yoshihiro Shimoda Date: Tue Apr 21 18:35:56 2020 +0900 ARM: dts: renesas: Fix IOMMU device node names Fix IOMMU device node names as "iommu@". Fixes: bbb44da0b595 ("ARM: dts: r8a7743: Add IPMMU DT nodes") Fixes: 0dcba3de5835 ("ARM: dts: r8a7745: Add IPMMU DT nodes") Fixes: 350ae49b97c4 ("ARM: dts: r8a7744: Add IPMMU DT nodes") Fixes: 70496727c082 ("ARM: shmobile: r8a7790: Add IPMMU DT nodes") Fixes: f1951852ed17 ("ARM: shmobile: r8a7791: Add IPMMU DT nodes") Fixes: 098cb3a601e6 ("ARM: shmobile: r8a7793: Add IPMMU nodes") Fixes: 1cb2794f6082 ("ARM: shmobile: r8a7794: Add IPMMU DT nodes") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/1587461756-13317-1-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 0836dacecf48a4fef6e625d4f64f9dea3a2aab8d Author: Tomi Valkeinen Date: Wed Apr 22 12:15:12 2020 +0300 arm64: dts: ti: k3-j721e-common-proc-board: add assigned clks for DSS The DSS related clock muxes are set via assigned-clocks in a way which provides us: VP0 - DisplayPort SST VP1 - DPI0 VP2 - DSI VP3 - DPI1 Signed-off-by: Tomi Valkeinen Signed-off-by: Tero Kristo commit 76921f15acc0758e7e6a0f84bf9c082b8240184b Author: Tomi Valkeinen Date: Wed Apr 22 12:15:11 2020 +0300 arm64: dts: ti: k3-j721e-main: Add DSS node Add DSS node for J721E SoC. Signed-off-by: Tomi Valkeinen Signed-off-by: Tero Kristo commit fc539b90eda229c02f5d8aee4d3a371cb22fc26d Author: Jyri Sarha Date: Wed Apr 22 12:15:10 2020 +0300 arm64: dts: ti: am654: Add DSS node Add DSS node to k3-am65-main.dtsi with labels for board specific support and syscon node for oldi-io-ctrl. Signed-off-by: Jyri Sarha Signed-off-by: Tomi Valkeinen Signed-off-by: Tero Kristo commit fea89b265f78b639c4845be6b3778a2957eac4bc Author: Geert Uytterhoeven Date: Mon Apr 20 17:15:53 2020 +0200 ARM: dts: shmobile: Update CMT1 compatible values New compatible values were introduced for the 48-bit CMT devices on SH-Mobile AG5 and R-Mobile A1, and the old "cmt-48"-based values were deprecated. However, the actual DTS files were never updated. See also commits: - 81b604c39997de91 ("dt-bindings: timer: renesas, cmt: Update CMT1 on sh73a0 and r8a7740"), - 8c1afba285a86b9d ("clocksource/drivers/sh_cmt: r8a7740 and sh73a0 SoC-specific match"), - 19d608458f4f3bb3 ("clocksource/drivers/sh_cmt: Document "cmt-48" as deprecated"). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200420151553.22975-1-geert+renesas@glider.be commit 14232c6e788cb1f7b96dbd08b077f90923324b24 Author: Lars Hofhansl Date: Thu Apr 23 14:57:09 2020 -0700 platform/x86: thinkpad_acpi: Add support for dual fan control This adds dual fan control for the following models: P50, P51, P52, P70, P71, P72, P1 gen1, P2 gen2, X1E gen1 and X1E gen2. Both fans are controlled together as if they were a single fan. Tested on an X1 Extreme Gen1, an X1 Extreme Gen2, and a P50. The patch is defensive, it adds only specific supported machines, and falls back to the old behavior if both fans cannot be controlled. Background: I tested the BIOS default behavior on my X1E gen2 and both fans are always changed together. So rather than adding controls for each fan, this controls both fans together as the BIOS would do. This was inspired by a discussion on dual fan support for the thinkfan tool (see link below). All BIOS IDs are taken from there. The X1E gen2 ID is verified on my machine. Thanks to GitHub users voidworker and civic9 for the earlier patches and BIOS IDs, and to users peter-stoll and sassman for testing the patch on their machines. BugLink: https://github.com/vmatare/thinkfan/issues/58 Signed-off-by: Lars Hofhansl [andy: massaged commit message to capitalize ID and convert to BugLink] Signed-off-by: Andy Shevchenko commit 366b8149fbff1965f9e25bb27dd4698d654be270 Author: Gustavo A. R. Silva Date: Mon Apr 20 13:14:01 2020 -0500 m68k: amiga: config: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20200420181401.GA32172@embeddedor Signed-off-by: Geert Uytterhoeven commit cef8ec8cbd21ac3dbb4e22adc752c8c183efa4a8 Author: Luca Weiss Date: Tue Apr 21 21:13:54 2020 +0200 leds: add sgm3140 driver Add a driver for the SGMICRO SGM3140 Buck/Boost Charge Pump LED driver. This device is controlled by two GPIO pins, one for enabling and the second one for switching between torch and flash mode. Signed-off-by: Luca Weiss Signed-off-by: Pavel Machek commit ea4407fa905aa5334a9176da21f3395bdcbe7bcd Author: Luca Weiss Date: Tue Apr 21 21:13:53 2020 +0200 dt-bindings: leds: Add binding for sgm3140 Add YAML devicetree binding for SGMICRO SGM3140 charge pump used for camera flash LEDs. Signed-off-by: Luca Weiss Reviewed-by: Dan Murphy Reviewed-by: Rob Herring Signed-off-by: Pavel Machek commit 03f613f0571fab238eaa8fcf2de54e4d35947fa6 Author: Lubomir Rintel Date: Sat Apr 25 00:02:40 2020 +0200 leds: ariel: Add driver for status LEDs on Dell Wyse 3020 This adds support for controlling the LEDs attached to the Embedded Controller on a Dell Wyse 3020 "Ariel" board. Signed-off-by: Lubomir Rintel Signed-off-by: Pavel Machek commit 44c606b0058b6670226af15229a56403d77d32dd Author: Denis Osterland-Heim Date: Tue Apr 21 13:09:14 2020 +0000 leds: pwm: check result of led_pwm_set() in led_pwm_add() led_pwm_set() now returns an error when setting the PWM fails. Signed-off-by: Denis Osterland-Heim Signed-off-by: Pavel Machek commit bfed0eded1ce00bda5cc2d2939b017f88e6b1fd0 Author: Rob Herring Date: Fri Apr 17 16:20:45 2020 -0500 clocksource/drivers/versatile: Allow CONFIG_CLKSRC_VERSATILE to be disabled The timer-versatile driver provides a sched_clock for certain Arm Ltd. reference platforms. Specifically, it is used on Versatile and 32-bit VExpress. It is not needed for those platforms with an arch timer (all the 64-bit ones) yet CONFIG_MFD_VEXPRESS_SYSREG does still need to be enabled. In that case, the timer-versatile can only be disabled when COMPILE_TEST is enabled which is not desirable. Let's use the sub-arch kconfig symbols instead. Realview platforms don't have the sysregs that this driver uses so correct the help text. Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Linus Walleij Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200417212045.16917-1-robh@kernel.org commit 9f4069b055d1508c833115df7493b6e0001e5c9b Author: Nick Desaulniers Date: Sun Apr 26 14:42:15 2020 -0700 drm/i915: re-disable -Wframe-address The top level Makefile disables this warning. When building an i386_defconfig with Clang, this warning is triggered a whole bunch via includes of headers from perf. Link: https://github.com/ClangBuiltLinux/continuous-integration/pull/182 Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200426214215.139435-1-ndesaulniers@google.com commit 5c447c18d1f73f94d8c8421e4aaf90e20cce7354 Author: Zou Wei Date: Thu Apr 23 15:21:58 2020 +0800 ACPI: CPPC: Make some symbols static Fix the following sparse warnings: drivers/acpi/cppc_acpi.c:353:20: warning: symbol 'cppc_mbox_cl' was not declared. Should it be static? drivers/acpi/cppc_acpi.c:600:5: warning: symbol 'pcc_data_alloc' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Rafael J. Wysocki commit 496121c02127e9c460b436244c38260b044cc45a Author: Zhang Rui Date: Wed Apr 22 15:26:07 2020 +0800 ACPI: processor: idle: Allow probing on platforms with one ACPI C-state It is possible for ACPI _CST to return only one ACPI C-state, for example, when deep cstate disabled in the BIOS. And it is better for the acpi_idle driver to probe succesfully in this case as well for consistency. Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 96fa72ffb2155dba9ba8c5d282a1ff19ed32f177 Merge: fbc35b45f9f6 6a8b55ed4056 Author: Greg Kroah-Hartman Date: Mon Apr 27 09:34:55 2020 +0200 Merge 5.7-rc3 into driver-core-next We need the driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 48a4cc950348c507580df79632ad53d8a08b6c0e Merge: 3275158fa52a 6a8b55ed4056 Author: Greg Kroah-Hartman Date: Mon Apr 27 09:34:02 2020 +0200 Merge 5.7-rc3 into char-misc-next We need the fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit e947861d0ccbc765af4512a395251e6af6857600 Merge: 6f1c0268a487 6a8b55ed4056 Author: Greg Kroah-Hartman Date: Mon Apr 27 09:33:21 2020 +0200 Merge 5.7-rc3 into tty-next We need the tty/serial fixes in here too. Signed-off-by: Greg Kroah-Hartman commit f6402eb4a2b3192bdf23fa39ef8e85fd3691cca9 Merge: 992a60ed0d5e 6a8b55ed4056 Author: Greg Kroah-Hartman Date: Mon Apr 27 09:32:30 2020 +0200 Merge 5.7-rc3 into usb-next We need the USB fixes in here too. Signed-off-by: Greg Kroah-Hartman commit 694cfd87b0c8a48af2f1afb225563571c0b975c4 Author: Ronald G. Minnich Date: Sat Apr 25 18:10:21 2020 -0700 x86/setup: Add an initrdmem= option to specify initrd physical address Add the initrdmem option: initrdmem=ss[KMG],nn[KMG] which is used to specify the physical address of the initrd, almost always an address in FLASH. Also add code for x86 to use the existing phys_init_start and phys_init_size variables in the kernel. This is useful in cases where a kernel and an initrd is placed in FLASH, but there is no firmware file system structure in the FLASH. One such situation occurs when unused FLASH space on UEFI systems has been reclaimed by, e.g., taking it from the Management Engine. For example, on many systems, the ME is given half the FLASH part; not only is 2.75M of an 8M part unused; but 10.75M of a 16M part is unused. This space can be used to contain an initrd, but need to tell Linux where it is. This space is "raw": due to, e.g., UEFI limitations: it can not be added to UEFI firmware volumes without rebuilding UEFI from source or writing a UEFI device driver. It can be referenced only as a physical address and size. At the same time, if a kernel can be "netbooted" or loaded from GRUB or syslinux, the option of not using the physical address specification should be available. Then, it is easy to boot the kernel and provide an initrd; or boot the the kernel and let it use the initrd in FLASH. In practice, this has proven to be very helpful when integrating Linux into FLASH on x86. Hence, the most flexible and convenient path is to enable the initrdmem command line option in a way that it is the last choice tried. For example, on the DigitalLoggers Atomic Pi, an image into FLASH can be burnt in with a built-in command line which includes: initrdmem=0xff968000,0x200000 which specifies a location and size. [ bp: Massage commit message, make it passive. ] [akpm@linux-foundation.org: coding style fixes] Signed-off-by: Ronald G. Minnich Signed-off-by: Andrew Morton Signed-off-by: Borislav Petkov Reviewed-by: H. Peter Anvin (Intel) Link: http://lkml.kernel.org/r/CAP6exYLK11rhreX=6QPyDQmW7wPHsKNEFtXE47pjx41xS6O7-A@mail.gmail.com Link: https://lkml.kernel.org/r/20200426011021.1cskg0AGd%akpm@linux-foundation.org commit 25259f7a5de2de9d67793dc584b15c83a3134c93 Author: Michael Ellerman Date: Sun Apr 26 22:43:56 2020 +1000 clocksource/drivers/timer-microchip-pit64b: Select CONFIG_TIMER_OF This driver is an OF driver, it depends on OF, and uses TIMER_OF_DECLARE, so it should select CONFIG_TIMER_OF. Without CONFIG_TIMER_OF enabled this can lead to warnings such as: powerpc-linux-ld: warning: orphan section `__timer_of_table' from `drivers/clocksource/timer-microchip-pit64b.o' being placed in section `__timer_of_table'. Because TIMER_OF_TABLES in vmlinux.lds.h doesn't emit anything into the linker script when CONFIG_TIMER_OF is not enabled. Fixes: 625022a5f160 ("clocksource/drivers/timer-microchip-pit64b: Add Microchip PIT64B support") Cc: stable@vger.kernel.org # v5.6+ Reported-by: kbuild test robot Signed-off-by: Michael Ellerman Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200426124356.3929682-1-mpe@ellerman.id.au commit e62905ae34eaf5fe2cfb254be5e0c097b3b1f798 Author: Nicolas Dichtel Date: Thu Apr 23 11:39:20 2020 +0200 xfrm interface: don't take extra reference to netdev I don't see any reason to do this. Maybe needed before commit 56c5ee1a5823 ("xfrm interface: fix memory leak on creation"). Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert commit 32927393dc1ccd60fb2bdc05b9e8e88753761469 Author: Christoph Hellwig Date: Fri Apr 24 08:43:38 2020 +0200 sysctl: pass kernel pointers to ->proc_handler Instead of having all the sysctl handlers deal with user pointers, which is rather hairy in terms of the BPF interaction, copy the input to and from userspace in common code. This also means that the strings are always NUL-terminated by the common code, making the API a little bit safer. As most handler just pass through the data to one of the common handlers a lot of the changes are mechnical. Signed-off-by: Christoph Hellwig Acked-by: Andrey Ignatov Signed-off-by: Al Viro commit f461d2dcd511c020a26d4d791fae595c65ed09b6 Author: Christoph Hellwig Date: Fri Apr 24 08:43:37 2020 +0200 sysctl: avoid forward declarations Move the sysctl tables to the end of the file to avoid lots of pointless forward declarations. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 2374c09b1c8a883bb9b4b2fc3756703eeb618f4a Author: Christoph Hellwig Date: Fri Apr 24 08:43:36 2020 +0200 sysctl: remove all extern declaration from sysctl.c Extern declarations in .c files are a bad style and can lead to mismatches. Use existing definitions in headers where they exist, and otherwise move the external declarations to suitable header files. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 26363af5643490a817272e1cc6f1d3f1d550a699 Author: Christoph Hellwig Date: Fri Apr 24 08:43:35 2020 +0200 mm: remove watermark_boost_factor_sysctl_handler watermark_boost_factor_sysctl_handler is just a pointless wrapper for proc_dointvec_minmax, so remove it and use proc_dointvec_minmax directly. Signed-off-by: Christoph Hellwig Acked-by: David Rientjes Signed-off-by: Al Viro commit 59a022cc14cf84c6405efc1571045683c258a1f5 Author: Wen Gong Date: Thu Apr 23 10:41:34 2020 +0800 ath10k: add statistics of tx retries and tx failed when tx complete disable When tx complete is disabled, all tx status will be set with status HTT_TX_COMPL_STATE_ACK and indicate to mac80211 by ieee80211_tx_status, then it does not have the statistics for retries and failed packets. count of tx retries and tx failed of command "iw wlan0 station dump" are both 0. If tx complete is not disabled, then firmware report the tx status and ath10k indicate the status to mac80211, then mac80211 save the statistics and command "iw wlan0 station dump" show them. for example: localhost ~ # iw dev wlan0 station dump Station 3c:28:6d:96:fd:69 (on wlan0) inactive time: 5 ms rx bytes: 1325012 rx packets: 6477 tx bytes: 85264 tx packets: 518 tx retries: 0 tx failed: 0 This patch only effect chips with tx complete disabled, e.g. SDIO. with this patch, output of command "iw dev wlan0 station dump": Station c4:04:15:5d:97:22 (on wlan0) inactive time: 608 ms rx bytes: 180366 rx packets: 991 tx bytes: 98765577 tx packets: 64624 tx retries: 14682 tx failed: 47086 Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200423024134.10601-1-wgong@codeaurora.org commit 4913e675630ec1a15c92651f426a63755c71b91b Author: Wen Gong Date: Thu Apr 23 10:27:58 2020 +0800 ath10k: enable rx duration report default for wmi tlv When run command "iw dev wlan0 station dump", the rx duration is 0. When firmware indicate WMI_UPDATE_STATS_EVENTID, extended flag of statsis not set by default, so firmware do not report rx duration. one sample: localhost # iw wlan0 station dump Station c4:04:15:5d:97:22 (on wlan0) inactive time: 48 ms rx bytes: 21670 rx packets: 147 tx bytes: 11529 tx packets: 100 tx retries: 88 tx failed: 36 beacon loss: 1 beacon rx: 31 rx drop misc: 47 signal: -72 [-74, -75] dBm signal avg: -71 [-74, -75] dBm beacon signal avg: -71 dBm tx bitrate: 54.0 MBit/s MCS 3 40MHz rx bitrate: 1.0 MBit/s rx duration: 0 us This patch enable firmware's extened flag of stats by setting flag WMI_TLV_STAT_PEER_EXTD of ar->fw_stats_req_mask which is set in ath10k_core_init_firmware_features via WMI_REQUEST_STATS_CMDID. After apply this patch, rx duration show value with the command: Station c4:04:15:5d:97:22 (on wlan0) inactive time: 883 ms rx bytes: 44289 rx packets: 265 tx bytes: 10838 tx packets: 93 tx retries: 899 tx failed: 103 beacon loss: 0 beacon rx: 78 rx drop misc: 46 signal: -71 [-74, -76] dBm signal avg: -70 [-74, -76] dBm beacon signal avg: -70 dBm tx bitrate: 54.0 MBit/s MCS 3 40MHz rx bitrate: 1.0 MBit/s rx duration: 358004 us This patch do not have side effect for all chips, because function ath10k_debug_fw_stats_request is already exported to debugfs "fw_stats" and WMI_REQUEST_STATS_CMDID is safely sent after condition checked by ath10k_peer_stats_enabled in ath10k_sta_statistics. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200423022758.5365-1-wgong@codeaurora.org commit 5cb899dd5ba430bd2debf6e4ce7b5cece9e9025d Author: Karthikeyan Periyasamy Date: Wed Apr 22 16:16:18 2020 +0530 ath11k: fix reo flush send we are sending the reo flush command for the deleted peer tid after the ageout period reaches 1 second. This handling causes reo ring get full when more than 128 clients are disconnected continuously. so added the count for flush list and reo flush command is triggered after the list count reaches the threshold value, it is configured as 64 (half of the reo ring). This will avoid the situation where reo ring get full. Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587552378-4884-1-git-send-email-periyasa@codeaurora.org commit 568776f992c4cb5e1b5715dc4ab62e6ae906b80d Author: Andy Shevchenko Date: Thu Apr 23 18:32:11 2020 +0300 zonefs: Replace uuid_copy() with import_uuid() There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting. Signed-off-by: Andy Shevchenko Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Signed-off-by: Damien Le Moal commit 74f99482eae03195ced512b440b31d62bdb6e943 Author: Bodong Wang Date: Tue Apr 21 10:04:16 2020 -0500 netfilter: nf_conntrack: add IPS_HW_OFFLOAD status bit This bit indicates that the conntrack entry is offloaded to hardware flow table. nf_conntrack entry will be tagged with [HW_OFFLOAD] if it's offload to hardware. cat /proc/net/nf_conntrack ipv4 2 tcp 6 \ src=1.1.1.17 dst=1.1.1.16 sport=56394 dport=5001 \ src=1.1.1.16 dst=1.1.1.17 sport=5001 dport=56394 [HW_OFFLOAD] \ mark=0 zone=0 use=3 Note that HW_OFFLOAD/OFFLOAD/ASSURED are mutually exclusive. Changelog: * V1->V2: - Remove check of lastused from stats. It was meant for cases such as removing driver module while traffic still running. Better to handle such cases from garbage collector. Signed-off-by: Bodong Wang Reviewed-by: Oz Shlomo Reviewed-by: Paul Blakey Signed-off-by: Pablo Neira Ayuso commit 21953ee5013d6632bee90ec89f2df59c69050db0 Author: Thomas Gleixner Date: Sun Apr 26 18:55:15 2020 +0200 x86/cpu: Export native_write_cr4() only when CONFIG_LKTDM=m Modules have no business poking into this but fixing this is for later. [ bp: Carve out from an earlier patch. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200421092558.939985695@linutronix.de commit f131bd3eee9745cc77701296e8bb7ca2b8d3345b Merge: 6f8a57ccf851 234589012ba0 Author: Alexei Starovoitov Date: Sun Apr 26 10:00:37 2020 -0700 Merge branch 'cloudflare-prog' Lorenz Bauer says: ==================== We've been developing an in-house L4 load balancer based on XDP and TC for a while. Following Alexei's call for more up-to-date examples of production BPF in the kernel tree [1], Cloudflare is making this available under dual GPL-2.0 or BSD 3-clause terms. The code requires at least v5.3 to function correctly. 1: https://lore.kernel.org/bpf/20200326210719.den5isqxntnoqhmv@ast-mbp/ ==================== Signed-off-by: Alexei Starovoitov commit 234589012ba0e5bf448e3fdbbac0f4c265dbdd7b Author: Lorenz Bauer Date: Fri Apr 24 19:55:55 2020 +0100 selftests/bpf: Add cls_redirect classifier cls_redirect is a TC clsact based replacement for the glb-redirect iptables module available at [1]. It enables what GitHub calls "second chance" flows [2], similarly proposed by the Beamer paper [3]. In contrast to glb-redirect, it also supports migrating UDP flows as long as connected sockets are used. cls_redirect is in production at Cloudflare, as part of our own L4 load balancer. We have modified the encapsulation format slightly from glb-redirect: glbgue_chained_routing.private_data_type has been repurposed to form a version field and several flags. Both have been arranged in a way that a private_data_type value of zero matches the current glb-redirect behaviour. This means that cls_redirect will understand packets in glb-redirect format, but not vice versa. The test suite only covers basic features. For example, cls_redirect will correctly forward path MTU discovery packets, but this is not exercised. It is also possible to switch the encapsulation format to GRE on the last hop, which is also not tested. There are two major distinctions from glb-redirect: first, cls_redirect relies on receiving encapsulated packets directly from a router. This is because we don't have access to the neighbour tables from BPF, yet. See forward_to_next_hop for details. Second, cls_redirect performs decapsulation instead of using separate ipip and sit tunnel devices. This avoids issues with the sit tunnel [4] and makes deploying the classifier easier: decapsulated packets appear on the same interface, so existing firewall rules continue to work as expected. The code base started it's life on v4.19, so there are most likely still hold overs from old workarounds. In no particular order: - The function buf_off is required to defeat a clang optimization that leads to the verifier rejecting the program due to pointer arithmetic in the wrong order. - The function pkt_parse_ipv6 is force inlined, because it would otherwise be rejected due to returning a pointer to stack memory. - The functions fill_tuple and classify_tcp contain kludges, because we've run out of function arguments. - The logic in general is rather nested, due to verifier restrictions. I think this is either because the verifier loses track of constants on the stack, or because it can't track enum like variables. 1: https://github.com/github/glb-director/tree/master/src/glb-redirect 2: https://github.com/github/glb-director/blob/master/docs/development/second-chance-design.md 3: https://www.usenix.org/conference/nsdi18/presentation/olteanu 4: https://github.com/github/glb-director/issues/64 Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200424185556.7358-2-lmb@cloudflare.com commit bfe3d8f6313d1e10806062ba22c5f660dddecbcc Author: Thomas Gleixner Date: Tue Apr 21 11:20:43 2020 +0200 x86/tlb: Restrict access to tlbstate Hide tlbstate, flush_tlb_info and related helpers when tlbflush.h is included from a module. Modules have absolutely no business with these internals. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092600.328438734@linutronix.de commit 8a29204f3e97d626b3b3c4589d00fbee1c95444c Author: Thomas Gleixner Date: Tue Apr 21 11:20:42 2020 +0200 xen/privcmd: Remove unneeded asm/tlb.h include Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092600.236617960@linutronix.de commit 6c9b7d79a801074837c683fc996e231266ca47ae Author: Thomas Gleixner Date: Tue Apr 21 11:20:41 2020 +0200 x86/tlb: Move PCID helpers where they are used Aside of the fact that they are used only in the TLB code, especially having the comment close to the actual implementation makes a lot of sense. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092600.145772183@linutronix.de commit 6f8a57ccf8511724e6f48d732cb2940889789ab2 Author: Andrii Nakryiko Date: Thu Apr 23 12:58:50 2020 -0700 bpf: Make verifier log more relevant by default To make BPF verifier verbose log more releavant and easier to use to debug verification failures, "pop" parts of log that were successfully verified. This has effect of leaving only verifier logs that correspond to code branches that lead to verification failure, which in practice should result in much shorter and more relevant verifier log dumps. This behavior is made the default behavior and can be overriden to do exhaustive logging by specifying BPF_LOG_LEVEL2 log level. Using BPF_LOG_LEVEL2 to disable this behavior is not ideal, because in some cases it's good to have BPF_LOG_LEVEL2 per-instruction register dump verbosity, but still have only relevant verifier branches logged. But for this patch, I didn't want to add any new flags. It might be worth-while to just rethink how BPF verifier logging is performed and requested and streamline it a bit. But this trimming of successfully verified branches seems to be useful and a good default behavior. To test this, I modified runqslower slightly to introduce read of uninitialized stack variable. Log (**truncated in the middle** to save many lines out of this commit message) BEFORE this change: ; int handle__sched_switch(u64 *ctx) 0: (bf) r6 = r1 ; struct task_struct *prev = (struct task_struct *)ctx[1]; 1: (79) r1 = *(u64 *)(r6 +8) func 'sched_switch' arg1 has btf_id 151 type STRUCT 'task_struct' 2: (b7) r2 = 0 ; struct event event = {}; 3: (7b) *(u64 *)(r10 -24) = r2 last_idx 3 first_idx 0 regs=4 stack=0 before 2: (b7) r2 = 0 4: (7b) *(u64 *)(r10 -32) = r2 5: (7b) *(u64 *)(r10 -40) = r2 6: (7b) *(u64 *)(r10 -48) = r2 ; if (prev->state == TASK_RUNNING) [ ... instruction dump from insn #7 through #50 are cut out ... ] 51: (b7) r2 = 16 52: (85) call bpf_get_current_comm#16 last_idx 52 first_idx 42 regs=4 stack=0 before 51: (b7) r2 = 16 ; bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, 53: (bf) r1 = r6 54: (18) r2 = 0xffff8881f3868800 56: (18) r3 = 0xffffffff 58: (bf) r4 = r7 59: (b7) r5 = 32 60: (85) call bpf_perf_event_output#25 last_idx 60 first_idx 53 regs=20 stack=0 before 59: (b7) r5 = 32 61: (bf) r2 = r10 ; event.pid = pid; 62: (07) r2 += -16 ; bpf_map_delete_elem(&start, &pid); 63: (18) r1 = 0xffff8881f3868000 65: (85) call bpf_map_delete_elem#3 ; } 66: (b7) r0 = 0 67: (95) exit from 44 to 66: safe from 34 to 66: safe from 11 to 28: R1_w=inv0 R2_w=inv0 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm???? fp-24_w=00000000 fp-32_w=00000000 fp-40_w=00000000 fp-48_w=00000000 ; bpf_map_update_elem(&start, &pid, &ts, 0); 28: (bf) r2 = r10 ; 29: (07) r2 += -16 ; tsp = bpf_map_lookup_elem(&start, &pid); 30: (18) r1 = 0xffff8881f3868000 32: (85) call bpf_map_lookup_elem#1 invalid indirect read from stack off -16+0 size 4 processed 65 insns (limit 1000000) max_states_per_insn 1 total_states 5 peak_states 5 mark_read 4 Notice how there is a successful code path from instruction 0 through 67, few successfully verified jumps (44->66, 34->66), and only after that 11->28 jump plus error on instruction #32. AFTER this change (full verifier log, **no truncation**): ; int handle__sched_switch(u64 *ctx) 0: (bf) r6 = r1 ; struct task_struct *prev = (struct task_struct *)ctx[1]; 1: (79) r1 = *(u64 *)(r6 +8) func 'sched_switch' arg1 has btf_id 151 type STRUCT 'task_struct' 2: (b7) r2 = 0 ; struct event event = {}; 3: (7b) *(u64 *)(r10 -24) = r2 last_idx 3 first_idx 0 regs=4 stack=0 before 2: (b7) r2 = 0 4: (7b) *(u64 *)(r10 -32) = r2 5: (7b) *(u64 *)(r10 -40) = r2 6: (7b) *(u64 *)(r10 -48) = r2 ; if (prev->state == TASK_RUNNING) 7: (79) r2 = *(u64 *)(r1 +16) ; if (prev->state == TASK_RUNNING) 8: (55) if r2 != 0x0 goto pc+19 R1_w=ptr_task_struct(id=0,off=0,imm=0) R2_w=inv0 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-24_w=00000000 fp-32_w=00000000 fp-40_w=00000000 fp-48_w=00000000 ; trace_enqueue(prev->tgid, prev->pid); 9: (61) r1 = *(u32 *)(r1 +1184) 10: (63) *(u32 *)(r10 -4) = r1 ; if (!pid || (targ_pid && targ_pid != pid)) 11: (15) if r1 == 0x0 goto pc+16 from 11 to 28: R1_w=inv0 R2_w=inv0 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm???? fp-24_w=00000000 fp-32_w=00000000 fp-40_w=00000000 fp-48_w=00000000 ; bpf_map_update_elem(&start, &pid, &ts, 0); 28: (bf) r2 = r10 ; 29: (07) r2 += -16 ; tsp = bpf_map_lookup_elem(&start, &pid); 30: (18) r1 = 0xffff8881db3ce800 32: (85) call bpf_map_lookup_elem#1 invalid indirect read from stack off -16+0 size 4 processed 65 insns (limit 1000000) max_states_per_insn 1 total_states 5 peak_states 5 mark_read 4 Notice how in this case, there are 0-11 instructions + jump from 11 to 28 is recorded + 28-32 instructions with error on insn #32. test_verifier test runner was updated to specify BPF_LOG_LEVEL2 for VERBOSE_ACCEPT expected result due to potentially "incomplete" success verbose log at BPF_LOG_LEVEL1. On success, verbose log will only have a summary of number of processed instructions, etc, but no branch tracing log. Having just a last succesful branch tracing seemed weird and confusing. Having small and clean summary log in success case seems quite logical and nice, though. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200423195850.1259827-1-andriin@fb.com commit af5c40c6ee057c5354930abdc4d34be013d0e9e0 Author: Thomas Gleixner Date: Tue Apr 21 11:20:40 2020 +0200 x86/tlb: Uninline nmi_uaccess_okay() cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. nmi_access_ok() is the last inline function which requires access to cpu_tlbstate. Move it into the TLB code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092600.052543007@linutronix.de commit 71d19214776e61b33da48f7c1b46e522c7f78221 Author: Maciej Żenczykowski Date: Sun Apr 26 09:15:25 2020 -0700 bpf: add bpf_ktime_get_boot_ns() On a device like a cellphone which is constantly suspending and resuming CLOCK_MONOTONIC is not particularly useful for keeping track of or reacting to external network events. Instead you want to use CLOCK_BOOTTIME. Hence add bpf_ktime_get_boot_ns() as a mirror of bpf_ktime_get_ns() based around CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. Signed-off-by: Maciej Żenczykowski Signed-off-by: Alexei Starovoitov commit 0a05861f80fe7d4dcfdabcc98d9854947573e072 Author: Tobias Klauser Date: Wed Apr 22 01:29:27 2020 +0200 xsk: Fix typo in xsk_umem_consume_tx and xsk_generic_xmit comments s/backpreassure/backpressure/ Signed-off-by: Tobias Klauser Signed-off-by: Alexei Starovoitov Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20200421232927.21082-1-tklauser@distanz.ch commit 96f59fe291d2cdc0fcb6f5f2f4b7c9cea9533fc3 Author: Thomas Gleixner Date: Tue Apr 21 11:20:39 2020 +0200 x86/tlb: Move cr4_set_bits_and_update_boot() to the usage site No point in having this exposed. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.940978251@linutronix.de commit 0cf2ea1121aa14f6873ed2907a3e27b62c87fcbe Author: Jiaxun Yang Date: Wed Apr 22 22:43:44 2020 +0800 MIPS: Kernel: Identify Loongson-2K processors Loongson-2K (Loongson64 Reduced) is a family of SoC shipped with gs264e core. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 69de6c1a7fc730260d39f09432d69abc99f5f344 Author: Thomas Gleixner Date: Tue Apr 21 11:20:38 2020 +0200 x86/tlb: Move paravirt_tlb_remove_table() to the usage site Move it where the only user is. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.849801011@linutronix.de commit 4b04e6c236744635eb4852bd9690172734fa0a1c Author: Thomas Gleixner Date: Tue Apr 21 11:20:37 2020 +0200 x86/tlb: Move __flush_tlb_all() out of line Reduce the number of required exports to one and make flush_tlb_global() static to the TLB code. flush_tlb_local() cannot be confined to the TLB code as the MTRR handling requires a PGE-less flush. Suggested-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200421092559.740388137@linutronix.de commit 082b57e3eb09810d357083cca5ee2df02c16aec9 Author: Maciej Żenczykowski Date: Mon Apr 20 11:47:50 2020 -0700 net: bpf: Make bpf_ktime_get_ns() available to non GPL programs The entire implementation is in kernel/bpf/helpers.c: BPF_CALL_0(bpf_ktime_get_ns) { /* NMI safe access to clock monotonic */ return ktime_get_mono_fast_ns(); } const struct bpf_func_proto bpf_ktime_get_ns_proto = { .func = bpf_ktime_get_ns, .gpl_only = false, .ret_type = RET_INTEGER, }; and this was presumably marked GPL due to kernel/time/timekeeping.c: EXPORT_SYMBOL_GPL(ktime_get_mono_fast_ns); and while that may make sense for kernel modules (although even that is doubtful), there is currently AFAICT no other source of time available to ebpf. Furthermore this is really just equivalent to clock_gettime(CLOCK_MONOTONIC) which is exposed to userspace (via vdso even to make it performant)... As such, I see no reason to keep the GPL restriction. (In the future I'd like to have access to time from Apache licensed ebpf code) Signed-off-by: Maciej Żenczykowski Signed-off-by: Alexei Starovoitov commit 6f3f65d80dac8f2bafce2213005821fccdce194c Author: Lorenzo Colitti Date: Mon Apr 20 11:34:08 2020 -0700 net: bpf: Allow TC programs to call BPF_FUNC_skb_change_head This allows TC eBPF programs to modify and forward (redirect) packets from interfaces without ethernet headers (for example cellular) to interfaces with (for example ethernet/wifi). The lack of this appears to simply be an oversight. Tested: in active use in Android R on 4.14+ devices for ipv6 cellular to wifi tethering offload. Signed-off-by: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Signed-off-by: Alexei Starovoitov commit 6890896bd765b0504761c61901c9804fca23bfb2 Author: Stanislav Fomichev Date: Fri Apr 24 16:59:41 2020 -0700 bpf: Fix missing bpf_base_func_proto in cgroup_base_func_proto for CGROUP_NET=n linux-next build bot reported compile issue [1] with one of its configs. It looks like when we have CONFIG_NET=n and CONFIG_BPF{,_SYSCALL}=y, we are missing the bpf_base_func_proto definition (from net/core/filter.c) in cgroup_base_func_proto. I'm reshuffling the code a bit to make it work. The common helpers are moved into kernel/bpf/helpers.c and the bpf_base_func_proto is exported from there. Also, bpf_get_raw_cpu_id goes into kernel/bpf/core.c akin to existing bpf_user_rnd_u32. [1] https://lore.kernel.org/linux-next/CAKH8qBsBvKHswiX1nx40LgO+BGeTmb1NX8tiTttt_0uu6T3dCA@mail.gmail.com/T/#mff8b0c083314c68c2e2ef0211cb11bc20dc13c72 Fixes: 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}") Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Cc: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200424235941.58382-1-sdf@google.com commit 745abfaa9eafa597d31fdf24a3249e5206a98768 Author: Luke Nelson Date: Mon Apr 20 17:28:04 2020 -0700 bpf, riscv: Fix tail call count off by one in RV32 BPF JIT This patch fixes an off by one error in the RV32 JIT handling for BPF tail call. Currently, the code decrements TCC before checking if it is less than zero. This limits the maximum number of tail calls to 32 instead of 33 as in other JITs. The fix is to instead check the old value of TCC before decrementing. Fixes: 5f316b65e99f ("riscv, bpf: Add RV32G eBPF JIT") Signed-off-by: Luke Nelson Signed-off-by: Alexei Starovoitov Acked-by: Xi Wang Link: https://lore.kernel.org/bpf/20200421002804.5118-1-luke.r.nels@gmail.com commit ae460c022453337850bdc36a36bf7596a6cfcf99 Author: Yoshiki Komachi Date: Tue Apr 21 09:05:27 2020 +0900 bpf_helpers.h: Add note for building with vmlinux.h or linux/types.h The following error was shown when a bpf program was compiled without vmlinux.h auto-generated from BTF: # clang -I./linux/tools/lib/ -I/lib/modules/$(uname -r)/build/include/ \ -O2 -Wall -target bpf -emit-llvm -c bpf_prog.c -o bpf_prog.bc ... In file included from linux/tools/lib/bpf/bpf_helpers.h:5: linux/tools/lib/bpf/bpf_helper_defs.h:56:82: error: unknown type name '__u64' ... It seems that bpf programs are intended for being built together with the vmlinux.h (which will have all the __u64 and other typedefs). But users may mistakenly think "include " is missing because the vmlinux.h is not common for non-bpf developers. IMO, an explicit comment therefore should be added to bpf_helpers.h as this patch shows. Signed-off-by: Yoshiki Komachi Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1587427527-29399-1-git-send-email-komachi.yoshiki@gmail.com commit 0456ea170cd665ddbb9503be92e39f96055dd5fa Author: Stanislav Fomichev Date: Mon Apr 20 10:46:10 2020 -0700 bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT} Currently the following prog types don't fall back to bpf_base_func_proto() (instead they have cgroup_base_func_proto which has a limited set of helpers from bpf_base_func_proto): * BPF_PROG_TYPE_CGROUP_DEVICE * BPF_PROG_TYPE_CGROUP_SYSCTL * BPF_PROG_TYPE_CGROUP_SOCKOPT I don't see any specific reason why we shouldn't use bpf_base_func_proto(), every other type of program (except bpf-lirc and, understandably, tracing) use it, so let's fall back to bpf_base_func_proto for those prog types as well. This basically boils down to adding access to the following helpers: * BPF_FUNC_get_prandom_u32 * BPF_FUNC_get_smp_processor_id * BPF_FUNC_get_numa_node_id * BPF_FUNC_tail_call * BPF_FUNC_ktime_get_ns * BPF_FUNC_spin_lock (CAP_SYS_ADMIN) * BPF_FUNC_spin_unlock (CAP_SYS_ADMIN) * BPF_FUNC_jiffies64 (CAP_SYS_ADMIN) I've also added bpf_perf_event_output() because it's really handy for logging and debugging. Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200420174610.77494-1-sdf@google.com commit 93e516894752e8b2ae3c2e7671e3ea33e27e3898 Author: Jagadeesh Pagadala Date: Sun Apr 19 11:09:17 2020 +0530 tools/bpf/bpftool: Remove duplicate headers Code cleanup: Remove duplicate headers which are included twice. Signed-off-by: Jagadeesh Pagadala Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/1587274757-14101-1-git-send-email-jagdsh.linux@gmail.com commit b0b3fb6759220d4fa359e9ac486859c9d422c204 Author: Mao Wenan Date: Sat Apr 18 09:37:35 2020 +0800 bpf: Remove set but not used variable 'dst_known' Fixes gcc '-Wunused-but-set-variable' warning: kernel/bpf/verifier.c:5603:18: warning: variable ‘dst_known’ set but not used [-Wunused-but-set-variable], delete this variable. Signed-off-by: Mao Wenan Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200418013735.67882-1-maowenan@huawei.com commit 598cc93005636e32a98ed003b0158329827c0ccb Author: Alan Stern Date: Sat Apr 25 16:35:40 2020 -0400 PM: sleep: Helpful edits for devices.rst documentation Here are some minor edits of the devices.rst documentation file, intended to improve the clarity and add a couple of missing details. Signed-off-by: Alan Stern Signed-off-by: Rafael J. Wysocki commit e2e13925ff74afa011e8c667cd9ceda38f254fc5 Author: Tiezhu Yang Date: Sun Apr 26 17:30:45 2020 +0800 MIPS: Loongson: Add support for perf tool In order to use perf tool on the Loongson platform, we should enable kernel support for various performance events provided by software and hardware, so add CONFIG_PERF_EVENTS=y to loongson3_defconfig. E.g. without this patch: [loongson@localhost perf]$ ./perf list List of pre-defined events (to be used in -e): duration_time [Tool event] rNNN [Raw hardware event descriptor] cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor] (see 'man perf-list' on how to encode it) mem:[/len][:access] [Hardware breakpoint] With this patch: [loongson@localhost perf]$ ./perf list List of pre-defined events (to be used in -e): branch-instructions OR branches [Hardware event] branch-misses [Hardware event] cpu-cycles OR cycles [Hardware event] instructions [Hardware event] alignment-faults [Software event] bpf-output [Software event] context-switches OR cs [Software event] cpu-clock [Software event] cpu-migrations OR migrations [Software event] dummy [Software event] emulation-faults [Software event] major-faults [Software event] minor-faults [Software event] page-faults OR faults [Software event] task-clock [Software event] duration_time [Tool event] L1-dcache-load-misses [Hardware cache event] L1-dcache-store-misses [Hardware cache event] L1-icache-load-misses [Hardware cache event] branch-load-misses [Hardware cache event] branch-loads [Hardware cache event] dTLB-load-misses [Hardware cache event] dTLB-store-misses [Hardware cache event] iTLB-load-misses [Hardware cache event] rNNN [Raw hardware event descriptor] cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor] (see 'man perf-list' on how to encode it) mem:[/len][:access] [Hardware breakpoint] Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit a44f83092d716d8a5e5e1a2620b68cf720c2ed2a Author: Huacai Chen Date: Sun Apr 26 19:09:52 2020 +0800 MIPS: Rename the "Fill" cache ops to avoid build failure MIPS define a "Fill" macro as a cache operation in cacheops.h, this will cause build failure under some special configurations because in seq_file.c there is a "Fill" label. To avoid this failure we rename the "Fill" macro to "Fill_I" which has the same coding style as other cache operations in cacheops.h (we think renaming the "Fill" macro is more reasonable than renaming the "Fill" label). Callers of "Fill" macro is also updated. Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit ebe6976d3634a311367f72c2402f148ab9f23920 Author: Al Viro Date: Thu Mar 19 18:08:59 2020 -0400 pcm_native: result of put_user() needs to be checked ... and no, __put_user() doesn't help here - skipping access_ok() on the second call does not remove the possibility of page having become unmapped or r/o in the meanwhile Signed-off-by: Al Viro commit 29def599b38bb8a10f48f83821dd990615300b04 Author: Thomas Gleixner Date: Tue Apr 21 11:20:36 2020 +0200 x86/tlb: Move flush_tlb_others() out of line cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. As a last step, move __flush_tlb_others() out of line and hide the native function. The latter can be static when CONFIG_PARAVIRT is disabled. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.641957686@linutronix.de commit 58430c5dba7bfe1d132b3c07f0d7a596852ef55c Author: Thomas Gleixner Date: Tue Apr 21 11:20:35 2020 +0200 x86/tlb: Move __flush_tlb_one_kernel() out of line cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. As a fourth step, move __flush_tlb_one_kernel() out of line and hide the native function. The latter can be static when CONFIG_PARAVIRT is disabled. Consolidate the name space while at it and remove the pointless extra wrapper in the paravirt code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.535159540@linutronix.de commit 127ac915c8e1c11b8209393e700ca16be0efabe8 Author: Thomas Gleixner Date: Tue Apr 21 11:20:34 2020 +0200 x86/tlb: Move __flush_tlb_one_user() out of line cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. As a third step, move _flush_tlb_one_user() out of line and hide the native function. The latter can be static when CONFIG_PARAVIRT is disabled. Consolidate the name space while at it and remove the pointless extra wrapper in the paravirt code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.428213098@linutronix.de commit cd30d26cf307b45159cd629d60b989e582372afe Author: Thomas Gleixner Date: Tue Apr 21 11:20:33 2020 +0200 x86/tlb: Move __flush_tlb_global() out of line cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. As a second step, move __flush_tlb_global() out of line and hide the native function. The latter can be static when CONFIG_PARAVIRT is disabled. Consolidate the namespace while at it and remove the pointless extra wrapper in the paravirt code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.336916818@linutronix.de commit 2faf153bb7346b7dfc895f916edf93a86297ec0a Author: Thomas Gleixner Date: Tue Apr 21 11:20:32 2020 +0200 x86/tlb: Move __flush_tlb() out of line cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. As a first step, move __flush_tlb() out of line and hide the native function. The latter can be static when CONFIG_PARAVIRT is disabled. Consolidate the namespace while at it and remove the pointless extra wrapper in the paravirt code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.246130908@linutronix.de commit 84c0eb212c88176142a0aaf1f896d9bddd8bcb7a Author: Wolfram Sang Date: Thu Mar 26 22:09:52 2020 +0100 platform/mellanox: mlxreg-hotplug: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit e14d796d8339405d0daff98cdaf1465706a90ffb Author: Rayagonda Kokatanur Date: Sun Mar 22 23:53:22 2020 +0530 i2c: iproc: add support for SMBUS quick cmd Add support for SMBUS quick command. SMBUS quick command passes single bit of information to the slave (target) device. Can be used to turn slave device on or off. By default i2c_detect tool uses the smbus quick cmd to try and detect devices. Without this support it will not detect some slaves. Signed-off-by: Rayagonda Kokatanur Signed-off-by: Wolfram Sang commit 6b98bf01d2af40141cc7d831a1d2064f6f25e45e Author: Aishwarya R Date: Wed Apr 8 15:33:53 2020 +0530 i2c: powermac: Simplify reading the "reg" and "i2c-address" property Use of_property_read_u32 to read the "reg" and "i2c-address" property instead of using of_get_property to check the return values. Signed-off-by: Aishwarya R Tested-by: Erhard Furtner Signed-off-by: Wolfram Sang commit 1b9e68533299253f5c7d87ccc4cd39ed0dccb37d Author: Jason Yan Date: Mon Apr 20 12:28:16 2020 +0800 i2c: qup: remove unneeded conversion to bool The '>' expression itself is bool, no need to convert it to bool again. Signed-off-by: Jason Yan Reviewed-by: Bjorn Andersson Signed-off-by: Wolfram Sang commit aef6f2e7cec184fac0ef50958b759e9605ed8128 Author: Dave Stevenson Date: Sat Apr 25 23:38:07 2020 +0200 i2c: brcmstb: Fix handling of optional interrupt If there is no interrupt defined then an error is logged due to the use of platform_get_irq. The driver handles not having the interrupt by falling back to polling, therefore make the appropriate call when claiming it. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli Signed-off-by: Wolfram Sang commit 88fb09c409255a3deb75f5d133dd77e70a1075c9 Author: Wolfram Sang Date: Wed Apr 15 12:51:00 2020 +0200 i2c: regroup documentation of bindings Some bindings are for the bus master, some are for the slaves. Regroup them and give them separate headings to make it clear. Also, remove references to "generic names" which is for nodes and not for compatibles. Signed-off-by: Wolfram Sang Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 09cc9a3bce914d363a0f481b6603f2943fde9227 Author: Alain Volmat Date: Mon Apr 20 16:57:57 2020 +0200 i2c: stm32f7: allows for any bus frequency Do not limitate to the 3 (100KHz, 400KHz, 1MHz) bus frequency but instead allows any frequency (if it matches timing requirements). Depending on the requested frequency, use the spec data from either Standard, Fast or Fast Plus mode. Hardcoding of min/max bus frequencies is removed and is instead computed. The driver do not use anymore speed identifier but instead handle directly the frequency and figure out the spec data (necessary for the computation of the timing register) based on the frequency. Signed-off-by: Alain Volmat Reviewed-by: Pierre-Yves MORDRET Signed-off-by: Wolfram Sang commit dd16163ea24b986136e0d11b9ebd861cef9d308d Author: Alain Volmat Date: Mon Apr 20 16:57:56 2020 +0200 dt-bindings: i2c: i2c-stm32f7: allow clock-frequency range For STM32F7, STM32H7 and STM32MP1 SoCs, if timing parameters match, the bus clock frequency can be from 1Hz to 1MHz. Signed-off-by: Alain Volmat Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit e07a89775c71a246c99b9cc3fbe5f932b72765ed Author: Etienne Carriere Date: Mon Apr 20 17:17:06 2020 +0200 i2c: stm32: don't print an error on probe deferral Do not print an error trace when deferring probe for some resource. Fix as well the error message in case of tx dma_request_chan failure. Signed-off-by: Etienne Carriere Signed-off-by: Alain Volmat Reviewed-by: Pierre-Yves MORDRET Signed-off-by: Wolfram Sang commit ec43f74343796460c916cdc8ab350235c8b88638 Author: Maxime Ripard Date: Fri Apr 24 17:33:42 2020 +0200 i2c: brcmstb: Allow to compile it on BCM2835 The BCM2711, supported by ARCH_BCM2835, also has a controller by the brcmstb driver so let's allow it to be compiled on that platform. Acked-by: Florian Fainelli Signed-off-by: Maxime Ripard Signed-off-by: Wolfram Sang commit e804f0a78e9e43f0105e1bc3e264894b3898e970 Author: Björn Ardö Date: Fri Apr 24 13:30:36 2020 +0200 i2c: slave-eeprom: Make it possible to pre-load eeprom data If the slave eeprom has a "firmware-name" in devicetree, then pre-load the data in the eeprom with this file. Otherwise we init the eeprom with 0xFF. Signed-off-by: Patrick Williams Signed-off-by: Björn Ardö [wsa: some cosmetic changes] Signed-off-by: Wolfram Sang commit 3fd8dc269ff0647819589c21b2ce60af6fc0a455 Author: Huazhong Tan Date: Sun Apr 26 10:13:48 2020 +0800 net: hns3: remove an unnecessary check in hclge_set_umv_space() Since hclge_set_umv_space() is only called by hclge_init_umv_space(), parameter 'allocated_size' will not be NULL. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 659d4587fe7233bfdff303744b20d6f41ad04362 Author: Tonghao Zhang Date: Sat Apr 25 11:39:48 2020 +0800 net: openvswitch: use div_u64() for 64-by-32 divisions Compile the kernel for arm 32 platform, the build warning found. To fix that, should use div_u64() for divisions. | net/openvswitch/meter.c:396: undefined reference to `__udivdi3' [add more commit msg, change reported tag, and use div_u64 instead of do_div by Tonghao] Fixes: e57358873bb5d6ca ("net: openvswitch: use u64 for meter bucket") Reported-by: kbuild test robot Signed-off-by: Tonghao Zhang Tested-by: Tonghao Zhang Signed-off-by: David S. Miller commit 4b36a0dff794a00989a50581aed2f94c88b57107 Author: Tonghao Zhang Date: Sat Apr 25 11:39:47 2020 +0800 net: openvswitch: suitable access to the dp_meters To fix the following sparse warning: | net/openvswitch/meter.c:109:38: sparse: sparse: incorrect type | in assignment (different address spaces) ... | net/openvswitch/meter.c:720:45: sparse: sparse: incorrect type | in argument 1 (different address spaces) ... Reported-by: kbuild test robot Signed-off-by: Tonghao Zhang Signed-off-by: David S. Miller commit 06b439de5f89be954ae70d16ee5983e6406f6b71 Merge: c90af587a9ee 1f62cfa19a61 Author: David S. Miller Date: Sat Apr 25 20:46:28 2020 -0700 Merge branch 'hinic-add-SR-IOV-support' Luo bin says: ==================== hinic: add SR-IOV support patch #1 adds mailbox channel support and vf can communicate with pf or hw through it. patch #2 adds support for enabling vf and tx/rx capabilities based on vf. patch #3 adds support for vf's basic configurations. ==================== Signed-off-by: David S. Miller commit 1f62cfa19a619f82c098468660b7950477101d45 Author: Luo bin Date: Sat Apr 25 01:21:11 2020 +0000 hinic: add net_device_ops associated with vf adds ndo_set_vf_mac/ndo_set_vf_vlan/ndo_get_vf_config and ndo_set_vf_trust to configure netdev of virtual function Signed-off-by: Luo bin Signed-off-by: David S. Miller commit 7dd29ee128654702bd493ecec0bb22c2c5f0f395 Author: Luo bin Date: Sat Apr 25 01:21:10 2020 +0000 hinic: add sriov feature support adds support of basic sriov feature including initialization and tx/rx capabilities of virtual function Signed-off-by: Luo bin Signed-off-by: David S. Miller commit a425b6e1c69ba907b72b737a4d44f8cfbc43ce3c Author: Luo bin Date: Sat Apr 25 01:21:09 2020 +0000 hinic: add mailbox function support virtual function and physical function can communicate with each other through mailbox channel supported by hw Signed-off-by: Luo bin Signed-off-by: David S. Miller commit c90af587a9eee697e2d89683113707cada70116a Author: Zou Wei Date: Fri Apr 24 21:53:14 2020 +0800 net/mlx4_core: Add missing iounmap() in error path This fixes the following coccicheck warning: drivers/net/ethernet/mellanox/mlx4/crdump.c:200:2-8: ERROR: missing iounmap; ioremap on line 190 and execution via conditional on line 198 Fixes: 7ef19d3b1d5e ("devlink: report error once U32_MAX snapshot ids have been used") Reported-by: Hulk Robot Signed-off-by: Zou Wei Reviewed-by: Saeed Mahameed Signed-off-by: David S. Miller commit df346f1aac6cef551b69d788b022a942270dc17b Author: YueHaibing Date: Fri Apr 24 21:13:34 2020 +0800 dccp: remove unused inline function dccp_set_seqno There's no callers in-tree since commit 792b48780e8b ("dccp: Implement both feature-local and feature-remote Sequence Window feature") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 163749ad8436b3206709172406d68869c40bc176 Author: YueHaibing Date: Fri Apr 24 21:12:56 2020 +0800 qlcnic: remove unused inline function qlcnic_hw_write_wx_2M There's no callers in-tree anymore. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 308de89fedf4240d2270d00a36b90a1394fef6a7 Author: YueHaibing Date: Fri Apr 24 21:11:34 2020 +0800 liquidio: remove unused inline functions commit b6334be64d6f ("net/liquidio: Delete driver version assignment") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 3e14462f1bee6d74eea6425d7965357d55151f80 Author: Yang Yingliang Date: Fri Apr 24 20:52:26 2020 +0800 ptp: clockmatrix: remove unnecessary comparison The type of loaddr is u8 which is always '<=' 0xff, so the loaddr <= 0xff is always true, we can remove this comparison. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Vincent Cheng Signed-off-by: David S. Miller commit f30e472071c827e2c2f191c8a011b7e371e17af5 Author: Taehee Yoo Date: Fri Apr 24 12:43:09 2020 +0000 hsr: remove unnecessary code in hsr_dev_change_mtu() In the hsr_dev_change_mtu(), the 'dev' and 'master->dev' pointer are same. So, the 'master' variable and some code are unnecessary. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 071c8ed6e88d2ac0a5f26948fb9c288fd4dd6e40 Author: Florian Westphal Date: Fri Apr 24 12:31:50 2020 +0200 tcp: mptcp: use mptcp receive buffer space to select rcv window In MPTCP, the receive window is shared across all subflows, because it refers to the mptcp-level sequence space. MPTCP receivers already place incoming packets on the mptcp socket receive queue and will charge it to the mptcp socket rcvbuf until userspace consumes the data. Update __tcp_select_window to use the occupancy of the parent/mptcp socket instead of the subflow socket in case the tcp socket is part of a logical mptcp connection. This commit doesn't change choice of initial window for passive or active connections. While it would be possible to change those as well, this adds complexity (especially when handling MP_JOIN requests). Furthermore, the MPTCP RFC specifically says that a MPTCP sender 'MUST NOT use the RCV.WND field of a TCP segment at the connection level if it does not also carry a DSS option with a Data ACK field.' SYN/SYNACK packets do not carry a DSS option with a Data ACK field. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 460fd830dd9d68e07c4d15363fd764944090e1f8 Author: Ioana Ciornei Date: Fri Apr 24 12:33:18 2020 +0300 dpaa2-eth: add channel stat to debugfs Compute the average number of frames processed for each CDAN (Channel Data Availability Notification) and export it to debugfs detailed channel stats. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit ae23aae229b8a253a3d5d51acf3bd6103a519d85 Author: Zheng Bin Date: Fri Apr 24 17:13:35 2020 +0800 octeontx2-pf: Remove unneeded semicolon Fixes coccicheck warning: drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h:312:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: David S. Miller commit dce38b74b2b57c6aeb9eafa9fb08451a7bb022dc Author: Zheng Bin Date: Fri Apr 24 17:08:50 2020 +0800 net: phy: dp83867: Remove unneeded semicolon Fixes coccicheck warning: drivers/net/phy/dp83867.c:368:2-3: Unneeded semicolon drivers/net/phy/dp83867.c:403:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8b5d10e4d28510161c6e9c77a97df9c66bcbd17f Merge: d483389678f9 039ba863e8d7 Author: David S. Miller Date: Sat Apr 25 20:29:44 2020 -0700 Merge branch 'net-hns3-refactor-for-MAC-table' Huazhong Tan says: ==================== net: hns3: refactor for MAC table This patchset refactors the MAC table management, configure the MAC address asynchronously, instead of synchronously. Base on this change, it also refines the handle of promisc mode and filter table entries restoring after reset. ==================== Signed-off-by: David S. Miller commit 039ba863e8d71c52b1f5faf26b0f458eec33d5e7 Author: Jian Shen Date: Fri Apr 24 10:23:13 2020 +0800 net: hns3: optimize the filter table entries handling when resetting Currently, the PF driver removes all (including its VFs') MAC/VLAN flow director table entries when resetting, and restores them after reset completed. In fact, the hardware will clear all table entries only in IMP reset and global reset. So driver only needs to restore the table entries in these cases, and needs do nothing when PF reset, FLR or other function level reset. This patch optimizes it by removing unnecessary table entries clear and restoring handling in the reset flow, and doing the restoring after reset completed. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 7d0b345156d0678fbbbf885f991c6d83f23d70f1 Author: Jian Shen Date: Fri Apr 24 10:23:12 2020 +0800 net: hns3: use mutex vport_lock instead of mutex umv_lock Currently, the driver use mutex umv_lock to protect the variable vport->share_umv_size. And there is already a mutex vport_lock being defined in the driver, which is designed to protect the resource of vport. So we can use vport_lock instead of umv_lock. Furthermore, there is a time window for protect share_umv_size between checking UMV space and doing MAC configuration in the lin function hclge_add_uc_addr_common(). It should be extended. This patch uses mutex vport_lock intead of spin lock umv_lock to protect share_umv_size, and adjusts the mutex's range. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit c631c696823cdddbf3c683c3b78812ecba31c350 Author: Jian Shen Date: Fri Apr 24 10:23:11 2020 +0800 net: hns3: refactor the promisc mode setting As the HNS3 driver doesn't update the MAC address directly in function hns3_set_rx_mode() now, it can't know whether the MAC table is full from __dev_uc_sync() and __dev_mc_sync(), so it's senseless to handle the overflow promisc here. This patch removes the handle of overflow promisc from function hns3_set_rx_mode(), and updates the promisc mode in the service task. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit f671237a4b4521dfde5f96c2b088287712e72f4b Author: Jian Shen Date: Fri Apr 24 10:23:10 2020 +0800 net: hns3: add support for dumping UC and MC MAC list This patch adds support for dumping entries of UC and MC MAC list, which help checking whether a MAC address being added into hardware or not. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit ee4bcd3b7ae40bd77732eb1ba14aa26d6c514525 Author: Jian Shen Date: Fri Apr 24 10:23:09 2020 +0800 net: hns3: refactor the MAC address configure Currently, the HNS3 driver sync and unsync MAC address in function hns3_set_rx_mode(). For PF, it adds and deletes MAC address directly in the path of dev_set_rx_mode(). If failed, it won't retry until next calling of hns3_set_rx_mode(). On the other hand, if request add and remove a same address many times at a short interval, each request must be done one by one, can't be merged. For VF, it sends mailbox messages to PF to request adding or deleting MAC address in the path of function hns3_set_rx_mode(), no matter the address is configured success. This patch refines it by recording the MAC address in function hns3_set_rx_mode(), and updating MAC address in the service task. If failed, it will retry by the next calling of periodical service task. It also uses some state to mark the state of each MAC address in the MAC list, which can help merge configure request for a same address. With these changes, when global reset or IMP reset occurs, we can restore the MAC table with the MAC list. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 4c58f592470192d2b5ce4cfd2f7ff0ea2624c073 Author: Jian Shen Date: Fri Apr 24 10:23:08 2020 +0800 net: hns3: replace num_req_vfs with num_alloc_vport in hclge_reset_umv_space() Like the calculation elsewhere, replaces num_req_vfs with num_alloc_vport in hclge_reset_umv_space(). Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit c1c5f66ee0dea782de9c95e6d63f19c355389ee8 Author: Jian Shen Date: Fri Apr 24 10:23:07 2020 +0800 net: hns3: remove unnecessary parameter 'is_alloc' in hclge_set_umv_space() Since hclge_set_umv_space() is only called by hclge_init_umv_space(), so parameter 'is_alloc' is redundant. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 1ac0e6c292983c2665383ae9efcfe1f8b53271e0 Author: Jian Shen Date: Fri Apr 24 10:23:06 2020 +0800 net: hns3: refine for unicast MAC VLAN space management Currently, firmware helps manage the unicast MAC VLAN table space for each PF. PF just needs to tell firmware its wanted space when initializing, and unnecessary to free it when un-intializing. So this patch removes the umv space free handle, and removes the forward statement of hclge_set_umv_space() by defining hclge_init_umv_space() after it. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit d483389678f9e03d53f226641ea39679debcbc81 Merge: 6033cebdfff9 b2768df24ec4 Author: David S. Miller Date: Sat Apr 25 19:24:42 2020 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Simple overlapping changes to linux/vermagic.h Signed-off-by: David S. Miller commit a656d47a010b74e390c4336efc0f617886ab407c Author: Al Viro Date: Wed Feb 12 11:36:05 2020 -0500 scsi_ioctl.c: switch SCSI_IOCTL_GET_IDLUN to copy_to_user() Signed-off-by: Al Viro commit ce5155c4f8226f4816f9f7cb88149ec275c7b0a8 Author: Al Viro Date: Tue Feb 18 22:43:15 2020 -0500 compat sysinfo(2): don't bother with field-by-field copyout Signed-off-by: Al Viro commit 7842087b0196d674ed877d768de8f2a34d7fdc53 Author: Stephan Gerhold Date: Sat Apr 25 13:06:31 2020 -0700 Input: mms114 - add extra compatible for mms345l MMS345L is another first generation touch screen from Melfas, which uses mostly the same registers as MMS152. However, there is some garbage printed during initialization. Apparently MMS345L does not have the MMS152_COMPAT_GROUP register that is read+printed during initialization. TSP FW Rev: bootloader 0x6 / core 0x26 / config 0x26, Compat group: \x06 On earlier kernel versions the compat group was actually printed as an ASCII control character, seems like it gets escaped now. But we probably shouldn't print something from a random register. Add a separate "melfas,mms345l" compatible that avoids reading from the MMS152_COMPAT_GROUP register. This might also help in case there is some other device-specific quirk in the future. Signed-off-by: Stephan Gerhold Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20200423102431.2715-1-stephan@gerhold.net Signed-off-by: Dmitry Torokhov commit 86d1ee00c86dd8472e18d76c6895e1e94a34d919 Author: Stephan Gerhold Date: Sat Apr 25 13:06:09 2020 -0700 dt-bindings: mms114: document melfas,mms345l binding The mms114 driver now supports MMS345L; document the melfas,mms345l binding that is used for it. Signed-off-by: Stephan Gerhold Reviewed-by: Andi Shyti Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200423102431.2715-2-stephan@gerhold.net Signed-off-by: Dmitry Torokhov commit b8a1181122f7a3d878e8a7a87603cd247ab24082 Author: Mika Kuoppala Date: Sat Apr 25 02:06:32 2020 +0300 drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL Use indirect ctx bb to load cmd buffer control value from context image to avoid corruption. v2: add to lrc layout (Chris) v3: end to a cacheline (Chris) v4: add to lrc fixed (Chris) v5: value in offset+1 Testcase: igt/i915_selftest/gt_lrc Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200424230632.30333-1-mika.kuoppala@linux.intel.com commit 1dd47b54baeac460f677a3c8bb347b2ffed56d4d Author: Mika Kuoppala Date: Sat Apr 25 00:48:40 2020 +0300 drm/i915: Add live selftests for indirect ctx batchbuffers Indirect ctx batchbuffers are a hw feature of which batch can be run, by hardware, during context restoration stage. Driver can setup a batchbuffer and also an offset into the context image. When context image is marshalled from memory to registers, and when the offset from the start of context register state is equal of what driver pre-determined, batch will run. So one can manipulate context restoration process at cacheline granularity, given some limitations, as you need to have rudimentaries in place before you can run a batch. Add selftest which will write the ring start register to a canary spot. This will test that hardware will run a batchbuffer for the context in question. v2: request wait fix, naming (Chris) v3: test order (Chris) v4: rebase Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200424214841.28076-3-mika.kuoppala@linux.intel.com commit e1ca5184625d06b116816830333e745af00b26a6 Author: Bjorn Andersson Date: Mon Apr 20 14:57:28 2020 -0700 panel: simple: Add Ivo M133NWF4 R0 The InfoVision Optoelectronics M133NWF4 R0 panel is a 13.3" 1920x1080 eDP panel, add support for it in panel-simple. Signed-off-by: Bjorn Andersson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200420215728.1927434-2-bjorn.andersson@linaro.org commit d08ffbeaa100100767ff6bd922a7b6448cb3c372 Author: Bjorn Andersson Date: Mon Apr 20 14:57:27 2020 -0700 dt-bindings: display: simple: Add IVO M133NWF4 R0 Define the vendor prefix for InfoVision Optoelectronics and add their M133NWF4 R0 13.3" FHD (1920x1080) TFT LCD panel to the compatible list of panel-simple. Signed-off-by: Bjorn Andersson Acked-by: Rob Herring [vendor-prefix] Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200420215728.1927434-1-bjorn.andersson@linaro.org commit 685d21096f6ceb44bda186dd42520f2a9d21d1aa Author: Mika Kuoppala Date: Sat Apr 25 02:05:46 2020 +0300 drm/i915: Add per ctx batchbuffer wa for timestamp Restoration of a previous timestamp can collide with updating the timestamp, causing a value corruption. Combat this issue by using indirect ctx bb to modify the context image during restoring process. We can preload value into scratch register. From which we then do the actual write with LRR. LRR is faster and thus less error prone as probability of race drops. v2: tidying (Chris) v3: lrr for all engines v4: grp v5: reg bit v6: wa_bb_offset, virtual engines (Chris) References: HSDES#16010904313 Testcase: igt/i915_selftest/gt_lrc Suggested-by: Joseph Koston Cc: Chris Wilson Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200424230546.30271-1-mika.kuoppala@linux.intel.com commit 168c6d231b4b8f0c647eb2fda86e06b62cf68c7a Author: Mika Kuoppala Date: Sat Apr 25 00:48:38 2020 +0300 drm/i915: Add engine scratch register to live_lrc_fixed General purpose registers are per engine and in a fixed location. Add to live_lrc_fixed. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200424214841.28076-1-mika.kuoppala@linux.intel.com commit 8cf7961dab42c9177a556b719c15f5b9449c24d1 Author: Christoph Hellwig Date: Sat Apr 25 09:53:36 2020 +0200 block: bypass ->make_request_fn for blk-mq drivers Call blk_mq_make_request when no ->make_request_fn is set. This is safe now that blk_alloc_queue always sets up the pointer for make_request based drivers. This avoids an indirect call in the blk-mq driver I/O fast path, which is rather expensive due to spectre mitigations. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit ae3cc8d8ff061d3ffca96665685550e70a86472a Author: Christoph Hellwig Date: Sat Apr 25 09:53:35 2020 +0200 dm: remove the make_request_fn check in device_area_is_invalid Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit a91b2014fc31dc6eaa02ca33aa3b4d1b6e4a0207 Author: Christoph Hellwig Date: Sat Apr 25 09:53:34 2020 +0200 bcache: remove a duplicate ->make_request_fn assignment The make_request_fn pointer should only be assigned by blk_alloc_queue. Fix a left over manual initialization. Fixes: ff27668ce809 ("bcache: pass the make_request methods to blk_queue_make_request") Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3e82c3485e835b4dc7374316357fa388676201d7 Author: Christoph Hellwig Date: Sat Apr 25 09:55:51 2020 +0200 block: remove create_io_context create_io_context just has a single caller, which also happens to not even use the return value. Just open code it there. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b0c664cc80e8780fdc06cf2e1281d7fcc1ab536f Author: Bjorn Andersson Date: Mon Apr 20 14:57:42 2020 -0700 panel: simple: Add BOE NV133FHM-N61 The BOE NV133FHM-N61 panel is a 13.3" 1920x1080 eDP panel, add support for it in panel-simple. Signed-off-by: Bjorn Andersson Signed-off-by: Sam Ravnborg [add boe_nv133fhm_n61_modes in alphabetical order] Link: https://patchwork.freedesktop.org/patch/msgid/20200420215742.1927498-2-bjorn.andersson@linaro.org commit 1a8afd1ef47c1fa4425b685d7dd3bcffe56209c3 Author: Bjorn Andersson Date: Mon Apr 20 14:57:41 2020 -0700 dt-bindings: display: simple: Add BOE NV133FHM-N61 Add the BOE NV133FHM-N61 13.3" FHD (1920x1080) TFT LCD Panel to the compatible list of panel-simple. Signed-off-by: Bjorn Andersson Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200420215742.1927498-1-bjorn.andersson@linaro.org commit 3e04cb60e872b9433e523d62c39addf0bd1a18f1 Author: Nuno Sá Date: Mon Apr 13 10:24:43 2020 +0200 iio: adis: Support different burst sizes Add burst_max_len to `adis_burst`. This is useful for devices which support different burst modes with different sizes. The buffer to be used in the spi transfer is allocated with this variable making sure that has space for all burst modes. The spi transfer length should hold the "real" burst length depending on the current burst mode configured in the device. Moreover, `extra_len` in `adis_burst` is made const and it should contain the smallest extra length necessary for a burst transfer. In `struct adis` was added a new `burst_extra_len` that should hold the extra bytes needed depending on the device instance being used. Signed-off-by: Nuno Sá Signed-off-by: Jonathan Cameron commit b9c5eec725d67b548e4dfdc406d6ca2c6d30d1c2 Author: Nuno Sá Date: Mon Apr 13 10:24:42 2020 +0200 iio: adis: Add adis_update_bits() APIs This patch adds a `regmap_update_bits()` like API to the ADIS library. It provides locked and unlocked variant. Signed-off-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 698211065d4aa71ce599b38c23452664a5a8e370 Author: Nuno Sá Date: Mon Apr 13 10:24:41 2020 +0200 iio: imu: adis: Add irq flag variable There are some ADIS devices that can configure the data ready pin polarity. Hence, we cannot hardcode our IRQ mask as IRQF_TRIGGER_RISING since we might want to have it as IRQF_TRIGGER_FALLING. Signed-off-by: Nuno Sá Signed-off-by: Jonathan Cameron commit bc7f0b6d4ae41875557eeaa1ebd5d8ac1a8f3657 Author: Souptick Joarder Date: Mon Apr 20 23:57:24 2020 +0530 video/fbdev/riva: Remove dead code These are dead code since 3.15. These can be removed forever if no plan to use it further. Signed-off-by: Souptick Joarder Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1587407244-32574-1-git-send-email-jrdr.linux@gmail.com commit fec86c6b8369b5dd8e3a1ad3752578a737163b25 Author: Nuno Sá Date: Mon Apr 13 10:24:40 2020 +0200 iio: imu: adis: Add Managed device functions This patch adds support for a managed device version of adis_setup_buffer_and_trigger. It works exactly as the original one but it calls all the devm_iio_* functions to setup an iio buffer and trigger. Hence we do not need to care about cleaning those and we do not need to support a remove() callback for every driver using the adis library. Signed-off-by: Nuno Sá Signed-off-by: Jonathan Cameron commit f3c034f6177569e1d27a7f3aaa755910201bc2d2 Author: Alexandru Ardelean Date: Wed Mar 4 10:42:19 2020 +0200 iio: at91-sama5d2_adc: adjust iio_triggered_buffer_{predisable,postenable} positions The iio_triggered_buffer_{predisable,postenable} functions attach/detach poll functions. In most cases the iio_triggered_buffer_postenable() should be called first to attach the poll function, and then the driver can init the data to be triggered. In this case it's the other way around: the DMA code should be initialized before the attaching the poll function and the reverse should be done when un-initializing. To make things easier when removing the iio_triggered_buffer_postenable() & iio_triggered_buffer_predisable() functions from the IIO core API, the DMA code has been moved into preenable() for init, and postdisable() for uninit. Signed-off-by: Alexandru Ardelean Reviewed-by: Ludovic Desroches Reviewed-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit 065056cb0d0ad42b04bcdfbce84cc7136f919ee6 Author: Alexandru Ardelean Date: Wed Mar 4 10:42:18 2020 +0200 iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helper This change moves the logic to check if the current channel is the touchscreen channel to a separate helper. This reduces some code duplication, but the main intent is to re-use this in the next patches. Signed-off-by: Alexandru Ardelean Reviewed-by: Eugen Hristev Reviewed-by: Ludovic Desroches Signed-off-by: Jonathan Cameron commit 3d930aacd637cca551f216c61b2e1c455db58eb0 Author: YueHaibing Date: Fri Apr 17 18:14:01 2020 +0800 drm/panel: remove set but not used variable 'config' drivers/gpu/drm/panel/panel-truly-nt35597.c:493:31: warning: variable ‘config’ set but not used [-Wunused-but-set-variable] const struct nt35597_config *config; ^~~~~~ Signed-off-by: YueHaibing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200417101401.19388-1-yuehaibing@huawei.com commit abb7e84d29b0d9fc9410661aceffecb5e22ad006 Author: Eugen Hristev Date: Tue Jan 28 12:57:41 2020 +0000 iio: adc: at91-sama5d2_adc: update for other trigger usage This change will allow the at91-sama5d2_adc driver to use other triggers than it's own. In particular, tested with the sysfs trigger. To be able to achieve this functionality, some changes were required: 1) Do not enable/disable channels when enabling/disabling the trigger. This is because the trigger is enabled/disabled only for our trigger (obviously). We need channels enabled/disabled regardless of what trigger is being used. 2) Cope with DMA : DMA cannot be used when using another type of trigger. Other triggers work through pollfunc, so we get polled anyway on every trigger. Thus we have to obtain data at every trigger. 3) When to start conversion? The usual pollfunc (store time from subsystem) would be in hard irq and this would be a good way, but current iio subsystem recommends to have it in the threaded irq. Thus adding software start code in this handler. 4) Buffer config: we need to setup buffer regardless of our own device's trigger. We may get one attached later. 5) IRQ handling: we use our own device IRQ only if it's our own trigger and we do not use DMA . If we use DMA, we use the DMA controller's IRQ. Signed-off-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit 97c54cf2a4e87630eab18ad53b88348ec7296176 Author: Eugen Hristev Date: Tue Jan 28 12:57:40 2020 +0000 iio: adc: at91-sama5d2_adc: handle unfinished conversions It can happen that on IRQ trigger, not all conversions are done if we are enabling multiple channels. The IRQ is triggered on first EOC (end of channel), but it can happen that not all channels are done. This leads into erroneous reports to userspace (zero values or previous values). To solve this, in trigger handler, check if the mask of done channels is the same as the mask of active scan channels. If it's the same, proceed and push to buffers. Otherwise, use usleep to sleep until the conversion is done or we timeout. Normally, it should happen that in a short time fashion, all channels are ready, since the first IRQ triggered. If a hardware fault happens (for example the clock suddently dissappears), the handler will not be completed, in which case we do not report anything to userspace anymore. Also, change from using the EOC interrupts to DRDY interrupt. This helps with the fact that not 'n' interrupt statuses are enabled, each being able to trigger an interrupt, and instead only data ready interrupt can wake up the CPU. Like this, when data is ready, check in handler which and how many channels are done. While the DRDY is raised, other IRQs cannot occur. Once the channel data is being read, we ack the IRQ and finish the conversion. Signed-off-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit 232f23e8cd97cc27e91a6e0f9cd055248abd329b Author: Thierry Reding Date: Fri Apr 17 08:53:28 2020 +0200 dt-bindings: panel: Document some missing compatible strings Add missing compatible strings for the Panasonic and Chunghwa panels found on NVIDIA Dalmore and Cardhu boards. Signed-off-by: Thierry Reding Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200417065328.1578603-1-thierry.reding@gmail.com commit 30be3031087139061de4421bf52015931eaab569 Author: Enric Balletbo i Serra Date: Thu Apr 16 23:06:54 2020 +0200 drm/bridge: panel: Return always an error pointer in drm_panel_bridge_add() Since commit 89958b7cd955 ("drm/bridge: panel: Infer connector type from panel by default"), drm_panel_bridge_add() and their variants can return NULL and an error pointer. This is fine but none of the actual users of the API are checking for the NULL value. Instead of change all the users, seems reasonable to return an error pointer instead. So change the returned value for those functions when the connector type is unknown. Suggested-by: Laurent Pinchart Signed-off-by: Enric Balletbo i Serra Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200416210654.2468805-1-enric.balletbo@collabora.com commit 77baa8d6bced7dbe67c6a9ffae749e5d77b38f80 Author: Jonathan Cameron Date: Sun Apr 19 16:02:06 2020 +0100 iio: light: vl6180: add include of mod_devicetable.h and drop of_match_ptr Enables probing via ACPI PRP0001 route and removes an example of an approach we no longer want people to copy. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 645aee51af92147801067cacda45ddfdbe544caf Author: Jonathan Cameron Date: Sun Apr 19 16:02:05 2020 +0100 iio: light: st_uvis25: Add mod_devicetable.h and drop of_match_ptr Enables probing via ACPI PRP0001 and removes an example that we don't want people to cut and paste into new drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 0741678ece687f53b7e8852731822ed5646f5cb2 Author: Jonathan Cameron Date: Sun Apr 19 16:02:04 2020 +0100 iio: light: opt3001: Add mod_devicetable.h and drop use of of_match_ptr Enables probing via ACPI PRP0001 but mostly about removing examples that might be copied to new drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 4606ed7ede0c1f8616c7d30cbf72230314888653 Author: Enric Balletbo i Serra Date: Thu Apr 16 18:44:04 2020 +0200 drm/bridge: ps8640: Let panel to set the connector type The panel connector type should be set by the panel not the bridge, so remove the connector_type assignment. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200416164404.2418426-2-enric.balletbo@collabora.com commit d53139b37f1037033c47cc552f2e6ce745c6a159 Author: Enric Balletbo i Serra Date: Thu Apr 16 18:44:03 2020 +0200 drm: panel: Set connector type for LP120UP1 The LP120UP1 is a eDP panel, set the connector type accordingly. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200416164404.2418426-1-enric.balletbo@collabora.com commit de1cbfe1174fe015c2df7fead1f43ec6edc74fc1 Author: Jonathan Cameron Date: Sun Apr 19 16:02:03 2020 +0100 iio: light: gp2ap020a00f: Swap of.h for mod_devicetable.h + drop of_match_ptr Also drops ifdef protections for CONFIG_OF. Enables probing via ACPI PRP0001 and removes an example that might be cut and paste into new drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 1de94b5945f2a3b1be29a235edf22af6d5b2f140 Author: Jonathan Cameron Date: Sun Apr 19 16:02:02 2020 +0100 iio: light: cm3232: Add mod_devicetable.h include and drop of_match_ptr Enables ACPI probing via PRP0001 and removes an example that might be cut and paste to a new driver. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 9065b78028c5a50f3c352f6fa904a7db9d470af3 Author: Jonathan Cameron Date: Sun Apr 19 16:02:01 2020 +0100 iio: light: cm32181: Add mod_devicetable.h and remove of_match_ptr Enables probing via the ACPI PRP0001 route but more is mosty about removing examples of this that might get copied into new drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit a29b57e9df22d1b8bf3a7a8e5a2011a4ea44a967 Author: Zheng Bin Date: Fri Apr 24 16:02:24 2020 +0800 drm/panel: ili9322: Remove unneeded semicolon Fixes coccicheck warning: drivers/gpu/drm/panel/panel-ilitek-ili9322.c:382:2-3: Unneeded semicolon drivers/gpu/drm/panel/panel-ilitek-ili9322.c:391:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200424080224.30763-1-zhengbin13@huawei.com commit f73a047456e2fddce6d975d8ed87aecb086c0524 Author: Jonathan Cameron Date: Sun Apr 19 16:02:00 2020 +0100 iio: light: bh1780: use mod_devicetable.h and drop of_match_ptr macro Whilst this enables ACPI binding or the device via PRP0001 the primary aim is to remove potential for these two things to be cut and paste into new drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean commit 3699e268a773fd304f8e80b3f163a395919a64b7 Author: Nishant Malpani Date: Sat Apr 25 04:14:38 2020 +0530 iio: accel: kxsd9-i2c: Use mod_devicetable.h and drop of_match_ptr macro Enables ACPI DSDT to probe via PRP0001 and the compatible property. Also removes the ifdef protections for CONFIG_OF. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 6d6c5e56d7718cdb7903d8ad2a1048fbe92afba6 Author: Nishant Malpani Date: Sat Apr 25 04:14:37 2020 +0530 iio: accel: dmard06: Use mod_devicetable.h and drop of_match_ptr macro Enables ACPI DSDT to probe via PRP0001 and the compatible property. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 03e909acd95afe5077e61fd2a9968000c329f7db Author: Sebastian Reichel Date: Wed Apr 15 19:27:25 2020 +0200 drm/panel: simple: Add support for AUO G121EAN01.4 panel Add timings for the AUO G121EAN01.4 panel. Signed-off-by: Sebastian Reichel Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200415172725.84257-4-sebastian.reichel@collabora.com commit d9ccd1f28246ff76d02a28ef745302b1954fa07e Author: Sebastian Reichel Date: Wed Apr 15 19:27:24 2020 +0200 drm/panel: simple: Add support for AUO G156XTN01.0 panel Add timings for the AUO G156XTN01.0 panel. Signed-off-by: Sebastian Reichel Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200415172725.84257-3-sebastian.reichel@collabora.com commit 2f7b832fc9920b444c7a0c36005369147b9a003b Author: Sebastian Reichel Date: Wed Apr 15 19:27:23 2020 +0200 drm/panel: simple: Add support for AUO G190EAN01 panel Add timings for the G190EAN01 dual channel LVDS panel. Signed-off-by: Sebastian Reichel Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200415172725.84257-2-sebastian.reichel@collabora.com commit b101c93ca5e2d4f9b0881c510a3913c9a292b33a Author: Matt Ranostay Date: Sat Apr 25 10:25:20 2020 +0300 iio: chemical: atlas-sensor: add RTD-SM module support Atlas Scientific RTD-SM OEM sensor reads temperature using resistance temperature detector technology. Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron commit 1e8f99edc952ee5f1787cfe3eb5fbb2a15dcce40 Author: Matt Ranostay Date: Sat Apr 25 10:25:19 2020 +0300 dt-bindings: iio: chemical: add Atlas Scientific RTD-SM sensor docs Cc: devicetree@vger.kernel.org Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron commit 298f3db6ee690259927b105d5ad1079563361323 Author: Peter Collingbourne Date: Thu Apr 23 09:31:31 2020 -0700 dma-contiguous: fix comment for dma_release_from_contiguous Commit 90ae409f9eb3 ("dma-direct: fix zone selection after an unaddressable CMA allocation") changed the logic in dma_release_from_contiguous to remove the normal pages fallback path, but did not update the comment. Fix that. Signed-off-by: Peter Collingbourne Signed-off-by: Christoph Hellwig commit 1d659236fb43c4d2b37af7a4309681e834e9ec9a Author: David Rientjes Date: Tue Apr 14 17:05:02 2020 -0700 dma-pool: scale the default DMA coherent pool size with memory capacity When AMD memory encryption is enabled, some devices may use more than 256KB/sec from the atomic pools. It would be more appropriate to scale the default size based on memory capacity unless the coherent_pool option is used on the kernel command line. This provides a slight optimization on initial expansion and is deemed appropriate due to the increased reliance on the atomic pools. Note that the default size of 128KB per pool will normally be larger than the single coherent pool implementation since there are now up to three coherent pools (DMA, DMA32, and kernel). Note that even prior to this patch, coherent_pool= for sizes larger than 1 << (PAGE_SHIFT + MAX_ORDER-1) can fail. With new dynamic expansion support, this would be trivially extensible to allow even larger initial sizes. Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 82fef0ad811fb5976cf36ccc3d2c3bc0195dfb72 Author: David Rientjes Date: Tue Apr 14 17:05:01 2020 -0700 x86/mm: unencrypted non-blocking DMA allocations use coherent pools When CONFIG_AMD_MEM_ENCRYPT is enabled and a device requires unencrypted DMA, all non-blocking allocations must originate from the atomic DMA coherent pools. Select CONFIG_DMA_COHERENT_POOL for CONFIG_AMD_MEM_ENCRYPT. Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 2edc5bb3c5cc42131438460a50b7b16905c81c2a Author: David Rientjes Date: Tue Apr 14 17:04:59 2020 -0700 dma-pool: add pool sizes to debugfs The atomic DMA pools can dynamically expand based on non-blocking allocations that need to use it. Export the sizes of each of these pools, in bytes, through debugfs for measurement. Suggested-by: Christoph Hellwig Signed-off-by: David Rientjes [hch: remove the !CONFIG_DEBUG_FS stubs] Signed-off-by: Christoph Hellwig commit 76a19940bd62a81148c303f3df6d0cee9ae4b509 Author: David Rientjes Date: Tue Apr 14 17:04:58 2020 -0700 dma-direct: atomic allocations must come from atomic coherent pools When a device requires unencrypted memory and the context does not allow blocking, memory must be returned from the atomic coherent pools. This avoids the remap when CONFIG_DMA_DIRECT_REMAP is not enabled and the config only requires CONFIG_DMA_COHERENT_POOL. This will be used for CONFIG_AMD_MEM_ENCRYPT in a subsequent patch. Keep all memory in these pools unencrypted. When set_memory_decrypted() fails, this prohibits the memory from being added. If adding memory to the genpool fails, and set_memory_encrypted() subsequently fails, there is no alternative other than leaking the memory. Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 54adadf9b08571fb8b11dc9d0d3a2ddd39825efd Author: David Rientjes Date: Mon Apr 20 12:09:58 2020 +0200 dma-pool: dynamically expanding atomic pools When an atomic pool becomes fully depleted because it is now relied upon for all non-blocking allocations through the DMA API, allow background expansion of each pool by a kworker. When an atomic pool has less than the default size of memory left, kick off a kworker to dynamically expand the pool in the background. The pool is doubled in size, up to MAX_ORDER-1. If memory cannot be allocated at the requested order, smaller allocation(s) are attempted. This allows the default size to be kept quite low when one or more of the atomic pools is not used. Allocations for lowmem should also use GFP_KERNEL for the benefits of reclaim, so use GFP_KERNEL | GFP_DMA and GFP_KERNEL | GFP_DMA32 for lowmem allocations. This also allows __dma_atomic_pool_init() to return a pointer to the pool to make initialization cleaner. Also switch over some node ids to the more appropriate NUMA_NO_NODE. Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit 41aef04524d3dc8c2a5d9652cccc1f567356b5fd Author: Carlos Guerrero Álvarez Date: Thu Apr 23 20:35:46 2020 +0200 Staging: rtl8188eu: core: rtw_pwrctrl: fixed a coding style issue Fixed a checkpatch.pl warning: the constant should be in the right side of the comparison. Signed-off-by: Carlos Guerrero Álvarez Link: https://lore.kernel.org/r/20200423183546.123612-1-carlosteniswarrior@gmail.com Signed-off-by: Greg Kroah-Hartman commit 87f86cddda65cab8a7e3df8a00e16abeccaa0730 Author: Dan Carpenter Date: Fri Apr 24 13:42:35 2020 +0300 staging: wfx: check ssidlen and prevent an array overflow We need to cap "ssidlen" to prevent a memcpy() overflow. Fixes: 40115bbc40e2 ("staging: wfx: implement the rest of mac80211 API") Signed-off-by: Dan Carpenter Reviewed-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200424104235.GA416402@mwanda Signed-off-by: Greg Kroah-Hartman commit 705b7c364808de23f067c128afb295e5f0d8da24 Author: kyoungho koo Date: Sat Apr 25 02:05:12 2020 +0900 Staging: rtl8723bs: Fix comment typo "the the". I have found double typed comments "the the". So i modified it to one "the" Signed-off-by: kyoungho koo Link: https://lore.kernel.org/r/20200424170508.GA10761@koo-Z370-HD3 Signed-off-by: Greg Kroah-Hartman commit f80fa161ae616e648f7040544c0e1f5f225fbfbf Author: Rylan Dmello Date: Thu Apr 23 22:57:23 2020 -0400 staging: qlge: qlge_dbg.c: Remove trailing semicolon from macro Fix checkpatch.pl warning: macros should not use a trailing semicolon Signed-off-by: Rylan Dmello Link: https://lore.kernel.org/r/20200424025723.GA28156@athena Signed-off-by: Greg Kroah-Hartman commit 46abf997419c8f4bf23ac2aaf1f1e773fe6cb20d Author: Richard C Yeh Date: Thu Apr 23 15:15:04 2020 -0400 MAINTAINERS: Add rcy@google.com as maintainer for drivers/staging/gasket After consultation with Todd Poynor and Jesse Barnes, I am adding myself as a maintainer for drivers/staging/gasket Signed-off-by: Richard C Yeh Acked-by: Todd Poynor Link: https://lore.kernel.org/r/20200423191504.149922-1-rcy@google.com Signed-off-by: Greg Kroah-Hartman commit 3172204a39c98367728d05ab27e2e96cf324a5a8 Author: Kyoungho Koo Date: Sat Apr 25 18:07:17 2020 +0900 Staging: gasket: fix typo in gasket_page_table.c comments. I have found double typed comments "the the". So i modified it to one "the". Signed-off-by: Kyoungho Koo Link: https://lore.kernel.org/r/20200425090714.GA2105@koo-Z370-HD3 Signed-off-by: Greg Kroah-Hartman commit 4da0b2b7e67524cc206067865666899bc02e1cb0 Author: Ard Biesheuvel Date: Sat Apr 25 12:22:04 2020 +0200 efi/libstub: Re-enable command line initrd loading for x86 Commit: cf6b83664895a5 ("efi/libstub: Make initrd file loader configurable") inadvertently disabled support on x86 for loading an initrd passed via the initrd= option on the kernel command line. Add X86 to the newly introduced Kconfig option's title and depends declarations, so it gets enabled by default, as before. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: linux-efi@vger.kernel.org commit 4353dd3b70783ebbc83fcf12d9c0af3fbab0223b Merge: 594e576d4b93 4eb8320bd1aa Author: Ingo Molnar Date: Sat Apr 25 10:25:02 2020 +0200 Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/core Pull EFI changes for v5.8 from Ard Biesheuvel: "- preliminary changes for RISC-V - add support for setting the resolution on the EFI framebuffer - simplify kernel image loading for arm64 - Move .bss into .data via the linker script instead of relying on symbol annotations. - Get rid of __pure getters to access global variables - Clean up the config table matching arrays" Signed-off-by: Ingo Molnar commit 30cdd62dce6b59692a3a9081ab8116a0da07ede4 Author: Anson Huang Date: Fri Apr 3 20:03:24 2020 +0800 arm64: dts: imx8mp: Add thermal zones support i.MX8MP has a TMU inside which supports two thermal zones, add support for them. Signed-off-by: Anson Huang Reviewed-by: Amit Kucheria Signed-off-by: Shawn Guo commit 9c4b24db828a560789bfe8f58495f9df5bfe36b0 Author: Marco Felsch Date: Thu Apr 2 10:34:36 2020 +0200 dt-bindings: arm: imx: add kontron smarc to schema Add Kontron SMARC module compatibles to the schema so we can make use of them for the validation. Signed-off-by: Marco Felsch Signed-off-by: Shawn Guo commit 592a8191f05805bc10aa875509bec64d565df931 Author: Kuldeep Singh Date: Mon Mar 30 16:46:31 2020 +0530 arm: dts: ls1021atwr: Add QSPI node properties LS1021A-TWR has one micron "n25q128a13" flash of size 16M. Add QSPI node properties for it. Signed-off-by: Kuldeep Singh Signed-off-by: Shawn Guo commit f5ac5ac12dd678f0abe708baa55a5049a44b7ab8 Author: Kuldeep Singh Date: Mon Mar 30 16:46:30 2020 +0530 arm64: dts: ls1012a: Add QSPI node properties Add support for QSPI on NXP layerscape LS1012A-RDB, LS1012A-QDS, LS1012A-FRDM and LS1012A-FRWY boards. LS1012A-RDB has 2 Spansion "s25fs512s" flashes of size 64M each and only one can be accessed at a time. LS1012A-QDS/FRDM has 1 spansion "s25fs512s" flash of size 64M. LS1012A-FRWY has one winbond "w25q16dw" flash of size 2M. Use generic compatibles as "jedec,spi-nor" for automatic detection of flash. Configure RX and TX buswidth values as 2 as only two I/O lines are available for data transfer. Add ls1012a(si) node alongwith flash nodes. Signed-off-by: Ashish Kumar Signed-off-by: Kuldeep Singh Signed-off-by: Shawn Guo commit e0d8d4eaccc29959f20de8bef9f1bcce4e952dfc Author: Andreas Kemnade Date: Sun Mar 29 12:42:50 2020 +0200 ARM: dts: e60k02: add interrupt for PMIC Since the PMIC driver now has IRQ handling, add the GPIO to listen to things like RTC alarm or ADC conversion completion. Signed-off-by: Andreas Kemnade Signed-off-by: Shawn Guo commit 6033cebdfff9b10192eb254e8cc60fedd595ea7f Author: Yang Yingliang Date: Fri Apr 24 16:03:48 2020 +0800 ptp: idt82p33: remove unnecessary comparison The type of loaddr is u8 which is always '<=' 0xff, so the loaddr <= 0xff is always true, we can remove this comparison. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 5d7163a117876f95f44f6f9fb9f028daead42243 Author: YueHaibing Date: Fri Apr 24 17:06:29 2020 +0800 net: ipv6: remove unused inline function ip6_set_txhash commit 877d1f6291f8 ("net: Set sk_txhash from a random number") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 7f023ec91c3cb188ab8a52478f3145ccd4daef68 Author: YueHaibing Date: Fri Apr 24 17:04:50 2020 +0800 net: sched: remove unused inline function qdisc_reset_all_tx There's no callers in-tree anymore. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit d9e4171a4a2cf20e803eb31a92d6854ea7002c38 Author: Zheng Bin Date: Fri Apr 24 17:04:28 2020 +0800 net: atlantic: Remove unneeded semicolon Fixes coccicheck warning: drivers/net/ethernet/aquantia/atlantic/aq_macsec.c:404:2-3: Unneeded semicolon drivers/net/ethernet/aquantia/atlantic/aq_macsec.c:420:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Acked-by: Igor Russkikh Signed-off-by: David S. Miller commit 10395e99f4a6f67d53b89f143f610ee954c24531 Author: Zheng Bin Date: Fri Apr 24 17:00:15 2020 +0800 net/mlxfw: Remove unneeded semicolon Fixes coccicheck warning: drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c:79:2-3: Unneeded semicolon drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c:162:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zheng Bin Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 993e8ec9754b61cb2999fdd7f5f1decb32cd8487 Merge: 5c05c1dbb177 9576e9fa1c02 Author: David S. Miller Date: Fri Apr 24 16:47:51 2020 -0700 Merge branch 'net-phy-smaller-phylib-improvements' Heiner Kallweit says: ==================== net: phy: smaller phylib improvements Series with smaller improvements for suspend and soft-reset handling. ==================== Signed-off-by: David S. Miller commit 9576e9fa1c02aea3cf1e42eadcbeb12ccf5e87de Author: Heiner Kallweit Date: Thu Apr 23 21:38:42 2020 +0200 net: phy: clear phydev->suspended after soft reset If a soft reset is triggered whilst PHY is in power-down, then phydev->suspended will remain set. Seems we didn't face any issue yet caused by this, but better reset the suspended flag after soft reset. See also the following from 22.2.4.1.1 Resetting a PHY is accomplished by setting bit 0.15 to a logic one. This action shall set the status and control registers to their default states. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3194915486b2bc3f77745774f1731b78f32ff688 Author: Heiner Kallweit Date: Thu Apr 23 21:35:36 2020 +0200 net: phy: remove genphy_no_soft_reset Since 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") we don't need genphy_no_soft_reset() any longer. Not setting callback soft_reset results in a no-op now. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit d70c47c8dc6902db19555b7ff7e6eeb264d4ac06 Author: Heiner Kallweit Date: Thu Apr 23 21:34:33 2020 +0200 net: phy: make phy_suspend a no-op if PHY is suspended already Gently handle the case that phy_suspend() is called whilst PHY is in power-down. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 5c05c1dbb177293636a3f5ea4caa872dfcf50ccd Author: Russell King Date: Thu Apr 23 17:02:56 2020 +0100 net: phylink, dsa: eliminate phylink_fixed_state_cb() Move the callback into the phylink_config structure, rather than providing a callback to set this up. Signed-off-by: Russell King Tested-by: Florian Fainelli Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6861d6d9cf36eac894ad235e75b3cf8bc0590f62 Merge: 92dc39fd4047 b89c1e6bdc73 Author: David S. Miller Date: Fri Apr 24 16:44:55 2020 -0700 Merge branch 'qdisc-noop' Jesper Dangaard Brouer says: ==================== Fix qdisc noop issue caused by driver and identify future bugs I've been very puzzled why networking on my NXP development board, using driver dpaa2-eth, stopped working when I updated the kernel version >= 5.3. The observable issue were that interface would drop all TX packets, because it had assigned the qdisc noop. This turned out the be a NIC driver bug, that would only get triggered when using sysctl net/core/default_qdisc=fq_codel. It was non-trivial to find out[1] this was driver related. Thus, this patchset besides fixing the driver bug, also helps end-user identify the issue. [1]: https://github.com/xdp-project/xdp-project/blob/master/areas/arm64/board_nxp_ls1088/nxp-board04-troubleshoot-qdisc.org ==================== Signed-off-by: David S. Miller commit b89c1e6bdc73f5775e118eb2ab778e75b262b30c Author: Jesper Dangaard Brouer Date: Thu Apr 23 16:57:50 2020 +0200 dpaa2-eth: fix return codes used in ndo_setup_tc Drivers ndo_setup_tc call should return -EOPNOTSUPP, when it cannot support the qdisc type. Other return values will result in failing the qdisc setup. This lead to qdisc noop getting assigned, which will drop all TX packets on the interface. Fixes: ab1e6de2bd49 ("dpaa2-eth: Add mqprio support") Signed-off-by: Jesper Dangaard Brouer Tested-by: Ioana Ciornei Signed-off-by: David S. Miller commit b70ba69ef1f72e58c8e43b5689a37a66a7b31d11 Author: Jesper Dangaard Brouer Date: Thu Apr 23 16:57:45 2020 +0200 net: sched: report ndo_setup_tc failures via extack Help end-users of the 'tc' command to see if the drivers ndo_setup_tc function call fails. Troubleshooting when this happens is non-trivial (see full process here[1]), and results in net_device getting assigned the 'qdisc noop', which will drop all TX packets on the interface. [1]: https://github.com/xdp-project/xdp-project/blob/master/areas/arm64/board_nxp_ls1088/nxp-board04-troubleshoot-qdisc.org Signed-off-by: Jesper Dangaard Brouer Tested-by: Ioana Ciornei Signed-off-by: David S. Miller commit af03958da0678c3162ae534829cabf9f67f0d950 Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 15 17:38:32 2020 -0700 PCI/EDR: Log only ACPI_NOTIFY_DISCONNECT_RECOVER events Previously we logged *all* ACPI SYSTEM-level events, which may include lots of non-EDR events. Move the message so we only log those related to EDR. Link: https://lore.kernel.org/r/01afb4e01efbe455de0c445bef6cf3ffc59340d2.1586996350.git.sathyanarayanan.kuppuswamy@linux.intel.com [bhelgaas: drop the pci_dbg() of all events since ACPI can log those already] Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Bjorn Helgaas commit adc9fbcd7d04a711b765e8f7f5c2e07cbbac0f20 Author: Rob Herring Date: Thu Apr 16 16:51:14 2020 -0500 PCI: Use of_node_name_eq() for node name comparisons Convert string compares of DT node names to use of_node_name_eq() helper instead. This removes direct access to the node name pointer. Link: https://lore.kernel.org/r/20200416215114.7715-1-robh@kernel.org Signed-off-by: Rob Herring Signed-off-by: Bjorn Helgaas Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman commit 92dc39fd4047c8fb7573df5247a81717bc10e247 Merge: 1802136023c0 4780dbdbd957 Author: David S. Miller Date: Fri Apr 24 15:41:51 2020 -0700 Merge branch 'mlxsw-Mirroring-cleanups' Ido Schimmel says: ==================== mlxsw: Mirroring cleanups This patch set contains various cleanups in SPAN (mirroring) code noticed by Amit and I while working on future enhancements in this area. No functional changes intended. Tested by current mirroring selftests. Patches #1-#2 from Amit reduce nesting in a certain function and rename a callback to a more meaningful name. Patch #3 removes debug prints that have little value. Patch #4 converts a reference count to 'refcount_t' in order to catch over/under flows. Patch #5 replaces a zero-length array with flexible-array member in order to get a compiler warning in case the flexible array does not occur last in the structure. ==================== Signed-off-by: David S. Miller commit 4780dbdbd957c204b62680161f39bb0bc4daf3a0 Author: Ido Schimmel Date: Fri Apr 24 18:43:45 2020 +0300 mlxsw: spectrum_span: Replace zero-length array with flexible-array member In a similar fashion to commit e99f8e7f88b5 ("mlxsw: Replace zero-length array with flexible-array member"), use a flexible-array member to get a compiler warning in case the flexible array does not occur last in the structure. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 4c00dafc59c7cc25a381abf7671b203a2fcfca71 Author: Ido Schimmel Date: Fri Apr 24 18:43:44 2020 +0300 mlxsw: spectrum_span: Use 'refcount_t' for reference counting 'refcount_t' is very useful for catching over/under flows. Convert the SPAN agent objects to use it instead of 'int' for their reference count. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit c0c2899cf66ee7a68e5b3a7a135089622e005008 Author: Ido Schimmel Date: Fri Apr 24 18:43:43 2020 +0300 mlxsw: spectrum_span: Remove unnecessary debug prints To the best of my knowledge, these debug prints were never used. Remove them. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 7f9b099bd9d3143d3c1a0ea74b586c5189e58750 Author: Amit Cohen Date: Fri Apr 24 18:43:42 2020 +0300 mlxsw: spectrum_span: Rename parms() to parms_set() Use a more meaningful name for parms() function. Signed-off-by: Amit Cohen Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8146458fcd7942861c754b85b5464ef2a8cfacbb Author: Amit Cohen Date: Fri Apr 24 18:43:41 2020 +0300 mlxsw: spectrum_span: Reduce nesting in mlxsw_sp_span_entry_configure() Use early return to avoid unnecessary nesting. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit f371d53453772bcbb9ac2201029b66281f713c07 Author: Jason Yan Date: Tue Apr 21 11:40:29 2020 +0800 scsi: sgiwd93: Remove unneeded semicolon in sgiwd93.c Fix the following coccicheck warning: drivers/scsi/sgiwd93.c:190:2-3: Unneeded semicolon Link: https://lore.kernel.org/r/20200421034029.28030-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 9b77c9da6a1f0bd89f130710671b2396239b1ee4 Author: Jason Yan Date: Tue Apr 21 11:40:38 2020 +0800 scsi: qla4xxx: Remove unneeded semicolon in ql4_os.c Fix the following coccicheck warning: drivers/scsi/qla4xxx/ql4_os.c:969:3-4: Unneeded semicolon Link: https://lore.kernel.org/r/20200421034038.28113-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 8d5e202802a5de1f81c445cacbb9359fcd4e6f23 Author: Jason Yan Date: Tue Apr 21 11:40:50 2020 +0800 scsi: isci: Use true, false for bool variables Fix the following coccicheck warning: drivers/scsi/isci/isci.h:515:1-12: WARNING: Assignment of 0/1 to bool variable drivers/scsi/isci/isci.h:503:1-12: WARNING: Assignment of 0/1 to bool variable drivers/scsi/isci/isci.h:509:1-12: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200421034050.28193-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit acfcb728bd57f3f04ae82050c9c5903cee077b08 Author: Jason Yan Date: Tue Apr 21 11:40:19 2020 +0800 scsi: bnx2fc: Remove unneeded semicolon in bnx2fc_fcoe.c Fix the following coccicheck warning: drivers/scsi/bnx2fc/bnx2fc_fcoe.c:948:4-5: Unneeded semicolon drivers/scsi/bnx2fc/bnx2fc_fcoe.c:968:4-5: Unneeded semicolon Link: https://lore.kernel.org/r/20200421034019.27949-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit f71ded01cc3ff8da997b6e910fe3eb59e2336e39 Author: Jason Yan Date: Tue Apr 21 11:39:57 2020 +0800 scsi: bfa: Remove unneeded semicolon in bfa_fcs_rport.c Fix the following coccicheck warning: drivers/scsi/bfa/bfa_fcs_rport.c:2452:2-3: Unneeded semicolon drivers/scsi/bfa/bfa_fcs_rport.c:1578:3-4: Unneeded semicolon Link: https://lore.kernel.org/r/20200421033957.27783-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 0745c834f7937bee2fe7de5c500ea4d6aa38ce35 Author: YueHaibing Date: Sat Apr 18 07:10:57 2020 +0000 scsi: bfa: Remove set but not used variable 'fchs' Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/bfa/bfa_svc.c: In function 'uf_recv': drivers/scsi/bfa/bfa_svc.c:5520:17: warning: variable 'fchs' set but not used [-Wunused-but-set-variable] struct fchs_s *fchs; ^ Link: https://lore.kernel.org/r/20200418071057.96699-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Signed-off-by: Martin K. Petersen commit 6942d531e2d22a72492502be010fee9030c58993 Author: Jason Yan Date: Sat Apr 18 15:06:15 2020 +0800 scsi: snic: Make snic_io_exch_ver_cmpl_handler() return void This function does not need a return value since no callers depend on it. Make it return void. This also fixes the coccicheck warning: drivers/scsi/snic/snic_ctl.c:163:5-8: Unneeded variable: "ret". Return "0" on line 228 Link: https://lore.kernel.org/r/20200418070615.11603-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit baf3fbf26cc003eaf7612ea215d6cc191bd6f850 Author: Jason Yan Date: Sat Apr 18 17:58:50 2020 +0800 scsi: mpt3sas: Remove NULL check before freeing function Fix the following coccicheck warning: drivers/scsi/mpt3sas/mpt3sas_base.c:4906:3-19: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/20200418095850.34883-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 2e9ef0fcac01a871ab1afcaab9398beeb4d76ea9 Author: Jason Yan Date: Sat Apr 18 17:59:03 2020 +0800 scsi: ipr: Remove NULL check before freeing function Fix the following coccicheck warning: drivers/scsi/ipr.c:9533:2-18: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/20200418095903.35118-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit f166021c0f51ffdb1661330ef8c8a5bb273560b8 Author: Jason Yan Date: Sat Apr 18 15:05:53 2020 +0800 scsi: bfa: Remove unneeded semicolon in bfa_fcs_lport_ns_sm_online() Fix the following coccicheck warning: drivers/scsi/bfa/bfa_fcs_lport.c:4361:3-4: Unneeded semicolon Link: https://lore.kernel.org/r/20200418070553.11262-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit f8f794a15adcea250c85cfa51716d09b03507375 Author: Wu Bo Date: Sat Apr 18 16:07:21 2020 +0800 scsi: pmcraid: Replace dma_pool_malloc with dma_pool_zalloc Replace dma_pool_malloc with dma_pool_zalloc to make the code more concise in pmcraid_allocate_control_blocks() function. Link: https://lore.kernel.org/r/1587197241-274646-1-git-send-email-wubo40@huawei.com Signed-off-by: Wu Bo Signed-off-by: Martin K. Petersen commit 7c59dace7e8e8cc75815f11882805368e5d2a807 Author: Maurizio Lombardi Date: Fri Apr 24 13:39:13 2020 +0200 scsi: target: iscsi: Remove the iscsi_data_count structure This patch removes the iscsi_data_count structure and the iscsit_do_rx_data() function because they are used only by rx_data() Link: https://lore.kernel.org/r/20200424113913.17237-1-mlombard@redhat.com Reviewed-by: Mike Christie Signed-off-by: Maurizio Lombardi Signed-off-by: Martin K. Petersen commit f983622ae60516d634008c7b1ff9ffff4f7bb8ae Author: Ming Lei Date: Thu Apr 23 10:07:13 2020 +0800 scsi: core: Avoid calling synchronize_rcu() for each device in scsi_host_block() scsi_host_block() calls scsi_internal_device_block() for each scsi_device and scsi_internal_device_block() calls blk_mq_quiesce_queue() for each LUN. Since synchronize_rcu() is called from blk_mq_quiesce_queue(), this can cause substantial slowdowns on systems with many LUNs. Use scsi_internal_device_block_nowait() to implement scsi_host_block() so it is sufficient to run synchronize_rcu() once. This is safe since SCSI does not set the BLK_MQ_F_BLOCKING flag. [mkp: commit desc and comment tweaks] Link: https://lore.kernel.org/r/20200423020713.332743-1-ming.lei@redhat.com Cc: Steffen Maier Cc: Bart Van Assche Cc: Christoph Hellwig Cc: Dexuan Cui Cc: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit 3fa65812c20297bf71724c6138c0aed8531012f9 Author: Jason Yan Date: Tue Apr 21 11:41:20 2020 +0800 scsi: BusLogic: Remove conversion to bool in blogic_inquiry() The '!=' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/scsi/BusLogic.c:2240:46-51: WARNING: conversion to bool not needed here Link: https://lore.kernel.org/r/20200421034120.28433-1-yanaijie@huawei.com Acked-by: Khalid Aziz Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 1a5d1d940ba8448ac9a17d5961f587ca36239dad Author: Jason Yan Date: Tue Apr 21 11:41:11 2020 +0800 scsi: megaraid: Use true, false for bool variables Fix the following coccicheck warning: drivers/scsi/megaraid/megaraid_sas_fusion.c:4242:6-16: WARNING: Assignment of 0/1 to bool variable drivers/scsi/megaraid/megaraid_sas_fusion.c:4786:1-29: WARNING: Assignment of 0/1 to bool variable drivers/scsi/megaraid/megaraid_sas_fusion.c:4791:1-29: WARNING: Assignment of 0/1 to bool variable drivers/scsi/megaraid/megaraid_sas_fusion.c:4716:1-29: WARNING: Assignment of 0/1 to bool variable drivers/scsi/megaraid/megaraid_sas_fusion.c:4721:1-29: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200421034111.28353-1-yanaijie@huawei.com Acked-by: Chandrakanth Patil Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 3147d8aaa03eac0e68742621e8f05323459aa37d Author: Eric W. Biederman Date: Mon Feb 24 18:53:09 2020 -0600 proc: Use PIDTYPE_TGID in next_tgid Combine the pid_task and thes test has_group_leader_pid into a single dereference by using pid_task(PIDTYPE_TGID). This makes the code simpler and proof against needing to even think about any shenanigans that de_thread might get up to. Acked-by: Oleg Nesterov Signed-off-by: "Eric W. Biederman" commit 0fb5ce62c5920b6e0a8a061f2fe80e0403281e10 Merge: c59f415a7cb6 e61bb8b36a28 Author: Eric W. Biederman Date: Fri Apr 24 16:52:43 2020 -0500 proc: modernize proc to support multiple private instances Alexey Gladkov writes: Procfs modernization: --------------------- Historically procfs was always tied to pid namespaces, during pid namespace creation we internally create a procfs mount for it. However, this has the effect that all new procfs mounts are just a mirror of the internal one, any change, any mount option update, any new future introduction will propagate to all other procfs mounts that are in the same pid namespace. This may have solved several use cases in that time. However today we face new requirements, and making procfs able to support new private instances inside same pid namespace seems a major point. If we want to to introduce new features and security mechanisms we have to make sure first that we do not break existing usecases. Supporting private procfs instances will allow to support new features and behaviour without propagating it to all other procfs mounts. Today procfs is more of a burden especially to some Embedded, IoT, sandbox, container use cases. In user space we are over-mounting null or inaccessible files on top to hide files and information. If we want to hide pids we have to create PID namespaces otherwise mount options propagate to all other proc mounts, changing a mount option value in one mount will propagate to all other proc mounts. If we want to introduce new features, then they will propagate to all other mounts too, resulting either maybe new useful functionality or maybe breaking stuff. We have also to note that userspace should not workaround procfs, the kernel should just provide a sane simple interface. In this regard several developers and maintainers pointed out that there are problems with procfs and it has to be modernized: "Here's another one: split up and modernize /proc." by Andy Lutomirski [1] Discussion about kernel pointer leaks: "And yes, as Kees and Daniel mentioned, it's definitely not just dmesg. In fact, the primary things tend to be /proc and /sys, not dmesg itself." By Linus Torvalds [2] Lot of other areas in the kernel and filesystems have been updated to be able to support private instances, devpts is one major example [3]. Which will be used for: 1) Embedded systems and IoT: usually we have one supervisor for apps, we have some lightweight sandbox support, however if we create pid namespaces we have to manage all the processes inside too, where our goal is to be able to run a bunch of apps each one inside its own mount namespace, maybe use network namespaces for vlans setups, but right now we only want mount namespaces, without all the other complexity. We want procfs to behave more like a real file system, and block access to inodes that belong to other users. The 'hidepid=' will not work since it is a shared mount option. 2) Containers, sandboxes and Private instances of file systems - devpts case Historically, lot of file systems inside Linux kernel view when instantiated were just a mirror of an already created and mounted filesystem. This was the case of devpts filesystem, it seems at that time the requirements were to optimize things and reuse the same memory, etc. This design used to work but not anymore with today's containers, IoT, hostile environments and all the privacy challenges that Linux faces. In that regards, devpts was updated so that each new mounts is a total independent file system by the following patches: "devpts: Make each mount of devpts an independent filesystem" by Eric W. Biederman [3] [4] 3) Linux Security Modules have multiple ptrace paths inside some subsystems, however inside procfs, the implementation does not guarantee that the ptrace() check which triggers the security_ptrace_check() hook will always run. We have the 'hidepid' mount option that can be used to force the ptrace_may_access() check inside has_pid_permissions() to run. The problem is that 'hidepid' is per pid namespace and not attached to the mount point, any remount or modification of 'hidepid' will propagate to all other procfs mounts. This also does not allow to support Yama LSM easily in desktop and user sessions. Yama ptrace scope which restricts ptrace and some other syscalls to be allowed only on inferiors, can be updated to have a per-task context, where the context will be inherited during fork(), clone() and preserved across execve(). If we support multiple private procfs instances, then we may force the ptrace_may_access() on /proc// to always run inside that new procfs instances. This will allow to specifiy on user sessions if we should populate procfs with pids that the user can ptrace or not. By using Yama ptrace scope, some restricted users will only be able to see inferiors inside /proc, they won't even be able to see their other processes. Some software like Chromium, Firefox's crash handler, Wine and others are already using Yama to restrict which processes can be ptracable. With this change this will give the possibility to restrict /proc// but more importantly this will give desktop users a generic and usuable way to specifiy which users should see all processes and which user can not. Side notes: * This covers the lack of seccomp where it is not able to parse arguments, it is easy to install a seccomp filter on direct syscalls that operate on pids, however /proc// is a Linux ABI using filesystem syscalls. With this change all LSMs should be able to analyze open/read/write/close... on /proc// 4) This will allow to implement new features either in kernel or userspace without having to worry about procfs. In containers, sandboxes, etc we have workarounds to hide some /proc inodes, this should be supported natively without doing extra complex work, the kernel should be able to support sane options that work with today and future Linux use cases. 5) Creation of new superblock with all procfs options for each procfs mount will fix the ignoring of mount options. The problem is that the second mount of procfs in the same pid namespace ignores the mount options. The mount options are ignored without error until procfs is remounted. Before: proc /proc proc rw,relatime,hidepid=2 0 0 mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0 +++ exited with 0 +++ proc /proc proc rw,relatime,hidepid=2 0 0 proc /tmp/proc proc rw,relatime,hidepid=2 0 0 proc /proc proc rw,relatime,hidepid=1 0 0 proc /tmp/proc proc rw,relatime,hidepid=1 0 0 After: proc /proc proc rw,relatime,hidepid=ptraceable 0 0 proc /proc proc rw,relatime,hidepid=ptraceable 0 0 proc /tmp/proc proc rw,relatime,hidepid=invisible 0 0 Introduced changes: ------------------- Each mount of procfs creates a separate procfs instance with its own mount options. This series adds few new mount options: * New 'hidepid=ptraceable' or 'hidepid=4' mount option to show only ptraceable processes in the procfs. This allows to support lightweight sandboxes in Embedded Linux, also solves the case for LSM where now with this mount option, we make sure that they have a ptrace path in procfs. * 'subset=pid' that allows to hide non-pid inodes from procfs. It can be used in containers and sandboxes, as these are already trying to hide and block access to procfs inodes anyway. ChangeLog: ---------- * Rebase on top of v5.7-rc1. * Fix a resource leak if proc is not mounted or if proc is simply reconfigured. * Add few selftests. * After a discussion with Eric W. Biederman, the numerical values for hidepid parameter have been removed from uapi. * Remove proc_self and proc_thread_self from the pid_namespace struct. * I took into account the comment of Kees Cook. * Update Reviewed-by tags. * 'subset=pidfs' renamed to 'subset=pid' as suggested by Alexey Dobriyan. * Include Reviewed-by tags. * Rebase on top of Eric W. Biederman's procfs changes. * Add human readable values of 'hidepid' as suggested by Andy Lutomirski. * Started using RCU lock to clean dcache entries as suggested by Linus Torvalds. * 'pidonly=1' renamed to 'subset=pidfs' as suggested by Alexey Dobriyan. * HIDEPID_* moved to uapi/ as they are user interface to mount(). Suggested-by Alexey Dobriyan * 'hidepid=' and 'gid=' mount options are moved from pid namespace to superblock. * 'newinstance' mount option removed as suggested by Eric W. Biederman. Mount of procfs always creates a new instance. * 'limit_pids' renamed to 'hidepid=3'. * I took into account the comment of Linus Torvalds [7]. * Documentation added. * Fixed a bug that caused a problem with the Fedora boot. * The 'pidonly' option is visible among the mount options. * Renamed mount options to 'newinstance' and 'pids=' Suggested-by: Andy Lutomirski * Fixed order of commit, Suggested-by: Andy Lutomirski * Many bug fixes. * Removed 'unshared' mount option and replaced it with 'limit_pids' which is attached to the current procfs mount. Suggested-by Andy Lutomirski * Do not fill dcache with pid entries that we can not ptrace. * Many bug fixes. References: ----------- [1] https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2017-January/004215.html [2] http://www.openwall.com/lists/kernel-hardening/2017/10/05/5 [3] https://lwn.net/Articles/689539/ [4] http://lxr.free-electrons.com/source/Documentation/filesystems/devpts.txt?v=3.14 [5] https://lkml.org/lkml/2017/5/2/407 [6] https://lkml.org/lkml/2017/5/3/357 [7] https://lkml.org/lkml/2018/5/11/505 Alexey Gladkov (7): proc: rename struct proc_fs_info to proc_fs_opts proc: allow to mount many instances of proc in one pid namespace proc: instantiate only pids that we can ptrace on 'hidepid=4' mount option proc: add option to mount only a pids subset docs: proc: add documentation for "hidepid=4" and "subset=pid" options and new mount behavior proc: use human-readable values for hidepid proc: use named enums for better readability Documentation/filesystems/proc.rst | 92 +++++++++--- fs/proc/base.c | 48 +++++-- fs/proc/generic.c | 9 ++ fs/proc/inode.c | 30 +++- fs/proc/root.c | 131 +++++++++++++----- fs/proc/self.c | 6 +- fs/proc/thread_self.c | 6 +- fs/proc_namespace.c | 14 +- include/linux/pid_namespace.h | 12 -- include/linux/proc_fs.h | 30 +++- tools/testing/selftests/proc/.gitignore | 2 + tools/testing/selftests/proc/Makefile | 2 + .../selftests/proc/proc-fsconfig-hidepid.c | 50 +++++++ .../selftests/proc/proc-multiple-procfs.c | 48 +++++++ 14 files changed, 384 insertions(+), 96 deletions(-) create mode 100644 tools/testing/selftests/proc/proc-fsconfig-hidepid.c create mode 100644 tools/testing/selftests/proc/proc-multiple-procfs.c Link: https://lore.kernel.org/lkml/20200419141057.621356-1-gladkov.alexey@gmail.com/ Signed-off-by: "Eric W. Biederman" commit c59f415a7cb6e1e1e1cdbd6ee370b050e95f6b21 Author: Alexey Gladkov Date: Thu Apr 23 22:03:10 2020 +0200 Use proc_pid_ns() to get pid_namespace from the proc superblock To get pid_namespace from the procfs superblock should be used a special helper. This will avoid errors when s_fs_info will change the type. Link: https://lore.kernel.org/lkml/20200423200316.164518-3-gladkov.alexey@gmail.com/ Link: https://lore.kernel.org/lkml/20200423112858.95820-1-gladkov.alexey@gmail.com/ Link: https://lore.kernel.org/lkml/06B50A1C-406F-4057-BFA8-3A7729EA7469@lca.pw/ Signed-off-by: Alexey Gladkov Signed-off-by: Eric W. Biederman commit 9669a5079995ddbe161243ca3e6cc86ca3ab6500 Author: Chris Wilson Date: Fri Apr 24 20:14:10 2020 +0100 drm/i915: Drop rq->ring->vma peeking from error capture We only hold the active spinlock while dumping the error state, and this does not prevent another thread from retiring the request -- as it is quite possible that despite us capturing the current state, the GPU has completed the request. As such, it is dangerous to dereference state below the request as it may already be freed, and the simplest way to avoid the danger is not include it in the error state. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1788 Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Andi Shyti Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200424191410.27570-1-chris@chris-wilson.co.uk commit edb7f9d6b574decc5a4c8c23dca4d07adc23f482 Merge: 09beebd8f93b 2fff3f73e8c2 Author: Rafael J. Wysocki Date: Fri Apr 24 21:37:01 2020 +0200 Merge back system-wide PM updates for v5.8. commit 8c8ff55b4da7c614ca159a7c04099d17b37ada25 Author: Bjorn Helgaas Date: Wed Apr 8 18:13:34 2020 -0500 PCI/AER: Don't select CONFIG_PCIEAER by default PCIe Advanced Error Reporting (AER) is optional and there's no need for it to be selected by default. Remove the "default y" for CONFIG_PCIEAER. Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Cc: Russell Currey Cc: Sam Bobroff Cc: Oliver O'Halloran commit 2fff3f73e8c27801b84d2315e1a49bce96b00eff Author: Rafael J. Wysocki Date: Sat Apr 18 18:55:32 2020 +0200 Documentation: PM: sleep: Update driver flags documentation Update the documentation of the driver flags for system-wide power management to reflect the current code flows and be more consistent. Signed-off-by: Rafael J. Wysocki commit fbedda4e4dc5a96d613dc056a82c3f14942f7998 Author: Bjorn Helgaas Date: Wed Apr 8 18:08:53 2020 -0500 PCI: keystone: Don't select CONFIG_PCI_KEYSTONE_HOST by default Drivers should not be selected by default because that bloats the kernel for people who don't need them. Remove the "default y" for CONFIG_PCI_KEYSTONE_HOST. Signed-off-by: Bjorn Helgaas Cc: Murali Karicheri Cc: linux-arm-kernel@lists.infradead.org commit 94b84ac1979b3b70b80a6d499d0c397057a6c7b3 Author: Bjorn Helgaas Date: Wed Apr 8 18:10:54 2020 -0500 PCI: dra7xx: Don't select CONFIG_PCI_DRA7XX_HOST by default Drivers should not be selected by default because that bloats the kernel for people who don't need them. Enable CONFIG_PCI_DRA7XX_HOST by default only if SOC_DRA7XX. Signed-off-by: Bjorn Helgaas Cc: Kishon Vijay Abraham I Cc: linux-omap@vger.kernel.org commit 2a3f34750b8b07df42ab4b30b70e029d46e0d7f3 Author: Rafael J. Wysocki Date: Sat Apr 18 18:53:20 2020 +0200 PM: sleep: core: Rename DPM_FLAG_LEAVE_SUSPENDED Rename DPM_FLAG_LEAVE_SUSPENDED to DPM_FLAG_MAY_SKIP_RESUME which matches its purpose more closely. No functional impact. Suggested-by: Alan Stern Signed-off-by: Rafael J. Wysocki Acked-by: Wolfram Sang # for I2C Acked-by: Alan Stern Acked-by: Bjorn Helgaas commit c3aaf086701d05a82c8156ee8620af41e5a7d6fe Author: Bjorn Helgaas Date: Tue Apr 7 18:23:15 2020 -0500 PCI/PM: Call .bridge_d3() hook only if non-NULL 26ad34d510a8 ("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") added the struct pci_platform_pm_ops.bridge_d3() function pointer and platform_pci_bridge_d3() to use it. The .bridge_d3() op is implemented by acpi_pci_platform_pm, but not by mid_pci_platform_pm. We don't expect platform_pci_bridge_d3() to be called on Intel MID platforms, but nothing in the code itself would prevent that. Check the .bridge_d3() pointer for NULL before calling it. Fixes: 26ad34d510a8 ("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit e07515563d010d8b32967634e8dc2fdc732c1aa6 Author: Rafael J. Wysocki Date: Sat Apr 18 18:53:01 2020 +0200 PM: sleep: core: Rename DPM_FLAG_NEVER_SKIP Rename DPM_FLAG_NEVER_SKIP to DPM_FLAG_NO_DIRECT_COMPLETE which matches its purpose more closely. No functional impact. Suggested-by: Alan Stern Signed-off-by: Rafael J. Wysocki Acked-by: Bjorn Helgaas # for PCI parts Acked-by: Jeff Kirsher Acked-by: Alan Stern Acked-by: Bjorn Helgaas Acked-by: Alex Deucher commit fa2bfead910322e44e7e0bb74364ac198a2abd32 Author: Rafael J. Wysocki Date: Sat Apr 18 18:52:48 2020 +0200 PM: sleep: core: Rename dev_pm_smart_suspend_and_suspended() Because all callers of dev_pm_smart_suspend_and_suspended use it only for checking whether or not to skip driver suspend callbacks for a device, rename it to dev_pm_skip_suspend() in analogy with dev_pm_skip_resume(). No functional impact. Suggested-by: Alan Stern Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Acked-by: Bjorn Helgaas commit 76c70cb58ce30264af4b714109ee756da25d830a Author: Rafael J. Wysocki Date: Sat Apr 18 18:52:30 2020 +0200 PM: sleep: core: Rename dev_pm_may_skip_resume() The name of dev_pm_may_skip_resume() may be easily confused with the power.may_skip_resume flag which is not checked by that function, so rename the former as dev_pm_skip_resume(). No functional impact. Suggested-by: Alan Stern Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Acked-by: Bjorn Helgaas commit 0fe8a1be599ab97f840ba22d98cb8f24a9f9e872 Author: Rafael J. Wysocki Date: Sat Apr 18 18:52:19 2020 +0200 PM: sleep: core: Rework the power.may_skip_resume handling Because the power.may_skip_resume device status bit is taken into account in combination with the DPM_FLAG_LEAVE_SUSPENDED driver flag, it can be set to 'true' for all devices in the "suspend" phase of a suspend-resume cycle, so do that. Then, neither the PM core nor the middle-layer (sybsystem) code handling it needs to set it to 'true' any more and it just has to be cleared if there is a reason to avoid skipping the "noirq" and "early" resume callbacks provided by the driver, so update the code in question accordingly. Suggested-by: Alan Stern Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Acked-by: Bjorn Helgaas commit 6e176bf8d46194353163c2cb660808bc633b45d9 Author: Rafael J. Wysocki Date: Sat Apr 18 18:52:08 2020 +0200 PM: sleep: core: Do not skip callbacks in the resume phase The current code in device_resume_noirq() causes the entire early resume and resume phases of device suspend to be skipped for devices for which the noirq resume phase have been skipped (due to the LEAVE_SUSPENDED flag being set) on the premise that those devices should stay in runtime-suspend after system-wide resume. However, that may not be correct in two situations. First, the middle layer (subsystem) noirq resume callback may be missing for a given device, but its early resume callback may be present and it may need to do something even if it decides to skip the driver callback. Second, if the device's wakeup settings were adjusted in the suspend phase without resuming the device (that was in runtime suspend at that time), they most likely need to be adjusted again in the resume phase and so the driver callback in that phase needs to be run. For the above reason, modify the core to allow the middle layer ->resume_late callback to run even if its ->resume_noirq callback is missing (and the core has skipped the driver-level callback in that phase) and to allow all device callbacks to run in the resume phase. Also make the core set the PM-runtime status of devices with SMART_SUSPEND set whose resume callbacks are not skipped to "active" in the "noirq" resume phase and update the affected subsystems (PCI and ACPI) accordingly. After this change, middle-layer (subsystem) callbacks will always be invoked in all phases of system suspend and resume and driver callbacks will always run in the prepare, suspend, resume, and complete phases for all devices. For devices with SMART_SUSPEND set, driver callbacks will be skipped in the late and noirq phases of system suspend if those devices remain in runtime suspend in __device_suspend_late(). Driver callbacks will also be skipped for them during the noirq and early phases of the "thaw" transition related to hibernation in that case. Setting LEAVE_SUSPENDED means that the driver allows its callbacks to be skipped in the noirq and early phases of system resume, but some additional conditions need to be met for that to happen (among other things, the power.may_skip_resume flag needs to be set for the device during system suspend for the driver callbacks to be skipped during the subsequent resume transition). For all devices with SMART_SUSPEND set whose driver callbacks are invoked during system resume, the PM-runtime status will be set to "active" (by the core). Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Acked-by: Bjorn Helgaas commit 9c878557b1ebd23316b65e4099313a4b0c21eac4 Author: Chris Wilson Date: Fri Apr 24 17:28:05 2020 +0100 drm/i915/gt: Use the RPM config register to determine clk frequencies For many configuration details within RC6 and RPS we are programming intervals for the internal clocks. From gen11, these clocks are configuration via the RPM_CONFIG and so for convenience, we would like to convert to/from more natural units (ns). Signed-off-by: Chris Wilson Cc: Andi Shyti Cc: Mika Kuoppala Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200424162805.25920-2-chris@chris-wilson.co.uk commit 555a3224299720ddecfdcda9aaabab608f9f616a Author: Chris Wilson Date: Fri Apr 24 17:28:04 2020 +0100 drm/i915/gt: Trace RPS events Add tracek to the RPS events (interrupts, worker, enabling, threshold selection, frequency setting), so that if we have to debug reticent HW we have some traces to start from. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200424162805.25920-1-chris@chris-wilson.co.uk commit 9020d3956317d052cdddd43e55acdd2970344192 Author: Thomas Gleixner Date: Tue Apr 21 11:20:31 2020 +0200 x86/alternatives: Move temporary_mm helpers into C The only user of these inlines is the text poke code and this must not be exposed to the world. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.139069561@linutronix.de commit ce4c43065c0180b7cb44f549591967fa00a627c3 Author: Suganath Prabu Date: Thu Apr 23 03:23:16 2020 -0400 scsi: mpt3sas: Update mpt3sas version to 33.101.00.00 Update mpt3sas driver version from 33.100.00.00 to 33.101.00.00. Link: https://lore.kernel.org/r/1587626596-1044-6-git-send-email-suganath-prabu.subramani@broadcom.com Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 8012209eb26b7819385a6ec6eae4b1d0a0dbe585 Author: Suganath Prabu Date: Thu Apr 23 03:23:15 2020 -0400 scsi: mpt3sas: Handle RDPQ DMA allocation in same 4G region For INVADER_SERIES, each set of 8 reply queues (0 - 7, 8 - 15,..), and for VENTURA_SERIES, each set of 16 reply queues (0 - 15, 16 - 31,..) need to be within the same 4 GB boundary. Driver uses limitation of VENTURA_SERIES to manage INVADER_SERIES as well. The driver is allocating the DMA able memory for RDPQs accordingly. 1) At driver load, set DMA mask to 64 and allocate memory for RDPQs 2) Check if allocated resources for RDPQ are in the same 4GB range 3) If #2 is true, continue with 64 bit DMA and go to #6 4) If #2 is false, then free all the resources from #1 5) Set DMA mask to 32 and allocate RDPQs 6) Proceed with driver loading and other allocations Link: https://lore.kernel.org/r/1587626596-1044-5-git-send-email-suganath-prabu.subramani@broadcom.com Reviewed-by: Christoph Hellwig Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 85896421df0cf66347003cb4603613780e81621b Author: Suganath Prabu Date: Thu Apr 23 03:23:14 2020 -0400 scsi: mpt3sas: Separate out RDPQ allocation to new function For readability separate out RDPQ allocations to new function base_alloc_rdpq_dma_pool(). Link: https://lore.kernel.org/r/1587626596-1044-4-git-send-email-suganath-prabu.subramani@broadcom.com Reviewed-by: Christoph Hellwig Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 550dc875cfbc0b1847096f07d0964ce569e41579 Author: Suganath Prabu Date: Thu Apr 23 03:23:13 2020 -0400 scsi: mpt3sas: Rename function name is_MSB_are_same Rename is_MSB_are_same() to mpt3sas_check_same_4gb_region() for better readability. Link: https://lore.kernel.org/r/1587626596-1044-3-git-send-email-suganath-prabu.subramani@broadcom.com Reviewed-by: Christoph Hellwig Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit ba27c5cf286df03a98fcdc6800b99c35e3cbdd2f Author: Christoph Hellwig Date: Thu Apr 23 03:23:12 2020 -0400 scsi: mpt3sas: Don't change the DMA coherent mask after allocations The DMA layer does not allow changing the DMA coherent mask after there are outstanding allocations. Link: https://lore.kernel.org/r/1587626596-1044-2-git-send-email-suganath-prabu.subramani@broadcom.com Reported-by: Abdul Haleem Signed-off-by: Christoph Hellwig Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit cb2a02355b042ec3ef11d0ba2a46742678e41632 Author: Thomas Gleixner Date: Tue Apr 21 11:20:30 2020 +0200 x86/cr4: Sanitize CR4.PCE update load_mm_cr4_irqsoff() is really a strange name for a function which has only one purpose: Update the CR4.PCE bit depending on the perf state. Rename it to update_cr4_pce_mm(), move it into the tlb code and provide a function which can be invoked by the perf smp function calls. Another step to remove exposure of cpu_tlbstate. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092559.049499158@linutronix.de commit b8d3ad51dfec3631763cfef3d30c16f40140058b Author: Jaroslav Kysela Date: Fri Apr 24 11:25:20 2020 +0200 ASoC: snd-sof-intel-hda-common - add hda_model parameter and pass it to HDA codec driver It may be useful to pass the specific model to the generic HDA codec routines like the legacy HDA driver (snd-hda-intel) allows. The model name "sofbus" is tricky anyway. Original proposal: https://lore.kernel.org/alsa-devel/20191203161908.7496-1-perex@perex.cz/ Signed-off-by: Jaroslav Kysela Reviewed-by: Takashi Iwai Reviewed-by: Kai Vehmanen Cc: Pierre-Louis Bossart Cc: Mark Brown Link: https://lore.kernel.org/r/20200424092520.23989-1-perex@perex.cz Signed-off-by: Mark Brown commit bc834e074e36262d62a9e26742ed5a5246a469eb Author: Jules Irenge Date: Sat Apr 11 01:19:31 2020 +0100 scsi: bnx2fc: Add missing annotation for bnx2fc_abts_cleanup() Sparse reports the following warning: warning: context imbalance in bnx2fc_abts_cleanup() - unexpected unlock The root cause is the missing annotation at bnx2fc_abts_cleanup(). Add the missing __must_hold(&tgt->tgt_lock) annotation. Link: https://lore.kernel.org/r/20200411001933.10072-8-jbi.octave@gmail.com Signed-off-by: Jules Irenge Signed-off-by: Martin K. Petersen commit 7c67f54661fcc8d141fb11abbab1739f32e13b03 Author: Paolo Bonzini Date: Thu Apr 23 10:52:48 2020 -0400 KVM: SVM: do not allow VMRUN inside SMM VMRUN is not supported inside the SMM handler and the behavior is undefined. Just raise a #UD. Signed-off-by: Paolo Bonzini commit acd05785e48c01edb2c4f4d014d28478b5f19fb5 Author: David Matlack Date: Fri Apr 17 15:14:46 2020 -0700 kvm: add capability for halt polling KVM_CAP_HALT_POLL is a per-VM capability that lets userspace control the halt-polling time, allowing halt-polling to be tuned or disabled on particular VMs. With dynamic halt-polling, a VM's VCPUs can poll from anywhere from [0, halt_poll_ns] on each halt. KVM_CAP_HALT_POLL sets the upper limit on the poll time. Signed-off-by: David Matlack Signed-off-by: Jon Cargille Reviewed-by: Jim Mattson Message-Id: <20200417221446.108733-1-jcargill@google.com> Signed-off-by: Paolo Bonzini commit 87796555d48ca1cc681515e065b824ecab9c4282 Author: Sean Christopherson Date: Wed Apr 22 17:11:27 2020 -0700 KVM: nVMX: Store vmcs.EXIT_QUALIFICATION as an unsigned long, not u32 Use an unsigned long for 'exit_qual' in nested_vmx_reflect_vmexit(), the EXIT_QUALIFICATION field is naturally sized, not a 32-bit field. The bug is most easily observed by doing VMXON (or any VMX instruction) in L2 with a negative displacement, in which case dropping the upper bits on nested VM-Exit results in L1 calculating the wrong virtual address for the memory operand, e.g. "vmxon -0x8(%rbp)" yields: Unhandled cpu exception 14 #PF at ip 0000000000400553 rbp=0000000000537000 cr2=0000000100536ff8 Fixes: fbdd50250396d ("KVM: nVMX: Move VM-Fail check out of nested_vmx_exit_reflected()") Signed-off-by: Sean Christopherson Message-Id: <20200423001127.13490-1-sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit d1ec20a55f6c8ce485fd298a015ec83d7e5326d8 Author: Alex Dewar Date: Fri Apr 3 17:47:11 2020 +0100 scsi: aic7xxx: Remove unnecessary NULL checks before kfree There are a number of places in the aic7xxx driver where a NULL check is performed before a kfree(). However, kfree() already performs NULL checks so this is unnecessary. Remove the checks. Issue identified with Coccinelle. Link: https://lore.kernel.org/r/20200403164712.49579-1-alex.dewar@gmx.co.uk Signed-off-by: Alex Dewar Signed-off-by: Martin K. Petersen commit 9cd7d494bd2b1fb53884a797b460b4f1741b82cc Author: Alex Dewar Date: Fri Apr 3 17:36:10 2020 +0100 scsi: aic7xxx: Use kzalloc() instead of kmalloc()+memset() There are a couple of places where kzalloc() could be used directly instead of calling kmalloc() then memset(). Replace them. Link: https://lore.kernel.org/r/20200403163611.46756-1-alex.dewar@gmx.co.uk Signed-off-by: Alex Dewar Signed-off-by: Martin K. Petersen commit d8f0b35331c4423e033f81f10eb5e0c7e4e1dcec Author: Thomas Gleixner Date: Tue Apr 21 11:20:29 2020 +0200 x86/cpu: Uninline CR4 accessors cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. The various CR4 accessors require cpu_tlbstate as the CR4 shadow cache is located there. In preparation for unexporting cpu_tlbstate, create a builtin function for manipulating CR4 and rework the various helpers to use it. No functional change. [ bp: push the export of native_write_cr4() only when CONFIG_LKTDM=m to the last patch in the series. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200421092558.939985695@linutronix.de commit f8e25f97407c2bcfaf54704938a5e5120e190002 Author: Xu Wang Date: Thu Apr 2 19:08:32 2020 +0800 scsi: cxgb4i: Remove superfluous null check In do_abort_rpl_rss, the null check of 'clk' is not needed. Link: https://lore.kernel.org/r/20200402110832.12712-1-vulab@iscas.ac.cn Signed-off-by: Xu Wang Signed-off-by: Martin K. Petersen commit c213db614685e8dc9f910bca5cf934816ba423fe Author: Jiaxun Yang Date: Wed Apr 22 22:45:34 2020 +0800 MIPS: Clear XContext at boot time XContext might be dirty at boot time. We need to clear it to ensure early stackframe is safe. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit d82d500f5118f9d07477d597fe75c3bd73b44c8e Author: Liangliang Huang Date: Thu Apr 23 19:44:21 2020 -0400 MIPS: arch_send_call_function_single_ipi() calling conventions change Use mp_ops->send_ipi_single() instead of mp_ops->send_ipi_mask() in arch_send_call_function_single_ipi(). send_ipi_single() can send IPI signal to a special cpu more efficiently. Signed-off-by: Liangliang Huang Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 1ebf7aaf3ac01952c49a303d7ded0dc3a19d3cbb Author: Chris Wilson Date: Wed Apr 22 01:17:01 2020 +0100 drm/i915/gt: Prefer soft-rc6 over RPS DOWN_TIMEOUT The RPS DOWN_TIMEOUT interrupt is signaled after a period of rc6, and upon receipt of that interrupt we reprogram the GPU clocks down to the next idle notch [to help convserve power during rc6]. However, on execlists, we benefit from soft-rc6 immediately parking the GPU and setting idle frequencies upon idling [within a jiffie], and here the interrupt prevents us from restarting from our last frequency. In the process, we can simply opt for a static pm_events mask and rely on the enable/disable interrupts to flush the worker on parking. This will reduce the amount of oscillation observed during steady workloads with microsleeps, as each time the rc6 timeout occurs we immediately follow with a waitboost for a dropped frame. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200422001703.1697-1-chris@chris-wilson.co.uk commit f83e4f9896eff614d0f2547a561fa5f39f9cddde Author: Huacai Chen Date: Fri Apr 24 18:56:46 2020 +0800 MIPS: Loongson-3: Add some unaligned instructions emulation 1, Add unaligned gslq, gssq, gslqc1, gssqc1 emulation; 2, Add unaligned gsl{h, w, d}x, gss{h, w, d}x emulation; 3, Add unaligned gslwxc1, gsswxc1, gsldxc1, gssdxc1 emulation. Signed-off-by: Huacai Chen Signed-off-by: Pei Huang Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit d339cd02b888eb8c4508fd772120782eac59a9fa Author: Huacai Chen Date: Fri Apr 24 18:56:45 2020 +0800 MIPS: Move unaligned load/store helpers to inst.h Move unaligned load/store helpers from unaligned.c to inst.h, then other parts of the kernel can use these helpers. Use __ASSEMBLY__ to guard the definition of "LONG" in asm.h to avoid build error on IPxx platforms. Signed-off-by: Huacai Chen Signed-off-by: Pei Huang Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit c05b5940d94019383dadb77ba614248d5a2323e1 Author: Huacai Chen Date: Fri Apr 24 18:56:44 2020 +0800 MIPS: Fix the declaration conflict of mm_isBranchInstr() mm_isBranchInstr() is declared both in branch.h and in fpu_emulator.h but the two declarations are conflict. If both of them are included by a same file, they will cause a build error: ./arch/mips/include/asm/branch.h:33:19: error: static declaration of 'mm_isBranchInstr' follows non-static declaration static inline int mm_isBranchInstr(struct pt_regs *regs, ^ ./arch/mips/include/asm/fpu_emulator.h:177:5: note: previous declaration of 'mm_isBranchInstr' was here int mm_isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn, Fix this error by removing both isBranchInstr() and mm_isBranchInstr() in fpu_emulator.h, and declaring both of them in branch.h. Signed-off-by: Huacai Chen Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit cbb01c2f2f630f1497f703c51ff21538ae2d86b8 Author: Arun Easi Date: Tue Mar 31 03:40:13 2020 -0700 scsi: qla2xxx: Fix MPI failure AEN (8200) handling Today, upon an MPI failure AEN, on top of collecting an MPI dump, a regular firmware dump is also taken and then chip reset. This is disruptive to IOs and not required. Make the firmware dump collection, followed by chip reset, optional (not done by default). Firmware dump buffer and MPI dump buffer are independent of each other with this change and each can have dump that was taken at two different times for two different issues. The MPI dump is saved in a separate buffer and is retrieved differently from firmware dump. To collect full dump on MPI failure AEN, a module parameter is introduced: ql2xfulldump_on_mpifail (default: 0) Link: https://lore.kernel.org/r/20200331104015.24868-2-njavali@marvell.com Reported-by: kbuild test robot Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit d971d42f0655fe448e34bcdbbe27ae2346301380 Author: Colin Ian King Date: Fri Apr 24 12:12:26 2020 +0100 amdgpu/dc: remove redundant assignment to variable 'option' The variable option is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit abb17b1edf7bd1eacb78b6862039e965cb442947 Author: Colin Ian King Date: Fri Apr 24 13:56:40 2020 +0100 drm/amdgpu/gmc: Use consistent variable on unlocks Currently the error returns paths are unlocking lock kiq->ring_lock however it seems this should be dev->gfx.kiq.ring_lock as this is the lock that is being locked and unlocked around the ring operations. This looks like a bug, but it's not. The kiq is just a local variable pointing to the same structure. Make it consistent. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit a96f661a471596f3f2945b335e8eac849e9b8a15 Author: Colin Ian King Date: Thu Apr 23 15:17:28 2020 +0100 drm/amd/display: remove redundant assignment to variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 04e4e2e9558326316cf3e32d46cca83cc3861ef0 Author: Yintian Tao Date: Thu Apr 23 12:05:54 2020 +0800 drm/amdgpu: protect ring overrun Wait for the oldest sequence on the ring to be signaled in order to make sure there will be no command overrun. v2: fix coding stype and remove abs operation v3: remove the initialization of variable r Signed-off-by: Yintian Tao Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 312a79b6eafe5c45e3e232506a4a6e97d7cdbba4 Author: Monk Liu Date: Tue Apr 21 18:04:50 2020 +0800 drm/amdgpu: extent threshold of waiting FLR_COMPLETE to 5s to satisfy WHOLE GPU reset which need 3+ seconds to finish Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit 79bebabb88cb8ef32fb55023f351e1a26ccb4e20 Author: Monk Liu Date: Wed Apr 22 12:09:16 2020 +0800 drm/amdgpu: for nv12 always need smu ip because nv12 SRIOV support one vf mode Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit 8efd72759e9ee9c6a5e841d1fdb27cd60d8b2ed2 Author: Monk Liu Date: Wed Apr 22 12:19:13 2020 +0800 drm/amdgpu: skip sysfs node not belong to one vf mode Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit 38748ad88a2f9673bb63dda607204bb3a9bc21a0 Author: Monk Liu Date: Wed Apr 22 19:28:48 2020 +0800 drm/amdgpu: enable one vf mode for nv12 Signed-off-by: Monk Liu Signed-off-by: Alex Deucher commit b217e6f579d675f90361f1bbafba769601f0bc61 Author: Monk Liu Date: Thu Apr 23 14:57:40 2020 +0800 drm/amdgpu: clear the messed up checking logic for ARCTURUS+ ASICS, we always support SW_SMU for bare-metal and for SRIOV one_vf_mode Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit c2ce6aebf09227160364e67f40d8c303875d6039 Author: Monk Liu Date: Wed Apr 22 19:27:44 2020 +0800 drm/amdgpu: provide RREG32_SOC15_NO_KIQ, will be used later Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit c983361a724999fcf6a209b485188a9ee93a5e38 Author: Monk Liu Date: Wed Apr 22 12:15:23 2020 +0800 drm/amdgpu: sriov is forbidden to call disable DPM Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit 2f5a0a91191a5a86d81f17dd86b89dcf18e2a987 Author: Monk Liu Date: Thu Apr 23 11:09:23 2020 +0800 drm/amdgpu: skip cg/pg set for SRIOV Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit 1a0f3667d876be86f31e5bdd3127064390aa9783 Author: Monk Liu Date: Wed Apr 22 11:42:37 2020 +0800 drm/amdgpu: ignore TA ucode for SRIOV Signed-off-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit 28d65729b050977d8a9125e6726871e83bd22124 Author: Salman Qazi Date: Fri Apr 24 08:03:21 2020 -0700 block: Limit number of items taken from the I/O scheduler in one go Flushes bypass the I/O scheduler and get added to hctx->dispatch in blk_mq_sched_bypass_insert. This can happen while a kworker is running hctx->run_work work item and is past the point in blk_mq_sched_dispatch_requests where hctx->dispatch is checked. The blk_mq_do_dispatch_sched call is not guaranteed to end in bounded time, because the I/O scheduler can feed an arbitrary number of commands. Since we have only one hctx->run_work, the commands waiting in hctx->dispatch will wait an arbitrary length of time for run_work to be rerun. A similar phenomenon exists with dispatches from the software queue. The solution is to poll hctx->dispatch in blk_mq_do_dispatch_sched and blk_mq_do_dispatch_ctx and return from the run_work handler and let it rerun. Signed-off-by: Salman Qazi Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 895d47759bdc4a8452e36ad3f7bc4324c9251932 Author: Christoph Hellwig Date: Fri Apr 24 12:56:34 2020 +0200 block: unexport bdev_read_page and bdev_write_page Each one just has two callers, both in always built-in code. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7db8736db0814dacda4d42f108f8ab366961ecdf Author: Ville Syrjälä Date: Mon Apr 20 23:06:10 2020 +0300 drm/i915: Split some long lines Split some overly long lines. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200420200610.31798-4-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 8fdda3854967d003f743059bb64ace8154266381 Author: Ville Syrjälä Date: Mon Apr 20 23:06:09 2020 +0300 drm/i915: Introduce .set_idle_link_train() vfunc Relocate a bunch of DDI specific code from intel_dp.c to intel_ddi.c by introducing a .set_idle_link_train() vfunc. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200420200610.31798-3-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit fb83f72c48a52201431945d31843a964b927a8e3 Author: Ville Syrjälä Date: Mon Apr 20 23:06:08 2020 +0300 drm/i915: Introduce .set_signal_levels() vfunc Sort out some of the mess between intel_ddi.c intel_dp.c by introducing a .set_signal_levels() vfunc. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200420200610.31798-2-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit eee3f91195ad8a096048fb5869e7299fd1e3ea5f Author: Ville Syrjälä Date: Mon Apr 20 23:06:07 2020 +0300 drm/i915: Introduce .set_link_train() vfunc Sort out some of the mess between intel_ddi.c intel_dp.c by introducing a .set_link_train() vfunc. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200420200610.31798-1-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit d7ff281c6d27d6a5329a426e5782d31f44073538 Author: Ville Syrjälä Date: Wed Apr 22 19:19:17 2020 +0300 drm/i915: Have pfit calculations return an error code Change intel_{gmch,pch}_panel_fitting() to return a normal error vs. success int. We'll need this later to validate that the margin properties aren't misconfigured. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200422161917.17389-6-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 4cecc7c0cc2b5d6e5d8350f77d210d189a25dfb8 Author: Ville Syrjälä Date: Wed Apr 22 19:19:16 2020 +0300 drm/i915: Pass connector state to pfit calculations Pass the entire connector state to intel_{gmch,pch}_panel_fitting(). For now we just need to get at .scaling_mode but in the future we'll want access to the margin properties as well. v2: Deal with intel_dp_ycbcr420_config() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200422161917.17389-5-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit f650af72e5ba499755eaa729eb9f1bc802ecf2f6 Author: Ville Syrjälä Date: Wed Apr 22 19:19:15 2020 +0300 drm/i915: s/pipe_config/crtc_state/ in pfit functions Follow the new naming convention and call the crtc state "crtc_state", and while at it drop the redundant crtc argument. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200422161917.17389-4-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 35dd95b4ee19787d4dd321ea88dd72c9b87d9425 Author: Ville Syrjälä Date: Wed Apr 22 19:19:14 2020 +0300 drm/i915: Use drm_rect to store the pfit window pos/size Make things a bit more abstract by replacing the pch_pfit.pos/size raw register values with a drm_rect. Makes it slighly more convenient to eg. compute the scaling factors. v2: Use drm_rect_init() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200422161917.17389-3-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit eac9c58539aa2db9e1173964025760fdea905656 Author: Ville Syrjälä Date: Wed Apr 22 19:19:13 2020 +0300 drm/i915: Flatten a bunch of the pfit functions Most of the pfit functions are of the form: func() { if (pfit_enabled) { ... } } Flip the pfit_enabled check around to flatten the functions. And while we're touching all this let's do the usual s/pipe_config/crtc_state/ replacement. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200422161917.17389-2-ville.syrjala@linux.intel.com commit c5a01ec7579a264ad332be8fa89f446efa2aaa58 Author: Ville Syrjälä Date: Wed Apr 22 19:19:12 2020 +0300 drm/i915: Fix skl+ non-scaled pfit modes Fix skl_update_scaler_crtc() to deal with different scaling modes correctly. The current implementation assumes DRM_MODE_SCALE_FULLSCREEN. Fortunately we don't expose any border properties currently so the code does actually end up doing the right thing (assigning a scaler for pfit). The code does need to be fixed before any borders are exposed. Also we have redundant calls to skl_update_scaler_crtc() in dp/hdmi .compute_config() which can be nuked. They were anyway called before we had even computed the pfit state so were basically nonsense. The real call we need to keep is in intel_crtc_atomic_check(). v2: Deal witrh skl_update_scaler_crtc() in intel_dp_ycbcr420_config() Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200422161917.17389-1-ville.syrjala@linux.intel.com commit 8c5cc19e94703182647dfccc164e4437a04539c8 Author: Thomas Gleixner Date: Tue Apr 21 11:20:28 2020 +0200 x86/tlb: Uninline __get_current_cr3_fast() cpu_tlbstate is exported because various TLB-related functions need access to it, but cpu_tlbstate is sensitive information which should only be accessed by well-contained kernel functions and not be directly exposed to modules. In preparation for unexporting cpu_tlbstate move __get_current_cr3_fast() into the x86 TLB management code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra (Intel) Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200421092558.848064318@linutronix.de commit cbc636557d2d20c4fb808c14df545b3c407a53d6 Author: Gil Adam Date: Sat Apr 18 11:08:57 2020 +0300 iwlwifi: debug: set NPK buffer in context info When buffer destination for ini debug is configured to NPK (TB22DTF) set the appropriate bit in the context info struct. Signed-off-by: Gil Adam Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.3c9f0fa6033f.Id1d6c191f85efe0d6cf35434bfb186ffd46ff64c@changeid commit 62bee4862bfa03c4d4ec9205111be99210923f49 Author: Luca Coelho Date: Sat Apr 18 11:08:56 2020 +0300 iwlwifi: pcie: add new structs for So devices with long latency Some So devices have a longer wake latency. To support this properly, add new cfg structs for them so the driver will inform the FW about the need to use another xtal and use a higher wait value during state transitions. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.daf515618f57.I80e60006b108e1586e3c56669635c670597fe08d@changeid commit 9c9613f0ee07b8da049914d92fc735a0e954d777 Author: Luca Coelho Date: Sat Apr 18 11:08:55 2020 +0300 iwlwifi: pcie: add new structure for Qu devices with medium latency Some Qu devices require an intermediate amount of time to wake up and for LTR notifications, so add a new structure with the correct values for them and change the corresponding devices to use it. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.d6df2bcee78f.Ie008b0c8f03340a466c1ef981bfd25359c9de90d@changeid commit 0928df0a868c010c1dfb5269a23ffa2f9adc876b Author: Johannes Berg Date: Sat Apr 18 11:08:54 2020 +0300 iwlwifi: mvm: tell firmware about required LTR delay Some (integrated) devices need a longer LTR delay than the firmware would typically apply, tell it about that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.24276ae2ad61.I8831a538f75893d5cee47b4a81f4b9b7fd0e8bea@changeid commit 2d39683e739940b852e579b8d5005c25a8912c0a Author: Ihab Zhaika Date: Sat Apr 18 11:08:53 2020 +0300 iwlwifi: update few product names in AX family update the product names of few structs in AX family. Signed-off-by: Ihab Zhaika Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.738dabad8732.I5673eaf8a016b8aa27ab8bab02121108fa723783@changeid commit 4ee27edd389174b3e1a9c84a1b3a678d9e9f0934 Author: Luca Coelho Date: Sat Apr 18 11:08:52 2020 +0300 iwlwifi: pcie: add cfgs for SoCs with device ID 0x4FD0 A new device ID needs to be added to the list to support new SoCs. Add it and support all subsystem IDs that other Qu devices support. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.5e5ce668ff8b.I20a9c8b3470aaabaa54361a5641637e5a14d8321@changeid commit e819a80a9764aea789ec6a25d3858d2a5d9ac7bc Author: Ihab Zhaika Date: Sat Apr 18 11:08:51 2020 +0300 iwlwifi: add new cards for AX family add few PCI ID'S for AX family. Signed-off-by: Ihab Zhaika Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.5eae2261b70c.I0369619a562c4e4008e2f0a3afb9ed5d4c9b49d4@changeid commit 28dd7ccdc56fbde66d49a36dc1fce06730586681 Author: Mordechay Goodstein Date: Sat Apr 18 11:08:50 2020 +0300 iwlwifi: acpi: read TAS table from ACPI and send it to the FW Read the Time Averaged SAR (TAS) table from ACPI and if TAS feature is enabled in the FW send the black list countries which TAS is disabled in to the FW Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.40a327d32cfd.I7203f3afc8186cca34c48a1a116baac1df5eff4e@changeid commit 9efab1ad3ffb5b5ecbe24ea5ace420a9b7466338 Author: Emmanuel Grumbach Date: Sat Apr 18 11:08:49 2020 +0300 iwlwifi: remove fw_monitor module parameter This module parameter is no longer useful now that other debug infrastructure was added to iwlwifi. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.03bd49c3432b.Ie62047d3b364b19c8c3584ea37790220466f2a8d@changeid commit 9dede812455041eef3fa308af015825ce9c701d0 Author: Luca Coelho Date: Sat Apr 18 11:08:48 2020 +0300 iwlwifi: remove deprecated and unused iwl_mvm_keyinfo struct This struct hasn't been used in years and is just a remnant of an API support removal that missed this structured. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.93860da2d12a.Ifeca3b3313e3f14330317bc3e3d62f7d991ec955@changeid commit c4ace42659b572c597e37a91902036378fe0f973 Author: Gil Adam Date: Sat Apr 18 11:08:47 2020 +0300 iwlwifi: mvm: add framework for specific phy configuration Add framework for supporting specific PHY filter configuration, which allows for application of various FW defined PHY filters (one per antenna). Change phy_cfg_cmd to the new API (ver3). Reading of configuration from platform's ACPI tables to be added later when tables are defined. Signed-off-by: Gil Adam Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.242a8f979592.I13c77a8a8dbf1a169b5052c7af1f8401ff3991ad@changeid commit 63417549fc8ea5d84cf7172e72a7452938755874 Author: Johannes Berg Date: Sat Apr 18 11:08:46 2020 +0300 iwlwifi: pcie: move iwl_pcie_ctxt_info_alloc_dma() to user There's no need for this to be an inline in the header file, only the context-info.c file ever uses it. Move it there. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200418110539.818a06457888.Ib4f55280cd14d7edab37f2992b381c9b6ca4cd7a@changeid commit f05f8edd90f1f637b60c4ed07a4f387052c84cbb Author: Shahar S Matityahu Date: Fri Apr 17 13:21:42 2020 +0300 iwlwifi: yoyo: support IWL_FW_INI_TIME_POINT_HOST_ALIVE_TIMEOUT time point Allow the driver to perform dump collection in case of alive notification timeout in yoyo mode. Signed-off-by: Shahar S Matityahu Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.bd46e6240590.Ibda6d9d330a1ae49670152cede34629b280f6cf9@changeid commit a548c69d2e0f010cd7b77404f94660a6c789abc8 Author: Johannes Berg Date: Fri Apr 17 13:21:41 2020 +0300 iwlwifi: mvm: add DCM flag to rate pretty-print It's useful to know if DCM was enabled, add this flag to the rate pretty-printer. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.891bb9741eca.Ia66448f7e00be9e4c9ea7147b90d4fcd5f1d3845@changeid commit 161158d7af3f67b15ee681c2b26b99ba461da9a6 Author: Johannes Berg Date: Fri Apr 17 13:21:40 2020 +0300 iwlwifi: pcie: gen2: minor code cleanups in byte table update One line should be indented less, otherwise it looks like it belongs into the parentheses, which clearly it doesn't; also some variables can move into their respective if branches. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.a4858aa0441b.I0e70e4a5493fe6b8db6390f9349ff0e7888ab240@changeid commit 95a9e44f8fb2626e4d0cb642ae6b5f6f30c5fb58 Author: Johannes Berg Date: Fri Apr 17 13:21:39 2020 +0300 iwlwifi: pcie: add n_window/ampdu to tx_queue debugfs Add the n_window and ampdu parameters so we can see them. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.a2cc1f36008f.Iea23802bb64a08de410223e9af4431dfcadf121b@changeid commit df67a1bea0378488a0454f2be2609349fda86727 Author: Johannes Berg Date: Fri Apr 17 13:21:38 2020 +0300 iwlwifi: pcie: use seq_file for tx_queue debugfs file On newer hardware, the tx_queue debugfs file would need to allocate 37.5kib data since there are 512 queues, which is too much. Rather than resorting to kludges like kvmalloc(), use the seq_file API to print out the data. While at it, also fix a NULL pointer dereference here, the txq pointer from trans_pcie->txqs[] may be NULL if that queue hasn't been allocated. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.491cf8224c49.I7f154d81e5becef3b5ff22d7c6e36170bde0d7d5@changeid commit 250380c9b8e5a1d893a8012a33667343dc75e17e Author: Mordechay Goodstein Date: Fri Apr 17 13:21:37 2020 +0300 iwlwifi: support version 9 of WOWLAN_GET_STATUS notification Add support for the new WOWLAN_GET_STATUS notification that contains a new element that informs the driver of TIDs whose BA sessions were closed during suspend. Note that the new functionality of handling these closed sessions is not implemented in this patch it. It only aligns to the new API version. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.b02153b94c1d.Ieb6291586d60f372d5a505604b18227ef97e7202@changeid commit 7a99c877ae8e2f1b4bd9811addd337900d24b3ae Author: Shahar S Matityahu Date: Fri Apr 17 13:21:36 2020 +0300 iwlwifi: dbg: support multiple dumps in legacy dump flow Support multiple debug data collection triggers in legacy flow. Utilize the already existing Yoyo infra so the change is rather simple. Signed-off-by: Shahar S Matityahu Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.5be6a1923cbe.I10701236b03f66328041f2a38f5f0f22a26fd40b@changeid commit 4af119509a4807ac450634c73d38757aaf0b3f98 Author: Mordechay Goodstein Date: Tue Apr 21 13:33:47 2020 +0300 iwlwifi: move API version lookup to common code The API version lookup is parsed from a TLV and should be in shared code make make it reusable across all opmodes. Also change the function names from mvm to fw, since this is not mvm-specific anymore. Additionally, since this function is not just a single line of code, it shouldn't be inline. Convert them to actual functions. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200421133326.cf94672dfcdb.I5ede9cc25ee8de7b8d2b5c574f917a18971da734@changeid commit c2cf318df87c3745fd0cf76c6a6ec2b85380dbdf Author: Tova Mussai Date: Fri Apr 17 13:21:35 2020 +0300 iwlwifi: nvm: use iwl_nl80211_band_from_channel_idx Use iwl_nl80211_band_from_channel_idx in iwl_parse_nvm_mcc_info Signed-off-by: Tova Mussai Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.a64a018f244e.Ie75ac5bb0f0f524d26944800138855ef2228339a@changeid commit 82f25bd73c0bee4d29df47007a4f7290695b7db7 Author: AceLan Kao Date: Fri Apr 24 20:33:58 2020 +0800 regmap-i2c: add 16-bit width registers support This allows to access data with 16-bit width of registers via i2c SMBus block functions. The multi-command sequence of the reading function is not safe and may read the wrong data from other address if other commands are sent in-between the SMBus commands in the read function. Read performance: 32768 bytes (33 kB, 32 KiB) copied, 11.4869 s, 2.9 kB/s Write performance(with 1-byte page): 32768 bytes (33 kB, 32 KiB) copied, 129.591 s, 0.3 kB/s The implementation is inspired by below commit https://patchwork.ozlabs.org/patch/545292/ v2: add more descriptions about the issue that maybe introduced by this commit Signed-off-by: AceLan Kao Link: https://lore.kernel.org/r/20200424123358.144850-1-acelan.kao@canonical.com Signed-off-by: Mark Brown commit e73f94d1b6f05f6f22434c63de255a9dec6fd23d Author: YueHaibing Date: Fri Apr 24 21:14:37 2020 +0800 batman-adv: remove unused inline function batadv_arp_change_timeout There's no callers in-tree. Signed-off-by: YueHaibing Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit a97bf49f824e357f1cc5d292e247d05271d32afe Author: Lang Cheng Date: Wed Apr 15 16:14:35 2020 +0800 RDMA/hns: Simplify the status judgment code of hns_roce_v1_m_qp() Use status table to reduce cyclomatic complexity. Link: https://lore.kernel.org/r/1586938475-37049-7-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 357f342946860b323d1981cc42370516dbb209d2 Author: Lang Cheng Date: Wed Apr 15 16:14:34 2020 +0800 RDMA/hns: Simplify the state judgment code of qp Use state table to make the qp state migrate code more readable. Link: https://lore.kernel.org/r/1586938475-37049-6-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 7c044adca272768d821921f11d3da4587dcec68a Author: Lang Cheng Date: Wed Apr 15 16:14:33 2020 +0800 RDMA/hns: Simplify the cqe code of poll cq Encapsulate codes to get status of cqe into a function and use map table instead of switch-case to reduce cyclomatic complexity of hns_roce_v2_poll_one(). Link: https://lore.kernel.org/r/1586938475-37049-5-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit a3de9e83810ced41ad7dece44c03f2338e44129d Author: Lang Cheng Date: Wed Apr 15 16:14:32 2020 +0800 RDMA/hns: Simplify the qp state convert code Use type map table to reduce the cyclomatic complexity. Link: https://lore.kernel.org/r/1586938475-37049-4-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 375898e83d26d6da7414f129ed417ad7cef2728f Author: Lijun Ou Date: Wed Apr 15 16:14:31 2020 +0800 RDMA/hns: Optimize hns_roce_v2_set_mac() Removes the unnecessary memset opertaion and adjust style of some lines in hns_roce_v2_set_mac(). Link: https://lore.kernel.org/r/1586938475-37049-3-git-send-email-liweihang@huawei.com Signed-off-by: Lijun Ou Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 9976ea27b526365c4a9a6d3336a8b06f839ec26d Author: Lijun Ou Date: Wed Apr 15 16:14:30 2020 +0800 RDMA/hns: Optimize hns_roce_config_link_table() Remove the unnecessary memset operation and adjust style of some lines in hns_roce_config_link_table(). Link: https://lore.kernel.org/r/1586938475-37049-2-git-send-email-liweihang@huawei.com Signed-off-by: Lijun Ou Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit dc234825997ec6ff05980ca9e2204f4ac3f8d695 Author: Peng Ma Date: Fri Apr 24 14:12:16 2020 +0800 spi: spi-fsl-dspi: Adding shutdown hook We need to ensure dspi controller could be stopped in order for kexec to start the next kernel. So add the shutdown operation support. Signed-off-by: Peng Ma Link: https://lore.kernel.org/r/20200424061216.27445-1-peng.ma@nxp.com Signed-off-by: Mark Brown commit 4eb8320bd1aaa7e69d039f2c251735e3ef0b9a38 Author: Ard Biesheuvel Date: Thu Mar 26 09:34:35 2020 +0100 efi: Move arch_tables check to caller Instead of making match_config_table() test its table_types pointer for NULL-ness, omit the call entirely if no arch_tables pointer was provided to efi_config_parse_tables(). Signed-off-by: Ard Biesheuvel commit 4e9a0f73f030e19a9259b69a7079021048e1f904 Author: Ard Biesheuvel Date: Thu Mar 26 09:24:14 2020 +0100 efi: Clean up config table description arrays Increase legibility by adding whitespace to the efi_config_table_type_t arrays that describe which EFI config tables we look for when going over the firmware provided list. While at it, replace the 'name' char pointer with a char array, which is more space efficient on relocatable 64-bit kernels, as it avoids a 8 byte pointer and the associated relocation data (24 bytes when using RELA format) Signed-off-by: Ard Biesheuvel commit 0a75561489f534cf2e8f6883e0cf8cdf51c534c5 Author: Ard Biesheuvel Date: Thu Apr 16 21:15:23 2020 +0200 efi/libstub/x86: Avoid getter function for efi_is64 We no longer need to take special care when using global variables in the EFI stub, so switch to a simple symbol reference for efi_is64. Signed-off-by: Ard Biesheuvel commit 980771f616624e4c563a2014a32b7d23876d1ecf Author: Ard Biesheuvel Date: Thu Apr 16 18:45:24 2020 +0200 efi/libstub: Drop __pure getters for EFI stub options The practice of using __pure getter functions to access global variables in the EFI stub dates back to the time when we had to carefully prevent GOT entries from being emitted, because we could not rely on the toolchain to do this for us. Today, we use the hidden visibility pragma for all EFI stub source files, which now all live in the same subdirectory, and we apply a sanity check on the objects, so we can get rid of these getter functions and simply refer to global data objects directly. So switch over the remaining boolean variables carrying options set on the kernel command line. Signed-off-by: Ard Biesheuvel commit ccc27ae77494252965aedca68588e7457829cfad Author: Ard Biesheuvel Date: Thu Apr 16 18:38:06 2020 +0200 efi/libstub: Drop __pure getter for efi_system_table The practice of using __pure getter functions to access global variables in the EFI stub dates back to the time when we had to carefully prevent GOT entries from being emitted, because we could not rely on the toolchain to do this for us. Today, we use the hidden visibility pragma for all EFI stub source files, which now all live in the same subdirectory, and we apply a sanity check on the objects, so we can get rid of these getter functions and simply refer to global data objects directly. Start with efi_system_table(), and convert it into a global variable. While at it, make it a pointer-to-const, because we can. Signed-off-by: Ard Biesheuvel commit 544393707f3ca4f185ea1e41cc3206d1526c99cf Author: Arvind Sankar Date: Thu Apr 16 11:12:27 2020 -0400 efi: Kill __efistub_global Now that both arm and x86 are using the linker script to place the EFI stub's global variables in the correct section, remove __efistub_global. Signed-off-by: Arvind Sankar Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200416151227.3360778-4-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 26a92425f9a301fdeb5482e7891915ce43cc0556 Author: Arvind Sankar Date: Thu Apr 16 11:12:26 2020 -0400 efi/x86: Remove __efistub_global and add relocation check Instead of using __efistub_global to force variables into the .data section, leave them in the .bss but pull the EFI stub's .bss section into .data in the linker script for the compressed kernel. Add relocation checking for x86 as well to catch non-PC-relative relocations that require runtime processing, since the EFI stub does not do any runtime relocation processing. This will catch, for example, data relocations created by static initializers of pointers. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200416151227.3360778-3-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 420b6d00ca94ce5b6578b1bc12e767ac7a0251ac Author: Arvind Sankar Date: Thu Apr 16 11:12:25 2020 -0400 efi/arm: Remove __efistub_global annotation Instead of using __efistub_global to force variables into the .data section, leave them in the .bss but pull the EFI stub's .bss section into .data in the linker script for the compressed kernel. Signed-off-by: Arvind Sankar Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20200416151227.3360778-2-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 685d8164b5da3aeb75b0320fd3a3bf75e4f9c51e Author: Ard Biesheuvel Date: Mon Apr 13 14:23:57 2020 +0200 efi/libstub: Move efi_relocate_kernel() into separate source file Move efi_relocate_kernel() into a separate source file, so that it only gets pulled into builds for architectures that use it. Since efi_relocate_kernel() is the only user of efi_low_alloc(), let's move that over as well. Signed-off-by: Ard Biesheuvel commit e71356fe29e7bd5cd5e07800d4940a7481fb0854 Author: Ard Biesheuvel Date: Tue Mar 31 10:59:39 2020 +0200 efi/libstub/arm64: Switch to ordinary page allocator for kernel image It is no longer necessary to locate the kernel as low as possible in physical memory, and so we can switch from efi_low_alloc() [which is a rather nasty concoction on top of GetMemoryMap()] to a new helper called efi_allocate_pages_aligned(), which simply rounds up the size to account for the alignment, and frees the misaligned pages again. So considering that the kernel can live anywhere in the physical address space, as long as its alignment requirements are met, let's switch to efi_allocate_pages_aligned() to allocate the pages. Signed-off-by: Ard Biesheuvel commit 43b1df0e013c25abb536699f46d0e9f291b586a0 Author: Ard Biesheuvel Date: Fri Mar 27 16:09:40 2020 +0100 efi/libstub: Add API function to allocate aligned memory Break out the code to create an aligned page allocation from mem.c and move it into a function efi_allocate_pages_aligned() in alignedmem.c. Update efi_allocate_pages() to invoke it unless the minimum alignment equals the EFI page size (4 KB), in which case the ordinary page allocator is sufficient. This way, efi_allocate_pages_aligned() will only be pulled into the build if it is actually being used (which will be on arm64 only in the immediate future) Signed-off-by: Ard Biesheuvel commit 50de2e9ebbc08e1ca27f9b3f0471d92abaaf834a Author: Qiang Yu Date: Tue Apr 21 21:35:51 2020 +0800 drm/lima: enable runtime pm Enable runtime pm by default so GPU suspend when idle for 200ms. This value can be changed by autosuspend_delay_ms in device's power sysfs dir. On Allwinner H3 lima_device_resume takes ~40us and lima_device_suspend takes ~20us. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-11-yuq825@gmail.com commit 63945d51490f16aede6d635e785faf56521e5e4a Author: Qiang Yu Date: Tue Apr 21 21:35:50 2020 +0800 drm/lima: add pm resume/suspend ops Add driver pm system and runtime hardware resume/suspend ops. Note this won't enable runtime pm of the device yet. v2: Do clock and power gating when suspend/resume. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-10-yuq825@gmail.com commit 7a475eb470ac482306c9281b2faadf2cbfb6b84c Author: Qiang Yu Date: Tue Apr 21 21:35:49 2020 +0800 drm/lima: separate clk/regulator enable/disable function For being used by both device init/fini and suspend/resume. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-9-yuq825@gmail.com commit 3446d7e9883d70882568b0f7b6549835d51a8bc7 Author: Qiang Yu Date: Tue Apr 21 21:35:48 2020 +0800 drm/lima: add resume/suspend callback for each ip For called when PM do resume/suspend. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-8-yuq825@gmail.com commit 9f5072a191a141dcc919125986ea22bf05d598a7 Author: Qiang Yu Date: Tue Apr 21 21:35:47 2020 +0800 drm/lima: power down ip blocks when pmu exit Prepare resume/suspend PM. v2: Fix lima_pmu_wait_cmd timeout when mali400 case. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-7-yuq825@gmail.com commit 4836cf044d74eb70bb28d3460d8c82e4aaf56d65 Author: Qiang Yu Date: Tue Apr 21 21:35:46 2020 +0800 drm/lima: add lima_devfreq_resume/suspend Used for device resume/suspend in the following commits. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-6-yuq825@gmail.com commit 4eb70cd3f284e200c9e526bdd60ed720d5ab9e5c Author: Qiang Yu Date: Tue Apr 21 21:35:45 2020 +0800 drm/lima: always set page directory when switch vm We need to flush TLB anyway before every task start, and the page directory will be set to empty vm after suspend/resume, so always set it to the task vm even no ctx switch happens. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-5-yuq825@gmail.com commit 24943269e51bb6fd2810e71597b675878369e06b Author: Qiang Yu Date: Tue Apr 21 21:35:44 2020 +0800 drm/lima: check vm != NULL in lima_vm_put No need to handle this check before calling lima_vm_put. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-4-yuq825@gmail.com commit d04f2a8e5b190c277663865311ecd6a393abf3b9 Author: Qiang Yu Date: Tue Apr 21 21:35:43 2020 +0800 drm/lima: print process name and pid when task error When error task list is full, print the process info where the error task come from for debug usage. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-3-yuq825@gmail.com commit 4eda21d61904f75cda7635b3c225b7141c2ef20c Author: Qiang Yu Date: Tue Apr 21 21:35:42 2020 +0800 drm/lima: use module_platform_driver helper Simplify module init/exit with module_platform_driver. Tested-by: Bhushan Shah Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-2-yuq825@gmail.com commit 2ce216edf2c661fd9d2f5e19ce72fd80c25abc64 Author: Robin Murphy Date: Tue Apr 21 23:51:37 2020 +0100 drm/lima: Clean up redundant pdev pointer There's no point explicitly tracking the platform device when it can be trivially derived from the regular device pointer in the couple of places it's ever used. Signed-off-by: Robin Murphy Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/8d9073cc91c10fc70910587fd1794e0e8f32b467.1587509150.git.robin.murphy@arm.com commit 21d81f888299715ce6e1f0a04506aeb7c6012660 Author: Robin Murphy Date: Tue Apr 21 23:51:36 2020 +0100 drm/lima: Clean up IRQ warnings Use the optional form of platform_get_irq() for blocks that legitimately may not be present, to avoid getting an annoying barrage of spurious warnings for non-existent PPs on configurations like Mali-450 MP2. Signed-off-by: Robin Murphy Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/de475904091400ef6c123285f221094654d96d35.1587509150.git.robin.murphy@arm.com commit 3e645a4add53eec22f3818c9da01c19191525096 Author: Rong Chen Date: Fri Apr 24 08:54:37 2020 +0800 ASoC: soc-compress: avoid false-positive Wuninitialized warning gcc-6.5 and earlier show a new warning: sound/soc/soc-compress.c: In function ‘soc_compr_open’: sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized] struct snd_soc_component *component, *save = NULL; ^~~~~~~~~ Simplest fix is to initialize it to avoid the warning. Reported-by: kbuild test robot Signed-off-by: Rong Chen Acked-by: Kuninori Morimoto Cc: Kuninori Morimoto Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com Link: https://lore.kernel.org/r/20200424005437.3941-1-rong.a.chen@intel.com Signed-off-by: Mark Brown commit 4a65ed6562bcfa58fe0c2ca5855c45268f40d365 Merge: b5f7311d3a2e 2f72d35ea75e Author: Andy Shevchenko Date: Fri Apr 24 13:56:46 2020 +0300 Merge branch 'ib-mfd-x86-usb-watchdog-v5.7' Merge branch 'ib-mfd-x86-usb-watchdog-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git to avoid conflicts in PDx86. Signed-off-by: Andy Shevchenko commit b6b5c42e3bab939d357d800fd313e3c995164065 Author: Johannes Berg Date: Fri Apr 24 12:39:46 2020 +0200 mac80211: fix two missing documentation entries Add documentation for two struct entries that was missing. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200424123945.6b23a26ab5e7.I664440ab5f33442df8103253bf5b9fe84be8d58c@changeid Signed-off-by: Johannes Berg commit be689f68d040702a3521035d267949d3927971f0 Author: Johannes Berg Date: Fri Apr 24 12:01:04 2020 +0200 cfg80211: reject channels/chandefs with KHz offset >= 1000 This should be covered by the next MHz, make sure that the numbers are always normalized. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200424120103.12b91ecf75f9.I4bf499d58404283bbfacb517d614a816763bccf2@changeid Signed-off-by: Johannes Berg commit 3b23c184f72acddad39c40373f165e1a9e384758 Author: Thomas Pedersen Date: Wed Apr 1 18:18:05 2020 -0700 mac80211: add freq_offset to RX status RX status needs a KHz component, so add freq_offset. We can reduce the bits for the frequency since 60 GHz isn't supported. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200402011810.22947-5-thomas@adapt-ip.com [fix commit message] Signed-off-by: Johannes Berg commit b6011960f392d1de619f10aa5d088c27f1e7526c Author: Thomas Pedersen Date: Wed Apr 1 18:18:04 2020 -0700 mac80211: handle channel frequency offset cfg80211_chan_def and ieee80211_channel recently gained a frequency offset component. Handle this where it makes sense (potentially required by S1G channels). For IBSS, TDLS, CSA, and ROC we return -EOPNOTSUPP if a channel with frequency offset is passed, since they may or may not work. Once someone tests and verifies these commands work on thos types of channels, we can remove that error. join_ocb and join_mesh look harmless because they use a simple ieee80211_vif_use_channel(), which is using an already verified channel, so we let those through. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200402011810.22947-4-thomas@adapt-ip.com Signed-off-by: Johannes Berg commit 934f4c7dd3a544bb8000f7436f1f0e12e04ebc37 Author: Thomas Pedersen Date: Wed Apr 1 18:18:03 2020 -0700 cfg80211: express channels with a KHz component Some bands (S1G) define channels centered on a non-integer MHz. Give ieee80211_channel and cfg80211_chan_def a freq_offset component where the final frequency can be expressed as: MHZ_TO_KHZ(chan->center_freq) + chan->freq_offset; Also provide some helper functions to do the frequency conversion and test for equality. Retain the existing interface to frequency and channel conversion helpers, and expose new ones which handle frequencies in units of KHz. Some internal functions (net/wireless/chan.c) pass around a frequency value. Convert these to units of KHz. mesh, ibss, wext, etc. are currently ignored. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200402011810.22947-3-thomas@adapt-ip.com Signed-off-by: Johannes Berg commit b572510100165ba037ba43dbbb0f05e8da12c741 Author: Thomas Pedersen Date: Wed Apr 1 18:18:02 2020 -0700 ieee80211: share 802.11 unit conversion helpers MHZ_TO_KHZ, and KHZ_TO_MHZ are useful to drivers and elsewhere so export these in the common ieee80211 header. Move the power helpers also because we might as well. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200402011810.22947-2-thomas@adapt-ip.com Signed-off-by: Johannes Berg commit bdee75d2ac23a1db30d3c689665a584c20220f97 Author: Johannes Berg Date: Thu Mar 26 15:09:41 2020 +0200 mac80211_hwsim: indicate in IBSS that we have transmitted beacons This is actually true because there's no functional beacon distribution and lets us get active scanning working - without it, mac80211 doesn't respond to probe requests. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.554d1199b309.Id86fd36e3d88d2a75d6e0c6618fd93ce8fe84065@changeid Signed-off-by: Johannes Berg commit dba25b04c61170cf8592f87df2bb086201047473 Author: Johannes Berg Date: Thu Mar 26 15:09:40 2020 +0200 mac80211: minstrel_ht_assign_best_tp_rates: remove redundant test We know this pointer isn't NULL and in fact dereferenced it before, remove the redundant test. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.adf551928846.Iae9015573d6c350cc1b12a311d6d13d086beec6c@changeid Signed-off-by: Johannes Berg commit 302ff8b7a2b01cfb7645f112bb259af1c146c57a Author: Ilan Peer Date: Thu Mar 26 15:09:39 2020 +0200 mac80211: Fail association when AP has no legacy rates The MLME logic had a workaround that allowed to continue an association with an AP even if the AP did not provide any basic rates in its supported rates in the association response, assuming that the first (non basic) legacy rate could be used as a basic rate. However, this did not consider the case where the AP (which is obviously buggy) did not provide any legacy rate. Fix this by failing the association, as this can result in an unexpected failure in the low level driver and FW, e.g., in rate scale logic etc. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.d70a1450d83f.I6e6ce5efda351a8544c0e7bfeee260fe3360d401@changeid Signed-off-by: Johannes Berg commit 0c197f16f7bc5ddb43073690a80fb15998ad61e4 Author: Mordechay Goodstein Date: Thu Mar 26 15:09:38 2020 +0200 mac80211: agg-tx: add an option to defer ADDBA transmit Driver tells mac80211 to sends ADDBA with SSN (starting sequence number) from the head of the queue, while the transmission of all the frames in the queue may take a while, which causes the peer to time out. In order to fix this scenario, add an option to defer ADDBA transmit until queue is drained. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.0f27423fec75.If67daab123a27c1cbddef000d6a3f212aa6309ef@changeid Signed-off-by: Johannes Berg commit 31d8bb4e07f80935ee9bf599a9d99de7ca90fc5a Author: Mordechay Goodstein Date: Thu Mar 26 15:09:37 2020 +0200 mac80211: agg-tx: refactor sending addba We move the actual arming the timer and sending ADDBA to a function for the use in different places calling the same logic. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.58a337eb90a1.I75934e6464535fbf43969acc796bc886291e79a5@changeid Signed-off-by: Johannes Berg commit 4826e721103acf42421304330cf48a642fa163bb Author: Ilan Peer Date: Thu Mar 26 15:09:36 2020 +0200 mac80211: Skip entries with HE membership selector When parsing supported rates IE. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.ed3e66f8c197.I93aad0e5ddb7ce79f05f8153922acb9aa5076d38@changeid Signed-off-by: Johannes Berg commit 2a392596d8811c6d58c014ec881b159c75a0cf45 Author: Ilan Peer Date: Thu Mar 26 15:09:35 2020 +0200 cfg80211: Parse HE membership selector This extends the support for drivers that rebuilds IEs in the FW (same as with HT/VHT). Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.20feaabfb484.I886252639604c8e3e84b8ef97962f1b0e4beec81@changeid Signed-off-by: Johannes Berg commit a4055e74a2ff7c70ccdb6c36254ad5181464f211 Author: Andrei Otcheretianski Date: Thu Mar 26 15:09:34 2020 +0200 mac80211: Don't destroy auth data in case of anti-clogging SAE AP may reject authentication with WLAN_STATUS_ANTI_CLOG_REQUIRED. As the user space will immediately continue the authentication flow, there is no need to destroy the authentication data in this case. This saves unneeded station removal and releasing the channel. Signed-off-by: Andrei Otcheretianski Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.7483996157a8.I8040a842874aaf6d209df3fc8a2acb97a0bf508b@changeid Signed-off-by: Johannes Berg commit d46b4ab870fa29445b701e922e9aa36b15f833ea Author: Shaul Triebitz Date: Thu Mar 26 15:09:33 2020 +0200 mac80211: add twt_protected flag to the bss_conf structure Add a flag to the BSS conf whether the BSS and STA support protected TWT. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.1dcb2d16fa74.I74d7c007dad2601d2e39f54612fe6554dd5ab386@changeid Signed-off-by: Johannes Berg commit 9166cc49767a646990a73380480356416b7794eb Author: Johannes Berg Date: Thu Mar 26 15:09:32 2020 +0200 mac80211: implement Operating Mode Notification extended NSS support Somehow we missed this for a long time, but similar to the extended NSS support in VHT capabilities, we need to have this in Operating Mode notification. Implement it by * parsing the 160/80+80 bit there and setting the bandwidth appropriately * having callers of ieee80211_get_vht_max_nss() pass in the current max NSS value as received in the operating mode notification in order to modify it appropriately depending on the extended NSS bits. This updates all drivers that use it, i.e. only iwlwifi/mvm. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200326150855.098483728cfa.I4e8c25d3288441759c2793247197229f0696a37d@changeid Signed-off-by: Johannes Berg commit 873b1cf61105a67f01f6fc3758405edb1bd1ba35 Author: Jouni Malinen Date: Tue Apr 21 17:48:15 2020 +0300 mac80211: Process multicast RX registration for Action frames Convert a user space registration for processing multicast Action frames (NL80211_CMD_REGISTER_FRAME with NL80211_ATTR_RECEIVE_MULTICAST) to a new enum ieee80211_filter_flags bit FIF_MCAST_ACTION so that drivers can update their RX filter parameters appropriately, if needed. Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20200421144815.19175-1-jouni@codeaurora.org [rename variables to rx_mcast_action_reg indicating action frames only] Signed-off-by: Johannes Berg commit 155d7c733807190258639c66b36340948f369349 Author: Johannes Berg Date: Mon Apr 20 14:06:00 2020 +0200 nl80211: allow client-only BIGTK support The current NL80211_EXT_FEATURE_BEACON_PROTECTION feature flag requires both AP and client support, add a new one called NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT that enables only support in client (and P2P-client) modes. Link: https://lore.kernel.org/r/20200420140559.6ba704053a5a.Ifeb869fb0b48e52fe0cb9c15572b93ac8a924f8d@changeid Signed-off-by: Johannes Berg commit 9dba48a6ece79da064655736dc7347a5fcadedef Author: Johannes Berg Date: Fri Apr 17 12:40:15 2020 +0200 cfg80211: support multicast RX registration For DPP, there's a need to receive multicast action frames, but many drivers need a special filter configuration for this. Support announcing from userspace in the management registration that multicast RX is required, with an extended feature flag if the driver handles this. Signed-off-by: Johannes Berg Reviewed-by: Sergey Matyukevich Link: https://lore.kernel.org/r/20200417124013.c46238801048.Ib041d437ce0bff28a0c6d5dc915f68f1d8591002@changeid Signed-off-by: Johannes Berg commit 6cd536fe62ef58d7c4eac2da07ab0ed7fd19010d Author: Johannes Berg Date: Fri Apr 17 12:43:01 2020 +0200 cfg80211: change internal management frame registration API Almost all drivers below cfg80211 get the API wrong (except for cfg80211) and are unable to cope with multiple registrations for the same frame type, which is valid due to the match filter. This seems to indicate the API is wrong, and we should maintain the full information in cfg80211 instead of the drivers. Change the API to no longer inform the driver about individual registrations and unregistrations, but rather every time about the entire state of the entire wiphy and single wdev, whenever it may have changed. This also simplifies the code in cfg80211 as it no longer has to track exactly what was unregistered and can free things immediately. Signed-off-by: Johannes Berg Acked-by: Arend van Spriel Reviewed-by: Sergey Matyukevich Link: https://lore.kernel.org/r/20200417124300.f47f3828afc8.I7f81ef59c2c5a340d7075fb3c6d0e08e8aeffe07@changeid Signed-off-by: Johannes Berg commit 9eaf183af741e3d8393eb571ac8aec9ee7d6530e Author: Jouni Malinen Date: Wed Apr 1 17:25:48 2020 +0300 mac80211: Report beacon protection failures to user space Report received Beacon frames that do not have a valid MME MIC when beacon protection is enabled. This covers both the cases of no MME in the received frame and invalid MIC in the MME. Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20200401142548.6990-2-jouni@codeaurora.org Signed-off-by: Johannes Berg commit 4d797fce783a8eb11dd23463828db84743795046 Author: Jouni Malinen Date: Wed Apr 1 17:25:47 2020 +0300 cfg80211: Unprotected Beacon frame RX indication Extend cfg80211_rx_unprot_mlme_mgmt() to cover indication of unprotected Beacon frames in addition to the previously used Deauthentication and Disassociation frames. The Beacon frame case is quite similar, but has couple of exceptions: this is used both with fully unprotected and also incorrectly protected frames and there is a rate limit on the events to avoid unnecessary flooding netlink events in case something goes wrong. Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20200401142548.6990-1-jouni@codeaurora.org [add missing kernel-doc] Signed-off-by: Johannes Berg commit c38b608504aa1ad8bfa00d85abd61cffad57f27f Author: Shengjiu Wang Date: Fri Apr 24 10:01:38 2020 +0800 ASoC: wm8962: set CLOCKING2 as non-volatile register Previously CLOCKING2 is set as a volatile register, but cause issue at suspend & resume, that some bits of CLOCKING2 is not restored at resume, for example SYSCLK_SRC bits, then the output clock is wrong. The volatile property is caused by CLASSD_CLK_DIV bits, which are controlled by the chip itself. But the datasheet claims these are read only and protected by the security key, and they are not read by the driver at all. So it should be safe to change CLOCKING2 to be non-volatile. Signed-off-by: Shengjiu Wang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/6d25d5b36d4b9aeb8655b5e947dad52214e34177.1587693523.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit de2cc97acba036847cdfb74e336f6e560eb6907c Author: Tova Mussai Date: Fri Apr 17 13:21:33 2020 +0300 iwlwifi: scan: remove support for fw scan api v13 The fw already supports scan api v14 and the firmware version that supports only v13 was not published, so we can remove support for v13 in the driver. Signed-off-by: Tova Mussai Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200417131727.11883315579a.I4f59100e457c1079c5e4c90e4930d1fa62b7ddd7@changeid commit 50689771c8f073e97f7758e5b696c64f3044bbd8 Author: Chris Wilson Date: Wed Apr 22 20:05:58 2020 +0100 drm/i915: Only close vma we open The history of i915_vma_close() is confusing, as is its use. As the lifetime of the i915_vma is currently bounded by the object it is attached to, we needed a means of identify when a vma was no longer in use by userspace (via the user's fd). This is further complicated by that only ppgtt vma should be closed at the user's behest, as the ggtt were always shared. Now that we attach the vma to a lut on the user's context, the open count does indicate how many unique and open context/vm are referencing this vma from the user. As such, we can and should just use the open_count to track when the vma is still in use by userspace. It's a poor man's replacement for reference counting. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1193 Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200422190558.30509-1-chris@chris-wilson.co.uk commit 2f72d35ea75ee8bf8c9e63fb43d43d5bfb4ac8fd Author: Mika Westerberg Date: Thu Apr 16 11:15:52 2020 +0300 MAINTAINERS: Update entry for Intel Broxton PMC driver The driver lives now under MFD so split the current entry into two parts and add me as co-maintainer of the Intel Broxton PMC driver. While there correct formatting of Zha Qipeng's email address. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 25f1ca31e230598eaf3c38d387a355a64bd772a7 Author: Mika Westerberg Date: Thu Apr 16 11:15:51 2020 +0300 platform/x86: intel_pmc_ipc: Convert to MFD This driver only creates a bunch of platform devices sharing resources belonging to the PMC device. This is pretty much what MFD subsystem is for so move the driver there, renaming it to intel_pmc_bxt.c which should be more clear what it is. MFD subsystem provides nice helper APIs for subdevice creation so convert the driver to use those. Unfortunately the ACPI device includes separate resources for most of the subdevices so we cannot simply call mfd_add_devices() to create all of them but instead we need to call it separately for each device. The new MFD driver continues to expose two sysfs attributes that allow userspace to send IPC commands to the PMC/SCU to avoid breaking any existing applications that may use these. Generally this is bad idea so document this in the ABI documentation. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 0759a8730c7070299556af8dddeecce90955c8ae Author: Mika Westerberg Date: Thu Apr 16 11:15:50 2020 +0300 platform/x86: intel_telemetry: Add telemetry_get_pltdata() Add new function that allows telemetry modules to get pointer to the platform specific configuration. This is needed to allow the telemetry debugfs module to fetch PMC IPC instance in the subsequent patch. This also allows us to replace telemetry_pltconfig_valid() with telemetry_get_pltdata() as well. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit b8da68f44f6dec243a4e9685af0ca0cdc1cd939c Author: Mika Westerberg Date: Thu Apr 16 11:15:49 2020 +0300 platform/x86: intel_pmc_ipc: Move PCI IDs to intel_scu_pcidrv.c The PCI probe driver in intel_pmc_ipc.c is a duplicate of what we already have in intel_scu_pcidrv.c with the exception that the later also creates SCU specific devices. Move the PCI IDs from the intel_pmc_ipc.c to intel_scu.c and use driver_data to detect whether SCU devices need to be created or not. Also update Kconfig entry to mention all platforms supported by the Intel SCU PCI driver and change dependency from X86_INTEL_MID to PCI which is more generic. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 781adff21c841196e846a5a88505f80d04b06016 Author: Mika Westerberg Date: Thu Apr 16 11:15:48 2020 +0300 x86/platform/intel-mid: Add empty stubs for intel_scu_devices_[create|destroy]() This allows to call the functions even when CONFIG_X86_INTEL_MID is not enabled. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 7713f9180cb410fbec3ae5d5024a8440e2c6c809 Author: Mika Westerberg Date: Thu Apr 16 11:15:47 2020 +0300 platform/x86: intel_pmc_ipc: Drop intel_pmc_ipc_command() Now that all callers have been converted over to the SCU IPC API we can drop intel_pmc_ipc_command(). Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit b62851491a55bcda59da7656c45a31f9388246d3 Author: Heikki Krogerus Date: Thu Apr 16 11:15:46 2020 +0300 usb: typec: mux: Convert the Intel PMC Mux driver to use new SCU IPC API Convert the driver to use the new SCU IPC API. This allows us to get rid of the duplicate PMC IPC implementation which is now covered in SCU IPC driver. Signed-off-by: Heikki Krogerus Signed-off-by: Mika Westerberg Signed-off-by: Lee Jones commit 68c73fb224778b8fd52b386f971a5cb3bca67878 Author: Mika Westerberg Date: Thu Apr 16 11:15:45 2020 +0300 platform/x86: intel_telemetry: Convert to use new SCU IPC API Convert the Intel Apollo Lake telemetry driver to use the new SCU IPC API. This allows us to get rid of the duplicate PMC IPC implementation which is now covered in SCU IPC driver. Also move telemetry specific IPC message constant to the telemetry driver where it belongs. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 5036208367cb3ada047d1c45b2615badedac7723 Author: Mika Westerberg Date: Thu Apr 16 11:15:44 2020 +0300 mfd: intel_soc_pmic_mrfld: Convert to use new SCU IPC API This converts the Intel Merrifield PMIC driver over the new SCU IPC API where the SCU IPC instance is passed to the functions. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 4181bc8f6fab150f197a696861599502727e0e95 Author: Mika Westerberg Date: Thu Apr 16 11:15:43 2020 +0300 mfd: intel_soc_pmic_bxtwc: Convert to use new SCU IPC API Convert the Intel Broxton Whiskey Cover PMIC driver to use the new SCU IPC API. This allows us to get rid of the PMC IPC implementation which is now covered in SCU IPC driver. We drop the error log if the IPC command fails because intel_scu_ipc_dev_command() does that already. Also move PMIC specific IPC message constants to the PMIC driver from the intel_pmc_ipc.h header. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit e7d3c33c58e0108e38e969239cd3b3678a5d8ac5 Author: Mika Westerberg Date: Thu Apr 16 11:15:42 2020 +0300 mfd: intel_soc_pmic: Add SCU IPC member to struct intel_soc_pmic Both PMIC drivers (intel_soc_pmic_mrfld and intel_soc_pmic_bxtwc) will be using this field going forward to access the SCU IPC instance. While there add kernel-doc for the intel_soc_pmic structure. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit ddcce057f50d3b1b6070880f2ced44ee55fd00cc Author: Mika Westerberg Date: Thu Apr 16 11:15:41 2020 +0300 platform/x86: intel_pmc_ipc: Start using SCU IPC SCU IPC is pretty much the same IPC implemented in the intel_pmc_ipc driver so drop the duplicate implementation and call directly the SCU IPC. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 7e18c89d6e37bfffa2b161b08f40b53d2ce7ee94 Author: Mika Westerberg Date: Thu Apr 16 11:15:40 2020 +0300 platform/x86: intel_scu_ipc: Add managed function to register SCU IPC Drivers such as intel_pmc_ipc.c can be unloaded as well so in order to support those in this driver add a new function that can be called to unregister the SCU IPC when it is not needed anymore. We also add a managed version of the intel_scu_ipc_register() that takes care of calling intel_scu_ipc_unregister() automatically when the driver is unbound. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 663cc18861a06f7b23bdd4315ff8a7a2ef213da8 Author: Mika Westerberg Date: Thu Apr 16 11:15:39 2020 +0300 platform/x86: intel_scu_ipcutil: Convert to use new SCU IPC API Convert the IPC util to use the new SCU IPC API where the SCU IPC instance is passed to the functions. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 80ae679b8f8679418018787ce8fdbf2684c10df7 Author: Mika Westerberg Date: Thu Apr 16 11:15:38 2020 +0300 watchdog: intel-mid_wdt: Convert to use new SCU IPC API This converts the Intel MID watchdog driver over the new SCU IPC API where the SCU IPC instance is passed to the functions. Signed-off-by: Mika Westerberg Acked-by: Guenter Roeck Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 595694bd38889ade26a572c75852bca0ddd68f5f Author: Mika Westerberg Date: Thu Apr 16 11:15:37 2020 +0300 platform/x86: intel_mid_powerbtn: Convert to use new SCU IPC API This converts the power button driver to use the new SCU IPC API where the SCU IPC instance is passed to the functions. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit f57fa18583f538786b66a045446617f5638f032a Author: Mika Westerberg Date: Thu Apr 16 11:15:36 2020 +0300 platform/x86: intel_scu_ipc: Introduce new SCU IPC API The current SCU IPC API has been operating on a single instance and there has been no way to pin the providing module in place when the SCU IPC is in use. This implements a new API that takes the SCU IPC instance as first parameter (NULL means the single instance is being used). The SCU IPC instance can be retrieved by calling new function intel_scu_ipc_dev_get() that take care of pinning the providing module in place as long as intel_scu_ipc_dev_put() is not called. The old API is updated to call the new API and is is left there in the legacy API header to support the existing users that cannot be converted easily. Subsequent patches will convert most of the users over to the new API. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit dd88564937390a9ebf4fb9c0ef21652ff6e35780 Author: Mika Westerberg Date: Thu Apr 16 11:15:35 2020 +0300 platform/x86: intel_scu_ipc: Move legacy SCU IPC API to a separate header In preparation for introducing a new API for SCU IPC, move the legacy API and constants to a separate header that is is subject to be removed eventually. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit ea608f25fa09b520400e168b4472660cd9dc9c55 Author: Mika Westerberg Date: Thu Apr 16 11:15:34 2020 +0300 platform/x86: intel_scu_ipc: Log more information if SCU IPC command fails Currently we only log an error if the command times out which makes it hard to figure out the failing command. This changes the driver to log command and subcommand with the error code which should make debugging easier. This also allows us to simplify the callers as they don't need to log these errors themselves. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit 54b34aa0a7295c0fc82c72c15bf42c05ad720d5f Author: Mika Westerberg Date: Thu Apr 16 11:15:33 2020 +0300 platform/x86: intel_scu_ipc: Split out SCU IPC functionality from the SCU driver The SCU IPC functionality is usable outside of Intel MID devices. For example modern Intel CPUs include the same thing but now it is called PMC (Power Management Controller) instead of SCU. To make the IPC available for those split the driver into core part (intel_scu_ipc.c) and the SCU PCI driver part (intel_scu_pcidrv.c) which then calls the former before it goes and creates rest of the SCU devices. The SCU IPC will also register a new class that gets assigned to the device that is created under the parent PCI device. We also split the Kconfig symbols so that INTEL_SCU_IPC enables the SCU IPC library and INTEL_SCU_PCI the SCU driver and convert the users accordingly. While there remove default y from the INTEL_SCU_PCI symbol as it is already selected by X86_INTEL_MID. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones commit b5f7311d3a2ed153f26b21c56d54a46d07a4da3f Author: Hans de Goede Date: Thu Apr 23 00:05:59 2020 +0200 platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA asus-nb-wmi does not add any extra functionality on these Asus Transformer books. They have detachable keyboards, so the hotkeys are send through a HID device (and handled by the hid-asus driver) and also the rfkill functionality is not used on these devices. Besides not adding any extra functionality, initializing the WMI interface on these devices actually has a negative side-effect. For some reason the \_SB.ATKD.INIT() function which asus_wmi_platform_init() calls drives GPO2 (INT33FC:02) pin 8, which is connected to the front facing webcam LED, high and there is no (WMI or other) interface to drive this low again causing the LED to be permanently on, even during suspend. This commit adds a blacklist of DMI system_ids on which not to load the asus-nb-wmi and adds these Transformer books to this list. This fixes the webcam LED being permanently on under Linux. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 90e8f58dfc04d1bd48ca155cc55ebf7ba1824864 Author: Johannes Berg Date: Fri Apr 17 11:18:31 2020 +0200 mac80211: fix drv_config_iface_filter() behaviour There are two bugs with this, first, it shouldn't be called on an interface that's down, and secondly, it should then be called when the interface comes up. Note that the currently only user (iwlwifi) doesn't seem to care about either of these scenarios. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200417111830.401d82c7a0bf.I5dc7d718816460c2d8d89c7af6c215f9e2b3078f@changeid Signed-off-by: Johannes Berg commit 1db364c88695272e3410eb4b5d4595c8cb15db30 Author: Johannes Berg Date: Fri Apr 17 12:38:04 2020 +0200 mac80211: mlme: remove duplicate AID bookkeeping Maintain the connection AID only in sdata->vif.bss_conf.aid, not also in sdata->u.mgd.aid. Keep setting that where we set ifmgd->aid before, which has the side effect of exposing the AID to the driver before the station entry (AP) is marked associated, in case it needs it then. Requested-by: Felix Fietkau Signed-off-by: Johannes Berg Tested-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/20200417123802.085d4a322b0c.I2e7a2ceceea8c6880219f9e9ee4d4ac985fd295a@changeid Signed-off-by: Johannes Berg commit 5cc58a9ecfa1bbf5fb587ec65e42f15dd5051238 Author: Johannes Berg Date: Mon Mar 23 16:24:00 2020 +0100 mac80211_hwsim: notify wmediumd of used MAC addresses Currently, wmediumd requires each used MAC address to be configured as a station in the virtual air, but that doesn't make sense as any station could have multiple MAC addresses, and even have randomized ones in scanning, etc. Add some code here to tell wmediumd of used MAC addresses, binding them to the hardware address. Combined with a wmediumd patch that makes it track the addresses this allows configuring just the radio address (42:00:00:00:nn:00 unless the radio was manually created) in wmediumd as a station, and all addresses that the station uses are added/removed dynamically. Tested with random scan, which without this and the corresponding wmediumd change doesn't get anything through as the sender doesn't exist as far as wmediumd is concerned (it's random). Link: https://lore.kernel.org/r/20200323162358.b397b1a1acef.Ice0536e34e5d96c51f97c374ea8af9551347c7e8@changeid Signed-off-by: Johannes Berg commit f78bf066acb92c93325e820802f9eb866007c86c Author: Archana Patni Date: Tue Apr 21 14:10:19 2020 +0530 platform/x86: intel_pmc_core: Change Jasper Lake S0ix debug reg map back to ICL Jasper Lake uses Icelake PCH IPs and the S0ix debug interfaces are same as Icelake. It uses SLP_S0_DBG register latch/read interface from Icelake generation. It doesn't use Tiger Lake LPM debug registers. Change the Jasper Lake S0ix debug interface to use the ICL reg map. Fixes: 16292bed9c56 ("platform/x86: intel_pmc_core: Add Atom based Jasper Lake (JSL) platform support") Signed-off-by: Archana Patni Acked-by: David E. Box Tested-by: Divagar Mohandass Signed-off-by: Andy Shevchenko commit 7ae14cf581f2cdd2ebae29ca5b3d42bdfebca597 Author: Jyri Sarha Date: Wed Jan 8 10:30:08 2020 +0200 phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver For DisplayPort use we need to set WIZ_CONFIG_LANECTL register's P_STANDARD_MODE bits to "mode 3". In the DisplayPort use also the P_ENABLE bits of the same register are set to P_ENABLE instead of P_ENABLE_FORCE, so that the DisplayPort driver can enable and disable the lane as needed. The DisplayPort mode is selected according to "cdns,phy-type"-properties found in link subnodes under the managed serdes (see "ti,sierra-phy-t0" and "ti,j721e-serdes-10g" devicetree bindings for details). All other values of "cdns,phy-type"-property but PHY_TYPE_DP will set P_STANDARD_MODE bits to 0 and P_ENABLE bits to force enable. Signed-off-by: Jyri Sarha Signed-off-by: Kishon Vijay Abraham I commit 5b6cc38f3f3f37109ce72b60bda215a5f6892c0b Author: Takashi Iwai Date: Fri Apr 24 09:40:16 2020 +0200 ALSA: usb-audio: Fix racy list management in output queue The linked list entry from FIFO is peeked at queue_pending_output_urbs() but the actual element pop-out is performed outside the spinlock, and it's potentially racy. Do delete the link at the right place inside the spinlock. Fixes: 8fdff6a319e7 ("ALSA: snd-usb: implement new endpoint streaming model") Link: https://lore.kernel.org/r/20200424074016.14301-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9c3d6497fbfa0911d4cd6f261762a0a7af29566a Author: Tang Bin Date: Sun Apr 19 15:12:45 2020 +0800 crypto: bcm - Delete redundant variable definition The variable "i" is redundant to be assigned a value of zero,because it's assigned in the for loop, so remove redundant one here. Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Signed-off-by: Herbert Xu commit 97f2650e504033376e8813691cb6eccf73151676 Author: Stephan Müller Date: Fri Apr 17 21:34:03 2020 +0200 crypto: drbg - always seeded with SP800-90B compliant noise source As the Jitter RNG provides an SP800-90B compliant noise source, use this noise source always for the (re)seeding of the DRBG. To make sure the DRBG is always properly seeded, the reseed threshold is reduced to 1<<20 generate operations. The Jitter RNG may report health test failures. Such health test failures are treated as transient as follows. The DRBG will not reseed from the Jitter RNG (but from get_random_bytes) in case of a health test failure. Though, it produces the requested random number. The Jitter RNG has a failure counter where at most 1024 consecutive resets due to a health test failure are considered as a transient error. If more consecutive resets are required, the Jitter RNG will return a permanent error which is returned to the caller by the DRBG. With this approach, the worst case reseed threshold is significantly lower than mandated by SP800-90A in order to seed with an SP800-90B noise source: the DRBG has a reseed threshold of 2^20 * 1024 = 2^30 generate requests. Yet, in case of a transient Jitter RNG health test failure, the DRBG is seeded with the data obtained from get_random_bytes. However, if the Jitter RNG fails during the initial seeding operation even due to a health test error, the DRBG will send an error to the caller because at that time, the DRBG has received no seed that is SP800-90B compliant. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 764428fe99e82ce9a57ca22fb8adc3370922348d Author: Stephan Müller Date: Fri Apr 17 21:33:33 2020 +0200 crypto: jitter - SP800-90B compliance SP800-90B specifies various requirements for the noise source(s) that may seed any DRNG including SP800-90A DRBGs. In November 2020, SP800-90B will be mandated for all noise sources that provide entropy to DRBGs as part of a FIPS 140-[2|3] validation or other evaluation types. Without SP800-90B compliance, a noise source is defined to always deliver zero bits of entropy. This patch ports the SP800-90B compliance from the user space Jitter RNG version 2.2.0. The following changes are applied: - addition of (an enhanced version of) the repetitive count test (RCT) from SP800-90B section 4.4.1 - the enhancement is due to the fact of using the stuck test as input to the RCT. - addition of the adaptive proportion test (APT) from SP800-90B section 4.4.2 - update of the power-on self test to perform a test measurement of 1024 noise samples compliant to SP800-90B section 4.3 - remove of the continuous random number generator test which is replaced by APT and RCT Health test failures due to the SP800-90B operation are only enforced in FIPS mode. If a runtime health test failure is detected, the Jitter RNG is reset. If more than 1024 resets in a row are performed, a permanent error is returned to the caller. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 63e05f3275172283fd0020dba678ef8eca869ef7 Author: Colin Ian King Date: Thu Apr 16 00:03:58 2020 +0100 crypto: algif_rng - remove redundant assignment to variable err The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu commit 8a656a48f75f193b901efe14326663505874c37a Author: Colin Ian King Date: Wed Apr 15 23:49:47 2020 +0100 crypto: chelsio - remove redundant assignment to variable error The variable error is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu commit 3ca73b70a3a98da739f4ebcff381d13bb7cd339f Author: Mark Brown Date: Tue Apr 14 19:20:08 2020 +0100 crypto: arm64 - Consistently enable extension Currently most of the crypto files enable the crypto extension using the .arch directive but crct10dif-ce-core.S uses .cpu instead. Move that over to .arch for consistency. Signed-off-by: Mark Brown Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 9784c9963feccd8dede924dbc0f8b1c64506e646 Author: Stephen Boyd Date: Thu Apr 23 13:34:16 2020 -0700 gpiolib: devprop: Warn if gpio-line-names is too long Some DT authors (including myself) have messed up the length of gpio-line-names and made it longer than it should be. Add a warning here so that developers can figure out that they've messed up their DT and should fix it. Cc: Alexandru M Stan Signed-off-by: Stephen Boyd Signed-off-by: Bartosz Golaszewski commit b2f9fb0d671f31e8af410a057eb429af3c17ec66 Author: Jason Yan Date: Wed Apr 15 16:50:06 2020 +0800 EDAC/amd8131: Remove defined but not used bridge_str Fix the following gcc warning: drivers/edac/amd8131_edac.c:47:21: warning: ‘bridge_str’ defined but not used [-Wunused-const-variable=] static char * const bridge_str[] = { ^~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Borislav Petkov Reviewed-by: Robert Richter Link: https://lkml.kernel.org/r/20200415085006.6732-1-yanaijie@huawei.com commit 04c96460bfdb483de5aaad0f9f75b2f3eca500be Author: Alexander Tsoy Date: Fri Apr 24 05:24:49 2020 +0300 ALSA: usb-audio: Remove async workaround for Scarlett 2nd gen Frame size computation has been fixed and the workaround is no longer needed. Signed-off-by: Alexander Tsoy Link: https://lore.kernel.org/r/20200424022449.14972-2-alexander@tsoy.me Signed-off-by: Takashi Iwai commit f0bd62b64016508938df9babe47f65c2c727d25c Author: Alexander Tsoy Date: Fri Apr 24 05:24:48 2020 +0300 ALSA: usb-audio: Improve frames size computation For computation of the the next frame size current value of fs/fps and accumulated fractional parts of fs/fps are used, where values are stored in Q16.16 format. This is quite natural for computing frame size for asynchronous endpoints driven by explicit feedback, since in this case fs/fps is a value provided by the feedback endpoint and it's already in the Q format. If an error is accumulated over time, the device can adjust fs/fps value to prevent buffer overruns/underruns. But for synchronous endpoints the accuracy provided by these computations is not enough. Due to accumulated error the driver periodically produces frames with incorrect size (+/- 1 audio sample). This patch fixes this issue by implementing a different algorithm for frame size computation. It is based on accumulating of the remainders from division fs/fps and it doesn't accumulate errors over time. This new method is enabled for synchronous and adaptive playback endpoints. Signed-off-by: Alexander Tsoy Link: https://lore.kernel.org/r/20200424022449.14972-1-alexander@tsoy.me Signed-off-by: Takashi Iwai commit 10635d2d2a4c95044217fe8ea6e5f5451fd07ae8 Merge: 36dbae994532 977dfef40c89 Author: Takashi Iwai Date: Fri Apr 24 08:24:39 2020 +0200 Merge branch 'for-linus' into for-next Back-merge 5.7-rc devel branch for further changes. Signed-off-by: Takashi Iwai commit 36dbae9945322e660795e73ffc8ed8ae4f25d13d Merge: 14ff6c5546e7 0d283287a420 Author: Takashi Iwai Date: Fri Apr 24 08:22:16 2020 +0200 Merge branch 'topic/nhlt' into for-next Merge NHLT init cleanup. Signed-off-by: Takashi Iwai commit 0d283287a42027e8a618bcdf17b79578041ebabd Author: Cezary Rojewski Date: Thu Apr 23 18:03:10 2020 +0200 ALSA: hda: Refactor Intel NHLT init NHLT fetch based on _DSM prevents ACPI table override mechanism from being utilized. Make use of acpi_get_table to enable it and get rid of redundant code. In consequence, NHLT can be overridden just like any other ACPI table, e.g.: DSDT or SSDT. Change has been verified on all Intel AVS architecture platforms, RVP and production laptops both. Change possible due to addition of NHLT signature to the list of standard ACPI tables: https://patchwork.kernel.org/patch/11463235/ Override helps not only with debug purposes but also allows user for table adjustment when one found on their production hardware is invalid. Shared official NHLT spec is now available to community at: https://01.org/blogs/intel-smart-sound-technology-audio-dsp NHLT support for iASL is still ongoing subject but should be available in nearest future. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20200423160310.28019-1-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 435cbab95e3966cd8310addd9e9b758dce0e8b84 Author: Jaegeuk Kim Date: Thu Apr 9 10:25:21 2020 -0700 f2fs: fix quota_sync failure due to f2fs_lock_op f2fs_quota_sync() uses f2fs_lock_op() before flushing dirty pages, but f2fs_write_data_page() returns EAGAIN. Likewise dentry blocks, we can just bypass getting the lock, since quota blocks are also maintained by checkpoint. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 126a34061eec2df05a5a28052edefd4e6125f31c Merge: 1aa63ddf726e 776d58823a60 Author: Dave Airlie Date: Fri Apr 24 13:12:08 2020 +1000 Merge tag 'drm-misc-next-2020-04-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.8: UAPI Changes: Cross-subsystem Changes: * MAINTAINERS: adapt several filenames to changes in panel code * arch/arm, fbdev: Use GPIO descriptors in sa11x0 * dma-buf: Fix typo in documentation Core Changes: * drm: Don't free framebuffer in drm_gem_fb_init() * drm: Document struct drm_device.dev_private being deprecated * drm: Merged topic/phy-compliance-202004-08 Driver Changes: * drm/adv7511: Add support for HDMI SPDIF and additional sampling rates * drm/ast: Allocate CRTC state of correct size * drm/panel: convert many driver bindings to DT schema; add port/ports property to bindings * drm/rockchip: Convert rk3066 bindings to YAML; spelling fixes * fbdev/arcfb: Call request_irq(), free_irq() at appropriate places * fbdev/controlfb: Support COMPILE_TEST; cleanups * fbdev/imxfb: Fix unbalanced enables/disables * fbdev/s1d13xxxfb: Call unregister_framebuffer() * fbdev/ssd1307fb: Use atomic PWM API, device properties and probe_new(); cleanups * fbdev/vesafb: Call release_region() * cleanups of includes, unused types/variables/fields, and fallthrough Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200423083425.GA15883@linux-uq9g commit 1802136023c010759d9ed1ff2b6384bcbf5eb3f9 Merge: efcd549da9d7 e57358873bb5 Author: David S. Miller Date: Thu Apr 23 18:26:12 2020 -0700 Merge branch 'ovs-meter-tables' Tonghao Zhang says: ==================== openvswitch: expand meter tables and fix bug The patch set expand or shrink the meter table when necessary. and other patches fix bug or improve codes. ==================== Signed-off-by: David S. Miller commit e57358873bb5d6caa882b9684f59140912b37dde Author: Tonghao Zhang Date: Fri Apr 24 08:08:06 2020 +0800 net: openvswitch: use u64 for meter bucket When setting the meter rate to 4+Gbps, there is an overflow, the meters don't work as expected. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit c77350089052cafa8125169e37463ab7028d6a18 Author: Tonghao Zhang Date: Fri Apr 24 08:08:05 2020 +0800 net: openvswitch: make EINVAL return value more obvious Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit a8e387384f554ea0b63889a7682ffcddee24df8b Author: Tonghao Zhang Date: Fri Apr 24 08:08:04 2020 +0800 net: openvswitch: remove the unnecessary check Before invoking the ovs_meter_cmd_reply_stats, "meter" was checked, so don't check it agin in that function. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit eb58eebc7fb5e23c9cc7d557c0a9236630591526 Author: Tonghao Zhang Date: Fri Apr 24 08:08:03 2020 +0800 net: openvswitch: set max limitation to meters Don't allow user to create meter unlimitedly, which may cause to consume a large amount of kernel memory. The max number supported is decided by physical memory and 20K meters as default. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit c7c4c44c9a95d87e50ced38f7480e779cb472174 Author: Tonghao Zhang Date: Fri Apr 24 08:08:02 2020 +0800 net: openvswitch: expand the meters supported number In kernel datapath of Open vSwitch, there are only 1024 buckets of meter in one datapath. If installing more than 1024 (e.g. 8192) meters, it may lead to the performance drop. But in some case, for example, Open vSwitch used as edge gateway, there should be 20K at least, where meters used for IP address bandwidth limitation. [Open vSwitch userspace datapath has this issue too.] For more scalable meter, this patch use meter array instead of hash tables, and expand/shrink the array when necessary. So we can install more meters than before in the datapath. Introducing the struct *dp_meter_instance, it's easy to expand meter though changing the *ti point in the struct *dp_meter_table. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit b4892e44043235368dfc714f4a6530f6793802b0 Author: Mika Kuoppala Date: Thu Apr 23 21:23:52 2020 +0300 drm/i915: Make define for lrc state offset More often than not, we need a byte offset into lrc register state from the start of the hw state. Make it so. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200423182355.21837-3-mika.kuoppala@linux.intel.com commit f1cc6acf22dd7b2a3548fa5dd9537b90a44668b5 Author: Mika Kuoppala Date: Thu Apr 23 23:41:59 2020 +0100 drm/i915/selftests: Add context batchbuffers registers to live_lrc_fixed Add per ctx bb and indirect ctx bb register locations to live_lrc_fixed for verification. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200423224159.22078-1-chris@chris-wilson.co.uk commit efcd549da9d7e8194b4d2d2f35eff8ce7b4da684 Author: Colin Ian King Date: Thu Apr 23 15:10:16 2020 +0100 net: phy: bcm54140: fix less than zero comparison on an unsigned Currently the unsigned variable tmp is being checked for an negative error return from the call to bcm_phy_read_rdb and this can never be true since tmp is unsigned. Fix this by making tmp a plain int. Addresses-Coverity: ("Unsigned compared against 0") Fixes: 4406d36dfdf1 ("net: phy: bcm54140: add hwmon support") Signed-off-by: Colin Ian King Reviewed-by: Andrew Lunn Reviewed-by: Michael Walle Signed-off-by: David S. Miller commit 8ffe2df6426f874659a3aa1654f45ba83fa91f87 Author: Zou Wei Date: Thu Apr 23 15:27:40 2020 +0800 qed: Make ll2_cbs static Fix the following sparse warning: drivers/net/ethernet/qlogic/qed/qed_ll2.c:2334:20: warning: symbol 'll2_cbs' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Acked-by: Michal Kalderon  Signed-off-by: David S. Miller commit 3c9143d96852485725d330b9164062d8f2d90a38 Author: Xu Wang Date: Thu Apr 23 13:43:13 2020 +0800 net: sched : Remove unnecessary cast in kfree Remove unnecassary casts in the argument to kfree. Signed-off-by: Xu Wang Signed-off-by: David S. Miller commit 9bd4af240f4db39e754081d135e6ef7a54bb6828 Author: Sean Christopherson Date: Tue Apr 21 00:53:27 2020 -0700 KVM: nVMX: Drop a redundant call to vmx_get_intr_info() Drop nested_vmx_l1_wants_exit()'s initialization of intr_info from vmx_get_intr_info() that was inadvertantly introduced along with the caching mechanism. EXIT_REASON_EXCEPTION_NMI, the only consumer of intr_info, populates the variable before using it. Fixes: bb53120d67cd ("KVM: VMX: Cache vmcs.EXIT_INTR_INFO using arch avail_reg flags") Signed-off-by: Sean Christopherson Message-Id: <20200421075328.14458-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 7d5b10fcb81e511ddf79c1c6b7f6efb282f80680 Author: Alex Deucher Date: Mon Apr 6 15:42:01 2020 -0400 PCI/P2PDMA: Add AMD Zen Raven and Renoir Root Ports to whitelist According to the hardware architect, pre-Zen parts support p2p writes and Zen parts support both p2p reads and writes. Add entries for Zen parts Raven (0x15d0) and Renoir (0x1630). Link: https://lore.kernel.org/r/20200406194201.846411-1-alexander.deucher@amd.com Signed-off-by: Alex Deucher Signed-off-by: Bjorn Helgaas Acked-by: Christian König Acked-by: Huang Rui commit 92a8da46462ecf8141a5a0055be98370dcfdea2c Merge: 4c532b144fc2 84ea9c0a95d7 Author: David S. Miller Date: Thu Apr 23 12:50:21 2020 -0700 Merge branch 'net-ethernet-ti-cpts-add-irq-and-HW_TS_PUSH-events' Grygorii Strashko says: ==================== net: ethernet: ti: cpts: add irq and HW_TS_PUSH events This is re-spin of patches to add CPSW IRQ and HW_TS_PUSH events support I've sent long time ago [1]. In this series, I've tried to restructure and split changes, and also add few additional optimizations comparing to initial RFC submission [1]. The HW_TS_PUSH events intended to serve for different timesync purposes on of which is to add PPS generation function, which can be implemented as below: +-----------------+ | Control | | application | +------->+ +----------+ | | | | | | | | | +-----------------+ | | | | | | PTP_EXTTS_REQUEST | | | | | +----------------------------------------------------------------+ | | Kernel +-------+----------+ +-------v--------+ | \dev\ptpX | | /sys/class/pwm/| | | | | +-------^----------+ +-------+--------+ | | | | | +-------v-------------------+ +-------+----------+ | | | CPTS driver | |pwm/pwm-omap-dmtimer.c | | | +---------------------------+ +-------^----------+ |clocksource/timer_ti_dm.c | | +-------+-------------------+ |HWx_TS_PUSH evt | +----------------------------------------------------------------+ | | HW +-------+----------+ +-------v--------+ | CPTS | | DMTimer | | | | | | HWx_TS_PUSH X<-----------------+ | | + | | +------------------+ +-------+--------+ | X timer4 As per my knowledge there is at least one public implemented above PPS generation schema from Tusori Tibor [2] based on initial HW_TS_PUSH enable submission[1]. And now there is work done by Lokesh Vutla published to enable PWM enable/improve PWM adjustment from user space [3][4][5]. Main changes comparing to initial submission: - TX timestamp processing deferred to ptp worker only - both CPTS IRQ and polling events processing supported to make it work for Keystone 2 also - switch to use new .gettimex64() interface - no DT updates as number of HWx_TS_PUSH inputs is static per HW Testing on am571x-idk/omap2plus_defconfig/+CONFIG_PREEMPT=y: 1) testing HW_TS_PUSH - enable pwm in DT pwm16: dmtimer-pwm { compatible = "ti,omap-dmtimer-pwm"; ti,timers = <&timer16>; #pwm-cells = <3>; }; - configure and start pwm echo 0 > /sys/class/pwm/pwmchip0/export echo 1000000000 > /sys/class/pwm/pwmchip0/pwm0/period echo 500000000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable - test HWx_TS_PUSH using Kernel selftest testptp application ./tools/testing/selftests/ptp/testptp -d /dev/ptp0 -e 1000 -i 3 2) testing phc2sys phc2sys[1616.791]: eth0 rms 408190379792180864 max 1580914543017209856 freq +864 +/- 4635 delay 645 +/- 29 phc2sys[1646.795]: eth0 rms 41 max 108 freq +0 +/- 36 delay 656 +/- 29 phc2sys[1676.800]: eth0 rms 43 max 83 freq +2 +/- 38 delay 650 +/- 0 phc2sys[1706.804]: eth0 rms 39 max 87 freq +4 +/- 34 delay 672 +/- 55 phc2sys[1736.808]: eth0 rms 35 max 66 freq +1 +/- 30 delay 667 +/- 49 phc2sys[1766.813]: eth0 rms 38 max 79 freq +2 +/- 33 delay 656 +/- 29 phc2sys[1796.817]: eth0 rms 45 max 98 freq +1 +/- 39 delay 656 +/- 29 phc2sys[1826.821]: eth0 rms 40 max 87 freq +5 +/- 35 delay 650 +/- 0 phc2sys[1856.826]: eth0 rms 29 max 76 freq -0 +/- 25 delay 656 +/- 29 phc2sys[1886.830]: eth0 rms 40 max 97 freq +4 +/- 35 delay 667 +/- 49 phc2sys[1916.834]: eth0 rms 42 max 94 freq +2 +/- 36 delay 661 +/- 41 phc2sys[1946.839]: eth0 rms 40 max 91 freq +2 +/- 35 delay 661 +/- 41 phc2sys[1976.843]: eth0 rms 46 max 88 freq -0 +/- 40 delay 667 +/- 49 phc2sys[2006.847]: eth0 rms 49 max 97 freq +2 +/- 43 delay 650 +/- 0 3) testing ptp4l - 1G connection ptp4l[862.891]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED ptp4l[923.894]: rms 1019697354682 max 5768279314068 freq +26053 +/- 72 delay 488 +/- 1 ptp4l[987.896]: rms 13 max 26 freq +26005 +/- 29 delay 488 +/- 1 ptp4l[1051.899]: rms 14 max 50 freq +25895 +/- 21 delay 488 +/- 1 ptp4l[1115.901]: rms 11 max 27 freq +25878 +/- 17 delay 488 +/- 1 ptp4l[1179.904]: rms 10 max 27 freq +25857 +/- 12 delay 488 +/- 1 ptp4l[1243.906]: rms 14 max 37 freq +25851 +/- 15 delay 488 +/- 1 ptp4l[1307.909]: rms 12 max 33 freq +25835 +/- 15 delay 488 +/- 1 ptp4l[1371.911]: rms 11 max 27 freq +25832 +/- 14 delay 488 +/- 1 ptp4l[1435.914]: rms 11 max 26 freq +25823 +/- 11 delay 488 +/- 1 ptp4l[1499.916]: rms 10 max 29 freq +25829 +/- 11 delay 489 +/- 1 ptp4l[1563.919]: rms 11 max 27 freq +25827 +/- 12 delay 488 +/- 1 - 10M connection ptp4l[51.955]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED ptp4l[112.957]: rms 279468848453933920 max 1580914542977391360 freq +25390 +/- 3207 delay 8222 +/- 36 ptp4l[176.960]: rms 254 max 522 freq +25809 +/- 219 delay 8271 +/- 30 ptp4l[240.962]: rms 271 max 684 freq +25868 +/- 234 delay 8249 +/- 22 ptp4l[304.965]: rms 263 max 556 freq +25894 +/- 227 delay 8225 +/- 47 ptp4l[368.967]: rms 238 max 648 freq +25908 +/- 204 delay 8234 +/- 40 ptp4l[432.970]: rms 274 max 658 freq +25932 +/- 237 delay 8241 +/- 22 ptp4l[496.972]: rms 247 max 557 freq +25943 +/- 213 delay 8223 +/- 26 ptp4l[560.974]: rms 291 max 756 freq +25968 +/- 251 delay 8244 +/- 41 ptp4l[624.977]: rms 249 max 697 freq +25975 +/- 216 delay 8258 +/- 22 Changes in v5: - fixed build issue Changes in v4: - fixed comments from Richard Cochran - dropped patch "net: ethernet: ti: cpts: move rx timestamp processing to ptp worker only" - added "Acked-by" from Richard Cochran - dependencies resolved, patch merged Changes in v3: - fixed rebase mess - fixed build issues Changes in v2 (broken): - fixed (formatting) comments from David Miller v4: https://patchwork.ozlabs.org/project/netdev/cover/20200422201254.15232-1-grygorii.strashko@ti.com/ v3: https://patchwork.ozlabs.org/project/netdev/cover/20200320194244.4703-1-grygorii.strashko@ti.com/ v2: https://patchwork.ozlabs.org/cover/1258339/ v1: https://patchwork.ozlabs.org/cover/1254708/ [1] https://lore.kernel.org/patchwork/cover/799251/ [2] https://usermanual.wiki/Document/SetupGuide.632280828.pdf https://github.com/t-tibor/msc_thesis [3] https://patchwork.kernel.org/cover/11421329/ [4] https://patchwork.kernel.org/cover/11433197/ [5] https://sourceforge.net/p/linuxptp/mailman/message/36943248/ ==================== Signed-off-by: David S. Miller commit 84ea9c0a95d7b3e554d6c3d7d719cc57be22e7ad Author: Grygorii Strashko Date: Thu Apr 23 17:20:22 2020 +0300 net: ethernet: ti: cpsw: enable cpts irq The CPSW misc IRQ need be enabled for CPTS event_pend IRQs processing. This patch adds corresponding support to CPSW driver. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit b78aba495df0eaee4f4a779b2354d6e2a43a3d70 Author: Grygorii Strashko Date: Thu Apr 23 17:20:21 2020 +0300 net: ethernet: ti: cpts: add support for HW_TS_PUSH events Hence CPTS IRQ support is in place the W_TS_PUSH events can be added. PWM capable DmTimers can be used to generete input signals for CPTS on TI AM335x/AM437x/DRA7 SoCs to be timestamped: AM335x/AM437x: timer4 - timer7 DRA7/AM57xx: timer13 - timer16 Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 85624412a03dc61eabddeb1cfbbc8325e3544694 Author: Grygorii Strashko Date: Thu Apr 23 17:20:20 2020 +0300 net: ethernet: ti: cpts: add irq support Add CPTS IRQ support, but do not enable it. By default, the CPTS driver will continue working using polling mode which is required for CPTS to continue working on platforms other than CPSW, like Keystone 2. The CPTS IRQ support is required to enable support for HW_TS_PUSH events. The CPSW CPTS IRQ and HW_TS_PUSH events support will be enabled in follow up patches. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit ba10742840fbc6e475dc05c7515fd91b7c88e1b2 Author: Grygorii Strashko Date: Thu Apr 23 17:20:19 2020 +0300 net: ethernet: ti: cpts: rework locking Now spinlock is used to synchronize everything which is not required. Add mutex and use to sync access to PTP interface and PTP worker and use spinlock only to sync FIFO/events processing. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit c8f8e47efe66dae775b617982e47a4564d7c4dda Author: Grygorii Strashko Date: Thu Apr 23 17:20:18 2020 +0300 net: ethernet: ti: cpts: move tx timestamp processing to ptp worker only Now the tx timestamp processing happens from different contexts - softirq and thread/PTP worker. Enabling IRQ will add one more hard_irq context. This makes over all defered TX timestamp processing and locking overcomplicated. Move tx timestamp processing to PTP worker always instead. napi_rx->cpts_tx_timestamp if ptp_packet then push to txq ptp_schedule_worker() do_aux_work->cpts_overflow_check cpts_process_events() Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 3bfd41b57811d76412af57f4884e28ad78c2ab2f Author: Grygorii Strashko Date: Thu Apr 23 17:20:17 2020 +0300 net: ethernet: ti: cpts: optimize packet to event matching Now the CPTS driver performs packet (skb) parsing every time when it needs to match packet to CPTS event (including ptp_classify_raw() calls). This patch optimizes matching process by parsing packet only once upon arrival and stores PTP specific data in skb->cb using the same fromat as in CPTS HW event. As result, all future matching reduces to comparing two u32 values. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 856e59ab7e6d3c85ee739f3f53341d47c88d454e Author: Grygorii Strashko Date: Thu Apr 23 17:20:16 2020 +0300 net: ethernet: ti: cpts: switch to use new .gettimex64() interface The CPTS HW latches and saves CPTS counter value in CPTS fifo immediately after writing to CPSW_CPTS_PUSH.TS_PUSH (bit 0), so the total time that the driver needs to read the CPTS timestamp is the time required CPSW_CPTS_PUSH write to actually reach HW. Hence switch CPTS driver to implement new .gettimex64() callback for more precise measurement of the offset between a PHC and the system clock which is measured as time between write(CPSW_CPTS_PUSH) read(CPSW_CPTS_PUSH) Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 0d6df3e613b74fe1a88de89cda63a0352e1dc4eb Author: Grygorii Strashko Date: Thu Apr 23 17:20:15 2020 +0300 net: ethernet: ti: cpts: move tc mult update in cpts_fifo_read() Now CPTS driver .adjfreq() generates request to read CPTS current time (CPTS_EV_PUSH) with intention to process all pending event using previous frequency adjustment values before switching to the new ones. So CPTS_EV_PUSH works as a marker to switch to the new frequency adjustment values. Current code assumes that all job is done in .adjfreq(), but after enabling IRQ this will not be true any more. Hence save new frequency adjustment values (mult) and perform actual freq adjustment in cpts_fifo_read() immediately after CPTS_EV_PUSH is received. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit e66dccced0cfd59a4dc4c16409b713332b882fa6 Author: Grygorii Strashko Date: Thu Apr 23 17:20:14 2020 +0300 net: ethernet: ti: cpts: separate hw counter read from timecounter Now CPTS HW time reading code is implemented in timecounter->cyclecounter .read() callback and performs following operations: timecounter_read() ->cc.read() -> cpts_systim_read() - request current CPTS HW time CPTS_TS_PUSH.TS_PUSH = 1 - poll CPTS FIFO for CPTS_EV_PUSH event with current HW timestamp This approach need to be changed for the future switch to PTP PHC .gettimex64() callback, which require to separate requesting current CPTS HW time and processing CPTS FIFO. And for the follow up patch, which improves .adjfreq() implementation. This patch moves code accessing CPTS HW out of timecounter code as following: - convert HW timestamp of every CPTS event to PTP time (us) and store it as part struct cpts_event; - add CPTS context field to store current CPTS HW time (counter) value and update it on CPTS_EV_PUSH reception; - move code accessing CPTS HW out of timecounter code and use current CPTS HW time (counter) from CPTS context instead; - ensure timecounter->cycle_last is updated on CPTS_EV_PUSH reception. After this change CPTS timecounter will only perform timekeeper role without actually accessing CPTS HW. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 79d6e755a45486ffb14bf0ed752e6ace20334cda Author: Grygorii Strashko Date: Thu Apr 23 17:20:13 2020 +0300 net: ethernet: ti: cpts: use dev_yy() api for logs Use dev_yy() API instead of pr_yy() for log outputs. Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 4c532b144fc28af43d11f0c12221db2a8c3ee4e3 Merge: e6acd2b6e84b cf4058dbaa18 Author: David S. Miller Date: Thu Apr 23 12:43:20 2020 -0700 Merge branch 'net-napi-addition-of-napi_defer_hard_irqs' Eric Dumazet says: ==================== net: napi: addition of napi_defer_hard_irqs This patch series augments gro_glush_timeout feature with napi_defer_hard_irqs As extensively described in first patch changelog, this can suppresss the chit-chat traffic between NIC and host to signal interrupts and re-arming them, since this can be an issue on high speed NIC with many queues. The last patch in this series converts mlx4 TX completion to napi_complete_done(), to enable this new mechanism. ==================== Signed-off-by: David S. Miller commit cf4058dbaa18bf8e55b7cb8c04e1c313298cd5b1 Author: Eric Dumazet Date: Wed Apr 22 09:13:29 2020 -0700 net/mlx4_en: use napi_complete_done() in TX completion In order to benefit from the new napi_defer_hard_irqs feature, we need to use napi_complete_done() variant in this driver. RX path is already using it, this patch implements TX completion side. mlx4_en_process_tx_cq() now returns the amount of retired packets, instead of a boolean, so that mlx4_en_poll_tx_cq() can pass this value to napi_complete_done(). Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7e417a66b86c110f4b282945dac82e21e0b08328 Author: Eric Dumazet Date: Wed Apr 22 09:13:28 2020 -0700 net: napi: use READ_ONCE()/WRITE_ONCE() gro_flush_timeout and napi_defer_hard_irqs can be read from napi_complete_done() while other cpus write the value, whithout explicit synchronization. Use READ_ONCE()/WRITE_ONCE() to annotate the races. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 6f8b12d661d09b488b9ac879b8eafbd2cc4a1450 Author: Eric Dumazet Date: Wed Apr 22 09:13:27 2020 -0700 net: napi: add hard irqs deferral feature Back in commit 3b47d30396ba ("net: gro: add a per device gro flush timer") we added the ability to arm one high resolution timer, that we used to keep not-complete packets in GRO engine a bit longer, hoping that further frames might be added to them. Since then, we added the napi_complete_done() interface, and commit 364b6055738b ("net: busy-poll: return busypolling status to drivers") allowed drivers to avoid re-arming NIC interrupts if we made a promise that their NAPI poll() handler would be called in the near future. This infrastructure can be leveraged, thanks to a new device parameter, which allows to arm the napi hrtimer, instead of re-arming the device hard IRQ. We have noticed that on some servers with 32 RX queues or more, the chit-chat between the NIC and the host caused by IRQ delivery and re-arming could hurt throughput by ~20% on 100Gbit NIC. In contrast, hrtimers are using local (percpu) resources and might have lower cost. The new tunable, named napi_defer_hard_irqs, is placed in the same hierarchy than gro_flush_timeout (/sys/class/net/ethX/) By default, both gro_flush_timeout and napi_defer_hard_irqs are zero. This patch does not change the prior behavior of gro_flush_timeout if used alone : NIC hard irqs should be rearmed as before. One concrete usage can be : echo 20000 >/sys/class/net/eth1/gro_flush_timeout echo 10 >/sys/class/net/eth1/napi_defer_hard_irqs If at least one packet is retired, then we will reset napi counter to 10 (napi_defer_hard_irqs), ensuring at least 10 periodic scans of the queue. On busy queues, this should avoid NIC hard IRQ, while before this patch IRQ avoidance was only possible if napi->poll() was exhausting its budget and not call napi_complete_done(). This feature also can be used to work around some non-optimal NIC irq coalescing strategies. Having the ability to insert XX usec delays between each napi->poll() can increase cache efficiency, since we increase batch sizes. It also keeps serving cpus not idle too long, reducing tail latencies. Co-developed-by: Luigi Rizzo Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e748f07d00c1c4a9106acafac52df7ea4ecf6264 Author: Hawking Zhang Date: Mon Apr 20 18:04:54 2020 +0800 drm/amdgpu: retire legacy vega10 sos version check retired those early sos version used in vega10 bring up phase Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 893d14cbe1eabaac4e907dcbacc733664eda2464 Author: Hawking Zhang Date: Mon Apr 20 18:01:33 2020 +0800 drm/amdgpu: switch to helper function to init sos ucode call common helper function to init sos ucode, instead of duplicate codes per ip version Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 1c301f4433871bf7c20ac88a8135caeaf2a810ee Author: Hawking Zhang Date: Mon Apr 20 17:47:53 2020 +0800 drm/amdgpu: add helper function to init sos ucode driver already had psp_firmware_header struture to deal with different layout of sos ucode. the sos micorcode initialization could be common one. Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit f4503f9eb3a16c8b70274dcb256ac4740242b508 Author: Hawking Zhang Date: Mon Apr 20 17:35:20 2020 +0800 drm/amdgpu: switch to helper function to init asd ucode call common helper function to initialize asd ucode Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit dc7195f66344281ad1db77e0ad2a902b919e4da8 Author: Hawking Zhang Date: Mon Apr 20 17:15:07 2020 +0800 drm/amdgpu: add helper function to init asd ucode asd is unified ucode across asic. it is not necessary to keep its software structure to be ip specific one Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit bc9fb7e93c7262ad4f1424245959657971aaaee2 Author: Hawking Zhang Date: Mon Apr 20 16:26:15 2020 +0800 drm/amdgpu: retire unused check_fw_loading status The driver can't access UCODE_DATA/ADDR registers on production boards. Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit d4d27897db9f00d66316e5f72425d9e3286cf9fc Author: Hawking Zhang Date: Mon Apr 20 15:57:26 2020 +0800 drm/amdgpu: remove unnecessary tOS version check tOS version is available through debugfs interface Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit a2676149323f04bf229bdad7f74b7ad14edd54d3 Author: Hawking Zhang Date: Mon Apr 20 16:01:11 2020 +0800 drm/amdgpu: retire support_vmr_ring interface vmr ring is dedicated for sriov vf (i.e.guest driver in sriov), which is general communication interface between driver and psp fw accross all ip version. it is not correct to make it as ip specific callback. it is even worse to check specific tOS version per IP version (like psp_v11/v12). Signed-off-by: Hawking Zhang Reviewed-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit fe158997c8b73ca5117e07ecfa94ec7d9acf7eb4 Author: Bernard Zhao Date: Mon Apr 20 23:48:18 2020 -0700 drm/amdgpu: shrink critical section in amdgpu_amdkfd_gpuvm_free_memory_of_gpu Reduce the mem->lock`s protected code area, no need to protect pr_debug. This also simplifies error handling. Signed-off-by: Bernard Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit e6acd2b6e84bf61fef42f99fe3d117fe75701629 Merge: e131a5634830 731815e720ae Author: David S. Miller Date: Thu Apr 23 12:37:11 2020 -0700 Merge branch 'qed-aer' Sudarsana Reddy Kalluru says: ==================== qed*: Add support for pcie advanced error recovery. The patch series adds qed/qede driver changes for PCIe Advanced Error Recovery (AER) support. Patch (1) adds qed changes to enable the device to send error messages to root port when detected. Patch (2) adds qede support for handling the detected errors (AERs). Changes from previous version: ------------------------------- v2: use pci_num_vf() instead of caching the value in edev. ==================== Signed-off-by: David S. Miller commit 731815e720ae7e47a19753e00ea80651b2d52b3b Author: Sudarsana Reddy Kalluru Date: Wed Apr 22 06:16:07 2020 -0700 qede: Add support for handling the pcie errors. The error recovery is handled by management firmware (MFW) with the help of qed/qede drivers. Upon detecting the errors, driver informs MFW about this event which in turn starts a recovery process. MFW sends ERROR_RECOVERY notification to the driver which performs the required cleanup/recovery from the driver side. Signed-off-by: Sudarsana Reddy Kalluru Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 2196d831205bad6bc5cd328baf0ae02234629695 Author: Sudarsana Reddy Kalluru Date: Wed Apr 22 06:16:06 2020 -0700 qed: Enable device error reporting capability. The patch enables the device to send error messages to root port when an error is detected. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit e131a5634830047923c694b4ce0c3b31745ff01b Author: Alexander Lobakin Date: Tue Apr 21 16:41:08 2020 +0300 net: dsa: add GRO support via gro_cells gro_cells lib is used by different encapsulating netdevices, such as geneve, macsec, vxlan etc. to speed up decapsulated traffic processing. CPU tag is a sort of "encapsulation", and we can use the same mechs to greatly improve overall DSA performance. skbs are passed to the GRO layer after removing CPU tags, so we don't need any new packet offload types as it was firstly proposed by me in the first GRO-over-DSA variant [1]. The size of struct gro_cells is sizeof(void *), so hot struct dsa_slave_priv becomes only 4/8 bytes bigger, and all critical fields remain in one 32-byte cacheline. The other positive side effect is that drivers for network devices that can be shipped as CPU ports of DSA-driven switches can now use napi_gro_frags() to pass skbs to kernel. Packets built that way are completely non-linear and are likely being dropped without GRO. This was tested on to-be-mainlined-soon Ethernet driver that uses napi_gro_frags(), and the overall performance was on par with the variant from [1], sometimes even better due to minimal overhead. net.core.gro_normal_batch tuning may help to push it to the limit on particular setups and platforms. iperf3 IPoE VLAN NAT TCP forwarding (port1.218 -> port0) setup on 1.2 GHz MIPS board: 5.7-rc2 baseline: [ID] Interval Transfer Bitrate Retr [ 5] 0.00-120.01 sec 9.00 GBytes 644 Mbits/sec 413 sender [ 5] 0.00-120.00 sec 8.99 GBytes 644 Mbits/sec receiver Iface RX packets TX packets eth0 7097731 7097702 port0 426050 6671829 port1 6671681 425862 port1.218 6671677 425851 With this patch: [ID] Interval Transfer Bitrate Retr [ 5] 0.00-120.01 sec 12.2 GBytes 870 Mbits/sec 122 sender [ 5] 0.00-120.00 sec 12.2 GBytes 870 Mbits/sec receiver Iface RX packets TX packets eth0 9474792 9474777 port0 455200 353288 port1 9019592 455035 port1.218 353144 455024 v2: - Add some performance examples in the commit message; - No functional changes. [1] https://lore.kernel.org/netdev/20191230143028.27313-1-alobakin@dlink.ru/ Signed-off-by: Alexander Lobakin Signed-off-by: David S. Miller commit b75326c201242de9495ff98e5d5cff41d7fc0d9d Author: Fernando Gont Date: Sun Apr 19 09:24:57 2020 -0300 ipv6: Honor all IPv6 PIO Valid Lifetime values RFC4862 5.5.3 e) prevents received Router Advertisements from reducing the Valid Lifetime of configured addresses to less than two hours, thus preventing hosts from reacting to the information provided by a router that has positive knowledge that a prefix has become invalid. This patch makes hosts honor all Valid Lifetime values, as per draft-gont-6man-slaac-renum-06, Section 4.2. This is meant to help mitigate the problem discussed in draft-ietf-v6ops-slaac-renum. Note: Attacks aiming at disabling an advertised prefix via a Valid Lifetime of 0 are not really more harmful than other attacks that can be performed via forged RA messages, such as those aiming at completely disabling a next-hop router via an RA that advertises a Router Lifetime of 0, or performing a Denial of Service (DoS) attack by advertising illegitimate prefixes via forged PIOs. In scenarios where RA-based attacks are of concern, proper mitigations such as RA-Guard [RFC6105] [RFC7113] should be implemented. Signed-off-by: Fernando Gont Signed-off-by: David S. Miller commit 6f81b2d047c59eb77cd04795a44245d6a52cdaec Author: limingyu Date: Wed Apr 22 17:01:19 2020 +0800 drm/amdgpu: Init data to avoid oops while reading pp_num_states. For chip like CHIP_OLAND with si enabled(amdgpu.si_support=1), the amdgpu will expose pp_num_states to the /sys directory. In this moment, read the pp_num_states file will excute the amdgpu_get_pp_num_states func. In our case, the data hasn't been initialized, so the kernel will access some ilegal address, trigger the segmentfault and system will reboot soon: uos@uos-PC:~$ cat /sys/devices/pci0000\:00/0000\:00\:00.0/0000\:01\:00 .0/pp_num_states Message from syslogd@uos-PC at Apr 22 09:26:20 ... kernel:[ 82.154129] Internal error: Oops: 96000004 [#1] SMP This patch aims to fix this problem, avoid that reading file triggers the kernel sementfault. Signed-off-by: limingyu Signed-off-by: zhoubinbin Signed-off-by: Alex Deucher commit 00aba6da21e5886e4d279bc3679cd2b4548d10f1 Author: YueHaibing Date: Tue Apr 21 10:41:25 2020 +0800 drm/amdgpu: remove set but not used variable 'priority' drivers/gpu/drm/amd/amdgpu/amdgpu_job.c: In function amdgpu_job_submit: drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:148:26: warning: variable priority set but not used [-Wunused-but-set-variable] commit 33abcb1f5a17 ("drm/amdgpu: set compute queue priority at mqd_init") left behind this, remove it. Reviewed-by: Christian König Signed-off-by: YueHaibing Signed-off-by: Alex Deucher commit 408d9121004d431fd2fd991fe461bf4891de6952 Author: Randy Dunlap Date: Sun Apr 19 18:50:15 2020 -0700 drm: amdgpu: fix kernel-doc struct warning Fix a kernel-doc warning of missing struct field desription: ../drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:92: warning: Function parameter or member 'vm' not described in 'amdgpu_vm_eviction_lock' Fixes: a269e44989f3 ("drm/amdgpu: Avoid reclaim fs while eviction lock") Signed-off-by: Randy Dunlap Cc: Signed-off-by: Alex Sierra Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Cc: David (ChunMing) Zhou Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 17fd4fe943fa01dbc551d918e6495a9f61948ef2 Author: Randy Dunlap Date: Tue Apr 21 16:34:00 2020 -0700 drm: amd/display: fix Kconfig help text Fix help text: indent one tab + 2 spaces; end a sentence with a period; and collapse short lines of text to one line. Fixes: 23c61b4599c4 ("drm/amd: Fix Kconfig indentation") Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Randy Dunlap Cc: Harry Wentland Cc: Alex Deucher Cc: Krzysztof Kozlowski Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 5420819401cc7048a373d99407a8bb2cca7861c9 Author: Yintian Tao Date: Wed Apr 22 19:58:22 2020 +0800 drm/amdgpu: request reg_val_offs each kiq read reg According to the current kiq read register method, there will be race condition when using KIQ to read register if multiple clients want to read at same time just like the expample below: 1. client-A start to read REG-0 throguh KIQ 2. client-A poll the seqno-0 3. client-B start to read REG-1 through KIQ 4. client-B poll the seqno-1 5. the kiq complete these two read operation 6. client-A to read the register at the wb buffer and get REG-1 value Therefore, use amdgpu_device_wb_get() to request reg_val_offs for each kiq read register. v2: fix the error remove v3: fix the print typo v4: remove unused variables Signed-off-by: Yintian Tao Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a6cec3fdbd72e9f975f2db2bbfd1847831478195 Author: Ani Sinha Date: Tue Apr 21 08:57:50 2020 +0530 PCI: pciehp: Remove unused EMI() and HP_SUPR_RM() macros EMI() and HP_SUPR_RM() are unused, so remove them. Link: https://lore.kernel.org/r/1587439673-39652-1-git-send-email-ani@anisinha.ca Signed-off-by: Ani Sinha Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit e0b4b4722dfac09658d1519b296cf8dc349a2451 Author: Leon Romanovsky Date: Thu Apr 9 21:03:33 2020 +0300 net/mlx5: Update transobj.c new cmd interface Do mass update of transobj.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Signed-off-by: Leon Romanovsky commit 7ba294e43595ab728adf2baf0aab378095768bfe Author: Leon Romanovsky Date: Thu Apr 9 21:02:08 2020 +0300 net/mlx5: Update SW steering new cmd interface Do mass update of SW steering to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Signed-off-by: Leon Romanovsky commit 2276a0dfc17be2cd89cfb8ed0a7ef6fad417aa3e Author: Leon Romanovsky Date: Thu Apr 9 21:00:23 2020 +0300 net/mlx5: Update port.c new cmd interface Do mass update of port.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit fa8110f4451c189b1efd4de6bef02ac6efb1244f Author: Leon Romanovsky Date: Thu Apr 9 17:05:31 2020 +0300 net/mlx5: Update rl.c new cmd interface Do mass update of rl.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 1fb5193434555df68eb065705baf223bca80ad0a Author: Leon Romanovsky Date: Thu Apr 9 17:05:05 2020 +0300 net/mlx5: Update uar.c new cmd interface Do mass update of uar.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 9b3ca3ec03169e895c414c4e98a49c0cd0cd95ec Author: Leon Romanovsky Date: Thu Apr 9 17:04:30 2020 +0300 net/mlx5: Update pd.c new cmd interface Do mass update of pd.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 86d41641ddd66fc9b2cc0aef0909cee68493a78a Author: Leon Romanovsky Date: Thu Apr 9 17:02:07 2020 +0300 net/mlx5: Update pagealloc.c new cmd interface Do mass update of pagealloc.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit adda874c957c86c7407930142d944c1546c38260 Author: Leon Romanovsky Date: Thu Apr 9 16:50:37 2020 +0300 net/mlx5: Update mr.c new cmd interface Do mass update of mr.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 62a9fec040831c84a79721ec288851a3fd6f8ec0 Author: Leon Romanovsky Date: Thu Apr 9 16:43:58 2020 +0300 net/mlx5: Update mcg.c new cmd interface Do mass update of mcg.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 3ac0e69e69ad17fe792ec68e651c6535d74fcffd Author: Leon Romanovsky Date: Thu Apr 9 16:33:38 2020 +0300 net/mlx5: Update main.c new cmd interface Do mass update of main.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 253e790e204f90adf10797ccea58910518a2c77e Author: Leon Romanovsky Date: Thu Apr 9 16:32:06 2020 +0300 net/mlx5: Update vxlan.c new cmd interface Do mass update of vxlan.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 9d6ed27163163b3236f38f89e3968601f7de6a95 Author: Leon Romanovsky Date: Thu Apr 9 16:31:21 2020 +0300 net/mlx5: Update mpfs.c new cmd interface Do mass update of mpfs.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit bb7664d369bfeb2754af8b972ddaa5734e2864a8 Author: Leon Romanovsky Date: Thu Apr 9 16:30:39 2020 +0300 net/mlx5: Update gid.c new cmd interface Do mass update of gid.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 5d19395f6988c057cb9461075f308a6c16a8c253 Author: Leon Romanovsky Date: Thu Apr 9 16:17:01 2020 +0300 net/mlx5: Update lag.c new cmd interface Do mass update of lag.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 59ad21c21fc4025831fbd0c291e2db1247fddf4d Author: Leon Romanovsky Date: Thu Apr 9 16:08:35 2020 +0300 net/mlx5: Update fw.c new cmd interface Do mass update of fw.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 31a0956ea91567b8f0e39d8420253646304b8571 Author: Leon Romanovsky Date: Thu Apr 9 16:01:30 2020 +0300 net/mlx5: Update fs_core new cmd interface Do mass update of fs_core to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit b316e1866fa39aadc1888fc68b73729343cc4058 Author: Leon Romanovsky Date: Thu Apr 9 15:59:30 2020 +0300 net/mlx5: Update FPGA to new cmd interface Do mass update of FPGA to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit e08a6832f9c19a1b514675ee53a34736647f918a Author: Leon Romanovsky Date: Thu Apr 9 12:30:08 2020 +0300 net/mlx5: Update eswitch to new cmd interface Do mass update of eswitch to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Signed-off-by: Leon Romanovsky commit a184cda1bb31eb14720c5f09d9698ab1666aa371 Author: Leon Romanovsky Date: Thu Apr 9 12:26:41 2020 +0300 net/mlx5: Update statistics to new cmd interface Do mass update of statistics to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 49d7fcd127c1ee011aee252985749eb33593488c Author: Leon Romanovsky Date: Thu Apr 9 12:25:08 2020 +0300 net/mlx5: Update eq.c to new cmd interface Do mass update of eq.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 9aa536ad45ec390d32c563321b26ccd8de52a2d9 Author: Leon Romanovsky Date: Thu Apr 9 11:56:42 2020 +0300 net/mlx5: Update ecpf.c to new cmd interface Do mass update of ecpf.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit e36fb468d23967683c1f0de644da0928563e604d Author: Leon Romanovsky Date: Thu Apr 9 11:55:06 2020 +0300 net/mlx5: Update debugfs.c to new cmd interface Do mass update of debugfs.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit d1f620500cde5c72c7b96a19474733c4c6c67f38 Author: Leon Romanovsky Date: Thu Apr 9 11:39:14 2020 +0300 net/mlx5: Update cq.c to new cmd interface Do mass update of cq.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Reviewed-by: Moshe Shemesh Signed-off-by: Leon Romanovsky commit 5d1c9a114a6efba2c8391e39d4ac3e4e5c7b6d32 Author: Leon Romanovsky Date: Tue Apr 7 18:59:51 2020 +0300 net/mlx5: Update vport.c to new cmd interface Do mass update of vport.c to reuse newly introduced mlx5_cmd_exec_in*() interfaces. Signed-off-by: Leon Romanovsky commit 5d12da9dd6c155f7a09dfcaa2b9827764c939b2a Author: Ard Biesheuvel Date: Mon Apr 13 15:36:37 2020 +0200 efi/libstub/arm64: Simplify randomized loading of kernel image The KASLR code path in the arm64 version of the EFI stub incorporates some overly complicated logic to randomly allocate a region of the right alignment: there is no need to randomize the placement of the kernel modulo 2 MiB separately from the placement of the 2 MiB aligned allocation itself - we can simply follow the same logic used by the non-randomized placement, which is to allocate at the correct alignment, and only take TEXT_OFFSET into account if it is not a round multiple of the alignment. Signed-off-by: Ard Biesheuvel commit 82046702e288bdd81673b81ab5138e498d155918 Author: Ard Biesheuvel Date: Fri Mar 27 17:23:52 2020 +0100 efi/libstub/arm64: Replace 'preferred' offset with alignment check The notion of a 'preferred' load offset for the kernel dates back to the times when the kernel's primary mapping overlapped with the linear region, and memory below it could not be used at all. Today, the arm64 kernel does not really care where it is loaded in physical memory, as long as the alignment requirements are met, and so there is no point in unconditionally moving the kernel to a new location in memory at boot. Instead, we can - check for a KASLR seed, and randomly reallocate the kernel if one is provided - otherwise, check whether the alignment requirements are met for the current placement of the kernel, and just run it in place if they are - finally, do an ordinary page allocation and reallocate the kernel to a suitably aligned buffer anywhere in memory. By the same reasoning, there is no need to take TEXT_OFFSET into account if it is a round multiple of the minimum alignment, which is the usual case for relocatable kernels with TEXT_OFFSET randomization disabled. Otherwise, it suffices to use the relative misaligment of TEXT_OFFSET when reallocating the kernel. Signed-off-by: Ard Biesheuvel commit c37c9162a2fae026dc8570ad7c5ade0422b0a267 Author: Ard Biesheuvel Date: Mon Apr 13 16:06:56 2020 +0200 efi/libstub/random: Increase random alloc granularity The implementation of efi_random_alloc() arbitrarily truncates the provided random seed to 16 bits, which limits the granularity of the randomly chosen allocation offset in memory. This is currently only an issue if the size of physical memory exceeds 128 GB, but going forward, we will reduce the allocation alignment to 64 KB, and this means we need to increase the granularity to ensure that the random memory allocations are distributed evenly. We will need to switch to 64-bit arithmetic for the multiplication, but this does not result in 64-bit integer intrinsic calls on ARM or on i386. Signed-off-by: Ard Biesheuvel commit e1df73e2d18b3b7d66f2ec38d81d9566b3a7fb21 Author: Ard Biesheuvel Date: Mon Apr 13 16:01:05 2020 +0200 efi/libstub/random: Align allocate size to EFI_ALLOC_ALIGN The EFI stub uses a per-architecture #define for the minimum base and size alignment of page allocations, which is set to 4 KB for all architecures except arm64, which uses 64 KB, to ensure that allocations can always be (un)mapped efficiently, regardless of the page size used by the kernel proper, which could be a kexec'ee The API wrappers around page based allocations assume that this alignment is always taken into account, and so efi_free() will also round up its size argument to EFI_ALLOC_ALIGN. Currently, efi_random_alloc() does not honour this alignment for the allocated size, and so freeing such an allocation may result in unrelated memory to be freed, potentially leading to issues after boot. So let's round up size in efi_random_alloc() as well. Fixes: 2ddbfc81eac84a29 ("efi: stub: add implementation of efi_random_alloc()") Signed-off-by: Ard Biesheuvel commit 45d97a749e9fec6d5324b19561ce5fbfa937d60b Author: Arvind Sankar Date: Sat Mar 28 12:06:01 2020 -0400 efi/gop: Allow automatically choosing the best mode Add the ability to automatically pick the highest resolution video mode (defined as the product of vertical and horizontal resolution) by using a command-line argument of the form video=efifb:auto If there are multiple modes with the highest resolution, pick one with the highest color depth. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200328160601.378299-2-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 9a1663bc4d9856f6810786fec597dab5440a9d8d Author: Arvind Sankar Date: Thu Mar 19 22:00:27 2020 -0400 efi/gop: Allow specifying depth as well as resolution Extend the video mode argument to handle an optional color depth specification of the form video=efifb:x[-(rgb|bgr|)] Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-14-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit d9ff0323d074c6c06467118c7a43d5748f147369 Author: Arvind Sankar Date: Thu Mar 19 22:00:26 2020 -0400 efi/gop: Allow specifying mode by x Add the ability to choose a video mode using a command-line argument of the form video=efifb:x Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-13-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit fffb68047e563fb74f782c726e9bdf1fa117d93d Author: Arvind Sankar Date: Thu Mar 19 22:00:25 2020 -0400 efi/gop: Allow specifying mode number on command line Add the ability to choose a video mode for the selected gop by using a command-line argument of the form video=efifb:mode= Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-12-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit b4b89a02724245c4f4eda9dbfb7895ddf122ca7f Author: Arvind Sankar Date: Thu Mar 19 22:00:24 2020 -0400 efi/gop: Add prototypes for query_mode and set_mode Add prototypes and argmap for the Graphics Output Protocol's QueryMode and SetMode functions. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-11-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit d49fd4bbf9bb0dbee3a3eed301ffeeb75636053b Author: Arvind Sankar Date: Thu Mar 19 22:00:23 2020 -0400 efi/gop: Remove unreachable code from setup_pixel_info pixel_format must be one of PIXEL_RGB_RESERVED_8BIT_PER_COLOR PIXEL_BGR_RESERVED_8BIT_PER_COLOR PIXEL_BIT_MASK since we skip PIXEL_BLT_ONLY when finding a gop. Remove the redundant code and add another check in find_gop to skip any pixel formats that we don't know about, in case a later version of the UEFI spec adds one. Reformat the code a little. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-10-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 9867fc9de6a6a7a54edb2c43540c6db226e84a14 Author: Arvind Sankar Date: Thu Mar 19 22:00:22 2020 -0400 efi/gop: Use helper macros for find_bits Use the __ffs/__fls macros to calculate the position and size of the mask. Correct type of mask to u32 instead of unsigned long. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-9-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit f1d1853bdbcfb2d00ae0b850baf26d87e6d363d8 Author: Arvind Sankar Date: Thu Mar 19 22:00:21 2020 -0400 efi/gop: Use helper macros for populating lfb_base Use the lower/upper_32_bits macros from kernel.h to initialize si->lfb_base and si->ext_lfb_base. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-8-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit e484c594ba0e34686ad8780287961d09a3b4169b Author: Arvind Sankar Date: Thu Mar 19 22:00:20 2020 -0400 efi/gop: Move variable declarations into loop block Declare the variables inside the block where they're used. Get rid of a couple of redundant initializers. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-7-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 8e0a22e2b0531870e61110d12b1d37d6b5d24eed Author: Arvind Sankar Date: Thu Mar 19 22:00:19 2020 -0400 efi/gop: Slightly re-arrange logic of find_gop Small cleanup to get rid of conout_found. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-6-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit ecf53091f34af7172322ed40cfb5acf487329561 Author: Arvind Sankar Date: Thu Mar 19 22:00:18 2020 -0400 efi/gop: Factor out locating the gop into a function Move the loop to find a gop into its own function. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-5-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 6327e6d0e4a52688be621190381eea6a146bb777 Author: Arvind Sankar Date: Thu Mar 19 22:00:17 2020 -0400 efi/gop: Get mode information outside the loop Move extraction of the mode information parameters outside the loop to find the gop, and eliminate some redundant variables. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-4-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 8cd207973c37175bf44727e28aa9c74fcf18de5e Author: Arvind Sankar Date: Thu Mar 19 22:00:16 2020 -0400 efi/gop: Move check for framebuffer before con_out If the gop doesn't have a framebuffer, there's no point in checking for con_out support. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-3-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit bd45870409a363eeb67e409645244ce38c7c2df3 Author: Arvind Sankar Date: Thu Mar 19 22:00:15 2020 -0400 efi/gop: Remove redundant current_fb_base current_fb_base isn't used for anything except assigning to fb_base if we locate a suitable gop. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200320020028.1936003-2-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel commit 87cd6378b3d2e0bd3316c3bb005e1d9d4db372fd Author: Zou Wei Date: Thu Apr 23 20:08:33 2020 +0800 efi/libstub/arm: Make install_memreserve_table static Fix the following sparse warning: drivers/firmware/efi/libstub/arm-stub.c:68:6: warning: symbol 'install_memreserve_table' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei Link: https://lore.kernel.org/r/1587643713-28169-1-git-send-email-zou_wei@huawei.com Signed-off-by: Ard Biesheuvel commit 22090f84bc3f8081e0ec180ccaedc85820085376 Author: Ard Biesheuvel Date: Thu Apr 23 13:44:50 2020 +0200 efi/libstub: unify EFI call wrappers for non-x86 We have wrappers around EFI calls so that x86 can define special versions for mixed mode, while all other architectures can use the same simple definition that just issues the call directly. In preparation for the arrival of yet another architecture that doesn't need anything special here (RISC-V), let's move the default definition into a shared header. Signed-off-by: Ard Biesheuvel commit cf6b83664895a5c7e97710df282e220bd047f0f5 Author: Ard Biesheuvel Date: Tue Apr 21 09:17:35 2020 +0200 efi/libstub: Make initrd file loader configurable Loading an initrd passed via the kernel command line is deprecated: it is limited to files that reside in the same volume as the one the kernel itself was loaded from, and we have more flexible ways to achieve the same. So make it configurable so new architectures can decide not to enable it. Signed-off-by: Ard Biesheuvel commit 0702e4f39034f15855def3165fe7213c7c2c0163 Author: Al Viro Date: Tue Feb 18 23:09:25 2020 -0500 dlmfs: convert dlmfs_file_read() to copy_to_user() Signed-off-by: Al Viro commit 3d3185ae593de8d4887535e095c9dca0bd689419 Author: Al Viro Date: Wed Feb 19 10:37:13 2020 -0500 esas2r: don't bother with __copy_to_user() sure, we'd done copy_from_user() on the same range, so we can skip access_ok()... and it's not worth bothering. Just use copy_to_user(). Signed-off-by: Al Viro commit 973a5909e99d0301a8832ca0cf07f9be01c4e97a Author: Lyude Paul Date: Thu Apr 23 12:42:24 2020 -0400 Revert "drm/dp_mst: Remove single tx msg restriction." This reverts commit 6bb0942e8f46863a745489cce27efe5be2a3885e. Unfortunately it would appear that the rumors we've heard of sideband message interleaving not being very well supported are true. On the Lenovo ThinkPad Thunderbolt 3 dock that I have, interleaved messages appear to just get dropped: [drm:drm_dp_mst_wait_tx_reply [drm_kms_helper]] timedout msg send 00000000571ddfd0 2 1 [dp_mst] txmsg cur_offset=2 cur_len=2 seqno=1 state=SENT path_msg=1 dst=00 [dp_mst] type=ENUM_PATH_RESOURCES contents: [dp_mst] port=2 DP descriptor for this hub: OUI 90-cc-24 dev-ID SYNA3 HW-rev 1.0 SW-rev 3.12 quirks 0x0008 It would seem like as well that this is a somewhat well known issue in the field. From section 5.4.2 of the DisplayPort 2.0 specification: There are MST Sink/Branch devices in the field that do not handle interleaved message transactions. To facilitate message transaction handling by downstream devices, an MST Source device shall generate message transactions in an atomic manner (i.e., the MST Source device shall not concurrently interleave multiple message transactions). Therefore, an MST Source device shall clear the Message_Sequence_No value in the Sideband_MSG_Header to 0. MST Source devices that support field policy updates by way of software should update the policy to forego the generation of interleaved message transactions. This is a bit disappointing, as features like HDCP require that we send a sideband request every ~2 seconds for each active stream. However, there isn't really anything in the specification that allows us to accurately probe for interleaved messages. If it ends up being that we -really- need this in the future, we might be able to whitelist hubs where interleaving is known to work-or maybe try some sort of heuristics. But for now, let's just play it safe and not use it. Signed-off-by: Lyude Paul Fixes: 6bb0942e8f46 ("drm/dp_mst: Remove single tx msg restriction.") Cc: Wayne Lin Cc: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200423164225.680178-1-lyude@redhat.com Reviewed-by: Sean Paul commit fe57a92c88580ae7894b9c71d2d520ba98eb1591 Author: Mark Brown Date: Thu Apr 23 15:28:05 2020 +0100 ASoC: SOF: Add missing dependency on IMX_SCU This broke PowerPC allyesconfig. Reported-by: Stephen Rothwell Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200423142805.52757-1-broonie@kernel.org Signed-off-by: Mark Brown commit 4e5552b23f9fdfdca008a1ab05725daa471f5a83 Author: Mauro Carvalho Chehab Date: Thu Apr 23 17:58:13 2020 +0200 media: Kconfig: fix some dvb-usb-v2 dependencies There are some tuners used by a few pure DVB boards that use internally V4L2 function calls. Due to that, such drivers now depends on v4l2 core support, and can't be auto-selected if !VIDEO_V4L2: WARNING: unmet direct dependencies detected for DVB_RTL2832_SDR Depends on [n]: MEDIA_SUPPORT [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_CORE [=y] && I2C [=y] && I2C_MUX [=y] && VIDEO_V4L2 [=n] && MEDIA_SDR_SUPPORT [=y] && USB [=y] Selected by [y]: - DVB_USB_RTL28XXU [=y] && USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && I2C [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_USB_V2 [=y] && I2C_MUX [=y] && MEDIA_SUBDRV_AUTOSELECT [=y] && MEDIA_SDR_SUPPORT [=y] WARNING: unmet direct dependencies detected for MEDIA_TUNER_E4000 Depends on [n]: (MEDIA_ANALOG_TV_SUPPORT [=y] || MEDIA_DIGITAL_TV_SUPPORT [=y] || MEDIA_RADIO_SUPPORT [=y] || MEDIA_SDR_SUPPORT [=y]) && MEDIA_SUPPORT [=y] && I2C [=y] && VIDEO_V4L2 [=n] Selected by [y]: - DVB_USB_RTL28XXU [=y] && USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && I2C [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_USB_V2 [=y] && I2C_MUX [=y] && MEDIA_SUBDRV_AUTOSELECT [=y] WARNING: unmet direct dependencies detected for MEDIA_TUNER_FC2580 Depends on [n]: (MEDIA_ANALOG_TV_SUPPORT [=y] || MEDIA_DIGITAL_TV_SUPPORT [=y] || MEDIA_RADIO_SUPPORT [=y] || MEDIA_SDR_SUPPORT [=y]) && MEDIA_SUPPORT [=y] && I2C [=y] && VIDEO_V4L2 [=n] Selected by [y]: - DVB_USB_RTL28XXU [=y] && USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && I2C [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_USB_V2 [=y] && I2C_MUX [=y] && MEDIA_SUBDRV_AUTOSELECT [=y] Detected via randconfig builds. Signed-off-by: Mauro Carvalho Chehab commit cbfd3a0c5a558bff441d39535ed5cafc862ce38a Author: Chris Wilson Date: Wed Apr 22 08:42:03 2020 +0100 drm/i915/selftests: Add request throughput measurement to perf Under ideal circumstances, the driver should be able to keep the GPU fully saturated with work. Measure how close to ideal we get under the harshest of conditions with no user payload. v2: Also measure throughput using only one thread. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200422074203.9799-1-chris@chris-wilson.co.uk commit 80300a7d5f2d7178335652f41d2e55ba898b4ec1 Author: Geert Uytterhoeven Date: Thu Apr 16 12:14:18 2020 +0200 spi: spi-mem: Fix Dual/Quad modes on Octal-capable devices Currently buswidths 2 and 4 are rejected for a device that advertises Octal capabilities. Allow these buswidths, just like is done for buswidth 2 and Quad-capable devices. Fixes: b12a084c8729ef42 ("spi: spi-mem: add support for octal mode I/O data transfer") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200416101418.14379-1-geert+renesas@glider.be Signed-off-by: Mark Brown commit b97f77baa845e779341150881bdc12971da18e52 Author: Chris Wilson Date: Thu Apr 23 09:59:39 2020 +0100 drm/i915/gt: Check carefully for an idle engine in wait-for-idle intel_gt_wait_for_idle() tries to wait until all the outstanding requests are retired and the GPU is idle. As a side effect of retiring requests, we may submit more work to flush any pm barriers, and so the wait-for-idle tries to flush the background pm work and catch the new requests. However, if the work completed in the background before we were able to flush, it would queue the extra barrier request without us noticing -- and so we would return from wait-for-idle with one request remaining. (This breaks e.g. record_default_state where we need to wait until that barrier is retired, and it may slow suspend down by causing us to wait on the background retirement worker as opposed to immediately retiring the barrier.) However, since we track if there has been a submission since the engine pm barrier, we can very quickly detect if the idle barrier is still outstanding. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1763 Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200423085940.28168-1-chris@chris-wilson.co.uk commit 36fe164d8d780f6eb93f1ffa4ab5d3e9e3e81711 Author: Chris Wilson Date: Thu Apr 23 12:53:15 2020 +0100 drm/i915/gt: Carefully order virtual_submission_tasklet During the virtual engine's submission tasklet, we take the request and insert into the submission queue on each of our siblings. This seems quite simply, and so no problems with ordering. However, the sibling execlists' submission tasklets may run concurrently with the virtual engine's tasklet, submitting the request to HW before the virtual finishes its task of telling all the siblings. If this happens, the sibling tasklet may *reorder* the ve->sibling[] array that the virtual engine tasklet is processing. This can *only* reorder within the elements already processed by the virtual engine, nevertheless the race is detected by KCSAN: [ 185.580014] BUG: KCSAN: data-race in execlists_dequeue [i915] / virtual_submission_tasklet [i915] [ 185.580054] [ 185.580076] write to 0xffff8881f1919860 of 8 bytes by interrupt on cpu 2: [ 185.580553] execlists_dequeue+0x6ad/0x1600 [i915] [ 185.581044] __execlists_submission_tasklet+0x48/0x60 [i915] [ 185.581517] execlists_submission_tasklet+0xd3/0x170 [i915] [ 185.581554] tasklet_action_common.isra.0+0x42/0x90 [ 185.581585] __do_softirq+0xc8/0x206 [ 185.581613] run_ksoftirqd+0x15/0x20 [ 185.581641] smpboot_thread_fn+0x15a/0x270 [ 185.581669] kthread+0x19a/0x1e0 [ 185.581695] ret_from_fork+0x1f/0x30 [ 185.581717] [ 185.581736] read to 0xffff8881f1919860 of 8 bytes by interrupt on cpu 0: [ 185.582231] virtual_submission_tasklet+0x10e/0x5c0 [i915] [ 185.582265] tasklet_action_common.isra.0+0x42/0x90 [ 185.582291] __do_softirq+0xc8/0x206 [ 185.582315] run_ksoftirqd+0x15/0x20 [ 185.582340] smpboot_thread_fn+0x15a/0x270 [ 185.582368] kthread+0x19a/0x1e0 [ 185.582395] ret_from_fork+0x1f/0x30 [ 185.582417] We can prevent this race by checking for the ve->request after looking up the sibling array. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200423115315.26825-1-chris@chris-wilson.co.uk commit fbc35b45f9f6a971341b9462c6e94c257e779fb5 Author: Grant Likely Date: Fri Mar 27 17:01:32 2020 +0000 Add documentation on meaning of -EPROBE_DEFER Add a bit of documentation on what it means when a driver .probe() hook returns the -EPROBE_DEFER error code, including the limitation that -EPROBE_DEFER should be returned as early as possible, before the driver starts to register child devices. Also: minor markup fixes in the same file Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Saravana Kannan Cc: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Grant Likely Link: https://lore.kernel.org/r/20200327170132.17275-1-grant.likely@arm.com Signed-off-by: Greg Kroah-Hartman commit 3275158fa52ad2a795f7f52ba4565ea92660c296 Author: Sudip Mukherjee Date: Fri Apr 3 14:43:25 2020 +0100 parport: remove use of devmodel Now that all the drivers using parallel port has been converted to use device model, there is no driver left which has devmodel as false. Remove the part of the code which expects devmodel can be false. Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-11-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit bae9defb06a781083844cafd0a359f423cd98388 Author: Sudip Mukherjee Date: Fri Apr 3 14:43:24 2020 +0100 parport: remove unused parport_register_device() All the drivers that are using parallel port has been converted to use the new device model api, and parport_register_device() is no longer used. Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-10-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6824f0ce38cb4b903a3cbf00dd528861f6c2ea7c Author: Sudip Mukherjee Date: Fri Apr 3 14:43:23 2020 +0100 parport: Add comments for parport_register_dev_model() In preparation to remove parport_register_device(), copy the comments to parport_register_dev_model() and modify the parameters according to what parport_register_dev_model() has. Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-9-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d Author: Joe Perches Date: Fri Apr 3 14:43:22 2020 +0100 parport: Standardize use of printmode Standardize the define and the uses of printmode. Miscellanea: o Add missing statement termination ; where necessary Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-8-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7b3992572f4cf66ac80dbbdf4f43b8e7fd443747 Author: Joe Perches Date: Fri Apr 3 14:43:21 2020 +0100 parport_pc: Convert DPRINTK to pr_debug Use a more common logging style. Miscellanea: o One message converted from KERN_INFO to KERN_DEBUG Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-7-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit 46aea0d41cf83690f2b376c260aa04b9e42c40d1 Author: Joe Perches Date: Fri Apr 3 14:43:20 2020 +0100 parport_mfc3: Convert DPRINTK to pr_debug Use a more common logging style. Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-6-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit 45a272bc018d86ec519fbbefae2f4b2308c0e232 Author: Joe Perches Date: Fri Apr 3 14:43:19 2020 +0100 parport_amiga: Convert DPRINTK to pr_debug Use a more common logging style. Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-5-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit 88c5cbdef8d2ec6f94701c0bacb9f90c8a7a8cd5 Author: Joe Perches Date: Fri Apr 3 14:43:18 2020 +0100 parport: daisy: Convert DPRINTK to pr_debug Use a more common logging style. Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-4-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit aa3d6e7c49e3b480aa9db0e9924736726a6f75aa Author: Joe Perches Date: Fri Apr 3 14:43:17 2020 +0100 parport: Use more comon logging styles Some of the logging can be poorly formatted because of unexpected line breaks given printks without KERN_CONT that should be pr_cont. Miscellanea: o Remove unnecessary spaces between function name and open parenthesis o Convert bare printks to pr_ where appropriate o Convert embedded function names to use %s, __func__ o Coalesce formats o Realign arguments o Use do {} while (0) in a macro and not a bare if Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-3-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit decf26f6ec25dac868782dc1751623a87d147831 Author: Joe Perches Date: Fri Apr 3 14:43:16 2020 +0100 parport: Convert printk(KERN_ to pr_( Use the more common kernel style. Miscellanea: o Coalesce formats o Realign arguments Signed-off-by: Joe Perches Reviewed-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-2-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit d98ce9fef73d74fa8b1301a9da3fb95ae0a1536f Author: Joe Perches Date: Fri Apr 3 14:43:15 2020 +0100 parport: fix if-statement empty body warnings Eliminate warnings by using pr_debug which is the more typical kernel debugging style and also enable dynamic_debug on these outputs. Miscellaneous: o A few messages were logged at KERN_INFO when enabled, now KERN_DEBUG o Convert %d/%d to %zd/%zu to avoid compilation warnings Original-patch-by: Randy Dunlap Signed-off-by: Joe Perches Acked-by: Randy Dunlap Signed-off-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20200403134325.11523-1-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman commit 45bb08de65b418959313593f527c619e102c2d57 Author: Colin Ian King Date: Thu Apr 2 12:13:41 2020 +0100 driver core: platform: remove redundant assignment to variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200402111341.511801-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit af831145158b9c03d1af0a51856d0f996e8423ab Author: Nishad Kamdar Date: Sun Apr 19 19:30:21 2020 +0530 drivers: visorbus: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header file related to Unisys visorbus configuration. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200419140017.GA7875@nishad Signed-off-by: Greg Kroah-Hartman commit 69b07ee33eb12a505d55e3e716fc7452496b9041 Author: Nishad Kamdar Date: Sun Apr 19 20:18:55 2020 +0530 debugfs: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header file related to debugfs File System support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200419144852.GA9206@nishad Signed-off-by: Greg Kroah-Hartman commit 0f605db5bdd42edfbfcac36acaf8f72cfe9ce774 Author: Waiman Long Date: Thu Apr 2 13:10:56 2020 -0400 kernfs: Change kernfs_node lockdep name to "kn->active" The kernfs_node lockdep tracking is being done on kn->active, the active reference count. The other reference count (kn->count) is not tracked by lockdep. So change the lockdep name to reflect what it is tracking. Signed-off-by: Waiman Long Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20200402171056.27871-1-longman@redhat.com Signed-off-by: Greg Kroah-Hartman commit 44b8fb6eaa7c3fb770bf1e37619cdb3902cca1fc Author: Madhuparna Bhowmik Date: Fri Apr 17 21:04:51 2020 +0530 drivers: char: tlclk.c: Avoid data race between init and interrupt handler After registering character device the file operation callbacks can be called. The open callback registers interrupt handler. Therefore interrupt handler can execute in parallel with rest of the init function. To avoid such data race initialize telclk_interrupt variable and struct alarm_events before registering character device. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Madhuparna Bhowmik Link: https://lore.kernel.org/r/20200417153451.1551-1-madhuparnabhowmik10@gmail.com Signed-off-by: Greg Kroah-Hartman commit c18c1f103503981bfbb3b9c3cdf3d2ea14f8e010 Author: Rui Feng Date: Wed Apr 15 10:37:17 2020 +0800 misc: rtsx: Improve compatibility for rts5261 Change initial clock to improve compatibility for rts5261 Signed-off-by: Rui Feng Link: https://lore.kernel.org/r/1586918237-3016-1-git-send-email-rui_feng@realsil.com.cn Signed-off-by: Greg Kroah-Hartman commit 19df2f8ea9789977c7a6c672e59de6b51b6e7662 Author: Jason Yan Date: Fri Apr 10 14:36:18 2020 +0800 sgi-xp: make some symbols static in xpc_main.c Fix the following sparse warning: drivers/misc/sgi-xp/xpc_main.c:62:22: warning: symbol 'xpc_dbg_name' was not declared. Should it be static? drivers/misc/sgi-xp/xpc_main.c:66:15: warning: symbol 'xpc_part_dbg_subname' was not declared. Should it be static? drivers/misc/sgi-xp/xpc_main.c:71:15: warning: symbol 'xpc_chan_dbg_subname' was not declared. Should it be static? drivers/misc/sgi-xp/xpc_main.c:1221:1: warning: symbol 'xpc_init' was not declared. Should it be static? drivers/misc/sgi-xp/xpc_main.c:1323:1: warning: symbol 'xpc_exit' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200410063618.27143-2-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 2a23537b3df3c452fdb3617b8bda137f1fb2eff3 Author: Jason Yan Date: Fri Apr 10 14:36:17 2020 +0800 sgi-xp: make some symbols static in xpnet.c Fix the following sparse warning: drivers/misc/sgi-xp/xpnet.c:99:19: warning: symbol 'xpnet_device' was not declared. Should it be static? drivers/misc/sgi-xp/xpnet.c:134:22: warning: symbol 'xpnet_dbg_name' was not declared. Should it be static? drivers/misc/sgi-xp/xpnet.c:138:15: warning: symbol 'xpnet_dbg_subname' was not declared. Should it be static? drivers/misc/sgi-xp/xpnet.c:143:15: warning: symbol 'xpnet' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200410063618.27143-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit dceb213ca4a7a8778786bb2eb49ade722a083fdc Author: Andrey Smirnov Date: Thu Mar 26 10:42:32 2020 -0700 ARM: vf610: report soc info via soc device The patch adds plumbing to soc device info code necessary to support Vybrid devices. Use case in mind for this is CAAM driver, which utilizes said API. Signed-off-by: Andrey Smirnov Cc: Lucas Stach Cc: Chris Healy Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-imx@nxp.com Tested-by: Chris Healy Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit ff847781049c37dff9ad4af2bf2d7aad02622f96 Author: Al Viro Date: Tue Feb 18 15:43:52 2020 -0500 pstore: switch to copy_from_user() don't bother trying to do bulk access_ok() Signed-off-by: Al Viro commit daa98831dddc80c52e70b31921dffe493ced22b5 Author: Al Viro Date: Tue Feb 18 15:40:40 2020 -0500 firewire: switch ioctl_queue_iso to use of copy_from_user() no point trying to do access_ok() for all those __copy_from_user() at once. Signed-off-by: Al Viro commit 9e306ba3a9299fc0348d2345e4cfdb39b77a8a27 Author: Colin Ian King Date: Thu Apr 2 11:50:00 2020 +0100 binderfs: remove redundant assignment to pointer ctx The pointer ctx is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20200402105000.506296-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 7a1c4f28ead628d44773ff90ae2414f8e7ea31ad Author: Tang Bin Date: Sat Apr 11 22:51:51 2020 +0800 binderfs: Fix binderfs.c selftest compilation warning Fix missing braces compilation warning in the ARM compiler environment: drivers/android/binderfs.c: In function 'binderfs_fill_super': drivers/android/binderfs.c:650:9: warning: missing braces around initializer [-Wmissing-braces] struct binderfs_device device_info = { 0 }; drivers/android/binderfs.c:650:9: warning: (near initialization for ‘device_info.name’) [-Wmissing-braces] Acked-by: Christian Brauner Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200411145151.5576-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit 324efc704352ad728ba5aa77dd81e4f35bebc3c2 Author: Mauro Carvalho Chehab Date: Thu Apr 23 16:46:07 2020 +0200 media: platform: fix VIA_CAMERA dependencies As detected by a randconfig: WARNING: unmet direct dependencies detected for VIDEO_OV7670 Depends on [n]: MEDIA_SUPPORT [=y] && I2C [=y] && VIDEO_V4L2 [=n] Selected by [y]: - VIDEO_VIA_CAMERA [=y] && MEDIA_SUPPORT [=y] && MEDIA_PLATFORM_SUPPORT [=y] && V4L_PLATFORM_DRIVERS [=y] && FB_VIA [=y] There's a missing dependency on VIDEO_V4L2 for VIA_CAMERA. Signed-off-by: Mauro Carvalho Chehab commit fecde876bc20399baaa7b6bb1eb767b383771858 Author: Anson Huang Date: Fri Mar 27 18:55:59 2020 +0800 arm64: defconfig: Enable CONFIG_PINCTRL_IMX8DXL by default Enable CONFIG_PINCTRL_IMX8DXL by default to support i.MX8DXL pinctrl driver. Signed-off-by: Anson Huang Acked-by: Linus Walleij Signed-off-by: Shawn Guo commit 76ec4aea9fd8117f064caa63ee6f7fbcb70eeb2c Author: Colin Ian King Date: Thu Apr 23 09:39:22 2020 +0100 ASoC: fsl_easrc: fix spelling mistake "prefitler" -> "prefilter" There is a spelling mistake in a deb_dbg message, fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200423083922.8159-1-colin.king@canonical.com Signed-off-by: Mark Brown commit cade2f59e7ae3d1ccec9c1e0e971308ca6a74296 Author: Andy Shevchenko Date: Wed Apr 22 16:04:43 2020 +0300 ASoC: Intel: Skylake: Replace guid_copy() with import_guid() There is a specific API to treat raw data as GUID, i.e. import_guid(). Use it instead of guid_copy() with explicit casting. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200422130443.38815-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit f5f27b79eab80de0287c243a22169e4876b08d5e Author: Franck LENORMAND Date: Thu Mar 26 00:00:05 2020 +0200 firmware: imx: scu: Fix corruption of header The header of the message to send can be changed if the response is longer than the request: - 1st word, the header is sent - the remaining words of the message are sent - the response is received asynchronously during the execution of the loop, changing the size field in the header - the for loop test the termination condition using the corrupted header It is the case for the API build_info which has just a header as request but 3 words in response. This issue is fixed storing the header locally instead of using a pointer on it. Fixes: edbee095fafb (firmware: imx: add SCU firmware driver support) Signed-off-by: Franck LENORMAND Reviewed-by: Leonard Crestez Signed-off-by: Leonard Crestez Cc: stable@vger.kernel.org Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo commit 15665c062b8c529d162479b306af23bc37bb6a12 Author: Zou Wei Date: Wed Apr 22 10:58:50 2020 +0800 misc: xilinx_sdfec: Use memdup_user() as a cleanup Fix coccicheck warning which recommends to use memdup_user(). This patch fixes the following coccicheck warnings: drivers/misc/xilinx_sdfec.c:652:8-15: WARNING opportunity for memdup_user Reported-by: Hulk Robot Signed-off-by: Zou Wei Link: https://lore.kernel.org/r/1587524330-119776-1-git-send-email-zou_wei@huawei.com Signed-off-by: Greg Kroah-Hartman commit 8419759f98adb5a538a40efaf66ebe9d136bc3d4 Author: Hu Haowen Date: Mon Mar 30 17:45:19 2020 +0800 misc: mic: correct a typo The word "Dont" is incorrect and should be replaced with "Don't". Signed-off-by: Hu Haowen Link: https://lore.kernel.org/r/20200330094519.17299-1-xianfengting221@163.com Signed-off-by: Greg Kroah-Hartman commit c56851576b1809f6523e48c1e5da6e3becfd57cb Author: Gustavo A. R. Silva Date: Wed Apr 1 13:28:55 2020 -0500 lkdtm: bugs: Fix spelling mistake Fix spelling mistake s/Intentially/Intentionally Signed-off-by: Gustavo A. R. Silva Acked-by: Kees Cook Link: https://lore.kernel.org/r/20200401182855.GA16253@embeddedor Signed-off-by: Greg Kroah-Hartman commit 593816fa2f357313a1ea584f95912d0761516583 Author: Adam Ford Date: Tue Mar 24 09:43:23 2020 -0500 arm64: dts: imx: Add Beacon i.MX8m-Mini development kit Beacon Embeddedworks is launching a development kit based on the i.MX8M Mini SoC. The kit consists of a System on Module (SOM) + baseboard. The SOM has the SoC, eMMC, and Ethernet. The baseboard has an wm8962 audio CODEC, a single USB OTG, and three USB host ports. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit d99c22eabee45f40ca44b877a1adde028f14b6b4 Author: Stephane Eranian Date: Wed Apr 22 08:50:38 2020 -0700 perf record: Add num-synthesize-threads option To control degree of parallelism of the synthesize_mmap() code which is scanning /proc/PID/task/PID/maps and can be time consuming. Mimic perf top way of handling the option. If not specified will default to 1 thread, i.e. default behavior before this option. On a desktop computer the processing of /proc/PID/task/PID/maps isn't slow enough to warrant parallel processing and the thread creation has some cost - hence the default of 1. On a loaded server with >100 cores it is possible to see synthesis times in the order of seconds and in this case having the option is desirable. As the processing is a synchronization point, it is legitimate to worry if Amdahl's law will apply to this patch. Profiling with this patch in place: https://lore.kernel.org/lkml/20200415054050.31645-4-irogers@google.com/ shows: ... - 32.59% __perf_event__synthesize_threads - 32.54% __event__synthesize_thread + 22.13% perf_event__synthesize_mmap_events + 6.68% perf_event__get_comm_ids.constprop.0 + 1.49% process_synthesized_event + 1.29% __GI___readdir64 + 0.60% __opendir ... That is the processing is 1.49% of execution time and there is plenty to make parallel. This is shown in the benchmark in this patch: https://lore.kernel.org/lkml/20200415054050.31645-2-irogers@google.com/ Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 1 Average synthesis took: 127729.000 usec (+- 3372.880 usec) Average num. events: 21548.600 (+- 0.306) Average time per event 5.927 usec Number of synthesis threads: 2 Average synthesis took: 88863.500 usec (+- 385.168 usec) Average num. events: 21552.800 (+- 0.327) Average time per event 4.123 usec Number of synthesis threads: 3 Average synthesis took: 83257.400 usec (+- 348.617 usec) Average num. events: 21553.200 (+- 0.327) Average time per event 3.863 usec Number of synthesis threads: 4 Average synthesis took: 75093.000 usec (+- 422.978 usec) Average num. events: 21554.200 (+- 0.200) Average time per event 3.484 usec Number of synthesis threads: 5 Average synthesis took: 64896.600 usec (+- 353.348 usec) Average num. events: 21558.000 (+- 0.000) Average time per event 3.010 usec Number of synthesis threads: 6 Average synthesis took: 59210.200 usec (+- 342.890 usec) Average num. events: 21560.000 (+- 0.000) Average time per event 2.746 usec Number of synthesis threads: 7 Average synthesis took: 54093.900 usec (+- 306.247 usec) Average num. events: 21562.000 (+- 0.000) Average time per event 2.509 usec Number of synthesis threads: 8 Average synthesis took: 48938.700 usec (+- 341.732 usec) Average num. events: 21564.000 (+- 0.000) Average time per event 2.269 usec Where average time per synthesized event goes from 5.927 usec with 1 thread to 2.269 usec with 8. This isn't a linear speed up as not all of synthesize code has been made parallel. If the synthesis time was about 10 seconds then using 8 threads may bring this down to less than 4. Signed-off-by: Stephane Eranian Reviewed-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Tony Jones Cc: yuzhoujian Link: http://lore.kernel.org/lkml/20200422155038.9380-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dbd660e6b2884b864d2642d930a163d3bcebe4be Author: Tommi Rantala Date: Thu Apr 23 14:53:40 2020 +0300 perf test session topology: Fix data path Commit 2d4f27999b88 ("perf data: Add global path holder") missed path conversion in tests/topology.c, causing the "Session topology" testcase to "hang" (waits forever for input from stdin) when doing "ssh $VM perf test". Can be reproduced by running "cat | perf test topo", and crashed by replacing cat with true: $ true | perf test -v topo 40: Session topology : --- start --- test child forked, pid 3638 templ file: /tmp/perf-test-QPvAch incompatible file format incompatible file format (rerun with -v to learn more) free(): invalid pointer test child interrupted ---- end ---- Session topology: FAILED! Committer testing: Reproduced the above result before the patch and after it is back working: # true | perf test -v topo 41: Session topology : --- start --- test child forked, pid 19374 templ file: /tmp/perf-test-YOTEQg CPU 0, core 0, socket 0 CPU 1, core 1, socket 0 CPU 2, core 2, socket 0 CPU 3, core 3, socket 0 CPU 4, core 0, socket 0 CPU 5, core 1, socket 0 CPU 6, core 2, socket 0 CPU 7, core 3, socket 0 test child finished with 0 ---- end ---- Session topology: Ok # Fixes: 2d4f27999b88 ("perf data: Add global path holder") Signed-off-by: Tommi Rantala Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Link: http://lore.kernel.org/lkml/20200423115341.562782-1-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo commit 295615f5e5a56558bb1502f4fefad5569ec1209c Author: Maksim Karasev Date: Tue Apr 21 16:25:48 2020 +0300 platform/x86: touchscreen_dmi: Add info for the ONDA V891 v5 tablet Add touchscreen info for the ONDA V891 v5 tablet. Signed-off-by: Maksim Karasev Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 5a707af10da95a53a55011a612e69063491020d4 Author: Andy Shevchenko Date: Fri Apr 21 16:36:06 2017 +0300 platform/x86: wmi: Describe function parameters There are few parameters that are not described properly. Fill the gap by describing them properly in kernel doc format. Signed-off-by: Andy Shevchenko commit 6701cc8f70710826a4de69cbb1f66c52db2c36ac Author: Andy Shevchenko Date: Thu Apr 23 15:30:15 2020 +0300 platform/x86: wmi: Fix indentation in some cases There is no need to split lines as they perfectly fit 80 character limit. Signed-off-by: Andy Shevchenko commit f9dffc1417130a2d465e2edaf6663d99738792a3 Author: Andy Shevchenko Date: Fri Apr 21 16:36:06 2017 +0300 platform/x86: wmi: Replace UUID redefinitions by their originals There are types and helpers that are redefined with old names. Convert the WMI library to use those types and helpers directly. Signed-off-by: Andy Shevchenko commit 197ba86fdc888dc0d3d6b89b402c9c6851d4c6fb Author: Jin Yao Date: Mon Apr 20 22:54:17 2020 +0800 perf stat: Improve runtime stat for interval mode For interval mode, the metric is printed after the '#' character if it exists. But it's not calculated by the counts generated in this interval. See the following examples: root@kbl-ppc:~# perf stat -M CPI -I1000 --interval-count 2 # time counts unit events 1.000422803 764,809 inst_retired.any # 2.9 CPI 1.000422803 2,234,932 cycles 2.001464585 1,960,061 inst_retired.any # 1.6 CPI 2.001464585 4,022,591 cycles The second CPI should not be 1.6 (4,022,591/1,960,061 is 2.1) root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2 # time counts unit events 1.000429493 2,869,311 cycles 1.000429493 816,875 instructions # 0.28 insn per cycle 2.001516426 9,260,973 cycles 2.001516426 5,250,634 instructions # 0.87 insn per cycle The second 'insn per cycle' should not be 0.87 (5,250,634/9,260,973 is 0.57). The current code uses a global variable 'rt_stat' for tracking and updating the std dev of runtime stat. Unlike the counts, 'rt_stat' is not reset for interval. While the counts are reset for interval. perf_stat_process_counter() { if (config->interval) init_stats(ps->res_stats); } So for interval mode, the 'rt_stat' variable should be reset too. This patch resets 'rt_stat' before read_counters(), so the runtime stat is only calculated by the counts generated in this interval. With this patch: root@kbl-ppc:~# perf stat -M CPI -I1000 --interval-count 2 # time counts unit events 1.000420924 2,408,818 inst_retired.any # 2.1 CPI 1.000420924 5,010,111 cycles 2.001448579 2,798,407 inst_retired.any # 1.6 CPI 2.001448579 4,599,861 cycles root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2 # time counts unit events 1.000428555 2,769,714 cycles 1.000428555 774,462 instructions # 0.28 insn per cycle 2.001471562 3,595,904 cycles 2.001471562 1,243,703 instructions # 0.35 insn per cycle Now the second 'insn per cycle' and CPI are calculated by the counts generated in this interval. Signed-off-by: Jin Yao Acked-by: Jiri Olsa Tested-By: Kajol Jain Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200420145417.6864-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f1c0268a4871a80c0ec78142eeb1fe0556e898a Author: Jason Yan Date: Fri Apr 3 15:13:25 2020 +0800 tty: hvc: remove hvcs_driver_string No users of hvcs_driver_string, remove it. This fixes the following gcc warning: drivers/tty/hvc/hvcs.c:199:19: warning: ‘hvcs_driver_string’ defined but not used [-Wunused-const-variable=] static const char hvcs_driver_string[] ^~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Acked-by: Jiri Slaby Link: https://lore.kernel.org/r/20200403071325.3721-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 44da03628b841635b157ea8d3fd46626783fe70d Author: Fabio Estevam Date: Thu Apr 16 12:34:53 2020 -0300 serial: fsl_lpuart: Change DMA failure messages to debug level Currently the following messages are seen when booting i.MX8QXP: fsl-lpuart 5a060000.serial: DMA tx channel request failed, operating without tx DMA (-19) fsl-lpuart 5a060000.serial: DMA rx channel request failed, operating without rx DMA (-19) It is not really useful to have such messages on every boot, so change them to debug level instead. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20200416153453.18825-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit 63552502b274fe8acf4e2aafd93f58e9ad42acd6 Author: Jiri Slaby Date: Fri Apr 17 12:59:58 2020 +0200 tty: rocket, remove unneeded variable num_chan in register_PCI is used only as an alias for ports_per_aiop. So drop num_chan and use ports_per_aiop directly. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20200417105959.15201-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 992a60ed0d5e312ce9a485c9e12097ac82ae4b3e Author: K V, Abhilash Date: Thu Apr 23 16:20:58 2020 +0300 usb: typec: ucsi: register with power_supply class With this change the UCSI device will show up in /sys/class/power_supply/. The following values are exported: - online - usb_type - voltage_min - voltage_max - voltage_now - current_max - current_now Once a PD-capable type-C power source is connected to the system, GET_PDOS UCSI command is used to query all source capabilities. Request data object (RDO) is used to get current values. Signed-off-by: K V, Abhilash Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200423132058.6972-7-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4dbc6a4ef06d6a79ff91be6fc2e90f8660031ce0 Author: K V, Abhilash Date: Thu Apr 23 16:20:57 2020 +0300 usb: typec: ucsi: save power data objects in PD mode When connected to a PD-capable power-source, read & save all partner power data objects (PDOs) by using GET_PDOS UCSI command. Also, save the current power contract in request data object (RDO) for that connector. Signed-off-by: K V, Abhilash Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200423132058.6972-6-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e2f38ff2f41fb88e3b5e81bbf51aeabe4a0d1188 Author: K V, Abhilash Date: Thu Apr 23 16:20:56 2020 +0300 usb: typec: ucsi: Correct bit-mask for CCI Bit 0 is reserved in CCI (Command Status & Connector Change Indicator) register. So, change bit-mask for connector number field to 7..1 instead of 7..0. There would be no functional change since we were anyways right-shifing by 1 bit. Signed-off-by: K V, Abhilash Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200423132058.6972-5-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0db592b1a3b7b513e16920a9cf8545e6732189c9 Author: K V, Abhilash Date: Thu Apr 23 16:20:55 2020 +0300 usb: typec: ucsi: replace magic numbers Replace magic numbers with macros in trace.h. Signed-off-by: K V, Abhilash Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200423132058.6972-4-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a0d4618788f26bd6f31f80a00f922f1c4bc66457 Author: K V, Abhilash Date: Thu Apr 23 16:20:54 2020 +0300 usb: typec: ucsi: Workaround for missed op_mode change EC firmware on Dell XPS & Latitude series does not set "Power Operation Mode Change" bit in "Connector Status change" field of MESSAGE IN Data while transitioning from type-C current to PD mode. Instead the "Negotiated Power Level Change" bit is set when the "Power Operation Mode" field shows the correct mode (i.e. PD). This patch adds a check for this bit also, to trigger an update of power operation mode in class driver, while handling GET_CONNECTOR_STATUS command. Signed-off-by: K V, Abhilash Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200423132058.6972-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 91813ef8da12fad01ee4aadd173504feefe60293 Author: Mayank Rana Date: Thu Apr 23 16:20:53 2020 +0300 usb: typec: ucsi: set USB data role when partner type is power cable/ufp Currently UCSI framework doesn't update USB data role when partner type is reported as power cable or power cable with ufp connected. This results into no USB host mode functionality. This is valid usecase where user wants to use legacy type c power cable with type a female connector to attach different USB devices like mouse, thumb drive etc. Hence update USB data role as host when partner type is reported as power cable or power cable with ufp connected. Signed-off-by: Mayank Rana Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20200423132058.6972-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5c330a7cefccbf91fb04a163defd80ae7cad61a9 Author: Jason Yan Date: Fri Apr 17 15:31:37 2020 +0800 usb: gadget: udc: remove unused 'driver_desc' Fix the following gcc warning: drivers/usb/gadget/udc/gr_udc.c:51:19: warning: ‘driver_desc’ defined but not used [-Wunused-const-variable=] static const char driver_desc[] = DRIVER_DESC; ^~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200417073137.39968-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 361ff6c10f4b08179185c5175f8a36565c432d74 Author: Nishad Kamdar Date: Sun Apr 19 18:06:03 2020 +0530 USB: phy: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to Physical Layer USB driver configuration. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200419123559.GA4505@nishad Signed-off-by: Greg Kroah-Hartman commit d28e617144c52fc64f9ffbc97024d93a98a94493 Author: Nishad Kamdar Date: Sun Apr 19 18:27:10 2020 +0530 usb: renesas_usbhs: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to Renesas USBHS Controller Drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20200419125705.GA5172@nishad Signed-off-by: Greg Kroah-Hartman commit 59b4e0cd4d8f2dd86ad9d0dbdc3cdf2ff05bf403 Author: Nishad Kamdar Date: Sun Apr 19 18:46:57 2020 +0530 USB: Storage: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB Storage driver configuration. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200419131653.GA6611@nishad Signed-off-by: Greg Kroah-Hartman commit b99bb85a31a6bfacfbf281ab809cd9109762df52 Author: Nishad Kamdar Date: Sun Apr 19 19:00:55 2020 +0530 USB: typec: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header file related to USB Type-C support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Reviewed-by Heikki Krogerus Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200419133051.GA7154@nishad Signed-off-by: Greg Kroah-Hartman commit cfee546166583fa1a51f657e2f84d866a3552710 Author: Jason Yan Date: Mon Apr 20 12:26:22 2020 +0800 usb: pci-quirks: use true,false for bool variables Fix the following coccicheck warning: drivers/usb/host/pci-quirks.c:532:1-27: WARNING: Assignment of 0/1 to bool variable drivers/usb/host/pci-quirks.c:208:1-20: WARNING: Assignment of 0/1 to bool variable drivers/usb/host/pci-quirks.c:232:2-21: WARNING: Assignment of 0/1 to bool variable drivers/usb/host/pci-quirks.c:235:2-21: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200420042622.18564-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit a6cd27e9b594ccf4bf525969c1077f2dbe515476 Author: Alan Stern Date: Wed Apr 22 16:20:19 2020 -0400 USB: core: Replace an empty statement with a debug message This patch adds a dev_dbg() message to usb_create_sysfs_intf_files(). The message is not expected ever to appear; it's real purpose is to satisfy the __must_check attribute on device_create_file() without triggering a compiler warning about an empty statement. In fact we don't really care if the sysfs attribute file doesn't get created. The interface string descriptor is purely informational and hardly ever present. Suggested-by: NeilBrown Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.2004221618500.11262-100000@iolanthe.rowland.org Signed-off-by: Greg Kroah-Hartman commit 27b0387b4221f076447d6738fdeafd8b9f437869 Author: Jason Yan Date: Tue Apr 21 11:39:45 2020 +0800 usb/early: remove unused including Fix the following versioncheck warning: drivers/usb/early/xhci-dbc.c:21:1: unused including Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200421033945.27703-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 7527810573436f00e582d3d5ef2eb3c027c98d7d Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:13 2020 +0200 Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type VMBus version 4.1 and later support the CHANNELMSG_MODIFYCHANNEL(22) message type which can be used to request Hyper-V to change the vCPU that a channel will interrupt. Introduce the CHANNELMSG_MODIFYCHANNEL message type, and define the vmbus_send_modifychannel() function to send CHANNELMSG_MODIFYCHANNEL requests to the host via a hypercall. The function is then used to define a sysfs "store" operation, which allows to change the (v)CPU the channel will interrupt by using the sysfs interface. The feature can be used for load balancing or other purposes. One interesting catch here is that Hyper-V can *not* currently ACK CHANNELMSG_MODIFYCHANNEL messages with the promise that (after the ACK is sent) the channel won't send any more interrupts to the "old" CPU. The peculiarity of the CHANNELMSG_MODIFYCHANNEL messages is problematic if the user want to take a CPU offline, since we don't want to take a CPU offline (and, potentially, "lose" channel interrupts on such CPU) if the host is still processing a CHANNELMSG_MODIFYCHANNEL message associated to that CPU. It is worth mentioning, however, that we have been unable to observe the above mentioned "race": in all our tests, CHANNELMSG_MODIFYCHANNEL requests appeared *as if* they were processed synchronously by the host. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-11-parri.andrea@gmail.com Reviewed-by: Michael Kelley [ wei: fix conflict in channel_mgmt.c ] Signed-off-by: Wei Liu commit d570aec0f2154e1bfba14ffd0df164a185e363b5 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:12 2020 +0200 Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug init_vp_index() may access the cpu_online_mask mask via its calls of cpumask_of_node(). Make sure to protect these accesses with a cpus_read_lock() critical section. Also, remove some (hardcoded) instances of CPU(0) from init_vp_index() and replace them with VMBUS_CONNECT_CPU. The connect CPU can not go offline, since Hyper-V does not provide a way to change it. Finally, order the accesses of target_cpu from init_vp_index() and hv_synic_cleanup() by relying on the channel_mutex; this is achieved by moving the call of init_vp_index() into vmbus_process_offer(). Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-10-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 8ef4c4abbbcdcd9d4bc0fd9454df03e6dac24b73 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:11 2020 +0200 Drivers: hv: vmbus: Remove the unused HV_LOCALIZED channel affinity logic The logic is unused since commit 509879bdb30b8 ("Drivers: hv: Introduce a policy for controlling channel affinity"). This logic assumes that a channel target_cpu doesn't change during the lifetime of a channel, but this assumption is incompatible with the new functionality that allows changing the vCPU a channel will interrupt. Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-9-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 240ad77cb50d9f0a961fcb0f21e67939cf7a9c04 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:10 2020 +0200 PCI: hv: Prepare hv_compose_msi_msg() for the VMBus-channel-interrupt-to-vCPU reassignment functionality The current implementation of hv_compose_msi_msg() is incompatible with the new functionality that allows changing the vCPU a VMBus channel will interrupt: if this function always calls hv_pci_onchannelcallback() in the polling loop, the interrupt going to a different CPU could cause hv_pci_onchannelcallback() to be running simultaneously in a tasklet, which will break. The current code also has a problem in that it is not synchronized with vmbus_reset_channel_cb(): hv_compose_msi_msg() could be accessing the ring buffer via the call of hv_pci_onchannelcallback() well after the time that vmbus_reset_channel_cb() has finished. Fix these issues as follows. Disable the channel tasklet before entering the polling loop in hv_compose_msi_msg() and re-enable it when done. This will prevent hv_pci_onchannelcallback() from running in a tasklet on a different CPU. Moreover, poll by always calling hv_pci_onchannelcallback(), but check the channel callback function for NULL and invoke the callback within a sched_lock critical section. This will prevent hv_compose_msi_msg() from accessing the ring buffer after vmbus_reset_channel_cb() has acquired the sched_lock spinlock. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Cc: Lorenzo Pieralisi Cc: Andrew Murray Cc: Bjorn Helgaas Cc: Link: https://lore.kernel.org/r/20200406001514.19876-8-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 9403b66e6161130ebae7e55a97491c84c1ad6f9f Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:09 2020 +0200 Drivers: hv: vmbus: Use a spin lock for synchronizing channel scheduling vs. channel removal Since vmbus_chan_sched() dereferences the ring buffer pointer, we have to make sure that the ring buffer data structures don't get freed while such dereferencing is happening. Current code does this by sending an IPI to the CPU that is allowed to access that ring buffer from interrupt level, cf., vmbus_reset_channel_cb(). But with the new functionality to allow changing the CPU that a channel will interrupt, we can't be sure what CPU will be running the vmbus_chan_sched() function for a particular channel, so the current IPI mechanism is infeasible. Instead synchronize vmbus_chan_sched() and vmbus_reset_channel_cb() by using the (newly introduced) per-channel spin lock "sched_lock". Move the test for onchannel_callback being NULL before the "switch" control statement in vmbus_chan_sched(), in order to not access the ring buffer if the vmbus_reset_channel_cb() has been completed on the channel. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-7-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 238d2ed8f7d1b1ca0c13334bb8197a42654af946 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:08 2020 +0200 hv_utils: Always execute the fcopy and vss callbacks in a tasklet The fcopy and vss callback functions could be running in a tasklet at the same time they are called in hv_poll_channel(). Current code serializes the invocations of these functions, and their accesses to the channel ring buffer, by sending an IPI to the CPU that is allowed to access the ring buffer, cf. hv_poll_channel(). This IPI mechanism becomes infeasible if we allow changing the CPU that a channel will interrupt. Instead modify the callback wrappers to always execute the fcopy and vss callbacks in a tasklet, thus mirroring the solution for the kvp callback functions adopted since commit a3ade8cc474d8 ("HV: properly delay KVP packets when negotiation is in progress"). This will ensure that the callback function can't run on two CPUs at the same time. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-6-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit ac5047671758ad4be9f93898247b3a8b6dfde4c7 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:07 2020 +0200 hv_netvsc: Disable NAPI before closing the VMBus channel vmbus_chan_sched() might call the netvsc driver callback function that ends up scheduling NAPI work. This "work" can access the channel ring buffer, so we must ensure that any such work is completed and that the ring buffer is no longer being accessed before freeing the ring buffer data structure in the channel closure path. To this end, disable NAPI before calling vmbus_close() in netvsc_device_remove(). Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Acked-by: Stephen Hemminger Cc: "David S. Miller" Cc: Link: https://lore.kernel.org/r/20200406001514.19876-5-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 8b6a877c060ed6b86878fe66c7c6493a6054cf23 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:06 2020 +0200 Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels When Hyper-V sends an interrupt to the guest, the guest has to figure out which channel the interrupt is associated with. Hyper-V sets a bit in a memory page that is shared with the guest, indicating a particular "relid" that the interrupt is associated with. The current Linux code then uses a set of per-CPU linked lists to map a given "relid" to a pointer to a channel structure. This design introduces a synchronization problem if the CPU that Hyper-V will interrupt for a certain channel is changed. If the interrupt comes on the "old CPU" and the channel was already moved to the per-CPU list of the "new CPU", then the relid -> channel mapping will fail and the interrupt is dropped. Similarly, if the interrupt comes on the new CPU but the channel was not moved to the per-CPU list of the new CPU, then the mapping will fail and the interrupt is dropped. Relids are integers ranging from 0 to 2047. The mapping from relids to channel structures can be done by setting up an array with 2048 entries, each entry being a pointer to a channel structure (hence total size ~16K bytes, which is not a problem). The array is global, so there are no per-CPU linked lists to update. The array can be searched and updated by loading from/storing to the array at the specified index. With no per-CPU data structures, the above mentioned synchronization problem is avoided and the relid2channel() function gets simpler. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-4-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit b9fa1b8797dcb579a9642a502769e1a5c3adc0d2 Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:05 2020 +0200 Drivers: hv: vmbus: Don't bind the offer&rescind works to a specific CPU The offer and rescind works are currently scheduled on the so called "connect CPU". However, this is not really needed: we can synchronize the works by relying on the usage of the offer_in_progress counter and of the channel_mutex mutex. This synchronization is already in place. So, remove this unnecessary "bind to the connect CPU" constraint and update the inline comments accordingly. Suggested-by: Dexuan Cui Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200406001514.19876-3-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 8a857c55420f29da4fc131adc22b12d474c48f4c Author: Andrea Parri (Microsoft) Date: Mon Apr 6 02:15:04 2020 +0200 Drivers: hv: vmbus: Always handle the VMBus messages on CPU0 A Linux guest have to pick a "connect CPU" to communicate with the Hyper-V host. This CPU can not be taken offline because Hyper-V does not provide a way to change that CPU assignment. Current code sets the connect CPU to whatever CPU ends up running the function vmbus_negotiate_version(), and this will generate problems if that CPU is taken offine. Establish CPU0 as the connect CPU, and add logics to prevents the connect CPU from being taken offline. We could pick some other CPU, and we could pick that "other CPU" dynamically if there was a reason to do so at some point in the future. But for now, #defining the connect CPU to 0 is the most straightforward and least complex solution. While on this, add inline comments explaining "why" offer and rescind messages should not be handled by a same serialized work queue. Suggested-by: Dexuan Cui Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20200406001514.19876-2-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit 52c7803f9bd4b1f0ac6e2e3e6051415198cc06bd Author: Vitaly Kuznetsov Date: Mon Apr 6 12:43:26 2020 +0200 Drivers: hv: check VMBus messages lengths VMBus message handlers (channel_message_table) receive a pointer to 'struct vmbus_channel_message_header' and cast it to a structure of their choice, which is sometimes longer than the header. We, however, don't check that the message is long enough so in case hypervisor screws up we'll be accessing memory beyond what was allocated for temporary buffer. Previously, we used to always allocate and copy 256 bytes from message page to temporary buffer but this is hardly better: in case the message is shorter than we expect we'll be trying to consume garbage as some real data and no memory guarding technique will be able to identify an issue. Introduce 'min_payload_len' to 'struct vmbus_channel_message_table_entry' and check against it in vmbus_on_msg_dpc(). Note, we can't require the exact length as new hypervisor versions may add extra fields to messages, we only check that the message is not shorter than we expect. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200406104326.45361-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit b0a284dc65b401a508dc2c5ed7d465884220f607 Author: Vitaly Kuznetsov Date: Mon Apr 6 12:43:15 2020 +0200 Drivers: hv: make sure that 'struct vmbus_channel_message_header' compiles correctly Strictly speaking, compiler is free to use something different from 'u32' for 'enum vmbus_channel_message_type' (e.g. char) but it doesn't happen in real life, just add a BUILD_BUG_ON() guardian. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200406104316.45303-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit 5cc415001bca8fe0e3f0ee6d58a953a314dd9751 Author: Vitaly Kuznetsov Date: Mon Apr 6 12:41:52 2020 +0200 Drivers: hv: avoid passing opaque pointer to vmbus_onmessage() vmbus_onmessage() doesn't need the header of the message, it only uses it to get to the payload, we can pass the pointer to the payload directly. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200406104154.45010-4-vkuznets@redhat.com Signed-off-by: Wei Liu commit a276463b7aeb6186e7e4315cccb032773fb31b5d Author: Vitaly Kuznetsov Date: Mon Apr 6 12:41:51 2020 +0200 Drivers: hv: allocate the exact needed memory for messages When we need to pass a buffer with Hyper-V message we don't need to always allocate 256 bytes for the message: the real message length is known from the header. Change 'struct onmessage_work_context' to make it possible to not over-allocate. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200406104154.45010-3-vkuznets@redhat.com Signed-off-by: Wei Liu commit ac0f7d42584125dab8039e60ab4ade48cc2db61c Author: Vitaly Kuznetsov Date: Mon Apr 6 12:41:50 2020 +0200 Drivers: hv: copy from message page only what's needed Hyper-V Interrupt Message Page (SIMP) has 16 256-byte slots for messages. Each message comes with a header (16 bytes) which specifies the payload length (up to 240 bytes). vmbus_on_msg_dpc(), however, doesn't look at the real message length and copies the whole slot to a temporary buffer before passing it to message handlers. This is potentially dangerous as hypervisor doesn't have to clean the whole slot when putting a new message there and a message handler can get access to some data which belongs to a previous message. Note, this is not currently a problem because all message handlers are in-kernel but eventually we may e.g. get this exported to userspace. Note also, that this is not a performance critical path: messages (unlike events) represent rare events so it doesn't really matter (from performance point of view) if we copy too much. Fix the issue by taking into account the real message length. The temporary buffer allocated by vmbus_on_msg_dpc() remains fixed size for now. Also, check that the supplied payload length is valid (<= 240 bytes). Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20200406104154.45010-2-vkuznets@redhat.com Signed-off-by: Wei Liu commit 33b22172452f05c351fd2fa24c28d2e76c7b0692 Author: Paolo Bonzini Date: Fri Apr 17 10:24:18 2020 -0400 KVM: x86: move nested-related kvm_x86_ops to a separate struct Clean up some of the patching of kvm_x86_ops, by moving kvm_x86_ops related to nested virtualization into a separate struct. As a result, these ops will always be non-NULL on VMX. This is not a problem: * check_nested_events is only called if is_guest_mode(vcpu) returns true * get_nested_state treats VMXOFF state the same as nested being disabled * set_nested_state fails if you attempt to set nested state while nesting is disabled * nested_enable_evmcs could already be called on a CPU without VMX enabled in CPUID. * nested_get_evmcs_version was fixed in the previous patch Signed-off-by: Paolo Bonzini commit 25091990ef289a5962b5bddd8c68de3f691c9e3c Author: Paolo Bonzini Date: Fri Apr 17 10:34:29 2020 -0400 KVM: eVMCS: check if nesting is enabled In the next patch nested_get_evmcs_version will be always set in kvm_x86_ops for VMX, even if nesting is disabled. Therefore, check whether VMX (aka nesting) is available in the function, the caller will not do the check anymore. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 56083bdf67c78030f11cdaed5b2b54959a329b02 Author: Paolo Bonzini Date: Fri Apr 17 10:32:53 2020 -0400 KVM: x86: check_nested_events is never NULL Both Intel and AMD now implement it, so there is no need to check if the callback is implemented. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 2e0eb483c058dd013be8e3d0ec1767be531485a2 Author: Atish Patra Date: Wed Apr 15 12:54:18 2020 -0700 efi/libstub: Move arm-stub to a common file Most of the arm-stub code is written in an architecture independent manner. As a result, RISC-V can reuse most of the arm-stub code. Rename the arm-stub.c to efi-stub.c so that ARM, ARM64 and RISC-V can use it. This patch doesn't introduce any functional changes. Signed-off-by: Atish Patra Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20200415195422.19866-2-atish.patra@wdc.com Signed-off-by: Ard Biesheuvel commit bf42304b55f59af5e71c86e46291705023dce62e Author: Oscar Carter Date: Mon Apr 20 17:52:46 2020 +0200 staging: vt6656: Use fls instead of for loop in vnt_update_top_rates Replace the for loops of the vnt_update_top_rates function by the fls function. The purpose of the two for loops is to find the most significant bit set in a range of bits. So, they can be replace by the fls function (find last set) with a previous mask to define the range. This way avoid the iteration over unnecessary for loops. The header "linux/bits.h" can be remove as it is included in the header "linux/bitops.h". Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200420155246.4925-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 9f8c9f4a2e6f23fc6eeecd305bfb40ddc91e0369 Author: Oscar Carter Date: Sat Apr 18 15:45:53 2020 +0200 staging: vt6656: Refactor the vnt_ofdm_min_rate function Replace the for loop by a ternary operator whose condition is an AND bitmask against the priv->basic_rates variable. The purpose of the for loop was to check if any of bits from RATE_54M to RATE_6M was set, but it's not necessary to check every individual bit. The same result can be achieved using only one single mask which comprises all the commented bits. This way avoid the iteration over an unnecessary for loop. Also change the return type to bool because it's the type that this function returns. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200418134553.6415-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit e3436ce60cf5f5eaedda2b8c622f69feb97595e2 Author: Xiyu Yang Date: Thu Apr 23 13:15:40 2020 +0800 staging: gasket: Fix mapping refcnt leak when register/store fails gasket_sysfs_register_store() invokes get_mapping(), which returns a reference of the specified gasket_sysfs_mapping object to "mapping" with increased refcnt. When gasket_sysfs_register_store() returns, local variable "mapping" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of gasket_sysfs_register_store(). When gasket_dev is NULL, the function forgets to decrease the refcnt increased by get_mapping(), causing a refcnt leak. Fix this issue by calling put_mapping() when gasket_dev is NULL. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Link: https://lore.kernel.org/r/1587618941-13718-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Greg Kroah-Hartman commit 57a66838e1494cd881b7f4e110ec685736e8e3ca Author: Xiyu Yang Date: Thu Apr 23 13:14:55 2020 +0800 staging: gasket: Fix mapping refcnt leak when put attribute fails gasket_sysfs_put_attr() invokes get_mapping(), which returns a reference of the specified gasket_sysfs_mapping object to "mapping" with increased refcnt. When gasket_sysfs_put_attr() returns, local variable "mapping" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one path of gasket_sysfs_put_attr(). When mapping attribute is unknown, the function forgets to decrease the refcnt increased by get_mapping(), causing a refcnt leak. Fix this issue by calling put_mapping() when put attribute fails due to unknown attribute. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Link: https://lore.kernel.org/r/1587618895-13660-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Greg Kroah-Hartman commit 5975b85ae244dd607965518129e816e4072bc976 Author: Jason Yan Date: Mon Apr 20 21:34:16 2020 +0800 staging: mt7621-pinctrl: Use correct pointer type argument for sizeof Fix the following coccicheck warning: drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c:223:14-36: WARNING: Use correct pointer type argument for sizeof Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200420133416.3087-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit e955a071b9b3e6b634b7ceda64025bfbd6529dcc Author: realwakka Date: Tue Apr 21 00:40:09 2020 +0900 staging: qlge: replace deprecated apis pci_dma_* Replace legacy/depreacted pci_dma_* functions to new dma_* functions. Also replace PCI_DMA_* macro to DMA* macro. Signed-off-by: realwakka Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20200420154009.21161-1-realwakka@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0eb79fd1e91118a55f028b85b3ae45873db9e639 Author: Mathieu Dolmen Date: Sun Apr 19 14:57:12 2020 +0200 staging: qlge: cleanup indent in qlge_main.c Cleanup indentation style in qlge_main.c. Fix 2 warnings found by checkpatch.pl. Signed-off-by: Mathieu Dolmen Link: https://lore.kernel.org/r/20200419125712.27506-1-mathieu.dolmen@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3436accadc3f179a108071df552a6b82542523b1 Author: Malcolm Priestley Date: Sun Apr 19 14:43:46 2020 +0100 staging: vt6656: Move vnt_get_frame_time and vnt_get_phy_field to rxtx These functions are only used by rxtx so move them and their arrays used with them abbreviating the function description. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/2a4fd665-2fe1-f1ad-1e9a-1b01f698ea79@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6f21cb793ce209e4e2ae020e06e0a39b9a8bf2c0 Author: Malcolm Priestley Date: Sun Apr 19 12:20:52 2020 +0100 staging: vt6656: call vnt_update_pre_ed_threshold from vnt_config. vnt_update_pre_ed_threshold needs to be updated more often so call from vnt_config where it updated on any of config changes. It must have maximum sensitivity when the device is off channel or idle. Remove all the other calls in scanning and bss. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/1b00c112-347c-b0bb-61ed-a874ee448ff8@gmail.com Signed-off-by: Greg Kroah-Hartman commit 72d55ebb50e1ebc636ff70d9130254ea82c0312e Author: Malcolm Priestley Date: Sun Apr 19 11:26:06 2020 +0100 staging: vt6656: Move firmware functions into main_usb. The firmware function are not that complicated so move them into main_usb as static functions in callers visibility Firmware definitions moved to device.h and MODULE_FIRMWARE move to below module_usb_driver. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/7b384871-826b-9365-e3ed-5717ecefd31c@gmail.com Signed-off-by: Greg Kroah-Hartman commit 370730894bece52b2bbd4eb727fbb39840cc0e14 Author: Denis Straghkov Date: Wed Apr 22 00:25:25 2020 +0300 Staging: rtl8723bs: rtw_wlan_util: Add size check of SSID IE Add size check of SSID information element in incoming 802.11 frames, to prevent memcpy() of IE in array bssid->Ssid.Ssid, with size more than 32 bytes. Signed-off-by: Denis Straghkov Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20200421212525.24962-1-d.straghkov@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 1bc355cff2c56d4435413b881dfcdcf753430693 Author: YueHaibing Date: Tue Apr 21 10:41:45 2020 +0800 staging: rtl8723bs: remove unused variable 'pregistrypriv' drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function HalRxAggr8723BSdio: drivers/staging/rtl8723bs/hal/sdio_halinit.c:547:24: warning: variable pregistrypriv set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200421024145.43576-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman commit 5c9e154cff660d7abc23ab08b897dfdbe783afab Author: Jason Yan Date: Fri Apr 17 15:34:39 2020 +0800 staging: rtl8723bs: remove defined but not used 'dB_Invert_Table' Fix the following gcc warning: drivers/staging/rtl8723bs/hal/odm.c:10:18: warning: ‘dB_Invert_Table’ defined but not used [-Wunused-const-variable=] static const u16 dB_Invert_Table[8][12] = { ^~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200417073439.41888-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit ce6921b8e017b79dc9a300435843d2614b6cb705 Author: Jason Yan Date: Fri Apr 17 15:33:10 2020 +0800 staging: rtl8723bs: remove some variables in hal_btcoex.c Fix the following gcc warning: drivers/staging/rtl8723bs/hal/hal_btcoex.c:45:26: warning: ‘ioStaString’ defined but not used [-Wunused-const-variable=] static const char *const ioStaString[] = { ^~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:38:26: warning: ‘h2cStaString’ defined but not used [-Wunused-const-variable=] static const char *const h2cStaString[] = { ^~~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:33:26: warning: ‘BtLinkRoleString’ defined but not used [-Wunused-const-variable=] static const char *const BtLinkRoleString[] = { ^~~~~~~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:23:26: warning: ‘BtSpecString’ defined but not used [-Wunused-const-variable=] static const char *const BtSpecString[] = { ^~~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:15:26: warning: ‘BtProfileString’ defined but not used [-Wunused-const-variable=] static const char *const BtProfileString[] = { ^~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200417073310.40893-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 8372e3227f80a440afe780922968d2f3d0df3a8d Author: Imre Deak Date: Wed Apr 22 15:34:40 2020 +0300 drm/i915/icl: Fix timeout handling during TypeC AUX power well enabling Fix the check for when an AUX power well enabling timeout is expected on a legacy TypeC port. Fixes: 89e01caac641 ("drm/i915: Use single set of AUX powerwell ops for gen11+") Cc: Matt Roper Cc: José Roberto de Souza Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200422123440.19522-1-imre.deak@intel.com commit 6ac29cc5af297098b7066e0eb3b6b9732a532f59 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:11 2020 +0200 staging: wfx: drop unused attribute 'join_complete_status' The field join_complete_status is never read. Drop it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 4b815a9da5e24a86264cedad15ee6c2d94716c8f Author: Jérôme Pouiller Date: Mon Apr 20 18:03:10 2020 +0200 staging: wfx: drop unused enum wfx_state In former code, the field wvif->state was more or less redundant with vif->type. With the lasts change it has become unused. It is now time to drop it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit cf24a82bd265d5ffff92faeda030eba7af2b2a59 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:09 2020 +0200 staging: wfx: simplify wfx_remove_interface() In wfx_remove_interface(), the current code differentiate AP and Station cases. However, it is not necessary. In all cases, the only important thing is the call to hif_reset(). We can use the same code to support all cases. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 06efad5808aa0db3528eca4b8faee4013ffd787b Author: Jérôme Pouiller Date: Mon Apr 20 18:03:08 2020 +0200 staging: wfx: drop useless checks in wfx_do_unjoin() The callers of wfx_do_unjoin() already take care of vif state. Therefore, it is not necessary to take care of the status of the interface. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a2ed058918886b7a749ba884efc231b0977b3159 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:07 2020 +0200 staging: wfx: drop protection for asynchronous join during scan In former code (before the inclusion of the driver in mainline kernel), hif_join() could run asynchronously. When a join request was in progress, it was forbidden to launch hif_scan(). Now, hif_join() is always run synchronously. There is no more reasons to keep a protection against this case. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9da38fd5a90655c308e59398d169f4d3efd16377 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:06 2020 +0200 staging: wfx: keys are kept during whole firmware life Keys sent to the firmware are never reset. So, it is not necessary to re-upload them after hif_reset(). Thus, it is no more necessary to keep a copy of the keys in struct wfx_dev. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7a44644c9379eb1bbb03ce8054a0b0179f470146 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:05 2020 +0200 staging: wfx: introduce wfx_set_default_unicast_key() Currently code handle WEP keys manually. It is far easier to use the set_default_unicast_key() callback provided by mac80211. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 28502e02e27ab45ba948bec970be95dc771a5175 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:04 2020 +0200 staging: wfx: drop useless update of field basic_rate_set Basic Rates are already set by hif_join(). hif_join() is also able to manage possible changes after association. Firmware also allows to change the Basic Rates with hif_set_association_mode() but it does not bring anything in our case. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7b0360e56f10e4bec46124ba7b0eaf8ec9837992 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:03 2020 +0200 staging: wfx: simplify hif_set_bss_params() The structure hif_req_set_bss_params come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_req_set_bss_params() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 2e885b18b1d96383814366cfe681b2f2db2833c0 Author: Jérôme Pouiller Date: Mon Apr 20 18:03:02 2020 +0200 staging: wfx: field operational_rate_set is ignored by firmware The field bss_params.operational_rate_set is ignore by the firmware. It is not necessary to send it. This change greatly simplify wfx_join_finalize(). It is no more necessary to get sta and it allow to save a RCU. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit d4620087d2ebc36077b0cd9d49773dcc29089fab Author: Jérôme Pouiller Date: Mon Apr 20 18:03:01 2020 +0200 staging: wfx: dual CTS is never necessary Dual CTS is only necessary when sending/receiving STBC data. However, the chip does not support STBC, so it is never necessary to enable double CTS. We can simplify the code. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 537000acc32363fb03cd638881bc0b0fa319ab5f Author: Jérôme Pouiller Date: Mon Apr 20 18:03:00 2020 +0200 staging: wfx: also fix network parameters for IBSS networks Current code skip some configuration during joining an IBSS network. Indeed, it seems that this configuration is not used in IBSS. However, it would be harmless to set them. In add, we would prefer to keep association processes for ad-hoc and managed networks the closest as possible. It also ensures the values of internal parameters of the firmware. Therefore, apply them unconditionally. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 988cf07bb9a0f3c296e38124ab7e7f5d2f2d28a4 Author: Jérôme Pouiller Date: Mon Apr 20 18:02:59 2020 +0200 staging: wfx: handle firmware events synchronously Currently, events from firmware are handled in a work queue with a complex event queue mechanism. It is probably overkill since there is only two events to handle: bss_loss and CQM events. Handling these events synchronously is sufficient. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 5c442b6a39e112539144abbfd5e75fe486c3dfab Author: Jérôme Pouiller Date: Mon Apr 20 18:02:58 2020 +0200 staging: wfx: drop useless attribute 'bss_params' Since wfx_bss_params_work() does not exist anymore, there is no more reason to keep a copy of bss_params in struct wfx_dev. A local instance in wfx_join_finalize() is sufficient. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 5a0af69888488d2b873f55bcba4cd17b162e4bea Author: Jérôme Pouiller Date: Mon Apr 20 18:02:57 2020 +0200 staging: wfx: use ieee80211_beacon_loss() provided by mac80211 The firmware is able to filter beacons and send a notification if one or multiple beacons are not received. Note that it send this notification only once. Only if it receive beacons gain, it send a new notification. Currently, the driver handle the connection loss itself (see wfx_cqm_bssloss_sm()). It send null frames and watch the answers. This patch fixes all this mess: - settle firmware to send a notification on the first beacon loss - call ieee80211_beacon_loss() and let mac80211 handle all the process - since we do have notification for each beacon loss, add a period task that call ieee80211_beacon_loss() until we receive "REGAIN" notification. Thus, we can drop the ugly wfx_cqm_bssloss_sm() and wfx_bss_params_work(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 13fe5a59b3c79e03cea3f7232a05e79bc5aad70a Author: Jérôme Pouiller Date: Mon Apr 20 18:02:56 2020 +0200 staging: wfx: simplify the check if the the device is associated Firmware dislikes the driver enables PS when it is not yet associated. The current check for that condition is more complex than necessary. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200420160311.57323-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 58d66175d4615097f3832e5733c64b9a3536ccec Author: Zou Wei Date: Thu Apr 23 14:52:24 2020 +0800 EDAC/thunderx: Make symbols static Make a couple of symbols static, as reported by sparse. [ bp: Massage. ] Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/1587624744-97240-1-git-send-email-zou_wei@huawei.com commit 325518e9b743686f471e7a4ef617b57c91386795 Author: Christoph Hellwig Date: Wed Apr 22 18:53:08 2020 +0200 x86/mm: Use pgprotval_t in protval_4k_2_large() and protval_large_2_4k() Use the proper type for "raw" page table values. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200422170116.GA28345@lst.de commit ebae33c3f6cee978f60ad48371258a03f9440691 Author: Clément Péron Date: Mon Apr 20 15:00:18 2020 +0200 arm64: dts: allwinner: h6: Enable CPU opp tables for Orange Pi 3 Enable CPU opp tables for Orange Pi 3. This needs to change the CPU regulator max voltage to fit the OPP table. Also add the ramp-delay information to avoid any out of spec running as the regulator is slower at reaching the voltage requested compare to the PLL reaching the frequency. There is no such information for AXP805 but similar PMIC (AXP813) has a DVM (Dynamic Voltage scaling Management) ramp rate equal to 2500uV/us. Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit 67533f873ad7e2a4af1a1ed47f03f501d6c770df Author: Clément Péron Date: Mon Apr 20 15:00:17 2020 +0200 arm64: dts: allwinner: h6: Enable CPU opp tables for Beelink GS1 Enable CPU opp tables for Beelink GS1. This needs to change the CPU regulator max voltage to fit the OPP table. Also add the ramp-delay information to avoid any out of spec running as the regulator is slower at reaching the voltage requested compare to the PLL reaching the frequency. There is no such information for AXP805 but similar PMIC (AXP813) has a DVM (Dynamic Voltage scaling Management) ramp rate equal to 2500uV/us. Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit 905434e0b544ee220bcce6da16a6857c0274b8ba Author: Ondrej Jirman Date: Mon Apr 20 15:00:15 2020 +0200 arm64: dts: allwinner: h6: Add CPU Operating Performance Points table Add an Operating Performance Points table for the CPU cores to enable Dynamic Voltage & Frequency Scaling on the H6. Signed-off-by: Ondrej Jirman Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit 9f8a93b742e99dd93ca888161909e7245f1c7269 Author: Ondrej Jirman Date: Mon Apr 20 15:00:14 2020 +0200 arm64: dts: allwinner: h6: Add thermal trip points/cooling map This enables passive cooling by down-regulating CPU voltage and frequency. Signed-off-by: Ondrej Jirman Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit de17a37896e1ad9e17ebd5274a50c33e18c9cb90 Author: Christoph Hellwig Date: Wed Apr 8 17:27:45 2020 +0200 x86/mm: Unexport __cachemode2pte_tbl Exporting the raw data for a table is generally a bad idea. Move cachemode2protval() out of line given that it isn't really used in the fast path, and then mark __cachemode2pte_tbl static. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200408152745.1565832-5-hch@lst.de commit d073569363d9f076a568ce8c31250d332ccf33ce Author: Christoph Hellwig Date: Wed Apr 8 17:27:44 2020 +0200 x86/mm: Cleanup pgprot_4k_2_large() and pgprot_large_2_4k() Make use of lower level helpers that operate on the raw protection values to make the code a little easier to understand, and to also avoid extra conversions in a few callers. [ Qian: Fix a wrongly placed bracket in the original submission. Reported and fixed by Qian Cai . Details in second Link: below. ] Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200408152745.1565832-4-hch@lst.de Link: https://lkml.kernel.org/r/1ED37D02-125F-4919-861A-371981581D9E@lca.pw commit 4e1d96306d8b8790bc157afa233dc2a2be86ccf5 Merge: 710c451fbcb2 2de8c02349f0 Author: Greg Kroah-Hartman Date: Thu Apr 23 11:06:48 2020 +0200 Merge tag 'iio-for-5.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First set of new IIO device support, features and cleanup for the 5.8 cycle Usual mix of new drivers, new support in old drivers and lots of minor cleanup. Yaml conversions also continue to trickle in (plenty more to go!) New device support * ad7476 - Add ad7091 support (ID only) * ad9467 - New driver for this 200/250 MSPS adi-axi-adc and SPI attached ADC. * adi-axi-adc - New driver to support ADIs generic AXI ADC IP core, used to provide high speed interfaces to ADCs (JESD204B/C or parallel interfaces). Usually paired with a device using a slow configuration interface (spi etc) Includes DT bindings and some fixes for fpga headers. * bmg160 - Add support for BMI088 (ID only) * max1241 - New driver for this ADC. * st_sensors - Add support for LIS2HH12 accelerometer * sx9310 - New driver supporting sx9310 and sx9311 proximity sensors. Yaml DT binding conversions * rockchip-saradc (including adding some missing parts) * stm32-dac * tsl2563 * vcnl4000 Features * st_lsm6dsx - Add LIS3MDL as a possible sensor hub device. * vcnl4000 - Add new concept of near level (from DT) to provide to userspace which often needs to have some calibrated concept of 'near'. Cleanups, minor fixes etc. * core - Use snprintf for functions where strings are built and there is potential for overflow. - Correct docs to indicate mlock should not be used directly by drivers. - Fix up accidental dropping of a patch to use bitmap_zalloc. - Stop allowing enabling of buffers with no channels enabled. - Drop unused 'stufftoread' from iio_buffer. - Drop scan_el_attrs form iio_buffer as unused. - Reorder sanity checks in __iio_device_register to fail earlier. - Drop all the devm_ runregister / free functions from IIO as they were never used and encourage poor design. * dma-buffer - Tidy up includes. * dma-engine-buffer - Provide dev-managed allocator. - Fix an issue with printing a size_t * cross subsystem (kxsd9, bmg160, mpu3050, bmi160, mpu6050, bmc150) - Replace some unnecessary casts of error ptrs and whilst there. use the %pe printf parameter to print them in a more useful fashion. * cross subsystem - Drop casts in calls to regmap_bulk_read as they make no sense. - Use devm_platform_ioremap_resource to reduce boilerplate. - Fix typos in Analog Devices. * counters/104-quad - Add Syed Nayyar Waris as an additional maintainer. * ad7476 - Generate CONVST signal internally rather than requiring external trigger. Add sysfs read back as can now do so. - use devm_add_action_or_reset to tidy up error and remove handling. * ad7793 - Switch to read_avail from explicit attribute. Mostly done to avoid confusing people with a - sign (without surounding spaces) that was correct but checkpatch didn't like. * adis library - Add missing newlines at end of error messages. * adis16400 - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR. * adis16460 - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR. * ad_sigma_delta - Move some channel definitions into individual drivers to avoid having to deal with complex options. * ak8974 - Silence an error on deffered probe. * bmp280 - Harden against IRQ before registration. - Convert to read_avail instead of opencoding the equivalent. - Explicitly mark GPIO as optional. - Cleanup casts. - Remove line breaks from strings. * htts221 - Replace direct access to platform_data with dev_get_platdata(). - Use device properties rather than device tree ones to allow ACPI probing. - Casting cleanups. * intel_mrfld_adc - Don't use unaligned accessor for aligned data. * isl29125 - Reorder buer pre and post hooks to allow for coming core rework. * ltc2983 - Remove comp to bool. * max1363 - Stop using mlock from the iio_dev directly in favour of a local lock with clearly defined scope. * max30100 - Use generic device properties to allow ACPI probe. * mpu6050 - Convert to i2c_new_client_device. - Add debugfs register access. * st_lsm6dsx - Provide means of configuring full scale on slave device if supported. - Drop include of st_sensors header to get one value. Its not otherwise used by this driver. * st-sensors - Replace direct access to platform_data with dev_get_platdata(). - Casting cleanups. - Avoid splitting strings. * st_uvis25 - Casting cleanups. * tsl2563 - Typo fix. * tsl2772 - scnprintf in a non obvious string building usecase. Note also 'fixes' a wrong calculation of remaining space that couldn't actually cause any trouble as there was lots of room. * xilinx-xadc - Fix Lars-Peter spelling his own name wrong :) + additional typos. * tag 'iio-for-5.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (101 commits) iio: magnetometer: ak8974: Silence deferred-probe error Documentation: ABI: document IIO in_proximity_nearlevel file iio: vcnl4000: Export near level property for proximity sensor dt-bindings: iio: light: vcnl4000: Add proximity-near-level dt-bindings: iio: Introduce common properties for iio sensors dt-bindings: iio: vcnl4000: convert bindings to YAML format iio: Fix misspellings of "Analog Devices" iio: light: isl29125: fix iio_triggered_buffer_{predisable,postenable} positions iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource iio: adc: at91-adc: Use devm_platform_ioremap_resource iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource iio:light:ltr501: Drop unnecessary cast of parameter in regmap_bulk_read iio:magn:mmc35240: Drop unnecessary casts of val parameter in regmap_bulk* iio:imu:mpu6050: Tidy up parameters to regmap_bulk functions. iio:chemical:bme680: Tidy up parameters to regmap_bulk_read iio:chemical:atlas-sensor: Drop unnecessary explicit casts in regmap_bulk_read calls iio:accel:mxc4005: Drop unnecessary explicit casts in regmap_bulk_read calls iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver iio: buffer: drop devm_iio_kfifo_free() API call iio: buffer: drop devm_iio_hw_consumer_free() API call ... commit db474931df3eb54edbf761b8c98ba517bdf24463 Author: Leonid Ravich Date: Thu Apr 23 00:09:18 2020 +0300 dmaengine: ioat: adding missed issue_pending to timeout handler completion timeout might trigger unnesesery DMA engine hw reboot in case of missed issue_pending() . Acked-by: Dave Jiang Signed-off-by: Leonid Ravich Link: https://lore.kernel.org/r/1587589761-32690-3-git-send-email-leonid.ravich@dell.com Signed-off-by: Vinod Koul commit 2baedcb6a637ba6a5d626a58cf37aecd6db16ef0 Author: Leonid Ravich Date: Thu Apr 23 00:09:17 2020 +0300 dmaengine: ioat: remove unnesesery double complition timer modification. removing unnecessary mod_timer from timeout handler incase of ioat_cleanup_preamble() is true for cleaner code Acked-by: Dave Jiang Signed-off-by: Leonid Ravich Link: https://lore.kernel.org/r/1587589761-32690-2-git-send-email-leonid.ravich@dell.com Signed-off-by: Vinod Koul commit 5a87c506ed7690091327be752a858634b88f6034 Author: Leonid Ravich Date: Thu Apr 23 00:09:16 2020 +0300 dmaengine: ioat: removing duplicate code from timeout handler moving duplicate code from timeout error handling to common function. Acked-by: Dave Jiang Signed-off-by: Leonid Ravich Link: https://lore.kernel.org/r/1587589761-32690-1-git-send-email-leonid.ravich@dell.com Signed-off-by: Vinod Koul commit a6e26648e6e2b1d4024e7f827bb63dcc9880bb36 Author: Lubomir Rintel Date: Sun Apr 19 18:49:12 2020 +0200 dmaengine: mmp_tdma: Remove the MMP_SRAM dependency A generic SRAM will driver for Device Tree enabled platforms will do as well. The non-DT drivers that use mmp_tdma to transfer audio samples to and from the audio SRAM should depend on MMP_SRAM themselves. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200419164912.670973-8-lkundrak@v3.sk Signed-off-by: Vinod Koul commit baed6b34ceea87bc6e88efd84a92c44559f2dc6c Author: Lubomir Rintel Date: Sun Apr 19 18:49:11 2020 +0200 dmaengine: mmp_tdma: Fill in slave capabilities This makes dma_get_slave_caps() work with the device so that it could actually be used with soc-generic-dmaengine-pcm. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200419164912.670973-7-lkundrak@v3.sk Signed-off-by: Vinod Koul commit 4719d4b71562182dcb86401898b0ee205ea28ee1 Author: Lubomir Rintel Date: Sun Apr 19 18:49:10 2020 +0200 dmaengine: mmp_tdma: Log an error if channel is in wrong state Let's log an error if the channel can't be prepared because it is in an unexpected state. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200419164912.670973-6-lkundrak@v3.sk Signed-off-by: Vinod Koul commit 0d8173f297dfedf1c11c7b6f9b1ec512c06d59a7 Author: Lubomir Rintel Date: Sun Apr 19 18:49:07 2020 +0200 dmaengine: mmp_tdma: Drop "mmp_tdma: from error messages Drop a redundant "mmp_tdma:" from some error messages. The dev_err() appends mostly the same thing for us: [ 120.756530] mmp-tdma d42a0800.adma: mmp_tdma: unknown burst size. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20200419164912.670973-3-lkundrak@v3.sk Signed-off-by: Vinod Koul commit 57d8df68eb53cc15e5bdfc14bfb28a18543109eb Author: Mika Westerberg Date: Fri Sep 14 12:58:37 2018 +0300 thunderbolt: Add support for Intel Tiger Lake Tiger Lake integrated Thunderbolt/USB4 controller is quite close to Intel Ice Lake. By default it is still using firmware based connection manager so we can use most of the Ice Lake flows in Tiger Lake as well. We check if the firmware connection manager is running and in that case use it, otherwise use the software based connection manager. Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat commit 0c98be8118221a8d3de572740f29dd02ed9686a5 Author: Ingo Molnar Date: Wed Apr 22 12:32:05 2020 +0200 objtool: Constify arch_decode_instruction() Mostly straightforward constification, except that WARN_FUNC() needs a writable pointer while we have read-only pointers, so deflect this to WARN(). Acked-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20200422103205.61900-4-mingo@kernel.org commit bc359ff2f6f3e8a9df38c39017e269bc442357c7 Author: Ingo Molnar Date: Wed Apr 22 12:32:04 2020 +0200 objtool: Rename elf_read() to elf_open_read() 'struct elf *' handling is an open/close paradigm, make sure the naming matches that: elf_open_read() elf_write() elf_close() Acked-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20200422103205.61900-3-mingo@kernel.org commit 894e48cada64ec384873fad4fe1b0d0c7de31a29 Author: Ingo Molnar Date: Wed Apr 22 12:32:03 2020 +0200 objtool: Constify 'struct elf *' parameters In preparation to parallelize certain parts of objtool, map out which uses of various data structures are read-only vs. read-write. As a first step constify 'struct elf' pointer passing, most of the secondary uses of it in find_symbol_*() methods are read-only. Also, while at it, better group the 'struct elf' handling methods in elf.h. Acked-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20200422103205.61900-2-mingo@kernel.org commit 4bdbff4da40584ec2225bb429b7c66ad54d19cda Author: Mauro Carvalho Chehab Date: Wed Apr 22 22:53:12 2020 +0200 media: tuners: Kconfig: add some missing VIDEO_V4L2 dependencies There are three tuners that depend on some functions inside V4L2 core: $ git grep -l -E 'v4l2_[0-9a-zA-Z_]+\(' drivers/media/tuners/ drivers/media/tuners/e4000.c drivers/media/tuners/fc2580.c drivers/media/tuners/msi001.c Make them dependent of VIDEO_V4L2, as otherwise, this would happen: on x86_64: CONFIG_VIDEO_V4L2=m CONFIG_MEDIA_TUNER_E4000=y ld: drivers/media/tuners/e4000.o: in function `e4000_remove': e4000.c:(.text+0x34): undefined reference to `v4l2_ctrl_handler_free' ld: drivers/media/tuners/e4000.o: in function `e4000_probe': e4000.c:(.text+0x16c1): undefined reference to `v4l2_ctrl_handler_init_class' ld: e4000.c:(.text+0x16eb): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1731): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1762): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x178c): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x17d6): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1804): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x182e): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1878): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x18a6): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x18d0): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x191a): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1948): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x1972): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x19a6): undefined reference to `v4l2_ctrl_handler_free' ld: e4000.c:(.text+0x1a2a): undefined reference to `v4l2_i2c_subdev_init' Reported-by: Randy Dunlap Acked-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab commit 2fb75ceaf71a4a198fc67b984aa95527c993fa1a Author: Christophe JAILLET Date: Sat Apr 11 18:07:50 2020 +0200 remoteproc: Add missing '\n' in log messages Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 791c13b709dd ("remoteproc: Fix NULL pointer dereference in rproc_virtio_notify") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200411160750.32573-1-christophe.jaillet@wanadoo.fr Signed-off-by: Bjorn Andersson commit 33467ac3c8dc80575e1b158e78d0c30ab33c1b08 Author: Loic Pallardy Date: Thu Apr 16 19:20:35 2020 -0500 remoteproc: Add prepare and unprepare ops On some SoC architecture, it is needed to enable HW like clock, bus, regulator, memory region... before loading co-processor firmware. This patch introduces prepare and unprepare ops to execute platform specific function before firmware loading and after stop execution. Signed-off-by: Loic Pallardy Signed-off-by: Suman Anna Reviewed-by: Bjorn Andersson Reviewed-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200417002036.24359-2-s-anna@ti.com Signed-off-by: Bjorn Andersson commit b1fcc5702a41ad5d3c22ae4720e38f6d4beec576 Author: Mike Leach Date: Wed Apr 15 21:12:30 2020 +0100 arm64: dts: qcom: msm8916: Add CTI options Adds system and CPU bound CTI definitions for Qualcom msm8916 platform (Dragonboard DB410C). System CTIs 2-11 are omitted as no information available at present. Signed-off-by: Mike Leach Reviewed-by: Mathieu Poirier Acked-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20200415201230.15766-1-mike.leach@linaro.org Signed-off-by: Bjorn Andersson commit e29ff72b779426c7fe462ead93c7ad77fe562935 Author: Clement Leger Date: Wed Apr 22 11:30:17 2020 +0200 remoteproc: remove rproc_elf32_sanity_check Since checks are present in the remoteproc elf loader before calling da_to_va, loading a elf64 will work on 32bits flavors of kernel. Indeed, if a segment size is larger than what size_t can hold, the loader will return an error so the functionality is equivalent to what exists today. Acked-by: Suman Anna Signed-off-by: Clement Leger Link: https://lore.kernel.org/r/20200422093017.10985-1-cleger@kalray.eu Signed-off-by: Bjorn Andersson commit 8347784d6f5fae467e82522029ab1290673c50d6 Author: Wen Gong Date: Wed Apr 22 16:47:19 2020 +0800 ath10k: drop the TX packet which size exceed credit size for sdio sdio chip use DMA buffer to receive TX packet from ath10k, and it has limitation of each buffer, if the packet size exceed the credit size, it will trigger error in firmware. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422084719.3479-1-wgong@codeaurora.org commit aac392d8553f3fcc8dd42fc8f7af8eb0593ce9ca Author: Maharaja Kennadyrajan Date: Wed Apr 22 00:28:32 2020 +0530 ath10k: Fix the invalid tx/rx chainmask configuration The driver is allowing the invalid tx/rx chainmask configuration (other than 1,3,7,15) set by the user. It causes the firmware crash due to the invalid chainmask values. Hence, reject the invalid chainmask values in the driver by not sending the pdev set command to the firmware. Tested hardware: QCA9888 Tested firmware: 10.4-3.10-00047 Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587495512-29813-1-git-send-email-mkenna@codeaurora.org commit 75e69fb11b40ba1256b14f943c7050682c1f5458 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:07 2020 +0800 rtw88: 8723d: initialize mac/bb/rf basic functions Implement rtw_chip_ops::phy_set_param and ::mac_init to initialize mac/bb/rf, and they are used during interface up. The procedure contains power on sequence registers, download firmware, load predefined parameters, mac/bb/rf specific register and etc. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-9-yhchuang@realtek.com commit d91277de23310c497212c2a2d2313e126cc3f2b8 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:06 2020 +0800 rtw88: 8723d: Organize chip TX/RX FIFO TX FIFO size is 32k and it was divided into 256 pages with 128 bytes. A boundary is used to split pages into two parts, head part is used to store TX packets coming from host, and tail part is reserved for special purposes, such as beacon packet, null data packet and so on. The TX packets coming from host have many categories, such as VO, VI, BE, BK, MG and etc. When going into head part of TX FIFO, they are classified to four priority queue named low, normal, high and extra priority queues. Each priority queue occupies predefined number of page, if a certain priority queue is full, TX packet will store into PUB priority queue. Similarly, RX FIFO is 16k and split into two parts, head part is used to store RX packets, and tail part is 128 bytes and used to store report. Thus, we fill this boundary to register as well. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-8-yhchuang@realtek.com commit ba9f0d1b8d9debf2e2d83db01d3b8f63fb75d9d5 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:05 2020 +0800 rtw88: 8723d: implement set_tx_power_index ops The txagc table is used to map rate_id and txagc register address and mask, and ops set_tx_power_index uses this table to write TX power to corresponding registers. Since 8723D is a 1x1 2.4G 11n chip, only CCK, OFDM and HT_MCS 0-7 are listed in the table. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-7-yhchuang@realtek.com commit 7907b52de08aeb27cea05bd3a2c825658f91f051 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:04 2020 +0800 rtw88: 8723d: 11N chips don't support H2C queue H2C queue is used to send command to firmware. Since 8723D doesn't support this queue, this commit check wlan_cpu flag to avoid to set H2C related registers. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-6-yhchuang@realtek.com commit fd9ead385102652b43f628ca700810d343c52437 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:03 2020 +0800 rtw88: decompose while(1) loop of power sequence polling command The power polling command is one kind of power sequence commands. It's used to check hardware situation, and subsequent comamnds will be executed if hardware is ready. A special case is PCIE must toggle BIT_PFM_WOWL and try again if first try is failed. In order to reduce indentation to understand the code easier, move polling part to a separate function. Then, the 'while (1)...loop' is replaced by two statements to do first try and retry. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-5-yhchuang@realtek.com commit 4e223a5f5342fab01ccebf87714401f559dcc791 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:02 2020 +0800 rtw88: 8723d: Add mac power-on/-off function The mac power-on flow consists of three steps: 1. pre_sys_cfg (Before switching power state) 2. power_switch (Switching power state) 3. init_sys_cfg (Settings after swtiching power state) When switching power state, driver will load and parse the power sequence tables. For 8723D devices, the logics for parsing are most same except for the polling function. 8723D devices need to toggle BIT_PFM_WOWL twice. The settings after power state is switched for 8723D devices are quite different with other devices, extract a legacy function for them. For power-off flow, 8723D devices have the same logic with existing chips. But warning printed if we run power-off sequence in power-off state: rtw_pci 0000:03:00.0: failed to poll offset=0x5f8 mask=0xff value=0x0 The scenario is user do 'ifconfig up' that will run power-on sequence to bring up and then run power-off sequence to enter idle (IEEE80211_CONF_IDLE). Then, user do 'ifconfig down' that will run power-off sequence again, and the warning is shown. Original code check power-on state to avoid to run power-on sequence twice, and this commit extends to check both power-on and power-off states. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-4-yhchuang@realtek.com commit e5f57ad06adec1dcbfe69f45792a8b9dd4798664 Author: Ping-Ke Shih Date: Wed Apr 22 11:46:01 2020 +0800 rtw88: no need to send additional information to legacy firmware The firmware of 11AC devices need more information to support more offload functions, such as IQK. And 11N devices such as 8723D does not support offload these function in firmware, there is no need to send these additional information to firmware when it comes to 11N devices. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-3-yhchuang@realtek.com commit 15d2fcc6b2dea46986e55cd3808c0dbb480a6c8d Author: Ping-Ke Shih Date: Wed Apr 22 11:46:00 2020 +0800 rtw88: add legacy firmware download for 8723D devices The WLAN CPU of 8723D device is different from others, add legacy firmware download function for it. A new variable wlan_cpu is used to decide which firmware download function we should use. Legacy firmware file contains 32 bytes header including version and subversion. When downloading to wlan cpu, header is excluded. Firmware is downloaded via beacon queue to reserved page that is a part of TX buffer. Since 11N WLAN CPU uses different control registers, this patch introduces related control registers. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200422034607.28747-2-yhchuang@realtek.com commit 2b7aadd3b9e17e8b81eeb8d9cc46756ae4658265 Author: Raz Bouganim Date: Tue Apr 21 15:28:05 2020 +0300 wlcore: Adding suppoprt for IGTK key in wlcore driver This patch adding support for new cipher suite - AES-CMAC in wlcore driver. This patch is required for support PMF/WPA3 connection to install IGTK key. Signed-off-by: Raz Bouganim Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587472085-755-1-git-send-email-r-bouganim@ti.com commit 23a6da79fe8b7f0b5725b40126a7b0638c016ef3 Author: Alexey Minnekhanov Date: Fri Apr 17 04:26:30 2020 +0300 arm64: dts: qcom: Add Xiaomi Redmi Note 7 (lavender) This adds the initial device tree support for Xiaomi Redmi Note 7 (codename lavender) phone. It is based on SDM660 SoC. Currently it can be booted into initrd with a shell over UART and you can also get kernel boot logs from a pstore-ramoops. Signed-off-by: Alexey Minnekhanov Link: https://lore.kernel.org/r/20200417012630.222352-4-alexey.min@gmail.com Signed-off-by: Bjorn Andersson commit feec34411d4c0a9759106ef4f7d563438b3881ae Author: Craig Tatlor Date: Fri Apr 17 04:26:29 2020 +0300 arm64: dts: qcom: Add SDM660 SoC support Initial device tree support for Qualcomm SDM660 SoC. SDM660 is based off MSM8998 and uses some of its drivers. SDM630/636 are based off SDM660 SoC and they are pin and software compatible. The device tree is based on the CAF 4.4 kernel tree. Features: * CPU nodes * Timer nodes * Interrupt controller * Global Clock Controller * Top Level Mode Multiplexer (pin controller) * UART node This is inspired by and based on the work of Craig Tatlor in https://patchwork.kernel.org/patch/10563667/ Signed-off-by: Craig Tatlor Signed-off-by: Alexey Minnekhanov Link: https://lore.kernel.org/r/20200417012630.222352-3-alexey.min@gmail.com Signed-off-by: Bjorn Andersson commit aab86bbbd3e32a10ca7e5cd1d3b9a473cf5909bb Author: Alexey Minnekhanov Date: Fri Apr 17 04:26:28 2020 +0300 dt-bindings: arm: qcom: Add sdm630 and sdm660 SoCs Add a SoC strings for the Qualcomm SDM630 and SDM660 SoCs. Also document the new xiaomi,lavender compatible used in a device tree binding. Signed-off-by: Alexey Minnekhanov Link: https://lore.kernel.org/r/20200417012630.222352-2-alexey.min@gmail.com Signed-off-by: Bjorn Andersson commit 30685b2a439b282b462e27ab0f8beb019719b7d9 Merge: 493f3cc7ee02 8665d9780e6e Author: David S. Miller Date: Wed Apr 22 20:11:29 2020 -0700 Merge branch 'dpaa2-eth-add-support-for-xdp-bulk-enqueue' Ioana Ciornei says: ==================== dpaa2-eth: add support for xdp bulk enqueue The first patch moves the DEV_MAP_BULK_SIZE macro into the xdp.h header file so that drivers can take advantage of it and use it. The following 3 patches are there to setup the scene for using the bulk enqueue feature. First of all, the prototype of the enqueue function is changed so that it returns the number of enqueued frames. Second, the bulk enqueue interface is used but without any functional changes, still one frame at a time is enqueued. Third, the .ndo_xdp_xmit callback is split into two stages, create all FDs for the xdp_frames received and then enqueue them. The last patch of the series builds on top of the others and instead of issuing an enqueue operation for each FD it issues a bulk enqueue call for as many frames as possible. This is repeated until all frames are enqueued or the maximum number of retries is hit. We do not use the XDP_XMIT_FLUSH flag since the architecture is not capable to store all frames dequeued in a NAPI cycle, instead we send out right away all frames received in a .ndo_xdp_xmit call. Changes in v2: - statically allocate an array of dpaa2_fd by frame queue - use the DEV_MAP_BULK_SIZE as the maximum number of xdp_frames received in .ndo_xdp_xmit() ==================== Signed-off-by: David S. Miller commit 8665d9780e6efafa3cd9865ae3a77826326fe8c6 Author: Ioana Ciornei Date: Wed Apr 22 15:05:13 2020 +0300 dpaa2-eth: use bulk enqueue in .ndo_xdp_xmit Take advantage of the bulk enqueue feature in .ndo_xdp_xmit. We cannot use the XDP_XMIT_FLUSH since the architecture is not capable to store all the frames dequeued in a NAPI cycle so we instead are enqueueing all the frames received in a ndo_xdp_xmit call right away. After setting up all FDs for the xdp_frames received, enqueue multiple frames at a time until all are sent or the maximum number of retries is hit. Signed-off-by: Ioana Ciornei Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit 6aa40b9e5b1ee732e07e406ffa6e17d152b3a216 Author: Ioana Ciornei Date: Wed Apr 22 15:05:12 2020 +0300 dpaa2-eth: split the .ndo_xdp_xmit callback into two stages Instead of having a function that both creates a frame descriptor from an xdp_frame and enqueues it, split this into two stages. Add the dpaa2_eth_xdp_create_fd that just transforms an xdp_frame into a FD while the actual enqueue callback is called directly from the ndo for each frame. This is particulary useful in conjunction with bulk enqueue. Signed-off-by: Ioana Ciornei Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit 6ff8044751bdc40fd3199813bfe9b93d056fc15d Author: Ioana Ciornei Date: Wed Apr 22 15:05:11 2020 +0300 dpaa2-eth: use the bulk ring mode enqueue interface Update the dpaa2-eth driver to use the bulk enqueue function introduced with the change to QBMAN ring mode. At the moment, no functional changes are made but rather the driver just transitions to the new interface while still enqueuing just one frame at a time. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 48c0481e5ad1d1eec6ccfaee6bb8a030fbbd07f7 Author: Ioana Ciornei Date: Wed Apr 22 15:05:10 2020 +0300 dpaa2-eth: return num_enqueued frames from enqueue callback The enqueue dpaa2-eth callback now returns the number of successfully enqueued frames. This is a preliminary patch necessary for adding support for bulk ring mode enqueue. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 788f87ac608c518b74f338acb95f197cf6e3d0c4 Author: Ioana Ciornei Date: Wed Apr 22 15:05:09 2020 +0300 xdp: export the DEV_MAP_BULK_SIZE macro Export the DEV_MAP_BULK_SIZE macro to the header file so that drivers can directly use it as the maximum number of xdp_frames received in the .ndo_xdp_xmit() callback. Signed-off-by: Ioana Ciornei Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit 493f3cc7ee020a4c5da02f6502743d9ae7be50d6 Author: David Ahern Date: Wed Apr 22 17:08:22 2020 -0600 selftests: A few improvements to fib_nexthops.sh Add nodad when adding IPv6 addresses and remove the sleep. A recent change to iproute2 moved the 'pref medium' to the prefix (where it belongs). Change the expected route check to strip 'pref medium' to be compatible with old and new iproute2. Add IPv4 runtime test with an IPv6 address as the gateway in the default route. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 250562aff7963bc7459edcc4cc7d0f803758caf2 Merge: ec403d880bcc f132ccc56e35 Author: David S. Miller Date: Wed Apr 22 19:48:57 2020 -0700 Merge branch 'Add-selftests-for-pedit-ex-munge-ip6-dsfield' Petr Machata says: ==================== Add selftests for pedit ex munge ip6 dsfield Patch #1 extends the existing generic forwarding selftests to cover pedit ex munge ip6 traffic_class as well. Patch #2 adds TDC test coverage. ==================== Signed-off-by: David S. Miller commit f132ccc56e35875655226915588cab63a16237ef Author: Petr Machata Date: Wed Apr 22 19:48:30 2020 +0300 selftests: tc-testing: Add a TDC test for pedit munge ip6 dsfield Add a self-test for the IPv6 dsfield munge that iproute2 will support. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 93e106da6a7514445c1e27fdbb6b9810f3df8452 Author: Petr Machata Date: Wed Apr 22 19:48:29 2020 +0300 selftests: forwarding: pedit_dsfield: Add pedit munge ip6 dsfield Extend the pedit_dsfield forwarding selftest with coverage of "pedit ex munge ip6 dsfield set". Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit ec403d880bcc48ea1f2bdc6589ffcb1301a69f56 Merge: d0f0c55e7c4c 6a64d3cdc5ef Author: David S. Miller Date: Wed Apr 22 19:41:26 2020 -0700 Merge branch 'add-TJA1102-support' Oleksij Rempel says: ==================== add TJA1102 support changes v5: - rename __of_mdiobus_register_phy() to of_mdiobus_phy_device_register() changes v4: - remove unused phy_id variable changes v3: - export part of of_mdiobus_register_phy() and reuse it in tja11xx driver - coding style fixes changes v2: - use .match_phy_device - add irq support - add add delayed registration for PHY1 ==================== Signed-off-by: David S. Miller commit 6a64d3cdc5ef89b2ac629701de5ffb3df1fb7937 Author: Oleksij Rempel Date: Wed Apr 22 11:24:56 2020 +0200 net: phy: tja11xx: add delayed registration of TJA1102 PHY1 TJA1102 is a dual PHY package with PHY0 having proper PHYID and PHY1 having no ID. On one hand it is possible to for PHY detection by compatible, on other hand we should be able to reset complete chip before PHY1 configured it, and we need to define dependencies for proper power management. We can solve it by defining PHY1 as child of PHY0: tja1102_phy0: ethernet-phy@4 { reg = <0x4>; interrupts-extended = <&gpio5 8 IRQ_TYPE_LEVEL_LOW>; reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; reset-assert-us = <20>; reset-deassert-us = <2000>; tja1102_phy1: ethernet-phy@5 { reg = <0x5>; interrupts-extended = <&gpio5 8 IRQ_TYPE_LEVEL_LOW>; }; }; The PHY1 should be a subnode of PHY0 and registered only after PHY0 was completely reset and initialized. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 5972157c2dde11698d7bcfc55621107d97121c87 Author: Oleksij Rempel Date: Wed Apr 22 11:24:55 2020 +0200 net: mdio: of: export part of of_mdiobus_register_phy() This function will be needed in tja11xx driver for secondary PHY support. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8f469506de2ad5528dedbab4d9ba34838991d5d1 Author: Oleksij Rempel Date: Wed Apr 22 11:24:54 2020 +0200 net: phy: tja11xx: add initial TJA1102 support TJA1102 is an dual T1 PHY chip. Both PHYs are separately addressable. Both PHYs are similar but have different amount of functionality. For example PHY 1 has no PHY ID and no health monitor. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit d9cc193cf0bf471630e203c369e60ab3735dd621 Author: Oleksij Rempel Date: Wed Apr 22 11:24:53 2020 +0200 dt-bindings: net: phy: Add support for NXP TJA11xx Document the NXP TJA11xx PHY bindings. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit d0f0c55e7c4ca7c66877064d7c1f4795025e88f8 Author: Tang Bin Date: Wed Apr 22 16:15:42 2020 +0800 net: phy: Use IS_ERR() to check and simplify code Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_OR_ZERO() to simplify code, avoid redundant paramenter definitions and judgements. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Signed-off-by: David S. Miller commit bcf3440c6dd78bfe5836ec0990fe36d7b4bb7d20 Author: Oleksij Rempel Date: Wed Apr 22 09:21:37 2020 +0200 net: phy: micrel: add phy-mode support for the KSZ9031 PHY Add support for following phy-modes: rgmii, rgmii-id, rgmii-txid, rgmii-rxid. This PHY has an internal RX delay of 1.2ns and no delay for TX. The pad skew registers allow to set the total TX delay to max 1.38ns and the total RX delay to max of 2.58ns (configurable 1.38ns + build in 1.2ns) and a minimal delay of 0ns. According to the RGMII v1.3 specification the delay provided by PCB traces should be between 1.5ns and 2.0ns. The RGMII v2.0 allows to provide this delay by MAC or PHY. So, we configure this PHY to the best values we can get by this HW: TX delay to 1.38ns (max supported value) and RX delay to 1.80ns (best calculated delay) The phy-modes can still be fine tuned/overwritten by *-skew-ps device tree properties described in: Documentation/devicetree/bindings/net/micrel-ksz90x1.txt Signed-off-by: Oleksij Rempel Reviewed-by: Philippe Schenker Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8518307dc2b2a97b235c74920b45020f9bebe33e Author: Jason Yan Date: Wed Apr 22 15:16:36 2020 +0800 net: caif: use true,false for bool variables Fix the following coccicheck warning: net/caif/caif_dev.c:410:2-13: WARNING: Assignment of 0/1 to bool variable net/caif/caif_dev.c:445:2-13: WARNING: Assignment of 0/1 to bool variable net/caif/caif_dev.c:145:1-12: WARNING: Assignment of 0/1 to bool variable net/caif/caif_dev.c:223:1-12: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit c89f44ff10fd4cdcfbebf4854aa1282fdad8de5d Author: Chuah, Kim Tatt Date: Wed Apr 22 11:31:06 2020 +0800 net: stmmac: Add support for VLAN promiscuous mode For dwmac4, enable VLAN promiscuity when MAC controller is requested to enter promiscuous mode. Signed-off-by: Chuah, Kim Tatt Signed-off-by: Ong Boon Leong Signed-off-by: Tan, Tee Min Signed-off-by: Wong Vee Khee Signed-off-by: David S. Miller commit 58e64a312c8468f3e8adead24b71ebb3039b381e Author: Wei Yongjun Date: Wed Apr 22 10:11:35 2020 +0800 macvlan: silence RCU list debugging warning macvlan_hash_lookup() uses list_for_each_entry_rcu() for traversing should either under RCU in fast path or the protection of rtnl_mutex. In the case of holding RTNL, we should add the corresponding lockdep expression to silence the following false-positive warning: ============================= WARNING: suspicious RCU usage 5.7.0-rc1-next-20200416-00003-ga3b8d28bc #1 Not tainted ----------------------------- drivers/net/macvlan.c:126 RCU-list traversed in non-reader section!! Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 3f251d741150265cfa7c84d30d105612449601ab Author: David Ahern Date: Tue Apr 21 18:40:22 2020 -0600 selftests: Add tests for vrf and xfrms Add tests for vrf and xfrms with a second round after adding a qdisc. There are a few known problems documented with the test cases that fail. The fix is non-trivial; will come back to it when time allows. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 3c7b51bd39b2078870baeeb98ad8190f447c2ed2 Author: Xiaoliang Yang Date: Tue Apr 21 21:13:47 2020 +0300 net: dsa: felix: allow flooding for all traffic classes Right now it can be seen that the VSC9959 (Felix) switch will not flood frames if they have a VLAN tag with a PCP of 1-7 (nonzero). It turns out that Felix is quite different from its cousin, Ocelot, in that frame flooding can be allowed/denied per traffic class. Where Ocelot has 1 instance of the ANA_FLOODING register, Felix has 8. The approach that this driver is going to take is "thanks, but no thanks". We have no use case of limiting the flooding domain based on traffic class, so we just want to allow packets to be flooded, no matter what traffic class they have. So we copy the line of code from ocelot.c which does the one-shot initialization of the flooding PGIDs, and we add it to felix.c as well - except replicated 8 times. Signed-off-by: Xiaoliang Yang Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9251dad3a3e5ed72cfb30ec27a4e569527e6f10f Author: Guido Günther Date: Tue Apr 21 16:44:14 2020 +0200 arm64: dts: imx8mq-librem5-devkit: Don't use underscore in node name Rename usb_typec to usb-typec to get a rid of a warning when building dtb with warnings enabled. Signed-off-by: Guido Günther Signed-off-by: Shawn Guo commit 76eceb0f3696a2021f407a5e649aa36d08a61be5 Author: Guido Günther Date: Tue Apr 21 16:44:13 2020 +0200 arm64: dts: imx8mq-librem5-devkit: Use 0.9V for VDD_GPU According to the imx8mq data sheet running VDD_GPU at 0.9V is enough when not overclocking to 1GHz (which we currently don't do). Signed-off-by: Guido Günther Signed-off-by: Shawn Guo commit f37b451f45a2fb0704b5d152563c921639f98eb8 Author: Andy Shevchenko Date: Wed Apr 22 16:05:39 2020 +0300 libnvdimm: Replace guid_copy() with import_guid() where it makes sense There is a specific API to treat raw data as GUID, i.e. import_guid(). Use it instead of guid_copy() with explicit casting. Signed-off-by: Andy Shevchenko Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20200422130539.45636-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dan Williams commit e09d40bdbac0e37a0179f4cd901e6422619a7ad2 Author: Christian König Date: Tue Apr 21 16:20:26 2020 +0200 drm/amdgpu: change how we update mmRLC_SPM_MC_CNTL In pp_one_vf mode avoid the extra overhead and read/write the registers without the KIQ. Signed-off-by: Christian König Reviewed-by: Monk Liu Acked-by: Yintian Tao Signed-off-by: Alex Deucher commit a891d239f9e036031f9f1c62fe584232662cb7f1 Author: Dennis Li Date: Wed Apr 22 12:22:54 2020 +0800 drm/amdgpu: set error query ready after all IPs late init If set error query ready in amdgpu_ras_late_init, which will cause some IP blocks aren't initialized, but their error query is ready. Signed-off-by: Dennis Li Reviewed-by: Guchun Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7dd8c205eaedfa3163c307143aaf29b65190e54a Author: Evan Quan Date: Thu Apr 16 12:39:04 2020 +0800 drm/amdgpu: code cleanup around gpu reset Make code more readable. Signed-off-by: Evan Quan Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 9e94d22c008585815f32630ee7d0d28c4ec12bb7 Author: Evan Quan Date: Thu Apr 16 12:27:28 2020 +0800 drm/amdgpu: optimize the gpu reset for XGMI setup V2 This is basically just some code cosmetic. The current design for XGMI setup gput reset is to operate on current device(adev) first and then on other devices from the hive(by another 'for' loop). But actually we can do some sort to the device list(to put current device 1st position) and handle all the devices in a single 'for' loop. V2: added missing hive->hive_lock protection Signed-off-by: Evan Quan Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 52fb44cf30fc6b11a2faf8d8d905e756ea24f919 Author: Evan Quan Date: Thu Apr 16 12:20:38 2020 +0800 drm/amdgpu: correct cancel_delayed_work_sync on gpu reset As for XGMI setup, it should be performed on other devices from the hive also. Signed-off-by: Evan Quan Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit a2f63ee8b5eabda8b317425d1e487e51a4d7b21e Author: Evan Quan Date: Thu Apr 16 12:15:31 2020 +0800 drm/amdgpu: correct fbdev suspend on gpu reset As for XGMI setup, it needs to be performed on all the devices from the same hive. Signed-off-by: Evan Quan Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 10f39758b8f3d2e6ba3bb4aa731123c6cf2271ea Author: Bernard Zhao Date: Tue Apr 21 18:46:18 2020 -0700 drm/amdgpu: cleanup coding style in amdkfd a bit Make the code a bit more readable by using a common error handling pattern. Signed-off-by: Bernard Zhao Reviewed-by: Christian König . Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit e05185b34157ba606bd2200bcc3c335cf19422ae Author: Kevin Wang Date: Mon Apr 20 23:08:14 2020 +0800 drm/amdgpu: clean up unused variable about ring lru clean up unused variable: 1. ring_lru_list 2. ring_lru_list_lock related-commit: drm/amdgpu: remove ring lru handling Signed-off-by: Kevin Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4cc1178e166a85cbc0f5e822426beceaafa7bef2 Author: Dennis Li Date: Sat Apr 18 12:08:20 2020 +0800 drm/amdgpu: replace DRM prefix with PCI device info for gfx/mmhub Prefix RAS message printing in gfx/mmhub with PCI device info, which assists the debug in multiple GPU case. Reviewed-by: Guchun Chen Signed-off-by: Dennis Li Signed-off-by: Alex Deucher commit f9b93c9ba605d8b0cf05e72102c3cf4a85aa6191 Author: Jiansong Chen Date: Mon Apr 20 15:36:53 2020 +0800 drm/amd/powerplay: limit smu support to Arcturus for onevf Under onevf mode the smu support to other chips is not well verified yet. Signed-off-by: Jiansong Chen Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 7aba19182e9958cce8d0c6b2f67807ceac31fd50 Author: Jiawei Date: Fri Apr 17 19:06:52 2020 +0800 drm/amdgpu: disble vblank when unloading sriov driver disble vblank in dce_vitual_crtc_commit(), which is skipped under sriov before Reviewed-by: Emily Deng Signed-off-by: Jiawei Signed-off-by: Alex Deucher commit d69b8971e540ae908a4b7ba44aa11ecb42a2c406 Author: Yong Zhao Date: Fri Apr 17 16:11:48 2020 -0400 drm/amdgpu: Print CU information by default during initialization This is convenient for multiple teams to obtain the information. Also, add device info by using dev_info(). Signed-off-by: Yong Zhao Reviewed-by: Dennis Li Signed-off-by: Alex Deucher commit a35da666cc087ce1a89ca8c6441cc575c0b8c36a Author: Prike Liang Date: Fri Apr 3 14:47:53 2020 +0800 drm/amd/powerplay: update smu12_driver_if.h to align with pmfw Update the smu12_driver_if.h header to follow the pmfw release. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui Signed-off-by: Alex Deucher commit 5f6a92e442834815736ee8815d99e2c9c658a51b Author: Yuxian Dai Date: Wed Apr 15 19:03:52 2020 +0800 drm/amdgpu/powerplay:avoid to show invalid DPM table info for different ASIC support different the number of DPM levels, we should avoid to show the invalid level value. v1 -> v2: follow the suggestion,clarifiy the description for this change Reviewed-by: Huang Rui Signed-off-by: Yuxian Dai Signed-off-by: Alex Deucher commit e1046a1f703c660ddbf8c5ea36e84d7584fa99eb Author: Yong Zhao Date: Fri Apr 17 16:16:57 2020 -0400 drm/amdgpu: Adjust the SDMA doorbell info printing Turn off the printing by default because it is not very useful, while adding more details. Signed-off-by: Yong Zhao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit de430916b4ef6dd0530a747c01e836a7832f7d21 Author: Yong Zhao Date: Fri Apr 17 16:06:59 2020 -0400 drm/amdkfd: Adjust three kfd dmesg printings during initialization Delete two printings which are not very useful, and change one from pr_info() to pr_debug(). Signed-off-by: Yong Zhao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ffadb9d6520843500d848f5f882ae74cc1aa11ce Author: Anthony Koo Date: Fri Apr 17 18:26:47 2020 -0400 drm/amd/display: fix bug in the logic for panel power control [Why] there's a bug in the new logic for panel power control. the check is wrong, and will skip panel power control under the wrong conditions. [How] fix to check for NULL panel_cntl Signed-off-by: Anthony Koo Reviewed-by: Ashley Thomas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a42c1ed50aafc29efa54ddb0524c86b1697ff13a Author: Wyatt Wood Date: Fri Apr 17 14:10:23 2020 -0400 drm/amd/display: Convert memory from cpu to fw endianness correctly [Why] Current code does not guarantee the correct endianness of memory being copied to fw, specifically in the case where cpu isn't little endian. [How] Windows and Diags are always little endian, so we define a macro that does nothing. Linux already defines this macro and will do the correct endianness conversion. Signed-off-by: Wyatt Wood Reviewed-by: Harry Wentland Acked-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit af031f078aeae3c6179a4618ce1aa8eda861ee10 Author: Rodrigo Siqueira Date: Wed Apr 22 17:43:26 2020 -0400 drm/amd/display: Fix green screen issue after suspend [why] We have seen a green screen after resume from suspend in a Raven system connected with two displays (HDMI and DP) on X based system. We noticed that this issue is related to bad DCC metadata from user space which may generate hangs and consequently an underflow on HUBP. After taking a deep look at the code path we realized that after resume we try to restore the commit with the DCC enabled framebuffer but the framebuffer is no longer valid. [how] This problem was only reported on Raven based system and after suspend, for this reason, this commit adds a new parameter on fill_plane_dcc_attributes() to give the option of disabling DCC programmatically. In summary, for disabling DCC we first verify if is a Raven system and if it is in suspend; if both conditions are true we disable DCC temporarily, otherwise, it is enabled. Co-developed-by: Nicholas Kazlauskas Signed-off-by: Nicholas Kazlauskas Signed-off-by: Rodrigo Siqueira Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit e49233873604519dd38c57109d8814aaa319d509 Author: Stylon Wang Date: Thu Apr 9 22:37:47 2020 +0800 drm/amd/display: Adjust refactored dm for color management only [Why] Commit cdde482caabf2adad47d23f0d1e235db2c4f2b7d is causing regression from changing the order of call sequence. [How] Keep the call sequence and take in extra dm state only if plane-level color management is enabled. Fixes: cdde482caabf2a ("drm/amd/display: Refactor color management to take dm plane state") Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 4dc0b81442c524e69361df7cc6452e6bc99f69ff Author: Yongqiang Sun Date: Wed Apr 8 20:40:02 2020 -0400 drm/amd/display: access ABM from stream resource. [Why] Since ABM resource is mapped to stream res, all the ABM access should via stream res. [How] Get ABM instance from stream res instead of resource pool. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 422d9091f7be46b0d38c562a5750195af832370a Author: Xiaodong Yan Date: Thu Apr 9 17:37:40 2020 +0800 drm/amd/display: blank dp stream before re-train the link [Why] When link loss happened, monitor can not light up if only re-train the link. [How] Blank all the DP streams on this link before re-train the link, and then unblank the stream Signed-off-by: Xiaodong Yan Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 967727021e75f6c1d9972d5a87f759155f935d75 Author: Aurabindo Pillai Date: Tue Apr 7 10:22:27 2020 -0400 drm/amd/display: DispalyPort: Write OUI only if panel supports it [why] Organizational Unit Identifier register is optional, and its presence is published via Down Stream Port Count register. Writing this register when not available will result in errors [how] Read this register and continue writing OUI only if the panel has the support advertised. Signed-off-by: Aurabindo Pillai Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d4caa72e275c1920d38a9541b2e4dcc167733734 Author: Anthony Koo Date: Wed Apr 8 13:31:50 2020 -0400 drm/amd/display: change from panel to panel cntl [Why] it doesn't represent panel specifically, it's more like the control logic for the panel [How] change from panel to panel cntl to make it a bit more clear Signed-off-by: Anthony Koo Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit e9e7123a6665cddffaf053a0a26e26743ba5a26d Author: Jaehyun Chung Date: Wed Apr 8 15:02:58 2020 -0400 drm/amd/display: Add HW rotation cursor changes to dcn10 [Why] HW rotation was enabled in DAL3 but hubp cursor calculations for HW roation were only added to dcn20. [How] Add hubp cursor position calculation changes to dcn10. Signed-off-by: Jaehyun Chung Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit c400ecce96458709f94dc25ab8e4cd2fad8726d1 Author: Nicholas Kazlauskas Date: Tue Apr 7 12:10:41 2020 -0400 drm/amd/display: Factor in immediate flip support into DLG calculations [Why] We expect to be able to perform immediate flipping without having to recalculate and update all the watermarks. There are certain usecases today (1080p @ 90deg, 2160p @ 90deg) such that we get a urgency value of 0 for frac_urg_bw_flip because we're explicitly passing in a value of "false" for requiring immediate flip support into the DLG calculation. [How] Always pass in true into the calculation. With this we get a correct non-zero value for frac_urg_bw_flip. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d5bef51f084fccafa984b114ff74a01a64a0e2e3 Author: Dmytro Laktyushkin Date: Tue Apr 7 12:01:07 2020 -0400 drm/amd/display: fix virtual signal dsc setup This prevents dpcd access on virtual links. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 9da3d050590952a329adce001d984f8417ab1182 Author: Anthony Koo Date: Wed Apr 8 09:30:21 2020 -0400 drm/amd/display: destroy panel on link destruct [Why] without destroy it is causing a memory leak [How] destroy panel on link destruct Signed-off-by: Anthony Koo Reviewed-by: Wyatt Wood Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7fc5c319efceaed1a23b7ef35c333553ce39fecf Author: Paul Hsieh Date: Tue Apr 7 17:18:47 2020 +0800 drm/amd/display: dmcu wait loop calculation is incorrect in RV [Why] Driver already get display clock from SMU base on MHz, but driver read again and mutiple 1000 cause wait loop value is overflow. [How] remove coding error Signed-off-by: Paul Hsieh Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 904fb6e0f4e8158e6db1e21c3c97bdc238e537f5 Author: Anthony Koo Date: Sat Mar 28 01:44:14 2020 -0400 drm/amd/display: move panel power seq to new panel struct [Why] panel power sequencer is currently just sitting in hwseq but it really it tied to internal panels [How] make a new panel struct to contain power sequencer code Signed-off-by: Anthony Koo Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit fefe92fe747ca74c6f127833188d4ff02d6f4e11 Author: Anthony Koo Date: Fri Mar 27 18:23:16 2020 -0400 drm/amd/display: make all backlight calls link based [Why] Backlight adjustment is tied to a specific display. So make the calls target a link rather than making it a global state. [How] make all backlight calls link based Signed-off-by: Anthony Koo Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 06535a48e297f43ce5d188afde108fa768010b0c Author: Sung Lee Date: Wed Mar 25 14:44:25 2020 -0400 drm/amd/display: Cap certain DML values for Low Pix Clk on DCN2.1 [WHY] In certain conditions with low pixel clock, some values in DML may go past the max due to margining for latency hiding. This causes assertions to get hit. [HOW] If the pixel clock is low and some values are high, cap it to the max. Signed-off-by: Sung Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit bccbf13dadbe33452e312d828332cb9d2b553f7f Author: Wyatt Wood Date: Sun Apr 5 13:48:56 2020 -0400 drm/amd/display: Various fixes for PSR on DMCUB [Why] - Driver does not recognize new definitions of psr states. - Internal tool is required for checking if psr is active. [How] - Parse psr state correctly so that driver will recognize psr state. - Add visual confirmation that psr is active using existing mechanisms. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7241434f88eba194623b0624880ea90c871ca358 Author: Aric Cyr Date: Mon Apr 6 00:22:52 2020 -0400 drm/amd/display: 3.2.81 Signed-off-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 68c10ac91f88babd7c8e273e5cdae892111ba334 Author: Aric Cyr Date: Sun Apr 5 15:35:16 2020 -0400 drm/amd/display: Update MPCC if requested Don't skip MPCC tree updates if requested. Signed-off-by: Aric Cyr Reviewed-by: Joshua Aberback Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d0a0a00d32e93d4dfcdea0a8e504c383da5afce3 Author: Aric Cyr Date: Fri Apr 3 16:33:56 2020 -0400 drm/amd/display: Fix HDR visual confirm Some cases were incorrectly reporting the wrong visual confirm, even though they were working as expected. Signed-off-by: Aric Cyr Reviewed-by: Krunoslav Kovac Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2059fc5e8c7f93442d18f9bcc82592fb089199e2 Author: Nicholas Kazlauskas Date: Tue Mar 31 16:50:12 2020 -0400 drm/amd/display: Use the correct input TF for video formats [Why] Color blending for NV12 formats is incorrect because we're using the predefined SRGB degamma. [How] Calculate the correct input transfer function for degamma from the color module depending on what the actual surface format is. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Zhan Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d2bacc38f6caa96e6d67d2e3e2bd0aee36de6954 Author: Haiyi Zhou Date: Fri Apr 3 10:00:58 2020 -0400 drm/amd/display: Change infopacket type programming [Why] Certain displays may experience blanking if infopacket max range does not equal nominal refresh rate. [How] Add additional infopacket versions to program range to full or forced range in freesync states. This does not change the vrr logic. Signed-off-by: Haiyi Zhou Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit f1029e7ead9a5f13ef040dfbe1473b975f927b41 Author: Nicholas Kazlauskas Date: Thu Apr 2 15:59:44 2020 -0400 drm/amd/display: Avoid NULL pointer in set_backlight when ABM is NULL [Why] On ASIC without ABM support (most dGPU) we run into a null pointer dereference when attempting to set the backlight level. [How] This function requires ABM, so fix up the condition to only allow DMCU to be optional. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Wyatt Wood Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 39063de95cfb1d522d111bdba10441bcd5642a43 Author: Dmytro Laktyushkin Date: Thu Apr 2 09:31:45 2020 -0400 drm/amd/display: fix stream setting for diags on silicon We need to set up stream even with virtual displays when running diags. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 0b1f04d8876bd1397d3c2c837c3ea4cc77773698 Author: Sung Lee Date: Mon Mar 30 17:16:23 2020 -0400 drm/amd/display: Cast int to float before division [Why]: Some inputs to dml_ceil have it dividied by int which causes a truncation. This loss of precision means the ceil function becomes redundant and does not round up. [How]: Cast parameter to float before division. Signed-off-by: Sung Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit f2cd2e5d861245dbf40e9b919e4734123164d8f4 Author: Sung Lee Date: Mon Mar 30 17:19:01 2020 -0400 drm/amd/display: Set meta_chunk_value to 0 in DML if DCC disabled in DCN2.1 [WHY]: Calculating refcyc_per_meta_chunk_vblank_l when DCC is disabled may lead to a large number causing an assert to get hit. In VBA, this value is 0 when DCC is disabled. [HOW]: Set value to 0 to avoid hitting the assert. Signed-off-by: Sung Lee Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a8665946f39aff519f363ebd7c1013c673cb31a1 Author: Wenjing Liu Date: Tue Mar 31 12:32:53 2020 -0400 drm/amd/display: add optc get crc support for timings with ODM/DSC [why] Optc needs to know if timing is enabled with ODM or DSC before computing crc. Otherwise value computed will be inaccurate. Before this change, the CRC computed without ODM is not equal to the CRC computed with ODM for the same timing. This is unexpected as we are driving the same timing despite of the underlaying hardware setup to achieve it. This is caused by missing hardware programming sequence to support it. [how] Add the new programming sequence based on hardware guide. Signed-off-by: Wenjing Liu Reviewed-by: Nikola Cornij Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 63b50a95ed933e69b886352214f1cb329def75ad Author: Jinze Xu Date: Wed Mar 25 16:14:35 2020 +0800 drm/amd/display: Workaround to disable YCbCr [Why] Some mst dock can't translate DP to HDMI properly. [How] Bypass YCbCr timings on specific MST device. Signed-off-by: Jinze Xu Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d652509e7a244761755403a2ae3fb6c96183226e Author: Nicholas Kazlauskas Date: Tue Mar 31 16:45:31 2020 -0400 drm/amd/display: Check ramp != NULL before applying lut1d for degamma [Why] A NULL ramp is a valid configuration for passing into mod_color_calculate_degamma_params but we'll hit a NULL pointer if we do so. We need this in order to get the right transfer function to do degamma on NV12 formats where we aren't supplied with a custom user degamma. [How] Add the NULL check. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Zhan Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d1ebfdd8d0fc30ff65b85a4bf3fa9e5e35006466 Author: Wyatt Wood Date: Tue Mar 31 09:31:16 2020 -0400 drm/amd/display: Unify psr feature flags [Why] As it stands, psr has feature flags in dm, stream, and link. Most are not defined well enough, and different dm layers have different uses for these same flags. [How] We define a new structure called psr_settings in dc_link that will hold the following psr feature flags: psr_feature_enable - psr is supported psr_allow_active - psr is currently active psr_version - internal psr version supported psr_frame_capture_indication_req psr_sdp_transmit_line_num_deadline The last two flags were moved out of the power module for the purposes of consolidating psr flags. Their use is already well-defined. Psr caps reported by sink will also be stored in dc_link, in dpcd_caps.psr_caps. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 44efb78410820045992a7d7f550f718c62d0ffa8 Author: Stylon Wang Date: Thu Mar 26 23:19:44 2020 +0800 drm/amd/display: Support plane-level gamut remap in DM [Why] Plane-level gamut remap is not enabled in DM, which is necessary to support CTM as a plane-level property. [How] Enable gamut remap in DM. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 67d09292f857d47e3577e69236e426cbc31439f0 Author: Wyatt Wood Date: Mon Mar 30 09:04:05 2020 -0400 drm/amd/display: Add SetBacklight call to abm on dmcub [Why] Set backlight calls to firmware are are being prevented by dmcu == null check. Dmcu is expected to be null in this case. [How] Only prevent call if dmcu and abm are null. Also rename variable 'use_smooth_brightness' to 'fw_set_brightness' as it's more appropriate. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit f12f70117a3cc9b7286dea486cb7af9920aa5dfd Author: Wyatt Wood Date: Mon Mar 30 09:58:29 2020 -0400 drm/amd/display: Remove byte swapping for dmcub abm config table [Why] Since x86 and dmcub are both little endian, byte swapping isn't necessary. Dmcu requires byte swapping as it is big endian. [How] Add flag to function definitions to determine if byte swapping is necessary. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 868149c9a072cbdc22a73ce25a487f9fbfa171ef Author: Joshua Aberback Date: Mon Mar 30 15:49:02 2020 -0400 drm/amd/display: Force watermark value propagation [Why] The HUBBUB watermark registers are in an area that cannot be power gated, but the HUBP copies of the watermark values are in areas that can be power gated. When we power on a pipe, it will not automatically take the HUBBUB values, we need to force propagation by writing to a watermark register. [How] - new HUBBUB function to re-write current value in a WM register - touch WM register after enabling the plane in program_pipe Signed-off-by: Joshua Aberback Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit dd5a94ce6c022bf60b821c29728258430912eb0b Author: Wyatt Wood Date: Mon Mar 30 09:08:04 2020 -0400 drm/amd/display: Move enable fractional pwm call [Why] Dmcu init fw call has some logic to initialize abm values. Since this doesn't exist on dmcub, must find a proper place for it in the abm sequence. [How] Move enable fractional pwm call. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 4c0de7de4cd568d16032d67a768271fb4977f94f Author: Wyatt Wood Date: Mon Mar 30 09:11:09 2020 -0400 drm/amd/display: Add user backlight level reg write [Why] Porting abm from dmcu to dmcub missed one register write. [How] Add this register write in the SetBacklightLevel sequence. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2a28fe92220a116735ef45939b7edcfee83cc6b0 Author: Dale Zhao Date: Fri Mar 27 20:11:55 2020 +0800 drm/amd/display: Correct updating logic of dcn21's pipe VM flags [Why]: Renoir's pipe VM flags are not correctly updated if pipe strategy has changed during some scenarios. It will result in watermarks mistakenly calculation, thus underflow and garbage appear. [How]: Correctly update pipe VM flags to pipes which have been populated. Signed-off-by: Dale Zhao Signed-off-by: Sung Lee Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 1c256f40bf8e9f4723c9e84c7e3a1105e1db0ad9 Author: Zhan Liu Date: Thu Apr 16 14:20:56 2020 -0400 drm/amd/display: Remove aconnector condition check for dpcd read [Why] Aconnector is not necessary to be NULL in order to read dpcd successfully. Actually if we rely on checking aconnector here, we won't be able to turn off all displays before doing display detection. That will cause some MST hubs not able to light up. [How] Remove aconnector check when turning off all displays at hardware initialization stage. Signed-off-by: Zhan Liu Reviewed-by: Joseph Gravenor Signed-off-by: Alex Deucher commit 8e0c819dc3c51be3d579c340f9fe2c65fbed3feb Author: YueHaibing Date: Fri Apr 17 18:12:47 2020 +0800 drm/amd/dc: remove unused variable 'video_optimized_pixel_rates' drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_clock_source.c:1017:50: warning: ‘video_optimized_pixel_rates’ defined but not used [-Wunused-const-variable=] static const struct pixel_rate_range_table_entry video_optimized_pixel_rates[] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~ commit d8cd587d2bfd ("drm/amd/display: removing MODULO change for dcn2") left behind this unused vairable, remove it. Signed-off-by: YueHaibing Signed-off-by: Alex Deucher commit 1470e957e204184e6598baab1efea215285bf79d Author: Jason Yan Date: Fri Apr 17 15:32:19 2020 +0800 drm/amd/powerplay: remove defined but not used variables Fix the following gcc warning: drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega10_powertune.c:710:46: warning: ‘PSMGCEDCThresholdConfig_vega10’ defined but not used [-Wunused-const-variable=] static const struct vega10_didt_config_reg PSMGCEDCThresholdConfig_vega10[] = ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega10_powertune.c:654:46: warning: ‘PSMSEEDCThresholdConfig_Vega10’ defined but not used [-Wunused-const-variable=] static const struct vega10_didt_config_reg PSMSEEDCThresholdConfig_Vega10[] = ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit d84a430d9f7b1ce6baedf1305106d0ae706aca76 Author: Jonathan Kim Date: Tue Mar 17 15:43:41 2020 -0400 drm/amdgpu: fix race between pstate and remote buffer map Vega20 arbitrates pstate at hive level and not device level. Last peer to remote buffer unmap could drop P-State while another process is still remote buffer mapped. With this fix, P-States still needs to be disabled for now as SMU bug was discovered on synchronous P2P transfers. This should be fixed in the next FW update. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9f65693577d976792e6dbad9ad42105b129259c6 Author: Alex Deucher Date: Thu Apr 16 14:44:52 2020 -0400 drm/amdgpu/display: give aux i2c buses more meaningful names Mirror what we do for i2c display buses. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit bdb9fbc6bae07c610048b23ca6709e035597e7ae Author: Alex Deucher Date: Thu Apr 16 14:20:58 2020 -0400 drm/amdgpu/display: fix aux registration (v2) We were registering the aux device in the MST late_register rather than the regular one. v2: handle eDP as well Fixes: 405a1f9090d1ac ("drm/amdgpu/display: split dp connector registration (v4)") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1100 Signed-off-by: Alex Deucher Reviewed-by: Harry Wentland commit 7ce016e71a8e8db239d0113e06a47fdf60fd8ea3 Author: Sandeep Raghuraman Date: Fri Apr 17 01:37:45 2020 +0530 drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii) Initialize thermal controller fields in the PowerPlay table for Hawaii GPUs, so that fan speeds are reported. Signed-off-by: Sandeep Raghuraman Signed-off-by: Alex Deucher commit 4f610503f0077c1d149b9f98c3fa966fb9551e85 Author: James Zhu Date: Sat Apr 11 08:41:52 2020 -0400 Revert "drm/amdgpu: Disable gfx off if VCN is busy" This reverts commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8 This is work around for vcn1 only. Currently vcn1 has separate begin_use and idle work handle. Signed-off-by: James Zhu Tested-by: changzhu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 12c17b9d62663c14a5343d6742682b3e67280754 Author: Guchun Chen Date: Thu Apr 16 23:41:07 2020 +0800 drm/amdgpu: fix kernel page fault issue by ras recovery on sGPU When running ras uncorrectable error injection and triggering GPU reset on sGPU, below issue is observed. It's caused by the list uninitialized when accessing. [ 80.047227] BUG: unable to handle page fault for address: ffffffffc0f4f750 [ 80.047300] #PF: supervisor write access in kernel mode [ 80.047351] #PF: error_code(0x0003) - permissions violation [ 80.047404] PGD 12c20e067 P4D 12c20e067 PUD 12c210067 PMD 41c4ee067 PTE 404316061 [ 80.047477] Oops: 0003 [#1] SMP PTI [ 80.047516] CPU: 7 PID: 377 Comm: kworker/7:2 Tainted: G OE 5.4.0-rc7-guchchen #1 [ 80.047594] Hardware name: System manufacturer System Product Name/TUF Z370-PLUS GAMING II, BIOS 0411 09/21/2018 [ 80.047888] Workqueue: events amdgpu_ras_do_recovery [amdgpu] Signed-off-by: Guchun Chen Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 69d0c18dda2dae4cfbf73d4ffaa5aff6dc69894a Author: Kent Russell Date: Thu Apr 16 08:22:28 2020 -0400 drm/amdgpu: Disable FRU read on Arcturus Update the list with supported Arcturus chips, but disable for now until final list is confirmed. Ideally we can poll atombios for FRU support, instead of maintaining this list of chips, but this will enable serial number reading for supported ASICs for the time-being. Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4e2fec3321d5c0a80b894c05eb2de51d06fa5c03 Author: Prike Liang Date: Wed Apr 15 21:43:41 2020 +0800 drm/amd/powerplay: fix resume failed as smu table initialize early exit When the amdgpu in the suspend/resume loop need notify the dpm disabled, otherwise the smu table will be uninitialize and result in resume failed. Signed-off-by: Prike Liang Tested-by: Mengbing Wang Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 53c9c89ac118c93cb5cf352f9cb12a1494715348 Author: Rajneesh Bhardwaj Date: Sun Apr 5 15:22:07 2020 -0400 drm/amdgpu/gmc: Fix spelling mistake. Fixes a minor typo in the file. Reviewed-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit e57761c68bb431885ff22ecc14b1db31cd09965b Author: John Clements Date: Wed Apr 15 10:57:33 2020 +0800 drm/amdgpu: cache smu fw version info reduce cmd submission to smu by caching version info Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit fdd21e62b01b0c618a19237344dc96b843647811 Author: Kent Russell Date: Mon Apr 13 14:15:44 2020 -0400 Revert "drm/amdgpu: use the BAR if possible in amdgpu_device_vram_access v2" This reverts commit c12b84d6e0d70f1185e6daddfd12afb671791b6e. The original patch causes a RAS event and subsequent kernel hard-hang when running the KFDMemoryTest.PtraceAccessInvisibleVram on VG20 and Arcturus dmesg output at hang time: [drm] RAS event of type ERREVENT_ATHUB_INTERRUPT detected! amdgpu 0000:67:00.0: GPU reset begin! Evicting PASID 0x8000 queues Started evicting pasid 0x8000 qcm fence wait loop timeout expired The cp might be in an unrecoverable state due to an unsuccessful queues preemption Failed to evict process queues Failed to suspend process 0x8000 Finished evicting pasid 0x8000 Started restoring pasid 0x8000 Finished restoring pasid 0x8000 [drm] UVD VCPU state may lost due to RAS ERREVENT_ATHUB_INTERRUPT amdgpu: [powerplay] Failed to send message 0x26, response 0x0 amdgpu: [powerplay] Failed to set soft min gfxclk ! amdgpu: [powerplay] Failed to upload DPM Bootup Levels! amdgpu: [powerplay] Failed to send message 0x7, response 0x0 amdgpu: [powerplay] [DisableAllSMUFeatures] Failed to disable all smu features! amdgpu: [powerplay] [DisableDpmTasks] Failed to disable all smu features! amdgpu: [powerplay] [PowerOffAsic] Failed to disable DPM! [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block failed -5 Signed-off-by: Kent Russell Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 079c72ad3a0135a56dca8c787ce75e068130369f Author: Alex Deucher Date: Thu Apr 9 09:40:01 2020 -0400 drm/amdgpu/gfx9: add gfxoff quirk Fix screen corruption with firefox. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207171 Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 7f70443fd8340709caa6444420b8810757688f4d Author: John Clements Date: Tue Apr 14 15:22:29 2020 +0800 drm/amdgpu: set mp1 state before reload Set MP1 state to prepare for unload before reloading SMU FW Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 40e611bdd1c762fc858ef22e8f206066ce844c44 Author: John Clements Date: Tue Apr 14 15:21:35 2020 +0800 drm/amdgpu: update psp fw loading sequence Added dedicated function to check if particular fw should be skipped from loading. Added dedicated function for SMU FW loading via PSP Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 47c11cff7e44fa3ff894ceb3e9e3a70500b36cf3 Author: Evan Quan Date: Mon Apr 13 18:49:50 2020 +0800 drm/amd/powerplay: update Arcturus smu-driver if header To fit the latest PMFW. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 774e335b878c1edf5e8e5d0138adaf86a892f025 Author: Evan Quan Date: Tue Apr 7 14:37:42 2020 +0800 drm/amd/powerplay: properly set the dpm_enabled state On the ASIC powered down(in baco or system suspend), the dpm_enabled will be set as false. Then all access (e.g. df state setting issued on RAS error event) to SMU will be blocked. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 94e0805ba929d7907c63fde8ef676feca62412e3 Author: Evan Quan Date: Mon Apr 13 13:26:22 2020 +0800 drm/amd/powerplay: correct i2c eeprom init/fini sequence As data transfer may starts immediately after i2c eeprom init completed. Thus i2c eeprom should be initialized after SMU ready. And i2c data transfer should be prohibited when SMU down. That is the i2c eeprom fini sequence needs to be updated also. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 56ddddaaccbf15af50e0cac56873de5231c03130 Author: Evan Quan Date: Fri Mar 6 18:08:41 2020 +0800 drm/amd/powerplay: bump the NAVI10 smu-driver if version To fit the latest SMC firmware 42.53 and eliminate the warning on driver loading. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 02c0bb4ee3eba2b967d123da7a073a7d67e029e9 Author: Evan Quan Date: Fri Mar 6 17:54:44 2020 +0800 drm/amd/powerplay: revise the way to retrieve the board parameters It can support different NV1x ASIC better. And this can guard no member got missing. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit ced1ba9761693ec310c33edf47c63b062a09be4a Author: Prike Liang Date: Mon Apr 13 21:41:14 2020 +0800 drm/amdgpu: fix the hw hang during perform system reboot and reset The system reboot failed as some IP blocks enter power gate before perform hw resource destory. Meanwhile use unify interface to set device CGPG to ungate state can simplify the amdgpu poweroff or reset ungate guard. Fixes: 487eca11a321ef ("drm/amdgpu: fix gfx hang during suspend with video playback (v2)") Signed-off-by: Prike Liang Tested-by: Mengbing Wang Tested-by: Paul Menzel Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 5edb769131e74defcdf82aeb53701a8895d2d462 Author: Colin Ian King Date: Fri Apr 10 12:46:13 2020 +0100 drm/amd/display: remove redundant assignment to variable dp_ref_clk_khz The variable dp_ref_clk_khz is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 322f3d45a17f64494152bd5583b68c8855b539c0 Author: Leon Romanovsky Date: Sun Apr 19 16:20:46 2020 +0300 RDMA/bnxt: Delete 'nq_ptr' variable which is not used The variable "nq_ptr" is set but never used, this generates the following warning while compiling kernel with W=1 option. drivers/infiniband/hw/bnxt_re/qplib_fp.c: In function 'bnxt_qplib_service_nq': drivers/infiniband/hw/bnxt_re/qplib_fp.c:303:25: warning: variable 'nq_ptr' set but not used [-Wunused-but-set-variable] 303 | struct nq_base *nqe, **nq_ptr; | Fixes: fddcbbb02af4 ("RDMA/bnxt_re: Simplify obtaining queue entry from hw ring") Link: https://lore.kernel.org/r/20200419132046.123887-1-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit dfddb54043f0a377f642bd0e6a28aa40769e2e65 Author: Manivannan Sadhasivam Date: Tue Apr 21 13:10:54 2020 +0530 net: qrtr: Add tracepoint support Add tracepoint support for QRTR with NS as the first candidate. Later on this can be extended to core QRTR and transport drivers. The trace_printk() used in NS has been replaced by tracepoints. Signed-off-by: Manivannan Sadhasivam Signed-off-by: David S. Miller commit 540bde5c2c3da005b87b3edb394d6ca4f890777d Author: YueHaibing Date: Tue Apr 21 11:09:12 2020 +0800 ila: remove unused macro 'ILA_HASH_TABLE_SIZE' net/ipv6/ila/ila_xlat.c:604:0: warning: macro "ILA_HASH_TABLE_SIZE" is not used [-Wunused-macros] Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit beb97d3a3192c00575580af9073921c6283cf93d Author: wenxu Date: Tue Apr 21 07:55:43 2020 +0800 net/sched: act_ct: update nf_conn_acct for act_ct SW offload in flowtable When the act_ct SW offload in flowtable, The counter of the conntrack entry will never update. So update the nf_conn_acct conuter in act_ct flowtable software offload. Signed-off-by: wenxu Reviewed-by: Roi Dayan Signed-off-by: David S. Miller commit 9521eb3ea19a828d8fd59a2785338fd742dbcf31 Author: Ondrej Mosnacek Date: Mon Apr 20 15:27:31 2020 +0200 selinux: don't produce incorrect filename_trans_count I thought I fixed the counting in filename_trans_read_helper() to count the compat rule count correctly in the final version, but it's still wrong. To really count the same thing as in the compat path, we'd need to add up the cardinalities of stype bitmaps of all datums. Since the kernel currently doesn't implement an ebitmap_cardinality() function (and computing the proper count would just waste CPU cycles anyway), just document that we use the field only in case of the old format and stop updating it in filename_trans_read_helper(). Fixes: 430059024389 ("selinux: implement new format of filename transitions") Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 3054d06719079388a543de6adb812638675ad8f5 Author: Paul Moore Date: Tue Apr 21 09:10:56 2020 -0400 audit: fix a net reference leak in audit_list_rules_send() If audit_list_rules_send() fails when trying to create a new thread to send the rules it also fails to cleanup properly, leaking a reference to a net structure. This patch fixes the error patch and renames audit_send_list() to audit_send_list_thread() to better match its cousin, audit_send_reply_thread(). Reported-by: teroincn@gmail.com Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 744b7bdfa79edb30bb7d5f9ae43b65e0d147533a Author: Xi Wang Date: Mon Apr 13 19:58:11 2020 +0800 RDMA/hns: Support 0 hop addressing for CQE buffer Add the zero hop addressing support by using mtr interface for CQE buffer, so the hns driver can support addressing hopnum between 0 to 3 for CQE. Link: https://lore.kernel.org/r/1586779091-51410-7-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 6fd610c5733d0b2024393e82f145180324ef55a7 Author: Xi Wang Date: Mon Apr 13 19:58:10 2020 +0800 RDMA/hns: Support 0 hop addressing for SRQ buffer Add the zero hop addressing support by using mtr interface for SRQ buffer, so the hns driver can support addressing hopnum between 0 to 3 for SRQ. Link: https://lore.kernel.org/r/1586779091-51410-6-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 58989d7cf6eefc7bc63b63739523e9319a8cfd81 Merge: 4406d36dfdf1 0785dad48003 Author: David S. Miller Date: Wed Apr 22 12:19:55 2020 -0700 Merge branch 'net-phy-add-device-managed-devm_mdiobus_register' Heiner Kallweit says: ==================== net: phy: add device-managed devm_mdiobus_register If there's no special ordering requirement for mdiobus_unregister(), then driver code can be simplified by using a device-managed version of mdiobus_register(). Prerequisite is that bus allocation has been done device-managed too. Else mdiobus_free() may be called whilst bus is still registered, resulting in a BUG_ON(). Therefore let devm_mdiobus_register() return -EPERM if bus was allocated non-managed. First user of the new functionality is r8169 driver. ==================== Signed-off-by: David S. Miller commit 0785dad48003408da27579845db2f83c024636df Author: Heiner Kallweit Date: Mon Apr 20 23:29:55 2020 +0200 r8169: use devm_mdiobus_register Use new function devm_mdiobus_register() to simplify the driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 38f961e744840db9044af68f4773ae5feae60a89 Author: Heiner Kallweit Date: Mon Apr 20 23:29:05 2020 +0200 net: phy: add device-managed devm_mdiobus_register If there's no special ordering requirement for mdiobus_unregister(), then driver code can be simplified by using a device-managed version of mdiobus_register(). Prerequisite is that bus allocation has been done device-managed too. Else mdiobus_free() may be called whilst bus is still registered, resulting in a BUG_ON(). Therefore let devm_mdiobus_register() return -EPERM if bus was allocated non-managed. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 4406d36dfdf1fbd954400e16ffeb915c1907d58a Author: Michael Walle Date: Mon Apr 20 20:21:13 2020 +0200 net: phy: bcm54140: add hwmon support The PHY supports monitoring its die temperature as well as two analog voltages. Add support for it. Signed-off-by: Michael Walle Acked-by: Guenter Roeck Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6937602ed3f9ebd46ed6a6b5e609c0ae4ed99008 Author: Michael Walle Date: Mon Apr 20 20:21:12 2020 +0200 net: phy: add Broadcom BCM54140 support The Broadcom BCM54140 is a Quad SGMII/QSGMII Copper/Fiber Gigabit Ethernet transceiver. This also adds support for tunables to set and get downshift and energy detect auto power-down. The PHY has four ports and each port has its own PHY address. There are per-port registers as well as global registers. Unfortunately, the global registers can only be accessed by reading and writing from/to the PHY address of the first port. Further, there is no way to find out what port you actually are by just reading the per-port registers. We therefore, have to scan the bus on the PHY probe to determine the port and thus what address we need to access the global registers. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0a32f1ff2a2e41404deaba5fb32f8a0d640c0974 Author: Michael Walle Date: Mon Apr 20 20:21:11 2020 +0200 net: phy: broadcom: add helper to write/read RDB registers RDB (Register Data Base) registers are used on newer Broadcom PHYs. Add helper to read, write and modify these registers. Signed-off-by: Michael Walle Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 66648766ef38d8d6c48ded2f59cf98420aec2cdb Author: Jimmy Assarsson Date: Thu Apr 2 19:25:07 2020 +0200 mm: Remove MPX leftovers Remove MPX leftovers in generic code. Fixes: 45fc24e89b7c ("x86/mpx: remove MPX from arch/x86") Signed-off-by: Jimmy Assarsson Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/20200402172507.2786-1-jimmyassarsson@gmail.com commit d563099e3e89c48caf9cc183ab3d39dd326c8987 Author: Xi Wang Date: Mon Apr 13 19:58:09 2020 +0800 RDMA/hns: Support 0 hop addressing for WQE buffer Add the zero hop addressing support by using new mtr interface for WQE buffer and simple mtr invoking process, so WQE buffer can support hopnum between 0 to 3. Link: https://lore.kernel.org/r/1586779091-51410-5-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 477a0a38707249227d8929648baf5abbdd58c40f Author: Xi Wang Date: Mon Apr 13 19:58:08 2020 +0800 RDMA/hns: Optimize 0 hop addressing for EQE buffer Use the new mtr interface to simple the hop 0 addressing and multihop addressing process. Link: https://lore.kernel.org/r/1586779091-51410-4-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit cc23267aedebd847f86953c67606a3f280fde201 Author: Xi Wang Date: Mon Apr 13 19:58:07 2020 +0800 RDMA/hns: Optimize hns buffer allocation flow When the value of nbufs is 1, the buffer is in direct mode, which may cause confusion. So optimizes current codes to make it easier to maintain and understand. Link: https://lore.kernel.org/r/1586779091-51410-3-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Lang Cheng Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 3c873161a0d7d1e11f1ce9cc59f89a009fb65711 Author: Xi Wang Date: Mon Apr 13 19:58:06 2020 +0800 RDMA/hns: Add support for addressing when hopnum is 0 Currently, WQE and EQE table have already used the mtr interface to config and access memory by multi-hop addressing when hopnum is from 1 to 3. But if hopnum is 0, each table need write its own but repetitive logic, and many duplicate code exists in the mtr interfaces invoke process. So wraps the public logic as 3 functions: hns_roce_mtr_create(), hns_roce_mtr_destroy() and hns_roce_mtr_map() to support hopnum ranges from 0 to 3. In addition, makes the mtr interfaces easier to use. Link: https://lore.kernel.org/r/1586779091-51410-2-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe commit 0e0bf1ea1147fcf74eab19c2d3c853cc3740a72f Author: Jin Yao Date: Thu Apr 9 15:07:55 2020 +0800 perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode As the code comments in perf_stat_process_counter() say, we calculate counter's data every interval, and the display code shows ps->res_stats avg value. We need to zero the stats for interval mode. But the current code only zeros the res_stats[0], it doesn't zero the res_stats[1] and res_stats[2], which are for ena and run of counter. This patch zeros the whole res_stats[] for interval mode. Fixes: 51fd2df1e882 ("perf stat: Fix interval output values") Signed-off-by: Jin Yao Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200409070755.17261-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b86a0373855bd1792dfc14e215df59c1372894f5 Merge: a3b6e8fd2723 630c3ff8c3d5 Author: David S. Miller Date: Wed Apr 22 11:43:27 2020 -0700 Merge branch 'dt-bindings-net-mdio.yaml-fixes' Florian Fainelli says: ==================== dt-bindings: net: mdio.yaml fixes This patch series documents some common MDIO devices properties such as resets (and delays) and broken-turn-around. The second patch also rephrases some descriptions to be more general towards MDIO devices and not specific towards Ethernet PHYs. Changes in v3: - corrected wording of 'broken-turn-around' in ethernet-phy.yaml and mdio.yaml, add Andrew's R-b tag to patch #3 ==================== Signed-off-by: David S. Miller commit 630c3ff8c3d554054229b8c1c3d3a2b9465ffa64 Author: Florian Fainelli Date: Mon Apr 20 11:07:23 2020 -0700 dt-bindings: net: mdio: Make descriptions more general A number of descriptions assume a PHY device, but since this binding describes a MDIO bus which can have different kinds of MDIO devices attached to it, rephrase some descriptions to be more general in that regard. Reviewed-by: Andrew Lunn Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit b92d905f2c9c5e66868fae26ba9ed32352df0f5a Author: Florian Fainelli Date: Mon Apr 20 11:07:22 2020 -0700 dt-bindings: net: mdio: Document common properties Some of the properties pertaining to the broken turn around or resets were only documented in ethernet-phy.yaml while they are applicable across all MDIO devices and not Ethernet PHYs specifically which are a superset. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit f42ceca226cadf2c27709499af8643acd4281cd7 Author: Florian Fainelli Date: Mon Apr 20 11:07:21 2020 -0700 dt-bindings: net: Correct description of 'broken-turn-around' The turn around bytes (2) are placed between the control phase of the MDIO transaction and the data phase, correct the wording to be more exact. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a3b6e8fd27233e54e34e10aaedea4cba217183c5 Merge: 44dd5efc97da 4faa2e06433f Author: David S. Miller Date: Wed Apr 22 11:40:52 2020 -0700 Merge branch 'Ocelot-MAC_ETYPE-tc-flower-key-improvements' Vladimir Oltean says: ==================== Ocelot MAC_ETYPE tc-flower key improvements As discussed in the comments surrounding this patch: https://patchwork.ozlabs.org/project/netdev/patch/20200417190308.32598-1-olteanv@gmail.com/ the restrictions imposed on non-MAC_ETYPE rules were harsher than they needed to be. IP, IPv6, ARP rules can still be added concurrently with src_mac and dst_mac rules, as long as those MAC address rules do not ask for an offending EtherType. For that to actually be supported, we need to parse the EtherType from the flower classification rule first. ==================== Signed-off-by: David S. Miller commit 4faa2e06433fbba16a13a21e1380ee4d246b95fc Author: Vladimir Oltean Date: Mon Apr 20 19:27:43 2020 +0300 net: mscc: ocelot: lift protocol restriction for flow_match_eth_addrs keys An attempt was made in commit fe3490e6107e ("net: mscc: ocelot: Hardware ofload for tc flower filter") to avoid clashes between MAC_ETYPE rules and IP rules. Because the protocol blacklist should have included ETH_P_ALL too, it created some confusion, but now the situation should be dealt with a bit better by the patch immediately previous to this one ("net: mscc: ocelot: refine the ocelot_ace_is_problematic_mac_etype function"). So now we can remove that check. MAC_ETYPE rules with a protocol of ETH_P_IP, ETH_P_IPV6, ETH_P_ARP and ETH_P_ALL _are_ supported, with some restrictions regarding per-port exclusivity which are enforced now. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7dec902f4fc0cf1162e18030f2598440e311a2d2 Author: Vladimir Oltean Date: Mon Apr 20 19:27:42 2020 +0300 net: mscc: ocelot: refine the ocelot_ace_is_problematic_mac_etype function The commit mentioned below was a bit too harsh, and while it restricted the invalid key combinations which are known to not work, such as: tc filter add dev swp0 ingress proto ip \ flower src_ip 192.0.2.1 action drop tc filter add dev swp0 ingress proto all \ flower src_mac 00:11:22:33:44:55 action drop it also restricted some which still should work, such as: tc filter add dev swp0 ingress proto ip \ flower src_ip 192.0.2.1 action drop tc filter add dev swp0 ingress proto 0x22f0 \ flower src_mac 00:11:22:33:44:55 action drop What actually does not match "sanely" is a MAC_ETYPE rule on frames having an EtherType of ARP, IPv4, IPv6, in addition to SNAP and OAM frames (which the ocelot tc-flower implementation does not parse yet, so the function might need to be revisited again in the future). So just make the function recognize the problematic MAC_ETYPE rules by EtherType - thus the VCAP IS2 can be forced to match even on those packets. This patch makes it possible for IP rules to live on a port together with MAC_ETYPE rules that are non-all, non-arp, non-ip and non-ipv6. Fixes: d4d0cb741d7b ("net: mscc: ocelot: deal with problematic MAC_ETYPE VCAP IS2 rules") Reported-by: Allan W. Nielsen Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 86b956de119c09818d0aabaf668280d8e4bd0d4b Author: Vladimir Oltean Date: Mon Apr 20 19:27:41 2020 +0300 net: mscc: ocelot: support matching on EtherType Currently, the filter's protocol is ignored except for a few special cases (IPv4 and IPv6). The EtherType can be matched inside VCAP IS2 by using a MAC_ETYPE key. So there are 2 cases in which EtherType matches are supported: - As part of a larger MAC_ETYPE rule, such as: tc filter add dev swp0 ingress protocol ip \ flower skip_sw src_mac 42:be:24:9b:76:20 action drop - Standalone (matching on protocol only): tc filter add dev swp0 ingress protocol arp \ flower skip_sw action drop As before, if the protocol is not specified, is it implicitly "all" and the EtherType mask in the MAC_ETYPE half key is set to zero. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2a89b674fd6834dacf2a6edfbdf5607c163dd36e Author: Al Viro Date: Thu Mar 19 13:19:34 2020 -0400 get rid of csum_partial_copy_to_user() For historical reasons some architectures call their csum_and_copy_to_user() csum_partial_copy_to_user() instead (and supply a macro defining the former as the latter). That's the last remnants of old experiment that went nowhere; time to bury them. Rename those to csum_and_copy_to_user() and get rid of the macros. Signed-off-by: Al Viro commit 60abfd08e88b2b41366dcdb1e586614770c791fa Author: Benjamin Thiel Date: Thu Apr 2 14:43:07 2020 +0200 x86/mm/mmap: Fix -Wmissing-prototypes warnings Add includes for the prototypes of valid_phys_addr_range(), arch_mmap_rnd() and valid_mmap_phys_addr_range() in order to fix -Wmissing-prototypes warnings. Signed-off-by: Benjamin Thiel Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200402124307.10857-1-b.thiel@posteo.de commit 9adbf3c609af92a57a73000a3cb8f4c2d307dfa3 Author: Mihai Carabas Date: Tue Apr 21 22:28:38 2020 +0300 x86/microcode: Fix return value for microcode late loading The return value from stop_machine() might not be consistent. stop_machine_cpuslocked() returns: - zero if all functions have returned 0. - a non-zero value if at least one of the functions returned a non-zero value. There is no way to know if it is negative or positive. So make __reload_late() return 0 on success or negative otherwise. [ bp: Unify ret val check and touch up. ] Signed-off-by: Mihai Carabas Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/1587497318-4438-1-git-send-email-mihai.carabas@oracle.com commit c03ee9af4e07112bd3fc688daca9e654f41eca93 Author: Hans de Goede Date: Fri Apr 17 19:15:32 2020 +0200 Bluetooth: btbcm: Add 2 missing models to subver tables Currently the bcm_uart_subver_ and bcm_usb_subver_table-s lack entries for the BCM4324B5 and BCM20703A1 chipsets. This makes the code use just "BCM" as prefix for the filename to pass to request-firmware, making it harder for users to figure out which firmware they need. This especially is problematic with the UART attached BCM4324B5 where this leads to the filename being just "BCM.hcd". Add the 2 missing devices to subver tables. This has been tested on: 1. A Dell XPS15 9550 where this makes btbcm.c try to load "BCM20703A1-0a5c-6410.hcd" before it tries to load "BCM-0a5c-6410.hcd". 2. A Thinkpad 8 where this makes btbcm.c try to load "BCM4324B5.hcd" before it tries to load "BCM.hcd" Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 74530a639adfa2b2162df6a688c6367ecae6a3ca Author: Hans de Goede Date: Fri Apr 17 19:15:31 2020 +0200 Bluetooth: btbcm: Try multiple Patch filenames when loading the Patch firmware Currently the bcm_uart_subver_ and bcm_usb_subver_table-s lack entries for various newer chipsets. This makes the code use just "BCM" as prefix for the filename to pass to request-firmware, making it harder for users to figure out which firmware they need. This especially a problem with UART attached devices where this leads to the filename being "BCM.hcd". If we add new entries to the subver-tables now, then this will change what firmware file the kernel looks for, e.g. currently linux-firmware contains a brcm/BCM-0bb4-0306.hcd file. If we add the info for the BCM20703A1 to the subver table, then this will change to brcm/BCM20703A1-0bb4-0306.hcd. This will cause the file to no longer get loaded breaking Bluetooth for existing users, going against the no regressions policy. To avoid this regression make the btbcm code try multiple filenames, first try the fullname, e.g. BCM20703A1-0bb4-0306.hcd and if that is not found, then fallback to the name with just BCM as prefix. This commit also adds an info message which filename was used, this makes the output look like this for example: [ 57.387867] Bluetooth: hci0: BCM20703A1 [ 57.387870] Bluetooth: hci0: BCM20703A1 (001.001.005) build 0000 [ 57.389438] Bluetooth: hci0: BCM20703A1 'brcm/BCM20703A1-0a5c-6410.hcd' Patch [ 58.681769] Bluetooth: hci0: BCM20703A1 Generic USB 20Mhz fcbga_BU [ 58.681772] Bluetooth: hci0: BCM20703A1 (001.001.005) build 0481 Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit f53b975cf113fa0dca9c7bba067c3d749682cc82 Author: Hans de Goede Date: Fri Apr 17 19:15:30 2020 +0200 Bluetooth: btbcm: Bail sooner from btbcm_initialize() when not loading fw If we have already loaded the firmware/patchram and btbcm_initialize() is called to re-init the HCI after this then there is no need to get the USB device-ids and build a firmware-filename out of these. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 0383f16a87c4dec6840cdbb80c2a30ecfdc2ffb0 Author: Hans de Goede Date: Fri Apr 17 19:15:29 2020 +0200 Bluetooth: btbcm: Make btbcm_setup_patchram use btbcm_finalize On UART attached devices we do: 1. btbcm_initialize() 2. Setup UART baudrate, etc. 3. btbcm_finalize() After our previous changes we can now also use btbcm_finalize() from the btbcm_setup_patchram() function used on USB devices without any functional changes. This completes unifying the USB and UART paths as much as possible. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 2fcdd562b91bdc29dddd406f7278102e4d90b1fa Author: Hans de Goede Date: Fri Apr 17 19:15:28 2020 +0200 Bluetooth: btbcm: Make btbcm_initialize() print local-name on re-init too Make btbcm_initialize() get and print the device's local-name on re-init too, this will make us also print the local-name after loading the Patch on UART attached devices making things more consistent. This also removes some code duplication from btbcm_setup_patchram() and allows more code duplication removal there in a follow-up patch. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 0287c5d84f5c0cde6c39362d56c7002dc4acedb3 Author: Hans de Goede Date: Fri Apr 17 19:15:27 2020 +0200 Bluetooth: btbcm: Fold Patch loading + applying into btbcm_initialize() Instead of having btbcm_initialize() fill a passed in fw_name buffer and then have its callers use that to request the firmware + load it into the HCI, make btbcm_initialize() do this itself the first time it is called (its get called a second time to reset the HCI after the firmware has been loaded). This removes some code duplication and makes it easier for further patches in this series to try more then 1 firmware filename. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit f8c51d28e9d13f20c33f4f2f46f8e7d0b8476b9c Author: Hans de Goede Date: Fri Apr 17 19:15:26 2020 +0200 Bluetooth: btbcm: Move setting of USE_BDADDR_PROPERTY quirk to hci_bcm.c btbcm_finalize() is currently only used by UART attached BCM devices. Move the setting of the USE_BDADDR_PROPERTY quirk, which we only want for UART attached devices to hci_bcm in preparation for using btbcm_finalize() for USB attached devices too. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 3fef10ec321ced8e75cd0a28616402401cbbcaf4 Author: Hans de Goede Date: Fri Apr 17 19:15:25 2020 +0200 Bluetooth: btbcm: Drop upper nibble version check from btbcm_initialize() btbcm_initialize() must either return an error; or fill the passed in fw_name, otherwise we end up passing uninitialized stack memory to request_firmware(). Since we have a fallback hw_name of "BCM" not having a known version in the subver field does not matter, drop the check so that we always fill the passed in fw_name. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit bdf8710d69f82ee6fd41b0166300c3306898b3c1 Author: Christoph Hellwig Date: Tue Apr 14 09:42:25 2020 +0200 block: move dma_pad handling from blk_rq_map_sg into the callers There are only two callers of blk_rq_map_sg/__blk_rq_map_sg that set the dma_pad value in the queue. Move the handling into those callers instead of burdening the common code, and move the ->extra_len field from struct request to struct scsi_cmnd. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit cc97923a5bccc776851c242b61015faf288d5c22 Author: Christoph Hellwig Date: Tue Apr 14 09:42:24 2020 +0200 block: move dma drain handling to scsi Don't burden the common block code with with specifics of the libata DMA draining mechanism. Instead move most of the code to the scsi midlayer. That also means the nr_phys_segments adjustments in the blk-mq fast path can go away entirely, given that SCSI never looks at nr_phys_segments after mapping the request to a scatterlist. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0475bd6c65976c390e3805a1e5f10fc30ca8def2 Author: Christoph Hellwig Date: Tue Apr 14 09:42:23 2020 +0200 scsi: merge scsi_init_sgtable into scsi_init_io scsi_init_io is the only caller of scsi_init_sgtable. Merge the two function to make upcoming changes a little easier. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 89de1504d53b59b12bfff227328ee3e63dd3a112 Author: Christoph Hellwig Date: Tue Apr 14 09:42:22 2020 +0200 block: provide a blk_rq_map_sg variant that returns the last element To be able to move some of the special purpose hacks in blk_rq_map_sg into the callers we need a variant that returns the last mapped S/G list element to the caller. Add that variant as __blk_rq_map_sg and make blk_rq_map_sg a trivial inline wrapper around it. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit e64a0e16928415648d53d721b3d6fc3635eddf92 Author: Christoph Hellwig Date: Tue Apr 14 09:42:21 2020 +0200 block: remove RQF_COPY_USER The RQF_COPY_USER is set for bio where the passthrough request mapping helpers decided that bounce buffering is required. It is then used to pad scatterlist for drivers that required it. But given that non-passthrough requests are per definition aligned, and directly mapped pass-through request must be aligned it is not actually required at all. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 15501287b1c1827d21cce14a868467a80060eccd Author: Chris Wilson Date: Wed Apr 22 15:17:49 2020 +0100 drm/i915/execlists: Drop request-before-CS assertion When we migrated to execlists, one of the conditions we wanted to test for was whether the breadcrumb seqno was being written before the breadcumb interrupt was delivered. This was following on from issues observed on previous generations which were not so strongly ordered. With the removal of the missed interrupt detection, we have not reliable means of detecting the out-of-order seqno/interrupt but instead tried to assert that the relationship between the CS event interrupt and the breadwrite should be strongly ordered. However, Icelake proves it is possible for the HW implementation to forget about minor little details such as write ordering and so the order between *processing* the CS event and the breadcrumb is unreliable. Remove the unreliable assertion, but leave a debug telltale in case we have reason to suspect. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1658 Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200422141749.28709-1-chris@chris-wilson.co.uk commit e61bb8b36a287dddc71bdf30be775e7abcaa595c Author: Alexey Gladkov Date: Sun Apr 19 16:10:57 2020 +0200 proc: use named enums for better readability Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit 1c6c4d112e81a919d4ea83ec6cbc2f55203217fd Author: Alexey Gladkov Date: Sun Apr 19 16:10:56 2020 +0200 proc: use human-readable values for hidepid The hidepid parameter values are becoming more and more and it becomes difficult to remember what each new magic number means. Backward compatibility is preserved since it is possible to specify numerical value for the hidepid parameter. This does not break the fsconfig since it is not possible to specify a numerical value through it. All numeric values are converted to a string. The type FSCONFIG_SET_BINARY cannot be used to indicate a numerical value. Selftest has been added to verify this behavior. Suggested-by: Andy Lutomirski Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit 37e7647a7212336d8a3a34db2e7f7345a47ca7b3 Author: Alexey Gladkov Date: Sun Apr 19 16:10:55 2020 +0200 docs: proc: add documentation for "hidepid=4" and "subset=pid" options and new mount behavior Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit 6814ef2d992af09451bbeda4770daa204461329e Author: Alexey Gladkov Date: Sun Apr 19 16:10:54 2020 +0200 proc: add option to mount only a pids subset This allows to hide all files and directories in the procfs that are not related to tasks. Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit 24a71ce5c47f6b1b3cdacf544cb24220f5c3b7ef Author: Alexey Gladkov Date: Sun Apr 19 16:10:53 2020 +0200 proc: instantiate only pids that we can ptrace on 'hidepid=4' mount option If "hidepid=4" mount option is set then do not instantiate pids that we can not ptrace. "hidepid=4" means that procfs should only contain pids that the caller can ptrace. Signed-off-by: Djalal Harouni Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit fa10fed30f2550313a8284365b3e2398526eb42c Author: Alexey Gladkov Date: Sun Apr 19 16:10:52 2020 +0200 proc: allow to mount many instances of proc in one pid namespace This patch allows to have multiple procfs instances inside the same pid namespace. The aim here is lightweight sandboxes, and to allow that we have to modernize procfs internals. 1) The main aim of this work is to have on embedded systems one supervisor for apps. Right now we have some lightweight sandbox support, however if we create pid namespacess we have to manages all the processes inside too, where our goal is to be able to run a bunch of apps each one inside its own mount namespace without being able to notice each other. We only want to use mount namespaces, and we want procfs to behave more like a real mount point. 2) Linux Security Modules have multiple ptrace paths inside some subsystems, however inside procfs, the implementation does not guarantee that the ptrace() check which triggers the security_ptrace_check() hook will always run. We have the 'hidepid' mount option that can be used to force the ptrace_may_access() check inside has_pid_permissions() to run. The problem is that 'hidepid' is per pid namespace and not attached to the mount point, any remount or modification of 'hidepid' will propagate to all other procfs mounts. This also does not allow to support Yama LSM easily in desktop and user sessions. Yama ptrace scope which restricts ptrace and some other syscalls to be allowed only on inferiors, can be updated to have a per-task context, where the context will be inherited during fork(), clone() and preserved across execve(). If we support multiple private procfs instances, then we may force the ptrace_may_access() on /proc// to always run inside that new procfs instances. This will allow to specifiy on user sessions if we should populate procfs with pids that the user can ptrace or not. By using Yama ptrace scope, some restricted users will only be able to see inferiors inside /proc, they won't even be able to see their other processes. Some software like Chromium, Firefox's crash handler, Wine and others are already using Yama to restrict which processes can be ptracable. With this change this will give the possibility to restrict /proc// but more importantly this will give desktop users a generic and usuable way to specifiy which users should see all processes and which users can not. Side notes: * This covers the lack of seccomp where it is not able to parse arguments, it is easy to install a seccomp filter on direct syscalls that operate on pids, however /proc// is a Linux ABI using filesystem syscalls. With this change LSMs should be able to analyze open/read/write/close... In the new patch set version I removed the 'newinstance' option as suggested by Eric W. Biederman. Selftest has been added to verify new behavior. Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit 1e88c420190be8f888015d9b357f16a85c81e865 Author: Alexey Gladkov Date: Sun Apr 19 16:10:51 2020 +0200 proc: rename struct proc_fs_info to proc_fs_opts Signed-off-by: Alexey Gladkov Reviewed-by: Alexey Dobriyan Reviewed-by: Kees Cook Signed-off-by: Eric W. Biederman commit cb593e5d2b6d3ad489669914d9fd1c64c7a4a6af Author: Chris Wilson Date: Wed Apr 22 08:28:05 2020 +0100 drm/i915/gem: Hold obj->vma.lock over for_each_ggtt_vma() While the ggtt vma are protected by their object lifetime, the list continues until it hits a non-ggtt vma, and that vma is not protected and may be freed as we inspect it. Hence, we require the obj->vma.lock to protect the list as we iterate. An example of forgetting to hold the obj->vma.lock is [1642834.464973] general protection fault, probably for non-canonical address 0xdead000000000122: 0000 [#1] SMP PTI [1642834.464977] CPU: 3 PID: 1954 Comm: Xorg Not tainted 5.6.0-300.fc32.x86_64 #1 [1642834.464979] Hardware name: LENOVO 20ARS25701/20ARS25701, BIOS GJET94WW (2.44 ) 09/14/2017 [1642834.465021] RIP: 0010:i915_gem_object_set_tiling+0x2c0/0x3e0 [i915] [1642834.465024] Code: 8b 84 24 18 01 00 00 f6 c4 80 74 59 49 8b 94 24 a0 00 00 00 49 8b 84 24 e0 00 00 00 49 8b 74 24 10 48 8b 92 30 01 00 00 89 c7 <80> ba 0a 06 00 00 03 0f 87 86 00 00 00 ba 00 00 08 00 b9 00 00 10 [1642834.465025] RSP: 0018:ffffa98780c77d60 EFLAGS: 00010282 [1642834.465028] RAX: ffff8d232bfb2578 RBX: 0000000000000002 RCX: ffff8d25873a0000 [1642834.465029] RDX: dead000000000122 RSI: fffff0af8ac6e408 RDI: 000000002bfb2578 [1642834.465030] RBP: ffff8d25873a0000 R08: ffff8d252bfb5638 R09: 0000000000000000 [1642834.465031] R10: 0000000000000000 R11: ffff8d252bfb5640 R12: ffffa987801cb8f8 [1642834.465032] R13: 0000000000001000 R14: ffff8d233e972e50 R15: ffff8d233e972d00 [1642834.465034] FS: 00007f6a3d327f00(0000) GS:ffff8d25926c0000(0000) knlGS:0000000000000000 [1642834.465036] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [1642834.465037] CR2: 00007f6a2064d000 CR3: 00000002fb57c001 CR4: 00000000001606e0 [1642834.465038] Call Trace: [1642834.465083] i915_gem_set_tiling_ioctl+0x122/0x230 [i915] [1642834.465121] ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915] [1642834.465151] drm_ioctl_kernel+0x86/0xd0 [drm] [1642834.465156] ? avc_has_perm+0x3b/0x160 [1642834.465178] drm_ioctl+0x206/0x390 [drm] [1642834.465216] ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915] [1642834.465221] ? selinux_file_ioctl+0x122/0x1c0 [1642834.465226] ? __do_munmap+0x24b/0x4d0 [1642834.465231] ksys_ioctl+0x82/0xc0 [1642834.465235] __x64_sys_ioctl+0x16/0x20 [1642834.465238] do_syscall_64+0x5b/0xf0 [1642834.465243] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [1642834.465245] RIP: 0033:0x7f6a3d7b047b [1642834.465247] Code: 0f 1e fa 48 8b 05 1d aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ed a9 0c 00 f7 d8 64 89 01 48 [1642834.465249] RSP: 002b:00007ffe71adba28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [1642834.465251] RAX: ffffffffffffffda RBX: 000055f99048fa40 RCX: 00007f6a3d7b047b [1642834.465253] RDX: 00007ffe71adba30 RSI: 00000000c0106461 RDI: 000000000000000e [1642834.465254] RBP: 0000000000000002 R08: 000055f98f3f1798 R09: 0000000000000002 [1642834.465255] R10: 0000000000001000 R11: 0000000000000246 R12: 0000000000000080 [1642834.465257] R13: 000055f98f3f1690 R14: 00000000c0106461 R15: 00007ffe71adba30 Now to take the spinlock during the list iteration, we need to break it down into two phases. In the first phase under the lock, we cannot sleep and so must defer the actual work to a second list, protected by the ggtt->mutex. We also need to hold the spinlock during creation of a new vma to serialise with updates of the tiling on the object. Reported-by: Dave Airlie Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Dave Airlie Cc: # v5.5+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200422072805.17340-1-chris@chris-wilson.co.uk commit c92724de6db1be85be679a58af25659ba696e64d Author: Chris Wilson Date: Wed Apr 22 11:09:03 2020 +0100 drm/i915/selftests: Try to detect rollback during batchbuffer preemption Since batch buffers dominant execution time, most preemption requests should naturally occur during execution of a batch buffer. We wish to verify that should a preemption occur within a batch buffer, when we come to restart that batch buffer, it occurs at the interrupted instruction and most importantly does not rollback to an earlier point. v2: Do not clear the GPR at the start of the batch, but rely on them being clear for new contexts. Suggested-by: Mika Kuoppala Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200422100903.25216-1-chris@chris-wilson.co.uk commit 5c98639814988647e6da17cf0d9ad905077219c4 Author: Mauro Carvalho Chehab Date: Wed Apr 22 15:59:54 2020 +0200 MAINTAINERS: reorder media attributes Some media entry attributes got out of the order after the bug was split into 3. Also, as reported by Johan, the Rockchip VPU entry also had their attributes at the wrong order. As those entries weren't merged yet upstream, let's reorder them with: ./scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS --order Reported-by: Johan Jonker Signed-off-by: Mauro Carvalho Chehab commit 1e76b171b71565b96117c2670c64ba54e36a9c2e Author: Ian Rogers Date: Mon Apr 20 17:43:29 2020 -0700 perf script: Avoid NULL dereference on symbol al->sym may be NULL given current if conditions and may cause a segv. Fixes: d2bedb7863e9 ("perf script: Allow --symbol to accept hexadecimal addresses") Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200421004329.43109-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3adbbd2295ad138ab95404d0ffc6bfc1b8f9f1e4 Author: Herbert Xu Date: Tue Apr 21 15:42:09 2020 +1000 hwrng: cctrng - Add dependency on HAS_IOMEM The cctrng doesn't compile without HAS_IOMEM so we should depend on it. Reported-by: kbuild test robot Fixes: a583ed310bb6 ("hwrng: cctrng - introduce Arm CryptoCell driver") Signed-off-by: Herbert Xu Acked-by: Hadar Gat Signed-off-by: Herbert Xu commit c73d1871503713c7ee37da9fde155322dc50280f Author: Stephen Rothwell Date: Tue Apr 21 14:56:49 2020 +1000 crypto: hisilicon/qm - add more ACPI dependencies due to the selects of CRYPTO_DEV_HISI_QM which now depends on ACPI Fixes: 6c6dd5802c2d ("crypto: hisilicon/qm - add controller reset...") Signed-off-by: Stephen Rothwell Signed-off-by: Herbert Xu commit f58dcab68aa57e74c12c9bec7ff1bb73e0b35143 Author: Wei Yongjun Date: Wed Apr 22 01:45:43 2020 +0000 spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size") Signed-off-by: Wei Yongjun Reviewed-by: Ashish Kumar Acked-by: Han Xu Link: https://lore.kernel.org/r/20200422014543.111070-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit 8fbd301bf206a3f3fc2c01181a11eb42846b9949 Author: Jagadeesh Pagadala Date: Sun Apr 19 11:43:56 2020 +0530 perf evlist: Remove duplicate headers Code cleanup: Remove duplicate headers which are included twice. Signed-off-by: Jagadeesh Pagadala Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/1587276836-17088-1-git-send-email-jagdsh.linux@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 41e7c32b978974adaadd4808ba42f9026634dca3 Author: Tommi Rantala Date: Fri Apr 17 16:23:29 2020 +0300 perf bench: Fix div-by-zero if runtime is zero Fix div-by-zero if runtime is zero: $ perf bench futex hash --runtime=0 # Running 'futex/hash' benchmark: Run summary [PID 12090]: 4 threads, each operating on 1024 [private] futexes for 0 secs. Floating point exception (core dumped) Signed-off-by: Tommi Rantala Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Darren Hart Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200417132330.119407-4-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo commit d2e7d8636fb7d3e30aa8f894003f9e293ea62eea Author: Tommi Rantala Date: Fri Apr 17 16:23:26 2020 +0300 perf cgroup: Avoid needless closing of unopened fd Do not bother with close() if fd is not valid, just to silence valgrind: $ valgrind ./perf script ==59169== Memcheck, a memory error detector ==59169== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==59169== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info ==59169== Command: ./perf script ==59169== ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() Signed-off-by: Tommi Rantala Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200417132330.119407-1-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo commit 5d7e0b1516dfc5901d1e394f17eb55b360e7d3d3 Author: Mark Brown Date: Wed Apr 22 09:35:50 2020 +0100 ASoC: dmic: Allow GPIO operations to sleep If there is a power GPIO provided we control it from DAPM context so there is no problem with a sleeping GPIO, use the _cansleep() version of the API to allow this. Signed-off-by: Mark Brown Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200422083550.50711-1-broonie@kernel.org Signed-off-by: Mark Brown commit 4aa86e05be84b0692846799fce16c233a170c559 Author: Jason Yan Date: Wed Apr 22 15:18:05 2020 +0800 ASoC: soc-core: return true, false in snd_soc_volsw_is_stereo() Fix the following coccicheck warning: include/sound/soc.h:1271:9-10: WARNING: return of 0/1 in function 'snd_soc_volsw_is_stereo' with return type bool Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200422071805.48793-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 87cfeb1920f84f465a738d4c6589033eefa20b45 Merge: 18bf34080c4c 12e89e65f446 Author: Ingo Molnar Date: Wed Apr 22 14:08:28 2020 +0200 Merge tag 'perf-core-for-mingo-5.8-20200420' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core fixes and improvements from Arnaldo Carvalho de Melo: kernel + tools/perf: Alexey Budankov: - Introduce CAP_PERFMON to kernel and user space. callchains: Adrian Hunter: - Allow using Intel PT to synthesize callchains for regular events. Kan Liang: - Stitch LBR records from multiple samples to get deeper backtraces, there are caveats, see the csets for details. perf script: Andreas Gerstmayr: - Add flamegraph.py script BPF: Jiri Olsa: - Synthesize bpf_trampoline/dispatcher ksymbol events. perf stat: Arnaldo Carvalho de Melo: - Honour --timeout for forked workloads. Stephane Eranian: - Force error in fallback on :k events, to avoid counting nothing when the user asks for kernel events but is not allowed to. perf bench: Ian Rogers: - Add event synthesis benchmark. tools api fs: Stephane Eranian: - Make xxx__mountpoint() more scalable libtraceevent: He Zhe: - Handle return value of asprintf. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit a349d3d97ea2d532a9c2d7211272623a4f71e8d0 Author: Ezequiel Garcia Date: Wed Apr 22 13:14:03 2020 +0200 media: MAINTAINERS: Fix Hantro, Rga and Rkvdec entries It seems recent merges introduced a couple issues here, so let's fix them all. Also, reorder Rockchip video decoder as per parse-maintainers.pl script and add linux-rockchip mailing list. Reported-by: Johan Jonker Signed-off-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab commit 19ce44f027ca6ed8c33b3a95a6c26c03d6a04448 Author: Hans Verkuil Date: Wed Apr 22 13:14:21 2020 +0200 media: rkisp1: fix missing mbus.type -> mbus_type conversion There was one missing sensor->mbus.type to sensor->mbus_type conversion which broke the build. I suspect this was due to a merge conflict that was incorrectly resolved. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d8e25a10ef876bfb2e6ee611fbbb7f7c926a3309 Author: Mark Brown Date: Wed Apr 22 12:07:10 2020 +0100 ASoC: SOF: Fix build The recent batch of SOF changes failed to build on some x86 configurations including an allmodconfig, revert the commits: e150ef4169a76 ASoC: SOF: Introduce extended manifest 371091417864b ASoC: SOF: ext_manifest: parse firmware version 7c024b948c206 ASoC: SOF: ext_manifest: parse compiler version 9e72f13ee541c ASoC: SOF: ext_manifest: parse windows to fix this. Reported-by: Stephen Rothwell Signed-off-by: Mark Brown commit 6d649fca349155698ba4b8858b258a62003c5c54 Author: Andy Shevchenko Date: Tue Apr 21 22:00:49 2020 +0300 pinctrl: intel: Move npins closer to pin_base in struct intel_community It's common across the drivers to use the (pin_base, npins) pair to describe community characteristics. Thus, move them in the struct intel_community to be closer to each other. While at it, add a blank line to cut driver usable fields from what core reserves for itself. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 2ccb9cc3b4d8653603c302083848e7d44bc89b58 Author: Andy Shevchenko Date: Tue Apr 21 22:00:48 2020 +0300 pinctrl: intel: Update description in struct intel_community It appears that most of the drivers, that are using struct intel_community, utilize gpps rather than gpp_size. Update comment accordingly. While here, correct the description of gpp_size, i.e. remove double space and drop redundant 'etc.' part. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 45591da765885f7320a111d290b3a28a23eed359 Author: Stephen Rothwell Date: Wed Apr 22 15:41:29 2020 +1000 powerpc/vas: Include linux/types.h in uapi/asm/vas-api.h allyesconfig fails with: ./usr/include/asm/vas-api.h:15:2: error: unknown type name '__u32' 15 | __u32 version; | ^~~~~ ./usr/include/asm/vas-api.h:16:2: error: unknown type name '__s16' 16 | __s16 vas_id; /* specific instance of vas or -1 for default */ | ^~~~~ ./usr/include/asm/vas-api.h:17:2: error: unknown type name '__u16' 17 | __u16 reserved1; | ^~~~~ ./usr/include/asm/vas-api.h:18:2: error: unknown type name '__u64' 18 | __u64 flags; /* Future use */ | ^~~~~ ./usr/include/asm/vas-api.h:19:2: error: unknown type name '__u64' 19 | __u64 reserved2[6]; | ^~~~~ uapi headers should be self contained, so add an include of linux/types.h. Fixes: 45f25a79fe50 ("powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API") Signed-off-by: Stephen Rothwell Acked-by: Haren Myneni [mpe: Flesh out change log from linux-next error report] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200422154129.11f988fd@canb.auug.org.au commit cbb6f8805a4cfcf6bd97dfd0de399f9f3f8f7cdc Author: Chris Wilson Date: Wed Apr 22 09:38:55 2020 +0100 drm/i915/selftests: Disable heartbeat around RPS interrupt testing For verifying reciving the EI interrupts, we need to hold the GPU in very precise conditions (in terms of C0 cycles during the EI). If we preempt the busy load to handle the heartbeat, this may perturb the busy load causing us to miss the interrupt. The other tests, while not as time sensitive, may also be slightly perturbed, so apply the heartbeat protection across all the measurements. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200422083855.26842-1-chris@chris-wilson.co.uk commit 14ff6c5546e7d98f8326d9ee7a75b79de9874efb Author: Jason Yan Date: Wed Apr 22 15:16:46 2020 +0800 ALSA: oxygen: use true,false for bool variables Fix the following coccicheck warning: sound/pci/oxygen/xonar_pcm179x.c:463:1-17: WARNING: Assignment of 0/1 to bool variable sound/pci/oxygen/xonar_pcm179x.c:505:1-17: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200422071646.48436-1-yanaijie@huawei.com Signed-off-by: Takashi Iwai commit 8137d2763bf77d68babb38a7323c5152c945f20e Author: Dan Carpenter Date: Wed Apr 22 12:22:55 2020 +0300 ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats() This should be ARRAY_SIZE() instead of sizeof(). The sizeof() limit is too high so it doesn't work. Fixes: 093b8494f299 ("ALSA: usb-audio: Print more information in stream proc files") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200422092255.GB195357@mwanda Signed-off-by: Takashi Iwai commit 0cc9ac8db0b447922d9af77916cd7941fc784b64 Author: Thomas Gleixner Date: Wed Mar 25 17:18:17 2020 +0100 objtool: Also consider .entry.text as noinstr Consider all of .entry.text as noinstr. This gets us coverage across the PTI boundary. While we could add everything .noinstr.text into .entry.text that would bloat the amount of code in the user mapping. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.525037514@infradead.org Signed-off-by: Ingo Molnar commit 932f8e987bfdcfc2365177978a30fdc0d6f6bd60 Author: Peter Zijlstra Date: Mon Mar 23 18:26:03 2020 +0100 objtool: Add STT_NOTYPE noinstr validation Make sure to also check STT_NOTYPE symbols for noinstr violations. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.465335884@infradead.org Signed-off-by: Ingo Molnar commit 4b5e2e7ffef87ae864f3f4546ee5753556e7550b Author: Peter Zijlstra Date: Mon Mar 23 21:17:50 2020 +0100 objtool: Rearrange validate_section() In preparation of further changes, once again break out the loop body. No functional changes intended. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.405863817@infradead.org Signed-off-by: Ingo Molnar commit da837bd6f1994f780325649e8eee7d9b01c5ee4d Author: Peter Zijlstra Date: Mon Mar 23 21:11:14 2020 +0100 objtool: Avoid iterating !text section symbols validate_functions() iterates all sections their symbols; this is pointless to do for !text sections as they won't have instructions anyway. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.346582716@infradead.org Signed-off-by: Ingo Molnar commit 6804c1afd794c8135351faaa69e1503ee11393ac Author: Peter Zijlstra Date: Wed Mar 18 13:33:54 2020 +0100 kbuild/objtool: Add objtool-vmlinux.o pass Now that objtool is capable of processing vmlinux.o and actually has something useful to do there, (conditionally) add it to the final link pass. This will increase build time by a few seconds. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.287494491@infradead.org Signed-off-by: Ingo Molnar commit 87ecb582f0ac85886398dde8c3cdb2225cac7786 Author: Peter Zijlstra Date: Mon Mar 16 15:47:27 2020 +0100 objtool: Use sec_offset_hash() for insn_hash In preparation for find_insn_containing(), change insn_hash to use sec_offset_hash(). This actually reduces runtime; probably because mixing in the section index reduces the collisions due to text sections all starting their instructions at offset 0. Runtime on vmlinux.o from 3.1 to 2.5 seconds. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.227240432@infradead.org Signed-off-by: Ingo Molnar commit 34f7c96d96d5e11b03a612017fcc3a6e645bb481 Author: Peter Zijlstra Date: Thu Mar 12 14:29:38 2020 +0100 objtool: Optimize !vmlinux.o again When doing kbuild tests to see if the objtool changes affected those I found that there was a measurable regression: pre post real 1m13.594 1m16.488s user 34m58.246s 35m23.947s sys 4m0.393s 4m27.312s Perf showed that for small files the increased hash-table sizes were a measurable difference. Since we already have -l "vmlinux" to distinguish between the modes, make it also use a smaller portion of the hash-tables. This flips it into a small win: real 1m14.143s user 34m49.292s sys 3m44.746s Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.167588731@infradead.org Signed-off-by: Ingo Molnar commit c4a33939a7eb396acbb05569e57eebe4374cc57c Author: Peter Zijlstra Date: Tue Mar 10 18:57:41 2020 +0100 objtool: Implement noinstr validation Validate that any call out of .noinstr.text is in between instr_begin() and instr_end() annotations. This annotation is useful to ensure correct behaviour wrt tracing sensitive code like entry/exit and idle code. When we run code in a sensitive context we want a guarantee no unknown code is ran. Since this validation relies on knowing the section of call destination symbols, we must run it on vmlinux.o instead of on individual object files. Add two options: -d/--duplicate "duplicate validation for vmlinux" -l/--vmlinux "vmlinux.o validation" Where the latter auto-detects when objname ends with "vmlinux.o" and the former will force all validations, also those already done on !vmlinux object files. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.106268040@infradead.org Signed-off-by: Ingo Molnar commit e7c0219b328c96746767f21b9532eed6a48f61c5 Author: Peter Zijlstra Date: Wed Mar 25 14:04:45 2020 +0100 objtool: Fix !CFI insn_state propagation Objtool keeps per instruction CFI state in struct insn_state and will save/restore this where required. However, insn_state has grown some !CFI state, and this must not be saved/restored (that would loose/destroy state). Fix this by moving the CFI specific parts of insn_state into struct cfi_state. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.045821071@infradead.org Signed-off-by: Ingo Molnar commit a3608f5954d07a40fb93764dc6d06195fa52eb14 Author: Peter Zijlstra Date: Wed Mar 25 15:34:50 2020 +0100 objtool: Rename struct cfi_state There's going to be a new struct cfi_state, rename this one to make place. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.986441913@infradead.org Signed-off-by: Ingo Molnar commit c536ed2fffd5dbf81fe2dede8ef294e0cbb08f72 Author: Peter Zijlstra Date: Wed Apr 1 16:54:26 2020 +0200 objtool: Remove SAVE/RESTORE hints The SAVE/RESTORE hints are now unused; remove them. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.926738768@infradead.org Signed-off-by: Ingo Molnar commit 9f2dfd61dd022d4559d42a832fb03e76aad36c5f Author: Peter Zijlstra Date: Wed Apr 1 16:51:11 2020 +0200 x86,ftrace: Shrink ftrace_regs_caller() by one byte 'Optimize' ftrace_regs_caller. Instead of comparing against an immediate, the more natural way to test for zero on x86 is: 'test %r,%r'. 48 83 f8 00 cmp $0x0,%rax 74 49 je 226 48 85 c0 test %rax,%rax 74 49 je 225 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.867411350@infradead.org Signed-off-by: Ingo Molnar commit dc2745b61907cf6faeb72cc25f2cc4b38d4a3cac Author: Peter Zijlstra Date: Wed Apr 1 16:50:40 2020 +0200 x86,ftrace: Use SIZEOF_PTREGS There's a convenient macro for 'SS+8' called FRAME_SIZE. Use it to clarify things. (entry/calling.h calls this SIZEOF_PTREGS but we're using asm/ptrace-abi.h) Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.808485515@infradead.org Signed-off-by: Ingo Molnar commit 0298739b7983cf9bf4fcfb4bfb815c539bdb87ca Author: Peter Zijlstra Date: Wed Apr 1 16:53:19 2020 +0200 x86,ftrace: Fix ftrace_regs_caller() unwind The ftrace_regs_caller() trampoline does something 'funny' when there is a direct-caller present. In that case it stuffs the 'direct-caller' address on the return stack and then exits the function. This then results in 'returning' to the direct-caller with the exact registers we came in with -- an indirect tail-call without using a register. This however (rightfully) confuses objtool because the function shares a few instruction in order to have a single exit path, but the stack layout is different for them, depending through which path we came there. This is currently cludged by forcing the stack state to the non-direct case, but this generates actively wrong (ORC) unwind information for the direct case, leading to potential broken unwinds. Fix this issue by fully separating the exit paths. This results in having to poke a second RET into the trampoline copy, see ftrace_regs_caller_ret. This brings us to a second objtool problem, in order for it to perceive the 'jmp ftrace_epilogue' as a function exit, it needs to be recognised as a tail call. In order to make that happen, ftrace_epilogue needs to be the start of an STT_FUNC, so re-arrange code to make this so. Finally, a third issue is that objtool requires functions to exit with the same stack layout they started with, which is obviously violated in the direct case, employ the new HINT_RET_OFFSET to tell objtool this is an expected exception. Together, this results in generating correct ORC unwind information for the ftrace_regs_caller() function and it's trampoline copies. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.749606694@infradead.org Signed-off-by: Ingo Molnar commit e25eea89bb8853763a22fa2547199cf96b571ba1 Author: Peter Zijlstra Date: Wed Apr 1 16:38:19 2020 +0200 objtool: Introduce HINT_RET_OFFSET Normally objtool ensures a function keeps the stack layout invariant. But there is a useful exception, it is possible to stuff the return stack in order to 'inject' a 'call': push $fun ret In this case the invariant mentioned above is violated. Add an objtool HINT to annotate this and allow a function exit with a modified stack frame. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.690601403@infradead.org Signed-off-by: Ingo Molnar commit b746046238bb99b8f703c79f6d95357428fb6476 Author: Peter Zijlstra Date: Thu Apr 2 10:15:51 2020 +0200 objtool: Better handle IRET Teach objtool a little more about IRET so that we can avoid using the SAVE/RESTORE annotation. In particular, make the weird corner case in insn->restore go away. The purpose of that corner case is to deal with the fact that UNWIND_HINT_RESTORE lands on the instruction after IRET, but that instruction can end up being outside the basic block, consider: if (cond) sync_core() foo(); Then the hint will land on foo(), and we'll encounter the restore hint without ever having seen the save hint. By teaching objtool about the arch specific exception frame size, and assuming that any IRET in an STT_FUNC symbol is an exception frame sized POP, we can remove the use of save/restore hints for this code. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115118.631224674@infradead.org Signed-off-by: Ingo Molnar commit 65ea47dcf4f936987a5fbf839c97acea00f4f196 Author: Julien Thierry Date: Fri Mar 27 15:28:47 2020 +0000 objtool: Support multiple stack_op per instruction Instruction sets can include more or less complex operations which might not fit the currently defined set of stack_ops. Combining more than one stack_op provides more flexibility to describe the behaviour of an instruction. This also reduces the need to define new stack_ops specific to a single instruction set. Allow instruction decoders to generate multiple stack_op per instruction. Signed-off-by: Julien Thierry Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200327152847.15294-11-jthierry@redhat.com Signed-off-by: Ingo Molnar commit 1ee444700e960b017558038a9443474e808b0045 Author: Muchun Song Date: Sun Apr 12 22:44:05 2020 +0800 objtool: Remove redundant .rodata section name comparison If the prefix of section name is not '.rodata', the following function call can never return 0. strcmp(sec->name, C_JUMP_TABLE_SECTION) So the name comparison is pointless, just remove it. Signed-off-by: Muchun Song Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit e378fa17d3fac5b118381923abd2636f45a98c6e Author: Nick Desaulniers Date: Thu Mar 26 11:37:06 2020 -0700 objtool: Documentation: document UACCESS warnings Compiling with Clang and CONFIG_KASAN=y was exposing a few warnings: call to memset() with UACCESS enabled Document how to fix these for future travelers. Link: https://github.com/ClangBuiltLinux/linux/issues/876 Suggested-by: Kamalesh Babulal Suggested-by: Matt Helsley Suggested-by: Peter Zijlstra Suggested-by: Randy Dunlap Signed-off-by: Nick Desaulniers Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit 6f8ca67683962d408c7a337664212669bd3e8355 Author: Julien Thierry Date: Fri Mar 27 15:28:46 2020 +0000 objtool: Split out arch-specific CFI definitions Some CFI definitions used by generic objtool code have no reason to vary from one architecture to another. Keep those definitions in generic code and move the arch-specific ones to a new arch-specific header. Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit bfb08f220312a4634532114eb3e7062f17dfb707 Author: Raphael Gault Date: Fri Mar 27 15:28:45 2020 +0000 objtool: Add abstraction for destination offsets The jump and call destination relocation offsets are x86-specific. Abstract them by calling arch-specific implementations. [ jthierry: Remove superfluous comment; replace other addend offsets with arch_dest_rela_offset() ] Signed-off-by: Raphael Gault Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit aff5e16918c3706622b138ea82391d6c597c5660 Author: Julien Thierry Date: Fri Mar 27 15:28:43 2020 +0000 objtool: Use arch specific values in restore_reg() The initial register state is set up by arch specific code. Use the value the arch code has set when restoring registers from the stack. Suggested-by: Raphael Gault Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit 7170cf47d16f1ba29eca07fd818870b7af0a93a5 Author: Julien Thierry Date: Fri Mar 27 15:28:41 2020 +0000 objtool: Ignore empty alternatives The .alternatives section can contain entries with no original instructions. Objtool will currently crash when handling such an entry. Just skip that entry, but still give a warning to discourage useless entries. Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit 0699e551af268c9841a205a3e90dc1615fb63d84 Author: Julien Thierry Date: Fri Mar 27 15:28:40 2020 +0000 objtool: Clean instruction state before each function validation When a function fails its validation, it might leave a stale state that will be used for the validation of other functions. That would cause false warnings on potentially valid functions. Reset the instruction state before the validation of each individual function. Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit a70266b5b2e1c4262566a52f2ef16bdcde90f99b Author: Julien Thierry Date: Fri Mar 27 15:28:39 2020 +0000 objtool: Remove redundant checks on operand type POP operations are already in the code path where the destination operand is OP_DEST_REG. There is no need to check the operand type again. Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit aa5847270a0eba62e5ab8445163c0ac974844598 Author: Julien Thierry Date: Fri Mar 27 15:28:38 2020 +0000 objtool: Always do header sync check Currently, the check of tools files against kernel equivalent is only done after every object file has been built. This means one might fix build issues against outdated headers without seeing a warning about this. Check headers before any object is built. Also, make it part of a FORCE'd recipe so every attempt to build objtool will report the outdated headers (if any). Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit 5377cae94ae31b089d4a69e7706672501c974f4d Author: Julien Thierry Date: Fri Apr 3 14:17:30 2020 +0100 objtool: Fix off-by-one in symbol_by_offset() Sometimes, WARN_FUNC() and other users of symbol_by_offset() will associate the first instruction of a symbol with the symbol preceding it. This is because symbol->offset + symbol->len is already outside of the symbol's range. Fixes: 2a362ecc3ec9 ("objtool: Optimize find_symbol_*() and read_symbols()") Signed-off-by: Julien Thierry Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar commit 963d5669171adcd59b45cad58fab81bbd599c3c8 Author: Peter Zijlstra Date: Mon Apr 20 10:33:32 2020 +0200 objtool: Fix 32bit cross builds Apparently there's people doing 64bit builds on 32bit machines. Fixes: 74b873e49d92 ("objtool: Optimize find_rela_by_dest_range()") Reported-by: youling257@gmail.com Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 41d91ec3de8a90167159275bde7ed65768723556 Merge: 1e060a453c86 ff5d18cb04f4 Author: Mark Brown Date: Wed Apr 22 08:51:44 2020 +0100 Merge tag 'tegra-for-5.7-asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into asoc-5.7 ASoC: tegra: Fixes for v5.7-rc3 This contains a couple of fixes that are needed to properly reconfigure the audio clocks on older Tegra devices. commit 788a4ee607e8d138269fdba7c53f6f233b0e2e36 Author: Nishad Kamdar Date: Sun Apr 19 18:36:07 2020 +0530 USB: serial: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB Serial device configuration. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Signed-off-by: Johan Hovold commit dd7fc5545bbafdbd6c1efdc996b61883b285bdc5 Author: Wen Gong Date: Tue Apr 21 15:09:35 2020 +0300 ath10k: add flush tx packets for SDIO chip When station connected to AP, and run TX traffic such as TCP/UDP, and system enter suspend state, then mac80211 call ath10k_flush with set drop flag, recently it only send wmi peer flush to firmware and firmware will flush all pending TX packets, for PCIe, firmware will indicate the TX packets status to ath10k, and then ath10k indicate to mac80211 TX complete with the status, then all the packets has been flushed at this moment. For SDIO chip, it is different, its TX complete indication is disabled by default, and it has a tx queue in ath10k, and its tx credit control is enabled, total tx credit is 96, when its credit is not sufficient, then the packets will buffered in the tx queue of ath10k, max packets is TARGET_TLV_NUM_MSDU_DESC_HL which is 1024, for SDIO, when mac80211 call ath10k_flush with set drop flag, maybe it have pending packets in tx queue of ath10k, and if it does not have sufficient tx credit, the packets will stay in queue untill tx credit report from firmware, if it is a noisy environment, tx speed is low and the tx credit report from firmware will delay more time, then the num_pending_tx will remain > 0 untill all packets send to firmware. After the 1st ath10k_flush, mac80211 will call the 2nd ath10k_flush without set drop flag immediately, then it will call to ath10k_mac_wait_tx_complete, and it wait untill num_pending_tx become to 0, in noisy environment, it is esay to wait about near 5 seconds, then it cause the suspend take long time. 1st and 2nd callstack of ath10k_flush [ 303.740427] ath10k_sdio mmc1:0001:1: ath10k_flush drop:1, pending:0-0 [ 303.740495] ------------[ cut here ]------------ [ 303.740739] WARNING: CPU: 1 PID: 3921 at /mnt/host/source/src/third_party/kernel/v4.19/drivers/net/wireless/ath/ath10k/mac.c:7025 ath10k_flush+0x54/0x104 [ath10k_core] [ 303.740757] Modules linked in: bridge stp llc ath10k_sdio ath10k_core rfcomm uinput cros_ec_rpmsg mtk_seninf mtk_cam_isp mtk_vcodec_enc mtk_fd mtk_vcodec_dec mtk_vcodec_common mtk_dip mtk_mdp3 videobuf2_dma_contig videobuf2_memops v4l2_mem2mem videobuf2_v4l2 videobuf2_common hid_google_hammer hci_uart btqca bluetooth dw9768 ov8856 ecdh_generic ov02a10 v4l2_fwnode mtk_scp mtk_rpmsg rpmsg_core mtk_scp_ipi ipt_MASQUERADE fuse iio_trig_sysfs cros_ec_sensors_ring cros_ec_sensors_sync cros_ec_light_prox cros_ec_sensors industrialio_triggered_buffer [ 303.740914] kfifo_buf cros_ec_activity cros_ec_sensors_core lzo_rle lzo_compress ath mac80211 zram cfg80211 joydev [last unloaded: ath10k_core] [ 303.741009] CPU: 1 PID: 3921 Comm: kworker/u16:10 Tainted: G W 4.19.95 #2 [ 303.741027] Hardware name: MediaTek krane sku176 board (DT) [ 303.741061] Workqueue: events_unbound async_run_entry_fn [ 303.741086] pstate: 60000005 (nZCv daif -PAN -UAO) [ 303.741166] pc : ath10k_flush+0x54/0x104 [ath10k_core] [ 303.741244] lr : ath10k_flush+0x54/0x104 [ath10k_core] [ 303.741260] sp : ffffffdf080e77a0 [ 303.741276] x29: ffffffdf080e77a0 x28: ffffffdef3730040 [ 303.741300] x27: ffffff907c2240a0 x26: ffffffde6ff39afc [ 303.741321] x25: ffffffdef3730040 x24: ffffff907bf61018 [ 303.741343] x23: ffffff907c2240a0 x22: ffffffde6ff39a50 [ 303.741364] x21: 0000000000000001 x20: ffffffde6ff39a50 [ 303.741385] x19: ffffffde6bac2420 x18: 0000000000017200 [ 303.741407] x17: ffffff907c24a000 x16: 0000000000000037 [ 303.741428] x15: ffffff907b49a568 x14: ffffff907cf332c1 [ 303.741476] x13: 00000000000922e4 x12: 0000000000000000 [ 303.741497] x11: 0000000000000001 x10: 0000000000000007 [ 303.741518] x9 : f2256b8c1de4bc00 x8 : f2256b8c1de4bc00 [ 303.741539] x7 : ffffff907ab5e764 x6 : 0000000000000000 [ 303.741560] x5 : 0000000000000080 x4 : 0000000000000001 [ 303.741582] x3 : ffffffdf080e74a8 x2 : ffffff907aa91244 [ 303.741603] x1 : ffffffdf080e74a8 x0 : 0000000000000024 [ 303.741624] Call trace: [ 303.741701] ath10k_flush+0x54/0x104 [ath10k_core] [ 303.741941] __ieee80211_flush_queues+0x1dc/0x358 [mac80211] [ 303.742098] ieee80211_flush_queues+0x34/0x44 [mac80211] [ 303.742253] ieee80211_set_disassoc+0xc0/0x5ec [mac80211] [ 303.742399] ieee80211_mgd_deauth+0x720/0x7d4 [mac80211] [ 303.742535] ieee80211_deauth+0x24/0x30 [mac80211] [ 303.742720] cfg80211_mlme_deauth+0x250/0x3bc [cfg80211] [ 303.742849] cfg80211_mlme_down+0x90/0xd0 [cfg80211] [ 303.742971] cfg80211_disconnect+0x340/0x3a0 [cfg80211] [ 303.743087] __cfg80211_leave+0xe4/0x17c [cfg80211] [ 303.743203] cfg80211_leave+0x38/0x50 [cfg80211] [ 303.743319] wiphy_suspend+0x84/0x5bc [cfg80211] [ 303.743335] dpm_run_callback+0x170/0x304 [ 303.743346] __device_suspend+0x2dc/0x3e8 [ 303.743356] async_suspend+0x2c/0xb0 [ 303.743370] async_run_entry_fn+0x48/0xf8 [ 303.743383] process_one_work+0x304/0x604 [ 303.743394] worker_thread+0x248/0x3f4 [ 303.743403] kthread+0x120/0x130 [ 303.743416] ret_from_fork+0x10/0x18 [ 303.743812] ath10k_sdio mmc1:0001:1: ath10k_flush drop:0, pending:0-0 [ 303.743858] ------------[ cut here ]------------ [ 303.744057] WARNING: CPU: 1 PID: 3921 at /mnt/host/source/src/third_party/kernel/v4.19/drivers/net/wireless/ath/ath10k/mac.c:7025 ath10k_flush+0x54/0x104 [ath10k_core] [ 303.744075] Modules linked in: bridge stp llc ath10k_sdio ath10k_core rfcomm uinput cros_ec_rpmsg mtk_seninf mtk_cam_isp mtk_vcodec_enc mtk_fd mtk_vcodec_dec mtk_vcodec_common mtk_dip mtk_mdp3 videobuf2_dma_contig videobuf2_memops v4l2_mem2mem videobuf2_v4l2 videobuf2_common hid_google_hammer hci_uart btqca bluetooth dw9768 ov8856 ecdh_generic ov02a10 v4l2_fwnode mtk_scp mtk_rpmsg rpmsg_core mtk_scp_ipi ipt_MASQUERADE fuse iio_trig_sysfs cros_ec_sensors_ring cros_ec_sensors_sync cros_ec_light_prox cros_ec_sensors industrialio_triggered_buffer kfifo_buf cros_ec_activity cros_ec_sensors_core lzo_rle lzo_compress ath mac80211 zram cfg80211 joydev [last unloaded: ath10k_core] [ 303.744256] CPU: 1 PID: 3921 Comm: kworker/u16:10 Tainted: G W 4.19.95 #2 [ 303.744273] Hardware name: MediaTek krane sku176 board (DT) [ 303.744301] Workqueue: events_unbound async_run_entry_fn [ 303.744325] pstate: 60000005 (nZCv daif -PAN -UAO) [ 303.744403] pc : ath10k_flush+0x54/0x104 [ath10k_core] [ 303.744480] lr : ath10k_flush+0x54/0x104 [ath10k_core] [ 303.744496] sp : ffffffdf080e77a0 [ 303.744512] x29: ffffffdf080e77a0 x28: ffffffdef3730040 [ 303.744534] x27: ffffff907c2240a0 x26: ffffffde6ff39afc [ 303.744556] x25: ffffffdef3730040 x24: ffffff907bf61018 [ 303.744577] x23: ffffff907c2240a0 x22: ffffffde6ff39a50 [ 303.744598] x21: 0000000000000000 x20: ffffffde6ff39a50 [ 303.744620] x19: ffffffde6bac2420 x18: 000000000001831c [ 303.744641] x17: ffffff907c24a000 x16: 0000000000000037 [ 303.744662] x15: ffffff907b49a568 x14: ffffff907cf332c1 [ 303.744683] x13: 00000000000922ea x12: 0000000000000000 [ 303.744704] x11: 0000000000000001 x10: 0000000000000007 [ 303.744747] x9 : f2256b8c1de4bc00 x8 : f2256b8c1de4bc00 [ 303.744768] x7 : ffffff907ab5e764 x6 : 0000000000000000 [ 303.744789] x5 : 0000000000000080 x4 : 0000000000000001 [ 303.744810] x3 : ffffffdf080e74a8 x2 : ffffff907aa91244 [ 303.744831] x1 : ffffffdf080e74a8 x0 : 0000000000000024 [ 303.744853] Call trace: [ 303.744929] ath10k_flush+0x54/0x104 [ath10k_core] [ 303.745098] __ieee80211_flush_queues+0x1dc/0x358 [mac80211] [ 303.745277] ieee80211_flush_queues+0x34/0x44 [mac80211] [ 303.745424] ieee80211_set_disassoc+0x108/0x5ec [mac80211] [ 303.745569] ieee80211_mgd_deauth+0x720/0x7d4 [mac80211] [ 303.745706] ieee80211_deauth+0x24/0x30 [mac80211] [ 303.745853] cfg80211_mlme_deauth+0x250/0x3bc [cfg80211] [ 303.745979] cfg80211_mlme_down+0x90/0xd0 [cfg80211] [ 303.746103] cfg80211_disconnect+0x340/0x3a0 [cfg80211] [ 303.746219] __cfg80211_leave+0xe4/0x17c [cfg80211] [ 303.746335] cfg80211_leave+0x38/0x50 [cfg80211] [ 303.746452] wiphy_suspend+0x84/0x5bc [cfg80211] [ 303.746467] dpm_run_callback+0x170/0x304 [ 303.746477] __device_suspend+0x2dc/0x3e8 [ 303.746487] async_suspend+0x2c/0xb0 [ 303.746498] async_run_entry_fn+0x48/0xf8 [ 303.746510] process_one_work+0x304/0x604 [ 303.746521] worker_thread+0x248/0x3f4 [ 303.746530] kthread+0x120/0x130 [ 303.746542] ret_from_fork+0x10/0x18 one sample's debugging log: it wait 3190 ms(5000 - 1810). 1st ath10k_flush, it has 120 packets in tx queue of ath10k: <...>-1513 [000] .... 25374.786005: ath10k_log_err: ath10k_sdio mmc1:0001:1 ath10k_flush drop:1, pending:120-0 <...>-1513 [000] ...1 25374.788375: ath10k_log_warn: ath10k_sdio mmc1:0001:1 ath10k_htt_tx_mgmt_inc_pending htt->num_pending_mgmt_tx:0 <...>-1500 [001] .... 25374.790143: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:121 2st ath10k_flush, it has 121 packets in tx queue of ath10k: <...>-1513 [000] .... 25374.790571: ath10k_log_err: ath10k_sdio mmc1:0001:1 ath10k_flush drop:0, pending:121-0 <...>-1513 [000] .... 25374.791990: ath10k_log_err: ath10k_sdio mmc1:0001:1 ath10k_mac_wait_tx_complete state:1 pending:121-0 <...>-1508 [001] .... 25374.792696: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit update: delta:46 <...>-1508 [001] .... 25374.792700: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit total:46 <...>-1508 [001] .... 25374.792729: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:121 <...>-1508 [001] .... 25374.792937: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx status:0, eid:1, req count:88, count:32, len:49792 <...>-1508 [001] .... 25374.793031: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx status:0, eid:1, req count:75, count:14, len:21784 kworker/u16:0-25773 [003] .... 25374.793701: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx complete, eid:1, pending complete count:46 <...>-1881 [000] .... 25375.073178: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit update: delta:24 <...>-1881 [000] .... 25375.073182: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit total:24 <...>-1881 [000] .... 25375.073429: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:75 <...>-1879 [001] .... 25375.074090: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx complete, eid:1, pending complete count:24 <...>-1881 [000] .... 25375.074123: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx status:0, eid:1, req count:51, count:24, len:37344 <...>-1879 [001] .... 25375.270126: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit update: delta:26 <...>-1879 [001] .... 25375.270130: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit total:26 <...>-1488 [000] .... 25375.270174: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:51 <...>-1488 [000] .... 25375.270529: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx status:0, eid:1, req count:25, count:26, len:40456 <...>-1879 [001] .... 25375.270693: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx complete, eid:1, pending complete count:26 <...>-1488 [001] .... 25377.775885: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit update: delta:12 <...>-1488 [001] .... 25377.775890: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit total:12 <...>-1488 [001] .... 25377.775933: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:25 <...>-1488 [001] .... 25377.776059: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx status:0, eid:1, req count:13, count:12, len:18672 <...>-1879 [001] .... 25377.776100: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx complete, eid:1, pending complete count:12 <...>-1488 [001] .... 25377.878079: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit update: delta:15 <...>-1488 [001] .... 25377.878087: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit total:15 <...>-1879 [000] .... 25377.878323: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:13 <...>-1879 [000] .... 25377.878487: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx status:0, eid:1, req count:0, count:13, len:20228 <...>-1879 [000] .... 25377.878497: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx complete, eid:1, pending complete count:13 <...>-1488 [001] .... 25377.919927: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit update: delta:11 <...>-1488 [001] .... 25377.919932: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 credit total:13 <...>-1488 [001] .... 25377.919976: ath10k_log_dbg: ath10k_sdio mmc1:0001:1 bundle tx work, eid:1, count:0 <...>-1881 [000] .... 25377.982645: ath10k_log_warn: ath10k_sdio mmc1:0001:1 HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION status:0 <...>-1513 [001] .... 25377.982973: ath10k_log_err: ath10k_sdio mmc1:0001:1 ath10k_mac_wait_tx_complete time_left:1810, pending:0-0 Flush all pending TX packets for the 1st ath10k_flush reduced the wait time of the 2nd ath10k_flush and then suspend take short time. This Patch only effect SDIO chips. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200415233730.10581-1-wgong@codeaurora.org commit 2f918ea98606100f3a6d47db7ff7c200838ec4f3 Author: Wen Gong Date: Tue Apr 21 15:09:35 2020 +0300 ath10k: enable alt data of TX path for sdio The default credit size is 1792 bytes, but the IP mtu is 1500 bytes, then it has about 290 bytes's waste for each data packet on sdio transfer path for TX bundle, it will reduce the transmission utilization ratio for data packet. This patch enable the small credit size in firmware, firmware will use the new credit size 1556 bytes, it will increase the transmission utilization ratio for data packet on TX patch. It results in significant performance improvement on TX path. This patch only effect sdio chip, it will not effect PCI, SNOC etc. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410061400.14231-3-wgong@codeaurora.org commit c8334512f3dd1b94844baca629f9bedca4271593 Author: Wen Gong Date: Tue Apr 21 15:09:35 2020 +0300 ath10k: add htt TX bundle for sdio The transmission utilization ratio for sdio bus for small packet is slow, because the space and time cost for sdio bus is same for large length packet and small length packet. So the speed of data for large length packet is higher than small length. Test result of different length of data: data packet(byte) cost time(us) calculated rate(Mbps) 256 28 73 512 33 124 1024 35 234 1792 45 318 14336 168 682 28672 333 688 57344 660 695 This patch change the TX packet from single packet to a large length bundle packet, max size is 32, it results in significant performance improvement on TX path. Also there's a fourth thread "ath10k_tx_complete_wq" added to ath10k as it improves TCP RX throughput (values in Mbps): TCP-RX TCP-TX UDP-RX UDP-TX use workqueue_tx_complete 423 357 448 412 change it to ar->workqueue 410 360 449 414 change it to ar->workqueue_aux 405 339 446 401 This patch only effect sdio chip, it will not effect PCI, SNOC etc. It only enable bundle for sdio chip. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410061400.14231-2-wgong@codeaurora.org commit d81709346ceac7b9131b4a091197b9d7fc5a409f Author: Jason Yan Date: Mon Apr 20 20:37:45 2020 +0800 ath11k: remove conversion to bool in ath11k_debug_fw_stats_process() The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/net/wireless/ath/ath11k/debug.c:198:57-62: WARNING: conversion to bool not needed here drivers/net/wireless/ath/ath11k/debug.c:218:58-63: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420123745.4159-1-yanaijie@huawei.com commit 8af40902f839f5431b89ce2a035ee01e51b31a1d Author: Jason Yan Date: Mon Apr 20 20:37:18 2020 +0800 ath11k: remove conversion to bool in ath11k_dp_rxdesc_mpdu_valid() The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/net/wireless/ath/ath11k/dp_rx.c:255:46-51: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420123718.3384-1-yanaijie@huawei.com commit 33fc918ab89bec747e45e4ffcb2803d37f01dd4d Author: Mauro Carvalho Chehab Date: Sat Apr 18 12:07:11 2020 +0200 media: admin-guide: split driver-specific indexes to new files In order to better organize the main admin-guide index, place the driver-specific indexes on separate files. This ensures a more consistent numbering at the main index. Signed-off-by: Mauro Carvalho Chehab commit a79a0e71ae67ec9f43df9a2d2d611ab56fcef89f Author: Mauro Carvalho Chehab Date: Sat Apr 18 11:59:24 2020 +0200 media: admin-guide: reorganize the guide Separate the generic documentation from the driver-specific parts, and use a better title for the documentation. Signed-off-by: Mauro Carvalho Chehab commit f45ce7a1e582678468afc2c7cc33794dea1ddeca Author: Mauro Carvalho Chehab Date: Sat Apr 18 11:59:20 2020 +0200 media: admin-guide: bt8xx.rst: fix a broken cross-reference The old cards.rst file doesn't exist anymore. Also, it is not the right reference there, as it should be pointing to the bttv-specific cardlist. Signed-off-by: Mauro Carvalho Chehab commit 8cf8f0a68a99de6e5bee188907faf81b40aead28 Author: Mauro Carvalho Chehab Date: Sat Apr 18 11:15:06 2020 +0200 media: admin-guide: add test-drivers While test drivers is probably something that normal users won't bother, it doesn't hurt to add them to the card list. This way, all drivers, except for the ones under staging, would be listed there. Signed-off-by: Mauro Carvalho Chehab commit c84315dd8aece8b400610cd1e4c1614209faac14 Author: Mauro Carvalho Chehab Date: Sat Apr 18 11:13:58 2020 +0200 media: admin-guide: add card lists for radio and firewire Document the supported radio devices, plus document the firewire driver. Signed-off-by: Mauro Carvalho Chehab commit a70559d37a6b564f16b324d6e18dfae48278243f Author: Mauro Carvalho Chehab Date: Sat Apr 18 11:13:58 2020 +0200 media: admin-guide: add SPI cards to platform drivers The SPI cards are also under the concept of "platform" drivers as defined at the section introduction. So, add a SPI card list there. Signed-off-by: Mauro Carvalho Chehab commit c127fa9d3d54e38ca2714c17e82365bc467021b0 Author: Mauro Carvalho Chehab Date: Sat Apr 18 11:08:54 2020 +0200 media: admin-guide: add a list of I2C drivers For completeness, let's add a list of I2C drivers. Signed-off-by: Mauro Carvalho Chehab commit 9436af9eb4e440d5d4d9fa5109eb8ec56b6c7bab Author: Mauro Carvalho Chehab Date: Sat Apr 18 10:56:34 2020 +0200 media: admin-guide: add a list of platform drivers There's no reason why to keep platform drivers out of the card list. Add them. Signed-off-by: Mauro Carvalho Chehab commit 0753351432ef95379b707e65f100048ba9990660 Author: Mauro Carvalho Chehab Date: Sat Apr 18 10:48:04 2020 +0200 media: admin-guide: add a table with USB drivers Having a table with a list of all USB drivers seems worth, and it comes almost for free, as we can just use Kconfig descriptions (with some adjustments). So, add a table for that. Signed-off-by: Mauro Carvalho Chehab commit 0cb8f667ec6adc731c4573609486e25ea48b5057 Author: Mauro Carvalho Chehab Date: Sat Apr 18 10:23:29 2020 +0200 media: admin-guide: add a list of media PCI cards Instead of listing "other" PCI card list, just add a list with the existing drivers (not including sub-drivers). Signed-off-by: Mauro Carvalho Chehab commit 97b202b004b47f8f220a0641a868083181d3656a Author: Mauro Carvalho Chehab Date: Sat Apr 18 10:16:06 2020 +0200 media: admin-guide: replace the frontend drivers list The frontend drivers list is incomplete. Update it from what's there at the Kernel Kconfig files. Signed-off-by: Mauro Carvalho Chehab commit d3cb0832072905db31ab08778cb5cf8482b9f700 Author: Mauro Carvalho Chehab Date: Sat Apr 18 08:40:57 2020 +0200 media: admin-guide: split DVB cards.rst The DVB cards.rst file is old and outdated. It also contains data that are contained on other cardlists. Remove the duplicated information and split frontends and PCI cards on separate files. As all USB cards already have their own card lists, just drop the old USB data there. Signed-off-by: Mauro Carvalho Chehab commit ea90626fdf6ee6ca6aa4843f9bf05dee198db192 Author: Mauro Carvalho Chehab Date: Fri Apr 17 17:58:04 2020 +0200 media: admin-guide: add a cardlist for all other USB cards There are several other USB cards. Most of them support just one device. The only exception is the "pwc" driver. But, as updates to it are not frequent, let's just place everything manually into a single file. Signed-off-by: Mauro Carvalho Chehab commit da95d30bb06e797716776945710cc10c004b3a57 Author: Mauro Carvalho Chehab Date: Fri Apr 17 18:42:24 2020 +0200 media: admin-guide: add a card list for the Siano driver The siano driver looks like em28xx, except that its cards are split on 3 drivers. Add a card list for it. Signed-off-by: Mauro Carvalho Chehab commit 4b45a0cd391a85ef54dedac5a623bcb51a46a48a Author: Mauro Carvalho Chehab Date: Fri Apr 17 12:36:51 2020 +0200 media: admin-guide: add support for the remaining dvb-usb boards Add documentation for the remaining dvb-usb boards. Signed-off-by: Mauro Carvalho Chehab commit f21067392bbda75b175edc6dc9bb5066240b94be Author: Mauro Carvalho Chehab Date: Fri Apr 17 10:58:43 2020 +0200 media: admin-guide: add dibusb-mb and dibusb-mc card lists Document the supported dib0300 boards. Signed-off-by: Mauro Carvalho Chehab commit 9f054a7e7d1f625124e55d3666d8df42e12f9f6c Author: Mauro Carvalho Chehab Date: Thu Apr 16 17:07:03 2020 +0200 media: admin-guide: add cardlist for dib0700 driver Document the cards supported by dib0700 driver. Signed-off-by: Mauro Carvalho Chehab commit 760ec48b6bea48b052b292c16ac1fb2958a7ef5f Author: Mauro Carvalho Chehab Date: Thu Apr 16 15:17:06 2020 +0200 media: admin-guide: add dvb-usb-v2 card lists Include cardlist documentation for the sub-drivers supported by dvb-usb-v2 core. Signed-off-by: Mauro Carvalho Chehab commit 17ce5e6d72d5acc838e8e6218c3fadc2a7abe7da Author: Mauro Carvalho Chehab Date: Thu Apr 16 14:20:54 2020 +0200 media: admin-guide: improve cardlist.rst documentation The cardlist section is important for some boards, because they may require extra modprobe parameters. Improve the docs to mention that. Thanks-to: Hans Verkuil # for providing me some PCI IDs Signed-off-by: Mauro Carvalho Chehab commit 2aca74c8b1a1496ec39051b1e8ed2337a4755ed5 Author: Mauro Carvalho Chehab Date: Thu Apr 16 13:31:50 2020 +0200 media: admin-guide: add a generic building guide Several of the existing documents under the media admin-guide contain build procedures. Add an specific chapter describing it. This document was partially inspired on the modifications I made to the bttv.rst file. Signed-off-by: Mauro Carvalho Chehab commit d9d43617bb1324b82db6169660e44f53348c7181 Author: Mauro Carvalho Chehab Date: Thu Apr 16 13:31:40 2020 +0200 media: admin-guide: Add an introduction chapter The media's admin guide is currently just a group of not-connected docs. Add an introduction chapter for it to start making sense to a random reader. Signed-off-by: Mauro Carvalho Chehab commit 433c8e566098423b7eaf6ac462f5df54bed7c8d8 Author: Mauro Carvalho Chehab Date: Thu Apr 16 12:37:23 2020 +0200 media: admin-guide: update em28xx cardlist A new em28xx card was added upstream. Update cards list accordingly. Signed-off-by: Mauro Carvalho Chehab commit 74da0d515c20e567456b1b0b382e583d9d0c4ab3 Author: Mauro Carvalho Chehab Date: Thu Apr 16 12:24:02 2020 +0200 media: admin-guide: add a card list for cx231xx boards It is interesting to have a card list also for cx231xx driver, as it currently supports 27 different boards. Signed-off-by: Mauro Carvalho Chehab commit 787103913b9135610db97aea17a9729d04d071e7 Author: Mauro Carvalho Chehab Date: Fri Apr 17 17:29:40 2020 +0200 media: pwc-if: place USB device list on numberical order It seems easier to maintain the list if the USB_DEVICE is ordered. Signed-off-by: Mauro Carvalho Chehab commit 52b88c87e22b5b8dc4de52c2bf2ef16f46e6cdd5 Author: Mauro Carvalho Chehab Date: Fri Apr 17 17:26:56 2020 +0200 media: pwc-if.c: Update comments about each pwc supported model The USB_DEVICE() list contain some of the product names, but some are missing, and others are different than the message printed during device detection. Update the comments in order to match what the driver prints. That makes easier to discover what model matches what physical device. Signed-off-by: Mauro Carvalho Chehab commit 8cbaa12100a1f84b1fbe4b68aae2a10104d41e27 Author: Mauro Carvalho Chehab Date: Thu Apr 16 16:11:52 2020 +0200 media: dvb-usb-v2: use DVB_USB_DEVICE() macro Instead of using USB_DEVICE() macro directly, use the DVB_USB_DEVICE() one, as other dvb-usb-v2 devices. The usage of the new macro makes cleaner and easier to parse the supported device names in a way that it would be easily parseable to generate cardlists. Signed-off-by: Mauro Carvalho Chehab commit 49c6644eb6acc71a76a46bedb17dd204b105161b Author: Mauro Carvalho Chehab Date: Thu Apr 16 15:58:55 2020 +0200 media: dvb-usb-ids.h: fix an USB PID name The USB_PID_ALINK_DTU is a Product ID, not a vendor ID. Fix that. Signed-off-by: Mauro Carvalho Chehab commit e304142c308979fff404a38118878679ca58a2ba Author: James Smart Date: Tue Apr 21 13:33:54 2020 -0700 scsi: lpfc: remove duplicate unloading checks During code reviews several instances of duplicate module unloading checks were found. Remove the duplicate checks. Link: https://lore.kernel.org/r/20200421203354.49420-1-jsmart2021@gmail.com Reviewed-by: Himanshu Madhani Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 355f46b97dacce6e5da436822c449db000744eac Author: Jason Yan Date: Tue Apr 21 11:41:01 2020 +0800 scsi: mpt3sas: use true,false for bool variables Fix the following coccicheck warning: drivers/scsi/mpt3sas/mpt3sas_base.c:416:6-14: WARNING: Assignment of 0/1 to bool variable drivers/scsi/mpt3sas/mpt3sas_base.c:485:2-10: WARNING: Assignment of 0/1 to bool variable Link: https://lore.kernel.org/r/20200421034101.28273-1-yanaijie@huawei.com Acked-by: Suganath Prabu Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit b7a9d0c6603d233280fbfef9d58154664e4aa478 Author: Jason Yan Date: Tue Apr 21 11:40:08 2020 +0800 scsi: fcoe: remove unneeded semicolon in fcoe.c Fix the following coccicheck warning: drivers/scsi/fcoe/fcoe.c:1918:3-4: Unneeded semicolon drivers/scsi/fcoe/fcoe.c:1930:3-4: Unneeded semicolon Link: https://lore.kernel.org/r/20200421034008.27865-1-yanaijie@huawei.com Reviewed-by: Hannes Reinecke Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit f336c7003c84c6ac6db3ccc70b8cf6a588015871 Author: Jason Yan Date: Sat Apr 18 15:06:25 2020 +0800 scsi: ufs-qcom: remove unneeded variable 'ret' Fix the following coccicheck warning: drivers/scsi/ufs/ufs-qcom.c:575:5-8: Unneeded variable: "ret". Return "0" on line 590 Link: https://lore.kernel.org/r/20200418070625.11756-1-yanaijie@huawei.com Reported-by: Hulk Robot Reviewed-by: Bjorn Andersson Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit ec34143912667c0f34cd6e0667344dde5e725f13 Author: Jason Yan Date: Sat Apr 18 15:06:05 2020 +0800 scsi: st: remove unneeded variable 'result' in st_release() Also remove a strange '^L' after this function. Fix the following coccicheck warning: drivers/scsi/st.c:1460:5-11: Unneeded variable: "result". Return "0" on line 1473 Link: https://lore.kernel.org/r/20200418070605.11450-1-yanaijie@huawei.com Reported-by: Hulk Robot Acked-by: Kai Mäkisara Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit f47ab3c2f5338828a67e89d5f688d2cef9605245 Author: Bryan O'Donoghue Date: Sun Mar 29 13:41:16 2020 +0100 clk: qcom: msm8916: Fix the address location of pll->config_reg During the process of debugging a processor derived from the msm8916 which we found the new processor was not starting one of its PLLs. After tracing the addresses and writes that downstream was doing and comparing to upstream it became obvious that we were writing to a different register location than downstream when trying to configure the PLL. This error is also present in upstream msm8916. As an example clk-pll.c::clk_pll_recalc_rate wants to write to pll->config_reg updating the bit-field POST_DIV_RATIO. That bit-field is defined in PLL_USER_CTL not in PLL_CONFIG_CTL. Taking the BIMC PLL as an example lm80-p0436-13_c_qc_snapdragon_410_processor_hrd.pdf 0x01823010 GCC_BIMC_PLL_USER_CTL 0x01823014 GCC_BIMC_PLL_CONFIG_CTL This pattern is repeated for gpll0, gpll1, gpll2 and bimc_pll. This error is likely not apparent since the bootloader will already have initialized these PLLs. This patch corrects the location of config_reg from PLL_CONFIG_CTL to PLL_USER_CTL for all relevant PLLs on msm8916. Fixes commit 3966fab8b6ab ("clk: qcom: Add MSM8916 Global Clock Controller support") Cc: Georgi Djakov Cc: Andy Gross Cc: Bjorn Andersson Cc: Michael Turquette Cc: Stephen Boyd Signed-off-by: Bryan O'Donoghue Link: https://lkml.kernel.org/r/20200329124116.4185447-1-bryan.odonoghue@linaro.org Signed-off-by: Stephen Boyd commit 89d9c24b391646308b6c1d3a68c8c521c9b8c8e9 Author: Prashant Malani Date: Tue Apr 21 17:41:51 2020 -0700 platform/chrome: typec: Fix ret value check error cros_typec_add_partner() returns 0 on success, so check for "ret" instead of "!ret" as an error. Signed-off-by: Prashant Malani Fixes: 9d33ea331032 ("platform/chrome: cros_ec_typec: Register port partner") Signed-off-by: Benson Leung commit 1aa63ddf726ea049279989b93b69b57ce6efd75b Merge: 774f1eeb18b0 14d0066b8477 Author: Dave Airlie Date: Wed Apr 22 10:40:34 2020 +1000 Merge tag 'drm-misc-next-2020-04-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.8: UAPI Changes: - drm: error out with EBUSY when device has existing master - drm: rework SET_MASTER and DROP_MASTER perm handling Cross-subsystem Changes: - mm: export two symbols from slub/slob - fbdev: savage: fix -Wextra build warning - video: omap2: Use scnprintf() for avoiding potential buffer overflow Core Changes: - Remove drm_pci.h - drm_pci_{alloc/free)() are now legacy - Introduce managed DRM resourcesA - Allow drivers to subclass struct drm_framebuffer - Introduce struct drm_afbc_framebuffer and helpers - fbdev: remove return value from generic fbdev setup - Introduce simple-encoder helper - vram-helpers: set fence on plane - dp_mst: ACT timeout improvements - dp_mst: Remove drm_dp_mst_has_audio() - TTM: ttm_trace_dma_{map/unmap}() cleanups - dma-buf: add flag for PCIP2P support - EDID: Various improvements - Encoder: cleanup semantics of possible_clones and possible_crtcs - VBLANK documentation updates - Writeback documentation updates Driver Changes: - Convert several drivers to i2c_new_client_device() - Drop explicit drm_mode_config_cleanup() calls from drivers - Auto-release device structures with drmm_add_final_kfree() - Init bfdev console after registering DRM device - Make various .debugfs functions return 0 unconditionally; ignore errors - video: Use scnprintf() to avoid buffer overflows - Convert drivers to simple encoders - drm/amdgpu: note that we can handle peer2peer DMA-buf - drm/amdgpu: add support for exporting VRAM using DMA-buf v3 - drm/kirin: Revert change to register connectors - drm/lima: Add optional devfreq and cooling device support - drm/lima: Various improvements wrt. task handling - drm/panel: nt39016: Support multiple modes and 50Hz - drm/panel: Support Leadtek LTK050H3146W - drm/rockchip: Add support for afbc - drm/virtio: Various cleanups - drm/hisilicon/hibmc: Enforce 128-byte stride alignment - drm/qxl: Fix notify port address of cursor ring buffer - drm/sun4i: Improvements to format handling - drm/bridge: dw-hdmi: Various improvements Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200414090738.GA16827@linux-uq9g commit 424a3a706aac4ec70de4414f5bce62c09a3d76e1 Author: Jitao Shi Date: Sat Apr 11 15:44:08 2020 +0800 drm/mediatek: config mipitx impedance with calibration data Read calibration data from nvmem, and config mipitx impedance with calibration data to make sure their impedance are 100ohm. Signed-off-by: Jitao Shi Signed-off-by: Chun-Kuang Hu commit 3d50b59abf64dcaee8595a7c12185a5a75a0782a Author: Jitao Shi Date: Sat Apr 11 15:44:07 2020 +0800 drm/mediatek: add the mipitx driving control Add a property in device tree to control the driving by different board. Reviewed-by: Matthias Brugger Signed-off-by: Jitao Shi Signed-off-by: Chun-Kuang Hu commit 6d3a4aeff2fb4f41ab32cc0d445eebdaa01059df Author: Jitao Shi Date: Sat Apr 11 15:44:06 2020 +0800 dt-bindings: display: mediatek: get mipitx calibration data from nvmem Add properties to get get mipitx calibration data. Reviewed-by: Rob Herring Signed-off-by: Jitao Shi Signed-off-by: Chun-Kuang Hu commit da2a97323133d0c7caeee399881a590eb8e83c34 Author: Jitao Shi Date: Sat Apr 11 15:44:05 2020 +0800 dt-bindings: display: mediatek: add property to control mipi tx drive current Add a property to control mipi tx drive current: "drive-strength-microamp" Signed-off-by: Jitao Shi Reviewed-by: Rob Herring Signed-off-by: Chun-Kuang Hu commit 44dd5efc97dae0dc09ea9316597826c8b0fd1578 Merge: 59211053f099 5287be405ca2 Author: David S. Miller Date: Tue Apr 21 15:38:34 2020 -0700 Merge branch 'Support-programmable-pins-for-Ocelot-PTP-driver' Yangbo Lu says: ==================== Support programmable pins for Ocelot PTP driver The Ocelot PTP clock driver had been embedded into ocelot.c driver. It had supported basic gettime64/settime64/adjtime/adjfine functions by now which were used by both Ocelot switch and Felix switch. This patch-set is to move current ptp clock code out of ocelot.c driver maintaining as a single ocelot_ptp.c driver, and to implement 4 programmable pins with only PTP_PF_PEROUT function for now. The PTP_PF_EXTTS function will be supported in the future, and it should be implemented separately for Felix and Ocelot, because of different hardware interrupt implementation in them. Changes for v2: - Put PTP driver under drivers/net/ethernet/mscc/. - Dropped MAINTAINERS patch. Kept original maintaining. - Initialized PTP separately in ocelot/felix platforms. - Supported PPS case in programmable pin. - Supported disabling pin function since deadlock is fixed by Richard. - Returned -EBUSY if not finding pin available. Changes for v3: - Re-sent. ==================== Signed-off-by: David S. Miller commit 5287be405ca2263a9c524a6b0a7869c59760f4e6 Author: Yangbo Lu Date: Mon Apr 20 10:46:51 2020 +0800 net: dsa: felix: enable PTP programmable pin Enable PTP programmable pin. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit aabb2bb07c963c67b8072aafcca3677e2b235be0 Author: Yangbo Lu Date: Mon Apr 20 10:46:50 2020 +0800 net: mscc: ocelot: enable PTP programmable pin Enable PTP programmable pin. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit cc2d87bb83407c7dfb0900d63b3fcfbf6a59202f Author: Yangbo Lu Date: Mon Apr 20 10:46:49 2020 +0800 net: mscc: ocelot: support 4 PTP programmable pins Support 4 PTP programmable pins with only PTP_PF_PEROUT function for now. The PTP_PF_EXTTS function will be supported in the future, and it should be implemented separately for Felix and Ocelot, because of different hardware interrupt implementation in them. Since the hardware is not able to support absolute start time, the periodic clock request only allows start time 0 0. But nsec could be accepted for PPS case for phase adjustment. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 94aca0824443d32987b31e656044ff7da425c523 Author: Yangbo Lu Date: Mon Apr 20 10:46:48 2020 +0800 net: mscc: ocelot: add wave programming registers definitions Add wave programming registers definitions for Ocelot platforms. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 3007bc7321e3c37de9d7d965cb9fb95aaa00113b Author: Yangbo Lu Date: Mon Apr 20 10:46:47 2020 +0800 net: mscc: ocelot: redefine PTP pins There are 5 PTP_PINS register groups on Ocelot switch. Except the one used for TOD operations, there are still 4 register groups for programmable pins. So redefine the 4 programmable pins. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit d2b09a8e7bcbfa47e7161b20d6387ac968834c21 Author: Yangbo Lu Date: Mon Apr 20 10:46:46 2020 +0800 net: mscc: ocelot: fix timestamp info if ptp clock does not work The timestamp info should be only software timestamp capabilities if ptp clock does not work. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 2b49d128b3f8d8fff8972afcbc603802e5e40c6a Author: Yangbo Lu Date: Mon Apr 20 10:46:45 2020 +0800 net: mscc: ocelot: move ocelot ptp clock code out of ocelot.c The Ocelot PTP clock driver had been embedded into ocelot.c driver. It had supported basic gettime64/settime64/adjtime/adjfine functions by now which were used by both Ocelot switch and Felix switch. This patch is to move current ptp clock code out of ocelot.c driver maintaining as a single ocelot_ptp.c. For futher new features implementation, the common code could be put in ocelot_ptp.c and the switch specific code should be in specific switch driver. The interrupt implementation in SoC is different between Ocelot and Felix. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 37558ac85c197a5ff776b7b2f53046877f2bd4ee Author: Jon Hunter Date: Fri Apr 17 13:40:46 2020 +0100 soc/tegra: fuse: Update the SoC revision attribute to display a name Currently the SoC revision attribute for Tegra devices displays the value of the enum associated with a particular revision. This is not very useful because to obtain the actual revision you need to use the tegra_revision enumeration to translate the value. It is more meaningful to display a name for the revision, such as 'A01', than the enumarated value and therefore, update the revision attribute to display a name. This change does alter the ABI, which is unfortunate, but this is more meaningful and maintable. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit d08a4095abd8174e13c23c733584da9d0de556e7 Author: Jon Hunter Date: Fri Apr 17 13:39:49 2020 +0100 soc/tegra: fuse: Trivial clean-up of tegra_init_revision() Clean-up the tegra_init_revision() function by removing the 'rev' variable which is not needed and use the newly added helper function tegra_get_minor_rev() to get the minor revision. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 379ac9eb1fe94cc40173b83fda1ee8d611a756e9 Author: Jon Hunter Date: Fri Apr 17 13:39:48 2020 +0100 soc/tegra: fuse: Add custom SoC attributes Add a custom SoC attribute for Tegra to expose the HIDREV register fields to userspace via the sysfs. This register provides additional details about the type of device (eg, silicon, FPGA, etc) as well as revision. Exposing this information is useful for identifying the exact device revision and device type. For Tegra devices up until Tegra186, the majorrev and minorrev fields of the HIDREV register are used to determine the device revision and device type. For Tegra194, the majorrev and minorrev fields only determine the revision. Starting with Tegra194, there is an additional field, pre_si_platform (which occupies bits 20-23), that now determines device type. Therefore, for all Tegra devices, add a custom SoC attribute for the majorrev and minorrev fields and for Tegra194 add an additional attribute for the pre_si_platform field. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit c78cf9956f19a7db7199310802ec514266653931 Author: Thierry Reding Date: Fri Apr 17 19:11:16 2020 +0200 soc/tegra: pmc: Enable PMIC wake event on Tegra186 The PMIC wake event can be used to bring the system out of suspend based on certain events happening on the PMIC (such as an RTC alarm). Signed-off-by: Thierry Reding Acked-by: Jon Hunter Tested-by: Jon Hunter commit d70f5e541ab30bf5ff29b219e9d1980e082ba159 Author: Thierry Reding Date: Wed Apr 22 00:00:53 2020 +0200 firmware: tegra: Make BPMP a regular driver The Tegra BPMP driver typically ends up deferring probe because it wants to attach to the SMMU, so there's little sense in registering it at the core init-level. One side-effect of this is that the driver will be probed later even if it doesn't want to attach to an SMMU, which means that consumers will end up deferring probe, which in turn takes care of ordering the suspend and resume queue in the correct way. Currently since suspend/resume order depends on instantiation order, and because BPMP is listed at the very end of the device tree (after most of its consumers), the suspend and resume queue is ordered wrongly, which can cause issues for drivers (like I2C) which suspend after and resume before BPMP. In the case of I2C this typically leads to the clock failing to enable. Besides fixing this suspend/resume ordering issue, this also has the added benefit of allowing the driver to be built as a loadable module, which can help decrease the size of multiplatform kernel. Signed-off-by: Thierry Reding commit 774f1eeb18b016eee460e060a786eee83b14d007 Merge: ae83d0b416db b06ef327e263 Author: Dave Airlie Date: Wed Apr 22 07:03:56 2020 +1000 Merge tag 'drm-intel-next-2020-04-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - drm/i915/perf: introduce global sseu pinning Allow userspace to request at perf/OA open full SSEU configuration on the system to be able to benchmark 3D workloads, at the cost of not being able to run media workloads. (Lionel) Userspace changes: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4021 - drm/i915/perf: add new open param to configure polling of OA buffer Let application choose how often the OA buffer should be checked on the CPU side for data availability for choosig between CPU overhead and realtime nature of data. Userspace changes: https://patchwork.freedesktop.org/series/74655/ (i915 perf recorder is a tool to capture i915 perf data for viewing in GPUVis.) - drm/i915/perf: remove generated code Removal of the machine generated perf/OA test configurations from i915. Used by Mesa v17.1-18.0, and shortly replaced by userspace supplied OA configurations. Removal of configs causes affected Mesa versions to fall back to earlier kernel behaviour (potentially missing metrics). (Lionel) Cross-subsystem Changes: - Backmerge of drm-next - Includes tag 'topic/phy-compliance-2020-04-08' from git://anongit.freedesktop.org/drm/drm-misc Driver Changes: - Fix for GitLab issue #27: Support 5k tiled dual DP display on SKL (Ville) - Fix https://github.com/thesofproject/linux/issues/1719: Broken audio after S3 resume on JSL platforms. (Kai) - Add new Tigerlake PCI IDs (Swathi D.) - Add missing Tigerlake W/As (Matt R.) - Extended Wa_2006604312 to EHL (Matt A) - Add DPCD link_rate quirk for Apple 15" MBP 2017 (v3) (Mario) - Make Wa_14010229206 apply to all Tigerlake steppings (Swathi d) - Extend hotplug detect retry on TypeC connectors to 5 seconds (Imre) - Yield the timeslice if caught waiting on a user semaphore (Chris) - Limit the residual W/A batch to Haswell due to instability on IVB/BYT (Chris) - TBT AUX should use TC power well ops on Tigerlake (Matt R) - Update PMINTRMSK holding fw to make it effective for RPS (Francisco, Chris) - Add YUV444 packed format support for skl+ (Stanislav) - Invalidate OA TLB when closing perf stream to avoid corruption (Umesh) - HDCP: fix Ri prime check done during link check (Oliver) - Rearm heartbeat on sysfs interval change (Chris) - Fix crtc nv12 etc. plane bitmasks for DPMS off (Ville) - Treat idling as a RPS downclock event (Chris) - Leave rps->cur_freq on unpark (Chris) - Ignore short pulse when EDP panel powered off (Anshuman) - Keep the engine awake until the next jiffie, to avoid ping-pong on moderate load (Chris) - Select the deepest available parking mode for rc6 on IVB (Chris) - Optimizations to direct submission execlist path (Chris) - Avoid NULL pointer dereference at intel_read_infoframe() (Chris) - Fix mode private_flags comparison at atomic_check (Uma, Ville) - Use forced codec wake on all gen9+ platforms (Kai) - Schedule oa_config after modifying the contexts (Chris, Lionel) - Explicitly reset both reg and context runtime on GPU reset (Chris) - Don't enable DDI IO power on a TypeC port in TBT mode (Imre) - Fixes to TGL, ICL and EHL vswing tables (Jose) - Fill all the unused space in the GGTT (Chris, imre) - Ignore readonly failures when updating relocs (Chris) - Attempt to find free space earlier for non-pinned VMAs (Chris) - Only wait for GPU activity before unbinding a GGTT fence (Chris) - Avoid data loss on small userspace perf OA polling (Ashutosh) - Watch out for unevictable nodes during eviction (Matt A) - Reinforce the barrier after GTT updates for Ironlake (Chris) - Convert various parts of driver to use drm_device based logging (Wambui, Jani) - Avoid dereferencing already closed context for engine (Chris) - Enable non-contiguous pipe fusing (Anshuman) - Add HW readout of Gamma LUT on ICL (Swati S.) - Use explicit flag to mark unreachable intel_context (Chris) - Cancel a hung context if already closed (Chris) - Add DP VSC/HDR SDP data structures and write routines (Gwan-gyeong) - Report context-is-closed prior to pinning at execbuf (Chris) - Mark timeline->cacheline as destroyed after rcu grace period (Chris) - Avoid live-lock with i915_vma_parked() (Chris) - Avoid gem_context->mutex for simple vma lookup (Chris) - Rely on direct submission to the queue (Chris) - Configure DSI transcoder to operate in TE GATE command mode (Vandita) - Add DI vblank calculation for command mode (Vandita) - Disable periodic command mode if programmed by GOP (Vandita) - Use private flags to indicate TE in cmd mode (Vandita) - Make fences a nice-to-have for FBC on GEN9+ (Jose) - Fix work queuing issue with mixed virtual engine/physical engine submissions (Chris) - Drop final few uses of drm_i915_private.engine (Chris) - Return early after MISSING_CASE for write_dp_sdp (Chris) - Include port sync state in the state dump (Ville) - ELSP workaround switching back to a completed context (Chris) - Include priority info in trace_ports (Chris) - Allow for different modes of interruptible i915_active_wait (Chris) - Split eb_vma into its own allocation (Chris) - Don't read perf head/tail pointers outside critical section (Lionel) - Pause CS flow before execlists reset (Chris) - Make fence revocation unequivocal (Chris) - Drop cached obj->bind_count (Chris) - Peek at the next submission for error interrupts (Chris) - Utilize rcu iteration of context engines (Chris) - Keep a per-engine request pool for power management ops (Chris) - Refactor port sync code into normal modeset flow (Ville) - Check current i915_vma.pin_count status first on unbind (Chris) - Free request pool from virtual engines (Chris) - Flush all the reloc_gpu batch (Chris) - Make exclusive awaits on i915_active optional and allow async waits (Chris) - Wait until the context is finally retired before releasing engines (Chris) - Prefer '%ps' for printing function symbol names (Chris) - Allow setting generic data pointer on intel GT debugfs (Andi) - Constify DP link computation code more (Ville) - Simplify MST master transcoder computation (Ville) - Move TRANS_DDI_FUNC_CTL2 programming where it belongs (Ville) - Move icl_get_trans_port_sync_config() into the DDI code (Ville) - Add definitions for VRR registers and bits (Aditya) - Refactor hardware fence code (Chris) - Start passing latency as parameter to WM calculation (Stanislav) - Kernel selftest and debug tracing improvements (Matt A, Chris, Mika) - Fixes to CI found corner cases and lockdep splats (Chris) - Overall fixes and refactoring to GEM code (Chris) - Overall fixes and refactoring to display code (Ville) - GuC/HuC code improvements (Daniele, Michal Wa) - Static code checker fixes (Nathan, Ville, Colin, Chris) - Fix spelling mistake (Chen) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20200417111548.GA15033@jlahtine-desk.ger.corp.intel.com commit 59211053f099054e0f4c7796a494f4c9c2f79ded Merge: b6246f4d8d07 51161bfc66a6 Author: David S. Miller Date: Tue Apr 21 13:27:38 2020 -0700 Merge branch 'vermagic-non-global' Leon Romanovsky says: ==================== Remove vermagic header from global include folder Changelog: v2: * Changed the implementation of patch #4 to be like Masahiro wants. I personally don't like this implementation and changing it just to move forward this this patchset. v1: https://lore.kernel.org/lkml/20200415133648.1306956-1-leon@kernel.org * Added tags * Updated patch #4 with test results * Changed scripts/mod/modpost.c to create inclusion of vermagic.h from kernel folder and not from general include/linux. This is needed to generate *.mod.c files, while building modules. v0: https://lore.kernel.org/lkml/20200414155732.1236944-1-leon@kernel.org This is followup to the failure reported by Borislav [1] and suggested fix later on [2]. The series removes all includes of linux/vermagic.h, updates hns and nfp to use same kernel versioning scheme (exactly like we did for other drivers in previous cycle) and removes vermagic.h from global include folder. [1] https://lore.kernel.org/lkml/20200411155623.GA22175@zn.tnic [2] https://lore.kernel.org/lkml/20200413080452.GA3772@zn.tnic ==================== Signed-off-by: David S. Miller commit 51161bfc66a68d21f13d15a689b3ea7980457790 Author: Leon Romanovsky Date: Sun Apr 19 18:55:06 2020 +0300 kernel/module: Hide vermagic header file from general use VERMAGIC* definitions are not supposed to be used by the drivers, see this [1] bug report, so introduce special define to guard inclusion of this header file and define it in kernel/modules.h and in internal script that generates *.mod.c files. In-tree module build: ➜ kernel git:(vermagic) ✗ make clean ➜ kernel git:(vermagic) ✗ make M=drivers/infiniband/hw/mlx5 ➜ kernel git:(vermagic) ✗ modinfo drivers/infiniband/hw/mlx5/mlx5_ib.ko filename: /images/leonro/src/kernel/drivers/infiniband/hw/mlx5/mlx5_ib.ko <...> vermagic: 5.6.0+ SMP mod_unload modversions Out-of-tree module build: ➜ mlx5 make -C /images/leonro/src/kernel clean M=/tmp/mlx5 ➜ mlx5 make -C /images/leonro/src/kernel M=/tmp/mlx5 ➜ mlx5 modinfo /tmp/mlx5/mlx5_ib.ko filename: /tmp/mlx5/mlx5_ib.ko <...> vermagic: 5.6.0+ SMP mod_unload modversions [1] https://lore.kernel.org/lkml/20200411155623.GA22175@zn.tnic Reported-by: Borislav Petkov Acked-by: Borislav Petkov Acked-by: Jessica Yu Co-developed-by: Masahiro Yamada Signed-off-by: Masahiro Yamada Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit b4f37219813fd126b2cda6d7805d8c61b8cf801a Author: Leon Romanovsky Date: Sun Apr 19 17:18:49 2020 +0300 net/nfp: Update driver to use global kernel version Change nfp driver to use globally defined kernel version. Reported-by: Borislav Petkov Acked-by: Jakub Kicinski Signed-off-by: Leon Romanovsky Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit cad99e506887e257ce8bce826ec25f7854b7e69a Author: Leon Romanovsky Date: Sun Apr 19 17:18:48 2020 +0300 net/hns: Remove custom driver version in favour of global one Use globally defined kernel version instead of custom driver variant. Reported-by: Borislav Petkov Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 1c79031f8a75c132bbd42e3ef20267af97b67466 Author: Leon Romanovsky Date: Sun Apr 19 17:18:47 2020 +0300 drivers: Remove inclusion of vermagic header Get rid of linux/vermagic.h includes, so that MODULE_ARCH_VERMAGIC from the arch header arch/x86/include/asm/module.h won't be redefined. In file included from ./include/linux/module.h:30, from drivers/net/ethernet/3com/3c515.c:56: ./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined 73 | # define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY | In file included from drivers/net/ethernet/3com/3c515.c:25: ./include/linux/vermagic.h:28: note: this is the location of the previous definition 28 | #define MODULE_ARCH_VERMAGIC "" | Fixes: 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers") Co-developed-by: Borislav Petkov Signed-off-by: Borislav Petkov Acked-by: Shannon Nelson # ionic Acked-by: Sebastian Reichel # power Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 33883310cd8ed365a4279600b329c50992e8f528 Author: Chris Wilson Date: Tue Apr 21 18:13:51 2020 +0100 drm/i915/selftests: Unroll the CS frequency loop Having noticed that MI_BB_START is incurring a memory stall (see the correlation with uncore frequency), we have to unroll the loop in order to diminish the impact of the MI_BB_START on the instruction throughput. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200421171351.19575-1-chris@chris-wilson.co.uk commit 7b9121040d83eb9e332f7dbc140eca17643d3586 Author: Adrian Freund Date: Tue Apr 7 15:05:25 2020 +0200 Documentation: scheduler: fix outdated information on sched groups The documentation claims that two sched groups must not overlap. This is no longer true, as overlapping sched groups are used on NUMA systems. This change has been introduced by commit e3589f6c81e47 and was documented by an in-code comment in commit 35a566e6e8a18. Signed-off-by: Adrian Freund Link: https://lore.kernel.org/r/20200407130525.76663-1-adrian@freund.io Signed-off-by: Jonathan Corbet commit 5af438d0dcdbdbc1da4f3abcdf08fe9b1291ca02 Author: Federico Vaga Date: Sun Apr 5 23:06:47 2020 +0200 doc:it_IT: add RISC-V maintenance guidelines Add translation for the RISC-V maintenance guidelines as part of the translation of things related to "process/" Signed-off-by: Federico Vaga Link: https://lore.kernel.org/r/20200405210647.24991-1-federico.vaga@vaga.pv.it Signed-off-by: Jonathan Corbet commit 5bf73b1b1deca46c7459cb4d732ba8bad6da93c5 Author: Kai Vehmanen Date: Mon Apr 20 23:54:31 2020 +0300 ASoC: intel/skl/hda - fix oops on systems without i915 audio codec Recent fix for jack detection caused a regression on systems with HDA audio codec but no HDMI/DP audio via i915 graphics, leading to a kernel oops at device probe. On these systems, HDA bus instance lookup fails, as the first ASoC runtime of the card is connected to a dummy codec (as no HDMI codec is present). Fixes: 3a24f135e6cc ("ASoC: intel/skl/hda - set autosuspend timeout for hda codecs") Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200420205431.13070-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 2f5f5302c569f773f58d7f31db2c9e8bbbacc6a7 Author: Kamal Dasu Date: Mon Apr 20 15:08:53 2020 -0400 spi: bcm-qspi: MSPI_SPCR0_MSB MSTR bit exists only on legacy controllers Set MASTER bit on the MSPI_SPCR0_MSB only for legacy MSPI and HIF_MSPI controllers. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-10-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit ab2b493d174e55867464fdd3212a141815807368 Author: Kamal Dasu Date: Mon Apr 20 15:08:46 2020 -0400 spi: Add support for mspi on brcmstb SoCs Added documentation for compatibility for brcmstb SoCs : 7425, 7429, 7435, 7216, 7278 Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-3-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 43613a77b8d5f2bb36f840afab49d34544fa3b4e Author: Kamal Dasu Date: Mon Apr 20 15:08:52 2020 -0400 spi: bcm-qspi: add support for MSPI sys clk 108Mhz Adding support for MSPI sys clk 108Mhz available on 7216 and 7278 BRCMSTB SoCs. Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-9-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit d9576ae5dcefe75ac8e1655916fa51ba50f9e90b Author: Kamal Dasu Date: Mon Apr 20 15:08:51 2020 -0400 spi: bcm-qspi: Use fastbr setting to allow faster MSPI speeds Setting MSPI_SPCR3.fastbr=1 allows using clock divider (SPBR) values of 1-7, while the default value prohibits these values and requires a minimum clock divider value of 8. Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-8-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 3a01f04d74ef7597104f3ace8a053761cb2ac349 Author: Florian Fainelli Date: Mon Apr 20 15:08:47 2020 -0400 spi: bcm-qspi: Handle lack of MSPI_REV offset Older MIPS chips have a QSPI/MSPI controller that does not have the MSPI_REV offset, reading from that offset will cause a bus error. Match their compatible string and do not perform a read from that register in that case. Signed-off-by: Florian Fainelli Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-4-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 66eb228988cf82abb5f633a7d585120923308caf Author: Linus Walleij Date: Wed Apr 15 19:56:13 2020 +0200 spi: orion: Convert to use GPIO descriptors This converts the Orion SPI master to use GPIO descriptors. The SPI core will obtain and manage the CS GPIOs, if any are defined. I make one sematic change: when a certain chip select is using a GPIO line instead of the native CS I simply just enable the 1:1 mapped native CS that would have been used if the GPIO was not there. As we set the SPI_MASTER_GPIO_SS the .set_cs() callback will be called for all chip selects whether native or not, and the important thing for the driver is that the previous native chip select (if any) is deasserted, which other chip select is asserted instead does not really matter. The previous code went to great lengths to ascertain that the first hw CS which was hiding behind a GPIO line was used for all cases when the line is not using native chip select but this should not matter at all, just use the one "underneath" the GPIO at all times. When a GPIO is used for CS, the SPI_CS_HIGH flag is enforced, so the native chip select is also inverted. But that should not matter since we are not using it anyways. Signed-off-by: Linus Walleij Cc: Gregory CLEMENT Cc: Tomas Paukrt Cc: Jan Kundrát Link: https://lore.kernel.org/r/20200415175613.220767-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit cd2f45b7514cdddabbf3f81a98a20ae02f99efa1 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Apr 20 19:32:56 2020 +0100 x86/vdso/Makefile: Add vobjs32 Treat ia32/i386 objects in array the same as 64-bit vdso objects. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200420183256.660371-5-dima@arista.com commit 833e55bb99bce116682efb94870b5c9f8a66f6af Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Apr 20 19:32:55 2020 +0100 x86/vdso/vdso2c: Convert iterators to unsigned `i` and `j` are used everywhere with unsigned types. Convert `i` to unsigned long in order to avoid signed to unsigned comparisons. Convert `k` to unsigned int with the same purpose. Also, drop `j` as `i` could be used in place of it. Introduce syms_nr for readability. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200420183256.660371-4-dima@arista.com commit 089ef5579fc1b0b748bfb1600b4392f42db6fd5f Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Apr 20 19:32:53 2020 +0100 x86/vdso/vdso2c: Correct error messages on file open err() message in main() is misleading: it should print `outfilename`, which is argv[3], not argv[2]. Correct error messages to be more precise about what failed and for which file. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200420183256.660371-2-dima@arista.com commit 787a46c02792f2e9d8b11176381741726120c009 Merge: 8baa3b5a6ab8 955ac624058f Author: Mark Brown Date: Tue Apr 21 19:22:09 2020 +0100 Merge series "ASoC: Add new module driver for new ASRC" from Shengjiu Wang : Add new module driver for new ASRC in i.MX8MN, several commits are added for new property fsl,asrc-format Shengjiu Wang (7): ASoC: fsl_asrc: rename asrc_priv to asrc ASoC: dt-bindings: fsl_asrc: Add new property fsl,asrc-format ASoC: fsl-asoc-card: Support new property fsl,asrc-format ASoC: fsl_asrc: Support new property fsl,asrc-format ASoC: fsl_asrc: Move common definition to fsl_asrc_common ASoC: dt-bindings: fsl_easrc: Add document for EASRC ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers changes in v9 - use lowercase for dt example. changes in v8 - change get_pair_priv_size to pair_priv_size variable changes in v7 - updated according to Nicoin's comments. - add get_pair_priv_size to replace PAIR_PRIVATE_SIZE changes in v6 - updated according to Nicoin's and Rob's comments. changes in v5 - Add new property fsl,asrc-format, rather than change fsl,asrc-width to fsl,asrc-formt. - code change for above change. changes in v4 - Add several commit for changing DT binding asrc-width to asrc-format - rename asrc_priv to asrc changes in v3 - add new commit "ASoC: fsl_asrc: Change asrc_width to asrc_format" - modify binding doc to yaml format - remove fsl_easrc_dma.c, make fsl_asrc_dma.c useable for easrc. changes in v2 - change i.MX815 to i.MX8MN - Add changes in Kconfig and Makefile .../devicetree/bindings/sound/fsl,asrc.txt | 4 + .../devicetree/bindings/sound/fsl,easrc.yaml | 101 + sound/soc/fsl/Kconfig | 11 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/fsl-asoc-card.c | 24 +- sound/soc/fsl/fsl_asrc.c | 305 +-- sound/soc/fsl/fsl_asrc.h | 74 +- sound/soc/fsl/fsl_asrc_common.h | 106 + sound/soc/fsl/fsl_asrc_dma.c | 54 +- sound/soc/fsl/fsl_easrc.c | 2114 +++++++++++++++++ sound/soc/fsl/fsl_easrc.h | 651 +++++ 11 files changed, 3212 insertions(+), 234 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/fsl,easrc.yaml create mode 100644 sound/soc/fsl/fsl_asrc_common.h create mode 100644 sound/soc/fsl/fsl_easrc.c create mode 100644 sound/soc/fsl/fsl_easrc.h -- 2.21.0 commit 8baa3b5a6ab82a48b8db790667d4f64d8ba3672a Merge: 52e8a94baf90 e7cbe528391a Author: Mark Brown Date: Tue Apr 21 19:22:08 2020 +0100 Merge series "ASoC: add snd_compress_ops and replace" from Kuninori Morimoto : Hi Mark Current snd_soc_component_driver has compr_ops, but it is created for ALSA, not for ALSA SoC. This means it doesn't know the callback is for which component, thus, each callback needs to get component via lookup function. It is not good design, and will not work in the future, because ASoC can have multipul same name component which current lookup function can't handle. This v2 patch-set adds new snd_compress_ops and call callbacks with component. v1 is here Link: https://lore.kernel.org/alsa-devel/87blnqpuqp.wl-kuninori.morimoto.gx@renesas.com/ Kuninori Morimoto (8): ASoC: soc-compress: add snd_compress_ops ASoC: codec: wm_adsp: use snd_compress_ops ASoC: uniphier: use snd_compress_ops ASoC: qcom: q6sp6: use snd_compress_ops ASoC: intel: atom: use snd_compress_ops ASoC: sof: use snd_compress_ops ASoC: sprd: use snd_compress_ops ASoC: soc-compress: remove snd_compr_ops include/sound/soc-component.h | 40 ++++++++- sound/soc/codecs/cs47l15.c | 9 +- sound/soc/codecs/cs47l24.c | 8 +- sound/soc/codecs/cs47l35.c | 9 +- sound/soc/codecs/cs47l85.c | 9 +- sound/soc/codecs/cs47l90.c | 9 +- sound/soc/codecs/cs47l92.c | 9 +- sound/soc/codecs/wm5102.c | 9 +- sound/soc/codecs/wm5110.c | 8 +- sound/soc/codecs/wm_adsp.c | 18 ++-- sound/soc/codecs/wm_adsp.h | 18 ++-- .../intel/atom/sst-mfld-platform-compress.c | 43 +++++---- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- sound/soc/intel/atom/sst-mfld-platform.h | 2 +- sound/soc/qcom/qdsp6/q6asm-dai.c | 51 ++++++----- sound/soc/soc-compress.c | 89 ++++++++++--------- sound/soc/sof/compress.c | 7 +- sound/soc/sof/compress.h | 7 +- sound/soc/sof/pcm.c | 4 +- sound/soc/sof/sof-priv.h | 2 +- sound/soc/sprd/sprd-pcm-compress.c | 49 +++++----- sound/soc/sprd/sprd-pcm-dma.c | 2 +- sound/soc/sprd/sprd-pcm-dma.h | 2 +- sound/soc/uniphier/aio-compress.c | 45 ++++++---- sound/soc/uniphier/aio-dma.c | 2 +- sound/soc/uniphier/aio.h | 2 +- 26 files changed, 265 insertions(+), 190 deletions(-) -- 2.17.1 commit 52e8a94baf9026276fcdc9ff21a50dc2ca0bc94b Author: Sven Van Asbroeck Date: Fri Apr 17 18:13:41 2020 -0400 ASoC: Add initial ZL38060 driver The ZL38060 is a "Connected Home Audio Processor" from Microsemi, which consists of a Digital Signal Processor (DSP), several Digital Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs. This driver supports only a tiny subset of the chip's functionality and possible configurations: - bypass mode (whole dsp block is bypassed) - chip's I2S DAI routed directly to/from DACs and microphone - chip's internal clock is driven by a 12 MHz external crystal - chip's DAI connected to CPU is I2S, and bit + frame clock master - chip must be strapped for "host boot": in this mode, firmware will be provided by this driver. Signed-off-by: Sven Van Asbroeck Link: https://lore.kernel.org/r/20200417221341.31428-2-TheSven73@gmail.com Signed-off-by: Mark Brown commit 19f303caf63693502cf34897ade76202afe5f445 Author: Sven Van Asbroeck Date: Fri Apr 17 18:13:40 2020 -0400 dt-bindings: sound: add Microsemi ZL38060 binding Add devicetree binding for the Microsemi ZL38060 Connected Home Audio Processor. Signed-off-by: Sven Van Asbroeck Link: https://lore.kernel.org/r/20200417221341.31428-1-TheSven73@gmail.com Signed-off-by: Mark Brown commit e7cbe528391ab6660f747095efb6ee1542e4f205 Author: Kuninori Morimoto Date: Mon Apr 20 16:10:15 2020 +0900 ASoC: soc-compress: remove snd_compr_ops snd_compr_ops couldn't care called component, but now we can care it via snd_compress_ops. All drivers switched to it. This patch removes snd_compr_ops. Signed-off-by: Kuninori Morimoto Tested-by: Charles Keepax Reviewed-by: Charles Keepax Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87lfmqvdig.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 27ecad217c1437761cb4a9e1409d08bd287c18ed Author: Kuninori Morimoto Date: Mon Apr 20 16:10:00 2020 +0900 ASoC: sprd: use snd_compress_ops We can use snd_compress_ops. Let's switch to use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87mu76vdiv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 39118ce50b85496c0d78614474009fb8cbebb857 Author: Kuninori Morimoto Date: Mon Apr 20 16:09:48 2020 +0900 ASoC: sof: use snd_compress_ops We can use snd_compress_ops. Let's switch to use it. Upstream code doesn't have sof_compressed_ops. This patch assume it is implemented at out-of-tree. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87o8rmvdj7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c60e4459c42de356b5cc49830fc08e5fd372a8cd Author: Kuninori Morimoto Date: Mon Apr 20 16:09:09 2020 +0900 ASoC: intel: atom: use snd_compress_ops vWe can use snd_compress_ops. Let's switch to use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87pnc2vdka.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 849db80ef0ba272dbffe2ca5de6f3ffa09b5a76c Author: Kuninori Morimoto Date: Mon Apr 20 16:08:44 2020 +0900 ASoC: qcom: q6sp6: use snd_compress_ops We can use snd_compress_ops. Let's switch to use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87r1wivdkz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 171d1785c703e2f3713a877881412145f6ce98ca Author: Kuninori Morimoto Date: Mon Apr 20 16:08:30 2020 +0900 ASoC: uniphier: use snd_compress_ops We can use snd_compress_ops. Let's switch to use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87sggyvdld.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3a5ccf25ee184510980a2c48606f7a004a2c844b Author: Kuninori Morimoto Date: Mon Apr 20 16:08:13 2020 +0900 ASoC: codec: wm_adsp: use snd_compress_ops We can use snd_compress_ops. Let's switch to use it. Signed-off-by: Kuninori Morimoto Tested-by: Charles Keepax Reviewed-by: Ranjani Sridharan Acked-by: Charles Keepax Link: https://lore.kernel.org/r/87tv1evdlu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c6cb522c1461eee41f086839bd3c9cb622cd26ca Author: Kuninori Morimoto Date: Mon Apr 20 16:07:50 2020 +0900 ASoC: soc-compress: add snd_compress_ops Current snd_soc_component_driver has compr_ops, and each driver can have callback via it. But, it is mainly created for ALSA, thus, it doesn't have "component" as parameter. Thus, each callback can't know it is called for which component. Each callback currently is getting "component" by using snd_soc_rtdcom_lookup() with driver name. --- ALSA SoC --- ... if (component->driver->compr_ops && component->driver->compr_ops->open) => return component->driver->compr_ops->open(stream); ... --- driver --- static int xxx_open(struct snd_compr_stream *stream) { struct snd_soc_pcm_runtime *rtd = stream->private_data; => struct snd_soc_component *component = snd_soc_rtdcom_lookup(..); ... } It works today, but, will not work in the future if we support multi CPU/Codec/Platform, because 1 rtd might have multiple same driver name component. To solve this issue, each callback need to be called with component. We already have many component driver callbacks. This patch adds new snd_compress_ops, and call it with "component". --- ALSA SoC --- ... if (component->driver->compress_ops->open) => return component->driver->compress_ops->open( component, substream); ~~~~~~~~~ ... --- driver --- static int xxx_open(struct snd_soc_component *component, struct snd_compr_stream *stream) { => /* it don't need to use snd_soc_rtdcom_lookup() */ ... } Signed-off-by: Kuninori Morimoto Tested-by: Charles Keepax Reviewed-by: Charles Keepax Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87v9luvdmh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 6abf4a2f80eab562a41dff1ade14e2d85743bc9f Author: Christoph Hellwig Date: Tue Apr 21 19:11:36 2020 +0200 ASoC: txx9: add back the hack for a too small resource_size_t Looks like I misread the Kconfig magic and this driver can be compiled into 32-bit kernels. Add back the hack to extent the range of the resource_size_t, and include the header with the txx9-specific ioremap magic for that. Fixes: acfaaf52ebfd ("ASoC: txx9: don't work around too small resource_size_t") Signed-off-by: Christoph Hellwig Acked-by: Mark Brown Signed-off-by: Thomas Bogendoerfer commit 4f39467e523e5fc8064dbabde8e927b1337e5b7e Author: Russell King Date: Sat Mar 28 13:03:02 2020 +0000 Update rmk's email address in various drivers Globally update my email address in six files scattered through the tree. Acked-by: Sam Ravnborg Acked-by: Hans Verkuil Signed-off-by: Russell King commit c281634c865202e2776b0250678ff93c771947ff Author: Russell King Date: Fri Apr 3 11:06:47 2020 +0100 ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl() We no longer need to switch to KERNEL_DS mode in sys_oabi_epoll_ctl() as we can use do_epoll_ctl() to avoid the additional copy. Reviewed-by: Christoph Hellwig Signed-off-by: Russell King commit 441ba630ac92f2cf33bc4830722aed276d988357 Author: Tomi Valkeinen Date: Fri Apr 17 14:30:20 2020 +0300 ARM: dts: am57xx-idk-common: add tc358778 bridge AM5 IDK boards have TC358778 DPI-to-DSI bridge. Two different DSI panel models are used with the AM5 IDKs, and these panels are added with DT overlays. The AM5 IDKs can also be used without any panel. Add TC358778 data to the am57xx-idk-common.dtsi, but set the status to disabled. Signed-off-by: Tomi Valkeinen Signed-off-by: Tony Lindgren commit 520557d4854b399606a6d2eb0666350ddad04f0c Author: Jason Kridner Date: Sat Apr 4 20:28:45 2020 +0200 ARM: dts: am5729: beaglebone-ai: adding device tree BeagleBoard.org BeagleBone AI is an open source hardware single board computer based on the Texas Instruments AM5729 SoC featuring dual-core 1.5GHz Arm Cortex-A15 processor, dual-core C66 digital signal processor (DSP), quad-core embedded vision engine (EVE), Arm Cortex-M4 processors, dual programmable realtime unit industrial control subsystems and more. The board features 1GB DDR3L, USB3.0 Type-C, USB HS Type-A, microHDMI, 16GB eMMC flash, 1G Ethernet, 802.11ac 2/5GHz, Bluetooth, and BeagleBone expansion headers. For more information, refer to: https://beaglebone.ai This patch introduces the BeagleBone AI device tree. Note that the device use the "ti,tpd12s016" component which is software compatible with "ti,tpd12s015". Thus we only use the latter driver. Signed-off-by: Jason Kridner Signed-off-by: Caleb Robey Signed-off-by: Drew Fustini Cc: Robert Nelson Signed-off-by: Tony Lindgren commit d85d5247885ef2e8192287b895c2e381fa931b0b Author: Stefan Agner Date: Sun Mar 29 22:33:14 2020 +0200 ARM: OMAP2+: drop unnecessary adrl The adrl instruction has been introduced with commit dd31394779aa ("ARM: omap3: Thumb-2 compatibility for sleep34xx.S"), back when this assembly file was considerably longer. Today adr seems to have enough reach, even when inserting about 60 instructions between the use site and the label. Replace adrl with conventional adr instruction. This allows to build this file using Clang's integrated assembler (which does not support the adrl pseudo instruction). Link: https://github.com/ClangBuiltLinux/linux/issues/430 Signed-off-by: Stefan Agner Signed-off-by: Tony Lindgren commit 675a59b7dec6e03c5fb060f18fc25b2e56be3c7a Author: Masahiro Yamada Date: Sat Feb 15 15:38:52 2020 +0900 x86/boot/build: Add phony targets in arch/x86/boot/Makefile to PHONY These targets are correctly added to PHONY in arch/x86/Makefile, but not in arch/x86/boot/Makefile. Thus, with a file 'install' in the top directory, 'make install' does nothing: $ touch install $ make install make[1]: 'install' is up to date. Add them to the PHONY targets in the boot Makefile too. [ bp: Massage. ] Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200215063852.8298-2-masahiroy@kernel.org commit 14bbe3e33710be52f21d61253a94c5f44a696d02 Author: Matthew Wilcox (Oracle) Date: Wed Apr 1 10:33:43 2020 -0700 docs: Add rbtree documentation to the core-api This file is close enough to being in rst format that I didn't feel the need to alter it in any way. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Michel Lespinasse Link: https://lore.kernel.org/r/20200401173343.17472-1-willy@infradead.org Signed-off-by: Jonathan Corbet commit 30ce434e44d7e142e7a36c6b3eb2545adf692c67 Author: Masahiro Yamada Date: Sat Feb 15 15:38:51 2020 +0900 x86/boot/build: Make 'make bzlilo' not depend on vmlinux or $(obj)/bzImage bzlilo is an installation target because it copies files to $(INSTALL_PATH)/, then runs 'lilo'. However, arch/x86/Makefile and arch/x86/boot/Makefile have it depend on vmlinux and $(obj)/bzImage, respectively. 'make bzlilo' may update some build artifacts in the source tree. As commit 19514fc665ff ("arm, kbuild: make "make install" not depend on vmlinux") explained, this should not happen. Make 'bzlilo' not depend on any build artifact. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200215063852.8298-1-masahiroy@kernel.org commit 955ac624058f91172b3b8820280556e699e1e0ff Author: Shengjiu Wang Date: Thu Apr 16 20:25:37 2020 +0800 ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. It is different with old ASRC module. The primary features for the EASRC are as follows: - 4 Contexts - groups of channels with an independent time base - Fully independent and concurrent context control - Simultaneous processing of up to 32 audio channels - Programmable filter charachteristics for each context - 32, 24, 20, and 16-bit fixed point audio sample support - 32-bit floating point audio sample support - 8kHz to 384kHz sample rate - 1/16 to 8x sample rate conversion ratio Signed-off-by: Shengjiu Wang Signed-off-by: Cosmin-Gabriel Samoila Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/260d7a9fbddf9fa90760d30095df60a4c25fd0a1.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit a960de4da241d409a73e318ab19e6b5fdcd95a83 Author: Shengjiu Wang Date: Thu Apr 16 20:25:36 2020 +0800 ASoC: dt-bindings: fsl_easrc: Add document for EASRC EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. Signed-off-by: Shengjiu Wang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/3195cad960113a089d63c10e2268d63b253a69c5.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit be7bd03f0201b5a513ced98c08444a140eab92ea Author: Shengjiu Wang Date: Thu Apr 16 20:25:35 2020 +0800 ASoC: fsl_asrc: Move common definition to fsl_asrc_common There is a new ASRC included in i.MX serial platform, there are some common definition can be shared with each other. So move the common definition to a separate header file. And add fsl_asrc_pair_priv and fsl_asrc_priv for the variable specific for the module, which can be used internally. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/7106993928ea9e9720e6b42ec601871103155b1c.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 4520af41fd21863d026d53c7e1eb987509cb3c24 Author: Shengjiu Wang Date: Thu Apr 16 20:25:34 2020 +0800 ASoC: fsl_asrc: Support new property fsl,asrc-format In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/2be9664768f32982ba4f71e49749f7390096ac9f.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 859e364302c510cfdd9abda13a3c4c1d1bc68c57 Author: Shengjiu Wang Date: Thu Apr 16 20:25:33 2020 +0800 ASoC: fsl-asoc-card: Support new property fsl, asrc-format In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/02f53d5512b9acd3492e2acdd5e0ba3113f18009.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit b84b4c9a688d803b0e7cf91fec9a5d8b3ba47768 Author: Shengjiu Wang Date: Thu Apr 16 20:25:32 2020 +0800 ASoC: dt-bindings: fsl_asrc: Add new property fsl, asrc-format In order to support new EASRC and simplify the code structure, We decide to share the common structure between them. This bring a problem that EASRC accept format directly from devicetree, but ASRC accept width from devicetree. In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, then driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Acked-by: Rob Herring Link: https://lore.kernel.org/r/e7acbde4b26a82b674a4091515a219e09f847eac.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 7470704d8b425c4c7045884690f92cf015563aac Author: Shengjiu Wang Date: Thu Apr 16 20:25:31 2020 +0800 ASoC: fsl_asrc: rename asrc_priv to asrc In order to move common structure to fsl_asrc_common.h we change the name of asrc_priv to asrc, the asrc_priv will be used by new struct fsl_asrc_priv. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Link: https://lore.kernel.org/r/722142c2e1b57a95f911db1d42d901b88fc283d6.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit b2965c912a3dbc40821cd27fa5548ae9a086a375 Author: Johan Jonker Date: Fri Apr 3 15:06:07 2020 +0200 media: dt-bindings: media: rockchip-rga: add power-domains property In the old txt situation we add/describe only properties that are used by the driver/hardware itself. With yaml it also filters things in a node that are used by other drivers like 'power-domains' for rk3399, so add it to 'rockchip-rga.yaml'. Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b1f487ef3339de6e9db92a45c054f6bb1679636d Author: Johan Jonker Date: Fri Apr 3 15:06:06 2020 +0200 media: dt-bindings: media: convert rockchip rga bindings to yaml Current dts files for Rockchip with 'rga' nodes are manually verified. In order to automate this process rockchip-rga.txt has to be converted to yaml. Changed: Add missing reg property Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bd3ec9e75893dacfa17f37c7f2bf1c7ed73d4043 Author: Chris Wilson Date: Tue Apr 21 10:25:04 2020 +0100 drm/i915/gt: Poison residual state [HWSP] across resume. Since we may lose the content of any buffer when we relinquish control of the system (e.g. suspend/resume), we have to be careful not to rely on regaining control. A good method to detect when we might be using garbage is by always injecting that garbage prior to first use on load/resume/etc. v2: Drop sanitize callback on cleanup v3: Move seqno reset to timeline enter, so we reset all timelines. However, this is done on every activation during runtime and not reset. The similar level of paranoia we apply to correcting context state after a period of inactivity. Suggested-by: Tvrtko Ursulin Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Venkata Ramana Nayana Cc: Daniele Ceraolo Spurio Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200421092504.7416-1-chris@chris-wilson.co.uk commit d0dd92789f44cb093d1da9a68d40a5f09402462a Author: Dafna Hirschfeld Date: Sat Apr 11 18:06:01 2020 +0200 media: staging: rkisp1: cap: support uv swapped planar formats Planar formats with the u and v planes swapped can be supported by swapping the address of the cb and cr buffers. Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c6a86569e841259d41db81d3d8f619f205be8217 Author: Dafna Hirschfeld Date: Sat Apr 11 18:06:00 2020 +0200 media: staging: rkisp1: cap: support uv swap only for semiplanar formats The register RKISP1_CIF_MI_XTD_FORMAT_CTRL is relevant only for semiplanar formats, therefore the uv swap can be supported through this register only for semiplanar formats. Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cf9ba27840c26f649a90bb04db5b455d47810292 Author: Chris Wilson Date: Tue Apr 21 15:22:36 2020 +0100 drm/i915/selftests: Disable C-states when measuring RPS frequency response Let's isolate the impact of cpu frequency selection on determing the GPU throughput in response to selection of RPS frequencies. For real systems, we do have to be concerned with the impact of integrating c-states, p-states and rp-states, but for the sake of proving whether or not RPS works, one baby step at a time. For the record, as one would hope, it does not seem to impact on the measured performance, but we do it anyway to reduce the number of variables. Later, we can extend the testing to encourage the the cpu/pkg to try and sleep while the GPU is busy. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200421142236.8614-1-chris@chris-wilson.co.uk Link: https://patchwork.freedesktop.org/patch/msgid/20200421142236.8614-1-chris@chris-wilson.co.uk commit b82b3993745946def468694be6075fcbde53c287 Author: Dafna Hirschfeld Date: Sat Apr 11 18:05:59 2020 +0200 media: staging: rkisp1: cap: change the logic for writing to uv swap register The register RKISP1_CIF_MI_XTD_FORMAT_CTRL is currently written with "on" only if the u,v streams need to be swapped. This patch also write to it with "off" if they don't need to be swapped. Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4ea6b1c456273c6da43a503c55f9eaec2da331cf Author: Chris Wilson Date: Tue Apr 21 13:46:36 2020 +0100 drm/i915/selftests: Show the full scaling curve on failure If we detect that the RPS end points do not scale perfectly, take the time to measure all the in between values as well. We are aborting the test, so we might as well spend the available time gathering critical debug information instead. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200421124636.22554-1-chris@chris-wilson.co.uk commit a557c3fa96c867b8f98a6bb65deb8c6b1de7c2c5 Author: Dafna Hirschfeld Date: Sat Apr 11 18:05:58 2020 +0200 media: staging: rkisp1: cap: fix value written to uv swap register in selfpath The value RKISP1_CIF_MI_XTD_FMT_CTRL_SP_CB_CR_SWAP should be set to the register instead of masking with ~BIT(1) Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ceb348690e29e3b14f9506d2d6d36748b1eda3c2 Author: Dafna Hirschfeld Date: Sat Apr 11 18:05:57 2020 +0200 media: staging: rkisp1: cap: cleanup in mainpath config for uv swap format The value RKISP1_CIF_MI_XTD_FMT_CTRL_MP_CB_CR_SWAP equals BIT(0), Therefore when writing it to the register there is no need to mask it first with ~BIT(0). Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ba99522b2bd08bf3ec7126bd363cf18ade74ed2f Author: Marco Felsch Date: Thu Apr 2 10:49:57 2020 +0200 media: v4l2-image-sizes: add HD and Full-HD definitions Add common (Full-)HD definitions also known as 720p and 1080p. Signed-off-by: Marco Felsch Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 66f92c4e1701d9d3c8b97503bd3aeb614a441a62 Author: Philipp Zabel Date: Wed Mar 18 19:36:49 2020 +0100 media: coda: add RC enable controls Currently the encoder enables the rate control algorithms if the bitrate control is non-zero. Implement the V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE and V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE controls to allow userspace to choose frame-level or macroblock-level rate control updates, or to explicitly disable rate control. Both controls are initially enabled to keep the current behavior. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1d3ac27801e51ca919ba78350d0b0079ceb1a39b Author: Dafna Hirschfeld Date: Tue Mar 17 19:07:01 2020 +0100 media: staging: rkisp1: replace the call to v4l2_async_notifier_parse_fwnode_endpoints_by_port don't call 'v4l2_async_notifier_parse_fwnode_endpoints_by_port' in order to register async subdevices. Instead call 'v4l2_fwnode_endpoint_parse' to parse the remote endpoints and then register each async subdev with 'v4l2_async_notifier_add_fwnode_remote_subdev' Also remove the relevant item in the TODO file Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4d0b43804c1245c63b5f87d89d14affc2195336f Author: Dafna Hirschfeld Date: Tue Mar 17 19:07:00 2020 +0100 media: staging: rkisp1: remove mbus field from rkisp1_sensor_async 'struct v4l2_mbus_config' is a legacy struct that should not be used in new drivers. So replace it with the fields: enum v4l2_mbus_type mbus_type; unsigned int mbus_flags; Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5c3a7db0c7ec4bbd5bd3f48af9be859a8fa3e532 Author: Peter Zijlstra Date: Fri Apr 3 19:13:03 2020 +0200 module: Harden STRICT_MODULE_RWX We're very close to enforcing W^X memory, refuse to load modules that violate this principle per construction. [jeyu: move module_enforce_rwx_sections under STRICT_MODULE_RWX as per discussion] Link: http://lore.kernel.org/r/20200403171303.GK20760@hirez.programming.kicks-ass.net Acked-by: Kees Cook Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Jessica Yu commit 0392727c261bab65a35cd4f82ee9459bc237591d Author: Florian Fainelli Date: Mon Apr 20 15:08:45 2020 -0400 spi: bcm-qspi: Handle clock probe deferral The clock provider may not be ready by the time spi-bcm-qspi gets probed, handle probe deferral using devm_clk_get_optional(). Signed-off-by: Florian Fainelli Signed-off-by: Kamal Dasu Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200420190853.45614-2-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 4df3bea7f9d2ddd9ac2c29ba945c7c4db2def29c Author: Justin Chen Date: Mon Apr 20 15:08:49 2020 -0400 spi: bcm-qspi: when tx/rx buffer is NULL set to 0 Currently we set the tx/rx buffer to 0xff when NULL. This causes problems with some spi slaves where 0xff is a valid command. Looking at other drivers, the tx/rx buffer is usually set to 0x00 when NULL. Following this convention solves the issue. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by: Justin Chen Signed-off-by: Kamal Dasu Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200420190853.45614-6-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 1b7ad8c405c3dc0ad6c2dc61fe21fe7a446cceeb Author: Kamal Dasu Date: Mon Apr 20 15:08:50 2020 -0400 spi: bcm-qspi: Make PM suspend/resume work with SCMI clock management SCMI only passes clk_prepare_enable() and clk_disable_unprepare(), made changes to suspend/resume ops to use the appropriate calls so that PM works for ARM and ARM64 platforms. Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-7-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 742d5958062488d03082a9ff01a6afb3cf7bd634 Author: Kamal Dasu Date: Mon Apr 20 15:08:48 2020 -0400 spi: bcm-qspi: Drive MSPI peripheral SSb pin on cs_change As per the spi core implementation for MSPI devices when the transfer is the last one in the message, the chip may stay selected until the next transfer. On multi-device SPI busses with nothing blocking messages going to other devices, this is just a performance hint; starting a message to another device deselects this one. But in other cases, this can be used to ensure correctness. Some devices need protocol transactions to be built from a series of spi_message submissions, where the content of one message is determined by the results of previous messages and where the whole transaction ends when the chipselect goes intactive. On CS change after completing the last serial transfer, the MSPI driver drives SSb pin CDRAM register correctly according comments in core spi.h as shown below: case 1) EOM =1, cs_change =0: SSb inactive case 2) EOM =1, cs_change =1: SSb active case 3) EOM =0, cs_change =0: SSb active case 4) EOM =0, cs_change =1: SSb inactive Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20200420190853.45614-5-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit e4b0326c4d706fa9cb844878595b55c82f8a4701 Author: Helen Koike Date: Mon Mar 16 22:00:44 2020 +0100 media: staging: rkisp1: cap: serialize start/stop stream In order to support simultaneous streaming from both capture devices, start/stop vb2 calls need to be serialized to allow multiple concurrent calls. Signed-off-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 60e915354c27035717d95af4465cfa1b42b9240a Author: Helen Koike Date: Mon Mar 16 22:00:43 2020 +0100 media: staging: rkisp1: cap: fix return values from pm functions If no errors occurs, pm functions return usage counters, so they can return positive numbers. This happens when streaming from multiple capture devices (mainpath and selfpath). Fix simultaneous streaming from mainpath and selfpath by not failing when pm usage counters returns a positive number. Signed-off-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b2b1046f1de6263e6281d46fd376ee048f09d013 Author: Hans Verkuil Date: Tue Mar 3 12:02:00 2020 +0100 media: v4l2-ctrls: add __v4l2_ctrl_s_ctrl_compound() Rather than creating new compound control helpers for each new type, create one generic function and just create defines on top. Signed-off-by: Hans Verkuil Tested-by: Paul Kocialkowski Signed-off-by: Mauro Carvalho Chehab commit 7c3bae3f430af6b4fcbdb7272e191e266fd94b45 Author: Hans Verkuil Date: Tue Mar 3 12:01:59 2020 +0100 media: v4l2-ctrls: v4l2_ctrl_g/s_ctrl*(): don't continue when WARN_ON If the v4l2_ctrl_g_ctrl*() or __v4l2_ctrl_s_ctrl*() functions are called for the wrong control type then they call WARN_ON since that is a driver error. But they still continue, potentially overwriting data. Change this to return an error (s_ctrl) or 0 (g_ctrl), just to be safe. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ff5d18cb04f4ecccbcf05b7f83ab6df2a0d95c16 Author: Sowjanya Komatineni Date: Mon Jan 13 23:24:24 2020 -0800 ASoC: tegra: Enable audio mclk during tegra_asoc_utils_init() Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30 through Tegra210 and currently Tegra clock driver keeps the audio mclk enabled. With the move of PMC clocks from clock driver into pmc driver, audio mclk enable from clock driver is removed and this should be taken care of by the audio driver. tegra_asoc_utils_init() calls tegra_asoc_utils_set_rate() and audio mclk rate configuration is not needed during init and the rate is actually set during the ->hw_params() callback. So, this patch removes tegra_asoc_utils_set_rate() call and just leaves the audio mclk enabled. Signed-off-by: Sowjanya Komatineni Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1e4e0bf136aa4b4aa59c1e6af19844bd6d807794 Author: Sowjanya Komatineni Date: Mon Jan 13 23:24:23 2020 -0800 ASoC: tegra: Add audio mclk parent configuration Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30 through Tegra210 and currently Tegra clock driver does the initial parent configuration for audio mclk and keeps it enabled by default. With the move of PMC clocks from clock driver into PMC driver, audio clocks parent configuration can be specified through the device tree using assigned-clock-parents property and audio mclk control should be taken care of by the audio driver. This patch has implementation for parent configuration when default parent configuration through assigned-clock-parents property is not specified in the device tree. Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Reviewed-by: Sameer Pujar Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit facb0f4bb35c05fbda41bcd1ef1ddeb41ced4e9f Author: Sowjanya Komatineni Date: Mon Jan 13 23:24:22 2020 -0800 ASoC: nau8825: Change Tegra clk_out_2 provider to PMC Tegra clk_out_1, clk_out_2, and clk_out_3 are part of PMC block and these clocks are moved from the clock driver to PMC driver with PMC as a provider for these clocks. Update bindings document to use PMC as clock provider for clk_out_2 and change ID to PMC clock ID. Reviewed-by: Dmitry Osipenko Acked-by: Rob Herring Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit 0de6db30ef79b391cedd749801a49c485d2daf4b Author: Sowjanya Komatineni Date: Mon Jan 13 23:24:17 2020 -0800 ASoC: tegra: Use device managed resource APIs to get the clock tegra_asoc_utils uses clk_get() to get the clock and clk_put() to free them explicitly. This patch updates it to use device managed resource API devm_clk_get() so the clock will be automatically released and freed when the device is unbound and removes tegra_asoc_utils_fini() as its no longer needed. Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Reviewed-by: Sameer Pujar Signed-off-by: Sowjanya Komatineni Signed-off-by: Thierry Reding commit fdb9e30e9143ac92be79f58c234db9b92c561bd4 Author: Sean Young Date: Wed Apr 15 13:47:38 2020 +0200 media: iguanair: rc drivers no longer need to do locking Since commit 4957133fe32f ("media: lirc: improve locking"), drivers do not need to do any of their own locking. During suspend and resume, no processes are running so no locking is needed. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 038fd4141029879563cf93efb2a09e5935d3df5f Author: Brad Love Date: Thu Nov 14 21:04:08 2019 +0100 media: cx25840: Register labeling, chip specific correction Remove vbi_regs_offset from a group of registers that are 888 specific, include those registers names. Sources used for reference are 885 and 888 datasheets. Add labels to some undocumented registers. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 722b3c140dd471ee484b072793addbb7e2cbd999 Author: Brad Love Date: Thu Nov 14 21:04:07 2019 +0100 media: lgdt3306a: Add CNR v5 stat The CNR is already calculated, so populate DVBv5 CNR stat during read_status. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit d99846cb1c0ecba0856276da5b8c2368dd402623 Author: Brad Love Date: Thu Nov 14 21:04:06 2019 +0100 media: si2157: add on-demand rf strength func Add get_rf_strength callback to get RSSI from the tuner. DVBv5 stat cache is updated. get_rf_strength is called by tuner_core for analog tuners and is also used by some bridge drivers to obtain RSSI directly from the tuner. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 3c1ccbad80802fa8bf807725db75a92d0887c9f2 Author: Brad Love Date: Thu Nov 14 21:04:05 2019 +0100 media: cx231xx: Add i2c device analog tuner support The boards listed below use i2c device drivers and have tuner_type equal TUNER_ABSENT. This means additional support is required to enable the analog tuning capability, a case statement is used to identify these models. Models with analog tuning enabled: - CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx (tested) - CX231XX_BOARD_HAUPPAUGE_935C (tested) - CX231XX_BOARD_HAUPPAUGE_955Q (tested) - CX231XX_BOARD_HAUPPAUGE_975 (tested) - CX231XX_BOARD_EVROMEDIA_FULL_HYBRID_FULLHD (untested) The EvroMedia model was added, since it uses the si2157 tuner and the board profile claims it has analog inputs. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit fbc9a49cf2721ac78b964c3eef7566efc6f1db23 Author: Brad Love Date: Thu Nov 14 21:04:04 2019 +0100 media: cx23885: Add i2c device analog tuner support Hauppauge QuadHD/1265/5525 boards all use i2c device drivers and have tuner_type equal TUNER_ABSENT. This means additional support is required to enable the analog tuning capability, a case statement is used to identify these models. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 2be355a08e191110237b9b908b8af1e3da573d9b Author: Brad Love Date: Thu Nov 14 21:04:03 2019 +0100 media: cx23885: Add analog frontend to HVR5525 Enables the analog tuning frontend for Hauppauge HVR-5525. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit f8e76a5e26792fe1d4dd0afd706bbc17cb8b5ed8 Author: Brad Love Date: Thu Nov 14 21:04:02 2019 +0100 media: cx23885: Add analog frontend to 1265_K4 Enables the analog tuning frontend for Hauppauge HVR-1265_K4. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 81118817c4ae31ad372f187f43b8c7fb2acea0d8 Author: Brad Love Date: Thu Nov 14 21:04:01 2019 +0100 media: cx23885: Add analog frontend to Hauppauge QuadHD Add analog tuner frontend to 888 Hauppauge QuadHD boards Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit e4361015a4aa2960f1441482241520cf095d2de9 Author: Brad Love Date: Thu Nov 14 21:04:00 2019 +0100 media: si2157: module debug option to wait on signal lock In some debugging cases it is useful to know how long it took signal lock to happen after tuning. This can help diagnose line issues. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 578147e968bd0cf6d74f4f04eee5a1f9b7e007da Author: Brad Love Date: Thu Nov 14 21:03:59 2019 +0100 media: si2157: Briefly wait for tuning operation to complete To detect errors in the tuning operation, this waits up 40ms for operation completion status. This allows for error detection and prevents issuing additional commands to the tuner before it is finished. Tuning typically completes in 20-30ms. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 7e80a8d14d9ffa5fbd10652da9a2d93c1cefd6f9 Author: Brad Love Date: Thu Nov 14 21:03:58 2019 +0100 media: si2157: Add analog tuning related functions Include set_analog_params, get_frequency, and get_bandwidth. Tested with NTSC and PAL standards via ch3/4 generator. Other standards are included, but are untested due to lack of generator. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit e955f959ac52e145f27ff2be9078b646d0352af0 Author: Brad Love Date: Thu Nov 14 21:03:57 2019 +0100 media: si2157: Better check for running tuner in init Getting the Xtal trim property to check if running is less error prone. Reset if_frequency if state is unknown. Replaces the previous "garbage check". Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 5741f4affb694653c2cec3d75aa4dd56cae2175b Author: Brad Love Date: Thu Nov 14 21:03:56 2019 +0100 media: si2157: Check error status bit on cmd execute Check error status bit on command execute, if error bit is set return -EAGAIN. Ignore -EAGAIN in probe during device check. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 5714e84fee5068c1829e2f6ab94fc40b0bb34eb5 Author: Brad Love Date: Thu Nov 14 21:03:55 2019 +0100 media: si2157: Enable tuner status flags Enable flags to get status of commands sent to the tuner. Signed-off-by: Brad Love Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 269b3a9ac538c4ae87f84be640b9fa89914a2489 Author: Tiezhu Yang Date: Tue Apr 21 19:59:46 2020 +0800 MIPS: Make sparse_init() using top-down allocation In the current code, if CONFIG_SWIOTLB is set, when failed to get IO TLB memory from the low pages by plat_swiotlb_setup(), it may lead to the boot process failed with kernel panic. (1) On the Loongson and SiByte platform arch/mips/loongson64/dma.c arch/mips/sibyte/common/dma.c void __init plat_swiotlb_setup(void) { swiotlb_init(1); } kernel/dma/swiotlb.c void __init swiotlb_init(int verbose) { ... vstart = memblock_alloc_low(PAGE_ALIGN(bytes), PAGE_SIZE); if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, verbose)) return; ... pr_warn("Cannot allocate buffer"); no_iotlb_memory = true; } phys_addr_t swiotlb_tbl_map_single() { ... if (no_iotlb_memory) panic("Can not allocate SWIOTLB buffer earlier ..."); ... } (2) On the Cavium OCTEON platform arch/mips/cavium-octeon/dma-octeon.c void __init plat_swiotlb_setup(void) { ... octeon_swiotlb = memblock_alloc_low(swiotlbsize, PAGE_SIZE); if (!octeon_swiotlb) panic("%s: Failed to allocate %zu bytes align=%lx\n", __func__, swiotlbsize, PAGE_SIZE); ... } Because IO_TLB_DEFAULT_SIZE is 64M, if the rest size of low memory is less than 64M when call plat_swiotlb_setup(), we can easily reproduce the panic case. In order to reduce the possibility of kernel panic when failed to get IO TLB memory under CONFIG_SWIOTLB, it is better to allocate low memory as small as possible before plat_swiotlb_setup(), so make sparse_init() using top-down allocation. Reported-by: Juxin Gao Co-developed-by: Juxin Gao Signed-off-by: Juxin Gao Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 2a3d47c94ebdfb97bd8aa95343c58b679cb11724 Author: Tiezhu Yang Date: Tue Apr 21 19:59:45 2020 +0800 MIPS: Cleanup code about plat_mem_setup() In the current code, plat_mem_setup() is called by arch_mem_init() instead of setup_arch() and has been declared in asm/bootinfo.h, so modify the code comment to reflect the reality and remove the useless duplicate declartion in arch/mips/kernel/setup.c. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 2c66e281c0330289aad93e6dd722b25fee29306c Author: Tiezhu Yang Date: Tue Apr 21 19:59:44 2020 +0800 MIPS: Do not initialise globals to 0 Fix the following checkpatch error: ERROR: do not initialise globals to 0 #834: FILE: arch/mips/kernel/setup.c:834: +int hw_coherentio = 0; /* Actual hardware supported DMA coherency setting. */ Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 1d2c6c9bd4b768bb665eeeb793dd50c2cebcbf0c Author: Paolo Bonzini Date: Fri Apr 17 12:35:38 2020 -0400 selftests: kvm/set_memory_region_test: do not check RIP if the guest shuts down On AMD, the state of the VMCB is undefined after a shutdown VMEXIT. KVM takes a very conservative approach to that and resets the guest altogether when that happens. This causes the set_memory_region_test to fail because the RIP is 0xfff0 (the reset vector). Restrict the RIP test to KVM_EXIT_INTERNAL_ERROR in order to fix this. Signed-off-by: Paolo Bonzini commit e72436bc3a5206f95bb384e741154166ddb3202e Author: Paolo Bonzini Date: Fri Apr 17 12:21:06 2020 -0400 KVM: SVM: avoid infinite loop on NPF from bad address When a nested page fault is taken from an address that does not have a memslot associated to it, kvm_mmu_do_page_fault returns RET_PF_EMULATE (via mmu_set_spte) and kvm_mmu_page_fault then invokes svm_need_emulation_on_page_fault. The default answer there is to return false, but in this case this just causes the page fault to be retried ad libitum. Since this is not a fast path, and the only other case where it is taken is an erratum, just stick a kvm_vcpu_gfn_to_memslot check in there to detect the common case where the erratum is not happening. This fixes an infinite loop in the new set_memory_region_test. Signed-off-by: Paolo Bonzini commit 997b7e98990cd44243651827e4efa366d9885907 Author: Stefan Raspl Date: Thu Apr 2 10:57:05 2020 +0200 tools/kvm_stat: add sample systemd unit file Add a sample unit file as a basis for systemd integration of kvm_stat logs. Signed-off-by: Stefan Raspl Message-Id: <20200402085705.61155-4-raspl@linux.ibm.com> Signed-off-by: Paolo Bonzini commit 3754afe7cf7cc3693a9c9ff795e9bd97175ca639 Author: Stefan Raspl Date: Thu Apr 2 10:57:04 2020 +0200 tools/kvm_stat: Add command line switch '-L' to log to file To integrate with logrotate, we have a signal handler that will re-open the logfile. Assuming we have a systemd unit file with ExecStart=kvm_stat -dtc -s 10 -L /var/log/kvm_stat.csv ExecReload=/bin/kill -HUP $MAINPID and a logrotate config featuring postrotate /bin/systemctl reload kvm_stat.service endscript Then the overall flow will look like this: (1) systemd starts kvm_stat, logging to A. (2) At some point, logrotate runs, moving A to B. kvm_stat continues to write to B at this point. (3) After rotating, logrotate restarts the kvm_stat unit via systemctl. (4) The kvm_stat unit sends a SIGHUP to kvm_stat, finally making it switch over to writing to A again. Note that in order to keep the structure of the cvs output in tact, we make sure to, in contrast to the standard log format, only write the header once at the beginning of a file. This implies that the header is suppressed when appending to an existing file. Unlike with the standard format, where we append to an existing file by starting out with a header. Signed-off-by: Stefan Raspl Message-Id: <20200402085705.61155-3-raspl@linux.ibm.com> Signed-off-by: Paolo Bonzini commit da1fda288943c37de8e1513b98f6dda40c8cd421 Author: Stefan Raspl Date: Thu Apr 2 10:57:03 2020 +0200 tools/kvm_stat: add command line switch '-z' to skip zero records When running in logging mode, skip records with all zeros (=empty records) to preserve space when logging to files. Signed-off-by: Stefan Raspl Message-Id: <20200402085705.61155-2-raspl@linux.ibm.com> Signed-off-by: Paolo Bonzini commit 1b94f6f81007b4afaea3480ec018bc9236148961 Author: Tianjia Zhang Date: Thu Apr 16 13:10:57 2020 +0800 KVM: Remove redundant argument to kvm_arch_vcpu_ioctl_run In earlier versions of kvm, 'kvm_run' was an independent structure and was not included in the vcpu structure. At present, 'kvm_run' is already included in the vcpu structure, so the parameter 'kvm_run' is redundant. This patch simplifies the function definition, removes the extra 'kvm_run' parameter, and extracts it from the 'kvm_vcpu' structure if necessary. Signed-off-by: Tianjia Zhang Message-Id: <20200416051057.26526-1-tianjia.zhang@linux.alibaba.com> Signed-off-by: Paolo Bonzini commit 4f233371f6bb1578340b6c7034ddf7b76606d4ae Author: Krish Sadhukhan Date: Thu Apr 9 16:50:33 2020 -0400 KVM: nSVM: Check for CR0.CD and CR0.NW on VMRUN of nested guests According to section "Canonicalization and Consistency Checks" in APM vol. 2, the following guest state combination is illegal: "CR0.CD is zero and CR0.NW is set" Signed-off-by: Krish Sadhukhan Message-Id: <20200409205035.16830-2-krish.sadhukhan@oracle.com> Signed-off-by: Paolo Bonzini commit a9ab13ff6e844ad5b3ed39339e6db9a76bb539ad Author: Wanpeng Li Date: Fri Apr 10 10:47:03 2020 -0700 KVM: X86: Improve latency for single target IPI fastpath IPI and Timer cause the main MSRs write vmexits in cloud environment observation, let's optimize virtual IPI latency more aggressively to inject target IPI as soon as possible. Running kvm-unit-tests/vmexit.flat IPI testing on SKX server, disable adaptive advance lapic timer and adaptive halt-polling to avoid the interference, this patch can give another 7% improvement. w/o fastpath -> x86.c fastpath 4238 -> 3543 16.4% x86.c fastpath -> vmx.c fastpath 3543 -> 3293 7% w/o fastpath -> vmx.c fastpath 4238 -> 3293 22.3% Cc: Haiwei Li Signed-off-by: Wanpeng Li Signed-off-by: Sean Christopherson Message-Id: <20200410174703.1138-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 873e1da16918a83cc7440e299dda0dc7ab6db34c Author: Sean Christopherson Date: Fri Apr 10 10:47:02 2020 -0700 KVM: VMX: Optimize handling of VM-Entry failures in vmx_vcpu_run() Mark the VM-Fail, VM-Exit on VM-Enter, and #MC on VM-Enter paths as 'unlikely' so as to improve code generation so that it favors successful VM-Enter. The performance of successful VM-Enter is for more important, irrespective of whether or not success is actually likely. Signed-off-by: Sean Christopherson Message-Id: <20200410174703.1138-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit b8d295f96b6c9745d7eebee622690e0e835c63af Author: Sean Christopherson Date: Wed Apr 15 17:07:39 2020 -0700 KVM: nVMX: Remove non-functional "support" for CR3 target values Remove all references to cr3_target_value[0-3] and replace the fields in vmcs12 with "dead_space" to preserve the vmcs12 layout. KVM doesn't support emulating CR3-target values, despite a variety of code that implies otherwise, as KVM unconditionally reports '0' for the number of supported CR3-target values. This technically fixes a bug where KVM would incorrectly allow VMREAD and VMWRITE to nonexistent fields, i.e. cr3_target_value[0-3]. Per Intel's SDM, the number of supported CR3-target values reported in VMX_MISC also enumerates the existence of the associated VMCS fields: If a future implementation supports more than 4 CR3-target values, they will be encoded consecutively following the 4 encodings given here. Alternatively, the "bug" could be fixed by actually advertisting support for 4 CR3-target values, but that'd likely just enable kvm-unit-tests given that no one has complained about lack of support for going on ten years, e.g. KVM, Xen and HyperV don't use CR3-target values. Signed-off-by: Sean Christopherson Message-Id: <20200416000739.9012-1-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit c36b71503a2268206ebeda6697094ffb4e7e94c2 Author: Paolo Bonzini Date: Thu Apr 16 09:48:07 2020 -0400 KVM: x86/mmu: Avoid an extra memslot lookup in try_async_pf() for L2 Create a new function kvm_is_visible_memslot() and use it from kvm_is_visible_gfn(); use the new function in try_async_pf() too, to avoid an extra memslot lookup. Opportunistically squish a multi-line comment into a single-line comment. Note, the end result, KVM_PFN_NOSLOT, is unchanged. Cc: Jim Mattson Cc: Rick Edgecombe Suggested-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit c583eed6d72bfea853ca7aa645d9295dd2720c6a Author: Sean Christopherson Date: Wed Apr 15 14:44:13 2020 -0700 KVM: x86/mmu: Set @writable to false for non-visible accesses by L2 Explicitly set @writable to false in try_async_pf() if the GFN->PFN translation is short-circuited due to the requested GFN not being visible to L2. Leaving @writable ('map_writable' in the callers) uninitialized is ok in that it's never actually consumed, but one has to track it all the way through set_spte() being short-circuited by set_mmio_spte() to understand that the uninitialized variable is benign, and relying on @writable being ignored is an unnecessary risk. Explicitly setting @writable also aligns try_async_pf() with __gfn_to_pfn_memslot(). Jim Mattson Signed-off-by: Sean Christopherson Message-Id: <20200415214414.10194-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8791585837f659943936b8e1cce9d039436ad1ca Author: Sean Christopherson Date: Wed Apr 15 13:34:54 2020 -0700 KVM: VMX: Cache vmcs.EXIT_INTR_INFO using arch avail_reg flags Introduce a new "extended register" type, EXIT_INFO_2 (to pair with the nomenclature in .get_exit_info()), and use it to cache VMX's vmcs.EXIT_INTR_INFO. Drop a comment in vmx_recover_nmi_blocking() that is obsoleted by the generic caching mechanism. Signed-off-by: Sean Christopherson Message-Id: <20200415203454.8296-6-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 5addc235199f15ae964e7ac6b20cf43f4a661573 Author: Sean Christopherson Date: Wed Apr 15 13:34:53 2020 -0700 KVM: VMX: Cache vmcs.EXIT_QUALIFICATION using arch avail_reg flags Introduce a new "extended register" type, EXIT_INFO_1 (to pair with the nomenclature in .get_exit_info()), and use it to cache VMX's vmcs.EXIT_QUALIFICATION. Signed-off-by: Sean Christopherson Message-Id: <20200415203454.8296-5-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ec0241f3bbe155a58455ce4a6057be5db6529b0f Author: Sean Christopherson Date: Wed Apr 15 13:34:52 2020 -0700 KVM: nVMX: Drop manual clearing of segment cache on nested VMCS switch Drop the call to vmx_segment_cache_clear() in vmx_switch_vmcs() now that the entire register cache is reset when switching the active VMCS, e.g. vmx_segment_cache_test_set() will reset the segment cache due to VCPU_EXREG_SEGMENTS being unavailable. Move vmx_segment_cache_clear() to vmx.c now that it's no longer invoked by the nested code. Signed-off-by: Sean Christopherson Message-Id: <20200415203454.8296-4-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit e5d03de5937e915c8e41b6357c337529dfae6797 Author: Sean Christopherson Date: Wed Apr 15 13:34:51 2020 -0700 KVM: nVMX: Reset register cache (available and dirty masks) on VMCS switch Reset the per-vCPU available and dirty register masks when switching between vmcs01 and vmcs02, as the masks track state relative to the current VMCS. The stale masks don't cause problems in the current code base because the registers are either unconditionally written on nested transitions or, in the case of segment registers, have an additional tracker that is manually reset. Note, by dropping (previously implicitly, now explicitly) the dirty mask when switching the active VMCS, KVM is technically losing writes to the associated fields. But, the only regs that can be dirtied (RIP, RSP and PDPTRs) are unconditionally written on nested transitions, e.g. explicit writeback is a waste of cycles, and a WARN_ON would be rather pointless. Signed-off-by: Sean Christopherson Message-Id: <20200415203454.8296-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 9932b49e5abef0218254d15b8278e3dbee5ceea3 Author: Sean Christopherson Date: Wed Apr 15 13:34:50 2020 -0700 KVM: nVMX: Invoke ept_save_pdptrs() if and only if PAE paging is enabled Invoke ept_save_pdptrs() when restoring L1's host state on a "late" VM-Fail if and only if PAE paging is enabled. This saves a CALL in the common case where L1 is a 64-bit host, and avoids incorrectly marking the PDPTRs as dirty. WARN if ept_save_pdptrs() is called with PAE disabled now that the nested usage pre-checks is_pae_paging(). Barring a bug in KVM's MMU, attempting to read the PDPTRs with PAE disabled is now impossible. Signed-off-by: Sean Christopherson Message-Id: <20200415203454.8296-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4dcefa312a6c1cc2aa2dd8a9ba76d97d63b3bd17 Author: Sean Christopherson Date: Wed Apr 15 10:55:18 2020 -0700 KVM: nVMX: Rename exit_reason to vm_exit_reason for nested VM-Exit Use "vm_exit_reason" for code related to injecting a nested VM-Exit to VM-Exits to make it clear that nested_vmx_vmexit() expects the full exit eason, not just the basic exit reason. The basic exit reason (bits 15:0 of vmcs.VM_EXIT_REASON) is colloquially referred to as simply "exit reason". Note, other flows, e.g. vmx_handle_exit(), are intentionally left as is. A future patch will convert vmx->exit_reason to a union + bit-field, and the exempted flows will interact with the unionized of "exit_reason". Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-10-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 2a7833899f6ab08d654a51f763a85ccf6c744090 Author: Sean Christopherson Date: Wed Apr 15 10:55:17 2020 -0700 KVM: nVMX: Cast exit_reason to u16 to check for nested EXTERNAL_INTERRUPT Explicitly check only the basic exit reason when emulating an external interrupt VM-Exit in nested_vmx_vmexit(). Checking the full exit reason doesn't currently cause problems, but only because the only exit reason modifier support by KVM is FAILED_VMENTRY, which is mutually exclusive with EXTERNAL_INTERRUPT. Future modifiers, e.g. ENCLAVE_MODE, will coexist with EXTERNAL_INTERRUPT. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-9-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit f47baaed4fef3e31baa750cf337fe62bfcaca31f Author: Sean Christopherson Date: Wed Apr 15 10:55:16 2020 -0700 KVM: nVMX: Pull exit_reason from vcpu_vmx in nested_vmx_reflect_vmexit() Grab the exit reason from the vcpu struct in nested_vmx_reflect_vmexit() instead of having the exit reason explicitly passed from the caller. This fixes a discrepancy between VM-Fail and VM-Exit handling, as the VM-Fail case is already handled by checking vcpu_vmx, e.g. the exit reason previously passed on the stack is bogus if vmx->fail is set. Not taking the exit reason on the stack also avoids having to document that nested_vmx_reflect_vmexit() requires the full exit reason, as opposed to just the basic exit reason, which is not at all obvious since the only usages of the full exit reason are for tracing and way down in prepare_vmcs12() where it's propagated to vmcs12. No functional change intended. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-8-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 1d283062c949f16fcc01d8a508b680e50c7d5ea0 Author: Sean Christopherson Date: Wed Apr 15 10:55:15 2020 -0700 KVM: nVMX: Drop a superfluous WARN on reflecting EXTERNAL_INTERRUPT Drop the WARN in nested_vmx_reflect_vmexit() that fires if KVM attempts to reflect an external interrupt. The WARN is blatantly impossible to hit now that nested_vmx_l0_wants_exit() is called from nested_vmx_reflect_vmexit() unconditionally returns true for EXTERNAL_INTERRUPT. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-7-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 2c1f3323802e4c4495bc8cc55d4867ded6014274 Author: Sean Christopherson Date: Wed Apr 15 10:55:14 2020 -0700 KVM: nVMX: Split VM-Exit reflection logic into L0 vs. L1 wants Split the logic that determines whether a nested VM-Exit is reflected into L1 into "L0 wants" and "L1 wants" to document the core control flow at a high level. If L0 wants the VM-Exit, e.g. because the exit is due to a hardware event that isn't passed through to L1, then KVM should handle the exit in L0 without considering L1's configuration. Then, if L0 doesn't want the exit, KVM needs to query L1's wants to determine whether or not L1 "caused" the exit, e.g. by setting an exiting control, versus the exit occurring due to an L0 setting, e.g. when L0 intercepts an action that L1 chose to pass-through. Note, this adds an extra read on vmcs.VM_EXIT_INTR_INFO for exception. This will be addressed in a future patch via a VMX-wide enhancement, rather than pile on another case where vmx->exit_intr_info is conditionally available. Suggested-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-6-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 236871b6744a6b3c8f9653a429cc041bba8908d5 Author: Sean Christopherson Date: Wed Apr 15 10:55:13 2020 -0700 KVM: nVMX: Move nested VM-Exit tracepoint into nested_vmx_reflect_vmexit() Move the tracepoint for nested VM-Exits in preparation of splitting the reflection logic into L1 wants the exit vs. L0 always handles the exit. Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-5-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit fbdd50250396d55bf9986b2b9f271a7e91c111ea Author: Sean Christopherson Date: Wed Apr 15 10:55:12 2020 -0700 KVM: nVMX: Move VM-Fail check out of nested_vmx_exit_reflected() Check for VM-Fail on nested VM-Enter in nested_vmx_reflect_vmexit() in preparation for separating nested_vmx_exit_reflected() into separate "L0 wants exit exit" and "L1 wants the exit" helpers. Explicitly set exit_intr_info and exit_qual to zero instead of reading them from vmcs02, as they are invalid on VM-Fail (and thankfully ignored by nested_vmx_vmexit() for nested VM-Fail). Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-4-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 7b7bd87dbd6aa8c09d5e8a8028bda69c3ab13969 Author: Sean Christopherson Date: Wed Apr 15 10:55:11 2020 -0700 KVM: nVMX: Uninline nested_vmx_reflect_vmexit(), i.e. move it to nested.c Uninline nested_vmx_reflect_vmexit() in preparation of refactoring nested_vmx_exit_reflected() to split up the reflection logic into more consumable chunks, e.g. VM-Fail vs. L1 wants the exit vs. L0 always handles the exit. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 789afc5ccd4ef1374669f788c90a870d4e41074c Author: Sean Christopherson Date: Wed Apr 15 10:55:10 2020 -0700 KVM: nVMX: Move reflection check into nested_vmx_reflect_vmexit() Move the call to nested_vmx_exit_reflected() from vmx_handle_exit() into nested_vmx_reflect_vmexit() and change the semantics of the return value for nested_vmx_reflect_vmexit() to indicate whether or not the exit was reflected into L1. nested_vmx_exit_reflected() and nested_vmx_reflect_vmexit() are intrinsically tied together, calling one without simultaneously calling the other makes little sense. No functional change intended. Reviewed-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200415175519.14230-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 812756a82ea51e3c7ff7ba5e6fa3f34345234bc7 Author: Emanuele Giuseppe Esposito Date: Tue Apr 14 17:56:25 2020 +0200 kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place The macros VM_STAT and VCPU_STAT are redundantly implemented in multiple files, each used by a different architecure to initialize the debugfs entries for statistics. Since they all have the same purpose, they can be unified in a single common definition in include/linux/kvm_host.h Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20200414155625.20559-1-eesposit@redhat.com> Acked-by: Cornelia Huck Signed-off-by: Paolo Bonzini commit 63d04348371b7ea4a134bcf47c79763d969e9168 Author: Paolo Bonzini Date: Wed Apr 1 00:42:22 2020 +0200 KVM: x86: move kvm_create_vcpu_debugfs after last failure point The placement of kvm_create_vcpu_debugfs is more or less irrelevant, since it cannot fail and userspace should not care about the debugfs entries until it knows the vcpu has been created. Moving it after the last failure point removes the need to remove the directory when unwinding the creation. Reviewed-by: Emanuele Giuseppe Esposito Message-Id: <20200331224222.393439-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini commit 1c164cb3ffd084e5359a56abde715acf121e69a4 Author: Uros Bizjak Date: Sat Apr 11 17:36:27 2020 +0200 KVM: SVM: Use do_machine_check to pass MCE to the host Use do_machine_check instead of INT $12 to pass MCE to the host, the same approach VMX uses. On a related note, there is no reason to limit the use of do_machine_check to 64 bit targets, as is currently done for VMX. MCE handling works for both target families. The patch is only compile tested, for both, 64 and 32 bit targets, someone should test the passing of the exception by injecting some MCEs into the guest. For future non-RFC patch, kvm_machine_check should be moved to some appropriate header file. Cc: Paolo Bonzini Cc: Joerg Roedel Cc: Sean Christopherson Signed-off-by: Uros Bizjak Message-Id: <20200411153627.3474710-1-ubizjak@gmail.com> Signed-off-by: Paolo Bonzini commit be100ef136254ab4a3ff223e2288aae6c5809ac6 Author: Sean Christopherson Date: Fri Mar 20 14:28:33 2020 -0700 KVM: VMX: Clean cr3/pgd handling in vmx_load_mmu_pgd() Rename @cr3 to @pgd in vmx_load_mmu_pgd() to reflect that it will be loaded into vmcs.EPT_POINTER and not vmcs.GUEST_CR3 when EPT is enabled. Similarly, load guest_cr3 with @pgd if and only if EPT is disabled. This fixes one of the last, if not _the_ last, cases in KVM where a variable that is not strictly a cr3 value uses "cr3" instead of "pgd". Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-38-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit be01e8e2c632c41c69bb30e7196661ec6e8fdc10 Author: Sean Christopherson Date: Fri Mar 20 14:28:32 2020 -0700 KVM: x86: Replace "cr3" with "pgd" in "new cr3/pgd" related code Rename functions and variables in kvm_mmu_new_cr3() and related code to replace "cr3" with "pgd", i.e. continue the work started by commit 727a7e27cf88a ("KVM: x86: rename set_cr3 callback and related flags to load_mmu_pgd"). kvm_mmu_new_cr3() and company are not always loading a new CR3, e.g. when nested EPT is enabled "cr3" is actually an EPTP. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-37-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ce8fe7b77bd8ee405295e349c82d0ef8c9788200 Author: Sean Christopherson Date: Fri Mar 20 14:28:31 2020 -0700 KVM: nVMX: Free only the affected contexts when emulating INVEPT Add logic to handle_invept() to free only those roots that match the target EPT context when emulating a single-context INVEPT. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-36-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 9805c5f74b8a65da397ec6b70734e44f1f191c0b Author: Sean Christopherson Date: Fri Mar 20 14:28:30 2020 -0700 KVM: nVMX: Don't flush TLB on nested VMX transition Unconditionally skip the TLB flush triggered when reusing a root for a nested transition as nested_vmx_transition_tlb_flush() ensures the TLB is flushed when needed, regardless of whether the MMU can reuse a cached root (or the last root). Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-35-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 41fab65e7c44ab1c3aa4b962e6f95649354db419 Author: Sean Christopherson Date: Fri Mar 20 14:28:29 2020 -0700 KVM: nVMX: Skip MMU sync on nested VMX transition when possible Skip the MMU sync when reusing a cached root if EPT is enabled or L1 enabled VPID for L2. If EPT is enabled, guest-physical mappings aren't flushed even if VPID is disabled, i.e. L1 can't expect stale TLB entries to be flushed if it has enabled EPT and L0 isn't shadowing PTEs (for L1 or L2) if L1 has EPT disabled. If VPID is enabled (and EPT is disabled), then L1 can't expect stale TLB entries to be flushed (for itself or L2). Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-34-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 71fe70130d88729abc0e658d3202618c340d2e71 Author: Sean Christopherson Date: Fri Mar 20 14:28:28 2020 -0700 KVM: x86/mmu: Add module param to force TLB flush on root reuse Add a module param, flush_on_reuse, to override skip_tlb_flush and skip_mmu_sync when performing a so called "fast cr3 switch", i.e. when reusing a cached root. The primary motiviation for the control is to provide a fallback mechanism in the event that TLB flushing and/or MMU sync bugs are exposed/introduced by upcoming changes to stop unconditionally flushing on nested VMX transitions. Suggested-by: Jim Mattson Suggested-by: Junaid Shahid Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-33-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4a632ac6ca66fb29b94a16495624c58f4d313f2f Author: Sean Christopherson Date: Fri Mar 20 14:28:27 2020 -0700 KVM: x86/mmu: Add separate override for MMU sync during fast CR3 switch Add a separate "skip" override for MMU sync, a future change to avoid TLB flushes on nested VMX transitions may need to sync the MMU even if the TLB flush is unnecessary. Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-32-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit b869855badd1387bd12415e4d5571e931825b546 Author: Sean Christopherson Date: Fri Mar 20 14:28:26 2020 -0700 KVM: x86/mmu: Move fast_cr3_switch() side effects to __kvm_mmu_new_cr3() Handle the side effects of a fast CR3 (PGD) switch up a level in __kvm_mmu_new_cr3(), which is the only caller of fast_cr3_switch(). This consolidates handling all side effects in __kvm_mmu_new_cr3() (where freeing the current root when KVM can't do a fast switch is already handled), and ameliorates the pain of adding a second boolean in a future patch to provide a separate "skip" override for the MMU sync. Cc: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-31-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4de1f9d469f4515464c2c4958a59479f641970ef Author: Sean Christopherson Date: Fri Mar 20 14:28:25 2020 -0700 KVM: VMX: Don't reload APIC access page if its control is disabled Don't reload the APIC access page if its control is disabled, e.g. if the guest is running with x2APIC (likely) or with the local APIC disabled (unlikely), to avoid unnecessary TLB flushes and VMWRITEs. Unconditionally reload the APIC access page and flush the TLB when the guest's virtual APIC transitions to "xAPIC enabled", as any changes to the APIC access page's mapping will not be recorded while the guest's virtual APIC is disabled. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-30-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit a4148b7ca2a5afe1295a41b5e30048cabcb74f8d Author: Sean Christopherson Date: Fri Mar 20 14:28:24 2020 -0700 KVM: VMX: Retrieve APIC access page HPA only when necessary Move the retrieval of the HPA associated with L1's APIC access page into VMX code to avoid unnecessarily calling gfn_to_page(), e.g. when the vCPU is in guest mode (L2). Alternatively, the optimization logic in VMX could be mirrored into the common x86 code, but that will get ugly fast when further optimizations are introduced. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-29-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 1196cb970b996be69a2fcd9756117b394f8e7526 Author: Sean Christopherson Date: Fri Mar 20 14:28:23 2020 -0700 KVM: nVMX: Reload APIC access page on nested VM-Exit only if necessary Defer reloading L1's APIC page by logging the need for a reload and processing it during nested VM-Exit instead of unconditionally reloading the APIC page on nested VM-Exit. This eliminates a TLB flush on the majority of VM-Exits as the APIC page rarely needs to be reloaded. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-28-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit c51e1ffee50121a2b2e00208f517a695493ee85d Author: Sean Christopherson Date: Fri Mar 20 14:28:22 2020 -0700 KVM: nVMX: Selectively use TLB_FLUSH_CURRENT for nested VM-Enter/VM-Exit Flush only the current context, as opposed to all contexts, when requesting a TLB flush to handle the scenario where a L1 does not expect a TLB flush, but one is required because L1 and L2 shared an ASID. This occurs if EPT is disabled (no per-EPTP tag), VPID is enabled (hardware doesn't flush unconditionally) and vmcs02 does not have its own VPID due to exhaustion of available VPIDs. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-27-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8c8560b833909cbf2e3a73d4dc8e65a60ba66f07 Author: Sean Christopherson Date: Fri Mar 20 14:28:21 2020 -0700 KVM: x86/mmu: Use KVM_REQ_TLB_FLUSH_CURRENT for MMU specific flushes Flush only the current ASID/context when requesting a TLB flush due to a change in the current vCPU's MMU to avoid blasting away TLB entries associated with other ASIDs/contexts, e.g. entries cached for L1 when a change in L2's MMU requires a flush. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-26-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit eeeb4f67a6cd437da1f5d1a20596cdc2d7b50551 Author: Sean Christopherson Date: Fri Mar 20 14:28:20 2020 -0700 KVM: x86: Introduce KVM_REQ_TLB_FLUSH_CURRENT to flush current ASID Add KVM_REQ_TLB_FLUSH_CURRENT to allow optimized TLB flushing of VMX's EPTP/VPID contexts[*] from the KVM MMU and/or in a deferred manner, e.g. to flush L2's context during nested VM-Enter. Convert KVM_REQ_TLB_FLUSH to KVM_REQ_TLB_FLUSH_CURRENT in flows where the flush is directly associated with vCPU-scoped instruction emulation, i.e. MOV CR3 and INVPCID. Add a comment in vmx_vcpu_load_vmcs() above its KVM_REQ_TLB_FLUSH to make it clear that it deliberately requests a flush of all contexts. Service any pending flush request on nested VM-Exit as it's possible a nested VM-Exit could occur after requesting a flush for L2. Add the same logic for nested VM-Enter even though it's _extremely_ unlikely for flush to be pending on nested VM-Enter, but theoretically possible (in the future) due to RSM (SMM) emulation. [*] Intel also has an Address Space Identifier (ASID) concept, e.g. EPTP+VPID+PCID == ASID, it's just not documented in the SDM because the rules of invalidation are different based on which piece of the ASID is being changed, i.e. whether the EPTP, VPID, or PCID context must be invalidated. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-25-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 50b265a4eee0d9fb9581f1a300742515b80dffda Author: Sean Christopherson Date: Fri Mar 20 14:28:19 2020 -0700 KVM: nVMX: Add helper to handle TLB flushes on nested VM-Enter/VM-Exit Add a helper to determine whether or not a full TLB flush needs to be performed on nested VM-Enter/VM-Exit, as the logic is identical for both flows and needs a fairly beefy comment to boot. This also provides a common point to make future adjustments to the logic. Handle vpid12 changes the new helper as well even though it is specific to VM-Enter. The vpid12 logic is an extension of the flushing logic, and it's worth the extra bool parameter to provide a single location for the flushing logic. Cc: Liran Alon Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-24-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 7780938cc70b848650722762fa4c7496fa68f9ec Author: Sean Christopherson Date: Fri Mar 20 14:28:18 2020 -0700 KVM: x86: Rename ->tlb_flush() to ->tlb_flush_all() Rename ->tlb_flush() to ->tlb_flush_all() in preparation for adding a new hook to flush only the current ASID/context. Opportunstically replace the comment in vmx_flush_tlb() that explains why it flushes all EPTP/VPID contexts with a comment explaining why it unconditionally uses INVEPT when EPT is enabled. I.e. rely on the "all" part of the name to clarify why it does global INVEPT/INVVPID. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-23-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4a41e43cbe2c0f47d7ec80d156ab786d03cdaacd Author: Sean Christopherson Date: Fri Mar 20 14:28:17 2020 -0700 KVM: SVM: Document the ASID logic in svm_flush_tlb() Add a comment in svm_flush_tlb() to document why it flushes only the current ASID, even when it is invoked when flushing remote TLBs. Cc: Tom Lendacky Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-22-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 33d19ec9b14c0e304f5d44a0dd1403539360968b Author: Sean Christopherson Date: Fri Mar 20 14:28:16 2020 -0700 KVM: VMX: Introduce vmx_flush_tlb_current() Add a helper to flush TLB entries only for the current EPTP/VPID context and use it for the existing direct invocations of vmx_flush_tlb(). TLB flushes that are specific to the current vCPU state do not need to flush other contexts. Note, both converted call sites happen to be related to the APIC access page, this is purely coincidental. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-21-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 25d8b84376e7c12ce4e4ec88c0f5bf0bfc9ff8f4 Author: Sean Christopherson Date: Fri Mar 20 14:28:15 2020 -0700 KVM: nVMX: Move nested_get_vpid02() to vmx/nested.h Move nested_get_vpid02() to vmx/nested.h so that a future patch can reference it from vmx.c to implement context-specific TLB flushing. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-20-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 5058b692c69997f9736b94df786509366c32f34d Author: Sean Christopherson Date: Fri Mar 20 14:28:14 2020 -0700 KVM: VMX: Move vmx_flush_tlb() to vmx.c Move vmx_flush_tlb() to vmx.c and make it non-inline static now that all its callers live in vmx.c. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-19-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 72b38320872666f7fb6ff9564bf91139c685c234 Author: Sean Christopherson Date: Fri Mar 20 14:28:13 2020 -0700 KVM: SVM: Wire up ->tlb_flush_guest() directly to svm_flush_tlb() Use svm_flush_tlb() directly for kvm_x86_ops->tlb_flush_guest() now that the @invalidate_gpa param to ->tlb_flush() is gone, i.e. the wrapper for ->tlb_flush_guest() is no longer necessary. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-18-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit f55ac304ca47039368a5971fa61ebc8160c90659 Author: Sean Christopherson Date: Fri Mar 20 14:28:12 2020 -0700 KVM: x86: Drop @invalidate_gpa param from kvm_x86_ops' tlb_flush() Drop @invalidate_gpa from ->tlb_flush() and kvm_vcpu_flush_tlb() now that all callers pass %true for said param, or ignore the param (SVM has an internal call to svm_flush_tlb() in svm_flush_tlb_guest that somewhat arbitrarily passes %false). Remove __vmx_flush_tlb() as it is no longer used. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-17-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ad104b5e433a6851a3a9822663c1ca756832a5f0 Author: Sean Christopherson Date: Fri Mar 20 14:28:11 2020 -0700 KVM: VMX: Clean up vmx_flush_tlb_gva() Refactor vmx_flush_tlb_gva() to remove a superfluous local variable and clean up its comment, which is oddly located below the code it is commenting. No functional change intended. Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-16-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 0baedd792713063213f1e2060dc6a5d536638f0a Author: Vitaly Kuznetsov Date: Wed Mar 25 12:28:24 2020 -0400 KVM: x86: make Hyper-V PV TLB flush use tlb_flush_guest() Hyper-V PV TLB flush mechanism does TLB flush on behalf of the guest so doing tlb_flush_all() is an overkill, switch to using tlb_flush_guest() (just like KVM PV TLB flush mechanism) instead. Introduce KVM_REQ_HV_TLB_FLUSH to support the change. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 5ad4d8957b69f3ebf95ac02212c388bda75aeb30 Author: Tzu-En Huang Date: Mon Apr 20 18:52:07 2020 +0800 rtw88: set power trim according to efuse PG values 8822C devices have power trim, thermal and PA bias values programmed in efuse. Driver should configure the RF components according to the values. If the power trim is not configured, then the devices might have distortion on the output tx power. Signed-off-by: Tzu-En Huang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420105207.31899-1-yhchuang@realtek.com commit ab0a031ecf2908c77833caebf0c86bab5e9f12b7 Author: Ping-Ke Shih Date: Mon Apr 20 13:50:54 2020 +0800 rtw88: 8723d: Add read_efuse to recognize efuse info from map The logical efuse map is decoded from physical map by parsing the header format of the physical map. And each different type of chips has different logical efuse layout. So add the logical map's layout for parsing the efuse contents. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-9-yhchuang@realtek.com commit 44baa97ca820dbc81dfde076937d15bc725a3a54 Author: Ping-Ke Shih Date: Mon Apr 20 13:50:53 2020 +0800 rtw88: 8723d: Add new chip op efuse_grant() to control efuse access 8723D devices need to grant efuse access before dumping physical efuse map, other chips don't need it, so keep this ops as blank. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-8-yhchuang@realtek.com commit 1afb5eb7a00dab15551bbfb24c4e8a750da21827 Author: Ping-Ke Shih Date: Mon Apr 20 13:50:52 2020 +0800 rtw88: 8723d: Add cfg_ldo25 to control LDO25 Implement rtw_chip_ops::cfg_ldo25 to enable/disable LDO25 with proper voltage. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-7-yhchuang@realtek.com commit 9874f6851e47f674a23fc12969de31dbdf469f3d Author: Ping-Ke Shih Date: Mon Apr 20 13:50:51 2020 +0800 rtw88: 8723d: Add mac/bb/rf/agc/power_limit tables Add corresponding parameter tables for 8723D devices. Since 8723D devices currently have only one RFE type, there is only one entry in rtw8723d_rfe_defs. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-6-yhchuang@realtek.com commit e0c27cdbbd414877864773152ad0291913e18eae Author: Ping-Ke Shih Date: Mon Apr 20 13:50:50 2020 +0800 rtw88: 8723d: Add RF read/write ops 8723D use SIPI to indirectly read RF register instead of directly read, so introduce a new struct rtw_rf_sipi_addr and new function rtw_phy_read_rf_sipi(). Since other chips don't use the new function, only 8723D needs to fill struct rtw_rf_sipi_addr in rtw_chip_info. Because there are two kinds of functions for reading RF registers now, change rtw_phy_read_rf() to chip->ops->read_rf() in rtw_phy_write_rf_reg_sipi() so that we can switch tp proper RF read functions depends on the type of the chip. Though 8723D is an 1x1 chip, it has two RF PHY and we can switch to one of them, and that should be configured properly. Hence, add a fix_rf_phy_num to struct rtw_chip_info to allow driver to set one of the PHY's registers for 8723D, even it is only 1x1. Another variable rf_phy_num is introduced to keep the constraint number of RF path we can access, and its value is: rf_phy_num = (fix_rf_phy_num ? fix_rf_phy_num : rf_path_num) Signed-off-by: Ping-Ke Shih Signed-off-by: Zong-Zhe Yang Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-5-yhchuang@realtek.com commit c57bd7c3af9974ad432c46c0373a70d75a2d9e08 Author: Ping-Ke Shih Date: Mon Apr 20 13:50:49 2020 +0800 rtw88: 8723d: Add power sequence Add corresponding power sequence for 8723D devices Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-4-yhchuang@realtek.com commit 93ae973fb47df112326e9a3657302f990934b327 Author: Ping-Ke Shih Date: Mon Apr 20 13:50:48 2020 +0800 rtw88: 8723d: add beamform wrapper functions 8723D doesn't support beamform because rtw88 only supports VHT beamform but 8723d doesn't have VHT capability. Though 8723d doesn't support beamform, BSS_CHANGED_MU_GROUPS is still marked as changed when doing disassociation. So, add wrapper functions for all beamform ops to make sure they aren't NULL before calling. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-3-yhchuang@realtek.com commit 811853da541a6a9be335c1f9dc9f20ca8bde65ed Author: Ping-Ke Shih Date: Mon Apr 20 13:50:47 2020 +0800 rtw88: 8723d: Add basic chip capabilities RTL8723DE is an 11n 1x1 2.4G single band chip with the following capabilities: - TX/RX BD size: 16/8 - TX/RX desc size: 40/24 - physical/logical/protected efuse size: 512/512/96 - TX gain index factor: 1 - max TX power index: 0x3F - band: 2G - HT: support - VHT: Not support Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420055054.14592-2-yhchuang@realtek.com commit 887e74239805217c9c583584a382e66583e0556b Author: Jason Yan Date: Mon Apr 20 12:26:58 2020 +0800 rtlwifi: rtl8723ae: fix warning comparison to bool Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:617:14-20: WARNING: Comparison to bool drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:622:13-19: WARNING: Comparison to bool drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:627:14-20: WARNING: Comparison to bool drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:632:13-19: WARNING: Comparison to bool drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:937:5-13: WARNING: Comparison to bool Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200420042658.18733-1-yanaijie@huawei.com commit e8277abd453d6824a92b42989a248969f4fbc988 Author: Jason Yan Date: Sat Apr 18 15:02:36 2020 +0800 rtlwifi: rtl8821ae: use true,false for bool variables Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c:79:1-34: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c:81:1-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200418070236.9620-6-yanaijie@huawei.com commit 47361089d987c367bedd778eba66843601d347df Author: Jason Yan Date: Sat Apr 18 15:02:35 2020 +0800 rtlwifi: rtl8723be: use true,false for bool variables Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c:77:1-34: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c:79:1-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200418070236.9620-5-yanaijie@huawei.com commit c13a83b01010c94ad7fe68161fd4dae3767d3ffe Author: Jason Yan Date: Sat Apr 18 15:02:34 2020 +0800 rtlwifi: rtl8192ee: use true,false for bool variables Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c:78:1-34: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c:80:1-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200418070236.9620-4-yanaijie@huawei.com commit 23c2ddb574c621cc2c5d9be0bb99a59f18f5863c Author: Jason Yan Date: Sat Apr 18 15:02:33 2020 +0800 rtlwifi: rtl8723ae: use true,false for bool variables Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c:81:1-34: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c:83:1-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200418070236.9620-3-yanaijie@huawei.com commit bec095ab477dcc11fbe448c6fae6c2c61a876f37 Author: Jason Yan Date: Sat Apr 18 15:02:32 2020 +0800 rtlwifi: rtl8188ee: use true,false for bool variables Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c:70:1-34: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c:72:1-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200418070236.9620-2-yanaijie@huawei.com commit 722c1963aba5a86778f7d044116e10e1c73e87a8 Author: Raphael Moreira Zinsly Date: Mon Apr 20 17:55:38 2020 -0300 selftests/powerpc: Add README for GZIP engine tests Include a README file with the instructions to use the testcases at selftests/powerpc/nx-gzip. Signed-off-by: Bulent Abali Signed-off-by: Raphael Moreira Zinsly Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200420205538.25181-6-rzinsly@linux.ibm.com commit 841fb73ad2195ac7d79ce970fa3d7ed7a5bb0ecd Author: Raphael Moreira Zinsly Date: Mon Apr 20 17:55:37 2020 -0300 selftests/powerpc: Add NX-GZIP engine decompress testcase Include a decompression testcase for the powerpc NX-GZIP engine. Signed-off-by: Bulent Abali Signed-off-by: Raphael Moreira Zinsly Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200420205538.25181-5-rzinsly@linux.ibm.com commit 647c734f62f882bb742683cd5f5596f0abadf758 Author: Raphael Moreira Zinsly Date: Mon Apr 20 17:55:36 2020 -0300 selftests/powerpc: Add NX-GZIP engine compress testcase Add a compression testcase for the powerpc NX-GZIP engine. Signed-off-by: Bulent Abali Signed-off-by: Raphael Moreira Zinsly Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200420205538.25181-4-rzinsly@linux.ibm.com commit f49b75724cfa2a6264aa5a77f33c3883701852af Author: Raphael Moreira Zinsly Date: Mon Apr 20 17:55:35 2020 -0300 selftests/powerpc: Add header files for NX compresion/decompression Add files to be able to compress and decompress files using the powerpc NX-GZIP engine. Signed-off-by: Bulent Abali Signed-off-by: Raphael Moreira Zinsly Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200420205538.25181-3-rzinsly@linux.ibm.com commit d53979b589609d87036d8daf9500f7eccb0c6317 Author: Raphael Moreira Zinsly Date: Mon Apr 20 17:55:34 2020 -0300 selftests/powerpc: Add header files for GZIP engine test Add files to access the powerpc NX-GZIP engine in user space. Signed-off-by: Bulent Abali Signed-off-by: Raphael Moreira Zinsly Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200420205538.25181-2-rzinsly@linux.ibm.com commit 7948efc27f7832fa8ff5bed0e3eec693dce30272 Merge: b96ea61665b7 c12e38b1d52e Author: Michael Ellerman Date: Tue Apr 21 22:49:52 2020 +1000 Merge NX gzip support into next As described by Haren: Power9 processor supports Virtual Accelerator Switchboard (VAS) which allows kernel and userspace to send compression requests to Nest Accelerator (NX) directly. The NX unit comprises of 2 842 compression engines and 1 GZIP engine. Linux kernel already has 842 compression support on kernel. This patch series adds GZIP compression support from user space. The GZIP Compression engine implements the ZLIB and GZIP compression algorithms. No plans of adding NX-GZIP compression support in kernel right now. Applications can send requests to NX directly with COPY/PASTE instructions. But kernel has to establish channel / window on NX-GZIP device for the userspace. So userspace access to the GZIP engine is provided through /dev/crypto/nx-gzip device with several operations. An application must open the this device to obtain a file descriptor (fd). Using the fd, application should issue the VAS_TX_WIN_OPEN ioctl to establish a connection to the engine. Once window is opened, should use mmap() system call to map the hardware address of engine's request queue into the application's virtual address space. Then user space forms the request as co-processor Request Block (CRB) and paste this CRB on the mapped HW address using COPY/PASTE instructions. Application can poll on status flags (part of CRB) with timeout for request completion. For VAS_TX_WIN_OPEN ioctl, if user space passes vas_id = -1 (struct vas_tx_win_open_attr), kernel determines the VAS instance on the corresponding chip based on the CPU on which the process is executing. Otherwise, the specified VAS instance is used if application passes the proper VAS instance (vas_id listed in /proc/device-tree/vas@*/ibm,vas_id). Process can open multiple windows with different FDs or can send several requests to NX on the same window at the same time. commit b96ea61665b70398a0c9a667ed20cb7504fed955 Merge: ae83d0b416db c420644c0a8f Author: Michael Ellerman Date: Tue Apr 21 22:46:33 2020 +1000 Merge VAS page fault handling into next As described by Haren: On Power9, Virtual Accelerator Switchboard (VAS) allows user space or kernel to communicate with Nest Accelerator (NX) directly using COPY/PASTE instructions. NX provides various functionalities such as compression, encryption and etc. But only compression (842 and GZIP formats) is supported in Linux kernel on power9. 842 compression driver (drivers/crypto/nx/nx-842-powernv.c) is already included in Linux. Only GZIP support will be available from user space. Applications can issue GZIP compression / decompression requests to NX with COPY/PASTE instructions. When NX is processing these requests, can hit fault on the request buffer (not in memory). It issues an interrupt and pastes fault CRB in fault FIFO. Expects kernel to handle this fault and return credits for both send and fault windows after processing. This patch series adds IRQ and fault window setup, and NX fault handling: - Alloc IRQ and trigger port address, and configure IRQ per VAS instance. - Set port# for each window to generate an interrupt when noticed fault. - Set fault window and FIFO on which NX paste fault CRB. - Setup IRQ thread fault handler per VAS instance. - When receiving an interrupt, Read CRBs from fault FIFO and update coprocessor_status_block (CSB) in the corresponding CRB with translation failure (CSB_CC_TRANSLATION). After issuing NX requests, process polls on CSB address. When it sees translation error, can touch the request buffer to bring the page in to memory and reissue NX request. - If copy_to_user fails on user space CSB address, OS sends SEGV signal. commit 776d58823a60c689816972b51100cb322a0834ce Author: Gal Pressman Date: Mon Apr 20 10:41:15 2020 +0300 dma-buf: Couple of documentation typo fixes Fix a couple of typos: "as" -> "has" and "int" -> "in". Signed-off-by: Gal Pressman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200420074115.23931-1-galpress@amazon.com commit 96c64857983fdc623fa5899afdb0310bef196f68 Author: Kalle Valo Date: Thu Apr 16 14:50:59 2020 +0300 ath10k: hif: make send_complete_check op optional That way we don't need to have an empty function in sdio.c. No functional changes, compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587037859-28873-5-git-send-email-kvalo@codeaurora.org commit 58921763210315fe96f590d9edb4f3952f8526ce Author: Kalle Valo Date: Thu Apr 16 14:50:58 2020 +0300 ath10k: sdio: remove _hif_ prefix from functions not part of hif interface The _hif_ prefix should be used only on functions part of ath10k_hif_ops, so remove it from functions which should not have it. No functional changes, compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587037859-28873-4-git-send-email-kvalo@codeaurora.org commit 22f28076b6c3f86107424b3b1ddfd90f2628f354 Author: Wen Gong Date: Thu Apr 16 14:50:57 2020 +0300 ath10k: improve power save performance for sdio This patch is to set register to allow the mbox enter sleep status if it does not have tx traffic and wakeup it if tx traffic arrive. After mbox enter sleep status, the soc will enter sleep status by firmware, this will save power. The power consume drops from about 90mW to about 10mW with this patch. This patch only effect sdio chip. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587037859-28873-3-git-send-email-kvalo@codeaurora.org commit 557e171434eb9bb43dbe71361775ae21ae95d4ed Author: Kalle Valo Date: Thu Apr 16 14:50:56 2020 +0300 ath10k: rename ath10k_hif_swap_mailbox() to ath10k_hif_start_post() Convert ath10k_hif_swap_mailbox() to a more generic op so that bus drivers can do more than just swap the mailbox, for example set power save settings like in the following sdio patch. No functional changes, compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1587037859-28873-2-git-send-email-kvalo@codeaurora.org commit cd33c830448baf7b1e94da72eca069e3e1d050c9 Author: Boris Brezillon Date: Sat Apr 4 00:13:44 2020 +0200 media: rkvdec: Add the rkvdec driver The rockchip vdec block is a stateless decoder that's able to decode H264, HEVC and VP9 content. This commit adds the core infrastructure and the H264 backend. Support for VP9 and HEVS will be added later on. [mchehab+huawei@kernel.org: select MEDIA_CONTROLLER and REQUEST_API] Signed-off-by: Boris Brezillon Signed-off-by: Ezequiel Garcia Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d6b50a96d3373d038c14eb7427acbeb5fa66ec33 Author: Boris Brezillon Date: Sat Apr 4 00:13:43 2020 +0200 media: dt-bindings: rockchip: Document RK3399 Video Decoder bindings Document the Rockchip RK3399 Video Decoder bindings. Signed-off-by: Boris Brezillon Reviewed-by: Rob Herring Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b5218cf40c1e030fa402594c845113a989d6e942 Author: Boris Brezillon Date: Sat Apr 4 00:13:42 2020 +0200 media: hantro: h264: Use the generic H264 reflist builder Now that the core provides generic reflist builders, we can use them instead of implementing our own. Signed-off-by: Boris Brezillon Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 624922a2739b96b83aaf1655d0519b41d30140f7 Author: Boris Brezillon Date: Sat Apr 4 00:13:41 2020 +0200 media: v4l2-core: Add helpers to build the H264 P/B0/B1 reflists Building those list is a standard procedure described in section '8.2.4 Decoding process for reference picture lists construction' of the H264 specification. We already have 2 drivers needing the same logic (hantro and rkvdec) and I suspect we will soon have more. Let's provide generic helpers to create those lists. Signed-off-by: Boris Brezillon Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 45776c540f7fee193ab5a419d5e188cd220ce226 Author: Ezequiel Garcia Date: Thu Apr 2 21:45:04 2020 +0200 media: rkisp1: Fix wrong PHY config dependency Instead of depending on the Rockchip PHY driver the ISP driver should really depend on CONFIG_GENERIC_PHY_MIPI_DPHY, given all it needs is the phy_mipi_dphy_get_default_config() symbol. Fix it. Signed-off-by: Ezequiel Garcia Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 42cbdf2b5ecb2aafa24f94eaba505decd86300b3 Author: Ezequiel Garcia Date: Thu Apr 2 21:45:03 2020 +0200 media: phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency The driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests. Signed-off-by: Ezequiel Garcia Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f661aaa007aa411ecd088e99864926adc968c510 Author: Ezequiel Garcia Date: Thu Apr 2 21:45:02 2020 +0200 media: rkisp1: Get rid of unused variable warning If CONFIG_OF is not selected, the compiler will complain: drivers/staging/media/rkisp1/rkisp1-dev.c: In function ‘rkisp1_probe’: drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: warning: unused variable ‘node’ [-Wunused-variable] 457 | struct device_node *node = pdev->dev.of_node; Rework the code slightly and make the compiler happy. Suggested-by: Robin Murphy Signed-off-by: Ezequiel Garcia Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d6ef0719fa90da52a555ff6de5f13e6bea601d33 Author: Seungchul Kim Date: Thu Mar 26 10:09:46 2020 +0100 media: v4l2-fh: define v4l2_fh struct regardless of condition v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV. If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module, it can make the mismatch of v4l2_fh sturct. By the mismatch, the following error occurs. =============================== [ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata [ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22) [ 7.535319] v4l2_mem2mem: disagrees about version of symbol v4l2_event_pending [ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22) =============================== So v4l2_fh struct is modified to does not have dependency for CONFIG_V4L2_MEM2MEM_DEV. Signed-off-by: Seungchul Kim Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 003492984ed7fc1f7cfc565b4a5c77cfd8ceea13 Author: Dafna Hirschfeld Date: Mon Apr 6 20:52:35 2020 +0200 media: staging: rkisp1: change fields names from fmt_type to pixel_enc The fields 'fmt_type' in the structs 'rkisp1_rsz_config', 'rkisp1_isp_mbus_info' are of type 'v4l2_pixel_encoding' so it is nicer to change their name to 'pixel_enc'. Also change the define 'RKISP1_DEF_FMT_TYPE' to 'RKISP1_DEF_PIXEL_ENC' Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b23096af0be45700c90f60f610c2d2ae66868f2d Author: Dafna Hirschfeld Date: Mon Apr 6 20:52:34 2020 +0200 media: staging: rkisp1: cap: remove field fmt_type from struct rkisp1_capture_fmt_cfg The pixel encoding can be retrieved from the cap->pix.info. Therefore the field fmt_type can be removed from the struct rkisp1_capture_fmt_cfg. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2990e3dbf7ee3094a6f5138bd3d0fcaef080c056 Author: Dafna Hirschfeld Date: Mon Apr 6 20:52:33 2020 +0200 media: staging: rkisp1: replace rkisp1_fmt_pix_type with v4l2_pixel_encoding The enum rkisp1_fmt_pix_type that holds the pixel format which is one of RGB, YUV, BAYER, can be replace by the v4l2 enum v4l2_pixel_encoding. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dd844fb8e50b12e65bbdc5746c9876c6735500df Author: Kieran Bingham Date: Tue Apr 7 17:44:17 2020 +0200 media: platform: fcp: Set appropriate DMA parameters Enabling CONFIG_DMA_API_DEBUG=y and CONFIG_DMA_API_DEBUG_SG=y will enable extra validation on DMA operations ensuring that the size restraints are met. When using the FCP in conjunction with the VSP1/DU, and display frames, the size of the DMA operations is larger than the default maximum segment size reported by the DMA core (64K). With the DMA debug enabled, this produces a warning such as the following: "DMA-API: rcar-fcp fea27000.fcp: mapping sg segment longer than device claims to support [len=3145728] [max=65536]" We have no specific limitation on the segment size which isn't already handled by the VSP1/DU which actually handles the DMA allcoations and buffer management, so define a maximum segment size of up to 4GB (a 32 bit mask). Reported-by: Geert Uytterhoeven Fixes: 7b49235e83b2 ("[media] v4l: Add Renesas R-Car FCP driver") Signed-off-by: Kieran Bingham Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dba3613457065a9578ba159738102dd6dbb5b8c7 Author: Dafna Hirschfeld Date: Tue Apr 7 19:25:22 2020 +0200 media: staging: rkisp1: remove TODO item - uapi structs compatibility remove the TODO item: * Make sure uapi structs have the same size and layout in 32 and 62 bits, and that there are no holes in the structures (pahole is a utility that can be used to test this). It was tested with pahole and found compatible. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f36592e7b343d853edf44d3545bb68961c0949a4 Author: Dan Carpenter Date: Tue Apr 7 11:32:37 2020 +0200 media: vicodec: Fix error codes in probe function If these functions fail then we return success, but we should instead preserve negative error code and return that. Fixes: fde649b418d1 ("media: vicodec: Register another node for stateless decoder") Fixes: c022a4a95722 ("media: vicodec: add struct for encoder/decoder instance") Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d00c9761afe7808ed742741c95bd536e0a648676 Author: Fabio Estevam Date: Thu Apr 9 18:29:45 2020 +0200 media: imx.rst: Provide streaming examples for imx6q-sabresd Improve the documentation by providing examples on how to test camera capture on imx6q-sabresd via v4l2-ctl and Gstreamer. Signed-off-by: Fabio Estevam Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8a4676d6e627ed3c7a48c827e23f71e3e91dd3dd Author: Fabio Estevam Date: Thu Apr 9 18:29:44 2020 +0200 media: imx.rst: Provide the OV560 module part number In order to improve the documentation, provide the OV5640 MIPI module part number that is used on the imx6q-sabresd board. Signed-off-by: Fabio Estevam Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 62ce7201f442d667a31415c1b051ba385a994b63 Author: Fabio Estevam Date: Thu Apr 9 18:29:43 2020 +0200 media: imx.rst: Provide an example for unprocessed video capture The current example for imx6q-sabresd is for a direct conversion pipeline. Provide an extra example using unprocessed video capture for completeness. Signed-off-by: Fabio Estevam Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9429e7072f8ffc1aae4f2a2c4aeee9db847905f5 Author: Fabio Estevam Date: Thu Apr 9 18:29:42 2020 +0200 media: imx.rst: Fix the MIPI CSI-2 virtual channel The current instructions for imx6q-sabresd do not lead to functional capture on OV5640 MIPI CSI-2. The reason for this, as explained by Steve Longerbeam, is that OV5640 by default transmits on virtual channel 0, not channel 1 as is given in the instructions. Adapt the instructions to use virtual channel 0 so that a working camera setup can be achieved on imx6q-sabresd. Also, since we are using an IC direct conversion pipeline, improve the example by demonstrating colorspace and scaling. Signed-off-by: Fabio Estevam Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ff8c2784b057596ae1fe75693046e1ac3382d8bf Author: Maheshwar Ajja Date: Tue Apr 7 23:55:26 2020 +0200 media: uapi: h264: Add new profile and levels Add H264 profile "Contrained High" and H264 levels "5.2", "6.0", "6.1" and "6.2". Signed-off-by: Maheshwar Ajja Signed-off-by: Mauro Carvalho Chehab commit 1ca3cb46a992d83ebd093acc64241007b20c5033 Author: Maheshwar Ajja Date: Mon Mar 16 23:42:30 2020 +0100 media: v4l2-ctrl: Add H264 profile and levels Add H264 profile "Contrained High" and H264 levels "5.2", "6.0", "6.1" and "6.2". Signed-off-by: Maheshwar Ajja Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 33d236371f707582128ab05faf7b9f95f479aa63 Author: Fabio Estevam Date: Wed Apr 8 15:10:05 2020 +0200 media: imx-media-csc-scaler: Use a shorter name for driver Currently v4l2-compliance tool returns the following output: Compliance test for imx-media-csc-s device /dev/video8: Driver Info: Driver name : imx-media-csc-s Card type : imx-media-csc-scaler Bus info : platform:imx-media-csc-scaler The driver name string is limited to 16 characters, so provide a shorter name in order to get a better output. While at it, use the same shorter name for driver, card and platform. Signed-off-by: Fabio Estevam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d45c9313782b3bde8da60e0f6c666a559da7243d Author: Colin Ian King Date: Fri Apr 10 16:18:13 2020 +0200 media: gspca: remove redundant assignment to variable status The variable status is being assigned a value that is never read. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 03f56d9952b425df613bb28d52149a52f72e6368 Author: Colin Ian King Date: Fri Apr 10 15:50:14 2020 +0200 media: pwc-ctl: remove redundant assignment to variable ret The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 757570f11fa4b0ce5472a6583de6f06e996a8527 Author: Hsin-Yi Wang Date: Tue Apr 14 05:08:15 2020 +0200 media: mtk-mdp: Use correct aliases name aliases property name must include only lowercase and '-'. Fix in dts and driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Matthias Brugger Reviewed-by: Chun-Kuang Hu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e13160116939c9825de5e78e697cb48b1a3f0258 Author: Colin Ian King Date: Thu Apr 16 00:54:11 2020 +0200 media: davinci: remove redundant assignment to pointer 'common' The pointer 'common' is being assigned with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4d7463cdf5dea933b6796681bdfac9015a845652 Author: Laurent Pinchart Date: Mon Apr 6 18:39:05 2020 +0200 media: imx: utils: Constify some mbus and ipu_image arguments The imx_media_mbus_fmt_to_pix_fmt() and imx_media_mbus_fmt_to_ipu_image() functions do not need to modify their mbus argument, and imx_media_ipu_image_to_mbus_fmt() does not need to modify its ipu_image argument. Make them const. [slongerbeam@gmail.com: Constified mbus arg to imx_media_mbus_fmt_to_ipu_image(), and ipu_image arg to imx_media_ipu_image_to_mbus_fmt(), as well] Signed-off-by: Laurent Pinchart Signed-off-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eef988826fbdcf042a4188c0d1150b0128b6512c Author: Laurent Pinchart Date: Mon Apr 6 18:39:04 2020 +0200 media: imx: utils: Rename format lookup and enumeration functions Rename the format lookup and enumeration functions according to their usage: - Rename imx_media_(find|enum)_format() to *_pixel_format() to explicitly state on what formats the functions operate. This aligns the naming scheme with the media bus and IPU format functions that already end with *_mbus_format() and *_ipu_formats(). - Rename all enumeration functions to pluralize 'formats' at the end, as they enumerate multiple formats. Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 74cd3984f13381049627cfa260fd87e6fcd31add Author: Steve Longerbeam Date: Mon Apr 6 18:39:03 2020 +0200 media: imx: utils: Split find|enum_format into fourcc and mbus functions To make the code easier to follow, split up find_format() into separate search functions for pixel formats and media-bus codes, and inline find_format() into the exported functions imx_media_find_format() and imx_media_find_mbus_format(). Do the equivalent for enum_format(). Also add comment blocks for the exported find|enum functions. The convenience functions imx_media_find_ipu_format() and imx_media_enum_ipu_format() can now be made inline and moved to imx-media.h. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c943b6947f459189419114682ac343fc1e22a954 Author: Laurent Pinchart Date: Mon Apr 6 18:39:02 2020 +0200 media: imx: utils: Make imx_media_pixfmt handle variable number of codes The imx_media_pixfmt structures include a codes member that stores media bus codes as a fixed array of 4 integers. The functions dealing with the imx_media_pixfmt structures assume that the array of codes is terminated by a 0 element. This mechanism is fragile, as demonstrated by several instances of the structure containing 4 non-zero codes. Fix this by turning the array into a pointer, and providing an IMX_BUS_FMTS macro to initialize the codes member with a guaranteed 0 element at the end. [Fixed a NULL deref of the codes pointer in a couple places] [Added more comments for the struct imx_media_pixfmt members, including a bold NOTE! for future developers that codes pointer is NULL for the in-memory-only formats] Signed-off-by: Laurent Pinchart Signed-off-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f0f71ae440a956d51ed1f3e2ba17638c51b7dfa7 Author: Steve Longerbeam Date: Mon Apr 6 18:39:01 2020 +0200 media: imx: utils: Introduce PIXFMT_SEL_IPU Add a PIXFMT_SEL_IPU selection flag, to select only the IPU-internal pixel formats, and move the single-entry IPU-internal pixel format arrays into pixel_formats[]. imx_media_find_ipu_format() and imx_media_enum_ipu_format() can now simply call find_format() and enum_format(). The RGB32 format is both an IPU-internal format, and an in-memory format via idmac channels that is supported by the IPUv3 driver, so it appears twice in pixel_formats[], one with ipufmt=false for the in-memory format, and again with ipufmt=true for the IPU-internal format. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a7d5003cab01458941907815d169999f885ecec3 Author: Steve Longerbeam Date: Mon Apr 6 18:39:00 2020 +0200 media: imx: utils: Rename pixel format selection enumeration After the introduction of the CS_SEL_BAYER flag, the "codespace" pixel format selection enumeration wording no longer makes sense (and even before, when selecting between YUV or RGB formats, "codespace" was a misuse of the term). Rename - 'enum codespace_sel' to 'enum imx_pixfmt_sel' - CS_SEL_* to PIXFMT_SEL_* - local vars named cs_sel to fmt_sel or just sel No functional changes. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3130c45c2ba357d0f495f178fc34b6b76c215596 Author: Steve Longerbeam Date: Mon Apr 6 18:38:59 2020 +0200 media: imx: Fix some pixel format selections - imx_media_capture_device_register() needs to use CS_SEL_ANY when finding the format from the attached source subdevice, because the source can be a CSI which supports bayer, and the CSI may have selected a bayer format when it registered. - Likewise, imx_media_init_mbus_fmt() is called from the CSI, so the function may be passed a bayer code. Use CS_SEL_ANY when locating the format. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0cd5d896a192887041f4030c1d388099a572322e Author: Laurent Pinchart Date: Mon Apr 6 18:38:58 2020 +0200 media: imx: utils: Handle Bayer format lookup through a selection flag The format lookup (and enumeration) functions take a boolean flag to tell if Bayer formats should be considered. This leads to hard to read lines such as return enum_format(fourcc, NULL, index, cs_sel, true, false); where the boolean parameters can easily be mixed. To make the code clearer, add a CS_SEL_BAYER flag that can be passed through the codespace_sel parameter of the lookup functions to replace the bool parameter. [slongerbeam@gmail.com: Instead of declaring CS_SEL_ANY as a bitfield containing only CS_SEL_YUV | CS_SEL_RGB, declare CS_SEL_ANY as all of the above (YUV, RGB, BAYER). A new enum is declared for the YUV | RGB selection as CS_SEL_YUV_RGB, and that is used by sub-devices that don't support BAYER and only allow selecting and enumerating YUV or RGB encodings. CS_SEL_ANY is now only used by the CSI sub-devices and the attached capture interfaces, since only those devices support BAYER formats.] Signed-off-by: Laurent Pinchart Signed-off-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c25ab5caf516f9439a5607162852d398c635d948 Author: Laurent Pinchart Date: Mon Apr 6 18:38:57 2020 +0200 media: imx: utils: Inline init_mbus_colorimetry() in its caller The init_mbus_colorimetry() function is small and used in a single place. The code becomes easier to follow if it gets inline in its caller. Do so. Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1df2148fdfc036c9350d41ae81b09b3f8897c9b6 Author: Philipp Zabel Date: Tue Apr 14 23:23:38 2020 +0200 media: imx: utils: fix media bus format enumeration Iterate over all media bus formats, not just over the first format in each imx_media_pixfmt entry. Before: $ v4l2-ctl -d $(media-ctl -e ipu1_csi0) --list-subdev-mbus-codes 0 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x2006: MEDIA_BUS_FMT_UYVY8_2X8 0x2008: MEDIA_BUS_FMT_YUYV8_2X8 0x1008: MEDIA_BUS_FMT_RGB565_2X8_LE 0x100a: MEDIA_BUS_FMT_RGB888_1X24 0x100d: MEDIA_BUS_FMT_ARGB8888_1X32 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3013: MEDIA_BUS_FMT_SGBRG8_1X8 0x3002: MEDIA_BUS_FMT_SGRBG8_1X8 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300e: MEDIA_BUS_FMT_SGBRG10_1X10 0x300a: MEDIA_BUS_FMT_SGRBG10_1X10 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x2001: MEDIA_BUS_FMT_Y8_1X8 0x200a: MEDIA_BUS_FMT_Y10_1X10 After: $ v4l2-ctl -d $(media-ctl -e ipu1_csi0) --list-subdev-mbus-codes 0 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x2006: MEDIA_BUS_FMT_UYVY8_2X8 0x200f: MEDIA_BUS_FMT_UYVY8_1X16 0x2008: MEDIA_BUS_FMT_YUYV8_2X8 0x2011: MEDIA_BUS_FMT_YUYV8_1X16 0x1008: MEDIA_BUS_FMT_RGB565_2X8_LE 0x100a: MEDIA_BUS_FMT_RGB888_1X24 0x100c: MEDIA_BUS_FMT_RGB888_2X12_LE 0x100d: MEDIA_BUS_FMT_ARGB8888_1X32 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3013: MEDIA_BUS_FMT_SGBRG8_1X8 0x3002: MEDIA_BUS_FMT_SGRBG8_1X8 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x3008: MEDIA_BUS_FMT_SBGGR12_1X12 0x3019: MEDIA_BUS_FMT_SBGGR14_1X14 0x301d: MEDIA_BUS_FMT_SBGGR16_1X16 0x300e: MEDIA_BUS_FMT_SGBRG10_1X10 0x3010: MEDIA_BUS_FMT_SGBRG12_1X12 0x301a: MEDIA_BUS_FMT_SGBRG14_1X14 0x301e: MEDIA_BUS_FMT_SGBRG16_1X16 0x300a: MEDIA_BUS_FMT_SGRBG10_1X10 0x3011: MEDIA_BUS_FMT_SGRBG12_1X12 0x301b: MEDIA_BUS_FMT_SGRBG14_1X14 0x301f: MEDIA_BUS_FMT_SGRBG16_1X16 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x3012: MEDIA_BUS_FMT_SRGGB12_1X12 0x301c: MEDIA_BUS_FMT_SRGGB14_1X14 0x3020: MEDIA_BUS_FMT_SRGGB16_1X16 0x2001: MEDIA_BUS_FMT_Y8_1X8 0x200a: MEDIA_BUS_FMT_Y10_1X10 0x2013: MEDIA_BUS_FMT_Y12_1X12 [laurent.pinchart@ideasonboard.com: Decrement index to replace loop counter k] [laurent.pinchart@ideasonboard.com: Return directly from within the loops] Fixes: e130291212df5 ("[media] media: Add i.MX media core driver") Signed-off-by: Philipp Zabel Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f2267d7ed803add8820c7a6537c12a6d8732f570 Author: Philipp Zabel Date: Tue Apr 14 23:20:29 2020 +0200 media: imx: utils: fix and simplify pixel format enumeration Merge yuv_formats and rgb_formats into a single array. Always loop over all entries, skipping those that do not match the requested search criteria. This simplifies the code, lets us get rid of the manual counting of array entries, and stops accidentally ignoring some non-mbus RGB formats. Before: $ v4l2-ctl -d /dev/video14 --list-formats-out ioctl: VIDIOC_ENUM_FMT Type: Video Output [0]: 'UYVY' (UYVY 4:2:2) [1]: 'YUYV' (YUYV 4:2:2) [2]: 'YU12' (Planar YUV 4:2:0) [3]: 'YV12' (Planar YVU 4:2:0) [4]: '422P' (Planar YUV 4:2:2) [5]: 'NV12' (Y/CbCr 4:2:0) [6]: 'NV16' (Y/CbCr 4:2:2) [7]: 'RGBP' (16-bit RGB 5-6-5) [8]: 'RGB3' (24-bit RGB 8-8-8) [9]: 'BX24' (32-bit XRGB 8-8-8-8) After: $ v4l2-ctl -d /dev/video14 --list-formats-out ioctl: VIDIOC_ENUM_FMT Type: Video Output [0]: 'UYVY' (UYVY 4:2:2) [1]: 'YUYV' (YUYV 4:2:2) [2]: 'YU12' (Planar YUV 4:2:0) [3]: 'YV12' (Planar YVU 4:2:0) [4]: '422P' (Planar YUV 4:2:2) [5]: 'NV12' (Y/CbCr 4:2:0) [6]: 'NV16' (Y/CbCr 4:2:2) [7]: 'RGBP' (16-bit RGB 5-6-5) [8]: 'RGB3' (24-bit RGB 8-8-8) [9]: 'BGR3' (24-bit BGR 8-8-8) [10]: 'BX24' (32-bit XRGB 8-8-8-8) [11]: 'XR24' (32-bit BGRX 8-8-8-8) [12]: 'RX24' (32-bit XBGR 8-8-8-8) [13]: 'XB24' (32-bit RGBX 8-8-8-8) Tested on a imx6q-sabresd. [laurent.pinchart@ideasonboard.com: Make loop counters unsigned] [laurent.pinchart@ideasonboard.com: Decrement index instead of adding a counter] [laurent.pinchart@ideasonboard.com: Return directly from within loop instead of breaking] [slongerbeam@gmail.com: Fix colorspace comparison error] Fixes: e130291212df5 ("[media] media: Add i.MX media core driver") Signed-off-by: Philipp Zabel Tested-by: Fabio Estevam Signed-off-by: Laurent Pinchart Signed-off-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9448762fd1d1550c254be36c4a1a6273b98e323b Author: Guru Das Srinagesh Date: Thu Apr 9 08:52:32 2020 +0200 media: ir-rx51: Use 64-bit division macro Since the PWM framework is switching struct pwm_state.period's datatype to u64, prepare for this transition by using DIV_ROUND_CLOSEST_ULL to handle a 64-bit dividend. Cc: Richard Fontana Cc: Thomas Gleixner Cc: Kate Stewart Cc: Allison Randal Signed-off-by: Guru Das Srinagesh Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit c77591a8ca5ad843238df67f89a1bdc0ee7dbb76 Author: Christophe JAILLET Date: Sat Apr 11 16:27:29 2020 +0200 media: m88ds3103: Add missing '\n' in log messages Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. While at it, change the log level from 'err' to 'debug'. Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod") Signed-off-by: Christophe JAILLET Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit d27958df93026a0768dd0394a200c09e78388f31 Author: Sean Young Date: Tue Apr 14 12:10:43 2020 +0200 media: dvb-usb: make dvb_usb_device_properties const This makes it possible to declare dvb_usb_device_properties const. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 96f3a9392799dd0f6472648a7366622ffd0989f3 Author: Colin Ian King Date: Mon Feb 10 18:51:33 2020 +0100 media: dvb: return -EREMOTEIO on i2c transfer failure. Currently when i2c transfers fail the error return -EREMOTEIO is assigned to err but then later overwritten when the tuner attach call is made. Fix this by returning early with the error return code -EREMOTEIO on i2c transfer failure errors. If the transfer fails, an uninitialized value will be read from b2. Addresses-Coverity: ("Unused value") Fixes: fbfee8684ff2 ("V4L/DVB (5651): Dibusb-mb: convert pll handling to properly use dvb-pll") Signed-off-by: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit a8648098948d9b04627408b0c51877720412dc9f Author: Sean Young Date: Tue Mar 31 14:39:52 2020 +0200 media: rc: if kernel is built without an IR codec, don't advertise it If the kernel is built without e.g. the imon IR decoder, the protocols sysfs file still show the protocol as available. If user-space tries to enable this decoder, the kernel will report an error: $ echo +imon > /sys/class/rc/rc0/protocols [ 57.693033] rc_core: Loaded IR protocol module ir-imon-decoder, but protocol imon still not available Ensuring that unavailable protocols are not advertised, ensures that users space knows it is not available, and a BPF based IR decoder can be loaded instead. This supports the case when no kernel-based codec needs to be compiled in, and every IR decoder can be BPF based. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 953f10064140327868ac451eefb0db1becbef200 Author: Sean Young Date: Thu Mar 12 10:22:45 2020 +0100 media: dvb: digitv: remove unused array element 0 The first element of the key array is not used. Remove it, and along with it a uninitialized memory read. This should fix the rc debug message. Link: https://www.spinics.net/lists/kernel/msg3374861.html Suggested-by: Phong Tran Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 06b29212c3a2467ef9d25876fe82b77fa3d09ac2 Author: Tang Bin Date: Sun Apr 19 15:06:07 2020 +0800 ARM: samsung: Use devm_platform_ioremap_resource() to simplify code Use devm_platform_ioremap_resource() instead of platform_get_resource() + devm_ioremap_resource(). Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Signed-off-by: Krzysztof Kozlowski commit ee9a71ad25549d28c26542d93270071e9a269408 Author: Tang Bin Date: Sun Apr 19 15:05:41 2020 +0800 ARM: samsung: Omit superfluous error message in s3c_adc_probe() In the function s3c_adc_probe(), when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Shengju Zhang Signed-off-by: Tang Bin Signed-off-by: Krzysztof Kozlowski commit 74f103928df70de5e9bf1a7646236986820e7009 Author: Chris Wilson Date: Mon Apr 20 21:30:40 2020 +0100 drm/i915/selftests: Show the pstate limits on any failure to reset min We want to see the pstate limits whenever we fail to set the minimum frequency as that may help for debugging. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420203040.8984-1-chris@chris-wilson.co.uk commit 007ff34e61c5874629a7016b4045522c05dbe64b Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:55 2020 +0530 drm/i915/display/vlv_dsi: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-14-pankaj.laxminarayan.bharadiya@intel.com commit e3c7c1052271260955affbe65c4f328286fbe5fb Author: Masahiro Yamada Date: Sat Feb 15 15:32:41 2020 +0900 x86/boot/build: Add cpustr.h to targets and remove clean-files Files in $(targets) are always cleaned up. Move the 'targets' assignment out of the ifdef and remove 'clean-files'. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200215063241.7437-1-masahiroy@kernel.org commit 26893e7e928e1790852b072edb9bff3c1309e111 Author: Sven Eckelmann Date: Mon Apr 13 21:23:29 2020 +0200 batman-adv: Utilize prandom_u32_max for random [0, max) values The kernel provides a function to create random values from 0 - (max-1) since commit f337db64af05 ("random32: add prandom_u32_max and convert open coded users"). Simply use this function to replace code sections which use prandom_u32 and a handcrafted method to map it to the correct range. Signed-off-by: Sven Eckelmann commit 9204a4f876b229505f4ab947124d1160b80bbb4c Author: Sven Eckelmann Date: Mon Apr 13 20:26:07 2020 +0200 batman-adv: trace: Drop unneeded types.h include The commit 04ae87a52074 ("ftrace: Rework event_create_dir()") restructured various macros in the ftrace framework. These changes also had the nice side effect that the linux/types.h include is no longer necessary to define some of the types used by these macros. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit c08dd06b3d25e8450a2e187ee6b7412d07c460af Author: Sven Eckelmann Date: Thu Mar 26 18:37:07 2020 +0100 batman-adv: Fix spelling error in term buffer checkpatch warns about a typo in the word bufFer which was introduced in commit 2191c1bcbc64 ("batman-adv: kernel doc for types.h"). Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 2a7e978625e887cbb80cb2188cf5f955e4223fa1 Author: Simon Wunderlich Date: Mon Apr 13 20:40:20 2020 +0200 batman-adv: Start new development cycle Signed-off-by: Simon Wunderlich commit e278f07679b022c47bbfe592da11a2215739bcfc Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:52 2020 +0530 drm/i915/display/overlay: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-11-pankaj.laxminarayan.bharadiya@intel.com commit 8d641574f3f057a49ff1e28fd306ab4fa06b7fa4 Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:51 2020 +0530 drm/i915/display/global_state: Prefer drm_WARN* over WARN* struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN* over WARN* calls. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-10-pankaj.laxminarayan.bharadiya@intel.com commit a7f2ad392928e7e01812641c8d696b21e01171f5 Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:50 2020 +0530 drm/i915/display/frontbuffer: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-9-pankaj.laxminarayan.bharadiya@intel.com commit 4ad53ededf0bc53bedae1ddc2b3e16a2b86faec5 Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:49 2020 +0530 drm/i915/display/dpll_mgr: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON at places where struct drm_device pointer can be extracted. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-8-pankaj.laxminarayan.bharadiya@intel.com commit cd13c72c1853f219e1f5577a107f48b9f9c44fdd Author: Iskren Chernev Date: Tue Apr 14 20:22:50 2020 +0300 ARM: dts: qcom: msm8974-klte: Add max77826 pmic node This introduces the MAX77826 PMIC that powers some pheripherals on the klte, like the touchpad, touchkeys and camera. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20200414172250.2363235-4-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 65876ae91e80d7746e36d3003866aa6f28c56a97 Author: Daniele Debernardi Date: Sat Apr 11 21:21:22 2020 +0300 ARM: dts: qcom: msm8974-klte: Add USB node This introduces the usb node which can be used e.g. for USB_ETH Signed-off-by: Daniele Debernardi Link: https://lore.kernel.org/r/20200411182122.2677248-6-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 8bf7a360a92cc6b2aebc8fa833ebc406ef317c38 Author: Daniele Debernardi Date: Sat Apr 11 21:21:21 2020 +0300 ARM: dts: qcom: msm8974-klte: Add sdhci1 node This introduces the eMMC sdhci node and its pinctrl state Signed-off-by: Daniele Debernardi Link: https://lore.kernel.org/r/20200411182122.2677248-5-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 8513de03928e84dd6b1debe334c4256cbf2d0f6f Author: Daniele Debernardi Date: Sat Apr 11 21:21:20 2020 +0300 ARM: dts: qcom: msm8974-klte: Add gpio-keys nodes This introduces the gpio-keys nodes for volume/home keys and the associated pinctrl state. Signed-off-by: Daniele Debernardi Link: https://lore.kernel.org/r/20200411182122.2677248-4-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 9111bbf3a19d463953f9889426314b993d047399 Author: Daniele Debernardi Date: Sat Apr 11 21:21:19 2020 +0300 ARM: dts: qcom: msm8974-klte: Remove inherited vreg_boost node The Samsung klte does not have a vreg_boost node. vreg_boost also depends on pm8941-gpio which are not present on the klte. Signed-off-by: Daniele Debernardi Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20200411182122.2677248-3-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 4e7573e7a54e1ae3052f1360b676bfeff22bbffb Author: Daniele Debernardi Date: Sat Apr 11 21:21:18 2020 +0300 ARM: dts: qcom: msm8974-klte: Add pma8084 regulator nodes The pma8084 replaces the pm8841,pm8941 found in other msm8974 devices. It is used for various things including gpio keys, sdhci, usb, dsi. The voltages are pulled from the vendor source tree. Signed-off-by: Daniele Debernardi Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20200411182122.2677248-2-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson commit 240031967ac4c63713c6e0c3249d734e23c913aa Author: Bjorn Andersson Date: Tue Apr 14 22:47:03 2020 -0700 arm64: dts: qcom: sm8250: Fix PDC compatible and reg The pdc node suffers from both too narrow compatible and insufficient cells in the reg, fix these. Fixes: 60378f1a171e ("arm64: dts: qcom: sm8250: Add sm8250 dts file") Tested-by: Vinod Koul Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200415054703.739507-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 871c60156dbee4417929607df20a299623650a68 Author: Souptick Joarder Date: Mon Apr 20 23:42:17 2020 +0530 drm/gma500: Remove dead code These are dead code since 3.7. If there is no plan to use them further, these can be removed forever. Signed-off-by: Souptick Joarder Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/1587406337-32317-1-git-send-email-jrdr.linux@gmail.com commit 02d8ecc18b8f392389ac9e7b785b0230ecb80833 Author: Sibi Sankar Date: Wed Apr 15 11:59:55 2020 +0530 soc: qcom: pdr: Remove impossible error condition The patch fbe639b44a82: "soc: qcom: Introduce Protection Domain Restart helpers" leads to the following static checker warning: drivers/soc/qcom/pdr_interface.c:158 pdr_register_listener() '(resp.curr_state < (-((~0 >> 1)) - 1)) => (s32min-s32max < s32min)' These are casted to int so they can't be outside of int range. Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers") Reported-by: Dan Carpenter Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200415062955.21439-1-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit 35bb4b22f606c0cc8eedf567313adc18161b1af4 Author: Douglas Anderson Date: Fri Apr 17 14:15:47 2020 -0700 soc: qcom: rpmh: Dirt can only make you dirtier, not cleaner Adding an item into the cache should never be able to make the cache cleaner. Use "|=" rather than "=" to update the dirty flag. Reviewed-by: Matthias Kaehlcke Reviewed-by: Maulik Shah Thanks, Maulik Reviewed-by: Bjorn Andersson Fixes: bb7000677a1b ("soc: qcom: rpmh: Update dirty flag only when data changes") Reported-by: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200417141531.1.Ia4b74158497213eabad7c3d474c50bfccb3f342e@changeid Signed-off-by: Bjorn Andersson commit ce04ecd9cf1e89385e72e43e349cda48c76ab1e2 Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:46 2020 +0530 drm/i915/display/display: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON at places where struct drm_device pointer can be extracted. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-5-pankaj.laxminarayan.bharadiya@intel.com commit 8b4f2137cc0fac74821cc097fe7b7e0110ea0762 Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:45 2020 +0530 drm/i915/display/ddi: Prefer drm_WARN* over WARN* struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN* over WARN* calls. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-4-pankaj.laxminarayan.bharadiya@intel.com commit 1e6850ee4c44cfb6fea9c4f3f7034f815c7874dd Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:44 2020 +0530 drm/i915/display/atomic_plane: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-3-pankaj.laxminarayan.bharadiya@intel.com commit 61198fe1bf48246d20de9d608a89687932e4dad6 Author: Pankaj Bharadiya Date: Mon Apr 6 16:57:43 2020 +0530 drm/i915/display/icl_dsi: Prefer drm_WARN_ON over WARN_ON struct drm_device specific drm_WARN* macros include device information in the backtrace, so we know what device the warnings originate from. Prefer drm_WARN_ON over WARN_ON. Signed-off-by: Pankaj Bharadiya Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406112800.23762-2-pankaj.laxminarayan.bharadiya@intel.com commit b7e2fba066223bce28107e8128e3f353b09ea6b4 Author: Bryan O'Donoghue Date: Tue Apr 14 23:14:30 2020 -0700 arm64: dts: qcom: sm8250: Add UFS controller and PHY Add nodes for the UFS controller and PHY, and enable these for the MTP with relevant supplies specified. Tested-by: Vinod Koul Reviewed-by: Vinod Koul Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200415061430.740854-3-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit ec13d5c23a33aafaaefb74968e305fb2e313a1fa Author: Bryan O'Donoghue Date: Tue Apr 14 23:14:29 2020 -0700 arm64: dts: qcom: sm8250-mtp: Add pm8150, pm8150l and pm8009 Add RPMh controlled regulators for the three PMICs and specify voltage ranges and mode for relevant regulators. Tested-by: Vinod Koul Reviewed-by: Vinod Koul Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200415061430.740854-2-bjorn.andersson@linaro.org [bjorn: Fixed up some supplies and voltages] Signed-off-by: Bjorn Andersson commit 11ebc2321b8ef88f549c5b8bf61ed4d00fc7952a Author: Jani Nikula Date: Mon Apr 20 16:16:32 2020 +0300 drm/i915/audio: fix compressed_bpp check The early check for compressed_bpp being zero is too early, as it is hit also when DSC is not enabled. Move the checks down to where the values are actually needed. This is a paranoid check for a situation that should not happen, so we don't really care about handling it gracefully apart from not oopsing. Fixes: 48b8b04c791d ("drm/i915/display: Enable DP Display Audio WA") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1750 Cc: Anshuman Gupta Cc: Uma Shankar Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200420131632.23283-1-jani.nikula@intel.com commit b6f78e2709693dba2e3e7c7f1f5251091db63dd2 Author: Bjorn Andersson Date: Tue Apr 14 23:21:54 2020 -0700 arm64: dts: qcom: sm8250: Add rpmhpd node Tested-by: Vinod Koul Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200415062154.741179-3-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 64016bb88e8519d0f8512b9861837779c1239c0d Author: Bjorn Andersson Date: Tue Apr 14 23:21:53 2020 -0700 soc: qcom: rpmhpd: Add SM8250 power domains Tested-by: Vinod Koul Reviewed-by: Vinod Koul Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200415062154.741179-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson commit 81b55ef1f47bfd3d0f8220d4f13ddf1dc2c66b09 Author: Jani Nikula Date: Mon Apr 20 17:04:38 2020 +0300 drm/i915: drop a bunch of superfluous inlines Remove a number of inlines from .c files, and let the compiler decide what's best. There's more to do, but need to start somewhere, and need to start setting the example. Acked-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200420140438.14672-2-jani.nikula@intel.com commit 95c31e68058e17ada15f8c451cb1e37a058a1f40 Author: Sai Prakash Ranjan Date: Thu Apr 9 17:13:37 2020 +0530 arm64: dts: qcom: sc7180: Add Coresight support Add coresight components found on Qualcomm SC7180 SoC. Signed-off-by: Sai Prakash Ranjan Reviewed-by: Stephen Boyd Reviewed-by: Mathieu Poirier Tested-by: Stephen Boyd Link: https://lore.kernel.org/r/73e4352c19afff4c9ea2041b263a85e68e6eef11.1586263250.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Bjorn Andersson commit 3c3041149c76a282e93433b4b8fdd3d3d01bc709 Author: Jani Nikula Date: Mon Apr 20 17:04:37 2020 +0300 drm/i915/hdmi: remove unused intel_hdmi_hdcp2_protocol() Unused, hiding from the compiler warnings behind the inline keyword. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200420140438.14672-1-jani.nikula@intel.com commit 459b1f86f1cba7de813fbc335df476c111feec22 Author: Christoph Hellwig Date: Tue Apr 14 14:31:36 2020 +0200 firmware: qcom_scm: fix bogous abuse of dma-direct internals As far as the device is concerned the dma address is the physical address. There is no need to convert it to a physical address, especially not using dma-direct internals that are not available to drivers and which will interact badly with IOMMUs. Last but not least the commit introducing it claimed to just fix a type issue, but actually changed behavior. Fixes: 6e37ccf78a532 ("firmware: qcom_scm: Use proper types for dma mappings") Reviewed-by: Bjorn Andersson Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20200414123136.441454-1-hch@lst.de Signed-off-by: Bjorn Andersson commit 1cf6c1a74e90e846400e74a094f2a99a84049f57 Author: YueHaibing Date: Fri Apr 17 18:10:32 2020 +0800 drm/gma500: remove unused variable 'hdmi_ids' drivers/gpu/drm/gma500/oaktrail_hdmi.c:676:35: warning: ‘hdmi_ids’ defined but not used [-Wunused-const-variable=] static const struct pci_device_id hdmi_ids[] = { ^~~~~~~~ It is never used, remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200417101032.8140-1-yuehaibing@huawei.com commit add0aff201fabce91570ed166376e0575bdbb1d8 Author: Geert Uytterhoeven Date: Thu Apr 16 12:30:55 2020 +0200 drm: Fix misspellings of "Analog Devices" According to https://www.analog.com/, the company name is spelled "Analog Devices". Signed-off-by: Geert Uytterhoeven Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200416103058.15269-4-geert+renesas@glider.be commit 150ccc181588b018891dc973f47905d574677b21 Author: Xiang Chen Date: Fri Apr 17 14:07:57 2020 +0800 mtd: spi-nor: Enable locking for n25q128a11 As 4bit block protection patchset for some micron models are merged, n25q128a11 also uses 4 bit Block Protection scheme, so enable locking for it. Tested it on n25q128a11, the locking functions work well. Signed-off-by: Xiang Chen Reviewed-by: Jungseung Lee Tested-by: Shreyas Joshi Signed-off-by: Tudor Ambarus commit 89e01caac641864c2453d41c81a990160a9acaf9 Author: Matt Roper Date: Wed Apr 15 16:34:35 2020 -0700 drm/i915: Use single set of AUX powerwell ops for gen11+ AUX power wells sometimes need additional handling besides just programming the specific power well registers: * Type-C PHY's also require additional Type-C register programming * ICL combo PHY's require additional workarounds * TGL & EHL combo PHY's can be treated like any other power well Today we have dedicated aux ops for the ICL combo PHY and Type-C cases. This works fine, but means that when a new platform shows up with identical general power well handling, but different types of PHYs on its outputs, we have to define an entire new power well table for that platform and can't just re-use the table from the earlier platform -- as an example, see ehl_power_wells[], which is a subset of icl_power_wells[], *except* that we need to specify different AUX ops for the third display. If we instead create a single set of top-level aux ops that will check the PHY type and then dispatch to the appropriate handlers, we can get more reuse out of our power well definitions. This allows us to immediately eliminate ehl_power_wells[] and simply reuse the ICL table; if future platforms follow the same general power well assignments as either ICL or TGL, we'll be able to re-use those tables in the same way. Note that I've only changed ICL+ platforms over to using the new icl_aux ops; at this point it's unlikely that we'll have any new platforms that re-use gen9 or earlier power well configurations. v2: - ICL_AUX_PW_TO_PHY() won't return the proper PHY for TBT AUX power wells. But we know those wells will only used on Type-C outputs anyway, so we can just check is is_tc_tbt flag in the condition. (Jose). Cc: José Roberto de Souza Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200415233435.3064257-2-matthew.d.roper@intel.com commit 305ac5a766b1d0dd8a4052c8c92e5464888eaa10 Author: Paul Cercueil Date: Fri Apr 17 19:00:37 2020 +0200 remoteproc: Add device-managed variants of rproc_alloc/rproc_add Add API functions devm_rproc_alloc() and devm_rproc_add(), which behave like rproc_alloc() and rproc_add() respectively, but register their respective cleanup function to be called on driver detach. Reviewed-by: Bjorn Andersson Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20200417170040.174319-2-paul@crapouillou.net Signed-off-by: Bjorn Andersson commit db65527836156fe9c6abe6b9b4aa02fac49a67e3 Author: Suman Anna Date: Thu Apr 16 19:20:36 2020 -0500 remoteproc: Use a local copy for the name field The current name field used in the remoteproc structure is simply a pointer to a name field supplied during the rproc_alloc() call. The pointer passed in by remoteproc drivers during registration is typically a dev_name pointer, but it is possible that the pointer will no longer remain valid if the devices themselves were created at runtime like in the case of of_platform_populate(), and were deleted upon any failures within the respective remoteproc driver probe function. So, allocate and maintain a local copy for this name field to keep it agnostic of the logic used in the remoteproc drivers. Reviewed-by: Mathieu Poirier Reviewed-by: Bjorn Andersson Signed-off-by: Suman Anna Link: https://lore.kernel.org/r/20200417002036.24359-3-s-anna@ti.com Signed-off-by: Bjorn Andersson commit 226f5db4212438cdfe1a94652d74c6c01788a837 Author: Mathieu Poirier Date: Mon Apr 20 17:16:01 2020 -0600 remoteproc: Get rid of tedious error path Get rid of tedious error management by moving firmware and operation allocation after calling device_initialize(). That way we take advantage of the automatic call to rproc_type_release() to cleanup after ourselves when put_device() is called. Signed-off-by: Mathieu Poirier Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Acked-by: Suman Anna Link: https://lore.kernel.org/r/20200420231601.16781-5-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit bf860aa176d0104cfbaf863acbadf5548f1172c2 Author: Mathieu Poirier Date: Mon Apr 20 17:16:00 2020 -0600 remoteproc: Split rproc_ops allocation from rproc_alloc() Make the rproc_ops allocation a function on its own in an effort to clean up function rproc_alloc(). Signed-off-by: Mathieu Poirier Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200420231601.16781-4-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit 9d5f82c8ba2471e34150a0e750ef54089e2a3740 Author: Mathieu Poirier Date: Mon Apr 20 17:15:59 2020 -0600 remoteproc: Restructure firmware name allocation Improve the readability of function rproc_alloc_firmware() by using a non-negated condition and moving the comment out of the conditional block Suggested-by: Alex Elder Signed-off-by: Mathieu Poirier Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200420231601.16781-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit 1487deda19c82d30d1867277e89bc2d515b9d2d4 Author: Mathieu Poirier Date: Mon Apr 20 17:15:58 2020 -0600 remoteproc: Use kstrdup_const() rather than kstrdup() For cases where @firmware is declared "const char *", use function kstrdup_const() to avoid needlessly creating another copy on the heap. Suggested-by: Bjorn Andersson Signed-off-by: Mathieu Poirier Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200420231601.16781-2-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit f49176fb13db5a1716255e8695b68feeb47cea3c Author: Stephan Gerhold Date: Wed Apr 15 10:11:59 2020 +0200 dt-bindings: soc: qcom: apr: Use generic node names for APR services Device nodes should be named according to the class of devices they belong to. Change the suggested names of the subnodes to apr-service@, which is already in use in arch/arm64/boot/dts/qcom/sdm845.dtsi. Reviewed-by: Srinivas Kandagatla Reviewed-by: Rob Herring Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200415081159.1098-2-stephan@gerhold.net Signed-off-by: Bjorn Andersson commit a48b284b403a4a073d8beb72d2bb33e54df67fb6 Author: Paul Moore Date: Mon Apr 20 10:09:29 2020 -0400 audit: fix a net reference leak in audit_send_reply() If audit_send_reply() fails when trying to create a new thread to send the reply it also fails to cleanup properly, leaking a reference to a net structure. This patch fixes the error path and makes a handful of other cleanups that came up while fixing the code. Reported-by: teroincn@gmail.com Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit b6246f4d8d0778fd045b84dbd7fc5aadd8f3136e Author: Colin Ian King Date: Mon Apr 20 22:51:49 2020 +0100 net: ipv4: remove redundant assignment to variable rc The variable rc is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit bd1266d3f21f7aba69d6c0627b2b81beb67df824 Merge: 80ad41f28ade 7d3cca75c169 Author: David S. Miller Date: Mon Apr 20 16:24:53 2020 -0700 Merge branch 'net-bcmgenet-Clean-up-after-ACPI-enablement' Andy Shevchenko says: ==================== net: bcmgenet: Clean up after ACPI enablement ACPI enablement series had missed some clean ups that would have been done at the same time. Here are these bits. In v2: - return dev_dbg() calls to avoid spamming logs when probe is deferred (Florian) - added Ack (Florian) - combined two, earlier sent, series together - added couple more patches ==================== Signed-off-by: David S. Miller commit 7d3cca75c169710048b0fea08522f635efcea893 Author: Andy Shevchenko Date: Tue Apr 21 00:51:21 2020 +0300 net: bcmgenet: Drop too many parentheses in bcmgenet_probe() No need to have parentheses around plain pointer variable or negation operator. Drop them for good. Signed-off-by: Andy Shevchenko Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit d2af1420cbc84f5eabcca6b667d7fb2339c398e2 Author: Andy Shevchenko Date: Tue Apr 21 00:51:20 2020 +0300 net: bcmgenet: Use get_unligned_beXX() and put_unaligned_beXX() It's convenient to use get_unligned_beXX() and put_unaligned_beXX() helpers to get or set MAC instead of open-coded variants. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller commit c80d36ff63a5fb447616e03d4339d2eef7884d28 Author: Andy Shevchenko Date: Tue Apr 21 00:51:19 2020 +0300 net: bcmgenet: Use devm_clk_get_optional() to get the clocks Conversion to devm_clk_get_optional() makes it explicit that clocks are optional. This change allows to handle deferred probe in case clocks are defined, but not yet probed. Due to above changes bail out in error case. While here, check potential error when enable main clock. Signed-off-by: Andy Shevchenko Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 9a965942a9cabb2cdca1d7e99c985d6978ece96c Author: Andy Shevchenko Date: Tue Apr 21 00:51:18 2020 +0300 net: bcmgenet: Drop useless OF code There is nothing which needs a set of OF headers, followed by redundant OF node ID check. Drop them for good. Signed-off-by: Andy Shevchenko Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit d4d9b47e4b10679d5c794e62f9866ee5ee204c0d Author: Andy Shevchenko Date: Tue Apr 21 00:51:17 2020 +0300 net: bcmgenet: Drop ACPI_PTR() to avoid compiler warning When compiled with CONFIG_ACPI=n, ACPI_PTR() will be no-op, and thus genet_acpi_match table defined, but not used. Compiler is not happy about such data. Drop ACPI_PTR() for good. Signed-off-by: Andy Shevchenko Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 90c165f0de3adad4719e65ab0c31d59edf5bd481 Author: Ricardo Cañuelo Date: Fri Apr 3 11:36:17 2020 +0200 docs: pr_*() kerneldocs and basic printk docs Add kerneldocs comments to the pr_*() macros in printk.h. Add a new rst node in the core-api manual describing the basic usage of printk and the related macro aliases. Signed-off-by: Ricardo Cañuelo Link: https://lore.kernel.org/r/20200403093617.18003-1-ricardo.canuelo@collabora.com Signed-off-by: Jonathan Corbet commit 4951d27b099bd24f87a093f67d91618742bd3a65 Author: Bumsik Kim Date: Fri Apr 3 12:15:07 2020 +0900 watchdog: clarify that stop() is optional The commit d0684c8a9354 ("watchdog: Make stop function optional") made stop function not mandatory, but the comments and the doc weren't reflected. Fix it to clarify. Signed-off-by: Bumsik Kim Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200403031507.63487-1-k.bumsik@gmail.com Signed-off-by: Jonathan Corbet commit 80ad41f28ade9d00ab3c34aa4946349fc82a5233 Merge: 794867ee6730 6533380dfd00 Author: David S. Miller Date: Mon Apr 20 16:11:31 2020 -0700 Merge tag 'mlx5-updates-2020-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2020-04-20 This series includes misc updates and clean ups to mlx5 driver: 1) improve some comments from Hu Haowen. 2) Handles errors of netif_set_real_num_{tx,rx}_queues, from Maxim 3) IPsec and FPGA related code cleanup to prepare for ASIC devices IPsec offloads, from Raed 4) Allow partial mask for tunnel options, from Roi. ==================== Signed-off-by: David S. Miller commit fc965497d5b3204d7b726c27fefe92d2e885f994 Author: Alessia Mantegazza Date: Mon Apr 13 18:34:57 2020 +0200 doc:it_IT: translation of documents in process/ Translations for the following documents in process/: - email-clients - management-style Signed-off-by: Alessia Mantegazza Signed-off-by: Federico Vaga Link: https://lore.kernel.org/r/20200413163457.52669-1-federico.vaga@vaga.pv.it Signed-off-by: Jonathan Corbet commit 794867ee6730fe3f0d419d3911f35a725cafe3a8 Author: Heiner Kallweit Date: Mon Apr 20 22:52:59 2020 +0200 r8169: change wmb to smb_wmb in rtl8169_start_xmit A barrier is needed here to ensure that rtl_tx sees the descriptor changes (DescOwn set) before the updated tp->cur_tx value. Else it may wrongly assume that the transfer has been finished already. For this purpose smp_wmb() is sufficient. No separate barrier is needed for ordering the descriptor changes with the MMIO doorbell write. The needed barrier is included in the non-relaxed writel() used by rtl8169_doorbell(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7dbffd3f84b08c6c9f48f211dd7e5b41dade3092 Author: Cristian Souza Date: Fri Apr 10 22:02:01 2020 -0300 docs: admin-guide: Clarify sentences Changes to make the text more formal and organized. The reasons are now cited and described at the same time. Minor grammatical problems have also been fixed. Signed-off-by: Cristian Souza Link: https://lore.kernel.org/r/20200411010201.GA22706@darkstar Signed-off-by: Jonathan Corbet commit d8e8ff1fe30278e46afcb3029468e678bbcffddd Author: Oded Gabbay Date: Sat Apr 18 20:41:32 2020 +0300 docs: ioctl-number.rst: add habanalabs driver IOCTL Habanalabs driver in misc exposes several IOCTLs to userspace. Document the letter and IOCTLs number range in ioctl-number.rst. Signed-off-by: Oded Gabbay Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20200418174132.10597-1-oded.gabbay@gmail.com Signed-off-by: Jonathan Corbet commit c7e1cc318d4a19549d55a4f114f3a3d472e9531e Author: Gal Pressman Date: Mon Apr 20 10:41:15 2020 +0300 dma-buf: Couple of documentation typo fixes Fix a couple of typos: "as" -> "has" and "int" -> "in". Signed-off-by: Gal Pressman Link: https://lore.kernel.org/r/20200420074115.23931-1-galpress@amazon.com Signed-off-by: Jonathan Corbet commit 5d8e5aee0e9391141fe2ab892d0ac98de5783537 Author: Stephen Kitt Date: Sun Mar 15 13:26:48 2020 +0100 docs: sysctl/kernel: document BPF entries Based on the implementation in kernel/bpf/syscall.c, kernel/bpf/trampoline.c, include/linux/filter.h, and the documentation in bpftool-prog.rst. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20200315122648.20558-1-steve@sk2.org Signed-off-by: Jonathan Corbet commit 3f11de39c489b0e947d7bd036be3d154e67e3329 Merge: 2f9c502552cd 4642289b5f66 Author: Jonathan Corbet Date: Mon Apr 20 16:58:17 2020 -0600 Merge branch 'mauro' into docs-next Mauro sez: Patches 1 to 5 contain changes to the documentation toolset: - The first 3 patches help to reduce a lot the number of reported kernel-doc issues, by making the tool more smart. - Patches 4 and 5 are meant to partially address the PDF build, with now requires Sphinx version 2.4 or upper. The remaining patches fix broken references detected by this tool: ./scripts/documentation-file-ref-check and address other random errors due to tags being mis-interpreted or mis-used. They are independent each other, but some may depend on the kernel-doc improvements. commit 6bd4763fd532cff43f9b15704f324c45a9806f53 Author: Jitao Shi Date: Wed Apr 15 09:13:19 2020 +0800 drm/mediatek: set dpi pin mode to gpio low to avoid leakage current Config dpi pins mode to output and pull low when dpi is disabled. Aovid leakage current from some dpi pins (Hsync Vsync DE ... ). Signed-off-by: Jitao Shi Signed-off-by: Chun-Kuang Hu commit b0ff9b590733079f7f9453e5976a9dd2630949e3 Author: Jitao Shi Date: Wed Apr 15 09:13:17 2020 +0800 dt-bindings: display: mediatek: control dpi pins mode to avoid leakage Add property "pinctrl-names" to swap pin mode between gpio and dpi mode. Set the dpi pins to gpio mode and output-low to avoid leakage current when dpi disabled. Acked-by: Rob Herring Signed-off-by: Jitao Shi Signed-off-by: Chun-Kuang Hu commit 470d4116ef93a94bcb710f7d8a5f25cd640ad330 Author: Saravanan Sekar Date: Wed Apr 15 08:55:32 2020 +0200 dt-bindings: Add an entry for Würth Elektronik, we Add an entry for Würth Elektronik GmbH, we Signed-off-by: Saravanan Sekar Signed-off-by: Rob Herring commit 56ae89228d9c8e6cafc382942077d9e7686cef1b Author: Peng Fan Date: Tue Apr 14 21:24:27 2020 +0800 dt-bindings: mailbox: imx-mu: correct example The example use i.MX8QXP MU, but actually the MU is compatible with i.MX6SX, so add the compatible. Signed-off-by: Peng Fan Acked-by: Oleksij Rempel Reviewed-by: Oleksij Rempel Signed-off-by: Rob Herring commit 680f9c28c1fd223649f78f9e00d02b21cfb6d217 Author: Paul Cercueil Date: Mon Apr 13 17:26:25 2020 +0200 dt-bindings: MIPS: Require SoC compatible string after board string All devicetree board files list a compatible string for the SoC after the compatible string of the board. Enhance the YAML format so that these SoC compatible strings appear aside each supported Ingenic board. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 989f51752783a8eab32d53f9991c889faed1da6b Author: Paul Cercueil Date: Mon Apr 13 17:26:24 2020 +0200 dt-bindings: usb: ingenic,musb: Add usb-role-switch property Add the common usb-role-switch boolean property to the list of the supported properties. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 63d35f6cf31f68db7d75bce827a7b59710276533 Author: Paul Cercueil Date: Mon Apr 13 17:26:23 2020 +0200 dt-bindings: dma: Convert jz4740-dma doc to YAML Convert the textual documentation for the Ingenic SoCs DMA Controller devicetree binding to YAML. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 2ebeea2b8906e8e68154d0a7518c0fbad55d9b93 Author: Paul Cercueil Date: Mon Apr 13 17:26:22 2020 +0200 dt-bindings: mmc: Convert jz4740-mmc doc to YAML Convert the jz4740-mmc.txt documentation to YAML. The ingenic,jz4770-mmc compatible string was added in the process, with a fallback to ingenic,jz4760-mmc. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 49ac0c7cfe02b7ab3b17301b3af71bdce64df99d Author: Paul Cercueil Date: Mon Apr 13 17:26:21 2020 +0200 dt-bindings: timer: Convert ingenic,tcu.txt to YAML Convert the ingenic,tcu.txt file to YAML. Signed-off-by: Paul Cercueil Signed-off-by: Rob Herring commit 4d8d2177625c26488e29f2ccd5194df29466f2ff Author: Ricardo Cañuelo Date: Mon Apr 13 12:30:47 2020 +0200 dt-bindings: nvmem: Convert rockchip-efuse bindings to yaml Convert the existing rockchip-efuse binding to json-schema. No changes were done to the binding except for small changes in the documentation strings. This deletes the rockchip-efuse.txt binding and replaces it with rockchip-efuse.yaml. Signed-off-by: Ricardo Cañuelo Signed-off-by: Rob Herring commit 02c625c5de6028cebb7a1ade5d6f532c6a535e0d Author: Martin Blumenstingl Date: Sat Apr 11 18:57:00 2020 +0200 dt-bindings: gpu: mali-utgard: Add the #cooling-cells property The GPU can be one of the big heat sources on a SoC. Allow the "#cooling-cells" property to be specified for ARM Mali Utgard GPUs so the GPU clock speeds (and voltages) can be reduced to prevent a SoC from overheating. Reviewed-by: Qiang Yu Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Rob Herring commit 2d4a22e79a5fdbaf54e5d75d933fb21dd12802b0 Author: Johan Jonker Date: Sat Apr 11 14:25:07 2020 +0200 dt-bindings: sram: convert rockchip-pmu-sram bindings to yaml Current dts files with 'rockchip-pmu-sram' compatible nodes are now verified with sram.yaml, although the original text document still exists. Merge rockchip-pmu-sram.txt with sram.yaml by adding it as description with an example. Make #address-cells, #size-cells and ranges optional if there are no child nodes to prevent yaml warnings. Signed-off-by: Johan Jonker Signed-off-by: Rob Herring commit 8d3cdfeca808f2b2dee11dda4282770c4b579b48 Author: tangjianqiang Date: Fri Apr 10 16:32:04 2020 +0800 of: fix the warnings from command line. Gerrit will complain with this warnings: ERROR: (foo*) should be (foo *) Signed-off-by: tangjianqiang Reviewed-by: Frank Rowand Signed-off-by: Rob Herring commit 4642289b5f6609b1af152a81b603ae8451df2626 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:59 2020 +0200 lib: bitmap.c: get rid of some doc warnings There are two ascii art drawings there. Use a block markup tag there in order to get rid of those warnings: ./lib/bitmap.c:189: WARNING: Unexpected indentation. ./lib/bitmap.c:190: WARNING: Block quote ends without a blank line; unexpected unindent. ./lib/bitmap.c:190: WARNING: Unexpected indentation. ./lib/bitmap.c:191: WARNING: Line block ends without a blank line. It should be noticed that there's actually a syntax violation right now, as something like: /** ... @src: will be handled as a definition for @src parameter, and not as part of a diagram. So, we need to add something before it, in order for this to be processed the way it should. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1e2568fdfa838c1a0d8cc2a1d70dd4b6de99bfb1.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 03c109d66867767ddbb0fe09223410a79193f5ea Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:58 2020 +0200 futex: get rid of a kernel-docs build warning Adjust whitespaces and blank lines in order to get rid of this: ./kernel/futex.c:491: WARNING: Definition list ends without a blank line; unexpected unindent. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/57788af7889161483e0c97f91c079cfb3986c4b3.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 2b8e8b5599a1831e9a4cf9aa86476887ff425e57 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:57 2020 +0200 fs: inode.c: get rid of docs warnings Use *foo makes the toolchain to think that this is an emphasis, causing those warnings: ./fs/inode.c:1609: WARNING: Inline emphasis start-string without end-string. ./fs/inode.c:1609: WARNING: Inline emphasis start-string without end-string. ./fs/inode.c:1615: WARNING: Inline emphasis start-string without end-string. So, use, instead, ``*foo``, in order to mark it as a literal block. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e8da46a0e57f2af6d63a0c53665495075698e28a.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit af690f459393017ce40bb9beef6a00e79511574d Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:56 2020 +0200 firewire: firewire-cdev.hL get rid of a docs warning This warning: ./include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string. is because %FOO doesn't work if there's a parenthesis at the string (as a parenthesis may indicate a function). So, mark the literal block using the alternate ``FOO`` syntax. Acked-by: Stefan Richter Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9b2501a41eba27ccdd4603cac2353c0efba7a90a.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a31a6997e6df4bd0d7782dbe945a59c321475669 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:55 2020 +0200 ata: libata-core: fix a doc warning The docs toolchain doesn't recognise this pattern: @link->[hw_]sata_spd_limit As it can't really process it. So, instead, let's mark it with a literal block markup: ``link->[hw_]sata_spd_limit`` in order to get rid of the following warning: ./drivers/ata/libata-core.c:5974: WARNING: Unknown target name: "hw". Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9a21444df75c46095c4b1839d2061d19c9addcff.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 77c34b2c18d4d88aed9ab3407407c492e0ce18b8 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:54 2020 +0200 docs: dt: rockchip,dwc3.txt: fix a pointer to a renamed file phy-rockchip-inno-usb2.txt was converted to yaml. Fix the corresponding reference. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/287bd271f5c542e9d12a132a6b6a17672c9fd67c.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit baeb2d5cb8ea84dfb932cbde0e2adcd527e51bb5 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:53 2020 +0200 docs: Makefile: place final pdf docs on a separate dir The Sphinx build system for PDF is too complex and generate lots of ancillary files, including one PDF file for each image. So, at the end, the main latex dir has 156 pdf files, instead of the 71 ones that would match each generated book. That's confusing and it makes harder to identify when something didn't work. So, instead, let's move the final PDF output(s) to a separate dir. This way, the latex/ dir will have the temporary and the final *.tex files, while the final pdf files that built ok will be under the pdf/ directory. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/832752cbc9678a6e8d3d634bc3356d655d44684f.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 36536a02e5542ea4909eea27fa7b173e81565312 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:52 2020 +0200 docs: i2c: rename i2c.svg to i2c_bus.svg When generating the PDF output, the Documentation/i2c dir will generate an i2c.pdf. The same happens with i2c.svg: it will also produce a file with the same name, at the same dir. This causes errors when building the PDF output. So, rename the image to i2c_bus.svg. Signed-off-by: Mauro Carvalho Chehab Acked-by: Wolfram Sang Link: https://lore.kernel.org/r/ecf3d51909ce46b3e84a1df4b36f07d76989e5da.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 8f97986ccbd75ff7f4deab8e33fd33be1e9d43c4 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:51 2020 +0200 docs: powerpc: cxl.rst: mark two section titles as such The User API chapter contains two sub-chapters. Mark them as such. Signed-off-by: Mauro Carvalho Chehab Acked-by: Andrew Donnellan Link: https://lore.kernel.org/r/190d67397cd63e419de8d85b92e8018d48e8c345.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 3f4a6c925a42adc15d3d50a333b179743e31df45 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:50 2020 +0200 docs: dt: fix a broken reference for a file converted to json Changeset 32ced09d7903 ("dt-bindings: serial: Convert slave-device bindings to json-schema") moved a binding to json and updated the links. Yet, one link was not changed, due to a merge conflict. Update this one too. Fixes: 32ced09d7903 ("dt-bindings: serial: Convert slave-device bindings to json-schema") Reviewed-by: Geert Uytterhoeven Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9b1603e254d39c9607bfedefeedaafd2c44aeb19.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit b4c6d8efdcdde455e0bd9b5df5c42b28c131ca6c Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:49 2020 +0200 docs: dt: qcom,dwc3.txt: fix cross-reference for a converted file The qcom-qusb2-phy.txt file was converted and renamed to yaml. Update cross-reference accordingly. Fixes: 8ce65d8d38df ("dt-bindings: phy: qcom,qusb2: Convert QUSB2 phy bindings to yaml") Reviewed-by: Stephen Boyd Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a055c564f2a79aa748064329d938db8b3c8edd58.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 9070492b10c36faba0d9c2cb13d3e0a5a0ffaf6a Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:48 2020 +0200 docs: vm: index.rst: add an orphan doc to the building system The new free_page_reporting.rst file is not listed at the index. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/146432ae6965a2bb62c929a6b62f9d4010986622.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 4a3fe6541c8cde8cb69e6453752b7fea1aac7d55 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:47 2020 +0200 docs: mm: userfaultfd.rst: use a cross-reference for a section Instead of using "foo", let's use `foo`_, with is a ReST way of saying that foo is a section of the document. With that, after building the docs, an hyperlink is generated. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/f46b45f1aaec233217f2e0b0438bbd8cc16fe17b.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 14a7e51ff184281a8c02c1cf803df15fd1ac19c8 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:46 2020 +0200 docs: mm: userfaultfd.rst: use ``foo`` for literals Several parts of this document define literals: ioctl names, function calls, directory patches, etc. Mark those as literal blocks, in order to improve its readability (both at text mode and after parsed by Sphinx. This fixes those two warnings: Documentation/admin-guide/mm/userfaultfd.rst:139: WARNING: Inline emphasis start-string without end-string. Documentation/admin-guide/mm/userfaultfd.rst:139: WARNING: Inline emphasis start-string without end-string. produced during documentation build. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2ae061761baf8fe00cdf8a7e6dae293756849a05.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit f08252469ef5b10863424e502bb1ed049d18390c Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:45 2020 +0200 docs: drivers: fix some warnings at base/platform.c when building docs Currrently, two warnings are generated when building docs: ./drivers/base/platform.c:136: WARNING: Unexpected indentation. ./drivers/base/platform.c:214: WARNING: Unexpected indentation. As examples are code blocks, they should use "::" markup. However, Example:: Is currently interpreted as a new section. While we could fix kernel-doc to accept such new syntax, it is easier to just replace it with: For Example:: Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/564273815a76136fb5e453969b1012a786d99e28.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit ad89c8852fde7ab0c4007f5b753517cf508d12be Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:44 2020 +0200 docs: spi: spi.h: fix a doc building warning We need to add a blank line to avoid this warning: ./include/linux/spi/spi.h:401: WARNING: Unexpected indentation. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1c701b3ac903dc0bc304dca958fbdee53bd38dc3.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 00aff95659616a131ae4b461aa21e429c33907b5 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:42 2020 +0200 docs: ras: don't need to repeat twice the same thing We don't need to say twice "for the first time" at the same paragraph. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/f76dcae96de8b1bb8ee37a79781c111c825e26d6.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit cfa204984d57ef205b09c7f6db9b562821b51dbd Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:41 2020 +0200 docs: ras: get rid of some warnings Sphinx produce some warnings due to a bad table format: Documentation/admin-guide/ras.rst:358: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/admin-guide/ras.rst:358: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/admin-guide/ras.rst:363: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/admin-guide/ras.rst:363: WARNING: Definition list ends without a blank line; unexpected unindent. Rearrange the things there in order to supress the warnings while being precise at the Sphinx output about how ranks are mapped into csrows. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9e1bb44d6dbedb5b6f049d081b47da1f9620de16.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit a588332fba0b13d5090537812865f3170fdf19c2 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:40 2020 +0200 docs: pci: boot-interrupts.rst: improve html output There are some warnings with this file: /Documentation/PCI/boot-interrupts.rst:42: WARNING: Unexpected indentation. /Documentation/PCI/boot-interrupts.rst:52: WARNING: Block quote ends without a blank line; unexpected unindent. /Documentation/PCI/boot-interrupts.rst:92: WARNING: Unexpected indentation. /Documentation/PCI/boot-interrupts.rst:98: WARNING: Unexpected indentation. /Documentation/PCI/boot-interrupts.rst:136: WARNING: Unexpected indentation. It turns that this file conversion to ReST could be improved, in order to remove the warnings and provide a better output. So, fix the warnings by adjusting blank lines, add a table and some list markups. Also, mark endnodes as such. Acked-by: Bjorn Helgaas Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a6a9eb16eede10731bcce69a600ab12d92e6ba47.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 877a37d31e0f9f97d04f8d211924dc16df74d31a Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:39 2020 +0200 docs: arm64: booting.rst: get rid of some warnings Get rid of those warnings: Documentation/arm64/booting.rst:253: WARNING: Unexpected indentation. Documentation/arm64/booting.rst:259: WARNING: Block quote ends without a blank line; unexpected unindent. By adding an extra blank lines where needed. While here, use list markups on some places, as otherwise Sphinx will consider the next lines as continuation of the privious ones. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/121b267be0a102fde73498c31792e5a9309013cc.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit d91589556b6a096d53f47ed3d91172a2788d4cdb Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:38 2020 +0200 docs: amu: supress some Sphinx warnings Add extra blank lines on some places, in order to avoid those warnings when building the docs: Documentation/arm64/amu.rst:26: WARNING: Unexpected indentation. Documentation/arm64/amu.rst:60: WARNING: Unexpected indentation. Documentation/arm64/amu.rst:81: WARNING: Unexpected indentation. Documentation/arm64/amu.rst:108: WARNING: Unexpected indentation. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ab0881638fc41ed790b3307a8e022ec84b7cce7e.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 0c1bc6b84525b96aa9fb8f6fbe8c5cb26a5c0ead Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:37 2020 +0200 docs: filesystems: fix renamed references Some filesystem references got broken by a previous patch series I submitted. Address those. Signed-off-by: Mauro Carvalho Chehab Acked-by: David Sterba # fs/affs/Kconfig Link: https://lore.kernel.org/r/57318c53008dbda7f6f4a5a9e5787f4d37e8565a.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 3ecad8c2c1ff333e204c26e2f0dddfa623153f87 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:36 2020 +0200 docs: fix broken references for ReST files that moved around Some broken references happened due to shifting files around and ReST renames. Those can't be auto-fixed by the script, so let's fix them manually. Signed-off-by: Mauro Carvalho Chehab Acked-by: Corentin Labbe Link: https://lore.kernel.org/r/64773a12b4410aaf3e3be89e3ec7e34de2484eea.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 72ef5e52b3f74c0be47b20f5c434b7ecc830cf40 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:35 2020 +0200 docs: fix broken references to text files Several references got broken due to txt to ReST conversion. Several of them can be automatically fixed with: scripts/documentation-file-ref-check --fix Reviewed-by: Mathieu Poirier # hwtracing/coresight/Kconfig Reviewed-by: Paul E. McKenney # memory-barrier.txt Acked-by: Alex Shi # translations/zh_CN Acked-by: Federico Vaga # translations/it_IT Acked-by: Marc Zyngier # kvm/arm64 Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6f919ddb83a33b5f2a63b6b5f0575737bb2b36aa.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit f9faa90899a2fa6e830bb785d473ebbedebcf80b Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:34 2020 +0200 docs: dt: fix broken reference to phy-cadence-torrent.yaml This file was removed, and another file was added instead of it, on two separate commits. Splitting a single logical change (doc conversion) on two patches is a bad thing, as it makes harder to discover what crap happened. Anyway, this patch fixes the broken reference, making it pointing to the new location of the file. Fixes: 922003733d42 ("dt-bindings: phy: Remove Cadence MHDP PHY dt binding") Fixes: c6d8eef38b7f ("dt-bindings: phy: Add Cadence MHDP PHY bindings in YAML format.") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3f1cf6d74e392f3ee9f894d82cb7ee29d04c1b6d.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 0855a36e22483b8e56eea84112eb0d5c48a2fa3a Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:33 2020 +0200 MAINTAINERS: dt: fix pointers for ARM Integrator, Versatile and RealView There's a conversion from a plain text binding file into 4 yaml ones. The old file got removed, causing this new warning: Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/arm/arm-boards Address it by replacing the old reference by the new ones Fixes: 2d483550b6d2 ("dt-bindings: arm: Drop the non-YAML bindings") Fixes: 33fbfb3eaf4e ("dt-bindings: arm: Add Integrator YAML schema") Fixes: 4b900070d50d ("dt-bindings: arm: Add Versatile YAML schema") Fixes: 7db625b9fa75 ("dt-bindings: arm: Add RealView YAML schema") Fixes: 4fb00d9066c1 ("dt-bindings: arm: Add Versatile Express and Juno YAML schema") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/eae3440fb70c1b1666973e34fd3fd6b8ab4a3bc7.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 101e330fd3f275ea553224bece4cf11ba20c6def Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:32 2020 +0200 MAINTAINERS: dt: update display/allwinner file entry Changeset f5a98bfe7b37 ("dt-bindings: display: Convert Allwinner display pipeline to schemas") split Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt into several files. Yet, it kept the old place at MAINTAINERS. Update it to point to the new place. Fixes: f5a98bfe7b37 ("dt-bindings: display: Convert Allwinner display pipeline to schemas") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1be758765272ba4c2acbc3904bdf71c863a90186.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 25813cae1eebbd77240b19ba45a1854020fa2cf6 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:31 2020 +0200 docs: LaTeX/PDF: drop list of documents The building system can auto-generate a list of documents since commit: 9d42afbe6bd4 ("docs: pdf: add all Documentation/*/index.rst to PDF output"). The added logic there allows keeping the existing list, but there's not real reason to keep it. Now, the media document has gone (it was split into tree). So, it sounds about time to get rid of the manual entries, and let the script to generate it automatically instead. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9345dba7164497dbf28578f6ec271e479379610c.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit d5afc9640a6d4596e57a2c4906f903ab1c83ada5 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:30 2020 +0200 docs: update recommended Sphinx version to 2.4.4 There are some docs that have nested tables. While this was always part of the spec, only Sphinx version 2.4.x can translate it to LaTeX. In other words, if someone is using a Sphinx version < 2.4, the LaTeX and PDF output won't work for some of the docs. So, it seems that it is time to raise the bar again for the recommented version. The Sphinx check script is already smart enough to keep working, with older versions, warning the users that an upgrade is recommended (and explaining how): Sphinx version 1.7.9 Warning: It is recommended at least Sphinx version 2.4.4. Detected OS: Fedora release 31 (Thirty One). To upgrade Sphinx, use: /usr/bin/virtualenv sphinx_2.4.4 . sphinx_2.4.4/bin/activate pip install -r ./Documentation/sphinx/requirements.txt Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/498f701c618f7d0cf5f0a37e5889ee926f7c8bf4.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 0d55d48b19ff3a31b295836da23223a52de7ef06 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:29 2020 +0200 scripts: kernel-doc: accept blank lines on parameter description Sphinx is very pedantic with respect to blank lines. Sometimes, in order to make it to properly handle something, we need to add a blank line. However, currently, any blank line inside a kernel-doc comment like: /* * @foo: bar * * foobar * * some description will be considered as if "foobar" was part of the description. This patch changes kernel-doc behavior. After it, foobar will be considered as part of the parameter text. The description will only be considered as such if it starts with: zero spaces after asterisk: *foo one space after asterisk: * foo or have a explicit Description section: * Description: Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c07d2862792d75a2691d69c9eceb7b89a0164cc0.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit ee2aa7590398ecc0877552191e38d8a282f21cb8 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:28 2020 +0200 scripts: kernel-doc: accept negation like !@var On a few places, it sometimes need to indicate a negation of a parameter, like: !@fshared This pattern happens, for example, at: kernel/futex.c and it is perfectly valid. However, kernel-doc currently transforms it into: !**fshared** This won't do what it would be expected. Fortunately, fixing the script is a simple matter of storing the "!" before "@" and adding it after the bold markup, like: **!fshared** Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/0314b47f8c3e1f9db00d5375a73dc3cddd8a21f2.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 346282db9c6bc7ce2dad8ae640494f3f88d23889 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:27 2020 +0200 scripts: kernel-doc: proper handle @foo->bar() The pattern @foo->bar() is valid, as it can be used by a function pointer inside a struct passed as a parameter. Right now, it causes a warning: ./drivers/firewire/core-transaction.c:606: WARNING: Inline strong start-string without end-string. In this specific case, the kernel-doc markup is: /** * fw_core_remove_address_handler() - unregister an address handler * @handler: callback * * To be called in process context. * * When fw_core_remove_address_handler() returns, @handler->callback() is * guaranteed to not run on any CPU anymore. */ With seems valid on my eyes. So, instead of trying to hack the kernel-doc markup, let's teach it about how to handle such things. This should likely remove lots of other similar warnings as well. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/48b46426d7bf6ff7529f20e5718fbf4e9758e62c.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e64419d991ea212af087d3c57fcabb4d27db03fc Author: Sean Christopherson Date: Fri Mar 20 14:28:10 2020 -0700 KVM: x86: Move "flush guest's TLB" logic to separate kvm_x86_ops hook Add a dedicated hook to handle flushing TLB entries on behalf of the guest, i.e. for a paravirtualized TLB flush, and use it directly instead of bouncing through kvm_vcpu_flush_tlb(). For VMX, change the effective implementation implementation to never do INVEPT and flush only the current context, i.e. to always flush via INVVPID(SINGLE_CONTEXT). The INVEPT performed by __vmx_flush_tlb() when @invalidate_gpa=false and enable_vpid=0 is unnecessary, as it will only flush guest-physical mappings; linear and combined mappings are flushed by VM-Enter when VPID is disabled, and changes in the guest pages tables do not affect guest-physical mappings. When EPT and VPID are enabled, doing INVVPID is not required (by Intel's architecture) to invalidate guest-physical mappings, i.e. TLB entries that cache guest-physical mappings can live across INVVPID as the mappings are associated with an EPTP, not a VPID. The intent of @invalidate_gpa is to inform vmx_flush_tlb() that it must "invalidate gpa mappings", i.e. do INVEPT and not simply INVVPID. Other than nested VPID handling, which now calls vpid_sync_context() directly, the only scenario where KVM can safely do INVVPID instead of INVEPT (when EPT is enabled) is if KVM is flushing TLB entries from the guest's perspective, i.e. is only required to invalidate linear mappings. For SVM, flushing TLB entries from the guest's perspective can be done by flushing the current ASID, as changes to the guest's page tables are associated only with the current ASID. Adding a dedicated ->tlb_flush_guest() paves the way toward removing @invalidate_gpa, which is a potentially dangerous control flag as its meaning is not exactly crystal clear, even for those who are familiar with the subtleties of what mappings Intel CPUs are/aren't allowed to keep across various invalidation scenarios. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-15-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit bc41d0c40ec2a09b775e2c65f425f903733f5b22 Author: Sean Christopherson Date: Fri Mar 20 14:28:09 2020 -0700 KVM: nVMX: Use vpid_sync_vcpu_addr() to emulate INVVPID with address Use vpid_sync_vcpu_addr() to emulate the "individual address" variant of INVVPID now that said function handles the fallback case of the (host) CPU not supporting "individual address". Note, the "vpid == 0" checks in the vpid_sync_*() helpers aren't actually redundant with the "!operand.vpid" check in handle_invvpid(), as the vpid passed to vpid_sync_vcpu_addr() is a KVM (host) controlled value, i.e. vpid02 can be zero even if operand.vpid is non-zero. No functional change intended. Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-14-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ca431c0cc3317e36c7011df2d2319385465db442 Author: Sean Christopherson Date: Fri Mar 20 14:28:08 2020 -0700 KVM: VMX: Drop redundant capability checks in low level INVVPID helpers Remove the INVVPID capabilities checks from vpid_sync_vcpu_single() and vpid_sync_vcpu_global() now that all callers ensure the INVVPID variant is supported. Note, in some cases the guarantee is provided in concert with hardware_setup(), which enables VPID if and only if at least of invvpid_single() or invvpid_global() is supported. Drop the WARN_ON_ONCE() from vmx_flush_tlb() as vpid_sync_vcpu_single() will trigger a WARN() on INVVPID failure, i.e. if SINGLE_CONTEXT isn't supported. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-13-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ab4b3597ffce01e9080ce5760e5a407a134701ae Author: Sean Christopherson Date: Fri Mar 20 14:28:07 2020 -0700 KVM: VMX: Handle INVVPID fallback logic in vpid_sync_vcpu_addr() Directly invoke vpid_sync_context() to do a global INVVPID when the individual address variant is not supported instead of deferring such behavior to the caller. This allows for additional consolidation of code as the logic is basically identical to the emulation of the individual address variant in handle_invvpid(). No functional change intended. Reviewed-by: Miaohe Lin Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-12-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8a8b097c6cd0041da6ba3a0701f911bfee05c652 Author: Sean Christopherson Date: Fri Mar 20 14:28:06 2020 -0700 KVM: VMX: Move vpid_sync_vcpu_addr() down a few lines Move vpid_sync_vcpu_addr() below vpid_sync_context() so that it can be refactored in a future patch to call vpid_sync_context() directly when the "individual address" INVVPID variant isn't supported. No functional change intended. Reviewed-by: Miaohe Lin Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-11-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 446ace4bca423297d62342801799ba4952d6b910 Author: Sean Christopherson Date: Fri Mar 20 14:28:05 2020 -0700 KVM: VMX: Use vpid_sync_context() directly when possible Use vpid_sync_context() directly for flows that run if and only if enable_vpid=1, or more specifically, nested VMX flows that are gated by vmx->nested.msrs.secondary_ctls_high.SECONDARY_EXEC_ENABLE_VPID being set, which is allowed if and only if enable_vpid=1. Because these flows call __vmx_flush_tlb() with @invalidate_gpa=false, the if-statement that decides between INVEPT and INVVPID will always go down the INVVPID path, i.e. call vpid_sync_context() because "enable_ept && (invalidate_gpa || !enable_vpid)" always evaluates false. This helps pave the way toward removing @invalidate_gpa and @vpid from __vmx_flush_tlb() and its callers. Opportunstically drop unnecessary brackets in handle_invvpid() around an affected __vmx_flush_tlb()->vpid_sync_context() conversion. No functional change intended. Reviewed-by: Miaohe Lin Reviewed-by: Vitaly Kuznetsov Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-10-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit c746b3a4b84cc6eb2f8a45e89210f57d252d98fd Author: Sean Christopherson Date: Fri Mar 20 14:28:04 2020 -0700 KVM: VMX: Skip global INVVPID fallback if vpid==0 in vpid_sync_context() Skip the global INVVPID in the unlikely scenario that vpid==0 and the SINGLE_CONTEXT variant of INVVPID is unsupported. If vpid==0, there's no need to INVVPID as it's impossible to do VM-Enter with VPID enabled and vmcs.VPID==0, i.e. there can't be any TLB entries for the vCPU with vpid==0. The fact that the SINGLE_CONTEXT variant isn't supported is irrelevant. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-9-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit ee1fa209f5e5ca5c1e76c7aa1c2aab292f371f4a Author: Junaid Shahid Date: Fri Mar 20 14:28:03 2020 -0700 KVM: x86: Sync SPTEs when injecting page/EPT fault into L1 When injecting a page fault or EPT violation/misconfiguration, KVM is not syncing any shadow PTEs associated with the faulting address, including those in previous MMUs that are associated with L1's current EPTP (in a nested EPT scenario), nor is it flushing any hardware TLB entries. All this is done by kvm_mmu_invalidate_gva. Page faults that are either !PRESENT or RSVD are exempt from the flushing, as the CPU is not allowed to cache such translations. Signed-off-by: Junaid Shahid Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-8-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 0cd665bd20f9088d363158b4ac75592af18ecf4f Author: Paolo Bonzini Date: Wed Mar 25 12:50:03 2020 -0400 KVM: x86: cleanup kvm_inject_emulated_page_fault To reconstruct the kvm_mmu to be used for page fault injection, we can simply use fault->nested_page_fault. This matches how fault->nested_page_fault is assigned in the first place by FNAME(walk_addr_generic). Signed-off-by: Paolo Bonzini commit 5efac0741ce238e0844d3f7af00198f81e84926a Author: Paolo Bonzini Date: Mon Mar 23 20:42:57 2020 -0400 KVM: x86: introduce kvm_mmu_invalidate_gva Wrap the combination of mmu->invlpg and kvm_x86_ops->tlb_flush_gva into a new function. This function also lets us specify the host PGD to invalidate and also the MMU, both of which will be useful in fixing and simplifying kvm_inject_emulated_page_fault. A nested guest's MMU however has g_context->invlpg == NULL. Instead of setting it to nonpaging_invlpg, make kvm_mmu_invalidate_gva the only entry point to mmu->invlpg and make a NULL invlpg pointer equivalent to nonpaging_invlpg, saving a retpoline. Signed-off-by: Paolo Bonzini commit 6533380dfd003ea7636cb5672f4f85124b56328b Author: Hu Haowen Date: Wed Apr 1 20:57:20 2020 +0800 net/mlx5: improve some comments Replaced "its" with "it's". Signed-off-by: Hu Haowen Signed-off-by: Saeed Mahameed commit c89da067a2e4d0f94f0f314c2918dca50348789c Author: Parav Pandit Date: Sun Mar 8 21:41:22 2020 -0500 net/mlx5: Read embedded cpu bit only once Embedded CPU bit doesn't change with PCI resume/suspend. Hence read it only once while probing the PCI device. Signed-off-by: Parav Pandit Reviewed-by: Bodong Wang Signed-off-by: Saeed Mahameed commit fa3748775b92692331cfcab6f7b09a04a23694d9 Author: Maxim Mikityanskiy Date: Thu Mar 19 17:32:27 2020 +0200 net/mlx5e: Handle errors from netif_set_real_num_{tx,rx}_queues netif_set_real_num_tx_queues and netif_set_real_num_rx_queues may fail. Now that mlx5e supports handling errors in the preactivate hook, this commit leverages that functionality to handle errors from those functions and roll back all changes on failure. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d7a42ad062cc6b20b2c2a8c09dc61df2d4f5751f Author: Roi Dayan Date: Wed Mar 25 11:32:56 2020 +0200 net/mlx5e: Allow partial data mask for tunnel options We use mapping to save and restore the tunnel options. Save also the tunnel options mask. Signed-off-by: Roi Dayan Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit 82fe2996419830b0bb2c7e1f2fed2d3a8a1a65cd Author: Tariq Toukan Date: Tue Feb 18 12:27:25 2020 +0200 net/mlx5e: Set of completion request bit should not clear other adjacent bits In notify HW (ring doorbell) flow, we set the bit to request a completion on the TX descriptor. When doing so, we should not unset other bits in the same byte. Currently, this does not fix a real issue, as we still don't have a flow where both MLX5_WQE_CTRL_CQ_UPDATE and any adjacent bit are set together. Fixes: 542578c67936 ("net/mlx5e: Move helper functions to a new txrx datapath header") Fixes: 864b2d715300 ("net/mlx5e: Generalize tx helper functions for different SQ types") Signed-off-by: Tariq Toukan Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 7dfee4b1d79e1800818abcfb47747b162c9a2d31 Author: Raed Salem Date: Wed Oct 23 17:04:13 2019 +0300 net/mlx5: IPsec, Refactor SA handle creation and destruction Currently the SA handle is created and managed as part of the common code for different IPsec supporting HW, this handle is passed to HW to be used on Rx to identify the SA handle that was used to return the xfrm state to stack. The above implementation pose a limitation on managing this handle. Refactor by moving management of this field to the specific HW code. Downstream patches will introduce the Connect-X support for IPsec that will use this handle differently than current implementation. Signed-off-by: Raed Salem Reviewed-by: Boris Pismenny Reviewed-by: Huy Nguyen Signed-off-by: Saeed Mahameed commit 0aab3e1b04aeeb5682c1ae7c862f107334ab79c0 Author: Raed Salem Date: Wed Jan 8 11:48:37 2020 +0200 net/mlx5e: IPSec, Expose IPsec HW stat only for supporting HW The current HW counters are supported only by Innova, split the ipsec stats group into two groups, one for HW and one for SW. And expose the HW counters to ethtool only if Innova HW is used for IPsec offload. Signed-off-by: Raed Salem Reviewed-by: Huy Nguyen Signed-off-by: Saeed Mahameed commit 1dbd51d0a71a561056579e2d4f406e5ce5343af0 Author: Raed Salem Date: Tue Dec 10 13:20:55 2019 +0200 net/mlx5: Refactor mlx5_accel_esp_create_hw_context parameter list Currently the FPGA IPsec is the only hw implementation of the IPsec acceleration api, and so the mlx5_accel_esp_create_hw_context was wrongly made to suit this HW api, among other in its parameter list and some of its parameter endianness. This implementation might not be suitable for different HW. Refactor by group and pass all function arguments of mlx5_accel_esp_create_hw_context in common mlx5_accel_esp_xfrm_attrs struct field of mlx5_accel_esp_xfrm struct and correct the endianness according to the HW being called. Signed-off-by: Raed Salem Reviewed-by: Boris Pismenny Reviewed-by: Huy Nguyen Signed-off-by: Saeed Mahameed commit 9425c595bd513948537ef355c07a65595dd2c771 Author: Raed Salem Date: Mon Jan 20 15:03:00 2020 +0200 net/mlx5e: en_accel, Add missing net/geneve.h include The cited commit relies on include being included implicitly prior to include "en_accel/en_accel.h". This mandates that all files that needs to include en_accel.h to redantantly include net/geneve.h. Include net/geneve.h explicitly at "en_accel/en_accel.h" to avoid undesired constrain as above. Fixes: e3cfc7e6b7bd ("net/mlx5e: TX, Add geneve tunnel stateless offload support") Signed-off-by: Raed Salem Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 8c8eea07c1fd46455b3a275a03c27326ddc42b20 Author: Raed Salem Date: Wed Oct 23 16:03:12 2019 +0300 net/mlx5: Use the correct IPsec capability function for FPGA ops Currently the IPsec acceleration capability function is also used at IPsec fpga capable device code. This could cause a future bug as the acceleration layer is agnostic to the device implementing its API. Fix by using the IPsec FPGA capability function instead of acceleration layer capability function in case of FPGA IPsec only related operations. Downstream patches will add support for Connect-X IPsec, this can avoid a future bug. Signed-off-by: Raed Salem Reviewed-by: Boris Pismenny Reviewed-by: Huy Nguyen Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 2f9c502552cd3e791db91ee80f7766e122b3b026 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:56:13 2020 +0200 scripts: sphinx-pre-install: add support for python -m venv Since python 3.3, the recommended way to setup a virtual env is via "python -m venv". Set this as a default, if python version is compatible with such feature. While here, add more comments to it, as the script is getting more complex. So, better to add more things, to avoid accidentally breaking it while improving it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/252cc849c79527ad496247e4c481961478adf41c.1586883286.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit d6ebf1890c8ba6c9340681cb24bdbdb0ea7c71b4 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:56:12 2020 +0200 scripts: sphinx-pre-install: add support for OpenMandriva It seems that Mageia and OpenMandriva will reunite on a single distribution. In any case, both came from Mandriva. So, it is close enough to use the same logic. So, add support for it. Tested with OpenMandriva 4.1 and with Mageia 7.1. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/692809729c6818a0b0f75513da15970c53d5565c.1586883286.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e45a631742fadd7c9feb5a0049382102e5d43fe7 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:56:11 2020 +0200 scripts: sphinx-pre-install: address some issues with Gentoo There are some small misdetections with Gentoo. While they don't cause too much trouble, it keeps recomending to install things that are already there. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/7f631edce102b02ccbdbfb18be1376a86b41373d.1586883286.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit bfc7f4281066154e6b420a87335d6387c9b0835a Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:56:10 2020 +0200 scripts: sphinx-pre-install: fix a dependency hint with Ubuntu 16.04 Avoid the scripts to keep asking to install fonts-noto-cjk on Ubuntu 16.04. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/912b664a8ca54e8c5c5767c3fe9171973eeddd6b.1586883286.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit b3df6223bdea763ed666b06a4e7431f40b33da67 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:56:09 2020 +0200 scripts: sphinx-pre-install: improve openSuse Tumbleweed check Currently, with openSUSE Tumbleweed 20200303, it keeps recommending this forever: sudo zypper install --no-recommends rsvg-view This dependency will never be fulfilled there, as the package now is named as on other distros: rsvg-convert. So, improve the detection to avoid such issue. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c3774f72ac36c5e5b5f446ae5db5b795d1f274f4.1586883286.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit d14d0c1aea8fe0eb61b7788a3b546475e183b079 Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:56:08 2020 +0200 scripts: sphinx-pre-install: improve distro detection check The Arch-linux detection is hit by catting /etc/issue, whose contents is (nowadays): Arch Linux \r (\l) It sounds a little ackward to print such string, so, instead, let's use the /etc/os-release file, with exists on lots of distributions and should provide a more reliable result. We'll keep the old tests before it, in order to avoid possible regressions with the other distros, although the new way should probably work on all the currently supported distributions. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/472924557afdf2b5492ae2a48c5ecfae216d54e2.1586883286.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit e6940c03dd628a223f6cce6581686bdb2e09936b Author: Mauro Carvalho Chehab Date: Mon Apr 20 18:48:44 2020 +0200 media: usbvision: depends on USB When built with: CONFIG_USB=m CONFIG_VIDEO_USBVISION=y It causes ld errors: ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_write_reg_irq': usbvision-core.c:(.text+0x8a4): undefined reference to `usb_submit_urb' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_isoc_irq': usbvision-core.c:(.text+0x2ee8): undefined reference to `usb_submit_urb' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_read_reg': usbvision-core.c:(.text+0x30ad): undefined reference to `usb_control_msg' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_write_reg': usbvision-core.c:(.text+0x3178): undefined reference to `usb_control_msg' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_set_output': usbvision-core.c:(.text+0x344e): undefined reference to `usb_control_msg' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_set_input': usbvision-core.c:(.text+0x3b9b): undefined reference to `usb_control_msg' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_setup': usbvision-core.c:(.text+0x4009): undefined reference to `usb_control_msg' ld: drivers/staging/media/usbvision/usbvision-core.o:usbvision-core.c:(.text+0x417f): more undefined references to `usb_control_msg' follow ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_set_alternate': usbvision-core.c:(.text+0x4518): undefined reference to `usb_set_interface' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_init_isoc': usbvision-core.c:(.text+0x4673): undefined reference to `usb_alloc_urb' ld: usbvision-core.c:(.text+0x46a5): undefined reference to `usb_alloc_coherent' ld: usbvision-core.c:(.text+0x4765): undefined reference to `usb_submit_urb' ld: drivers/staging/media/usbvision/usbvision-core.o: in function `usbvision_stop_isoc': usbvision-core.c:(.text+0x4837): undefined reference to `usb_kill_urb' ld: usbvision-core.c:(.text+0x485f): undefined reference to `usb_free_coherent' ld: usbvision-core.c:(.text+0x4874): undefined reference to `usb_free_urb' ld: usbvision-core.c:(.text+0x48f1): undefined reference to `usb_set_interface' ld: drivers/staging/media/usbvision/usbvision-video.o: in function `usbvision_release': usbvision-video.c:(.text+0x1a8a): undefined reference to `usb_free_urb' ld: drivers/staging/media/usbvision/usbvision-video.o: in function `usbvision_disconnect': usbvision-video.c:(.text+0x1b74): undefined reference to `usb_put_dev' ld: drivers/staging/media/usbvision/usbvision-video.o: in function `usbvision_radio_close': usbvision-video.c:(.text+0x1c89): undefined reference to `usb_set_interface' ld: drivers/staging/media/usbvision/usbvision-video.o: in function `usbvision_probe': usbvision-video.c:(.text+0x1e4b): undefined reference to `usb_get_dev' ld: usbvision-video.c:(.text+0x20e1): undefined reference to `usb_alloc_urb' ld: usbvision-video.c:(.text+0x2797): undefined reference to `usb_put_dev' ld: drivers/staging/media/usbvision/usbvision-video.o: in function `usbvision_exit': usbvision-video.c:(.exit.text+0x37): undefined reference to `usb_deregister' ld: drivers/staging/media/usbvision/usbvision-video.o: in function `usbvision_init': usbvision-video.c:(.init.text+0xf9): undefined reference to `usb_register_driver' ld: drivers/staging/media/usbvision/usbvision-i2c.o: in function `usbvision_i2c_write': usbvision-i2c.c:(.text+0x2f4): undefined reference to `usb_control_msg' Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Acked-by: Greg Kroah-Hartman Signed-off-by: Mauro Carvalho Chehab commit e10daad5bb6e51395c505feafd869037090f9ca8 Author: Mauro Carvalho Chehab Date: Mon Apr 20 18:44:03 2020 +0200 media: staging: rkisp1 Kconfig: depends on OF building it with a random config causes a warning: WARNING: unmet direct dependencies detected for PHY_ROCKCHIP_DPHY_RX0 Depends on [n]: STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=y] && (ARCH_ROCKCHIP || COMPILE_TEST [=y]) && OF [=n] Selected by [y]: - VIDEO_ROCKCHIP_ISP1 [=y] && STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=y] && VIDEO_V4L2 [=y] && (ARCH_ROCKCHIP || COMPILE_TEST [=y]) Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Signed-off-by: Mauro Carvalho Chehab commit 82ebc889091a488b4dd95e682b3c3b889a50713c Author: Jason Yan Date: Mon Apr 20 12:27:20 2020 +0800 qed: use true,false for bool variables Fix the following coccicheck warning: drivers/net/ethernet/qlogic/qed/qed_dev.c:4395:2-34: WARNING: Assignment of 0/1 to bool variable drivers/net/ethernet/qlogic/qed/qed_dev.c:1975:2-34: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan Acked-by: Michal Kalderon  Signed-off-by: David S. Miller commit 820f63652bb45f2a2de4f4ddf82577991fdb3d11 Author: Jason Yan Date: Mon Apr 20 20:35:16 2020 +0800 firmware: qcom_scm: Remove unneeded conversion to bool The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/firmware/qcom_scm.c:946:25-30: WARNING: conversion to bool not needed here Reviewed-by: Bjorn Andersson Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200420123516.7888-1-yanaijie@huawei.com Signed-off-by: Bjorn Andersson commit 0fa1484e9c5d516e567cbbc1fb118ffd0a74ca9b Merge: b785b06ccaae d8355240cf8f Author: David S. Miller Date: Mon Apr 20 12:49:18 2020 -0700 Merge branch 'hns3-next' Huazhong Tan says: ==================== net: hns3: misc updates for -next This patchset includes some misc updates for the HNS3 ethernet driver. [patch 1&2] separates two bloated function. [patch 3-5] removes some redundant code. [patch 6-7] cleans up some coding style issues. [patch 8-10] adds some debugging information. Change log: V1->V2: removes an unnecessary initialization in [patch 1] which suggested by David Miller. modified some print format issue and commit log in [patch 8]. ==================== Signed-off-by: David S. Miller commit d8355240cf8fb8b9e002b5c8458578435cea85c2 Author: Yufeng Mo Date: Mon Apr 20 10:17:35 2020 +0800 net: hns3: add trace event support for PF/VF mailbox This patch adds trace event support for PF/VF mailbox. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 5cb51cfe8ad65117d4404b82fb8531768b149ad9 Author: Yufeng Mo Date: Mon Apr 20 10:17:34 2020 +0800 net: hns3: add support for dumping MAC reg in debugfs This patch adds support for dumping MAC reg in debugfs, which will be helpful for debugging. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit a3ca5e9048be07576259d2ba9628dc8187f7690e Author: Guojia Liao Date: Mon Apr 20 10:17:33 2020 +0800 net: hns3: add debug information for flow table when failed Adds some debug information for failures of processing flow table, removes the redundant printing when hclge_fd_check_spec() returns error, and modifies the printing level for FD not enable error. Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 0b4bdc55df6163f2861fe935755e892963dc9512 Author: Huazhong Tan Date: Mon Apr 20 10:17:32 2020 +0800 net: hns3: clean up some coding style issue This patch removes some unnecessary blank lines, redundant parentheses, and changes one tab to blank in hclge_dbg_dump_reg_common(). Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 84944d5c4797df7aa0b2677283db5064a2560633 Author: Guojia Liao Date: Mon Apr 20 10:17:31 2020 +0800 net: hns3: modify some unsuitable type declaration In hclge_set_fd_key_config(), parameter 'stage' should be as enum HCLGE_FD_STAGE, and in hclge_config_key(), 'tuple_size' should be type u8, also simplify unsigned int with u32 for 'i'. Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit f84f6a8634f3424244e91fc3fd460152dae689cf Author: Guojia Liao Date: Mon Apr 20 10:17:30 2020 +0800 net: hns3: remove two unused structures in hclge_cmd.h struct hclge_mac_vlan_remove_cmd and hclge_mac_vlan_add_cmd are unused. So removes them from hclge_cmd.h. Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 16505f878e3065f2c0457e38ec867cdd6d3ce243 Author: Guojia Liao Date: Mon Apr 20 10:17:29 2020 +0800 net: hns3: remove useless proto_support field in struct hclge_fd_cfg proto_support field in struct hclge_fd_cfg shows what protocols in flow direct table are supported now. It is unnecessary since checking which one is unsupported will be more efficient, so this patch removes it. Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit e9368c4094f54c1af44a842814c1d87d4365c684 Author: Huazhong Tan Date: Mon Apr 20 10:17:28 2020 +0800 net: hns3: remove an unnecessary case 0 in hclge_fd_convert_tuple() Since case default has included case 0, so removes this redundant case 0. Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit fa663c096052ec8c5dfef29fc1cd30190e5aba93 Author: Jian Shen Date: Mon Apr 20 10:17:27 2020 +0800 net: hns3: split out hclge_get_fd_rule_info() hclge_get_fd_rule_info() is bloated, this patch separates it into several standalone functions for readability and maintainability. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 736fc0e17fade807e59cd9001af88ec4bcca62ef Author: Jian Shen Date: Mon Apr 20 10:17:26 2020 +0800 net: hns3: split out hclge_fd_check_ether_tuple() For readability and maintainability, this patch separates the handling part of each flow type in hclge_fd_check_ether_tuple() into standalone functions. Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 61d2ca503d0b55d2849fd656ce51d8e1e9ba0b6c Author: Jonathan Marek Date: Mon Apr 20 11:35:43 2020 -0400 arm64: dts: qcom: fix pm8150 gpio interrupts This was mistakenly copied from the downstream dts, however the upstream driver works differently. I only tested this with the pm8150_gpios node (used with volume button), but the 2 others should be the same. Fixes: e92b61c8e775 ("arm64: dts: qcom: pm8150l: Add base dts file") Fixes: 229d5bcad0d0 ("arm64: dts: qcom: pm8150b: Add base dts file") Fixes: 5101f22a5c37 ("arm64: dts: qcom: pm8150: Add base dts file") Reviewed-by: Bjorn Andersson Signed-off-by: Jonathan Marek Link: https://lore.kernel.org/r/20200420153543.14512-1-jonathan@marek.ca Signed-off-by: Bjorn Andersson commit b785b06ccaae3ab669877ca4175213587485a31e Merge: 749d22e8f6d5 77e9b2ab451d Author: David S. Miller Date: Mon Apr 20 12:43:24 2020 -0700 Merge branch 'RFC-2863-Testing-Oper-status' Andrew Lunn says: ==================== RFC 2863 Testing Oper status This patchset add support for RFC 2863 Oper status testing. An interface is placed into this state when a self test is performed using ethtool. v2: Fix date/kernel version in Documentation Add reviewed-by tags ==================== Signed-off-by: David S. Miller commit 77e9b2ab451d32c81468ef679c377b2f831cd720 Author: Andrew Lunn Date: Mon Apr 20 00:11:52 2020 +0200 net: ethtool: self_test: Mark interface in testing operative status When an interface is executing a self test, put the interface into operative status testing. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit db30a57779b18b7cef092c21887ed2d23ad2bd35 Author: Andrew Lunn Date: Mon Apr 20 00:11:51 2020 +0200 net: Add testing sysfs attribute Similar to speed, duplex and dorment, report the testing status in sysfs. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit eec517cdb4810b3843eb7707971de3164088bff1 Author: Andrew Lunn Date: Mon Apr 20 00:11:50 2020 +0200 net: Add IF_OPER_TESTING RFC 2863 defines the operational state testing. Add support for this state, both as a IF_LINK_MODE_ and __LINK_STATE_. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 749d22e8f6d5645ed066ec434c0ce5327987c699 Merge: 9d3679fe0f30 3c01eb62d1bd Author: David S. Miller Date: Mon Apr 20 12:37:08 2020 -0700 Merge branch 'FEC-MDIO-speedups' Andrew Lunn says: ==================== FEC MDIO speedups This patchset gives a number of speedups for MDIO with the FEC. Replacing interrupt driven with polled IO brings a big speedup due to the overheads of interrupts compared to the short time interval. Clocking the bus faster, when the MDIO targets supports it, can double the transfer rate. And suppressing the preamble, if devices support it, makes each transaction faster. By default the MDIO clock remains 2.5MHz and preables are used. But these can now be controlled from the device tree. Since these are generic properties applicable to more than just FEC, these have been added to the generic MDIO binding documentation. v2: readl_poll_timeout() Add patches to set bus frequency and preamble disable v3: Add Reviewed tags uS->us readl_poll_timeout_atomic() Extend DT binding documentation ==================== Acked-by: Fugang Duan Signed-off-by: David S. Miller commit 3c01eb62d1bd85a5dd1d22d74339728666ae2c45 Author: Andrew Lunn Date: Mon Apr 20 00:04:02 2020 +0200 net: ethernet: fec: Allow the MDIO preamble to be disabled An MDIO transaction normally starts with 32 1s as a preamble. However not all devices requires such a preamble. Add a device tree property which allows the preamble to be suppressed. This will half the size of the MDIO transaction, allowing faster transactions. But it should only be used when all devices on the bus support suppressed preamble. Suggested-by: Chris Healy Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 3e782985cb3ce00a32c372b37d8feefdae18ddf1 Author: Andrew Lunn Date: Mon Apr 20 00:04:01 2020 +0200 net: ethernet: fec: Allow configuration of MDIO bus speed MDIO busses typically operate at 2.5MHz. However many devices can operate at faster speeds. This then allows more MDIO transactions per second, useful for Ethernet switch statistics, or Ethernet PHY TDR data. Allow the bus speed to be configured, using the standard "clock-frequency" property, which i2c busses use to indicate the bus speed. Before using this property, ensure all devices on the bus do actually support the requested clock speed. Suggested-by: Chris Healy Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 29ae6bd1b0d8a57d7c00ab12cbb949fc41986eef Author: Andrew Lunn Date: Mon Apr 20 00:04:00 2020 +0200 net: ethernet: fec: Replace interrupt driven MDIO with polled IO Measurements of the MDIO bus have shown that driving the MDIO bus using interrupts is slow. Back to back MDIO transactions take about 90us, with 25us spent performing the transaction, and the remainder of the time the bus is idle. Replacing the completion interrupt with polled IO results in back to back transactions of 40us. The polling loop waiting for the hardware to complete the transaction takes around 28us. Which suggests interrupt handling has an overhead of 50us, and polled IO nearly halves this overhead, and doubles the MDIO performance. Suggested-by: Chris Heally Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 9d3679fe0f30b5a4c1ae6303611c9f2bbeb9961d Author: Heiner Kallweit Date: Sun Apr 19 23:16:55 2020 +0200 r8169: inline rtl8169_make_unusable_by_asic Inline rtl8169_make_unusable_by_asic() and simplify it: - Address field doesn't need to be poisoned because descriptor is owned by CPU now - desc->opts1 is set by rtl8169_mark_to_asic() and rtl8169_rx_fill(), therefore we don't have to preserve any field parts. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 2ac1fa439ee97aaaa124c37340a316918bb0a8bc Author: Heiner Kallweit Date: Sun Apr 19 23:07:39 2020 +0200 r8169: inline rtl8169_mark_as_last_descriptor rtl8169_mark_as_last_descriptor() has just one user, so inline it. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit a5006777e99c71a4ccb6c466ee3748ebd749c8cf Merge: 745e5ad5084d 949b922e8b1b Author: David S. Miller Date: Mon Apr 20 12:25:31 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-04-19 This series contains updates to e1000e and igc only. Sasha adds new device IDs supported by the igc driver. Vitaly fixes the S0ix entry and exit flows in e1000e for TGP and newer MAC types when a cable is connected. Andre has the remaining changes in the series, starting with cleanup of the igc driver of duplicate code. Added a check for IGC_MAC_STATE_SRC_ADDR flag which is unsupported for MAC filters in igc. Cleaned up the return values for igc_add_mac_filter(), where the return value was not being used, so update the function to only return success or failure. Fix the return value of igc_uc_unsync() as well. Refactor the igc driver in several functions to help reduce the convoluted logic and simplify the driver filtering mechanisms. Improve the MAC address checks when adding a MAC filter. Lastly, improve the log messages related to MAC address filtering to ease debugging. ==================== Signed-off-by: David S. Miller commit 745e5ad5084db32e093a143de324afa4ed95f14d Author: Aishwarya Ramakrishnan Date: Sun Apr 19 21:59:17 2020 +0530 net: qed: Remove unneeded cast from memory allocation Remove casting the values returned by memory allocation function. Coccinelle emits WARNING: casting value returned by memory allocation function to struct pointer is useless. This issue was detected by using the Coccinelle. Signed-off-by: Aishwarya Ramakrishnan Acked-by: Michal Kalderon  Signed-off-by: David S. Miller commit 5333fdbed0c860c7a17dc12f328203d29947eff7 Author: Aishwarya Ramakrishnan Date: Sun Apr 19 21:14:43 2020 +0530 net: sun: Remove unneeded cast from memory allocation Remove casting the values returned by memory allocation function. Coccinelle emits WARNING: casting value returned by memory allocation function to (struct cas_init_block *) is useless. This issue was detected by using the Coccinelle software. Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: David S. Miller commit 92efe48e8fe2b6848ca56e14436c2b7d20c986d4 Author: Dejin Zheng Date: Sun Apr 19 20:02:53 2020 +0800 net: ethernet: dnet: convert to devm_platform_get_and_ioremap_resource use devm_platform_get_and_ioremap_resource() to simplify code, which contains platform_get_resource() and devm_ioremap_resource(), it also get the resource for use by the following code. Signed-off-by: Dejin Zheng Signed-off-by: David S. Miller commit e07c7606a00c4361bad72ff4e72ed0dfbefa23b0 Author: Xiyu Yang Date: Mon Apr 20 13:41:54 2020 +0800 drm/i915/selftests: Fix i915_address_space refcnt leak igt_ppgtt_pin_update() invokes i915_gem_context_get_vm_rcu(), which returns a reference of the i915_address_space object to "vm" with increased refcount. When igt_ppgtt_pin_update() returns, "vm" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in two exception handling paths of igt_ppgtt_pin_update(). When i915_gem_object_create_internal() returns IS_ERR, the refcnt increased by i915_gem_context_get_vm_rcu() is not decreased, causing a refcnt leak. Fix this issue by jumping to "out_vm" label when i915_gem_object_create_internal() returns IS_ERR. Fixes: a4e7ccdac38e ("drm/i915: Move context management under GEM") Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/1587361342-83494-1-git-send-email-xiyuyang19@fudan.edu.cn commit e42a969e725c2ff93a0a66ca5d2c27d59310056e Author: Chris Wilson Date: Mon Apr 20 18:27:39 2020 +0100 drm/i915/selftests: Exercise dynamic reclocking with RPS After having testing all the RPS controls individually, we need to take a step back and check how our RPS worker integrates them to perform dynamic GPU reclocking. So do that by submitting a spinner and wait and see what happens. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420172739.11620-6-chris@chris-wilson.co.uk commit 6b36fc9442bbbb8d44a4d06315f189f88381809b Author: Chris Wilson Date: Mon Apr 20 18:27:38 2020 +0100 drm/i915/selftests: Show the pcode frequency table on error If we encounter an error while scaling, read back the frequency tables from the pcu. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420172739.11620-5-chris@chris-wilson.co.uk commit 0eaccc4b180c0ded33e0b71491aac09fcb323dac Author: Chris Wilson Date: Mon Apr 20 18:27:37 2020 +0100 drm/i915/selftests: Split RPS frequency measurement Split the frequency measurement into two modes, so that we can judge the impact of the llc setup on top of the pure CS frequency scaling. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420172739.11620-4-chris@chris-wilson.co.uk commit b66c9b8de22b666718c2fcb0ae84ce620f9b81c0 Author: Lourdes Pedrajas Date: Sun Apr 19 11:16:51 2020 +0200 selftests: pmtu: implement IPIP, SIT and ip6tnl PMTU discovery tests Add PMTU discovery tests for these encapsulations: - IPIP - SIT, mode ip6ip - ip6tnl, modes ip6ip6 and ipip6 Signed-off-by: Lourdes Pedrajas Reviewed-by: Stefano Brivio Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 9938ee2e631c329ff335884c51ff78ebe5224722 Author: Chris Wilson Date: Mon Apr 20 18:27:36 2020 +0100 drm/i915/selftests: Check RPS controls Check that the GPU does respond to our RPS frequency requests by setting our desired frequency. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420172739.11620-3-chris@chris-wilson.co.uk commit a740f5c5f6bc781340c1fd346123b6b7d8be54de Author: Chris Wilson Date: Mon Apr 20 18:27:35 2020 +0100 drm/i915/selftests: Skip energy consumption tests if not controlling freq If we can not manipulate the frequency with RPS, then comparing min/max power consumption is pointless / misleading. We will leave the warning about not being able to control the frequency selection via RPS to other tests so as not to confuse this more specialised check. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420172739.11620-2-chris@chris-wilson.co.uk commit 4ba74e53ada3c7cca9808d0c1332d34133f06575 Author: Chris Wilson Date: Mon Apr 20 18:27:34 2020 +0100 drm/i915/selftests: Verify frequency scaling with RPS One of the core tenents of reclocking the GPU is that its throughput scales with the clock frequency. We can observe this by incrementing a loop counter on the GPU, and compare the different execution rates at the notional RPS frequencies. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200420172739.11620-1-chris@chris-wilson.co.uk commit cceadc831e728fde74c21813519962c648f5ca7c Author: Michael Walle Date: Sun Apr 19 10:27:57 2020 +0200 net: phy: mscc: use mdiobus_get_phy() Don't use internal knowledge of the mdio bus core, instead use mdiobus_get_phy() which does the same thing. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6bedc6948bcfd43b22b29d3f0621300e8a3219e6 Merge: c290d1ab12d3 b7f03b0b2a21 Author: David S. Miller Date: Mon Apr 20 11:57:33 2020 -0700 Merge branch 'mlxsw-Two-small-changes' Ido Schimmel says: ==================== mlxsw: Two small changes Patch #1 increases the scale of supported IPv6 nexthops groups when each group has one nexthop and all are using the same nexthop device, but with a different gateway IP. Patch #2 adjusts a register definition in accordance with recent firmware changes. ==================== Signed-off-by: David S. Miller commit b7f03b0b2a213474f452a802769ecd9fcee209a9 Author: Ido Schimmel Date: Sun Apr 19 10:01:06 2020 +0300 mlxsw: reg: Increase register field length to 13 bits The Infrastructure Entry Delete Register (IEDR) is used to delete entries stored in the KVD linear database. Currently, it is only possible to delete entries of size up to 2048. Future firmware versions will support deletion of entries of size up to 4096. Increase the size of the field so that the driver will be able to perform such deletions in the future, when required. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit cec2500d44751a7782d16ce99fca104e77e324a5 Author: Ido Schimmel Date: Sun Apr 19 10:01:05 2020 +0300 mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups As explained in commit fc25996e6f46 ("mlxsw: spectrum_router: Increase scale of IPv6 nexthop groups"), each nexthop group is hashed by XOR-ing the interface indexes of all the member nexthop devices. To avoid many different nexthop groups ending up using the same key, the above commit started hashing the interface indexes themselves before they are XOR-ed. However, in cases in which there are many nexthop groups that all use the same nexthop device and only differ in the gateway IP, we can still end up in a situation in which all the groups are using the same key. This eventually leads to -EBUSY error from rhashtable during insertion. Improve the situation by also making the gateway IP part of the key. Signed-off-by: Ido Schimmel Reported-by: Alex Veber Reviewed-by: Jiri Pirko Tested-by: Alex Veber Signed-off-by: David S. Miller commit c290d1ab12d3385da1d7be909e6b09caea3325bb Author: Florian Fainelli Date: Sat Apr 18 20:17:13 2020 -0700 net: phy: Propagate error from bus->reset If a bus->reset() call for the mii_bus structure returns an error (e.g.: -EPROE_DEFER) we should propagate it accordingly. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit f0617ff0b89416d5e15e14c22489ae3013d343fa Author: Ville Syrjälä Date: Fri Apr 17 18:27:34 2020 +0300 drm/i915: Push MST link retraining to the hotplug work We shouldn't try to do link retraining from the short hpd handler. We can't take any modeset locks there so this is racy as hell. Push the whole thing into the hotplug work like we do with SST. We'll just have to adjust the SST retraining code to deal with the MST encoders and multiple pipes. TODO: I have a feeling we should just rip this all out and do a full modeset instead. Stuff like port sync and the tgl+ MST master transcoder stuff maybe doesn't work well if we try to retrain without following the proper modeset sequence. So far haven't done any actual tests to confirm that though. Cc: Lyude Paul Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200417152734.464-2-ville.syrjala@linux.intel.com Reviewed-by: Lyude Paul commit 3c0ec2c2d5948356a22c8f1c08a8087b12a303e7 Author: Ville Syrjälä Date: Fri Apr 17 18:27:33 2020 +0300 drm/i915: Flatten intel_dp_check_mst_status() a bit Make intel_dp_check_mst_status() somewhat legible by humans. Note that the return value of drm_dp_mst_hpd_irq() is always either 0 or -ENOMEM, and we never did anything with the latter so we can just ignore the whole thing. We can also get rid of the direct drm_dp_mst_topology_mgr_set_mst(false) call since returning -EINVAL causes the caller to do the very same call for us. Cc: Lyude Paul Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200417152734.464-1-ville.syrjala@linux.intel.com Reviewed-by: Lyude Paul commit eed22a46b979a3ccefd4820a73af167569ad4711 Author: Ville Syrjälä Date: Fri Apr 17 16:47:20 2020 +0300 drm/i915: Pass encoder all the way to intel_ddi_transcoder_func_reg_val_get() Pass the encoder all the way down to intel_ddi_transcoder_func_reg_val_get(). Allows us eliminate the intel_ddi_get_crtc_encoder() eyesore. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200417134720.16654-4-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson Acked-by: Jani Nikula commit 7c2fedd7608fca45ba91200994fafe81700f582c Author: Ville Syrjälä Date: Fri Apr 17 16:47:19 2020 +0300 drm/i915: Push TRANS_DDI_FUNC_CTL into the encoder->enable() hook Push the TRANS_DDI_FUNC_CTL into the encoder enable hook. The disable is already there, and as a followup will enable us to pass the encoder all the way down. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200417134720.16654-3-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson Acked-by: Jani Nikula commit c38730987b4a3652ed2c350a2679ca228b0ab284 Author: Ville Syrjälä Date: Fri Apr 17 16:47:18 2020 +0300 drm/i915: Move the TRANS_DDI_FUNC_CTL enable to a later point No reason that I can see why we should enable TRANS_DDI_FUNC_CTL before we set up the watermarks of configure the mbus stuff. In fact reordering these seems to match the bspec sequence better, and crucially will allow us to push the TRANS_DDI_FUNC_CTL enable into the encoder enable hook as a followup. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200417134720.16654-2-ville.syrjala@linux.intel.com Acked-by: Chris Wilson Acked-by: Jani Nikula commit 02a715c371d2b411687fbbb1e57020bcbc41f6c4 Author: Ville Syrjälä Date: Fri Apr 17 16:47:17 2020 +0300 drm/i915: Pass encoder to intel_ddi_enable_pipe_clock() Since intel_ddi_enable_pipe_clock() was pushed down into the encoder hooks we can pass on the encoder instead of having to use intel_ddi_get_crtc_encoder(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200417134720.16654-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson Acked-by: Jani Nikula commit ad3df63723a3fab65daaaf2daaa1a196659bb8e3 Merge: 6d9279771600 109f0cf23b09 Author: David S. Miller Date: Mon Apr 20 11:12:29 2020 -0700 Merge branch 'net-phy-realtek-move-PHY-resume-delay-from-MAC-to-PHY-driver' Heiner Kallweit says: ==================== net: phy: realtek: move PHY resume delay from MAC to PHY driver Internal PHY's from RTL8168h up may not be instantly ready after calling genphy_resume(). So far r8169 network driver adds the needed delay, but better handle this in the PHY driver. The network driver may miss other places where the PHY is resumed. ==================== Signed-off-by: David S. Miller commit 109f0cf23b094b0b780a22ce1c9ea267ebcd3974 Author: Heiner Kallweit Date: Sat Apr 18 22:09:42 2020 +0200 r8169: remove PHY resume delay that is handled in the PHY driver now The Realtek PHY driver takes care of adding the needed delay now, therefore we can remove the delay here. Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit fee698d62b3b0621dba8b33454042a4fe82521f3 Author: Heiner Kallweit Date: Sat Apr 18 22:08:51 2020 +0200 net: phy: realtek: add delay to resume path of certain internal PHY's Internal PHY's from RTL8168h up may not be instantly ready after calling genphy_resume(). So far r8169 network driver adds the needed delay, but better handle this in the PHY driver. The network driver may miss other places where the PHY is resumed. Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6d92797716003a462bd75bbda3740718ce54bcdd Author: Jason Yan Date: Sat Apr 18 16:42:12 2020 +0800 net: hns: use true,false for bool variables Fix the following coccicheck warning: drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:700:2-8: WARNING: Assignment of 0/1 to bool variable drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:702:2-8: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: David S. Miller commit d30e1c3db96467f1f444d84023c2c37821202aeb Author: YueHaibing Date: Sat Apr 18 10:01:49 2020 +0800 ptp: idt82p33: Make two variables static Fix sparse warnings: drivers/ptp/ptp_idt82p33.c:26:5: warning: symbol 'sync_tod_timeout' was not declared. Should it be static? drivers/ptp/ptp_idt82p33.c:31:5: warning: symbol 'phase_snap_threshold' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 0673f976285e0570437612329962c339300d013e Author: YueHaibing Date: Sat Apr 18 09:51:54 2020 +0800 ptp_kvm: Make kvm_ptp_lock static Fix sparse warning: drivers/ptp/ptp_kvm.c:25:1: warning: symbol 'kvm_ptp_lock' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 135e30180ff4f654794960aba04785fe7eef2e90 Author: Vladimir Oltean Date: Fri Apr 17 22:50:52 2020 +0300 net: dsa: sja1105: enable internal pull-down for RX_DV/CRS_DV/RX_CTL and RX_ER Some boards do not have the RX_ER MII signal connected. Normally in such situation, those pins would be grounded, but then again, some boards left it electrically floating. When sending traffic to those switch ports, one can see that the N_SOFERR statistics counter is incrementing once per each packet. The user manual states for this counter that it may count the number of frames "that have the MII error input being asserted prior to or up to the SOF delimiter byte". So the switch MAC is sampling an electrically floating signal, and preventing proper traffic reception because of that. As a workaround, enable the internal weak pull-downs on the input pads for the MII control signals. This way, a floating signal would be internally tied to ground. The logic levels of signals which _are_ externally driven should not be bothered by this 40-50 KOhm internal resistor. So it is not an issue to enable the internal pull-down unconditionally, irrespective of PHY interface type (MII, RMII, RGMII, SGMII) and of board layout. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6e0d6ac5f3d9d90271899f6d340872360fe1caee Author: Kees Cook Date: Thu Mar 26 23:48:20 2020 -0700 arm64/elf: Disable automatic READ_IMPLIES_EXEC for 64-bit address spaces With arm64 64-bit environments, there should never be a need for automatic READ_IMPLIES_EXEC, as the architecture has always been execute-bit aware (as in, the default memory protection should be NX unless a region explicitly requests to be executable). Suggested-by: Hector Marco-Gisbert Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Jason Gunthorpe Reviewed-by: Catalin Marinas Link: https://lkml.kernel.org/r/20200327064820.12602-7-keescook@chromium.org commit eaf3f9e61887332d5097dbf0b327b8377546adc5 Author: Kees Cook Date: Thu Mar 26 23:48:19 2020 -0700 arm32/64/elf: Split READ_IMPLIES_EXEC from executable PT_GNU_STACK The READ_IMPLIES_EXEC work-around was designed for old toolchains that lacked the ELF PT_GNU_STACK marking under the assumption that toolchains that couldn't specify executable permission flags for the stack may not know how to do it correctly for any memory region. This logic is sensible for having ancient binaries coexist in a system with possibly NX memory, but was implemented in a way that equated having a PT_GNU_STACK marked executable as being as "broken" as lacking the PT_GNU_STACK marking entirely. Things like unmarked assembly and stack trampolines may cause PT_GNU_STACK to need an executable bit, but they do not imply all mappings must be executable. This confusion has led to situations where modern programs with explicitly marked executable stack are forced into the READ_IMPLIES_EXEC state when no such thing is needed. (And leads to unexpected failures when mmap()ing regions of device driver memory that wish to disallow VM_EXEC[1].) In looking for other reasons for the READ_IMPLIES_EXEC behavior, Jann Horn noted that glibc thread stacks have always been marked RWX (until 2003 when they started tracking the PT_GNU_STACK flag instead[2]). And musl doesn't support executable stacks at all[3]. As such, no breakage for multithreaded applications is expected from this change. This changes arm32 and arm64 compat together, to keep behavior the same. [1] https://lkml.kernel.org/r/20190418055759.GA3155@mellanox.com [2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=54ee14b3882 [3] https://lkml.kernel.org/r/20190423192534.GN23599@brightrain.aerifal.cx Suggested-by: Hector Marco-Gisbert Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Jason Gunthorpe Reviewed-by: Catalin Marinas Link: https://lkml.kernel.org/r/20200327064820.12602-6-keescook@chromium.org commit 78066055b08096ed3282c027de9d9e137f9a1580 Author: Kees Cook Date: Thu Mar 26 23:48:18 2020 -0700 arm32/64/elf: Add tables to document READ_IMPLIES_EXEC Add tables to document the current behavior of READ_IMPLIES_EXEC in preparation for changing the behavior for both arm64 and arm. Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Jason Gunthorpe Reviewed-by: Catalin Marinas Link: https://lkml.kernel.org/r/20200327064820.12602-5-keescook@chromium.org commit f46e1dc982a04c1d2b46694a0c1350e76d4b0817 Author: Jiaxun Yang Date: Mon Apr 20 21:45:29 2020 +0800 MIPS: Loongson64: Mark RS780 HPET as broken This driver is using some dangerous hack to set MMIO address for HPET, which might break systems with other kinds of PCH. Also, as Loongson-3 cpufreq driver never appeared in mainline, this driver rarely got used. So we temporarily mark it as broken until we find a better solution. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit a89aa749ece9c6fee7932163472d2ee0efd6ddd3 Author: Jiaxun Yang Date: Mon Apr 20 21:45:28 2020 +0800 MIPS: DTS: Loongson64: Add ACPI Controller Node Add ACPI Controller Node for RS780E PCH to fit newly added driver. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit dbfd92fe57b125ec72ee6f9c75c40275826579b6 Author: Jiaxun Yang Date: Mon Apr 20 21:45:27 2020 +0800 dt-bindings: Document Loongson RS780E PCH ACPI Controller This controller is attached under ISA Bus and can be found in Loongson-3 systems with RS780E PCH. Signed-off-by: Jiaxun Yang Reviewed-by: Rob Herring Signed-off-by: Thomas Bogendoerfer commit 0cfd2440aa03ea3d4b04cc2565561cecadcb1257 Author: Jiaxun Yang Date: Mon Apr 20 21:45:26 2020 +0800 MIPS: Loongson64: Make RS780E ACPI as a platform driver Make RS780E ACPI as a platform driver so we can enable it by DeviceTree selectively. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit a746f50d69bf1cb13b17c1d0855471dc4c9fbd4f Author: Jiaxun Yang Date: Mon Apr 20 21:45:25 2020 +0800 MIPS: Loongson64: Remove dead RTC code RTC is now enabled by devicetree. So platform code is no longer needed. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 9bc5c397d8384b50c8202f4400bf2f87fe8291d9 Author: Christoph Hellwig Date: Tue Apr 14 09:29:02 2020 +0200 block: fold bdev_unhash_inode into invalidate_partition invalidate_partition and bdev_unhash_inode are always paired, and invalidate_partition already does an icache lookup for the block device inode. Piggy back on that to remove the inode from the hash. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit 02d33b6771fcc63c98cb48cad0cd8b8fb033837a Author: Christoph Hellwig Date: Tue Apr 14 09:29:01 2020 +0200 block: mark invalidate_partition static invalidate_partition is only used in genhd.c, so mark it static. Also drop the return value given that is is always ignored. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit d5f3178ec9ab8a3a71763310d260e1d2a047baf1 Author: Christoph Hellwig Date: Tue Apr 14 09:29:00 2020 +0200 block: simplify block device syncing in bdev_del_partition We just checked a little above that the block device for the partition im busy. That implies no file system is mounted, and thus the only thing in fsync_bdev that actually is used is sync_blockdev. Just call sync_blockdev directly. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit e669c1da03a9dde0e7d43852a5b6ade8312e8701 Author: Christoph Hellwig Date: Tue Apr 14 09:28:59 2020 +0200 block: don't call invalidate_partition from blk_drop_partitions Given that the device must not be busy, most of the calls from invalidate_partition that are related to file system metadata are guranteed to not happen. Just open code the calls to sync_blockdev and invalidate_bdev instead. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 21be6cdc00954b5e5e5842b69ec8e83fb3cb0816 Author: Christoph Hellwig Date: Tue Apr 14 09:28:58 2020 +0200 dasd: use blk_drop_partitions instead of badly reimplementing it Use the blk_drop_partitions function instead of messing around with ioctls that get kernel pointers. For this blk_drop_partitions needs to be exported, which it normally shouldn't - make an exception for s390 only. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit d46430bf5a2298f55e20f59a90ebe3545d273b2f Author: Christoph Hellwig Date: Tue Apr 14 09:28:57 2020 +0200 block: remove the disk argument from blk_drop_partitions The gendisk can be trivially deducted from the block_device. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit 4377b48da6da44360cc76cd3e0562dbb47dd4904 Author: Christoph Hellwig Date: Tue Apr 14 09:28:56 2020 +0200 block: remove hd_struct_kill The function has a single caller, so just open code it. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit 8da2892e27833c5ee78788a66941e0e96eedad22 Author: Christoph Hellwig Date: Tue Apr 14 09:28:55 2020 +0200 block: cleanup hd_struct freeing Move hd_ref_init out of line as there it isn't anywhere near a fast path, and rename the rcu ref freeing callbacks to be more descriptive. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit cddae808aeb77e5c29d22a8e0dfbdaed413f9e04 Author: Christoph Hellwig Date: Tue Apr 14 09:28:54 2020 +0200 block: pass a hd_struct to delete_partition All callers have the hd_struct at hand, so pass it instead of performing another lookup. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe commit fa9156ae597c244df4e12891dc8329f649970d9a Author: Christoph Hellwig Date: Tue Apr 14 09:28:53 2020 +0200 block: refactor blkpg_ioctl Split each sub-command out into a separate helper, and move those helpers to block/partitions/core.c instead of having a lot of partition manipulation logic open coded in block/ioctl.c. Signed-off-by: Christoph Hellwig commit 9fccc5c0c99f238aa1b0460fccbdb30a887e7036 Author: Kees Cook Date: Thu Mar 26 23:48:17 2020 -0700 x86/elf: Disable automatic READ_IMPLIES_EXEC on 64-bit With modern x86 64-bit environments, there should never be a need for automatic READ_IMPLIES_EXEC, as the architecture is intended to always be execute-bit aware (as in, the default memory protection should be NX unless a region explicitly requests to be executable). There were very old x86_64 systems that lacked the NX bit, but for those, the NX bit is, obviously, unenforceable, so these changes should have no impact on them. Suggested-by: Hector Marco-Gisbert Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Jason Gunthorpe Link: https://lkml.kernel.org/r/20200327064820.12602-4-keescook@chromium.org commit 122306117afe4ba202b5e57c61dfbeffc5c41387 Author: Kees Cook Date: Thu Mar 26 23:48:16 2020 -0700 x86/elf: Split READ_IMPLIES_EXEC from executable PT_GNU_STACK The READ_IMPLIES_EXEC workaround was designed for old toolchains that lacked the ELF PT_GNU_STACK marking under the assumption that toolchains that couldn't specify executable permission flags for the stack may not know how to do it correctly for any memory region. This logic is sensible for having ancient binaries coexist in a system with possibly NX memory, but was implemented in a way that equated having a PT_GNU_STACK marked executable as being as "broken" as lacking the PT_GNU_STACK marking entirely. Things like unmarked assembly and stack trampolines may cause PT_GNU_STACK to need an executable bit, but they do not imply all mappings must be executable. This confusion has led to situations where modern programs with explicitly marked executable stacks are forced into the READ_IMPLIES_EXEC state when no such thing is needed. (And leads to unexpected failures when mmap()ing regions of device driver memory that wish to disallow VM_EXEC[1].) In looking for other reasons for the READ_IMPLIES_EXEC behavior, Jann Horn noted that glibc thread stacks have always been marked RWX (until 2003 when they started tracking the PT_GNU_STACK flag instead[2]). And musl doesn't support executable stacks at all[3]. As such, no breakage for multithreaded applications is expected from this change. [1] https://lkml.kernel.org/r/20190418055759.GA3155@mellanox.com [2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=54ee14b3882 [3] https://lkml.kernel.org/r/20190423192534.GN23599@brightrain.aerifal.cx Suggested-by: Hector Marco-Gisbert Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Jason Gunthorpe Link: https://lkml.kernel.org/r/20200327064820.12602-3-keescook@chromium.org commit e48e83d15bd98b15f7f9eb69f10e4ec595b3f69e Author: Jason Yan Date: Mon Apr 20 12:29:11 2020 +0800 ASoC: wcd934x: remove unneeded semicolon Fix the following coccicheck warning: sound/soc/codecs/wcd934x.c:3621:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:4270:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:4018:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:4043:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:3804:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:3866:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:3596:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:3542:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:3673:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:3723:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:2492:2-3: Unneeded semicolon sound/soc/codecs/wcd934x.c:1790:3-4: Unneeded semicolon sound/soc/codecs/wcd934x.c:1806:3-4: Unneeded semicolon sound/soc/codecs/wcd934x.c:1812:2-3: Unneeded semicolon Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200420042911.19379-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 0eb0674616b03da3d636134a8367eed284732b65 Author: Jason Yan Date: Mon Apr 20 12:28:47 2020 +0800 ASoC: wcd9335: remove unneeded semicolon Fix the following coccicheck warning: sound/soc/codecs/wcd9335.c:2606:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3619:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2849:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2955:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2988:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3960:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3776:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3924:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3355:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3832:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3079:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3089:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3232:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3878:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3578:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3728:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:1922:3-4: Unneeded semicolon sound/soc/codecs/wcd9335.c:1938:3-4: Unneeded semicolon sound/soc/codecs/wcd9335.c:1944:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3144:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2568:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2219:2-3: Unneeded semicolon Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200420042847.19206-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 4f05b5c62d248d6a25edcd13795001fb5eaa2080 Author: Jason Yan Date: Mon Apr 20 12:28:33 2020 +0800 ASoC: wcd934x: remove unnecessary comparisons to bool Fix the following coccicheck warning: sound/soc/codecs/wcd934x.c:3881:8-17: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200420042833.19116-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 629ba12e9998f344389e096a7cec6286c86ed7ab Author: Mac Chiang Date: Mon Mar 23 10:49:24 2020 +0800 ASoC: Intel: boards: split woofer and tweeter support Support Woofer stereo speakers by default and optionally Tweeter stereo speakers with a DMI quirk Signed-off-by: Mac Chiang Link: https://lore.kernel.org/r/1584931764-2778-1-git-send-email-mac.chiang@intel.com Signed-off-by: Mark Brown commit f7199cf489027ae38a9a82312d13025f7aefa0b8 Author: Sudeep Holla Date: Fri Apr 17 11:32:32 2020 +0100 firmware: arm_scmi: Fix return error code in smc_send_message SMCCC can return NOT_SUPPORTED(-1). Map it to appropriate Linux error codes namely -EOPNOTSUPP. Link: https://lore.kernel.org/r/20200417103232.6896-1-sudeep.holla@arm.com Reported-and-Tested-by:: Etienne Carriere Reviewed-by: Etienne Carriere Reviewed-by: Peng Fan Signed-off-by: Sudeep Holla commit b4fd63f42647110c963d4bfcd526ac48f5a5faff Author: Douglas Anderson Date: Mon Apr 20 09:24:54 2020 -0700 Revert "scsi: core: run queue if SCSI device queue isn't ready and queue is idle" This reverts commit 7e70aa789d4a0c89dbfbd2c8a974a4df717475ec. Now that we have the patches ("blk-mq: In blk_mq_dispatch_rq_list() "no budget" is a reason to kick") and ("blk-mq: Rerun dispatching in the case of budget contention") we should no longer need the fix in the SCSI code. Revert it, resolving conflicts with other patches that have touched this code. With this revert (and the two new patches) I can run the script that was in commit 7e70aa789d4a ("scsi: core: run queue if SCSI device queue isn't ready and queue is idle") in a loop with no failure. If I do this revert without the two new patches I can easily get a failure. Signed-off-by: Douglas Anderson Reviewed-by: Ming Lei Acked-by: Martin K. Petersen Signed-off-by: Jens Axboe commit a0823421a4d7264fc91c7b3769612331493cec1b Author: Douglas Anderson Date: Mon Apr 20 09:24:53 2020 -0700 blk-mq: Rerun dispatching in the case of budget contention If ever a thread running blk-mq code tries to get budget and fails it immediately stops doing work and assumes that whenever budget is freed up that queues will be kicked and whatever work the thread was trying to do will be tried again. One path where budget is freed and queues are kicked in the normal case can be seen in scsi_finish_command(). Specifically: - scsi_finish_command() - scsi_device_unbusy() - # Decrement "device_busy", AKA release budget - scsi_io_completion() - scsi_end_request() - blk_mq_run_hw_queues() The above is all well and good. The problem comes up when a thread claims the budget but then releases it without actually dispatching any work. Since we didn't schedule any work we'll never run the path of finishing work / kicking the queues. This isn't often actually a problem which is why this issue has existed for a while and nobody noticed. Specifically we only get into this situation when we unexpectedly found that we weren't going to do any work. Code that later receives new work kicks the queues. All good, right? The problem shows up, however, if timing is just wrong and we hit a race. To see this race let's think about the case where we only have a budget of 1 (only one thread can hold budget). Now imagine that a thread got budget and then decided not to dispatch work. It's about to call put_budget() but then the thread gets context switched out for a long, long time. While in this state, any and all kicks of the queue (like the when we received new work) will be no-ops because nobody can get budget. Finally the thread holding budget gets to run again and returns. All the normal kicks will have been no-ops and we have an I/O stall. As you can see from the above, you need just the right timing to see the race. To start with, the only case it happens if we thought we had work, actually managed to get the budget, but then actually didn't have work. That's pretty rare to start with. Even then, there's usually a very small amount of time between realizing that there's no work and putting the budget. During this small amount of time new work has to come in and the queue kick has to make it all the way to trying to get the budget and fail. It's pretty unlikely. One case where this could have failed is illustrated by an example of threads running blk_mq_do_dispatch_sched(): * Threads A and B both run has_work() at the same time with the same "hctx". Imagine has_work() is exact. There's no lock, so it's OK if Thread A and B both get back true. * Thread B gets interrupted for a long time right after it decides that there is work. Maybe its CPU gets an interrupt and the interrupt handler is slow. * Thread A runs, get budget, dispatches work. * Thread A's work finishes and budget is released. * Thread B finally runs again and gets budget. * Since Thread A already took care of the work and no new work has come in, Thread B will get NULL from dispatch_request(). I believe this is specifically why dispatch_request() is allowed to return NULL in the first place if has_work() must be exact. * Thread B will now be holding the budget and is about to call put_budget(), but hasn't called it yet. * Thread B gets interrupted for a long time (again). Dang interrupts. * Now Thread C (maybe with a different "hctx" but the same queue) comes along and runs blk_mq_do_dispatch_sched(). * Thread C won't do anything because it can't get budget. * Finally Thread B will run again and put the budget without kicking any queues. Even though the example above is with blk_mq_do_dispatch_sched() I believe the race is possible any time someone is holding budget but doesn't do work. Unfortunately, the unlikely has become more likely if you happen to be using the BFQ I/O scheduler. BFQ, by design, sometimes returns "true" for has_work() but then NULL for dispatch_request() and stays in this state for a while (currently up to 9 ms). Suddenly you only need one race to hit, not two races in a row. With my current setup this is easy to reproduce in reboot tests and traces have actually shown that we hit a race similar to the one described above. Note that we only need to fix blk_mq_do_dispatch_sched() and blk_mq_do_dispatch_ctx() and not the other places that put budget. In other cases we know that we have work to do on at least one "hctx" and code already exists to kick that "hctx"'s queue. When that work finally finishes all the queues will be kicked using the normal flow. One last note is that (at least in the SCSI case) budget is shared by all "hctx"s that have the same queue. Thus we need to make sure to kick the whole queue, not just re-run dispatching on a single "hctx". Signed-off-by: Douglas Anderson Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit b9151e7bca82a17ff7aa442a168e0f924a07443c Author: Douglas Anderson Date: Mon Apr 20 09:24:52 2020 -0700 blk-mq: Add blk_mq_delay_run_hw_queues() API call We have: * blk_mq_run_hw_queue() * blk_mq_delay_run_hw_queue() * blk_mq_run_hw_queues() ...but not blk_mq_delay_run_hw_queues(), presumably because nobody needed it before now. Since we need it for a later patch in this series, add it. Signed-off-by: Douglas Anderson Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit ab3cee3762e5e69f27c302c43691289fdfc12316 Author: Douglas Anderson Date: Mon Apr 20 09:24:51 2020 -0700 blk-mq: In blk_mq_dispatch_rq_list() "no budget" is a reason to kick In blk_mq_dispatch_rq_list(), if blk_mq_sched_needs_restart() returns true and the driver returns BLK_STS_RESOURCE then we'll kick the queue. However, there's another case where we might need to kick it. If we were unable to get budget we can be in much the same state as when the driver returns BLK_STS_RESOURCE, so we should treat it the same. It should be noted that even if we add a whole bunch of extra kicking to the queue in other patches this patch is still important. Specifically any kicking that happened before we re-spliced leftover requests into 'hctx->dispatch' wouldn't have found any work, so we really need to make sure we kick ourselves after we've done the splicing. Signed-off-by: Douglas Anderson Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit c5bceb98ce0e4ae8057a386c5171a868213fe226 Author: Cristian Marussi Date: Mon Apr 20 16:23:15 2020 +0100 firmware: arm_scmi: Fix handling of unexpected delayed responses Upon reception of an unexpected bogus delayed response, clear the channel and bail-out safely. Link: https://lore.kernel.org/r/20200420152315.21008-5-cristian.marussi@arm.com Fixes: 4d09852b6f01 ("firmware: arm_scmi: Add support for notifications message processing") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit d04fb2b2ddefad7c00edd29c1ed40188ce8f12a2 Author: Cristian Marussi Date: Mon Apr 20 16:23:14 2020 +0100 firmware: arm_scmi: Clear channel for delayed responses Clear channel properly when done processing a delayed response. This will let the platform firmware know that the channel is now free to use it for any new delayed response or notification. Link: https://lore.kernel.org/r/20200420152315.21008-4-cristian.marussi@arm.com Signed-off-by: Cristian Marussi (sudeep.holla: Updated commit log to reflect that channel is now free for platform to use) Signed-off-by: Sudeep Holla commit b37f5cc8d243479d7572445010fb6c9a4dff6dc4 Author: Cristian Marussi Date: Mon Apr 20 16:23:13 2020 +0100 firmware: arm_scmi: Clear channel on reception of unexpected responses When an unexpected response message is received we currently warn the user and bail-out, ensure to also free the channel by invoking the transport independent operation .clear_channel() Link: https://lore.kernel.org/r/20200420152315.21008-3-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 87dff4e63cf2910f2e4a32d1cb3e4a1a25406eb7 Author: Cristian Marussi Date: Mon Apr 20 16:23:12 2020 +0100 firmware: arm_scmi: Rename .clear_notification() transport_ops SCMI transport operation .clear_notification() is indeed a generic method to clear the channel in a transport dependent way, as such it could be a useful helper also in other contexts. Rename such method as .clear_channel(), renaming accordingly also its already existent call-sites. No functional change. Link: https://lore.kernel.org/r/20200420152315.21008-2-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 6b7fc6a3e6af4ff5773949d0fed70d8e7f68d5ce Author: Peter Jones Date: Fri Jul 6 15:04:24 2018 -0400 Make the "Reducing compressed framebufer size" message be DRM_INFO_ONCE() This was sort of annoying me: random:~$ dmesg | tail -1 [523884.039227] [drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS. random:~$ dmesg | grep -c "Reducing the compressed" 47 This patch makes it DRM_INFO_ONCE() just like the similar message farther down in that function is pr_info_once(). Cc: stable@vger.kernel.org Signed-off-by: Peter Jones Acked-by: Rodrigo Vivi Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1745 Link: https://patchwork.freedesktop.org/patch/msgid/20180706190424.29194-1-pjones@redhat.com [vsyrjala: Rebase due to per-device logging] Signed-off-by: Ville Syrjälä commit f153f6395a6392e894a1039eada81f8083d00517 Author: Chris Wilson Date: Mon Apr 20 13:53:56 2020 +0100 drm/i915/gt: Move the late flush_submission in retire to the end Avoid flushing the submission queue (of others) under the client's timeline lock, but instead move it to the end so that we may catch more. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1066 Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200420125356.26614-2-chris@chris-wilson.co.uk commit f7ea285b6266822bd63af2a3695f03e3357fd74f Merge: 97e130f63757 c7582ff7ed38 Author: Andy Shevchenko Date: Mon Apr 20 18:34:20 2020 +0300 Merge branch 'ib-pdx86-properties' Merge branch 'ib-pdx86-properties' of git://git.infradead.org/linux-platform-drivers-x86.git to avoid conflicts in PDx86. Signed-off-by: Andy Shevchenko commit 4eb542cc88c1c255a70e745b12ae913cd3edb535 Author: Kuninori Morimoto Date: Mon Apr 20 16:01:01 2020 +0900 soundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer Now ALSA SoC needs to use asoc_rtd_to_codec(), otherwise, it will be compile error. Signed-off-by: Kuninori Morimoto Acked-By: Vinod Koul Link: https://lore.kernel.org/r/87y2qqvdxu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a95f3ac21d64d62c746f836598d1467d5837fa28 Author: Chris Wilson Date: Mon Apr 20 13:53:55 2020 +0100 drm/i915/gem: Remove object_is_locked assertion from unpin_from_display_plane Since moving the obj->vma.list to a spin_lock, and the vm->bound_list to its vm->mutex, along with tracking shrinkable status under its own spinlock, we no long require the object to be locked by the caller. This is fortunate as it appears we can be called with the lock along an error path in flipping: <4> [139.942851] WARN_ON(debug_locks && !lock_is_held(&(&((obj)->base.resv)->lock.base)->dep_map)) <4> [139.943242] WARNING: CPU: 0 PID: 1203 at drivers/gpu/drm/i915/gem/i915_gem_domain.c:405 i915_gem_object_unpin_from_display_plane+0x70/0x130 [i915] <4> [139.943263] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_realtek snd_hda_codec_generic coretemp snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core r8169 lpc_ich snd_pcm realtek prime_numbers [last unloaded: i915] <4> [139.943347] CPU: 0 PID: 1203 Comm: kms_flip Tainted: G U 5.6.0-gd0fda5c2cf3f1-drmtip_474+ #1 <4> [139.943363] Hardware name: /D510MO, BIOS MOPNV10J.86A.0311.2010.0802.2346 08/02/2010 <4> [139.943589] RIP: 0010:i915_gem_object_unpin_from_display_plane+0x70/0x130 [i915] <4> [139.943589] Code: 85 28 01 00 00 be ff ff ff ff 48 8d 78 60 e8 d7 9b f0 e2 85 c0 75 b9 48 c7 c6 50 b9 38 c0 48 c7 c7 e9 48 3c c0 e8 20 d4 e9 e2 <0f> 0b eb a2 48 c7 c1 08 bb 38 c0 ba 0a 01 00 00 48 c7 c6 88 a3 35 <4> [139.943589] RSP: 0018:ffffb774c0603b48 EFLAGS: 00010282 <4> [139.943589] RAX: 0000000000000000 RBX: ffff9a142fa36e80 RCX: 0000000000000006 <4> [139.943589] RDX: 000000000000160d RSI: ffff9a142c1a88f8 RDI: ffffffffa434a64d <4> [139.943589] RBP: ffff9a1410a513c0 R08: ffff9a142c1a88f8 R09: 0000000000000000 <4> [139.943589] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9a1436ee94b8 <4> [139.943589] R13: 0000000000000001 R14: 00000000ffffffff R15: ffff9a1410960000 <4> [139.943589] FS: 00007fc73a744e40(0000) GS:ffff9a143da00000(0000) knlGS:0000000000000000 <4> [139.943589] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4> [139.943589] CR2: 00007fc73997e098 CR3: 000000002f5fe000 CR4: 00000000000006f0 <4> [139.943589] Call Trace: <4> [139.943589] intel_pin_and_fence_fb_obj+0x1c9/0x1f0 [i915] <4> [139.943589] intel_plane_pin_fb+0x3f/0xd0 [i915] <4> [139.943589] intel_prepare_plane_fb+0x13b/0x5c0 [i915] <4> [139.943589] drm_atomic_helper_prepare_planes+0x85/0x110 <4> [139.943589] intel_atomic_commit+0xda/0x390 [i915] <4> [139.943589] drm_atomic_helper_page_flip+0x9c/0xd0 <4> [139.943589] ? drm_event_reserve_init+0x46/0x60 <4> [139.943589] drm_mode_page_flip_ioctl+0x587/0x5d0 This completes the symmetry lost in commit 8b1c78e06e61 ("drm/i915: Avoid calling i915_gem_object_unbind holding object lock"). Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1743 Fixes: 8b1c78e06e61 ("drm/i915: Avoid calling i915_gem_object_unbind holding object lock") Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Andi Shyti Cc: # v5.6+ Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200420125356.26614-1-chris@chris-wilson.co.uk commit 75d892588e959573b321895003462d88cae2cff3 Author: Kirill Tkhai Date: Fri Feb 28 15:15:24 2020 +0300 fuse: Update stale comment in queue_interrupt() Fixes: 04ec5af0776e "fuse: export fuse_end_request()" Signed-off-by: Kirill Tkhai Signed-off-by: Miklos Szeredi commit 0e9fb6f17ad5b386b75451328975a07d7d953c6d Author: Vasily Averin Date: Mon Aug 19 09:53:50 2019 +0300 fuse: BUG_ON correction in fuse_dev_splice_write() commit 963545357202 ("fuse: reduce allocation size for splice_write") changed size of bufs array, so BUG_ON which checks the index of the array shold also be fixed. [SzM: turn BUG_ON into WARN_ON] Fixes: 963545357202 ("fuse: reduce allocation size for splice_write") Signed-off-by: Vasily Averin Signed-off-by: Miklos Szeredi commit a5d8422cc9598b11054faf34772d9ce68ae204fd Author: Masayoshi Mizuma Date: Tue Dec 17 15:55:20 2019 -0500 virtiofs: Add mount option and atime behavior to the doc Add a section to show the mount option and a subsection to show the atime behavior. Signed-off-by: Masayoshi Mizuma Signed-off-by: Miklos Szeredi commit bb737bbe48bea9854455cb61ea1dc06e92ce586c Author: Vivek Goyal Date: Mon Apr 20 17:01:34 2020 +0200 virtiofs: schedule blocking async replies in separate worker In virtiofs (unlike in regular fuse) processing of async replies is serialized. This can result in a deadlock in rare corner cases when there's a circular dependency between the completion of two or more async replies. Such a deadlock can be reproduced with xfstests:generic/503 if TEST_DIR == SCRATCH_MNT (which is a misconfiguration): - Process A is waiting for page lock in worker thread context and blocked (virtio_fs_requests_done_work()). - Process B is holding page lock and waiting for pending writes to finish (fuse_wait_on_page_writeback()). - Write requests are waiting in virtqueue and can't complete because worker thread is blocked on page lock (process A). Fix this by creating a unique work_struct for each async reply that can block (O_DIRECT read). Fixes: a62a8ef9d97d ("virtio-fs: add virtiofs filesystem") Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 9558b51ab739920aaf3c400d2df29e5ca4f19ec5 Author: Anson Huang Date: Fri Mar 20 07:44:03 2020 +0800 clk: imx: clk-pllv3: Use readl_relaxed_poll_timeout() for PLL lock wait Use readl_relaxed_poll_timeout() for PLL lock wait which can simplify the code a lot. Signed-off-by: Anson Huang Reviewed-by: Abel Vesa Reviewed-by: Stephen Boyd Signed-off-by: Shawn Guo commit 9e04ff70cf8ecf84c0ea49d11e9e801af9f175e3 Merge: ceab3ac1e60d ae83d0b416db Author: Mauro Carvalho Chehab Date: Mon Apr 20 16:50:25 2020 +0200 Merge tag 'v5.7-rc2' into patchwork Linux 5.7-rc2 * tag 'v5.7-rc2': (331 commits) Linux 5.7-rc2 mm: Fix MREMAP_DONTUNMAP accounting on VMA merge xattr.h: Replace zero-length array with flexible-array member uapi: linux: fiemap.h: Replace zero-length array with flexible-array member uapi: linux: dlm_device.h: Replace zero-length array with flexible-array member tpm_eventlog.h: Replace zero-length array with flexible-array member ti_wilink_st.h: Replace zero-length array with flexible-array member swap.h: Replace zero-length array with flexible-array member skbuff.h: Replace zero-length array with flexible-array member sched: topology.h: Replace zero-length array with flexible-array member rslib.h: Replace zero-length array with flexible-array member rio.h: Replace zero-length array with flexible-array member posix_acl.h: Replace zero-length array with flexible-array member platform_data: wilco-ec.h: Replace zero-length array with flexible-array member memcontrol.h: Replace zero-length array with flexible-array member list_lru.h: Replace zero-length array with flexible-array member lib: cpu_rmap: Replace zero-length array with flexible-array member irq.h: Replace zero-length array with flexible-array member ihex.h: Replace zero-length array with flexible-array member igmp.h: Replace zero-length array with flexible-array member ... commit 148c01d176237115d9c2805f6d29c0b6a72fbd10 Author: Dejin Zheng Date: Mon Apr 20 21:46:47 2020 +0800 regmap: Simplify implementation of the regmap_field_read_poll_timeout() macro Simplify the implementation of the macro regmap_field_read_poll_timeout() by using the macro read_poll_timeout(). Signed-off-by: Dejin Zheng Link: https://lore.kernel.org/r/20200420134647.9121-3-zhengdejin5@gmail.com Signed-off-by: Mark Brown commit e44ab4e14d6f4c448ae555132090c1a116b19e5c Author: Dejin Zheng Date: Mon Apr 20 21:46:46 2020 +0800 regmap: Simplify implementation of the regmap_read_poll_timeout() macro Simplify the implementation of the macro regmap_read_poll_timeout() by using the macro read_poll_timeout(). Signed-off-by: Dejin Zheng Link: https://lore.kernel.org/r/20200420134647.9121-2-zhengdejin5@gmail.com Signed-off-by: Mark Brown commit f25a066d1a07affb7bea4e5d9c179c3338338e23 Author: Peng Fan Date: Thu Mar 19 15:49:53 2020 +0800 firmware: imx-scu: Support one TX and one RX Current imx-scu requires four TX and four RX to communicate with SCU. This is low efficient and causes lots of mailbox interrupts. With imx-mailbox driver could support one TX to use all four transmit registers and one RX to use all four receive registers, imx-scu could use one TX and one RX. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 23aadcb9a8d59cd12fbf2cbe9be8479429bf0dae Author: Anson Huang Date: Wed Mar 18 09:39:25 2020 +0800 clk: imx: clk-sscg-pll: Remove unnecessary blank lines Remove many unnecessary blank lines for cleanup. Signed-off-by: Anson Huang Reviewed-by: Abel Vesa Reviewed-by: Stephen Boyd Signed-off-by: Shawn Guo commit dd12fa6978a1c9eb76274dc4e27f91d7c77727b2 Author: Vladimir Oltean Date: Wed Mar 18 02:16:02 2020 +0200 arm64: dts: ls1028a: Specify the DMA channels for the DSPI controllers LS1028A has a functional connection to the eDMA module. Even if the spi-fsl-dspi.c driver is not using DMA for LS1028A now, define the slots in the DMAMUX for connecting the eDMA channels to the 3 DSPI controllers. Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit ace105dd6159c7c4a49b4c80aa1efca31fc7720c Merge: 8ec7d6043263 c1c050ee74d6 Author: Mark Brown Date: Mon Apr 20 15:27:09 2020 +0100 Merge series "ASoC: Fix dependency issues of SND_SOC" from Wei Li : Fix dependency issues of SND_SOC introduced by commit ea00d95200d02 ("ASoC: Use imply for SND_SOC_ALL_CODECS"). Wei Li (2): ASoC: wm89xx: Fix build errors caused by I2C dependency ASoC: Fix wrong dependency of da7210 and wm8983 sound/soc/codecs/Kconfig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 commit 104edb94cc4b3101bab33161cd861de13e85610b Author: Sumit Garg Date: Fri Mar 27 10:59:48 2020 +0530 tee: add private login method for kernel clients There are use-cases where user-space shouldn't be allowed to communicate directly with a TEE device which is dedicated to provide a specific service for a kernel client. So add a private login method for kernel clients and disallow user-space to open-session using GP implementation defined login method range: (0x80000000 - 0xBFFFFFFF). Reviewed-by: Jerome Forissier Signed-off-by: Sumit Garg Signed-off-by: Jens Wiklander commit 26bfe3d0b227ab6d38692640b44ce48f2d857602 Author: Dave Jiang Date: Fri Apr 17 10:37:23 2020 -0700 ntb: intel: Add Icelake (gen4) support for Intel NTB Adding 4th generation Intel NTB support bits. There are a lot of common parts that the gen4 NTB has with gen3 NTB on Skylake. The commonalities are reused in gen4 Icelake NTB. Signed-off-by: Dave Jiang Signed-off-by: Jon Mason commit c1c050ee74d67aeb879fd38e3a07139d7fdb79f4 Author: Wei Li Date: Tue Apr 21 04:24:10 2020 +0800 ASoC: Fix wrong dependency of da7210 and wm8983 As these two drivers support I2C and SPI, we should add the SND_SOC_I2C_AND_SPI dependency instead. Fixes: ce0c97f8a2936 ("ASoC: Fix SND_SOC_ALL_CODECS imply SPI fallout") Signed-off-by: Wei Li Link: https://lore.kernel.org/r/20200420202410.47327-3-liwei391@huawei.com Signed-off-by: Mark Brown commit 91e475b5e810c7e0d6346e58017507d66a23f526 Author: Wei Li Date: Tue Apr 21 04:24:09 2020 +0800 ASoC: wm89xx: Fix build errors caused by I2C dependency When I2C=m, SND_SOC_WM8900=y, SND_SOC_WM8988=y, SND_SOC_WM8995=y: sound/soc/codecs/wm8900.o: In function `wm8900_i2c_probe': wm8900.c:(.text+0xa16): undefined reference to `__devm_regmap_init_i2c' sound/soc/codecs/wm8900.o: In function `wm8900_modinit': wm8900.c:(.init.text+0xb): undefined reference to `i2c_register_driver' sound/soc/codecs/wm8900.o: In function `wm8900_exit': wm8900.c:(.exit.text+0x8): undefined reference to `i2c_del_driver' sound/soc/codecs/wm8988.o: In function `wm8988_i2c_probe': wm8988.c:(.text+0x86b): undefined reference to `__devm_regmap_init_i2c' sound/soc/codecs/wm8988.o: In function `wm8988_modinit': wm8988.c:(.init.text+0xb): undefined reference to `i2c_register_driver' sound/soc/codecs/wm8988.o: In function `wm8988_exit': wm8988.c:(.exit.text+0x8): undefined reference to `i2c_del_driver' sound/soc/codecs/wm8995.o: In function `wm8995_i2c_probe': wm8995.c:(.text+0x1b5b): undefined reference to `__devm_regmap_init_i2c' sound/soc/codecs/wm8995.o: In function `wm8995_modinit': wm8995.c:(.init.text+0xb): undefined reference to `i2c_register_driver' sound/soc/codecs/wm8995.o: In function `wm8995_exit': wm8995.c:(.exit.text+0x8): undefined reference to `i2c_del_driver' As these drivers support I2C and SPI, we add the SND_SOC_I2C_AND_SPI dependency to solve it. Fixes: ea00d95200d02 ("ASoC: Use imply for SND_SOC_ALL_CODECS") Reported-by: Hulk Robot Signed-off-by: Wei Li Link: https://lore.kernel.org/r/20200420202410.47327-2-liwei391@huawei.com Signed-off-by: Mark Brown commit 2a6ba3f794e892c37d67b8ebb19487ce105eabc2 Author: Sumit Garg Date: Fri Mar 27 10:59:47 2020 +0530 tee: enable support to register kernel memory Enable support to register kernel memory reference with TEE. This change will allow TEE bus drivers to register memory references. Signed-off-by: Sumit Garg Signed-off-by: Jens Wiklander commit f0adbc382b8bb46a2467c4e5e1027763a197c8e1 Author: Thomas Zimmermann Date: Thu Jan 30 10:40:12 2020 +0100 drm/ast: Allocate initial CRTC state of the correct size The ast driver inherits from DRM's CRTC state, but still uses the atomic helper for struct drm_crtc_funcs.reset, drm_atomic_helper_crtc_reset(). The helper only allocates enough memory for the core CRTC state. That results in an out-ouf-bounds access when duplicating the initial CRTC state. Simplified backtrace shown below: [ 21.469321] ================================================================== [ 21.469434] BUG: KASAN: slab-out-of-bounds in ast_crtc_atomic_duplicate_state+0x84/0x100 [ast] [ 21.469445] Read of size 8 at addr ffff888036c1c5f8 by task systemd-udevd/382 [ 21.469451] [ 21.469464] CPU: 2 PID: 382 Comm: systemd-udevd Tainted: G E 5.5.0-rc6-1-default+ #214 [ 21.469473] Hardware name: Sun Microsystems SUN FIRE X2270 M2/SUN FIRE X2270 M2, BIOS 2.05 07/01/2010 [ 21.469480] Call Trace: [ 21.469501] dump_stack+0xb8/0x110 [ 21.469528] print_address_description.constprop.0+0x1b/0x1e0 [ 21.469557] ? ast_crtc_atomic_duplicate_state+0x84/0x100 [ast] [ 21.469581] ? ast_crtc_atomic_duplicate_state+0x84/0x100 [ast] [ 21.469597] __kasan_report.cold+0x1a/0x35 [ 21.469640] ? ast_crtc_atomic_duplicate_state+0x84/0x100 [ast] [ 21.469665] kasan_report+0xe/0x20 [ 21.469693] ast_crtc_atomic_duplicate_state+0x84/0x100 [ast] [ 21.469733] drm_atomic_get_crtc_state+0xbf/0x1c0 [ 21.469768] __drm_atomic_helper_set_config+0x81/0x5a0 [ 21.469803] ? drm_atomic_plane_check+0x690/0x690 [ 21.469843] ? drm_client_rotation+0xae/0x240 [ 21.469876] drm_client_modeset_commit_atomic+0x230/0x390 [ 21.469888] ? __mutex_lock+0x8f0/0xbe0 [ 21.469929] ? drm_client_firmware_config.isra.0+0xa60/0xa60 [ 21.469948] ? drm_client_modeset_commit_force+0x28/0x230 [ 21.470031] ? memset+0x20/0x40 [ 21.470078] drm_client_modeset_commit_force+0x90/0x230 [ 21.470110] drm_fb_helper_restore_fbdev_mode_unlocked+0x5f/0xc0 [ 21.470132] drm_fb_helper_set_par+0x59/0x70 [ 21.470155] fbcon_init+0x61d/0xad0 [ 21.470185] ? drm_fb_helper_restore_fbdev_mode_unlocked+0xc0/0xc0 [ 21.470232] visual_init+0x187/0x240 [ 21.470266] do_bind_con_driver+0x2e3/0x460 [ 21.470321] do_take_over_console+0x20a/0x290 [ 21.470371] do_fbcon_takeover+0x85/0x100 [ 21.470402] register_framebuffer+0x2fd/0x490 [ 21.470425] ? kzalloc.constprop.0+0x10/0x10 [ 21.470503] __drm_fb_helper_initial_config_and_unlock+0xf2/0x140 [ 21.470533] drm_fbdev_client_hotplug+0x162/0x250 [ 21.470563] drm_fbdev_generic_setup+0xd2/0x155 [ 21.470602] ast_driver_load+0x688/0x850 [ast] <...> [ 21.472625] ================================================================== Allocating enough memory for struct ast_crtc_state in a custom ast CRTC reset handler fixes the problem. v2: * implement according to drm_atomic_helper_crtc_reset() * update state with __drm_atomic_helper_crtc_reset() Signed-off-by: Thomas Zimmermann Fixes: 83be6a3ceb11 ("drm/ast: Introduce struct ast_crtc_state") Reviewed-by: Daniel Vetter Cc: Gerd Hoffmann Cc: Dave Airlie Cc: Daniel Vetter Cc: Alex Deucher Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20200130094012.32140-1-tzimmermann@suse.de commit 9d9e435f3f2492bfd196acacb61cc9a9212d8170 Author: Kees Cook Date: Thu Mar 26 23:48:15 2020 -0700 x86/elf: Add table to document READ_IMPLIES_EXEC Add a table to document the current behavior of READ_IMPLIES_EXEC in preparation for changing the behavior. Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Jason Gunthorpe Link: https://lkml.kernel.org/r/20200327064820.12602-2-keescook@chromium.org commit 8a3a9535189d908f7e325238c9f09069d4fe9b8f Author: Yangtao Li Date: Mon Apr 20 15:00:13 2020 +0200 arm64: dts: allwinner: h6: Add clock to CPU cores The ARM CPU cores are fed by the CPU clock from the CCU. Add a reference to the clock for each CPU core, along with the clock transition latency. Signed-off-by: Yangtao Li Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit c7582ff7ed388b803d083166514a4c8acd4ef57d Author: Andy Shevchenko Date: Wed Apr 8 19:09:06 2020 +0300 platform/x86: intel_cht_int33fe: Fix spelling issues Fix spelling issues over the comments in the code. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Tested-by: Hans de Goede Reviewed-by: Heikki Krogerus commit 7b839f76400086a169c8966cbca58ef50c723eb7 Author: Andy Shevchenko Date: Wed Apr 8 19:09:05 2020 +0300 platform/x86: intel_cht_int33fe: Switch to use acpi_dev_hid_uid_match() Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Tested-by: Hans de Goede Reviewed-by: Heikki Krogerus commit fa0c9cb11bad91ee1d2d6c6fd6a6dcbbb36858fd Author: Andy Shevchenko Date: Wed Apr 8 19:09:04 2020 +0300 platform/x86: intel_cht_int33fe: Convert to use set_secondary_fwnode() In one place we open coded set_secondary_fwnode(). Let's replace it with a helper. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Tested-by: Hans de Goede Reviewed-by: Heikki Krogerus commit 140355e5db8be765c39a97fb6817afa1a2c25909 Author: Andy Shevchenko Date: Wed Apr 8 19:09:03 2020 +0300 platform/x86: intel_cht_int33fe: Convert software node array to group Code looks and be read cleaner when software nodes are defined individually. Convert software node array to a group in order to achieve above. While here, switch struct initializers to C99 standard. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Tested-by: Hans de Goede Reviewed-by: Heikki Krogerus commit 954fd81ce83b7077b8e7b7b0fbf3ebf19d4eaff9 Author: Takahiro Kuwano Date: Mon Apr 20 14:44:41 2020 +0300 mtd: spi-nor: spansion: Enable dual and quad read for s25fl256s0 The s25fl256s0 supports dual and quad read like s25fl256s1. Enable it by adding SPI_NOR_DUAL_READ and SPI_NOR_QUAD_READ flags to the flash_info entry. Tested with the device and confirmed that is working. Signed-off-by: Takahiro Kuwano Signed-off-by: Tudor Ambarus commit 02094d54870590a667f822e4032bbd1ba6c48d00 Author: Andy Shevchenko Date: Wed Apr 8 19:09:02 2020 +0300 software node: Allow register and unregister software node groups Sometimes it's more convenient to register a set of individual software nodes grouped together. Add couple of functions for that. Signed-off-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Reviewed-by: Hans de Goede Tested-by: Hans de Goede Reviewed-by: Heikki Krogerus commit 96489ae170fb30b62f817c86c8e64b150b55a7ff Author: Andy Shevchenko Date: Wed Apr 8 19:09:01 2020 +0300 device property: export set_secondary_fwnode() to modules Some drivers when compiled as modules may need to set secondary firmware node. Export set_secondary_fwnode() to make it possible without code duplication. Signed-off-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Reviewed-by: Hans de Goede Tested-by: Hans de Goede Reviewed-by: Heikki Krogerus commit 7a6659a59198acb5e9be050f42dbb1060efe7434 Author: Thomas Bogendoerfer Date: Mon Apr 20 13:28:54 2020 +0200 MIPS: alchemy: Fix build error after ioremap cleanup IOremap changes caused following build error: arch/mips/alchemy/common/setup.c:99:9: error: implicit declaration of function +‘remap_pfn_range’; did you mean ‘io_remap_pfn_range’? +[-Werror=implicit-function-declaration] Fixed my including linux/mm.h Fixes: d399157283fb ("MIPS: cleanup fixup_bigphys_addr handling") Signed-off-by: Thomas Bogendoerfer commit 41fe32ecc7aff4527a4ee477870d9b1164be95a4 Author: Geert Uytterhoeven Date: Fri Apr 17 16:10:03 2020 +0200 MAINTAINERS: Add DT Bindings for Renesas Pin Function Controllers The "PIN CONTROLLER - RENESAS" section lacks the related DT bindings. Add them. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20200417141003.22816-1-geert+renesas@glider.be commit 1115899e7aad71bc36100c3fa1d0b99cff9263e6 Author: Dan Carpenter Date: Tue Apr 7 12:30:28 2020 +0300 tee: remove unnecessary NULL check in tee_shm_alloc() Smatch complains that "ctx" isn't checked consistently: drivers/tee/tee_shm.c:164 tee_shm_alloc() warn: variable dereferenced before check 'ctx' (see line 95) I audited the callers and "ctx" can't be NULL so the check can be removed. Signed-off-by: Dan Carpenter Signed-off-by: Jens Wiklander commit 7fa3e10f0f3646108a1018004d0f571c3222dc9f Author: Christoph Hellwig Date: Wed Apr 8 17:27:43 2020 +0200 x86/mm: Move pgprot2cachemode out of line This helper is only used by x86 low-level MM code. Also remove the entirely pointless __pte2cachemode_tbl export as that symbol can be marked static now. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200408152745.1565832-3-hch@lst.de commit 1f6f655e01adebf5bd5e6c3da2e843c104ded051 Author: Christoph Hellwig Date: Wed Apr 8 17:27:42 2020 +0200 x86/mm: Add a x86_has_pat_wp() helper Abstract the ioremap code away from the caching mode internals. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200408152745.1565832-2-hch@lst.de commit 7222a1b5b87417f22265c92deea76a6aecd0fb0f Author: Mark Gross Date: Thu Apr 16 18:21:51 2020 +0200 x86/speculation: Add SRBDS vulnerability and mitigation documentation Add documentation for the SRBDS vulnerability and its mitigation. [ bp: Massage. jpoimboe: sysfs table strings. ] Signed-off-by: Mark Gross Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Reviewed-by: Josh Poimboeuf commit 7e5b3c267d256822407a22fdce6afdf9cd13f9fb Author: Mark Gross Date: Thu Apr 16 17:54:04 2020 +0200 x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation SRBDS is an MDS-like speculative side channel that can leak bits from the random number generator (RNG) across cores and threads. New microcode serializes the processor access during the execution of RDRAND and RDSEED. This ensures that the shared buffer is overwritten before it is released for reuse. While it is present on all affected CPU models, the microcode mitigation is not needed on models that enumerate ARCH_CAPABILITIES[MDS_NO] in the cases where TSX is not supported or has been disabled with TSX_CTRL. The mitigation is activated by default on affected processors and it increases latency for RDRAND and RDSEED instructions. Among other effects this will reduce throughput from /dev/urandom. * Enable administrator to configure the mitigation off when desired using either mitigations=off or srbds=off. * Export vulnerability status via sysfs * Rename file-scoped macros to apply for non-whitelist table initializations. [ bp: Massage, - s/VULNBL_INTEL_STEPPING/VULNBL_INTEL_STEPPINGS/g, - do not read arch cap MSR a second time in tsx_fused_off() - just pass it in, - flip check in cpu_set_bug_bits() to save an indentation level, - reflow comments. jpoimboe: s/Mitigated/Mitigation/ in user-visible strings tglx: Dropped the fused off magic for now ] Signed-off-by: Mark Gross Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Reviewed-by: Tony Luck Reviewed-by: Pawan Gupta Reviewed-by: Josh Poimboeuf Tested-by: Neelima Krishnan commit e9d7144597b10ff13ff2264c059f7d4a7fbc89ac Author: Mark Gross Date: Thu Apr 16 17:23:10 2020 +0200 x86/cpu: Add a steppings field to struct x86_cpu_id Intel uses the same family/model for several CPUs. Sometimes the stepping must be checked to tell them apart. On x86 there can be at most 16 steppings. Add a steppings bitmask to x86_cpu_id and a X86_MATCH_VENDOR_FAMILY_MODEL_STEPPING_FEATURE macro and support for matching against family/model/stepping. [ bp: Massage. ] Signed-off-by: Mark Gross Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Reviewed-by: Tony Luck Reviewed-by: Josh Poimboeuf commit 93920f61c2ad7edb01e63323832585796af75fc9 Author: Mark Gross Date: Thu Apr 16 17:32:42 2020 +0200 x86/cpu: Add 'table' argument to cpu_matches() To make cpu_matches() reusable for other matching tables, have it take a pointer to a x86_cpu_id table as an argument. [ bp: Flip arguments order. ] Signed-off-by: Mark Gross Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf commit a49e244797f92bc32286cdbb7ab6621bca1c553b Author: Marek Vasut Date: Sun Mar 22 19:40:08 2020 +0100 ARM: dts: stm32: Enable I2C2 on DHCOM PDK2 carrier board The I2C2 is routed out to header X21, enable it to make it available. Add a comment to I2C5, which is routed to header X22 right next to it. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit bc1aa0919284679c71853577f3003d8aa1ff9720 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:12 2020 +0100 dt-bindings: arm: stm32: document lxa,stm32mp157c-mc1 compatible Document the STM32MP157 based Linux Automation MC-1 device tree compatible. Acked-by: Rob Herring Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 666b5ca85cd34f219a1b237a64d09e778980e231 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:11 2020 +0100 ARM: dts: stm32: add STM32MP1-based Linux Automation MC-1 board The Linux Automation MC-1 is a SBC built around the Octavo Systems OSD32MP15x SiP. The SiP features up to 1 GB DDR3 RAM, EEPROM and a PMIC. The board has eMMC and a SD slot for storage and GbE for both connectivity and power. Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit f0b06064bbd66f6d7f2a14a1332b344f555333d6 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:10 2020 +0100 dt-bindings: add vendor prefix for Linux Automation GmbH Linux Automation GmbH[0] was founded in 2019 in order to develop electronics for embedded Linux. Add its vendor prefix so it may be used in future board and device compatibles. [0]: https://www.linux-automation.com Acked-by: Rob Herring Signed-off-by: Robert Schwebel Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit c19e7f74966a868f5a2fd3a446ade159c79a3694 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:09 2020 +0100 ARM: dts: stm32: use uniform node names for sleep pinctrl groups While all sleep pinctrl group labels now follow a fixed naming scheme, node _names_ for these groups don't: - Some use ${dev}-[0-9], where the suffix is the normal group suffix + 1 - Some use ${dev}-sleep-[0-9], where suffix is the normal group suffix - The <dc node uses ${dev}-[a-z]-[0-9], where the letter matches the phandle and the number suffix is the normal group's suffix + 1 For uniformity, standardize on using ${dev}-[0-9]+ for all normal pinctrl groups and ${dev}-sleep-[0-9]+ for all sleep pinctrl groups. Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 6ddf19e09fb29d1661ca4f0a5eaff7141879c7fe Author: Ahmad Fatoum Date: Thu Mar 26 23:02:08 2020 +0100 ARM: dts: stm32: use uniform label names for sleep pinctrl phandles Some labels follow the *_sleep_pins_* naming scheme, but some also use *_pins_sleep_*. Because most labels use the former and for uniformity with variants like sdmmc1_b4_pins_a and sdmmc1_dir_pins_a, adopt the *_sleep_pins_* scheme throughout. Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 276bd3f003b18f4bff3b5db68bd3a746653cb8f8 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:07 2020 +0100 ARM: dts: stm32: remove now redundant STM32MP15x video cell sizes With the cell sizes specified in the SoC DTSIs in a previous commit, individual boards no longer need to specify them, thus drop them. No functional change. Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 9c32f980d999b4f441044f94005b3e649d036694 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:06 2020 +0100 ARM: dts: stm32: preset stm32mp15x video #address- and #size-cells The cell count for address and size is defined by the binding and not something a board would change. Avoid each board adding this boilerplate by having the cell size specification in the SoC DTSI. Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 88fcb8a340e5221fdb0317a26f16d1df1776f0a9 Author: Ahmad Fatoum Date: Thu Mar 26 23:02:05 2020 +0100 ARM: dts: stm32: enable stm32mp157's &gpu by default In the original stm32mp157c.dtsi, the GPU was disabled as some SoC variants lacked a GPU. We now have separate a dtsi for each SoC variant and variants without a GPU lack the node altogether. As we need no board support for using the GPU, enable it by default and while at it remove the now redundant status = "okay" in existing board device trees. Suggested-by: Lucas Stach Signed-off-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 4bbb76eedde97a84b54e89527993bb1d9493e1c7 Author: Fabrice Gasnier Date: Thu Mar 19 11:30:26 2020 +0100 ARM: dts: stm32: fix a typo for DAC io-channel-cells on stm32mp15 Fix a typo on STM32MP15 DAC, e.g. s/channels/channel Fixes: da6cddc7e8a4 ("ARM: dts: stm32: Add DAC support to stm32mp157c") Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit a7c0bbc3fd612531714bd6aae33bbdedb215a9f5 Author: Fabrice Gasnier Date: Thu Mar 19 11:26:11 2020 +0100 ARM: dts: stm32: fix a typo for DAC io-channel-cells on stm32h743 Fix a typo on STM32H743 DAC, e.g. s/channels/channel Fixes: 1536dec45e77 ("ARM: dts: stm32: Add DAC support on stm32h743") Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit 546283d580c7564f895a47910dbe59c53a091d35 Author: Fabrice Gasnier Date: Thu Mar 19 11:23:31 2020 +0100 ARM: dts: stm32: fix a typo for DAC io-channel-cells on stm32f429 Fix a typo on STM32F429 DAC, e.g. s/channels/channel Fixes: 25329b23fae9 ("ARM: dts: stm32: Add DAC support on stm32f429") Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit c84dc6e68a1d2464e050d9694be4e4ff49e32bfd Author: David Rientjes Date: Tue Apr 14 17:04:55 2020 -0700 dma-pool: add additional coherent pools to map to gfp mask The single atomic pool is allocated from the lowest zone possible since it is guaranteed to be applicable for any DMA allocation. Devices may allocate through the DMA API but not have a strict reliance on GFP_DMA memory. Since the atomic pool will be used for all non-blockable allocations, returning all memory from ZONE_DMA may unnecessarily deplete the zone. Provision for multiple atomic pools that will map to the optimal gfp mask of the device. When allocating non-blockable memory, determine the optimal gfp mask of the device and use the appropriate atomic pool. The coherent DMA mask will remain the same between allocation and free and, thus, memory will be freed to the same atomic pool it was allocated from. __dma_atomic_pool_init() will be changed to return struct gen_pool * later once dynamic expansion is added. Signed-off-by: David Rientjes Signed-off-by: Christoph Hellwig commit e860c299ac0d738b44ff91693f11e63080a29698 Author: David Rientjes Date: Tue Apr 14 17:04:52 2020 -0700 dma-remap: separate DMA atomic pools from direct remap code DMA atomic pools will be needed beyond only CONFIG_DMA_DIRECT_REMAP so separate them out into their own file. This also adds a new Kconfig option that can be subsequently used for options, such as CONFIG_AMD_MEM_ENCRYPT, that will utilize the coherent pools but do not have a dependency on direct remapping. For this patch alone, there is no functional change introduced. Reviewed-by: Christoph Hellwig Signed-off-by: David Rientjes [hch: fixup copyrights and remove unused includes] Signed-off-by: Christoph Hellwig commit 05f099a7d0a73114c6eb3e6a359ea97563b47031 Author: Jason Yan Date: Fri Apr 17 15:36:05 2020 +0800 dma-debug: make __dma_entry_alloc_check_leak() static Fix the following sparse warning: kernel/dma/debug.c:659:6: warning: symbol '__dma_entry_alloc_check_leak' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Christoph Hellwig commit e09a7440407900757d03aa0cd897e4fc8e7d5fac Author: Gustavo A. R. Silva Date: Thu Mar 26 18:29:09 2020 -0500 m68k: amiga: config: Mark expected switch fall-through Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: allmodconfig m68k): arch/m68k/amiga/config.c: In function ‘amiga_identify’: ./arch/m68k/include/asm/amigahw.h:42:50: warning: this statement may fall through [-Wimplicit-fallthrough=] #define AMIGAHW_SET(name) (amiga_hw_present.name = 1) ~~~~~~~~~~~~~~~~~~~~~~~^~~~ arch/m68k/amiga/config.c:223:3: note: in expansion of macro ‘AMIGAHW_SET’ AMIGAHW_SET(PCMCIA); ^~~~~~~~~~~ arch/m68k/amiga/config.c:224:2: note: here case AMI_500: ^~~~ Replace the existing /* fall through */ comments and fix the issue above by using the new pseudo-keyword fallthrough; Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/14ff577604d25243c8a897f851b436ba87ae87cb.1585264062.git.gustavo@embeddedor.com Signed-off-by: Geert Uytterhoeven commit 0b545fd17f84184f9536bde68c3521e36c488448 Author: Jason Yan Date: Sat Apr 18 16:19:26 2020 +0800 KVM: s390: remove unneeded semicolon in gisa_vcpu_kicker() Fix the following coccicheck warning: arch/s390/kvm/interrupt.c:3085:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Christian Borntraeger Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/20200418081926.41666-1-yanaijie@huawei.com Signed-off-by: Christian Borntraeger commit 62cf666e4eb8c00dee69bed505db60bf8c3fecf0 Author: David Hildenbrand Date: Fri Apr 3 17:30:50 2020 +0200 KVM: s390: vsie: gmap_table_walk() simplifications Let's use asce_type where applicable. Also, simplify our sanity check for valid table levels and convert it into a WARN_ON_ONCE(). Check if we even have a valid gmap shadow as the very first step. Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200403153050.20569-6-david@redhat.com Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger commit d075fc3154be9de3b00b7bba2fb6009fe8ab611a Author: David Hildenbrand Date: Fri Apr 3 17:30:49 2020 +0200 KVM: s390: vsie: Move conditional reschedule Let's move it to the outer loop, in case we ever run again into long loops, trying to map the prefix. While at it, convert it to cond_resched(). Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20200403153050.20569-5-david@redhat.com Reviewed-by: Claudio Imbrenda Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger commit bb15aded5144d36b2a050e1dad415876c0b94234 Author: Sergei Shtylyov Date: Tue Apr 7 23:56:43 2020 +0300 mtd: spi-nor: move #define SPINOR_OP_WRDI The write disable (WRDI) opcode is not really specific to the SST flashes (anymore?) -- move the #define to the main opcode group, just before WREN. Signed-off-by: Sergei Shtylyov Signed-off-by: Tudor Ambarus commit 124eb5dc4ca5f4beeef1c0f29f3a053a0d0f5e46 Author: Geert Uytterhoeven Date: Mon Mar 16 11:25:40 2020 +0100 ARM: dts: r8a7791: Add PWM device nodes Enable support for the 7 PWM channels provided by PWM Timers on R-Car M2-W, by adding device nodes describing the PWM Timers. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200316102540.28887-3-geert+renesas@glider.be commit d92798d5759d7894921b320de64b9e83dfb3000c Author: Geert Uytterhoeven Date: Mon Mar 16 11:25:39 2020 +0100 ARM: dts: r8a7791: Add TPU device node Enable support for the 4 PWM channels provided by the 16-bit Timer Pulse Unit on R-Car M2-W, by adding a device node describing the TPU. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200316102540.28887-2-geert+renesas@glider.be commit fdba377f962e50a2542e4d5709968c8d79f4815f Author: Geert Uytterhoeven Date: Fri Apr 17 16:11:16 2020 +0200 MAINTAINERS: Add DT Bindings for Renesas Clock Generators The "RENESAS CLOCK DRIVERS" section lacks the related DT bindings. Add them. Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200417141116.23019-1-geert+renesas@glider.be commit 30205377ddbb717ee451e872fd59511f4f76373d Author: Rafael J. Wysocki Date: Sat Apr 18 18:51:44 2020 +0200 PM: sleep: core: Fold functions into their callers Fold four functions in the PM core that each have only one caller now into their callers. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern commit 107d47b2b95ef478d71f3bf36201886d7475427a Author: Rafael J. Wysocki Date: Sat Apr 18 18:29:30 2020 +0200 PM: sleep: core: Simplify the SMART_SUSPEND flag handling The code to handle the SMART_SUSPEND driver PM flag is hard to follow and somewhat inconsistent with respect to devices without middle-layer (subsystem) callbacks. Namely, for those devices the core takes the role of a middle layer in providing the expected ordering of execution of callbacks (under the assumption that the drivers setting SMART_SUSPEND can reuse their PM-runtime callbacks directly for system-wide suspend). To that end, it prevents driver ->suspend_late and ->suspend_noirq callbacks from being executed for devices that are still runtime-suspended in __device_suspend_late(), because running the same callback funtion that was previously run by PM-runtime for them may be invalid. However, it does that only for devices without any middle-layer callbacks for the late/noirq/early suspend/resume phases even though it would be simpler and more consistent to skip the driver-lavel callbacks for all devices with SMART_SUSPEND set that are runtime-suspended in __device_suspend_late(). Simplify the code in accordance with the above observation. Suggested-by: Alan Stern Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern commit cdaeaa2560a9511374986cf7ce6e164318caae53 Author: Clément Péron Date: Sun Apr 19 15:50:06 2020 +0200 arm64: configs: Enable sun50i cpufreq nvmem Allwinner H6 needs this driver to be able to get the correct speed_bin required for DVFS. Enable this option in arm64 defconfig. Signed-off-by: Clément Péron Signed-off-by: Maxime Ripard commit d7fb38ae36a2dc97924b075ad1d1a88792777ea9 Author: Lyude Paul Date: Mon Apr 13 17:44:06 2020 -0400 drm/i915/dpcd_bl: Unbreak enable_dpcd_backlight modparam Looks like I accidentally made it so you couldn't force DPCD backlight support on, whoops. Fix that. Signed-off-by: Lyude Paul Fixes: 17f5d57915be ("drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED panel") Cc: Adam Jackson Cc: Jani Nikula Cc: Joonas Lahtinen Cc: "Ville Syrjälä" Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200413214407.1851002-1-lyude@redhat.com commit 3357b61177a7f34267256098b29a7f4992af40f3 Author: Hadar Gat Date: Fri Apr 17 23:38:45 2020 +0300 hwrng: cctrng - add missing include to linux/fips.h This fixes build failure when CONFIG_CRYPTO_FIPS is defined. Fixes: a583ed310bb6 ("hwrng: cctrng - introduce Arm CryptoCell driver") Signed-off-by: Hadar Gat Reported-by: Randy Dunlap Reported-by: kbuild test robot Acked-by: Randy Dunlap # build-tested Signed-off-by: Herbert Xu commit f88480e300ac13141aa84f0f70b745df2e11b203 Author: Shukun Tan Date: Fri Apr 17 15:08:31 2020 +0800 crypto: hisilicon/qm - fix build failure with ACPI off Add Kconfig dependency to fix kbuild warnings. Fixes: 6c6dd5802c2d ("crypto: hisilicon/qm - add controller reset interface") Reported-by: kbuild test robot Reported-by: Stephen Rothwell Signed-off-by: Shukun Tan Signed-off-by: Herbert Xu commit 4b4e8e93eccc2abc4209fe226ec89e7fbe9f3c61 Author: Jason Yan Date: Fri Apr 17 19:16:04 2020 +0800 pinctrl: rza1: Fix wrong array assignment of rza1l_swio_entries The rza1l_swio_entries referred to the wrong array rza1h_swio_pins, which was intended to be rza1l_swio_pins. So let's fix it. This is detected by the following gcc warning: drivers/pinctrl/pinctrl-rza1.c:401:35: warning: ‘rza1l_swio_pins’ defined but not used [-Wunused-const-variable=] static const struct rza1_swio_pin rza1l_swio_pins[] = { ^~~~~~~~~~~~~~~ Fixes: 039bc58e73b77723 ("pinctrl: rza1: Add support for RZ/A1L") Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200417111604.19143-1-yanaijie@huawei.com Signed-off-by: Geert Uytterhoeven commit 4c427ab28fd1cd988fce9517527476cfebd27485 Author: Geert Uytterhoeven Date: Wed Apr 15 14:49:23 2020 +0200 ARM: shmobile: defconfig: Refresh for v5.7-rc1 Update the defconfig for Renesas ARM boards: - Enable CONFIG_DRM_DISPLAY_CONNECTOR (for HDMI, VGA, and composite display connectors on various R-Car H1, Gen2, and RZ/G1 boards, since commit 0c275c30176b2e78 ("drm/bridge: Add bridge driver for display connectors")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200415124923.2510-1-geert+renesas@glider.be commit 1f36ab3f6e3b791eadad94f792c874706e153b66 Author: Siddharth Gupta Date: Wed Apr 8 16:36:40 2020 -0700 remoteproc: sysmon: Inform current rproc about all active rprocs Clients/services running on a remoteproc that booted up might need to be aware of the state of already running remoteprocs. When a remoteproc boots up (fresh or after recovery) it is not aware of the remoteprocs that booted before it, i.e., the system state is incomplete. So to keep track of it we send sysmon on behalf of all 'ONLINE' remoteprocs. Acked-by: Mathieu Poirier Reviewed-by: Bjorn Andersson Signed-off-by: Siddharth Gupta Link: https://lore.kernel.org/r/1586389003-26675-4-git-send-email-sidgup@codeaurora.org Signed-off-by: Bjorn Andersson commit 611905d6e31c6ce2a59c8bda91b3d33beec13c50 Author: Kuninori Morimoto Date: Mon Apr 20 16:01:01 2020 +0900 soundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer Now ALSA SoC needs to use asoc_rtd_to_codec(), otherwise, it will be compile error. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y2qqvdxu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Vinod Koul commit 1877f54f75ad16549861ae92a708bd04c23f2a72 Author: Siddharth Gupta Date: Wed Apr 8 16:36:39 2020 -0700 remoteproc: sysmon: Add notifications for events Add notification for other stages of remoteproc boot and shutdown. This includes adding callback functions for the prepare and unprepare events, and fleshing out the callback function for start. Acked-by: Mathieu Poirier Reviewed-by: Bjorn Andersson Signed-off-by: Siddharth Gupta Link: https://lore.kernel.org/r/1586389003-26675-3-git-send-email-sidgup@codeaurora.org Signed-off-by: Bjorn Andersson commit 66a4347e9a3e6adf9d3d5ceb9856cbed3d805beb Author: Siddharth Gupta Date: Wed Apr 8 16:36:38 2020 -0700 remoteproc: sysmon: Add ability to send type of notification Current implementation of the sysmon driver does not support adding notifications for other remoteproc events - prepare, start, unprepare. Clients on the remoteproc side might be interested in knowing when a remoteproc boots up. This change adds the ability to send the notification type along with the name. For example, audio DSP is interested in knowing when modem has crashed so that it can perform cleanup and wait for modem to boot up before it starts processing data again. Acked-by: Mathieu Poirier Reviewed-by: Bjorn Andersson Signed-off-by: Siddharth Gupta Link: https://lore.kernel.org/r/1586389003-26675-2-git-send-email-sidgup@codeaurora.org Signed-off-by: Bjorn Andersson commit c12e38b1d52e995a0efe6d011873f57e04b80b89 Author: Haren Myneni Date: Fri Apr 17 02:11:55 2020 -0700 Documentation/powerpc: VAS API Power9 introduced Virtual Accelerator Switchboard (VAS) which allows userspace to communicate with Nest Accelerator (NX) directly. But kernel has to establish channel to NX for userspace. This document describes user space API that application can use to establish communication channel. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114715.2275.1135.camel@hbabu-laptop commit 040b00acec4bbbed7493fd64829e74a055075fb2 Author: Haren Myneni Date: Fri Apr 17 02:11:14 2020 -0700 crypto/nx: Remove 'pid' in vas_tx_win_attr struct When window is opened, pid reference is taken for user space windows. Not needed for kernel windows. So remove 'pid' in vas_tx_win_attr struct. Signed-off-by: Haren Myneni Acked-by: Herbert Xu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114674.2275.1132.camel@hbabu-laptop commit 1af11ae225350a92a1e13a4c27c215befced20af Author: Haren Myneni Date: Fri Apr 17 02:10:24 2020 -0700 crypto/nx: Enable and setup GZIP compression type Changes to probe GZIP device-tree nodes, open RX windows and setup GZIP compression type. No plans to provide GZIP usage in kernel right now, but this patch enables GZIP for user space usage. Signed-off-by: Haren Myneni Acked-by: Herbert Xu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114624.2275.1129.camel@hbabu-laptop commit 4aebf3ce26ca2128433b615cd2535c22b03c8fa3 Author: Haren Myneni Date: Fri Apr 17 02:09:29 2020 -0700 crypto/nx: Make enable code generic to add new GZIP compression type Make setup and enable code generic to support new GZIP compression type. Changed nx842 reference to nx and moved some code to new functions. Functionality is not changed except sparse warning fix - setting NULL instead of 0 for per_cpu send window in nx_delete_coprocs(). Signed-off-by: Haren Myneni Acked-by: Herbert Xu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114569.2275.1126.camel@hbabu-laptop commit 32e091a668bc8575c1ad6afd616726c60ba6e5d0 Author: Haren Myneni Date: Fri Apr 17 02:03:20 2020 -0700 crypto/nx: Rename nx-842-powernv file name to nx-common-powernv Rename nx-842-powernv.c to nx-common-powernv.c to add code for setup and enable new GZIP compression type. The actual functionality is not changed in this patch. Signed-off-by: Haren Myneni Acked-by: Herbert Xu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114200.2275.1113.camel@hbabu-laptop commit 7673d6568b141f34b4b59232f8de8d484408d2ee Author: Haren Myneni Date: Fri Apr 17 02:02:43 2020 -0700 crypto/nx: Initialize coproc entry with kzalloc coproc entry is initialized during NX probe on power9, but not on P8. nx842_delete_coprocs() is used for both and frees receive window if it is allocated. Getting crash for rmmod on P8 since coproc->vas.rxwin is not initialized. This patch replaces kmalloc with kzalloc in nx842_powernv_probe() Signed-off-by: Haren Myneni Acked-by: Herbert Xu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114163.2275.1110.camel@hbabu-laptop commit dda44eb29c235735a5ceae283dc521cfca27885c Author: Haren Myneni Date: Fri Apr 17 02:02:01 2020 -0700 powerpc/vas: Add VAS user space API On power9, userspace can send GZIP compression requests directly to NX once kernel establishes NX channel / window with VAS. This patch provides user space API which allows user space to establish channel using open VAS_TX_WIN_OPEN ioctl, mmap and close operations. Each window corresponds to file descriptor and application can open multiple windows. After the window is opened, VAS_TX_WIN_OPEN icoctl to open a window on specific VAS instance, mmap() system call to map the hardware address of engine's request queue into the application's virtual address space. Then the application can then submit one or more requests to the the engine by using the copy/paste instructions and pasting the CRBs to the virtual address (aka paste_address) returned by mmap(). Only NX GZIP coprocessor type is supported right now and allow GZIP engine access via /dev/crypto/nx-gzip device node. Thanks to Michael Ellerman for his changes and suggestions to make the ioctl generic to support any coprocessor type. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114121.2275.1109.camel@hbabu-laptop commit 45f25a79fe50f330b563d012fc856a1103cb00d8 Author: Haren Myneni Date: Fri Apr 17 02:01:05 2020 -0700 powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API Define the VAS_TX_WIN_OPEN ioctl interface for NX GZIP access from user space. This interface is used to open GZIP send window and mmap region which can be used by userspace to send requests to NX directly with copy/paste instructions. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114065.2275.1106.camel@hbabu-laptop commit a8c0c69b5e95e8f155480d5203a7bafb8024fd93 Author: Haren Myneni Date: Fri Apr 17 02:00:29 2020 -0700 powerpc/vas: Initialize window attributes for GZIP coprocessor type Initialize send and receive window attributes for GZIP high and normal priority types. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587114029.2275.1103.camel@hbabu-laptop commit c420644c0a8f8839ca7269acbb8a3fc7fe1ec97d Author: Haren Myneni Date: Wed Apr 15 23:08:11 2020 -0700 powerpc: Use mm_context vas_windows counter to issue CP_ABORT set_thread_uses_vas() sets used_vas flag for a process that opened VAS window and issue CP_ABORT during context switch for only that process. In multi-thread application, windows can be shared. For example Thread A can open a window and Thread B can run COPY/PASTE instructions to send NX request which may cause corruption or snooping or a covert channel Also once this flag is set, continue to run CP_ABORT even the VAS window is closed. So define vas-windows counter in process mm_context, increment this counter for each window open and decrement it for window close. If vas-windows is set, issue CP_ABORT during context switch. It means clear the foreign real address mapping only if the process / thread uses COPY/PASTE. Then disable it for that process if windows are not open. Moved set_thread_uses_vas() code to vas_tx_win_open() as this functionality is needed only for userspace open windows. We are adding VAS userspace support along with this fix. So no need to include this fix in stable releases. Fixes: 9d2a4d71332c ("powerpc: Define set_thread_uses_vas()") Signed-off-by: Haren Myneni Reported-by: Nicholas Piggin Suggested-by: Milton Miller Suggested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017291.2275.1077.camel@hbabu-laptop commit 1d955f981895464d8f112179a20bfdb92e6c63d4 Author: Haren Myneni Date: Wed Apr 15 23:07:36 2020 -0700 powerpc/vas: Free send window in VAS instance after credits returned NX may be processing requests while trying to close window. Wait until all credits are returned and then free send window from VAS instance. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017256.2275.1076.camel@hbabu-laptop commit bd4da68dbd5fd2e83841b3500ac575967a948cfa Author: Haren Myneni Date: Wed Apr 15 23:06:59 2020 -0700 powerpc/vas: Display process stuck message Process can not close send window until all requests are processed. Means wait until window state is not busy and send credits are returned. Display debug messages in case taking longer to close the window. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017219.2275.1073.camel@hbabu-laptop commit 04f6296ca7c34cbc78e077518c634cc5c392b3ec Author: Haren Myneni Date: Wed Apr 15 23:05:36 2020 -0700 powerpc/vas: Do not use default credits for receive window System checkstops if RxFIFO overruns with more requests than the maximum possible number of CRBs allowed in FIFO at any time. So max credits value (rxattr.wcreds_max) is set and is passed to vas_rx_win_open() by the the driver. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017136.2275.1070.camel@hbabu-laptop commit cf33e1e9383e1a09f6f3e308ebfbbe1871a19ff8 Author: Haren Myneni Date: Wed Apr 15 23:04:59 2020 -0700 powerpc/vas: Print CRB and FIFO values Dump FIFO entries if could not find send window and print CRB for debugging. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017099.2275.1067.camel@hbabu-laptop commit 461862ef94a88e4b74e177b82bee2c81c6535fae Author: Haren Myneni Date: Wed Apr 15 23:04:19 2020 -0700 powerpc/vas: Return credits after handling fault NX uses credit mechanism to control the number of requests issued on a specific window at any point of time. Only send windows and fault window are used credits. When the request is issued on a given window, a credit is taken. This credit will be returned after that request is processed. If credits are not available, returns RMA_Busy for send window and RMA_Reject for fault window. NX expects OS to return credit for send window after processing fault CRB. Also credit has to be returned for fault window after handling the fault. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017059.2275.1064.camel@hbabu-laptop commit c96c4436aba4c12f1f48369f2f90bc43e12fe36c Author: Haren Myneni Date: Wed Apr 15 23:03:42 2020 -0700 powerpc/vas: Update CSB and notify process for fault CRBs Applications polls on CSB for the status update after requests are issued. NX process these requests and update the CSB with the status. If it encounters translation error, pastes CRB in fault FIFO and raises an interrupt. The kernel handles fault by reading CRB from fault FIFO and process the fault CRB. For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB so that user space can touch the fault address and resend the request. If the user space passed invalid CSB address send signal to process with SIGSEGV. In the case of multi-thread applications, child thread may not be available. So if the task is not running, send signal to tgid. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587017022.2275.1063.camel@hbabu-laptop commit 9774628acf86409771acad6269ad24ea31ddb4b3 Author: Haren Myneni Date: Wed Apr 15 23:03:02 2020 -0700 powerpc/vas: Setup thread IRQ handler per VAS instance When NX encounters translation error on CRB and any request buffer, raises an interrupt on the CPU to handle the fault. It can raise one interrupt for multiple faults. Expects OS to handle these faults and return credits for fault window after processing faults. Setup thread IRQ handler and IRQ thread function per each VAS instance. IRQ handler checks if the thread is already woken up and can handle new faults. If so returns with IRQ_HANDLED, otherwise wake up thread to process new faults. The thread functions reads each CRB entry from fault FIFO until sees invalid entry. After reading each CRB, determine the corresponding send window using pswid (from CRB) and process fault CRB. Then invalidate the entry and return credit. Processing fault CRB and return credit is described in subsequent patches. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016982.2275.1060.camel@hbabu-laptop commit db1c08a7406351673c52594f5c8a65829baf5bf6 Author: Haren Myneni Date: Wed Apr 15 23:02:16 2020 -0700 powerpc/vas: Take reference to PID and mm for user space windows When process opens a window, its pid and tgid will be saved in the vas_window struct. This window will be closed when the process exits. The kernel handles NX faults by updating CSB or send SEGV signal to pid of the process if the userspace csb addr is invalid. In multi-thread applications, a window can be opened by a child thread, but it will not be closed when this thread exits. It is expected that the parent will clean up all resources including NX windows opened by child threads. A child thread can send NX requests using this window and could be killed before completion is reported. If the pid assigned to this thread is reused while requests are pending, a failure SEGV would be directed to the wrong place. To prevent reusing the pid, take references to pid and mm when the window is opened and release them when when the window is closed. Then if child thread is not running, SEGV signal will be sent to thread group leader (tgid). Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016936.2275.1057.camel@hbabu-laptop commit 8b8a73dc7919489b54ccd2772b2948088d3dbe6d Author: Haren Myneni Date: Wed Apr 15 23:01:28 2020 -0700 powerpc/vas: Register NX with fault window ID and IRQ port value For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016888.2275.1054.camel@hbabu-laptop commit 0d17de03ce6a7a9b08c868211f1e9a7cf1ced8c4 Author: Haren Myneni Date: Wed Apr 15 23:00:46 2020 -0700 powerpc/vas: Setup fault window per VAS instance Setup fault window for each VAS instance. When NX gets a fault on request buffer, pastes fault CRB in the corresponding fault FIFO and then raises an interrupt to the OS. The kernel handles this fault and process faults CRB from this FIFO. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016846.2275.1053.camel@hbabu-laptop commit c20e1e299d936c7f3089c9be99fa784e57da5b7f Author: Haren Myneni Date: Wed Apr 15 23:00:06 2020 -0700 powerpc/vas: Alloc and setup IRQ and trigger port address Allocate a xive irq on each chip with a vas instance. The NX coprocessor raises a host CPU interrupt via vas if it encounters page fault on user space request buffer. Subsequent patches register the trigger port with the NX coprocessor, and create a vas fault handler for this interrupt mapping. Signed-off-by: Haren Myneni Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016806.2275.1050.camel@hbabu-laptop commit 73a8077938824bf13dd9b8557545be91012ffc9c Author: Haren Myneni Date: Wed Apr 15 22:59:29 2020 -0700 powerpc/vas: Define nx_fault_stamp in coprocessor_request_block Kernel sets fault address and status in CRB for NX page fault on user space address after processing page fault. User space gets the signal and handles the fault mentioned in CRB by bringing the page in to memory and send NX request again. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016769.2275.1048.camel@hbabu-laptop commit 8d0ea29db5aefd0d94fa4b6ca6124c68998f3c6a Author: Haren Myneni Date: Wed Apr 15 22:58:40 2020 -0700 powerpc/xive: Define xive_native_alloc_irq_on_chip() This function allocates IRQ on a specific chip. VAS needs per chip IRQ allocation and will have IRQ handler per VAS instance. Signed-off-by: Haren Myneni Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1587016720.2275.1047.camel@hbabu-laptop commit b4ed131dbfb6d345e1e5f7cc65358e11ab46f10d Author: Jani Nikula Date: Fri Apr 17 09:51:32 2020 +0300 drm/i915/audio: error log non-zero audio power refcount after unbind We have some module unload/reload tests hitting an issue with i915 unbinding the component interface before the audio driver has properly put the power. Log an error about it for ease of debugging. (Normally this leads to a wakeref debug splat on the power well.) Cc: Kai Vehmanen Reviewed-by: Kai Vehmanen Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200417065132.23048-1-jani.nikula@intel.com commit 27be41de45a70fe1cb0ae1cbd2fd6da1ce3ffe9a Author: Jani Nikula Date: Fri Apr 17 16:01:09 2020 +0300 drm/i915: fix Sphinx build duplicate label warning Fix the warning caused by enabling the autosectionlabel extension in the kernel Sphinx build: Documentation/gpu/i915.rst:610: WARNING: duplicate label gpu/i915:layout, other instance in Documentation/gpu/i915.rst The autosectionlabel extension adds labels to each section title for cross-referencing, but forbids identical section titles in a document. With kernel-doc, this includes sections titles in the included kernel-doc comments. In the warning message, Sphinx is unable to reference the labels in their true locations in the kernel-doc comments in source. In this case, there's "Layout" sections in both gt/intel_workarounds.c and i915_reg.h. Rename the section in the latter to "File Layout". Fixes: 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst") Reviewed-by: Chris Wilson Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200417130109.12791-1-jani.nikula@intel.com commit 704887278b3fb6e72ef767e56fbae4129e567c48 Author: Stephen Boyd Date: Thu Apr 16 17:06:45 2020 -0700 soc: qcom: cmd-db: Properly endian swap the slv_id for debugfs Read the slv_id properly by making sure the 16-bit number is endian swapped from little endian to CPU native before we read it to figure out what to print for the human readable name. Otherwise we may just show that all the elements in the cmd-db are "Unknown" which isn't right. Reviewed-by: Guenter Roeck Reported-by: kbuild test robot Cc: Lina Iyer Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20200417000645.234693-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson commit 3adaf26e7b01691eeee4086b7ac70c7750ff126e Author: Stephen Boyd Date: Wed Apr 15 12:29:16 2020 -0700 soc: qcom: cmd-db: Use 5 digits for printing address The top few bits aren't relevant to pad out because they're always zero. Let's just print 5 digits instead of 8 so that it's a little shorter and more readable. Reviewed-by: Lina Iyer Suggested-by: Lina Iyer Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20200415192916.78339-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson commit 9d6ba921acf43bf1894564eb3d51ced2145e0147 Author: Stephen Boyd Date: Tue Apr 14 23:20:33 2020 -0700 soc: qcom: cmd-db: Cast sizeof() to int to silence field width warning We pass the result of sizeof() here to tell the printk format specifier how many bytes to print. That expects an int though and sizeof() isn't that type. Cast to int to silence this warning: drivers/soc/qcom/cmd-db.c: In function 'cmd_db_debugfs_dump': drivers/soc/qcom/cmd-db.c:281:30: warning: field width specifier '*' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] Reviewed-by: Guenter Roeck Fixes: d6815c5c43d4 ("soc: qcom: cmd-db: Add debugfs dumping file") Reported-by: Stephen Rothwell Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20200415062033.66406-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson commit 3898fc99d199346348b3efe1f6657b9eb7fa56cd Author: Clement Leger Date: Fri Apr 10 12:24:33 2020 +0200 remoteproc: use rproc_coredump_set_elf_info in drivers Modify drivers which are using remoteproc coredump functionality to use rproc_coredump_set_elf_info in order to create correct elf coredump format. Reviewed-by: Bjorn Andersson Reviewed-by: Mathieu Poirier Signed-off-by: Clement Leger Link: https://lore.kernel.org/r/20200410102433.2672-3-cleger@kalray.eu Signed-off-by: Bjorn Andersson commit 418fd78771220f5e522d02676758ed824c349fd5 Author: Clement Leger Date: Fri Apr 10 12:24:32 2020 +0200 remoteproc: add rproc_coredump_set_elf_info This function allows drivers to correctly setup the coredump output elf information. Reviewed-by: Bjorn Andersson Reviewed-by: Mathieu Poirier Signed-off-by: Clement Leger Link: https://lore.kernel.org/r/20200410102433.2672-2-cleger@kalray.eu Signed-off-by: Bjorn Andersson commit 4df4f8be8b3e9ce807ba47c030893d711abe6ee3 Author: Mathieu Poirier Date: Wed Apr 15 14:48:54 2020 -0600 remoteproc: Simplify default name allocation In an effort to cleanup firmware name allocation, replace the cumbersome mechanic used to allocate a default firmware name with function kasprintf(). Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Suggested-by: Bjorn Andersson Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200415204858.2448-4-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit 0c2ae2b1afdfffa5e485614569d2ff12dee97fc5 Author: Mathieu Poirier Date: Wed Apr 15 14:48:53 2020 -0600 remoteproc: Split firmware name allocation from rproc_alloc() Make the firmware name allocation a function on its own in an effort to cleanup function rproc_alloc(). Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200415204858.2448-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit 6442df49400b466431979e7634849a464a5f1861 Author: Alex Elder Date: Wed Apr 15 14:48:52 2020 -0600 remoteproc: Fix IDR initialisation in rproc_alloc() If ida_simple_get() returns an error when called in rproc_alloc(), put_device() is called to clean things up. By this time the rproc device type has been assigned, with rproc_type_release() as the release function. The first thing rproc_type_release() does is call: idr_destroy(&rproc->notifyids); But at the time the ida_simple_get() call is made, the notifyids field in the remoteproc structure has not been initialized. I'm not actually sure this case causes an observable problem, but it's incorrect. Fix this by initializing the notifyids field before calling ida_simple_get() in rproc_alloc(). Fixes: b5ab5e24e960 ("remoteproc: maintain a generic child device for each rproc") Signed-off-by: Alex Elder Reviewed-by: Mathieu Poirier Reviewed-by: Suman Anna Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200415204858.2448-2-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson commit 2592677c0486e64a08e0b930a7dfa6fbf77e6fc1 Author: Roberto Sassu Date: Wed Mar 25 11:54:24 2020 +0100 ima: Use ima_hash_algo for collision detection in the measurement list Before calculating a digest for each PCR bank, collisions were detected with a SHA1 digest. This patch includes ima_hash_algo among the algorithms used to calculate the template digest and checks collisions on that digest. The position in the measurement entry array of the template digest calculated with the IMA default hash algorithm is stored in the ima_hash_algo_idx global variable and is determined at IMA initialization time. Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 1ea973df6e2166d1a576cabe5d08925d3261ff9d Author: Roberto Sassu Date: Wed Mar 25 11:53:50 2020 +0100 ima: Calculate and extend PCR with digests in ima_template_entry This patch modifies ima_calc_field_array_hash() to calculate a template digest for each allocated PCR bank and SHA1. It also passes the tpm_digest array of the template entry to ima_pcr_extend() or in case of a violation, the pre-initialized digests array filled with 0xff. Padding with zeros is still done if the mapping between TPM algorithm ID and crypto ID is unknown. This patch calculates again the template digest when a measurement list is restored. Copying only the SHA1 digest (due to the limitation of the current measurement list format) is not sufficient, as hash collision detection will be done on the digest calculated with the IMA default hash algorithm. Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 6d94809af6b0830c4dfcad661535a5939bcb8a7d Author: Roberto Sassu Date: Wed Mar 25 11:52:48 2020 +0100 ima: Allocate and initialize tfm for each PCR bank This patch creates a crypto_shash structure for each allocated PCR bank and for SHA1 if a bank with that algorithm is not currently allocated. Reported-by: kbuild test robot Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit aa724fe18a8a8285d0071c3bfc932efb090d142d Author: Roberto Sassu Date: Wed Mar 25 11:47:09 2020 +0100 ima: Switch to dynamically allocated buffer for template digests This patch dynamically allocates the array of tpm_digest structures in ima_alloc_init_template() and ima_restore_template_data(). The size of the array is equal to the number of PCR banks plus ima_extra_slots, to make room for SHA1 and the IMA default hash algorithm, when PCR banks with those algorithms are not allocated. Calculating the SHA1 digest is mandatory, as SHA1 still remains the default hash algorithm for the measurement list. When IMA will support the Crypto Agile format, remaining digests will be also provided. The position in the measurement entry array of the SHA1 digest is stored in the ima_sha1_idx global variable and is determined at IMA initialization time. Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 7ca79645a1f8837c3850b881a2c0b43cfba5dc36 Author: Roberto Sassu Date: Wed Mar 25 11:47:08 2020 +0100 ima: Store template digest directly in ima_template_entry In preparation for the patch that calculates a digest for each allocated PCR bank, this patch passes to ima_calc_field_array_hash() the ima_template_entry structure, so that digests can be directly stored in that structure instead of ima_digest_data. Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit e144d6b265415ddbdc54b3f17f4f95133effa5a8 Author: Roberto Sassu Date: Wed Mar 25 11:47:07 2020 +0100 ima: Evaluate error in init_ima() Evaluate error in init_ima() before register_blocking_lsm_notifier() and return if not zero. Cc: stable@vger.kernel.org # 5.3.x Fixes: b16942455193 ("ima: use the lsm policy update notifier") Signed-off-by: Roberto Sassu Reviewed-by: James Morris Signed-off-by: Mimi Zohar commit 6f1a1d103b48b1533a9c804e7a069e2c8e937ce7 Author: Roberto Sassu Date: Wed Mar 25 11:47:06 2020 +0100 ima: Switch to ima_hash_algo for boot aggregate boot_aggregate is the first entry of IMA measurement list. Its purpose is to link pre-boot measurements to IMA measurements. As IMA was designed to work with a TPM 1.2, the SHA1 PCR bank was always selected even if a TPM 2.0 with support for stronger hash algorithms is available. This patch first tries to find a PCR bank with the IMA default hash algorithm. If it does not find it, it selects the SHA256 PCR bank for TPM 2.0 and SHA1 for TPM 1.2. Ultimately, it selects SHA1 also for TPM 2.0 if the SHA256 PCR bank is not found. If none of the PCR banks above can be found, boot_aggregate file digest is filled with zeros, as for TPM bypass, making it impossible to perform a remote attestation of the system. Cc: stable@vger.kernel.org # 5.1.x Fixes: 879b589210a9 ("tpm: retrieve digest size of unknown algorithms with PCR read") Reported-by: Jerry Snitselaar Suggested-by: James Bottomley Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 093b8494f2992e58c2bef6fc26c7e11464ad415a Author: Takashi Iwai Date: Sun Apr 19 23:21:34 2020 +0200 ALSA: usb-audio: Print more information in stream proc files For more debug and usability information, add the entry showing the DSD raw states and the channel mapping in each stream proc file. Link: https://lore.kernel.org/r/20200419212134.14200-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 949b922e8b1b2bebfec90c68edd888723ab8bc23 Author: Andre Guedes Date: Wed Mar 18 16:01:02 2020 -0700 igc: Add debug messages to MAC filter code This patch adds log messages to functions related to the MAC address filtering code to ease debugging. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 5f930713728b5551f5c07b918cc8030dacb75fe1 Author: Andre Guedes Date: Wed Mar 18 16:01:01 2020 -0700 igc: Refactor igc_del_mac_filter() This patch does a code refactoring in igc_del_mac_filter() so it uses the new helper igc_find_mac_filter() and improves the comment about the special handling when deleting the default filter. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 794e5bc817bcc16ca955691e957e23908edbef9c Author: Andre Guedes Date: Wed Mar 18 16:01:00 2020 -0700 igc: Refactor igc_mac_entry_can_be_used() The helper igc_mac_entry_can_be_used() implementation is a bit convoluted since it does two different things: find a not-in-use slot in mac_table or find an in-use slot where the address and address type match. This patch does a code refactoring and break it up into two helper functions. With this patch we might traverse mac_table twice in some situations, but this is not harmful performance-wise (mac_table has only 16 entries and adding mac filters is not hot-path), and it improves igc_add_mac_ filter() readability considerably. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 83ba21b9ef7706413bdaf9fa8357b93c4986d8a0 Author: Andre Guedes Date: Wed Mar 18 16:00:59 2020 -0700 igc: Remove igc_*_mac_steering_filter() wrappers With the previous two patches, igc_add_mac_steering_filter() and igc_del_mac_steering_filter() became a pointless wrapper of igc_add_mac_filter() and igc_del_mac_filter(). This patch removes these wrappers and update callers to call igc_add_mac_filter() and igc_del_mac_filter() directly. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit e9736fa407e53224e9f23a092b17d8f2d1eb705d Author: Andre Guedes Date: Wed Apr 1 14:43:58 2020 -0700 igc: Remove IGC_MAC_STATE_QUEUE_STEERING The IGC_MAC_STATE_QUEUE_STEERING bit in mac_table[i].state is utilized to indicate that frames matching the filter are assigned to mac_table[i].queue. This bit is not strictly necessary since we can convey the same information as follows: queue == -1 means queue assignment is disabled, otherwise it is enabled. In addition to make the code simpler, this change fixes some awkward situations where we pass a complete misleading 'queue' value such as in igc_uc_sync(). So this patch removes IGC_MAC_STATE_QUEUE_STEERING and also takes the opportunity to improve the igc_add_mac_filter documentation. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit c6aae5917b8a244dcb4114be806ba3ac52e3480a Author: Andre Guedes Date: Wed Apr 1 14:41:43 2020 -0700 igc: Remove 'queue' check in igc_del_mac_filter() igc_add_mac_filter() doesn't allow us to have more than one entry with the same address and address type in adapter->mac_table so checking if 'queue' matches in igc_del_mac_filter() isn't necessary. This patch removes that check. This patch also takes the opportunity to improve the igc_del_mac_filter documentation and remove comment which is not applicable to this I225 controller. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit a73eb651005eef079a6bf3b448d1b6eb607bc80b Author: Andre Guedes Date: Wed Mar 18 16:00:56 2020 -0700 igc: Improve address check in igc_del_mac_filter() igc_add_mac_filter() doesn't allow filters with invalid MAC address to be added to adapter->mac_table so, in igc_del_mac_filter(), we can early return if MAC address is invalid. No need to traverse the table. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 424045bec085575fe4818428e6a68dac7cca48f3 Author: Andre Guedes Date: Wed Apr 1 14:36:45 2020 -0700 igc: Refactor igc_rar_set_index() Current igc_rar_set_index() implementation is a bit convoluted so this patch does some code refactoring to improve it. The helper igc_rar_set_index() is about writing MAC filter settings into hardware registers. Logic such as address validation belongs to functions upper in the call chain such as igc_set_mac() and igc_add_mac_filter(). So this patch moves the is_valid_ether_addr() call to igc_add_mac_filter(). No need to touch igc_set_mac() since it already checks it. The variables 'rar_low' and 'rar_high' represent the value in registers RAL and RAH so we rename them to 'ral' and 'rah', respectively, to match the registers names. To make it explicit, filter settings are passed as arguments to the function instead of reading them from adapter->mac_table "under the hood". Also, the function was renamed to igc_set_mac_filter_hw to make it more clear what it does. Finally, the patch removes some wrfl() calls and comments not needed. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit ec00f1090735259151568f6b74d19c3230d65787 Author: Andre Guedes Date: Wed Mar 18 16:00:54 2020 -0700 igc: Fix igc_uc_unsync() In case igc_del_mac_filter() returns error, that error is masked since the functions always return 0 (success). This patch fixes igc_uc_unsync() so it returns whatever value igc_del_mac_filter() returns (0 on success, negative number on error). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 58184b8ff0786b219772016a50ce07c6b3020846 Author: Andre Guedes Date: Wed Mar 18 16:00:53 2020 -0700 igc: Change igc_add_mac_filter() returning value In case of success, igc_add_mac_filter() returns the index in adapter->mac_table where the requested filter was added. This information, however, is not used by any caller of that function. In fact, callers have extra code just to handle this returning index as 0 (success). So this patch changes the function to return 0 on success instead, and cleans up the extra code. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 23b7b511675669702ad32bf7f92dcf2ae05015ba Author: Andre Guedes Date: Wed Mar 18 16:00:52 2020 -0700 igc: Check unsupported flag in igc_add_mac_filter() The IGC_MAC_STATE_SRC_ADDR flags is not supported by igc_add_mac_ filter() so this patch adds a check for it and returns -ENOTSUPP in case it is set. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 0c2e060859aa1cb8b13376554d802a251f750fa9 Author: Andre Guedes Date: Wed Mar 18 16:00:51 2020 -0700 igc: Remove duplicate code in MAC filtering logic This patch does a code refactoring in the MAC address filtering logic to get rid of some duplicate code. IGC driver has two functions to add MAC address filters that are pretty much the same: igc_add_mac_filter() and igc_add_mac_filter_flags(). The only difference is that the latter allows the callee to specify the 'flags' parameter while the former has it hard coded as zero. The same rationale applies to filter deletion counterparts. So this patch refactors igc_add_mac_filter() and igc_del_mac_filter() so they handle the 'flags' parameters, removes the _flags() functions, and fixes callees accordingly. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 632fbd5eb5b0e01f03f1acb90a2b9ac1352b5dc7 Author: Vitaly Lifshits Date: Thu Mar 12 13:57:07 2020 +0200 e1000e: fix S0ix flows for cable connected case Added a fix to S0ix entry and exit flows for TGP and above MAC types, to the case when the Ethernet cable is connected and the link is up. With that the system is able to reach SLP_S0 when going to freeze power state. Signed-off-by: Vitaly Lifshits Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit c2a3f8febc69f222d9fc3248bf774c8f0c5725f3 Author: Sasha Neftin Date: Wed Mar 11 11:35:06 2020 +0200 igc: Add new device IDs for i225 part Add new device IDs for the next step of i225 Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 4ea8391e3556ad08ff0ea8fb282f9a550b8a3333 Author: Linus Walleij Date: Sat Apr 18 13:40:09 2020 -0700 Input: delete unused GP2AP002A00F driver There is now an IIO driver for GP2AP002A00F and GP2AP002S00F in drivers/iio/light/gp2ap002.c. Delete this driver, it is unused in the kernel tree and new users can make use of the IIO driver. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200417203059.8151-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 2de8c02349f02d014e51b43f306d28fc7a23ea6e Author: Dmitry Osipenko Date: Sat Apr 18 20:12:44 2020 +0300 iio: magnetometer: ak8974: Silence deferred-probe error It's not uncommon that voltage regulator becomes available later during kernel's boot process. This patch adds info message about unavailable regulators in a case of the deferred-probe error and also amends the error message with a error code. Signed-off-by: Dmitry Osipenko Signed-off-by: Jonathan Cameron commit aa8cb0485594d8b3c9bfe7f4427b3ae26187c861 Author: Guido Günther Date: Sun Apr 5 15:50:32 2020 +0200 Documentation: ABI: document IIO in_proximity_nearlevel file The vcnl4000 IIO driver introduced a new attribute "in_proximity_nearlevel". This adds it to the list of documented ABI for sysfs-bus-iio. Signed-off-by: Guido Günther Signed-off-by: Jonathan Cameron commit f5a98e1fca15cbf79f50098ea30e84ce33da2fd6 Author: Guido Günther Date: Sun Apr 5 15:50:31 2020 +0200 iio: vcnl4000: Export near level property for proximity sensor When an object can be considered close to the sensor is hardware dependent. Allowing to configure the property via device tree allows to configure this device specific value. This is useful for e.g. iio-sensor-proxy to indicate to userspace if an object is close to the sensor. Signed-off-by: Guido Günther Signed-off-by: Jonathan Cameron commit 138986062b50e7e24404e279d2e2c79c0291dac3 Author: Guido Günther Date: Sun Apr 5 15:50:30 2020 +0200 dt-bindings: iio: light: vcnl4000: Add proximity-near-level This value indicates when userspace should consider an object near to the sensor/device. Signed-off-by: Guido Günther Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 445b16fb6bdc2cd3086a8d9018b4f325c89faa24 Author: Guido Günther Date: Sun Apr 5 15:50:29 2020 +0200 dt-bindings: iio: Introduce common properties for iio sensors Introduce a file for common properties of iio sensors. So far this contains the new proximity-near-level property for proximity sensors that indicates when an object should be considered near. Signed-off-by: Guido Günther Signed-off-by: Jonathan Cameron commit c194e2389d99be2fc69811693775b81f9ab88f6c Author: Guido Günther Date: Sun Apr 5 15:50:28 2020 +0200 dt-bindings: iio: vcnl4000: convert bindings to YAML format Convert the vcnl4000 device tree bindings to the new YAML format. Signed-off-by: Guido Günther Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 8cba4a9927df08c3bf7037e90692699e4152fa00 Author: Geert Uytterhoeven Date: Thu Apr 16 12:30:56 2020 +0200 iio: Fix misspellings of "Analog Devices" According to https://www.analog.com/, the company name is spelled "Analog Devices". Signed-off-by: Geert Uytterhoeven Reviewed-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 9b7a12c3e090cf3fba6f66f1f23abbc6e0e86021 Author: Alexandru Ardelean Date: Wed Mar 4 10:24:25 2020 +0200 iio: light: isl29125: fix iio_triggered_buffer_{predisable,postenable} positions The iio_triggered_buffer_{predisable,postenable} functions attach/detach the poll functions. For the predisable hook, the disable code should occur before detaching the poll func, and for the postenable hook, the poll func should be attached before the enable code. This change reworks the predisable/postenable hooks so that the pollfunc is attached/detached in the correct position. It also balances the calls a bit, by grouping the preenable and the iio_triggered_buffer_postenable() into a single isl29125_buffer_postenable() function. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 587122cb8b43421ce7b90a2a3f07eb0c498da2a6 Author: Aishwarya Ramakrishnan Date: Sun Apr 12 19:20:20 2020 +0530 iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. It reduces boilerplate and suggested by coccinelle. Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: Jonathan Cameron commit af5c2174ca6d9eb5d31a36fb057bbcf2aaac6f6c Author: Aishwarya Ramakrishnan Date: Sun Apr 12 19:26:42 2020 +0530 iio: adc: at91-adc: Use devm_platform_ioremap_resource Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. It reduces boilerplate and suggested by coccinelle. Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: Jonathan Cameron commit fd1cadd6ca30dda7e9acdf501adbf33a12f0c2fd Author: Aishwarya Ramakrishnan Date: Sun Apr 12 20:02:18 2020 +0530 iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Reduces boilerplate and suggested by coccinelle. Signed-off-by: Aishwarya Ramakrishnan Signed-off-by: Jonathan Cameron commit 5372e1e5b4c8cc3c10295224b3d116d5625930a7 Author: Jonathan Cameron Date: Sun Apr 5 19:03:21 2020 +0100 iio:light:ltr501: Drop unnecessary cast of parameter in regmap_bulk_read This only occurs once in the driver and isn't needed in this case either, so drop it. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean Reviewed-by: Andy Shevchenko commit 06c482605b13626e3ca3e5adf48611ebf0e883d1 Author: Jonathan Cameron Date: Sun Apr 5 19:03:20 2020 +0100 iio:magn:mmc35240: Drop unnecessary casts of val parameter in regmap_bulk* Given the parameter is void *, casting to u8 * is unnecessary. Signed-off-by: Jonathan Cameron Cc: Daniel Baluta Reviewed-by: Alexandru Ardelean Reviewed-by: Andy Shevchenko commit d7d3a1327b8a90c826bd1dd9bdf2d5ccb969b6b6 Author: Jonathan Cameron Date: Sun Apr 5 19:03:19 2020 +0100 iio:imu:mpu6050: Tidy up parameters to regmap_bulk functions. A mixture of: * Casts to u8 * for the val parameter which is void * and so needs no cast. * Explicit sizes when we can use sizeof on the destination / source variable. Not broken in anyway, I'm just trying to tidy up the is in the subsystem to avoid it getting cut and paste into new drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean Reviewed-by: Andy Shevchenko commit ce968fb6f97cd69d8321e188f3d820e5f7aca8d1 Author: Jonathan Cameron Date: Sun Apr 5 19:03:18 2020 +0100 iio:chemical:bme680: Tidy up parameters to regmap_bulk_read A mixture of: * Unnecessary casts of val parameter to u8 * which makes little sense as the function take a void *. * Explicit sizes where we can use the destination type to define that. Note that's not true in all cases as we do read 3 bytes into 4 byte destinations. Note that noting was broken here, I'm just trying to ensure this doesn't get cut and paste into more drivers so cleaning these out subsystem wide. Signed-off-by: Jonathan Cameron Acked-by: Himanshu Jha Reviewed-by: Andy Shevchenko Reviewed-by: Alexandru Ardelean commit 0f92afee81ec63c015d2d5c2391a3024a6c277ea Author: Jonathan Cameron Date: Sun Apr 5 19:03:17 2020 +0100 iio:chemical:atlas-sensor: Drop unnecessary explicit casts in regmap_bulk_read calls regmap_bulk_read takes a void * for its val parameter. It certainly makes no sense to cast to a (u8 *) + no need to explicitly cast at all when converting another pointer type to void *. Signed-off-by: Jonathan Cameron Acked-by: Matt Ranostay Reviewed-by: Andy Shevchenko Reviewed-by: Alexandru Ardelean commit b01401a228bc4997b0d4bcb669fced448f7a15ca Author: Jonathan Cameron Date: Sun Apr 5 19:03:16 2020 +0100 iio:accel:mxc4005: Drop unnecessary explicit casts in regmap_bulk_read calls regmap_bulk_read takes a void * for its val parameter. It certainly makes no sense to cast to a (u8 *) + no need to explicitly cast at all when converting another pointer type to void *. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean Reviewed-by: Andy Shevchenko commit 780f1c176140d04447ecce8466b8d56c77cb9f7a Author: Lorenzo Bianconi Date: Mon Apr 6 21:00:25 2020 +0200 iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver st_lsm6dsx is a standalone driver for STM IMU sensors and does not rely on st_sensor common framework, so it does not include st_sensor common definitions. In st_lsm6dsx_shub driver st_sensors.h is used just to introduce the default wai address for LIS3MDL sensor. Drop this largely unconnected include file and introduce the default wai address for LIS3MDL in st_lsm6dsx_ext_dev_settings register map Reviewed-by: Andy Shevchenko Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron commit 608d98a2c4a0a72c15fa16ef1542df67afe41fee Author: Alexandru Ardelean Date: Thu Feb 27 15:52:27 2020 +0200 iio: buffer: drop devm_iio_kfifo_free() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 05c09e3cee0aa97a51c2eac1a2f453cac0ba5683 Author: Alexandru Ardelean Date: Thu Feb 27 15:52:26 2020 +0200 iio: buffer: drop devm_iio_hw_consumer_free() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit fc1f75a0347aecc8b967c8c154564f520d6f4412 Author: Alexandru Ardelean Date: Thu Feb 27 15:52:25 2020 +0200 iio: inkern: drop devm_iio_channel_release{_all} API calls It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 92b7ed7fe40dd26de62ff8f5aa1605909a14e3ef Author: Alexandru Ardelean Date: Thu Feb 27 15:52:24 2020 +0200 iio: core: drop devm_iio_trigger_free() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 83381c9803a00d534f32ab52ed91588601eba43f Author: Alexandru Ardelean Date: Thu Feb 27 15:52:23 2020 +0200 iio: core: drop devm_iio_trigger_unregister() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 66be392a48f9d5256b4ba582ff06303fe97b5ca2 Author: Alexandru Ardelean Date: Thu Feb 27 15:52:22 2020 +0200 iio: core: drop devm_iio_device_free() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. This is the last user of 'devm_iio_device_match()', so it can be removed as well in this patch. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 666e4de43d942fbe0d7f1d9dbc993f5b5c81760c Author: Alexandru Ardelean Date: Thu Feb 27 15:52:21 2020 +0200 iio: core: drop devm_iio_triggered_buffer_cleanup() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 83af573e980aafa7edf56a449a6e70f6c8ac9792 Author: Alexandru Ardelean Date: Thu Feb 27 15:52:20 2020 +0200 iio: core: drop devm_iio_device_unregister() API call It's unused so far, so it can be removed. Also makes sense to remove it to discourage weird uses of this call during review. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit a17cb784fcd7d54b8bca9792d83e5a7516d73d4e Author: Alexandru Ardelean Date: Tue Apr 7 18:07:43 2020 +0300 iio: move 'indio_dev->info' null check first in __iio_device_register() Moves this to be the first check, as it's very simple and fails the registration earlier, instead of potentially initializing the 'indio_dev->label' and checking for duplicate indexes, and then failing with this simple-check. This is a minor optimization, since '__iio_device_register()' will waste fewer validation cycles in case 'indio_dev->info' is NULL. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 2e036804d773e00ea19c6f6b8b7a4b8232c77da1 Author: Alexandru Ardelean Date: Fri Apr 10 12:36:07 2020 +0300 iio: buffer: remove 'scan_el_attrs' attribute group from buffer struct This field doesn't seem used. It seems that only 'buffer->attrs' was ever used to extend sysfs attributes for an IIO buffer. Moving forward, it may not make sense to keep it. This patch removes the field and it's initialization code. Since we want to rework IIO buffer, to be able to add more buffers per IIO device, we will merge [somehow] the 'buffer' & 'scan_elements' groups, and we will continue to add the attributes to the 'buffer' group. Removing it here, will also make the rework here a bit smaller, since this code will not be present. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 97f1755ee227f6bef186e1d2166e50097c7f7e4f Author: Christophe JAILLET Date: Fri Apr 10 19:12:24 2020 +0200 iio: imu: adis: Add a missing '\n' in a log message Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 1fd456702692 ("iio: imu: adis: add support product ID check in adis_initial_startup") Signed-off-by: Christophe JAILLET Signed-off-by: Jonathan Cameron commit 903b6a07d95b28d06b6b2d1bd0fabd1a83c93aa6 Author: Lars-Peter Clausen Date: Fri Apr 3 15:27:17 2020 +0200 iio: xilinx-xadc: Fix typo Fix a typo. 'at the a time' -> 'at a time'. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron commit a630117f2553adde1ad31bb9ab647020a1a75f5e Author: Johan Jonker Date: Sat Apr 4 12:27:30 2020 +0200 dt-bindings: iio: adc: rockchip-saradc: add description for px30 The description below is already in use for px30.dtsi, but was somehow never added to a document, so add "rockchip,px30-saradc", "rockchip,rk3399-saradc" for saradc nodes on a px30 platform to rockchip-saradc.yaml. Signed-off-by: Johan Jonker Acked-by: Rob Herring Signed-off-by: Jonathan Cameron commit 221f7b4fea8d31adf8f455c2c0b07ab67099bfa5 Author: Johan Jonker Date: Sat Apr 4 12:27:29 2020 +0200 dt-bindings: iio: adc: rockchip-saradc: add description for rk3308 The description below is already in use for rk3308.dtsi, but was somehow never added to a document, so add "rockchip,rk3308-saradc", "rockchip,rk3399-saradc" for saradc nodes on a rk3308 platform to rockchip-saradc.yaml. Signed-off-by: Johan Jonker Acked-by: Rob Herring Signed-off-by: Jonathan Cameron commit 4647caae68e80b9e902b03e521ec7d8e1c39c48f Author: Johan Jonker Date: Sat Apr 4 12:27:28 2020 +0200 dt-bindings: iio: adc: convert rockchip saradc bindings to yaml Current dts files with 'saradc' nodes are manually verified. In order to automate this process rockchip-saradc.txt has to be converted to yaml. Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit c0ae3591d900c0d1a54a86666c2102dd39b3d4f7 Author: Lars-Peter Clausen Date: Wed Apr 1 18:57:06 2020 +0200 iio: dma-buffer: Cleanup buffer.h/buffer_impl.h includes The IIO DMA buffer is a DMA buffer implementation. As such it should include buffer_impl.h rather than buffer.h. The include to buffer.h in buffer-dma.h should be buffer_impl.h so it has access to the struct iio_buffer definition. The code currently only works because all places that use buffer-dma.h include buffer_impl.h before it. The include to buffer.h in industrialio-buffer-dma.c can be removed since those file does not reference any of buffer consumer functions. Signed-off-by: Lars-Peter Clausen Tested-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 8a80a71d9020b0066cb035e7cedfc26334a2aa44 Author: Alexandru Lazar Date: Fri Apr 3 15:13:23 2020 +0300 iio: adc: Add MAX1241 driver Add driver for the Maxim MAX1241 12-bit, single-channel ADC. Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX1240-MAX1241.pdf Reviewed-by: Alexandru Ardelean Signed-off-by: Alexandru Lazar Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit fc20a26a2188a78f714bcb5e0f32357415aff86d Author: Alexandru Lazar Date: Fri Apr 3 15:13:22 2020 +0300 dt-bindings: iio: adc: Add MAX1241 bindings Add device-tree bindings documentation for the MAX1241 device driver. Signed-off-by: Alexandru Lazar Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 3f4a559bb57c386a12f568896c2920a37ca10239 Author: Gaëtan André Date: Mon Mar 30 16:19:23 2020 +0200 iio: accel: st_sensors: add support for LIS2HH12 Add support for STMicroelectronics LISHH12 accelerometer in st_accel framework. https://www.st.com/resource/en/datasheet/lis2hh12.pdf Signed-off-by: Gaëtan André Reviewed-by: Stephan Gerhold Signed-off-by: Jonathan Cameron commit 9e3fbad5bb85f6bf159b0ea9b9fe963ce3052a31 Author: Gaëtan André Date: Mon Mar 30 16:19:22 2020 +0200 dt-bindings: st_sensors: add st,lis2hh12 compatible entry Add LIS2HH12 compatible entry. Signed-off-by: Gaëtan André Signed-off-by: Jonathan Cameron commit 394dedec7746a32dff2fa47e3acf9be13fe5fe62 Author: Jimmy Assarsson Date: Sat Mar 28 19:45:19 2020 +0100 iio: imu: st_lsm6dsx: Add sensor hub device LIS3MDL Add LIS3MDL register map to sensor hub device table. Tested with LSM6DSM. Signed-off-by: Jimmy Assarsson Signed-off-by: Jonathan Cameron commit a0e35e2416c719fab456ac0ad2239d8833e89678 Author: Jimmy Assarsson Date: Tue Mar 24 22:52:25 2020 +0100 iio: imu: st_lsm6dsx: Increase ODR_LIST_SIZE Support for sensor with up to 8 different ODR settings. Required for supporting LIS3MDL as sensor hub slave device. Signed-off-by: Jimmy Assarsson Signed-off-by: Jonathan Cameron commit 2ca73823d05d654cb6d21bd0b045dfa382fb9c83 Author: Rohit Sarkar Date: Tue Mar 31 17:17:31 2020 +0530 iio: imu: adis16460: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE debugfs_create_file_unsafe does not protect the fops handed to it against file removal. DEFINE_DEBUGFS_ATTRIBUTE makes the fops aware of the file lifetime and thus protects it against removal. Signed-off-by: Rohit Sarkar Tested-by Nuno Sá Signed-off-by: Jonathan Cameron commit ae1d37a9bb4bd8d9091a40d153143e99b115ee37 Author: Rohit Sarkar Date: Tue Mar 31 17:17:30 2020 +0530 iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE debugfs_create_file_unsafe does not protect the fops handed to it against file removal. DEFINE_DEBUGFS_ATTRIBUTE makes the fops aware of the file lifetime and thus protects it against removal. Signed-off-by: Rohit Sarkar Tested-by Nuno Sá Signed-off-by: Jonathan Cameron commit 4ab717d9e8bdc14ce9f76d1417bc5873c4f493a1 Author: Lorenzo Bianconi Date: Thu Mar 19 22:02:45 2020 +0100 iio: imu: st_lsm6dsx: configure full scale on slave device if supported Introduce st_lsm6dsx_shub_set_full_scale routine in order to configure the i2c slave device sensitivity Tested-by: Jimmy Assarsson Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron commit 9601c94d9419eb1349c6c8bf47d438f5ee488243 Author: Fabrice Gasnier Date: Thu Mar 19 18:46:23 2020 +0100 dt-bindings: iio: dac: stm32-dac: convert bindings to json-schema Convert the STM32 DAC binding to DT schema format using json-schema Signed-off-by: Fabrice Gasnier Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 9cfea767d22ddac685fd8daf20a9531fd607bded Author: Nishant Malpani Date: Wed Mar 18 12:49:40 2020 +0530 dt-bindings: iio: tsl2563: convert bindings to YAML Convert the TSL2563 device tree bindings to the new YAML format. Signed-off-by: Nishant Malpani Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 94291556b21a6206945a63cddfb5bf37b9bb7d42 Author: Alexandru Ardelean Date: Tue Mar 24 15:46:36 2020 +0200 dt-bindings: iio: adc: add bindings doc for AD9467 ADC This change adds the binding doc for the AD9467 ADC. Signed-off-by: Alexandru Ardelean Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit ad67971202381c9b7289b018151f0b12c0ee5314 Author: Michael Hennerich Date: Tue Mar 24 15:46:35 2020 +0200 iio: adc: ad9467: add support AD9467 ADC The AD9467 is a 16-bit, monolithic, IF sampling analog-to-digital converter (ADC). It is optimized for high performanceover wide bandwidths and ease of use. The product operates at a 250 MSPS conversion rate and is designed for wireless receivers, instrumentation, and test equipment that require a high dynamic range. The ADC requires 1.8 V and 3.3 V power supplies and a low voltage differential input clock for full performance operation. No external reference or driver components are required for many applications. Data outputs are LVDS compatible (ANSI-644 compatible) and include the means to reduce the overall current needed for short trace distances. Since the chip can operate at such high sample-rates (much higher than classical interfaces), it requires that a DMA controller be used to interface directly to the chip and push data into memory. Typically, the AXI ADC IP core is used to interface with it. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9467.pdf Signed-off-by: Lars-Peter Clausen Signed-off-by: Michael Hennerich Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 96553a44e96d6ffee66274057b6462ddfa0d38e4 Author: Alexandru Ardelean Date: Tue Mar 24 15:46:34 2020 +0200 dt-bindings: iio: adc: add bindings doc for AXI ADC driver This change adds the bindings documentation for the AXI ADC driver. Reviewed-by: Rob Herring Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit ef04070692a21633ec6a60f80c19b6af44b3cf47 Author: Michael Hennerich Date: Tue Mar 24 15:46:33 2020 +0200 iio: adc: adi-axi-adc: add support for AXI ADC IP core This change adds support for the Analog Devices Generic AXI ADC IP core. The IP core is used for interfacing with analog-to-digital (ADC) converters that require either a high-speed serial interface (JESD204B/C) or a source synchronous parallel interface (LVDS/CMOS). Usually, some other interface type (i.e SPI) is used as a control interface for the actual ADC, while the IP core (controlled via this driver), will interface to the data-lines of the ADC and handle the streaming of data into memory via DMA. Because of this, the AXI ADC driver needs the other SPI-ADC driver to register with it. The SPI-ADC needs to be register via the SPI framework, while the AXI ADC registers as a platform driver. The two cannot be ordered in a hierarchy as both drivers have their own registers, and trying to organize this [in a hierarchy becomes] problematic when trying to map memory/registers. There are some modes where the AXI ADC can operate as standalone ADC, but those will be implemented at a later point in time. DocLink: https://wiki.analog.com/resources/fpga/docs/axi_adc_ip Signed-off-by: Michael Hennerich Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit e0fcca9fbd99e959855aa1d66c125d696f969e68 Author: Alexandru Ardelean Date: Tue Mar 24 15:46:32 2020 +0200 iio: buffer-dmaengine: add dev-managed calls for buffer alloc Currently, when using a 'iio_dmaengine_buffer_alloc()', an matching call to 'iio_dmaengine_buffer_free()' must be made. With this change, this can be avoided by using 'devm_iio_dmaengine_buffer_alloc()'. The buffer will get free'd via the device's devres handling. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 6eb3b8acfd079104571c207d4524743b6acc6550 Author: Alexandru Ardelean Date: Tue Mar 24 15:46:31 2020 +0200 iio: buffer-dmaengine: use %zu specifier for sprintf(align) The 'size_t' type behaves differently on 64-bit architectures, and causes compiler a warning of the sort "format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t {aka long unsigned int}'". This change adds the correct specifier for the 'align' field. Fixes: 4538c18568099 ("iio: buffer-dmaengine: Report buffer length requirements") Reported-by: kbuild test robot Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 20d5fa48d333670ffbc08d387a80710be91259a0 Author: Alexandru Ardelean Date: Tue Mar 24 15:46:30 2020 +0200 include: fpga: adi-axi-common.h: add version helper macros The format for all ADI AXI IP cores is the same. i.e. 'major.minor.patch'. This patch adds the helper macros to be re-used in ADI AXI drivers. Acked-by: Moritz Fischer Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 641dedd50c488739b56ef0f716988e646295dce4 Author: Alexandru Ardelean Date: Tue Mar 24 15:46:29 2020 +0200 include: fpga: adi-axi-common.h: fixup whitespace tab -> space The initial version use a tab between '#define' & 'ADI_AXI_REG_VERSION'. This changes it to space. The change is purely cosmetic. Acked-by: Moritz Fischer Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 9159c7c06cebfab4bebca0a930b924ad29437638 Author: Alexandru Ardelean Date: Sat Mar 28 18:34:21 2020 +0200 iio: buffer: drop left-over 'stufftoread' field This seems like a left-over from a7348347ba8a4 ("staging:iio: Add polling of events on the ring access chrdev."). Then it was moved into the sca3000 driver around 9dd4694dafbd8 ("iio: staging: sca3000: hide stufftoread logic"), and that one seemed to be the only user of this. Then it eventually was no longer used after 152a6a884ae1 ("staging:iio:accel:sca3000 move to hybrid hard / soft buffer design.") Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 5a464c6e274c94ef16f4127e139449d9e4742823 Author: Rohit Sarkar Date: Sat Mar 28 12:23:04 2020 +0530 iio: temperature: ltc2983: remove redundant comparison to bool Remove redundant comparison to a boolean variable. Fixes coccinelle warning: drivers/iio/temperature//ltc2983.c:393:20-32: WARNING: Comparison to bool drivers/iio/temperature//ltc2983.c:394:20-32: WARNING: Comparison to bool Signed-off-by: Rohit Sarkar Acked-by: Nuno Sá Signed-off-by: Jonathan Cameron commit 4b7ef6040fc49d51379d2db72c2e2d70db794d47 Author: Rohit Sarkar Date: Fri Mar 27 18:40:23 2020 +0530 iio: imu: inv_mpu6050: add debugfs register r/w interface The debugfs interface provides direct access to read and write device registers if debugfs is enabled. Signed-off-by: Rohit Sarkar Reviewed-by: Andy Shevchenko Acked-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit 792897ce417f9690cc7e365a4aca9fa3f4cf6c77 Author: Andy Shevchenko Date: Mon Mar 23 12:41:29 2020 +0200 iio: pressure: bmp280: Join string literals back For easy grepping on debug purposes join string literals back in the messages. No functional change. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Jonathan Cameron commit a7a047ea5e014c1f296f5590bce27602dba282fa Author: Andy Shevchenko Date: Mon Mar 23 12:41:28 2020 +0200 iio: pressure: bmp280: Drop unneeded explicit castings In few places the unnecessary explicit castings are being used. Drop them for good. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Jonathan Cameron commit df6e71256c84c4c232107a4074572ea150851d15 Author: Andy Shevchenko Date: Mon Mar 23 12:41:27 2020 +0200 iio: pressure: bmp280: Explicitly mark GPIO optional Show by using a corresponding API call that GPIO is optional. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 6085102c494b8afc62bc093f8f32d6248f6d33e5 Author: Andy Shevchenko Date: Mon Mar 23 12:41:26 2020 +0200 iio: pressure: bmp280: Convert to use ->read_avail() Convert to use ->read_avail() instead of open-coded attribute handling. Suggested-by: Jonathan Cameron Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Jonathan Cameron commit 97b31a6f5fb95b1ec6575b78a7240baddba34384 Author: Andy Shevchenko Date: Mon Mar 23 12:41:25 2020 +0200 iio: pressure: bmp280: Tolerate IRQ before registering With DEBUG_SHIRQ enabled we have a kernel crash [ 116.482696] BUG: kernel NULL pointer dereference, address: 0000000000000000 ... [ 116.606571] Call Trace: [ 116.609023] [ 116.611047] complete+0x34/0x50 [ 116.614206] bmp085_eoc_irq+0x9/0x10 [bmp280] because DEBUG_SHIRQ mechanism fires an IRQ before registration and drivers ought to be able to handle an interrupt happening before request_irq() returns. Fixes: aae953949651 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt") Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Jonathan Cameron commit b5fbf0568c51f5241b898388b3619286fa468d10 Author: Wolfram Sang Date: Thu Mar 26 22:09:55 2020 +0100 iio: imu: inv_mpu6050: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit 9623473cbb6f605fb7a85972284dce19cc74267b Author: Nishant Malpani Date: Sun Mar 22 22:53:15 2020 +0530 iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 02566b459f391d867b637d6e2eda8ac48b30415f Author: Nishant Malpani Date: Sun Mar 22 22:53:12 2020 +0530 iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit fb3f7ab7736d22aae8282a1d56f3187ecf9cb66f Author: Nishant Malpani Date: Sun Mar 22 22:53:11 2020 +0530 iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 35c9c8d5ec0734f6044d21a46e97d879d40dd12b Author: Nishant Malpani Date: Sun Mar 22 22:53:10 2020 +0530 iio: imu: bmi160_spi: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 6e924c526a32b352b2ce10fc847c8ed593506c6c Author: Nishant Malpani Date: Sun Mar 22 22:53:09 2020 +0530 iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 0e5fd387657abfed7da96edd8a313babb7f6a66a Author: Nishant Malpani Date: Sun Mar 22 22:53:08 2020 +0530 iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit df91cf5c289c4dfe46aa7ef32231cc827b7e4d61 Author: Nishant Malpani Date: Sun Mar 22 22:53:07 2020 +0530 iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 442140989f2d777d9cf02622c76f0ac8a4b891b3 Author: Nishant Malpani Date: Sun Mar 22 22:53:06 2020 +0530 iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit f0bd45fea3ea9c73040228bc95dd9a2ca74b2b17 Author: Nishant Malpani Date: Sun Mar 22 22:53:03 2020 +0530 iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 1cfe38fc40e6d3d86e8fc88f9e2c080b9b38df3d Author: Alexandru Ardelean Date: Sun Mar 22 17:26:56 2020 +0200 iio: adc: ad7793: use read_avail iio hook for scale available This change uses the read_avail and '.info_mask_shared_by_type_available' modifier to set the available scale. Essentially, nothing changes to the driver's ABI. The main idea for this patch is to remove the AD7793 driver from checkpatch's radar. There have been about ~3 attempts to fix/break the 'in_voltage-voltage_scale_available' attribute, because checkpatch assumed it to be an arithmetic operation and people were trying to change that. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit b7329249ea5b08b2a1c2c3f24a2f4c495c4f14b8 Author: Lars-Peter Clausen Date: Thu Mar 26 11:30:12 2020 +0200 iio: buffer: Don't allow buffers without any channels enabled to be activated Before activating a buffer make sure that at least one channel is enabled. Activating a buffer with 0 channels enabled doesn't make too much sense and disallowing this case makes sure that individual driver don't have to add special case code to handle it. Currently, without this patch enabling a buffer is possible and no error is produced. With this patch -EINVAL is returned. An example of execution with this patch and some instrumented print-code: root@analog:~# cd /sys/bus/iio/devices/iio\:device3/buffer root@analog:/sys/bus/iio/devices/iio:device3/buffer# echo 1 > enable 0: iio_verify_update 748 indio_dev->masklength 2 *insert_buffer->scan_mask 00000000 1: iio_verify_update 753 2:__iio_update_buffers 1115 ret -22 3: iio_buffer_store_enable 1241 ret -22 -bash: echo: write error: Invalid argument 1, 2 & 3 are exit-error paths. 0 the first print in iio_verify_update() rergardless of error path. Without this patch (and same instrumented print-code): root@analog:~# cd /sys/bus/iio/devices/iio\:device3/buffer root@analog:/sys/bus/iio/devices/iio:device3/buffer# echo 1 > enable 0: iio_verify_update 748 indio_dev->masklength 2 *insert_buffer->scan_mask 00000000 root@analog:/sys/bus/iio/devices/iio:device3/buffer# Buffer is enabled with no error. Note from Jonathan: Probably not suitable for automatic application to stable. This has been there from the very start. It tidies up an odd corner case but won't effect any 'real' users. Fixes: 84b36ce5f79c0 ("staging:iio: Add support for multiple buffers") Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 3dee0426289818fee3c827fdd166cc5b874c756c Author: Takashi Iwai Date: Mon Mar 16 13:49:41 2020 +0100 iio: tsl2772: Use scnprintf() for avoiding potential buffer overflow snprintf() is a hard-to-use function, it's especially difficult to use it for concatenating substrings in a buffer with a limited size. Since snprintf() returns the would-be-output size, not the actual size, the subsequent use of snprintf() may go beyond the given limit easily. Although the current code doesn't actually overflow the buffer, it's an incorrect usage. This patch replaces such snprintf() calls with a safer version, scnprintf(). Also this fixes the incorrect argument of the buffer limit size passed to snprintf(), too. The size has to be decremented for the remaining length. Signed-off-by: Takashi Iwai Reviewed-by: Brian Masney Signed-off-by: Jonathan Cameron commit bf09cddb2cd4028681a83426649f18b90c662e16 Author: Rohit Sarkar Date: Sun Mar 15 21:34:58 2020 +0530 iio: adc: max1363: replace uses of mlock Replace usage indio_dev's mlock with either local lock or iio_device_claim_direct_mode. Signed-off-by: Rohit Sarkar Signed-off-by: Jonathan Cameron commit bb8759f28e3685d3f0d97f948a3ad2dabe33b5f1 Author: Rohit Sarkar Date: Sun Mar 15 20:55:12 2020 +0530 iio: health: max30100: use generic property handler Instead of of_property_read_xxx use device_property_read_xxx as it is compatible with ACPI too as opposed to only device tree. Signed-off-by: Rohit Sarkar Signed-off-by: Jonathan Cameron commit 1579fc067f6e4f958e06db6bf3d170b753cd36d0 Author: Mike Looijmans Date: Mon Mar 16 07:34:03 2020 +0100 iio/gyro/bmg160: Add support for BMI088 chip The BMI088 is pin-compatible with the BMI055, and provides both gyro and accel functions. The gyro part is similar to the BMI055 and this adds the chip to the list of supported devices for the gyro part. The accel part of the chip is not compatible with anything existing already. Signed-off-by: Mike Looijmans Signed-off-by: Jonathan Cameron commit ccd428e42b807a1269d0477dd89c90136065617c Author: Alexandru Ardelean Date: Sat Mar 21 10:59:56 2020 +0200 iio: buffer: re-introduce bitmap_zalloc() for trialmask Commit 3862828a903d3 ("iio: buffer: Switch to bitmap_zalloc()") introduced bitmap_alloc(), but commit 20ea39ef9f2f9 ("iio: Fix scan mask selection") reverted it. This change adds it back. The only difference is that it's adding bitmap_zalloc(). There might be some changes later that would require initializing it to zero. In any case, now it's already zero-ing the trialmask. Appears to have been the result of merge conflict resolution rather than an intentional revert. Reviewed-by: Andy Shevchenko Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 7d744c8f70154f1e8ae2ca15ce410bfb8da1d0f2 Author: Syed Nayyar Waris Date: Fri Mar 20 13:42:58 2020 +0530 MAINTAINERS: Add Syed Nayyar Waris to ACCES 104-QUAD-8 driver Add Syed Nayyar Waris as a co-maintainer for the ACCES 104-QUAD-8 counter driver. Signed-off-by: Syed Nayyar Waris Acked-by: William Breathitt Gray Signed-off-by: Jonathan Cameron commit 501d3e5dd5bd33a7119f35ee6d365a5787e32a30 Author: Alexandru Ardelean Date: Sat Mar 21 11:08:01 2020 +0200 iio: ad_sigma_delta: remove unused IIO channel macros Now that all channel SigmaDelta IIO channel macros have been localized, remove the generic ones. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit aebefb444fe889bd7d92741a3dcc1c20c308f875 Author: Alexandru Ardelean Date: Sat Mar 21 11:08:00 2020 +0200 iio: adc: ad7793: define/use own IIO channel macros This driver seems to use most of the AD_SD_*_CHANNEL. This change will move them in the driver. The intent is that if a new part comes along which would require tweaks per IIO channel, these should be doable in the driver. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit ab3449943b1da697301c3aa814b7c5f3bfe3065b Author: Alexandru Ardelean Date: Sat Mar 21 11:07:59 2020 +0200 iio: adc: ad7791: define/use own IIO channel macros This driver seems to use most of the AD_SD_*_CHANNEL. This change will move them in the driver. The intent is that if a new part comes along which would require tweaks per IIO channel, these should be doable in the driver. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 5924dab2412b42144c93ab6ab72ad489617b0121 Author: Alexandru Ardelean Date: Sat Mar 21 11:07:58 2020 +0200 iio: adc: ad7780: define/use own IIO channel macros This change gets rid of the AD_SD_*_CHANNEL macros in favor of defining it's own. The ad7780 is quite simpler than it's other Sigma-Delta brothers. It turned out that centralizing the AD_SD_*_CHANNEL macros doesn't scale too well, especially with some more complicated drivers. Some of the variations in the more complicated drivers require new macros, and that way things can become harder to maintain. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 58eb7b77ad01f058e523554cb7bae7272a7d2579 Author: Kaitao Cheng Date: Sat Apr 18 00:24:51 2020 +0800 smp: Use smp_call_func_t in on_each_cpu() Use smp_call_func_t instead of the open coded function pointer argument. Signed-off-by: Kaitao Cheng Signed-off-by: Thomas Gleixner Acked-by: Sebastian Andrzej Siewior Link: https://lkml.kernel.org/r/20200417162451.91969-1-pilgrimtao@gmail.com commit 19c968222934835058e9ed3d515de744d8275213 Author: H. Nikolaus Schaller Date: Fri Feb 28 17:00:53 2020 +0100 MIPS: DTS: CI20: make DM9000 Ethernet controller use NVMEM to find the default MAC address There is a unique MAC address programmed into the eFuses of the JZ4780 chip in the CI20 factory. By using this for initializing the DM9000 Ethernet controller, every CI20 board has an individual - but stable - MAC address and DHCP can assign stable IP addresses. Signed-off-by: H. Nikolaus Schaller Signed-off-by: Thomas Bogendoerfer commit 190607f2d59e174bcf8415efb1bb390737f8d428 Author: PrasannaKumar Muralidharan Date: Fri Feb 28 17:00:52 2020 +0100 MIPS: DTS: JZ4780: define node for JZ4780 efuse This patch brings support for the JZ4780 efuse. Currently it only exposes a read only access to the entire 8K bits efuse memory and the ethernet mac address for the davicom dm9000 chip on the CI20 board. It also changes the nemc ranges definition to give the driver access to the efuse registers, which are in the middle of the nemc reg range. Tested-by: Mathieu Malaterre Signed-off-by: PrasannaKumar Muralidharan Signed-off-by: Mathieu Malaterre Signed-off-by: H. Nikolaus Schaller Signed-off-by: Thomas Bogendoerfer commit c2591eb5da521f34bd6023ece98b657719831752 Author: Christoph Hellwig Date: Thu Apr 16 17:00:11 2020 +0200 MIPS: use ioremap_page_range Use the generic ioremap_page_range helper instead of reimplementing it. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit d257b8fe173a4b22ca32780a6e65b075a3b88301 Author: Christoph Hellwig Date: Thu Apr 16 17:00:10 2020 +0200 MIPS: move ioremap_prot und iounmap out of line Neither of these interfaces is anywhere near the fast path. Move them out of line and avoid exposing implementation details to the drivers. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit 8e487c153c302a4cf274c1645c705ad6f551f138 Author: Christoph Hellwig Date: Thu Apr 16 17:00:09 2020 +0200 MIPS: split out the 64-bit ioremap implementation Split out the mips64 ioremap implementation entirely, as it will never use page table based remapping. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit 5c9ff5709dcf82bfd9a6d0d99a13b15ca522f510 Author: Christoph Hellwig Date: Thu Apr 16 17:00:08 2020 +0200 MIPS: merge __ioremap_mode into ioremap_prot There is no reason to have two ioremap with flags interfaces. Merge the historic mips __ioremap_mode into ioremap_prot which is a generic kernel interface. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit d399157283fb457cdc3ae03f2897070f0bd5d7c6 Author: Christoph Hellwig Date: Thu Apr 16 17:00:07 2020 +0200 MIPS: cleanup fixup_bigphys_addr handling fixup_bigphys_addr is only provided by the alchemy platform. Remove all the stubs, and ensure we only call it if it is actually implemented. Also don't bother implementing io_remap_pfn_range if we don't have to, and move the remaining implementation to alchemy platform code. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit b604d4973af7df4bbe970b2c380f5a0477fa53ec Author: Christoph Hellwig Date: Thu Apr 16 17:00:06 2020 +0200 MIPS: remove cpu_has_64bit_addresses This macro is identical to CONFIG_64BIT, and using a Kconfig variable for the only places that checks them (the ioremap implementation) will simplify later patches in this series. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit acfaaf52ebfd02de509bc212fc3e8c8bac187110 Author: Christoph Hellwig Date: Thu Apr 16 17:00:05 2020 +0200 ASoC: txx9: don't work around too small resource_size_t The txx9 sound driver deends on HAS_TXX9_ACLC, which is only set for three tx49xx SOCs, and thus always has a 64-bit phys_addr_t and resource_size_t. Instead of poking into ioremap internals to work around a potentially too small resource_size_t just add a BUILD_BUG_ON to catch such a case. Signed-off-by: Christoph Hellwig Acked-by: Mark Brown Signed-off-by: Thomas Bogendoerfer commit 9446aa5062e972265427368314039fe74635bec2 Author: Jason Yan Date: Sat Apr 18 16:18:34 2020 +0800 MIPS: Netlogic: remove unneeded semicolon in fmn_message_handler() Fix the following coccicheck warning: arch/mips/netlogic/xlr/fmn.c:106:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Thomas Bogendoerfer commit 59e9e8e4fe83f68e599b87c06aaf239dcc64887b Author: Mark Zhang Date: Tue Jan 14 05:06:25 2020 +0200 net/mlx5: Enable SW-defined RoCEv2 UDP source port When this is enabled, UDP source port for RoCEv2 packets are defined by software instead of firmware. Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky commit a2a322f447b91a9b85d332b345a3b508d97506a9 Author: Leon Romanovsky Date: Thu Mar 19 11:43:59 2020 +0200 net/mlx5: Refactor HCA capability set flow Reduce the amount of kzalloc/kfree cycles by allocating command structure in the parent function and leverage the knowledge that set_caps() is called for HCA capabilities only with specific HW structure as parameter to calculate mailbox size. Acked-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 333fbaa0255b8d471fc7ae767ef3a1766c732d6d Author: Leon Romanovsky Date: Sat Apr 4 10:40:24 2020 +0300 net/mlx5: Move QP logic to mlx5_ib The mlx5_core doesn't need any functionality coded in qp.c, so move that file to drivers/infiniband/ be under mlx5_ib responsibility. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 42f9bbd11278d0a270a75998f5c0d21e7b37c521 Author: Leon Romanovsky Date: Wed Apr 1 11:48:47 2020 +0300 RDMA/mlx5: Alphabetically sort build artifacts Sort .o objects in makefile to make addition of new object less cumbersome. Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky commit 9c275ee4ad82aeb1f51981fdc9ee16b74d4b101a Author: Leon Romanovsky Date: Tue Apr 7 16:09:15 2020 +0300 net/mlx5: Delete not-used cmd header The structures defined in the cmd header are not used and can be safely removed from the driver. This patch removes that file and deletes all relevant includes. Signed-off-by: Leon Romanovsky commit bfd745f8f327c40d74c8207ca62db05a264b5b7c Author: Leon Romanovsky Date: Fri Apr 3 13:31:18 2020 +0300 RDMA/mlx5: Delete Q counter allocations command Remove mlx5_ib implementation of Q counter allocation logic together with cleaning boolean which controlled validity of the counter. It is not needed, because counter_id == 0 means that counter is not valid. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 66247fbb280c2a699a8621708c52dae6acd2e4bc Author: Leon Romanovsky Date: Fri Apr 3 11:28:28 2020 +0300 net/mlx5: Remove Q counter low level helper APIs mlx5 core users are encouraged to use low level API (mlx5_cmd_exec) without the need of helper functions, do this for q counters, remove helper functions and call mlx5_cmd_exec directly from users. This will help reduce the total amount of code and reduction of the mlx5_core symbol table. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 57a6c5e992f5d6ab92764a7eaaba855f6d4b2df8 Author: Leon Romanovsky Date: Mon Apr 6 15:53:06 2020 +0300 net/mlx5: Replace hand written QP context struct with automatic getters By changing debugfs to not use any QP related API, convert the debugfs code to use MLX5_GET() directly to access QP context instead of hand written struct. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit f93f4f4f31492468d5c6903e35cc0e31a9cb2c48 Author: Leon Romanovsky Date: Mon Apr 6 11:17:44 2020 +0300 net/mlx5: Remove extra indirection while storing QPN The FPGA, SW steering and IPoIB need to have only QPN from the mlx5_core_qp struct, so reduce memory footprint by storing QPN directly. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit a452e0e43669d5223f3f2264d0d4f08acdba98c0 Author: Leon Romanovsky Date: Mon Apr 6 13:43:14 2020 +0300 net/mlx5: Open-code modify QP in the IPoIB module Remove dependency on qp.c from the IPoIB by open coding modify QP interface. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit a6532fd925b981863161275dea6fd26b2e2c02e4 Author: Leon Romanovsky Date: Mon Apr 6 09:42:43 2020 +0300 net/mlx5: Open-code modify QP in the FPGA module Remove dependency on qp.c from the FPGA by open coding modify QP interface. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit acab4b88e93ceb467623b991bb4b1594c893667a Author: Leon Romanovsky Date: Sat Apr 4 18:25:48 2020 +0300 net/mlx5: Open-code modify QP in steering module Remove dependency on qp.c from SW steering by open coding modify QP interface. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 73a75b96fc9a79779ad7491b61d65f0bbae04d11 Author: Leon Romanovsky Date: Mon Apr 6 08:40:52 2020 +0300 net/mlx5: Remove empty QP and CQ events handlers The QP and CQ events functions do nothing except printing some debug messages. There is nothing to do with this knowledge and such events, so remove them. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit ec44e72b73b74af489196352152e53a20c8ad5eb Author: Leon Romanovsky Date: Thu Apr 2 15:17:40 2020 +0300 net/mlx5: Open-code create and destroy QP calls FPGA, IPoIB and SW steering don't need anything from the mlx5_core_create_qp() and mlx5_core_destroy_qp() except calls to mlx5_cmd_exec(). Let's open-code it, so we will be able to move qp.c to mlx5_ib. Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit bb7fc863729b45f0fbcdea991d0465d855ffd831 Author: Leon Romanovsky Date: Sun Apr 5 20:57:00 2020 +0300 net/mlx5: Provide simplified command interfaces Many mlx5_cmd_exec() callers are not interested in the output from that command or have standard in/out structures. Those callers simply allocate those structure on the stack and use sizeof() to provide in/out arguments. In this naive approach provide simplified versions of mlx5_cmd_exec(). Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit ce33988fb69828dfcb5825f9086d9dc2b37a9282 Author: Heiko Stuebner Date: Tue Apr 14 10:29:38 2020 +0200 arm64: dts: rockchip: add Odroid Advance Go The Odroid Advance Go is a handheld based on Rockchip's rk3326 soc with a DSI display and some handheld controls including an analog joystick connected to the saradc. Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20200414082938.2977572-3-heiko@sntech.de Signed-off-by: Heiko Stuebner commit 98412e1e57ea776b4581077a68fe6ed598bfba99 Author: Heiko Stuebner Date: Tue Apr 14 10:29:37 2020 +0200 dt-bindings: Add binding for Hardkernel Odroid Go Advance Add a compatible for the Odroid Go Advance from Hardkernel. The compatible used by the vendor already is odroid-go2, to distinguish it from the previous (microcontroller-based) Odroid Go, so we're keeping that, also to not cause unnecessary incompatibilites. Signed-off-by: Heiko Stuebner Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200414082938.2977572-2-heiko@sntech.de Signed-off-by: Heiko Stuebner commit df07f7df7e5a61d06b21f89c4ab744fb4e4c2222 Author: Heiko Stuebner Date: Tue Apr 14 10:29:36 2020 +0200 arm64: dts: rockchip: add core devicetree for rk3326 The rk3326 is basically a px30 without the second display controller. So add a dtsi based on that, that just removes the affected nodes. Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20200414082938.2977572-1-heiko@sntech.de Signed-off-by: Heiko Stuebner commit 051083dddf07a4472bc1720d5c2b1909e0865890 Author: Johan Jonker Date: Wed Apr 15 15:10:57 2020 +0200 arm64: dts: rockchip: remove bus-width from mmc nodes in rk3308-roc-cc The 'bus-width' property for mmc nodes is defined both in 'rk3308.dtsi' and 'rk3308-roc-cc.dts'. 'bus-width' and pinctrl containing the bus-pins should be in the same file, so remove all entries from mmc nodes in 'rk3308-roc-cc.dts'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200415131057.2366-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 1f5a3e1679353fb53e955afd8801a7f4f60877ff Author: Tobias Schramm Date: Thu Apr 16 16:55:34 2020 +0200 arm64: dts: rockchip: add micro SD card regulator to rockpro64 This patch adds the RockPro64's micro SD card regulator to the RockPro64 dtsi. The regulator is present on all revisions of the device. Previously the regular was missing, resulting in unreliable boot behaviour when booting from SD card. Signed-off-by: Tobias Schramm Link: https://lore.kernel.org/r/20200416145534.1263575-1-t.schramm@manjaro.org Signed-off-by: Heiko Stuebner commit 8eea6e26fc2eda6922e5008ccb7f55bc1775d5b3 Author: Johan Jonker Date: Fri Apr 3 15:36:30 2020 +0200 dt-bindings: display: convert rockchip rk3066 hdmi bindings to yaml Current dts files with 'hdmi' nodes for rk3066 are manually verified. In order to automate this process rockchip,rk3066-hdmi.txt has to be converted to yaml. Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20200403133630.7377-1-jbx6244@gmail.com commit 81b4d1d22ca0d0162360d3536b0eb3f6d5bfcf88 Author: Kenny Levinsen Date: Sat Apr 18 21:26:50 2020 -0700 Input: evdev - use keyed wakeups Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP. As evdev uses unkeyed wakeups, such a poll receives many spurious wakeups from uninteresting events. Use keyed wakeups to allow the wakeup target to more efficiently discard these uninteresting events. Signed-off-by: Kenny Levinsen Link: https://lore.kernel.org/r/20200410233557.3892-1-kl@kl.wtf Signed-off-by: Dmitry Torokhov commit ec4ba6c35b1bd748de50044e36040136f378b9b6 Author: Christophe JAILLET Date: Sat Apr 18 21:27:25 2020 -0700 Input: spear-keyboard - fix a typo in a module name in Kconfig A 'y' is missing in spear-keyboard. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200412095711.9107-1-christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov commit c154703bc8dd2231ae81aafef5589b795b2b7e09 Author: Christophe JAILLET Date: Sat Apr 18 21:18:07 2020 -0700 Input: tca6416-keypad - fix a typo in MODULE_DESCRIPTION This should be 'tca6416', not 'tca6146' Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200413152329.4435-1-christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov commit 0fde6e3b55a15a13f3b5aa484a79fe5298c1ed40 Merge: 7070eea5e95a 773235f4e1cc Author: David S. Miller Date: Sat Apr 18 20:20:11 2020 -0700 Merge branch 'r8169-series-with-improvements' Heiner Kallweit says: ==================== r8169: series with improvements Again a series with few improvements. ==================== Signed-off-by: David S. Miller commit 773235f4e1cc41ea98f520a0cfe0a51a58b2d411 Author: Heiner Kallweit Date: Sat Apr 18 23:11:32 2020 +0200 r8169: add workaround for RTL8168evl TSO hw issues Add workaround for hw issues with TSO on RTL8168evl. This workaround is based on information I got from Realtek, and *should* allow to safely enable TSO on this chip version. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 0623b98b41cd16073ee15f35e058194313e6dc51 Author: Heiner Kallweit Date: Sat Apr 18 23:10:44 2020 +0200 r8169: improve rtl8169_tso_csum_v2 Simplify the code and avoid the overhead of calling vlan_get_protocol(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 145192f83a1184ca8f2ef4508e7a93bb783bb444 Author: Heiner Kallweit Date: Sat Apr 18 23:10:03 2020 +0200 r8169: use rtl8169_set_features in rtl8169_init_one At that place in rtl_init_one() we can safely use rtl8169_set_features() to configure the chip according to the default features. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 85ab8b245ec6572eb489d0fe76c5573851d7b7ad Author: Heiner Kallweit Date: Sat Apr 18 23:08:43 2020 +0200 r8169: preserve VLAN setting on RTL8125 in rtl_init_rxcfg So far we set RX_VLAN_8125 unconditionally, even if NETIF_F_HW_VLAN_CTAG_RX may not be set. Don't touch these bits, and let only rtl8169_set_features() control them. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit a9b3d56830a3d626a0d85adc285ea94e829b6e9d Author: Heiner Kallweit Date: Sat Apr 18 23:07:41 2020 +0200 r8169: remove NETIF_F_HIGHDMA from vlan_features NETIF_F_HIGHDMA is added to vlan_features by register_netdev(), therefore we can omit this here. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 0360c046ca186be1953d185d5a3631e415381820 Author: Heiner Kallweit Date: Sat Apr 18 23:06:51 2020 +0200 r8169: move setting OCP base to generic init code Move setting the ocp_base to rtl_init_one(). Where supported the value is always the same, and if not supported it doesn't hurt. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7070eea5e95a3c1ea30b9afcedd8d29efcc28477 Author: Vladimir Oltean Date: Fri Apr 17 22:07:55 2020 +0300 enetc: permit configuration of rx-vlan-filter with ethtool Each ENETC station interface (SI) has a VLAN filter list and a port flag (PSIPVMR) by which it can be put in "VLAN promiscuous" mode, which enables the reception of VLAN-tagged traffic even if it is not in the VLAN filtering list. Currently the handling of this setting works like this: the port starts off as VLAN promiscuous, then it switches to enabling VLAN filtering as soon as the first VLAN is installed in its filter via .ndo_vlan_rx_add_vid. In practice that does not work out very well, because more often than not, the first VLAN to be installed is out of the control of the user: the 8021q module, if loaded, adds its rule for 802.1p (VID 0) traffic upon bringing the interface up. What the user is currently seeing in ethtool is this: ethtool -k eno2 rx-vlan-filter: on [fixed] which doesn't match the intention of the code, but the practical reality of having the 8021q module install its VID which has the side-effect of turning on VLAN filtering in this driver. All in all, a slightly confusing experience. So instead of letting this driver switch the VLAN filtering state by itself, just wire it up with the rx-vlan-filter feature from ethtool, and let it be user-configurable just through that knob, except for one case, see below. In promiscuous mode, it is more intuitive that all traffic is received, including VLAN tagged traffic. It appears that it is necessary to set the flag in PSIPVMR for that to be the case, so VLAN promiscuous mode is also temporarily enabled. On exit from promiscuous mode, the setting made by ethtool is restored. Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Signed-off-by: David S. Miller commit 89f9ffd3eb670bad1260bc579f5e13b8f2d5b3e0 Author: Vladimir Oltean Date: Fri Apr 17 22:03:08 2020 +0300 net: mscc: ocelot: deal with problematic MAC_ETYPE VCAP IS2 rules By default, the VCAP IS2 will produce a single match for each frame, on the most specific classification. Example: a ping packet (ICMP over IPv4 over Ethernet) sent from an IP address of 10.0.0.1 and a MAC address of 96:18:82:00:04:01 will match this rule: tc filter add dev swp0 ingress protocol ipv4 \ flower skip_sw src_ip 10.0.0.1 action drop but not this one: tc filter add dev swp0 ingress \ flower skip_sw src_mac 96:18:82:00:04:01 action drop Currently the driver does not really warn the user in any way about this, and the behavior is rather strange anyway. The current patch is a workaround to force matches on MAC_ETYPE keys (DMAC and SMAC) for all packets irrespective of higher layer protocol. The setting is made at the port level. Of course this breaks all other non-src_mac and non-dst_mac matches, so rule exclusivity checks have been added to the driver, in order to never have rules of both types on any ingress port. The bits that discard higher-level protocol information are set only once a MAC_ETYPE rule is added to a filter block, and only for the ports that are bound to that filter block. Then all further non-MAC_ETYPE rules added to that filter block should be denied by the ports bound to it. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f89370d413b38251dc3fd0e71d107da846c1012c Merge: 123aff2a789c ac9156b27564 Author: David S. Miller Date: Sat Apr 18 15:53:00 2020 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-04-17 This series contains updates to e1000e and igc only. Sasha adds partial generic segmentation offload (GSO partial) support to the igc driver. Also added support for translating taprio schedules into i225 cycles in igc. Did clean up of dead code or unused defines in the igc driver. Refactored the code to avoid forward declarations where possible. Enables the NETIF_F_HW_TC flag for igc by default. Vinicius adds support for ETF offloading using the similar approach that taprio offload used. Kees Cook fixes a clang warning in the e1000e driver by moving the declared variable either into the switch case that uses the variable or lift them up into the main function body, to help the compiler. Andre fixed some register overwriting when dumping registers via ethtool for igc driver. Also fixed support for ethtool Network Flow Classification (NFC) queue redirection by adding the missing code needed to enable the queue selection feature from Receive Address High (RAH) register. Cleans up code to remove the code bits designed to support tc-flower filters, since this client part does not support it. ==================== Signed-off-by: David S. Miller commit 123aff2a789c3975c2235653939ff00107d6156c Author: Florian Fainelli Date: Fri Apr 17 11:38:02 2020 -0700 net: phy: broadcom: Add support for BCM53125 internal PHYs BCM53125 has internal Gigabit PHYs which support interrupts as well as statistics, make it possible to configure both of those features with a PHY driver entry. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit c6f5f242f5ed58cc531e75507e8447a8c9b6cd30 Author: Florian Fainelli Date: Fri Apr 17 11:34:20 2020 -0700 net: phy: mdio-bcm-iproc: Do not show kernel pointer Displaying the virtual address at which the MDIO base register address has been mapped is not useful and is not visible with pointer hashing in place, replace the message with something indicating successful registration instead. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 007fc3c0ca478f3a8ad687cf9ecbe672d3a64700 Author: Florian Fainelli Date: Fri Apr 17 11:33:41 2020 -0700 net: dsa: b53: per-port interrupts are optional Make use of platform_get_irq_byname_optional() to avoid printing messages on the kernel console that interrupts cannot be found. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 5800091a206172e2016e84906035f1d757cc6547 Author: David Bauer Date: Fri Apr 17 15:41:59 2020 +0200 net: phy: at803x: add support for AR8032 PHY This adds support for the Qualcomm Atheros AR8032 Fast Ethernet PHY. It shares many similarities with the already supported AR8030 PHY but additionally supports MII connection to the MAC. Signed-off-by: David Bauer Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit e42688ed5cf5936fb55c78cc365dbe0944af7c63 Author: Dejin Zheng Date: Thu Apr 16 23:23:45 2020 +0800 i2c: busses: remove duplicate dev_err() it will print an error message by itself when platform_get_irq() goes wrong. so don't need dev_err() in here again. Reviewed-by: Andy Shevchenko Suggested-by: Markus Elfring Signed-off-by: Dejin Zheng Signed-off-by: Wolfram Sang commit e517526195de400158e05a08764d1fb61d579105 Author: Loic Poulain Date: Tue Apr 7 10:33:00 2020 +0200 i2c: Add Qualcomm CCI I2C driver This commit adds I2C bus support for the Camera Control Interface (CCI) I2C controller found on the Qualcomm SoC processors. This I2C controller supports two masters and they are registered to the core. CCI versions supported in the driver are msm8916, msm8996 and sdm845. This is a rework of the patch posted by Vinod: https://patchwork.kernel.org/patch/10569961/ With additional fixes + most of the comments addressed. Signed-off-by: Todor Tomov Signed-off-by: Vinod Koul Signed-off-by: Loic Poulain Tested-by: Robert Foss Reviewed-by: Bjorn Andersson [wsa: removed err msg after platform_get_irq] Signed-off-by: Wolfram Sang commit b7ed0496d94143fd5029297f31dbaab90313c570 Author: Todor Tomov Date: Tue Apr 7 10:33:01 2020 +0200 dt-bindings: i2c: Add binding for Qualcomm CCI I2C controller Add DT binding document for Qualcomm Camera Control Interface (CCI) I2C controller. Signed-off-by: Todor Tomov Signed-off-by: Vinod Koul Reviewed-by: Rob Herring Reviewed-by: Robert Foss Signed-off-by: Wolfram Sang commit 9f210ec65acc525db49de3223b935f9dd4c2f5b5 Author: Alexandre Belloni Date: Wed Apr 15 22:02:26 2020 +0200 rtc: 88pm860x: remove useless range check Because the core is now checking the RTC range, it is unnecessary to check it again in .set_time/ Link: https://lore.kernel.org/r/20200415200226.157361-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 06030d5001494f67fe2dee65c49c2f0e54e34eba Author: Alexandre Belloni Date: Wed Apr 15 22:00:21 2020 +0200 rtc: mt2712: switch to devm_platform_ioremap_resource Using devm_platform_ioremap_resource instead of open coding it reduces the size of the binary. text data bss dec hex filename 3728 216 0 3944 f68 drivers/rtc/rtc-mt2712.o 3744 216 0 3960 f78 drivers/rtc/rtc-mt2712.o.old Link: https://lore.kernel.org/r/20200415200021.157118-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 3642b17e9a8d32ddf8d74cd033de7efcd0a15aec Author: Alexandre Belloni Date: Wed Apr 15 22:00:20 2020 +0200 rtc: mt2712: remove unnecessary error string Remove the unnecessary error string as the core will already display error messages when registration fails (i.e. never). Link: https://lore.kernel.org/r/20200415200021.157118-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 2ce0d7f9766f0e49bb54f149c77bae89464932fb Author: Mark Brown Date: Thu Apr 16 19:24:02 2020 +0100 x86/asm: Provide a Kconfig symbol for disabling old assembly annotations As x86 was converted to use the modern SYM_ annotations for assembly, ifdefs were added to remove the generic definitions of the old style annotations on x86. Rather than collect a list of architectures in the ifdefs as more architectures are converted over, provide a Kconfig symbol for this and update x86 to use it. Signed-off-by: Mark Brown Signed-off-by: Borislav Petkov Acked-by: Jiri Slaby Link: https://lkml.kernel.org/r/20200416182402.6206-1-broonie@kernel.org commit 12e89e65f446476951f42aedeef56b6bd6f7f1e6 Author: Kan Liang Date: Thu Mar 19 13:25:17 2020 -0700 perf hist: Add fast path for duplicate entries check Perf checks the duplicate entries in a callchain before adding an entry. However the check is very slow especially with deeper call stack. Almost ~50% elapsed time of perf report is spent on the check when the call stack is always depth of 32. The hist_entry__cmp() is used to compare the new entry with the old entries. It will go through all the available sorts in the sort_list, and call the specific cmp of each sort, which is very slow. Actually, for most cases, there are no duplicate entries in callchain. The symbols are usually different. It's much faster to do a quick check for symbols first. Only do the full cmp when the symbols are exactly the same. The quick check is only to check symbols, not dso. Export _sort__sym_cmp. $ perf record --call-graph lbr ./tchain_edit_64 Without the patch $time perf report --stdio real 0m21.142s user 0m21.110s sys 0m0.033s With the patch $time perf report --stdio real 0m10.977s user 0m10.948s sys 0m0.027s Signed-off-by: Kan Liang Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Andi Kleen Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-18-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d80da766d181555d0c846298b8c619c384c7d179 Author: Kan Liang Date: Thu Mar 19 13:25:16 2020 -0700 perf c2c: Add option to enable the LBR stitching approach With the LBR stitching approach, the reconstructed LBR call stack can break the HW limitation. However, it may reconstruct invalid call stacks in some cases, e.g. exception handing such as setjmp/longjmp. Also, it may impact the processing time especially when the number of samples with stitched LBRs are huge. Add an option to enable the approach. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-17-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 13e0c844fa097f657bd8204fd574477c34f47a0c Author: Kan Liang Date: Thu Mar 19 13:25:15 2020 -0700 perf top: Add option to enable the LBR stitching approach With the LBR stitching approach, the reconstructed LBR call stack can break the HW limitation. However, it may reconstruct invalid call stacks in some cases, e.g. exception handing such as setjmp/longjmp. Also, it may impact the processing time especially when the number of samples with stitched LBRs are huge. Add an option to enable the approach. The option must be used with --call-graph lbr. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-16-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 680d125cd522d460b24ccc8b29f03cdb62dea23e Author: Kan Liang Date: Thu Mar 19 13:25:14 2020 -0700 perf script: Add option to enable the LBR stitching approach With the LBR stitching approach, the reconstructed LBR call stack can break the HW limitation. However, it may reconstruct invalid call stacks in some cases, e.g. exception handing such as setjmp/longjmp. Also, it may impact the processing time especially when the number of samples with stitched LBRs are huge. Add an option to enable the approach. Committer testing: Using the same perf.data as with the latest cset committer testing section: $ perf script --stitch-lbr tchain_edit 11131 15164.984292: 437491 cycles:u: 401106 f43+0x0 (/wb/tchain_edit) 40114c f42+0x18 (/wb/tchain_edit) 401172 f41+0xe (/wb/tchain_edit) 401194 f40+0x0 (/wb/tchain_edit) 40119b f39+0x0 (/wb/tchain_edit) 4011a2 f38+0x0 (/wb/tchain_edit) 4011a9 f37+0x0 (/wb/tchain_edit) 4011b0 f36+0x0 (/wb/tchain_edit) 4011b7 f35+0x0 (/wb/tchain_edit) 4011be f34+0x0 (/wb/tchain_edit) 4011c5 f33+0x0 (/wb/tchain_edit) 4011cc f32+0x0 (/wb/tchain_edit) 401207 f31+0x34 (/wb/tchain_edit) 401212 f30+0x0 (/wb/tchain_edit) 401219 f29+0x0 (/wb/tchain_edit) 401220 f28+0x0 (/wb/tchain_edit) 401227 f27+0x0 (/wb/tchain_edit) 40122e f26+0x0 (/wb/tchain_edit) 401235 f25+0x0 (/wb/tchain_edit) 40123c f24+0x0 (/wb/tchain_edit) 401243 f23+0x0 (/wb/tchain_edit) 40124a f22+0x0 (/wb/tchain_edit) 401251 f21+0x0 (/wb/tchain_edit) 401258 f20+0x0 (/wb/tchain_edit) 40125f f19+0x0 (/wb/tchain_edit) 401266 f18+0x0 (/wb/tchain_edit) 40126d f17+0x0 (/wb/tchain_edit) 401274 f16+0x0 (/wb/tchain_edit) 40127b f15+0x0 (/wb/tchain_edit) 401282 f14+0x0 (/wb/tchain_edit) 401289 f13+0x0 (/wb/tchain_edit) 401290 f12+0x0 (/wb/tchain_edit) 401297 f11+0x0 (/wb/tchain_edit) 40129e f10+0x0 (/wb/tchain_edit) 4012a5 f9+0x0 (/wb/tchain_edit) 4012ac f8+0x0 (/wb/tchain_edit) 4012b3 f7+0x0 (/wb/tchain_edit) 4012ba f6+0x0 (/wb/tchain_edit) 4012c1 f5+0x0 (/wb/tchain_edit) 4012c8 f4+0x0 (/wb/tchain_edit) 4012cf f3+0x0 (/wb/tchain_edit) 4012d6 f2+0x0 (/wb/tchain_edit) 4012dd f1+0x0 (/wb/tchain_edit) 4012e4 main+0x0 (/wb/tchain_edit) 7f41a5016f41 __libc_start_main+0xf1 (/usr/lib64/libc-2.29.so) $ Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-15-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b1d1429b1820e1587d8588fc05b28ef9af42cfc6 Author: Kan Liang Date: Thu Mar 19 13:25:13 2020 -0700 perf report: Add option to enable the LBR stitching approach With the LBR stitching approach, the reconstructed LBR call stack can break the HW limitation. However, it may reconstruct invalid call stacks in some cases, e.g. exception handing such as setjmp/longjmp. Also, it may impact the processing time especially when the number of samples with stitched LBRs are huge. Add an option to enable the approach. # To display the perf.data header info, please use # --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 6K of event 'cycles' # Event count (approx.): 6492797701 # # Children Self Command Shared Object Symbol # ........ ........ ............... .................. # ................................. # 99.99% 99.99% tchain_edit tchain_edit [.] f43 | ---main f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25 f26 f27 f28 f29 f30 f31 | --99.65%--f32 f33 f34 f35 f36 f37 f38 f39 f40 f41 f42 f43 Committer testing: $ perf record --call-graph lbr /wb/tchain_edit [ perf record: Woken up 23 times to write data ] [ perf record: Captured and wrote 5.578 MB perf.data (6839 samples) ] $ perf report --header-only | egrep 'cpu(desc|.*capabilities)' # cpudesc : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz # cpu pmu capabilities: branches=32, max_precise=3, pmu_name=skylake $ Before: $ perf report --no-children --stdio # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 6K of event 'cycles:u' # Event count (approx.): 6459523879 # # Overhead Command Shared Object Symbol # ........ ........... ................ ....................... # 99.95% tchain_edit tchain_edit [.] f43 | --99.92%--f43 f42 f41 f40 f39 f38 f37 f36 f35 f34 f33 f32 f31 f30 f29 f28 f27 f26 f25 f24 f23 f22 f21 f20 f19 f18 f17 f16 f15 f14 f13 f12 f11 0.03% tchain_edit tchain_edit [.] f42 0.01% tchain_edit tchain_edit [.] f41 0.00% tchain_edit tchain_edit [.] f31 0.00% tchain_edit ld-2.29.so [.] _dl_relocate_object 0.00% tchain_edit ld-2.29.so [.] memmove 0.00% tchain_edit [unknown] [k] 0xffffffff93a00b17 After: $ perf report --stitch-lbr --no-children --stdio # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 6K of event 'cycles:u' # Event count (approx.): 6459496645 # # Overhead Command Shared Object Symbol # ........ ........... ................ ........................ # 99.97% tchain_edit tchain_edit [.] f43 | --99.93%--f43 f42 f41 f40 f39 f38 f37 f36 f35 f34 f33 f32 f31 f30 f29 f28 f27 f26 f25 f24 f23 f22 f21 f20 f19 f18 f17 f16 f15 f14 f13 f12 f11 f10 f9 f8 f7 f6 f5 f4 f3 f2 f1 main __libc_start_main 0.02% tchain_edit [unknown] [k] 0xffffffff93a00b17 0.01% tchain_edit tchain_edit [.] f31 0.00% tchain_edit ld-2.29.so [.] _dl_important_hwcaps Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-14-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ff165628d72644e37674c5485658e8bd9f4a348b Author: Kan Liang Date: Thu Mar 19 13:25:12 2020 -0700 perf callchain: Stitch LBR call stack In LBR call stack mode, the depth of reconstructed LBR call stack limits to the number of LBR registers. For example, on skylake, the depth of reconstructed LBR call stack is always <= 32. # To display the perf.data header info, please use # --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 6K of event 'cycles' # Event count (approx.): 6487119731 # # Children Self Command Shared Object Symbol # ........ ........ ............... .................. # ................................ 99.97% 99.97% tchain_edit tchain_edit [.] f43 | --99.64%--f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25 f26 f27 f28 f29 f30 f31 f32 f33 f34 f35 f36 f37 f38 f39 f40 f41 f42 f43 For a call stack which is deeper than LBR limit, HW will overwrite the LBR register with oldest branch. Only partial call stacks can be reconstructed. However, the overwritten LBRs may still be retrieved from previous sample. At that moment, HW hasn't overwritten the LBR registers yet. Perf tools can stitch those overwritten LBRs on current call stacks to get a more complete call stack. To determine if LBRs can be stitched, perf tools need to compare current sample with previous sample. - They should have identical LBR records (Same from, to and flags values, and the same physical index of LBR registers). - The searching starts from the base-of-stack of current sample. Once perf determines to stitch the previous LBRs, the corresponding LBR cursor nodes will be copied to 'lists'. The 'lists' is to track the LBR cursor nodes which are going to be stitched. When the stitching is over, the nodes will not be freed immediately. They will be moved to 'free_lists'. Next stitching may reuse the space. Both 'lists' and 'free_lists' will be freed when all samples are processed. Committer notes: Fix the intel-pt.c initialization of the union with 'struct branch_flags', that breaks the build with its unnamed union on older gcc versions. Uninline thread__free_stitch_list(), as it grew big and started dragging includes to thread.h, so move it to thread.c where what it needs in terms of headers are already there. This fixes the build in several systems such as debian:experimental when cross building to the MIPS32 architecture, i.e. in the other cases what was needed was being included by sheer luck. In file included from builtin-sched.c:11: util/thread.h: In function 'thread__free_stitch_list': util/thread.h:169:3: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration] 169 | free(pos); | ^~~~ util/thread.h:169:3: error: incompatible implicit declaration of built-in function 'free' [-Werror] util/thread.h:19:1: note: include '' or provide a declaration of 'free' 18 | #include "callchain.h" +++ |+#include 19 | util/thread.h:174:3: error: incompatible implicit declaration of built-in function 'free' [-Werror] 174 | free(pos); | ^~~~ util/thread.h:174:3: note: include '' or provide a declaration of 'free' Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-13-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7f1d39317c071268b4204175df7cfbb2187acb72 Author: Kan Liang Date: Thu Mar 19 13:25:11 2020 -0700 perf callchain: Save previous cursor nodes for LBR stitching approach The cursor nodes which generates from sample are eventually added into callchain. To avoid generating cursor nodes from previous samples again, the previous cursor nodes are also saved for LBR stitching approach. Some option, e.g. hide-unresolved, may hide some LBRs. Add a variable 'valid' in struct callchain_cursor_node to indicate this case. The LBR stitching approach will only append the valid cursor nodes from previous samples later. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-12-kan.liang@linux.intel.com [ Use zfree() instead of open coded equivalent, and use it when freeing members of structs ] Signed-off-by: Arnaldo Carvalho de Melo commit 9c6c3f471d85a9b0bcda3ce6fc1e2646685e3f60 Author: Kan Liang Date: Thu Mar 19 13:25:10 2020 -0700 perf thread: Save previous sample for LBR stitching approach To retrieve the overwritten LBRs from previous sample for LBR stitching approach, perf has to save the previous sample. Only allocate the struct lbr_stitch once, when LBR stitching approach is enabled and kernel supports hw_idx. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-11-kan.liang@linux.intel.com [ Use zalloc()/zfree() for thread->lbr_stitch ] Signed-off-by: Arnaldo Carvalho de Melo commit 771fd155dfaa5332da69d606db16fe27bd9d388d Author: Kan Liang Date: Thu Mar 19 13:25:09 2020 -0700 perf thread: Add a knob for LBR stitch approach The LBR stitch approach should be disabled by default. Because - The stitching approach base on LBR call stack technology. The known limitations of LBR call stack technology still apply to the approach, e.g. Exception handing such as setjmp/longjmp will have calls/returns not match. - This approach is not foolproof. There can be cases where it creates incorrect call stacks from incorrect matches. There is no attempt to validate any matches in another way. The 'lbr_stitch_enable' is used to indicate whether enable LBR stitch approach, which is disabled by default. The following patch will introduce a new option for each tools to enable the LBR stitch approach. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-10-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e2b23483eb1d851b4c48935a995f79b2de41c3ed Author: Kan Liang Date: Thu Mar 19 13:25:08 2020 -0700 perf machine: Factor out lbr_callchain_add_lbr_ip() Both caller and callee needs to add ip from LBR to callchain. Factor out lbr_callchain_add_lbr_ip() to improve code readability. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-9-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit dd3e249a0c0ad88098922803b149c788bb364c23 Author: Kan Liang Date: Thu Mar 19 13:25:07 2020 -0700 perf machine: Factor out lbr_callchain_add_kernel_ip() Both caller and callee needs to add kernel ip to callchain. Factor out lbr_callchain_add_kernel_ip() to improve code readability. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-8-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e48b8311ca4538ec716196a1625812b045999f21 Author: Kan Liang Date: Thu Mar 19 13:25:06 2020 -0700 perf machine: Refine the function for LBR call stack reconstruction LBR only collect the user call stack. To reconstruct a call stack, both kernel call stack and user call stack are required. The function resolve_lbr_callchain_sample() mix the kernel call stack and user call stack. Now, with the help of HW idx, perf tool can reconstruct a more complete call stack by adding some user call stack from previous sample. However, current implementation is hard to be extended to support it. Current code path for resolve_lbr_callchain_sample() for (j = 0; j < mix_chain_nr; j++) { if (ORDER_CALLEE) { if (kernel callchain) Fill callchain info else if (LBR callchain) Fill callchain info } else { if (LBR callchain) Fill callchain info else if (kernel callchain) Fill callchain info } add_callchain_ip(); } With the patch, if (ORDER_CALLEE) { for (j = 0; j < NUM of kernel callchain) { Fill callchain info add_callchain_ip(); } for (; j < mix_chain_nr) { Fill callchain info add_callchain_ip(); } } else { for (; j < NUM of LBR callchain) { Fill callchain info add_callchain_ip(); } for (j = 0; j < mix_chain_nr) { Fill callchain info add_callchain_ip(); } } No functional changes. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-7-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f8603267bf8589f2a6a3e0a7de0a8dc6b6bd3c7d Author: Kan Liang Date: Thu Mar 19 13:25:05 2020 -0700 perf machine: Remove the indent in resolve_lbr_callchain_sample The indent is unnecessary in resolve_lbr_callchain_sample. Removing it will make the following patch simpler. Current code path for resolve_lbr_callchain_sample() /* LBR only affects the user callchain */ if (i != chain_nr) { body of the function .... return 1; } return 0; With the patch, /* LBR only affects the user callchain */ if (i == chain_nr) return 0; body of the function ... return 1; No functional changes. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-6-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f91ea283a1ed23e4a548ddd62db6deb2c707f82 Author: Kan Liang Date: Thu Mar 19 13:25:02 2020 -0700 perf header: Support CPU PMU capabilities To stitch LBR call stack, the max LBR information is required. So the CPU PMU capabilities information has to be stored in perf header. Add a new feature HEADER_CPU_PMU_CAPS for CPU PMU capabilities. Retrieve all CPU PMU capabilities, not just max LBR information. Add variable max_branches to facilitate future usage. Committer testing: # ls -la /sys/devices/cpu/caps/ total 0 drwxr-xr-x. 2 root root 0 Apr 17 10:53 . drwxr-xr-x. 6 root root 0 Apr 17 07:02 .. -r--r--r--. 1 root root 4096 Apr 17 10:53 max_precise # # cat /sys/devices/cpu/caps/max_precise 0 # perf record sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.033 MB perf.data (7 samples) ] # # perf report --header-only | egrep 'cpu(desc|.*capabilities)' # cpudesc : AMD Ryzen 5 3600X 6-Core Processor # cpu pmu capabilities: max_precise=0 # And then on an Intel machine: $ ls -la /sys/devices/cpu/caps/ total 0 drwxr-xr-x. 2 root root 0 Apr 17 10:51 . drwxr-xr-x. 6 root root 0 Apr 17 10:04 .. -r--r--r--. 1 root root 4096 Apr 17 11:37 branches -r--r--r--. 1 root root 4096 Apr 17 10:51 max_precise -r--r--r--. 1 root root 4096 Apr 17 11:37 pmu_name $ cat /sys/devices/cpu/caps/max_precise 3 $ cat /sys/devices/cpu/caps/branches 32 $ cat /sys/devices/cpu/caps/pmu_name skylake $ perf record sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.001 MB perf.data (8 samples) ] $ perf report --header-only | egrep 'cpu(desc|.*capabilities)' # cpudesc : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz # cpu pmu capabilities: branches=32, max_precise=3, pmu_name=skylake $ Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-3-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3a6c51e4d66cf2fbc05583247b2d2f1179e8a74c Author: Jiri Olsa Date: Fri Apr 17 00:14:05 2020 +0200 perf parser: Add support to specify rXXX event with pmu The current rXXXX event specification creates event under PERF_TYPE_RAW pmu type. This change allows to use rXXXX within pmu syntax, so it's type is used via the following syntax: -e 'cpu/r3c/' -e 'cpum_cf/r0/' The XXXX number goes directly to perf_event_attr::config the same way as in '-e rXXXX' event. The perf_event_attr::type is filled with pmu type. Committer testing: So, lets see what goes in perf_event_attr::config for, say, the 'instructions' PERF_TYPE_HARDWARE (0) event, first we should look at how to encode this event as a PERF_TYPE_RAW event for this specific CPU, an AMD Ryzen 5: # cat /sys/devices/cpu/events/instructions event=0xc0 # Then try with it _and_ the instruction, just to see that they are close enough: # perf stat -e rc0,instructions sleep 1 Performance counter stats for 'sleep 1': 919,794 rc0 919,898 instructions 1.000754579 seconds time elapsed 0.000715000 seconds user 0.000000000 seconds sys # Now we should try, before this patch, the PMU event encoding: # perf stat -e cpu/rc0/ sleep 1 event syntax error: 'cpu/rc0/' \___ unknown term valid terms: event,edge,inv,umask,cmask,config,config1,config2,name,period,percore # Now with this patch, the three ways of specifying the 'instructions' CPU counter are accepted: # perf stat -e cpu/rc0/,rc0,instructions sleep 1 Performance counter stats for 'sleep 1': 892,948 cpu/rc0/ 893,052 rc0 893,156 instructions 1.000931819 seconds time elapsed 0.000916000 seconds user 0.000000000 seconds sys # Requested-by: Thomas Richter Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Tested-by: Thomas Richter Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sumanth Korikkar Cc: Vasily Gorbik Link: http://lore.kernel.org/lkml/20200416221405.437788-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e9cfa47e687d77d256610b7124d736776f137ea0 Author: Ian Rogers Date: Thu Apr 16 09:20:55 2020 -0700 perf doc: allow ASCIIDOC_EXTRA to be an argument This will allow parent makefiles to pass values to asciidoc. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Budankov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Florian Fainelli Cc: Greg Kroah-Hartman Cc: Igor Lubashev Cc: Jin Yao Cc: Jiri Olsa Cc: Jiwei Sun Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian Link: http://lore.kernel.org/lkml/20200416162058.201954-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9fbc61f832ebf432326a90e28184dade05ee34a8 Author: Kan Liang Date: Thu Mar 19 13:25:01 2020 -0700 perf pmu: Add support for PMU capabilities The PMU capabilities information, which is located at /sys/bus/event_source/devices//caps, is required by perf tool. For example, the max LBR information is required to stitch LBR call stack. Add perf_pmu__caps_parse() to parse the PMU capabilities information. The information is stored in a list. The following patch will store the capabilities information in perf header. Committer notes: Here's an example of such directories and its files in an i5 7th gen machine: [root@seventh ~]# ls -lad /sys/bus/event_source/devices/*/caps drwxr-xr-x. 2 root root 0 Apr 14 13:33 /sys/bus/event_source/devices/cpu/caps drwxr-xr-x. 2 root root 0 Apr 14 13:33 /sys/bus/event_source/devices/intel_pt/caps [root@seventh ~]# ls -la /sys/bus/event_source/devices/intel_pt/caps total 0 drwxr-xr-x. 2 root root 0 Apr 14 13:33 . drwxr-xr-x. 5 root root 0 Apr 14 13:12 .. -r--r--r--. 1 root root 4096 Apr 16 13:10 cr3_filtering -r--r--r--. 1 root root 4096 Apr 16 11:42 cycle_thresholds -r--r--r--. 1 root root 4096 Apr 16 13:10 ip_filtering -r--r--r--. 1 root root 4096 Apr 16 13:10 max_subleaf -r--r--r--. 1 root root 4096 Apr 14 13:33 mtc -r--r--r--. 1 root root 4096 Apr 14 13:33 mtc_periods -r--r--r--. 1 root root 4096 Apr 16 13:10 num_address_ranges -r--r--r--. 1 root root 4096 Apr 16 13:10 output_subsys -r--r--r--. 1 root root 4096 Apr 16 13:10 payloads_lip -r--r--r--. 1 root root 4096 Apr 16 13:10 power_event_trace -r--r--r--. 1 root root 4096 Apr 14 13:33 psb_cyc -r--r--r--. 1 root root 4096 Apr 14 13:33 psb_periods -r--r--r--. 1 root root 4096 Apr 16 13:10 ptwrite -r--r--r--. 1 root root 4096 Apr 16 13:10 single_range_output -r--r--r--. 1 root root 4096 Apr 16 12:03 topa_multiple_entries -r--r--r--. 1 root root 4096 Apr 16 13:10 topa_output [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/topa_output 1 [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/topa_multiple_entries 1 [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/mtc 1 [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/power_event_trace 0 [root@seventh ~]# [root@seventh ~]# ls -la /sys/bus/event_source/devices/cpu/caps/ total 0 drwxr-xr-x. 2 root root 0 Apr 14 13:33 . drwxr-xr-x. 6 root root 0 Apr 14 13:12 .. -r--r--r--. 1 root root 4096 Apr 16 13:10 branches -r--r--r--. 1 root root 4096 Apr 14 13:33 max_precise -r--r--r--. 1 root root 4096 Apr 16 13:10 pmu_name [root@seventh ~]# cat /sys/bus/event_source/devices/cpu/caps/max_precise 3 [root@seventh ~]# cat /sys/bus/event_source/devices/cpu/caps/branches 32 [root@seventh ~]# cat /sys/bus/event_source/devices/cpu/caps/pmu_name skylake [root@seventh ~]# Wow, first time I've heard about /sys/bus/event_source/devices/cpu/caps/max_precise, I think I'll use it! :-) Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-2-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f8ff18be1f5c6ba1c2befb043bea6e7eaf9f8987 Author: He Zhe Date: Thu Feb 20 09:58:50 2020 +0800 tools lib traceevent: Take care of return value of asprintf According to the API, if memory allocation wasn't possible, or some other error occurs, asprintf will return -1, and the contents of strp below are undefined. int asprintf(char **strp, const char *fmt, ...); This patch takes care of return value of asprintf to make it less error prone and prevent the following build warning. ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: He Zhe Reviewed-by: Steven Rostedt (VMware) Cc: Tzvetomir Stoyanov Cc: hewenliang4@huawei.com Link: http://lore.kernel.org/lkml/1582163930-233692-1-git-send-email-zhe.he@windriver.com Signed-off-by: Arnaldo Carvalho de Melo commit bec49a9e05db3dbdca696fa07c62c52638fb6371 Author: Stephane Eranian Date: Tue Apr 14 09:15:50 2020 -0700 perf stat: Force error in fallback on :k events When it is not possible for a non-privilege perf command to monitor at the kernel level (:k), the fallback code forces a :u. That works if the event was previously monitoring both levels. But if the event was already constrained to kernel only, then it does not make sense to restrict it to user only. Given the code works by exclusion, a kernel only event would have: attr->exclude_user = 1 The fallback code would add: attr->exclude_kernel = 1 In the end the end would not monitor in either the user level or kernel level. In other words, it would count nothing. An event programmed to monitor kernel only cannot be switched to user only without seriously warning the user. This patch forces an error in this case to make it clear the request cannot really be satisfied. Behavior with paranoid 1: $ sudo bash -c "echo 1 > /proc/sys/kernel/perf_event_paranoid" $ perf stat -e cycles:k sleep 1 Performance counter stats for 'sleep 1': 1,520,413 cycles:k 1.002361664 seconds time elapsed 0.002480000 seconds user 0.000000000 seconds sys Old behavior with paranoid 2: $ sudo bash -c "echo 2 > /proc/sys/kernel/perf_event_paranoid" $ perf stat -e cycles:k sleep 1 Performance counter stats for 'sleep 1': 0 cycles:ku 1.002358127 seconds time elapsed 0.002384000 seconds user 0.000000000 seconds sys New behavior with paranoid 2: $ sudo bash -c "echo 2 > /proc/sys/kernel/perf_event_paranoid" $ perf stat -e cycles:k sleep 1 Error: You may not have permission to collect stats. Consider tweaking /proc/sys/kernel/perf_event_paranoid, which controls use of the performance events system by unprivileged users (without CAP_PERFMON or CAP_SYS_ADMIN). The current value is 2: -1: Allow use of (almost) all events by all users Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK >= 0: Disallow ftrace function tracepoint by users without CAP_PERFMON or CAP_SYS_ADMIN Disallow raw tracepoint access by users without CAP_SYS_PERFMON or CAP_SYS_ADMIN >= 1: Disallow CPU event access by users without CAP_PERFMON or CAP_SYS_ADMIN >= 2: Disallow kernel profiling by users without CAP_PERFMON or CAP_SYS_ADMIN To make this setting permanent, edit /etc/sysctl.conf too, e.g.: kernel.perf_event_paranoid = -1 v2 of this patch addresses the review feedback from jolsa@redhat.com. Signed-off-by: Stephane Eranian Reviewed-by: Ian Rogers Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200414161550.225588-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e345997914a8af5e8362e884d2fee38bd2e9c6d8 Author: Adrian Hunter Date: Wed Apr 1 13:16:13 2020 +0300 perf tools: Add support for leader-sampling with AUX area events When AUX area events are used in sampling mode, they must be the group leader, but the group leader is also used for leader-sampling. However, it is not desirable to use an AUX area event as the leader for leader-sampling, because it doesn't have any samples of its own. To support leader-sampling with AUX area events, use the 2nd event of the group as the "leader" for the purposes of leader-sampling. Example: # perf record --kcore --aux-sample -e '{intel_pt//,cycles,instructions}:S' -c 10000 uname [ perf record: Woken up 3 times to write data ] [ perf record: Captured and wrote 0.786 MB perf.data ] # perf report Samples: 380 of events 'anon group { cycles, instructions }', Event count (approx.): 3026164 Children Self Command Shared Object Symbol + 38.76% 42.65% 0.00% 0.00% uname [kernel.kallsyms] [k] __x86_indirect_thunk_rax + 35.82% 31.33% 0.00% 0.00% uname ld-2.28.so [.] _dl_start_user + 34.29% 29.74% 0.55% 0.47% uname ld-2.28.so [.] _dl_start + 33.73% 28.62% 1.60% 0.97% uname ld-2.28.so [.] dl_main + 33.19% 29.04% 0.52% 0.32% uname ld-2.28.so [.] _dl_sysdep_start + 27.83% 33.74% 0.00% 0.00% uname [kernel.kallsyms] [k] do_syscall_64 + 26.76% 33.29% 0.00% 0.00% uname [kernel.kallsyms] [k] entry_SYSCALL_64_after_hwframe + 23.78% 20.33% 5.97% 5.25% uname [kernel.kallsyms] [k] page_fault + 23.18% 24.60% 0.00% 0.00% uname libc-2.28.so [.] __libc_start_main + 22.64% 24.37% 0.00% 0.00% uname uname [.] _start + 21.04% 23.27% 0.00% 0.00% uname uname [.] main + 19.48% 18.08% 3.72% 3.64% uname ld-2.28.so [.] _dl_relocate_object + 19.47% 21.81% 0.00% 0.00% uname libc-2.28.so [.] setlocale + 19.44% 21.56% 0.52% 0.61% uname libc-2.28.so [.] _nl_find_locale + 17.87% 19.66% 0.00% 0.00% uname libc-2.28.so [.] _nl_load_locale_from_archive + 15.71% 13.73% 0.53% 0.52% uname [kernel.kallsyms] [k] do_page_fault + 15.18% 13.21% 1.03% 0.68% uname [kernel.kallsyms] [k] handle_mm_fault + 14.15% 12.53% 1.01% 1.12% uname [kernel.kallsyms] [k] __handle_mm_fault + 12.03% 9.67% 0.54% 0.32% uname ld-2.28.so [.] _dl_map_object + 10.55% 8.48% 0.00% 0.00% uname ld-2.28.so [.] openaux + 10.55% 20.20% 0.52% 0.61% uname libc-2.28.so [.] __run_exit_handlers Comnmitter notes: Fixed up this problem: util/record.c: In function ‘perf_evlist__config’: util/record.c:256:3: error: too few arguments to function ‘perf_evsel__config_leader_sampling’ 256 | perf_evsel__config_leader_sampling(evsel); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util/record.c:190:13: note: declared here 190 | static void perf_evsel__config_leader_sampling(struct evsel *evsel, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-17-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 94d3820f2e18d3c88f833baec8d6ad5b3489fa59 Author: Adrian Hunter Date: Wed Apr 1 13:16:12 2020 +0300 perf evlist: Allow multiple read formats Tools find the correct evsel, and therefore read format, using the event ID, so it isn't necessary for all read formats to be the same. In the case of leader-sampling of AUX area events, dummy tracking events will have a different read format, so relax the validation to become a debug message only. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-16-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3713eb371c873e6bed713d78f1bdd5e8be0764a3 Author: Adrian Hunter Date: Wed Apr 1 13:16:11 2020 +0300 perf evsel: Rearrange perf_evsel__config_leader_sampling() In preparation for adding support for leader sampling with AUX area events. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-15-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5f34278867b78bed77dcbd723056244e9bfc12ef Author: Adrian Hunter Date: Wed Apr 1 13:16:10 2020 +0300 perf evlist: Move leader-sampling configuration Move leader-sampling configuration in preparation for adding support for leader sampling with AUX area events. Committer notes: It only makes sense when configuring an evsel that is part of an evlist, so the only case where it is called outside perf_evlist__config(), in some 'perf test' entry, is safe, and even there we should just use perf_evlist__config(), but since in that case we have just one evsel in the evlist, it is equivalent. Also fixed up this problem: util/record.c: In function ‘perf_evlist__config’: util/record.c:223:3: error: too many arguments to function ‘perf_evsel__config_leader_sampling’ 223 | perf_evsel__config_leader_sampling(evsel, evlist); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util/record.c:170:13: note: declared here 170 | static void perf_evsel__config_leader_sampling(struct evsel *evsel) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-14-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e12ee9f7513cb5dbe8b12aac030dfbeff35b3766 Author: Adrian Hunter Date: Wed Apr 1 13:16:09 2020 +0300 perf evsel: Move and globalize perf_evsel__find_pmu() and perf_evsel__is_aux_event() Move and globalize 2 functions from the auxtrace specific sources so that they can be reused. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-13-adrian.hunter@intel.com [ Move to pmu.c, as moving to evsel.h breaks the python binding ] Signed-off-by: Arnaldo Carvalho de Melo commit 31a02eb70b8d9e68c848f2543fa8e745073363e2 Author: Michael J. Ruhl Date: Fri Apr 17 15:51:07 2020 -0400 drm/i915: Refactor setting dma info to a common helper DMA_MASK bit values are different for different generations. This will become more difficult to manage over time with the open coded usage of different versions of the device. Fix by: disallow setting of dma mask in AGP path (< GEN(5) for i915, add dma_mask_size to the device info configuration, updating open code call sequence to the latest interface, refactoring into a common function for setting the dma segment and mask info Reviewed-by: Chris Wilson Signed-off-by: Michael J. Ruhl cc: Brian Welty cc: Daniele Ceraolo Spurio Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200417195107.68732-1-michael.j.ruhl@intel.com commit 7479f3c90a6d6f0a8c9b8a53b3856ac1002a8587 Author: Colin Ian King Date: Fri Apr 17 17:08:29 2020 +0100 drm/i915: remove redundant assignment to variable test_result The variable test_result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200417160829.112776-1-colin.king@canonical.com commit 65bb9dd0ec7966880b68b252b9a71585f0b539e8 Author: Anshuman Gupta Date: Fri Apr 17 22:58:35 2020 +0530 drm/i915: Add ICL PG3 PW ID for EHL Gen11 onwards PG3 contains functions for pipe B, external displays, and VGA. Add missing ICL_DISP_PW_3 for ehl_power_wells. Cc: Animesh Manna Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1737 Signed-off-by: Anshuman Gupta Acked-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200417172835.15461-1-anshuman.gupta@intel.com commit edcb9028d66b44d74ba4f8b9daa379b004dc1f85 Author: José Roberto de Souza Date: Tue Apr 14 16:04:40 2020 -0700 drm/i915/display: Load DP_TP_CTL/STATUS offset before use it Right now dp.regs.dp_tp_ctl/status are only set during the encoder pre_enable() hook, what is causing all reads and writes to those registers to go to offset 0x0 before pre_enable() is executed. So if i915 takes the BIOS state and don't do a modeset any following link retraing will fail. In the case that i915 needs to do a modeset, the DDI disable sequence will write to a wrong register not disabling DP 'Transport Enable' in DP_TP_CTL, making a HDMI modeset in the same port/transcoder to not light up the monitor. So here for GENs older than 12, that have those registers fixed at port offset range it is loading at encoder/port init while for GEN12 it will keep setting it at encoder pre_enable() and during HW state readout. Fixes: 4444df6e205b ("drm/i915/tgl: move DP_TP_* to transcoder") Cc: Matt Roper Cc: Lucas De Marchi Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200414230442.262092-1-jose.souza@intel.com commit 0f8925090ac7ad451ed9e803662ebe3214dc8072 Author: José Roberto de Souza Date: Tue Apr 14 12:49:56 2020 -0700 drm/i915/tc: Do not warn when aux power well of static TC ports timeout This is a expected timeout of static TC ports not conneceted, so not throwing warnings that would taint CI. v3: - moved checks to tc_phy_aux_timeout_expected() v4: - moved and add comments to tc_phy_aux_timeout_expected() v5: - only checking tc_legacy_port for TC ports Signed-off-by: José Roberto de Souza Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-8-jose.souza@intel.com commit 3ed347d1a73ea485ea9f68df64e95cc164e1a790 Author: José Roberto de Souza Date: Tue Apr 14 12:49:55 2020 -0700 drm/i915/tc: Catch TC users accessing FIA registers without enable aux As described in "drm/i915/tc/icl: Implement TC cold sequences" users of TC functions should held aux power well during access to avoid read garbage due HW in TC cold state. v3: - renamed is_tc_cold_blocked() to assert_tc_cold_blocked() - restored the removed 0xffffffff checks Reviewed-by: Imre Deak Tested-by: You-Sheng Yang Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-7-jose.souza@intel.com commit 3c02934b24e37344b8c1c6f9df55efc8891e6251 Author: José Roberto de Souza Date: Tue Apr 14 12:49:54 2020 -0700 drm/i915/tc/tgl: Implement TC cold sequences TC ports can enter in TCCOLD to save power and is required to request to PCODE to exit this state before use or read to TC registers. For TGL there is a new MBOX command to do that with a parameter to ask PCODE to exit and block TCCOLD entry or unblock TCCOLD entry. So adding a new power domain to reuse the refcount and only allow TC cold when all TC ports are not in use. v2: - fixed missing case in intel_display_power_domain_str() - moved tgl_tc_cold_request to intel_display_power.c - renamed TGL_TC_COLD_OFF to TGL_TC_COLD_OFF_POWER_DOMAINS - added all TC and TBT aux power domains to TGL_TC_COLD_OFF_POWER_DOMAINS v3: - added one msec sleep when PCODE returns -EAGAIN - added timeout of 5msec to not loop forever if sandybridge_pcode_write_timeout() keeps returning -EAGAIN v4: - Made failure to block or unblock TC cold a error - removed 5msec timeout, instead giving PCODE 1msec by up 3 times to recover from the internal error v5: - only sleeping 1msec when ret is -EAGAIN BSpec: 49294 Cc: Imre Deak Cc: Cooper Chiou Cc: Kai-Heng Feng Reviewed-by: Imre Deak Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-6-jose.souza@intel.com commit 7ce40a671538c225ea8eb170830cad90b16ec211 Author: José Roberto de Souza Date: Tue Apr 14 12:49:53 2020 -0700 drm/i915/tc: Skip ref held check for TC legacy aux power wells As part of ICL TC cold exit sequences we need to request aux power well before lock the access to TC ports, so skiping the intel_tc_port_ref_held() check for TC legacy ports. Reviewed-by: Imre Deak Tested-by: You-Sheng Yang Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-5-jose.souza@intel.com commit feb7e0ef5ff820ee7242bb46cfe3d0dd3e234c38 Author: José Roberto de Souza Date: Tue Apr 14 12:49:52 2020 -0700 drm/i915/tc/icl: Implement TC cold sequences This is required for legacy/static TC ports as IOM is not aware of the connection and will not trigger the TC cold exit. Just request PCODE to exit TCCOLD is not enough as it could enter again before driver makes use of the port, to prevent it BSpec states that aux powerwell should be held. So here embedding the TC cold exit sequence into ICL aux enable, it will enable aux and then request TC cold to exit. The TC cold block(exit and aux hold) and unblock was added to some exported TC functions for the others and to access PHY registers, callers should enable and keep aux powerwell enabled during access. Also adding TC cold check and warnig in tc_port_load_fia_params() as at this point of the driver initialization we can't request power wells, if we get this warning we will need to figure out how to handle it. v2: - moved ICL TC cold exit function to intel_display_power - using dig_port->tc_legacy_port to only execute sequences for legacy ports, hopefully VBTs will have this right - fixed check to call _hsw_power_well_continue_enable() - calling _hsw_power_well_continue_enable() unconditionally in icl_tc_phy_aux_power_well_enable(), if needed we will surpress timeout warnings of TC legacy ports - only blocking TC cold around fia access v3: - added timeout of 5msec to not loop forever if sandybridge_pcode_write_timeout() keeps returning -EAGAIN returning -EAGAIN in in icl_tc_cold_exit() - removed leftover tc_cold_wakeref - added one msec sleep when PCODE returns -EAGAIN v4: - removed 5msec timeout, instead giving 1msec to whoever is using PCODE to finish it up to 3 times - added a comment about turn TC cold exit failure as a error in future BSpec: 21750 Closes: https://gitlab.freedesktop.org/drm/intel/issues/1296 Cc: Imre Deak Cc: Cooper Chiou Cc: Kai-Heng Feng Reviewed-by: Imre Deak Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-4-jose.souza@intel.com commit f8bb28e63a1e9f46fe15f63e924fab643ff8abe0 Author: José Roberto de Souza Date: Tue Apr 14 12:49:51 2020 -0700 drm/i915/display: Split hsw_power_well_enable() into two This is a preparation for ICL TC cold exit sequences. v2: - renamed new functions to hsw_power_well_enable_prepare()/complete() Signed-off-by: José Roberto de Souza Reviewed-by: Imre Deak Tested-by: You-Sheng Yang Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-3-jose.souza@intel.com commit 7109cb51517267ef0631da293d80a26f4e18d3ba Author: Saurav Kashyap Date: Thu Apr 16 01:43:14 2020 -0700 scsi: qedf: Get dev info after updating the params An update to pf params can change the devinfo. Get updated device information. [mkp: updated error message spotted by Sergei Shtylyov] Link: https://lore.kernel.org/r/20200416084314.18851-10-skashyap@marvell.com Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit dba6b0b4eab362a886db616ee38c1d624914d98b Author: José Roberto de Souza Date: Tue Apr 14 12:49:50 2020 -0700 drm/i915/display: Add intel_legacy_aux_to_power_domain() This is a similar function to intel_aux_power_domain() but it do not care about TBT ports, this will be needed by ICL TC sequences. v2: - renamed to intel_legacy_aux_to_power_domain() Cc: Imre Deak Cc: Cooper Chiou Cc: Kai-Heng Feng Reviewed-by: Imre Deak Tested-by: You-Sheng Yang Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-2-jose.souza@intel.com commit ad40f5256095c68dc17c991eb976261d5ea2daaa Author: Chad Dupuis Date: Thu Apr 16 01:43:13 2020 -0700 scsi: qedf: Fix crash when MFW calls for protocol stats while function is still probing The MFW may make a call to qed and then to qedf for protocol statistics while the function is still probing. If this happens it's possible that some members of the struct qedf_ctx may not be fully initialized which can result in a NULL pointer dereference or general protection fault. To prevent this, add a new flag call QEDF_PROBING and set it when the __qedf_probe() function is active. Then in the qedf_get_protocol_tlv_data() function we can check if the function is still probing and return immediantely before any uninitialized structures can be touched. Link: https://lore.kernel.org/r/20200416084314.18851-9-skashyap@marvell.com Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit 34a3f0b273a7196b98668324556bce9f6dc091d7 Author: José Roberto de Souza Date: Tue Apr 14 12:49:49 2020 -0700 drm/i915/display: Move out code to return the digital_port of the aux ch Moving the code to return the digital port of the aux channel also removing the intel_phy_is_tc() to make it generic. digital_port will be needed in icl_tc_phy_aux_power_well_enable() so adding it as a parameter to icl_tc_port_assert_ref_held(). While at at removing the duplicated call to icl_tc_phy_aux_ch() in icl_tc_port_assert_ref_held(). v2: - fixed build when DRM_I915_DEBUG_RUNTIME_PM is not set - moved to before hsw_wait_for_power_well_enable() as it will be needed by hsw_wait_for_power_well_enable() in a future patch v4: - fixed action of if (!dig_port), continue instead of return Cc: You-Sheng Yang Reviewed-by: Imre Deak Tested-by: You-Sheng Yang Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-1-jose.souza@intel.com commit f6b172f21999cf5a18a49d6c028ba46b1c9ce02f Author: Chad Dupuis Date: Thu Apr 16 01:43:12 2020 -0700 scsi: qedf: Add schedule recovery handler Implement recovery handler to be used by QED to signal the need for recovery to come out of an error condition like ramrod struck and firmware context reset. Link: https://lore.kernel.org/r/20200416084314.18851-8-skashyap@marvell.com Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit 6e7c8eea929e547f5f8f453a3d72b36b8e40bf4d Author: Saurav Kashyap Date: Thu Apr 16 01:43:11 2020 -0700 scsi: qedf: Implement callback for bw_update Add support for the common qed bw_update callback to qedf. This function is called whenever there is a reported change in the bandwidth and updates corresponding values in sysfs. Link: https://lore.kernel.org/r/20200416084314.18851-7-skashyap@marvell.com Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit 699fed4a2d8e32d77d64928e570d7ffd93a62fdf Author: Sudarsana Reddy Kalluru Date: Thu Apr 16 01:43:10 2020 -0700 scsi: qed: Send BW update notifications to the protocol drivers Management firmware (MFW) sends a notification whenever there is a change in the bandwidth values. Add driver support for sending this notification to the upper layer drivers (e.g., qedf). Link: https://lore.kernel.org/r/20200416084314.18851-6-skashyap@marvell.com Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit fedc173e46d31b2b3a2744947ac5ea4cb351f6b1 Author: Javed Hasan Date: Thu Apr 16 01:43:09 2020 -0700 scsi: qedf: Honor status qualifier in FCP_RSP per spec Handle scope and qualifier on SAM_STAT_TASK_SET_FULL or SAM_STAT_BUSY [mkp: added braces to fix sparse complaint] Link: https://lore.kernel.org/r/20200416084314.18851-5-skashyap@marvell.com Signed-off-by: Javed Hasan Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit 334b4f988f73dd70b80132933b0866bad0e0e221 Author: Javed Hasan Date: Thu Apr 16 01:43:08 2020 -0700 scsi: qedf: Acquire rport_lock for resetting the delay_timestamp Retry delay timestamp is updated in queuecommand as well as in qedf_scsi_completion routine. Protect it using lock. Link: https://lore.kernel.org/r/20200416084314.18851-4-skashyap@marvell.com Signed-off-by: Javed Hasan Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit b0c4187e2616e9ecb1359f6bce2e93dd9593120b Author: Javed Hasan Date: Thu Apr 16 01:43:07 2020 -0700 scsi: qedf: Increase the upper limit of retry delay Max time to hold the IO in case of SAM_STAT_TASK_SET_FULL or SAM_STAT_BUSY. Link: https://lore.kernel.org/r/20200416084314.18851-3-skashyap@marvell.com Signed-off-by: Javed Hasan Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit ab0a82991fcaae0b0d895c0aea36e91730c2d00a Author: Saurav Kashyap Date: Thu Apr 16 01:43:06 2020 -0700 scsi: qedf: Keep track of num of pending flogi If a port is brought down for an extended period of time, the fipvlan counter gets exhausted and the driver will fall back to default VLAN 1002 and call fcoe_ctlr_link_up to log in. However, the switch will discard the FLOGI attempt because the VLAN is now different. Keep track of the number of FLOGI attempts and if a threshold of QEDF_FLOGI_RETRY_CNT is exceeded, perform a context soft reset. Link: https://lore.kernel.org/r/20200416084314.18851-2-skashyap@marvell.com Signed-off-by: Saurav Kashyap Signed-off-by: Martin K. Petersen commit c0ff9e5e69f33ce5051f33cc4cb35afa754de01c Author: José Roberto de Souza Date: Thu Apr 16 11:58:41 2020 -0700 drm/i915: Add missing deinitialization cases of load failure The intel_display_power_put_async() used in TC cold sequences made easy to hit the missing deinitialization of driver in case of load failure as seen in the stack trace bellow. intel_modeset_driver_remove_noirq() had to be removed from i915_driver_modeset_remove_noirq() as those are different initialialition steps with IRQ and GEM initialization in between then. [drm:__intel_engine_init_ctx_wa [i915]] Initialized 3 context workarounds on rcs'0 [drm:__i915_inject_probe_error [i915]] Injecting failure -19 at checkpoint 36 [__uc_init:294] [drm:i915_hdcp_component_unbind [i915]] I915 HDCP comp unbind [drm:edp_panel_vdd_off_sync [i915]] Turning [ENCODER:275:DDI A] VDD off [drm:edp_panel_vdd_off_sync [i915]] PP_STATUS: 0x00000000 PP_CONTROL: 0x00000060 [drm:intel_power_well_disable [i915]] disabling AUX A general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] PREEMPT SMP NOPTI CPU: 3 PID: 1142 Comm: kworker/u16:20 Tainted: G U 5.6.0-CI-Patchwork_17226+ #1 Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2457.A16.1912270059 12/27/2019 Workqueue: events_unbound intel_display_power_put_async_work [i915] RIP: 0010:__intel_display_power_put_domain+0xa5/0x180 [i915] Code: 48 85 c0 78 54 44 89 e1 41 bd 01 00 00 00 49 c7 c4 80 44 41 a0 49 d3 e5 eb 0d 48 83 eb 10 48 3b 9d 08 ad 00 00 78 32 48 8b 03 <4c> 85 68 10 74 ea 8b 53 08 85 d2 74 2d 83 ea 01 85 d2 89 53 08 75 RSP: 0018:ffffc9000061fdb0 EFLAGS: 00010206 RAX: 6b6b6b6b6b6b6b6b RBX: ffff8884948f5df0 RCX: 000000000000003d RDX: 0000000080000001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff888479be0000 R08: ffff88849a180920 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa0414480 R13: 2000000000000000 R14: ffff888479beb320 R15: 2000000000000000 FS: 0000000000000000(0000) GS:ffff88849ff80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005634fa8ed670 CR3: 0000000005610004 CR4: 0000000000760ee0 PKRU: 55555554 Call Trace: release_async_put_domains+0x9b/0x110 [i915] intel_display_power_put_async_work+0x91/0xf0 [i915] process_one_work+0x260/0x600 ? worker_thread+0xc9/0x380 worker_thread+0x37/0x380 ? process_one_work+0x600/0x600 kthread+0x119/0x130 ? kthread_park+0x80/0x80 ret_from_fork+0x24/0x50 Modules linked in: i915(+) vgem snd_hda_codec_hdmi mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul cdc_ether usbnet mii snd_intel_dspcfg ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core e1000e ptp mei_me snd_pcm pps_core mei intel_lpss_pci prime_numbers [last unloaded: i915] ---[ end trace b402d1b4060f8b97 ]--- BUG: sleeping function called from invalid context at kernel/sched/completion.c:99 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 1142, name: kworker/u16:20 INFO: lockdep is turned off. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 3 PID: 1142 Comm: kworker/u16:20 Tainted: G UD 5.6.0-CI-Patchwork_17226+ #1 Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2457.A16.1912270059 12/27/2019 Workqueue: events_unbound intel_display_power_put_async_work [i915] Call Trace: dump_stack+0x71/0x9b ___might_sleep+0x178/0x260 wait_for_completion+0x37/0x1a0 virt_efi_query_variable_info+0x161/0x1b0 efi_query_variable_store+0xb3/0x1a0 ? efivar_entry_set_safe+0x19c/0x220 efivar_entry_set_safe+0x19c/0x220 ? efi_pstore_write+0x10b/0x150 ? efi_pstore_write+0xa0/0x150 efi_pstore_write+0x10b/0x150 pstore_dump+0x123/0x340 kmsg_dump+0x87/0x1b0 oops_end+0x3e/0x90 do_general_protection+0x1c3/0x2f0 general_protection+0x2d/0x40 RIP: 0010:__intel_display_power_put_domain+0xa5/0x180 [i915] Code: 48 85 c0 78 54 44 89 e1 41 bd 01 00 00 00 49 c7 c4 80 44 41 a0 49 d3 e5 eb 0d 48 83 eb 10 48 3b 9d 08 ad 00 00 78 32 48 8b 03 <4c> 85 68 10 74 ea 8b 53 08 85 d2 74 2d 83 ea 01 85 d2 89 53 08 75 RSP: 0018:ffffc9000061fdb0 EFLAGS: 00010206 RAX: 6b6b6b6b6b6b6b6b RBX: ffff8884948f5df0 RCX: 000000000000003d RDX: 0000000080000001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff888479be0000 R08: ffff88849a180920 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa0414480 R13: 2000000000000000 R14: ffff888479beb320 R15: 2000000000000000 release_async_put_domains+0x9b/0x110 [i915] intel_display_power_put_async_work+0x91/0xf0 [i915] process_one_work+0x260/0x600 ? worker_thread+0xc9/0x380 worker_thread+0x37/0x380 ? process_one_work+0x600/0x600 kthread+0x119/0x130 ? kthread_park+0x80/0x80 ret_from_fork+0x24/0x50 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 1142 at kernel/rcu/tree_plugin.h:293 rcu_note_context_switch+0x87/0x650 Modules linked in: i915(+) vgem snd_hda_codec_hdmi mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul cdc_ether usbnet mii snd_intel_dspcfg ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core e1000e ptp mei_me snd_pcm pps_core mei intel_lpss_pci prime_numbers [last unloaded: i915] v2: - fixed handling in case of failure in drm_vblank_init() - moved i915_gem_driver_remove() call to before i915_driver_modeset_remove_noirq() this match initialization order too v3: - reverting call swap between i915_reset_error_state() and i915_gem_driver_remove() call order - improved label naming in i915_driver_modeset_probe_noirq() Closes: https://gitlab.freedesktop.org/drm/intel/issues/1647 Cc: Imre Deak Cc: Ville Syrjälä Cc: Jani Nikula Reviewed-by: Imre Deak Reviewed-by: Chris Wilson Signed-off-by: José Roberto de Souza Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200416185841.125686-1-jose.souza@intel.com commit d21481994039d36aec21b56c4710aae684e107f1 Author: Jason Yan Date: Wed Apr 15 16:50:53 2020 +0800 scsi: mvsas: remove unused symbol 'mvs_th' This symbol has no users so remove it. Link: https://lore.kernel.org/r/20200415085053.7633-1-yanaijie@huawei.com Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit a677ab35a9670f3dd1f16398d1d94bb22efed38f Author: Jason Yan Date: Wed Apr 15 16:50:44 2020 +0800 scsi: mvsas: make mvst_host_attrs static Fix the following sparse warning: drivers/scsi/mvsas/mv_init.c:28:25: warning: symbol 'mvst_host_attrs' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200415085044.7460-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 44578ecef7ace298ea3d121777955bc2f6e90c30 Author: Jason Yan Date: Wed Apr 15 16:50:29 2020 +0800 scsi: qedi: make qedi_ll2_buf_size static Fix the following sparse warning: drivers/scsi/qedi/qedi_main.c:44:6: warning: symbol 'qedi_ll2_buf_size' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200415085029.7170-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 089f5b64b8af10aaef176f91144275d25e71e2ff Author: Asutosh Das Date: Mon Apr 13 23:14:48 2020 -0700 scsi: ufs: full reinit upon resume if link was off During suspend, if the link is put to off, it would require a full initialization during resume. This patch resets and restores both the host and the card during initialization, otherwise host-only reset and restore would fail occasionally. Link: https://lore.kernel.org/r/1586844892-22720-1-git-send-email-cang@codeaurora.org Reviewed-by: Bean Huo Reviewed-by: Alim Akhtar Acked-by: Stanley Chu Acked-by: Avri Altman Signed-off-by: Asutosh Das Signed-off-by: Can Guo Signed-off-by: Martin K. Petersen commit 4300590243895ac39e8c97a2f5acd004dad8a42f Author: Ondrej Mosnacek Date: Thu Apr 16 19:13:55 2020 +0200 selinux: implement new format of filename transitions Implement a new, more space-efficient way of storing filename transitions in the binary policy. The internal structures have already been converted to this new representation; this patch just implements reading/writing an equivalent represntation from/to the binary policy. This new format reduces the size of Fedora policy from 7.6 MB to only 3.3 MB (with policy optimization enabled in both cases). With the unconfined module disabled, the size is reduced from 3.3 MB to 2.4 MB. The time to load policy into kernel is also shorter with the new format. On Fedora Rawhide x86_64 it dropped from 157 ms to 106 ms; without the unconfined module from 115 ms to 105 ms. Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 225621c9348d2a759db141024d5986d48e8c50dc Author: Ondrej Mosnacek Date: Fri Apr 17 10:11:57 2020 +0200 selinux: move context hashing under sidtab Now that context hash computation no longer depends on policydb, we can simplify things by moving the context hashing completely under sidtab. The hash is still cached in sidtab entries, but not for the in-flight context structures. Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 50077289804c9bd4e6cfd5b3a10d4da0487f7e42 Author: Ondrej Mosnacek Date: Fri Apr 17 10:11:56 2020 +0200 selinux: hash context structure directly Always hashing the string representation is inefficient. Just hash the contents of the structure directly (using jhash). If the context is invalid (str & len are set), then hash the string as before, otherwise hash the structured data. Since the context hashing function is now faster (about 10 times), this patch decreases the overhead of security_transition_sid(), which is called from many hooks. The jhash function seemed as a good choice, since it is used as the default hashing algorithm in rhashtable. Signed-off-by: Ondrej Mosnacek Reviewed-by: Jeff Vander Stoep Tested-by: Jeff Vander Stoep [PM: fixed some spelling errors in the comments pointed out by JVS] Signed-off-by: Paul Moore commit 7e5ff5917593011360dfafd05093d50d21d115fb Merge: 9f60a65bc5e6 0903060fe590 Author: Rob Herring Date: Fri Apr 17 14:37:05 2020 -0500 Merge branch 'dt/linus' into dt/next commit e67b2ec9f6171895e774f6543626913960e019df Author: Ondrej Mosnacek Date: Tue Apr 7 20:28:58 2020 +0200 selinux: store role transitions in a hash table Currently, they are stored in a linked list, which adds significant overhead to security_transition_sid(). On Fedora, with 428 role transitions in policy, converting this list to a hash table cuts down its run time by about 50%. This was measured by running 'stress-ng --msg 1 --msg-ops 100000' under perf with and without this patch. Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 8ec7d6043263ecf250b9b7c0dd8ade899487538a Author: Cezary Rojewski Date: Mon Mar 30 21:45:20 2020 +0200 ASoC: Intel: haswell: Power transition refactor Update D0 <-> D3 sequence to correctly transition hardware and DSP core from and to D3. On top of that, set SHIM registers to their recommended defaults during D0 and D3 proceduces as HW does not reset registers for us. Connected to: [alsa-devel][BUG] bdw-rt5650 DSP boot timeout https://mailman.alsa-project.org/pipermail/alsa-devel/2019-July/153098.html Github issue ticket reference: https://github.com/thesofproject/linux/pull/1842 Tested on: - BDW-Y RVP with rt286 - SAMUS with rt5677 Proposed solution (both in July 2019 and on github): 'Revert "ASoC: Intel: Work around to fix HW d3 potential crash issue"' is NAKed as it only covers the problem up and actually brings back the undefined behavior: some registers (e.g.: APLLSE) are describing LPT offsets rather than WPT ones. In consequence, during power-transitions driver issues incorrect writes and leaves the regs of interest alone. Existing patch - the non-revert - does not resolve the HW D3 issue at all as it ignores the recommended sequence and does not initialize hardware registers as expected. And thus, leaving things as are is also unacceptable. Signed-off-by: Cezary Rojewski Tested-by: Ross Zwisler Link: https://lore.kernel.org/r/20200330194520.13253-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit c4310defd88e1e32859d4371d07fa3e1d98c1436 Author: Radhakrishna Sripada Date: Thu Apr 16 09:46:10 2020 -0700 drm/i915/icl: Update forcewake firmware ranges Some workarounds are not sticking across suspend resume cycles. The forcewake ranges table has been updated and would reflect the hardware appropriately. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1222 v2: Simplify the table and use 0 for some unused ranges(Matt) Cc: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Atwood Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200416164610.15422-1-radhakrishna.sripada@intel.com commit 968e6147fcc5862096863980298f3ec4ae5742eb Author: Andy Shevchenko Date: Thu Mar 26 19:54:15 2020 +0200 x86/early_printk: Remove unused includes After 1bd187de5364 ("x86, intel-mid: remove Intel MID specific serial support") the Intel MID header is not needed anymore. After 69c1f396f25b ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation") the EFI headers are not needed anymore. Remove the respective includes. Signed-off-by: Andy Shevchenko Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200326175415.8618-1-andriy.shevchenko@linux.intel.com commit c43dd6b4144aa8f27ff9a1c4872f6ab49a4ba3ec Author: Chris Wilson Date: Fri Apr 17 16:20:18 2020 +0100 drm/i915/selftests: Check power consumption at min/max frequencies A basic premise of RPS is that at lower frequencies, not only do we run slower, but we save power compared to higher frequencies. For example, when idle, we set the minimum frequency just in case there is some residual current. Since the power curve should be a physical relationship, if we find no power saving it's likely that we've broken our frequency handling, so test! Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Andi Shyti Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200417152018.13079-2-chris@chris-wilson.co.uk commit d4e3d455a12e9d7d151f35f86b688bdff5dcd076 Author: Chris Wilson Date: Fri Apr 17 16:20:17 2020 +0100 drm/i915/selftests: Move gpu energy measurement into its own little lib Move the handy utility to measure the GPU energy consumption using RAPL msr into a common lib so that it can be reused easily. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200417152018.13079-1-chris@chris-wilson.co.uk commit 513a24ffb3f96a1eedc1f346616814f55ecb11da Merge: 2fcd80144b93 7edc9079540b Author: David S. Miller Date: Fri Apr 17 10:48:46 2020 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2020-04-17 Here's the first bluetooth-next pull request for the 5.8 kernel: - Added debugfs option to control MITM flag usage during pairing - Added new BT_MODE socket option - Added support for Qualcom QCA6390 device - Added support for Realtek RTL8761B device - Added support for mSBC audio codec over USB endpoints - Added framework for Microsoft HCI vendor extensions - Added new Read Security Information management command - Fixes/cleanup to link layer privacy related code - Various other smaller cleanups & fixes ==================== Signed-off-by: David S. Miller commit 9ae583804a331594fc91c87719d404e0dc73034a Author: Jason Yan Date: Wed Apr 15 17:38:09 2020 +0800 scsi: fnic: make vnic_wq_get_ctrl and vnic_wq_alloc_ring static Fix the following sparse warning: drivers/scsi/fnic/vnic_wq.c:28:5: warning: symbol 'vnic_wq_get_ctrl' was not declared. Should it be static? drivers/scsi/fnic/vnic_wq.c:40:5: warning: symbol 'vnic_wq_alloc_ring' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200415093809.9365-3-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 1d8baf9ed09d169ccaa8c703bd1c36a0ac69543f Author: Jason Yan Date: Wed Apr 15 17:38:08 2020 +0800 scsi: fnic: make fnic_list and fnic_list_lock static Fix the following sparse warning: drivers/scsi/fnic/fnic_main.c:52:1: warning: symbol 'fnic_list' was not declared. Should it be static? drivers/scsi/fnic/fnic_main.c:53:1: warning: symbol 'fnic_list_lock' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200415093809.9365-2-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 363f4d937501ba464d8a8248983dcfffabe69ea7 Author: Jason Yan Date: Wed Apr 15 17:38:07 2020 +0800 scsi: fnic: make some symbols static Fix the following sparse warning: drivers/scsi/fnic/vnic_dev.c:257:5: warning: symbol 'vnic_dev_cmd1' was not declared. Should it be static? drivers/scsi/fnic/vnic_dev.c:319:5: warning: symbol 'vnic_dev_cmd2' was not declared. Should it be static? drivers/scsi/fnic/vnic_dev.c:414:5: warning: symbol 'vnic_dev_init_devcmd1' was not declared. Should it be static? drivers/scsi/fnic/vnic_dev.c:425:5: warning: symbol 'vnic_dev_init_devcmd2' was not declared. Should it be static? drivers/scsi/fnic/vnic_dev.c:495:6: warning: symbol 'vnic_dev_deinit_devcmd2' was not declared. Should it be static? drivers/scsi/fnic/vnic_dev.c:506:5: warning: symbol 'vnic_dev_cmd_no_proxy' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200415093809.9365-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 680e1af713d92940e39a313a8592b13a6885a14c Author: Stanislav Lisovskiy Date: Wed Apr 15 17:39:04 2020 +0300 drm/i915: Add pre/post plane updates for SAGV Lets have a unified way to handle SAGV changes, espoecially considering the upcoming Gen12 changes. Current "standard" way of doing this in commit_tail is pre/post plane updates, when everything which has to be forbidden and not supported in new config has to be restricted before update and relaxed after plane update. v2: - Removed unneeded returns(Ville) Reviewed-by: Ville Syrjälä Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200415143911.10244-5-stanislav.lisovskiy@intel.com commit a389c49fac556cba82edee7a5724269ec2d28981 Author: Stanislav Lisovskiy Date: Wed Apr 15 17:57:40 2020 +0300 drm/i915: Prepare to extract gen specific functions from intel_can_enable_sagv Addressing one of the comments, recommending to extract platform specific code from intel_can_enable_sagv as a preparation, before we are going to add support for tgl+. v2: - Removed whitespace v3: - Removed premature debug and new cycle introduction(Ville) - Added missing no active pipes check(Ville) v4: - Fixed stupid mistake with plane_state caused by stupid macro change Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200415145740.28241-1-stanislav.lisovskiy@intel.com commit 442e7ee834e8528ec85ea0df3c76bfe6c6742f5a Author: Stanislav Lisovskiy Date: Wed Apr 15 17:39:02 2020 +0300 drm/i915: Add intel_atomic_get_bw_*_state helpers Add correspondent helpers to be able to get old/new bandwidth global state object. v2: - Fixed typo in function call v3: - Changed new functions naming to use convention proposed by Jani Nikula, i.e intel_bw_* in intel_bw.c file. v4: - Change function naming back to intel_atomic* pattern, was decided to rename in a separate patch series. v5: - Fix function naming to match existing practices(Ville) v6: - Removed spurious whitespace v7: - Removed bw_state NULL checks(Ville) Reviewed-by: Ville Syrjälä Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200415143911.10244-3-stanislav.lisovskiy@intel.com commit ac9156b27564a089ec52f526bfcb59f61c34e7c6 Author: Andre Guedes Date: Mon Mar 9 16:10:40 2020 -0700 igc: Fix default MAC address filter override This patch fixes a bug when the user adds the first MAC address filter via ethtool NFC mechanism. When the first MAC address filter is added, it overwrites the default MAC address filter configured at RAL[0] and RAH[0]. As consequence, frames addressed to the interface MAC address are not sent to host anymore. This patch fixes the bug by calling igc_set_default_mac_filter() during adapter init so the position 0 of adapter->mac_table[] is assigned to the default MAC address. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit c24fd2481e0bd3d2c5755c7a3dc898ef249c0ddb Author: Andre Guedes Date: Fri Mar 6 16:36:42 2020 -0800 igc: Remove dead code related to flower filter IGC driver has no support for tc-flower filters so this patch removes some leftover code, probably copied from IGB driver by mistake. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 27945ebe5b980f796fa04dd61511796ac5b80cc2 Author: Andre Guedes Date: Fri Mar 6 15:54:03 2020 -0800 igc: Fix NFC queue redirection support The support for ethtool Network Flow Classification (NFC) queue redirection based on destination MAC address is currently broken in IGC. For instance, if we add the following rule, matching frames aren't enqueued on the expected rx queue. $ ethtool -N IFNAME flow-type ether dst 3c:fd:fe:9e:7f:71 queue 2 The issue here is due to the fact that igc_rar_set_index() is missing code to enable the queue selection feature from Receive Address High (RAH) register. This patch adds the missing code and fixes the issue. Signed-off-by: Andre Guedes Acked-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 2e39d2c8ff9654ba508c973ade5df332f53f41cc Author: Sasha Neftin Date: Tue Mar 3 20:26:10 2020 +0200 igc: Remove copper fiber switch control i225 device support copper mode only PHY signal detect indication for copper fiber switch not applicable to i225 part Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 635071e2c48d4a9261a0df8401155dbd959efd3d Author: Sasha Neftin Date: Tue Mar 3 02:28:08 2020 +0200 igc: Enable NETIF_F_HW_TC flag This assignment of the feature NETIF_F_HW_TC occurs prior to the initial setup of the local hw_features variable. This ensures that NETIF_F_HW_TC are marked as user changeable, and also enables it by default when the driver loads. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 64900e8ff551dd6ae891651b6d74789378472ee1 Author: Sasha Neftin Date: Fri Feb 28 19:50:07 2020 +0200 igc: Fix double definition IGC_START_ITR has beed defined twice This patch come to fix it Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit b8a61ea15cdf8524f91dbad90a4f1fae13b0120b Author: Andre Guedes Date: Fri Feb 28 00:19:57 2020 -0800 igc: Fix overwrites when dumping registers This patch fixes some register overwriting when dumping registers via ethtool. We have a total of 16 RAL registers, starting at offset 139. So RAH offset should be 139 + 16 = 155, not 145. As result some RAL registers are overwritten. Likewise, RAH registers are also overwritten by TDBAL, TDBAH, TDLEN, and TDH registers. To fix this bug while preserving the ABI, this patch re-writes RAL and RAH registers at the end of 'regs_buff' and bumps regs->version. It also removes some pointless comments in the middle of igc_set_regs(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 89d35511f38da851c71c3ad9d2b8197ee34e0846 Author: Sasha Neftin Date: Fri Feb 28 02:25:15 2020 +0200 igc: Remove forward declaration Move igc_adapter and igc_ring structures up to avoid forward declaration It is not necessary to forward declare these structures Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 3d1ce3fa83917b19e150352c5a0f9c6324b2da9b Author: Sasha Neftin Date: Thu Feb 27 19:19:12 2020 +0200 igc: Remove unused CTRL_EXT_LINK_MODE_MASK We support only copper mode Not applicable for i225 parts Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit f1fd45598205b3eb52779f5d92b7df9d42fb755b Author: Sasha Neftin Date: Thu Feb 27 18:57:23 2020 +0200 igc: Remove unused MDIC_DEST mask Formally Destination bit should be kept reserved to support legacy drivers and ignore on write/read operation Not applicable for i225 parts Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit a34c7f5156654ebaf7eaace102938be7ff7036cb Author: Kees Cook Date: Wed Feb 19 22:23:02 2020 -0800 e1000: Distribute switch variables for initialization Variables declared in a switch statement before any case statements cannot be automatically initialized with compiler instrumentation (as they are not part of any execution flow). With GCC's proposed automatic stack variable initialization feature, this triggers a warning (and they don't get initialized). Clang's automatic stack variable initialization (via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also doesn't initialize such variables[1]. Note that these warnings (or silent skipping) happen before the dead-store elimination optimization phase, so even when the automatic initializations are later elided in favor of direct initializations, the warnings remain. To avoid these problems, move such variables into the "case" where they're used or lift them up into the main function body. drivers/net/ethernet/intel/e1000/e1000_main.c: In function ‘e1000_xmit_frame’: drivers/net/ethernet/intel/e1000/e1000_main.c:3143:18: warning: statement will never be executed [-Wswitch-unreachable] 3143 | unsigned int pull_size; | ^~~~~~~~~ [1] https://bugs.llvm.org/show_bug.cgi?id=44916 Signed-off-by: Kees Cook Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 82faa9b799500f9e002067c6d8cb027ab12acca4 Author: Vinicius Costa Gomes Date: Fri Feb 14 15:52:03 2020 -0800 igc: Add support for ETF offloading This adds support for ETF offloading for the i225 controller. For i225, the LaunchTime feature is almost a subset of the Qbv feature. The main change from the i210 is that the launchtime of each packet is specified as an offset applied to the BASET register. BASET is automatically incremented each cycle. For i225, the approach chosen is to re-use most of the setup used for taprio offloading. With a few changes: - The more or less obvious one is that when ETF is enabled, we should set add the expected launchtime to the (advanced) transmit descriptor; - The less obvious, is that when taprio offloading is not enabled, we add a dummy schedule (all queues are open all the time, with a cycle time of 1 second). Signed-off-by: Vinicius Costa Gomes Reviewed-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit ec50a9d437f05dd76444a65fdd3cfbfad90ee9d6 Author: Vinicius Costa Gomes Date: Fri Feb 14 15:52:02 2020 -0800 igc: Add support for taprio offloading Adds support for translating taprio schedules into i225 cycles. This will allow schedules to run in the hardware, making the schedules enforcement more precise and saving CPU time. Right now, the only simple schedules are allowed, complex schedules are rejected. "simple" in this context are schedules that each HW queue is opened and closed only once in each cycle. Changing schedules is still not supported as well. Signed-off-by: Vinicius Costa Gomes Reviewed-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 34428dff3679f0c4c9b185ff8eccefd12a7f55f8 Author: Sasha Neftin Date: Mon Feb 10 09:04:15 2020 +0200 igc: Add GSO partial support Partial generic segmentation offload is a hybrid between TSO and GSO. What is effectively does is take advantage of certain traits of TCP and tunnels so that instead of having to rewrite the packet headers for each segment only in the inner-most transport header and possible the outer-most network header need to be updated. This allows devices that do not support tunnel offload or tunnels offloads with checksum to still make use of segmentation. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 8b83ac81f4283ae3bd05c9a7e15dca721014dd03 Author: Chao Yu Date: Thu Apr 16 18:16:56 2020 +0800 f2fs: support read iostat Adds to support accounting read IOs from userspace/kernel. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit df423399757531c20d495bf6b8b83a8dcca3565c Author: Sahitya Tummala Date: Thu Apr 16 11:47:41 2020 +0530 f2fs: Fix the accounting of dcc->undiscard_blks When a discard_cmd needs to be split due to dpolicy->max_requests, then for the remaining length it will be either merged into another cmd or a new discard_cmd will be created. In this case, there is double accounting of dcc->undiscard_blks for the remaining len, due to which it shows incorrect value in stats. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ce4c638cdd52b302247434daed4c127f258d9860 Author: Chao Yu Date: Fri Apr 10 18:07:20 2020 +0800 f2fs: fix to handle error path of f2fs_ra_meta_pages() In f2fs_ra_meta_pages(), if f2fs_submit_page_bio() failed, we need to unlock page, fix it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3fa6a8c5b55d063c6a759e0b354f9d7fc09ffbc0 Author: Sahitya Tummala Date: Wed Apr 15 09:35:54 2020 +0530 f2fs: report the discard cmd errors properly In case a discard_cmd is split into several bios, the dc->error must not be overwritten once an error is reported by a bio. Also, move it under dc->lock. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 141af6ba5216d4d49de683582b600d5c9b51792c Author: Sahitya Tummala Date: Wed Apr 15 14:37:53 2020 +0530 f2fs: fix long latency due to discard during umount F2FS already has a default timeout of 5 secs for discards that can be issued during umount, but it can take more than the 5 sec timeout if the underlying UFS device queue is already full and there are no more available free tags to be used. Fix this by submitting a small batch of discard requests so that it won't cause the device queue to be full at any time and thus doesn't incur its wait time in the umount context. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2bc4bea33848e4c5f441fcec4a94497082c1cc9f Author: Daeho Jeong Date: Mon Mar 30 03:30:59 2020 +0000 f2fs: add tracepoint for f2fs iostat Added a tracepoint to see iostat of f2fs. Default period of that is 3 second. This tracepoint can be used to be monitoring I/O statistics periodically. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ac2caae61e566dc0a45ac264f5484e619366ce42 Author: Linus Walleij Date: Wed Apr 15 14:24:27 2020 +0200 drm/tegra: Clean up GPIO includes The Tegra DRM drivers includes the legacy GPIO headers and but what it really uses is since only gpio_desc structs are ever referenced. Include the right header on the top level tegra/drm.h file and drop all the surplus includes. Signed-off-by: Linus Walleij Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200415122427.111769-1-linus.walleij@linaro.org commit 33aa46f252c703e42c81a76696cd0c240f2281e4 Author: Rafael J. Wysocki Date: Wed Mar 25 15:03:35 2020 +0100 cpufreq: intel_pstate: Use passive mode by default without HWP After recent changes allowing scale-invariant utilization to be used on x86, the schedutil governor on top of intel_pstate in the passive mode should be on par with (or better than) the active mode "powersave" algorithm of intel_pstate on systems in which hardware-managed P-states (HWP) are not used, so it should not be necessary to use the internal scaling algorithm in those cases. Accordingly, modify intel_pstate to start in the passive mode by default if the processor at hand does not support HWP of if the driver is requested to avoid using HWP through the kernel command line. Among other things, that will allow utilization clamps and the support for RT/DL tasks in the schedutil governor to be utilized on systems in which intel_pstate is used. Signed-off-by: Rafael J. Wysocki commit 693774995595b40ae74264216f933224021f4577 Author: Chuhong Yuan Date: Sun Mar 29 22:58:39 2020 +0800 video: fbdev: vesafb: add missed release_region The driver forgets to free the I/O region in remove and probe failure. Add the missed calls to fix it. Since the success of request_region() is optional, add the "region" field in vesafb_par to represent whether request_region() succeeds. Then only call release_region() when "region" is not null. Signed-off-by: Chuhong Yuan Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200329145839.20076-1-hslester96@gmail.com commit fbe3d80df87bb3f91fe1d8b421b69c3c8d089640 Author: Chuhong Yuan Date: Tue Mar 24 21:23:53 2020 +0800 video: fbdev: arcfb: add missed free_irq and fix the order of request_irq The driver forgets to free irq in remove which is requested in probe. Add the missed call to fix it. Also, the position of request_irq() in probe should be put before register_framebuffer(). Signed-off-by: Chuhong Yuan Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324132353.21785-1-hslester96@gmail.com commit 8213fb41874f3e013b67915c4d1802efe05fd496 Author: Chuhong Yuan Date: Tue Mar 24 21:23:11 2020 +0800 fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove The driver calls register_framebuffer() in probe but does not call unregister_framebuffer() in remove. Rename current remove to __s1d13xxxfb_remove() for error handler. Then add a new remove to call unregister_framebuffer(). Signed-off-by: Chuhong Yuan Cc: Kristoffer Ericson [b.zolnierkie: ported over recent s1d13xxxfb changes] [b.zolnierkie: removed extra newline] Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324132311.21729-1-hslester96@gmail.com commit 5e4096ef03dcabd39e1d98856cd92f7359bc13e0 Author: Linus Walleij Date: Wed Apr 15 18:50:55 2020 +0200 ARM/fbdev: sa11x0: Switch to use GPIO descriptors This converts the SA11x0 frame buffer driver to use GPIO descriptors. Get the GPIO optional and register a look-up table specifically for the Shannon machine. Signed-off-by: Linus Walleij Cc: Russell King Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200415165055.193113-1-linus.walleij@linaro.org commit 7066fcd5531c3442e9f454acc023edaa774c6417 Author: Jason Yan Date: Fri Apr 17 17:23:18 2020 +0800 video: fbdev: aty128fb: remove unused 'sdr_64' Fix the following gcc warning: drivers/video/fbdev/aty/aty128fb.c:337:36: warning: ‘sdr_64’ defined but not used [-Wunused-const-variable=] static const struct aty128_meminfo sdr_64 = { ^~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Cc: Paul Mackerras Cc: Daniel Vetter Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200417092318.13978-1-yanaijie@huawei.com commit fff1ac9e2820a5a38fcd60cadd860b03c8f45bfe Author: YueHaibing Date: Wed Apr 15 21:23:50 2020 +0800 omapfb/dss: remove unused variable 'venc_config_pal_bdghi' drivers/video/fbdev/omap2/omapfb/dss/venc.c:212:33: warning: ‘venc_config_pal_bdghi’ defined but not used [-Wunused-const-variable=] static const struct venc_config venc_config_pal_bdghi = { ^~~~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: YueHaibing Cc: Allison Randal [b.zolnierkie: fixed typo in the patch summary] Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200415132350.33088-1-yuehaibing@huawei.com commit 1c49f35e9e9156273124a0cfd38b57f7a7d4828f Author: Sam Ravnborg Date: Sun Apr 12 22:21:43 2020 +0200 video: vt8500lcdfb: fix fallthrough warning Fix following warning: vt8500lcdfb.c: In function 'vt8500lcd_blank': vt8500lcdfb.c:229:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR || ^ vt8500lcdfb.c:233:2: note: here case FB_BLANK_UNBLANK: ^~~~ Adding a simple "fallthrough;" fixed the warning. The fix was build tested. Signed-off-by: Sam Ravnborg Reported-by: kbuild test robot Fixes: e41f1a989408 ("fbdev: Implement simple blanking in pseudocolor modes for vt8500lcdfb") Cc: Alexey Charkov Cc: Paul Mundt Cc: # v2.6.38+ Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200412202143.GA26948@ravnborg.org commit 5c694f8094e44f227937540f6a5e93e747c34098 Author: Uwe Kleine-König Date: Mon Mar 23 22:16:26 2020 +0100 video: fbdev: imxfb: ensure balanced regulator usage The fbdev framework doesn't care to call the .set_power callback only on changes. So the driver has to care for itself that the regulator doesn't get disabled more often than enabled. This fixes the regulator warning unbalanced disables for lcd supply which can be triggered by doing echo 4 > /sys/class/lcd/imxfb-lcd/lcd_power twice. Signed-off-by: Uwe Kleine-König Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Shawn Guo Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200323211626.24812-1-u.kleine-koenig@pengutronix.de commit 04dff10ffb55ceb9480431b2398f8300a1aa327f Author: Bartlomiej Zolnierkiewicz Date: Tue Mar 24 14:45:08 2020 +0100 video: fbdev: controlfb: remove function prototypes part #3 Reorder code a bit and then remove no longer needed function prototypes. Acked-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324134508.25120-7-b.zolnierkie@samsung.com commit a57eb14ebb00270ac0e679e93ea69110f33697a2 Author: Bartlomiej Zolnierkiewicz Date: Tue Mar 24 14:45:07 2020 +0100 video: fbdev: controlfb: remove function prototypes part #2 Reorder code a bit and then remove no longer needed function prototypes. Acked-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324134508.25120-6-b.zolnierkie@samsung.com commit 946e8fd4fbbfea58c1d4ad93ce4fb7401f77308b Author: Bartlomiej Zolnierkiewicz Date: Tue Mar 24 14:45:06 2020 +0100 video: fbdev: controlfb: remove function prototypes part #1 Reorder code a bit and then remove no longer needed function prototypes. Acked-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324134508.25120-5-b.zolnierkie@samsung.com commit 72155824e1c94266ea7fec3c384a3b86d0ee2225 Author: Bartlomiej Zolnierkiewicz Date: Tue Mar 24 14:45:05 2020 +0100 video: fbdev: controlfb: remove obsolete module support CONFIG_FB_CONTROL is bool, hence the Apple "control" frame buffer driver cannot be built as a module. Replace module_init() by device_initcall(). Acked-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324134508.25120-4-b.zolnierkie@samsung.com commit a07a63b0e24dd1316d11427601a9f83dc955bb40 Author: Bartlomiej Zolnierkiewicz Date: Tue Mar 24 14:45:04 2020 +0100 video: fbdev: controlfb: add COMPILE_TEST support Add COMPILE_TEST support to controlfb driver for better compile testing coverage. While at it: - convert driver to use eieio() and dcbf() helpers instead of open-coding them - add invalid_vram_cache() helper to avoid code duplication Acked-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324134508.25120-3-b.zolnierkie@samsung.com commit 38bf1077cf24cc20fdf459e51bb87b553f4fb79d Author: Bartlomiej Zolnierkiewicz Date: Tue Mar 24 14:45:03 2020 +0100 video: fbdev: controlfb: fix sparse warning about using incorrect type Use in_le32() instead of le32_to_cpup() to fix sparse warning about improper type of the argument. Also drop inline keyword from control_par_to_var() prototype (to match function definition). Acked-by: Sam Ravnborg Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324134508.25120-2-b.zolnierkie@samsung.com commit 304d63d4d89dc2c24bdfc7730355ca38f589f91b Author: Andy Shevchenko Date: Tue Mar 24 19:05:32 2020 +0200 video: ssd1307fb: Remove redundant forward declaration There is no need to have forward declaration of struct ssd1307fb_par. Drop it for good. Signed-off-by: Andy Shevchenko Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324170532.44384-5-andriy.shevchenko@linux.intel.com commit 479382360da64e5d31509c72a07e4623ed249db0 Author: Andy Shevchenko Date: Tue Mar 24 19:05:31 2020 +0200 video: ssd1307fb: Convert to atomic PWM API Use the atomic API wherever appropriate and get rid of pwm_apply_args() call (the reference period and polarity are now explicitly set when calling pwm_apply_state()). We also make use of the pwm_set_relative_duty_cycle() helper to ease relative to absolute duty_cycle conversion. Signed-off-by: Andy Shevchenko Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324170532.44384-4-andriy.shevchenko@linux.intel.com commit 72915994e028912add23afce7f16ebd06d2dc73e Author: Andy Shevchenko Date: Tue Mar 24 19:05:30 2020 +0200 video: ssd1307fb: Make use of device properties Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: Andy Shevchenko Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324170532.44384-3-andriy.shevchenko@linux.intel.com commit fa64c6badea4445895362fca61c7743ca7cd0bde Author: Andy Shevchenko Date: Tue Mar 24 19:05:29 2020 +0200 video: ssd1307fb: Introduce temporary variable to increase readability Introduce temporary variable to increase readability of the code. Signed-off-by: Andy Shevchenko [b.zolnierkie: fix lines over 80 characters] Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324170532.44384-2-andriy.shevchenko@linux.intel.com commit 59d961c5972f8dd064277b41be1061e41827c726 Author: Andy Shevchenko Date: Tue Mar 24 19:05:28 2020 +0200 video: ssd1307fb: Convert driver to use ->probe_new() Use the ->probe_new() callback. The driver does not use const struct i2c_device_id * argument, so convert it to utilise the simplified I²C driver registration. Signed-off-by: Andy Shevchenko Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200324170532.44384-1-andriy.shevchenko@linux.intel.com commit 97e130f63757ede9abc4a9ee42b5fcad466a8e97 Author: Wiktor Ciurej Date: Thu Apr 2 18:13:13 2020 +0200 platform/x86: touchscreen_dmi: Add touchscreen info for techBite Arc 11.6. Add touchscreen info for techBite Arc 11.6. Signed-off-by: Wiktor Ciurej Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko commit e415da3597ac6460d9fee8f88ddd53dea7e6587d Author: Hans de Goede Date: Wed Apr 1 10:03:48 2020 +0200 platform/x86: touchscreen_dmi: Add info for the MP-man MPWIN895CL tablet Add touchscreen info for the MP-man MPWIN895CL tablet. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit a50717dbf41715683057562d106060bb4e405cce Author: Chris Wilson Date: Fri Apr 17 10:39:28 2020 +0100 drm/i915/selftests: Take the engine wakeref around __rps_up_interrupt Since we are touching the device to read the registers, we are required to ensure the device is awake at the time. Currently, we believe ourselves to be inside the active request [thus an active engine wakeref], but since that may be retired in the background, we can spontaneously lose the wakeref and the ability to probe the HW. <4> [379.686703] RPM wakelock ref not held during HW access <4> [379.686805] WARNING: CPU: 7 PID: 4869 at ./drivers/gpu/drm/i915/intel_runtime_pm.h:115 gen12_fwtable_read32+0x233/0x300 [i915] <4> [379.686808] Modules linked in: i915(+) vgem snd_hda_codec_hdmi mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ax88179_178a usbnet mii ghash_clmulni_intel snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pcm e1000e mei_me ptp mei pps_core intel_lpss_pci prime_numbers [last unloaded: i915] <4> [379.686827] CPU: 7 PID: 4869 Comm: i915_selftest Tainted: G U 5.7.0-rc1-CI-CI_DRM_8313+ #1 <4> [379.686830] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2457.A13.1912190237 12/19/2019 <4> [379.686883] RIP: 0010:gen12_fwtable_read32+0x233/0x300 [i915] <4> [379.686887] Code: d8 ea e0 0f 0b e9 19 fe ff ff 80 3d ad 12 2d 00 00 0f 85 17 fe ff ff 48 c7 c7 b0 32 3e a0 c6 05 99 12 2d 00 01 e8 2d d8 ea e0 <0f> 0b e9 fd fd ff ff 8b 05 c4 75 56 e2 85 c0 0f 85 84 00 00 00 48 <4> [379.686889] RSP: 0018:ffffc90000727970 EFLAGS: 00010286 <4> [379.686892] RAX: 0000000000000000 RBX: ffff88848cc20ee8 RCX: 0000000000000001 <4> [379.686894] RDX: 0000000080000001 RSI: ffff88843b1f0900 RDI: 00000000ffffffff <4> [379.686896] RBP: 0000000000000000 R08: ffff88843b1f0900 R09: 0000000000000000 <4> [379.686898] R10: 0000000000000000 R11: 0000000000000000 R12: 000000000000a058 <4> [379.686900] R13: 0000000000000001 R14: ffff88848cc2bf30 R15: 00000000ffffffea <4> [379.686902] FS: 00007f7d63f5e300(0000) GS:ffff8884a0180000(0000) knlGS:0000000000000000 <4> [379.686904] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4> [379.686907] CR2: 000055e5c30f4988 CR3: 000000042e190002 CR4: 0000000000760ee0 <4> [379.686910] PKRU: 55555554 <4> [379.686911] Call Trace: <4> [379.686986] live_rps_interrupt+0xb14/0xc10 [i915] <4> [379.687051] ? intel_rps_unpark+0xb0/0xb0 [i915] <4> [379.687057] ? __trace_bprintk+0x57/0x80 <4> [379.687143] __i915_subtests+0xb8/0x210 [i915] <4> [379.687222] ? __i915_live_teardown+0x50/0x50 [i915] <4> [379.687291] ? __intel_gt_live_setup+0x30/0x30 [i915] <4> [379.687361] __run_selftests+0x112/0x170 [i915] <4> [379.687431] i915_live_selftests+0x2c/0x60 [i915] <4> [379.687491] i915_pci_probe+0x93/0x1b0 [i915] Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200417093928.17822-2-chris@chris-wilson.co.uk commit 9d7e560f432766e5894bfbac41d6faa5f3daf1b7 Author: Chris Wilson Date: Fri Apr 17 10:39:27 2020 +0100 drm/i915/selftests: Delay spinner before waiting for an interrupt It seems that although (perhaps because of the memory stall?) the spinner has signaled that it has started, it still takes some time to spin up to 100% utilisation of the HW. Since the test depends on the full utilisation of the HW to trigger the RPS interrupt, wait a little bit and flush the interrupt status to be sure that the event we see if from the spinner. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200417093928.17822-1-chris@chris-wilson.co.uk commit ba50e011b142cfe739ff2c64957dbba95797a912 Author: Tomi Valkeinen Date: Fri Apr 17 14:37:58 2020 +0300 leds: tlc591xxt: hide error on EPROBE_DEFER If devm_led_classdev_register_ext() fails with EPROBE_DEFER, we get: tlc591xx 0-0040: couldn't register LED (null) Only print the error if the error is something else than EPROBE_DEFER. Signed-off-by: Tomi Valkeinen Reviewed-by: Dan Murphy Signed-off-by: Pavel Machek commit 59fc9ad5cb108bce18043281c7cf67f2b425d55d Author: Yicong Yang Date: Fri Apr 17 15:48:27 2020 +0800 spi: hisi-sfc-v3xx: add error check after per operation The controller may receive instructions of accessing protected address, or may perform failed page program. These operations will not succeed and the controller will receive interrupts when such failure occur. Previously we don't check the interrupts and return 0 even if such operation fails. Check the interrupts after per command and inform the user if there is an error. Signed-off-by: Yicong Yang Acked-by: John Garry Link: https://lore.kernel.org/r/1587109707-23597-1-git-send-email-yangyicong@hisilicon.com Signed-off-by: Mark Brown commit 9d282c17b023a97516a63255ce7f7ee65c39bec1 Author: Patrice Chotard Date: Fri Apr 17 14:12:41 2020 +0200 spi: stm32-qspi: Add pm_runtime support By default, STM32_AUTOSUSPEND_DELAY is set to -1 which has for effect to prevent runtime suspends. Runtime suspends can be activated by setting autosuspend_delay_ms using sysfs entry : echo {delay_in_ms} > /sys/devices/platform/soc/58003000.spi/power/autosusp end_delay_ms) Signed-off-by: Christophe Kerello Signed-off-by: Patrice Chotard Signed-off-by: Benjamin Gaignard Link: https://lore.kernel.org/r/20200417121241.6473-1-patrice.chotard@st.com Signed-off-by: Mark Brown commit db991af02f11053558431467102ee5832894d7a4 Author: Jessica Yu Date: Wed Apr 8 16:31:06 2020 +0200 module: break nested ARCH_HAS_STRICT_MODULE_RWX and STRICT_MODULE_RWX #ifdefs Various frob_* and module_{enable,disable}_* functions are defined in a CONFIG_ARCH_HAS_STRICT_MODULE_RWX ifdef block which also has a nested CONFIG_STRICT_MODULE_RWX ifdef block within it. This is unecessary and makes things hard to read. Not only that, this construction requires redundant empty stubs for module_enable_nx(). I suspect this was originally done for cosmetic reasons - to keep all the frob_* functions in the same place, and all the module_{enable,disable}_* functions right after, but as a result it made the code harder to read. Make this more readable by unnesting the ifdef blocks and getting rid of the redundant empty stubs. Signed-off-by: Jessica Yu commit 23122a4d992b5d5a660155e2c4640e5a93cc957d Author: Chris Wilson Date: Thu Apr 16 12:41:17 2020 +0100 drm/i915/gt: Scrub execlists state on resume Before we resume, we reset the HW so we restart from a known good state. However, as a part of the reset process, we drain our pending CS event queue -- and if we are resuming that does not correspond to internal state. On setup, we are scrubbing the CS pointers, but alas only on setup. Apply the sanitization not just to setup, but to all resumes. Reported-by: Venkata Ramana Nayana Signed-off-by: Chris Wilson Cc: Venkata Ramana Nayana Cc: Daniele Ceraolo Spurio Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200416114117.3460-1-chris@chris-wilson.co.uk commit ca99522667ad239267e3c17773dbabb482c1ceac Author: Linus Walleij Date: Wed Apr 15 17:08:37 2020 +0200 leds: tca6507: Include the right header The TCA6507 optionally presents a GPIO controller, so include instead of the legacy . Cc: NeilBrown Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit cb60e2f9af80b1c2f096d63d51993ad0e00190db Author: Linus Walleij Date: Wed Apr 15 14:37:50 2020 +0200 leds: lt3593: Drop surplus include This driver is already including and using the proper header, there is no need to include the legacy header. Cc: Daniel Mack Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit da542caf1ff78bd10847b38cfd89bd6e1a6355fc Author: Linus Walleij Date: Wed Apr 15 14:35:08 2020 +0200 leds: lp3952: Include the right header This driver is using the GPIO descriptor API properly as it should be but is including the legacy GPIO header . Fix it by including instead. Cc: Tony Makkiel Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit ea1a6a15f4090dc7f852892bc6976b2131e9b9ea Author: Linus Walleij Date: Wed Apr 15 14:29:45 2020 +0200 leds: lm355x: Drop surplus include This driver includes but does not use any symbols from that file, so drop the include. Cc: G.Shark Jeong Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit 48b8b04c791d1e39883416fd3106cad205007298 Author: Uma Shankar Date: Thu Apr 16 16:24:19 2020 +0530 drm/i915/display: Enable DP Display Audio WA For certain DP VDSC bpp settings, hblank asserts before hblank_early, leading to a bad audio state. Driver need to program "hblank early enable" and "samples per line" parameters in AUDIO_CONFIG_BE register. This is Display Audio WA #1406928334 for 4k+VDSC usecase applicable on DP encoders. Implemented the same. v2: Fixed build failures on 32bit machine. v3: Dropped u64, added helpers for sample room calculation, other general comments as per Jani Nikula's feedback. Also fixed connector type check (spotted by Anshuman) v4: Addressed Jani Nikula and Kai's review comments. v5: Addressed Anshuman's review comment and used crtc_* variable to get timings. v6: Dropped a redundant initialization. Reviewed-by: Anshuman Gupta Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200416105419.9664-1-uma.shankar@intel.com commit a02254f8a676f5fdb98ebeb6cc420a71e652574a Author: Leonid Ravich Date: Thu Apr 16 20:06:22 2020 +0300 dmaengine: ioat: Decreasing allocation chunk size 2M->512K requreing kmalloc of 2M high chance to fail in fragmented memory. IOAT ring requires 64k * 64B memory which will be achived by 512k * 8 allocation instead of 2M * 2. Acked-by: Dave Jiang Signed-off-by: Leonid Ravich Link: https://lore.kernel.org/r/20200416170628.16196-2-leonid.ravich@dell.com Signed-off-by: Vinod Koul commit bd2bf302eef21aafa6da2cf829b87a9e33150658 Author: Leonid Ravich Date: Thu Apr 16 20:06:21 2020 +0300 dmaengine: ioat: fixing chunk sizing macros dependency changing macros which assumption is chunk size of 2M, which can be other size prepare for changing allocation chunk size. Acked-by: Dave Jiang Signed-off-by: Leonid Ravich Link: https://lore.kernel.org/r/20200416170628.16196-1-leonid.ravich@dell.com Signed-off-by: Vinod Koul commit 2fea2906b5cbeffe49911e4735451af62fc121b4 Author: Geert Uytterhoeven Date: Thu Apr 16 12:30:54 2020 +0200 dmaengine: Fix misspelling of "Analog Devices" According to https://www.analog.com/, the company name is spelled "Analog Devices". Signed-off-by: Geert Uytterhoeven Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20200416103058.15269-3-geert+renesas@glider.be [vkoul: make subsystem name dmaengine] Signed-off-by: Vinod Koul commit b3cb14310eb4b0355291c89a3807336be576f0b3 Author: Yoshihiro Shimoda Date: Fri Apr 17 17:07:09 2020 +0900 dt-bindings: dma: renesas,usb-dmac: convert bindings to json-schema Convert Renesas R-Car USB-DMA Controller bindings documentation to json-schema. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1587110829-26609-3-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit cde9a96ee24f796941bd187e0ded93a242ce5340 Author: Yoshihiro Shimoda Date: Fri Apr 17 17:07:08 2020 +0900 dt-bindings: dma: renesas,rcar-dmac: convert bindings to json-schema Convert Renesas R-Car and RZ/G DMA Controller bindings documentation to json-schema. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1587110829-26609-2-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit fc6f5d0a4983e2ba9451cc1377a8da5a82cdc52d Author: Alan Mikhak Date: Wed Apr 15 10:27:09 2020 -0700 dmaengine: dw-edma: Decouple dw-edma-core.c from struct pci_dev Decouple dw-edma-core.c from struct pci_dev as a step toward integration of dw-edma with pci-epf-test so the latter can initiate dma operations locally from the endpoint side. A barrier to such integration is the dependency of dw_edma_probe() and other functions in dw-edma-core.c on struct pci_dev. The Synopsys DesignWare dw-edma driver was designed to run on host side of PCIe link to initiate DMA operations remotely using eDMA channels of PCIe controller on the endpoint side. This can be inferred from seeing that dw-edma uses struct pci_dev and accesses hardware registers of dma channels across the bus using BAR0 and BAR2. The ops field of struct dw_edma in dw-edma-core.h is currenty undefined: const struct dw_edma_core_ops *ops; However, the kernel builds without failure even when dw-edma driver is enabled. Instead of removing the currently undefined and usued ops field, define struct dw_edma_core_ops and use the ops field to decouple dw-edma-core.c from struct pci_dev. Signed-off-by: Alan Mikhak Acked-by: Gustavo Pimentel Link: https://lore.kernel.org/r/1586971629-30196-1-git-send-email-alan.mikhak@sifive.com Signed-off-by: Vinod Koul commit 3dbf1ee6abbb30d21db0649b93a34576da64ab00 Author: Grace Kao Date: Fri Apr 17 12:11:54 2020 +0800 pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler According to Braswell NDA Specification Update (#557593), concurrent read accesses may result in returning 0xffffffff and write instructions may be dropped. We have an established format for the commit references, i.e. cdca06e4e859 ("pinctrl: baytrail: Add missing spinlock usage in byt_gpio_irq_handler") Fixes: 0bd50d719b00 ("pinctrl: cherryview: prevent concurrent access to GPIO controllers") Signed-off-by: Grace Kao Reported-by: Brian Norris Reviewed-by: Brian Norris Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 9f676e5313c1fb7070997bd652a4ed68c6fb9a8c Author: YueHaibing Date: Wed Apr 8 07:08:32 2020 +0000 gpio: mlxbf2: remove unused including Remove including that don't need it. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200408070832.137037-1-yuehaibing@huawei.com Acked-by: Asmaa Mnebhi Signed-off-by: Linus Walleij commit 4c2b54f73aba9c8428c1c8025f91d69ca77e1e6e Author: Andy Shevchenko Date: Wed Apr 15 17:15:32 2020 +0300 gpio: dwapb: Split out dwapb_get_irq() helper Split out dwapb_get_irq() helper for better readability and maintenance. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-13-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit c59042ed896592eba6a5f8baa9c12aec7e36db20 Author: Andy Shevchenko Date: Wed Apr 15 17:15:31 2020 +0300 gpio: dwapb: Drop of_match_ptr() & ACPI_PTR() calls Since we always have a table of IDs compiled in, there is no use for of_match_ptr() nor ACPI_PTR() call. Besides that it brings a warning (depending on configuration): .../gpio-dwapb.c:638:34: warning: ‘dwapb_of_match’ defined but not used [-Wunused-const-variable=] 638 | static const struct of_device_id dwapb_of_match[] = { | ^~~~~~~~~~~~~~ Get rid of them for good. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-12-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 4f344e86c7396015e83f31c08aef2eb73838f338 Author: Andy Shevchenko Date: Wed Apr 15 17:15:30 2020 +0300 gpio: dwapb: Drop bogus BUG_ON()s There is no case when no context is provided in the ->suspend() and ->resume() hooks. Moreover, BUG_ON() is harmful to user and makes kernel inoperable after the crash. Drop the BUG_ON()s for good. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-11-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 48ce805683461f0205e5b1baa2385a0cb425388e Author: Andy Shevchenko Date: Wed Apr 15 17:15:29 2020 +0300 gpio: dwapb: Switch to more usual pattern of RMW in dwapb_gpio_set_debounce() More usual pattern is to prepare value and then write it in a single place. Switch code in dwapb_gpio_set_debounce() to it. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-10-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit d31275a9dc0baa6b084917f8d42f1e197239fe6c Author: Andy Shevchenko Date: Wed Apr 15 17:15:28 2020 +0300 gpio: dwapb: Convert to use IRQ core provided macros IRQ core provides macros such as IRQ_RETVAL(). Convert code to use them. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-9-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 9826bbe1fef0b5a2432acce0292562891b1feb57 Author: Andy Shevchenko Date: Wed Apr 15 17:15:27 2020 +0300 gpio: dwapb: Use device_get_match_data() to simplify code Use device_get_match_data() here to simplify the code a bit. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-8-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit e092bc5044ca8bb7acfa2930a96a5f1dba4148aa Author: Andy Shevchenko Date: Wed Apr 15 17:15:26 2020 +0300 gpio: dwapb: Convert to use irqd_to_hwirq() Convert to use irqd_to_hwirq() instead of direct access to the hwirq member. Also amend the type of the hwirq holding variable to be irq_hw_number_t. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Cc: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-7-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 43296bf22e16a044500870e6063fc33b17b4253c Author: Andy Shevchenko Date: Wed Apr 15 17:15:25 2020 +0300 gpio: dwapb: Deduplicate IRQ resource management GPIO library provides default IRQ resource management hooks, there is no need to repeat this in the individual driver. Remove them for good. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-6-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit f9754c79707fb71f51208ae8a0d00a30250b6d08 Author: Andy Shevchenko Date: Wed Apr 15 17:15:24 2020 +0300 gpio: dwapb: set default handler to be handle_bad_irq() We switch the default handler to be handle_bad_irq() instead of handle_level_irq(), though for now apply it later in the code, to make the difference between IRQ chips more visible. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-5-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 9b0aef32c725d7ff92f4628c119867bc1a04d321 Author: Andy Shevchenko Date: Wed Apr 15 17:15:23 2020 +0300 gpio: dwapb: Use chained IRQ prologue and epilogue Refactor IRQ handler in order to enter and exit chained IRQ by using respective prologue and epilogue calls. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-4-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 038aa1f0aba9596639c8ec2057169fa8e77d60d1 Author: Andy Shevchenko Date: Wed Apr 15 17:15:22 2020 +0300 gpio: dwapb: Refactor IRQ handler to use bit operations Refactor IRQ handler in order to use for_each_set_bit() helper. Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit c58220cba2e03618659fa7d5dfae31f5ad4ae9d0 Author: Andy Shevchenko Date: Wed Apr 15 17:15:21 2020 +0300 gpio: dwapb: Append MODULE_ALIAS for platform driver The commit 3d2613c4289f ("GPIO: gpio-dwapb: Enable platform driver binding to MFD driver") introduced a use of the platform driver but missed to add the following line to it: MODULE_ALIAS("platform:gpio-dwapb"); Add this to get driver loaded automatically if platform device is registered. Fixes: 3d2613c4289f ("GPIO: gpio-dwapb: Enable platform driver binding to MFD driver") Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20200415141534.31240-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit a26fa4b5d368289803259dbb7df8778c7800a0a6 Author: Serge Semin Date: Mon Mar 23 22:54:01 2020 +0300 MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. Suggested-by: Linus Walleij Signed-off-by: Serge Semin Cc: Hoan Tran Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: linux-gpio@vger.kernel.org Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200323195401.30338-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Linus Walleij commit 5c544c92d6cd058d2a95a49fe75265043264b942 Author: Serge Semin Date: Mon Mar 23 22:54:00 2020 +0300 gpio: dwapb: Add debounce reference clock support Aside from the APB reference clock DW GPIO controller can have a dedicated clock connected to setup a debounce time interval for GPIO-based IRQs. Since this functionality is optional the corresponding clock source is also optional. Due to this lets handle the debounce clock in the same way as it has been developed for the APB reference clock, but using the bulk request/enable-disable methods. Signed-off-by: Serge Semin Reviewed-by: Linus Walleij Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200323195401.30338-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Linus Walleij commit 3ea8094c3b45495a18b75afd27cfda9597bf0e7d Author: Serge Semin Date: Mon Mar 23 22:53:59 2020 +0300 gpio: dwapb: Use optional-clocks interface for APB ref-clock The common clocks kernel framework provides a generic way to use an optional reference clock sources. If it's utilized there is no need in checking whether the clock descriptor pointer is actually a negative error at the moment of the prepare/unprepare clocks method calling. So if the corresponding clock source is provided, then getting an error shall actually terminate the device probe procedure. If it isn't specified then the driver shall proceed with further initializations. We'll use the optional clocks getting method to handle the APB reference clock, which can be provided for instance in the device of-node with "bus" clock-name. Signed-off-by: Serge Semin Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200323195401.30338-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Linus Walleij commit c55812afd3954c20c0d06b00ee9271ca6a3d8eab Author: Serge Semin Date: Mon Mar 23 22:53:58 2020 +0300 dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Seeing Hoan has been silent for a long time Linus suggested to me to be also maintaining the driver. This patch adds myself to the list of maintainers in the DT schema of the driver. Suggested-by: Linus Walleij Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Acked-by: Rob Herring Cc: Hoan Tran Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Link: https://lore.kernel.org/r/20200323195401.30338-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Linus Walleij commit 4f18093743673d4e21a5619dc323adb1dc2021e9 Author: Serge Semin Date: Mon Mar 23 22:53:57 2020 +0300 dt-bindings: gpio: Add DW GPIO debounce clock property Port A of the DW GPIO controller may optionally have a debounce logic enabled if it was synthesized with that functionality enabled. In this case a dedicated reference clock should be declared in the node with corresponding "db" name presented in the clock-names property. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Acked-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Link: https://lore.kernel.org/r/20200323195401.30338-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Linus Walleij commit 657a06df993c92ca404da4c251f7f354f1069eaa Author: Serge Semin Date: Mon Mar 23 22:53:56 2020 +0300 dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Modern device tree bindings are supposed to be created as YAML-files in accordance with DT schema. This commit replaces Synopsys DW GPIO legacy bare text binding with YAML file. As before the binding file states that the corresponding dts node is supposed to be compatible with generic DW I2C controller indicated by the "snps,dw-apb-gpio" compatible string and to provide a mandatory registers memory range. It may also have an optional clock and reset phandle references. There must be specified at least one subnode with "snps,dw-apb-gpio-port" compatible string indicating the GPIO port, which would actually export the GPIO controller functionality. Such nodes should have traditional GPIO controller properties together with optional interrupt-controller attributes if the corresponding controller was synthesized to detect and report the input values change to the parental IRQ controller. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Reviewed-by: Andy Shevchenko Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200323195401.30338-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Linus Walleij commit 7045e673c2fd6465a1472f09f73f75a8edcd7e68 Author: Jason Yan Date: Fri Apr 17 17:21:25 2020 +0800 pinctrl: mcp23s08: add module license Fix the following build warning: WARNING: modpost: missing MODULE_LICENSE() in drivers/pinctrl/pinctrl-mcp23s08.o see include/linux/module.h for more information Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200417092125.12513-1-yanaijie@huawei.com Reported-by: Randy Dunlap Reported-by: Stephen Rothwell Signed-off-by: Linus Walleij commit 5da42a3d2540732f66ae8c228d902aa7a27b4f6a Author: YueHaibing Date: Wed Apr 8 07:05:04 2020 +0000 pinctrl: qcom: Remove duplicated include from pinctrl-msm.c Remove duplicated include. Fixes: 13bec8d49bdf ("pinctrl: qcom: use scm_call to route GPIO irq to Apps") Signed-off-by: YueHaibing Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200408070504.134847-1-yuehaibing@huawei.com Signed-off-by: Linus Walleij commit aa08ff0f345ef68829bab30ddb5a23e9d99301b7 Author: Geert Uytterhoeven Date: Thu Apr 16 12:30:57 2020 +0200 ALSA: Fix misspellings of "Analog Devices" According to https://www.analog.com/, the company name is spelled "Analog Devices". Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200416103058.15269-6-geert+renesas@glider.be Signed-off-by: Takashi Iwai commit fb55c735522352704c35d899d0b253453cf0e799 Author: Yan Zhao Date: Fri Apr 17 05:13:34 2020 -0400 drm/i915/gvt: skip populate shadow context if guest context not changed Software is not expected to populate engine context except when using restore inhibit bit or golden state to initialize it for the first time. Therefore, if a newly submitted guest context is the same as the last shadowed one, no need to populate its engine context from guest again. Currently using lrca + ring_context_gpa to identify whether two guest contexts are the same. The reason of why context id is not included as an identifier is that i915 recently changed the code and context id is only unique for a context when OA is enabled. And when OA is on, context id is generated based on lrca. Therefore, in that case, if two contexts are of the same lrca, they have identical context ids as well. (This patch also works with old guest kernel like 4.20.) for guest context, if its ggtt entry is modified after last context shadowing, it is also deemed as not the same context as last shadowed one. v7: -removed local variable "valid". use the one in s->last_ctx diretly v6: -change type of lrca of last ctx to be u32. as currently it's all protected by vgpu lock (Kevin Tian) -reset valid of last ctx to false once it needs to be repopulated before population completes successfully (Kevin Tian) v5: -merge all 3 patches into one patch (Zhenyu Wang) v4: - split the series into 3 patches. - don't turn on optimization until last patch in this series (Kevin Tian) - define lrca to be atomic in this patch rather than update its type in the second patch (Kevin Tian) v3: updated commit message to describe engine context and context id clearly (Kevin Tian) v2: rebased to 5.6.0-rc4+Signed-off-by: Yan Zhao Reviewed-by: Zhenyu Wang Reviewed-by: Kevin Tian Cc: Kevin Tian Suggested-by: Zhenyu Wang Signed-off-by: Yan Zhao Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200417091334.32628-1-yan.y.zhao@intel.com commit f82cdff1aa7f6dcf6625c7219342a6e5c977098d Author: Tony Luck Date: Wed Apr 15 12:58:26 2020 -0700 x86/mce: Drop bogus comment about mce.kflags The bit definitions for kflags are for internal use only. A late edit moved them from uapi/asm/mce.h to the internal x86 , but the comment saying "See below" was accidentally left here. Delete "See below". Just labelling this field as internal kernel use is sufficient. Fixes: 1de08dccd383 ("x86/mce: Add a struct mce.kflags field") Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200415195826.GA13681@agluck-desk2.amr.corp.intel.com commit 7f21a85085b7211ec1d1583d10912ad272ab76bc Author: Alain Volmat Date: Sun Mar 22 17:16:16 2020 +0100 dts: arm: stih407-family: remove duplicated rng nodes the 2 rng nodes are duplicated within the stih407-family.dtsi Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 248a8ffd2c9de33b67bb0469fab7867f960c7169 Author: Alain Volmat Date: Sun Mar 22 17:16:31 2020 +0100 dts: arm: stih418: Fix complain about IRQ_TYPE_NONE usage Since commit 83a86fbb5b56 ("irqchip/gic: Loudly complain about the use of IRQ_TYPE_NONE") kernel is complaining about the IRQ_TYPE_NONE usage which shouldn't be used. Use IRQ_TYPE_LEVEL_HIGH instead. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 55623260bb33e2ab849af76edf2253bc04cb241f Author: Scott Branden Date: Tue Apr 14 17:25:17 2020 -0700 test_firmware: remove unnecessary test_fw_mutex in test_dev_config_show_xxx Remove unnecessary use of test_fw_mutex in test_dev_config_show_xxx functions that show simple bool, int, and u8. Signed-off-by: Scott Branden Reviewed-by: Kees Cook Reviewed-by: Luis Chamberlain Signed-off-by: Andrew Morton Link: https://lore.kernel.org/r/20200415002517.4328-1-scott.branden@broadcom.com Signed-off-by: Greg Kroah-Hartman commit ab7c1e163b525316a870a494dd4ea196e7a6c455 Author: Takashi Iwai Date: Wed Apr 15 18:45:00 2020 +0200 firmware: Drop unused pages field from struct firmware The struct firmware contains a page table pointer that was used only internally in the past. Since the actual page tables are referred from struct fw_priv and should be never from struct firmware, we can drop this unused field gracefully. Signed-off-by: Takashi Iwai Acked-by: Luis Chamberlain Link: https://lore.kernel.org/r/20200415164500.28749-1-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman commit 9efa0c1a500f97f17e959397f368ca252336fde1 Author: Anshuman Gupta Date: Wed Apr 15 22:35:55 2020 +0530 drm/i915: Add i915_lpsp_status debugfs attribute It requires a separate debugfs attribute to expose lpsp status to user space, as there may be display less configuration without any valid connected output, those configuration will not be able to test lpsp status, if lpsp status exposed from a connector based debugfs attribute. Reviewed-by: Animesh Manna Signed-off-by: Anshuman Gupta Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200415170555.15531-5-anshuman.gupta@intel.com commit 76a23f06011dcc19c6769a45f2c788da70a93130 Author: Anshuman Gupta Date: Wed Apr 15 22:35:54 2020 +0530 drm/i915: Add connector dbgfs for all connectors Add connector debugfs attributes for each intel connector which is getting register. v2: - adding connector debugfs for each connector in intel_connector_register() to fix CI failure for legacy connectors. Reviewed-by: Jani Nikula Signed-off-by: Anshuman Gupta Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200415170555.15531-4-anshuman.gupta@intel.com commit 8806211fe7b30696c1fcae54b73c94abfdf55893 Author: Anshuman Gupta Date: Wed Apr 15 22:35:53 2020 +0530 drm/i915: Add i915_lpsp_capability debugfs New i915_pm_lpsp igt solution approach relies on connector specific debugfs attribute i915_lpsp_capability, it exposes whether an output is capable of driving lpsp. v2: - CI fixup. v3: - register i915_lpsp_info only for supported connector. [Jani] - use intel_display_power_well_is_enabled() instead of looking inside power_well count. [Jani] - fixes the lpsp capable conditional logic. [Jani] - combined the lpsp capable and enable info. [Jani] v4: - Separate out connector based debugfs i915_lpsp_capability lpsp enable status would be exposes by different entry. [Animesh] v5: - Add Platform Gen condition to add i915_lpsp_capability and some cosmetic nitpick changes. [Animesh] Reviewed-by: Animesh Manna Signed-off-by: Anshuman Gupta Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200415170555.15531-3-anshuman.gupta@intel.com commit fc4a8c16e34b2b0a8bd100e1b52dfbba5a8dd981 Author: Anshuman Gupta Date: Wed Apr 15 22:35:52 2020 +0530 drm/i915: Power well id for ICL PG3 Gen11 onwards PG3 is contains functions for pipe B, external displays, and VGA. It make sense to add a power well id with name ICL_DISP_PW_3 rather then TGL_DISP_PW_3, Also PG3 power well id requires to know if lpsp is enabled. Reviewed-by: Animesh Manna Signed-off-by: Anshuman Gupta Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200415170555.15531-2-anshuman.gupta@intel.com commit ceab3ac1e60d70afb4e25147d60817c513f235f7 Author: Mauro Carvalho Chehab Date: Fri Apr 17 09:13:38 2020 +0200 media: dvb-frontends: DUMMY_FE should depends on DVB_CORE Using select for DVB_CORE doesn't work, as reported by Randy: CONFIG_I2C=m CONFIG_DVB_CORE=y ld: drivers/media/dvb-core/dvbdev.o: in function `dvb_module_probe': dvbdev.c:(.text+0xf92): undefined reference to `i2c_new_client_device' ld: dvbdev.c:(.text+0xffb): undefined reference to `i2c_unregister_device' ld: drivers/media/dvb-core/dvbdev.o: in function `dvb_module_release': dvbdev.c:(.text+0x107d): undefined reference to `i2c_unregister_device' The problem is actually caused by the dummy frontend driver, which uses select, and it is missing an I2C dependency: WARNING: unmet direct dependencies detected for DVB_CORE Depends on [m]: MEDIA_SUPPORT [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && (I2C [=m] || I2C [=m]=n) Selected by [y]: - DVB_DUMMY_FE [=y] && MEDIA_SUPPORT [=y] && MEDIA_TEST_SUPPORT [=y] As this is the only frontend driver using "select DVB_CORE", change it do depends on DVB_CORE. Reported-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab commit a735e6b80d911fc1f452cea328c61779445e1054 Author: Mauro Carvalho Chehab Date: Fri Apr 17 09:04:55 2020 +0200 media: cec/usb: depends on USB_SUPPORT and TTY As reported by Randy: WARNING: unmet direct dependencies detected for USB Depends on [n]: USB_SUPPORT [=n] && USB_ARCH_HAS_HCD [=n] Selected by [m]: - USB_RAINSHADOW_CEC [=m] && MEDIA_CEC_SUPPORT [=y] WARNING: unmet direct dependencies detected for USB_ACM Depends on [n]: USB_SUPPORT [=n] && USB [=m] && TTY [=n] Selected by [m]: - USB_RAINSHADOW_CEC [=m] && MEDIA_CEC_SUPPORT [=y] in order to be able to select USB_ACM, we need both USB_SUPPORT and TTY. So, depends on those two. Reported-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab commit e36b68ed273e12a4539b54d24bcdb929d94b68ba Author: Mauro Carvalho Chehab Date: Fri Apr 17 08:55:01 2020 +0200 media: mc/Kconfig: remove staging dependency for request API When the request API got merged, only drivers at staging were using it. As we wanted to be able to do future changes on it, we added an artificial depends on STAGING_MEDIA. Yet, request API is there for quite some time now, and didn't suffer any API breakages during this time. So, drop this. Reported-by: Stephen Rothwell Suggested-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab commit 948565468cfbf7f80eef58aa7f2b7c22dd518bf8 Merge: 08d99b2c23df 8cdf72711928 Author: Thomas Zimmermann Date: Fri Apr 17 08:52:37 2020 +0200 Merge tag 'topic/phy-compliance-2020-04-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-misc-next Topic pull request for topic/phy-compliance: - Standardize DP_PHY_TEST_PATTERN name. - Add support for setting/getting test pattern from sink. - Implement DP PHY compliance to i915. Signed-off-by: Thomas Zimmermann # gpg: Signatur vom Mi 08 Apr 2020 14:46:42 CEST # gpg: mittels RSA-Schlüssel B97BD6A80CAC4981091AE547FE558C72A67013C3 # gpg: Signatur kann nicht geprüft werden: Kein öffentlicher Schlüssel From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/efb3d0d9-2cf7-046b-3a9b-2548d086258e@linux.intel.com commit 7860c8738a164035a24fa471a27d25214e1211b0 Author: Rob Herring Date: Fri Jan 17 17:08:55 2020 -0600 ARM: tegra: Kill off "simple-panel" compatibles "simple-panel" is a Linux driver and has never been an accepted upstream compatible string, so remove it. Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Thierry Reding commit 6af5797c76c11d8c08ae1f5a73c3711fcf89ab6f Author: Mauro Carvalho Chehab Date: Fri Apr 17 08:49:06 2020 +0200 media: cec: don't select PCI & DMI While select would be a great idea for most archs, this causes a breakage with s390: "I don't think that's a good idea, as it suddenly enables selecting all PCI drivers on platforms that do not have PCI. WARNING: unmet direct dependencies detected for PCI Depends on [n]: HAVE_PCI [=n] Selected by [m]: - CEC_SECO [=m] && MEDIA_CEC_SUPPORT [=y] && (X86 || IA64 || COMPILE_TEST [=y]) Reported-by: Geert Uytterhoeven Signed-off-by: Mauro Carvalho Chehab commit b06ef327e26367b9286a2079b31cde8d2161c0d8 Author: Joonas Lahtinen Date: Fri Apr 17 09:35:00 2020 +0300 drm/i915: Update DRIVER_DATE to 20200417 Signed-off-by: Joonas Lahtinen commit aa58a21ae37894d456a2f91a37e9fd71ad4aa27e Author: Bartosz Golaszewski Date: Tue Apr 7 17:42:45 2020 +0200 gpio: pca953x: disable regmap locking This driver uses its own locking but regmap silently uses a mutex for all operations too. Add the option to disable locking to the regmap config struct. Signed-off-by: Bartosz Golaszewski Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Acked-by: Linus Walleij commit 08d99b2c23dfa84ca5b5e5c194062a0550888b71 Merge: 13e3d94110d8 8f3d9f354286 Author: Thomas Zimmermann Date: Fri Apr 17 08:12:22 2020 +0200 Merge drm/drm-next into drm-misc-next Backmerging required to pull topic/phy-compliance. Signed-off-by: Thomas Zimmermann commit 3cbdb97564a39020262e62b655e788b63cf426cb Author: Matt Roper Date: Wed Apr 15 16:34:34 2020 -0700 drm/i915/tgl: TBT AUX should use TC power well ops As on ICL, we want to use the Type-C aux handlers for the TBT aux wells to ensure the DP_AUX_CH_CTL_TBT_IO flag is set properly. Fixes: 656409bbaf87 ("drm/i915/tgl: Add power well support") Cc: José Roberto de Souza Cc: Imre Deak Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200415233435.3064257-1-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza commit 075894d45656fe9aeced4f34ef692b52791d78dc Author: Wang Wenhu Date: Fri Mar 13 09:50:49 2020 -0700 rpmsg: fix a comment typo for rpmsg_device_match() Should be 'a' rather than 'an'. Signed-off-by: WANG Wenhu Link: https://lore.kernel.org/r/20200313165049.62907-1-wenhu.wang@vivo.com Signed-off-by: Bjorn Andersson commit c78bc072ac80823a5934574e791325dd6817ec10 Author: Yangtao Li Date: Sat Dec 1 10:58:38 2018 -0500 remoteproc: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Link: https://lore.kernel.org/r/20181201155838.8619-1-tiny.windzz@gmail.com Signed-off-by: Bjorn Andersson commit 9f60a65bc5e6cd882120d8477cc7bec065887e3d Author: Rob Herring Date: Wed Apr 15 19:55:48 2020 -0500 dt-bindings: Clean-up schema indentation formatting Fix various inconsistencies in schema indentation. Most of these are list indentation which should be 2 spaces more than the start of the enclosing keyword. This doesn't matter functionally, but affects running scripts which do transforms on the schema files. Signed-off-by: Rob Herring Acked-by: Maxime Ripard Acked-by: Lee Jones Acked-By: Vinod Koul Acked-by: Mark Brown Acked-by: Alexandre Belloni Signed-off-by: Rob Herring commit fbfb9a60d5d0d6744c324c2b0640144c329a1d18 Author: Rob Herring Date: Tue Nov 19 08:16:58 2019 -0600 dt-bindings: input: Convert gpio-keys bindings to schema Convert the gpio-keys and gpio-keys-polled bindings to a DT schema. As both bindings are almost the same, combine them into a single schema. The binding said 'interrupts' was required, but testing on dts files showed that it isn't required. 'linux,input-value' was only documented for gpio-keys-polled, but there doesn't seem to be any reason for it to be specific to that. It can work for gpio-keys too if the GPIO line(s) are available. Cc: Dmitry Torokhov Signed-off-by: Rob Herring commit da9953b729c12ece6d35fd15d236457eee679228 Author: Jaegeuk Kim Date: Thu Apr 2 09:32:35 2020 -0700 f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature. -> attach REQ_FUA to Hot Data writes -> attach REQ_FUA to Hot|Warm Data writes -> attach REQ_FUA to Hot|Warm|Cold Data writes -> attach REQ_FUA to Hot|Warm|Cold Data writes as well as REQ_META to Hot Data writes Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 328de1c519c5c0925151cae47944a1c1a0333bcd Author: Rishi Gupta Date: Tue Apr 14 22:18:14 2020 +0530 HID: mcp2221: add GPIO functionality support MCP2221 has 4 pins that can be used as GPIO or configured for alternate functionality such as clock generation and IRQ detection. This patch adds support for GPIO functionality. To set direction of a pin or to toggle its state after it has been configured as GPIO, driver sends command to mcp2221 and parses response received from mcp2221. Based on this response either 0 or appropriate error code is returned to GPIO framework. To get the direction or current state of a pin, driver sends command and read response from the device. Based on the response received from device direction or value is sent to the GPIO framework. Command from driver to mcp2221 device are output report. Response received from mcp2221 is input report. Datasheet (page 45-48) contains details about how to decode the response received from device: http://ww1.microchip.com/downloads/en/DeviceDoc/20005565B.pdf Signed-off-by: Rishi Gupta Reviewed-by: Linus Walleij Signed-off-by: Jiri Kosina commit 7e73aa90a38c8815acea7af71e285658bf5ab879 Author: Andy Shevchenko Date: Wed Apr 8 18:41:55 2020 +0300 gpio: merrifield: Better show how GPIO and IRQ bases are derived from hardware It's a bit hard to realize what the BAR1 is for and what is the layout of the data in it. Be slightly more verbose to better show how GPIO and IRQ bases are derived from the hardware. Signed-off-by: Andy Shevchenko commit 6b1c7837af0e29ad630f0ae18634f6c58a3381ee Author: Andy Shevchenko Date: Wed Apr 8 18:41:54 2020 +0300 gpio: merrifield: Switch over to MSI interrupts Some devices may support MSI interrupts. Let's at least try to use them in platforms that provide MSI capability. Signed-off-by: Andy Shevchenko commit 5376b0b31295364f3a166ee82f1a7d893bcbf8e9 Author: Andy Shevchenko Date: Tue Apr 14 20:49:00 2020 +0300 gpio: pch: Use in pch_irq_type() macros provided by IRQ core Use in pch_irq_type() the macros provided by IRQ core for IRQ type. Signed-off-by: Andy Shevchenko commit 368b8436011ac5138230b98bb34923b7f77ae533 Author: Andy Shevchenko Date: Tue Apr 14 20:48:59 2020 +0300 gpio: pch: Refactor pch_irq_type() to avoid unnecessary locking When type is not supported there is no need to lock and check. Signed-off-by: Andy Shevchenko commit 5a4245de48d87f9300c3cac7c62e1af18916fb22 Author: Andy Shevchenko Date: Tue Apr 14 20:48:58 2020 +0300 gpio: pch: Get rid of unneeded variable in IRQ handler There is no need to have an additional variable in IRQ handler. We may simple rely on the fact of having non-zero register value we read from the hardware. While here, drop repetitive messages in time critical function. Signed-off-by: Andy Shevchenko commit 5c85418ab35bc84d33947e45b2e0ffe55aa8a484 Author: Andy Shevchenko Date: Tue Apr 14 20:48:57 2020 +0300 gpio: pch: Use BIT() and GENMASK() where it's appropriate Use BIT() and GENMASK() where it's appropriate. At the same time drop it where it's not appropriate. Signed-off-by: Andy Shevchenko commit 5f3b82a168d597099dfc20e47e9389c1f7d0c11b Author: Andy Shevchenko Date: Tue Apr 14 19:13:38 2020 +0300 pinctrl: lynxpoint: Use platform_get_irq_optional() explicitly There is no need to repeat functionality of platform_get_irq_optional() in the driver. Replace it with explicit call to the helper. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Reviewed-by: Linus Walleij commit c02e96304451ad3e22c58235061a8363c30116b6 Author: Arnd Bergmann Date: Thu Apr 9 11:02:28 2020 +0200 mips: loongsoon2ef: remove private clk api As platforms are moving to COMMON_CLK in general, loongson2ef stuck out as something that has a private implementation but does not actually use it except for setting the frequency of the CPU itself from the loongson2_cpufreq driver. Change that driver to call the register setting function directly and remove the rest of the stub implementation. Signed-off-by: Arnd Bergmann Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 5ceb89f8a301b2d5c2ffa20c9b41eb2501360113 Author: bibo mao Date: Wed Apr 15 17:56:43 2020 +0800 MIPS: Fix typo for user_ld macro definition There is typo for macro user_ld if __ASSEMBLY__ is declared, this patch fixes this issue. Signed-off-by: bibo mao Signed-off-by: Thomas Bogendoerfer commit 2855c05cf14a5ee0d3b58168632acb11ea35721f Author: Adrian Hunter Date: Wed Apr 1 13:16:08 2020 +0300 perf intel-pt: Add support for synthesizing callchains for regular events Currently, callchains can be synthesized only for synthesized events. Support also synthesizing callchains for regular events. Example: # perf record --kcore --aux-sample -e '{intel_pt//,cycles}' -c 10000 uname Linux [ perf record: Woken up 3 times to write data ] [ perf record: Captured and wrote 0.532 MB perf.data ] # perf script --itrace=Ge | head -20 uname 4864 2419025.358181: 10000 cycles: ffffffffbba56965 apparmor_bprm_committing_creds+0x35 ([kernel.kallsyms]) ffffffffbc400cd5 __indirect_thunk_start+0x5 ([kernel.kallsyms]) ffffffffbba07422 security_bprm_committing_creds+0x22 ([kernel.kallsyms]) ffffffffbb89805d install_exec_creds+0xd ([kernel.kallsyms]) ffffffffbb90d9ac load_elf_binary+0x3ac ([kernel.kallsyms]) uname 4864 2419025.358185: 10000 cycles: ffffffffbba56db0 apparmor_bprm_committed_creds+0x20 ([kernel.kallsyms]) ffffffffbc400cd5 __indirect_thunk_start+0x5 ([kernel.kallsyms]) ffffffffbba07452 security_bprm_committed_creds+0x22 ([kernel.kallsyms]) ffffffffbb89809a install_exec_creds+0x4a ([kernel.kallsyms]) ffffffffbb90d9ac load_elf_binary+0x3ac ([kernel.kallsyms]) uname 4864 2419025.358189: 10000 cycles: ffffffffbb86fdf6 vma_adjust_trans_huge+0x6 ([kernel.kallsyms]) ffffffffbb821660 __vma_adjust+0x160 ([kernel.kallsyms]) ffffffffbb897be7 shift_arg_pages+0x97 ([kernel.kallsyms]) ffffffffbb897ed9 setup_arg_pages+0x1e9 ([kernel.kallsyms]) ffffffffbb90d9f2 load_elf_binary+0x3f2 ([kernel.kallsyms]) Committer testing: # perf record --kcore --aux-sample -e '{intel_pt//,cycles}' -c 10000 uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.233 MB perf.data ] # Then, before this patch: # perf script --itrace=Ge | head -20 uname 28642 168664.856384: 10000 cycles: ffffffff9810aeaa commit_creds+0x2a ([kernel.kallsyms]) uname 28642 168664.856388: 10000 cycles: ffffffff982a24f1 mprotect_fixup+0x151 ([kernel.kallsyms]) uname 28642 168664.856392: 10000 cycles: ffffffff982a385b move_page_tables+0xbcb ([kernel.kallsyms]) uname 28642 168664.856396: 10000 cycles: ffffffff982fd4ec __mod_memcg_state+0x1c ([kernel.kallsyms]) uname 28642 168664.856400: 10000 cycles: ffffffff9829fddd do_mmap+0xfd ([kernel.kallsyms]) uname 28642 168664.856404: 10000 cycles: ffffffff9829c879 __vma_adjust+0x479 ([kernel.kallsyms]) uname 28642 168664.856408: 10000 cycles: ffffffff98238e94 __perf_addr_filters_adjust+0x34 ([kernel.kallsyms]) uname 28642 168664.856412: 10000 cycles: ffffffff98a38e0b down_write+0x1b ([kernel.kallsyms]) uname 28642 168664.856416: 10000 cycles: ffffffff983006a0 memcg_kmem_get_cache+0x0 ([kernel.kallsyms]) uname 28642 168664.856421: 10000 cycles: ffffffff98396eaf load_elf_binary+0x92f ([kernel.kallsyms]) uname 28642 168664.856425: 10000 cycles: ffffffff982e0222 kfree+0x62 ([kernel.kallsyms]) uname 28642 168664.856428: 10000 cycles: ffffffff9846dfd4 file_has_perm+0x54 ([kernel.kallsyms]) uname 28642 168664.856433: 10000 cycles: ffffffff98288911 vma_interval_tree_insert+0x51 ([kernel.kallsyms]) uname 28642 168664.856437: 10000 cycles: ffffffff9823e577 perf_event_mmap_output+0x27 ([kernel.kallsyms]) uname 28642 168664.856441: 10000 cycles: ffffffff98a26fa0 xas_load+0x40 ([kernel.kallsyms]) uname 28642 168664.856445: 10000 cycles: ffffffff98004f30 arch_setup_additional_pages+0x0 ([kernel.kallsyms]) uname 28642 168664.856448: 10000 cycles: ffffffff98a297c0 copy_user_generic_unrolled+0xa0 ([kernel.kallsyms]) uname 28642 168664.856452: 10000 cycles: ffffffff9853a87a strnlen_user+0x10a ([kernel.kallsyms]) uname 28642 168664.856456: 10000 cycles: ffffffff986638a7 randomize_page+0x27 ([kernel.kallsyms]) uname 28642 168664.856460: 10000 cycles: ffffffff98a3b645 _raw_spin_lock+0x5 ([kernel.kallsyms]) # And after: # perf script --itrace=Ge | head -20 uname 28642 168664.856384: 10000 cycles: ffffffff9810aeaa commit_creds+0x2a ([kernel.kallsyms]) ffffffff9831fe87 install_exec_creds+0x17 ([kernel.kallsyms]) ffffffff983968d9 load_elf_binary+0x359 ([kernel.kallsyms]) ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms]) ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms]) uname 28642 168664.856388: 10000 cycles: ffffffff982a24f1 mprotect_fixup+0x151 ([kernel.kallsyms]) ffffffff9831fa83 setup_arg_pages+0x123 ([kernel.kallsyms]) ffffffff9839691f load_elf_binary+0x39f ([kernel.kallsyms]) ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms]) ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms]) uname 28642 168664.856392: 10000 cycles: ffffffff982a385b move_page_tables+0xbcb ([kernel.kallsyms]) ffffffff9831f889 shift_arg_pages+0xa9 ([kernel.kallsyms]) ffffffff9831fb4f setup_arg_pages+0x1ef ([kernel.kallsyms]) ffffffff9839691f load_elf_binary+0x39f ([kernel.kallsyms]) ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms]) # Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-12-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e11869a065e36f3d22a575ccfb1097c262bb4f6e Author: Adrian Hunter Date: Wed Apr 1 13:16:07 2020 +0300 perf evsel: Add support for synthesized sample type For reporting purposes, an evsel sample can have a callchain synthesized from AUX area data. Add support for keeping track of synthesized sample types. Note, the recorded sample_type cannot be changed because it is needed to continue to parse events. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-11-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 8e94b3243a9af2c49a38fd0d6f2f9beb542e41a4 Author: Adrian Hunter Date: Wed Apr 1 13:16:07 2020 +0300 perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set Using 'type' variable for checking for callchains is equivalent to using evsel__has_callchain(evsel) and is how the other PERF_SAMPLE_ bits are checked in this function, so use it to be consistent. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-11-adrian.hunter@intel.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 4fef41bfb1d8d2ada4a18eb3ab80c2682bcbae12 Author: Adrian Hunter Date: Wed Apr 1 13:16:06 2020 +0300 perf thread-stack: Add thread_stack__sample_late() Add a thread stack function to create a call chain for hardware events where the sample records get created some time after the event occurred. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1c5c25b3fdbd7035f6d53a1a99b5afd577ce13e1 Author: Adrian Hunter Date: Wed Apr 1 13:16:05 2020 +0300 perf auxtrace: Add an option to synthesize callchains for regular events Currently, callchains can be synthesized only for synthesized events. Add an itrace option to synthesize callchains for regular events. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5c7bec0c9c543733fa96fe500e4c245be6f9fd30 Author: Adrian Hunter Date: Wed Apr 1 13:16:04 2020 +0300 perf auxtrace: For reporting purposes, un-group AUX area event An AUX area event must be the group leader when recording traces in sample mode, but that does not produce the expected results from 'perf report' because it expects the leader to provide samples. Rather than teach 'perf report' about AUX area sampling, un-group the AUX area event during processing, making the 2nd event the leader. Example: $ perf record -e '{intel_pt//u,branch-misses:u}' -c 1 uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.080 MB perf.data ] Before: $ perf report Samples: 800 of events 'anon group { intel_pt//u, branch-misses:u }', Event count (approx.): 800 Children Self Command Shared Object Symbol 0.00% 47.50% 0.00% 47.50% uname libc-2.28.so [.] _dl_addr 0.00% 16.38% 0.00% 16.38% uname ld-2.28.so [.] __GI___tunables_init 0.00% 54.75% 0.00% 4.75% uname ld-2.28.so [.] dl_main 0.00% 3.12% 0.00% 3.12% uname ld-2.28.so [.] _dl_map_object_from_fd 0.00% 2.38% 0.00% 2.38% uname ld-2.28.so [.] strcmp 0.00% 2.25% 0.00% 2.25% uname ld-2.28.so [.] _dl_check_map_versions 0.00% 2.00% 0.00% 2.00% uname ld-2.28.so [.] _dl_important_hwcaps 0.00% 2.00% 0.00% 2.00% uname ld-2.28.so [.] _dl_map_object_deps 0.00% 51.50% 0.00% 1.50% uname ld-2.28.so [.] _dl_sysdep_start 0.00% 1.25% 0.00% 1.25% uname ld-2.28.so [.] _dl_load_cache_lookup 0.00% 51.12% 0.00% 1.12% uname ld-2.28.so [.] _dl_start 0.00% 50.88% 0.00% 1.12% uname ld-2.28.so [.] do_lookup_x 0.00% 50.62% 0.00% 1.00% uname ld-2.28.so [.] _dl_lookup_symbol_x 0.00% 1.00% 0.00% 1.00% uname ld-2.28.so [.] _dl_map_object 0.00% 1.00% 0.00% 1.00% uname ld-2.28.so [.] _dl_next_ld_env_entry 0.00% 0.88% 0.00% 0.88% uname ld-2.28.so [.] _dl_cache_libcmp 0.00% 0.88% 0.00% 0.88% uname ld-2.28.so [.] _dl_new_object 0.00% 50.88% 0.00% 0.88% uname ld-2.28.so [.] _dl_relocate_object 0.00% 0.62% 0.00% 0.62% uname ld-2.28.so [.] _dl_init_paths 0.00% 0.62% 0.00% 0.62% uname ld-2.28.so [.] _dl_name_match_p 0.00% 0.50% 0.00% 0.50% uname ld-2.28.so [.] get_common_indeces.constprop.1 0.00% 0.50% 0.00% 0.50% uname ld-2.28.so [.] memmove 0.00% 0.50% 0.00% 0.50% uname ld-2.28.so [.] memset 0.00% 0.50% 0.00% 0.50% uname ld-2.28.so [.] open_verify.constprop.11 0.00% 0.38% 0.00% 0.38% uname ld-2.28.so [.] _dl_check_all_versions 0.00% 0.38% 0.00% 0.38% uname ld-2.28.so [.] _dl_find_dso_for_object 0.00% 0.38% 0.00% 0.38% uname ld-2.28.so [.] init_tls 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] __tunable_get_val 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] _dl_add_to_namespace_list 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] _dl_determine_tlsoffset 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] _dl_discover_osversion 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] calloc@plt 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] malloc 0.00% 0.25% 0.00% 0.25% uname ld-2.28.so [.] malloc@plt 0.00% 0.25% 0.00% 0.25% uname libc-2.28.so [.] _nl_load_locale_from_archive 0.00% 0.25% 0.00% 0.25% uname [unknown] [k] 0xffffffffa3a00010 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] __libc_scratch_buffer_set_array_size 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] _dl_allocate_tls_storage 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] _dl_catch_exception 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] _dl_setup_hash 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] _dl_sort_maps 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] _dl_sysdep_read_whole_file 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] access 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] calloc 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] mmap64 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] openaux 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] rtld_lock_default_lock_recursive 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] rtld_lock_default_unlock_recursive 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] strchr 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] strlen 0.00% 0.12% 0.00% 0.12% uname ld-2.28.so [.] 0x0000000000001080 0.00% 0.12% 0.00% 0.12% uname libc-2.28.so [.] __strchrnul_avx2 0.00% 0.12% 0.00% 0.12% uname libc-2.28.so [.] _nl_normalize_codeset 0.00% 0.12% 0.00% 0.12% uname libc-2.28.so [.] malloc 0.00% 0.12% 0.00% 0.12% uname [unknown] [k] 0xffffffffa3a011f0 0.00% 50.00% 0.00% 0.00% uname ld-2.28.so [.] _dl_start_user 0.00% 50.00% 0.00% 0.00% uname [unknown] [.] 0000000000000000 After: Samples: 800 of event 'branch-misses:u', Event count (approx.): 800 Children Self Command Shared Object Symbol 54.75% 4.75% uname ld-2.28.so [.] dl_main 51.50% 1.50% uname ld-2.28.so [.] _dl_sysdep_start 51.12% 1.12% uname ld-2.28.so [.] _dl_start 50.88% 0.88% uname ld-2.28.so [.] _dl_relocate_object 50.88% 1.12% uname ld-2.28.so [.] do_lookup_x 50.62% 1.00% uname ld-2.28.so [.] _dl_lookup_symbol_x 50.00% 0.00% uname ld-2.28.so [.] _dl_start_user 50.00% 0.00% uname [unknown] [.] 0000000000000000 47.50% 47.50% uname libc-2.28.so [.] _dl_addr 16.38% 16.38% uname ld-2.28.so [.] __GI___tunables_init 3.12% 3.12% uname ld-2.28.so [.] _dl_map_object_from_fd 2.38% 2.38% uname ld-2.28.so [.] strcmp 2.25% 2.25% uname ld-2.28.so [.] _dl_check_map_versions 2.00% 2.00% uname ld-2.28.so [.] _dl_important_hwcaps 2.00% 2.00% uname ld-2.28.so [.] _dl_map_object_deps 1.25% 1.25% uname ld-2.28.so [.] _dl_load_cache_lookup 1.00% 1.00% uname ld-2.28.so [.] _dl_map_object 1.00% 1.00% uname ld-2.28.so [.] _dl_next_ld_env_entry 0.88% 0.88% uname ld-2.28.so [.] _dl_cache_libcmp 0.88% 0.88% uname ld-2.28.so [.] _dl_new_object 0.62% 0.62% uname ld-2.28.so [.] _dl_init_paths 0.62% 0.62% uname ld-2.28.so [.] _dl_name_match_p 0.50% 0.50% uname ld-2.28.so [.] get_common_indeces.constprop.1 0.50% 0.50% uname ld-2.28.so [.] memmove 0.50% 0.50% uname ld-2.28.so [.] memset 0.50% 0.50% uname ld-2.28.so [.] open_verify.constprop.11 0.38% 0.38% uname ld-2.28.so [.] _dl_check_all_versions 0.38% 0.38% uname ld-2.28.so [.] _dl_find_dso_for_object 0.38% 0.38% uname ld-2.28.so [.] init_tls 0.25% 0.25% uname ld-2.28.so [.] __tunable_get_val 0.25% 0.25% uname ld-2.28.so [.] _dl_add_to_namespace_list 0.25% 0.25% uname ld-2.28.so [.] _dl_determine_tlsoffset 0.25% 0.25% uname ld-2.28.so [.] _dl_discover_osversion 0.25% 0.25% uname ld-2.28.so [.] calloc@plt 0.25% 0.25% uname ld-2.28.so [.] malloc 0.25% 0.25% uname ld-2.28.so [.] malloc@plt 0.25% 0.25% uname libc-2.28.so [.] _nl_load_locale_from_archive 0.25% 0.25% uname [unknown] [k] 0xffffffffa3a00010 0.12% 0.12% uname ld-2.28.so [.] __libc_scratch_buffer_set_array_size 0.12% 0.12% uname ld-2.28.so [.] _dl_allocate_tls_storage 0.12% 0.12% uname ld-2.28.so [.] _dl_catch_exception 0.12% 0.12% uname ld-2.28.so [.] _dl_setup_hash 0.12% 0.12% uname ld-2.28.so [.] _dl_sort_maps 0.12% 0.12% uname ld-2.28.so [.] _dl_sysdep_read_whole_file 0.12% 0.12% uname ld-2.28.so [.] access 0.12% 0.12% uname ld-2.28.so [.] calloc 0.12% 0.12% uname ld-2.28.so [.] mmap64 0.12% 0.12% uname ld-2.28.so [.] openaux 0.12% 0.12% uname ld-2.28.so [.] rtld_lock_default_lock_recursive 0.12% 0.12% uname ld-2.28.so [.] rtld_lock_default_unlock_recursive 0.12% 0.12% uname ld-2.28.so [.] strchr 0.12% 0.12% uname ld-2.28.so [.] strlen 0.12% 0.12% uname ld-2.28.so [.] 0x0000000000001080 0.12% 0.12% uname libc-2.28.so [.] __strchrnul_avx2 0.12% 0.12% uname libc-2.28.so [.] _nl_normalize_codeset 0.12% 0.12% uname libc-2.28.so [.] malloc 0.12% 0.12% uname [unknown] [k] 0xffffffffa3a011f0 Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 113fcb46cfd557c549ab6bd9a1d43fda2c3a488c Author: Adrian Hunter Date: Wed Apr 1 13:16:03 2020 +0300 perf s390-cpumsf: Implement ->evsel_is_auxtrace() callback Implement ->evsel_is_auxtrace() callback. Signed-off-by: Adrian Hunter Acked-by: Thomas Richter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a58ab57caad02b0d854969e191b5d1d4b0f90930 Author: Adrian Hunter Date: Wed Apr 1 13:16:02 2020 +0300 perf cs-etm: Implement ->evsel_is_auxtrace() callback Implement ->evsel_is_auxtrace() callback. Signed-off-by: Adrian Hunter Reviewed-by: Mathieu Poirier Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 508c71e3f90e4ceee7516d691355a36660a3e5bf Author: Adrian Hunter Date: Wed Apr 1 13:16:01 2020 +0300 perf arm-spe: Implement ->evsel_is_auxtrace() callback Implement ->evsel_is_auxtrace() callback. Signed-off-by: Adrian Hunter Reviewed-by: Leo Yan Cc: Andi Kleen Cc: Jiri Olsa Cc: Kim Phillips Link: http://lore.kernel.org/lkml/20200401101613.6201-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 966246f597deafbcb1d8c126865b4efdc2be776e Author: Adrian Hunter Date: Wed Apr 1 13:16:00 2020 +0300 perf intel-bts: Implement ->evsel_is_auxtrace() callback Implement ->evsel_is_auxtrace() callback. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6b52bb07c397af274850deb9e4e054bdb6261e73 Author: Adrian Hunter Date: Wed Apr 1 13:15:59 2020 +0300 perf intel-pt: Implement ->evsel_is_auxtrace() callback Implement ->evsel_is_auxtrace() callback. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 853f37d75c44c305f750d8c4a34d83f03b610fce Author: Adrian Hunter Date: Wed Apr 1 13:15:58 2020 +0300 perf auxtrace: Add ->evsel_is_auxtrace() callback Add ->evsel_is_auxtrace() callback to identify if a selected event is an AUX area event. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Cc: Kim Phillips Cc: Mathieu Poirier Cc: Thomas Richter Link: http://lore.kernel.org/lkml/20200401101613.6201-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5287f926920688e1151741d49da37a533ccf1960 Author: Andreas Gerstmayr Date: Fri Mar 20 16:13:48 2020 +0100 perf script: Add flamegraph.py script This script works in tandem with d3-flame-graph to generate flame graphs from perf. It supports two output formats: JSON and HTML (the default). The HTML format will look for a standalone d3-flame-graph template file in /usr/share/d3-flame-graph/d3-flamegraph-base.html and fill in the collected stacks. Usage: perf record -a -g -F 99 sleep 60 perf script report flamegraph Combined: perf script flamegraph -a -F 99 sleep 60 Committer testing: Tested both with "PYTHON=python3" and with the default, that uses python2-devel: Complete set of instructions: $ mkdir /tmp/build/perf $ make PYTHON=python3 -C tools/perf O=/tmp/build/perf install-bin $ export PATH=~/bin:$PATH $ perf record -a -g -F 99 sleep 60 $ perf script report flamegraph Now go and open the generated flamegraph.html file in a browser. At first this required building with PYTHON=python3, but after I reported this Andreas was kind enough to send a patch making it work with both python and python3. Signed-off-by: Andreas Gerstmayr Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Brendan Gregg Cc: Martin Spier Link: http://lore.kernel.org/lkml/20200320151355.66302-1-agerstmayr@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 47352aba40035ab3fdc50dd03a94456feabed7d8 Author: Kajol Jain Date: Thu Apr 2 02:03:36 2020 +0530 perf metrictroup: Split the metricgroup__add_metric function This patch refactors metricgroup__add_metric function where some part of it move to function metricgroup__add_metric_param. No logic change. Signed-off-by: Kajol Jain Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-4-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 871f9f599db8d9d2387c0717e712af405290edea Author: Jiri Olsa Date: Thu Apr 2 02:03:35 2020 +0530 perf expr: Add expr_scanner_ctx object Add the expr_scanner_ctx object to hold user data for the expr scanner. Currently it holds only start_token, Kajol Jain will use it to hold 24x7 runtime param. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kajol Jain Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-3-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit aecce63e2b98f28606b063949cca06facf215d6c Author: Jiri Olsa Date: Thu Apr 2 02:03:34 2020 +0530 perf expr: Add expr_ prefix for parse_ctx and parse_id Adding expr_ prefix for parse_ctx and parse_id, to straighten out the expr* namespace. There's no functional change. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kajol Jain Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-2-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 04ed4ccb9c07868bc0cb41f699391332bf62220c Author: Ian Rogers Date: Thu Apr 2 08:43:55 2020 -0700 perf synthetic-events: save 4kb from 2 stack frames Reuse an existing char buffer to avoid two PATH_MAX sized char buffers. Reduces stack frame sizes by 4kb. perf_event__synthesize_mmap_events before 'sub $0x45b8,%rsp' after 'sub $0x35b8,%rsp'. perf_event__get_comm_ids before 'sub $0x2028,%rsp' after 'sub $0x1028,%rsp'. The performance impact of this change is negligible. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andrey Zhizhikin Cc: Jiri Olsa Cc: Kan Liang Cc: Kefeng Wang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200402154357.107873-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c6fddb28bad26e5472cb7acf7b04cd5126f1a4ab Author: Stephane Eranian Date: Thu Apr 2 08:43:54 2020 -0700 tools api fs: Make xxx__mountpoint() more scalable The xxx_mountpoint() interface provided by fs.c finds mount points for common pseudo filesystems. The first time xxx_mountpoint() is invoked, it scans the mount table (/proc/mounts) looking for a match. If found, it is cached. The price to scan /proc/mounts is paid once if the mount is found. When the mount point is not found, subsequent calls to xxx_mountpoint() scan /proc/mounts over and over again. There is no caching. This causes a scaling issue in perf record with hugeltbfs__mountpoint(). The function is called for each process found in synthesize__mmap_events(). If the machine has thousands of processes and if the /proc/mounts has many entries this could cause major overhead in perf record. We have observed multi-second slowdowns on some configurations. As an example on a laptop: Before: $ sudo umount /dev/hugepages $ strace -e trace=openat -o /tmp/tt perf record -a ls $ fgrep mounts /tmp/tt 285 After: $ sudo umount /dev/hugepages $ strace -e trace=openat -o /tmp/tt perf record -a ls $ fgrep mounts /tmp/tt 1 One could argue that the non-caching in case the moint point is not found is intentional. That way subsequent calls may discover a moint point if the sysadmin mounts the filesystem. But the same argument could be made against caching the mount point. It could be unmounted causing errors. It all depends on the intent of the interface. This patch assumes it is expected to scan /proc/mounts once. The patch documents the caching behavior in the fs.h header file. An alternative would be to just fix perf record. But it would solve the problem with hugetlbs__mountpoint() but there could be similar issues (possibly down the line) with other xxx_mountpoint() calls in perf or other tools. Signed-off-by: Stephane Eranian Reviewed-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andrey Zhizhikin Cc: Kan Liang Cc: Kefeng Wang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Petr Mladek Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200402154357.107873-3-irogers@google.com Signed-off-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo commit 2a4b51666af8bf0b67ccc2e53120bad27351917c Author: Ian Rogers Date: Thu Apr 2 08:43:53 2020 -0700 perf bench: Add event synthesis benchmark Event synthesis may occur at the start or end (tail) of a perf command. In system-wide mode it can scan every process in /proc, which may add seconds of latency before event recording. Add a new benchmark that times how long event synthesis takes with and without data synthesis. An example execution looks like: $ perf bench internals synthesize # Running 'internals/synthesize' benchmark: Average synthesis took: 168.253800 usec Average data synthesis took: 208.104700 usec Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andrey Zhizhikin Cc: Kan Liang Cc: Kefeng Wang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephane Eranian Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200402154357.107873-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1a2725f3ee5571cf07966f467b73a9941bcbacb8 Author: Adrian Hunter Date: Thu Apr 2 17:15:48 2020 +0300 perf script: Simplify auxiliary event printing functions This simplifies the print functions for the following perf script options: --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events Example: # perf record --switch-events -a -e cycles -c 10000 sleep 1 Before: # perf script --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events > out-before.txt After: # perf script --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events > out-after.txt # diff -s out-before.txt out-after.txt Files out-before.txt and out-after.tx are identical Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lore.kernel.org/lkml/20200402141548.21283-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 025b16f81dd7f51f29d0109399d669438c63b6ce Author: Alexey Budankov Date: Thu Apr 2 11:54:39 2020 +0300 doc/admin-guide: update kernel.rst with CAP_PERFMON information Update the kernel.rst documentation file with the information related to usage of CAP_PERFMON capability to secure performance monitoring and observability operations in system. Signed-off-by: Alexey Budankov Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: James Morris Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/84c32383-14a2-fa35-16b6-f9e59bd37240@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 902a8dcc5ba6c5dc3332e8806b01be2f0f7ef2e4 Author: Alexey Budankov Date: Thu Apr 2 11:54:01 2020 +0300 doc/admin-guide: Update perf-security.rst with CAP_PERFMON information Update perf-security.rst documentation file with the information related to usage of CAP_PERFMON capability to secure performance monitoring and observability operations in system. Committer notes: While testing 'perf top' under cap_perfmon I noticed that it needs some more capability and Alexey pointed out cap_ipc_lock, as needed by this kernel chunk: kernel/events/core.c: 6101 if ((locked > lock_limit) && perf_is_paranoid() && !capable(CAP_IPC_LOCK)) { ret = -EPERM; goto unlock; } So I added it to the documentation, and also mentioned that if the libcap version doesn't yet supports 'cap_perfmon', its numeric value can be used instead, i.e. if: # setcap "cap_perfmon,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf Fails, try: # setcap "38,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf I also added a paragraph stating that using an unpatched libcap will fail the check for CAP_PERFMON, as it checks the cap number against a maximum to see if it is valid, which makes it use as the default the 'cycles:u' event, even tho a cap_perfmon capable perf binary can get kernel samples, to workaround that just use, e.g.: # perf top -e cycles # perf record -e cycles And it will sample kernel and user modes. Signed-off-by: Alexey Budankov Tested-by: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: James Morris Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/17278551-9399-9ebe-d665-8827016a217d@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ab76878bb720cbd35a05ae868387f4373a58c949 Author: Alexey Budankov Date: Thu Apr 2 11:53:07 2020 +0300 drivers/oprofile: Open access for CAP_PERFMON privileged process Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Acked-by: James Morris Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/691f1096-b15f-9b12-50a0-c2b93918149e@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit cea7d0d4a59b4efd0e1fe067130b4c06ab4d412f Author: Alexey Budankov Date: Thu Apr 2 11:51:21 2020 +0300 drivers/perf: Open access for CAP_PERFMON privileged process Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Acked-by: Will Deacon Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/4ec1d6f7-548c-8d1c-f84a-cebeb9674e4e@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit cf91baf3f7f39a0cd29072e21ed0e4bb1ab3b382 Author: Alexey Budankov Date: Thu Apr 2 11:50:15 2020 +0300 parisc/perf: open access for CAP_PERFMON privileged process Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Acked-by: Helge Deller Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/8cc98809-d35b-de0f-de02-4cf554f3cf62@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ff46758313e688fca7d762b3e6ead32843999511 Author: Alexey Budankov Date: Thu Apr 2 11:49:36 2020 +0300 powerpc/perf: open access for CAP_PERFMON privileged process Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Acked-by: Anju T Sudhakar Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/ac98cd9f-b59e-673c-c70d-180b3e7695d2@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 031258da05956646c5606023ab0abe10a7e68ea1 Author: Alexey Budankov Date: Thu Apr 2 11:48:54 2020 +0300 trace/bpf_trace: Open access for CAP_PERFMON privileged process Open access to bpf_trace monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to bpf_trace monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure bpf_trace monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Acked-by: Song Liu Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/c0a0ae47-8b6e-ff3e-416b-3cd1faaf71c0@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 4e3d3456b78fa5a70e65de0d7c5309b814281ae3 Author: Alexey Budankov Date: Thu Apr 2 11:48:15 2020 +0300 drm/i915/perf: Open access for CAP_PERFMON privileged process Open access to i915_perf monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to i915_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure i915_events monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Acked-by: Lionel Landwerlin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/e3e3292f-f765-ea98-e59c-fbe2db93fd34@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6b3e0e2e04615df128b2d38fa1dd1fcb84f2504c Author: Alexey Budankov Date: Thu Apr 2 11:47:35 2020 +0300 perf tools: Support CAP_PERFMON capability Extend error messages to mention CAP_PERFMON capability as an option to substitute CAP_SYS_ADMIN capability for secure system performance monitoring and observability operations. Make perf_event_paranoid_check() and __cmd_ftrace() to be aware of CAP_PERFMON capability. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to perf_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure perf_events monitoring is discouraged with respect to CAP_PERFMON capability. Committer testing: Using a libcap with this patch: diff --git a/libcap/include/uapi/linux/capability.h b/libcap/include/uapi/linux/capability.h index 78b2fd4c8a95..89b5b0279b60 100644 --- a/libcap/include/uapi/linux/capability.h +++ b/libcap/include/uapi/linux/capability.h @@ -366,8 +366,9 @@ struct vfs_ns_cap_data { #define CAP_AUDIT_READ 37 +#define CAP_PERFMON 38 -#define CAP_LAST_CAP CAP_AUDIT_READ +#define CAP_LAST_CAP CAP_PERFMON #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) Note that using '38' in place of 'cap_perfmon' works to some degree with an old libcap, its only when cap_get_flag() is called that libcap performs an error check based on the maximum value known for capabilities that it will fail. This makes determining the default of perf_event_attr.exclude_kernel to fail, as it can't determine if CAP_PERFMON is in place. Using 'perf top -e cycles' avoids the default check and sets perf_event_attr.exclude_kernel to 1. As root, with a libcap supporting CAP_PERFMON: # groupadd perf_users # adduser perf -g perf_users # mkdir ~perf/bin # cp ~acme/bin/perf ~perf/bin/ # chgrp perf_users ~perf/bin/perf # setcap "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" ~perf/bin/perf # getcap ~perf/bin/perf /home/perf/bin/perf = cap_sys_ptrace,cap_syslog,cap_perfmon+ep # ls -la ~perf/bin/perf -rwxr-xr-x. 1 root perf_users 16968552 Apr 9 13:10 /home/perf/bin/perf As the 'perf' user in the 'perf_users' group: $ perf top -a --stdio Error: Failed to mmap with 1 (Operation not permitted) $ Either add the cap_ipc_lock capability to the perf binary or reduce the ring buffer size to some smaller value: $ perf top -m10 -a --stdio rounding mmap pages size to 64K (16 pages) Error: Failed to mmap with 1 (Operation not permitted) $ perf top -m4 -a --stdio Error: Failed to mmap with 1 (Operation not permitted) $ perf top -m2 -a --stdio PerfTop: 762 irqs/sec kernel:49.7% exact: 100.0% lost: 0/0 drop: 0/0 [4000Hz cycles], (all, 4 CPUs) ------------------------------------------------------------------------------------------------------ 9.83% perf [.] __symbols__insert 8.58% perf [.] rb_next 5.91% [kernel] [k] module_get_kallsym 5.66% [kernel] [k] kallsyms_expand_symbol.constprop.0 3.98% libc-2.29.so [.] __GI_____strtoull_l_internal 3.66% perf [.] rb_insert_color 2.34% [kernel] [k] vsnprintf 2.30% [kernel] [k] string_nocheck 2.16% libc-2.29.so [.] _IO_getdelim 2.15% [kernel] [k] number 2.13% [kernel] [k] format_decode 1.58% libc-2.29.so [.] _IO_feof 1.52% libc-2.29.so [.] __strcmp_avx2 1.50% perf [.] rb_set_parent_color 1.47% libc-2.29.so [.] __libc_calloc 1.24% [kernel] [k] do_syscall_64 1.17% [kernel] [k] __x86_indirect_thunk_rax $ perf record -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.552 MB perf.data (74 samples) ] $ perf evlist cycles $ perf evlist -v cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1 $ perf report | head -20 # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 74 of event 'cycles' # Event count (approx.): 15694834 # # Overhead Command Shared Object Symbol # ........ ............... .......................... ...................................... # 19.62% perf [kernel.vmlinux] [k] strnlen_user 13.88% swapper [kernel.vmlinux] [k] intel_idle 13.83% ksoftirqd/0 [kernel.vmlinux] [k] pfifo_fast_dequeue 13.51% swapper [kernel.vmlinux] [k] kmem_cache_free 6.31% gnome-shell [kernel.vmlinux] [k] kmem_cache_free 5.66% kworker/u8:3+ix [kernel.vmlinux] [k] delay_tsc 4.42% perf [kernel.vmlinux] [k] __set_cpus_allowed_ptr 3.45% kworker/2:1-eve [kernel.vmlinux] [k] shmem_truncate_range 2.29% gnome-shell libgobject-2.0.so.0.6000.7 [.] g_closure_ref $ Signed-off-by: Alexey Budankov Reviewed-by: James Morris Acked-by: Jiri Olsa Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/a66d5648-2b8e-577e-e1f2-1d56c017ab5e@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c9e0924e5c2b59365f9c0d43ff8722e79ecf4088 Author: Alexey Budankov Date: Thu Apr 2 11:47:01 2020 +0300 perf/core: open access to probes for CAP_PERFMON privileged process Open access to monitoring via kprobes and uprobes and eBPF tracing for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. perf kprobes and uprobes are used by ftrace and eBPF. perf probe uses ftrace to define new kprobe events, and those events are treated as tracepoint events. eBPF defines new probes via perf_event_open interface and then the probes are used in eBPF tracing. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons access to perf_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure perf_events monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Tested-by: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Cc: linux-man@vger.kernel.org Link: http://lore.kernel.org/lkml/3c129d9a-ba8a-3483-ecc5-ad6c8e7c203f@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 18aa18566218d4a46d940049b835314d2b071cc2 Author: Alexey Budankov Date: Thu Apr 2 11:46:24 2020 +0300 perf/core: Open access to the core for CAP_PERFMON privileged process Open access to monitoring of kernel code, CPUs, tracepoints and namespaces data for a CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) For backward compatibility reasons the access to perf_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure perf_events monitoring is discouraged with respect to CAP_PERFMON capability. Signed-off-by: Alexey Budankov Reviewed-by: James Morris Tested-by: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: linux-man@vger.kernel.org Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Serge Hallyn Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/471acaef-bb8a-5ce2-923f-90606b78eef9@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 980737282232b752bb14dab96d77665c15889c36 Author: Alexey Budankov Date: Thu Apr 2 11:45:31 2020 +0300 capabilities: Introduce CAP_PERFMON to kernel and user space Introduce the CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON can assist CAP_SYS_ADMIN capability in its governing role for performance monitoring and observability subsystems. CAP_PERFMON hardens system security and integrity during performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [2]. Providing the access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operation more secure. Thus, CAP_PERFMON implements the principle of least privilege for performance monitoring and observability operations (POSIX IEEE 1003.1e: 2.2.2.39 principle of least privilege: A security design principle that states that a process or program be granted only those privileges (e.g., capabilities) necessary to accomplish its legitimate function, and only for the time that such privileges are actually required) CAP_PERFMON meets the demand to secure system performance monitoring and observability operations for adoption in security sensitive, restricted, multiuser production environments (e.g. HPC clusters, cloud and virtual compute environments), where root or CAP_SYS_ADMIN credentials are not available to mass users of a system, and securely unblocks applicability and scalability of system performance monitoring and observability operations beyond root and CAP_SYS_ADMIN use cases. CAP_PERFMON takes over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balances amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below." For backward compatibility reasons access to system performance monitoring and observability subsystems of the kernel remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN capability usage for secure system performance monitoring and observability operations is discouraged with respect to the designed CAP_PERFMON capability. Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official hardware issues mitigation procedure [2]. The bugs in the software itself can be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations. [1] http://man7.org/linux/man-pages/man7/capabilities.7.html [2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html [3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html Signed-off-by: Alexey Budankov Acked-by: James Morris Acked-by: Serge E. Hallyn Acked-by: Song Liu Acked-by: Stephen Smalley Tested-by: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Igor Lubashev Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: linux-doc@vger.kernel.org Cc: linux-man@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: selinux@vger.kernel.org Link: http://lore.kernel.org/lkml/5590d543-82c6-490a-6544-08e6a5517db0@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3c29d4483e855b6ba5c6e35b0c81caad7d9e3984 Author: Jiri Olsa Date: Thu Mar 12 20:56:10 2020 +0100 perf annotate: Add basic support for bpf_image Add the DSO_BINARY_TYPE__BPF_IMAGE dso binary type to recognize BPF images that carry trampoline or dispatcher. Upcoming patches will add support to read the image data, store it within the BPF feature in perf.data and display it for annotation purposes. Currently we only display following message: # ./perf annotate bpf_trampoline_24456 --stdio Percent | Source code & Disassembly of . for cycles (504 ... --------------------------------------------------------------- ... : to be implemented Signed-off-by: Jiri Olsa Acked-by: Song Liu Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Björn Töpel Cc: Daniel Borkmann Cc: David S. Miller Cc: Jakub Kicinski Cc: Jesper Dangaard Brouer Cc: John Fastabend Cc: Martin KaFai Lau Cc: Yonghong Song Link: https://lore.kernel.org/bpf/20200312195610.346362-16-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7eddf7e74e54aea3b24410b3fb8911927836632f Author: Jiri Olsa Date: Thu Mar 12 20:56:09 2020 +0100 perf machine: Set ksymbol dso as loaded on arrival There's no special load action for ksymbol data on map__load/dso__load action, where the kernel is getting loaded. It only gets confused with kernel kallsyms/vmlinux load for bpf object, which fails and could mess up with the map. Disabling any further load of the map for ksymbol related dso/map. Signed-off-by: Jiri Olsa Acked-by: Song Liu Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Björn Töpel Cc: Daniel Borkmann Cc: David S. Miller Cc: Jakub Kicinski Cc: Jesper Dangaard Brouer Cc: John Fastabend Cc: Martin KaFai Lau Cc: Yonghong Song Link: https://lore.kernel.org/bpf/20200312195610.346362-15-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 943930e4729a64c11142a0370415663b39189996 Author: Jiri Olsa Date: Thu Mar 12 20:56:08 2020 +0100 perf tools: Synthesize bpf_trampoline/dispatcher ksymbol event Synthesize bpf images (trampolines/dispatchers) on start, as ksymbol events from /proc/kallsyms. Having this perf can recognize samples from those images and perf report and top shows them correctly. The rest of the ksymbol handling is already in place from for the bpf programs monitoring, so only the initial state was needed. perf report output: # Overhead Command Shared Object Symbol 12.37% test_progs [kernel.vmlinux] [k] entry_SYSCALL_64 11.80% test_progs [kernel.vmlinux] [k] syscall_return_via_sysret 9.63% test_progs bpf_prog_bcf7977d3b93787c_prog2 [k] bpf_prog_bcf7977d3b93787c_prog2 6.90% test_progs bpf_trampoline_24456 [k] bpf_trampoline_24456 6.36% test_progs [kernel.vmlinux] [k] memcpy_erms Committer notes: Use scnprintf() instead of strncpy() to overcome this on fedora:32, rawhide and OpenMandriva Cooker: CC /tmp/build/perf/util/bpf-event.o In file included from /usr/include/string.h:495, from /git/linux/tools/lib/bpf/libbpf_common.h:12, from /git/linux/tools/lib/bpf/bpf.h:31, from util/bpf-event.c:4: In function 'strncpy', inlined from 'process_bpf_image' at util/bpf-event.c:323:2, inlined from 'kallsyms_process_symbol' at util/bpf-event.c:358:9: /usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 256 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Jiri Olsa Acked-by: Song Liu Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Björn Töpel Cc: Daniel Borkmann Cc: David S. Miller Cc: Jakub Kicinski Cc: Jesper Dangaard Brouer Cc: John Fastabend Cc: Martin KaFai Lau Cc: Yonghong Song Link: https://lore.kernel.org/bpf/20200312195610.346362-14-jolsa@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit cfbd41b786519d4a15e1c15181556689bcf6635a Author: Arnaldo Carvalho de Melo Date: Wed Apr 15 12:31:26 2020 -0300 perf stat: Honour --timeout for forked workloads When --timeout is used and a workload is specified to be started by 'perf stat', i.e. $ perf stat --timeout 1000 sleep 1h The --timeout wasn't being honoured, i.e. the workload, 'sleep 1h' in the above example, should be terminated after 1000ms, but it wasn't, 'perf stat' was waiting for it to finish. Fix it by sending a SIGTERM when the timeout expires. Now it works: # perf stat -e cycles --timeout 1234 sleep 1h sleep: Terminated Performance counter stats for 'sleep 1h': 1,066,692 cycles 1.234314838 seconds time elapsed 0.000750000 seconds user 0.000000000 seconds sys # Fixes: f1f8ad52f8bf ("perf stat: Add support to print counts after a period of time") Reported-by: Konstantin Kharlamov Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207243 Tested-by: Konstantin Kharlamov Cc: Adrian Hunter Acked-by: Jiri Olsa Tested-by: Jiri Olsa Cc: Namhyung Kim Cc: yuzhoujian Link: https://lore.kernel.org/lkml/20200415153803.GB20324@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5ba8e3e75361c68c1120080d7ffe8839bf11c06d Merge: 858e26a515c2 33e8fd4bfbd7 Author: Mark Brown Date: Thu Apr 16 15:46:21 2020 +0100 Merge series "Cleanup chip info in spi-dw driver" from Clement Leger : Some mechanisms have no more user, and as such code paths are unused. Remove these code paths and associated structs members. Clement Leger (2): spi: dw: remove unused dw_spi_chip handling spi: dw: remove cs_control and poll_mode members from chip_data drivers/spi/spi-dw.c | 57 +------------------------------------------- drivers/spi/spi-dw.h | 12 ---------- 2 files changed, 1 insertion(+), 68 deletions(-) -- 2.17.1 commit 858e26a515c28df3ef542d9c09493b54a329d6cf Author: Ashish Kumar Date: Thu Apr 16 17:13:19 2020 +0530 spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size Reduce devm_ioremap size to (4 * AHB_BUFER_SIZE) rather than mapping complete QSPI-Memmory as driver is now independent of flash size. Flash of any size can be accessed. Issue was reported on platform where devm_ioremap failure is observed with size > 256M. Error log on LS1021ATWR : fsl-quadspi 1550000.spi: ioremap failed for resource [mem 0x40000000-0x7fffffff] fsl-quadspi 1550000.spi: Freescale QuadSPI probe failed fsl-quadspi: probe of 1550000.spi failed with error -12 This change was also suggested previously: https://patchwork.kernel.org/patch/10508753/#22166385 Suggested-by: Boris Brezillon Signed-off-by: Kuldeep Singh Signed-off-by: Ashish Kumar Reviewed-by: Boris Brezillon Reviewed-by: Frieder Schrempf Link: https://lore.kernel.org/r/1587037399-18672-1-git-send-email-Ashish.Kumar@nxp.com Signed-off-by: Mark Brown commit b938b25f49cdb47397b0215b69cdd5251b4b2f8b Author: Geert Uytterhoeven Date: Thu Apr 16 12:30:58 2020 +0200 ASoC: Fix misspellings of "Analog Devices" According to https://www.analog.com/, the company name is spelled "Analog Devices". Signed-off-by: Geert Uytterhoeven Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20200416103058.15269-7-geert+renesas@glider.be Signed-off-by: Mark Brown commit a8e7346b7c0a3b33963e5e043e2c612fdf69de34 Author: Raviteja Narayanam Date: Thu Apr 9 11:56:03 2020 +0530 serial: uartps: Use cdns_uart_tx_empty in console_write Instead of accessing the registers and checking for tx_empty, use cdns_uart_tx_empty in cdns_uart_console_write function. Signed-off-by: Raviteja Narayanam Reviewed-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/1586413563-29125-3-git-send-email-raviteja.narayanam@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 Author: Raviteja Narayanam Date: Thu Apr 9 11:56:02 2020 +0530 serial: uartps: Wait for tx_empty in console setup On some platforms, the log is corrupted while console is being registered. It is observed that when set_termios is called, there are still some bytes in the FIFO to be transmitted. So, wait for tx_empty inside cdns_uart_console_setup before calling set_termios. Signed-off-by: Raviteja Narayanam Reviewed-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 8fd31e69f890f691b7c548de20a7ee74955df593 Author: Jiri Slaby Date: Wed Apr 15 11:36:08 2020 +0200 vt: extract selection chars storing from vc_do_selection Let's put it to a separate function, named vc_selection_store_chars. Again, this makes vc_do_selection a bit shorter and more readable. Having 4 local variables instead of 12 (5.6-rc1) looks much better now. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20200415093608.10348-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9ba4ddbc04feac9513d573e02a4360db6f598455 Author: Jiri Slaby Date: Wed Apr 15 11:36:07 2020 +0200 vt: selection, split __set_selection_kernel Handle these actions: * poking console * TIOCL_SELCLEAR * TIOCL_SELMOUSEREPORT * start/end precomputation * clear_selection if the console changed in a separate function, thus making __set_selection_kernel way shorter and more readable. The function still needs dissection, but we are approaching. This includes introduction of vc_selection and renaming __set_selection_kernel to vc_do_selection. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20200415093608.10348-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 30c67b91973cc6a9d4118d53eaf6da059a8d3996 Author: Linus Walleij Date: Wed Apr 15 20:02:50 2020 +0200 serial: sh-sci: Drop unused include The sh-sci.h file includes the legacy header but the driver is actually migrated to use the mctrl_gpio library so this is not needed. Cc: George G. Davis Signed-off-by: Linus Walleij Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200415180250.221762-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit cd9479a16720a6a38b3b614d2adece2413aebefc Author: Colin Ian King Date: Sun Apr 5 14:54:23 2020 +0100 drivers/tty: remove redundant assignment to variable i and rename it to ret The variable i is being assigned a value that is never read and it is being updated later with a new value. The assignment is redundant and can be removed. Also rename i to ret as this new name makes makes more sense. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Jiri Slaby Link: https://lore.kernel.org/r/20200405135423.383466-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 810bc0a5fafb8575b9406fcc8b0be77ff93a7be0 Author: Michael Walle Date: Fri Apr 3 19:49:42 2020 +0200 tty: serial: fsl_lpuart: make coverity happy Coverity reports the following: var_compare_op: Comparing chan to null implies that chan might be null. 1234 if (chan) 1235 dmaengine_terminate_all(chan); 1236 Dereference after null check (FORWARD_NULL) var_deref_op: Dereferencing null pointer chan. 1237 dma_unmap_sg(chan->device->dev, &sport->rx_sgl, 1, DMA_FROM_DEVICE); Technically, this is correct. But lpuart_dma_rx_free() is guarded by lpuart_dma_rx_use which is only true if there is a dma channel, see lpuart_rx_dma_startup(). In any way, this looks bogus. So remove the superfluous "if (chan)" check and make coverity happy. Fixes: a092ab25fdaa ("tty: serial: fsl_lpuart: fix DMA mapping") Signed-off-by: Michael Walle Reported-by: Colin Ian King Acked-by: Jiri Slaby Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20200403174942.9594-1-michael@walle.cc Signed-off-by: Greg Kroah-Hartman commit 5745fd0f950f1ac99c7c680245353a961da3ca14 Author: Linus Walleij Date: Wed Apr 15 20:39:27 2020 +0200 serial: omap: Convert to use GPIO descriptors This converts the OMAP serial driver to use a GPIO descriptor for the optional RTS signal. Cc: Shubhrajyoti D Cc: Tony Lindgren Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200415183927.269445-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9f3745f3719ccd27e0da22a883756e9716fc8cb7 Author: Linus Walleij Date: Wed Apr 15 20:43:00 2020 +0200 serial: lpc32xx_hs: Drop surplus include The driver includes but does not use any symbols from the file so drop this include. Cc: Roland Stigge Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200415184300.269889-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit e9010320f2d953156fdaa65b54ac868d8ad67c16 Author: Jason Yan Date: Thu Apr 2 20:38:37 2020 +0800 usb: cdns3: gadget: make a bunch of functions static Fix the following sparse warning: drivers/usb/cdns3/gadget.c:85:6: warning: symbol 'cdns3_clear_register_bit' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:140:26: warning: symbol 'cdns3_next_align_buf' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:151:22: warning: symbol 'cdns3_next_priv_request' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:193:5: warning: symbol 'cdns3_ring_size' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:348:6: warning: symbol 'cdns3_move_deq_to_next_trb' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:514:20: warning: symbol 'cdns3_wa2_gadget_giveback' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:554:5: warning: symbol 'cdns3_wa2_gadget_ep_queue' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:839:6: warning: symbol 'cdns3_wa1_restore_cycle_bit' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:1907:6: warning: symbol 'cdns3_stream_ep_reconfig' was not declared. Should it be static? drivers/usb/cdns3/gadget.c:1928:6: warning: symbol 'cdns3_configure_dmult' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20200402123837.5850-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 6e24826d2c51a0e005ecf3ed74ea48688fca0306 Author: Linus Walleij Date: Wed Apr 15 21:24:48 2020 +0200 usb: fusb302: Convert to use GPIO descriptors This converts the FUSB302 driver to use GPIO descriptors. The conversion to descriptors per se is pretty straight-forward. In the process I discovered that: 1. The driver uses a completely undocumented device tree binding for the interrupt GPIO line, "fcs,int_n". Ooops. 2. The undocumented binding, presumably since it has not seen review, is just "fcs,int_n", lacking the compulsory "-gpios" suffix and also something that is not a good name because the "_n" implies the line is inverted which is something we handle with flags in the device tree. Ooops. 3. Possibly the driver should not be requesting the line as a GPIO and request the corresponding interrupt line by open coding, the GPIO chip is very likely doubleing as an IRQ controller and can probably provide an interrupt directly for this line with interrupts-extended = <&gpio0 ...>; 4. Possibly the IRQ should just be tagged on the I2C client node in the device tree like apparently ACPI does, as it overrides this IRQ with client->irq if that exists. But now it is too late to do much about that and as I can see this is used like this in the Pinebook which is a shipping product so let'a just contain the mess and move on. The property currently appears in: arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts Create a quirk in the GPIO OF library to allow this property specifically to be specified without the "-gpios" suffix, we have other such bindings already. Cc: Tobias Schramm Cc: Heikki Krogerus Cc: Yueyao Zhu Cc: Guenter Roeck Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20200415192448.305257-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit eed6ed6e7085b8f3e12c372d5111b8cd36c02fa8 Author: Peter Chen Date: Tue Mar 31 16:10:05 2020 +0800 usb: cdns3: change dev_info to dev_dbg for debug message During device mode initialization, lots of device information are printed to console, see below. Change them as debug message. cdns-usb3 5b130000.cdns3: Initialized ep0 support: cdns-usb3 5b130000.cdns3: Initialized ep1out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep2out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep3out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep4out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep5out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep6out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep7out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep1in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep2in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep3in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep4in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep5in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep6in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep7in support: BULK, INT ISO Signed-off-by: Peter Chen Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20200331081005.32752-4-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit 0c7299d68736034ae4f1b166cf16d62a5ae0abb2 Author: Peter Chen Date: Tue Mar 31 16:10:04 2020 +0800 usb: cdns3: change "cdsn3" to"cdns3" And delete cdsn3_hw_role_state_machine declare which doesn't be needed. Signed-off-by: Peter Chen Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20200331081005.32752-3-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit 85820de1b6109ffcfc4c5e9bb27e31f130725223 Author: Peter Chen Date: Tue Mar 31 16:10:03 2020 +0800 usb: cdns3: delete role_override In short, we have three kinds of role switches: - Based on SoC: ID and VBUS - Based on external connnctor, eg, Type-C or GPIO Connector - Based on user choices through sysfs Since HW handling and usb-role-switch handling are at different places, we do not need role_override any more, and this flag could not judge external connector case well. With role_override deleted, We use cdns3_hw_role_switch for the 1st use case, and usb-role-switch for the 2nd and 3rd cases. Signed-off-by: Peter Chen Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20200331081005.32752-2-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit 0f2d776199ec3ae80623fdc5978d5a1ef3accb49 Author: Peter Chen Date: Tue Mar 31 16:10:02 2020 +0800 usb: cdns3: core: get role switch node from firmware After that, the role switch device (eg, Type-C device) could call cdns3_role_set to finish the role switch. Signed-off-by: Peter Chen Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20200331081005.32752-1-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman commit 33e8fd4bfbd7eb0921eb55caceed54e51912a4e6 Author: Clement Leger Date: Thu Apr 16 13:09:16 2020 +0200 spi: dw: remove cs_control and poll_mode members from chip_data Since these members were initialized only with previous dw_spi_chip struct members and that there is no user anymore, remove them. Along this removal, remove code path which were using these members. Signed-off-by: Clement Leger Link: https://lore.kernel.org/r/20200416110916.22633-2-cleger@kalray.eu Signed-off-by: Mark Brown commit ae9e6ac4d8542d1b16fad4bd3c3e447632437623 Author: Clement Leger Date: Thu Apr 16 13:09:15 2020 +0200 spi: dw: remove unused dw_spi_chip handling The path of code using this struct is unused since there is no more user of this. Remove code and struct definition. Signed-off-by: Clement Leger Link: https://lore.kernel.org/r/20200416110916.22633-1-cleger@kalray.eu Signed-off-by: Mark Brown commit 96d7c7b3e6545612c1d37944621fdd611afd6adf Author: Paul Thomas Date: Tue Apr 14 11:28:42 2020 -0400 gpio: gpio-pca953x, Add get_multiple function Implement a get_multiple function for gpio-pca953x. If a driver leaves get_multiple unimplemented then gpio_chip_get_multiple() in gpiolib.c takes care of it by calling chip->get() as needed. For i2c chips this is very inefficient. For example if you do an 8-bit read then instead of a single i2c transaction there are 8 transactions reading the same byte! Signed-off-by: Paul Thomas Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 35c638d039bbabbca7affb52960d468951d811c1 Author: Stephan Gerhold Date: Wed Apr 15 10:11:58 2020 +0200 ASoC: qdsp6: Suggest more generic node names Change the listed examples to use more generic node names, representing the class of the device nodes: - apr-service@ - dai@ Both names are already in use in arch/arm64/boot/dts/qcom/sdm845.dtsi. Also add #address-cells + #size-cells to the q6asm example, without them the example produces dtc warnings. Signed-off-by: Stephan Gerhold Reviewed-by: Srinivas Kandagatla Cc: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200415081159.1098-1-stephan@gerhold.net Signed-off-by: Mark Brown commit 896fa735084e4a9160f8f17d75d2899fb38a6215 Author: Geert Uytterhoeven Date: Thu Apr 16 12:18:35 2020 +0200 spi: spidev_test: Add support for Octal mode data transfers Add support for octal transfers using the -8/--octal command line parameter. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200416101835.14573-3-geert+renesas@glider.be Signed-off-by: Mark Brown commit 66ec7b3bc9c043518da828cd84aefe6242943a97 Author: Geert Uytterhoeven Date: Thu Apr 16 12:18:34 2020 +0200 spi: spidev: Add support for Octal mode data transfers Include the flags for Octal mode data transfers in the mask, so userspace can set them. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200416101835.14573-2-geert+renesas@glider.be Signed-off-by: Mark Brown commit ab455450fe15f84837ea63e73d194dbef1cc00c7 Author: Christophe JAILLET Date: Sat Apr 11 08:38:11 2020 +0200 usb: phy: jz4770: Add a missing '\n' in a log message Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 541368b46b82 ("usb: phy: Add driver for the Ingenic JZ4770 USB transceiver") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200411063811.6767-1-christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit b0d84e452c1b7f592c6162187e3d90f1d06aea73 Author: Nishad Kamdar Date: Sat Mar 28 15:18:32 2020 +0530 USB: dwc2: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to DesignWare USB2 DRD Core Support. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Acked-by: Minas Harutyunyan Link: https://lore.kernel.org/r/20200328094828.GA5016@nishad Signed-off-by: Greg Kroah-Hartman commit 4d49d352b66799802388f7ef6ce75d12440be6fa Author: Nishad Kamdar Date: Sat Apr 4 16:07:31 2020 +0530 USB: mtu3: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to MediaTek USB3 Dual Role controller. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Reviewed-by: Chunfeng Yun Link: https://lore.kernel.org/r/20200404103728.GA6011@nishad Signed-off-by: Greg Kroah-Hartman commit 6814c73fdc46cc5d0ece070af507cb95666b3f6a Author: Nishad Kamdar Date: Sat Apr 4 16:19:55 2020 +0530 USB: musb: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB Dual Role (OTG-ready) Controller Drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200404104952.GA6575@nishad Signed-off-by: Greg Kroah-Hartman commit e90b8e91a10f980d528e7eef69e8045cdba437f8 Author: Nishad Kamdar Date: Sat Apr 4 15:16:43 2020 +0530 USB: misc: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB Miscellaneous drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200404094638.GA5319@nishad Signed-off-by: Greg Kroah-Hartman commit 29e9ead2fe943f0a0e51e16a9cb8e45809491b6a Author: Nishad Kamdar Date: Sat Apr 4 15:08:08 2020 +0530 USB: isp1760: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to ISP1760 USB host controller. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200404093803.GA4983@nishad Signed-off-by: Greg Kroah-Hartman commit 3e45ed3cc14894a4d5114127ebdc62296521f365 Author: Nishad Kamdar Date: Sat Apr 4 14:51:40 2020 +0530 USB: host: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB host controller drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200404092135.GA4522@nishad Signed-off-by: Greg Kroah-Hartman commit 081c95df8992b738fd6462f3a420d8892d7f6d71 Author: Masahiro Yamada Date: Fri Apr 3 22:16:51 2020 +0900 usb: gadget: legacy: fix redundant initialization warnings from cppcheck Fix the following cppcheck warnings: drivers/usb/gadget/legacy/inode.c:1364:8: style: Redundant initialization for 'value'. The initialized value is overwritten$ value = -EOPNOTSUPP; ^ drivers/usb/gadget/legacy/inode.c:1331:15: note: value is initialized int value = -EOPNOTSUPP; ^ drivers/usb/gadget/legacy/inode.c:1364:8: note: value is overwritten value = -EOPNOTSUPP; ^ drivers/usb/gadget/legacy/inode.c:1817:8: style: Redundant initialization for 'value'. The initialized value is overwritten$ value = -EINVAL; ^ drivers/usb/gadget/legacy/inode.c:1787:18: note: value is initialized ssize_t value = len, length = len; ^ drivers/usb/gadget/legacy/inode.c:1817:8: note: value is overwritten value = -EINVAL; ^ Reported-by: kbuild test robot Signed-off-by: Masahiro Yamada Acked-by: Alan Stern Link: https://lore.kernel.org/r/20200403131652.8183-1-masahiroy@kernel.org Signed-off-by: Greg Kroah-Hartman commit 48ce9e4119ce24131d188746118e948e9e97fc1d Author: Madhuparna Bhowmik Date: Sat Apr 4 23:11:02 2020 +0530 usb: host: u132-hcd: Remove u132_static_list and list head u132_list u132_static_list is a global list protected by u132_module_lock. It is read in the u132_hcd_exit() function without holding the lock thus may lead to data race. However, it turns out that this list isn't used for anything useful and thus it is okay to get rid of it. Thus, remove the u132_static_list from u132-hcd module. Also remove struct list_head u132_list from struct u132. Found by Linux Driver Verification project (linuxtesting.org). Suggested-by: Alan Stern Signed-off-by: Madhuparna Bhowmik Link: https://lore.kernel.org/r/20200404174102.19862-1-madhuparnabhowmik10@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec47c6449a4e9840a14ca964cdab3c2185947fe4 Author: Nishad Kamdar Date: Sat Mar 28 16:14:30 2020 +0530 USB: early: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header file related to early USB devices. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200328104426.GA6401@nishad Signed-off-by: Greg Kroah-Hartman commit e6075b6689506d3c388bd72888df9f42a51ed6d8 Author: Nishad Kamdar Date: Sat Mar 28 14:48:50 2020 +0530 USB: core: Use the correct style for SPDX License Identifier This patch corrects the SPDX License Identifier style in header files related to USB Core. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches Signed-off-by: Nishad Kamdar Link: https://lore.kernel.org/r/20200328091844.GA3648@nishad Signed-off-by: Greg Kroah-Hartman commit aa5ab36aeda54853944b4c666348cd6592b0024b Author: Tang Bin Date: Mon Apr 6 13:55:30 2020 +0800 usb: host: ehci-tegra: Remove superfluous dev_err() message The platform_get_irq() can print error message,so remove the redundant dev_err() here. Signed-off-by: Tang Bin Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20200406055530.10860-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman commit b4203ce0556348dcfe29f897d1dbe65102874d89 Author: Nicolas Pitre Date: Wed Apr 15 16:30:01 2020 -0400 i3c master: GETMRL's 3rd byte is optional even with BCR_IBI_PAYLOAD According to the I3C spec v1.1 document, GETMRL's payload is 2 bytes, with an optional 3rd byte if the IBI private payload is larger than 1 byte. The whole GETMRL may also be optional so max_ibi_len already defaults to 1 if BCR_IBI_PAYLOAD prior to the i3c_master_getmrl_locked() call. Signed-off-by: Nicolas Pitre Signed-off-by: Boris Brezillon Link: https://lore.kernel.org/linux-i3c/nycvar.YSQ.7.76.2004151623060.2671@knanqh.ubzr commit 0f04a81784fe3ddc00cae74c517265b3ddb8825c Author: Andy Shevchenko Date: Tue Apr 7 20:38:49 2020 +0300 pinctrl: mcp23s08: Split to three parts: core, I²C, SPI Split the driver to three parts: core, I²C, SPI. No functional change intended. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-9-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 7b04aaaf660be525bf0df892a198a24ad66ac93d Author: Andy Shevchenko Date: Tue Apr 7 20:38:48 2020 +0300 pinctrl: mcp23s08: Use for_each_set_bit() and hweight_long() Here is a simplification of SPI code by using for_each_set_bit() and hweight_long() library functions. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-8-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 1ac30db20be2da288131a865b94c772512e9ad47 Author: Andy Shevchenko Date: Tue Apr 7 20:38:47 2020 +0300 pinctrl: mcp23s08: Make use of device properties Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-7-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 88af89b52a1b7493f1e5ec165856b4c6767cf654 Author: Andy Shevchenko Date: Tue Apr 7 20:38:46 2020 +0300 pinctrl: mcp23s08: Propagate error code from device_property_read_u32() Return error code from device_property_read_u32() as is in mcp23s08_probe(). While here, drop status variable in mcp23s08_irq_set_type() which always 0. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-6-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0874758ecb2b3faa200a86dda45dbc29335f883e Author: Andy Shevchenko Date: Tue Apr 7 20:38:45 2020 +0300 pinctrl: mcp23s08: Refactor mcp23s08_spi_regmap_init() There is a lot of duplication for one small helper function. Refactor mcp23s08_spi_regmap_init() to prepare everything first and then register regmap at the end. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-5-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0521701c8d10f832a401cc7ebfa92bb73782d792 Author: Andy Shevchenko Date: Tue Apr 7 20:38:44 2020 +0300 pinctrl: mcp23s08: Drop unused parameter in mcp23s08_probe_one() The cs parameter in mcp23s08_probe_one() is never used. Drop it for good. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-4-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit d3da29b628a86777d25c741c44b8af35f10020a0 Author: Andy Shevchenko Date: Tue Apr 7 20:38:43 2020 +0300 pinctrl: mcp23s08: Consolidate SPI and I²C code There are three parts of each, SPI and I²C, driver spread over the code under ifdeffery. Consolidate them so it will be only one for SPI and one for I²C. The code has been cosmetically changed to avoid intrusive change. Clean up is considered in the nearest future. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 84d02e785d34be9363a825d696cca1f07fac2634 Author: Andy Shevchenko Date: Tue Apr 7 20:38:42 2020 +0300 pinctrl: mcp23s08: Deduplicate IRQ chip filling In both cases, SPI and I²C, IRQ chip is filled in the same way. Deduplicate this by moving common part to mcp23s08_probe_one(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 6aba6ed879b3471903c8ada28ba968a268df6143 Author: Andy Shevchenko Date: Tue Apr 7 20:38:41 2020 +0300 pinctrl: mcp23s08: Get rid of legacy platform data Platform data is a legacy interface to supply device properties to the driver. In this case we even don't have in-kernel users for it. Just remove it for good. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200407173849.43628-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit f9a8744dde48f368768b3a6de389b7ec2751d192 Author: Anson Huang Date: Fri Mar 27 18:55:58 2020 +0800 pinctrl: imx: Add imx8dxl driver i.MX8DXL contains a system controller that is responsible for controlling the pad setting of the IPs that are present. Communication between the host processor running an OS and the system controller happens through a SCU protocol, add support for the SCU based i.MX8DXL pinctrl driver. Signed-off-by: Anson Huang Link: https://lore.kernel.org/r/1585306559-13973-2-git-send-email-Anson.Huang@nxp.com Signed-off-by: Linus Walleij commit 087905f925c93131611d78526fb40e90cd7e7731 Author: Anson Huang Date: Fri Mar 27 18:55:57 2020 +0800 dt-bindings: arm: fsl-scu: Add imx8dxl pinctrl support Update binding doc to support i.MX8DXL pinctrl. Signed-off-by: Anson Huang Acked-by: Rob Herring Link: https://lore.kernel.org/r/1585306559-13973-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Linus Walleij commit cef622d7634e0adc351d795f089e7b77700272ca Merge: 2b703bbda271 8cdf72711928 Author: Joonas Lahtinen Date: Thu Apr 16 14:36:38 2020 +0300 Merge tag 'topic/phy-compliance-2020-04-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-intel-next-queued Topic pull request for topic/phy-compliance: - Standardize DP_PHY_TEST_PATTERN name. - Add support for setting/getting test pattern from sink. - Implement DP PHY compliance to i915. From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/efb3d0d9-2cf7-046b-3a9b-2548d086258e@linux.intel.com Signed-off-by: Joonas Lahtinen commit 13e3d94110d82e318d640d0980896d32e02ba4d6 Author: Andrzej Pietrasiewicz Date: Wed Apr 15 19:20:24 2020 +0200 drm: Don't free a struct never allocated by drm_gem_fb_init() drm_gem_fb_init() is passed the fb and never allocates it, so it should be not the one freeing it. As it is now the second call to kfree() is possible with the same fb. Coverity reported the following: *** CID 1492613: Memory - corruptions (USE_AFTER_FREE) /drivers/gpu/drm/drm_gem_framebuffer_helper.c: 230 in drm_gem_fb_create_with_funcs() 224 fb = kzalloc(sizeof(*fb), GFP_KERNEL); 225 if (!fb) 226 return ERR_PTR(-ENOMEM); 227 228 ret = drm_gem_fb_init_with_funcs(dev, fb, file, mode_cmd, funcs); 229 if (ret) { vvv CID 1492613: Memory - corruptions (USE_AFTER_FREE) vvv Calling "kfree" frees pointer "fb" which has already been freed. [Note: The source code implementation of the function has been overridden by a user model.] 230 kfree(fb); 231 return ERR_PTR(ret); 232 } 233 234 return fb; 235 } drm_gem_fb_init_with_funcs() calls drm_gem_fb_init() drm_gem_fb_init() calls kfree(fb) Reported-by: coverity-bot Addresses-Coverity-ID: 1492613 ("Memory - corruptions") Fixes: f2b816d78a94 ("drm/core: Allow drivers allocate a subclass of struct drm_framebuffer") Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200415172024.24004-1-andrzej.p@collabora.com commit 710c451fbcb24959c575a96dff28bcf48c819fe2 Author: Michael Straube Date: Mon Apr 13 19:59:57 2020 +0200 staging: rtl8188eu: make const char array static Make const char array 'fw_name' static. Clears a checkpatch warning and reduces object file size by 17 bytes (gcc 9.3.1 x86_64). WARNING: const array should probably be static const Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200413175957.30165-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 05a72b5616724cf4dd2b4582884da44e036a30fc Author: Michael Straube Date: Mon Apr 13 19:59:56 2020 +0200 staging: rtl8188eu: cleanup long line in fw.c Add line break to avoid line length over 80 characters. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200413175957.30165-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8349fa213e13ff5b7b10349155c646ef770efc6b Author: Michael Straube Date: Mon Apr 13 19:59:55 2020 +0200 staging: rtl8188eu: rename define to upper case Rename 'FWDL_ChkSum_rpt' to 'FWDL_CHKSUM_RPT' as defines are normaly named all upper case. Also clears a camel case checkpatch warning. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200413175957.30165-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7f3115fbfea18d20d3421a192be510cbccbaf9f6 Author: Colin Ian King Date: Tue Apr 14 15:35:02 2020 +0100 staging: vt6656: remove redundant assignment to variable ed_inx The variable ed_inx is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200414143502.237803-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit 5a78455625a345933ed35dd3370fe5b85d44ed11 Author: Oscar Carter Date: Tue Apr 14 17:38:49 2020 +0200 staging: vt6656: Remove duplicate code for the phy->service assignment Take out the "phy->service" assignment from the if-else statement due to it's the same for the two branches. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200414153849.5785-6-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 8a29fb1fcf4e2466632924c9496e5030c1a8c4bc Author: Oscar Carter Date: Tue Apr 14 17:38:48 2020 +0200 staging: vt6656: Refactor the assignment of the phy->signal variable Create a constant array with the values of the "phy->signal" for every rate. Remove all "phy->signal" assignments inside the switch statement and replace these with a single reading from the new vnt_phy_signal array. The constant array can be of one dimension because the OR mask with BIT(3) or BIT(4) allow obtain a second value according to the rate, the preamble_type and the pkt_type. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200414153849.5785-5-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 8b0eb26ad5f3c717e0b2cf58e7ffd9eb9ba165e6 Author: Oscar Carter Date: Tue Apr 14 17:38:47 2020 +0200 staging: vt6656: Use define instead of magic number for tx_rate Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200414153849.5785-4-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 91fdbcd909293f491f9773fef5b39605126cbf94 Author: Oscar Carter Date: Tue Apr 14 17:38:46 2020 +0200 staging: vt6656: Use BIT() macro instead of bit shift operator Use the BIT() macro instead of the bit left shift operator. So the code is more clear. It's safe to remove the casting to u16 type because the value obtained never exceeds 16 bits. So the casting is unnecessary. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200414153849.5785-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 2b703bbda2713fd2a7d98029ea6c44f9c3159f34 Merge: 3ffaf56e912e 8f3d9f354286 Author: Joonas Lahtinen Date: Thu Apr 16 14:35:16 2020 +0300 Merge drm/drm-next into drm-intel-next-queued Backmerging in order to pull "topic/phy-compliance". Signed-off-by: Joonas Lahtinen commit 10415533a9062c9e5e27c421d9c232f0cae108fd Author: Will Deacon Date: Wed Jan 22 19:36:29 2020 +0000 gcov: Remove old GCC 3.4 support The kernel requires at least GCC 4.8 in order to build, and so there is no need to cater for the pre-4.7 gcov format. Remove the obsolete code. Acked-by: Peter Oberparleiter Reviewed-by: Nick Desaulniers Signed-off-by: Will Deacon commit 10223c5286f7389c022e9e91f12c49918790cf36 Author: Will Deacon Date: Thu Dec 19 17:11:43 2019 +0000 arm64: barrier: Use '__unqual_scalar_typeof' for acquire/release macros Passing volatile-qualified pointers to the arm64 implementations of the load-acquire/store-release macros results in a re-load from the stack and a bunch of associated stack-protector churn due to the temporary result variable inheriting the volatile semantics thanks to the use of 'typeof()'. Define these temporary variables using 'unqual_scalar_typeof' to drop the volatile qualifier in the case that they are scalar types. Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Arnd Bergmann Acked-by: Mark Rutland Signed-off-by: Will Deacon commit 549887271a961a79375b2a55bf675515b9107778 Author: Will Deacon Date: Thu Dec 19 16:22:56 2019 +0000 locking/barriers: Use '__unqual_scalar_typeof' for load-acquire macros Passing volatile-qualified pointers to the asm-generic implementations of the load-acquire macros results in a re-load from the stack due to the temporary result variable inheriting the volatile semantics thanks to the use of 'typeof()'. Define these temporary variables using 'unqual_scalar_typeof' to drop the volatile qualifier in the case that they are scalar types. Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Arnd Bergmann Signed-off-by: Will Deacon commit dee081bf8f824cabeb7c7495367d5dad0a444eb1 Author: Will Deacon Date: Thu Dec 19 14:22:31 2019 +0000 READ_ONCE: Drop pointer qualifiers when reading from scalar types Passing a volatile-qualified pointer to READ_ONCE() is an absolute trainwreck for code generation: the use of 'typeof()' to define a temporary variable inside the macro means that the final evaluation in macro scope ends up forcing a read back from the stack. When stack protector is enabled (the default for arm64, at least), this causes the compiler to vomit up all sorts of junk. Unfortunately, dropping pointer qualifiers inside the macro poses quite a challenge, especially since the pointed-to type is permitted to be an aggregate, and this is relied upon by mm/ code accessing things like 'pmd_t'. Based on numerous hacks and discussions on the mailing list, this is the best I've managed to come up with. Introduce '__unqual_scalar_typeof()' which takes an expression and, if the expression is an optionally qualified 8, 16, 32 or 64-bit scalar type, evaluates to the unqualified type. Other input types, including aggregates, remain unchanged. Hopefully READ_ONCE() on volatile aggregate pointers isn't something we do on a fast-path. Cc: Peter Zijlstra Cc: Arnd Bergmann Suggested-by: Linus Torvalds Reported-by: Michael Ellerman Signed-off-by: Will Deacon commit 9e343b467c70379e66b8b771d96f03ae23eba351 Author: Will Deacon Date: Fri Dec 13 14:47:02 2019 +0000 READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses {READ,WRITE}_ONCE() cannot guarantee atomicity for arbitrary data sizes. This can be surprising to callers that might incorrectly be expecting atomicity for accesses to aggregate structures, although there are other callers where tearing is actually permissable (e.g. if they are using something akin to sequence locking to protect the access). Linus sayeth: | We could also look at being stricter for the normal READ/WRITE_ONCE(), | and require that they are | | (a) regular integer types | | (b) fit in an atomic word | | We actually did (b) for a while, until we noticed that we do it on | loff_t's etc and relaxed the rules. But maybe we could have a | "non-atomic" version of READ/WRITE_ONCE() that is used for the | questionable cases? The slight snag is that we also have to support 64-bit accesses on 32-bit architectures, as these appear to be widespread and tend to work out ok if either the architecture supports atomic 64-bit accesses (x86, armv7) or if the variable being accesses represents a virtual address and therefore only requires 32-bit atomicity in practice. Take a step in that direction by introducing a variant of 'compiletime_assert_atomic_type()' and use it to check the pointer argument to {READ,WRITE}_ONCE(). Expose __{READ,WRITE}_ONCE() variants which are allowed to tear and convert the one broken caller over to the new macros. Suggested-by: Linus Torvalds Cc: Peter Zijlstra Cc: Michael Ellerman Cc: Arnd Bergmann Signed-off-by: Will Deacon commit a5460b5e5fb82656807840d40d3deaecad094044 Author: Will Deacon Date: Mon Dec 16 16:51:45 2019 +0000 READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE() The implementations of {READ,WRITE}_ONCE() suffer from a significant amount of indirection and complexity due to a historic GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 which was originally worked around by 230fa253df63 ("kernel: Provide READ_ONCE and ASSIGN_ONCE"). Since GCC 4.8 is fairly vintage at this point and we emit a warning if we detect it during the build, return {READ,WRITE}_ONCE() to their former glory with an implementation that is easier to understand and, crucially, more amenable to optimisation. A side effect of this simplification is that WRITE_ONCE() no longer returns a value, but nobody seems to be relying on that and the new behaviour is aligned with smp_store_release(). Suggested-by: Linus Torvalds Cc: Peter Zijlstra Cc: Michael Ellerman Cc: Arnd Bergmann Cc: Christian Borntraeger Signed-off-by: Will Deacon commit ce7107697986edff2bd7e8d0c0990d3109b5a009 Author: Rob Herring Date: Thu Apr 9 16:20:14 2020 -0600 ARM: versatile: Drop mapping IB2 module registers As of commit 153969fd952d ("ARM: versatile: Drop CLCD platform data"), the IB2 module is not accessed in the platform code, so let's remove mapping it. Cc: Linus Walleij Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20200409222014.31828-1-robh@kernel.org Signed-off-by: Linus Walleij commit db1e113578193c9f8d308cf1edfc1cb050984268 Author: Rob Herring Date: Thu Apr 9 16:19:52 2020 -0600 ARM: versatile: Remove dead sched_clock code Now that there's a DT based sched_clock driver in drivers/clocksource/timer-versatile.c and all the Arm reference platforms are DT only, the non-DT versatile sched_clock code can be removed. Cc: Linus Walleij Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20200409221952.31287-1-robh@kernel.org Signed-off-by: Linus Walleij commit 65fd41e6fa2ee0905b06379d1ef1ff52b3f27156 Author: Geert Uytterhoeven Date: Tue Jan 21 11:37:20 2020 +0100 ARM: realview: Drop unneeded select of multi-platform features Support for ARM Ltd. RealView systems depends on ARCH_MULTIPLATFORM, which selects USE_OF. Support for ARMv6 and ARMv7 variants depends on ARCH_MULTI_V6 or ARCH_MULTI_V7, which both select ARCH_MULTI_V6_V7 and thus MIGHT_HAVE_CACHE_L2X0. Support for ARMv7 variants depends on ARCH_MULTI_V7, which selects HAVE_SMP. Hence there is no need for the affected RealView-specific symbols to select any of them. Signed-off-by: Geert Uytterhoeven Cc: Linus Walleij Signed-off-by: Linus Walleij commit ba637aa019e038a518236bb56afcdb86ebfd269c Author: Geert Uytterhoeven Date: Tue Jan 21 11:37:13 2020 +0100 ARM: integrator: Drop unneeded select of SPARSE_IRQ Support for ARM Ltd. Integrator systems depends on ARCH_MULTIPLATFORM. As the latter selects SPARSE_IRQ, there is no need for ARCH_INTEGRATOR to select SPARSE_IRQ. Signed-off-by: Geert Uytterhoeven Cc: Linus Walleij Signed-off-by: Linus Walleij commit f823cce279368162a161852de189d654a1e61b72 Author: Oscar Carter Date: Tue Apr 14 17:38:45 2020 +0200 staging: vt6656: Return error code in vnt_rf_write_embedded function Use the error code returned by the vnt_control_out function as the returned value of the vnt_rf_write_embedded function instead of a boolean value. Then, fix all vnt_rf_write_embedded calls removing the "and" operations and replace with a direct assignment to the ret variable and add a check condition after every call. Also replace the boolean values true or false in the vnt_rf_set_txpower function to 0 or error code EINVAL to follow the coding style guide. The vnt_rf_set_txpower function is called only in the vnt_rf_setpower function that already returns error codes. The calls to this function (vnt_rf_set_txpower) not use the returned values, so they not need to be fixed. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200414153849.5785-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 4a585df3682c54460b1b4b96734d4abc7b816dc7 Author: R Veera Kumar Date: Mon Apr 13 22:29:05 2020 +0530 staging: vc04_services: bcm2835-audio: Make function arguments alignment match open parenthesis Make function arguments alignment match open parenthesis. Found using checkpatch.pl. Signed-off-by: R Veera Kumar Reviewed-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200413165905.6081-1-vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit 2596313a9ff924179c842364ebcc4debf54e5f1a Author: R Veera Kumar Date: Mon Apr 13 21:37:53 2020 +0530 staging: sm750fb: Make function arguments alignment match open parenthesis Make function arguments alignment match open parenthesis. Found using checkpatch.pl. Signed-off-by: R Veera Kumar Link: https://lore.kernel.org/r/20200413160753.3787-1-vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit 3e63dbd42503a4827d989e3405e587469c89159b Author: Michael Straube Date: Mon Apr 13 23:51:09 2020 +0200 staging: rtl8712: correct spelling mistake in comment Correct a spelling mistake discovered by checkpatch. attatch -> attach Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200413215109.15749-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8220be592d82637e3f7ac269eb9d33a247e942b6 Author: Sergio Paracuellos Date: Mon Apr 13 17:50:18 2020 +0200 staging: mt7621-pci: initialize 'n' variable when it is declared Variable 'n' in 'mt7621_pcie_init_virtual_bridges' function can be directly initialized when it is declared instead of doing it before using it first. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200413155018.31921-3-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit cddc585ec92c074025d2d76bc0f6ec120e44fe8a Author: Sergio Paracuellos Date: Mon Apr 13 17:50:17 2020 +0200 staging: mt7621-pci: add clarification comment in 'mt7621_pcie_init_virtual_bridges' Add a comment explaining a bit what is going on in this function. It would be helfulp for other people for a better understanding of the code. Suggested-by: NeilBrown Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200413155018.31921-2-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 535bd126d65364b51d9bdeccf584979b7ff1ded3 Author: Sergio Paracuellos Date: Mon Apr 13 17:50:16 2020 +0200 staging: mt7621-pci: rename 'PCIE_P2P_MAX' into 'PCIE_P2P_CNT' Definition 'PCIE_P2P_MAX' is '3'. The value here is not a MAXimum. It is a count or a number. It is how many masks there are. The masks are numbered 0, 1, 2 so the maximum is 2. Hence rename variable into 'PCIE_P2P_CNT' which is a more accurate name. Suggested-by: NeilBrown Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200413155018.31921-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4ddf14470bd7c552cbc017e7788491ded6bd8bff Author: Jérôme Pouiller Date: Wed Apr 15 18:11:47 2020 +0200 staging: wfx: update TODO Update the TODO list associated to the wfx driver with the last progresses and last remarks made by reviewers. The items about support for P2P and mesh have also been removed. Indeed, it seems that the device does not fully support them. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-21-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit c801351a9d4587aab131d018330d4b35a0b3cdcf Author: Jérôme Pouiller Date: Wed Apr 15 18:11:46 2020 +0200 staging: wfx: drop useless attribute 'filter_mcast' Currently, wfx_update_filtering() apply the value of wvif->filter_mcast to the hardware. But an attentive reader will note that wfx_update_filtering() is always called after set wvif->filter_mcast. Thus, it not necessary to store filter_mcast in the struct wfx_vif. We can just pass it as parameter. Also rename wfx_update_filtering() in wfx_filter_mcast() to reflect this change. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b15973f30852dee46d80ccd2363ece80b2c0317d Author: Jérôme Pouiller Date: Wed Apr 15 18:11:45 2020 +0200 staging: wfx: drop useless filter update when starting AP mac80211 explicitly call wfx_configure_filters() before/after starting AP. Thus, it is not necessary to call wfx_update_filtering() from wfx_start_ap(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 2c69b2da37824307b4c73cbf7ad98ae82a6a52fe Author: Jérôme Pouiller Date: Wed Apr 15 18:11:44 2020 +0200 staging: wfx: split out wfx_filter_beacon() Currently, wfx_update_filtering() is sometime called only to apply the value of wvif->filter_beacon to the hardware. It is nicer to have a specific function for beacon filtering. In add, an attentive reader would note that wfx_update_filtering() is always called after change of wvif->filter_beacon. Thus, it not necessary to store filter_beacon in the struct wfx_vif. We can just pass it as parameter. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a558395d4ce328d39772ffd88422aaad5d572449 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:43 2020 +0200 staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid' It is now useless to store filter_prbreq and filter_bssid in struct wfx_vif. We can just pass them as parameters to hif_set_rx_filter(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f41224bd47fe2f6a36bf2ba579ed5f677e288ffa Author: Jérôme Pouiller Date: Wed Apr 15 18:11:42 2020 +0200 staging: wfx: drop useless call to hif_set_rx_filter() hif_set_rx_filter() apply changes on filter_prbreq and filter_bssid to the hardware. Each time filter_prbreq and filter_bssid are changed, hif_set_rx_filter() is called. Currently, on extra call to hif_set_rx_filter() is made from wfx_update_filtering(). This call is useless. Drop it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 981132aa039d90456abf2bed7a2f6472c9dc3f98 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:41 2020 +0200 staging: wfx: drop struct wfx_grp_addr_table The struct wfx_grp_addr_table is only instantiated on one place. There is no justifiation for this struct. Moreover, it is not consistent with other fields related to filtering (filter_bssid, etc...). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6273691fbd50534982e864ccce482f8da6f2afac Author: Jérôme Pouiller Date: Wed Apr 15 18:11:40 2020 +0200 staging: wfx: align semantic of probe request filter with other filters Filters provided by HIF API are sometime inclusive, sometime exclusive. This patch align the behavior and name of the probe request filter with the other filters. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b07357e02749b0858adf0314ff67abf5d523f03a Author: Jérôme Pouiller Date: Wed Apr 15 18:11:39 2020 +0200 staging: wfx: align semantic of beacon filter with other filters Filters provided by HIF API are sometime inclusive, sometime exclusive. This patch align the behavior and name of the beacon filter with the other filters. Also avoid double negation: "disable filter" Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 824f830fc0943e91bbce44799e76dc50e1fbdad2 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:38 2020 +0200 staging: wfx: drop useless wfx_fwd_probe_req() wfx_fwd_probe_req() is a function of two lines called from only one place. In order to uniformize all filtering functions, drop wfx_fwd_probe_req(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ed4a707d2643de1afb938095558e3e61f6c3badd Author: Jérôme Pouiller Date: Wed Apr 15 18:11:37 2020 +0200 staging: wfx: ensure that probe requests are filtered when AP Device is able to automatically reply to probe request (therefore, the probe requests are not forwarded to host). This feature is enabled by wfx_start_ap(). However, further calls to wfx_configure_filter() can disable it. So, relocate the handling of probe request filtering in wfx_configure_filter(). Note that wfx_configure_filter() is always called by mac80211 when an AP start. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 0f55a72e7e38b7fc2a7366f3e9dfd5e8d55e5232 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:36 2020 +0200 staging: wfx: stop changing filtering rule in wfx_hw_scan() It is not very clear why driver ask to firmware to stop filtering probe request during scan. It is particularly weird because scan is not supported in AP mode. In add, it does not restore previous filtering state after scanning. It seems to be a mistake and should be dropped. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 349e540a3d09ccd8ee1367bed09958899bfd9ff1 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:35 2020 +0200 staging: wfx: do not use built-in AUTO_ERP feature Firmware is able to detect detect changes about ERP protection in beacons and automatically enable/disable ERP protection. However, it not bring performance improvements and we are more confident in the ERP handling of mac80211. So, the patch disable this feature. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit eb52d63a6dbded02375fa094dacec9c4503b8b72 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:34 2020 +0200 staging: wfx: disabling beacon filtering after hif_reset() is useless After hif_reset(), device stop to receive any RF data. So, it is useless to disable beacon filtering. In add, if necessary, mac80211 will call wfx_configure_filter(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 1ab6bf4c56bb5f3ecea4453d40a7f4e882a7fbb7 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:33 2020 +0200 staging: wfx: do not wait for a dtim before associate The only reason we ask to mac80211 to wait for a dtim before to associate is to get an accurate DTIM value. However, we can temporary set the dtim period to 1. Then we can waiting for BSS_CHANGED_BEACON_INFO for the real value. Thus, the association process is faster. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b3919d9bbcde6c27f2072dd4242c54e076bb17b7 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:32 2020 +0200 staging: wfx: wfx_update_filtering_work() is no more used Since we had simplified the join process, update_filtering_work is no more used. Drop it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit e269060e79ed834c5519a037facc5944ea52f739 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:31 2020 +0200 staging: wfx: simplify handling of beacon filter during join process When the device joins an AP, beacon are forwarded to the host. Once has retrieved all necessary parameters, we can start to filter the beacon (and only beacon with changed/new data will be forwarded). Currently, the driver detect beacons in data Rx process. It is far more easier to just wait for the BSS_CHANGED_BEACON_INFO event. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b460713a5a2927998729fd22d9c649bcc9f1a9de Author: Jérôme Pouiller Date: Wed Apr 15 18:11:30 2020 +0200 staging: wfx: rework wfx_configure_filter() wfx_configure_filter() lacks of coherency. In add, some corner cases seems to not been handled properly. Rework the whole function(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit e86bc725ba5f96ec687f30c924c9d82eea095968 Author: Jérôme Pouiller Date: Wed Apr 15 18:11:29 2020 +0200 staging: wfx: simplify wfx_update_filtering() Inline wfx_set_mcast_filter() into wfx_update_filtering() and remove useless intermediate variables. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 427fd02e168179f87ed3fd3f022d08a78cc51e3b Author: Jérôme Pouiller Date: Wed Apr 15 18:11:28 2020 +0200 staging: wfx: update filtering even if not connected Currently, filtering are not update if the device is not connected. There is no obvious rationale for that. Updating filtering while it is not necessary is harmless. On the other hand, it is difficult to ensure that the filtering rule has been correctly sent to the firmware. Just drop this useless condition. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6dde0ae30a9a883778154f8377ed50a2c7752211 Author: Martin Blumenstingl Date: Tue Apr 14 21:50:31 2020 +0200 clk: meson: g12a: Prepare the GPU clock tree to change at runtime The "mali_0" or "mali_1" clock trees should not be updated while the clock is running. Enforce this by setting CLK_SET_RATE_GATE on the "mali_0" and "mali_1" gates. This makes the CCF switch to the "mali_1" tree when "mali_0" is currently active and vice versa, which is exactly what the vendor driver does when updating the frequency of the mali clock. Also propagate set_rate requests from the gate to the divider and from the divider to the the mux so the GPU clock frequency can be updated at runtime (which will be required for GPU DVFS). Don't propagate rate changes to the mux parents because we don't want to change the MPLL clocks (these are reserved for audio). Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20200414195031.224021-3-martin.blumenstingl@googlemail.com commit 5c2602e5fcefa5a581ce20521552d7d446a3a9aa Author: Martin Blumenstingl Date: Tue Apr 14 21:50:30 2020 +0200 clk: meson: gxbb: Prepare the GPU clock tree to change at runtime The "mali_0" or "mali_1" clock trees should not be updated while the clock is running. Enforce this by setting CLK_SET_RATE_GATE on the "mali_0" and "mali_1" gates. This makes the CCF switch to the "mali_1" tree when "mali_0" is currently active and vice versa, which is exactly what the vendor driver does when updating the frequency of the mali clock. Also propagate set_rate requests from the gate to the divider and from the divider to the the mux so the GPU clock frequency can be updated at runtime (which will be required for GPU DVFS). Don't propagate rate changes to the mux parents because we don't want to change the MPLL clocks (these are reserved for audio). Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20200414195031.224021-2-martin.blumenstingl@googlemail.com commit 3ffaf56e912e76cf09c560244c8804f9bebda8b1 Author: Oliver Barta Date: Sat Mar 28 11:41:00 2020 +0100 drm/i915: HDCP: fix Ri prime check done during link check The check was always succeeding even in case of a mismatch due to the HDCP_STATUS_ENC bit being set. Make sure both bits are actually set. Signed-off-by: Oliver Barta Fixes: 2320175feb74 ("drm/i915: Implement HDCP for HDMI") Reviewed-by: Ramalingam C Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200328104100.12162-1-oliver.barta@aptiv.com commit 7edc9079540b65026f3d3386b3642d1820d5fed5 Author: Marcel Holtmann Date: Wed Apr 15 17:35:16 2020 +0200 Bluetooth: Enhanced Connection Complete event belongs to LL Privacy The Enhanced Connection Complete event is use in conjunction with LL Privacy and not Extended Advertising. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit da90417467b4035146e8ba534ee7f49ceffb6251 Author: Stanislav Lisovskiy Date: Tue Apr 7 14:55:46 2020 -0700 drm/i915: Add YUV444 packed format support for skl+ PLANE_CTL_FORMAT_AYUV is already supported, according to hardware specification. Reviewed-by: Ville Syrjälä Reviewed-by: Matt Roper Signed-off-by: Stanislav Lisovskiy Signed-off-by: Bob Paauwe Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200407215546.5445-2-bob.j.paauwe@intel.com commit dacca5f0fa69f04c2e70aad9847e8250b459971c Author: Hans Verkuil Date: Thu Apr 16 10:25:59 2020 +0200 media: media/test_drivers: rename to test-drivers We never use _ in directory names in the media subsystem, so rename to test-drivers instead for consistency. Also update MAINTAINERS with the new path. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 143f8adfd534baf7db9ab662c50d41f74d1c7e21 Author: Hans Verkuil Date: Thu Apr 16 10:26:25 2020 +0200 media: Documentation/media: drop/fix vivi references The vivi.c driver has long gone, but v4l2-videobuf.rst still refers to it. Just drop that reference since it is no longer valid or relevant (videobuf is deprecated). The QUERYCAP documentation also made a reference to is, but there vivi could just be replaced by vivid, the vivi successor. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cbb5494ebce5dfafab27de01e7e8bfe6d7c6a27f Author: Nicholas Johnson Date: Tue Apr 14 02:04:25 2020 +0800 Revert "thunderbolt: Prevent crash if non-active NVMem file is read" This reverts commit 03cd45d2e219301880cabc357e3cf478a500080f. Commit 664f0549380c ("nvmem: core: use is_bin_visible for permissions") incidentally adds support for write-only nvmem. Hence, this workaround is no longer required, so drop it. Signed-off-by: Nicholas Johnson Signed-off-by: Mika Westerberg commit 016baa59bf9f6c2550480b73f18100285e3a4fd2 Author: Ezequiel Garcia Date: Wed Apr 15 00:06:24 2020 +0200 media: Kconfig: Don't expose the Request API option The Request API isn't meant to be chosen by users, but instead should be selected by drivers that want to support it. Hantro and Cedrus are already selecting the right options, so only the test drivers need to be fixed. Signed-off-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab commit 9cbb04551a85b6b222b0cec9c3d9d1b2a69e55ed Author: Mauro Carvalho Chehab Date: Wed Apr 15 15:39:39 2020 +0200 media: radio: don't use a menu just for wl128x driver It doesn't make any sense to have a submenu just for this driver. Drop it. Signed-off-by: Mauro Carvalho Chehab commit 5c57ae64e8bccc693a96b4bbd9b20cc5890aeb69 Author: Mauro Carvalho Chehab Date: Wed Apr 15 15:39:38 2020 +0200 media: i2c/Kconfig: use sub-menus for I2C support There are *lots* of I2C ancillary drivers. While we're using comments to group them, all options appear at the same menu. It should be a lot clearer to group them into sub-menus, with may help people to go directly to the driver(s) he's needing to enable. Suggested-by: Hans Verkuil Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 39eb3cc8ab8a5cb7b0a2b728cb653e58319449e9 Author: Corentin Labbe Date: Thu Apr 2 09:08:52 2020 +0000 pinctrl: sunxi: handle probe defferal When checking the logs on my sun8i-a33-olinuxino I saw: sun8i-a23-r-pinctrl 1f02c00.pinctrl: Reset controller missing but this driver was working after. This message is just here because the reset controller was still not probed. So don't say anything if the return code say to wait. Signed-off-by: Corentin Labbe Link: https://lore.kernel.org/r/1585818532-23051-1-git-send-email-clabbe@baylibre.com Acked-by: Maxime Ripard Signed-off-by: Linus Walleij commit 9c95f7c2836c19cd243fb55f17643e6757e11405 Author: Light Hsieh Date: Wed Apr 8 04:08:17 2020 +0800 pinctrl: mediatek: make MediaTek MT6765 pinctrl ready for buiding loadable module This patch make pinctrl-mt6765 ready for building as loadable module. Signed-off-by: Sean Wang Signed-off-by: Light Hsieh Link: https://lore.kernel.org/r/42100afe6f97d28447c153bea6b54ea556cf95ca.1586289920.git.sean.wang@mediatek.com Signed-off-by: Linus Walleij commit 8174a8512e3e5acbf9e2202b24934b7f7fd28e13 Author: Light Hsieh Date: Wed Apr 8 04:08:16 2020 +0800 pinctrl: mediatek: make MediaTek pinctrl v2 driver ready for buidling loadable module In the future we want to be able to build the MediaTek pinctrl driver, based on paris, as kernel module. This patch allows pinctrl-paris.c, the external interrupt controller mtk-eint.c, and pinctrl-mtk-common-v2.c to be loadable as module. Signed-off-by: Sean Wang Signed-off-by: Light Hsieh Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/9feeb04805e5a406fe22a92e3f280abda39ddda4.1586289920.git.sean.wang@mediatek.com Signed-off-by: Linus Walleij commit 7e23ab72e73bc601b4cf2983382691d9f165c8d1 Author: Ding Xiang Date: Mon Mar 30 15:56:26 2020 +0800 pinctrl: nomadik:remove unneeded variable ret is unneeded, just return 0. Signed-off-by: Ding Xiang Link: https://lore.kernel.org/r/1585554986-26521-1-git-send-email-dingxiang@cmss.chinamobile.com Signed-off-by: Linus Walleij commit 04fd1ca77918a2395d0dc73c9a68436fdfaa26de Author: Hans de Goede Date: Wed Mar 25 11:39:56 2020 +0100 gpiolib: acpi: Add missing __init(const) markers to initcall-s The gpiolib ACPI code uses 2 initcall-s and the called function (and used DMI table) is missing __init(const) markers. This commit fixes this freeing up some extra memory once the kernel has completed booting. Acked-by: Mika Westerberg Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20200325103956.109284-2-hdegoede@redhat.com Signed-off-by: Linus Walleij commit 0a8f5989e03476cfb2a7756e33fa4d0163cb4375 Author: Christophe JAILLET Date: Sat Apr 11 14:06:33 2020 +0200 crypto: marvell/octeontx - Add missing '\n' in log messages Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. While at it, I've introduced a few pr_cont that looked logical to me. Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT") Fixes: d9110b0b01ff ("crypto: marvell - add support for OCTEON TX CPT engine") Signed-off-by: Christophe JAILLET Signed-off-by: Herbert Xu commit 6603523bf5e432c7c8490fb500793bb15d4e5f61 Author: Herbert Xu Date: Fri Apr 10 16:09:42 2020 +1000 crypto: api - Fix use-after-free and race in crypto_spawn_alg There are two problems in crypto_spawn_alg. First of all it may return spawn->alg even if spawn->dead is set. This results in a double-free as detected by syzbot. Secondly the setting of the DYING flag is racy because we hold the read-lock instead of the write-lock. We should instead call crypto_shoot_alg in a safe manner by gaining a refcount, dropping the lock, and then releasing the refcount. This patch fixes both problems. Reported-by: syzbot+fc0674cde00b66844470@syzkaller.appspotmail.com Fixes: 4f87ee118d16 ("crypto: api - Do not zap spawn->alg") Fixes: 73669cc55646 ("crypto: api - Fix race condition in...") Cc: Signed-off-by: Herbert Xu commit eebac678556d6927f09a992872f4464cf3aecc76 Author: Arnd Bergmann Date: Wed Apr 8 18:26:48 2020 +0200 crypto: ccp -- don't "select" CONFIG_DMADEVICES DMADEVICES is the top-level option for the slave DMA subsystem, and should not be selected by device drivers, as this can cause circular dependencies such as: drivers/net/ethernet/freescale/Kconfig:6:error: recursive dependency detected! drivers/net/ethernet/freescale/Kconfig:6: symbol NET_VENDOR_FREESCALE depends on PPC_BESTCOMM drivers/dma/bestcomm/Kconfig:6: symbol PPC_BESTCOMM depends on DMADEVICES drivers/dma/Kconfig:6: symbol DMADEVICES is selected by CRYPTO_DEV_SP_CCP drivers/crypto/ccp/Kconfig:10: symbol CRYPTO_DEV_SP_CCP depends on CRYPTO crypto/Kconfig:16: symbol CRYPTO is selected by LIBCRC32C lib/Kconfig:222: symbol LIBCRC32C is selected by LIQUIDIO drivers/net/ethernet/cavium/Kconfig:65: symbol LIQUIDIO depends on PTP_1588_CLOCK drivers/ptp/Kconfig:8: symbol PTP_1588_CLOCK is implied by FEC drivers/net/ethernet/freescale/Kconfig:23: symbol FEC depends on NET_VENDOR_FREESCALE The LIQUIDIO driver causing this problem is addressed in a separate patch, but this change is needed to prevent it from happening again. Using "depends on DMADEVICES" is what we do for all other implementations of slave DMA controllers as well. Fixes: b3c2fee5d66b ("crypto: ccp - Ensure all dependencies are specified") Signed-off-by: Arnd Bergmann Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit beeb460cd12ac9b91640b484b6a52dcba9d9fc8f Author: Eric Biggers Date: Mon Apr 6 23:02:40 2020 -0700 crypto: algapi - Avoid spurious modprobe on LOADED Currently after any algorithm is registered and tested, there's an unnecessary request_module("cryptomgr") even if it's already loaded. Also, CRYPTO_MSG_ALG_LOADED is sent twice, and thus if the algorithm is "crct10dif", lib/crc-t10dif.c replaces the tfm twice rather than once. This occurs because CRYPTO_MSG_ALG_LOADED is sent using crypto_probing_notify(), which tries to load "cryptomgr" if the notification is not handled (NOTIFY_DONE). This doesn't make sense because "cryptomgr" doesn't handle this notification. Fix this by using crypto_notify() instead of crypto_probing_notify(). Fixes: dd8b083f9a5e ("crypto: api - Introduce notifier for new crypto algorithms") Cc: # v4.20+ Cc: Martin K. Petersen Signed-off-by: Eric Biggers Reviewed-by: Martin K. Petersen Signed-off-by: Herbert Xu commit 56b80bdee4a16cf330562801667a1e62fe7b9255 Author: Markus Elfring Date: Sat Apr 4 17:34:53 2020 +0200 crypto: sun8i-ss - Delete an error message in sun8i_ss_probe() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit f72fed86a5ac80445c7723d3fc782325a23bc7db Author: Markus Elfring Date: Sat Apr 4 17:07:34 2020 +0200 hwrng: xgene - Delete an error message in xgene_rng_probe() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Herbert Xu commit b111418a226f20d3e0b00dbe40bbc4e20b9c2ab5 Author: Markus Elfring Date: Sat Apr 4 16:45:57 2020 +0200 hwrng: omap - Delete an error message in of_get_omap_rng_device_details() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Herbert Xu commit 56e0b6273ec8791ffe1c3cdc5d32fe5d001fd520 Author: Tang Bin Date: Sat Apr 4 06:07:54 2020 +0800 crypto: amlogic - Delete duplicate dev_err in meson_crypto_probe() When something goes wrong, platform_get_irq() will print an error message, so in order to avoid the situation of repeat output,we should remove dev_err here. Signed-off-by: Tang Bin Signed-off-by: Herbert Xu commit f037fc5f93f4e3c973f8c3b7ebd6ccd123f0944b Author: Yang Shen Date: Fri Apr 3 16:16:42 2020 +0800 crypto: hisilicon/qm - stop qp by judging sq and cq tail It is not working well to determine whether the queue is empty based on whether the used count is 0. It is more stable to get if the queue is stopping by checking if the tail pointer of the send queue and the completion queue are equal. Signed-off-by: Yang Shen Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 141876c252a461818c39d45ca30ef1cb7c71953a Author: Yang Shen Date: Fri Apr 3 16:16:41 2020 +0800 crypto: hisilicon/sec2 - add controller reset support for SEC2 Add support for controller reset in SEC driver. Signed-off-by: Yang Shen Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 1f5c9f34f0cc78e058088090b9d2abca45690e6b Author: Hui Tang Date: Fri Apr 3 16:16:40 2020 +0800 crypto: hisilicon/hpre - add controller reset support for HPRE Add support for the controller reset in HPRE driver. Signed-off-by: Hui Tang Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 84c9b7802b02a0b13de1db262122e0c59f4abd77 Author: Shukun Tan Date: Fri Apr 3 16:16:39 2020 +0800 crypto: hisilicon/zip - add controller reset support for zip Register controller reset handle with PCIe AER. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 6c6dd5802c2d6769fa589c0e8de54299def199a7 Author: Shukun Tan Date: Fri Apr 3 16:16:38 2020 +0800 crypto: hisilicon/qm - add controller reset interface Add the main implementation of the controller reset interface, which is roughly divided into three parts, stop, reset, and reinitialization. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 35ee280fb1fb97ffa32a19953457becb4f45579b Author: Hao Fang Date: Thu Apr 2 14:53:03 2020 +0800 crypto: hisilicon - add vfs_num module parameter for hpre/sec The vfs_num module parameter has been used in zip driver, this patch adds this for HPRE and SEC driver. Signed-off-by: Hao Fang Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit cd1b7ae3435cc428579615241adeee36d217320c Author: Shukun Tan Date: Thu Apr 2 14:53:02 2020 +0800 crypto: hisilicon - unify SR-IOV related codes into QM Clean the duplicate SR-IOV related codes, put all into qm.c. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 619e464ae22a17e6a060527c8591ccf78eb368ba Author: Shukun Tan Date: Thu Apr 2 14:53:01 2020 +0800 crypto: hisilicon - put vfs_num into struct hisi_qm We plan to move vfs_num related code into qm.c, put the param vfs_num into struct hisi_qm first. Signed-off-by: Shukun Tan Reviewed-by: Zhou Wang Reviewed-by: Zaibo Xu Signed-off-by: Herbert Xu commit 3c8e0bd105037c4451adb4594fcfa33aef58d286 Author: Hadar Gat Date: Fri Mar 27 09:10:23 2020 +0300 MAINTAINERS: add HG as cctrng maintainer I work for Arm on maintaining the TrustZone CryptoCell TRNG driver. Signed-off-by: Hadar Gat Signed-off-by: Herbert Xu commit a583ed310bb6b514e717c11a30b5a7bc3a65d1b1 Author: Hadar Gat Date: Fri Mar 27 09:10:22 2020 +0300 hwrng: cctrng - introduce Arm CryptoCell driver Introduce low level Arm CryptoCell TRNG HW support. Signed-off-by: Hadar Gat Signed-off-by: Herbert Xu commit ffb57daad3a345a90543ffa1bb5e03f76b6453fb Author: Hadar Gat Date: Fri Mar 27 09:10:21 2020 +0300 dt-bindings: add device tree binding for Arm CryptoCell trng engine The Arm CryptoCell is a hardware security engine. This patch adds DT bindings for its TRNG (True Random Number Generator) engine. Signed-off-by: Hadar Gat Reviewed-by: Rob Herring Signed-off-by: Herbert Xu commit 217a5879e10a381d06311702f8bbb9060d3c4b89 Merge: 72161e0eea64 a1687c68c308 Author: Mark Brown Date: Thu Apr 16 00:23:22 2020 +0100 Merge series "ASoC: SOF: topology and firmware IPC updates for 5.8" from Pierre-Louis Bossart : Long series made of a relatively small changes from multiple SOF contributors. I didn't find a good way to split this series since it tracks SOF minor ABI changes (backwards-compatible with older firmware files) and needs to be kept in-order. Future series should be much shorter. The main addition is support for an extended firmware manifest, which helps retrieve capabilities directly from the firmware file instead of the current IPC mechanism (still supported but will be deprecated). The IPC is realigned with the firmware, along with type cleanups, and the DMIC interface is simplified. The topology changes are mainly about a multi-cpu DAI fix, a new DC blocking component, better parsing of tuples and new parameters for ALH (SoundWire) and HDaudio DAIs. New tokens are also added to clarify the firmware behavior in the case of dependent pipelines, e.g. for echo reference generation. Artur Kloniecki (1): ASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer. Bard Liao (5): ASoC: SOF: topology: fix: handle DAI widget connections properly with multiple CPU DAI's ASoC: SOF: align sof_ipc_dai_alh_params with FW ASoC: SOF: topology: Get ALH rate amd channels from topology ASoC: SOF: topology: fix: parse hda_tokens to &config->hda ASoC: SOF: topology: Get HDA rate and channels from topology Jaska Uimonen (2): ASoC: SOF: topology: stop parsing when all tokens have been found ASoC: SOF: topology: handle multiple sets of tuple arrays Karol Trzcinski (6): ASoC: SOF: Mark get_ext* function ext_hdr arguments as const ASoC: SOF: Introduce offset in firmware data ASoC: SOF: Introduce extended manifest ASoC: SOF: ext_manifest: parse firmware version ASoC: SOF: ext_manifest: parse windows ASoC: SOF: ext_manifest: parse compiler version Pan Xiuli (6): ASoC: SOF: add probe support extend data ASoC: SOF: add debug ABI version ASoC: SOF: change type char to uint8_t in info.h ASoC: SOF: change type char to uint8_t in trace.h ASoC: SOF: change type char to uint8_t in topology.h ASoC: SOF: make sof_ipc_cc_version to fixed length Sebastiano Carlucci (1): ASoC: SOF: topology: Add support for DC Blocker Seppo Ingalsuo (3): ASoC: SOF: Intel: Fix typo in header file comment text ASoC: SOF: Intel: Change DMIC load IPC to fixed length ASoC: SOF: Intel: Rename deprecated DMIC IPC struct field include/sound/sof.h | 3 + include/sound/sof/dai-intel.h | 20 +- include/sound/sof/info.h | 26 ++- include/sound/sof/topology.h | 16 +- include/sound/sof/trace.h | 2 +- include/uapi/sound/sof/abi.h | 2 +- include/uapi/sound/sof/ext_manifest.h | 91 ++++++++ include/uapi/sound/sof/tokens.h | 8 + sound/soc/sof/intel/hda-loader.c | 9 +- sound/soc/sof/loader.c | 226 ++++++++++++++++-- sound/soc/sof/topology.c | 323 ++++++++++++++++---------- 11 files changed, 568 insertions(+), 158 deletions(-) create mode 100644 include/uapi/sound/sof/ext_manifest.h base-commit: 83b35f4586e235bfb785a7947b555ad8f3d96887 -- 2.20.1 commit 72161e0eea64bb2b5a7a834ed5a76425aac4cdd1 Merge: 980f91778a2f 35a0f2425205 Author: Mark Brown Date: Thu Apr 16 00:23:20 2020 +0100 Merge series "Add support for SOF on i.MX8M" from Daniel Baluta Daniel Baluta : From: Daniel Baluta This patch series adds support for SOF on i.MX8M family. First board from this family that has a DSP is i.MX8MP. First 2 patches are trying to fix some compilation issues, the next two are adding the imx8m support and the last one adds the devicetree binding. Changes since v2: - add reviewed by from Rob to DT patch - fix ownership for patch 2 Daniel Baluta (3): ASoC: SOF: imx: Add i.MX8M HW support ASoC: SOF: Add i.MX8MP device descriptor dt-bindings: dsp: fsl: Add fsl,imx8mp-dsp entry Pierre-Louis Bossart (1): ASoC: SOF: imx: fix undefined reference issue YueHaibing (1): ASoC: SOF: imx8: Fix randbuild error .../devicetree/bindings/dsp/fsl,dsp.yaml | 2 + sound/soc/sof/imx/Kconfig | 32 +- sound/soc/sof/imx/Makefile | 2 + sound/soc/sof/imx/imx8m.c | 279 ++++++++++++++++++ sound/soc/sof/sof-of-dev.c | 14 + 5 files changed, 325 insertions(+), 4 deletions(-) create mode 100644 sound/soc/sof/imx/imx8m.c -- 2.17.1 commit a1687c68c3089ed746c18f2121c8e63e2cf22c00 Author: Jaska Uimonen Date: Wed Apr 15 15:28:16 2020 -0500 ASoC: SOF: topology: handle multiple sets of tuple arrays Widget's parameters are set in topology and they usually consist of several different types of tuple arrays like strings, words and bytes. Here this kind of combination is called a "set". Lately we've seen more complex widget definitions with multiple identical sets of tuple arrays. One example is the dmic pdm configuration, which is currently handled as a special case in token parsing. This is not scalable for other components with multiple sets. So add a new function sof_parse_token_sets, which can be used to parse multiple sets. This function defines the number of sets and an offset to copy the tokens to correct positions in the destination ipc struct. Old sof_parse_token function will be a special case of calling sof_parse_token_sets to parse 1 set with offset 0. Finally modify the dmic dai link loading to use the new sof_parse_array_sets to load multiple pdm configs. Signed-off-by: Jaska Uimonen Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-25-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f228a5b1703871632adb0918774386409cef05c5 Author: Jaska Uimonen Date: Wed Apr 15 15:28:15 2020 -0500 ASoC: SOF: topology: stop parsing when all tokens have been found Optimize the parsing so that it will stop after all required tokens have been found as there is no reason to continue after that. Signed-off-by: Jaska Uimonen Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-24-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 18aaab64fbb121e5879f74a46903bcfd30bf660b Author: Bard Liao Date: Wed Apr 15 15:28:14 2020 -0500 ASoC: SOF: topology: Get HDA rate and channels from topology FW interface for HDA DAI parameters was extended with information on sampling rate and channel count in version 3.16. Align kernel header with the FW change. This change is backwards compatible. Old firmware will ignore the values. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-23-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 15bf1831fc91a447e336ef252b48d5f9cad8a3f2 Author: Bard Liao Date: Wed Apr 15 15:28:13 2020 -0500 ASoC: SOF: topology: fix: parse hda_tokens to &config->hda Items in hda_tokens are for &config->hda. So fix it to the right object. This error has been harmless as hda_tokens array was empty. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-22-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c7fc96dfc41d168e94d26c455123193e6e59bf24 Author: Bard Liao Date: Wed Apr 15 15:28:12 2020 -0500 ASoC: SOF: topology: Get ALH rate amd channels from topology FW will need these params for synchronized playback over multiple DAIs. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Sławomir Błauciak Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-21-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1f846505b3651ac385762b794868922e2be83d42 Author: Bard Liao Date: Wed Apr 15 15:28:11 2020 -0500 ASoC: SOF: align sof_ipc_dai_alh_params with FW Aligned with FW change. The rate and channel values are needed in case of a connection with a demux for synchronize playback over multiple ALH DAIs. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Sławomir Błauciak Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-20-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1993ba26cc53a98aa67c451d735249e221ddd39d Author: Seppo Ingalsuo Date: Wed Apr 15 15:28:10 2020 -0500 ASoC: SOF: Intel: Rename deprecated DMIC IPC struct field This patch restores the field name to fifo_bits_b since the legacy firmware compatibility code (for firmware ABI 3.0.0 or earlier) sets it in sof_link_dmic_load() function in topology.c. Setting of reserved_2 didn't look appropriate. Signed-off-by: Seppo Ingalsuo Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-19-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 31be5337ace110b6c9a567c05b661fd8168ef8cc Author: Seppo Ingalsuo Date: Wed Apr 15 15:28:09 2020 -0500 ASoC: SOF: Intel: Change DMIC load IPC to fixed length This patch changes the flexible array member pdm[] into a fixed array of four that is the max. number of stereo PDM controllers in the current Intel platforms. The change simplifies DMIC DAI load code and aligns the IPC with other DAI types. The change is compatible with old and new firmware with similar change. The ABI minor version is increased due to change in IPC headers. Signed-off-by: Seppo Ingalsuo Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 79a4ff94a3fcb76d9650341336f4779f6d48d325 Author: Seppo Ingalsuo Date: Wed Apr 15 15:28:08 2020 -0500 ASoC: SOF: Intel: Fix typo in header file comment text This patch fixes the typo in word "microphone". Signed-off-by: Seppo Ingalsuo Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7893df67e9bde8e4f0ede579ff874d438af620d8 Author: Artur Kloniecki Date: Wed Apr 15 15:28:07 2020 -0500 ASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer. Currently if a component source buffer underruns or a component sink buffer overruns the pipeline will enter an XRUN status and attempt recovery. This is desired in most pipelines but some topologies need to support use cases where we expect buffers to underrun or overrun. Host ---> Proc----> Selector0 --> Buf0 ---- > DAI Playback | v Buf1 | v Host <---------------Selector1 <----- Buf2 <----- Echo Ref DAI In the example above we two host PCMs that can be independently started/stopped thereby causing buf1 to either underrun or overrun (and stop the pipelines). Buf1 should be permitted to underrun or overrun without invoking pipeline XRUN logic and should over write oldest data (for overrun) and readback 0s (for underrun). 2 flags have been added for use during buffer instantiation: SOF_BUF_OVERRUN_PERMITTED and SOF_BUF_UNDERRUN_PERMITTED, along with struct sof_ipc_buffer member fields: flags and reserved. Flags field is supposed to hold the above-mentioned flags to allow some control over XRUN behaviour. Also added reserved field to the structure in case it comes in handy some time in the future. This is an incremental ABI change as the new fields are ignored by older versions of the firmware. Signed-off-by: Artur Kloniecki Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a9a9cbf081414de0261279e3b11ada2f0a7f7e83 Author: Pan Xiuli Date: Wed Apr 15 15:28:06 2020 -0500 ASoC: SOF: make sof_ipc_cc_version to fixed length Align struct sof_ipc_cc_version to firmware definition in SOF ABI 3.15.0. The struct definition was changed due to errors in FW build. The Cadence XCC compiler produces incorrect linkage section sizes, when a variable length array is used in the compiler version struct. The firmware definition was changed to a fixed 32 byte compiler description string. This length covers all released firmware binaries and thus only a minor ABI change is needed. As the same structure is used in IPC messages between driver and firmware, the kernel needs to be aligned to firmware change. Signed-off-by: Pan Xiuli Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 60829341aa602b74f5f5b9d903e0b809557a54a4 Author: Pan Xiuli Date: Wed Apr 15 15:28:05 2020 -0500 ASoC: SOF: change type char to uint8_t in topology.h Use uint8_t to replace char in packed ABI structs to have fixed length for struct. Signed-off-by: Pan Xiuli Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f480f804f27a3decd03682b707453963bb8b4162 Author: Pan Xiuli Date: Wed Apr 15 15:28:04 2020 -0500 ASoC: SOF: change type char to uint8_t in trace.h Use uint8_t to replace char in packed ABI structs to have fixed length for struct. Signed-off-by: Pan Xiuli Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e6224484454da920874db9ad30ea9b493f5600bd Author: Pan Xiuli Date: Wed Apr 15 15:28:03 2020 -0500 ASoC: SOF: change type char to uint8_t in info.h Use uint8_t to replace char in packed ABI structs to have fixed length for struct. Signed-off-by: Pan Xiuli Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 2014185eba4e061db038a59a6e1d85e88291edc6 Author: Pan Xiuli Date: Wed Apr 15 15:28:02 2020 -0500 ASoC: SOF: add debug ABI version Add new debug ABI version to be increased when changing user space debug interfaces while the the main FW ABI is not affected. The abi_dbg_version share same definition with SOF_ABI_VER This change main ABI to 3.14.0 Signed-off-by: Pan Xiuli Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 786d6516877dc852392117d44a77bf3093c39dbd Author: Pan Xiuli Date: Wed Apr 15 15:28:01 2020 -0500 ASoC: SOF: add probe support extend data Share how many injection probe DMAs and how many probe points driver can request from FW. injection_dmas_max 0 means injection is not supported probe_points_max 0 means whole probes subsystem in FW is not enabled and not compiled in. ABI version change to 3.14.0 Signed-off-by: Pan Xiuli Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 542adb2a461fb63711b96b1179f070b4fa79cc37 Author: Sebastiano Carlucci Date: Wed Apr 15 15:28:00 2020 -0500 ASoC: SOF: topology: Add support for DC Blocker This commit adds the enumerations to support the dc blocker component from SOF. Signed-off-by: Sebastiano Carlucci Signed-off-by: Pierre-Louis Bossart Reviewed-by: Curtis Malainey Reviewed-by: Seppo Ingalsuo Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7c024b948c206935e69aafa56187bff9dd36abed Author: Karol Trzcinski Date: Wed Apr 15 15:27:59 2020 -0500 ASoC: SOF: ext_manifest: parse compiler version The compiler version and description can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9e72f13ee541ccae34dd4a6735bcdf0c78090216 Author: Karol Trzcinski Date: Wed Apr 15 15:27:58 2020 -0500 ASoC: SOF: ext_manifest: parse windows The window description can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 371091417864b7be870eaad45e043059e6b6828a Author: Karol Trzcinski Date: Wed Apr 15 15:27:57 2020 -0500 ASoC: SOF: ext_manifest: parse firmware version The firmware version can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e150ef4169a766aa20003506c0f25b5519981e80 Author: Karol Trzcinski Date: Wed Apr 15 15:27:56 2020 -0500 ASoC: SOF: Introduce extended manifest Extended manifest is a place to store build time known firmware metadata, for example firmware version or used compiler description. Given information is read on host side before firmware startup. This part of output binary is located as a first structure in binary file. Extended manifest should be skipped in firmware loading routine. Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 92be17a559a8872b655512b1cf9d0bc407bace33 Author: Karol Trzcinski Date: Wed Apr 15 15:27:55 2020 -0500 ASoC: SOF: Introduce offset in firmware data It makes possible to provide extra information to host before downloading firmware. Extra data should be put at the beginning of firmware binary. Exchange is done without any effort on DSP side. This mechanism will be used in extended manifest. Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0730c0928d8941327f38dd72e53f9bdb0cc29e00 Author: Karol Trzcinski Date: Wed Apr 15 15:27:54 2020 -0500 ASoC: SOF: Mark get_ext* function ext_hdr arguments as const This pointer can be mark as const to indicate that it is read only pointer. Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200415202816.934-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 101001652ee7231bb02a8aa75d25fadb1c078c2c Author: Bard Liao Date: Wed Apr 15 15:27:53 2020 -0500 ASoC: SOF: topology: fix: handle DAI widget connections properly with multiple CPU DAI's Currently, when connecting a DAI widget to the BE CPU DAI, we overwrite the previous connections. This worked because we only ever had 1 CPU DAI for each rtd until now. But with multiple CPU DAI's, a new connection between a BE CPU DAI and the DAI widget should be established without affecting the previous connections. So, modify the loop to set the playback/capture widget for the first BE CPU DAI that does not have a connection established previously. Fixes: 4a7e26a4d833 ("ASoC: SOF: topology: connect dai widget to all cpu-dais") Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20200415202816.934-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a080bd994c4023042a2b605c65fa10a25933f636 Author: Chris Wilson Date: Wed Apr 15 18:03:18 2020 +0100 drm/i915/gt: Update PMINTRMSK holding fw If we use a non-forcewaked write to PMINTRMSK, it does not take effect until much later, if at all, causing a loss of RPS interrupts and no GPU reclocking, leaving the GPU running at the wrong frequency for long periods of time. Reported-by: Francisco Jerez Suggested-by: Francisco Jerez Fixes: 35cc7f32c298 ("drm/i915/gt: Use non-forcewake writes for RPS") Signed-off-by: Chris Wilson Cc: Francisco Jerez Cc: Mika Kuoppala Cc: Andi Shyti Reviewed-by: Mika Kuoppala Reviewed-by: Andi Shyti Reviewed-by: Francisco Jerez Cc: # v5.6+ Link: https://patchwork.freedesktop.org/patch/msgid/20200415170318.16771-2-chris@chris-wilson.co.uk commit 46495adc6ca74bb5903b3064b32afe96830a38e8 Author: Chris Wilson Date: Wed Apr 15 18:03:17 2020 +0100 drm/i915/selftests: Exercise basic RPS interrupt generation Since we depend upon RPS generating interrupts after evaluation intervals to determine when to up/down clock the GPU, it is imperative that we successfully enable interrupt generation! Verify that we do see an interrupt if we keep the GPU busy for an entire EI. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200415170318.16771-1-chris@chris-wilson.co.uk commit 2a040f0d08c3811f33b9880f5c0d84cb66e8fd74 Author: Matt Roper Date: Tue Apr 14 14:11:18 2020 -0700 drm/i915/tgl: Initialize multicast register steering for workarounds Even though the bspec is missing gen12 register details for the MCR selector register (0xFDC), this is confirmed by hardware folks to be a mistake; the register does exist and we do indeed need to steer multicast register reads to an appropriate instance the same as we did on gen11. Note that despite the lack of documentation we were still using the MCR selector to read INSTDONE and such in read_subslice_reg() too. Cc: Matt Atwood Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200414211118.2787489-4-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza commit 802101528bce1065fdefb31ad7ca9480297831e7 Author: Matt Roper Date: Tue Apr 14 14:11:16 2020 -0700 drm/i915/tgl: Extend Wa_1409767108:tgl to B0 stepping Cc: Matt Atwood Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200414211118.2787489-2-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza commit 35a0f242520520dfa1e8eaf66f20d297b12e413e Author: Daniel Baluta Date: Thu Apr 9 10:18:32 2020 +0300 dt-bindings: dsp: fsl: Add fsl,imx8mp-dsp entry Minimal implementation needs the same DT properties as existing compatible strings. So, we just add the new compatible string in the list. Signed-off-by: Daniel Baluta Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200409071832.2039-6-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 58825cc2253986ec3a4d0d67b8b4dc30945afb52 Author: Daniel Baluta Date: Thu Apr 9 10:18:31 2020 +0300 ASoC: SOF: Add i.MX8MP device descriptor Add SOF device and DT descriptor for i.MX8MP platform. Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20200409071832.2039-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit dbff5a8db9c630f61a892ab41a283445e01270f5 Author: Matt Roper Date: Tue Apr 14 14:11:17 2020 -0700 drm/i915/tgl: Add Wa_14010477008:tgl Media decompression support should not be advertised on any display planes for steppings A0-C0. Bspec: 53273 Fixes: 2dfbf9d2873a ("drm/i915/tgl: Gen-12 display can decompress surfaces compressed by the media engine") Cc: Matt Atwood Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200414211118.2787489-3-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza commit afb93d716533ddef20fc70e626f7b43f204cb411 Author: Daniel Baluta Date: Thu Apr 9 10:18:30 2020 +0300 ASoC: SOF: imx: Add i.MX8M HW support This adds skeleton support for the audio DSP hardware found on NXP i.MX8M platform. There is one notable difference between i.MX8M and i.MX8, which doesn't allow us to reuse HW support from imx8.c file designed for i.MX8: On i.MX8M resources (clocks, power, pinctrl, etc) are managed by the Linux kernel while on i.MX8 resources are managed by a separate System Controller Firmware. This makes the interface to those resources completely different. Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20200409071832.2039-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit cb0312f61c3e95c71ec8955a94d42bf7eb5ba617 Author: Pierre-Louis Bossart Date: Thu Apr 9 10:18:29 2020 +0300 ASoC: SOF: imx: fix undefined reference issue make.cross ARCH=mips allyesconfig fails with the following error: sound/soc/sof/sof-of-dev.o:(.data.sof_of_imx8qxp_desc+0x40): undefined reference to `sof_imx8x_ops'. This seems to be a Makefile order issue, solve by using the same structure as for Intel platforms. Fixes: f9ad75468453 ("ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency") Signed-off-by: Pierre-Louis Bossart Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20200409071832.2039-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit fe17e6cdc0fefca96ba9659be4b2b07487cbf0c5 Author: YueHaibing Date: Thu Apr 9 10:18:28 2020 +0300 ASoC: SOF: imx8: Fix randbuild error when do randconfig like this: CONFIG_SND_SOC_SOF_IMX8_SUPPORT=y CONFIG_SND_SOC_SOF_IMX8=y CONFIG_SND_SOC_SOF_OF=y CONFIG_IMX_DSP=m CONFIG_IMX_SCU=y there is a link error: sound/soc/sof/imx/imx8.o: In function 'imx8_send_msg': imx8.c:(.text+0x380): undefined reference to 'imx_dsp_ring_doorbell' Select IMX_DSP in SND_SOC_SOF_IMX8_SUPPORT to fix this Fixes: f9ad75468453 ("ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency") Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20200409071832.2039-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 433e3aa37773e8a36858b9417c3e345eff79a079 Author: Ondrej Mosnacek Date: Wed Apr 8 11:08:08 2020 +0200 selinux: drop unnecessary smp_load_acquire() call In commit 66f8e2f03c02 ("selinux: sidtab reverse lookup hash table") the corresponding load is moved under the spin lock, so there is no race possible and we can read the count directly. The smp_store_release() is still needed to avoid racing with the lock-free readers. Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit c6a771d932332568df9f46a3b53507c578e8c8e8 Author: Will Deacon Date: Tue Apr 14 22:22:47 2020 +0100 arm64: csum: Disable KASAN for do_csum() do_csum() over-reads the source buffer and therefore abuses READ_ONCE_NOCHECK() to avoid tripping up KASAN. In preparation for READ_ONCE_NOCHECK() becoming a macro, and therefore losing its '__no_sanitize_address' annotation, just annotate do_csum() explicitly and fall back to normal loads. Cc: Mark Rutland Cc: Robin Murphy Signed-off-by: Will Deacon commit 9b4fb5cec031f81ef436bf2cfd9fc265e25f6e45 Author: Will Deacon Date: Thu Dec 19 17:40:21 2019 +0000 fault_inject: Don't rely on "return value" from WRITE_ONCE() It's a bit weird that WRITE_ONCE() evaluates to the value it stores and it's different to smp_store_release(), which can't be used this way. In preparation for preventing this in WRITE_ONCE(), change the fault injection code to use a local variable instead. Cc: Akinobu Mita Signed-off-by: Will Deacon commit 9a8939490d401fefddf53cd5e4cb3e20a52b98a7 Author: Will Deacon Date: Tue Apr 14 23:13:50 2020 +0100 net: tls: Avoid assigning 'const' pointer to non-const pointer tls_build_proto() uses WRITE_ONCE() to assign a 'const' pointer to a 'non-const' pointer. Cleanups to the implementation of WRITE_ONCE() mean that this will give rise to a compiler warning, just like a plain old assignment would do: | net/tls/tls_main.c: In function ‘tls_build_proto’: | ./include/linux/compiler.h:229:30: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] | net/tls/tls_main.c:640:4: note: in expansion of macro ‘smp_store_release’ | 640 | smp_store_release(&saved_tcpv6_prot, prot); | | ^~~~~~~~~~~~~~~~~ Drop the const qualifier from the local 'prot' variable, as it isn't needed. Cc: Boris Pismenny Cc: Aviad Yehezkel Cc: John Fastabend Cc: Daniel Borkmann Signed-off-by: Will Deacon commit 514cc55b01eb7f34f9d1d4518f81e42a633c784e Author: Will Deacon Date: Tue Dec 17 14:20:25 2019 +0000 netfilter: Avoid assigning 'const' pointer to non-const pointer nf_remove_net_hook() uses WRITE_ONCE() to assign a 'const' pointer to a 'non-const' pointer. Cleanups to the implementation of WRITE_ONCE() mean that this will give rise to a compiler warning, just like a plain old assignment would do: | In file included from ./include/linux/export.h:43, | from ./include/linux/linkage.h:7, | from ./include/linux/kernel.h:8, | from net/netfilter/core.c:9: | net/netfilter/core.c: In function ‘nf_remove_net_hook’: | ./include/linux/compiler.h:216:30: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] | *(volatile typeof(x) *)&(x) = (val); \ | ^ | net/netfilter/core.c:379:3: note: in expansion of macro ‘WRITE_ONCE’ | WRITE_ONCE(orig_ops[i], &dummy_ops); | ^~~~~~~~~~ Follow the pattern used elsewhere in this file and add a cast to 'void *' to squash the warning. Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: "David S. Miller" Reviewed-by: Nick Desaulniers Signed-off-by: Will Deacon commit 5429ef62bcf360aae06740cbe065be01e5cfb6fc Author: Will Deacon Date: Wed Jan 22 19:38:21 2020 +0000 compiler/gcc: Raise minimum GCC version for kernel builds to 4.8 It is very rare to see versions of GCC prior to 4.8 being used to build the mainline kernel. These old compilers are also know to have codegen issues which can lead to silent miscompilation: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 Raise the minimum GCC version for kernel build to 4.8 and remove some tautological Kconfig dependencies as a consequence. Cc: Masahiro Yamada Acked-by: Arnd Bergmann Reviewed-by: Nick Desaulniers Signed-off-by: Will Deacon commit f96198abe8b0c9e0d82732181f1c0d1b9346c63c Author: Matt Atwood Date: Mon Apr 13 13:53:22 2020 -0400 drm/i915/ehl: extended Wa_2006604312 to ehl Reflect recent bspec changes. Bspec: 33451 Signed-off-by: Matt Atwood Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200413175322.12162-1-matthew.s.atwood@intel.com Reviewed-by: Matt Roper commit 999866c92f4a333cb776c3e87831feeddef74f96 Author: Geert Uytterhoeven Date: Wed Apr 8 11:11:29 2020 +0200 spi: dt-bindings: rspi: Convert to json-schema Convert the Renesas (Quad) Serial Peripheral Interface (RSPI/QSPI) Device Tree binding documentation to json-schema. Document missing properties. Update the second example to match reality. Drop the first example, as it doesn't add much value. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200408091129.25429-1-geert+renesas@glider.be Signed-off-by: Mark Brown commit 980f91778a2f4dcca43d16b7a83feda8df5c96e7 Author: Amadeusz Sławiński Date: Wed Apr 15 12:24:34 2020 -0400 ASoC: topology: Remove unneeded semicolon There is unnecessary semicolon after last bracket of if statement, remove it. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20200415162435.31859-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit f0f383347ced96416d5e3062f8bb2b0f99ac9d5b Author: Nils ANDRÉ-CHANG Date: Sun Apr 12 18:19:00 2020 +0100 brcmfmac: remove leading space Signed-off-by: Nils ANDRÉ-CHANG Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200412171900.xzedxhzd56gox5kf@nixos commit befc8236a74feb912e5f02ae6764f5400297b2d6 Author: Joseph Lo Date: Thu Apr 9 19:52:32 2020 +0200 dt-bindings: memory: tegra: Add external memory controller binding for Tegra210 Add the binding document for the external memory controller (EMC) which communicates with external LPDDR4 devices. It includes the bindings of the EMC node and a sub-node of EMC table which under the reserved memory node. The EMC table contains the data of the rates that EMC supported. Signed-off-by: Joseph Lo Signed-off-by: Thierry Reding Signed-off-by: Rob Herring commit 1a351b10b9671fc2fac767c40a1c4373b9bf5092 Author: Radu Pirea Date: Mon Jan 6 12:43:36 2020 +0200 i2c: cadence: Added slave support Added support for I2C slave functionality Signed-off-by: Chirag Parekh Signed-off-by: Michal Simek Signed-off-by: Radu Pirea Signed-off-by: Wolfram Sang commit c2ce6bbcfc9f142b426717bc5aa3f9ba20485a65 Author: Dave Jiang Date: Wed Apr 15 09:13:12 2020 -0700 dmaengine: idxd: export hw version through sysfs Some user apps would like to know the hardware version in order to determine the variation of the hardware. Export the hardware version number to userspace via sysfs. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/158696714008.39484.13401950732606906479.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 18bc99156f01bbeace24abfb0a550e977e7c6ad0 Author: Thierry Reding Date: Thu Apr 9 19:52:25 2020 +0200 dt-bindings: reserved-memory: Introduce memory-region-names In order to make the reserved-memory bindings more consistent with other existing bindings, add a memory-region-names property that contains an array of strings that name the entries of the memory-region property and allows these regions to be looked up by name. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring commit 84a25ea9cfd9889acf1e1021cbd835277a1df71e Author: Pawel Dembicki Date: Thu Apr 9 09:04:43 2020 +0200 dt-bindings: vendor-prefixes: Add Check Point Check Point Software Technologies Ltd. is a company based in Israel and USA. They manufacture network devices and provide software products for IT security. Signed-off-by: Pawel Dembicki Acked-by: Sam Ravnborg Reviewed-by: Andrew Lunn Signed-off-by: Rob Herring commit a4e688535a0829980d5ef1516c0713777a874c62 Author: Peter Ujfalusi Date: Fri Mar 27 16:42:28 2020 +0200 dmaengine: ti: k3-udma: Disable memcopy via MCU NAVSS on am654 Trace of a test for DMA memcpy domains slipped into the glue layer commit. The memcpy support should be disabled on the MCU UDMAP. Fixes: d702419134133 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users") Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200327144228.11101-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit 53b3d8e9d57753295b33065f80b1e2fb4fcb946d Author: Sean Christopherson Date: Fri Mar 20 14:28:01 2020 -0700 KVM: x86: Export kvm_propagate_fault() (as kvm_inject_emulated_page_fault) Export the page fault propagation helper so that VMX can use it to correctly emulate TLB invalidation on page faults in an upcoming patch. In the (hopefully) not-too-distant future, SGX virtualization will also want access to the helper for injecting page faults to the correct level (L1 vs. L2) when emulating ENCLS instructions. Rename the function to kvm_inject_emulated_page_fault() to clarify that it is (a) injecting a fault and (b) only for page faults. WARN if it's invoked with an exception other than PF_VECTOR. Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-6-sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit d6e3f8385d27e6357221e01158fdd369f762cd0f Author: Junaid Shahid Date: Fri Mar 20 14:28:00 2020 -0700 KVM: nVMX: Invalidate all roots when emulating INVVPID without EPT Free all roots when emulating INVVPID for L1 and EPT is disabled, as outstanding changes to the page tables managed by L1 need to be recognized. Because L1 and L2 share an MMU when EPT is disabled, and because VPID is not tracked by the MMU role, all roots in the current MMU (root_mmu) need to be freed, otherwise a future nested VM-Enter or VM-Exit could do a fast CR3 switch (without a flush/sync) and consume stale SPTEs. Fixes: 5c614b3583e7b ("KVM: nVMX: nested VPID emulation") Signed-off-by: Junaid Shahid [sean: ported to upstream KVM, reworded the comment and changelog] Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-5-sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit f8aa7e3958bc433087ae7b9d7f24a92036c41141 Author: Sean Christopherson Date: Fri Mar 20 14:27:59 2020 -0700 KVM: nVMX: Invalidate all EPTP contexts when emulating INVEPT for L1 Free all L2 (guest_mmu) roots when emulating INVEPT for L1. Outstanding changes to the EPT tables managed by L1 need to be recognized, and relying on KVM to always flush L2's EPTP context on nested VM-Enter is dangerous. Similar to handle_invpcid(), rely on kvm_mmu_free_roots() to do a remote TLB flush if necessary, e.g. if L1 has never entered L2 then there is nothing to be done. Nuking all L2 roots is overkill for the single-context variant, but it's the safe and easy bet. A more precise zap mechanism will be added in the future. Add a TODO to call out that KVM only needs to invalidate affected contexts. Fixes: 14c07ad89f4d ("x86/kvm/mmu: introduce guest_mmu") Reported-by: Jim Mattson Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-4-sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit eed0030e4caa941cfbdfca00981395d85e6b3c3e Author: Sean Christopherson Date: Fri Mar 20 14:27:58 2020 -0700 KVM: nVMX: Validate the EPTP when emulating INVEPT(EXTENT_CONTEXT) Signal VM-Fail for the single-context variant of INVEPT if the specified EPTP is invalid. Per the INEVPT pseudocode in Intel's SDM, it's subject to the standard EPT checks: If VM entry with the "enable EPT" VM execution control set to 1 would fail due to the EPTP value then VMfail(Invalid operand to INVEPT/INVVPID); Fixes: bfd0a56b90005 ("nEPT: Nested INVEPT") Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-3-sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit e8eff282154fc392dadf6a779009c7ecaa7e169b Author: Sean Christopherson Date: Fri Mar 20 14:27:57 2020 -0700 KVM: VMX: Flush all EPTP/VPID contexts on remote TLB flush Flush all EPTP/VPID contexts if a TLB flush _may_ have been triggered by a remote or deferred TLB flush, i.e. by KVM_REQ_TLB_FLUSH. Remote TLB flushes require all contexts to be invalidated, not just the active contexts, e.g. all mappings in all contexts for a given HVA need to be invalidated on a mmu_notifier invalidation. Similarly, the instigator of the deferred TLB flush may be expecting all contexts to be flushed, e.g. vmx_vcpu_load_vmcs(). Without nested VMX, flushing only the current EPTP/VPID context isn't problematic because KVM uses a constant VPID for each vCPU, and mmu_alloc_direct_roots() all but guarantees KVM will use a single EPTP for L1. In the rare case where a different EPTP is created or reused, KVM (currently) unconditionally flushes the new EPTP context prior to entering the guest. With nested VMX, KVM conditionally uses a different VPID for L2, and unconditionally uses a different EPTP for L2. Because KVM doesn't _intentionally_ guarantee L2's EPTP/VPID context is flushed on nested VM-Enter, it'd be possible for a malicious L1 to attack the host and/or different VMs by exploiting the lack of flushing for L2. 1) Launch nested guest from malicious L1. 2) Nested VM-Enter to L2. 3) Access target GPA 'g'. CPU inserts TLB entry tagged with L2's ASID mapping 'g' to host PFN 'x'. 2) Nested VM-Exit to L1. 3) L1 triggers kernel same-page merging (ksm) by duplicating/zeroing the page for PFN 'x'. 4) Host kernel merges PFN 'x' with PFN 'y', i.e. unmaps PFN 'x' and remaps the page to PFN 'y'. mmu_notifier sends invalidate command, KVM flushes TLB only for L1's ASID. 4) Host kernel reallocates PFN 'x' to some other task/guest. 5) Nested VM-Enter to L2. KVM does not invalidate L2's EPTP or VPID. 6) L2 accesses GPA 'g' and gains read/write access to PFN 'x' via its stale TLB entry. However, current KVM unconditionally flushes L1's EPTP/VPID context on nested VM-Exit. But, that behavior is mostly unintentional, KVM doesn't go out of its way to flush EPTP/VPID on nested VM-Enter/VM-Exit, rather a TLB flush is guaranteed to occur prior to re-entering L1 due to __kvm_mmu_new_cr3() always being called with skip_tlb_flush=false. On nested VM-Enter, this happens via kvm_init_shadow_ept_mmu() (nested EPT enabled) or in nested_vmx_load_cr3() (nested EPT disabled). On nested VM-Exit it occurs via nested_vmx_load_cr3(). This also fixes a bug where a deferred TLB flush in the context of L2, with EPT disabled, would flush L1's VPID instead of L2's VPID, as vmx_flush_tlb() flushes L1's VPID regardless of is_guest_mode(). Cc: Vitaly Kuznetsov Cc: Ben Gardon Cc: Jim Mattson Cc: Junaid Shahid Cc: Liran Alon Cc: Boris Ostrovsky Cc: John Haxby Reviewed-by: Liran Alon Fixes: efebf0aaec3d ("KVM: nVMX: Do not flush TLB on L1<->L2 transitions if L1 uses VPID and EPT") Signed-off-by: Sean Christopherson Message-Id: <20200320212833.3507-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 909e0abaac0f3331e2016d4b9b19001a390d6019 Author: Wainer dos Santos Moschetta Date: Fri Apr 10 16:17:07 2020 -0700 selftests: kvm: Add testcase for creating max number of memslots This patch introduces test_add_max_memory_regions(), which checks that a VM can have added memory slots up to the limit defined in KVM_CAP_NR_MEMSLOTS. Then attempt to add one more slot to verify it fails as expected. Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Andrew Jones Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-11-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 5b4f758f454b6e3d9c7182031631c745105ec24b Author: Sean Christopherson Date: Fri Apr 10 16:17:06 2020 -0700 KVM: selftests: Make set_memory_region_test common to all architectures Make set_memory_region_test available on all architectures by wrapping the bits that are x86-specific in ifdefs. A future testcase to create the maximum number of memslots will be architecture agnostic. Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-10-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8cc2dd637b890d75613387daf57af7e8f3a32e33 Author: Sean Christopherson Date: Fri Apr 10 16:17:05 2020 -0700 KVM: selftests: Add "zero" testcase to set_memory_region_test Add a testcase for running a guest with no memslots to the memory region test. The expected result on x86_64 is that the guest will trigger an internal KVM error due to the initial code fetch encountering a non-existent memslot and resulting in an emulation failure. Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-9-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4cd94d125df531f9f569478eb3e025f08bc180f2 Author: Wainer dos Santos Moschetta Date: Fri Apr 10 16:17:04 2020 -0700 selftests: kvm: Add vm_get_fd() in kvm_util Introduces the vm_get_fd() function in kvm_util which returns the VM file descriptor. Reviewed-by: Andrew Jones Signed-off-by: Wainer dos Santos Moschetta Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-8-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8fb38f05ca9ffcca895d545a68a02f9a312c30d5 Author: Sean Christopherson Date: Fri Apr 10 16:17:03 2020 -0700 KVM: selftests: Add "delete" testcase to set_memory_region_test Add a testcase for deleting memslots while the guest is running. Like the "move" testcase, this is x86_64-only as it relies on MMIO happening when a non-existent memslot is encountered. Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-7-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8a0639fe9201ed7af73dd40fc4b6f9a4f7b16a42 Author: Sean Christopherson Date: Fri Apr 10 16:17:02 2020 -0700 KVM: sefltests: Add explicit synchronization to move mem region test Use sem_post() and sem_timedwait() to synchronize test stages between the vCPU thread and the main thread instead of using usleep() to wait for the vCPU thread and hoping for the best. Opportunistically refactor the code to make it suck less in general, and to prepare for adding more testcases. Suggested-by: Peter Xu Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-6-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 3e6b94126784fd5b0e781f2e8e980948ee945195 Author: Sean Christopherson Date: Fri Apr 10 16:17:01 2020 -0700 KVM: selftests: Add GUEST_ASSERT variants to pass values to host Add variants of GUEST_ASSERT to pass values back to the host, e.g. to help debug/understand a failure when the the cause of the assert isn't necessarily binary. It'd probably be possible to auto-calculate the number of arguments and just have a single GUEST_ASSERT, but there are a limited number of variants and silently eating arguments could lead to subtle code bugs. Signed-off-by: Sean Christopherson Message-Id: <20200410231707.7128-5-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 8c996e4dae177e6921fe61d20b1f30fc06a3d275 Author: Sean Christopherson Date: Fri Apr 10 16:17:00 2020 -0700 KVM: selftests: Add util to delete memory region Add a utility to delete a memory region, it will be used by x86's set_memory_region_test. Signed-off-by: Sean Christopherson Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Andrew Jones Message-Id: <20200410231707.7128-4-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 4d9bba9007167074504187d27fd80352eb3a04e7 Author: Sean Christopherson Date: Fri Apr 10 16:16:59 2020 -0700 KVM: selftests: Use kernel's list instead of homebrewed replacement Replace the KVM selftests' homebrewed linked lists for vCPUs and memory regions with the kernel's 'struct list_head'. Signed-off-by: Sean Christopherson Reviewed-by: Andrew Jones Message-Id: <20200410231707.7128-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 238022ff5d05f6cdceac67c03a66cc28a6cb30c9 Author: Sean Christopherson Date: Fri Apr 10 16:16:58 2020 -0700 KVM: selftests: Take vcpu pointer instead of id in vm_vcpu_rm() The sole caller of vm_vcpu_rm() already has the vcpu pointer, take it directly instead of doing an extra lookup. Signed-off-by: Sean Christopherson Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Andrew Jones Message-Id: <20200410231707.7128-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 43d05de2bee7561b7958628b7c27c89b779de990 Author: Eric Northup Date: Tue Apr 14 18:23:20 2020 -0700 KVM: pass through CPUID(0x80000006) Return the host's L2 cache and TLB information for CPUID.0x80000006 instead of zeroing out the entry as part of KVM_GET_SUPPORTED_CPUID. This allows a userspace VMM to feed KVM_GET_SUPPORTED_CPUID's output directly into KVM_SET_CPUID2 (without breaking the guest). Signed-off-by: Eric Northup (Google) Signed-off-by: Jim Mattson Signed-off-by: Jon Cargille Message-Id: <20200415012320.236065-1-jcargill@google.com> Signed-off-by: Paolo Bonzini commit 24647e0a39b6c5ef007fa2f9a91ac8b581e093b9 Author: Peter Shier Date: Wed Oct 10 15:56:53 2018 -0700 KVM: x86: Return updated timer current count register from KVM_GET_LAPIC kvm_vcpu_ioctl_get_lapic (implements KVM_GET_LAPIC ioctl) does a bulk copy of the LAPIC registers but must take into account that the one-shot and periodic timer current count register is computed upon reads and is not present in register state. When restoring LAPIC state (e.g. after migration), restart timers from their their current count values at time of save. Note: When a one-shot timer expires, the code in arch/x86/kvm/lapic.c does not zero the value of the LAPIC initial count register (emulating HW behavior). If no other timer is run and pending prior to a subsequent KVM_GET_LAPIC call, the returned register set will include the expired one-shot initial count. On a subsequent KVM_SET_LAPIC call the code will see a non-zero initial count and start a new one-shot timer using the expired timer's count. This is a prior existing bug and will be addressed in a separate patch. Thanks to jmattson@google.com for this find. Signed-off-by: Peter Shier Reviewed-by: Jim Mattson Reviewed-by: Wanpeng Li Message-Id: <20181010225653.238911-1-pshier@google.com> Signed-off-by: Paolo Bonzini commit 788109c1ccf70f29d2d15de94aabf100710d0069 Author: Colin Ian King Date: Fri Apr 10 12:35:26 2020 +0100 KVM: remove redundant assignment to variable r The variable r is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Message-Id: <20200410113526.13822-1-colin.king@canonical.com> Signed-off-by: Paolo Bonzini commit 702a21425a6d09a045a1ac9dd0141a9bac182486 Author: Sam Ravnborg Date: Wed Apr 8 21:51:09 2020 +0200 dt-bindings: display: move DSI panels to panel-simple-dsi Tomi noticed that several DSI panels was wrongly described in panel-simple.yaml. Move them to panel-simple-dsi.yaml where they belong. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-37-sam@ravnborg.org commit 8b9e7ace123d78d858914696cf61ca0830d5ccab Author: Sam Ravnborg Date: Wed Apr 8 21:51:08 2020 +0200 dt-bindings: display: convert olimex,lcd-olinuxino to DT Schema v2: - use "ic2" node name in example (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Rob Herring Cc: Stefan Mavrodiev Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-36-sam@ravnborg.org commit 5717f3b80d5fa1565d1580c490750897e9a4659f Author: Sam Ravnborg Date: Wed Apr 8 21:51:07 2020 +0200 dt-bindings: display: convert lgphilips,lb035q02 to DT Schema v2: - drop use of spi-slave.yaml (Maxime) - added unevaluatedProperties (maxime) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Tomi Valkeinen Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-35-sam@ravnborg.org commit 90c8466e3771b14459045b31929e82fd5a93a55a Author: Sam Ravnborg Date: Wed Apr 8 21:51:06 2020 +0200 dt-bindings: display: convert seiko,43wvf1g to DT Schema Signed-off-by: Sam Ravnborg Reviewed-by: Marco Franchi Reviewed-by: Rob Herring Cc: Marco Franchi Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-34-sam@ravnborg.org commit 236623c09ca43397aea783c29696ac185d4b6ed2 Author: Sam Ravnborg Date: Wed Apr 8 21:51:05 2020 +0200 dt-bindings: display: convert sharp,lq150x1lg11 to DT Schema Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Peter Rosin Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-33-sam@ravnborg.org commit e437b61b2132eabef1c7e587e94f66ffba4181a6 Author: Sam Ravnborg Date: Wed Apr 8 21:51:04 2020 +0200 dt-bindings: display: convert sharp,ls037v7dw01 to DT Schema v2: - Add min/maxItems to mode-gpios (Rob) - Fix bug in description, mode is up to three gpios (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Rob Herring Cc: Tony Lindgren Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-32-sam@ravnborg.org commit a965584dd089980482df114d2c5559a6d53c77fe Author: Sam Ravnborg Date: Wed Apr 8 21:51:02 2020 +0200 dt-bindings: display: convert sharp,ls043t1le01 to DT Schema The txt binding specified the property "power-supply". But the example and the actual implementation in the linux-kernel uses "avdd-supply". So the binding is adjusted to use avdd-supply as this seems to be the correct choice. There are no DT files in the linux kernel to check. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Werner Johansson Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-30-sam@ravnborg.org commit 6b3ee820b58000007deee2d05b103f75135dfdae Author: Sam Ravnborg Date: Wed Apr 8 21:51:01 2020 +0200 dt-bindings: display: drop unused simple-panel.txt There are no more references to simple-panel.txt. Delete it. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-29-sam@ravnborg.org commit 6c424e6862217f673fc23b6b389d4090e76a007b Author: Sam Ravnborg Date: Wed Apr 8 21:51:00 2020 +0200 dt-bindings: display: convert sitronix,st7789v to DT Schema v2: - dropped use of spi-slave.yaml (Maxime) - added unevaluatedProperties (Maxime) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-28-sam@ravnborg.org commit c907477e128b37113263496c75f968154c263273 Author: Sam Ravnborg Date: Wed Apr 8 21:50:59 2020 +0200 dt-bindings: display: convert sony,acx565akm to DT Schema v2: - drop use of spi-slave.yaml (Maxime) - add unevaluatedProperties (Maxime) - rename node in example to panel (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Tomi Valkeinen Reviewed-by: Rob Herring Cc: Tomi Valkeinen Cc: Rob Herring Cc: Maxime Ripard Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-27-sam@ravnborg.org commit 8d1f9345ea7045c49614c3e38cc1f4b4da4f325f Author: Sam Ravnborg Date: Wed Apr 8 21:50:58 2020 +0200 dt-bindings: display: convert startek,startek-kd050c to DT Schema Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Marek Belisko Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-26-sam@ravnborg.org commit 77aeb2d7942dcb0ec2a44f23149f94c716a92598 Author: Sam Ravnborg Date: Wed Apr 8 21:50:57 2020 +0200 dt-bindings: display: convert toppoly panels to DT Schema v2: - dropped use of spi-slave.yaml (Maxime) - added unevaluatedProperties (Maxime) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Marek Belisko Cc: H. Nikolaus Schaller Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-25-sam@ravnborg.org commit f9f2ae6282a75d6e0fdd9ea43bb14351f09f8f30 Author: Sam Ravnborg Date: Wed Apr 8 21:50:55 2020 +0200 dt-bindings: display: convert samsung,ld9040 to DT Schema v2: - drop use of spi-slave.yaml (Maxime) - added unevaluatedProperties (Maxime) - added type to width/height properties (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Rob Herring Cc: Andrzej Hajda Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-23-sam@ravnborg.org commit 19853af1e44e73910d9f264304eb08e6321f7f5a Author: Sam Ravnborg Date: Wed Apr 8 21:50:54 2020 +0200 dt-bindings: display: convert samsung,s6d16d0 to DT Schema Signed-off-by: Sam Ravnborg Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Cc: Linus Walleij Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-22-sam@ravnborg.org commit 48d8e0a712e52397fb87bc90464daa6e6fe72c48 Author: Sam Ravnborg Date: Wed Apr 8 21:50:53 2020 +0200 dt-bindings: display: convert samsung AMOLED to DT Schema For samsung there was two AMOLED panels with the same description. Collect them in one binding file. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Hoegeun Kwon Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-21-sam@ravnborg.org commit 1aa3bf853cb41ded4905f90c2d10b239d823c74b Author: Sam Ravnborg Date: Wed Apr 8 21:50:51 2020 +0200 dt-bindings: display: convert raydium,rm67191 to DT Schema v2: - Fix entry in MAINTAINERS - Add reg number to node name (Rob) - Fix stray spaces Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Rob Herring Cc: Robert Chiras Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-19-sam@ravnborg.org commit 05bf34578d4d4a6621e245891b90e92184c3fc7c Author: Sam Ravnborg Date: Wed Apr 8 21:50:50 2020 +0200 dt-bindings: display: convert osddisplays,osd101t2587-53ts to DT Schema osddisplays,osd101t2587-53ts is compatible with panel-simple-dsi binding, so list the compatible in the panel-simple-dsi binding file. v2: - It is a DSI panel, move to -dsi binding (Tomi) Signed-off-by: Sam Ravnborg Reviewed-by: Tomi Valkeinen Reviewed-by: Rob Herring Cc: Peter Ujfalusi Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-18-sam@ravnborg.org commit 889034a6a2fd2b8499ffd37912bbcc1f02c8a8e9 Author: Sam Ravnborg Date: Wed Apr 8 21:50:49 2020 +0200 dt-bindings: display: convert lg,lg4573 to DT Schema v2: - Dropped spi-slave (Maxime) - Added unevaluatedProperties (Maxime) - Deleted needless compatible from example (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Heiko Schocher Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Rob Herring Cc: Heiko Schocher Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-17-sam@ravnborg.org commit 310abcea76e91ed05545c4fc0304fbe9cc1f18a7 Author: Sam Ravnborg Date: Wed Apr 8 21:50:48 2020 +0200 dt-bindings: display: convert simple lg panels to DT Schema Add the lg panels that matches the panel-simple binding to panel-simple.yaml Signed-off-by: Sam Ravnborg Reviewed-by: Brian Masney Reviewed-by: Rob Herring Cc: Brian Masney Cc: Alexandre Courbot Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-16-sam@ravnborg.org commit 7236d77374fd170e604aa39e3018b9ba908273fb Author: Sam Ravnborg Date: Wed Apr 8 21:50:47 2020 +0200 dt-bindings: display: convert kingdisplay,kd097d04 to DT Schema kingdisplay,kd097d04 matches the panel-simple-dsi binding. The only difference is that enable-gpios is now an optional property. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Nickey Yang Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-15-sam@ravnborg.org commit 3b5d6c3c9c9b5886417f73720ee63e391ec91b57 Author: Sam Ravnborg Date: Wed Apr 8 21:50:46 2020 +0200 dt-bindings: display: convert kingdisplay,kd035g6-54nt to DT Schema v2: - Drop use of spi-slave.yaml (Maxime) - Introduce unevaluatedProperties (Maxime) Signed-off-by: Sam Ravnborg Reviewed-by: Paul Cercueil Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Paul Cercueil Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-14-sam@ravnborg.org commit b33b9141b7a878522308151eeb28b3c2dea20060 Author: Sam Ravnborg Date: Wed Apr 8 21:50:45 2020 +0200 dt-bindings: display: convert jdi,lt070me05000 to DT Schema v2: - drop address in dsi node in example (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Vinay Simha BN Reviewed-by: Rob Herring Cc: Rob Herring Cc: Vinay Simha BN Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-13-sam@ravnborg.org commit cd906710d845aa30bc14fcfa6d133e7847cf8a70 Author: Sam Ravnborg Date: Wed Apr 8 21:50:44 2020 +0200 dt-bindings: display: convert innolux,p120zdg-bf1 to DT Schema v3: - Fix stray spaces Signed-off-by: Sam Ravnborg Reviewed-by: Douglas Anderson Reviewed-by: Rob Herring Cc: Douglas Anderson Cc: Sandeep Panda Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-12-sam@ravnborg.org commit 16cd62768d61e66780042e866bca0fb53f47fb88 Author: Sam Ravnborg Date: Wed Apr 8 21:50:43 2020 +0200 dt-bindings: display: convert innolux,p097pfg to DT Schema Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Lin Huang Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-11-sam@ravnborg.org commit ba98fc38dd50a5674355c2e0b8c6dd3a9acde165 Author: Sam Ravnborg Date: Wed Apr 8 21:50:41 2020 +0200 dt-bindings: display: convert ilitek,ili9881c to DT Schema Updating this binding identified an issue in the example in the allwinner,sun6i-a31-mipi-dsi binding. Fix the example so no new warnings are introduced. v2: - fix example in allwinner,sun6i-a31-mipi-dsi (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Rob Herring Cc: Maxime Ripard Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-9-sam@ravnborg.org commit 66e3377c7c81a04b9461254300d9c8ae853eab99 Author: Sam Ravnborg Date: Wed Apr 8 21:50:40 2020 +0200 dt-bindings: display: convert ilitek,ili9322 to DT Schema The .txt binding explains: " The following optional properties only apply to RGB and YUV input modes and can be omitted for BT.656 input modes: " This constraint is not implmented in the DT Schema. The original binding from the .txt file referenced properties that is included in panel-timing.yaml. The properties in question are: - pixelclk-active - de-active - hsync-active - vsync-active These properties was dropped in the conversion as they are not relevant. v2: - drop properties from panel-timing (Linus) - drop use of spi-slave.yaml (Maxime) - introduce unevaluatedProperties (Maxime) - dropped unused properties (Linus) - delete stray spaces Signed-off-by: Sam Ravnborg Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Cc: Linus Walleij Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-8-sam@ravnborg.org commit c1eb28405d3a454df900ed3534a31f138e73225e Author: Sam Ravnborg Date: Wed Apr 8 21:50:39 2020 +0200 dt-bindings: display: convert boe,himax8279d to DT Schema v2: - Fix entry in MAINTAINERS v3: - Fix panel@0 in example (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Jerry Han Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-7-sam@ravnborg.org commit 5304058b1526064a0c381446a66f19b146fa8e7e Author: Sam Ravnborg Date: Wed Apr 8 21:50:38 2020 +0200 dt-bindings: display: convert arm,versatile-tft-panel to DT Schema v2: - Fix entry in MAINTAINERS Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Linus Walleij Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-6-sam@ravnborg.org commit 022467444515c15ac8f3f690f3dff5f21d04c627 Author: Peter Ujfalusi Date: Fri Apr 3 17:19:50 2020 +0300 dmaengine: ti: k3-udma: Drop COMPILE_TEST for the drivers for now It is not possible to compile test the UDMA stack right now due to dependencies to T_SCI_PROTOCOL and TI_SCI_INTA_IRQCHIP and their dependencies. Remove the COMPILE_TEST until it is actually possible to compile test the drivers. Reported-by: Linus Torvalds Signed-off-by: Peter Ujfalusi Acked-by: Linus Torvalds Link: https://lore.kernel.org/r/20200403141950.9359-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul commit f86a1bb536064a431c36d4333f4a2295b2419477 Author: Andy Shevchenko Date: Tue Apr 14 19:13:37 2020 +0300 pinctrl: baytrail: Use platform_get_irq_optional() explicitly There is no need to repeat functionality of platform_get_irq_optional() in the driver. Replace it with explicit call to the helper. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit d4e0055b8fa084d07dfbdd6e041fd7d8b07f4dc5 Author: Sam Ravnborg Date: Wed Apr 8 21:50:37 2020 +0200 dt-bindings: display: convert samsung,s6e63m0 to DT Schema The binding for this panel is a SPI slave. v2: - Drop use of spi-slave (Maxime) - Introude unevaluatedProperties (Maxime) - Drop reg entry in example (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Maxime Ripard Cc: Rob Herring Cc: Jonathan Bakker Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-5-sam@ravnborg.org commit 1e4fbcdf8a0319916b1172518f8ccd35bfa24b80 Author: Sam Ravnborg Date: Wed Apr 8 21:50:36 2020 +0200 dt-bindings: display: add te-gpios to panel-common Several bindings specifies a "te-gpios" for tearing effect signal. Add this to panel-common so we have a shared definition. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-4-sam@ravnborg.org commit 16a7e952e824ea85a749459bdd7820d09a8a6286 Author: Sam Ravnborg Date: Wed Apr 8 21:50:35 2020 +0200 dt-bindings: display: look for dsi* nodes in dsi-controller Rob wrote: Uhhh, it's looking for dsi-controller(@.*)? which is not the common case found in dts files. We should fix that to dsi(@.*)?. See: https://lore.kernel.org/dri-devel/20200319032222.GK29911@bogus/ Fix it. Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Linus Walleij Cc: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20200408195109.32692-3-sam@ravnborg.org commit 95a776e8a6282ac19051655c55124e711318ae6e Author: Max Gurtovoy Date: Mon Apr 13 16:39:05 2020 +0300 RDMA/rw: use DIV_ROUND_UP to calculate nr_ops Don't open-code DIV_ROUND_UP() kernel macro. Link: https://lore.kernel.org/r/20200413133905.933343-1-leon@kernel.org Signed-off-by: Max Gurtovoy Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 63735af86d645a47903f912ae89957507edd917b Author: Mauro Carvalho Chehab Date: Tue Mar 31 14:44:56 2020 +0200 media: docs: add cros-references to the other media guides In order to make easier for people to navigate between the three media guides, add cross-references between them Signed-off-by: Mauro Carvalho Chehab commit e4da97eb3a0969e240a276562b45fb1ba2a343a3 Author: Mauro Carvalho Chehab Date: Tue Mar 31 14:44:49 2020 +0200 media: docs: add GPLv2 for uAPI guide Newer uAPI docs should be dual-licensed with both GPL and GFDL. Add a text adding the GPLv2 license text there, in order to be coherent with the included docs. Signed-off-by: Mauro Carvalho Chehab commit cc5d250e5a3b6b50b84b497a5c97ff0c2e59bd20 Author: Mauro Carvalho Chehab Date: Tue Mar 31 14:34:29 2020 +0200 media: docs: move copyrights to the end and update them The copyright info is not the most valuable information there. Move them to the end. While here, change the copyright to cover up to this year (2020). Signed-off-by: Mauro Carvalho Chehab commit ef7f0c9539d8a1e7de8e3e62788774b0bdbf30e9 Author: Mauro Carvalho Chehab Date: Tue Mar 31 14:21:28 2020 +0200 media: docs: fix references for vimc As the test drivers got moved, we need to update the cross-references accordingly. Signed-off-by: Mauro Carvalho Chehab commit 4605a6102a7bebabf3123b29daa94bea88b6a087 Author: Mauro Carvalho Chehab Date: Tue Mar 10 16:01:08 2020 +0100 media: docs: cleanup bttv-devel.rst file This file was converted from text at the early ReST days. We learnt a lot about how to produce a nicer result while keeping the file better readable as plain text. Change some ReST markups to make it look better, both at the output formats and as plain text file. While here, remove references for the old bt848/winutil tool, as it seems that it doesn't exist anymore. Signed-off-by: Mauro Carvalho Chehab commit 371f6ff57f56fc1f5b561f668d9f10eb2103068f Author: Mauro Carvalho Chehab Date: Tue Mar 10 15:53:39 2020 +0100 media: docs: Add a master topic for the index file Right now, both V4L and Digital TV are shown as main titles. Instead, add a main title, in order to better display its output. While here, simplify the file, as we don't need to add a title for the indexes, nor we need copyright info, as everything there is GPL, as stated by the SPDX tags. Signed-off-by: Mauro Carvalho Chehab commit 1c9eeba23227df126e7e8e3597df2d0e7ff39881 Author: Mauro Carvalho Chehab Date: Tue Mar 10 13:42:41 2020 +0100 media: docs: get rid of obsoleted udev documentation This file is very old, and doesn't match the current udev behavior. I wanted to preserve it, because we'll need some udev description some day about how to keep names unique, but there's nothing here to help with that... So, be it: let's just discard this document, as it doesn't provide anything useful anymore. Signed-off-by: Mauro Carvalho Chehab commit 08256f12ac56dfae0ddadc057bb4066e380b7078 Author: Mauro Carvalho Chehab Date: Tue Mar 10 13:38:34 2020 +0100 media: docs: zr364xx: update documentation There aren't much to be done here... almost everything is still valid. The supported boards even reflect the current driver's state. Yet, some things changed, so let's keep this document updated. Signed-off-by: Mauro Carvalho Chehab commit 12bcf90c693cc56dfde62690d4b38fd3332ed536 Author: Mauro Carvalho Chehab Date: Tue Mar 10 13:10:17 2020 +0100 media: docs: saa7134.rst: update the documentation There are several things here that are outdated, because this document was written a long time ago. Update them to reflect the current status of the driver and the media subsystem. Signed-off-by: Mauro Carvalho Chehab commit 8a1bfbc70d13e780e7bd11a9b42f9083910b4ed7 Author: Mauro Carvalho Chehab Date: Mon Mar 9 17:21:16 2020 +0100 media: docs: update Digital TV faq.rst This file contains lots of obsoleted information. Update it to reflect the current status and tools used by Digital TV users and add pointers to the current locations and to LinuxTV wiki pages. Signed-off-by: Mauro Carvalho Chehab commit fe877259d8aa6af1161718f2aa8c6848efe3418b Author: Mauro Carvalho Chehab Date: Mon Mar 9 17:05:05 2020 +0100 media: docs: cpia2.rst: do some cleanups Do some cleanups at the document in order to mark two literal blocks as such. While here, simplify two block markups, using the less verbose option (::). Signed-off-by: Mauro Carvalho Chehab commit 9fafef585718415bcacc8e3cae7d3cfbe43c4f70 Author: Mauro Carvalho Chehab Date: Mon Mar 9 16:35:26 2020 +0100 media: docs: add a cardlist for cx18 boards There aren't many boards supported by this driver. So, add a list for it manually generated. Signed-off-by: Mauro Carvalho Chehab commit 729126e4b4b3e1e7c774536fecd387271d87ef90 Author: Mauro Carvalho Chehab Date: Mon Mar 9 16:18:55 2020 +0100 media: docs: update bttv.rst information This document is... old. The bttv driver was one of the first drivers at the Kernel. So, the document became a little obsoleted. Update it to reflect some changes that happened along the time affecting this driver and the subsystem. Signed-off-by: Mauro Carvalho Chehab commit f631516f6d7d87fc006a8f51348fa84022a58d12 Author: Mauro Carvalho Chehab Date: Mon Mar 9 15:44:06 2020 +0100 media: docs: bt8xx.rst: update document info This document is very outdated, and doesn't match the upstream current way. Update it, making some parts a little bit more generic. While the main focus of this document is digital TV cards, its content also may also help someone with just analog TV support. Signed-off-by: Mauro Carvalho Chehab commit c5b352431f6f50419790d70be89f2412018c423c Author: Mauro Carvalho Chehab Date: Mon Mar 9 15:00:34 2020 +0100 media: docs: update avermedia.rst contents While this is old, now that we moved the intro part of it, its contents seem to be valid, if we mention that we're talking only about the BT878 support. Update the document title accordingly and remove the obsolete note from it. Signed-off-by: Mauro Carvalho Chehab commit 03693a5a23936263fe1e370218228e8d037295aa Author: Mauro Carvalho Chehab Date: Mon Mar 9 14:56:54 2020 +0100 media: docs: intro.rst actually contain DVB references This document doesn't describe the DVB subsystem. Instead, it just contain references to some places. Better name it and improve its contents. Signed-off-by: Mauro Carvalho Chehab commit 109895a1525fb717850186c59ea21e5a9bd6b5d4 Author: Mauro Carvalho Chehab Date: Mon Mar 9 14:37:07 2020 +0100 media: docs: dvb_intro.rst: update its contents The content there is somewhat outdated. Update to reflect the current status. While here, remove extra spaces, as we won't be preserving left margin alinment on this document. Signed-off-by: Mauro Carvalho Chehab commit c4b89166d291959cf9a2e8da48f7bfa65b7d56d4 Author: Mauro Carvalho Chehab Date: Mon Mar 9 13:20:32 2020 +0100 media: docs: split avermedia.rst contents on two files Part of this document has nothing to do with the Avermedia driver. It is generic to the entire subsystem. So, split it on a separate file. Signed-off-by: Mauro Carvalho Chehab commit b533cad6fd59c0fb083c1e0066ee7713366bff7e Author: Mauro Carvalho Chehab Date: Mon Mar 9 07:23:59 2020 +0100 media: docs: update cardlists There were some changes at the drivers adding support for more cards. Update cardlists accordingly. Signed-off-by: Mauro Carvalho Chehab commit 2eb71a3a68c387274cfc1bc43eac25138add528d Author: Marcel Holtmann Date: Thu Apr 9 08:05:50 2020 +0200 Bluetooth: Clear HCI_LL_RPA_RESOLUTION flag on reset When the controller is being reset or power cycled, then the flag HCI_LL_RPA_RESOLUTION which indicates if controller based address resolution is active needs to be also reset. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit ff3b8df2bd758d97aa3dd7c021864be05fec9bd5 Author: Marcel Holtmann Date: Thu Apr 9 08:05:49 2020 +0200 Bluetooth: Enable LE Enhanced Connection Complete event. In case LL Privacy is supported by the controller, it is also a good idea to use the LE Enhanced Connection Complete event for getting all information about the new connection and its addresses. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 849c9c35e80d73c215c65b6023658b371bdeb5ed Author: Marcel Holtmann Date: Thu Apr 9 08:05:48 2020 +0200 Bluetooth: Use extra variable to make code more readable When starting active scanning for discovery the whitelist is not needed to be used. So the filter_policy is 0x00. To make the core more readable use a variable name instead of just setting 0 as paramter. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 55beec10710d10cb4a1cbbc5b1a0d9c9cfbd2c1e Author: Marcel Holtmann Date: Thu Apr 9 08:05:47 2020 +0200 Bluetooth: Sort list of LE features constants The list of LE features constants has gotten a bit confused. It lost the order and gained duplicated. Clean this up. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit ffb2e0082cfc77d01e44a9de965ae1adcbc48546 Author: Guillaume Tucker Date: Wed Apr 15 14:35:52 2020 +0100 media: Kconfig: include test_drivers with MEDIA_TEST_SUPPORT Include test_drivers/Kconfig when MEDIA_TEST_SUPPORT is enabled rather than MEDIA_PLATFORM_SUPPORT. Test drivers should not depend on platform drivers to be enabled. Reported-by: "kernelci.org bot" Fixes: 4b32216adb010 ("media: split test drivers from platform directory") Signed-off-by: Guillaume Tucker Signed-off-by: Mauro Carvalho Chehab commit 83b35f4586e235bfb785a7947b555ad8f3d96887 Author: Tang Bin Date: Wed Apr 15 12:45:13 2020 +0800 ASoC: fsl_micfil: Omit superfluous error message in fsl_micfil_probe() In the function fsl_micfil_probe(), when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang Link: https://lore.kernel.org/r/20200415044513.17492-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown commit 46b7e2ff8cb67f9f23bdfec0d8d08d803eb1146e Author: Pierre-Louis Bossart Date: Tue Apr 14 22:26:47 2020 -0500 ASoC: Intel: skl_hda_generic: remove rtd->codec_dai Use macro and solve compilation issues Reported-by: Stephen Rothwell Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200415032647.11209-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 906746ba26d0b45688f4c3b730c35f765dc958ba Author: Bjorn Andersson Date: Tue Apr 14 22:37:08 2020 -0700 regulator: qcom-rpmh: Fix typos in pm8150 and pm8150l Fix typos in pm8150 l13/l16/l17 and pm8150l ldo8 supplies. Fixes: 06369bcc15a1 ("regulator: qcom-rpmh: Add support for SM8150") Signed-off-by: Bjorn Andersson Tested-by: Vinod Koul Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200415053708.717623-1-bjorn.andersson@linaro.org Signed-off-by: Mark Brown commit 6472e4e25e573848be9d4b33237a994414e6a43a Author: Colin Ian King Date: Wed Apr 15 09:34:20 2020 +0100 drm/rockchip: fix spelling mistake "modifer" -> "modifier" There is a spelling mistake in a DRM_DEBUG_KMS debug message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200415083420.366279-1-colin.king@canonical.com commit ea06a482a47c41f5d04565dffbc21156bcfdd3e8 Author: Adam Ford Date: Sat Apr 11 20:33:51 2020 -0500 gpiolib: of: improve gpiolib-of support of pull up/down on expanders When using GPIO expanders attached to I2C ports, their set_config function needs to be passed a config setting which contains options to enable pull up or pull down bias feature. In order to set this config properly, the gpio parser needs to handle GPIO_PULL_UP and GPIO_PULL_DOWN. This patch enables the flags corresponding to GPIO_PULL_UP and GPIO_PULL_DOWN. Signed-off-by: Adam Ford Signed-off-by: Bartosz Golaszewski commit 35eba185fd1a3c61556a3050edbddc58d953303f Author: Wan Ahmad Zainie Date: Tue Apr 7 21:34:39 2020 +0800 i2c: designware: Calculate SCL timing parameter for High Speed Mode Custom parameters for HCNT/LCNT are not available for OF based system. Thus, we will use existing SCL timing parameter calculation functions for High Speed Mode too. The value for the parameters tSYMBOL and tLOW is taken from DesignWare DW_apb_i2c Databook v2.01a, section 3.15.4.6. The calculation should assume higher bus load since it gives slower timing parameter. Signed-off-by: Wan Ahmad Zainie Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 85f8fcaeed33315e19905af23f2693a81956688a Author: Wan Ahmad Zainie Date: Tue Apr 7 21:34:38 2020 +0800 i2c: designware: Calculate SCL timing parameter for Fast Mode Plus Custom parameters for HCNT/LCNT are not available for OF based system. Thus, we will use existing SCL timing parameter calculation functions for Fast Mode Plus. Signed-off-by: Wan Ahmad Zainie Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 79d48da381ca977c60e17bdebd2e6f7c4c390df8 Author: Fabrice Gasnier Date: Thu Mar 19 19:21:55 2020 +0100 i2c: i2c-stm32f7: improve nack debug message Add information on slave addr in the nack debug message. Signed-off-by: Fabrice Gasnier Signed-off-by: Alain Volmat Reviewed-by: Pierre-Yves MORDRET Signed-off-by: Wolfram Sang commit be1b92c133cc91b2fb00b8c5f6b8a922fa8003da Author: Geert Uytterhoeven Date: Tue Mar 24 14:56:47 2020 +0100 i2c: i801: Use GPIO_LOOKUP() helper macro i801_add_mux() fills in the GPIO lookup table by manually populating an array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper macro instead, to relax a dependency on the gpiod_lookup structure's member names. Signed-off-by: Geert Uytterhoeven Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit def00b32f02729eb55088f83b0f6e076cdbb3bc3 Author: Wolfram Sang Date: Wed Apr 1 21:30:18 2020 +0200 i2c: refactor parsing of timings When I wanted to print the chosen values to debug output, I concluded that a helper function to parse one timing would be helpful. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit df823a8208c434eee6e4e9aa016c956d0968e2e2 Author: Mauro Carvalho Chehab Date: Wed Apr 15 12:12:29 2020 +0200 media: cec: rename CEC platform drivers config options Most CEC platform drivers are using VIDEO_*_CEC pattern, some with an _HDMI extension too. Well, they're not related to V4L2 support, and we don't really need those big config names. So drop VIDEO_* from them, remove _HDMI (if present) and move CEC to the start. This way, all platform driver options are now CEC_. Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f27237c174fd9653033330e4e532cd9d153ce824 Author: Adam Honse Date: Fri Apr 10 15:48:44 2020 -0500 i2c: piix4: Detect secondary SMBus controller on AMD AM4 chipsets The AMD X370 and other AM4 chipsets (A/B/X 3/4/5 parts) and Threadripper equivalents have a secondary SMBus controller at I/O port address 0x0B20. This bus is used by several manufacturers to control motherboard RGB lighting via embedded controllers. I have been using this bus in my OpenRGB project to control the Aura RGB on many motherboards and ASRock also uses this bus for their Polychrome RGB controller. I am not aware of any CZ-compatible platforms which do not have the second SMBus channel. All of AMD's AM4- and Threadripper- series chipsets that OpenRGB users have tested appear to have this secondary bus. I also noticed this secondary bus is present on older AMD platforms including my FM1 home server. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202587 Signed-off-by: Adam Honse Reviewed-by: Jean Delvare Reviewed-by: Sebastian Reichel Tested-by: Sebastian Reichel Signed-off-by: Wolfram Sang commit c02fb2b8067a4b940884fc58289adad0e3866d10 Author: Dejin Zheng Date: Tue Apr 14 21:48:27 2020 +0800 i2c: busses: convert to devm_platform_get_and_ioremap_resource use devm_platform_get_and_ioremap_resource() to simplify code, which contains platform_get_resource() and devm_ioremap_resource(), it also get the resource for use by the following code. Signed-off-by: Dejin Zheng Signed-off-by: Wolfram Sang commit e0442d76213981ab48e8ea0874bb6c47e3af5a36 Author: Dejin Zheng Date: Thu Apr 9 21:52:24 2020 +0800 i2c: busses: convert to devm_platform_ioremap_resource use devm_platform_ioremap_resource() to simplify code, it contains platform_get_resource and devm_ioremap_resource. Reviewed-by: Barry Song Acked-by: Bartosz Golaszewski Acked-by: Robert Richter Acked-by: Thor Thayer Acked-by: Manivannan Sadhasivam Reviewed-by: Bjorn Andersson Signed-off-by: Dejin Zheng Signed-off-by: Wolfram Sang commit a81068181aad78a5f6980408a4b6115d22bb8aed Author: Mauro Carvalho Chehab Date: Wed Apr 15 11:14:25 2020 +0200 media: move CEC USB drivers to a separate directory As CEC support doesn't depend on MEDIA_SUPPORT, let's place the platform drivers outside the media menu. As a side effect, instead of depends on USB, drivers just select it. Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4be5e8648b0c287aefc6ac3f3a0b12c696054f43 Author: Mauro Carvalho Chehab Date: Wed Apr 15 11:03:40 2020 +0200 media: move CEC platform drivers to a separate directory As CEC support doesn't depend on MEDIA_SUPPORT, let's place the platform drivers outside the media menu. As a side effect, instead of depends on PCI, seco driver can select it (and DMI). Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 00e0afb658bf180a521ee693df204d9bccc6e58a Author: Jules Irenge Date: Mon Apr 13 22:42:40 2020 +0100 fsnotify: Add missing annotation for fsnotify_finish_user_wait() and for fsnotify_prepare_user_wait() Sparse reports warnings at fsnotify_prepare_user_wait() and at fsnotify_finish_user_wait() warning: context imbalance in fsnotify_finish_user_wait() - wrong count at exit warning: context imbalance in fsnotify_prepare_user_wait() - unexpected unlock The root cause is the missing annotation at fsnotify_finish_user_wait() and at fsnotify_prepare_user_wait() fsnotify_prepare_user_wait() has an extra annotation __release() that only tell Sparse and not GCC to shutdown the warning Add the missing __acquires(&fsnotify_mark_srcu) annotation Add the missing __releases(&fsnotify_mark_srcu) annotation Add the __release(&fsnotify_mark_srcu) annotation. Link: https://lore.kernel.org/r/20200413214240.15245-1-jbi.octave@gmail.com Signed-off-by: Jules Irenge Signed-off-by: Jan Kara commit 46d2a3b964ddbe63605dab502c847180b1efbfb2 Author: Mauro Carvalho Chehab Date: Wed Apr 15 09:55:10 2020 +0200 media: place CEC menu before MEDIA_SUPPORT The only item that opens at the CEC Kconfig menu is related to Remote Controller. Also, its support should not depend on media support, so it makes sense to keep both RC and CEC together. After this change, the main media menus that are visible under "Device Drivers" menu are: <*> Remote Controller support ---> [ ] HDMI CEC RC integration (NEW) < > HDMI CEC drivers Multimedia support ---> Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit de73b88c7ca1f3b214ba135d100afad42ddf7a2a Author: Mauro Carvalho Chehab Date: Wed Apr 15 10:43:44 2020 +0200 media: cec: move the core to a separate directory In preparation for moving CEC drivers to the CEC directory, move the core to a separate place. Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d9976bc155b11a0875a361e656255c64964d8090 Author: Lukas Bulwahn Date: Mon Apr 13 13:52:55 2020 +0200 MAINTAINERS: Remove sifive_l2_cache.c from EDAC-SIFIVE pattern Commit 9209fb51896f ("riscv: move sifive_l2_cache.c to drivers/soc") moved arch/riscv/mm/sifive_l2_cache.c to drivers/soc/sifive/sifive_l2_cache.c and adjusted the MAINTAINERS EDAC-SIFIVE entry but slipped in a mistake. Since then, ./scripts/get_maintainer.pl --self-test complains: warning: no file matches F: drivers/soc/sifive_l2_cache.c Boris suggested that sifive_l2_cache.c is considered part of the SIFIVE DRIVERS, not part of EDAC-SIFIVE. So simply drop this entry, and by the sifive keyword pattern in SIFIVE PATTERNS, it is automatically part of the SIFIVE DRIVERS. Suggested-by: Borislav Petkov Co-developed-by: Sebastian Duda Signed-off-by: Sebastian Duda Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200413115255.7100-1-lukas.bulwahn@gmail.com commit 4c5b566c2193e2af82c891daa5303c8899e61044 Author: Kairui Song Date: Tue Mar 31 02:15:44 2020 +0800 crash_dump: Remove no longer used saved_max_pfn saved_max_pfn was originally introduced in commit 92aa63a5a1bf ("[PATCH] kdump: Retrieve saved max pfn") It used to make sure that the user does not try to read the physical memory beyond saved_max_pfn. But since commit 921d58c0e699 ("vmcore: remove saved_max_pfn check") it's no longer used for the check. This variable doesn't have any users anymore so just remove it. [ bp: Drop the Calgary IOMMU reference from the commit message. ] Signed-off-by: Kairui Song Signed-off-by: Borislav Petkov Acked-by: "Eric W. Biederman" Link: https://lkml.kernel.org/r/20200330181544.1595733-1-kasong@redhat.com commit 79799562bf087b30d9dd0fddf5bed2d3b038be08 Author: Andrzej Pietrasiewicz Date: Tue Apr 14 20:00:57 2020 +0200 thermal: int3400_thermal: Statically initialize .get_mode()/.set_mode() ops int3400_thermal_ops is used inside int3400_thermal_probe() only after the assignments, which can just as well be made statically at struct's initizer. Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Bartlomiej Zolnierkiewicz Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200414180105.20042-2-andrzej.p@collabora.com commit 8c42c0f72d7c4f295646d3eba73f62e5579b1732 Author: Jason Yan Date: Tue Apr 14 20:02:38 2020 +0800 clocksource/drivers/atmel-st: Remove useless 'status' Fix the following coccicheck warning: drivers/clocksource/timer-atmel-st.c:142:6-12: Unneeded variable: "status". Return "0" on line 166 Signed-off-by: Jason Yan Acked-by: Alexandre Belloni Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200414120238.35704-1-yanaijie@huawei.com commit 5a652b49b41b1cbffe2beedbaf253f60f768fd92 Author: Jason Yan Date: Tue Apr 14 20:02:51 2020 +0800 ipw2x00: make ipw_setup_deferred_work() void This function actually needs no return value. So remove the unneeded variable 'ret' and make it void. This also fixes the following coccicheck warning: drivers/net/wireless/intel/ipw2x00/ipw2200.c:10648:5-8: Unneeded variable: "ret". Return "0" on line 10684 Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200414120251.35869-1-yanaijie@huawei.com commit e871b8bfedda84924ac5767883c80deae67a2657 Author: Jason Yan Date: Mon Apr 13 16:21:26 2020 +0800 brcmsmac: make brcms_c_stf_ss_update() void Fix the following coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmsmac/stf.c:309:5-13: Unneeded variable: "ret_code". Return "0" on line 328 Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200413082126.22572-1-yanaijie@huawei.com commit 7b9ae69d5441d98ce55da7d651efff2c7ce27551 Author: Jason Yan Date: Mon Apr 13 16:20:43 2020 +0800 orinoco: remove useless variable 'err' in spectrum_cs_suspend() Fix the following coccicheck warning: drivers/net/wireless/intersil/orinoco/spectrum_cs.c:281:5-8: Unneeded variable: "err". Return "0" on line 286 Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200413082043.22468-1-yanaijie@huawei.com commit 99cd87d63c0b0724a8e4f1405107ca06c10341e8 Author: Jason Yan Date: Mon Apr 13 16:20:22 2020 +0800 libertas: make lbs_process_event() void Fix the following coccicheck warning: drivers/net/wireless/marvell/libertas/cmdresp.c:225:5-8: Unneeded variable: "ret". Return "0" on line 355 Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200413082022.22380-1-yanaijie@huawei.com commit 40fb232c02d1b012c6c84b8c22465d01e20eddf9 Author: Jules Irenge Date: Sat Apr 11 01:19:29 2020 +0100 brcmsmac: Add missing annotation for brcms_down() Sparse reports a warning at brcms_down() warning: context imbalance in brcms_down() - unexpected unlock The root cause is the missing annotation at brcms_down() Add the missing __must_hold(&wl->lock) annotation Signed-off-by: Jules Irenge Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200411001933.10072-6-jbi.octave@gmail.com commit 2fe5efb8a475c856cd72a37fd73d82f5b5b563e0 Author: Jules Irenge Date: Sat Apr 11 01:19:28 2020 +0100 brcmsmac: Add missing annotation for brcms_rfkill_set_hw_state() Sparse reports a warning at brcms_rfkill_set_hw_state() warning: context imbalance in brcms_rfkill_set_hw_state() - unexpected unlock The root cause is the missing annotation at brcms_rfkill_set_hw_state() Add the missing __must_hold(&wl->lock) annotation Signed-off-by: Jules Irenge Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200411001933.10072-5-jbi.octave@gmail.com commit 1c0e3c73e98dd55bc9551279fed6233997425c23 Author: Jules Irenge Date: Sat Apr 11 01:19:27 2020 +0100 hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop Sparse reports warnings at prism2_bss_list_proc_start() and prism2_bss_list_proc_stop() warning: context imbalance in prism2_wds_proc_stop() - unexpected unlock warning: context imbalance in prism2_bss_list_proc_start() - wrong count at exit The root cause is the missing annotations at prism2_bss_list_proc_start() Add the missing __acquires(&local->lock) annotation Add the missing __releases(&local->lock) annotation Signed-off-by: Jules Irenge Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200411001933.10072-4-jbi.octave@gmail.com commit 297bcf8222f222fd7defead862de4b8e3ea0b08a Author: Yan-Hsuan Chuang Date: Fri Apr 10 18:09:50 2020 +0800 rtw88: add support for set/get antennas User space program such as iw can set antenna mask for the device. So add set antenna support by configure the trx mode. This is useful for some tests want to see the output of different antenna configuration (e.g. path A v.s. path B). Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410100950.3199-3-yhchuang@realtek.com commit b9ed7e9505ba6346a101384d21ddd1139ae69eef Author: Yan-Hsuan Chuang Date: Fri Apr 10 18:09:49 2020 +0800 rtw88: make rtw_chip_ops::set_antenna return int To support ieee80211_ops::set_antenna, the driver can decide if the antenna mask is accepted, otherwise it can return an error code. Because each chip could have different limitations, let the chip check the mask and return. Also the antenna mask for TRX from upper space is 32-bit long. Change the antenna mask for rtw_chip_ops::set_antenna from u8 to u32. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410100950.3199-2-yhchuang@realtek.com commit 818227321d331c583c4563a8275eb187b98475df Author: Michal Simek Date: Tue Feb 25 10:00:26 2020 +0100 arm64: zynqmp: Fix GIC compatible property dtbs_check is showing warning around GIC compatible property as interrupt-controller@f9010000: compatible: ['arm,gic-400', 'arm,cortex-a15-gic'] is not valid under any of the given schemas Similar change has been done also by commit 5400cdc1410b ("ARM: dts: sunxi: Fix GIC compatible") Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/a50412fbb520954e4602f274f19a7ffbd1154ead.1582621224.git.michal.simek@xilinx.com commit 2fd5fdca6a3ae0d7333c086e019ba6c4330fa0a8 Author: Jason Yan Date: Fri Apr 10 17:09:42 2020 +0800 libertas: make lbs_init_mesh() void Fix the following coccicheck warning: drivers/net/wireless/marvell/libertas/mesh.c:833:5-8: Unneeded variable: "ret". Return "0" on line 874 Reported-by: Hulk Robot Signed-off-by: Jason Yan Reviewed-by: Lubomir Rintel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410090942.27239-1-yanaijie@huawei.com commit 80efb443ea0346791a79dade0e65c4a252f0571f Author: Jason Yan Date: Fri Apr 10 17:09:10 2020 +0800 cw1200: make cw1200_spi_irq_unsubscribe() void Fix the following coccicheck warning: drivers/net/wireless/st/cw1200/cw1200_spi.c:273:5-8: Unneeded variable: "ret". Return "0" on line 279 Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410090910.27132-1-yanaijie@huawei.com commit a69a1328fb03309555d70f4add76eae3780a6fba Author: Jason Yan Date: Fri Apr 10 17:08:50 2020 +0800 ipw2x00: make ipw_qos_association_resp() void Fix the following coccicheck warning: drivers/net/wireless/intel/ipw2x00/ipw2200.c:7048:5-8: Unneeded variable: "ret". Return "0" on line 7055 Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410090850.27025-1-yanaijie@huawei.com commit 3e8f3bd047163d30fb1ad32ca7e4628921555c09 Author: Thomas Ebeling Date: Tue Apr 14 23:10:29 2020 +0200 ALSA: usb-audio: RME Babyface Pro mixer patch Added mixer quirks to allow controlling the internal DSP of the RME Babyface Pro and its successor Babyface Pro FS. Signed-off-by: Thomas Ebeling Link: https://lore.kernel.org/r/20200414211019.qprg7whepg2y7nei@bollie.ca9.eu Signed-off-by: Takashi Iwai commit d687275b268b09c350b24b1947d1bf3496f49137 Author: Sriram R Date: Mon Apr 13 18:27:02 2020 +0530 ath11k: Add dynamic tcl ring selection logic with retry mechanism IPQ8074 HW supports three TCL rings for tx. Currently these rings are mapped based on the Access categories, viz. VO, VI, BE, BK. In case, one of the traffic type dominates, then it could stress the same tcl rings. Rather, it would be optimal to make use of all the rings in a round robin fashion irrespective of the traffic type so that the load could be evenly distributed among all the rings. Also, in case the selected ring is busy or full, a retry mechanism is used to ensure other available ring is selected without dropping the packet. In SMP systems, this change avoids a single CPU from getting hogged when heavy traffic of same category is transmitted. The tx completion interrupts corresponding to the used tcl ring would be more which causes the assigned CPU to get hogged. Distribution of tx packets to different tcl rings helps balance this load. Signed-off-by: Sriram R Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586782622-22570-1-git-send-email-srirrama@codeaurora.org commit 8e5b5d75e9d0a6d75e554047ad5c8d2c935447d4 Author: Mauro Carvalho Chehab Date: Wed Apr 15 10:06:59 2020 +0200 media: Kconfig: DVB support should be enabled for Digital TV As we reverted changeset 85f7cd3a2aad ("Revert "media: Kconfig: better support hybrid TV devices""), we should add a default to DVB_CORE, as otherwise DVB support won't work. Fixes: 85f7cd3a2aad ("Revert "media: Kconfig: better support hybrid TV devices"") Signed-off-by: Mauro Carvalho Chehab commit e190bc05b191ff62157ca63322aedd14c7e87d32 Author: Govindaraj Saminathan Date: Mon Apr 13 16:51:12 2020 +0530 ath11k: cleanup reo command error code overwritten should not overwrite the error code. No buffer available then return invalid. For other failures return the error code of actual failure. Signed-off-by: Govindaraj Saminathan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586776872-25766-1-git-send-email-gsamin@codeaurora.org commit 8a7968bee8d08835caa0d7bc0c25d750a5b52389 Author: Mamatha Telu Date: Sun Apr 12 23:54:35 2020 +0530 ath10k: Fix typo in warning messages Fix some typo: s/fnrom/from s/pkgs/pkts/ s/AMSUs/AMSDUs/ Signed-off-by: Mamatha Telu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586715875-5182-1-git-send-email-telumamatha36@gmail.com commit ec48d28ba291943d4ae2f873a4330debddecbca6 Author: Maharaja Kennadyrajan Date: Fri Apr 10 22:36:45 2020 +0530 ath11k: Fix rx_filter flags setting for per peer rx_stats Rx_filter flags are set with default filter flags during wifi up/down sequence even though the 'ext_rx_stats' debugfs is enabled as 1. So, that we are not getting proper per peer rx_stats. Hence, fixing this by setting the missing rx_filter when ext_rx_stats is already set/enabled. Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586538405-16226-3-git-send-email-mkenna@codeaurora.org commit 40c766d4a49cdfe30e0fb40825321b4d4de651aa Author: Ritesh Singh Date: Fri Apr 10 22:36:44 2020 +0530 ath11k: Fix fw assert by setting proper vht cap After setting fixed vht-rate if new station is trying to assoc with mu_bfee cap, or if a sta is already connected with mu_bfee cap then set the fixed vht-rate and reconnecting the sta, FW assert is happening. So to avoid this, reset the MU_BEAMFORMEE bit in vht->caps, if mcs_index is invalid for nss 1. Signed-off-by: Ritesh Singh Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586538405-16226-2-git-send-email-mkenna@codeaurora.org commit 11ddbdfb68e4f9791e4bd4f8d7c87d3f19670967 Author: Dan Carpenter Date: Tue Apr 7 12:28:52 2020 +0300 rtc: rc5t619: Fix an ERR_PTR vs NULL check The devm_kzalloc() function returns NULL on error, it doesn't return error pointers so this check doesn't work. Fixes: 540d1e15393d ("rtc: rc5t619: Add Ricoh RC5T619 RTC driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200407092852.GI68494@mwanda Signed-off-by: Alexandre Belloni commit 6fc3b94ef5964736408cd4f8e85a816dcf1dd510 Author: Maharaja Kennadyrajan Date: Fri Apr 10 22:36:43 2020 +0530 ath11k: Cleanup in pdev destroy and mac register during crash on recovery Debugfs pdev entries should be cleaned up during the crash on recovery. If not, mac register will fail for the reason that it is already registered during core reconfigure. Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586538405-16226-1-git-send-email-mkenna@codeaurora.org commit 944ed452eb1b4241c8bd693b8b689fe8b888c445 Author: Markus Elfring Date: Sun Apr 5 17:30:15 2020 +0200 rtc: remove unnecessary error message after platform_get_irq The function “platform_get_irq” can log an error already. Thus omit redundant messages for the exception handling in the calling functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Vladimir Zapolskiy Link: https://lore.kernel.org/r/04116352-b464-041c-1939-96440133aa6f@web.de Signed-off-by: Alexandre Belloni commit 9393d050c860a8f03f1e04d380653d23c7911c90 Author: Mauro Carvalho Chehab Date: Wed Apr 15 09:46:06 2020 +0200 Revert "media: Kconfig: move CEC-specific options to cec/Kconfig" The CEC_CORE symbols are selected by DRM, and should be independent of MEDIA_SUPPORT. Fixes this warning when doing "make multi_v7_defconfig": WARNING: unmet direct dependencies detected for CEC_CORE Depends on [m]: MEDIA_SUPPORT [=m] Selected by [y]: - DRM_TEGRA [=y] && HAS_IOMEM [=y] && (ARCH_TEGRA [=y] || ARM [=y] && COMPILE_TEST [=n]) && COMMON_CLK [=y] && DRM [=y] && OF [=y] && CEC_NOTIFIER [=y] Selected by [m]: - VIDEO_SAMSUNG_S5P_CEC [=m] && MEDIA_SUPPORT [=m] && MEDIA_PLATFORM_SUPPORT [=y] && CEC_PLATFORM_DRIVERS [=y] && (ARCH_EXYNOS [=y] || COMPILE_TEST [=n]) - DRM_EXYNOS_HDMI [=y] && HAS_IOMEM [=y] && DRM_EXYNOS [=m] && (DRM_EXYNOS_MIXER [=y] || DRM_EXYNOS5433_DECON [=n]) && CEC_NOTIFIER [=y] - DRM_I2C_ADV7511_CEC [=y] && HAS_IOMEM [=y] && DRM [=y] && DRM_BRIDGE [=y] && DRM_I2C_ADV7511 [=m] - DRM_DW_HDMI [=m] && HAS_IOMEM [=y] && DRM [=y] && DRM_BRIDGE [=y] && CEC_NOTIFIER [=y] This reverts commit f1991411257bdb68d96ef8c8c5b35f412b480375. Reported-by: Stephen Rothwell Signed-off-by: Mauro Carvalho Chehab commit e5e113079efdffb9a39e16a88d109c3d47efdfcc Author: Yan Zhao Date: Tue Apr 14 23:58:27 2020 -0400 drm/i915/gvt: combine access to consecutive guest context pages IOVA(GPA)s of context pages are checked and if they are consecutive, read/write them together in one intel_gvt_hypervisor_read_gpa() / intel_gvt_hypervisor_write_gpa(). Signed-off-by: Yan Zhao Reviewed-by: Zhenyu Wang Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200415035827.26476-1-yan.y.zhao@intel.com commit 6c2f73e26a253ae827d9754572bfee4a912e559c Author: Yan Zhao Date: Tue Apr 14 23:57:28 2020 -0400 drm/i915/gvt: access shadow ctx via its virtual address directly as shadow context is pinned in intel_vgpu_setup_submission() and unpinned in intel_vgpu_clean_submission(), its base virtual address of is safely obtained from lrc_reg_state. no need to call kmap()/kunmap() repeatedly. Signed-off-by: Yan Zhao Reviewed-by: Zhenyu Wang Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200415035728.26424-1-yan.y.zhao@intel.com commit 9d33ea331032332882d4cc1a38a9d0e237126bd0 Author: Prashant Malani Date: Tue Apr 14 22:29:43 2020 -0700 platform/chrome: cros_ec_typec: Register port partner Register (and unregister) the port partner when a connect (and disconnect) is detected. Co-developed-by: Jon Flatley Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus Signed-off-by: Enric Balletbo i Serra commit 5fed73b84f52a0595cc3f11b6f4fd3746a797e34 Author: Prashant Malani Date: Tue Apr 14 22:29:42 2020 -0700 platform/chrome: cros_ec_typec: Add struct for port data Add a separate struct for storing port data, including Type C connector class struct pointers and caps. Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus Signed-off-by: Enric Balletbo i Serra commit 7110f5f0e5ab329b6ed840c06e7321bbf331ccf5 Author: Prashant Malani Date: Tue Apr 14 22:29:41 2020 -0700 platform/chrome: cros_ec_typec: Use notifier for updates Register a listener for the cros-usbpd-notifier, and update port state when a notification comes in. Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus Signed-off-by: Enric Balletbo i Serra commit 1e4ffb8344c53b3d8297c9591c59debe4406e6cb Author: Jules Irenge Date: Sat Apr 11 01:19:30 2020 +0100 scsi: libsas: Add missing annotation for sas_ata_qc_issue() Sparse reports a warning at sas_ata_qc_issue() warning: context imbalance in sas_ata_qc_issue() - unexpected unlock The root cause is the missing annotation at sas_ata_qc_issue() Add the missing __must_hold(ap->lock) annotation Link: https://lore.kernel.org/r/20200411001933.10072-7-jbi.octave@gmail.com Reviewed-by: John Garry Signed-off-by: Jules Irenge Signed-off-by: Martin K. Petersen commit 4a0b746fa9a7e7936fa4511116aab5a98d1af49a Author: Jason Yan Date: Mon Apr 13 16:28:22 2020 +0800 scsi: ipr: remove unneeded semicolon Fix the following coccicheck warning: drivers/scsi/ipr.c:1167:2-3: Unneeded semicolon Link: https://lore.kernel.org/r/20200413082822.24356-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 5d296cc9ab6e5cafaef2f81e1376320a6b6de50b Author: Jason Yan Date: Thu Apr 9 16:49:10 2020 +0800 scsi: qla1280: make qla1280_firmware_mutex and qla1280_fw_tbl static Fix the following sparse warning: drivers/scsi/qla1280.c:529:1: warning: symbol 'qla1280_firmware_mutex' was not declared. Should it be static? drivers/scsi/qla1280.c:538:15: warning: symbol 'qla1280_fw_tbl' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200409084910.44336-1-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 1909a4386c7e66d307e9c4383efb2d598a475b0e Author: Jason Yan Date: Tue Apr 7 17:28:27 2020 +0800 scsi: megaraid: make two symbols static in megaraid_sas_base.c Fix the following sparse warning: drivers/scsi/megaraid/megaraid_sas_base.c:84:5: warning: symbol 'rdpq_enable' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_base.c:92:14: warning: symbol 'scmd_timeout' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407092827.18074-5-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 057d1c0d1b03707bffb8c54c2ca104b049d1ce5d Author: Jason Yan Date: Tue Apr 7 17:28:26 2020 +0800 scsi: megaraid: make some symbols static in megaraid_sas_fusion.c Fix the following sparse warning: drivers/scsi/megaraid/megaraid_sas_fusion.c:180:1: warning: symbol 'megasas_enable_intr_fusion' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fusion.c:202:1: warning: symbol 'megasas_disable_intr_fusion' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fusion.c:4233:6: warning: symbol 'megasas_refire_mgmt_cmd' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407092827.18074-4-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 3c3c6f663baa5d2089771697829de19a43f93f0b Author: Jason Yan Date: Tue Apr 7 17:28:25 2020 +0800 scsi: megaraid: make some symbols static in megaraid_sas_fp.c Fix the following sparse warning: drivers/scsi/megaraid/megaraid_sas_fp.c:88:5: warning: symbol 'mega_div64_32' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fp.c:370:5: warning: symbol 'MR_GetSpanBlock' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fp.c:420:5: warning: symbol 'mr_spanset_get_span_block' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fp.c:645:4: warning: symbol 'get_arm' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fp.c:788:4: warning: symbol 'MR_GetPhyParams' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_sas_fp.c:1345:4: warning: symbol 'megasas_get_best_arm_pd' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407092827.18074-3-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 02ff107046e0fe469a62cabea4a583d88dd34839 Author: Jason Yan Date: Tue Apr 7 17:28:24 2020 +0800 scsi: megaraid: make two symbols static in megaraid_mbox.c Fix the following sparse warning: drivers/scsi/megaraid/megaraid_mbox.c:305:5: warning: symbol 'dev_attr_megaraid_mbox_app_hndl' was not declared. Should it be static? drivers/scsi/megaraid/megaraid_mbox.c:315:5: warning: symbol 'dev_attr_megaraid_mbox_ld' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407092827.18074-2-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 4d5956fb5137423dc916994b632aff942454f23b Author: Jason Yan Date: Tue Apr 7 11:22:02 2020 +0800 scsi: bfa: bfad.c: make max_rport_logins static Fix the following sparse warning: drivers/scsi/bfa/bfad.c:53:17: warning: symbol 'max_rport_logins' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-8-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 938b18462ecd8b47e2852cad676516031b315edb Author: Jason Yan Date: Tue Apr 7 11:22:01 2020 +0800 scsi: bfa: bfad_attr.c: make two funcitons static Fix the following sparse warning: drivers/scsi/bfa/bfad_attr.c:441:1: warning: symbol 'bfad_im_issue_fc_host_lip' was not declared. Should it be static? drivers/scsi/bfa/bfad_attr.c:566:1: warning: symbol 'bfad_im_vport_set_symbolic_name' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-7-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit eae9b1788ab2418a96466e096a2fdb1c40848e11 Author: Jason Yan Date: Tue Apr 7 11:22:00 2020 +0800 scsi: bfa: bfa_ioc_ct.c: make two funcitons static Fix the following sparse warning: drivers/scsi/bfa/bfa_ioc_ct.c:368:1: warning: symbol 'bfa_ioc_ct2_lpu_read_stat' was not declared. Should it be static? drivers/scsi/bfa/bfa_ioc_ct.c:748:1: warning: symbol 'bfa_ioc_ct2_mac_reset' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-6-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 901ad27c6998817b2b6abeb55f9b24cf189cbcfe Author: Jason Yan Date: Tue Apr 7 11:21:59 2020 +0800 scsi: bfa: bfa_fcs_lport.c: make bfa_fcport_get_loop_attr() static Fix the following sparse warning: drivers/scsi/bfa/bfa_fcs_lport.c:1287:1: warning: symbol 'bfa_fcport_get_loop_attr' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-5-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 84a2fd236d75bb72d44d56192f21f627f0421853 Author: Jason Yan Date: Tue Apr 7 11:21:58 2020 +0800 scsi: bfa: bfa_fcpim.c: make two functions static Fix the following sparse warning: drivers/scsi/bfa/bfa_fcpim.c:440:1: warning: symbol 'bfa_ioim_profile_comp' was not declared. Should it be static? drivers/scsi/bfa/bfa_fcpim.c:457:1: warning: symbol 'bfa_ioim_profile_start' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-4-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit b9ddee1ee15f0dc17cdb919cadf837cd6429d7a1 Author: Jason Yan Date: Tue Apr 7 11:21:57 2020 +0800 scsi: bfa: bfa_core.c: make bfa_isr_rspq() static Fix the following sparse warning: drivers/scsi/bfa/bfa_core.c:712:1: warning: symbol 'bfa_isr_rspq' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-3-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 037773f3b6dd9559a02315047f61eee7b7c96011 Author: Jason Yan Date: Tue Apr 7 11:21:56 2020 +0800 scsi: bfa: bfa_svc.c: make two functions static Fix the following sparse warning: drivers/scsi/bfa/bfa_svc.c:4288:1: warning: symbol 'bfa_fcport_ddportenable' was not declared. Should it be static? drivers/scsi/bfa/bfa_svc.c:4297:1: warning: symbol 'bfa_fcport_ddportdisable' was not declared. Should it be static? Link: https://lore.kernel.org/r/20200407032202.36789-2-yanaijie@huawei.com Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit 78e8df28c5c3063a14669c5e029de8aa176a8389 Author: Wang Hai Date: Tue Apr 7 12:21:14 2020 -0400 scsi: gdth: Make __gdth_execute static Fix sparse warning: drivers/scsi/gdth.c:332:5: warning: symbol '__gdth_execute' was not declared. Should it be static? Link: https://lore.kernel.org/r/1586276474-34480-1-git-send-email-wanghai38@huawei.com Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Martin K. Petersen commit d221aed19c80d83c2de2fa5e8a5ba045065c6d4b Author: Bart Van Assche Date: Sun Apr 12 19:13:59 2020 -0700 scsi: qla2xxx: Use ARRAY_SIZE() instead of open-coding it This patch does not change any functionality. Link: https://lore.kernel.org/r/20200413021359.21725-1-bvanassche@acm.org Cc: Nilesh Javali Cc: Quinn Tran Cc: Himanshu Madhani Cc: Martin Wilck Cc: Daniel Wagner Cc: Roman Bolshakov Reviewed-by: Daniel Wagner Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 57f25e1cf00d4c1ae051b608de9a1db3c3a9fb74 Author: Nick Reitemeyer Date: Mon Apr 6 16:13:49 2020 +0200 dt-bindings: vendor-prefixes: Add Alps Alps Electric Co., Ltd. is a japanese electronics company: https://www.alps.com/ Signed-off-by: Nick Reitemeyer Reviewed-by: Stephan Gerhold Tested-by: Stephan Gerhold Reviewed-by: Linus Walleij Reviewed-by: Linus Walleij Tested-by: Linus Walleij Signed-off-by: Rob Herring commit 88986987c76f0f832ee61e34ac95341dcef5a119 Author: Krzysztof Kozlowski Date: Mon Apr 6 12:45:54 2020 +0200 dt-bindings: memory-controllers: exynos-srom: Remove unneeded type for reg-io-width 'reg-io-width' property is an enum so there is no need to specify its type. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring commit dd302ee41e6ed204f8d9534d511edc72b5ce5e53 Author: Leon Romanovsky Date: Mon Apr 13 16:23:23 2020 +0300 RDMA/cma: Limit the scope of rdma_is_consumer_reject function The function is local to cma.c, so let's limit its scope. Link: https://lore.kernel.org/r/20200413132323.930869-1-leon@kernel.org Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f29808b2fb85a7ff2d4830aa1cb736c8c9b986f4 Author: John Stultz Date: Thu Mar 26 22:44:57 2020 +0000 soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38) So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Acked-by: Saravana Kannan Tested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz Link: https://lore.kernel.org/r/20200326224459.105170-2-john.stultz@linaro.org Signed-off-by: Bjorn Andersson commit d4889ec1fc6ac6321cc1e8b35bb656f970926a09 Author: John Stultz Date: Thu Mar 26 22:44:59 2020 +0000 soc: qcom: rpmhpd: Allow RPMHPD driver to be loaded as a module This patch allow the rpmhpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Acked-by: Saravana Kannan Tested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz Link: https://lore.kernel.org/r/20200326224459.105170-4-john.stultz@linaro.org Signed-off-by: Bjorn Andersson commit 1d3c6f86fd3f8b88c707f56d8c3f94e014b40e83 Author: John Stultz Date: Thu Mar 26 22:44:58 2020 +0000 soc: qcom: rpmh: Allow RPMH driver to be loaded as a module This patch allow the rpmh driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but the rpmh driver is fairly core to the system, so once its loaded with almost anythign else to get the system to go, the dependencies are not likely to ever also be removed. So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Acked-by: Saravana Kannan Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Tested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz Link: https://lore.kernel.org/r/20200326224459.105170-3-john.stultz@linaro.org Signed-off-by: Bjorn Andersson commit 4a7b0cf24d9a1d3c598152cdffefec3c363ee438 Author: Sandeep Maheswaram Date: Mon Mar 9 15:23:09 2020 +0530 arm64: dts: qcom: sc7180: Update QUSB2 V2 Phy params for SC7180 IDP device Overriding the QUSB2 V2 Phy tuning parameters for SC7180 IDP device. Signed-off-by: Sandeep Maheswaram Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1583747589-17267-10-git-send-email-sanm@codeaurora.org Signed-off-by: Bjorn Andersson commit 4b8503967ef5d1123d6e0a87d5723bdaeddf8b3f Author: Zou Wei Date: Tue Apr 14 16:18:07 2020 +0800 selinux: fix warning Comparison to bool fix below warnings reported by coccicheck security/selinux/ss/mls.c:539:39-43: WARNING: Comparison to bool security/selinux/ss/services.c:1815:46-50: WARNING: Comparison to bool security/selinux/ss/services.c:1827:46-50: WARNING: Comparison to bool Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Paul Moore commit 8ce111d00e64b52e7c77a5956434384e906f7394 Author: Devesh Sharma Date: Thu Apr 2 14:12:15 2020 -0400 RDMA/bnxt_re: Remove dead code from rcfw In the previous refactoring serise there were few leftover functions which are not is use anymore. Removed them as it is a dead code. Fixes: 6f53196bc5e7 ("RDMA/bnxt_re: Refactor doorbell management functions") Link: https://lore.kernel.org/r/1585851136-2316-5-git-send-email-devesh.sharma@broadcom.com Signed-off-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit fddcbbb02af42a5d6ec0c6ed38f823cc9dba1414 Author: Devesh Sharma Date: Thu Apr 2 14:12:14 2020 -0400 RDMA/bnxt_re: Simplify obtaining queue entry from hw ring Restructring the data path and control path queue management code to simplify the way a queue element is extracted from the hardware ring. Introduced a new function which will give a pointer to the next ring item depending upon the current cons/prod index in the hardware queue. Further, there are hardcoding when size of queue entry is calculated, replacing it with an inline function. This function would be easier to expand if need going forward. The code section to initialize the PSN search areas has also been restructured and couple of functions has been added there. Link: https://lore.kernel.org/r/1585851136-2316-4-git-send-email-devesh.sharma@broadcom.com Signed-off-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit c78671a4e65ae0b2e639ea61b4c65842c4200f2d Author: Devesh Sharma Date: Thu Apr 2 14:12:13 2020 -0400 RDMA/bnxt_re: Update missing hsi data structures Adding fast path support data structure into hardware HSI. These structures are header only definition of RQE/SRQE/SQE. This is to help calculating the size of hardware wqe size. Link: https://lore.kernel.org/r/1585851136-2316-3-git-send-email-devesh.sharma@broadcom.com Signed-off-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit 99bf84e24eb83d1612598cee1807732bd194c23c Author: Devesh Sharma Date: Thu Apr 2 14:12:12 2020 -0400 RDMA/bnxt_re: Reduce device page size detection code Getting rid of the repeated code in the driver when deciding on the page size of the hardware ring memory. A new common function would translate the ring page size into device specific page size. Link: https://lore.kernel.org/r/1585851136-2316-2-git-send-email-devesh.sharma@broadcom.com Signed-off-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit 4f953089111d45d0e654080a1f2edec39f197c93 Author: Zou Wei Date: Mon Apr 13 10:42:04 2020 +0800 IB/qib: Remove unused variable ret This patch fixes below warnings reported by coccicheck drivers/infiniband/hw/qib/qib_iba7322.c:6878:8-11: Unneeded variable: "ret". Return "0" on line 6907 drivers/infiniband/hw/qib/qib_iba7322.c:2378:5-8: Unneeded variable: "ret". Return "0" on line 2513 Link: https://lore.kernel.org/r/1586745724-107477-1-git-send-email-zou_wei@huawei.com Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Jason Gunthorpe commit 255e636df4133507254da13137e8d8524ef0794f Author: Mauro Carvalho Chehab Date: Tue Apr 14 18:48:43 2020 +0200 IB: Fix some documentation warnings Parsing verbs.c with kernel-doc produce some warnings: ./drivers/infiniband/core/verbs.c:2579: WARNING: Unexpected indentation. ./drivers/infiniband/core/verbs.c:2581: WARNING: Block quote ends without a blank line; unexpected unindent. ./drivers/infiniband/core/verbs.c:2613: WARNING: Unexpected indentation. ./drivers/infiniband/core/verbs.c:2579: WARNING: Unexpected indentation. ./drivers/infiniband/core/verbs.c:2581: WARNING: Block quote ends without a blank line; unexpected unindent. ./drivers/infiniband/core/verbs.c:2613: WARNING: Unexpected indentation. Address them by adding an extra blank line and converting the parameters on one of the arguments to a table. Link: https://lore.kernel.org/r/4c5466d0f450c5a9952138150c3485740b37f9c5.1586881715.git.mchehab+huawei@kernel.org Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jason Gunthorpe commit 860b511766a3d95308a942ac09a34e4d1839e706 Author: Helen Koike Date: Tue Apr 14 16:02:38 2020 -0300 media: Makefile: fix test drivers compilation test_drivers/ folder is not being added by media Makefile, so it is not being compiled. Add test_drivers/ folder in Makefile folder's list. Fixes: 4b32216adb010 ("media: split test drivers from platform directory") Signed-off-by: Helen Koike Signed-off-by: Mauro Carvalho Chehab commit 1587982e705db1ac090b05a7006771c78d0e8417 Author: Jason Gunthorpe Date: Tue Apr 7 20:20:09 2020 -0300 RDMA: Remove a few extra calls to ib_get_client_data() These four places already have easy access to the client data, just use that instead. Link: https://lore.kernel.org/r/0-v1-fae83f600b4a+68-less_get_client_data%25jgg@mellanox.com Acked-by: Ursula Braun Signed-off-by: Jason Gunthorpe commit eb356e6dc15a30af604f052cd0e170450193c254 Author: Jason Gunthorpe Date: Mon Apr 6 21:44:26 2020 -0300 RDMA/uverbs: Make the event_queue fds return POLLERR when disassociated If is_closed is set, and the event list is empty, then read() will return -EIO without blocking. After setting is_closed in ib_uverbs_free_event_queue(), we do trigger a wake_up on the poll_wait, but the fops->poll() function does not check it, so poll will continue to sleep on an empty list. Fixes: 14e23bd6d221 ("RDMA/core: Fix locking in ib_uverbs_event_read") Link: https://lore.kernel.org/r/0-v1-ace813388969+48859-uverbs_poll_fix%25jgg@mellanox.com Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cf26deff9036cd3270af562dbec545239e5c7f07 Author: Yishai Hadas Date: Mon Apr 6 20:35:40 2020 +0300 RDMA/mlx5: Fix udata response upon SRQ creation Fix udata response upon SRQ creation to use the UAPI structure (i.e. mlx5_ib_create_srq_resp). It did not zero the reserved field in userspace. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Link: https://lore.kernel.org/r/20200406173540.1466477-1-leon@kernel.org Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0184afd15a141d7ce24c32c0d86a1e3ba6bc0eb3 Author: Zhu Yanjun Date: Mon Apr 6 20:35:01 2020 +0300 RDMA/rxe: Set default vendor ID The RXE driver doesn't set vendor_id and user space applications see zeros. This causes to pyverbs tests to fail with the following traceback, because the expectation is to have valid vendor_id. Traceback (most recent call last): File "tests/test_device.py", line 51, in test_query_device self.verify_device_attr(attr) File "tests/test_device.py", line 77, in verify_device_attr assert attr.vendor_id != 0 In order to fix it, we will set vendor_id 0XFFFFFF, according to the IBTA v1.4 A3.3.1 VENDOR INFORMATION section. """ A vendor that produces a generic controller (i.e., one that supports a standard I/O protocol such as SRP), which does not have vendor specific device drivers, may use the value of 0xFFFFFF in the VendorID field. """ Before: hca_id: rxe0 transport: InfiniBand (0) fw_ver: 0.0.0 node_guid: 5054:00ff:feaa:5363 sys_image_guid: 5054:00ff:feaa:5363 vendor_id: 0x0000 After: hca_id: rxe0 transport: InfiniBand (0) fw_ver: 0.0.0 node_guid: 5054:00ff:feaa:5363 sys_image_guid: 5054:00ff:feaa:5363 vendor_id: 0xffffff Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20200406173501.1466273-1-leon@kernel.org Signed-off-by: Zhu Yanjun Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9a2506b1a29c97fabb000d89ff97b6f57668f2a2 Author: Drew Fustini Date: Fri Apr 3 21:19:31 2020 +0200 dt-bindings: Add vendor prefix for BeagleBoard.org Add vendor prefix for BeagleBoard.org Foundation Signed-off-by: Jason Kridner Signed-off-by: Drew Fustini Signed-off-by: Rob Herring commit eb57a2988abcad94c3bd1dd15142c11aa2f6442c Author: Christophe Roullier Date: Fri Apr 3 16:04:15 2020 +0200 dt-bindings: net: dwmac: Convert stm32 dwmac to DT schema Convert stm32 dwmac to DT schema. Signed-off-by: Christophe Roullier [robh: drop dma-ranges from example] Signed-off-by: Rob Herring commit f22531438ff42ce568f81e346428461c71dea9e2 Author: Christophe Roullier Date: Fri Apr 3 16:04:14 2020 +0200 dt-bindings: net: dwmac: increase 'maxItems' for 'clocks', 'clock-names' properties This change is needed for some soc based on snps,dwmac, which have more than 3 clocks. Signed-off-by: Christophe Roullier Signed-off-by: Rob Herring commit 0fa007c1e8c25de61a48dffc476425f706fe0421 Author: Sandeep Maheswaram Date: Mon Mar 9 15:23:07 2020 +0530 arm64: dts: qcom: sc7180: Add generic QUSB2 V2 Phy compatible Use generic QUSB2 V2 Phy configuration for SC7180. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1583747589-17267-8-git-send-email-sanm@codeaurora.org Signed-off-by: Bjorn Andersson commit d724b42ededb9a07f8f39b18aaf7fda74a561495 Author: Sandeep Maheswaram Date: Mon Mar 9 15:23:08 2020 +0530 arm64: dts: qcom: sdm845: Add generic QUSB2 V2 Phy compatible Use generic QUSB2 V2 Phy configuration for sdm845. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1583747589-17267-9-git-send-email-sanm@codeaurora.org Signed-off-by: Bjorn Andersson commit 78f022d08006b4a641351ec74aef9b084ad50964 Author: Iskren Chernev Date: Tue Apr 14 20:22:49 2020 +0300 regulator: Document bindings for max77826 Add device tree binding information for max77826 regulator driver. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20200414172250.2363235-3-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit e7314653dc08efbf3c6a17fff7290cf2d89ea03b Author: Iskren Chernev Date: Tue Apr 14 20:22:48 2020 +0300 regulator: max77826: Add max77826 regulator driver Adding regulator driver for the Maxim max77826 device. The max77826 PMIC contains a high-efficiency BUCK regulator, a BUCK BOOST regulator and 15 LDOs. It is designed for smartphone and tablet applications and is accessed over I2C. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20200414172250.2363235-2-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 21fb1f41bcdf436f6969f4651dce0df62985f69a Author: Aishwarya R Date: Mon Apr 6 21:23:01 2020 +0530 spi: spi-sh-msiof: Fix checkpatch error Complex macros should use () Fixed checkpatch error "Macros with complex values should be enclosed in parentheses" Signed-off-by: Aishwarya R Link: https://lore.kernel.org/r/20200406155301.21768-1-raishwar@visteon.com Signed-off-by: Mark Brown commit afedb4b7282b4c532d8aea105943e71c0efb3a6b Author: Jason Yan Date: Thu Apr 9 16:50:09 2020 +0800 spi: spi-mtk-nor: make mtk_nor_exec_op() statuc Fix the following sparse warning: drivers/spi/spi-mtk-nor.c:394:5: warning: symbol 'mtk_nor_exec_op' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200409085009.44971-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit bb4bf8d2f4e0fdf64e43bb3a3186e04891b8a8e1 Author: Baolin Wang Date: Mon Apr 13 14:30:25 2020 +0800 spi: sprd: adi: Use IS_ENABLED() to validate configs If the Spreadtrum wachdog is loaded as a module, we still need set default watchdog reboot mode in case the rebooting is caused by watchdog. But now we can not set the watchdog reboot mode by using '#ifdef' to validate the watchdog configuration, thus we can change to use IS_ENABLED() to fix this issue. Signed-off-by: Baolin Wang Link: https://lore.kernel.org/r/e38807eadd5550add8eb90dd3f8fbe2cfc39cc13.1586759322.git.baolin.wang7@gmail.com Signed-off-by: Mark Brown commit 49686df5b874e5ed6249bc622b73ad9a9e71cd99 Author: Colin Ian King Date: Fri Apr 10 13:23:15 2020 +0100 spi: remove redundant assignment to variable ms The variable ms is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King Reviewed-by: Geert Uytterhoeven Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20200410122315.17523-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 7cb88afb42a49e5a6d51d458ffbb3d02e2c0755c Author: Aishwarya R Date: Tue Apr 7 17:58:55 2020 +0530 spi: spi-fsl-spi: Fix checkpatch error "foo * bar" should be "foo *bar" This patch fixes checkpatch error "foo * bar" should be "foo *bar" Signed-off-by: Aishwarya R Link: https://lore.kernel.org/r/20200407122855.5531-1-aishwaryarj100@gmail.com Signed-off-by: Mark Brown commit 0b93dd98d6d5ba93f834113994dbc8f291447dae Author: Tiezhu Yang Date: Tue Apr 7 11:35:12 2020 +0800 spi: spidev_test: Remove hidden temporary file when make clean In the current code, it only removes *.o and .*.o.d file when make clean, there still exists useless .*.o.cmd file, just remove it. Without this patch: [yangtiezhu@linux spi]$ make [yangtiezhu@linux spi]$ make clean [yangtiezhu@linux spi]$ ls -1 .*.o.cmd .spidev_fdx-in.o.cmd .spidev_fdx.o.cmd .spidev_test-in.o.cmd .spidev_test.o.cmd With this patch: [yangtiezhu@linux spi]$ make [yangtiezhu@linux spi]$ make clean [yangtiezhu@linux spi]$ ls -1 .*.o.cmd ls: cannot access .*.o.cmd: No such file or directory Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1586230512-5507-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Mark Brown commit cb75b0c4dee881fe9d486e725b778395ce0b0426 Author: Aishwarya R Date: Tue Apr 7 18:25:57 2020 +0530 spi: spi-fsl-lpspi: Fix indentation and open brace should be on the previous line Resolved open brace { should be on the previous line checkpatch error and fix the indentation Signed-off-by: Aishwarya R Link: https://lore.kernel.org/r/20200407125557.6520-1-aishwaryarj100@gmail.com Signed-off-by: Mark Brown commit 7b994759ad3cc70715a20850416beb54ec0dd53f Author: Stanislav Lisovskiy Date: Thu Apr 9 18:47:18 2020 +0300 drm/i915: Start passing latency as parameter We need to start passing memory latency as a parameter when calculating plane wm levels, as latency can get changed in different circumstances(for example with or without SAGV). So we need to be more flexible on that matter. v2: Changed latency type from u32 to unsigned int(Ville Syrjälä) Reviewed-by: Ville Syrjälä Signed-off-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200409154730.18568-2-stanislav.lisovskiy@intel.com commit e82c878d49bf58f3f2199cba00400530856ad11e Author: Jiaxun Yang Date: Thu Mar 26 14:16:58 2020 +0800 MIPS: Kill MIPS_GIC_IRQ_BASE It never got used by any driver. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 39400f34a289ad5f5f0b36b8bb4591603b73a759 Merge: 5c5118dc5d14 2a79c31a498e Author: Mark Brown Date: Tue Apr 14 18:04:08 2020 +0100 Merge branch 'asoc-5.7' into asoc-5.8 commit 408b722d029b14d87bd5039c04f59a282d6c1f74 Author: bibo mao Date: Thu Mar 26 03:42:47 2020 -0400 MIPS: xilfpga: Removed unused header files Header in directory asm/mach-xilfpga is not used any more. Remove it here, and it passes to compile with xilfpga_defconfig Signed-off-by: bibo mao Signed-off-by: Thomas Bogendoerfer commit 78056e701c61132d15e0942e415926a6393fcf17 Author: Saravana Kannan Date: Wed Apr 1 15:52:03 2020 -0700 of: property: Add device link support for extcon Add support for creating device links out of more DT properties. Cc: MyungJoo Ham Cc: Chanwoo Choi Signed-off-by: Saravana Kannan Signed-off-by: Rob Herring commit 74aae1c42f4a7f69934762f9e9f90a3ec335fef2 Author: Daniel Vetter Date: Fri Apr 3 15:57:47 2020 +0200 drm/device: Deprecate dev_private harder We've had lots of conversions to embeddeding, but didn't stop using ->dev_private. Which defeats the point of this. Reviewed-by: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200403135828.2542770-4-daniel.vetter@ffwll.ch commit abf8422cf6de197a9996e1ee9467494975db5af5 Author: Nobuhiro Iwamatsu Date: Wed Apr 1 23:14:49 2020 +0900 dt-bindings: timer: cadence_ttc: Migrate timer-cadence-ttc documentation to YAML The document was migrated to YAML format and renamed cdns,ttc.yaml. And updated the example to the latest format. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Rob Herring commit f86ca414797651178b54a87815d04cdf891606b2 Author: Nobuhiro Iwamatsu Date: Wed Apr 1 22:47:09 2020 +0900 dt-bindings: i2c: xiic: Migrate i2c-xiic documentation to YAML The document was migrated to YAML format and renamed xlnx,xps-iic-2.00.a.yaml Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Rob Herring commit aea37006e18331158f3e4773a6fa4844c8ddcb94 Author: Nobuhiro Iwamatsu Date: Wed Apr 1 22:42:22 2020 +0900 dt-bindings: i2c: cadence: Migrate i2c-cadence documentation to YAML The document was migrated to YAML format and renamed cdns,i2c-r1p10.yaml Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Rob Herring commit 8089a622d9b494f132f1799c318df5e36bb88def Author: Sam Ravnborg Date: Sun Apr 12 15:21:39 2020 +0200 dt-bindings: display: allow port and ports in panel-lvds Both port and ports names may be used in a panel-lvds binding port - for a single port ports - if there is more than one port in sub-nodes Fixes the following warning: advantech,idk-2121wr.example.dt.yaml: panel-lvds: 'port' is a required property advantech,idk-2121wr.yaml needs several ports, so uses a ports node. v2: - Use oneOf - makes the logic more obvious (Rob) - Added Fixes tag - Added port: true, ports:true v3: - Indent port/ports in required two spaces (Rob) Signed-off-by: Sam Ravnborg Reviewed-by: Rob Herring Cc: Rob Herring Fixes: 8efef33eff50 ("dt-bindings: display: Add idk-2121wr binding") Cc: Fabrizio Castro Cc: Lad Prabhakar Cc: Sam Ravnborg Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20200412132139.11418-2-sam@ravnborg.org commit f26f1db5d2be446324140ec096cc9a31e7e7c891 Author: Kai Vehmanen Date: Mon Mar 30 17:44:21 2020 +0300 drm/i915: do AUD_FREQ_CNTRL state save on all gen9+ platforms Replace the TGL/ICL specific platform checks with a more generic check using INTEL_GEN(). Fixes bug with broken audio after S3 resume on JSL platforms. An initial version of state save and restore of AUD_FREQ_CNTRL register was added for subset of platforms in commit 87c1694533c9 ("drm/i915: save AUD_FREQ_CNTRL state at audio domain suspend"). The state save has proven to work well and it is needed in newer platforms, so needs to be extended. Although the logic is not in practise needed on GEN9/10 systems, follow the hardware specification and apply state and restore on all gen9+ platforms. Bspec: 49281 Link: https://github.com/thesofproject/linux/issues/1719 Signed-off-by: Kai Vehmanen Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200330144421.11632-1-kai.vehmanen@linux.intel.com Reviewed-by: Matt Roper commit 2ea8db7200d40f89ebfb97fc512ced5f792e0e1c Author: Colin Ian King Date: Fri Apr 10 14:34:06 2020 +0100 regulator: tps80031: remove redundant assignment to variables ret and val The variables ret and val are being initialized with values that are never read and are being updated later with a new value. The initializations are redundant and can be removed. Signed-off-by: Colin Ian King Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20200410133406.24458-1-colin.king@canonical.com Signed-off-by: Mark Brown commit 29ebe87cdd57accdbe94e44a01685cb3227ad223 Author: Jason Yan Date: Fri Apr 10 15:33:43 2020 +0800 regulator: ab8500: remove some defined but not used variables Fix the following gcc warning: drivers/regulator/ab8500.c:195:27: warning: ‘ldo_vdmic_voltages’ defined but not used [-Wunused-const-variable=] static const unsigned int ldo_vdmic_voltages[] = { ^~~~~~~~~~~~~~~~~~ drivers/regulator/ab8500.c:169:27: warning: ‘fixed_3300000_voltage’ defined but not used [-Wunused-const-variable=] static const unsigned int fixed_3300000_voltage[] = { ^~~~~~~~~~~~~~~~~~~~~ drivers/regulator/ab8500.c:142:27: warning: ‘ldo_sdio_voltages’ defined but not used [-Wunused-const-variable=] static const unsigned int ldo_sdio_voltages[] = { ^~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200410073343.39031-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 6b576eb035dba77daf091f045fa1448682ee12b4 Author: Michał Mirosław Date: Sat Apr 4 02:11:57 2020 +0200 regulator: use consumer->supply_name in debugfs/regulator_summary Make it easier to identify regulator consumers when consumer device uses more than one supply. Before: regulator ena use open bypass voltage current min max ----------------------------------------------------------------------------------- regulator-dummy 1 0 2 0 0mV 0mA 0mV 0mV 1-0010 0mV 0mV 1-0010 0mV 0mV After: regulator ena use open bypass voltage current min max ----------------------------------------------------------------------------------- regulator-dummy 1 0 2 0 0mV 0mA 0mV 0mV 1-0010-vccio 0mV 0mV 1-0010-vcc33 0mV 0mV Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/731a4b299c6ae0ee9d8995157600a3477f21a36c.1585959068.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown commit d2c2c218ea3f46cabd0955307d246e18371565dd Author: Jason Yan Date: Thu Apr 9 19:40:26 2020 +0800 regulator: qcom_rpm: remove defined but not used 'pm8921_ftsmps' Fix the following gcc warning: drivers/regulator/qcom_rpm-regulator.c:607:34: warning: ‘pm8921_ftsmps’ defined but not used [-Wunused-const-variable=] static const struct qcom_rpm_reg pm8921_ftsmps = { ^~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200409114026.38383-1-yanaijie@huawei.com Signed-off-by: Mark Brown commit 3ada1b176e6b91c0a807e02274437ff0c01d155a Merge: 4475337326bc 12479382877d Author: Mark Brown Date: Tue Apr 14 16:37:32 2020 +0100 Merge series "Add support for Kontron sl28cpld" from Michael Walle : The Kontron sl28cpld is a board management chip providing gpio, pwm, fan monitoring and an interrupt controller. For now this controller is used on the Kontron SMARC-sAL28 board. But because of its flexible nature, it might also be used on other boards in the future. The individual blocks (like gpio, pwm, etc) are kept intentionally small. The MFD core driver then instantiates different (or multiple of the same) blocks. It also provides the register layout so it might be updated in the future without a device tree change; and support other boards with a different layout or functionalities. See also [1] for more information. This is my first take of a MFD driver. I don't know whether the subsystem maintainers should only be CCed on the patches which affect the subsystem or on all patches for this series. I've chosen the latter so you can get a more complete picture. [1] https://lore.kernel.org/linux-devicetree/0e3e8204ab992d75aa07fc36af7e4ab2@walle.cc/ Changes since v1: - use of_match_table in all drivers, needed for automatic module loading, when using OF_MFD_CELL() - add new gpio-regmap.c which adds a generic regmap gpio_chip implemention - new patch for reqmap_irq, so we can reuse its implementation - remove almost any code from gpio-sl28cpld.c, instead use gpio-regmap and regmap-irq - change the handling of the mfd core vs device tree nodes; add a new property "of_reg" to the mfd_cell struct which, when set, is matched to the unit-address of the device tree nodes. - fix sl28cpld watchdog when it is not initialized by the bootloader. Explicitly set the operation mode. - also add support for kontron,assert-wdt-timeout-pin in sl28cpld-wdt. As suggested by Bartosz Golaszewski: - define registers as hex - make gpio enum uppercase - move parent regmap check before memory allocation - use device_property_read_bool() instead of the of_ version - mention the gpio flavors in the bindings documentation As suggested by Guenter Roeck: - cleanup #includes and sort them - use devm_watchdog_register_device() - use watchdog_stop_on_reboot() - provide a Documentation/hwmon/sl28cpld.rst - cleaned up the weird tristate->bool and I2C=y issue. Instead mention that the MFD driver is bool because of the following intc patch - removed the SL28CPLD_IRQ typo As suggested by Rob Herring: - combine all dt bindings docs into one patch - change the node name for all gpio flavors to "gpio" - removed the interrupts-extended rule - cleaned up the unit-address space, see above Michael Walle (16): include/linux/ioport.h: add helper to define REG resource constructs mfd: mfd-core: Don't overwrite the dma_mask of the child device mfd: mfd-core: match device tree node against reg property regmap-irq: make it possible to add irq_chip do a specific device node dt-bindings: mfd: Add bindings for sl28cpld mfd: Add support for Kontron sl28cpld management controller irqchip: add sl28cpld interrupt controller support watchdog: add support for sl28cpld watchdog pwm: add support for sl28cpld PWM controller gpio: add a reusable generic gpio_chip using regmap gpio: add support for the sl28cpld GPIO controller hwmon: add support for the sl28cpld hardware monitoring controller arm64: dts: freescale: sl28: enable sl28cpld arm64: dts: freescale: sl28: map GPIOs to input events arm64: dts: freescale: sl28: enable LED support arm64: dts: freescale: sl28: enable fan support .../bindings/gpio/kontron,sl28cpld-gpio.yaml | 51 +++ .../hwmon/kontron,sl28cpld-hwmon.yaml | 27 ++ .../bindings/mfd/kontron,sl28cpld.yaml | 162 +++++++++ .../bindings/pwm/kontron,sl28cpld-pwm.yaml | 35 ++ .../watchdog/kontron,sl28cpld-wdt.yaml | 35 ++ Documentation/hwmon/sl28cpld.rst | 36 ++ .../fsl-ls1028a-kontron-kbox-a-230-ls.dts | 14 + .../fsl-ls1028a-kontron-sl28-var3-ads2.dts | 9 + .../freescale/fsl-ls1028a-kontron-sl28.dts | 124 +++++++ drivers/base/regmap/regmap-irq.c | 84 ++++- drivers/gpio/Kconfig | 15 + drivers/gpio/Makefile | 2 + drivers/gpio/gpio-regmap.c | 321 ++++++++++++++++++ drivers/gpio/gpio-sl28cpld.c | 187 ++++++++++ drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/sl28cpld-hwmon.c | 152 +++++++++ drivers/irqchip/Kconfig | 3 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-sl28cpld.c | 99 ++++++ drivers/mfd/Kconfig | 21 ++ drivers/mfd/Makefile | 2 + drivers/mfd/mfd-core.c | 31 +- drivers/mfd/sl28cpld.c | 154 +++++++++ drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-sl28cpld.c | 204 +++++++++++ drivers/watchdog/Kconfig | 11 + drivers/watchdog/Makefile | 1 + drivers/watchdog/sl28cpld_wdt.c | 242 +++++++++++++ include/linux/gpio-regmap.h | 88 +++++ include/linux/ioport.h | 5 + include/linux/mfd/core.h | 26 +- include/linux/regmap.h | 10 + 34 files changed, 2142 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/kontron,sl28cpld-gpio.yaml create mode 100644 Documentation/devicetree/bindings/hwmon/kontron,sl28cpld-hwmon.yaml create mode 100644 Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml create mode 100644 Documentation/devicetree/bindings/pwm/kontron,sl28cpld-pwm.yaml create mode 100644 Documentation/devicetree/bindings/watchdog/kontron,sl28cpld-wdt.yaml create mode 100644 Documentation/hwmon/sl28cpld.rst create mode 100644 drivers/gpio/gpio-regmap.c create mode 100644 drivers/gpio/gpio-sl28cpld.c create mode 100644 drivers/hwmon/sl28cpld-hwmon.c create mode 100644 drivers/irqchip/irq-sl28cpld.c create mode 100644 drivers/mfd/sl28cpld.c create mode 100644 drivers/pwm/pwm-sl28cpld.c create mode 100644 drivers/watchdog/sl28cpld_wdt.c create mode 100644 include/linux/gpio-regmap.h -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel commit 4475337326bcfa712006ff8cbc760c045cca1d82 Merge: bd3ddb495762 80215f133d59 Author: Mark Brown Date: Tue Apr 14 16:37:31 2020 +0100 Merge series "Add new reg_update_bits() support" from Baolin Wang : The Spreadtrum platform uses a special set/clear method to update registers' bits, thus this patch set registers a physical regmap bus into syscon core to support this feature instead of using the MMIO bus, which is not a physical regmap bus. Any comments are welcome. Thanks. Changes from RFC v1: - Add new helper to registers a physical regmap bus instead of using the MMIO bus. Baolin Wang (3): mfd: syscon: Support physical regmap bus regmap: Add bus reg_update_bits() support soc: sprd: Add Spreadtrum special bits updating support drivers/base/regmap/regmap.c | 1 + drivers/mfd/syscon.c | 16 ++++++- drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/sprd/Kconfig | 16 +++++++ drivers/soc/sprd/Makefile | 2 + drivers/soc/sprd/sprd_syscon.c | 76 ++++++++++++++++++++++++++++++++++ include/linux/mfd/syscon.h | 7 ++++ 8 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 drivers/soc/sprd/Kconfig create mode 100644 drivers/soc/sprd/Makefile create mode 100644 drivers/soc/sprd/sprd_syscon.c -- 2.17.1 commit bd3ddb495762575ab14e7bd2e4017dc1f9a80b2f Author: Marco Felsch Date: Thu Apr 2 10:41:11 2020 +0200 regmap: add reg_sequence helpers Add helper to make it easier to define a reg_sequence array. Signed-off-by: Marco Felsch Link: https://lore.kernel.org/r/20200402084111.30123-1-m.felsch@pengutronix.de Signed-off-by: Mark Brown commit 12479382877dcf6623af4676caa8d3c647469a1b Author: Michael Walle Date: Thu Apr 2 22:36:44 2020 +0200 regmap-irq: make it possible to add irq_chip do a specific device node Add a new function regmap_add_irq_chip_np() with its corresponding devm_regmap_add_irq_chip_np() variant. Sometimes one want to register the IRQ domain on a different device node that the one of the regmap node. For example when using a MFD where there are different interrupt controllers and particularly for the generic regmap gpio_chip/irq_chip driver. In this case it is not desireable to have the IRQ domain on the parent node. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20200402203656.27047-5-michael@walle.cc Signed-off-by: Mark Brown commit fd7fb0253cdf96241308336e7833186b928336a8 Author: Jason Yan Date: Fri Apr 10 17:08:17 2020 +0800 brcmsmac: make brcms_c_set_mac() void Fix the following coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c:3773:5-8: Unneeded variable: "err". Return "0" on line 3781 Reported-by: Hulk Robot Signed-off-by: Jason Yan Acked-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200410090817.26883-1-yanaijie@huawei.com commit c960e2b384ef3cec4dd447ac90dbdc27a3c41a08 Author: Christophe JAILLET Date: Tue Apr 7 21:32:33 2020 +0200 qtnfmac: Simplify code in _attach functions There is no need to re-implement 'netdev_alloc_skb_ip_align()' here. Keep the code simple. Signed-off-by: Christophe JAILLET Reviewed-by: Sergey Matyukevich Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200407193233.9439-1-christophe.jaillet@wanadoo.fr commit ec4d3e3a054578de34cd0b587ab8a1ac36f629d9 Author: Larry Finger Date: Tue Apr 7 14:00:43 2020 -0500 b43legacy: Fix case where channel status is corrupted This patch fixes commit 75388acd0cd8 ("add mac80211-based driver for legacy BCM43xx devices") In https://bugzilla.kernel.org/show_bug.cgi?id=207093, a defect in b43legacy is reported. Upon testing, thus problem exists on PPC and X86 platforms, is present in the oldest kernel tested (3.2), and has been present in the driver since it was first added to the kernel. The problem is a corrupted channel status received from the device. Both the internal card in a PowerBook G4 and the PCMCIA version (Broadcom BCM4306 with PCI ID 14e4:4320) have the problem. Only Rev, 2 (revision 4 of the 802.11 core) of the chip has been tested. No other devices using b43legacy are available for testing. Various sources of the problem were considered. Buffer overrun and other sources of corruption within the driver were rejected because the faulty channel status is always the same, not a random value. It was concluded that the faulty data is coming from the device, probably due to a firmware bug. As that source is not available, the driver must take appropriate action to recover. At present, the driver reports the error, and them continues to process the bad packet. This is believed that to be a mistake, and the correct action is to drop the correpted packet. Fixes: 75388acd0cd8 ("add mac80211-based driver for legacy BCM43xx devices") Cc: Stable Signed-off-by: Larry Finger Reported-and-tested by: F. Erhard Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200407190043.1686-1-Larry.Finger@lwfinger.net commit 6343a6d4b2130be9323f347d60af8a7ba8f7242c Author: Kai-Heng Feng Date: Tue Apr 7 15:33:31 2020 +0800 rtw88: Add delay on polling h2c command status bit On some systems we can constanly see rtw88 complains: [39584.721375] rtw_pci 0000:03:00.0: failed to send h2c command Increase interval of each check to wait the status bit really changed. Use read_poll_timeout() macro which fits anything we need here. Suggested-by: Kalle Valo Signed-off-by: Kai-Heng Feng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200407073331.397-1-kai.heng.feng@canonical.com commit 63e49a9fdac1b4e97ac26cb3fe953f210d83bc53 Author: Giuseppe Marco Randazzo Date: Mon Apr 6 00:06:59 2020 +0200 p54usb: add AirVasT USB stick device-id This patch adds the AirVasT USB wireless devices 124a:4026 to the list of supported devices. It's using the ISL3886 usb firmware. Without this modification, the wiki adapter is not recognized. Cc: Signed-off-by: Giuseppe Marco Randazzo Signed-off-by: Christian Lamparter [formatted, reworded] Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200405220659.45621-1-chunkeey@gmail.com commit 80215f133d59310fdfce5ee4398aeb7076c2e99f Author: Baolin Wang Date: Mon Apr 13 14:13:20 2020 +0800 regmap: Add bus reg_update_bits() support Add reg_update_bits() support in case some platforms use a special method to update bits of registers. Signed-off-by: Baolin Wang Link: https://lore.kernel.org/r/df32fd0529957d1e7e26ba1465723f16cfbe92c8.1586757922.git.baolin.wang7@gmail.com Signed-off-by: Mark Brown commit 09667ea7ce6d6a90152aeba631f11b55f283a898 Author: Colin Ian King Date: Sun Apr 5 14:39:06 2020 +0100 brcm80211: remove redundant pointer 'address' Pointer 'address' is being assigned and updated in a few places by it is never read. Hence the assignments are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200405133906.381358-1-colin.king@canonical.com commit f9f46bca59d11d0fa04087c840e23ca94cd239b5 Author: Qiujun Huang Date: Thu Apr 2 22:17:58 2020 +0800 rsi: fix a typo "throld" -> "threshold" There is a typo in debug message. Fix it. s/throld/threshold Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585837078-6149-1-git-send-email-hqjagain@gmail.com commit a24993e54b9cac81b2814da53a664261af10a829 Author: Qiujun Huang Date: Thu Apr 2 16:19:17 2020 +0800 rtlwifi: rtl8723ae: fix spelling mistake "chang" -> "change" There is a spelling mistake in a trace message. Fix it. Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585815557-20212-1-git-send-email-hqjagain@gmail.com commit c57673852062428cdeabdd6501ac8b8e4c302067 Author: Jaehoon Chung Date: Mon Mar 30 14:25:28 2020 +0900 brcmfmac: fix wrong location to get firmware feature sup_wpa feature is getting after setting feature_disable flag. If firmware is supported sup_wpa feature, it's always enabled regardless of feature_disable flag. Fixes: b8a64f0e96c2 ("brcmfmac: support 4-way handshake offloading for WPA/WPA2-PSK") Signed-off-by: Jaehoon Chung Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200330052528.10503-1-jh80.chung@samsung.com commit ca2c6881dccabe00a38cda00ddcccb55e6abe245 Author: YueHaibing Date: Sat Mar 28 11:05:24 2020 +0800 rtw88: Make two functions static Fix sparse warnings: drivers/net/wireless/realtek/rtw88/fw.c:633:4: warning: symbol 'rtw_get_rsvd_page_probe_req_location' was not declared. Should it be static? drivers/net/wireless/realtek/rtw88/fw.c:650:5: warning: symbol 'rtw_get_rsvd_page_probe_req_size' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200328030524.16032-1-yuehaibing@huawei.com commit 5c5118dc5d14e1d7864bddade30019660cb467fa Merge: 3c9432d1efc9 b2acc24c805a Author: Mark Brown Date: Tue Apr 14 15:45:38 2020 +0100 Merge series "ASoC: SOF: adjust dmesg verbosity" from Pierre-Louis Bossart : Decrease the dmesg verbosity to remove unnecessary logs on SoundWire platforms, and conversely add more information to help the community and downstream distros with HDaudio/SOF support (DMIC detection and card instanciation are the most prevalent issues on GitHub). Pierre-Louis Bossart (3): ASoC: codecs: rt1308-sdw: reduce verbosity ASoC: SOF: Intel: hda: reduce verbosity on SoundWire detection ASoC: SOF: Intel: hda: log number of microphones detected in NHLT tables Ranjani Sridharan (1): ASoC: soc-core: Add dynamic debug logs in soc_dai_link_sanity_check() sound/soc/codecs/rt1308-sdw.c | 4 ++-- sound/soc/soc-core.c | 18 +++++++++++++++--- sound/soc/sof/intel/hda.c | 10 ++++++---- 3 files changed, 23 insertions(+), 9 deletions(-) base-commit: dd8e871d4e560eeb8d22af82dde91457ad835a63 -- 2.20.1 commit 3c9432d1efc93ae0b3b2b3fa4dabdcfd8f65d8e6 Merge: 41d5d7b330b0 805a23de2657 Author: Mark Brown Date: Tue Apr 14 15:45:37 2020 +0100 Merge series "ASoC: SOF: trivial code cleanups" from Pierre-Louis Bossart : Fix warnings reported by tools - no functionality change. Payal Kshirsagar (2): ASoC: SOF: remove unneeded variables ASoC: SOF: Intel: hda: remove unnecessary parentheses sound/soc/sof/intel/hda-codec.c | 5 +---- sound/soc/sof/intel/hda-dsp.c | 8 ++++---- sound/soc/sof/nocodec.c | 6 ++---- 3 files changed, 7 insertions(+), 12 deletions(-) base-commit: dd8e871d4e560eeb8d22af82dde91457ad835a63 -- 2.20.1 commit 41d5d7b330b0a7b9b24aa7bfc61fdc9cfb64d27a Merge: df3e71c42f05 8240fe6c91b8 Author: Mark Brown Date: Tue Apr 14 15:45:36 2020 +0100 Merge series "Support headset on Tegra boards that use WM8903" from Dmitry Osipenko : Hello, Some devices have a 4-pin jack instead of a 3-pin and currently the WM8903 configuration is hardcoded to the case of 3-pin jack in the Tegra's ASoC driver. A new device-tree property is required in order to convey that hardware has a 4-pin jack, and thus, microphone's detection needs to be done in a different way. In particular this is needed for Acer A500 tablet device that has a 4-pin headset jack, otherwise userspace sees headset instead of headphones and internal microphone isn't enabled by ALSA UCM rule when it should be. Please review and apply, thanks in advance. Dmitry Osipenko (2): dt-bindings: sound: tegra-wm8903: Document new nvidia,headset property ASoC: tegra: tegra_wm8903: Support nvidia,headset property .../devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt | 1 + sound/soc/tegra/tegra_wm8903.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.25.1 commit df3e71c42f058998b5a38e292a70f41d229e8fa9 Merge: aa982b05950c 30e3edfbd1bf Author: Mark Brown Date: Tue Apr 14 15:45:35 2020 +0100 Merge series "ASoC: Intel: machine drivers update for 5.8" from Pierre-Louis Bossart : This patchset a) adds support for the Intel ElkhartLake platforms b)aligns the HDaudio mic detection with the snd-hda-intel driver c) correct DMIC missing configurations d) fixes initialization/compilation problems for SoundWire platforms d) completes the removal of codec_dais missing in Morimoto-san's series. Bard Liao (1): ASoC: intel: sof_sdw: init all aggregated codecs Hui Wang (1): ASoC: intel/skl/hda - set autosuspend timeout for hda codecs Keyon Jie (1): ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Libin Yang (3): ALSA: hda: Add ElkhartLake HDMI codec vid ASoC: SOF: Intel: add PCI ID for ElkhartLake ASoC: Intel: boards: support Elkhart Lake with rt5660 Pierre-Louis Bossart (6): ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode ASoC: Intel: sof_sdw_hdmi: remove codec_dai use ASoC: Intel: sof_sdw_rt1308: remove codec dai use ASoC: Intel: sof_sdw_rt5682: remove codec_dai use ASoC: Intel: sof_sdw_rt700: remove codec_dai use ASoC: Intel: sof_sdw_rt711: remove codec_dai use Yong Zhi (1): ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k sound/pci/hda/patch_hdmi.c | 1 + sound/soc/intel/boards/Kconfig | 15 + sound/soc/intel/boards/Makefile | 2 + sound/soc/intel/boards/ehl_rt5660.c | 323 ++++++++++++++++++ sound/soc/intel/boards/skl_hda_dsp_generic.c | 29 +- sound/soc/intel/boards/sof_da7219_max98373.c | 21 ++ sound/soc/intel/boards/sof_sdw.c | 41 ++- sound/soc/intel/boards/sof_sdw_hdmi.c | 4 +- sound/soc/intel/boards/sof_sdw_rt1308.c | 2 +- sound/soc/intel/boards/sof_sdw_rt5682.c | 3 +- sound/soc/intel/boards/sof_sdw_rt700.c | 3 +- sound/soc/intel/boards/sof_sdw_rt711.c | 3 +- .../intel/common/soc-acpi-intel-ehl-match.c | 7 + sound/soc/sof/sof-pci-dev.c | 2 + 14 files changed, 434 insertions(+), 22 deletions(-) create mode 100644 sound/soc/intel/boards/ehl_rt5660.c base-commit: dd8e871d4e560eeb8d22af82dde91457ad835a63 -- 2.20.1 commit aa982b05950cd12dc5824193836427d8633087a5 Merge: 4c979a775432 1729025b04b9 Author: Mark Brown Date: Tue Apr 14 15:45:34 2020 +0100 Merge series "ASoC: remove rtd->cpu/codec_dai{s} v2" from Kuninori Morimoto : Hi Mark These are rebased "remove rtd->cpu/codec_dai" patches. Kuninori Morimoto (4): ASoC: soc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer ASoC: soc-core: set rtd->num_cpu/codec at soc_new_pcm_runtime() ASoC: soc-core: tidyup soc_new_pcm_runtime() rtd setups ASoC: soc-core: remove cpu_dai/codec_dai/cpu_dais/codec_dais include/sound/soc.h | 26 +++++++++-------- sound/soc/soc-compress.c | 36 +++++++++++------------ sound/soc/soc-core.c | 42 ++++++++++----------------- sound/soc/soc-dapm.c | 4 +-- sound/soc/soc-generic-dmaengine-pcm.c | 6 ++-- sound/soc/soc-pcm.c | 30 +++++++++---------- 6 files changed, 68 insertions(+), 76 deletions(-) -- 2.17.1 commit 616844408de7f21546c3c2a71ea7f8d364f45e0d Author: Rob Herring Date: Wed Apr 8 19:41:10 2020 -0600 gpio: pl061: Support building as module Enable building the PL061 GPIO driver as a module. This does change the initcall level when built-in. This shouldn't be a problem as any user should support deferred probe by now. A scan of DT based platforms at least didn't reveal any users that would be a problem. Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit 85a94ff8fb14511c88b8d21f82937197d76b82a2 Author: Andy Shevchenko Date: Thu Apr 2 22:21:45 2020 +0300 gpio: Extend TODO to cover code duplication avoidance It appears at least two drivers has a lot of duplication code in GPIO subsystem. To avoid adding more and get rid of existing duplication extend TODO. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 7fc504b993cee79e38c0f018bf3c38940873bebd Author: Brian Masney Date: Wed Apr 1 13:49:37 2020 -0400 gpio: xgene-sb: set valid IRQ type in to_irq() xgene-sb is setup to be a hierarchical IRQ chip with the GIC as the parent chip. xgene_gpio_sb_to_irq() currently sets the default IRQ type to IRQ_TYPE_NONE, which the GIC loudly complains about with a WARN_ON(). Let's set the initial default to a sane value (IRQ_TYPE_EDGE_RISING) that was determined by decoding the ACPI tables on affected hardware: Device (_SB.GPSB) { Name (_HID, "APMC0D15") // _HID: Hardware ID Name (_CID, "APMC0D15") // _CID: Compatible ID Name (_UID, "GPIOSB") // _UID: Unique ID ... Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { ... Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, ) { 0x00000048, } ... } } This can be overridden later as needed with irq_set_irq_type(). Signed-off-by: Brian Masney Signed-off-by: Bartosz Golaszewski commit 4c979a775432f8a1c9b6cfd9bf466eba05e96c9d Author: Jason Yan Date: Tue Apr 7 16:29:32 2020 +0800 ASoC: wm8900: remove some defined but not used symbols Fix the following gcc warning: sound/soc/codecs/wm8900.c:449:38: warning: ‘wm8900_dapm_routput2_control’ defined but not used [-Wunused-const-variable=] static const struct snd_kcontrol_new wm8900_dapm_routput2_control = ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm8900.c:446:38: warning: ‘wm8900_dapm_loutput2_control’ defined but not used [-Wunused-const-variable=] static const struct snd_kcontrol_new wm8900_dapm_loutput2_control = ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200407082932.41511-5-yanaijie@huawei.com Signed-off-by: Mark Brown commit f840ebfe58027b43d6a6ba261c11cc80963952d6 Author: Jason Yan Date: Tue Apr 7 16:29:31 2020 +0800 ASoC: wm8990: remove some defined but unused symbols Fix the following gcc warning: sound/soc/codecs/wm8990.c:1309:35: warning: ‘wm8990_regmap’ defined but not used [-Wunused-const-variable=] static const struct regmap_config wm8990_regmap = { ^~~~~~~~~~~~~ sound/soc/codecs/wm8990.c:490:38: warning: ‘wm8990_dapm_rxvoice_controls’ defined but not used [-Wunused-const-variable=] static const struct snd_kcontrol_new wm8990_dapm_rxvoice_controls[] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm8990.c:120:35: warning: ‘out_omix_tlv’ defined but not used [-Wunused-const-variable=] static const DECLARE_TLV_DB_SCALE(out_omix_tlv, -600, 0, 0); ^ sound/soc/codecs/wm8990.c:112:35: warning: ‘rec_mix_tlv’ defined but not used [-Wunused-const-variable=] static const DECLARE_TLV_DB_SCALE(rec_mix_tlv, -1500, 600, 0); ^ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200407082932.41511-4-yanaijie@huawei.com Signed-off-by: Mark Brown commit cdab86902d07800a6393af1967fe8d343a27e526 Author: Jason Yan Date: Tue Apr 7 16:29:30 2020 +0800 ASoC: wm8991: remove defined but not used 'wm8991_dapm_rxvoice_controls' Fix the following gcc warning: sound/soc/codecs/wm8991.c:480:38: warning: ‘wm8991_dapm_rxvoice_controls’ defined but not used [-Wunused-const-variable=] static const struct snd_kcontrol_new wm8991_dapm_rxvoice_controls[] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200407082932.41511-3-yanaijie@huawei.com Signed-off-by: Mark Brown commit e8ec193e485d933946ca7cc788c5503cd38af1a2 Author: Jason Yan Date: Tue Apr 7 16:29:29 2020 +0800 ASoC: wm8994: remove wm1811_snd_controls and mixin_boost_tlv Fix the following gcc warning: sound/soc/codecs/wm8994.c:736:38: warning: ‘wm1811_snd_controls’ defined but not used [-Wunused-const-variable=] static const struct snd_kcontrol_new wm1811_snd_controls[] = { ^~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200407082932.41511-2-yanaijie@huawei.com Signed-off-by: Mark Brown commit 6f0841a8197b20d01de9d41cb1eeed09b7b31f9b Author: Jeff LaBundy Date: Sun Apr 12 21:15:16 2020 -0500 pwm: Add support for Azoteq IQS620A PWM generator This patch adds support for the Azoteq IQS620A, capable of generating a 1-kHz PWM output with duty cycle between ~0.4% and 100% (inclusive). Signed-off-by: Jeff LaBundy Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 1df73b2131e3b33d518609769636b41ce00212de Author: Borislav Petkov Date: Tue Apr 7 13:49:58 2020 +0200 x86/mce: Fixup exception only for the correct MCEs The severity grading code returns IN_KERNEL_RECOV error context for errors which have happened in kernel space but from which the kernel can recover. Whether the recovery can happen is determined by the exception table entry having as handler ex_handler_fault() and which has been declared at build time using _ASM_EXTABLE_FAULT(). IN_KERNEL_RECOV is used in mce_severity_intel() to lookup the corresponding error severity in the severities table. However, the mapping back from error severity to whether the error is IN_KERNEL_RECOV is ambiguous and in the very paranoid case - which might not be possible right now - but be better safe than sorry later, an exception fixup could be attempted for another MCE whose address is in the exception table and has the proper severity. Which would be unfortunate, to say the least. Therefore, mark such MCEs explicitly as MCE_IN_KERNEL_RECOV so that the recovery attempt is done only for them. Document the whole handling, while at it, as it is not trivial. Reported-by: Thomas Gleixner Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200407163414.18058-10-bp@alien8.de commit 7fc0b9b995f222646ece8d5bca528060c098ee88 Author: Tony Luck Date: Fri Feb 14 14:27:20 2020 -0800 EDAC: Drop the EDAC report status checks When acpi_extlog was added, we were worried that the same error would be reported more than once by different subsystems. But in the ensuing years I've seen complaints that people could not find an error log (because this mechanism suppressed the log they were looking for). Rip it all out. People are smart enough to notice the same address from different reporting mechanisms. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-8-tony.luck@intel.com commit 43505646941bee217b91d064756975aa1ab6ee3b Author: Tony Luck Date: Fri Feb 14 14:27:19 2020 -0800 x86/mce: Add mce=print_all option Sometimes, when logs are getting lost, it's nice to just have everything dumped to the serial console. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-7-tony.luck@intel.com commit 925946cfa715a5a71639528f82b98e58f14dd4cb Author: Tony Luck Date: Fri Feb 14 14:27:18 2020 -0800 x86/mce: Change default MCE logger to check mce->kflags Instead of keeping count of how many handlers are registered on the MCE notifier chain and printing if below some magic value, look at mce->kflags to see if anyone claims to have handled/logged this error. [ bp: Do not print ->kflags in __print_mce(). ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-6-tony.luck@intel.com commit 23ba710a0864108910c7531dc4c73ef65eca5568 Author: Tony Luck Date: Fri Feb 14 14:27:17 2020 -0800 x86/mce: Fix all mce notifiers to update the mce->kflags bitmask If the handler took any action to log or deal with the error, set a bit in mce->kflags so that the default handler on the end of the machine check chain can see what has been done. Get rid of NOTIFY_STOP returns. Make the EDAC and dev-mcelog handlers skip over errors already processed by CEC. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-5-tony.luck@intel.com commit 1de08dccd383482a3e88845d3554094d338f5ff9 Author: Tony Luck Date: Fri Feb 14 14:27:16 2020 -0800 x86/mce: Add a struct mce.kflags field There can be many different subsystems register on the mce handler chain. Add a new bitmask field and define values so that handlers can indicate whether they took any action to log or otherwise handle an error. The default handler at the end of the chain can use this information to decide whether to print to the console log. Boris suggested a generic name and leaving plenty of spare bits for possible future use. [ bp: Move flag bits to the internal mce.h header and use BIT_ULL(). ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-4-tony.luck@intel.com commit 07b053ff1c6ee7c972e7e3d0915d05f1b1280f14 Author: Yoshihiro Shimoda Date: Fri Apr 10 18:14:17 2020 +0900 dt-bindings: pwm: rcar: add r8a77961 support Add support for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Signed-off-by: Thierry Reding commit 9554bfe403bdfc084823df8695a01f28c680af61 Author: Tony Luck Date: Fri Feb 14 14:27:15 2020 -0800 x86/mce: Convert the CEC to use the MCE notifier The CEC code has its claws in a couple of routines in mce/core.c. Convert it to just register itself on the normal MCE notifier chain. [ bp: Make cec_add_elem() and cec_init() static. ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-3-tony.luck@intel.com commit db539cb928c0abe3b6c96ab16ed19b90c5dd110d Author: Christophe JAILLET Date: Sat Apr 11 17:35:28 2020 +0200 pwm: Add missing '\n' in log messages Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 3ad1f3a33286 ("pwm: Implement some checks for lowlevel drivers") Signed-off-by: Christophe JAILLET Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c9c6d216ed28be6e2c91e3651af169eca284813a Author: Tony Luck Date: Fri Feb 14 14:27:14 2020 -0800 x86/mce: Rename "first" function as "early" It isn't going to be first on the notifier chain when the CEC is moved to be a normal user of the notifier chain. Fix the enum for the MCE_PRIO symbols to list them in reverse order so that the compiler can give them numbers from low to high priority. Add an entry for MCE_PRIO_CEC as the highest priority. [ bp: Use passive voice, add comments. ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200214222720.13168-2-tony.luck@intel.com commit 3e0fdec858d82c829774f271e88b5ceb17051551 Author: Borislav Petkov Date: Tue Apr 7 09:55:10 2020 +0200 x86/mce/amd, edac: Remove report_gart_errors ... because no one should be interested in spurious MCEs anyway. Make the filtering unconditional and move it to amd_filter_mce(). Signed-off-by: Borislav Petkov Tested-by: Tony Luck Link: https://lkml.kernel.org/r/20200407163414.18058-2-bp@alien8.de commit 04df45fba52177f796a20642b92fdc44e489e174 Author: Anson Huang Date: Tue Mar 17 09:37:33 2020 +0800 soc: imx8m: No need to put node when of_find_compatible_node() failed No need to put node when of_find_compatible_node() failed, return immediately to simplify the code. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 8240fe6c91b884b5f1f861a8c22721d6ea4c53c9 Author: Dmitry Osipenko Date: Mon Mar 30 23:40:10 2020 +0300 ASoC: tegra-wm8903: Document new nvidia, headset property Some devices have a 4-pin headset jack instead of 3-pin microphone jack. The new boolean nvidia,headset property tells that the Mic Jack represents the state of a headset microphone. This additional hardware description is needed because microphone detection procedure differs in a case of a 4-pin jack from a 3-pin jack. Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20200330204011.18465-2-digetx@gmail.com Signed-off-by: Mark Brown commit 3ef9d5073b552d56bd6daf2af1e89b7e8d4df183 Author: Dmitry Osipenko Date: Mon Mar 30 23:40:11 2020 +0300 ASoC: tegra: tegra_wm8903: Support nvidia, headset property The microphone-jack state needs to be masked in a case of a 4-pin jack when microphone and ground pins are shorted. Presence of nvidia,headset tells that WM8903 CODEC driver should mask microphone's status if short circuit is detected, i.e headphones are inserted. Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20200330204011.18465-3-digetx@gmail.com Signed-off-by: Mark Brown commit a037f3ca0ea0a660e3f961431095a88674b8f3c4 Author: Thomas Gleixner Date: Tue Mar 31 13:16:44 2020 +0200 x86/mce/amd: Make threshold bank setting hotplug robust Handle the cases when the CPU goes offline before the bank setting/reading happens. [ bp: Write commit message. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-8-bp@alien8.de commit f26d2580a7ddc84aa9e51e47fdbb5ad63dbee5a7 Author: Thomas Gleixner Date: Tue Mar 31 10:53:18 2020 +0200 x86/mce/amd: Cleanup threshold device remove path Pass in the bank pointer directly to the cleaning up functions, obviating the need for per-CPU accesses. Make the clean up path interrupt-safe by cleaning the bank pointer first so that the rest of the teardown happens safe from the thresholding interrupt. No functional changes. [ bp: Write commit message and reverse bank->shared test to save an indentation level in threshold_remove_bank(). ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-7-bp@alien8.de commit e7e5af7df1f518610aca8fa29a2eb711eb2ed5b2 Author: Igor Opaniuk Date: Mon Mar 16 16:33:45 2020 +0200 ARM: dts: colibri: introduce device trees with UHS-I support 1. Introduce dtsi with overlay configuration for enabling UHS-I for Colibri iMX6S/DL V1.1x re-design. 2. Introduce new dts for the Colibri iMX6S/DL V1.1x on Colibri Evaluation Carrier Board V3.x. However, disable 1.8V for the Colibri Evaluation Board since this carrier board has 3.3V pull-ups on. 3. Provide proper configuration for VGEN3, which allows that rail to be automatically switched to 1.8 volts for proper UHS-I operation mode. Signed-off-by: Igor Opaniuk Signed-off-by: Shawn Guo commit 6458de97fc15530b54477c4e2b70af653e8ac3d9 Author: Thomas Gleixner Date: Mon Mar 30 20:30:45 2020 +0200 x86/mce/amd: Straighten CPU hotplug path mce_threshold_create_device() hotplug callback runs on the plugged in CPU so: - use this_cpu_read() which is faster - pass in struct threshold_bank **bp to threshold_create_bank() and instead of doing per-CPU accesses - Use rdmsr_safe() instead of rdmsr_safe_on_cpu() which avoids an IPI. No functional changes. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-6-bp@alien8.de commit 44111124fcfd4f28ecf3634ba60fd6c4302034bc Author: Igor Opaniuk Date: Mon Mar 16 16:33:44 2020 +0200 dt-bindings: arm: fsl: add nxp based toradex colibri bindings Document Colibri iMX6S/DL V1.1x re-design devicetree binding. Signed-off-by: Igor Opaniuk Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 6e7a41c63abcfee28734c4c8872dae8d642329b6 Author: Thomas Gleixner Date: Mon Mar 30 16:21:54 2020 +0200 x86/mce/amd: Sanitize thresholding device creation hotplug path Drop the stupid threshold_init_device() initcall iterating over all online CPUs in favor of properly setting up everything on the CPU hotplug path, when each CPU's callback is invoked. [ bp: Write commit message. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-5-bp@alien8.de commit cca9cc05fe98f3eb0cfb58ec6739cfc9d0b4ccbf Author: Thomas Gleixner Date: Thu Mar 12 20:05:43 2020 +0100 x86/mce/amd: Protect a not-fully initialized bank from the thresholding interrupt Make sure the thresholding bank descriptor is fully initialized when the thresholding interrupt fires after a hotplug event. [ bp: Write commit message and document long-forgotten bank_map. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-4-bp@alien8.de commit c9bf318f77b3a78483e656e609d005c52aadc86d Author: Thomas Gleixner Date: Wed Feb 12 00:34:01 2020 +0100 x86/mce/amd: Init thresholding machinery only on relevant vendors ... and not unconditionally. [ bp: Add a new vendor_flags bit for that. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-3-bp@alien8.de commit b1fe0d0937dd7a7dd6e1bbd7212e9c4b5d53a026 Author: Peng Fan Date: Fri Mar 13 11:27:15 2020 +0800 clk: imx: drop the dependency on ARM64 for i.MX8M Moving to support aarch32 mode on aarch64 hardware, need to drop the dependency on ARM64 to make the driver could be selected for ARM32. Signed-off-by: Peng Fan Acked-by: Arnd Bergmann Acked-by: Stephen Boyd Signed-off-by: Shawn Guo commit 260dab4478f60d02a77692c803ea1ff33261843e Author: Peng Fan Date: Mon Mar 16 16:32:33 2020 +0800 clk: imx7ulp: make it easy to change ARM core clk ARM clk could only source from divcore or hsrun_divcore. Follow what we already used on i.MX7D and i.MX8M SoCs, use imx_clk_hw_cpu API. When ARM core is running normaly, whether divcore or hwrun_divcore will finally source from SPLL_PFD0. However SPLL_PFD0 is marked with CLK_SET_GATE, so we need to disable SPLL_PFD0, when configure the rate. So add CORE and HSRUN_CORE virtual clk to make it easy to configure the clk using imx_clk_hw_cpu API. Since CORE and HSRUN_CORE already marked with CLK_IS_CRITICAL, no need to set ARM as CLK_IS_CRITICAL. And when set the rate of ARM clk, prograting it the parent with CLK_SET_RATE_PARENT will finally set the SPLL_PFD0 clk. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Signed-off-by: Shawn Guo commit 30e3edfbd1bf2f79287a5586508bb51f3fce5826 Author: Pierre-Louis Bossart Date: Thu Apr 9 13:58:27 2020 -0500 ASoC: Intel: sof_sdw_rt711: remove codec_dai use Use macro. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200409185827.16255-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 6a739362211b14c1cfe56929c1da71f15c5e6143 Author: Pierre-Louis Bossart Date: Thu Apr 9 13:58:26 2020 -0500 ASoC: Intel: sof_sdw_rt700: remove codec_dai use Use macro Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200409185827.16255-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f11633da41bd00cc436e4e9b143bd6a00b9b65c6 Author: Pierre-Louis Bossart Date: Thu Apr 9 13:58:25 2020 -0500 ASoC: Intel: sof_sdw_rt5682: remove codec_dai use Use macro. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200409185827.16255-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 680ca80f731e11ff510f8ec2777f920ee228e54a Author: Pierre-Louis Bossart Date: Thu Apr 9 13:58:24 2020 -0500 ASoC: Intel: sof_sdw_rt1308: remove codec dai use Use macro. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200409185827.16255-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5611e6f4b32bbdfe973e22d1534c2838c57408b7 Author: Pierre-Louis Bossart Date: Thu Apr 9 13:58:23 2020 -0500 ASoC: Intel: sof_sdw_hdmi: remove codec_dai use Use macro instead. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200409185827.16255-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 272e68d06539d0abc39d949657a2bc6c5ee25647 Author: Pierre-Louis Bossart Date: Thu Apr 9 13:58:22 2020 -0500 ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode Missing prefix causing build fail when NOCODEC option is selected Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409185827.16255-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 35e648cc66ac814ae1114695e6ace26bc63504c8 Author: Keyon Jie Date: Thu Apr 9 13:58:21 2020 -0500 ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Add DMIC endpoint widget and route to make DMIC DAPM routes completed, to make DAPM Power Management works for DMIC streams. Signed-off-by: Keyon Jie Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200409185827.16255-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5930d02c2d533aa9cbc2b55ad27b41802858da16 Author: Bard Liao Date: Thu Apr 9 13:58:20 2020 -0500 ASoC: intel: sof_sdw: init all aggregated codecs Init codecs which belong to the same group id on all links. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409185827.16255-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit db8cfae8c4fdffee9f287a9172605450b5c5bc2e Author: Libin Yang Date: Thu Apr 9 13:58:19 2020 -0500 ASoC: Intel: boards: support Elkhart Lake with rt5660 This patch adds the support of Intel Elkhart Lake with Realtek rt5660 codec. Signed-off-by: Libin Yang Signed-off-by: Muhammad Nazif Bin Mohd Borhan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200409185827.16255-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a4ed29273376cb1f5aa05b90eb3c4d5877564976 Author: Libin Yang Date: Thu Apr 9 13:58:18 2020 -0500 ASoC: SOF: Intel: add PCI ID for ElkhartLake Add PCI ID for ElkhartLake platform. Signed-off-by: Libin Yang Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20200409185827.16255-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d233c4941630af0ec2e14be7c2a693e9c9ce3087 Author: Libin Yang Date: Thu Apr 9 13:58:17 2020 -0500 ALSA: hda: Add ElkhartLake HDMI codec vid Add HDMI codec vid for the Intel ElkhartLake platform Signed-off-by: Libin Yang Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Acked-by: Takashi Iwai Link: https://lore.kernel.org/r/20200409185827.16255-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3a24f135e6cc58c2dc042dde44031ec31b706ce5 Author: Hui Wang Date: Thu Apr 9 13:58:16 2020 -0500 ASoC: intel/skl/hda - set autosuspend timeout for hda codecs On some Lenovo and HP laptops, if both codec driver and SOF driver are in runtime suspend mode, we plug a headset to the audio jack, the headphone could be detected but Mic couldn't. That is because when plugging, the headphone triggers a unsol event first, and about 0.7s later (on the Lenovo X1 Carbon 7th), the Mic triggers a unsol event. But if the codec driver enters runtime suspend within 0.7s, the Mic can't trigger the unsol event. If we don't set autosuspend_delay to a non-zero value for the hda codec driver, it will enter runtime suspend immediately after the headphone triggers the unsol event. Follow the sequence of legacy hda driver and set a autosuspend delay of 1sec after card registration (refer to pci/hda/hda_intel.c and pci/hda/hda_codec.c). Co-developed-by: Kai Vehmanen Co-developed-by: Jaska Uimonen Signed-off-by: Hui Wang Signed-off-by: Kai Vehmanen Signed-off-by: Jaska Uimonen Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Clarex Zhou Link: https://lore.kernel.org/r/20200409185827.16255-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a8bb72f160020db5d7f81824b2dba6c8e29ef67a Author: Yong Zhi Date: Thu Apr 9 13:58:15 2020 -0500 ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Add dmic16k BE dailink for keyword detection support, FE is added in topology tplg file. Signed-off-by: Yong Zhi Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409185827.16255-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ada018b15ccecbdb95df46db7121516edb906bf6 Author: Thomas Gleixner Date: Fri Feb 14 18:32:43 2020 +0100 x86/mce/amd: Do proper cleanup on error paths Drop kobject reference counts properly on error in the banks and blocks allocation functions. [ bp: Write commit message. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200403161943.1458-2-bp@alien8.de commit e278dcb7048b1a27b559e34b0f5f0e50f06221a2 Author: Andy Shevchenko Date: Mon Apr 13 14:18:25 2020 +0300 pinctrl: intel: Add Intel Jasper Lake pin controller support This driver adds pinctrl/GPIO support for Intel Jasper Lake SoC. The GPIO controller is based on the next generation GPIO hardware but still compatible with the one supported by the Intel core pinctrl/GPIO driver. Cc: Mika Westerberg Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 9bd59157e16c64b45da5315f5b49b659fe51984b Author: Andy Shevchenko Date: Mon Apr 13 14:18:24 2020 +0300 pinctrl: intel: Introduce new flag to force GPIO base to be 0 In some cases not the first group would like to have GPIO base to be 0. It's not possible right now due to 0 has special meaning already. Thus, introduce a new flag to allow drivers to force GPIO base to be 0 on a certain group. It's assumed that it can be only one group per device with such flag enabled. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit d4b41f8bb26d9c0d526784797a7ea77dba7ed21d Author: Andy Shevchenko Date: Mon Apr 13 14:18:23 2020 +0300 pinctrl: tigerlake: Use generic flag for special GPIO base treatment Since we have a generic flag for special GPIO base treatment, use it in the driver. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit cf2f2c3a445f9b45d5baaaf49b7752df33e5d44e Author: Andy Shevchenko Date: Mon Apr 13 14:18:22 2020 +0300 pinctrl: icelake: Use generic flag for special GPIO base treatment Since we have a generic flag for special GPIO base treatment, use it in the driver. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 5ba092edb990b48b522355e7f8ae4be7c37cd7fa Author: Andy Shevchenko Date: Mon Apr 13 14:18:21 2020 +0300 pinctrl: cannonlake: Use generic flag for special GPIO base treatment Since we have a generic flag for special GPIO base treatment, use it in the driver. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit e5a4ab6a55e2308aad546b594c0d8e5b71d21be9 Author: Andy Shevchenko Date: Mon Apr 13 14:18:20 2020 +0300 pinctrl: intel: Introduce common flags for GPIO mapping scheme Few drivers are using the same flag to tell Intel pin control core how to interpret GPIO base. Provide a generic flags so all drivers can use. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 1729025b04b9f242dca37f50dba8dd3705eb1ea1 Author: Kuninori Morimoto Date: Mon Mar 30 10:48:27 2020 +0900 ASoC: soc-core: remove cpu_dai/codec_dai/cpu_dais/codec_dais No-one is using cpu_dai/codec_dai/cpu_dais/codec_dais. Let's remove these from snd_soc_pcm_runtime Signed-off-by: Kuninori Morimoto Tested-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87eetabok4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 01faf501eefa86fa6f334bb9c71a48498de653e6 Author: Kuninori Morimoto Date: Mon Mar 30 10:48:14 2020 +0900 ASoC: soc-core: tidyup soc_new_pcm_runtime() rtd setups soc_new_pcm_runtime() setups rtd, but code is very random. This patch tidyup it. Signed-off-by: Kuninori Morimoto Tested-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87ftdqbokh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 49648d02008dd75ddd84b16f9abf29f24c383519 Author: Kuninori Morimoto Date: Mon Mar 30 10:47:54 2020 +0900 ASoC: soc-core: set rtd->num_cpu/codec at soc_new_pcm_runtime() rtd->cpu_dais/codec_dais are set at soc_new_pcm_runtime(). rtd->num_cpus/codecs should be set there. This patch do it. Signed-off-by: Kuninori Morimoto Tested-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87h7y6bol1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c2233a266178f8937cc26a84cd7672334b5424b7 Author: Kuninori Morimoto Date: Mon Mar 30 10:47:37 2020 +0900 ASoC: soc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer Signed-off-by: Kuninori Morimoto Tested-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87imimboli.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit fa93816ba9ca41885fc7b7bdc5aa8f8fffb372ae Author: Oleksij Rempel Date: Mon Mar 30 14:06:36 2020 +0200 dt-bindings: vendor-prefixes: Add an entry for Protonic Holland Add "prt" entry for Protonic Holland: https://www.protonic.nl/en/ Signed-off-by: Oleksij Rempel Signed-off-by: Rob Herring commit 58fb82ccbccca25fd46775731283eb451fc165ba Author: Ding Xiang Date: Mon Mar 30 18:05:02 2020 +0800 of: of_detach_node() remove unneeded local return variable rc is unneeded, just return 0. Signed-off-by: Ding Xiang Signed-off-by: Rob Herring commit 133bf33effffd2a1e169a2d639de71db9a98b0e3 Author: Neil Armstrong Date: Thu Mar 26 17:59:54 2020 +0100 dt-bindings: sram: Add Amlogic SCP SRAM compatibles Add compatibles for the Amlogic SCP SRAM memory zones. Signed-off-by: Neil Armstrong Signed-off-by: Rob Herring commit e5bff02a101d670960ffdb0d0600b4ff08507836 Author: Geert Uytterhoeven Date: Thu Mar 26 17:38:06 2020 +0100 dt-bindings: usb: generic-ohci: Document power-domains property It is quite common for a generic OHCI block to be embedded in an SoC in its own power domain. Hence allow the DTS writer to describe the controller's position in the power hierarchy, by documenting the optional presence of a "power-domains" property. This gets rid of "make dtbs_check" warnings like: arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dt.yaml: usb@ee080000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Geert Uytterhoeven Reviewed-by: Yoshihiro Shimoda Signed-off-by: Rob Herring commit f98d7c3abca05471706c32ac47ec42fb4c71264d Author: Geert Uytterhoeven Date: Thu Mar 26 17:38:05 2020 +0100 dt-bindings: usb: generic-ehci: Document power-domains property It is quite common for a generic EHCI block to be embedded in an SoC in its own power domain. Hence allow the DTS writer to describe the controller's position in the power hierarchy, by documenting the optional presence of a "power-domains" property. This gets rid of "make dtbs_check" warnings like: arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dt.yaml: usb@ee080100: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Geert Uytterhoeven Reviewed-by: Yoshihiro Shimoda Signed-off-by: Rob Herring commit 2d7401f8632fabea6b55a6c693caaa7436f14187 Author: Anson Huang Date: Thu Mar 12 17:50:13 2020 +0800 ARM: dts: imx7d: Add cpu1 supply Each cpu-core is supposed to list its supply separately, add supply for cpu1. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit f2e3d666a448e239420d6517f29eb3ab06a4740d Author: Anson Huang Date: Thu Mar 12 17:50:12 2020 +0800 ARM: dts: imx7: Correct CPU supply name i.MX7 uses cpufreq-dt driver which requires the CPU supply name to be either "cpu0-supply" or "cpu-supply", correct it. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 41235c8f1093362dc1c47487647b55d3bb035813 Author: Anson Huang Date: Thu Mar 12 17:47:45 2020 +0800 arm64: dts: imx8mn-ddr4-evk: Add secondary cpus supply Each cpu-core is supposed to list its supply separately, add supply for secondary cpus. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit f3fe96017f0968cea4adbf8d191afa7ae8a5084e Author: Anson Huang Date: Thu Mar 12 17:47:44 2020 +0800 arm64: dts: imx8mm-evk: Add secondary cpus supply Each cpu-core is supposed to list its supply separately, add supply for secondary cpus. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit b2acc24c805a42b6ebfe8b8ae09dbf9c994c5604 Author: Ranjani Sridharan Date: Thu Apr 9 13:44:16 2020 -0500 ASoC: soc-core: Add dynamic debug logs in soc_dai_link_sanity_check() When a platform device is created successfully but the machine driver probe fails due to errors with missing components during the card bind stage, no error is propagated or logged. To help flag such problems, add a dynamic debug log. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409184416.15591-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 642646cc4f84e1a7a0002f8ac4660576011abffe Author: Pierre-Louis Bossart Date: Thu Apr 9 13:44:15 2020 -0500 ASoC: SOF: Intel: hda: log number of microphones detected in NHLT tables Log the information extracted from NHLT tables to help support users who report non-functional digital mics with SOF. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409184416.15591-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0d4453e98706d996ba06aa38907eab989822f6ee Author: Pierre-Louis Bossart Date: Thu Apr 9 13:44:14 2020 -0500 ASoC: SOF: Intel: hda: reduce verbosity on SoundWire detection No need to report an error when SoundWire is not detected (not present in hardware or not exposed in ACPI). Move to dev_dbg to state that SoundWire is skipped. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409184416.15591-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 110f44c2ed1be38efff72f078134aea6678adaa8 Author: Pierre-Louis Bossart Date: Thu Apr 9 13:44:13 2020 -0500 ASoC: codecs: rt1308-sdw: reduce verbosity These messages are generated at each enumeration, this is overkill. Move to dev_dbg [ 86.481709] rt1308 sdw:1:25d:1308:0: rt1308_io_init m_btl_l=0xffee, m_btl_r=0xffff [ 86.481714] rt1308 sdw:1:25d:1308:0: rt1308_io_init c_btl_l=0x28c, c_btl_r=0x113 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409184416.15591-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 87a4eca891b6646c05fb6cf4ee026ad621680b10 Author: Jason Yan Date: Thu Apr 9 17:32:59 2020 +0800 EDAC/xgene: Remove set but not used address local var Fix the following gcc warning: drivers/edac/xgene_edac.c:1486:7: warning: variable ‘address’ set but not used [-Wunused-but-set-variable] u32 address; ^~~~~~~ Remove the unused macro RBERRADDR_RD while at it. Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200409093259.20069-1-yanaijie@huawei.com commit f0e0884acf8a5cbd8862834bbd5b7a1db284966b Author: Martin Blumenstingl Date: Tue Mar 31 01:45:35 2020 +0200 clk: meson: meson8b: make the hdmi_sys clock tree mutable The HDMI TX controller requires the hdmi_sys clock to be enabled. Allow changing the whole clock tree now that we know that one of our drivers requires this. Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20200330234535.3327513-3-martin.blumenstingl@googlemail.com commit 778fb6b729080f5ec91dfdb392845304e0e57b3c Author: Martin Blumenstingl Date: Tue Mar 31 01:45:34 2020 +0200 clk: meson8b: export the HDMI system clock Export the HDMI system clock (used by the HDMI transmitter) so it can be used in the dt-bindings. Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Acked-by: Rob Herring Link: https://lore.kernel.org/r/20200330234535.3327513-2-martin.blumenstingl@googlemail.com commit 593309423cbad0fab659a685834416cf12d8f581 Author: Borislav Petkov Date: Sat Apr 4 01:33:05 2020 +0200 x86/32: Remove CONFIG_DOUBLEFAULT Make the doublefault exception handler unconditional on 32-bit. Yes, it is important to be able to catch #DF exceptions instead of silent reboots. Yes, the code size increase is worth every byte. And one less CONFIG symbol is just the cherry on top. No functional changes. Signed-off-by: Borislav Petkov Acked-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200404083646.8897-1-bp@alien8.de commit 805a23de2657c10c2ca96588a309a42df947bb36 Author: Payal Kshirsagar Date: Thu Apr 9 13:48:53 2020 -0500 ASoC: SOF: Intel: hda: remove unnecessary parentheses Remove unnecessary parentheses around the right hand side of an assignment and align the code. Signed-off-by: Payal Kshirsagar Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200409184853.15896-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1d03c19e970e7457b755d736a81e9e8601e1a407 Author: Payal Kshirsagar Date: Thu Apr 9 13:48:52 2020 -0500 ASoC: SOF: remove unneeded variables Remove unneeded temporary local variables and their declarations. Change suggested by coccinelle. Signed-off-by: Payal Kshirsagar Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200409184853.15896-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0dadde344d965566589cd82797893d5aa06557a3 Author: Andy Shevchenko Date: Mon Apr 13 21:04:06 2020 +0300 spi: Respect DataBitLength field of SpiSerialBusV2() ACPI resource By unknown reason the commit 64bee4d28c9e ("spi / ACPI: add ACPI enumeration support") missed the DataBitLength property to encounter when parse SPI slave device data from ACPI. Fill the gap here. Fixes: 64bee4d28c9e ("spi / ACPI: add ACPI enumeration support") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200413180406.1826-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 6d75145bf6b6558dea5ce3b4f83f3f66444bcac0 Author: Christophe JAILLET Date: Mon Apr 13 17:40:43 2020 +0200 spi: sc18is602: Fix a typo in MODULE_DESCRIPTION This should be 'SC18IS602', not 'SC18IC602' Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200413154043.23064-1-christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit e1e2662036c01acc1418942d8febe0e726624669 Author: Tudor Ambarus Date: Mon Apr 13 14:09:25 2020 +0000 ARM: dts: at91: sama5d27_wlsom1: Add alias for i2c0 wlsom1 has an ATECC608A-TNGTLS Secure Element connected on the i2c0 bus. Add alias for the i2c device to not rely on probe order for the i2c device numbering. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200413140922.154886-1-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit ec16d2ab4d0bb0344ae6aab74d642f813984b737 Author: Mauro Carvalho Chehab Date: Tue Apr 14 12:58:59 2020 +0200 media: docs: fix some broken references Some media files got moved. Update the corresponding references to the referenced files. Signed-off-by: Mauro Carvalho Chehab commit 3fbfb4585bfd4ff34e9d3b4edd5b3e49e8f5a541 Author: Mike Rapoport Date: Thu Apr 2 11:16:14 2020 +0300 mips: define pud_index() regardless of page table folding Commit 31168f033e37 ("mips: drop __pXd_offset() macros that duplicate pXd_index() ones") is correct that pud_index() & __pud_offset() are the same when pud_index() is actually provided, however it does not take into account the __PAGETABLE_PUD_FOLDED case. This has broken MIPS KVM compilation because it relied on availability of pud_index(). Define pud_index() regardless of page table folded. It will evaluate to actual index for 4-level pagetables and to 0 for folded PUD level. Link: https://lore.kernel.org/lkml/20200331154749.5457-1-pbonzini@redhat.com Reported-by: Paolo Bonzini Signed-off-by: Mike Rapoport Tested-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit de0c4eb44c39cbb2b3b11bac699b618b0f8d4142 Author: YueHaibing Date: Fri Apr 3 17:49:04 2020 +0800 MIPS: TXx9: Fix Kconfig warnings If TTY and SND is not n, we got this warnings: WARNING: unmet direct dependencies detected for HAS_TXX9_SERIAL Depends on [n]: TTY [=n] && HAS_IOMEM [=y] Selected by [y]: - SOC_TX3927 [=y] WARNING: unmet direct dependencies detected for HAS_TXX9_SERIAL Depends on [n]: TTY [=n] && HAS_IOMEM [=y] Selected by [y]: - SOC_TX4938 [=y] Only dependencies is enabled, they can be enabled, so use 'imply' instead of 'select' to fix this. Signed-off-by: YueHaibing Signed-off-by: Thomas Bogendoerfer commit 6dfcbde592e0fc4d5ab9618764d9849f66e3090c Author: Tomi Valkeinen Date: Wed Mar 25 13:15:10 2020 +0100 media: ti-vpe: cal: fix stop state timeout The stop-state timeout needs to be over 100us as per CSI spec. With the CAL fclk of 266 MHZ on DRA76, with the current value the driver uses, the timeout is 24us. Too small timeout will cause failure to enable the streaming. Also, the fclk can be different on other SoCs, as is the case with AM65x where the fclk is 250 MHz. This patch fixes the timeout by calculating it correctly based on the fclk rate. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 355357457a5880ddeb776e0f61bbb74f49dc5f4c Author: Tomi Valkeinen Date: Wed Mar 25 13:15:09 2020 +0100 media: ti-vpe: cal: improve wait for stop-state Sometimes there is a timeout when waiting for the Stop-State. Testing shows that sometimes we need to wait more than what the current code does. It is not clear how long this wait can be, but it is based on how quickly the sensor provides a valid clock, and how quickly CAL syncs to it. Change the code to make it more obvious how long we'll wait, and set a wider range for usleep_range. Increase the timeout to 750ms. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5125bfeeb6e4ffc47a5cb2715c342c938854cf20 Author: Tiezhu Yang Date: Tue Mar 31 15:00:06 2020 +0800 MIPS: Loongson: Use CONFIG_NR_CPUS_DEFAULT_64 to support more CPUs When I update the mainline kernel on the Loongson 2-way platform which has 8 CPUs, it only shows 4 CPUs due to NR_CPUS is 4, this is obviously wrong. In order to support more CPUs on the Loongson platform, it is better to use CONFIG_NR_CPUS_DEFAULT_64 instead of CONFIG_NR_CPUS_DEFAULT_4 to specify the maximum number of CPUs which the kernel will support. Signed-off-by: Tiezhu Yang Acked-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit c17013918a217cea51ecc4925953d640b0dc8858 Author: Tomi Valkeinen Date: Wed Mar 25 13:15:08 2020 +0100 media: ti-vpe: cal: improve wait for CIO resetdone Sometimes there is a timeout when waiting for the 'ComplexIO Reset Done'. Testing shows that sometimes we need to wait more than what the current code does. It is not clear how long this wait can be, but it is based on how quickly the sensor provides a valid clock, and how quickly CAL syncs to it. Change the code to make it more obvious how long we'll wait, and set a wider range for usleep_range. Increase the timeout to 750ms. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cbdda28ab9302db941d0303d39aa775896e617e4 Author: Tomi Valkeinen Date: Wed Mar 25 13:15:07 2020 +0100 media: ti-vpe: cal: move code to separate functions To make csi2_wait_for_phy() more readable, move code to separate functions. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: delete empty line before } ] Signed-off-by: Mauro Carvalho Chehab commit cd1a746b9b244e39570eb67f9de52c5ae06a136f Author: Tomi Valkeinen Date: Wed Mar 25 13:15:06 2020 +0100 media: ti-vpe: cal: set DMA max seg size Set DMA max seg size correctly to get rid of warnings on 64 bit platforms: DMA-API: cal 6f03000.cal: mapping sg segment longer than device claims to support [len=720896] [max=65536] Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aaf97874882ffefb5cf2a135085fc88169794e2d Author: Tomi Valkeinen Date: Wed Mar 25 13:15:05 2020 +0100 media: ti-vpe: cal: program number of lines properly CAL_CSI2_CTX register has LINES field, which, according to the documentation, should be programmed to the number of lines transmitted by the camera. If the number of lines is unknown, it can be set to 0. The driver sets the field to 0 for some reason, even if we know the number of lines. This patch sets the number of lines properly, which will allow the HW to discard extra lines (if the sensor would send such for some reason), and, according to documentation: "This leads to regular video timings and avoids potential artifacts". Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c1075243e56caf084da9056fb85a98bc9cf22554 Author: Tomi Valkeinen Date: Wed Mar 25 13:15:04 2020 +0100 media: ti-vpe: cal: fix dummy read to phy After ComplexIO reset, a dummy read to PHY is needed as per CAL spec to finish the reset. Currently the driver reads a ComplexIO register, not PHY register. Fix this. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f77f2e1f29469394d9113669a88079863f37fc29 Author: Tomi Valkeinen Date: Wed Mar 25 13:15:03 2020 +0100 media: ti-vpe: cal: cleanup CIO power enable/disable Move the code to enable and disable ComplexIO power to its own function. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fa72ef7abc90575e0fba8c8ecffa532ec6859cd9 Author: Tomi Valkeinen Date: Wed Mar 25 13:15:02 2020 +0100 media: ti-vpe: cal: use reg_write_field Simplify the code by using reg_write_field() where trivially possible. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 05254a2b12ec922602b673780152a40d7517505a Author: Tomi Valkeinen Date: Wed Mar 25 13:15:01 2020 +0100 media: ti-vpe: cal: remove useless IRQ defines Remove a bunch of IRQ defines, of which only CAL_HL_IRQ_ENABLE and CAL_HL_IRQ_CLEAR are used, and these defines only end up obfuscating code. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ad03da58ea57304ca7c78105cb9906336c3d03e6 Author: Tomi Valkeinen Date: Wed Mar 25 13:15:00 2020 +0100 media: ti-vpe: cal: remove useless CAL_GEN_* macros These macros only obfuscate the code, so drop them. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 09ea44ca0743ad0b0b29935916f4fbf296a3cc1a Author: Tomi Valkeinen Date: Wed Mar 25 13:14:59 2020 +0100 media: ti-vpe: cal: simplify irq handling Instead of having identical code block to handle irqs for the two CAL ports, we can have a for loop and a single code block. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8425328585154abf3763b7a701aefa9512fce161 Author: Tomi Valkeinen Date: Wed Mar 25 13:14:58 2020 +0100 media: ti-vpe: cal: print errors on timeouts The driver does not print any errors on ComplexIO reset timeout or when waiting for stop-state, making it difficult to debug and notice problems. Add error prints for these cases. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ffd41d4f1593b2f8f74d1fcc81ea2d38892ada52 Author: Tomi Valkeinen Date: Wed Mar 25 13:14:57 2020 +0100 media: ti-vpe: cal: catch error irqs and print errors CAL reports various errors via IRQs, which are not handled at all by the current driver. Add code to enable and catch those IRQs and print errors. This will make it much easier to notice and debug issues with sensors. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: fix: spaces preferred around that '-'] Signed-off-by: Mauro Carvalho Chehab commit f7271bfb1801f11df6c82c14986d6b2203786f59 Author: Tomi Valkeinen Date: Wed Mar 25 13:14:56 2020 +0100 media: ti-vpe: cal: drop cal_runtime_get/put Now that cal_runtime_get and cal_runtime_put are only direct wrappers to pm_runtime_get/put, we can drop cal_runtime_get and cal_runtime_put. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b6959ca031ab6a86a86947f4ce495b07b03ea22e Author: Tomi Valkeinen Date: Wed Mar 25 13:14:55 2020 +0100 media: ti-vpe: cal: use runtime_resume for errata handling We need to do errata handling every time CAL is being enabled. The code is currently in cal_runtime_get(), which is not the correct place for it. Move the code to cal_runtime_resume, which is called every time CAL is enabled. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 29decd21bb16c4b482ec5b211a50ae545700f823 Author: Tomi Valkeinen Date: Wed Mar 25 13:14:54 2020 +0100 media: ti-vpe: cal: fix use of wrong macro i913_errata() sets a bit to 1 in PHY_REG10, but for some reason uses CAL_CSI2_PHY_REG0_HSCLOCKCONFIG_DISABLE for the bit value. The value of that macro is 1, so it works, but is still wrong. Fix this to 1. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 528649578a87afbf05ab884200e261e7eeaa8a98 Author: Tomi Valkeinen Date: Wed Mar 25 13:14:53 2020 +0100 media: ti-vpe: cal: improve enable_irqs IRQENABLE_SET registers are (usually) not meant to be read, only written to. The current driver needlessly uses read-modify-write cycle to enable IRQ bits. The read-modify-write has no bad side effects here, but it's still better to clean this up by only using write. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3dc4365ba87342b46ffb4140ae1ff9be3599aa7c Author: Tomi Valkeinen Date: Wed Mar 25 13:14:52 2020 +0100 media: ti-vpe: cal: fix DMA memory corruption When the CAL driver stops streaming, it will shut everything down without waiting for the current frame to finish. This leaves the CAL DMA in a slightly undefined state, and when CAL DMA is enabled when the stream is started the next time, the old DMA transfer will continue. It is not clear if the old DMA transfer continues with the exact settings of the original transfer, or is it a mix of old and new settings, but in any case the end result is memory corruption as the destination memory address is no longer valid. I could not find any way to ensure that any old DMA transfer would be discarded, except perhaps full CAL reset. But we cannot do a full reset when one port is getting enabled, as that would reset both ports. This patch tries to make sure that the DMA transfer is finished properly when the stream is being stopped. I say "tries", as, as mentioned above, I don't see a way to force the DMA transfer to finish. I believe this fixes the corruptions for normal cases, but if for some reason the DMA of the final frame would stall a lot, resulting in timeout in the code waiting for the DMA to finish, we'll again end up with unfinished DMA transfer. However, I don't know what could cause such a timeout. Signed-off-by: Tomi Valkeinen Reviewed-by: Benoit Parrot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4b7126a7894849aaf239dad71b9286534d8c1719 Author: Laurent Pinchart Date: Fri Mar 13 00:47:22 2020 +0100 media: imx: imx7-mipi-csis: Implement the .enum_mbus_code() operation Implement the subdev pad .enum_mbus_code() operation to enumerate media bus codes on the sink and source pads. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f89ab84a949f9b7072c4f9d86231d0161fc8fe24 Author: Laurent Pinchart Date: Fri Mar 13 00:47:21 2020 +0100 media: imx: imx7-mipi-csis: Don't use imx-media-utils helpers The imx7-mipi-csis only uses the imx_media_init_mbus_fmt() function from the imx-media-utils helpers. The helpers don't support all the media bus formats used by this driver, and are thus a bad fit. As the MIPI CSIS is a standalone IP core that could be integrated in other SoCs, let's not use the helper. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9994e00d4131986624b24f9aac881c3392cc2714 Author: Laurent Pinchart Date: Fri Mar 13 00:47:20 2020 +0100 media: imx: imx7-mipi-csis: Cleanup includes Remove unneeded includes, add needed ones, and sort them alphabetically. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1d812ad253d4667ee09b902950578184b797879b Author: Laurent Pinchart Date: Fri Mar 13 00:47:19 2020 +0100 media: imx: imx7-mipi-csis: Remove link setup on source pad The driver rejects enablement of multiple links on its source pad. This isn't needed, as the CSIS doesn't care. Drop it. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2c2ae48d3b83ff7a78eb33eb6ee158371e003a85 Author: Laurent Pinchart Date: Fri Mar 13 00:47:18 2020 +0100 media: imx: imx7-mipi-csis: Align macro definitions The register macros at the top of the file have their value not aligned on the same column, hindering readability. Fix it. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eeea9ac2d2a966655868d04ae95c72a353cddc0b Author: Laurent Pinchart Date: Fri Mar 13 00:47:17 2020 +0100 media: imx: imx7-mipi-csis: Never set MIPI_CSIS_ISPCFG_ALIGN_32BIT The MIPI_CSIS_ISPCFG_ALIGN_32BIT bit enables output of 32-bit data. The driver sets it based on the select format, but no format uses a 32-bit bus width, so the bit is never set in practice. This isn't likely to change any time soon, as the CSI IP core connected at the output of the CSIS doesn't support 32-bit data width. Hardcode the bit to 0. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b06bde9ac6836902f1fb50f69493d02d4191d5aa Author: Laurent Pinchart Date: Fri Mar 13 00:47:16 2020 +0100 media: imx: imx7-mipi-csis: Align image width based on format The total number of bits per line needs to be a multiple of 8, which requires aligning the image width based on the format width. The csis_pix_format structure contains a pix_width_alignment field that serves this purpose, but the field is never set. Instead of fixing that, calculate the alignment constraints based on the bus width for the format, and drop the unneeded pix_width_alignment field. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a0ec36a364a73d3af1c7387250a5135d54600d5c Author: Laurent Pinchart Date: Fri Mar 13 00:47:15 2020 +0100 media: imx: imx7-mipi-csis: Rename data_alignment field to width The csis_pix_format data_alignment field stores the bus width. Rename it accordingly. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 083285ac9df3375608b1aae4685d0339a88c48c5 Author: Laurent Pinchart Date: Fri Mar 13 00:47:14 2020 +0100 media: imx: imx7-mipi-csis: Add MEDIA_BUS_FMT_UYVY10_2X10 support Add support for 10-bit YUV 4:2:2. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cb373070bf7575e4cb0a15976702bcb415b2b6d4 Author: Laurent Pinchart Date: Fri Mar 13 00:47:13 2020 +0100 media: imx: imx7-mipi-csis: Fix MEDIA_BUS_FMT_UYVY8_2X8 data alignment The MEDIA_BUS_FMT_UYVY8_2X8 format reports a data alignment of 16 bits, which isn't correct as it is output on an 8-bit bus. Fix it. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0aa09e57b0f6bd46a7e8e4d88ba0045e317d43f9 Author: Laurent Pinchart Date: Fri Mar 13 00:47:12 2020 +0100 media: imx: imx7-mipi-csis: Expose correct YUV formats The imx7-mipi-csis driver claims to support MEDIA_BUS_FMT_VYUY8_2X8 and MEDIA_BUS_FMT_YUYV8_2X8, but this is not correct. When receiving YUV 4:2:2 data on the CSI-2 bus, the output format is MEDIA_BUS_FMT_UYVY8_2X8. Fix this. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d9a7dd2f684c7f4c1a4940d42e25568bc9af32fa Author: Laurent Pinchart Date: Fri Mar 13 00:47:11 2020 +0100 media: imx: imx7-mipi-csis: Add missing RAW formats Add support for all the missing 8-, 10-, 12- and 14-bit RAW formats. This include all Bayer combinations, as well as greyscale. No media bus code exist for Y14 so this is currently left out. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 45cde0aab78096d17e3ea2040854b3e95e3e197e Author: Laurent Pinchart Date: Fri Mar 13 00:47:10 2020 +0100 media: imx: imx7-mipi-csis: Centralize initialization of pad formats Pad formats for the active configuration are manually initialized in mipi_csis_subdev_init(), while pad formats for the TRY configurations are initialized by the subdev .init_cfg() operation. This creates a risk of the two configurations not being synchronized. Fix it by initializing formats in the .init_cfg() operation only, and calling it from mipi_csis_subdev_init(). Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d321dd233b9f2bb407b8e6b4759408f09ec207c3 Author: Laurent Pinchart Date: Fri Mar 13 00:47:09 2020 +0100 media: imx: imx7-mipi-csis: Cleanup and fix subdev pad format handling The subdev set pad format operation currently misbehaves in multiple ways: - mipi_csis_try_format() unconditionally stores the format in the device state, even for V4L2_SUBDEV_FORMAT_TRY. - The format is never stored in the pad cfg, but the pad cfg format always overwrites the format requested by the user. - The sink format is not propagated to the source. Fix all this by reworking the set format operation as follows: 1. For the source pad, turn set() into get() as the source format is not modifiable. 2. Validate the requested format and updated the stored format accordingly. 3. Return the format actually set. 4. Propagate the format from sink to source. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 07f8f22a33a9e3e9955e24a84e2f856dcc8c31c4 Author: Mansur Alisha Shaik Date: Fri Apr 10 09:17:25 2020 +0200 media: venus: core: remove CNOC voting while device suspend The Venus driver is voting Configuration NoC during .probe but not clear voting in .suspend. Because of this NoC is up during shutdown also. As a consequence the whole device could leak energy while in .suspend. So correct this by moving voting in .resume and unvoting in .suspend Signed-off-by: Mansur Alisha Shaik Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 0f61e171e4bbac4595175070c75707f1b12f4e37 Author: Gustavo A. R. Silva Date: Thu Mar 19 23:22:29 2020 +0100 media: venus: hfi_msgs.h: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 380f3bbd9562dc93be2e3cadc329b15284fbedae Author: Gustavo A. R. Silva Date: Thu Mar 19 23:21:05 2020 +0100 media: venus: hfi_cmds.h: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 63342afea65e9efa06889775c27001745e157770 Author: Stanimir Varbanov Date: Thu Jan 30 16:44:24 2020 +0100 media: venus: vdec: Use pmruntime autosuspend Implement pmruntime autosuspend in video decoder. This will allow to save power while the userspace is inactive for some reasonable period of time. Here we power-off venus core clocks and power domain and don't touch vcodec because it is under hardware control. The later decision is made to simplify the code and avoid a mess in the power management code. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit e1ebe9f9c88e5a78fcc4670a9063c9b3cd87dda4 Author: Bingbu Cao Date: Tue Mar 24 05:16:48 2020 +0100 media: staging: imgu: do not hold spinlock during freeing mmu page table ImgU need set the mmu page table in memory as uncached, and set back to write-back when free the page table by set_memory_wb(), set_memory_wb() can not do flushing without interrupt, so the spinlock should not be hold during ImgU page alloc and free, the interrupt should be enabled during memory cache flush. This patch release spinlock before freeing pages table. Signed-off-by: Bingbu Cao Reviewed-by: Tomasz Figa Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9611ba28d8508dcb92837a47a639b79598cbcc53 Author: Bingbu Cao Date: Tue Mar 31 15:00:40 2020 +0200 media: ipu3.rst: add yuv-downscaling into pipeline diagram For ipu3 ImgU image processing, the frame data from TNR can feed into DDR by Output Formatting System or feed into YUV downscaler to do YUV downscaling for secondary output, which is usually used for display. current ImgU image pipeline diagram misses the YUV downscaling, this patch add it to aligh with actual hardware blocks. Signed-off-by: Bingbu Cao Suggested-by: Sakari Ailus Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f744d9a4fee3a80f341eb04dad92256b513790ab Author: Deepak R Varma Date: Tue Mar 31 01:20:57 2020 +0200 media: staging/intel-ipu3: Simplify single goto jump On successful node setup, the code jumps to a cleanup label to perform nodes cleanup. This only call to cleanup using goto label can be included in the for / if blocks to make it look more associated. Signed-off-by: Deepak R Varma Reviewed-by: Stefano Brivio Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ce7d96a4a77d3db1ae86415c0a74bf812dc81103 Author: Bingbu Cao Date: Mon Mar 30 11:05:14 2020 +0200 media: doc-rst: add yavta test example in ipu3 docs This patch add yavta test command in ipu3.rst as an example on how to run simple ImgU test using yavta. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit bfcba38d95a0aed146a958a84a2177af1459eddc Author: Tomi Valkeinen Date: Wed Mar 25 13:20:00 2020 +0100 media: ov5640: fix use of destroyed mutex v4l2_ctrl_handler_free() uses hdl->lock, which in ov5640 driver is set to sensor's own sensor->lock. In ov5640_remove(), the driver destroys the sensor->lock first, and then calls v4l2_ctrl_handler_free(), resulting in the use of the destroyed mutex. Fix this by calling moving the mutex_destroy() to the end of the cleanup sequence, as there's no need to destroy the mutex as early as possible. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Cc: stable@vger.kernel.org # v4.14+ Reviewed-by: Benoit Parrot Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 34b7db6fff8d977398234cd6393c620787989e68 Author: Deepak R Varma Date: Wed Mar 25 21:56:44 2020 +0100 media: staging/intel-ipu3: Remove extra blank lines Remove extra blank lines from the code blocks. Signed-off-by: Deepak R Varma Reviewed-by: Stefano Brivio Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9581ba4596e073659280f9fd95a73fbaadb973eb Author: Deepak R Varma Date: Wed Mar 25 21:38:24 2020 +0100 media: staging/intel-ipu3: css: simplify expression An array index computed inside square brackets complicates the code and also extends the line beyond 80 character. Add new variable to compute array index separately and use it as an index during assignment. Signed-off-by: Deepak R Varma Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 33e3c349b2bf1235be458df09fb8d237141486c4 Author: Bingbu Cao Date: Thu Mar 26 15:54:37 2020 +0100 media: staging/intel-ipu3: Implement lock for stream on/off operations Currently concurrent stream off operations on ImgU nodes are not synchronized, leading to use-after-free bugs (as reported by KASAN). [ 250.090724] BUG: KASAN: use-after-free in ipu3_dmamap_free+0xc5/0x116 [ipu3_imgu] [ 250.090726] Read of size 8 at addr ffff888127b29bc0 by task yavta/18836 [ 250.090731] Hardware name: HP Soraka/Soraka, BIOS Google_Soraka.10431.17.0 03/22/2018 [ 250.090732] Call Trace: [ 250.090735] dump_stack+0x6a/0xb1 [ 250.090739] print_address_description+0x8e/0x279 [ 250.090743] ? ipu3_dmamap_free+0xc5/0x116 [ipu3_imgu] [ 250.090746] kasan_report+0x260/0x28a [ 250.090750] ipu3_dmamap_free+0xc5/0x116 [ipu3_imgu] [ 250.090754] ipu3_css_pool_cleanup+0x24/0x37 [ipu3_imgu] [ 250.090759] ipu3_css_pipeline_cleanup+0x61/0xb9 [ipu3_imgu] [ 250.090763] ipu3_css_stop_streaming+0x1f2/0x321 [ipu3_imgu] [ 250.090768] imgu_s_stream+0x94/0x443 [ipu3_imgu] [ 250.090772] ? ipu3_vb2_buf_queue+0x280/0x280 [ipu3_imgu] [ 250.090775] ? vb2_dma_sg_unmap_dmabuf+0x16/0x6f [videobuf2_dma_sg] [ 250.090778] ? vb2_buffer_in_use+0x36/0x58 [videobuf2_common] [ 250.090782] ipu3_vb2_stop_streaming+0xf9/0x135 [ipu3_imgu] Implemented a lock to synchronize imgu stream on / off operations and the modification of streaming flag (in struct imgu_device), to prevent these issues. Reported-by: Laurent Pinchart Suggested-by: Laurent Pinchart Signed-off-by: Rajmohan Mani Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e671ed99f843e0c783c63d731a03c52f7073ae51 Author: Mauro Carvalho Chehab Date: Tue Apr 14 12:09:12 2020 +0200 media: vimc: fix kernel-doc markups There are several markups there that doesn't follow the specs. Fields should be like: @foo: with a collon at the end. Also, continuation lines should be aligned. Failing to do that would cause kernel-doc to parse it wrong. Some of the troubles will even cause warnings: $ ./scripts/kernel-doc -none drivers/media/test_drivers/vimc/vimc-common.h drivers/media/test_drivers/vimc/vimc-common.h:59: error: Cannot parse struct or union! drivers/media/test_drivers/vimc/vimc-common.h:77: warning: Function parameter or member 'bpp' not described in 'vimc_pix_map' drivers/media/test_drivers/vimc/vimc-common.h:120: warning: Function parameter or member 'pipe_cfg' not described in 'vimc_device' drivers/media/test_drivers/vimc/vimc-common.h:120: warning: Function parameter or member 'ent_devs' not described in 'vimc_device' drivers/media/test_drivers/vimc/vimc-common.h:120: warning: Function parameter or member 'mdev' not described in 'vimc_device' drivers/media/test_drivers/vimc/vimc-common.h:120: warning: Function parameter or member 'v4l2_dev' not described in 'vimc_device' drivers/media/test_drivers/vimc/vimc-common.h:137: warning: Function parameter or member 'add' not described in 'vimc_ent_type' drivers/media/test_drivers/vimc/vimc-common.h:137: warning: Function parameter or member 'unregister' not described in 'vimc_ent_type' drivers/media/test_drivers/vimc/vimc-common.h:137: warning: Function parameter or member 'release' not described in 'vimc_ent_type' drivers/media/test_drivers/vimc/vimc-common.h:150: warning: Function parameter or member 'name' not described in 'vimc_ent_config' drivers/media/test_drivers/vimc/vimc-common.h:150: warning: Function parameter or member 'type' not described in 'vimc_ent_config' drivers/media/test_drivers/vimc/vimc-common.h:197: warning: bad line: flags of the pads Signed-off-by: Mauro Carvalho Chehab commit 9d3bf4cd9f1e04012679aca71db4ff540b8bf30d Author: Ezequiel Garcia Date: Sat Mar 28 15:44:16 2020 +0100 media: vim2m: Remove unneeded buffer lock This spinlock is used solely to call v4l2_m2m_buf_done(). Since buffers are obtained only after being removed from the ready queue, there's no concurrent access, and so no need for synchronization. Remove the spinlock to make sure no one copies this pattern. Some archaeology shows this is a small leftover from ancient code. This driver (then called m2m_testdev) used the videobuf1 framework; commit d80ee38cd845 ("[media] v4l: mem2mem: port m2m_testdev to vb2") converted it to videobuf2. The spinlock was then no longer needed, and this simply went unnoticed. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e472d6a2594bb78277c5c7272f8867652aee9591 Author: Dafna Hirschfeld Date: Tue Mar 31 20:45:15 2020 +0200 media: vimc: add vimc_ent_type struct for the callbacks of entities Since each vimc entity type is defined by the callbacks implementation, it is a good idea to add a struct to hold these callbacks. Each vimc entity then declare its type in the file for the entity. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5aa0d0964b98100595dcdbf3af12f45c579a8198 Author: Dafna Hirschfeld Date: Sat Mar 28 08:52:53 2020 +0100 media: vimc: fix issues in documentation in vimc-common.h There are some missing and extra fields and typos in structs documentations in vimc-common.h. Fix it. [mchehab+huawei@kernel.org: add a missing ':' after @bayer field] Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 967534cb49cd389b101848fa0c99dd8a1e961fbb Author: Dafna Hirschfeld Date: Sat Mar 28 08:52:52 2020 +0100 media: vimc: keep the error value when adding an entity fails Currently when the 'add' callback of an entity fails, a NULL is returned. This hides the error code of the failure and always returns -EINVAL. Replace return NULL with return ERR_PTR(ret) to improve debugging. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7a040cf303438c567fceb987f10cfd058619f2c9 Author: Dafna Hirschfeld Date: Sat Mar 28 08:52:51 2020 +0100 media: vimc: handle error in vimc_add_subdevs In case the 'add' callback of an entity fails, then all other entities should unregister and released. This should be done inside vimc_add_subdevs so that the function handles its own failure. In order to call vimc_unregister_subdevs and vimc_release_subdevs from vimc_add_subdevs, the order of the function should change. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4ce4646c23373b20a156b73b398dc04aea14fce8 Author: Dafna Hirschfeld Date: Sat Mar 28 08:52:50 2020 +0100 media: vimc: remove the function vimc_unregister The function vimc_unregister is called only from one place in the code and has only 3 lines so it has no justification. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5c990fa01fb2803150c5ebd031753a884976c6d3 Author: Adrian Ratiu Date: Tue Mar 24 17:04:29 2020 +0100 media: coda: jpeg: support optimized huffman tables Each jpeg can have the huffman tables optimized for its specific content meaning that the table lenghts and values don't match the standard table of substitutions so there's no reason to hardcode and expect the standard lengths, otherwise we just end up rejecting optimized jpegs altogether. Tested on CODA960. Signed-off-by: Adrian Ratiu Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 15c3d5aae73ecfe8cad916000cf42b85197e7308 Author: Philipp Zabel Date: Wed Mar 18 19:35:36 2020 +0100 media: coda: lock capture queue wakeup against decoder stop command Similar to commit 9ee50a9489f1 ("media: coda: lock capture queue wakeup against encoder stop command"), make sure that a JPEG decoder stop command running concurrently with a decoder finish_run always either flags the last returned buffer or wakes up the capture queue to signal the end of stream condition afterwards. This was not necessary for BIT processor contexts because of the need to release the bitstream buffer with the stream end condition. In contrast, the JPEG decoder can be finished with decoding the image between the time the application queues the last output buffer and the time it issues the decoder stop command. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1e34e446d79cbc85b14e881a7198ee6617909f13 Author: Philipp Zabel Date: Wed Mar 18 19:35:35 2020 +0100 media: coda: mark last capture buffer If a JPEG decoding application queues the last capture and output buffers, issues a decoder stop command after the decoding is already done, and then dequeues the last capture buffer, it is not marked as last. Detect this condition in the decoder stop command and mark the last buffer on the capture done list. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d2f1db8608527bed9478d87e710aa1a8bac8f40a Author: Philipp Zabel Date: Wed Mar 18 19:35:34 2020 +0100 media: coda: split marking last meta into helper function Split marking the last metadata entry into a helper function to simplify coda_decoder_cmd. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 12310819a26aa567a9b80b675c2d4970ca797c0d Author: Philipp Zabel Date: Wed Mar 18 19:35:33 2020 +0100 media: coda: jpeg: add CODA960 JPEG decoder support This patch adds JPEG decoding support for CODA960, handling the JPEG hardware directly. A separate JPEG decoder video device is created due to the separate hardware unit and different supported pixel formats. While the hardware can not change subsampling on the fly, it can decode 4:2:2 subsampled JPEG images into YUV422P. [m.felsch@pengutronix.de: fix qsequence counting by explicitly checking for the !use_bit case] [hverkuil-cisco@xs4all.nl: fix 'warning: missing braces around initializer'] [mchehab+huawei@kernel.org: fix 'BRACES: Unbalanced braces around else statement'] Signed-off-by: Philipp Zabel Signed-off-by: Marco Felsch Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 50733b5b9102da5b2415e3497aa89588396e4f20 Author: Philipp Zabel Date: Wed Mar 18 19:35:32 2020 +0100 media: add v4l2 JPEG helpers Add helpers for JPEG header parsing. They allow both scanning for marker segment positions and later parsing the segments individually, as required by s5p-jpeg, as well as parsing all headers in one go, as required by coda-vpu. The frame header is always parsed, as basically all decoders are interested in width, height, and number of components. For convenience, the JPEG chroma subsampling factors are decoded into a v4l2_jpeg_chroma_subsampling enum. Only baseline and extended sequential DCT encoded JPEGs with 8-bit or 12-bit precision with up to four components are supported. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dbe939814cfa0154421ab1643f48b7cdd379d522 Author: Philipp Zabel Date: Wed Mar 18 19:35:31 2020 +0100 media: coda: round up decoded buffer size for all codecs The BIT decoders always write 16x16 macroblocks. Align stride and height to avoid spilling luma data into the top of the chroma planes. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 58d4c14ed89ca51c782cab7ae6bf2c5215109204 Author: Dafna Hirschfeld Date: Mon Mar 16 08:01:23 2020 +0100 media: v4l2-common: Add BGR666 to v4l2_format_info Add V4L2_PIX_FMT_BGR666 to the format table. Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4eaaf0861fa601fdbceacae6248ffb1d28e1259c Author: Dafna Hirschfeld Date: Mon Mar 16 16:56:26 2020 +0100 media: doc-rst: in the RGB formats table add '-' in undefined bits In the table of the RGB formats, add an explicit '-' signs to cells that contain undefined bits. This makes it more clear how many bits and bytes are used for each format. Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 48b2bce8c7db92601145e1204fa7048b1f74e442 Author: Keerthy Date: Tue Apr 7 11:21:14 2020 +0530 thermal: k3: Add support for bandgap sensors Add VTM thermal support. In the Voltage Thermal Management Module(VTM), K3 AM654 supplies a voltage reference and a temperature sensor feature that are gathered in the band gap voltage and temperature sensor (VBGAPTS) module. The band gap provides current and voltage reference for its internal circuits and other analog IP blocks. The analog-to-digital converter (ADC) produces an output value that is proportional to the silicon temperature. Currently reading temperatures only is supported. There are no active/passive cooling agent supported. Signed-off-by: Keerthy Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200407055116.16082-3-j-keerthy@ti.com commit 3dc748754d68b5893307c3c68acfc67f76110ecf Author: Keerthy Date: Tue Apr 7 11:21:13 2020 +0530 dt-bindings: thermal: k3: Add VTM bindings documentation Add VTM bindings documentation. In the Voltage Thermal Management Module(VTM), K3 AM654 supplies a voltage reference and a temperature sensor feature that are gathered in the band gap voltage and temperature sensor (VBGAPTS) module. The band gap provides current and voltage reference for its internal circuits and other analog IP blocks. The analog-to-digital converter (ADC) produces an output value that is proportional to the silicon temperature. Signed-off-by: Keerthy Reviewed-by: Rob Herring Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200407055116.16082-2-j-keerthy@ti.com commit 8cb775bb005c568857ba7909a1c5a297ed4c33ee Author: Markus Elfring Date: Sun Apr 5 18:35:16 2020 +0200 thermal: Delete an error message in four functions The function “platform_get_irq” can log an error already. Thus omit redundant messages for the exception handling in the calling functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Amit Kucheria Reviewed-by: Keerthy Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/05f49ae7-5cc7-d6a0-fc3d-abaf2a0b373c@web.de commit 0145f67866b71e8c1da3c1d9412623db7ba8a0c8 Author: Daniel Lezcano Date: Thu Apr 2 16:27:47 2020 +0200 thermal: Remove thermal_zone_device_update() stub All users of the function depends on THERMAL, no stub is needed. Remove it. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-9-daniel.lezcano@linaro.org commit 708418500644c248d6f266e4df0bf43ce53bf746 Author: Daniel Lezcano Date: Thu Apr 2 16:27:46 2020 +0200 thermal: Remove stubs for thermal_zone_[un]bind_cooling_device All callers of the functions depends on THERMAL, it is pointless to define stubs. Remove them. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-8-daniel.lezcano@linaro.org commit 60518260cab21e749704baa5246ff13f7559fa91 Author: Daniel Lezcano Date: Thu Apr 2 16:27:45 2020 +0200 thermal: Change IS_ENABLED to IFDEF in the header file The thermal framework can not be compiled as a module. The IS_ENABLED macro is useless here and can be replaced by an ifdef. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-7-daniel.lezcano@linaro.org commit 06f1041f5023c00a54f63c269b997c61d1b3b739 Author: Daniel Lezcano Date: Thu Apr 2 16:27:44 2020 +0200 thermal: Move get_thermal_instance to the internal header The function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it. Move the definition to the internal header and allow better self-encapsulation. Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-6-daniel.lezcano@linaro.org commit f0129c231772a85a726b233756cdc58ea42a9d84 Author: Daniel Lezcano Date: Thu Apr 2 16:27:43 2020 +0200 thermal: Move get_tz_trend to the internal header The function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it. Move the definition to the internal header and allow better self-encapsulation. Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-5-daniel.lezcano@linaro.org commit 2e7700dc336dde93cdc9394d10ccd79593fff214 Author: Daniel Lezcano Date: Thu Apr 2 16:27:42 2020 +0200 thermal: Move trip point structure definition to private header The struct thermal_trip is only used by the thermal internals, it is pointless to export the definition in the global header. Move the structure to the thermal_core.h internal header. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-4-daniel.lezcano@linaro.org commit 33a88af10944edc7fd390000cd6bc9bbde918bc3 Author: Daniel Lezcano Date: Thu Apr 2 16:27:41 2020 +0200 thermal: Move internal IPA functions The exported IPA functions are used by the IPA. It is pointless to declare the functions in the thermal.h file. For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file. As the users depends on THERMAL then it is pointless to have the stub, remove them. Take also the opportunity to fix checkpatch warnings/errors when moving the code around. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-3-daniel.lezcano@linaro.org commit c68df440b07f88210c5839d4507b5cbfa35e3df9 Author: Daniel Lezcano Date: Thu Apr 2 16:27:40 2020 +0200 thermal: Move struct thermal_attr to the private header The structure belongs to the thermal core internals but it is exported in the include/linux/thermal.h For better self-encapsulation and less impact for the compilation if a change is made on it. Move the structure in the thermal core internal header file. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-2-daniel.lezcano@linaro.org commit 8097db407a08f33236b6fa6ba8b62d669321c720 Author: Daniel Lezcano Date: Thu Apr 2 16:27:39 2020 +0200 thermal: Move default governor config option to the internal header The default governor set at compilation time is a thermal internal business, no need to export to the global thermal header. Move the config options to the internal header. Signed-off-by: Daniel Lezcano Reviewed-by: Amit Kucheria Acked-by: Zhang Rui Link: https://lore.kernel.org/r/20200402142747.8307-1-daniel.lezcano@linaro.org commit 04fa9c804b0ed50a3c6bae1d4b60a2494c81a23f Author: Matthias Kaehlcke Date: Wed Mar 18 11:45:46 2020 +0000 thermal: devfreq_cooling: Use PM QoS to set frequency limits Now that devfreq supports limiting the frequency range of a device through PM QoS make use of it instead of disabling OPPs that should not be used. The switch from disabling OPPs to PM QoS introduces a subtle behavioral change in case of conflicting requests (min > max): PM QoS gives precedence to the MIN_FREQUENCY request, while higher OPPs disabled with dev_pm_opp_disable() would override MIN_FREQUENCY. Signed-off-by: Matthias Kaehlcke Reviewed-by: Lukasz Luba Reviewed-by: Chanwoo Choi Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200318114548.19916-4-lukasz.luba@arm.com commit 44fc73223eebaf4a0c970072819d34ff1d92ce7b Author: Daniel Lezcano Date: Tue Mar 31 18:54:49 2020 +0200 thermal: core: Remove pointless debug traces The last temperature and the current temperature are show via a dev_debug. The line before, those temperature are also traced. It is pointless to duplicate the traces for the temperatures, remove the dev_dbg traces. Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba Reviewed-by: Amit Kucheria Link: https://lore.kernel.org/r/20200331165449.30355-2-daniel.lezcano@linaro.org commit bceb5646a15dad49ceb29ec16b8acc10075d0627 Author: Daniel Lezcano Date: Tue Mar 31 18:54:48 2020 +0200 thermal: core: Make thermal_zone_set_trips private The function thermal_zone_set_trips() is used by the thermal core code in order to update the next trip points, there are no other users. Move the function definition in the thermal_core.h, remove the EXPORT_SYMBOL_GPL and document the function. Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba Reviewed-by: Amit Kucheria Link: https://lore.kernel.org/r/20200331165449.30355-1-daniel.lezcano@linaro.org commit d2bc4dd91da6095a769fdc9bc519d3be7ad5f97a Author: Anson Huang Date: Thu Mar 26 11:13:31 2020 +0800 thermal: imx_sc_thermal: Add hwmon support Expose i.MX SC thermal sensors as HWMON devices. Signed-off-by: Anson Huang Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1585192411-25593-1-git-send-email-Anson.Huang@nxp.com commit 67f373122bcc5ee1b7b60e3c726b25f8e205da6b Merge: 8f3d9f354286 7395fb496577 Author: Kalle Valo Date: Tue Apr 14 12:39:43 2020 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.8. Major changes: ath11k * add debugfs file for testing ADDBA and DELBA ath10k * enable VHT160 and VHT80+80 modes * enable radar detection in secondary segment * sdio: disable TX complete indication to improve throughput commit cdb82f826eca487cda530909e543b6cfee61d89b Author: Steve Longerbeam Date: Thu Mar 19 23:59:36 2020 +0100 media: imx.rst: Add example media graphs Add the media graph topologies for the i.MX6Q SabreSD and SabreAuto. This makes it easier to understand the topology and follow the entity descriptions in the following sections. Also clarify that the SabreSD and SabreLite media pipeline config examples are for the i.MX6Q boards. Signed-off-by: Steve Longerbeam Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7ca02435ff25fd384dc7e02da7ea01fe2799ffce Author: Dafna Hirschfeld Date: Mon Mar 23 18:36:18 2020 +0100 media: v4l2-common: change the pixel_enc of V4L2_PIX_FMT_GREY to YUV V4L2_PIX_FMT_GREY format is Ycbcr format without the color data, therefore its pixel_enc should set to V4L2_PIXEL_ENC_YUV. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 479ce8f5b1fb56fffa29ba737fd70ce5f574a365 Author: Wolfram Sang Date: Thu Mar 26 22:09:46 2020 +0100 media: usb: pvrusb2: convert to use i2c_new_client_device() Move away from the deprecated API. Signed-off-by: Wolfram Sang Acked-by: Mike Isely Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f263c8514a38619b17ece1ed37537bff8e25f2af Author: Wolfram Sang Date: Thu Mar 26 22:09:45 2020 +0100 media: usb: hdpvr: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cb3c38c93ac35aedacef6ddde72b975fe3bc9490 Author: Wolfram Sang Date: Thu Mar 26 22:09:44 2020 +0100 media: usb: cx231xx: convert to use i2c_new_client_device() Move away from the deprecated API and make use of the fact that unregistering devices is NULL- and ERR_PTR-safe. Signed-off-by: Wolfram Sang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 03c87596b71a63cd62afe738666017857ead5fdb Author: Wolfram Sang Date: Thu Mar 26 22:09:43 2020 +0100 media: marvell-ccic: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b041cb6362db77bb60e9dda0b89ec653ed2cc4f0 Author: Wolfram Sang Date: Thu Mar 26 22:09:42 2020 +0100 media: pci: saa7134: convert to use i2c_new_client_device() Move away from the deprecated API. Signed-off-by: Wolfram Sang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 286e78a9b508728604b40f39e0051d00f894a807 Author: Wolfram Sang Date: Thu Mar 26 22:09:41 2020 +0100 media: pci: cx88: convert to use i2c_new_client_device() Move away from the deprecated API and make use of the fact that unregistering devices is NULL- and ERR_PTR-safe. Signed-off-by: Wolfram Sang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 493362dd7b9fe29758fb2976ee8de5efa520451a Author: Christophe JAILLET Date: Mon Apr 13 06:15:56 2020 +0200 EDAC/armada_xp: Fix some log messages Fix spelling (s/Aramda/Armada/) in a log message and in a comment. While at it, add a trailing '\n' in messages. Signed-off-by: Christophe JAILLET Signed-off-by: Borislav Petkov Reviewed-by: Jan Luebbe Link: https://lkml.kernel.org/r/20200413041556.3514-1-christophe.jaillet@wanadoo.fr commit ba445b7ff43b3e45836a9a290efdc3a36ea63941 Author: Ezequiel Garcia Date: Thu Mar 26 20:13:43 2020 +0100 media: dt-bindings: rockchip-vpu: Convert bindings to json-schema Convert Rockchip VPU (Hantro IP block) codec driver documentation to json-schema. Signed-off-by: Ezequiel Garcia Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 88d06362d1d052e4c844ac95a2ca308ed4d90452 Author: Ezequiel Garcia Date: Wed Mar 25 22:34:37 2020 +0100 media: hantro: Refactor for V4L2 API spec compliancy Refactor how S_FMT and TRY_FMT are handled, and also make sure internal initial format and format reset are done properly. The latter is achieved by making sure the same hantro_{set,try}_fmt helpers are called on all paths that set the format (which is part of the driver state). This commit removes the following v4l2-compliance warnings: test VIDIOC_G_FMT: OK fail: v4l2-test-formats.cpp(711): Video Capture Multiplanar: TRY_FMT(G_FMT) != G_FMT test VIDIOC_TRY_FMT: FAIL fail: v4l2-test-formats.cpp(1116): Video Capture Multiplanar: S_FMT(G_FMT) != G_FMT test VIDIOC_S_FMT: FAIL Reported-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 774ffd751a94eb6a5c7c6f809ea1ea7203591920 Author: Ezequiel Garcia Date: Wed Mar 25 22:34:36 2020 +0100 media: hantro: Move H264 motion vector calculation to a helper Move the extra bytes calculation that are needed for H264 motion vector to a helper. This is just a cosmetic cleanup. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c9f98d9aeb0914c05d18d97a7aa89feb5fedb10f Author: Ezequiel Garcia Date: Wed Mar 25 22:34:35 2020 +0100 media: hantro: Remove unneeded hantro_dec_buf_finish Since now .buf_prepare takes care of setting the buffer payload size, we can get rid of this, at least for decoders. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 28a202c55963386b8bc45bcc52029362e9aa0d33 Author: Ezequiel Garcia Date: Wed Mar 25 22:34:34 2020 +0100 media: hantro: Use v4l2_m2m_buf_done_and_job_finish Let the core sort out the nuances of returning buffers to userspace, by using the v4l2_m2m_buf_done_and_job_finish helper. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6837e43e9ca11c49eac175326a736ee1bd2de516 Author: Ezequiel Garcia Date: Wed Mar 25 22:34:33 2020 +0100 media: hantro: Set buffers' zeroth plane payload in .buf_prepare Buffers' zeroth plane payload size is calculated at format negotiation time, and so it can be set in .buf_prepare. Keep in mind that, to make this change easier, hantro_buf_prepare is refactored, using the cedrus driver as reference. This results in cleaner code as byproduct. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e1e213b1b0e4c785bac8bfa52130996105bffb62 Author: Ezequiel Garcia Date: Wed Mar 25 22:34:32 2020 +0100 media: v4l2-mem2mem: return CAPTURE buffer first When the request API is used, typically an OUTPUT (src) buffer will be part of a request. A userspace process will be typically blocked, waiting on the request file descriptor. Returning the OUTPUT (src) buffer will wake-up such processes, who will immediately attempt to dequeue the CAPTURE buffer, only to find it's still unavailable. Therefore, change v4l2_m2m_buf_done_and_job_finish returning the CAPTURE (dst) buffer first, to avoid signalling the request file descriptor prematurely, i.e. before the CAPTURE buffer is done. When the request API is not used, this change should have no impact. Tested-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 16863fbc1cf2618f5d35b37cb23119d09b8cc3b2 Author: Christophe JAILLET Date: Sun Apr 12 11:07:43 2020 +0200 HID: fix typo in Kconfig Fix 2 typos: s/Uninterruptable/Uninterruptible/ s/should't/shouldn't/ Signed-off-by: Christophe JAILLET Signed-off-by: Jiri Kosina commit 2ae6193a1b95a128d040f0181d592bbf2705407b Author: Stephan Gerhold Date: Sun Apr 5 19:32:51 2020 +0200 ARM: dts: ux500: samsung-golden: Add proximity sensor samsung-golden has the same sharp,gp2ap002s00f proximity sensor that is also used in samsung-skomer. A driver was added for it in commit 97d642e23037 ("iio: light: Add a driver for Sharp GP2AP002x00F"). Now that it was merged we can add an entry for it in the device tree for samsung-golden. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20200405173252.67614-1-stephan@gerhold.net Signed-off-by: Linus Walleij commit 85f7cd3a2aadd3be9652ce105370f561ff755a26 Author: Mauro Carvalho Chehab Date: Tue Apr 14 11:00:30 2020 +0200 Revert "media: Kconfig: better support hybrid TV devices" Changing from "depends on" to "select" may cause some side-effects. This patch is not ready to be merged yet, as it requires some adjustments. So, let's revert it. This reverts commit a3b91d8bd1e034c8ed89d3f55243478af97a0a52. Signed-off-by: Mauro Carvalho Chehab commit 911d1ef131945f57b7c229331da18c8fc9727efd Author: Stephan Gerhold Date: Thu Dec 19 21:20:52 2019 +0100 ARM: defconfig: u8500: Enable new drivers for samsung-golden The new device tree for samsung-golden depends on some additional drivers that are not selected in the u8500 defconfig yet: - Bluetooth: hci_bcm - WiFi: brcmfmac - Touchscreen: atmel_mxt_ts - Vibrator: gpio-vibra - Sensors: inv_mpu6050 (IMU) Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20191219202052.19039-10-stephan@gerhold.net Signed-off-by: Linus Walleij commit 07f2fee91937283fddebd4b2f666da024738e84c Author: Christoph Hellwig Date: Sat Apr 4 11:40:58 2020 +0200 i915/gvt: remove unused xen bits No Xen support anywhere here. Remove a dead declaration and an unused include. Signed-off-by: Christoph Hellwig Acked-by: Zhenyu Wang Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200404094101.672954-4-hch@lst.de commit d29e1ef4d638a6be59a8859b4994b457bb7348c5 Author: Mauro Carvalho Chehab Date: Tue Mar 10 13:57:48 2020 +0100 media: docs: get rid of Documentation/media/ Now that everything got moved, we can get rid of the old media directory. Signed-off-by: Mauro Carvalho Chehab commit b36343861b218d24d4e568c4de8921b15c2cc8a8 Author: Mauro Carvalho Chehab Date: Fri Mar 6 08:50:46 2020 +0100 media: docs: add an uAPI chapter for driver-specific stuff There are some uAPI stuff that are driver-specific. Add them to the main media uAPI body. Signed-off-by: Mauro Carvalho Chehab commit 577a7ad33aeff86f6c97277b12b122a0a2ad97d7 Author: Mauro Carvalho Chehab Date: Wed Mar 4 15:54:10 2020 +0100 media: docs: move driver-specific info to driver-api Those documents don't really describe the driver API. Instead, they contain development-specific information. Yet, as the main index file describes the content of it as: "how specific kernel subsystems work from the point of view of a kernel developer" It seems to be the better fit. Signed-off-by: Mauro Carvalho Chehab commit 32e2eae23f8fd1b90d86f4d04ca9790952d9d928 Author: Mauro Carvalho Chehab Date: Wed Mar 4 13:08:03 2020 +0100 media: docs: move user-facing docs to the admin guide Most of the driver-specific documentation is meant to help users of the media subsystem. Move them to the admin-guide. It should be noticed, however, that several of those files are outdated and will require further work in order to make them useful again. Signed-off-by: Mauro Carvalho Chehab commit 7395fb496577f0f9abf7fd278f00a8941b2f7ad8 Author: Manikanta Pubbisetty Date: Thu Apr 9 14:13:17 2020 +0530 ath11k: rx path optimizations During RX, accessing the reo dest ring descriptor directly is consuming a lot of CPU cycles. Accessing the descriptor after copying it locally has improved CPU usage by around ~10-15% while measuring throughput in RX DBTC test cases(all radios are involved in the throughput measurement). HW tested: IPQ8074 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586421797-885-1-git-send-email-mpubbise@codeaurora.org commit 05090864fc7ecfe72558087216fcccc5eb46add8 Author: Manikanta Pubbisetty Date: Thu Apr 9 14:00:13 2020 +0530 ath11k: set IRQ_DISABLE_UNLAZY flag for DP interrupts Unlike CE interrupts, DP interrupts are not enabled/disabled at source; they are enabled/disabled only at GIC level, therefore it is required to set IRQ_DISABLE_UNLAZY flag to avoid spurious interrupts. Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586421013-23025-1-git-send-email-mpubbise@codeaurora.org commit 2e9a7e0bc191c6dc97a0b3cb994b83834179a42b Author: Mauro Carvalho Chehab Date: Fri Mar 6 08:34:41 2020 +0100 media: docs: move fourcc file to the uAPI document This file gives a hint about how fourcc should be named. It is on a very weird place, as such kind of thing belongs to the uAPI guide. Signed-off-by: Mauro Carvalho Chehab commit ff768f596fa19e719c88fbc9bd65e13145d944e7 Author: Mauro Carvalho Chehab Date: Wed Mar 4 10:50:14 2020 +0100 media: docs: kAPI docs: move them to driver-api All those documents describe the media driver API. So, move them to the right place within the Kernel documentation. Signed-off-by: Mauro Carvalho Chehab commit a3baa8f084198949f3739651d96634d897f3224d Author: Aloka Dixit Date: Wed Apr 8 10:41:17 2020 -0700 ath11k: Fix TWT radio count TWT feature fails on radio2 because physical device count is hardcoded to 2. Set value dynamically. Signed-off-by: Aloka Dixit Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200408174117.22957-1-alokad@codeaurora.org commit 4d09852b6f0126cafc45d070de589c7bf64fdd17 Author: Sudeep Holla Date: Fri Mar 27 14:34:29 2020 +0000 firmware: arm_scmi: Add support for notifications message processing Add the mechanisms to distinguish notifications from delayed responses and command responses. Also add support to properly fetch notification messages upon reception. Notifications processing does not continue any further after the fetch phase. Link: https://lore.kernel.org/r/20200327143438.5382-5-cristian.marussi@arm.com Reviewed-by: Jonathan Cameron [Reworked/renamed scmi_handle_xfer_delayed_resp()] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 54f38fcae536ea202ce7d6a359521492fba30c1f Author: Mauro Carvalho Chehab Date: Wed Mar 4 10:21:39 2020 +0100 media: docs: move uAPI book to userspace-api/media Since 2017, there is an space reserved for userspace API, created by changeset 1d596dee3862 ("docs: Create a user-space API guide"). As the media subsystem was one of the first subsystems to use Sphinx, until this patch, we were keeping things on a separate place. Let's just use the new location, as having all uAPI altogether will likely make things easier for developers. Signed-off-by: Mauro Carvalho Chehab commit d5141f37c42e0b833863f157ac4cee203b2ba3d2 Author: Cristian Marussi Date: Fri Mar 27 14:34:28 2020 +0000 firmware: arm_scmi: Add notifications support in transport layer Add common transport-layer methods to: - fetch a notification instead of a response - clear a pending notification Add also all the needed support in mailbox/shmem transports. Link: https://lore.kernel.org/r/20200327143438.5382-4-cristian.marussi@arm.com Reviewed-by: Jonathan Cameron Reviewed-by: Viresh Kumar Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 2264417a9a99babcc45960f28057a04c24919efb Author: Sudeep Holla Date: Fri Mar 27 14:34:27 2020 +0000 firmware: arm_scmi: Update protocol commands and notification list Add commands' enumerations and messages definitions for all existing notify-enable commands across all protocols. Link: https://lore.kernel.org/r/20200327143438.5382-3-cristian.marussi@arm.com Reviewed-by: Jonathan Cameron Signed-off-by: Sudeep Holla commit 4ebd8f6dea813660740d004bde3caaf54bd79019 Author: Sudeep Holla Date: Fri Mar 27 14:34:26 2020 +0000 firmware: arm_scmi: Add receive buffer support for notifications With all the plumbing in place, let's just add the separate dedicated receive buffers to handle notifications that can arrive asynchronously from the platform firmware to OS. Also add one check to see if the platform supports any receive channels before allocating the receive buffers: since those buffers are optionally supported though, the whole xfer initialization is also postponed to be able to check for their existence in advance. Link: https://lore.kernel.org/r/20200327143438.5382-2-cristian.marussi@arm.com Reviewed-by: Jonathan Cameron [Changed parameters in __scmi_xfer_info_init()] Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 23818b3d8590a79d56af9659cf709ebfae30f832 Author: Sudeep Holla Date: Fri Apr 3 18:10:18 2020 +0100 firmware: arm_scpi: Add include guard to linux/scpi_protocol.h If this header is include twice, it will generate loads of compile time error with the following below error pattern. It was reported by 0day kbuild robot on a branch pushed with double inclusion by accident. This is based on the similar change in linux/scmi_protocol.h error: conflicting types for ‘...’ note: previous declaration of ‘...’ was here error: redefinition of ‘...’ Add a header include guard just in case. Link: https://lore.kernel.org/r/20200403171018.1230-2-sudeep.holla@arm.com Reported-by: kbuild test robot Signed-off-by: Sudeep Holla commit 70771c69ab9be6e37618b1ec6c105f370e510f94 Author: Sudeep Holla Date: Fri Apr 3 18:10:17 2020 +0100 firmware: arm_scmi: Add include guard to linux/scmi_protocol.h If this header is include twice, it will generate loads of compile time error with the following below error pattern. It was reported by 0day kbuild robot on a branch pushed with double inclusion by accident. error: conflicting types for ‘...’ note: previous declaration of ‘...’ was here error: redefinition of ‘...’ Add a header include guard just in case. Link: https://lore.kernel.org/r/20200403171018.1230-1-sudeep.holla@arm.com Reported-by: kbuild test robot Signed-off-by: Sudeep Holla commit 4e44590ee4a917df5ce557df4ad831ec5e82b4a6 Author: Sudeep Holla Date: Fri Mar 27 16:36:54 2020 +0000 firmware: arm_scmi: Drop checking for shmem property in parent node The scmi protocol core driver checks for the channel availability before evaluating the shmem property. If the individual protocols don't have separate channel assigned to them, the channel alloted for the BASE protocol is reused automatically. Therefore there is no need to check for the shmem property in the parent node if it is absent in the child protocol node. Link: https://lore.kernel.org/r/20200327163654.13389-5-sudeep.holla@arm.com Tested-by: Peng Fan Reviewed-by: Peng Fan Signed-off-by: Sudeep Holla commit 8aa6e12bbf9dd6cf1ebf2aad7b09389863a4c2c6 Author: Sudeep Holla Date: Fri Mar 27 16:36:53 2020 +0000 firmware: arm_scmi: Check shmem property for channel availablity Instead of declaring the channel availabilty unconditionally, let us check for the presence of "shmem" property and return the channel availablity accordingly. Link: https://lore.kernel.org/r/20200327163654.13389-4-sudeep.holla@arm.com Tested-by: Peng Fan Reviewed-by: Peng Fan Signed-off-by: Sudeep Holla commit b9d15ee21cd8cf088ac574649ae7ac2fefaa440a Author: Sudeep Holla Date: Fri Mar 27 16:36:52 2020 +0000 firmware: arm_scmi: Drop empty stub for smc_mark_txdone The scmi protocol core driver check for non NULL mark_txdone before invoking the same. There is no need to provide a empty stub. SMC/HVC calls are synchronous and the call return indicates the completion. Link: https://lore.kernel.org/r/20200327163654.13389-3-sudeep.holla@arm.com Tested-by: Peng Fan Reviewed-by: Peng Fan Signed-off-by: Sudeep Holla commit 18988265b87615b93cd4cf15001c8c883236a137 Author: Sudeep Holla Date: Fri Mar 27 16:36:51 2020 +0000 firmware: arm_scmi: Make mutex channel specific In order to support multiple SMC/HVC transport channels with associated shared memory, it is better to maintain the mutex per channel instead of existing global one. Move the smc_mutex into the scmi_smc structure and also rename it to shmem_lock which is more appropriate for it's use. Link: https://lore.kernel.org/r/20200327163654.13389-2-sudeep.holla@arm.com Tested-by: Peng Fan Reviewed-by: Peng Fan Signed-off-by: Sudeep Holla commit 1dc6558062dadfabd2fb3bd885fa6e92ec7196f2 Author: Peng Fan Date: Sun Mar 8 21:24:39 2020 +0800 firmware: arm_scmi: Add smc/hvc transport Use the value of "arm,smc-id" property from the device tree as the first argument for SMCCC call leaving all the other arguments as zero for now. There is no Rx, only Tx because of smc/hvc not support Rx. Link: https://lore.kernel.org/r/1583673879-20714-3-git-send-email-peng.fan@nxp.com Signed-off-by: Peng Fan [sudeep.holla: reworded commit log/subject and fixed !HAVE_ARM_SMCCC build] Signed-off-by: Sudeep Holla commit b953dceaddbf67c6915d257dd7c3ccf63fed5318 Author: Peng Fan Date: Sun Mar 8 21:24:38 2020 +0800 dt-bindings: arm: Add smc/hvc transport for SCMI SCMI could use SMC/HVC as tranports. Since there is no standardized SMC/HVC function identifier for the same, we need to use vendor specific id. Add the same into the devicetree binding document. Also add arm,scmi-smc compatible string for smc/hvc transport Link: https://lore.kernel.org/r/1583673879-20714-2-git-send-email-peng.fan@nxp.com Signed-off-by: Peng Fan Reviewed-by: Rob Herring Reviewed-by: Florian Fainelli [sudeep.holla: reworded commit log and subject] Signed-off-by: Sudeep Holla commit 5dfb8db56b273740a76e8687ee7efb4b2c0ec83b Author: Mauro Carvalho Chehab Date: Thu Mar 5 08:33:37 2020 +0100 media: docs: split uAPI info from imx.rst This file contains both driver develompent documentation and userspace API. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit 889a500ed5fef83ffd8ffc962b73df02750caaed Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:59:19 2020 +0100 media: docs: split uAPI info from omap3isp.rst This file contains both driver develompent documentation and userspace API. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit f8dd7a257dcef6c4c208b7d8b0e2a7229131cf8d Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:48:35 2020 +0100 media: docs: split uAPI info from saa7134-devel.rst This file contains both driver develompent documentation and userspace API. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit b4a5f46cdee4beda24ce22cb55d116120271af3e Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:38:55 2020 +0100 media: docs: split uAPI info from fimc.rst This file contains both driver develompent documentation and userspace API. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit d81c969b95d4096344714c9131a0843b4193750c Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:36:13 2020 +0100 media: docs: split uAPI info from davinci-vpbe.rst This file contains both driver develompent documentation and userspace API. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit 087362d96356c213b1b1cfc835951c91a04ed433 Author: Mauro Carvalho Chehab Date: Fri Mar 6 06:26:59 2020 +0100 media: docs: cx18-streams.c: fix broken references to docs There are two places inside this file that points to the cx2341x documentation, with was split into two. Looking at changeset dcc0ef88209a ("V4L/DVB (10442): cx18: Fixes for enforcing when Encoder Raw VBI params can be set") with added those comments, it was originally pointing to: Documentation/video4linux/cx2341x/fw-encoder-api.txt Well, the firmware details went to Signed-off-by: Mauro Carvalho Chehab commit aeb9b21ab44953ae183c685ae46f84ff44a96bd4 Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:30:50 2020 +0100 media: docs: split cx2341x.rst into different audiences This file contains both driver develompent documentation (basically, firmware documentation) and IVTV-specific documentation about VBI and raw formats, focused on uAPI development. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit 51df01acc193084430543db71c69f19827191752 Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:25:55 2020 +0100 media: docs: split development info from cx88.rst This file contains both admin and development stuff. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit 481025598f214eea371a2aa9cf2464ed786b7555 Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:24:17 2020 +0100 media: docs: split development info from bttv.rst This file contains both admin and development stuff. Split on two, as they're usually read by different audiences. Signed-off-by: Mauro Carvalho Chehab commit 8d562a0038da9977b6c2b83c2f1be499734f1253 Author: Mauro Carvalho Chehab Date: Wed Mar 4 17:10:12 2020 +0100 media: docs: split vimc.rst into devel and admin parts The vimc driver has some kerneldoc markups, plus admin info. Split it into two files. Signed-off-by: Mauro Carvalho Chehab commit a6c5ac5ca76041b1f86e24a799fd0505aa0dd9b1 Author: Mauro Carvalho Chehab Date: Wed Mar 4 16:24:52 2020 +0100 media: docs: split meye.rst into admin and uAPI docs Instead of placing both info from admin PoV and uAPI at the same place, split into two separate documents. Signed-off-by: Mauro Carvalho Chehab commit f40b814a3d5ad5275580bba3d005e442d7e3f361 Author: Mauro Carvalho Chehab Date: Wed Mar 4 14:31:12 2020 +0100 media: docs: split ci.rst into uAPI and user guide docs The ci.rst file contains two parts: the first one describing how to use the CA high level interface; the second one with uAPI internals. Split this on two separate files, adding the uAPI bits to the DVB ca.rst configuration. Signed-off-by: Mauro Carvalho Chehab commit 64a881836a91304cc1ff8d108b12366609a27510 Author: Mauro Carvalho Chehab Date: Wed Mar 4 16:15:25 2020 +0100 media: docs: split cpia2.rst on two files In order to be able to better organize the subsystem, split the cpia2 information on two files: one user-facing and another one from Kernel development PoV. Signed-off-by: Mauro Carvalho Chehab commit c8b667ac517ecb5fada1c085236a9c05d0e303ca Author: Mauro Carvalho Chehab Date: Thu Mar 5 07:49:04 2020 +0100 media: docs: move soc-camera.rst to staging As the entire soc_camera driver is on staging to be removed soon, let's place there its documentation too. Signed-off-by: Mauro Carvalho Chehab commit 485f9a434c165441fafec9259fa1057c399af903 Author: Mauro Carvalho Chehab Date: Wed Mar 4 12:53:28 2020 +0100 media: docs: avermedia.rst: mark a table as such There's a table on this file, with aren't using the ReST markups. Fix that. Signed-off-by: Mauro Carvalho Chehab commit b6a7d1bcc55fd297ad4bf341237f08ca989adf93 Author: Mauro Carvalho Chehab Date: Wed Mar 25 16:33:35 2020 +0100 media: Kconfig: don't use visible for device type select While making the menu invisible seemed a good idea, there's a drawback: when the menu is not visible, it is not parsing the "default" dependency. So, instead, let's just avoid the items at the menu to be prompted, by using the "prompt ... if" construction. Signed-off-by: Mauro Carvalho Chehab commit f48fd1514212b5c72b98db79efee4ed914acf662 Author: Mauro Carvalho Chehab Date: Wed Mar 25 15:56:15 2020 +0100 media: i2c/Kconfig: reorganize items there Right now, there are I2C drivers that don't depend on camera support before and after those. Move the camera support drivers to the end, and add a notice at the "endif", in order to make easier to maintain and to avoid adding extra dependencies at the other i2c/*/Kconfig files. Signed-off-by: Mauro Carvalho Chehab commit 0c822d97bd1450034576a8331b92d7e912326551 Author: Mauro Carvalho Chehab Date: Wed Mar 25 11:15:15 2020 +0100 media: Kconfig: Better organize the per-API options After this change, the menu is displayed like above. 1) When filtering is not active: --- Multimedia support [ ] Filter devices by their types [*] Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends) Media core support ---> Video4Linux options ---> Media controller options ---> Digital TV options ---> HDMI CEC options ---> Media drivers ---> 2) When filtering is active: --- Multimedia support [*] Filter devices by their types [*] Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends) Media device types ---> Video4Linux options ---> Media controller options ---> Digital TV options ---> HDMI CEC options ---> Media drivers ---> The per-API menu will only be displayed if the corresponding core support is enabled. Signed-off-by: Mauro Carvalho Chehab commit b0cd4fb276653f8f18cdbc1bcc041a4227bdb9da Author: Mauro Carvalho Chehab Date: Tue Mar 24 14:29:57 2020 +0100 media: Kconfig: on !EMBEDDED && !EXPERT, enable driver filtering Advanced and embedded users know what to do, so, by default, they will likely want to be able to open the entire set of Kconfig media options. Normal "poor" users usually needs more help when setting stuff, so let's open an more simplified version to them by default. Signed-off-by: Mauro Carvalho Chehab commit 1b80d36aeb92a767da8c75eb0118cfe4b34b840c Author: Mauro Carvalho Chehab Date: Tue Mar 24 14:24:41 2020 +0100 media: Kconfig: move the position of sub-driver autoselection Let's place the sub-driver-autoselection option just below the device filtering one, as it also controls a filter menu, with is not even visible if !EXPERT && !EMBEDDED. Signed-off-by: Mauro Carvalho Chehab commit 5e9e60f4214153e66217310b55ca52946181c933 Author: Mauro Carvalho Chehab Date: Tue Mar 24 14:09:23 2020 +0100 media: Kconfig: place all options under a sub-menu That should make easier for people setting the media subsystem config options, as they'll be split by the type of functionality that will be enabled. Signed-off-by: Mauro Carvalho Chehab commit 8fc42fff164b92dbea1961533875730314e8fe34 Author: Mauro Carvalho Chehab Date: Tue Mar 24 13:59:23 2020 +0100 media: Kconfig: move media controller core select to main Kconfig Let's place the main API selections at the media/Kconfig file, as this way we can better organize things. Signed-off-by: Mauro Carvalho Chehab commit 8164ab872115396ed8329f25a643bcc87500867d Author: Mauro Carvalho Chehab Date: Tue Mar 24 13:50:33 2020 +0100 media: Kconfig: move V4L2 subdev API to v4l2-core/Kconfig This option is part of V4L2 API extra functionality set. Move it to be at the v4l2-core/Kconfig, where it belongs, cleaning the main Kconfig file. Signed-off-by: Mauro Carvalho Chehab commit 10713a9420403837ea55d5bbf8650dab36841ae6 Author: Mauro Carvalho Chehab Date: Tue Mar 24 13:47:11 2020 +0100 media: Kconfig: move DVB-specific options to dvb-core/Kconfig In order to cleanup the main media Kconfig, move the DVB-core specific options to dvb-core/Kconfig. Signed-off-by: Mauro Carvalho Chehab commit f1991411257bdb68d96ef8c8c5b35f412b480375 Author: Mauro Carvalho Chehab Date: Tue Mar 24 13:41:57 2020 +0100 media: Kconfig: move CEC-specific options to cec/Kconfig There's no need to have the CEC definitions inside the media Kconfig, as the Kconfig parser doesn't require symbols to be declared before their usages. With that, the main Kconfig menu becomes cleaner. Signed-off-by: Mauro Carvalho Chehab commit ce971d957015d5ea8c7369114e701bc66d866c25 Author: Mauro Carvalho Chehab Date: Thu Mar 26 09:44:13 2020 +0100 media: Kconfig: warn if drivers are filtered As per a tester feedback, add an option to report when the drivers are filtered at the Kconfig menu. Cc: Helen Koike Signed-off-by: Mauro Carvalho Chehab commit c6774ee035dcb8782c59a3f7f958f36ad439793b Author: Mauro Carvalho Chehab Date: Tue Mar 24 11:36:10 2020 +0100 media: Kconfig: make filtering devices optional The per-device option selection is a feature that some developers love, while others hate... So, let's make both happy by making it optional. Signed-off-by: Mauro Carvalho Chehab commit c39d57044a253a22b5cfc129d1f1f04be6199341 Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:25:09 2020 +0100 media: Kconfig: use a sub-menu to select supported devices The media subsystem has hundreds of driver-specific options. The *_SUPPORT config options work as a sort of filter, allowing to reduce its complexity for users that won't want to dig into thousands of options they don't need. Yet, it the filtering options are becoming large. So, let's place it on a sub-menu. Signed-off-by: Mauro Carvalho Chehab commit 7d5bc6930db43b737ef29e67b11b32624727802c Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:14:15 2020 +0100 media: Kconfig: reorganize the drivers menu options The comments before some of the drivers support look weird, because their Kconfig have their own "comment" directive inside it. So, rearrange them to make it look a little nicer for the ones with are not too familiar with the media system. Signed-off-by: Mauro Carvalho Chehab commit 32a363d0b0b142f35512848dc646ee53e0926723 Author: Mauro Carvalho Chehab Date: Wed Mar 25 15:36:56 2020 +0100 media: Kconfig files: use select for V4L2 subdevs and MC There are lots of drivers that only work when the media controller and/or the V4L2 subdev APIs are present. Right now, someone need to first enable those APIs before using those drivers. Well, ideally, drivers, should, instead *optionally* depend on it, in order for PC camera drivers to be able to use them, but nowadays most drivers are UVC cameras, with don't require a sensor driver. So, be it. Let's instead make them select the MEDIA_CONTROLLER and the SUBDEV API, in order to make easier for people to be able of enabling them. Signed-off-by: Mauro Carvalho Chehab commit e58be01614ca8640d727ea7cd37f5984e0b57a7a Author: Mauro Carvalho Chehab Date: Wed Mar 25 15:01:25 2020 +0100 media: dvb-core: Kconfig: default to use dynamic minors All modern Linux distributions nowadays use udev or some alternative (like systemd). So, it makes sense to change the default to use dynamic minors. Please notice that this default doesn't enable any code. It just changes the dvb-core behavior. Signed-off-by: Mauro Carvalho Chehab commit 76c34a8d0e53f98975a2da5f753a99b4abc05c44 Author: Mauro Carvalho Chehab Date: Thu Mar 26 16:13:16 2020 +0100 media: add SPDX headers on Kconfig and Makefile files Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them. Signed-off-by: Mauro Carvalho Chehab commit 6268b351394450e9168a9281a9279f7cb420669f Author: Mauro Carvalho Chehab Date: Thu Mar 26 15:47:25 2020 +0100 media: Kconfig: fix selection for test drivers There are some long-time mistakes related to build test drivers, with regards to depends on/select. Also, as we now want to build any test driver without needing to enable anything else, change the logic in order to properly filter them. Please notice that the PCI skeleton is somewhat an exception, as it requires to select *both* SAMPLES and MEDIA_TEST_SUPPORT. I almost changed it to be either one, but decided to keep it as-is, as this is something that we don't really need to be included on any distribution. The only reason for someone to build it is for COMPILE_TEST purposes. Signed-off-by: Mauro Carvalho Chehab commit a3b91d8bd1e034c8ed89d3f55243478af97a0a52 Author: Mauro Carvalho Chehab Date: Wed Mar 25 08:36:36 2020 +0100 media: Kconfig: better support hybrid TV devices Right now, if one has an hybrid TV card, it has to select both analog and digital TV support, as otherwise the needed core support won't be selected. Change the logic to auto-select the core support for those drivers, as this is a way more intuitive. It should be noticed that, as now both DVB_CORE and VIDEO_DEV defaults depends on selecting a hybrid cards, we had to remove the explicit dependencies there, in order to avoid circular dependencies. That requires some tricks: 1) the prompt should not be not visible when an hybrid card is selected, as the user shold not change it. 2) When a media hybrid device is selected, the modular option for DVB_CORE and VIDEO_DEV will follow the MEDIA_SUPPORT dependency, as we can't have a core built with "y" with a driver built as module. Note: while here, moved two pure V4L2 PCI drivers out of the "hybrid" part of config and consider pvrusb2 as an hybrid device. Signed-off-by: Mauro Carvalho Chehab commit a832862295e0e604949e49f286ed368d5dfc2e3b Author: Mauro Carvalho Chehab Date: Wed Mar 25 09:59:18 2020 +0100 media: Kconfig: simplify some dependencies both DVB_CORE and VIDEO_DEV already depends on MEDIA_SUPPORT, as they're below an if block. So, remove this double dependency. Signed-off-by: Mauro Carvalho Chehab commit 97b19498dc0250826f6c9f4921b1e4c553cb086c Author: Mauro Carvalho Chehab Date: Thu Mar 26 09:45:31 2020 +0100 media: Kconfig: mark other drivers as test drivers Neither the PCI skeleton nor the DVB dummy driver are real drivers. They're there just as an example for a driver writter. Distros should not enable those drivers. So, hide them if MEDIA_TEST_SUPPORT is not selected. Signed-off-by: Mauro Carvalho Chehab commit 9a33a27e7fe5b1aebf045829f92fd11562ad0ac7 Author: Mauro Carvalho Chehab Date: Thu Mar 26 15:23:34 2020 +0100 media: ddbridge: use the ddbridge's own dummy fe driver Cleanup the ddbridge's dummy driver by removing the parts that aren't needed by ddbridge, adding it to the building system and changing the binding at the driver to use the newer function name. Signed-off-by: Mauro Carvalho Chehab commit 94ab24a2c886620fd3d0c0241d98b6c448cc8b38 Author: Mauro Carvalho Chehab Date: Thu Mar 26 15:08:59 2020 +0100 media: ddbridge-dummy_fe: do some vars and function renames As the name of this driver is now ddbridge-dummy, do some renames internally. No functional changes. Signed-off-by: Mauro Carvalho Chehab commit bd902b1bdb25729be44c25630f44735fd6b8b254 Author: Karthikeyan Periyasamy Date: Wed Apr 8 16:35:57 2020 +0530 ath11k: Modify the interrupt timer threshold Modify the interrupt timer threshold param as 256 to avoid HW watchdog in heavy multicast traffic scenario. Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586343957-21474-1-git-send-email-periyasa@codeaurora.org commit 3a137f81f76850b3cc024360147b1c3fb4b12c03 Author: Mauro Carvalho Chehab Date: Thu Mar 26 15:06:02 2020 +0100 media: ddbridge: copy the dvb_dummy_fe driver to ddbridge As we'll be transforming the dvb-dummy-fe driver soon into a virtual driver, let's first copy the existing one to ddbridge as-is, as it is needed there. Signed-off-by: Mauro Carvalho Chehab commit 6a79117187b384e837310d85a824fe0b6381e057 Author: Mauro Carvalho Chehab Date: Tue Mar 24 14:06:08 2020 +0100 media: Kconfig: mode firewire comment to firewire/Kconfig This comment should only be visible if the DVB_FIREDTV config will show. Signed-off-by: Mauro Carvalho Chehab commit 3bb112016616ca01f6ee06ee2bf77d8eec4afeb1 Author: Mauro Carvalho Chehab Date: Tue Mar 24 13:53:23 2020 +0100 media: Kconfig: move drivers-specific TTPCI_EEPROM Kconfig var This option is used only by av7110 and by an USB driver. As the av7110 is the first DVB hardware, hardly found those days, let's opt to place it at usb/Kconfig, as the driver with needs it might have a longer lifetime. Signed-off-by: Mauro Carvalho Chehab commit a41034df538968e726c6aad3e5d8b99799d2d0cd Author: Mauro Carvalho Chehab Date: Tue Mar 24 13:43:23 2020 +0100 media: Kconfig: move comment to siano include Showing this comment without showing the Siano mmc option is very weird! Place the option together, and make it visible only when showing Siano configuration. Signed-off-by: Mauro Carvalho Chehab commit 4b32216adb010a364f23a055c45e06e839b089f9 Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:39:43 2020 +0100 media: split test drivers from platform directory When the first test device was added (vivi.c), there were just one file. I was too lazy on that time to create a separate directory just for it, so I kept it together with platform. Now, we have vivid, vicodec, vim2m and vimc. Also, a new virtual driver has been prepared to support DVB API. So, it is time to solve this mess, by placing test stuff on a separate directory. It should be noticed that we also have some skeleton drivers (for V4L and for DVB). For now, we'll keep them separate, as they're not really test drivers, but instead, just examples. The DVB frontend ones will likely be part of a new DVB test driver. By that time, it should make sense to move them here as well. Signed-off-by: Mauro Carvalho Chehab commit dee1877d9168f3e4b5e3c384d6d217dd1bbd4b49 Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:15:43 2020 +0100 media: Kconfig: update the MEDIA_SUPPORT help message There are more things than just cameras and TV devices on media. Update the help message accordingly. Signed-off-by: Mauro Carvalho Chehab commit f11175daffad2c53e6e3ea020d0a6c3839a2fba7 Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:05:18 2020 +0100 media: pci: move VIDEO_PCI_SKELETON to a different Kconfig The V4L2 PCI skeleton is not part of the V4L2 core. Move it to appear together with the other PCI drivers, at the end, as this is something that normal users don't even need to bother. Signed-off-by: Mauro Carvalho Chehab commit a19f228b8dd9a67e8de4ebd4eac8a4c94ec39d1a Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:03:16 2020 +0100 media: Kconfig: not all V4L2 platform drivers are for camera When the platform drivers got added, they were all part of complex camera support. This is not the case anymore, as we now have codecs and other stuff there too. So, fix the dependencies, in order to not require users to manually select something that it doesn't make sense. Signed-off-by: Mauro Carvalho Chehab commit 06b93644f4d102bdfc297159121acc1de794d68d Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:27:15 2020 +0100 media: Kconfig: add an option to filter in/out platform drivers Most systems don't need support for those, while others only need those, instead of the others. So, add an option to filter in/out platform drivers. Signed-off-by: Mauro Carvalho Chehab commit d9d6e1f3d5bbca799910072b2110963250e0b9c6 Author: Mauro Carvalho Chehab Date: Tue Mar 24 10:00:38 2020 +0100 media: dvb-usb: auto-select CYPRESS_FIRMWARE At least some of the supported boards by dvb-usb driver need to load the cypress firmware, so select it, as otherwise missing dependencies may popup. Also, as the cypress firmware load routines are needed only by the dvb-usb, dvb-usb-v2 and go7007 drivers, and those all (now) select it, there's no need to ask the user for manually select it. Signed-off-by: Mauro Carvalho Chehab commit b97b6a1f6e14a25d1e1ca2a46c5fa3e2ca374e22 Author: Bogdan Togorean Date: Mon Apr 13 14:35:08 2020 +0300 drm: bridge: adv7511: Extend list of audio sample rates ADV7511 support sample rates up to 192kHz. CTS and N parameters should be computed accordingly so this commit extend the list up to maximum supported sample rate. Signed-off-by: Bogdan Togorean Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20200413113513.86091-2-bogdan.togorean@analog.com commit f7f436b99364a3904387eba613fc69853cc2f220 Author: Bogdan Togorean Date: Mon Apr 13 14:35:07 2020 +0300 drm: bridge: adv7511: Enable SPDIF DAI ADV7511 support I2S or SPDIF as audio input interfaces. This commit enable support for SPDIF. Signed-off-by: Bogdan Togorean Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20200413113513.86091-1-bogdan.togorean@analog.com commit 1e744bf218b54d2e241aa6107484828d4f4a9fdc Author: Karthikeyan Periyasamy Date: Wed Apr 8 16:33:15 2020 +0530 ath11k: fix duplication peer create on same radio Add the pdev index information in the peer object to validate the peer creation. Ignore the peer creation request, if the given MAC address is already present in the peer list with same radio. If we allow the peer creation in above scenario, FW assert will happen. Above scenario occurred in two cases, where Multiple AP VAP created in the same radio. 1. when testing tool sends association request to two AP with same MAC address 2. when a station do roaming from one AP VAP to another AP VAP. Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1586343795-21422-1-git-send-email-periyasa@codeaurora.org commit 76e6c82c53780516adde50a2d02a2412c07ac9b1 Author: Yoshihiro Shimoda Date: Fri Apr 10 19:47:14 2020 +0900 arm64: dts: renesas: r8a77961: Add PCIe device nodes Add PCIe device nodes for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1586515634-28095-3-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 174d0967b3447c118b9cae1e959950fa58d2e6bc Author: Yoshihiro Shimoda Date: Fri Apr 10 19:47:13 2020 +0900 arm64: dts: renesas: r8a77961: Add PWM device nodes Add PWM device nodes for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1586515634-28095-2-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 3971a7734862570a75a88d52b3906751421b899b Author: Geert Uytterhoeven Date: Fri Mar 27 13:44:18 2020 +0100 arm64: dts: renesas: r8a77961: Add SCIF and HSCIF nodes Add the device nodes for all SCIF and HSCIF serial ports on R-Car M3-W+. Add the missing DMA properties to the already-present SCIF2 node. Signed-off-by: Geert Uytterhoeven Reviewed-by: Eugeniu Rosca commit 8ab47ffc8d5d8df240ea56cdc5da9c6606dd7c36 Author: Yoshihiro Shimoda Date: Wed Mar 25 15:24:30 2020 +0900 arm64: dts: renesas: r8a77961: Add USB3.0 device nodes This patch adds USB3.0 related device nodes for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1585117470-8625-3-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 667fd76faaf96e81767191858ed7e1c9cf5c6580 Author: Yoshihiro Shimoda Date: Wed Mar 25 15:24:29 2020 +0900 arm64: dts: renesas: r8a77961: Add USB2.0 device nodes This patch adds USB2.0 related device nodes for r8a77961 (R-Car M3-W+). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1585117470-8625-2-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 3d478d211b8e40deb609594f0676be205e8d89c1 Author: Sebastian Meyer Date: Mon Apr 13 08:24:33 2020 +0200 arm64: allwinner: h6: orangepi-lite2: Support BT+WIFI combo module OrangePi Lite2 has AP6255 BT+WIFI combo chip. Add support for it. Signed-off-by: Sebastian Meyer [merged BT and WIFI patches and updated commit message] Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 27c9f2a0c5125727f0a9f7a19366d044b841e873 Author: Jernej Skrabec Date: Mon Apr 13 08:24:32 2020 +0200 arm64: dts: allwinner: h6: orangepi: Disable OTG mode As can be seen from OrangePi Lite 2 and One Plus schematics, VBUS pin on USB OTG port is directly connected to 5 V power supply. This mean that OTG port can safely operate only in host mode, even though these two boards have ID pin connected. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit b928fd4674fe339374aa0aead9a82d9d6e476f88 Author: Jernej Skrabec Date: Mon Apr 13 08:24:31 2020 +0200 arm64: dts: allwinner: h6: orangepi: Add gpio power supply OrangePi Lite2 and One Plus have GPIO ports powered by same power supplies. Add them in common DT. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 34b6826df7462c541752cf8b1de2691b26d78ae0 Author: Vincent Stehlé Date: Sat Apr 11 19:48:43 2020 +0200 ARM: dts: sun8i-h2-plus-bananapi-m2-zero: Fix led polarity The PWR-LED on the bananapi m2 zero board is on when gpio PL10 is low. This has been verified on a board and in the schematics [1]. [1]: http://wiki.banana-pi.org/Banana_Pi_BPI-M2_ZERO#Documents Fixes: 8b8061fcbfae ("ARM: dts: sun8i: h2+: add support for Banana Pi M2 Zero board") Signed-off-by: Vincent Stehlé Cc: Icenowy Zheng Cc: Maxime Ripard Signed-off-by: Maxime Ripard commit cdfdeb4a381d97d441ac421a86a2e8158346ad51 Author: Christophe JAILLET Date: Mon Apr 13 06:17:09 2020 +0200 clk: renesas: r9a06g032: Fix some typo in comments This file seems to be for R9A06G032 only. So replace reference to R9A09G032 by R9A06G032 to avoid confusion. AFAIK, R9A09G032 does'nt exist. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20200413041709.3630-1-christophe.jaillet@wanadoo.fr Signed-off-by: Geert Uytterhoeven commit 91a577e77fdf55bdc6cd863581658761908c1686 Author: Yoshihiro Shimoda Date: Thu Mar 26 14:30:08 2020 +0900 dt-bindings: clock: renesas: rcar-usb2-clock-sel: Add r8a77961 support This patch adds support for r8a77961 (R-Car M3-W+). To avoid confusion between R-Car M3-W (R8A77960) and R-Car M3-W+ (R8A77961), this patch also updates the comment of "renesas,r8a7796-rcar-usb2-clock-sel". Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/1585200608-30103-1-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit e7d5260e2b109c6da1023e37d18f5a9adf9ae0ca Author: Samuel Holland Date: Sat Feb 22 22:08:53 2020 -0600 arm64: dts: allwinner: h6: Add msgbox node The H6 SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard commit 3e3f39a774381c68a9387b65e333c2280e4df27d Author: Samuel Holland Date: Sat Feb 22 22:08:52 2020 -0600 arm64: dts: allwinner: a64: Add msgbox node The A64 SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard commit 667aeaef74513173efc1755935cc8d225d30b50a Author: Samuel Holland Date: Sat Feb 22 22:08:51 2020 -0600 ARM: dts: sunxi: h3/h5: Add msgbox node The H3 and H5 SoCs contain a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard commit 9a0e4df7f9bebb07cc0a1737d6f63f9dcbac3cbc Author: Samuel Holland Date: Sat Feb 22 22:08:50 2020 -0600 ARM: dts: sunxi: a83t: Add msgbox node The A83T SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Tested-by: Ondrej Jirman Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard commit c21c2c86f6067d4d7c2bf5eab4940dd0c18dbecf Author: Qiang Yu Date: Sat Mar 28 17:16:32 2020 +0800 ARM: dts: sun8i-h3: add opp table for mali gpu OPP table value is get from orangepi lichee linux-3.4 kernel driver. Signed-off-by: Qiang Yu Signed-off-by: Maxime Ripard commit 89866b2667e0d80732ea55041f58babc26a5187e Author: Petr Štetiar Date: Wed Mar 25 21:59:24 2020 +0100 arm64: dts: allwinner: a64: olinuxino: add user red LED There is a red LED marked as `GPIO_LED1` on the silkscreen and connected to PE17 by default. So lets add this missing bit in the current hardware description. Signed-off-by: Petr Štetiar Signed-off-by: Maxime Ripard commit 4a0cc312443d1de8d2c8839bedf67065012f722e Author: Stefan Mavrodiev Date: Sat Mar 21 09:57:56 2020 +0200 ARM: dts: sun7i: Add A20-OLinuXino-LIME-eMMC There is new version of A20-OLinuXino-LIME with eMMC storage. The card routing is the same as in A20-OLinuXino-LIME2-eMMC, so this is basically copy/paste. Signed-off-by: Stefan Mavrodiev Signed-off-by: Maxime Ripard commit 69f6eb775ede672ec88c82ae9f913b6310906fa9 Author: Stefan Mavrodiev Date: Sat Mar 21 09:57:57 2020 +0200 dt-bindings: arm: sunxi: Add compatible for A20-OLinuXino-LIME-eMMC Add compatible string for A20-OLinuXino-LIME2-eMMC to the bindings documentation. Signed-off-by: Stefan Mavrodiev Signed-off-by: Maxime Ripard commit ee25d9742dabed3fd18158b518f846abeb70f319 Author: Rikard Falkeborn Date: Tue Mar 17 22:13:32 2020 +0100 clk: sunxi: Fix incorrect usage of round_down() round_down() can only round to powers of 2. If round_down() is asked to round to something that is not a power of 2, incorrect results are produced. The incorrect results can be both too large and too small. Instead, use rounddown() which can round to any number. Fixes: 6a721db180a2 ("clk: sunxi: Add A31 clocks support") Signed-off-by: Rikard Falkeborn Signed-off-by: Maxime Ripard commit 5d2408c6cd594fa29c3989db65629827475d948c Author: Corentin Labbe Date: Thu Apr 2 09:34:21 2020 +0000 ARM: configs: sunxi: Add sun8i analog codec On my orange pi PC, I got lot of "sun4i-codec 1c22c00.codec: Failed to register our card". This was due to a missing component: the sun8i analog codec. Signed-off-by: Corentin Labbe Signed-off-by: Maxime Ripard commit 032c692ae588324f66ac07c0357d2e681a9d0e1e Author: Douglas Anderson Date: Mon Apr 13 10:04:15 2020 -0700 soc: qcom: rpmh-rsc: read_tcs_reg()/write_tcs_reg() are not for IRQ The RSC_DRV_IRQ_ENABLE, RSC_DRV_IRQ_STATUS, and RSC_DRV_IRQ_CLEAR registers are not part of TCS 0. Let's not pretend that they are by using read_tcs_reg() and write_tcs_reg() and passing a bogus tcs_id of 0. We could introduce a new wrapper for these registers but it wouldn't buy us much. Let's just read/write directly. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.10.I2adf93809c692d0b673e1a86ea97c45644aa8d97@changeid Signed-off-by: Bjorn Andersson commit 881808d0bbf336d333981ad86bde62ef2165e437 Author: Douglas Anderson Date: Mon Apr 13 10:04:14 2020 -0700 soc: qcom: rpmh-rsc: Caller handles tcs_invalidate() exclusivity Auditing tcs_invalidate() made me worried. Specifically I saw that it used spin_lock(), not spin_lock_irqsave(). That always worries me unless I can trace for sure that I'm in the interrupt handler or that someone else already disabled interrupts. Looking more at it, there is actually no reason for these locks anyway. Specifically the only reason you'd ever call rpmh_rsc_invalidate() is if you cared that the sleep/wake TCSes were empty. That means that they need to continue to be empty even after rpmh_rsc_invalidate() returns. The only way that can happen is if the caller already has done something to keep all other RPMH users out. It should be noted that even though the caller is only worried about making sleep/wake TCSes empty, they also need to worry about stopping active-only transfers if they need to handle the case where active-only transfers might borrow the wake TCS. At the moment rpmh_rsc_invalidate() is only called in PM code from the last CPU. If that later changes the caller will still need to solve the above problems themselves, so these locks will never be useful. Continuing to audit tcs_invalidate(), I found a bug. The function didn't properly check for a borrowed TCS if we hadn't recently written anything into the TCS. Specifically, if we've never written to the WAKE_TCS (or we've flushed it recently) then tcs->slots is empty. We'll early-out and we'll never call tcs_is_free(). I thought about fixing this bug by either deleting the early check for bitmap_empty() or possibly only doing it if we knew we weren't on a TCS that could be borrowed. However, I think it's better to just delete the checks. As argued above it's up to the caller to make sure that all other users of RPMH are quiet before tcs_invalidate() is called. Since callers need to handle the zero-active-TCS case anyway that means they need to make sure that the active-only transfers are quiet before calling too. The one way tcs_invalidate() gets called today is through rpmh_rsc_cpu_pm_callback() which calls rpmh_rsc_ctrlr_is_busy() to handle this. When we have another path to get to tcs_invalidate() it will also need to come up with something similar and it won't need this extra check either. If we later find some code path that actually needs this check back in (and somehow manages to be race free) we can always add it back in. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.9.I07c1f70e0e8f2dc0004bd38970b4e258acdc773e@changeid Signed-off-by: Bjorn Andersson commit dded0317f510352ee622e526e113b9478ca406da Author: Douglas Anderson Date: Mon Apr 13 10:04:13 2020 -0700 soc: qcom: rpmh-rsc: Don't double-check rpmh payload The calls rpmh_rsc_write_ctrl_data() and rpmh_rsc_send_data() are only ever called from rpmh.c. We know that rpmh.c already error checked the message. There's no reason to do it again in rpmh-rsc. Suggested-by: Maulik Shah Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.8.I8e187cdfb7a31f5bb7724f1f937f2862ee464a35@changeid Signed-off-by: Bjorn Andersson commit ff304ea34d2e2d7ef7a13aefb4e62f456cf78e99 Author: Douglas Anderson Date: Mon Apr 13 10:04:12 2020 -0700 soc: qcom: rpmh-rsc: tcs_is_free() can just check tcs_in_use tcs_is_free() had two checks in it: does the software think that the TCS is free and does the hardware think that the TCS is free. I couldn't figure out in which case the hardware could think that a TCS was in-use but software thought it was free. Apparently there is no case and the extra check can be removed. This apparently has already been done in a downstream patch. Suggested-by: Maulik Shah Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.7.Icf2213131ea652087f100129359052c83601f8b0@changeid Signed-off-by: Bjorn Andersson commit e40b0c1628f27986dd90f94c43464df5aa8968cf Author: Douglas Anderson Date: Mon Apr 13 10:04:11 2020 -0700 soc: qcom: rpmh-rsc: A lot of comments I've been pouring through the rpmh-rsc code and trying to understand it. Document everything to the best of my ability. All documentation here is strictly from code analysis--no actual knowledge of the hardware was used. If something is wrong in here I either misunderstood the code, had a typo, or the code has a bug in it leading to my incorrect understanding. In a few places here I have documented things that don't make tons of sense. A future patch will try to address this. While this means I'm adding comments / todos and then later fixing them in the series, it seemed more urgent to get things documented first so that people could understand the later patches. Any comments I adjusted I also tried to make match kernel-doc better. Specifically: - kernel-doc says do not leave a blank line between the function description and the arguments - kernel-doc examples always have things starting w/ a capital and ending with a period. This should be a no-op. It's just comment changes. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200413100321.v4.6.I52653eb85d7dc8981ee0dafcd0b6cc0f273e9425@changeid Signed-off-by: Bjorn Andersson commit 1bc92a933f19e2415353a4892f7df4617f691b6c Author: Douglas Anderson Date: Mon Apr 13 10:04:10 2020 -0700 soc: qcom: rpmh-rsc: Kill cmd_cache and find_match() with fire The "cmd_cache" in RPMH wasn't terribly sensible. Specifically: - The current code doesn't really detect "conflicts" properly any case where the sequence being checked has more than one entry. One simple way to see this in the current code is that if cmd[0].addr isn't found then cmd[1].addr is never checked. - The code attempted to use the "cmd_cache" to update an existing message in a sleep/wake TCS with new data. The goal appeared to be to update part of a TCS while leaving the rest of the TCS alone. We never actually do this. We always fully invalidate and re-write everything. - If/when we try to optimize things to not fully invalidate / re-write every time we update the TCSes we'll need to think it through very carefully. Specifically requirement of find_match() that the new sequence of addrs must match exactly the old sequence of addrs seems inflexible. It's also not documented in rpmh_write() and rpmh_write_batch(). In any case, if we do decide to require updates to keep the exact same sequence and length then presumably the API and data structures should be updated to understand groups more properly. The current algorithm doesn't really keep track of the length of the old sequence and there are several boundary-condition bugs because of that. Said another way: if we decide to do something like this in the future we should start from scratch and thus find_match() isn't useful to keep around. This patch isn't quite a no-op. Specifically: - It should be a slight performance boost of not searching through so many arrays. - The old code would have done something useful in one case: it would allow someone calling rpmh_write() to override the data that came from rpmh_write_batch(). I don't believe that actually happens in reality. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.5.I6d3d0a3ec810dc72ff1df3cbf97deefdcdeb8eef@changeid Signed-off-by: Bjorn Andersson commit 53d49fe1ff49196712c416ddb987634483423934 Author: Douglas Anderson Date: Mon Apr 13 10:04:09 2020 -0700 soc: qcom: rpmh-rsc: Remove get_tcs_of_type() abstraction The get_tcs_of_type() function doesn't provide any value. It's not conceptually difficult to access a value in an array, even if that value is in a structure and we want a pointer to the value. Having the function in there makes me feel like it's doing something fancier like looping or searching. Remove it. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.4.Ia348ade7c6ed1d0d952ff2245bc854e5834c8d9a@changeid Signed-off-by: Bjorn Andersson commit 427ef4f72bba5c8d3fb7dce758c3afe99d9db9c6 Author: Douglas Anderson Date: Mon Apr 13 10:04:08 2020 -0700 soc: qcom: rpmh-rsc: Fold tcs_ctrl_write() into its single caller I was trying to write documentation for the functions in rpmh-rsc and I got to tcs_ctrl_write(). The documentation for the function would have been: "This is the core of rpmh_rsc_write_ctrl_data(); all the caller does is error-check and then call this". Having the error checks in a separate function doesn't help for anything since: - There are no other callers that need to bypass the error checks. - It's less documenting. When I read tcs_ctrl_write() I kept wondering if I need to handle cases other than ACTIVE_ONLY or cases with more commands than could fit in a TCS. This is obvious when the error checks and code are together. - The function just isn't that long, so there's no problem understanding the combined function. Things were even more confusing because the two functions names didn't make obvious (at least to me) their relationship. Simplify by folding one function into the other. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.3.Ie88ce5ccfc0c6055903ccca5286ae28ed3b85ed3@changeid Signed-off-by: Bjorn Andersson commit 1f7dbeb51a4f555db4105dc7927be6c77f0b60fd Author: Douglas Anderson Date: Mon Apr 13 10:04:07 2020 -0700 soc: qcom: rpmh-rsc: Document the register layout better Perhaps it's just me, it took a really long time to understand what the register layout of rpmh-rsc was just from the #defines. Let's add a bunch of comments describing which blocks are part of other blocks. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200413100321.v4.2.Iaddc29b72772e6ea381238a0ee85b82d3903e5f2@changeid Signed-off-by: Bjorn Andersson commit 3b5e3d50f83a3706126ade45ba8d44ca829b0803 Author: Douglas Anderson Date: Mon Apr 13 10:04:06 2020 -0700 soc: qcom: rpmh-rsc: Clean code reading/writing TCS regs/cmds This patch makes two changes, both of which should be no-ops: 1. Make read_tcs_reg() / read_tcs_cmd() symmetric to write_tcs_reg() / write_tcs_cmd(). 2. Change the order of operations in the above functions to make it more obvious to me what the math is doing. Specifically first you want to find the right TCS, then the right register, and then multiply by the command ID if necessary. Signed-off-by: Douglas Anderson Reviewed-by: Maulik Shah Reviewed-by: Stephen Boyd Tested-by: Maulik Shah Link: https://lore.kernel.org/r/20200413100321.v4.1.I1b754137e8089e46cf33fc2ea270734ec3847ec4@changeid Signed-off-by: Bjorn Andersson commit b47c5fc15d88ce69a2f3497ec4e5a884f08a4d69 Author: Robert Foss Date: Tue Mar 24 16:58:42 2020 +0100 arm64: defconfig: Enable Qualcomm CAMCC, CAMSS and CCI drivers Build camera clock, isp and controller drivers as modules. Signed-off-by: Robert Foss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200324155843.10719-7-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 8cd6209962c6efedf9823600eebc406ed2185495 Author: Maulik Shah Date: Sun Apr 12 20:19:59 2020 +0530 arm64: dts: qcom: sc7180: Add cpuidle low power states Add device bindings for cpuidle states for cpu devices. Cc: devicetree@vger.kernel.orgi Signed-off-by: Maulik Shah Reviewed-by: Srinivas Rao L Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1586703004-13674-2-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit e8a7fdc505bb06625a176f23293811d12d7d24eb Author: Sivaprakash Murugesan Date: Sat Apr 11 08:10:30 2020 +0530 arm64: dts: ipq8074: qcom: Re-arrange dts nodes based on address This patch re-arranges ipq8074 device nodes based on node address followed by node names followed by node labels. Suggested-by: Bjorn Andersson Signed-off-by: Sivaprakash Murugesan Link: https://lore.kernel.org/r/1586572830-22727-1-git-send-email-sivaprak@codeaurora.org Signed-off-by: Bjorn Andersson commit 5a307c66a33d23c66e9fd2d0cd669b42b82fa08e Author: Matthias Kaehlcke Date: Thu Apr 9 16:02:08 2020 -0700 arm64: dts: qcom: sc7180: Add interconnect paths for the video codec Add the interconnect path configuration for the venus video codec of the SC7180. Signed-off-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20200409160206.1.Icf877f5cd50ef5e56d14ee014ca196d76242cb89@changeid Signed-off-by: Bjorn Andersson commit 22337b91022d8c9c8a56324c9b1ae58e7ab5768d Author: Rajeshwari Date: Tue Apr 7 13:01:16 2020 +0530 arm64: dts: qcom: sc7180: Changed polling mode in Thermal-zones node Changed polling-delay and polling-delay-passive to zero to disable polling mode of the framework as interrupts for tsens are already configured. Signed-off-by: Rajeshwari Reviewed-by: Amit Kucheria Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1586244677-14399-1-git-send-email-rkambl@codeaurora.org Signed-off-by: Bjorn Andersson commit a0e5aea1482bcbba2664723a88357fbe630ddb3c Author: Douglas Anderson Date: Tue Mar 31 09:29:00 2020 -0700 arm64: dts: qcom: sc7180: Swap order of gpucc and sdhc_2 Devices are supposed to be sorted by unit address. These two got swapped when they landed. Fix. Reviewed-by: Matthias Kaehlcke Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20200331092832.1.Ic361058ca22d7439164ffea11421740462e14272@changeid Signed-off-by: Bjorn Andersson commit 285aa631e353e14efa8c153d6a4ab9bc7bcd3403 Author: Amit Kucheria Date: Mon Mar 30 15:36:28 2020 +0530 arm64: dts: qcom: msm8998: remove unit name for thermal trip points The thermal trip points have unit name but no reg property, so we can remove them. It also fixes the following warnings from 'make dtbs_check' after adding the thermal yaml bindings. arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu0-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu1-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu3-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu4-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu5-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu6-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cpu7-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: clust0-mhm-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: clust1-mhm-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: cluster1-l2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: modem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: mem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: wlan-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: q6-dsp-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: camera-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dt.yaml: thermal-zones: multimedia-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu0-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu1-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu3-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu4-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu5-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu6-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cpu7-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: clust0-mhm-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: clust1-mhm-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: cluster1-l2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: modem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: mem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: wlan-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: q6-dsp-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: camera-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8998-mtp.dt.yaml: thermal-zones: multimedia-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' Signed-off-by: Amit Kucheria Link: https://lore.kernel.org/r/cd6f0c7298437d35642b35c9ede9064c247d6090.1585562459.git.amit.kucheria@linaro.org Signed-off-by: Bjorn Andersson commit 971b289d8749819040c203fccc2ccfbfd92e9442 Author: Amit Kucheria Date: Mon Mar 30 15:36:27 2020 +0530 arm64: dts: qcom: msm8996: remove unit name for thermal trip points The thermal trip points have unit name but no reg property, so we can remove them. It also fixes the following warnings from 'make dtbs_check' after adding the thermal yaml bindings. arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: cpu0-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: cpu1-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: cpu2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: cpu3-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: m4m-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: l3-or-venus-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: cluster0-l2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: cluster1-l2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: camera-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: q6-dsp-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: mem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-ifc6640.dt.yaml: thermal-zones: modemtx-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: cpu0-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: cpu1-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: cpu2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: cpu3-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: m4m-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: l3-or-venus-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: cluster0-l2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: cluster1-l2-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: camera-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: q6-dsp-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: mem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8096-db820c.dt.yaml: thermal-zones: modemtx-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' Signed-off-by: Amit Kucheria Link: https://lore.kernel.org/r/2c0aa5357c96c3caff8554f9ef3ab9c5a2b8d2f8.1585562459.git.amit.kucheria@linaro.org Signed-off-by: Bjorn Andersson commit fe2aff0c574d206f34f1864d5a0b093694c27142 Author: Amit Kucheria Date: Mon Mar 30 15:36:26 2020 +0530 arm64: dts: qcom: msm8916: remove unit name for thermal trip points The thermal trip points have unit name but no reg property, so we can remove them. It also fixes the following warnings from 'make dtbs_check' after adding the thermal yaml bindings. arch/arm64/boot/dts/qcom/apq8016-sbc.dt.yaml: thermal-zones: gpu-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8016-sbc.dt.yaml: thermal-zones: camera-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8016-sbc.dt.yaml: thermal-zones: modem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: thermal-zones: gpu-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: thermal-zones: camera-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: thermal-zones: modem-thermal:trips: 'trip-point@0' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' Signed-off-by: Amit Kucheria Link: https://lore.kernel.org/r/2d3d045c18a2fb85b28cf304aa11ae6e6538d75e.1585562459.git.amit.kucheria@linaro.org Signed-off-by: Bjorn Andersson commit eccdac07ae300bbe31ab4230a5ac522c1044d0e1 Author: Krishna Manikandan Date: Fri Mar 20 18:41:04 2020 +0530 arm64: dts: qcom: sc7180: modify assigned clocks for sc7180 target Add DISP_CC_MDSS_ROT_CLK and DISP_CC_MDSS_AHB_CLK in the assigned clocks list as these are display specific clocks and needs to be initialized from the client side. Adding the default rate of 19.2 mhz for these clocks for sc7180 target. Signed-off-by: Krishna Manikandan Link: https://lore.kernel.org/r/1584709864-5587-1-git-send-email-mkrishn@codeaurora.org Signed-off-by: Bjorn Andersson commit a0fa17f1ff74df618021704af98683a09f1fa837 Author: Evan Green Date: Tue Mar 10 16:16:29 2020 -0700 arm64: dts: qcom: sc7180: Include interconnect definitions Re-introduce the include of the sc7180 interconnect node name definitions. Though this was part of v5 of the interconnect provider series [1], it was dropped because the DT changes went through a different tree than the header. Re-add that now. Interconnect clients being introduced can reference this patch as a dependency, rather than racing each other to add the include. [1] https://patchwork.kernel.org/patch/11417989/ Signed-off-by: Evan Green Link: https://lore.kernel.org/r/20200310161502.1.Ia2884ed3c8826f52fbd5dcfa7a376a2fac4f31e6@changeid Signed-off-by: Bjorn Andersson commit d4919a44564b1d196a4211f59250735af737031e Author: Robert Foss Date: Tue Mar 24 16:58:41 2020 +0100 arm64: dts: qcom: sdm845-db845c: Add ov8856 & ov7251 camera nodes Enable the ov8856 main camera and the ov7251 b/w tracking camera used on the Qualcomm RB3 kit. Currently the camera nodes have not yet been attached to an to a CSI2 endpoint, since no driver currently supports the ISP that the the SDM845/db845c ships with. Signed-off-by: Robert Foss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200324155843.10719-6-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 68fc0facce113f7bf587298bca80ffbbeb6a7485 Author: Robert Foss Date: Tue Mar 24 16:58:40 2020 +0100 arm64: dts: qcom: sdm845-db845c: Add pm_8998 gpio names Add pm_8998 GPIO trace names. These names are defined in the 96boards db845c mezzanine schematic. Signed-off-by: Robert Foss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200324155843.10719-5-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 07484de372bd57e6f8b28daca01bdf676015fa81 Author: Robert Foss Date: Tue Mar 24 16:58:39 2020 +0100 arm64: dts: qcom: sdm845: Add i2c-qcom-cci node The sdm845 SOC ships with a CCI controller, which has two CCI/I2C buses. Signed-off-by: Robert Foss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200324155843.10719-4-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 39e0ce6cd1bf97e8076d55250ae05d4e965c0aac Author: Loic Poulain Date: Tue Mar 24 16:58:38 2020 +0100 arm64: dts: qcom: apq8016-sbc: Add CCI/Sensor nodes Add cci device to msm8916.dtsi. Add default 96boards camera node for db410c (apq8016-sbc). Signed-off-by: Loic Poulain Signed-off-by: Robert Foss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200324155843.10719-3-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 1c51a4aba5916a0624cda69e10a02a21f76345c3 Author: Loic Poulain Date: Tue Mar 24 16:58:37 2020 +0100 arm64: dts: qcom: msm8916: Add i2c-qcom-cci node The msm8916 CCI controller provides one CCI/I2C bus. Signed-off-by: Loic Poulain Signed-off-by: Robert Foss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20200324155843.10719-2-robert.foss@linaro.org Signed-off-by: Bjorn Andersson commit 75e85d53fad2a072fcb12359b9f3952839e73576 Author: Bryan O'Donoghue Date: Wed Mar 11 19:15:17 2020 +0000 arm64: dts: qcom: qcs404-evb: Enable USB controllers This patch enables the primary and secondary USB controllers on the qcs404-evb. Primary: The primary USB controller has - One USB3 SS PHY using gpio-usb-conn - One USB2 HS PHY in device mode only and no connector driver associated. Secondary: The second DWC3 controller which has one USB Hi-Speed PHY attached to it. Cc: Andy Gross Cc: Bjorn Andersson Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200311191517.8221-7-bryan.odonoghue@linaro.org [bjorn: Dropped usb3 role switching and enabled vbus] Signed-off-by: Bjorn Andersson commit 3d439b2a48bccd00f0daca6d635d6050d2567deb Author: Bryan O'Donoghue Date: Wed Mar 11 19:15:16 2020 +0000 arm64: dts: qcom: qcs404-evb: Raise vreg_l12_3p3 minimum voltage Rather than set the minimum microvolt for this regulator in the USB SS PHY driver, set it in the DTS. Suggested-by: Bjorn Andersson Cc: Andy Gross Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200311191517.8221-6-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 2c0b742d2f183b4a51c753f75094d862a8bf8389 Author: Bryan O'Donoghue Date: Wed Mar 11 19:15:15 2020 +0000 arm64: dts: qcom: qcs404-evb: Describe external VBUS regulator VBUS is supplied by an external regulator controlled by a GPIO pin. This patch models the regulator as regulator-usb3-vbus. Cc: Andy Gross Cc: Bjorn Andersson Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200311191517.8221-5-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 599a0f340aa995d669c6f66fa775d5e764baa0e2 Author: Bryan O'Donoghue Date: Wed Mar 11 19:15:14 2020 +0000 arm64: dts: qcom: qcs404-evb: Define USB ID pin The USB ID pin is used to tell if a system is a Host or a Device. For our purposes we will bind this pin into gpio-usb-conn later. For now define the pin with its pinmux. Cc: Andy Gross Cc: Bjorn Andersson Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200311191517.8221-4-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 70a8c5abc59873d74bf9b38db28187e89ca04cef Author: Bryan O'Donoghue Date: Wed Mar 11 19:15:13 2020 +0000 arm64: dts: qcom: qcs404-evb: Define VBUS pins Defines VBUS detect and VBUS boost for the QCS404 EVB. Detect: VBUS present/absent is presented to the SoC via a GPIO on the EVB. Define the pin mapping for later use by gpio-usb-conn. Boost: An external regulator is used to trigger VBUS on/off via GPIO. This patch defines the relevant GPIO in the EVB dts. Cc: Andy Gross Cc: Bjorn Andersson Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200311191517.8221-3-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 9375e7d719b3fd933991382ddef2eb6572601273 Author: Bjorn Andersson Date: Wed Mar 11 19:15:12 2020 +0000 arm64: dts: qcom: qcs404: Add USB devices and PHYs QCS404 sports HS and SS USB controllers based on dwc3 block with two HS PHYs and one SS PHY. Add nodes for these devices and enable them for EVB board. Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Shawn Guo Cc: Andy Gross Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20200311191517.8221-2-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit f97d414d7fee8c3de0a6f4788f77b65f82b9a693 Author: Amit Kucheria Date: Wed Mar 18 14:38:17 2020 +0530 arm64: dts: qcom: sc7180: Fix cpu compatible "arm,armv8" compatible should only be used for software models. Replace it with the real cpu type. Reviewed-by: Stephen Boyd Reviewed-by: Rajendra Nayak Signed-off-by: Amit Kucheria Link: https://lore.kernel.org/r/2526d2b2907116d1bb6f7edd194226eb7e24c333.1584516925.git.amit.kucheria@linaro.org Signed-off-by: Bjorn Andersson commit 0e3ac61d703d9c68b9fa431bfcddaf063f990af9 Author: Amit Kucheria Date: Wed Mar 18 14:38:16 2020 +0530 dt-bindings: arm: cpus: Add kryo468 compatible Kryo468 is found in sc7180, so add it to the list of cpu compatibles Reviewed-by: Stephen Boyd Reviewed-by: Rajendra Nayak Signed-off-by: Amit Kucheria Link: https://lore.kernel.org/r/cd0f3d35ca0fc2944fd97e030a28318ff82dd5c1.1584516925.git.amit.kucheria@linaro.org Signed-off-by: Bjorn Andersson commit 31abcc91ef397c3e61659e1f69b38f8031d51b90 Author: Ulf Hansson Date: Thu Mar 26 11:39:32 2020 +0100 arm64: dts: qcom: msm8916: Conform to the nodename pattern PSCI subnodes Subnodes for PSCI should start with "power-domain-", so let's adopt to this. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200326103932.5809-3-ulf.hansson@linaro.org Signed-off-by: Bjorn Andersson commit 912f9a6d0b75cbdbb0c86a4b011f571f7dc3a257 Author: Ulf Hansson Date: Thu Mar 26 11:39:31 2020 +0100 arm64: dts: qcom: msm8916: Conform to the domain-idle-state binding As the domain-idle-state DT binding got converted to the json-schema, a few minor changes were introduced. For example, the states needs to be specified within a separate node, named domain-idle-states. Let's conform to the updated binding. This also silence the below errors for msm8916 from of 'make dtbs_check': idle-states: cluster-retention:compatible:0: 'arm,idle-state' was expected idle-states: cluster-gdhs:compatible:0: 'arm,idle-state' was expected Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200326103932.5809-2-ulf.hansson@linaro.org Signed-off-by: Bjorn Andersson commit 8acc36189dcaf4487d8c6ba7445948f39b1d248a Author: Abhishek Sahu Date: Fri Apr 3 13:40:40 2020 +0200 ARM: dts: qcom: ipq4019: fix high resolution timer Cherry-picked from CAF QSDK repo. Original commit message: The kernel is failing in switching the timer for high resolution mode and clock source operates in 10ms resolution. The always-on property needs to be given for timer device tree node to make clock source working in 1ns resolution. Signed-off-by: Abhishek Sahu Signed-off-by: Pavel Kubelun Signed-off-by: Christian Lamparter Tested-by: Robert Marko Cc: Luka Perkov Link: https://lore.kernel.org/r/20200403114040.349787-1-robert.marko@sartura.hr Signed-off-by: Bjorn Andersson commit 21e855cdfeb91cf2fe92cd608c3f1d657fc73c5c Author: Bart Van Assche Date: Sun Apr 5 15:59:05 2020 -0700 scsi: qla2xxx: Split qla2x00_configure_local_loop() The size of the function qla2x00_configure_local_loop() hurts its readability. Hence split that function. This patch does not change any functionality. Link: https://lore.kernel.org/r/20200405225905.17171-1-bvanassche@acm.org Cc: Nilesh Javali Cc: Himanshu Madhani Cc: Quinn Tran Cc: Martin Wilck Cc: Daniel Wagner Cc: Roman Bolshakov Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Reviewed-by: Daniel Wagner Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b9b97e6903032ec56e6dcbe137a9819b74a17fea Author: Nilesh Javali Date: Tue Apr 7 23:43:32 2020 -0700 scsi: qedi: Fix termination timeouts in session logout The destroy connection ramrod timed out during session logout. Fix the wait delay for graceful vs abortive termination as per the FW requirements. Link: https://lore.kernel.org/r/20200408064332.19377-7-mrangankar@marvell.com Reviewed-by: Lee Duncan Signed-off-by: Nilesh Javali Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit c6bfa707207c34674d45235e44e63f9a5801232f Author: Manish Rangankar Date: Tue Apr 7 23:43:31 2020 -0700 scsi: qedi: Add modules param to enable qed iSCSI debug Add module parameter to enable debug messages specific to iSCSI functions. Link: https://lore.kernel.org/r/20200408064332.19377-6-mrangankar@marvell.com Reviewed-by: Lee Duncan Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 927527aea0e2a9c1d336c7d33f77f1911481d008 Author: Nilesh Javali Date: Tue Apr 7 23:43:30 2020 -0700 scsi: qedi: Do not flush offload work if ARP not resolved For an unreachable target, offload_work is not initialized and the endpoint state is set to OFLDCONN_NONE. This results in a WARN_ON due to the check of the work function field being set to zero. ------------[ cut here ]------------ WARNING: CPU: 24 PID: 18587 at ../kernel/workqueue.c:3037 __flush_work+0x1c1/0x1d0 : Hardware name: HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10, BIOS U30 02/01/2020 RIP: 0010:__flush_work+0x1c1/0x1d0 Code: ba 6d 00 03 80 c9 f0 eb b6 48 c7 c7 20 ee 6c a4 e8 52 d3 04 00 0f 0b 31 c0 e9 d1 fe ff ff 48 c7 c7 20 ee 6c a4 e8 3d d3 04 00 <0f> 0b 31 c0 e9 bc fe ff ff e8 11 f3 f 00 31 f6 RSP: 0018:ffffac5a8cd47a80 EFLAGS: 00010282 RAX: 0000000000000024 RBX: ffff98d68c1fcaf0 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff98ce9fd99898 RDI: ffff98ce9fd99898 RBP: ffff98d68c1fcbc0 R08: 00000000000006fa R09: 0000000000000001 R10: ffffac5a8cd47b50 R11: 0000000000000001 R12: 0000000000000000 R13: 000000000000489b R14: ffff98d68c1fc800 R15: ffff98d692132c00 FS: 00007f65f7f62280(0000) GS:ffff98ce9fd80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffd2435e880 CR3: 0000000809334003 CR4: 00000000007606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ? class_create_release+0x40/0x40 ? klist_put+0x2c/0x80 qedi_ep_disconnect+0xdd/0x400 [qedi] iscsi_if_ep_disconnect.isra.20+0x59/0x70 [scsi_transport_iscsi] iscsi_if_rx+0x129b/0x1670 [scsi_transport_iscsi] ? __netlink_lookup+0xe7/0x160 netlink_unicast+0x21d/0x300 netlink_sendmsg+0x30f/0x430 sock_sendmsg+0x5b/0x60 ____sys_sendmsg+0x1e2/0x240 ? copy_msghdr_from_user+0xd9/0x160 ___sys_sendmsg+0x88/0xd0 ? ___sys_recvmsg+0xa2/0xe0 ? hrtimer_try_to_cancel+0x25/0x100 ? do_nanosleep+0x9c/0x170 ? __sys_sendmsg+0x5e/0xa0 __sys_sendmsg+0x5e/0xa0 do_syscall_64+0x60/0x1f0 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f65f6f16107 Code: 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 80 00 00 00 00 8b 05 aa d2 2b 00 48 63 d2 48 63 ff 85 c0 75 18 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 59 f3 c3 0f 1f 8 0 00 00 00 00 53 48 89 f3 48 RSP: 002b:00007ffd24367ca8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000055a7aeaaf110 RCX: 00007f65f6f16107 RDX: 0000000000000000 RSI: 00007ffd24367cc0 RDI: 0000000000000003 RBP: 0000000000000070 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000075c R11: 0000000000000246 R12: 00007ffd24367cc0 R13: 000055a7ae560008 R14: 00007ffd24367db0 R15: 0000000000000000 ---[ end trace 54f499c05d41f8bb ]--- Only flush if the connection endpoint state if different from OFLDCONN_NONE. [mkp: clarified commit desc] Link: https://lore.kernel.org/r/20200408064332.19377-5-mrangankar@marvell.com Reviewed-by: Lee Duncan Signed-off-by: Nilesh Javali Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit cf9e672dd85561a0fb7e5595b4e40efa291fc59b Author: Manish Rangankar Date: Tue Apr 7 23:43:29 2020 -0700 scsi: qedi: Use correct msix count for fastpath vectors Use MSI-X count provided by qed. Link: https://lore.kernel.org/r/20200408064332.19377-4-mrangankar@marvell.com Reviewed-by: Lee Duncan Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 2e612fab05112d9e40add3c3cb75a0e86967d53c Author: Manish Rangankar Date: Tue Apr 7 23:43:28 2020 -0700 scsi: qedi: Avoid unnecessary endpoint allocation on link down No need to allocate and deallocate endpoint memory if the physical link is down. Link: https://lore.kernel.org/r/20200408064332.19377-3-mrangankar@marvell.com Reviewed-by: Lee Duncan Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 2f1ea39870c95aa9fff6a0b48757625a0b22f551 Author: Manish Rangankar Date: Tue Apr 7 23:43:27 2020 -0700 scsi: qedi: Remove additional char from boot target iqnname While parsing the iSCSI TLV data to MFW request, a newline was added to the firmware boot target iqnname string. Because of this, we were getting the following error even after the boot target was successfully logged in: "[qedi_get_protocol_tlv_data:1197]:1: Boot target not set" Remove the trailing newline. [mkp: clarified commit desc] Link: https://lore.kernel.org/r/20200408064332.19377-2-mrangankar@marvell.com Reviewed-by: Lee Duncan Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 38427e5a47bf83299da930bd474c6cb2632ad810 Author: Maulik Shah Date: Sun Apr 12 20:20:04 2020 +0530 soc: qcom: rpmh-rsc: Allow using free WAKE TCS for active request When there are more than one WAKE TCS available and there is no dedicated ACTIVE TCS available, invalidating all WAKE TCSes and waiting for current transfer to complete in first WAKE TCS blocks using another free WAKE TCS to complete current request. Remove rpmh_rsc_invalidate() to happen from tcs_write() when WAKE TCSes is re-purposed to be used for Active mode. Clear only currently used WAKE TCS's register configuration. Fixes: 2de4b8d33eab (drivers: qcom: rpmh-rsc: allow active requests from wake TCS) Signed-off-by: Maulik Shah Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1586703004-13674-7-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit 15b3bf61b8d48f8e0ccd9d7f1bcb468b543da396 Author: Raju P.L.S.S.S.N Date: Sun Apr 12 20:20:03 2020 +0530 soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS For RSCs that have sleep & wake TCS but no dedicated active TCS, wake TCS can be re-purposed to send active requests. Once the active requests are sent and response is received, the active mode configuration needs to be cleared so that controller can use wake TCS for sending wake requests. Introduce enable_tcs_irq() to enable completion IRQ for repurposed TCSes. Fixes: 2de4b8d33eab (drivers: qcom: rpmh-rsc: allow active requests from wake TCS) Signed-off-by: Raju P.L.S.S.S.N [mkshah: call enable_tcs_irq() within drv->lock, update commit message] Signed-off-by: Maulik Shah Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1586703004-13674-6-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit 985427f997b6a31155cce841eb395d43c64771c5 Author: Maulik Shah Date: Sun Apr 12 20:20:02 2020 +0530 soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches Add changes to invoke rpmh flush() from CPU PM notification. This is done when the last the cpu is entering deep CPU idle states and controller is not busy. Controllers that have 'HW solver' mode like display RSC do not need to register for CPU PM notification. They may be in autonomous mode executing low power mode and do not require rpmh_flush() to happen from CPU PM notification. Signed-off-by: Maulik Shah Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1586703004-13674-5-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit f5ac95f9ca2f439179a5baf48e1c0f22f83d936e Author: Maulik Shah Date: Sun Apr 12 20:20:01 2020 +0530 soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data TCSes have previously programmed data when rpmh_flush() is called. This can cause old data to trigger along with newly flushed. Fix this by cleaning SLEEP and WAKE TCSes before new data is flushed. With this there is no need to invoke rpmh_rsc_invalidate() call from rpmh_invalidate(). Simplify rpmh_invalidate() by moving invalidate_batch() inside. Fixes: 600513dfeef3 ("drivers: qcom: rpmh: cache sleep/wake state requests") Signed-off-by: Maulik Shah Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1586703004-13674-4-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit bb7000677a1b287206c8d4327c62442fa3050a8f Author: Maulik Shah Date: Sun Apr 12 20:20:00 2020 +0530 soc: qcom: rpmh: Update dirty flag only when data changes Currently rpmh ctrlr dirty flag is set for all cases regardless of data is really changed or not. Add changes to update dirty flag when data is changed to newer values. Update dirty flag everytime when data in batch cache is updated since rpmh_flush() may get invoked from any CPU instead of only last CPU going to low power mode. Also move dirty flag updates to happen from within cache_lock and remove unnecessary INIT_LIST_HEAD() call and a default case from switch. Fixes: 600513dfeef3 ("drivers: qcom: rpmh: cache sleep/wake state requests") Signed-off-by: Maulik Shah Reviewed-by: Srinivas Rao L Reviewed-by: Evan Green Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1586703004-13674-3-git-send-email-mkshah@codeaurora.org Signed-off-by: Bjorn Andersson commit 51befb888f62b1a62434fb4b82328d698a30f9de Author: Ansuel Smith Date: Thu Mar 19 23:44:24 2020 +0100 ARM: dts: qcom: add scm definition to ipq806x Add missing scm definition for ipq806x soc Signed-off-by: Ansuel Smith Link: https://lore.kernel.org/r/20200319224424.18473-1-ansuelsmth@gmail.com Signed-off-by: Bjorn Andersson commit 1790c97125dd29d58d2404192c542966b0056309 Author: Markus Elfring Date: Sun Apr 5 18:08:13 2020 +0200 soc: qcom: smp2p: Delete an error message in qcom_smp2p_probe() The function platform_get_irq() can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Link: https://lore.kernel.org/r/eb92fcfb-6181-1f9d-2601-61e5231bd892@web.de Signed-off-by: Bjorn Andersson commit d6815c5c43d4f9d18e557d27fd27ae8d9cfd450c Author: Stephen Boyd Date: Mon Mar 9 11:57:04 2020 -0700 soc: qcom: cmd-db: Add debugfs dumping file It's useful for kernel devs to understand what resources and data is stored inside command db. Add a file in debugufs called 'cmd-db' to dump the memory contents and strings for resources along with their addresses. E.g. Command DB DUMP Slave ARC (v16.0) ------------------------- 0x00030000: cx.lvl [00 00 10 00 40 00 80 00 c0 00 00 01 80 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00] 0x00030004: cx.tmr 0x00030010: mx.lvl [00 00 10 00 00 01 80 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00] 0x00030014: mx.tmr Cc: Lina Iyer Cc: Maulik Shah Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20200309185704.2491-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson commit 27a344139c186889d742764d3c2a62b395949cef Author: Srinivas Kandagatla Date: Thu Mar 19 12:14:18 2020 +0000 soc: qcom: socinfo: add missing soc_id sysfs entry Looks like SoC ID is not exported to sysfs for some reason. This patch adds it! This is mostly used by userspace libraries like Snapdragon Neural Processing Engine (SNPE) SDK for checking supported SoC info. Fixes: efb448d0a3fc ("soc: qcom: Add socinfo driver") Reviewed-by: Stephen Boyd Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200319121418.5180-1-srinivas.kandagatla@linaro.org Signed-off-by: Bjorn Andersson commit 7ad18bb5c2c4bd50c8b83d375ee19be992022cf3 Author: Sibi Sankar Date: Thu Feb 27 18:26:15 2020 +0530 soc: qcom: cmd-db: Fix compilation error when CMD_DB is disabled If CONFIG_QCOM_COMMAND_DB=n the following compilation errors will be seen. Fix this by including the appropriate linux headers. ./include/soc/qcom/cmd-db.h: In function ‘cmd_db_read_aux_data’: ./include/soc/qcom/cmd-db.h: error: implicit declaration of function ‘ERR_PTR’; Reviewed-by: Stephen Boyd Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20200227125615.4727-1-sibis@codeaurora.org Signed-off-by: Bjorn Andersson commit fbbef0dad79f31baca4fdc09779918c70c1b26ca Author: Daniel Wagner Date: Fri Apr 3 11:27:17 2020 +0200 scsi: qedf: Simplify mutex_unlock() usage The commit 6d1368e8f987 ("scsi: qedf: fixup locking in qedf_restart_rport()") introduced the lock. Though the lock protects only the fc_rport_create() call. Thus, we can move the mutex unlock up before the if statement and drop the else body. Link: https://lore.kernel.org/r/20200403092717.19779-1-dwagner@suse.de Cc: Hannes Reinecke Cc: Saurav Kashyap Signed-off-by: Daniel Wagner Signed-off-by: Martin K. Petersen commit cdb9b07d8c78be63d72aba9a2686ff161ddd2099 Author: Marco Elver Date: Fri Apr 10 18:44:18 2020 +0200 kcsan: Make reporting aware of KCSAN tests Reporting hides KCSAN runtime functions in the stack trace, with filtering done based on function names. Currently this included all functions (or modules) that would match "kcsan_". Make the filter aware of KCSAN tests, which contain "kcsan_test", and are no longer skipped in the report. This is in preparation for adding a KCSAN test module. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit f770ed10a9ee65529f3ec8d90eb374bbd8b7c238 Author: Marco Elver Date: Fri Apr 10 18:44:17 2020 +0200 kcsan: Fix function matching in report Pass string length as returned by scnprintf() to strnstr(), since strnstr() searches exactly len bytes in haystack, even if it contains a NUL-terminator before haystack+len. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit d071e91361bbfef524ae8abf7e560fb294d0ad64 Author: Marco Elver Date: Tue Mar 31 21:32:33 2020 +0200 kcsan: Change data_race() to no longer require marking racing accesses Thus far, accesses marked with data_race() would still require the racing access to be marked in some way (be it with READ_ONCE(), WRITE_ONCE(), or data_race() itself), as otherwise KCSAN would still report a data race. This requirement, however, seems to be unintuitive, and some valid use-cases demand *not* marking other accesses, as it might hide more serious bugs (e.g. diagnostic reads). Therefore, this commit changes data_race() to no longer require marking racing accesses (although it's still recommended if possible). The alternative would have been introducing another variant of data_race(), however, since usage of data_race() already needs to be carefully reasoned about, distinguishing between these cases likely adds more complexity in the wrong place. Link: https://lkml.kernel.org/r/20200331131002.GA30975@willie-the-truck Cc: Paul E. McKenney Cc: Will Deacon Cc: Qian Cai Acked-by: Will Deacon Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 01b4ff58f72dbee926077d9afa0650f6e685e866 Author: Marco Elver Date: Tue Mar 31 21:32:32 2020 +0200 kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h Both affect access checks, and should therefore be in kcsan-checks.h. This is in preparation to use these in compiler.h. Acked-by: Will Deacon Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit d8949ef1d9f1062848cd068cf369a57ce33dae6f Author: Marco Elver Date: Wed Mar 25 17:41:58 2020 +0100 kcsan: Introduce scoped ASSERT_EXCLUSIVE macros Introduce ASSERT_EXCLUSIVE_*_SCOPED(), which provide an intuitive interface to use the scoped-access feature, without having to explicitly mark the start and end of the desired scope. Basing duration of the checks on scope avoids accidental misuse and resulting false positives, which may be hard to debug. See added comments for usage. The macros are implemented using __attribute__((__cleanup__(func))), which is supported by all compilers that currently support KCSAN. Suggested-by: Boqun Feng Suggested-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 9967683ce5d4ce21829bbc807e006ee33cc68725 Author: Marco Elver Date: Wed Mar 25 17:41:57 2020 +0100 objtool, kcsan: Add explicit check functions to uaccess whitelist Add explicitly invoked KCSAN check functions to objtool's uaccess whitelist. This is needed in order to permit calling into kcsan_check_scoped_accesses() from the fast-path, which in turn calls __kcsan_check_access(). __kcsan_check_access() is the generic variant of the already whitelisted specializations __tsan_{read,write}N. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 757a4cefde76697af2b2c284c8a320912b77e7e6 Author: Marco Elver Date: Wed Mar 25 17:41:56 2020 +0100 kcsan: Add support for scoped accesses This adds support for scoped accesses, where the memory range is checked for the duration of the scope. The feature is implemented by inserting the relevant access information into a list of scoped accesses for the current execution context, which are then checked (until removed) on every call (through instrumentation) into the KCSAN runtime. An alternative, more complex, implementation could set up a watchpoint for the scoped access, and keep the watchpoint set up. This, however, would require first exposing a handle to the watchpoint, as well as dealing with cases such as accesses by the same thread while the watchpoint is still set up (and several more cases). It is also doubtful if this would provide any benefit, since the majority of delay where the watchpoint is set up is likely due to the injected delays by KCSAN. Therefore, the implementation in this patch is simpler and avoids hurting KCSAN's main use-case (normal data race detection); it also implicitly increases scoped-access race-detection-ability due to increased probability of setting up watchpoints by repeatedly calling __kcsan_check_access() throughout the scope of the access. The implementation required adding an additional conditional branch to the fast-path. However, the microbenchmark showed a *speedup* of ~5% on the fast-path. This appears to be due to subtly improved codegen by GCC from moving get_ctx() and associated load of preempt_count earlier. Suggested-by: Boqun Feng Suggested-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 6119418f94ca5314392d258d27eb0cb58bb1774e Author: Marco Elver Date: Wed Mar 18 18:38:45 2020 +0100 kcsan: Avoid blocking producers in prepare_report() To avoid deadlock in case watchers can be interrupted, we need to ensure that producers of the struct other_info can never be blocked by an unrelated consumer. (Likely to occur with KCSAN_INTERRUPT_WATCHER.) There are several cases that can lead to this scenario, for example: 1. A watchpoint A was set up by task T1, but interrupted by interrupt I1. Some other thread (task or interrupt) finds watchpoint A consumes it, and sets other_info. Then I1 also finds some unrelated watchpoint B, consumes it, but is blocked because other_info is in use. T1 cannot consume other_info because I1 never returns -> deadlock. 2. A watchpoint A was set up by task T1, but interrupted by interrupt I1, which also sets up a watchpoint B. Some other thread finds watchpoint A, and consumes it and sets up other_info with its information. Similarly some other thread finds watchpoint B and consumes it, but is then blocked because other_info is in use. When I1 continues it sees its watchpoint was consumed, and that it must wait for other_info, which currently contains information to be consumed by T1. However, T1 cannot unblock other_info because I1 never returns -> deadlock. To avoid this, we need to ensure that producers of struct other_info always have a usable other_info entry. This is obviously not the case with only a single instance of struct other_info, as concurrent producers must wait for the entry to be released by some consumer (which may be locked up as illustrated above). While it would be nice if producers could simply call kmalloc() and append their instance of struct other_info to a list, we are very limited in this code path: since KCSAN can instrument the allocators themselves, calling kmalloc() could lead to deadlock or corrupted allocator state. Since producers of the struct other_info will always succeed at try_consume_watchpoint(), preceding the call into kcsan_report(), we know that the particular watchpoint slot cannot simply be reused or consumed by another potential other_info producer. If we move removal of a watchpoint after reporting (by the consumer of struct other_info), we can see a consumed watchpoint as a held lock on elements of other_info, if we create a one-to-one mapping of a watchpoint to an other_info element. Therefore, the simplest solution is to create an array of struct other_info that is as large as the watchpoints array in core.c, and pass the watchpoint index to kcsan_report() for producers and consumers, and change watchpoints to be removed after reporting is done. With a default config on a 64-bit system, the array other_infos consumes ~37KiB. For most systems today this is not a problem. On smaller memory constrained systems, the config value CONFIG_KCSAN_NUM_WATCHPOINTS can be reduced appropriately. Overall, this change is a simplification of the prepare_report() code, and makes some of the checks (such as checking if at least one access is a write) redundant. Tested: $ tools/testing/selftests/rcutorture/bin/kvm.sh \ --cpus 12 --duration 10 --kconfig "CONFIG_DEBUG_INFO=y \ CONFIG_KCSAN=y CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC=n \ CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=n \ CONFIG_KCSAN_REPORT_ONCE_IN_MS=100000 CONFIG_KCSAN_VERBOSE=y \ CONFIG_KCSAN_INTERRUPT_WATCHER=y CONFIG_PROVE_LOCKING=y" \ --configs TREE03 => No longer hangs and runs to completion as expected. Reported-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 135c0872d86948046d11d7083e36c930cc43ac93 Author: Marco Elver Date: Wed Mar 18 18:38:44 2020 +0100 kcsan: Introduce report access_info and other_info Improve readability by introducing access_info and other_info structs, and in preparation of the following commit in this series replaces the single instance of other_info with an array of size 1. No functional change intended. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 164eaf6b435c31d98fdabe0151e979fa0b4280a0 Author: Tang Bin Date: Mon Apr 6 13:07:57 2020 +0800 power: supply: 88pm860x_battery: remove redundant dev_err message In the pm860x_battery_probe(), when get irq failed, the function platform_get_irq() logs an dev_err message, so remove redundant message here. Signed-off-by: Tang Bin Signed-off-by: Sebastian Reichel commit 4ac54b88b6c191e400a4e5d09da3a693307365eb Author: Rafael Gandolfi Date: Mon Apr 6 16:05:38 2020 +0200 power: supply: axp288_fuel_gauge: Add the Meegopad T02 to the blacklist. The Meegopad T02 is a PC in stick format and doesn't have a battery, it is reported with a random and constant battery charge but as discharging to userspace. Add it to the blacklist to avoid the bogus battery status reporting. Signed-off-by: Rafael Gandolfi Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 35cdc3fa00ee3aebf1a25f55db8a114cbb612092 Merge: 8f3d9f354286 f06f924a65fb Author: Florian Fainelli Date: Mon Apr 13 15:55:35 2020 -0700 Merge tag 'tags/bcm2835-defconfig-next-2020-03-27' into defconfig/next Enables fixed regulator in bcm2835_defconfig Signed-off-by: Florian Fainelli commit 460227c329e5bd39103b9f7ba01cbad69b14c4c4 Merge: 8f3d9f354286 3ac395a5b3f3 Author: Florian Fainelli Date: Mon Apr 13 15:53:28 2020 -0700 Merge tag 'tags/bcm2835-dt-next-2020-03-27' into devicetree/next - First patch updates RPi4's expgpio's GPIO labels, adding the SD power rail. - Second patch adds a fixed regulator that controls the SD power and hooks it up with emmc2. - Third patch rolls back to the firmware based power driver as the MMIO version is unstable. Signed-off-by: Florian Fainelli commit f05ec5073fdea165d13624322d6fc4d295bccc65 Author: Jason Yan Date: Thu Apr 9 16:54:01 2020 +0800 power: supply: max14656: remove set but not used 'ret' Fix the following gcc warning: drivers/power/supply/max14656_charger_detector.c:142:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret = 0; ^~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Sebastian Reichel commit cf96e284deda69e26a90b8f278967998e7b628ab Merge: fd167f7a4a60 538b8471fee8 Author: Benson Leung Date: Mon Apr 13 12:53:22 2020 -0700 Merge remote-tracking branch 'origin/chrome-platform-5.7-fixes' into for-kernelci Merging 5.7 fixes branch as of April 13, containing two fixes to branch destined for chrome-platform-5.8. 538b8471fee8 platform/chrome: cros_ec_sensorhub: Add missing '\n' in log messages 5b69c23799ec platform/chrome: cros_ec_sensorhub: Off by one in cros_sensorhub_send_sample() Signed-off-by: Benson Leung commit 4e2dec66e2ae4f3b44e0b16311391eaf2e95bb95 Author: Mauro Carvalho Chehab Date: Wed Apr 8 17:46:15 2020 +0200 scsi: docs: fusion: get rid of a doc build warning Use a table for the enum list, to avoid this warning: ./drivers/message/fusion/mptbase.c:5058: WARNING: Definition list ends without a blank line; unexpected unindent. Link: https://lore.kernel.org/r/9ca049c2d25689c56448afddf4f0d1e619fa87f7.1586359676.git.mchehab+huawei@kernel.org Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Martin K. Petersen commit 689b937beddebf2d7c57249206428b8eecf4646b Author: Hsin-Yi Wang Date: Mon Feb 10 14:35:23 2020 +0800 arm64: dts: mediatek: add mt8173 elm and hana board Elm is Acer Chromebook R13. Hana is Lenovo Chromebook. Both uses mt8173 SoC. Signed-off-by: Hsin-Yi Wang Tested-by: Enric Balletbo i Serra Reviewed-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200210063523.133333-5-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 72b29215aced394d01ca25e432963b619daa0098 Author: Hsin-Yi Wang Date: Mon Feb 10 14:35:22 2020 +0800 arm64: dts: mt8173: fix unit name warnings Fixing several unit name warnings: Warning (unit_address_vs_reg): /oscillator@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /oscillator@1: node has a unit name, but no reg property Warning (unit_address_vs_reg): /oscillator@2: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/trips/trip-point@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/trips/trip-point@1: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/trips/cpu_crit@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/cooling-maps/map@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/cooling-maps/map@1: node has a unit name, but no reg property Warning (unit_address_vs_reg): /reserved-memory/vpu_dma_mem_region: node has a reg or ranges property, but no unit name Warning (simple_bus_reg): /soc/pinctrl@10005000: simple-bus unit address format error, expected "1000b000" Warning (simple_bus_reg): /soc/interrupt-controller@10220000: simple-bus unit address format error, expected "10221000" Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20200210063523.133333-4-hsinyi@chromium.org [mb: drop fixes for '_' in property name] Signed-off-by: Matthias Brugger commit 0f5da28ef8274f44204df300d52bfbc635da32db Author: Hsin-Yi Wang Date: Mon Feb 10 14:35:21 2020 +0800 arm64: dts: mt8173: add uart aliases Add serial as uart aliases in mt8173. Signed-off-by: Hsin-Yi Wang Reviewed-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20200210063523.133333-3-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 668f44f354b7c71f6f8f98f049510a4273a1f412 Author: Hsin-Yi Wang Date: Mon Feb 10 14:35:20 2020 +0800 dt-bindings: arm64: dts: mediatek: Add mt8173 elm and hana Elm is Acer Chromebook R13. Hana is Lenovo Chromebook. Both uses mt8173 SoC. Signed-off-by: Hsin-Yi Wang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20200210063523.133333-2-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 6b55297581eaf4f1850b4d25b29dd55a239272cc Author: Ikjoon Jang Date: Tue Feb 25 16:07:53 2020 +0800 arm64: dts: mt8183: adjust cpuidle target residency Split a cluster level cpuidle state into two, so mt8183 variant boards can adjust parameters for each cluster, and reduce cluster0's default target residency to 1000us as power measurements showed that its minimum residency is slightly less than cluster1's 1300us. Signed-off-by: Ikjoon Jang Link: https://lore.kernel.org/r/20200225080752.200952-1-ikjn@chromium.org Signed-off-by: Matthias Brugger commit eb4a01afedf64bf0f44f0dbd9fee87d917eb4a13 Author: Hsin-Yi Wang Date: Thu Apr 9 13:50:12 2020 +0800 arm64: dts: mt8173: Add gce setting in mmsys and display node In order to use GCE function, we need add some informations into display node (mboxes, mediatek,gce-client-reg, mediatek,gce-events). Signed-off-by: Hsin-Yi Wang Tested-by: Enric Balletbo i Serra Reviewed-by: Bibby Hsieh Reviewed-by: Chun-Kuang Hu Signed-off-by: Matthias Brugger commit ff5b89c2858f28006f9f9c0a88c55a679488192c Author: Sean Wang Date: Sun Mar 8 14:34:37 2020 +0800 arm: dts: mt7623: add phy-mode property for gmac2 Add phy-mode property required by phylink on gmac2 Fixes: b8fc9f30821e ("net: ethernet: mediatek: Add basic PHYLINK support") Signed-off-by: Sean Wang Link: https://lore.kernel.org/r/70e3eff31ecd500ed4862d9de28325a4dbd15105.1583648927.git.sean.wang@mediatek.com Signed-off-by: Matthias Brugger commit d94541fa8ae87f916ac5f6546972afb4a19acbc9 Merge: 3ba21113bd33 0650857570d1 Author: Takashi Iwai Date: Mon Apr 13 18:03:52 2020 +0200 Merge branch 'topic/for-5.8' into for-next Signed-off-by: Takashi Iwai commit 43ad9b39b0a3af10ebf8133012898c0a0d991b9b Author: Jason Yan Date: Mon Apr 13 22:33:00 2020 +0800 drm/radeon: remove defined but not used variables in ci_dpm.c Fix the following gcc warning: drivers/gpu/drm/radeon/ci_dpm.c:82:36: warning: ‘defaults_saturn_pro’ defined but not used [-Wunused-const-variable=] static const struct ci_pt_defaults defaults_saturn_pro = ^~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/ci_dpm.c:68:36: warning: ‘defaults_bonaire_pro’ defined but not used [-Wunused-const-variable=] static const struct ci_pt_defaults defaults_bonaire_pro = ^~~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit 01e5e998a30ebcc621162360e2d3d03bfb5ac55b Author: Jason Yan Date: Mon Apr 13 22:32:45 2020 +0800 drm/radeon: remove defined but not used 'dte_data_tahiti_le' Fix the following gcc warning: drivers/gpu/drm/radeon/si_dpm.c:255:33: warning: ‘dte_data_tahiti_le’ defined but not used [-Wunused-const-variable=] static const struct si_dte_data dte_data_tahiti_le = Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit 8e2f84206389164b5938b8ad39213e8891665af7 Author: Jason Yan Date: Mon Apr 13 22:32:35 2020 +0800 drm/amdgpu: remove dead code in si_dpm.c This code is dead, let's remove it. Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit dd4fa6c1b89a4f4034ec79c65405fdfc920204d1 Author: Aurabindo Pillai Date: Wed Apr 8 21:28:15 2020 -0400 drm/amd/amdgpu: remove hardcoded module name in prints Let format prefixes take care of printing the module name through pr_fmt and dev_fmt definitions. Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 539489fc91ea773c0b124697da1ed6f0866a653e Author: Aurabindo Pillai Date: Wed Apr 8 21:28:14 2020 -0400 drm/amd/amdgpu: add print prefix for dev_* variants Define dev_fmt macro for informative print messages Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit d57229b1da7204dc0ec663478bc36c8fcf0314d0 Author: Aurabindo Pillai Date: Wed Apr 8 21:28:13 2020 -0400 drm/amd/amdgpu: add prefix for pr_* prints amdgpu uses lots of pr_* calls for printing error messages. With this prefix, errors shall be more obvious to the end use regarding its origin, and may help debugging. Prefix format: [xxx.xxxxx] amdgpu: ... Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit bba8289b8f02e325ccd74d69ecbb499fa58961a7 Author: Jason Yan Date: Mon Apr 13 16:22:49 2020 +0800 drm/amd/display: code clean up in dce80_hw_sequencer.c Fix the following gcc warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_hw_sequencer.c:43:46: warning: ‘reg_offsets’ defined but not used [-Wunused-const-variable=] static const struct dce80_hw_seq_reg_offsets reg_offsets[] = { ^~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Alex Deucher commit a4c246802719416a53162d807da562effe8ef355 Author: Alex Deucher Date: Thu Apr 9 16:04:39 2020 -0400 drm/amdgpu/ring: simplify scheduler setup logic Set up a GPU scheduler based on the ring flag rather than the ring type. Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a783910d5c8b45f62c820123a14332d2f37a5387 Author: Alex Deucher Date: Thu Apr 9 16:02:36 2020 -0400 drm/amdgpu/kiq: add no_scheduler flag to KIQ We don't want a GPU scheduler for this ring. Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cb3d1085019da94cf2b7d721600b4e5df93b4ef8 Author: Alex Deucher Date: Thu Apr 9 15:56:05 2020 -0400 drm/amdgpu/ring: add no_scheduler flag This allows IPs to flag whether a specific ring requires a GPU scheduler or not. E.g., sometimes instances of an IP are asymmetric and have different capabilities. Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e8663832b088fb37ad6558f62dcaf3ae0116bb8d Author: Likun Gao Date: Mon Sep 16 11:37:42 2019 +0800 drm/amdgpu/powerplay: get SMC FW size to a flexible way Get SMC fw size before backdoor loading instead of giving an certain value, as it may different for different ASIC. Signed-off-by: Likun Gao Reviewed-by: Kenneth Feng Reviewed-by: Evan Quan Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit dadce777e0947b9b6839f06f360882e54ba2a154 Author: Evan Quan Date: Fri Apr 10 15:38:44 2020 +0800 drm/amdgpu: fix wrong vram lost counter increment V2 Vram lost counter is wrongly increased by two during baco reset. V2: assumed vram lost for mode1 reset on all ASICs Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ed72aa21c74a22457f56a9af1ccafd057098186f Author: Guchun Chen Date: Mon Apr 13 14:39:09 2020 +0800 drm/amdgpu: replace DRM prefix with PCI device info for GFX RAS Prefix RAS message printing in GFX IP with PCI device info, which assists the debug in multiple GPU case. Signed-off-by: Guchun Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d32709dac627e5602fb3e66bcf4316906356120d Author: Yintian Tao Date: Mon Apr 13 14:31:27 2020 +0800 drm/amdgpu: resume kiq access debugfs If there is no GPU hang, user still can access debugfs through kiq. Signed-off-by: Yintian Tao Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit 6952e99cfd52d32098540fe8d9e592828b9e774c Author: Guchun Chen Date: Fri Apr 10 15:51:14 2020 +0800 drm/amdgpu: refine ras related message print Prefix ras related kernel message logging with PCI device info by replacing DRM_INFO/WARN/ERROR with dev_info/warn/err. This can clearly tell user about GPU device information where ras is. And add some other ras message printing to make it more clear and friendly as well. Suggested-by: Hawking Zhang Signed-off-by: Guchun Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1f3ef0efbacb2aa63e8e3933664192ee27d0d95b Author: Guchun Chen Date: Fri Apr 10 11:41:54 2020 +0800 drm/amdgpu: add uncorrectable error count print in UMC ecc irq cb Uncorrectable error count printing is missed when issuing UMC UE injection. When going to the error count log function in GPU recover work thread, there is no chance to get correct error count value by last error injection and print, because the error status register is automatically cleared after reading in UMC ecc irq callback. So add such message printing in UMC ecc irq cb to be consistent with other RAS error interrupt cases. Signed-off-by: Guchun Chen Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 7adf5619ae82244446e0e9e5199d96c316f3c80d Author: Sergei Lopatin Date: Wed Jun 26 14:56:59 2019 +0500 drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled Should prevent flicker if PP_OVERDRIVE_MASK is set. bug: https://bugs.freedesktop.org/show_bug.cgi?id=102646 bug: https://bugs.freedesktop.org/show_bug.cgi?id=108941 bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1088 bug: https://gitlab.freedesktop.org/drm/amd/-/issues/628 Signed-off-by: Sergei Lopatin Signed-off-by: Alex Deucher commit f9135b086b5863eeb83973fd291a7c30ba62333e Author: Zhan Liu Date: Thu Apr 9 15:32:44 2020 -0400 drm/amd/display: Change "error" to "dc_log" at amdgpu_dm dpcd reading stage [Why] If reading dpcd happens ahead of hw initialization, then aconnector is NULL at this point. This is expected, so there is no need to output an error (which will spam dmesg.log) [How] Change type of message from "error" to "DC_LOG_DC". Signed-off-by: Zhan Liu Reviewed-by: Rodrigo Siqueira Acked-by: Zhan Liu Signed-off-by: Alex Deucher commit 95a2f917387a23c8b09f4ab95e1560a69db5b1f1 Author: Yintian Tao Date: Tue Apr 7 18:08:39 2020 +0800 drm/amdgpu: restrict debugfs register access under SR-IOV Under bare metal, there is no more else to take care of the GPU register access through MMIO. Under Virtualization, to access GPU register is implemented through KIQ during run-time due to world-switch. Therefore, under SR-IOV user can only access debugfs to r/w GPU registers when meets all three conditions below. - amdgpu_gpu_recovery=0 - TDR happened - in_gpu_reset=0 v2: merge amdgpu_virt_can_access_debugfs() into amdgpu_virt_enable_access_debugfs() v3: drop ret variable in amdgpu_virt_enable_access_debugfs() and directly return result Signed-off-by: Yintian Tao Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit fd167f7a4a6079c14a0c940e9103495b171279fb Author: Jett Rink Date: Fri Apr 10 10:23:05 2020 -0600 platform/chrome: cros_ec_ishtp: free ishtp buffer before sending event Recycle the ISH buffer before notifying of a response or an event. Often a new message is sent in response to an event and in high traffic scenarios this can lead to exhausting all available buffers. We can ensure we are using the fewest buffers possible by freeing buffers as soon as they are used. Signed-off-by: Jett Rink Signed-off-by: Mathew King Signed-off-by: Enric Balletbo i Serra commit 0f706b4fac8b19fd0a4b4fef24dbadb23a3eb0c1 Author: Jett Rink Date: Fri Apr 10 10:23:04 2020 -0600 platform/chrome: cros_ec_ishtp: skip old cros_ec responses The ISHTP layer can give us old responses that we already gave up on. We do not want to interpret these old responses as the current response we are waiting for. The cros_ish should only have one request in flight at a time. We send the request and wait for the response from the ISH. If the ISH is too slow to respond we give up on that request and we can send a new request. The ISH may still send the response to the request that timed out and without this we treat the old response as the response to the current command. This is a condition that should not normally happen but it has been observed with a bad ISH image. So add a token to the request header which is copied into the response header when the ISH processes the message to ensure that response is for the current request. Signed-off-by: Jett Rink Signed-off-by: Mathew King Signed-off-by: Enric Balletbo i Serra commit ad35da94b61785ddc1186095c3e488c5c0af6bd2 Author: Bernardo Perez Priego Date: Thu Apr 2 15:33:30 2020 -0700 platform/chrome: wilco_ec: Provide correct output format to 'h1_gpio' file Function 'h1_gpio_get' is receiving 'val' parameter of type u64, this is being passed to 'send_ec_cmd' as type u8, thus, result is stored in least significant byte. Due to output format, the whole 'val' value was being displayed when any of the most significant bytes are different than zero. This fix will make sure only least significant byte is displayed regardless of remaining bytes value. Signed-off-by: Bernardo Perez Priego Signed-off-by: Enric Balletbo i Serra commit 1c7c51347f2e2ff5920cee1b54c683e2af06bd81 Author: Sarthak Kukreti Date: Wed Apr 1 17:15:48 2020 -0700 platform/chrome: chromeos_pstore: set user space log size On x86 ChromiumOS devices, the pmsg_size is set to 0 (check /sys/module/ramoops/parameters/pmsg_size): this prevents use of pstore-pmsg, even if CONFIG_PSTORE_PMSG is enabled. Set pmsg_size to a value that is consistent with the size used on non-x86 ChromiumOS devices. Signed-off-by: Sarthak Kukreti Reviewed-by: Kees Cook Signed-off-by: Enric Balletbo i Serra commit 5b167212d673f4fcf02ff4d8266d76daf0d5e061 Author: Marek Vasut Date: Mon Mar 30 04:22:22 2020 +0200 ARM: dts: imx6q-dhcom: Add DH 560-200 display unit support Add DT bits to support the DH 560-200 display unit, which can be plugged into the side of the PDK2 board. The display unit contains a display, EDT ETM0700G0EDH6 and an EDT FT5x06 touchscreen controller. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP Linux Team Cc: Shawn Guo To: linux-arm-kernel@lists.infradead.org Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit a0348a4da1a7073fa14065f370f507073b857782 Author: Jiasen Lin Date: Thu Apr 9 00:11:24 2020 -0700 NTB: Fix static check warning in perf_clear_test As pthr->dma_chan can't be NULL in this context, so there is no need to check pthr->dma_chan. Fixes: 99a06056124d ("NTB: ntb_perf: Fix address err in perf_copy_chunk") Reported-by: Dan Carpenter Signed-off-by: Jiasen Lin Signed-off-by: Jon Mason commit f454f4d1915b44cc3857148aac7a297a31591501 Author: Maciej Grochowski Date: Thu Apr 9 01:03:37 2020 -0400 include/ntb: Fix typo in ntb_unregister_device description Signed-off-by: Maciej Grochowski Signed-off-by: Jon Mason commit d5b2b22558f1a265ea8e88e5a54fc61ae7da3355 Author: Waibel Georg Date: Wed Mar 18 10:33:24 2020 +0000 clk: imx: imx6ul: change flexcan clock to support CiA bitrates Setting a CAN bitrate of 800kbit/s fails with a bitrate error of 1.3% if the flexcan module is clocked at 30MHz (CAN_CLK_ROOT). This patch changes the clock frequency from 30MHz to 40MHz which allows to support all bitrates recommended by CiA. The patch sets CAN_CLK_SEL to 80MHz by changing its clock parent from CLK_PLL3_60M to CLK_PLL3_80M. The post-divider CAN_CLK_PODF is set to /2 by default which makes 40MHz CAN_CLK_ROOT from its parent CAN_CLK_SEL. Background: CAN in Automation document 102 (CiA102) recommends the CAN bitrates 10, 20, 50, 125, 250, 500, 800 and 1000kbit/s. With the flexcan serial clock at 30MHz (original value) setting some common bitrates ("ip link set canX type can bitrate ") gives the following results: requested value / actually set value 5000: bitrate 5000 sample-point 0.708 10000: bitrate 10000 sample-point 0.866 20000: bitrate 20000 sample-point 0.866 40000: bitrate 40000 sample-point 0.866 50000: bitrate 50000 sample-point 0.866 80000: bitrate 80000 sample-point 0.866 100000: bitrate 100000 sample-point 0.866 125000: bitrate 125000 sample-point 0.875 250000: bitrate 250000 sample-point 0.866 400000: bitrate 400000 sample-point 0.866 500000: bitrate 500000 sample-point 0.866 666666: bitrate 666666 sample-point 0.800 800000: bitrate 789473 sample-point 0.789 !!!bitrate error 1.3% 1000000: bitrate 1000000 sample-point 0.733 With the flexcan serial clock at 40MHz (new value) we get this: 5000: no more possible 10000: bitrate 10000 sample-point 0.875 20000: bitrate 20000 sample-point 0.875 40000: bitrate 40000 sample-point 0.850 50000: bitrate 50000 sample-point 0.875 80000: bitrate 80000 sample-point 0.850 100000: bitrate 100000 sample-point 0.875 125000: bitrate 125000 sample-point 0.875 250000: bitrate 250000 sample-point 0.875 400000: bitrate 400000 sample-point 0.850 500000: bitrate 500000 sample-point 0.875 666666: bitrate 666666 sample-point 0.800 800000: bitrate 800000 sample-point 0.800 1000000: bitrate 1000000 sample-point 0.750 A drawback of the modification is that 5kbit/s is no more supported. Setting the flexcan serial clock to 60MHz or 80MHz would produce similar results but with losing even more bitrates at the lower end. Changing the flexcan serial clock to 40MHz might apply for other SoCs using the flaxcan module as well (e.g. imx6q/d/s..). But since I don't have such hardware to test I did not add this to the patch. Signed-off-by: Georg Waibel Signed-off-by: Shawn Guo commit 87c3d579c8ed0eaea6b1567d529a8daa85a2bc6c Author: Enric Balletbo i Serra Date: Mon Apr 13 16:10:51 2020 +0200 power: supply: bq24257_charger: Replace depends on REGMAP_I2C with select regmap is a library function that gets selected by drivers that need it. No driver modules should depend on it. Depending on REGMAP_I2C makes this driver only build if another driver already selected REGMAP_I2C, as the symbol can't be selected through the menu kernel configuration. Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver") Signed-off-by: Enric Balletbo i Serra Signed-off-by: Sebastian Reichel commit 68a95ef72cefeeabbc68d36f191f49743a3d9c08 Author: Cristian Birsan Date: Fri Apr 10 19:43:20 2020 +0300 ARM: dts: at91: sama5d2-icp: add SAMA5D2-ICP This is the addition of the new SAMA5D2 Industrial Connectivity Platform(ICP). Signed-off-by: Cristian Birsan Link: https://lore.kernel.org/r/20200410164320.7658-3-cristian.birsan@microchip.com Signed-off-by: Alexandre Belloni commit a2e269ca294c65fb5ef66a2d4b61cf9533152dd1 Author: Codrin Ciubotariu Date: Fri Apr 10 19:43:19 2020 +0300 dt-bindings: ARM: Document SAMA5D2-ICP Document device tree binding for SAMA5D2 Industrial Connectivity Platform(ICP). Signed-off-by: Codrin Ciubotariu [cristian.birsan@microchip.com update board name to match silkscreen] Signed-off-by: Cristian Birsan Link: https://lore.kernel.org/r/20200410164320.7658-2-cristian.birsan@microchip.com Signed-off-by: Alexandre Belloni commit ce920326663b3df22c94ade99a8b234baa6ccaa5 Author: Malcolm Priestley Date: Sun Apr 12 11:43:00 2020 +0100 staging: vt6656: formulate rspinf values into tables Four tables can be extracted from RSPINF_A_* based on BB_TYPE_11A or else being GB rates. Preamble short or long tables from fixed size len of 14 for RSPINF_B rates. Remove function vnt_calculate_ofdm_rate and replace with the tables calling RSPINF_A and RSPINF_B separately. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/addca9e1-9ea2-59ee-dec9-3afb3c731c2e@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9ed05c15a319e9758da56c3d034a6b50eb9fa2de Author: Ivan Safonov Date: Sun Apr 12 20:37:16 2020 +0300 staging: r8188eu: replace rtw_malloc/copy_from_user sequence with memdup_user memdup_user is shorter and expressively. Signed-off-by: Ivan Safonov Link: https://lore.kernel.org/r/20200412173716.846469-1-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 823b6a951fa28cec07771a43929436ae5961ed83 Author: Oscar Carter Date: Sat Apr 11 14:51:04 2020 +0200 staging: vt6656: Remove unnecessary local variable initialization Don't initialize the ret variable as it is set a few lines later. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200411125104.9625-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 2661509ffafbb84cf186b45b391869b51af4a04d Author: Oscar Carter Date: Sat Apr 11 14:51:03 2020 +0200 staging: vt6656: Remove duplicate code in vnt_vt3184_init function Remove duplicate code in "if" statements because different branches are almost the same. Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200411125104.9625-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 8d71b5e11dc3a219d5af3c9d1367fe4c998754a6 Author: Oscar Carter Date: Tue Apr 7 18:39:15 2020 +0200 staging: vt6656: Remove unnecessary local variable initialization Don't initialize the rate variable as it is set a few lines later. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter Link: https://lore.kernel.org/r/20200407163915.7491-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 2da5445be1da5cf125359a173eff7df906ab2bd8 Author: Malcolm Priestley Date: Mon Apr 6 20:33:16 2020 +0100 staging: vt6656: rxtx remove rate change and current_rate. There is no longer any need to change power in vnt_tx_packet. Remove current_rate in vnt_tx_packet and struct vnt_private as it is no longer used elsewhere. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/3ba896aa-5ab2-affb-9ce5-7df8a9b3190a@gmail.com Signed-off-by: Greg Kroah-Hartman commit 463288b98190d55d0610aef28582480b44a58657 Author: Malcolm Priestley Date: Mon Apr 6 20:31:16 2020 +0100 staging: vt6556: vnt_rf_setpower convert to use ieee80211_channel. ieee80211_channel contains all the necessary information to change power according to tx mode required. vnt_rf_setpower is moved and so that vnt_rf_set_txpower the only caller becomes static. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/9eab9af8-fde9-1dc6-fced-95c7a36ecc01@gmail.com Signed-off-by: Greg Kroah-Hartman commit a6a002fd8934806ce89c96ea697803cda8ba944f Author: Jason Yan Date: Thu Apr 9 16:53:39 2020 +0800 staging: vc04_services: remove set but not used 'local_entity_uc' Fix the following gcc warning: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:2356:16: warning: variable ‘local_entity_uc’ set but not used [-Wunused-but-set-variable] int local_uc, local_entity_uc; ^~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200409085339.47255-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 9485a408ae31ed93325d1109dab0d692661cf8a2 Author: Michael Straube Date: Thu Apr 9 10:08:02 2020 +0200 staging: rtl8188eu: remove 5 GHz if test Cleanup a line over 80 characters by removing an if test that is valid only for 5 GHz. According to the TODO 5 GHz code should be removed. - find and remove remaining code valid only for 5 GHz. Most of the obvious ones have been removed, but things like channel > 14 still exist. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200409080802.16645-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fab6710e4c51f4eb622f95a08322ab5fdbe3f295 Author: Sergio Paracuellos Date: Mon Apr 13 07:59:42 2020 +0200 staging: mt7621-pci: fix PCIe interrupt mapping MT7621 has three assigned interrupts for the pcie. This interrupts should properly being mapped taking into account which devices are finally connected in which bus according to link status. So the irq mappings should be as follows according to link status (three bits indicating which devices are link up): * For PCIe Bus 1 slot 0: - status = 0x2 || status = 0x6 => IRQ = pcie1_irq (24). - status = 0x4 => IRQ = pcie2_irq (25). - default => IRQ = pcie0_irq (23). * For PCIe Bus 2 slot 0: - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25). - default => IRQ = pcie1_irq (24). * For PCIe Bus 2 slot 1: - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25). - default => IRQ = pcie1_irq (24). * For PCIe Bus 3 any slot: - default => IRQ = pcie2_irq (25). Because of this, the function 'of_irq_parse_and_map_pci' cannot be used and we need to change device tree information from using the 'interrupt-map' and 'interrupt-map-mask' properties into an 'interrupts' property to be able to get irq information from the ports using the 'platform_get_irq' and storing an 'irq-map' into the pcie driver data node to properly map correct irq using a new 'mt7621_map_irq' function where this map will be read and the correct irq returned. Fixes: 46d093124df4 ("staging: mt7621-pci: improve interrupt mapping") Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200413055942.2714-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit be3d9b6802392d0a1a0b2380aee8fb63144d6224 Author: Sergio Paracuellos Date: Fri Apr 10 11:18:36 2020 +0200 staging: mt7621-pci-phy: dt: bindings: remove bindings txt file Yaml file for bindings has been properly added. Hence, remove the old txt file. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200410091836.13068-3-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d60093f8eec9e1f1ddca915e231772f33cee8d5 Author: Sergio Paracuellos Date: Fri Apr 10 11:18:35 2020 +0200 staging: mt7621-pci-phy: dt: bindings: add mediatek, mt7621-pci-phy.yaml Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200410091836.13068-2-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5fcded5e857cf66c9592e4be28c4dab4520c9177 Author: Sergio Paracuellos Date: Thu Apr 9 13:16:52 2020 +0200 staging: mt7621-pci: properly power off dual-ported pcie phy Pcie phy for pcie0 and pcie1 is shared using a dual ported one. Current code was assuming that if nothing is connected in pcie0 it won't be also nothing connected in pcie1. This assumtion is wrong for some devices such us 'Mikrotik rbm33g' and 'ZyXEL LTE3301-PLUS' where only connecting a card to the second bus on the phy is possible. For such devices kernel hangs in the same point because of the wrong poweroff of the phy getting the following trace: mt7621-pci-phy 1e149000.pcie-phy: PHY for 0xbe149000 (dual port = 1) mt7621-pci-phy 1e14a000.pcie-phy: PHY for 0xbe14a000 (dual port = 0) mt7621-pci-phy 1e149000.pcie-phy: Xtal is 40MHz mt7621-pci-phy 1e14a000.pcie-phy: Xtal is 40MHz mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) [hangs] The wrong assumption is located in the 'mt7621_pcie_init_ports' function where we are just making a power off of the phy for slots 0 and 2 if nothing is connected in them. Hence, only poweroff the phy if nothing is connected in both slot 0 and slot 1 avoiding the kernel to hang. Fixes: 5737cfe87a9c ("staging: mt7621-pci: avoid to poweroff the phy for slot one") Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20200409111652.30964-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit a53f548597805dfa3b5bcc7036cd81cd212381e7 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:39 2020 +0200 staging: wfx: drop useless update of macaddr Mac address is set in wfx_add_interface() and removed in wfx_remove_interface(). Currently, there is also an additional update of mac address in wfx_do_unjoin(). It has no rationale. Mac address is already present and nothing has changed it. Therefore, we can drop it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 790241e92847c93f1bd7772299e6c58fb8f185e8 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:38 2020 +0200 staging: wfx: drop unused attribute 'beacon_int' The field beacon_int is never read. Drop it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 239a1d3c646080a85d72ed2ffb2d26e703e5ef72 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:37 2020 +0200 staging: wfx: check value of beacon_int Firmware dislike when beacon_int value is 0. This patch add some warnings in case it would happen. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit ac243a1b6ff03c1874bddb9fcbc74694da497783 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:36 2020 +0200 staging: wfx: re-enable BA after reset Firmware does not support Block Acks when multiple vif are running. Thus, wfx_add_interface() and wfx_remove_interface() enable and disable Block Acks as necessary. Block Ack policy is also reset after hif_reset(). Driver have to re-enable it after each call to hif_reset(). This patch reflects this behavior. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit e836ad4e2da4c4472bb08c15fcd60493d5a09d64 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:35 2020 +0200 staging: wfx: introduce wfx_join_ibss() and wfx_leave_ibss() Currently, IBSS networks are started by the mean of wfx_bss_info_changed(). It easier to use use callbacks provided by mac80211. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 17c8cc79ef72a5791a7c5223d9f5905cdaa69f30 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:34 2020 +0200 staging: wfx: allow to join IBSS networks Current code does not permit to join an already existing IBSS network. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7b063f3bfbcd76b50b894ba16ed38a065ca33e07 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:33 2020 +0200 staging: wfx: avoid duplicate updating of beacon template When ERP changes, mac80211 call wfx_bss_info_changed() with BSS_CHANGED_ERP_* and with BSS_CHANGED_BEACON. The driver already update beacon template because of BSS_CHANGED_BEACON. It is not necessary to also update beacon template because of BSS_CHANGED_ERP_*. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 974dfbf8fe411dff2e77d15ed8ec54777d13452c Author: Jérôme Pouiller Date: Fri Apr 10 15:32:32 2020 +0200 staging: wfx: remove unnecessary conditions in wfx_bss_info_changed() wfx_bss_info_changed() update ERP and CQM related stuff. Thus, it check the flags BSS_CHANGED_ERP_* and BSS_CHANGED_CQM. It also update ERP and CQM on join and leave by checking the flag BSS_CHANGED_ASSOC. This check is useless. Mac80211 already do that job and set necessary flags as expected. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 23d57c152cef193c96598bb449f3f7e83c4aae2e Author: Jérôme Pouiller Date: Fri Apr 10 15:32:31 2020 +0200 staging: wfx: request to send beacons in IBSS mode Currently, firmware take in charge of start/stop sending beacons while in IBSS mode. However, this behavior may change in the further releases. Currently, asking to firmware to send beacon while in IBSS mode return an error but is harmless. Therefore, send this request unconditionally. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9f9a18e40e0849b72857b7ed47b3d3bb70d93052 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:30 2020 +0200 staging: wfx: drop unnecessary condition checks in wfx_upload_ap_templates() In former code, wfx_upload_ap_templates() was called in more cases than necessary. Therefore, it tried to not update the frame templates if it was not necessary. Now, wfx_upload_ap_templates() is called only if mac80211 asked to update the templates. In add, it does not hurt to upload template if they are not used. So, remove unnecessary conditions at beginning of wfx_upload_ap_templates() Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 54a9d85cab0892b5d3e5a5bba08a7f6973717025 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:29 2020 +0200 staging: wfx: disabling keep alive during unjoin is useless After a call to hif_reset(), the parameters associated with BSS are reset. So, it useless to explicitly reset the keep alive period. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit eeab4787d95b05a338e2a7ce125dc660c5fb232f Author: Jérôme Pouiller Date: Fri Apr 10 15:32:28 2020 +0200 staging: wfx: fix support for BSS_CHANGED_KEEP_ALIVE Chip firmware is able to send periodic null frames to keep the association with the AP. The driver arbitrary set this period to 30sec. We prefer to rely on BSS_CHANGED_KEEP_ALIVE that provide a true value. Note that if BSS_CHANGED_KEEP_ALIVE is not received, we just disable keep_alive feature. It is not very disturbing since AP will probably ping the station before to disconnect it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit eb63e2fddb51370fcb2ba77ce5e9d49515acc295 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:27 2020 +0200 staging: wfx: remove useless call to wfx_tx_flush() wfx_do_join() calls wfx_tx_lock_flush() ate beginning of the function. Therefore, the subsequent call to wfx_tx_flush() is useless. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9abb6b26f62e392ba3761256e9e020a45c5629e3 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:26 2020 +0200 staging: wfx: change the way the station associate to an AP Chipset need two steps to associate with an AP: 1. it start receiving beacon from the AP (done with wfx_do_join()) 2. it sent the association request (done with wfx_join_finalize()) The join request (see hif_join()) contains basic rates, beacon interval and bssid to connect, so we trig on these events for the first step. The second step is obviously associated to the event BSS_CHANGED_ASSOC. Note that conf_mutex is now easier to manage. It is held by wfx_bss_info_changed() and inner functions does not need to lock it. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 3393eebd9ddbe952628b297374befd10d73e2741 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:25 2020 +0200 staging: wfx: set all parameters before starting AP Current code start AP and then configure the different parameters. Since all the configuration is sent quickly after AP started, it works. However, it is not very nice. In add, last firmware releases start to disallow incorrect settings. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit cba1d8976db0032171bc36decd67df168e58bf3a Author: Jérôme Pouiller Date: Fri Apr 10 15:32:24 2020 +0200 staging: wfx: implement start_ap/stop_ap Currently, wfx_bss_info_changed() check interface status changes and guess when the pattern match with an AP start and AP stop (through wfx_update_beaconing()). It is far easier to rely on start_ap and stop_ap callbacks provided by mac80211. wfx_bss_info_changed() keeps only the responsibility of updating the frame templates. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 836a8fc3f5073b204135a088908b15d868030c4c Author: Jérôme Pouiller Date: Fri Apr 10 15:32:23 2020 +0200 staging: wfx: call wfx_do_unjoin() synchronously Currently, wfx_do_unjoin() are called by the mean of work queues. However, the contexts from where they are called are not atomic. So there is no reason to not call it synchronously. This change will simplify the code. Notice two main changes: - There no more reason to lock tx queue before to run wfx_do_unjoin(). We can lock the tx queue directly from wfx_do_unjoin(). - Most of the time, wfx_do_unjoin_work() was called with conf_mutex held. This patch remove lock of conf_mutex in wfx_do_unjoin_work() and ensure that conf_mutex is always held whatever the context. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b4d74f7ad1cdfb0099a4c844d3692ccd94b144aa Author: Jérôme Pouiller Date: Fri Apr 10 15:32:22 2020 +0200 staging: wfx: reduce hold duration of cfg80211_bss Pointer to cfg80211_bss is held during all duration of wfx_do_join. But, it is not necessary, We can release it far earlier. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 0f66c31eb6c457a8013c7093fd3204e7d8808115 Author: Jérôme Pouiller Date: Fri Apr 10 15:32:21 2020 +0200 staging: wfx: fix race between configure_filter and remove_interface wfx_remove_interface() and wfx_configure_filter() can be run concurrently. Therefore, this patch protect access to the list of interfaces from wfx_configure_filter(). Notice that wfx_configure_filter() now lock "conf_lock" and "scan_lock". Beside that, wfx_hw_scan_work() also access to the same locks. So we have to lock them in same order to avoid any deadlock. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200410133239.438347-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit be4692e5e04a063119de9a74471504ab7ec39d1a Author: Jérôme Pouiller Date: Mon Apr 6 13:17:56 2020 +0200 staging: wfx: send just necessary bytes Size of hif_mib_template_frame must be sufficient to contains bytes declared by frame_length and cannot exceed 700bytes. Change the API to reflect that. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9a46a0a93b7b885888c59c98ea0d6d3ff5a8081e Author: Jérôme Pouiller Date: Mon Apr 6 13:17:55 2020 +0200 staging: wfx: make hif_ie_table_entry const In wfx_update_filtering(), filter_ies is never modified. So, make it constant. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 32f5d47cbf01f8b31edf3bdbae82e79da76a69bd Author: Jérôme Pouiller Date: Mon Apr 6 13:17:54 2020 +0200 staging: wfx: allow to connect an IBSS with an existing SSID With current code, chip is not able to join an existing IBSS network. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9671f1338b67c93183a6051789acadd10c5942bb Author: Jérôme Pouiller Date: Mon Apr 6 13:17:53 2020 +0200 staging: wfx: place hif_tx_mib functions into a .c file Until now, all functions from hif_tx_mib.h are declared "static inline". However, they are not time critical. So, it does not make so much sense. We prefer to place them in a .c file as for other hif functions. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit fac592d084abfc8e1c71536a0563fde852007a81 Author: Jérôme Pouiller Date: Mon Apr 6 13:17:52 2020 +0200 staging: wfx: align members declarations in hif API Hardware API headers were not uniformly aligned. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 31db18cccc277e63f0e6489587381d52f034194b Author: Jérôme Pouiller Date: Mon Apr 6 13:17:51 2020 +0200 staging: wfx: fix endianness of hif API The chip expects little endian in all structs it sends/receives. This patch fixes the hif API to reflect this fact. Sparse should now report meaningful errors. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a3d968288640277819af01f23f593af1c279a2b8 Author: Jérôme Pouiller Date: Mon Apr 6 13:17:50 2020 +0200 staging: wfx: remove useless defines Several values defined in hif API are only here to define length of some arrays. In most cases, they do not provide any extra information about the size of the array (ie. "API_FIRMWARE_LABEL_SIZE" is only used to define the size of member "firmware_label"). Remove these useless definitions. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 29d69a59c4c6de92a9f0b4b5dbb2e7842168b87f Author: Jérôme Pouiller Date: Mon Apr 6 13:17:49 2020 +0200 staging: wfx: remove unused definitions from the hif API Until now, hif API was directly imported from firmware sources. However, it does not make sense to keep ton of unused structures in the driver. Moreover, the hif API is now stable enough to be keep in sync by importing delta from firmware. So, drop unused definitions from the hif API. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a4aac6b8890fef31c94cc658d4b56591d20cf5f2 Author: Jérôme Pouiller Date: Mon Apr 6 13:17:48 2020 +0200 staging: wfx: relocate TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID to hif API The definitions TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID are imposed by the hardware. Therefore, they should be located in the hardware interface API. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit d7dcf8a54ea51463ece2c7c5893d7941a53edae0 Author: Jérôme Pouiller Date: Mon Apr 6 13:17:47 2020 +0200 staging: wfx: relocate LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE to hif API The definitions LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE are imposed by the hardware. Therefore, they should be located in the hardware interface API. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 43aeff2c09e0ada5826f047df694657ea3ab80f2 Author: Jérôme Pouiller Date: Mon Apr 6 13:17:46 2020 +0200 staging: wfx: drop unused WFX_LINK_ID_GC_TIMEOUT The definition WFX_LINK_ID_GC_TIMEOUT is not used anymore since commit d6aeba575f27 ("staging: wfx: simplify the link-id allocation") Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200406111756.154086-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 1ba2ed77210ab9d4d0995cce0d2ef2cae742bd09 Author: Ryder Lee Date: Mon Mar 30 06:53:40 2020 +0800 arm64: dts: mt7622: add built-in Wi-Fi device nodes This enables built-in 802.11n Wi-Fi support. It's 2.4GHz only. Signed-off-by: Ryder Lee Signed-off-by: Matthias Brugger commit 667c769246b01c53ad0925d603d2a2531abd3ef2 Author: Enric Balletbo i Serra Date: Wed Mar 25 18:31:23 2020 +0100 soc / drm: mediatek: Fix mediatek-drm device probing In the actual implementation the same compatible string "mediatek,-mmsys" is used to bind the clock drivers (drivers/soc/mediatek) as well as to the gpu driver (drivers/gpu/drm/mediatek/mtk_drm_drv.c). This ends with the problem that the only probed driver is the clock driver and there is no display at all. In any case having the same compatible string for two drivers is not correct and should be fixed. To fix this, and maintain backward compatibility, we can consider that the mmsys driver is the top-level entry point for the multimedia subsystem, so is not a pure clock controller but a system controller, and the drm driver is instantiated by that MMSYS driver. Signed-off-by: Enric Balletbo i Serra Reviewed-by: CK Hu Acked-by: CK Hu Signed-off-by: Matthias Brugger commit 2c758e301ed95aefde68f98584204811d55c9bb8 Author: Enric Balletbo i Serra Date: Wed Mar 25 18:31:22 2020 +0100 soc / drm: mediatek: Move routing control to mmsys device Provide a mtk_mmsys_ddp_connect() and mtk_mmsys_disconnect() functions to replace mtk_ddp_add_comp_to_path() and mtk_ddp_remove_comp_from_path(). Those functions will allow DRM driver and others to control the data path routing. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Matthias Brugger Reviewed-by: CK Hu Acked-by: CK Hu Tested-by: Anders Roxell Reviewed-by: Chun-Kuang Hu Signed-off-by: Matthias Brugger commit 13032709e2328553970f0002df5edce6aac69425 Author: Matthias Brugger Date: Wed Mar 25 18:31:21 2020 +0100 clk / soc: mediatek: Move mt8173 MMSYS to platform driver There is no strong reason for this to use CLK_OF_DECLARE instead of being a platform driver. Plus, MMSYS provides clocks but also a shared register space for the mediatek-drm and the mediatek-mdp driver. So move the MMSYS clocks to a new platform driver and also create a new MMSYS platform driver in drivers/soc/mediatek that instantiates the clock driver. Signed-off-by: Matthias Brugger Signed-off-by: Enric Balletbo i Serra Reviewed-by: CK Hu Reviewed-by: Stephen Boyd Signed-off-by: Matthias Brugger commit 1a680aa888d6ff39507d09a022bde20ef7e809dd Author: Enric Balletbo i Serra Date: Wed Mar 25 18:31:20 2020 +0100 dt-bindings: mediatek: Update mmsys binding to reflect it is a system controller The mmsys system controller is not only a pure clock controller, so update the binding documentation to reflect that apart from providing clocks, it also provides routing and miscellaneous control registers. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Matthias Brugger Reviewed-by: CK Hu Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Matthias Brugger commit af19d6450101bc2c4f0d30ffce1780b676e10552 Author: Matthias Brugger Date: Wed Mar 25 18:31:19 2020 +0100 drm/mediatek: Omit warning on probe defers It can happen that the mmsys clock drivers aren't probed before the platform driver gets invoked. The platform driver used to print a warning that the driver failed to get the clocks. Omit this error on the defered probe path. Signed-off-by: Matthias Brugger Reviewed-by: CK Hu Signed-off-by: Enric Balletbo i Serra Signed-off-by: Matthias Brugger commit 6a2ab88ca789804cad89d558625147edd26a1d37 Author: Razvan Stefanescu Date: Wed Mar 25 12:22:23 2020 +0200 ARM: configs: at91: sama5: enable MCP16502 regulator Driver is built as a module. Signed-off-by: Razvan Stefanescu Link: https://lore.kernel.org/r/20200325102223.24827-2-eugen.hristev@microchip.com Signed-off-by: Alexandre Belloni commit 8d77c0296150f96036e647fd27ed3a8ad0f7cf1b Author: Razvan Stefanescu Date: Wed Mar 25 12:22:22 2020 +0200 ARM: configs: at91: sama5: enable SAMA5D2_PIOBU Driver is enabled as a module. Signed-off-by: Razvan Stefanescu Link: https://lore.kernel.org/r/20200325102223.24827-1-eugen.hristev@microchip.com Signed-off-by: Alexandre Belloni commit 2fdc4e1c8cb1b291b920f514afad8d7ce286851d Author: Ludovic Desroches Date: Fri Apr 3 06:12:27 2020 +0000 ARM: dts: at91: at91-sama5d27_som1: Enable eeprom device There is an EEPROM on at91-sama5d27_som1 connected to i2c0. i2c0 node has to be moved from at91-sama5d27_som1_ek to at91-sama5d27_som1. Enable the i2c EEPROM found on at91-sama5d27_som1. Add an alias for the i2c node. Signed-off-by: Ludovic Desroches Tested-by: Tudor Ambarus Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200403061222.1277147-5-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 51cca920ce84356d53068ac83a53ba8c45879a0e Author: Cyrille Pitchen Date: Fri Apr 3 06:12:26 2020 +0000 ARM: dts: at91: sama5d2_xplained: Add QSPI0 + SPI NOR memory nodes This patch enables the QSPI0 controller, configures its pin muxing and declares a jedec,spi-nor memory. sama5d2 Xplained RevB and RevC use the Macronix MX25L25673G flash memory which advertises a maximum frequency of 80MHz for Quad IO Fast Read. Set the spi-max-frequency to 80MHz knowing that actually the QSPI drver will set the SPI bus clock to 166MHz / 3 = 55.3MHz. Signed-off-by: Cyrille Pitchen Tested-by: Tudor Ambarus Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200403061222.1277147-3-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 0fd3a8f58f78b498784b72c1971c225c4e69ddac Author: Tudor Ambarus Date: Fri Apr 3 06:12:26 2020 +0000 ARM: dts: at91: sam9x60ek: Add sdmmc1 node sdmmc1 is not populated by default on sam9x60ek, but there are cases where it is populated with wilc3000. Add the node, but keep it disabled. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200403061222.1277147-4-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 471f0532ea37160aa2751cd241478ceb738f1923 Author: Claudiu Beznea Date: Fri Apr 3 06:12:25 2020 +0000 ARM: dts: at91: sama5d27_som1: Add SPI NOR flash mapping Add SoM1 flash mapping, identical with the other SPI NOR flash mappings found on the other at91 boards. Signed-off-by: Claudiu Beznea Tested-by: Tudor Ambarus Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200403061222.1277147-2-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit c378150337efa7a4b03394b0229a9110bda8403c Author: Tudor Ambarus Date: Fri Apr 3 06:12:24 2020 +0000 ARM: dts: at91: sam9x60ek: Use quad mode in the spi-nor flash Both the QSPI controller and the sst26vf064b flash support quad mode, enable it. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20200403061222.1277147-1-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni commit 32542faf867f78e13cfec4178311795305c8c177 Author: Ludovic Desroches Date: Thu Apr 2 00:15:04 2020 +0200 ARM: dts: at91: sama5d27_som1_ek: add an alias for i2c0 Add aliases for i2c devices to not rely on probe order for i2c device numbering. Signed-off-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200401221504.41196-5-ludovic.desroches@microchip.com Signed-off-by: Alexandre Belloni commit d0815bc1b4559eddd671a3c51ba77fcd04c0fea4 Author: Ludovic Desroches Date: Thu Apr 2 00:15:03 2020 +0200 ARM: dts: at91: sama5d27_som1_ek: enable i2c0 Enable i2c0 controller. Signed-off-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200401221504.41196-4-ludovic.desroches@microchip.com Signed-off-by: Alexandre Belloni commit d08f4a5ac9fe2121b4d809d8529b5d4927971061 Author: Ludovic Desroches Date: Thu Apr 2 00:15:02 2020 +0200 ARM: dts: at91: sama5d2_ptc_ek: add PB_USER as wakeup source Add the push button PB_USER as wakeup source Signed-off-by: Ludovic Desroches Link: https://lore.kernel.org/r/20200401221504.41196-3-ludovic.desroches@microchip.com Signed-off-by: Alexandre Belloni commit baa998aecb75c04d62be0a4ab6b724af6d73a0f9 Author: Ludovic Desroches Date: Thu Apr 2 00:19:47 2020 +0200 ARM: dts: at91: sama5d2_ptc_ek: fix vbus pin The gpio property for the vbus pin doesn't match the pinctrl and is not correct. Signed-off-by: Ludovic Desroches Fixes: 42ed535595ec "ARM: dts: at91: introduce the sama5d2 ptc ek board" Cc: stable@vger.kernel.org # 4.19 and later Link: https://lore.kernel.org/r/20200401221947.41502-1-ludovic.desroches@microchip.com Signed-off-by: Alexandre Belloni commit a1af7f36c70369b971ee1cf679dd68368dad23f0 Author: Ludovic Desroches Date: Thu Apr 2 00:15:00 2020 +0200 ARM: dts: at91: sama5d2_ptc_ek: fix sdmmc0 node description Remove non-removable and mmc-ddr-1_8v properties from the sdmmc0 node which come probably from an unchecked copy/paste. Signed-off-by: Ludovic Desroches Fixes:42ed535595ec "ARM: dts: at91: introduce the sama5d2 ptc ek board" Cc: stable@vger.kernel.org # 4.19 and later Link: https://lore.kernel.org/r/20200401221504.41196-1-ludovic.desroches@microchip.com Signed-off-by: Alexandre Belloni commit 0e0e528d8260f10d32d6bc58fc987d553f3148a2 Author: Alexandre Belloni Date: Tue Mar 24 13:41:54 2020 +0100 ARM: dts: at91: rm9200: switch to new clock bindings Switch at91rm9200 boards to the new PMC clock bindings. Link: https://lore.kernel.org/r/20200324124154.368335-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 15090390cac613ab2d0db416e3e5f1699bf21547 Author: Alexandre Belloni Date: Fri Jan 17 22:06:19 2020 +0100 ARM: dts: at91: at91sam9g45: switch to new clock bindings Switch at91sam9g45 boards to the new PMC clock bindings. Link: https://lore.kernel.org/r/20200117210619.17768-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 82a5df83e444d4a8aef01c1ba81c38f5bb66b06a Author: Alexandre Belloni Date: Thu Jan 16 18:35:10 2020 +0100 ARM: dts: at91: at91sam9n12: switch to new clock bindings Switch at91sam9n12 boards to the new PMC clock bindings. Link: https://lore.kernel.org/r/20200116173510.427403-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 7ed609b0020fd1db5acde66248f5623328834b72 Author: Alexandre Belloni Date: Fri Jan 10 23:27:44 2020 +0100 ARM: dts: at91: sama5d3: switch to new clock bindings Switch sama5d3 boards to the new PMC clock bindings. This prevents the wb50n to use the out of spec rate for USART1. Link: https://lore.kernel.org/r/20200110222744.1261464-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit 778627c78f01c6a05abb1211f3e3d763c236506c Author: Wolfram Sang Date: Thu Mar 26 22:10:14 2020 +0100 ARM: s3c64xx: convert to use i2c_new_client_device() Move away from the deprecated API and remove printing a stale 'ret' value. Signed-off-by: Wolfram Sang Acked-by: Charles Keepax Signed-off-by: Krzysztof Kozlowski commit a8360727870bce0b4adb6f08a94bb6bc4cdf6c39 Author: Marek Szyprowski Date: Thu Mar 26 10:46:26 2020 +0100 ARM: exynos_defconfig: Compile MAC80211/CFG80211 as modules MAC80211/CFG80211 framework requires loading regulatory.db from /lib/firmware directory, so it makes very little sense to have it built-in. Change it to be built as modules to let it properly load the needed firmware/db files. As a side effect of this change, the size of the compressed modules on SquashFS increased significantly from 27MiB to 38MiB, so increase the size of BLK_DEV_RAM to allow the modules to fit into it. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 9b6d5690b543b8fbf3daf8fc2d7ec7b59b3a3467 Author: sachin agarwal Date: Sun Feb 9 16:46:20 2020 +0530 gpio: ich: fix a typo We had written "Mangagment" rather than "Management". Signed-off-by: Sachin Agarwal Signed-off-by: Andy Shevchenko commit 5707dd73c71bb442e1e617c5c7e8f55823fb7317 Author: Andy Shevchenko Date: Wed Apr 1 20:35:02 2020 +0300 pinctrl: cherryview: Use GENMASK() consistently Use GENMASK() macro for all definitions where it's appropriate. No functional change intended. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 36ad7b24486ae5e8705650d623cd2d998221f6ff Author: Andy Shevchenko Date: Wed Apr 1 20:35:01 2020 +0300 pinctrl: cherryview: Re-use data structures from pinctrl-intel.h (part 2) We have some data structures duplicated across the drivers. Let's deduplicate them by using ones that being provided by pinctrl-intel.h. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit b577a279914085c6b657c33e9f39ef56d96a3302 Author: Jonathan Bakker Date: Sat Apr 4 10:08:49 2020 -0700 pinctrl: samsung: Correct setting of eint wakeup mask on s5pv210 Commit a8be2af0218c ("pinctrl: samsung: Write external wakeup interrupt mask") started writing the eint wakeup mask from the pinctrl driver. Unfortunately, it made the assumption that the private retention data was always a regmap while in the case of s5pv210 it is a raw pointer to the clock base (as the eint wakeup mask not in the PMU as with newer Exynos platforms). Fixes: a8be2af0218c ("pinctrl: samsung: Write external wakeup interrupt mask") Cc: Signed-off-by: Jonathan Bakker Signed-off-by: Krzysztof Kozlowski commit f1b0ffaa686f21e8538bb38f0e147ee2ce80e67f Author: Marek Szyprowski Date: Fri Mar 27 14:00:05 2020 +0100 ARM: dts: exynos: Enable WLAN support for the UniversalC210 board Add a node for BCM4330/2 SDIO chip on SDHCI bus #3 and the required MMC power sequence node for the Exynos4210-based UniversalC210 board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 95384e977c426e73971e7393c393ccce66c084ec Author: Marek Szyprowski Date: Fri Mar 27 13:53:17 2020 +0100 ARM: dts: exynos: Enable WLAN support for the Rinato board Add a node for BCM43342A SDIO chip on MSHC bus #1 and the required MMC power sequence node for the Exynos3250-based Rinato board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit d22928095975acd4ac6c9fd5df768ffde82ebfdf Author: Marek Szyprowski Date: Thu Mar 26 16:09:46 2020 +0100 ARM: dts: exynos: Remove useless address/size cells for mshc_0 on Rinato mshc_0 node doesn't have any children, so there is no need for address and size-cells properties. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit ad0e74f0d67009c9db4a1e31ffba7badd06d805f Author: Marek Szyprowski Date: Thu Mar 26 16:08:06 2020 +0100 ARM: dts: exynos: Correct the MAX8997 interrupts on the Trats board Remove the 'interrupts' and 'interrupts-parent' properties, which have been superseded by the interrupts-extended property. While touching this, fix the interrupts flags to correctly describe the hardware. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 5453c5c9c5afadd6c2d0f6f0c6b168202b0310c1 Author: Marek Szyprowski Date: Thu Mar 26 15:44:55 2020 +0100 ARM: dts: exynos: Correct regulator names Both CPU-freq and dev-freq drivers support proper regulator lookup from device-tree, so the early introduced hacks for registering main ARM VDD regulator under 'vdd_arm' name are no longer needed. Similar for devfreq. Fix this by removing the obsolete comments and changing the regulator names to the one, which match the schematics and style for the given board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 8df80c1801c99e2a000c20ee2ab1a94ddd326720 Author: Marek Szyprowski Date: Thu Mar 26 15:39:09 2020 +0100 ARM: dts: exynos: Convert to new i2c-gpio bindings The updated "i2c-gpio" driver bindings require to define the SDA and SCL GPIO lines in the separate properties and mark both as GPIO_OPEN_DRAIN. Covert all Exynos dts files to follow this style. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 8807d356bfea92b0a8f04ce421800ed83400cd22 Author: Marek Szyprowski Date: Thu Mar 26 15:20:37 2020 +0100 ARM: dts: exynos: Fix GPIO polarity for thr GalaxyS3 CM36651 sensor's bus GPIO lines for the CM36651 sensor I2C bus use the normal not the inverted polarity. This bug has been there since adding the CM36651 sensor by commit 85cb4e0bd229 ("ARM: dts: add cm36651 light/proximity sensor node for exynos4412-trats2"), but went unnoticed because the "i2c-gpio" driver ignored the GPIO polarity specified in the device-tree. The recent conversion of "i2c-gpio" driver to the new, descriptor based GPIO API, automatically made it the DT-specified polarity aware, what broke the CM36651 sensor operation. Fixes: 85cb4e0bd229 ("ARM: dts: add cm36651 light/proximity sensor node for exynos4412-trats2") CC: stable@vger.kernel.org # 4.16+ Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit a19f6efc01df901c16a57455485613236eaad55e Author: Marek Szyprowski Date: Thu Mar 26 10:46:24 2020 +0100 ARM: dts: exynos: Enable WLAN support for the Trats board Add a node for BCM4330/3 SDIO chip on SDHCI bus #3 and the required MMC power sequence node for the Exynos4210-based Trats board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit b6353c31ab641d99a7879d9fae557c8793bd2243 Author: Marek Szyprowski Date: Thu Mar 26 09:35:23 2020 +0100 ARM: dts: exynos: Enable Bluetooth support for Rinato board Add a node for the BCM43342A Bluetooth chip on the serial bus #0 on the Exynos3250-based Rinato board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 8620cc2f99b734bfc7988b62f3d3c8c6fca04598 Author: Stenkin Evgeniy Date: Thu Mar 19 18:34:11 2020 +0100 ARM: dts: exynos: Add devicetree file for the Galaxy S2 Add devicetree file for the Exynos4210 based Galaxy S2 (GT-I9100 version). Signed-off-by: Stenkin Evgeniy Signed-off-by: Paul Cercueil Reviewed-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 15598aab6eb2dcb0996d9f6481e6a3cb348f6f28 Author: Paul Cercueil Date: Thu Mar 19 18:34:10 2020 +0100 dt-bindings: arm: samsung: Add compatible string for the Galaxy S2 Add compatible string for the Samsung Galaxy S2 (GT-I9100 version), which is an Exynos4210 based device. Signed-off-by: Paul Cercueil Signed-off-by: Krzysztof Kozlowski commit f8beebe019467c690f02ce75bb48fb5afa7b2730 Author: Marek Szyprowski Date: Thu Mar 26 09:35:24 2020 +0100 ARM: exynos_defconfig: Enable serial bus and BCM HCIUART drivers Enable serial bus and BCM HCIUART Bluetooth drivers available on the Exynos3250-based Rinato board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 2fa9a3cf3055db07a4835eb7bd48c648cb17ac26 Author: Borislav Petkov Date: Tue Mar 24 19:58:36 2020 +0100 x86/smpboot: Remove the last ICPU() macro Now all is using the shiny new macros. No code changed: # arch/x86/kernel/smpboot.o: text data bss dec hex filename 16432 2649 40 19121 4ab1 smpboot.o.before 16432 2649 40 19121 4ab1 smpboot.o.after md5: a58104003b72c1de533095bc5a4c30a9 smpboot.o.before.asm a58104003b72c1de533095bc5a4c30a9 smpboot.o.after.asm Signed-off-by: Borislav Petkov Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20200324185836.GI22931@zn.tnic commit 3b02a051d25d9600e9d403ad3043aed7de00160e Merge: f5d2313bd3c5 8f3d9f354286 Author: Ingo Molnar Date: Mon Apr 13 09:44:39 2020 +0200 Merge tag 'v5.7-rc1' into locking/kcsan, to resolve conflicts and refresh Resolve these conflicts: arch/x86/Kconfig arch/x86/kernel/Makefile Do a minor "evil merge" to move the KCSAN entry up a bit by a few lines in the Kconfig to reduce the probability of future conflicts. Signed-off-by: Ingo Molnar commit 0b973c65d2f2da049252bc8370e4cf037b99c7e9 Author: Colin Ian King Date: Thu Jan 23 00:48:07 2020 +0000 ARM: rockchip: fix spelling mistake "to" -> "too" There is a spelling mistake in a pr_err message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200123004807.2833556-1-colin.king@canonical.com Signed-off-by: Heiko Stuebner commit 37aed36cfec3b35469be3dc5fb52c8a459414cff Author: Geert Uytterhoeven Date: Wed Feb 12 11:08:27 2020 +0100 ARM: rockchip: Replace by The Rockchip platform code is not a clock provider, and just needs to call of_clk_init(). Hence it can include instead of . Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20200212100830.446-5-geert+renesas@glider.be Signed-off-by: Heiko Stuebner commit 73a6e90041ce80d5683f62bee0eaf7226ce73392 Author: R Veera Kumar Date: Mon Apr 6 21:11:26 2020 +0530 staging: rtl8723bs: hal: Correct misspelled symbolic name Correct misspelled symbolic name. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar Link: https://lore.kernel.org/r/b893adc31b71722df63d0756f0d360e27f896e51.1586187304.git.vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit cb514b30a9dc1ad86dbd62f89835f2bc74686d1c Author: R Veera Kumar Date: Mon Apr 6 21:11:25 2020 +0530 staging: rtl8723bs: hal: Correct misspelt enum name Correct misspelt enum name. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar Link: https://lore.kernel.org/r/d091fa95d537f613c24e55a2dee638d4493534b5.1586187304.git.vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit e3a2b0d97568b3db2117580fe59183ebddc8316e Author: R Veera Kumar Date: Mon Apr 6 21:11:24 2020 +0530 staging: rtl8723bs: Correct misspelt symbolic names Correct misspelt symbolic names. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar Link: https://lore.kernel.org/r/abe807c11a5fda479ed6079a11d528989fe7b63e.1586187304.git.vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit 3f84adfe1d7ae9c72f02a4f28d3381c678878a3d Author: Jérôme Pouiller Date: Wed Apr 1 13:04:05 2020 +0200 staging: wfx: remove hack about tx_rate policies Current code contains a weird hack to avoid switch from 54Mbps CTS to 1Mbps. However, we have not been able to reproduce the problem and hardware team don't know any defect of this kind. So, it seems this hack is no more necessary. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-33-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 4fb6036a1b743ad551c867e6847d2f09512467bb Author: Jérôme Pouiller Date: Wed Apr 1 13:04:04 2020 +0200 staging: wfx: fix case where AP stop with CAB traffic pending When driver has Content After DTIM Beacon (CAB) in queue, it wait for an indication from the firmware. However, when we stop to send beacons, this indication may never happen. Solve this issue by simply simulate this indication. Firmware will send data that probably nobody will heard. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-32-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a39e761aa4fefa2a8aaf549217329933b91da7c9 Author: Jérôme Pouiller Date: Wed Apr 1 13:04:03 2020 +0200 staging: wfx: fix potential deadlock in wfx_tx_flush() wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames. Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current code is more restrictive that it should. Note that wfx_tx_flush() release the lock before to return while wfx_tx_lock_flush() keep the lock. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-31-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7f573a6fb1d848121a8793756a0d3a7949ee621d Author: Jérôme Pouiller Date: Wed Apr 1 13:04:02 2020 +0200 staging: wfx: wfx_flush() did not ensure that frames are processed wfx_flush() exited once all frames are retrieved from the device. However, it did not ensure they were processed by driver before to return. Therefore, some frame may be processed after the interface has disappear. Change the place we signal that the queue is empty to fix that. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-30-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 4c6b3837c6dc0d9e5f9ec910da2e36349beea733 Author: Jérôme Pouiller Date: Wed Apr 1 13:04:01 2020 +0200 staging: wfx: repair wfx_flush() Until now, wfx_flush() flushed queue for while device instead of only the queue of the intended vif. It sometime failed with a timeout, but this error was not reported. Moreover, if the device was frozen, wfx_flush didn't do anything and it results a potential warning (and maybe a resource leak) when the frozen device was unregistered. We can also notice that wfx_tx_queues_wait_empty_vif() did only exist to work around the broken feature of wfx_flush(). This patch repair wfx_flush() and therefore drop wfx_tx_queues_wait_empty_vif(). Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-29-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7db856797f2537cb3022a655e6543b16fcad13c2 Author: Jérôme Pouiller Date: Wed Apr 1 13:04:00 2020 +0200 staging: wfx: relocate wfx_skb_dtor() prior its callers In a next commit, we would like to mark wfx_skb_dtor as static and stop to declare it in data_tx.h. Relocate wfx_skb_dtor() prior its callers to avoid compile error. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-28-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 39dbfa536b406fbe516e0ec7b571264ccf567edb Author: Jérôme Pouiller Date: Wed Apr 1 13:03:59 2020 +0200 staging: wfx: improve interface between data_tx.c and queue.c Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward the tx status to mac80211. Let's make the architecture cleaner: - merge wfx_pending_remove() into wfx_pending_get() - call wfx_skb_dtor() from data_tx.c Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-27-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit cb851c867dc07aa643f8a9a1be4092775bae7532 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:58 2020 +0200 staging: wfx: simplify usage of wfx_tx_queues_put() The queue used for wfx_tx_queue_put() can be deducted from the content of the skb. So drop this parameter from call to wfx_tx_queues_put(). In add, this change uniformizes usage of functions wfx_tx_queues_*. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-26-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit d32cedbec0a64e24548986a0159ab86cfe6a4097 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:57 2020 +0200 staging: wfx: drop struct wfx_queue_stats There is no reason to keep the intermediate struct wfx_queue_stats. Relocate its members to struct wfx_dev. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-25-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 41c5dfcdbc75e7ee75ec376e93742882ac92afca Author: Jérôme Pouiller Date: Wed Apr 1 13:03:56 2020 +0200 staging: wfx: drop now useless field edca_params Since we do not rely in QoS parameters to choose which frame to send, it is no more necessary to keep a copy of EDCA parameters. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-24-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6bf418c50f98a3ec0105d9e5b5b99a7772c47d87 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:55 2020 +0200 staging: wfx: change the way to choose frame to send The current code computes itself the QoS policy to choose which frame should be sent. However, firmware already do that job. Firmware would prefer to have packets in every queues and be able to choose itself which queue to use. So, this patch sort the queues from the emptiest to the fulliest (thanks to the pending frames counter introduced a few commits earlier). It send frame to the least full queue. However, we continue to be careful with frames that have to be sent after a dtim ("cab": Content After (DTIM) Beacon). So, this patch splits AC queues in two skb_queues: one for normal frames and another for cab frames. It cares to send frames from CAB skb_queue if appropriate. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-23-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 7ba22b075422bb761f1fc26ff6dcb05eabed6e63 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:54 2020 +0200 staging: wfx: introduce a counter of pending frames This counter will be useful to know which queue is least full in a further patch. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-22-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit b6ef154973384439c663f8c5fde0eafa51e54309 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:53 2020 +0200 staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab() It is not necessary to return a skb. Just getting the information if there is traffic to be sent after DTIM is sufficient. In add, the acronym "cab" (Content After (DTIM) Beacon) is used in mac80211 to designate this kind of traffic. So, make wfx_tx_queues_get_after_dtim() return a boolean and rename accordingly. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-21-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit bf325befc6038bf8b1a75dff53b7dd375efc4b31 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:52 2020 +0200 staging: wfx: rename wfx_tx_get_raw_link_id() Since concept of "raw_link_id" does not exist anymore, rename wfx_tx_get_raw_link_id() in wfx_tx_get_link_id(). Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9f84c196f563e913f311febc28d7f25ce61a5122 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:51 2020 +0200 staging: wfx: drop unused raw_link_id field raw_link_id can be retrieved by wfx_tx_get_raw_link_id(). So, it is not necessary to keep it in struct wfx_tx_priv. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f4a4fe570b8a36bcb2172fcf229284cd818a3240 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:50 2020 +0200 staging: wfx: drop unused link_id field It is not used anymore. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9251ad667d742ccc1430457266ee7206521668fc Author: Jérôme Pouiller Date: Wed Apr 1 13:03:49 2020 +0200 staging: wfx: do not rely anymore on link_id to choose packet in queue link_id was expected to contain identifier of a station. It was also used to mark frames that has to sent after dtim. We do not use the further purpose. For the last purpose, we can directly check the flag value in tx_info. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 9e76ba774445f87f4374244c791758e853f7e1e1 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:48 2020 +0200 staging: wfx: drop useless link_map_cache Driver does not use link_map_cache anymore. So we can drop it. In add, we do not have to keep this counter in sync with skb_queue item, so we can drop explicit spin_locks. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 6c262beb41e6d3bd93f0b055c0b20ebda7dfed51 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:47 2020 +0200 staging: wfx: do not use link_map_cache to track CAB Since we do not track power save status of the stations anymore, link_map_cache is now only used to track "Content After (DTIM) Beacon". We prefer to rely on flags from tx_info. So we will be able to drop link_map_cache. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit af72697196dcb9d23484ae32ea096955f715c1d1 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:46 2020 +0200 staging: wfx: drop argument tx_allowed_mask since it is constant now Following the remove of asleep_mask, the tx_allowed_mask argument passed to various functions is now always the same. Drop this argument and simplify the code. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 062a6c410258ca2e66f377e54ee229c937504e22 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:45 2020 +0200 staging: wfx: drop useless sta_asleep_mask Currently, the driver tracks power save state of the stations with the variable sta_asleep_mask. Then, it takes care to not sent data to asleep stations. However, this work is already done by mac80211. Normally, there are no frames for asleep stations in our queues. So, driver do not have to filter frames in its queues (apart the frames marked "AFTER_DTIM"). Notice that there is a risk of race between state of the station and data send to the firmware. However, this risk is limited since the number of frame in queues are small. In add, this race also exists with the current code. Anyway, the firmware is able to detect the problem and driver will receive a 'REQUEUE' status (translated in TX_STAT_TX_FILTERED for mac80211). Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 517b358fddd737e81a3e0762d0893722871fafe9 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:44 2020 +0200 staging: wfx: simplify wfx_tx_queue_mask_get() It is far simpler to return a pointer instead of an error. Thus, it is no more necessary to pass a pointer reference as argument. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit abaef5374e53be81ca46ef76d9c03e103b49da51 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:43 2020 +0200 staging: wfx: drop unused argument in wfx_get_prio_queue() The argument "total" is not used anymore since commit a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM"). Fixes: a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM") Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f42483f9efefd9ea0ea4eb054cd1e1923626e414 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:42 2020 +0200 staging: wfx: simplify wfx_tx_queues_empty() Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the spin_lock before to check if the queue is empty. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit f5d331ee86a9906ab732d1391e6bebad53624d4e Author: Jérôme Pouiller Date: Wed Apr 1 13:03:41 2020 +0200 staging: wfx: simplify hif_handle_tx_data() The last argument of hif_handle_tx_data() was now unused. In add, hif_handle_tx_data() has nothing to do with HIF layer and should be renamed. Finally, it not convenient to pass a wfx_vif as parameter. It is easier to let hif_handle_tx_data() find the interface itself. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 566059cc5fe4d8b49e5f09efe468c046bdd9596d Author: Jérôme Pouiller Date: Wed Apr 1 13:03:40 2020 +0200 staging: wfx: avoid useless wake_up __wfx_flush() wait for all queues to be empty. In current code, wait_link_id_empty is wake up each time there is no more data for a station. We can simplify the processing and avoid some wake-up by raising this event only when the queue is empty. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 70b727314f90765c9267e1e1882b5b01fba5201b Author: Jérôme Pouiller Date: Wed Apr 1 13:03:39 2020 +0200 staging: wfx: drop useless queue_id field The field queue_id is no more used. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 365fdf7e3e77e23cd145161219e3b25a839855c0 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:38 2020 +0200 staging: wfx: uniformize queue_id retrieval tx_info->hw_queue contains "vif.hw_queue[skb_get_queue_mapping(skb)]". For now, it is equivalent of "skb_get_queue_mapping(skb)". However, it is not the same semantic. In wfx_tx_inner(), we want to get the mac80211 queue index, not the hardware queue index. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 57c5222004d39e8d914d7b6190593f31e3554892 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:37 2020 +0200 staging: wfx: remove "burst" mechanism In the old days, the driver tried to reorder frames in order to send frames from the same queue grouped to the firmware. However, the firmware is able to do the job internally for a long time. There is no reasons to keep this mechanism. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit 055d20cf72fe90f5b3141e2d88b98f15e4e190c5 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:36 2020 +0200 staging: wfx: take advantage of ieee80211_{stop/start}_queues Instead of maintaining stop status for each queue, we can just maintain a global status for all queues. In add, wfx_tx_queues_{lock/unlock} are only used when no more tx_policies are available. Therefore, the counter of recursive locks ("tx_locked_cnt") is useless. So, wfx_tx_queues_{lock/unlock} can be replaced by ieee80211_{stop/start}_queues. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit af9d2f79dcb52e336dcb7edabf6c64b8d74412c3 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:35 2020 +0200 staging: wfx: do not stop mac80211 queueing during tx_policy upload When a new tx_policy has to be uploaded, it is necessary to avoid any race between the frame and the policy. So, the driver stops the tx queue during tx_policy upload. However, it is not necessary to stop mac80211 queuing. Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a6bdff3f627bbb116c63f4b8464345af84d68ce8 Author: Jérôme Pouiller Date: Wed Apr 1 13:03:34 2020 +0200 staging: wfx: add sanity checks to hif_join() Add a few check on start of hif_join(). Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman commit a920f3be5268732d0dada10667f7a8356e71b5b4 Author: Soumyajit Deb Date: Mon Apr 6 16:47:06 2020 +0530 staging: rtl8188eu: Line over 80 characters Break various lines into multiple lines to respect 80 character width limit. Reported by checkpatch.pl Signed-off-by: Soumyajit Deb Link: https://lore.kernel.org/r/20200406111706.25957-4-debsoumyajit100@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1003537f08528e92a27e13f83aa61f9f484bc439 Author: Soumyajit Deb Date: Mon Apr 6 16:47:05 2020 +0530 staging: rtl8188eu: Remove unnecessary extra parentheses Remove unnecessary extra parentheses to improve code readability. Signed-off-by: Soumyajit Deb Link: https://lore.kernel.org/r/20200406111706.25957-3-debsoumyajit100@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8c8fbdb27280c6001060cff7017fb68f13855cb1 Author: Soumyajit Deb Date: Mon Apr 6 16:47:04 2020 +0530 staging: rtl8188eu: Properly structure the multiline comment Add "*" at the start of each line of the multiline comment to improve code readability and to adhere to the uniform Kernel coding style. Reported by checkpatch.pl Signed-off-by: Soumyajit Deb Link: https://lore.kernel.org/r/20200406111706.25957-2-debsoumyajit100@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8d36c8d83509b47b067792d88e703215ca0b367b Author: Michael Straube Date: Sun Apr 5 13:22:30 2020 +0200 staging: rtl8188eu: remove unnecessary variable The variable 'bStopBlinking' is used in if tests immediately after its value is set. Use the conditions for setting 'bStopBlinking' diretly in the subsequent if tests and remove the variable. Slightly reduces object file size by 16 bytes (gcc 9.2.1 x86_64). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200405112230.31975-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d90027bdde125665dd3e8f0bc3d15e901e5faf0 Author: Michael Straube Date: Sun Apr 5 13:22:29 2020 +0200 staging: rtl8188eu: remove unnecessary asignment Remove unnecessary asignment in SwLedBlink1(). The code path with the asignment 'pLed->BlinkTimes = 0' is only executed when 'pLed->BlinkTimes' is already zero and the value is not changed between the test 'if (pLed->BlinkTimes == 0)' and the asignment. Signed-off-by: Michael Straube Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20200405112230.31975-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c5a906e391d9acc8e9c354e8f782752bb6985953 Author: R Veera Kumar Date: Sun Apr 5 23:27:22 2020 +0530 staging: unisys: visorhba: Correct a typo in comment Correct a typo in comment. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar Link: https://lore.kernel.org/r/20200405175722.8188-1-vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit 3c9d0b5e8155d6283414c4fbe8fc3ee997280038 Author: R Veera Kumar Date: Sun Apr 5 23:12:47 2020 +0530 staging: rtl8192e: rtl8192e: Correct misspelt variable name Correct misspelt variable name. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar Link: https://lore.kernel.org/r/20200405174247.7868-1-vkor@vkten.in Signed-off-by: Greg Kroah-Hartman commit 84d041ffc98f9a2411b68480f0492f9928d72cfa Author: Colin Ian King Date: Sun Apr 5 14:06:19 2020 +0100 staging: gdm724x: remove redundant assignment to pointer 'w' The pointer 'w' is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200405130619.377043-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman commit af93096eef047dab93698e56c4a971624a1263d7 Author: Briana Oursler Date: Fri Apr 3 10:18:05 2020 -0700 Staging: vt6655: Replace camel case variable names. Replace camel case variable names with snake case in baseband.h and its dependencies. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/20200403171805.466600-1-briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3ea1cb241df9cf345ac2f3732b287a77beccd916 Author: Stefan Wahren Date: Sun Mar 29 14:45:01 2020 +0200 staging: bcm2835-camera: reduce indentation in ctrl_set_image_effect We can reduce the indentation in the loop by using continue in case the effect doesn't match. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-10-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit a60f0c8b563a05c896f04007594963875815419b Author: Stefan Wahren Date: Sun Mar 29 14:45:00 2020 +0200 staging: bcm2835-camera: reduce multiline statements There are a lot of multiline statements which can be reduced. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-9-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit f23e128aa814c3d2fecdc55e2b2550047c110561 Author: Stefan Wahren Date: Sun Mar 29 14:44:59 2020 +0200 staging: bcm2835-camera: return early in mmal_setup_components We can reduce the indentation in mmal_setup_components further by returning early in error case. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-8-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit 1a59532382a6c7301bc71c4bb56efab87745aaff Author: Stefan Wahren Date: Sun Mar 29 14:44:58 2020 +0200 staging: bcm2835-camera: Move video component setup in its own function The function mmal_setup_components has to many indention levels. So move the setup code for video component in its own function. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-7-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit 3c0b37483b824f6aa55236452b4e24fa92e7fe44 Author: Stefan Wahren Date: Sun Mar 29 14:44:57 2020 +0200 staging: bcm2835-camera: Move encode component setup in its own function The function mmal_setup_components has to many indention levels. So move the setup code for encode component in its own function. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-6-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit 576b4ff899228db32677afd6e5892ace38a4955b Author: Stefan Wahren Date: Sun Mar 29 14:44:56 2020 +0200 staging: bcm2835-camera: Simplify set_framerate_params This simplifies set_framerate_params and avoids the multiple assignment in one line by moving the fps_high handling out of the if statement. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-5-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit a9939ce41b44dc2dc8171bf24ab21d33d6206c31 Author: Stefan Wahren Date: Sun Mar 29 14:44:55 2020 +0200 staging: bcm2835-camera: Make struct indentation consistent The indentation of struct members wasn't consistent over the whole driver. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-4-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit 93a8883f5e4b96997f7221aca66cb45fbff9b379 Author: Stefan Wahren Date: Sun Mar 29 14:44:54 2020 +0200 staging: bcm2835-camera: Activate V4L2_EXPOSURE_METERING_MATRIX handling I don't see any reason to keep this TODO, so activate the V4L2_EXPOSURE_METERING_MATRIX handling. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-3-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit e7a57270e53dedcf860c266a0829c7b1a1943a45 Author: Stefan Wahren Date: Sun Mar 29 14:44:53 2020 +0200 staging: bcm2835-camera: Drop PREVIEW_LAYER This define is used only once. So drop the define and init the layer directly. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1585485901-10172-2-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman commit e21b8f2789eb21a9d5a2c66510632eb8923d9f72 Author: John B. Wyatt IV Date: Wed Apr 1 19:33:10 2020 -0700 staging: fsl-dpaa2: ethsw: Fix parenthesis alignment Fix 2 parenthesis alignment issues. Reported by checkpatch. Signed-off-by: John B. Wyatt IV Link: https://lore.kernel.org/r/20200402023310.816245-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman commit 955a50846f11f596dedfc9b912134388635c6867 Author: John B. Wyatt IV Date: Wed Apr 1 18:50:08 2020 -0700 staging: axis-fifo: Fix parenthesis alignment Fix 2 parenthesis alignment issues. Reported by checkpatch. Signed-off-by: John B. Wyatt IV Link: https://lore.kernel.org/r/20200402015008.728612-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman commit 269da10b1477c31c660288633c8d613e421b131f Author: Aiman Najjar Date: Sun Mar 29 14:57:47 2020 -0400 staging: rtl8712: fix multiline derefernce warnings This patch fixes remaining checkpatch warnings in rtl871x_xmit.c: WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->PrivacyKeyIndex' 636: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:636: + (u8)psecuritypriv-> + PrivacyKeyIndex); WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->XGrpKeyid' 643: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:643: + (u8)psecuritypriv-> + XGrpKeyid); WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->XGrpKeyid' 652: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:652: + (u8)psecuritypriv-> + XGrpKeyid); Signed-off-by: Aiman Najjar Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/98805a72b92e9bbf933e05b827d27944663b7bc1.1585508171.git.aiman.najjar@hurranet.com Signed-off-by: Greg Kroah-Hartman commit 2aaeaaff1ae21b2817256435c7fc0095eeda61ae Author: Aiman Najjar Date: Sun Mar 29 14:57:46 2020 -0400 staging: rtl8712: code improvements to make_wlanhdr 1. Refactor make_wlanhdr to improve code style. 2. Use ether_addr_copy instead of memcpy to copy addresses. Suggested-by: Joe Perches Signed-off-by: Aiman Najjar Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/275773a0379e4a03839cd832d2ed952fd7bfee48.1585508171.git.aiman.najjar@hurranet.com Signed-off-by: Greg Kroah-Hartman commit f476c5901fc5b6c1e7ff85975593eae3616bdd1c Author: Aiman Najjar Date: Sun Mar 29 14:57:45 2020 -0400 staging: rtl8712: fix checkpatch warnings This patch fixes multiline dereference warnings in rtl871x_xmit.c: WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->XGrptxmickey' 379: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:379: + psecuritypriv-> + XGrptxmickey[psecuritypriv-> WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->XGrpKeyid' 380: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:380: + XGrptxmickey[psecuritypriv-> + XGrpKeyid].skey); Signed-off-by: Aiman Najjar Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/ddd296c34c5b0206dfe5cf2e6cbe40e0a118c257.1585508171.git.aiman.najjar@hurranet.com Signed-off-by: Greg Kroah-Hartman commit 45afa5637b85d73cf5eabb1500fe57f55ed70e1f Author: Aiman Najjar Date: Sun Mar 29 14:57:44 2020 -0400 staging: rtl8712: fix long-line checkpatch warning This patch fixes the following warning in rtl871x_xmit.c: WARNING: line over 80 characters 130: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:130: + pxmitbuf->pallocated_buf = kmalloc(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ, Signed-off-by: Aiman Najjar Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/de477e0d8f352c1d6cd75d64d84ac6f9017db254.1585508171.git.aiman.najjar@hurranet.com Signed-off-by: Greg Kroah-Hartman commit d7e6ede6acd4fb1930112d8e882ae3273436985b Author: Aiman Najjar Date: Sun Mar 29 14:57:43 2020 -0400 staging: rtl8712: fix checkpatch long-line warning This patch fixes these two long-line checkpatch warnings in rtl871x_xmit.c: WARNING: line over 80 characters \#74: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:74: + * Please allocate memory with the sz = (struct xmit_frame) * NR_XMITFRAME, WARNING: line over 80 characters \#79: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:79: + kmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4, GFP_ATOMIC); Signed-off-by: Aiman Najjar Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/acd523d0d24cc81fae9eb933a066d87815587cee.1585508171.git.aiman.najjar@hurranet.com Signed-off-by: Greg Kroah-Hartman commit 48327b9a7ae37e6d20bb91642c0baa35babb661f Author: Gokce Kuler Date: Sat Mar 28 23:15:13 2020 +0300 staging: sm750fb: line over 80 characters Convert a single line comment to a multiline comment to respect the 80 character rule.Problem found using checkpatch. Signed-off-by: Gokce Kuler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/20200328201513.GA16863@siyah2 Signed-off-by: Greg Kroah-Hartman commit 37c2513eadd418c91422bb8224f097ae9daa7e06 Author: John B. Wyatt IV Date: Sun Mar 29 01:00:31 2020 -0700 staging: comedi: Fix line ending with a ( Fix style issue with declaration by adopting the same style as the function defintion in drivers/staging/comedi/comedi_buf.c. Issue reported by checkpatch. Signed-off-by: John B. Wyatt IV Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/20200329080031.511959-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman commit 18bcd8a08ba8d5005b4bde0d77ce5c333f2b1127 Author: Michael Straube Date: Sun Mar 29 12:04:50 2020 +0200 staging: rtl8188eu: refactor Efuse_GetCurrentSize() Refactor while loop in Efuse_GetCurrentSize() to reduce indentation level and clear line over 80 characters checkpatch warnings. Signed-off-by: Michael Straube Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20200329100450.10126-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ab966667bde12ed999082c68977e0f2979336923 Author: Michael Straube Date: Fri Mar 27 19:53:11 2020 +0100 staging: rtl8188eu: remove unnecessary parentheses Remove all remaining unnecessary parentheses reported by checkpatch. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20200327185311.16129-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c39ec313389d11d8ef654c8c66a8bcc4f70db4b Author: John B. Wyatt IV Date: Thu Apr 2 21:24:48 2020 -0700 staging: android: ion: Align with parenthesis Align two different lines of arguments with the parenthesis of their respected function definitions. Fix style warnings of matching alignment. Reported by checkpatch. Signed-off-by: John B. Wyatt IV Link: https://lore.kernel.org/r/20200403042448.863689-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman commit 55126bb37d9d35ce8220bfb32c43938e44f77a57 Author: Malcolm Priestley Date: Thu Apr 2 22:42:17 2020 +0100 staging: vt6656: set all cck rates to default. mac80211 rate control decides which cck rates to use so all of them should be set enabled at the appropriate bit rate. This means vnt_get_cck_rate is no longer required. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/dec847da-5bad-1920-f275-741f7f704fb3@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1b3409b574c0b6214219670883e1a5f458594f27 Author: Malcolm Priestley Date: Thu Apr 2 22:41:34 2020 +0100 staging: vt6656: set all ofdm rates to default mac80211 rate control decides which odfm rates to use so all of them should be set enabled at the appropriate bit rate. This means vnt_get_ofdm_rate is no longer required. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/9a52d7f4-dd3e-efdc-eef8-bb794f7dea6d@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5035fc5915461fd979a78f0118d6040323f49c76 Author: Malcolm Priestley Date: Thu Apr 2 21:45:21 2020 +0100 staging: vt6656: replace al2230_power_table array with formula. The power table can replaced with calculation 0x0404090 | (power << 12) removing array and length macro. variable power never goes beyond the maximum setting. Signed-off-by: Malcolm Priestley Link: https://lore.kernel.org/r/e277409a-4509-d09c-515d-59b952f8310d@gmail.com Signed-off-by: Greg Kroah-Hartman commit d12d96ff66b7a131afc78c217382bdd9ca488ad2 Author: Oscar Carter Date: Thu Apr 2 19:01:03 2020 +0200 staging: vt6656: Define EnCFG_BBType_MASK as OR between previous defines Define the EnCFG_BBType_MASK bit as an OR operation between two previous defines instead of using the OR between two new BIT macros. Thus, the code is more clear. Signed-off-by: Oscar Carter Reviewed-by: Dan Carpenter Reviewed-by: Quentin Deslandes Link: https://lore.kernel.org/r/20200402170103.22520-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit afa2e976b152ae27a6c8d1d7e4b81b39354acd6d Author: John B. Wyatt IV Date: Mon Mar 30 16:39:00 2020 -0700 staging: vt6656: add error code handling to unused variable Add error code handling to unused 'ret' variable that was never used. Return an error code from functions called within vnt_radio_power_on. Issue reported by coccinelle (coccicheck). Suggested-by: Quentin Deslandes Suggested-by: Stefano Brivio Reviewed-by: Quentin Deslandes Signed-off-by: John B. Wyatt IV Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/20200330233900.36938-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman commit 69a809e1569312b8a92a8cafee21b7cd01eddbbd Author: Oscar Carter Date: Sat Mar 28 19:17:06 2020 +0100 staging: vt6656: Refactor the vnt_update_pre_ed_threshold function Create three arrays with the threshold data use in the switch statement of the vnt_update_pre_ed_threshold function. These three arrays contains elements of struct vnt_threshold new type. Create a for loop in the vnt_update_pre_ed_threshold function to do exactly the same that the if-elseif-else statements in the switch statement. Also, remove the if check against the !cr_201 && !cr_206 due to now it is replace by the NULL check against the threshold pointer. When this pointer is NULL means that the cr_201 and cr_206 variables have not been assigned, that is the same that the old comparison against cr_201 and cr_206 due to these variables were initialized with 0. The statistics of the old baseband object file are: section size addr .text 3415 0 .data 576 0 .bss 0 0 .rodata 120 0 .comment 45 0 .note.GNU-stack 0 0 .note.gnu.property 28 0 Total 4184 The statistics of the new baseband object file are: section size addr .text 2209 0 .data 576 0 .bss 0 0 .rodata 344 0 .comment 45 0 .note.GNU-stack 0 0 .note.gnu.property 28 0 Total 3202 With this refactoring it increase a little the readonly data but it decrease much more the .text section. This refactoring decrease the footprint and makes the code more clear. Signed-off-by: Oscar Carter Reviewed-by: Quentin Deslandes Link: https://lore.kernel.org/r/20200328181706.14276-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 3b643f431162469009f38998a4d328d62496cecf Author: Oscar Carter Date: Sat Mar 28 15:17:38 2020 +0100 staging: vt6656: Use defines in preamble_type variables Use the PREAMBLE_SHORT and PREAMBLE_LONG defines present in the file "baseband.h" to assign values to preamble_type variables. Also, use the same defines to make comparisons against these variables. In this way, avoid the use of numerical literals or boolean values and make the code more clear. Signed-off-by: Oscar Carter Reviewed-by: Quentin Deslandes Link: https://lore.kernel.org/r/20200328141738.23810-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman commit 3d7b79f2ee473daa547722b5a14d4028ef68d097 Author: Briana Oursler Date: Wed Apr 1 22:14:36 2020 -0700 Staging: vt6655: Remove BBvExitDeepSleep definition. Remove function BBvExitDeepSleep that is never called. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/027b00a27e2bef13c1daab3514dc7dc19fa1aa00.1585802818.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3d1f39e96212246855121c6b53b96c7dc7b67613 Author: Briana Oursler Date: Wed Apr 1 22:14:35 2020 -0700 Staging: vt6655: Remove CARDbRadioPowerOn definition. Remove function CARDbRadioPowerOn that is never called, along with comments related to it. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/e64c02aadd0b846604c755989b39f374161a87e0.1585802818.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5ec64e91d381b1cbafbd46afad2b5e70d36f1079 Author: Briana Oursler Date: Wed Apr 1 22:14:34 2020 -0700 Staging: vt6655: Remove CARDvSetLoopbackMode definition. Remove function CARDvSetLoopbackMode that is never called, along with comments related to it. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/b81f06ebc0179fbceb43c085411b372ff909b134.1585802818.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1ad93e3166b7b2755f550c33c278722e87d5c1aa Author: Briana Oursler Date: Wed Apr 1 22:14:33 2020 -0700 Staging: vt6655: Remove CARDbSoftwareReset definition. Remove function CARDbSoftwareReset that is never called, along with comments related to it. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/8ec491439b947c959fab52e006d9ca26ec3657ab.1585802818.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2f7ccc387cf3b2e896dadbe5252502baf56473a4 Author: Briana Oursler Date: Wed Apr 1 11:03:42 2020 -0700 Staging: vt6655: Format long lines. Add whitespace around '-' operator and wrap long lines. Issue found by checkpatch.pl. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/e1c9fc822f1576f9896799fea6c467457cf0f6da.1585763457.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit b03ee7b2b8861ec1a41325d177ac28af4e13c9d9 Author: Briana Oursler Date: Wed Apr 1 11:03:41 2020 -0700 Staging: vt6655: Eliminate nested if else Eliminate nested if else statement, reduce code duplication, and shorten long lines by creating a new variable, len, to determine function input needed for s_uGetTxRsvTime. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/301ff66e13e76be6416b5c0f8359249fa25f08e3.1585763457.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit e781fd1b33010bcec66607c16fb38710267081ce Author: Briana Oursler Date: Wed Apr 1 11:03:40 2020 -0700 Staging: vt6655: Move rate determination logic. Factor rate setting logic out of nested if-else statement to prevent code duplication. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/ba87af8a2d28d5737c6d8888bbda143aad723d2c.1585763457.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5b0578364fb875366de08686593f9fc6ce2ce564 Author: Briana Oursler Date: Wed Apr 1 11:03:39 2020 -0700 Staging: vt6655: Limit return statements. Limit return statements within context of switch case to improve readability. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/fe417533b66d29ef6ea19128b38b8c8de7757ae2.1585763457.git.briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6f5ec72252d1d40a7e23976eb1b3c7bb9073e433 Author: Briana Oursler Date: Sat Mar 28 13:03:31 2020 -0700 Staging: vt6655: Remove BBvCalculateParameter comment. Remove comment that refers to function that no longer exists. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/20200328200331.136265-1-briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 81a13643f81281b88ea0647368d4f78281246307 Author: Briana Oursler Date: Fri Mar 27 12:27:00 2020 -0700 staging: vt6655: Remove multiple assignments. Remove multiple assignments at initialization and in computations to better match Linux style. Issue found by checkpatch.pl. Signed-off-by: Briana Oursler Reviewed-by: Stefano Brivio Link: https://lore.kernel.org/r/20200327192700.12289-1-briana.oursler@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9bb086e5ba9495ac150fbbcc5c8c2bccc06261dd Author: Chen Zhou Date: Wed Apr 1 11:00:17 2020 +0800 staging: greybus: fix a missing-check bug in gb_lights_light_config() In gb_lights_light_config(), 'light->name' is allocated by kstrndup(). It returns NULL when fails, add check for it. Signed-off-by: Chen Zhou Acked-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20200401030017.100274-1-chenzhou10@huawei.com Signed-off-by: Greg Kroah-Hartman commit c42f736332a43e7cec61f582909036b5addc707a Author: Dan Jessie Date: Sat Mar 28 18:21:35 2020 -0400 staging: greybus: hid: remove braces {} around single statement block This patch fixes the checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks This is the only instance of the problem noted by checkpatch.pl in staging: greybus. Signed-off-by: Dan Jessie Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20200328222134.19344-1-dtjessie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 14d0066b8477775971db7d0ef03c86fefe4d5bf2 Author: John Stultz Date: Thu Apr 9 00:43:06 2020 +0000 drm: kirin: Revert change to add register connect helper functions Daniel noted[1] that commit d606dc9a6323 ("drm: kirin: Add register connect helper functions in drm init") was unnecessary and incorrect, as drm_dev_register does register connectors for us. Thus, this patch reverts the change as suggested by Daniel. [1]: https://lore.kernel.org/lkml/CAKMK7uHr5U-pPsxdQ4MpfK5v8iLjphDFug_3VTiUAf06nhS=yQ@mail.gmail.com/ Cc: Xu YiPing Cc: Rongrong Zou Cc: Xinliang Liu Cc: Xinwei Kong Cc: Chen Feng Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Cc: dri-devel Signed-off-by: John Stultz Reviewed-by: Daniel Vetter Acked-by: Xinliang Liu Signed-off-by: Xinliang Liu Link: https://patchwork.freedesktop.org/patch/msgid/20200409004306.18541-1-john.stultz@linaro.org commit 378788120bed12cfafc17e0348710c145f598644 Author: Andreas Färber Date: Sun Nov 24 13:40:20 2019 +0100 dt-bindings: reset: rtd1295: Add SB2 reset Add a constant for reset3 SB2, based on downstream crt_sys_reg.h. Acked-by: Rob Herring Acked-by: James Tai Signed-off-by: Andreas Färber commit e624119013bf4f10df233d2534c91eab9642911d Author: Andreas Färber Date: Mon Nov 25 07:45:43 2019 +0100 arm64: dts: realtek: rtd16xx: Add SB2 and SCPU Wrapper syscon nodes Add syscon mfd nodes for SB2 and SCPU Wrapper to RTD16xx DT. Acked-by: James Tai Signed-off-by: Andreas Färber commit dd473726dc799a1a62d687fb2a6aa5c55815f061 Author: Andreas Färber Date: Mon Nov 25 07:42:57 2019 +0100 arm64: dts: realtek: rtd139x: Add SB2 and SCPU Wrapper syscon nodes Add syscon mfd nodes for SB2 and SCPU Wrapper to RTD139x DT. Acked-by: James Tai Signed-off-by: Andreas Färber commit 6de1aced8bd6e2f8b75da7533299a281fbb1783c Author: Andreas Färber Date: Mon Nov 25 07:40:34 2019 +0100 arm64: dts: realtek: rtd129x: Add SB2 and SCPU Wrapper syscon nodes Add syscon mfd nodes for SB2 and SCPU Wrapper to RTD129x DT. Acked-by: James Tai Signed-off-by: Andreas Färber commit fcf8628246522b8bc23f5669016d25402091593c Author: Andreas Färber Date: Mon Nov 25 07:37:36 2019 +0100 ARM: dts: rtd1195: Add SB2 and SCPU Wrapper syscon nodes Add syscon mfd nodes for SB2 and SCPU Wrapper to RTD1195 DT. Acked-by: James Tai Signed-off-by: Andreas Färber commit 4b1b26deeb58b2d16eb7b2f8f5ce25345761f6da Author: Andreas Färber Date: Sun Nov 24 02:29:27 2019 +0100 arm64: dts: realtek: rtd16xx: Add CRT syscon node Prepare a CRT syscon mfd node. Acked-by: James Tai Signed-off-by: Andreas Färber commit a4516dc56ea88331ccb9672193c8dac81f47b061 Author: Andreas Färber Date: Wed Oct 23 11:21:45 2019 +0200 ARM: dts: rtd1195: Add UART resets Associate the UART nodes with the corresponding reset controller bits. Acked-by: James Tai Signed-off-by: Andreas Färber commit 6f7f0d95380fa36b1102f3f8b8dc4e0f9a9af51f Author: Andreas Färber Date: Mon Oct 21 04:30:14 2019 +0200 ARM: dts: rtd1195: Add reset nodes Add reset controller nodes for Realtek RTD1195 SoC. Acked-by: James Tai Signed-off-by: Andreas Färber commit 63313c1ceb94f337d2ba6133f5e2e96f4bb14c14 Author: Andreas Färber Date: Mon Oct 9 03:56:45 2017 +0200 dt-bindings: reset: Add Realtek RTD1195 Add a header with symbolic reset indices for Realtek RTD1195 SoC. Naming was derived from BSP register description headers. Acked-by: Philipp Zabel Reviewed-by: Rob Herring Acked-by: James Tai Signed-off-by: Andreas Färber commit aff13f7cc8697ca95ca111845e07be5245659726 Author: Andreas Färber Date: Sat Nov 23 23:14:05 2019 +0100 ARM: dts: rtd1195: Add CRT syscon node Prepare a CRT syscon mfd node. Acked-by: James Tai Signed-off-by: Andreas Färber commit cc022ebcaf747fdff15a6e25e1e164d4069cd37c Author: Andreas Färber Date: Tue Nov 26 07:11:18 2019 +0100 arm64: dts: realtek: rtd16xx: Introduce iso and misc syscon Group UART0 into an Isolation syscon mfd node. Group UART1 and UART2 into a Miscellaneous syscon mfd node. Acked-by: James Tai Signed-off-by: Andreas Färber commit a5360a35772f4a621afc2c9b19eb99950a3e207b Author: Andreas Färber Date: Sun Nov 24 02:23:09 2019 +0100 arm64: dts: realtek: rtd139x: Introduce CRT, iso and misc syscon Group the non-iso reset controller nodes into a CRT syscon mfd node. Group reset controller, watchdog and UART0 into an Isolation mfd node. Group UART1 and UART2 into a Miscellaneous syscon mfd node. Acked-by: James Tai Signed-off-by: Andreas Färber commit 9e7c2a1caf2517f8c8594aceaeba6e40c7906ab4 Author: Andreas Färber Date: Sun Nov 24 02:06:25 2019 +0100 arm64: dts: realtek: rtd129x: Introduce CRT, iso and misc syscon Group the non-iso reset controller nodes in a CRT syscon mfd node. Group reset controller, watchdog and UART0 in an Isolation syscon mfd node. Group UART1 and UART2 into a Miscellaneous syscon mfd node. Acked-by: James Tai Signed-off-by: Andreas Färber commit c5021279aa71f188780741afb9b50206918d7df9 Author: Andreas Färber Date: Tue Nov 26 06:43:44 2019 +0100 ARM: dts: rtd1195: Introduce iso and misc syscon Group watchdog and UART0 into an Isolation syscon mfd node. Group UART1 into a Miscellaneous syscon mfd node. Cc: James Tai Signed-off-by: Andreas Färber commit e557f4b0ba860aa1d449ad543484a2306393d919 Author: Andreas Färber Date: Sun Dec 8 15:54:36 2019 +0100 arm64: dts: realtek: rtd1295: Add Xnano X5 The Xnano X5 is an OTT TV Box. Signed-off-by: Andreas Färber commit b5912cac6eac2a59cc3809371fe0d8ff3213ad7e Author: Andreas Färber Date: Mon Dec 9 23:35:41 2019 +0100 dt-bindings: arm: realtek: Add Xnano X5 Define a compatible string for Xnano X5 OTT TV Box. Acked-by: Rob Herring Signed-off-by: Andreas Färber commit 7c620476a6237861fca0116ab32dfed3aca1198f Author: Andreas Färber Date: Fri Dec 6 14:30:56 2019 +0100 dt-bindings: vendor-prefixes: Add Xnano Xnano is a Chinese TV box brand, but not much more is publicly known. Acked-by: Rob Herring Signed-off-by: Andreas Färber commit 0d874aad940d60e2763fa95a1d5cb352d5b60b7f Author: Andreas Färber Date: Sat Nov 23 01:54:02 2019 +0100 arm64: dts: realtek: rtd16xx: Add memory reservations Reserve memory regions for RPC and TEE. Fixes: d8a6c3b34276 ("arm64: dts: realtek: Add RTD1619 SoC and Realtek Mjolnir EVB") Acked-by: James Tai Signed-off-by: Andreas Färber commit 44955042b512bd1ae748cc33bb45ecfe29c97967 Author: Andreas Färber Date: Sat Nov 30 20:00:58 2019 +0100 arm64: dts: realtek: rtd16xx: Carve out boot ROM from memory Update Mjolnir /memory node to exclude 0..0x2dfff from reg entry. Add this region to /soc ranges instead. Fixes: d8a6c3b34276 ("arm64: dts: realtek: Add RTD1619 SoC and Realtek Mjolnir EVB") Suggested-by: Rob Herring Cc: James Tai Signed-off-by: Andreas Färber commit d8a6c3b3427618dc7441ec9eb180405ec30f3413 Author: James Tai Date: Tue Nov 12 15:45:22 2019 +0000 arm64: dts: realtek: Add RTD1619 SoC and Realtek Mjolnir EVB Add Device Trees for Realtek RTD1619 SoC family, RTD1619 SoC and Realtek Mjolnir EVB. Signed-off-by: James Tai [AF: Renamed r-bus node, modified UART comments, style cleanups] Signed-off-by: Andreas Färber commit 8dcb8b063601ccfdf8a64a5f1c8cc299e6e9f959 Author: James Tai Date: Fri Nov 8 09:42:59 2019 +0000 dt-bindings: arm: realtek: Document RTD1619 and Realtek Mjolnir EVB Define compatible strings for Realtek RTD1619 SoC and Realtek Mjolnir EVB. Signed-off-by: James Tai Reviewed-by: Rob Herring Signed-off-by: Andreas Färber commit 50a87ad8cd6aa963211c8f526dce1fa9ab0a9288 Author: Andreas Färber Date: Tue Nov 26 04:21:53 2019 +0100 arm64: dts: realtek: rtd1395: Add Realtek Lion Skin EVB Add a Device Tree for Realtek RTD1395 SoC Lion Skin evaluation board. Signed-off-by: Andreas Färber commit 158caa2e14edc136504a4b54ff2a03d1a10e3883 Author: Andreas Färber Date: Sun Nov 10 10:15:43 2019 +0100 dt-bindings: arm: realtek: Add Realtek Lion Skin EVB Define a compatible string for Realtek RTD1395 Lion Skin eval board. Acked-by: Rob Herring Signed-off-by: Andreas Färber commit 769c00a2f10b4f43fe764077a48d9a594010686b Author: Andreas Färber Date: Thu Nov 7 07:34:22 2019 +0100 arm64: dts: realtek: Add RTD1395 and BPi-M4 Add Device Trees for Realtek RTD1395 SoC and Banana Pi BPi-M4 SBC. For now reuse RTD1295 reset constants. Signed-off-by: Andreas Färber commit 843603bbcdff552554d0777ccf4ae0420bab3c68 Author: Andreas Färber Date: Sun Nov 10 09:53:02 2019 +0100 dt-bindings: arm: realtek: Add RTD1395 and Banana Pi BPI-M4 Define compatible strings for Realtek RTD1395 SoC and BPI-M4 SBC. Reviewed-by: Rob Herring Signed-off-by: Andreas Färber commit 3040e132beda2aee56e6ea9be8db69889bcb2e7a Author: Andreas Färber Date: Sat Nov 30 19:20:53 2019 +0100 arm64: dts: realtek: rtd129x: Carve out boot ROM from memory Update DS418j, MeLE V9, PROBOX2 AVA, Zidoo X9S and DS418 /memory nodes to exclude 0..0x1efff from reg entry and update unit address to match. Add this region to /soc ranges and for now just update the /memreserve/s. Suggested-by: Rob Herring Fixes: 72a7786c0a0d ("ARM64: dts: Add Realtek RTD1295 and Zidoo X9S") Fixes: d938a964a966 ("arm64: dts: realtek: Add ProBox2 Ava") Fixes: a9ce6f854581 ("arm64: dts: realtek: Add MeLE V9") Fixes: cf976f660ee8 ("arm64: dts: realtek: Add RTD1293 and Synology DS418j") Fixes: 5133636e41a2 ("arm64: dts: realtek: Add RTD1296 and Synology DS418") Cc: James Tai Signed-off-by: Andreas Färber commit 6d2fdb241005807735a445f96dbcd2b5fefeb1ed Author: Andreas Färber Date: Sun Nov 10 01:17:29 2019 +0100 arm64: dts: realtek: rtd129x: Introduce r-bus Model Realtek's register bus in DT. Signed-off-by: Andreas Färber commit 690677c22d5fa5dfdaa609a1739b75fdfb1c4a24 Author: Andreas Färber Date: Sun Nov 10 07:02:43 2019 +0100 arm64: dts: realtek: rtd129x: Use reserved-memory for RPC regions Move /reserved-memory node from RTD1295 to RTD129x DT. Convert RPC /memreserve/s into /reserved-memory nodes. Fixes: 72a7786c0a0d ("ARM64: dts: Add Realtek RTD1295 and Zidoo X9S") Fixes: f8b3436dad5c ("arm64: dts: realtek: Factor out common RTD129x parts") Signed-off-by: Andreas Färber commit 31888c8be1486daf2c34ba6c58129635e49d564a Author: Andreas Färber Date: Mon Nov 11 03:00:26 2019 +0100 arm64: dts: realtek: rtd129x: Fix GIC CPU masks for RTD1293 Convert from GIC_CPU_MASK_RAW() to GIC_CPU_MASK_SIMPLE(). In case of RTD1293 adjust the arch timer and VGIC interrupts' CPU masks to its smaller number of CPUs. Fixes: cf976f660ee8 ("arm64: dts: realtek: Add RTD1293 and Synology DS418j") Signed-off-by: Andreas Färber commit 824c46117ae00590ff7f3bccea31eb97b50f8fb9 Author: Andreas Färber Date: Sun Nov 17 23:28:26 2019 +0100 ARM: dts: rtd1195: Add Realtek Horseradish EVB Add a Device Tree for Realtek's RTD1195 EVB "Horseradish". Signed-off-by: Andreas Färber commit 89eac40f933cf0953133129c2227e2c8a3aa1993 Author: Andreas Färber Date: Sun Nov 17 17:13:47 2019 +0100 dt-bindings: arm: realtek: Add Realtek Horseradish EVB Define a compatible string for Realtek Horseradish EVB for RTD1195 SoC. Acked-by: Rob Herring Signed-off-by: Andreas Färber commit ede8b703750c8cd5bd50feb18a9f300697d3b196 Author: Andreas Färber Date: Fri Nov 8 19:22:23 2019 +0100 ARM: dts: rtd1195: Introduce r-bus Model Realtek's register bus in DT. Signed-off-by: Andreas Färber commit af19d9b8844f5e4573e59a42914af83200bf86a4 Author: Andreas Färber Date: Sat Nov 23 18:49:16 2019 +0100 ARM: dts: rtd1195: Exclude boot ROM from memory ranges Carve out 0xa800 for the boot ROM from the /memory@0 node, updating it to /memory@a800, and add it to /soc ranges. Signed-off-by: Andreas Färber commit 517a77d07c3940074e4d926c8824e74e27881bdc Author: Andreas Färber Date: Thu Oct 5 05:52:52 2017 +0200 ARM: dts: Prepare Realtek RTD1195 and MeLE X1000 Add Device Trees for Realtek RTD1195 SoC and MeLE X1000 TV box. Reuse the existing RTD1295 watchdog compatible for now. Reviewed-by: Rob Herring [AF: Fixed r-bus size, fixed GIC, updated memreserve & memory] Signed-off-by: Andreas Färber commit 7c070e9a2352714c2c2dd924b46afd43841767a1 Author: Andreas Färber Date: Sun Oct 20 16:26:47 2019 +0200 dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000 Add bindings for Realtek RTD1195 SoC and MeLE X1000 TV box. Reviewed-by: Rob Herring Signed-off-by: Andreas Färber commit ed25e516a100de9a4e9b09f8272585d3efbbfdfc Author: Andreas Färber Date: Sun Jan 5 06:40:48 2020 +0100 MAINTAINERS: Add Realtek arm DT files Add a file pattern for 32-bit arm DT files being added. Signed-off-by: Andreas Färber commit 86aeee4d0a4cc5f7a28fe209444887b93a9a47ca Author: Andreas Färber Date: Thu Oct 5 03:59:15 2017 +0200 ARM: Prepare Realtek RTD1195 Introduce ARCH_REALTEK Kconfig option also for 32-bit Arm. Override the text offset to cope with boot ROM occupying first 0xa800 bytes and further reservations up to 0xf4000 (compare Device Tree). Add a custom machine_desc to enforce memory carveout for I/O registers. Signed-off-by: Andreas Färber commit feea1aab9217fc48078ed791ff0940d2e1eee4d2 Author: Sam Ravnborg Date: Wed Apr 8 20:29:26 2020 +0200 fbdev: mx3fb: const pointer to ipu_di_signal_cfg Laurent Pinchart and Jani Nikula both suggested to make the pointer to struct ipu_di_signal_cfg const. Fix this. Signed-off-by: Sam Ravnborg Fixes: 3f6c93ec9254 ("fbdev: mx3fb: avoid warning about psABI change") Reviewed-by: Laurent Pinchart Cc: Jani Nikula Cc: Laurent Pinchart Cc: Arnd Bergmann Cc: Sam Ravnborg Cc: Enrico Weigelt Cc: Bartlomiej Zolnierkiewicz Cc: linux-fbdev@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200408182926.GA21997@ravnborg.org commit 0650857570d161486a95d37bc8682628881ae2da Author: Pierre-Louis Bossart Date: Thu Apr 9 14:02:51 2020 -0500 ALSA: hda: add autodetection for SoundWire When an ACPI companion device is present and the SoundWire link mask information is available, use SoundWire instead of legacy HDA or Skylake drivers. The SOF driver is selected when SoundWire or DMIC are detected. There is no precedence at this level. In the SOF driver proper, SoundWire will be handled first since it is mutually exclusive with HDaudio. Known devices with an existing DMI quirk bypass this detection to avoid any dependency on ACPI/DSDT tables. Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200409190251.16569-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 04896832c94aae4842100cafb8d3a73e1bed3a45 Author: Ziqian SUN (Zamir) Date: Sat Apr 11 09:34:27 2020 +0800 Bluetooth: btrtl: Add support for RTL8761B Add new compatible device RTL8761B. RTL8761B is a USB Bluetooth device, with support of BLE and BR/EDR. The USB info is T: Bus=03 Lev=04 Prnt=04 Port=00 Cnt=01 Dev#= 29 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=8771 Rev= 2.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=XXXXXXXXXXXX C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms Signed-off-by: Ziqian SUN (Zamir) Signed-off-by: Marcel Holtmann commit f30d3ced9fafa03e4855508929b5b6334907f45e Author: Chris Wilson Date: Fri Apr 10 09:35:35 2020 +0100 agp/intel: Reinforce the barrier after GTT updates After changing the timing between GTT updates and execution on the GPU, we started seeing sporadic failures on Ironlake. These were narrowed down to being an insufficiently strong enough barrier/delay after updating the GTT and scheduling execution on the GPU. By forcing the uncached read, and adding the missing barrier for the singular insert_page (relocation paths), the sporadic failures go away. Fixes: 983d308cb8f6 ("agp/intel: Serialise after GTT updates") Fixes: 3497971a71d8 ("agp/intel: Flush chipset writes after updating a single PTE") Signed-off-by: Chris Wilson Acked-by: Andi Shyti Cc: stable@vger.kernel.org # v4.0+ Link: https://patchwork.freedesktop.org/patch/msgid/20200410083535.25464-1-chris@chris-wilson.co.uk commit c1b5ea926d55239e3e66e41030d9c45c7b876310 Author: Chris Wilson Date: Fri Apr 10 09:16:38 2020 +0100 drm/i915/selftests: Check for an already completed timeslice With timeslice yielding on a semaphore, we may complete timeslices much faster than we were expecting and already have yielded the stuck request. Before complaining that timeslicing is not enabled, check that we haven't already applied the switch. Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200410081638.19893-1-chris@chris-wilson.co.uk commit 538c329f7f3efeac3e6dc116da1a0465bd56d980 Author: Colin Ian King Date: Thu Apr 9 14:31:07 2020 +0100 drm/i915: remove redundant assignment to variable err The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200409133107.415812-1-colin.king@canonical.com commit dc2f7e67a28a5cbe4ea905dafaa6903df670014a Author: Chris Wilson Date: Thu Apr 9 12:01:01 2020 +0100 dma-buf: Exercise dma-fence-chain under selftests A few very simple testcases to exercise the dma-fence-chain API. Signed-off-by: Chris Wilson Reviewed-by: Venkata Sandeep Dhanalakota Link: https://patchwork.freedesktop.org/patch/msgid/20200409110101.18400-3-chris@chris-wilson.co.uk commit 5de376bb434f80a13138f0ebedc8351ab73d8b0d Author: Chris Wilson Date: Thu Apr 9 12:01:00 2020 +0100 dma-buf: Report signaled links inside dma-fence-chain Whenever we walk along the dma-fence-chain, we prune signaled links to keep the chain nice and tidy. This leads to situations where we can prune a link and report the earlier fence as the target seqno -- violating our own consistency checks that the seqno is not more advanced than the last element in a dma-fence-chain. Report a NULL fence and success if the seqno has already been signaled. Signed-off-by: Chris Wilson Tested-by: Venkata Sandeep Dhanalakota Reviewed-by: Venkata Sandeep Dhanalakota Link: https://patchwork.freedesktop.org/patch/msgid/20200409110101.18400-2-chris@chris-wilson.co.uk commit 29da47cfc1f0c3aad0daa89ccf284c3465971482 Author: Chris Wilson Date: Thu Apr 9 12:00:59 2020 +0100 dma-buf: Prettify typecasts for dma-fence-chain Inside dma-fence-chain, we use a cmpxchg on an RCU-protected pointer. To avoid the sparse warning for using the RCU pointer directly, we have to cast away the __rcu annotation. However, we don't need to use void* everywhere and can stick to the dma_fence*. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200409110101.18400-1-chris@chris-wilson.co.uk commit 943d5d92c5e87aa8293aae6de2b3ee977aa7d3cf Author: Daniels Umanovskis Date: Thu Apr 9 13:18:29 2020 +0200 Bluetooth: log advertisement packet length if it gets corrected The error could indicate a problem with the Bluetooth device. It is easier to investigate if the packet's actual length gets logged, not just the fact that a discrepancy occurred. Signed-off-by: Daniels Umanovskis Reviewed-by: Alain Michaud Signed-off-by: Marcel Holtmann commit d103729a623abcc616364c713d88ab3710037f4a Author: Rafał Hibner Date: Thu Apr 9 17:56:21 2020 +0200 spi: spi-axi-spi-engine: Access register after clock initialization Move register access after clock initialization. Clock "s_axi_aclk" is needed for register access. Without the clock running AXI bus hangs and causes kernel freeze. Signed-off-by: Rafał Hibner Reviewed-by: Alexandru Ardelean Cc: Alexandru Ardelean Link: https://lore.kernel.org/r/20200409155621.12174-1-rafal.hibner@secom.com.pl Signed-off-by: Mark Brown commit 4d1b58d5eafd6acbc728e41263a7de1b5e8b781a Author: Lyude Paul Date: Fri Apr 3 15:58:29 2020 -0400 drm/dp_mst: Print errors on ACT timeouts Although it's not unexpected for drm_dp_check_act_status() to fail due to DPCD read failures (as the hub may have just been unplugged suddenly), timeouts are a bit more worrying as they either mean we need a longer timeout value, or we aren't setting up payload allocations properly. So, let's start printing errors on timeouts. Signed-off-by: Lyude Paul Cc: Sean Paul Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-5-lyude@redhat.com commit 873a95e0d59ac06901ae261dda0b7165ffd002b8 Author: Lyude Paul Date: Fri Apr 3 15:47:15 2020 -0400 drm/dp_mst: Increase ACT retry timeout to 3s Currently we only poll for an ACT up to 30 times, with a busy-wait delay of 100µs between each attempt - giving us a timeout of 2900µs. While this might seem sensible, it would appear that in certain scenarios it can take dramatically longer then that for us to receive an ACT. On one of the EVGA MST hubs that I have available, I observed said hub sometimes taking longer then a second before signalling the ACT. These delays mostly seem to occur when previous sideband messages we've sent are NAKd by the hub, however it wouldn't be particularly surprising if it's possible to reproduce times like this simply by introducing branch devices with large LCTs since payload allocations have to take effect on every downstream device up to the payload's target. So, instead of just retrying 30 times we poll for the ACT for up to 3ms, and additionally use usleep_range() to avoid a very long and rude busy-wait. Note that the previous retry count of 30 appears to have been arbitrarily chosen, as I can't find any mention of a recommended timeout or retry count for ACTs in the DisplayPort 2.0 specification. This also goes for the range we were previously using for udelay(), although I suspect that was just copied from the recommended delay for link training on SST devices. Changes since v1: * Use readx_poll_timeout() instead of open-coding timeout loop - Sean Paul Changes since v2: * Increase poll interval to 200us - Sean Paul * Print status in hex when we timeout waiting for ACT - Sean Paul Signed-off-by: Lyude Paul Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)") Cc: Sean Paul Cc: # v3.17+ Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-4-lyude@redhat.com commit a5cb5fa6c3a5c2cf492db667b8670ee7b044b79f Author: Lyude Paul Date: Fri Apr 3 14:08:32 2020 -0400 drm/dp_mst: Reformat drm_dp_check_act_status() a bit Just add a bit more line wrapping, get rid of some extraneous whitespace, remove an unneeded goto label, and move around some variable declarations. No functional changes here. Signed-off-by: Lyude Paul [this isn't a fix, but it's needed for the fix that comes after this] Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)") Cc: Sean Paul Cc: # v3.17+ Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-3-lyude@redhat.com commit 17e03aa8cc16e3d43848fb459f0435372f1c5b9b Author: Lyude Paul Date: Fri Apr 3 14:11:46 2020 -0400 drm/dp_mst: Improve kdocs for drm_dp_check_act_status() No functional changes. Signed-off-by: Lyude Paul Cc: Sean Paul Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-2-lyude@redhat.com commit c61a748370438ca1ae8389071664b2520f16820c Author: Wen Gong Date: Tue Apr 7 08:12:34 2020 +0300 ath10k: change ATH10K_SDIO_BUS_REQUEST_MAX_NUM from 64 to 1024 sdio bus bandwidth is low, sometimes for high performance TX test, it will lack of ath10k_sdio_bus_request, it will print message: ath10k_sdio mmc1:0001:1: unable to allocate bus request for async request change the num from 64 to 1024 will not happen it. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200212080415.31265-3-wgong@codeaurora.org commit d81686d3335648197c5da3992b151648706dc0f8 Author: Wen Gong Date: Tue Apr 7 08:12:30 2020 +0300 ath10k: disable TX complete indication of htt for sdio For sdio chip, it is high latency bus, all the TX packet's content will be tranferred from HOST memory to firmware memory via sdio bus, then it need much more memory in firmware than low latency bus chip, for low latency chip, such as PCI-E, it only need to transfer the TX descriptor via PCI-E bus to firmware memory. For sdio chip, reduce the complexity of TX logic will help TX efficiency since its memory is limited, and it will reduce the TX circle's time of each packet and then firmware will have more memory for TX since TX complete also need memeory. This patch disable TX complete indication from firmware for htt data packet, it will not have TX complete indication from firmware to ath10k. It will cut the cost of bus bandwidth of TX complete and make the TX logic of firmware simpler, it results in significant performance improvement on TX path. Udp TX throughout is 130Mbps without this patch, and it arrives 400Mbps with this patch. The downside of this patch is the command "iw wlan0 station dump" will show 0 for "tx retries" and "tx failed" since all tx packet's status is success. This patch only effect sdio chip, it will not effect PCI, SNOC etc. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWPZ-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200212080415.31265-2-wgong@codeaurora.org commit 9a785c7ad1d775f41c61bc380a98e710bc71347e Author: John Clements Date: Thu Apr 9 15:32:41 2020 +0800 drm/amdgpu: increased atom cmd timeout added macro to define timeout Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 5aaa8fff3aa9509991eff2eaaca96bcfbecacca7 Author: Evan Quan Date: Tue Mar 24 16:22:19 2020 +0800 drm/amd/powerplay: unload mp1 for Arcturus RAS baco reset This sequence is recommended by PMFW team for the baco reset with PMFW reloaded. And it seems able to address the random failure seen on Arcturus. Signed-off-by: Evan Quan Reviewed-by: Feifei Xu Reviewed-by: John Clements Signed-off-by: Alex Deucher commit ad36d71b3f5293fd0ab7be6c8755ba0cc78bf528 Author: Aurabindo Pillai Date: Tue Apr 7 14:26:18 2020 -0400 amdgpu_kms: Remove unnecessary condition check Execution will only reach here if the asserted condition is true. Hence there is no need for the additional check. Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit ef91e8b5c885e5985b176fcc04eaefe1f162d7f6 Author: Alex Deucher Date: Wed Apr 8 09:30:11 2020 -0400 drm/amdgpu/display: fix warning when compiling without debugfs fixes unused variable warning. Reported-by: Eric Biggers Acked-by: Christian König Reviewed-by: Mikita Lipski Signed-off-by: Alex Deucher commit ba714a56fcb58782023514bb11455c549c572099 Author: Aaron Liu Date: Tue Apr 7 17:46:04 2020 +0800 drm/amdgpu: unify fw_write_wait for new gfx9 asics Make the fw_write_wait default case true since presumably all new gfx9 asics will have updated firmware. That is using unique WAIT_REG_MEM packet with opration=1. Signed-off-by: Aaron Liu Tested-by: Aaron Liu Tested-by: Yuxian Dai Acked-by: Alex Deucher Acked-by: Huang Rui Signed-off-by: Alex Deucher commit 2eee0229f65e897134566888e5321bcb3af0df7a Author: Hawking Zhang Date: Wed Apr 8 16:18:52 2020 +0800 drm/amdgpu: support access regs outside of mmio bar add indirect access support to registers outside of mmio bar. Signed-off-by: Hawking Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f384ff95f652ad743d6e3a901c60ca521da78674 Author: Hawking Zhang Date: Fri Apr 3 17:58:06 2020 +0800 drm/amdgpu: retire AMDGPU_REGS_KIQ flag all the register access through kiq is redirected to amdgpu_kiq_rreg/amdgpu_kiq_wreg Signed-off-by: Hawking Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ec59847e741d7d2c9d404bb3d1efcf11b77293ff Author: Hawking Zhang Date: Fri Apr 3 17:51:42 2020 +0800 drm/amdgpu: retire RREG32_IDX/WREG32_IDX those are not needed anymore Signed-off-by: Hawking Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 3c888c1635910a66f19a451f98d86d076aae57fd Author: Hawking Zhang Date: Fri Apr 3 17:37:39 2020 +0800 drm/amdgpu: retire indirect mmio reg support from cgs not needed anymore Signed-off-by: Hawking Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 46e840ed1045474a3bbd1340ac3ba5bd57e46f14 Author: Hawking Zhang Date: Fri Apr 3 17:30:00 2020 +0800 drm/amdgpu: replace indirect mmio access in non-dc code path all the mmCUR_CONTROL instances are in mmr range and can be accessd directly by using RREG32/WREG32 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit dec0520aff8df2f1aca8ab9b29818a8002592bec Author: Hawking Zhang Date: Fri Apr 3 16:40:35 2020 +0800 drm/amdgpu: remove inproper workaround for vega10 the workaround is not needed for soc15 ASICs except for vega10. it is even not needed with latest vega10 vbios. Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 1744fb2391dd26b03d2a9ef1735bf2beb3565853 Author: Evan Quan Date: Fri Apr 3 13:19:14 2020 +0800 drm/amd/powerplay: error out on forcing clock setting not supported For Arcturus, forcing clock to some specific level is not supported with 54.18 and onwards SMU firmware. As according to firmware team, they adopt new gfx dpm tuned parameters which can cover all the use case in a much smooth way. Thus setting through driver interface is not needed and maybe do a disservice. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a23ca7f76d558e2275cea6033171a6c47fcd002c Author: Prike Liang Date: Tue Apr 7 20:21:26 2020 +0800 drm/amdgpu: fix gfx hang during suspend with video playback (v2) The system will be hang up during S3 suspend because of SMU is pending for GC not respose the register CP_HQD_ACTIVE access request.This issue root cause of accessing the GC register under enter GFX CGGPG and can be fixed by disable GFX CGPG before perform suspend. v2: Use disable the GFX CGPG instead of RLC safe mode guard. Signed-off-by: Prike Liang Tested-by: Mengbing Wang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 5f8693796c06ded7d88bf1d9009cdc406e31f3b1 Author: Bhawanpreet Lakha Date: Mon Feb 24 14:55:53 2020 -0500 drm/amd/display: add HDCP caps debugfs Add debugfs to get HDCP capability. This is also useful for kms_content_protection igt test. Use: cat /sys/kernel/debug/dri/0/DP-1/hdcp_sink_capability cat /sys/kernel/debug/dri/0/HDMI-A-1/hdcp_sink_capability Signed-off-by: Bhawanpreet Lakha Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit fe8db3bcf2e5f9d9056f923b12c7158d6541e435 Author: Bhawanpreet Lakha Date: Wed Apr 1 15:07:26 2020 -0400 drm/amd/display: query hdcp capability during link detect [Why] Query the hdcp caps of a link, it is useful and can be reported to the user [How] Create a query function and call it during link detect Signed-off-by: Bhawanpreet Lakha Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 1ea2b260eb6306b31dd6a932693519dd35da3774 Author: Kent Russell Date: Fri Apr 3 10:42:21 2020 -0400 drm/amdgpu: Re-enable FRU check for most models v5 There is at least 1 VG20 DID that does not have an FRU, and trying to read that will cause a hang. For now, explicitly support reading the FRU for Arcturus and for the WKS VG20 DIDs, and skip for everything else. This re-enables serial number reporting for server cards v2: Add ASIC check v3: Don't default to true for pre-VG20 v4: Use DID instead of parsing the VBIOS v5: Sqaush in overflow warning fix Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3adf175e2e74aaa0b416cbf322eb8664081a63a9 Author: Aric Cyr Date: Sun Apr 5 16:41:15 2020 -0400 drm/amd/display: 3.2.80 Signed-off-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a576b345f94ff9ab9c4006bf8317c1fbc3dee867 Author: Nicholas Kazlauskas Date: Sun Apr 5 16:41:14 2020 -0400 drm/amd/display: Make DMCUB bss/data firmware blob optional [Why] By moving everything out of .data into the other regions we can drop the requirement for the second blob and unify it all into the inst/const blob. [How] We need to still support the blob being there and not being there for backwards compatibility. Look for the DMCUB metadata section in the end of the inst/const blob instead of bss/data is missing. Clear CW2 if we don't have the data blob so we don't hang when transitioning between data blob/blobless firmwares. Don't memcpy the blob into CW2 region if it doesn't exist. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 8ccf0e20769d96b8d0ccbfcb56bc7ca7874154a4 Author: Wenjing Liu Date: Sun Apr 5 16:41:13 2020 -0400 drm/amd/display: determine USB C DP2 mode only when USB DP Alt is enabled [why] When display is connected with a native DP port, DP2 mode register value is a don't care. Driver mistakenly reduce max supported lane count to 2 lane based on the don't care value. [how] Add additional check only if USB C DP alt mode is enabled, we will determine max lane count supported based on current mode. Signed-off-by: Wenjing Liu Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 4404b47852f3ec709f5787c045650afabea00b4b Author: Michael Strauss Date: Sun Apr 5 16:41:12 2020 -0400 drm/amd/display: Check for null fclk voltage when parsing clock table [WHY] In cases where a clock table is malformed such that fclk entries have frequencies but not voltages listed, we don't catch the error and set clocks to 0 instead of using hardcoded values as we should. [HOW] Add check for clock tables fclk entry's voltage as well Signed-off-by: Michael Strauss Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 6fb4280ecbff9dd8a8db57bc9bfeef95c2b3a53f Author: Joshua Aberback Date: Sun Apr 5 16:41:11 2020 -0400 drm/amd/display: Acknowledge wm_optimized_required [Why] If dc->clk_mgr->funcs->are_clock_states_equal is set, then wm_optimized_required is never checked. In that case, when going from a higher mode to a lower mode, wm_optimized_required remains true until the next mode change. [How] - move from else-if to unconditional or Signed-off-by: Joshua Aberback Reviewed-by: Jun Lei Reviewed-by: Nicholas Kazlauskas Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2fdcc916ed77e09a0b856b561af8063e93ae96b3 Author: Jaehyun Chung Date: Sun Apr 5 16:41:10 2020 -0400 drm/amd/display: Update DRAM watermark before checking to update TTU [Why] In most cases, DRAM watermark is large enough that the result of the condition to increase TTU doesn't change after DRAM watermark is increased. However, there is are cases where the condition fails and becomes true after DRAM watermark is increased. This results in minTTU < DRAM watermarks which leads to PSR hang since p-state is requested but not allowed. [How] Check whether to update TTU after DRAM watermark is updated. Signed-off-by: Jaehyun Chung Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b754c07a39b11cc20586ef55374846605360915b Author: Jerry (Fangzhi) Zuo Date: Sun Apr 5 16:41:09 2020 -0400 drm/amd/display: Avoid create MST prop after registration [Why] Prop are created at boot stage, and not allowed to create new prop after device registration. [How] Reuse the connector property from SST if exist. Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Hersen Wu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 033baeeefbf088416b975ac1aae08a4b8e8ef914 Author: Nicholas Kazlauskas Date: Sun Apr 5 16:41:08 2020 -0400 drm/amd/display: Make cursor source translation adjustment optional [Why] In some usecases, like tiled display, the stream and plane configuration can be setup in a way where the caller expects DAL to perform the clipping, eg: P0: src_rect(0, 0, w, h) dst_rect(0, 0, w, h) P1: src_rect(w, 0, w, h) dst_rect(0, 0, w, h) Cursor is enabled on both streams with the same position. This can result in double cursor on tiled display, even though this behavior is technically correct from the DC interface point of view. We need a mechanism to control this dynamically. [How] This is something that should live in the DM layer based on detection of the specified configuration but it's not something that we really have enough information to deal with today. Add a flag to the cursor position state that specifies whether we want DC to do the translation or not and make it opt-in and let the DM decide when to do it. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a1a0e61f3c43c610f0a3c109348c14ce930c1977 Author: Alvin Lee Date: Sun Apr 5 16:41:05 2020 -0400 drm/amd/display: Revert to old formula in set_vtg_params [Why] New formula + cursor change causing underflow on certain configs [How] Rever to old formula Signed-off-by: Alvin Lee Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit cdde482caabf2adad47d23f0d1e235db2c4f2b7d Author: Stylon Wang Date: Sun Apr 5 16:41:04 2020 -0400 drm/amd/display: Refactor color management to take dm plane state [Why] - In amdgpu_dm_update_plane_color_mgmt() it is inconsistent in taking in dm_crtc_state and dc_plane_state. - Makes supporting plane-level color management with proper guard more complicated than necessary. [How] Pass in dm_plane_state in place of dc_plane_state in amdgpu_dm_update_plane_color_mgmt(). Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit c7f345e53c45c78478833aaf8954a0ed66ae8672 Author: Charlene Liu Date: Sun Apr 5 16:41:03 2020 -0400 drm/amd/display: initialize get_max_link_cap [why] usb3->usb2 switch system hang. driver needs to limit the max sink cap based on DP4 mode. [how] based on s_dpalt check and DP4 check: limit the USB-C DPALT DP maximum supported lane count. Signed-off-by: Charlene Liu Reviewed-by: Chris Park Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit fa90219a129fd87bc2186caca79d2626fc1986a9 Author: Dmytro Laktyushkin Date: Sun Apr 5 16:41:02 2020 -0400 drm/amd/display: fix dml pipe merge logic Dml merges mpc/odm combine pipes to do calculations. This merge is imperfect if there is a viewport overlap. This change saves pre overlap viewport for dml use. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Reviewed-by: Wesley Chalmers Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit bdfbff5ef46b99322476fefe7dfe51ac8fdb6173 Author: Isabel Zhang Date: Sun Apr 5 16:41:01 2020 -0400 drm/amd/display: Update stream adjust in dc_stream_adjust_vmin_vmax [Why] After v_total_min and max are updated in vrr structure, the changes are not reflected in stream adjust. When these values are read from stream adjust it does not reflect the actual state of the system. [How] Set stream adjust values equal to vrr adjust values after vrr adjust values are updated. Signed-off-by: Isabel Zhang Reviewed-by: Alvin Lee Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 700f7f729810926fe76311a59ae236d85c4e24b3 Author: Aric Cyr Date: Sun Apr 5 16:41:00 2020 -0400 drm/amd/display: 3.2.79 Signed-off-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit efc3ec87a9372b1a1b354362a1844202b5d8d184 Author: Wyatt Wood Date: Sun Apr 5 16:40:59 2020 -0400 drm/amd/display: Remove unused defines [Why] Defines aren't used. Remove them. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 875390a86321c20f43ba5a3c8fec33a1b12322e4 Author: Nicholas Kazlauskas Date: Sun Apr 5 16:40:57 2020 -0400 drm/amd/display: Calculate scaling ratios on every medium/full update [Why] If a plane isn't being actively enabled or disabled then DC won't always recalculate scaling rects and ratios for the primary plane. This results in only a partial or corrupted rect being displayed on the screen instead of scaling to fit the screen. [How] Add back the logic to recalculate the scaling rects into dc_commit_updates_for_stream since this is the expected place to do it in DC. This was previously removed a few years ago to fix an underscan issue but underscan is still functional now with this change - and it should be, since this is only updating to the latest plane state getting passed in. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b34659deb66bfe937b36aeeb53ed9b89c4048c8d Author: Nicholas Kazlauskas Date: Sun Apr 5 16:40:56 2020 -0400 drm/amd/display: Program viewport when source pos changes for DCN20 hw seq [Why] For medium updates that change nothing but the source rect position the viewport doesn't change on DCN20. We're missing the check for the position update bit that was there in the DCN10 hardware sequencer. [How] Check the position bit along with the scaling bit like we were doing with DCN20. We shouldn't actually hit a case where context != current_state in our programming/commit model but guard against it anyway since it was guarded for the other bits. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Zhan Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 03a4059b8dddf6a299ca941cc6e0d66bb146d884 Author: Nicholas Kazlauskas Date: Sun Apr 5 16:40:55 2020 -0400 drm/amd/display: Fix incorrect cursor pos on scaled primary plane [Why] Cursor pos is correctly adjusted from DC side for source rect offset on DCN ASIC, but only on the overlay. This is because DM places offsets the cursor for primary planes only to workaround missing code in DCE for the adjustment we're now correctly doing in DC for DCN ASIC. [How] Drop the adjustment for source rect from the DM side of things and put the code where it actually belongs - in DC on the pipe level. This matches what we do for DCN now. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Zhan Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d3227976f4a8aae84ae34b8766f043c73cc2ab8a Author: Eric Yang Date: Sun Apr 5 16:40:54 2020 -0400 drm/amd/display: change default pipe_split policy for DCN1 [Why] Changing policy to dynamic will allow 4k multi display configs to be supported at DPM0 Signed-off-by: Eric Yang Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 12aec9efea952eee284dd58dc585df7948a85771 Author: Nicholas Kazlauskas Date: Sun Apr 5 16:40:53 2020 -0400 drm/amd/display: Translate cursor position by source rect [Why] Cursor is drawn as part of the framebuffer for a plane on AMD hardware. The cursor position on the framebuffer does not change even if the source rect viewport for the cursor does. This causes the cursor to be clipped. The following IGT tests fail as a result of this issue: - kms_plane_cursor@pipe-*-viewport-size-* [How] Offset cursor position by plane source rect viewport. If the viewport is unscaled then the cursor is now correctly positioned on any plane - primary or overlay. There is still a hardware limitation for dealing with the cursor size being incorrectly scaled but that's not something we can address. Add some documentation explaining some of this in the code while we're at it. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Zhan Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 8d26334d1ccdae26f2ed6457d36cc8ae99e98fc7 Author: Wyatt Wood Date: Sun Apr 5 16:40:52 2020 -0400 drm/amd/display: Fix ABM config copy for dmcub Decouple dmcub config copy from dmcu iram copy. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 8d9c07b0eb099a0bda247d0206acb3a76410914d Author: Xiaodong Yan Date: Sun Apr 5 16:40:51 2020 -0400 drm/amd/display: only blank dp stream which will be powered off [why] blank all dp stream would impact edp [how] only blank the one which will be powered off Signed-off-by: Xiaodong Yan Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 49c4a8b6d93b533e266cb9f76eae4067592e077e Author: Joseph Gravenor Date: Sun Apr 5 16:40:50 2020 -0400 drm/amd/display: fix typo [why] MOD_HDCP_STATUS_HDCP1_ENABLE_ENCRYPTION and MOD_HDCP_STATUS_HDCP2_ENABLE_ENCRYPTION were supposed to be MOD_HDCP_STATUS_HDCP1_ENABLE_ENCRYPTION_FAILURE and MOD_HDCP_STATUS_HDCP2_ENABLE_ENCRYPTION_FAILURE. Because of this it always seems like mod_hdcp_hdcp1_enable_encryption and mod_hdcp_hdcp2_enable_encryption are always passing [how] rename the elements to what they were supposed to be called Signed-off-by: Joseph Gravenor Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 501b4026c95e5f6e8cdbad186b7f70714fdec4a7 Author: Wyatt Wood Date: Sun Apr 5 16:40:49 2020 -0400 drm/amd/display: Use config flag to disable dmcu obj creation [Why] When dmcub is the default we no longer wish to create the psr and dmcu objects. Currently a dc debug flag is used to implement this, but these flags aren't populated until after dcn21_resource_construct is called. This means the dmcub objects will never be created. Therefore we must use a dc config flag, which is populated before dc resource construct. [How] Add a dc config flag. Signed-off-by: Wyatt Wood Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d5e27f072844f6097ab3305b3b7bee00709b953b Author: Sung Lee Date: Sun Apr 5 16:40:48 2020 -0400 drm/amd/display: Check power_down functions exist before calling [WHY] The power_down() function was only defined for specific asics and will crash the system if it is called by an asic with eDP connected that does not have it defined. [HOW] Add a check for the function's existence before calling it. Signed-off-by: Sung Lee Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit c97c8d77b11fcf4c18c2f67dd3878781b1b5c2ff Author: Nicholas Kazlauskas Date: Sun Apr 5 16:40:47 2020 -0400 drm/amd/display: Don't change mpcc tree for medium updates on DCN20 hwseq [Why] Overlay planes disappear when the plane's alpha blending mode or global opacity is modified. These are considered UPDATE_TYPE_MEDIUM and trigger the update_mpcc path in the DCN hardware sequencer. On DCN10 we have an "optimization" to avoid touching the blending tree on these updates, but this is actually required behavior based on how update_mpcc is structured. For full updates we acquire a MPCC for the plane, remove it if it already exists then reinsert it after with insert_plane. The call to insert_plane can take an optional mpcc to insert the new one above to preserve the current blending order. The update_mpcc hwseq function doesn't do this so the overlay gets sent to the very bottom of the tree. [How] Copy the check over from DCN10 to DCN20. The only time we need to actually touch the tree really is the full update, so this is also an optimization on top of the fix. Fixing the logic for insert_plane is rather simple (cache the bot_mpcc and pass it to insert_plane) but is a change that impacts most display usecases. For now stick with the optimization. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Chris Park Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit c5f5b9d934ba897182ba7159f4d1f1ff06234e3e Author: Xiaodong Yan Date: Sun Apr 5 16:40:46 2020 -0400 drm/amd/display: blank dp stream before power off receiver [why] power off dp receiver directly cause garbage during hw init [how] blank dp stream and then power off receiver Signed-off-by: Xiaodong Yan Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b3a941df690f4b587ca005a4fca081f7b40be198 Author: Sung Lee Date: Sun Apr 5 16:40:45 2020 -0400 drm/amd/display: Power down hw blocks on boot [WHY] On headless boot a DIG may be turned on by VBIOS on RN. This leads to display_count being non-zero in hybrid graphics cases leading to SMU DISPLAY_OFF message not being sent. [HOW] Power down hardware on boot if seamless boot is not occurring (power_down_display_on_boot == 1) Signed-off-by: Sung Lee Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2deade5ede56581722c0d7672f28b09548dc0fc4 Author: Isabel Zhang Date: Sun Apr 5 16:40:44 2020 -0400 drm/amd/display: Remove hdcp display state with mst fix [Why] Due to previous code changes, displays transition from active to active and added state immediately, making it redundant to have both display states. Previous change to fix this caused HDCP to get into a bad state when monitor is connected to MST hub, this change fixes that issue. [How] Change code behavior so when a device is added successfully the state remains as active and when addition is unsuccessful change state to inactive. This removes need for added and active state. Signed-off-by: Isabel Zhang Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit c5d5b0ecf9c849c23e167965d88e609958cd805d Author: Wyatt Wood Date: Sun Apr 5 16:40:43 2020 -0400 drm/amd/display: Implement abm config table copy to dmcub [Why] Driver must pass abm config table to dmub fw. This provides various parameters for abm functionality. [How] There is too much data to be passed in an inbox message, so we must pass this data using an indirect buffer. Copy the table to cw7 via x86, driver copies to fw_state structure. Signed-off-by: Wyatt Wood Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Acked-by: Tony Cheng Signed-off-by: Alex Deucher commit c06a545ae531bd8f791dc41b787822512eb65c5d Author: Nikola Cornij Date: Sun Apr 5 16:40:42 2020 -0400 drm/amd/display: Program DSC before enabling link [why] Link or DIG BE can't be exposed to a higher stream bandwidth than they can handle. When DSC is required to fit the stream into the link bandwidth, DSC has to be programmed before the link is enabled to ensure this. Without it, intermittent issues such as black screen after S3 or a hot-plug can be seen with DSC timings like 4k144Hz or 8k60Hz. [how] Move DSC programming from before enabling stream to before enabling link Signed-off-by: Nikola Cornij Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 5b5c1777bd3ce3ae3a448c8c8df3c724d1bfa9fe Author: Josip Pavic Date: Sun Apr 5 16:40:41 2020 -0400 drm/amd/display: prevent loop from occuring in pipe list [Why] If no free pipes are available, acquire_first_split_pipe is called to get a pipe to use. This call may alter the ordering of the pipes in the list so that, for example, the tail pipe changes. If acquire_first_split_pipe returns the tail pipe, we'll have free_pipe == tail_pipe. What tail_pipe refers to is not the current tail_pipe, but what was previously the tail pipe - i.e. prior to the call to acquire_first_split_pipe The logic that follows will link free_pipe to the tail pipe, referring to the current tail pipe. However, since tail_pipe is cached from before the call to acquire_first_split_pipe, the wrong tail pipe will be used, and it will end up being linked to itself, creating a loop that, if traversed, will result in a soft hang. [How] Do not cache the tail pipe. Instead, check the tail pipe after the call to acquire_first_split_pipe is made. Signed-off-by: Josip Pavic Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 86f4a94023df4315c30643bee40d58797a156033 Author: Aric Cyr Date: Sun Apr 5 16:40:40 2020 -0400 drm/amd/display: 3.2.78 Signed-off-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b639c22c98ff0ba140799ddc56f639240014f999 Author: Jack Zhang Date: Tue Apr 7 13:50:05 2020 +0800 drm/amdgpu/sriov add amdgpu_amdkfd_pre_reset in gpu reset [PATCH 2/2] kfd_pre_reset will free mem_objs allocated by kfd_gtt_sa_allocate Without this change, sriov tdr code path will never free those allocated memories and get memory leak. Signed-off-by: Jack Zhang Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit fe9824d15eff7ef38f63eddd1a06648e49286c7b Author: Jack Zhang Date: Tue Apr 7 13:44:51 2020 +0800 drm/amdkfd Avoid destroy hqd when GPU is on reset This reverts commit 5161bba4311f in order to split it into two different patches, and this will make it easier to understand. [PATCH 1/2] porting to gfx10 from commit 1b0bfcff463f390c40 ("drm/amdgpu: Avoid destroy hqd when GPU is on reset") Originally, MEC is touched without GPU initialized first. Signed-off-by: Jack Zhang Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit 4a06686b948579be72a6783c62e5a275af63b0f8 Author: John Clements Date: Tue Apr 7 16:54:33 2020 +0800 drm/amdgpu: update RAS related dmesg print prefix RAS error related dmesg print with pci device info Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit b3dbd6d3ec495057db425a09516a922e1dacec33 Author: John Clements Date: Tue Apr 7 15:08:15 2020 +0800 drm/amdgpu: resolve mGPU RAS query instability upon receiving uncorrectable error, query every GPU node for ras errors Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit c419bdf5b820d5482cf9088c28952249c7fa67f2 Author: Chengming Gui Date: Fri Apr 3 11:32:15 2020 +0800 drm/amd/amdgpu: Correct gfx10's CG sequence Incorrect CG sequence will cause gfx timedout, if we keep switching power profile mode (enter profile mod such as PEAK will disable CG, exit profile mode EXIT will enable CG) when run Vulkan test case(case used for test: vkexample). Signed-off-by: Chengming Gui Reviewed-by: Kenneth Feng Acked-by: Evan Quan Signed-off-by: Alex Deucher commit b2d92682ff6a40d6981a1abab0a96470c0ac16b0 Author: Tianci.Yin Date: Tue Apr 7 22:24:21 2020 +0800 drm/amdgpu: add SPM golden settings for Navi12 Add RLC_SPM golden settings Reviewed-by: Alex Deucher Signed-off-by: Tianci.Yin Signed-off-by: Alex Deucher commit a900f562c8b107ee401b67fbf733949d68199352 Author: Tianci.Yin Date: Tue Apr 7 12:51:04 2020 +0800 drm/amdgpu: add SPM golden settings for Navi14 Add RLC_SPM golden settings Reviewed-by: Alex Deucher Signed-off-by: Tianci.Yin Signed-off-by: Alex Deucher commit 4189425d309aed4c0f6af8cdc01bab8b8f5a5079 Author: Tianci.Yin Date: Thu Apr 2 18:48:22 2020 +0800 drm/amdgpu: add SPM golden settings for Navi10(v2) Add RLC_SPM golden settings Reviewed-by: Alex Deucher Reviewed-by: Feifei Xu Signed-off-by: Tianci.Yin Signed-off-by: Alex Deucher commit d2155a719d8f66d2a3cc3c232ed147d3886b31db Author: Oak Zeng Date: Mon Apr 6 12:11:31 2020 -0500 drm/amdgpu: Print UTCL2 client ID on a gpuvm fault UTCL2 client ID is useful information to get which UTCL2 client caused the gpuvm fault. Print it out for debug purpose Signed-off-by: Oak Zeng Reviewed-by: Alex Deucher Reviewed-by: Christian Konig Signed-off-by: Alex Deucher commit db3e0a284eaca583f2b765731489120d7cc0458d Author: Nirmoy Das Date: Mon Apr 6 10:08:47 2020 +0200 drm/amd/powerplay: fix a typo Util -> Until Fixes: 567c8fc4a0d28b63f ("drm/amd/powerplay: implement the is_dpm_running()") Signed-off-by: Nirmoy Das Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 21b704d78352c289d31697824ceea7ad0ff4ce59 Author: James Zhu Date: Thu Apr 2 23:25:45 2020 -0400 drm/amdgpu/vcn: add shared memory restore after wake up from sleep. VCN shared memory needs restore after wake up during S3 test. v2: Allocate shared memory saved_bo at sw_init and free it in sw_fini. Signed-off-by: James Zhu Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 2a20e630f883065ec95141a9d490484310ce73be Author: Aaron Ma Date: Fri Apr 3 22:34:19 2020 +0800 drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event On ARCTURUS and RENOIR, powerplay is not supported yet. When plug in or unplug power jack, ACPI event will issue. Then kernel NULL pointer BUG will be triggered. Check for NULL pointers before calling. Signed-off-by: Aaron Ma Signed-off-by: Alex Deucher commit a45a9e5e10e0ecbe46fc881d23ce6a8ab6f739e5 Author: Alex Deucher Date: Fri Apr 3 12:25:48 2020 -0400 drm/amdgpu/psp: dont warn on missing optional TA's Replace dev_warn() with dev_info() and note that they are optional to avoid confusing users. The RAS TAs only exist on server boards and the HDCP and DTM TAs only exist on client boards. They are optional either way. Acked-by: Nirmoy Das Signed-off-by: Alex Deucher commit 1c6d567bdf73a207f51ef2e5745854ba7daa22c7 Author: Nirmoy Das Date: Wed Apr 1 11:46:57 2020 +0200 drm/amdgpu: rework sched_list generation Generate HW IP's sched_list in amdgpu_ring_init() instead of amdgpu_ctx.c. This makes amdgpu_ctx_init_compute_sched(), ring.has_high_prio and amdgpu_ctx_init_sched() unnecessary. This patch also stores sched_list for all HW IPs in one big array in struct amdgpu_device which makes amdgpu_ctx_init_entity() much more leaner. v2: fix a coding style issue do not use drm hw_ip const to populate amdgpu_ring_type enum v3: remove ctx reference and move sched array and num_sched to a struct use num_scheds to detect uninitialized scheduler list v4: use array_index_nospec for user space controlled variables fix possible checkpatch.pl warnings Signed-off-by: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 07e14845d1d866083c2679759e7591df3612af89 Author: Nirmoy Das Date: Tue Mar 31 13:29:08 2020 +0200 drm/amdgpu: sync ring type and drm hw_ip type Use AMDGPU_HW_IP_* to set amdgpu_ring_type enum values Signed-off-by: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 04bef61e5da18c2b301c629a209ccdba4d4c6fbb Author: Jack Zhang Date: Thu Apr 2 15:10:24 2020 +0800 drm/amdgpu/sriov add amdgpu_amdkfd_pre_reset in gpu reset kfd_pre_reset will free mem_objs allocated by kfd_gtt_sa_allocate Without this change, sriov tdr code path will never free those allocated memories and get memory leak. v2:add a bugfix for kiq ring test fail Signed-off-by: Jack Zhang Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit ac161f57b66dcf14b3339b1c5857c08a9ad4d833 Author: Anson Huang Date: Wed Apr 1 12:27:02 2020 +0800 clocksource/drivers/imx-tpm: Add support for ARM64 Allows building and compile-testing the i.MX TPM driver also for ARM64. The delay_timer is only supported on ARMv7. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1585715222-24489-1-git-send-email-Anson.Huang@nxp.com commit 44cfc6233447cb2cf47aeb99457de35826a363f6 Author: Guido Günther Date: Thu Apr 9 12:42:02 2020 +0200 drm/bridge: Add NWL MIPI DSI host controller support This adds initial support for the NWL MIPI DSI Host controller found on i.MX8 SoCs. It adds support for the i.MX8MQ but the same IP can be found on e.g. the i.MX8QXP. It has been tested on the Librem 5 devkit using mxsfb. Signed-off-by: Guido Günther Co-developed-by: Robert Chiras Signed-off-by: Robert Chiras Tested-by: Robert Chiras Tested-by: Martin Kepplinger Reviewed-by: Fabio Estevam Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1cf5750f734e33d005564cd89c576eaf3c1c192b.1586427783.git.agx@sigxcpu.org commit 6885e66bc0e7bb073246dde73ddf534102dd4533 Author: Guido Günther Date: Thu Apr 9 12:42:01 2020 +0200 dt-bindings: display/bridge: Add binding for NWL mipi dsi host controller The Northwest Logic MIPI DSI IP core can be found in NXPs i.MX8 SoCs. Signed-off-by: Guido Günther Tested-by: Robert Chiras Reviewed-by: Rob Herring Acked-by: Sam Ravnborg Reviewed-by: Fabio Estevam Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/147ffc1e4dee3a623e5dca25d84565d386a34112.1586427783.git.agx@sigxcpu.org commit 4855f2bd91b6e3461af7d795bfe9a40420122131 Author: Christophe JAILLET Date: Thu Apr 9 12:12:26 2020 +0200 clocksource: davinci: axe a pointless __GFP_NOFAIL There is no need to specify __GFP_NOFAIL when allocating memory here, so axe it. Signed-off-by: Christophe JAILLET Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200409101226.15432-1-christophe.jaillet@wanadoo.fr commit bdf8783c0dae9d3d8fc1c4078fe849ab8aa8b583 Author: Christophe JAILLET Date: Thu Apr 9 11:25:43 2020 +0200 clocksource/drivers/davinci: Avoid trailing '\n' hidden in pr_fmt() pr_xxx() functions usually have '\n' at the end of the logging message. Here, this '\n' is added via the 'pr_fmt' macro. In order to be more consistent with other files, use a more standard convention and put these '\n' back in the messages themselves and remove it from the pr_fmt macro. While at it, remove a useless message in case of 'kzalloc' failure, especially with a __GFP_NOFAIL flag. Signed-off-by: Christophe JAILLET Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200409092543.14727-1-christophe.jaillet@wanadoo.fr commit b22b51a0346ed64b781122a4db3824cd400e9f57 Author: Thomas Zimmermann Date: Tue Mar 31 10:12:38 2020 +0200 drm/vram-helpers: Merge code into a single file Most of the documentation was in an otherwise empty file, which was probably just left from a previous clean-up effort. So move code and documentation into a single file. Signed-off-by: Thomas Zimmermann Acked-by: Gerd Hoffmann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200331081238.24749-1-tzimmermann@suse.de commit d7b001d852cd805e5c23374eccba4b3e19568051 Author: Thomas Zimmermann Date: Tue Mar 31 11:27:40 2020 +0200 drm/vram-helpers: Set plane fence for display update Calling the VRAM helper's prepare_fb() helper now sets the plane's fence object. This will be useful for PRIME support. VRAM helpers don't support buffer sharing ATM, so for now there are no drivers requiring this change. v2: * removed a TODO comment about buffer synchronization Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200331092740.29282-1-tzimmermann@suse.de commit 8e334c1d89d2e9d367717fbf6008b046c445a1c6 Author: Chris Wilson Date: Wed Apr 8 22:24:07 2020 +0100 drm: Don't return 0 from a void drm_fbdev_generic_setup drm_fbdev_generic_setup() was changed to be a void return, but the stub was left returning 0. ./include/drm/drm_fb_helper.h: In function ‘drm_fbdev_generic_setup’: ./include/drm/drm_fb_helper.h:450:9: warning: ‘return’ with a value, in function returning void [-Wreturn-type] ./include/drm/drm_fb_helper.h:448:1: note: declared here 448 | drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp) Fixes: 1aed9509b29a ("drm/fb-helper: Remove return value from drm_fbdev_generic_setup()") Signed-off-by: Chris Wilson Cc: Thomas Zimmermann Cc: Sam Ravnborg Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200408212407.4309-1-chris@chris-wilson.co.uk commit 53dd7028dc3901d9c16c9f3b68037263924e958a Author: Matthew Auld Date: Wed Apr 8 18:04:56 2020 +0100 drm/i915/evict: watch out for unevictable nodes In an address space there can be sprinkling of I915_COLOR_UNEVICTABLE nodes, which lack a parent vma. For platforms with cache coloring we might be very unlucky and abut with such a node thinking we can simply unbind the vma. Signed-off-by: Matthew Auld Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200408170456.399604-1-matthew.auld@intel.com commit 963518c12431b6b114401a3ac763d10037b7d1e0 Author: David Lu Date: Tue Mar 24 15:57:34 2020 +0800 drm/panel: support for boe,tv105wum-nw0 dsi video mode panel Add entries for BOE TV105WUM-NW0 10.5" WUXGA TFT LCD panel. Signed-off-by: David Lu Reviewed-by: Nicolas Boichat Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200324075734.1802-1-david.lu@bitland.com.cn commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9 Author: Sonny Sasaka Date: Mon Apr 6 11:04:02 2020 -0700 Bluetooth: Always request for user confirmation for Just Works (LE SC) To improve security, always give the user-space daemon a chance to accept or reject a Just Works pairing (LE). The daemon may decide to auto-accept based on the user's intent. This patch is similar to the previous patch but applies for LE Secure Connections (SC). Signed-off-by: Sonny Sasaka Signed-off-by: Marcel Holtmann commit 828f138c499b209e6e077f9c9a9318c0f3b68bb2 Author: David Lu Date: Tue Mar 24 17:45:25 2020 +0800 dt-bindings: boe, tv101wum-n16: Add compatible for boe tv105wum-nw0. Add bindings documentation for BOE TV105WUM-NW0 10.5" WUXGA TFT LCD panel. Signed-off-by: David Lu Acked-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200324094525.4758-1-david.lu@bitland.com.cn commit 3f6c93ec9254b387ad7f8706c32c9d529ac9796e Author: Arnd Bergmann Date: Wed Apr 8 18:25:38 2020 +0200 fbdev: mx3fb: avoid warning about psABI change The arm64 gcc-9 release warns about a change in the calling conventions: drivers/video/fbdev/mx3fb.c: In function 'sdc_init_panel': drivers/video/fbdev/mx3fb.c:506:12: note: parameter passing for argument of type 'struct ipu_di_signal_cfg' changed in GCC 9.1 506 | static int sdc_init_panel(struct mx3fb_data *mx3fb, enum ipu_panel panel, | ^~~~~~~~~~~~~~ drivers/video/fbdev/mx3fb.c: In function '__set_par': drivers/video/fbdev/mx3fb.c:848:7: note: parameter passing for argument of type 'struct ipu_di_signal_cfg' changed in GCC 9.1 Change the file to just pass the struct by reference, which is unambiguous and avoids the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408162551.3928330-1-arnd@arndb.de commit 1aed9509b29a6a3989f981247efaed422d89a010 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:41 2020 +0200 drm/fb-helper: Remove return value from drm_fbdev_generic_setup() Generic fbdev emulation is a DRM client. Drivers should invoke the setup function, but not depend on its success. Hence remove the return value. v3: * document stricter requirements for call sequence v2: * warn if fbdev device has not been registered yet * document the new behavior * convert the existing warning to the new dev_ interface Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-11-tzimmermann@suse.de commit 3662cd199266a95b3d649bbe6054094c610817fe Author: Thomas Zimmermann Date: Wed Apr 8 10:26:40 2020 +0200 drm/vboxvideo: Set up fbdev after registering device; remove error checks Generic fbdev support is a DRM client. Set it up after registering the new DRM device. Remove the error checks as the driver's probe function should not depend on a DRM client's state. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-10-tzimmermann@suse.de commit 66459fa21dfe79ae95c1d685b21a214142046d96 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:39 2020 +0200 drm/udl: Remove error check from fbdev setup Remove the error check from the fbdev setup function. The driver's probe function should not depend on a DRM client's state. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-9-tzimmermann@suse.de commit f5ef076215df639d4eeead734a741cabc88dbc73 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:38 2020 +0200 drm/tilcdc: Set up fbdev after fully registering device Generic fbdev support is a DRM client. Set it up after fully registering the new DRM device. Signed-off-by: Thomas Zimmermann Acked-by: Jyri Sarha Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-8-tzimmermann@suse.de commit fc54048a4dc21208e16a7fcf80f18f82c9076881 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:37 2020 +0200 drm/mgag200: Set up fbdev after registering device; remove error checks Generic fbdev support is a DRM client. Set it up after registering the new DRM device. Remove the error checks as the driver's probe function should not depend on a DRM client's state. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-7-tzimmermann@suse.de commit c05ca218162de8b112eba68bf114d1f86ba0c3b3 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:36 2020 +0200 drm/mediatek: Remove error check from fbdev setup Remove the error check from the fbdev setup function. The function will print a warning. v2: * fix subject line Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-6-tzimmermann@suse.de commit 38d356c7fe7fd41be65f12813dc2998d5665ef11 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:35 2020 +0200 drm/ingenic: Remove error check from fbdev setup Remove the error check from the fbdev setup function. The function will print a warning. Signed-off-by: Thomas Zimmermann Reviewed-by: Paul Cercueil Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-5-tzimmermann@suse.de commit e883a82b69a01f541b15599bb6ce8397a9912b0e Author: Thomas Zimmermann Date: Wed Apr 8 10:26:34 2020 +0200 drm/kirin: Set up fbdev after fully registering device Generic fbdev support is a DRM client. Set it up after fully registering the new DRM device. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-4-tzimmermann@suse.de commit 1a2b3335077f762e4116caf50e33189a33ee99e9 Author: Thomas Zimmermann Date: Wed Apr 8 10:26:33 2020 +0200 drm/hibmc: Remove error check from fbdev setup Generic fbdev support is a DRM client. Remove the error check as the driver's probe function should not depend on a DRM client's state. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-3-tzimmermann@suse.de commit a4cbf268afee2b292359dc7af939ebcfc0694c9d Author: Thomas Zimmermann Date: Wed Apr 8 10:26:32 2020 +0200 drm/ast: Set up fbdev after registering device; remove error checks Generic fbdev support is a DRM client. Set it up after registering the new DRM device. Remove the error checks as the driver's probe function should not depend on a DRM client's state. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-2-tzimmermann@suse.de commit 3dba4e16794a7936eca25af80bc1e154c57e2a12 Author: Huang Rui Date: Tue Apr 7 17:12:53 2020 +0800 drm/ttm: clean up ttm_trace_dma_map/ttm_trace_dma_unmap (v2) ttm_trace_dma_map/ttm_trace_dma_unmap is never used anymore. v2: remove the file completely Signed-off-by: Huang Rui Signed-off-by: Christian König Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/360432/ commit 8cdf727119289db3a98835662eb28e1c5ad835f1 Author: Animesh Manna Date: Mon Mar 16 16:07:59 2020 +0530 drm/i915/dp: Program vswing, pre-emphasis, test-pattern This patch process phy compliance request by programming requested vswing, pre-emphasis and test pattern. v1: Initial patch. v2: Fixes added during testing with test-scope. (Khaled/Clint/Manasi) - pipe used as argument during registers programming instead of port. - TRANS_CONF must be disable/enable as well during ddi disable/enable. - harcoded PLTPAT 80 bit custom pattern as the DPR-100 does not set it in the sink’s DPCDs - TRANS_DDI_FUNC_CTL DDI_Select (Bits 27:30) need to reset/set during disable/enable. v3: used macros instead of numbers and some cosmetic changes. [Manasi] Cc: Clinton Taylor Cc: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Khaled Almahallawy Reviewed-by: Manasi Navare Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-8-animesh.manna@intel.com commit fce214aea8e061ba99aee9c85c3df437c2e72364 Author: Animesh Manna Date: Tue Mar 24 10:41:11 2020 +0530 drm/i915/dp: Register definition for DP compliance register DP_COMP_CTL and DP_COMP_PAT register used to program DP compliance pattern. v1: Initial patch. v2: used pipe instead of port in macro definition. [Manasi] v3: used trans_offset for offset calculation. [Manasi] v4: Used MMIO_PIPE for evenly spaced register offset instead MMIO_PIPE2. [Ville] Reviewed-by: Manasi Navare Signed-off-by: Animesh Manna Reviewed-by: Manasi Navare Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200324051111.29398-1-animesh.manna@intel.com commit 75947e39f3d94fb7884a70cd07dd9bdcb1a0f973 Author: Animesh Manna Date: Mon Mar 16 16:07:57 2020 +0530 drm/i915/dp: Add debugfs entry for DP phy compliance These debugfs entry will help testapp to understand the test request during dp phy compliance mode. Reviewed-by: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-6-animesh.manna@intel.com commit 88afbfdbfda88fd07f01f1ba1731b090f32a5a3f Author: Animesh Manna Date: Mon Mar 16 16:07:56 2020 +0530 drm/i915/dp: Preparation for DP phy compliance auto test During DP phy compliance auto test mode, sink will request combination of different test pattern with differnt level of vswing, pre-emphasis. Function added to prepare for it. Reviewed-by: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-5-animesh.manna@intel.com commit 5d1453d529addd0dc146b1954f07a58c4b15943a Author: Animesh Manna Date: Mon Mar 16 16:07:55 2020 +0530 drm/i915/dp: Made intel_dp_adjust_train() non-static vswing/pre-emphasis adjustment calculation is needed in processing of auto phy compliance request other than link training, so have made non-static function. No functional change. v1: initial patch. v2: - used "intel_dp" prefix in function name. (Jani) - used array notation instead pointer for link_status. (Ville) v3: Scrapped the initial patch, modified commit description accordingly. - made non-static function and used intel_dp prefix. (Jani, Manasi) Reviewed-by: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-4-animesh.manna@intel.com commit 4342f839ae7e6117977c9e867a49645cc7625c5a Author: Animesh Manna Date: Mon Mar 16 16:07:54 2020 +0530 drm/dp: get/set phy compliance pattern During phy compliance auto test mode source need to read requested test pattern from sink through DPCD. After processing the request source need to set the pattern. So set/get method added in drm layer as it is DP protocol. v2: As per review feedback from Manasi on RFC version, - added dp revision as function argument in set_phy_pattern api. - used int for link_rate and u8 for lane_count to align with existing code. v3: As per review feedback from Harry, - used sizeof() instead of magic number. - corrected kernel-doc for drm_dp_phy_test_params structure. Reviewed-by: Harry Wentland Reviewed-by: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-3-animesh.manna@intel.com commit 8811d9eb4dfa6ce6fbbb8dabcec1e049f3e03329 Author: Animesh Manna Date: Mon Mar 16 16:07:53 2020 +0530 drm/amd/display: Align macro name as per DP spec [Why]: Aligh with DP spec wanted to follow same naming convention. [How]: Changed the macro name of the dpcd address used for getting requested test-pattern. Cc: Harry Wentland Cc: Alex Deucher Reviewed-by: Harry Wentland Reviewed-by: Manasi Navare Signed-off-by: Animesh Manna Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-2-animesh.manna@intel.com commit fbaa1229d354b05fd8156b1ec1a0c00f084f4324 Author: Chris Wilson Date: Wed Apr 8 10:17:23 2020 +0100 drm/i915/selftests: Take an explicit ref for rq->batch Since we are peeking into the batch object of the request, it is beholden on us to hold a reference to it. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1634 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200408091723.28937-1-chris@chris-wilson.co.uk commit dd345efe8aa48656610db7f7a3ab8d906434db44 Author: Chris Wilson Date: Wed Apr 8 10:29:16 2020 +0100 drm/i915/gt: Mark up racy check of breadcrumb irq enabled We control b->irq_enabled inside the b->irq_lock, but we check before entering the spinlock whether or not the interrupt is currently unmasked. [ 1511.735208] BUG: KCSAN: data-race in __intel_breadcrumbs_disarm_irq [i915] / intel_engine_disarm_breadcrumbs [i915] [ 1511.735231] [ 1511.735242] write to 0xffff8881f75fc214 of 1 bytes by interrupt on cpu 2: [ 1511.735440] __intel_breadcrumbs_disarm_irq+0x4b/0x160 [i915] [ 1511.735635] signal_irq_work+0x337/0x710 [i915] [ 1511.735652] irq_work_run_list+0xd7/0x110 [ 1511.735666] irq_work_run+0x1d/0x50 [ 1511.735681] smp_irq_work_interrupt+0x21/0x30 [ 1511.735701] irq_work_interrupt+0xf/0x20 [ 1511.735722] __do_softirq+0x6f/0x206 [ 1511.735736] irq_exit+0xcd/0xe0 [ 1511.735756] do_IRQ+0x44/0xc0 [ 1511.735773] ret_from_intr+0x0/0x1c [ 1511.735787] schedule+0x0/0xb0 [ 1511.735803] worker_thread+0x194/0x670 [ 1511.735823] kthread+0x19a/0x1e0 [ 1511.735837] ret_from_fork+0x1f/0x30 [ 1511.735848] [ 1511.735867] read to 0xffff8881f75fc214 of 1 bytes by task 432 on cpu 1: [ 1511.736068] intel_engine_disarm_breadcrumbs+0x22/0x80 [i915] [ 1511.736263] __engine_park+0x107/0x5d0 [i915] [ 1511.736453] ____intel_wakeref_put_last+0x44/0x90 [i915] [ 1511.736648] __intel_wakeref_put_last+0x5a/0x70 [i915] [ 1511.736842] intel_context_exit_engine+0xf2/0x100 [i915] [ 1511.737044] i915_request_retire+0x6b2/0x770 [i915] [ 1511.737244] retire_requests+0x7a/0xd0 [i915] [ 1511.737438] intel_gt_retire_requests_timeout+0x3a7/0x6f0 [i915] [ 1511.737633] i915_drop_caches_set+0x1e7/0x260 [i915] [ 1511.737650] simple_attr_write+0xfa/0x110 [ 1511.737665] full_proxy_write+0x94/0xc0 [ 1511.737679] __vfs_write+0x4b/0x90 [ 1511.737697] vfs_write+0xfc/0x280 [ 1511.737718] ksys_write+0x78/0x100 [ 1511.737732] __x64_sys_write+0x44/0x60 [ 1511.737751] do_syscall_64+0x6e/0x2c0 [ 1511.737769] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200408092916.5355-1-chris@chris-wilson.co.uk commit 32a55a109f260d856d0cbca357ab133350040c23 Author: Chris Wilson Date: Tue Apr 7 23:18:32 2020 +0100 drm/i915/gt: Mark up racy read of intel_ring.head The intel_ring.head is updated as the requests are retired, but is sampled at any time as we submit requests. Furthermore, it tracks RING_HEAD which is inherently asynchronous. [ 148.630314] BUG: KCSAN: data-race in execlists_dequeue [i915] / i915_request_retire [i915] [ 148.630349] [ 148.630374] write to 0xffff8881f4e28ddc of 4 bytes by task 90 on cpu 2: [ 148.630752] i915_request_retire+0xed/0x770 [i915] [ 148.631123] retire_requests+0x7a/0xd0 [i915] [ 148.631491] engine_retire+0xa6/0xe0 [i915] [ 148.631523] process_one_work+0x3af/0x640 [ 148.631552] worker_thread+0x80/0x670 [ 148.631581] kthread+0x19a/0x1e0 [ 148.631609] ret_from_fork+0x1f/0x30 [ 148.631629] [ 148.631652] read to 0xffff8881f4e28ddc of 4 bytes by task 14288 on cpu 3: [ 148.632019] execlists_dequeue+0x1300/0x1680 [i915] [ 148.632384] __execlists_submission_tasklet+0x48/0x60 [i915] [ 148.632770] execlists_submit_request+0x38e/0x3c0 [i915] [ 148.633146] submit_notify+0x8f/0xc0 [i915] [ 148.633512] __i915_sw_fence_complete+0x5d/0x3e0 [i915] [ 148.633875] i915_sw_fence_complete+0x58/0x80 [i915] [ 148.634238] i915_sw_fence_commit+0x16/0x20 [i915] [ 148.634613] __i915_request_queue+0x60/0x70 [i915] [ 148.634985] i915_gem_do_execbuffer+0x2de0/0x42b0 [i915] [ 148.635366] i915_gem_execbuffer2_ioctl+0x2ab/0x580 [i915] [ 148.635400] drm_ioctl_kernel+0xe9/0x130 [ 148.635429] drm_ioctl+0x27d/0x45e [ 148.635456] ksys_ioctl+0x89/0xb0 [ 148.635482] __x64_sys_ioctl+0x42/0x60 [ 148.635510] do_syscall_64+0x6e/0x2c0 [ 148.635542] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 645.071436] BUG: KCSAN: data-race in gen8_emit_fini_breadcrumb [i915] / i915_request_retire [i915] [ 645.071456] [ 645.071467] write to 0xffff8881efe403dc of 4 bytes by task 14668 on cpu 3: [ 645.071647] i915_request_retire+0xed/0x770 [i915] [ 645.071824] i915_request_create+0x6c/0x160 [i915] [ 645.072000] i915_gem_do_execbuffer+0x206d/0x42b0 [i915] [ 645.072177] i915_gem_execbuffer2_ioctl+0x2ab/0x580 [i915] [ 645.072194] drm_ioctl_kernel+0xe9/0x130 [ 645.072208] drm_ioctl+0x27d/0x45e [ 645.072222] ksys_ioctl+0x89/0xb0 [ 645.072235] __x64_sys_ioctl+0x42/0x60 [ 645.072248] do_syscall_64+0x6e/0x2c0 [ 645.072263] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 645.072275] [ 645.072285] read to 0xffff8881efe403dc of 4 bytes by interrupt on cpu 2: [ 645.072458] gen8_emit_fini_breadcrumb+0x158/0x300 [i915] [ 645.072636] __i915_request_submit+0x204/0x430 [i915] [ 645.072809] execlists_dequeue+0x8e1/0x1680 [i915] [ 645.072982] __execlists_submission_tasklet+0x48/0x60 [i915] [ 645.073154] execlists_submit_request+0x38e/0x3c0 [i915] [ 645.073330] submit_notify+0x8f/0xc0 [i915] [ 645.073499] __i915_sw_fence_complete+0x5d/0x3e0 [i915] [ 645.073668] i915_sw_fence_wake+0xc2/0x130 [i915] [ 645.073836] __i915_sw_fence_complete+0x2cf/0x3e0 [i915] [ 645.074006] i915_sw_fence_complete+0x58/0x80 [i915] [ 645.074175] dma_i915_sw_fence_wake+0x3e/0x80 [i915] [ 645.074344] signal_irq_work+0x62f/0x710 [i915] [ 645.074360] irq_work_run_list+0xd7/0x110 [ 645.074373] irq_work_run+0x1d/0x50 [ 645.074386] smp_irq_work_interrupt+0x21/0x30 [ 645.074400] irq_work_interrupt+0xf/0x20 [ 645.074414] _raw_spin_unlock_irqrestore+0x34/0x40 [ 645.074585] execlists_submission_tasklet+0xde/0x170 [i915] [ 645.074602] tasklet_action_common.isra.0+0x42/0x90 [ 645.074617] __do_softirq+0xc8/0x206 [ 645.074629] irq_exit+0xcd/0xe0 [ 645.074642] do_IRQ+0x44/0xc0 [ 645.074654] ret_from_intr+0x0/0x1c [ 645.074667] finish_task_switch+0x73/0x230 [ 645.074679] __schedule+0x1c5/0x4c0 [ 645.074691] schedule+0x45/0xb0 [ 645.074704] worker_thread+0x194/0x670 [ 645.074716] kthread+0x19a/0x1e0 [ 645.074729] ret_from_fork+0x1f/0x30 Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200407221832.15465-1-chris@chris-wilson.co.uk commit c27c6bd2c4d6b6bb779f9b722d5607993e1d5e5c Author: John Johansen Date: Mon Mar 30 23:37:54 2020 -0700 apparmor: ensure that dfa state tables have entries Currently it is possible to specify a state machine table with 0 length, this is not valid as optional tables are specified by not defining the table as present. Further this allows by-passing the base tables range check against the next/check tables. Fixes: d901d6a298dc ("apparmor: dfa split verification of table headers") Reported-by: Mike Salvatore Signed-off-by: John Johansen commit 16b4511d836c7228cd0f59e5b43d52c9d9bcc68f Author: Paul Cercueil Date: Wed Apr 8 11:58:30 2020 +0200 drm/panel: nt39016: Add support for 50 Hz refresh rate By changing the pixel clock and the length of the back porch, it is possible to obtain a perfect 50 Hz refresh rate. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200408095830.8131-2-paul@crapouillou.net Acked-by: Sam Ravnborg commit fa361758b109aa7a4ce309fbd1adba2d9d76a197 Author: Paul Cercueil Date: Wed Apr 8 11:58:29 2020 +0200 drm/panel: nt39016: Add support for multiple modes Add support for multiple drm_display_mode entries. This will allow to add a 50 Hz mode later. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200408095830.8131-1-paul@crapouillou.net Acked-by: Sam Ravnborg commit 4381bbd856d2cc481428fcad732854a92e6d3639 Author: Jani Nikula Date: Thu Apr 2 14:48:19 2020 +0300 drm/i915/uc: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-17-jani.nikula@intel.com commit dc483ba501a5a72b8afbdc2f943a5c223bee6c1a Author: Jani Nikula Date: Thu Apr 2 14:48:18 2020 +0300 drm/i915/gt: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-16-jani.nikula@intel.com commit dd1ba6ba09d17cb96e94a729cf836b208f901119 Author: Jani Nikula Date: Thu Apr 2 14:48:17 2020 +0300 drm/i915/stolen: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-15-jani.nikula@intel.com commit 19b5b50f344adebfbbae7bd25a127e047bec42bf Author: Jani Nikula Date: Thu Apr 2 14:48:16 2020 +0300 drm/i915/uncore: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-14-jani.nikula@intel.com commit 225ffaa8209b517b5ffe51b130cb490a8ae18fa1 Author: Jani Nikula Date: Thu Apr 2 14:48:15 2020 +0300 drm/i915/dram: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-13-jani.nikula@intel.com commit 1900aba56787d85616bcbe0ebd4c6efd38a226c1 Author: Jani Nikula Date: Thu Apr 2 14:48:14 2020 +0300 drm/i915/pmu: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-12-jani.nikula@intel.com commit 58f44aadd365087efdd47444b4caaabf3ff823da Author: Jani Nikula Date: Thu Apr 2 14:48:13 2020 +0300 drm/i915/error: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-11-jani.nikula@intel.com commit 61d5c507e93dda681b135c8fa694b8d56c816ba5 Author: Jani Nikula Date: Thu Apr 2 14:48:12 2020 +0300 drm/i915/uc: prefer struct drm_device based logging Prefer struct drm_device based logging over struct device based logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-10-jani.nikula@intel.com commit f54efb6ad0332204d212594837404c616064e902 Author: Jani Nikula Date: Thu Apr 2 14:48:11 2020 +0300 drm/i915/switcheroo: use struct drm_device based logging Convert all the pr_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-9-jani.nikula@intel.com commit 9b5d45b175c05ea7192126409848ab1cf9535013 Author: Jani Nikula Date: Thu Apr 2 14:48:10 2020 +0300 drm/i915/state: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-8-jani.nikula@intel.com commit c3f81563ec8519ab838ad0a8940a6d84d7376e25 Author: Jani Nikula Date: Thu Apr 2 14:48:09 2020 +0300 drm/i915/bw: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-7-jani.nikula@intel.com commit 59cbc8eca958d43a97f933e8249ffbe17107ba8f Author: Jani Nikula Date: Thu Apr 2 14:48:08 2020 +0300 drm/i915/debugfs: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-6-jani.nikula@intel.com commit d518a20b7f5d00e45a0d3f8768558f5c75e7389f Author: Jani Nikula Date: Thu Apr 2 14:48:07 2020 +0300 drm/i915/crt: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-5-jani.nikula@intel.com commit af67009c143918974e0348c8165e729e47c351a2 Author: Jani Nikula Date: Thu Apr 2 14:48:06 2020 +0300 drm/i915/dp: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-4-jani.nikula@intel.com commit 0383443d89bb321022ce96326a0a81ac7614ca11 Author: Jani Nikula Date: Thu Apr 2 14:48:05 2020 +0300 drm/i915/tc: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-3-jani.nikula@intel.com commit 2b3c472cc311db88ce4d703780fa5fe58a599d47 Author: Jani Nikula Date: Thu Apr 2 14:48:04 2020 +0300 drm/i915/panel: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-2-jani.nikula@intel.com commit 9282a66ceebe9dbff24d00e3968dd9fc353e169e Author: Jani Nikula Date: Thu Apr 2 14:48:03 2020 +0300 drm/i915/audio: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-1-jani.nikula@intel.com commit 465b1e058a22ef7de3b0688de1bd91466e792834 Author: Jason Yan Date: Fri Apr 3 10:25:53 2020 +0800 video: fbdev: mb862xx: remove set but not used variable 'mdr' Fix the following gcc warning: drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:187:6: warning: variable ‘mdr’ set but not used [-Wunused-but-set-variable] int mdr; ^~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403022553.33320-1-yanaijie@huawei.com commit 7b987887f97b9fdbc5fa4774ff973158266d834c Author: Jason Yan Date: Fri Apr 3 10:16:09 2020 +0800 video: fbdev: matroxfb: remove dead code and set but not used variable Fix the following gcc warning: drivers/video/fbdev/matrox/g450_pll.c:336:15: warning: variable ‘pixel_vco’ set but not used [-Wunused-but-set-variable] unsigned int pixel_vco; ^~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403021609.20968-1-yanaijie@huawei.com commit 6ea4383b9214c7b2134948999c5d0088723be79a Author: Heiko Stuebner Date: Wed Apr 8 10:53:17 2020 +0200 drm/panel: add panel driver for Leadtek LTK050H3146W The LTK050H3146W is 5.0" 720x1280 DSI display. There are two variants with essentially the same name, LTK050H3146W and LTK050H3146W-A2. They differ in their init sequence and mode details. changes in v2: - add display variants changes in v3: - fixed indentation and artifacts found by Sam Signed-off-by: Heiko Stuebner Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200408085317.2624599-2-heiko@sntech.de commit 17434fbaa972d43ad786ecb836c9712f729f78da Author: Heiko Stuebner Date: Wed Apr 8 01:23:50 2020 +0200 dt-bindings: display: panel: Add binding document for Leadtek LTK050H3146W The LTK050H3146W is a 5.0" 720x1280 DSI display. changes in v2: - add display variants Signed-off-by: Heiko Stuebner Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200407232351.2547750-1-heiko@sntech.de commit 0706cd0f94d4d8dd71fad7f70dcbf19d514391ef Author: Johan Jonker Date: Fri Apr 3 16:22:35 2020 +0200 dt-bindings: display: rockchip-vop: add additional properties In the old txt situation we add/describe only properties that are used by the driver/hardware itself. With yaml it also filters things in a node that are used by other drivers like 'assigned-clocks' and 'assigned-clock-rates' for rk3399 and 'power-domains' for most Rockchip Socs in 'vop' nodes, so add them to 'rockchip-vop.yaml'. Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403142235.8870-2-jbx6244@gmail.com commit 4e78ba278722480fa1fa933caa6ff24a53b441c8 Author: Johan Jonker Date: Fri Apr 3 16:22:34 2020 +0200 dt-bindings: display: convert rockchip vop bindings to yaml Current dts files with 'vop' nodes are manually verified. In order to automate this process rockchip-vop.txt has to be converted to yaml. Signed-off-by: Johan Jonker Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403142235.8870-1-jbx6244@gmail.com commit cf4c826d96da8784a711c4bf84d656a93c1280bf Author: Chris Wilson Date: Tue Apr 7 23:26:25 2020 +0100 drm/i915/selftests: Drop vestigal timeslicing assert Since the semaphore interrupt may cause us to yield the timeslice immediately, we may cancel the timer before we notice the submission is complete. The assertion is no longer valid due to the race with the interrupt. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200407222625.15542-1-chris@chris-wilson.co.uk commit fcd156ee8bc6a989dbf7e5efbccdc9cdb831fd27 Author: Sathish Narasimman Date: Wed Apr 8 10:57:03 2020 +0530 Bluetooth: btusb: check for NULL in btusb_find_altsetting() The new btusb_find_altsetting() dereferences it without checking the check is added in this patch Signed-off-by: Sathish Narasimman Signed-off-by: Marcel Holtmann commit 95caa2ae70fdbf626335700d24400f47c12825ee Author: Michał Mirosław Date: Sat Apr 4 02:00:06 2020 +0200 usb: chipidea: allow disabling glue drivers if EMBEDDED Allow to cut down on driver size for embedded config. Signed-off-by: Michał Mirosław Signed-off-by: Peter Chen commit 1c16f63d1e6c9405d4e6f018c3cc33389adb1f22 Author: Michał Mirosław Date: Sat Apr 4 02:00:06 2020 +0200 usb: chipidea: usb2: absorb zevio glue driver ZEVIO glue code is is identical to generic binding now, but doesn't enable runtime PM. Let's squash the driver and get runtime PM for free. Signed-off-by: Michał Mirosław Signed-off-by: Peter Chen commit c2de37b31f178c4a4164751e9fef19acd3ceb913 Author: Michał Mirosław Date: Sat Apr 4 02:00:05 2020 +0200 usb: chipidea: usb2: make clock optional Allow clock to be missing from DT (assume it's enabled then). Signed-off-by: Michał Mirosław Signed-off-by: Peter Chen commit 8b93527071a81425532c1b22067f6201e51c7b7d Author: Michał Mirosław Date: Sat Apr 4 02:00:05 2020 +0200 usb: chipidea: usb2: fix formatting Add spaces before closing braces. Signed-off-by: Michał Mirosław Signed-off-by: Peter Chen commit fc228ef6397de633703ac671e6eb020913de6918 Author: Michał Mirosław Date: Sat Apr 4 01:59:58 2020 +0200 usb: chipidea: usb2: constify zynq_pdata pdata is copied anyway to allow setting device name. Make the source const. Signed-off-by: Michał Mirosław Signed-off-by: Peter Chen commit 7fd9681e8fd0998a1b1f0491783d000e776b9c85 Author: Jagan Teki Date: Fri Apr 3 19:54:53 2020 +0530 MAINTAINERS: Update feiyang,st7701 panel bindings converted as YAML The feiyang,fy07024di26a30d.txt and sitronix,st7701.txt has been converted to YAML schemas, update MAINTAINERS to match them again. Signed-off-by: Jagan Teki Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403142453.25307-3-jagan@amarulasolutions.com commit dfa10dfcde8f2bdaa2874a8868d36c1be31352e2 Author: Jagan Teki Date: Fri Apr 3 19:54:52 2020 +0530 dt-bindings: display: panel: Convert sitronix,st7701 to DT schema Convert the sitronix,st7701 panel bindings to DT schema. Signed-off-by: Jagan Teki Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403142453.25307-2-jagan@amarulasolutions.com commit 91b21a669f182cbcb796134102822195dfcb1979 Author: Jagan Teki Date: Fri Apr 3 19:54:51 2020 +0530 dt-bindings: display: panel: Convert feiyang,fy07024di26a30d to DT schema Convert the feiyang,fy07024di26a30d panel bindings to DT schema. Signed-off-by: Jagan Teki Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403142453.25307-1-jagan@amarulasolutions.com commit 43ea4d090509de46e3ad7688560743dcad05d329 Author: Jules Irenge Date: Fri Apr 3 17:05:02 2020 +0100 video: Add missing annotation for cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() Sparse reports warnings at cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() warning: context imbalance in cyber2000fb_enable_ddc() - wrong count at exit warning: context imbalance in cyber2000fb_disable_ddc() - unexpected unlock The root cause is the missing annotation at cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() Add the missing __acquires(&cfb->reg_b0_lock) annotation Add the missing __releases(&cfb->reg_b0_lock) annotation Signed-off-by: Jules Irenge Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403160505.2832-3-jbi.octave@gmail.com commit 71c45008e2b0d68bbcdd658cb5ab632b2aa433f7 Author: Markus Elfring Date: Sun Apr 5 11:25:30 2020 +0200 drm/ingenic: Delete an error message in ingenic_drm_probe() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/e03e7106-0f22-99c4-ad21-b288e8990b5a@web.de commit 20c22ad3295766b9a7f6da29b3620f570993c2f3 Author: Lyude Paul Date: Mon Apr 6 16:06:42 2020 -0400 drm/dp_mst: Remove drm_dp_mst_has_audio() Drive-by fix I noticed the other day - drm_dp_mst_has_audio() only ever made sense back when we still had to validate ports before accessing them in order to (attempt to) avoid NULL dereferences. Since we have proper reference counting that guarantees we always can safely access the MST port, there's no use in keeping this function around as all it does is validate the port pointer before checking the audio status. Note - drm_dp_mst_port->has_audio is technically protected by drm_device->mode_config.connection_mutex, since it's only ever updated from drm_dp_mst_get_edid(). Additionally, we change the declaration for port in struct intel_connector to be properly typed, so we can directly access it. Changes since v1: * Change type of intel_connector->port in a separate patch - Sean Paul Cc: "Lee, Shawn C" Reviewed-by: Sean Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200406200646.1263435-2-lyude@redhat.com commit 75727b30809266decfe21ed1143ef5cfd27bac89 Author: Lyude Paul Date: Mon Apr 6 16:06:41 2020 -0400 drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port The only reason for having this cast as void * before was because we originally needed to use drm_dp_mst_get_port_validated() and friends in order to (attempt to) safely access MST ports. However, we've since improved how reference counting works with ports and mstbs such that we can now rely on drm_dp_mst_port structs remaining in memory for as long as the driver needs. This means we don't really need to cast this as void* anymore, and can just access the struct directly. We'll also need this for the next commit, so that we can remove drm_dp_mst_port_has_audio(). Signed-off-by: Lyude Paul Reviewed-by: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200406200646.1263435-1-lyude@redhat.com commit 7606662686154d28d53b5acd41fc8678aefaec71 Author: Tang Bin Date: Mon Apr 6 13:34:50 2020 +0800 video: fbdev: don't print error message on platform_get_irq() failure The platform_get_irq() can print error message, so remove the redundant dev_err() here. Signed-off-by: Tang Bin Acked-by: Nicolas Ferre Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200406053450.8380-1-tangbin@cmss.chinamobile.com commit d1d900f822b6b2874de9c1ef8094fc8df56a2f9f Author: Guenter Roeck Date: Mon Apr 6 11:54:38 2020 -0700 Bluetooth: Simplify / fix return values from tk_request Some static checker run by 0day reports a variableScope warning. net/bluetooth/smp.c:870:6: warning: The scope of the variable 'err' can be reduced. [variableScope] There is no need for two separate variables holding return values. Stick with the existing variable. While at it, don't pre-initialize 'ret' because it is set in each code path. tk_request() is supposed to return a negative error code on errors, not a bluetooth return code. The calling code converts the return value to SMP_UNSPECIFIED if needed. Fixes: 92516cd97fd4 ("Bluetooth: Always request for user confirmation for Just Works") Cc: Sonny Sasaka Signed-off-by: Guenter Roeck Reviewed-by: Sonny Sasaka Signed-off-by: Sonny Sasaka Signed-off-by: Marcel Holtmann commit 56b165feaf9bf0e3111d814bad0e4a2e11231a9e Author: Sam Ravnborg Date: Mon Apr 6 21:47:44 2020 +0200 drm/vblank: Add intro to documentation Lyude Paul wrote a very good intro to vblank here: https://lore.kernel.org/dri-devel/faf63d8a9ed23c16af69762f59d0dca6b2bf085f.camel@redhat.com/T/#mce6480be738160e9d07c5d023e88fd78d7a06d27 Add this to the intro chapter in drm_vblank.c so others can benefit from it too. v2: - Reworded to improve readability (Thomas) v3: - Added nice ascii drawing from Lyude (Lyude) - Added referende to high-precision timestamp (Daniel) - Improved grammar (Thomas) - Combined it all and made kernel-doc happy - Dropped any a-b, r-b do to the amount of changes v4: - Add intro to vblank interrupt (Liviu) - Add historical reference for blanking (Alex) Signed-off-by: Sam Ravnborg Co-developed-by: Lyude Paul Reviewed-by: Lyude Paul Reviewed-by: Alex Deucher Cc: Alex Deucher Cc: Liviu Dudau Cc: Lyude Paul Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20200406194746.26433-2-sam@ravnborg.org commit c2aa30db744d9cbdde127d4ed8aeea18273834c6 Author: Archie Pusaka Date: Tue Apr 7 12:26:27 2020 +0800 Bluetooth: debugfs option to unset MITM flag The BT qualification test SM/MAS/PKE/BV-01-C needs us to turn off the MITM flag when pairing, and at the same time also set the io capability to something other than no input no output. Currently the MITM flag is only unset when the io capability is set to no input no output, therefore the test cannot be executed. This patch introduces a debugfs option to force MITM flag to be turned off. Signed-off-by: Archie Pusaka Signed-off-by: Marcel Holtmann commit e2d7fc20b3e26a738dc5161adb4279e0096d9575 Author: Sam Ravnborg Date: Mon Apr 6 21:47:46 2020 +0200 drm/writeback: wire drm_writeback.h to kernel-doc drm_writeback.h included a lot of nice kernel-doc comments. Wire it up so the header file is included in the kernel-doc generated documentation. Added a few simple comments to the two structs so they get picked up by kernel-doc. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Vetter Cc: Laurent Pinchart Cc: Brian Starkey Cc: Liviu Dudau Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20200406194746.26433-4-sam@ravnborg.org commit 21de71f6db2e1773414e387bad520e7adbf79d46 Author: Sam Ravnborg Date: Mon Apr 6 21:47:45 2020 +0200 drm: writeback: document callbacks Document the callbacks: drm_connector_helper_funcs.prepare_writeback_job drm_connector_helper_funcs.cleanup_writeback_job The documentation was pulled from the changelong introducing the callbacks, originally written by Laurent. Adding the missing documentation fixes the following warnings: drm_modeset_helper_vtables.h:1052: warning: Function parameter or member 'prepare_writeback_job' not described in 'drm_connector_helper_funcs' drm_modeset_helper_vtables.h:1052: warning: Function parameter or member 'cleanup_writeback_job' not described in 'drm_connector_helper_funcs' v2: - Fix formatting (Daniel) - Drop changelog text and add reference (Daniel) - Improve grammar. and use "operation" (Laurent) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Vetter Reviewed-by: Laurent Pinchart Reviewed-by: Liviu Dudau Cc: Laurent Pinchart Cc: Liviu Dudau Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20200406194746.26433-3-sam@ravnborg.org commit c4e8ba7390346a77ffe33ec3f210bc62e0b6c8c6 Author: Chris Wilson Date: Tue Apr 7 14:08:11 2020 +0100 drm/i915/gt: Yield the timeslice if caught waiting on a user semaphore If we find ourselves waiting on a MI_SEMAPHORE_WAIT, either within the user batch or in our own preamble, the engine raises a GT_WAIT_ON_SEMAPHORE interrupt. We can unmask that interrupt and so respond to a semaphore wait by yielding the timeslice, if we have another context to yield to! The only real complication is that the interrupt is only generated for the start of the semaphore wait, and is asynchronous to our process_csb() -- that is, we may not have registered the timeslice before we see the interrupt. To ensure we don't miss a potential semaphore blocking forward progress (e.g. selftests/live_timeslice_preempt) we mark the interrupt and apply it to the next timeslice regardless of whether it was active at the time. v2: We use semaphores in preempt-to-busy, within the timeslicing implementation itself! Ergo, when we do insert a preemption due to an expired timeslice, the new context may start with the missed semaphore flagged by the retired context and be yielded, ad infinitum. To avoid this, read the context id at the time of the semaphore interrupt and only yield if that context is still active. Fixes: 8ee36e048c98 ("drm/i915/execlists: Minimalistic timeslicing") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Kenneth Graunke Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200407130811.17321-1-chris@chris-wilson.co.uk commit e94f785642dc74faca998c8555cc783c868c3d32 Author: Chris Wilson Date: Tue Apr 7 09:59:30 2020 +0100 drm/i915/gem: Promote 'remain' to unsigned long Tidy the code by casting remain to unsigned long once for the duration of eb_relocate_vma() Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200407085930.19421-1-chris@chris-wilson.co.uk commit 2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 Author: Qiujun Huang Date: Sat Apr 4 12:18:38 2020 +0800 ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb In ath9k_hif_usb_rx_cb interface number is assumed to be 0. usb_ifnum_to_if(urb->dev, 0) But it isn't always true. The case reported by syzbot: https://lore.kernel.org/linux-usb/000000000000666c9c05a1c05d12@google.com usb 2-1: new high-speed USB device number 2 using dummy_hcd usb 2-1: config 1 has an invalid interface number: 2 but max is 0 usb 2-1: config 1 has no interface number 0 usb 2-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08 usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 general protection fault, probably for non-canonical address 0xdffffc0000000015: 0000 [#1] SMP KASAN KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0 Call Trace __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 __do_softirq+0x21e/0x950 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x178/0x1a0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 Reported-and-tested-by: syzbot+40d5d2e8a4680952f042@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200404041838.10426-6-hqjagain@gmail.com commit 19d6c375d671ce9949a864fb9a03e19f5487b4d3 Author: Qiujun Huang Date: Sat Apr 4 12:18:37 2020 +0800 ath9x: Fix stack-out-of-bounds Write in ath9k_hif_usb_rx_cb Add barrier to accessing the stack array skb_pool. The case reported by syzbot: https://lore.kernel.org/linux-usb/0000000000003d7c1505a2168418@google.com BUG: KASAN: stack-out-of-bounds in ath9k_hif_usb_rx_stream drivers/net/wireless/ath/ath9k/hif_usb.c:626 [inline] BUG: KASAN: stack-out-of-bounds in ath9k_hif_usb_rx_cb+0xdf6/0xf70 drivers/net/wireless/ath/ath9k/hif_usb.c:666 Write of size 8 at addr ffff8881db309a28 by task swapper/1/0 Call Trace: ath9k_hif_usb_rx_stream drivers/net/wireless/ath/ath9k/hif_usb.c:626 [inline] ath9k_hif_usb_rx_cb+0xdf6/0xf70 drivers/net/wireless/ath/ath9k/hif_usb.c:666 __usb_hcd_giveback_urb+0x1f2/0x470 drivers/usb/core/hcd.c:1648 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1713 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 Reported-and-tested-by: syzbot+d403396d4df67ad0bd5f@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200404041838.10426-5-hqjagain@gmail.com commit e4ff08a4d727146bb6717a39a8d399d834654345 Author: Qiujun Huang Date: Sat Apr 4 12:18:36 2020 +0800 ath9k: Fix use-after-free Write in ath9k_htc_rx_msg Write out of slab bounds. We should check epid. The case reported by syzbot: https://lore.kernel.org/linux-usb/0000000000006ac55b05a1c05d72@google.com BUG: KASAN: use-after-free in htc_process_conn_rsp drivers/net/wireless/ath/ath9k/htc_hst.c:131 [inline] BUG: KASAN: use-after-free in ath9k_htc_rx_msg+0xa25/0xaf0 drivers/net/wireless/ath/ath9k/htc_hst.c:443 Write of size 2 at addr ffff8881cea291f0 by task swapper/1/0 Call Trace: htc_process_conn_rsp drivers/net/wireless/ath/ath9k/htc_hst.c:131 [inline] ath9k_htc_rx_msg+0xa25/0xaf0 drivers/net/wireless/ath/ath9k/htc_hst.c:443 ath9k_hif_usb_reg_in_cb+0x1ba/0x630 drivers/net/wireless/ath/ath9k/hif_usb.c:718 __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 Reported-and-tested-by: syzbot+b1c61e5f11be5782f192@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200404041838.10426-4-hqjagain@gmail.com commit abeaa85054ff8cfe8b99aafc5c70ea067e5d0908 Author: Qiujun Huang Date: Sat Apr 4 12:18:35 2020 +0800 ath9k: Fix use-after-free Read in ath9k_wmi_ctrl_rx Free wmi later after cmd urb has been killed, as urb cb will access wmi. the case reported by syzbot: https://lore.kernel.org/linux-usb/0000000000000002fc05a1d61a68@google.com BUG: KASAN: use-after-free in ath9k_wmi_ctrl_rx+0x416/0x500 drivers/net/wireless/ath/ath9k/wmi.c:215 Read of size 1 at addr ffff8881cef1417c by task swapper/1/0 Call Trace: ath9k_wmi_ctrl_rx+0x416/0x500 drivers/net/wireless/ath/ath9k/wmi.c:215 ath9k_htc_rx_msg+0x2da/0xaf0 drivers/net/wireless/ath/ath9k/htc_hst.c:459 ath9k_hif_usb_reg_in_cb+0x1ba/0x630 drivers/net/wireless/ath/ath9k/hif_usb.c:718 __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 Reported-and-tested-by: syzbot+5d338854440137ea0fef@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200404041838.10426-3-hqjagain@gmail.com commit ced21a4c726bdc60b1680c050a284b08803bc64c Author: Qiujun Huang Date: Sat Apr 4 12:18:34 2020 +0800 ath9k: Fix use-after-free Read in htc_connect_service The skb is consumed by htc_send_epid, so it needn't release again. The case reported by syzbot: https://lore.kernel.org/linux-usb/000000000000590f6b05a1c05d15@google.com usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008 usb 1-1: Service connection timeout for: 256 ================================================================== BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:134 [inline] BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1042 [inline] BUG: KASAN: use-after-free in kfree_skb+0x32/0x3d0 net/core/skbuff.c:692 Read of size 4 at addr ffff8881d0957994 by task kworker/1:2/83 Call Trace: kfree_skb+0x32/0x3d0 net/core/skbuff.c:692 htc_connect_service.cold+0xa9/0x109 drivers/net/wireless/ath/ath9k/htc_hst.c:282 ath9k_wmi_connect+0xd2/0x1a0 drivers/net/wireless/ath/ath9k/wmi.c:265 ath9k_init_htc_services.constprop.0+0xb4/0x650 drivers/net/wireless/ath/ath9k/htc_drv_init.c:146 ath9k_htc_probe_device+0x25a/0x1d80 drivers/net/wireless/ath/ath9k/htc_drv_init.c:959 ath9k_htc_hw_init+0x31/0x60 drivers/net/wireless/ath/ath9k/htc_hst.c:501 ath9k_hif_usb_firmware_cb+0x26b/0x500 drivers/net/wireless/ath/ath9k/hif_usb.c:1187 request_firmware_work_func+0x126/0x242 drivers/base/firmware_loader/main.c:976 process_one_work+0x94b/0x1620 kernel/workqueue.c:2264 worker_thread+0x96/0xe20 kernel/workqueue.c:2410 kthread+0x318/0x420 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 83: kmem_cache_alloc_node+0xdc/0x330 mm/slub.c:2814 __alloc_skb+0xba/0x5a0 net/core/skbuff.c:198 alloc_skb include/linux/skbuff.h:1081 [inline] htc_connect_service+0x2cc/0x840 drivers/net/wireless/ath/ath9k/htc_hst.c:257 ath9k_wmi_connect+0xd2/0x1a0 drivers/net/wireless/ath/ath9k/wmi.c:265 ath9k_init_htc_services.constprop.0+0xb4/0x650 drivers/net/wireless/ath/ath9k/htc_drv_init.c:146 ath9k_htc_probe_device+0x25a/0x1d80 drivers/net/wireless/ath/ath9k/htc_drv_init.c:959 ath9k_htc_hw_init+0x31/0x60 drivers/net/wireless/ath/ath9k/htc_hst.c:501 ath9k_hif_usb_firmware_cb+0x26b/0x500 drivers/net/wireless/ath/ath9k/hif_usb.c:1187 request_firmware_work_func+0x126/0x242 drivers/base/firmware_loader/main.c:976 process_one_work+0x94b/0x1620 kernel/workqueue.c:2264 worker_thread+0x96/0xe20 kernel/workqueue.c:2410 kthread+0x318/0x420 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Freed by task 0: kfree_skb+0x102/0x3d0 net/core/skbuff.c:690 ath9k_htc_txcompletion_cb+0x1f8/0x2b0 drivers/net/wireless/ath/ath9k/htc_hst.c:356 hif_usb_regout_cb+0x10b/0x1b0 drivers/net/wireless/ath/ath9k/hif_usb.c:90 __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 __do_softirq+0x21e/0x950 kernel/softirq.c:292 Reported-and-tested-by: syzbot+9505af1ae303dabdc646@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200404041838.10426-2-hqjagain@gmail.com commit acb31476adc9ff271140cdd4d3c707ff0c97f5a4 Author: Venkateswara Naralasetty Date: Wed Apr 1 15:48:10 2020 +0530 ath10k: fix kernel null pointer dereference Currently sta airtime is updated without any lock in case of host based airtime calculation. Which may result in accessing the invalid sta pointer in case of continuous station connect/disconnect. This patch fix the kernel null pointer dereference by updating the station airtime with proper RCU lock in case of host based airtime calculation. Proceeding with the analysis of "ARM Kernel Panic". The APSS crash happened due to OOPS on CPU 0. Crash Signature : Unable to handle kernel NULL pointer dereference at virtual address 00000300 During the crash, PC points to "ieee80211_sta_register_airtime+0x1c/0x448 [mac80211]" LR points to "ath10k_txrx_tx_unref+0x17c/0x364 [ath10k_core]". The Backtrace obtained is as follows: [] (ieee80211_sta_register_airtime [mac80211]) from [] (ath10k_txrx_tx_unref+0x17c/0x364 [ath10k_core]) [] (ath10k_txrx_tx_unref [ath10k_core]) from [] (ath10k_htt_txrx_compl_task+0xa50/0xfc0 [ath10k_core]) [] (ath10k_htt_txrx_compl_task [ath10k_core]) from [] (ath10k_pci_napi_poll+0x50/0xf8 [ath10k_pci]) [] (ath10k_pci_napi_poll [ath10k_pci]) from [] (net_rx_action+0xac/0x160) [] (net_rx_action) from [] (__do_softirq+0x104/0x294) [] (__do_softirq) from [] (run_ksoftirqd+0x30/0x90) [] (run_ksoftirqd) from [] (smpboot_thread_fn+0x25c/0x274) [] (smpboot_thread_fn) from [] (kthread+0xd8/0xec) Tested HW: QCA9888 Tested FW: 10.4-3.10-00047 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585736290-17661-1-git-send-email-vnaralas@codeaurora.org commit 61272e47c18cd05c0c5e5a4a2bee736bf37d765d Author: Lyude Paul Date: Fri Apr 3 16:03:25 2020 -0400 drm/dp_mst: Don't drop NAKs for down responses It looks like that when we introduced the ability to handle multiple down requests at once, we accidentally started dropping NAK replies - causing sideband messages which got NAK'd to seemingly timeout and cause all sorts of weirdness. So, fix this by making sure we don't return from drm_dp_mst_handle_down_rep() early, but instead treat NAKs like any other message. Signed-off-by: Lyude Paul Fixes: fbc821c4a506 ("drm/mst: Support simultaneous down replies") Cc: Wayne Lin Cc: Wayne Lin Cc: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200403200325.885628-1-lyude@redhat.com Reviewed-by: Sean Paul commit cbfb1b74438fdab9ab34a24bb3a206033d807dc0 Author: Lyude Paul Date: Mon Apr 6 15:33:52 2020 -0400 drm/dp_mst: Fix NULL deref in drm_dp_get_one_sb_msg() While we don't need this function to store an mstb anywhere for UP requests since we process them asynchronously, we do need to make sure that we don't try to write to **mstb for UP requests otherwise we'll cause a NULL pointer deref: RIP: 0010:drm_dp_get_one_sb_msg+0x4b/0x460 [drm_kms_helper] Call Trace: ? vprintk_emit+0x16a/0x230 ? drm_dp_mst_hpd_irq+0x133/0x1010 [drm_kms_helper] drm_dp_mst_hpd_irq+0x133/0x1010 [drm_kms_helper] ? __drm_dbg+0x87/0x90 [drm] ? intel_dp_hpd_pulse+0x24b/0x400 [i915] intel_dp_hpd_pulse+0x24b/0x400 [i915] i915_digport_work_func+0xd6/0x160 [i915] process_one_work+0x1a9/0x370 worker_thread+0x4d/0x3a0 kthread+0xf9/0x130 ? process_one_work+0x370/0x370 ? kthread_park+0x90/0x90 ret_from_fork+0x35/0x40 So, fix this. Signed-off-by: Lyude Paul Fixes: fbc821c4a506 ("drm/mst: Support simultaneous down replies") Cc: Wayne Lin Cc: Lyude Paul Cc: Wayne Lin Cc: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200406193352.1245985-1-lyude@redhat.com Reviewed-by: Sean Paul commit e68296259cf34f5ef86f8db16e036ec6c7b41315 Author: Chris Wilson Date: Mon Apr 6 16:58:40 2020 +0100 drm/i915/gem: Wait until the context is finally retired before releasing engines If we want to percolate information back from the HW, up through the GEM context, we need to wait until the intel_context is scheduled out for the last time. This is handled by the retirement of the intel_context's barrier, i.e. by listening to the pulse after the notional unpin. So wait until the intel_context is finally retired before releasing the engine, so that we can inspect the final context state and pass it on. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200406155840.1728-3-chris@chris-wilson.co.uk commit 3b0a05792e2e279d2b859db70319445c0410d427 Author: Chris Wilson Date: Mon Apr 6 16:58:39 2020 +0100 drm/i915: Allow asynchronous waits on the i915_active barriers Allow the caller to also wait upon the barriers stored in i915_active. v2: Hook up i915_request_await_active(I915_ACTIVE_AWAIT_BARRIER) as well for completeness, and avoid the lazy GEM_BUG_ON()! v3: Pull flush_lazy_signals() under the active-ref protection as it too walks the rbtree and so we must be careful that we do not free it as we iterate. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200406155840.1728-2-chris@chris-wilson.co.uk commit 442dbc5c686153f2c86eeca21d0df010dc8f1c3a Author: Chris Wilson Date: Mon Apr 6 16:58:38 2020 +0100 drm/i915: Make exclusive awaits on i915_active optional Later use will require asynchronous waits on the active timelines, but will not utilize an async wait on the exclusive channel. Make the await on the exclusive fence explicit in the selection flags. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200406155840.1728-1-chris@chris-wilson.co.uk commit 795def8b14ffa334881264823444eaab4d1879c3 Author: Lei Wang Date: Mon Mar 30 18:56:32 2020 +0530 ath10k: enable radar detection in secondary segment Enable radar detection in secondary segment for VHT160 and VHT80+80 mode on DFS channels. Otherwise, when injecting radar pulse in the secondary segment, the DUT can't detect radar pulse. Tested: qca9984 with firmware ver 10.4-3.10-00047 Signed-off-by: Lei Wang Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585574792-719-2-git-send-email-ssreeela@codeaurora.org commit 3db24065c2c824e9ea419c453b810b5f301d91c8 Author: Lei Wang Date: Mon Mar 30 18:56:31 2020 +0530 ath10k: enable VHT160 and VHT80+80 modes Set right channel frequencies in VHT160 mode according to the VHT160 interoperability workaround added as part of IEEE Std 802.11™-2016 in "Table 9-252—VHT Operation Information subfields", band_center_freq2 corresponds to CCFS1 in Table 9-253. Previous implementation (band_center_freq2 = 0 for VHT160) is only deprecated. Enable VHT80+80 mode and set the proper peer RX nss value for VHT160 and VHT80+80 mode. Based on patches by Sebastian Gottschall: https://lkml.kernel.org/r/20180704095444.662-1-s.gottschall@dd-wrt.com https://lkml.kernel.org/r/20180704120519.6479-1-s.gottschall@dd-wrt.com Tested: qca9984 with firmware ver 10.4-3.10-00047 Co-developed-by: Sebastian Gottschall Signed-off-by: Sebastian Gottschall Co-developed-by: Rick Wu Signed-off-by: Rick Wu Signed-off-by: Lei Wang Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585574792-719-1-git-send-email-ssreeela@codeaurora.org commit 800113ff4b1d277c2b66ffc04d4d38f202a0d187 Author: Sriram R Date: Mon Mar 30 16:47:08 2020 +0530 ath11k: Avoid mgmt tx count underflow The mgmt tx count reference is incremented/decremented on every mgmt tx and on tx completion event from firmware. In case of an unexpected mgmt tx completion event from firmware, the counter would underflow. Avoid this by decrementing only when the tx count is greater than 0. Signed-off-by: Sriram R Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585567028-9242-1-git-send-email-srirrama@codeaurora.org commit bdef56a36eeaccf236af43578f77938f3561a2b1 Author: Sriram R Date: Mon Mar 30 16:46:46 2020 +0530 ath11k: Increase the tx completion ring size Increase the tx completion ring size to 0x8000.Also set the idr size to be same as the completion ring size. This avoids backpressure on the TX Completion and corresponding TCL Data ring during high data traffic. Signed-off-by: Sriram R Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585567006-9173-1-git-send-email-srirrama@codeaurora.org commit 9a8074e3bcd7956ec6b4f7c26360af1b0b0abe38 Author: Colin Ian King Date: Fri Mar 27 19:26:39 2020 +0000 ath11k: fix error message to correctly report the command that failed Currently the error message refers to the command WMI_TWT_DIeABLE_CMDID which looks like a cut-n-paste mangled typo. Fix the message to match the command WMI_BSS_COLOR_CHANGE_ENABLE_CMDID that failed. Fixes: 5a032c8d1953 ("ath11k: add WMI calls required for handling BSS color") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200327192639.363354-1-colin.king@canonical.com commit 21c1b063f4b98c14b2438734c93fe24d517233cb Author: Maharaja Kennadyrajan Date: Thu Mar 26 20:19:15 2020 +0530 ath11k: add pktlog checksum in trace events to support pktlog Pktlog data are different among the chipset & chipset versions. As part of enhancing the user space script to decode the pktlog trace events generated, it is desirable to know which chipset or which chipset version has provided the events and thereby decode the pktlogs appropriately. Pktlog checksum helps to determine the chipset variant which is given by the firmware in the struct wmi_ready_event. Pktlog checksums are computed during the firmware build. So, adding that pktlog checksum in the pklog trace events. Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585234155-30574-1-git-send-email-mkenna@codeaurora.org commit 3d1c60460fb2823a19ead9e6ec8f184dd7271aa7 Author: Maharaja Kennadyrajan Date: Thu Mar 26 18:36:36 2020 +0200 ath10k: Fix the race condition in firmware dump work queue There is a race condition, when the user writes 'hw-restart' and 'hard' in the simulate_fw_crash debugfs file without any delay. In the above scenario, the firmware dump work queue(scheduled by 'hard') should be handled gracefully, while the target is in the 'hw-restart'. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00044 Co-developed-by: Govindaraj Saminathan Signed-off-by: Govindaraj Saminathan Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585213077-28439-1-git-send-email-mkenna@codeaurora.org commit 9556dfa28b4d84edfd5b96e684ed8e7a15a51b67 Author: Maharaja Kennadyrajan Date: Thu Mar 26 18:36:32 2020 +0200 ath11k: Add sta debugfs support to configure ADDBA and DELBA Add support to test aggregation procedures (addba/addba_resp/delba) manually by adding the required callbacks in sta debugfs files. To enable automatic aggregation in target, echo 0 > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/aggr_mode For manual mode, echo 1 > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/aggr_mode To send addba response, echo 0 25 > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/addba_resp To send addba, echo 1 32 > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/addba To send delba, echo 0 1 37 > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/delba Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585213026-28406-1-git-send-email-mkenna@codeaurora.org commit 39d571d172312c7f76570ba86c4074f170aaf442 Author: Chris Wilson Date: Mon Apr 6 13:36:16 2020 +0100 drm/i915/gem: Take DBG_FORCE_RELOC into account prior to using reloc_gpu If we set the debug flag to force ourselves not to relocate via the gpu, do not relocate via the gpu. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200406123616.7334-1-chris@chris-wilson.co.uk commit 30c88a47f1abd5744908d3681f54dcf823fe2a12 Author: Chris Wilson Date: Mon Apr 6 12:48:21 2020 +0100 drm/i915/gem: Flush all the reloc_gpu batch __i915_gem_object_flush_map() takes a byte range, so feed it the written bytes and do not mistake the u32 index as bytes! Fixes: a679f58d0510 ("drm/i915: Flush pages on acquisition") Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: # v5.2+ Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200406114821.10949-1-chris@chris-wilson.co.uk commit b4df5405f3e67e408554c9fd837faa3789b2ac32 Author: Imre Deak Date: Mon Mar 30 12:54:25 2020 +0300 drm/i915: Extend hotplug detect retry on TypeC connectors to 5 seconds On TypeC ports if a sink deasserts/reasserts its HPD signal, generating a hotplug interrupt without the sink getting unplugged/replugged from the connector, there can be an up to 3 seconds delay until the AUX channel gets functional. To avoid detection failures this delay causes retry the detection for 5 seconds. I noticed this on ICL/TGL RVPs and a DELL XPS 13 7390 ICL laptop. References: https://gitlab.freedesktop.org/drm/intel/issues/1067 Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200330095425.29113-2-imre.deak@intel.com commit 8c8919c7c99f097c9e6a441486c1c263277288b0 Author: Imre Deak Date: Mon Mar 30 12:54:24 2020 +0300 drm/i915: Add a retry counter for hotplug detect retries On TypeC connectors we need to retry the detection after hotplug events for a longer time, so add a retry counter to support this. The next patch will add detection retries on TypeC ports needing this. Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200330095425.29113-1-imre.deak@intel.com commit c08ce255033a31440219b7d3dffedf37057f2444 Author: Filipe Laíns Date: Sun Jan 12 23:50:09 2020 +0000 HID: logitech: drop outdated references to unifying receivers The hid-logitech-{dj,hidpp} were originally developed for unifying receivers but since then they have evolved and now support other types of receivers and devices. This patch adjusts the original descriptions with this in mind. Signed-off-by: Filipe Laíns Signed-off-by: Jiri Kosina commit ed7cca1ff0142b4e24daed94271afef3b9bb4162 Author: Markus Elfring Date: Sun Apr 5 13:45:53 2020 +0200 drm/sun4i: tcon: Delete an error message in sun4i_tcon_init_irq() The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/5a6cf5a7-3f27-5425-4d6a-550a17bc51e3@web.de commit 91fcf8e603848961e7d83ebf48f52ff8f608eae5 Author: Sam Ravnborg Date: Sat Mar 28 14:20:25 2020 +0100 drm/bridge: fix kernel-doc warning in panel.c Add missing documentation to fix following warning: panel.c:303: warning: Function parameter or member 'bridge' not described in 'drm_panel_bridge_connector' Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Vetter Cc: Laurent Pinchart Cc: Boris Brezillon Cc: Mihail Atanassov Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Jonas Karlman Cc: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200328132025.19910-7-sam@ravnborg.org commit fa3d55a14a7ccd8e908d0cce6b13d466803a32a9 Author: Sam Ravnborg Date: Sat Mar 28 14:20:22 2020 +0100 drm/sched: fix kernel-doc in gpu_scheduler.h Fix following warning: gpu_scheduler.h:103: warning: Function parameter or member 'priority' not described in 'drm_sched_entity' Signed-off-by: Sam Ravnborg Acked-by: Daniel Vetter Cc: Nirmoy Das Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200328132025.19910-4-sam@ravnborg.org commit d2a3f5f4635b7b0df8d4cd04ee0c75886ef699b9 Author: Marcel Holtmann Date: Fri Apr 3 21:44:07 2020 +0200 Bluetooth: Add HCI device identifier for VIRTIO devices This patch assigns the next free HCI device identifier to Bluetooth devices based on VIRTIO devices. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 3679fe7d43c65e07f00afb216987f33e152ceb6f Author: Marcel Holtmann Date: Fri Apr 3 21:44:06 2020 +0200 Bluetooth: Increment management interface revision Increment the mgmt revision due to the recently added new commands. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit bc292258c580a82c9baef0a64f66971e010a40a9 Author: Marcel Holtmann Date: Fri Apr 3 21:44:05 2020 +0200 Bluetooth: Add support for reading security information To allow userspace to make correcty security policy decision, the kernel needs to export a few details of the supported security features and encryption key size information. This command exports this information and also allows future extensions if needed. Signed-off-by: Marcel Holtmann Reviewed-by: Alain Michaud Signed-off-by: Johan Hedberg commit a479036041d6a1bcf98f72b16a425e8d45e20ae9 Author: Marcel Holtmann Date: Fri Apr 3 21:44:04 2020 +0200 Bluetooth: Add support for Read Local Simple Pairing Options With the Read Local Simple Pairing Options command it is possible to retrieve the support for max encryption key size supported by the controller and also if the controller correctly verifies the ECDH public key during pairing. Signed-off-by: Marcel Holtmann Reviewed-by: Alain Michaud Signed-off-by: Johan Hedberg commit fc04590e3d39213a22b7afd46c4bd5d95a6cab1f Author: Miao-chen Chou Date: Fri Apr 3 21:44:03 2020 +0200 Bluetooth: btusb: Enable MSFT extension for Intel ThunderPeak devices The Intel ThundePeak BT controllers support the Microsoft vendor extension and they are using 0xFC1E for VsMsftOpCode. < HCI Command: Vendor (0x3f|0x001e) plen 1 00 > HCI Event: Command Complete (0x0e) plen 15 Vendor (0x3f|0x001e) ncmd 1 Status: Success (0x00) 00 3f 00 00 00 00 00 00 00 01 50 Signed-off-by: Miao-chen Chou Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 7fd673bcdacc8528c7d9489d31f040eac7cca164 Author: Marcel Holtmann Date: Fri Apr 3 21:44:02 2020 +0200 Bluetooth: btusb: Enable Intel events even if already in operational mode In case the controller is already in operation mode, the Intel specific events will not be enabled. Fix this by jumping to a common finish section that will allow setting final details for the controller. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 145373cb1b1fcdba2059e945d0aa2613af2e84d1 Author: Miao-chen Chou Date: Fri Apr 3 21:44:01 2020 +0200 Bluetooth: Add framework for Microsoft vendor extension Micrsoft defined a set for HCI vendor extensions. Check the following link for details: https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/microsoft-defined-bluetooth-hci-commands-and-events This provides the basic framework to enable the extension and read its supported features. Drivers still have to declare support for this extension before it can be utilized by the host stack. Signed-off-by: Miao-chen Chou Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 3d2336042ae3555d4b77995402291c5795882d20 Author: Marcel Holtmann Date: Fri Apr 3 21:44:00 2020 +0200 Bluetooth: Move debugfs configuration above the selftests This is just a cosmetic clean to move the selftests configuration option to the bottom of the list of options. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit baac6276c0a9f36f1fe1f00590ef00d2ba5ba626 Author: Sathish Narasimman Date: Fri Apr 3 21:43:59 2020 +0200 Bluetooth: btusb: handle mSBC audio over USB Endpoints For mSBC encoded audio stream over usb transport, btusb driver to be set to alternate settings 6 as per BT core spec 5.0. The type of air mode is used to differenting which alt setting to be used. The changes are made considering some discussion over the similar patch submitted earlier from Kuba Pawlak (link below) https://www.spinics.net/lists/linux-bluetooth/msg64577.html Reported-by: kbuild test robot Signed-off-by: Sathish Narasimman Signed-off-by: Chethan T N Signed-off-by: Hsin-Yu Chao Signed-off-by: Amit K Bag Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 1f8330ea1692c9c490b1e566e31d96d8cef99dd8 Author: Sathish Narsimman Date: Fri Apr 3 21:43:58 2020 +0200 Bluetooth: add support to notify using SCO air mode notifying using HCI_NOTIFY_CONN_ADD for SCO connection is generic in case of mSBC audio. To differntiate SCO air mode introducing HCI_NOTIFY_ENABLE_SCO_CVSD and HCI_NOTIFY_ENABLE_SCO_TRANSP. Signed-off-by: Sathish Narsimman Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 50dc581a8f43f22f72af613397c6a01460d7559d Author: Yifan Zhang Date: Fri Apr 3 17:11:14 2020 +0800 drm/amd/display: fix the broken logic in dc_link.c Add missing braces. Signed-off-by: Yifan Zhang Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 764a21cb085b8d7d754b5d74e2ecc6adc064e3e7 Author: Tiecheng Zhou Date: Thu Apr 2 16:49:36 2020 +0800 drm/amd/powerplay: avoid using pm_en before it is initialized hwmgr->pm_en is initialized at hwmgr_hw_init. during amdgpu_device_init, there is amdgpu_asic_reset that calls to pp_get_asic_baco_capability, while hwmgr->pm_en has not yet been initialized. so avoid using pm_en in pp_get_asic_baco_capability. Reviewed-by: Emily Deng Signed-off-by: Tiecheng Zhou Signed-off-by: Yintian Tao Signed-off-by: Alex Deucher commit 567c8fc4a0d28b63f81549af2f77ee9b5c260b80 Author: Prike Liang Date: Fri Apr 3 12:26:15 2020 +0800 drm/amd/powerplay: implement the is_dpm_running() As the pmfw hasn't exported the interface of SMU feature mask to APU SKU so just force on all the features to driver inquired interface at early initial stage. Signed-off-by: Prike Liang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit dbd138dfeb74f6e5e80496702d37c89248faaec4 Author: Shirish S Date: Thu Apr 2 14:40:11 2020 +0530 drm/amd/display: re-order asic declarations Fixes build error of: "use of undeclared identifier 'RENOIR_A0'" To fix the same, this patch re-orders the ASIC declarations accordingly. Fixes: 41ef3dcd86443fa ("drm/amd/display: Fix RV2 Variant Detection") Signed-off-by: Shirish S Reviewed-by: Zhan Liu Signed-off-by: Alex Deucher commit 575b0a6e6a2f35babc7991d8e63e701d2fec9d00 Author: Yuxian Dai Date: Wed Apr 1 19:26:26 2020 +0800 drm/amdgpu/powerplay: using the FCLK DPM table to set the MCLK 1.Using the FCLK DPM table to set the MCLK for DPM states consist of three entities: FCLK UCLK MEMCLK All these three clk change together, MEMCLK from FCLK, so use the fclk frequency. 2.we should show the current working clock freqency from clock table metric Signed-off-by: Yuxian Dai Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit 193cce34a105d5acb97e83bf7d2321b4c24be7b4 Author: Alex Sierra Date: Wed Apr 1 16:57:17 2020 -0500 amdgpu/drm: remove psp access on navi10 for sriov Navi ASICs don't require to access through PSP to osssys registers. This on SR-IOV configuration. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8913f7ff0580605093563688f58e427dd0014609 Author: Bhawanpreet Lakha Date: Mon Mar 30 17:44:00 2020 -0400 drm/amd/display: Guard calls to hdcp_ta and dtm_ta [Why] The buffer used when calling psp is a shared buffer. If we have multiple calls at the same time we can overwrite the buffer. [How] Add mutex to guard the shared buffer. Signed-off-by: Bhawanpreet Lakha Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit c0ed2ca61f9085a98b3b3d4a61582741adde9260 Author: Bhawanpreet Lakha Date: Wed Apr 1 15:55:24 2020 -0400 drm/amd/display: remove mod_hdcp_hdcp2_get_link_encryption_status() It is not being used, so remove it Signed-off-by: Bhawanpreet Lakha Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 72dc0f5159138b61762a500d0fde9bbc1af82884 Author: Lyude Paul Date: Tue Mar 31 16:57:37 2020 -0400 drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector Now that we've removed the last user of this callback, get rid of it and drm_dp_destroy_connector(). Signed-off-by: Lyude Paul Cc: Pankaj Bharadiya Link: https://patchwork.freedesktop.org/patch/msgid/20200331205740.135525-5-lyude@redhat.com Reviewed-by: Alex Deucher commit eefc9589512484b531a181a7db13e9864cbd8c35 Author: Lyude Paul Date: Tue Mar 31 16:57:36 2020 -0400 drm/amd/amdgpu_dm/mst: Stop printing extra messages in dm_dp_add_mst_connector() You can already trace the creation and destruction of connectors using DRM, and we definitely don't need to be printing info messages on connector hotplugs as well. So, get rid of these. Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200331205740.135525-4-lyude@redhat.com Reviewed-by: Alex Deucher commit 09b974e8983a4b163d4a406b46d50bf869da3073 Author: Lyude Paul Date: Tue Mar 31 16:57:35 2020 -0400 drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback Pankaj Bharadiya started cleaning up the MST connector callbacks a while ago, as I pointed out that they are the same across every driver and don't serve much purpose. There was one callback that was left over though from amdgpu, that we delayed removing due to not being completely sure as to whether or not it was needed. So, I've read through said callback and can confirm it's not at all needed. Pretty much all of the work that is done in dm_dp_destroy_mst_connector() can be done in dm_dp_mst_connector_destroy(). Additionally, I've removed some bits that didn't actually do anything: * Removed DRM_INFO message we were printing, this shouldn't be info level and there's more appropriate drm debugging flags that should be used instead * Removed amdgpu_dm_update_freesync_caps() - reading into this function, it doesn't actually do anything important and I'm not sure why it was ever being called here * Stop clearing aconnector->dc_sink - this also doesn't do anything * Stop clearing link settings in dc_link - this also doesn't do anything * Also, use shorter variable Signed-off-by: Lyude Paul Cc: Pankaj Bharadiya Link: https://patchwork.freedesktop.org/patch/msgid/20200331205740.135525-3-lyude@redhat.com Reviewed-by: Alex Deucher commit e75405bcd8f3dc88a66be75dd0cbd31dd6de9b0e Author: Lyude Paul Date: Tue Mar 31 16:57:34 2020 -0400 drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying connectors Doesn't do anything, noticed this while cleaning up some unrelated stuff. Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200331205740.135525-2-lyude@redhat.com Reviewed-by: Alex Deucher commit 848862e672883232f5f7f07a2d6628ed3f25444f Author: Chris Wilson Date: Fri Apr 3 21:33:03 2020 +0100 drm/i915/gt: Free request pool from virtual engines While extremely unlikely to be populated, we could capture a request on the virtual engine which we should free along with the virtual engine. Fixes: 43acd6516ca9 ("drm/i915: Keep a per-engine request pool") Signed-off-by: Chris Wilson Reviewed-by: Janusz Krzysztofik Link: https://patchwork.freedesktop.org/patch/msgid/20200403203303.10903-1-chris@chris-wilson.co.uk commit 53f5da74c7a2ac355527ae20c09a4064a02815e7 Author: Chris Wilson Date: Fri Apr 3 20:02:09 2020 +0100 drm/i915/selftests: Wait until we start timeslicing after a submit If we submit, we do not start timeslicing until we process the CS event that marks the start of the context running on HW. So in the selftest, be sure to wait until we have processed the pending events before asserting that timeslicing has begun. Signed-off-by: Chris Wilson Acked-by: Michael J. Ruhl Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200403190209.21818-1-chris@chris-wilson.co.uk commit 614654abe847a42fc75d7eb5096e46f796a438b6 Author: Chris Wilson Date: Fri Apr 3 13:01:50 2020 +0100 drm/i915: Check current i915_vma.pin_count status first on unbind Do an early rejection of a i915_vma_unbind() attempt if the i915_vma is currently pinned, without waiting to see if the inflight operations may unpin it. We see this problem with the shrinker trying to unbind the active vma from inside its bind worker: <6> [472.618968] Workqueue: events_unbound fence_work [i915] <4> [472.618970] Call Trace: <4> [472.618974] ? __schedule+0x2e5/0x810 <4> [472.618978] schedule+0x37/0xe0 <4> [472.618982] schedule_preempt_disabled+0xf/0x20 <4> [472.618984] __mutex_lock+0x281/0x9c0 <4> [472.618987] ? mark_held_locks+0x49/0x70 <4> [472.618989] ? _raw_spin_unlock_irqrestore+0x47/0x60 <4> [472.619038] ? i915_vma_unbind+0xae/0x110 [i915] <4> [472.619084] ? i915_vma_unbind+0xae/0x110 [i915] <4> [472.619122] i915_vma_unbind+0xae/0x110 [i915] <4> [472.619165] i915_gem_object_unbind+0x1dc/0x400 [i915] <4> [472.619208] i915_gem_shrink+0x328/0x660 [i915] <4> [472.619250] ? i915_gem_shrink_all+0x38/0x60 [i915] <4> [472.619282] i915_gem_shrink_all+0x38/0x60 [i915] <4> [472.619325] vm_alloc_page.constprop.25+0x1aa/0x240 [i915] <4> [472.619330] ? rcu_read_lock_sched_held+0x4d/0x80 <4> [472.619363] ? __alloc_pd+0xb/0x30 [i915] <4> [472.619366] ? module_assert_mutex_or_preempt+0xf/0x30 <4> [472.619368] ? __module_address+0x23/0xe0 <4> [472.619371] ? is_module_address+0x26/0x40 <4> [472.619374] ? static_obj+0x34/0x50 <4> [472.619376] ? lockdep_init_map+0x4d/0x1e0 <4> [472.619407] setup_page_dma+0xd/0x90 [i915] <4> [472.619437] alloc_pd+0x29/0x50 [i915] <4> [472.619470] __gen8_ppgtt_alloc+0x443/0x6b0 [i915] <4> [472.619503] gen8_ppgtt_alloc+0xd7/0x300 [i915] <4> [472.619535] ppgtt_bind_vma+0x2a/0xe0 [i915] <4> [472.619577] __vma_bind+0x26/0x40 [i915] <4> [472.619611] fence_work+0x1c/0x90 [i915] <4> [472.619617] process_one_work+0x26a/0x620 Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200403120150.17091-1-chris@chris-wilson.co.uk commit 958f92414de170a8b6c6ca3ac0c46730b872c012 Author: Ville Syrjälä Date: Mon Mar 2 22:34:24 2020 +0200 drm/panel-leadtek-ltk500hd1829: Fix dotclock The currently listed dotclock disagrees with the currently listed vrefresh rate. Change the dotclock to match the vrefresh. Someone tell me which (if either) of the dotclock or vreresh is correct? Cc: Heiko Stuebner Cc: Sam Ravnborg Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200302203452.17977-6-ville.syrjala@linux.intel.com Tested-by: Heiko Stuebner Acked-by: Heiko Stuebner Acked-by: Sam Ravnborg commit 6352219c39c04ed3f9a8d1cf93f87c21753a213e Author: Ashutosh Dixit Date: Thu Apr 2 18:01:20 2020 -0700 drm/i915/perf: Do not clear pollin for small user read buffers It is wrong to block the user thread in the next poll when OA data is already available which could not fit in the user buffer provided in the previous read. In several cases the exact user buffer size is not known. Blocking user space in poll can lead to data loss when the buffer size used is smaller than the available data. This change fixes this issue and allows user space to read all OA data even when using a buffer size smaller than the available data using multiple non-blocking reads rather than staying blocked in poll till the next timer interrupt. v2: Fix ret value for blocking reads (Umesh) v3: Mistake during patch send (Ashutosh) v4: Remove -EAGAIN from comment (Umesh) v5: Improve condition for clearing pollin and return (Lionel) v6: Improve blocking read loop and other cleanups (Lionel) v7: Added Cc stable Testcase: igt/perf/polling-small-buf Reviewed-by: Lionel Landwerlin Signed-off-by: Ashutosh Dixit Cc: Umesh Nerlige Ramappa Cc: Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200403010120.3067-1-ashutosh.dixit@intel.com commit 9657aaa2055d0f7a5bce8020c35cdf66947f10b4 Author: Chris Wilson Date: Fri Apr 3 17:09:51 2020 +0100 drm/i915: Revoke mmap before fence Make sure we revoke the user's mmaps of this vma to force them to take a pagefault *before* we remove the associated aperture detiling register. Fixes: 0d86ee35097a ("drm/i915/gt: Make fence revocation unequivocal") Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200403160951.8271-1-chris@chris-wilson.co.uk commit d82a855ac085e22b7bc309c337afab1ff1afc298 Author: Ville Syrjälä Date: Fri Mar 13 18:48:31 2020 +0200 drm/i915: Move the port sync DP_TP_CTL stuff to the encoder hook Move the final DP_TP_CTL frobbing of port sync to the master encoder's enable hook. Now neatly out of sight from the high level modeset code. And thus we've eliminated all the special casing of port sync in the high level modeset code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-14-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit ede9771d7f84025e64ed5cbd683c5f0e4e7f2187 Author: Ville Syrjälä Date: Fri Mar 13 18:48:30 2020 +0200 drm/i915: Pass atomic state to encoder hooks We're going to want access to the atomic state for iterating the slave crtcs when enabling the port sync master crtc. Pass the atomic state all the way down. The alternative would be yet another encoder hook which we'll have to call after all the normal modeset stuff is done. Not really a fan of yet another hook just for this. Note that during readout state sanitation we are now going to pass NULL as the atomic state since we don't have one. We need to change that and then we can also s/crtc_state/crtc/ and s/conn_state/conn/ for the encoder hooks as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-13-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 1ff241ea2b26b6485587e3d1b6997999ab7ea285 Author: Ville Syrjälä Date: Fri Mar 13 18:48:29 2020 +0200 drm/i915: Do pipe updates after enables for everyone Currently only port sync pipes do the sequence such that we first do the modeset part for every pipe and then do the plane/etc. updates. Let's follow that apporach for all pipes in skl+ so that we can properly integrate the port sync into the normal modeset flow. v2: Remove now stale TODO of port sync slave entries[] s/oldnew/new/ Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-12-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 4f05d7aeba9764f624e7cb2ebd9a729c8a84408c Author: Ville Syrjälä Date: Fri Mar 13 18:48:28 2020 +0200 drm/i915: Fix port sync code to work with >2 pipes Don't assume there is just one port sync slave. We might have several. v2: Fix unitialized new_crtc_state usage (José) Fix clearing of modeset_pipes for slaves s/oldnew/new/ Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-11-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit b932da3c8a356294deffd84f088560167d221630 Author: Ville Syrjälä Date: Fri Mar 13 18:48:27 2020 +0200 drm/i915: Eliminate port sync copy pasta Remove the copy pasted port sync crtc enable functions and instead just split the normal function into the two parts we need. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-10-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit dc5b8ed56bb3788cade153c853221bb6b73364f3 Author: Ville Syrjälä Date: Fri Mar 13 18:48:26 2020 +0200 drm/i915: Implement port sync for SKL+ Transcoder port sync was introduced to the hardware in BDW. We can trivially enable it for SKL+ since the same codepaths are already used for ICL+ port sync. The only difference is the actual location of the bits we need to poke. We leave BDW out (at least for now) since it uses different modeset paths that haven't been adapted for port sync, and IIRC using the feature would involve some extra workarounds we've not implemented. Pre-BDW hardware does not support port sync so we'd have to tweak the modeset sequence to start the pipes as close together as possible and hope for the best. So far no one has seriously tried to implement that. Closes: https://gitlab.freedesktop.org/drm/intel/issues/27 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-9-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 10cf8e755a9ac793d43e4ce35f23cb32960140f9 Author: Ville Syrjälä Date: Wed Mar 18 19:02:35 2020 +0200 drm/i915: Store cpu_transcoder_mask in device info We have a bunch of code that would like to know which CPU transcoders are actually present in the hardware. Rather than use various ad-hoc methods let's just include a full bitmask in the device info, alongside pipe_mask. v2: Rebase Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200318170235.15176-1-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit bfae03fe75eb8875396184bd3bf15a52bea04956 Author: Chris Wilson Date: Fri Apr 3 08:36:57 2020 +0100 drm/i915: Avoid setting timer->expires to 0 We use timer->expires == 0 to detect if a timer had been cancelled, but it's a valid expiration we could set. Just skip using 0 and set the expiry for the next jiffie. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200403073657.13427-1-chris@chris-wilson.co.uk commit 625c18d706f7f96db2a315a60c7895761bba6128 Author: Daniel Vetter Date: Fri Apr 3 13:06:10 2020 +0200 drm: delete drm_pci.h It's empty! After more than 20 years of OS abstraction layer for pci devices, it's kinda gone now. Signed-off-by: Daniel Vetter Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403110610.2344842-2-daniel.vetter@ffwll.ch commit 33775336d56ebed543f4d6cc636e9018c8a671a1 Author: Daniel Vetter Date: Fri Apr 3 13:06:09 2020 +0200 drm/pci: Move drm_pci_alloc/free under CONFIG_DRM_LEGACY All other users have been removed, yay! Signed-off-by: Daniel Vetter Reviewed-by: Sam Ravnborg [fix checkpatch warning] Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200403110610.2344842-1-daniel.vetter@ffwll.ch commit 43acd6516ca970c7a1d9d4e3e1d85bf570abc190 Author: Chris Wilson Date: Thu Apr 2 19:40:37 2020 +0100 drm/i915: Keep a per-engine request pool Add a tiny per-engine request mempool so that we should always have a request available for powermanagement allocations from tricky contexts. This reserve is expected to be only used for kernel contexts when barriers must be emitted [almost] without fail. The main consumer for this reserved request is expected to be engine-pm, for which we know that there will always be at least the previous pm request that we can reuse under mempressure (so there should always be a spare request for engine_park()). This is an alternative to using a comparatively bulky mempool, which requires custom handling for both our reserved allocation requirement and to protect our TYPESAFE_BY_RCU slab cache. The advantage of mempool would be that it would allow us to keep a larger per-engine request pool. However, converting over to mempool is straightforward should the need arise. Signed-off-by: Chris Wilson Cc: Janusz Krzysztofik Cc: Tvrtko Ursulin Reviewed-and-tested-by: Janusz Krzysztofik Link: https://patchwork.freedesktop.org/patch/msgid/20200402184037.21630-1-chris@chris-wilson.co.uk commit 61249ce08ee9d031070281dbf36871f1c794abb8 Author: Jungseung Lee Date: Thu Apr 2 21:10:22 2020 +0900 spi: spi-ep93xx: fix wrong SPI mode selection The mode bits on control register 0 are in a different order compared to the spi mode define values. Thus, in the current code, it fails to set the correct SPI mode selection. Fix it. Signed-off-by: Jungseung Lee Link: https://lore.kernel.org/r/20200402121022.9976-1-js07.lee@samsung.com Signed-off-by: Mark Brown commit 1e5479be46a70389e1059818a2e9358858eaa5fc Author: Alain Michaud Date: Fri Apr 3 13:49:05 2020 +0000 Bluetooth: fixing minor typo in comment This changes a simple typo in hci_event.c Signed-off-by: Alain Michaud Signed-off-by: Marcel Holtmann commit c76d4ab764adaef6ee4c385df2df24dbaea88412 Author: Gurchetan Singh Date: Wed Apr 1 15:30:38 2020 -0700 drm/virtio: make virtio_gpu_object_attach void It always returns zero. Signed-off-by: Gurchetan Singh Link: http://patchwork.freedesktop.org/patch/msgid/20200401223039.2860-4-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann commit 6457a0df4df2bba9d395bc93476a84219f661b41 Author: Gurchetan Singh Date: Wed Apr 1 15:30:37 2020 -0700 drm/virtio: delete notify in virtio_gpu_object_create For 3D buffers, virtio_gpu_gem_object_open notifies. We can have the same behavior for dumb buffer. v2: virtio_gpu_gem_object_open always notifies v3: avoid boolean variable Signed-off-by: Gurchetan Singh Reviewed-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/20200401223039.2860-3-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann commit 6eefb4bb938fb0b214524bbcfd66f873540181c9 Author: Gurchetan Singh Date: Wed Apr 1 15:30:36 2020 -0700 drm/virtio: delete notify after virtio_gpu_cmd_context_create The first 3D ioctl will take care of notification. Signed-off-by: Gurchetan Singh Reviewed-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/20200401223039.2860-2-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann commit d60138530a786629b0ba7072105756087a13c3fd Author: Gurchetan Singh Date: Wed Apr 1 15:30:35 2020 -0700 drm/virtio: random virtgpu_drv.h cleanups - Static-ify virtio_gpu_gem_create - Delete unused prototypes - Point to current implementation files Signed-off-by: Gurchetan Singh Reviewed-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/20200401223039.2860-1-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann commit 7fedd3bb6b77f9b6eefb0e4dcd8f79d0d00b86d7 Author: Abhishek Pandit-Subedi Date: Mon Mar 23 12:45:07 2020 -0700 Bluetooth: Prioritize SCO traffic When scheduling TX packets, send all SCO/eSCO packets first, check for pending SCO/eSCO packets after every ACL/LE packet and send them if any are pending. This is done to make sure that we can meet SCO deadlines on slow interfaces like UART. If we were to queue up multiple ACL packets without checking for a SCO packet, we might miss the SCO timing. For example: The time it takes to send a maximum size ACL packet (1024 bytes): t = 10/8 * 1024 bytes * 8 bits/byte * 1 packet / baudrate where 10/8 is uart overhead due to start/stop bits per byte Replace t = 3.75ms (SCO deadline), which gives us a baudrate of 2730666. At a baudrate of 3000000, if we didn't check for SCO packets within 1024 bytes, we would miss the 3.75ms timing window. Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann commit 81bd5d0c62437c02caac6b3f942fcda874063cb0 Author: Michał Mirosław Date: Thu Apr 2 14:55:20 2020 +0200 Bluetooth: hci_bcm: fix freeing not-requested IRQ When BT module can't be initialized, but it has an IRQ, unloading the driver WARNs when trying to free not-yet-requested IRQ. Fix it by noting whether the IRQ was requested. WARNING: CPU: 2 PID: 214 at kernel/irq/devres.c:144 devm_free_irq+0x49/0x4ca [...] WARNING: CPU: 2 PID: 214 at kernel/irq/manage.c:1746 __free_irq+0x8b/0x27c Trying to free already-free IRQ 264 Modules linked in: hci_uart(-) btbcm bluetooth ecdh_generic ecc libaes CPU: 2 PID: 214 Comm: rmmod Tainted: G W 5.6.1mq-00044-ga5f9ea098318-dirty #928 [...] [] (devm_free_irq) from [] (bcm_close+0x97/0x118 [hci_uart]) [] (bcm_close [hci_uart]) from [] (hci_uart_unregister_device+0x33/0x3c [hci_uart]) [] (hci_uart_unregister_device [hci_uart]) from [] (serdev_drv_remove+0x13/0x20) [] (serdev_drv_remove) from [] (device_release_driver_internal+0x97/0x118) [] (device_release_driver_internal) from [] (driver_detach+0x2f/0x58) [] (driver_detach) from [] (bus_remove_driver+0x41/0x94) [] (bus_remove_driver) from [] (bcm_deinit+0x1b/0x740 [hci_uart]) [] (bcm_deinit [hci_uart]) from [] (hci_uart_exit+0x13/0x30 [hci_uart]) [] (hci_uart_exit [hci_uart]) from [] (sys_delete_module+0x109/0x1d0) [] (sys_delete_module) from [] (ret_fast_syscall+0x1/0x5a) [...] Cc: stable@vger.kernel.org Fixes: 6cc4396c8829 ("Bluetooth: hci_bcm: Add wake-up capability") Signed-off-by: Michał Mirosław Signed-off-by: Marcel Holtmann commit b25e4df4a83e516efbdeeefb5b2d3e259639a56e Author: Michał Mirosław Date: Thu Apr 2 14:55:18 2020 +0200 Bluetooth: hci_bcm: respect IRQ polarity from DT The IRQ polarity is be configured in bcm_setup_sleep(). Make the configured value match what is in the DeviceTree. Cc: stable@vger.kernel.org Fixes: f25a96c8eb46 ("Bluetooth: hci_bcm: enable IRQ capability from devicetree") Signed-off-by: Michał Mirosław Signed-off-by: Marcel Holtmann commit 9c9a8468de21895abc43f45fc86346467217c986 Author: Tian Tao Date: Fri Mar 6 11:43:01 2020 +0800 drm/hisilicon: Enforce 128-byte stride alignment to fix the hardware limitation because the hardware limitation,The initial color depth must set to 32bpp and must set the FB Offset of the display hardware to 128Byte alignment, which is used to solve the display problem at 800x600 and 1440x900 resolution under 16bpp. Signed-off-by: Tian Tao Signed-off-by: Gong junjie Acked-by: Xinliang Liu Signed-off-by: Xinliang Liu Link: https://patchwork.freedesktop.org/patch/msgid/1583466184-7060-4-git-send-email-tiantao6@hisilicon.com commit 63d0f3ea8ebb67160eca281320d255c72b0cb51a Author: Swathi Dhanavanthri Date: Thu Mar 26 16:49:55 2020 -0700 drm/i915/tgl: Make Wa_14010229206 permanent This workaround now applies to all steppings, not just A0. Wa_1409085225 is a temporary A0-only W/A however it is identical to Wa_14010229206 and hence the combined workaround is made permanent. Bspec: 52890 Signed-off-by: Swathi Dhanavanthri Tested-by: Rafael Antognolli Reviewed-by: Matt Roper [mattrope: added missing blank line] Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200326234955.16155-1-swathi.dhanavanthri@intel.com commit 98d513167f6f3ff93acdaa455403c92f42af4afc Author: Chris Wilson Date: Thu Apr 2 21:58:39 2020 +0100 drm/i915/selftests: Check for has-reset before testing hostile contexts In order to kill off a hostile context, we need to be able to reset the GPU. So check that is supported prior to beginning the test. Reported-by: Tvrtko Ursulin Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200402205839.25065-1-chris@chris-wilson.co.uk commit 89ff76bf9b3b0b86e6bbe344bd6378d8661303fc Author: Chris Wilson Date: Thu Apr 2 13:42:18 2020 +0100 drm/i915/gem: Utilize rcu iteration of context engines Now that we can peek at GEM->engines[] and obtain a reference to them using RCU, do so for instances where we can safely iterate the potentially old copy of the engines. For setting, we can do this when we know the engine properties are copied over before swapping, so we know the new engines already have the global property and we update the old before they are discarded. For reading, we only need to be safe; as we do so on behalf of the user, their races are their own problem. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200402124218.6375-1-chris@chris-wilson.co.uk commit 4c977837ba296e4b601e2b0abd11c4b296e7786b Author: Chris Wilson Date: Wed Apr 1 12:04:34 2020 +0100 drm/i915/execlists: Peek at the next submission for error interrupts If we receive the error interrupt before the CS interrupt, we may find ourselves without an active request to reset, skipping the GPU reset. All because the attempt to reset was too early. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200401110435.30389-1-chris@chris-wilson.co.uk commit 7bcb773dafc0d5209575a96e6f08d6d62bafb023 Author: Chris Wilson Date: Mon Mar 30 22:22:54 2020 +0100 drm/i915/uc: Cleanup kerneldoc warnings drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:205: warning: Excess function parameter 'supported' description in 'intel_uc_fw_init_early' drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:205: warning: Excess function parameter 'platform' description in 'intel_uc_fw_init_early' drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:205: warning: Excess function parameter 'rev' description in 'intel_uc_fw_init_early' drivers/gpu/drm/i915/gt/uc/intel_guc_log.c:696: warning: Function parameter or member 'log' not described in 'intel_guc_log_info' drivers/gpu/drm/i915/gt/uc/intel_guc_log.c:696: warning: Excess function parameter 'guc' description in 'intel_guc_log_info' Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200330212254.18236-1-chris@chris-wilson.co.uk commit b812e5b4aaed827f3d0691543a8c48846db45152 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:50 2020 +0100 drm/zte: Use simple encoder The zte driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-23-tzimmermann@suse.de commit d19561579d230db8151c93ff54c91c3baa3b037a Author: Thomas Zimmermann Date: Thu Mar 5 16:59:48 2020 +0100 drm/vkms: Use simple encoder The vkms driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-21-tzimmermann@suse.de commit 35b9df3cde204c01f5023ca099aa59b000b98e64 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:47 2020 +0100 drm/virtgpu: Use simple encoder The virtgpu driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-20-tzimmermann@suse.de commit f6ebc1b0f7725ccf5c282b59bd45fc8ef4d7cfd0 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:46 2020 +0100 drm/vc4: Use simple encoder The vc4 driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Acked-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-19-tzimmermann@suse.de commit d877d6ea7773b3aa3d03c359c85262fb0468c41a Author: Thomas Zimmermann Date: Thu Mar 5 16:59:45 2020 +0100 drm/tilcdc: Use simple encoder The tilcdc driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Acked-by: Jyri Sarha Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-18-tzimmermann@suse.de commit b28ad7deb2f21770cc9c8fe2843ba56add424b54 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:44 2020 +0100 drm/tidss: Use simple encoder The tidss driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Acked-by: Jyri Sarha Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-17-tzimmermann@suse.de commit 4d0e95e0e5679936b45848826aa080ced1ba40c8 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:43 2020 +0100 drm/tegra: Use simple encoder The tegra driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-16-tzimmermann@suse.de commit f9f3a38d16542cb6521a14b4c8ed674c1cae2355 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:42 2020 +0100 drm/sun4i: Use simple encoder The ingenic driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-15-tzimmermann@suse.de commit 2d2e89dafc858444edc30d1c3923920c4e917331 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:41 2020 +0100 drm/shmobile: Use simple encoder The shmobile driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-14-tzimmermann@suse.de commit 0dbd735448bfdb078a429d5d63e1bd0ef2c5d0f0 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:40 2020 +0100 drm/rockchip: Use simple encoder The rockchip driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-13-tzimmermann@suse.de commit f9b21bde1af5d42e4752b0f26a5c41aae1cbb3cc Author: Thomas Zimmermann Date: Thu Mar 5 16:59:39 2020 +0100 drm/rcar-du: Use simple encoder The rcar-du driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-12-tzimmermann@suse.de commit b534c4f550d9eed1b8b4aed5ca92360c53828c82 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:38 2020 +0100 drm/mediatek: Use simple encoder The mediatek driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Matthias Brugger Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Acked-by: CK Hu Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-11-tzimmermann@suse.de commit c9f9a6f2f0489fb052b2cc00622581a75d4bdaf5 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:37 2020 +0100 drm/ingenic: Use simple encoder The ingenic driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-10-tzimmermann@suse.de commit 62fbddda2f72b86d6126da2bdbddc330544c6e9f Author: Thomas Zimmermann Date: Thu Mar 5 16:59:36 2020 +0100 drm/imx: Use simple encoder The imx driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-9-tzimmermann@suse.de commit a1170f90c4d825b68f5262732312a015ae83e8ff Author: Thomas Zimmermann Date: Thu Mar 5 16:59:35 2020 +0100 drm/i2c/tda998x: Use simple encoder The tda998x driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-8-tzimmermann@suse.de commit 785b07e1ba600b09a612168ea4445f12bd9bfd07 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:34 2020 +0100 drm/hisilicon/kirin: Use simple encoder The kirin driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-7-tzimmermann@suse.de commit d088b69f5017f86628a875592414545ba23938f8 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:33 2020 +0100 drm/gma500: Use simple encoder The gma500 driver uses empty implementations for some of its encoders. Replace the code with the generic simple encoder. As a side effect, the patch also removes an indirection in the encoder setup for Medfield. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-6-tzimmermann@suse.de commit 3d5e73abb7be15e18c88e4cdcfed6b7f27f47656 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:32 2020 +0100 drm/fsl-dcu: Use simple encoder The fsl-dcu driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-5-tzimmermann@suse.de commit 3e1fe32dd5bc046845fb65d4072761adfdd0ed3c Author: Thomas Zimmermann Date: Thu Mar 5 16:59:31 2020 +0100 drm/exynos: Use simple encoder The exynos driver uses empty implementations for its encoders. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-4-tzimmermann@suse.de commit cbb9ea426cc889041d242ad7e43a7e474d963273 Author: Thomas Zimmermann Date: Thu Mar 5 16:59:30 2020 +0100 drm/atmel-hlcdc: Use simple encoder The atmel-hlcdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-3-tzimmermann@suse.de commit 6a1e7ccf8cdcd6d5c108c592d0591a1752a45b9c Author: Laurent Pinchart Date: Thu Apr 2 12:53:25 2020 +0300 drm: Fix wrong kfree() in managed resource usage example The example code showing how to use the managed resource API calls kfree() on the wrong pointer. Fix it. Signed-off-by: Laurent Pinchart Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200402095325.5266-1-laurent.pinchart+renesas@ideasonboard.com commit 92516cd97fd4d8ad5b1421a0d51771044f453a5f Author: Sonny Sasaka Date: Fri Mar 27 17:34:23 2020 -0700 Bluetooth: Always request for user confirmation for Just Works To improve security, always give the user-space daemon a chance to accept or reject a Just Works pairing (LE). The daemon may decide to auto-accept based on the user's intent. Signed-off-by: Sonny Sasaka Signed-off-by: Marcel Holtmann commit 3ee7b7cd83900bb711efadbf16fa096a615a1566 Author: Luiz Augusto von Dentz Date: Fri Mar 27 11:32:15 2020 -0700 Bluetooth: Add BT_MODE socket option This adds BT_MODE socket option which can be used to set L2CAP modes, including modes only supported over LE which were not supported using the L2CAP_OPTIONS. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit b86b0b150fed840c376145383ef5105116c81b0c Author: Luiz Augusto von Dentz Date: Fri Mar 27 11:32:14 2020 -0700 Bluetooth: L2CAP: Fix handling LE modes by L2CAP_OPTIONS L2CAP_OPTIONS shall only be used with BR/EDR modes. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 139dfad6cfa0ff816ea06d70132b164a44257c12 Author: Rocky Liao Date: Wed Mar 25 10:26:38 2020 +0800 dt-bindings: net: bluetooth: Add device tree bindings for QCA chip QCA6390 This patch adds compatible string for the QCA chip QCA6390. Signed-off-by: Rocky Liao Signed-off-by: Marcel Holtmann commit e5d6468fe9d8dced9af0c548a359a7dbeb31c931 Author: Rocky Liao Date: Wed Mar 25 10:26:37 2020 +0800 Bluetooth: hci_qca: Add support for Qualcomm Bluetooth SoC QCA6390 This patch adds support for QCA6390, including the devicetree and acpi compatible hwid matching, and patch/nvm downloading. Signed-off-by: Rocky Liao Signed-off-by: Marcel Holtmann commit 9da0ea09639f35cb91c5f2c44a96d192dad112e1 Author: Chris Wilson Date: Wed Apr 1 23:39:24 2020 +0100 drm/i915/gem: Drop cached obj->bind_count We cached the number of vma bound to the object in order to speed up shrinker decisions. This has been superseded by being more proactive in removing objects we cannot shrink from the shrinker lists, and so we can drop the clumsy attempt at atomically counting the bind count and comparing it to the number of pinned mappings of the object. This will only get more clumsier with asynchronous binding and unbinding. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200401223924.16667-1-chris@chris-wilson.co.uk commit 0d86ee35097ae0f1c2c50f2b8035ef480e25e4f1 Author: Chris Wilson Date: Wed Apr 1 22:01:04 2020 +0100 drm/i915/gt: Make fence revocation unequivocal If we must revoke the fence because the VMA is no longer present, or because the fence no longer applies, ensure that we do and convert it into an error if we try but cannot. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200401210104.15907-3-chris@chris-wilson.co.uk commit 725c9ee7fc6ddbfd0f0fa3e59b8021e9420a3198 Author: Chris Wilson Date: Wed Apr 1 22:01:03 2020 +0100 drm/i915/gt: Store the fence details on the fence Make a copy of the object tiling parameters at the point of grabbing the fence. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200401210104.15907-2-chris@chris-wilson.co.uk commit 63baf4f3d5875bc929d13bf8a559178ed4e8f1de Author: Chris Wilson Date: Wed Apr 1 22:01:02 2020 +0100 drm/i915/gt: Only wait for GPU activity before unbinding a GGTT fence Only GPU activity via the GGTT fence is asynchronous, we know that we control the CPU access directly, so we only need to wait for the GPU to stop using the fence before we relinquish it. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200401210104.15907-1-chris@chris-wilson.co.uk commit 8a338f4bf64242e3284b4d937890aee8899500cd Author: Chris Wilson Date: Wed Apr 1 20:41:35 2020 +0100 drm/i915/gem: Try allocating va from free space If the current node/entry location is occupied, and the object is not pinned, try assigning it some free space. We cannot wait here, so if in doubt, we unreserve and try to grab all at once. v2: Use the final pin_flags so that we won't have to move the object if we find the wrong free space. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200401194135.5442-1-chris@chris-wilson.co.uk commit a871afc8d05cfba993bb69a6713e42d64f6e5110 Author: Lyude Paul Date: Tue Mar 31 17:22:24 2020 -0400 drm/amd/dc: Kill dc_conn_log_hex_linux() DRM already supports tracing DPCD transactions, there's no reason for the existence of this function. Also, it prints one byte per-line which is way too loud. So, just remove it. Reviewed-by: Nicholas Kazlauskas Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher commit a98c4cd926903ff2aa452b6dbf5be6411a2fbe60 Author: Lyude Paul Date: Tue Mar 31 17:22:23 2020 -0400 drm/amd/amdgpu_dm/mst: Remove useless sideband tracing We already trace DPCD reads/writes on both MST and SST, there's no reason to have this code here (plus, toggling these things with a define at the top of the file isn't how we do things in the kernel). Reviewed-by: Nicholas Kazlauskas Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher commit a500194e73c87e112a6d3833b38eefb4057a2c9e Author: Colin Ian King Date: Wed Apr 1 17:35:45 2020 +0100 drm/amdgpu/vcn: fix spelling mistake "fimware" -> "firmware" There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 82c416b13cb7d22b96ec0888b296a48dff8a09eb Author: Christian König Date: Thu Mar 12 12:03:34 2020 +0100 drm/amdgpu: fix and cleanup amdgpu_gem_object_close v4 The problem is that we can't add the clear fence to the BO when there is an exclusive fence on it since we can't guarantee the the clear fence will complete after the exclusive one. To fix this refactor the function and also add the exclusive fence as shared to the resv object. v2: fix warning v3: add excl fence as shared instead v4: squash in fix for fence handling in amdgpu_gem_object_close Signed-off-by: Christian König Reviewed-by: xinhui pan Signed-off-by: Alex Deucher commit 9ec420d833413e39a46b5327ac27436e24d1ad12 Author: Melissa Wen Date: Tue Mar 31 08:00:32 2020 -0300 drm/amd/display: code cleanup of dc_link file on func dc_link_construct Removes codestyle issues in dc_link file, on dc_link_construct and translate_encoder_to_transmitter as suggested by checkpatch.pl. Types covered: CHECK: Lines should not end with a '(' WARNING: Missing a blank line after declarations CHECK: Alignment should match open parenthesis CHECK: Comparison to NULL could be written CHECK: Logical continuations should be on the previous line CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit ded3491b85225c68cce45a4568893f7d8dd7fc51 Author: Melissa Wen Date: Tue Mar 31 07:59:59 2020 -0300 drm/amd/display: code cleanup on dc_link from is_same_edid to get_ddc_line Removes codestyle issues on the file dc_link between is_same_edid and get_ddc_line as suggested by checkpatch.pl. Types covered: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' WARNING: braces {} are not necessary for single statement blocks CHECK: Comparison to NULL could be written CHECK: Lines should not end with a '(' CHECK: Alignment should match open parenthesis CHECK: Using comparison to false is error prone CHECK: Using comparison to true is error prone WARNING: Avoid multiple line dereference - prefer 'link->dpcd_caps.sink_count.bits.SINK_COUNT' CHECK: Unnecessary parentheses around WARNING: Missing a blank line after declarations Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit 621514aa4140543dec5d533eb636d4b1484000b0 Author: Melissa Wen Date: Tue Mar 31 07:59:20 2020 -0300 drm/amd/display: codestyle cleanup on dc_link file until detect_dp func Removes codestyle issues on the file dc_link until detect_dp func as suggested by checkpatch.pl. Types covered: CHECK: Please don't use multiple blank lines CHECK: Comparison to NULL could be written ERROR: space required before the open parenthesis '(' CHECK: Alignment should match open parenthesis CHECK: Lines should not end with a '(' WARNING: please, no space before tabs WARNING: Comparisons should place the constant on the right side of the test WARNING: braces {} are not necessary for single statement blocks CHECK: Please don't use multiple blank lines Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit 2176409956eb1f2c3bbe988e31142587e5757c72 Author: Melissa Wen Date: Tue Mar 31 07:57:34 2020 -0300 drm/amd/display: cleanup codestyle type BLOCK_COMMENT_STYLE on dc_link Solve comments alignment problems on dc_link file Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit e520859cde724ea451561520ceceb5a630eef4f2 Author: James Zhu Date: Mon Feb 10 10:28:00 2020 -0500 drm/amdgpu: enable VCN2.5 DPG mode for Arcturus Enable VCN2.5 DPG mode for arcturus after below items are applied. ASD: 0x21000023 SOS: 0x17003B VCN firmware Version ENC: 1.1 DEC: 1 VEP: 0 Revision: 16 VBIOS: 23 Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit c97e3076eb7ace8adc51ed9fe646c2e7cd0941ca Author: James Zhu Date: Sun Mar 29 20:15:44 2020 -0400 drm/amdgpu/vcn2.5: Add firmware w/r ptr reset sync Add firmware write/read point reset sync through shared memory Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 9352141027afd8230846c1ca3a0b91ce8855677c Author: James Zhu Date: Sun Mar 29 20:11:34 2020 -0400 drm/amdgpu/vcn2.0: Add firmware w/r ptr reset sync Add firmware write/read point reset sync through shared memory Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 2c68f0e3771d2f414d4095ab96039c1d004eadb4 Author: James Zhu Date: Sun Mar 29 20:00:22 2020 -0400 drm/amdgpu/vcn: Add firmware share memory support Added firmware share memory support for VCN. Current multiple queue mode is enabled only. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit ad9469fb5b3ce2a004e95637ff4387b47d853713 Author: James Zhu Date: Tue Feb 18 17:46:29 2020 -0500 drm/amdgpu/vcn2.5: stall DPG when WPTR/RPTR reset Add vcn dpg harware synchronization to fix race condition issue between vcn driver and hardware. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit ef563ff403404ef2f234abe79bdd9f04ab6481c9 Author: James Zhu Date: Tue Feb 18 17:44:39 2020 -0500 drm/amdgpu/vcn2.0: stall DPG when WPTR/RPTR reset Add vcn dpg harware synchronization to fix race condition issue between vcn driver and hardware. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit e3b41d82dabaf6f1da94df8339afeee66e9b1a7e Author: James Zhu Date: Mon Feb 10 12:52:16 2020 -0500 drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switch Couldn't only rely on enc fence to decide switching to dpg unpaude mode. Since a enc thread may not schedule a fence in time during multiple threads running situation. v3: 1. Rename enc_submission_cnt to dpg_enc_submission_cnt 2. Add dpg_enc_submission_cnt check in idle_work_handler v4: Remove extra counter check, and reduce counter before idle work schedule Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit bd718638b8513e20a481a67f37a8acc1ebf2d957 Author: James Zhu Date: Mon Feb 10 12:41:41 2020 -0500 drm/amdgpu/vcn: fix race condition issue for vcn start Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter check, and reduce counter before idle work schedule Signed-off-by: James Zhu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 17e137f27cb1e868a55ac5c41e1863660a388a9c Author: Yintian Tao Date: Tue Mar 10 23:24:53 2020 +0800 drm/amdgpu: skip access sdma_v5_0 registers under SRIOV (v2) Due to the new L1.0b0c011b policy, many SDMA registers are blocked which raise the violation warning. There are total 6 pair register needed to be skipped when driver init and de-init. mmSDMA0/1_CNTL mmSDMA0/1_F32_CNTL mmSDMA0/1_UTCL1_PAGE mmSDMA0/1_UTCL1_CNTL mmSDMA0/1_CHICKEN_BITS, mmSDMA0/1_SEM_WAIT_FAIL_TIMER_CNTL v2: squash in warning fix Signed-off-by: Yintian Tao Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit 1675c3a24d075d484377003789245f48c2114a0b Author: Christian König Date: Fri Feb 21 15:10:31 2020 +0100 drm/amdgpu: stop disable the scheduler during HW fini When we stop the HW for example for GPU reset we should not stop the front-end scheduler. Otherwise we run into intermediate failures during command submission. The scheduler should only be stopped in very few cases: 1. We can't get the hardware working in ring or IB test after a GPU reset. 2. The KIQ scheduler is not used in the front-end and should be disabled during GPU reset. 3. In amdgpu_ring_fini() when the driver unloads. Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Nirmoy Das Test-by: Dennis Li Signed-off-by: Alex Deucher commit 6b6706cdaca344a9279fe124bf87da040f5711fb Author: Evan Quan Date: Fri Mar 27 11:20:29 2020 +0800 drm/amd/powerplay: added mutex protection on msg issuing This could avoid the possible race condition. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit a0ec225633d9f681e393a1827f29f02c837deb84 Author: Evan Quan Date: Fri Mar 27 10:48:20 2020 +0800 drm/amd/powerplay: unified interfaces for message issuing and response checking This can avoid potential race condition between them. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 5964f3feb0001bdb7d03269bcf9a3822c31607ea Author: Evan Quan Date: Thu Mar 26 18:01:25 2020 +0800 drm/amd/powerplay: avoid calling Vega20 specific SMU message implemention Prepare for coming lock protection for SMU message issuing. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 81bf835ef90d709409a0f2c948c6034331350d08 Author: Evan Quan Date: Thu Mar 26 17:52:50 2020 +0800 drm/amd/powerplay: avoid calling SMU10 specific SMU message implemention Prepare for coming lock protection for SMU message issuing. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 7843f537422a8280516e5b94b6bfb6328089580d Author: Evan Quan Date: Thu Mar 26 17:44:45 2020 +0800 drm/amd/powerplay: avoid calling SMU9 specific SMU message implemention Prepare for coming lock protection for SMU message issuing. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 92e0070e02e885ddc4f590dbc8c7d1ff3cc5fb87 Author: Evan Quan Date: Thu Mar 26 16:47:45 2020 +0800 drm/amd/powerplay: avoid calling SMU8 specific SMU message implemention Prepare for coming lock protection for SMU message issuing. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 87f09ec6c62d0fb30886530adee8f0be6d1a974c Author: Evan Quan Date: Thu Mar 26 16:35:25 2020 +0800 drm/amd/powerpaly: drop unused APIs Drop unused smu7 message APIs. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit d9c8316eb3722688e969804566eb456ef4e8bf26 Author: Evan Quan Date: Thu Mar 26 16:30:52 2020 +0800 drm/amd/powerplay: avoid calling SMU7 specific SMU message implemention Prepare for coming lock protection for SMU message issuing. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 22ecc9665d40b3d0eaa4e99cf3f90c07f0d77f3e Author: Evan Quan Date: Thu Mar 26 16:09:05 2020 +0800 drm/amd/powerplay: avoid calling CI specific SMU message implemention Prepare for coming lock protection for SMU message issuing. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 9e94ff33861031cb3714f6484f67740c3b2da137 Author: Alex Sierra Date: Mon Mar 23 14:00:43 2020 -0500 drm/amdgpu: reroute VMC and UMD to IH ring 1 for oss v5 [Why] Due Page faults can easily overwhelm the interrupt handler. So to make sure that we never lose valuable interrupts on the primary ring we re-route page faults to IH ring 1. It also facilitates the recovery page process, since it's already running from a process context. This is valid for Arcturus and future Navi generation GPUs. [How] Setting IH_CLIENT_CFG_DATA for VMC and UMD IH clients. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0ab176e69c8d82d43fea23c51498653a3a28f13e Author: Alex Sierra Date: Mon Mar 23 13:53:39 2020 -0500 drm/amdgpu: call psp to program ih cntl in SR-IOV for Navi call psp to program ih cntl in SR-IOV if supported on Navi and Arcturus. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ab518012062d9a7adbdea189ecffb53133c2bb42 Author: Alex Sierra Date: Mon Mar 23 13:28:15 2020 -0500 drm/amdgpu: enable IH ring 1 and ring 2 for navi Support added into IH to enable ring1 and ring2 for navi10_ih. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b635ae8744e181dcd3a1d7861be09dbc1b56b44f Author: Alex Sierra Date: Wed Mar 18 18:26:19 2020 -0500 drm/amdgpu: ih doorbell size of range changed for nbio v7.4 [Why] nbio v7.4 size of ih doorbell range is 64 bit. This requires 2 DWords per register. [How] Change ih doorbell size from 2 to 4. This means two Dwords per ring. Current configuration uses two ih rings. Signed-off-by: Alex Sierra Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 04cdac5c17f0336ee53e14a2d839a1b75ed45ebf Author: Alex Sierra Date: Wed Mar 18 17:57:10 2020 -0500 drm/amdgpu: infinite retries fix from UTLC1 RB SDMA [Why] Previously these registers were set to 0. This was causing an infinite retry on the UTCL1 RB, preventing higher priority RB such as paging RB. [How] Set to one the SDMAx_UTLC1_TIMEOUT registers for all SDMAs on Vega10, Vega12, Vega20 and Arcturus. Signed-off-by: Alex Sierra Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a9d82d2f91297679cfafd7e61c4bccdca6cd550d Author: Evan Quan Date: Fri Mar 27 15:39:06 2020 +0800 drm/amdgpu: fix non-pointer dereference for non-RAS supported Backtrace on gpu recover test on Navi10. [ 1324.516681] RIP: 0010:amdgpu_ras_set_error_query_ready+0x15/0x20 [amdgpu] [ 1324.523778] Code: 4c 89 f7 e8 cd a2 a0 d8 e9 99 fe ff ff 45 31 ff e9 91 fe ff ff 0f 1f 44 00 00 55 48 85 ff 48 89 e5 74 0e 48 8b 87 d8 2b 01 00 <40> 88 b0 38 01 00 00 5d c3 66 90 0f 1f 44 00 00 55 31 c0 48 85 ff [ 1324.543452] RSP: 0018:ffffaa1040e4bd28 EFLAGS: 00010286 [ 1324.549025] RAX: 0000000000000000 RBX: ffff911198b20000 RCX: 0000000000000000 [ 1324.556217] RDX: 00000000000c0a01 RSI: 0000000000000000 RDI: ffff911198b20000 [ 1324.563514] RBP: ffffaa1040e4bd28 R08: 0000000000001000 R09: ffff91119d0028c0 [ 1324.570804] R10: ffffffff9a606b40 R11: 0000000000000000 R12: 0000000000000000 [ 1324.578413] R13: ffffaa1040e4bd70 R14: ffff911198b20000 R15: 0000000000000000 [ 1324.586464] FS: 00007f4441cbf540(0000) GS:ffff91119ed80000(0000) knlGS:0000000000000000 [ 1324.595434] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1324.601345] CR2: 0000000000000138 CR3: 00000003fcdf8004 CR4: 00000000003606e0 [ 1324.608694] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1324.616303] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1324.623678] Call Trace: [ 1324.626270] amdgpu_device_gpu_recover+0x6e7/0xc50 [amdgpu] [ 1324.632018] ? seq_printf+0x4e/0x70 [ 1324.636652] amdgpu_debugfs_gpu_recover+0x50/0x80 [amdgpu] [ 1324.643371] seq_read+0xda/0x420 [ 1324.647601] full_proxy_read+0x5c/0x90 [ 1324.652426] __vfs_read+0x1b/0x40 [ 1324.656734] vfs_read+0x8e/0x130 [ 1324.660981] ksys_read+0xa7/0xe0 [ 1324.665201] __x64_sys_read+0x1a/0x20 [ 1324.669907] do_syscall_64+0x57/0x1c0 [ 1324.674517] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1324.680654] RIP: 0033:0x7f44417cf081 Signed-off-by: Evan Quan Reviewed-by: John Clements Signed-off-by: Alex Deucher commit c76c1a429788f148b151f0d1179011ec6200fe39 Author: Tom St Denis Date: Fri Mar 27 09:30:52 2020 -0400 drm/amd/amdgpu: Include headers for PWR and SMUIO registers Clean up the smu10, smu12, and gfx9 drivers to use headers for registers instead of hardcoding in the C source files. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c8e42d57859d5055bfe3313cfd5dc025097b753e Author: xinhui pan Date: Thu Mar 26 08:38:29 2020 +0800 drm/amdgpu: implement more ib pools (v2) We have three ib pools, they are normal, VM, direct pools. Any jobs which schedule IBs without dependence on gpu scheduler should use DIRECT pool. Any jobs schedule direct VM update IBs should use VM pool. Any other jobs use NORMAL pool. v2: squash in coding style fix Signed-off-by: xinhui pan Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ac60b2294c9ea4a9c5f0c6c021c9a779243a8995 Author: Wyatt Wood Date: Wed Mar 11 15:46:26 2020 -0400 drm/amd/display: Move backlight pwm enable function call [Why] Can't call dmub_abm_enable_fractional_pwm from dmub_abm_create as dmub_srv is still null at this init stage, and therefore can't call to fw. [How] Move call to dmub_abm_init_backlight. This should be the first call from the driver for ABM. Signed-off-by: Wyatt Wood Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 16012806e697bdee44329adc3e55631c5ab667f3 Author: Wyatt Wood Date: Thu Feb 20 11:50:44 2020 -0500 drm/amd/display: Add ABM driver implementation [Why] Moving ABM from DMCU to DMCUB. [How] Add ABM driver files and implementation. Signed-off-by: Wyatt Wood Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 46484870d02acc174cbf2c22400c1b7b38346818 Author: Aric Cyr Date: Mon Mar 9 11:08:49 2020 -0400 drm/amd/display: 3.2.77 Signed-off-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b7b2a316b95e09ad51db0fd18c5f291051b06117 Author: Jiawei Date: Thu Mar 26 15:10:51 2020 +0800 drm/amdgpu: extend compute job timeout extend compute lockup timeout to 60000 for SR-IOV. Reviewed-by: Emily Deng Signed-off-by: Jiawei Signed-off-by: Alex Deucher commit ad31da434eb3c41fe291851316267fa73d352bed Author: Emily Deng Date: Thu Mar 26 13:41:57 2020 +0800 drm/amdgpu: No need support vcn decode As no need to support vcn decode feature, so disable the ring for SR-IOV. Signed-off-by: Emily Deng Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit 2f2941324c65bf23695038968cecab4e5cde647e Author: Monk Liu Date: Tue Mar 10 18:12:13 2020 +0800 drm/amdgpu: postpone entering fullaccess mode if host support new handshake we only need to enter fullaccess_mode in ip_init() part, otherwise we need to do it before reading vbios (becuase host prepares vbios for VF only after received REQ_GPU_INIT event under legacy handshake) Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit dffa11b4f74b1572341a667ec7a006420dc48626 Author: Monk Liu Date: Wed Mar 4 21:33:27 2020 +0800 drm/amdgpu: adjust sequence of ip_discovery init and timeout_setting what: 1)move timtout setting before ip_early_init to reduce exclusive mode cost for SRIOV 2)move ip_discovery_init() to inside of amdgpu_discovery_reg_base_init() it is a prepare for the later upcoming patches. why: in later upcoming patches we would use a new mailbox event -- "req_gpu_init_data", which is a callback hooked in adev->virt.ops and this callback send a new event "REQ_GPU_INIT_DAT" to host to notify host to do some preparation like "IP discovery/vbios on the VF FB" and this callback must be: A) invoked after set_ip_block() because virt.ops is configured during set_ip_block() B) invoked before ip_discovery_init() becausen ip_discovery_init() need host side prepares everything in VF FB first. current place of ip_discovery_init() is before we can invoke callback of adev->virt.ops, thus we must move ip_discovery_init() to a place after the adev->virt.ops all settle done, and the perfect place is in amdgpu_discovery_reg_base_init() Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit 122078de168b8380e9dde15a5c04a5412e710cb6 Author: Monk Liu Date: Wed Mar 4 23:51:51 2020 +0800 drm/amdgpu: equip new req_init_data handshake by this new handshake host side can prepare vbios/ip-discovery and pf&vf exchange data upon recieving this request without stopping world switch. this way the world switch is less impacted by VF's exclusive mode request Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit ff1f03a7b8c4787faefdb44b189e39cbf4f7611c Author: Monk Liu Date: Wed Mar 4 23:46:45 2020 +0800 drm/amdgpu: use static mmio offset for NV mailbox what: with the new "req_init_data" handshake we need to use mailbox before do IP discovery, so in mxgpu_nv.c file the original SOC15_REG method won'twork because that depends on IP discovery complete first. how: so the solution is to always use static MMIO offset for NV+ mailbox registers. HW team confirm us all MAILBOX registers will be at the same offset for all ASICs, no IP discovery needed for those registers Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit aa53bc2edb66624ac05902910c41d8b4f685b8bc Author: Monk Liu Date: Wed Mar 4 11:38:36 2020 +0800 drm/amdgpu: introduce new request and its function 1) modify xgpu_nv_send_access_requests to support new idh request 2) introduce new function: req_gpu_init_data() which is used to notify host to prepare vbios/ip-discovery/pfvf exchange Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit c27cbdd2d073baf77deaf3e73dace7945a72dde7 Author: Monk Liu Date: Tue Mar 3 18:13:51 2020 +0800 drm/amdgpu: introduce new idh_request/event enum new idh_request and ihd_event to prepare for the new handshake protocol implementation later Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit 4d130238a7600fbaa47fb07bf5ede5a2cb2c1622 Author: Monk Liu Date: Tue Mar 3 16:40:00 2020 +0800 drm/amdgpu: cleanup idh event/req for NV headers 1) drop the headers from AI in mxgpu_nv.c, should refer to mxgpu_nv.h 2) the IDH_EVENT_MAX is not used and not aligned with host side so drop it 3) the IDH_TEXT_MESSAG was provided in host but not defined in guest Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit ba56657d187ac77afa1063334fe2e28b3aebbf74 Author: Tom St Denis Date: Wed Mar 25 15:07:01 2020 -0400 drm/amd/amdgpu: Fix SMUIO/PWR Confusion (v2) The PWR block was merged into the SMUIO block by revision 12 so we add that to the smuio_12_0_0 headers. (v2): Drop nonsensical smuio_10_0_0 header Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6c33a6f4c8a6db1f208bb5e1c250a3328961e35e Author: Tom St Denis Date: Wed Mar 25 13:44:54 2020 -0400 drm/amd/amdgpu: Move PWR_MISC_CNTL_STATUS to its own header The register is part of the PWR block not the GC block. Move to its own header. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2e40d9b915d4b95ea9eb7de471fe76267ddf31e8 Author: Tom St Denis Date: Wed Mar 25 09:33:29 2020 -0400 drm/amd/amdgpu: Add missing SMUIO v12 register to headers This register is needed by umr. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 955df04e3b31c9365f52ff16588eec434d33dd60 Author: Chen Zhou Date: Wed Mar 25 10:32:50 2020 +0800 drm/amdgpu/uvd7: remove unnecessary conversion to bool The conversion to bool is not needed, remove it. Signed-off-by: Chen Zhou Signed-off-by: Alex Deucher commit 1bd9c9392732d4829d13f25f7a9bf46a18e99a71 Author: Masahiro Yamada Date: Fri Feb 14 00:39:27 2020 +0900 drm/radeon: align short build log This beautifies the build log. [Before] HOSTCC drivers/gpu/drm/radeon/mkregtable MKREGTABLE drivers/gpu/drm/radeon/r100_reg_safe.h MKREGTABLE drivers/gpu/drm/radeon/rn50_reg_safe.h CC [M] drivers/gpu/drm/radeon/r100.o MKREGTABLE drivers/gpu/drm/radeon/r300_reg_safe.h CC [M] drivers/gpu/drm/radeon/r300.o [After] HOSTCC drivers/gpu/drm/radeon/mkregtable MKREG drivers/gpu/drm/radeon/r100_reg_safe.h MKREG drivers/gpu/drm/radeon/rn50_reg_safe.h CC [M] drivers/gpu/drm/radeon/r100.o MKREG drivers/gpu/drm/radeon/r300_reg_safe.h CC [M] drivers/gpu/drm/radeon/r300.o Signed-off-by: Masahiro Yamada Signed-off-by: Alex Deucher commit a341deb9723671141530c431bc73a77df82254df Author: Masahiro Yamada Date: Fri Feb 14 00:39:26 2020 +0900 drm/radeon: use pattern rule to avoid code duplication in Makefile This Makefile repeats similar build rules. Use a pattern rule. Signed-off-by: Masahiro Yamada Signed-off-by: Alex Deucher commit 4ed513b52dc849564ccff7ef42580274ef91b1b8 Author: Masahiro Yamada Date: Wed Mar 25 16:48:35 2020 -0400 drm/radeon: fix build rules of *_reg_safe.h if_changed must have FORCE as a prerequisite, and the targets must be added to 'targets'. Signed-off-by: Masahiro Yamada Signed-off-by: Alex Deucher commit 4bc97748e3f4669f2909201c3cc27c649b9f8b8a Author: Masahiro Yamada Date: Wed Mar 25 16:47:16 2020 -0400 drm/radeon: remove unneeded header include path A header include path without $(srctree)/ is suspicious because it does not work with O= builds. You can build drivers/gpu/drm/radeon/ without this include path. Signed-off-by: Masahiro Yamada Signed-off-by: Alex Deucher commit d73cd701278a04a55e41fa0d094aed492720d551 Author: Emily Deng Date: Wed Mar 25 18:58:02 2020 +0800 drm/amdgpu: Ignore the not supported error from psp As the VCN firmware will not use vf vmr now. And new psp policy won't support set tmr now. For driver compatible issue, ignore the not support error. Signed-off-by: Emily Deng Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit 6bc8cdde574b1120502688fb52061a216d112ed3 Author: Emily Deng Date: Wed Mar 25 18:59:16 2020 +0800 drm/amdgpu: Add 4k resolution for virtual display Add 4k resolution for virtual connector. Signed-off-by: Emily Deng Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit 02f6efb47856cd239a9e4104e26a41ec61887bb0 Author: Emily Deng Date: Wed Mar 25 19:01:58 2020 +0800 drm/amdgpu: Virtual display need to support multiple ctrcs The crtc num is determined by virtual_display parameter. Signed-off-by: Emily Deng Reviewed-by: Monk Liu Signed-off-by: Alex Deucher commit 61380faa4b4cc577df8a7ff5db5859bac6b351f7 Author: John Clements Date: Wed Mar 25 16:01:14 2020 +0800 drm/amdgpu: disable ras query and iject during gpu reset added flag to ras context to indicate if ras query functionality is ready Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 66399248feaf4a2fa4cd76765412a4139aca28e9 Author: John Clements Date: Wed Mar 25 15:56:31 2020 +0800 drm/amdgpu: added xgmi ras error reset sequence added mechanism to clear xgmi ras status inbetween error queries Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 3aa0115d238c71423d0e212138678a8cf51d4361 Author: Monk Liu Date: Wed Mar 4 14:02:55 2020 +0800 drm/amdgpu: cleanup all virtualization detection routine we need to move virt detection much earlier because: 1) HW team confirms us that RCC_IOV_FUNC_IDENTIFIER will always be at DE5 (dw) mmio offset from vega10, this way there is no need to implement detect_hw_virt() routine in each nbio/chip file. for VI SRIOV chip (tonga & fiji), the BIF_IOV_FUNC_IDENTIFIER is at 0x1503 2) we need to acknowledged we are SRIOV VF before we do IP discovery because the IP discovery content will be updated by host everytime after it recieved a new coming "REQ_GPU_INIT_DATA" request from guest (there will be patches for this new handshake soon). Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit b89659b783291f9e91dd2d91fc34fc6354116bfe Author: Monk Liu Date: Tue Mar 3 19:23:24 2020 +0800 drm/amdgpu: amends feature bits for MM bandwidth mgr Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit 8884532a6e0fb3f76affd26b0c57e58a5833c072 Author: Monk Liu Date: Wed Mar 4 13:46:09 2020 +0800 drm/amdgpu: purge ip_discovery headers those two headers are not needed for ip discovery Signed-off-by: Monk Liu Reviewed-by: Emily Deng Signed-off-by: Alex Deucher commit 714309f0f3e32a52beca44460986caf8d9e143f3 Author: Kent Russell Date: Tue Mar 24 05:29:46 2020 -0400 drm/amdgpu: Fix FRU data checking Ensure that when we memcpy, we don't end up copying more data than the struct supports. For now, this is 16 characters for product number and serial number, and 32 chars for product name Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 358e00e0adc8622f2acd6bf70704e7a86df2b568 Author: Kent Russell Date: Tue Mar 24 07:40:20 2020 -0400 drm/amdgpu: Expose TA FW version in fw_version file Reporting the fw_version just returns 0, the actual version is kept as ta_*_ucode_version. This is the same as the feature reported in the amdgpu_firmware_info debugfs file. Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fabe01d7bbda15ae608fe8fa221b596fe498b037 Author: John Clements Date: Mon Mar 23 17:22:01 2020 +0800 drm/amdgpu: disabled fru eeprom access added asic support checking function to be filled in by supported asic types Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher commit 1f02c97b32dd983ab1646bc77d7e75c52ca97c5a Author: Tom St Denis Date: Fri Mar 20 14:21:58 2020 -0400 drm/amd/amdgpu: Add GFX9.1 PWR_MISC_CNTL_STATUS register to headers The registers are needed for umr and not in the headers. I left them in the gfx_v9_0.c since it includes 9.0 and 9.4 headers and including 9.1 headers would result in a lot of duplicate registers clashing. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 18485be976574d484e1efd80785b2dc6ce15ca2d Author: Kent Russell Date: Fri Mar 20 09:19:01 2020 -0400 drm/amdgpu: Add documentation for unique_id Add the amdgpu.rst tie-ins for the unique_id documentation Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1af8e76e1418fd7f8d0ffedcd64c27026ead8978 Author: Kent Russell Date: Fri Mar 20 09:17:21 2020 -0400 drm/amdgpu: Add documentation for PCIe accounting Add the amdgpu.rst tie-ins for the pcie accounting documentation Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1d90c13d711911e7b15d6eb3b4b02daaadfd7b5e Author: Kent Russell Date: Thu Mar 19 15:03:40 2020 -0400 drm/amdgpu: Add documentation for memory info Add the amdgpu.rst tie-ins for the mem_info documentation Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit bd607166af7fe31f8d8e9c575f4561a4b56b9f24 Author: Kent Russell Date: Fri Mar 13 09:21:55 2020 -0400 drm/amdgpu: Enable reading FRU chip via I2C v3 Allow for reading of information like manufacturer, product number and serial number from the FRU chip. Report the serial number as the new sysfs file serial_number. Note that this only works on server cards, as consumer cards do not feature the FRU chip, which contains this information. v2: Add documentation to amdgpu.rst, add helper functions, rename functions for consistency, fix bad starting offset v3: Remove testing definitions Signed-off-by: Kent Russell Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 0d961c4610ff24fdd6d98782b443e27d176aa006 Author: Chen Zhou Date: Wed Apr 1 10:25:06 2020 +0800 drm/i915/gt: fix spelling mistake "undeflow" -> "underflow" There is a spelling mistake in comment, fix it. Signed-off-by: Chen Zhou Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200401022506.52965-1-chenzhou10@huawei.com commit a5572d1f0d7f74f3135c6af7513492950ccd7a26 Author: Chris Wilson Date: Wed Apr 1 12:15:54 2020 +0100 drm/i915/gt: Align engine dump active/pending Insert a space so that the same fields between active/pending execlists state are aligned. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200401111554.6279-1-chris@chris-wilson.co.uk commit bcf6293d7ae931159fac4fbd9924b0276f1edabd Author: Andrzej Pietrasiewicz Date: Tue Mar 31 17:53:08 2020 +0200 drm/core: Calculate bpp in afbc helper Some drivers (komeda, malidp) don't set anything in cpp. If that is the case the right value can be inferred from the format. Then the "bpp" member can be eliminated from struct drm_afbc_framebuffer. Signed-off-by: Andrzej Pietrasiewicz Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200331155308.6345-3-andrzej.p@collabora.com commit 88f1b29a44b197852828d3aba5fefa0082d377ff Author: Andrzej Pietrasiewicz Date: Tue Mar 31 17:53:07 2020 +0200 drm/core: Use proper debugging macro Use drm_dbg_kms() instead of DRM_DEBUG_KMS. Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200331155308.6345-2-andrzej.p@collabora.com commit 8523f8875bee3831ea602b2229e73e2fe096a354 Author: Christian König Date: Tue Mar 10 14:23:12 2020 +0100 drm/amdgpu: improve amdgpu_gem_info debugfs file Note if a buffer was imported using peer2peer. Signed-off-by: Christian König Acked-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/359296 commit f44ffd677fb3562ac0a1ff9c8ae52672be741f00 Author: Christian König Date: Fri Mar 23 16:56:37 2018 +0100 drm/amdgpu: add support for exporting VRAM using DMA-buf v3 We should be able to do this now after checking all the prerequisites. v2: fix entrie count in the sgt v3: manually construct the sg Signed-off-by: Christian König Acked-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/359295 commit 48262cd9499c9cd0faf687ef9427cc0b0a3b0189 Author: Christian König Date: Fri Mar 23 16:33:57 2018 +0100 drm/amdgpu: add checks if DMA-buf P2P is supported Check if we can do peer2peer on the PCIe bus. Signed-off-by: Christian König Acked-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/359294 commit 57b7b62f5a7436fbe5c190c5c8960121d0b9041d Author: Christian König Date: Thu Mar 22 19:21:30 2018 +0100 drm/amdgpu: note that we can handle peer2peer DMA-buf Importing should work out of the box. Signed-off-by: Christian König Acked-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/359293 commit efa557bc7c8118330d47b814edb88949f5159442 Author: Christian König Date: Mon Mar 30 15:45:01 2020 +0200 drm/ttm: lock resv object during destruction Calling ttm_bo_cleanup_memtype_use() destroys the TT object which in turn could result in warnings without this. Signed-off-by: Christian König Acked-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/359288 commit 09606b5446c25b2c3b16c5bd2977eca730e3a570 Author: Christian König Date: Thu Mar 22 17:09:42 2018 +0100 dma-buf: add peer2peer flag Add a peer2peer flag noting that the importer can deal with device resources which are not backed by pages. Signed-off-by: Christian König Acked-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/359286/ commit 97a37c919f6262fe75afc4a4eb838093bf18b032 Author: Chris Wilson Date: Tue Mar 31 17:21:50 2020 +0100 drm/i915/gem: Ignore readonly failures when updating relocs If the user passes in a readonly reloc[], by the time we notice we have already committed to modifying the execobjects, or have indeed done so already. Reporting the failure just compounds the issue as we have no second pass to fall back to anymore. "Be damned if you do, and damned if you don't." Testcase: igt/gem_exec_reloc/readonly Fixes: 7dc8f1143778 ("drm/i915/gem: Drop relocation slowpath") References: fddcd00a49e9 ("drm/i915: Force the slow path after a user-write error") Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Joonas Lahtinen Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200331162150.3635-1-chris@chris-wilson.co.uk commit bdf7e3b782efbc6ca8fd4d6cd663f14a00cafdad Author: Maya Rashish Date: Sat Mar 21 22:29:59 2020 +0000 drm/dp_mst: make build_clear_payload_id_table return void Nothing uses the always-0 return value. Signed-off-by: Maya Rashish Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200321222959.GA1053@SDF.ORG commit 4d6c18590870fbac1e65dde5e01e621c8e0ca096 Author: Chris Wilson Date: Tue Mar 31 16:23:48 2020 +0100 drm/i915/gt: Fill all the unused space in the GGTT When we allocate space in the GGTT we may have to allocate a larger region than will be populated by the object to accommodate fencing. Make sure that this space beyond the end of the buffer points safely into scratch space, in case the HW tries to access it anyway (e.g. fenced access to the last tile row). v2: Preemptively / conservatively guard gen6 ggtt as well. Reported-by: Imre Deak References: https://gitlab.freedesktop.org/drm/intel/-/issues/1554 Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Imre Deak Cc: stable@vger.kernel.org Reviewed-by: Matthew Auld Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20200331152348.26946-1-chris@chris-wilson.co.uk commit 708c82d59b149bd0c146108794f00fc357a7853d Author: Mika Kuoppala Date: Tue Mar 31 16:54:03 2020 +0300 drm/i915: Report all failed registers for ctx isolation For CI it is enough to point out a single failure in isolation. However it is beneficial to gather info in logs for transients further down the line. Do not stop into first comparison failure but continue probing forward. v2: for all engines and poisons (Chris) Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200331135403.16906-1-mika.kuoppala@linux.intel.com commit 606727842d8b167fecd7cacfda6bded90d93754c Author: Chris Wilson Date: Tue Mar 31 10:42:39 2020 +0100 drm/i915/gt: Include the execlists CCID of each port in the engine dump Since we print out EXECLISTS_STATUS in the dump, also print out the CCID of each context so we can cross check between the two. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200331094239.23145-1-chris@chris-wilson.co.uk commit 917155557238826b830011b67f110017b1f8ffad Author: Chris Wilson Date: Tue Mar 31 10:14:57 2020 +0100 drm/i915/execlists: Pause CS flow before reset Since we may be attempting to reset an active engine, we try to freeze it in place before resetting -- to be on the safe side. We can go one step further if we are using the CS flow semaphore to prevent the context switching into the next. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200331091459.29179-2-chris@chris-wilson.co.uk commit 71a6688e81d992d244bc56e6061441ec16b4b2e1 Author: Chris Wilson Date: Tue Mar 31 10:14:56 2020 +0100 drm/i915/selftests: Tidy up an error message for live_error_interrupt Since we don't wait for the error interrupt to reset, restart and then complete the guilty request, clean up the error messages. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200331091459.29179-1-chris@chris-wilson.co.uk commit f53ae29c0ea16914be272b311ee75c16dcdf5c65 Author: Chris Wilson Date: Tue Mar 31 13:05:02 2020 +0100 drm/i915/gt: Include a few tracek for timeslicing Add a few telltales to see when timeslicing is being enabled. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200331120502.14713-1-chris@chris-wilson.co.uk commit 86dbf52d26cce688ed45d8080f337aa42913ceaa Author: Chris Wilson Date: Tue Mar 31 12:48:52 2020 +0100 drm/i915: Defer kicking the tasklet until all rescheduling is complete Since we may kick more than engine, and may kick each one a couple of times, coalesce the tasklet execution to the end. This also ensures that we have the chance to run the tasklet immediately after priority bumping. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200331114852.11583-1-chris@chris-wilson.co.uk commit 9f7ffa297978c63ea55181899de7afaa9b68331b Author: José Roberto de Souza Date: Mon Mar 30 14:00:44 2020 -0700 drm/i915/tc/icl: Update TC vswing tables Specification was updated with vswing tables for different configurations. Also reordering icl_mg_phy_ddi_buf_trans struct to match table order. BSpec: 21735 Signed-off-by: José Roberto de Souza Reviewed-by: Clinton Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20200330210044.130510-3-jose.souza@intel.com commit a2ae2010d3b713f3adcf8b7fb08d43eaf586e7d3 Author: José Roberto de Souza Date: Mon Mar 30 14:00:43 2020 -0700 drm/i915/dp/ehl: Update vswing table for HBR and RBR EHL has now only one table for all DP rates. BSpec: 21257 Signed-off-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200330210044.130510-2-jose.souza@intel.com commit 70988115ac69ecc249aa0f8e8265e8daf87bc28c Author: José Roberto de Souza Date: Mon Mar 30 14:00:42 2020 -0700 drm/i915/dp: Return the right vswing tables DDI ports have its encoders initialized with INTEL_OUTPUT_DDI type and later eDP ports that have the type changed to INTEL_OUTPUT_EDP. But for all other DDI ports it can drive HDMI or DP depending on what user connects to the ports. ehl_get_combo_buf_trans() and tgl_get_combo_buf_trans() was checking for INTEL_OUTPUT_DP that was never true, causing wrong vswing tables being used. So here replacing the INTEL_OUTPUT_DP checks by the valid output types that this functions receives as parameters. HDMI cases will be correctly handled as it do not use encoder->type, instead it calls the functions with INTEL_OUTPUT_HDMI as type parameter and HDMI don't have retraining. v2: changed INTEL_OUTPUT_DDI to INTEL_OUTPUT_EDP and INTEL_OUTPUT_HDMI Fixes: bd3cf6f7ce20 ("drm/i915/dp/tgl+: Update combo phy vswing tables") Cc: Clinton A Taylor Cc: Matt Roper Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200330210044.130510-1-jose.souza@intel.com commit f77a2db27f26c3ccba0681f7e89fef083718f07f Author: Imre Deak Date: Mon Mar 30 18:22:44 2020 +0300 drm/i915/icl+: Don't enable DDI IO power on a TypeC port in TBT mode The DDI IO power well must not be enabled for a TypeC port in TBT mode, ensure this during driver loading/system resume. This gets rid of error messages like [drm] *ERROR* power well DDI E TC2 IO state mismatch (refcount 1/enabled 0) and avoids leaking the power ref when disabling the output. Cc: # v5.4+ Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200330152244.11316-1-imre.deak@intel.com commit 80e5f89da3ab949fbbf1cae01dfaea29f5483a75 Author: Huacai Chen Date: Tue Mar 31 14:18:08 2020 +0800 drm/qxl: Use correct notify port address when creating cursor ring The command ring and cursor ring use different notify port addresses definition: QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR. However, in qxl_device_init() we use QXL_IO_NOTIFY_CMD to create both command ring and cursor ring. This doesn't cause any problems now, because QEMU's behaviors on QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR are the same. However, QEMU's behavior may be change in future, so let's fix it. P.S.: In the X.org QXL driver, the notify port address of cursor ring is correct. Signed-off-by: Huacai Chen Cc: Link: http://patchwork.freedesktop.org/patch/msgid/1585635488-17507-1-git-send-email-chenhc@lemote.com Signed-off-by: Gerd Hoffmann commit 2713778cbfca756eccd754339b785712ef464a98 Author: Christian König Date: Mon Mar 30 14:30:41 2020 +0200 drm/mm: revert "Break long searches in fragmented address spaces" This reverts commit 7be1b9b8e9d1e9ef0342d2e001f44eec4030aa4d. The drm_mm is supposed to work in atomic context, so calling schedule() or in this case cond_resched() is illegal. Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/359278/ commit e6219defd36653c531b8da5e83f55a8d0796dc72 Author: Simon Ser Date: Sun Mar 29 14:45:08 2020 +0000 drm: add docs about the IN_FORMATS plane property This is a standard property attached to planes in drm_universal_plane_init when drm_mode_config.allow_fb_modifiers is true. Signed-off-by: Simon Ser Cc: Daniel Vetter Cc: Daniel Stone Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/mHOtz80Wa-x3A5Lz5ETTM65VUMfW1j6b-iCuvIy1RzOM1EloHPqAb2MnbU8ygZi0ABaLrxuN6pzu0v3QRn83125C0bXuHoo-DQWWEd80fdw=@emersion.fr commit e2ccf0d009b145c89baf35fe5c1f71a511848951 Author: Chris Wilson Date: Tue Mar 31 00:43:18 2020 +0100 drm/i915/execlists: Double check breadcrumb before crying foul process_csb: 0000:00:02.0 bcs0: cs-irq head=4, tail=5 process_csb: 0000:00:02.0 bcs0: csb[5]: status=0x00008002:0x60000020 trace_ports: 0000:00:02.0 bcs0: preempted { ff84:45154! prio 2 } trace_ports: 0000:00:02.0 bcs0: promote { ff84:45155* prio 2 } trace_ports: 0000:00:02.0 bcs0: submit { ff84:45156 prio 2 } process_csb: 0000:00:02.0 bcs0: cs-irq head=5, tail=6 process_csb: 0000:00:02.0 bcs0: csb[6]: status=0x00000018:0x60000020 trace_ports: 0000:00:02.0 bcs0: completed { ff84:45155* prio 2 } process_csb: 0000:00:02.0 bcs0: ring:{start:0x00178000, head:0928, tail:0928, ctl:00000000, mode:00000200} process_csb: 0000:00:02.0 bcs0: rq:{start:00178000, head:08b0, tail:08f0, seqno:ff84:45155, hwsp:45156}, process_csb: 0000:00:02.0 bcs0: ctx:{start:00178000, head:e000928, tail:0928}, process_csb: GEM_BUG_ON("context completed before request") In this sequence, we can see that although we have submitted the next request [ff84:45156] to HW (via ELSP[]) it has not yet reported the lite-restore. Instead, we see the completion event of the currently active request [ff84:45155] but at the time of processing that event, the breadcrumb has not yet been written. Though by the time we do print out the debug info, the seqno write of ff84:45156 has landed! Therefore there is a serialisation problem between the seqno writes and CS events, not just between the CS buffer and its head/tail pointers as previously observed on Icelake. This is not a huge problem, as we don't strictly rely on the breadcrumb to determine HW activity, but it may indicate that interrupt delivery is before the seqno write, aka bringing back the plague of missed interrupts from yesteryear. However, there is no indication of this wider problem, so let's just flush the seqno read before reporting an error. If it persists after the fresh read we can worry again. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200330234318.30638-1-chris@chris-wilson.co.uk commit d16e137e7f4b3ccb2b66081b9bc40bc0cbe5aef8 Author: Lionel Landwerlin Date: Mon Mar 30 12:14:11 2020 +0300 drm/i915/perf: don't read head/tail pointers outside critical section Reading or writing those fields should only happen under stream->oa_buffer.ptr_lock. Signed-off-by: Lionel Landwerlin Fixes: d1df41eb72ef ("drm/i915/perf: rework aging tail workaround") Reviewed-by: Chris Wilson Acked-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20200330091411.37357-1-lionel.g.landwerlin@intel.com commit b28b34ac85d73ec77c6c442ab72fe0c7769e6475 Author: Chris Wilson Date: Mon Mar 30 13:58:27 2020 +0100 drm/i915/execlists: Explicitly reset both reg and context runtime Upon a GPU reset, we copy the default context image over top of the guilty image. This will rollback the CTX_TIMESTAMP register to before our value of ce->runtime.last. Reset both back to 0 so that we do not encounter an underflow on the next schedule out after resume. This should not be a huge issue in practice, as hangs should be rare in correct code. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200330125827.5804-1-chris@chris-wilson.co.uk commit c7da606edab6b4234d420c56ad855092f787e722 Author: Daniel Vetter Date: Sat Mar 28 17:23:58 2020 +0100 drm/managed: Fix off-by-one in warning I'm thinking this is the warning that fired in the 0day report, but I can't double-check yet since 0day didn't upload its source tree anywhere I can check. And all the drivers I can easily test don't use drm_dev_alloc anymore ... Also if I'm correct supreme amounts of bad luck because usually kslap (for bigger structures) gives us something quite a bit bigger than what we asked for. [0day uploaded tree, guess is correct] Reported-by: kernel test robot Fixes: c6603c740e0e ("drm: add managed resources tied to drm_device") Reviewed-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Dan Carpenter Cc: Laurent Pinchart Cc: Neil Armstrong Cc: "Rafael J. Wysocki" Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200328162358.18500-1-daniel.vetter@ffwll.ch commit 0f1dd02295f35dcdcbaafcbcbbec0753884ab974 Author: Chris Wilson Date: Mon Mar 30 14:37:10 2020 +0100 drm/i915/gem: Split eb_vma into its own allocation Use a separate array allocation for the execbuf vma, so that we can track their lifetime independently from the copy of the user arguments. With luck, this has a secondary benefit of splitting the malloc size to within reason and avoid vmalloc. The downside is that we might require two separate vmallocs -- but much less likely. In the process, this prevents a memory leak on the ww_mutex error unwind. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1390 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200330133710.14385-1-chris@chris-wilson.co.uk commit 303973aaef1204fa205c1dccc6f8cac15812a8c9 Author: Sam Ravnborg Date: Sat Mar 28 14:20:21 2020 +0100 drm/fb: fix kernel-doc in drm_framebuffer.h Fix following warnings: drm_framebuffer.h:342: warning: Function parameter or member 'block_width' not described in 'drm_afbc_framebuffer' drm_framebuffer.h:342: warning: Function parameter or member 'block_height' not described in 'drm_afbc_framebuffer' Trivial spelling mistakes. Signed-off-by: Sam Ravnborg Acked-by: Andrzej Pietrasiewicz Fixes: 55f7f72753ab ("drm/core: Add drm_afbc_framebuffer and a corresponding helper") Cc: Andrzej Pietrasiewicz Cc: Emil Velikov Cc: James Qian Wang Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200328132025.19910-3-sam@ravnborg.org commit d7d50f801d445f9f17221573c2eda9f7b23fb891 Author: Chris Wilson Date: Fri Mar 27 11:22:12 2020 +0000 drm/i915/perf: Schedule oa_config after modifying the contexts We wish that the scheduler emit the context modification commands prior to enabling the oa_config, for which we must explicitly inform it of the ordering constraints. This is especially important as we now wait for the final oa_config setup to be completed and as this wait may be on a distinct context to the state modifications, we need that command packet to be always last in the queue. We borrow the i915_active for its ability to track multiple timelines and the last dma_fence on each; a flexible dma_resv. Keeping track of each dma_fence is important for us so that we can efficiently schedule the requests and reprioritise as required. Reported-by: Lionel Landwerlin Signed-off-by: Chris Wilson Cc: Lionel Landwerlin Reviewed-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20200327112212.16046-3-chris@chris-wilson.co.uk commit 229007e02d697b0662f85378aae53531b0dfea05 Author: Chris Wilson Date: Fri Mar 27 11:22:11 2020 +0000 drm/i915: Wrap i915_active in a simple kreffed struct For conveniences of callers that just want to use an i915_active to track a wide array of concurrent timelines, wrap the base i915_active struct inside a kref. This i915_active will self-destruct after use. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200327112212.16046-2-chris@chris-wilson.co.uk commit d75a92a81467933404547edf47ec63d58d7e2b2f Author: Chris Wilson Date: Fri Mar 27 11:22:10 2020 +0000 drm/i915: Allow for different modes of interruptible i915_active_wait Allow some users the discretion to not immediately return on a normal signal. Hopefully, they will opt to use TASK_KILLABLE instead. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200327112212.16046-1-chris@chris-wilson.co.uk commit 4b379a48ded0cb4d95471edfe91d55fe41f1d120 Author: Chris Wilson Date: Mon Mar 30 13:16:44 2020 +0100 drm/i915/selftests: Check timeout before flush and cond checks Allow a bit of leniency for the CPU scheduler to be distracted while we flush the tasklet and so ensure that we always check the status of the request once more before timing out. v2: Wait until the HW acked the submit, and we do any secondary actions for the submit (e.g. timeslices) Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200330121644.25277-1-chris@chris-wilson.co.uk commit 8b6d457f953290b494e05444ad920fc4baa1162b Author: Chris Wilson Date: Mon Mar 30 12:31:37 2020 +0100 drm/i915/execlists: Include priority info in trace_ports Add some extra information into trace_ports to help with reviewing correctness. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200330113137.24425-1-chris@chris-wilson.co.uk commit d472634ef9e143a4ac566e5bec953cc52e2618fe Author: Michal Wajdeczko Date: Mon Mar 30 13:33:38 2020 +0200 drm/i915/huc: Fix HuC register used in debugfs We report HuC status in debugfs using register read, but we missed that on Gen11+ HuC uses different register. Use correct one. While here, correct placement of the colon. Signed-off-by: Michal Wajdeczko Cc: Daniele Ceraolo Spurio Cc: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200330113338.1713-1-michal.wajdeczko@intel.com commit 6c0ac4d5fff7fc5d990cc79c0231f02d88a69b9b Author: Sam Ravnborg Date: Sat Mar 28 14:20:24 2020 +0100 drm/dp_mst: add kernel-doc for drm_dp_mst_port.fec_capable Fix kernel-doc warnings for drm_dp_mst_port.fec_capable. This fixed the following warning: drm_dp_mst_helper.h:162: warning: Function parameter or member 'fec_capable' not described in 'drm_dp_mst_port' Signed-off-by: Sam Ravnborg Cc: David Francis Cc: Lyude Paul Cc: Harry Wentland Cc: Mikita Lipski Cc: Alex Deucher Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter [Wrapped commit msg + s/network/topology] Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200328132025.19910-6-sam@ravnborg.org commit 2da48b1f888d70c008ab7a4c15d60e3421fe4a22 Author: Michal Wajdeczko Date: Mon Mar 30 13:33:02 2020 +0200 drm/i915/huc: Add more errors for I915_PARAM_HUC_STATUS There might be many reasons why we failed to successfully load and authenticate HuC firmware, but today we only use single error in case of no HuC hardware. Add some more error codes for most common cases (disabled, not installed, corrupted or mismatched firmware). Signed-off-by: Michal Wajdeczko Cc: Joonas Lahtinen Cc: Chris Wilson Cc: Daniele Ceraolo Spurio Cc: Tony Ye Cc: Robert M. Fosha Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200330113302.1670-1-michal.wajdeczko@intel.com commit 2bf99b22beff545d360fb0cc3a977add147713b6 Author: Emil Velikov Date: Thu Mar 19 17:29:30 2020 +0000 drm: error out with EBUSY when device has existing master As requested by Adam, provide different error message for when the device has an existing master. An audit of the following projects, shows that the errno is used only for printf() purposes. xorg/xserver xorg/drivers/xf86-video-ati xorg/drivers/xf86-video-amdgpu xorg/drivers/xf86-video-intel xorg/drivers/xf86-video-tegra xorg/drivers/xf86-video-freedreno xorg/drivers/xf86-video-nouveau xorg/drivers/xf86-video-vmwgfx qt/kwin/plasma gtk/mutter/gnomeshell efl/enlightment Cc: Adam Jackson Suggested-by: Adam Jackson Signed-off-by: Emil Velikov Reviewed-by: Adam Jackson Link: https://patchwork.freedesktop.org/patch/msgid/20200319172930.230583-2-emil.l.velikov@gmail.com commit 45bc3d26c95a8fc63a7d8668ca9e57ef0883351c Author: Emil Velikov Date: Thu Mar 19 17:29:29 2020 +0000 drm: rework SET_MASTER and DROP_MASTER perm handling This commit reworks the permission handling of the two ioctls. In particular it enforced the CAP_SYS_ADMIN check only, if: - we're issuing the ioctl from process other than the one which opened the node, and - we are, or were master in the past This ensures that we: - do not regress the systemd-logind style of DRM_MASTER arbitrator - allow applications which do not use systemd-logind to drop their master capabilities (and regain them at later point) ... w/o running as root. See the comment above drm_master_check_perm() for more details. v1: - Tweak wording, fixup all checks, add igt test v2: - Add a few more comments, grammar nitpicks. Cc: Adam Jackson Cc: Daniel Vetter Cc: Pekka Paalanen Testcase: igt/core_setmaster/master-drop-set-user Signed-off-by: Emil Velikov Reviewed-by: Adam Jackson Link: https://patchwork.freedesktop.org/patch/msgid/20200319172930.230583-1-emil.l.velikov@gmail.com commit 86b17c7f14ed1a442246a332c90df0e81003a2d3 Author: Peter Chen Date: Thu Mar 26 16:26:22 2020 +0800 usb: chipidea: core: show the real pointer value for register The pointer value is "ptrval" like below at current code: ci_hdrc ci_hdrc.0: ChipIdea HDRC found, revision: 25, lpm: 0; cap: (ptrval) op: (ptrval) According to Documentation/core-api/printk-formats.rst, we change it from %p to %px for real value. Signed-off-by: Peter Chen commit 80990f3fdc0a9e7cf9c86f13ce6ab89a616c3551 Author: Peter Chen Date: Thu Mar 26 15:53:57 2020 +0800 usb: chipidea: core: refine the description for this driver Some descriptions are outdated, update them. Signed-off-by: Peter Chen commit 5de131d2134910d326fe6d6e882e88e9c6da2c71 Author: Peter Chen Date: Mon Mar 23 21:20:23 2020 +0800 usb: chipidea: udc: fix the kernel doc for udc.h The kernel doc for td_node is outdated, update it. Signed-off-by: Peter Chen commit c7ccc1b783681722638ec0c432908f69d197303a Author: Wolfram Sang Date: Thu Mar 26 22:10:04 2020 +0100 drm/radeon: convert to use i2c_new_client_device() Move away from the deprecated API. Signed-off-by: Wolfram Sang Acked-by: Alex Deucher Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-7-wsa+renesas@sang-engineering.com commit 3f9becf950aa9ceb949f6df90fd3d027d30fe69c Author: Wolfram Sang Date: Thu Mar 26 22:10:03 2020 +0100 drm/nouveau/therm: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Alex Deucher Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-6-wsa+renesas@sang-engineering.com commit bf2993c19b00af9b68c10ff1089e1ea90dc0e19f Author: Wolfram Sang Date: Thu Mar 26 22:10:02 2020 +0100 drm/i2c/tda998x: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Alex Deucher Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-5-wsa+renesas@sang-engineering.com commit d1fe2e78f27f45aec626d104c2577be59f83ff4d Author: Wolfram Sang Date: Thu Mar 26 22:10:01 2020 +0100 drm/i2c/sil164: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Alex Deucher Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-4-wsa+renesas@sang-engineering.com commit fae6802daf46fa4665fe964eb943f026bcf32fbf Author: Wolfram Sang Date: Thu Mar 26 22:10:00 2020 +0100 drm/gma500: convert to use i2c_new_client_device() Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Alex Deucher Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-3-wsa+renesas@sang-engineering.com commit 0bf659504912718312547d4ebf14a4e678c4f060 Author: Wolfram Sang Date: Thu Mar 26 22:09:59 2020 +0100 drm/amdgpu: convert to use i2c_new_client_device() Move away from the deprecated API. Signed-off-by: Wolfram Sang Acked-by: Alex Deucher Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-2-wsa+renesas@sang-engineering.com commit 0ddc945269710d8c1ac0afb10bee73edf133b938 Author: Harigovindan P Date: Fri Mar 27 13:06:35 2020 +0530 dt-bindings: display: add visionox rm69299 panel variant Add bindings for visionox rm69299 panel. Signed-off-by: Harigovindan P Signed-off-by: Sam Ravnborg [fixed indent] Link: https://patchwork.freedesktop.org/patch/msgid/20200327073636.13823-2-harigovi@codeaurora.org commit b1e44754af50e567c2a3caffffe462a432d796bb Author: Fabio Estevam Date: Sat Mar 28 15:36:41 2020 -0300 dt-bindings: display: xpp055c272: Remove the reg property Commit 52120e8c7ae3 ("dt-bindings: display: fix panel warnings") removed the dsi unit name, but missed to remove the 'reg' property, which causes the following 'make dt_binding_check' warning: Documentation/devicetree/bindings/display/panel/xinpeng,xpp055c272.example.dts:17.5-29.11: Warning (unit_address_vs_reg): /example-0/dsi: node has a reg or ranges property, but no unit name Fix it by removing the unneeded 'reg' property. Fixes: 52120e8c7ae3 ("dt-bindings: display: fix panel warnings") Signed-off-by: Fabio Estevam Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200328183641.11226-2-festevam@gmail.com commit dcde9c02f86f069dfa4b144dee0072b8cf430bcb Author: Fabio Estevam Date: Sat Mar 28 15:36:40 2020 -0300 dt-bindings: display: ltk500hd1829: Remove the reg property Commit 52120e8c7ae3 ("dt-bindings: display: fix panel warnings") removed the dsi unit name, but missed to remove the 'reg' property, which causes the following 'make dt_binding_check' warning: Documentation/devicetree/bindings/display/panel/leadtek,ltk500hd1829.example.dts:17.5-29.11: Warning (unit_address_vs_reg): /example-0/dsi: node has a reg or ranges property, but no unit name Fix it by removing the unneeded 'reg' property. Fixes: 52120e8c7ae3 ("dt-bindings: display: fix panel warnings") Signed-off-by: Fabio Estevam Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200328183641.11226-1-festevam@gmail.com commit 105235e4ae4cbdf068116ca0526567cfae79076d Author: Pascal Roeleven Date: Fri Mar 20 12:21:33 2020 +0100 drm: panel: Add Starry KR070PE2T The KR070PE2T is a 7" panel with a resolution of 800x480. KR070PE2T is the marking present on the ribbon cable. As this panel is probably available under different brands, this marking will catch most devices. As I can't find a datasheet for this panel, the bus_flags are instead from trial-and-error. The flags seem to be common for these kind of panels as well. Signed-off-by: Pascal Roeleven Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200320112205.7100-3-dev@pascalroeleven.nl commit c2eee4bfda5603291d917917307791d85d1aace4 Author: Pascal Roeleven Date: Fri Mar 20 12:21:32 2020 +0100 dt-bindings: panel: Add binding for Starry KR070PE2T Add the devicetree binding for Starry KR070PE2T Signed-off-by: Pascal Roeleven Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200320112205.7100-2-dev@pascalroeleven.nl commit 1996970773a323533e1cc1b6b97f00a95d675f32 Author: Martin Blumenstingl Date: Thu Mar 19 21:34:27 2020 +0100 drm/lima: Add optional devfreq and cooling device support Most platforms with a Mali-400 or Mali-450 GPU also have support for changing the GPU clock frequency. Add devfreq support so the GPU clock rate is updated based on the actual GPU usage when the "operating-points-v2" property is present in the board.dts. The actual devfreq code is taken from panfrost_devfreq.c and modified so it matches what the lima hardware needs: - a call to dev_pm_opp_set_clkname() during initialization because there are two clocks on Mali-4x0 IPs. "core" is the one that actually clocks the GPU so we need to control it using devfreq. - locking when reading or writing the devfreq statistics because (unlike than panfrost) we have multiple PP and GP IRQs which may finish jobs concurrently. Signed-off-by: Martin Blumenstingl Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200319203427.2259891-3-martin.blumenstingl@googlemail.com commit 106d4ffd6cb8f15f3b66c0f64c16dfeda4f395e2 Author: Aditya Swarup Date: Wed Mar 18 18:59:41 2020 -0700 drm/i915/tgl: Add definitions for VRR registers and bits Add definitions for registers grouped under Transcoder VRR function with necessary bitfields. Bspec: 49268 v2: Use REG_GENMASK, correct tabs/space indentation and move the definitions near the transcoder section.(Jani) v3: Remove unnecessary prefix from bit/mask definitions.(Manasi) v4: Use 'trans' in macro for better readability.(Manasi) Cc: Manasi Navare Cc: Jani Nikula Cc: Ville Syrjala Cc: Matt Roper Signed-off-by: Aditya Swarup Reviewed-by: Manasi Navare Signed-off-by: Manasi Navare Link: https://patchwork.freedesktop.org/patch/msgid/20200319015941.28008-1-aditya.swarup@intel.com commit 35f3fd8182ba26e766f7b814e903acf19d01bbb5 Author: Chris Wilson Date: Fri Mar 27 20:14:33 2020 +0000 drm/i915/execlists: Workaround switching back to a completed context In what seems remarkably similar to the w/a required to not reload an idle context with HEAD==TAIL, it appears we must prevent the HW from switching to an idle context in ELSP[1], while simultaneously trying to preempt the HW to run another context and a continuation of the idle context (which is no longer idle). We can achieve this by preventing the context from completing while we reload a new ELSP (by applying ring_set_paused(1) across the whole of dequeue), except this eventually fails due to a lite-restore into a waiting semaphore does not generate an ACK. Instead, we try to avoid making the GPU do anything too challenging and not submit a new ELSP while the interrupts + CSB events appear to have fallen behind the completed contexts. We expect it to catch up shortly so we queue another tasklet execution and hope for the best. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1501 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200327201433.21864-1-chris@chris-wilson.co.uk commit f06f924a65fb3991614fb23a783d4fef9c8d14ea Author: Nicolas Saenz Julienne Date: Thu Mar 26 14:44:57 2020 +0100 ARM: bcm2835_defconfig: Enable fixed-regulator This regulator is now used to control the SD card's power supply on the Raspberry Pi 4. Suggested-by: Stefan Wahren Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200326134458.13992-1-nsaenzjulienne@suse.de commit 3ac395a5b3f3b678663fbb58381fdae2b1b57588 Author: Nicolas Saenz Julienne Date: Tue Mar 3 18:32:16 2020 +0100 ARM: dts: bcm283x: Use firmware PM driver for V3D The register based driver turned out to be unstable, specially on RPi3a+ but not limited to it. While a fix is being worked on, we roll back to using firmware based scheme. Fixes: e1dc2b2e1bef ("ARM: bcm283x: Switch V3D over to using the PM driver instead of firmware") Signed-off-by: Nicolas Saenz Julienne Tested-by: Stefan Wahren Link: https://lore.kernel.org/r/20200303173217.3987-1-nsaenzjulienne@suse.de commit 8f7a54a74d72c8e5b4023b2ee035508237ee853d Author: Nicolas Saenz Julienne Date: Fri Mar 6 18:44:13 2020 +0100 ARM: dts: bcm2711: Add vmmc regulator in emmc2 The SD card power can be controlled trough a pin routed into the board's external GPIO expander. Turn that into a regulator and provide it to emmc2. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200306174413.20634-12-nsaenzjulienne@suse.de commit 155c58f225281a7e4bb675370252477f2f9b9a30 Author: Nicolas Saenz Julienne Date: Fri Mar 6 18:44:12 2020 +0100 ARM: dts: bcm2711: Update expgpio's GPIO labels The 6th line of the GPIO expander is used to power the board's SD card. Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20200306174413.20634-11-nsaenzjulienne@suse.de commit 6bb0942e8f46863a745489cce27efe5be2a3885e Author: Sean Paul Date: Thu Feb 13 16:15:20 2020 -0500 drm/dp_mst: Remove single tx msg restriction. Now that we can support multiple simultaneous replies, remove the restrictions placed on sending new tx msgs. This patch essentially just reverts commit 5a64967a2f3b ("drm/dp_mst: Have DP_Tx send one msg at a time") now that the problem is solved in a different way. Cc: Wayne Lin Reviewed-by: Lyude Paul Reviewed-by: Wayne Lin Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200213211523.156998-4-sean@poorly.run commit fbc821c4a506a960e85f3e97e32cfab63d43f7d0 Author: Sean Paul Date: Thu Feb 13 16:15:19 2020 -0500 drm/mst: Support simultaneous down replies Currently we have one down reply message servicing the mst manager, so we need to serialize all tx msgs to ensure we only have one message in flight at a time. For obvious reasons this is suboptimal (but less suboptimal than the free-for-all we had before serialization). This patch removes the single down_rep_recv message from manager and adds 2 replies in the branch structure. The 2 replies mirrors the tx_slots which we use to rate-limit outgoing messages and correspond to seqno in the packet headers. Cc: Wayne Lin Reviewed-by: Lyude Paul Reviewed-by: Wayne Lin Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200213211523.156998-3-sean@poorly.run commit 21a729d00776799c553b1cf45cb798c852ead660 Author: Sean Paul Date: Thu Feb 13 16:15:18 2020 -0500 drm/mst: Separate sideband packet header parsing from message building In preparation of per-branch device down message handling, separate header parsing from message building. This will allow us to peek at figure out which branch device the message is from before starting to parse the message contents. Reviewed-by: Lyude Paul Reviewed-by: Wayne Lin [seanpaul s/drm_dp_sideband_msg_build/drm_dp_sideband_msg_set_header/] Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200213211523.156998-2-sean@poorly.run commit 05d756b0c3b8b56e682e2e23801057d85b423846 Author: Ville Syrjälä Date: Fri Mar 13 18:48:24 2020 +0200 drm/i915: Include port sync state in the state dump Dump the port sync stat in intel_dump_pipe_config(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-7-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit d4d7d9ca57a4e41e437cb03e694aa7259507c595 Author: Ville Syrjälä Date: Fri Mar 13 18:48:23 2020 +0200 drm/i915: Use REG_FIELD_PREP() & co. for TRANS_DDI_FUNC_CTL2 Clean up the TRANS_DDI_FUNC_CTL2 programming/readout by using REG_FIELD_PREP() & co. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-6-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 02d8ea47dbc30724aaac014ab0a7a31b095f88fb Author: Ville Syrjälä Date: Fri Mar 13 18:48:22 2020 +0200 drm/i915: Move icl_get_trans_port_sync_config() into the DDI code Move the port sync readout into the DDI code where it belongs. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-5-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit f73adacadfe5bb54e93938138e6e40eca9a6cc2e Author: Ville Syrjälä Date: Fri Mar 13 18:48:21 2020 +0200 drm/i915: Drop usless master_transcoder assignments The entire crtc state has been reset before readout so master_transcoder is already set to INVALID. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-4-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 589a4cd6cc436e9e2930d7bf3b630d968357cd90 Author: Ville Syrjälä Date: Fri Mar 13 18:48:20 2020 +0200 drm/i915: Move TRANS_DDI_FUNC_CTL2 programming where it belongs This port sync enable/disable stuff is misplaced. It's just another step of the normal TRANS_DDI_FUNC_CTL enable. Move it to its natural place. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-3-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 3a035ea46631d3af95c2032661bd304834d213f2 Author: Ville Syrjälä Date: Fri Mar 13 18:48:19 2020 +0200 drm/i915/mst: Use .compute_config_late() to compute master transcoder Use the recently introduced encoder .compute_config_late() hook to do the MST master transcoder assignment. Avoids having to do it in a funny way before we know the CPU transcoder of each pipe. And now we can also properly use hw.active instead of uapi.active since it too has been calculated earlier for everyone. Cc: José Roberto de Souza Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313164831.5980-2-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit d002491168fcd1cd7b8092e8467e21f648748ec2 Author: Chris Wilson Date: Thu Mar 26 14:27:27 2020 +0000 drm/i915: Differentiate between aliasing-ppgtt and ggtt pinning Userptr causes lockdep to complain when we are using the aliasing-ppgtt (and ggtt, but for that it is rightfully so to complain about) in that when we revoke the userptr we take a mutex which we also use to revoke the mmaps. However, we only revoke mmaps for GGTT bindings and we never allow userptr to create a GGTT binding so the warning should be false and is simply caused by our conflation of the aliasing-ppgtt with the ggtt. So lets try treating the binding into the aliasing-ppgtt as a separate lockclass from the ggtt. The downside is that we are deliberately suppressing lockdep;s ability to warn us of cycles. Closes: https://gitlab.freedesktop.org/drm/intel/issues/478 Signed-off-by: Chris Wilson Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200326142727.31962-1-chris@chris-wilson.co.uk commit 0c1abaa7fbfb994d91718f04ac05dc266ac447f4 Author: Ville Syrjälä Date: Thu Mar 19 18:38:44 2020 +0200 drm: Constify adjusted_mode a bit The DP link computation functions shouldn't modify the adjusted_mode so make it const. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200319163844.22783-3-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 743acd115070cecb5a4d5ae146248f90c402a2f0 Author: Ville Syrjälä Date: Tue Mar 10 22:27:52 2020 +0200 drm/i915: Get rid of silly void* from MST code Not sure why this thing is trying to avoid declaring the proper type for these pointers. But since these are used only once let's just get rid of the local variable entirely. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200310202752.28454-1-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 1c664c15cf0a31784b217a84fa0128ce46f17a84 Author: Kai Vehmanen Date: Tue Mar 24 17:32:12 2020 +0200 drm/i915: use forced codec wake on all gen9+ platforms Commit 632f3ab95fe2 ("drm/i915/audio: add codec wakeup override enabled/disable callback"), added logic to toggle Codec Wake on gen9. This is used by audio driver when it resets the HDA controller. It seems explicit toggling of the wakeline can help to fix problems with probe failing on some gen12 platforms. And based on specs, there is no reason why this programming sequence should not be applied to all gen9+ platforms. No side-effects are seen on gen10/11. So apply the wake-logic to all gen9+ platforms. Link: https://github.com/thesofproject/linux/issues/1847 Signed-off-by: Kai Vehmanen Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200324153212.6303-1-kai.vehmanen@linux.intel.com commit 4ef10fe05ba0b08ce7029c07878afe3c8d5754d8 Author: Lionel Landwerlin Date: Tue Mar 24 11:54:57 2020 -0700 drm/i915/perf: add new open param to configure polling of OA buffer This new parameter let's the application choose how often the OA buffer should be checked on the CPU side for data availability. Longer polling period tend to reduce CPU overhead if the application does not care about somewhat real time data collection. v2: Allow disabling polling completely with 0 value (Lionel) v3: Version the new parameter (Joonas) v4: Rebase (Umesh) v5: Make poll delay value of 0 invalid (Umesh) v6: - Describe poll_oa_period (Ashutosh) - Fix comment for new poll parameter (Lionel) - Drop open_flags in read_properties_unlocked (Lionel) - Rename uapi parameter (Ashutosh) v7: Reword the comment in uapi (Ashutosh) Signed-off-by: Lionel Landwerlin Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Signed-off-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20200324185457.14635-4-umesh.nerlige.ramappa@intel.com commit c51dbc6e8f1796d235f308ae365ffc4ad8c54ff9 Author: Lionel Landwerlin Date: Tue Mar 24 11:54:56 2020 -0700 drm/i915/perf: move pollin setup to non hw specific code This isn't really gen specific stuff, so just move it to the common code. v2: Rebase (Umesh) v3: Remove comment, pollin is a per stream state already (Ashutosh) Signed-off-by: Lionel Landwerlin Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Signed-off-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20200324185457.14635-3-umesh.nerlige.ramappa@intel.com commit d1df41eb72efbd132df5196e265a5fa1165b3255 Author: Lionel Landwerlin Date: Tue Mar 24 11:54:55 2020 -0700 drm/i915/perf: rework aging tail workaround We're about to introduce an options to open the perf stream, giving the user ability to configure how often it wants the kernel to poll the OA registers for available data. Right now the workaround against the OA tail pointer race condition requires at least twice the internal kernel polling timer to make any data available. This changes introduce checks on the OA data written into the circular buffer to make as much data as possible available on the first iteration of the polling timer. v2: Use OA_TAKEN macro without the gtt_offset (Lionel) v3: (Umesh) - Rebase - Change report to report32 from below review https://patchwork.freedesktop.org/patch/330704/?series=66697&rev=1 v4: (Ashutosh, Lionel) - Fix checkpatch errors - Fix aging_timestamp initialization - Check for only one valid landed report - Fix check for unlanded report v5: (Ashutosh) - Fix bug in accurately determining landed report. - Optimize the check for landed reports by going as far as the previously determined aged tail. Signed-off-by: Lionel Landwerlin Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Signed-off-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20200324185457.14635-2-umesh.nerlige.ramappa@intel.com commit 1a8bf67df6d87912ab1fc17fa1a7d63fbddddaee Author: Hans de Goede Date: Thu Mar 26 16:10:09 2020 +0100 drm/fb-helper: Add TODO for making drm_fb_helper_alloc_fbi fill apertures Currently drivers using drm_fbdev_generic_setup() end up with a single empty aperture in their fb_info struct. Not having the proper info in the apertures list causes register_framebuffer to not remove conflicting framebuffers, which some drivers currently workaround by manually calling drm_fb_helper_remove_conflicting_pci_framebuffers(). Add a TODO as a reminder that we need to fix this. Signed-off-by: Hans de Goede Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200326151009.102377-1-hdegoede@redhat.com commit 5ea5647f491876027064780cf1ea0beb041e7e41 Author: Marek Szyprowski Date: Wed Feb 26 11:13:07 2020 +0100 drm/bridge: sii9234: silence warning about regulators during deferred probe Don't confuse user with meaningless warning about failure in getting regulators in case of deferred probe. Signed-off-by: Marek Szyprowski Reviewed-by: Laurent Pinchart Reviewed-by: Krzysztof Kozlowski Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20200226101307.16708-1-m.szyprowski@samsung.com commit 7bf03e7504e433da274963c447648876902b86df Author: Nathan Chancellor Date: Thu Feb 13 22:47:07 2020 -0700 drm/i915: Cast remain to unsigned long in eb_relocate_vma A recent commit in clang added -Wtautological-compare to -Wall, which is enabled for i915 after -Wtautological-compare is disabled for the rest of the kernel so we see the following warning on x86_64: ../drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1433:22: warning: result of comparison of constant 576460752303423487 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (unlikely(remain > N_RELOC(ULONG_MAX))) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ ../include/linux/compiler.h:78:42: note: expanded from macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ 1 warning generated. It is not wrong in the case where ULONG_MAX > UINT_MAX but it does not account for the case where this file is built for 32-bit x86, where ULONG_MAX == UINT_MAX and this check is still relevant. Cast remain to unsigned long, which keeps the generated code the same (verified with clang-11 on x86_64 and GCC 9.2.0 on x86 and x86_64) and the warning is silenced so we can catch more potential issues in the future. Closes: https://github.com/ClangBuiltLinux/linux/issues/778 Suggested-by: Michel Dänzer Reviewed-by: Jani Nikula Signed-off-by: Nathan Chancellor Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200214054706.33870-1-natechancellor@gmail.com commit a9410a6250643079a614c500240fc5942e66b383 Author: Daniele Ceraolo Spurio Date: Thu Mar 26 11:11:21 2020 -0700 drm/i915/uc: do not free err log on uc_fini We need to keep the GuC error logs around to debug the load failure, so we can't clean them in the error unwind, which includes uc_fini(). Moving the cleanup to driver remove ensures that the logs stick around long enough for us to dump them. v2: reword commit msg (John) Signed-off-by: Daniele Ceraolo Spurio Cc: Michal Wajdeczko Reviewed-by: John Harrison Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-7-daniele.ceraolospurio@intel.com commit 293a554801b2db8e5fe626dac1e2e5be0edb4855 Author: Daniele Ceraolo Spurio Date: Thu Mar 26 11:11:20 2020 -0700 drm/i915/uc: Move uC debugfs to its own folder under GT uC is a component of the GT, so it makes sense for the uC debugfs files to be in the GT folder. A subfolder has been used to keep the same structure we have for the code. v2: use intel_* prefix (Jani), rebase on new gt_debugfs_register_files, fix permissions for writable debugfs files. v3: Rename files (Michal), remove blank line (Jani), fix sparse warns. Signed-off-by: Daniele Ceraolo Spurio Cc: Andi Shyti Cc: Michal Wajdeczko Cc: John Harrison Cc: Matthew Brost Cc: Tony Ye Cc: Jani Nikula Reviewed-by: Andi Shyti #v2 Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-6-daniele.ceraolospurio@intel.com commit 34904bd64a6990fd32f04b657f290ecabd47abda Author: Daniele Ceraolo Spurio Date: Thu Mar 26 11:11:19 2020 -0700 drm/i915/debugfs: move uC printers and update debugfs file names Move the printers to the respective files for clarity. The guc_load_status debugfs has been squashed in the guc_info one, has having separate ones wasn't very useful. The HuC debugfs has been renamed huc_info to match. v2: keep printing HUC_STATUS2 (Tony), avoid const->non-const container_of (Jani) Suggested-by: Michal Wajdeczko Signed-off-by: Daniele Ceraolo Spurio Cc: Michal Wajdeczko Cc: John Harrison Cc: Matthew Brost Cc: Tony Ye Cc: Jani Nikula Reviewed-by: John Harrison Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-5-daniele.ceraolospurio@intel.com commit 801a0caa627b3b2aa5933b66f0e4a83c4f85143e Author: Daniele Ceraolo Spurio Date: Thu Mar 26 11:11:18 2020 -0700 drm/i915/huc: make "support huc" reflect HW capabilities We currently initialize HuC support based on GuC being enabled in modparam; this means that huc_is_supported() can return false on HW that does have a HuC when enable_guc=0. The rationale for this behavior is that HuC requires GuC for authentication and therefore is not supported by itself. However, we do not allow defining HuC fw wthout GuC fw and selecting HuC in modparam implicitly selects GuC as well, so we can't actually hit a scenario where HuC is selected alone. Therefore, we can flip the support check to reflect the HW capabilities and fw availability, which is more intuitive and will make it cleaner to log HuC the difference between not supported in HW and not selected. Removing the difference between GuC and HuC also allows us to simplify the init_early, since we don't need to differentiate the support based on the type of uC. Signed-off-by: Daniele Ceraolo Spurio Cc: Michal Wajdeczko Cc: John Harrison Cc: Matthew Brost Reviewed-by: Andi Shyti Reviewed-by: John Harrison Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-4-daniele.ceraolospurio@intel.com commit 708249a6eba1e1b9c1abfdb400a19f1eb8aaf4d7 Author: Daniele Ceraolo Spurio Date: Thu Mar 26 11:11:17 2020 -0700 drm/i915/guc: drop stage_pool debugfs The pool will be private to GuC in the new submission scheme, so we won't be able to print it and we can just drop the current legacy code. Signed-off-by: Daniele Ceraolo Spurio Cc: Michal Wajdeczko Cc: John Harrison Cc: Matthew Brost Reviewed-by: Andi Shyti Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-3-daniele.ceraolospurio@intel.com commit 12df6c59b6dbf26fa92f58af5e0544528ea261db Author: Andi Shyti Date: Thu Mar 26 11:11:16 2020 -0700 drm/i915/gt: allow setting generic data pointer When registering debugfs files the intel gt debugfs library forces a 'struct *gt' private data on the caller. To be open to different usages make the new "intel_gt_debugfs_register_files()"[*] function more generic by converting the 'struct *gt' pointer to a 'void *' type. I take the chance to rename the functions by using "intel_gt_" as prefix instead of "debugfs_", so that "debugfs_gt_register_files()" becomes "intel_gt_debugfs_register_files()". Signed-off-by: Andi Shyti Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-2-daniele.ceraolospurio@intel.com commit 9e1ed9fb1eb0a4bc43a26365c592d3095286038b Author: Daniel Vetter Date: Mon Mar 23 15:49:50 2020 +0100 drm: Add docs for managed resources All collected together to provide a consistent story in one patch, instead of the somewhat bumpy refactor-evolution leading to this. Also some thoughts on what the next steps could be: - Create a macro called devm_drm_dev_alloc() which essentially wraps the kzalloc(); devm_drm_dev_init(); drmm_add_final_kfree() combo. Needs to be a macro since we'll have to do some typeof trickery and casting to make this fully generic for all drivers that embed struct drm_device into their own thing. - A lot of the simple drivers now have essentially just drm_dev_unplug(); drm_atomic_helper_shutdown(); as their $bus_driver->remove hook. We could create a devm_mode_config_reset which sets drm_atomic_helper_shutdown as it's cleanup action, and a devm_drm_dev_register with drm_dev_unplug as it's cleanup action, and simple drivers wouldn't have a need for a ->remove function at all, and we could delete them. - For more complicated drivers we need drmm_ versions of a _lot_ more things. All the userspace visible objects (crtc, plane, encoder, crtc), anything else hanging of those (maybe a drmm_get_edid, at least for panels and other built-in stuff). Also some more thoughts on why we're not reusing devm_ with maybe a fake struct device embedded into the drm_device (we can't use the kdev, since that's in each drm_minor). - Code review gets extremely tricky, since every time you see a devm_ you need to carefully check whether the fake device (with the drm_device lifetim) or the real device (with the lifetim of the underlying physical device and driver binding) are used. That's not going to help at all, and we have enormous amounts of drivers who use devm_ where they really shouldn't. Having different types makes sure the compiler type checks this for us and ensures correctness. - The set of functions are very much non-overlapping. E.g. devm_ioremap makes total sense, drmm_ioremap has the wrong lifetime, since hw resources need to be cleaned out at driver unbind and wont outlive that like a drm_device. Similar, but other way round for drmm_connector_init (which is the only correct version, devm_ for drm_connector is just buggy). Simply not having the wrong version again prevents bugs. Finally I guess this opens a huge todo for all the drivers. I'm semi-tempted to do a tree-wide s/devm_kzalloc/drmm_kzalloc/ since most likely that'll fix an enormous amount of bugs and most likely not cause any issues at all (aside from maybe holding onto memory slightly too long). v2: - Doc improvements from Laurent. - Also add kerneldoc for the new drmm_add_action_or_reset. v3: - Remove kerneldoc for drmm_remove_action. Reviewed-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Laurent Pinchart Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Daniel Vetter fixup docs Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-52-daniel.vetter@ffwll.ch commit b1a981bd55767123d3c34626c41d18d3c7cd7c14 Author: Daniel Vetter Date: Mon Mar 23 15:49:49 2020 +0100 drm/udl: drop drm_driver.release hook There's only two functions called from that: drm_kms_helper_poll_fini() and udl_free_urb_list(). Both of these are also called from the ubs_driver->disconnect hook, so entirely pointless to do the same again in the ->release hook. Furthermore by the time we clean up the drm_driver we really shouldn't be touching hardware anymore, so stopping the poll worker and freeing the urb allocations in ->disconnect is the right thing to do. Now disconnect still cleans things up before unregistering the driver, but that's a different issue. v2: Use _fini, not _disable in unplug, motivated by discussions with Thomas. _disable/_enable are for suspend/resume. Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Sean Paul Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Emil Velikov Cc: Gerd Hoffmann Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: Thomas Gleixner Cc: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-51-daniel.vetter@ffwll.ch commit fe5b7c86d6068ac33df2d46cf3c7a1859c3b84a8 Author: Daniel Vetter Date: Mon Mar 23 15:49:48 2020 +0100 drm/udl: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This allows us to delete a bit of onion unwinding in udl_modeset_init(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Thomas Zimmermann Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Sean Paul Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Emil Velikov Cc: Gerd Hoffmann Cc: "Noralf Trønnes" Cc: Thomas Gleixner Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-50-daniel.vetter@ffwll.ch commit 3421a6c4098ff70365444b956cd735b50fa99ead Author: Daniel Vetter Date: Mon Mar 23 15:49:47 2020 +0100 drm/mipi-dbi: Drop explicit drm_mode_config_cleanup call Allows us to drop the drm_driver.release callback from all drivers, and remove the mipi_dbi_release() function. This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Laurent Pinchart Reviewed-by: Noralf Trønnes (v2) Tested-by: Noralf Trønnes Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Eric Anholt Cc: David Lechner Cc: Kamlesh Gurudasani Cc: "Noralf Trønnes" Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-49-daniel.vetter@ffwll.ch commit 53bdebf7fec8f5ce10599776a4bc60ffdc25800b Author: Daniel Vetter Date: Mon Mar 23 15:49:46 2020 +0100 drm/mipi-dbi: Move drm_mode_config_init into mipi library 7/7 drivers agree that's the right choice, let's do this. This avoids duplicating the same old error checking code over all 7 drivers, which is the motivation here. Acked-by: Sam Ravnborg Reviewed-by: Noralf Trønnes Tested-by: Noralf Trønnes Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Eric Anholt Cc: David Lechner Cc: Kamlesh Gurudasani Cc: "Noralf Trønnes" Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-48-daniel.vetter@ffwll.ch commit be9f2b0348591acb1a019ecdbc8706e94aa5aa15 Author: Daniel Vetter Date: Mon Mar 23 15:49:45 2020 +0100 drm/repaper: Drop explicit drm_mode_config_cleanup call Allows us to drop the drm_driver.release callback. This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) I also noticed that I've failed to add the error checking, __must_check caught that. Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Laurent Pinchart Reviewed-by: Noralf Trønnes (v2) Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-47-daniel.vetter@ffwll.ch commit 8f2cb9379fb4ab6fde2a46937dfe294f4c1a97db Author: Daniel Vetter Date: Mon Mar 23 15:49:44 2020 +0100 drm/gm12u320: Simplify upload work Instead of having a work item that never stops (which really should be a kthread), with a dedicated workqueue to not upset anyone else, use a delayed work. A bunch of changes: - We can throw out all the custom wakeup and requeue logic and state tracking. If we schedule the work with a 0 delay it'll get scheduled immediately. - Persistent state (frame & draw_status_timeout) need to be moved out of the work. - diff is bigger than the changes, biggest chunk is reindenting the work fn because it lost its while loop. Lots of code deleting as consequence all over. Specifically we can delete the drm_driver.release code now! v2: Review from Hans: - Use mod_delayed_work in the plane update path to make sure we do actually schedule immediately). In the worker we still want queue_delayed_work, which won't modify the timeout when the work is already scheduled. Which is exactly what we want if the work races with a plane update. - Switch to system_long_wq, Hans says on usb2 a plane upload can take 80 ms. Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-46-daniel.vetter@ffwll.ch commit 7ef64ed121c7b9bef7b79b08022a5a847bac0849 Author: Daniel Vetter Date: Mon Mar 23 15:49:43 2020 +0100 drm/gm12u320: Use helpers for shutdown/suspend/resume Also there's a race in the disconnect implemenation. First shut down, then unplug, leaves a window where userspace could sneak in and restart the entire machinery. With this we can also delete the very un-atomic global pipe_enabled tracking. Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-45-daniel.vetter@ffwll.ch commit 993f5b193d145540f873ba80b8f2eae5249b1464 Author: Daniel Vetter Date: Mon Mar 23 15:49:42 2020 +0100 drm/gm12u320: Use devm_drm_dev_init Only drops the drm_dev_put, but hey a few lines! Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-44-daniel.vetter@ffwll.ch commit 08373edcb9a87edddc7c5327c5f944ea5b4177bc Author: Daniel Vetter Date: Mon Mar 23 15:49:41 2020 +0100 drm/gm12u320: More drmm_ The drm_mode_config_cleanup call we can drop, and all the allocations we can switch over to drmm_kzalloc. Unfortunately the work queue is still present, so can't get rid of the drm_driver->release function outright. v2: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Hans de Goede (v1) Signed-off-by: Daniel Vetter Cc: Hans de Goede Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-43-daniel.vetter@ffwll.ch commit c792098baf22714b7023cea15acf8432d1ee08e1 Author: Daniel Vetter Date: Mon Mar 23 15:49:40 2020 +0100 drm/tidss: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... I'm pretty sure this one blows up already under KASAN because it's using devm_drm_dev_init, and later on devm_kzalloc. Hence the memory will get freed before the final drm_dev_put (all from the devres code), but the cleanup in that final drm_dev_put will access the just freed memory. Unfortunately fixing this properly needs slightly more work, namely drmm_ versions for all the drm objects (planes, crtc, ...), so that the cleanup actually happens before even drmm_kzalloc would release the underlying memory. Not quite there yet. v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Jyri Sarha Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Jyri Sarha Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-42-daniel.vetter@ffwll.ch commit 18c6222237f88806c0cc1883ae69a54cf3bbf5d8 Author: Daniel Vetter Date: Mon Mar 23 15:49:39 2020 +0100 drm/mtk: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Chun-Kuang Hu Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-41-daniel.vetter@ffwll.ch commit e28c853eed8fb05f0efb5de1bae9dfcd15a175c8 Author: Daniel Vetter Date: Mon Mar 23 15:49:38 2020 +0100 drm/shmob: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Laurent Pinchart (v2) Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Laurent Pinchart Cc: Kieran Bingham Cc: linux-renesas-soc@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-40-daniel.vetter@ffwll.ch commit 967be0ffa62dfda7b13c528b6bab860fd692325c Author: Daniel Vetter Date: Mon Mar 23 15:49:37 2020 +0100 drm/stm: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Sam Ravnborg Acked-by: Philippe Cornu Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Yannick Fertre Cc: Philippe Cornu Cc: Benjamin Gaignard Cc: Vincent Abriou Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-39-daniel.vetter@ffwll.ch commit 56e35f85bae2be7ae1b10d2d236ccbf2c1a6966d Author: Daniel Vetter Date: Mon Mar 23 15:49:36 2020 +0100 drm/rockchip: Drop explicit drm_mode_config_cleanup call It's (almost, there's some iommu stuff without significance) right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Jump out at the right label (Francesco) v4: Try again, kbuild caught that I didn't build test this properly ... v5: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Francesco Lavra Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Sandy Huang Cc: "Heiko Stübner" Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-38-daniel.vetter@ffwll.ch commit b570e88d8827ec37b0682763bc6781e2101e027a Author: Daniel Vetter Date: Mon Mar 23 15:49:35 2020 +0100 drm/rcar-du: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Laurent Pinchart (v2) Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Laurent Pinchart Cc: Kieran Bingham Cc: linux-renesas-soc@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-37-daniel.vetter@ffwll.ch commit 5e3e55b69c390d5ea28b2e1ee71af140177678a0 Author: Daniel Vetter Date: Mon Mar 23 15:49:34 2020 +0100 drm/pl111: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: This driver gets its devm_ stuff all wrong wrt drm_device and anything hanging off that. Not the only one unfortunately. v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-36-daniel.vetter@ffwll.ch commit bd9ff7b521a647a3c8f90a71b52d5f4c2723482e Author: Daniel Vetter Date: Mon Mar 23 15:49:33 2020 +0100 drm/meson: Drop explicit drm_mode_config_cleanup call It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: This driver gets its devm_ stuff all wrong wrt drm_device and anything hanging off that. Not the only one unfortunately. v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Neil Armstrong (v2) Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Neil Armstrong Cc: Kevin Hilman Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-35-daniel.vetter@ffwll.ch commit 90c2e13bc30e22db8f118907f2d58546a0979dcf Author: Daniel Vetter Date: Mon Mar 23 15:49:32 2020 +0100 drm/mcde: More devm_drm_dev_init Auto-unwind ftw, now possible with the fixed drm_device related management. Aside, clk/regulator seem to be missing devm versions for a bunch of functions, preventing a pile of these simpler drivers from outright losing their ->remove hook. Reviewed-by: Linus Walleij Signed-off-by: Daniel Vetter Cc: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-34-daniel.vetter@ffwll.ch commit 4b055ab1378a9b802760a2f4d5cfcc91e0b89fa7 Author: Daniel Vetter Date: Mon Mar 23 15:49:31 2020 +0100 drm/mcde: Drop explicit drm_mode_config_cleanup call Allows us to drop the drm_driver.release callback. This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Linus Walleij (v2) Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-33-daniel.vetter@ffwll.ch commit fe1cc102a381a97be2bf4069bb36b841751fefdf Author: Daniel Vetter Date: Mon Mar 23 15:49:30 2020 +0100 drm/ingenic: Drop explicit drm_mode_config_cleanup call Allows us to drop the drm_driver.release callback. This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Paul Cercueil (v2) Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-32-daniel.vetter@ffwll.ch commit 70c2fe18a4be2599ed3832081f9d92faf63e34f7 Author: Daniel Vetter Date: Mon Mar 23 15:49:29 2020 +0100 drm/cirrus: Fully embrace devm_ With the drm_device lifetime fun cleaned up there's nothing in the way anymore to use devm_ for everything hw releated. Do it, and in the process, throw out the entire onion unwinding. Acked-by: Gerd Hoffmann Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: "Noralf Trønnes" Cc: Emil Velikov Cc: Thomas Zimmermann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-31-daniel.vetter@ffwll.ch commit bb1e0dfaa7e99ce218b1b5fffd9f30bac54520f9 Author: Daniel Vetter Date: Mon Mar 23 15:49:28 2020 +0100 drm/cirrus: Drop explicit drm_mode_config_cleanup call We can even delete the drm_driver.release hook now! This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Gerd Hoffmann Cc: Sam Ravnborg Acked-by: Sam Ravnborg Cc: Thomas Zimmermann Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-30-daniel.vetter@ffwll.ch commit b771a5687d61a4b9834ed92602585d0cf9e71bca Author: Daniel Vetter Date: Mon Mar 23 15:49:27 2020 +0100 drm/bochs: Drop explicit drm_mode_config_cleanup Instead rely on the automatic clean, for which we just need to check that drm_mode_config_init succeeded. To avoid an inversion in the cleanup we also have to move the dev_private allocation over to drmm_kzalloc. This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Acked-by: Gerd Hoffmann Acked-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-29-daniel.vetter@ffwll.ch commit 9caf3c801964cdceeb6fec5aeba14ada411c75a5 Author: Daniel Vetter Date: Mon Mar 23 15:49:26 2020 +0100 drm/bochs: Remove leftover drm_atomic_helper_shutdown Small mistake that crept into commit 81da8c3b8d3df6f05b11300b7d17ccd1f3017fab Author: Gerd Hoffmann Date: Tue Feb 11 14:52:18 2020 +0100 drm/bochs: add drm_driver.release callback where drm_atomic_helper_shutdown was left in both places. The ->release callback really shouldn't touch hardware. Acked-by: Gerd Hoffmann Cc: Gerd Hoffmann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-28-daniel.vetter@ffwll.ch commit c3b790ea07a13da0c46816bda6b04abef346af15 Author: Daniel Vetter Date: Mon Mar 23 15:49:25 2020 +0100 drm: Manage drm_mode_config_init with drmm_ drm_mode_config_cleanup is idempotent, so no harm in calling this twice. This allows us to gradually switch drivers over by removing explicit drm_mode_config_cleanup calls. With this step it's now also possible that (at least for simple drivers) automatic resource cleanup can be done correctly without a drm_driver->release hook. Therefore allow this now in devm_drm_dev_init(). Also with drmm_ explicit drm_driver->release hooks are kinda not the best option: Drivers can always just register their current release hook with drmm_add_action, but even better they could split them up to simplify the unwinding for the driver load failure case. So deprecate that hook to discourage future users. v2: Fixup the example in the kerneldoc too. v3: - For paranoia, double check that minor->dev == dev in the release hook, because I botched the pointer math in the drmm library. - Call drm_mode_config_cleanup when drmm_add_action fails, we'd be missing some mutex_destroy and ida_cleanup otherwise (Laurent) v4: Add a drmm_add_action_or_reset (like devm_ has) to encapsulate this pattern (Noralf). v5: Fix oversight in the new drmm_add_action_or_reset macro (Noralf) v4: Review from Sam: - drmm_mode_config_init wrapper (also suggested by Thomas) - improve commit message, explain better why ->relase is deprecated v5: - Make drmm_ the main function, with the old one as compat wrapper (Sam) - Add FIXME comments to drm_mode_config_cleanup/init() that drivers shouldn't use these anymore. - Move drmm_add_action_or_reset helper to an earlier patch. Reviewed-by: Sam Ravnborg Cc: Laurent Pinchart Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Noralf Trønnes Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-27-daniel.vetter@ffwll.ch commit d33b58d0115e7eee011fddee2d8e25c6a09fb279 Author: Daniel Vetter Date: Mon Mar 23 15:49:24 2020 +0100 drm: Garbage collect drm_dev_fini It has become empty. Given the few users I figured not much point splitting this up. v2: Rebase over i915 changes. v3: Rebase over patch split fix. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-26-daniel.vetter@ffwll.ch commit c23d686f1960a91006bfb4da1bb5edf88eef57c6 Author: Daniel Vetter Date: Mon Mar 23 15:49:23 2020 +0100 drm: Manage drm_vblank_cleanup with drmm_ Nothing special here, except that this is the first time that we automatically clean up something that's initialized with an explicit driver call. But the cleanup was done at the very end of the release sequence for all drivers, and that's still the case. At least without more uses of drmm_ through explicit driver calls. Also for this one we need drmm_kcalloc, so lets add those. The motivation here is to allow us to remove the explicit calls to drm_dev_fini() from all drivers. v2: Sort includes (Laurent) v3: Motivate the change in the commit message better (Sam) Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-25-daniel.vetter@ffwll.ch commit 641b9103d8383f52025bd2e1d3aaed2356efc913 Author: Daniel Vetter Date: Mon Mar 23 15:49:22 2020 +0100 drm: Manage drm_gem_init with drmm_ We might want to look into pushing this down into drm_mm_init, but that would mean rolling out return codes to a pile of functions unfortunately. So let's leave that for now. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-24-daniel.vetter@ffwll.ch commit f96306f9892b3a28ece4c65c4d1b95f631b3e63c Author: Daniel Vetter Date: Tue Mar 24 21:39:36 2020 +0100 drm: manage drm_minor cleanup with drmm_ The cleanup here is somewhat tricky, since we can't tell apart the allocated minor index from 0. So register a cleanup action first, and if the index allocation fails, unregister that cleanup action again to avoid bad mistakes. The kdev for the minor already handles NULL, so no problem there. Hence add drmm_remove_action() to the drm_managed library. v2: Make pointer math around void ** consistent with what Laurent suggested. v3: Use drmm_add_action_or_reset and remove drmm_remove_action. Noticed because of some questions from Thomas. This also means we need to move the drmm_add_action_or_reset helper earlier in the series. v4: Uh ... fix slightly embarrassing bug CI spotted. Acked-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Cc: Thomas Zimmermann Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200324203936.3330994-1-daniel.vetter@ffwll.ch commit 2cbf7fc6718b9443ecd6261308c6348d8ffcccae Author: Daniel Vetter Date: Mon Mar 23 15:49:20 2020 +0100 drm: Use drmm_ for drm_dev_init cleanup Well for the simple stuff at least, vblank, gem and minor cleanup I want to further split up as a demonstration. v2: We need to clear drm_device->dev otherwise the debug drm printing after our cleanup hook (e.g. in drm_manged_release) will chase released memory and result in a use-after-free. Not really pretty, but oh well. Reviewed-by: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-22-daniel.vetter@ffwll.ch commit a5c71fdba9dfeff1f47713a641ef5ce2eadf5e8f Author: Daniel Vetter Date: Mon Mar 23 15:49:19 2020 +0100 drm: Handle dev->unique with drmm_ We need to add a drmm_kstrdup for this, but let's start somewhere. This is not exactly perfect onion unwinding, but it's jsut a kfree so doesn't really matter at all. Reviewed-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-21-daniel.vetter@ffwll.ch commit d5e56705927e00f703b2eb5a98299dd6622d16e5 Author: Uma Shankar Date: Thu Mar 26 18:21:11 2020 +0530 drm/i915/display: Fix mode private_flags comparison at atomic_check This patch fixes the private_flags of mode to be checked and compared against uapi.mode and not from hw.mode. This helps properly trigger modeset at boot if desired by driver. It helps resolve audio_codec initialization issues if display is connected at boot. Initial discussion on this issue has happened on below thread: https://patchwork.freedesktop.org/series/74828/ v2: No functional change. Fixed the Closes tag and added Maarten's RB. v3: Added Fixes tag. Cc: Ville Syrjä Cc: Maarten Lankhorst Cc: Kai Vehmanen Cc: Souza, Jose Fixes: 58d124ea2739 ("drm/i915: Complete crtc hw/uapi split, v6.") Closes: https://gitlab.freedesktop.org/drm/intel/issues/1363 Suggested-by: Ville Syrjä Signed-off-by: Uma Shankar Signed-off-by: SweeAun Khor Reviewed-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20200326125111.11081-1-uma.shankar@intel.com commit 5dad34f3c4442962fe93f4d583b774af2484c2f2 Author: Daniel Vetter Date: Mon Mar 23 15:49:18 2020 +0100 drm: Cleanups after drmm_add_final_kfree rollout A few things: - Update the example driver in the documentation. - We can drop the old kfree in drm_dev_release. - Add a WARN_ON check in drm_dev_register to make sure everyone calls drmm_add_final_kfree and there's no leaks. v2: Restore the full cleanup, I accidentally left some moved code behind when fixing the bisectability of the series. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Sam Ravnborg Cc: Dan Carpenter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-20-daniel.vetter@ffwll.ch commit 780e41edf8908eed5db956508b9f114acba4392d Author: Daniel Vetter Date: Mon Mar 23 15:49:17 2020 +0100 drm/: Use drmm_add_final_kfree These are the leftover drivers that didn't have a ->release hook that needed to be updated. Acked-by: Sam Ravnborg Acked-by: Liviu Dudau Signed-off-by: Daniel Vetter Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Cc: Russell King Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-19-daniel.vetter@ffwll.ch commit b6731025a52f19f86feae0b9c086390a0eec214d Author: Daniel Vetter Date: Mon Mar 23 15:49:16 2020 +0100 drm/gm12u320: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. Acked-by: Sam Ravnborg Reviewed-by: Hans de Goede Signed-off-by: Daniel Vetter Cc: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-18-daniel.vetter@ffwll.ch commit 81e3264652e88ebddc80f350b0f85c443b4c9a40 Author: Daniel Vetter Date: Mon Mar 23 15:49:15 2020 +0100 drm/ingenic: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. Acked-by: Sam Ravnborg Reviewed-by: Paul Cercueil Signed-off-by: Daniel Vetter Cc: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-17-daniel.vetter@ffwll.ch commit 144a29fdac4ede527008646488cd7c32d6289de7 Author: Daniel Vetter Date: Mon Mar 23 15:49:14 2020 +0100 drm/repaper: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. Acked-by: Sam Ravnborg Reviewed-by: Noralf Trønnes Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-16-daniel.vetter@ffwll.ch commit ac19f140bc27ff72ca223cc0d4474f6ff5d1672e Author: Daniel Vetter Date: Mon Mar 23 15:49:13 2020 +0100 drm/vkms: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. v2: After drm_dev_init/drmm_add_final_kfree we need to clean up everything through a drm_dev_put. Rework the unwind code to match that. Reviewed-by: Rodrigo Siqueira Tested-by: Rodrigo Siqueira Signed-off-by: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-15-daniel.vetter@ffwll.ch commit 363de9e7d4f6b1dd7993f316a064df1f9abc3341 Author: Daniel Vetter Date: Mon Mar 23 15:49:12 2020 +0100 drm/vgem: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. v2: After drm_dev_init/drmm_add_final_kfree we need to clean up everything through a drm_dev_put. Rework the unwind code to match that. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Emil Velikov Cc: Chris Wilson Cc: Sean Paul Cc: Eric Anholt Cc: Rob Clark Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-14-daniel.vetter@ffwll.ch commit e2edcaaa3da88018bf6afd4dd09b8b5b4f8e8443 Author: Daniel Vetter Date: Mon Mar 23 15:49:11 2020 +0100 drm/mcde: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. v2: Fix unused variable warning, spotted while applying. Reviewed-by: Linus Walleij Signed-off-by: Daniel Vetter Cc: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-13-daniel.vetter@ffwll.ch commit afeeabb88babf22647f3483a2f428f70be93e289 Author: Daniel Vetter Date: Mon Mar 23 15:49:10 2020 +0100 drm/tidss: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. Acked-by: Jyri Sarha Signed-off-by: Daniel Vetter Cc: Jyri Sarha Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-12-daniel.vetter@ffwll.ch commit ea3aa6203c6b5540c80527d6beae68063a0080c1 Author: Daniel Vetter Date: Mon Mar 23 15:49:09 2020 +0100 drm/v3d: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. I also noticed that the unwind code is wrong, after drm_dev_init the drm_device owns the v3d allocation, so the kfree(v3d) is a double-free. Reorder the setup to fix this issue. After a bit more prep in drivers and drm core v3d should be able to switch over to devm_drm_dev_init, which should clean this up further. Acked-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-11-daniel.vetter@ffwll.ch commit b6097727ae57dc782900e5955ac03c5d6158b28d Author: Daniel Vetter Date: Mon Mar 23 15:49:08 2020 +0100 drm/cirrus: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. I also noticed that cirrus forgot to call drm_dev_fini(). v2: Don't call kfree(cirrus) after we've handed overship of that to drm_device and the drmm_ stuff. Acked-by: Gerd Hoffmann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: "Noralf Trønnes" Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-10-daniel.vetter@ffwll.ch commit 7fb81e9d80738ee2673990f6be1e55494d5ea014 Author: Daniel Vetter Date: Mon Mar 23 15:49:07 2020 +0100 drm/i915: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. The mock device in the selftests needed it's pci_device split up from the drm_device. In the future we could simplify this again by allocating the pci_device as a managed allocation too. v2: I overlooked that i915_driver_destroy is also called in the unwind code of the error path. There we need a drm_dev_put. Similar for the mock object. Now the problem with that is that the drm_driver->release callbacks for both the real driver and the mock one assume everything has been set up. Hence going through that path for a partially set up driver will result in issues. Quickest fix is to disable the ->release() hook until the driver is fully initialized, and keep the onion unwinding. Long term would be cleanest to move everything over to drmm_ release actions, but that's a lot of work for a big driver like i915. Plus more core work needed first anyway. v3: Fix i915_drm pointer wrangling in mock_gem_device. Also switch over to start using drm_dev_put() to clean up even on the error path. Aside I think the current error path is leaking the allocation. v4: more fixes for intel-gfx-ci, some if it damage from v3 :-/ Reviewed-by: Jani Nikula Signed-off-by: Daniel Vetter Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Matthew Auld Cc: Andi Shyti Cc: Mika Kuoppala Cc: Daniele Ceraolo Spurio Cc: Daniel Vetter Cc: Abdiel Janulgue Cc: intel-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-9-daniel.vetter@ffwll.ch commit c1b164a5f7ab932699923f58c95767bfc6921d91 Merge: 873863b6214a c2556238120b Author: Maarten Lankhorst Date: Thu Mar 26 15:11:04 2020 +0100 Merge remote-tracking branch 'drm/drm-next' into drm-misc-next Requested for getting some i915 fixes back into drm-misc-next by danvet. Signed-off-by: Maarten Lankhorst commit 873863b6214a034e8d4e4bfc8232f65bf9a292fe Author: Daniel Vetter Date: Mon Mar 23 15:49:06 2020 +0100 drm/qxl: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. Acked-by: Gerd Hoffmann Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-8-daniel.vetter@ffwll.ch commit d0c116adc656e88a36ddc71ff6c9da5e75fc6b44 Author: Daniel Vetter Date: Mon Mar 23 15:49:05 2020 +0100 drm/udl: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. v2: We need drm_dev_put to unroll the driver creation (once drm_dev_init and drmm_add_final_kfree suceeded), otherwise the drmm_ magic doesn't happen. v3: Actually squash in the fixup (Laurent). Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Laurent Pinchart Cc: Dave Airlie Cc: Sean Paul Cc: Thomas Zimmermann Cc: Emil Velikov Cc: Daniel Vetter Cc: "Noralf Trønnes" Cc: Thomas Gleixner Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-7-daniel.vetter@ffwll.ch commit f5ad671b2963d335e4eda195291c68a0409808d6 Author: Daniel Vetter Date: Mon Mar 23 15:49:04 2020 +0100 drm/mipi_dbi: Use drmm_add_final_kfree in all drivers They all share mipi_dbi_release so we need to switch them all together. With this we can drop the final kfree from the release function. Aside, I think we could perhaps have a tiny additional helper for these mipi_dbi drivers, the first few lines around devm_drm_dev_init are all the same (except for the drm_driver pointer). Acked-by: Sam Ravnborg Reviewed-by: Noralf Trønnes Tested-by: Noralf Trønnes Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Eric Anholt Cc: David Lechner Cc: Kamlesh Gurudasani Cc: "Noralf Trønnes" Cc: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-6-daniel.vetter@ffwll.ch commit 6f365e561d66553d09b832378a45d3dee5be24e1 Author: Daniel Vetter Date: Mon Mar 23 15:49:03 2020 +0100 drm: Set final_kfree in drm_dev_alloc I also did a full review of all callers, and only the xen driver forgot to call drm_dev_put in the failure path. Fix that up too. v2: I noticed that xen has a drm_driver.release hook, and uses drm_dev_alloc(). We need to remove the kfree from xen_drm_drv_release(). bochs also has a release hook, but leaked the drm_device ever since commit 0a6659bdc5e8221da99eebb176fd9591435e38de Author: Gerd Hoffmann Date: Tue Dec 17 18:04:46 2013 +0100 drm/bochs: new driver This patch here fixes that leak. Same for virtio, started leaking with commit b1df3a2b24a917f8853d43fe9683c0e360d2c33a Author: Gerd Hoffmann Date: Tue Feb 11 14:58:04 2020 +0100 drm/virtio: add drm_driver.release callback. Acked-by: Gerd Hoffmann Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Reviewed-by: Oleksandr Andrushchenko Cc: Gerd Hoffmann Cc: Oleksandr Andrushchenko Cc: xen-devel@lists.xenproject.org Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Oleksandr Andrushchenko Cc: xen-devel@lists.xenproject.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-5-daniel.vetter@ffwll.ch commit c6603c740e0e3492c9c95fdab833375bf7117b6b Author: Daniel Vetter Date: Tue Mar 24 13:45:40 2020 +0100 drm: add managed resources tied to drm_device We have lots of these. And the cleanup code tends to be of dubious quality. The biggest wrong pattern is that developers use devm_, which ties the release action to the underlying struct device, whereas all the userspace visible stuff attached to a drm_device can long outlive that one (e.g. after a hotunplug while userspace has open files and mmap'ed buffers). Give people what they want, but with more correctness. Mostly copied from devres.c, with types adjusted to fit drm_device and a few simplifications - I didn't (yet) copy over everything. Since the types don't match code sharing looked like a hopeless endeavour. For now it's only super simplified, no groups, you can't remove actions (but kfree exists, we'll need that soon). Plus all specific to drm_device ofc, including the logging. Which I didn't bother to make compile-time optional, since none of the other drm logging is compile time optional either. One tricky bit here is the chicken&egg between allocating your drm_device structure and initiliazing it with drm_dev_init. For perfect onion unwinding we'd need to have the action to kfree the allocation registered before drm_dev_init registers any of its own release handlers. But drm_dev_init doesn't know where exactly the drm_device is emebedded into the overall structure, and by the time it returns it'll all be too late. And forcing drivers to be able clean up everything except the one kzalloc is silly. Work around this by having a very special final_kfree pointer. This also avoids troubles with the list head possibly disappearing from underneath us when we release all resources attached to the drm_device. v2: Do all the kerneldoc at the end, to avoid lots of fairly pointless shuffling while getting everything into shape. v3: Add static to add/del_dr (Neil) Move typo fix to the right patch (Neil) v4: Enforce contract for drmm_add_final_kfree: Use ksize() to check that the drm_device is indeed contained somewhere in the final kfree(). Because we need that or the entire managed release logic blows up in a pile of use-after-frees. Motivated by a discussion with Laurent. v5: Review from Laurent: - %zu instead of casting size_t - header guards - sorting of includes - guarding of data assignment if we didn't allocate it for a NULL pointer - delete spurious newline - cast void* data parameter correctly in ->release call, no idea how this even worked before v6: Review from Sam - Add the kerneldoc for the managed sub-struct back in, even if it doesn't show up in the generated html somehow. - Explain why __always_inline. - Fix bisectability around the final kfree() in drm_dev_relase(). This is just interim code which will disappear again. - Some whitespace polish. - Add debug output when drmm_add_action or drmm_kmalloc fail. v7: My bisectability fix wasn't up to par as noticed by smatch. v8: Remove unecessary {} around if else v9: Use kstrdup_const, which requires kfree_const and introducing a free_dr() helper (Thomas). v10: kfree_const goes boom on the plain "kmalloc" assignment, somehow we need to wrap that in kstrdup_const() too!! Also renumber revision log, I somehow reset it midway thruh. Reviewed-by: Sam Ravnborg Cc: Thomas Zimmermann Cc: Dan Carpenter Cc: Sam Ravnborg Cc: Laurent Pinchart Cc: Neil Armstrong Cc: "Rafael J. Wysocki" Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200324124540.3227396-1-daniel.vetter@ffwll.ch commit 0ce542f7317117a02d65183e047a09911fa08afe Author: Daniel Vetter Date: Mon Mar 23 15:49:01 2020 +0100 drm/i915: Don't clear drvdata in ->release For two reasons: - The driver core clears this already for us after we're unloaded in __device_release_driver(). - It's way too late, the drm_device ->release callback might massively outlive the underlying physical device, since a drm_device can be kept alive by open drm_file or well really anything else userspace is still hanging onto. So if we clear this ourselves, we should clear it in the pci ->remove callback, not in the drm_device ->release callback. Looking at git history this was fixed in the driver core with commit 0998d0631001288a5974afc0b2a5f568bcdecb4d Author: Hans de Goede Date: Wed May 23 00:09:34 2012 +0200 device-core: Ensure drvdata = NULL when no driver is bound v2: Cite the core fix in the commit message (Chris). v3: Fix commit message and unused variable warning (Jani). Cc: Greg Kroah-Hartman Cc: Chris Wilson Reviewed-by: Jani Nikula Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-3-daniel.vetter@ffwll.ch commit fd7cb5753ef49964ea9db5121c3fc9a4ec21ed8e Author: Daniel Vetter Date: Mon Mar 23 15:49:00 2020 +0100 mm/sl[uo]b: export __kmalloc_track(_node)_caller slab does this already, and I want to use this in a memory allocation tracker in drm for stuff that's tied to the lifetime of a drm_device, not the underlying struct device. Kinda like devres, but for drm. Acked-by: Andrew Morton Signed-off-by: Daniel Vetter Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: linux-mm@kvack.org Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-2-daniel.vetter@ffwll.ch commit d121f63c00e3b82f2e72b1db0de3e233c2ba2126 Author: Chris Wilson Date: Wed Mar 25 14:07:54 2020 +0000 drm/i915/display: Return early after MISSING_CASE for write_dp_sdp Avoid using the uninitialised len along the impossible error path to shut the compiler up: drivers/gpu/drm/i915/display/intel_dp.c:4928 intel_write_dp_sdp() error: uninitialized symbol 'len'. Signed-off-by: Chris Wilson Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200325140754.12636-1-chris@chris-wilson.co.uk commit 7015f127d821f5658958433e017a742aa6c39941 Author: Chris Wilson Date: Thu Mar 26 08:28:38 2020 +0000 drm/i915/display: Remove useless but deadly local Beware dereferencing the NULL pointer prior to checking for its existence. <1>[ 3.324694] BUG: kernel NULL pointer dereference, address: 0000000000000000 <1>[ 3.324696] #PF: supervisor read access in kernel mode <4>[ 3.324704] hardirqs last enabled at (751): [] d_lookup+0x57/0xa0 <1>[ 3.324709] #PF: error_code(0x0000) - not-present page <4>[ 3.324716] hardirqs last disabled at (752): [] __slab_alloc.isra.89.constprop.94+0x19/0x70 <4>[ 3.324720] softirqs last enabled at (402): [] __do_softirq+0x385/0x47f <6>[ 3.324725] PGD 0 P4D 0 <4>[ 3.324733] softirqs last disabled at (395): [] irq_exit+0xba/0xc0 <4>[ 3.324762] Oops: 0000 [#1] PREEMPT SMP PTI <4>[ 3.324768] CPU: 0 PID: 380 Comm: systemd-udevd Not tainted 5.6.0-rc7-CI-CI_DRM_8189+ #1 <4>[ 3.324776] Hardware name: MSI MS-7924/Z97M-G43(MS-7924), BIOS V1.12 02/15/2016 <4>[ 3.324840] RIP: 0010:intel_read_infoframe+0x3a/0x170 [i915] <4>[ 3.324848] Code: 65 48 8b 04 25 28 00 00 00 48 89 44 24 20 31 c0 83 f9 0a 77 12 ba 01 00 00 00 48 d3 e2 f7 c2 c0 05 00 00 48 0f 45 c7 83 fb 03 <4c> 8b 20 0f 84 f2 00 00 00 83 fb 0a 0f 84 f3 00 00 00 83 fb 07 0f <4>[ 3.324865] RSP: 0018:ffffc900005438b0 EFLAGS: 00010212 <4>[ 3.324871] RAX: 0000000000000000 RBX: 0000000000000082 RCX: 0000000000000001 <4>[ 3.324879] RDX: 0000000000000002 RSI: ffff8883f8309000 RDI: ffff8883f80cbe00 <4>[ 3.324887] RBP: ffff8883f8309b34 R08: 000000000000000e R09: 0000000000000001 <4>[ 3.324894] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8883f7ac0000 <4>[ 3.324901] R13: ffff8883f7ac0000 R14: ffff8883f7ac0d90 R15: ffff8883f844d000 <4>[ 3.324908] FS: 00007ffa4a839680(0000) GS:ffff888410000000(0000) knlGS:0000000000000000 <4>[ 3.324917] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4>[ 3.324923] CR2: 0000000000000000 CR3: 0000000401aa4002 CR4: 00000000001606f0 <4>[ 3.324930] Call Trace: <4>[ 3.324980] ? gen6_read32+0x272/0x300 [i915] <4>[ 3.325044] intel_ddi_get_config+0x238/0x610 [i915] <4>[ 3.325108] hsw_crt_get_config+0x12/0x40 [i915] <4>[ 3.325173] intel_modeset_setup_hw_state+0x3b3/0x1660 [i915] <4>[ 3.325182] ? ww_mutex_lock+0x39/0x70 <4>[ 3.325190] ? drm_modeset_lock+0xad/0x120 <4>[ 3.325254] intel_modeset_init+0x582/0x1c50 [i915] Fixes: 419190429cd1 ("drm/i915/hdmi: use struct drm_device based logging") Signed-off-by: Chris Wilson Cc: Wambui Karuga Cc: Jani Nikula Cc: "Ville Syrjälä" Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200326082838.16357-1-chris@chris-wilson.co.uk commit 73c8bfb7feed2831ab685faafa0a77d90ca6db07 Author: Chris Wilson Date: Wed Mar 25 23:48:03 2020 +0000 drm/i915: Drop final few uses of drm_i915_private.engine We've migrated all the heavy users over to the intel_gt, and can finally drop the last few users and with that the mirror in dev_priv->engine[]. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Andi Shyti Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200325234803.6175-1-chris@chris-wilson.co.uk commit 9642b4f01bcd5f003e33bfd96550c8c298f206b7 Author: Jani Nikula Date: Fri Mar 20 16:36:38 2020 +0200 drm/i915/wopcm: convert to drm device based logging Prefer drm_dbg() over DRM_DEV_DEBUG_DRIVER() and drm_err() over dev_err(). Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/017d9bdc171481da13ba9492492625fc6878844d.1584714939.git.jani.nikula@intel.com commit 85f691d369d1321ee253494581ffe971a8b77a05 Author: Jani Nikula Date: Fri Mar 20 16:36:37 2020 +0200 drm/i915/psr: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/cac03aba0a363c8f704035f1f771c73385235a35.1584714939.git.jani.nikula@intel.com commit 3dfd8d710419d45777c6255db4d9ccb44f8fcba7 Author: Jani Nikula Date: Fri Mar 20 16:36:36 2020 +0200 drm/i915/display: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/ffdbda0a0fe18354867b3f8c7a83f59f0963711d.1584714939.git.jani.nikula@intel.com commit 4fb5eec94c51716a0300f3a7ae6fa72eb2744cc8 Author: Jani Nikula Date: Fri Mar 20 16:36:35 2020 +0200 drm/i915/display: clean up intel_PLL_is_valid() Drop useless macro hiding the return. Fix superfluous whitespace. Rename function to all lowercase. Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/307c9f87cb2fbd5d2d67ec6adcde7ab669c2b93f.1584714939.git.jani.nikula@intel.com commit 7bee031d7b319f206611212aafd25cb712316bd6 Author: Jani Nikula Date: Fri Mar 20 16:36:34 2020 +0200 drm/i915/tv: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/e08dbd1933e1dbbd8e9f1954f5b0a9db946c4e7d.1584714939.git.jani.nikula@intel.com commit edd38964a52663afd58995fd9e504279d2d0f09b Author: Jani Nikula Date: Fri Mar 20 16:36:33 2020 +0200 drm/i915/connector: use MISSING_CASE instead of logging Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/bb70a05a2c20307ab67b89c4682f5afc5953fcaf.1584714939.git.jani.nikula@intel.com commit dd10a80f867186d9145edfcc3ae8c862b5bcb10f Author: Jani Nikula Date: Fri Mar 20 16:36:32 2020 +0200 drm/i915/dsi: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com commit 419190429cd1ae904c63d0cd1a54b0fc72083d32 Author: Jani Nikula Date: Fri Mar 20 16:36:31 2020 +0200 drm/i915/hdmi: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/fbc5396e6a512195b38c24b113aeebe23755c716.1584714939.git.jani.nikula@intel.com commit 5bdbddff31cd7610bc89d48a5ecda85ff2f9f475 Author: Jani Nikula Date: Fri Mar 20 16:36:30 2020 +0200 drm/i915/dsi: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/3bc29cddbba9dea57f8f843be2a6b5e1f7358b5c.1584714939.git.jani.nikula@intel.com commit ca4aae6daae1d69dffaa1fbcdfacb254e1ff45f7 Author: Jani Nikula Date: Fri Mar 20 16:36:29 2020 +0200 drm/i915/dp_mst: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/5ee3b8040658b5b4ef0b8b1a546fa04f554cdf6a.1584714939.git.jani.nikula@intel.com commit eba9836f28b23095081b31f8e1b36607db1db2f5 Author: Jani Nikula Date: Fri Mar 20 16:36:28 2020 +0200 drm/i915/dp_aux_backlight: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/733d3032e61cb4892a516d5be5da5ec73bdb9fa1.1584714939.git.jani.nikula@intel.com commit 3c4e3870facc1db239d4f830f219e34e407a448e Author: Jani Nikula Date: Fri Mar 20 16:36:27 2020 +0200 drm/i915/display_power: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/25e56d1b7df3b1e91024eb969fb839fdcbdcb35e.1584714939.git.jani.nikula@intel.com commit 47bdb1caba0bc5a732e4564bd661684a4c6bc985 Author: Jani Nikula Date: Fri Mar 20 16:36:26 2020 +0200 drm/i915/ddi: use struct drm_device based logging Convert all the DRM_* logging macros to the struct drm_device based macros to provide device specific logging. No functional changes. Generated using the following semantic patch, originally written by Wambui Karuga , with manual fixups on top: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_NOTE( +drm_notice(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } Cc: Wambui Karuga Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/e09bb6e97b2fbc44303acce0523dc35e3e74a456.1584714939.git.jani.nikula@intel.com commit 1443b8c9e712ef8914a2cab9ae7ce133229ed96c Author: Marco Elver Date: Thu Mar 5 15:21:09 2020 +0100 kcsan: Update API documentation in kcsan-checks.h Update the API documentation for ASSERT_EXCLUSIVE_* macros and make them generate readable documentation for the code examples. All @variable short summaries were missing ':', which was updated for the whole file. Tested with "make htmldocs". Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit e7325b774cc72edc2cffc4a1ce40f4dbf1bc0930 Author: Marco Elver Date: Thu Mar 5 15:21:08 2020 +0100 kcsan: Update Documentation/dev-tools/kcsan.rst Extend and improve based on recent changes, and summarize important bits that have been missing. Tested with "make htmldocs". Signed-off-by: Marco Elver Cc: Qian Cai Signed-off-by: Paul E. McKenney commit e7b34100500733f7e052ce3dee94e6338b86e6bc Author: Qiujun Huang Date: Thu Mar 5 15:21:07 2020 +0100 kcsan: Fix a typo in a comment s/slots slots/slots/ Signed-off-by: Qiujun Huang Reviewed-by: Nick Desaulniers [elver: commit message] Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 44656d3dc4f0dc20010d054f27397a4a1469fabf Author: Marco Elver Date: Tue Feb 25 15:32:58 2020 +0100 kcsan: Add current->state to implicitly atomic accesses Add volatile current->state to list of implicitly atomic accesses. This is in preparation to eventually enable KCSAN on kernel/sched (which currently still has KCSAN_SANITIZE := n). Since accesses that match the special check in atomic.h are rare, it makes more sense to move this check to the slow-path, avoiding the additional compare in the fast-path. With the microbenchmark, a speedup of ~6% is measured. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 2402d0eae589a31ee7b1774cb220d84d0f5605b4 Author: Marco Elver Date: Sat Feb 22 00:10:27 2020 +0100 kcsan: Add option for verbose reporting Adds CONFIG_KCSAN_VERBOSE to optionally enable more verbose reports. Currently information about the reporting task's held locks and IRQ trace events are shown, if they are enabled. Signed-off-by: Marco Elver Suggested-by: Qian Cai Signed-off-by: Paul E. McKenney commit 48b1fc190a180d971fb69217c88c7247f4f2ca19 Author: Marco Elver Date: Fri Feb 21 23:02:09 2020 +0100 kcsan: Add option to allow watcher interruptions Add option to allow interrupts while a watchpoint is set up. This can be enabled either via CONFIG_KCSAN_INTERRUPT_WATCHER or via the boot parameter 'kcsan.interrupt_watcher=1'. Note that, currently not all safe per-CPU access primitives and patterns are accounted for, which could result in false positives. For example, asm-generic/percpu.h uses plain operations, which by default are instrumented. On interrupts and subsequent accesses to the same variable, KCSAN would currently report a data race with this option. Therefore, this option should currently remain disabled by default, but may be enabled for specific test scenarios. To avoid new warnings, changes all uses of smp_processor_id() to use the raw version (as already done in kcsan_found_watchpoint()). The exact SMP processor id is for informational purposes in the report, and correctness is not affected. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 6c81e21a4742385c00713137c6fdcade0412e93c Author: Chris Wilson Date: Wed Mar 25 13:00:59 2020 +0000 drm/i915/gt: Stage the transfer of the virtual breadcrumb We move the virtual breadcrumb from one physical engine to the next, if the next virtual request is scheduled on a new physical engine. Since the virtual context can only be in one signal queue, we need it to track the current physical engine for the new breadcrumbs. However, to move the list we need both breadcrumb locks -- and since we cannot take both at the same time (unless we are careful and always ensure consistent ordering) stage the movement of the signaler via the current virtual request. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1510 Fixes: 6d06779e8672 ("drm/i915: Load balancing across a virtual engine") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200325130059.30600-1-chris@chris-wilson.co.uk commit 92581f9fb99ca46941bdf869b8984ce61c085434 Author: Chris Wilson Date: Wed Mar 25 12:02:27 2020 +0000 drm/i915: Immediately execute the fenced work If the caller allows and we do not have to wait for any signals, immediately execute the work within the caller's process. By doing so we avoid the overhead of scheduling a new task, and the latency in executing it, at the cost of pulling that work back into the immediate context. (Sometimes we still prefer to offload the task to another cpu, especially if we plan on executing many such tasks in parallel for this client.) Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200325120227.8044-2-chris@chris-wilson.co.uk commit 6670b413f8452ec303efcd2f9a6009c8602a297e Author: Chris Wilson Date: Wed Mar 25 12:02:26 2020 +0000 drm/i915/execlists: Pull tasklet interrupt-bh local to direct submission We dropped calling process_csb prior to handling direct submission in order to avoid the nesting of spinlocks and lift process_csb() and the majority of the tasklet out of irq-off. However, we do want to avoid ksoftirqd latency in the fast path, so try and pull the interrupt-bh local to direct submission if we can acquire the tasklet's lock. v2: Document the read of pending[0] from outside the tasklet with READ_ONCE. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200325120227.8044-1-chris@chris-wilson.co.uk commit 032d992dcbefb1e6a43832fa36c0da11b6b64741 Author: Chris Wilson Date: Wed Mar 25 10:15:02 2020 +0000 drm/i915/selftests: Measure the energy consumed while in RC6 Measure and compare the energy consumed, as reported by the rapl MSR, by the GPU while in RC0 and RC6 states. Throw an error if RC6 does not at least halve the energy consumption of RC0, as this more than likely means we failed to enter RC0 correctly. If we can't measure the energy draw with the MSR, then it will report 0 for both measurements. Since the measurement works on all gen6+, this seems worth flagging as an error. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Andi Shyti Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200325101502.12591-1-chris@chris-wilson.co.uk commit 9bf7c31386e511cc9671a252886dcb080bf08579 Author: Chris Wilson Date: Wed Mar 25 10:13:58 2020 +0000 drm/i915/execlists: Drop setting sibling priority hint on virtual engines We set the priority hint on execlists to avoid executing the tasklet for when we know that there will be no change in execution order. However, as we set it from the virtual engine for all siblings, but only one physical engine may respond, we leave the hint set on the others stopping direct submission that could take place. If we do not set the hint, we may attempt direct submission even if we don't expect to submit. If we set the hint, we may not do any submission until the tasklet is run (and sometimes we may park the engine before that has had a chance). Ergo there's only a minor ill-effect on mixed virtual/physical engine workloads where we may try and fail to do direct submission more often than required. (Pure virtual / engine workloads will have redundant tasklet execution suppressed as normal.) Closes: https://gitlab.freedesktop.org/drm/intel/issues/1522 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200325101358.12231-1-chris@chris-wilson.co.uk commit 5d1b631c773ffbbadcbb3176a2ae0ea9d1c114c7 Author: Mark Brown Date: Mon Mar 23 17:01:19 2020 +0000 arm64: bti: Document behaviour for dynamically linked binaries For dynamically linked binaries the interpreter is responsible for setting PROT_BTI on everything except itself. The dynamic linker needs to be aware of PROT_BTI, for example in order to avoid dropping that when marking executable pages read only after doing relocations, and doing everything in userspace ensures that we don't get any issues due to divergences in behaviour between the kernel and dynamic linker within a single executable. Add a comment indicating that this is intentional to the code to help people trying to understand what's going on. Signed-off-by: Mark Brown Signed-off-by: Catalin Marinas commit 691f7ba58d5220bbb06392054a6e50abdd393516 Author: José Roberto de Souza Date: Thu Mar 19 14:15:35 2020 -0700 drm/i915/display/fbc: Make fences a nice-to-have for GEN9+ dGFX has local memory so it does not have aperture or support CPU fences but even for iGFX it have a small number of fences. As replacement for fences to track frontbuffer modifications by CPU we have a software tracking that is already in used by FBC and PSR. PSR don't support fences so it shows that this tracking is reliable. So lets make fences a nice-to-have to activate FBC for GEN9+, this will allow us to enable FBC for dGFXs and iGFXs even when there is no available fence. We do not set fences to rotated planes but FBC only have restrictions against 16bpp, so adding it here. Also adding a new check for the tiling format, fences are only set to X and Y tiled planes but again FBC don't have any restrictions against tiling so adding linear as supported as well, other formats should be added after tested but IGT only supports drawing in thse 3 formats. intel_fbc_hw_tracking_covers_screen() maybe can also have the same treatment as fences but BSpec is not clear if the size limitation is for hardware tracking or general use of FBC and I don't have a 5K display to test it, so keeping as is for safety. v2: - Added tiling and pixel format rotation checks - Changed the GEN version not requiring fences to 11 from 9, DDX needs some changes but it don't have support for GEN11+ v3: - Changed back to GEN9+ - Moved GEN test to inside of tiling_is_valid() v4: - moved rotation check to its own functions v5: - renamed rotations_is_valid to rotation_is_valid - moved pre-g4x rotation check to rotation_is_valid() Cc: Daniel Vetter Cc: Dhinakaran Pandiyan Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200319211535.114625-1-jose.souza@intel.com commit 0e8003076aca7b29c868e923e73f332cca12ed8b Author: Jernej Skrabec Date: Thu Mar 5 00:25:12 2020 +0100 drm/bridge: dw-hdmi: rework csc related functions is_color_space_conversion() is a misnomer. It checks not only if color space conversion is needed, but also if format conversion is needed. This is actually desired behaviour because result of this function determines if CSC block should be enabled or not (CSC block can also do format conversion). In order to clear misunderstandings, let's rework is_color_space_conversion() to do exactly what is supposed to do and add another function which will determine if CSC block must be enabled or not. Reviewed-by: Laurent Pinchart Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200304232512.51616-5-jernej.skrabec@siol.net commit 86af379ebca2ef0b01d998a49e531cd495dcf9a3 Author: Jernej Skrabec Date: Thu Mar 5 00:25:11 2020 +0100 drm/bridge: dw-hdmi: Add support for RGB limited range CEA 861 standard requestis that RGB quantization range is "limited" for CEA modes. Support that by adding CSC matrix which downscales values. This allows proper color reproduction on TV and PC monitor at the same time. In future, override property can be added, like "Broadcast RGB" in i915 driver. Reviewed-by: Laurent Pinchart Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200304232512.51616-4-jernej.skrabec@siol.net commit 6b633e3efbb45b574bdd803ebdddc8e010758a95 Author: Jonas Karlman Date: Thu Mar 5 00:25:10 2020 +0100 drm/bridge: dw-hdmi: do not force "none" scan mode Setting scan mode to "none" confuses some TVs like LG B8, which randomly change overscan percentage over time. Digital outputs like HDMI and DVI, handled by this controller, don't really need overscan, so we can always set scan mode to underscan. Actually, this is exactly what drm_hdmi_avi_infoframe_from_display_mode() already does, so we can just remove offending line. Reviewed-by: Neil Armstrong Acked-by: Laurent Pinchart Signed-off-by: Jonas Karlman [updated commit message] Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200304232512.51616-3-jernej.skrabec@siol.net commit 1ef1380ca5dd450b514a987a65364af7c126d325 Author: Jernej Skrabec Date: Mon Feb 24 18:39:01 2020 +0100 drm/sun4i: Sort includes in VI and UI layer code sun8i_mixer.h include is misplaced. Move it. Acked-by: Maxime Ripard Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200224173901.174016-8-jernej.skrabec@siol.net commit 7831112eded6b9e792162863ad6d6e3936c7ed69 Author: Jernej Skrabec Date: Mon Feb 24 18:39:00 2020 +0100 drm/sun4i: de2: Don't return de2_fmt_info struct Now that de2_fmt_info contains only DRM <-> HW format mapping, it doesn't make sense to return pointer to structure when searching by DRM format. Rework that to return only HW format instead. This doesn't make any functional change. Acked-by: Maxime Ripard Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200224173901.174016-7-jernej.skrabec@siol.net commit daab3d0e8e2b2a6aecbb7c1a11e1148446e2ef30 Author: Jernej Skrabec Date: Mon Feb 24 18:38:59 2020 +0100 drm/sun4i: de2: csc_mode in de2 format struct is mostly redundant For RGB formats CSC mode is always set to none and for YUV formats almost always set to YUV to RGB. Add a helper function to deduce CSC mode from format. Acked-by: Maxime Ripard Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200224173901.174016-6-jernej.skrabec@siol.net commit a9a753594a8939023ac12bef379912c5231ec941 Author: Jernej Skrabec Date: Mon Feb 24 18:38:58 2020 +0100 drm/sun4i: de2: rgb field in de2 format struct is redundant drm_format_info structure already contains information if format is RGB or YUV. Use that instead. Acked-by: Maxime Ripard Signed-off-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20200224173901.174016-5-jernej.skrabec@siol.net commit 13c5a577b342d80ea06b7300ce69420a2d0928ca Author: Chris Wilson Date: Tue Mar 24 13:42:32 2020 +0000 drm/i915/gt: Select the deepest available parking mode for rc6 On Ivybridge, we can go lower than rc6 to rc6p. And this is required for Ivybridge to hit the same minimum power consumption as rc6 on other platforms, so make it so. v2: Update selftest to include all rc6 residency counters Note that Andi did mention that we should be converting the magic numbers into opaque magic macros, so if they ever get reused (unlikely given only Ivybridge used the extra modes) we'll need to pay back the technical debt. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1518 Fixes: 730eaeb52426 ("drm/i915/gt: Manual rc6 entry upon parking") Testcase: igt/i915_pm_rc6_residency/rc6-idle Signed-off-by: Chris Wilson Cc: Andi Shyti Cc: Mika Kuoppala Cc: Imre Deak Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200324134232.8773-1-chris@chris-wilson.co.uk commit f78a862d13e85d1cb4c4049f515d53a35e5b9dfe Author: Vandita Kulkarni Date: Thu Mar 12 11:08:37 2020 +0530 drm/i915/dsi: Use private flags to indicate TE in cmd mode On dsi cmd mode we do not receive vblanks instead we would get TE and these flags indicate TE is expected on which port. Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200312053841.2794-6-vandita.kulkarni@intel.com commit cebb28acf70441e9e828b10fa63835481e81fb4c Author: Vandita Kulkarni Date: Thu Mar 12 11:08:36 2020 +0530 drm/i915/dsi: Add check for periodic command mode If the GOP has programmed periodic command mode, we need to disable that which would need a deconfigure and configure sequence. v2: Fix sparse error, pass only intel_dsi (Jani) v3: Use intel_de_read Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200312053841.2794-5-vandita.kulkarni@intel.com commit b683e6d9a679141e4d28dc1c4ba8286041691803 Author: Vandita Kulkarni Date: Thu Mar 12 11:08:35 2020 +0530 drm/i915/dsi: Add cmd mode flags in display mode private flags Adding TE flags and periodic command mode flags as part of private flags to indicate what TE interrupts we would be getting instead of vblanks in case of mipi dsi command mode. v2: Add TE flag description (Jani) Reviewed-by: Jani Nikula Signed-off-by: Vandita Kulkarni Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200312053841.2794-4-vandita.kulkarni@intel.com commit b927783228f9838c9dbb40dd4928858047fa166c Author: Vandita Kulkarni Date: Thu Mar 12 11:08:34 2020 +0530 drm/i915/dsi: Add vblank calculation for command mode Transcoder timing calculation differ for command mode. v2: Use is_vid_mode, and use same I915_WRITE (Jani) v3: Adjust the calculations to reflect dsc compression ratio v4: Rearrange the vertical and horizontal timing calc, optimize local variables usage. (Jani) v5: Fix the values used for calculation, use afe_clk for byte clock calculation, use intel_de_write/read (Jani) Signed-off-by: Vandita Kulkarni Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200312053841.2794-3-vandita.kulkarni@intel.com commit b4b95b056ef3f3c047ffc161f60dddf8332e1358 Author: Vandita Kulkarni Date: Thu Mar 12 11:08:33 2020 +0530 drm/i915/dsi: Configure transcoder operation for command mode. Configure the transcoder to operate in TE GATE command mode and take TE events from GPIO. Also disable the periodic command mode, that GOP would have programmed. v2: Disable util pin (Jani) v3: Use intel_de_write (Jani) Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200312053841.2794-2-vandita.kulkarni@intel.com commit af7a272ef650832b2cb3b20103f1b5254696ae9f Author: Chris Wilson Date: Mon Mar 23 19:20:29 2020 +0000 drm/i915/gt: Only delay the context barrier pm It is strictly sufficient to only delay the intel_engine_pm_put from the context barrier (and not from the context exit) in order to prevent the gem_exec_nop contention. Adding the delay to the context exit incurs noticably extra penalty for soft-rc6. Fixes: edee52c927ef ("drm/i915/gt: Delay release of engine-pm after last retirement") Testcase: igt/i915_pm_rc6_residency/rc6-idle Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200323192029.20723-1-chris@chris-wilson.co.uk commit 8ad463acc78a591116eb64b5a8eec13c2486aed6 Author: Wambui Karuga Date: Mon Mar 23 14:28:02 2020 +0300 drm/vram-helper: remove unneeded #if defined/endif guards. Remove unneeded #if/#endif guards for checking whether the CONFIG_DEBUG_FS option is set or not. If the option is not set, the compiler optimizes the functions making the guards unnecessary. Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200323112802.228214-1-wambui.karugax@gmail.com commit 8493e110a637c273b4d38e79f7ce3c3ad1812931 Author: Matthew Auld Date: Mon Mar 23 13:08:21 2020 +0000 drm/i915/selftests: mark huge_gem_object as not shrinkable It looks like some callers expect a non-volatile object, that they do not want the contents of the pages lost if they happen to not be looking at it. The shrinker however sees that we mark the pages as DONTNEED and believes that it can freely reap them. However, since the huge object use plain pages, they cannot be swapped out as they have no backing storge, and the only way we can shrink them is by discarding the contents. In light of the callers wanting to keep the contents around, both IS_SHRINKABLE and marking the pages as volatile are incorrect. If we drop the IS_SHRINKABLE flag we avoid the immediate issue of the shrinker accidentally removing valuable content. We will have to remember that a huge object is not suitable for exercising the shrinker interaction -- although we can introduce a shrinkable one if we require. Signed-off-by: Matthew Auld Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200323130821.47914-1-matthew.auld@intel.com commit edee52c927ef30d5b0ae871375567f3484f23cee Author: Chris Wilson Date: Mon Mar 23 09:28:37 2020 +0000 drm/i915/gt: Delay release of engine-pm after last retirement Keep the engine-pm awake until the next jiffie, to avoid immediate ping-pong under moderate load. (Forcing the idle barrier excerbates the moderate load, dramatically increasing the driver overhead.) On the other hand, delaying the idle-barrier slightly incurs longer rc6-off and so more power consumption. Closes: https://gitlab.freedesktop.org/drm/intel/issues/848 Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200323092841.22240-4-chris@chris-wilson.co.uk commit e9037e7f9a1681fca32e45e82d7b7f714b49a9e6 Author: Chris Wilson Date: Mon Mar 23 10:32:21 2020 +0000 drm/i915: Extend intel_wakeref to support delayed puts In some cases we want to hold onto the wakeref for a little after the last user so that we can avoid having to drop and then immediately reacquire it. Allow the last user to specify if they would like to keep the wakeref alive for a short hysteresis. v2: Embrace bitfield.h for adjustable flags. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200323103221.14444-1-chris@chris-wilson.co.uk commit 45d4173994248a47d8689866676b014f5439c711 Author: Matthew Auld Date: Mon Mar 23 11:03:01 2020 +0000 drm/i915/selftests/perf: watch out for stolen objects Stolen memory is allocated at creation, returning -ENOSPC if we run out space. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1424 Signed-off-by: Matthew Auld Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200323110301.38806-1-matthew.auld@intel.com commit 41e4065a6b0bb4d785161eff16874f31ec9633ef Author: Chris Wilson Date: Mon Mar 23 09:28:38 2020 +0000 drm/i915: Rely on direct submission to the queue Drop the pretense of kicking the tasklet (used only for the defunct guc submission backend, it should just take ownership of the submit!) and so remove the bh-kicking from around submission. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200323092841.22240-5-chris@chris-wilson.co.uk commit 7707f7227f096162c724cc55f5db1b83cb94c105 Author: Andrzej Pietrasiewicz Date: Wed Mar 11 15:55:41 2020 +0100 drm/rockchip: Add support for afbc This patch adds support for afbc handling. afbc is a compressed format which reduces the necessary memory bandwidth. Co-developed-by: Mark Yao Signed-off-by: Mark Yao Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Sandy Huang Link: https://patchwork.freedesktop.org/patch/msgid/20200311145541.29186-7-andrzej.p@collabora.com commit 93159e12353c2a47e5576d642845a91fa00530bf Author: Chris Wilson Date: Mon Mar 23 09:28:41 2020 +0000 drm/i915/gem: Avoid gem_context->mutex for simple vma lookup As we store the handle lookup inside a radix tree, we do not need the gem_context->mutex except until we need to insert our lookup into the common radix tree. This takes a small bit of rearranging to ensure that the lut we insert into the tree is ready prior to actually inserting it (as soon as it is exposed via the radixtree, it is visible to any other submission). v2: For brownie points, remove the goto spaghetti. v3: Tighten up the closed-handle checks. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200323092841.22240-8-chris@chris-wilson.co.uk commit 3447c4c55d0edc95742fdcd91c3efb050546b907 Author: Chris Wilson Date: Mon Mar 23 09:28:35 2020 +0000 drm/i915: Avoid live-lock with i915_vma_parked() Abuse^W Take advantage that we know we are inside the GT wakeref and that prevents any client execbuf from reopening the i915_vma in order to claim all the vma to close without having to drop the spinlock to free each one individually. By keeping the spinlock, we do not have to restart if we run concurrently with i915_gem_free_objects -- which causes them both to restart continually and make very very slow progress. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1361 Fixes: 77853186e547 ("drm/i915: Claim vma while under closed_lock in i915_vma_parked()") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200323092841.22240-2-chris@chris-wilson.co.uk commit 8e87e0139aff59c5961347ab1ef06814f092c439 Author: Chris Wilson Date: Mon Mar 23 09:28:34 2020 +0000 drm/i915/gt: Mark timeline->cacheline as destroyed after rcu grace period Since we take advantage of RCU for some i915_active objects, like the intel_timeline_cacheline, we need to delay the i915_active_fini until after the RCU grace period and we perform the kfree -- that is until after all RCU protected readers. <3> [108.204873] ODEBUG: assert_init not available (active state 0) object type: i915_active hint: __cacheline_active+0x0/0x80 [i915] <4> [108.207377] WARNING: CPU: 3 PID: 2342 at lib/debugobjects.c:488 debug_print_object+0x67/0x90 <4> [108.207400] Modules linked in: vgem snd_hda_codec_hdmi x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul snd_hda_intel ghash_clmulni_intel snd_intel_dspcfg snd_hda_codec ax88179_178a snd_hwdep usbnet btusb snd_hda_core btrtl mii btbcm btintel snd_pcm bluetooth ecdh_generic ecc i915 i2c_hid pinctrl_sunrisepoint pinctrl_intel intel_lpss_pci prime_numbers <4> [108.207587] CPU: 3 PID: 2342 Comm: gem_exec_parall Tainted: G U 5.6.0-rc6-CI-Patchwork_17047+ #1 <4> [108.207609] Hardware name: Google Soraka/Soraka, BIOS MrChromebox-4.10 08/25/2019 <4> [108.207639] RIP: 0010:debug_print_object+0x67/0x90 <4> [108.207668] Code: 83 c2 01 8b 4b 14 4c 8b 45 00 89 15 87 d2 8a 02 8b 53 10 4c 89 e6 48 c7 c7 38 2b 32 82 48 8b 14 d5 80 2f 07 82 e8 49 d5 b7 ff <0f> 0b 5b 83 05 c3 f6 22 01 01 5d 41 5c c3 83 05 b8 f6 22 01 01 c3 <4> [108.207692] RSP: 0018:ffffc90000e7f890 EFLAGS: 00010282 <4> [108.207723] RAX: 0000000000000000 RBX: ffffc90000e7f8b0 RCX: 0000000000000001 <4> [108.207747] RDX: 0000000080000001 RSI: ffff88817ada8cb8 RDI: 00000000ffffffff <4> [108.207770] RBP: ffffffffa0341cc0 R08: ffff88816b5a8948 R09: 0000000000000000 <4> [108.207792] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff82322d54 <4> [108.207814] R13: ffffffffa0341cc0 R14: ffffffff83df9568 R15: ffff88816064f400 <4> [108.207839] FS: 00007f437d753700(0000) GS:ffff88817ad80000(0000) knlGS:0000000000000000 <4> [108.207863] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4> [108.207887] CR2: 00007f2ad1fb5000 CR3: 00000001725d8004 CR4: 00000000003606e0 <4> [108.207907] Call Trace: <4> [108.207959] debug_object_assert_init+0x15c/0x180 <4> [108.208475] ? i915_active_acquire_if_busy+0x10/0x50 [i915] <4> [108.208513] ? rcu_read_lock_held+0x4d/0x60 <4> [108.208970] i915_active_acquire_if_busy+0x10/0x50 [i915] <4> [108.209380] intel_timeline_read_hwsp+0x81/0x540 [i915] <4> [108.210262] __emit_semaphore_wait+0x45/0x1b0 [i915] <4> [108.210726] ? i915_request_await_dma_fence+0x143/0x560 [i915] <4> [108.211156] i915_request_await_dma_fence+0x28a/0x560 [i915] <4> [108.211633] i915_request_await_object+0x24a/0x3f0 [i915] <4> [108.212102] eb_submit.isra.47+0x58f/0x920 [i915] <4> [108.212622] i915_gem_do_execbuffer+0x1706/0x2c70 [i915] <4> [108.213071] ? i915_gem_execbuffer2_ioctl+0xc0/0x470 [i915] Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20200323092841.22240-1-chris@chris-wilson.co.uk commit 13ea6db2cf24a797ac8c9922e3079fcb897fd32c Author: Anshuman Gupta Date: Wed Mar 18 13:48:37 2020 +0530 drm/i915/edp: Ignore short pulse when panel powered off Few edp panels like Sharp is triggering short and long hpd pulse after panel is getting powered off. Currently driver is already ignoring long pulse for eDP panel but in order to process the short pulse, it turns on the VDD which requires panel power_cycle_delay + panel_power_on_delay these delay on Sharp panel introduced the responsiveness overhead of 800ms in the modeset sequence and as well is in suspend sequence. Ignoring any short pulse if panel is powered off. FIXME: It requires to wait for panel_power_off delay in order to check the panel power status due to pps_lock because panel triggers short pulse immediately after writing PP_OFF to PP_CTRL register and wait_panel_off waits for panel_power_off delay with pps_lock held. This still creates responsiveness overhead of panel_power_off delay. v2: - checking vdd along with panel power to ignore the hpd. [Jani,Ville] v3: - safer side check to ignore the long hpd when eDP have power, adding type of hpd to debug log. [Jani] Signed-off-by: Anshuman Gupta Reviewed-by: Jani Nikula Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200318081837.23983-1-anshuman.gupta@intel.com commit 043cd2d14edec8c09ddfdea07a1604e78526c897 Author: Chris Wilson Date: Sun Mar 22 16:32:25 2020 +0000 drm/i915/gt: Leave rps->cur_freq on unpark Don't override our previous frequency we used after parking, and avoid continually spiking back to the efficient frequency for mostly idle workloads. Trust our ability to autotune across a workload switch. Signed-off-by: Chris Wilson Cc: Andi Shyti Cc: Lyude Paul Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200322163225.28791-2-chris@chris-wilson.co.uk commit 21abf0bf168dffff1192e0f072af1dc74ae1ff0e Author: Chris Wilson Date: Sun Mar 22 16:32:24 2020 +0000 drm/i915/gt: Treat idling as a RPS downclock event If we park/unpark faster than we can respond to RPS events, we never will process a downclock event after expiring a waitboost, and thus we will forever restart the GPU at max clocks even if the workload switches and doesn't justify full power. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1500 Fixes: 3e7abf814193 ("drm/i915: Extract GT render power state management") Signed-off-by: Chris Wilson Cc: Andi Shyti Cc: Lyude Paul Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20200322163225.28791-1-chris@chris-wilson.co.uk Cc: # v5.5+ commit bb6892b7ce15acc0742f32b740ecaa5594bf31ec Author: Chris Wilson Date: Sun Mar 22 12:32:41 2020 +0000 drm/i915/gt: Use the correct err_unlock unwind path for a closed context A silly cut'n'paste copied the unlocked error path and used it inside the pin_mutex lock, we need to drop that lock before returning. Fixes: b412c63f1cba ("drm/i915/gt: Report context-is-closed prior to pinning") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200322123241.17694-1-chris@chris-wilson.co.uk commit 7f60c4b9d964f604262327a0bfdbfd1721288ef8 Author: Qiang Yu Date: Sat Mar 7 21:54:38 2020 +0800 drm/lima: add trace point for tasks track lima task start which can be combined with dma_fence_signal to identify task execution time. example command to record: trace-cmd record -i \ -e "lima:lima_task_submit" -e "lima:lima_task_run" \ -e "*fence:*fence_signaled" -e "drm:drm_vblank_event" \ -e "drm:drm_vblank_event_queued" sleep 4 Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200307135438.9981-1-yuq825@gmail.com commit 57b517cecea05f35fd4a1a00708f9255db7382c8 Author: Qiang Yu Date: Sat Feb 22 10:42:09 2020 +0800 drm/lima: add error sysfs to export error task dump Export /sys/class/drm/cardX/device/error sysfs for user read out error task dump file. Tested-by: Andreas Baierl Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200222024210.18697-5-yuq825@gmail.com commit b78edd46f6a9eca23b4070166fe98264c07171cc Author: Qiang Yu Date: Sat Mar 7 21:44:23 2020 +0800 drm/lima: save task info dump when task fail Save all information to start a task which can be exported to user for debug usage. Dump file data format is specified in lima_dump.h v2: Add include header to address build robot complain. Tested-by: Andreas Baierl Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200307134423.24329-1-yuq825@gmail.com commit c67a3d4f68c7cff39253e122d26a0152dbef37c8 Author: Qiang Yu Date: Sat Feb 22 10:42:07 2020 +0800 drm/lima: add max_error_tasks module parameter Limit error tasks to save. Tested-by: Andreas Baierl Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200222024210.18697-3-yuq825@gmail.com commit 6ebd24b6bf106d3195bdbfeaa1ac77571e3dc670 Author: Qiang Yu Date: Sat Feb 22 10:42:06 2020 +0800 drm/lima: save process info for debug usage When task fail, we can find its process with this information. Tested-by: Andreas Baierl Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200222024210.18697-2-yuq825@gmail.com commit f019190b7d2708baec0732c5e915923430eab8dc Author: Geert Uytterhoeven Date: Mon Mar 16 17:42:49 2020 +0100 drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const mipi_dbi_command_stackbuf() copies the passed buffer data, so it can be const. Signed-off-by: Geert Uytterhoeven Reviewed-by: Noralf Trønnes Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200316164249.6234-1-geert+renesas@glider.be commit 92e513fb079833d2f775d9771071174d9f3936c3 Author: Sam Ravnborg Date: Sat Mar 14 16:30:47 2020 +0100 dt-bindings: display: grammar fixes in panel/ Fix a few grammar/editorial issues spotted by Laurent Pinchart. Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Cc: Laurent Pinchart Cc: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20200314153047.2486-4-sam@ravnborg.org commit 9fd28570ec9166a7357692990789db128fd7a635 Author: Nishant Malpani Date: Wed Mar 18 13:33:11 2020 +0530 iio: light: tsl2563: Rename macro to fix typo This patch renames macro to fix the following warning generated by checkpatch.pl: WARNING: 'DISBLED' may be misspelled - perhaps 'DISABLED'? Signed-off-by: Nishant Malpani Signed-off-by: Jonathan Cameron commit 143324fd89eff7423c01eba79fc7044003a257e9 Author: Rohit Sarkar Date: Wed Mar 18 21:41:51 2020 +0530 iio: core: Make mlock internal to the iio core "mlock" should ideally only be used by the iio core. The mlock implementation may change in the future which means that no driver should be explicitly using mlock. Signed-off-by: Rohit Sarkar Signed-off-by: Jonathan Cameron commit 72ad02b15d6367f9897db62313cc69fb0a20ee1f Author: Daniel Campello Date: Tue Mar 10 14:06:59 2020 -0600 iio: Add SEMTECH SX9310/9311 sensor driver Add SEMTECH SX9310/9311 driver. The device has the following entry points: Usual frequency: - sampling_frequency - sampling_frequency_available Instant reading of current values for different sensors: - in_proximity0_raw - in_proximity1_raw - in_proximity2_raw - in_proximity3_comb_raw and associated events in events/ Signed-off-by: Gwendal Grignou Signed-off-by: Enrico Granata Signed-off-by: Daniel Campello Signed-off-by: Jonathan Cameron commit 4bb2b8f94ace32c1e0d94a7dc9f881c44c3a71b8 Author: Beniamin Bia Date: Wed Mar 11 10:43:28 2020 +0200 iio: adc: ad7476: implement devm_add_action_or_reset Use devm_add_action_or_reset to automatically disable the device when it is removed or an error occurs during probe routine. Signed-off-by: Beniamin Bia Signed-off-by: Jonathan Cameron commit 0267a3166644037f0de66b496165a5801a99a5ae Author: Dragos Bogdan Date: Wed Mar 11 10:43:27 2020 +0200 iio: adc: ad7476: Add AD7091 support AD7091R is already supported by this driver. While AD7091R allows the choice of an internal or an external voltage reference, for AD7091 the reference is only provided by VDD. Since this information is anyway obtained through the "vcc" regulator, no other driver changes are required for adding AD7091 support as well. Signed-off-by: Dragos Bogdan Signed-off-by: Beniamin Bia Signed-off-by: Jonathan Cameron commit 3a6af93dd66eba90cee3eb778b83bdccb2202d4f Author: Dragos Bogdan Date: Wed Mar 11 10:43:26 2020 +0200 iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R When CONVST signal is generated internally, IIO_CHAN_INFO_RAW can be made available for AD7091R for single reads. This patch enables it and makes supporting more devices by this driver easier. Signed-off-by: Dragos Bogdan Signed-off-by: Beniamin Bia Signed-off-by: Jonathan Cameron commit af37e4703d00cea66e467ffe69afe2540fa32f75 Author: Dragos Bogdan Date: Wed Mar 11 10:43:25 2020 +0200 iio: adc: ad7476: Generate CONVST signal internally Compared to the other supported parts, AD7091R are dependent of a CONVST signal that initiates the conversion. At this moment, only sampling in buffered mode is supported for AD7091R and the only option until now was to generate this signal externally using an IIO trigger. This patch adds the option of generating it internally, more compatible triggers being available in this case. Also, it is an intermediate step of adding support more devices. Signed-off-by: Dragos Bogdan Signed-off-by: Beniamin Bia Signed-off-by: Jonathan Cameron commit 4be590e3f6ec402abe563db90afff6ce3c44737f Author: Andy Shevchenko Date: Wed Mar 11 11:22:23 2020 +0200 iio: adc: intel_mrfld_adc: Use be16_to_cpu() instead of get_unaligned_be16() There is no need to call unaligned helpers on stack placed variables because compiler will align them correctly, accordingly to architectural ABI. Moreover, using bitwise type makes it explicit to see what we are reading in bulk transfer. On top of that, use sizeof() instead of magic value. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 144eb562becf64aeff1975f99932ddba0c1616d0 Author: Andy Shevchenko Date: Fri Mar 13 12:49:55 2020 +0200 iio: humidity: hts221: Drop unneeded casting when print error code Explicit casting in printf() usually shows that something is not okay. Here, we really don't need it by providing correct specifier. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 92c3e93b7d2d8d9505f295d2caff58b91b407fa2 Author: Andy Shevchenko Date: Fri Mar 13 12:49:54 2020 +0200 iio: humidity: hts221: Make use of device properties Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 4d8d2f09ad9fec7dcc1298541b0b12bd5dadf319 Author: Andy Shevchenko Date: Fri Mar 13 12:49:53 2020 +0200 iio: humidity: hts221: Use dev_get_platdata() to get platform_data Use dev_get_platdata() to get the platform_data instead of referencing it directly. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 38bc80154a50b75ddfbf6f6ae38eb3105de8a5db Author: Andy Shevchenko Date: Fri Mar 13 12:49:52 2020 +0200 iio: st_sensors: Join string literals back For easy grepping on debug purposes join string literals back in the messages. No functional change. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 7da08588b99264db434a4ce3c4167cb307911031 Author: Andy Shevchenko Date: Fri Mar 13 12:49:51 2020 +0200 iio: st_sensors: Drop unneeded casting when print error code Explicit casting in printf() usually shows that something is not okay. Here, we really don't need it by providing correct specifier. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 1f38527d5878401611a0082e2926c9625e2331cf Author: Andy Shevchenko Date: Fri Mar 13 12:49:50 2020 +0200 iio: st_sensors: Drop unneeded explicit castings In few places the unnecessary explicit castings are being used. Drop them for good. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 49f20fc6fe7010e91f8d27847bea24bd990de953 Author: Andy Shevchenko Date: Fri Mar 13 12:49:49 2020 +0200 iio: st_sensors: Use dev_get_platdata() to get platform_data Use dev_get_platdata() to get the platform_data instead of referencing it directly. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 3c50dee99588301869cdab857e70dfbb1b9ba6f0 Author: Andy Shevchenko Date: Fri Mar 13 12:49:48 2020 +0200 iio: light: st_uvis25: Drop unneeded casting when print error code Explicit casting in printf() usually shows that something is not okay. Here, we really don't need it by providing correct specifier. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 35a4eeb055c9c35ed3c4cdc340547468bf18368e Author: Takashi Iwai Date: Wed Mar 11 08:43:24 2020 +0100 iio: core: Use scnprintf() for avoiding potential buffer overflow Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai Signed-off-by: Jonathan Cameron commit 2dbbe4d513ad17f6ce125234c7710626268b8932 Author: Lars-Peter Clausen Date: Mon Mar 9 11:28:47 2020 +0100 iio: xilinx-xadc: Fix typo in author's name It appears the author of the xilinx-xadc driver can't even spell his own name correctly. Fix that. Reported-by: Lars Möllendorf Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron commit f5d2313bd3c540be405c4977a63840cd6d0167b5 Author: Marco Elver Date: Fri Feb 14 22:10:35 2020 +0100 kcsan, trace: Make KCSAN compatible with tracing Previously the system would lock up if ftrace was enabled together with KCSAN. This is due to recursion on reporting if the tracer code is instrumented with KCSAN. To avoid this for all types of tracing, disable KCSAN instrumentation for all of kernel/trace. Furthermore, since KCSAN relies on udelay() to introduce delay, we have to disable ftrace for udelay() (currently done for x86) in case KCSAN is used together with lockdep and ftrace. The reason is that it may corrupt lockdep IRQ flags tracing state due to a peculiar case of recursion (details in Makefile comment). Reported-by: Qian Cai Tested-by: Qian Cai Acked-by: Steven Rostedt (VMware) Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 703b321501c95c658275fd76775282fe45989641 Author: Marco Elver Date: Tue Feb 11 17:04:23 2020 +0100 kcsan: Introduce ASSERT_EXCLUSIVE_BITS(var, mask) This introduces ASSERT_EXCLUSIVE_BITS(var, mask). ASSERT_EXCLUSIVE_BITS(var, mask) will cause KCSAN to assume that the following access is safe w.r.t. data races (however, please see the docbook comment for disclaimer here). For more context on why this was considered necessary, please see: http://lkml.kernel.org/r/1580995070-25139-1-git-send-email-cai@lca.pw In particular, before this patch, data races between reads (that use @mask bits of an access that should not be modified concurrently) and writes (that change ~@mask bits not used by the readers) would have been annotated with "data_race()" (or "READ_ONCE()"). However, doing so would then hide real problems: we would no longer be able to detect harmful races between reads to @mask bits and writes to @mask bits. Therefore, by using ASSERT_EXCLUSIVE_BITS(var, mask), we accomplish: 1. Avoid proliferation of specific macros at the call sites: by including a single mask in the argument list, we can use the same macro in a wide variety of call sites, regardless of how and which bits in a field each call site actually accesses. 2. The existing code does not need to be modified (although READ_ONCE() may still be advisable if we cannot prove that the data race is always safe). 3. We catch bugs where the exclusive bits are modified concurrently. 4. We document properties of the current code. Acked-by: John Hubbard Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar Cc: David Hildenbrand Cc: Jan Kara Cc: Qian Cai commit 81af89e15862909881ff010a0adb67148487e88a Author: Marco Elver Date: Tue Feb 11 17:04:22 2020 +0100 kcsan: Add kcsan_set_access_mask() support When setting up an access mask with kcsan_set_access_mask(), KCSAN will only report races if concurrent changes to bits set in access_mask are observed. Conveying access_mask via a separate call avoids introducing overhead in the common-case fast-path. Acked-by: John Hubbard Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit b738f6169f1260b4ed5bd9f220b1c84d79f3ab8d Author: Marco Elver Date: Tue Feb 11 17:04:21 2020 +0100 kcsan: Introduce kcsan_value_change type Introduces kcsan_value_change type, which explicitly points out if we either observed a value-change (TRUE), or we could not observe one but cannot rule out a value-change happened (MAYBE). The MAYBE state can either be reported or not, depending on configuration preferences. A follow-up patch introduces the FALSE state, which should never be reported. No functional change intended. Acked-by: John Hubbard Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit b968a08f242d51982e46041c506115b5e11a7570 Author: Marco Elver Date: Tue Feb 11 17:04:20 2020 +0100 compiler.h, seqlock.h: Remove unnecessary kcsan.h includes No we longer have to include kcsan.h, since the required KCSAN interface for both compiler.h and seqlock.h are now provided by kcsan-checks.h. Acked-by: John Hubbard Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit f0f6928c2c4c19ab6171d4f468f542fac1888a8f Author: Marco Elver Date: Tue Feb 11 17:04:19 2020 +0100 kcsan: Move interfaces that affects checks to kcsan-checks.h This moves functions that affect state changing the behaviour of kcsan_check_access() to kcsan-checks.h. Since these are likely used with kcsan_check_access() it makes more sense to have them in kcsan-checks.h, to avoid including all of 'include/linux/kcsan.h'. No functional change intended. Acked-by: John Hubbard Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 3a5b45e5031fa395ab6e53545fb726b2d5b104f0 Author: Marco Elver Date: Mon Feb 10 15:56:39 2020 +0100 kcsan: Fix misreporting if concurrent races on same address If there are at least 4 threads racing on the same address, it can happen that one of the readers may observe another matching reader in other_info. To avoid locking up, we have to consume 'other_info' regardless, but skip the report. See the added comment for more details. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 80d4c4775216602ccdc9e761ce251c8451d0c6ca Author: Marco Elver Date: Fri Feb 7 19:59:10 2020 +0100 kcsan: Expose core configuration parameters as module params This adds early_boot, udelay_{task,interrupt}, and skip_watch as module params. The latter parameters are useful to modify at runtime to tune KCSAN's performance on new systems. This will also permit auto-tuning these parameters to maximize overall system performance and KCSAN's race detection ability. None of the parameters are used in the fast-path and referring to them via static variables instead of CONFIG constants will not affect performance. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar Cc: Qian Cai commit a312013578e4775003689e31c1f487df11f362a3 Author: Marco Elver Date: Thu Feb 6 16:46:26 2020 +0100 kcsan: Add test to generate conflicts via debugfs Add 'test=' option to KCSAN's debugfs interface to invoke KCSAN checks on a dummy variable. By writing 'test=' to the debugfs file from multiple tasks, we can generate real conflicts, and trigger data race reports. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit f97f713dc25714ac13f3b5abdeffce2da3f6fe70 Author: Marco Elver Date: Thu Feb 6 16:46:25 2020 +0100 kcsan: Introduce ASSERT_EXCLUSIVE_*() macros Introduces ASSERT_EXCLUSIVE_WRITER() and ASSERT_EXCLUSIVE_ACCESS(), which may be used to assert properties of synchronization logic, where violation cannot be detected as a normal data race. Examples of the reports that may be generated: ================================================================== BUG: KCSAN: assert: race in test_thread / test_thread write to 0xffffffffab3d1540 of 8 bytes by task 466 on cpu 2: test_thread+0x8d/0x111 debugfs_write.cold+0x32/0x44 ... assert no writes to 0xffffffffab3d1540 of 8 bytes by task 464 on cpu 0: test_thread+0xa3/0x111 debugfs_write.cold+0x32/0x44 ... ================================================================== ================================================================== BUG: KCSAN: assert: race in test_thread / test_thread assert no accesses to 0xffffffffab3d1540 of 8 bytes by task 465 on cpu 1: test_thread+0xb9/0x111 debugfs_write.cold+0x32/0x44 ... read to 0xffffffffab3d1540 of 8 bytes by task 464 on cpu 0: test_thread+0x77/0x111 debugfs_write.cold+0x32/0x44 ... ================================================================== Suggested-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit d591ec3db75f9eadfa7976ff8796c674c0027715 Author: Marco Elver Date: Thu Feb 6 16:46:24 2020 +0100 kcsan: Introduce KCSAN_ACCESS_ASSERT access type The KCSAN_ACCESS_ASSERT access type may be used to introduce dummy reads and writes to assert certain properties of concurrent code, where bugs could not be detected as normal data races. For example, a variable that is only meant to be written by a single CPU, but may be read (without locking) by other CPUs must still be marked properly to avoid data races. However, concurrent writes, regardless if WRITE_ONCE() or not, would be a bug. Using kcsan_check_access(&x, sizeof(x), KCSAN_ACCESS_ASSERT) would allow catching such bugs. To support KCSAN_ACCESS_ASSERT the following notable changes were made: * If an access is of type KCSAN_ASSERT_ACCESS, disable various filters that only apply to data races, so that all races that KCSAN observes are reported. * Bug reports that involve an ASSERT access type will be reported as "KCSAN: assert: race in ..." instead of "data-race"; this will help more easily distinguish them. * Update a few comments to just mention 'races' where we do not always mean pure data races. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit ed95f95c86cd53621103d865d62b5e1f96e60edb Author: Marco Elver Date: Wed Feb 5 11:14:19 2020 +0100 kcsan: Fix 0-sized checks Instrumentation of arbitrary memory-copy functions, such as user-copies, may be called with size of 0, which could lead to false positives. To avoid this, add a comparison in check_access() for size==0, which will be optimized out for constant sized instrumentation (__tsan_{read,write}N), and therefore not affect the common-case fast-path. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 8cfbb04fae75260eae07ab8c74c1dcd44294d739 Author: Marco Elver Date: Tue Feb 4 18:21:12 2020 +0100 kcsan: Clean up the main KCSAN Kconfig option This patch cleans up the rules of the 'KCSAN' Kconfig option by: 1. implicitly selecting 'STACKTRACE' instead of depending on it; 2. depending on DEBUG_KERNEL, to avoid accidentally turning KCSAN on if the kernel is not meant to be a debug kernel; 3. updating the short and long summaries. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit a249a73231e2e30944b948c5351025e5ff65f6d1 Author: Marco Elver Date: Tue Feb 4 18:21:11 2020 +0100 kcsan: Clarify Kconfig option KCSAN_IGNORE_ATOMICS Clarify difference between options KCSAN_IGNORE_ATOMICS and KCSAN_ASSUME_PLAIN_WRITES_ATOMIC in help text. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 1e6ee2f0fe8ae682757960edf455e99f611268a0 Author: Marco Elver Date: Tue Feb 4 18:21:10 2020 +0100 kcsan: Add option to assume plain aligned writes up to word size are atomic This adds option KCSAN_ASSUME_PLAIN_WRITES_ATOMIC. If enabled, plain aligned writes up to word size are assumed to be atomic, and also not subject to other unsafe compiler optimizations resulting in data races. This option has been enabled by default to reflect current kernel-wide preferences. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 7ad900d35b49af5a05f595d2274c32e69e01b055 Author: Paul E. McKenney Date: Mon Feb 3 14:42:18 2020 -0800 kcsan: Add docbook header for data_race() Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar Cc: Marco Elver Cc: Dmitry Vyukov commit 76d6f06c36a3b5cc402eeeb709613cb211fdaa8f Author: Marco Elver Date: Tue Jan 21 17:05:12 2020 +0100 copy_to_user, copy_from_user: Use generic instrumented.h This replaces the KASAN instrumentation with generic instrumentation, implicitly adding KCSAN instrumentation support. For KASAN no functional change is intended. Suggested-by: Arnd Bergmann Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit d0ef4c360f7ea33905539b9b36fa2273915703f0 Author: Marco Elver Date: Tue Jan 21 17:05:11 2020 +0100 iov_iter: Use generic instrumented.h This replaces the kasan instrumentation with generic instrumentation, implicitly adding KCSAN instrumentation support. For KASAN no functional change is intended. Suggested-by: Arnd Bergmann Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 27f937cc810aef63b0752f5bfbf383390dd076a1 Author: Marco Elver Date: Tue Jan 21 17:05:10 2020 +0100 asm-generic, kcsan: Add KCSAN instrumentation for bitops Add explicit KCSAN checks for bitops. Acked-by: Arnd Bergmann Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit ed8af2e4d2a71bd58f5776b7e5a477d136e32be4 Author: Marco Elver Date: Tue Jan 21 17:05:09 2020 +0100 asm-generic, atomic-instrumented: Use generic instrumented.h This switches atomic-instrumented.h to use the generic instrumentation wrappers provided by instrumented.h. No functional change intended. Suggested-by: Arnd Bergmann Signed-off-by: Marco Elver Acked-by: Arnd Bergmann Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 36e4d4dd4fc4f1d99e7966a460a2b12ce438abc2 Author: Marco Elver Date: Tue Jan 21 17:05:08 2020 +0100 include/linux: Add instrumented.h infrastructure This adds instrumented.h, which provides generic wrappers for memory access instrumentation that the compiler cannot emit for various sanitizers. Currently this unifies KASAN and KCSAN instrumentation. In future this will also include KMSAN instrumentation. Note that, copy_{to,from}_user should use special instrumentation, since we should be able to instrument both source and destination memory accesses if both are kernel memory. The current patch only instruments the memory access where the address is always in kernel space, however, both may in fact be kernel addresses when a compat syscall passes an argument allocated in the kernel to a real syscall. In a future change, both KASAN and KCSAN should check both addresses in such cases, as well as KMSAN will make use of both addresses. [It made more sense to provide the completed function signature, rather than updating it and changing all locations again at a later time.] Suggested-by: Arnd Bergmann Signed-off-by: Marco Elver Acked-by: Alexander Potapenko Reviewed-by: Dmitry Vyukov Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit ad4f8eeca8eaa24afb6059c241a2f4baf86378f3 Author: Marco Elver Date: Wed Jan 29 16:01:02 2020 +0100 kcsan: Address missing case with KCSAN_REPORT_VALUE_CHANGE_ONLY Even with KCSAN_REPORT_VALUE_CHANGE_ONLY, KCSAN still reports data races between reads and watchpointed writes, even if the writes wrote values already present. This commit causes KCSAN to unconditionally skip reporting in this case. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit f1bc96210c6a6b853b4b2eec808141956e8fbc5d Author: Marco Elver Date: Wed Jan 15 17:25:12 2020 +0100 kcsan: Make KCSAN compatible with lockdep We must avoid any recursion into lockdep if KCSAN is enabled on utilities used by lockdep. One manifestation of this is corruption of lockdep's IRQ trace state (if TRACE_IRQFLAGS), resulting in spurious warnings (see below). This commit fixes this by: 1. Using raw_local_irq{save,restore} in kcsan_setup_watchpoint(). 2. Disabling lockdep in kcsan_report(). Tested with: CONFIG_LOCKDEP=y CONFIG_DEBUG_LOCKDEP=y CONFIG_TRACE_IRQFLAGS=y This fix eliminates spurious warnings such as the following one: WARNING: CPU: 0 PID: 2 at kernel/locking/lockdep.c:4406 check_flags.part.0+0x101/0x220 Modules linked in: CPU: 0 PID: 2 Comm: kthreadd Not tainted 5.5.0-rc1+ #11 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:check_flags.part.0+0x101/0x220 Call Trace: lock_is_held_type+0x69/0x150 freezer_fork+0x20b/0x370 cgroup_post_fork+0x2c9/0x5c0 copy_process+0x2675/0x3b40 _do_fork+0xbe/0xa30 ? _raw_spin_unlock_irqrestore+0x40/0x50 ? match_held_lock+0x56/0x250 ? kthread_park+0xf0/0xf0 kernel_thread+0xa6/0xd0 ? kthread_park+0xf0/0xf0 kthreadd+0x321/0x3d0 ? kthread_create_on_cpu+0x130/0x130 ret_from_fork+0x3a/0x50 irq event stamp: 64 hardirqs last enabled at (63): [] _raw_spin_unlock_irqrestore+0x40/0x50 hardirqs last disabled at (64): [] kcsan_setup_watchpoint+0x92/0x460 softirqs last enabled at (32): [] fpu__copy+0xe8/0x470 softirqs last disabled at (30): [] fpu__copy+0x69/0x470 Reported-by: Qian Cai Signed-off-by: Marco Elver Acked-by: Alexander Potapenko Tested-by: Qian Cai Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 05f9a4067964e3f864210271a6299f13d2eeea55 Author: Marco Elver Date: Fri Jan 10 19:48:34 2020 +0100 kcsan: Rate-limit reporting per data races KCSAN data-race reports can occur quite frequently, so much so as to render the system useless. This commit therefore adds support for time-based rate-limiting KCSAN reports, with the time interval specified by a new KCSAN_REPORT_ONCE_IN_MS Kconfig option. The default is 3000 milliseconds, also known as three seconds. Because KCSAN must detect data races in allocators and in other contexts where use of allocation is ill-advised, a fixed-size array is used to buffer reports during each reporting interval. To reduce the number of reports lost due to array overflow, this commit stores only one instance of duplicate reports, which has the benefit of further reducing KCSAN's console output rate. Reported-by: Qian Cai Suggested-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 47144eca282189afcf34ef25aee8408c168765d4 Author: Marco Elver Date: Fri Jan 10 19:48:33 2020 +0100 kcsan: Show full access type in report This commit adds access-type information to KCSAN's reports as follows: "read", "read (marked)", "write", and "write (marked)". Suggested-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar commit 5c361425744d1e3b03d835dde659708683ca27d1 Author: Marco Elver Date: Tue Jan 7 17:31:04 2020 +0100 kcsan: Prefer __always_inline for fast-path Prefer __always_inline for fast-path functions that are called outside of user_access_save, to avoid generating UACCESS warnings when optimizing for size (CC_OPTIMIZE_FOR_SIZE). It will also avoid future surprises with compiler versions that change the inlining heuristic even when optimizing for performance. Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar Link: http://lkml.kernel.org/r/58708908-84a0-0a81-a836-ad97e33dbb62@infradead.org commit df10846ff2ac3b0a7b295be2de2e9215877982f3 Merge: a4654e9bde4e 5ad0ec0b8652 Author: Ingo Molnar Date: Sat Mar 21 09:35:44 2020 +0100 Merge branch 'linus' into locking/kcsan, to pick up fixes Signed-off-by: Ingo Molnar commit a4654e9bde4ecedb4921e6c8fe2088114bdff1b3 Merge: 7add7875a8eb e4160b2e4b02 Author: Ingo Molnar Date: Sat Mar 21 09:23:40 2020 +0100 Merge branch 'x86/kdump' into locking/kcsan, to resolve conflicts Conflicts: arch/x86/purgatory/Makefile Signed-off-by: Ingo Molnar commit 4f55bb03801a9cd13b0535d78698e66ebf45b056 Author: Tomi Valkeinen Date: Fri Mar 13 14:24:10 2020 +0200 omapfb: Remove unused writeback code Remove unused writeback code. This code will never be used, as omapfb is being deprecated. Signed-off-by: Tomi Valkeinen Cc: Laurent Pinchart Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200313122410.7528-1-tomi.valkeinen@ti.com commit 6ce2fc42dbda51495eec179c18baaf80801d57b4 Author: Randy Dunlap Date: Sat Mar 14 21:10:02 2020 -0700 fbdev: via: fix -Wextra build warning and format warning When 'VIAFB_DEBUG' and 'VIAFB_WARN' are not defined, modify the DEBUG_MSG() &WARN_MSG() macros to use the no_printk() macro instead of using . This fixes a build warning when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/via/ioctl.c:88:47: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] Also use %lu to print an unsigned long instead of just %l, to fix a printk format warning: ../drivers/video/fbdev/via/viafbdev.c: In function ‘viafb_dvp0_proc_write’: ../drivers/video/fbdev/via/viafbdev.c:1148:14: warning: unknown conversion type character ‘]’ in format [-Wformat=] DEBUG_MSG("DVP0:reg_val[%l]=:%x\n", i, Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-7-rdunlap@infradead.org commit 1a56b9fa3275abceca96aa0a6061a3eda9859bb2 Author: Randy Dunlap Date: Sat Mar 14 21:10:01 2020 -0700 fbdev: pm[23]fb.c: fix -Wextra build warnings and errors When 'DEBUG' is not defined, modify the DPRINTK() macro to use the no_printk() macro instead of using . This fixes build warnings when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/pm2fb.c:227:38: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../drivers/video/fbdev/pm3fb.c:1039:33: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] Also drop one argument in two DPRINTK() macro uses to provide the correct number of arguments and use the correct field in one case to fix a build error: ../drivers/video/fbdev/pm3fb.c:353:9: error: ‘struct fb_info’ has no member named ‘current_par’ info->current_par->depth); Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-6-rdunlap@infradead.org commit 5194480ce6b27753de23416f58e6d1611b3f8efc Author: Randy Dunlap Date: Sat Mar 14 21:10:00 2020 -0700 fbdev: savage: fix -Wextra build warning When 'SAVAGEFB_DEBUG' is not defined, modify the DBG() macro to use the no_printk() macro instead of using . This fixes a build warning when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/savage/savagefb_driver.c:2411:13: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-5-rdunlap@infradead.org commit 6ea16a0ba37f3aaf71e0dbb270f60a5b08588b72 Author: Randy Dunlap Date: Sat Mar 14 21:09:59 2020 -0700 fbdev: matrox: fix -Wextra build warnings When 'DEBUG' is not defined, modify the dprintk() macro to use the no_printk() macro instead of using . This fixes build warnings when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/matrox/matroxfb_base.c:635:77: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../drivers/video/fbdev/matrox/matroxfb_Ti3026.c:632:54: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] ../drivers/video/fbdev/matrox/matroxfb_Ti3026.c:654:53: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-4-rdunlap@infradead.org commit c43da06107232a10f1b14bdf3aab82089937d63f Author: Randy Dunlap Date: Sat Mar 14 21:09:58 2020 -0700 fbdev: aty: fix -Wextra build warning When 'DEBUG' is not defined, modify the DPRINTK() macro to use the no_printk() macro instead of using . This fixes a build warning when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/aty/atyfb_base.c:784:61: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-3-rdunlap@infradead.org commit b5445b244114bf55efa325ea07f417bc5915bc74 Author: Randy Dunlap Date: Sat Mar 14 21:09:57 2020 -0700 fbdev: fbmon: fix -Wextra build warnings When 'DEBUG' is not defined, modify the DPRINTK() macro to use the no_printk() macro instead of using . This fixes a build warning when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/core/fbmon.c:812:47: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../drivers/video/fbdev/core/fbmon.c:842:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] ../drivers/video/fbdev/core/fbmon.c:847:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-2-rdunlap@infradead.org commit 06b522d6de9d7b429f368210c93d5414ead3586b Author: Takashi Iwai Date: Wed Mar 11 10:32:30 2020 +0100 video: uvesafb: Use scnprintf() for avoiding potential buffer overflow Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200311093230.24900-4-tiwai@suse.de commit 42f21e5452a24d205dcc029be4075b8be07f2ac0 Author: Takashi Iwai Date: Wed Mar 11 10:32:29 2020 +0100 video: omap2: Use scnprintf() for avoiding potential buffer overflow Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200311093230.24900-3-tiwai@suse.de commit bf1b615ad97e6ce915b0f510c031803da71b02b8 Author: Takashi Iwai Date: Wed Mar 11 10:32:28 2020 +0100 video: omapfb: Use scnprintf() for avoiding potential buffer overflow Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200311093230.24900-2-tiwai@suse.de commit b412c63f1cba70b0e21927ae840aa45e024be97f Author: Chris Wilson Date: Fri Mar 20 13:01:56 2020 +0000 drm/i915/gt: Report context-is-closed prior to pinning Our assertion caught that we do try to pin a closed context if userspace is viciously racing context-closure with execbuf, so make it fail gracefully. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1492 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200320130159.3922-1-chris@chris-wilson.co.uk commit cb1824bb1ec6b466c610bb2bc8a11fef892fd569 Author: Ville Syrjälä Date: Wed Mar 18 19:45:15 2020 +0200 drm/i915: Fix crtc nv12 etc. plane bitmasks for DPMS off We only consider crtc_state->enable when initially calculating plane visibility. Later on we try to override the plane's state to invisible if the crtc is in DPMS off state (crtc_state->active==false). Unfortunately the code doing that only updates the plane_state.visible flag and the crtc_state.active_planes bimask, but forgets to update some of the other plane bitmasks stored in the crtc_state. Namely crtc_state.nv12_planes is left set up based on the original visibility check which makes icl_check_nv12_planes() pick a slave plane for the flagged plane in the bitmask. Later on we hit the watermark code which sees a plane with a slave assigned and it then makes the logical assumption that the master plane must itself be visible. Since the master's plane_state.visible flag was already cleared we get a WARN. Fix the problem by clearing all the plane bitmasks for DPMS off. This is more or less the wrong approach and instead we should calculate all the plane related state purely based crtc_state->enable (to guarantee that the subsequent DPMS on can't fail). However in the past we definitely had some roadblocks to making that happen. Not sure how many are left these days, but let's stick to the current approach since it's a much simpler fix to the immediate problem (the WARN). v2: Keep the visible=false, it's important (Rodrigo) Cc: Rodrigo Vivi Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200318174515.31637-1-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 03c761b00c87d62eeb1994c2e96b049b89cd7a09 Author: Gwan-gyeong Mun Date: Tue Feb 11 09:46:43 2020 +0200 drm/i915/dp: Add writing of DP SDPs It adds routines that write DP VSC SDP and DP HDR Metadata Infoframe SDP. In order to pack DP VSC SDP, it adds intel_dp_vsc_sdp_pack() function. It follows DP 1.4a spec. [Table 2-116: VSC SDP Header Bytes] and [Table 2-117: VSC SDP Payload for DB16 through DB18] In order to pack DP HDR Metadata Infoframe SDP, it adds intel_dp_hdr_metadata_infoframe_sdp_pack() function. And it follows DP 1.4a spec. ([Table 2-125: INFOFRAME SDP v1.2 Header Bytes] and [Table 2-126: INFOFRAME SDP v1.2 Payload Data Bytes - DB0 through DB31]) and CTA-861-G spec. [Table-42 Dynamic Range and Mastering InfoFrame]. A mechanism and a naming rule of intel_dp_set_infoframes() function references intel_encoder->set_infoframes() of intel_hdmi.c . VSC SDP is used for PSR and Pixel Encoding and Colorimetry Formats cases. Because PSR routine has its own routine of writing a VSC SDP, when the PSR is enabled, intel_dp_set_infoframes() does not write a VSC SDP. v3: - Explicitly disable unused DIPs (AVI, GCP, VS, SPD, DRM. They will be used for HDMI), when intel_dp_set_infoframes() function will be called. - Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp. v4: Use struct drm_device logging macros v5: - use intel_de_*() functions for register access - Addressed review comments from Uma Polish commit message and comments Add 6bpc to packing of VSC SDP Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200211074657.231405-5-gwan-gyeong.mun@intel.com commit d1eed96dcb60b798418ab7554bcedf33fccc17ef Author: Gwan-gyeong Mun Date: Tue Feb 11 09:46:42 2020 +0200 drm/i915/dp: Add compute routine for DP HDR Metadata Infoframe SDP It stores computed dp hdr metadata infoframe sdp to infoframes.drm of crtc state. It referenced intel_hdmi_compute_drm_infoframe(). While computing, we'll also fill out the infoframes.enable bitmask appropriately. v2: Wrap a long line. v4: Use struct drm_device logging macros v5: Fix typo [Uma] Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200211074657.231405-4-gwan-gyeong.mun@intel.com commit 9799c4c3b76e540d97e302f9beb5971ef6a9b473 Author: Gwan-gyeong Mun Date: Tue Feb 11 09:46:41 2020 +0200 drm/i915/dp: Add compute routine for DP VSC SDP In order to support state readout for DP VSC SDP, we need to have a structure which holds DP VSC SDP payload data such as "union hdmi_infoframe drm" which is used for DRM infoframe. It adds a struct drm_dp_vsc_sdp vsc to intel_crtc_state.infoframes. And it stores computed dp vsc sdp to infoframes.vsc of crtc state. While computing we'll also fill out the inforames.enable bitmask appropriately. The compute routine follows DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through DB18]. v3: Replace a structure name to drm_dp_vsc_sdp from intel_dp_vsc_sdp v5: - Rebased - Add warning where a bpc is 6 and a pixel format is RGB. v7: Fix the wrong check of combination bpc 6 and RGB pixelformat Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200211074657.231405-3-gwan-gyeong.mun@intel.com commit e2e4c4e1dcaf4296b26a765086613b6bf4390f0d Author: Gwan-gyeong Mun Date: Tue Feb 11 09:46:40 2020 +0200 drm: Add DP1.4 VSC SDP Payload related Data Structures It adds new enumeration definitions for VSC SDP Payload for Pixel Encoding/Colorimetry Format. And it adds a new drm data structure for DP VSC SDP. enum dp_colorspace and enum dp_colorimetry correspond "Pixel Encoding and Colorimetry Formats". enum dp_dynamic_range corresponds "Dynamic Range". And enum dp_content_type corresponds "Content Type" All of them are based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through DB18]. v3: Add a new drm data structure for DP VSC SDP v5: Addressed review comments from Uma - Add kernel docs for added data structures - Rename enum dp_colorspace to dp_pixelformat - Polish commit message - Fix typos - Drop self-explanatory comments Signed-off-by: Gwan-gyeong Mun Reviewed-by: Uma Shankar Acked-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200211074657.231405-2-gwan-gyeong.mun@intel.com commit 8e37d699139128139c0468e005c2f0d6215b0c55 Author: Chris Wilson Date: Thu Mar 19 17:07:07 2020 +0000 drm/i915/gt: Cancel a hung context if already closed Use the restored ability to check if a context is closed to decide whether or not to immediately ban the context from further execution after a hang. Fixes: be90e344836a ("drm/i915/gt: Cancel banned contexts after GT reset") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200319170707.8262-2-chris@chris-wilson.co.uk commit 207e4a71fb53e761be72daaeb78a49225bc31c69 Author: Chris Wilson Date: Thu Mar 19 17:07:06 2020 +0000 drm/i915: Use explicit flag to mark unreachable intel_context I need to keep the GEM context around a bit longer so adding an explicit flag for syncing execbuf with closed/abandonded contexts. v2: * Use already available context flags. (Chris) Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20200319170707.8262-1-chris@chris-wilson.co.uk commit 2386b492ded48bb4731ab4321715986bb29a0454 Author: Chris Wilson Date: Thu Mar 19 09:19:38 2020 +0000 drm/i915: Prefer '%ps' for printing function symbol names %pS includes the offset, which is useful for return addresses but noise when we are pretty printing a known (and expected) function entry point. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200319091943.7815-1-chris@chris-wilson.co.uk commit 0666a8d7f6a4530440e59f2d22ed4091f4d3818c Author: Jiri Slaby Date: Thu Mar 19 11:04:21 2020 +0100 drm/virtio: fix OOB in virtio_gpu_object_create After commit f651c8b05542 ("drm/virtio: factor out the sg_table from virtio_gpu_object"), virtio_gpu_create_object allocates too small space to fit everything in. It is because it allocates struct virtio_gpu_object, but should allocate a newly added struct virtio_gpu_object_shmem which has 2 more members. So fix that by using correct type in virtio_gpu_create_object. Signed-off-by: Jiri Slaby Link: http://patchwork.freedesktop.org/patch/msgid/20200319100421.16267-1-jslaby@suse.cz Fixes: f651c8b05542 ("drm/virtio: factor out the sg_table from virtio_gpu_object") Cc: Gurchetan Singh Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann commit 394ad36c51ad63270352dfa2c3ee45fa1e5327d0 Author: Wambui Karuga Date: Sat Mar 14 21:33:44 2020 +0300 drm/i915/workarounds: convert to drm_device based logging macros. Replace the use of printk based drm logging macros with the struct drm_device based logging macros. Note that this converts DRM_DEBUG_DRIVER() to drm_dbg(). References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-8-wambui.karugax@gmail.com commit a8fa7c079f3ec0240112a622fe6e27a773a0e174 Author: Wambui Karuga Date: Sat Mar 14 21:33:43 2020 +0300 drm/i915/rps: use struct drm_device based logging macros. Replace the use of the printk based drm logging macros with the struct drm_device based logging macros in i915/gt/intel_rps.c. This also involves extracting the drm_i915_private device pointer from various intel types. This converts the instances of DRM_DEBUG_DRIVER to drm_dbg() while not converting DRM_DEBUG() instances due to the lack of an analogous drm_device based macro. References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-7-wambui.karugax@gmail.com commit 606856f09e843d268a67ccece345a0555b58ac8e Author: Wambui Karuga Date: Sat Mar 14 21:33:42 2020 +0300 drm/i915/ring_submission: use drm_device based logging macros. Replace the use of printk based drm logging macros to the struct drm_device based logging macros in i915/gt/intel_ring_submission.c. This was done using the following semantic patch that transforms based on the existence of a drm_i915_private device: @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } New checkpatch warnings were fixed manually. Note that this converts DRM_DEBUG_DRIVER to drm_dbg(). References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-6-wambui.karugax@gmail.com commit edf040f4ee619c9f47da1781eafc7f2dde36d57c Author: Wambui Karuga Date: Sat Mar 14 21:33:41 2020 +0300 drm/i915/renderstate: use struct drm_device based logging macros. Replace the use of the printk based drm logging macros with the struct drm_device based logging macros. Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-5-wambui.karugax@gmail.com commit 1ca6ce9332e7bf9dc8083235df20ea72bd893cad Author: Wambui Karuga Date: Sat Mar 14 21:33:40 2020 +0300 drm/i915/rc6: convert to struct drm_device based logging macros. Converts various instances of the printk based drm logging macros to use the struct drm_device logging macros. This also involves extracting the drm_i915_private device from intel types in some cases. Note that this converts DRM_DEBUG_DRIVER() to drm_dbg(). References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-4-wambui.karugax@gmail.com commit 91682e45ba62068ed19f829d5844dfd30b605808 Author: Wambui Karuga Date: Sat Mar 14 21:33:39 2020 +0300 drm/i915/lrc: convert to struct drm_device based logging macros. Convert various instances of the printk based drm logging macros to the struct drm_device based logging macros. Note that this converts DRM_DEBUG_DRIVER() to drm_dbg() but does not convert DRM_DEBUG() due to the lack of an analogous drm_device based macro. References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-3-wambui.karugax@gmail.com commit 36034c95d3c7985463db062134ec99b74e043289 Author: Wambui Karuga Date: Sat Mar 14 21:33:38 2020 +0300 drm/i915/ggtt: convert to drm_device based logging macros. Converts various instances of the printk based drm logging macros to use the struct drm_device based logging macros in i915/gt/intel_ggtt.c. This change was done using the following coccinelle script that matches based on the existence of a drm_i915_private device: @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } New checkpatch warnings were fixed manually. Note that this converts DRM_DEBUG_DRIVER to drm_dbg() References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200314183344.17603-2-wambui.karugax@gmail.com commit 3882581753d1cca0d32b5a8ad81791b79fb35d67 Author: Swathi Dhanavanthri Date: Wed Mar 18 15:12:40 2020 -0700 drm/i915/tgl: Add new PCI IDs to TGL Adding 4 new PCI IDs to TGL Bspec: 44455 Signed-off-by: Swathi Dhanavanthri Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20200318221240.8180-1-swathi.dhanavanthri@intel.com Reviewed-by: Matt Roper commit 639e0db2d70fb84833d96e782cc4a01825e03b13 Author: Mario Kleiner Date: Mon Mar 16 05:23:40 2020 +0100 drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (v3) This fixes a problem found on the MacBookPro 2017 Retina panel. The panel reports 10 bpc color depth in its EDID, and the firmware chooses link settings at boot which support enough bandwidth for 10 bpc (324000 kbit/sec = multiplier 0xc), but the DP_MAX_LINK_RATE dpcd register only reports 2.7 Gbps (multiplier value 0xa) as possible, in direct contradiction of what the firmware successfully set up. This restricts the panel to 8 bpc, not providing the full color depth of the panel. This patch adds a quirk specific to the MBP 2017 15" Retina panel to add the additiional 324000 kbps link rate during edp setup. Link to previous discussion of a different attempted fix with Ville and Jani: https://patchwork.kernel.org/patch/11325935/ v2: Follow Jani's proposal of defining quirk_rates[] instead of just appending 324000. This for better clarity. v3: Rebased onto current drm-tip, as of 16-March-2020. Adapt to new edid_quirks parameter of drm_dp_has_quirk(). Signed-off-by: Mario Kleiner Tested-by: Mario Kleiner Cc: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20200316042340.4783-1-mario.kleiner.de@gmail.com commit b684822a44469fe44b80aef5cdca52cd979a4ecb Author: Ville Syrjälä Date: Wed Mar 18 20:25:18 2020 +0200 drm: Skip drm_mode_config_validate() for !modeset drm_mode_config_init() may not have been called when the driver/device doesn't support modeset. That will cause drm_mode_config_validate() to oops. Skip the validation for !modeset. TODO: We may want to consider calling drm_mode_config_init() unconditionally to avoid similar issues elsewhere... Fixes: 74d2aacbe840 ("drm: Validate encoder->possible_clones") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200318182518.31618-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit 260fcfc0e9b0208abef20719cfe7d08b2357a623 Author: Wambui Karuga Date: Tue Mar 10 10:52:45 2020 +0200 drm/i915/hdcp: convert to struct drm_device based logging. Converts various instances of the printk based drm logging macros to the struct drm_device based logging macros in i915/display/intel_hdcp.c. This also involves extracting the drm_i915_private device from the intel_connector type for use in the macros. v2 by Jani: - rebase Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Reviewed-by: Wambui Karuga Link: https://patchwork.freedesktop.org/patch/msgid/47d5e88dedc08ee48938344296ada550dedd5f90.1583766715.git.jani.nikula@intel.com commit ac467612f40377c48311664303d56039c54ab8ec Author: Wambui Karuga Date: Tue Mar 10 10:52:42 2020 +0200 drm/i915/fbdev: convert to drm_device based logging. Convert various instances of printk based drm logging macros to the struct drm_device based logging macros in i915/display/intel_fbdev.c. This also involves extracting the drm_i915_private device from various intel types. v2 by Jani: - fix the final one too Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Reviewed-by: Wambui Karuga Link: https://patchwork.freedesktop.org/patch/msgid/7081a49d20cc46b1b1144c83a4e21294d121d8a7.1583766715.git.jani.nikula@intel.com commit 97ed48b5c8b14874d57f163f3e755eeb3f02a414 Author: Wambui Karuga Date: Tue Mar 10 10:52:41 2020 +0200 drm/i915/fbc: convert to drm_device based logging macros. This replaces the uses of the printk based drm logging macros with the struct drm_device based logging macros in i915/display/intel_fbc.c. This transformation was done using the following coccinelle semantic patch that matches based on the existence of a drm_i915_private device pointer: @@ identifier fn, T; @@ fn(...,struct drm_i915_private *T,...) { <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_ATOMIC( +drm_dbg_atomic(&T->drm, ...) ) ...+> } New checkpatch warnings were addressed manually. v2 by Jani: - also convert pr_info_once to drm based logging Signed-off-by: Wambui Karuga Signed-off-by: Jani Nikula Reviewed-by: Wambui Karuga Link: https://patchwork.freedesktop.org/patch/msgid/32a92f1d4e4d01131605b17bec831517e39c5902.1583766715.git.jani.nikula@intel.com commit 8edb699707393a87e012de0804f7acc636d76c6e Author: Daniel Vetter Date: Tue Mar 17 21:56:43 2020 +0100 MAINTAINERS: Better regex for dma_buf|fence|resv We're getting some random other stuff that we're not really interested in, so match only word boundaries. Also avoid the capture group while at it. Suggested by Joe Perches. Acked-by: Sumit Semwal Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Cc: Joe Perches Cc: Sumit Semwal Cc: Sam Ravnborg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200317205643.1028398-1-daniel.vetter@ffwll.ch commit 7ce84471e3c72e23020b046714358b45a7ffe9ab Author: Wambui Karuga Date: Tue Mar 10 16:31:21 2020 +0300 drm: convert .debugfs_init() hook to return void. As a result of commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail) and changes to various debugfs functions in drm/core and across various drivers, there is no need for the drm_driver.debugfs_init() hook to have a return value. Therefore, declare it as void. This also includes refactoring all users of the .debugfs_init() hook to return void across the subsystem. v2: include changes to the hook and drivers that use it in one patch to prevent driver breakage and enable individual successful compilation of this change. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-18-wambui.karugax@gmail.com commit 0df10823743311f31a067c26e2a3c6fa6dc867e9 Author: Ville Syrjälä Date: Tue Feb 11 18:22:07 2020 +0200 drm: Validate encoder->possible_crtcs WARN if the encoder possible_crtcs is effectively empty or contains bits for non-existing crtcs. v2: Move to drm_mode_config_validate() (Daniel) Make the docs say we WARN when this is wrong (Daniel) Extract full_crtc_mask() Cc: Thomas Zimmermann Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-7-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 74d2aacbe84042d89f572a3112a146fca05bfcb1 Author: Ville Syrjälä Date: Tue Feb 11 18:22:06 2020 +0200 drm: Validate encoder->possible_clones Many drivers are populating encoder->possible_clones wrong. Let's persuade them to get it right by adding some loud WARNs. We'll cross check the bits between any two encoders. So either both encoders can clone with the other, or neither can. We'll also complain about effectively empty possible_clones, and possible_clones containing bits for encoders that don't exist. v2: encoder->possible_clones now includes the encoder itelf v3: Move to drm_mode_config_validate() (Daniel) Document that you get a WARN when this is wrong (Daniel) Extract full_encoder_mask() v4: !! instead of ! (Daniel) Acked-by: Thomas Zimmermann Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-6-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 9cb6a97621ae35fd84e93b6c8e4defcdc53161f2 Author: Ville Syrjälä Date: Tue Feb 11 18:22:05 2020 +0200 drm/imx: Remove the bogus possible_clones setup It's not at all clear what cloning options this driver supports. So let's just clear possible_clones instead of setting it to some bogus value. v2: Adjust the FIXME (Daniel) Cc: Philipp Zabel Acked-by: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-5-ville.syrjala@linux.intel.com commit 8a7827ee32ac8fcea38c1cbdb5e948ea1c111294 Author: Ville Syrjälä Date: Tue Feb 11 18:22:03 2020 +0200 drm/gma500: Sanitize possible_clones I doubt the DP+DP and SDVO+SDVO cloning works for this driver. i915 at least doesn't do those. Truthfully there could be some very specific circumstances where some of them would do doable, but genereally it's too much pain to deal with so we've chose not to bother. Let's use the same approach for gma500. Also the LVDS+LVDS and DSI+DSI cases probably don't really exist as there is one of each at most. This does mean we'll now leave possible_clones at 0 for these encoder types whereas previosuly we included the encoder itself in the bitmask. But that's fine as the core now treaks 0 as a special case and adds the encoder itself into the final bitmask reported to userspace. Cc: Patrik Jakobsson Acked-by: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-3-ville.syrjala@linux.intel.com commit 714277951deb9f5b22ec3789b61bb45f55c643b8 Author: Ville Syrjälä Date: Tue Feb 11 18:22:02 2020 +0200 drm: Include the encoder itself in possible_clones The docs say possible_clones should always include the encoder itself. Since most drivers don't want to deal with the complexities of cloning let's allow them to set possible_clones=0 and instead we'll fix that up in the core. We can't put this special case into drm_encoder_init() because drivers will have to fill up possible_clones after adding all the relevant encoders. Otherwise they wouldn't know the proper encoder indexes to use. So we'll just do it just before registering the device. v2: Don't set the bit if possible_clones!=0 so that the validation (coming soon) will WARN (Thomas) Fix up the docs to allow possible_clones==0 (Daniel) .late_register() is too late, introduce drm_mode_config_validate() which gets called _before_ we register the char device (Daniel) Acked-by: Thomas Zimmermann Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-2-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit a212d6a55765e6f61bdf674db2ade99862ed06da Author: Wambui Karuga Date: Tue Mar 10 16:31:20 2020 +0300 drm/debugfs: remove checks for return value of drm_debugfs functions. Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), there is no need to check the return value of drm_debugfs_create_files(). Therefore, remove remove unnecessary checks and error handling statement blocks for its return value. These changes also enable changing drm_debugfs_create_files() to return void. Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-17-wambui.karugax@gmail.com commit 092c367ac6c621cf882061f46e21a5ab2c814a5d Author: Ville Syrjälä Date: Fri Mar 13 18:20:54 2020 +0200 drm/edid: Fix DispID tile parsing for override EDID Currently the DispID tile block gets parsed in drm_get_edid(), which is an odd place for it considering we parse nothing else there. Also this doesn't work for override EDIDs since drm_connector_update_edid_property() refuses to do its job twice in such cases. Thus we never update the tile property with results of the DispID tile block parsing during drm_get_edid(). To fix this let's just move the tile block parsing to happen during drm_connector_update_edid_property(), which is where we parse a bunch of other stuff as well (and where we update both the EDID and tile properties). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-10-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit bd1f64df3135ea50827a36dfa3b15d81249e1a37 Author: Ville Syrjälä Date: Fri Mar 13 18:20:53 2020 +0200 drm/edid: Clarify validate_displayid() Throw out the magic '5' from validate_displayid() and replace with the actual thing we mean sizeof(header)+checksum. Also rewrite the checksum loop to be less hard to parse for mere mortals. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-9-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 5f706b4a3bd68e5982879bb60f7bb27698e759b3 Author: Ville Syrjälä Date: Fri Mar 13 18:20:52 2020 +0200 drm/edid: Don't include ext block csum in DispID size The EDID extension block checksum byte is not part of the actual DispID data, so don't use it in validate_displayid(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-8-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 8e88c75245a3f84e3503bff2fa39a9178e8efb5f Author: Ville Syrjälä Date: Fri Mar 13 18:20:51 2020 +0200 drm/edid: Don't parse garbage as DispID blocks Currently the code assumes that the entire EDID extesion block can be taken up by the DispID blocks. That is not true. There is at least always the DispID checksum, and potentially fill bytes if the extension block uses the interior fill scheme to pad out to fill EDID block size. So let's not parse the checksum or the fill bytes as DispID blocks by having drm_find_displayid_extension() return the actual length of the DispID data to the caller. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-7-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit ea0aa608a8e89f112761d6f91733f27513d2b657 Author: Ville Syrjälä Date: Fri Mar 13 18:20:50 2020 +0200 drm/edid: Move validate_displayid() drm_find_displayid_extension() Instead of everyone having to call validate_displayid() let's just have drm_find_displayid_extension() do it for them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-6-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 23b03867a2201099f598a6d7800f7837620dfa94 Author: Ville Syrjälä Date: Fri Mar 13 18:20:49 2020 +0200 drm/edid: Return DispID length from drm_find_displayid_extension() As with the byte offset (idx) drm_find_displayid_extension() is the only one who actually knows how much data the resulting DispID block can contain. So return the length from therein instead of assuming it's the EDID block length all over. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-5-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 3688118404add838a4c0e136f9609413dd61f8af Author: Ville Syrjälä Date: Fri Mar 13 18:20:48 2020 +0200 drm/edid: Remove idx==1 assumptions from all over the DispID parsing The fact that the DispID starts at byte offset 1 is due to the DispID coming from and EDID extension block (the first byte being the extesion block tag). Instead of hadrdocoding that idx==1 assumptions all over let's just have drm_find_displayid_extension() return it since it actually knows what it's talking about. If at some point someone comes across a DispID which is not embedded inside an EDID the function that returns the new type of DispID can return it's own byte offset without having to updated all the code. TODO: should probably just get rid of that idx thing altogether and just return the thing we want directly. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-4-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit bf5e4a863ae0785239ba61a8cbb4d81e35e4732f Author: Ville Syrjälä Date: Fri Mar 13 18:20:47 2020 +0200 drm/edid: Swap some operands in for_each_displayid_db() A+B on the previous line, B+A on the next line. Brain hurts. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-3-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 267ea759b231e26611f87c8d23d2f3e5ea5a6e71 Author: Ville Syrjälä Date: Fri Mar 13 18:20:46 2020 +0200 drm: Constify topology id Make the topology id const since we don't want to change it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-2-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit e196e140f95cbe1cbd654f8529346fcdfe496cb7 Author: Wambui Karuga Date: Tue Mar 10 16:31:19 2020 +0300 drm: make various debugfs_init() functions return 0 Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove its use as the return value of various debugfs_init() functions in drm, and have these functions return 0 directly. v2: convert debugfs_init() functions to return 0 instead of void to avoid build breakage. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-16-wambui.karugax@gmail.com commit f06b2052f74d7b42ff8cbfe1ac0b78be7668c37d Author: Wambui Karuga Date: Tue Mar 10 16:31:18 2020 +0300 drm/i915: have *_debugfs_init() functions return void. Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove its use as the return value of debugfs_init() functions and have the functions return void. v2: convert intel_display_debugfs_register() stub to return void too. Signed-off-by: Wambui Karuga Reviewed-by: Jani Nikula Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-15-wambui.karugax@gmail.com commit 68f73a1bef8717870ef5d7e7d6631c7fb937aac5 Author: Wambui Karuga Date: Tue Mar 10 16:31:17 2020 +0300 drm/omap: remove checks for return value of drm_debugfs functions Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), there is no need to ever check the return value for drm_debugfs_create_files(). Therefore remove the checks for the return value and subsequent error handling in omap_debugfs_init(). These changes also enables the changing of omap_debugfs_init() to return 0 directly. v2: convert omap_debugfs_init() to return 0 instead of void to avoid introduction of build issues and enable individual driver compilation. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-14-wambui.karugax@gmail.com commit b4441251e5d0465f72bd42feb0ab4ed5ca367a94 Author: Wambui Karuga Date: Tue Mar 10 16:31:16 2020 +0300 drm/pl111: make pl111_debugfs_init return 0 Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail) drm_debugfs_create_files() should return void. Therefore, remove its use as the return value in pl111_debugfs_init(), and have the function return 0 directly. v2: have pl111_debugfs_init() return 0 instead of void to avoid build breakage for individual compilation. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-13-wambui.karugax@gmail.com commit 0567776b698bb2eec92ab55e603c5af07d0a51d0 Author: Wambui Karuga Date: Tue Mar 10 16:31:15 2020 +0300 drm/nouveau: make nouveau_drm_debugfs_init() return 0 Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), there is no need to ever check for the the return value of debugfs_create_file() and drm_debugfs_create_files(). Therefore, remove unnecessary checks and error handling in nouveau_drm_debugfs_init() and have the function return 0 directly. v2: have nouveau_drm_debugfs_init() return 0 instead of void so as not to introduce any build warnings to enable individual patch compilation. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-12-wambui.karugax@gmail.com commit 3a748157f209a79748ee8dd7da82e5db913ffa52 Author: Wambui Karuga Date: Tue Mar 10 16:31:14 2020 +0300 drm/vram-helper: make drm_vram_mm_debugfs_init() return 0 Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove its use as the return value of drm_vram_mm_debugfs_init(), and have the function return 0 directly. v2: have drm_vram_mm_debugfs_init() return 0 instead of void to avoid introducing build issues and build breakage. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Acked-by: Thomas Zimmermann Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-11-wambui.karugax@gmail.com commit 54ac836b16de05c9ca2e4a910a0848c0fa1d4a0c Author: Wambui Karuga Date: Tue Mar 10 16:31:13 2020 +0300 drm/sti: remove use of drm_debugfs functions as return values Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails, and should return void. This change therefore removes it uses as a return value in various functions across drm/sti. With these changes, the affected functions have been changed to use a void return value. v2: convert sti_mixer_debugfs_init() and sti_compositor_debugfs_init() to return void too. Also have sti_drm_dbg_init() to return 0 to avoid build issues. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-10-wambui.karugax@gmail.com commit 9e2fd463ec346d1c1703b336bf9762780ccaa8c7 Author: Wambui Karuga Date: Tue Mar 10 16:31:12 2020 +0300 drm/msm: remove checks for return value of drm_debugfs_create_files() Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files never fails and only returns 0. Therefore, the unnecessary checks for its return value and error handling in various debugfs_init() functions in drm/msm and have the functions return 0 directly. v2: have debug functions return 0 instead of void to avoid build breakage and ensure standalone compilation. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-9-wambui.karugax@gmail.com commit 14b461950c6f3440d5e3e32ba742d86dc0345d84 Author: Wambui Karuga Date: Tue Mar 10 16:31:11 2020 +0300 drm/etnaviv: remove check for return value of drm_debugfs_create_files() Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and only returns 0. Therefore, remove the unnecessary check of its return value and error handling in etnaviv_debugfs_init() and have the function return 0 directly. v2: have etnaviv_debugfs_init() return 0 instead of void to ensure individual compilation and avoid build breakage. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Acked-by: Lucas Stach Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-8-wambui.karugax@gmail.com commit 0bc40e18603a99ae5d18c29d6f5d1ff603961925 Author: Wambui Karuga Date: Tue Mar 10 16:31:10 2020 +0300 drm/arm: make hdlcd_debugfs_init() return 0 Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove its use as the return value of hdlcd_debugfs_init() and have the latter function return 0 directly. v2: make hdlcd_debugfs_init() return 0 instead of void to ensure that each patch compiles individually. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Acked-by: Liviu Dudau Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-7-wambui.karugax@gmail.com commit 2fb9c8a02fd34e3a3efa5782f85ea59259ee36fd Author: Wambui Karuga Date: Tue Mar 10 16:31:09 2020 +0300 drm/arc: make arcgpu_debugfs_init() return 0. Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove its use as the return value of arcpgu_debugfs_init() and have the latter function return 0 directly. v2: convert the function to return 0 instead of void to avoid breaking the build and ensure that this individual patch compiles properly. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Acked-by: Alexey Brodkin Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-6-wambui.karugax@gmail.com commit b9c82f593f26567845060df66486c56906cc6371 Author: Wambui Karuga Date: Tue Mar 10 16:31:08 2020 +0300 drm/vc4: remove check of return value of drm_debugfs functions Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove unnecessary check and error handling for the return value of drm_debugfs_create_files() in vc4_debugfs_init(). v2: remove conversion of vc4_debugfs_init() to void to enable individual compilation and avoid build issues and breakage. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-5-wambui.karugax@gmail.com commit 19660e8903e6813846ae176e2df570689da3843b Author: Wambui Karuga Date: Tue Mar 10 16:31:07 2020 +0300 drm/v3d: make v3d_debugfs_init() return 0 Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails and should return void. Therefore, remove its use as the return value of v3d_debugfs_init() and have the function return 0 directly instead. v2: remove conversion of v3d_debugfs_init() to void to avoid build breakage and enable individual compilation. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-4-wambui.karugax@gmail.com commit f1c1a1f38db45573bd3ab70bb910f0a4b291ec46 Author: Wambui Karuga Date: Tue Mar 10 16:31:06 2020 +0300 drm/tilcdc: remove check for return value of debugfs functions. Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail), drm_debugfs_create_files() never fails. Therefore, remove the check and error handling of the return value of drm_debugfs_create_files() as it is not needed in tilcdc_debugfs_init(). Also remove local variables that are not used after the changes. v2: remove conversion of tilcdc_debugfs_init() to void to avoid build breakage and enable individual compilation. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Acked-by: Jyri Sarha Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-3-wambui.karugax@gmail.com commit ad6d94f24f2024178bf71d126e93813dddde5ee4 Author: Wambui Karuga Date: Tue Mar 10 16:31:05 2020 +0300 drm/tegra: remove checks for debugfs functions return value Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail) there is no need to check the return value of drm_debugfs_create_files(). Therefore, remove the return checks and error handling of the drm_debugfs_create_files() function from various debugfs init functions in drm/tegra and have them return 0 directly. v2: remove conversion of tegra_debugfs_init() to void to avoid build breakage. References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html Signed-off-by: Wambui Karuga Acked-by: Thierry Reding Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-2-wambui.karugax@gmail.com commit bf7f15c585d5b9b843e662aa78f9fc71037db968 Author: Will Deacon Date: Wed Mar 18 08:28:31 2020 +0000 arm64: elf: Fix allnoconfig kernel build with !ARCH_USE_GNU_PROPERTY Commit ab7876a98a21 ("arm64: elf: Enable BTI at exec based on ELF program properties") introduced the conditional selection of ARCH_USE_GNU_PROPERTY if BINFMT_ELF is enabled. With allnoconfig, this option is no longer selected and the arm64 arch_parse_elf_property() function clashes with the generic dummy implementation. Link: http://lkml.kernel.org/r/20200318082830.GA31312@willie-the-truck Fixes: ab7876a98a21 ("arm64: elf: Enable BTI at exec based on ELF program properties") Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas commit 82c0ef94b92ed29211a1d2d35f34624d7e1cad59 Author: Igor Matheus Andrade Torrente Date: Tue Mar 17 18:03:39 2020 -0300 drm: Correct a typo in a function comment Replace "pionter" with "pointer" in the drm_gem_handle_create description. Changes in v2: - Change subject text Signed-off-by: Igor Matheus Andrade Torrente Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200317210339.2669-1-igormtorrente@gmail.com commit 84551afa312a19c3c26d30695552579840cc61e6 Author: Joe Perches Date: Thu Mar 12 12:17:12 2020 -0700 drm: drm_vm: Use fallthrough; Convert /* fallthrough */ style comments to fallthrough; Convert the various uses of fallthrough comments to fallthrough; Done via script Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/ And by hand: This file has a fallthrough comment outside of an #ifdef block that causes gcc to emit a warning if converted in-place. So move the new fallthrough; inside the containing #ifdef/#endif too. Signed-off-by: Joe Perches Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/398db73cdc8a584fd7f34f5013c04df13ba90f64.1584040050.git.joe@perches.com commit 6e66dbfaaf268a52c8b7ffc7d863604029db0c60 Author: Daniel Vetter Date: Wed Mar 18 08:31:22 2020 +0100 drm/hisilicon: Drop unused #include drm_encoder_slave is really not something anyone should be using, the last real user is only nouveau. Reviewed-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Boris Brezillon Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Tomi Valkeinen Cc: Allison Randal Cc: Thomas Gleixner Cc: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20200318073122.1032945-1-daniel.vetter@ffwll.ch commit b4ab7aa848acaf7467d3544bbb980290cbad4465 Author: Swati Sharma Date: Tue Mar 17 19:27:36 2020 +0530 drm/i915/color: Extract icl_read_luts() For icl+, have hw read out to create hw blob of gamma lut values. icl+ platforms supports multi segmented gamma mode by default, add hw lut creation for this mode. This will be used to validate gamma programming using dsb (display state buffer) which is a tgl specific feature. v2: -readout code for multisegmented gamma has to come up with some intermediate entries that aren't preserved in hardware (Jani N) -linear interpolation (Ville) -moved common code to check gamma_enable to specific funcs, since icl doesn't support that v3: -use u16 instead of __u16 [Jani N] -used single lut [Jani N] -improved and more readable for loops [Jani N] -read values directly to actual locations and then fill gaps [Jani N] -moved cleaning to patch 1 [Jani N] -renamed icl_read_lut_multi_seg() to icl_read_lut_multi_segment to make it similar to icl_load_luts() -renamed icl_compute_interpolated_gamma_blob() to icl_compute_interpolated_gamma_lut_values() more sensible, I guess v4: -removed interpolated func for creating gamma lut values -removed readouts of fine and coarse segments, failure to read PAL_PREC_DATA correctly v5: -added gamma_enable check inside read_luts() v6: -renamed intel_color_lut_entry_equal() to intel_color_lut_entries_equal() [Ville] -changed if-else to switch [Ville] -removed intel_color_lut_entry_multi_equal() [Ville] v7: -checkpatch warnings v8: -rebased v9: -rebased, aligned with Ville's style of gamma cleanup Signed-off-by: Swati Sharma Reviewed-by: Mika Kahola Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200317135736.14305-1-swati2.sharma@intel.com commit 0a7ada196675717b1c9290aa325f054f300f696b Author: Anshuman Gupta Date: Wed Mar 18 15:14:48 2020 +0530 drm/i915: Enable non-contiguous pipe fusing As we have already enabled supported infrastructure for non-contiguous pipe fusing in driver, we don't require non-contiguous pipe_mask check anymore. It is an unlike condition, it make sense to remove this condition. changes since RFC: - using intel_pipe_mask_is_valid() function to check integrity of pipe_mask. [Ville] v2: - simplify condition in intel_pipe_mask_is_valid(). [Ville] v3: - removed non-contiguous pipe fusing check. [Lucas] Cc: Ville Syrjälä Cc: Lucas De Marchi Reviewed-by: Lucas De Marchi Signed-off-by: Anshuman Gupta Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20200318094448.26239-1-anshuman.gupta@intel.com commit 55f7f72753abdd46f35d027a25b43969dba56fac Author: Andrzej Pietrasiewicz Date: Wed Mar 11 15:55:37 2020 +0100 drm/core: Add drm_afbc_framebuffer and a corresponding helper The new struct contains afbc-specific data. The new function can be used by drivers which support afbc to complete the preparation of struct drm_afbc_framebuffer. It must be called after allocating the said struct and calling drm_gem_fb_init_with_funcs(). Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Emil Velikov Reviewed-by: James Qian Wang Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200311145541.29186-3-andrzej.p@collabora.com commit f2b816d78a94319b7230430c3d1f99d9f1cb5bd0 Author: Andrzej Pietrasiewicz Date: Wed Mar 11 15:55:36 2020 +0100 drm/core: Allow drivers allocate a subclass of struct drm_framebuffer Allow allocating a specialized version of struct drm_framebuffer by moving the actual fb allocation out of drm_gem_fb_create_with_funcs(); the respective functions names are adjusted to reflect that fact. Please note, though, that standard size checks are performed on buffers, so the drm_gem_fb_init_with_funcs() is useful for cases where those standard size checks are appropriate or at least don't conflict the checks to be performed in the specialized case. Thanks to this change the drivers can call drm_gem_fb_init_with_funcs() having allocated their special version of struct drm_framebuffer, exactly the way the new version of drm_gem_fb_create_with_funcs() does. Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Emil Velikov Reviewed-by: James Qian Wang Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200311145541.29186-2-andrzej.p@collabora.com commit a639b0c15065df930467695b76ef38d5edaed049 Author: Umesh Nerlige Ramappa Date: Mon Mar 9 14:10:57 2020 -0700 drm/i915/perf: Invalidate OA TLB on when closing perf stream On running several back to back perf capture sessions involving closing and opening the perf stream, invalid OA reports are seen in the beginning of the OA buffer in some sessions. Fix this by invalidating OA TLB when the perf stream is closed or disabled on gen12. Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Lionel Landwerlin Fixes: 00a7f0d7155c ("drm/i915/tgl: Add perf support on TGL") Signed-off-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20200309211057.38575-1-umesh.nerlige.ramappa@intel.com commit 500f9ac3025107a84e0c00d960a6c852efde83cc Author: Chris Wilson Date: Tue Mar 17 16:32:08 2020 +0000 drm/i915/gt: Always reschedule the new heartbeat In order to better respond to new heartbeat intervals given via sysfs, always reprogramme an active heartbeat upon change (i.e. use mod_delayed_work to reschedule rather than queue_delayed_work which ignores an already active work.) Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200317163208.30010-1-chris@chris-wilson.co.uk commit ba69fb165b034cd3615ae8607e8e075dd47dc5e8 Author: Chris Wilson Date: Tue Mar 17 14:12:50 2020 +0000 drm/i915: Fix up documentation paths after file moving Redirect references to i915_gem_fence_reg.c to gt/intel_ggtt_fencing.c Fixes: dec9cf9ee8cb ("drm/i915/gt: Pull restoration of GGTT fences underneath the GT") Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200317141250.20903-1-chris@chris-wilson.co.uk commit e4160b2e4b02377c67f8ecd05786811598f39acd Author: Hans de Goede Date: Tue Mar 17 14:08:41 2020 +0100 x86/purgatory: Fail the build if purgatory.ro has missing symbols Linking purgatory.ro with -r enables "incremental linking"; this means no checks for unresolved symbols are done while linking purgatory.ro. A change to the sha256 code has caused the purgatory in 5.4-rc1 to have a missing symbol on memzero_explicit(), yet things still happily build. Add an extra check for unresolved symbols by calling ld without -r before running bin2c to generate kexec-purgatory.c. This causes a build of 5.4-rc1 with this patch added to fail as it should: CHK arch/x86/purgatory/purgatory.ro ld: arch/x86/purgatory/purgatory.ro: in function `sha256_transform': sha256.c:(.text+0x1c0c): undefined reference to `memzero_explicit' make[2]: *** [arch/x86/purgatory/Makefile:72: arch/x86/purgatory/kexec-purgatory.c] Error 1 make[1]: *** [scripts/Makefile.build:509: arch/x86/purgatory] Error 2 make: *** [Makefile:1650: arch/x86] Error 2 Also remove --no-undefined from LDFLAGS_purgatory.ro as that has no effect. Signed-off-by: Hans de Goede Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200317130841.290418-2-hdegoede@redhat.com commit e2ac07c06058ae2d58b45bbf2a2a352771d76fcb Author: Hans de Goede Date: Tue Mar 17 14:08:40 2020 +0100 x86/purgatory: Disable various profiling and sanitizing options Since the purgatory is a special stand-alone binary, various profiling and sanitizing options must be disabled. Having these options enabled typically will cause dependencies on various special symbols exported by special libs / stubs used by these frameworks. Since the purgatory is special, it is not linked against these stubs causing missing symbols in the purgatory if these options are not disabled. Sync the set of disabled profiling and sanitizing options with that from drivers/firmware/efi/libstub/Makefile, adding -DDISABLE_BRANCH_PROFILING to the CFLAGS and setting: GCOV_PROFILE := n UBSAN_SANITIZE := n This fixes broken references to ftrace_likely_update() when CONFIG_TRACE_BRANCH_PROFILING is enabled and to __gcov_init() and __gcov_exit() when CONFIG_GCOV_KERNEL is enabled. Signed-off-by: Hans de Goede Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200317130841.290418-1-hdegoede@redhat.com commit 11ecbdddf2f8b6cc2480aff6d877b7a4076e3b7f Author: Lionel Landwerlin Date: Tue Mar 17 15:22:22 2020 +0200 drm/i915/perf: introduce global sseu pinning On Gen11 powergating half the execution units is a functional requirement when using the VME samplers. Not fullfilling this requirement can lead to hangs. This unfortunately plays fairly poorly with the NOA requirements. NOA requires a stable power configuration to maintain its configuration. As a result using OA (and NOA feeding into it) so far has required us to use a power configuration that can work for all contexts. The only power configuration fullfilling this is powergating half the execution units. This makes performance analysis for 3D workloads somewhat pointless. Failing to find a solution that would work for everybody, this change introduces a new i915-perf stream open parameter that punts the decision off to userspace. If this parameter is omitted, the existing Gen11 behavior remains (half EU array powergating). This change takes the initiative to move all perf related sseu configuration into i915_perf.c v2: Make parameter priviliged if different from default v3: Fix context modifying its sseu config while i915-perf is enabled v4: Always consider global sseu a privileged operation (Tvrtko) Override req_sseu point in intel_sseu_make_rpcs() (Tvrtko) Remove unrelated changes (Tvrtko) v5: Some typos (Tvrtko) Process sseu param in read_properties_unlocked() (Tvrtko) v6: Actually commit the bits from v5... Fixup some checkpath warnings v7: Only compare engine uabi field (Chris) Signed-off-by: Lionel Landwerlin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200317132222.2638719-3-lionel.g.landwerlin@intel.com commit 371aba6e26fbc41009ef100559e07d7e884d382a Author: Lionel Landwerlin Date: Tue Mar 17 15:22:21 2020 +0200 drm/i915/perf: remove redundant power configuration register override The caller of i915_oa_init_reg_state() already sets this. Signed-off-by: Lionel Landwerlin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200317132222.2638719-2-lionel.g.landwerlin@intel.com commit 9aba9c188da136f22938f9d19b71affe84381b05 Author: Lionel Landwerlin Date: Tue Mar 17 15:22:20 2020 +0200 drm/i915/perf: remove generated code A little bit of history : Back when i915-perf was introduced (4.13), there was no way to dynamically add new OA configurations to i915. Only the generated configs baked in at build time were allowed. It quickly became obvious that we would need to allow applications to upload their own configurations, for instance to be able to test new ones, and so by the next stable version (4.14) we added uAPIs to allow uploading new configurations. When adding that capability, we took the opportunity to remove most HW configurations except the TestOa one which is a configuration IGT would rely on to verify that the HW is outputting correct values. At the time it made sense to have that confiuration in at the same time a given HW platform added to the i915-perf driver. Now that IGT has become the reference point for HW configurations (see commit 53f8f541ca ("lib: Add i915_perf library"), previously this was located in the GPUTop repository), the need for having those configurations in i915-perf is gone. On the Mesa side, we haven't relied on this test configuration for a while. The MDAPI library always required 4.14 feature level and always loaded its configuration into i915. I'm sure nobody will miss this generated stuff in i915 :) v2: Fix selftests by creating an empty config v3: Fix unlocking on allocation error (Dan Carpenter) v4: Fixup checkpatch warnings v5: Fix incorrect unlock in error path (Umesh) Signed-off-by: Lionel Landwerlin Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20200317132222.2638719-1-lionel.g.landwerlin@intel.com commit a22f34783476a39d157b60485285aaa43554cb2d Author: Chris Wilson Date: Mon Mar 16 16:14:47 2020 +0000 drm/i915/gem: Check for a closed context when looking up an engine Beware that the context may already be closed as we try to lookup an engine. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1389 Fixes: 130a95e9098e ("drm/i915/gem: Consolidate ctx->engines[] release") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200316161447.18410-1-chris@chris-wilson.co.uk commit 51b8479ab20ba3804348824c63abdb3f35b0aaeb Merge: 6afe6929964b 69ddce0970d9 Author: Maxime Ripard Date: Tue Mar 17 09:29:11 2020 +0100 Merge drm/drm-next into drm-misc-next Jernej needs some patches that got merged in -rc5. Signed-off-by: Maxime Ripard commit 220a6704ff4373cf1573b663d90d632ea0740210 Author: Chris Wilson Date: Mon Mar 16 20:54:50 2020 +0000 drm/i915/gt: Restore check for invalid vma for fencing Apparently we do try and attach a fence to an invalid vma (during execbuf) so we cannot simply assert it never happens and report EINVAL instead. Fixes: dec9cf9ee8cb ("drm/i915/gt: Pull restoration of GGTT fences underneath the GT") Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200316205450.15843-1-chris@chris-wilson.co.uk commit 0b6bc81dbd6dd2f6132c623e9c3df33fe3397e94 Author: Chris Wilson Date: Mon Mar 16 11:38:46 2020 +0000 drm/i915/gt: Allocate i915_fence_reg array Since the number of fence regs can vary dramactically between platforms, allocate the array on demand so we don't waste as much space. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200316113846.4974-4-chris@chris-wilson.co.uk commit bd9a4dbc84f509b00424f39642013c9efd0beeea Author: Chris Wilson Date: Mon Mar 16 11:38:45 2020 +0000 drm/i915: Remove manual save/resume of fence register state Since we always reload the fence register state on runtime resume, having it explicitly in the S0ix resume code is redundant. Indeed, it is not even being used! Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200316113846.4974-3-chris@chris-wilson.co.uk commit dec9cf9ee8cb203d556bec3f650c480ba2a04735 Author: Chris Wilson Date: Mon Mar 16 11:38:44 2020 +0000 drm/i915/gt: Pull restoration of GGTT fences underneath the GT Make the GT responsible for restoring its fence when it wakes up from suspend. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200316113846.4974-2-chris@chris-wilson.co.uk commit f899f786d181e03f6ca29319bd90ba62231cb44b Author: Chris Wilson Date: Mon Mar 16 11:38:43 2020 +0000 drm/i915: Move GGTT fence registers under gt/ Since the fence registers control HW detiling through the GGTT aperture, make them a part of the intel_ggtt under gt/ Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200316113846.4974-1-chris@chris-wilson.co.uk commit 383499f8863ea8ce869ba62cec91d9f709c9459b Author: Dave Martin Date: Mon Mar 16 16:50:55 2020 +0000 arm64: BTI: Add Kconfig entry for userspace BTI Now that the code for userspace BTI support is in the kernel add the Kconfig entry so that it can be built and used. [Split out of "arm64: Basic Branch Target Identification support" -- broonie] Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit 424037b77519d1537872442ba144dda1464988d7 Author: Daniel Kiss Date: Mon Mar 16 16:50:54 2020 +0000 mm: smaps: Report arm64 guarded pages in smaps The arm64 Branch Target Identification support is activated by marking executable pages as guarded pages. Report pages mapped this way in smaps to aid diagnostics. Signed-off-by: Mark Brown Signed-off-by: Daniel Kiss Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit de48bb369242fe17022fab3a2addc9c6dacad43f Author: Mark Brown Date: Mon Mar 16 16:50:53 2020 +0000 arm64: mm: Display guarded pages in ptdump v8.5-BTI introduces the GP field in stage 1 translation tables which indicates that blocks and pages with it set are guarded pages for which branch target identification checks should be performed. Decode this when dumping the page tables to aid debugging. Signed-off-by: Mark Brown Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit 30685d789c48f27f97f6ecde6185b606a6c7abf6 Author: Dave Martin Date: Mon Mar 16 16:50:52 2020 +0000 KVM: arm64: BTI: Reset BTYPE when skipping emulated instructions Since normal execution of any non-branch instruction resets the PSTATE BTYPE field to 0, so do the same thing when emulating a trapped instruction. Branches don't trap directly, so we should never need to assign a non-zero value to BTYPE here. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Acked-by: Marc Zyngier Signed-off-by: Catalin Marinas commit 0537c4cd71e3c729c278c82f5b088460fb66fc33 Author: Dave Martin Date: Mon Mar 16 16:50:51 2020 +0000 arm64: BTI: Reset BTYPE when skipping emulated instructions Since normal execution of any non-branch instruction resets the PSTATE BTYPE field to 0, so do the same thing when emulating a trapped instruction. Branches don't trap directly, so we should never need to assign a non-zero value to BTYPE here. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Signed-off-by: Catalin Marinas commit d2c2ee4cc33bea814eb6739f14d8cb6a4b5265bb Author: Dave Martin Date: Mon Mar 16 16:50:50 2020 +0000 arm64: traps: Shuffle code to eliminate forward declarations Hoist the IT state handling code earlier in traps.c, to avoid accumulating forward declarations. No functional change. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit 172a797661d95873c4af528c497cb5e1dfa8b91f Author: Dave Martin Date: Mon Mar 16 16:50:49 2020 +0000 arm64: unify native/compat instruction skipping Skipping of an instruction on AArch32 works a bit differently from AArch64, mainly due to the different CPSR/PSTATE semantics. Currently arm64_skip_faulting_instruction() is only suitable for AArch64, and arm64_compat_skip_faulting_instruction() handles the IT state machine but is local to traps.c. Since manual instruction skipping implies a trap, it's a relatively slow path. So, make arm64_skip_faulting_instruction() handle both compat and native, and get rid of the arm64_compat_skip_faulting_instruction() special case. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Kees Cook Reviewed-by: Mark Rutland Signed-off-by: Catalin Marinas commit ec94a46ee7ac999b0f10f7772c40aed3f604831b Author: Dave Martin Date: Mon Mar 16 16:50:48 2020 +0000 arm64: BTI: Decode BYTPE bits when printing PSTATE The current code to print PSTATE symbolically when generating backtraces etc., does not include the BYTPE field used by Branch Target Identification. So, decode BYTPE and print it too. In the interests of human-readability, print the classes of BTI matched. The symbolic notation, BYTPE (PSTATE[11:10]) and permitted classes of subsequent instruction are: -- (BTYPE=0b00): any insn jc (BTYPE=0b01): BTI jc, BTI j, BTI c, PACIxSP -c (BYTPE=0b10): BTI jc, BTI c, PACIxSP j- (BTYPE=0b11): BTI jc, BTI j Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit ab7876a98a2160092133de4c648e94b18bc3f139 Author: Dave Martin Date: Mon Mar 16 16:50:47 2020 +0000 arm64: elf: Enable BTI at exec based on ELF program properties For BTI protection to be as comprehensive as possible, it is desirable to have BTI enabled from process startup. If this is not done, the process must use mprotect() to enable BTI for each of its executable mappings, but this is painful to do in the libc startup code. It's simpler and more sound to have the kernel do it instead. To this end, detect BTI support in the executable (or ELF interpreter, as appropriate), via the NT_GNU_PROGRAM_PROPERTY_TYPE_0 note, and tweak the initial prot flags for the process' executable pages to include PROT_BTI as appropriate. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit fe0f67660ee9c99408be5261ae045f8b41953b05 Author: Dave Martin Date: Mon Mar 16 16:50:46 2020 +0000 elf: Allow arch to tweak initial mmap prot flags An arch may want to tweak the mmap prot flags for an ELFexecutable's initial mappings. For example, arm64 is going to need to add PROT_BTI for executable pages in an ELF process whose executable is marked as using Branch Target Identification (an ARMv8.5-A control flow integrity feature). So that this can be done in a generic way, add a hook arch_elf_adjust_prot() to modify the prot flags as desired: arches can select CONFIG_HAVE_ELF_PROT and implement their own backend where necessary. By default, leave the prot flags unchanged. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Catalin Marinas Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit 8ef8f360cf30be12382f89ff48a57fbbd9b31c14 Author: Dave Martin Date: Mon Mar 16 16:50:45 2020 +0000 arm64: Basic Branch Target Identification support This patch adds the bare minimum required to expose the ARMv8.5 Branch Target Identification feature to userspace. By itself, this does _not_ automatically enable BTI for any initial executable pages mapped by execve(). This will come later, but for now it should be possible to enable BTI manually on those pages by using mprotect() from within the target process. Other arches already using the generic mman.h are already using 0x10 for arch-specific prot flags, so we use that for PROT_BTI here. For consistency, signal handler entry points in BTI guarded pages are required to be annotated as such, just like any other function. This blocks a relatively minor attack vector, but comforming userspace will have the annotations anyway, so we may as well enforce them. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Catalin Marinas Signed-off-by: Catalin Marinas commit 00e19ceec80b03a43f626f891fcc53e57919f1b3 Author: Dave Martin Date: Mon Mar 16 16:50:44 2020 +0000 ELF: Add ELF program property parsing support ELF program properties will be needed for detecting whether to enable optional architecture or ABI features for a new ELF process. For now, there are no generic properties that we care about, so do nothing unless CONFIG_ARCH_USE_GNU_PROPERTY=y. Otherwise, the presence of properties using the PT_PROGRAM_PROPERTY phdrs entry (if any), and notify each property to the arch code. For now, the added code is not used. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit db751e309ff05461a0c8e114b1238d7a69cc1f18 Author: Dave Martin Date: Mon Mar 16 16:50:43 2020 +0000 ELF: UAPI and Kconfig additions for ELF program properties Pull the basic ELF definitions relating to the NT_GNU_PROPERTY_TYPE_0 note from Yu-Cheng Yu's earlier x86 shstk series. Signed-off-by: Mark Brown Signed-off-by: Dave Martin Signed-off-by: Yu-cheng Yu Reviewed-by: Catalin Marinas Reviewed-by: Kees Cook Signed-off-by: Catalin Marinas commit a62774782b994026ac3198bf115717d55d536166 Author: Chris Wilson Date: Wed Mar 11 10:36:40 2020 +0000 drm/i915/gt: Restrict gen7 w/a batch to Haswell The residual w/a batch is causing system instablity on Ivybridge and Baytrail under some workloads, so disable until resolved. Closes: https://gitlab.freedesktop.org/drm/intel/issues/1405 Fixes: 47f8253d2b89 ("drm/i915/gen7: Clear all EU/L3 residual contexts") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Prathap Kumar Valsan Cc: Akeem G Abodunrin Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Acked-by: Mika Kuoppala Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20200311103640.26572-1-chris@chris-wilson.co.uk commit 74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91 Author: Peng Fan Date: Fri Mar 13 09:58:07 2020 +0800 regmap: debugfs: check count when read regmap file When executing the following command, we met kernel dump. dmesg -c > /dev/null; cd /sys; for i in `ls /sys/kernel/debug/regmap/* -d`; do echo "Checking regmap in $i"; cat $i/registers; done && grep -ri "0x02d0" *; It is because the count value is too big, and kmalloc fails. So add an upper bound check to allow max size `PAGE_SIZE << (MAX_ORDER - 1)`. Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com Signed-off-by: Mark Brown commit 7aba5dcc234635b44b2781dbc268048cfba388ad Author: Gustavo A. R. Silva Date: Mon Mar 9 13:23:08 2020 -0500 jfs: Replace zero-length array with flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Dave Kleikamp commit 7856488bd83b0182548a84d05c07326321ae6138 Author: Jyri Sarha Date: Sat Mar 7 09:47:24 2020 -0800 ARM: dts: keystone-k2g-evm: add HDMI video support Add DT nodes for HDMI video support for K2G EVM. The HDMI uses SiI9022 DPI as HDMI encoder. The DSS DPI is connected to SiI9022 HDMI encoder's video input and encoder's output goes to HDMI connector. Signed-off-by: Jyri Sarha Signed-off-by: Santosh Shilimkar commit 3a361eabbff081dbd63ac5159d1fe85ca3c4a56e Author: Jyri Sarha Date: Sat Mar 7 09:47:23 2020 -0800 ARM: dts: keystone-k2g: Add DSS node Add DT node for DSS. K2G has DSS version 6. Keystone family DSS are somewhat different compered to the old OMAP family DSSes and the binding looks different too. Signed-off-by: Jyri Sarha Signed-off-by: Tomi Valkeinen Signed-off-by: Jyri Sarha Signed-off-by: Santosh Shilimkar commit e8cc2b97ca5aa12152c302b2f5d41d125e55ab1f Author: Andy Shevchenko Date: Fri Feb 21 10:57:23 2020 +0200 lib/vsprintf: update comment about simple_strto() functions The commit 885e68e8b7b1 ("kernel.h: update comment about simple_strto() functions") updated a comment regard to simple_strto() functions, but missed similar change in the vsprintf.c module. Update comments in vsprintf.c as well for simple_strto() functions. Link: https://lore.kernel.org/r/20200221085723.42469-1-andriy.shevchenko@linux.intel.com Reported-by: Uwe Kleine-König Signed-off-by: Andy Shevchenko Signed-off-by: Petr Mladek commit 88affa2f891bcbe39fc773e61bf6c90b78756bdc Author: Kalyani Akula Date: Mon Feb 17 15:56:44 2020 +0530 arm64: zynqmp: Add Xilinx AES node This patch adds a AES DT node for Xilinx ZynqMP SoC. Signed-off-by: Kalyani Akula Acked-by: Michal Simek Signed-off-by: Michal Simek commit 8efbc518b884e1db2dd6a6fce62d0112ab871dcf Author: Dave Young Date: Wed Feb 12 19:04:24 2020 +0800 x86/kexec: Do not reserve EFI setup_data in the kexec e820 table The e820 table for the kexec kernel unconditionally marks setup_data as reserved because the second kernel can reuse setup_data passed by the 1st kernel's boot loader, for example SETUP_PCI marked regions like PCI BIOS, etc. SETUP_EFI types, however, are used by kexec itself to enable EFI in the 2nd kernel. Thus, it is pointless to add this type of setup_data to the kexec e820 table as reserved. IOW, what happens is this: - 1st physical boot: no SETUP_EFI. - kexec loads a new kernel and prepares a SETUP_EFI setup_data blob, then reboots the machine. - 2nd kernel sees SETUP_EFI, reserves it both in the e820 and in the kexec e820 table. - If another kexec load is executed, it prepares a new SETUP_EFI blob and then reboots the machine into the new kernel. 5. The 3rd kexec-ed kernel has two SETUP_EFI ranges reserved. And so on... Thus skip SETUP_EFI while reserving setup_data in the e820_table_kexec table because it is not needed. [ bp: Heavily massage commit message, shorten line and improve comment. ] Signed-off-by: Dave Young Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200212110424.GA2938@dhcp-128-65.nay.redhat.com commit 33225d7b0ac9903c5701bbede7dfdaeba74ad6c3 Author: Benjamin Herrenschmidt Date: Thu Feb 13 10:51:33 2020 +0100 printk: Correctly set CON_CONSDEV even when preferred console was not registered CON_CONSDEV flag was historically used to put/keep the preferred console first in console_drivers list. Where the preferred console is the last on the command line. The ordering is important only when opening /dev/console: + tty_kopen() + tty_lookup_driver() + console_device() The flag was originally an implementation detail. But it was later made accessible from userspace via /proc/consoles. It was used, for example, by the tool "showconsole" to show the real tty accessible via /dev/console, see https://github.com/bitstreamout/showconsole Now, the current code sets CON_CONSDEV only for the preferred console or when a fallback console is added. The flag is not set when the preferred console is defined on the command line but it is not registered from some reasons. Simple solution is to set CON_CONSDEV flag for the first registered console. It will work most of the time because: + Most real consoles have console->device defined. + Boot consoles are removed in printk_late_init(). + unregister_console() moves CON_CONSDEV flag to the next console. Clean solution would require checking con->device when the preferred console is registered and in unregister_console(). Conclusion: Use the simple solution for now. It is better than the current state and good enough. The clean solution is not worth it. It would complicate the already complicated code without too much gain. Instead the code would deserve a complete rewrite. Link: https://lore.kernel.org/r/20200213095133.23176-4-pmladek@suse.com Signed-off-by: Benjamin Herrenschmidt [pmladek@suse.com: Correct reasoning in the commit message, comment update.] Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit e369d8227fd211be36242fc44a9dc2209e246b9a Author: Benjamin Herrenschmidt Date: Thu Feb 13 10:51:32 2020 +0100 printk: Fix preferred console selection with multiple matches In the following circumstances, the rule of selecting the console corresponding to the last "console=" entry on the command line as the preferred console (CON_CONSDEV, ie, /dev/console) fails. This is a specific example, but it could happen with different consoles that have a similar name aliasing mechanism. - The kernel command line has both console=tty0 and console=ttyS0 in that order (the latter with speed etc... arguments). This is common with some cloud setups such as Amazon Linux. - add_preferred_console is called early to register "uart0". In our case that happens from acpi_parse_spcr() on arm64 since the "enable_console" argument is true on that architecture. This causes "uart0" to become entry 0 of the console_cmdline array. Now, because of the above, what happens is: - add_preferred_console is called by the cmdline parsing for tty0 and ttyS0 respectively, thus occupying entries 1 and 2 of the console_cmdline array (since this happens after ACPI SPCR parsing). At that point preferred_console is set to 2 as expected. - When the tty layer kicks in, it will call register_console for tty0. This will match entry 1 in console_cmdline array. It isn't our preferred console but because it's our only console at this point, it will end up "first" in the consoles list. - When 8250 probes the actual serial port later on, it calls register_console for ttyS0. At that point the loop in register_console tries to match it with the entries in the console_cmdline array. Ideally this should match ttyS0 in entry 2, which is preferred, causing it to be inserted first and to replace tty0 as CONSDEV. However, 8250 provides a "match" hook in its struct console, and that hook will match "uart" as an alias to "ttyS". So we match uart0 at entry 0 in the array which is not the preferred console and will not match entry 2 which is since we break out of the loop on the first match. As a result, we don't set CONSDEV and don't insert it first, but second in the console list. As a result, we end up with tty0 remaining first in the array, and thus /dev/console going there instead of the last user specified one which is ttyS0. This tentative fix register_console() to scan first for consoles specified on the command line, and only if none is found, to then scan for consoles specified by the architecture. Link: https://lore.kernel.org/r/20200213095133.23176-3-pmladek@suse.com Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit ad8cd1db80cc33337bdbee63c453ef6d5132474b Author: Benjamin Herrenschmidt Date: Thu Feb 13 10:51:31 2020 +0100 printk: Move console matching logic into a separate function This moves the loop that tries to match a newly registered console with the command line or add_preferred_console list into a separate helper, in order to be able to call it multiple times in subsequent patches. Link: https://lore.kernel.org/r/20200213095133.23176-2-pmladek@suse.com Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek commit 5661dd95a2958634485bb1a53f90a6ab621d4b0c Author: Nathan Chancellor Date: Thu Jan 30 15:16:44 2020 -0700 printk: Convert a use of sprintf to snprintf in console_unlock When CONFIG_PRINTK is disabled (e.g. when building allnoconfig), clang warns: ../kernel/printk/printk.c:2416:10: warning: 'sprintf' will always overflow; destination buffer has size 0, but format string expands to at least 33 [-Wfortify-source] len = sprintf(text, ^ 1 warning generated. It is not wrong; text has a zero size when CONFIG_PRINTK is disabled because LOG_LINE_MAX and PREFIX_MAX are both zero. Change to snprintf so that this case is explicitly handled without any risk of overflow. Link: https://github.com/ClangBuiltLinux/linux/issues/846 Link: https://github.com/llvm/llvm-project/commit/6d485ff455ea2b37fef9e06e426dae6c1241b231 Link: http://lkml.kernel.org/r/20200130221644.2273-1-natechancellor@gmail.com Cc: Steven Rostedt Cc: linux-kernel@vger.kernel.org Cc: clang-built-linux@googlegroups.com Signed-off-by: Nathan Chancellor Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 7add7875a8eb4ffe5eddaf8a11e409c9e1b6e3f3 Merge: 837171fe77d7 e33f9a169747 Author: Ingo Molnar Date: Fri Jan 24 09:33:52 2020 +0100 Merge branch 'kcsan.2020.01.07a' into locking/kcsan Pull KCSAN updates from Paul E. McKenney: - UBSAN fixes - inlining updates - documentation updates Signed-off-by: Ingo Molnar commit 01df52d726b5d55d2970f5c957f1961930acd5d6 Author: John Johansen Date: Thu Aug 29 11:35:50 2019 -0700 apparmor: remove duplicate check of xattrs on profile attachment. The second check to ensure the xattrs are present and checked is unneeded as this is already done in the profile attachment xmatch. Signed-off-by: John Johansen commit 0df34a645bae00c86f383fb063cd3840862837bf Author: John Johansen Date: Tue Jul 30 02:42:13 2019 -0700 apparmor: add outofband transition and use it in xattr match There are cases where the a special out of band transition that can not be triggered by input is useful in separating match conditions in the dfa encoding. The null_transition is currently used as an out of band transition for match conditions that can not contain a \0 in their input but apparmor needs an out of band transition for cases where the match condition is allowed to contain any input character. Achieve this by allowing for an explicit transition out of input range that can only be triggered by code. Signed-off-by: John Johansen commit f05841a940df995b784b5e3ec6f76141e8337245 Author: John Johansen Date: Thu Dec 19 15:55:39 2019 -0800 apparmor: fail unpack if profile mode is unknown Profile unpack should fail if the profile mode is not a mode that the kernel understands. Signed-off-by: John Johansen commit 3ed4aaa94fc07db3cd0c91be95e3e1b9782a2710 Author: John Johansen Date: Wed Sep 25 08:02:48 2019 -0700 apparmor: fix nnp subset test for unconfined The subset test is not taking into account the unconfined exception which will cause profile transitions in the stacked confinement case to fail when no_new_privs is applied. This fixes a regression introduced in the fix for https://bugs.launchpad.net/bugs/1839037 BugLink: https://bugs.launchpad.net/bugs/1844186 Signed-off-by: John Johansen commit a68d59ff4d67ec182926aaa82daaa66b3d465c9a Author: John Johansen Date: Tue Sep 24 09:46:33 2019 -0700 apparmor: remove useless aafs_create_symlink commit 1180b4c757aa ("apparmor: fix dangling symlinks to policy rawdata after replacement") reworked how the rawdata symlink is handled but failedto remove aafs_create_symlink which was reduced to a useles stub. Fixes: 1180b4c757aa ("apparmor: fix dangling symlinks to policy rawdata after replacement") Reported-by: Al Viro Signed-off-by: John Johansen commit 837171fe77d700222bb75ef5fe26f4785fcd9e99 Merge: c29a59e43829 def9d2780727 Author: Ingo Molnar Date: Mon Jan 20 08:42:47 2020 +0100 Merge tag 'v5.5-rc7' into locking/kcsan, to refresh the tree Signed-off-by: Ingo Molnar commit 6413f852ce086c0f95817012c08d481ce24d8b1a Author: John Johansen Date: Mon Feb 4 05:23:14 2019 -0800 apparmor: add proc subdir to attrs This patch provides a /proc//attr/apparmor/ subdirectory. Enabling userspace to use the apparmor attributes without having to worry about collisions with selinux or smack on interface files in /proc//attr. Signed-off-by: John Johansen commit dae6029325a4744e639eb048c13f53c24320aeda Author: John Johansen Date: Sat Aug 31 15:55:45 2019 -0700 apparmor: add consistency check between state and dfa diff encode flags Check that a states diff encode flag is only set if diff encode is enabled in the dfa header. Signed-off-by: John Johansen commit c659696964a7530ddd9ae075919b44f263fba05c Author: John Johansen Date: Sat Aug 31 15:55:06 2019 -0700 apparmor: add a valid state flags check Add a check to ensure only known state flags are set on each state in the dfa. Signed-off-by: John Johansen commit e4f4e6ba5eaadb839d17cfe5235cff149a44b36a Author: Vasyl Gomonovych Date: Fri Jul 26 15:32:10 2019 +0200 AppArmor: Remove semicolon Remove unneeded semicolon Signed-off-by: Vasyl Gomonovych Signed-off-by: John Johansen commit 278de07ef84a4356a3b166dc17751abc03abca67 Author: Markus Elfring Date: Tue Jul 2 20:27:32 2019 +0200 apparmor: Replace two seq_printf() calls by seq_puts() in aa_label_seq_xprint() Two strings which did not contain a data format specification should be put into a sequence. Thus use the corresponding function “seq_puts”. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: John Johansen commit c29a59e43829beabc4c26036ebcc6a32dd0b6a01 Author: Jann Horn Date: Mon Jan 6 21:02:04 2020 +0100 x86/vdso: Enable sanitizers for vma.o The vDSO makefile opts out of all sanitizers (and objtool validation); however, vma.o is a normal kernel object file (and already has objtool validation selectively enabled), so turn the sanitizers back on for that file. Signed-off-by: Jann Horn Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Marco Elver Cc: Paul E. McKenney Link: https://lkml.kernel.org/r/20200106200204.94782-1-jannh@google.com Signed-off-by: Ingo Molnar commit e33f9a169747880a008dd5e7b934fc592e91cd63 Author: Marco Elver Date: Thu Dec 12 01:07:09 2019 +0100 kcsan: Add __no_kcsan function attribute Since the use of -fsanitize=thread is an implementation detail of KCSAN, the name __no_sanitize_thread could be misleading if used widely. Instead, we introduce the __no_kcsan attribute which is shorter and more accurate in the context of KCSAN. This matches the attribute name __no_kcsan_or_inline. The use of __kcsan_or_inline itself is still required for __always_inline functions to retain compatibility with older compilers. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 7161177481d521e725a7bc6c9308ac2968fee038 Author: Marco Elver Date: Thu Dec 12 01:07:08 2019 +0100 kcsan: Document static blacklisting options Updates the section on "Selective analysis", listing all available options to blacklist reporting data races for: specific accesses, functions, compilation units, and entire directories. These options should provide adequate control for maintainers to opt out of KCSAN analysis at varying levels of granularity. It is hoped to provide the required control to reflect preferences for handling data races across the kernel. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 944bc9cca7c392879fa2c3f911bbef7422707679 Author: Marco Elver Date: Tue Nov 26 15:04:05 2019 +0100 asm-generic/atomic: Use __always_inline for fallback wrappers Use __always_inline for atomic fallback wrappers. When building for size (CC_OPTIMIZE_FOR_SIZE), some compilers appear to be less inclined to inline even relatively small static inline functions that are assumed to be inlinable such as atomic ops. This can cause problems, for example in UACCESS regions. While the fallback wrappers aren't pure wrappers, they are trivial nonetheless, and the function they wrap should determine the final inlining policy. For x86 tinyconfig we observe: - vmlinux baseline: 1315988 - vmlinux with patch: 1315928 (-60 bytes) Suggested-by: Mark Rutland Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit c020395b6634b7a674ee6aa91a971b08e268caba Author: Marco Elver Date: Tue Nov 26 15:04:04 2019 +0100 asm-generic/atomic: Use __always_inline for pure wrappers Prefer __always_inline for atomic wrappers. When building for size (CC_OPTIMIZE_FOR_SIZE), some compilers appear to be less inclined to inline even relatively small static inline functions that are assumed to be inlinable such as atomic ops. This can cause problems, for example in UACCESS regions. By using __always_inline, we let the real implementation and not the wrapper determine the final inlining preference. For x86 tinyconfig we observe: - vmlinux baseline: 1316204 - vmlinux with patch: 1315988 (-216 bytes) This came up when addressing UACCESS warnings with CC_OPTIMIZE_FOR_SIZE in the KCSAN runtime: http://lkml.kernel.org/r/58708908-84a0-0a81-a836-ad97e33dbb62@infradead.org Reported-by: Randy Dunlap Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit d47715f50e833f12c5e829ce9dcc4a65104fa74f Author: Marco Elver Date: Tue Nov 19 19:57:42 2019 +0100 kcsan, ubsan: Make KCSAN+UBSAN work together Context: http://lkml.kernel.org/r/fb7e25d8-aba4-3dcf-7761-cb7ecb3ebb71@infradead.org Reported-by: Randy Dunlap Signed-off-by: Marco Elver Acked-by: Randy Dunlap # build-tested Signed-off-by: Paul E. McKenney commit 31c7ac388aa905a196ee16dff2015111f701f035 Merge: 28336be568bb c79f46a28239 Author: Ingo Molnar Date: Mon Jan 6 07:51:15 2020 +0100 Merge tag 'v5.5-rc5' into locking/kcsan, to resolve conflict Signed-off-by: Ingo Molnar commit 28336be568bb473d16ba80db0801276fb4f1bbe5 Merge: 5cbaefe9743b fd6988496e79 Author: Ingo Molnar Date: Mon Dec 30 08:10:51 2019 +0100 Merge tag 'v5.5-rc4' into locking/kcsan, to resolve conflicts Conflicts: init/main.c lib/Kconfig.debug Signed-off-by: Ingo Molnar commit 5cbaefe9743bf14c9d3106db0cc19f8cb0a3ca22 Author: Ingo Molnar Date: Wed Nov 20 10:41:43 2019 +0100 kcsan: Improve various small stylistic details Tidy up a few bits: - Fix typos and grammar, improve wording. - Remove spurious newlines that are col80 warning artifacts where the resulting line-break is worse than the disease it's curing. - Use core kernel coding style to improve readability and reduce spurious code pattern variations. - Use better vertical alignment for structure definitions and initialization sequences. - Misc other small details. No change in functionality intended. Cc: linux-kernel@vger.kernel.org Cc: Marco Elver Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Andrew Morton Cc: Thomas Gleixner Cc: Paul E. McKenney Cc: Will Deacon Signed-off-by: Ingo Molnar commit 8e1d58ae0c8d4af9ab0141f7e8a9ca95720df01c Merge: af42d3466bdc 40d04110f879 Author: Ingo Molnar Date: Tue Nov 19 19:54:39 2019 +0100 Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/kcsan Pull the KCSAN subsystem from Paul E. McKenney: "This pull request contains base kernel concurrency sanitizer (KCSAN) enablement for x86, courtesy of Marco Elver. KCSAN is a sampling watchpoint-based data-race detector, and is documented in Documentation/dev-tools/kcsan.rst. KCSAN was announced in September, and much feedback has since been incorporated: http://lkml.kernel.org/r/CANpmjNPJ_bHjfLZCAPV23AXFfiPiyXXqqu72n6TgWzb2Gnu1eA@mail.gmail.com The data races located thus far have resulted in a number of fixes: https://github.com/google/ktsan/wiki/KCSAN#upstream-fixes-of-data-races-found-by-kcsan Additional information may be found here: https://lore.kernel.org/lkml/20191114180303.66955-1-elver@google.com/ " Signed-off-by: Ingo Molnar commit 40d04110f87940b6a03bf0aa19cd29e84f465f20 Author: Marco Elver Date: Thu Nov 14 19:03:03 2019 +0100 x86, kcsan: Enable KCSAN for x86 This patch enables KCSAN for x86, with updates to build rules to not use KCSAN for several incompatible compilation units. Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit e75a6795ed132f26f69d08dea958630d5993056d Author: Marco Elver Date: Thu Nov 14 19:03:02 2019 +0100 locking/atomics, kcsan: Add KCSAN instrumentation This adds KCSAN instrumentation to atomic-instrumented.h. Signed-off-by: Marco Elver Reviewed-by: Mark Rutland Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit bf07132f96d426bcbf2098227fb680915cf44498 Author: Marco Elver Date: Thu Nov 14 19:03:00 2019 +0100 seqlock: Require WRITE_ONCE surrounding raw_seqcount_barrier This patch proposes to require marked atomic accesses surrounding raw_write_seqcount_barrier. We reason that otherwise there is no way to guarantee propagation nor atomicity of writes before/after the barrier [1]. For example, consider the compiler tears stores either before or after the barrier; in this case, readers may observe a partial value, and because readers are unaware that writes are going on (writes are not in a seq-writer critical section), will complete the seq-reader critical section while having observed some partial state. [1] https://lwn.net/Articles/793253/ This came up when designing and implementing KCSAN, because KCSAN would flag these accesses as data-races. After careful analysis, our reasoning as above led us to conclude that the best thing to do is to propose an amendment to the raw_seqcount_barrier usage. Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit 88ecd153be9519f259b87a9f6f4c8383a8b3bbf1 Author: Marco Elver Date: Thu Nov 14 19:02:59 2019 +0100 seqlock, kcsan: Add annotations for KCSAN Since seqlocks in the Linux kernel do not require the use of marked atomic accesses in critical sections, we teach KCSAN to assume such accesses are atomic. KCSAN currently also pretends that writes to `sequence` are atomic, although currently plain writes are used (their corresponding reads are READ_ONCE). Further, to avoid false positives in the absence of clear ending of a seqlock reader critical section (only when using the raw interface), KCSAN assumes a fixed number of accesses after start of a seqlock critical section are atomic. === Commentary on design around absence of clear begin/end markings === Seqlock usage via seqlock_t follows a predictable usage pattern, where clear critical section begin/end is enforced. With subtle special cases for readers needing to be flat atomic regions, e.g. because usage such as in: - fs/namespace.c:__legitimize_mnt - unbalanced read_seqretry - fs/dcache.c:d_walk - unbalanced need_seqretry But, anything directly accessing seqcount_t seems to be unpredictable. Filtering for usage of read_seqcount_retry not following 'do { .. } while (read_seqcount_retry(..));': $ git grep 'read_seqcount_retry' | grep -Ev 'while \(|seqlock.h|Doc|\* ' => about 1/3 of the total read_seqcount_retry usage. Just looking at fs/namei.c, we conclude that it is non-trivial to prescribe and migrate to an interface that would force clear begin/end seqlock markings for critical sections. As such, we concluded that the best design currently, is to simply ensure that KCSAN works well with the existing code. Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit 0ebba7141eadc4804ec5b4bb5106331b0c3abf4c Author: Marco Elver Date: Thu Nov 14 19:02:58 2019 +0100 build, kcsan: Add KCSAN build exceptions This blacklists several compilation units from KCSAN. See the respective inline comments for the reasoning. Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit 5f5c971292b43fed68273d5cba7202f6bd953df9 Author: Marco Elver Date: Thu Nov 14 19:02:57 2019 +0100 objtool, kcsan: Add KCSAN runtime functions to whitelist This patch adds KCSAN runtime functions to the objtool whitelist. Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit 905e672b3af5d2305f8ed58d68e13843217eaa99 Author: Marco Elver Date: Thu Nov 14 19:02:56 2019 +0100 kcsan: Add Documentation entry in dev-tools Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney commit c48981eeb0d56e107691df590007d6699441a689 Author: Marco Elver Date: Thu Nov 14 19:02:55 2019 +0100 include/linux/compiler.h: Introduce data_race(expr) macro This introduces the data_race(expr) macro, which can be used to annotate expressions for purposes of (1) documenting, and (2) giving tooling such as KCSAN information about which data races are deemed "safe". More context: http://lkml.kernel.org/r/CAHk-=wg5CkOEF8DTez1Qu0XTEFw_oHhxN98bDnFqbY7HL5AB2g@mail.gmail.com Signed-off-by: Marco Elver Cc: Alan Stern Cc: Eric Dumazet Cc: Linus Torvalds Cc: Paul E. McKenney Signed-off-by: Paul E. McKenney commit dfd402a4c4baae42398ce9180ff424d589b8bffc Author: Marco Elver Date: Thu Nov 14 19:02:54 2019 +0100 kcsan: Add Kernel Concurrency Sanitizer infrastructure Kernel Concurrency Sanitizer (KCSAN) is a dynamic data-race detector for kernel space. KCSAN is a sampling watchpoint-based data-race detector. See the included Documentation/dev-tools/kcsan.rst for more details. This patch adds basic infrastructure, but does not yet enable KCSAN for any architecture. Signed-off-by: Marco Elver Acked-by: Paul E. McKenney Signed-off-by: Paul E. McKenney